[mbsystem] 01/01: Since the packaging just had started in Debian GIS I merged the work from the Debian life packaging workshop at DebConf 15 to

Andreas Tille tille at debian.org
Thu Aug 20 13:30:14 UTC 2015


This is an automated email from the git hooks/post-receive script.

tille pushed a commit to branch master
in repository mbsystem.

commit 4c3862d4d8609bf7a392dfc541eca1d8d10de326
Author: Andreas Tille <tille at debian.org>
Date:   Thu Aug 20 15:29:50 2015 +0200

    Since the packaging just had started in Debian GIS I merged the work from the Debian life packaging workshop at DebConf 15 to
    
       Vcs-Browser: http://anonscm.debian.org/cgit/pkg-grass/mbsystem.git
       Vcs-Git: git://anonscm.debian.org/pkg-grass/mbsystem.git
    
    Please keep on working there.
---
 AUTHORS                                     |    51 -
 COPYING                                     |    81 -
 ChangeLog                                   |  3746 ------
 GPL                                         |   671 -
 INSTALL                                     |   370 -
 Makefile.am                                 |     3 -
 Makefile.in                                 |   818 --
 NEWS                                        |    13 -
 NOTES                                       |   295 -
 README                                      |   457 -
 README.status                               |     7 +
 ar-lib                                      |   270 -
 config.guess                                |  1568 ---
 config.sub                                  |  1793 ---
 configure                                   | 17705 -------------------------
 configure.ac                                |   878 --
 configure.ac.save                           |   869 --
 configure.cmd                               |   283 -
 configureGMT5.cmd                           |    15 -
 debian/changelog                            |     5 -
 debian/compat                               |     1 -
 debian/control                              |    36 -
 debian/copyright                            |    11 -
 debian/createmanpages                       |    16 -
 debian/doc-base                             |    20 -
 debian/rules                                |    26 -
 debian/source/format                        |     1 -
 debian/upstream/metadata                    |    12 -
 debian/watch                                |     3 -
 depcomp                                     |   791 --
 html/ChayesJul2003.gif                      |   Bin 19022 -> 0 bytes
 html/MBTeamJul2003.gif                      |   Bin 146993 -> 0 bytes
 html/ValJul2003.gif                         |   Bin 20392 -> 0 bytes
 html/caress2001.gif                         |   Bin 14069 -> 0 bytes
 html/gpl.html                               |   604 -
 html/index.html                             |   312 -
 html/mbsystem.html                          |  1681 ---
 html/mbsystem_capabilities.html             |   254 -
 html/mbsystem_copyright.html                |   123 -
 html/mbsystem_faq.html                      |   433 -
 html/mbsystem_formats.html                  |  1141 --
 html/mbsystem_future.html                   |   122 -
 html/mbsystem_home.html                     |   312 -
 html/mbsystem_how_to_get.html               |   580 -
 html/mbsystem_logo.gif                      |   Bin 66436 -> 0 bytes
 html/mbsystem_logo_small.gif                |   Bin 6158 -> 0 bytes
 html/mbsystem_man_list.html                 |   267 -
 html/mbsystem_whatsnew.html                 |   393 -
 install-sh                                  |   527 -
 libtool                                     | 11642 -----------------
 ltmain.sh                                   | 11147 ----------------
 missing                                     |   215 -
 src/Makefile.am                             |    15 -
 src/Makefile.in                             |   650 -
 src/bsio/Makefile.am                        |    16 -
 src/bsio/Makefile.in                        |   713 -
 src/bsio/bs.3                               |   684 -
 src/bsio/bs2asc.1                           |   104 -
 src/bsio/bs2asc.c                           |   900 --
 src/bsio/bsfile.4                           |   622 -
 src/bsio/mbbs.h                             |   154 -
 src/bsio/mbbs_defines.h                     |   563 -
 src/bsio/mbbs_io.c                          |  1432 --
 src/bsio/mbbs_iomrv1.c                      |   235 -
 src/bsio/mbbs_iomrv2.c                      |   233 -
 src/bsio/mbbs_mem.h                         |    74 -
 src/bsio/mbbs_memalloc.c                    |   134 -
 src/bsio/mbbs_misc.c                        |   655 -
 src/bsio/mbbs_swapbytes.c                   |    66 -
 src/bsio/mbbs_tm.c                          |   343 -
 src/bsio/mbbs_utils.c                       |   268 -
 src/bsio/mbbs_wrhdrfields.c                 |   421 -
 src/bsio/mbbs_wrsampflags.c                 |   182 -
 src/gmt/Makefile.am                         |    15 -
 src/gmt/Makefile.in                         |   709 -
 src/gmt/common_byteswap.h                   |   135 -
 src/gmt/common_math.h                       |   107 -
 src/gmt/common_runpath.h                    |    59 -
 src/gmt/common_sighandler.h                 |    34 -
 src/gmt/common_string.h                     |    88 -
 src/gmt/gmt_calclock.h                      |    68 -
 src/gmt/gmt_colors.h                        |    60 -
 src/gmt/gmt_common.h                        |   187 -
 src/gmt/gmt_config.h                        |     0
 src/gmt/gmt_constants.h                     |   224 -
 src/gmt/gmt_contour.h                       |   158 -
 src/gmt/gmt_core_module.h                   |   114 -
 src/gmt/gmt_crossing.h                      |    40 -
 src/gmt/gmt_customio.h                      |    55 -
 src/gmt/gmt_dcw.h                           |    55 -
 src/gmt/gmt_defaults.h                      |   170 -
 src/gmt/gmt_define.h                        |    45 -
 src/gmt/gmt_dev.h                           |   146 -
 src/gmt/gmt_dimensions.h                    |    29 -
 src/gmt/gmt_error.h                         |   139 -
 src/gmt/gmt_error_codes.h                   |   107 -
 src/gmt/gmt_fft.h                           |   102 -
 src/gmt/gmt_gdalread.h                      |   177 -
 src/gmt/gmt_grd.h                           |   193 -
 src/gmt/gmt_grdio.h                         |   157 -
 src/gmt/gmt_hash.h                          |    48 -
 src/gmt/gmt_init.h                          |   118 -
 src/gmt/gmt_internals.h                     |   282 -
 src/gmt/gmt_io.h                            |   350 -
 src/gmt/gmt_macros.h                        |   109 -
 src/gmt/gmt_map.h                           |    68 -
 src/gmt/gmt_media_name.h                    |    31 -
 src/gmt/gmt_media_size.h                    |    31 -
 src/gmt/gmt_memory.h                        |    92 -
 src/gmt/gmt_mgg_header2.h                   |    41 -
 src/gmt/gmt_nan.h                           |    50 -
 src/gmt/gmt_notposix.h                      |   570 -
 src/gmt/gmt_option.h                        |    87 -
 src/gmt/gmt_pennames.h                      |    12 -
 src/gmt/gmt_plot.h                          |   188 -
 src/gmt/gmt_private.h                       |   165 -
 src/gmt/gmt_project.h                       |   482 -
 src/gmt/gmt_prototypes.h                    |   448 -
 src/gmt/gmt_ps.h                            |    61 -
 src/gmt/gmt_resources.h                     |   678 -
 src/gmt/gmt_sharedlibs.h                    |    37 -
 src/gmt/gmt_shore.h                         |   240 -
 src/gmt/gmt_sph.h                           |    60 -
 src/gmt/gmt_stat.h                          |    77 -
 src/gmt/gmt_supplements_module.h            |    73 -
 src/gmt/gmt_support.h                       |    61 -
 src/gmt/gmt_symbol.h                        |   113 -
 src/gmt/gmt_synopsis.h                      |    75 -
 src/gmt/gmt_texture.h                       |    67 -
 src/gmt/gmt_time.h                          |    48 -
 src/gmt/gmt_types.h                         |   216 -
 src/gmt/gmt_unique.h                        |    69 -
 src/gmt/gmt_version.h                       |    63 -
 src/gmt/mbcontour.c                         |  1532 ---
 src/gmt/mbgrdtiff.c                         |  1548 ---
 src/gmt/mbswath.c                           |  2729 ----
 src/gmt/pslib.h                             |   405 -
 src/gsf/LGPL_2-1.pdf                        |   Bin 61625 -> 0 bytes
 src/gsf/Makefile.am                         |    10 -
 src/gsf/Makefile.in                         |   703 -
 src/gsf/dump_gsf.c                          |   489 -
 src/gsf/gsf.c                               |  9450 --------------
 src/gsf/gsf.c.orig                          |  9450 --------------
 src/gsf/gsf.c.rej                           |    17 -
 src/gsf/gsf.h                               |  2926 -----
 src/gsf/gsf.h.orig                          |  2895 ----
 src/gsf/gsf.h.rej                           |    65 -
 src/gsf/gsf_dec.c                           |  7891 -----------
 src/gsf/gsf_dec.h                           |    58 -
 src/gsf/gsf_enc.c                           |  8454 ------------
 src/gsf/gsf_enc.h                           |    58 -
 src/gsf/gsf_ft.h                            |   114 -
 src/gsf/gsf_geo.c                           |   269 -
 src/gsf/gsf_indx.c                          |  2194 ----
 src/gsf/gsf_indx.h                          |   120 -
 src/gsf/gsf_info.c                          |   783 --
 src/gsf/gsf_lib.pdf                         |   Bin 453277 -> 0 bytes
 src/gsf/gsf_spec.pdf                        |   Bin 726687 -> 0 bytes
 src/html/ChangeLog.txt                      |  3746 ------
 src/html/ChayesJul2003.gif                  |   Bin 19022 -> 0 bytes
 src/html/Christina_d_S_Ferreira_crop.jpg    |   Bin 817139 -> 0 bytes
 src/html/KrystleAnderson2013.gif            |   Bin 12909 -> 0 bytes
 src/html/MBTeamJul2003.gif                  |   Bin 146993 -> 0 bytes
 src/html/MBTeamJul2003.jpg                  |   Bin 282307 -> 0 bytes
 src/html/Makefile.am                        |   101 -
 src/html/Makefile.in                        |   618 -
 src/html/ValJul2003.gif                     |   Bin 20392 -> 0 bytes
 src/html/caress.gif                         |   Bin 9809 -> 0 bytes
 src/html/caress2001.gif                     |   Bin 14069 -> 0 bytes
 src/html/caress_chayes_ferreira_Feb2014.jpg |   Bin 143883 -> 0 bytes
 src/html/chayes.gif                         |   Bin 7901 -> 0 bytes
 src/html/gpl.html                           |   604 -
 src/html/index.html                         |   312 -
 src/html/lamont_logo.gif                    |   Bin 2252 -> 0 bytes
 src/html/lamont_masthead.gif                |   Bin 2252 -> 0 bytes
 src/html/make_mbhtml                        |   220 -
 src/html/man2html                           |   Bin 78440 -> 0 bytes
 src/html/man2html.c                         |  4270 ------
 src/html/mb7k2jstar.html                    |   386 -
 src/html/mb7k2ss.html                       |   452 -
 src/html/mb7kpreprocess.html                |   346 -
 src/html/mbabsorption.html                  |   276 -
 src/html/mbareaclean.html                   |   381 -
 src/html/mbauvloglist.html                  |   492 -
 src/html/mbauvnavusbl.html                  |   154 -
 src/html/mbbackangle.html                   |   476 -
 src/html/mbclean.html                       |   590 -
 src/html/mbcontour.html                     |   591 -
 src/html/mbcopy.html                        |   316 -
 src/html/mbctdlist.html                     |   281 -
 src/html/mbdatalist.html                    |   483 -
 src/html/mbdefaults.html                    |   332 -
 src/html/mbdumpesf.html                     |   192 -
 src/html/mbedit.html                        |  1059 --
 src/html/mbeditviz.html                     |   229 -
 src/html/mbextractsegy.html                 |   440 -
 src/html/mbfilter.html                      |   440 -
 src/html/mbformat.html                      |   212 -
 src/html/mbformat.txt                       |   540 -
 src/html/mbgetesf.html                      |   213 -
 src/html/mbgrdtiff.html                     |   249 -
 src/html/mbgrdviz.html                      |   719 -
 src/html/mbgrid.html                        |  8425 ------------
 src/html/mbhistogram.html                   |   355 -
 src/html/mbhsdump.html                      |   160 -
 src/html/mbhysweeppreprocess.html           |   412 -
 src/html/mbinfo.html                        |   564 -
 src/html/mbio.html                          |  4213 ------
 src/html/mbkongsbergpreprocess.html         |   402 -
 src/html/mblevitus.html                     |   300 -
 src/html/mblist.html                        |   846 --
 src/html/mbm_arc2grd.html                   |   153 -
 src/html/mbm_bpr.html                       |   312 -
 src/html/mbm_copy.html                      |   210 -
 src/html/mbm_grd2arc.html                   |   196 -
 src/html/mbm_grd2geovrml.html               |   529 -
 src/html/mbm_grd3dplot.html                 |  1146 --
 src/html/mbm_grdcut.html                    |   180 -
 src/html/mbm_grdinfo.html                   |   148 -
 src/html/mbm_grdplot.html                   |  1641 ---
 src/html/mbm_grdtiff.html                   |   862 --
 src/html/mbm_grid.html                      |   645 -
 src/html/mbm_histplot.html                  |   418 -
 src/html/mbm_makedatalist.html              |   163 -
 src/html/mbm_makesvp.html                   |   184 -
 src/html/mbm_multicopy.html                 |   236 -
 src/html/mbm_multidatalist.html             |   224 -
 src/html/mbm_multiprocess.html              |   200 -
 src/html/mbm_plot.html                      |  1586 ---
 src/html/mbm_route2mission.html             |   527 -
 src/html/mbm_stat.html                      |   122 -
 src/html/mbm_utm.html                       |   161 -
 src/html/mbm_xbt.html                       |   163 -
 src/html/mbm_xyplot.html                    |   974 --
 src/html/mbmosaic.html                      |  8591 ------------
 src/html/mbnavadjust.html                   |  1682 ---
 src/html/mbnavadjustmerge.html              |   373 -
 src/html/mbnavedit.html                     |   835 --
 src/html/mbnavlist.html                     |   521 -
 src/html/mbneptune2esf.html                 |   277 -
 src/html/mbotps.html                        |   457 -
 src/html/mbpreprocess.html                  |   135 -
 src/html/mbprocess.html                     |  1502 ---
 src/html/mbps.html                          |   285 -
 src/html/mbrollbias.html                    |   229 -
 src/html/mbrolltimelag.html                 |   283 -
 src/html/mbroutetime.html                   |   271 -
 src/html/mbsegygrid.html                    |   425 -
 src/html/mbsegyinfo.html                    |   199 -
 src/html/mbsegylist.html                    |   301 -
 src/html/mbsegypsd.html                     |   316 -
 src/html/mbset.html                         |  1296 --
 src/html/mbstripnan.html                    |   125 -
 src/html/mbsvplist.html                     |   287 -
 src/html/mbsvpselect.html                   |   336 -
 src/html/mbswath.html                       |   629 -
 src/html/mbswplspreprocess.html             |   278 -
 src/html/mbsystem.html                      |  1681 ---
 src/html/mbsystem_capabilities.html         |   254 -
 src/html/mbsystem_copyright.html            |   123 -
 src/html/mbsystem_faq.html                  |   433 -
 src/html/mbsystem_formats.html              |  1141 --
 src/html/mbsystem_future.html               |   122 -
 src/html/mbsystem_home.html                 |   312 -
 src/html/mbsystem_how_to_get.html           |   492 -
 src/html/mbsystem_logo.gif                  |   Bin 66436 -> 0 bytes
 src/html/mbsystem_logo_small.gif            |   Bin 6158 -> 0 bytes
 src/html/mbsystem_man_ftr.frag              |     7 -
 src/html/mbsystem_man_hdr.frag              |     3 -
 src/html/mbsystem_man_hdr2.frag             |     8 -
 src/html/mbsystem_man_list.html             |   267 -
 src/html/mbsystem_version.txt               |     2 -
 src/html/mbsystem_whatsnew.html             |   409 -
 src/html/mbtime.html                        |   152 -
 src/html/mbvelocitytool.html                |   459 -
 src/html/schmidt.gif                        |   Bin 29499 -> 0 bytes
 src/macros/Makefile.am                      |    24 -
 src/macros/Makefile.in                      |   553 -
 src/macros/mbm_arc2grd                      |   230 -
 src/macros/mbm_bpr                          |   279 -
 src/macros/mbm_copy                         |   243 -
 src/macros/mbm_dslnavfix                    |   642 -
 src/macros/mbm_fmtvel                       |   274 -
 src/macros/mbm_grd2arc                      |   346 -
 src/macros/mbm_grd2geovrml                  |   693 -
 src/macros/mbm_grd3dplot                    |  3171 -----
 src/macros/mbm_grdcut                       |   355 -
 src/macros/mbm_grdinfo                      |   405 -
 src/macros/mbm_grdplot                      |  4049 ------
 src/macros/mbm_grdtiff                      |  2149 ---
 src/macros/mbm_grid                         |   960 --
 src/macros/mbm_histplot                     |  1736 ---
 src/macros/mbm_makedatalist                 |   213 -
 src/macros/mbm_makesvp                      |   285 -
 src/macros/mbm_multicopy                    |   258 -
 src/macros/mbm_multidatalist                |   185 -
 src/macros/mbm_multiprocess                 |   174 -
 src/macros/mbm_plot                         |  3708 ------
 src/macros/mbm_rollerror                    |   205 -
 src/macros/mbm_route2mission                |  2711 ----
 src/macros/mbm_stat                         |   211 -
 src/macros/mbm_utm                          |   522 -
 src/macros/mbm_vrefcheck                    |   240 -
 src/macros/mbm_xbt                          |   520 -
 src/macros/mbm_xyplot                       |  2250 ----
 src/man/Makefile.am                         |     1 -
 src/man/Makefile.in                         |   641 -
 src/man/man1/Makefile                       |   627 -
 src/man/man1/Makefile.am                    |    93 -
 src/man/man1/Makefile.in                    |   627 -
 src/man/man1/geod.1                         |   206 -
 src/man/man1/mb7k2jstar.1                   |   291 -
 src/man/man1/mb7k2ss.1                      |   354 -
 src/man/man1/mb7kpreprocess.1               |   243 -
 src/man/man1/mbabsorption.1                 |   183 -
 src/man/man1/mbareaclean.1                  |   289 -
 src/man/man1/mbauvloglist.1                 |   394 -
 src/man/man1/mbauvnavusbl.1                 |    78 -
 src/man/man1/mbbackangle.1                  |   387 -
 src/man/man1/mbclean.1                      |   475 -
 src/man/man1/mbcontour.1                    |   452 -
 src/man/man1/mbcopy.1                       |   220 -
 src/man/man1/mbctdlist.1                    |   195 -
 src/man/man1/mbdatalist.1                   |   381 -
 src/man/man1/mbdefaults.1                   |   234 -
 src/man/man1/mbdumpesf.1                    |   118 -
 src/man/man1/mbedit.1                       |   873 --
 src/man/man1/mbeditviz.1                    |   153 -
 src/man/man1/mbextractsegy.1                |   335 -
 src/man/man1/mbfilter.1                     |   344 -
 src/man/man1/mbformat.1                     |   126 -
 src/man/man1/mbgetesf.1                     |   139 -
 src/man/man1/mbgrdtiff.1                    |   169 -
 src/man/man1/mbgrdviz.1                     |   457 -
 src/man/man1/mbgrid.1                       |  8302 ------------
 src/man/man1/mbhistogram.1                  |   256 -
 src/man/man1/mbhsdump.1                     |    85 -
 src/man/man1/mbhysweeppreprocess.1          |   322 -
 src/man/man1/mbinfo.1                       |   466 -
 src/man/man1/mbkongsbergpreprocess.1        |   311 -
 src/man/man1/mblevitus.1                    |   224 -
 src/man/man1/mblist.1                       |   731 --
 src/man/man1/mbm_arc2grd.1                  |    79 -
 src/man/man1/mbm_bpr.1                      |   218 -
 src/man/man1/mbm_copy.1                     |   130 -
 src/man/man1/mbm_dslnavfix.1                |   184 -
 src/man/man1/mbm_fmtvel.1                   |    52 -
 src/man/man1/mbm_grd2arc.1                  |   119 -
 src/man/man1/mbm_grd2geovrml.1              |   408 -
 src/man/man1/mbm_grd3dplot.1                |   952 --
 src/man/man1/mbm_grdcut.1                   |   106 -
 src/man/man1/mbm_grdinfo.1                  |    77 -
 src/man/man1/mbm_grdplot.1                  |  1375 --
 src/man/man1/mbm_grdtiff.1                  |   673 -
 src/man/man1/mbm_grid.1                     |   522 -
 src/man/man1/mbm_histplot.1                 |   329 -
 src/man/man1/mbm_makedatalist.1             |    85 -
 src/man/man1/mbm_makesvp.1                  |   106 -
 src/man/man1/mbm_multicopy.1                |   152 -
 src/man/man1/mbm_multidatalist.1            |   143 -
 src/man/man1/mbm_multiprocess.1             |   123 -
 src/man/man1/mbm_plot.1                     |  1356 --
 src/man/man1/mbm_route2mission.1            |   427 -
 src/man/man1/mbm_stat.1                     |    53 -
 src/man/man1/mbm_utm.1                      |    98 -
 src/man/man1/mbm_vrefcheck.1                |   100 -
 src/man/man1/mbm_xbt.1                      |    82 -
 src/man/man1/mbm_xyplot.1                   |   796 --
 src/man/man1/mbmosaic.1                     |  8454 ------------
 src/man/man1/mbnavadjust.1                  |  1403 --
 src/man/man1/mbnavadjustmerge.1             |   279 -
 src/man/man1/mbnavedit.1                    |   671 -
 src/man/man1/mbnavlist.1                    |   417 -
 src/man/man1/mbneptune2esf.1                |   196 -
 src/man/man1/mbotps.1                       |   350 -
 src/man/man1/mbpreprocess.1                 |    68 -
 src/man/man1/mbprocess.1                    |  1413 --
 src/man/man1/mbps.1                         |   185 -
 src/man/man1/mbrollbias.1                   |   149 -
 src/man/man1/mbrolltimelag.1                |   199 -
 src/man/man1/mbroutetime.1                  |   201 -
 src/man/man1/mbsegygrid.1                   |   335 -
 src/man/man1/mbsegyinfo.1                   |   124 -
 src/man/man1/mbsegylist.1                   |   218 -
 src/man/man1/mbsegypsd.1                    |   227 -
 src/man/man1/mbset.1                        |  1217 --
 src/man/man1/mbstripnan.1                   |    70 -
 src/man/man1/mbsvplist.1                    |   200 -
 src/man/man1/mbsvpselect.1                  |   256 -
 src/man/man1/mbswath.1                      |   483 -
 src/man/man1/mbswplspreprocess.1            |   180 -
 src/man/man1/mbsystem.1                     |  1515 ---
 src/man/man1/mbtime.1                       |    78 -
 src/man/man1/mbvelocitytool.1               |   358 -
 src/man/man1/proj.1                         |   303 -
 src/man/man3/Makefile                       |   543 -
 src/man/man3/Makefile.am                    |     8 -
 src/man/man3/Makefile.in                    |   543 -
 src/man/man3/mbio.3                         |  3999 ------
 src/man/man3/pj_init.3                      |   111 -
 src/man/whatis                              |    82 -
 src/mbaux/Makefile.am                       |    28 -
 src/mbaux/Makefile.in                       |   736 --
 src/mbaux/mb_aux.h                          |   402 -
 src/mbaux/mb_cheb.c                         |   603 -
 src/mbaux/mb_delaun.c                       |   565 -
 src/mbaux/mb_intersectgrid.c                |   687 -
 src/mbaux/mb_readwritegrd.c                 |   629 -
 src/mbaux/mb_spline.c                       |   529 -
 src/mbaux/mb_surface.c                      |  1652 ---
 src/mbaux/mb_track.c                        |   372 -
 src/mbaux/mb_truecont.c                     |  2082 ---
 src/mbaux/mb_xgraphics.c                    |   393 -
 src/mbaux/mb_xgraphics.h                    |    67 -
 src/mbaux/mb_zgrid.c                        |  1068 --
 src/mbedit/Makefile.am                      |    20 -
 src/mbedit/Makefile.in                      |   671 -
 src/mbedit/mbedit.c                         |   167 -
 src/mbedit/mbedit.h                         |   507 -
 src/mbedit/mbedit.uil                       |  4378 -------
 src/mbedit/mbedit_bxutils.c                 |  3926 ------
 src/mbedit/mbedit_callbacks.c               |  3390 -----
 src/mbedit/mbedit_creation.c                |  4619 -------
 src/mbedit/mbedit_creation.h                |   138 -
 src/mbedit/mbedit_prog.c                    |  7300 -----------
 src/mbeditviz/Makefile.am                   |    24 -
 src/mbeditviz/Makefile.in                   |   683 -
 src/mbeditviz/mbeditviz.h                   |   332 -
 src/mbeditviz/mbeditviz.uil                 |  1897 ---
 src/mbeditviz/mbeditviz_callbacks.c         |  2362 ----
 src/mbeditviz/mbeditviz_creation.c          |  1721 ---
 src/mbeditviz/mbeditviz_creation.h          |    63 -
 src/mbeditviz/mbeditviz_main.c              |   240 -
 src/mbeditviz/mbeditviz_prog.c              |  4460 -------
 src/mbgrdviz/Makefile.am                    |    24 -
 src/mbgrdviz/Makefile.in                    |   680 -
 src/mbgrdviz/mbgrdviz.uil                   |  2992 -----
 src/mbgrdviz/mbgrdviz_callbacks.c           |  7499 -----------
 src/mbgrdviz/mbgrdviz_creation.c            |  2447 ----
 src/mbgrdviz/mbgrdviz_creation.h            |    92 -
 src/mbgrdviz/mbgrdviz_main.c                |   412 -
 src/mbio/Makefile.am                        |   150 -
 src/mbio/Makefile.in                        |  1042 --
 src/mbio/mb_absorption.c                    |   197 -
 src/mbio/mb_access.c                        |  2673 ----
 src/mbio/mb_angle.c                         |   827 --
 src/mbio/mb_buffer.c                        |  1500 ---
 src/mbio/mb_check_info.c                    |  1733 ---
 src/mbio/mb_close.c                         |   144 -
 src/mbio/mb_compare.c                       |    89 -
 src/mbio/mb_config.h                        |   108 -
 src/mbio/mb_config.h.in                     |   107 -
 src/mbio/mb_coor_scale.c                    |   221 -
 src/mbio/mb_defaults.c                      |   693 -
 src/mbio/mb_define.h                        |   826 --
 src/mbio/mb_error.c                         |   379 -
 src/mbio/mb_esf.c                           |  1180 --
 src/mbio/mb_fileio.c                        |   264 -
 src/mbio/mb_format.c                        |  4827 -------
 src/mbio/mb_format.h                        |  2039 ---
 src/mbio/mb_get.c                           |  1056 --
 src/mbio/mb_get_all.c                       |   691 -
 src/mbio/mb_get_value.c                     |   361 -
 src/mbio/mb_info.h                          |   123 -
 src/mbio/mb_io.h                            |   543 -
 src/mbio/mb_mem.c                           |  1573 ---
 src/mbio/mb_navint.c                        |  3296 -----
 src/mbio/mb_platform.c                      |  1415 --
 src/mbio/mb_process.c                       |  6071 ---------
 src/mbio/mb_process.h                       |  1281 --
 src/mbio/mb_proj.c                          |   333 -
 src/mbio/mb_put_all.c                       |   242 -
 src/mbio/mb_put_comment.c                   |   128 -
 src/mbio/mb_read.c                          |  1100 --
 src/mbio/mb_read_init.c                     |   760 --
 src/mbio/mb_read_ping.c                     |   121 -
 src/mbio/mb_rt.c                            |  1238 --
 src/mbio/mb_segy.c                          |  1277 --
 src/mbio/mb_segy.h                          |   233 -
 src/mbio/mb_status.h                        |   480 -
 src/mbio/mb_swap.c                          |   125 -
 src/mbio/mb_swap.h                          |    83 -
 src/mbio/mb_time.c                          |   524 -
 src/mbio/mb_write_init.c                    |   679 -
 src/mbio/mb_write_ping.c                    |   187 -
 src/mbio/mbf_bchrtunb.h                     |   216 -
 src/mbio/mbf_bchrxunb.h                     |   204 -
 src/mbio/mbf_cbat8101.h                     |   547 -
 src/mbio/mbf_cbat9001.h                     |   233 -
 src/mbio/mbf_dsl120pf.h                     |   190 -
 src/mbio/mbf_dsl120sf.h                     |   190 -
 src/mbio/mbf_elmk2unb.h                     |   198 -
 src/mbio/mbf_em12darw.h                     |   127 -
 src/mbio/mbf_em12ifrm.h                     |   265 -
 src/mbio/mbf_gsfgenmb.h                     |    46 -
 src/mbio/mbf_hs10jams.h                     |   150 -
 src/mbio/mbf_hsatlraw.h                     |   223 -
 src/mbio/mbf_hsldedmb.h                     |   122 -
 src/mbio/mbf_hsldeoih.h                     |   502 -
 src/mbio/mbf_hsmdaraw.h                     |   305 -
 src/mbio/mbf_hsmdldih.h                     |   300 -
 src/mbio/mbf_hsuricen.h                     |   114 -
 src/mbio/mbf_hypc8101.h                     |   576 -
 src/mbio/mbf_mbarirov.h                     |    91 -
 src/mbio/mbf_mbarrov2.h                     |    70 -
 src/mbio/mbf_mbpronav.h                     |    64 -
 src/mbio/mbf_mgd77dat.h                     |   187 -
 src/mbio/mbf_mr1aldeo.h                     |   143 -
 src/mbio/mbf_mr1bldeo.h                     |   145 -
 src/mbio/mbf_mr1prhig.h                     |   148 -
 src/mbio/mbf_mstiffss.h                     |   232 -
 src/mbio/mbf_oicgeoda.h                     |   208 -
 src/mbio/mbf_oicmbari.h                     |   213 -
 src/mbio/mbf_omghdcsj.h                     |   762 --
 src/mbio/mbf_sb2100rw.h                     |   235 -
 src/mbio/mbf_sb2120xs.h                     |   309 -
 src/mbio/mbf_sbifremr.h                     |   117 -
 src/mbio/mbf_sbsiocen.h                     |   122 -
 src/mbio/mbf_sbsiolsi.h                     |   121 -
 src/mbio/mbf_sbsiomrg.h                     |   132 -
 src/mbio/mbf_sbsioswb.h                     |   122 -
 src/mbio/mbf_sburicen.h                     |   122 -
 src/mbio/mbf_xtfr8101.h                     |   615 -
 src/mbio/mbr_3ddepthp.c                     |  1410 --
 src/mbio/mbr_asciixyz.c                     |  1305 --
 src/mbio/mbr_bchrtunb.c                     |  3769 ------
 src/mbio/mbr_bchrxunb.c                     |  3736 ------
 src/mbio/mbr_cbat8101.c                     |  3193 -----
 src/mbio/mbr_cbat9001.c                     |  2796 ----
 src/mbio/mbr_dsl120pf.c                     |  2137 ---
 src/mbio/mbr_dsl120sf.c                     |  1855 ---
 src/mbio/mbr_edgjstar.c                     |  3802 ------
 src/mbio/mbr_elmk2unb.c                     |  2835 ----
 src/mbio/mbr_em12darw.c                     |  1145 --
 src/mbio/mbr_em12ifrm.c                     |  1866 ---
 src/mbio/mbr_em300mba.c                     |  9435 -------------
 src/mbio/mbr_em300raw.c                     |  9720 --------------
 src/mbio/mbr_em710mba.c                     | 10658 ---------------
 src/mbio/mbr_em710raw.c                     | 10298 ---------------
 src/mbio/mbr_emoldraw.c                     |  4955 -------
 src/mbio/mbr_gsfgenmb.c                     |   777 --
 src/mbio/mbr_hir2rnav.c                     |   631 -
 src/mbio/mbr_hs10jams.c                     |   788 --
 src/mbio/mbr_hsatlraw.c                     |  3896 ------
 src/mbio/mbr_hsds2lam.c                     |  1208 --
 src/mbio/mbr_hsds2raw.c                     |  1774 ---
 src/mbio/mbr_hsldedmb.c                     |   848 --
 src/mbio/mbr_hsldeoih.c                     |  4047 ------
 src/mbio/mbr_hsmdaraw.c                     |  2177 ---
 src/mbio/mbr_hsmdldih.c                     |  2177 ---
 src/mbio/mbr_hsunknwn.c                     |   770 --
 src/mbio/mbr_hsuricen.c                     |   867 --
 src/mbio/mbr_hsurivax.c                     |   854 --
 src/mbio/mbr_hydrob93.c                     |   608 -
 src/mbio/mbr_hypc8101.c                     |  1588 ---
 src/mbio/mbr_hysweep1.c                     |  4077 ------
 src/mbio/mbr_image83p.c                     |  1110 --
 src/mbio/mbr_imagemba.c                     |  1071 --
 src/mbio/mbr_l3xseraw.c                     |  7810 -----------
 src/mbio/mbr_mbarirov.c                     |   995 --
 src/mbio/mbr_mbarrov2.c                     |   938 --
 src/mbio/mbr_mbldeoih.c                     |  1481 ---
 src/mbio/mbr_mbnetcdf.c                     |  7189 ----------
 src/mbio/mbr_mbpronav.c                     |   911 --
 src/mbio/mbr_mgd77dat.c                     |  1139 --
 src/mbio/mbr_mgd77tab.c                     |  2232 ----
 src/mbio/mbr_mgd77txt.c                     |  1191 --
 src/mbio/mbr_mr1aldeo.c                     |  1594 ---
 src/mbio/mbr_mr1bldeo.c                     |  1589 ---
 src/mbio/mbr_mr1prhig.c                     |  1623 ---
 src/mbio/mbr_mr1prvr2.c                     |  1100 --
 src/mbio/mbr_mstiffss.c                     |  1469 ---
 src/mbio/mbr_nvnetcdf.c                     |  2727 ----
 src/mbio/mbr_oicgeoda.c                     |  2134 ---
 src/mbio/mbr_oicmbari.c                     |  2045 ---
 src/mbio/mbr_omghdcsj.c                     |  7943 -----------
 src/mbio/mbr_photgram.c                     |  1098 --
 src/mbio/mbr_reson7kr.c                     | 18146 --------------------------
 src/mbio/mbr_samesurf.c                     |   949 --
 src/mbio/mbr_sb2000sb.c                     |  1209 --
 src/mbio/mbr_sb2000ss.c                     |  1277 --
 src/mbio/mbr_sb2100bi.c                     |  3015 -----
 src/mbio/mbr_sb2100rw.c                     |  2907 -----
 src/mbio/mbr_sbifremr.c                     |  1077 --
 src/mbio/mbr_sbsiocen.c                     |   743 --
 src/mbio/mbr_sbsiolsi.c                     |   743 --
 src/mbio/mbr_sbsiomrg.c                     |   909 --
 src/mbio/mbr_sbsioswb.c                     |  1304 --
 src/mbio/mbr_sburicen.c                     |   751 --
 src/mbio/mbr_sburivax.c                     |   765 --
 src/mbio/mbr_segysegy.c                     |   536 -
 src/mbio/mbr_swplssxi.c                     |   907 --
 src/mbio/mbr_swplssxp.c                     |   828 --
 src/mbio/mbr_tempform.c                     |   671 -
 src/mbio/mbr_wasspenl.c                     |  3152 -----
 src/mbio/mbr_xtfb1624.c                     |  2195 ----
 src/mbio/mbr_xtfr8101.c                     |  2412 ----
 src/mbio/mbsys_3datdepthlidar.c             |  2200 ----
 src/mbio/mbsys_3datdepthlidar.h             |   500 -
 src/mbio/mbsys_atlas.c                      |  1544 ---
 src/mbio/mbsys_atlas.h                      |  1406 --
 src/mbio/mbsys_benthos.c                    |  1398 --
 src/mbio/mbsys_benthos.h                    |   193 -
 src/mbio/mbsys_dsl.c                        |  1304 --
 src/mbio/mbsys_dsl.h                        |   257 -
 src/mbio/mbsys_elac.c                       |  1569 ---
 src/mbio/mbsys_elac.h                       |   330 -
 src/mbio/mbsys_elacmk2.c                    |  1790 ---
 src/mbio/mbsys_elacmk2.h                    |   302 -
 src/mbio/mbsys_gsf.c                        |  2709 ----
 src/mbio/mbsys_gsf.h                        |   164 -
 src/mbio/mbsys_hdcs.c                       |  1854 ---
 src/mbio/mbsys_hdcs.h                       |   484 -
 src/mbio/mbsys_hs10.c                       |  1177 --
 src/mbio/mbsys_hs10.h                       |   247 -
 src/mbio/mbsys_hsds.c                       |  1450 --
 src/mbio/mbsys_hsds.h                       |   299 -
 src/mbio/mbsys_hsmd.c                       |  1397 --
 src/mbio/mbsys_hsmd.h                       |   274 -
 src/mbio/mbsys_hysweep.c                    |  2743 ----
 src/mbio/mbsys_hysweep.h                    |   917 --
 src/mbio/mbsys_image83p.c                   |  1101 --
 src/mbio/mbsys_image83p.h                   |   149 -
 src/mbio/mbsys_jstar.c                      |  3432 -----
 src/mbio/mbsys_jstar.h                      |   547 -
 src/mbio/mbsys_ldeoih.c                     |  1634 ---
 src/mbio/mbsys_ldeoih.h                     |   263 -
 src/mbio/mbsys_mr1.c                        |  1411 --
 src/mbio/mbsys_mr1.h                        |   227 -
 src/mbio/mbsys_mr1b.c                       |  1384 --
 src/mbio/mbsys_mr1b.h                       |   214 -
 src/mbio/mbsys_mr1v2001.c                   |  1783 ---
 src/mbio/mbsys_mr1v2001.h                   |   151 -
 src/mbio/mbsys_mstiff.c                     |   986 --
 src/mbio/mbsys_mstiff.h                     |   222 -
 src/mbio/mbsys_navnetcdf.c                  |  1777 ---
 src/mbio/mbsys_navnetcdf.h                  |   409 -
 src/mbio/mbsys_netcdf.c                     |  3799 ------
 src/mbio/mbsys_netcdf.h                     |  1108 --
 src/mbio/mbsys_oic.c                        |  1622 ---
 src/mbio/mbsys_oic.h                        |   310 -
 src/mbio/mbsys_reson.c                      |  1747 ---
 src/mbio/mbsys_reson.h                      |   675 -
 src/mbio/mbsys_reson7k.c                    | 10475 ---------------
 src/mbio/mbsys_reson7k.h                    |  2737 ----
 src/mbio/mbsys_reson8k.c                    |  1937 ---
 src/mbio/mbsys_reson8k.h                    |   281 -
 src/mbio/mbsys_sb.c                         |  1267 --
 src/mbio/mbsys_sb.h                         |   194 -
 src/mbio/mbsys_sb2000.c                     |  1302 --
 src/mbio/mbsys_sb2000.h                     |   243 -
 src/mbio/mbsys_sb2100.c                     |  1585 ---
 src/mbio/mbsys_sb2100.h                     |   421 -
 src/mbio/mbsys_simrad.c                     |  3178 -----
 src/mbio/mbsys_simrad.h                     |  1483 ---
 src/mbio/mbsys_simrad2.c                    |  5356 --------
 src/mbio/mbsys_simrad2.h                    |  1136 --
 src/mbio/mbsys_simrad3.c                    |  3465 -----
 src/mbio/mbsys_simrad3.h                    |  1473 ---
 src/mbio/mbsys_singlebeam.c                 |  1423 --
 src/mbio/mbsys_singlebeam.h                 |   332 -
 src/mbio/mbsys_stereopair.c                 |  1575 ---
 src/mbio/mbsys_stereopair.h                 |   316 -
 src/mbio/mbsys_surf.c                       |  1578 ---
 src/mbio/mbsys_surf.h                       |   212 -
 src/mbio/mbsys_swathplus.c                  |  7019 ----------
 src/mbio/mbsys_swathplus.h                  |   745 --
 src/mbio/mbsys_templatesystem.c             |  1766 ---
 src/mbio/mbsys_templatesystem.h             |   236 -
 src/mbio/mbsys_wassp.c                      |  1814 ---
 src/mbio/mbsys_wassp.h                      |   774 --
 src/mbio/mbsys_xse.c                        |  2122 ---
 src/mbio/mbsys_xse.h                        |   803 --
 src/mbio/stamp-h1                           |     1 -
 src/mbnavadjust/Makefile.am                 |    23 -
 src/mbnavadjust/Makefile.in                 |   684 -
 src/mbnavadjust/Makefile.org                |    59 -
 src/mbnavadjust/mbnavadjust.c               |   176 -
 src/mbnavadjust/mbnavadjust.h               |   637 -
 src/mbnavadjust/mbnavadjust.uil             |  4136 ------
 src/mbnavadjust/mbnavadjust_callbacks.c     |  6222 ---------
 src/mbnavadjust/mbnavadjust_creation.c      |  4671 -------
 src/mbnavadjust/mbnavadjust_creation.h      |   145 -
 src/mbnavadjust/mbnavadjust_extrawidgets.h  |    56 -
 src/mbnavadjust/mbnavadjust_io.c            |  2293 ----
 src/mbnavadjust/mbnavadjust_io.h            |   316 -
 src/mbnavadjust/mbnavadjust_prog.c          | 17754 -------------------------
 src/mbnavadjust/mbnavadjust_prog.c.orig     | 17750 -------------------------
 src/mbnavadjust/mbnavadjust_util.c          |  3926 ------
 src/mbnavadjust/mbnavadjustmerge.c          |  2345 ----
 src/mbnavedit/Makefile.am                   |    22 -
 src/mbnavedit/Makefile.in                   |   672 -
 src/mbnavedit/mbnavedit.c                   |   167 -
 src/mbnavedit/mbnavedit.h                   |   281 -
 src/mbnavedit/mbnavedit.uil                 |  3749 ------
 src/mbnavedit/mbnavedit_callbacks.c         |  3393 -----
 src/mbnavedit/mbnavedit_creation.c          |  4173 ------
 src/mbnavedit/mbnavedit_creation.h          |   119 -
 src/mbnavedit/mbnavedit_extrawidgets.h      |    46 -
 src/mbnavedit/mbnavedit_prog.c              |  6900 ----------
 src/mbnavedit/mbnavedit_util.c              |  3928 ------
 src/mbvelocitytool/Makefile.am              |    21 -
 src/mbvelocitytool/Makefile.in              |   673 -
 src/mbvelocitytool/mbvelocity.c             |   173 -
 src/mbvelocitytool/mbvelocity.h             |   138 -
 src/mbvelocitytool/mbvelocity.uil           |  2029 ---
 src/mbvelocitytool/mbvelocity_bxutils.c     |  3927 ------
 src/mbvelocitytool/mbvelocity_callbacks.c   |  1456 ---
 src/mbvelocitytool/mbvelocity_creation.c    |  1917 ---
 src/mbvelocitytool/mbvelocity_creation.h    |    67 -
 src/mbvelocitytool/mbvelocity_prog.c        |  3158 -----
 src/mbview/MB3DNavList.c                    |   291 -
 src/mbview/MB3DNavList.h                    |    66 -
 src/mbview/MB3DRouteList.c                  |   291 -
 src/mbview/MB3DRouteList.h                  |    66 -
 src/mbview/MB3DSiteList.c                   |   292 -
 src/mbview/MB3DSiteList.h                   |    66 -
 src/mbview/MB3DView.c                       |  5174 --------
 src/mbview/MB3DView.h                       |   281 -
 src/mbview/MBpedit.c                        |  2623 ----
 src/mbview/MBpedit.h                        |   159 -
 src/mbview/Makefile.am                      |    32 -
 src/mbview/Makefile.in                      |   906 --
 src/mbview/Mb3dsdg.c                        |  1357 --
 src/mbview/Mb3dsdg.h                        |   107 -
 src/mbview/creation-c.h                     |    38 -
 src/mbview/mb3dsoundings.uil                |  1241 --
 src/mbview/mb3dsoundings_bxutils.c          |  4026 ------
 src/mbview/mb3dsoundings_callbacks.c        |  3685 ------
 src/mbview/mb3dsoundings_creation.c         |   128 -
 src/mbview/mb3dsoundings_creation.h         |    17 -
 src/mbview/mb3dsoundings_main.c             |   142 -
 src/mbview/mb3dsoundingsprivate.h           |   310 -
 src/mbview/mb_glwdrawa.c                    |   680 -
 src/mbview/mb_glwdrawa.h                    |   211 -
 src/mbview/mb_glwdrawap.h                   |   131 -
 src/mbview/mbpingedit.c                     |   150 -
 src/mbview/mbpingedit.uil                   |  2512 ----
 src/mbview/mbpingedit_bxutils.c             |  4026 ------
 src/mbview/mbpingedit_callbacks.c           |   539 -
 src/mbview/mbpingedit_creation.c            |   135 -
 src/mbview/mbpingedit_creation.h            |    37 -
 src/mbview/mbpingeditprivate.h              |   271 -
 src/mbview/mbview.h                         |  1181 --
 src/mbview/mbview.uil                       |  5313 --------
 src/mbview/mbview_bxutils.c                 |  4026 ------
 src/mbview/mbview_callbacks.c               |  9939 --------------
 src/mbview/mbview_nav.c                     |  2404 ----
 src/mbview/mbview_pick.c                    |  2556 ----
 src/mbview/mbview_plot.c                    |  3530 -----
 src/mbview/mbview_primary.c                 |   494 -
 src/mbview/mbview_process.c                 |  4885 -------
 src/mbview/mbview_profile.c                 |   872 --
 src/mbview/mbview_route.c                   |  2780 ----
 src/mbview/mbview_secondary.c               |   568 -
 src/mbview/mbview_site.c                    |  1476 ---
 src/mbview/mbview_vector.c                  |   972 --
 src/mbview/mbviewprivate.h                  |  1127 --
 src/otps/Makefile.am                        |    25 -
 src/otps/Makefile.in                        |   674 -
 src/otps/mbotps.c                           |   908 --
 src/proj/Makefile.am                        |   166 -
 src/proj/Makefile.in                        |  1105 --
 src/proj/PJ_aea.c                           |   162 -
 src/proj/PJ_aeqd.c                          |   271 -
 src/proj/PJ_airy.c                          |   124 -
 src/proj/PJ_aitoff.c                        |    76 -
 src/proj/PJ_august.c                        |    18 -
 src/proj/PJ_bacon.c                         |    41 -
 src/proj/PJ_bipc.c                          |   132 -
 src/proj/PJ_boggs.c                         |    32 -
 src/proj/PJ_bonne.c                         |    85 -
 src/proj/PJ_cass.c                          |    79 -
 src/proj/PJ_cc.c                            |    19 -
 src/proj/PJ_cea.c                           |    60 -
 src/proj/PJ_chamb.c                         |   112 -
 src/proj/PJ_collg.c                         |    29 -
 src/proj/PJ_crast.c                         |    22 -
 src/proj/PJ_denoy.c                         |    18 -
 src/proj/PJ_eck1.c                          |    19 -
 src/proj/PJ_eck2.c                          |    28 -
 src/proj/PJ_eck3.c                          |    50 -
 src/proj/PJ_eck4.c                          |    44 -
 src/proj/PJ_eck5.c                          |    18 -
 src/proj/PJ_eqc.c                           |    23 -
 src/proj/PJ_eqdc.c                          |    85 -
 src/proj/PJ_fahey.c                         |    17 -
 src/proj/PJ_fouc_s.c                        |    45 -
 src/proj/PJ_gall.c                          |    19 -
 src/proj/PJ_geos.c                          |   192 -
 src/proj/PJ_gins8.c                         |    17 -
 src/proj/PJ_gn_sinu.c                       |    98 -
 src/proj/PJ_gnom.c                          |   105 -
 src/proj/PJ_goode.c                         |    49 -
 src/proj/PJ_gstmerc.c                       |    48 -
 src/proj/PJ_hammer.c                        |    29 -
 src/proj/PJ_hatano.c                        |    50 -
 src/proj/PJ_healpix.c                       |   675 -
 src/proj/PJ_igh.c                           |   190 -
 src/proj/PJ_imw_p.c                         |   151 -
 src/proj/PJ_isea.c                          |  1134 --
 src/proj/PJ_krovak.c                        |   250 -
 src/proj/PJ_labrd.c                         |   109 -
 src/proj/PJ_laea.c                          |   233 -
 src/proj/PJ_lagrng.c                        |    35 -
 src/proj/PJ_larr.c                          |    12 -
 src/proj/PJ_lask.c                          |    26 -
 src/proj/PJ_lcc.c                           |   105 -
 src/proj/PJ_lcca.c                          |    72 -
 src/proj/PJ_loxim.c                         |    41 -
 src/proj/PJ_lsat.c                          |   171 -
 src/proj/PJ_mbt_fps.c                       |    38 -
 src/proj/PJ_mbtfpp.c                        |    32 -
 src/proj/PJ_mbtfpq.c                        |    47 -
 src/proj/PJ_merc.c                          |    47 -
 src/proj/PJ_mill.c                          |    15 -
 src/proj/PJ_mod_ster.c                      |   211 -
 src/proj/PJ_moll.c                          |    60 -
 src/proj/PJ_natearth.c                      |    77 -
 src/proj/PJ_nell.c                          |    29 -
 src/proj/PJ_nell_h.c                        |    30 -
 src/proj/PJ_nocol.c                         |    38 -
 src/proj/PJ_nsper.c                         |   149 -
 src/proj/PJ_nzmg.c                          |   107 -
 src/proj/PJ_ob_tran.c                       |   144 -
 src/proj/PJ_ocea.c                          |    68 -
 src/proj/PJ_oea.c                           |    58 -
 src/proj/PJ_omerc.c                         |   194 -
 src/proj/PJ_ortho.c                         |    95 -
 src/proj/PJ_poly.c                          |    99 -
 src/proj/PJ_putp2.c                         |    40 -
 src/proj/PJ_putp3.c                         |    26 -
 src/proj/PJ_putp4p.c                        |    29 -
 src/proj/PJ_putp5.c                         |    26 -
 src/proj/PJ_putp6.c                         |    59 -
 src/proj/PJ_robin.c                         |   105 -
 src/proj/PJ_rpoly.c                         |    35 -
 src/proj/PJ_sconics.c                       |   154 -
 src/proj/PJ_somerc.c                        |    66 -
 src/proj/PJ_stere.c                         |   241 -
 src/proj/PJ_sterea.c                        |    85 -
 src/proj/PJ_sts.c                           |    54 -
 src/proj/PJ_tcc.c                           |    17 -
 src/proj/PJ_tcea.c                          |    27 -
 src/proj/PJ_tmerc.c                         |   175 -
 src/proj/PJ_tpeqd.c                         |    76 -
 src/proj/PJ_urm5.c                          |    28 -
 src/proj/PJ_urmfps.c                        |    40 -
 src/proj/PJ_vandg.c                         |    78 -
 src/proj/PJ_vandg2.c                        |    45 -
 src/proj/PJ_vandg4.c                        |    41 -
 src/proj/PJ_wag2.c                          |    21 -
 src/proj/PJ_wag3.c                          |    24 -
 src/proj/PJ_wag7.c                          |    14 -
 src/proj/PJ_wink1.c                         |    20 -
 src/proj/PJ_wink2.c                         |    34 -
 src/proj/aasincos.c                         |    35 -
 src/proj/adjlon.c                           |    15 -
 src/proj/bch2bps.c                          |   140 -
 src/proj/bchgen.c                           |    58 -
 src/proj/biveval.c                          |    87 -
 src/proj/cs2cs.1                            |   202 -
 src/proj/cs2cs.c                            |   422 -
 src/proj/dmstor.c                           |   113 -
 src/proj/emess.c                            |    57 -
 src/proj/emess.h                            |    28 -
 src/proj/gen_cheb.c                         |    71 -
 src/proj/geocent.c                          |   435 -
 src/proj/geocent.h                          |   179 -
 src/proj/geod.1                             |   206 -
 src/proj/geod.c                             |   237 -
 src/proj/geod_for.c                         |   103 -
 src/proj/geod_inv.c                         |    56 -
 src/proj/geod_set.c                         |    74 -
 src/proj/geodesic.h                         |    51 -
 src/proj/jniproj.c                          |   631 -
 src/proj/mk_cheby.c                         |   161 -
 src/proj/multistresstest.c                  |   317 -
 src/proj/nad2bin.c                          |   376 -
 src/proj/nad_cvt.c                          |    68 -
 src/proj/nad_init.c                         |   311 -
 src/proj/nad_intr.c                         |    62 -
 src/proj/org_proj4_Projections.h            |    37 -
 src/proj/p_series.c                         |    39 -
 src/proj/pj_apply_gridshift.c               |   249 -
 src/proj/pj_apply_vgridshift.c              |   208 -
 src/proj/pj_auth.c                          |    30 -
 src/proj/pj_ctx.c                           |   179 -
 src/proj/pj_datum_set.c                     |   139 -
 src/proj/pj_datums.c                        |    90 -
 src/proj/pj_deriv.c                         |    33 -
 src/proj/pj_ell_set.c                       |   105 -
 src/proj/pj_ellps.c                         |    56 -
 src/proj/pj_errno.c                         |    17 -
 src/proj/pj_factors.c                       |    86 -
 src/proj/pj_fwd.c                           |    37 -
 src/proj/pj_gauss.c                         |    94 -
 src/proj/pj_geocent.c                       |    57 -
 src/proj/pj_gridinfo.c                      |   870 --
 src/proj/pj_gridlist.c                      |   224 -
 src/proj/pj_init.3                          |   112 -
 src/proj/pj_init.c                          |   508 -
 src/proj/pj_initcache.c                     |   181 -
 src/proj/pj_inv.c                           |    33 -
 src/proj/pj_latlong.c                       |    80 -
 src/proj/pj_list.c                          |    11 -
 src/proj/pj_list.h                          |   142 -
 src/proj/pj_log.c                           |    73 -
 src/proj/pj_malloc.c                        |    27 -
 src/proj/pj_mlfn.c                          |    57 -
 src/proj/pj_msfn.c                          |     7 -
 src/proj/pj_mutex.c                         |   196 -
 src/proj/pj_open_lib.c                      |   176 -
 src/proj/pj_param.c                         |   108 -
 src/proj/pj_phi2.c                          |    25 -
 src/proj/pj_pr_list.c                       |    91 -
 src/proj/pj_qsfn.c                          |    16 -
 src/proj/pj_release.c                       |    11 -
 src/proj/pj_strerrno.c                      |    85 -
 src/proj/pj_transform.c                     |   826 --
 src/proj/pj_tsfn.c                          |    10 -
 src/proj/pj_units.c                         |    37 -
 src/proj/pj_utils.c                         |   173 -
 src/proj/pj_zpoly1.c                        |    46 -
 src/proj/proj.1                             |   303 -
 src/proj/proj.c                             |   501 -
 src/proj/proj_api.h                         |   134 -
 src/proj/proj_etmerc.c                      |   252 -
 src/proj/proj_mdist.c                       |   123 -
 src/proj/proj_rouss.c                       |   122 -
 src/proj/projects.h                         |   476 -
 src/proj/rtodms.c                           |    72 -
 src/proj/vector1.c                          |    29 -
 src/ps/.ps                                  |  4296 ------
 src/ps/Makefile.am                          |    81 -
 src/ps/Makefile.in                          |   598 -
 src/ps/mb7k2jstar.ps                        |   539 -
 src/ps/mb7k2ss.ps                           |   637 -
 src/ps/mb7kpreprocess.ps                    |   522 -
 src/ps/mbabsorption.ps                      |   384 -
 src/ps/mbareaclean.ps                       |   569 -
 src/ps/mbauvloglist.ps                      |   697 -
 src/ps/mbauvnavusbl.ps                      |   295 -
 src/ps/mbbackangle.ps                       |   655 -
 src/ps/mbclean.ps                           |   732 --
 src/ps/mbcontour.ps                         |   703 -
 src/ps/mbcopy.ps                            |   468 -
 src/ps/mbctdlist.ps                         |   434 -
 src/ps/mbdatalist.ps                        |   676 -
 src/ps/mbdefaults.ps                        |   483 -
 src/ps/mbdumpesf.ps                         |   342 -
 src/ps/mbedit.ps                            |  1284 --
 src/ps/mbeditviz.ps                         |   458 -
 src/ps/mbextractsegy.ps                     |   628 -
 src/ps/mbfilter.ps                          |   630 -
 src/ps/mbformat.ps                          |   348 -
 src/ps/mbgetesf.ps                          |   384 -
 src/ps/mbgrdtiff.ps                         |   415 -
 src/ps/mbgrdviz.ps                          |   644 -
 src/ps/mbgrid.ps                            | 10293 ---------------
 src/ps/mbhistogram.ps                       |   467 -
 src/ps/mbhsdump.ps                          |   310 -
 src/ps/mbhysweeppreprocess.ps               |   573 -
 src/ps/mbinfo.ps                            |   727 --
 src/ps/mbio.ps                              |  4344 ------
 src/ps/mbkongsbergpreprocess.ps             |   619 -
 src/ps/mblevitus.ps                         |   447 -
 src/ps/mblist.ps                            |   895 --
 src/ps/mbm_arc2grd.ps                       |   300 -
 src/ps/mbm_bpr.ps                           |   486 -
 src/ps/mbm_copy.ps                          |   366 -
 src/ps/mbm_dslnavfix.ps                     |   393 -
 src/ps/mbm_fmtvel.ps                        |   271 -
 src/ps/mbm_grd2arc.ps                       |   331 -
 src/ps/mbm_grd2geovrml.ps                   |   622 -
 src/ps/mbm_grd3dplot.ps                     |  1181 --
 src/ps/mbm_grdcut.ps                        |   326 -
 src/ps/mbm_grdinfo.ps                       |   298 -
 src/ps/mbm_grdplot.ps                       |  1644 ---
 src/ps/mbm_grdtiff.ps                       |   863 --
 src/ps/mbm_grid.ps                          |   796 --
 src/ps/mbm_histplot.ps                      |   515 -
 src/ps/mbm_makedatalist.ps                  |   306 -
 src/ps/mbm_makesvp.ps                       |   350 -
 src/ps/mbm_multicopy.ps                     |   392 -
 src/ps/mbm_multidatalist.ps                 |   367 -
 src/ps/mbm_multiprocess.ps                  |   341 -
 src/ps/mbm_plot.ps                          |  1692 ---
 src/ps/mbm_route2mission.ps                 |   820 --
 src/ps/mbm_stat.ps                          |   272 -
 src/ps/mbm_utm.ps                           |   321 -
 src/ps/mbm_vrefcheck.ps                     |   326 -
 src/ps/mbm_xbt.ps                           |   298 -
 src/ps/mbm_xyplot.ps                        |  1022 --
 src/ps/mbmosaic.ps                          | 10323 ---------------
 src/ps/mbnavadjust.ps                       |  2283 ----
 src/ps/mbnavadjustmerge.ps                  |   602 -
 src/ps/mbnavedit.ps                         |  1025 --
 src/ps/mbnavlist.ps                         |   761 --
 src/ps/mbneptune2esf.ps                     |   452 -
 src/ps/mbotps.ps                            |   584 -
 src/ps/mbpreprocess.ps                      |   284 -
 src/ps/mbprocess.ps                         |  1580 ---
 src/ps/mbps.ps                              |   445 -
 src/ps/mbrollbias.ps                        |   382 -
 src/ps/mbrolltimelag.ps                     |   484 -
 src/ps/mbroutetime.ps                       |   481 -
 src/ps/mbsegygrid.ps                        |   620 -
 src/ps/mbsegyinfo.ps                        |   343 -
 src/ps/mbsegylist.ps                        |   408 -
 src/ps/mbsegypsd.ps                         |   491 -
 src/ps/mbset.ps                             |  1375 --
 src/ps/mbstripnan.ps                        |   286 -
 src/ps/mbsvplist.ps                         |   438 -
 src/ps/mbsvpselect.ps                       |   509 -
 src/ps/mbswath.ps                           |   733 --
 src/ps/mbswplspreprocess.ps                 |   427 -
 src/ps/mbsystem.ps                          |  2165 ---
 src/ps/mbtime.ps                            |   307 -
 src/ps/mbvelocitytool.ps                    |   747 --
 src/share/LevitusAnnual82.dat               |   Bin 17107200 -> 0 bytes
 src/share/Makefile.am                       |     1 -
 src/share/Makefile.in                       |   517 -
 src/share/Projections.dat                   | 17373 ------------------------
 src/stamp-h1                                |     1 -
 src/surf/Makefile.am                        |    15 -
 src/surf/Makefile.in                        |   712 -
 src/surf/Makefile.org                       |   117 -
 src/surf/README                             |   154 -
 src/surf/mb_sapi.h                          |   719 -
 src/surf/mem_surf.c                         |  2309 ----
 src/surf/mem_surf.h                         |   297 -
 src/surf/myOpSys.c                          |     5 -
 src/surf/opsys.h                            |     1 -
 src/surf/pb_math.c                          |   448 -
 src/surf/pb_math.h                          |   182 -
 src/surf/sapi_build.c                       |   286 -
 src/surf/sapi_data.c                        |   277 -
 src/surf/sapi_files.c                       |   685 -
 src/surf/sapi_globals.c                     |   230 -
 src/surf/sapi_simple.c                      |   173 -
 src/surf/surf.h                             |  1136 --
 src/surf/types_win32.h                      |     9 -
 src/surf/util_surf.c                        |   793 --
 src/surf/util_surf.h                        |   208 -
 src/surf/xdr_surf.c                         |  1434 --
 src/surf/xdr_surf.h                         |   192 -
 src/surf/xdr_win32.c                        |   654 -
 src/surf/xdr_win32.h                        |    51 -
 src/utilities/Makefile.am                   |   145 -
 src/utilities/Makefile.in                   |  1233 --
 src/utilities/geodesic.c                    |  1770 ---
 src/utilities/geodesic.h                    |   751 --
 src/utilities/mb7k2jstar.c                  |  2574 ----
 src/utilities/mb7k2ss.c                     |  2514 ----
 src/utilities/mb7kpreprocess.c              |  7735 -----------
 src/utilities/mb7kpreprocess.c.new          |  7787 -----------
 src/utilities/mbabsorption.c                |   279 -
 src/utilities/mbareaclean.c                 |  1532 ---
 src/utilities/mbauvloglist.c                |   858 --
 src/utilities/mbauvnavusbl.c                |   746 --
 src/utilities/mbbackangle.c                 |  2062 ---
 src/utilities/mbclean.c                     |  2087 ---
 src/utilities/mbcopy.c                      |  3276 -----
 src/utilities/mbctdlist.c                   |  1360 --
 src/utilities/mbdatalist.c                  |   613 -
 src/utilities/mbdefaults.c                  |   534 -
 src/utilities/mbdumpesf.c                   |   403 -
 src/utilities/mbextractsegy.c               |  1580 ---
 src/utilities/mbfilter.c                    |  2102 ---
 src/utilities/mbformat.c                    |   420 -
 src/utilities/mbgetesf.c                    |   606 -
 src/utilities/mbgrid.c                      |  5775 --------
 src/utilities/mbhistogram.c                 |   786 --
 src/utilities/mbhsdump.c                    |   819 --
 src/utilities/mbhysweeppreprocess.c         |  2361 ----
 src/utilities/mbinfo.c                      |  2898 ----
 src/utilities/mbinsreprocess.c              |   578 -
 src/utilities/mbkongsbergpreprocess.c       |  2945 -----
 src/utilities/mblevitus.c                   |   505 -
 src/utilities/mblist.c                      |  5466 --------
 src/utilities/mbmosaic.c                    |  4926 -------
 src/utilities/mbnavlist.c                   |  1095 --
 src/utilities/mbneptune2esf.c               |  1253 --
 src/utilities/mbpreprocess.c                |  2314 ----
 src/utilities/mbprocess.c                   |  7245 ----------
 src/utilities/mbps.c                        |  1111 --
 src/utilities/mbrollbias.c                  |  1204 --
 src/utilities/mbrolltimelag.c               |   785 --
 src/utilities/mbroutetime.c                 |   626 -
 src/utilities/mbrphsbias.c                  |   857 --
 src/utilities/mbsegygrid.c                  |  1260 --
 src/utilities/mbsegyinfo.c                  |   560 -
 src/utilities/mbsegylist.c                  |   892 --
 src/utilities/mbsegypsd.c                   |  1000 --
 src/utilities/mbset.c                       |  1660 ---
 src/utilities/mbsslayout.c                  |  3244 -----
 src/utilities/mbstripnan.c                  |    62 -
 src/utilities/mbsvplist.c                   |   920 --
 src/utilities/mbsvpselect.c                 |  1819 ---
 src/utilities/mbswplspreprocess.c           |  1547 ---
 src/utilities/mbtime.c                      |   183 -
 1102 files changed, 7 insertions(+), 1101985 deletions(-)

diff --git a/AUTHORS b/AUTHORS
deleted file mode 100644
index e0bfbc5..0000000
--- a/AUTHORS
+++ /dev/null
@@ -1,51 +0,0 @@
--------------------------------------------------------------------------------
-MB-SYSTEM AUTHORS FILE:
--------------------------------------------------------------------------------
-Version: $Id: AUTHORS 2080 2013-05-23 22:33:37Z caress $
--------------------------------------------------------------------------------
-
-This file lists the primary and contributing authors of the MB-System open
-source software package for the processing and display of swath sonar data.
-This file is located at the top of the MB-System source code distribution
-directory structure.
-
--------------------------------------------------------------------------------
-MB-SYSTEM PRIMARY AUTHORS:
--------------------------------------------------------------------------------
-
-David W. Caress (caress at mbari.org)
-Monterey Bay Aquarium Research Institute
-7700 Sandholdt Road
-Moss Landing, CA 95039
-
-Dale N. Chayes (dale at ldeo.columbia.edu)
-Lamont-Doherty Earth Observatory of Columbia University
-Rte 9W
-Palisades, NY 10964
-
--------------------------------------------------------------------------------
-MB-SYSTEM CONTRIBUTING AUTHORS:
--------------------------------------------------------------------------------
-
-Bob Covill, Tekmap Consulting, Nova Scotia, Canada
-Christian Ferreira, MARUM, University of Bremen, Germany
-Gordon Keith, CSIRO Marine and Atmospheric Research, Australia
-Suzanne O'Hara, Lamont-Doherty Earth Observatory of Columbia University
-Val Schmidt, University of New Hampshire JHC/CCOM
-
-------------------------------------------------------------------------
-OTHER MB-SYSTEM CONTRIBUTORS:
-------------------------------------------------------------------------
-
-In addition to those listed above, a number of people have made contributions to
-the source code for MB-System. These include:
-    Mike McCann (MBARI)
-    Daniel Scheirer (United States Geological Survey)
-    Paul Cohen (formerly of SeaBeam Instruments and Fidelity Investments)
-    Steve Dzurenko (foremerly of SeaBeam Instruments and University of Texas)
-    Peter Lemmond (Woods Hole Oceanographic Institution)
-    David Brock (formerly with Antarctic Support Associates)
-    Alberto Malinverno (Lamont-Doherty Earth Observatory)
-    Russ Alexander (formerly with UCSB)
-
-------------------------------------------------------------------------
diff --git a/COPYING b/COPYING
deleted file mode 100644
index e2600ad..0000000
--- a/COPYING
+++ /dev/null
@@ -1,81 +0,0 @@
--------------------------------------------------------------------------------
-MB-SYSTEM COPYRIGHT, LICENSING AND CAVEAT:
--------------------------------------------------------------------------------
-Version: $Id: COPYING 2162 2014-01-25 05:03:15Z caress $
--------------------------------------------------------------------------------
-
-This file contains the copyright and licensing terms for the MB-System open
-source software package for the processing and display of swath sonar data.
-This file is located at the top of the MB-System source code distribution
-directory structure.
-
--------------------------------------------------------------------------------
-
-MB-System Copyright (C) 1993-2013 by
-David W. Caress (caress at mbari.org)
-  Monterey Bay Aquarium Research Institute
-  Moss Landing, CA 95039
-Dale N. Chayes (dale at ldeo.columbia.edu)
-  Lamont-Doherty Earth Observatory
-  Palisades, NY 10964mbbackangle.manl
-All Rights Reserved
-All Wrongs Remembered
-
--------------------------------------------------------------------------------
-
-The MB-System source code is distributed under the GNU General Public License,
-version 3, as formulated by the GNU Project. Early MB-System distributions
-were described as "public domain", which meant there was no restriction
-whatsoever on the use of the code. For over a decade we have adopted the
-more restrictive GNU GPL license in order to insure that anyone who distributes
-software based in whole or in part on MB-System also distributes their
-modified MB-System source code and any additional source code.
-
-The file "GPL", also located at the top of the MB-System source code
-distribution directory structure, contains the text of the GNU GPL version 3.
-
-The GNU GPL also prohibits the distribution of proprietary executables linked
-with MB-System libraries unless the source code is also distributed. We waive
-this restriction on distributing proprietary compiled programs for specific
-software products if and only if those software products meet the following
-two conditions:
-   1) The software product was created, sold, and delivered to customers using
-      source code derived from MB-System release 4.6 distributions.
-   2) The software product was sold and delivered to customers prior to
-      January 1, 2001.
-
-The MB-System distribution includes some source code derived from packages that
-are distributed separately and have been authored by programmers other than the
-MB-System team. This includes:
-   - The Generic Sensor Format (GSF) library source located in
-     mbsystem/src/gsf. The GSF package is distributed by the
-     Science Applications International Corporation under contract
-     to the Naval Oceanographic Office.
-   - The SURF API (SAPI) library source located in mbsystem/src/surf.
-     The SAPI package has been released under the GNU General Public
-     License by Atlas Hydrographic.
-   - The MR1PR library source located in mbsystem/src/mr1pr. This
-     package has been openly released by the Hawaii Mapping
-     Research Group.
-   - The PROJ.4 library source located in mbsystem/src/proj.
-     This package was originally developed by Gerald Evenden
-     of the United States Geological Survey, and is now maintained
-     and distributed under an MIT license (that is very close to
-     public domain) by Frank Warmerdam in association with the Open
-     Source Geospational Foundation
-   - The mb_mergesort() function found in mbsystem/src/mbio/mb_esf.c
-     derives from the GNU-Darwin Distribution. This code is released
-     under both the Apple Public Source License Version 1.1 and the
-     BSD license, with original copyright by the Regents of the
-     University of California.
-
-The MB-System does not come with any warranties, nor is it guaranteed to work
-on your computer or to do anything useful. The user assumes full responsibility
-for the use of this system. In particular, David W. Caress, Dale N. Chayes,
-the Monterey Bay Aquarium Research Institute, the Lamont-Doherty Earth
-Observatory of Columbia University, or any other individuals or organizations
-involved in the design and maintenance of the MB-System software package are
-NOT responsible for any damage that may follow from correct or incorrect use
-of these programs.
-
--------------------------------------------------------------------------------
diff --git a/ChangeLog b/ChangeLog
deleted file mode 100644
index bb8f25b..0000000
--- a/ChangeLog
+++ /dev/null
@@ -1,3746 +0,0 @@
--------------------------------------------------------------------------------
-MB-SYSTEM CHANGELOG FILE:
--------------------------------------------------------------------------------
-Version: $Id: ChangeLog 2252 2015-07-01 19:35:37Z caress $
--------------------------------------------------------------------------------
-
-This file lists changes to the source code of the MB-System open
-source software package for the processing and display of swath sonar data.
-This file is located at the top of the MB-System source code distribution
-directory structure.
-
--------------------------------------------------------------------------------
-MB-SYSTEM VERSION 5 RELEASE DATES:
--------------------------------------------------------------------------------
-Here "*" denotes source distribution release made available for ftp download.
-Releases without an "*" are discrete revisions available from the source code
-archive at http://svn.ilab.ldeo.columbia.edu/listing.php?repname=MB-System.
-
-* Version 5.5.2252       July 1, 2015
-* Version 5.5.2251       June 30, 2015
-  Version 5.5.2250       June 29, 2015
-  Version 5.5.2249       June 26, 2015
-* Version 5.5.2248       May 31, 2015
-  Version 5.5.2247       May 29, 2015
-* Version 5.5.2246       May 27, 2015
-* Version 5.5.2243       May 22, 2015
-* Version 5.5.2242       May 16, 2015
-  Version 5.5.2241       May 12, 2015
-  Version 5.5.2240       May 8, 2015
-  Version 5.5.2239       May 6, 2015
-  Version 5.5.2238       April 14, 2015
-  Version 5.5.2237       March 23, 2015
-  Version 5.5.2234       March 5, 2015
-* Version 5.5.2233       February 23, 2015
-  Version 5.5.2232       February 21, 2015
-  Version 5.5.2231       February 20, 2015
-  Version 5.5.2230       February 18, 2015
-  Version 5.5.2229       February 14, 2015
-  Version 5.5.2228       February 6, 2015
-* Version 5.4.2220       January 22, 2015 (Last GMT4-compatible archive revision, released February 27, 2015)
-  Version 5.4.2219       December 11, 2014
-  Version 5.4.2218       December 4, 2014
-  Version 5.4.2217       December 1, 2014
-* Version 5.4.2213       November 13, 2014
-  Version 5.4.2210       November 10, 2014
-* Version 5.4.2209       November 4, 2014
-* Version 5.4.2208       October 29, 2014
-  Version 5.4.2204       September 5, 2014
-* Version 5.4.2202       August 25, 2014
-  Version 5.4.2201       August 20, 2014
-* Version 5.4.2200       July 24, 2014
-* Version 5.4.2199       July 19, 2014
-  Version 5.4.2196       July 14, 2014
-  Version 5.4.2195       July 9, 2014
-  Version 5.4.2194       July 8, 2014
-* Version 5.4.2191       June 4, 2014
-* Version 5.4.2188       May 31, 2014
-  Version 5.4.2187       May 28, 2014
-  Version 5.4.2186       May 26, 2014
-  Version 5.4.2185       May 11, 2014
-* Version 5.4.2183       April 16, 2014
-  Version 5.4.2182       April 8, 2014
-  Version 5.4.2181       April 4, 2014
-* Version 5.4.2176       March 18, 2014
-* Version 5.4.2168       February 19, 2014
-* Version 5.4.2163       January 31, 2014
-  Version 5.4.2162       January 24, 2014
-* Version 5.4.2159       January 18, 2014
-  Version 5.4.2158       January 18, 2014
-* Version 5.4.2157       October 14, 2013
-  Version 5.4.2155       October 13, 2013
-  Version 5.4.2154       September 26, 2013
-  Version 5.4.2153       September 22, 2013
-* Version 5.4.2152       September 16, 2013
-  Version 5.4.2151       September 12, 2013
-  Version 5.4.2149       September 2, 2013
-  Version 5.4.2148       August 28, 2013
-  Version 5.4.2147       August 27, 2013
-  Version 5.4.2144       August 26, 2013
-  Version 5.4.2143       August 24, 2013
-  Version 5.4.2141       August 24, 2013
-  Version 5.4.2139       August 19, 2013
-  Version 5.4.2138       August 18, 2013
-  Version 5.4.2137       August 9, 2013
-  Version 5.4.2136       August 8, 2013
-* Version 5.4.2135       August 7, 2013
-  Version 5.4.2133       July 29, 2013
-  Version 5.4.2132       July 26, 2013
-  Version 5.4.2130       July 20, 2013
-  Version 5.4.2129       July 8, 2013
-  Version 5.4.2128       June 18, 2013
-  Version 5.4.2123       June 10, 2013
-  Version 5.4.2082       May 24, 2013
-  Version 5.3.2053       April 4, 2013
-  Version 5.3.2051       March 20, 2013
-  Version 5.3.2042       March 12, 2013
-* Version 5.3.2017       March 3, 2013
-* Version 5.3.2013       January 29, 2013
-* Version 5.3.2012       January 25, 2013
-* Version 5.3.2011       January 17, 2013
-  Version 5.3.2010       January 14, 2013
-* Version 5.3.2009       January 10, 2013
-* Version 5.3.2008       January 6, 2013
-  Version 5.3.2007       January 5, 2013
-  Version 5.3.2006       January 4, 2013
-  Version 5.3.2005       December 31, 2012
-  Version 5.3.2004       December 12, 2012
-  Version 5.3.2000       Navember 14, 2012
-  Version 5.3.1999       Navember 13, 2012
-  Version 5.3.1998       Navember 6, 2012
-  Version 5.3.1994       October 27, 2012
-  Version 5.3.1988       September 29, 2012
-  Version 5.3.1986       September 12, 2012
-* Version 5.3.1982       August 15, 2012
-  Version 5.3.1981       August 2, 2012
-* Version 5.3.1980       July 13, 2012
-* Version 5.3.1955       May 16, 2012
-  Version 5.3.1941       March 6, 2012
-* Version 5.3.1917       January 10, 2012
-* Version 5.3.1912       November 19, 2011
-* Version 5.3.1909       November 16, 2011
-* Version 5.3.1907       November 9, 2011
-* Version 5.3.1906       September 28, 2011
-* Version 5.2.1880       December 30, 2010
-  Version 5.1.3beta1875  November 23, 2010
-  Version 5.1.3beta1874  November 7, 2010
-  Version 5.1.3beta1862  June 7, 2010
-  Version 5.1.3beta1858  May 18, 2010
-  Version 5.1.3beta1855  May 4, 2010
-  Version 5.1.3beta1851  April 14, 2010
-  Version 5.1.3beta1844  March 30, 2010
-  Version 5.1.3beta1843  March 29, 2010
-  Version 5.1.3beta1829  February 5, 2010
-* Version 5.1.2          December 31, 2009
-  Version 5.1.2beta15    December 30, 2009
-  Version 5.1.2beta14    December 28, 2009
-  Version 5.1.2beta13    December 28, 2009
-  Version 5.1.2beta12    December 26, 2009
-  Version 5.1.2beta11    Ausust 26, 2009
-  Version 5.1.2beta10    Ausust 12, 2009
-  Version 5.1.2beta09    Ausust 7, 2009
-  Version 5.1.2beta08    Ausust 5, 2009
-  Version 5.1.2beta06    July 2, 2009
-  Version 5.1.2beta05    June 14, 2009
-  Version 5.1.2beta02    March 13, 2009
-  Version 5.1.2beta01    March 9, 2009
-* Version 5.1.1          December 31, 2008
-  Version 5.1.1beta26    November 18, 2008
-  Version 5.1.1beta25    September 28, 2008
-  Version 5.1.1beta23    September 19, 2008
-  Version 5.1.1beta21    July 20, 2008
-  Version 5.1.1beta20    July 10, 2008
-  Version 5.1.1beta19    June 6, 2008
-  Version 5.1.1beta18    May 16, 2008
-  Version 5.1.1beta17    March 21, 2008
-  Version 5.1.1beta16    March 14, 2008
-  Version 5.1.1beta15    February 8, 2008
-  Version 5.1.1beta14    January 15, 2008
-  Version 5.1.1beta13    November 16, 2007
-  Version 5.1.1beta12    November 2, 2007
-  Version 5.1.1beta11    October 17, 2007
-  Version 5.1.1beta10    October 8, 2007
-  Version 5.1.1beta5     July 5, 2007
-* Version 5.1.0          November 26, 2006
-  Version 5.1.0beta4     October 5, 2006
-  Version 5.1.0beta3     September 11, 2006
-  Version 5.1.0beta2     August 9, 2006
-  Version 5.1.0beta      July 5, 2006
-* Version 5.0.9          February 20, 2006
-* Version 5.0.8          February 8, 2006
-  Version 5.0.8beta5     February 3, 2006
-  Version 5.0.8beta4     February 1, 2006
-  Version 5.0.8beta3     February 1, 2006
-  Version 5.0.8beta2     January 27, 2006
-  Version 5.0.8beta      January 24, 2006
-* Version 5.0.7          April 7, 2005
-* Version 5.0.6          February 19, 2005
-* Version 5.0.5          October 6, 2004
-* Version 5.0.4          May 22, 2004
-* Version 5.0.3          February 27, 2004
-* Version 5.0.2          December 24, 2003
-* Version 5.0.1          December 12, 2003
-* Version 5.0.0          December 5, 2003
-  Version 5.0.beta31     April 29, 2003
-  Version 5.0.beta30     April 25, 2003
-  Version 5.0.beta29     March 10, 2003
-  Version 5.0.beta28     January 14, 2003
-  Version 5.0.beta27     November 13, 2002
-  Version 5.0.beta26     November 3, 2002
-  Version 5.0.beta25     October 15, 2002
-  Version 5.0.beta24     October 4, 2002
-  Version 5.0.beta23     September 20, 2002
-  Version 5.0.beta22     August 30, 2002
-  Version 5.0.beta21     July 25, 2002
-  Version 5.0.beta20     July 20, 2002
-  Version 5.0.beta18     May 31, 2002
-  Version 5.0.beta17     May 1, 2002
-  Version 5.0.beta16     April 5, 2002
-  Version 5.0.beta15     March 26, 2002
-  Version 5.0.beta14     February 25, 2002
-  Version 5.0.beta13     February 22, 2002
-  Version 5.0.beta12     January 2, 2002
-  Version 5.0.beta11     December 20, 2001
-  Version 5.0.beta10     November 20, 2001
-  Version 5.0.beta09     November 6, 2001
-  Version 5.0.beta08     October 19, 2001
-  Version 5.0.beta07     August 10, 2001
-  Version 5.0.beta06     July 30, 2001
-  Version 5.0.beta05     July 23, 2001
-  Version 5.0.beta04     July 20, 2001
-  Version 5.0.beta03     July 19, 2001
-  Version 5.0.beta02     June 30, 2001
-  Version 5.0.beta01     June 8, 2001
-  Version 5.0.beta00     April 6, 2001
-
--------------------------------------------------------------------------------
-MB-SYSTEM VERSION 5.5 RELEASE NOTES:
--------------------------------------------------------------------------------
-
------> 5.5.2252 (July 1, 2015)
-
-Mbedit, mbnavedit, mbnavadjust, mbvelocitytool: Fix X11 font initialization
-problem created in the 2251 commit.
-
------> 5.5.2251 (June 30, 2015)
-
-Mblist, mbnavlist, mbctdlist: Changed time outputs so that decimal second
-values will be formatted according to the locale (e.g. decimal delineation by
-commas in Europe).
-
-Mbedit, mbnavedit, mbnavadjust, mbvelocitytool, mbgrdviz, mbeditviz: Set up
-preprocessor defines to allow fonts to be defined using the CFLAGS
-environment variable.
-
------> 5.5.2250 (June 29, 2015)
-
-Mbedit, mbnavedit, mbvelocitytool, mbgrdviz, mbeditviz: Removed call to X11
-function XtSetLanguageProc() in all graphical tools. This call apparently
-causes the program locale to be reset according system defaults, even if the
-program implicitly begins in the standard C locale. If the system locale uses
-"," rather than "." as the decimal point marker (e.g. a normal European locale),
-then a GMT 5 initialization will probably fail on reading fonts, at least on
-many if not all Linux distributions. Thanks to Giancarlo Troni for figuring this
-one out.
-
-General: Added mbio/mb_platform.c to the archive. This source file includes the
-functions to read, write, and use platform, sensor, and sensor offset definitions.
-At this time the mb_platform_*() functions are only used in mb7kpreprocess, but
-they will soon be used in mbprocess and all the preprocess programs.
-
-Mbprocess: changed application of tide corrections so that these corrections are
-applied to the platform depth values rather than the bathymetry values. The result
-is the same, but now the navigation (or trajectory) of the processed files is
-corrected in addition to the bathymetry.
-
------> 5.5.2249 (June 26, 2015)
-
-Format 121 (MBF_GSFGENMB): Kluge added to the GSF format i/o module to handle
-beam angles incorrectly constructed so that angles from vertical are negative
-for port side beams when all aziumuthal angles are uniformaly zero (=starboard).
-
-General: Added platform, sensor, and sensor offset definitions to mb_io.h for
-use in flexibly defining a platform consisting of many sensors with relative
-positional and angular offsets. Also added functions to read and write
-platform files using these definitions. Have not completed the function to perform
-lever arm calculations using this platform definition. Initially these functions
-will be used in mb7kpreprocess, but ultimately these will be used generally
-in MB-System.
-
-Mb7kpreprocess: initial implementation using the new platform file and structure
-definitions.
-
------> 5.5.2248 (May 31, 2015)
-
-Mbgrdviz and mbview: Fixed casts between int and pointer that seem to be
-responsible for mbgrdviz crashes.
-
------> 5.5.2247 (May 29, 2015)
-
-General: Cleaned up missing function prototypes through much of the codebase
-(excepting externally written libraries gsf, sapi, bsio) in an effort to fix
-crashes of mbgrdviz and other programs.
-
------> 5.5.2246 (May 27, 2015)
-
-Mbswath, mbcontour, mbgrdtiff: Updated GMT5 header files in src/gmt to enable
-building on Ubuntu Linux, CentOs Linux, and CygWin while maintaining
-compatibility with GMT 5.1.2.
-
-Mbedit, mbnavedit, mbvelocitytool, mbgrdviz, mbeditviz: Incomplete tweaks to
-font handling to enable use of fonts other than Helvetica, Times, and Courier.
-
------> 5.5.2243 (May 22, 2015)
-
-Rewrote the configure.ac file to fix logic flaws in the configure script.
-
------> 5.5.2242 (May 16, 2015)
-
-Mbswath, mbcontour, mbgrdtiff: Updated files in src/gmt for compatibility with
-GMT 5.1.2.
-
------> 5.5.2241 (May 12, 2015)
-
-Format 59 (MBF_EM710MBA): Fixed flag causing erroneous warning that beam flags
-are not supported for this format (beam flags are supported).
-
-Many source files: further changes to precompiler directives suggested by Joaquim Luis
-in order to enable building under Windows.
-
------> 5.5.2240 (May 8, 2015)
-
-Format 241 (MBF_WASSPENL): Fixed recognition of *.nwsf suffix.
-
-Mbclean: fixed bug in beam position calculation identified by Joaquim Luis.
-
------> 5.5.2239 (May 6, 2015)
-
-Format 241 (MBF_WASSPENL): Now supports WASSP multibeam data conforming to
-the WASSP ICD 2.4. MB-System is storing beam flags in unused bytes in the
-existing CORBATHY data records (specifically the "empty" field in the
-CORBATHY beam data specified in ICD 2.4).
-
-Many source files: changes to precompiler directives suggested by Joaquim Luis
-in order to enable building under Windows.
-
-Mbnavadjust: Modified the inversion to separate the vertical and lateral
-covariance so that lateral offsets do not bleed into the vertical offset
-model.
-
-Mb7kpreprocess: Fixed bug that treated null soundings as good for datasets
-without detection records.
-
-Mbdumpesf: Added capability to output in the edit save file format in addition
-to ASCII text, and to ignore specified types of edit events (e.g. copy an esf
-file while removing all beam null events).
-
-Build system: Fixed bug that caused configure to fail if netCDF has a pkg-config
-installation while GMT5 is in a specified but nonstandard location.
-
------> 5.5.2238 (April 15, 2015)
-
-Mbnavadjust: Recast and improved the inversion. Added a "perturbation" model
-display which does not include the average offsets between the individual surveys
-in projects involving multiple surveys.
-
-Mbcontour, mbswath, mbgrdtiff: Included fixes suggested by Joaquim Luis for
-compatibility with the next GMT5 release.
-
-Mbclean: Removed -M3 and -M4 options that previously caused the program to null
-(or zero) rather than flag bad soundings. This is an obsolete feature that only
-made sense prior to existence of mbprocess.
-
-Mbbackangle: Fixed mbm_grdplot call to no longer use an obsolete option.
-
------> 5.5.2237 (March 23, 2015)
-
-Mbnavadjust, mbnavedit: Removed references to GMT and netCDF in the Makefile.am
-file in both source directories.
-
------> 5.5.2236 (March 23, 2015)
-
-Mbnavadjust, mbnavadjustmerge: Added a new type of constraint referred to as a
-global tie. Each data section can have one of its navigation points tied to
-the fixed global frame of reference with a specified x, y, z offset (or just x
-and y, or just z) and x, y, and z uncertainties in the offset values. These
-global ties are set using mbnavadjustmerge. The relevant mbnavadjustmerge
-commands are:
-    --set-global-tie=file:section[:snav]/xoffset/yoffset/zoffset[/xsigma/ysigma/zsigma]
-    --set-global-tie-xyz=file:section[:snav]
-    --set-global-tie-xyonly=file:section[:snav]
-    --set-global-tie-zonly=file:section[:snav]
-
-Mbnavadjustmerge: Added ability to unset (delete) global ties and crossing ties.
-The relevant mbnavadjustmerge commands are:
-    --unset-global-tie=file:section
-    --unset-tie=file1:section1/file2:section2
-
-Mbnavadjust, mbnavadjustmerge: Explicitly added references to libgmt and libpsl in
-the src/mbnavadjust/Makefile.am file so that the mbnavadjust and mbnavadjustmerge
-executables are linked to those libraries. This is to solve a mysterious dependency
-of mbnavadjust on libgmt on CentOs6 - the program was failing due inability to find
-libgmt.so.5 even though the code does not reference any GMT or GMT5 function or header
-file. Presumably this change will go away when the mystery is solved.
-
-Mbsslayout: fixed automatically generated plottin script.
-
-Mbm_route2mission: Added multibeam maximum range value.
-
------> 5.5.2234 (March 5, 2015)
-
-Plot macros (mbm_grdplot, mbm_grd3dplot, mbm_grdtiff, mbm_histplot, mbm_plot,
-mbm_xyplot): Now generate plotting scripts that will not attempt to display the
-plot on the screen if invoked with a "-N" command line argument.
-
-Format 64 (MBF_MR1PRVR2): Added include of <sys/time.h> in mbbs_defines.h to
-facilitate building under cygwin.
-
-Multi-macros (mbm_multiprocess, mbm_multicopy, mbm_multidatalist): Changed to
-use datalist.mb-1 as default input and to use 4 as the default number of CPUs.
-
-Mbedit: Added fast scroll through a file if the forward or back mouse buttons
-are held down more than 2 seconds.
-
-Mbextractsegy, mbsslayout: Changed output section/line plotting script so that
-it will not attempt to display the plot on the screen if invoked with a "-N"
-command line argument.
-
-Mbprocess: Reduced informational output when not in verbose mode to make the
-output from use of mbm_multiprocess cleaner.
-
------> 5.5.2233 (February 23, 2015)
-
-Release 5.5.2233
-
-Mbm_grdplot, mbm_grdtiff: Generated plot scripts now set foregound and background
-colors based on the -D option.
-
-Mbmroute2mission: Now allows the maximum planned climb rate of the AUV to be
-specified with the -U option
-
------> 5.5.2232 (February 21, 2015)
-
-Mbm_plot, mbm_grdplot, mbm_grd3dplot, mbhistplot: Changed handling of gmt defaults
-so that any local gmt.conf file is deleted before any gmtset calls are made, and
-the resulting gmt.conf file is deleted before the plot script ends.
-
-Mbswath: fixed calculation of beam or pixel footprints in mode requesting real
-footprint plotting.
-
------> 5.5.2231 (February 20, 2015)
-
-Mb7kpreprocess: Switched beam angle calculation to the mb_beaudoin() function
-already used by mbkongsbergpreprocess (contributed by Jonathan Beaudoin).
-
-Mbm_bpr: Made compatible with GMT5.
-
------> 5.5.2230 (February 18, 2015)
-
-Mbgrdtiff: Fixed ordering of rows and columns in the output image.
-
-Mbm_route2mission: Added output of a mission alititude profile plot.
-
-Mbauvloglist: Added capability of binary output.
-
-Mb7kpreprocess: Fixed so that bathymetry calculation uses roll merged at
-the bottom detect time for all of the possible combinations of Reson 7k
-data record types.
-
-Mbpreprocess: Fixed to exclude zero longitude or lattitude values from the
-tables used for interpolation onto ping times.
-
-Mbrolltimelag: Fixed automatically generated roll-slope correlation plot.
-
------> 5.5.2229 (February 14, 2015)
-
-Format 121 (MBF_GSFGENMB): The i/o module will now allocate and initialize arrays
-of beamflags and alongtrack distance when those are not included in the input file.
-
-Mbfilter: removed failing check for existance of sidescan data.
-
-Mbsegygrid: flipped grid convention for compatibility with GMT5.
-
-Mbm_plot, mbm_grdplot, mbm_grd3dplot, mbm_histplot: further changes for compatibility
-with GMT5.
-
-Mbm_route2mission: Compatibility with GMT5.
-
-Mbcontour, mbswath: More changes for compatibility with GMT5.
-
------> 5.5.2228 (February 6, 2015)
-
-Install_makefiles: the old install_makefiles build system no longer 
-functions and has been removed.
-
-Mbgrid: When using the two-step weighted footprint slope algorithm, mbgrid
-only reads files on the second pass through the input datalist that contained
-useful data in the first pass.
-
-Major changes made to integrate MB-System with GMT5:
-  The code will no longer compile or work with GMT4.5.
-  Changes include:
-    -updating functions in libmbaux  that read and write GMT grids
-    -deletion of src/mbaux/mb_pslibface.c
-    -changes to all programs that read or write GMT grids,
-    -the former programs mbcontour, mbswath, and mbgrdtiff are now GMT5
-      modules built as part of a shared library.
-    -changes to all of the plot macros (e.g. mbm_grdplot) that make use of GMT
-
-Format 88 (MBF_RESON7KR): Update Reson 7k i/o module to handle TVG records.
-
--------------------------------------------------------------------------------
-MB-SYSTEM VERSION 5.4 RELEASE NOTES:
--------------------------------------------------------------------------------
-
------> 5.4.2219 (December 11, 2014)
-
-Mbnavadjust: Fixed fixed memory management issue related to fbt files.
-
-Mb7kpreprocess: Moved toward correct handling of sensor offsets.
-
-Mbpreprocess: Moved toward correct handling of sensor offsets.
-
------> 5.4.2218 (December 4, 2014)
-
-Mbinfo: Fixed JSON format output to file (previously missed final closing bracket).
-
-
------> 5.4.2217 (December 1, 2014)
-
-Mbclean: Implemented additional flagging tests contributed by Suzanne O'Hara,
-including speed range (-Pspeed_min/speed_max), ping navigation bounds
-(-Rwest/east/south/north), and zero longitude and latitude values (-Z).
-Also, a minimum depth at nadir test embedded by Dana Yoerger for all data
-(circa 2010) has been recast into a minimum range test option (-Krange_min). 
-
-Format 71 (MBF_MBLDEOIH) and fbt files: fixed a problem with the i/o module
-as updated in 5.4.2216.
-
------> 5.4.2216 (November 30, 2014)
-
-Format 251 (MBF_PHOTGRAM): We have added a new data format and associated data
-system supporting photogrammetric topography calculated from stereo pair
-photographs. This format includes navigation and attitude data. Each 2D group
-of bathymetry values is derived with a single stereo pair. A file consists of a
-sequence of stereo pair bathymetry, each set of which has a timestamp, navigation
-and attitude as well as bathymetry values. The format 251 files are generated
-from stereo pairs (and navigation and attitude data) by a set of tools that
-are not currently in MB-System, but which will be added to MB-System in the
-future. 
-
-Mbeditviz and Mbgrdviz: Now allow selection of a single navigation point.
-
-Mbeditviz and mbgrid: Now handle point topography data (e.g. xyz soundings, lidar
-soundings, photogrammetry topography) differently than multibeam soundings even
-when the footprint algorithm is specified. Point data are now treated as such,
-and no longer are associated with nonsensical beam footprints.
-
-Format 71 (MBF_MBLDEOIH) and fbt files: We have defined a new data record header (version 5)
-that represents the number of bathymetry beams, amplitude beams, and sidescan
-pixels as four-byte int values rather than two-byte short values. This supports
-data constructs that have more than 32768 bathymetry values, as can be the case
-for dense photogrammetry data derived from stereo-pair photography. The i/o module
-only uses the version 5 header when there are more than 32768 bathymetry values
-in the associated sonar ping, lidar scan, or photographic stereo pair. Otherwise,
-the previously existing version 4 header is used. Consequently, for all previously
-supported data types there will be no change to the MBF_MBLDEOIH format or to
-fbt files.
-
-General: MB-System now defines several types of bathymetry data:
-      MB_TOPOGRAPHY_TYPE_UNKNOWN		0
-      MB_TOPOGRAPHY_TYPE_ECHOSOUNDER	        1
-      MB_TOPOGRAPHY_TYPE_MULTIBEAM		2
-      MB_TOPOGRAPHY_TYPE_SIDESCAN		3
-      MB_TOPOGRAPHY_TYPE_INTERFEROMETRIC	4
-      MB_TOPOGRAPHY_TYPE_LIDAR      	        5
-      MB_TOPOGRAPHY_TYPE_CAMERA     	        6
-      MB_TOPOGRAPHY_TYPE_GRID     	        7
-      MB_TOPOGRAPHY_TYPE_POINT       	        8
-The immediate utility of differentiating between data types is to
-allow gridding algorithms to handle data appropriately. As discussed
-above, the footprint gridding algorithms are now only applied by
-mbgrid or mbeditviz to multibeam bathymetry. Other differences in
-data processing will be added in the future.
-
-General: The sort function and related comparison function declarations
-in MB-System have been corrected to be consistent with qsort() from stdlib.
-
------> 5.4.2213 (November 13, 2014)
-
-Mbkongsbergpreprocess: Added -E option to allow specification of offsets between
-the depth sensor and the sonar. This is relevant only to submerged platforms
-such as AUVs or ROVs. Also added -P option to enable filtering of pressure
-depth data.
-
-Format 59 (MBF_EM710MBA): Set the navigation and attitude source records to be
-survey data so that mbnavedit and mbnavlist work by default with values from the 
-survey records rather than asynchronous raw sensor data. The navigation and attitude
-sources for format 58 (MBF_EM710RAW) remain the asynchronous records.
-
-Mbnavedit: Strictly define the font definitions for pushbutton widgets
-(some X11 environments are making bad choices when given latitude).
-
------> 5.4.2210 (November 10, 2014)
-
-Mbkongsbergpreprocess: Changed handling of water column records. The default
-behavior is now to not write water column records to the output format 59 files.
-Users can specify -W1 to have the water column records written in the output files.
-
-Format 41 (MBF_SB2100RW): Bug fix for Seabeam format 41 so the code handles
-records without the maximum number of beams. Contributed by Bob Covill.
-
-Mbprocess: Added ability to apply static bathymetry corrections defined according
-to beam angle in addition to corrections according to beam number. Contributed
-by Bob Covill.
-
-Mbvelocitytool: When loading a swath file, mbvelocitytool will now also read in
-and apply an associated *.esf (edit save file) if it exists. This prevents
-soundings that have been identified as bad from biasing the calculations.
-Contributed by Bob Covill.
-
-Mbm_grdcut: Fix to the manual page. Contributed by Jenny Paduan.
-
------> 5.4.2209 (November 4, 2014)
-
-MBnavadjustmerge:  Completed the manual page for this new program that allows
-one to merge and manipulate MBnavadjust projects.
-
-Formats 58 (MBF_EM710RAW) and 59 (MBF_EM710MBA): Recast the i/o architecture to
-handle the full variablity of multibeam data in these formats.
-
------> 5.4.2208 (October 29, 2014)
-
-Mbkongsbergpreprocess:  Fixed calculation of beam
-takeoff angles for raytracing from the raw range and angle data records by
-including code made available by Jonathan Beaudoin. Recalculation of
-bathymetry in current generation Kongsberg multibeam data appears to work
-now.
-
-Formats 58 (MBF_EM710RAW) and 59 (MBF_EM710MBA): Support Mesotech M3
-multibeam data recorded in *.all files.
-
-Formats 58 (MBF_EM710RAW) and 59 (MBF_EM710MBA): Fixed calculation of beam
-takeoff angles for raytracing from the raw range and angle data records by
-including code made available by Jonathan Beaudoin. Recalculation of
-bathymetry in current generation Kongsberg multibeam data appears to work
-now.
-
------> 5.4.2204 (September 5, 2014)
-
-Mb7kpreprocess:  Changed handling of roll, pitch, and heave compensation
-to deal with deep water Reson 7150 data.
-
-Format 88 (MBF_RESON7KR): Changed handling of roll, pitch, and heave compensation
-to deal with deep water Reson 7150 data.
-
-Mbdefaults: Added control of default color and shading settings for mbgrdviz and
-mbeditviz.
-
-Format 231 (MBF_3DDEPTHP): Fixed the mbsys_3datdepthlidar_insert_nav() function
-to apply changes to all pulses.
-
-Mbgrdviz and Mbeditviz: Default color and shading settings now can be set using
-mbdefaults.
-
------> 5.4.2202 (August 25, 2014)
-
-Format 88 (MBF_RESON7KR): Enlarged the maximum number of beams to 1024 in order
-to handle 7150 data with >800 beams.
-
-Format 21 (MBF_HSATLRAW): Augmented to trim trailing blank space at the end of
-lines before parsing - this allows reading Hydrosweep DS data in the form
-held by NIO.
-
------> 5.4.2201 (August 20, 2014)
-
-Mbm_grdplot: Added two "sealevel" color palletes that use Haxby colors for
-negative values (e.g. topography below sea level) and either greens or browns
-for positive values (e.g. topography above sea level). The Sealevel 2 pallette
-was contributed by Jenny Paduan.
-
-Mbeditviz: Changed default illumination parameters to magnitude=1.0 and
-elevation=5.0.
-
-Mbgrdviz: Changed default illumination parameters to magnitude=1.0 and
-elevation=5.0.
-
-Mbnavadjust: Added views for 10% coverage crossings.
-
-Mb7kpreprocess: Added kluge function to "tweak" the beam angles as if the speed of
-sound used for beamforming had been wrong.
-
------> 5.4.2200 (July 24, 2014)
-
-Format 121 (MBF_GSFGENMB): Fixed bug in which null sensor depth and altitude
-values are handled incorrectly.
-
------> 5.4.2199 (July 20, 2014)
-
-Format 121 (MBF_GSFGENMB): Modified GSF 3.06 source files gsf.c gsf_indx.c to
-disable recasting of fundamental file io functions (fopen(), fseek(), ftell(),
-stat()) when the compile flag -DUSE_DEFAULT_FILE_FUNCTIONS is defined. This
-allows MB-System builds to just use the normal file functions without changing
-the build behavior of the code in other contexts. The issue is that Leidos is
-supporting 64-bit file i/o in binaries for 32-bit architectures. The consequence
-of this change in MB-System is that MB-System will not support GSF files that
-are 2 GB or larger when built on or for 32-bit systems.
-
-mbpreprocess: Fixed bug in merging of asynchronous attitude data. This program
-is not ready for general use.
-
------> 5.4.2196 (July 14, 2014)
-
-mbotps: Added -P option to specify the location of the OTPS package.
-
-mbsslayout: Made to work (again) with Reson 7k data with embedded Edgetech
-sidescan and subbottom data.
-
-mb7kpreprocess: Made to work (again) with Reson 7k data with embedded Edgetech
-sidescan and subbottom data.
-
-mbextractsegy: Made to work (again) with Reson 7k data with embedded Edgetech
-sidescan and subbottom data.
-
------> 5.4.2195 (July 9, 2014)
-
-Format 88 (MBF_RESON7KR): Fixed bug in mbsys_reson7k_extract_altitude().
-
-Format 132 (MBF_EDGJSTAR): Added mbsys_jstar_insert_altitude() to support
-mbpreprocess and mbsslayout. Fixed handling of heading on extract and insert.
-
-mbm_route2mission: Removed confusing juxtaposition of estimated AUV mission time
-with actual AUV mission termination time in the output AUV mission script.
-
-mbpreprocess: Added ability to merge altitude data. Tested successfully with
-raw Edgetech sidescan data collected without embedded navigation, attitude,
-or anything really.
-
-mbsslayout: A new program to lay out raw sidescan onto the seafloor, most
-often on a 3D seafloor topographic model. Achieved functionality, at least 
-for use with Edgetech sidescan data in Jstar format.
-
------> 5.4.2194 (July 8, 2014)
-
-Format 121 (MBF_GSFGENMB): Updated source files in src/gsf/ to GSF release 3.06.
-
-Format 121 (MBF_GSFGENMB): Fixed scaling of array values in GSF files to allow
-depth and distance resolutions better than 1 cm.
-
-Formats 58 (MBF_EM710RAW) and 59 (MBF_EM710MBA) to support EM2040D data, in which
-dual sonars ping simulatneously.
-
------> 5.4.2191 (June 4, 2014)
-
-Install_makefiles: Fixed old build system so that it successfully compiles and
-links the new, unfinished program mbsslayout.
-
------> 5.4.2189 (June 4, 2014)
-
-Format 121 (MBF_GSFGENMB): Fixed bug that caused programs reading GSF data to hang
-when the GSF file ends with a partial or corrupted data record.
-
-MBeditviz: Added capability to set the color of selected soundings (e.g. soundings
-associated with a particular file or particular section of trackline).
-
-Format 88 (MBF_RESON7KR): Added support for pitch stabilization.
-
-MB7kpreprocess: Added support for pitch stabilization in Reson 7k data.
-
------> 5.4.2188 (May 31, 2014)
-
-Format 121 (MBF_GSFGENMB): Fixed bug that caused crashes when the GSF file
-contains a zero length comment.
-
-Format 64 (MBF_MR1PRVR2): Fixed bug that caused crashes when copying data from
-MR1 file to an fbt file when comments are longer than supported in fbt files.
-
-MBnavadjust: Fixed bug that reset the selected survey while doing autopicks.
-
------> 5.4.2187 (May 28, 2014)
-
-Format 201 (MBF_HYSWEEP1): Added code to ignore bad RMB records found in some
-NOAA HSX data.
-
-Format 88 (MBF_RESON7KR): Support for calibrated snippet records (contributed
-by David Finlayson).
-
-MB7kpreprocess: Support for calibrated snippet records (contributed
-by David Finlayson).
-
-MBnavadjustmerge: Fixed to handle projects not in the current working directory.
-
------> 5.4.2186 (May 26, 2014)
-
-MBeditviz: Fixed interactive application of pitch bias and heading bias changes.
-
-MBnavadjustmerge: New program to merge two existing MBnavadjust projects.
-
------> 5.4.2185 (May 17, 2014)
-
-MBrolltimelag: Now checks for case when all beams are flagged.
-
-MBlist: Added beamflag values to those that can be printed ('F' or 'f').
-
-Bathymetry editing: Fixed bug that prevented successful flagging of some beams
-when files include simultaneous pings with different numbers of beams.
-
-GSF library: Updated to new release 03.05. This release is licensed using LGPL 2.1.
-
------> 5.4.2185 (May 11, 2014)
-
-Several programs: Fixed formating error in printing system time_tm.tv_sec values.
-
-MBsvpselect: Fixed sscanf format warning.
-
-MBcopy: Fixed array dimensioning bug that occasionally caused buffer overflows.
-
-MBnavadjust: Moved some declarations from mbnavadjust_prog.c to mbnavadjust.h in
-preparation for breaking project i/o out into a separate source file to be shared
-with the new program mbnavadjustmerge.
-
-MBsslayout: Added shell of program under development to read sidescan in raw time
-series form, lay the sidescan out regularly sampled on a specified topography
-model, and output the sidescan to format 71 (MBF_MBLDEOIH) files.
-
-HSDS formats (MBF_HSATLRAW, MBF_HSLDEDMB, MBF_HSURIVAX, MBF_HSURICEN): Fixed bug
-in handling of system gain arrays (16 rather than 59 values).
-
-MBsegygrid: Attempted to incorporate actual nonvertical geometry into the
-subbottom sections - not satisfactory yet.
-
-MBrolltimelag: Fixed bug regarding the default roll source. The program will
-now work with roll values derived from survey records by default.
-
-Format 88 (MBF_RESON7KR): Cleaned up some debug print statements.
-
-MBinsreprocess: Incomplete new MB6 program to reprocess INS data of various sorts
-to improve on realtime Kalman filtered navigation and attitude data.
-
-MBsslayout: Incomplete new MB6 program to perform layout of time series sidescan
-onto a 3D topography model. This will replace mb7k2ss and extend the functionality
-to conventional sidescan data in several data formats.
-
-Mbm_route2mission: Fixed output AUV mission script to have "\r\n" line ends on
-all lines.
-
-Format 222 (MBF_SWPLSSXP): Revised implementation of SEA SwathPlus SXP data format
-(format id 222) contributed by David Finlayson.
-
-Format 121 (MBF_GSFGENMB): Changed the source for the internally supplied GSF
-library to be the new 3.05 release. This includes for the first time a proper
-open source license (LGPL 2.1).
-
------> 5.4.2184 (April 22, 2014)
-
-
-src/bsio/Makefile.in: Added to archive (previously mistakenly left out).
-
------> 5.4.2183 (April 16, 2014)
-
-Many programs: Fixed handling of system time character string provided by
-function ctime() to prevent occasional overflows.
-
-Format 222 (MBF_SWPLSSXP): Revised implementation of SEA SwathPlus SXP data format
-(format id 222) contributed by David Finlayson.
-
-MBswplspreprocess: Preprocess program for SEA SwathPlus SXP data format
-(format id 222) contributed by David Finlayson. This was formerly known as
-mbsxppreprocess.
-
------> 5.4.2182 (April 8, 2014)
-
-Format 231 (MBF_3DDEPTHP): Added new raw Lidar record to be used by 3DatDepth.
-
-Format 201 (): Corrected bug in handling of navigation in projected coordinate
-systems.
-
-mbio/mb_navint.c and mbio/mb_define.h: Added a new function mb_navint_prjinterp()
-that interpolates navigation and speed from internal runnings lists assuming the
-navigation is in eastings and northings rather than longitude and latitude.
-
------> 5.4.2181 (April 4, 2014)
-
-Release 5.4.2181
-
-htmlsrc/mbsystem_home.html & htmlsrc/mbsystem_faq.html: Actually committed
-pictures of Christian Ferreira and Krystle Anderson to the archive
-
------> 5.4.2180 (April 2, 2014)
-
-htmlsrc/mbsystem_home.html & htmlsrc/mbsystem_faq.html: Updated references
-to the MB-System team in the html documentation to include Christian Ferreira
-and Krystle Anderson.
-
-htmlsrc/mbsystem_how_to_get.html: Updated installation instructions
-in the html documentation.
-
-MB7kpreprocess: recoded the application of time domain filtering of pressure
-depth data to be much more efficient.
-
-Format 132 (MBF_EDGJSTAR): Supported obsolete sidescan records with 80 byte
-traceheaders.
-
-MBextractsegy: Now works with Edgetech Jstar files.
-
-MBauvloglist: reset default printing of timestamp values.
-
-Mbset: modified so that when mbset is used to turn off a mode that implies
-use of an external file, the associated filename is also erased. For example
-    mbset -PSVPMODE:0
-will now also erase (null) the filename set by -PSVPFILE.
-
-Mbm_grd3dplot, mbm_grdplot, mbm_histplot, mbm_plot, mbm_xyplot: added support
-for the evince postscript viewer.
-
-Format 172 (MBF_HIR2RNAV) and format 173 (MBF_MGD77TXT): fixed segmentation
-faults while handling comment records.
-
-MBlist: The 'N' output option will now use actual ping numbers if those are
-available (instead of ping count in the file).
-
-MBroutetime: Now exits with error message if no start line or end line waypoints
-are read from the input route file.
-
------> 5.4.2176 (March 18, 2014)
-
-Release 5.4.2176
-
------> 5.4.2175 (March 18, 2014)
-
-Configure.ac: Removed reference to src/mbsvptool (src/mbsvptool/mbsvptool.c
-was moved to src/utilities/mbsvpselect.c for 5.4.2173).
-
-MBnavadjust: The program generates route files of crossings and ties that
-can be viewed in mbgrdviz. The coloring of the crossings and ties when
-displayed in mbgrdviz has changed. The route files generated are:
-    True Crossings (unfixed)
-    >50% Crossings (unfixed)
-    >25% && <50% Crossings (unfixed)
-    <25% Crossings (unfixed)
-    Ties (unfixed)
-    Ties (fixed)
-For the crossing files, individual crossings are colored as:
-    Unset - Red
-    Skipped - Yellow
-    Set - Green
-For the tie files, individual ties are colored as:
-    Ties (unfixed) - Blue-Green
-    Ties (fixed) - Purple
-
-All source files: Updated copyright notices to 2014.
-
------> 5.4.2173 (March 17, 2014)
-
-MBsvpselect: Added program contributed by Ammar Aljuhne and Christian Ferreira
-of MARUM (University of Bremen). This program chooses and implements the best
-available sound speed model for each swath file in a survey. The user  provides
-a  list of the available sound speed models and specifies the criteria used for
-model selection. The program uses mbset to turn on bathymetry recalculation by
-raytracing through the sound speed model selected for each swath file.
-
-MBsvplist: The SVP files output by mbsvplist now include a header line that
-is recognized by mbsvpselect. This header line includes the time stamp and
-position associated with the SVP record's location in the swath file.
-
-MBpreprocess: Added an incomplete manual page for this incomplete MB-System 6
-program.
-
------> 5.4.2172 (March 14, 2014)
-
-MBmosaic: Added option to apply priorities based on the platform heading.
-
-Format 64 (MBF_MR1PRVR2): Hawaii Mapping Research Group (HMRG) data format
-updated to use the current library and thereby support post-2005 data.
-Removed old HMRG mr1pr library from mbsystem/src and added current bsio
-library.
-
-MBgrdviz: Modified handling of routes so that if a route header contains a line
-like:
-      ## ROUTEEDITMODE:0
-then the route cannot be changed in MBgrdviz.
-
-MBnavadjust: Changed so that when a project is output, mbnavadjust writes out
-five different route files in which each tie point or crossing is a two point route
-consisting of the connected snav points
-- route files of ties (fixed and unfixed separate) represent each tie as a
-two point route consisting of the connected snav points
-- route files of crossings (<25%, >= 25% && < 50%, >= 50%, true crossings)
-represent each crossing as a two point route consisting of the central
-snav points for each of the two sections.
-
-Mbvelocitytool: made all filename and command strings type mb_path, which is
-a 1024 byte char array.
-
-Format 173 (MBF_MGD77TXT): Added format to read and write MGD77 format
-underway geophysical data files with "\r\n" characters at the ends of the
-data records.
-
-Format 174 (MBF_MGD77TAB): Added format to read and write MGD77T format
-underway geophysical data files with tab delimiters and "\r\n" characters
-at the ends of the data records.
-
------> 5.4.2168 (February 19, 2014)
-
-Mbinfo: Fixed bug in variance calculation (memory overwrites of the relevant arrays).
-
------> 5.4.2165 (February 18, 2014)
-
-Format 241 (MBF_WASSPENL): Made format suffix ".000" recognizable as format 241.
-
-
------> 5.4.2164 (February 15, 2014)
-
-Format 241 (MBF_WASSPENL): added new format for WASSP multibeam sonar.
-
-Format 151 (MBF_OMGHDCSJ): applied patch supplied by Bob Covill.
-
-Mbrolltimelag: fixed so that the program works with data formats for which the
-roll source is the survey records.
-
-Mbauvloglist: added capability to merge navigation from external files.
-
------> 5.4.2163 (January 31, 2014)
-
-Format 71 (MBF_MBLDEOIH): fixed a recently introduced error in scaling of
-bathymetry values. This error impacts the fbt files, and consequently will
-mess up bathymetry gridding and plotting. It's important to update installations
-to 5.4.2163.
-
-MBextractsegy: Fixed so correct navigation is inserted in both the source and
-group position fields in the segy traceheader.
-
------> 5.4.2162 (January 24, 2014)
-
-Format 88 (MBF_RESON7KR): fixed crash when generating sidescan from pings with no valid beams.
-
-Format 201 (MBF_HYSWEEP1): fixed crash when generating sidescan from pings with no valid beams.
-
-Build system: Altered so the configure script works with standard options.
-
------> 5.4.2161 (January 21, 2014)
-
-MBedit: fixed use of beamflag setting macros that were messed up yesterday.
-
------> 5.4.2160 (January 20, 2014)
-
-General: fixed many compiler warnings.
-
-General: implemented changes suggested by Joaquim Luis in order to enable
-building MB-System on Windows systems.
-
------> 5.4.2159 (January 18, 2014)
-
-Release 5.4.2159.
-
------> 5.4.2158 (January 18, 2014)
-
-Many changes, including:
-  - Support for new format of lidar data
-  - Fixes to support swath data with sub-cm lateral resolution
-  - Fix so that mbnavadjust works when built with shared libraries.
-    - this involved changes to the contouring code in the mbaux library.
-  - Augmentation of the AUV mission planning capability
-  - Improvement to mbm_grdplot output for maps of small areas
-  - Fixes to the configure build system
-    - now allows MB-System to be built using an externally installed
-      libproj or the proj library bundled with MB-System
-    - using --disable-gsf now works properly to build without any use of
-      or entanglement with libgsf.
-        
------> 5.4.2157 (October 14, 2013)
-
-Mbm_makesvp: New macro to extract sound speed and depth data from a datalist of
-swath files, and generate a sound velocity profile model from averages of the
-sound speed values in regular depth ranges. This macro uses mbctdlist to extract
-the sound speed values embedded in swath data files is intended for use with
-mapping data from submerged platforms (e.g. ROVs and AUVs) carrying CTD or
-sound speed sensors. 
-
------> 5.4.2155 (October 13, 2013)
-
-MBvelocitytool: Fixed problems with bad calculations after loading more than
-one swath data.
-
-MBgrdtiff, mbm_grdtiff: Added capability to output a *.tfw "world" file parallel
-to the GeoTiff image. Some software does not recognize the coordinate system
-information embedded in the GeoTiff file.
-
-MBsegygrid: Added capability for simple time domain low-pass filtering.
-
-MBrphsbias: Added incomplete new program that will, when complete, use a brute
-force multidimensional search obtain optimized estimates for bias parameters
-from a specified dataset. There is no documentation yet as the program currently
-does nothing but compile and read data.
-
------> 5.4.2154 (September 26, 2013)
-
-MBkongsbergpreprocess, MB7kpreprocess, MBhysweeppreprocess, mbprocess:
-Fixed errors in navigation interpolation introduced in 5.4.2152.
-
-Format 84 (MBF_XTFR8101): Fixed initialization of the storage data structure.
-
-Committed from CCGS Sir Wilfrid Laurier at 116d 04.4876' W, 68d 57.30' N.
-
------> 5.4.2153 (September 22, 2013)
-
-Format 201 (Hysweep HSX): fixed sign error in handling of pitch values.
-
------> 5.4.2152 (September 16, 2013)
-
-Formats 58 (Kongsberg raw), 59 (Kongsberg extended), 88 (Reson 7k):
-Fixed problem with interpolation of heading for Kongsberg and Reson data.
-Eliminated possibility of negative headings being inserted into the storage
-data structure.
-
-Format 222: Inserted initial implementation of SEA SwathPlus sxp data format
-(format id 222) contributed by David Finlayson with minor changes. This format
-support is still developmental.
-
-Build system: Applied patch contributed by Frank Delahoyde with additional fixes
-to configure.ac and the src/*/Makefile.am files.
-
------> 5.4.2151 (September 12, 2013)
-
-Many *.c files: hundreds of small changes to eliminate compiler warning messages
-on various types of systems.
-
-Build system: Changes to configure.ac, autogen.sh, and src/*/Makefile.am files
-based on suggestions from Frank Delahoyde of SIO and Kurt Schwehr of Google.
-
------> 5.4.2149 (September 2, 2013)
-
-Src directories src/mbio and src/utilities: Fixed a number of debug print
-statements that treated pointer values as %ul rather than %p.
-
------> 5.4.2148 (August 28, 2013)
-
-Buildsystem: More tweaking of configure.ac file, including making the comments
-output more sensible.
-
------> 5.4.2147 (August 27, 2013)
-
-Buildsystem: More tweaking of configure.in file trying to get MB-System to build
-on Ubuntu 12.04.02LTS. Moved configure.in to configure.ac to conform to current
-autoconf file naming conventions.
-
------> 5.4.2144 (August 26, 2013)
-
-Buildsystem: Added src/mbgrdviz/Makefile.in and src/mbeditviz/Makefile.in to the
-subversion source archive.
-
-Format 201 (Hysweep HSX): Changed mbr_rt_hysweep1() in mbr_hysweep1.c so that
-survey records without navigation and/or attitude data do not have an error
-set. This means that data missing nav and/or attitude will still be
-processable.
-
-Format 121 (GSF): Now recognizes and appropriately treats null values for
-position, attitude, speed, and sonar depth.
-
------> 5.4.2143 (August 24, 2013)
-
-MBsxppreprocess: Added nonfunctional stub for program mbsxppreprocess to be
-developed by David Finlayson.
-
------> 5.4.2141 (August 24, 2013)
-
-Build system, MBgrdviz, MBeditviz, MBview: Moved source files for MBgrdviz
-and MBeditviz from src/mbview to src/mbgrdviz and src/mbeditviz, respectively.
-This move separates the application source files for MBgrdviz and MBeditviz
-from the source files of the mbview library.
-
------> 5.4.2139 (August 19, 2013)
-
-Build system: Further modification to the src/mbview/Makefile.am file.
-
------> 5.4.2138 (August 18, 2013)
-
-Build system: Further modifications to the Makefile.am files.
-
-MBopts: Now allows users to specify the tide model used by OTPS. Also now works
-with all three variants of the OTPS package.
-
-MBareaclean: Fixed memory allocations problems.
-
-MBgrdviz: Added capability to launch mbnavedit and mbvelocitytool on selected
-swath data (contributed by Christian Ferreira).
-
------> 5.4.2137 (August 9, 2013)
-
-Build system: Still attempting to fix problems with the autoconf build system on
-Ubuntu machines. Change mbsystem/src/opts/Makefile.am so that building this
-utility does not depend on GMT libraries (since it doesn't).
-
------> 5.4.2136 (August 8, 2013)
-
-Build system: Attempted to fix problems with the autoconf build system on
-Ubuntu machines. Reset the automake version to 2.65 from 2.69 as specified
-in the mbsystem/configure.in file. Also added a conditional reference to
-libmbgsf to the requirements for mbcopy in mbsystem/src/utilities/Makefile.am.
-
------> 5.4.2135 (August 7, 2013)
-
-Mbdatalist: Fixed generation of old-format fbt files.
-
-Web page documentation: Updated basic web pages included in the distribution.
-
------> 5.4.2134 (July 31, 2013)
-
-Heading and nav interpolation (src/mbaux/mb_spline.c): Fixed function
-mb_linear_interp_degrees() so that negative latitude values are allowed.
-
-Mbkongsbergpreprocess: Added checking so that interpolated heading and
-navigation are in the correct domains.
-
------> 5.4.2133 (July 29, 2013)
-
-Heading and nav interpolation (src/mbaux/mb_spline.c): Modified function
-mb_linear_interp_degrees() so that return values must be in the range
-  0.0 <= value < 360.0
-to fix bad heading values near due north.
-
-Mbclean: added -Ttolerance option which will recast the timestamps of edit
-events read from edit save files to match the pingtimes, where the tolerance
-value in seconds defines how close the timestamps must be to be considered the
-same. This is used to override timestamp differences greater than 0.0011 seconds
-that can arise when edits are extracted from one set of files (perhaps processed
-using software other than MB-System) using mbgetesf and then applied to a
-different set of files (presumably as part of MB-System processing).
-
------> 5.4.2132 (July 26, 2013)
-
-Format 88 (Reson s7k): Fixed layout of snippet backscatter into sidescan in the
-near-nadir region.
-
-Format 88 (Reson s7k): Mbprocess now routinely recreates multibeam sidescan
-during processing. This allows backscatter from beams flagged as bad to be
-excluded from the multibeam sidescan.
-
-Mbinfo: Fixes to XML output from mbinfo (Christian Ferreira)
-
-Format 201 (Hysweep): Substantially changed i/o logic to handle the many
-different variants of data logged through Hysweep.
-
-Format 201 (Hysweep): Augmented to handle sidescan data in conjunction with
-multibeam bathymetry. The i/o module will lay the raw sidescan out on the
-bathymetry to generate "processed" sidescan. That will be included in any output
-file as MSS records (an MB-System extension to the HSX format), which can be
-corrected and filtered in the usual way.
-
-Format 88 (Reson s7k): Fixed bug in which sidescan generated from backscatter
-records was flipped port to starboard. Also fixed layout of backscatter in the
-near-nadir region.
-
------> 5.4.2129 (July 8, 2013)
-
-Build system: Attempted to implement changes to the build system suggested by
-Kurt Schwehr and Hamish Bowman.
-
-Mbrolltimelag: Augmented to allow specification of the time lag interval used
-in correllation calculations with arbitrary start and end times.
-
-Mbnavlist: Fixed problems with outputting attitude data from some variants of
-Kongsberg data.
-
-Mbgrid: Changed the convergence criteria for the zgrid interpolation algorithm
-to simply be that the largest change in the grid value is no more than 1 mm.
-
-Formats 56 and 57: Augmented handling of Kongsberg EM1002 data to recognize and
-fix erroneous transmit and receive beamwidth values.
-
-Mbprocess and mbvelocitytool: Augmented raytracing code to handle high angle
-rays without rounding errors producing a square root of a negative number.
-This fixed problems with sample EM1002 data.
-
------> 5.4.2128 (June 18, 2013)
-
-Mblist: Fixed bug that flagged as bad all sidescan pixels with negative values.
-
-src/mbio/projections.h and src/utilities/levitus.h: Removed from svn version
-control as these are created during the build process.
-
-Build system: Implemented changes to the build system contributed by
-Kurt Schwehr that enable building MB-System without support for GSF or inclusion
-of the GSF source code from SAIC. This optional removal of GSF support addresses
-the lack of a proper open source or free software license for the GSF source
-code distribution from SAIC. MB-System distributions that include GSF code or
-require the GSF library cannot be included in official open source package
-collections such as Debian.
-
-Mbgrid: Changed the usage of the zgrid interpolation by mbgrid. Release 5.3.1989
-included changes to speed up interpolation by calculating a smooth model for a
-low resolution grid and then resampling this onto the full resolution grid. This
-approach has the problem that the low resolution interpolation can work poorly
-near data. Mbgrid still does low resolution interpolation as part of the
-slope estimation stage of algorithms 5 and 6 and as part of background
-interpolation, but once again does the primary interpolation stage at full
-resolution.
-
------> 5.4.2123 (June 10, 2013)
-
-Many changes implementing fixes to the new build system from Bob Covill,
-Hamish Bowman, and Christian Ferreira. Moved key auto-generated header file
-from mbsystem/src/mbsystem_config.h to mbsystem/src/mbio/mb_config.h.
-
-Mbm_route2mission: added support for more than one type of survey behavior
-in an AUV mission as controlled by waypoint type in the route files
-exported from mbgrdviz.
-
-Moved program hsdump to mbhsdump.
-
-Fixed some potential buffer overflows and other errors identified by
-Hamish Bowman.
-
-Changed the header of the mbm_* perl macros to #!/usr/bin/env perl as
-suggested by Hamish Bowman and Kurt Schwehr.
-
------> 5.4.2082 (May 24, 2013)
-
-Configure.cmd: Added -DBYTESWAPPED to the recommended pre-options for the
-configure script on Macs.
-
-MBF_EM710RAW (format 58) and MBF_EM710MBA (format 59): Added EM2045 to the
-list of supported Kongsberg multibeam sonars (also known as the EM2040D).
-
------> 5.4.2081 (May 23, 2013)
-
-Build System: Have implemented an autotools-based build system with a
-configure script, following on the initial work by Bob Covill and others.
-The man page and web page documentation have been moved into the source
-tree. The old install_makefiles build system has been updated to still work.
-
--------------------------------------------------------------------------------
-MB-SYSTEM VERSION 5.3 RELEASE NOTES:
--------------------------------------------------------------------------------
-
------> 5.3.2062 (May 17, 2013)
-
-Mbprocess: Fixed a couple more mistakes on lines 5659 and 5662 in mbprocess.c.
-
------> 5.3.2061 (May 16, 2013)
-
-Perl macros: Renamed all perl source files in mbsystem/src/macros by removing
-the *.pl suffix. This is another change to allow use of the GNU autotools for
-building MB-System. The easy way for automake to handle executable scripts is
-to just copy them to the bin directory; renaming the scripts is harder to set
-up.
-
------> 5.3.2060 (May 14, 2013)
-
-Mbsvplist: Added -N option to limit the number of SVP profiles that can be
-output. (contributed by Suzanne O'Hara)
-
------> 5.3.2059 (May 14, 2013)
-
-Mbprocess: Fixed bug in mbprocess in which angle rotation calculations mixed
-degrees and radians when attitude is merged as part of an external navigation
-stream. (Contributed by Bob Covill)
-
-Mbsvplist: Added -T option to output CSV delimited table
-(contributed by Suzanne O'Hara)
-
------> 5.3.2056 (May 7, 2013)
-
-Formats 221 and 222: Added empty i/o module files to ultimately support two
-new formats, both handling data from SEA SWATHplus interferometric sonars:
-	MBF_SWPLSSXI - 221
-	MBF_SWPLSSXP - 222
-The new files include:
-	mbio/mbsys_swathplus.c
-	mbio/mbsys_swathplus.h
-	mbio/mbr_swplssxi.c
-	mbio/mbr_swplssxp.c
-
------> 5.3.2055 (May 7, 2013)
-
-Many files: fixed issues that result in compiler warnings.
-
-Mb7k2ss: Fixed problem that overwrote the first extracted sidescan line.
-
-Mbgrid: Added gridding algorithm 6, called footprint weighted mean. This
-differs from algorithm 5, called footprint slope weighted mean, in that it
-omits the use of the local slope, and thus requires only a single pass
-through the data.
-
-Format 121 (GSF): Added fix from Christian Ferreira to reset the
-depth_corrector value to zero if necessary
-
------> 5.3.2053 (April 4, 2013)
-
-Mb7k2ss: Fixed line breakouts so that the first line is output separate from
-the second.
-
-Formats 162, 163, 168, 169 (text xyz variants): Fixed i/o modules to handle files
-with leading white space before the first column.
-
-Mbset: Added -N option to turn off merging of navigation from MBnavadjust and
-also remove the *.na0 files.
-
-Mbgrid, mbmosaic, mbm_grid: Fixed documentation descriptions of the options
-controlling the spline interpolation, particularly the tension.
-
-Mbm_grdtiff: Fixed the image display program called in the tiff-creating
-script created by mbm_grdtiff.
-
-Mbdatalist: Recast the output format for the -S option. One now gets a single
-line of output for each file unless the -V option is also specified.
-
------> 5.3.2051 (March 20, 2013)
-
-Formats 58 and 59 (mbf): The calculation of "sidescan" from raw backscatter
-samples has been improved. The sidescan can now be successfully
-recalculated by mbprocess following application of bathymetry edits.
-
-Mbprocess: Recalculation of Konsberg multibeam sidescan now enabled for
-formats 58 (mbf_em710raw) and 59 (mbf_em710mba) with command
-mbset -PSSRECALCMODE:1.
-
-Mbedit: soundings originally flagged by the sonar now return to that
-state if they are unflagged and then reflagged interactively.
-
-Mbgrdviz: Disabled "goaway" buttons in dialogs to minimize crashes.
-
-Mbeditviz: Disabled "goaway" buttons in dialogs to minimize crashes.
-
-Mbm_grdplot: Updated macros to derive system defaults from mbdefaults.
-
-Mbm_grdtiff: Updated macros to derive system defaults from mbdefaults.
-
-Mbm_histplot: Updated macros to derive system defaults from mbdefaults.
-
-Mbm_grd3dplot: Updated macros to derive system defaults from mbdefaults.
-
-Mbm_vrefcheck: Updated macros to derive system defaults from mbdefaults.
-
-Mbm_plot: Updated macros to derive system defaults from mbdefaults.
-
------> 5.3.2042 (March 12, 2013)
-
-MBkongsbergpreprocess: Fixed calculation of transmit time for sector subpings.
-
-Format 58 (mbf_em710raw): Improved translation of bottom pick parameters to
-beam flags.
-
-MBgrdviz: Added export of routes to Hypack lnw format and to degrees + decimal
-minutes format.
-
------> 5.3.2017 (March 3, 2013)
-
-Mb7k2ss: Program exits if topography grid specified but reading the file fails.
-
------> 5.3.2016 (March 2, 2013)
-
-Mb7k2ss: Fixed plotting correlation functions.
-
-Mbm_xyplot: Fixed handling of NaN values in input data - no longer includes NaN
-inputs in sorting to determine min max.
-
------> 5.3.2015 (March 1, 2013)
-
-Format 88 (mbf_reson7kr): Fixed some debugging print statements of hexadecimal
-values.
-
-Mbm_route2mission: Added command line control of multibeam sonar settings.
-
-Mbprocess: Fixed handling of tide data with just one value.
-
-Mbeditviz: Fixed calculation of corrected attitude and position for pings at
-start and end of files.Previously badly mislocated pings happened unpredictably.
-
-Mbfilter: Fixed handling of nonfatal read errors.
-
-Format 94 (mbf_l3xseraw): Made storage available for sound speed profiles much
-larger to handle some ridiculous data samples.
-
-Mbauvloglist: Added code to output readable date and time values if desired.
-
-mbm_xbt: Fixed code to more generally handle actual headers in Sippican MK12 data.
-
-mbaux/mb_spline.c: Fixed extrapolation error in linear interpolation code.
-
-Formats 162, 163, 168, 169 (xyz, yxz, xyt, yxt): Augmented code to handle text
-triples with NaN values.
-
-Mbotps: made /usr/local/otps the default location for the OSU Tidal Prediction Software (OTPS)
-
-Format 21 (mbf_hsatlraw): Fixed failure to initialize the internal storage structure.
-
------> 5.3.2013 (January 29, 2013)
-
-Format 94 (mbf_l3xseraw): Fixed bug causing memory faults in Linux when data
-with large svp records are encountered. SVP records can now have as many as
-8192 entries.
-
------> 5.3.2012 (January 25, 2013)
-
-Mbkongsbergpreprocess: Fixed bug causing seg faults on Linux
-
------> 5.3.2011 (January 17, 2013)
-
-Format 88 (mbf_reson7kr): Removed debug messages left in by mistake
-
------> 5.3.2010 (January 14, 2013)
-
-Format 88 (mbf_reson7kr): Fixed reporting of angular beam widths, particularly
-for pre-2009 data in which the alongtrack value was reported incorrectly.
-
-Mbgrid: Changed the weighted footprint algorithm to correctly use the beamwidth
-scaling parameter set with the -W option.
-
------> 5.3.2009 (January 10, 2013)
-
-Format 88 (mbf_reson7kr): Fixed a bug introduced at 5.3.2004 in first-time
-parsing of current Reson 7k data that caused erroneous flagging of some beams.
-
------> 5.3.2008 (January 6, 2013)
-
------> 5.3.2007 (January 5, 2013)
-
-Mbkongsbergpreprocess: Fixed -O option to direct all output to a single file.
-Mb7kpreprocess: Fixed -O option to direct all output to a single file.
-
------> 5.3.2006 (January 4, 2013)
-
-Mbkongsbergpreprocess: Fixed -D option to put output files in the specified
-directory.
-
------> 5.3.2005 (December 31, 2012)
-
-Mbsvplist: Added -M option to control SVP printing. If mode=0 (the default), then
-the first SVP of each file will be output, plus any SVP that is different from
-the previous SVP. If mode=1, then only the first instance of each unique SVP will
-be output, even through multiple files referenced through a datalist structure.
-If mode=2, then all SVPs will be output even if they are duplicates (equivalent
-to the -D option). The -D option is retained for compatibility.
-
-Format 88 (mbf_reson7kr): MB-System now recognizes files with a *.7k suffix as
-Reson multibeam data in format 88. Usually Reson data are logged to files with
-a *.s7k suffix.
-
-Mbm_route2mission: Updated the calculation of the number of photos to be taken
-during a Dorado-class AUV bottom photography mission.
-
-Formats 58 (mbf_em710raw) and 59 (mbf_em710mba): Added support for for the
-"Extraparameters" datagram.
-
-Formats 58 (mbf_em710raw) and 59 (mbf_em710mba): Changed the encoding of binary
-values in the format 58 and 59 files written by MB-System to be little-endian
-(Intel byte order). The Kongsberg format specification allows byte encoding to
-be little or big-endian, and previously MB-System has consistently used big-endian.
-
-Mblist: Fixed bug regarding the output of transmit pulse length values.
-
-Mbprocess: Altered mbprocess so that input SVP files are checked for zero
-thickness layers.
-
------> 5.3.2004 (December 12, 2012)
-
-Mbsvplist: Added -S option to output surface sound speed from survey data rather
-
-Mb7kpreprocess: Changed lever arm correction specified with the -D option to
-involve three dimensions rather than just two.
-
-Format 88 (mbf_reson7kr): Fixed so that mbctdlist and mbsvplist can output
-surface sound speed values from Reson 7k data.
-
-Format 88 (mbf_reson7kr): Fixed so that the storage of bathymetry acrosstrack and
-alongtrack distance values in bathymetry (7006) records is correct. MB-System has
-output incorrect 7006 records since the Reson 7k format (88) was first supported.
-The error was that the acrosstrack and alongtrack distance values were transposed
-relative to the format specification and the data output by the PDS2000 datalogger
-(a reality that only became apparent when I finally had access to a sample of
-PDS2000-logged data). The format 88 i/o module has been augmented to detect if
-data being read derives from pre-fix versions of MB-System, and to fix the data
-if necessary. The existence of this error and its fix should be invisible to
-users, except that data written by pre-fix MB-System will probably import to
-other software packages with the acrosstrack and alongtrack distances switched.
-
-Mbmosaic: Fixed azimuthal priority weighting so that directional mosaicing is
-more reliable.
-
------> 5.3.2000 (Navember 14, 2012)
-
-Mbinfo: Changed mbinfo to gracefully handle the situation of reading a file that
-has no data records while the -P option is specified (gracefully means not
-seg faulting).
-
-Mbmosaic: fixed bug in the use of the azimuth weighting factor.
-
------> 5.3.1999 (Navember 13, 2012)
-
-Mbm_route2mission: Added multibeam pulse length as a command line argument.
-
-Mbnavadjust: Added capability to solve for a z-offset model in which each
-survey has a uniform or constant z-offset, and then reset all ties automatically using
-those z-offsets.
-
-Format 88 (mbf_reson7kr): Fixed bug that caused seg faults with pings that have no valid soundings.
-
------> 5.3.1998 (Navember 6, 2012)
-
-Mb7kpreprocess: Added -C option to apply roll bias and pitch bias during preprocessing. Fixed
-rotation calculations so that side-looking and up looking mapping data can be handled
-properly.
-
-Mbmosaic: added checks for valid topography grid file.
-
-Mbprocess: Fixed rotation calculations so that side-looking and up looking mapping data
-can be handled properly.
-
-Mbm_route2mission: added handling of third specified altitude value in AUV missions.
-
-Mbeditviz: Fixed rotation calculations so that side-looking and up looking mapping data
-can be handled properly.
-
-Formats 56 (mbf_em300raw) and 57 (mbf_em300mba): added support for asynchronous attitude
-output, in particular by mbnavlist -K18.
-
------> 5.3.1995 (October 27, 2012)
------> 5.3.1994 (October 27, 2012)
-
-Mbfilter: when filtering sidescan the output file now includes any bathymetry available in the
-original file. The bathymetry can be used by mbmosaic for calculating apparent grazing
-angles and data priorities.
-
-Mbmosaic: substantially rewrote the calculation of apparent grazing angle for sidescan
-data to be more reliable and to optionally use a topographic model supplied by a
-topography grid (specified with the -T option).
-
-Mb7k2ss: removed functions associated with laying out sidescan on a 3D topographic
-model. These functions are now found in src/mbaux/mb_intersectgrid.c.
-
-Format 88 (mbf_reson7kr) and mb7kpreprocess: added support for multibeam sidescan
-derived from either the backscatter records or the snippet records. The snippets are
-generally better, and are the default source when . The program mb7kpreprocess can be
-set to generate the multibeam sidescan from either record type. The multibeam sidescan is stored using
-MB-System-only "processed sidescan" records as an MB-System-specific extension
-to the 7k format.
-
-libmbaux: added functions to the mbaux library that locate the intersection of
-arbitrary vectors from a sonar platform with a topographic grid. This code is
-located in src/mbaux/mb_intersectgrid.c, and includes functions formerly found
-in src/utilities/mb7k2ss.c. These functions are now used to lay sidescan out
-on a seafloor topographic model and to calculate the apparent grazing angles
-needed for angle-based priority calculation in mbmosaic.
-
-Mbgrid: fixed -Cclip[/mode] option so that -C0/3 will in fact fully interpolate
-the resulting grid.
-
-Format 88 (mbf_reson7kr): fixed travel time and angle calculation for current
-generation data using v2detectionsetup data records.
-
-Mbgrid and mbmosaic: Added -Rfactor option that will allow users to specify that
-the output grid extent will be the data extent expanded by a multiplicitive
-factor. For instance, specifying factor = 1.1 means the grid is expanded 5% to
-the west, east, south and north for a total expansion of 0.1 or 10%.
-
------> 5.3.1989 (October 4, 2012)
-
-Mbm_grdplot & mbm_grdtiff: Fixed application of strict color table bounds in
-mbm_grdplot and mbm_grdtiff.
-
-mb7k2ss: Added -Q option so that sidescan lines can be constructed based on the
-times starting and ending waypoints were reached.
-
-Format 71 (mbf_mbldeoih): Fixed scaling of sidescan values to handle data with
-small values.
-
-Mbgrid and mbmosaic: Fixed the zgrid interpolation code, and also changed the
-usage so that the interpolation stages will proceed much more rapidly. This is
-now accomplished for large grids by iteratively calculating a smooth Laplacian model
-for a low resolution grid and then resampling this onto the desired full resolution
-grid using bilinear interpolation.
-
------> 5.3.1988 (September 29, 2012)
-
-Format 71 (mbf_mbldeoih): Implemented automatic scaling of sidescan values to improve
-fidelity of stored values to the original values.
-
-MBeditviz: Fixed region selection to include topography min and max within that
-region.
-
-Reson 7k data (format 88, mbf_reson7kr): fixed calculation of beam angles from
-7026 7k Detection records.
-
-MBnavadjust: the tie (or block) view now honors the "With Selected Survey" and
-"With Selected File" display modes.
-
-MB7kpreprocess: Added control for the use or nonuse of attitude sensor time delay
-data embedded in MBARI "Bluefin Navigation" records.
-
-MB7k2ss: Added option to define sidescan line start and end points using a list
-of times generated using mbroutetime (duplicating an option of mbextractsegy).
-
-MB7k2ss: When extracting sidescan data from 7k data files to separate format 71 files,
-use navigation, heading, sonar depth, and attitude data from multibeam data records
-in the 7k data file (previously these values derived from asynchronous navigation,
-heading, attitude, etc, records).
-
------> 5.3.1986 (September 12, 2012)
-
-MBnavadjust now treats data from interferometric sonars different than data
-from other sonars. When interferometric bathymetry is imported, the many soundings
-are binned and averaged into 1-degree wide "pseudo-beams" to allow reasonable
-(both visually and computationally) contouring.
-
-Added MBIO function mb_sonartype() that returns the type of sonar associated
-with some data, using the definitions:
-  #define	MB_SONARTYPE_UNKNOWN		0
-  #define	MB_SONARTYPE_ECHOSOUNDER	1
-  #define	MB_SONARTYPE_MULTIBEAM		2
-  #define	MB_SONARTYPE_SIDESCAN		3
-  #define	MB_SONARTYPE_INTERFEROMETRIC	4
-
-Added function to mbnavadjust that will estimate vertical offset between surveys
-and then set relevant ties accordingly.
-
-Fixed some plotting defaults for mbm_histplot.
-
-Added -MXexcludepercent option to mblist to exclude a user defined
-percentage of outer beams from mblist output. (contributed by Suzanne O'Hara)
-
------> 5.3.1982 (August 15, 2012)
-
-Fixed significant issue in mb7kpreprocess and in Reson 7k format support in general.
-The code was not handling the current raw detection data records correctly.
-
-Fixed mbotps so that it handles requests for sound speed models on locations that
-are dry land in the Topex mdoels more gracefully.
-
-Fixed minor info printing issue with mbnavadjust (now doesn't report failure to
-invert unless there is a failure to invert).
-
-Improved performance of navigation and attitude merging for both mb7kpreprocess
-and mbkongsbergpreprocess
-
-Added new functionality to mbkongsbergpreprocess (contributed by Suzanne O'Hara):
-  -Added -D<outputDirectory> argument to allow users to set new directory for
-    output files; original code always created output in input directory.
-    This is a problem where users should not be modifying original directories.
-    Using this flag allows the user to use the datalist option and is easier
-    than copying the original mb58 data to a different directory or to using a
-    script that loops through all the data using the -D option
-  -Added -C flag to output counts. Current code always outputs many rows of
-    information that can be confusing. The default now is to work silently
-    unless there is a problem.
-
------> 5.3.1981 (August 2, 2012)
-
-Fixed problem with mbprocess in which the heading was unexpectedly replaced by course-made-good.
-Now this can only happen with HEADINGMODE:1 or HEADINGMODE:2 in the parameter file.
-
-Fixed error in the definition of the OMG HDCS format in mbf_omghdcsj.h
-This fix provided by Bob Covill.
-
------> 5.3.1980 (July 13, 2012)
-
-Augmented support for L3 XSE format (94) so that data from recent SeaBeam 3000 and SeaBeam 3050
-multibeams can be processed.
-
-Added option to mbinfo to generate output in XML (contributed by Christian Ferreira)
-
-Augmented the i/o module for Reson 7k data to work with data files that do not
-include the 7006 bathymetry records but instead include the raw detection 7027
-records.
-
-Altered mbnavlist so that longitude and latitude values are output with a
-precision about equivalent to 0.1 mm, the same as mblist and mbinfo.
-
-Altered mbprocess so that navigation shifts and offsets are applied to merged
-navigation. Navigation derived from mbnavadjust is not affected.
-
-Added new program mbkongsbergpreprocess, which reads data from a third generation
-Kongsberg multibeam sonar (e.g. EM122, EM302, EM710),  interpolates  the asynchronous
-navigation, heading, and attitude onto the multibeam data, and writes a new file
-with that information correctly embedded in the multibeam  survey  data.  The  input
-files  may  be  in  the  vendor  format  MBF_EM710RAW  (format id 58) or the MB-System
-extended format MBF_EM710MBA (format id 59); the output  files  will  always  be  in
-the  MB-System  extended  format MBF_EM710MBA (format id 59).
-
-Updated GSF library to new release 3.04 from SAIC.
-
-Removed local($[) = 0 initializations from all perl macros for compatibility with the
-current version of perl (some macros were missed when this was done before 5.3.1955).
-
-Fixed problem with mbprocess in which merged roll and pitch data were not applied
-to the bathymetry unless the bathymetry was being recalculated by raytracing.
-
-Added ability to change the read and write buffers for file i/o, initially just
-for Reson 7k and Kongsberg current generation data. This allows one to tune for
-the highest throughput file i/o for a given situation (e.g. 10 MB buffers achieve
-5-10% faster throughput on the MBARI network).
-
-Altered i/o module mbr_image83p.c for Imagenex DeltaT data so that if no roll or
-pitch data are stored, the sonar is treated as if it is pointed down rather than
-horizontal. Also fixed the module so that the profile tile angle parameter is
-used correctly.
-
------> 5.3.1955 (May 16, 2012)
-
-Removed ($[) = 0 initializations from all perl macros for compatibility with the
-current version of perl.
-
-Updated PROJ4 to the 4.8.0 release.
-
-Added code for a new i/o module reading (but not yet writing) Benthos 1624 sidescan
-data in the XTF format. This read-only i/o module has a format id of 211. This code
-has been contributed by Jens Renken (MARUM/University of Bremen). The intent is to
-complete the i/o module to allow full processing of the Benthos 1624 data.
-
-Added a new macro, mbm_bpr,  to translate pressure data from a Seabird SBE53 pressure sensor
-used as a Bottom Pressure Recorder (BPR) into tidal data that can be used to correct swath
-bathymetry data.
-
-Changed default Postscript viewer for Linux or Mac to be gv rather than Ghostview.
-
-Added option to mbinfo (-X1) to generate output in the json format. If the -O option
-is used to make metadata files, then the addition of -X1 will cause the output files
-to be named "*_inf.json" rather than "*.inf". Suzanne O'Hara (LDEO) contributed this
-improvement.
-
-Augmented mbsvplist with option -C which causes the program to output the number of
-unique SVPs in each file to stdout. Suzanne O'Hara (LDEO) contributed this
-improvement.
-
-Fixed multiple problems with mbcontour and the underlying contouring library that
-were producing crashes in many circumstances.
-
-Updated the MBARI AUV mission generator mbm_route2mission to reflect current operational
-parameters for the MBARI Mapping AUV.
-
-Applied fixes to the Marine Sonics sidescan i/o module (mbr_mstiffss.c) contributed
-by Val Schmidt of UNH/CCOM.
-
-Changed the color table in mbnavadjust to eliminate yellow contours, which are difficult to see.
-
-Added output of potential temperature to mbctdlist.
-
-Altered subbottom section plots generated by mbextractsegy. The first cut plots
-generated when mbextractsegy is used to extract subbottom data into segy files are broken
-into multiple section plots for long files (representing survey lines if extracted
-according to a route file). Previously, all section plots for a given line had a time sweep
-encompassing the data for the entire line. Now, if the total sweep exceeds 1 second, then
-the sections plots will be generated using only the sweep required for each section alone.
-
-Improved the robustness of calculating longitude latitude bounds for segy data using
-mbsegyinfo.
-
-Added capability to mbsegygrid to grid and plot subbottom sections based on distance between
-the end points of a survey line. This approach to plotting subbottom sections removes the
-impact of speed variations and deemphasizes data where the sonar platform moved slowly
-or stopped.
-
------> 5.3.1941 (March 6, 2012)
-
-Fixed sidescan filtering with mbfilter. The filtered sidescan output in
-format 71 files had incorrect acrosstrack locations.
-
-Fixed problems with sidescan generation for current generation
-Kongsberg data (formats 58 and 59). The code previously tended to choose too
-small of a pixel size, resulting in a sidescan swath narrower than the real
-swath width.
-
-Fixed swath contouring and track plotting by mbcontour and mbm_plot. Subtle changes
-in the GMT pslib resulted in contours and tracks only partly plotting in some
-Postscript devices. The MB-System code now explicitly chooses when to call
-stroke operations in the Postscript, rather than leaving that up to pslib.
-
-Fixed format 24 (mbf_hsldeoih) so that certain old files with extra bytes in some
-comment records can be read correctly.
-
-Added output of raw values from current generation Kongsberg data (formats 58 and 59)
-to mblist.
-
------> 5.3.1937
-
-Changed the resolution of navigation in fbt (format 71) files and
-fnv files to be 1e-9 degrees, equivalent to about 0.1 mm. Similarly change
-the navigation resolution in the output of mbinfo, and thus in inf files.
-This affects mbr_mbldeoih.c, mbsys_ldeoih.c mbsys_ldeoih.h in src/mbio,
-and mbinfo.c and mblist.c in src/utilities.
-
-Add importing and display of "vector" data in mbview and mbgrdviz. The
-vector files are GMT-style segmented files of lon, lat, topography value triples.
-These are displayed as lines colored according to the value. Controls for
-setting the color tables still have to be added.
-
-Changed mbgrid so that any background (option -K) is calculated first,
-before significant memory is allocated. This avoids crashes due to
-attempted forks that overrun available memory.
-
-Fixed beamwidth calculation for Reson 7k data. Fix in mbr_reson7kr.c
-and mbsys_reson7k.c.
-
-Fixed overflow during iterative search for beam angle values in
-mbr_em710raw.c
-
-Added capability to mbauvloglist to output angle values in degrees rather
-than radians.
-
-Added code to mbnavadjust to detect when the uncertainty ellipsoid of one
-or more ties contains a zero value that will cause the inversion to fail.
-In this case, the program prints out which ties are problematic, and declines
-to calculate the inversion.
-
-Fixed beamwidth values stored in fbt files.
-
-Added JSON output option to mbinfo. This addition provided by Suzanne O'Hara of
-LDEO/IEDA.
-
-Added graceful exit to mbm_grdplot when a call to grdinfo fails. Fix provided by
-Hamish Bowman of the University of Otago.
-
-Bug fixes to mbr_mstiffss.c related to reading Marine Sonics sidescan data. This fix
-provided by Val Schmidt of CCOM/JHC at University of New Hampshire.
-
------> 5.3.1917 (January 10, 2012)
-
-Added preliminary support for HYSWEEP HSX format as MBIO format 201. Added program mbhysweeppreprocess to preprocess the HSX data.
-
-Fixed bug in mb_lever() function in mb_angle.c.
-
-GSF 3.03 update.
-
------> 5.3.1912 (November 19, 2011)
-
-Formats 58 and 59 (third generation Kongsberg multibeam data):
-Augmented code to handle bathymetry data in which beams are reported
-as having valid soundings but actually have zero ranges and NaN
-bathymetry, acrosstrack distance, and alongtrack distance values.
-
-Formats 58 and 59 (third generation Kongsberg multibeam data):
-Fixes to the handling of attitude ecords, particularly with regard
-to writing the records.
-
------> 5.3.1909 (November 16, 2011)
-
-Program mbnavlist:
-Fixed attitude record output so that use of -K18, -K55, -K56, or -K57
-results in output lines for all attitude records, even when position
-or heading data are not available for interpolation.
-
-Formats 58 and 59 (third generation Kongsberg multibeam data):
-Fixed the i/o modules to successfully output attitude and netattitude
-records identified as MB_DATA_ATTITUDE1,  MB_DATA_ATTITUDE2, or
-MB_DATA_ATTITUDE3.
-
------> 5.3.1907 (November 9, 2011)
-
-Program mblist:
-Added output of beam bottom detection algorithm (amplitude or phase)
-to mblist. One can now use Q and q as valid output values that can
-be included in the arguments to the -O option.
-
-Program mbnavlist:
-Added ability to output navigation data keyed to primary or
-ancilliary attitude data. For instance, use of the -K18 option will
-cause the mbnavlist output to occur for all attitude samples in the
-primary attitude data stream. The timestamps will be those of the
-attitude records, and any position, speed, or sonar depth values
-requested will be interpolated onto the attitude timestamps.
-
-Program mbm_route2mission:
-Enabled the generation of AUV missions in which multibeam beamformed
-data ("water column") are recorded in addition to bathymetry and
-backscatter.
-
-Program mb7kpreprocess:
-Fixed integration of MBARI AUV INS log data into the processing of
-Reson 7k data.
-
-Program mbrolltimelag:
-Fixed a bug that rarely produced a failure of time lag correlation
-calculation.
-
-Third generation Kongsberg data (formats 58 & 59:
-Fixed handling of different attitude records, in that the code
-now recognizes multiple sources of roll, pitch, and heave when
-they appear in a datastream. The data records identified as the
-primary attitude source are identified as type MB_DATA_ATTITUDE (18)
-while ancilliary records will be identified as MB_DATA_ATTITUDE1 (55),
-MB_DATA_ATTITUDE2 (56), or MB_DATA_ATTITUDE3(57).
-
------> 5.3.1906 (September 28, 2011)
-
-Program mbnavadjust:
-Added -D option to invert foreground (normally black) and background
-(normally white) colors in the interactive plots
-
-Format 88 MBF_RESON7KR (Reson 7k multibeam data):
-Fixed deallocation of MBF_RESON7KR data structures.
-
-Program mb7kpreprocess:
-Fixed some filtering code in mb7kpreprocess.
-
-Program mbrolltimelag:
-Added -K option to mbrolltimelag - this duplicates the new -K option
-in mbnavlist and is used when mbrolltimelag calls mbnavlist to extract
-the roll time series.
-
-Program mbnavlist:
-Augmented mbnavlist to allow extraction of data keyed to data records
-other than navigation or survey data. A new -Kkind option allows
-users to specify output at the times of attitude, heading, or other
-record types.
-
-Programs mbedit, mbeditviz, mbnavedit, mbclean, mbprocess:
-Added ability to disable file locking using the program mbdefaults
-and the .mbio_defaults file in the user's home directory.
-If a user disables file locking by running
-     mbdefaults -U0
-then the programs mbedit, mbeditviz, mbnavedit, mbclean, and
-mbprocess will not set new file locks and will ignore any existing
-file locks. In short, a user can disable the entire file locking
-mechanism in MB-System.
-
-New macros mbm_multicopy, mbm_multidatalist, mbm_multiprocess:
-Added three new macros authored by Christian Ferreira. These are
-mbm_multicopy, mbm_multidatalist, and mbm_multiprocess. All three
-are used to execute tasks on large numbers of swath files by starting
-multiple processes in parallel. The mbm_multicopy macro accomplishes
-copying of files from one format to another. The mbm_multidatalist
-macro accomplishes the creation of ancilliary files. The mbm_multiprocess
-macro accomplishes processing with mbprocess. These all require the
-Parallel-Forkmanager Perl module available from www.cpan.org.
-
-Program mbclean:
-Added flagging by acrosstrack distance to mbclean. Also added esf
-file locking for compatibility with mbedit and mbeditviz, and
-fixed handling of old edits.
-
-Program mbgrid:
-Fixed a problem with the footprint algorithm of mbgrid
-that sometimes left holes that could not be filled by interpolation.
-
-Macro mbm_route2mission:
-Added ability to mix constant altitude and constant depth behaviors
-within a single AUV mission to mbm_route2mission.
-
-Format 88 MBF_RESON7KR (Reson 7k multibeam data):
-Fixes to handling of asynchronous attitude data in format 88 (Reson s7k)
-and calculation of time lag estimates.
-
-Program mbextractsegy:
-Adjustments to the default plots of segy data by mbextractsegy.
-
-Macro mbm_route2mission:
-Fixes to generation of MBARI AUV missions by mbm_route2mission.
-
-Format 88 MBF_RESON7KR (Reson 7k multibeam data):
-Fixed extraction of raw, asynchronous attitude data from Reson 7k
-data using rollpitchheave records (e.g. from the MARUM AUV), which in
-turn fixes the calculation of attitude time lag estimates using
-mbrolltimelag.
-
-Program mb7kpreprocess:
-Fixed application of time lag model by mb7kpreprocess for the case
-of Reson 7k data using rollpitchheave records (e.g. from the MARUM AUV).
-
-Program mblist:
-Added -UN option to mblist that ignores output of lines
-associated with zero longitude or latitude values. This option
-will be used by mbdatalist to create *.fnv files.
-
-Format 71 MBF_LDEOIH (generic swath):
-Provided a means to continue using the old definition of
-swath format MBF_LDEOIH (format 71) for fbt files.
-Users can now use mbdefaults to set the format 71 version that
-will be generated when fbt files are created by mbdatalist and
-mbprocess. If
- 	mbdefaults -Fold
-is executed, the .mbio_defaults file in the user's home directory
-will be altered so that all new fbt files are in the old format.
-The purpose of this backwards compatibility is to allow users to
-take advantage of the Fledermaus capability for editing bathymetry
-in MB-System processing environments. This involved changes to mbcopy
-as well as to the MBF_LDEOIH i/o module.
-
-Program mbnavadjust:
-Changed the swath data import code so that sections will be created even
-when all beams have been flagged as bad. This is to allow surveys
-to remain intact, with no breaks, because the concept of a continuous
-survey is increasingly important in MBnavadjust. Also altered the
-status displays and listings to show survey id along with file and
-section id's.
-
-Format 71 MBF_LDEOIH (generic swath):
-Updated the definition of swath format MBF_LDEOIH (format 71),
-which is used for the "fast bathymetry" or *.fbt files in MB-System
-processing environments. The previous form of *.fbt files had a
-serious limitation in that bathymetry from multibeams operated
-near the seafloor in deep water did not represent the full
-numerical resolution of those data. The updated format allows for
-depth and distance resolution to 0.001 m even in the deep ocean.
-Old *.fbt files are read transparently, but newly written files
-will be in the new form.
-IMPORTANT: In order to avoid compatibility issues, all users
-operating on the same projects should upgrade to this version or
-higher once one user upgrades.
-
-Format 88 MBF_RESON7KR (Reson 7k multibeam data):
-Updated support for Reson 7k data to include the "1022" record.
-We still don't know what this is, but the code now reads and
-writes it without complaint.
-
-Program mbinfo:
-Fixed mbinfo handling of swath files with no good data
-(Thanks Suzanne O'Hara)
-
-MBIO function mb_get_format():
-Changed mb_get_format() function in mb_format.c so that formats
-are inferred from parameter files if they exist.
-
-Program mbnavadjust:
-Supplemented informational output to stdout from MBnavadjust.
-
-Format 71 MBF_LDEOIH (generic swath):
-Started development of new version of format 71 (mbf_ldeoih).
-
-Program mb7kpreprocess:
-Fixed translation of beam quality values into MB-System beam flags
-by mb7kpreprocess.
-
-Program mbextractsegy:
-Fixed calculation of line breaks by mbextractsegy.
-
-MBIO function mb_get_format():
-Augmented mb_get_format() in mb_format.c to look for the format id
-value in mbprocess parameter files before trying to make sense of
-file suffixes.
-
-Program mbedit:
-Fixed MBedit's handling of files not conforming to the MB-System
-filename suffix convention.
-
-Macro mbm_xyplot:
-Allow users of mbm_xyplot to specify both axis annotation with the
--B option and axis labeling with the -L option.
-
-Program mbeditviz:
-Implemented workaround for MBeditviz crash problem on Poseidon Linux.
-MBeditviz would shut down whenever a second map view was requested with
-an Xserver error named GLXBadContextTag. Previously, the OpenGL rendering
-within X11/Motif widgets has been implemented with the graphics calls
-always sent through the X11 window server. I have now set the code to
-allow direct rendering through hardware when that is possible. For reasons
-I do not understand, this change results in MBeditviz no longer crashing
-on my Poseidon Linux test machine.
-
-Programs mbedit, mbnavedit, mbeditviz:
-Fixed font issue for MBedit, MBnavedit, and MBeditviz by using courier
-rather than monaco as a fixed-width font for the available file list
-widgets.
-
-Program mbprocess:
-Added support for the "Rolling Deck to Repository" (R2R) navigation format
-as both an MB-System format (format id 172) and an mbprocess navigation
-merging format (NAVFORMAT=10)
-
-Macros mbm_grdplot and mbm_grdtiff:
-Modified mbm_grdplot and mbm_grdtiff so that the -Y option strictly enforces
-the colormap min max bounds set with the -Z option.
-
-Formats 132 MBF_EDGJSTAR and 133 MBF_EDGJSTR2 (Edgetech Jstar):
-Fixed support for Edgetech Jstar files (formats 132 and 133) so that the
-output of mb7k2jstar and mbprocess are compatible with Edgetech programs.
-
-Programs mbedit, mbeditviz, and mbnavedit:
-Added file locking to mbedit, mbeditviz, and mbnavedit. All three programs
-can now load datalists and display lists of files available for editing.
-These lists show whether the file has been previously edited and if the
-file is locked. Locked files cannot be loaded or edited. As before, mbprocess
-also locks files during processing and skips files that are locked by
-other programs. The program mbdatalist can be used to detect (-S) and remove
-(-Y) orphan file locks in files referenced by datalist structures.
-
-Program mbprocess:
-Fixed bug in mbprocess.c involving parsing of NMEA GGA strings when
-reading in navigation for merging with survey data.
-
-Program mbnavadjust:
-Changed MBnavadjust to allow more file modes, in turn allowing
-more control over which data has the most influence over the navigation
-solutions. In addition to the previously existing modes (Fixed, Good, Poor),
-surveys can now be set to FixedXY and FixedZ modes where the navigation
-of the files so identified will have the specified coordinates fixed
-(unadjusted) and the other coordinate(s) treated as Good. In particular,
-this allowed us to simultaneously adjust navigation from overlapping
-MBARI Mapping AUV and ABE surveys in which the Mapping AUV pressure depth
-was clearly more accurate than the ABE vehicle depths. By setting the
-MBARI data to mode FixedZ, we were able to force the solution to adjust
-the ABE navigation to match the Mapping AUV vertical reference, while still
-allowing lateral (XY) adjustments of all the AUV navigation.
-
-Program mbnavadjust:
-Changed MBnavadjust to output user, cpu, and time of changes to
-project files and as comments to the adjusted navigation files. Also changed
-mbprocess to handle comments in adjusted navigation files.
-
-Program mbm_copy:
-Fixed -C option of mbm_copy.
-
-Format 192 MBF_IMAGEMBA (Imagenex DeltaT):
-Fixed i/o module for extended format Imagenex DeltaT data (format 192) by removing code
-that recalculated bathymetry unnecessarily.
-
-Program mbdatalist:
-Added -Y option to mbdatalist to remove any leftover lock files.
-
-Parsing *.inf files:
-Fixed bug in parsing file start and end times in *.inf files.
-
-MBIO functions mb_defaults(), mb_env(), and mb_lonflip():
-Changed mb_defaults(), mb_env(), and mb_lonflip() functions to always return
-MB_SUCCESS status even when ~/.mbio_defaults file does not exist. Working with
-system defaults hould not be an error.
-
-Program mbeditviz:
-Changed mbeditviz_import_file() function in mbeditviz_prog.c to reset global
-status to MB_SUCCESS on entry.
-
-Program mbclean:
-Incomplete implementation of Dana Yoerger's changes to mbclean. Not yet tested.
-
-Program mbnavedit:
-Increased verbosity of mbnavedit for -X option.
-
--------------------------------------------------------------------------------
-MB-SYSTEM VERSION 5.2 RELEASE NOTES:
--------------------------------------------------------------------------------
-
------> 5.2.1880 (December 30, 2010)
-
-Augmented mbotps to output tide in both
- 	time_d tide
-and
- 	year month day hour minute seconds tide
-using a -Atideformat command line option.
-
-Added new kluge processing option to mb7kpreprocess (-K2)
-that zeros alongtrack angles. This fixes some recent sample
-Reson 7k data.
-
-Recast lever arm calculation due to roll and pitch rotations
-in mb_angle.c.
-
-More changes to the handling of current generation Kongsberg
-data in mbr_em710raw.c.
-
-Fixed handling of beam alongtrack distance values during bathymetry
-recalculation by raytracing.
-
-Improved beam info display in mbeditviz.
-
-Fixed mbnavadjust recalculation of the 3D cross-correlation function
-after changing the vertical offset.
-
-Changed mbr_image83p.c, mbr_imagemba.c, and mbsys_imae83p.c so that
-calculation of beam angles happens during the first read of the data.
-
-Replaced strsep() with strtok() in mbr_edgjstar.c. This is to allow
-MB-System to be more easily built on Solaris systems.
-
-Fixed mbset so that it recognizes sidescan cutting commands (SSCUTNUMBER,
-SSCUTDISTANCE, SSCUTSPEED).
-
------> 5.1.3beta1875
-
-Altered -P option in mbsvplist. Previously this option (which turns on
-bathymetry recalculation by raytracing in mbprocess using the water sound
-speed models extracted from the data files) set the raytracing to
-correct the takeoff angles for the difference between the sound speed
-used for beamforming (surface sound velocity or SSV) and the sound speed
-at the sonar depth in the water sound speed model. Now, mbsvplist sets
-mbprocess to leave the takeoff angles unchanged. This is more more
-consistent with the expectation that raytracing through the original
-sound speed model should yield values matching the original bathymetry.
-
-Altered mbprocess bathymetry recalculation by raytracing to better handle
-cases where large heave values bring the sonar array above the nominal
-water line. In this case, a static heave offset is calculated, raytracing
-is done from the top of the water sound speed model, and the heave offset
-is added to the raytracing result.
-
-Improved the autopicking function of mbnavadjust.
-
-Fixed a bug in handling the per-beam heave values in current generation
-Kongsberg data (formats 58 & 59).
-
-Changed mbm_route2mission to allow command line argument control of AUV
-speed during ascent/descent, survey lines, and transit lines. Also added
-control of the "deltaDepthRestart" value controlling how far up the AUV
-should float after an altitude abort before resuming the mission.
-
-More changes to support of Kongsberg current generation multibeam
-data in formats 58 and 59. As previously noted, the angles used to recalculate
-bathymetry from raw travel times by raytracing are estimated by iteratively
-seeking to match the original bathymetry reported by the sonar. These angles
-are estimated when data are first read as format 58 and then embedded in
-format 59 data (presumably when mbcopy is used to translate format 58 files to
-format 59)for later use by mbprocess. The default algorithm matches the original
-bathymetry to within about 0.1% altitude by calculating an effective heave for
-each ping and takeoff angles for each beam. A second algorithm (which can only
-be activated by uncommenting an #ifdef statement in mbr_em710raw.c) matches the
-orginal bathymetry by modifying both the takeoff angles and the travel time
-measurement - this achieves matching of the original bathymetry to about 0.02%
-of altitude. Use of the second algorithm is not recommended because modifying
-the fundamental observations (travel times) to match the sonar's calculation
-is, well, unsatisfying and wrong. The bad option is there because I took the
-time to code it to see how well it would work.
-
------> 5.1.3beta1874
-
-The function mb_get_info() now properly applies the lonflip value. This
-in turn allows mbgrid to infer correct bounds in situations where the
-lonflip is important (e.g. data across the +/-180 degree boundary when
-lonflip is -1 or 1).
-
-Changed MBnavadjust so that an "Inversion Smoothing" value replaces a
-no-longer-used "Inversion Precision" value. This value, accessible under
-the Options dialog, sets the importance of smoothing in the adjusted
-navigation model. The default is 4.00, and possible ranges are 0.10 to
-10.0, where the smoothing penalty weight applied to the first and
-second derivatives of the adjusted navigation perturbation is ten
-raised to this power.
-
-Added support for Kongsberg EM2040 multibeam in formats 58 and 59.
-
-Changed MBnavadjust so that default settings for section length and
-contour interval are appropriate for high resolution surveys such
-as those produced by AUV's equipped with >100 kHz multibeams.
-
-Fixed plotting macros mbm_plot, mbm_grdplot, mbm_xyplot, mbm_grd3dplot
-so that the calls to display postscript graphics using gv in the output
-plotting scripts scale plots to fit on the screen.
-
-Fixed mbm_route2mission to use proper camera control when generating
-mission scripts for the MBARI Benthic Imaging AUV.
-
-Added -W option to set the desired swath width of sidescan output from
-mb7k2ss.
-
-Updated the i/o module supporting OMG HDCS (the John Hughes Clarke format)
-to handle HDCS version 4. These mods contributed by Bob Covill.
-
-Fixed mb7kpreprocess to check for and ignore repeated ancilliary and
-survey data records.
-
-Update GSF code to version 3.02, released 28 September 2010.
-
-Set MBeditviz to resolve format id's in output parameter files when
-filenames do not follow known suffix conventions.
-
-Added support for a number of new data records in the Reson 7k data format,
-following the 19 June 2009 addendum to the 7k format version 1.00 specification.
-
-Changed mb_malloc() calls in mb_format.c and mb_buffer.c to mb_mallocd() calls
-for greater debugging capability.
-
-Added some debugging statements to mbprocess.c.
-
-Changed mbm_grdplot macro to use the variable names embedded in seismic section
-GMT grid files generated by mbsegygrid.
-
-Improved autopicking in MBnavadjust to the point where it is actually useful.
-Also fixed bug that caused eventual seg faults when analyzing many crossings
-in a single session.
-
-Fixes to  Reson s7k (format 88) support allowing mbnavlist to use position
-records as navigation channel 3. This in turn allows mbrolltimelag to work
-with Reson 7k data collected by MARUM (University of Bremen).
-
-Added file name and line output to debug messages in mbr_l3xseraw.c to aid
-in later work to fully support the current XSE data format.
-
-Set mbrolltimelag to only attempt to generate a variable time lag model
-plot if more than one robust time lag values have been generated.
-
-Updating in preparation for beta release version 5.1.3beta1874.
-
------> 5.1.3beta1862
-
-Moved src/mbaux/mb_rt.c to src/mbio/mb_rt.c and made this
-raytracing code part of libmbio rather than libmbaux.
-
-Fixed deallocation of raytracing data in mbprocess.
-
-Added source type flag (CW or chirp) definition to src/mbio/mb_status.h
-
-Add mb_io_pulses() function definition to src/mbio/mb_io.h as a
-pointer for functions in i/o modules that extract source type (CW or chirp)
-for individual beams. Added mb_pulses() function calls to src/mbio/mb_define.h
-and src/mbio/mb_access.c.
-
-Added mbsys_simrad3_pulses() function to i/o module for current
-generation Kongsberg (Simrad) data in src/mbio/mbsys_simrad3_pulses().
-
-Altered i/o module for current generation Kongsberg (Simrad) data
-so that bathymetry calculation using raytracing works correctly.
-This involves src/mbio/mbr_em710raw.c and src/mbio/mbsys_simrad3.c.
-The problem is that the current raw beam and angle datagram stores
-travel times and angles uncorrected for motion and attitude. My
-attempts to properly calculate the attitude and motion
-compensation have not succeeded (as measured by succeeding in replicating
-the original bathymetry when used with the original sound speed model).
-This version achieves accurate estimation of the compensated angles
-for each sounding by finding a ray (through iteration) that replicates
-the original sounding position by raytracing through the original
-sound speed model. The depth difference is stored as a per-beam heave
-correction, and the angles are stored normally. This calculation is
-done only on the raw data format 58. When mbcopy is used to translate
-the data to the processing format 59, the compensated angles are stored
-in extended bathymetry datagrams. This scheme suffices to allow full
-processing of the data, but is not satisfying in that I clearly still do not
-fully understand the raw data format
-
-Fixed issues with a number of manual pages.
-
------> 5.1.3beta1860
-
-Further changes to mbnavadjust:
-- The inversion stops if it is diverging rather than converging on a navigation adjustment model solution.
-- The program will insure that all crossings have the later section second by flipping the order of crossings if necessary while reading an old project.
-- The program also resorts the crossings when it reads a project.
-
------> 5.1.3beta1858
-
-Slight modification to mbm_grdplot map annotation scheme (degrees + minutes
-for maps up to 4 degrees across where only degrees shown before for maps
-wider than 1 degree).
-
-Changes to mbm_route2mission to accomodate new capability of MBARI
-Mapping AUV to record full water column data from the Reson 7125 multibeam.
-
-Move mb_mergesort() function prototype from mb_esf.c to mb_define.h.
-
-MBnavadjust augmented with capability to check for new crossings and
-to recalculate overlap coverage of existing crossings after inversions.
-Users can also toggle previously analyzed crossing to "unset" status.
-
-MB7kpreprocess augmented to handle Reson 7111 data sample from NGDC.
-
-Fixed incorrect listing MB_DATA defines in mb_status.h.
-
-Added per-beam heave data to mbsys_simrad3 ping structure to support
-bathymetry recalculation for EM710, EM302, EM122 data. Defined new
-processed bathymetry record for use in format 59, and set code to
-transparently read the old record and write only the new record.
-Mostly fixed handling of attitude data in bathymetry recalculation.
-There still seems to be a problem with handling heading data.
-
------> 5.1.3beta1855
-
-Fixed error in beam angle calculation for third generation Simrad multibeam
-data (formats 58 and 59, EM710, EM302, EM122) that made bathymetry recalculation
-by raytracing badly wrong.
-
------> 5.1.3beta1851
-
-Fixed problem where mb7kpreprocess made beams that should have been null
-valid but flagged.
-
-Fixed bug that caused mbclean to fail to actually flag some beams
-identified for flagging.
-
-Added button to zero all z offsets on crossings for cases where tidal
-corrections have been made before data were imported into a mbnavadjust
-project.
-
-Fixed mbgetesf manual page.
-
-Fixed mode control in mbgetesf so one can extract the complete beam flag
-state from a swath file. MBgetesf is now used by MBeditviz to get the
-original beam flag state of raw swath bathymetry when processed files
-are read.
-
-Fixed sorting of beamflag edit events in edit save file data as used by
-MBedit, MBeditviz, MBclean, MBareaclean, and MBprocess. This fixes a
-problem wherein some edits performed by MBeditviz were dropped by
-MBprocess. Also, MBgetesf is now used by MBeditviz to get the original
-beam flag state of raw swath bathymetry when processed files are read.
-
------> 5.1.3beta1844
-
-Fixed yet another bug in MBnavadjust - this time getting the
-importation of old project files correct and, more importantly,
-getting the z-offset sign correct in the Naverr display.
-
------> 5.1.3beta1843
-
-Updated mb7k2ss man page.
-
-Fixed bug in mbrolltimelag regarding popen/pclose use.
-
-Fixed bug in mb_process.c file locking.
-
-Fixed mbotps man page.Fixed bug in MBeditviz and added hot keys for
-editing (only partially successful because it's hard to reliably get
-the keyboard focus onto the rendering OpenGL widget.
-
-Fixed mbotps man page.
-
-Augmented MBnavadjust to allow referencing high resolution bathymetry
-(e.g. AUV surveys) to lower resolution bathymetry (e.g. hull mounted
-multibeam surveys). The navigation of specified files (typically the
-data collected from the surface where GPS is available) can be fixed
-so that everything else floats and is adjusted relative to those data.
-
-mbprocess - improved error reporting to show why files are not being processed.
-
-mbmosaic - fixed aspects of the footprint calculation, particularly
-fixing a bug that prevented footprints from being fully covered.
-
-Added -S option to mbprocess for debugging file status values used to
-determine whether processed data files are "out of date".
-
-Greatly improved mbnavadjust by adding a interim solution for a smooth
-navigation adjustment model fitting ties to fixed (immovable) data and
-by making all of the internal crossing and tie conventions consistent.
-MBnavadjust now outputs version 3.0 nvh project files, but will transparently
-read and translate earlier version nvh project files.
-
------> 5.1.3beta1829
-
-From now on beta releases will be named according to the corresponding
-source archive revision in the MB-System Subversion source code archive.
-This will allow us (and users) to more precisely track code changes relative
-to the beta releases.
-
-Fixed support of Reson 7k data (format 88) to work with MARUM
-AUV data. Includes changes to mb7kpreprocess.
-
-Fixed 64 bit issues with Simrad, Reson 7k, and L3 XSE data
-(formats 58, 59, 88, 94).
-
-Fixed 64 bit issues with mbnavedit, mbclean, and mbneptune2esf.
-
-Added buttons to MBedit to immediately go to the start or end of the data.
-
-Fixed sidescan beamwidths used by the Edgetech Jstar format i/o
-modules (formats 132 & 133).
-
-Fixed memory management errors in MBgrdviz and mbfilter.
-
-Fixed more 64 bit  and memory management issues in MBeditviz and MBgrdviz.
-
-Added a plot reset button and an ability to autoscale on unflagged soundings
-only in the MBeditviz 3D sounding cloud display.
-
-Fixed handling of site and route points far from the display view in MBgrdviz.
-
-Put actual (but still incomplete) text into the MBeditviz man page.
-
-Changed print format for unsigned long values from %ld to %lu to avoid copious
-warning messages in Ubuntu.
-
--------------------------------------------------------------------------------
-MB-SYSTEM VERSION 5.1.2 RELEASE NOTES:
--------------------------------------------------------------------------------
-
-Fixed pixel calculation algorithm in mbmosaic. Previously, sidescan
-data from each pixel were being treated as extending over a
-larger area than is correct.
-
-Ressurected program mbfilter with an new implementation. Allows
-low pass, high pass, and contrast enhancement filtering of amplitude
-and sidescan data. Implemented so that filtered data are stored
-in ancilliary files ending in *.ffa (amplitude) and *.ffs (sidescan).
-The data type selection options of mbswath, mbm_plot, and mbmosaic
-all now allow users to select filtered data.
-
-Improved handling current generation Simrad multibeam data (e.g.
-EM710, EM122) through formats 58 (MBF_EM710RAW) and 59 (MBF_EM710MBA).
-There still seems to be a problem with calculating the takeoff angles
-for recalculating bathymetry by raytracing, probably due to a problem
-interpolating the correct roll and pitch values.
-
-Changed processing kluge 004. Previously kluge 004 caused mbprocess
-to not output survey data with time stamps prior to the last good ping.
-Now the dropped data will have time stamps prior to or equal to that
-of the last good ping.
-
-Fixed problem reading and writing format 16 (MBF_SBSIOSWB) data on
-little-endian systems.
-
-Added support for new ROV Doc Ricketts navigation data as format 165.
-
-Added a Gaussian mean smoothing algorithm to MBnavedit. This is primarily
-intended for smoothing USBL or LBL based navigation of submerged platforms
-(e.g. ROVs or submersibles).
-
-Altered the install_makefiles perl script used to generate the makefiles
-during installation of MB-System. The install_makefiles script now
-automatically determines whether the local architecture is big or
-little "endian". Consequently, the "BYTESWAPPED" parameter no longer
-needs to be set in install_makefiles, and has been removed. The "GRAPHICAL"
-parameter has also been removed. Now, install_makefiles builds the
-graphical utilities only if the Motif libraries and header file
-location are specified with the MOTIFLIBs and MOTIFINCDIR parameters.
-Also, install_makefiles now allows users to specify the use of independent
-installations of the GSF and PROJ4 libraries. By default, the versions of
-these libraries distributed with MB-System will be built and used.
-
-Fixed bug in mbedit in which the view mode switched spontaneously after
-loading a new file and advancing the view buffer.
-
-Improved efficiency of attitude interpolation when reading Simrad multibeam
-data. This greatly improves the speed at which Simrad multibeam data files
-are read and processed.
-
-Fixed bug in mbm_grdplot which sometimes produces broken color tables.
-
-Updated GSF library code to GSF release 3.01.
-
-Fixed bug in EM710 support (format 59) involving netattitude datagrams.
-
-Changed licensing from GPL version 2 to GPL version 3.
-
------> 5.1.2beta07
-
-Fixed MB-System compatibility with GMT 4.5.0
-
-Fixed mbps memory handling.
-
-MBgrdviz now displays ping/shot numbers when navigation is picked.
-MBextractsegy now embeds line numbers into the output segy files.
-
------> 5.1.2beta08
-
-Fixed mbauvloglist to work with all MBARI AUV logs.
-
-Fixed mbm_route2mission so that the AUV mission segment duration always
-corresponds to the actual mission segment length.
-
-Added file locking to the mbprocess system. Now, when mbprocess starts
-working on a swath file, it creates a *.lck file parallel to the swath file
-and deletes the *.lck file when processing is complete. Other instances of
-mbprocess will skip a locked file. This allows users to run multiple instances
-of mbprocess on multiple machines on the same datalist structure. This
-crude sort of parallel processing can greatly speed up reprocessing of
-large datasets. This locking functionality will be extended to the processing
-tools mbedit, mbeditviz, and mbnavedit in the future.
-
------> 5.1.2beta09
-
-Fixed bug in SeaBeam 2112 support that misplaced some sidescan data
-on little-endian machines.
-
-Fixed the mbview library so that MBgrdviz will enable display of routes,
-sites, and navigation on all open windows when such data is loaded into
-one of the windows.
-
-Fixed cause of frequent MBgrdviz crashes when displaying multiple windows.
-
-Implemented timed background plotting in MBgrdviz so that full resolution
-displays automatically appear within a few seconds of the end of mouse
-interactions. Previously one had to click the "Full" button to get a full
-resolution view. At this point, the redisplay fails to happen occasionally.
-
-Greatly increased speed of reading third generation Simrad data (formats 58 & 59,
-EM710, EM302, EM122).
-
------> 5.1.2beta11
-
-Fixed mb7k2ss to avoid creating shadow zones in the extracted sidescan.
-
-Fixed support for dual-head Simrad EM3002 data (formats 56 and 57).
-
-Changed mbdatalist so that the -Z option (create datalistp.mb-1 datalist
-file referencing an input datalist with the $PROCESSED tag set) can be
-executed in conjunction with creating ancilliary files with the -O or
--N options.
-
------> 5.1.2beta12
-
-Updated proj library to 4.7.0 release. If the installing user chooses to
-use the proj distributed with MB-System, then the programs proj and geod
-will now be built and installed in the bin directory.
-
-Rooted through the entire codebase fixing obvious failure points for
-64-bit compilation. Most of the issues identified so far relate to
-storing address values in variables declared as "int".
-
-Completed moving the code base into subversion hosted at Lamont by
-first updating the subversion archive to 5.1.2beta11 and then committing
-the copious mods related to the 64-bit cleanup.
-
-Changed the suffix of the Perl source files in src/macros from
-".perl" to ".pl".
-
-Changed the section name for the MB-System man pages from "l" to "1"
-for programs and "3" for libraries and functions. This is in line with
-common practice and follows a similar change by GMT.
-
-Modified support for Edgetech JSTAR sidescan/subbottom files (formats 132 & 133)
-to work with a new data sample from GEOMAR. MB-System can now automatically
-distinguish between low frequency (132) and high frequency (133) sidescan
-data.
-
-Modified support for Reson 7k multibeams (format 88) to work with a
-new data sample from GEOMAR. Altered interpretation of initial beam quality
-flags, improving initial beamflags.
-
-Fixed problems with survey generation in mbgrdviz.
-
-Improved read-only support for XTF format Reson 8XXX data
-(format 84 MBF_XTFR8101), but still don't have time stamping of
-attitude data correct.
-
-Augmented edit save file format and beam flag handling in order to deal
-successfully with multiple head multibeams that produce multiple pings
-with identical time stamps. This affects mbprocess, mbedit, mbeditviz,
-mbclean, and mbareaclean.
-
-Added program mbotps to generate open ocean tidal models at specified
-times and locations using the Oregon State Tidal Prediction Software
-(OTPS) package. This program will build whether OTPS is installed or
-not, but will only work if the OTPS programs are installed and in the
-user's path. The OTPS predictions are based on global barotropic inverse
-tidal solutions obtained with OTIS and available for download at:
-     http://www.coas.oregonstate.edu/research/po/research/tide/
-
-Added program mbsegypsd to calculate sonograms from segy time series data.
-Sonograms are 2D displays of power spectral density (PSD) functions (y-axis)
-versus time (x-axis). One PSD is calculated for each trace in the segy file.
-This program requires linking with the FFTW (Fastest FFT in The West) package.
-
------> 5.1.2beta13
-
-Fixed many more issues relating to clean compiles on 64 bit machines.
-In particular, store GSF and netCDF data stream id's in their own
-int-size variables rather than a pointer-size FILE variable, and
-declare mbview instance parameters as size_t rather than int so that
-passing these values through Xt event notify function calls as pointer
-values is clean. Also changed casting of pointer values to long for
-debug printing so that the pointer values are now casted to size_t
-values. This should allow for compatibility with Windows 64 bit builds,
-as Windows 64 bit C has a different type model than the rest of the
-universe (e.g. long = 32 bit on Windows but long = 64 bit for gcc).
-
------> 5.1.2beta14
-
-Fixed a few more issues relating to clean compiles on 64 bit machines.
-We're iterating towards a working version by getting problem reports
-from people like Hamish Bowman, Bob Arko, and Bob Covill.
-
------> 5.1.2beta15
-
-Fixed EM3002 support to reliably detect whether data comes from a single
-or double head sonar (formats 56 & 57).
-
-Fixed problem with EM710 support (formats 58 & 59).
-
------> 5.1.2
-
-Incorporates all changes listed above.
-
-Fixed memory management bug for formats 56 and 57 (Simrad EM3002 etc).
-
--------------------------------------------------------------------------------
-MB-SYSTEM VERSION 5.1.1 RELEASE NOTES:
--------------------------------------------------------------------------------
-
-Fixed longstanding error in src/mbio/mb_angle.c in the application
-of roll and pitch angles. Previously, the pitch rotation was applied
-first, which is incorrect, but only produced obvious errors with
-large pitch values. Now roll is applied first, and the translation
-between sonar coordinates and raytracing coordinates is correct.
-
-Ping number, and more importantly for seismic data, shot number
-annotation of navigation tracks is now supported by mbm_grdplot.
-
-Improved handling of navigation plotting and annotation by
-mbcontour, mbm_plot, and mbm_grdplot. It is now easier to specify
-time, ping number, and filename annotation of navigation tracks.
-
-Major modifications have been made to MBnavadjust. MBnavadjust
-now picks offsets in z (depth) as well as x (longitude) and
-y (latitude). An autopicking algorithm has been implemented,
-and a display of the optimal navigation adjustment model added
-as well.
-
-The acrosstrack view of MBedit now shows the real alongtrack
-positions of the soundings.
-
-Fixed bug in mbsys_gsf.c that incorrectly calculated the alongtrack
-distance of sidescan samples in "snippet" sidescan data contained in
-GSF format (121) multibeam data. On occasion this bug produced
-egregiously wrong alongtrack values.
-
-Fixed bug in mbgrid that caused failure to write Arc Ascii grids
-with option -G4.
-
-Augmented i/o module for XSE format (94) to support current version
-of SeaBeam 2112 sonars on WHOI ships. This data format now has
-an MB-System extension to its multibeam records that includes
-interpolated navigation values. Previously only asynchronous
-navigation was handled.
-
-Fixed bug in old Simrad i/o module regarding EM121A data.
-
-Added prototype of MBeditviz, a tool that combines 3D bathymetry
-editing and patch test capability.
-
-MBeditviz can be started from MBgrdviz. Any selected files (using
-navigation selection) will be loaded.
-
-Fixed further issues with the XSE format i/o module.
-
-Added swath file copy function to mbdatalist.
-
-Fixed calculation of grazing angles in mblist by adding sonar
-depth to the calculation.
-
-Added some additional large format page sizes to the plot macros
-mbm_plot, mbm_grdplot, mbm_grd3dplot, mbm_xyplot, and mbm_histplot.
-
-Added mblist capability to output tables using column delimiters
-other than tabs (e.g. commas to make csv files).
-
-Modified mbnavedit so that any nav points that repeat previous lon
-and lat values will be automatically flagged as bad.
-
-Fixed footprint calculation in mbmosaic, correcting problems in
-sidescan mosaic creation.
-
-Altered mbm_utm to work with comma delimited input data as well as
-white space delimited data.
-
-Updated proj library to current version 4.5.0.
-
-Updated gsf to the current version 2.07.
-
-Sidescan extracted from MBARI Mapping AUV data can now be laid out
-on a topography grid rather than laid out with a flat bottom
-assumption (mb7k2ss).
-
-The sidescan and amplitude correction scheme (mbbackangle & mbprocess)
-can now use a topography grid to calculate grazing angles.
-
-Altered several programs so that sidescan data can have valid zero or
-negative values. Stopped applying a shift to Simrad sidescan and amplitude
-values to force them to be positive.
-
-Added decimation feature to mblist, mbnavlist, and mbsegylist. Also added
-and/or fixed the delimiter, segment, and binary output features for all
-three listing programs.
-
-Added mbcopy capability to merge bathymetry and beam flags from a third
-"merge" swath file. This is a Gordon Keith contribution.
-
-MB-System programs will now recognize filename suffixes of the form
-".MB***" as well as ".mb***". Capitalized versions of many vendor
-format suffixes are also supported.
-
-Fixed error in mblist manual page.
-
-Fixed mbswath handling  of time gap errors that made plotting of
-single beam data problematic.
-
-Fixed problem with processing mgd77 data. Can now use mbedit to process
-single beam echosounder bathymetry.
-
-Made checking for data min maxes and bounds more robust to improve
-parsing through large databases.
-
-Added some generic gain values to mblist as part of the "raw" list.
-To do this, added mb_gains() function to MBIO. This is currently
-defined for SeaBeam 2112, Simrad, and Reson 7k multibeams.
-
-Added new program mbabsorption to calculate the sound absorption of
-seawater as a function of salinity, pH, temperature, depth, and
-frequency.
-
-Changed macro mbm_grdplot so that the -T option causes the coastline
-to be drawn without grayscale filling of dry areas. To obtain the
-previously default behavior, add -MTG128.
-
-Added support for newer Simrad multibeam data (e.g. EM710) in
-vendor format MBF_EM710RAW (format id 58) and processing
-format MBF_EM710MBA (format id 59)
-
-Updated format MBF_OMGHDCSJ (151), which supports the John Hughes
-Clark HDCS (SwathEd) format, to handle all of John's "version 3"
-data. John's "version 4" format is not yet supported.
-
-Added calculation and use of three dimensional covariance in
-the xyz nav offsets used by mbnavadjust.
-
-Added processing kluge006 to mbprocess. This "kluge" allows users to
-change the sonar draft value without changing the calculated bathymetry.
-This fixes a problem in which Atalante Simard data were exported by
-Caris into GSF with an incorrect sonar draft.
-
-Added program mbtime to allow command line conversion between calendar
-times and unix time values.
-
-Fixed mbprocess so that changes to the sonar depth/draft derived from
-mbnavadjust are output to the processed data. Previously the bathymetry
-was corrected, but not the sonar depth/draft.
-
-Fixed formats 58/59 to support EM302, EM122 in addition to EM710. Also
-supported "network attitude" datagram as source of attitude.
-
-Changed mbnavadjust inversion to use simplistic iterative relaxation
-rather than a full matrix solver. This targeted solver is faster and
-avoids some bad behavior around survey starts and ends.
-
-Fixed mbedit scaling for swath widths less than 6 m.
-
-Added formats 191 and 192 to support Imagenex Delta T multibeams.
-Format 191 supports the 83P vendor format and format 192 is an
-extended processing format. This format also supports data from
-the Odom ES3 multibeam sonar.
-
-Lengthened filename char arrays in mbedit, mbnavedit, and mbvelocitytool
-to prevent possible overflows with large paths.
-
-Updated the GSF code to new GSF version 2.09
-
-Fixed support of UNB OMG HDCS format 151 to handle situation where
-ancillary sidescan files are missing.
-
-Added new program mbctdlist to allow mblist style text output of
-CTD data from swath files. Initially relevant only to Reson 7k format data.
-
-Applied patches to mbgrid and mbmosaic to handle lonflipping of bounds in
-projected coordinates.
-
-Added format 26 to support Hydrosweep DS data format used by SOPAC.
-
-Fixed support for EM302 sonars.
-
-Augmented mbgrid footprint gridding algorithm. When used with the -F5
-option, mbgrid now does a first pass, low resolution grid to provide
-a local slope estimate. During the second pass, final gridding,
-individual beam footprints are tilted to reflect the local slope,
-increasing the high-resolution fidelity of the resulting topographic
-model.
-
-Enhanced the patch test capability of mbeditviz. MBeditviz can now be
-used to model time lag as well as roll, pitch, and heading bias. In order
-to use the time lag function, users must place files parallel to each
-swath file containing time series of attitude, heading, and sonardepth.
-These files contain the full asynchronous times series for heading,
-sonardepth, roll, and pitch and the synchronous time series for roll
-and pitch (asynchronous means the raw sensor data sampled more frequently
-than the sonar ping rate, and synchronous means the sensor data sampled
-at ping times).
-Each time series file uses epoch times in seconds as the first column.
-These files are:
-	*.ath - asynchronous heading - time heading
-	*.ats - asynchronous sonardepth - time sonardepth
-	*.ata - asynchronous attitude - time roll pitch
-	*.sta - synchronous attitude - time roll pitch
-Asynchronous data are not available in all formats. When available, the
-asynchronous data can be extracted using mbnavlist. The synchronous
-attitude can be extracted using mblist.
-
-Added support for EM12D data in the Caraibes netcdf form as format 76.
-Contributed by Gordon Keith.
-
-Removed a number of obsolete programs and macros from the distribution.
-The following are no longer distributed with MB-System:
- 	mbanglecorrect
- 	mbbackangleold
- 	mbbath
- 	mbcleanold
- 	mbeditold
- 	mbfilter
- 	mbgetmask
- 	mbmask
- 	mbmerge
- 	mbm_dslnavfix.perl
- 	mbm_fmtvel.perl
- 	mbm_vrefcheck.perl
- 	mbm_rollerror.perl
- 	mbnaveditold
- 	mbsmooth
- 	mbtide
- 	mbunclean
-
--------------------------------------------------------------------------------
-MB-SYSTEM VERSION 5.1.0 RELEASE NOTES:
--------------------------------------------------------------------------------
-
-The version 5.1.0 release of MB-System contains both bug fixes
-and new capabilities relative to the 5.0.9 release.
-
-A typo in the mbgrid man page was fixed.
-
-A catastrophic error in the i/o module for the MBF_ASCIIYXZ
-format was fixed.
-
-The proj library was updated to use code from the Proj 4.4.9 release.
-
-The proj and GSF libraries internal to MB-System have been
-renamed libmbproj and libmbgsf to avoid name conflicts with
-proj and gsf in package managers like fink for MacOsX.
-
-Fixed mbprocess problem with per-beam heave values when applying
-rotational bathymetry correction - previously did not initialize
-heave values for non-null but flagged beams.
-
-A minor change to mbbackangle to output the slope correction
-status (-Q) in the coments in the output file.
-
-Altered mbbackangle so that it outputs at least one table,
-even if there are no survey pings in a file. This prevents
-mbprocess from failing on data files with no survey pings.
-
-Also altered mbbackangle so that it outputs a single global
-correction table based on all of the input data. This can
-be used for uniform correction of sidescan and amplitude
-data.s
-
-A new program mbrolltimelag calculates the cross-correlation
-between roll data and the difference between the seafloor
-slope and the roll. If there is a time lag in the roll data,
-then the two series should have a cross correlation maximum
-at a nonzero time lag.
-
-New macro mbm_histplot for simple histogram plots.
-
-MBgrdviz now has a profile display capability. Profiles can
-be displayed and exported from two point picks, selected routes,
-and selected navigation. The profile view is enabled from the
-view menu.
-
-Fixed problems with output of ESRI ARC ascii grids from
-mbgrid and mbmosiac.
-
-Added interactive control over the target of precision of the
-navigation inversion in MBnavadjust.
-
-Added output of Winfrog pts file to mbm_route2mission.
-
-Added output of Winfrog pts file to mbgrdviz.
-
-MBedit now automatically chooses appropriate acrosstrack and
-vertical annotation intervals when files are opened.
-
-MBextractsegy now will extract subbottom data to segy files
-in sequential line files based on waypoints in a route file.
-The program generates a plotting shellscript that will in
-turn generate profile plots of the segy data. Long lines will
-be broken up into multiple plots.
-
-Updated manual page for mbm_route2mission.
-
-A bug in mbgrdtiff has been fixed that mislocated the geoTIFF
-images by 1/2 pixel, thanks to Gordon Keith.
-
-The plotting macros mbm_plot, mbm_grdplot, mbm_xyplot,
-mbm_3dgrdplot, and mbm_histplot all now use the current
-GMT default parameter PLOT_DEGREE_FORMAT rather than
-the old DEGREE_FORMAT.
-
-Upgraded the mbsystem/gsf code to GSF version 2.0.4. Since the
-libgsf code now has #ifdef statements allowing compilation
-under MacOSX, the code contained in MB-System no longer has
-modifications relative to the generic GSF releases.
-
-Added support for Simrad EM710 data in formats 56 and 57.
-
-Fixed byte count problem with comment records in format 94 (XSE data).
-
-Added GMT_end() calls to all programs calling gmtlib and pslib functions
-so that GMT "advisory file locking" does not system() calls to GMT programs.
-
-Put (void *) casts into qsort() calls to avoid compiler warnings.
-
-The macro mbm_grdplot now handles calls for a linear plot with
-decreasing x values (e.g. using -Jx-0.01/20 to specify the projection).
-
-A new edit mode called "grab" has been added to MBedit. In this
-mode, the user drags a rectangle on the ping display. When the mouse
-is released, all unflagged beams within that rectangle are flagged.
-
-All MB-System programs that read or write grids have been altered
-so that they will work with GMT 4.1.3 built in the default fashion
-(i.e. GMT built with "advisory file locking" enabled).
-
-Fixed mbgrdtiff so that it creates geographic GeoTIFF images with
-the longitude bounds consistent with the user's default or
-specified lonflip value.
-
-MBlist can now print out values associated with the port-most and
-starboard-most non-null beams and pixels. Use the special '=' or '+'
-characters in the -O option.
-
-Support was added for a new MBARI ROV navigation format (format id 170)
-
-Support was added for SEGY seismic data as single beam format (id = 160).
-Heading values are stored in an unused space in the trace header - this
-is an MB-System specific modification that will only be found in segy
-files generated by mbextractsegy.
-
-Ping number, and more importantly for seismic data, shot number
-annotation of navigation tracks is now supported by mbcontour and
-mbm_plot.
-
-Fixed problem reading some Simrad multibeam data with slightly broken
-bathymetry records.
-
--------------------------------------------------------------------------------
-MB-SYSTEM VERSION 5.0.9 RELEASE NOTES:
--------------------------------------------------------------------------------
-
-The version 5.0.9 release of MB-System is purely a bug fix
-release, and includes only a few changes relative to the 5.0.8
-release.
-
-The macros mbm_grdtiff, mbm_grd2arc, mbm_grd3dplot, mbm_grdinfo,
-mbm_grdtiff, mbm_grd2geovrml, and mbm_grdcut have been fixed to
-work properly with the output of the GMT 4.1 version of grdinfo.
-
-The code in src/mbio/mb_swap.c has been fixed so it will compile
-using the Solaris cc compiler.
-
-MBprocess had been fixed so that it will read navigation
-formats using julian days properly.
-
-MBnavedit has been altered so that speed and acceleration weighting
-values in the smooth inversion function can be less than 1.0.
-
-
--------------------------------------------------------------------------------
-MB-SYSTEM VERSION 5.0.8 RELEASE NOTES:
--------------------------------------------------------------------------------
-
-The version 5.0.8 release of MB-System includes several changes
-relative to the 5.0.7 release.
-
-MB-System 5.0.8 requires GMT 4.1 in order to build successfully.
-
-The format 75 (MBF_MBNETCDF) i/o module has been altered to
-handle multiple pings with the same time stamp without breaking
-the beam edit (edit save file) scheme, which depends upon
-unique time stamps. When multiple pings with the same time
-stamp are encountered, the subsequent pings have multiples
-of 2 msec added so that each has a detectably unique time
-stamp. This issue relates to Thompson Seafalcon II multibeam
-data; this sonar collects five simultaneous acrosstrack swathes.
-Since this is a deep water sonar, the maximum 10 msec time
-addition should not introduce excessive error in navigation
-or other aspects of the data.
-
-The Edgetech Jstar format is now supported through the new
-MB-System formats 132 and 133. The Jstar format is relevant
-to Edgetech FSDW systems (and related sonar products). The
-FSDW systems include chirp subbottom profiler and dual
-frequency chirp sidescan sonar. Format 132 treats the low
-frequency sidescan as survey data, and format 133 treats
-the high frequency sidescan as survey data.
-
-Incorrect trace scaling of subbottom and sidescan data
-in the Reson 7k format (format 88) has been fixed.
-
-A new program called mb7k2jstar has been added that extracts
-Edgetech subbottom and sidescan data from Reson 7k format (88)
-files and writes that data in Edgetech Jstar (132/133) format
-files.
-
-The comments in the install_makefiles script has been updated
-to show the correct parameters needed to build MB-System on
-a current Solaris system.
-
-A feature to apply longitude and latitude offsets to navigation
-data has been added to MBnavedit.
-
-The program mbextractsegy can now extract subbottom profiler
-data in segy format from both Reson 7k files (format 88) and
-Edgetech Jstar files (formats 132 and 133).
-
-MBprocess kluge005 has been defined to cause survey data
-timestamps to be replaced by the timestamps of the corresponding
-merged navigation records. This allows timestamps fixed using
-MBnavedit to be inserted into processed data.
-
-The program mbsegygrid can now apply a simple time-varying
-gain to traces before gridding. This gain may begin at either
-the start of each trace or at the seafloor arrival time. The
-user may also set the length of time the gain is applied;
-samples after the end of the gain window are zeroed.
-
-The method for determining the best altitude value to be used
-in correcting amplitude and sidescan data has been improved
-in programs mbbackangle and mbbprocess.
-
-The program mbgrid once again uses the Zgrid algorithm for
-thin plate spline interpolation. The code allows for the GMT
-Surface algorithm to be used instead by compiling with a
--DUSESURFACE compile flag.
-
-The macros mbm_grdplot and mbm_grd3dplot have been altered so
-that histogram equalization will work even if grdhisteq returns
-a smaller number of valid intervals than requested.
-
-The capability of plotting amplitude vs. grazing angle histograms
-from mbbackangle results has been fixed for sidescan data.
-
-A further significant architectural change was implemented for  release
-5.0.8  in  order  to support data formats that have no explicit maximum
-number of beams or pixels. The memory management of arrays used to hold
-bathymetry,  amplitude,  and  sidescan data has been made dynamic. Now,
-when data records are encountered that include larger numbers of  beams
-or  pixels  than  will  fit  in  the arrays previously allocated, those
-arrays are reallocated to the required size. This is handled  automati-
-cally for all of the internal arrays used by MBIO functions. Of course,
-applications using MBIO must  allocate  arrays  that  are  passed  into
-functions  like  mb_read, mb_get_all, and mb_get to be populated by the
-desired data. In order for these arrays to be managed dynamically,  the
-application  must  first register each array by passing the location of
-the array pointer to a new function called mb_register_array.
-
-The program MBgrdtiff has been altered so that the geoTiff images
-produced are more generally portable.
-
-A program called mbrolltimelag has been written to analyze attitude
-time lag. This macro extracts raw attitude and apparent slope values
-from multibeam data, and then calculates the cross correlation between
-roll and apparent slope over a specified range of time lags. If there
-is a an attitude time lag, then the bathymetry collected over a planar
-bottom should be dominated by a jitter that is correlated, with a time
-lag, with the roll signal.
-
-The format 56 (vendor Simrad multibeam format) i/o module has been
-altered to support data logged on byteswapped platforms (e.g. Windows
-Intel PC's.). The Simrad multibeam formats 56 and 57 now support
-recently introduced raw angle/range and water column imagery datagrams.
-These i/o modules also now handle cases where the beams listed in a
-sidescan datagram do not exactly match the beams listed in the corresponding
-bathymetry datagram differently than before. Previously the entire
-ping would have been dropped. Now, the ping is preserved but the raw
-sidescan samples are not used to generate binned sidescan.
-
-The program mbdatalist has been augmented to allow users to easily identify
-some problems with swath data files and the processing parameters
-specified in parameter files. The -n and -o options are used to generate
-ancillary files for all swath files referenced through a recursive datalist
-structure. These options now invoke mbinfo with the -n option, causing
-the "inf" files to include listings of easily identified data problems.
-The -q option of mbdatalist now extracts and lists these data problems
-as well as problems with the processing parameters.The possible data problems
-include:
-        No survey data found
-        Zero longitude or latitude in survey data
-        Instantaneous speed exceeds 25 km/hr
-        Average speed exceeds 25 km/hr
-        Sounding depth exceeds 11000 m
-        Unsupported Simrad datagram
-To populate the "inf" files of existing datalist structures with data problem
-notices, use mbdatalist with the -n option.
-
-The program mbvelocitytool now allows users to interactively set the
-center as well as the range of the water sound speed model plot window.
-
-Fixed mbm_plot so that it calculates reasonable plot bounds at high
-latitudes.
-
-The program mbset now accepts '=' as well as ':' as separators between
-parameter names and values in -P option arguments (as suggested by
-Bob Covill).
-
-The install_makefiles script has been altered so that the editable
-parameters are located towards the top of the file rather than below
-the documentation of example settings for different operating systems.
-
-The program mbareaclean now incorporates a mean filter as well as a
-median filter (contributed by Gordon Keith).
-
-The program mbmosaic will now mosaic grazing angle or acrosstrack slope as
-well as amplitude or sidescan data (contributed by Gordon Keith).
-
-The program mblist will now output some format specific values from
-Simrad multibeams (formats 56 and 57). In particular, some
-system parameters, raw amplitude values, and raw sidescan samples
-may now be output (Contributed by Gordon Keith).
-
-A new macro called mbm_makedatalist can easily generate a datalist
-referencing all identifiable swath files in a specified directory.
-
-There is a known but not understood bug in MBnavedit. When built on
-SUSE 10 systems, use of the smooth inversion function causes the first
-line of the output edited navigation to have NaN values for the
-longitude and lattitude.
-
--------------------------------------------------------------------------------
-MB-SYSTEM VERSION 5.0.7 RELEASE NOTES:
--------------------------------------------------------------------------------
-
-The version 5.0.7 release of MB-System includes several changes
-relative to the 5.0.6 release.
-
-MBprocess and MBset now support merging sonar depth
-(or draft) from separate time series files. This is
-controlled by the SONARDEPTHMODE, SONARDEPTHFILE,
-and SONARDEPTHFORMAT mbprocess parameters.
-
-A bug in mbgrid has been fixed that affected the footprint
-gridding algorithm used with bathymetry from sonars on
-submerged platforms.
-
-MBedit has new view options. The default is the the
-traditional waterfall view. Users may now also view the
-soundings from an alongtrack view perspective and an
-acrosstrack view perspective without static vertical
-offsets between pings. The view mode is controlled from
-the View menu and from keyboard macros (characters '2',
-'3', and '4').
-
-The 5.0.6 release mistakenly left the code in mbr_em300raw.c
-in debug mode, causing copious stderr output when reading
-raw Simrad data (format 56). This has been corrected.
-
-Problems with the output in debug mode of mbr_em300raw.c and
-mbr_em300mba.c have been fixed.
-
-The handling of the tickinfo string in the plot macros
-mbm_plot, mbm_grdplot, mbm_grd3dplot, and mbm_xyplot have
-been fixed.
-
-The orientation of the filename annotation by mbcontour
-has been fixed, and control over that orientation has been
-added to mbcontour and mbm_plot.
-
-Fixed problem of uninitialized data in mbr_mbpronav.c.
-
-Fixed problem with occasional incorrect scaling of sonar
-depth in mbldeoih format (71) data.
-
-Fixed problem in which sonar depth could be calculated
-from implausible pressure values in some single beam
-or navigation formats.
-
-Improved handling of interpolated asynchronous data,
-especially sonar depth, in Reson 7k data (format 88).
-
-A capability to interpolate over repeated values was added
-to mbnavedit.
-
-Fixed a problem with the beam footprint gridding algorithm
-in mbgrid that caused beam footprints to be miscalculated
-for submerged sonars.
-
-Fixed MBgrdviz crashes related to route data by fixing
-problem with allocation and deallocation of route
-arrays in the mbview library.
-
-Moved tide correction to end of processing tasks so that
-it doesn't mess up grazing angle calculations for amplitude
-and sidescan correction.
-
-Added option to mbm_grdplot allowing the user to specify
-a separate grid file to be contoured. This code was
-contributed by Gordon Keith.
-
--------------------------------------------------------------------------------
-MB-SYSTEM VERSION 5.0.6 RELEASE NOTES:
--------------------------------------------------------------------------------
-
-The version 5.0.6 release of MB-System includes several changes
-relative to the 5.0.5 release.
-
-The man page for mbprocess has been updated with full
-documentation of the navigation formats supported for
-merging by mbprocess.
-
-The merging of heading and attitude data from navigation files
-has been fixed.
-
-The ability to merge attitude data from a separate file
-has been added to mbprocess, and the mbprocess and mbset
-man pages have been updated.
-
-A problem producing ascii grids from mbgrid and mbmosaic
-has been identified, and a fix suggested by Gordon Keith
-adopted.
-
-A problem with the -D option of mblist has been identified,
-and a fix suggested by Gordon Keith adopted.
-
-A new program called mbneptune2esf has been contributed by
-Gordon Keith. MBneptune2esf  imports manual data flagging
-performed using Simrad's NEPTUNE software and flags those
-beams  in  the corresponding MB-System files.
-
-A new program called mbauvnavusbl has been added to the
-distribution. MBauvnavusbl reads a primary navigation file
-(usually from a submerged platform swath survey) and also
-reads secondary navigation (e.g. USBL fixes).  The program
-calculates position offsets between the raw survey navigation
-and the secondary navigation every 3600 seconds (10 minutes),
-and then linearly interpolates and applies this adjustment
-vector for each primary navigation position. The adjusted
-navigation is output.
-
-The ability to annotate tracklines on swath plots with
-the swath filenames has been added to mbm_plot and
-mbcontour. The annotation occurs at the beginning of the
-data associated with each file. This option can be used
-most simply by specifying -NF in mbm_plot. The suggestion
-and initial implementation were contributed by Gordon Keith.
-
-A problem with setting file paths in parameter files in
-the different directories associated with recursive
-datalists has been fixed. The nature of and fix to this
-bug were determined by Gordon Keith.
-
-Fixed makefiles to link libpsl.a with all programs making
-libgmt.a calls. This was necessitated by changes to the
-GMT4.0 release relative to the GMT4.0beta release.
-
-Implemented latest GSF release (2.0.3).
-
-Fixed, but not satisfactorily, a problem reading some older
-EM3000 data with the current format 56 i/o module.
-
-Added release version of simple grid visualization demo
-mbgrdviz.
-
-Improved the ability of mbgrid to embed background
-datasets.
-
--------------------------------------------------------------------------------
-MB-SYSTEM VERSION 5.0.5 RELEASE NOTES:
--------------------------------------------------------------------------------
-
-The version 5.0.5 release of MB-System includes several changes
-relative to the 5.0.4 release.
-
-The program mbgrid can now obtain background data from GMT grid
-files using grd2xyz as well as through raster databases using
-grdraster. See the -Kbackground option documentation in the
-mbgrid manual page.
-
-The macro mbm_xbt has been substantially updated.
-
-The -G option of mbinfo now avoids reporting zero starting
-positions (it always ignored zero positions for the reported
-data bounds).
-
-Provides read-only support for Edgetech sidescan and subbottom
-profiler data in the new Reson 6046 format (format id 88).
-
-A new program mbextractsegy allows for the extraction of
-subbottom profiler data into separate files in the SEGY
-format (this can apply only to data formats that incorporate
-subbottom data in with swath sonar data, and at present only
-supports format 88).
-
-A new program mbsegyinfo is a utility for reading a segy
-format seismic data file and outputting some basic statistics.
-The table generated shows the filename, data counts, navigation
-totals, time and navigation of the first and last data records,
-minimum and maximum data values, and the geographic bounding box
-of the data.
-
-A new program mbsegylist is a utility to output specified
-header values from segy seismic data files to stdout.
-The option -Ooutput_format is used to control the type and
-order of values output. By default, mbsegylist produces
-ASCII files in spreadsheet style, with data columns separated by
-tabs. Alternatively, the output can be binary, with each field
-represented as a double precision float (-A option).
-
-A new program mbsegygrid generates grids from subbottom
-profiler data (and seismic reflection data, and potentially
-other seismic data) in the SEGY format. These grids can then
-be displayed using GMT (through mbm_grdplot if desired).
-
-The program mbm_plot now works properly when start and end times
-are specified using the -MMB and -MME options.
-
-A bug involving the handling of edit save filenames by mbset and
-mbprocess has been fixed.
-
-Errors in handling Simrad datagrams and edit save files on
-byteswapped  machines (e.g. Intel or AMD processors) have been
-fixed.
-
-The program mbdatalist has a new option -Z which causes a
-standard "datalistp.mb-1" file to be created. This is a
-convenience file that applies the $PROCESSED flag to be
-applied to the swath files referenced in a datalist named
-"datalist.mb-1".
-
-Problems with the creation of amplitude vs. grazing angle
-correction tables using mbbackangle, and the use of those
-tables by mbprocess, have been fixed. The default settings
-for mbbackangle and amplitude vs. grazing angle correction
-by mbprocess have been changed.
-
-The default angle mode for raytracing has been changed so
-that starting angles are adjusted using Snell's Law for the
-difference between the SSV and the initial depth in the SVP.
-This change affects mbvelocitytool, mbsvplist, mbset, and
-mbprocess.
-
-The program mbsvplist now has an option -P that not only
-outputs SVPs in a swath file to individual ancillary SVP
-files (as with the -O option), but also sets the first SVP
-output file to be used by mbprocess to recalculate the
-bathymetry.
-
-Problems with the MGD77 format i/o module have been fixed
-according to suggestions from Bob Covill.
-
--------------------------------------------------------------------------------
-MB-SYSTEM VERSION 5.0.4 RELEASE NOTES:
--------------------------------------------------------------------------------
-
-The version 5.0.4 release of MB-System includes several changes
-relative to the 5.0.3 release.
-
-All of the interactive tools (MBedit, MBnavedit, MBvelocitytool,
-MBnavadjust) have been changed to require linking with the Motif 2.0
-or later library (or compatible open source versions such as OpenMotif
-or LessTif).
-
-The MB-System distribution is now compatible with GMT 4.0b. There have
-been minor changes to the pslib and gmtlib APIs, so it is necessary
-to specify the linked version of GMT in the mbsystem/install_makefiles
-script. Set:
-	$GMTVERSION = "4.0";
-if you are using GMT 4.0b, or set:
-	$GMTVERSION = "3.4";
-if you are still using GMT 3.4
-
-MBnavadjust has a significant new feature in which the contours
-displayed by the Nav Err window can be pre-generated. This greatly
-increases the speed with which the bathymetry crossings can be
-analyzed.
-
-A "Flag View" feature has been added to MBedit, allowing users to
-flag all of the beams in the current display. Key macros have also
-been defined for both the "Flag View" and "Unflag View" buttons.
-
-The raw Hydrosweep DS format (format 21) i/o module now estimates
-travel times from the bathymetry when data files lacking travel time
-records are read. This allows users to recalculate bathymetry by
-raytracing even if the travel times are not recorded.
-
--------------------------------------------------------------------------------
-MB-SYSTEM VERSION 5.0.3 RELEASE NOTES:
--------------------------------------------------------------------------------
-
-The version 5.0.3 release of MB-System includes two bug fixes
-relative to the 5.0.2 release.
-
-We have fixed a bug in the i/o modules for Simrad multibeam
-data (formats 56 and 57) that caused a failure to gracefully
-handle unsupported datagrams on byteswapped systems (e.g.
-Intel processors running Linux).
-
-We have fixed a bug that caused edit save files to be incorrectly
-read on byteswapped systems (e.g. Intel processors running Linux).
-
-We have fixed a bug in the i/o modules for binary SeaBeam 2100
-data (formats 42 and 43) that caused data to be written incorrectly
-on byteswapped systems (e.g. Intel processors running Linux).
-
--------------------------------------------------------------------------------
-MB-SYSTEM VERSION 5.0.2 RELEASE NOTES:
--------------------------------------------------------------------------------
-
-The version 5.0.2 release of MB-System includes two bug fixes
-relative to the 5.0.1 release.
-
-We have fixed a bug in the i/o module for Elac Bottomchart data
-in the XSE format (94) in which the sonar depth was added to
-bathymetry values when new data files were written.
-
-We have also fixed problems related to reading and writing
-SeaBeam 2100 data in the binary formats 42 and 43.
-
--------------------------------------------------------------------------------
-MB-SYSTEM VERSION 5.0.1 RELEASE NOTES:
--------------------------------------------------------------------------------
-
-The version 5.0.1 release of MB-System includes two bug fixes
-relative to the 5.0.0 release. The program mbgrid has been
-fixed so that it compiles correctly under Red Hat Linux. The
-program mbcopy has been fixed so that time and space bounds
-are successfully applied to pings with a time gap error.
-
-Also, the distribution now has a top directory name of mbsystem-5.0.1
-rather than just mbsystem. This will allow users to unpack the
-distribution in the target location without overwriting an existing
-older MB-System installation. Users can then rename the directory to
-mbsystem or create a soft link to mbsystem-5.0.1 named mbsystem
-(e.g. ln -s mbsystem-5.0.1 mbsystem).
-
--------------------------------------------------------------------------------
-MB-SYSTEM VERSION 5.0.0 RELEASE NOTES:
--------------------------------------------------------------------------------
-
-The version 5.0 release of MB-System includes a number of
-changes and improvements relative to the version 4 releases.
-The most significant changes include:
-
-A new approach to managing data processing.
-- Many tools - one output file.
-    In previous versions of MB-System, each processing
-    program read an input swath data file and
-    produced an output swath data file. This "serial"
-    processing scheme generally produced a large number of
-    intermediate data files. MB-System version 5.0 features the
-    integration of the editing and analysis tools with a single
-    program, mbprocess, that outputs processed data files. The
-    new "parallel" processing scheme covers bathymetry data
-    processing, but does not yet incorporate the sidescan
-    processing capabilities. All of the old tools and
-    capabilities are still part of the distribution.
-- Recursive datalists.
-    The lists of data files used by gridding and plotting
-    programs can now be recursive, making it simpler to manage
-    data from many different surveys.
-- Automatic format identification.
-    MB-System programs will now attempt to automatically
-    identify the swath data format based on the filename suffix.
-- Extended inf files.
-    Users can generate inf files by directing the output
-    of mbinfo to a file named by adding an
-    ".inf" suffix to the swath data file name. Several programs
-    can parse inf files, if they exist, to quickly obtain data
-    locations or ranges. This feature speeds operations such as
-    gridding, mosaicing, and automated plotting.
-
-New tools.
-- mbnavadjust.
-    This new tool allows users to adjust poorly
-    navigated surveys by matching features in overlapping
-    swathes. It is particularly useful for processing surveys
-    conducted from submerged platforms.
-- mbprocess.
-    This new tool performs a variety of processing
-    tasks and produces a single output processed swath data
-    file. The program mbprocess can apply bathymetry edits from
-    mbedit and mbclean, navigation edits from mbnavedit, sound
-    velocity profile changes from mbvelocitytool, and a variety
-    of other corrections.
-- mbset.
-    This new tool allows users to create and modify the
-    parameter files used to control the operation of mbprocess.
-- mbdatalist.
-    This new tool allows users to list the files referenced by
-    a recursive datalist structure. It can also be used to create
-    the ancillary ".inf", ".fbt", and ".fnv" files for all of the
-    data files referenced in a recursive datalist structure.
-- mbsvplist.
-    This new tool lists water sound velocity profiles embedded in
-    swath data files, creating secondary files that  can be read
-    into MBvelocitytool.
-- mbareaclean.
-    This new tool identifies and flags artifacts in swath sonar
-    bathymetry data within a specified area of interest. The area
-    is divided into a grid with square cells or bins, and the
-    data are grouped according to these bins. Once all of  data
-    are read, statistical tests are applied  to the soundings
-    within each bin.
-
-Improved bathymetry and navigation editors.
-- MBedit and MBnavedit now swallow data files whole rather than
-    reading in limited size buffers.
-- MBedit now outputs beam edit events rather than an entire swath
-    file. The edits are applied by MBprocess.
-- MBnavedit now outputs the edited navigation rather than an entire
-    swath file. The edited navigation is merged using MBprocess.
-- Both editors show the position of the currently displayed data
-    within the entire data file.
-- MBnavedit has two navigation modeling modes relevant to swath
-    data collected using poorly navigated ROVs and towfishes. One
-    mode applies a dead reckoning model with interactively set drifts,
-    and the other involves inverting for an optimally smooth
-    navigation by penalizing speed and acceleration.
-
-Support for Projected Coordinate Systems
-- MB-System now incorporates the source code for the PROJ.4
-    Cartographic Projections library, providing support for
-   (apparently) all commonly used geodetic coordinate systems.
-    PROJ.4 was developed by Gerald Evenden (then of the USGS),
-    and was obtained from the www.remotesensing.org website.
-- A large number of commonly used projected coordinate systems
-    (e.g. UTM) are defined in a file (mbsystem/share/projections.dat)
-    distributed with MB-System. These include all of the standard
-    UTM zones, all of the standard state plate coordinate systems,
-    and most of the European Petroleum Survey Group (EPSG)
-    coordinate systems (also including UTM).
-- MB-System can now handle swath data that is navigated in a supported
-    projected coordinate system. In particular, data files that are
-    navigated with UTM eastings and northings instead of longitude and
-    latitude can now be plotted and processed with MB-System.
-- The programs mbgrid and mbmosaic can now output grids and mosaics
-    in any of the projected coordinate systems specified in
-    mbsystem/share/projections.dat.
-- The TIFF  images generated with mbm_grdtiff and mbgrdtiff
-    now fully conform to the GeoTIFF standard, providing that the
-    source grids or mosaics were generated using mbgrid or mbmosaic
-    in either Geographic coordinates, UTM coordinates, or any of the
-    EPSG coordinate systems specified in the projections.dat file.
-    This means, for instance, that GeoTIFF images generated  with
-    mbgrdtiff will be properly georeferenced when they are
-    imported into ESRI ArcGIS or other GIS packages.
-
-Restructuring the code.
-- All of the C code now conforms to the ANSI C standard.
-- The underlying input/output library (MBIO) has been
-    substantially rewritten. The structure has been streamlined,
-    simplifying both future development and support of the
-    existing code. The MBIO API has been greatly modified.
-
-Handling of old Simrad multibeam data.
-- Vendor format data from the old Simrad multibeams (pre-
-    1997 sonars) are now supported by a single format id (51)
-    rather than a separate format id for each sonar model. The
-    old format id's are automatically aliased to 51, so existing
-    shellscripts will continue to work.
-- Sidescan data from old Simrad multibeams (pre-1997 sonars)
-    are now handled in the same manner as data from the newer
-    sonars (e.g. EM3000, EM3000, EM120). The raw samples in the
-    vendor data format are binned, averaged, and interpolated
-    into a 1024 pixel sidescan swath. This binned sidescan is
-    not saved in the vendor format, so it is recommended that
-    the data be copied to an extended format (57) that stores
-    both bathymetry beam flags and processed sidescan. Format 57
-    is also used for processing data from the current Simrad
-    multibeam sonars.
-
-Streamlining of MB-System Default Parameters.
-- Prior to version 5.0, the MB-System defaults set by mbdefaults
-    included the format id, a control for ping averaging,
-    longitude and latitude bounds for windowing by area, and
-    begin and end times for windowing in time. These values are
-    no longer set in the .mbio_defaults file or controlled by
-    mbdefaults. As noted above, the format id is automatically
-    identified from the filename when possible. When filenames
-    do not match one of the recognized structures, users must
-    specify the format using the relevant programs -Fformat option.
-    The controls for ping averaging and windowing in time and
-    space are rarely used, and must now be explicitly set in
-    command line arguments.
-
-New Data Formats
-- Furuno HS10 multibeam bathymetry is supported as format 171.
-- SeaBeam 2120 multibeam data in the L3 Communications XSE format
-    are supported as format 94 (already used to support Elac
-    Bottomchart MkII XSE data).
-- Raw STN Atlas multibeam data generated by the upgraded
-    Hydrosweep DS2 multibeam on the R/V Ewing are supported by
-    read-only format 182. Processing is supported using the
-    augmented read-write format 183.
-- The IFREMER netCDF multibeam archiving data format is supported
-    as format 75. Similarly, the IFREMER netCDF navigation
-    archiving data format is supported as format 167.
-- The STN Atlas processing data format SURF is supported as
-    format 181. At present, SURF is supported as a read-only
-    format. This allows plotting and gridding of the SURF data,
-    but not processing. Writing or translating the SURF data to
-    allow processing will be supported in a later version.
-- The Hawaii Mapping Research Group's new MR1 format is supported
-    as format 64. This format is used to disseminate data from
-    both the HMRG interferometric sonars (e.g. MR1) and the
-    WHOI DSL 120 deep-towed inteferometric sonar. This format has
-    been supported by including the code for the HMRG library
-    libmr1pr in the MB-System library. Thanks to Roger Davis and
-    HMRG for making the code available under the GPL.
diff --git a/GPL b/GPL
deleted file mode 100644
index 31f0b95..0000000
--- a/GPL
+++ /dev/null
@@ -1,671 +0,0 @@
--------------------------------------------------------------------------------
-MB-SYSTEM LICENSE:
--------------------------------------------------------------------------------
-Version: $Id: GPL 2079 2013-05-22 18:20:36Z caress $
--------------------------------------------------------------------------------
-
-This file contains the GNU GPL version 3 that is used for the MB-System open
-source software package for the processing and display of swath sonar data.
-This file is located at the top of the MB-System source code distribution
-directory structure.
-
--------------------------------------------------------------------------------
-                    GNU GENERAL PUBLIC LICENSE
--------------------------------------------------------------------------------
-
-Version 3, 29 June 2007
-
-Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
-
-Everyone is permitted to copy and distribute verbatim copies of this
-license document, but changing it is not allowed.
-
-Preamble
-
-The GNU General Public License is a free, copyleft license for software
-and other kinds of works.
-
-The licenses for most software and other practical works are designed
-to take away your freedom to share and change the works. By contrast,
-the GNU General Public License is intended to guarantee your freedom
-to share and change all versions of a program--to make sure it remains
-free software for all its users. We, the Free Software Foundation, use
-the GNU General Public License for most of our software; it applies
-also to any other work released this way by its authors. You can apply
-it to your programs, too.
-
-When we speak of free software, we are referring to freedom, not price.
-Our General Public Licenses are designed to make sure that you have the
-freedom to distribute copies of free software (and charge for them if
-you wish), that you receive source code or can get it if you want it,
-that you can change the software or use pieces of it in new free
-programs, and that you know you can do these things.
-
-To protect your rights, we need to prevent others from denying you
-these rights or asking you to surrender the rights. Therefore, you
-have certain responsibilities if you distribute copies of the software,
-or if you modify it: responsibilities to respect the freedom of others.
-For example, if you distribute copies of such a program, whether gratis
-or for a fee, you must pass on to the recipients the same freedoms that
-you received. You must make sure that they, too, receive or can get the
-source code. And you must show them these terms so they know their rights.
-Developers that use the GNU GPL protect your rights with two steps:
-(1) assert copyright on the software, and (2) offer you this License
-giving you legal permission to copy, distribute and/or modify it.
-For the developers' and authors' protection, the GPL clearly explains
-that there is no warranty for this free software. For both users' and
-authors' sake, the GPL requires that modified versions be marked as
-changed, so that their problems will not be attributed erroneously to
-authors of previous versions.
-
-Some devices are designed to deny users access to install or run modified
-versions of the software inside them, although the manufacturer can do so.
-This is fundamentally incompatible with the aim of protecting users'
-freedom to change the software. The systematic pattern of such abuse
-occurs in the area of products for individuals to use, which is precisely
-where it is most unacceptable. Therefore, we have designed this version of
-the GPL to prohibit the practice for those products. If such problems
-arise substantially in other domains, we stand ready to extend this
-provision to those domains in future versions of the GPL, as needed to
-protect the freedom of users.
-
-Finally, every program is threatened constantly by software patents.
-States should not allow patents to restrict development and use of
-software on general-purpose computers, but in those that do, we wish to
-avoid the special danger that patents applied to a free program could
-make it effectively proprietary. To prevent this, the GPL assures that
-patents cannot be used to render the program non-free.
-
-The precise terms and conditions for copying, distribution and modification
-follow.
-
-TERMS AND CONDITIONS
-0. Definitions.
-
-This License refers to version 3 of the GNU General Public License.
-
-Copyright also means copyright-like laws that apply to other kinds of
-works, such as semiconductor masks.
-
-The Program refers to any copyrightable work licensed under this License.
-Each licensee is addressed as you. Licensees and recipients may be
-individuals or organizations.
-
-To modify a work means to copy from or adapt all or part of the work in
-a fashion requiring copyright permission, other than the making of an
-exact copy. The resulting work is called a modified version of the
-earlier work or a work based on the earlier work.
-
-A covered work means either the unmodified Program or a work based on
-the Program.
-
-To propagate a work means to do anything with it that, without permission,
-would make you directly or secondarily liable for infringement under
-applicable copyright law, except executing it on a computer or modifying
-a private copy. Propagation includes copying, distribution (with or
-without modification), making available to the public, and in some
-countries other activities as well.
-
-To convey a work means any kind of propagation that enables other parties
-to make or receive copies. Mere interaction with a user through a
-computer network, with no transfer of a copy, is not conveying.
-An interactive user interface displays Appropriate Legal Notices to the
-extent that it includes a convenient and prominently visible feature
-that (1) displays an appropriate copyright notice, and (2) tells the
-user that there is no warranty for the work (except to the extent that
-warranties are provided), that licensees may convey the work under this
-License, and how to view a copy of this License. If the interface
-presents a list of user commands or options, such as a menu, a prominent
-item in the list meets this criterion.
-
-1. Source Code.
-
-The source code for a work means the preferred form of the work for
-making modifications to it. Object code means any non-source form of a
-work.
-
-A Standard Interface means an interface that either is an official
-standard defined by a recognized standards body, or, in the case of
-interfaces specified for a particular programming language, one that is
-widely used among developers working in that language.
-
-The System Libraries of an executable work include anything, other than
-the work as a whole, that (a) is included in the normal form of
-packaging a Major Component, but which is not part of that Major
-Component, and (b) serves only to enable use of the work with that
-Major Component, or to implement a Standard Interface for which an
-implementation is available to the public in source code form. A Major
-Component, in this context, means a major essential component (kernel,
-window system, and so on) of the specific operating system (if any) on
-which the executable work runs, or a compiler used to produce the work,
-or an object code interpreter used to run it.
-
-The Corresponding Source for a work in object code form means all the
-source code needed to generate, install, and (for an executable work)
-run the object code and to modify the work, including scripts to control
-those activities. However, it does not include the work's System
-Libraries, or general-purpose tools or generally available free programs
-which are used unmodified in performing those activities but which are
-not part of the work. For example, Corresponding Source includes
-interface definition files associated with source files for the work,
-and the source code for shared libraries and dynamically linked
-subprograms that the work is specifically designed to require, such as
-by intimate data communication or control flow between those subprograms
-and other parts of the work.
-
-The Corresponding Source need not include anything that users can
-regenerate automatically from other parts of the Corresponding Source.
-The Corresponding Source for a work in source code form is that same
-work.
-
-2. Basic Permissions.
-
-All rights granted under this License are granted for the term of
-copyright on the Program, and are irrevocable provided the stated
-conditions are met. This License explicitly affirms your unlimited
-permission to run the unmodified Program. The output from running a
-covered work is covered by this License only if the output, given its
-content, constitutes a covered work. This License acknowledges your
-rights of fair use or other equivalent, as provided by copyright law.
-You may make, run and propagate covered works that you do not convey,
-without conditions so long as your license otherwise remains in force.
-You may convey covered works to others for the sole purpose of having
-them make modifications exclusively for you, or provide you with
-facilities for running those works, provided that you comply with the
-terms of this License in conveying all material for which you do not
-control copyright. Those thus making or running the covered works for
-you must do so exclusively on your behalf, under your direction and
-control, on terms that prohibit them from making any copies of your
-copyrighted material outside their relationship with you.
-
-Conveying under any other circumstances is permitted solely under the
-conditions stated below. Sublicensing is not allowed; section 10 makes
-it unnecessary.
-
-3. Protecting Users' Legal Rights From Anti-Circumvention Law.
-
-No covered work shall be deemed part of an effective technological
-measure under any applicable law fulfilling obligations under article
-11 of the WIPO copyright treaty adopted on 20 December 1996, or similar
-laws prohibiting or restricting circumvention of such measures.
-
-When you convey a covered work, you waive any legal power to forbid
-circumvention of technological measures to the extent such circumvention
-is effected by exercising rights under this License with respect to the
-covered work, and you disclaim any intention to limit operation or
-modification of the work as a means of enforcing, against the work's
-users, your or third parties' legal rights to forbid circumvention of
-technological measures.
-
-4. Conveying Verbatim Copies.
-
-You may convey verbatim copies of the Program's source code as you
-receive it, in any medium, provided that you conspicuously and
-appropriately publish on each copy an appropriate copyright notice;
-keep intact all notices stating that this License and any non-permissive
-terms added in accord with section 7 apply to the code; keep intact all
-notices of the absence of any warranty; and give all recipients a copy
-of this License along with the Program.
-
-You may charge any price or no price for each copy that you convey, and
-you may offer support or warranty protection for a fee.
-
-5. Conveying Modified Source Versions.
-
-You may convey a work based on the Program, or the modifications to
-produce it from the Program, in the form of source code under the terms
-of section 4, provided that you also meet all of these conditions:
-	a) The work must carry prominent notices stating that you
-	   modified it, and giving a relevant date.
-	b) The work must carry prominent notices stating that it is
-	   released under this License and any conditions added under
-	   section 7. This requirement modifies the requirement in
-	   section 4 to keep intact all notices.
-	c) You must license the entire work, as a whole, under this
-	   License to anyone who comes into possession of a copy. This
-	   License will therefore apply, along with any applicable
-	   section 7 additional terms, to the whole of the work, and
-	   all its parts, regardless of how they are packaged. This
-	   License gives no permission to license the work in any other
-	   way, but it does not invalidate such permission if you have
-	   separately received it.
-	d) If the work has interactive user interfaces, each must
-	   display Appropriate Legal Notices; however, if the Program
-	   has interactive interfaces that do not display Appropriate
-	   Legal Notices, your work need not make them do so.
-
-A compilation of a covered work with other separate and independent
-works, which are not by their nature extensions of the covered work,
-and which are not combined with it such as to form a larger program,
-in or on a volume of a storage or distribution medium, is called an
-aggregate if the compilation and its resulting copyright are not used
-to limit the access or legal rights of the compilation's users beyond
-what the individual works permit. Inclusion of a covered work in an
-aggregate does not cause this License to apply to the other parts of
-the aggregate.
-
-6. Conveying Non-Source Forms.
-
-You may convey a covered work in object code form under the terms of
-sections 4 and 5, provided that you also convey the machine-readable
-Corresponding Source under the terms of this License, in one of these
-ways:
-	a) Convey the object code in, or embodied in, a physical
-	   product (including a physical distribution medium),
-	   accompanied by the Corresponding Source fixed on a durable
-	   physical medium customarily used for software interchange.
-	b) Convey the object code in, or embodied in, a physical
-	   product (including a physical distribution medium),
-	   accompanied by a written offer, valid for at least three
-	   years and valid for as long as you offer spare parts or
-	   customer support for that product model, to give anyone who
-	   possesses the object code either (1) a copy of the
-	   Corresponding Source for all the software in the product
-	   that is covered by this License, on a durable physical
-	   medium customarily used for software interchange, for a
-	   price no more than your reasonable cost of physically
-	   performing this conveying of source, or (2) access to copy
-	   the Corresponding Source from a network server at no charge.
-	c) Convey individual copies of the object code with a copy of
-	   the written offer to provide the Corresponding Source. This
-	   alternative is allowed only occasionally and noncommercially,
-	   and only if you received the object code with such an offer,
-	   in accord with subsection 6b.
-	d) Convey the object code by offering access from a designated
-	   place (gratis or for a charge), and offer equivalent access
-	   to the Corresponding Source in the same way through the same
-	   place at no further charge. You need not require recipients
-	   to copy the Corresponding Source along with the object code.
-	   If the place to copy the object code is a network server,
-	   the Corresponding Source may be on a different server
-	   (operated by you or a third party) that supports equivalent
-	   copying facilities, provided you maintain clear directions
-	   next to the object code saying where to find the
-	   Corresponding Source. Regardless of what server hosts the
-	   Corresponding Source, you remain obligated to ensure that it
-	   is available for as long as needed to satisfy these
-	   requirements.
-	e) Convey the object code using peer-to-peer transmission,
-	   provided you inform other peers where the object code and
-	   Corresponding Source of the work are being offered to the
-	   general public at no charge under subsection 6d.
-
-A separable portion of the object code, whose source code is excluded
-from the Corresponding Source as a System Library, need not be included
-in conveying the object code work.
-
-A User Product is either (1) a consumer product, which means any
-tangible personal property which is normally used for personal, family,
-or household purposes, or (2) anything designed or sold for
-incorporation into a dwelling. In determining whether a product is a
-consumer product, doubtful cases shall be resolved in favor of coverage.
-For a particular product received by a particular user, normally used
-refers to a typical or common use of that class of product, regardless
-of the status of the particular user or of the way in which the
-particular user actually uses, or expects or is expected to use, the
-product. A product is a consumer product regardless of whether the
-product has substantial commercial, industrial or non-consumer uses,
-unless such uses represent the only significant mode of use of the
-product.
-
-Installation Information for a User Product means any methods,
-procedures, authorization keys, or other information required to
-install and execute modified versions of a covered work in that User
-Product from a modified version of its Corresponding Source. The
-information must suffice to ensure that the continued functioning of
-the modified object code is in no case prevented or interfered with
-solely because modification has been made.
-
-If you convey an object code work under this section in, or with, or
-specifically for use in, a User Product, and the conveying occurs as
-part of a transaction in which the right of possession and use of the
-User Product is transferred to the recipient in perpetuity or for a
-fixed term (regardless of how the transaction is characterized), the
-Corresponding Source conveyed under this section must be accompanied
-by the Installation Information. But this requirement does not apply
-if neither you nor any third party retains the ability to install
-modified object code on the User Product (for example, the work has
-been installed in ROM).
-
-The requirement to provide Installation Information does not include a
-requirement to continue to provide support service, warranty, or
-updates for a work that has been modified or installed by the recipient,
-or for the User Product in which it has been modified or installed.
-Access to a network may be denied when the modification itself
-materially and adversely affects the operation of the network or
-violates the rules and protocols for communication across the network.
-
-Corresponding Source conveyed, and Installation Information provided,
-in accord with this section must be in a format that is publicly
-documented (and with an implementation available to the public in
-source code form), and must require no special password or key for
-unpacking, reading or copying.
-
-7. Additional Terms.
-
-Additional permissions are terms that supplement the terms of this
-License by making exceptions from one or more of its conditions.
-Additional permissions that are applicable to the entire Program shall
-be treated as though they were included in this License, to the extent
-that they are valid under applicable law. If additional permissions
-apply only to part of the Program, that part may be used separately
-under those permissions, but the entire Program remains governed by
-this License without regard to the additional permissions.
-
-When you convey a copy of a covered work, you may at your option remove
-any additional permissions from that copy, or from any part of it.
-(Additional permissions may be written to require their own removal in
-certain cases when you modify the work.) You may place additional
-permissions on material, added by you to a covered work, for which you
-have or can give appropriate copyright permission.
-
-Notwithstanding any other provision of this License, for material you
-add to a covered work, you may (if authorized by the copyright holders
-of that material) supplement the terms of this License with terms:
-	a) Disclaiming warranty or limiting liability differently from
-	   the terms of sections 15 and 16 of this License; or
-	b) Requiring preservation of specified reasonable legal notices
-	   or author attributions in that material or in the Appropriate
-	   Legal Notices displayed by works containing it; or
-	c) Prohibiting misrepresentation of the origin of that material,
-	   or requiring that modified versions of such material be
-	   marked in reasonable ways as different from the original
-	   version; or
-	d) Limiting the use for publicity purposes of names of licensors
-	   or authors of the material; or
-	e) Declining to grant rights under trademark law for use of some
-	   trade names, trademarks, or service marks; or
-	f) Requiring indemnification of licensors and authors of that
-	   material by anyone who conveys the material (or modified
-	   versions of it) with contractual assumptions of liability to
-	   the recipient, for any liability that these contractual
-	   assumptions directly impose on those licensors and authors.
-
-All other non-permissive additional terms are considered further
-restrictions within the meaning of section 10. If the Program as you
-received it, or any part of it, contains a notice stating that it is
-governed by this License along with a term that is a further restriction,
-you may remove that term. If a license document contains a further
-restriction but permits relicensing or conveying under this License,
-you may add to a covered work material governed by the terms of that
-license document, provided that the further restriction does not
-survive such relicensing or conveying.
-
-If you add terms to a covered work in accord with this section, you must
-place, in the relevant source files, a statement of the additional
-terms that apply to those files, or a notice indicating where to find
-the applicable terms.
-
-Additional terms, permissive or non-permissive, may be stated in the
-form of a separately written license, or stated as exceptions; the
-above requirements apply either way.
-
-8. Termination.
-
-You may not propagate or modify a covered work except as expressly
-provided under this License. Any attempt otherwise to propagate or
-modify it is void, and will automatically terminate your rights under
-this License (including any patent licenses granted under the third
-paragraph of section 11).
-
-However, if you cease all violation of this License, then your license
-from a particular copyright holder is reinstated (a) provisionally,
-unless and until the copyright holder explicitly and finally terminates
-your license, and (b) permanently, if the copyright holder fails to
-notify you of the violation by some reasonable means prior to 60 days
-after the cessation.
-
-Moreover, your license from a particular copyright holder is reinstated
-permanently if the copyright holder notifies you of the violation by
-some reasonable means, this is the first time you have received notice
-of violation of this License (for any work) from that copyright holder,
-and you cure the violation prior to 30 days after your receipt of the
-notice.
-
-Termination of your rights under this section does not terminate the
-licenses of parties who have received copies or rights from you under
-this License. If your rights have been terminated and not permanently
-reinstated, you do not qualify to receive new licenses for the same
-material under section 10.
-
-9. Acceptance Not Required for Having Copies.
-
-You are not required to accept this License in order to receive or
-run a copy of the Program. Ancillary propagation of a covered work
-occurring solely as a consequence of using peer-to-peer transmission
-to receive a copy likewise does not require acceptance. However,
-nothing other than this License grants you permission to propagate or
-modify any covered work. These actions infringe copyright if you do
-not accept this License. Therefore, by modifying or propagating a
-covered work, you indicate your acceptance of this License to do so.
-
-10. Automatic Licensing of Downstream Recipients.
-Each time you convey a covered work, the recipient automatically
-receives a license from the original licensors, to run, modify and
-propagate that work, subject to this License. You are not responsible
-for enforcing compliance by third parties with this License.
-
-An entity transaction is a transaction transferring control of an
-organization, or substantially all assets of one, or subdividing an
-organization, or merging organizations. If propagation of a covered
-work results from an entity transaction, each party to that transaction
-who receives a copy of the work also receives whatever licenses to the
-work the party's predecessor in interest had or could give under the
-previous paragraph, plus a right to possession of the Corresponding
-Source of the work from the predecessor in interest, if the predecessor
-has it or can get it with reasonable efforts.
-
-You may not impose any further restrictions on the exercise of the
-rights granted or affirmed under this License. For example, you may
-not impose a license fee, royalty, or other charge for exercise of
-rights granted under this License, and you may not initiate litigation
-(including a cross-claim or counterclaim in a lawsuit) alleging that
-any patent claim is infringed by making, using, selling, offering for
-sale, or importing the Program or any portion of it.
-
-11. Patents.
-
-A contributor is a copyright holder who authorizes use under this
-License of the Program or a work on which the Program is based. The
-work thus licensed is called the contributor's contributor version.
-
-A contributor's essential patent claims are all patent claims owned
-or controlled by the contributor, whether already acquired or hereafter
-acquired, that would be infringed by some manner, permitted by this
-License, of making, using, or selling its contributor version, but do
-not include claims that would be infringed only as a consequence of
-further modification of the contributor version. For purposes of this
-definition, control includes the right to grant patent sublicenses in
-a manner consistent with the requirements of this License.
-
-Each contributor grants you a non-exclusive, worldwide, royalty-free
-patent license under the contributor's essential patent claims, to
-make, use, sell, offer for sale, import and otherwise run, modify and
-propagate the contents of its contributor version.
-
-In the following three paragraphs, a patent license is any express
-agreement or commitment, however denominated, not to enforce a patent
-(such as an express permission to practice a patent or covenant not
-to sue for patent infringement). To grant such a patent license to a
-party means to make such an agreement or commitment not to enforce a
-patent against the party.
-
-If you convey a covered work, knowingly relying on a patent license,
-and the Corresponding Source of the work is not available for anyone
-to copy, free of charge and under the terms of this License, through
-a publicly available network server or other readily accessible means,
-then you must either (1) cause the Corresponding Source to be so
-available, or (2) arrange to deprive yourself of the benefit of the
-patent license for this particular work, or (3) arrange, in a manner
-consistent with the requirements of this License, to extend the patent
-license to downstream recipients. Knowingly relying means you have
-actual knowledge that, but for the patent license, your conveying the
-covered work in a country, or your recipient's use of the covered work
-in a country, would infringe one or more identifiable patents in that
-country that you have reason to believe are valid.
-
-If, pursuant to or in connection with a single transaction or
-arrangement, you convey, or propagate by procuring conveyance of, a
-covered work, and grant a patent license to some of the parties
-receiving the covered work authorizing them to use, propagate, modify
-or convey a specific copy of the covered work, then the patent license
-you grant is automatically extended to all recipients of the covered
-work and works based on it.
-
-A patent license is discriminatory if it does not include within the
-scope of its coverage, prohibits the exercise of, or is conditioned on
-the non-exercise of one or more of the rights that are specifically
-granted under this License. You may not convey a covered work if you
-are a party to an arrangement with a third party that is in the business
-of distributing software, under which you make payment to the third
-party based on the extent of your activity of conveying the work, and
-under which the third party grants, to any of the parties who would
-receive the covered work from you, a discriminatory patent license (a)
-in connection with copies of the covered work conveyed by you (or copies
-made from those copies), or (b) primarily for and in connection with
-specific products or compilations that contain the covered work, unless
-you entered into that arrangement, or that patent license was granted,
-prior to 28 March 2007.
-
-Nothing in this License shall be construed as excluding or limiting any
-implied license or other defenses to infringement that may otherwise be
-available to you under applicable patent law.
-
-12. No Surrender of Others' Freedom.
-
-If conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot convey a
-covered work so as to satisfy simultaneously your obligations under
-this License and any other pertinent obligations, then as a consequence
-you may not convey it at all. For example, if you agree to terms that
-obligate you to collect a royalty for further conveying from those to
-whom you convey the Program, the only way you could satisfy both those
-terms and this License would be to refrain entirely from conveying the
-Program.
-
-13. Use with the GNU Affero General Public License.
-
-Notwithstanding any other provision of this License, you have
-permission to link or combine any covered work with a work licensed
-under version 3 of the GNU Affero General Public License into a single
-combined work, and to convey the resulting work. The terms of this
-License will continue to apply to the part which is the covered work,
-but the special requirements of the GNU Affero General Public License,
-section 13, concerning interaction through a network will apply to the
-combination as such.
-
-14. Revised Versions of this License.
-
-The Free Software Foundation may publish revised and/or new versions
-of the GNU General Public License from time to time. Such new versions
-will be similar in spirit to the present version, but may differ in
-detail to address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Program
-specifies that a certain numbered version of the GNU General Public
-License or any later version applies to it, you have the option of
-following the terms and conditions either of that numbered version or
-of any later version published by the Free Software Foundation. If the
-Program does not specify a version number of the GNU General Public
-License, you may choose any version ever published by the Free Software
-Foundation.
-
-If the Program specifies that a proxy can decide which future versions
-of the GNU General Public License can be used, that proxy's public
-statement of acceptance of a version permanently authorizes you to
-choose that version for the Program.
-
-Later license versions may give you additional or different permissions.
-However, no additional obligations are imposed on any author or
-copyright holder as a result of your choosing to follow a later
-version.
-
-15. Disclaimer of Warranty.
-
-THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
-APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
-HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM AS IS WITHOUT WARRANTY
-OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED
-TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE
-OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU
-ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
-16. Limitation of Liability.
-
-IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR
-CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES
-ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT
-NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES
-SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO
-OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY
-HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
-
-17. Interpretation of Sections 15 and 16.
-
-If the disclaimer of warranty and limitation of liability provided
-above cannot be given local legal effect according to their terms,
-reviewing courts shall apply local law that most closely approximates
-an absolute waiver of all civil liability in connection with the Program,
-unless a warranty or assumption of liability accompanies a copy of the
-Program in return for a fee.
-
-END OF TERMS AND CONDITIONS
-
-How to Apply These Terms to Your New Programs
-
-If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these
-terms.
-
-To do so, attach the following notices to the program. It is safest to
-attach them to the start of each source file to most effectively state
-the exclusion of warranty; and each file should have at least the
-copyright line and a pointer to where the full notice is found.
-
-    <one line to give the program's name and a brief idea of what it does.>
-    Copyright (C) <year>  <name of author>
-
-    This program is free software: you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation, either version 3 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-Also add information on how to contact you by electronic and paper mail.
-If the program does terminal interaction, make it output a short notice
-like this when it starts in an interactive mode:
-
-    <program>  Copyright (C) <year>  <name of author>
-    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
-    This is free software, and you are welcome to redistribute it
-    under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License. Of course, your program's commands might
-be different; for a GUI interface, you would use an about box.
-
-You should also get your employer (if you work as a programmer) or school,
-if any, to sign a copyright disclaimer for the program, if necessary. For
-more information on this, and how to apply and follow the GNU GPL, see
-<http://www.gnu.org/licenses/>.
-
-The GNU General Public License does not permit incorporating your program
-into proprietary programs. If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library. If this is what you want to do, use the GNU Lesser General Public
-License instead of this License. But first, please read
-<http://www.gnu.org/philosophy/why-not-lgpl.html>.
-
--------------------------------------------------------------------------------
diff --git a/INSTALL b/INSTALL
deleted file mode 100644
index 2099840..0000000
--- a/INSTALL
+++ /dev/null
@@ -1,370 +0,0 @@
-Installation Instructions
-*************************
-
-Copyright (C) 1994-1996, 1999-2002, 2004-2013 Free Software Foundation,
-Inc.
-
-   Copying and distribution of this file, with or without modification,
-are permitted in any medium without royalty provided the copyright
-notice and this notice are preserved.  This file is offered as-is,
-without warranty of any kind.
-
-Basic Installation
-==================
-
-   Briefly, the shell command `./configure && make && make install'
-should configure, build, and install this package.  The following
-more-detailed instructions are generic; see the `README' file for
-instructions specific to this package.  Some packages provide this
-`INSTALL' file but do not implement all of the features documented
-below.  The lack of an optional feature in a given package is not
-necessarily a bug.  More recommendations for GNU packages can be found
-in *note Makefile Conventions: (standards)Makefile Conventions.
-
-   The `configure' shell script attempts to guess correct values for
-various system-dependent variables used during compilation.  It uses
-those values to create a `Makefile' in each directory of the package.
-It may also create one or more `.h' files containing system-dependent
-definitions.  Finally, it creates a shell script `config.status' that
-you can run in the future to recreate the current configuration, and a
-file `config.log' containing compiler output (useful mainly for
-debugging `configure').
-
-   It can also use an optional file (typically called `config.cache'
-and enabled with `--cache-file=config.cache' or simply `-C') that saves
-the results of its tests to speed up reconfiguring.  Caching is
-disabled by default to prevent problems with accidental use of stale
-cache files.
-
-   If you need to do unusual things to compile the package, please try
-to figure out how `configure' could check whether to do them, and mail
-diffs or instructions to the address given in the `README' so they can
-be considered for the next release.  If you are using the cache, and at
-some point `config.cache' contains results you don't want to keep, you
-may remove or edit it.
-
-   The file `configure.ac' (or `configure.in') is used to create
-`configure' by a program called `autoconf'.  You need `configure.ac' if
-you want to change it or regenerate `configure' using a newer version
-of `autoconf'.
-
-   The simplest way to compile this package is:
-
-  1. `cd' to the directory containing the package's source code and type
-     `./configure' to configure the package for your system.
-
-     Running `configure' might take a while.  While running, it prints
-     some messages telling which features it is checking for.
-
-  2. Type `make' to compile the package.
-
-  3. Optionally, type `make check' to run any self-tests that come with
-     the package, generally using the just-built uninstalled binaries.
-
-  4. Type `make install' to install the programs and any data files and
-     documentation.  When installing into a prefix owned by root, it is
-     recommended that the package be configured and built as a regular
-     user, and only the `make install' phase executed with root
-     privileges.
-
-  5. Optionally, type `make installcheck' to repeat any self-tests, but
-     this time using the binaries in their final installed location.
-     This target does not install anything.  Running this target as a
-     regular user, particularly if the prior `make install' required
-     root privileges, verifies that the installation completed
-     correctly.
-
-  6. You can remove the program binaries and object files from the
-     source code directory by typing `make clean'.  To also remove the
-     files that `configure' created (so you can compile the package for
-     a different kind of computer), type `make distclean'.  There is
-     also a `make maintainer-clean' target, but that is intended mainly
-     for the package's developers.  If you use it, you may have to get
-     all sorts of other programs in order to regenerate files that came
-     with the distribution.
-
-  7. Often, you can also type `make uninstall' to remove the installed
-     files again.  In practice, not all packages have tested that
-     uninstallation works correctly, even though it is required by the
-     GNU Coding Standards.
-
-  8. Some packages, particularly those that use Automake, provide `make
-     distcheck', which can by used by developers to test that all other
-     targets like `make install' and `make uninstall' work correctly.
-     This target is generally not run by end users.
-
-Compilers and Options
-=====================
-
-   Some systems require unusual options for compilation or linking that
-the `configure' script does not know about.  Run `./configure --help'
-for details on some of the pertinent environment variables.
-
-   You can give `configure' initial values for configuration parameters
-by setting variables in the command line or in the environment.  Here
-is an example:
-
-     ./configure CC=c99 CFLAGS=-g LIBS=-lposix
-
-   *Note Defining Variables::, for more details.
-
-Compiling For Multiple Architectures
-====================================
-
-   You can compile the package for more than one kind of computer at the
-same time, by placing the object files for each architecture in their
-own directory.  To do this, you can use GNU `make'.  `cd' to the
-directory where you want the object files and executables to go and run
-the `configure' script.  `configure' automatically checks for the
-source code in the directory that `configure' is in and in `..'.  This
-is known as a "VPATH" build.
-
-   With a non-GNU `make', it is safer to compile the package for one
-architecture at a time in the source code directory.  After you have
-installed the package for one architecture, use `make distclean' before
-reconfiguring for another architecture.
-
-   On MacOS X 10.5 and later systems, you can create libraries and
-executables that work on multiple system types--known as "fat" or
-"universal" binaries--by specifying multiple `-arch' options to the
-compiler but only a single `-arch' option to the preprocessor.  Like
-this:
-
-     ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
-                 CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
-                 CPP="gcc -E" CXXCPP="g++ -E"
-
-   This is not guaranteed to produce working output in all cases, you
-may have to build one architecture at a time and combine the results
-using the `lipo' tool if you have problems.
-
-Installation Names
-==================
-
-   By default, `make install' installs the package's commands under
-`/usr/local/bin', include files under `/usr/local/include', etc.  You
-can specify an installation prefix other than `/usr/local' by giving
-`configure' the option `--prefix=PREFIX', where PREFIX must be an
-absolute file name.
-
-   You can specify separate installation prefixes for
-architecture-specific files and architecture-independent files.  If you
-pass the option `--exec-prefix=PREFIX' to `configure', the package uses
-PREFIX as the prefix for installing programs and libraries.
-Documentation and other data files still use the regular prefix.
-
-   In addition, if you use an unusual directory layout you can give
-options like `--bindir=DIR' to specify different values for particular
-kinds of files.  Run `configure --help' for a list of the directories
-you can set and what kinds of files go in them.  In general, the
-default for these options is expressed in terms of `${prefix}', so that
-specifying just `--prefix' will affect all of the other directory
-specifications that were not explicitly provided.
-
-   The most portable way to affect installation locations is to pass the
-correct locations to `configure'; however, many packages provide one or
-both of the following shortcuts of passing variable assignments to the
-`make install' command line to change installation locations without
-having to reconfigure or recompile.
-
-   The first method involves providing an override variable for each
-affected directory.  For example, `make install
-prefix=/alternate/directory' will choose an alternate location for all
-directory configuration variables that were expressed in terms of
-`${prefix}'.  Any directories that were specified during `configure',
-but not in terms of `${prefix}', must each be overridden at install
-time for the entire installation to be relocated.  The approach of
-makefile variable overrides for each directory variable is required by
-the GNU Coding Standards, and ideally causes no recompilation.
-However, some platforms have known limitations with the semantics of
-shared libraries that end up requiring recompilation when using this
-method, particularly noticeable in packages that use GNU Libtool.
-
-   The second method involves providing the `DESTDIR' variable.  For
-example, `make install DESTDIR=/alternate/directory' will prepend
-`/alternate/directory' before all installation names.  The approach of
-`DESTDIR' overrides is not required by the GNU Coding Standards, and
-does not work on platforms that have drive letters.  On the other hand,
-it does better at avoiding recompilation issues, and works well even
-when some directory options were not specified in terms of `${prefix}'
-at `configure' time.
-
-Optional Features
-=================
-
-   If the package supports it, you can cause programs to be installed
-with an extra prefix or suffix on their names by giving `configure' the
-option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
-
-   Some packages pay attention to `--enable-FEATURE' options to
-`configure', where FEATURE indicates an optional part of the package.
-They may also pay attention to `--with-PACKAGE' options, where PACKAGE
-is something like `gnu-as' or `x' (for the X Window System).  The
-`README' should mention any `--enable-' and `--with-' options that the
-package recognizes.
-
-   For packages that use the X Window System, `configure' can usually
-find the X include and library files automatically, but if it doesn't,
-you can use the `configure' options `--x-includes=DIR' and
-`--x-libraries=DIR' to specify their locations.
-
-   Some packages offer the ability to configure how verbose the
-execution of `make' will be.  For these packages, running `./configure
---enable-silent-rules' sets the default to minimal output, which can be
-overridden with `make V=1'; while running `./configure
---disable-silent-rules' sets the default to verbose, which can be
-overridden with `make V=0'.
-
-Particular systems
-==================
-
-   On HP-UX, the default C compiler is not ANSI C compatible.  If GNU
-CC is not installed, it is recommended to use the following options in
-order to use an ANSI C compiler:
-
-     ./configure CC="cc -Ae -D_XOPEN_SOURCE=500"
-
-and if that doesn't work, install pre-built binaries of GCC for HP-UX.
-
-   HP-UX `make' updates targets which have the same time stamps as
-their prerequisites, which makes it generally unusable when shipped
-generated files such as `configure' are involved.  Use GNU `make'
-instead.
-
-   On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot
-parse its `<wchar.h>' header file.  The option `-nodtk' can be used as
-a workaround.  If GNU CC is not installed, it is therefore recommended
-to try
-
-     ./configure CC="cc"
-
-and if that doesn't work, try
-
-     ./configure CC="cc -nodtk"
-
-   On Solaris, don't put `/usr/ucb' early in your `PATH'.  This
-directory contains several dysfunctional programs; working variants of
-these programs are available in `/usr/bin'.  So, if you need `/usr/ucb'
-in your `PATH', put it _after_ `/usr/bin'.
-
-   On Haiku, software installed for all users goes in `/boot/common',
-not `/usr/local'.  It is recommended to use the following options:
-
-     ./configure --prefix=/boot/common
-
-Specifying the System Type
-==========================
-
-   There may be some features `configure' cannot figure out
-automatically, but needs to determine by the type of machine the package
-will run on.  Usually, assuming the package is built to be run on the
-_same_ architectures, `configure' can figure that out, but if it prints
-a message saying it cannot guess the machine type, give it the
-`--build=TYPE' option.  TYPE can either be a short name for the system
-type, such as `sun4', or a canonical name which has the form:
-
-     CPU-COMPANY-SYSTEM
-
-where SYSTEM can have one of these forms:
-
-     OS
-     KERNEL-OS
-
-   See the file `config.sub' for the possible values of each field.  If
-`config.sub' isn't included in this package, then this package doesn't
-need to know the machine type.
-
-   If you are _building_ compiler tools for cross-compiling, you should
-use the option `--target=TYPE' to select the type of system they will
-produce code for.
-
-   If you want to _use_ a cross compiler, that generates code for a
-platform different from the build platform, you should specify the
-"host" platform (i.e., that on which the generated programs will
-eventually be run) with `--host=TYPE'.
-
-Sharing Defaults
-================
-
-   If you want to set default values for `configure' scripts to share,
-you can create a site shell script called `config.site' that gives
-default values for variables like `CC', `cache_file', and `prefix'.
-`configure' looks for `PREFIX/share/config.site' if it exists, then
-`PREFIX/etc/config.site' if it exists.  Or, you can set the
-`CONFIG_SITE' environment variable to the location of the site script.
-A warning: not all `configure' scripts look for a site script.
-
-Defining Variables
-==================
-
-   Variables not defined in a site shell script can be set in the
-environment passed to `configure'.  However, some packages may run
-configure again during the build, and the customized values of these
-variables may be lost.  In order to avoid this problem, you should set
-them in the `configure' command line, using `VAR=value'.  For example:
-
-     ./configure CC=/usr/local2/bin/gcc
-
-causes the specified `gcc' to be used as the C compiler (unless it is
-overridden in the site shell script).
-
-Unfortunately, this technique does not work for `CONFIG_SHELL' due to
-an Autoconf limitation.  Until the limitation is lifted, you can use
-this workaround:
-
-     CONFIG_SHELL=/bin/bash ./configure CONFIG_SHELL=/bin/bash
-
-`configure' Invocation
-======================
-
-   `configure' recognizes the following options to control how it
-operates.
-
-`--help'
-`-h'
-     Print a summary of all of the options to `configure', and exit.
-
-`--help=short'
-`--help=recursive'
-     Print a summary of the options unique to this package's
-     `configure', and exit.  The `short' variant lists options used
-     only in the top level, while the `recursive' variant lists options
-     also present in any nested packages.
-
-`--version'
-`-V'
-     Print the version of Autoconf used to generate the `configure'
-     script, and exit.
-
-`--cache-file=FILE'
-     Enable the cache: use and save the results of the tests in FILE,
-     traditionally `config.cache'.  FILE defaults to `/dev/null' to
-     disable caching.
-
-`--config-cache'
-`-C'
-     Alias for `--cache-file=config.cache'.
-
-`--quiet'
-`--silent'
-`-q'
-     Do not print messages saying which checks are being made.  To
-     suppress all normal output, redirect it to `/dev/null' (any error
-     messages will still be shown).
-
-`--srcdir=DIR'
-     Look for the package's source code in directory DIR.  Usually
-     `configure' can determine that directory automatically.
-
-`--prefix=DIR'
-     Use DIR as the installation prefix.  *note Installation Names::
-     for more details, including other options available for fine-tuning
-     the installation locations.
-
-`--no-create'
-`-n'
-     Run the configure checks, but stop before creating any output
-     files.
-
-`configure' also accepts some other, not widely useful, options.  Run
-`configure --help' for more details.
diff --git a/Makefile.am b/Makefile.am
deleted file mode 100644
index f8238b2..0000000
--- a/Makefile.am
+++ /dev/null
@@ -1,3 +0,0 @@
-ACLOCAL_AMFLAGS = -I m4
-
-SUBDIRS = src
diff --git a/Makefile.in b/Makefile.in
deleted file mode 100644
index 532128a..0000000
--- a/Makefile.in
+++ /dev/null
@@ -1,818 +0,0 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
-
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
-am__make_running_with_option = \
-  case $${target_option-} in \
-      ?) ;; \
-      *) echo "am__make_running_with_option: internal error: invalid" \
-              "target option '$${target_option-}' specified" >&2; \
-         exit 1;; \
-  esac; \
-  has_opt=no; \
-  sane_makeflags=$$MAKEFLAGS; \
-  if $(am__is_gnu_make); then \
-    sane_makeflags=$$MFLAGS; \
-  else \
-    case $$MAKEFLAGS in \
-      *\\[\ \	]*) \
-        bs=\\; \
-        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
-          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
-    esac; \
-  fi; \
-  skip_next=no; \
-  strip_trailopt () \
-  { \
-    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
-  }; \
-  for flg in $$sane_makeflags; do \
-    test $$skip_next = yes && { skip_next=no; continue; }; \
-    case $$flg in \
-      *=*|--*) continue;; \
-        -*I) strip_trailopt 'I'; skip_next=yes;; \
-      -*I?*) strip_trailopt 'I';; \
-        -*O) strip_trailopt 'O'; skip_next=yes;; \
-      -*O?*) strip_trailopt 'O';; \
-        -*l) strip_trailopt 'l'; skip_next=yes;; \
-      -*l?*) strip_trailopt 'l';; \
-      -[dEDm]) skip_next=yes;; \
-      -[JT]) skip_next=yes;; \
-    esac; \
-    case $$flg in \
-      *$$target_option*) has_opt=yes; break;; \
-    esac; \
-  done; \
-  test $$has_opt = yes
-am__make_dryrun = (target_option=n; $(am__make_running_with_option))
-am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-subdir = .
-DIST_COMMON = INSTALL NEWS README AUTHORS ChangeLog \
-	$(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/configure $(am__configure_deps) COPYING ar-lib \
-	compile config.guess config.sub install-sh missing ltmain.sh
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
-	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
-	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
-	$(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-	$(ACLOCAL_M4)
-am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
- configure.lineno config.status.lineno
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/src/mbio/mb_config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-AM_V_P = $(am__v_P_ at AM_V@)
-am__v_P_ = $(am__v_P_ at AM_DEFAULT_V@)
-am__v_P_0 = false
-am__v_P_1 = :
-AM_V_GEN = $(am__v_GEN_ at AM_V@)
-am__v_GEN_ = $(am__v_GEN_ at AM_DEFAULT_V@)
-am__v_GEN_0 = @echo "  GEN     " $@;
-am__v_GEN_1 = 
-AM_V_at = $(am__v_at_ at AM_V@)
-am__v_at_ = $(am__v_at_ at AM_DEFAULT_V@)
-am__v_at_0 = @
-am__v_at_1 = 
-SOURCES =
-DIST_SOURCES =
-RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
-	ctags-recursive dvi-recursive html-recursive info-recursive \
-	install-data-recursive install-dvi-recursive \
-	install-exec-recursive install-html-recursive \
-	install-info-recursive install-pdf-recursive \
-	install-ps-recursive install-recursive installcheck-recursive \
-	installdirs-recursive pdf-recursive ps-recursive \
-	tags-recursive uninstall-recursive
-am__can_run_installinfo = \
-  case $$AM_UPDATE_INFO_DIR in \
-    n|no|NO) false;; \
-    *) (install-info --version) >/dev/null 2>&1;; \
-  esac
-RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
-  distclean-recursive maintainer-clean-recursive
-am__recursive_targets = \
-  $(RECURSIVE_TARGETS) \
-  $(RECURSIVE_CLEAN_TARGETS) \
-  $(am__extra_recursive_targets)
-AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
-	cscope distdir dist dist-all distcheck
-am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
-# Read a list of newline-separated strings from the standard input,
-# and print each of them once, without duplicates.  Input order is
-# *not* preserved.
-am__uniquify_input = $(AWK) '\
-  BEGIN { nonempty = 0; } \
-  { items[$$0] = 1; nonempty = 1; } \
-  END { if (nonempty) { for (i in items) print i; }; } \
-'
-# Make sure the list of sources is unique.  This is necessary because,
-# e.g., the same source file might be shared among _SOURCES variables
-# for different programs/libraries.
-am__define_uniq_tagged_files = \
-  list='$(am__tagged_files)'; \
-  unique=`for i in $$list; do \
-    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-  done | $(am__uniquify_input)`
-ETAGS = etags
-CTAGS = ctags
-CSCOPE = cscope
-DIST_SUBDIRS = $(SUBDIRS)
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-distdir = $(PACKAGE)-$(VERSION)
-top_distdir = $(distdir)
-am__remove_distdir = \
-  if test -d "$(distdir)"; then \
-    find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
-      && rm -rf "$(distdir)" \
-      || { sleep 5 && rm -rf "$(distdir)"; }; \
-  else :; fi
-am__post_remove_distdir = $(am__remove_distdir)
-am__relativize = \
-  dir0=`pwd`; \
-  sed_first='s,^\([^/]*\)/.*$$,\1,'; \
-  sed_rest='s,^[^/]*/*,,'; \
-  sed_last='s,^.*/\([^/]*\)$$,\1,'; \
-  sed_butlast='s,/*[^/]*$$,,'; \
-  while test -n "$$dir1"; do \
-    first=`echo "$$dir1" | sed -e "$$sed_first"`; \
-    if test "$$first" != "."; then \
-      if test "$$first" = ".."; then \
-        dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
-        dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
-      else \
-        first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
-        if test "$$first2" = "$$first"; then \
-          dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
-        else \
-          dir2="../$$dir2"; \
-        fi; \
-        dir0="$$dir0"/"$$first"; \
-      fi; \
-    fi; \
-    dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
-  done; \
-  reldir="$$dir2"
-DIST_ARCHIVES = $(distdir).tar.gz
-GZIP_ENV = --best
-DIST_TARGETS = dist-gzip
-distuninstallcheck_listfiles = find . -type f -print
-am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
-  | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
-distcleancheck_listfiles = find . -type f -print
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-CC = @CC@
-CCAS = @CCAS@
-CCASDEPMODE = @CCASDEPMODE@
-CCASFLAGS = @CCASFLAGS@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DLLTOOL = @DLLTOOL@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GREP = @GREP@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBM = @LIBM@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIBTOOL_DEPS = @LIBTOOL_DEPS@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LTLIBOBJS = @LTLIBOBJS@
-LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
-MAINT = @MAINT@
-MAKEINFO = @MAKEINFO@
-MANIFEST_TOOL = @MANIFEST_TOOL@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-OTPS_DIR = @OTPS_DIR@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_URL = @PACKAGE_URL@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PKG_CONFIG = @PKG_CONFIG@
-PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
-PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-VERSION = @VERSION@
-XDR_LIB = @XDR_LIB@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_AR = @ac_ct_AR@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-fftw_app = @fftw_app@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libGLU_CFLAGS = @libGLU_CFLAGS@
-libGLU_LIBS = @libGLU_LIBS@
-libXm_CFLAGS = @libXm_CFLAGS@
-libXm_LIBS = @libXm_LIBS@
-libdir = @libdir@
-libexecdir = @libexecdir@
-libfftw3_CFLAGS = @libfftw3_CFLAGS@
-libfftw3_LIBS = @libfftw3_LIBS@
-libfftw_CPPFLAGS = @libfftw_CPPFLAGS@
-libfftw_LIBS = @libfftw_LIBS@
-libgmt_CFLAGS = @libgmt_CFLAGS@
-libgmt_CPPFLAGS = @libgmt_CPPFLAGS@
-libgmt_LIBS = @libgmt_LIBS@
-libmotif_CPPFLAGS = @libmotif_CPPFLAGS@
-libmotif_LIBS = @libmotif_LIBS@
-libnetcdf_CFLAGS = @libnetcdf_CFLAGS@
-libnetcdf_CPPFLAGS = @libnetcdf_CPPFLAGS@
-libnetcdf_LIBS = @libnetcdf_LIBS@
-libopengl_CPPFLAGS = @libopengl_CPPFLAGS@
-libopengl_LIBS = @libopengl_LIBS@
-libproj_CFLAGS = @libproj_CFLAGS@
-libproj_CPPFLAGS = @libproj_CPPFLAGS@
-libproj_LIBS = @libproj_LIBS@
-libpsl_CFLAGS = @libpsl_CFLAGS@
-libpsl_LIBS = @libpsl_LIBS@
-localedir = @localedir@
-localstatedir = @localstatedir@
-mandir = @mandir@
-mbsystemdatadir = @mbsystemdatadir@
-mbsystemhtmldir = @mbsystemhtmldir@
-mbsystempsdir = @mbsystempsdir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-ACLOCAL_AMFLAGS = -I m4
-SUBDIRS = src
-all: all-recursive
-
-.SUFFIXES:
-am--refresh: Makefile
-	@:
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
-	@for dep in $?; do \
-	  case '$(am__configure_deps)' in \
-	    *$$dep*) \
-	      echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \
-	      $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \
-		&& exit 0; \
-	      exit 1;; \
-	  esac; \
-	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \
-	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --gnu Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	@case '$?' in \
-	  *config.status*) \
-	    echo ' $(SHELL) ./config.status'; \
-	    $(SHELL) ./config.status;; \
-	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
-	esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	$(SHELL) ./config.status --recheck
-
-$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
-	$(am__cd) $(srcdir) && $(AUTOCONF)
-$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
-	$(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
-$(am__aclocal_m4_deps):
-
-mostlyclean-libtool:
-	-rm -f *.lo
-
-clean-libtool:
-	-rm -rf .libs _libs
-
-distclean-libtool:
-	-rm -f libtool config.lt
-
-# This directory's subdirectories are mostly independent; you can cd
-# into them and run 'make' without going through this Makefile.
-# To change the values of 'make' variables: instead of editing Makefiles,
-# (1) if the variable is set in 'config.status', edit 'config.status'
-#     (which will cause the Makefiles to be regenerated when you run 'make');
-# (2) otherwise, pass the desired values on the 'make' command line.
-$(am__recursive_targets):
-	@fail=; \
-	if $(am__make_keepgoing); then \
-	  failcom='fail=yes'; \
-	else \
-	  failcom='exit 1'; \
-	fi; \
-	dot_seen=no; \
-	target=`echo $@ | sed s/-recursive//`; \
-	case "$@" in \
-	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
-	  *) list='$(SUBDIRS)' ;; \
-	esac; \
-	for subdir in $$list; do \
-	  echo "Making $$target in $$subdir"; \
-	  if test "$$subdir" = "."; then \
-	    dot_seen=yes; \
-	    local_target="$$target-am"; \
-	  else \
-	    local_target="$$target"; \
-	  fi; \
-	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
-	  || eval $$failcom; \
-	done; \
-	if test "$$dot_seen" = "no"; then \
-	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
-	fi; test -z "$$fail"
-
-ID: $(am__tagged_files)
-	$(am__define_uniq_tagged_files); mkid -fID $$unique
-tags: tags-recursive
-TAGS: tags
-
-tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
-	set x; \
-	here=`pwd`; \
-	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
-	  include_option=--etags-include; \
-	  empty_fix=.; \
-	else \
-	  include_option=--include; \
-	  empty_fix=; \
-	fi; \
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
-	    test ! -f $$subdir/TAGS || \
-	      set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
-	  fi; \
-	done; \
-	$(am__define_uniq_tagged_files); \
-	shift; \
-	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
-	  test -n "$$unique" || unique=$$empty_fix; \
-	  if test $$# -gt 0; then \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      "$$@" $$unique; \
-	  else \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      $$unique; \
-	  fi; \
-	fi
-ctags: ctags-recursive
-
-CTAGS: ctags
-ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
-	$(am__define_uniq_tagged_files); \
-	test -z "$(CTAGS_ARGS)$$unique" \
-	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$unique
-
-GTAGS:
-	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && $(am__cd) $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) "$$here"
-cscope: cscope.files
-	test ! -s cscope.files \
-	  || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS)
-clean-cscope:
-	-rm -f cscope.files
-cscope.files: clean-cscope cscopelist
-cscopelist: cscopelist-recursive
-
-cscopelist-am: $(am__tagged_files)
-	list='$(am__tagged_files)'; \
-	case "$(srcdir)" in \
-	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
-	  *) sdir=$(subdir)/$(srcdir) ;; \
-	esac; \
-	for i in $$list; do \
-	  if test -f "$$i"; then \
-	    echo "$(subdir)/$$i"; \
-	  else \
-	    echo "$$sdir/$$i"; \
-	  fi; \
-	done >> $(top_builddir)/cscope.files
-
-distclean-tags:
-	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-	-rm -f cscope.out cscope.in.out cscope.po.out cscope.files
-
-distdir: $(DISTFILES)
-	$(am__remove_distdir)
-	test -d "$(distdir)" || mkdir "$(distdir)"
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	list='$(DISTFILES)'; \
-	  dist_files=`for file in $$list; do echo $$file; done | \
-	  sed -e "s|^$$srcdirstrip/||;t" \
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
-	case $$dist_files in \
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
-			   sort -u` ;; \
-	esac; \
-	for file in $$dist_files; do \
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  if test -d $$d/$$file; then \
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
-	    if test -d "$(distdir)/$$file"; then \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
-	  else \
-	    test -f "$(distdir)/$$file" \
-	    || cp -p $$d/$$file "$(distdir)/$$file" \
-	    || exit 1; \
-	  fi; \
-	done
-	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
-	    $(am__make_dryrun) \
-	      || test -d "$(distdir)/$$subdir" \
-	      || $(MKDIR_P) "$(distdir)/$$subdir" \
-	      || exit 1; \
-	    dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
-	    $(am__relativize); \
-	    new_distdir=$$reldir; \
-	    dir1=$$subdir; dir2="$(top_distdir)"; \
-	    $(am__relativize); \
-	    new_top_distdir=$$reldir; \
-	    echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
-	    echo "     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
-	    ($(am__cd) $$subdir && \
-	      $(MAKE) $(AM_MAKEFLAGS) \
-	        top_distdir="$$new_top_distdir" \
-	        distdir="$$new_distdir" \
-		am__remove_distdir=: \
-		am__skip_length_check=: \
-		am__skip_mode_fix=: \
-	        distdir) \
-	      || exit 1; \
-	  fi; \
-	done
-	-test -n "$(am__skip_mode_fix)" \
-	|| find "$(distdir)" -type d ! -perm -755 \
-		-exec chmod u+rwx,go+rx {} \; -o \
-	  ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
-	  ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
-	  ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
-	|| chmod -R a+r "$(distdir)"
-dist-gzip: distdir
-	tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
-	$(am__post_remove_distdir)
-
-dist-bzip2: distdir
-	tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2
-	$(am__post_remove_distdir)
-
-dist-lzip: distdir
-	tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz
-	$(am__post_remove_distdir)
-
-dist-xz: distdir
-	tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
-	$(am__post_remove_distdir)
-
-dist-tarZ: distdir
-	@echo WARNING: "Support for shar distribution archives is" \
-	               "deprecated." >&2
-	@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
-	tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
-	$(am__post_remove_distdir)
-
-dist-shar: distdir
-	@echo WARNING: "Support for distribution archives compressed with" \
-		       "legacy program 'compress' is deprecated." >&2
-	@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
-	shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
-	$(am__post_remove_distdir)
-
-dist-zip: distdir
-	-rm -f $(distdir).zip
-	zip -rq $(distdir).zip $(distdir)
-	$(am__post_remove_distdir)
-
-dist dist-all:
-	$(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:'
-	$(am__post_remove_distdir)
-
-# This target untars the dist file and tries a VPATH configuration.  Then
-# it guarantees that the distribution is self-contained by making another
-# tarfile.
-distcheck: dist
-	case '$(DIST_ARCHIVES)' in \
-	*.tar.gz*) \
-	  GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
-	*.tar.bz2*) \
-	  bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
-	*.tar.lz*) \
-	  lzip -dc $(distdir).tar.lz | $(am__untar) ;;\
-	*.tar.xz*) \
-	  xz -dc $(distdir).tar.xz | $(am__untar) ;;\
-	*.tar.Z*) \
-	  uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
-	*.shar.gz*) \
-	  GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\
-	*.zip*) \
-	  unzip $(distdir).zip ;;\
-	esac
-	chmod -R a-w $(distdir)
-	chmod u+w $(distdir)
-	mkdir $(distdir)/_build $(distdir)/_inst
-	chmod a-w $(distdir)
-	test -d $(distdir)/_build || exit 0; \
-	dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
-	  && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
-	  && am__cwd=`pwd` \
-	  && $(am__cd) $(distdir)/_build \
-	  && ../configure \
-	    $(AM_DISTCHECK_CONFIGURE_FLAGS) \
-	    $(DISTCHECK_CONFIGURE_FLAGS) \
-	    --srcdir=.. --prefix="$$dc_install_base" \
-	  && $(MAKE) $(AM_MAKEFLAGS) \
-	  && $(MAKE) $(AM_MAKEFLAGS) dvi \
-	  && $(MAKE) $(AM_MAKEFLAGS) check \
-	  && $(MAKE) $(AM_MAKEFLAGS) install \
-	  && $(MAKE) $(AM_MAKEFLAGS) installcheck \
-	  && $(MAKE) $(AM_MAKEFLAGS) uninstall \
-	  && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
-	        distuninstallcheck \
-	  && chmod -R a-w "$$dc_install_base" \
-	  && ({ \
-	       (cd ../.. && umask 077 && mkdir "$$dc_destdir") \
-	       && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
-	       && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
-	       && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
-	            distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
-	      } || { rm -rf "$$dc_destdir"; exit 1; }) \
-	  && rm -rf "$$dc_destdir" \
-	  && $(MAKE) $(AM_MAKEFLAGS) dist \
-	  && rm -rf $(DIST_ARCHIVES) \
-	  && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \
-	  && cd "$$am__cwd" \
-	  || exit 1
-	$(am__post_remove_distdir)
-	@(echo "$(distdir) archives ready for distribution: "; \
-	  list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
-	  sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
-distuninstallcheck:
-	@test -n '$(distuninstallcheck_dir)' || { \
-	  echo 'ERROR: trying to run $@ with an empty' \
-	       '$$(distuninstallcheck_dir)' >&2; \
-	  exit 1; \
-	}; \
-	$(am__cd) '$(distuninstallcheck_dir)' || { \
-	  echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \
-	  exit 1; \
-	}; \
-	test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \
-	   || { echo "ERROR: files left after uninstall:" ; \
-	        if test -n "$(DESTDIR)"; then \
-	          echo "  (check DESTDIR support)"; \
-	        fi ; \
-	        $(distuninstallcheck_listfiles) ; \
-	        exit 1; } >&2
-distcleancheck: distclean
-	@if test '$(srcdir)' = . ; then \
-	  echo "ERROR: distcleancheck can only run from a VPATH build" ; \
-	  exit 1 ; \
-	fi
-	@test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
-	  || { echo "ERROR: files left in build directory after distclean:" ; \
-	       $(distcleancheck_listfiles) ; \
-	       exit 1; } >&2
-check-am: all-am
-check: check-recursive
-all-am: Makefile
-installdirs: installdirs-recursive
-installdirs-am:
-install: install-recursive
-install-exec: install-exec-recursive
-install-data: install-data-recursive
-uninstall: uninstall-recursive
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-recursive
-install-strip:
-	if test -z '$(STRIP)'; then \
-	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	      install; \
-	else \
-	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
-	fi
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
-	@echo "This command is intended for maintainers to use"
-	@echo "it deletes files that may require special tools to rebuild."
-clean: clean-recursive
-
-clean-am: clean-generic clean-libtool mostlyclean-am
-
-distclean: distclean-recursive
-	-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-	-rm -f Makefile
-distclean-am: clean-am distclean-generic distclean-libtool \
-	distclean-tags
-
-dvi: dvi-recursive
-
-dvi-am:
-
-html: html-recursive
-
-html-am:
-
-info: info-recursive
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-recursive
-
-install-dvi-am:
-
-install-exec-am:
-
-install-html: install-html-recursive
-
-install-html-am:
-
-install-info: install-info-recursive
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-recursive
-
-install-pdf-am:
-
-install-ps: install-ps-recursive
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-recursive
-	-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-	-rm -rf $(top_srcdir)/autom4te.cache
-	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-recursive
-
-mostlyclean-am: mostlyclean-generic mostlyclean-libtool
-
-pdf: pdf-recursive
-
-pdf-am:
-
-ps: ps-recursive
-
-ps-am:
-
-uninstall-am:
-
-.MAKE: $(am__recursive_targets) install-am install-strip
-
-.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \
-	am--refresh check check-am clean clean-cscope clean-generic \
-	clean-libtool cscope cscopelist-am ctags ctags-am dist \
-	dist-all dist-bzip2 dist-gzip dist-lzip dist-shar dist-tarZ \
-	dist-xz dist-zip distcheck distclean distclean-generic \
-	distclean-libtool distclean-tags distcleancheck distdir \
-	distuninstallcheck dvi dvi-am html html-am info info-am \
-	install install-am install-data install-data-am install-dvi \
-	install-dvi-am install-exec install-exec-am install-html \
-	install-html-am install-info install-info-am install-man \
-	install-pdf install-pdf-am install-ps install-ps-am \
-	install-strip installcheck installcheck-am installdirs \
-	installdirs-am maintainer-clean maintainer-clean-generic \
-	mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
-	ps ps-am tags tags-am uninstall uninstall-am
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/NEWS b/NEWS
deleted file mode 100644
index 74037a4..0000000
--- a/NEWS
+++ /dev/null
@@ -1,13 +0,0 @@
--------------------------------------------------------------------------------
-MB-SYSTEM NEWS FILE:
--------------------------------------------------------------------------------
-Version: $Id: NEWS 2080 2013-05-23 22:33:37Z caress $
--------------------------------------------------------------------------------
-
-In the GNU package standard, the NEWS file lists the history of user-visible
-changes to a package. For the the MB-System open source software package for the
-processing and display of swath sonar data, this information is included in the
-ChangeLog file. Both the NEWS file and the ChangeLog file are located at the top
-of the MB-System source code distribution directory structure.
-
--------------------------------------------------------------------------------
diff --git a/NOTES b/NOTES
deleted file mode 100644
index 1b61408..0000000
--- a/NOTES
+++ /dev/null
@@ -1,295 +0,0 @@
--------------------------------------------------------------------------------
-MB-SYSTEM INSTALLATION NOTES FILE:
--------------------------------------------------------------------------------
-Version: $Id: NOTES 2159 2014-01-18 23:19:37Z caress $
--------------------------------------------------------------------------------
-
-This file contains installation notes for the MB-System open source software
-package for the processing and display of swath sonar data. This file is located
-at the top of the MB-System source code distribution directory structure.
-
--------------------------------------------------------------------------------
-THE MB-SYSTEM SOURCE CODE DISTRIBUTION:
--------------------------------------------------------------------------------
-MB-System is distributed as a compressed tar archive named according to the
-release version. For example, release 5.4.2081 was distributed in a file named:
-    mbsystem-5.4.2081.tar.gz
-Here the major release is 5, the minor release is 4, and the third number is the
-corresponding revision number for the source code archive (which is managed
-using the Subversion package).
-
-The source code archive can be accessed directly at:
-    http://svn.ilab.ldeo.columbia.edu
-
-The tar utility is used to extract the distribution:
-    % tar xvzf mbsystem-5.4.2081.tar.gz
-yielding a directory named "mbsystem-5.4.2081".
-
-Listing the contents of the top directory and then the src directory below
-reveals:
-    % cd mbsystem-5.4.2081
-    % ls -s
-	total 2920
-	  8 AUTHORS		  8 NEWS		 40 configure.in
-	 16 COPYING		 16 NOTES		 48 depcomp
-	224 ChangeLog		 56 README		 32 install-sh
-	 72 GPL			 88 config.guess	 64 install_makefiles
-	 32 INSTALL		 72 config.sub*		576 libtool*
-	 48 Makefile.in		944 configure		560 ltmain.sh
-	  8 Makefile.template	  8 configure.cmd*	  0 src/
-    % ls -s src
-	total 80
-	48 Makefile.in			 8 mbsystem_config.h
-	 8 Makefile.template		 8 mbsystem_config.h.in
-	 0 gmt/				 0 mbvelocitytool/
-	 0 gsf/				 0 mbview/
-	 0 html/			 0 mr1pr/
-	 0 macros/			 0 otps/
-	 0 man/				 0 proj/
-	 0 mbaux/			 0 ps/
-	 0 mbedit/			 0 share/
-	 0 mbio/			 8 stamp-h1
-	 0 mbnavadjust/			 0 surf/
-	 0 mbnavedit/			 0 utilities/
-The src/html, src/man, and src/ps directories contain documentation in web page,
-man page, and postscript formats respectively. The other directories under src
-contain either C source files that are compiled into programs or Perl script
-source files.
-
--------------------------------------------------------------------------------
-MB-SYSTEM BUILD SYSTEMS:
--------------------------------------------------------------------------------
-MB-System source distributions come with two build systems. Both create a
-set of recursive makefiles so that the make utility can be used to compile and
-install the package. The primary build system uses a configure script that has
-been created using the GNU autotools package. Users customize the makefiles for
-the local system by using arguments to configure. The older approach uses a
-perl script called install_makefiles that must first be edited to reflect the
-local system. The install_makefiles script is maintained for backward
-compatibility, but we expect most users to use the configure script.
-
--------------------------------------------------------------------------------
-BUILDING AND INSTALLING MB-SYSTEM WITH CONFIGURE
--------------------------------------------------------------------------------
-
-The basic steps for building MB-System using the configure script are:
-
-    1. Move to the top of the MB-System distribution directory:
-        % cd mbsystem-5.4.2081
-
-    2. Run the configure script to generate the Makefile files throughout the
-    distribution directory structure. The command line options for configure
-    are discussed below.
-        % [...pre-options...]./configure [...options...]
-
-    3. Run the make utility to build the software within the source distribution.
-        % make
-
-    4. Run the make utility with the install option to install the software
-    within the target location that was specified while running configure.
-        % make
-        % make install
-
-The configure script is intended to discern the enviroment, locate prerequisite
-packages, and construct the makefiles with a minimum of user intervention. In
-practice, users generally need to set at least some options when using the
-configure script in order to successfully build, install, and run MB-System.
-If NetCDF and GMT installations cannot be located, MB-System cannot be built. If
-FFTW3, Motif, or OpenGL cannot be found MB-System will be built, but without
-the applications that depend on these packages.
-
-Depending on how user permissions are set on your system and where the package
-is to be installed, it may be necessary to execute some or all of the above
-commands with superuser privileges. On older styles of Unix and Linux, this
-was typically accomplished by using the su command to become root, or
-superuser, a step that requires knowing the root password for the system.
-Following a successful invocation of su in a command shell, all commands have
-superuser privileges. On MacOsX and other "modern" flavors of Unix and Linux,
-it's more common to use the sudo command in front of other commands in order
-to execute them with superuser privileges. An administrator password is
-required for the first instance of sudo, but not for subsequent instances (at
-least for a period of time, typically five minutes). In this case, the commands
-become:
-
-	% sudo ./configure
-	% sudo make
-	% sudo make install
-
-The available configure options are:
-    --prefix=install      - location for mbsystem (/usr/local/mbsystem)"])
-    --with-netcdf-lib     - location of NetCDF libs"])
-    --with-netcdf-include - location of NetCDF headers"])
-    --with-proj-lib       - location of PROJ libs"])
-    --with-proj-include   - location of PROJ headers"])
-    --with-gmt-lib        - location of GMT libs"])
-    --with-gmt-include    - location of GMT headers"])
-    --with-fftw-lib       - location of FFTW3 libs (optional)"])
-    --with-fftw-include   - location of FFTW3 headers (optional)"])
-    --with-motif-lib      - location of Motif libs (optional)"])
-    --with-motif-include  - location of Motif headers (optional)"])
-    --with-opengl-lib     - location of OpenGL libs (optional)"])
-    --with-opengl-include - location of OpenGL headers (optional)"])
-    --with-otps-dir       - location of OTPS installation (optional)"])
-    --without-gsf         - build without including or supporting GSF"])
-    --enable-bundledproj  - build using bundled proj package - the
-				default is to link with libproj"])
-
-Users can also define custom compiler flags on the command line to be used by
-configure. For example, the command:
-        % CFLAGS="-g -W -DBYTESWAPPED" ./configure \
-          --prefix=/usr/local/mbsystem
-will override the system default CFLAGS with "-g, -W, and -DBYTESWAPPED", build
-the package in the distribution directory with shared libraries, and install
-the package in /usr/local/mbsystem. The destination directories will be:
-        /usr/local/mbsystem/bin                      executable binaries and scripts
-        /usr/local/mbsystem/lib                      libraries
-        /usr/local/mbsystem/include                  header files
-        /usr/local/mbsystem/share/mbsystem           projection and levitus data
-        /usr/local/mbsystem/share/doc/mbsystem/html  web page documentation
-        /usr/local/mbsystem/share/doc/mbsystem/ps    postscript documentation
-        /usr/local/mbsystem/man                      man page documentation
-
-If one is installing on a Mac in which some or all of the prerequisite packages
-have been installed with Fink or MacPorts, then the locations of those
-prerequisite packages must be explicitly defined. Fink installs packages in
-/sw, and MacPorts installs into /opt. An example for installing in a Fink-centric
-system is:
-	% CFLAGS="-g -I/opt/X11/include" \
-	    LDFLAGS="-L/opt/X11/lib" \
-	    ./configure \
-	    --prefix=/Users/caress/sandbox/mbsystem \
-	    --with-netcdf-include=/sw/include \
-	    --with-netcdf-lib=/sw/lib \
-	    --with-proj-include=/sw/include \
-	    --with-proj-lib=/sw/lib \
-	    --with-gmt-include=/sw/include \
-	    --with-gmt-lib=/sw/lib \
-	    --with-fftw-include=/sw/include \
-	    --with-fftw-lib=/sw/lib \
-	    --with-motif-include=/sw/include \
-	    --with-motif-lib=/sw/lib \
-	    --with-otps-dir=/usr/local/OTPS
-This is for MacOSX 10.9 (Mavericks), in which X11 must be obtained from X.org
-and is installed in /opt. Previous versions of MacOsX installed X11 in /usr/X11R6.
-The only non-Fink package specified is OTPS (which is not available through
-package managers) in /usr/local.
-
--------------------------------------------------------------------------------
-BUILDING AND INSTALLING MB-SYSTEM WITH INSTALL_MAKEFILES:
--------------------------------------------------------------------------------
-
-The original, and now alternate, method for generating the makefiles is to use
-a script named install_makefiles that is also present at the top of the
-MB-System distribution. In contrast to configure, which can be controlled by
-command line options, install_makefiles must be customized to the local
-environment by manual editing before this perl script is executed.
-In order to configure your installation. In particular, the user must explicitly
-set the library locations, header file locations, compile flags, and link flags.
-
-The important parameters to be set in install_makefiles are:
-
-     Required parameters:
-     $MBSYSTEM_HOME - absolute path to the MB-System installation location
-     $OS - Operating system (e.g. DARWIN, LINUX).
-     $CFLAGS - Compile flags for C source files.
-     $LFLAGS - Load flags for all object files.
-     $NETCDFLIBDIR - Location of NetCDF library.
-     $NETCDFINCDIR - Location of NetCDF header files.
-     $GMTLIBDIR - Location of GMT libraries.
-     $GMTINCDIR - Location of GMT header files.
-
-     Required parameters for spectrogram program mbsegypsd
-	- mbsegypsd will not be built if these are commented out
-     $FFTWLIBDIR - Location of the FFTW3 library.
-     $FFTWINCDIR - Location of FFTW3 header files.
-
-     Required parameters for graphical tools
-	- graphical tools will not be built if these
-	  are commented out
-     $MOTIFINCDIR - Location of the Motif header files.
-     $MOTIFLIBS - Location of the Motif libraries.
-
-     Required parameter for visualization tools
-	- visualization tools will not be built if this
-	  is commented out
-     $OPENGLLIBS - Link flags for the OpenGL libraries: "-lGLU -lGL";
-
-     Required parameter for mblevitus program
-     $LEVITUS - Location of the Levitus library (usually "$MBSYSTEM_HOME/share/LevitusAnnual82.dat").
-
-     Required parameter for mbotps program
-     $OTPSDIR - Location of the OTPSnc installation (usually "/usr/local/OTPSnc").
-
-     Optional name of C compiler (if other than "cc").
-     $CC - Usually "cc", but could be "gcc".
-
-     Optional parameters for use of independent GSF library installation
-	- GSF library included with MB-System will be used
-	  if these are commented out
-     $GSFLIB - Location of GSF library.
-     $GSFINCDIR - Location of GSF header files.
-
-     Optional parameters for use of independent PROJ4 library installation
-	- PROJ4 library included with MB-System will be used
-	  if these are commented out
-     $PROJLIB - Location of PROJ4 library.
-     $PROJINCDIR - Location of PROJ4 header files.
-
-An example of the parameters for installing a distribution in /usr/local on a
-current (MacOs X 10.8) Fink-centric Mac is:
-     $MBSYSTEM_HOME = "/usr/local/mbsystem-5.4.2081";
-     $OS = "DARWIN";
-     $CFLAGS = "-I/usr/X11R6/include ";
-     $LFLAGS = "-lm -L/sw/lib -lgdal";
-     $NETCDFLIBDIR = "/sw/lib";
-     $NETCDFINCDIR = "/sw/include";
-     $GMTLIBDIR = "/sw/lib";
-     $GMTINCDIR = "/usr/include";
-     $PROJECTIONS = "$MBSYSTEM_HOME/share/mbsystem/Projections.dat";
-     $FFTWLIBDIR = "/sw/lib";
-     $FFTWINCDIR = "/sw/include";
-     $MOTIFINCDIR = "/sw/include";
-     $MOTIFLIBS = "-L/sw/lib -L/usr/X11R6/lib -lXm -lXt -lX11";
-     $OPENGLLIBS = "-lGLU -lGL";
-     $LEVITUS = "$MBSYSTEM_HOME/share/mbsystem/LevitusAnnual82.dat";
-     $OTPSDIR = "/usr/local/OTPSnc";
-
-To execute install_makefiles, do the following:
-
-     % cd mbsystem-5.4.2081
-     % ./install_makefiles
-
-Because install_makefiles is a perl script, the executable perl must be
-available in the installer's path. Once install_makefiles has been correctly
-configured and run, give the command "make all" to generate the executable
-programs:
-
-     % make all
-
-The make command will descend recursively down through the directory structure,
-compiling source files, linking object files, and copying executables and manual
-pages to the appropriate directories.
-The destination directories will be:
-        /usr/local/mbsystem-5.4.2081/bin                      executable binaries and scripts
-        /usr/local/mbsystem-5.4.2081/lib                      libraries
-        /usr/local/mbsystem-5.4.2081/include                  header files
-        /usr/local/mbsystem-5.4.2081/share/mbsystem           projection and levitus data
-        /usr/local/mbsystem-5.4.2081/share/doc/mbsystem/html  web page documentation
-        /usr/local/mbsystem-5.4.2081/share/doc/mbsystem/ps    postscript documentation
-        /usr/local/mbsystem-5.4.2081/man                      man page documentation
-
--------------------------------------------------------------------------------
-SETTING THE USER ENVIRONMENT:
--------------------------------------------------------------------------------
-
-Naturally, in order for users to use the MB-System utilities, the directory
-containing the executables must be included in their path. The executable perl
-must also be available in the user's path for most of the macros to work. This
-is generally achieved by editing the environment files in a user's home
-directory. For csh users, the relevant files are .cshrc and .login; for sh or
-bash users, the relevant files are .bashrc and .bash_profile.
-
-Most users will also wish to specify which program they generally use to view
-Postscript plots on their screen. This parameter can be set with the mbdefaults
-program. The recommended Postscript viewer is a program called gv.
--------------------------------------------------------------------------------
diff --git a/README b/README
deleted file mode 100644
index 87c6080..0000000
--- a/README
+++ /dev/null
@@ -1,457 +0,0 @@
--------------------------------------------------------------------------------
-MB-SYSTEM README FILE:
--------------------------------------------------------------------------------
-Version: $Id: README 2114 2013-06-07 07:46:19Z caress $
--------------------------------------------------------------------------------
-
-This file contains general information regarding the MB-System open
-source software package for the processing and display of swath sonar data.
-This file is located at the top of the MB-System source code distribution
-directory structure.
-
-The copyright and licensing terms are contained in the file "COPYING".
-The GNU GPL version 3 license used for MB-System can be found in the file "GPL".
-The software authors are listed in the file "AUTHORS".
-A log of source code changes is in the file "CHANGELOG".
-Installation instructions are found in the file "NOTES".
-
--------------------------------------------------------------------------------
-MB-SYSTEM VERSION 5 DESCRIPTION:
--------------------------------------------------------------------------------
-
-MB-System is a software package consisting of programs which manipulate,
-process, list, or display swath sonar bathymetry, amplitude, and sidescan data.
-This software is distributed freely (and for free) in the form of source code
-for Unix platforms. The heart of the system is an input/output library called
-MBIO which allows programs to work transparently with any of a number of
-supported swath sonar data formats. This approach has allowed the creation
-of "generic" utilities which can be applied in a uniform manner to sonar data
-from a variety of sources. Most of the programs are command-line tools, but the
-package does include graphical tools for editing swath bathymetry, editing
-navigation, modeling bathymetry calculation, and adjusting survey navigation.
-
--------------------------------------------------------------------------------
-MB-SYSTEM PROGRAMS
--------------------------------------------------------------------------------
-hsdump(1)                - hsdump lists the information contained in Hydrosweep
-                            DS data files
-mb7k2jstar(1)            - extracts subbottom profiler and/or sidescan sonar
-                            data from Reson 7k format data files into Edgetech
-                            Jstar format data files
-mb7k2ss(1)               - extracts sidescan sonar data from Reson 7k format
-                            data, bins and lays the sidescan onto the seafloor,
-                            and outputs files in the MBF_MBLDEOIH formst
-                            (MBIO format id 71)
-mb7kpreprocess(1)        - performs preprocessing of Reson 7k multibeam data in
-                            the 7k format (MBIO format 88)
-mbabsorption(1)          - calculates the absorption of sound in sea water in
-                            dB/km as a function of frequency, temperature,
-                            salinity, sound speed, and depth
-mbareaclean(1)           - Tool to automatically flag bad beams in swath sonar
-                            bathymetry data within a specified area
-mbauvloglist(1)          - Lists table data from an MBARI AUV mission log file
-mbauvnavusbl(1)          - Adjusts inertial navigation of a submerged
-                            platform/vehicle to be consistent with more
-                            accurate but less precise surface tracking (USBL)
-                            navigation
-mbbackangle(1)           - Generates tables of the average amplitude or
-                            sidescan values in swath sonar data as a function
-                            of the grazing angle with the seafloor
-mbclean(1)               - Tool to automatically flag bad beams in swath sonar
-                            bathymetry data
-mbcontour(1)             - GMT compatible utility for color fill or color
-                            shaded relief swath plots of swath sonar data using
-                            Postscript
-mbcopy(1)                - Copy swath sonar bathymetry data files
-mbctdlist(1)             - List CTD data in swath sonar data files
-mbdatalist(1)            - parses recursive datalist files and outputs the
-                            complete list of data files, formats, and file
-                            weights
-mbdefaults(1)            - Set or list default mbio parameters for reading and
-                            writing swath sonar data
-mbedit(1)                - Interactive editor used to flag bad bathymetry
-                            values in swath sonar bathymetry data
-mbeditviz(1)             - 3D visualization-based editing of swath bathymetry
-                            soundings
-mbextractsegy(1)         - extracts subbottom profiler, center beam reflection,
-                            or seismic reflection data from swath data
-                            supported by MB-System and rewrites it as a SEGY
-                            file
-mbfilter(1)              - Apply some simple filter functions to sidescan or
-                            beam amplitude data from swath sonar data files
-mbformat(1)              - List information about swath sonar data formats
-                            supported by the MBIO library
-mbgetesf(1)              - Extract swath bathymetry data flags into an edit
-                            save file
-mbgrdtiff(1)             - generates a geographically located TIFF image from a
-                            GMT grid file
-mbgrdviz(1)              - Simple interactive 2D/3D visualization of GMT grids
-mbgrid(1)                - Grid bathymetry, amplitude, or sidescan data from
-                            swath sonar data files
-mbhistogram(1)           - Generate a histogram of bathymetry, amplitude, or
-                            sidescan values from swath sonar data files
-mbinfo(1)                - Output some basic statistics of swath sonar data
-                            files
-mbio(3)                  - Format independent input/output library for swath
-                            mapping sonar data
-mblevitus(1)             - Create a water velocity profile which is
-                            representative of the mean annual water column for
-                            a specified 1 degree by 1 degree region
-mblist(1)                - List data in swath data files
-mbm_arc2grd(1)           - Macro to convert an ArcView ASCII grid to a GMT grid
-                            file in the GMT NetCDF grid format
-mbm_copy(1)              - Apply mbcopy to all files referenced through a
-                            datalist, using the MB-System file suffix convention
-                            to name the output files
-mbm_dslnavfix(1)         - Translate WHOI DSL AMS-120 navigation from UTM
-                            eastings and northings to longitude and latitude
-mbm_fmtvel(1)            - Extract sound velocity info from Hydrosweep data
-                            files and create output in tabular format
-mbm_grd2arc(1)           - Macro to convert a GMT grid file in the GMT NetCDF
-                            grid format to an ArcView ASCII grid
-mbm_grd2geovrml(1)       - Create and execute commands which generate a
-                            TerraVision tileset and GeoVRML terrain set that
-                            can be combined with other geospatial data for
-                            viewing in a web browser
-mbm_grd3dplot(1)         - Create an executable shellscript which will generate
-                            a GMT 3D perspective plot of gridded data in a GMT
-                            grd file
-mbm_grdcut(1)            - Macro to extract a specified subarea of a GMT GRD
-                            grid file as another GRD file
-mbm_grdinfo(1)           - Macro to get information regarding a GMT grd file
-                            when the region of interest is a subset of the area
-                            covered in the input file
-mbm_grdplot(1)           - Create an executable shellscript which will generate
-                            a GMT map of gridded data in a GMT grd file
-mbm_grdtiff(1)           - Create an executable shellscript which will generate
-                            a TIFF image of gridded data in a GMT grd file
-mbm_grid(1)              - Create an executable shellscript which will generate
-                            a grid (bathymetry or topography) or mosaic
-                            (amplitude or sidescan) of swath sonar swath data
-mbm_histplot(1)          - Create an executable shellscript which will generate
-                            a GMT histogram plot of a dataset
-mbm_makedatalist(1)      - Macro to generate a datalist of the swath files in a
-                            specified directory
-mbm_plot(1)              - Create an executable shellscript which will generate
-                            a GMT plot of swath sonar swath data
-mbm_route2mission(1)     - Macro to convert an mbgrdviz route file into an MBARI
-                            AUV mission script
-mbm_stat(1)              - Extract beam statistics from output generated by
-                            mbinfo
-mbm_utm(1)               - Macro to perform forward and inverse UTM projections
-                            of ASCII data triples
-mbm_vrefcheck(1)         - Macro to generate plot of crosstrack seafloor slope
-                            from a swath sonar file.  The noise in this time
-                            series largely reflects noise in the vertical
-                            reference used by the sonar
-mbm_xbt(1)               - Calculate sound speed from XBT data
-mbm_xyplot(1)            - Create an executable shellscript which will generate
-                            a GMT plot of xy data
-mbmask(1), mbdumpesf(1)  - Output text version of beam edits from a binary edit
-                            save file
-mbmosaic(1)              - Mosaic amplitude or sidescan data from swath mapping
-                            sonar data files
-mbnavadjust(1)           - Package that solves for optimal navigation by
-                            matching bathymetry of overlapping swaths
-mbnavedit(1)             - Interactive navigation editor for swath sonar data
-mbnavlist(1)             - List navigation data in swath sonar data files
-mbneptune2esf(1)         - Tool to import beam flags from Simrad's Neptune
-                            system
-mbotps(1)                - Predicts tides using the OSU Tidal Prediction
-                            Software (OTPS) distribution
-mbprocess(1)             - this program performs a variety of swath data
-                            processing functions in a single step (producing a
-                            single output swath data file), including merging
-                            navigation, recalculating bathymetry from travel
-                            time and angle data by raytracing through a layered
-                            water sound velocity model, applying changes to
-                            ship draft, roll bias and pitch bias, applying
-                            tides, and applying bathymetry edits from edit save
-                            files
-mbps(1)                  - Generates a PostScript perspective plot of a piece of
-                            swath sonar data
-mbrollbias(1)            - Assess roll bias of swath sonar sonar systems
-mbrolltimelag(1)         - Calculates cross correlation between the apparent
-                            bottom slope in swath bathymetry data and the roll
-                            time series used by the sonar in order to assess
-                            attitude time lag problems
-mbsegygrid(1)            - Generate time vs. trace number grids of seismic data
-                            from segy files
-mbsegyinfo(1)            - Output some basic statistics of segy format seismic
-                            data files
-mbsegylist(1)            - List selected header values in segy format seismic
-                            data files
-mbsegypsd(1)             - Calculates the power spectral densisty function
-                            (PSD) of each trace in a segy file, outputting the
-                            PSD estimates as a GMT grid file with trace number
-                            along the x axis and frequency along the y axis
-mbset(1)                 - Sets values in mbprocess parameter files
-mbstripNaN(1)            - filter to remove NaN nodes
-mbsvplist(1)             - List water sound velocity profiles in swath sonar
-                            data files
-mbswath(1)               - GMT compatible utility for color fill or color shaded
-                            relief swath plots of swath sonar data using
-                            Postscript
-mbsystem(1)              - A set of utilities for manipulating and processing
-                            swath sonar bathymetry, amplitude, and sidescan data
-mbtime(1)                - Translate between calendar time values and unix time
-mbvelocitytool(1)        - Interactive water sound velocity profile editor
-
--------------------------------------------------------------------------------
-THE VERSION 5 DATA PROCESSING STRUCTURE
--------------------------------------------------------------------------------
-
-MB-System version 5 features utilities implementing a parallel processing
-scheme that simplifies the processing of most swath data. This scheme is
-centered around the program mbprocess, which can accomplish the following
-processing tasks in a single step:
-   - Merge edited navigation generated by mbnavedit.
-   - Apply bathymetry edit flags from mbedit
-     and mbclean
-   - Recalculate bathymetry from raw travel time and
-     angle data by raytracing through water sound speed
-     models from mbvelocitytool or mbsvplist.
-   - Apply changes to roll bias, pitch bias, heading
-     bias, and draft values.
-   - Recalculate sidescan from raw backscatter samples
-     (Simrad multibeam data only).
-   - Correct sidescan for amplitude vs grazing angle
-     patterns.
-   - Apply tides to bathymetry.
-The actions of mbprocess are controlled by text parameter files. Each mbprocess
-parameter file is named by adding a ".par" suffix to the associated input swath
-data file and contains single line commands that set processing modes and
-parameters. Tools such as mbedit, mbnavedit, and mbclean all generate and/or
-modify parameter files in addition to generating parallel files used by
-mbprocess. The program mbset can also be used to create and modify mbprocess
-parameter files.
-
-One example of a possible data processing scheme is presented here:
-
-   1) Run mbdatalist to create ancillary
-      data files containing statistics
-      (".inf"), quickly read bathymetry
-      (".fbt"), and quickly read navigation
-      (".fnv"). These files are used to
-      speed common operations such as swath
-      plotting and gridding.
-	  Input:  mbari_1998_524.mb57
-	  Output: mbari_1998_524.mb57.inf
-		  mbari_1998_524.mb57.fbt
-		  mbari_1998_524.mb57.fnv
-
-   2) Run mbclean to identify
-      the obvious bathymetric artifacts
-      and output a list of the edit events.
-      The parameter file is created and
-      set to apply bathymetry flags from
-      the ".esf" file.
-	  Input:  mbari_1998_524.mb57
-	  Output: mbari_1998_524.mb57.esf
-		  mbari_1998_524.mb57.par
-
-   3) Run mbedit to interactively
-      identify bathymetric artifacts
-      and output a list of the edit events.
-      The existing edits from mbclean
-      are loaded and applied prior to editing.
-      The parameter file is updated and
-      set to apply bathymetry flags from
-      the ".esf" file.
-	  Input:  mbari_1998_524.mb57
-		  mbari_1998_524.mb57.esf
-		  mbari_1998_524.mb57.par
-	  Output: mbari_1998_524.mb57.esf
-		  mbari_1998_524.mb57.par
-
-   4) Run mbnavedit to interactively
-      clean the navigation. The edited
-      navigation is output to the ".nve" file.
-      The parameter file is updated and
-      set to merge the navigation from
-      the ".nve" file.
-	  Input:  mbari_1998_524.mb57
-		  mbari_1998_524.mb57.par
-	  Output: mbari_1998_524.mb57.nve
-		  mbari_1998_524.mb57.par
-
-   5) Run mbvelocitytool to generate an
-      an appropriate sound velocity profile
-      (SVP) for recalculating the bathymetry.
-      The SVP is output to the ".svp" file.
-      The parameter file is updated and
-      set to recalculate the bathymetry by
-      raytracing through the SVP model from
-      the ".svp" file.
-	  Input:  mbari_1998_524.mb57
-		  mbari_1998_524.mb57.par
-	  Output: mbari_1998_524.mb57.svp
-		  mbari_1998_524.mb57.par
-
-   6) Run mbbackangle to generate an
-      a set of amplitude vs grazing angle
-      tables at regular intervals in the
-      data. These tables are placed into
-      a single ".sga" file. The parameter
-      file is updated and set to correct
-      the sidescan by interpolating the
-      amplitude vs grazing angle table for
-      each ping.
-	  Input:  mbari_1998_524.mb57
-		  mbari_1998_524.mb57.par
-	  Output: mbari_1998_524.mb57.sga
-		  mbari_1998_524.mb57.par
-
-   7) Run mbset to set the parameter file
-      so that mbprocess will recalculate
-      the sidescan (this is for Simrad
-      multibeam data only) while ignoring
-      sidescan samples from beams now flagged
-      as bad.
-	  Input:  mbari_1998_524.mb57.par
-	  Output: mbari_1998_524.mb57.par
-
-   8) Run mbprocess to apply the bathymetric
-      edits, merge the cleaned navigation,
-      recalculate the bathymetry, recalculate
-      the sidescan, and correct the sidescan.
-      The processed swath data is written to
-      an output swath data file. The usual
-      ancillary data files containing statistics,
-      quickly read bathymetry, and quickly
-      read navigation are also created.
-	  Input:  mbari_1998_524.mb57
-		  mbari_1998_524.mb57.esf
-		  mbari_1998_524.mb57.nve
-		  mbari_1998_524.mb57.svp
-		  mbari_1998_524.mb57.aga
-		  mbari_1998_524.mb57.par
-	  Output: mbari_1998_524p.mb57
-	          mbari_1998_524p.mb57.inf
-	          mbari_1998_524p.mb57.fbt
-	          mbari_1998_524p.mb57.fnv
-
-The result of this processing is a single output swath data file. Moreover, the
-processed output can be easily updated if, for example, additional bathymetry
-editing is required. If the mbedit program is used again, it will load the
-existing edit events from the ".esf" file and then update the ".esf" file. To
-incorporate the updated bathymetry edits, one just runs mbprocess again. One
-can similarly change the SVP file without impacting on the bathymetry
-editing or navigation editing components of the processing.
-
--------------------------------------------------------------------------------
-OTHER REQUIRED AND SUGGESTED SOFTWARE AND DATA
--------------------------------------------------------------------------------
-
-MB-System requires a number of other software packages and databases to be
-fully functional. These are:
-
-- GMT version 4.5 or later: MB-System makes use of the Generic Mapping Tools
-  (GMT) libraries and programs for much of its graphics. GMT also includes a
-  detailed global coastline database. GMT has been developed by Professor Paul
-  Wessel of SOEST (School of Ocean and Earth Science and Technology at the
-  Univeristy of Hawaii) and Dr. Walter H. F. Smith of NOAA. The GMT source code
-  is available from the GMT web page.
-- NetCDF version 3.5.1 or later: Both GMT and MB-System require the NCAR netCDF
-  library.
-- Perl version 5.0 or later: Perl is a fast, well documented scripting language
-  used widely in the Linux/Unix world. MB-System contains a number of perl
-  scripts used both for installation and to ease common tasks. Most of the
-  current Unix operating systems include perl. If you need to obtain the perl
-  source code, first check with your local system administrator - you will
-  probably find perl already available locally. The perl source code can be
-  obtained from the GNU software archives of the Free Software Foundation.
-- Perl Parallel-Forkmanager module: this Perl module is required for the
-  parallel processing macros mbm_multicopy, mbm_multidatalist, and
-  mbm_multiprocess to work. An easily installed package is available from from
-  www.cpan.org.
-- X11: The interactive graphical utilities in MB-System (MBedit, MBnavedit,
-  MBvelocitytool, MBgrdviz, MBeditviz) use and require the X11 windowing system.
-- Motif: The interactive graphical utilities in MB-System (MBedit, MBnavedit,
-  MBvelocitytool, MBgrdviz, MBeditviz) use version 2 of the Motif widget set,
-  and Motif libraries are required for these utilities to be built and to run.
-  Most current Unix/Linux operating systems include the required Motif
-  libraries, either in the original proprietary form (Motif), or the
-  not-quite-open-source form (OpenMotif). If you do not have these libraries,
-  the OpenMotif 2 source is available through Motifzone. An old alternative
-  open source Motif-compatible distribution called LessTif does not work with
-  the new OpenGL based MB-System programs (MBgrdviz, MBeditviz) and should be
-  avoided.
-- FFTW: The "Fastest Fourier Transform in the West" package is used by the
-  sonagram calculation program MBbsegypsd to calculate, well, Fast Fourier
-  Transforms. FFTW is commonly used and thus available on or for most current
-  Unix operating systems.
-- OTPSnc: The Oregon State Ocean Tide Prediction Software package is required
-  for the tidal modeling program MBotps (which in fact is just a convenient
-  front end for the old-style-batch interface of OTPS). The OTPSnc package can
-  be obtained from the tidal modeling group at Oregon State University.
-
-MB-System produces Postscript based graphics. Most current Unix operating
-systems provide a program which serves as a screen-based Postscript viewer. If
-you do not have a Postscript viewer, one option is to obtain one of several
-Ghostscript-based packages from the Free Software Foundation.
-
-- ghostview: Open source screen Postscript viewer. The source code can be
-  obtained from the GNU software archives of the Free Software Foundation.
-- gv: Open source screen Postscript viewer. This package is a bit more
-  sophisticated than ghostview and can handle poster-sized plots. The source
-  code can be obtained from the GNU software archives of the Free Software
-  Foundation.
-
-Users of MacOs X should note that many of the above packages can be painlessly
-installed using the fink package available from the Fink Project.
-
--------------------------------------------------------------------------------
-DOCUMENTATION:
--------------------------------------------------------------------------------
-
-The html documentation consists of a number of html documents and images in the
-directory mbsystem/share/doc/mbsystem/html. This documentation also comprises
-the MB-System web site available from the Lamont web site at:
-	http://www.ldeo.columbia.edu
-and the MBARI web site at:
-	http://www.mbari.org
-Users can access the documentation in their own MB-System installation by using
-a web browser and accessing the file:
-	file:/usr/local/mbsystem/share/doc/mbsystem/html/index.html
-(here it is assumed that MB-System has been installed in /usr/local). The
-documentation includes some general information about MB-System (e.g. who
-wrote, how to get it, how to install it) and a complete set of manual
-pages.
-
--------------------------------------------------------------------------------
-MB-SYSTEM DISCUSSION LIST
--------------------------------------------------------------------------------
-
-We maintain an MB-System discussion email list to facillitate communication
-among MB-System developers and users. We encourage users with questions and/or
-problems to use this list rather than emailing the developers directly. One
-must subscribe to the list in order to post messages, but the message archive is
-publically viewable and searchable over a web interface. The maximum message
-size in this list is 100K.
-
-The web interface to the list is at:
-        http://listserver.mbari.org/sympa/info/mbsystem
-
-To subscribe to the list go to:
-        http://listserver.mbari.org/sympa/subscribe/mbsystem
-
-To read the archives go to:
-        http://listserver.mbari.org/sympa/arc/mbsystem
-
--------------------------------------------------------------------------------
-SUGGESTIONS:
--------------------------------------------------------------------------------
-
-We are interested in your suggestions. Please post in the discussion list
-rather than emailing the authors directly.
-
--------------------------------------------------------------------------------
-BUGS:
--------------------------------------------------------------------------------
-
-There are undoubtably bugs in this software. Although we make no promises about
-how rapidly problems will be fixed, we strongly encourage users to notify us of
-bugs (and fixes!!). We will continue to support this software for the forseeable
-future.
--------------------------------------------------------------------------------
diff --git a/README.status b/README.status
new file mode 100644
index 0000000..951dce0
--- /dev/null
+++ b/README.status
@@ -0,0 +1,7 @@
+Since the packaging just had started in Debian GIS I merged the
+work from the Debian life packaging workshop at DebConf 15 to
+
+   Vcs-Browser: http://anonscm.debian.org/cgit/pkg-grass/mbsystem.git
+   Vcs-Git: git://anonscm.debian.org/pkg-grass/mbsystem.git
+
+Please keep on working there.
diff --git a/ar-lib b/ar-lib
deleted file mode 100755
index fe2301e..0000000
--- a/ar-lib
+++ /dev/null
@@ -1,270 +0,0 @@
-#! /bin/sh
-# Wrapper for Microsoft lib.exe
-
-me=ar-lib
-scriptversion=2012-03-01.08; # UTC
-
-# Copyright (C) 2010-2013 Free Software Foundation, Inc.
-# Written by Peter Rosin <peda at lysator.liu.se>.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-# This file is maintained in Automake, please report
-# bugs to <bug-automake at gnu.org> or send patches to
-# <automake-patches at gnu.org>.
-
-
-# func_error message
-func_error ()
-{
-  echo "$me: $1" 1>&2
-  exit 1
-}
-
-file_conv=
-
-# func_file_conv build_file
-# Convert a $build file to $host form and store it in $file
-# Currently only supports Windows hosts.
-func_file_conv ()
-{
-  file=$1
-  case $file in
-    / | /[!/]*) # absolute file, and not a UNC file
-      if test -z "$file_conv"; then
-	# lazily determine how to convert abs files
-	case `uname -s` in
-	  MINGW*)
-	    file_conv=mingw
-	    ;;
-	  CYGWIN*)
-	    file_conv=cygwin
-	    ;;
-	  *)
-	    file_conv=wine
-	    ;;
-	esac
-      fi
-      case $file_conv in
-	mingw)
-	  file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
-	  ;;
-	cygwin)
-	  file=`cygpath -m "$file" || echo "$file"`
-	  ;;
-	wine)
-	  file=`winepath -w "$file" || echo "$file"`
-	  ;;
-      esac
-      ;;
-  esac
-}
-
-# func_at_file at_file operation archive
-# Iterate over all members in AT_FILE performing OPERATION on ARCHIVE
-# for each of them.
-# When interpreting the content of the @FILE, do NOT use func_file_conv,
-# since the user would need to supply preconverted file names to
-# binutils ar, at least for MinGW.
-func_at_file ()
-{
-  operation=$2
-  archive=$3
-  at_file_contents=`cat "$1"`
-  eval set x "$at_file_contents"
-  shift
-
-  for member
-  do
-    $AR -NOLOGO $operation:"$member" "$archive" || exit $?
-  done
-}
-
-case $1 in
-  '')
-     func_error "no command.  Try '$0 --help' for more information."
-     ;;
-  -h | --h*)
-    cat <<EOF
-Usage: $me [--help] [--version] PROGRAM ACTION ARCHIVE [MEMBER...]
-
-Members may be specified in a file named with @FILE.
-EOF
-    exit $?
-    ;;
-  -v | --v*)
-    echo "$me, version $scriptversion"
-    exit $?
-    ;;
-esac
-
-if test $# -lt 3; then
-  func_error "you must specify a program, an action and an archive"
-fi
-
-AR=$1
-shift
-while :
-do
-  if test $# -lt 2; then
-    func_error "you must specify a program, an action and an archive"
-  fi
-  case $1 in
-    -lib | -LIB \
-    | -ltcg | -LTCG \
-    | -machine* | -MACHINE* \
-    | -subsystem* | -SUBSYSTEM* \
-    | -verbose | -VERBOSE \
-    | -wx* | -WX* )
-      AR="$AR $1"
-      shift
-      ;;
-    *)
-      action=$1
-      shift
-      break
-      ;;
-  esac
-done
-orig_archive=$1
-shift
-func_file_conv "$orig_archive"
-archive=$file
-
-# strip leading dash in $action
-action=${action#-}
-
-delete=
-extract=
-list=
-quick=
-replace=
-index=
-create=
-
-while test -n "$action"
-do
-  case $action in
-    d*) delete=yes  ;;
-    x*) extract=yes ;;
-    t*) list=yes    ;;
-    q*) quick=yes   ;;
-    r*) replace=yes ;;
-    s*) index=yes   ;;
-    S*)             ;; # the index is always updated implicitly
-    c*) create=yes  ;;
-    u*)             ;; # TODO: don't ignore the update modifier
-    v*)             ;; # TODO: don't ignore the verbose modifier
-    *)
-      func_error "unknown action specified"
-      ;;
-  esac
-  action=${action#?}
-done
-
-case $delete$extract$list$quick$replace,$index in
-  yes,* | ,yes)
-    ;;
-  yesyes*)
-    func_error "more than one action specified"
-    ;;
-  *)
-    func_error "no action specified"
-    ;;
-esac
-
-if test -n "$delete"; then
-  if test ! -f "$orig_archive"; then
-    func_error "archive not found"
-  fi
-  for member
-  do
-    case $1 in
-      @*)
-        func_at_file "${1#@}" -REMOVE "$archive"
-        ;;
-      *)
-        func_file_conv "$1"
-        $AR -NOLOGO -REMOVE:"$file" "$archive" || exit $?
-        ;;
-    esac
-  done
-
-elif test -n "$extract"; then
-  if test ! -f "$orig_archive"; then
-    func_error "archive not found"
-  fi
-  if test $# -gt 0; then
-    for member
-    do
-      case $1 in
-        @*)
-          func_at_file "${1#@}" -EXTRACT "$archive"
-          ;;
-        *)
-          func_file_conv "$1"
-          $AR -NOLOGO -EXTRACT:"$file" "$archive" || exit $?
-          ;;
-      esac
-    done
-  else
-    $AR -NOLOGO -LIST "$archive" | sed -e 's/\\/\\\\/g' | while read member
-    do
-      $AR -NOLOGO -EXTRACT:"$member" "$archive" || exit $?
-    done
-  fi
-
-elif test -n "$quick$replace"; then
-  if test ! -f "$orig_archive"; then
-    if test -z "$create"; then
-      echo "$me: creating $orig_archive"
-    fi
-    orig_archive=
-  else
-    orig_archive=$archive
-  fi
-
-  for member
-  do
-    case $1 in
-    @*)
-      func_file_conv "${1#@}"
-      set x "$@" "@$file"
-      ;;
-    *)
-      func_file_conv "$1"
-      set x "$@" "$file"
-      ;;
-    esac
-    shift
-    shift
-  done
-
-  if test -n "$orig_archive"; then
-    $AR -NOLOGO -OUT:"$archive" "$orig_archive" "$@" || exit $?
-  else
-    $AR -NOLOGO -OUT:"$archive" "$@" || exit $?
-  fi
-
-elif test -n "$list"; then
-  if test ! -f "$orig_archive"; then
-    func_error "archive not found"
-  fi
-  $AR -NOLOGO -LIST "$archive" || exit $?
-fi
diff --git a/config.guess b/config.guess
deleted file mode 100755
index 9afd676..0000000
--- a/config.guess
+++ /dev/null
@@ -1,1568 +0,0 @@
-#! /bin/sh
-# Attempt to guess a canonical system name.
-#   Copyright 1992-2013 Free Software Foundation, Inc.
-
-timestamp='2013-11-29'
-
-# This file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, see <http://www.gnu.org/licenses/>.
-#
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that
-# program.  This Exception is an additional permission under section 7
-# of the GNU General Public License, version 3 ("GPLv3").
-#
-# Originally written by Per Bothner.
-#
-# You can get the latest version of this script from:
-# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
-#
-# Please send patches with a ChangeLog entry to config-patches at gnu.org.
-
-
-me=`echo "$0" | sed -e 's,.*/,,'`
-
-usage="\
-Usage: $0 [OPTION]
-
-Output the configuration name of the system \`$me' is run on.
-
-Operation modes:
-  -h, --help         print this help, then exit
-  -t, --time-stamp   print date of last modification, then exit
-  -v, --version      print version number, then exit
-
-Report bugs and patches to <config-patches at gnu.org>."
-
-version="\
-GNU config.guess ($timestamp)
-
-Originally written by Per Bothner.
-Copyright 1992-2013 Free Software Foundation, Inc.
-
-This is free software; see the source for copying conditions.  There is NO
-warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
-
-help="
-Try \`$me --help' for more information."
-
-# Parse command line
-while test $# -gt 0 ; do
-  case $1 in
-    --time-stamp | --time* | -t )
-       echo "$timestamp" ; exit ;;
-    --version | -v )
-       echo "$version" ; exit ;;
-    --help | --h* | -h )
-       echo "$usage"; exit ;;
-    -- )     # Stop option processing
-       shift; break ;;
-    - )	# Use stdin as input.
-       break ;;
-    -* )
-       echo "$me: invalid option $1$help" >&2
-       exit 1 ;;
-    * )
-       break ;;
-  esac
-done
-
-if test $# != 0; then
-  echo "$me: too many arguments$help" >&2
-  exit 1
-fi
-
-trap 'exit 1' 1 2 15
-
-# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
-# compiler to aid in system detection is discouraged as it requires
-# temporary files to be created and, as you can see below, it is a
-# headache to deal with in a portable fashion.
-
-# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
-# use `HOST_CC' if defined, but it is deprecated.
-
-# Portable tmp directory creation inspired by the Autoconf team.
-
-set_cc_for_build='
-trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
-trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
-: ${TMPDIR=/tmp} ;
- { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
- { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
- { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
- { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
-dummy=$tmp/dummy ;
-tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
-case $CC_FOR_BUILD,$HOST_CC,$CC in
- ,,)    echo "int x;" > $dummy.c ;
-	for c in cc gcc c89 c99 ; do
-	  if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
-	     CC_FOR_BUILD="$c"; break ;
-	  fi ;
-	done ;
-	if test x"$CC_FOR_BUILD" = x ; then
-	  CC_FOR_BUILD=no_compiler_found ;
-	fi
-	;;
- ,,*)   CC_FOR_BUILD=$CC ;;
- ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
-esac ; set_cc_for_build= ;'
-
-# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
-# (ghazi at noc.rutgers.edu 1994-08-24)
-if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
-	PATH=$PATH:/.attbin ; export PATH
-fi
-
-UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
-UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
-UNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
-UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
-
-case "${UNAME_SYSTEM}" in
-Linux|GNU|GNU/*)
-	# If the system lacks a compiler, then just pick glibc.
-	# We could probably try harder.
-	LIBC=gnu
-
-	eval $set_cc_for_build
-	cat <<-EOF > $dummy.c
-	#include <features.h>
-	#if defined(__UCLIBC__)
-	LIBC=uclibc
-	#elif defined(__dietlibc__)
-	LIBC=dietlibc
-	#else
-	LIBC=gnu
-	#endif
-	EOF
-	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
-	;;
-esac
-
-# Note: order is significant - the case branches are not exclusive.
-
-case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
-    *:NetBSD:*:*)
-	# NetBSD (nbsd) targets should (where applicable) match one or
-	# more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
-	# *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
-	# switched to ELF, *-*-netbsd* would select the old
-	# object file format.  This provides both forward
-	# compatibility and a consistent mechanism for selecting the
-	# object file format.
-	#
-	# Note: NetBSD doesn't particularly care about the vendor
-	# portion of the name.  We always set it to "unknown".
-	sysctl="sysctl -n hw.machine_arch"
-	UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
-	    /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
-	case "${UNAME_MACHINE_ARCH}" in
-	    armeb) machine=armeb-unknown ;;
-	    arm*) machine=arm-unknown ;;
-	    sh3el) machine=shl-unknown ;;
-	    sh3eb) machine=sh-unknown ;;
-	    sh5el) machine=sh5le-unknown ;;
-	    *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
-	esac
-	# The Operating System including object format, if it has switched
-	# to ELF recently, or will in the future.
-	case "${UNAME_MACHINE_ARCH}" in
-	    arm*|i386|m68k|ns32k|sh3*|sparc|vax)
-		eval $set_cc_for_build
-		if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
-			| grep -q __ELF__
-		then
-		    # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
-		    # Return netbsd for either.  FIX?
-		    os=netbsd
-		else
-		    os=netbsdelf
-		fi
-		;;
-	    *)
-		os=netbsd
-		;;
-	esac
-	# The OS release
-	# Debian GNU/NetBSD machines have a different userland, and
-	# thus, need a distinct triplet. However, they do not need
-	# kernel version information, so it can be replaced with a
-	# suitable tag, in the style of linux-gnu.
-	case "${UNAME_VERSION}" in
-	    Debian*)
-		release='-gnu'
-		;;
-	    *)
-		release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
-		;;
-	esac
-	# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
-	# contains redundant information, the shorter form:
-	# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
-	echo "${machine}-${os}${release}"
-	exit ;;
-    *:Bitrig:*:*)
-	UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
-	echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE}
-	exit ;;
-    *:OpenBSD:*:*)
-	UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
-	echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
-	exit ;;
-    *:ekkoBSD:*:*)
-	echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
-	exit ;;
-    *:SolidBSD:*:*)
-	echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
-	exit ;;
-    macppc:MirBSD:*:*)
-	echo powerpc-unknown-mirbsd${UNAME_RELEASE}
-	exit ;;
-    *:MirBSD:*:*)
-	echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
-	exit ;;
-    alpha:OSF1:*:*)
-	case $UNAME_RELEASE in
-	*4.0)
-		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
-		;;
-	*5.*)
-		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
-		;;
-	esac
-	# According to Compaq, /usr/sbin/psrinfo has been available on
-	# OSF/1 and Tru64 systems produced since 1995.  I hope that
-	# covers most systems running today.  This code pipes the CPU
-	# types through head -n 1, so we only detect the type of CPU 0.
-	ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^  The alpha \(.*\) processor.*$/\1/p' | head -n 1`
-	case "$ALPHA_CPU_TYPE" in
-	    "EV4 (21064)")
-		UNAME_MACHINE="alpha" ;;
-	    "EV4.5 (21064)")
-		UNAME_MACHINE="alpha" ;;
-	    "LCA4 (21066/21068)")
-		UNAME_MACHINE="alpha" ;;
-	    "EV5 (21164)")
-		UNAME_MACHINE="alphaev5" ;;
-	    "EV5.6 (21164A)")
-		UNAME_MACHINE="alphaev56" ;;
-	    "EV5.6 (21164PC)")
-		UNAME_MACHINE="alphapca56" ;;
-	    "EV5.7 (21164PC)")
-		UNAME_MACHINE="alphapca57" ;;
-	    "EV6 (21264)")
-		UNAME_MACHINE="alphaev6" ;;
-	    "EV6.7 (21264A)")
-		UNAME_MACHINE="alphaev67" ;;
-	    "EV6.8CB (21264C)")
-		UNAME_MACHINE="alphaev68" ;;
-	    "EV6.8AL (21264B)")
-		UNAME_MACHINE="alphaev68" ;;
-	    "EV6.8CX (21264D)")
-		UNAME_MACHINE="alphaev68" ;;
-	    "EV6.9A (21264/EV69A)")
-		UNAME_MACHINE="alphaev69" ;;
-	    "EV7 (21364)")
-		UNAME_MACHINE="alphaev7" ;;
-	    "EV7.9 (21364A)")
-		UNAME_MACHINE="alphaev79" ;;
-	esac
-	# A Pn.n version is a patched version.
-	# A Vn.n version is a released version.
-	# A Tn.n version is a released field test version.
-	# A Xn.n version is an unreleased experimental baselevel.
-	# 1.2 uses "1.2" for uname -r.
-	echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
-	# Reset EXIT trap before exiting to avoid spurious non-zero exit code.
-	exitcode=$?
-	trap '' 0
-	exit $exitcode ;;
-    Alpha\ *:Windows_NT*:*)
-	# How do we know it's Interix rather than the generic POSIX subsystem?
-	# Should we change UNAME_MACHINE based on the output of uname instead
-	# of the specific Alpha model?
-	echo alpha-pc-interix
-	exit ;;
-    21064:Windows_NT:50:3)
-	echo alpha-dec-winnt3.5
-	exit ;;
-    Amiga*:UNIX_System_V:4.0:*)
-	echo m68k-unknown-sysv4
-	exit ;;
-    *:[Aa]miga[Oo][Ss]:*:*)
-	echo ${UNAME_MACHINE}-unknown-amigaos
-	exit ;;
-    *:[Mm]orph[Oo][Ss]:*:*)
-	echo ${UNAME_MACHINE}-unknown-morphos
-	exit ;;
-    *:OS/390:*:*)
-	echo i370-ibm-openedition
-	exit ;;
-    *:z/VM:*:*)
-	echo s390-ibm-zvmoe
-	exit ;;
-    *:OS400:*:*)
-	echo powerpc-ibm-os400
-	exit ;;
-    arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
-	echo arm-acorn-riscix${UNAME_RELEASE}
-	exit ;;
-    arm*:riscos:*:*|arm*:RISCOS:*:*)
-	echo arm-unknown-riscos
-	exit ;;
-    SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
-	echo hppa1.1-hitachi-hiuxmpp
-	exit ;;
-    Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
-	# akee at wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
-	if test "`(/bin/universe) 2>/dev/null`" = att ; then
-		echo pyramid-pyramid-sysv3
-	else
-		echo pyramid-pyramid-bsd
-	fi
-	exit ;;
-    NILE*:*:*:dcosx)
-	echo pyramid-pyramid-svr4
-	exit ;;
-    DRS?6000:unix:4.0:6*)
-	echo sparc-icl-nx6
-	exit ;;
-    DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
-	case `/usr/bin/uname -p` in
-	    sparc) echo sparc-icl-nx7; exit ;;
-	esac ;;
-    s390x:SunOS:*:*)
-	echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
-	exit ;;
-    sun4H:SunOS:5.*:*)
-	echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
-	exit ;;
-    sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
-	echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
-	exit ;;
-    i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
-	echo i386-pc-auroraux${UNAME_RELEASE}
-	exit ;;
-    i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
-	eval $set_cc_for_build
-	SUN_ARCH="i386"
-	# If there is a compiler, see if it is configured for 64-bit objects.
-	# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
-	# This test works for both compilers.
-	if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
-	    if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
-		(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
-		grep IS_64BIT_ARCH >/dev/null
-	    then
-		SUN_ARCH="x86_64"
-	    fi
-	fi
-	echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
-	exit ;;
-    sun4*:SunOS:6*:*)
-	# According to config.sub, this is the proper way to canonicalize
-	# SunOS6.  Hard to guess exactly what SunOS6 will be like, but
-	# it's likely to be more like Solaris than SunOS4.
-	echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
-	exit ;;
-    sun4*:SunOS:*:*)
-	case "`/usr/bin/arch -k`" in
-	    Series*|S4*)
-		UNAME_RELEASE=`uname -v`
-		;;
-	esac
-	# Japanese Language versions have a version number like `4.1.3-JL'.
-	echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
-	exit ;;
-    sun3*:SunOS:*:*)
-	echo m68k-sun-sunos${UNAME_RELEASE}
-	exit ;;
-    sun*:*:4.2BSD:*)
-	UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
-	test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
-	case "`/bin/arch`" in
-	    sun3)
-		echo m68k-sun-sunos${UNAME_RELEASE}
-		;;
-	    sun4)
-		echo sparc-sun-sunos${UNAME_RELEASE}
-		;;
-	esac
-	exit ;;
-    aushp:SunOS:*:*)
-	echo sparc-auspex-sunos${UNAME_RELEASE}
-	exit ;;
-    # The situation for MiNT is a little confusing.  The machine name
-    # can be virtually everything (everything which is not
-    # "atarist" or "atariste" at least should have a processor
-    # > m68000).  The system name ranges from "MiNT" over "FreeMiNT"
-    # to the lowercase version "mint" (or "freemint").  Finally
-    # the system name "TOS" denotes a system which is actually not
-    # MiNT.  But MiNT is downward compatible to TOS, so this should
-    # be no problem.
-    atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
-	echo m68k-atari-mint${UNAME_RELEASE}
-	exit ;;
-    atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
-	echo m68k-atari-mint${UNAME_RELEASE}
-	exit ;;
-    *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
-	echo m68k-atari-mint${UNAME_RELEASE}
-	exit ;;
-    milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
-	echo m68k-milan-mint${UNAME_RELEASE}
-	exit ;;
-    hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
-	echo m68k-hades-mint${UNAME_RELEASE}
-	exit ;;
-    *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
-	echo m68k-unknown-mint${UNAME_RELEASE}
-	exit ;;
-    m68k:machten:*:*)
-	echo m68k-apple-machten${UNAME_RELEASE}
-	exit ;;
-    powerpc:machten:*:*)
-	echo powerpc-apple-machten${UNAME_RELEASE}
-	exit ;;
-    RISC*:Mach:*:*)
-	echo mips-dec-mach_bsd4.3
-	exit ;;
-    RISC*:ULTRIX:*:*)
-	echo mips-dec-ultrix${UNAME_RELEASE}
-	exit ;;
-    VAX*:ULTRIX*:*:*)
-	echo vax-dec-ultrix${UNAME_RELEASE}
-	exit ;;
-    2020:CLIX:*:* | 2430:CLIX:*:*)
-	echo clipper-intergraph-clix${UNAME_RELEASE}
-	exit ;;
-    mips:*:*:UMIPS | mips:*:*:RISCos)
-	eval $set_cc_for_build
-	sed 's/^	//' << EOF >$dummy.c
-#ifdef __cplusplus
-#include <stdio.h>  /* for printf() prototype */
-	int main (int argc, char *argv[]) {
-#else
-	int main (argc, argv) int argc; char *argv[]; {
-#endif
-	#if defined (host_mips) && defined (MIPSEB)
-	#if defined (SYSTYPE_SYSV)
-	  printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
-	#endif
-	#if defined (SYSTYPE_SVR4)
-	  printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
-	#endif
-	#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
-	  printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
-	#endif
-	#endif
-	  exit (-1);
-	}
-EOF
-	$CC_FOR_BUILD -o $dummy $dummy.c &&
-	  dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
-	  SYSTEM_NAME=`$dummy $dummyarg` &&
-	    { echo "$SYSTEM_NAME"; exit; }
-	echo mips-mips-riscos${UNAME_RELEASE}
-	exit ;;
-    Motorola:PowerMAX_OS:*:*)
-	echo powerpc-motorola-powermax
-	exit ;;
-    Motorola:*:4.3:PL8-*)
-	echo powerpc-harris-powermax
-	exit ;;
-    Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
-	echo powerpc-harris-powermax
-	exit ;;
-    Night_Hawk:Power_UNIX:*:*)
-	echo powerpc-harris-powerunix
-	exit ;;
-    m88k:CX/UX:7*:*)
-	echo m88k-harris-cxux7
-	exit ;;
-    m88k:*:4*:R4*)
-	echo m88k-motorola-sysv4
-	exit ;;
-    m88k:*:3*:R3*)
-	echo m88k-motorola-sysv3
-	exit ;;
-    AViiON:dgux:*:*)
-	# DG/UX returns AViiON for all architectures
-	UNAME_PROCESSOR=`/usr/bin/uname -p`
-	if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
-	then
-	    if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
-	       [ ${TARGET_BINARY_INTERFACE}x = x ]
-	    then
-		echo m88k-dg-dgux${UNAME_RELEASE}
-	    else
-		echo m88k-dg-dguxbcs${UNAME_RELEASE}
-	    fi
-	else
-	    echo i586-dg-dgux${UNAME_RELEASE}
-	fi
-	exit ;;
-    M88*:DolphinOS:*:*)	# DolphinOS (SVR3)
-	echo m88k-dolphin-sysv3
-	exit ;;
-    M88*:*:R3*:*)
-	# Delta 88k system running SVR3
-	echo m88k-motorola-sysv3
-	exit ;;
-    XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
-	echo m88k-tektronix-sysv3
-	exit ;;
-    Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
-	echo m68k-tektronix-bsd
-	exit ;;
-    *:IRIX*:*:*)
-	echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
-	exit ;;
-    ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
-	echo romp-ibm-aix     # uname -m gives an 8 hex-code CPU id
-	exit ;;               # Note that: echo "'`uname -s`'" gives 'AIX '
-    i*86:AIX:*:*)
-	echo i386-ibm-aix
-	exit ;;
-    ia64:AIX:*:*)
-	if [ -x /usr/bin/oslevel ] ; then
-		IBM_REV=`/usr/bin/oslevel`
-	else
-		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
-	fi
-	echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
-	exit ;;
-    *:AIX:2:3)
-	if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
-		eval $set_cc_for_build
-		sed 's/^		//' << EOF >$dummy.c
-		#include <sys/systemcfg.h>
-
-		main()
-			{
-			if (!__power_pc())
-				exit(1);
-			puts("powerpc-ibm-aix3.2.5");
-			exit(0);
-			}
-EOF
-		if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
-		then
-			echo "$SYSTEM_NAME"
-		else
-			echo rs6000-ibm-aix3.2.5
-		fi
-	elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
-		echo rs6000-ibm-aix3.2.4
-	else
-		echo rs6000-ibm-aix3.2
-	fi
-	exit ;;
-    *:AIX:*:[4567])
-	IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
-	if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
-		IBM_ARCH=rs6000
-	else
-		IBM_ARCH=powerpc
-	fi
-	if [ -x /usr/bin/oslevel ] ; then
-		IBM_REV=`/usr/bin/oslevel`
-	else
-		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
-	fi
-	echo ${IBM_ARCH}-ibm-aix${IBM_REV}
-	exit ;;
-    *:AIX:*:*)
-	echo rs6000-ibm-aix
-	exit ;;
-    ibmrt:4.4BSD:*|romp-ibm:BSD:*)
-	echo romp-ibm-bsd4.4
-	exit ;;
-    ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
-	echo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to
-	exit ;;                             # report: romp-ibm BSD 4.3
-    *:BOSX:*:*)
-	echo rs6000-bull-bosx
-	exit ;;
-    DPX/2?00:B.O.S.:*:*)
-	echo m68k-bull-sysv3
-	exit ;;
-    9000/[34]??:4.3bsd:1.*:*)
-	echo m68k-hp-bsd
-	exit ;;
-    hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
-	echo m68k-hp-bsd4.4
-	exit ;;
-    9000/[34678]??:HP-UX:*:*)
-	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
-	case "${UNAME_MACHINE}" in
-	    9000/31? )            HP_ARCH=m68000 ;;
-	    9000/[34]?? )         HP_ARCH=m68k ;;
-	    9000/[678][0-9][0-9])
-		if [ -x /usr/bin/getconf ]; then
-		    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
-		    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
-		    case "${sc_cpu_version}" in
-		      523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
-		      528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
-		      532)                      # CPU_PA_RISC2_0
-			case "${sc_kernel_bits}" in
-			  32) HP_ARCH="hppa2.0n" ;;
-			  64) HP_ARCH="hppa2.0w" ;;
-			  '') HP_ARCH="hppa2.0" ;;   # HP-UX 10.20
-			esac ;;
-		    esac
-		fi
-		if [ "${HP_ARCH}" = "" ]; then
-		    eval $set_cc_for_build
-		    sed 's/^		//' << EOF >$dummy.c
-
-		#define _HPUX_SOURCE
-		#include <stdlib.h>
-		#include <unistd.h>
-
-		int main ()
-		{
-		#if defined(_SC_KERNEL_BITS)
-		    long bits = sysconf(_SC_KERNEL_BITS);
-		#endif
-		    long cpu  = sysconf (_SC_CPU_VERSION);
-
-		    switch (cpu)
-			{
-			case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
-			case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
-			case CPU_PA_RISC2_0:
-		#if defined(_SC_KERNEL_BITS)
-			    switch (bits)
-				{
-				case 64: puts ("hppa2.0w"); break;
-				case 32: puts ("hppa2.0n"); break;
-				default: puts ("hppa2.0"); break;
-				} break;
-		#else  /* !defined(_SC_KERNEL_BITS) */
-			    puts ("hppa2.0"); break;
-		#endif
-			default: puts ("hppa1.0"); break;
-			}
-		    exit (0);
-		}
-EOF
-		    (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
-		    test -z "$HP_ARCH" && HP_ARCH=hppa
-		fi ;;
-	esac
-	if [ ${HP_ARCH} = "hppa2.0w" ]
-	then
-	    eval $set_cc_for_build
-
-	    # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
-	    # 32-bit code.  hppa64-hp-hpux* has the same kernel and a compiler
-	    # generating 64-bit code.  GNU and HP use different nomenclature:
-	    #
-	    # $ CC_FOR_BUILD=cc ./config.guess
-	    # => hppa2.0w-hp-hpux11.23
-	    # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
-	    # => hppa64-hp-hpux11.23
-
-	    if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
-		grep -q __LP64__
-	    then
-		HP_ARCH="hppa2.0w"
-	    else
-		HP_ARCH="hppa64"
-	    fi
-	fi
-	echo ${HP_ARCH}-hp-hpux${HPUX_REV}
-	exit ;;
-    ia64:HP-UX:*:*)
-	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
-	echo ia64-hp-hpux${HPUX_REV}
-	exit ;;
-    3050*:HI-UX:*:*)
-	eval $set_cc_for_build
-	sed 's/^	//' << EOF >$dummy.c
-	#include <unistd.h>
-	int
-	main ()
-	{
-	  long cpu = sysconf (_SC_CPU_VERSION);
-	  /* The order matters, because CPU_IS_HP_MC68K erroneously returns
-	     true for CPU_PA_RISC1_0.  CPU_IS_PA_RISC returns correct
-	     results, however.  */
-	  if (CPU_IS_PA_RISC (cpu))
-	    {
-	      switch (cpu)
-		{
-		  case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
-		  case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
-		  case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
-		  default: puts ("hppa-hitachi-hiuxwe2"); break;
-		}
-	    }
-	  else if (CPU_IS_HP_MC68K (cpu))
-	    puts ("m68k-hitachi-hiuxwe2");
-	  else puts ("unknown-hitachi-hiuxwe2");
-	  exit (0);
-	}
-EOF
-	$CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
-		{ echo "$SYSTEM_NAME"; exit; }
-	echo unknown-hitachi-hiuxwe2
-	exit ;;
-    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
-	echo hppa1.1-hp-bsd
-	exit ;;
-    9000/8??:4.3bsd:*:*)
-	echo hppa1.0-hp-bsd
-	exit ;;
-    *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
-	echo hppa1.0-hp-mpeix
-	exit ;;
-    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
-	echo hppa1.1-hp-osf
-	exit ;;
-    hp8??:OSF1:*:*)
-	echo hppa1.0-hp-osf
-	exit ;;
-    i*86:OSF1:*:*)
-	if [ -x /usr/sbin/sysversion ] ; then
-	    echo ${UNAME_MACHINE}-unknown-osf1mk
-	else
-	    echo ${UNAME_MACHINE}-unknown-osf1
-	fi
-	exit ;;
-    parisc*:Lites*:*:*)
-	echo hppa1.1-hp-lites
-	exit ;;
-    C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
-	echo c1-convex-bsd
-	exit ;;
-    C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
-	if getsysinfo -f scalar_acc
-	then echo c32-convex-bsd
-	else echo c2-convex-bsd
-	fi
-	exit ;;
-    C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
-	echo c34-convex-bsd
-	exit ;;
-    C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
-	echo c38-convex-bsd
-	exit ;;
-    C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
-	echo c4-convex-bsd
-	exit ;;
-    CRAY*Y-MP:*:*:*)
-	echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
-	exit ;;
-    CRAY*[A-Z]90:*:*:*)
-	echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
-	| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
-	      -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
-	      -e 's/\.[^.]*$/.X/'
-	exit ;;
-    CRAY*TS:*:*:*)
-	echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
-	exit ;;
-    CRAY*T3E:*:*:*)
-	echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
-	exit ;;
-    CRAY*SV1:*:*:*)
-	echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
-	exit ;;
-    *:UNICOS/mp:*:*)
-	echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
-	exit ;;
-    F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
-	FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
-	FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
-	FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
-	echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
-	exit ;;
-    5000:UNIX_System_V:4.*:*)
-	FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
-	FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
-	echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
-	exit ;;
-    i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
-	echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
-	exit ;;
-    sparc*:BSD/OS:*:*)
-	echo sparc-unknown-bsdi${UNAME_RELEASE}
-	exit ;;
-    *:BSD/OS:*:*)
-	echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
-	exit ;;
-    *:FreeBSD:*:*)
-	UNAME_PROCESSOR=`/usr/bin/uname -p`
-	case ${UNAME_PROCESSOR} in
-	    amd64)
-		echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
-	    *)
-		echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
-	esac
-	exit ;;
-    i*:CYGWIN*:*)
-	echo ${UNAME_MACHINE}-pc-cygwin
-	exit ;;
-    *:MINGW64*:*)
-	echo ${UNAME_MACHINE}-pc-mingw64
-	exit ;;
-    *:MINGW*:*)
-	echo ${UNAME_MACHINE}-pc-mingw32
-	exit ;;
-    i*:MSYS*:*)
-	echo ${UNAME_MACHINE}-pc-msys
-	exit ;;
-    i*:windows32*:*)
-	# uname -m includes "-pc" on this system.
-	echo ${UNAME_MACHINE}-mingw32
-	exit ;;
-    i*:PW*:*)
-	echo ${UNAME_MACHINE}-pc-pw32
-	exit ;;
-    *:Interix*:*)
-	case ${UNAME_MACHINE} in
-	    x86)
-		echo i586-pc-interix${UNAME_RELEASE}
-		exit ;;
-	    authenticamd | genuineintel | EM64T)
-		echo x86_64-unknown-interix${UNAME_RELEASE}
-		exit ;;
-	    IA64)
-		echo ia64-unknown-interix${UNAME_RELEASE}
-		exit ;;
-	esac ;;
-    [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
-	echo i${UNAME_MACHINE}-pc-mks
-	exit ;;
-    8664:Windows_NT:*)
-	echo x86_64-pc-mks
-	exit ;;
-    i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
-	# How do we know it's Interix rather than the generic POSIX subsystem?
-	# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
-	# UNAME_MACHINE based on the output of uname instead of i386?
-	echo i586-pc-interix
-	exit ;;
-    i*:UWIN*:*)
-	echo ${UNAME_MACHINE}-pc-uwin
-	exit ;;
-    amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
-	echo x86_64-unknown-cygwin
-	exit ;;
-    p*:CYGWIN*:*)
-	echo powerpcle-unknown-cygwin
-	exit ;;
-    prep*:SunOS:5.*:*)
-	echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
-	exit ;;
-    *:GNU:*:*)
-	# the GNU system
-	echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
-	exit ;;
-    *:GNU/*:*:*)
-	# other systems with GNU libc and userland
-	echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}
-	exit ;;
-    i*86:Minix:*:*)
-	echo ${UNAME_MACHINE}-pc-minix
-	exit ;;
-    aarch64:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
-	exit ;;
-    aarch64_be:Linux:*:*)
-	UNAME_MACHINE=aarch64_be
-	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
-	exit ;;
-    alpha:Linux:*:*)
-	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
-	  EV5)   UNAME_MACHINE=alphaev5 ;;
-	  EV56)  UNAME_MACHINE=alphaev56 ;;
-	  PCA56) UNAME_MACHINE=alphapca56 ;;
-	  PCA57) UNAME_MACHINE=alphapca56 ;;
-	  EV6)   UNAME_MACHINE=alphaev6 ;;
-	  EV67)  UNAME_MACHINE=alphaev67 ;;
-	  EV68*) UNAME_MACHINE=alphaev68 ;;
-	esac
-	objdump --private-headers /bin/sh | grep -q ld.so.1
-	if test "$?" = 0 ; then LIBC="gnulibc1" ; fi
-	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
-	exit ;;
-    arc:Linux:*:* | arceb:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
-	exit ;;
-    arm*:Linux:*:*)
-	eval $set_cc_for_build
-	if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
-	    | grep -q __ARM_EABI__
-	then
-	    echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
-	else
-	    if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
-		| grep -q __ARM_PCS_VFP
-	    then
-		echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi
-	    else
-		echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf
-	    fi
-	fi
-	exit ;;
-    avr32*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
-	exit ;;
-    cris:Linux:*:*)
-	echo ${UNAME_MACHINE}-axis-linux-${LIBC}
-	exit ;;
-    crisv32:Linux:*:*)
-	echo ${UNAME_MACHINE}-axis-linux-${LIBC}
-	exit ;;
-    frv:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
-	exit ;;
-    hexagon:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
-	exit ;;
-    i*86:Linux:*:*)
-	echo ${UNAME_MACHINE}-pc-linux-${LIBC}
-	exit ;;
-    ia64:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
-	exit ;;
-    m32r*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
-	exit ;;
-    m68*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
-	exit ;;
-    mips:Linux:*:* | mips64:Linux:*:*)
-	eval $set_cc_for_build
-	sed 's/^	//' << EOF >$dummy.c
-	#undef CPU
-	#undef ${UNAME_MACHINE}
-	#undef ${UNAME_MACHINE}el
-	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
-	CPU=${UNAME_MACHINE}el
-	#else
-	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
-	CPU=${UNAME_MACHINE}
-	#else
-	CPU=
-	#endif
-	#endif
-EOF
-	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
-	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
-	;;
-    or1k:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
-	exit ;;
-    or32:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
-	exit ;;
-    padre:Linux:*:*)
-	echo sparc-unknown-linux-${LIBC}
-	exit ;;
-    parisc64:Linux:*:* | hppa64:Linux:*:*)
-	echo hppa64-unknown-linux-${LIBC}
-	exit ;;
-    parisc:Linux:*:* | hppa:Linux:*:*)
-	# Look for CPU level
-	case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
-	  PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;
-	  PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
-	  *)    echo hppa-unknown-linux-${LIBC} ;;
-	esac
-	exit ;;
-    ppc64:Linux:*:*)
-	echo powerpc64-unknown-linux-${LIBC}
-	exit ;;
-    ppc:Linux:*:*)
-	echo powerpc-unknown-linux-${LIBC}
-	exit ;;
-    ppc64le:Linux:*:*)
-	echo powerpc64le-unknown-linux-${LIBC}
-	exit ;;
-    ppcle:Linux:*:*)
-	echo powerpcle-unknown-linux-${LIBC}
-	exit ;;
-    s390:Linux:*:* | s390x:Linux:*:*)
-	echo ${UNAME_MACHINE}-ibm-linux-${LIBC}
-	exit ;;
-    sh64*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
-	exit ;;
-    sh*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
-	exit ;;
-    sparc:Linux:*:* | sparc64:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
-	exit ;;
-    tile*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
-	exit ;;
-    vax:Linux:*:*)
-	echo ${UNAME_MACHINE}-dec-linux-${LIBC}
-	exit ;;
-    x86_64:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
-	exit ;;
-    xtensa*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
-	exit ;;
-    i*86:DYNIX/ptx:4*:*)
-	# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
-	# earlier versions are messed up and put the nodename in both
-	# sysname and nodename.
-	echo i386-sequent-sysv4
-	exit ;;
-    i*86:UNIX_SV:4.2MP:2.*)
-	# Unixware is an offshoot of SVR4, but it has its own version
-	# number series starting with 2...
-	# I am not positive that other SVR4 systems won't match this,
-	# I just have to hope.  -- rms.
-	# Use sysv4.2uw... so that sysv4* matches it.
-	echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
-	exit ;;
-    i*86:OS/2:*:*)
-	# If we were able to find `uname', then EMX Unix compatibility
-	# is probably installed.
-	echo ${UNAME_MACHINE}-pc-os2-emx
-	exit ;;
-    i*86:XTS-300:*:STOP)
-	echo ${UNAME_MACHINE}-unknown-stop
-	exit ;;
-    i*86:atheos:*:*)
-	echo ${UNAME_MACHINE}-unknown-atheos
-	exit ;;
-    i*86:syllable:*:*)
-	echo ${UNAME_MACHINE}-pc-syllable
-	exit ;;
-    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
-	echo i386-unknown-lynxos${UNAME_RELEASE}
-	exit ;;
-    i*86:*DOS:*:*)
-	echo ${UNAME_MACHINE}-pc-msdosdjgpp
-	exit ;;
-    i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
-	UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
-	if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
-		echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
-	else
-		echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
-	fi
-	exit ;;
-    i*86:*:5:[678]*)
-	# UnixWare 7.x, OpenUNIX and OpenServer 6.
-	case `/bin/uname -X | grep "^Machine"` in
-	    *486*)	     UNAME_MACHINE=i486 ;;
-	    *Pentium)	     UNAME_MACHINE=i586 ;;
-	    *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
-	esac
-	echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
-	exit ;;
-    i*86:*:3.2:*)
-	if test -f /usr/options/cb.name; then
-		UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
-		echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
-	elif /bin/uname -X 2>/dev/null >/dev/null ; then
-		UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
-		(/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
-		(/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
-			&& UNAME_MACHINE=i586
-		(/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
-			&& UNAME_MACHINE=i686
-		(/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
-			&& UNAME_MACHINE=i686
-		echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
-	else
-		echo ${UNAME_MACHINE}-pc-sysv32
-	fi
-	exit ;;
-    pc:*:*:*)
-	# Left here for compatibility:
-	# uname -m prints for DJGPP always 'pc', but it prints nothing about
-	# the processor, so we play safe by assuming i586.
-	# Note: whatever this is, it MUST be the same as what config.sub
-	# prints for the "djgpp" host, or else GDB configury will decide that
-	# this is a cross-build.
-	echo i586-pc-msdosdjgpp
-	exit ;;
-    Intel:Mach:3*:*)
-	echo i386-pc-mach3
-	exit ;;
-    paragon:*:*:*)
-	echo i860-intel-osf1
-	exit ;;
-    i860:*:4.*:*) # i860-SVR4
-	if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
-	  echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
-	else # Add other i860-SVR4 vendors below as they are discovered.
-	  echo i860-unknown-sysv${UNAME_RELEASE}  # Unknown i860-SVR4
-	fi
-	exit ;;
-    mini*:CTIX:SYS*5:*)
-	# "miniframe"
-	echo m68010-convergent-sysv
-	exit ;;
-    mc68k:UNIX:SYSTEM5:3.51m)
-	echo m68k-convergent-sysv
-	exit ;;
-    M680?0:D-NIX:5.3:*)
-	echo m68k-diab-dnix
-	exit ;;
-    M68*:*:R3V[5678]*:*)
-	test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
-    3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
-	OS_REL=''
-	test -r /etc/.relid \
-	&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
-	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
-	  && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
-	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
-	  && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
-    3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
-	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
-	  && { echo i486-ncr-sysv4; exit; } ;;
-    NCR*:*:4.2:* | MPRAS*:*:4.2:*)
-	OS_REL='.3'
-	test -r /etc/.relid \
-	    && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
-	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
-	    && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
-	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
-	    && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
-	/bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
-	    && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
-    m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
-	echo m68k-unknown-lynxos${UNAME_RELEASE}
-	exit ;;
-    mc68030:UNIX_System_V:4.*:*)
-	echo m68k-atari-sysv4
-	exit ;;
-    TSUNAMI:LynxOS:2.*:*)
-	echo sparc-unknown-lynxos${UNAME_RELEASE}
-	exit ;;
-    rs6000:LynxOS:2.*:*)
-	echo rs6000-unknown-lynxos${UNAME_RELEASE}
-	exit ;;
-    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
-	echo powerpc-unknown-lynxos${UNAME_RELEASE}
-	exit ;;
-    SM[BE]S:UNIX_SV:*:*)
-	echo mips-dde-sysv${UNAME_RELEASE}
-	exit ;;
-    RM*:ReliantUNIX-*:*:*)
-	echo mips-sni-sysv4
-	exit ;;
-    RM*:SINIX-*:*:*)
-	echo mips-sni-sysv4
-	exit ;;
-    *:SINIX-*:*:*)
-	if uname -p 2>/dev/null >/dev/null ; then
-		UNAME_MACHINE=`(uname -p) 2>/dev/null`
-		echo ${UNAME_MACHINE}-sni-sysv4
-	else
-		echo ns32k-sni-sysv
-	fi
-	exit ;;
-    PENTIUM:*:4.0*:*)	# Unisys `ClearPath HMP IX 4000' SVR4/MP effort
-			# says <Richard.M.Bartel at ccMail.Census.GOV>
-	echo i586-unisys-sysv4
-	exit ;;
-    *:UNIX_System_V:4*:FTX*)
-	# From Gerald Hewes <hewes at openmarket.com>.
-	# How about differentiating between stratus architectures? -djm
-	echo hppa1.1-stratus-sysv4
-	exit ;;
-    *:*:*:FTX*)
-	# From seanf at swdc.stratus.com.
-	echo i860-stratus-sysv4
-	exit ;;
-    i*86:VOS:*:*)
-	# From Paul.Green at stratus.com.
-	echo ${UNAME_MACHINE}-stratus-vos
-	exit ;;
-    *:VOS:*:*)
-	# From Paul.Green at stratus.com.
-	echo hppa1.1-stratus-vos
-	exit ;;
-    mc68*:A/UX:*:*)
-	echo m68k-apple-aux${UNAME_RELEASE}
-	exit ;;
-    news*:NEWS-OS:6*:*)
-	echo mips-sony-newsos6
-	exit ;;
-    R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
-	if [ -d /usr/nec ]; then
-		echo mips-nec-sysv${UNAME_RELEASE}
-	else
-		echo mips-unknown-sysv${UNAME_RELEASE}
-	fi
-	exit ;;
-    BeBox:BeOS:*:*)	# BeOS running on hardware made by Be, PPC only.
-	echo powerpc-be-beos
-	exit ;;
-    BeMac:BeOS:*:*)	# BeOS running on Mac or Mac clone, PPC only.
-	echo powerpc-apple-beos
-	exit ;;
-    BePC:BeOS:*:*)	# BeOS running on Intel PC compatible.
-	echo i586-pc-beos
-	exit ;;
-    BePC:Haiku:*:*)	# Haiku running on Intel PC compatible.
-	echo i586-pc-haiku
-	exit ;;
-    x86_64:Haiku:*:*)
-	echo x86_64-unknown-haiku
-	exit ;;
-    SX-4:SUPER-UX:*:*)
-	echo sx4-nec-superux${UNAME_RELEASE}
-	exit ;;
-    SX-5:SUPER-UX:*:*)
-	echo sx5-nec-superux${UNAME_RELEASE}
-	exit ;;
-    SX-6:SUPER-UX:*:*)
-	echo sx6-nec-superux${UNAME_RELEASE}
-	exit ;;
-    SX-7:SUPER-UX:*:*)
-	echo sx7-nec-superux${UNAME_RELEASE}
-	exit ;;
-    SX-8:SUPER-UX:*:*)
-	echo sx8-nec-superux${UNAME_RELEASE}
-	exit ;;
-    SX-8R:SUPER-UX:*:*)
-	echo sx8r-nec-superux${UNAME_RELEASE}
-	exit ;;
-    Power*:Rhapsody:*:*)
-	echo powerpc-apple-rhapsody${UNAME_RELEASE}
-	exit ;;
-    *:Rhapsody:*:*)
-	echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
-	exit ;;
-    *:Darwin:*:*)
-	UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
-	eval $set_cc_for_build
-	if test "$UNAME_PROCESSOR" = unknown ; then
-	    UNAME_PROCESSOR=powerpc
-	fi
-	if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then
-	    if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
-		if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
-		    (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
-		    grep IS_64BIT_ARCH >/dev/null
-		then
-		    case $UNAME_PROCESSOR in
-			i386) UNAME_PROCESSOR=x86_64 ;;
-			powerpc) UNAME_PROCESSOR=powerpc64 ;;
-		    esac
-		fi
-	    fi
-	elif test "$UNAME_PROCESSOR" = i386 ; then
-	    # Avoid executing cc on OS X 10.9, as it ships with a stub
-	    # that puts up a graphical alert prompting to install
-	    # developer tools.  Any system running Mac OS X 10.7 or
-	    # later (Darwin 11 and later) is required to have a 64-bit
-	    # processor. This is not true of the ARM version of Darwin
-	    # that Apple uses in portable devices.
-	    UNAME_PROCESSOR=x86_64
-	fi
-	echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
-	exit ;;
-    *:procnto*:*:* | *:QNX:[0123456789]*:*)
-	UNAME_PROCESSOR=`uname -p`
-	if test "$UNAME_PROCESSOR" = "x86"; then
-		UNAME_PROCESSOR=i386
-		UNAME_MACHINE=pc
-	fi
-	echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
-	exit ;;
-    *:QNX:*:4*)
-	echo i386-pc-qnx
-	exit ;;
-    NEO-?:NONSTOP_KERNEL:*:*)
-	echo neo-tandem-nsk${UNAME_RELEASE}
-	exit ;;
-    NSE-*:NONSTOP_KERNEL:*:*)
-	echo nse-tandem-nsk${UNAME_RELEASE}
-	exit ;;
-    NSR-?:NONSTOP_KERNEL:*:*)
-	echo nsr-tandem-nsk${UNAME_RELEASE}
-	exit ;;
-    *:NonStop-UX:*:*)
-	echo mips-compaq-nonstopux
-	exit ;;
-    BS2000:POSIX*:*:*)
-	echo bs2000-siemens-sysv
-	exit ;;
-    DS/*:UNIX_System_V:*:*)
-	echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
-	exit ;;
-    *:Plan9:*:*)
-	# "uname -m" is not consistent, so use $cputype instead. 386
-	# is converted to i386 for consistency with other x86
-	# operating systems.
-	if test "$cputype" = "386"; then
-	    UNAME_MACHINE=i386
-	else
-	    UNAME_MACHINE="$cputype"
-	fi
-	echo ${UNAME_MACHINE}-unknown-plan9
-	exit ;;
-    *:TOPS-10:*:*)
-	echo pdp10-unknown-tops10
-	exit ;;
-    *:TENEX:*:*)
-	echo pdp10-unknown-tenex
-	exit ;;
-    KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
-	echo pdp10-dec-tops20
-	exit ;;
-    XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
-	echo pdp10-xkl-tops20
-	exit ;;
-    *:TOPS-20:*:*)
-	echo pdp10-unknown-tops20
-	exit ;;
-    *:ITS:*:*)
-	echo pdp10-unknown-its
-	exit ;;
-    SEI:*:*:SEIUX)
-	echo mips-sei-seiux${UNAME_RELEASE}
-	exit ;;
-    *:DragonFly:*:*)
-	echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
-	exit ;;
-    *:*VMS:*:*)
-	UNAME_MACHINE=`(uname -p) 2>/dev/null`
-	case "${UNAME_MACHINE}" in
-	    A*) echo alpha-dec-vms ; exit ;;
-	    I*) echo ia64-dec-vms ; exit ;;
-	    V*) echo vax-dec-vms ; exit ;;
-	esac ;;
-    *:XENIX:*:SysV)
-	echo i386-pc-xenix
-	exit ;;
-    i*86:skyos:*:*)
-	echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
-	exit ;;
-    i*86:rdos:*:*)
-	echo ${UNAME_MACHINE}-pc-rdos
-	exit ;;
-    i*86:AROS:*:*)
-	echo ${UNAME_MACHINE}-pc-aros
-	exit ;;
-    x86_64:VMkernel:*:*)
-	echo ${UNAME_MACHINE}-unknown-esx
-	exit ;;
-esac
-
-eval $set_cc_for_build
-cat >$dummy.c <<EOF
-#ifdef _SEQUENT_
-# include <sys/types.h>
-# include <sys/utsname.h>
-#endif
-main ()
-{
-#if defined (sony)
-#if defined (MIPSEB)
-  /* BFD wants "bsd" instead of "newsos".  Perhaps BFD should be changed,
-     I don't know....  */
-  printf ("mips-sony-bsd\n"); exit (0);
-#else
-#include <sys/param.h>
-  printf ("m68k-sony-newsos%s\n",
-#ifdef NEWSOS4
-	"4"
-#else
-	""
-#endif
-	); exit (0);
-#endif
-#endif
-
-#if defined (__arm) && defined (__acorn) && defined (__unix)
-  printf ("arm-acorn-riscix\n"); exit (0);
-#endif
-
-#if defined (hp300) && !defined (hpux)
-  printf ("m68k-hp-bsd\n"); exit (0);
-#endif
-
-#if defined (NeXT)
-#if !defined (__ARCHITECTURE__)
-#define __ARCHITECTURE__ "m68k"
-#endif
-  int version;
-  version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
-  if (version < 4)
-    printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
-  else
-    printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
-  exit (0);
-#endif
-
-#if defined (MULTIMAX) || defined (n16)
-#if defined (UMAXV)
-  printf ("ns32k-encore-sysv\n"); exit (0);
-#else
-#if defined (CMU)
-  printf ("ns32k-encore-mach\n"); exit (0);
-#else
-  printf ("ns32k-encore-bsd\n"); exit (0);
-#endif
-#endif
-#endif
-
-#if defined (__386BSD__)
-  printf ("i386-pc-bsd\n"); exit (0);
-#endif
-
-#if defined (sequent)
-#if defined (i386)
-  printf ("i386-sequent-dynix\n"); exit (0);
-#endif
-#if defined (ns32000)
-  printf ("ns32k-sequent-dynix\n"); exit (0);
-#endif
-#endif
-
-#if defined (_SEQUENT_)
-    struct utsname un;
-
-    uname(&un);
-
-    if (strncmp(un.version, "V2", 2) == 0) {
-	printf ("i386-sequent-ptx2\n"); exit (0);
-    }
-    if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
-	printf ("i386-sequent-ptx1\n"); exit (0);
-    }
-    printf ("i386-sequent-ptx\n"); exit (0);
-
-#endif
-
-#if defined (vax)
-# if !defined (ultrix)
-#  include <sys/param.h>
-#  if defined (BSD)
-#   if BSD == 43
-      printf ("vax-dec-bsd4.3\n"); exit (0);
-#   else
-#    if BSD == 199006
-      printf ("vax-dec-bsd4.3reno\n"); exit (0);
-#    else
-      printf ("vax-dec-bsd\n"); exit (0);
-#    endif
-#   endif
-#  else
-    printf ("vax-dec-bsd\n"); exit (0);
-#  endif
-# else
-    printf ("vax-dec-ultrix\n"); exit (0);
-# endif
-#endif
-
-#if defined (alliant) && defined (i860)
-  printf ("i860-alliant-bsd\n"); exit (0);
-#endif
-
-  exit (1);
-}
-EOF
-
-$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
-	{ echo "$SYSTEM_NAME"; exit; }
-
-# Apollos put the system type in the environment.
-
-test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
-
-# Convex versions that predate uname can use getsysinfo(1)
-
-if [ -x /usr/convex/getsysinfo ]
-then
-    case `getsysinfo -f cpu_type` in
-    c1*)
-	echo c1-convex-bsd
-	exit ;;
-    c2*)
-	if getsysinfo -f scalar_acc
-	then echo c32-convex-bsd
-	else echo c2-convex-bsd
-	fi
-	exit ;;
-    c34*)
-	echo c34-convex-bsd
-	exit ;;
-    c38*)
-	echo c38-convex-bsd
-	exit ;;
-    c4*)
-	echo c4-convex-bsd
-	exit ;;
-    esac
-fi
-
-cat >&2 <<EOF
-$0: unable to guess system type
-
-This script, last modified $timestamp, has failed to recognize
-the operating system you are using. It is advised that you
-download the most up to date version of the config scripts from
-
-  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
-and
-  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
-
-If the version you run ($0) is already up to date, please
-send the following data and any information you think might be
-pertinent to <config-patches at gnu.org> in order to provide the needed
-information to handle your system.
-
-config.guess timestamp = $timestamp
-
-uname -m = `(uname -m) 2>/dev/null || echo unknown`
-uname -r = `(uname -r) 2>/dev/null || echo unknown`
-uname -s = `(uname -s) 2>/dev/null || echo unknown`
-uname -v = `(uname -v) 2>/dev/null || echo unknown`
-
-/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
-/bin/uname -X     = `(/bin/uname -X) 2>/dev/null`
-
-hostinfo               = `(hostinfo) 2>/dev/null`
-/bin/universe          = `(/bin/universe) 2>/dev/null`
-/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null`
-/bin/arch              = `(/bin/arch) 2>/dev/null`
-/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null`
-/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
-
-UNAME_MACHINE = ${UNAME_MACHINE}
-UNAME_RELEASE = ${UNAME_RELEASE}
-UNAME_SYSTEM  = ${UNAME_SYSTEM}
-UNAME_VERSION = ${UNAME_VERSION}
-EOF
-
-exit 1
-
-# Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "timestamp='"
-# time-stamp-format: "%:y-%02m-%02d"
-# time-stamp-end: "'"
-# End:
diff --git a/config.sub b/config.sub
deleted file mode 100755
index 61cb4bc..0000000
--- a/config.sub
+++ /dev/null
@@ -1,1793 +0,0 @@
-#! /bin/sh
-# Configuration validation subroutine script.
-#   Copyright 1992-2013 Free Software Foundation, Inc.
-
-timestamp='2013-10-01'
-
-# This file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, see <http://www.gnu.org/licenses/>.
-#
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that
-# program.  This Exception is an additional permission under section 7
-# of the GNU General Public License, version 3 ("GPLv3").
-
-
-# Please send patches with a ChangeLog entry to config-patches at gnu.org.
-#
-# Configuration subroutine to validate and canonicalize a configuration type.
-# Supply the specified configuration type as an argument.
-# If it is invalid, we print an error message on stderr and exit with code 1.
-# Otherwise, we print the canonical config type on stdout and succeed.
-
-# You can get the latest version of this script from:
-# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
-
-# This file is supposed to be the same for all GNU packages
-# and recognize all the CPU types, system types and aliases
-# that are meaningful with *any* GNU software.
-# Each package is responsible for reporting which valid configurations
-# it does not support.  The user should be able to distinguish
-# a failure to support a valid configuration from a meaningless
-# configuration.
-
-# The goal of this file is to map all the various variations of a given
-# machine specification into a single specification in the form:
-#	CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
-# or in some cases, the newer four-part form:
-#	CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
-# It is wrong to echo any other type of specification.
-
-me=`echo "$0" | sed -e 's,.*/,,'`
-
-usage="\
-Usage: $0 [OPTION] CPU-MFR-OPSYS
-       $0 [OPTION] ALIAS
-
-Canonicalize a configuration name.
-
-Operation modes:
-  -h, --help         print this help, then exit
-  -t, --time-stamp   print date of last modification, then exit
-  -v, --version      print version number, then exit
-
-Report bugs and patches to <config-patches at gnu.org>."
-
-version="\
-GNU config.sub ($timestamp)
-
-Copyright 1992-2013 Free Software Foundation, Inc.
-
-This is free software; see the source for copying conditions.  There is NO
-warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
-
-help="
-Try \`$me --help' for more information."
-
-# Parse command line
-while test $# -gt 0 ; do
-  case $1 in
-    --time-stamp | --time* | -t )
-       echo "$timestamp" ; exit ;;
-    --version | -v )
-       echo "$version" ; exit ;;
-    --help | --h* | -h )
-       echo "$usage"; exit ;;
-    -- )     # Stop option processing
-       shift; break ;;
-    - )	# Use stdin as input.
-       break ;;
-    -* )
-       echo "$me: invalid option $1$help"
-       exit 1 ;;
-
-    *local*)
-       # First pass through any local machine types.
-       echo $1
-       exit ;;
-
-    * )
-       break ;;
-  esac
-done
-
-case $# in
- 0) echo "$me: missing argument$help" >&2
-    exit 1;;
- 1) ;;
- *) echo "$me: too many arguments$help" >&2
-    exit 1;;
-esac
-
-# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
-# Here we must recognize all the valid KERNEL-OS combinations.
-maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
-case $maybe_os in
-  nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
-  linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
-  knetbsd*-gnu* | netbsd*-gnu* | \
-  kopensolaris*-gnu* | \
-  storm-chaos* | os2-emx* | rtmk-nova*)
-    os=-$maybe_os
-    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
-    ;;
-  android-linux)
-    os=-linux-android
-    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
-    ;;
-  *)
-    basic_machine=`echo $1 | sed 's/-[^-]*$//'`
-    if [ $basic_machine != $1 ]
-    then os=`echo $1 | sed 's/.*-/-/'`
-    else os=; fi
-    ;;
-esac
-
-### Let's recognize common machines as not being operating systems so
-### that things like config.sub decstation-3100 work.  We also
-### recognize some manufacturers as not being operating systems, so we
-### can provide default operating systems below.
-case $os in
-	-sun*os*)
-		# Prevent following clause from handling this invalid input.
-		;;
-	-dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
-	-att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
-	-unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
-	-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
-	-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
-	-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
-	-apple | -axis | -knuth | -cray | -microblaze*)
-		os=
-		basic_machine=$1
-		;;
-	-bluegene*)
-		os=-cnk
-		;;
-	-sim | -cisco | -oki | -wec | -winbond)
-		os=
-		basic_machine=$1
-		;;
-	-scout)
-		;;
-	-wrs)
-		os=-vxworks
-		basic_machine=$1
-		;;
-	-chorusos*)
-		os=-chorusos
-		basic_machine=$1
-		;;
-	-chorusrdb)
-		os=-chorusrdb
-		basic_machine=$1
-		;;
-	-hiux*)
-		os=-hiuxwe2
-		;;
-	-sco6)
-		os=-sco5v6
-		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-		;;
-	-sco5)
-		os=-sco3.2v5
-		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-		;;
-	-sco4)
-		os=-sco3.2v4
-		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-		;;
-	-sco3.2.[4-9]*)
-		os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
-		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-		;;
-	-sco3.2v[4-9]*)
-		# Don't forget version if it is 3.2v4 or newer.
-		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-		;;
-	-sco5v6*)
-		# Don't forget version if it is 3.2v4 or newer.
-		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-		;;
-	-sco*)
-		os=-sco3.2v2
-		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-		;;
-	-udk*)
-		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-		;;
-	-isc)
-		os=-isc2.2
-		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-		;;
-	-clix*)
-		basic_machine=clipper-intergraph
-		;;
-	-isc*)
-		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-		;;
-	-lynx*178)
-		os=-lynxos178
-		;;
-	-lynx*5)
-		os=-lynxos5
-		;;
-	-lynx*)
-		os=-lynxos
-		;;
-	-ptx*)
-		basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
-		;;
-	-windowsnt*)
-		os=`echo $os | sed -e 's/windowsnt/winnt/'`
-		;;
-	-psos*)
-		os=-psos
-		;;
-	-mint | -mint[0-9]*)
-		basic_machine=m68k-atari
-		os=-mint
-		;;
-esac
-
-# Decode aliases for certain CPU-COMPANY combinations.
-case $basic_machine in
-	# Recognize the basic CPU types without company name.
-	# Some are omitted here because they have special meanings below.
-	1750a | 580 \
-	| a29k \
-	| aarch64 | aarch64_be \
-	| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
-	| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
-	| am33_2.0 \
-	| arc | arceb \
-	| arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
-	| avr | avr32 \
-	| be32 | be64 \
-	| bfin \
-	| c4x | c8051 | clipper \
-	| d10v | d30v | dlx | dsp16xx \
-	| epiphany \
-	| fido | fr30 | frv \
-	| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
-	| hexagon \
-	| i370 | i860 | i960 | ia64 \
-	| ip2k | iq2000 \
-	| k1om \
-	| le32 | le64 \
-	| lm32 \
-	| m32c | m32r | m32rle | m68000 | m68k | m88k \
-	| maxq | mb | microblaze | microblazeel | mcore | mep | metag \
-	| mips | mipsbe | mipseb | mipsel | mipsle \
-	| mips16 \
-	| mips64 | mips64el \
-	| mips64octeon | mips64octeonel \
-	| mips64orion | mips64orionel \
-	| mips64r5900 | mips64r5900el \
-	| mips64vr | mips64vrel \
-	| mips64vr4100 | mips64vr4100el \
-	| mips64vr4300 | mips64vr4300el \
-	| mips64vr5000 | mips64vr5000el \
-	| mips64vr5900 | mips64vr5900el \
-	| mipsisa32 | mipsisa32el \
-	| mipsisa32r2 | mipsisa32r2el \
-	| mipsisa64 | mipsisa64el \
-	| mipsisa64r2 | mipsisa64r2el \
-	| mipsisa64sb1 | mipsisa64sb1el \
-	| mipsisa64sr71k | mipsisa64sr71kel \
-	| mipsr5900 | mipsr5900el \
-	| mipstx39 | mipstx39el \
-	| mn10200 | mn10300 \
-	| moxie \
-	| mt \
-	| msp430 \
-	| nds32 | nds32le | nds32be \
-	| nios | nios2 | nios2eb | nios2el \
-	| ns16k | ns32k \
-	| open8 \
-	| or1k | or32 \
-	| pdp10 | pdp11 | pj | pjl \
-	| powerpc | powerpc64 | powerpc64le | powerpcle \
-	| pyramid \
-	| rl78 | rx \
-	| score \
-	| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
-	| sh64 | sh64le \
-	| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
-	| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
-	| spu \
-	| tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
-	| ubicom32 \
-	| v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
-	| we32k \
-	| x86 | xc16x | xstormy16 | xtensa \
-	| z8k | z80)
-		basic_machine=$basic_machine-unknown
-		;;
-	c54x)
-		basic_machine=tic54x-unknown
-		;;
-	c55x)
-		basic_machine=tic55x-unknown
-		;;
-	c6x)
-		basic_machine=tic6x-unknown
-		;;
-	m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip)
-		basic_machine=$basic_machine-unknown
-		os=-none
-		;;
-	m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
-		;;
-	ms1)
-		basic_machine=mt-unknown
-		;;
-
-	strongarm | thumb | xscale)
-		basic_machine=arm-unknown
-		;;
-	xgate)
-		basic_machine=$basic_machine-unknown
-		os=-none
-		;;
-	xscaleeb)
-		basic_machine=armeb-unknown
-		;;
-
-	xscaleel)
-		basic_machine=armel-unknown
-		;;
-
-	# We use `pc' rather than `unknown'
-	# because (1) that's what they normally are, and
-	# (2) the word "unknown" tends to confuse beginning users.
-	i*86 | x86_64)
-	  basic_machine=$basic_machine-pc
-	  ;;
-	# Object if more than one company name word.
-	*-*-*)
-		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
-		exit 1
-		;;
-	# Recognize the basic CPU types with company name.
-	580-* \
-	| a29k-* \
-	| aarch64-* | aarch64_be-* \
-	| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
-	| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
-	| alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
-	| arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
-	| avr-* | avr32-* \
-	| be32-* | be64-* \
-	| bfin-* | bs2000-* \
-	| c[123]* | c30-* | [cjt]90-* | c4x-* \
-	| c8051-* | clipper-* | craynv-* | cydra-* \
-	| d10v-* | d30v-* | dlx-* \
-	| elxsi-* \
-	| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
-	| h8300-* | h8500-* \
-	| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
-	| hexagon-* \
-	| i*86-* | i860-* | i960-* | ia64-* \
-	| ip2k-* | iq2000-* \
-	| k1om-* \
-	| le32-* | le64-* \
-	| lm32-* \
-	| m32c-* | m32r-* | m32rle-* \
-	| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
-	| m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
-	| microblaze-* | microblazeel-* \
-	| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
-	| mips16-* \
-	| mips64-* | mips64el-* \
-	| mips64octeon-* | mips64octeonel-* \
-	| mips64orion-* | mips64orionel-* \
-	| mips64r5900-* | mips64r5900el-* \
-	| mips64vr-* | mips64vrel-* \
-	| mips64vr4100-* | mips64vr4100el-* \
-	| mips64vr4300-* | mips64vr4300el-* \
-	| mips64vr5000-* | mips64vr5000el-* \
-	| mips64vr5900-* | mips64vr5900el-* \
-	| mipsisa32-* | mipsisa32el-* \
-	| mipsisa32r2-* | mipsisa32r2el-* \
-	| mipsisa64-* | mipsisa64el-* \
-	| mipsisa64r2-* | mipsisa64r2el-* \
-	| mipsisa64sb1-* | mipsisa64sb1el-* \
-	| mipsisa64sr71k-* | mipsisa64sr71kel-* \
-	| mipsr5900-* | mipsr5900el-* \
-	| mipstx39-* | mipstx39el-* \
-	| mmix-* \
-	| mt-* \
-	| msp430-* \
-	| nds32-* | nds32le-* | nds32be-* \
-	| nios-* | nios2-* | nios2eb-* | nios2el-* \
-	| none-* | np1-* | ns16k-* | ns32k-* \
-	| open8-* \
-	| orion-* \
-	| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
-	| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
-	| pyramid-* \
-	| rl78-* | romp-* | rs6000-* | rx-* \
-	| sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
-	| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
-	| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
-	| sparclite-* \
-	| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \
-	| tahoe-* \
-	| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
-	| tile*-* \
-	| tron-* \
-	| ubicom32-* \
-	| v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
-	| vax-* \
-	| we32k-* \
-	| x86-* | x86_64-* | xc16x-* | xps100-* \
-	| xstormy16-* | xtensa*-* \
-	| ymp-* \
-	| z8k-* | z80-*)
-		;;
-	# Recognize the basic CPU types without company name, with glob match.
-	xtensa*)
-		basic_machine=$basic_machine-unknown
-		;;
-	# Recognize the various machine names and aliases which stand
-	# for a CPU type and a company and sometimes even an OS.
-	386bsd)
-		basic_machine=i386-unknown
-		os=-bsd
-		;;
-	3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
-		basic_machine=m68000-att
-		;;
-	3b*)
-		basic_machine=we32k-att
-		;;
-	a29khif)
-		basic_machine=a29k-amd
-		os=-udi
-		;;
-	abacus)
-		basic_machine=abacus-unknown
-		;;
-	adobe68k)
-		basic_machine=m68010-adobe
-		os=-scout
-		;;
-	alliant | fx80)
-		basic_machine=fx80-alliant
-		;;
-	altos | altos3068)
-		basic_machine=m68k-altos
-		;;
-	am29k)
-		basic_machine=a29k-none
-		os=-bsd
-		;;
-	amd64)
-		basic_machine=x86_64-pc
-		;;
-	amd64-*)
-		basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
-		;;
-	amdahl)
-		basic_machine=580-amdahl
-		os=-sysv
-		;;
-	amiga | amiga-*)
-		basic_machine=m68k-unknown
-		;;
-	amigaos | amigados)
-		basic_machine=m68k-unknown
-		os=-amigaos
-		;;
-	amigaunix | amix)
-		basic_machine=m68k-unknown
-		os=-sysv4
-		;;
-	apollo68)
-		basic_machine=m68k-apollo
-		os=-sysv
-		;;
-	apollo68bsd)
-		basic_machine=m68k-apollo
-		os=-bsd
-		;;
-	aros)
-		basic_machine=i386-pc
-		os=-aros
-		;;
-	aux)
-		basic_machine=m68k-apple
-		os=-aux
-		;;
-	balance)
-		basic_machine=ns32k-sequent
-		os=-dynix
-		;;
-	blackfin)
-		basic_machine=bfin-unknown
-		os=-linux
-		;;
-	blackfin-*)
-		basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
-		os=-linux
-		;;
-	bluegene*)
-		basic_machine=powerpc-ibm
-		os=-cnk
-		;;
-	c54x-*)
-		basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
-		;;
-	c55x-*)
-		basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
-		;;
-	c6x-*)
-		basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
-		;;
-	c90)
-		basic_machine=c90-cray
-		os=-unicos
-		;;
-	cegcc)
-		basic_machine=arm-unknown
-		os=-cegcc
-		;;
-	convex-c1)
-		basic_machine=c1-convex
-		os=-bsd
-		;;
-	convex-c2)
-		basic_machine=c2-convex
-		os=-bsd
-		;;
-	convex-c32)
-		basic_machine=c32-convex
-		os=-bsd
-		;;
-	convex-c34)
-		basic_machine=c34-convex
-		os=-bsd
-		;;
-	convex-c38)
-		basic_machine=c38-convex
-		os=-bsd
-		;;
-	cray | j90)
-		basic_machine=j90-cray
-		os=-unicos
-		;;
-	craynv)
-		basic_machine=craynv-cray
-		os=-unicosmp
-		;;
-	cr16 | cr16-*)
-		basic_machine=cr16-unknown
-		os=-elf
-		;;
-	crds | unos)
-		basic_machine=m68k-crds
-		;;
-	crisv32 | crisv32-* | etraxfs*)
-		basic_machine=crisv32-axis
-		;;
-	cris | cris-* | etrax*)
-		basic_machine=cris-axis
-		;;
-	crx)
-		basic_machine=crx-unknown
-		os=-elf
-		;;
-	da30 | da30-*)
-		basic_machine=m68k-da30
-		;;
-	decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
-		basic_machine=mips-dec
-		;;
-	decsystem10* | dec10*)
-		basic_machine=pdp10-dec
-		os=-tops10
-		;;
-	decsystem20* | dec20*)
-		basic_machine=pdp10-dec
-		os=-tops20
-		;;
-	delta | 3300 | motorola-3300 | motorola-delta \
-	      | 3300-motorola | delta-motorola)
-		basic_machine=m68k-motorola
-		;;
-	delta88)
-		basic_machine=m88k-motorola
-		os=-sysv3
-		;;
-	dicos)
-		basic_machine=i686-pc
-		os=-dicos
-		;;
-	djgpp)
-		basic_machine=i586-pc
-		os=-msdosdjgpp
-		;;
-	dpx20 | dpx20-*)
-		basic_machine=rs6000-bull
-		os=-bosx
-		;;
-	dpx2* | dpx2*-bull)
-		basic_machine=m68k-bull
-		os=-sysv3
-		;;
-	ebmon29k)
-		basic_machine=a29k-amd
-		os=-ebmon
-		;;
-	elxsi)
-		basic_machine=elxsi-elxsi
-		os=-bsd
-		;;
-	encore | umax | mmax)
-		basic_machine=ns32k-encore
-		;;
-	es1800 | OSE68k | ose68k | ose | OSE)
-		basic_machine=m68k-ericsson
-		os=-ose
-		;;
-	fx2800)
-		basic_machine=i860-alliant
-		;;
-	genix)
-		basic_machine=ns32k-ns
-		;;
-	gmicro)
-		basic_machine=tron-gmicro
-		os=-sysv
-		;;
-	go32)
-		basic_machine=i386-pc
-		os=-go32
-		;;
-	h3050r* | hiux*)
-		basic_machine=hppa1.1-hitachi
-		os=-hiuxwe2
-		;;
-	h8300hms)
-		basic_machine=h8300-hitachi
-		os=-hms
-		;;
-	h8300xray)
-		basic_machine=h8300-hitachi
-		os=-xray
-		;;
-	h8500hms)
-		basic_machine=h8500-hitachi
-		os=-hms
-		;;
-	harris)
-		basic_machine=m88k-harris
-		os=-sysv3
-		;;
-	hp300-*)
-		basic_machine=m68k-hp
-		;;
-	hp300bsd)
-		basic_machine=m68k-hp
-		os=-bsd
-		;;
-	hp300hpux)
-		basic_machine=m68k-hp
-		os=-hpux
-		;;
-	hp3k9[0-9][0-9] | hp9[0-9][0-9])
-		basic_machine=hppa1.0-hp
-		;;
-	hp9k2[0-9][0-9] | hp9k31[0-9])
-		basic_machine=m68000-hp
-		;;
-	hp9k3[2-9][0-9])
-		basic_machine=m68k-hp
-		;;
-	hp9k6[0-9][0-9] | hp6[0-9][0-9])
-		basic_machine=hppa1.0-hp
-		;;
-	hp9k7[0-79][0-9] | hp7[0-79][0-9])
-		basic_machine=hppa1.1-hp
-		;;
-	hp9k78[0-9] | hp78[0-9])
-		# FIXME: really hppa2.0-hp
-		basic_machine=hppa1.1-hp
-		;;
-	hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
-		# FIXME: really hppa2.0-hp
-		basic_machine=hppa1.1-hp
-		;;
-	hp9k8[0-9][13679] | hp8[0-9][13679])
-		basic_machine=hppa1.1-hp
-		;;
-	hp9k8[0-9][0-9] | hp8[0-9][0-9])
-		basic_machine=hppa1.0-hp
-		;;
-	hppa-next)
-		os=-nextstep3
-		;;
-	hppaosf)
-		basic_machine=hppa1.1-hp
-		os=-osf
-		;;
-	hppro)
-		basic_machine=hppa1.1-hp
-		os=-proelf
-		;;
-	i370-ibm* | ibm*)
-		basic_machine=i370-ibm
-		;;
-	i*86v32)
-		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
-		os=-sysv32
-		;;
-	i*86v4*)
-		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
-		os=-sysv4
-		;;
-	i*86v)
-		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
-		os=-sysv
-		;;
-	i*86sol2)
-		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
-		os=-solaris2
-		;;
-	i386mach)
-		basic_machine=i386-mach
-		os=-mach
-		;;
-	i386-vsta | vsta)
-		basic_machine=i386-unknown
-		os=-vsta
-		;;
-	iris | iris4d)
-		basic_machine=mips-sgi
-		case $os in
-		    -irix*)
-			;;
-		    *)
-			os=-irix4
-			;;
-		esac
-		;;
-	isi68 | isi)
-		basic_machine=m68k-isi
-		os=-sysv
-		;;
-	m68knommu)
-		basic_machine=m68k-unknown
-		os=-linux
-		;;
-	m68knommu-*)
-		basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
-		os=-linux
-		;;
-	m88k-omron*)
-		basic_machine=m88k-omron
-		;;
-	magnum | m3230)
-		basic_machine=mips-mips
-		os=-sysv
-		;;
-	merlin)
-		basic_machine=ns32k-utek
-		os=-sysv
-		;;
-	microblaze*)
-		basic_machine=microblaze-xilinx
-		;;
-	mingw64)
-		basic_machine=x86_64-pc
-		os=-mingw64
-		;;
-	mingw32)
-		basic_machine=i686-pc
-		os=-mingw32
-		;;
-	mingw32ce)
-		basic_machine=arm-unknown
-		os=-mingw32ce
-		;;
-	miniframe)
-		basic_machine=m68000-convergent
-		;;
-	*mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
-		basic_machine=m68k-atari
-		os=-mint
-		;;
-	mips3*-*)
-		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
-		;;
-	mips3*)
-		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
-		;;
-	monitor)
-		basic_machine=m68k-rom68k
-		os=-coff
-		;;
-	morphos)
-		basic_machine=powerpc-unknown
-		os=-morphos
-		;;
-	msdos)
-		basic_machine=i386-pc
-		os=-msdos
-		;;
-	ms1-*)
-		basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
-		;;
-	msys)
-		basic_machine=i686-pc
-		os=-msys
-		;;
-	mvs)
-		basic_machine=i370-ibm
-		os=-mvs
-		;;
-	nacl)
-		basic_machine=le32-unknown
-		os=-nacl
-		;;
-	ncr3000)
-		basic_machine=i486-ncr
-		os=-sysv4
-		;;
-	netbsd386)
-		basic_machine=i386-unknown
-		os=-netbsd
-		;;
-	netwinder)
-		basic_machine=armv4l-rebel
-		os=-linux
-		;;
-	news | news700 | news800 | news900)
-		basic_machine=m68k-sony
-		os=-newsos
-		;;
-	news1000)
-		basic_machine=m68030-sony
-		os=-newsos
-		;;
-	news-3600 | risc-news)
-		basic_machine=mips-sony
-		os=-newsos
-		;;
-	necv70)
-		basic_machine=v70-nec
-		os=-sysv
-		;;
-	next | m*-next )
-		basic_machine=m68k-next
-		case $os in
-		    -nextstep* )
-			;;
-		    -ns2*)
-		      os=-nextstep2
-			;;
-		    *)
-		      os=-nextstep3
-			;;
-		esac
-		;;
-	nh3000)
-		basic_machine=m68k-harris
-		os=-cxux
-		;;
-	nh[45]000)
-		basic_machine=m88k-harris
-		os=-cxux
-		;;
-	nindy960)
-		basic_machine=i960-intel
-		os=-nindy
-		;;
-	mon960)
-		basic_machine=i960-intel
-		os=-mon960
-		;;
-	nonstopux)
-		basic_machine=mips-compaq
-		os=-nonstopux
-		;;
-	np1)
-		basic_machine=np1-gould
-		;;
-	neo-tandem)
-		basic_machine=neo-tandem
-		;;
-	nse-tandem)
-		basic_machine=nse-tandem
-		;;
-	nsr-tandem)
-		basic_machine=nsr-tandem
-		;;
-	op50n-* | op60c-*)
-		basic_machine=hppa1.1-oki
-		os=-proelf
-		;;
-	openrisc | openrisc-*)
-		basic_machine=or32-unknown
-		;;
-	os400)
-		basic_machine=powerpc-ibm
-		os=-os400
-		;;
-	OSE68000 | ose68000)
-		basic_machine=m68000-ericsson
-		os=-ose
-		;;
-	os68k)
-		basic_machine=m68k-none
-		os=-os68k
-		;;
-	pa-hitachi)
-		basic_machine=hppa1.1-hitachi
-		os=-hiuxwe2
-		;;
-	paragon)
-		basic_machine=i860-intel
-		os=-osf
-		;;
-	parisc)
-		basic_machine=hppa-unknown
-		os=-linux
-		;;
-	parisc-*)
-		basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
-		os=-linux
-		;;
-	pbd)
-		basic_machine=sparc-tti
-		;;
-	pbb)
-		basic_machine=m68k-tti
-		;;
-	pc532 | pc532-*)
-		basic_machine=ns32k-pc532
-		;;
-	pc98)
-		basic_machine=i386-pc
-		;;
-	pc98-*)
-		basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
-		;;
-	pentium | p5 | k5 | k6 | nexgen | viac3)
-		basic_machine=i586-pc
-		;;
-	pentiumpro | p6 | 6x86 | athlon | athlon_*)
-		basic_machine=i686-pc
-		;;
-	pentiumii | pentium2 | pentiumiii | pentium3)
-		basic_machine=i686-pc
-		;;
-	pentium4)
-		basic_machine=i786-pc
-		;;
-	pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
-		basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
-		;;
-	pentiumpro-* | p6-* | 6x86-* | athlon-*)
-		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
-		;;
-	pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
-		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
-		;;
-	pentium4-*)
-		basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
-		;;
-	pn)
-		basic_machine=pn-gould
-		;;
-	power)	basic_machine=power-ibm
-		;;
-	ppc | ppcbe)	basic_machine=powerpc-unknown
-		;;
-	ppc-* | ppcbe-*)
-		basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
-		;;
-	ppcle | powerpclittle | ppc-le | powerpc-little)
-		basic_machine=powerpcle-unknown
-		;;
-	ppcle-* | powerpclittle-*)
-		basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
-		;;
-	ppc64)	basic_machine=powerpc64-unknown
-		;;
-	ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
-		;;
-	ppc64le | powerpc64little | ppc64-le | powerpc64-little)
-		basic_machine=powerpc64le-unknown
-		;;
-	ppc64le-* | powerpc64little-*)
-		basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
-		;;
-	ps2)
-		basic_machine=i386-ibm
-		;;
-	pw32)
-		basic_machine=i586-unknown
-		os=-pw32
-		;;
-	rdos | rdos64)
-		basic_machine=x86_64-pc
-		os=-rdos
-		;;
-	rdos32)
-		basic_machine=i386-pc
-		os=-rdos
-		;;
-	rom68k)
-		basic_machine=m68k-rom68k
-		os=-coff
-		;;
-	rm[46]00)
-		basic_machine=mips-siemens
-		;;
-	rtpc | rtpc-*)
-		basic_machine=romp-ibm
-		;;
-	s390 | s390-*)
-		basic_machine=s390-ibm
-		;;
-	s390x | s390x-*)
-		basic_machine=s390x-ibm
-		;;
-	sa29200)
-		basic_machine=a29k-amd
-		os=-udi
-		;;
-	sb1)
-		basic_machine=mipsisa64sb1-unknown
-		;;
-	sb1el)
-		basic_machine=mipsisa64sb1el-unknown
-		;;
-	sde)
-		basic_machine=mipsisa32-sde
-		os=-elf
-		;;
-	sei)
-		basic_machine=mips-sei
-		os=-seiux
-		;;
-	sequent)
-		basic_machine=i386-sequent
-		;;
-	sh)
-		basic_machine=sh-hitachi
-		os=-hms
-		;;
-	sh5el)
-		basic_machine=sh5le-unknown
-		;;
-	sh64)
-		basic_machine=sh64-unknown
-		;;
-	sparclite-wrs | simso-wrs)
-		basic_machine=sparclite-wrs
-		os=-vxworks
-		;;
-	sps7)
-		basic_machine=m68k-bull
-		os=-sysv2
-		;;
-	spur)
-		basic_machine=spur-unknown
-		;;
-	st2000)
-		basic_machine=m68k-tandem
-		;;
-	stratus)
-		basic_machine=i860-stratus
-		os=-sysv4
-		;;
-	strongarm-* | thumb-*)
-		basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`
-		;;
-	sun2)
-		basic_machine=m68000-sun
-		;;
-	sun2os3)
-		basic_machine=m68000-sun
-		os=-sunos3
-		;;
-	sun2os4)
-		basic_machine=m68000-sun
-		os=-sunos4
-		;;
-	sun3os3)
-		basic_machine=m68k-sun
-		os=-sunos3
-		;;
-	sun3os4)
-		basic_machine=m68k-sun
-		os=-sunos4
-		;;
-	sun4os3)
-		basic_machine=sparc-sun
-		os=-sunos3
-		;;
-	sun4os4)
-		basic_machine=sparc-sun
-		os=-sunos4
-		;;
-	sun4sol2)
-		basic_machine=sparc-sun
-		os=-solaris2
-		;;
-	sun3 | sun3-*)
-		basic_machine=m68k-sun
-		;;
-	sun4)
-		basic_machine=sparc-sun
-		;;
-	sun386 | sun386i | roadrunner)
-		basic_machine=i386-sun
-		;;
-	sv1)
-		basic_machine=sv1-cray
-		os=-unicos
-		;;
-	symmetry)
-		basic_machine=i386-sequent
-		os=-dynix
-		;;
-	t3e)
-		basic_machine=alphaev5-cray
-		os=-unicos
-		;;
-	t90)
-		basic_machine=t90-cray
-		os=-unicos
-		;;
-	tile*)
-		basic_machine=$basic_machine-unknown
-		os=-linux-gnu
-		;;
-	tx39)
-		basic_machine=mipstx39-unknown
-		;;
-	tx39el)
-		basic_machine=mipstx39el-unknown
-		;;
-	toad1)
-		basic_machine=pdp10-xkl
-		os=-tops20
-		;;
-	tower | tower-32)
-		basic_machine=m68k-ncr
-		;;
-	tpf)
-		basic_machine=s390x-ibm
-		os=-tpf
-		;;
-	udi29k)
-		basic_machine=a29k-amd
-		os=-udi
-		;;
-	ultra3)
-		basic_machine=a29k-nyu
-		os=-sym1
-		;;
-	v810 | necv810)
-		basic_machine=v810-nec
-		os=-none
-		;;
-	vaxv)
-		basic_machine=vax-dec
-		os=-sysv
-		;;
-	vms)
-		basic_machine=vax-dec
-		os=-vms
-		;;
-	vpp*|vx|vx-*)
-		basic_machine=f301-fujitsu
-		;;
-	vxworks960)
-		basic_machine=i960-wrs
-		os=-vxworks
-		;;
-	vxworks68)
-		basic_machine=m68k-wrs
-		os=-vxworks
-		;;
-	vxworks29k)
-		basic_machine=a29k-wrs
-		os=-vxworks
-		;;
-	w65*)
-		basic_machine=w65-wdc
-		os=-none
-		;;
-	w89k-*)
-		basic_machine=hppa1.1-winbond
-		os=-proelf
-		;;
-	xbox)
-		basic_machine=i686-pc
-		os=-mingw32
-		;;
-	xps | xps100)
-		basic_machine=xps100-honeywell
-		;;
-	xscale-* | xscalee[bl]-*)
-		basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`
-		;;
-	ymp)
-		basic_machine=ymp-cray
-		os=-unicos
-		;;
-	z8k-*-coff)
-		basic_machine=z8k-unknown
-		os=-sim
-		;;
-	z80-*-coff)
-		basic_machine=z80-unknown
-		os=-sim
-		;;
-	none)
-		basic_machine=none-none
-		os=-none
-		;;
-
-# Here we handle the default manufacturer of certain CPU types.  It is in
-# some cases the only manufacturer, in others, it is the most popular.
-	w89k)
-		basic_machine=hppa1.1-winbond
-		;;
-	op50n)
-		basic_machine=hppa1.1-oki
-		;;
-	op60c)
-		basic_machine=hppa1.1-oki
-		;;
-	romp)
-		basic_machine=romp-ibm
-		;;
-	mmix)
-		basic_machine=mmix-knuth
-		;;
-	rs6000)
-		basic_machine=rs6000-ibm
-		;;
-	vax)
-		basic_machine=vax-dec
-		;;
-	pdp10)
-		# there are many clones, so DEC is not a safe bet
-		basic_machine=pdp10-unknown
-		;;
-	pdp11)
-		basic_machine=pdp11-dec
-		;;
-	we32k)
-		basic_machine=we32k-att
-		;;
-	sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
-		basic_machine=sh-unknown
-		;;
-	sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
-		basic_machine=sparc-sun
-		;;
-	cydra)
-		basic_machine=cydra-cydrome
-		;;
-	orion)
-		basic_machine=orion-highlevel
-		;;
-	orion105)
-		basic_machine=clipper-highlevel
-		;;
-	mac | mpw | mac-mpw)
-		basic_machine=m68k-apple
-		;;
-	pmac | pmac-mpw)
-		basic_machine=powerpc-apple
-		;;
-	*-unknown)
-		# Make sure to match an already-canonicalized machine name.
-		;;
-	*)
-		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
-		exit 1
-		;;
-esac
-
-# Here we canonicalize certain aliases for manufacturers.
-case $basic_machine in
-	*-digital*)
-		basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
-		;;
-	*-commodore*)
-		basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
-		;;
-	*)
-		;;
-esac
-
-# Decode manufacturer-specific aliases for certain operating systems.
-
-if [ x"$os" != x"" ]
-then
-case $os in
-	# First match some system type aliases
-	# that might get confused with valid system types.
-	# -solaris* is a basic system type, with this one exception.
-	-auroraux)
-		os=-auroraux
-		;;
-	-solaris1 | -solaris1.*)
-		os=`echo $os | sed -e 's|solaris1|sunos4|'`
-		;;
-	-solaris)
-		os=-solaris2
-		;;
-	-svr4*)
-		os=-sysv4
-		;;
-	-unixware*)
-		os=-sysv4.2uw
-		;;
-	-gnu/linux*)
-		os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
-		;;
-	# First accept the basic system types.
-	# The portable systems comes first.
-	# Each alternative MUST END IN A *, to match a version number.
-	# -sysv* is not here because it comes later, after sysvr4.
-	-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
-	      | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
-	      | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
-	      | -sym* | -kopensolaris* | -plan9* \
-	      | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
-	      | -aos* | -aros* \
-	      | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
-	      | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
-	      | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
-	      | -bitrig* | -openbsd* | -solidbsd* \
-	      | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
-	      | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
-	      | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
-	      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
-	      | -chorusos* | -chorusrdb* | -cegcc* \
-	      | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
-	      | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
-	      | -linux-newlib* | -linux-musl* | -linux-uclibc* \
-	      | -uxpv* | -beos* | -mpeix* | -udk* \
-	      | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
-	      | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
-	      | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
-	      | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
-	      | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
-	      | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
-	      | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*)
-	# Remember, each alternative MUST END IN *, to match a version number.
-		;;
-	-qnx*)
-		case $basic_machine in
-		    x86-* | i*86-*)
-			;;
-		    *)
-			os=-nto$os
-			;;
-		esac
-		;;
-	-nto-qnx*)
-		;;
-	-nto*)
-		os=`echo $os | sed -e 's|nto|nto-qnx|'`
-		;;
-	-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
-	      | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
-	      | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
-		;;
-	-mac*)
-		os=`echo $os | sed -e 's|mac|macos|'`
-		;;
-	-linux-dietlibc)
-		os=-linux-dietlibc
-		;;
-	-linux*)
-		os=`echo $os | sed -e 's|linux|linux-gnu|'`
-		;;
-	-sunos5*)
-		os=`echo $os | sed -e 's|sunos5|solaris2|'`
-		;;
-	-sunos6*)
-		os=`echo $os | sed -e 's|sunos6|solaris3|'`
-		;;
-	-opened*)
-		os=-openedition
-		;;
-	-os400*)
-		os=-os400
-		;;
-	-wince*)
-		os=-wince
-		;;
-	-osfrose*)
-		os=-osfrose
-		;;
-	-osf*)
-		os=-osf
-		;;
-	-utek*)
-		os=-bsd
-		;;
-	-dynix*)
-		os=-bsd
-		;;
-	-acis*)
-		os=-aos
-		;;
-	-atheos*)
-		os=-atheos
-		;;
-	-syllable*)
-		os=-syllable
-		;;
-	-386bsd)
-		os=-bsd
-		;;
-	-ctix* | -uts*)
-		os=-sysv
-		;;
-	-nova*)
-		os=-rtmk-nova
-		;;
-	-ns2 )
-		os=-nextstep2
-		;;
-	-nsk*)
-		os=-nsk
-		;;
-	# Preserve the version number of sinix5.
-	-sinix5.*)
-		os=`echo $os | sed -e 's|sinix|sysv|'`
-		;;
-	-sinix*)
-		os=-sysv4
-		;;
-	-tpf*)
-		os=-tpf
-		;;
-	-triton*)
-		os=-sysv3
-		;;
-	-oss*)
-		os=-sysv3
-		;;
-	-svr4)
-		os=-sysv4
-		;;
-	-svr3)
-		os=-sysv3
-		;;
-	-sysvr4)
-		os=-sysv4
-		;;
-	# This must come after -sysvr4.
-	-sysv*)
-		;;
-	-ose*)
-		os=-ose
-		;;
-	-es1800*)
-		os=-ose
-		;;
-	-xenix)
-		os=-xenix
-		;;
-	-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
-		os=-mint
-		;;
-	-aros*)
-		os=-aros
-		;;
-	-zvmoe)
-		os=-zvmoe
-		;;
-	-dicos*)
-		os=-dicos
-		;;
-	-nacl*)
-		;;
-	-none)
-		;;
-	*)
-		# Get rid of the `-' at the beginning of $os.
-		os=`echo $os | sed 's/[^-]*-//'`
-		echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
-		exit 1
-		;;
-esac
-else
-
-# Here we handle the default operating systems that come with various machines.
-# The value should be what the vendor currently ships out the door with their
-# machine or put another way, the most popular os provided with the machine.
-
-# Note that if you're going to try to match "-MANUFACTURER" here (say,
-# "-sun"), then you have to tell the case statement up towards the top
-# that MANUFACTURER isn't an operating system.  Otherwise, code above
-# will signal an error saying that MANUFACTURER isn't an operating
-# system, and we'll never get to this point.
-
-case $basic_machine in
-	score-*)
-		os=-elf
-		;;
-	spu-*)
-		os=-elf
-		;;
-	*-acorn)
-		os=-riscix1.2
-		;;
-	arm*-rebel)
-		os=-linux
-		;;
-	arm*-semi)
-		os=-aout
-		;;
-	c4x-* | tic4x-*)
-		os=-coff
-		;;
-	c8051-*)
-		os=-elf
-		;;
-	hexagon-*)
-		os=-elf
-		;;
-	tic54x-*)
-		os=-coff
-		;;
-	tic55x-*)
-		os=-coff
-		;;
-	tic6x-*)
-		os=-coff
-		;;
-	# This must come before the *-dec entry.
-	pdp10-*)
-		os=-tops20
-		;;
-	pdp11-*)
-		os=-none
-		;;
-	*-dec | vax-*)
-		os=-ultrix4.2
-		;;
-	m68*-apollo)
-		os=-domain
-		;;
-	i386-sun)
-		os=-sunos4.0.2
-		;;
-	m68000-sun)
-		os=-sunos3
-		;;
-	m68*-cisco)
-		os=-aout
-		;;
-	mep-*)
-		os=-elf
-		;;
-	mips*-cisco)
-		os=-elf
-		;;
-	mips*-*)
-		os=-elf
-		;;
-	or1k-*)
-		os=-elf
-		;;
-	or32-*)
-		os=-coff
-		;;
-	*-tti)	# must be before sparc entry or we get the wrong os.
-		os=-sysv3
-		;;
-	sparc-* | *-sun)
-		os=-sunos4.1.1
-		;;
-	*-be)
-		os=-beos
-		;;
-	*-haiku)
-		os=-haiku
-		;;
-	*-ibm)
-		os=-aix
-		;;
-	*-knuth)
-		os=-mmixware
-		;;
-	*-wec)
-		os=-proelf
-		;;
-	*-winbond)
-		os=-proelf
-		;;
-	*-oki)
-		os=-proelf
-		;;
-	*-hp)
-		os=-hpux
-		;;
-	*-hitachi)
-		os=-hiux
-		;;
-	i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
-		os=-sysv
-		;;
-	*-cbm)
-		os=-amigaos
-		;;
-	*-dg)
-		os=-dgux
-		;;
-	*-dolphin)
-		os=-sysv3
-		;;
-	m68k-ccur)
-		os=-rtu
-		;;
-	m88k-omron*)
-		os=-luna
-		;;
-	*-next )
-		os=-nextstep
-		;;
-	*-sequent)
-		os=-ptx
-		;;
-	*-crds)
-		os=-unos
-		;;
-	*-ns)
-		os=-genix
-		;;
-	i370-*)
-		os=-mvs
-		;;
-	*-next)
-		os=-nextstep3
-		;;
-	*-gould)
-		os=-sysv
-		;;
-	*-highlevel)
-		os=-bsd
-		;;
-	*-encore)
-		os=-bsd
-		;;
-	*-sgi)
-		os=-irix
-		;;
-	*-siemens)
-		os=-sysv4
-		;;
-	*-masscomp)
-		os=-rtu
-		;;
-	f30[01]-fujitsu | f700-fujitsu)
-		os=-uxpv
-		;;
-	*-rom68k)
-		os=-coff
-		;;
-	*-*bug)
-		os=-coff
-		;;
-	*-apple)
-		os=-macos
-		;;
-	*-atari*)
-		os=-mint
-		;;
-	*)
-		os=-none
-		;;
-esac
-fi
-
-# Here we handle the case where we know the os, and the CPU type, but not the
-# manufacturer.  We pick the logical manufacturer.
-vendor=unknown
-case $basic_machine in
-	*-unknown)
-		case $os in
-			-riscix*)
-				vendor=acorn
-				;;
-			-sunos*)
-				vendor=sun
-				;;
-			-cnk*|-aix*)
-				vendor=ibm
-				;;
-			-beos*)
-				vendor=be
-				;;
-			-hpux*)
-				vendor=hp
-				;;
-			-mpeix*)
-				vendor=hp
-				;;
-			-hiux*)
-				vendor=hitachi
-				;;
-			-unos*)
-				vendor=crds
-				;;
-			-dgux*)
-				vendor=dg
-				;;
-			-luna*)
-				vendor=omron
-				;;
-			-genix*)
-				vendor=ns
-				;;
-			-mvs* | -opened*)
-				vendor=ibm
-				;;
-			-os400*)
-				vendor=ibm
-				;;
-			-ptx*)
-				vendor=sequent
-				;;
-			-tpf*)
-				vendor=ibm
-				;;
-			-vxsim* | -vxworks* | -windiss*)
-				vendor=wrs
-				;;
-			-aux*)
-				vendor=apple
-				;;
-			-hms*)
-				vendor=hitachi
-				;;
-			-mpw* | -macos*)
-				vendor=apple
-				;;
-			-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
-				vendor=atari
-				;;
-			-vos*)
-				vendor=stratus
-				;;
-		esac
-		basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
-		;;
-esac
-
-echo $basic_machine$os
-exit
-
-# Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "timestamp='"
-# time-stamp-format: "%:y-%02m-%02d"
-# time-stamp-end: "'"
-# End:
diff --git a/configure b/configure
deleted file mode 100755
index 9fab747..0000000
--- a/configure
+++ /dev/null
@@ -1,17705 +0,0 @@
-#! /bin/sh
-# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for mbsystem 5.5.2252.
-#
-# Report bugs to <http://listserver.mbari.org/sympa/arc/mbsystem>.
-#
-#
-# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
-#
-#
-# This configure script is free software; the Free Software Foundation
-# gives unlimited permission to copy, distribute and modify it.
-## -------------------- ##
-## M4sh Initialization. ##
-## -------------------- ##
-
-# Be more Bourne compatible
-DUALCASE=1; export DUALCASE # for MKS sh
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
-  emulate sh
-  NULLCMD=:
-  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
-  # is contrary to our usage.  Disable this feature.
-  alias -g '${1+"$@"}'='"$@"'
-  setopt NO_GLOB_SUBST
-else
-  case `(set -o) 2>/dev/null` in #(
-  *posix*) :
-    set -o posix ;; #(
-  *) :
-     ;;
-esac
-fi
-
-
-as_nl='
-'
-export as_nl
-# Printing a long string crashes Solaris 7 /usr/bin/printf.
-as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
-# Prefer a ksh shell builtin over an external printf program on Solaris,
-# but without wasting forks for bash or zsh.
-if test -z "$BASH_VERSION$ZSH_VERSION" \
-    && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
-  as_echo='print -r --'
-  as_echo_n='print -rn --'
-elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
-  as_echo='printf %s\n'
-  as_echo_n='printf %s'
-else
-  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
-    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
-    as_echo_n='/usr/ucb/echo -n'
-  else
-    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
-    as_echo_n_body='eval
-      arg=$1;
-      case $arg in #(
-      *"$as_nl"*)
-	expr "X$arg" : "X\\(.*\\)$as_nl";
-	arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
-      esac;
-      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
-    '
-    export as_echo_n_body
-    as_echo_n='sh -c $as_echo_n_body as_echo'
-  fi
-  export as_echo_body
-  as_echo='sh -c $as_echo_body as_echo'
-fi
-
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
-  PATH_SEPARATOR=:
-  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
-    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
-      PATH_SEPARATOR=';'
-  }
-fi
-
-
-# IFS
-# We need space, tab and new line, in precisely that order.  Quoting is
-# there to prevent editors from complaining about space-tab.
-# (If _AS_PATH_WALK were called with IFS unset, it would disable word
-# splitting by setting IFS to empty value.)
-IFS=" ""	$as_nl"
-
-# Find who we are.  Look in the path if we contain no directory separator.
-as_myself=
-case $0 in #((
-  *[\\/]* ) as_myself=$0 ;;
-  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
-  done
-IFS=$as_save_IFS
-
-     ;;
-esac
-# We did not find ourselves, most probably we were run as `sh COMMAND'
-# in which case we are not to be found in the path.
-if test "x$as_myself" = x; then
-  as_myself=$0
-fi
-if test ! -f "$as_myself"; then
-  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
-  exit 1
-fi
-
-# Unset variables that we do not need and which cause bugs (e.g. in
-# pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the "|| exit 1"
-# suppresses any "Segmentation fault" message there.  '((' could
-# trigger a bug in pdksh 5.2.14.
-for as_var in BASH_ENV ENV MAIL MAILPATH
-do eval test x\${$as_var+set} = xset \
-  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
-done
-PS1='$ '
-PS2='> '
-PS4='+ '
-
-# NLS nuisances.
-LC_ALL=C
-export LC_ALL
-LANGUAGE=C
-export LANGUAGE
-
-# CDPATH.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-# Use a proper internal environment variable to ensure we don't fall
-  # into an infinite loop, continuously re-executing ourselves.
-  if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then
-    _as_can_reexec=no; export _as_can_reexec;
-    # We cannot yet assume a decent shell, so we have to provide a
-# neutralization value for shells without unset; and this also
-# works around shells that cannot unset nonexistent variables.
-# Preserve -v and -x to the replacement shell.
-BASH_ENV=/dev/null
-ENV=/dev/null
-(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
-case $- in # ((((
-  *v*x* | *x*v* ) as_opts=-vx ;;
-  *v* ) as_opts=-v ;;
-  *x* ) as_opts=-x ;;
-  * ) as_opts= ;;
-esac
-exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
-# Admittedly, this is quite paranoid, since all the known shells bail
-# out after a failed `exec'.
-$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
-as_fn_exit 255
-  fi
-  # We don't want this to propagate to other subprocesses.
-          { _as_can_reexec=; unset _as_can_reexec;}
-if test "x$CONFIG_SHELL" = x; then
-  as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
-  emulate sh
-  NULLCMD=:
-  # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
-  # is contrary to our usage.  Disable this feature.
-  alias -g '\${1+\"\$@\"}'='\"\$@\"'
-  setopt NO_GLOB_SUBST
-else
-  case \`(set -o) 2>/dev/null\` in #(
-  *posix*) :
-    set -o posix ;; #(
-  *) :
-     ;;
-esac
-fi
-"
-  as_required="as_fn_return () { (exit \$1); }
-as_fn_success () { as_fn_return 0; }
-as_fn_failure () { as_fn_return 1; }
-as_fn_ret_success () { return 0; }
-as_fn_ret_failure () { return 1; }
-
-exitcode=0
-as_fn_success || { exitcode=1; echo as_fn_success failed.; }
-as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
-as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
-as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
-if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
-
-else
-  exitcode=1; echo positional parameters were not saved.
-fi
-test x\$exitcode = x0 || exit 1
-test -x / || exit 1"
-  as_suggested="  as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
-  as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
-  eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
-  test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1
-
-  test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || (
-    ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
-    ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO
-    ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO
-    PATH=/empty FPATH=/empty; export PATH FPATH
-    test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\
-      || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1
-test \$(( 1 + 1 )) = 2 || exit 1"
-  if (eval "$as_required") 2>/dev/null; then :
-  as_have_required=yes
-else
-  as_have_required=no
-fi
-  if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :
-
-else
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-as_found=false
-for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  as_found=:
-  case $as_dir in #(
-	 /*)
-	   for as_base in sh bash ksh sh5; do
-	     # Try only shells that exist, to save several forks.
-	     as_shell=$as_dir/$as_base
-	     if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
-		    { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
-  CONFIG_SHELL=$as_shell as_have_required=yes
-		   if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
-  break 2
-fi
-fi
-	   done;;
-       esac
-  as_found=false
-done
-$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
-	      { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
-  CONFIG_SHELL=$SHELL as_have_required=yes
-fi; }
-IFS=$as_save_IFS
-
-
-      if test "x$CONFIG_SHELL" != x; then :
-  export CONFIG_SHELL
-             # We cannot yet assume a decent shell, so we have to provide a
-# neutralization value for shells without unset; and this also
-# works around shells that cannot unset nonexistent variables.
-# Preserve -v and -x to the replacement shell.
-BASH_ENV=/dev/null
-ENV=/dev/null
-(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
-case $- in # ((((
-  *v*x* | *x*v* ) as_opts=-vx ;;
-  *v* ) as_opts=-v ;;
-  *x* ) as_opts=-x ;;
-  * ) as_opts= ;;
-esac
-exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
-# Admittedly, this is quite paranoid, since all the known shells bail
-# out after a failed `exec'.
-$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
-exit 255
-fi
-
-    if test x$as_have_required = xno; then :
-  $as_echo "$0: This script requires a shell more modern than all"
-  $as_echo "$0: the shells that I found on your system."
-  if test x${ZSH_VERSION+set} = xset ; then
-    $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
-    $as_echo "$0: be upgraded to zsh 4.3.4 or later."
-  else
-    $as_echo "$0: Please tell bug-autoconf at gnu.org and
-$0: http://listserver.mbari.org/sympa/arc/mbsystem about
-$0: your system, including any error possibly output before
-$0: this message. Then install a modern shell, or manually
-$0: run the script under such a shell if you do have one."
-  fi
-  exit 1
-fi
-fi
-fi
-SHELL=${CONFIG_SHELL-/bin/sh}
-export SHELL
-# Unset more variables known to interfere with behavior of common tools.
-CLICOLOR_FORCE= GREP_OPTIONS=
-unset CLICOLOR_FORCE GREP_OPTIONS
-
-## --------------------- ##
-## M4sh Shell Functions. ##
-## --------------------- ##
-# as_fn_unset VAR
-# ---------------
-# Portably unset VAR.
-as_fn_unset ()
-{
-  { eval $1=; unset $1;}
-}
-as_unset=as_fn_unset
-
-# as_fn_set_status STATUS
-# -----------------------
-# Set $? to STATUS, without forking.
-as_fn_set_status ()
-{
-  return $1
-} # as_fn_set_status
-
-# as_fn_exit STATUS
-# -----------------
-# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
-as_fn_exit ()
-{
-  set +e
-  as_fn_set_status $1
-  exit $1
-} # as_fn_exit
-
-# as_fn_mkdir_p
-# -------------
-# Create "$as_dir" as a directory, including parents if necessary.
-as_fn_mkdir_p ()
-{
-
-  case $as_dir in #(
-  -*) as_dir=./$as_dir;;
-  esac
-  test -d "$as_dir" || eval $as_mkdir_p || {
-    as_dirs=
-    while :; do
-      case $as_dir in #(
-      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
-      *) as_qdir=$as_dir;;
-      esac
-      as_dirs="'$as_qdir' $as_dirs"
-      as_dir=`$as_dirname -- "$as_dir" ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-	 X"$as_dir" : 'X\(//\)[^/]' \| \
-	 X"$as_dir" : 'X\(//\)$' \| \
-	 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$as_dir" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
-	    s//\1/
-	    q
-	  }
-	  /^X\(\/\/\)[^/].*/{
-	    s//\1/
-	    q
-	  }
-	  /^X\(\/\/\)$/{
-	    s//\1/
-	    q
-	  }
-	  /^X\(\/\).*/{
-	    s//\1/
-	    q
-	  }
-	  s/.*/./; q'`
-      test -d "$as_dir" && break
-    done
-    test -z "$as_dirs" || eval "mkdir $as_dirs"
-  } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
-
-
-} # as_fn_mkdir_p
-
-# as_fn_executable_p FILE
-# -----------------------
-# Test if FILE is an executable regular file.
-as_fn_executable_p ()
-{
-  test -f "$1" && test -x "$1"
-} # as_fn_executable_p
-# as_fn_append VAR VALUE
-# ----------------------
-# Append the text in VALUE to the end of the definition contained in VAR. Take
-# advantage of any shell optimizations that allow amortized linear growth over
-# repeated appends, instead of the typical quadratic growth present in naive
-# implementations.
-if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
-  eval 'as_fn_append ()
-  {
-    eval $1+=\$2
-  }'
-else
-  as_fn_append ()
-  {
-    eval $1=\$$1\$2
-  }
-fi # as_fn_append
-
-# as_fn_arith ARG...
-# ------------------
-# Perform arithmetic evaluation on the ARGs, and store the result in the
-# global $as_val. Take advantage of shells that can avoid forks. The arguments
-# must be portable across $(()) and expr.
-if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
-  eval 'as_fn_arith ()
-  {
-    as_val=$(( $* ))
-  }'
-else
-  as_fn_arith ()
-  {
-    as_val=`expr "$@" || test $? -eq 1`
-  }
-fi # as_fn_arith
-
-
-# as_fn_error STATUS ERROR [LINENO LOG_FD]
-# ----------------------------------------
-# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
-# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
-# script with STATUS, using 1 if that was 0.
-as_fn_error ()
-{
-  as_status=$1; test $as_status -eq 0 && as_status=1
-  if test "$4"; then
-    as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-    $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
-  fi
-  $as_echo "$as_me: error: $2" >&2
-  as_fn_exit $as_status
-} # as_fn_error
-
-if expr a : '\(a\)' >/dev/null 2>&1 &&
-   test "X`expr 00001 : '.*\(...\)'`" = X001; then
-  as_expr=expr
-else
-  as_expr=false
-fi
-
-if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
-  as_basename=basename
-else
-  as_basename=false
-fi
-
-if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
-  as_dirname=dirname
-else
-  as_dirname=false
-fi
-
-as_me=`$as_basename -- "$0" ||
-$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
-	 X"$0" : 'X\(//\)$' \| \
-	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X/"$0" |
-    sed '/^.*\/\([^/][^/]*\)\/*$/{
-	    s//\1/
-	    q
-	  }
-	  /^X\/\(\/\/\)$/{
-	    s//\1/
-	    q
-	  }
-	  /^X\/\(\/\).*/{
-	    s//\1/
-	    q
-	  }
-	  s/.*/./; q'`
-
-# Avoid depending upon Character Ranges.
-as_cr_letters='abcdefghijklmnopqrstuvwxyz'
-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
-as_cr_Letters=$as_cr_letters$as_cr_LETTERS
-as_cr_digits='0123456789'
-as_cr_alnum=$as_cr_Letters$as_cr_digits
-
-
-  as_lineno_1=$LINENO as_lineno_1a=$LINENO
-  as_lineno_2=$LINENO as_lineno_2a=$LINENO
-  eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
-  test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
-  # Blame Lee E. McMahon (1931-1989) for sed's syntax.  :-)
-  sed -n '
-    p
-    /[$]LINENO/=
-  ' <$as_myself |
-    sed '
-      s/[$]LINENO.*/&-/
-      t lineno
-      b
-      :lineno
-      N
-      :loop
-      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
-      t loop
-      s/-\n.*//
-    ' >$as_me.lineno &&
-  chmod +x "$as_me.lineno" ||
-    { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
-
-  # If we had to re-execute with $CONFIG_SHELL, we're ensured to have
-  # already done that, so ensure we don't try to do so again and fall
-  # in an infinite loop.  This has already happened in practice.
-  _as_can_reexec=no; export _as_can_reexec
-  # Don't try to exec as it changes $[0], causing all sort of problems
-  # (the dirname of $[0] is not the place where we might find the
-  # original and so on.  Autoconf is especially sensitive to this).
-  . "./$as_me.lineno"
-  # Exit status is that of the last command.
-  exit
-}
-
-ECHO_C= ECHO_N= ECHO_T=
-case `echo -n x` in #(((((
--n*)
-  case `echo 'xy\c'` in
-  *c*) ECHO_T='	';;	# ECHO_T is single tab character.
-  xy)  ECHO_C='\c';;
-  *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null
-       ECHO_T='	';;
-  esac;;
-*)
-  ECHO_N='-n';;
-esac
-
-rm -f conf$$ conf$$.exe conf$$.file
-if test -d conf$$.dir; then
-  rm -f conf$$.dir/conf$$.file
-else
-  rm -f conf$$.dir
-  mkdir conf$$.dir 2>/dev/null
-fi
-if (echo >conf$$.file) 2>/dev/null; then
-  if ln -s conf$$.file conf$$ 2>/dev/null; then
-    as_ln_s='ln -s'
-    # ... but there are two gotchas:
-    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
-    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
-    # In both cases, we have to default to `cp -pR'.
-    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
-      as_ln_s='cp -pR'
-  elif ln conf$$.file conf$$ 2>/dev/null; then
-    as_ln_s=ln
-  else
-    as_ln_s='cp -pR'
-  fi
-else
-  as_ln_s='cp -pR'
-fi
-rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
-rmdir conf$$.dir 2>/dev/null
-
-if mkdir -p . 2>/dev/null; then
-  as_mkdir_p='mkdir -p "$as_dir"'
-else
-  test -d ./-p && rmdir ./-p
-  as_mkdir_p=false
-fi
-
-as_test_x='test -x'
-as_executable_p=as_fn_executable_p
-
-# Sed expression to map a string onto a valid CPP name.
-as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
-
-# Sed expression to map a string onto a valid variable name.
-as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
-
-SHELL=${CONFIG_SHELL-/bin/sh}
-
-
-test -n "$DJDIR" || exec 7<&0 </dev/null
-exec 6>&1
-
-# Name of the host.
-# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,
-# so uname gets run too.
-ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
-
-#
-# Initializations.
-#
-ac_default_prefix=/usr/local
-ac_clean_files=
-ac_config_libobj_dir=.
-LIBOBJS=
-cross_compiling=no
-subdirs=
-MFLAGS=
-MAKEFLAGS=
-
-# Identity of this package.
-PACKAGE_NAME='mbsystem'
-PACKAGE_TARNAME='mbsystem'
-PACKAGE_VERSION='5.5.2252'
-PACKAGE_STRING='mbsystem 5.5.2252'
-PACKAGE_BUGREPORT='http://listserver.mbari.org/sympa/arc/mbsystem'
-PACKAGE_URL='http://www.mbari.org/data/mbsystem/'
-
-# Factoring default headers for most tests.
-ac_includes_default="\
-#include <stdio.h>
-#ifdef HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-#ifdef HAVE_SYS_STAT_H
-# include <sys/stat.h>
-#endif
-#ifdef STDC_HEADERS
-# include <stdlib.h>
-# include <stddef.h>
-#else
-# ifdef HAVE_STDLIB_H
-#  include <stdlib.h>
-# endif
-#endif
-#ifdef HAVE_STRING_H
-# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
-#  include <memory.h>
-# endif
-# include <string.h>
-#endif
-#ifdef HAVE_STRINGS_H
-# include <strings.h>
-#endif
-#ifdef HAVE_INTTYPES_H
-# include <inttypes.h>
-#endif
-#ifdef HAVE_STDINT_H
-# include <stdint.h>
-#endif
-#ifdef HAVE_UNISTD_H
-# include <unistd.h>
-#endif"
-
-ac_subst_vars='am__EXEEXT_FALSE
-am__EXEEXT_TRUE
-LTLIBOBJS
-LIBOBJS
-mbsystempsdir
-mbsystemhtmldir
-mbsystemdatadir
-BUILD_GL_FALSE
-BUILD_GL_TRUE
-libopengl_CPPFLAGS
-libopengl_LIBS
-libGLU_LIBS
-libGLU_CFLAGS
-BUILD_MOTIF_FALSE
-BUILD_MOTIF_TRUE
-libmotif_CPPFLAGS
-libmotif_LIBS
-libXm_LIBS
-libXm_CFLAGS
-BUILD_FFTW_FALSE
-BUILD_FFTW_TRUE
-libfftw_CPPFLAGS
-libfftw_LIBS
-fftw_app
-libfftw3_LIBS
-libfftw3_CFLAGS
-libgmt_CPPFLAGS
-libpsl_LIBS
-libpsl_CFLAGS
-libgmt_LIBS
-libgmt_CFLAGS
-libproj_CPPFLAGS
-libproj_LIBS
-libproj_CFLAGS
-BUILD_PROJ_FALSE
-BUILD_PROJ_TRUE
-libnetcdf_CPPFLAGS
-libnetcdf_LIBS
-libnetcdf_CFLAGS
-PKG_CONFIG_LIBDIR
-PKG_CONFIG_PATH
-PKG_CONFIG
-OTPS_DIR
-XDR_LIB
-LIBM
-LIBTOOL_DEPS
-CPP
-LT_SYS_LIBRARY_PATH
-OTOOL64
-OTOOL
-LIPO
-NMEDIT
-DSYMUTIL
-MANIFEST_TOOL
-RANLIB
-DLLTOOL
-OBJDUMP
-NM
-ac_ct_DUMPBIN
-DUMPBIN
-LD
-FGREP
-EGREP
-GREP
-SED
-LIBTOOL
-LN_S
-ac_ct_AR
-AR
-am__fastdepCCAS_FALSE
-am__fastdepCCAS_TRUE
-CCASDEPMODE
-CCASFLAGS
-CCAS
-am__fastdepCC_FALSE
-am__fastdepCC_TRUE
-CCDEPMODE
-am__nodep
-AMDEPBACKSLASH
-AMDEP_FALSE
-AMDEP_TRUE
-am__quote
-am__include
-DEPDIR
-OBJEXT
-EXEEXT
-ac_ct_CC
-CPPFLAGS
-LDFLAGS
-CFLAGS
-CC
-MAINT
-MAINTAINER_MODE_FALSE
-MAINTAINER_MODE_TRUE
-AM_BACKSLASH
-AM_DEFAULT_VERBOSITY
-AM_DEFAULT_V
-AM_V
-am__untar
-am__tar
-AMTAR
-am__leading_dot
-SET_MAKE
-AWK
-mkdir_p
-MKDIR_P
-INSTALL_STRIP_PROGRAM
-STRIP
-install_sh
-MAKEINFO
-AUTOHEADER
-AUTOMAKE
-AUTOCONF
-ACLOCAL
-VERSION
-PACKAGE
-CYGPATH_W
-am__isrc
-INSTALL_DATA
-INSTALL_SCRIPT
-INSTALL_PROGRAM
-host_os
-host_vendor
-host_cpu
-host
-build_os
-build_vendor
-build_cpu
-build
-target_alias
-host_alias
-build_alias
-LIBS
-ECHO_T
-ECHO_N
-ECHO_C
-DEFS
-mandir
-localedir
-libdir
-psdir
-pdfdir
-dvidir
-htmldir
-infodir
-docdir
-oldincludedir
-includedir
-localstatedir
-sharedstatedir
-sysconfdir
-datadir
-datarootdir
-libexecdir
-sbindir
-bindir
-program_transform_name
-prefix
-exec_prefix
-PACKAGE_URL
-PACKAGE_BUGREPORT
-PACKAGE_STRING
-PACKAGE_VERSION
-PACKAGE_TARNAME
-PACKAGE_NAME
-PATH_SEPARATOR
-SHELL'
-ac_subst_files=''
-ac_user_opts='
-enable_option_checking
-enable_silent_rules
-enable_maintainer_mode
-enable_dependency_tracking
-enable_shared
-enable_static
-with_pic
-enable_fast_install
-with_aix_soname
-with_gnu_ld
-with_sysroot
-enable_libtool_lock
-with_otps_dir
-with_netcdf_lib
-with_netcdf_include
-enable_bundledproj
-with_proj_lib
-with_proj_include
-with_gmt_lib
-with_gmt_include
-with_fftw_lib
-with_fftw_include
-with_motif_lib
-with_motif_include
-with_opengl_lib
-with_opengl_include
-'
-      ac_precious_vars='build_alias
-host_alias
-target_alias
-CC
-CFLAGS
-LDFLAGS
-LIBS
-CPPFLAGS
-CCAS
-CCASFLAGS
-LT_SYS_LIBRARY_PATH
-CPP
-PKG_CONFIG
-PKG_CONFIG_PATH
-PKG_CONFIG_LIBDIR
-libnetcdf_CFLAGS
-libnetcdf_LIBS
-libproj_CFLAGS
-libproj_LIBS
-libgmt_CFLAGS
-libgmt_LIBS
-libpsl_CFLAGS
-libpsl_LIBS
-libfftw3_CFLAGS
-libfftw3_LIBS
-libXm_CFLAGS
-libXm_LIBS
-libGLU_CFLAGS
-libGLU_LIBS'
-
-
-# Initialize some variables set by options.
-ac_init_help=
-ac_init_version=false
-ac_unrecognized_opts=
-ac_unrecognized_sep=
-# The variables have the same names as the options, with
-# dashes changed to underlines.
-cache_file=/dev/null
-exec_prefix=NONE
-no_create=
-no_recursion=
-prefix=NONE
-program_prefix=NONE
-program_suffix=NONE
-program_transform_name=s,x,x,
-silent=
-site=
-srcdir=
-verbose=
-x_includes=NONE
-x_libraries=NONE
-
-# Installation directory options.
-# These are left unexpanded so users can "make install exec_prefix=/foo"
-# and all the variables that are supposed to be based on exec_prefix
-# by default will actually change.
-# Use braces instead of parens because sh, perl, etc. also accept them.
-# (The list follows the same order as the GNU Coding Standards.)
-bindir='${exec_prefix}/bin'
-sbindir='${exec_prefix}/sbin'
-libexecdir='${exec_prefix}/libexec'
-datarootdir='${prefix}/share'
-datadir='${datarootdir}'
-sysconfdir='${prefix}/etc'
-sharedstatedir='${prefix}/com'
-localstatedir='${prefix}/var'
-includedir='${prefix}/include'
-oldincludedir='/usr/include'
-docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
-infodir='${datarootdir}/info'
-htmldir='${docdir}'
-dvidir='${docdir}'
-pdfdir='${docdir}'
-psdir='${docdir}'
-libdir='${exec_prefix}/lib'
-localedir='${datarootdir}/locale'
-mandir='${datarootdir}/man'
-
-ac_prev=
-ac_dashdash=
-for ac_option
-do
-  # If the previous option needs an argument, assign it.
-  if test -n "$ac_prev"; then
-    eval $ac_prev=\$ac_option
-    ac_prev=
-    continue
-  fi
-
-  case $ac_option in
-  *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
-  *=)   ac_optarg= ;;
-  *)    ac_optarg=yes ;;
-  esac
-
-  # Accept the important Cygnus configure options, so we can diagnose typos.
-
-  case $ac_dashdash$ac_option in
-  --)
-    ac_dashdash=yes ;;
-
-  -bindir | --bindir | --bindi | --bind | --bin | --bi)
-    ac_prev=bindir ;;
-  -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
-    bindir=$ac_optarg ;;
-
-  -build | --build | --buil | --bui | --bu)
-    ac_prev=build_alias ;;
-  -build=* | --build=* | --buil=* | --bui=* | --bu=*)
-    build_alias=$ac_optarg ;;
-
-  -cache-file | --cache-file | --cache-fil | --cache-fi \
-  | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
-    ac_prev=cache_file ;;
-  -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
-  | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
-    cache_file=$ac_optarg ;;
-
-  --config-cache | -C)
-    cache_file=config.cache ;;
-
-  -datadir | --datadir | --datadi | --datad)
-    ac_prev=datadir ;;
-  -datadir=* | --datadir=* | --datadi=* | --datad=*)
-    datadir=$ac_optarg ;;
-
-  -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
-  | --dataroo | --dataro | --datar)
-    ac_prev=datarootdir ;;
-  -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
-  | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
-    datarootdir=$ac_optarg ;;
-
-  -disable-* | --disable-*)
-    ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
-    # Reject names that are not valid shell variable names.
-    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
-      as_fn_error $? "invalid feature name: $ac_useropt"
-    ac_useropt_orig=$ac_useropt
-    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
-    case $ac_user_opts in
-      *"
-"enable_$ac_useropt"
-"*) ;;
-      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
-	 ac_unrecognized_sep=', ';;
-    esac
-    eval enable_$ac_useropt=no ;;
-
-  -docdir | --docdir | --docdi | --doc | --do)
-    ac_prev=docdir ;;
-  -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
-    docdir=$ac_optarg ;;
-
-  -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
-    ac_prev=dvidir ;;
-  -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
-    dvidir=$ac_optarg ;;
-
-  -enable-* | --enable-*)
-    ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
-    # Reject names that are not valid shell variable names.
-    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
-      as_fn_error $? "invalid feature name: $ac_useropt"
-    ac_useropt_orig=$ac_useropt
-    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
-    case $ac_user_opts in
-      *"
-"enable_$ac_useropt"
-"*) ;;
-      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
-	 ac_unrecognized_sep=', ';;
-    esac
-    eval enable_$ac_useropt=\$ac_optarg ;;
-
-  -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
-  | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
-  | --exec | --exe | --ex)
-    ac_prev=exec_prefix ;;
-  -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
-  | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
-  | --exec=* | --exe=* | --ex=*)
-    exec_prefix=$ac_optarg ;;
-
-  -gas | --gas | --ga | --g)
-    # Obsolete; use --with-gas.
-    with_gas=yes ;;
-
-  -help | --help | --hel | --he | -h)
-    ac_init_help=long ;;
-  -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
-    ac_init_help=recursive ;;
-  -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
-    ac_init_help=short ;;
-
-  -host | --host | --hos | --ho)
-    ac_prev=host_alias ;;
-  -host=* | --host=* | --hos=* | --ho=*)
-    host_alias=$ac_optarg ;;
-
-  -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
-    ac_prev=htmldir ;;
-  -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
-  | --ht=*)
-    htmldir=$ac_optarg ;;
-
-  -includedir | --includedir | --includedi | --included | --include \
-  | --includ | --inclu | --incl | --inc)
-    ac_prev=includedir ;;
-  -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
-  | --includ=* | --inclu=* | --incl=* | --inc=*)
-    includedir=$ac_optarg ;;
-
-  -infodir | --infodir | --infodi | --infod | --info | --inf)
-    ac_prev=infodir ;;
-  -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
-    infodir=$ac_optarg ;;
-
-  -libdir | --libdir | --libdi | --libd)
-    ac_prev=libdir ;;
-  -libdir=* | --libdir=* | --libdi=* | --libd=*)
-    libdir=$ac_optarg ;;
-
-  -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
-  | --libexe | --libex | --libe)
-    ac_prev=libexecdir ;;
-  -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
-  | --libexe=* | --libex=* | --libe=*)
-    libexecdir=$ac_optarg ;;
-
-  -localedir | --localedir | --localedi | --localed | --locale)
-    ac_prev=localedir ;;
-  -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
-    localedir=$ac_optarg ;;
-
-  -localstatedir | --localstatedir | --localstatedi | --localstated \
-  | --localstate | --localstat | --localsta | --localst | --locals)
-    ac_prev=localstatedir ;;
-  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
-  | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
-    localstatedir=$ac_optarg ;;
-
-  -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
-    ac_prev=mandir ;;
-  -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
-    mandir=$ac_optarg ;;
-
-  -nfp | --nfp | --nf)
-    # Obsolete; use --without-fp.
-    with_fp=no ;;
-
-  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
-  | --no-cr | --no-c | -n)
-    no_create=yes ;;
-
-  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
-  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
-    no_recursion=yes ;;
-
-  -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
-  | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
-  | --oldin | --oldi | --old | --ol | --o)
-    ac_prev=oldincludedir ;;
-  -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
-  | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
-  | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
-    oldincludedir=$ac_optarg ;;
-
-  -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
-    ac_prev=prefix ;;
-  -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
-    prefix=$ac_optarg ;;
-
-  -program-prefix | --program-prefix | --program-prefi | --program-pref \
-  | --program-pre | --program-pr | --program-p)
-    ac_prev=program_prefix ;;
-  -program-prefix=* | --program-prefix=* | --program-prefi=* \
-  | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
-    program_prefix=$ac_optarg ;;
-
-  -program-suffix | --program-suffix | --program-suffi | --program-suff \
-  | --program-suf | --program-su | --program-s)
-    ac_prev=program_suffix ;;
-  -program-suffix=* | --program-suffix=* | --program-suffi=* \
-  | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
-    program_suffix=$ac_optarg ;;
-
-  -program-transform-name | --program-transform-name \
-  | --program-transform-nam | --program-transform-na \
-  | --program-transform-n | --program-transform- \
-  | --program-transform | --program-transfor \
-  | --program-transfo | --program-transf \
-  | --program-trans | --program-tran \
-  | --progr-tra | --program-tr | --program-t)
-    ac_prev=program_transform_name ;;
-  -program-transform-name=* | --program-transform-name=* \
-  | --program-transform-nam=* | --program-transform-na=* \
-  | --program-transform-n=* | --program-transform-=* \
-  | --program-transform=* | --program-transfor=* \
-  | --program-transfo=* | --program-transf=* \
-  | --program-trans=* | --program-tran=* \
-  | --progr-tra=* | --program-tr=* | --program-t=*)
-    program_transform_name=$ac_optarg ;;
-
-  -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
-    ac_prev=pdfdir ;;
-  -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
-    pdfdir=$ac_optarg ;;
-
-  -psdir | --psdir | --psdi | --psd | --ps)
-    ac_prev=psdir ;;
-  -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
-    psdir=$ac_optarg ;;
-
-  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
-  | -silent | --silent | --silen | --sile | --sil)
-    silent=yes ;;
-
-  -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
-    ac_prev=sbindir ;;
-  -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
-  | --sbi=* | --sb=*)
-    sbindir=$ac_optarg ;;
-
-  -sharedstatedir | --sharedstatedir | --sharedstatedi \
-  | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
-  | --sharedst | --shareds | --shared | --share | --shar \
-  | --sha | --sh)
-    ac_prev=sharedstatedir ;;
-  -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
-  | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
-  | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
-  | --sha=* | --sh=*)
-    sharedstatedir=$ac_optarg ;;
-
-  -site | --site | --sit)
-    ac_prev=site ;;
-  -site=* | --site=* | --sit=*)
-    site=$ac_optarg ;;
-
-  -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
-    ac_prev=srcdir ;;
-  -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
-    srcdir=$ac_optarg ;;
-
-  -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
-  | --syscon | --sysco | --sysc | --sys | --sy)
-    ac_prev=sysconfdir ;;
-  -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
-  | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
-    sysconfdir=$ac_optarg ;;
-
-  -target | --target | --targe | --targ | --tar | --ta | --t)
-    ac_prev=target_alias ;;
-  -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
-    target_alias=$ac_optarg ;;
-
-  -v | -verbose | --verbose | --verbos | --verbo | --verb)
-    verbose=yes ;;
-
-  -version | --version | --versio | --versi | --vers | -V)
-    ac_init_version=: ;;
-
-  -with-* | --with-*)
-    ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
-    # Reject names that are not valid shell variable names.
-    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
-      as_fn_error $? "invalid package name: $ac_useropt"
-    ac_useropt_orig=$ac_useropt
-    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
-    case $ac_user_opts in
-      *"
-"with_$ac_useropt"
-"*) ;;
-      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
-	 ac_unrecognized_sep=', ';;
-    esac
-    eval with_$ac_useropt=\$ac_optarg ;;
-
-  -without-* | --without-*)
-    ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
-    # Reject names that are not valid shell variable names.
-    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
-      as_fn_error $? "invalid package name: $ac_useropt"
-    ac_useropt_orig=$ac_useropt
-    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
-    case $ac_user_opts in
-      *"
-"with_$ac_useropt"
-"*) ;;
-      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
-	 ac_unrecognized_sep=', ';;
-    esac
-    eval with_$ac_useropt=no ;;
-
-  --x)
-    # Obsolete; use --with-x.
-    with_x=yes ;;
-
-  -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
-  | --x-incl | --x-inc | --x-in | --x-i)
-    ac_prev=x_includes ;;
-  -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
-  | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
-    x_includes=$ac_optarg ;;
-
-  -x-libraries | --x-libraries | --x-librarie | --x-librari \
-  | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
-    ac_prev=x_libraries ;;
-  -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
-  | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
-    x_libraries=$ac_optarg ;;
-
-  -*) as_fn_error $? "unrecognized option: \`$ac_option'
-Try \`$0 --help' for more information"
-    ;;
-
-  *=*)
-    ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
-    # Reject names that are not valid shell variable names.
-    case $ac_envvar in #(
-      '' | [0-9]* | *[!_$as_cr_alnum]* )
-      as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;
-    esac
-    eval $ac_envvar=\$ac_optarg
-    export $ac_envvar ;;
-
-  *)
-    # FIXME: should be removed in autoconf 3.0.
-    $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
-    expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
-      $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
-    : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"
-    ;;
-
-  esac
-done
-
-if test -n "$ac_prev"; then
-  ac_option=--`echo $ac_prev | sed 's/_/-/g'`
-  as_fn_error $? "missing argument to $ac_option"
-fi
-
-if test -n "$ac_unrecognized_opts"; then
-  case $enable_option_checking in
-    no) ;;
-    fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
-    *)     $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
-  esac
-fi
-
-# Check all directory arguments for consistency.
-for ac_var in	exec_prefix prefix bindir sbindir libexecdir datarootdir \
-		datadir sysconfdir sharedstatedir localstatedir includedir \
-		oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
-		libdir localedir mandir
-do
-  eval ac_val=\$$ac_var
-  # Remove trailing slashes.
-  case $ac_val in
-    */ )
-      ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
-      eval $ac_var=\$ac_val;;
-  esac
-  # Be sure to have absolute directory names.
-  case $ac_val in
-    [\\/$]* | ?:[\\/]* )  continue;;
-    NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
-  esac
-  as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
-done
-
-# There might be people who depend on the old broken behavior: `$host'
-# used to hold the argument of --host etc.
-# FIXME: To remove some day.
-build=$build_alias
-host=$host_alias
-target=$target_alias
-
-# FIXME: To remove some day.
-if test "x$host_alias" != x; then
-  if test "x$build_alias" = x; then
-    cross_compiling=maybe
-  elif test "x$build_alias" != "x$host_alias"; then
-    cross_compiling=yes
-  fi
-fi
-
-ac_tool_prefix=
-test -n "$host_alias" && ac_tool_prefix=$host_alias-
-
-test "$silent" = yes && exec 6>/dev/null
-
-
-ac_pwd=`pwd` && test -n "$ac_pwd" &&
-ac_ls_di=`ls -di .` &&
-ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
-  as_fn_error $? "working directory cannot be determined"
-test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
-  as_fn_error $? "pwd does not report name of working directory"
-
-
-# Find the source files, if location was not specified.
-if test -z "$srcdir"; then
-  ac_srcdir_defaulted=yes
-  # Try the directory containing this script, then the parent directory.
-  ac_confdir=`$as_dirname -- "$as_myself" ||
-$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-	 X"$as_myself" : 'X\(//\)[^/]' \| \
-	 X"$as_myself" : 'X\(//\)$' \| \
-	 X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$as_myself" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
-	    s//\1/
-	    q
-	  }
-	  /^X\(\/\/\)[^/].*/{
-	    s//\1/
-	    q
-	  }
-	  /^X\(\/\/\)$/{
-	    s//\1/
-	    q
-	  }
-	  /^X\(\/\).*/{
-	    s//\1/
-	    q
-	  }
-	  s/.*/./; q'`
-  srcdir=$ac_confdir
-  if test ! -r "$srcdir/$ac_unique_file"; then
-    srcdir=..
-  fi
-else
-  ac_srcdir_defaulted=no
-fi
-if test ! -r "$srcdir/$ac_unique_file"; then
-  test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
-  as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
-fi
-ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
-ac_abs_confdir=`(
-	cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
-	pwd)`
-# When building in place, set srcdir=.
-if test "$ac_abs_confdir" = "$ac_pwd"; then
-  srcdir=.
-fi
-# Remove unnecessary trailing slashes from srcdir.
-# Double slashes in file names in object file debugging info
-# mess up M-x gdb in Emacs.
-case $srcdir in
-*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
-esac
-for ac_var in $ac_precious_vars; do
-  eval ac_env_${ac_var}_set=\${${ac_var}+set}
-  eval ac_env_${ac_var}_value=\$${ac_var}
-  eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
-  eval ac_cv_env_${ac_var}_value=\$${ac_var}
-done
-
-#
-# Report the --help message.
-#
-if test "$ac_init_help" = "long"; then
-  # Omit some internal or obsolete options to make the list less imposing.
-  # This message is too long to be a string in the A/UX 3.1 sh.
-  cat <<_ACEOF
-\`configure' configures mbsystem 5.5.2252 to adapt to many kinds of systems.
-
-Usage: $0 [OPTION]... [VAR=VALUE]...
-
-To assign environment variables (e.g., CC, CFLAGS...), specify them as
-VAR=VALUE.  See below for descriptions of some of the useful variables.
-
-Defaults for the options are specified in brackets.
-
-Configuration:
-  -h, --help              display this help and exit
-      --help=short        display options specific to this package
-      --help=recursive    display the short help of all the included packages
-  -V, --version           display version information and exit
-  -q, --quiet, --silent   do not print \`checking ...' messages
-      --cache-file=FILE   cache test results in FILE [disabled]
-  -C, --config-cache      alias for \`--cache-file=config.cache'
-  -n, --no-create         do not create output files
-      --srcdir=DIR        find the sources in DIR [configure dir or \`..']
-
-Installation directories:
-  --prefix=PREFIX         install architecture-independent files in PREFIX
-                          [$ac_default_prefix]
-  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
-                          [PREFIX]
-
-By default, \`make install' will install all the files in
-\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
-an installation prefix other than \`$ac_default_prefix' using \`--prefix',
-for instance \`--prefix=\$HOME'.
-
-For better control, use the options below.
-
-Fine tuning of the installation directories:
-  --bindir=DIR            user executables [EPREFIX/bin]
-  --sbindir=DIR           system admin executables [EPREFIX/sbin]
-  --libexecdir=DIR        program executables [EPREFIX/libexec]
-  --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
-  --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
-  --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
-  --libdir=DIR            object code libraries [EPREFIX/lib]
-  --includedir=DIR        C header files [PREFIX/include]
-  --oldincludedir=DIR     C header files for non-gcc [/usr/include]
-  --datarootdir=DIR       read-only arch.-independent data root [PREFIX/share]
-  --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
-  --infodir=DIR           info documentation [DATAROOTDIR/info]
-  --localedir=DIR         locale-dependent data [DATAROOTDIR/locale]
-  --mandir=DIR            man documentation [DATAROOTDIR/man]
-  --docdir=DIR            documentation root [DATAROOTDIR/doc/mbsystem]
-  --htmldir=DIR           html documentation [DOCDIR]
-  --dvidir=DIR            dvi documentation [DOCDIR]
-  --pdfdir=DIR            pdf documentation [DOCDIR]
-  --psdir=DIR             ps documentation [DOCDIR]
-_ACEOF
-
-  cat <<\_ACEOF
-
-Program names:
-  --program-prefix=PREFIX            prepend PREFIX to installed program names
-  --program-suffix=SUFFIX            append SUFFIX to installed program names
-  --program-transform-name=PROGRAM   run sed PROGRAM on installed program names
-
-System types:
-  --build=BUILD     configure for building on BUILD [guessed]
-  --host=HOST       cross-compile to build programs to run on HOST [BUILD]
-_ACEOF
-fi
-
-if test -n "$ac_init_help"; then
-  case $ac_init_help in
-     short | recursive ) echo "Configuration of mbsystem 5.5.2252:";;
-   esac
-  cat <<\_ACEOF
-
-Optional Features:
-  --disable-option-checking  ignore unrecognized --enable/--with options
-  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
-  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
-  --enable-silent-rules   less verbose build output (undo: "make V=1")
-  --disable-silent-rules  verbose build output (undo: "make V=0")
-  --enable-maintainer-mode
-                          enable make rules and dependencies not useful (and
-                          sometimes confusing) to the casual installer
-  --enable-dependency-tracking
-                          do not reject slow dependency extractors
-  --disable-dependency-tracking
-                          speeds up one-time build
-  --enable-shared[=PKGS]  build shared libraries [default=yes]
-  --enable-static[=PKGS]  build static libraries [default=yes]
-  --enable-fast-install[=PKGS]
-                          optimize for fast installation [default=yes]
-  --disable-libtool-lock  avoid locking (might break parallel builds)
-  --enable-bundledproj    build and use the bundled proj package
-
-Optional Packages:
-  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
-  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
-  --with-pic[=PKGS]       try to use only PIC/non-PIC objects [default=use
-                          both]
-  --with-aix-soname=aix|svr4|both
-                          shared library versioning (aka "SONAME") variant to
-                          provide on AIX, [default=aix].
-  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
-  --with-sysroot[=DIR]    Search for dependent libraries within DIR (or the
-                          compiler's sysroot if not specified).
- --with-otps_dir=DIR    Location of OSU Tidal Prediction Software
-  --with-netcdf-lib=DIR	Location of NetCDF library
-  --with-netcdf-include=DIR	Location of NetCDF headers
-  --with-proj-lib=DIR	Location of PROJ library
-  --with-proj-include=DIR	Location of PROJ headers
-  --with-gmt-lib=DIR	Location of GMT libraries libgmt libpsl
-  --with-gmt-include=DIR	Location of GMT headers
-  --with-fftw-lib=DIR	Location of FFTW library
-  --with-fftw-include=DIR	Location of FFTW headers
-  --with-motif-lib=DIR	Location of MOTIF library
-  --with-motif-include=DIR	Location of Motif headers
-  --with-opengl-lib=DIR	Location of OpenGL library
-  --with-opengl-include=DIR	Location of OpenGL headers
-
-Some influential environment variables:
-  CC          C compiler command
-  CFLAGS      C compiler flags
-  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
-              nonstandard directory <lib dir>
-  LIBS        libraries to pass to the linker, e.g. -l<library>
-  CPPFLAGS    (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
-              you have headers in a nonstandard directory <include dir>
-  CCAS        assembler compiler command (defaults to CC)
-  CCASFLAGS   assembler compiler flags (defaults to CFLAGS)
-  LT_SYS_LIBRARY_PATH
-              User-defined run-time library search path.
-  CPP         C preprocessor
-  PKG_CONFIG  path to pkg-config utility
-  PKG_CONFIG_PATH
-              directories to add to pkg-config's search path
-  PKG_CONFIG_LIBDIR
-              path overriding pkg-config's built-in search path
-  libnetcdf_CFLAGS
-              C compiler flags for libnetcdf, overriding pkg-config
-  libnetcdf_LIBS
-              linker flags for libnetcdf, overriding pkg-config
-  libproj_CFLAGS
-              C compiler flags for libproj, overriding pkg-config
-  libproj_LIBS
-              linker flags for libproj, overriding pkg-config
-  libgmt_CFLAGS
-              C compiler flags for libgmt, overriding pkg-config
-  libgmt_LIBS linker flags for libgmt, overriding pkg-config
-  libpsl_CFLAGS
-              C compiler flags for libpsl, overriding pkg-config
-  libpsl_LIBS linker flags for libpsl, overriding pkg-config
-  libfftw3_CFLAGS
-              C compiler flags for libfftw3, overriding pkg-config
-  libfftw3_LIBS
-              linker flags for libfftw3, overriding pkg-config
-  libXm_CFLAGS
-              C compiler flags for libXm, overriding pkg-config
-  libXm_LIBS  linker flags for libXm, overriding pkg-config
-  libGLU_CFLAGS
-              C compiler flags for libGLU, overriding pkg-config
-  libGLU_LIBS linker flags for libGLU, overriding pkg-config
-
-Use these variables to override the choices made by `configure' or to help
-it to find libraries and programs with nonstandard names/locations.
-
-Report bugs to <http://listserver.mbari.org/sympa/arc/mbsystem>.
-mbsystem home page: <http://www.mbari.org/data/mbsystem/>.
-_ACEOF
-ac_status=$?
-fi
-
-if test "$ac_init_help" = "recursive"; then
-  # If there are subdirs, report their specific --help.
-  for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
-    test -d "$ac_dir" ||
-      { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
-      continue
-    ac_builddir=.
-
-case "$ac_dir" in
-.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
-*)
-  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
-  # A ".." for each directory in $ac_dir_suffix.
-  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
-  case $ac_top_builddir_sub in
-  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
-  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
-  esac ;;
-esac
-ac_abs_top_builddir=$ac_pwd
-ac_abs_builddir=$ac_pwd$ac_dir_suffix
-# for backward compatibility:
-ac_top_builddir=$ac_top_build_prefix
-
-case $srcdir in
-  .)  # We are building in place.
-    ac_srcdir=.
-    ac_top_srcdir=$ac_top_builddir_sub
-    ac_abs_top_srcdir=$ac_pwd ;;
-  [\\/]* | ?:[\\/]* )  # Absolute name.
-    ac_srcdir=$srcdir$ac_dir_suffix;
-    ac_top_srcdir=$srcdir
-    ac_abs_top_srcdir=$srcdir ;;
-  *) # Relative name.
-    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
-    ac_top_srcdir=$ac_top_build_prefix$srcdir
-    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
-esac
-ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
-
-    cd "$ac_dir" || { ac_status=$?; continue; }
-    # Check for guested configure.
-    if test -f "$ac_srcdir/configure.gnu"; then
-      echo &&
-      $SHELL "$ac_srcdir/configure.gnu" --help=recursive
-    elif test -f "$ac_srcdir/configure"; then
-      echo &&
-      $SHELL "$ac_srcdir/configure" --help=recursive
-    else
-      $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
-    fi || ac_status=$?
-    cd "$ac_pwd" || { ac_status=$?; break; }
-  done
-fi
-
-test -n "$ac_init_help" && exit $ac_status
-if $ac_init_version; then
-  cat <<\_ACEOF
-mbsystem configure 5.5.2252
-generated by GNU Autoconf 2.69
-
-Copyright (C) 2012 Free Software Foundation, Inc.
-This configure script is free software; the Free Software Foundation
-gives unlimited permission to copy, distribute and modify it.
-_ACEOF
-  exit
-fi
-
-## ------------------------ ##
-## Autoconf initialization. ##
-## ------------------------ ##
-
-# ac_fn_c_try_compile LINENO
-# --------------------------
-# Try to compile conftest.$ac_ext, and return whether this succeeded.
-ac_fn_c_try_compile ()
-{
-  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  rm -f conftest.$ac_objext
-  if { { ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_compile") 2>conftest.err
-  ac_status=$?
-  if test -s conftest.err; then
-    grep -v '^ *+' conftest.err >conftest.er1
-    cat conftest.er1 >&5
-    mv -f conftest.er1 conftest.err
-  fi
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then :
-  ac_retval=0
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_retval=1
-fi
-  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-  as_fn_set_status $ac_retval
-
-} # ac_fn_c_try_compile
-
-# ac_fn_c_try_link LINENO
-# -----------------------
-# Try to link conftest.$ac_ext, and return whether this succeeded.
-ac_fn_c_try_link ()
-{
-  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  rm -f conftest.$ac_objext conftest$ac_exeext
-  if { { ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_link") 2>conftest.err
-  ac_status=$?
-  if test -s conftest.err; then
-    grep -v '^ *+' conftest.err >conftest.er1
-    cat conftest.er1 >&5
-    mv -f conftest.er1 conftest.err
-  fi
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 test -x conftest$ac_exeext
-       }; then :
-  ac_retval=0
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_retval=1
-fi
-  # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
-  # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
-  # interfere with the next link command; also delete a directory that is
-  # left behind by Apple's compiler.  We do this before executing the actions.
-  rm -rf conftest.dSYM conftest_ipa8_conftest.oo
-  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-  as_fn_set_status $ac_retval
-
-} # ac_fn_c_try_link
-
-# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
-# -------------------------------------------------------
-# Tests whether HEADER exists and can be compiled using the include files in
-# INCLUDES, setting the cache variable VAR accordingly.
-ac_fn_c_check_header_compile ()
-{
-  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-$as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-$4
-#include <$2>
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  eval "$3=yes"
-else
-  eval "$3=no"
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-eval ac_res=\$$3
-	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-
-} # ac_fn_c_check_header_compile
-
-# ac_fn_c_try_cpp LINENO
-# ----------------------
-# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
-ac_fn_c_try_cpp ()
-{
-  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  if { { ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
-  ac_status=$?
-  if test -s conftest.err; then
-    grep -v '^ *+' conftest.err >conftest.er1
-    cat conftest.er1 >&5
-    mv -f conftest.er1 conftest.err
-  fi
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } > conftest.i && {
-	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       }; then :
-  ac_retval=0
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-    ac_retval=1
-fi
-  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-  as_fn_set_status $ac_retval
-
-} # ac_fn_c_try_cpp
-
-# ac_fn_c_try_run LINENO
-# ----------------------
-# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
-# that executables *can* be run.
-ac_fn_c_try_run ()
-{
-  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  if { { ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_link") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
-  { { case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_try") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; }; then :
-  ac_retval=0
-else
-  $as_echo "$as_me: program exited with status $ac_status" >&5
-       $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-       ac_retval=$ac_status
-fi
-  rm -rf conftest.dSYM conftest_ipa8_conftest.oo
-  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-  as_fn_set_status $ac_retval
-
-} # ac_fn_c_try_run
-
-# ac_fn_c_check_func LINENO FUNC VAR
-# ----------------------------------
-# Tests whether FUNC exists, setting the cache variable VAR accordingly
-ac_fn_c_check_func ()
-{
-  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-$as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-/* Define $2 to an innocuous variant, in case <limits.h> declares $2.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define $2 innocuous_$2
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $2 (); below.
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-    <limits.h> exists even on freestanding compilers.  */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $2
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char $2 ();
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined __stub_$2 || defined __stub___$2
-choke me
-#endif
-
-int
-main ()
-{
-return $2 ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  eval "$3=yes"
-else
-  eval "$3=no"
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-fi
-eval ac_res=\$$3
-	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-
-} # ac_fn_c_check_func
-
-# ac_fn_c_find_intX_t LINENO BITS VAR
-# -----------------------------------
-# Finds a signed integer type with width BITS, setting cache variable VAR
-# accordingly.
-ac_fn_c_find_intX_t ()
-{
-  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for int$2_t" >&5
-$as_echo_n "checking for int$2_t... " >&6; }
-if eval \${$3+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  eval "$3=no"
-     # Order is important - never check a type that is potentially smaller
-     # than half of the expected target width.
-     for ac_type in int$2_t 'int' 'long int' \
-	 'long long int' 'short int' 'signed char'; do
-       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-$ac_includes_default
-	     enum { N = $2 / 2 - 1 };
-int
-main ()
-{
-static int test_array [1 - 2 * !(0 < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1))];
-test_array [0] = 0;
-return test_array [0];
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-$ac_includes_default
-	        enum { N = $2 / 2 - 1 };
-int
-main ()
-{
-static int test_array [1 - 2 * !(($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1)
-		 < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 2))];
-test_array [0] = 0;
-return test_array [0];
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
-else
-  case $ac_type in #(
-  int$2_t) :
-    eval "$3=yes" ;; #(
-  *) :
-    eval "$3=\$ac_type" ;;
-esac
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-       if eval test \"x\$"$3"\" = x"no"; then :
-
-else
-  break
-fi
-     done
-fi
-eval ac_res=\$$3
-	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-
-} # ac_fn_c_find_intX_t
-
-# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES
-# -------------------------------------------------------
-# Tests whether HEADER exists, giving a warning if it cannot be compiled using
-# the include files in INCLUDES and setting the cache variable VAR
-# accordingly.
-ac_fn_c_check_header_mongrel ()
-{
-  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  if eval \${$3+:} false; then :
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-$as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
-  $as_echo_n "(cached) " >&6
-fi
-eval ac_res=\$$3
-	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-else
-  # Is the header compilable?
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5
-$as_echo_n "checking $2 usability... " >&6; }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-$4
-#include <$2>
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_header_compiler=yes
-else
-  ac_header_compiler=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5
-$as_echo "$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5
-$as_echo_n "checking $2 presence... " >&6; }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <$2>
-_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
-  ac_header_preproc=yes
-else
-  ac_header_preproc=no
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5
-$as_echo "$ac_header_preproc" >&6; }
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #((
-  yes:no: )
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5
-$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
-$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
-    ;;
-  no:yes:* )
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5
-$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;}
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2:     check for missing prerequisite headers?" >&5
-$as_echo "$as_me: WARNING: $2:     check for missing prerequisite headers?" >&2;}
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5
-$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;}
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2:     section \"Present But Cannot Be Compiled\"" >&5
-$as_echo "$as_me: WARNING: $2:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
-$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
-( $as_echo "## ------------------------------------------------------------- ##
-## Report this to http://listserver.mbari.org/sympa/arc/mbsystem ##
-## ------------------------------------------------------------- ##"
-     ) | sed "s/^/$as_me: WARNING:     /" >&2
-    ;;
-esac
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-$as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  eval "$3=\$ac_header_compiler"
-fi
-eval ac_res=\$$3
-	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-fi
-  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-
-} # ac_fn_c_check_header_mongrel
-cat >config.log <<_ACEOF
-This file contains any messages produced by compilers while
-running configure, to aid debugging if configure makes a mistake.
-
-It was created by mbsystem $as_me 5.5.2252, which was
-generated by GNU Autoconf 2.69.  Invocation command line was
-
-  $ $0 $@
-
-_ACEOF
-exec 5>>config.log
-{
-cat <<_ASUNAME
-## --------- ##
-## Platform. ##
-## --------- ##
-
-hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
-uname -m = `(uname -m) 2>/dev/null || echo unknown`
-uname -r = `(uname -r) 2>/dev/null || echo unknown`
-uname -s = `(uname -s) 2>/dev/null || echo unknown`
-uname -v = `(uname -v) 2>/dev/null || echo unknown`
-
-/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
-/bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
-
-/bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
-/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
-/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
-/usr/bin/hostinfo      = `(/usr/bin/hostinfo) 2>/dev/null      || echo unknown`
-/bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
-/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
-/bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
-
-_ASUNAME
-
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    $as_echo "PATH: $as_dir"
-  done
-IFS=$as_save_IFS
-
-} >&5
-
-cat >&5 <<_ACEOF
-
-
-## ----------- ##
-## Core tests. ##
-## ----------- ##
-
-_ACEOF
-
-
-# Keep a trace of the command line.
-# Strip out --no-create and --no-recursion so they do not pile up.
-# Strip out --silent because we don't want to record it for future runs.
-# Also quote any args containing shell meta-characters.
-# Make two passes to allow for proper duplicate-argument suppression.
-ac_configure_args=
-ac_configure_args0=
-ac_configure_args1=
-ac_must_keep_next=false
-for ac_pass in 1 2
-do
-  for ac_arg
-  do
-    case $ac_arg in
-    -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
-    -q | -quiet | --quiet | --quie | --qui | --qu | --q \
-    | -silent | --silent | --silen | --sile | --sil)
-      continue ;;
-    *\'*)
-      ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
-    esac
-    case $ac_pass in
-    1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
-    2)
-      as_fn_append ac_configure_args1 " '$ac_arg'"
-      if test $ac_must_keep_next = true; then
-	ac_must_keep_next=false # Got value, back to normal.
-      else
-	case $ac_arg in
-	  *=* | --config-cache | -C | -disable-* | --disable-* \
-	  | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
-	  | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
-	  | -with-* | --with-* | -without-* | --without-* | --x)
-	    case "$ac_configure_args0 " in
-	      "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
-	    esac
-	    ;;
-	  -* ) ac_must_keep_next=true ;;
-	esac
-      fi
-      as_fn_append ac_configure_args " '$ac_arg'"
-      ;;
-    esac
-  done
-done
-{ ac_configure_args0=; unset ac_configure_args0;}
-{ ac_configure_args1=; unset ac_configure_args1;}
-
-# When interrupted or exit'd, cleanup temporary files, and complete
-# config.log.  We remove comments because anyway the quotes in there
-# would cause problems or look ugly.
-# WARNING: Use '\'' to represent an apostrophe within the trap.
-# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
-trap 'exit_status=$?
-  # Save into config.log some information that might help in debugging.
-  {
-    echo
-
-    $as_echo "## ---------------- ##
-## Cache variables. ##
-## ---------------- ##"
-    echo
-    # The following way of writing the cache mishandles newlines in values,
-(
-  for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
-    eval ac_val=\$$ac_var
-    case $ac_val in #(
-    *${as_nl}*)
-      case $ac_var in #(
-      *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
-$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
-      esac
-      case $ac_var in #(
-      _ | IFS | as_nl) ;; #(
-      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
-      *) { eval $ac_var=; unset $ac_var;} ;;
-      esac ;;
-    esac
-  done
-  (set) 2>&1 |
-    case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
-    *${as_nl}ac_space=\ *)
-      sed -n \
-	"s/'\''/'\''\\\\'\'''\''/g;
-	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
-      ;; #(
-    *)
-      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
-      ;;
-    esac |
-    sort
-)
-    echo
-
-    $as_echo "## ----------------- ##
-## Output variables. ##
-## ----------------- ##"
-    echo
-    for ac_var in $ac_subst_vars
-    do
-      eval ac_val=\$$ac_var
-      case $ac_val in
-      *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
-      esac
-      $as_echo "$ac_var='\''$ac_val'\''"
-    done | sort
-    echo
-
-    if test -n "$ac_subst_files"; then
-      $as_echo "## ------------------- ##
-## File substitutions. ##
-## ------------------- ##"
-      echo
-      for ac_var in $ac_subst_files
-      do
-	eval ac_val=\$$ac_var
-	case $ac_val in
-	*\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
-	esac
-	$as_echo "$ac_var='\''$ac_val'\''"
-      done | sort
-      echo
-    fi
-
-    if test -s confdefs.h; then
-      $as_echo "## ----------- ##
-## confdefs.h. ##
-## ----------- ##"
-      echo
-      cat confdefs.h
-      echo
-    fi
-    test "$ac_signal" != 0 &&
-      $as_echo "$as_me: caught signal $ac_signal"
-    $as_echo "$as_me: exit $exit_status"
-  } >&5
-  rm -f core *.core core.conftest.* &&
-    rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
-    exit $exit_status
-' 0
-for ac_signal in 1 2 13 15; do
-  trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal
-done
-ac_signal=0
-
-# confdefs.h avoids OS command line length limits that DEFS can exceed.
-rm -f -r conftest* confdefs.h
-
-$as_echo "/* confdefs.h */" > confdefs.h
-
-# Predefined preprocessor variables.
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_NAME "$PACKAGE_NAME"
-_ACEOF
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
-_ACEOF
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_VERSION "$PACKAGE_VERSION"
-_ACEOF
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_STRING "$PACKAGE_STRING"
-_ACEOF
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
-_ACEOF
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_URL "$PACKAGE_URL"
-_ACEOF
-
-
-# Let the site file select an alternate cache file if it wants to.
-# Prefer an explicitly selected file to automatically selected ones.
-ac_site_file1=NONE
-ac_site_file2=NONE
-if test -n "$CONFIG_SITE"; then
-  # We do not want a PATH search for config.site.
-  case $CONFIG_SITE in #((
-    -*)  ac_site_file1=./$CONFIG_SITE;;
-    */*) ac_site_file1=$CONFIG_SITE;;
-    *)   ac_site_file1=./$CONFIG_SITE;;
-  esac
-elif test "x$prefix" != xNONE; then
-  ac_site_file1=$prefix/share/config.site
-  ac_site_file2=$prefix/etc/config.site
-else
-  ac_site_file1=$ac_default_prefix/share/config.site
-  ac_site_file2=$ac_default_prefix/etc/config.site
-fi
-for ac_site_file in "$ac_site_file1" "$ac_site_file2"
-do
-  test "x$ac_site_file" = xNONE && continue
-  if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
-$as_echo "$as_me: loading site script $ac_site_file" >&6;}
-    sed 's/^/| /' "$ac_site_file" >&5
-    . "$ac_site_file" \
-      || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "failed to load site script $ac_site_file
-See \`config.log' for more details" "$LINENO" 5; }
-  fi
-done
-
-
-# Check that the precious variables saved in the cache have kept the same
-# value.
-ac_cache_corrupted=false
-for ac_var in $ac_precious_vars; do
-  eval ac_old_set=\$ac_cv_env_${ac_var}_set
-  eval ac_new_set=\$ac_env_${ac_var}_set
-  eval ac_old_val=\$ac_cv_env_${ac_var}_value
-  eval ac_new_val=\$ac_env_${ac_var}_value
-  case $ac_old_set,$ac_new_set in
-    set,)
-      { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
-$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
-      ac_cache_corrupted=: ;;
-    ,set)
-      { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
-$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
-      ac_cache_corrupted=: ;;
-    ,);;
-    *)
-      if test "x$ac_old_val" != "x$ac_new_val"; then
-	# differences in whitespace do not lead to failure.
-	ac_old_val_w=`echo x $ac_old_val`
-	ac_new_val_w=`echo x $ac_new_val`
-	if test "$ac_old_val_w" != "$ac_new_val_w"; then
-	  { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
-$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
-	  ac_cache_corrupted=:
-	else
-	  { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
-$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
-	  eval $ac_var=\$ac_old_val
-	fi
-	{ $as_echo "$as_me:${as_lineno-$LINENO}:   former value:  \`$ac_old_val'" >&5
-$as_echo "$as_me:   former value:  \`$ac_old_val'" >&2;}
-	{ $as_echo "$as_me:${as_lineno-$LINENO}:   current value: \`$ac_new_val'" >&5
-$as_echo "$as_me:   current value: \`$ac_new_val'" >&2;}
-      fi;;
-  esac
-  # Pass precious variables to config.status.
-  if test "$ac_new_set" = set; then
-    case $ac_new_val in
-    *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
-    *) ac_arg=$ac_var=$ac_new_val ;;
-    esac
-    case " $ac_configure_args " in
-      *" '$ac_arg' "*) ;; # Avoid dups.  Use of quotes ensures accuracy.
-      *) as_fn_append ac_configure_args " '$ac_arg'" ;;
-    esac
-  fi
-done
-if $ac_cache_corrupted; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-  { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
-$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
-  as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
-fi
-## -------------------- ##
-## Main body of script. ##
-## -------------------- ##
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-$as_echo "#define VERSION_DATE \"1 July 2015\"" >>confdefs.h
-
-
-ac_aux_dir=
-for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
-  if test -f "$ac_dir/install-sh"; then
-    ac_aux_dir=$ac_dir
-    ac_install_sh="$ac_aux_dir/install-sh -c"
-    break
-  elif test -f "$ac_dir/install.sh"; then
-    ac_aux_dir=$ac_dir
-    ac_install_sh="$ac_aux_dir/install.sh -c"
-    break
-  elif test -f "$ac_dir/shtool"; then
-    ac_aux_dir=$ac_dir
-    ac_install_sh="$ac_aux_dir/shtool install -c"
-    break
-  fi
-done
-if test -z "$ac_aux_dir"; then
-  as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5
-fi
-
-# These three variables are undocumented and unsupported,
-# and are intended to be withdrawn in a future Autoconf release.
-# They can cause serious problems if a builder's source tree is in a directory
-# whose full name contains unusual characters.
-ac_config_guess="$SHELL $ac_aux_dir/config.guess"  # Please don't use this var.
-ac_config_sub="$SHELL $ac_aux_dir/config.sub"  # Please don't use this var.
-ac_configure="$SHELL $ac_aux_dir/configure"  # Please don't use this var.
-
-
-# Make sure we can run config.sub.
-$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
-  as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
-$as_echo_n "checking build system type... " >&6; }
-if ${ac_cv_build+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_build_alias=$build_alias
-test "x$ac_build_alias" = x &&
-  ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
-test "x$ac_build_alias" = x &&
-  as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
-ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
-  as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
-$as_echo "$ac_cv_build" >&6; }
-case $ac_cv_build in
-*-*-*) ;;
-*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;;
-esac
-build=$ac_cv_build
-ac_save_IFS=$IFS; IFS='-'
-set x $ac_cv_build
-shift
-build_cpu=$1
-build_vendor=$2
-shift; shift
-# Remember, the first character of IFS is used to create $*,
-# except with old shells:
-build_os=$*
-IFS=$ac_save_IFS
-case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
-$as_echo_n "checking host system type... " >&6; }
-if ${ac_cv_host+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test "x$host_alias" = x; then
-  ac_cv_host=$ac_cv_build
-else
-  ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
-    as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
-$as_echo "$ac_cv_host" >&6; }
-case $ac_cv_host in
-*-*-*) ;;
-*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;;
-esac
-host=$ac_cv_host
-ac_save_IFS=$IFS; IFS='-'
-set x $ac_cv_host
-shift
-host_cpu=$1
-host_vendor=$2
-shift; shift
-# Remember, the first character of IFS is used to create $*,
-# except with old shells:
-host_os=$*
-IFS=$ac_save_IFS
-case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
-
-
-
-$as_echo " "
-$as_echo "------------------------------------------------------------------------------"
-$as_echo "    The MB-system:	configure	12/7/2011"
-$as_echo "    $Id: configure 2252 2015-07-01 19:35:37Z caress $"
-$as_echo " "
-$as_echo "    Copyright (c) 2011-2015 by"
-$as_echo "    D. W. Caress (caress at lamont.ldgo.columbia.edu)"
-$as_echo "    and D. N. Chayes (dale at lamont.ldgo.columbia.edu)"
-$as_echo "    Lamont-Doherty Earth Observatory"
-$as_echo "    Palisades, NY  10964"
-$as_echo " "
-$as_echo "    See README file for copying and redistribution conditions."
-$as_echo "------------------------------------------------------------------------------"
-$as_echo " "
-$as_echo "    The initial version of the MB-System autoconf-based build system"
-$as_echo "    was contributed by Bob Covill on 7 December 2011. Further"
-$as_echo "    refinement of the build system involved contributions from"
-$as_echo "    Bob Covill, Kurt Schwehr, Hamish Bowman, David Caress, and"
-$as_echo "    Christian Ferreira."
-$as_echo " "
-$as_echo "------------------------------------------------------------------------------"
-$as_echo "    To modify this build system..."
-$as_echo "------------------------------------------------------------------------------"
-$as_echo " "
-$as_echo "    Edit the file configure.ac in the top directory and the files"
-$as_echo "    Makefile.am in each directory under src. Then run the following sequence"
-$as_echo "    of commands:"
-$as_echo " "
-$as_echo "        # Build libtool files for LT_INIT"[]
-$as_echo "        libtoolize --force --copy"
-$as_echo "        aclocal"
-$as_echo " "
-$as_echo "        # Build custom header for configure"[]
-$as_echo "        autoheader"
-$as_echo "        automake --add-missing --include-deps"
-$as_echo "        autoconf"
-$as_echo " "
-$as_echo "        # To update configure files use the following:"[]
-$as_echo "        autoupdate"
-$as_echo "        autoreconf --force --install --warnings=all"
-$as_echo " "
-$as_echo "        # Reset the autotools version to 2.65 to accomodate some Linux distributions"[]
-$as_echo "        sed -i.bak s/2\.69/2\.65/ configure.ac"
-$as_echo " "
-$as_echo "    When you run ./configure, a number of configure options are saved to a"
-$as_echo "    header file:"
-$as_echo "        ./src/mbio/mb_config.h"
-$as_echo "    This file has a template:"
-$as_echo "        ./src/mbio/mb_config.h.in"
-$as_echo "    This file is conditionally included by:"
-$as_echo "        ./src/mbio/mb_define.h"
-$as_echo "    which is in turn included by essentially every MB-System C source file."
-$as_echo " "
-$as_echo "------------------------------------------------------------------------------"
-$as_echo "    To use the build system..."
-$as_echo "------------------------------------------------------------------------------"
-$as_echo "    To generate the makefiles needed to build MB-System, run ./configure"
-$as_echo "    with the options appropriate for your situation. These options are"
-$as_echo "    listed here:"
-$as_echo "        --prefix=install      - location for mbsystem (/usr/local/mbsystem)"
-$as_echo "        --with-netcdf-lib     - location of NetCDF libs"
-$as_echo "        --with-netcdf-include - location of NetCDF headers"
-$as_echo "        --with-proj-lib       - location of PROJ libs"
-$as_echo "        --with-proj-include   - location of PROJ headers"
-$as_echo "        --with-gmt-lib        - location of GMT libs"
-$as_echo "        --with-gmt-include    - location of GMT headers"
-$as_echo "        --with-fftw-lib       - location of FFTW3 libs (optional)"
-$as_echo "        --with-fftw-include   - location of FFTW3 headers (optional)"
-$as_echo "        --with-motif-lib      - location of Motif libs (optional)"
-$as_echo "        --with-motif-include  - location of Motif headers (optional)"
-$as_echo "        --with-opengl-lib     - location of OpenGL libs (optional)"
-$as_echo "        --with-opengl-include - location of OpenGL headers (optional)"
-$as_echo "        --with-otps-dir       - location of OTPS installation (optional)"
-$as_echo "        --enable-bundledproj  - build using bundled proj package - default is to link with libproj"
-$as_echo " "
-$as_echo "    After configure you can run the make utility in the usual fashion"
-$as_echo "        make"
-$as_echo "        make install"
-$as_echo " "
-$as_echo "    Some other useful make commands include: "
-$as_echo "        make clean (to clean up compiled code)"
-$as_echo "        make distclean (to clean up compiled code and configure output)"
-$as_echo "        make uninstall (to remove a previously installed version)"
-$as_echo "------------------------------------------------------------------------------"
-$as_echo " "
-$as_echo "Configure will now attempt to construct the Makefiles required to build MB-System"
-$as_echo "MB-System Version $PACKAGE_VERSION"
-$as_echo "HOST System Type: ${host}"
-$as_echo " "
-
-am__api_version='1.14'
-
-# Find a good install program.  We prefer a C program (faster),
-# so one script is as good as another.  But avoid the broken or
-# incompatible versions:
-# SysV /etc/install, /usr/sbin/install
-# SunOS /usr/etc/install
-# IRIX /sbin/install
-# AIX /bin/install
-# AmigaOS /C/install, which installs bootblocks on floppy discs
-# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
-# AFS /usr/afsws/bin/install, which mishandles nonexistent args
-# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
-# OS/2's system install, which has a completely different semantic
-# ./install, which can be erroneously created by make from ./install.sh.
-# Reject install programs that cannot install multiple files.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
-$as_echo_n "checking for a BSD-compatible install... " >&6; }
-if test -z "$INSTALL"; then
-if ${ac_cv_path_install+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    # Account for people who put trailing slashes in PATH elements.
-case $as_dir/ in #((
-  ./ | .// | /[cC]/* | \
-  /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
-  ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \
-  /usr/ucb/* ) ;;
-  *)
-    # OSF1 and SCO ODT 3.0 have their own names for install.
-    # Don't use installbsd from OSF since it installs stuff as root
-    # by default.
-    for ac_prog in ginstall scoinst install; do
-      for ac_exec_ext in '' $ac_executable_extensions; do
-	if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
-	  if test $ac_prog = install &&
-	    grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
-	    # AIX install.  It has an incompatible calling convention.
-	    :
-	  elif test $ac_prog = install &&
-	    grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
-	    # program-specific install script used by HP pwplus--don't use.
-	    :
-	  else
-	    rm -rf conftest.one conftest.two conftest.dir
-	    echo one > conftest.one
-	    echo two > conftest.two
-	    mkdir conftest.dir
-	    if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
-	      test -s conftest.one && test -s conftest.two &&
-	      test -s conftest.dir/conftest.one &&
-	      test -s conftest.dir/conftest.two
-	    then
-	      ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
-	      break 3
-	    fi
-	  fi
-	fi
-      done
-    done
-    ;;
-esac
-
-  done
-IFS=$as_save_IFS
-
-rm -rf conftest.one conftest.two conftest.dir
-
-fi
-  if test "${ac_cv_path_install+set}" = set; then
-    INSTALL=$ac_cv_path_install
-  else
-    # As a last resort, use the slow shell script.  Don't cache a
-    # value for INSTALL within a source directory, because that will
-    # break other packages using the cache if that directory is
-    # removed, or if the value is a relative name.
-    INSTALL=$ac_install_sh
-  fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5
-$as_echo "$INSTALL" >&6; }
-
-# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
-# It thinks the first close brace ends the variable substitution.
-test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
-
-test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
-
-test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5
-$as_echo_n "checking whether build environment is sane... " >&6; }
-# Reject unsafe characters in $srcdir or the absolute working directory
-# name.  Accept space and tab only in the latter.
-am_lf='
-'
-case `pwd` in
-  *[\\\"\#\$\&\'\`$am_lf]*)
-    as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;;
-esac
-case $srcdir in
-  *[\\\"\#\$\&\'\`$am_lf\ \	]*)
-    as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;;
-esac
-
-# Do 'set' in a subshell so we don't clobber the current shell's
-# arguments.  Must try -L first in case configure is actually a
-# symlink; some systems play weird games with the mod time of symlinks
-# (eg FreeBSD returns the mod time of the symlink's containing
-# directory).
-if (
-   am_has_slept=no
-   for am_try in 1 2; do
-     echo "timestamp, slept: $am_has_slept" > conftest.file
-     set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
-     if test "$*" = "X"; then
-	# -L didn't work.
-	set X `ls -t "$srcdir/configure" conftest.file`
-     fi
-     if test "$*" != "X $srcdir/configure conftest.file" \
-	&& test "$*" != "X conftest.file $srcdir/configure"; then
-
-	# If neither matched, then we have a broken ls.  This can happen
-	# if, for instance, CONFIG_SHELL is bash and it inherits a
-	# broken ls alias from the environment.  This has actually
-	# happened.  Such a system could not be considered "sane".
-	as_fn_error $? "ls -t appears to fail.  Make sure there is not a broken
-  alias in your environment" "$LINENO" 5
-     fi
-     if test "$2" = conftest.file || test $am_try -eq 2; then
-       break
-     fi
-     # Just in case.
-     sleep 1
-     am_has_slept=yes
-   done
-   test "$2" = conftest.file
-   )
-then
-   # Ok.
-   :
-else
-   as_fn_error $? "newly created file is older than distributed files!
-Check your system clock" "$LINENO" 5
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-# If we didn't sleep, we still need to ensure time stamps of config.status and
-# generated files are strictly newer.
-am_sleep_pid=
-if grep 'slept: no' conftest.file >/dev/null 2>&1; then
-  ( sleep 1 ) &
-  am_sleep_pid=$!
-fi
-
-rm -f conftest.file
-
-test "$program_prefix" != NONE &&
-  program_transform_name="s&^&$program_prefix&;$program_transform_name"
-# Use a double $ so make ignores it.
-test "$program_suffix" != NONE &&
-  program_transform_name="s&\$&$program_suffix&;$program_transform_name"
-# Double any \ or $.
-# By default was `s,x,x', remove it if useless.
-ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
-program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
-
-# expand $ac_aux_dir to an absolute path
-am_aux_dir=`cd $ac_aux_dir && pwd`
-
-if test x"${MISSING+set}" != xset; then
-  case $am_aux_dir in
-  *\ * | *\	*)
-    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
-  *)
-    MISSING="\${SHELL} $am_aux_dir/missing" ;;
-  esac
-fi
-# Use eval to expand $SHELL
-if eval "$MISSING --is-lightweight"; then
-  am_missing_run="$MISSING "
-else
-  am_missing_run=
-  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5
-$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;}
-fi
-
-if test x"${install_sh}" != xset; then
-  case $am_aux_dir in
-  *\ * | *\	*)
-    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
-  *)
-    install_sh="\${SHELL} $am_aux_dir/install-sh"
-  esac
-fi
-
-# Installed binaries are usually stripped using 'strip' when the user
-# run "make install-strip".  However 'strip' might not be the right
-# tool to use in cross-compilation environments, therefore Automake
-# will honor the 'STRIP' environment variable to overrule this program.
-if test "$cross_compiling" != no; then
-  if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
-set dummy ${ac_tool_prefix}strip; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_STRIP+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$STRIP"; then
-  ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_STRIP="${ac_tool_prefix}strip"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-STRIP=$ac_cv_prog_STRIP
-if test -n "$STRIP"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
-$as_echo "$STRIP" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_STRIP"; then
-  ac_ct_STRIP=$STRIP
-  # Extract the first word of "strip", so it can be a program name with args.
-set dummy strip; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$ac_ct_STRIP"; then
-  ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_ac_ct_STRIP="strip"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
-if test -n "$ac_ct_STRIP"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
-$as_echo "$ac_ct_STRIP" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-  if test "x$ac_ct_STRIP" = x; then
-    STRIP=":"
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
-    STRIP=$ac_ct_STRIP
-  fi
-else
-  STRIP="$ac_cv_prog_STRIP"
-fi
-
-fi
-INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5
-$as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
-if test -z "$MKDIR_P"; then
-  if ${ac_cv_path_mkdir+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_prog in mkdir gmkdir; do
-	 for ac_exec_ext in '' $ac_executable_extensions; do
-	   as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue
-	   case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
-	     'mkdir (GNU coreutils) '* | \
-	     'mkdir (coreutils) '* | \
-	     'mkdir (fileutils) '4.1*)
-	       ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
-	       break 3;;
-	   esac
-	 done
-       done
-  done
-IFS=$as_save_IFS
-
-fi
-
-  test -d ./--version && rmdir ./--version
-  if test "${ac_cv_path_mkdir+set}" = set; then
-    MKDIR_P="$ac_cv_path_mkdir -p"
-  else
-    # As a last resort, use the slow shell script.  Don't cache a
-    # value for MKDIR_P within a source directory, because that will
-    # break other packages using the cache if that directory is
-    # removed, or if the value is a relative name.
-    MKDIR_P="$ac_install_sh -d"
-  fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5
-$as_echo "$MKDIR_P" >&6; }
-
-for ac_prog in gawk mawk nawk awk
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_AWK+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$AWK"; then
-  ac_cv_prog_AWK="$AWK" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_AWK="$ac_prog"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-AWK=$ac_cv_prog_AWK
-if test -n "$AWK"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
-$as_echo "$AWK" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-  test -n "$AWK" && break
-done
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
-$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
-set x ${MAKE-make}
-ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
-if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.make <<\_ACEOF
-SHELL = /bin/sh
-all:
-	@echo '@@@%%%=$(MAKE)=@@@%%%'
-_ACEOF
-# GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
-case `${MAKE-make} -f conftest.make 2>/dev/null` in
-  *@@@%%%=?*=@@@%%%*)
-    eval ac_cv_prog_make_${ac_make}_set=yes;;
-  *)
-    eval ac_cv_prog_make_${ac_make}_set=no;;
-esac
-rm -f conftest.make
-fi
-if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-  SET_MAKE=
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-  SET_MAKE="MAKE=${MAKE-make}"
-fi
-
-rm -rf .tst 2>/dev/null
-mkdir .tst 2>/dev/null
-if test -d .tst; then
-  am__leading_dot=.
-else
-  am__leading_dot=_
-fi
-rmdir .tst 2>/dev/null
-
-# Check whether --enable-silent-rules was given.
-if test "${enable_silent_rules+set}" = set; then :
-  enableval=$enable_silent_rules;
-fi
-
-case $enable_silent_rules in # (((
-  yes) AM_DEFAULT_VERBOSITY=0;;
-   no) AM_DEFAULT_VERBOSITY=1;;
-    *) AM_DEFAULT_VERBOSITY=1;;
-esac
-am_make=${MAKE-make}
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5
-$as_echo_n "checking whether $am_make supports nested variables... " >&6; }
-if ${am_cv_make_support_nested_variables+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if $as_echo 'TRUE=$(BAR$(V))
-BAR0=false
-BAR1=true
-V=1
-am__doit:
-	@$(TRUE)
-.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then
-  am_cv_make_support_nested_variables=yes
-else
-  am_cv_make_support_nested_variables=no
-fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5
-$as_echo "$am_cv_make_support_nested_variables" >&6; }
-if test $am_cv_make_support_nested_variables = yes; then
-    AM_V='$(V)'
-  AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
-else
-  AM_V=$AM_DEFAULT_VERBOSITY
-  AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
-fi
-AM_BACKSLASH='\'
-
-if test "`cd $srcdir && pwd`" != "`pwd`"; then
-  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
-  # is not polluted with repeated "-I."
-  am__isrc=' -I$(srcdir)'
-  # test to see if srcdir already configured
-  if test -f $srcdir/config.status; then
-    as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5
-  fi
-fi
-
-# test whether we have cygpath
-if test -z "$CYGPATH_W"; then
-  if (cygpath --version) >/dev/null 2>/dev/null; then
-    CYGPATH_W='cygpath -w'
-  else
-    CYGPATH_W=echo
-  fi
-fi
-
-
-# Define the identity of the package.
- PACKAGE='mbsystem'
- VERSION='5.5.2252'
-
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE "$PACKAGE"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define VERSION "$VERSION"
-_ACEOF
-
-# Some tools Automake needs.
-
-ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
-
-
-AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
-
-
-AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
-
-
-AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
-
-
-MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
-
-# For better backward compatibility.  To be removed once Automake 1.9.x
-# dies out for good.  For more background, see:
-# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
-# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
-mkdir_p='$(MKDIR_P)'
-
-# We need awk for the "check" target.  The system "awk" is bad on
-# some platforms.
-# Always define AMTAR for backward compatibility.  Yes, it's still used
-# in the wild :-(  We should find a proper way to deprecate it ...
-AMTAR='$${TAR-tar}'
-
-
-# We'll loop over all known methods to create a tar archive until one works.
-_am_tools='gnutar  pax cpio none'
-
-am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'
-
-
-
-
-
-
-# POSIX will say in a future version that running "rm -f" with no argument
-# is OK; and we want to be able to make that assumption in our Makefile
-# recipes.  So use an aggressive probe to check that the usage we want is
-# actually supported "in the wild" to an acceptable degree.
-# See automake bug#10828.
-# To make any issue more visible, cause the running configure to be aborted
-# by default if the 'rm' program in use doesn't match our expectations; the
-# user can still override this though.
-if rm -f && rm -fr && rm -rf; then : OK; else
-  cat >&2 <<'END'
-Oops!
-
-Your 'rm' program seems unable to run without file operands specified
-on the command line, even when the '-f' option is present.  This is contrary
-to the behaviour of most rm programs out there, and not conforming with
-the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
-
-Please tell bug-automake at gnu.org about your system, including the value
-of your $PATH and any error possibly output before this message.  This
-can help us improve future automake versions.
-
-END
-  if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
-    echo 'Configuration will proceed anyway, since you have set the' >&2
-    echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
-    echo >&2
-  else
-    cat >&2 <<'END'
-Aborting the configuration process, to ensure you take notice of the issue.
-
-You can download and install GNU coreutils to get an 'rm' implementation
-that behaves properly: <http://www.gnu.org/software/coreutils/>.
-
-If you want to complete the configuration process using your problematic
-'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
-to "yes", and re-run configure.
-
-END
-    as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5
-  fi
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5
-$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; }
-    # Check whether --enable-maintainer-mode was given.
-if test "${enable_maintainer_mode+set}" = set; then :
-  enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval
-else
-  USE_MAINTAINER_MODE=no
-fi
-
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5
-$as_echo "$USE_MAINTAINER_MODE" >&6; }
-   if test $USE_MAINTAINER_MODE = yes; then
-  MAINTAINER_MODE_TRUE=
-  MAINTAINER_MODE_FALSE='#'
-else
-  MAINTAINER_MODE_TRUE='#'
-  MAINTAINER_MODE_FALSE=
-fi
-
-  MAINT=$MAINTAINER_MODE_TRUE
-
-
-ac_config_headers="$ac_config_headers src/mbio/mb_config.h"
-
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
-set dummy ${ac_tool_prefix}gcc; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$CC"; then
-  ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_CC="${ac_tool_prefix}gcc"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
-$as_echo "$CC" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_CC"; then
-  ac_ct_CC=$CC
-  # Extract the first word of "gcc", so it can be a program name with args.
-set dummy gcc; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_CC+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$ac_ct_CC"; then
-  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_ac_ct_CC="gcc"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_CC=$ac_cv_prog_ac_ct_CC
-if test -n "$ac_ct_CC"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
-$as_echo "$ac_ct_CC" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-  if test "x$ac_ct_CC" = x; then
-    CC=""
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
-    CC=$ac_ct_CC
-  fi
-else
-  CC="$ac_cv_prog_CC"
-fi
-
-if test -z "$CC"; then
-          if test -n "$ac_tool_prefix"; then
-    # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
-set dummy ${ac_tool_prefix}cc; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$CC"; then
-  ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_CC="${ac_tool_prefix}cc"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
-$as_echo "$CC" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-  fi
-fi
-if test -z "$CC"; then
-  # Extract the first word of "cc", so it can be a program name with args.
-set dummy cc; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$CC"; then
-  ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-  ac_prog_rejected=no
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
-       ac_prog_rejected=yes
-       continue
-     fi
-    ac_cv_prog_CC="cc"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-if test $ac_prog_rejected = yes; then
-  # We found a bogon in the path, so make sure we never use it.
-  set dummy $ac_cv_prog_CC
-  shift
-  if test $# != 0; then
-    # We chose a different compiler from the bogus one.
-    # However, it has the same basename, so the bogon will be chosen
-    # first if we set CC to just the basename; use the full file name.
-    shift
-    ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
-  fi
-fi
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
-$as_echo "$CC" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$CC"; then
-  if test -n "$ac_tool_prefix"; then
-  for ac_prog in cl.exe
-  do
-    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
-set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$CC"; then
-  ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
-$as_echo "$CC" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-    test -n "$CC" && break
-  done
-fi
-if test -z "$CC"; then
-  ac_ct_CC=$CC
-  for ac_prog in cl.exe
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_CC+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$ac_ct_CC"; then
-  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_ac_ct_CC="$ac_prog"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_CC=$ac_cv_prog_ac_ct_CC
-if test -n "$ac_ct_CC"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
-$as_echo "$ac_ct_CC" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-  test -n "$ac_ct_CC" && break
-done
-
-  if test "x$ac_ct_CC" = x; then
-    CC=""
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
-    CC=$ac_ct_CC
-  fi
-fi
-
-fi
-
-
-test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "no acceptable C compiler found in \$PATH
-See \`config.log' for more details" "$LINENO" 5; }
-
-# Provide some information about the compiler.
-$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
-set X $ac_compile
-ac_compiler=$2
-for ac_option in --version -v -V -qversion; do
-  { { ac_try="$ac_compiler $ac_option >&5"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_compiler $ac_option >&5") 2>conftest.err
-  ac_status=$?
-  if test -s conftest.err; then
-    sed '10a\
-... rest of stderr output deleted ...
-         10q' conftest.err >conftest.er1
-    cat conftest.er1 >&5
-  fi
-  rm -f conftest.er1 conftest.err
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }
-done
-
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-ac_clean_files_save=$ac_clean_files
-ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
-# Try to create an executable without -o first, disregard a.out.
-# It will help us diagnose broken compilers, and finding out an intuition
-# of exeext.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
-$as_echo_n "checking whether the C compiler works... " >&6; }
-ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
-
-# The possible output files:
-ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
-
-ac_rmfiles=
-for ac_file in $ac_files
-do
-  case $ac_file in
-    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
-    * ) ac_rmfiles="$ac_rmfiles $ac_file";;
-  esac
-done
-rm -f $ac_rmfiles
-
-if { { ac_try="$ac_link_default"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_link_default") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; then :
-  # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
-# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
-# in a Makefile.  We should not override ac_cv_exeext if it was cached,
-# so that the user can short-circuit this test for compilers unknown to
-# Autoconf.
-for ac_file in $ac_files ''
-do
-  test -f "$ac_file" || continue
-  case $ac_file in
-    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
-	;;
-    [ab].out )
-	# We found the default executable, but exeext='' is most
-	# certainly right.
-	break;;
-    *.* )
-	if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
-	then :; else
-	   ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
-	fi
-	# We set ac_cv_exeext here because the later test for it is not
-	# safe: cross compilers may not add the suffix if given an `-o'
-	# argument, so we may need to know it at that point already.
-	# Even if this section looks crufty: it has the advantage of
-	# actually working.
-	break;;
-    * )
-	break;;
-  esac
-done
-test "$ac_cv_exeext" = no && ac_cv_exeext=
-
-else
-  ac_file=''
-fi
-if test -z "$ac_file"; then :
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-$as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error 77 "C compiler cannot create executables
-See \`config.log' for more details" "$LINENO" 5; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
-$as_echo_n "checking for C compiler default output file name... " >&6; }
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
-$as_echo "$ac_file" >&6; }
-ac_exeext=$ac_cv_exeext
-
-rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
-ac_clean_files=$ac_clean_files_save
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
-$as_echo_n "checking for suffix of executables... " >&6; }
-if { { ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_link") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; then :
-  # If both `conftest.exe' and `conftest' are `present' (well, observable)
-# catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
-# work properly (i.e., refer to `conftest.exe'), while it won't with
-# `rm'.
-for ac_file in conftest.exe conftest conftest.*; do
-  test -f "$ac_file" || continue
-  case $ac_file in
-    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
-    *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
-	  break;;
-    * ) break;;
-  esac
-done
-else
-  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "cannot compute suffix of executables: cannot compile and link
-See \`config.log' for more details" "$LINENO" 5; }
-fi
-rm -f conftest conftest$ac_cv_exeext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
-$as_echo "$ac_cv_exeext" >&6; }
-
-rm -f conftest.$ac_ext
-EXEEXT=$ac_cv_exeext
-ac_exeext=$EXEEXT
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <stdio.h>
-int
-main ()
-{
-FILE *f = fopen ("conftest.out", "w");
- return ferror (f) || fclose (f) != 0;
-
-  ;
-  return 0;
-}
-_ACEOF
-ac_clean_files="$ac_clean_files conftest.out"
-# Check that the compiler produces executables we can run.  If not, either
-# the compiler is broken, or we cross compile.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
-$as_echo_n "checking whether we are cross compiling... " >&6; }
-if test "$cross_compiling" != yes; then
-  { { ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_link") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }
-  if { ac_try='./conftest$ac_cv_exeext'
-  { { case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_try") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; }; then
-    cross_compiling=no
-  else
-    if test "$cross_compiling" = maybe; then
-	cross_compiling=yes
-    else
-	{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "cannot run C compiled programs.
-If you meant to cross compile, use \`--host'.
-See \`config.log' for more details" "$LINENO" 5; }
-    fi
-  fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
-$as_echo "$cross_compiling" >&6; }
-
-rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
-ac_clean_files=$ac_clean_files_save
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
-$as_echo_n "checking for suffix of object files... " >&6; }
-if ${ac_cv_objext+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.o conftest.obj
-if { { ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_compile") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; then :
-  for ac_file in conftest.o conftest.obj conftest.*; do
-  test -f "$ac_file" || continue;
-  case $ac_file in
-    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
-    *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
-       break;;
-  esac
-done
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "cannot compute suffix of object files: cannot compile
-See \`config.log' for more details" "$LINENO" 5; }
-fi
-rm -f conftest.$ac_cv_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
-$as_echo "$ac_cv_objext" >&6; }
-OBJEXT=$ac_cv_objext
-ac_objext=$OBJEXT
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
-$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
-if ${ac_cv_c_compiler_gnu+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-#ifndef __GNUC__
-       choke me
-#endif
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_compiler_gnu=yes
-else
-  ac_compiler_gnu=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-ac_cv_c_compiler_gnu=$ac_compiler_gnu
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
-$as_echo "$ac_cv_c_compiler_gnu" >&6; }
-if test $ac_compiler_gnu = yes; then
-  GCC=yes
-else
-  GCC=
-fi
-ac_test_CFLAGS=${CFLAGS+set}
-ac_save_CFLAGS=$CFLAGS
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
-$as_echo_n "checking whether $CC accepts -g... " >&6; }
-if ${ac_cv_prog_cc_g+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_save_c_werror_flag=$ac_c_werror_flag
-   ac_c_werror_flag=yes
-   ac_cv_prog_cc_g=no
-   CFLAGS="-g"
-   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_prog_cc_g=yes
-else
-  CFLAGS=""
-      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
-else
-  ac_c_werror_flag=$ac_save_c_werror_flag
-	 CFLAGS="-g"
-	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_prog_cc_g=yes
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-   ac_c_werror_flag=$ac_save_c_werror_flag
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
-$as_echo "$ac_cv_prog_cc_g" >&6; }
-if test "$ac_test_CFLAGS" = set; then
-  CFLAGS=$ac_save_CFLAGS
-elif test $ac_cv_prog_cc_g = yes; then
-  if test "$GCC" = yes; then
-    CFLAGS="-g -O2"
-  else
-    CFLAGS="-g"
-  fi
-else
-  if test "$GCC" = yes; then
-    CFLAGS="-O2"
-  else
-    CFLAGS=
-  fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
-$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
-if ${ac_cv_prog_cc_c89+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_cv_prog_cc_c89=no
-ac_save_CC=$CC
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <stdarg.h>
-#include <stdio.h>
-struct stat;
-/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
-struct buf { int x; };
-FILE * (*rcsopen) (struct buf *, struct stat *, int);
-static char *e (p, i)
-     char **p;
-     int i;
-{
-  return p[i];
-}
-static char *f (char * (*g) (char **, int), char **p, ...)
-{
-  char *s;
-  va_list v;
-  va_start (v,p);
-  s = g (p, va_arg (v,int));
-  va_end (v);
-  return s;
-}
-
-/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has
-   function prototypes and stuff, but not '\xHH' hex character constants.
-   These don't provoke an error unfortunately, instead are silently treated
-   as 'x'.  The following induces an error, until -std is added to get
-   proper ANSI mode.  Curiously '\x00'!='x' always comes out true, for an
-   array size at least.  It's necessary to write '\x00'==0 to get something
-   that's true only with -std.  */
-int osf4_cc_array ['\x00' == 0 ? 1 : -1];
-
-/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
-   inside strings and character constants.  */
-#define FOO(x) 'x'
-int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
-
-int test (int i, double x);
-struct s1 {int (*f) (int a);};
-struct s2 {int (*f) (double a);};
-int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
-int argc;
-char **argv;
-int
-main ()
-{
-return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
-  ;
-  return 0;
-}
-_ACEOF
-for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
-	-Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
-do
-  CC="$ac_save_CC $ac_arg"
-  if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_prog_cc_c89=$ac_arg
-fi
-rm -f core conftest.err conftest.$ac_objext
-  test "x$ac_cv_prog_cc_c89" != "xno" && break
-done
-rm -f conftest.$ac_ext
-CC=$ac_save_CC
-
-fi
-# AC_CACHE_VAL
-case "x$ac_cv_prog_cc_c89" in
-  x)
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
-$as_echo "none needed" >&6; } ;;
-  xno)
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
-$as_echo "unsupported" >&6; } ;;
-  *)
-    CC="$CC $ac_cv_prog_cc_c89"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
-$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
-esac
-if test "x$ac_cv_prog_cc_c89" != xno; then :
-
-fi
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5
-$as_echo_n "checking whether $CC understands -c and -o together... " >&6; }
-if ${am_cv_prog_cc_c_o+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-  # Make sure it works both with $CC and with simple cc.
-  # Following AC_PROG_CC_C_O, we do the test twice because some
-  # compilers refuse to overwrite an existing .o file with -o,
-  # though they will create one.
-  am_cv_prog_cc_c_o=yes
-  for am_i in 1 2; do
-    if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5
-   ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5
-   ac_status=$?
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } \
-         && test -f conftest2.$ac_objext; then
-      : OK
-    else
-      am_cv_prog_cc_c_o=no
-      break
-    fi
-  done
-  rm -f core conftest*
-  unset am_i
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5
-$as_echo "$am_cv_prog_cc_c_o" >&6; }
-if test "$am_cv_prog_cc_c_o" != yes; then
-   # Losing compiler, so override with the script.
-   # FIXME: It is wrong to rewrite CC.
-   # But if we don't then we get into trouble of one sort or another.
-   # A longer-term fix would be to have automake use am__CC in this case,
-   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
-   CC="$am_aux_dir/compile $CC"
-fi
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-DEPDIR="${am__leading_dot}deps"
-
-ac_config_commands="$ac_config_commands depfiles"
-
-
-am_make=${MAKE-make}
-cat > confinc << 'END'
-am__doit:
-	@echo this is the am__doit target
-.PHONY: am__doit
-END
-# If we don't find an include directive, just comment out the code.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5
-$as_echo_n "checking for style of include used by $am_make... " >&6; }
-am__include="#"
-am__quote=
-_am_result=none
-# First try GNU make style include.
-echo "include confinc" > confmf
-# Ignore all kinds of additional output from 'make'.
-case `$am_make -s -f confmf 2> /dev/null` in #(
-*the\ am__doit\ target*)
-  am__include=include
-  am__quote=
-  _am_result=GNU
-  ;;
-esac
-# Now try BSD make style include.
-if test "$am__include" = "#"; then
-   echo '.include "confinc"' > confmf
-   case `$am_make -s -f confmf 2> /dev/null` in #(
-   *the\ am__doit\ target*)
-     am__include=.include
-     am__quote="\""
-     _am_result=BSD
-     ;;
-   esac
-fi
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5
-$as_echo "$_am_result" >&6; }
-rm -f confinc confmf
-
-# Check whether --enable-dependency-tracking was given.
-if test "${enable_dependency_tracking+set}" = set; then :
-  enableval=$enable_dependency_tracking;
-fi
-
-if test "x$enable_dependency_tracking" != xno; then
-  am_depcomp="$ac_aux_dir/depcomp"
-  AMDEPBACKSLASH='\'
-  am__nodep='_no'
-fi
- if test "x$enable_dependency_tracking" != xno; then
-  AMDEP_TRUE=
-  AMDEP_FALSE='#'
-else
-  AMDEP_TRUE='#'
-  AMDEP_FALSE=
-fi
-
-
-
-depcc="$CC"   am_compiler_list=
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
-$as_echo_n "checking dependency style of $depcc... " >&6; }
-if ${am_cv_CC_dependencies_compiler_type+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
-  # We make a subdir and do the tests there.  Otherwise we can end up
-  # making bogus files that we don't know about and never remove.  For
-  # instance it was reported that on HP-UX the gcc test will end up
-  # making a dummy file named 'D' -- because '-MD' means "put the output
-  # in D".
-  rm -rf conftest.dir
-  mkdir conftest.dir
-  # Copy depcomp to subdir because otherwise we won't find it if we're
-  # using a relative directory.
-  cp "$am_depcomp" conftest.dir
-  cd conftest.dir
-  # We will build objects and dependencies in a subdirectory because
-  # it helps to detect inapplicable dependency modes.  For instance
-  # both Tru64's cc and ICC support -MD to output dependencies as a
-  # side effect of compilation, but ICC will put the dependencies in
-  # the current directory while Tru64 will put them in the object
-  # directory.
-  mkdir sub
-
-  am_cv_CC_dependencies_compiler_type=none
-  if test "$am_compiler_list" = ""; then
-     am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
-  fi
-  am__universal=false
-  case " $depcc " in #(
-     *\ -arch\ *\ -arch\ *) am__universal=true ;;
-     esac
-
-  for depmode in $am_compiler_list; do
-    # Setup a source with many dependencies, because some compilers
-    # like to wrap large dependency lists on column 80 (with \), and
-    # we should not choose a depcomp mode which is confused by this.
-    #
-    # We need to recreate these files for each test, as the compiler may
-    # overwrite some of them when testing with obscure command lines.
-    # This happens at least with the AIX C compiler.
-    : > sub/conftest.c
-    for i in 1 2 3 4 5 6; do
-      echo '#include "conftst'$i'.h"' >> sub/conftest.c
-      # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
-      # Solaris 10 /bin/sh.
-      echo '/* dummy */' > sub/conftst$i.h
-    done
-    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
-
-    # We check with '-c' and '-o' for the sake of the "dashmstdout"
-    # mode.  It turns out that the SunPro C++ compiler does not properly
-    # handle '-M -o', and we need to detect this.  Also, some Intel
-    # versions had trouble with output in subdirs.
-    am__obj=sub/conftest.${OBJEXT-o}
-    am__minus_obj="-o $am__obj"
-    case $depmode in
-    gcc)
-      # This depmode causes a compiler race in universal mode.
-      test "$am__universal" = false || continue
-      ;;
-    nosideeffect)
-      # After this tag, mechanisms are not by side-effect, so they'll
-      # only be used when explicitly requested.
-      if test "x$enable_dependency_tracking" = xyes; then
-	continue
-      else
-	break
-      fi
-      ;;
-    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
-      # This compiler won't grok '-c -o', but also, the minuso test has
-      # not run yet.  These depmodes are late enough in the game, and
-      # so weak that their functioning should not be impacted.
-      am__obj=conftest.${OBJEXT-o}
-      am__minus_obj=
-      ;;
-    none) break ;;
-    esac
-    if depmode=$depmode \
-       source=sub/conftest.c object=$am__obj \
-       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
-       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
-         >/dev/null 2>conftest.err &&
-       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
-       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
-       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
-       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
-      # icc doesn't choke on unknown options, it will just issue warnings
-      # or remarks (even with -Werror).  So we grep stderr for any message
-      # that says an option was ignored or not supported.
-      # When given -MP, icc 7.0 and 7.1 complain thusly:
-      #   icc: Command line warning: ignoring option '-M'; no argument required
-      # The diagnosis changed in icc 8.0:
-      #   icc: Command line remark: option '-MP' not supported
-      if (grep 'ignoring option' conftest.err ||
-          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
-        am_cv_CC_dependencies_compiler_type=$depmode
-        break
-      fi
-    fi
-  done
-
-  cd ..
-  rm -rf conftest.dir
-else
-  am_cv_CC_dependencies_compiler_type=none
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5
-$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; }
-CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
-
- if
-  test "x$enable_dependency_tracking" != xno \
-  && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
-  am__fastdepCC_TRUE=
-  am__fastdepCC_FALSE='#'
-else
-  am__fastdepCC_TRUE='#'
-  am__fastdepCC_FALSE=
-fi
-
-
-
-
-# By default we simply use the C compiler to build assembly code.
-
-test "${CCAS+set}" = set || CCAS=$CC
-test "${CCASFLAGS+set}" = set || CCASFLAGS=$CFLAGS
-
-
-
-depcc="$CCAS"   am_compiler_list=
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
-$as_echo_n "checking dependency style of $depcc... " >&6; }
-if ${am_cv_CCAS_dependencies_compiler_type+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
-  # We make a subdir and do the tests there.  Otherwise we can end up
-  # making bogus files that we don't know about and never remove.  For
-  # instance it was reported that on HP-UX the gcc test will end up
-  # making a dummy file named 'D' -- because '-MD' means "put the output
-  # in D".
-  rm -rf conftest.dir
-  mkdir conftest.dir
-  # Copy depcomp to subdir because otherwise we won't find it if we're
-  # using a relative directory.
-  cp "$am_depcomp" conftest.dir
-  cd conftest.dir
-  # We will build objects and dependencies in a subdirectory because
-  # it helps to detect inapplicable dependency modes.  For instance
-  # both Tru64's cc and ICC support -MD to output dependencies as a
-  # side effect of compilation, but ICC will put the dependencies in
-  # the current directory while Tru64 will put them in the object
-  # directory.
-  mkdir sub
-
-  am_cv_CCAS_dependencies_compiler_type=none
-  if test "$am_compiler_list" = ""; then
-     am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
-  fi
-  am__universal=false
-
-
-  for depmode in $am_compiler_list; do
-    # Setup a source with many dependencies, because some compilers
-    # like to wrap large dependency lists on column 80 (with \), and
-    # we should not choose a depcomp mode which is confused by this.
-    #
-    # We need to recreate these files for each test, as the compiler may
-    # overwrite some of them when testing with obscure command lines.
-    # This happens at least with the AIX C compiler.
-    : > sub/conftest.c
-    for i in 1 2 3 4 5 6; do
-      echo '#include "conftst'$i'.h"' >> sub/conftest.c
-      # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
-      # Solaris 10 /bin/sh.
-      echo '/* dummy */' > sub/conftst$i.h
-    done
-    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
-
-    # We check with '-c' and '-o' for the sake of the "dashmstdout"
-    # mode.  It turns out that the SunPro C++ compiler does not properly
-    # handle '-M -o', and we need to detect this.  Also, some Intel
-    # versions had trouble with output in subdirs.
-    am__obj=sub/conftest.${OBJEXT-o}
-    am__minus_obj="-o $am__obj"
-    case $depmode in
-    gcc)
-      # This depmode causes a compiler race in universal mode.
-      test "$am__universal" = false || continue
-      ;;
-    nosideeffect)
-      # After this tag, mechanisms are not by side-effect, so they'll
-      # only be used when explicitly requested.
-      if test "x$enable_dependency_tracking" = xyes; then
-	continue
-      else
-	break
-      fi
-      ;;
-    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
-      # This compiler won't grok '-c -o', but also, the minuso test has
-      # not run yet.  These depmodes are late enough in the game, and
-      # so weak that their functioning should not be impacted.
-      am__obj=conftest.${OBJEXT-o}
-      am__minus_obj=
-      ;;
-    none) break ;;
-    esac
-    if depmode=$depmode \
-       source=sub/conftest.c object=$am__obj \
-       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
-       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
-         >/dev/null 2>conftest.err &&
-       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
-       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
-       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
-       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
-      # icc doesn't choke on unknown options, it will just issue warnings
-      # or remarks (even with -Werror).  So we grep stderr for any message
-      # that says an option was ignored or not supported.
-      # When given -MP, icc 7.0 and 7.1 complain thusly:
-      #   icc: Command line warning: ignoring option '-M'; no argument required
-      # The diagnosis changed in icc 8.0:
-      #   icc: Command line remark: option '-MP' not supported
-      if (grep 'ignoring option' conftest.err ||
-          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
-        am_cv_CCAS_dependencies_compiler_type=$depmode
-        break
-      fi
-    fi
-  done
-
-  cd ..
-  rm -rf conftest.dir
-else
-  am_cv_CCAS_dependencies_compiler_type=none
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CCAS_dependencies_compiler_type" >&5
-$as_echo "$am_cv_CCAS_dependencies_compiler_type" >&6; }
-CCASDEPMODE=depmode=$am_cv_CCAS_dependencies_compiler_type
-
- if
-  test "x$enable_dependency_tracking" != xno \
-  && test "$am_cv_CCAS_dependencies_compiler_type" = gcc3; then
-  am__fastdepCCAS_TRUE=
-  am__fastdepCCAS_FALSE='#'
-else
-  am__fastdepCCAS_TRUE='#'
-  am__fastdepCCAS_FALSE=
-fi
-
-
-
-if test -n "$ac_tool_prefix"; then
-  for ac_prog in ar lib "link -lib"
-  do
-    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
-set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_AR+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$AR"; then
-  ac_cv_prog_AR="$AR" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_AR="$ac_tool_prefix$ac_prog"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-AR=$ac_cv_prog_AR
-if test -n "$AR"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
-$as_echo "$AR" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-    test -n "$AR" && break
-  done
-fi
-if test -z "$AR"; then
-  ac_ct_AR=$AR
-  for ac_prog in ar lib "link -lib"
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_AR+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$ac_ct_AR"; then
-  ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_ac_ct_AR="$ac_prog"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_AR=$ac_cv_prog_ac_ct_AR
-if test -n "$ac_ct_AR"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
-$as_echo "$ac_ct_AR" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-  test -n "$ac_ct_AR" && break
-done
-
-  if test "x$ac_ct_AR" = x; then
-    AR="false"
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
-    AR=$ac_ct_AR
-  fi
-fi
-
-: ${AR=ar}
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the archiver ($AR) interface" >&5
-$as_echo_n "checking the archiver ($AR) interface... " >&6; }
-if ${am_cv_ar_interface+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-   am_cv_ar_interface=ar
-   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-int some_variable = 0;
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  am_ar_try='$AR cru libconftest.a conftest.$ac_objext >&5'
-      { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$am_ar_try\""; } >&5
-  (eval $am_ar_try) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }
-      if test "$ac_status" -eq 0; then
-        am_cv_ar_interface=ar
-      else
-        am_ar_try='$AR -NOLOGO -OUT:conftest.lib conftest.$ac_objext >&5'
-        { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$am_ar_try\""; } >&5
-  (eval $am_ar_try) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }
-        if test "$ac_status" -eq 0; then
-          am_cv_ar_interface=lib
-        else
-          am_cv_ar_interface=unknown
-        fi
-      fi
-      rm -f conftest.lib libconftest.a
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-   ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_ar_interface" >&5
-$as_echo "$am_cv_ar_interface" >&6; }
-
-case $am_cv_ar_interface in
-ar)
-  ;;
-lib)
-  # Microsoft lib, so override with the ar-lib wrapper script.
-  # FIXME: It is wrong to rewrite AR.
-  # But if we don't then we get into trouble of one sort or another.
-  # A longer-term fix would be to have automake use am__AR in this case,
-  # and then we could set am__AR="$am_aux_dir/ar-lib \$(AR)" or something
-  # similar.
-  AR="$am_aux_dir/ar-lib $AR"
-  ;;
-unknown)
-  as_fn_error $? "could not determine $AR interface" "$LINENO" 5
-  ;;
-esac
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5
-$as_echo_n "checking whether ln -s works... " >&6; }
-LN_S=$as_ln_s
-if test "$LN_S" = "ln -s"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5
-$as_echo "no, using $LN_S" >&6; }
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
-$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
-set x ${MAKE-make}
-ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
-if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.make <<\_ACEOF
-SHELL = /bin/sh
-all:
-	@echo '@@@%%%=$(MAKE)=@@@%%%'
-_ACEOF
-# GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
-case `${MAKE-make} -f conftest.make 2>/dev/null` in
-  *@@@%%%=?*=@@@%%%*)
-    eval ac_cv_prog_make_${ac_make}_set=yes;;
-  *)
-    eval ac_cv_prog_make_${ac_make}_set=no;;
-esac
-rm -f conftest.make
-fi
-if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-  SET_MAKE=
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-  SET_MAKE="MAKE=${MAKE-make}"
-fi
-
-case `pwd` in
-  *\ * | *\	*)
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5
-$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;;
-esac
-
-
-
-macro_version='2.4.6'
-macro_revision='2.4.6'
-
-
-
-
-
-
-
-
-
-
-
-
-
-ltmain=$ac_aux_dir/ltmain.sh
-
-# Backslashify metacharacters that are still active within
-# double-quoted strings.
-sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
-
-# Same as above, but do not quote variable references.
-double_quote_subst='s/\(["`\\]\)/\\\1/g'
-
-# Sed substitution to delay expansion of an escaped shell variable in a
-# double_quote_subst'ed string.
-delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
-
-# Sed substitution to delay expansion of an escaped single quote.
-delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
-
-# Sed substitution to avoid accidental globbing in evaled expressions
-no_glob_subst='s/\*/\\\*/g'
-
-ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
-ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
-ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5
-$as_echo_n "checking how to print strings... " >&6; }
-# Test print first, because it will be a builtin if present.
-if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
-   test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
-  ECHO='print -r --'
-elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
-  ECHO='printf %s\n'
-else
-  # Use this function as a fallback that always works.
-  func_fallback_echo ()
-  {
-    eval 'cat <<_LTECHO_EOF
-$1
-_LTECHO_EOF'
-  }
-  ECHO='func_fallback_echo'
-fi
-
-# func_echo_all arg...
-# Invoke $ECHO with all args, space-separated.
-func_echo_all ()
-{
-    $ECHO ""
-}
-
-case $ECHO in
-  printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5
-$as_echo "printf" >&6; } ;;
-  print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5
-$as_echo "print -r" >&6; } ;;
-  *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5
-$as_echo "cat" >&6; } ;;
-esac
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5
-$as_echo_n "checking for a sed that does not truncate output... " >&6; }
-if ${ac_cv_path_SED+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-            ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
-     for ac_i in 1 2 3 4 5 6 7; do
-       ac_script="$ac_script$as_nl$ac_script"
-     done
-     echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed
-     { ac_script=; unset ac_script;}
-     if test -z "$SED"; then
-  ac_path_SED_found=false
-  # Loop through the user's path and test for each of PROGNAME-LIST
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_prog in sed gsed; do
-    for ac_exec_ext in '' $ac_executable_extensions; do
-      ac_path_SED="$as_dir/$ac_prog$ac_exec_ext"
-      as_fn_executable_p "$ac_path_SED" || continue
-# Check for GNU ac_path_SED and select it if it is found.
-  # Check for GNU $ac_path_SED
-case `"$ac_path_SED" --version 2>&1` in
-*GNU*)
-  ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;;
-*)
-  ac_count=0
-  $as_echo_n 0123456789 >"conftest.in"
-  while :
-  do
-    cat "conftest.in" "conftest.in" >"conftest.tmp"
-    mv "conftest.tmp" "conftest.in"
-    cp "conftest.in" "conftest.nl"
-    $as_echo '' >> "conftest.nl"
-    "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break
-    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
-    as_fn_arith $ac_count + 1 && ac_count=$as_val
-    if test $ac_count -gt ${ac_path_SED_max-0}; then
-      # Best one so far, save it but keep looking for a better one
-      ac_cv_path_SED="$ac_path_SED"
-      ac_path_SED_max=$ac_count
-    fi
-    # 10*(2^10) chars as input seems more than enough
-    test $ac_count -gt 10 && break
-  done
-  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
-esac
-
-      $ac_path_SED_found && break 3
-    done
-  done
-  done
-IFS=$as_save_IFS
-  if test -z "$ac_cv_path_SED"; then
-    as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5
-  fi
-else
-  ac_cv_path_SED=$SED
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5
-$as_echo "$ac_cv_path_SED" >&6; }
- SED="$ac_cv_path_SED"
-  rm -f conftest.sed
-
-test -z "$SED" && SED=sed
-Xsed="$SED -e 1s/^X//"
-
-
-
-
-
-
-
-
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
-$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
-if ${ac_cv_path_GREP+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -z "$GREP"; then
-  ac_path_GREP_found=false
-  # Loop through the user's path and test for each of PROGNAME-LIST
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_prog in grep ggrep; do
-    for ac_exec_ext in '' $ac_executable_extensions; do
-      ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
-      as_fn_executable_p "$ac_path_GREP" || continue
-# Check for GNU ac_path_GREP and select it if it is found.
-  # Check for GNU $ac_path_GREP
-case `"$ac_path_GREP" --version 2>&1` in
-*GNU*)
-  ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
-*)
-  ac_count=0
-  $as_echo_n 0123456789 >"conftest.in"
-  while :
-  do
-    cat "conftest.in" "conftest.in" >"conftest.tmp"
-    mv "conftest.tmp" "conftest.in"
-    cp "conftest.in" "conftest.nl"
-    $as_echo 'GREP' >> "conftest.nl"
-    "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
-    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
-    as_fn_arith $ac_count + 1 && ac_count=$as_val
-    if test $ac_count -gt ${ac_path_GREP_max-0}; then
-      # Best one so far, save it but keep looking for a better one
-      ac_cv_path_GREP="$ac_path_GREP"
-      ac_path_GREP_max=$ac_count
-    fi
-    # 10*(2^10) chars as input seems more than enough
-    test $ac_count -gt 10 && break
-  done
-  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
-esac
-
-      $ac_path_GREP_found && break 3
-    done
-  done
-  done
-IFS=$as_save_IFS
-  if test -z "$ac_cv_path_GREP"; then
-    as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
-  fi
-else
-  ac_cv_path_GREP=$GREP
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
-$as_echo "$ac_cv_path_GREP" >&6; }
- GREP="$ac_cv_path_GREP"
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
-$as_echo_n "checking for egrep... " >&6; }
-if ${ac_cv_path_EGREP+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
-   then ac_cv_path_EGREP="$GREP -E"
-   else
-     if test -z "$EGREP"; then
-  ac_path_EGREP_found=false
-  # Loop through the user's path and test for each of PROGNAME-LIST
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_prog in egrep; do
-    for ac_exec_ext in '' $ac_executable_extensions; do
-      ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
-      as_fn_executable_p "$ac_path_EGREP" || continue
-# Check for GNU ac_path_EGREP and select it if it is found.
-  # Check for GNU $ac_path_EGREP
-case `"$ac_path_EGREP" --version 2>&1` in
-*GNU*)
-  ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
-*)
-  ac_count=0
-  $as_echo_n 0123456789 >"conftest.in"
-  while :
-  do
-    cat "conftest.in" "conftest.in" >"conftest.tmp"
-    mv "conftest.tmp" "conftest.in"
-    cp "conftest.in" "conftest.nl"
-    $as_echo 'EGREP' >> "conftest.nl"
-    "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
-    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
-    as_fn_arith $ac_count + 1 && ac_count=$as_val
-    if test $ac_count -gt ${ac_path_EGREP_max-0}; then
-      # Best one so far, save it but keep looking for a better one
-      ac_cv_path_EGREP="$ac_path_EGREP"
-      ac_path_EGREP_max=$ac_count
-    fi
-    # 10*(2^10) chars as input seems more than enough
-    test $ac_count -gt 10 && break
-  done
-  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
-esac
-
-      $ac_path_EGREP_found && break 3
-    done
-  done
-  done
-IFS=$as_save_IFS
-  if test -z "$ac_cv_path_EGREP"; then
-    as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
-  fi
-else
-  ac_cv_path_EGREP=$EGREP
-fi
-
-   fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
-$as_echo "$ac_cv_path_EGREP" >&6; }
- EGREP="$ac_cv_path_EGREP"
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5
-$as_echo_n "checking for fgrep... " >&6; }
-if ${ac_cv_path_FGREP+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1
-   then ac_cv_path_FGREP="$GREP -F"
-   else
-     if test -z "$FGREP"; then
-  ac_path_FGREP_found=false
-  # Loop through the user's path and test for each of PROGNAME-LIST
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_prog in fgrep; do
-    for ac_exec_ext in '' $ac_executable_extensions; do
-      ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext"
-      as_fn_executable_p "$ac_path_FGREP" || continue
-# Check for GNU ac_path_FGREP and select it if it is found.
-  # Check for GNU $ac_path_FGREP
-case `"$ac_path_FGREP" --version 2>&1` in
-*GNU*)
-  ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;;
-*)
-  ac_count=0
-  $as_echo_n 0123456789 >"conftest.in"
-  while :
-  do
-    cat "conftest.in" "conftest.in" >"conftest.tmp"
-    mv "conftest.tmp" "conftest.in"
-    cp "conftest.in" "conftest.nl"
-    $as_echo 'FGREP' >> "conftest.nl"
-    "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break
-    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
-    as_fn_arith $ac_count + 1 && ac_count=$as_val
-    if test $ac_count -gt ${ac_path_FGREP_max-0}; then
-      # Best one so far, save it but keep looking for a better one
-      ac_cv_path_FGREP="$ac_path_FGREP"
-      ac_path_FGREP_max=$ac_count
-    fi
-    # 10*(2^10) chars as input seems more than enough
-    test $ac_count -gt 10 && break
-  done
-  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
-esac
-
-      $ac_path_FGREP_found && break 3
-    done
-  done
-  done
-IFS=$as_save_IFS
-  if test -z "$ac_cv_path_FGREP"; then
-    as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
-  fi
-else
-  ac_cv_path_FGREP=$FGREP
-fi
-
-   fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5
-$as_echo "$ac_cv_path_FGREP" >&6; }
- FGREP="$ac_cv_path_FGREP"
-
-
-test -z "$GREP" && GREP=grep
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-# Check whether --with-gnu-ld was given.
-if test "${with_gnu_ld+set}" = set; then :
-  withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes
-else
-  with_gnu_ld=no
-fi
-
-ac_prog=ld
-if test yes = "$GCC"; then
-  # Check if gcc -print-prog-name=ld gives a path.
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5
-$as_echo_n "checking for ld used by $CC... " >&6; }
-  case $host in
-  *-*-mingw*)
-    # gcc leaves a trailing carriage return, which upsets mingw
-    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
-  *)
-    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
-  esac
-  case $ac_prog in
-    # Accept absolute paths.
-    [\\/]* | ?:[\\/]*)
-      re_direlt='/[^/][^/]*/\.\./'
-      # Canonicalize the pathname of ld
-      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
-      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
-	ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
-      done
-      test -z "$LD" && LD=$ac_prog
-      ;;
-  "")
-    # If it fails, then pretend we aren't using GCC.
-    ac_prog=ld
-    ;;
-  *)
-    # If it is relative, then search for the first ld in PATH.
-    with_gnu_ld=unknown
-    ;;
-  esac
-elif test yes = "$with_gnu_ld"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5
-$as_echo_n "checking for GNU ld... " >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5
-$as_echo_n "checking for non-GNU ld... " >&6; }
-fi
-if ${lt_cv_path_LD+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -z "$LD"; then
-  lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
-  for ac_dir in $PATH; do
-    IFS=$lt_save_ifs
-    test -z "$ac_dir" && ac_dir=.
-    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
-      lt_cv_path_LD=$ac_dir/$ac_prog
-      # Check to see if the program is GNU ld.  I'd rather use --version,
-      # but apparently some variants of GNU ld only accept -v.
-      # Break only if it was the GNU/non-GNU ld that we prefer.
-      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
-      *GNU* | *'with BFD'*)
-	test no != "$with_gnu_ld" && break
-	;;
-      *)
-	test yes != "$with_gnu_ld" && break
-	;;
-      esac
-    fi
-  done
-  IFS=$lt_save_ifs
-else
-  lt_cv_path_LD=$LD # Let the user override the test with a path.
-fi
-fi
-
-LD=$lt_cv_path_LD
-if test -n "$LD"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5
-$as_echo "$LD" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5
-$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; }
-if ${lt_cv_prog_gnu_ld+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  # I'd rather use --version here, but apparently some GNU lds only accept -v.
-case `$LD -v 2>&1 </dev/null` in
-*GNU* | *'with BFD'*)
-  lt_cv_prog_gnu_ld=yes
-  ;;
-*)
-  lt_cv_prog_gnu_ld=no
-  ;;
-esac
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_gnu_ld" >&5
-$as_echo "$lt_cv_prog_gnu_ld" >&6; }
-with_gnu_ld=$lt_cv_prog_gnu_ld
-
-
-
-
-
-
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5
-$as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; }
-if ${lt_cv_path_NM+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$NM"; then
-  # Let the user override the test.
-  lt_cv_path_NM=$NM
-else
-  lt_nm_to_check=${ac_tool_prefix}nm
-  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
-    lt_nm_to_check="$lt_nm_to_check nm"
-  fi
-  for lt_tmp_nm in $lt_nm_to_check; do
-    lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
-    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
-      IFS=$lt_save_ifs
-      test -z "$ac_dir" && ac_dir=.
-      tmp_nm=$ac_dir/$lt_tmp_nm
-      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then
-	# Check to see if the nm accepts a BSD-compat flag.
-	# Adding the 'sed 1q' prevents false positives on HP-UX, which says:
-	#   nm: unknown option "B" ignored
-	# Tru64's nm complains that /dev/null is an invalid object file
-	# MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty
-	case $build_os in
-	mingw*) lt_bad_file=conftest.nm/nofile ;;
-	*) lt_bad_file=/dev/null ;;
-	esac
-	case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in
-	*$lt_bad_file* | *'Invalid file or object type'*)
-	  lt_cv_path_NM="$tmp_nm -B"
-	  break 2
-	  ;;
-	*)
-	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
-	  */dev/null*)
-	    lt_cv_path_NM="$tmp_nm -p"
-	    break 2
-	    ;;
-	  *)
-	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
-	    continue # so that we can try to find one that supports BSD flags
-	    ;;
-	  esac
-	  ;;
-	esac
-      fi
-    done
-    IFS=$lt_save_ifs
-  done
-  : ${lt_cv_path_NM=no}
-fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5
-$as_echo "$lt_cv_path_NM" >&6; }
-if test no != "$lt_cv_path_NM"; then
-  NM=$lt_cv_path_NM
-else
-  # Didn't find any BSD compatible name lister, look for dumpbin.
-  if test -n "$DUMPBIN"; then :
-    # Let the user override the test.
-  else
-    if test -n "$ac_tool_prefix"; then
-  for ac_prog in dumpbin "link -dump"
-  do
-    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
-set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_DUMPBIN+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$DUMPBIN"; then
-  ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-DUMPBIN=$ac_cv_prog_DUMPBIN
-if test -n "$DUMPBIN"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5
-$as_echo "$DUMPBIN" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-    test -n "$DUMPBIN" && break
-  done
-fi
-if test -z "$DUMPBIN"; then
-  ac_ct_DUMPBIN=$DUMPBIN
-  for ac_prog in dumpbin "link -dump"
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$ac_ct_DUMPBIN"; then
-  ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_ac_ct_DUMPBIN="$ac_prog"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN
-if test -n "$ac_ct_DUMPBIN"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5
-$as_echo "$ac_ct_DUMPBIN" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-  test -n "$ac_ct_DUMPBIN" && break
-done
-
-  if test "x$ac_ct_DUMPBIN" = x; then
-    DUMPBIN=":"
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
-    DUMPBIN=$ac_ct_DUMPBIN
-  fi
-fi
-
-    case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in
-    *COFF*)
-      DUMPBIN="$DUMPBIN -symbols -headers"
-      ;;
-    *)
-      DUMPBIN=:
-      ;;
-    esac
-  fi
-
-  if test : != "$DUMPBIN"; then
-    NM=$DUMPBIN
-  fi
-fi
-test -z "$NM" && NM=nm
-
-
-
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5
-$as_echo_n "checking the name lister ($NM) interface... " >&6; }
-if ${lt_cv_nm_interface+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  lt_cv_nm_interface="BSD nm"
-  echo "int some_variable = 0;" > conftest.$ac_ext
-  (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5)
-  (eval "$ac_compile" 2>conftest.err)
-  cat conftest.err >&5
-  (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
-  (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
-  cat conftest.err >&5
-  (eval echo "\"\$as_me:$LINENO: output\"" >&5)
-  cat conftest.out >&5
-  if $GREP 'External.*some_variable' conftest.out > /dev/null; then
-    lt_cv_nm_interface="MS dumpbin"
-  fi
-  rm -rf conftest*
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5
-$as_echo "$lt_cv_nm_interface" >&6; }
-
-# find the maximum length of command line arguments
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5
-$as_echo_n "checking the maximum length of command line arguments... " >&6; }
-if ${lt_cv_sys_max_cmd_len+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-    i=0
-  teststring=ABCD
-
-  case $build_os in
-  msdosdjgpp*)
-    # On DJGPP, this test can blow up pretty badly due to problems in libc
-    # (any single argument exceeding 2000 bytes causes a buffer overrun
-    # during glob expansion).  Even if it were fixed, the result of this
-    # check would be larger than it should be.
-    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
-    ;;
-
-  gnu*)
-    # Under GNU Hurd, this test is not required because there is
-    # no limit to the length of command line arguments.
-    # Libtool will interpret -1 as no limit whatsoever
-    lt_cv_sys_max_cmd_len=-1;
-    ;;
-
-  cygwin* | mingw* | cegcc*)
-    # On Win9x/ME, this test blows up -- it succeeds, but takes
-    # about 5 minutes as the teststring grows exponentially.
-    # Worse, since 9x/ME are not pre-emptively multitasking,
-    # you end up with a "frozen" computer, even though with patience
-    # the test eventually succeeds (with a max line length of 256k).
-    # Instead, let's just punt: use the minimum linelength reported by
-    # all of the supported platforms: 8192 (on NT/2K/XP).
-    lt_cv_sys_max_cmd_len=8192;
-    ;;
-
-  mint*)
-    # On MiNT this can take a long time and run out of memory.
-    lt_cv_sys_max_cmd_len=8192;
-    ;;
-
-  amigaos*)
-    # On AmigaOS with pdksh, this test takes hours, literally.
-    # So we just punt and use a minimum line length of 8192.
-    lt_cv_sys_max_cmd_len=8192;
-    ;;
-
-  bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*)
-    # This has been around since 386BSD, at least.  Likely further.
-    if test -x /sbin/sysctl; then
-      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
-    elif test -x /usr/sbin/sysctl; then
-      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
-    else
-      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
-    fi
-    # And add a safety zone
-    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
-    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
-    ;;
-
-  interix*)
-    # We know the value 262144 and hardcode it with a safety zone (like BSD)
-    lt_cv_sys_max_cmd_len=196608
-    ;;
-
-  os2*)
-    # The test takes a long time on OS/2.
-    lt_cv_sys_max_cmd_len=8192
-    ;;
-
-  osf*)
-    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
-    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
-    # nice to cause kernel panics so lets avoid the loop below.
-    # First set a reasonable default.
-    lt_cv_sys_max_cmd_len=16384
-    #
-    if test -x /sbin/sysconfig; then
-      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
-        *1*) lt_cv_sys_max_cmd_len=-1 ;;
-      esac
-    fi
-    ;;
-  sco3.2v5*)
-    lt_cv_sys_max_cmd_len=102400
-    ;;
-  sysv5* | sco5v6* | sysv4.2uw2*)
-    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
-    if test -n "$kargmax"; then
-      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[	 ]//'`
-    else
-      lt_cv_sys_max_cmd_len=32768
-    fi
-    ;;
-  *)
-    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
-    if test -n "$lt_cv_sys_max_cmd_len" && \
-       test undefined != "$lt_cv_sys_max_cmd_len"; then
-      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
-      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
-    else
-      # Make teststring a little bigger before we do anything with it.
-      # a 1K string should be a reasonable start.
-      for i in 1 2 3 4 5 6 7 8; do
-        teststring=$teststring$teststring
-      done
-      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
-      # If test is not a shell built-in, we'll probably end up computing a
-      # maximum length that is only half of the actual maximum length, but
-      # we can't tell.
-      while { test X`env echo "$teststring$teststring" 2>/dev/null` \
-	         = "X$teststring$teststring"; } >/dev/null 2>&1 &&
-	      test 17 != "$i" # 1/2 MB should be enough
-      do
-        i=`expr $i + 1`
-        teststring=$teststring$teststring
-      done
-      # Only check the string length outside the loop.
-      lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
-      teststring=
-      # Add a significant safety factor because C++ compilers can tack on
-      # massive amounts of additional arguments before passing them to the
-      # linker.  It appears as though 1/2 is a usable value.
-      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
-    fi
-    ;;
-  esac
-
-fi
-
-if test -n "$lt_cv_sys_max_cmd_len"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5
-$as_echo "$lt_cv_sys_max_cmd_len" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
-$as_echo "none" >&6; }
-fi
-max_cmd_len=$lt_cv_sys_max_cmd_len
-
-
-
-
-
-
-: ${CP="cp -f"}
-: ${MV="mv -f"}
-: ${RM="rm -f"}
-
-if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
-  lt_unset=unset
-else
-  lt_unset=false
-fi
-
-
-
-
-
-# test EBCDIC or ASCII
-case `echo X|tr X '\101'` in
- A) # ASCII based system
-    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
-  lt_SP2NL='tr \040 \012'
-  lt_NL2SP='tr \015\012 \040\040'
-  ;;
- *) # EBCDIC based system
-  lt_SP2NL='tr \100 \n'
-  lt_NL2SP='tr \r\n \100\100'
-  ;;
-esac
-
-
-
-
-
-
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5
-$as_echo_n "checking how to convert $build file names to $host format... " >&6; }
-if ${lt_cv_to_host_file_cmd+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  case $host in
-  *-*-mingw* )
-    case $build in
-      *-*-mingw* ) # actually msys
-        lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
-        ;;
-      *-*-cygwin* )
-        lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
-        ;;
-      * ) # otherwise, assume *nix
-        lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
-        ;;
-    esac
-    ;;
-  *-*-cygwin* )
-    case $build in
-      *-*-mingw* ) # actually msys
-        lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
-        ;;
-      *-*-cygwin* )
-        lt_cv_to_host_file_cmd=func_convert_file_noop
-        ;;
-      * ) # otherwise, assume *nix
-        lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
-        ;;
-    esac
-    ;;
-  * ) # unhandled hosts (and "normal" native builds)
-    lt_cv_to_host_file_cmd=func_convert_file_noop
-    ;;
-esac
-
-fi
-
-to_host_file_cmd=$lt_cv_to_host_file_cmd
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5
-$as_echo "$lt_cv_to_host_file_cmd" >&6; }
-
-
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5
-$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; }
-if ${lt_cv_to_tool_file_cmd+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  #assume ordinary cross tools, or native build.
-lt_cv_to_tool_file_cmd=func_convert_file_noop
-case $host in
-  *-*-mingw* )
-    case $build in
-      *-*-mingw* ) # actually msys
-        lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
-        ;;
-    esac
-    ;;
-esac
-
-fi
-
-to_tool_file_cmd=$lt_cv_to_tool_file_cmd
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5
-$as_echo "$lt_cv_to_tool_file_cmd" >&6; }
-
-
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5
-$as_echo_n "checking for $LD option to reload object files... " >&6; }
-if ${lt_cv_ld_reload_flag+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  lt_cv_ld_reload_flag='-r'
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5
-$as_echo "$lt_cv_ld_reload_flag" >&6; }
-reload_flag=$lt_cv_ld_reload_flag
-case $reload_flag in
-"" | " "*) ;;
-*) reload_flag=" $reload_flag" ;;
-esac
-reload_cmds='$LD$reload_flag -o $output$reload_objs'
-case $host_os in
-  cygwin* | mingw* | pw32* | cegcc*)
-    if test yes != "$GCC"; then
-      reload_cmds=false
-    fi
-    ;;
-  darwin*)
-    if test yes = "$GCC"; then
-      reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs'
-    else
-      reload_cmds='$LD$reload_flag -o $output$reload_objs'
-    fi
-    ;;
-esac
-
-
-
-
-
-
-
-
-
-if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args.
-set dummy ${ac_tool_prefix}objdump; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_OBJDUMP+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$OBJDUMP"; then
-  ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-OBJDUMP=$ac_cv_prog_OBJDUMP
-if test -n "$OBJDUMP"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5
-$as_echo "$OBJDUMP" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_OBJDUMP"; then
-  ac_ct_OBJDUMP=$OBJDUMP
-  # Extract the first word of "objdump", so it can be a program name with args.
-set dummy objdump; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$ac_ct_OBJDUMP"; then
-  ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_ac_ct_OBJDUMP="objdump"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP
-if test -n "$ac_ct_OBJDUMP"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5
-$as_echo "$ac_ct_OBJDUMP" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-  if test "x$ac_ct_OBJDUMP" = x; then
-    OBJDUMP="false"
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
-    OBJDUMP=$ac_ct_OBJDUMP
-  fi
-else
-  OBJDUMP="$ac_cv_prog_OBJDUMP"
-fi
-
-test -z "$OBJDUMP" && OBJDUMP=objdump
-
-
-
-
-
-
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5
-$as_echo_n "checking how to recognize dependent libraries... " >&6; }
-if ${lt_cv_deplibs_check_method+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  lt_cv_file_magic_cmd='$MAGIC_CMD'
-lt_cv_file_magic_test_file=
-lt_cv_deplibs_check_method='unknown'
-# Need to set the preceding variable on all platforms that support
-# interlibrary dependencies.
-# 'none' -- dependencies not supported.
-# 'unknown' -- same as none, but documents that we really don't know.
-# 'pass_all' -- all dependencies passed with no checks.
-# 'test_compile' -- check by making test program.
-# 'file_magic [[regex]]' -- check by looking for files in library path
-# that responds to the $file_magic_cmd with a given extended regex.
-# If you have 'file' or equivalent on your system and you're not sure
-# whether 'pass_all' will *always* work, you probably want this one.
-
-case $host_os in
-aix[4-9]*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-beos*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-bsdi[45]*)
-  lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
-  lt_cv_file_magic_cmd='/usr/bin/file -L'
-  lt_cv_file_magic_test_file=/shlib/libc.so
-  ;;
-
-cygwin*)
-  # func_win32_libid is a shell function defined in ltmain.sh
-  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
-  lt_cv_file_magic_cmd='func_win32_libid'
-  ;;
-
-mingw* | pw32*)
-  # Base MSYS/MinGW do not provide the 'file' command needed by
-  # func_win32_libid shell function, so use a weaker test based on 'objdump',
-  # unless we find 'file', for example because we are cross-compiling.
-  if ( file / ) >/dev/null 2>&1; then
-    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
-    lt_cv_file_magic_cmd='func_win32_libid'
-  else
-    # Keep this pattern in sync with the one in func_win32_libid.
-    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
-    lt_cv_file_magic_cmd='$OBJDUMP -f'
-  fi
-  ;;
-
-cegcc*)
-  # use the weaker test based on 'objdump'. See mingw*.
-  lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
-  lt_cv_file_magic_cmd='$OBJDUMP -f'
-  ;;
-
-darwin* | rhapsody*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-freebsd* | dragonfly*)
-  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
-    case $host_cpu in
-    i*86 )
-      # Not sure whether the presence of OpenBSD here was a mistake.
-      # Let's accept both of them until this is cleared up.
-      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library'
-      lt_cv_file_magic_cmd=/usr/bin/file
-      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
-      ;;
-    esac
-  else
-    lt_cv_deplibs_check_method=pass_all
-  fi
-  ;;
-
-haiku*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-hpux10.20* | hpux11*)
-  lt_cv_file_magic_cmd=/usr/bin/file
-  case $host_cpu in
-  ia64*)
-    lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64'
-    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
-    ;;
-  hppa*64*)
-    lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'
-    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
-    ;;
-  *)
-    lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library'
-    lt_cv_file_magic_test_file=/usr/lib/libc.sl
-    ;;
-  esac
-  ;;
-
-interix[3-9]*)
-  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
-  lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$'
-  ;;
-
-irix5* | irix6* | nonstopux*)
-  case $LD in
-  *-32|*"-32 ") libmagic=32-bit;;
-  *-n32|*"-n32 ") libmagic=N32;;
-  *-64|*"-64 ") libmagic=64-bit;;
-  *) libmagic=never-match;;
-  esac
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-# This must be glibc/ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-netbsd*)
-  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
-    lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
-  else
-    lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$'
-  fi
-  ;;
-
-newos6*)
-  lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)'
-  lt_cv_file_magic_cmd=/usr/bin/file
-  lt_cv_file_magic_test_file=/usr/lib/libnls.so
-  ;;
-
-*nto* | *qnx*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-openbsd* | bitrig*)
-  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
-    lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$'
-  else
-    lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
-  fi
-  ;;
-
-osf3* | osf4* | osf5*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-rdos*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-solaris*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-sysv4 | sysv4.3*)
-  case $host_vendor in
-  motorola)
-    lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]'
-    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
-    ;;
-  ncr)
-    lt_cv_deplibs_check_method=pass_all
-    ;;
-  sequent)
-    lt_cv_file_magic_cmd='/bin/file'
-    lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'
-    ;;
-  sni)
-    lt_cv_file_magic_cmd='/bin/file'
-    lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib"
-    lt_cv_file_magic_test_file=/lib/libc.so
-    ;;
-  siemens)
-    lt_cv_deplibs_check_method=pass_all
-    ;;
-  pc)
-    lt_cv_deplibs_check_method=pass_all
-    ;;
-  esac
-  ;;
-
-tpf*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-os2*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-esac
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5
-$as_echo "$lt_cv_deplibs_check_method" >&6; }
-
-file_magic_glob=
-want_nocaseglob=no
-if test "$build" = "$host"; then
-  case $host_os in
-  mingw* | pw32*)
-    if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
-      want_nocaseglob=yes
-    else
-      file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"`
-    fi
-    ;;
-  esac
-fi
-
-file_magic_cmd=$lt_cv_file_magic_cmd
-deplibs_check_method=$lt_cv_deplibs_check_method
-test -z "$deplibs_check_method" && deplibs_check_method=unknown
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
-set dummy ${ac_tool_prefix}dlltool; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_DLLTOOL+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$DLLTOOL"; then
-  ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-DLLTOOL=$ac_cv_prog_DLLTOOL
-if test -n "$DLLTOOL"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5
-$as_echo "$DLLTOOL" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_DLLTOOL"; then
-  ac_ct_DLLTOOL=$DLLTOOL
-  # Extract the first word of "dlltool", so it can be a program name with args.
-set dummy dlltool; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$ac_ct_DLLTOOL"; then
-  ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_ac_ct_DLLTOOL="dlltool"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL
-if test -n "$ac_ct_DLLTOOL"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5
-$as_echo "$ac_ct_DLLTOOL" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-  if test "x$ac_ct_DLLTOOL" = x; then
-    DLLTOOL="false"
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
-    DLLTOOL=$ac_ct_DLLTOOL
-  fi
-else
-  DLLTOOL="$ac_cv_prog_DLLTOOL"
-fi
-
-test -z "$DLLTOOL" && DLLTOOL=dlltool
-
-
-
-
-
-
-
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5
-$as_echo_n "checking how to associate runtime and link libraries... " >&6; }
-if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  lt_cv_sharedlib_from_linklib_cmd='unknown'
-
-case $host_os in
-cygwin* | mingw* | pw32* | cegcc*)
-  # two different shell functions defined in ltmain.sh;
-  # decide which one to use based on capabilities of $DLLTOOL
-  case `$DLLTOOL --help 2>&1` in
-  *--identify-strict*)
-    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
-    ;;
-  *)
-    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
-    ;;
-  esac
-  ;;
-*)
-  # fallback: assume linklib IS sharedlib
-  lt_cv_sharedlib_from_linklib_cmd=$ECHO
-  ;;
-esac
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5
-$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; }
-sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
-test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
-
-
-
-
-
-
-
-if test -n "$ac_tool_prefix"; then
-  for ac_prog in ar
-  do
-    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
-set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_AR+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$AR"; then
-  ac_cv_prog_AR="$AR" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_AR="$ac_tool_prefix$ac_prog"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-AR=$ac_cv_prog_AR
-if test -n "$AR"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
-$as_echo "$AR" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-    test -n "$AR" && break
-  done
-fi
-if test -z "$AR"; then
-  ac_ct_AR=$AR
-  for ac_prog in ar
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_AR+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$ac_ct_AR"; then
-  ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_ac_ct_AR="$ac_prog"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_AR=$ac_cv_prog_ac_ct_AR
-if test -n "$ac_ct_AR"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
-$as_echo "$ac_ct_AR" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-  test -n "$ac_ct_AR" && break
-done
-
-  if test "x$ac_ct_AR" = x; then
-    AR="false"
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
-    AR=$ac_ct_AR
-  fi
-fi
-
-: ${AR=ar}
-: ${AR_FLAGS=cru}
-
-
-
-
-
-
-
-
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5
-$as_echo_n "checking for archiver @FILE support... " >&6; }
-if ${lt_cv_ar_at_file+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  lt_cv_ar_at_file=no
-   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  echo conftest.$ac_objext > conftest.lst
-      lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5'
-      { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
-  (eval $lt_ar_try) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }
-      if test 0 -eq "$ac_status"; then
-	# Ensure the archiver fails upon bogus file names.
-	rm -f conftest.$ac_objext libconftest.a
-	{ { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
-  (eval $lt_ar_try) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }
-	if test 0 -ne "$ac_status"; then
-          lt_cv_ar_at_file=@
-        fi
-      fi
-      rm -f conftest.* libconftest.a
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5
-$as_echo "$lt_cv_ar_at_file" >&6; }
-
-if test no = "$lt_cv_ar_at_file"; then
-  archiver_list_spec=
-else
-  archiver_list_spec=$lt_cv_ar_at_file
-fi
-
-
-
-
-
-
-
-if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
-set dummy ${ac_tool_prefix}strip; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_STRIP+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$STRIP"; then
-  ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_STRIP="${ac_tool_prefix}strip"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-STRIP=$ac_cv_prog_STRIP
-if test -n "$STRIP"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
-$as_echo "$STRIP" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_STRIP"; then
-  ac_ct_STRIP=$STRIP
-  # Extract the first word of "strip", so it can be a program name with args.
-set dummy strip; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$ac_ct_STRIP"; then
-  ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_ac_ct_STRIP="strip"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
-if test -n "$ac_ct_STRIP"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
-$as_echo "$ac_ct_STRIP" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-  if test "x$ac_ct_STRIP" = x; then
-    STRIP=":"
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
-    STRIP=$ac_ct_STRIP
-  fi
-else
-  STRIP="$ac_cv_prog_STRIP"
-fi
-
-test -z "$STRIP" && STRIP=:
-
-
-
-
-
-
-if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
-set dummy ${ac_tool_prefix}ranlib; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_RANLIB+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$RANLIB"; then
-  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-RANLIB=$ac_cv_prog_RANLIB
-if test -n "$RANLIB"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
-$as_echo "$RANLIB" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_RANLIB"; then
-  ac_ct_RANLIB=$RANLIB
-  # Extract the first word of "ranlib", so it can be a program name with args.
-set dummy ranlib; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_RANLIB+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$ac_ct_RANLIB"; then
-  ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_ac_ct_RANLIB="ranlib"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
-if test -n "$ac_ct_RANLIB"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
-$as_echo "$ac_ct_RANLIB" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-  if test "x$ac_ct_RANLIB" = x; then
-    RANLIB=":"
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
-    RANLIB=$ac_ct_RANLIB
-  fi
-else
-  RANLIB="$ac_cv_prog_RANLIB"
-fi
-
-test -z "$RANLIB" && RANLIB=:
-
-
-
-
-
-
-# Determine commands to create old-style static archives.
-old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
-old_postinstall_cmds='chmod 644 $oldlib'
-old_postuninstall_cmds=
-
-if test -n "$RANLIB"; then
-  case $host_os in
-  bitrig* | openbsd*)
-    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
-    ;;
-  *)
-    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
-    ;;
-  esac
-  old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
-fi
-
-case $host_os in
-  darwin*)
-    lock_old_archive_extraction=yes ;;
-  *)
-    lock_old_archive_extraction=no ;;
-esac
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-# If no C compiler was specified, use CC.
-LTCC=${LTCC-"$CC"}
-
-# If no C compiler flags were specified, use CFLAGS.
-LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
-
-# Allow CC to be a program name with arguments.
-compiler=$CC
-
-
-# Check for command to grab the raw symbol name followed by C symbol from nm.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5
-$as_echo_n "checking command to parse $NM output from $compiler object... " >&6; }
-if ${lt_cv_sys_global_symbol_pipe+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-
-# These are sane defaults that work on at least a few old systems.
-# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
-
-# Character class describing NM global symbol codes.
-symcode='[BCDEGRST]'
-
-# Regexp to match symbols that can be accessed directly from C.
-sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
-
-# Define system-specific variables.
-case $host_os in
-aix*)
-  symcode='[BCDT]'
-  ;;
-cygwin* | mingw* | pw32* | cegcc*)
-  symcode='[ABCDGISTW]'
-  ;;
-hpux*)
-  if test ia64 = "$host_cpu"; then
-    symcode='[ABCDEGRST]'
-  fi
-  ;;
-irix* | nonstopux*)
-  symcode='[BCDEGRST]'
-  ;;
-osf*)
-  symcode='[BCDEGQRST]'
-  ;;
-solaris*)
-  symcode='[BDRT]'
-  ;;
-sco3.2v5*)
-  symcode='[DT]'
-  ;;
-sysv4.2uw2*)
-  symcode='[DT]'
-  ;;
-sysv5* | sco5v6* | unixware* | OpenUNIX*)
-  symcode='[ABDT]'
-  ;;
-sysv4)
-  symcode='[DFNSTU]'
-  ;;
-esac
-
-# If we're using GNU nm, then use its standard symbol codes.
-case `$NM -V 2>&1` in
-*GNU* | *'with BFD'*)
-  symcode='[ABCDGIRSTW]' ;;
-esac
-
-if test "$lt_cv_nm_interface" = "MS dumpbin"; then
-  # Gets list of data symbols to import.
-  lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'"
-  # Adjust the below global symbol transforms to fixup imported variables.
-  lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'"
-  lt_c_name_hook=" -e 's/^I .* \(.*\)$/  {\"\1\", (void *) 0},/p'"
-  lt_c_name_lib_hook="\
-  -e 's/^I .* \(lib.*\)$/  {\"\1\", (void *) 0},/p'\
-  -e 's/^I .* \(.*\)$/  {\"lib\1\", (void *) 0},/p'"
-else
-  # Disable hooks by default.
-  lt_cv_sys_global_symbol_to_import=
-  lt_cdecl_hook=
-  lt_c_name_hook=
-  lt_c_name_lib_hook=
-fi
-
-# Transform an extracted symbol line into a proper C declaration.
-# Some systems (esp. on ia64) link data and code symbols differently,
-# so use this general approach.
-lt_cv_sys_global_symbol_to_cdecl="sed -n"\
-$lt_cdecl_hook\
-" -e 's/^T .* \(.*\)$/extern int \1();/p'"\
-" -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'"
-
-# Transform an extracted symbol line into symbol name and symbol address
-lt_cv_sys_global_symbol_to_c_name_address="sed -n"\
-$lt_c_name_hook\
-" -e 's/^: \(.*\) .*$/  {\"\1\", (void *) 0},/p'"\
-" -e 's/^$symcode$symcode* .* \(.*\)$/  {\"\1\", (void *) \&\1},/p'"
-
-# Transform an extracted symbol line into symbol name with lib prefix and
-# symbol address.
-lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\
-$lt_c_name_lib_hook\
-" -e 's/^: \(.*\) .*$/  {\"\1\", (void *) 0},/p'"\
-" -e 's/^$symcode$symcode* .* \(lib.*\)$/  {\"\1\", (void *) \&\1},/p'"\
-" -e 's/^$symcode$symcode* .* \(.*\)$/  {\"lib\1\", (void *) \&\1},/p'"
-
-# Handle CRLF in mingw tool chain
-opt_cr=
-case $build_os in
-mingw*)
-  opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
-  ;;
-esac
-
-# Try without a prefix underscore, then with it.
-for ac_symprfx in "" "_"; do
-
-  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
-  symxfrm="\\1 $ac_symprfx\\2 \\2"
-
-  # Write the raw and C identifiers.
-  if test "$lt_cv_nm_interface" = "MS dumpbin"; then
-    # Fake it for dumpbin and say T for any non-static function,
-    # D for any global variable and I for any imported variable.
-    # Also find C++ and __fastcall symbols from MSVC++,
-    # which start with @ or ?.
-    lt_cv_sys_global_symbol_pipe="$AWK '"\
-"     {last_section=section; section=\$ 3};"\
-"     /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
-"     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
-"     /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\
-"     /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\
-"     /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\
-"     \$ 0!~/External *\|/{next};"\
-"     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
-"     {if(hide[section]) next};"\
-"     {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\
-"     {split(\$ 0,a,/\||\r/); split(a[2],s)};"\
-"     s[1]~/^[@?]/{print f,s[1],s[1]; next};"\
-"     s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\
-"     ' prfx=^$ac_symprfx"
-  else
-    lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[	 ]\($symcode$symcode*\)[	 ][	 ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
-  fi
-  lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
-
-  # Check to see that the pipe works correctly.
-  pipe_works=no
-
-  rm -rf conftest*
-  cat > conftest.$ac_ext <<_LT_EOF
-#ifdef __cplusplus
-extern "C" {
-#endif
-char nm_test_var;
-void nm_test_func(void);
-void nm_test_func(void){}
-#ifdef __cplusplus
-}
-#endif
-int main(){nm_test_var='a';nm_test_func();return(0);}
-_LT_EOF
-
-  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; then
-    # Now try to grab the symbols.
-    nlist=conftest.nm
-    if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5
-  (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } && test -s "$nlist"; then
-      # Try sorting and uniquifying the output.
-      if sort "$nlist" | uniq > "$nlist"T; then
-	mv -f "$nlist"T "$nlist"
-      else
-	rm -f "$nlist"T
-      fi
-
-      # Make sure that we snagged all the symbols we need.
-      if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
-	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
-	  cat <<_LT_EOF > conftest.$ac_ext
-/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
-#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE
-/* DATA imports from DLLs on WIN32 can't be const, because runtime
-   relocations are performed -- see ld's documentation on pseudo-relocs.  */
-# define LT_DLSYM_CONST
-#elif defined __osf__
-/* This system does not cope well with relocations in const data.  */
-# define LT_DLSYM_CONST
-#else
-# define LT_DLSYM_CONST const
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-_LT_EOF
-	  # Now generate the symbol file.
-	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
-
-	  cat <<_LT_EOF >> conftest.$ac_ext
-
-/* The mapping between symbol names and symbols.  */
-LT_DLSYM_CONST struct {
-  const char *name;
-  void       *address;
-}
-lt__PROGRAM__LTX_preloaded_symbols[] =
-{
-  { "@PROGRAM@", (void *) 0 },
-_LT_EOF
-	  $SED "s/^$symcode$symcode* .* \(.*\)$/  {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
-	  cat <<\_LT_EOF >> conftest.$ac_ext
-  {0, (void *) 0}
-};
-
-/* This works around a problem in FreeBSD linker */
-#ifdef FREEBSD_WORKAROUND
-static const void *lt_preloaded_setup() {
-  return lt__PROGRAM__LTX_preloaded_symbols;
-}
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-_LT_EOF
-	  # Now try linking the two files.
-	  mv conftest.$ac_objext conftstm.$ac_objext
-	  lt_globsym_save_LIBS=$LIBS
-	  lt_globsym_save_CFLAGS=$CFLAGS
-	  LIBS=conftstm.$ac_objext
-	  CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag"
-	  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } && test -s conftest$ac_exeext; then
-	    pipe_works=yes
-	  fi
-	  LIBS=$lt_globsym_save_LIBS
-	  CFLAGS=$lt_globsym_save_CFLAGS
-	else
-	  echo "cannot find nm_test_func in $nlist" >&5
-	fi
-      else
-	echo "cannot find nm_test_var in $nlist" >&5
-      fi
-    else
-      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5
-    fi
-  else
-    echo "$progname: failed program was:" >&5
-    cat conftest.$ac_ext >&5
-  fi
-  rm -rf conftest* conftst*
-
-  # Do not use the global_symbol_pipe unless it works.
-  if test yes = "$pipe_works"; then
-    break
-  else
-    lt_cv_sys_global_symbol_pipe=
-  fi
-done
-
-fi
-
-if test -z "$lt_cv_sys_global_symbol_pipe"; then
-  lt_cv_sys_global_symbol_to_cdecl=
-fi
-if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5
-$as_echo "failed" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
-$as_echo "ok" >&6; }
-fi
-
-# Response file support.
-if test "$lt_cv_nm_interface" = "MS dumpbin"; then
-  nm_file_list_spec='@'
-elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then
-  nm_file_list_spec='@'
-fi
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
-$as_echo_n "checking for sysroot... " >&6; }
-
-# Check whether --with-sysroot was given.
-if test "${with_sysroot+set}" = set; then :
-  withval=$with_sysroot;
-else
-  with_sysroot=no
-fi
-
-
-lt_sysroot=
-case $with_sysroot in #(
- yes)
-   if test yes = "$GCC"; then
-     lt_sysroot=`$CC --print-sysroot 2>/dev/null`
-   fi
-   ;; #(
- /*)
-   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-   ;; #(
- no|'')
-   ;; #(
- *)
-   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_sysroot" >&5
-$as_echo "$with_sysroot" >&6; }
-   as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5
-   ;;
-esac
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5
-$as_echo "${lt_sysroot:-no}" >&6; }
-
-
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a working dd" >&5
-$as_echo_n "checking for a working dd... " >&6; }
-if ${ac_cv_path_lt_DD+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  printf 0123456789abcdef0123456789abcdef >conftest.i
-cat conftest.i conftest.i >conftest2.i
-: ${lt_DD:=$DD}
-if test -z "$lt_DD"; then
-  ac_path_lt_DD_found=false
-  # Loop through the user's path and test for each of PROGNAME-LIST
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_prog in dd; do
-    for ac_exec_ext in '' $ac_executable_extensions; do
-      ac_path_lt_DD="$as_dir/$ac_prog$ac_exec_ext"
-      as_fn_executable_p "$ac_path_lt_DD" || continue
-if "$ac_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then
-  cmp -s conftest.i conftest.out \
-  && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=:
-fi
-      $ac_path_lt_DD_found && break 3
-    done
-  done
-  done
-IFS=$as_save_IFS
-  if test -z "$ac_cv_path_lt_DD"; then
-    :
-  fi
-else
-  ac_cv_path_lt_DD=$lt_DD
-fi
-
-rm -f conftest.i conftest2.i conftest.out
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_lt_DD" >&5
-$as_echo "$ac_cv_path_lt_DD" >&6; }
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to truncate binary pipes" >&5
-$as_echo_n "checking how to truncate binary pipes... " >&6; }
-if ${lt_cv_truncate_bin+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  printf 0123456789abcdef0123456789abcdef >conftest.i
-cat conftest.i conftest.i >conftest2.i
-lt_cv_truncate_bin=
-if "$ac_cv_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then
-  cmp -s conftest.i conftest.out \
-  && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1"
-fi
-rm -f conftest.i conftest2.i conftest.out
-test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q"
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_truncate_bin" >&5
-$as_echo "$lt_cv_truncate_bin" >&6; }
-
-
-
-
-
-
-
-# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
-func_cc_basename ()
-{
-    for cc_temp in $*""; do
-      case $cc_temp in
-        compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
-        distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
-        \-*) ;;
-        *) break;;
-      esac
-    done
-    func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
-}
-
-# Check whether --enable-libtool-lock was given.
-if test "${enable_libtool_lock+set}" = set; then :
-  enableval=$enable_libtool_lock;
-fi
-
-test no = "$enable_libtool_lock" || enable_libtool_lock=yes
-
-# Some flags need to be propagated to the compiler or linker for good
-# libtool support.
-case $host in
-ia64-*-hpux*)
-  # Find out what ABI is being produced by ac_compile, and set mode
-  # options accordingly.
-  echo 'int i;' > conftest.$ac_ext
-  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; then
-    case `/usr/bin/file conftest.$ac_objext` in
-      *ELF-32*)
-	HPUX_IA64_MODE=32
-	;;
-      *ELF-64*)
-	HPUX_IA64_MODE=64
-	;;
-    esac
-  fi
-  rm -rf conftest*
-  ;;
-*-*-irix6*)
-  # Find out what ABI is being produced by ac_compile, and set linker
-  # options accordingly.
-  echo '#line '$LINENO' "configure"' > conftest.$ac_ext
-  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; then
-    if test yes = "$lt_cv_prog_gnu_ld"; then
-      case `/usr/bin/file conftest.$ac_objext` in
-	*32-bit*)
-	  LD="${LD-ld} -melf32bsmip"
-	  ;;
-	*N32*)
-	  LD="${LD-ld} -melf32bmipn32"
-	  ;;
-	*64-bit*)
-	  LD="${LD-ld} -melf64bmip"
-	;;
-      esac
-    else
-      case `/usr/bin/file conftest.$ac_objext` in
-	*32-bit*)
-	  LD="${LD-ld} -32"
-	  ;;
-	*N32*)
-	  LD="${LD-ld} -n32"
-	  ;;
-	*64-bit*)
-	  LD="${LD-ld} -64"
-	  ;;
-      esac
-    fi
-  fi
-  rm -rf conftest*
-  ;;
-
-mips64*-*linux*)
-  # Find out what ABI is being produced by ac_compile, and set linker
-  # options accordingly.
-  echo '#line '$LINENO' "configure"' > conftest.$ac_ext
-  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; then
-    emul=elf
-    case `/usr/bin/file conftest.$ac_objext` in
-      *32-bit*)
-	emul="${emul}32"
-	;;
-      *64-bit*)
-	emul="${emul}64"
-	;;
-    esac
-    case `/usr/bin/file conftest.$ac_objext` in
-      *MSB*)
-	emul="${emul}btsmip"
-	;;
-      *LSB*)
-	emul="${emul}ltsmip"
-	;;
-    esac
-    case `/usr/bin/file conftest.$ac_objext` in
-      *N32*)
-	emul="${emul}n32"
-	;;
-    esac
-    LD="${LD-ld} -m $emul"
-  fi
-  rm -rf conftest*
-  ;;
-
-x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \
-s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
-  # Find out what ABI is being produced by ac_compile, and set linker
-  # options accordingly.  Note that the listed cases only cover the
-  # situations where additional linker options are needed (such as when
-  # doing 32-bit compilation for a host where ld defaults to 64-bit, or
-  # vice versa); the common cases where no linker options are needed do
-  # not appear in the list.
-  echo 'int i;' > conftest.$ac_ext
-  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; then
-    case `/usr/bin/file conftest.o` in
-      *32-bit*)
-	case $host in
-	  x86_64-*kfreebsd*-gnu)
-	    LD="${LD-ld} -m elf_i386_fbsd"
-	    ;;
-	  x86_64-*linux*)
-	    case `/usr/bin/file conftest.o` in
-	      *x86-64*)
-		LD="${LD-ld} -m elf32_x86_64"
-		;;
-	      *)
-		LD="${LD-ld} -m elf_i386"
-		;;
-	    esac
-	    ;;
-	  powerpc64le-*linux*)
-	    LD="${LD-ld} -m elf32lppclinux"
-	    ;;
-	  powerpc64-*linux*)
-	    LD="${LD-ld} -m elf32ppclinux"
-	    ;;
-	  s390x-*linux*)
-	    LD="${LD-ld} -m elf_s390"
-	    ;;
-	  sparc64-*linux*)
-	    LD="${LD-ld} -m elf32_sparc"
-	    ;;
-	esac
-	;;
-      *64-bit*)
-	case $host in
-	  x86_64-*kfreebsd*-gnu)
-	    LD="${LD-ld} -m elf_x86_64_fbsd"
-	    ;;
-	  x86_64-*linux*)
-	    LD="${LD-ld} -m elf_x86_64"
-	    ;;
-	  powerpcle-*linux*)
-	    LD="${LD-ld} -m elf64lppc"
-	    ;;
-	  powerpc-*linux*)
-	    LD="${LD-ld} -m elf64ppc"
-	    ;;
-	  s390*-*linux*|s390*-*tpf*)
-	    LD="${LD-ld} -m elf64_s390"
-	    ;;
-	  sparc*-*linux*)
-	    LD="${LD-ld} -m elf64_sparc"
-	    ;;
-	esac
-	;;
-    esac
-  fi
-  rm -rf conftest*
-  ;;
-
-*-*-sco3.2v5*)
-  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
-  SAVE_CFLAGS=$CFLAGS
-  CFLAGS="$CFLAGS -belf"
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5
-$as_echo_n "checking whether the C compiler needs -belf... " >&6; }
-if ${lt_cv_cc_needs_belf+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  lt_cv_cc_needs_belf=yes
-else
-  lt_cv_cc_needs_belf=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-     ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5
-$as_echo "$lt_cv_cc_needs_belf" >&6; }
-  if test yes != "$lt_cv_cc_needs_belf"; then
-    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
-    CFLAGS=$SAVE_CFLAGS
-  fi
-  ;;
-*-*solaris*)
-  # Find out what ABI is being produced by ac_compile, and set linker
-  # options accordingly.
-  echo 'int i;' > conftest.$ac_ext
-  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; then
-    case `/usr/bin/file conftest.o` in
-    *64-bit*)
-      case $lt_cv_prog_gnu_ld in
-      yes*)
-        case $host in
-        i?86-*-solaris*|x86_64-*-solaris*)
-          LD="${LD-ld} -m elf_x86_64"
-          ;;
-        sparc*-*-solaris*)
-          LD="${LD-ld} -m elf64_sparc"
-          ;;
-        esac
-        # GNU ld 2.21 introduced _sol2 emulations.  Use them if available.
-        if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
-          LD=${LD-ld}_sol2
-        fi
-        ;;
-      *)
-	if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
-	  LD="${LD-ld} -64"
-	fi
-	;;
-      esac
-      ;;
-    esac
-  fi
-  rm -rf conftest*
-  ;;
-esac
-
-need_locks=$enable_libtool_lock
-
-if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args.
-set dummy ${ac_tool_prefix}mt; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_MANIFEST_TOOL+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$MANIFEST_TOOL"; then
-  ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL
-if test -n "$MANIFEST_TOOL"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5
-$as_echo "$MANIFEST_TOOL" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_MANIFEST_TOOL"; then
-  ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL
-  # Extract the first word of "mt", so it can be a program name with args.
-set dummy mt; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$ac_ct_MANIFEST_TOOL"; then
-  ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_ac_ct_MANIFEST_TOOL="mt"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL
-if test -n "$ac_ct_MANIFEST_TOOL"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5
-$as_echo "$ac_ct_MANIFEST_TOOL" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-  if test "x$ac_ct_MANIFEST_TOOL" = x; then
-    MANIFEST_TOOL=":"
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
-    MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL
-  fi
-else
-  MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL"
-fi
-
-test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5
-$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; }
-if ${lt_cv_path_mainfest_tool+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  lt_cv_path_mainfest_tool=no
-  echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5
-  $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
-  cat conftest.err >&5
-  if $GREP 'Manifest Tool' conftest.out > /dev/null; then
-    lt_cv_path_mainfest_tool=yes
-  fi
-  rm -rf conftest*
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5
-$as_echo "$lt_cv_path_mainfest_tool" >&6; }
-if test yes != "$lt_cv_path_mainfest_tool"; then
-  MANIFEST_TOOL=:
-fi
-
-
-
-
-
-
-  case $host_os in
-    rhapsody* | darwin*)
-    if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args.
-set dummy ${ac_tool_prefix}dsymutil; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_DSYMUTIL+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$DSYMUTIL"; then
-  ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-DSYMUTIL=$ac_cv_prog_DSYMUTIL
-if test -n "$DSYMUTIL"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5
-$as_echo "$DSYMUTIL" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_DSYMUTIL"; then
-  ac_ct_DSYMUTIL=$DSYMUTIL
-  # Extract the first word of "dsymutil", so it can be a program name with args.
-set dummy dsymutil; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$ac_ct_DSYMUTIL"; then
-  ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_ac_ct_DSYMUTIL="dsymutil"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL
-if test -n "$ac_ct_DSYMUTIL"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5
-$as_echo "$ac_ct_DSYMUTIL" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-  if test "x$ac_ct_DSYMUTIL" = x; then
-    DSYMUTIL=":"
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
-    DSYMUTIL=$ac_ct_DSYMUTIL
-  fi
-else
-  DSYMUTIL="$ac_cv_prog_DSYMUTIL"
-fi
-
-    if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args.
-set dummy ${ac_tool_prefix}nmedit; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_NMEDIT+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$NMEDIT"; then
-  ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-NMEDIT=$ac_cv_prog_NMEDIT
-if test -n "$NMEDIT"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5
-$as_echo "$NMEDIT" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_NMEDIT"; then
-  ac_ct_NMEDIT=$NMEDIT
-  # Extract the first word of "nmedit", so it can be a program name with args.
-set dummy nmedit; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$ac_ct_NMEDIT"; then
-  ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_ac_ct_NMEDIT="nmedit"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT
-if test -n "$ac_ct_NMEDIT"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5
-$as_echo "$ac_ct_NMEDIT" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-  if test "x$ac_ct_NMEDIT" = x; then
-    NMEDIT=":"
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
-    NMEDIT=$ac_ct_NMEDIT
-  fi
-else
-  NMEDIT="$ac_cv_prog_NMEDIT"
-fi
-
-    if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args.
-set dummy ${ac_tool_prefix}lipo; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_LIPO+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$LIPO"; then
-  ac_cv_prog_LIPO="$LIPO" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_LIPO="${ac_tool_prefix}lipo"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-LIPO=$ac_cv_prog_LIPO
-if test -n "$LIPO"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5
-$as_echo "$LIPO" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_LIPO"; then
-  ac_ct_LIPO=$LIPO
-  # Extract the first word of "lipo", so it can be a program name with args.
-set dummy lipo; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_LIPO+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$ac_ct_LIPO"; then
-  ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_ac_ct_LIPO="lipo"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO
-if test -n "$ac_ct_LIPO"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5
-$as_echo "$ac_ct_LIPO" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-  if test "x$ac_ct_LIPO" = x; then
-    LIPO=":"
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
-    LIPO=$ac_ct_LIPO
-  fi
-else
-  LIPO="$ac_cv_prog_LIPO"
-fi
-
-    if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args.
-set dummy ${ac_tool_prefix}otool; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_OTOOL+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$OTOOL"; then
-  ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_OTOOL="${ac_tool_prefix}otool"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-OTOOL=$ac_cv_prog_OTOOL
-if test -n "$OTOOL"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5
-$as_echo "$OTOOL" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_OTOOL"; then
-  ac_ct_OTOOL=$OTOOL
-  # Extract the first word of "otool", so it can be a program name with args.
-set dummy otool; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_OTOOL+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$ac_ct_OTOOL"; then
-  ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_ac_ct_OTOOL="otool"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL
-if test -n "$ac_ct_OTOOL"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5
-$as_echo "$ac_ct_OTOOL" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-  if test "x$ac_ct_OTOOL" = x; then
-    OTOOL=":"
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
-    OTOOL=$ac_ct_OTOOL
-  fi
-else
-  OTOOL="$ac_cv_prog_OTOOL"
-fi
-
-    if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args.
-set dummy ${ac_tool_prefix}otool64; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_OTOOL64+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$OTOOL64"; then
-  ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-OTOOL64=$ac_cv_prog_OTOOL64
-if test -n "$OTOOL64"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5
-$as_echo "$OTOOL64" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_OTOOL64"; then
-  ac_ct_OTOOL64=$OTOOL64
-  # Extract the first word of "otool64", so it can be a program name with args.
-set dummy otool64; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$ac_ct_OTOOL64"; then
-  ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_ac_ct_OTOOL64="otool64"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64
-if test -n "$ac_ct_OTOOL64"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5
-$as_echo "$ac_ct_OTOOL64" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-  if test "x$ac_ct_OTOOL64" = x; then
-    OTOOL64=":"
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
-    OTOOL64=$ac_ct_OTOOL64
-  fi
-else
-  OTOOL64="$ac_cv_prog_OTOOL64"
-fi
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5
-$as_echo_n "checking for -single_module linker flag... " >&6; }
-if ${lt_cv_apple_cc_single_mod+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  lt_cv_apple_cc_single_mod=no
-      if test -z "$LT_MULTI_MODULE"; then
-	# By default we will add the -single_module flag. You can override
-	# by either setting the environment variable LT_MULTI_MODULE
-	# non-empty at configure time, or by adding -multi_module to the
-	# link flags.
-	rm -rf libconftest.dylib*
-	echo "int foo(void){return 1;}" > conftest.c
-	echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
--dynamiclib -Wl,-single_module conftest.c" >&5
-	$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
-	  -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
-        _lt_result=$?
-	# If there is a non-empty error log, and "single_module"
-	# appears in it, assume the flag caused a linker warning
-        if test -s conftest.err && $GREP single_module conftest.err; then
-	  cat conftest.err >&5
-	# Otherwise, if the output was created with a 0 exit code from
-	# the compiler, it worked.
-	elif test -f libconftest.dylib && test 0 = "$_lt_result"; then
-	  lt_cv_apple_cc_single_mod=yes
-	else
-	  cat conftest.err >&5
-	fi
-	rm -rf libconftest.dylib*
-	rm -f conftest.*
-      fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5
-$as_echo "$lt_cv_apple_cc_single_mod" >&6; }
-
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5
-$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; }
-if ${lt_cv_ld_exported_symbols_list+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  lt_cv_ld_exported_symbols_list=no
-      save_LDFLAGS=$LDFLAGS
-      echo "_main" > conftest.sym
-      LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
-      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  lt_cv_ld_exported_symbols_list=yes
-else
-  lt_cv_ld_exported_symbols_list=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-	LDFLAGS=$save_LDFLAGS
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5
-$as_echo "$lt_cv_ld_exported_symbols_list" >&6; }
-
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5
-$as_echo_n "checking for -force_load linker flag... " >&6; }
-if ${lt_cv_ld_force_load+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  lt_cv_ld_force_load=no
-      cat > conftest.c << _LT_EOF
-int forced_loaded() { return 2;}
-_LT_EOF
-      echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5
-      $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5
-      echo "$AR cru libconftest.a conftest.o" >&5
-      $AR cru libconftest.a conftest.o 2>&5
-      echo "$RANLIB libconftest.a" >&5
-      $RANLIB libconftest.a 2>&5
-      cat > conftest.c << _LT_EOF
-int main() { return 0;}
-_LT_EOF
-      echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5
-      $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
-      _lt_result=$?
-      if test -s conftest.err && $GREP force_load conftest.err; then
-	cat conftest.err >&5
-      elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then
-	lt_cv_ld_force_load=yes
-      else
-	cat conftest.err >&5
-      fi
-        rm -f conftest.err libconftest.a conftest conftest.c
-        rm -rf conftest.dSYM
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5
-$as_echo "$lt_cv_ld_force_load" >&6; }
-    case $host_os in
-    rhapsody* | darwin1.[012])
-      _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;;
-    darwin1.*)
-      _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
-    darwin*) # darwin 5.x on
-      # if running on 10.5 or later, the deployment target defaults
-      # to the OS version, if on x86, and 10.4, the deployment
-      # target defaults to 10.4. Don't you love it?
-      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
-	10.0,*86*-darwin8*|10.0,*-darwin[91]*)
-	  _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
-	10.[012][,.]*)
-	  _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
-	10.*)
-	  _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
-      esac
-    ;;
-  esac
-    if test yes = "$lt_cv_apple_cc_single_mod"; then
-      _lt_dar_single_mod='$single_module'
-    fi
-    if test yes = "$lt_cv_ld_exported_symbols_list"; then
-      _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym'
-    else
-      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib'
-    fi
-    if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then
-      _lt_dsymutil='~$DSYMUTIL $lib || :'
-    else
-      _lt_dsymutil=
-    fi
-    ;;
-  esac
-
-# func_munge_path_list VARIABLE PATH
-# -----------------------------------
-# VARIABLE is name of variable containing _space_ separated list of
-# directories to be munged by the contents of PATH, which is string
-# having a format:
-# "DIR[:DIR]:"
-#       string "DIR[ DIR]" will be prepended to VARIABLE
-# ":DIR[:DIR]"
-#       string "DIR[ DIR]" will be appended to VARIABLE
-# "DIRP[:DIRP]::[DIRA:]DIRA"
-#       string "DIRP[ DIRP]" will be prepended to VARIABLE and string
-#       "DIRA[ DIRA]" will be appended to VARIABLE
-# "DIR[:DIR]"
-#       VARIABLE will be replaced by "DIR[ DIR]"
-func_munge_path_list ()
-{
-    case x$2 in
-    x)
-        ;;
-    *:)
-        eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\"
-        ;;
-    x:*)
-        eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\"
-        ;;
-    *::*)
-        eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\"
-        eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\"
-        ;;
-    *)
-        eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\"
-        ;;
-    esac
-}
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
-$as_echo_n "checking how to run the C preprocessor... " >&6; }
-# On Suns, sometimes $CPP names a directory.
-if test -n "$CPP" && test -d "$CPP"; then
-  CPP=
-fi
-if test -z "$CPP"; then
-  if ${ac_cv_prog_CPP+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-      # Double quotes because CPP needs to be expanded
-    for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
-    do
-      ac_preproc_ok=false
-for ac_c_preproc_warn_flag in '' yes
-do
-  # Use a header file that comes with gcc, so configuring glibc
-  # with a fresh cross-compiler works.
-  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-  # <limits.h> exists even on freestanding compilers.
-  # On the NeXT, cc -E runs the code through the compiler's parser,
-  # not just through cpp. "Syntax error" is here to catch this case.
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-		     Syntax error
-_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
-
-else
-  # Broken: fails on valid input.
-continue
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-
-  # OK, works on sane cases.  Now check whether nonexistent headers
-  # can be detected and how.
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <ac_nonexistent.h>
-_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
-  # Broken: success on invalid input.
-continue
-else
-  # Passes both tests.
-ac_preproc_ok=:
-break
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-
-done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.i conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then :
-  break
-fi
-
-    done
-    ac_cv_prog_CPP=$CPP
-
-fi
-  CPP=$ac_cv_prog_CPP
-else
-  ac_cv_prog_CPP=$CPP
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
-$as_echo "$CPP" >&6; }
-ac_preproc_ok=false
-for ac_c_preproc_warn_flag in '' yes
-do
-  # Use a header file that comes with gcc, so configuring glibc
-  # with a fresh cross-compiler works.
-  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-  # <limits.h> exists even on freestanding compilers.
-  # On the NeXT, cc -E runs the code through the compiler's parser,
-  # not just through cpp. "Syntax error" is here to catch this case.
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-		     Syntax error
-_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
-
-else
-  # Broken: fails on valid input.
-continue
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-
-  # OK, works on sane cases.  Now check whether nonexistent headers
-  # can be detected and how.
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <ac_nonexistent.h>
-_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
-  # Broken: success on invalid input.
-continue
-else
-  # Passes both tests.
-ac_preproc_ok=:
-break
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-
-done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.i conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then :
-
-else
-  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
-See \`config.log' for more details" "$LINENO" 5; }
-fi
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
-$as_echo_n "checking for ANSI C header files... " >&6; }
-if ${ac_cv_header_stdc+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
-#include <float.h>
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_header_stdc=yes
-else
-  ac_cv_header_stdc=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-if test $ac_cv_header_stdc = yes; then
-  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <string.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "memchr" >/dev/null 2>&1; then :
-
-else
-  ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-fi
-
-if test $ac_cv_header_stdc = yes; then
-  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <stdlib.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "free" >/dev/null 2>&1; then :
-
-else
-  ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-fi
-
-if test $ac_cv_header_stdc = yes; then
-  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
-  if test "$cross_compiling" = yes; then :
-  :
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <ctype.h>
-#include <stdlib.h>
-#if ((' ' & 0x0FF) == 0x020)
-# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
-# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
-#else
-# define ISLOWER(c) \
-		   (('a' <= (c) && (c) <= 'i') \
-		     || ('j' <= (c) && (c) <= 'r') \
-		     || ('s' <= (c) && (c) <= 'z'))
-# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
-#endif
-
-#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
-int
-main ()
-{
-  int i;
-  for (i = 0; i < 256; i++)
-    if (XOR (islower (i), ISLOWER (i))
-	|| toupper (i) != TOUPPER (i))
-      return 2;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-
-else
-  ac_cv_header_stdc=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
-$as_echo "$ac_cv_header_stdc" >&6; }
-if test $ac_cv_header_stdc = yes; then
-
-$as_echo "#define STDC_HEADERS 1" >>confdefs.h
-
-fi
-
-# On IRIX 5.3, sys/types and inttypes.h are conflicting.
-for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
-		  inttypes.h stdint.h unistd.h
-do :
-  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
-"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-
-for ac_header in dlfcn.h
-do :
-  ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default
-"
-if test "x$ac_cv_header_dlfcn_h" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_DLFCN_H 1
-_ACEOF
-
-fi
-
-done
-
-
-
-
-
-# Set options
-
-
-
-        enable_dlopen=no
-
-
-  enable_win32_dll=no
-
-
-            # Check whether --enable-shared was given.
-if test "${enable_shared+set}" = set; then :
-  enableval=$enable_shared; p=${PACKAGE-default}
-    case $enableval in
-    yes) enable_shared=yes ;;
-    no) enable_shared=no ;;
-    *)
-      enable_shared=no
-      # Look at the argument we got.  We use all the common list separators.
-      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
-      for pkg in $enableval; do
-	IFS=$lt_save_ifs
-	if test "X$pkg" = "X$p"; then
-	  enable_shared=yes
-	fi
-      done
-      IFS=$lt_save_ifs
-      ;;
-    esac
-else
-  enable_shared=yes
-fi
-
-
-
-
-
-
-
-
-
-  # Check whether --enable-static was given.
-if test "${enable_static+set}" = set; then :
-  enableval=$enable_static; p=${PACKAGE-default}
-    case $enableval in
-    yes) enable_static=yes ;;
-    no) enable_static=no ;;
-    *)
-     enable_static=no
-      # Look at the argument we got.  We use all the common list separators.
-      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
-      for pkg in $enableval; do
-	IFS=$lt_save_ifs
-	if test "X$pkg" = "X$p"; then
-	  enable_static=yes
-	fi
-      done
-      IFS=$lt_save_ifs
-      ;;
-    esac
-else
-  enable_static=yes
-fi
-
-
-
-
-
-
-
-
-
-
-# Check whether --with-pic was given.
-if test "${with_pic+set}" = set; then :
-  withval=$with_pic; lt_p=${PACKAGE-default}
-    case $withval in
-    yes|no) pic_mode=$withval ;;
-    *)
-      pic_mode=default
-      # Look at the argument we got.  We use all the common list separators.
-      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
-      for lt_pkg in $withval; do
-	IFS=$lt_save_ifs
-	if test "X$lt_pkg" = "X$lt_p"; then
-	  pic_mode=yes
-	fi
-      done
-      IFS=$lt_save_ifs
-      ;;
-    esac
-else
-  pic_mode=default
-fi
-
-
-
-
-
-
-
-
-  # Check whether --enable-fast-install was given.
-if test "${enable_fast_install+set}" = set; then :
-  enableval=$enable_fast_install; p=${PACKAGE-default}
-    case $enableval in
-    yes) enable_fast_install=yes ;;
-    no) enable_fast_install=no ;;
-    *)
-      enable_fast_install=no
-      # Look at the argument we got.  We use all the common list separators.
-      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
-      for pkg in $enableval; do
-	IFS=$lt_save_ifs
-	if test "X$pkg" = "X$p"; then
-	  enable_fast_install=yes
-	fi
-      done
-      IFS=$lt_save_ifs
-      ;;
-    esac
-else
-  enable_fast_install=yes
-fi
-
-
-
-
-
-
-
-
-  shared_archive_member_spec=
-case $host,$enable_shared in
-power*-*-aix[5-9]*,yes)
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking which variant of shared library versioning to provide" >&5
-$as_echo_n "checking which variant of shared library versioning to provide... " >&6; }
-
-# Check whether --with-aix-soname was given.
-if test "${with_aix_soname+set}" = set; then :
-  withval=$with_aix_soname; case $withval in
-    aix|svr4|both)
-      ;;
-    *)
-      as_fn_error $? "Unknown argument to --with-aix-soname" "$LINENO" 5
-      ;;
-    esac
-    lt_cv_with_aix_soname=$with_aix_soname
-else
-  if ${lt_cv_with_aix_soname+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  lt_cv_with_aix_soname=aix
-fi
-
-    with_aix_soname=$lt_cv_with_aix_soname
-fi
-
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_aix_soname" >&5
-$as_echo "$with_aix_soname" >&6; }
-  if test aix != "$with_aix_soname"; then
-    # For the AIX way of multilib, we name the shared archive member
-    # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o',
-    # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File.
-    # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag,
-    # the AIX toolchain works better with OBJECT_MODE set (default 32).
-    if test 64 = "${OBJECT_MODE-32}"; then
-      shared_archive_member_spec=shr_64
-    else
-      shared_archive_member_spec=shr
-    fi
-  fi
-  ;;
-*)
-  with_aix_soname=aix
-  ;;
-esac
-
-
-
-
-
-
-
-
-
-
-# This can be used to rebuild libtool when needed
-LIBTOOL_DEPS=$ltmain
-
-# Always use our own libtool.
-LIBTOOL='$(SHELL) $(top_builddir)/libtool'
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-test -z "$LN_S" && LN_S="ln -s"
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-if test -n "${ZSH_VERSION+set}"; then
-   setopt NO_GLOB_SUBST
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5
-$as_echo_n "checking for objdir... " >&6; }
-if ${lt_cv_objdir+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  rm -f .libs 2>/dev/null
-mkdir .libs 2>/dev/null
-if test -d .libs; then
-  lt_cv_objdir=.libs
-else
-  # MS-DOS does not allow filenames that begin with a dot.
-  lt_cv_objdir=_libs
-fi
-rmdir .libs 2>/dev/null
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5
-$as_echo "$lt_cv_objdir" >&6; }
-objdir=$lt_cv_objdir
-
-
-
-
-
-cat >>confdefs.h <<_ACEOF
-#define LT_OBJDIR "$lt_cv_objdir/"
-_ACEOF
-
-
-
-
-case $host_os in
-aix3*)
-  # AIX sometimes has problems with the GCC collect2 program.  For some
-  # reason, if we set the COLLECT_NAMES environment variable, the problems
-  # vanish in a puff of smoke.
-  if test set != "${COLLECT_NAMES+set}"; then
-    COLLECT_NAMES=
-    export COLLECT_NAMES
-  fi
-  ;;
-esac
-
-# Global variables:
-ofile=libtool
-can_build_shared=yes
-
-# All known linkers require a '.a' archive for static linking (except MSVC,
-# which needs '.lib').
-libext=a
-
-with_gnu_ld=$lt_cv_prog_gnu_ld
-
-old_CC=$CC
-old_CFLAGS=$CFLAGS
-
-# Set sane defaults for various variables
-test -z "$CC" && CC=cc
-test -z "$LTCC" && LTCC=$CC
-test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
-test -z "$LD" && LD=ld
-test -z "$ac_objext" && ac_objext=o
-
-func_cc_basename $compiler
-cc_basename=$func_cc_basename_result
-
-
-# Only perform the check for file, if the check method requires it
-test -z "$MAGIC_CMD" && MAGIC_CMD=file
-case $deplibs_check_method in
-file_magic*)
-  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5
-$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; }
-if ${lt_cv_path_MAGIC_CMD+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  case $MAGIC_CMD in
-[\\/*] |  ?:[\\/]*)
-  lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path.
-  ;;
-*)
-  lt_save_MAGIC_CMD=$MAGIC_CMD
-  lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
-  ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
-  for ac_dir in $ac_dummy; do
-    IFS=$lt_save_ifs
-    test -z "$ac_dir" && ac_dir=.
-    if test -f "$ac_dir/${ac_tool_prefix}file"; then
-      lt_cv_path_MAGIC_CMD=$ac_dir/"${ac_tool_prefix}file"
-      if test -n "$file_magic_test_file"; then
-	case $deplibs_check_method in
-	"file_magic "*)
-	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
-	  MAGIC_CMD=$lt_cv_path_MAGIC_CMD
-	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
-	    $EGREP "$file_magic_regex" > /dev/null; then
-	    :
-	  else
-	    cat <<_LT_EOF 1>&2
-
-*** Warning: the command libtool uses to detect shared libraries,
-*** $file_magic_cmd, produces output that libtool cannot recognize.
-*** The result is that libtool may fail to recognize shared libraries
-*** as such.  This will affect the creation of libtool libraries that
-*** depend on shared libraries, but programs linked with such libtool
-*** libraries will work regardless of this problem.  Nevertheless, you
-*** may want to report the problem to your system manager and/or to
-*** bug-libtool at gnu.org
-
-_LT_EOF
-	  fi ;;
-	esac
-      fi
-      break
-    fi
-  done
-  IFS=$lt_save_ifs
-  MAGIC_CMD=$lt_save_MAGIC_CMD
-  ;;
-esac
-fi
-
-MAGIC_CMD=$lt_cv_path_MAGIC_CMD
-if test -n "$MAGIC_CMD"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
-$as_echo "$MAGIC_CMD" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-
-
-
-if test -z "$lt_cv_path_MAGIC_CMD"; then
-  if test -n "$ac_tool_prefix"; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5
-$as_echo_n "checking for file... " >&6; }
-if ${lt_cv_path_MAGIC_CMD+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  case $MAGIC_CMD in
-[\\/*] |  ?:[\\/]*)
-  lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path.
-  ;;
-*)
-  lt_save_MAGIC_CMD=$MAGIC_CMD
-  lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
-  ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
-  for ac_dir in $ac_dummy; do
-    IFS=$lt_save_ifs
-    test -z "$ac_dir" && ac_dir=.
-    if test -f "$ac_dir/file"; then
-      lt_cv_path_MAGIC_CMD=$ac_dir/"file"
-      if test -n "$file_magic_test_file"; then
-	case $deplibs_check_method in
-	"file_magic "*)
-	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
-	  MAGIC_CMD=$lt_cv_path_MAGIC_CMD
-	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
-	    $EGREP "$file_magic_regex" > /dev/null; then
-	    :
-	  else
-	    cat <<_LT_EOF 1>&2
-
-*** Warning: the command libtool uses to detect shared libraries,
-*** $file_magic_cmd, produces output that libtool cannot recognize.
-*** The result is that libtool may fail to recognize shared libraries
-*** as such.  This will affect the creation of libtool libraries that
-*** depend on shared libraries, but programs linked with such libtool
-*** libraries will work regardless of this problem.  Nevertheless, you
-*** may want to report the problem to your system manager and/or to
-*** bug-libtool at gnu.org
-
-_LT_EOF
-	  fi ;;
-	esac
-      fi
-      break
-    fi
-  done
-  IFS=$lt_save_ifs
-  MAGIC_CMD=$lt_save_MAGIC_CMD
-  ;;
-esac
-fi
-
-MAGIC_CMD=$lt_cv_path_MAGIC_CMD
-if test -n "$MAGIC_CMD"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
-$as_echo "$MAGIC_CMD" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-  else
-    MAGIC_CMD=:
-  fi
-fi
-
-  fi
-  ;;
-esac
-
-# Use C for the default configuration in the libtool script
-
-lt_save_CC=$CC
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-# Source file extension for C test sources.
-ac_ext=c
-
-# Object file extension for compiled C test sources.
-objext=o
-objext=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="int some_variable = 0;"
-
-# Code to be used in simple link tests
-lt_simple_link_test_code='int main(){return(0);}'
-
-
-
-
-
-
-
-# If no C compiler was specified, use CC.
-LTCC=${LTCC-"$CC"}
-
-# If no C compiler flags were specified, use CFLAGS.
-LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
-
-# Allow CC to be a program name with arguments.
-compiler=$CC
-
-# Save the default compiler, since it gets overwritten when the other
-# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
-compiler_DEFAULT=$CC
-
-# save warnings/boilerplate of simple test code
-ac_outfile=conftest.$ac_objext
-echo "$lt_simple_compile_test_code" >conftest.$ac_ext
-eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_compiler_boilerplate=`cat conftest.err`
-$RM -r conftest*
-
-ac_outfile=conftest.$ac_objext
-echo "$lt_simple_link_test_code" >conftest.$ac_ext
-eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_linker_boilerplate=`cat conftest.err`
-$RM -r conftest*
-
-
-## CAVEAT EMPTOR:
-## There is no encapsulation within the following macros, do not change
-## the running order or otherwise move them around unless you know exactly
-## what you are doing...
-if test -n "$compiler"; then
-
-lt_prog_compiler_no_builtin_flag=
-
-if test yes = "$GCC"; then
-  case $cc_basename in
-  nvcc*)
-    lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;;
-  *)
-    lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;;
-  esac
-
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
-$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; }
-if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  lt_cv_prog_compiler_rtti_exceptions=no
-   ac_outfile=conftest.$ac_objext
-   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-   lt_compiler_flag="-fno-rtti -fno-exceptions"  ## exclude from sc_useless_quotes_in_assignment
-   # Insert the option either (1) after the last *FLAGS variable, or
-   # (2) before a word containing "conftest.", or (3) at the end.
-   # Note that $ac_compile itself does not contain backslashes and begins
-   # with a dollar sign (not a hyphen), so the echo should work correctly.
-   # The option is referenced via a variable to avoid confusing sed.
-   lt_compile=`echo "$ac_compile" | $SED \
-   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-   -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
-   (eval "$lt_compile" 2>conftest.err)
-   ac_status=$?
-   cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   if (exit $ac_status) && test -s "$ac_outfile"; then
-     # The compiler can only warn and ignore the option if not recognized
-     # So say no if there are warnings other than the usual output.
-     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
-     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
-     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
-       lt_cv_prog_compiler_rtti_exceptions=yes
-     fi
-   fi
-   $RM -r conftest*
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
-$as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; }
-
-if test yes = "$lt_cv_prog_compiler_rtti_exceptions"; then
-    lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions"
-else
-    :
-fi
-
-fi
-
-
-
-
-
-
-  lt_prog_compiler_wl=
-lt_prog_compiler_pic=
-lt_prog_compiler_static=
-
-
-  if test yes = "$GCC"; then
-    lt_prog_compiler_wl='-Wl,'
-    lt_prog_compiler_static='-static'
-
-    case $host_os in
-      aix*)
-      # All AIX code is PIC.
-      if test ia64 = "$host_cpu"; then
-	# AIX 5 now supports IA64 processor
-	lt_prog_compiler_static='-Bstatic'
-      fi
-      lt_prog_compiler_pic='-fPIC'
-      ;;
-
-    amigaos*)
-      case $host_cpu in
-      powerpc)
-            # see comment about AmigaOS4 .so support
-            lt_prog_compiler_pic='-fPIC'
-        ;;
-      m68k)
-            # FIXME: we need at least 68020 code to build shared libraries, but
-            # adding the '-m68020' flag to GCC prevents building anything better,
-            # like '-m68040'.
-            lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4'
-        ;;
-      esac
-      ;;
-
-    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
-      # PIC is the default for these OSes.
-      ;;
-
-    mingw* | cygwin* | pw32* | os2* | cegcc*)
-      # This hack is so that the source file can tell whether it is being
-      # built for inclusion in a dll (and should export symbols for example).
-      # Although the cygwin gcc ignores -fPIC, still need this for old-style
-      # (--disable-auto-import) libraries
-      lt_prog_compiler_pic='-DDLL_EXPORT'
-      case $host_os in
-      os2*)
-	lt_prog_compiler_static='$wl-static'
-	;;
-      esac
-      ;;
-
-    darwin* | rhapsody*)
-      # PIC is the default on this platform
-      # Common symbols not allowed in MH_DYLIB files
-      lt_prog_compiler_pic='-fno-common'
-      ;;
-
-    haiku*)
-      # PIC is the default for Haiku.
-      # The "-static" flag exists, but is broken.
-      lt_prog_compiler_static=
-      ;;
-
-    hpux*)
-      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
-      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
-      # sets the default TLS model and affects inlining.
-      case $host_cpu in
-      hppa*64*)
-	# +Z the default
-	;;
-      *)
-	lt_prog_compiler_pic='-fPIC'
-	;;
-      esac
-      ;;
-
-    interix[3-9]*)
-      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
-      # Instead, we relocate shared libraries at runtime.
-      ;;
-
-    msdosdjgpp*)
-      # Just because we use GCC doesn't mean we suddenly get shared libraries
-      # on systems that don't support them.
-      lt_prog_compiler_can_build_shared=no
-      enable_shared=no
-      ;;
-
-    *nto* | *qnx*)
-      # QNX uses GNU C++, but need to define -shared option too, otherwise
-      # it will coredump.
-      lt_prog_compiler_pic='-fPIC -shared'
-      ;;
-
-    sysv4*MP*)
-      if test -d /usr/nec; then
-	lt_prog_compiler_pic=-Kconform_pic
-      fi
-      ;;
-
-    *)
-      lt_prog_compiler_pic='-fPIC'
-      ;;
-    esac
-
-    case $cc_basename in
-    nvcc*) # Cuda Compiler Driver 2.2
-      lt_prog_compiler_wl='-Xlinker '
-      if test -n "$lt_prog_compiler_pic"; then
-        lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic"
-      fi
-      ;;
-    esac
-  else
-    # PORTME Check for flag to pass linker flags through the system compiler.
-    case $host_os in
-    aix*)
-      lt_prog_compiler_wl='-Wl,'
-      if test ia64 = "$host_cpu"; then
-	# AIX 5 now supports IA64 processor
-	lt_prog_compiler_static='-Bstatic'
-      else
-	lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp'
-      fi
-      ;;
-
-    darwin* | rhapsody*)
-      # PIC is the default on this platform
-      # Common symbols not allowed in MH_DYLIB files
-      lt_prog_compiler_pic='-fno-common'
-      case $cc_basename in
-      nagfor*)
-        # NAG Fortran compiler
-        lt_prog_compiler_wl='-Wl,-Wl,,'
-        lt_prog_compiler_pic='-PIC'
-        lt_prog_compiler_static='-Bstatic'
-        ;;
-      esac
-      ;;
-
-    mingw* | cygwin* | pw32* | os2* | cegcc*)
-      # This hack is so that the source file can tell whether it is being
-      # built for inclusion in a dll (and should export symbols for example).
-      lt_prog_compiler_pic='-DDLL_EXPORT'
-      case $host_os in
-      os2*)
-	lt_prog_compiler_static='$wl-static'
-	;;
-      esac
-      ;;
-
-    hpux9* | hpux10* | hpux11*)
-      lt_prog_compiler_wl='-Wl,'
-      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
-      # not for PA HP-UX.
-      case $host_cpu in
-      hppa*64*|ia64*)
-	# +Z the default
-	;;
-      *)
-	lt_prog_compiler_pic='+Z'
-	;;
-      esac
-      # Is there a better lt_prog_compiler_static that works with the bundled CC?
-      lt_prog_compiler_static='$wl-a ${wl}archive'
-      ;;
-
-    irix5* | irix6* | nonstopux*)
-      lt_prog_compiler_wl='-Wl,'
-      # PIC (with -KPIC) is the default.
-      lt_prog_compiler_static='-non_shared'
-      ;;
-
-    linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
-      case $cc_basename in
-      # old Intel for x86_64, which still supported -KPIC.
-      ecc*)
-	lt_prog_compiler_wl='-Wl,'
-	lt_prog_compiler_pic='-KPIC'
-	lt_prog_compiler_static='-static'
-        ;;
-      # icc used to be incompatible with GCC.
-      # ICC 10 doesn't accept -KPIC any more.
-      icc* | ifort*)
-	lt_prog_compiler_wl='-Wl,'
-	lt_prog_compiler_pic='-fPIC'
-	lt_prog_compiler_static='-static'
-        ;;
-      # Lahey Fortran 8.1.
-      lf95*)
-	lt_prog_compiler_wl='-Wl,'
-	lt_prog_compiler_pic='--shared'
-	lt_prog_compiler_static='--static'
-	;;
-      nagfor*)
-	# NAG Fortran compiler
-	lt_prog_compiler_wl='-Wl,-Wl,,'
-	lt_prog_compiler_pic='-PIC'
-	lt_prog_compiler_static='-Bstatic'
-	;;
-      tcc*)
-	# Fabrice Bellard et al's Tiny C Compiler
-	lt_prog_compiler_wl='-Wl,'
-	lt_prog_compiler_pic='-fPIC'
-	lt_prog_compiler_static='-static'
-	;;
-      pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
-        # Portland Group compilers (*not* the Pentium gcc compiler,
-	# which looks to be a dead project)
-	lt_prog_compiler_wl='-Wl,'
-	lt_prog_compiler_pic='-fpic'
-	lt_prog_compiler_static='-Bstatic'
-        ;;
-      ccc*)
-        lt_prog_compiler_wl='-Wl,'
-        # All Alpha code is PIC.
-        lt_prog_compiler_static='-non_shared'
-        ;;
-      xl* | bgxl* | bgf* | mpixl*)
-	# IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
-	lt_prog_compiler_wl='-Wl,'
-	lt_prog_compiler_pic='-qpic'
-	lt_prog_compiler_static='-qstaticlink'
-	;;
-      *)
-	case `$CC -V 2>&1 | sed 5q` in
-	*Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*)
-	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
-	  lt_prog_compiler_pic='-KPIC'
-	  lt_prog_compiler_static='-Bstatic'
-	  lt_prog_compiler_wl=''
-	  ;;
-	*Sun\ F* | *Sun*Fortran*)
-	  lt_prog_compiler_pic='-KPIC'
-	  lt_prog_compiler_static='-Bstatic'
-	  lt_prog_compiler_wl='-Qoption ld '
-	  ;;
-	*Sun\ C*)
-	  # Sun C 5.9
-	  lt_prog_compiler_pic='-KPIC'
-	  lt_prog_compiler_static='-Bstatic'
-	  lt_prog_compiler_wl='-Wl,'
-	  ;;
-        *Intel*\ [CF]*Compiler*)
-	  lt_prog_compiler_wl='-Wl,'
-	  lt_prog_compiler_pic='-fPIC'
-	  lt_prog_compiler_static='-static'
-	  ;;
-	*Portland\ Group*)
-	  lt_prog_compiler_wl='-Wl,'
-	  lt_prog_compiler_pic='-fpic'
-	  lt_prog_compiler_static='-Bstatic'
-	  ;;
-	esac
-	;;
-      esac
-      ;;
-
-    newsos6)
-      lt_prog_compiler_pic='-KPIC'
-      lt_prog_compiler_static='-Bstatic'
-      ;;
-
-    *nto* | *qnx*)
-      # QNX uses GNU C++, but need to define -shared option too, otherwise
-      # it will coredump.
-      lt_prog_compiler_pic='-fPIC -shared'
-      ;;
-
-    osf3* | osf4* | osf5*)
-      lt_prog_compiler_wl='-Wl,'
-      # All OSF/1 code is PIC.
-      lt_prog_compiler_static='-non_shared'
-      ;;
-
-    rdos*)
-      lt_prog_compiler_static='-non_shared'
-      ;;
-
-    solaris*)
-      lt_prog_compiler_pic='-KPIC'
-      lt_prog_compiler_static='-Bstatic'
-      case $cc_basename in
-      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
-	lt_prog_compiler_wl='-Qoption ld ';;
-      *)
-	lt_prog_compiler_wl='-Wl,';;
-      esac
-      ;;
-
-    sunos4*)
-      lt_prog_compiler_wl='-Qoption ld '
-      lt_prog_compiler_pic='-PIC'
-      lt_prog_compiler_static='-Bstatic'
-      ;;
-
-    sysv4 | sysv4.2uw2* | sysv4.3*)
-      lt_prog_compiler_wl='-Wl,'
-      lt_prog_compiler_pic='-KPIC'
-      lt_prog_compiler_static='-Bstatic'
-      ;;
-
-    sysv4*MP*)
-      if test -d /usr/nec; then
-	lt_prog_compiler_pic='-Kconform_pic'
-	lt_prog_compiler_static='-Bstatic'
-      fi
-      ;;
-
-    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
-      lt_prog_compiler_wl='-Wl,'
-      lt_prog_compiler_pic='-KPIC'
-      lt_prog_compiler_static='-Bstatic'
-      ;;
-
-    unicos*)
-      lt_prog_compiler_wl='-Wl,'
-      lt_prog_compiler_can_build_shared=no
-      ;;
-
-    uts4*)
-      lt_prog_compiler_pic='-pic'
-      lt_prog_compiler_static='-Bstatic'
-      ;;
-
-    *)
-      lt_prog_compiler_can_build_shared=no
-      ;;
-    esac
-  fi
-
-case $host_os in
-  # For platforms that do not support PIC, -DPIC is meaningless:
-  *djgpp*)
-    lt_prog_compiler_pic=
-    ;;
-  *)
-    lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC"
-    ;;
-esac
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
-$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
-if ${lt_cv_prog_compiler_pic+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  lt_cv_prog_compiler_pic=$lt_prog_compiler_pic
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5
-$as_echo "$lt_cv_prog_compiler_pic" >&6; }
-lt_prog_compiler_pic=$lt_cv_prog_compiler_pic
-
-#
-# Check to make sure the PIC flag actually works.
-#
-if test -n "$lt_prog_compiler_pic"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5
-$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; }
-if ${lt_cv_prog_compiler_pic_works+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  lt_cv_prog_compiler_pic_works=no
-   ac_outfile=conftest.$ac_objext
-   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-   lt_compiler_flag="$lt_prog_compiler_pic -DPIC"  ## exclude from sc_useless_quotes_in_assignment
-   # Insert the option either (1) after the last *FLAGS variable, or
-   # (2) before a word containing "conftest.", or (3) at the end.
-   # Note that $ac_compile itself does not contain backslashes and begins
-   # with a dollar sign (not a hyphen), so the echo should work correctly.
-   # The option is referenced via a variable to avoid confusing sed.
-   lt_compile=`echo "$ac_compile" | $SED \
-   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-   -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
-   (eval "$lt_compile" 2>conftest.err)
-   ac_status=$?
-   cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   if (exit $ac_status) && test -s "$ac_outfile"; then
-     # The compiler can only warn and ignore the option if not recognized
-     # So say no if there are warnings other than the usual output.
-     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
-     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
-     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
-       lt_cv_prog_compiler_pic_works=yes
-     fi
-   fi
-   $RM -r conftest*
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5
-$as_echo "$lt_cv_prog_compiler_pic_works" >&6; }
-
-if test yes = "$lt_cv_prog_compiler_pic_works"; then
-    case $lt_prog_compiler_pic in
-     "" | " "*) ;;
-     *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;;
-     esac
-else
-    lt_prog_compiler_pic=
-     lt_prog_compiler_can_build_shared=no
-fi
-
-fi
-
-
-
-
-
-
-
-
-
-
-
-#
-# Check to make sure the static flag actually works.
-#
-wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\"
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5
-$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; }
-if ${lt_cv_prog_compiler_static_works+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  lt_cv_prog_compiler_static_works=no
-   save_LDFLAGS=$LDFLAGS
-   LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
-   echo "$lt_simple_link_test_code" > conftest.$ac_ext
-   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
-     # The linker can only warn and ignore the option if not recognized
-     # So say no if there are warnings
-     if test -s conftest.err; then
-       # Append any errors to the config.log.
-       cat conftest.err 1>&5
-       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
-       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
-       if diff conftest.exp conftest.er2 >/dev/null; then
-         lt_cv_prog_compiler_static_works=yes
-       fi
-     else
-       lt_cv_prog_compiler_static_works=yes
-     fi
-   fi
-   $RM -r conftest*
-   LDFLAGS=$save_LDFLAGS
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5
-$as_echo "$lt_cv_prog_compiler_static_works" >&6; }
-
-if test yes = "$lt_cv_prog_compiler_static_works"; then
-    :
-else
-    lt_prog_compiler_static=
-fi
-
-
-
-
-
-
-
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
-$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
-if ${lt_cv_prog_compiler_c_o+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  lt_cv_prog_compiler_c_o=no
-   $RM -r conftest 2>/dev/null
-   mkdir conftest
-   cd conftest
-   mkdir out
-   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-
-   lt_compiler_flag="-o out/conftest2.$ac_objext"
-   # Insert the option either (1) after the last *FLAGS variable, or
-   # (2) before a word containing "conftest.", or (3) at the end.
-   # Note that $ac_compile itself does not contain backslashes and begins
-   # with a dollar sign (not a hyphen), so the echo should work correctly.
-   lt_compile=`echo "$ac_compile" | $SED \
-   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-   -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
-   (eval "$lt_compile" 2>out/conftest.err)
-   ac_status=$?
-   cat out/conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   if (exit $ac_status) && test -s out/conftest2.$ac_objext
-   then
-     # The compiler can only warn and ignore the option if not recognized
-     # So say no if there are warnings
-     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
-     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
-     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
-       lt_cv_prog_compiler_c_o=yes
-     fi
-   fi
-   chmod u+w . 2>&5
-   $RM -r conftest*
-   # SGI C++ compiler will create directory out/ii_files/ for
-   # template instantiation
-   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
-   $RM out/* && rmdir out
-   cd ..
-   $RM -r conftest
-   $RM -r conftest*
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5
-$as_echo "$lt_cv_prog_compiler_c_o" >&6; }
-
-
-
-
-
-
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
-$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
-if ${lt_cv_prog_compiler_c_o+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  lt_cv_prog_compiler_c_o=no
-   $RM -r conftest 2>/dev/null
-   mkdir conftest
-   cd conftest
-   mkdir out
-   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-
-   lt_compiler_flag="-o out/conftest2.$ac_objext"
-   # Insert the option either (1) after the last *FLAGS variable, or
-   # (2) before a word containing "conftest.", or (3) at the end.
-   # Note that $ac_compile itself does not contain backslashes and begins
-   # with a dollar sign (not a hyphen), so the echo should work correctly.
-   lt_compile=`echo "$ac_compile" | $SED \
-   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-   -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
-   (eval "$lt_compile" 2>out/conftest.err)
-   ac_status=$?
-   cat out/conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   if (exit $ac_status) && test -s out/conftest2.$ac_objext
-   then
-     # The compiler can only warn and ignore the option if not recognized
-     # So say no if there are warnings
-     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
-     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
-     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
-       lt_cv_prog_compiler_c_o=yes
-     fi
-   fi
-   chmod u+w . 2>&5
-   $RM -r conftest*
-   # SGI C++ compiler will create directory out/ii_files/ for
-   # template instantiation
-   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
-   $RM out/* && rmdir out
-   cd ..
-   $RM -r conftest
-   $RM -r conftest*
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5
-$as_echo "$lt_cv_prog_compiler_c_o" >&6; }
-
-
-
-
-hard_links=nottested
-if test no = "$lt_cv_prog_compiler_c_o" && test no != "$need_locks"; then
-  # do not overwrite the value of need_locks provided by the user
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5
-$as_echo_n "checking if we can lock with hard links... " >&6; }
-  hard_links=yes
-  $RM -r conftest*
-  ln conftest.a conftest.b 2>/dev/null && hard_links=no
-  touch conftest.a
-  ln conftest.a conftest.b 2>&5 || hard_links=no
-  ln conftest.a conftest.b 2>/dev/null && hard_links=no
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5
-$as_echo "$hard_links" >&6; }
-  if test no = "$hard_links"; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5
-$as_echo "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;}
-    need_locks=warn
-  fi
-else
-  need_locks=no
-fi
-
-
-
-
-
-
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5
-$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
-
-  runpath_var=
-  allow_undefined_flag=
-  always_export_symbols=no
-  archive_cmds=
-  archive_expsym_cmds=
-  compiler_needs_object=no
-  enable_shared_with_static_runtimes=no
-  export_dynamic_flag_spec=
-  export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
-  hardcode_automatic=no
-  hardcode_direct=no
-  hardcode_direct_absolute=no
-  hardcode_libdir_flag_spec=
-  hardcode_libdir_separator=
-  hardcode_minus_L=no
-  hardcode_shlibpath_var=unsupported
-  inherit_rpath=no
-  link_all_deplibs=unknown
-  module_cmds=
-  module_expsym_cmds=
-  old_archive_from_new_cmds=
-  old_archive_from_expsyms_cmds=
-  thread_safe_flag_spec=
-  whole_archive_flag_spec=
-  # include_expsyms should be a list of space-separated symbols to be *always*
-  # included in the symbol list
-  include_expsyms=
-  # exclude_expsyms can be an extended regexp of symbols to exclude
-  # it will be wrapped by ' (' and ')$', so one must not match beginning or
-  # end of line.  Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc',
-  # as well as any symbol that contains 'd'.
-  exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
-  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
-  # platforms (ab)use it in PIC code, but their linkers get confused if
-  # the symbol is explicitly referenced.  Since portable code cannot
-  # rely on this symbol name, it's probably fine to never include it in
-  # preloaded symbol tables.
-  # Exclude shared library initialization/finalization symbols.
-  extract_expsyms_cmds=
-
-  case $host_os in
-  cygwin* | mingw* | pw32* | cegcc*)
-    # FIXME: the MSVC++ port hasn't been tested in a loooong time
-    # When not using gcc, we currently assume that we are using
-    # Microsoft Visual C++.
-    if test yes != "$GCC"; then
-      with_gnu_ld=no
-    fi
-    ;;
-  interix*)
-    # we just hope/assume this is gcc and not c89 (= MSVC++)
-    with_gnu_ld=yes
-    ;;
-  openbsd* | bitrig*)
-    with_gnu_ld=no
-    ;;
-  esac
-
-  ld_shlibs=yes
-
-  # On some targets, GNU ld is compatible enough with the native linker
-  # that we're better off using the native interface for both.
-  lt_use_gnu_ld_interface=no
-  if test yes = "$with_gnu_ld"; then
-    case $host_os in
-      aix*)
-	# The AIX port of GNU ld has always aspired to compatibility
-	# with the native linker.  However, as the warning in the GNU ld
-	# block says, versions before 2.19.5* couldn't really create working
-	# shared libraries, regardless of the interface used.
-	case `$LD -v 2>&1` in
-	  *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
-	  *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;;
-	  *\ \(GNU\ Binutils\)\ [3-9]*) ;;
-	  *)
-	    lt_use_gnu_ld_interface=yes
-	    ;;
-	esac
-	;;
-      *)
-	lt_use_gnu_ld_interface=yes
-	;;
-    esac
-  fi
-
-  if test yes = "$lt_use_gnu_ld_interface"; then
-    # If archive_cmds runs LD, not CC, wlarc should be empty
-    wlarc='$wl'
-
-    # Set some defaults for GNU ld with shared library support. These
-    # are reset later if shared libraries are not supported. Putting them
-    # here allows them to be overridden if necessary.
-    runpath_var=LD_RUN_PATH
-    hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
-    export_dynamic_flag_spec='$wl--export-dynamic'
-    # ancient GNU ld didn't support --whole-archive et. al.
-    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
-      whole_archive_flag_spec=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
-    else
-      whole_archive_flag_spec=
-    fi
-    supports_anon_versioning=no
-    case `$LD -v | $SED -e 's/(^)\+)\s\+//' 2>&1` in
-      *GNU\ gold*) supports_anon_versioning=yes ;;
-      *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
-      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
-      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
-      *\ 2.11.*) ;; # other 2.11 versions
-      *) supports_anon_versioning=yes ;;
-    esac
-
-    # See if GNU ld supports shared libraries.
-    case $host_os in
-    aix[3-9]*)
-      # On AIX/PPC, the GNU linker is very broken
-      if test ia64 != "$host_cpu"; then
-	ld_shlibs=no
-	cat <<_LT_EOF 1>&2
-
-*** Warning: the GNU linker, at least up to release 2.19, is reported
-*** to be unable to reliably create shared libraries on AIX.
-*** Therefore, libtool is disabling shared libraries support.  If you
-*** really care for shared libraries, you may want to install binutils
-*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
-*** You will then need to restart the configuration process.
-
-_LT_EOF
-      fi
-      ;;
-
-    amigaos*)
-      case $host_cpu in
-      powerpc)
-            # see comment about AmigaOS4 .so support
-            archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
-            archive_expsym_cmds=''
-        ;;
-      m68k)
-            archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
-            hardcode_libdir_flag_spec='-L$libdir'
-            hardcode_minus_L=yes
-        ;;
-      esac
-      ;;
-
-    beos*)
-      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
-	allow_undefined_flag=unsupported
-	# Joseph Beckenbach <jrb3 at best.com> says some releases of gcc
-	# support --undefined.  This deserves some investigation.  FIXME
-	archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
-      else
-	ld_shlibs=no
-      fi
-      ;;
-
-    cygwin* | mingw* | pw32* | cegcc*)
-      # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless,
-      # as there is no search path for DLLs.
-      hardcode_libdir_flag_spec='-L$libdir'
-      export_dynamic_flag_spec='$wl--export-all-symbols'
-      allow_undefined_flag=unsupported
-      always_export_symbols=no
-      enable_shared_with_static_runtimes=yes
-      export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols'
-      exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'
-
-      if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
-        archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
-	# If the export-symbols file already is a .def file, use it as
-	# is; otherwise, prepend EXPORTS...
-	archive_expsym_cmds='if   test DEF = "`$SED -n     -e '\''s/^[	 ]*//'\''     -e '\''/^\(;.*\)*$/d'\''     -e '\''s/^\(EXPORTS\|LIBRARY\)\([	 ].*\)*$/DEF/p'\''     -e q     $export_symbols`" ; then
-          cp $export_symbols $output_objdir/$soname.def;
-        else
-          echo EXPORTS > $output_objdir/$soname.def;
-          cat $export_symbols >> $output_objdir/$soname.def;
-        fi~
-        $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
-      else
-	ld_shlibs=no
-      fi
-      ;;
-
-    haiku*)
-      archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
-      link_all_deplibs=yes
-      ;;
-
-    os2*)
-      hardcode_libdir_flag_spec='-L$libdir'
-      hardcode_minus_L=yes
-      allow_undefined_flag=unsupported
-      shrext_cmds=.dll
-      archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
-	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
-	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
-	$ECHO EXPORTS >> $output_objdir/$libname.def~
-	emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
-	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
-	emximp -o $lib $output_objdir/$libname.def'
-      archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
-	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
-	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
-	$ECHO EXPORTS >> $output_objdir/$libname.def~
-	prefix_cmds="$SED"~
-	if test EXPORTS = "`$SED 1q $export_symbols`"; then
-	  prefix_cmds="$prefix_cmds -e 1d";
-	fi~
-	prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
-	cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
-	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
-	emximp -o $lib $output_objdir/$libname.def'
-      old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
-      enable_shared_with_static_runtimes=yes
-      ;;
-
-    interix[3-9]*)
-      hardcode_direct=no
-      hardcode_shlibpath_var=no
-      hardcode_libdir_flag_spec='$wl-rpath,$libdir'
-      export_dynamic_flag_spec='$wl-E'
-      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
-      # Instead, shared libraries are loaded at an image base (0x10000000 by
-      # default) and relocated if they conflict, which is a slow very memory
-      # consuming and fragmenting process.  To avoid this, we pick a random,
-      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
-      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
-      archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
-      archive_expsym_cmds='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
-      ;;
-
-    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
-      tmp_diet=no
-      if test linux-dietlibc = "$host_os"; then
-	case $cc_basename in
-	  diet\ *) tmp_diet=yes;;	# linux-dietlibc with static linking (!diet-dyn)
-	esac
-      fi
-      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
-	 && test no = "$tmp_diet"
-      then
-	tmp_addflag=' $pic_flag'
-	tmp_sharedflag='-shared'
-	case $cc_basename,$host_cpu in
-        pgcc*)				# Portland Group C compiler
-	  whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
-	  tmp_addflag=' $pic_flag'
-	  ;;
-	pgf77* | pgf90* | pgf95* | pgfortran*)
-					# Portland Group f77 and f90 compilers
-	  whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
-	  tmp_addflag=' $pic_flag -Mnomain' ;;
-	ecc*,ia64* | icc*,ia64*)	# Intel C compiler on ia64
-	  tmp_addflag=' -i_dynamic' ;;
-	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
-	  tmp_addflag=' -i_dynamic -nofor_main' ;;
-	ifc* | ifort*)			# Intel Fortran compiler
-	  tmp_addflag=' -nofor_main' ;;
-	lf95*)				# Lahey Fortran 8.1
-	  whole_archive_flag_spec=
-	  tmp_sharedflag='--shared' ;;
-        nagfor*)                        # NAGFOR 5.3
-          tmp_sharedflag='-Wl,-shared' ;;
-	xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below)
-	  tmp_sharedflag='-qmkshrobj'
-	  tmp_addflag= ;;
-	nvcc*)	# Cuda Compiler Driver 2.2
-	  whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
-	  compiler_needs_object=yes
-	  ;;
-	esac
-	case `$CC -V 2>&1 | sed 5q` in
-	*Sun\ C*)			# Sun C 5.9
-	  whole_archive_flag_spec='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
-	  compiler_needs_object=yes
-	  tmp_sharedflag='-G' ;;
-	*Sun\ F*)			# Sun Fortran 8.3
-	  tmp_sharedflag='-G' ;;
-	esac
-	archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
-
-        if test yes = "$supports_anon_versioning"; then
-          archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
-            cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
-            echo "local: *; };" >> $output_objdir/$libname.ver~
-            $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
-        fi
-
-	case $cc_basename in
-	tcc*)
-	  export_dynamic_flag_spec='-rdynamic'
-	  ;;
-	xlf* | bgf* | bgxlf* | mpixlf*)
-	  # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
-	  whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive'
-	  hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
-	  archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
-	  if test yes = "$supports_anon_versioning"; then
-	    archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
-              cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
-              echo "local: *; };" >> $output_objdir/$libname.ver~
-              $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
-	  fi
-	  ;;
-	esac
-      else
-        ld_shlibs=no
-      fi
-      ;;
-
-    netbsd*)
-      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
-	archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
-	wlarc=
-      else
-	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
-	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
-      fi
-      ;;
-
-    solaris*)
-      if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
-	ld_shlibs=no
-	cat <<_LT_EOF 1>&2
-
-*** Warning: The releases 2.8.* of the GNU linker cannot reliably
-*** create shared libraries on Solaris systems.  Therefore, libtool
-*** is disabling shared libraries support.  We urge you to upgrade GNU
-*** binutils to release 2.9.1 or newer.  Another option is to modify
-*** your PATH or compiler configuration so that the native linker is
-*** used, and then restart.
-
-_LT_EOF
-      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
-	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
-	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
-      else
-	ld_shlibs=no
-      fi
-      ;;
-
-    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
-      case `$LD -v 2>&1` in
-        *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
-	ld_shlibs=no
-	cat <<_LT_EOF 1>&2
-
-*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot
-*** reliably create shared libraries on SCO systems.  Therefore, libtool
-*** is disabling shared libraries support.  We urge you to upgrade GNU
-*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
-*** your PATH or compiler configuration so that the native linker is
-*** used, and then restart.
-
-_LT_EOF
-	;;
-	*)
-	  # For security reasons, it is highly recommended that you always
-	  # use absolute paths for naming shared libraries, and exclude the
-	  # DT_RUNPATH tag from executables and libraries.  But doing so
-	  # requires that you compile everything twice, which is a pain.
-	  if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
-	    hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
-	    archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
-	    archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
-	  else
-	    ld_shlibs=no
-	  fi
-	;;
-      esac
-      ;;
-
-    sunos4*)
-      archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
-      wlarc=
-      hardcode_direct=yes
-      hardcode_shlibpath_var=no
-      ;;
-
-    *)
-      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
-	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
-	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
-      else
-	ld_shlibs=no
-      fi
-      ;;
-    esac
-
-    if test no = "$ld_shlibs"; then
-      runpath_var=
-      hardcode_libdir_flag_spec=
-      export_dynamic_flag_spec=
-      whole_archive_flag_spec=
-    fi
-  else
-    # PORTME fill in a description of your system's linker (not GNU ld)
-    case $host_os in
-    aix3*)
-      allow_undefined_flag=unsupported
-      always_export_symbols=yes
-      archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
-      # Note: this linker hardcodes the directories in LIBPATH if there
-      # are no directories specified by -L.
-      hardcode_minus_L=yes
-      if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then
-	# Neither direct hardcoding nor static linking is supported with a
-	# broken collect2.
-	hardcode_direct=unsupported
-      fi
-      ;;
-
-    aix[4-9]*)
-      if test ia64 = "$host_cpu"; then
-	# On IA64, the linker does run time linking by default, so we don't
-	# have to do anything special.
-	aix_use_runtimelinking=no
-	exp_sym_flag='-Bexport'
-	no_entry_flag=
-      else
-	# If we're using GNU nm, then we don't want the "-C" option.
-	# -C means demangle to GNU nm, but means don't demangle to AIX nm.
-	# Without the "-l" option, or with the "-B" option, AIX nm treats
-	# weak defined symbols like other global defined symbols, whereas
-	# GNU nm marks them as "W".
-	# While the 'weak' keyword is ignored in the Export File, we need
-	# it in the Import File for the 'aix-soname' feature, so we have
-	# to replace the "-B" option with "-P" for AIX nm.
-	if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
-	  export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols'
-	else
-	  export_symbols_cmds='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
-	fi
-	aix_use_runtimelinking=no
-
-	# Test if we are trying to use run time linking or normal
-	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
-	# have runtime linking enabled, and use it for executables.
-	# For shared libraries, we enable/disable runtime linking
-	# depending on the kind of the shared library created -
-	# when "with_aix_soname,aix_use_runtimelinking" is:
-	# "aix,no"   lib.a(lib.so.V) shared, rtl:no,  for executables
-	# "aix,yes"  lib.so          shared, rtl:yes, for executables
-	#            lib.a           static archive
-	# "both,no"  lib.so.V(shr.o) shared, rtl:yes
-	#            lib.a(lib.so.V) shared, rtl:no,  for executables
-	# "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables
-	#            lib.a(lib.so.V) shared, rtl:no
-	# "svr4,*"   lib.so.V(shr.o) shared, rtl:yes, for executables
-	#            lib.a           static archive
-	case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
-	  for ld_flag in $LDFLAGS; do
-	  if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then
-	    aix_use_runtimelinking=yes
-	    break
-	  fi
-	  done
-	  if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then
-	    # With aix-soname=svr4, we create the lib.so.V shared archives only,
-	    # so we don't have lib.a shared libs to link our executables.
-	    # We have to force runtime linking in this case.
-	    aix_use_runtimelinking=yes
-	    LDFLAGS="$LDFLAGS -Wl,-brtl"
-	  fi
-	  ;;
-	esac
-
-	exp_sym_flag='-bexport'
-	no_entry_flag='-bnoentry'
-      fi
-
-      # When large executables or shared objects are built, AIX ld can
-      # have problems creating the table of contents.  If linking a library
-      # or program results in "error TOC overflow" add -mminimal-toc to
-      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
-      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
-
-      archive_cmds=''
-      hardcode_direct=yes
-      hardcode_direct_absolute=yes
-      hardcode_libdir_separator=':'
-      link_all_deplibs=yes
-      file_list_spec='$wl-f,'
-      case $with_aix_soname,$aix_use_runtimelinking in
-      aix,*) ;; # traditional, no import file
-      svr4,* | *,yes) # use import file
-	# The Import File defines what to hardcode.
-	hardcode_direct=no
-	hardcode_direct_absolute=no
-	;;
-      esac
-
-      if test yes = "$GCC"; then
-	case $host_os in aix4.[012]|aix4.[012].*)
-	# We only want to do this on AIX 4.2 and lower, the check
-	# below for broken collect2 doesn't work under 4.3+
-	  collect2name=`$CC -print-prog-name=collect2`
-	  if test -f "$collect2name" &&
-	   strings "$collect2name" | $GREP resolve_lib_name >/dev/null
-	  then
-	  # We have reworked collect2
-	  :
-	  else
-	  # We have old collect2
-	  hardcode_direct=unsupported
-	  # It fails to find uninstalled libraries when the uninstalled
-	  # path is not listed in the libpath.  Setting hardcode_minus_L
-	  # to unsupported forces relinking
-	  hardcode_minus_L=yes
-	  hardcode_libdir_flag_spec='-L$libdir'
-	  hardcode_libdir_separator=
-	  fi
-	  ;;
-	esac
-	shared_flag='-shared'
-	if test yes = "$aix_use_runtimelinking"; then
-	  shared_flag="$shared_flag "'$wl-G'
-	fi
-	# Need to ensure runtime linking is disabled for the traditional
-	# shared library, or the linker may eventually find shared libraries
-	# /with/ Import File - we do not want to mix them.
-	shared_flag_aix='-shared'
-	shared_flag_svr4='-shared $wl-G'
-      else
-	# not using gcc
-	if test ia64 = "$host_cpu"; then
-	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
-	# chokes on -Wl,-G. The following line is correct:
-	  shared_flag='-G'
-	else
-	  if test yes = "$aix_use_runtimelinking"; then
-	    shared_flag='$wl-G'
-	  else
-	    shared_flag='$wl-bM:SRE'
-	  fi
-	  shared_flag_aix='$wl-bM:SRE'
-	  shared_flag_svr4='$wl-G'
-	fi
-      fi
-
-      export_dynamic_flag_spec='$wl-bexpall'
-      # It seems that -bexpall does not export symbols beginning with
-      # underscore (_), so it is better to generate a list of symbols to export.
-      always_export_symbols=yes
-      if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then
-	# Warning - without using the other runtime loading flags (-brtl),
-	# -berok will link without error, but may produce a broken library.
-	allow_undefined_flag='-berok'
-        # Determine the default libpath from the value encoded in an
-        # empty executable.
-        if test set = "${lt_cv_aix_libpath+set}"; then
-  aix_libpath=$lt_cv_aix_libpath
-else
-  if ${lt_cv_aix_libpath_+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-
-  lt_aix_libpath_sed='
-      /Import File Strings/,/^$/ {
-	  /^0/ {
-	      s/^0  *\([^ ]*\) *$/\1/
-	      p
-	  }
-      }'
-  lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-  # Check for a 64-bit object if we didn't find anything.
-  if test -z "$lt_cv_aix_libpath_"; then
-    lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-  fi
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-  if test -z "$lt_cv_aix_libpath_"; then
-    lt_cv_aix_libpath_=/usr/lib:/lib
-  fi
-
-fi
-
-  aix_libpath=$lt_cv_aix_libpath_
-fi
-
-        hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath"
-        archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag
-      else
-	if test ia64 = "$host_cpu"; then
-	  hardcode_libdir_flag_spec='$wl-R $libdir:/usr/lib:/lib'
-	  allow_undefined_flag="-z nodefs"
-	  archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols"
-	else
-	 # Determine the default libpath from the value encoded in an
-	 # empty executable.
-	 if test set = "${lt_cv_aix_libpath+set}"; then
-  aix_libpath=$lt_cv_aix_libpath
-else
-  if ${lt_cv_aix_libpath_+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-
-  lt_aix_libpath_sed='
-      /Import File Strings/,/^$/ {
-	  /^0/ {
-	      s/^0  *\([^ ]*\) *$/\1/
-	      p
-	  }
-      }'
-  lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-  # Check for a 64-bit object if we didn't find anything.
-  if test -z "$lt_cv_aix_libpath_"; then
-    lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-  fi
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-  if test -z "$lt_cv_aix_libpath_"; then
-    lt_cv_aix_libpath_=/usr/lib:/lib
-  fi
-
-fi
-
-  aix_libpath=$lt_cv_aix_libpath_
-fi
-
-	 hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath"
-	  # Warning - without using the other run time loading flags,
-	  # -berok will link without error, but may produce a broken library.
-	  no_undefined_flag=' $wl-bernotok'
-	  allow_undefined_flag=' $wl-berok'
-	  if test yes = "$with_gnu_ld"; then
-	    # We only use this code for GNU lds that support --whole-archive.
-	    whole_archive_flag_spec='$wl--whole-archive$convenience $wl--no-whole-archive'
-	  else
-	    # Exported symbols can be pulled into shared objects from archives
-	    whole_archive_flag_spec='$convenience'
-	  fi
-	  archive_cmds_need_lc=yes
-	  archive_expsym_cmds='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d'
-	  # -brtl affects multiple linker settings, -berok does not and is overridden later
-	  compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([, ]\\)%-berok\\1%g"`'
-	  if test svr4 != "$with_aix_soname"; then
-	    # This is similar to how AIX traditionally builds its shared libraries.
-	    archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname'
-	  fi
-	  if test aix != "$with_aix_soname"; then
-	    archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) >  [...]
-	  else
-	    # used by -dlpreopen to get the symbols
-	    archive_expsym_cmds="$archive_expsym_cmds"'~$MV  $output_objdir/$realname.d/$soname $output_objdir'
-	  fi
-	  archive_expsym_cmds="$archive_expsym_cmds"'~$RM -r $output_objdir/$realname.d'
-	fi
-      fi
-      ;;
-
-    amigaos*)
-      case $host_cpu in
-      powerpc)
-            # see comment about AmigaOS4 .so support
-            archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
-            archive_expsym_cmds=''
-        ;;
-      m68k)
-            archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
-            hardcode_libdir_flag_spec='-L$libdir'
-            hardcode_minus_L=yes
-        ;;
-      esac
-      ;;
-
-    bsdi[45]*)
-      export_dynamic_flag_spec=-rdynamic
-      ;;
-
-    cygwin* | mingw* | pw32* | cegcc*)
-      # When not using gcc, we currently assume that we are using
-      # Microsoft Visual C++.
-      # hardcode_libdir_flag_spec is actually meaningless, as there is
-      # no search path for DLLs.
-      case $cc_basename in
-      cl*)
-	# Native MSVC
-	hardcode_libdir_flag_spec=' '
-	allow_undefined_flag=unsupported
-	always_export_symbols=yes
-	file_list_spec='@'
-	# Tell ltmain to make .lib files, not .a files.
-	libext=lib
-	# Tell ltmain to make .dll files, not .so files.
-	shrext_cmds=.dll
-	# FIXME: Setting linknames here is a bad hack.
-	archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
-	archive_expsym_cmds='if   test DEF = "`$SED -n     -e '\''s/^[	 ]*//'\''     -e '\''/^\(;.*\)*$/d'\''     -e '\''s/^\(EXPORTS\|LIBRARY\)\([	 ].*\)*$/DEF/p'\''     -e q     $export_symbols`" ; then
-            cp "$export_symbols" "$output_objdir/$soname.def";
-            echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
-          else
-            $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
-          fi~
-          $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
-          linknames='
-	# The linker will not automatically build a static lib if we build a DLL.
-	# _LT_TAGVAR(old_archive_from_new_cmds, )='true'
-	enable_shared_with_static_runtimes=yes
-	exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
-	export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
-	# Don't use ranlib
-	old_postinstall_cmds='chmod 644 $oldlib'
-	postlink_cmds='lt_outputfile="@OUTPUT@"~
-          lt_tool_outputfile="@TOOL_OUTPUT@"~
-          case $lt_outputfile in
-            *.exe|*.EXE) ;;
-            *)
-              lt_outputfile=$lt_outputfile.exe
-              lt_tool_outputfile=$lt_tool_outputfile.exe
-              ;;
-          esac~
-          if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then
-            $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
-            $RM "$lt_outputfile.manifest";
-          fi'
-	;;
-      *)
-	# Assume MSVC wrapper
-	hardcode_libdir_flag_spec=' '
-	allow_undefined_flag=unsupported
-	# Tell ltmain to make .lib files, not .a files.
-	libext=lib
-	# Tell ltmain to make .dll files, not .so files.
-	shrext_cmds=.dll
-	# FIXME: Setting linknames here is a bad hack.
-	archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
-	# The linker will automatically build a .lib file if we build a DLL.
-	old_archive_from_new_cmds='true'
-	# FIXME: Should let the user specify the lib program.
-	old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
-	enable_shared_with_static_runtimes=yes
-	;;
-      esac
-      ;;
-
-    darwin* | rhapsody*)
-
-
-  archive_cmds_need_lc=no
-  hardcode_direct=no
-  hardcode_automatic=yes
-  hardcode_shlibpath_var=unsupported
-  if test yes = "$lt_cv_ld_force_load"; then
-    whole_archive_flag_spec='`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
-
-  else
-    whole_archive_flag_spec=''
-  fi
-  link_all_deplibs=yes
-  allow_undefined_flag=$_lt_dar_allow_undefined
-  case $cc_basename in
-     ifort*|nagfor*) _lt_dar_can_shared=yes ;;
-     *) _lt_dar_can_shared=$GCC ;;
-  esac
-  if test yes = "$_lt_dar_can_shared"; then
-    output_verbose_link_cmd=func_echo_all
-    archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil"
-    module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil"
-    archive_expsym_cmds="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil"
-    module_expsym_cmds="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil"
-
-  else
-  ld_shlibs=no
-  fi
-
-      ;;
-
-    dgux*)
-      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      hardcode_libdir_flag_spec='-L$libdir'
-      hardcode_shlibpath_var=no
-      ;;
-
-    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
-    # support.  Future versions do this automatically, but an explicit c++rt0.o
-    # does not break anything, and helps significantly (at the cost of a little
-    # extra space).
-    freebsd2.2*)
-      archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
-      hardcode_libdir_flag_spec='-R$libdir'
-      hardcode_direct=yes
-      hardcode_shlibpath_var=no
-      ;;
-
-    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
-    freebsd2.*)
-      archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
-      hardcode_direct=yes
-      hardcode_minus_L=yes
-      hardcode_shlibpath_var=no
-      ;;
-
-    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
-    freebsd* | dragonfly*)
-      archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
-      hardcode_libdir_flag_spec='-R$libdir'
-      hardcode_direct=yes
-      hardcode_shlibpath_var=no
-      ;;
-
-    hpux9*)
-      if test yes = "$GCC"; then
-	archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
-      else
-	archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
-      fi
-      hardcode_libdir_flag_spec='$wl+b $wl$libdir'
-      hardcode_libdir_separator=:
-      hardcode_direct=yes
-
-      # hardcode_minus_L: Not really in the search PATH,
-      # but as the default location of the library.
-      hardcode_minus_L=yes
-      export_dynamic_flag_spec='$wl-E'
-      ;;
-
-    hpux10*)
-      if test yes,no = "$GCC,$with_gnu_ld"; then
-	archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
-      else
-	archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
-      fi
-      if test no = "$with_gnu_ld"; then
-	hardcode_libdir_flag_spec='$wl+b $wl$libdir'
-	hardcode_libdir_separator=:
-	hardcode_direct=yes
-	hardcode_direct_absolute=yes
-	export_dynamic_flag_spec='$wl-E'
-	# hardcode_minus_L: Not really in the search PATH,
-	# but as the default location of the library.
-	hardcode_minus_L=yes
-      fi
-      ;;
-
-    hpux11*)
-      if test yes,no = "$GCC,$with_gnu_ld"; then
-	case $host_cpu in
-	hppa*64*)
-	  archive_cmds='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
-	  ;;
-	ia64*)
-	  archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
-	  ;;
-	*)
-	  archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
-	  ;;
-	esac
-      else
-	case $host_cpu in
-	hppa*64*)
-	  archive_cmds='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
-	  ;;
-	ia64*)
-	  archive_cmds='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
-	  ;;
-	*)
-
-	  # Older versions of the 11.00 compiler do not understand -b yet
-	  # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
-	  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5
-$as_echo_n "checking if $CC understands -b... " >&6; }
-if ${lt_cv_prog_compiler__b+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  lt_cv_prog_compiler__b=no
-   save_LDFLAGS=$LDFLAGS
-   LDFLAGS="$LDFLAGS -b"
-   echo "$lt_simple_link_test_code" > conftest.$ac_ext
-   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
-     # The linker can only warn and ignore the option if not recognized
-     # So say no if there are warnings
-     if test -s conftest.err; then
-       # Append any errors to the config.log.
-       cat conftest.err 1>&5
-       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
-       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
-       if diff conftest.exp conftest.er2 >/dev/null; then
-         lt_cv_prog_compiler__b=yes
-       fi
-     else
-       lt_cv_prog_compiler__b=yes
-     fi
-   fi
-   $RM -r conftest*
-   LDFLAGS=$save_LDFLAGS
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5
-$as_echo "$lt_cv_prog_compiler__b" >&6; }
-
-if test yes = "$lt_cv_prog_compiler__b"; then
-    archive_cmds='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
-else
-    archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
-fi
-
-	  ;;
-	esac
-      fi
-      if test no = "$with_gnu_ld"; then
-	hardcode_libdir_flag_spec='$wl+b $wl$libdir'
-	hardcode_libdir_separator=:
-
-	case $host_cpu in
-	hppa*64*|ia64*)
-	  hardcode_direct=no
-	  hardcode_shlibpath_var=no
-	  ;;
-	*)
-	  hardcode_direct=yes
-	  hardcode_direct_absolute=yes
-	  export_dynamic_flag_spec='$wl-E'
-
-	  # hardcode_minus_L: Not really in the search PATH,
-	  # but as the default location of the library.
-	  hardcode_minus_L=yes
-	  ;;
-	esac
-      fi
-      ;;
-
-    irix5* | irix6* | nonstopux*)
-      if test yes = "$GCC"; then
-	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
-	# Try to use the -exported_symbol ld option, if it does not
-	# work, assume that -exports_file does not work either and
-	# implicitly export all symbols.
-	# This should be the same for all languages, so no per-tag cache variable.
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5
-$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; }
-if ${lt_cv_irix_exported_symbol+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  save_LDFLAGS=$LDFLAGS
-	   LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null"
-	   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-int foo (void) { return 0; }
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  lt_cv_irix_exported_symbol=yes
-else
-  lt_cv_irix_exported_symbol=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-           LDFLAGS=$save_LDFLAGS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5
-$as_echo "$lt_cv_irix_exported_symbol" >&6; }
-	if test yes = "$lt_cv_irix_exported_symbol"; then
-          archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib'
-	fi
-      else
-	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
-	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib'
-      fi
-      archive_cmds_need_lc='no'
-      hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
-      hardcode_libdir_separator=:
-      inherit_rpath=yes
-      link_all_deplibs=yes
-      ;;
-
-    linux*)
-      case $cc_basename in
-      tcc*)
-	# Fabrice Bellard et al's Tiny C Compiler
-	ld_shlibs=yes
-	archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
-	;;
-      esac
-      ;;
-
-    netbsd*)
-      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
-	archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
-      else
-	archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
-      fi
-      hardcode_libdir_flag_spec='-R$libdir'
-      hardcode_direct=yes
-      hardcode_shlibpath_var=no
-      ;;
-
-    newsos6)
-      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      hardcode_direct=yes
-      hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
-      hardcode_libdir_separator=:
-      hardcode_shlibpath_var=no
-      ;;
-
-    *nto* | *qnx*)
-      ;;
-
-    openbsd* | bitrig*)
-      if test -f /usr/libexec/ld.so; then
-	hardcode_direct=yes
-	hardcode_shlibpath_var=no
-	hardcode_direct_absolute=yes
-	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
-	  archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
-	  archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols'
-	  hardcode_libdir_flag_spec='$wl-rpath,$libdir'
-	  export_dynamic_flag_spec='$wl-E'
-	else
-	  archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
-	  hardcode_libdir_flag_spec='$wl-rpath,$libdir'
-	fi
-      else
-	ld_shlibs=no
-      fi
-      ;;
-
-    os2*)
-      hardcode_libdir_flag_spec='-L$libdir'
-      hardcode_minus_L=yes
-      allow_undefined_flag=unsupported
-      shrext_cmds=.dll
-      archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
-	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
-	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
-	$ECHO EXPORTS >> $output_objdir/$libname.def~
-	emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
-	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
-	emximp -o $lib $output_objdir/$libname.def'
-      archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
-	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
-	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
-	$ECHO EXPORTS >> $output_objdir/$libname.def~
-	prefix_cmds="$SED"~
-	if test EXPORTS = "`$SED 1q $export_symbols`"; then
-	  prefix_cmds="$prefix_cmds -e 1d";
-	fi~
-	prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
-	cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
-	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
-	emximp -o $lib $output_objdir/$libname.def'
-      old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
-      enable_shared_with_static_runtimes=yes
-      ;;
-
-    osf3*)
-      if test yes = "$GCC"; then
-	allow_undefined_flag=' $wl-expect_unresolved $wl\*'
-	archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
-      else
-	allow_undefined_flag=' -expect_unresolved \*'
-	archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
-      fi
-      archive_cmds_need_lc='no'
-      hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
-      hardcode_libdir_separator=:
-      ;;
-
-    osf4* | osf5*)	# as osf3* with the addition of -msym flag
-      if test yes = "$GCC"; then
-	allow_undefined_flag=' $wl-expect_unresolved $wl\*'
-	archive_cmds='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
-	hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
-      else
-	allow_undefined_flag=' -expect_unresolved \*'
-	archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
-	archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
-          $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp'
-
-	# Both c and cxx compiler support -rpath directly
-	hardcode_libdir_flag_spec='-rpath $libdir'
-      fi
-      archive_cmds_need_lc='no'
-      hardcode_libdir_separator=:
-      ;;
-
-    solaris*)
-      no_undefined_flag=' -z defs'
-      if test yes = "$GCC"; then
-	wlarc='$wl'
-	archive_cmds='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
-	archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-          $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
-      else
-	case `$CC -V 2>&1` in
-	*"Compilers 5.0"*)
-	  wlarc=''
-	  archive_cmds='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags'
-	  archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-            $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
-	  ;;
-	*)
-	  wlarc='$wl'
-	  archive_cmds='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags'
-	  archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-            $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
-	  ;;
-	esac
-      fi
-      hardcode_libdir_flag_spec='-R$libdir'
-      hardcode_shlibpath_var=no
-      case $host_os in
-      solaris2.[0-5] | solaris2.[0-5].*) ;;
-      *)
-	# The compiler driver will combine and reorder linker options,
-	# but understands '-z linker_flag'.  GCC discards it without '$wl',
-	# but is careful enough not to reorder.
-	# Supported since Solaris 2.6 (maybe 2.5.1?)
-	if test yes = "$GCC"; then
-	  whole_archive_flag_spec='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract'
-	else
-	  whole_archive_flag_spec='-z allextract$convenience -z defaultextract'
-	fi
-	;;
-      esac
-      link_all_deplibs=yes
-      ;;
-
-    sunos4*)
-      if test sequent = "$host_vendor"; then
-	# Use $CC to link under sequent, because it throws in some extra .o
-	# files that make .init and .fini sections work.
-	archive_cmds='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags'
-      else
-	archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
-      fi
-      hardcode_libdir_flag_spec='-L$libdir'
-      hardcode_direct=yes
-      hardcode_minus_L=yes
-      hardcode_shlibpath_var=no
-      ;;
-
-    sysv4)
-      case $host_vendor in
-	sni)
-	  archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-	  hardcode_direct=yes # is this really true???
-	;;
-	siemens)
-	  ## LD is ld it makes a PLAMLIB
-	  ## CC just makes a GrossModule.
-	  archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
-	  reload_cmds='$CC -r -o $output$reload_objs'
-	  hardcode_direct=no
-        ;;
-	motorola)
-	  archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-	  hardcode_direct=no #Motorola manual says yes, but my tests say they lie
-	;;
-      esac
-      runpath_var='LD_RUN_PATH'
-      hardcode_shlibpath_var=no
-      ;;
-
-    sysv4.3*)
-      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      hardcode_shlibpath_var=no
-      export_dynamic_flag_spec='-Bexport'
-      ;;
-
-    sysv4*MP*)
-      if test -d /usr/nec; then
-	archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-	hardcode_shlibpath_var=no
-	runpath_var=LD_RUN_PATH
-	hardcode_runpath_var=yes
-	ld_shlibs=yes
-      fi
-      ;;
-
-    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
-      no_undefined_flag='$wl-z,text'
-      archive_cmds_need_lc=no
-      hardcode_shlibpath_var=no
-      runpath_var='LD_RUN_PATH'
-
-      if test yes = "$GCC"; then
-	archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-      else
-	archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-      fi
-      ;;
-
-    sysv5* | sco3.2v5* | sco5v6*)
-      # Note: We CANNOT use -z defs as we might desire, because we do not
-      # link with -lc, and that would cause any symbols used from libc to
-      # always be unresolved, which means just about no library would
-      # ever link correctly.  If we're not using GNU ld we use -z text
-      # though, which does catch some bad symbols but isn't as heavy-handed
-      # as -z defs.
-      no_undefined_flag='$wl-z,text'
-      allow_undefined_flag='$wl-z,nodefs'
-      archive_cmds_need_lc=no
-      hardcode_shlibpath_var=no
-      hardcode_libdir_flag_spec='$wl-R,$libdir'
-      hardcode_libdir_separator=':'
-      link_all_deplibs=yes
-      export_dynamic_flag_spec='$wl-Bexport'
-      runpath_var='LD_RUN_PATH'
-
-      if test yes = "$GCC"; then
-	archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-      else
-	archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-      fi
-      ;;
-
-    uts4*)
-      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      hardcode_libdir_flag_spec='-L$libdir'
-      hardcode_shlibpath_var=no
-      ;;
-
-    *)
-      ld_shlibs=no
-      ;;
-    esac
-
-    if test sni = "$host_vendor"; then
-      case $host in
-      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
-	export_dynamic_flag_spec='$wl-Blargedynsym'
-	;;
-      esac
-    fi
-  fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5
-$as_echo "$ld_shlibs" >&6; }
-test no = "$ld_shlibs" && can_build_shared=no
-
-with_gnu_ld=$with_gnu_ld
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-#
-# Do we need to explicitly link libc?
-#
-case "x$archive_cmds_need_lc" in
-x|xyes)
-  # Assume -lc should be added
-  archive_cmds_need_lc=yes
-
-  if test yes,yes = "$GCC,$enable_shared"; then
-    case $archive_cmds in
-    *'~'*)
-      # FIXME: we may have to deal with multi-command sequences.
-      ;;
-    '$CC '*)
-      # Test whether the compiler implicitly links with -lc since on some
-      # systems, -lgcc has to come before -lc. If gcc already passes -lc
-      # to ld, don't add -lc before -lgcc.
-      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5
-$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; }
-if ${lt_cv_archive_cmds_need_lc+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  $RM -r conftest*
-	echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-
-	if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } 2>conftest.err; then
-	  soname=conftest
-	  lib=conftest
-	  libobjs=conftest.$ac_objext
-	  deplibs=
-	  wl=$lt_prog_compiler_wl
-	  pic_flag=$lt_prog_compiler_pic
-	  compiler_flags=-v
-	  linker_flags=-v
-	  verstring=
-	  output_objdir=.
-	  libname=conftest
-	  lt_save_allow_undefined_flag=$allow_undefined_flag
-	  allow_undefined_flag=
-	  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5
-  (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }
-	  then
-	    lt_cv_archive_cmds_need_lc=no
-	  else
-	    lt_cv_archive_cmds_need_lc=yes
-	  fi
-	  allow_undefined_flag=$lt_save_allow_undefined_flag
-	else
-	  cat conftest.err 1>&5
-	fi
-	$RM -r conftest*
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5
-$as_echo "$lt_cv_archive_cmds_need_lc" >&6; }
-      archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc
-      ;;
-    esac
-  fi
-  ;;
-esac
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5
-$as_echo_n "checking dynamic linker characteristics... " >&6; }
-
-if test yes = "$GCC"; then
-  case $host_os in
-    darwin*) lt_awk_arg='/^libraries:/,/LR/' ;;
-    *) lt_awk_arg='/^libraries:/' ;;
-  esac
-  case $host_os in
-    mingw* | cegcc*) lt_sed_strip_eq='s|=\([A-Za-z]:\)|\1|g' ;;
-    *) lt_sed_strip_eq='s|=/|/|g' ;;
-  esac
-  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
-  case $lt_search_path_spec in
-  *\;*)
-    # if the path contains ";" then we assume it to be the separator
-    # otherwise default to the standard path separator (i.e. ":") - it is
-    # assumed that no part of a normal pathname contains ";" but that should
-    # okay in the real world where ";" in dirpaths is itself problematic.
-    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
-    ;;
-  *)
-    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
-    ;;
-  esac
-  # Ok, now we have the path, separated by spaces, we can step through it
-  # and add multilib dir if necessary...
-  lt_tmp_lt_search_path_spec=
-  lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
-  # ...but if some path component already ends with the multilib dir we assume
-  # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer).
-  case "$lt_multi_os_dir; $lt_search_path_spec " in
-  "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*)
-    lt_multi_os_dir=
-    ;;
-  esac
-  for lt_sys_path in $lt_search_path_spec; do
-    if test -d "$lt_sys_path$lt_multi_os_dir"; then
-      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir"
-    elif test -n "$lt_multi_os_dir"; then
-      test -d "$lt_sys_path" && \
-	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
-    fi
-  done
-  lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
-BEGIN {RS = " "; FS = "/|\n";} {
-  lt_foo = "";
-  lt_count = 0;
-  for (lt_i = NF; lt_i > 0; lt_i--) {
-    if ($lt_i != "" && $lt_i != ".") {
-      if ($lt_i == "..") {
-        lt_count++;
-      } else {
-        if (lt_count == 0) {
-          lt_foo = "/" $lt_i lt_foo;
-        } else {
-          lt_count--;
-        }
-      }
-    }
-  }
-  if (lt_foo != "") { lt_freq[lt_foo]++; }
-  if (lt_freq[lt_foo] == 1) { print lt_foo; }
-}'`
-  # AWK program above erroneously prepends '/' to C:/dos/paths
-  # for these hosts.
-  case $host_os in
-    mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
-      $SED 's|/\([A-Za-z]:\)|\1|g'` ;;
-  esac
-  sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
-else
-  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
-fi
-library_names_spec=
-libname_spec='lib$name'
-soname_spec=
-shrext_cmds=.so
-postinstall_cmds=
-postuninstall_cmds=
-finish_cmds=
-finish_eval=
-shlibpath_var=
-shlibpath_overrides_runpath=unknown
-version_type=none
-dynamic_linker="$host_os ld.so"
-sys_lib_dlsearch_path_spec="/lib /usr/lib"
-need_lib_prefix=unknown
-hardcode_into_libs=no
-
-# when you set need_version to no, make sure it does not cause -set_version
-# flags to be left without arguments
-need_version=unknown
-
-
-
-case $host_os in
-aix3*)
-  version_type=linux # correct to gnu/linux during the next big refactor
-  library_names_spec='$libname$release$shared_ext$versuffix $libname.a'
-  shlibpath_var=LIBPATH
-
-  # AIX 3 has no versioning support, so we append a major version to the name.
-  soname_spec='$libname$release$shared_ext$major'
-  ;;
-
-aix[4-9]*)
-  version_type=linux # correct to gnu/linux during the next big refactor
-  need_lib_prefix=no
-  need_version=no
-  hardcode_into_libs=yes
-  if test ia64 = "$host_cpu"; then
-    # AIX 5 supports IA64
-    library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext'
-    shlibpath_var=LD_LIBRARY_PATH
-  else
-    # With GCC up to 2.95.x, collect2 would create an import file
-    # for dependence libraries.  The import file would start with
-    # the line '#! .'.  This would cause the generated library to
-    # depend on '.', always an invalid library.  This was fixed in
-    # development snapshots of GCC prior to 3.0.
-    case $host_os in
-      aix4 | aix4.[01] | aix4.[01].*)
-      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
-	   echo ' yes '
-	   echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then
-	:
-      else
-	can_build_shared=no
-      fi
-      ;;
-    esac
-    # Using Import Files as archive members, it is possible to support
-    # filename-based versioning of shared library archives on AIX. While
-    # this would work for both with and without runtime linking, it will
-    # prevent static linking of such archives. So we do filename-based
-    # shared library versioning with .so extension only, which is used
-    # when both runtime linking and shared linking is enabled.
-    # Unfortunately, runtime linking may impact performance, so we do
-    # not want this to be the default eventually. Also, we use the
-    # versioned .so libs for executables only if there is the -brtl
-    # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only.
-    # To allow for filename-based versioning support, we need to create
-    # libNAME.so.V as an archive file, containing:
-    # *) an Import File, referring to the versioned filename of the
-    #    archive as well as the shared archive member, telling the
-    #    bitwidth (32 or 64) of that shared object, and providing the
-    #    list of exported symbols of that shared object, eventually
-    #    decorated with the 'weak' keyword
-    # *) the shared object with the F_LOADONLY flag set, to really avoid
-    #    it being seen by the linker.
-    # At run time we better use the real file rather than another symlink,
-    # but for link time we create the symlink libNAME.so -> libNAME.so.V
-
-    case $with_aix_soname,$aix_use_runtimelinking in
-    # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct
-    # soname into executable. Probably we can add versioning support to
-    # collect2, so additional links can be useful in future.
-    aix,yes) # traditional libtool
-      dynamic_linker='AIX unversionable lib.so'
-      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
-      # instead of lib<name>.a to let people know that these are not
-      # typical AIX shared libraries.
-      library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
-      ;;
-    aix,no) # traditional AIX only
-      dynamic_linker='AIX lib.a(lib.so.V)'
-      # We preserve .a as extension for shared libraries through AIX4.2
-      # and later when we are not doing run time linking.
-      library_names_spec='$libname$release.a $libname.a'
-      soname_spec='$libname$release$shared_ext$major'
-      ;;
-    svr4,*) # full svr4 only
-      dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o)"
-      library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'
-      # We do not specify a path in Import Files, so LIBPATH fires.
-      shlibpath_overrides_runpath=yes
-      ;;
-    *,yes) # both, prefer svr4
-      dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o), lib.a(lib.so.V)"
-      library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'
-      # unpreferred sharedlib libNAME.a needs extra handling
-      postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"'
-      postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"'
-      # We do not specify a path in Import Files, so LIBPATH fires.
-      shlibpath_overrides_runpath=yes
-      ;;
-    *,no) # both, prefer aix
-      dynamic_linker="AIX lib.a(lib.so.V), lib.so.V($shared_archive_member_spec.o)"
-      library_names_spec='$libname$release.a $libname.a'
-      soname_spec='$libname$release$shared_ext$major'
-      # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling
-      postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)'
-      postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"'
-      ;;
-    esac
-    shlibpath_var=LIBPATH
-  fi
-  ;;
-
-amigaos*)
-  case $host_cpu in
-  powerpc)
-    # Since July 2007 AmigaOS4 officially supports .so libraries.
-    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
-    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
-    ;;
-  m68k)
-    library_names_spec='$libname.ixlibrary $libname.a'
-    # Create ${libname}_ixlibrary.a entries in /sys/libs.
-    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
-    ;;
-  esac
-  ;;
-
-beos*)
-  library_names_spec='$libname$shared_ext'
-  dynamic_linker="$host_os ld.so"
-  shlibpath_var=LIBRARY_PATH
-  ;;
-
-bsdi[45]*)
-  version_type=linux # correct to gnu/linux during the next big refactor
-  need_version=no
-  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
-  soname_spec='$libname$release$shared_ext$major'
-  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
-  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
-  # the default ld.so.conf also contains /usr/contrib/lib and
-  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
-  # libtool to hard-code these into programs
-  ;;
-
-cygwin* | mingw* | pw32* | cegcc*)
-  version_type=windows
-  shrext_cmds=.dll
-  need_version=no
-  need_lib_prefix=no
-
-  case $GCC,$cc_basename in
-  yes,*)
-    # gcc
-    library_names_spec='$libname.dll.a'
-    # DLL is installed to $(libdir)/../bin by postinstall_cmds
-    postinstall_cmds='base_file=`basename \$file`~
-      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
-      dldir=$destdir/`dirname \$dlpath`~
-      test -d \$dldir || mkdir -p \$dldir~
-      $install_prog $dir/$dlname \$dldir/$dlname~
-      chmod a+x \$dldir/$dlname~
-      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
-        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
-      fi'
-    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
-      dlpath=$dir/\$dldll~
-       $RM \$dlpath'
-    shlibpath_overrides_runpath=yes
-
-    case $host_os in
-    cygwin*)
-      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
-      soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
-
-      sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"
-      ;;
-    mingw* | cegcc*)
-      # MinGW DLLs use traditional 'lib' prefix
-      soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
-      ;;
-    pw32*)
-      # pw32 DLLs use 'pw' prefix rather than 'lib'
-      library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
-      ;;
-    esac
-    dynamic_linker='Win32 ld.exe'
-    ;;
-
-  *,cl*)
-    # Native MSVC
-    libname_spec='$name'
-    soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
-    library_names_spec='$libname.dll.lib'
-
-    case $build_os in
-    mingw*)
-      sys_lib_search_path_spec=
-      lt_save_ifs=$IFS
-      IFS=';'
-      for lt_path in $LIB
-      do
-        IFS=$lt_save_ifs
-        # Let DOS variable expansion print the short 8.3 style file name.
-        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
-        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
-      done
-      IFS=$lt_save_ifs
-      # Convert to MSYS style.
-      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'`
-      ;;
-    cygwin*)
-      # Convert to unix form, then to dos form, then back to unix form
-      # but this time dos style (no spaces!) so that the unix form looks
-      # like /cygdrive/c/PROGRA~1:/cygdr...
-      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
-      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
-      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
-      ;;
-    *)
-      sys_lib_search_path_spec=$LIB
-      if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
-        # It is most probably a Windows format PATH.
-        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
-      else
-        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
-      fi
-      # FIXME: find the short name or the path components, as spaces are
-      # common. (e.g. "Program Files" -> "PROGRA~1")
-      ;;
-    esac
-
-    # DLL is installed to $(libdir)/../bin by postinstall_cmds
-    postinstall_cmds='base_file=`basename \$file`~
-      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
-      dldir=$destdir/`dirname \$dlpath`~
-      test -d \$dldir || mkdir -p \$dldir~
-      $install_prog $dir/$dlname \$dldir/$dlname'
-    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
-      dlpath=$dir/\$dldll~
-       $RM \$dlpath'
-    shlibpath_overrides_runpath=yes
-    dynamic_linker='Win32 link.exe'
-    ;;
-
-  *)
-    # Assume MSVC wrapper
-    library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib'
-    dynamic_linker='Win32 ld.exe'
-    ;;
-  esac
-  # FIXME: first we should search . and the directory the executable is in
-  shlibpath_var=PATH
-  ;;
-
-darwin* | rhapsody*)
-  dynamic_linker="$host_os dyld"
-  version_type=darwin
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='$libname$release$major$shared_ext $libname$shared_ext'
-  soname_spec='$libname$release$major$shared_ext'
-  shlibpath_overrides_runpath=yes
-  shlibpath_var=DYLD_LIBRARY_PATH
-  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
-
-  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"
-  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
-  ;;
-
-dgux*)
-  version_type=linux # correct to gnu/linux during the next big refactor
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
-  soname_spec='$libname$release$shared_ext$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  ;;
-
-freebsd* | dragonfly*)
-  # DragonFly does not have aout.  When/if they implement a new
-  # versioning mechanism, adjust this.
-  if test -x /usr/bin/objformat; then
-    objformat=`/usr/bin/objformat`
-  else
-    case $host_os in
-    freebsd[23].*) objformat=aout ;;
-    *) objformat=elf ;;
-    esac
-  fi
-  version_type=freebsd-$objformat
-  case $version_type in
-    freebsd-elf*)
-      library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
-      soname_spec='$libname$release$shared_ext$major'
-      need_version=no
-      need_lib_prefix=no
-      ;;
-    freebsd-*)
-      library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
-      need_version=yes
-      ;;
-  esac
-  shlibpath_var=LD_LIBRARY_PATH
-  case $host_os in
-  freebsd2.*)
-    shlibpath_overrides_runpath=yes
-    ;;
-  freebsd3.[01]* | freebsdelf3.[01]*)
-    shlibpath_overrides_runpath=yes
-    hardcode_into_libs=yes
-    ;;
-  freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
-  freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
-    shlibpath_overrides_runpath=no
-    hardcode_into_libs=yes
-    ;;
-  *) # from 4.6 on, and DragonFly
-    shlibpath_overrides_runpath=yes
-    hardcode_into_libs=yes
-    ;;
-  esac
-  ;;
-
-haiku*)
-  version_type=linux # correct to gnu/linux during the next big refactor
-  need_lib_prefix=no
-  need_version=no
-  dynamic_linker="$host_os runtime_loader"
-  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
-  soname_spec='$libname$release$shared_ext$major'
-  shlibpath_var=LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
-  hardcode_into_libs=yes
-  ;;
-
-hpux9* | hpux10* | hpux11*)
-  # Give a soname corresponding to the major version so that dld.sl refuses to
-  # link against other versions.
-  version_type=sunos
-  need_lib_prefix=no
-  need_version=no
-  case $host_cpu in
-  ia64*)
-    shrext_cmds='.so'
-    hardcode_into_libs=yes
-    dynamic_linker="$host_os dld.so"
-    shlibpath_var=LD_LIBRARY_PATH
-    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
-    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
-    soname_spec='$libname$release$shared_ext$major'
-    if test 32 = "$HPUX_IA64_MODE"; then
-      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
-      sys_lib_dlsearch_path_spec=/usr/lib/hpux32
-    else
-      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
-      sys_lib_dlsearch_path_spec=/usr/lib/hpux64
-    fi
-    ;;
-  hppa*64*)
-    shrext_cmds='.sl'
-    hardcode_into_libs=yes
-    dynamic_linker="$host_os dld.sl"
-    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
-    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
-    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
-    soname_spec='$libname$release$shared_ext$major'
-    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
-    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
-    ;;
-  *)
-    shrext_cmds='.sl'
-    dynamic_linker="$host_os dld.sl"
-    shlibpath_var=SHLIB_PATH
-    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
-    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
-    soname_spec='$libname$release$shared_ext$major'
-    ;;
-  esac
-  # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
-  postinstall_cmds='chmod 555 $lib'
-  # or fails outright, so override atomically:
-  install_override_mode=555
-  ;;
-
-interix[3-9]*)
-  version_type=linux # correct to gnu/linux during the next big refactor
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
-  soname_spec='$libname$release$shared_ext$major'
-  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  hardcode_into_libs=yes
-  ;;
-
-irix5* | irix6* | nonstopux*)
-  case $host_os in
-    nonstopux*) version_type=nonstopux ;;
-    *)
-	if test yes = "$lt_cv_prog_gnu_ld"; then
-		version_type=linux # correct to gnu/linux during the next big refactor
-	else
-		version_type=irix
-	fi ;;
-  esac
-  need_lib_prefix=no
-  need_version=no
-  soname_spec='$libname$release$shared_ext$major'
-  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext'
-  case $host_os in
-  irix5* | nonstopux*)
-    libsuff= shlibsuff=
-    ;;
-  *)
-    case $LD in # libtool.m4 will add one of these switches to LD
-    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
-      libsuff= shlibsuff= libmagic=32-bit;;
-    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
-      libsuff=32 shlibsuff=N32 libmagic=N32;;
-    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
-      libsuff=64 shlibsuff=64 libmagic=64-bit;;
-    *) libsuff= shlibsuff= libmagic=never-match;;
-    esac
-    ;;
-  esac
-  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
-  shlibpath_overrides_runpath=no
-  sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff"
-  sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff"
-  hardcode_into_libs=yes
-  ;;
-
-# No shared lib support for Linux oldld, aout, or coff.
-linux*oldld* | linux*aout* | linux*coff*)
-  dynamic_linker=no
-  ;;
-
-linux*android*)
-  version_type=none # Android doesn't support versioned libraries.
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='$libname$release$shared_ext'
-  soname_spec='$libname$release$shared_ext'
-  finish_cmds=
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-
-  # This implies no fast_install, which is unacceptable.
-  # Some rework will be needed to allow for fast_install
-  # before this can be enabled.
-  hardcode_into_libs=yes
-
-  dynamic_linker='Android linker'
-  # Don't embed -rpath directories since the linker doesn't support them.
-  hardcode_libdir_flag_spec='-L$libdir'
-  ;;
-
-# This must be glibc/ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
-  version_type=linux # correct to gnu/linux during the next big refactor
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
-  soname_spec='$libname$release$shared_ext$major'
-  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-
-  # Some binutils ld are patched to set DT_RUNPATH
-  if ${lt_cv_shlibpath_overrides_runpath+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  lt_cv_shlibpath_overrides_runpath=no
-    save_LDFLAGS=$LDFLAGS
-    save_libdir=$libdir
-    eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \
-	 LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\""
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  if  ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then :
-  lt_cv_shlibpath_overrides_runpath=yes
-fi
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-    LDFLAGS=$save_LDFLAGS
-    libdir=$save_libdir
-
-fi
-
-  shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
-
-  # This implies no fast_install, which is unacceptable.
-  # Some rework will be needed to allow for fast_install
-  # before this can be enabled.
-  hardcode_into_libs=yes
-
-  # Ideally, we could use ldconfig to report *all* directores which are
-  # searched for libraries, however this is still not possible.  Aside from not
-  # being certain /sbin/ldconfig is available, command
-  # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64,
-  # even though it is searched at run-time.  Try to do the best guess by
-  # appending ld.so.conf contents (and includes) to the search path.
-  if test -f /etc/ld.so.conf; then
-    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[	 ]*hwcap[	 ]/d;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
-    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
-  fi
-
-  # We used to test for /lib/ld.so.1 and disable shared libraries on
-  # powerpc, because MkLinux only supported shared libraries with the
-  # GNU dynamic linker.  Since this was broken with cross compilers,
-  # most powerpc-linux boxes support dynamic linking these days and
-  # people can always --disable-shared, the test was removed, and we
-  # assume the GNU/Linux dynamic linker is in use.
-  dynamic_linker='GNU/Linux ld.so'
-  ;;
-
-netbsd*)
-  version_type=sunos
-  need_lib_prefix=no
-  need_version=no
-  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
-    library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
-    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
-    dynamic_linker='NetBSD (a.out) ld.so'
-  else
-    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
-    soname_spec='$libname$release$shared_ext$major'
-    dynamic_linker='NetBSD ld.elf_so'
-  fi
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  hardcode_into_libs=yes
-  ;;
-
-newsos6)
-  version_type=linux # correct to gnu/linux during the next big refactor
-  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  ;;
-
-*nto* | *qnx*)
-  version_type=qnx
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
-  soname_spec='$libname$release$shared_ext$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  hardcode_into_libs=yes
-  dynamic_linker='ldqnx.so'
-  ;;
-
-openbsd* | bitrig*)
-  version_type=sunos
-  sys_lib_dlsearch_path_spec=/usr/lib
-  need_lib_prefix=no
-  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
-    need_version=no
-  else
-    need_version=yes
-  fi
-  library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
-  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  ;;
-
-os2*)
-  libname_spec='$name'
-  version_type=windows
-  shrext_cmds=.dll
-  need_version=no
-  need_lib_prefix=no
-  # OS/2 can only load a DLL with a base name of 8 characters or less.
-  soname_spec='`test -n "$os2dllname" && libname="$os2dllname";
-    v=$($ECHO $release$versuffix | tr -d .-);
-    n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _);
-    $ECHO $n$v`$shared_ext'
-  library_names_spec='${libname}_dll.$libext'
-  dynamic_linker='OS/2 ld.exe'
-  shlibpath_var=BEGINLIBPATH
-  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
-  sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
-  postinstall_cmds='base_file=`basename \$file`~
-    dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~
-    dldir=$destdir/`dirname \$dlpath`~
-    test -d \$dldir || mkdir -p \$dldir~
-    $install_prog $dir/$dlname \$dldir/$dlname~
-    chmod a+x \$dldir/$dlname~
-    if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
-      eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
-    fi'
-  postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~
-    dlpath=$dir/\$dldll~
-    $RM \$dlpath'
-  ;;
-
-osf3* | osf4* | osf5*)
-  version_type=osf
-  need_lib_prefix=no
-  need_version=no
-  soname_spec='$libname$release$shared_ext$major'
-  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
-  shlibpath_var=LD_LIBRARY_PATH
-  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
-  sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
-  ;;
-
-rdos*)
-  dynamic_linker=no
-  ;;
-
-solaris*)
-  version_type=linux # correct to gnu/linux during the next big refactor
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
-  soname_spec='$libname$release$shared_ext$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  hardcode_into_libs=yes
-  # ldd complains unless libraries are executable
-  postinstall_cmds='chmod +x $lib'
-  ;;
-
-sunos4*)
-  version_type=sunos
-  library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
-  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  if test yes = "$with_gnu_ld"; then
-    need_lib_prefix=no
-  fi
-  need_version=yes
-  ;;
-
-sysv4 | sysv4.3*)
-  version_type=linux # correct to gnu/linux during the next big refactor
-  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
-  soname_spec='$libname$release$shared_ext$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  case $host_vendor in
-    sni)
-      shlibpath_overrides_runpath=no
-      need_lib_prefix=no
-      runpath_var=LD_RUN_PATH
-      ;;
-    siemens)
-      need_lib_prefix=no
-      ;;
-    motorola)
-      need_lib_prefix=no
-      need_version=no
-      shlibpath_overrides_runpath=no
-      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
-      ;;
-  esac
-  ;;
-
-sysv4*MP*)
-  if test -d /usr/nec; then
-    version_type=linux # correct to gnu/linux during the next big refactor
-    library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext'
-    soname_spec='$libname$shared_ext.$major'
-    shlibpath_var=LD_LIBRARY_PATH
-  fi
-  ;;
-
-sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
-  version_type=sco
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext'
-  soname_spec='$libname$release$shared_ext$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  hardcode_into_libs=yes
-  if test yes = "$with_gnu_ld"; then
-    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
-  else
-    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
-    case $host_os in
-      sco3.2v5*)
-        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
-	;;
-    esac
-  fi
-  sys_lib_dlsearch_path_spec='/usr/lib'
-  ;;
-
-tpf*)
-  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
-  version_type=linux # correct to gnu/linux during the next big refactor
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  hardcode_into_libs=yes
-  ;;
-
-uts4*)
-  version_type=linux # correct to gnu/linux during the next big refactor
-  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
-  soname_spec='$libname$release$shared_ext$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  ;;
-
-*)
-  dynamic_linker=no
-  ;;
-esac
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5
-$as_echo "$dynamic_linker" >&6; }
-test no = "$dynamic_linker" && can_build_shared=no
-
-variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
-if test yes = "$GCC"; then
-  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
-fi
-
-if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then
-  sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec
-fi
-
-if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then
-  sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec
-fi
-
-# remember unaugmented sys_lib_dlsearch_path content for libtool script decls...
-configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec
-
-# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code
-func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH"
-
-# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool
-configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5
-$as_echo_n "checking how to hardcode library paths into programs... " >&6; }
-hardcode_action=
-if test -n "$hardcode_libdir_flag_spec" ||
-   test -n "$runpath_var" ||
-   test yes = "$hardcode_automatic"; then
-
-  # We can hardcode non-existent directories.
-  if test no != "$hardcode_direct" &&
-     # If the only mechanism to avoid hardcoding is shlibpath_var, we
-     # have to relink, otherwise we might link with an installed library
-     # when we should be linking with a yet-to-be-installed one
-     ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, )" &&
-     test no != "$hardcode_minus_L"; then
-    # Linking always hardcodes the temporary library directory.
-    hardcode_action=relink
-  else
-    # We can link without hardcoding, and we can hardcode nonexisting dirs.
-    hardcode_action=immediate
-  fi
-else
-  # We cannot hardcode anything, or else we can only hardcode existing
-  # directories.
-  hardcode_action=unsupported
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5
-$as_echo "$hardcode_action" >&6; }
-
-if test relink = "$hardcode_action" ||
-   test yes = "$inherit_rpath"; then
-  # Fast installation is not supported
-  enable_fast_install=no
-elif test yes = "$shlibpath_overrides_runpath" ||
-     test no = "$enable_shared"; then
-  # Fast installation is not necessary
-  enable_fast_install=needless
-fi
-
-
-
-
-
-
-  if test yes != "$enable_dlopen"; then
-  enable_dlopen=unknown
-  enable_dlopen_self=unknown
-  enable_dlopen_self_static=unknown
-else
-  lt_cv_dlopen=no
-  lt_cv_dlopen_libs=
-
-  case $host_os in
-  beos*)
-    lt_cv_dlopen=load_add_on
-    lt_cv_dlopen_libs=
-    lt_cv_dlopen_self=yes
-    ;;
-
-  mingw* | pw32* | cegcc*)
-    lt_cv_dlopen=LoadLibrary
-    lt_cv_dlopen_libs=
-    ;;
-
-  cygwin*)
-    lt_cv_dlopen=dlopen
-    lt_cv_dlopen_libs=
-    ;;
-
-  darwin*)
-    # if libdl is installed we need to link against it
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
-$as_echo_n "checking for dlopen in -ldl... " >&6; }
-if ${ac_cv_lib_dl_dlopen+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldl  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char dlopen ();
-int
-main ()
-{
-return dlopen ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_dl_dlopen=yes
-else
-  ac_cv_lib_dl_dlopen=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
-$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
-if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
-  lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl
-else
-
-    lt_cv_dlopen=dyld
-    lt_cv_dlopen_libs=
-    lt_cv_dlopen_self=yes
-
-fi
-
-    ;;
-
-  tpf*)
-    # Don't try to run any link tests for TPF.  We know it's impossible
-    # because TPF is a cross-compiler, and we know how we open DSOs.
-    lt_cv_dlopen=dlopen
-    lt_cv_dlopen_libs=
-    lt_cv_dlopen_self=no
-    ;;
-
-  *)
-    ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load"
-if test "x$ac_cv_func_shl_load" = xyes; then :
-  lt_cv_dlopen=shl_load
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5
-$as_echo_n "checking for shl_load in -ldld... " >&6; }
-if ${ac_cv_lib_dld_shl_load+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldld  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char shl_load ();
-int
-main ()
-{
-return shl_load ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_dld_shl_load=yes
-else
-  ac_cv_lib_dld_shl_load=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5
-$as_echo "$ac_cv_lib_dld_shl_load" >&6; }
-if test "x$ac_cv_lib_dld_shl_load" = xyes; then :
-  lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld
-else
-  ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen"
-if test "x$ac_cv_func_dlopen" = xyes; then :
-  lt_cv_dlopen=dlopen
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
-$as_echo_n "checking for dlopen in -ldl... " >&6; }
-if ${ac_cv_lib_dl_dlopen+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldl  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char dlopen ();
-int
-main ()
-{
-return dlopen ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_dl_dlopen=yes
-else
-  ac_cv_lib_dl_dlopen=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
-$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
-if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
-  lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5
-$as_echo_n "checking for dlopen in -lsvld... " >&6; }
-if ${ac_cv_lib_svld_dlopen+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lsvld  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char dlopen ();
-int
-main ()
-{
-return dlopen ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_svld_dlopen=yes
-else
-  ac_cv_lib_svld_dlopen=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5
-$as_echo "$ac_cv_lib_svld_dlopen" >&6; }
-if test "x$ac_cv_lib_svld_dlopen" = xyes; then :
-  lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5
-$as_echo_n "checking for dld_link in -ldld... " >&6; }
-if ${ac_cv_lib_dld_dld_link+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldld  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char dld_link ();
-int
-main ()
-{
-return dld_link ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_dld_dld_link=yes
-else
-  ac_cv_lib_dld_dld_link=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5
-$as_echo "$ac_cv_lib_dld_dld_link" >&6; }
-if test "x$ac_cv_lib_dld_dld_link" = xyes; then :
-  lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld
-fi
-
-
-fi
-
-
-fi
-
-
-fi
-
-
-fi
-
-
-fi
-
-    ;;
-  esac
-
-  if test no = "$lt_cv_dlopen"; then
-    enable_dlopen=no
-  else
-    enable_dlopen=yes
-  fi
-
-  case $lt_cv_dlopen in
-  dlopen)
-    save_CPPFLAGS=$CPPFLAGS
-    test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
-
-    save_LDFLAGS=$LDFLAGS
-    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
-
-    save_LIBS=$LIBS
-    LIBS="$lt_cv_dlopen_libs $LIBS"
-
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5
-$as_echo_n "checking whether a program can dlopen itself... " >&6; }
-if ${lt_cv_dlopen_self+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  	  if test yes = "$cross_compiling"; then :
-  lt_cv_dlopen_self=cross
-else
-  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
-  lt_status=$lt_dlunknown
-  cat > conftest.$ac_ext <<_LT_EOF
-#line $LINENO "configure"
-#include "confdefs.h"
-
-#if HAVE_DLFCN_H
-#include <dlfcn.h>
-#endif
-
-#include <stdio.h>
-
-#ifdef RTLD_GLOBAL
-#  define LT_DLGLOBAL		RTLD_GLOBAL
-#else
-#  ifdef DL_GLOBAL
-#    define LT_DLGLOBAL		DL_GLOBAL
-#  else
-#    define LT_DLGLOBAL		0
-#  endif
-#endif
-
-/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
-   find out it does not work in some platform. */
-#ifndef LT_DLLAZY_OR_NOW
-#  ifdef RTLD_LAZY
-#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
-#  else
-#    ifdef DL_LAZY
-#      define LT_DLLAZY_OR_NOW		DL_LAZY
-#    else
-#      ifdef RTLD_NOW
-#        define LT_DLLAZY_OR_NOW	RTLD_NOW
-#      else
-#        ifdef DL_NOW
-#          define LT_DLLAZY_OR_NOW	DL_NOW
-#        else
-#          define LT_DLLAZY_OR_NOW	0
-#        endif
-#      endif
-#    endif
-#  endif
-#endif
-
-/* When -fvisibility=hidden is used, assume the code has been annotated
-   correspondingly for the symbols needed.  */
-#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
-int fnord () __attribute__((visibility("default")));
-#endif
-
-int fnord () { return 42; }
-int main ()
-{
-  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
-  int status = $lt_dlunknown;
-
-  if (self)
-    {
-      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
-      else
-        {
-	  if (dlsym( self,"_fnord"))  status = $lt_dlneed_uscore;
-          else puts (dlerror ());
-	}
-      /* dlclose (self); */
-    }
-  else
-    puts (dlerror ());
-
-  return status;
-}
-_LT_EOF
-  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then
-    (./conftest; exit; ) >&5 2>/dev/null
-    lt_status=$?
-    case x$lt_status in
-      x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
-      x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;
-      x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;;
-    esac
-  else :
-    # compilation failed
-    lt_cv_dlopen_self=no
-  fi
-fi
-rm -fr conftest*
-
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5
-$as_echo "$lt_cv_dlopen_self" >&6; }
-
-    if test yes = "$lt_cv_dlopen_self"; then
-      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
-      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5
-$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; }
-if ${lt_cv_dlopen_self_static+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  	  if test yes = "$cross_compiling"; then :
-  lt_cv_dlopen_self_static=cross
-else
-  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
-  lt_status=$lt_dlunknown
-  cat > conftest.$ac_ext <<_LT_EOF
-#line $LINENO "configure"
-#include "confdefs.h"
-
-#if HAVE_DLFCN_H
-#include <dlfcn.h>
-#endif
-
-#include <stdio.h>
-
-#ifdef RTLD_GLOBAL
-#  define LT_DLGLOBAL		RTLD_GLOBAL
-#else
-#  ifdef DL_GLOBAL
-#    define LT_DLGLOBAL		DL_GLOBAL
-#  else
-#    define LT_DLGLOBAL		0
-#  endif
-#endif
-
-/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
-   find out it does not work in some platform. */
-#ifndef LT_DLLAZY_OR_NOW
-#  ifdef RTLD_LAZY
-#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
-#  else
-#    ifdef DL_LAZY
-#      define LT_DLLAZY_OR_NOW		DL_LAZY
-#    else
-#      ifdef RTLD_NOW
-#        define LT_DLLAZY_OR_NOW	RTLD_NOW
-#      else
-#        ifdef DL_NOW
-#          define LT_DLLAZY_OR_NOW	DL_NOW
-#        else
-#          define LT_DLLAZY_OR_NOW	0
-#        endif
-#      endif
-#    endif
-#  endif
-#endif
-
-/* When -fvisibility=hidden is used, assume the code has been annotated
-   correspondingly for the symbols needed.  */
-#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
-int fnord () __attribute__((visibility("default")));
-#endif
-
-int fnord () { return 42; }
-int main ()
-{
-  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
-  int status = $lt_dlunknown;
-
-  if (self)
-    {
-      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
-      else
-        {
-	  if (dlsym( self,"_fnord"))  status = $lt_dlneed_uscore;
-          else puts (dlerror ());
-	}
-      /* dlclose (self); */
-    }
-  else
-    puts (dlerror ());
-
-  return status;
-}
-_LT_EOF
-  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then
-    (./conftest; exit; ) >&5 2>/dev/null
-    lt_status=$?
-    case x$lt_status in
-      x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
-      x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;
-      x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;;
-    esac
-  else :
-    # compilation failed
-    lt_cv_dlopen_self_static=no
-  fi
-fi
-rm -fr conftest*
-
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5
-$as_echo "$lt_cv_dlopen_self_static" >&6; }
-    fi
-
-    CPPFLAGS=$save_CPPFLAGS
-    LDFLAGS=$save_LDFLAGS
-    LIBS=$save_LIBS
-    ;;
-  esac
-
-  case $lt_cv_dlopen_self in
-  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
-  *) enable_dlopen_self=unknown ;;
-  esac
-
-  case $lt_cv_dlopen_self_static in
-  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
-  *) enable_dlopen_self_static=unknown ;;
-  esac
-fi
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-striplib=
-old_striplib=
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5
-$as_echo_n "checking whether stripping libraries is possible... " >&6; }
-if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
-  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
-  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-else
-# FIXME - insert some real tests, host_os isn't really good enough
-  case $host_os in
-  darwin*)
-    if test -n "$STRIP"; then
-      striplib="$STRIP -x"
-      old_striplib="$STRIP -S"
-      { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-    else
-      { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-    fi
-    ;;
-  *)
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-    ;;
-  esac
-fi
-
-
-
-
-
-
-
-
-
-
-
-
-  # Report what library types will actually be built
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5
-$as_echo_n "checking if libtool supports shared libraries... " >&6; }
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5
-$as_echo "$can_build_shared" >&6; }
-
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5
-$as_echo_n "checking whether to build shared libraries... " >&6; }
-  test no = "$can_build_shared" && enable_shared=no
-
-  # On AIX, shared libraries and static libraries use the same namespace, and
-  # are all built from PIC.
-  case $host_os in
-  aix3*)
-    test yes = "$enable_shared" && enable_static=no
-    if test -n "$RANLIB"; then
-      archive_cmds="$archive_cmds~\$RANLIB \$lib"
-      postinstall_cmds='$RANLIB $lib'
-    fi
-    ;;
-
-  aix[4-9]*)
-    if test ia64 != "$host_cpu"; then
-      case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
-      yes,aix,yes) ;;			# shared object as lib.so file only
-      yes,svr4,*) ;;			# shared object as lib.so archive member only
-      yes,*) enable_static=no ;;	# shared object in lib.a archive as well
-      esac
-    fi
-    ;;
-  esac
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5
-$as_echo "$enable_shared" >&6; }
-
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5
-$as_echo_n "checking whether to build static libraries... " >&6; }
-  # Make sure either enable_shared or enable_static is yes.
-  test yes = "$enable_shared" || enable_static=yes
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5
-$as_echo "$enable_static" >&6; }
-
-
-
-
-fi
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-CC=$lt_save_CC
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-        ac_config_commands="$ac_config_commands libtool"
-
-
-
-
-# Only expand once:
-
-
-
-LIBM=
-case $host in
-*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*)
-  # These system don't have libm, or don't need it
-  ;;
-*-ncr-sysv4.3*)
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _mwvalidcheckl in -lmw" >&5
-$as_echo_n "checking for _mwvalidcheckl in -lmw... " >&6; }
-if ${ac_cv_lib_mw__mwvalidcheckl+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lmw  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char _mwvalidcheckl ();
-int
-main ()
-{
-return _mwvalidcheckl ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_mw__mwvalidcheckl=yes
-else
-  ac_cv_lib_mw__mwvalidcheckl=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mw__mwvalidcheckl" >&5
-$as_echo "$ac_cv_lib_mw__mwvalidcheckl" >&6; }
-if test "x$ac_cv_lib_mw__mwvalidcheckl" = xyes; then :
-  LIBM=-lmw
-fi
-
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cos in -lm" >&5
-$as_echo_n "checking for cos in -lm... " >&6; }
-if ${ac_cv_lib_m_cos+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lm  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char cos ();
-int
-main ()
-{
-return cos ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_m_cos=yes
-else
-  ac_cv_lib_m_cos=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_cos" >&5
-$as_echo "$ac_cv_lib_m_cos" >&6; }
-if test "x$ac_cv_lib_m_cos" = xyes; then :
-  LIBM="$LIBM -lm"
-fi
-
-  ;;
-*)
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cos in -lm" >&5
-$as_echo_n "checking for cos in -lm... " >&6; }
-if ${ac_cv_lib_m_cos+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lm  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char cos ();
-int
-main ()
-{
-return cos ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_m_cos=yes
-else
-  ac_cv_lib_m_cos=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_cos" >&5
-$as_echo "$ac_cv_lib_m_cos" >&6; }
-if test "x$ac_cv_lib_m_cos" = xyes; then :
-  LIBM=-lm
-fi
-
-  ;;
-esac
-
-
-
-BYTESWAP=no
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5
-$as_echo_n "checking whether byte ordering is bigendian... " >&6; }
-if ${ac_cv_c_bigendian+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_cv_c_bigendian=unknown
-    # See if we're dealing with a universal compiler.
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#ifndef __APPLE_CC__
-	       not a universal capable compiler
-	     #endif
-	     typedef int dummy;
-
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
-	# Check for potential -arch flags.  It is not universal unless
-	# there are at least two -arch flags with different values.
-	ac_arch=
-	ac_prev=
-	for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do
-	 if test -n "$ac_prev"; then
-	   case $ac_word in
-	     i?86 | x86_64 | ppc | ppc64)
-	       if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then
-		 ac_arch=$ac_word
-	       else
-		 ac_cv_c_bigendian=universal
-		 break
-	       fi
-	       ;;
-	   esac
-	   ac_prev=
-	 elif test "x$ac_word" = "x-arch"; then
-	   ac_prev=arch
-	 fi
-       done
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-    if test $ac_cv_c_bigendian = unknown; then
-      # See if sys/param.h defines the BYTE_ORDER macro.
-      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <sys/types.h>
-	     #include <sys/param.h>
-
-int
-main ()
-{
-#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \
-		     && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \
-		     && LITTLE_ENDIAN)
-	      bogus endian macros
-	     #endif
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  # It does; now see whether it defined to BIG_ENDIAN or not.
-	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <sys/types.h>
-		#include <sys/param.h>
-
-int
-main ()
-{
-#if BYTE_ORDER != BIG_ENDIAN
-		 not big endian
-		#endif
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_c_bigendian=yes
-else
-  ac_cv_c_bigendian=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-    fi
-    if test $ac_cv_c_bigendian = unknown; then
-      # See if <limits.h> defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris).
-      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <limits.h>
-
-int
-main ()
-{
-#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN)
-	      bogus endian macros
-	     #endif
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  # It does; now see whether it defined to _BIG_ENDIAN or not.
-	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <limits.h>
-
-int
-main ()
-{
-#ifndef _BIG_ENDIAN
-		 not big endian
-		#endif
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_c_bigendian=yes
-else
-  ac_cv_c_bigendian=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-    fi
-    if test $ac_cv_c_bigendian = unknown; then
-      # Compile a test program.
-      if test "$cross_compiling" = yes; then :
-  # Try to guess by grepping values from an object file.
-	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-short int ascii_mm[] =
-		  { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
-		short int ascii_ii[] =
-		  { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
-		int use_ascii (int i) {
-		  return ascii_mm[i] + ascii_ii[i];
-		}
-		short int ebcdic_ii[] =
-		  { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
-		short int ebcdic_mm[] =
-		  { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
-		int use_ebcdic (int i) {
-		  return ebcdic_mm[i] + ebcdic_ii[i];
-		}
-		extern int foo;
-
-int
-main ()
-{
-return use_ascii (foo) == use_ebcdic (foo);
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then
-	      ac_cv_c_bigendian=yes
-	    fi
-	    if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
-	      if test "$ac_cv_c_bigendian" = unknown; then
-		ac_cv_c_bigendian=no
-	      else
-		# finding both strings is unlikely to happen, but who knows?
-		ac_cv_c_bigendian=unknown
-	      fi
-	    fi
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-$ac_includes_default
-int
-main ()
-{
-
-	     /* Are we little or big endian?  From Harbison&Steele.  */
-	     union
-	     {
-	       long int l;
-	       char c[sizeof (long int)];
-	     } u;
-	     u.l = 1;
-	     return u.c[sizeof (long int) - 1] == 1;
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  ac_cv_c_bigendian=no
-else
-  ac_cv_c_bigendian=yes
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-    fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5
-$as_echo "$ac_cv_c_bigendian" >&6; }
- case $ac_cv_c_bigendian in #(
-   yes)
-     BYTESWAP=no;; #(
-   no)
-     BYTESWAP=yes ;; #(
-   universal)
-     as_fn_error $? "Universial endianess not supported" "$LINENO" 5
-
-     ;; #(
-   *)
-     as_fn_error $? "Unknown endian state" "$LINENO" 5 ;;
- esac
-
-if test BYTESWAP == "no" ; then
-
-$as_echo "#define ENDIAN_BIG 1" >>confdefs.h
-
-else
-
-$as_echo "#define BYTESWAPPED 1" >>confdefs.h
-
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
-$as_echo_n "checking for ANSI C header files... " >&6; }
-if ${ac_cv_header_stdc+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
-#include <float.h>
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_header_stdc=yes
-else
-  ac_cv_header_stdc=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-if test $ac_cv_header_stdc = yes; then
-  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <string.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "memchr" >/dev/null 2>&1; then :
-
-else
-  ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-fi
-
-if test $ac_cv_header_stdc = yes; then
-  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <stdlib.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "free" >/dev/null 2>&1; then :
-
-else
-  ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-fi
-
-if test $ac_cv_header_stdc = yes; then
-  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
-  if test "$cross_compiling" = yes; then :
-  :
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <ctype.h>
-#include <stdlib.h>
-#if ((' ' & 0x0FF) == 0x020)
-# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
-# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
-#else
-# define ISLOWER(c) \
-		   (('a' <= (c) && (c) <= 'i') \
-		     || ('j' <= (c) && (c) <= 'r') \
-		     || ('s' <= (c) && (c) <= 'z'))
-# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
-#endif
-
-#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
-int
-main ()
-{
-  int i;
-  for (i = 0; i < 256; i++)
-    if (XOR (islower (i), ISLOWER (i))
-	|| toupper (i) != TOUPPER (i))
-      return 2;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-
-else
-  ac_cv_header_stdc=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
-$as_echo "$ac_cv_header_stdc" >&6; }
-if test $ac_cv_header_stdc = yes; then
-
-$as_echo "#define STDC_HEADERS 1" >>confdefs.h
-
-fi
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for exp in -lm" >&5
-$as_echo_n "checking for exp in -lm... " >&6; }
-if ${ac_cv_lib_m_exp+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lm  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char exp ();
-int
-main ()
-{
-return exp ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_m_exp=yes
-else
-  ac_cv_lib_m_exp=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_exp" >&5
-$as_echo "$ac_cv_lib_m_exp" >&6; }
-if test "x$ac_cv_lib_m_exp" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBM 1
-_ACEOF
-
-  LIBS="-lm $LIBS"
-
-fi
-
-
-ac_fn_c_find_intX_t "$LINENO" "8" "ac_cv_c_int8_t"
-case $ac_cv_c_int8_t in #(
-  no|yes) ;; #(
-  *)
-
-cat >>confdefs.h <<_ACEOF
-#define int8_t $ac_cv_c_int8_t
-_ACEOF
-;;
-esac
-
-
-ac_fn_c_check_header_mongrel "$LINENO" "malloc.h" "ac_cv_header_malloc_h" "$ac_includes_default"
-if test "x$ac_cv_header_malloc_h" = xyes; then :
-
-$as_echo "#define HAVE_MALLOC_H 1" >>confdefs.h
-
-fi
-
-
-
-case "${host_os}" in
-	solaris*|sunos*) CFLAGS="${CFLAGS} -DSUN" ;;
-	*) $as_echo "Build does not require -DSUN CFLAG" ;;
-esac
-
-case "${host_os}" in
-	*mingw32*|cygwin*)
-
-$as_echo "#define WIN32 1" >>confdefs.h
-
-	$as_echo "Added WIN32 define to mb_config.h"
-	;;
-	*)
-	$as_echo "Not WIN32 system"
-	;;
-esac
-
-for ac_header in rpc/rpc.h
-do :
-  ac_fn_c_check_header_mongrel "$LINENO" "rpc/rpc.h" "ac_cv_header_rpc_rpc_h" "$ac_includes_default"
-if test "x$ac_cv_header_rpc_rpc_h" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_RPC_RPC_H 1
-_ACEOF
-
-fi
-
-done
-
-for ac_header in rpc/types.h
-do :
-  ac_fn_c_check_header_mongrel "$LINENO" "rpc/types.h" "ac_cv_header_rpc_types_h" "$ac_includes_default"
-if test "x$ac_cv_header_rpc_types_h" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_RPC_TYPES_H 1
-_ACEOF
-
-else
-  as_fn_error $? "Required header <rpc/types.h> not found, check include path and intsalled devel packages" "$LINENO" 5
-fi
-
-done
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lws2_32" >&5
-$as_echo_n "checking for main in -lws2_32... " >&6; }
-if ${ac_cv_lib_ws2_32_main+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lws2_32  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-
-int
-main ()
-{
-return main ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_ws2_32_main=yes
-else
-  ac_cv_lib_ws2_32_main=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ws2_32_main" >&5
-$as_echo "$ac_cv_lib_ws2_32_main" >&6; }
-if test "x$ac_cv_lib_ws2_32_main" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBWS2_32 1
-_ACEOF
-
-  LIBS="-lws2_32 $LIBS"
-
-fi
-
-
-ac_fn_c_check_func "$LINENO" "xdrmem_create" "ac_cv_func_xdrmem_create"
-if test "x$ac_cv_func_xdrmem_create" = xyes; then :
-  XDR_LIB=
-else
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for xdrmem_create in -lsun" >&5
-$as_echo_n "checking for xdrmem_create in -lsun... " >&6; }
-if ${ac_cv_lib_sun_xdrmem_create+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lsun  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char xdrmem_create ();
-int
-main ()
-{
-return xdrmem_create ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_sun_xdrmem_create=yes
-else
-  ac_cv_lib_sun_xdrmem_create=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_sun_xdrmem_create" >&5
-$as_echo "$ac_cv_lib_sun_xdrmem_create" >&6; }
-if test "x$ac_cv_lib_sun_xdrmem_create" = xyes; then :
-  XDR_LIB=-lsun
-else
-
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for xdrmem_create in -lnsl" >&5
-$as_echo_n "checking for xdrmem_create in -lnsl... " >&6; }
-if ${ac_cv_lib_nsl_xdrmem_create+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lnsl  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char xdrmem_create ();
-int
-main ()
-{
-return xdrmem_create ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_nsl_xdrmem_create=yes
-else
-  ac_cv_lib_nsl_xdrmem_create=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_xdrmem_create" >&5
-$as_echo "$ac_cv_lib_nsl_xdrmem_create" >&6; }
-if test "x$ac_cv_lib_nsl_xdrmem_create" = xyes; then :
-  XDR_LIB=-lnsl
-else
-
-   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for xdrmem_create in -lrpclib" >&5
-$as_echo_n "checking for xdrmem_create in -lrpclib... " >&6; }
-if ${ac_cv_lib_rpclib_xdrmem_create+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lrpclib  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char xdrmem_create ();
-int
-main ()
-{
-return xdrmem_create ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_rpclib_xdrmem_create=yes
-else
-  ac_cv_lib_rpclib_xdrmem_create=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rpclib_xdrmem_create" >&5
-$as_echo "$ac_cv_lib_rpclib_xdrmem_create" >&6; }
-if test "x$ac_cv_lib_rpclib_xdrmem_create" = xyes; then :
-  XDR_LIB=-lrpclib
-else
-
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for xdrmem_create in -lxdr" >&5
-$as_echo_n "checking for xdrmem_create in -lxdr... " >&6; }
-if ${ac_cv_lib_xdr_xdrmem_create+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lxdr -lws2_32  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char xdrmem_create ();
-int
-main ()
-{
-return xdrmem_create ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_xdr_xdrmem_create=yes
-else
-  ac_cv_lib_xdr_xdrmem_create=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_xdr_xdrmem_create" >&5
-$as_echo "$ac_cv_lib_xdr_xdrmem_create" >&6; }
-if test "x$ac_cv_lib_xdr_xdrmem_create" = xyes; then :
-  XDR_LIB=-lxdr
-else
-
-     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for xdrmem_create in -lportablexdr" >&5
-$as_echo_n "checking for xdrmem_create in -lportablexdr... " >&6; }
-if ${ac_cv_lib_portablexdr_xdrmem_create+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lportablexdr -lws2_32  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char xdrmem_create ();
-int
-main ()
-{
-return xdrmem_create ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_portablexdr_xdrmem_create=yes
-else
-  ac_cv_lib_portablexdr_xdrmem_create=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_portablexdr_xdrmem_create" >&5
-$as_echo "$ac_cv_lib_portablexdr_xdrmem_create" >&6; }
-if test "x$ac_cv_lib_portablexdr_xdrmem_create" = xyes; then :
-  XDR_LIB=-lportablexdr
-else
-   as_fn_error $? "*** Unable to locate XDR functions." "$LINENO" 5
-fi
-
-
-fi
-
-fi
-
-fi
-
-fi
-
-fi
-
-
-
-
-$as_echo "Use OTPS (OSU Tidal Prediction Software) location if specified with --with-otps_dir, use default otherwise"
-OTPS_DIR="/usr/local/OTPSnc"
-
-# Check whether --with-otps_dir was given.
-if test "${with_otps_dir+set}" = set; then :
-  withval=$with_otps_dir; OTPS_DIR=${withval}
-fi
-
-
-
-
-$as_echo "Check for netCDF library libnetcdf"
-GOT_CDF=no
-CDF_SETTING=no
-
-# Check whether --with-netcdf-lib was given.
-if test "${with_netcdf_lib+set}" = set; then :
-  withval=$with_netcdf_lib; netcdf_libdir="${withval}" GOT_CDF=yes
-else
-  GOT_CDF=no
-fi
-
-if test "$GOT_CDF" = "yes" ; then
-        $as_echo "NetCDF library location specified: $netcdf_libdir - check if libnetcdf is there..."
-    save_LDFLAGS=$LDFLAGS
-    LDFLAGS="$LDFLAGS -L$netcdf_libdir"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nc_open in -lnetcdf" >&5
-$as_echo_n "checking for nc_open in -lnetcdf... " >&6; }
-if ${ac_cv_lib_netcdf_nc_open+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lnetcdf  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char nc_open ();
-int
-main ()
-{
-return nc_open ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_netcdf_nc_open=yes
-else
-  ac_cv_lib_netcdf_nc_open=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_netcdf_nc_open" >&5
-$as_echo "$ac_cv_lib_netcdf_nc_open" >&6; }
-if test "x$ac_cv_lib_netcdf_nc_open" = xyes; then :
-  CDF_SETTING=yes
-else
-  CDF_SETTING=no
-fi
-
-    LDFLAGS="$save_LDFLAGS"
-    if test "$CDF_SETTING" = "no"; then
-	as_fn_error $? "Did not find libnetcdf according to --with-netcdf-lib - check the installation!" "$LINENO" 5
-    fi
-    libnetcdf_LIBS="-L$netcdf_libdir -R $netcdf_libdir -lnetcdf"
-    libnetcdf_LDFLAGS="-L$netcdf_libdir"
-else
-        $as_echo "Look for pkg-config netCDF package..."
-
-
-
-
-
-
-
-if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
-	if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
-set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_PKG_CONFIG+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  case $PKG_CONFIG in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-  ;;
-esac
-fi
-PKG_CONFIG=$ac_cv_path_PKG_CONFIG
-if test -n "$PKG_CONFIG"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
-$as_echo "$PKG_CONFIG" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_path_PKG_CONFIG"; then
-  ac_pt_PKG_CONFIG=$PKG_CONFIG
-  # Extract the first word of "pkg-config", so it can be a program name with args.
-set dummy pkg-config; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  case $ac_pt_PKG_CONFIG in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-  ;;
-esac
-fi
-ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
-if test -n "$ac_pt_PKG_CONFIG"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
-$as_echo "$ac_pt_PKG_CONFIG" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-  if test "x$ac_pt_PKG_CONFIG" = x; then
-    PKG_CONFIG=""
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
-    PKG_CONFIG=$ac_pt_PKG_CONFIG
-  fi
-else
-  PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
-fi
-
-fi
-if test -n "$PKG_CONFIG"; then
-	_pkg_min_version=0.9.0
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5
-$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; }
-	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
-		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-	else
-		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-		PKG_CONFIG=""
-	fi
-fi
-
-pkg_failed=no
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libnetcdf" >&5
-$as_echo_n "checking for libnetcdf... " >&6; }
-
-if test -n "$libnetcdf_CFLAGS"; then
-    pkg_cv_libnetcdf_CFLAGS="$libnetcdf_CFLAGS"
- elif test -n "$PKG_CONFIG"; then
-    if test -n "$PKG_CONFIG" && \
-    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"netcdf\""; } >&5
-  ($PKG_CONFIG --exists --print-errors "netcdf") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; then
-  pkg_cv_libnetcdf_CFLAGS=`$PKG_CONFIG --cflags "netcdf" 2>/dev/null`
-		      test "x$?" != "x0" && pkg_failed=yes
-else
-  pkg_failed=yes
-fi
- else
-    pkg_failed=untried
-fi
-if test -n "$libnetcdf_LIBS"; then
-    pkg_cv_libnetcdf_LIBS="$libnetcdf_LIBS"
- elif test -n "$PKG_CONFIG"; then
-    if test -n "$PKG_CONFIG" && \
-    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"netcdf\""; } >&5
-  ($PKG_CONFIG --exists --print-errors "netcdf") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; then
-  pkg_cv_libnetcdf_LIBS=`$PKG_CONFIG --libs "netcdf" 2>/dev/null`
-		      test "x$?" != "x0" && pkg_failed=yes
-else
-  pkg_failed=yes
-fi
- else
-    pkg_failed=untried
-fi
-
-
-
-if test $pkg_failed = yes; then
-   	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-
-if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
-        _pkg_short_errors_supported=yes
-else
-        _pkg_short_errors_supported=no
-fi
-        if test $_pkg_short_errors_supported = yes; then
-	        libnetcdf_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "netcdf" 2>&1`
-        else
-	        libnetcdf_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "netcdf" 2>&1`
-        fi
-	# Put the nasty error message in config.log where it belongs
-	echo "$libnetcdf_PKG_ERRORS" >&5
-
-	GOT_CDF=no
-elif test $pkg_failed = untried; then
-     	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-	GOT_CDF=no
-else
-	libnetcdf_CFLAGS=$pkg_cv_libnetcdf_CFLAGS
-	libnetcdf_LIBS=$pkg_cv_libnetcdf_LIBS
-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-	GOT_CDF=yes
-fi
-    libnetcdf_LIBS="-lnetcdf"
-    libnetcdf_LDFLAGS=""
-fi
-if test "$GOT_CDF" = "no" ; then
-        $as_echo "Did not find netCDF library pkg-config package, looking in the usual places..."
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nc_open in -lnetcdf" >&5
-$as_echo_n "checking for nc_open in -lnetcdf... " >&6; }
-if ${ac_cv_lib_netcdf_nc_open+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lnetcdf  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char nc_open ();
-int
-main ()
-{
-return nc_open ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_netcdf_nc_open=yes
-else
-  ac_cv_lib_netcdf_nc_open=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_netcdf_nc_open" >&5
-$as_echo "$ac_cv_lib_netcdf_nc_open" >&6; }
-if test "x$ac_cv_lib_netcdf_nc_open" = xyes; then :
-  CDF_SETTING=yes
-else
-  CDF_SETTING=no
-fi
-
-    if test "$CDF_SETTING" = "yes" ; then
-        GOT_CDF=yes
-        $as_echo "Using pre-installed libnetcdf..."
-        libnetcdf_LIBS="-lnetcdf"
-        libnetcdf_LDFLAGS=""
-    else
-        $as_echo "Did not find netCDF library anywhere, use --with-netcdf-lib to set the location"
-        as_fn_error $? "Did not find netCDF library anywhere, use --with-netcdf-lib to set the location" "$LINENO" 5
-    fi
-fi
-
-$as_echo "Check for netCDF headers"
-GOT_CDF=no
-CDF_SETTING=no
-
-# Check whether --with-netcdf-include was given.
-if test "${with_netcdf_include+set}" = set; then :
-  withval=$with_netcdf_include; libnetcdf_CPPFLAGS="-I${withval}" GOT_CDF=yes
-else
-  GOT_CDF=no
-fi
-
-if test "$GOT_CDF" = "yes" ; then
-        $as_echo "NetCDF header location specified: $libnetcdf_CPPFLAGS - check if netcdf.h is there..."
-    save_CPPFLAGS=$CPPFLAGS
-    save_CFLAGS=$CFLAGS
-    CPPFLAGS="$CPPFLAGS $libnetcdf_CPPFLAGS"
-    CFLAGS="$CFLAGS $libnetcdf_CPPFLAGS"
-    ac_fn_c_check_header_mongrel "$LINENO" "netcdf.h" "ac_cv_header_netcdf_h" "$ac_includes_default"
-if test "x$ac_cv_header_netcdf_h" = xyes; then :
-  CDF_SETTING=yes
-else
-  CDF_SETTING=no
-fi
-
-
-    CPPFLAGS=$save_CPPFLAGS
-    CFLAGS=$save_CFLAGS
-    if test "$CDF_SETTING" = "no"; then
-	as_fn_error $? "Did not find netcdf.h according to --with-netcdf-include - check the installation!" "$LINENO" 5
-    fi
-else
-        $as_echo "Looking for netCDF headers in the usual places..."
-    ac_fn_c_check_header_mongrel "$LINENO" "netcdf.h" "ac_cv_header_netcdf_h" "$ac_includes_default"
-if test "x$ac_cv_header_netcdf_h" = xyes; then :
-  CDF_SETTING=yes
-else
-  CDF_SETTING=no
-fi
-
-
-    if test "$CDF_SETTING" = "yes" ; then
-        GOT_CDF=yes
-        $as_echo "Using pre-installed netCDF headers..."
-    else
-        $as_echo "Did not find netCDF headers anywhere, use --with-netcdf-include to set the location"
-        as_fn_error $? "Did not find netCDF headers anywhere, use --with-netcdf-include to set the location" "$LINENO" 5
-    fi
-fi
-
-libnetcdf_LIBS=$libnetcdf_LIBS
-
-libnetcdf_CPPFLAGS=$libnetcdf_CPPFLAGS
-
-
-
-$as_echo "Check whether to use bundled proj package or link with external libproj"
-# Check whether --enable-bundledproj was given.
-if test "${enable_bundledproj+set}" = set; then :
-  enableval=$enable_bundledproj; bundledproj=yes
-else
-  bundledproj=no
-fi
-
- if test x"$bundledproj" = xyes; then
-  BUILD_PROJ_TRUE=
-  BUILD_PROJ_FALSE='#'
-else
-  BUILD_PROJ_TRUE='#'
-  BUILD_PROJ_FALSE=
-fi
-
-if test "$bundledproj" = "yes" ; then
-        $as_echo "Using bundled PROJ library"
-    libproj_LIBS="-lproj"
-    libproj_LDFLAGS=
-else
-        $as_echo "Check if proj library location specified on the command line"
-    GOT_PROJ=no
-    PROJ_SETTING=no
-
-# Check whether --with-proj-lib was given.
-if test "${with_proj_lib+set}" = set; then :
-  withval=$with_proj_lib; proj_libdir="${withval}" GOT_PROJ=yes
-else
-  GOT_PROJ=no
-fi
-
-    if test "$GOT_PROJ" = "yes" ; then
-                $as_echo "PROJ library location specified: $proj_libdir - check if libproj is there..."
-        save_LDFLAGS=$LDFLAGS
-        LDFLAGS="$LDFLAGS -L$proj_libdir"
-        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pj_init_plus in -lproj" >&5
-$as_echo_n "checking for pj_init_plus in -lproj... " >&6; }
-if ${ac_cv_lib_proj_pj_init_plus+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lproj  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char pj_init_plus ();
-int
-main ()
-{
-return pj_init_plus ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_proj_pj_init_plus=yes
-else
-  ac_cv_lib_proj_pj_init_plus=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_proj_pj_init_plus" >&5
-$as_echo "$ac_cv_lib_proj_pj_init_plus" >&6; }
-if test "x$ac_cv_lib_proj_pj_init_plus" = xyes; then :
-  PROJ_SETTING=yes
-else
-  PROJ_SETTING=no
-fi
-
-        LDFLAGS="$save_LDFLAGS"
-        if test "$PROJ_SETTING" = "no"; then
-            as_fn_error $? "Did not find libproj according to --with-proj-lib - check the installation!" "$LINENO" 5
-        fi
-        libproj_LIBS="-L$proj_libdir -R $proj_libdir -lproj"
-        libproj_LDFLAGS="-L$proj_libdir"
-    else
-                $as_echo "Look for pkg-config PROJ package..."
-
-pkg_failed=no
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libproj" >&5
-$as_echo_n "checking for libproj... " >&6; }
-
-if test -n "$libproj_CFLAGS"; then
-    pkg_cv_libproj_CFLAGS="$libproj_CFLAGS"
- elif test -n "$PKG_CONFIG"; then
-    if test -n "$PKG_CONFIG" && \
-    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"proj\""; } >&5
-  ($PKG_CONFIG --exists --print-errors "proj") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; then
-  pkg_cv_libproj_CFLAGS=`$PKG_CONFIG --cflags "proj" 2>/dev/null`
-		      test "x$?" != "x0" && pkg_failed=yes
-else
-  pkg_failed=yes
-fi
- else
-    pkg_failed=untried
-fi
-if test -n "$libproj_LIBS"; then
-    pkg_cv_libproj_LIBS="$libproj_LIBS"
- elif test -n "$PKG_CONFIG"; then
-    if test -n "$PKG_CONFIG" && \
-    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"proj\""; } >&5
-  ($PKG_CONFIG --exists --print-errors "proj") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; then
-  pkg_cv_libproj_LIBS=`$PKG_CONFIG --libs "proj" 2>/dev/null`
-		      test "x$?" != "x0" && pkg_failed=yes
-else
-  pkg_failed=yes
-fi
- else
-    pkg_failed=untried
-fi
-
-
-
-if test $pkg_failed = yes; then
-   	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-
-if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
-        _pkg_short_errors_supported=yes
-else
-        _pkg_short_errors_supported=no
-fi
-        if test $_pkg_short_errors_supported = yes; then
-	        libproj_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "proj" 2>&1`
-        else
-	        libproj_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "proj" 2>&1`
-        fi
-	# Put the nasty error message in config.log where it belongs
-	echo "$libproj_PKG_ERRORS" >&5
-
-	GOT_PROJ=no
-elif test $pkg_failed = untried; then
-     	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-	GOT_PROJ=no
-else
-	libproj_CFLAGS=$pkg_cv_libproj_CFLAGS
-	libproj_LIBS=$pkg_cv_libproj_LIBS
-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-	GOT_PROJ=yes
-fi
-        libproj_LIBS="-lproj"
-        libproj_LDFLAGS=""
-    fi
-    if test "$GOT_PROJ" = "no" ; then
-                $as_echo "Did not find PROJ library pkg-config package, looking in the usual places..."
-        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pj_init_plus in -lproj" >&5
-$as_echo_n "checking for pj_init_plus in -lproj... " >&6; }
-if ${ac_cv_lib_proj_pj_init_plus+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lproj  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char pj_init_plus ();
-int
-main ()
-{
-return pj_init_plus ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_proj_pj_init_plus=yes
-else
-  ac_cv_lib_proj_pj_init_plus=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_proj_pj_init_plus" >&5
-$as_echo "$ac_cv_lib_proj_pj_init_plus" >&6; }
-if test "x$ac_cv_lib_proj_pj_init_plus" = xyes; then :
-  PROJ_SETTING=yes
-else
-  PROJ_SETTING=no
-fi
-
-        if test "$PROJ_SETTING" = "yes" ; then
-            GOT_PROJ=yes
-            $as_echo "Using pre-installed libproj..."
-            libproj_LIBS="-lproj"
-            libproj_LDFLAGS=""
-        else
-            $as_echo "Did not find PROJ library anywhere, use --with-proj-lib to set the location"
-            as_fn_error $? "Did not find PROJ library anywhere, use --with-proj-lib to set the location" "$LINENO" 5
-        fi
-    fi
-
-        $as_echo "Check if proj header location specified on the command line"
-    GOT_PROJ=no
-    PROJ_SETTING=no
-
-# Check whether --with-proj-include was given.
-if test "${with_proj_include+set}" = set; then :
-  withval=$with_proj_include; libproj_CPPFLAGS="-I${withval}" GOT_PROJ=yes
-else
-  GOT_PROJ=no
-fi
-
-    if test "$GOT_PROJ" = "yes" ; then
-                $as_echo "PROJ header location specified: $libproj_CPPFLAGS - check if proj_api.h is there..."
-        save_CPPFLAGS=$CPPFLAGS
-        save_CFLAGS=$CFLAGS
-        CPPFLAGS="$CPPFLAGS $libproj_CPPFLAGS"
-        CFLAGS="$CFLAGS $libproj_CPPFLAGS"
-        ac_fn_c_check_header_mongrel "$LINENO" "proj_api.h" "ac_cv_header_proj_api_h" "$ac_includes_default"
-if test "x$ac_cv_header_proj_api_h" = xyes; then :
-  PROJ_SETTING=yes
-else
-  PROJ_SETTING=no
-fi
-
-
-        CPPFLAGS=$save_CPPFLAGS
-        CFLAGS=$save_CFLAGS
-        if test "$PROJ_SETTING" = "no"; then
-           as_fn_error $? "Did not find PROJ headers according to --with-proj-include - check the installation!" "$LINENO" 5
-        fi
-    else
-                $as_echo "Looking for PROJ headers in the usual places..."
-        ac_fn_c_check_header_mongrel "$LINENO" "proj_api.h" "ac_cv_header_proj_api_h" "$ac_includes_default"
-if test "x$ac_cv_header_proj_api_h" = xyes; then :
-  PROJ_SETTING=yes
-else
-  PROJ_SETTING=no
-fi
-
-
-        if test "$PROJ_SETTING" = "yes" ; then
-            GOT_PROJ=yes
-            $as_echo "Using pre-installed PROJ headers..."
-        else
-            $as_echo "Did not find PROJ headers anywhere, use --with-proj-include to set the location"
-            as_fn_error $? "Did not find PROJ headers anywhere, use --with-proj-include to set the location" "$LINENO" 5
-        fi
-    fi
-     fi
-
-libproj_LIBS=$libproj_LIBS
-
-libproj_CPPFLAGS=$libproj_CPPFLAGS
-
-
-
-$as_echo "Check for GMT libraries libgmt libpsl"
-GOT_GMT=no
-GMT_SETTING=no
-
-# Check whether --with-gmt-lib was given.
-if test "${with_gmt_lib+set}" = set; then :
-  withval=$with_gmt_lib; gmt_libdir="${withval}" GOT_GMT=yes
-else
-  GOT_GMT=no
-fi
-
-if test "$GOT_GMT" = "yes" ; then
-        $as_echo "GMT library location specified: $gmt_libdir - check if libgmt libpsl are there..."
-    save_LDFLAGS=$LDFLAGS
-    LDFLAGS="$LDFLAGS -L$gmt_libdir"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GMT_begin in -lgmt" >&5
-$as_echo_n "checking for GMT_begin in -lgmt... " >&6; }
-if ${ac_cv_lib_gmt_GMT_begin+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lgmt  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char GMT_begin ();
-int
-main ()
-{
-return GMT_begin ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_gmt_GMT_begin=yes
-else
-  ac_cv_lib_gmt_GMT_begin=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gmt_GMT_begin" >&5
-$as_echo "$ac_cv_lib_gmt_GMT_begin" >&6; }
-if test "x$ac_cv_lib_gmt_GMT_begin" = xyes; then :
-  GMT_SETTING=yes
-else
-  GMT_SETTING=no
-fi
-
-    LDFLAGS="$save_LDFLAGS"
-    if test "$GMT_SETTING" = "no"; then
-	as_fn_error $? "Did not find libgmt according to --with-gmt-lib - check the installation!" "$LINENO" 5
-    fi
-    libgmt_LIBS="-L$gmt_libdir -R $gmt_libdir -lgmt -lpsl"
-    libgmt_LDFLAGS="-L$gmt_libdir"
-else
-        $as_echo "Look for pkg-config GMT package..."
-
-pkg_failed=no
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libgmt" >&5
-$as_echo_n "checking for libgmt... " >&6; }
-
-if test -n "$libgmt_CFLAGS"; then
-    pkg_cv_libgmt_CFLAGS="$libgmt_CFLAGS"
- elif test -n "$PKG_CONFIG"; then
-    if test -n "$PKG_CONFIG" && \
-    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gmt\""; } >&5
-  ($PKG_CONFIG --exists --print-errors "gmt") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; then
-  pkg_cv_libgmt_CFLAGS=`$PKG_CONFIG --cflags "gmt" 2>/dev/null`
-		      test "x$?" != "x0" && pkg_failed=yes
-else
-  pkg_failed=yes
-fi
- else
-    pkg_failed=untried
-fi
-if test -n "$libgmt_LIBS"; then
-    pkg_cv_libgmt_LIBS="$libgmt_LIBS"
- elif test -n "$PKG_CONFIG"; then
-    if test -n "$PKG_CONFIG" && \
-    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gmt\""; } >&5
-  ($PKG_CONFIG --exists --print-errors "gmt") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; then
-  pkg_cv_libgmt_LIBS=`$PKG_CONFIG --libs "gmt" 2>/dev/null`
-		      test "x$?" != "x0" && pkg_failed=yes
-else
-  pkg_failed=yes
-fi
- else
-    pkg_failed=untried
-fi
-
-
-
-if test $pkg_failed = yes; then
-   	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-
-if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
-        _pkg_short_errors_supported=yes
-else
-        _pkg_short_errors_supported=no
-fi
-        if test $_pkg_short_errors_supported = yes; then
-	        libgmt_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "gmt" 2>&1`
-        else
-	        libgmt_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "gmt" 2>&1`
-        fi
-	# Put the nasty error message in config.log where it belongs
-	echo "$libgmt_PKG_ERRORS" >&5
-
-	GOT_LIBGMT=no
-elif test $pkg_failed = untried; then
-     	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-	GOT_LIBGMT=no
-else
-	libgmt_CFLAGS=$pkg_cv_libgmt_CFLAGS
-	libgmt_LIBS=$pkg_cv_libgmt_LIBS
-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-	GOT_LIBGMT=yes
-fi
-
-pkg_failed=no
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libpsl" >&5
-$as_echo_n "checking for libpsl... " >&6; }
-
-if test -n "$libpsl_CFLAGS"; then
-    pkg_cv_libpsl_CFLAGS="$libpsl_CFLAGS"
- elif test -n "$PKG_CONFIG"; then
-    if test -n "$PKG_CONFIG" && \
-    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gmt\""; } >&5
-  ($PKG_CONFIG --exists --print-errors "gmt") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; then
-  pkg_cv_libpsl_CFLAGS=`$PKG_CONFIG --cflags "gmt" 2>/dev/null`
-		      test "x$?" != "x0" && pkg_failed=yes
-else
-  pkg_failed=yes
-fi
- else
-    pkg_failed=untried
-fi
-if test -n "$libpsl_LIBS"; then
-    pkg_cv_libpsl_LIBS="$libpsl_LIBS"
- elif test -n "$PKG_CONFIG"; then
-    if test -n "$PKG_CONFIG" && \
-    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gmt\""; } >&5
-  ($PKG_CONFIG --exists --print-errors "gmt") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; then
-  pkg_cv_libpsl_LIBS=`$PKG_CONFIG --libs "gmt" 2>/dev/null`
-		      test "x$?" != "x0" && pkg_failed=yes
-else
-  pkg_failed=yes
-fi
- else
-    pkg_failed=untried
-fi
-
-
-
-if test $pkg_failed = yes; then
-   	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-
-if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
-        _pkg_short_errors_supported=yes
-else
-        _pkg_short_errors_supported=no
-fi
-        if test $_pkg_short_errors_supported = yes; then
-	        libpsl_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "gmt" 2>&1`
-        else
-	        libpsl_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "gmt" 2>&1`
-        fi
-	# Put the nasty error message in config.log where it belongs
-	echo "$libpsl_PKG_ERRORS" >&5
-
-	GOT_LIBPSL=no
-elif test $pkg_failed = untried; then
-     	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-	GOT_LIBPSL=no
-else
-	libpsl_CFLAGS=$pkg_cv_libpsl_CFLAGS
-	libpsl_LIBS=$pkg_cv_libpsl_LIBS
-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-	GOT_LIBPSL=yes
-fi
-    if test "$GOT_LIBGMT" = "yes" ; then
-            GOT_GMT=yes
-    fi
-    if test "$GOT_PSL" = "no" ; then
-            GOT_GMT=no
-    fi
-    libgmt_LIBS="-lgmt -lpsl"
-    libgmt_LDFLAGS=""
-fi
-if test "$GOT_GMT" = "no" ; then
-        $as_echo "Did not find GMT library pkg-config package, looking in the usual places..."
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GMT_begin in -lgmt" >&5
-$as_echo_n "checking for GMT_begin in -lgmt... " >&6; }
-if ${ac_cv_lib_gmt_GMT_begin+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lgmt  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char GMT_begin ();
-int
-main ()
-{
-return GMT_begin ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_gmt_GMT_begin=yes
-else
-  ac_cv_lib_gmt_GMT_begin=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gmt_GMT_begin" >&5
-$as_echo "$ac_cv_lib_gmt_GMT_begin" >&6; }
-if test "x$ac_cv_lib_gmt_GMT_begin" = xyes; then :
-  GMT_SETTING=yes
-else
-  GMT_SETTING=no
-fi
-
-    if test "$GMT_SETTING" = "yes" ; then
-        GOT_GMT=yes
-        $as_echo "Using pre-installed libgmt..."
-        libgmt_LIBS="-lgmt -lpsl"
-        libgmt_LDFLAGS=""
-    else
-        $as_echo "Did not find GMT libraries anywhere, use --with-gmt-lib to set the location"
-        as_fn_error $? "Did not find GMT libraries anywhere, use --with-gmt-lib to set the location" "$LINENO" 5
-    fi
-fi
-
-$as_echo "Check for GMT headers"
-GOT_GMT=no
-GMT_SETTING=no
-
-# Check whether --with-gmt-include was given.
-if test "${with_gmt_include+set}" = set; then :
-  withval=$with_gmt_include; libgmt_CPPFLAGS="-I${withval}" GOT_GMT=yes
-else
-  GOT_GMT=no
-fi
-
-if test "$GOT_GMT" = "yes" ; then
-        $as_echo "GMT header location specified: $libgmt_CPPFLAGS - check if gmt.h is there..."
-    save_CPPFLAGS=$CPPFLAGS
-    save_CFLAGS=$CFLAGS
-    CPPFLAGS="$CPPFLAGS $libgmt_CPPFLAGS"
-    CFLAGS="$CFLAGS $libgmt_CPPFLAGS"
-    ac_fn_c_check_header_mongrel "$LINENO" "gmt.h" "ac_cv_header_gmt_h" "$ac_includes_default"
-if test "x$ac_cv_header_gmt_h" = xyes; then :
-  GMT_SETTING=yes
-else
-  GMT_SETTING=no
-fi
-
-
-    CPPFLAGS=$save_CPPFLAGS
-    CFLAGS=$save_CFLAGS
-    if test "$GMT_SETTING" = "no"; then
-	as_fn_error $? "Did not find gmt.h according to --with-gmt-include - check the installation!" "$LINENO" 5
-    fi
-else
-        $as_echo "Looking for GMT headers in the usual places..."
-    ac_fn_c_check_header_mongrel "$LINENO" "gmt.h" "ac_cv_header_gmt_h" "$ac_includes_default"
-if test "x$ac_cv_header_gmt_h" = xyes; then :
-  GMT_SETTING=yes
-else
-  GMT_SETTING=no
-fi
-
-
-    if test "$GMT_SETTING" = "yes" ; then
-        GOT_GMT=yes
-        $as_echo "Using pre-installed GMT headers..."
-    else
-        $as_echo "Did not find GMT headers anywhere, use --with-gmt-include to set the location"
-        as_fn_error $? "Did not find GMT headers anywhere, use --with-gmt-include to set the location" "$LINENO" 5
-    fi
-fi
-
-libgmt_LIBS=$libgmt_LIBS
-
-libgmt_CPPFLAGS=$libgmt_CPPFLAGS
-
-
-
-$as_echo "Check for FFTW library libfftw3"
-GOT_FFTW=no
-FFTW_SETTING=no
-
-# Check whether --with-fftw-lib was given.
-if test "${with_fftw_lib+set}" = set; then :
-  withval=$with_fftw_lib; fftw_libdir="${withval}" GOT_FFTW=yes
-else
-  GOT_FFTW=no
-fi
-
-if test "$GOT_FFTW" = "yes" ; then
-        $as_echo "FFTW library location specified: $fftw_libdir - check if libfftw3 is there..."
-    save_LDFLAGS=$LDFLAGS
-    LDFLAGS="$LDFLAGS -L$fftw_libdir"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fftw_plan_dft_1d in -lfftw3" >&5
-$as_echo_n "checking for fftw_plan_dft_1d in -lfftw3... " >&6; }
-if ${ac_cv_lib_fftw3_fftw_plan_dft_1d+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lfftw3  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char fftw_plan_dft_1d ();
-int
-main ()
-{
-return fftw_plan_dft_1d ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_fftw3_fftw_plan_dft_1d=yes
-else
-  ac_cv_lib_fftw3_fftw_plan_dft_1d=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fftw3_fftw_plan_dft_1d" >&5
-$as_echo "$ac_cv_lib_fftw3_fftw_plan_dft_1d" >&6; }
-if test "x$ac_cv_lib_fftw3_fftw_plan_dft_1d" = xyes; then :
-  FFTW_SETTING=yes
-else
-  FFTW_SETTING=no
-fi
-
-    LDFLAGS="$save_LDFLAGS"
-    if test "$FFTW_SETTING" = "no"; then
-	as_fn_error $? "Did not find libfftw3 according to --with-fftw-lib - check the installation!" "$LINENO" 5
-    fi
-    libfftw_LIBS="-L$fftw_libdir -R $fftw_libdir -lfftw3"
-    libfftw_LDFLAGS="-L$fftw_libdir"
-else
-        $as_echo "Look for pkg-config FFTW package..."
-
-pkg_failed=no
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfftw3" >&5
-$as_echo_n "checking for libfftw3... " >&6; }
-
-if test -n "$libfftw3_CFLAGS"; then
-    pkg_cv_libfftw3_CFLAGS="$libfftw3_CFLAGS"
- elif test -n "$PKG_CONFIG"; then
-    if test -n "$PKG_CONFIG" && \
-    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"fftw3\""; } >&5
-  ($PKG_CONFIG --exists --print-errors "fftw3") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; then
-  pkg_cv_libfftw3_CFLAGS=`$PKG_CONFIG --cflags "fftw3" 2>/dev/null`
-		      test "x$?" != "x0" && pkg_failed=yes
-else
-  pkg_failed=yes
-fi
- else
-    pkg_failed=untried
-fi
-if test -n "$libfftw3_LIBS"; then
-    pkg_cv_libfftw3_LIBS="$libfftw3_LIBS"
- elif test -n "$PKG_CONFIG"; then
-    if test -n "$PKG_CONFIG" && \
-    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"fftw3\""; } >&5
-  ($PKG_CONFIG --exists --print-errors "fftw3") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; then
-  pkg_cv_libfftw3_LIBS=`$PKG_CONFIG --libs "fftw3" 2>/dev/null`
-		      test "x$?" != "x0" && pkg_failed=yes
-else
-  pkg_failed=yes
-fi
- else
-    pkg_failed=untried
-fi
-
-
-
-if test $pkg_failed = yes; then
-   	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-
-if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
-        _pkg_short_errors_supported=yes
-else
-        _pkg_short_errors_supported=no
-fi
-        if test $_pkg_short_errors_supported = yes; then
-	        libfftw3_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "fftw3" 2>&1`
-        else
-	        libfftw3_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "fftw3" 2>&1`
-        fi
-	# Put the nasty error message in config.log where it belongs
-	echo "$libfftw3_PKG_ERRORS" >&5
-
-	GOT_FFTW=no
-elif test $pkg_failed = untried; then
-     	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-	GOT_FFTW=no
-else
-	libfftw3_CFLAGS=$pkg_cv_libfftw3_CFLAGS
-	libfftw3_LIBS=$pkg_cv_libfftw3_LIBS
-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-	GOT_FFTW=yes
-fi
-    libfftw_LIBS="-lfftw3"
-    libfftw_LDFLAGS=""
-fi
-if test "$GOT_FFTW" = "no" ; then
-        $as_echo "Did not find FFTW library pkg-config package, looking in the usual places..."
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fftw_plan_dft_1d in -lfftw3" >&5
-$as_echo_n "checking for fftw_plan_dft_1d in -lfftw3... " >&6; }
-if ${ac_cv_lib_fftw3_fftw_plan_dft_1d+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lfftw3  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char fftw_plan_dft_1d ();
-int
-main ()
-{
-return fftw_plan_dft_1d ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_fftw3_fftw_plan_dft_1d=yes
-else
-  ac_cv_lib_fftw3_fftw_plan_dft_1d=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fftw3_fftw_plan_dft_1d" >&5
-$as_echo "$ac_cv_lib_fftw3_fftw_plan_dft_1d" >&6; }
-if test "x$ac_cv_lib_fftw3_fftw_plan_dft_1d" = xyes; then :
-  FFTW_SETTING=yes
-else
-  FFTW_SETTING=no
-fi
-
-    if test "$FFTW_SETTING" = "yes" ; then
-        GOT_FFTW=yes
-        $as_echo "Using pre-installed libfftw3..."
-        libfftw_LIBS="-lfftw3"
-        libfftw_LDFLAGS=""
-    else
-        $as_echo "Did not find FFTW library anywhere, use --with-fftw-lib to set the location"
-        as_fn_error $? "Did not find FFTW library anywhere, use --with-fftw-lib to set the location" "$LINENO" 5
-    fi
-fi
-
-$as_echo "Check for FFTW headers"
-GOT_FFTW=no
-FFTW_SETTING=no
-
-# Check whether --with-fftw-include was given.
-if test "${with_fftw_include+set}" = set; then :
-  withval=$with_fftw_include; libfftw_CPPFLAGS="-I${withval}" GOT_FFTW=yes
-else
-  GOT_FFTW=no
-fi
-
-if test "$GOT_FFTW" = "yes" ; then
-        $as_echo "FFTW header location specified: $libfftw_CPPFLAGS - check if fftw3.h is there..."
-    save_CPPFLAGS=$CPPFLAGS
-    save_CFLAGS=$CFLAGS
-    CPPFLAGS="$CPPFLAGS $libfftw_CPPFLAGS"
-    CFLAGS="$CFLAGS $libfftw_CPPFLAGS"
-    ac_fn_c_check_header_mongrel "$LINENO" "fftw3.h" "ac_cv_header_fftw3_h" "$ac_includes_default"
-if test "x$ac_cv_header_fftw3_h" = xyes; then :
-  FFTW_SETTING=yes
-else
-  FFTW_SETTING=no
-fi
-
-
-    CPPFLAGS=$save_CPPFLAGS
-    CFLAGS=$save_CFLAGS
-    if test "$FFTW_SETTING" = "no"; then
-	as_fn_error $? "Did not find fftw3.h according to --with-fftw-include - check the installation!" "$LINENO" 5
-    fi
-else
-        $as_echo "Looking for FFTW headers in the usual places..."
-    ac_fn_c_check_header_mongrel "$LINENO" "fftw3.h" "ac_cv_header_fftw3_h" "$ac_includes_default"
-if test "x$ac_cv_header_fftw3_h" = xyes; then :
-  FFTW_SETTING=yes
-else
-  FFTW_SETTING=no
-fi
-
-
-    if test "$FFTW_SETTING" = "yes" ; then
-        GOT_FFTW=yes
-        $as_echo "Using pre-installed FFTW headers..."
-    else
-        $as_echo "Did not find FFTW headers anywhere, use --with-fftw-include to set the location"
-        as_fn_error $? "Did not find FFTW headers anywhere, use --with-fftw-include to set the location" "$LINENO" 5
-    fi
-fi
-
-if test "$GOT_FFTW" = "yes" ; then
-    fftw_app=$USE_FFTW
-
-    libfftw_LIBS=$libfftw_LIBS
-
-    libfftw_CPPFLAGS=$libfftw_CPPFLAGS
-
-fi
- if test "$GOT_FFTW" = yes; then
-  BUILD_FFTW_TRUE=
-  BUILD_FFTW_FALSE='#'
-else
-  BUILD_FFTW_TRUE='#'
-  BUILD_FFTW_FALSE=
-fi
-
-
-
-$as_echo "Check for X11 libraries libX11 libXt and X11 header file X11/Intrinsic.h"
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for XtAppMainLoop in -lXt" >&5
-$as_echo_n "checking for XtAppMainLoop in -lXt... " >&6; }
-if ${ac_cv_lib_Xt_XtAppMainLoop+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lXt  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char XtAppMainLoop ();
-int
-main ()
-{
-return XtAppMainLoop ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_Xt_XtAppMainLoop=yes
-else
-  ac_cv_lib_Xt_XtAppMainLoop=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xt_XtAppMainLoop" >&5
-$as_echo "$ac_cv_lib_Xt_XtAppMainLoop" >&6; }
-if test "x$ac_cv_lib_Xt_XtAppMainLoop" = xyes; then :
-  GOT_X11=yes
-else
-  GOT_X11=no
-fi
-
-if test "$GOT_X11" = "yes" ; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XSendEvent in -lX11" >&5
-$as_echo_n "checking for XSendEvent in -lX11... " >&6; }
-if ${ac_cv_lib_X11_XSendEvent+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lX11  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char XSendEvent ();
-int
-main ()
-{
-return XSendEvent ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_X11_XSendEvent=yes
-else
-  ac_cv_lib_X11_XSendEvent=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_X11_XSendEvent" >&5
-$as_echo "$ac_cv_lib_X11_XSendEvent" >&6; }
-if test "x$ac_cv_lib_X11_XSendEvent" = xyes; then :
-  GOT_X11=yes
-else
-  GOT_X11=no
-fi
-
-fi
-if test "$GOT_X11" = "yes" ; then
-    ac_fn_c_check_header_mongrel "$LINENO" "X11/Intrinsic.h" "ac_cv_header_X11_Intrinsic_h" "$ac_includes_default"
-if test "x$ac_cv_header_X11_Intrinsic_h" = xyes; then :
-  GOT_X11=yes
-else
-  GOT_X11=no
-fi
-
-
-    if test "$GOT_X11" = "yes" ; then
-        $as_echo "Found X11 libraries libX11 libXt and X11 header file X11/Intrinsic.h"
-    else
-        $as_echo "Found X11 libraries libX11 libXt but did not find X11 header file X11/Intrinsic.h - graphical tools cannot be built"
-    fi
-else
-    $as_echo "Did not find X11 libraries libX11 libXt - graphical tools cannot be built"
-fi
-
-GOT_MOTIF=no
-MOTIF_SETTING=no
-if test "$GOT_X11" = "yes" ; then
-
-        $as_echo "Check for Motif library libXm"
-
-# Check whether --with-motif-lib was given.
-if test "${with_motif_lib+set}" = set; then :
-  withval=$with_motif_lib; motif_libdir="${withval}" GOT_MOTIF=yes
-else
-  GOT_MOTIF=no
-fi
-
-    if test "$GOT_MOTIF" = "yes" ; then
-                $as_echo "Motif library location specified: $motif_libdir - check if libXm is there..."
-        save_LDFLAGS=$LDFLAGS
-        LDFLAGS="$LDFLAGS -L$motif_libdir"
-        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XmCreatePushButton in -lXm" >&5
-$as_echo_n "checking for XmCreatePushButton in -lXm... " >&6; }
-if ${ac_cv_lib_Xm_XmCreatePushButton+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lXm  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char XmCreatePushButton ();
-int
-main ()
-{
-return XmCreatePushButton ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_Xm_XmCreatePushButton=yes
-else
-  ac_cv_lib_Xm_XmCreatePushButton=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xm_XmCreatePushButton" >&5
-$as_echo "$ac_cv_lib_Xm_XmCreatePushButton" >&6; }
-if test "x$ac_cv_lib_Xm_XmCreatePushButton" = xyes; then :
-  MOTIF_SETTING=yes
-else
-  MOTIF_SETTING=no
-fi
-
-        LDFLAGS="$save_LDFLAGS"
-        if test "$MOTIF_SETTING" = "no"; then
-            as_fn_error $? "Did not find libXm according to --with-motif-lib - check the installation!" "$LINENO" 5
-        fi
-        libmotif_LIBS="-L$motif_libdir -R $motif_libdir -lXm -lXt -lX11"
-        libmotif_LDFLAGS="-L$motif_libdir"
-    else
-                $as_echo "Look for pkg-config X11 package..."
-
-pkg_failed=no
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libXm" >&5
-$as_echo_n "checking for libXm... " >&6; }
-
-if test -n "$libXm_CFLAGS"; then
-    pkg_cv_libXm_CFLAGS="$libXm_CFLAGS"
- elif test -n "$PKG_CONFIG"; then
-    if test -n "$PKG_CONFIG" && \
-    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"openmotif\""; } >&5
-  ($PKG_CONFIG --exists --print-errors "openmotif") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; then
-  pkg_cv_libXm_CFLAGS=`$PKG_CONFIG --cflags "openmotif" 2>/dev/null`
-		      test "x$?" != "x0" && pkg_failed=yes
-else
-  pkg_failed=yes
-fi
- else
-    pkg_failed=untried
-fi
-if test -n "$libXm_LIBS"; then
-    pkg_cv_libXm_LIBS="$libXm_LIBS"
- elif test -n "$PKG_CONFIG"; then
-    if test -n "$PKG_CONFIG" && \
-    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"openmotif\""; } >&5
-  ($PKG_CONFIG --exists --print-errors "openmotif") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; then
-  pkg_cv_libXm_LIBS=`$PKG_CONFIG --libs "openmotif" 2>/dev/null`
-		      test "x$?" != "x0" && pkg_failed=yes
-else
-  pkg_failed=yes
-fi
- else
-    pkg_failed=untried
-fi
-
-
-
-if test $pkg_failed = yes; then
-   	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-
-if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
-        _pkg_short_errors_supported=yes
-else
-        _pkg_short_errors_supported=no
-fi
-        if test $_pkg_short_errors_supported = yes; then
-	        libXm_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "openmotif" 2>&1`
-        else
-	        libXm_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "openmotif" 2>&1`
-        fi
-	# Put the nasty error message in config.log where it belongs
-	echo "$libXm_PKG_ERRORS" >&5
-
-	GOT_MOTIF=no
-elif test $pkg_failed = untried; then
-     	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-	GOT_MOTIF=no
-else
-	libXm_CFLAGS=$pkg_cv_libXm_CFLAGS
-	libXm_LIBS=$pkg_cv_libXm_LIBS
-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-	GOT_MOTIF=yes
-fi
-        libmotif_LIBS="-lXm -lXt -lX11"
-        libmotif_LDFLAGS=""
-    fi
-    if test "$GOT_MOTIF" = "no" ; then
-                $as_echo "Did not find Motif library pkg-config package, looking in the usual places..."
-        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XmCreatePushButton in -lXm" >&5
-$as_echo_n "checking for XmCreatePushButton in -lXm... " >&6; }
-if ${ac_cv_lib_Xm_XmCreatePushButton+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lXm  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char XmCreatePushButton ();
-int
-main ()
-{
-return XmCreatePushButton ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_Xm_XmCreatePushButton=yes
-else
-  ac_cv_lib_Xm_XmCreatePushButton=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xm_XmCreatePushButton" >&5
-$as_echo "$ac_cv_lib_Xm_XmCreatePushButton" >&6; }
-if test "x$ac_cv_lib_Xm_XmCreatePushButton" = xyes; then :
-  MOTIF_SETTING=yes
-else
-  MOTIF_SETTING=no
-fi
-
-        if test "$MOTIF_SETTING" = "yes" ; then
-            GOT_MOTIF=yes
-            $as_echo "Using pre-installed libXm..."
-            libmotif_LIBS="-lXm -lXt -lX11"
-            libmotif_LDFLAGS=""
-        else
-            $as_echo "Did not find Motif library anywhere, use --with-motif-lib to set the location"
-            as_fn_error $? "Did not find Motif library anywhere, use --with-motif-lib to set the location" "$LINENO" 5
-        fi
-    fi
-
-    if test "$GOT_MOTIF" = "yes" ; then
-                $as_echo "Check for Motif headers"
-        GOT_MOTIF=no
-        MOTIF_SETTING=no
-
-# Check whether --with-motif-include was given.
-if test "${with_motif_include+set}" = set; then :
-  withval=$with_motif_include; libmotif_CPPFLAGS="-I${withval}" GOT_MOTIF=yes
-else
-  GOT_MOTIF=no
-fi
-
-        if test "$GOT_MOTIF" = "yes" ; then
-                        $as_echo "Motif header location specified: $libmotif_CPPFLAGS - check if Xm/Xm.h is there..."
-            save_CPPFLAGS=$CPPFLAGS
-            save_CFLAGS=$CFLAGS
-            CPPFLAGS="$CPPFLAGS $libmotif_CPPFLAGS"
-            CFLAGS="$CFLAGS $libmotif_CPPFLAGS"
-            ac_fn_c_check_header_mongrel "$LINENO" "Xm/Xm.h" "ac_cv_header_Xm_Xm_h" "$ac_includes_default"
-if test "x$ac_cv_header_Xm_Xm_h" = xyes; then :
-  MOTIF_SETTING=yes
-else
-  MOTIF_SETTING=no
-fi
-
-
-            CPPFLAGS=$save_CPPFLAGS
-            CFLAGS=$save_CFLAGS
-            if test "$MOTIF_SETTING" = "no"; then
-                as_fn_error $? "Did not find Xm/Xm.h according to --with-motif-include - check the installation!" "$LINENO" 5
-            fi
-        else
-                        $as_echo "Looking for Motif headers in the usual places..."
-            ac_fn_c_check_header_mongrel "$LINENO" "Xm/Xm.h" "ac_cv_header_Xm_Xm_h" "$ac_includes_default"
-if test "x$ac_cv_header_Xm_Xm_h" = xyes; then :
-  MOTIF_SETTING=yes
-else
-  MOTIF_SETTING=no
-fi
-
-
-            if test "$MOTIF_SETTING" = "yes" ; then
-                GOT_MOTIF=yes
-                $as_echo "Using pre-installed Motif headers..."
-            else
-                $as_echo "Did not find Motif headers anywhere, use --with-motif-include to set the location"
-                as_fn_error $? "Did not find Motif headers anywhere, use --with-motif-include to set the location" "$LINENO" 5
-            fi
-        fi
-            fi
-
-        libmotif_LIBS=$libmotif_LIBS
-
-    libmotif_CPPFLAGS=$libmotif_CPPFLAGS
-
-
-else
-        $as_echo "Failed to find X11 libraries and headers - unable to build graphical tools"
-fi
-
- if test "$GOT_MOTIF" = yes; then
-  BUILD_MOTIF_TRUE=
-  BUILD_MOTIF_FALSE='#'
-else
-  BUILD_MOTIF_TRUE='#'
-  BUILD_MOTIF_FALSE=
-fi
-
-
-$as_echo "Check for OpenGL libraries libGL libGLU and header files GL/gl.h GL/glu.h GL/glx.h"
-GOT_OPENGL=no
-OPENGL_SETTING=no
-if test "$GOT_MOTIF" = "yes" ; then
-
-        $as_echo "Check for OpenGL libraries libGLU libGL"
-
-# Check whether --with-opengl-lib was given.
-if test "${with_opengl_lib+set}" = set; then :
-  withval=$with_opengl_lib; opengl_libdir="${withval}" GOT_OPENGL=yes
-else
-  GOT_OPENGL=no
-fi
-
-    if test "$GOT_OPENGL" = "yes" ; then
-                $as_echo "OpenGL library location specified: $opengl_libdir - check if libGL libGLU are there..."
-        save_LDFLAGS=$LDFLAGS
-        LDFLAGS="$LDFLAGS -L$opengl_libdir"
-        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lGLU" >&5
-$as_echo_n "checking for main in -lGLU... " >&6; }
-if ${ac_cv_lib_GLU_main+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lGLU  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-
-int
-main ()
-{
-return main ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_GLU_main=yes
-else
-  ac_cv_lib_GLU_main=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_GLU_main" >&5
-$as_echo "$ac_cv_lib_GLU_main" >&6; }
-if test "x$ac_cv_lib_GLU_main" = xyes; then :
-  OPENGL_SETTING=yes
-else
-  OPENGL_SETTING=no
-fi
-
-        if test "$OPENGL_SETTING" = "yes"; then
-            { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lGL" >&5
-$as_echo_n "checking for main in -lGL... " >&6; }
-if ${ac_cv_lib_GL_main+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lGL  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-
-int
-main ()
-{
-return main ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_GL_main=yes
-else
-  ac_cv_lib_GL_main=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_GL_main" >&5
-$as_echo "$ac_cv_lib_GL_main" >&6; }
-if test "x$ac_cv_lib_GL_main" = xyes; then :
-  OPENGL_SETTING=yes
-else
-  OPENGL_SETTING=no
-fi
-
-        fi
-        LDFLAGS="$save_LDFLAGS"
-        if test "$OPENGL_SETTING" = "no"; then
-            as_fn_error $? "Did not find libGLU libGL according to --with-opengl-lib - check the installation!" "$LINENO" 5
-        fi
-        libopengl_LIBS="-L$opengl_libdir -R $opengl_libdir -lGL -lGLU"
-        libopengl_LDFLAGS="-L$opengl_libdir"
-    else
-                $as_echo "Look for pkg-config OpenGL package..."
-
-pkg_failed=no
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libGLU" >&5
-$as_echo_n "checking for libGLU... " >&6; }
-
-if test -n "$libGLU_CFLAGS"; then
-    pkg_cv_libGLU_CFLAGS="$libGLU_CFLAGS"
- elif test -n "$PKG_CONFIG"; then
-    if test -n "$PKG_CONFIG" && \
-    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"opengl\""; } >&5
-  ($PKG_CONFIG --exists --print-errors "opengl") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; then
-  pkg_cv_libGLU_CFLAGS=`$PKG_CONFIG --cflags "opengl" 2>/dev/null`
-		      test "x$?" != "x0" && pkg_failed=yes
-else
-  pkg_failed=yes
-fi
- else
-    pkg_failed=untried
-fi
-if test -n "$libGLU_LIBS"; then
-    pkg_cv_libGLU_LIBS="$libGLU_LIBS"
- elif test -n "$PKG_CONFIG"; then
-    if test -n "$PKG_CONFIG" && \
-    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"opengl\""; } >&5
-  ($PKG_CONFIG --exists --print-errors "opengl") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; then
-  pkg_cv_libGLU_LIBS=`$PKG_CONFIG --libs "opengl" 2>/dev/null`
-		      test "x$?" != "x0" && pkg_failed=yes
-else
-  pkg_failed=yes
-fi
- else
-    pkg_failed=untried
-fi
-
-
-
-if test $pkg_failed = yes; then
-   	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-
-if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
-        _pkg_short_errors_supported=yes
-else
-        _pkg_short_errors_supported=no
-fi
-        if test $_pkg_short_errors_supported = yes; then
-	        libGLU_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "opengl" 2>&1`
-        else
-	        libGLU_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "opengl" 2>&1`
-        fi
-	# Put the nasty error message in config.log where it belongs
-	echo "$libGLU_PKG_ERRORS" >&5
-
-	GOT_OPENGL=no
-elif test $pkg_failed = untried; then
-     	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-	GOT_OPENGL=no
-else
-	libGLU_CFLAGS=$pkg_cv_libGLU_CFLAGS
-	libGLU_LIBS=$pkg_cv_libGLU_LIBS
-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-	GOT_OPENGL=yes
-fi
-        libopengl_LIBS="-lGL -lGLU"
-        libopengl_LDFLAGS=""
-    fi
-    if test "$GOT_OPENGL" = "no" ; then
-                $as_echo "Did not find OpenGL library pkg-config package, looking in the usual places..."
-        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lGLU" >&5
-$as_echo_n "checking for main in -lGLU... " >&6; }
-if ${ac_cv_lib_GLU_main+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lGLU  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-
-int
-main ()
-{
-return main ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_GLU_main=yes
-else
-  ac_cv_lib_GLU_main=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_GLU_main" >&5
-$as_echo "$ac_cv_lib_GLU_main" >&6; }
-if test "x$ac_cv_lib_GLU_main" = xyes; then :
-  OPENGL_SETTING=yes
-else
-  OPENGL_SETTING=no
-fi
-
-        if test "$OPENGL_SETTING" = "yes" ; then
-            { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lGL" >&5
-$as_echo_n "checking for main in -lGL... " >&6; }
-if ${ac_cv_lib_GL_main+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lGL  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-
-int
-main ()
-{
-return main ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_GL_main=yes
-else
-  ac_cv_lib_GL_main=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_GL_main" >&5
-$as_echo "$ac_cv_lib_GL_main" >&6; }
-if test "x$ac_cv_lib_GL_main" = xyes; then :
-  OPENGL_SETTING=yes
-else
-  OPENGL_SETTING=no
-fi
-
-        fi
-        if test "$OPENGL_SETTING" = "yes" ; then
-            GOT_OPENGL=yes
-            $as_echo "Using pre-installed libGLU libGL..."
-            libopengl_LIBS="-lGL -lGLU"
-            libopengl_LDFLAGS=""
-        else
-            $as_echo "Did not find OpenGL library anywhere, use --with-opengl-lib to set the location"
-            as_fn_error $? "Did not find OpenGL library anywhere, use --with-opengl-lib to set the location" "$LINENO" 5
-        fi
-    fi
-
-    if test "$GOT_OPENGL" = "yes" ; then
-                $as_echo "Check for OpenGL headers"
-        GOT_OPENGL=no
-        OPENGL_SETTING=no
-
-# Check whether --with-opengl-include was given.
-if test "${with_opengl_include+set}" = set; then :
-  withval=$with_opengl_include; libopengl_CPPFLAGS="-I${withval}" GOT_OPENGL=yes
-else
-  GOT_OPENGL=no
-fi
-
-        if test "$GOT_OPENGL" = "yes" ; then
-                        $as_echo "OpenGL header location specified: $libopengl_CPPFLAGS - check if Xm/Xm.h is there..."
-            save_CPPFLAGS=$CPPFLAGS
-            save_CFLAGS=$CFLAGS
-            CPPFLAGS="$CPPFLAGS $libopengl_CPPFLAGS"
-            CFLAGS="$CFLAGS $libopengl_CPPFLAGS"
-            ac_fn_c_check_header_mongrel "$LINENO" "Xm/Xm.h" "ac_cv_header_Xm_Xm_h" "$ac_includes_default"
-if test "x$ac_cv_header_Xm_Xm_h" = xyes; then :
-  OPENGL_SETTING=yes
-else
-  OPENGL_SETTING=no
-fi
-
-
-            CPPFLAGS=$save_CPPFLAGS
-            CFLAGS=$save_CFLAGS
-            if test "$OPENGL_SETTING" = "no"; then
-                as_fn_error $? "Did not find Xm/Xm.h according to --with-opengl-include - check the installation!" "$LINENO" 5
-            fi
-        else
-                        $as_echo "Looking for OpenGL headers in the usual places..."
-            ac_fn_c_check_header_mongrel "$LINENO" "Xm/Xm.h" "ac_cv_header_Xm_Xm_h" "$ac_includes_default"
-if test "x$ac_cv_header_Xm_Xm_h" = xyes; then :
-  OPENGL_SETTING=yes
-else
-  OPENGL_SETTING=no
-fi
-
-
-            if test "$OPENGL_SETTING" = "yes" ; then
-                GOT_OPENGL=yes
-                $as_echo "Using pre-installed OpenGL headers..."
-            else
-                $as_echo "Did not find OpenGL headers anywhere, use --with-opengl-include to set the location"
-                as_fn_error $? "Did not find OpenGL headers anywhere, use --with-opengl-include to set the location" "$LINENO" 5
-            fi
-        fi
-            fi
-
-        libopengl_LIBS=$libopengl_LIBS
-
-    libopengl_CPPFLAGS=$libopengl_CPPFLAGS
-
-    if test "$GOT_OPENGL" = "yes" ; then
-
-$as_echo "#define GOT_GL 1" >>confdefs.h
-
-    fi
-     if test "$GOT_OPENGL" = yes; then
-  BUILD_GL_TRUE=
-  BUILD_GL_FALSE='#'
-else
-  BUILD_GL_TRUE='#'
-  BUILD_GL_FALSE=
-fi
-
-
-else
-        $as_echo "Failed to find Motif libraries and headers - did not look for OpenGL libraries and headers - unable to build visualization tools"
-fi
-
-
-mbsystemdatadir="$datadir/$PACKAGE"
-
-mbsystemhtmldir="$docdir/html"
-
-mbsystempsdir="$docdir/ps"
-
-
-
-$as_echo " "
-$as_echo "About to create Makefiles..."
-ac_config_files="$ac_config_files Makefile src/Makefile src/mbio/Makefile src/surf/Makefile src/bsio/Makefile src/gsf/Makefile src/mbaux/Makefile src/utilities/Makefile src/gmt/Makefile src/macros/Makefile src/mbedit/Makefile src/mbnavedit/Makefile src/mbvelocitytool/Makefile src/mbnavadjust/Makefile src/otps/Makefile src/mbview/Makefile src/mbgrdviz/Makefile src/mbeditviz/Makefile src/man/Makefile src/man/man1/Makefile src/man/man3/Makefile src/html/Makefile src/ps/Makefile src/share/Makefile"
-
-if test "$bundledproj" = "yes" ; then
-ac_config_files="$ac_config_files src/proj/Makefile"
-
-fi
-
-
-test "x$prefix" = xNONE && prefix=$ac_default_prefix
-# Let make expand exec_prefix.
-test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
-
-DEFS=-DHAVE_CONFIG_H
-
-ac_libobjs=
-ac_ltlibobjs=
-U=
-for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
-  # 1. Remove the extension, and $U if already installed.
-  ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
-  ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
-  # 2. Prepend LIBOBJDIR.  When used with automake>=1.10 LIBOBJDIR
-  #    will be set to the directory where LIBOBJS objects are built.
-  as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
-  as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
-done
-LIBOBJS=$ac_libobjs
-
-LTLIBOBJS=$ac_ltlibobjs
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5
-$as_echo_n "checking that generated files are newer than configure... " >&6; }
-   if test -n "$am_sleep_pid"; then
-     # Hide warnings about reused PIDs.
-     wait $am_sleep_pid 2>/dev/null
-   fi
-   { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5
-$as_echo "done" >&6; }
- if test -n "$EXEEXT"; then
-  am__EXEEXT_TRUE=
-  am__EXEEXT_FALSE='#'
-else
-  am__EXEEXT_TRUE='#'
-  am__EXEEXT_FALSE=
-fi
-
-if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then
-  as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
-  as_fn_error $? "conditional \"AMDEP\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
-  as_fn_error $? "conditional \"am__fastdepCC\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${am__fastdepCCAS_TRUE}" && test -z "${am__fastdepCCAS_FALSE}"; then
-  as_fn_error $? "conditional \"am__fastdepCCAS\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${BUILD_PROJ_TRUE}" && test -z "${BUILD_PROJ_FALSE}"; then
-  as_fn_error $? "conditional \"BUILD_PROJ\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${BUILD_FFTW_TRUE}" && test -z "${BUILD_FFTW_FALSE}"; then
-  as_fn_error $? "conditional \"BUILD_FFTW\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${BUILD_MOTIF_TRUE}" && test -z "${BUILD_MOTIF_FALSE}"; then
-  as_fn_error $? "conditional \"BUILD_MOTIF\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${BUILD_GL_TRUE}" && test -z "${BUILD_GL_FALSE}"; then
-  as_fn_error $? "conditional \"BUILD_GL\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-
-: "${CONFIG_STATUS=./config.status}"
-ac_write_fail=0
-ac_clean_files_save=$ac_clean_files
-ac_clean_files="$ac_clean_files $CONFIG_STATUS"
-{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
-$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
-as_write_fail=0
-cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
-#! $SHELL
-# Generated by $as_me.
-# Run this file to recreate the current configuration.
-# Compiler output produced by configure, useful for debugging
-# configure, is in config.log if it exists.
-
-debug=false
-ac_cs_recheck=false
-ac_cs_silent=false
-
-SHELL=\${CONFIG_SHELL-$SHELL}
-export SHELL
-_ASEOF
-cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
-## -------------------- ##
-## M4sh Initialization. ##
-## -------------------- ##
-
-# Be more Bourne compatible
-DUALCASE=1; export DUALCASE # for MKS sh
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
-  emulate sh
-  NULLCMD=:
-  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
-  # is contrary to our usage.  Disable this feature.
-  alias -g '${1+"$@"}'='"$@"'
-  setopt NO_GLOB_SUBST
-else
-  case `(set -o) 2>/dev/null` in #(
-  *posix*) :
-    set -o posix ;; #(
-  *) :
-     ;;
-esac
-fi
-
-
-as_nl='
-'
-export as_nl
-# Printing a long string crashes Solaris 7 /usr/bin/printf.
-as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
-# Prefer a ksh shell builtin over an external printf program on Solaris,
-# but without wasting forks for bash or zsh.
-if test -z "$BASH_VERSION$ZSH_VERSION" \
-    && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
-  as_echo='print -r --'
-  as_echo_n='print -rn --'
-elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
-  as_echo='printf %s\n'
-  as_echo_n='printf %s'
-else
-  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
-    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
-    as_echo_n='/usr/ucb/echo -n'
-  else
-    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
-    as_echo_n_body='eval
-      arg=$1;
-      case $arg in #(
-      *"$as_nl"*)
-	expr "X$arg" : "X\\(.*\\)$as_nl";
-	arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
-      esac;
-      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
-    '
-    export as_echo_n_body
-    as_echo_n='sh -c $as_echo_n_body as_echo'
-  fi
-  export as_echo_body
-  as_echo='sh -c $as_echo_body as_echo'
-fi
-
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
-  PATH_SEPARATOR=:
-  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
-    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
-      PATH_SEPARATOR=';'
-  }
-fi
-
-
-# IFS
-# We need space, tab and new line, in precisely that order.  Quoting is
-# there to prevent editors from complaining about space-tab.
-# (If _AS_PATH_WALK were called with IFS unset, it would disable word
-# splitting by setting IFS to empty value.)
-IFS=" ""	$as_nl"
-
-# Find who we are.  Look in the path if we contain no directory separator.
-as_myself=
-case $0 in #((
-  *[\\/]* ) as_myself=$0 ;;
-  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
-  done
-IFS=$as_save_IFS
-
-     ;;
-esac
-# We did not find ourselves, most probably we were run as `sh COMMAND'
-# in which case we are not to be found in the path.
-if test "x$as_myself" = x; then
-  as_myself=$0
-fi
-if test ! -f "$as_myself"; then
-  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
-  exit 1
-fi
-
-# Unset variables that we do not need and which cause bugs (e.g. in
-# pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the "|| exit 1"
-# suppresses any "Segmentation fault" message there.  '((' could
-# trigger a bug in pdksh 5.2.14.
-for as_var in BASH_ENV ENV MAIL MAILPATH
-do eval test x\${$as_var+set} = xset \
-  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
-done
-PS1='$ '
-PS2='> '
-PS4='+ '
-
-# NLS nuisances.
-LC_ALL=C
-export LC_ALL
-LANGUAGE=C
-export LANGUAGE
-
-# CDPATH.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-
-# as_fn_error STATUS ERROR [LINENO LOG_FD]
-# ----------------------------------------
-# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
-# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
-# script with STATUS, using 1 if that was 0.
-as_fn_error ()
-{
-  as_status=$1; test $as_status -eq 0 && as_status=1
-  if test "$4"; then
-    as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-    $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
-  fi
-  $as_echo "$as_me: error: $2" >&2
-  as_fn_exit $as_status
-} # as_fn_error
-
-
-# as_fn_set_status STATUS
-# -----------------------
-# Set $? to STATUS, without forking.
-as_fn_set_status ()
-{
-  return $1
-} # as_fn_set_status
-
-# as_fn_exit STATUS
-# -----------------
-# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
-as_fn_exit ()
-{
-  set +e
-  as_fn_set_status $1
-  exit $1
-} # as_fn_exit
-
-# as_fn_unset VAR
-# ---------------
-# Portably unset VAR.
-as_fn_unset ()
-{
-  { eval $1=; unset $1;}
-}
-as_unset=as_fn_unset
-# as_fn_append VAR VALUE
-# ----------------------
-# Append the text in VALUE to the end of the definition contained in VAR. Take
-# advantage of any shell optimizations that allow amortized linear growth over
-# repeated appends, instead of the typical quadratic growth present in naive
-# implementations.
-if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
-  eval 'as_fn_append ()
-  {
-    eval $1+=\$2
-  }'
-else
-  as_fn_append ()
-  {
-    eval $1=\$$1\$2
-  }
-fi # as_fn_append
-
-# as_fn_arith ARG...
-# ------------------
-# Perform arithmetic evaluation on the ARGs, and store the result in the
-# global $as_val. Take advantage of shells that can avoid forks. The arguments
-# must be portable across $(()) and expr.
-if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
-  eval 'as_fn_arith ()
-  {
-    as_val=$(( $* ))
-  }'
-else
-  as_fn_arith ()
-  {
-    as_val=`expr "$@" || test $? -eq 1`
-  }
-fi # as_fn_arith
-
-
-if expr a : '\(a\)' >/dev/null 2>&1 &&
-   test "X`expr 00001 : '.*\(...\)'`" = X001; then
-  as_expr=expr
-else
-  as_expr=false
-fi
-
-if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
-  as_basename=basename
-else
-  as_basename=false
-fi
-
-if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
-  as_dirname=dirname
-else
-  as_dirname=false
-fi
-
-as_me=`$as_basename -- "$0" ||
-$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
-	 X"$0" : 'X\(//\)$' \| \
-	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X/"$0" |
-    sed '/^.*\/\([^/][^/]*\)\/*$/{
-	    s//\1/
-	    q
-	  }
-	  /^X\/\(\/\/\)$/{
-	    s//\1/
-	    q
-	  }
-	  /^X\/\(\/\).*/{
-	    s//\1/
-	    q
-	  }
-	  s/.*/./; q'`
-
-# Avoid depending upon Character Ranges.
-as_cr_letters='abcdefghijklmnopqrstuvwxyz'
-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
-as_cr_Letters=$as_cr_letters$as_cr_LETTERS
-as_cr_digits='0123456789'
-as_cr_alnum=$as_cr_Letters$as_cr_digits
-
-ECHO_C= ECHO_N= ECHO_T=
-case `echo -n x` in #(((((
--n*)
-  case `echo 'xy\c'` in
-  *c*) ECHO_T='	';;	# ECHO_T is single tab character.
-  xy)  ECHO_C='\c';;
-  *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null
-       ECHO_T='	';;
-  esac;;
-*)
-  ECHO_N='-n';;
-esac
-
-rm -f conf$$ conf$$.exe conf$$.file
-if test -d conf$$.dir; then
-  rm -f conf$$.dir/conf$$.file
-else
-  rm -f conf$$.dir
-  mkdir conf$$.dir 2>/dev/null
-fi
-if (echo >conf$$.file) 2>/dev/null; then
-  if ln -s conf$$.file conf$$ 2>/dev/null; then
-    as_ln_s='ln -s'
-    # ... but there are two gotchas:
-    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
-    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
-    # In both cases, we have to default to `cp -pR'.
-    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
-      as_ln_s='cp -pR'
-  elif ln conf$$.file conf$$ 2>/dev/null; then
-    as_ln_s=ln
-  else
-    as_ln_s='cp -pR'
-  fi
-else
-  as_ln_s='cp -pR'
-fi
-rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
-rmdir conf$$.dir 2>/dev/null
-
-
-# as_fn_mkdir_p
-# -------------
-# Create "$as_dir" as a directory, including parents if necessary.
-as_fn_mkdir_p ()
-{
-
-  case $as_dir in #(
-  -*) as_dir=./$as_dir;;
-  esac
-  test -d "$as_dir" || eval $as_mkdir_p || {
-    as_dirs=
-    while :; do
-      case $as_dir in #(
-      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
-      *) as_qdir=$as_dir;;
-      esac
-      as_dirs="'$as_qdir' $as_dirs"
-      as_dir=`$as_dirname -- "$as_dir" ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-	 X"$as_dir" : 'X\(//\)[^/]' \| \
-	 X"$as_dir" : 'X\(//\)$' \| \
-	 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$as_dir" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
-	    s//\1/
-	    q
-	  }
-	  /^X\(\/\/\)[^/].*/{
-	    s//\1/
-	    q
-	  }
-	  /^X\(\/\/\)$/{
-	    s//\1/
-	    q
-	  }
-	  /^X\(\/\).*/{
-	    s//\1/
-	    q
-	  }
-	  s/.*/./; q'`
-      test -d "$as_dir" && break
-    done
-    test -z "$as_dirs" || eval "mkdir $as_dirs"
-  } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
-
-
-} # as_fn_mkdir_p
-if mkdir -p . 2>/dev/null; then
-  as_mkdir_p='mkdir -p "$as_dir"'
-else
-  test -d ./-p && rmdir ./-p
-  as_mkdir_p=false
-fi
-
-
-# as_fn_executable_p FILE
-# -----------------------
-# Test if FILE is an executable regular file.
-as_fn_executable_p ()
-{
-  test -f "$1" && test -x "$1"
-} # as_fn_executable_p
-as_test_x='test -x'
-as_executable_p=as_fn_executable_p
-
-# Sed expression to map a string onto a valid CPP name.
-as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
-
-# Sed expression to map a string onto a valid variable name.
-as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
-
-
-exec 6>&1
-## ----------------------------------- ##
-## Main body of $CONFIG_STATUS script. ##
-## ----------------------------------- ##
-_ASEOF
-test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
-
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-# Save the log message, to keep $0 and so on meaningful, and to
-# report actual input values of CONFIG_FILES etc. instead of their
-# values after options handling.
-ac_log="
-This file was extended by mbsystem $as_me 5.5.2252, which was
-generated by GNU Autoconf 2.69.  Invocation command line was
-
-  CONFIG_FILES    = $CONFIG_FILES
-  CONFIG_HEADERS  = $CONFIG_HEADERS
-  CONFIG_LINKS    = $CONFIG_LINKS
-  CONFIG_COMMANDS = $CONFIG_COMMANDS
-  $ $0 $@
-
-on `(hostname || uname -n) 2>/dev/null | sed 1q`
-"
-
-_ACEOF
-
-case $ac_config_files in *"
-"*) set x $ac_config_files; shift; ac_config_files=$*;;
-esac
-
-case $ac_config_headers in *"
-"*) set x $ac_config_headers; shift; ac_config_headers=$*;;
-esac
-
-
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-# Files that config.status was made for.
-config_files="$ac_config_files"
-config_headers="$ac_config_headers"
-config_commands="$ac_config_commands"
-
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-ac_cs_usage="\
-\`$as_me' instantiates files and other configuration actions
-from templates according to the current configuration.  Unless the files
-and actions are specified as TAGs, all are instantiated by default.
-
-Usage: $0 [OPTION]... [TAG]...
-
-  -h, --help       print this help, then exit
-  -V, --version    print version number and configuration settings, then exit
-      --config     print configuration, then exit
-  -q, --quiet, --silent
-                   do not print progress messages
-  -d, --debug      don't remove temporary files
-      --recheck    update $as_me by reconfiguring in the same conditions
-      --file=FILE[:TEMPLATE]
-                   instantiate the configuration file FILE
-      --header=FILE[:TEMPLATE]
-                   instantiate the configuration header FILE
-
-Configuration files:
-$config_files
-
-Configuration headers:
-$config_headers
-
-Configuration commands:
-$config_commands
-
-Report bugs to <http://listserver.mbari.org/sympa/arc/mbsystem>.
-mbsystem home page: <http://www.mbari.org/data/mbsystem/>."
-
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
-ac_cs_version="\\
-mbsystem config.status 5.5.2252
-configured by $0, generated by GNU Autoconf 2.69,
-  with options \\"\$ac_cs_config\\"
-
-Copyright (C) 2012 Free Software Foundation, Inc.
-This config.status script is free software; the Free Software Foundation
-gives unlimited permission to copy, distribute and modify it."
-
-ac_pwd='$ac_pwd'
-srcdir='$srcdir'
-INSTALL='$INSTALL'
-MKDIR_P='$MKDIR_P'
-AWK='$AWK'
-test -n "\$AWK" || AWK=awk
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-# The default lists apply if the user does not specify any file.
-ac_need_defaults=:
-while test $# != 0
-do
-  case $1 in
-  --*=?*)
-    ac_option=`expr "X$1" : 'X\([^=]*\)='`
-    ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
-    ac_shift=:
-    ;;
-  --*=)
-    ac_option=`expr "X$1" : 'X\([^=]*\)='`
-    ac_optarg=
-    ac_shift=:
-    ;;
-  *)
-    ac_option=$1
-    ac_optarg=$2
-    ac_shift=shift
-    ;;
-  esac
-
-  case $ac_option in
-  # Handling of the options.
-  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
-    ac_cs_recheck=: ;;
-  --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
-    $as_echo "$ac_cs_version"; exit ;;
-  --config | --confi | --conf | --con | --co | --c )
-    $as_echo "$ac_cs_config"; exit ;;
-  --debug | --debu | --deb | --de | --d | -d )
-    debug=: ;;
-  --file | --fil | --fi | --f )
-    $ac_shift
-    case $ac_optarg in
-    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
-    '') as_fn_error $? "missing file argument" ;;
-    esac
-    as_fn_append CONFIG_FILES " '$ac_optarg'"
-    ac_need_defaults=false;;
-  --header | --heade | --head | --hea )
-    $ac_shift
-    case $ac_optarg in
-    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
-    esac
-    as_fn_append CONFIG_HEADERS " '$ac_optarg'"
-    ac_need_defaults=false;;
-  --he | --h)
-    # Conflict between --help and --header
-    as_fn_error $? "ambiguous option: \`$1'
-Try \`$0 --help' for more information.";;
-  --help | --hel | -h )
-    $as_echo "$ac_cs_usage"; exit ;;
-  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
-  | -silent | --silent | --silen | --sile | --sil | --si | --s)
-    ac_cs_silent=: ;;
-
-  # This is an error.
-  -*) as_fn_error $? "unrecognized option: \`$1'
-Try \`$0 --help' for more information." ;;
-
-  *) as_fn_append ac_config_targets " $1"
-     ac_need_defaults=false ;;
-
-  esac
-  shift
-done
-
-ac_configure_extra_args=
-
-if $ac_cs_silent; then
-  exec 6>/dev/null
-  ac_configure_extra_args="$ac_configure_extra_args --silent"
-fi
-
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-if \$ac_cs_recheck; then
-  set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
-  shift
-  \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
-  CONFIG_SHELL='$SHELL'
-  export CONFIG_SHELL
-  exec "\$@"
-fi
-
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-exec 5>>config.log
-{
-  echo
-  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
-## Running $as_me. ##
-_ASBOX
-  $as_echo "$ac_log"
-} >&5
-
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-#
-# INIT-COMMANDS
-#
-AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
-
-
-# The HP-UX ksh and POSIX shell print the target directory to stdout
-# if CDPATH is set.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-sed_quote_subst='$sed_quote_subst'
-double_quote_subst='$double_quote_subst'
-delay_variable_subst='$delay_variable_subst'
-macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`'
-macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`'
-enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`'
-enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`'
-pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`'
-enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`'
-shared_archive_member_spec='`$ECHO "$shared_archive_member_spec" | $SED "$delay_single_quote_subst"`'
-SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`'
-ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`'
-PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`'
-host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`'
-host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`'
-host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`'
-build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`'
-build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`'
-build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`'
-SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`'
-Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`'
-GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`'
-EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`'
-FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`'
-LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`'
-NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`'
-LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`'
-max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`'
-ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`'
-exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`'
-lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`'
-lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`'
-lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`'
-lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`'
-lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`'
-reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`'
-reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`'
-OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`'
-deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`'
-file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`'
-file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`'
-want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`'
-DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`'
-sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`'
-AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`'
-AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`'
-archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`'
-STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`'
-RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`'
-old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`'
-old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`'
-old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`'
-lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`'
-CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`'
-CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`'
-compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`'
-GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`'
-lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`'
-lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`'
-lt_cv_sys_global_symbol_to_import='`$ECHO "$lt_cv_sys_global_symbol_to_import" | $SED "$delay_single_quote_subst"`'
-lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`'
-lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`'
-lt_cv_nm_interface='`$ECHO "$lt_cv_nm_interface" | $SED "$delay_single_quote_subst"`'
-nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`'
-lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`'
-lt_cv_truncate_bin='`$ECHO "$lt_cv_truncate_bin" | $SED "$delay_single_quote_subst"`'
-objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`'
-MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`'
-lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`'
-lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`'
-lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`'
-lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`'
-lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`'
-need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`'
-MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`'
-DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`'
-NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`'
-LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`'
-OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`'
-OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`'
-libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`'
-shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`'
-extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`'
-archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`'
-enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`'
-export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`'
-whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`'
-compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`'
-old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`'
-old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`'
-archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`'
-archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`'
-module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`'
-module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`'
-with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`'
-allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`'
-no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`'
-hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`'
-hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`'
-hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`'
-hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`'
-hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`'
-hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`'
-hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`'
-inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`'
-link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`'
-always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`'
-export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`'
-exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`'
-include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`'
-prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`'
-postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`'
-file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`'
-variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`'
-need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`'
-need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`'
-version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`'
-runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`'
-shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`'
-shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`'
-libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`'
-library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`'
-soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`'
-install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`'
-postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`'
-postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`'
-finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`'
-finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`'
-hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`'
-sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`'
-configure_time_dlsearch_path='`$ECHO "$configure_time_dlsearch_path" | $SED "$delay_single_quote_subst"`'
-configure_time_lt_sys_library_path='`$ECHO "$configure_time_lt_sys_library_path" | $SED "$delay_single_quote_subst"`'
-hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`'
-enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`'
-enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`'
-enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`'
-old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`'
-striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`'
-
-LTCC='$LTCC'
-LTCFLAGS='$LTCFLAGS'
-compiler='$compiler_DEFAULT'
-
-# A function that is used when there is no print builtin or printf.
-func_fallback_echo ()
-{
-  eval 'cat <<_LTECHO_EOF
-\$1
-_LTECHO_EOF'
-}
-
-# Quote evaled strings.
-for var in SHELL \
-ECHO \
-PATH_SEPARATOR \
-SED \
-GREP \
-EGREP \
-FGREP \
-LD \
-NM \
-LN_S \
-lt_SP2NL \
-lt_NL2SP \
-reload_flag \
-OBJDUMP \
-deplibs_check_method \
-file_magic_cmd \
-file_magic_glob \
-want_nocaseglob \
-DLLTOOL \
-sharedlib_from_linklib_cmd \
-AR \
-AR_FLAGS \
-archiver_list_spec \
-STRIP \
-RANLIB \
-CC \
-CFLAGS \
-compiler \
-lt_cv_sys_global_symbol_pipe \
-lt_cv_sys_global_symbol_to_cdecl \
-lt_cv_sys_global_symbol_to_import \
-lt_cv_sys_global_symbol_to_c_name_address \
-lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \
-lt_cv_nm_interface \
-nm_file_list_spec \
-lt_cv_truncate_bin \
-lt_prog_compiler_no_builtin_flag \
-lt_prog_compiler_pic \
-lt_prog_compiler_wl \
-lt_prog_compiler_static \
-lt_cv_prog_compiler_c_o \
-need_locks \
-MANIFEST_TOOL \
-DSYMUTIL \
-NMEDIT \
-LIPO \
-OTOOL \
-OTOOL64 \
-shrext_cmds \
-export_dynamic_flag_spec \
-whole_archive_flag_spec \
-compiler_needs_object \
-with_gnu_ld \
-allow_undefined_flag \
-no_undefined_flag \
-hardcode_libdir_flag_spec \
-hardcode_libdir_separator \
-exclude_expsyms \
-include_expsyms \
-file_list_spec \
-variables_saved_for_relink \
-libname_spec \
-library_names_spec \
-soname_spec \
-install_override_mode \
-finish_eval \
-old_striplib \
-striplib; do
-    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
-    *[\\\\\\\`\\"\\\$]*)
-      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
-      ;;
-    *)
-      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
-      ;;
-    esac
-done
-
-# Double-quote double-evaled strings.
-for var in reload_cmds \
-old_postinstall_cmds \
-old_postuninstall_cmds \
-old_archive_cmds \
-extract_expsyms_cmds \
-old_archive_from_new_cmds \
-old_archive_from_expsyms_cmds \
-archive_cmds \
-archive_expsym_cmds \
-module_cmds \
-module_expsym_cmds \
-export_symbols_cmds \
-prelink_cmds \
-postlink_cmds \
-postinstall_cmds \
-postuninstall_cmds \
-finish_cmds \
-sys_lib_search_path_spec \
-configure_time_dlsearch_path \
-configure_time_lt_sys_library_path; do
-    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
-    *[\\\\\\\`\\"\\\$]*)
-      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
-      ;;
-    *)
-      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
-      ;;
-    esac
-done
-
-ac_aux_dir='$ac_aux_dir'
-
-# See if we are running on zsh, and set the options that allow our
-# commands through without removal of \ escapes INIT.
-if test -n "\${ZSH_VERSION+set}"; then
-   setopt NO_GLOB_SUBST
-fi
-
-
-    PACKAGE='$PACKAGE'
-    VERSION='$VERSION'
-    RM='$RM'
-    ofile='$ofile'
-
-
-
-
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-
-# Handling of arguments.
-for ac_config_target in $ac_config_targets
-do
-  case $ac_config_target in
-    "src/mbio/mb_config.h") CONFIG_HEADERS="$CONFIG_HEADERS src/mbio/mb_config.h" ;;
-    "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
-    "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
-    "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
-    "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
-    "src/mbio/Makefile") CONFIG_FILES="$CONFIG_FILES src/mbio/Makefile" ;;
-    "src/surf/Makefile") CONFIG_FILES="$CONFIG_FILES src/surf/Makefile" ;;
-    "src/bsio/Makefile") CONFIG_FILES="$CONFIG_FILES src/bsio/Makefile" ;;
-    "src/gsf/Makefile") CONFIG_FILES="$CONFIG_FILES src/gsf/Makefile" ;;
-    "src/mbaux/Makefile") CONFIG_FILES="$CONFIG_FILES src/mbaux/Makefile" ;;
-    "src/utilities/Makefile") CONFIG_FILES="$CONFIG_FILES src/utilities/Makefile" ;;
-    "src/gmt/Makefile") CONFIG_FILES="$CONFIG_FILES src/gmt/Makefile" ;;
-    "src/macros/Makefile") CONFIG_FILES="$CONFIG_FILES src/macros/Makefile" ;;
-    "src/mbedit/Makefile") CONFIG_FILES="$CONFIG_FILES src/mbedit/Makefile" ;;
-    "src/mbnavedit/Makefile") CONFIG_FILES="$CONFIG_FILES src/mbnavedit/Makefile" ;;
-    "src/mbvelocitytool/Makefile") CONFIG_FILES="$CONFIG_FILES src/mbvelocitytool/Makefile" ;;
-    "src/mbnavadjust/Makefile") CONFIG_FILES="$CONFIG_FILES src/mbnavadjust/Makefile" ;;
-    "src/otps/Makefile") CONFIG_FILES="$CONFIG_FILES src/otps/Makefile" ;;
-    "src/mbview/Makefile") CONFIG_FILES="$CONFIG_FILES src/mbview/Makefile" ;;
-    "src/mbgrdviz/Makefile") CONFIG_FILES="$CONFIG_FILES src/mbgrdviz/Makefile" ;;
-    "src/mbeditviz/Makefile") CONFIG_FILES="$CONFIG_FILES src/mbeditviz/Makefile" ;;
-    "src/man/Makefile") CONFIG_FILES="$CONFIG_FILES src/man/Makefile" ;;
-    "src/man/man1/Makefile") CONFIG_FILES="$CONFIG_FILES src/man/man1/Makefile" ;;
-    "src/man/man3/Makefile") CONFIG_FILES="$CONFIG_FILES src/man/man3/Makefile" ;;
-    "src/html/Makefile") CONFIG_FILES="$CONFIG_FILES src/html/Makefile" ;;
-    "src/ps/Makefile") CONFIG_FILES="$CONFIG_FILES src/ps/Makefile" ;;
-    "src/share/Makefile") CONFIG_FILES="$CONFIG_FILES src/share/Makefile" ;;
-    "src/proj/Makefile") CONFIG_FILES="$CONFIG_FILES src/proj/Makefile" ;;
-
-  *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
-  esac
-done
-
-
-# If the user did not use the arguments to specify the items to instantiate,
-# then the envvar interface is used.  Set only those that are not.
-# We use the long form for the default assignment because of an extremely
-# bizarre bug on SunOS 4.1.3.
-if $ac_need_defaults; then
-  test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
-  test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
-  test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
-fi
-
-# Have a temporary directory for convenience.  Make it in the build tree
-# simply because there is no reason against having it here, and in addition,
-# creating and moving files from /tmp can sometimes cause problems.
-# Hook for its removal unless debugging.
-# Note that there is a small window in which the directory will not be cleaned:
-# after its creation but before its name has been assigned to `$tmp'.
-$debug ||
-{
-  tmp= ac_tmp=
-  trap 'exit_status=$?
-  : "${ac_tmp:=$tmp}"
-  { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
-' 0
-  trap 'as_fn_exit 1' 1 2 13 15
-}
-# Create a (secure) tmp directory for tmp files.
-
-{
-  tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
-  test -d "$tmp"
-}  ||
-{
-  tmp=./conf$$-$RANDOM
-  (umask 077 && mkdir "$tmp")
-} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
-ac_tmp=$tmp
-
-# Set up the scripts for CONFIG_FILES section.
-# No need to generate them if there are no CONFIG_FILES.
-# This happens for instance with `./config.status config.h'.
-if test -n "$CONFIG_FILES"; then
-
-
-ac_cr=`echo X | tr X '\015'`
-# On cygwin, bash can eat \r inside `` if the user requested igncr.
-# But we know of no other shell where ac_cr would be empty at this
-# point, so we can use a bashism as a fallback.
-if test "x$ac_cr" = x; then
-  eval ac_cr=\$\'\\r\'
-fi
-ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
-if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
-  ac_cs_awk_cr='\\r'
-else
-  ac_cs_awk_cr=$ac_cr
-fi
-
-echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
-_ACEOF
-
-
-{
-  echo "cat >conf$$subs.awk <<_ACEOF" &&
-  echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
-  echo "_ACEOF"
-} >conf$$subs.sh ||
-  as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
-ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
-ac_delim='%!_!# '
-for ac_last_try in false false false false false :; do
-  . ./conf$$subs.sh ||
-    as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
-
-  ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
-  if test $ac_delim_n = $ac_delim_num; then
-    break
-  elif $ac_last_try; then
-    as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
-  else
-    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
-  fi
-done
-rm -f conf$$subs.sh
-
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
-_ACEOF
-sed -n '
-h
-s/^/S["/; s/!.*/"]=/
-p
-g
-s/^[^!]*!//
-:repl
-t repl
-s/'"$ac_delim"'$//
-t delim
-:nl
-h
-s/\(.\{148\}\)..*/\1/
-t more1
-s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
-p
-n
-b repl
-:more1
-s/["\\]/\\&/g; s/^/"/; s/$/"\\/
-p
-g
-s/.\{148\}//
-t nl
-:delim
-h
-s/\(.\{148\}\)..*/\1/
-t more2
-s/["\\]/\\&/g; s/^/"/; s/$/"/
-p
-b
-:more2
-s/["\\]/\\&/g; s/^/"/; s/$/"\\/
-p
-g
-s/.\{148\}//
-t delim
-' <conf$$subs.awk | sed '
-/^[^""]/{
-  N
-  s/\n//
-}
-' >>$CONFIG_STATUS || ac_write_fail=1
-rm -f conf$$subs.awk
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-_ACAWK
-cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
-  for (key in S) S_is_set[key] = 1
-  FS = ""
-
-}
-{
-  line = $ 0
-  nfields = split(line, field, "@")
-  substed = 0
-  len = length(field[1])
-  for (i = 2; i < nfields; i++) {
-    key = field[i]
-    keylen = length(key)
-    if (S_is_set[key]) {
-      value = S[key]
-      line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
-      len += length(value) + length(field[++i])
-      substed = 1
-    } else
-      len += 1 + keylen
-  }
-
-  print line
-}
-
-_ACAWK
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
-  sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
-else
-  cat
-fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
-  || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
-_ACEOF
-
-# VPATH may cause trouble with some makes, so we remove sole $(srcdir),
-# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and
-# trailing colons and then remove the whole line if VPATH becomes empty
-# (actually we leave an empty line to preserve line numbers).
-if test "x$srcdir" = x.; then
-  ac_vpsub='/^[	 ]*VPATH[	 ]*=[	 ]*/{
-h
-s///
-s/^/:/
-s/[	 ]*$/:/
-s/:\$(srcdir):/:/g
-s/:\${srcdir}:/:/g
-s/:@srcdir@:/:/g
-s/^:*//
-s/:*$//
-x
-s/\(=[	 ]*\).*/\1/
-G
-s/\n//
-s/^[^=]*=[	 ]*$//
-}'
-fi
-
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-fi # test -n "$CONFIG_FILES"
-
-# Set up the scripts for CONFIG_HEADERS section.
-# No need to generate them if there are no CONFIG_HEADERS.
-# This happens for instance with `./config.status Makefile'.
-if test -n "$CONFIG_HEADERS"; then
-cat >"$ac_tmp/defines.awk" <<\_ACAWK ||
-BEGIN {
-_ACEOF
-
-# Transform confdefs.h into an awk script `defines.awk', embedded as
-# here-document in config.status, that substitutes the proper values into
-# config.h.in to produce config.h.
-
-# Create a delimiter string that does not exist in confdefs.h, to ease
-# handling of long lines.
-ac_delim='%!_!# '
-for ac_last_try in false false :; do
-  ac_tt=`sed -n "/$ac_delim/p" confdefs.h`
-  if test -z "$ac_tt"; then
-    break
-  elif $ac_last_try; then
-    as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
-  else
-    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
-  fi
-done
-
-# For the awk script, D is an array of macro values keyed by name,
-# likewise P contains macro parameters if any.  Preserve backslash
-# newline sequences.
-
-ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
-sed -n '
-s/.\{148\}/&'"$ac_delim"'/g
-t rset
-:rset
-s/^[	 ]*#[	 ]*define[	 ][	 ]*/ /
-t def
-d
-:def
-s/\\$//
-t bsnl
-s/["\\]/\\&/g
-s/^ \('"$ac_word_re"'\)\(([^()]*)\)[	 ]*\(.*\)/P["\1"]="\2"\
-D["\1"]=" \3"/p
-s/^ \('"$ac_word_re"'\)[	 ]*\(.*\)/D["\1"]=" \2"/p
-d
-:bsnl
-s/["\\]/\\&/g
-s/^ \('"$ac_word_re"'\)\(([^()]*)\)[	 ]*\(.*\)/P["\1"]="\2"\
-D["\1"]=" \3\\\\\\n"\\/p
-t cont
-s/^ \('"$ac_word_re"'\)[	 ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p
-t cont
-d
-:cont
-n
-s/.\{148\}/&'"$ac_delim"'/g
-t clear
-:clear
-s/\\$//
-t bsnlc
-s/["\\]/\\&/g; s/^/"/; s/$/"/p
-d
-:bsnlc
-s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p
-b cont
-' <confdefs.h | sed '
-s/'"$ac_delim"'/"\\\
-"/g' >>$CONFIG_STATUS || ac_write_fail=1
-
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-  for (key in D) D_is_set[key] = 1
-  FS = ""
-}
-/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {
-  line = \$ 0
-  split(line, arg, " ")
-  if (arg[1] == "#") {
-    defundef = arg[2]
-    mac1 = arg[3]
-  } else {
-    defundef = substr(arg[1], 2)
-    mac1 = arg[2]
-  }
-  split(mac1, mac2, "(") #)
-  macro = mac2[1]
-  prefix = substr(line, 1, index(line, defundef) - 1)
-  if (D_is_set[macro]) {
-    # Preserve the white space surrounding the "#".
-    print prefix "define", macro P[macro] D[macro]
-    next
-  } else {
-    # Replace #undef with comments.  This is necessary, for example,
-    # in the case of _POSIX_SOURCE, which is predefined and required
-    # on some systems where configure will not decide to define it.
-    if (defundef == "undef") {
-      print "/*", prefix defundef, macro, "*/"
-      next
-    }
-  }
-}
-{ print }
-_ACAWK
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-  as_fn_error $? "could not setup config headers machinery" "$LINENO" 5
-fi # test -n "$CONFIG_HEADERS"
-
-
-eval set X "  :F $CONFIG_FILES  :H $CONFIG_HEADERS    :C $CONFIG_COMMANDS"
-shift
-for ac_tag
-do
-  case $ac_tag in
-  :[FHLC]) ac_mode=$ac_tag; continue;;
-  esac
-  case $ac_mode$ac_tag in
-  :[FHL]*:*);;
-  :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
-  :[FH]-) ac_tag=-:-;;
-  :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
-  esac
-  ac_save_IFS=$IFS
-  IFS=:
-  set x $ac_tag
-  IFS=$ac_save_IFS
-  shift
-  ac_file=$1
-  shift
-
-  case $ac_mode in
-  :L) ac_source=$1;;
-  :[FH])
-    ac_file_inputs=
-    for ac_f
-    do
-      case $ac_f in
-      -) ac_f="$ac_tmp/stdin";;
-      *) # Look for the file first in the build tree, then in the source tree
-	 # (if the path is not absolute).  The absolute path cannot be DOS-style,
-	 # because $ac_f cannot contain `:'.
-	 test -f "$ac_f" ||
-	   case $ac_f in
-	   [\\/$]*) false;;
-	   *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
-	   esac ||
-	   as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
-      esac
-      case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
-      as_fn_append ac_file_inputs " '$ac_f'"
-    done
-
-    # Let's still pretend it is `configure' which instantiates (i.e., don't
-    # use $as_me), people would be surprised to read:
-    #    /* config.h.  Generated by config.status.  */
-    configure_input='Generated from '`
-	  $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
-	`' by configure.'
-    if test x"$ac_file" != x-; then
-      configure_input="$ac_file.  $configure_input"
-      { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
-$as_echo "$as_me: creating $ac_file" >&6;}
-    fi
-    # Neutralize special characters interpreted by sed in replacement strings.
-    case $configure_input in #(
-    *\&* | *\|* | *\\* )
-       ac_sed_conf_input=`$as_echo "$configure_input" |
-       sed 's/[\\\\&|]/\\\\&/g'`;; #(
-    *) ac_sed_conf_input=$configure_input;;
-    esac
-
-    case $ac_tag in
-    *:-:* | *:-) cat >"$ac_tmp/stdin" \
-      || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
-    esac
-    ;;
-  esac
-
-  ac_dir=`$as_dirname -- "$ac_file" ||
-$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-	 X"$ac_file" : 'X\(//\)[^/]' \| \
-	 X"$ac_file" : 'X\(//\)$' \| \
-	 X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$ac_file" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
-	    s//\1/
-	    q
-	  }
-	  /^X\(\/\/\)[^/].*/{
-	    s//\1/
-	    q
-	  }
-	  /^X\(\/\/\)$/{
-	    s//\1/
-	    q
-	  }
-	  /^X\(\/\).*/{
-	    s//\1/
-	    q
-	  }
-	  s/.*/./; q'`
-  as_dir="$ac_dir"; as_fn_mkdir_p
-  ac_builddir=.
-
-case "$ac_dir" in
-.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
-*)
-  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
-  # A ".." for each directory in $ac_dir_suffix.
-  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
-  case $ac_top_builddir_sub in
-  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
-  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
-  esac ;;
-esac
-ac_abs_top_builddir=$ac_pwd
-ac_abs_builddir=$ac_pwd$ac_dir_suffix
-# for backward compatibility:
-ac_top_builddir=$ac_top_build_prefix
-
-case $srcdir in
-  .)  # We are building in place.
-    ac_srcdir=.
-    ac_top_srcdir=$ac_top_builddir_sub
-    ac_abs_top_srcdir=$ac_pwd ;;
-  [\\/]* | ?:[\\/]* )  # Absolute name.
-    ac_srcdir=$srcdir$ac_dir_suffix;
-    ac_top_srcdir=$srcdir
-    ac_abs_top_srcdir=$srcdir ;;
-  *) # Relative name.
-    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
-    ac_top_srcdir=$ac_top_build_prefix$srcdir
-    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
-esac
-ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
-
-
-  case $ac_mode in
-  :F)
-  #
-  # CONFIG_FILE
-  #
-
-  case $INSTALL in
-  [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
-  *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
-  esac
-  ac_MKDIR_P=$MKDIR_P
-  case $MKDIR_P in
-  [\\/$]* | ?:[\\/]* ) ;;
-  */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
-  esac
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-# If the template does not know about datarootdir, expand it.
-# FIXME: This hack should be removed a few years after 2.60.
-ac_datarootdir_hack=; ac_datarootdir_seen=
-ac_sed_dataroot='
-/datarootdir/ {
-  p
-  q
-}
-/@datadir@/p
-/@docdir@/p
-/@infodir@/p
-/@localedir@/p
-/@mandir@/p'
-case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
-*datarootdir*) ac_datarootdir_seen=yes;;
-*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
-  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
-$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-  ac_datarootdir_hack='
-  s&@datadir@&$datadir&g
-  s&@docdir@&$docdir&g
-  s&@infodir@&$infodir&g
-  s&@localedir@&$localedir&g
-  s&@mandir@&$mandir&g
-  s&\\\${datarootdir}&$datarootdir&g' ;;
-esac
-_ACEOF
-
-# Neutralize VPATH when `$srcdir' = `.'.
-# Shell code in configure.ac might set extrasub.
-# FIXME: do we really want to maintain this feature?
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-ac_sed_extra="$ac_vpsub
-$extrasub
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-:t
-/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
-s|@configure_input@|$ac_sed_conf_input|;t t
-s&@top_builddir@&$ac_top_builddir_sub&;t t
-s&@top_build_prefix@&$ac_top_build_prefix&;t t
-s&@srcdir@&$ac_srcdir&;t t
-s&@abs_srcdir@&$ac_abs_srcdir&;t t
-s&@top_srcdir@&$ac_top_srcdir&;t t
-s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
-s&@builddir@&$ac_builddir&;t t
-s&@abs_builddir@&$ac_abs_builddir&;t t
-s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
-s&@INSTALL@&$ac_INSTALL&;t t
-s&@MKDIR_P@&$ac_MKDIR_P&;t t
-$ac_datarootdir_hack
-"
-eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
-  >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
-
-test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
-  { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
-  { ac_out=`sed -n '/^[	 ]*datarootdir[	 ]*:*=/p' \
-      "$ac_tmp/out"`; test -z "$ac_out"; } &&
-  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
-which seems to be undefined.  Please make sure it is defined" >&5
-$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
-which seems to be undefined.  Please make sure it is defined" >&2;}
-
-  rm -f "$ac_tmp/stdin"
-  case $ac_file in
-  -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
-  *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
-  esac \
-  || as_fn_error $? "could not create $ac_file" "$LINENO" 5
- ;;
-  :H)
-  #
-  # CONFIG_HEADER
-  #
-  if test x"$ac_file" != x-; then
-    {
-      $as_echo "/* $configure_input  */" \
-      && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs"
-    } >"$ac_tmp/config.h" \
-      || as_fn_error $? "could not create $ac_file" "$LINENO" 5
-    if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
-$as_echo "$as_me: $ac_file is unchanged" >&6;}
-    else
-      rm -f "$ac_file"
-      mv "$ac_tmp/config.h" "$ac_file" \
-	|| as_fn_error $? "could not create $ac_file" "$LINENO" 5
-    fi
-  else
-    $as_echo "/* $configure_input  */" \
-      && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \
-      || as_fn_error $? "could not create -" "$LINENO" 5
-  fi
-# Compute "$ac_file"'s index in $config_headers.
-_am_arg="$ac_file"
-_am_stamp_count=1
-for _am_header in $config_headers :; do
-  case $_am_header in
-    $_am_arg | $_am_arg:* )
-      break ;;
-    * )
-      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
-  esac
-done
-echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" ||
-$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-	 X"$_am_arg" : 'X\(//\)[^/]' \| \
-	 X"$_am_arg" : 'X\(//\)$' \| \
-	 X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$_am_arg" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
-	    s//\1/
-	    q
-	  }
-	  /^X\(\/\/\)[^/].*/{
-	    s//\1/
-	    q
-	  }
-	  /^X\(\/\/\)$/{
-	    s//\1/
-	    q
-	  }
-	  /^X\(\/\).*/{
-	    s//\1/
-	    q
-	  }
-	  s/.*/./; q'`/stamp-h$_am_stamp_count
- ;;
-
-  :C)  { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5
-$as_echo "$as_me: executing $ac_file commands" >&6;}
- ;;
-  esac
-
-
-  case $ac_file$ac_mode in
-    "depfiles":C) test x"$AMDEP_TRUE" != x"" || {
-  # Older Autoconf quotes --file arguments for eval, but not when files
-  # are listed without --file.  Let's play safe and only enable the eval
-  # if we detect the quoting.
-  case $CONFIG_FILES in
-  *\'*) eval set x "$CONFIG_FILES" ;;
-  *)   set x $CONFIG_FILES ;;
-  esac
-  shift
-  for mf
-  do
-    # Strip MF so we end up with the name of the file.
-    mf=`echo "$mf" | sed -e 's/:.*$//'`
-    # Check whether this is an Automake generated Makefile or not.
-    # We used to match only the files named 'Makefile.in', but
-    # some people rename them; so instead we look at the file content.
-    # Grep'ing the first line is not enough: some people post-process
-    # each Makefile.in and add a new line on top of each file to say so.
-    # Grep'ing the whole file is not good either: AIX grep has a line
-    # limit of 2048, but all sed's we know have understand at least 4000.
-    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
-      dirpart=`$as_dirname -- "$mf" ||
-$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-	 X"$mf" : 'X\(//\)[^/]' \| \
-	 X"$mf" : 'X\(//\)$' \| \
-	 X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$mf" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
-	    s//\1/
-	    q
-	  }
-	  /^X\(\/\/\)[^/].*/{
-	    s//\1/
-	    q
-	  }
-	  /^X\(\/\/\)$/{
-	    s//\1/
-	    q
-	  }
-	  /^X\(\/\).*/{
-	    s//\1/
-	    q
-	  }
-	  s/.*/./; q'`
-    else
-      continue
-    fi
-    # Extract the definition of DEPDIR, am__include, and am__quote
-    # from the Makefile without running 'make'.
-    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
-    test -z "$DEPDIR" && continue
-    am__include=`sed -n 's/^am__include = //p' < "$mf"`
-    test -z "$am__include" && continue
-    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
-    # Find all dependency output files, they are included files with
-    # $(DEPDIR) in their names.  We invoke sed twice because it is the
-    # simplest approach to changing $(DEPDIR) to its actual value in the
-    # expansion.
-    for file in `sed -n "
-      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
-	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
-      # Make sure the directory exists.
-      test -f "$dirpart/$file" && continue
-      fdir=`$as_dirname -- "$file" ||
-$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-	 X"$file" : 'X\(//\)[^/]' \| \
-	 X"$file" : 'X\(//\)$' \| \
-	 X"$file" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$file" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
-	    s//\1/
-	    q
-	  }
-	  /^X\(\/\/\)[^/].*/{
-	    s//\1/
-	    q
-	  }
-	  /^X\(\/\/\)$/{
-	    s//\1/
-	    q
-	  }
-	  /^X\(\/\).*/{
-	    s//\1/
-	    q
-	  }
-	  s/.*/./; q'`
-      as_dir=$dirpart/$fdir; as_fn_mkdir_p
-      # echo "creating $dirpart/$file"
-      echo '# dummy' > "$dirpart/$file"
-    done
-  done
-}
- ;;
-    "libtool":C)
-
-    # See if we are running on zsh, and set the options that allow our
-    # commands through without removal of \ escapes.
-    if test -n "${ZSH_VERSION+set}"; then
-      setopt NO_GLOB_SUBST
-    fi
-
-    cfgfile=${ofile}T
-    trap "$RM \"$cfgfile\"; exit 1" 1 2 15
-    $RM "$cfgfile"
-
-    cat <<_LT_EOF >> "$cfgfile"
-#! $SHELL
-# Generated automatically by $as_me ($PACKAGE) $VERSION
-# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
-# NOTE: Changes made to this file will be lost: look at ltmain.sh.
-
-# Provide generalized library-building support services.
-# Written by Gordon Matzigkeit, 1996
-
-# Copyright (C) 2014 Free Software Foundation, Inc.
-# This is free software; see the source for copying conditions.  There is NO
-# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
-# GNU Libtool is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of of the License, or
-# (at your option) any later version.
-#
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program or library that is built
-# using GNU Libtool, you may include this file under the  same
-# distribution terms that you use for the rest of that program.
-#
-# GNU Libtool is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-
-# The names of the tagged configurations supported by this script.
-available_tags=''
-
-# Configured defaults for sys_lib_dlsearch_path munging.
-: \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"}
-
-# ### BEGIN LIBTOOL CONFIG
-
-# Which release of libtool.m4 was used?
-macro_version=$macro_version
-macro_revision=$macro_revision
-
-# Whether or not to build shared libraries.
-build_libtool_libs=$enable_shared
-
-# Whether or not to build static libraries.
-build_old_libs=$enable_static
-
-# What type of objects to build.
-pic_mode=$pic_mode
-
-# Whether or not to optimize for fast installation.
-fast_install=$enable_fast_install
-
-# Shared archive member basename,for filename based shared library versioning on AIX.
-shared_archive_member_spec=$shared_archive_member_spec
-
-# Shell to use when invoking shell scripts.
-SHELL=$lt_SHELL
-
-# An echo program that protects backslashes.
-ECHO=$lt_ECHO
-
-# The PATH separator for the build system.
-PATH_SEPARATOR=$lt_PATH_SEPARATOR
-
-# The host system.
-host_alias=$host_alias
-host=$host
-host_os=$host_os
-
-# The build system.
-build_alias=$build_alias
-build=$build
-build_os=$build_os
-
-# A sed program that does not truncate output.
-SED=$lt_SED
-
-# Sed that helps us avoid accidentally triggering echo(1) options like -n.
-Xsed="\$SED -e 1s/^X//"
-
-# A grep program that handles long lines.
-GREP=$lt_GREP
-
-# An ERE matcher.
-EGREP=$lt_EGREP
-
-# A literal string matcher.
-FGREP=$lt_FGREP
-
-# A BSD- or MS-compatible name lister.
-NM=$lt_NM
-
-# Whether we need soft or hard links.
-LN_S=$lt_LN_S
-
-# What is the maximum length of a command?
-max_cmd_len=$max_cmd_len
-
-# Object file suffix (normally "o").
-objext=$ac_objext
-
-# Executable file suffix (normally "").
-exeext=$exeext
-
-# whether the shell understands "unset".
-lt_unset=$lt_unset
-
-# turn spaces into newlines.
-SP2NL=$lt_lt_SP2NL
-
-# turn newlines into spaces.
-NL2SP=$lt_lt_NL2SP
-
-# convert \$build file names to \$host format.
-to_host_file_cmd=$lt_cv_to_host_file_cmd
-
-# convert \$build files to toolchain format.
-to_tool_file_cmd=$lt_cv_to_tool_file_cmd
-
-# An object symbol dumper.
-OBJDUMP=$lt_OBJDUMP
-
-# Method to check whether dependent libraries are shared objects.
-deplibs_check_method=$lt_deplibs_check_method
-
-# Command to use when deplibs_check_method = "file_magic".
-file_magic_cmd=$lt_file_magic_cmd
-
-# How to find potential files when deplibs_check_method = "file_magic".
-file_magic_glob=$lt_file_magic_glob
-
-# Find potential files using nocaseglob when deplibs_check_method = "file_magic".
-want_nocaseglob=$lt_want_nocaseglob
-
-# DLL creation program.
-DLLTOOL=$lt_DLLTOOL
-
-# Command to associate shared and link libraries.
-sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd
-
-# The archiver.
-AR=$lt_AR
-
-# Flags to create an archive.
-AR_FLAGS=$lt_AR_FLAGS
-
-# How to feed a file listing to the archiver.
-archiver_list_spec=$lt_archiver_list_spec
-
-# A symbol stripping program.
-STRIP=$lt_STRIP
-
-# Commands used to install an old-style archive.
-RANLIB=$lt_RANLIB
-old_postinstall_cmds=$lt_old_postinstall_cmds
-old_postuninstall_cmds=$lt_old_postuninstall_cmds
-
-# Whether to use a lock for old archive extraction.
-lock_old_archive_extraction=$lock_old_archive_extraction
-
-# A C compiler.
-LTCC=$lt_CC
-
-# LTCC compiler flags.
-LTCFLAGS=$lt_CFLAGS
-
-# Take the output of nm and produce a listing of raw symbols and C names.
-global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
-
-# Transform the output of nm in a proper C declaration.
-global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
-
-# Transform the output of nm into a list of symbols to manually relocate.
-global_symbol_to_import=$lt_lt_cv_sys_global_symbol_to_import
-
-# Transform the output of nm in a C name address pair.
-global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
-
-# Transform the output of nm in a C name address pair when lib prefix is needed.
-global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix
-
-# The name lister interface.
-nm_interface=$lt_lt_cv_nm_interface
-
-# Specify filename containing input files for \$NM.
-nm_file_list_spec=$lt_nm_file_list_spec
-
-# The root where to search for dependent libraries,and where our libraries should be installed.
-lt_sysroot=$lt_sysroot
-
-# Command to truncate a binary pipe.
-lt_truncate_bin=$lt_lt_cv_truncate_bin
-
-# The name of the directory that contains temporary libtool files.
-objdir=$objdir
-
-# Used to examine libraries when file_magic_cmd begins with "file".
-MAGIC_CMD=$MAGIC_CMD
-
-# Must we lock files when doing compilation?
-need_locks=$lt_need_locks
-
-# Manifest tool.
-MANIFEST_TOOL=$lt_MANIFEST_TOOL
-
-# Tool to manipulate archived DWARF debug symbol files on Mac OS X.
-DSYMUTIL=$lt_DSYMUTIL
-
-# Tool to change global to local symbols on Mac OS X.
-NMEDIT=$lt_NMEDIT
-
-# Tool to manipulate fat objects and archives on Mac OS X.
-LIPO=$lt_LIPO
-
-# ldd/readelf like tool for Mach-O binaries on Mac OS X.
-OTOOL=$lt_OTOOL
-
-# ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4.
-OTOOL64=$lt_OTOOL64
-
-# Old archive suffix (normally "a").
-libext=$libext
-
-# Shared library suffix (normally ".so").
-shrext_cmds=$lt_shrext_cmds
-
-# The commands to extract the exported symbol list from a shared archive.
-extract_expsyms_cmds=$lt_extract_expsyms_cmds
-
-# Variables whose values should be saved in libtool wrapper scripts and
-# restored at link time.
-variables_saved_for_relink=$lt_variables_saved_for_relink
-
-# Do we need the "lib" prefix for modules?
-need_lib_prefix=$need_lib_prefix
-
-# Do we need a version for libraries?
-need_version=$need_version
-
-# Library versioning type.
-version_type=$version_type
-
-# Shared library runtime path variable.
-runpath_var=$runpath_var
-
-# Shared library path variable.
-shlibpath_var=$shlibpath_var
-
-# Is shlibpath searched before the hard-coded library search path?
-shlibpath_overrides_runpath=$shlibpath_overrides_runpath
-
-# Format of library name prefix.
-libname_spec=$lt_libname_spec
-
-# List of archive names.  First name is the real one, the rest are links.
-# The last name is the one that the linker finds with -lNAME
-library_names_spec=$lt_library_names_spec
-
-# The coded name of the library, if different from the real name.
-soname_spec=$lt_soname_spec
-
-# Permission mode override for installation of shared libraries.
-install_override_mode=$lt_install_override_mode
-
-# Command to use after installation of a shared archive.
-postinstall_cmds=$lt_postinstall_cmds
-
-# Command to use after uninstallation of a shared archive.
-postuninstall_cmds=$lt_postuninstall_cmds
-
-# Commands used to finish a libtool library installation in a directory.
-finish_cmds=$lt_finish_cmds
-
-# As "finish_cmds", except a single script fragment to be evaled but
-# not shown.
-finish_eval=$lt_finish_eval
-
-# Whether we should hardcode library paths into libraries.
-hardcode_into_libs=$hardcode_into_libs
-
-# Compile-time system search path for libraries.
-sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
-
-# Detected run-time system search path for libraries.
-sys_lib_dlsearch_path_spec=$lt_configure_time_dlsearch_path
-
-# Explicit LT_SYS_LIBRARY_PATH set during ./configure time.
-configure_time_lt_sys_library_path=$lt_configure_time_lt_sys_library_path
-
-# Whether dlopen is supported.
-dlopen_support=$enable_dlopen
-
-# Whether dlopen of programs is supported.
-dlopen_self=$enable_dlopen_self
-
-# Whether dlopen of statically linked programs is supported.
-dlopen_self_static=$enable_dlopen_self_static
-
-# Commands to strip libraries.
-old_striplib=$lt_old_striplib
-striplib=$lt_striplib
-
-
-# The linker used to build libraries.
-LD=$lt_LD
-
-# How to create reloadable object files.
-reload_flag=$lt_reload_flag
-reload_cmds=$lt_reload_cmds
-
-# Commands used to build an old-style archive.
-old_archive_cmds=$lt_old_archive_cmds
-
-# A language specific compiler.
-CC=$lt_compiler
-
-# Is the compiler the GNU compiler?
-with_gcc=$GCC
-
-# Compiler flag to turn off builtin functions.
-no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag
-
-# Additional compiler flags for building library objects.
-pic_flag=$lt_lt_prog_compiler_pic
-
-# How to pass a linker flag through the compiler.
-wl=$lt_lt_prog_compiler_wl
-
-# Compiler flag to prevent dynamic linking.
-link_static_flag=$lt_lt_prog_compiler_static
-
-# Does compiler simultaneously support -c and -o options?
-compiler_c_o=$lt_lt_cv_prog_compiler_c_o
-
-# Whether or not to add -lc for building shared libraries.
-build_libtool_need_lc=$archive_cmds_need_lc
-
-# Whether or not to disallow shared libs when runtime libs are static.
-allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes
-
-# Compiler flag to allow reflexive dlopens.
-export_dynamic_flag_spec=$lt_export_dynamic_flag_spec
-
-# Compiler flag to generate shared objects directly from archives.
-whole_archive_flag_spec=$lt_whole_archive_flag_spec
-
-# Whether the compiler copes with passing no objects directly.
-compiler_needs_object=$lt_compiler_needs_object
-
-# Create an old-style archive from a shared archive.
-old_archive_from_new_cmds=$lt_old_archive_from_new_cmds
-
-# Create a temporary old-style archive to link instead of a shared archive.
-old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds
-
-# Commands used to build a shared archive.
-archive_cmds=$lt_archive_cmds
-archive_expsym_cmds=$lt_archive_expsym_cmds
-
-# Commands used to build a loadable module if different from building
-# a shared archive.
-module_cmds=$lt_module_cmds
-module_expsym_cmds=$lt_module_expsym_cmds
-
-# Whether we are building with GNU ld or not.
-with_gnu_ld=$lt_with_gnu_ld
-
-# Flag that allows shared libraries with undefined symbols to be built.
-allow_undefined_flag=$lt_allow_undefined_flag
-
-# Flag that enforces no undefined symbols.
-no_undefined_flag=$lt_no_undefined_flag
-
-# Flag to hardcode \$libdir into a binary during linking.
-# This must work even if \$libdir does not exist
-hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
-
-# Whether we need a single "-rpath" flag with a separated argument.
-hardcode_libdir_separator=$lt_hardcode_libdir_separator
-
-# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes
-# DIR into the resulting binary.
-hardcode_direct=$hardcode_direct
-
-# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes
-# DIR into the resulting binary and the resulting library dependency is
-# "absolute",i.e impossible to change by setting \$shlibpath_var if the
-# library is relocated.
-hardcode_direct_absolute=$hardcode_direct_absolute
-
-# Set to "yes" if using the -LDIR flag during linking hardcodes DIR
-# into the resulting binary.
-hardcode_minus_L=$hardcode_minus_L
-
-# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
-# into the resulting binary.
-hardcode_shlibpath_var=$hardcode_shlibpath_var
-
-# Set to "yes" if building a shared library automatically hardcodes DIR
-# into the library and all subsequent libraries and executables linked
-# against it.
-hardcode_automatic=$hardcode_automatic
-
-# Set to yes if linker adds runtime paths of dependent libraries
-# to runtime path list.
-inherit_rpath=$inherit_rpath
-
-# Whether libtool must link a program against all its dependency libraries.
-link_all_deplibs=$link_all_deplibs
-
-# Set to "yes" if exported symbols are required.
-always_export_symbols=$always_export_symbols
-
-# The commands to list exported symbols.
-export_symbols_cmds=$lt_export_symbols_cmds
-
-# Symbols that should not be listed in the preloaded symbols.
-exclude_expsyms=$lt_exclude_expsyms
-
-# Symbols that must always be exported.
-include_expsyms=$lt_include_expsyms
-
-# Commands necessary for linking programs (against libraries) with templates.
-prelink_cmds=$lt_prelink_cmds
-
-# Commands necessary for finishing linking programs.
-postlink_cmds=$lt_postlink_cmds
-
-# Specify filename containing input files.
-file_list_spec=$lt_file_list_spec
-
-# How to hardcode a shared library path into an executable.
-hardcode_action=$hardcode_action
-
-# ### END LIBTOOL CONFIG
-
-_LT_EOF
-
-    cat <<'_LT_EOF' >> "$cfgfile"
-
-# ### BEGIN FUNCTIONS SHARED WITH CONFIGURE
-
-# func_munge_path_list VARIABLE PATH
-# -----------------------------------
-# VARIABLE is name of variable containing _space_ separated list of
-# directories to be munged by the contents of PATH, which is string
-# having a format:
-# "DIR[:DIR]:"
-#       string "DIR[ DIR]" will be prepended to VARIABLE
-# ":DIR[:DIR]"
-#       string "DIR[ DIR]" will be appended to VARIABLE
-# "DIRP[:DIRP]::[DIRA:]DIRA"
-#       string "DIRP[ DIRP]" will be prepended to VARIABLE and string
-#       "DIRA[ DIRA]" will be appended to VARIABLE
-# "DIR[:DIR]"
-#       VARIABLE will be replaced by "DIR[ DIR]"
-func_munge_path_list ()
-{
-    case x$2 in
-    x)
-        ;;
-    *:)
-        eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\"
-        ;;
-    x:*)
-        eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\"
-        ;;
-    *::*)
-        eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\"
-        eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\"
-        ;;
-    *)
-        eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\"
-        ;;
-    esac
-}
-
-
-# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
-func_cc_basename ()
-{
-    for cc_temp in $*""; do
-      case $cc_temp in
-        compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
-        distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
-        \-*) ;;
-        *) break;;
-      esac
-    done
-    func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
-}
-
-
-# ### END FUNCTIONS SHARED WITH CONFIGURE
-
-_LT_EOF
-
-  case $host_os in
-  aix3*)
-    cat <<\_LT_EOF >> "$cfgfile"
-# AIX sometimes has problems with the GCC collect2 program.  For some
-# reason, if we set the COLLECT_NAMES environment variable, the problems
-# vanish in a puff of smoke.
-if test set != "${COLLECT_NAMES+set}"; then
-  COLLECT_NAMES=
-  export COLLECT_NAMES
-fi
-_LT_EOF
-    ;;
-  esac
-
-
-ltmain=$ac_aux_dir/ltmain.sh
-
-
-  # We use sed instead of cat because bash on DJGPP gets confused if
-  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
-  # text mode, it properly converts lines to CR/LF.  This bash problem
-  # is reportedly fixed, but why not run on old versions too?
-  sed '$q' "$ltmain" >> "$cfgfile" \
-     || (rm -f "$cfgfile"; exit 1)
-
-   mv -f "$cfgfile" "$ofile" ||
-    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
-  chmod +x "$ofile"
-
- ;;
-
-  esac
-done # for ac_tag
-
-
-as_fn_exit 0
-_ACEOF
-ac_clean_files=$ac_clean_files_save
-
-test $ac_write_fail = 0 ||
-  as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5
-
-
-# configure is writing to config.log, and then calls config.status.
-# config.status does its own redirection, appending to config.log.
-# Unfortunately, on DOS this fails, as config.log is still kept open
-# by configure, so config.status won't be able to write to it; its
-# output is simply discarded.  So we exec the FD to /dev/null,
-# effectively closing config.log, so it can be properly (re)opened and
-# appended to by config.status.  When coming back to configure, we
-# need to make the FD available again.
-if test "$no_create" != yes; then
-  ac_cs_success=:
-  ac_config_status_args=
-  test "$silent" = yes &&
-    ac_config_status_args="$ac_config_status_args --quiet"
-  exec 5>/dev/null
-  $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
-  exec 5>>config.log
-  # Use ||, not &&, to avoid exiting from the if with $? = 1, which
-  # would make configure fail if this is the last instruction.
-  $ac_cs_success || as_fn_exit 1
-fi
-if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
-$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
-fi
-
-
-$as_echo ""
-$as_echo "------------------------------------------------------------------------------"
-$as_echo "MB-System Configure Summary"
-$as_echo "------------------------------------------------------------------------------"
-$as_echo "MB-System will be installed in: ${prefix}"
-$as_echo "Installation host:              ${host}"
-if test "x$enable_static" = xyes ; then
-	$as_echo "Building Static Libs: Yes"
-else
-	$as_echo "Building Static Libs: No"
-fi
-if test "x$enable_shared" = xyes ; then
-	$as_echo "Building Shared Libs: Yes"
-else
-	$as_echo "Building Shared Libs: No"
-fi
-if test $BYTESWAP = "yes" ; then
-	$as_echo "Byteswapping: Enabled"
-else
-	$as_echo "Byteswapping: Disabled"
-fi
-if test "$GOT_FFTW" = "yes" ; then
-	$as_echo "FFTW Support: Enabled"
-else
-	$as_echo "FFTW Support: Disabled"
-fi
-if test "$GOT_MOTIF" = "yes" ; then
-	$as_echo "Motif Support: Enabled"
-else
-	$as_echo "Motif Support: Disabled"
-fi
-if test "$GOT_OPENGL" = "yes" ; then
-	$as_echo "OpenGL Support: Enabled"
-else
-	$as_echo "OpenGL Support: Disabled"
-fi
-$as_echo "Using $OTPS_DIR for OSU Tidal Prediction Software"
-
-if test "$bundledproj" = "yes" ; then
-	$as_echo "Building using bundled proj package"
-else
-	$as_echo "Building using system libproj library, not bundled proj package"
-fi
-
-$as_echo "------------------------------------------------------------------------------"
-$as_echo "Key Variables:"
-$as_echo "    prefix:                   ${prefix}"
-$as_echo "    exec_prefix:              ${exec_prefix}"
-$as_echo "    datarootdir:              ${datarootdir}"
-$as_echo "    PACKAGE_TARNAME:          ${PACKAGE_TARNAME}"
-$as_echo "------------------------------------------------------------------------------"
-$as_echo "Installation Locations:"
-$as_echo "    executables:              ${bindir}"
-$as_echo "    libraries:                ${libdir}"
-$as_echo "    header files:             ${includedir}"
-$as_echo "    data files:               ${mbsystemdatadir}"
-$as_echo "    man pages:                ${mandir}"
-$as_echo "    Html documentation:       ${mbsystemhtmldir}"
-$as_echo "    Postscript documentation: ${mbsystempsdir}"
-$as_echo "------------------------------------------------------------------------------"
-$as_echo "See config.log for details of configure results"
-$as_echo "See INSTALL for further build instructions and hints"
-$as_echo "------------------------------------------------------------------------------"
diff --git a/configure.ac b/configure.ac
deleted file mode 100644
index 9c5ad6a..0000000
--- a/configure.ac
+++ /dev/null
@@ -1,878 +0,0 @@
-dnl--------------------------------------------------------------------
-dnl    The MB-system:	configure.ac	12/7/2011
-dnl    $Id: configure.ac 2252 2015-07-01 19:35:37Z caress $
-dnl
-dnl    Copyright (c) 2011-2015 by
-dnl    D. W. Caress (caress at lamont.ldgo.columbia.edu)
-dnl    and D. N. Chayes (dale at lamont.ldgo.columbia.edu)
-dnl    Lamont-Doherty Earth Observatory
-dnl    Palisades, NY  10964
-dnl
-dnl    See README file for copying and redistribution conditions.
-dnl--------------------------------------------------------------------
-
-dnl Require automake 2.65 or later
-AC_PREREQ([2.65])
-
-dnl Disable configure caching
-define([AC_CACHE_LOAD], )
-define([AC_CACHE_SAVE], )
-
-dnl Initialize and set version and version date
-AC_INIT([mbsystem],[5.5.2252],[http://listserver.mbari.org/sympa/arc/mbsystem],[mbsystem],[http://www.mbari.org/data/mbsystem/])
-
-AC_CONFIG_MACRO_DIR(m4)
-AC_LANG(C)
-AC_DEFINE(VERSION_DATE, "1 July 2015", [Set VERSION_DATE define in mb_config.h])
-
-dnl Check system arch
-AC_CANONICAL_HOST
-
-AS_ECHO([" "])
-AS_ECHO(["------------------------------------------------------------------------------"])
-AS_ECHO(["    The MB-system:	configure	12/7/2011"])
-AS_ECHO(["    $Id: configure.ac 2252 2015-07-01 19:35:37Z caress $"])
-AS_ECHO([" "])
-AS_ECHO(["    Copyright (c) 2011-2015 by"])
-AS_ECHO(["    D. W. Caress (caress at lamont.ldgo.columbia.edu)"])
-AS_ECHO(["    and D. N. Chayes (dale at lamont.ldgo.columbia.edu)"])
-AS_ECHO(["    Lamont-Doherty Earth Observatory"])
-AS_ECHO(["    Palisades, NY  10964"])
-AS_ECHO([" "])
-AS_ECHO(["    See README file for copying and redistribution conditions."])
-AS_ECHO(["------------------------------------------------------------------------------"])
-AS_ECHO([" "])
-AS_ECHO(["    The initial version of the MB-System autoconf-based build system"])
-AS_ECHO(["    was contributed by Bob Covill on 7 December 2011. Further"])
-AS_ECHO(["    refinement of the build system involved contributions from"])
-AS_ECHO(["    Bob Covill, Kurt Schwehr, Hamish Bowman, David Caress, and"])
-AS_ECHO(["    Christian Ferreira."])
-AS_ECHO([" "])
-AS_ECHO(["------------------------------------------------------------------------------"])
-AS_ECHO(["    To modify this build system..."])
-AS_ECHO(["------------------------------------------------------------------------------"])
-AS_ECHO([" "])
-AS_ECHO(["    Edit the file configure.ac in the top directory and the files"])
-AS_ECHO(["    Makefile.am in each directory under src. Then run the following sequence"])
-AS_ECHO(["    of commands:"])
-AS_ECHO([" "])
-AS_ECHO(["        # Build libtool files for LT_INIT"])
-AS_ECHO(["        libtoolize --force --copy"])
-AS_ECHO(["        aclocal"])
-AS_ECHO([" "])
-AS_ECHO(["        # Build custom header for configure"])
-AS_ECHO(["        autoheader"])
-AS_ECHO(["        automake --add-missing --include-deps"])
-AS_ECHO(["        autoconf"])
-AS_ECHO([" "])
-AS_ECHO(["        # To update configure files use the following:"])
-AS_ECHO(["        autoupdate"])
-AS_ECHO(["        autoreconf --force --install --warnings=all"])
-AS_ECHO([" "])
-AS_ECHO(["        # Reset the autotools version to 2.65 to accomodate some Linux distributions"])
-AS_ECHO(["        sed -i.bak s/2\.69/2\.65/ configure.ac"])
-AS_ECHO([" "])
-AS_ECHO(["    When you run ./configure, a number of configure options are saved to a"])
-AS_ECHO(["    header file:"])
-AS_ECHO(["        ./src/mbio/mb_config.h"])
-AS_ECHO(["    This file has a template:"])
-AS_ECHO(["        ./src/mbio/mb_config.h.in"])
-AS_ECHO(["    This file is conditionally included by:"])
-AS_ECHO(["        ./src/mbio/mb_define.h"])
-AS_ECHO(["    which is in turn included by essentially every MB-System C source file."])
-AS_ECHO([" "])
-AS_ECHO(["------------------------------------------------------------------------------"])
-AS_ECHO(["    To use the build system..."])
-AS_ECHO(["------------------------------------------------------------------------------"])
-AS_ECHO(["    To generate the makefiles needed to build MB-System, run ./configure"])
-AS_ECHO(["    with the options appropriate for your situation. These options are"])
-AS_ECHO(["    listed here:"])
-AS_ECHO(["        --prefix=install      - location for mbsystem (/usr/local/mbsystem)"])
-AS_ECHO(["        --with-netcdf-lib     - location of NetCDF libs"])
-AS_ECHO(["        --with-netcdf-include - location of NetCDF headers"])
-AS_ECHO(["        --with-proj-lib       - location of PROJ libs"])
-AS_ECHO(["        --with-proj-include   - location of PROJ headers"])
-AS_ECHO(["        --with-gmt-lib        - location of GMT libs"])
-AS_ECHO(["        --with-gmt-include    - location of GMT headers"])
-AS_ECHO(["        --with-fftw-lib       - location of FFTW3 libs (optional)"])
-AS_ECHO(["        --with-fftw-include   - location of FFTW3 headers (optional)"])
-AS_ECHO(["        --with-motif-lib      - location of Motif libs (optional)"])
-AS_ECHO(["        --with-motif-include  - location of Motif headers (optional)"])
-AS_ECHO(["        --with-opengl-lib     - location of OpenGL libs (optional)"])
-AS_ECHO(["        --with-opengl-include - location of OpenGL headers (optional)"])
-AS_ECHO(["        --with-otps-dir       - location of OTPS installation (optional)"])
-AS_ECHO(["        --enable-bundledproj  - build using bundled proj package - default is to link with libproj"])
-AS_ECHO([" "])
-AS_ECHO(["    After configure you can run the make utility in the usual fashion"])
-AS_ECHO(["        make"])
-AS_ECHO(["        make install"])
-AS_ECHO([" "])
-AS_ECHO(["    Some other useful make commands include: "])
-AS_ECHO(["        make clean (to clean up compiled code)"])
-AS_ECHO(["        make distclean (to clean up compiled code and configure output)"])
-AS_ECHO(["        make uninstall (to remove a previously installed version)"])
-AS_ECHO(["------------------------------------------------------------------------------"])
-AS_ECHO([" "])
-AS_ECHO(["Configure will now attempt to construct the Makefiles required to build MB-System"])
-AS_ECHO(["MB-System Version $PACKAGE_VERSION"])
-AS_ECHO(["HOST System Type: ${host}"])
-AS_ECHO([" "])
-
-AM_INIT_AUTOMAKE
-AM_MAINTAINER_MODE
-AC_CONFIG_HEADERS([src/mbio/mb_config.h])
-
-dnl Check for programs
-AC_PROG_CC
-AM_PROG_CC_C_O
-AC_PROG_INSTALL
-AM_PROG_AS
-m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
-AC_PROG_LN_S
-AC_PROG_MAKE_SET
-LT_INIT
-AC_SUBST([LIBTOOL_DEPS])
-LT_LIB_M
-
-dnl Check Endian size
-BYTESWAP=no
-AC_C_BIGENDIAN([BYTESWAP=no], [BYTESWAP=yes],
-	AC_MSG_ERROR(Unknown endian state),
-	AC_MSG_ERROR(Universial endianess not supported)
-)
-if test BYTESWAP == "no" ; then
-	AC_DEFINE(ENDIAN_BIG, 1, [Machine is bigendian, (Byteswapping off)])
-else
-	AC_DEFINE(BYTESWAPPED, 1, [Machine is littleendian, (Byteswapping on)])
-fi
-
-dnl Check for headers
-AC_HEADER_STDC
-
-dnl Check for math lib
-AC_CHECK_LIB(m,exp,,,)
-
-dnl check for signed char
-AC_TYPE_INT8_T
-
-dnl check for malloc header
-AC_CHECK_HEADER(malloc.h, AC_DEFINE(HAVE_MALLOC_H, 1, [Have malloc.h]))
-
-dnl Parse host_os from CANONICAL and deterimine
-dnl if solaris flag required
-case "${host_os}" in
-	solaris*|sunos*) CFLAGS="${CFLAGS} -DSUN" ;;
-	*) AS_ECHO(["Build does not require -DSUN CFLAG"]) ;;
-esac
-
-dnl check for win32 flag
-case "${host_os}" in
-	*mingw32*|cygwin*)
-	AC_DEFINE(WIN32, 1, [Turned on WIN32 define in config])
-	AS_ECHO(["Added WIN32 define to mb_config.h"])
-	;;
-	*)
-	AS_ECHO(["Not WIN32 system"])
-	;;
-esac
-
-dnl check for RPC XDR headers needed by mbio lib
-AC_CHECK_HEADERS(rpc/rpc.h)
-AC_CHECK_HEADERS(rpc/types.h, ,
-                 [AC_MSG_ERROR([Required header <rpc/types.h> not found, check include path and intsalled devel packages])],)
-
-dnl for win32
-dnl AC_CHECK_LIB(uuid, main)
-dnl AC_CHECK_LIB(ole32, main)
-dnl AC_CHECK_LIB(gw32c, main)
-dnl AC_CHECK_LIB(wsock32, main)
-AC_CHECK_LIB(ws2_32, main)
-
-AC_CHECK_FUNC(xdrmem_create, XDR_LIB=, [
- AC_CHECK_LIB(sun, xdrmem_create, XDR_LIB=-lsun, [
-  AC_CHECK_LIB(nsl, xdrmem_create, XDR_LIB=-lnsl, [
-   AC_CHECK_LIB(rpclib, xdrmem_create, XDR_LIB=-lrpclib, [
-    AC_CHECK_LIB(xdr, xdrmem_create, XDR_LIB=-lxdr, [
-     AC_CHECK_LIB(portablexdr, xdrmem_create, XDR_LIB=-lportablexdr,
-   [ AC_MSG_ERROR([*** Unable to locate XDR functions.]) ], -lws2_32 )
-], -lws2_32 )])])])])
-AC_SUBST(XDR_LIB)
-
-dnl--------------------------------------------------------------------
-dnl OTPS Section
-dnl--------------------------------------------------------------------
-
-dnl Use OTPS (OSU Tidal Prediction Software) location if specified with --with-otps_dir, use default otherwise
-AS_ECHO(["Use OTPS (OSU Tidal Prediction Software) location if specified with --with-otps_dir, use default otherwise"])
-OTPS_DIR="/usr/local/OTPSnc"
-AC_ARG_WITH(otps_dir, [ --with-otps_dir=DIR    Location of OSU Tidal Prediction Software], [OTPS_DIR=${withval}])
-AC_SUBST(OTPS_DIR)
-
-dnl--------------------------------------------------------------------
-dnl NetCDF Section
-dnl--------------------------------------------------------------------
-
-dnl Check for netCDF library
-AS_ECHO(["Check for netCDF library libnetcdf"])
-GOT_CDF=no
-CDF_SETTING=no
-dnl First check if netcdf location specified on the command line
-AC_ARG_WITH(netcdf-lib, [  --with-netcdf-lib=DIR	Location of NetCDF library],
-	[netcdf_libdir="${withval}"] [GOT_CDF=yes], [GOT_CDF=no])
-if test "$GOT_CDF" = "yes" ; then
-    dnl NetCDF library location specified: $netcdf_libdir - check if libnetcdf is there...
-    AS_ECHO(["NetCDF library location specified: $netcdf_libdir - check if libnetcdf is there..."])
-    save_LDFLAGS=$LDFLAGS
-    LDFLAGS="$LDFLAGS -L$netcdf_libdir"
-    AC_CHECK_LIB([netcdf], [nc_open], [CDF_SETTING=yes], [CDF_SETTING=no], )
-    LDFLAGS="$save_LDFLAGS"
-    if test "$CDF_SETTING" = "no"; then
-	AC_MSG_ERROR([Did not find libnetcdf according to --with-netcdf-lib - check the installation!])
-    fi
-    libnetcdf_LIBS="-L$netcdf_libdir -R $netcdf_libdir -lnetcdf"
-    libnetcdf_LDFLAGS="-L$netcdf_libdir"
-else
-    dnl Look for pkg-config netCDF package...
-    AS_ECHO(["Look for pkg-config netCDF package..."])
-    PKG_CHECK_MODULES([libnetcdf], [netcdf], [GOT_CDF=yes], [GOT_CDF=no])
-    libnetcdf_LIBS="-lnetcdf"
-    libnetcdf_LDFLAGS=""
-fi
-if test "$GOT_CDF" = "no" ; then
-    dnl Did not find netCDF library pkg-config package, looking in the usual places...
-    AS_ECHO(["Did not find netCDF library pkg-config package, looking in the usual places..."])
-    AC_CHECK_LIB([netcdf], [nc_open], [CDF_SETTING=yes], [CDF_SETTING=no],)
-    if test "$CDF_SETTING" = "yes" ; then
-        GOT_CDF=yes
-        AS_ECHO(["Using pre-installed libnetcdf..."])
-        libnetcdf_LIBS="-lnetcdf"
-        libnetcdf_LDFLAGS=""
-    else
-        AS_ECHO(["Did not find netCDF library anywhere, use --with-netcdf-lib to set the location"])
-        AC_MSG_ERROR([Did not find netCDF library anywhere, use --with-netcdf-lib to set the location])
-    fi
-fi
-dnl Done checking for netCDF library libnetcdf
-
-dnl Check for netCDF headers
-AS_ECHO(["Check for netCDF headers"])
-GOT_CDF=no
-CDF_SETTING=no
-dnl First check if netcdf location specified on the command line
-AC_ARG_WITH(netcdf-include, [  --with-netcdf-include=DIR	Location of NetCDF headers],
-	[libnetcdf_CPPFLAGS="-I${withval}"] [GOT_CDF=yes], [GOT_CDF=no])
-if test "$GOT_CDF" = "yes" ; then
-    dnl NetCDF header location specified: $libnetcdf_CPPFLAGS - check if netcdf.h is there...
-    AS_ECHO(["NetCDF header location specified: $libnetcdf_CPPFLAGS - check if netcdf.h is there..."])
-    save_CPPFLAGS=$CPPFLAGS
-    save_CFLAGS=$CFLAGS
-    CPPFLAGS="$CPPFLAGS $libnetcdf_CPPFLAGS"
-    CFLAGS="$CFLAGS $libnetcdf_CPPFLAGS"
-    AC_CHECK_HEADER(netcdf.h, [CDF_SETTING=yes], [CDF_SETTING=no],)
-    CPPFLAGS=$save_CPPFLAGS
-    CFLAGS=$save_CFLAGS
-    if test "$CDF_SETTING" = "no"; then
-	AC_MSG_ERROR([Did not find netcdf.h according to --with-netcdf-include - check the installation!])
-    fi
-else
-    dnl Looking for netCDF headers in the usual places...
-    AS_ECHO(["Looking for netCDF headers in the usual places..."])
-    AC_CHECK_HEADER(netcdf.h, [CDF_SETTING=yes], [CDF_SETTING=no])
-    if test "$CDF_SETTING" = "yes" ; then
-        GOT_CDF=yes
-        AS_ECHO(["Using pre-installed netCDF headers..."])
-    else
-        AS_ECHO(["Did not find netCDF headers anywhere, use --with-netcdf-include to set the location"])
-        AC_MSG_ERROR([Did not find netCDF headers anywhere, use --with-netcdf-include to set the location])
-    fi
-fi
-dnl Done checking for netCDF headers
-
-dnl Substitute netCDF library and header arguments
-AC_SUBST([libnetcdf_LIBS], [$libnetcdf_LIBS])
-AC_SUBST([libnetcdf_CPPFLAGS], [$libnetcdf_CPPFLAGS])
-
-dnl--------------------------------------------------------------------
-dnl PROJ Section
-dnl--------------------------------------------------------------------
-
-dnl Check whether to use bundled proj package or link with external libproj
-AS_ECHO(["Check whether to use bundled proj package or link with external libproj"])
-AC_ARG_ENABLE(bundledproj, [AS_HELP_STRING([--enable-bundledproj], [build and use the bundled proj package])],
-        [bundledproj=yes], [bundledproj=no])
-AM_CONDITIONAL([BUILD_PROJ], [test x"$bundledproj" = xyes])
-if test "$bundledproj" = "yes" ; then
-    dnl Using bundled PROJ library
-    AS_ECHO(["Using bundled PROJ library"])
-    libproj_LIBS="-lproj"
-    libproj_LDFLAGS=
-else
-    dnl Check if proj library location specified on the command line
-    AS_ECHO(["Check if proj library location specified on the command line"])
-    GOT_PROJ=no
-    PROJ_SETTING=no
-    AC_ARG_WITH(proj-lib, [  --with-proj-lib=DIR	Location of PROJ library],
-        [proj_libdir="${withval}"] [GOT_PROJ=yes], [GOT_PROJ=no])
-    if test "$GOT_PROJ" = "yes" ; then
-        dnl PROJ library location specified: $proj_libdir - check if libproj is there...
-        AS_ECHO(["PROJ library location specified: $proj_libdir - check if libproj is there..."])
-        save_LDFLAGS=$LDFLAGS
-        LDFLAGS="$LDFLAGS -L$proj_libdir"
-        AC_CHECK_LIB([proj], [pj_init_plus], [PROJ_SETTING=yes], [PROJ_SETTING=no], )
-        LDFLAGS="$save_LDFLAGS"
-        if test "$PROJ_SETTING" = "no"; then
-            AC_MSG_ERROR([Did not find libproj according to --with-proj-lib - check the installation!])
-        fi
-        libproj_LIBS="-L$proj_libdir -R $proj_libdir -lproj"
-        libproj_LDFLAGS="-L$proj_libdir"
-    else
-        dnl Look for pkg-config PROJ package...
-        AS_ECHO(["Look for pkg-config PROJ package..."])
-        PKG_CHECK_MODULES([libproj], [proj], [GOT_PROJ=yes], [GOT_PROJ=no])
-        libproj_LIBS="-lproj"
-        libproj_LDFLAGS=""
-    fi
-    if test "$GOT_PROJ" = "no" ; then
-        dnl Did not find PROJ library pkg-config package, looking in the usual places...
-        AS_ECHO(["Did not find PROJ library pkg-config package, looking in the usual places..."])
-        AC_CHECK_LIB([proj], [pj_init_plus], [PROJ_SETTING=yes], [PROJ_SETTING=no],)
-        if test "$PROJ_SETTING" = "yes" ; then
-            GOT_PROJ=yes
-            AS_ECHO(["Using pre-installed libproj..."])
-            libproj_LIBS="-lproj"
-            libproj_LDFLAGS=""
-        else
-            AS_ECHO(["Did not find PROJ library anywhere, use --with-proj-lib to set the location"])
-            AC_MSG_ERROR([Did not find PROJ library anywhere, use --with-proj-lib to set the location])
-        fi
-    fi
-    
-    dnl Check if proj header location specified on the command line
-    AS_ECHO(["Check if proj header location specified on the command line"])
-    GOT_PROJ=no
-    PROJ_SETTING=no
-    AC_ARG_WITH(proj-include, [  --with-proj-include=DIR	Location of PROJ headers],
-            [libproj_CPPFLAGS="-I${withval}"] [GOT_PROJ=yes], [GOT_PROJ=no])
-    if test "$GOT_PROJ" = "yes" ; then
-        dnl PROJ header location specified: $libproj_CPPFLAGS - check if proj_api.h is there...
-        AS_ECHO(["PROJ header location specified: $libproj_CPPFLAGS - check if proj_api.h is there..."])
-        save_CPPFLAGS=$CPPFLAGS
-        save_CFLAGS=$CFLAGS
-        CPPFLAGS="$CPPFLAGS $libproj_CPPFLAGS"
-        CFLAGS="$CFLAGS $libproj_CPPFLAGS"
-        AC_CHECK_HEADER(proj_api.h, [PROJ_SETTING=yes], [PROJ_SETTING=no],)
-        CPPFLAGS=$save_CPPFLAGS
-        CFLAGS=$save_CFLAGS
-        if test "$PROJ_SETTING" = "no"; then
-           AC_MSG_ERROR([Did not find PROJ headers according to --with-proj-include - check the installation!])
-        fi
-    else
-        dnl Looking for PROJ headers in the usual places...
-        AS_ECHO(["Looking for PROJ headers in the usual places..."])
-        AC_CHECK_HEADER(proj_api.h, [PROJ_SETTING=yes], [PROJ_SETTING=no])
-        if test "$PROJ_SETTING" = "yes" ; then
-            GOT_PROJ=yes
-            AS_ECHO(["Using pre-installed PROJ headers..."])
-        else
-            AS_ECHO(["Did not find PROJ headers anywhere, use --with-proj-include to set the location"])
-            AC_MSG_ERROR([Did not find PROJ headers anywhere, use --with-proj-include to set the location])
-        fi
-    fi
-     dnl Done checking for PROJ headers
-fi
-dnl Done checking for PROJ library libproj and PROJ headers
-
-dnl Substitute PROJ library and header arguments
-AC_SUBST([libproj_LIBS], [$libproj_LIBS])
-AC_SUBST([libproj_CPPFLAGS], [$libproj_CPPFLAGS])
-
-dnl--------------------------------------------------------------------
-dnl GMT Section
-dnl--------------------------------------------------------------------
-
-dnl Check for GMT libraries libgmt libpsl
-AS_ECHO(["Check for GMT libraries libgmt libpsl"])
-GOT_GMT=no
-GMT_SETTING=no
-dnl First check if GMT library location specified on the command line
-AC_ARG_WITH(gmt-lib, [  --with-gmt-lib=DIR	Location of GMT libraries libgmt libpsl],
-	[gmt_libdir="${withval}"] [GOT_GMT=yes], [GOT_GMT=no])
-if test "$GOT_GMT" = "yes" ; then
-    dnl GMT library location specified: $gmt_libdir - check if libgmt libpsl are there...
-    AS_ECHO(["GMT library location specified: $gmt_libdir - check if libgmt libpsl are there..."])
-    save_LDFLAGS=$LDFLAGS
-    LDFLAGS="$LDFLAGS -L$gmt_libdir"
-    AC_CHECK_LIB([gmt], [GMT_begin], [GMT_SETTING=yes], [GMT_SETTING=no], )
-    LDFLAGS="$save_LDFLAGS"
-    if test "$GMT_SETTING" = "no"; then
-	AC_MSG_ERROR([Did not find libgmt according to --with-gmt-lib - check the installation!])
-    fi
-    libgmt_LIBS="-L$gmt_libdir -R $gmt_libdir -lgmt -lpsl"
-    libgmt_LDFLAGS="-L$gmt_libdir"
-else
-    dnl Look for pkg-config GMT package...
-    AS_ECHO(["Look for pkg-config GMT package..."])
-    PKG_CHECK_MODULES([libgmt], [gmt], [GOT_LIBGMT=yes], [GOT_LIBGMT=no])
-    PKG_CHECK_MODULES([libpsl], [gmt], [GOT_LIBPSL=yes], [GOT_LIBPSL=no])
-    if test "$GOT_LIBGMT" = "yes" ; then
-            GOT_GMT=yes
-    fi
-    if test "$GOT_PSL" = "no" ; then
-            GOT_GMT=no
-    fi
-    libgmt_LIBS="-lgmt -lpsl"
-    libgmt_LDFLAGS=""
-fi
-if test "$GOT_GMT" = "no" ; then
-    dnl Did not find GMT library pkg-config package, looking in the usual places...
-    AS_ECHO(["Did not find GMT library pkg-config package, looking in the usual places..."])
-    AC_CHECK_LIB([gmt], [GMT_begin], [GMT_SETTING=yes], [GMT_SETTING=no],)
-    if test "$GMT_SETTING" = "yes" ; then
-        GOT_GMT=yes
-        AS_ECHO(["Using pre-installed libgmt..."])
-        libgmt_LIBS="-lgmt -lpsl"
-        libgmt_LDFLAGS=""
-    else
-        AS_ECHO(["Did not find GMT libraries anywhere, use --with-gmt-lib to set the location"])
-        AC_MSG_ERROR([Did not find GMT libraries anywhere, use --with-gmt-lib to set the location])
-    fi
-fi
-dnl Done checking for GMT libraries libgmt libpsl
-
-dnl Check for GMT headers
-AS_ECHO(["Check for GMT headers"])
-GOT_GMT=no
-GMT_SETTING=no
-dnl First check if GMT header location specified on the command line
-AC_ARG_WITH(gmt-include, [  --with-gmt-include=DIR	Location of GMT headers],
-	[libgmt_CPPFLAGS="-I${withval}"] [GOT_GMT=yes], [GOT_GMT=no])
-if test "$GOT_GMT" = "yes" ; then
-    dnl GMT header location specified: $libgmt_CPPFLAGS - check if gmt.h is there...
-    AS_ECHO(["GMT header location specified: $libgmt_CPPFLAGS - check if gmt.h is there..."])
-    save_CPPFLAGS=$CPPFLAGS
-    save_CFLAGS=$CFLAGS
-    CPPFLAGS="$CPPFLAGS $libgmt_CPPFLAGS"
-    CFLAGS="$CFLAGS $libgmt_CPPFLAGS"
-    AC_CHECK_HEADER(gmt.h, [GMT_SETTING=yes], [GMT_SETTING=no],)
-    CPPFLAGS=$save_CPPFLAGS
-    CFLAGS=$save_CFLAGS
-    if test "$GMT_SETTING" = "no"; then
-	AC_MSG_ERROR([Did not find gmt.h according to --with-gmt-include - check the installation!])
-    fi
-else
-    dnl Looking for GMT headers in the usual places...
-    AS_ECHO(["Looking for GMT headers in the usual places..."])
-    AC_CHECK_HEADER(gmt.h, [GMT_SETTING=yes], [GMT_SETTING=no])
-    if test "$GMT_SETTING" = "yes" ; then
-        GOT_GMT=yes
-        AS_ECHO(["Using pre-installed GMT headers..."])
-    else
-        AS_ECHO(["Did not find GMT headers anywhere, use --with-gmt-include to set the location"])
-        AC_MSG_ERROR([Did not find GMT headers anywhere, use --with-gmt-include to set the location])
-    fi
-fi
-dnl Done checking for GMT headers
-
-dnl Substitute PROJ library and header arguments
-AC_SUBST([libgmt_LIBS], [$libgmt_LIBS])
-AC_SUBST([libgmt_CPPFLAGS], [$libgmt_CPPFLAGS])
-
-dnl--------------------------------------------------------------------
-dnl FFTW Section
-dnl--------------------------------------------------------------------
-
-dnl Check for FFTW library libfftw3
-AS_ECHO(["Check for FFTW library libfftw3"])
-GOT_FFTW=no
-FFTW_SETTING=no
-dnl First check if fftw location specified on the command line
-AC_ARG_WITH(fftw-lib, [  --with-fftw-lib=DIR	Location of FFTW library],
-	[fftw_libdir="${withval}"] [GOT_FFTW=yes], [GOT_FFTW=no])
-if test "$GOT_FFTW" = "yes" ; then
-    dnl FFTW library location specified: $fftw_libdir - check if libfftw3 is there...
-    AS_ECHO(["FFTW library location specified: $fftw_libdir - check if libfftw3 is there..."])
-    save_LDFLAGS=$LDFLAGS
-    LDFLAGS="$LDFLAGS -L$fftw_libdir"
-    AC_CHECK_LIB([fftw3], [fftw_plan_dft_1d], [FFTW_SETTING=yes], [FFTW_SETTING=no], )
-    LDFLAGS="$save_LDFLAGS"
-    if test "$FFTW_SETTING" = "no"; then
-	AC_MSG_ERROR([Did not find libfftw3 according to --with-fftw-lib - check the installation!])
-    fi
-    libfftw_LIBS="-L$fftw_libdir -R $fftw_libdir -lfftw3"
-    libfftw_LDFLAGS="-L$fftw_libdir"
-else
-    dnl Look for pkg-config FFTW package...
-    AS_ECHO(["Look for pkg-config FFTW package..."])
-    PKG_CHECK_MODULES([libfftw3], [fftw3], [GOT_FFTW=yes], [GOT_FFTW=no])
-    libfftw_LIBS="-lfftw3"
-    libfftw_LDFLAGS=""
-fi
-if test "$GOT_FFTW" = "no" ; then
-    dnl Did not find FFTW library pkg-config package, looking in the usual places...
-    AS_ECHO(["Did not find FFTW library pkg-config package, looking in the usual places..."])
-    AC_CHECK_LIB([fftw3], [fftw_plan_dft_1d], [FFTW_SETTING=yes], [FFTW_SETTING=no],)
-    if test "$FFTW_SETTING" = "yes" ; then
-        GOT_FFTW=yes
-        AS_ECHO(["Using pre-installed libfftw3..."])
-        libfftw_LIBS="-lfftw3"
-        libfftw_LDFLAGS=""
-    else
-        AS_ECHO(["Did not find FFTW library anywhere, use --with-fftw-lib to set the location"])
-        AC_MSG_ERROR([Did not find FFTW library anywhere, use --with-fftw-lib to set the location])
-    fi
-fi
-dnl Done checking for FFTW library libfftw3
-
-dnl Check for FFTW headers
-AS_ECHO(["Check for FFTW headers"])
-GOT_FFTW=no
-FFTW_SETTING=no
-dnl First check if fftw3 location specified on the command line
-AC_ARG_WITH(fftw-include, [  --with-fftw-include=DIR	Location of FFTW headers],
-	[libfftw_CPPFLAGS="-I${withval}"] [GOT_FFTW=yes], [GOT_FFTW=no])
-if test "$GOT_FFTW" = "yes" ; then
-    dnl FFTW header location specified: $libfftw_CPPFLAGS - check if fftw3.h is there...
-    AS_ECHO(["FFTW header location specified: $libfftw_CPPFLAGS - check if fftw3.h is there..."])
-    save_CPPFLAGS=$CPPFLAGS
-    save_CFLAGS=$CFLAGS
-    CPPFLAGS="$CPPFLAGS $libfftw_CPPFLAGS"
-    CFLAGS="$CFLAGS $libfftw_CPPFLAGS"
-    AC_CHECK_HEADER(fftw3.h, [FFTW_SETTING=yes], [FFTW_SETTING=no],)
-    CPPFLAGS=$save_CPPFLAGS
-    CFLAGS=$save_CFLAGS
-    if test "$FFTW_SETTING" = "no"; then
-	AC_MSG_ERROR([Did not find fftw3.h according to --with-fftw-include - check the installation!])
-    fi
-else
-    dnl Looking for FFTW headers in the usual places...
-    AS_ECHO(["Looking for FFTW headers in the usual places..."])
-    AC_CHECK_HEADER(fftw3.h, [FFTW_SETTING=yes], [FFTW_SETTING=no])
-    if test "$FFTW_SETTING" = "yes" ; then
-        GOT_FFTW=yes
-        AS_ECHO(["Using pre-installed FFTW headers..."])
-    else
-        AS_ECHO(["Did not find FFTW headers anywhere, use --with-fftw-include to set the location"])
-        AC_MSG_ERROR([Did not find FFTW headers anywhere, use --with-fftw-include to set the location])
-    fi
-fi
-dnl Done checking for FFTW headers
-
-dnl Substitute FFTW library and header arguments
-if test "$GOT_FFTW" = "yes" ; then
-    AC_SUBST([fftw_app], [$USE_FFTW])
-    AC_SUBST([libfftw_LIBS], [$libfftw_LIBS])
-    AC_SUBST([libfftw_CPPFLAGS], [$libfftw_CPPFLAGS])
-fi
-AM_CONDITIONAL([BUILD_FFTW], [test "$GOT_FFTW" = yes])
-
-dnl--------------------------------------------------------------------
-dnl X11/Motif & OpenGL Section
-dnl--------------------------------------------------------------------
-
-dnl Check for X11 libraries libX11 libXt and X11 header file X11/Intrinsic.h
-AS_ECHO(["Check for X11 libraries libX11 libXt and X11 header file X11/Intrinsic.h"])
-AC_CHECK_LIB([Xt], [XtAppMainLoop], [GOT_X11=yes], [GOT_X11=no])
-if test "$GOT_X11" = "yes" ; then
-    AC_CHECK_LIB([X11], [XSendEvent], [GOT_X11=yes], [GOT_X11=no])
-fi
-if test "$GOT_X11" = "yes" ; then
-    AC_CHECK_HEADER(X11/Intrinsic.h, [GOT_X11=yes], [GOT_X11=no],)
-    if test "$GOT_X11" = "yes" ; then
-        AS_ECHO(["Found X11 libraries libX11 libXt and X11 header file X11/Intrinsic.h"])
-    else
-        AS_ECHO(["Found X11 libraries libX11 libXt but did not find X11 header file X11/Intrinsic.h - graphical tools cannot be built"])
-    fi
-else
-    AS_ECHO(["Did not find X11 libraries libX11 libXt - graphical tools cannot be built"])
-fi
-
-GOT_MOTIF=no
-MOTIF_SETTING=no
-if test "$GOT_X11" = "yes" ; then
-    
-    dnl Check for Motif library libXm
-    AS_ECHO(["Check for Motif library libXm"])
-    AC_ARG_WITH(motif-lib, [  --with-motif-lib=DIR	Location of MOTIF library],
-            [motif_libdir="${withval}"] [GOT_MOTIF=yes], [GOT_MOTIF=no])
-    if test "$GOT_MOTIF" = "yes" ; then
-        dnl Motif library location specified: $motif_libdir - check if libXm is there...
-        AS_ECHO(["Motif library location specified: $motif_libdir - check if libXm is there..."])
-        save_LDFLAGS=$LDFLAGS
-        LDFLAGS="$LDFLAGS -L$motif_libdir"
-        AC_CHECK_LIB([Xm], [XmCreatePushButton], [MOTIF_SETTING=yes], [MOTIF_SETTING=no], )
-        LDFLAGS="$save_LDFLAGS"
-        if test "$MOTIF_SETTING" = "no"; then
-            AC_MSG_ERROR([Did not find libXm according to --with-motif-lib - check the installation!])
-        fi
-        libmotif_LIBS="-L$motif_libdir -R $motif_libdir -lXm -lXt -lX11"
-        libmotif_LDFLAGS="-L$motif_libdir"
-    else
-        dnl Look for pkg-config X11 package...
-        AS_ECHO(["Look for pkg-config X11 package..."])
-        PKG_CHECK_MODULES([libXm], [openmotif], [GOT_MOTIF=yes], [GOT_MOTIF=no])
-        libmotif_LIBS="-lXm -lXt -lX11"
-        libmotif_LDFLAGS=""
-    fi
-    if test "$GOT_MOTIF" = "no" ; then
-        dnl Did not find Motif library pkg-config package, looking in the usual places...
-        AS_ECHO(["Did not find Motif library pkg-config package, looking in the usual places..."])
-        AC_CHECK_LIB([Xm], [XmCreatePushButton], [MOTIF_SETTING=yes], [MOTIF_SETTING=no],)
-        if test "$MOTIF_SETTING" = "yes" ; then
-            GOT_MOTIF=yes
-            AS_ECHO(["Using pre-installed libXm..."])
-            libmotif_LIBS="-lXm -lXt -lX11"
-            libmotif_LDFLAGS=""
-        else
-            AS_ECHO(["Did not find Motif library anywhere, use --with-motif-lib to set the location"])
-            AC_MSG_ERROR([Did not find Motif library anywhere, use --with-motif-lib to set the location])
-        fi
-    fi
-    dnl Done checking for Motif library libmotif
-
-    if test "$GOT_MOTIF" = "yes" ; then
-        dnl Check for Motif headers
-        AS_ECHO(["Check for Motif headers"])
-        GOT_MOTIF=no
-        MOTIF_SETTING=no
-        dnl First check if Motif location specified on the command line
-        AC_ARG_WITH(motif-include, [  --with-motif-include=DIR	Location of Motif headers],
-                [libmotif_CPPFLAGS="-I${withval}"] [GOT_MOTIF=yes], [GOT_MOTIF=no])
-        if test "$GOT_MOTIF" = "yes" ; then
-            dnl Motif header location specified: $libmotif_CPPFLAGS - check if Xm/Xm.h is there...
-            AS_ECHO(["Motif header location specified: $libmotif_CPPFLAGS - check if Xm/Xm.h is there..."])
-            save_CPPFLAGS=$CPPFLAGS
-            save_CFLAGS=$CFLAGS
-            CPPFLAGS="$CPPFLAGS $libmotif_CPPFLAGS"
-            CFLAGS="$CFLAGS $libmotif_CPPFLAGS"
-            AC_CHECK_HEADER(Xm/Xm.h, [MOTIF_SETTING=yes], [MOTIF_SETTING=no],)
-            CPPFLAGS=$save_CPPFLAGS
-            CFLAGS=$save_CFLAGS
-            if test "$MOTIF_SETTING" = "no"; then
-                AC_MSG_ERROR([Did not find Xm/Xm.h according to --with-motif-include - check the installation!])
-            fi
-        else
-            dnl Looking for Motif headers in the usual places...
-            AS_ECHO(["Looking for Motif headers in the usual places..."])
-            AC_CHECK_HEADER(Xm/Xm.h, [MOTIF_SETTING=yes], [MOTIF_SETTING=no])
-            if test "$MOTIF_SETTING" = "yes" ; then
-                GOT_MOTIF=yes
-                AS_ECHO(["Using pre-installed Motif headers..."])
-            else
-                AS_ECHO(["Did not find Motif headers anywhere, use --with-motif-include to set the location"])
-                AC_MSG_ERROR([Did not find Motif headers anywhere, use --with-motif-include to set the location])
-            fi
-        fi
-        dnl Done checking for Motif headers
-    fi
-    
-    dnl Substitute Motif library and header arguments
-    AC_SUBST([libmotif_LIBS], [$libmotif_LIBS])
-    AC_SUBST([libmotif_CPPFLAGS], [$libmotif_CPPFLAGS])
-
-else
-    dnl Failed to find X11 libraries and headers - unable to build graphical tools
-    AS_ECHO(["Failed to find X11 libraries and headers - unable to build graphical tools"])
-fi
-
-AM_CONDITIONAL([BUILD_MOTIF], [test "$GOT_MOTIF" = yes])
-dnl End check for Motif library and headers
-
-dnl Check for OpenGL libraries libGL libGLU and header files GL/gl.h GL/glu.h GL/glx.h
-AS_ECHO(["Check for OpenGL libraries libGL libGLU and header files GL/gl.h GL/glu.h GL/glx.h"])
-GOT_OPENGL=no
-OPENGL_SETTING=no
-if test "$GOT_MOTIF" = "yes" ; then
-    
-    dnl Check for OpenGL libraries libGLU libGL
-    AS_ECHO(["Check for OpenGL libraries libGLU libGL"])
-    AC_ARG_WITH(opengl-lib, [  --with-opengl-lib=DIR	Location of OpenGL library],
-            [opengl_libdir="${withval}"] [GOT_OPENGL=yes], [GOT_OPENGL=no])
-    if test "$GOT_OPENGL" = "yes" ; then
-        dnl OpenGL library location specified: $opengl_libdir - check if libGLU libGL is there...
-        AS_ECHO(["OpenGL library location specified: $opengl_libdir - check if libGL libGLU are there..."])
-        save_LDFLAGS=$LDFLAGS
-        LDFLAGS="$LDFLAGS -L$opengl_libdir"
-        AC_CHECK_LIB([GLU], [main], [OPENGL_SETTING=yes], [OPENGL_SETTING=no], )
-        if test "$OPENGL_SETTING" = "yes"; then
-            AC_CHECK_LIB([GL], [main], [OPENGL_SETTING=yes], [OPENGL_SETTING=no], )
-        fi
-        LDFLAGS="$save_LDFLAGS"
-        if test "$OPENGL_SETTING" = "no"; then
-            AC_MSG_ERROR([Did not find libGLU libGL according to --with-opengl-lib - check the installation!])
-        fi
-        libopengl_LIBS="-L$opengl_libdir -R $opengl_libdir -lGL -lGLU"
-        libopengl_LDFLAGS="-L$opengl_libdir"
-    else
-        dnl Look for pkg-config X11 package...
-        AS_ECHO(["Look for pkg-config OpenGL package..."])
-        PKG_CHECK_MODULES([libGLU], [opengl], [GOT_OPENGL=yes], [GOT_OPENGL=no])
-        libopengl_LIBS="-lGL -lGLU"
-        libopengl_LDFLAGS=""
-    fi
-    if test "$GOT_OPENGL" = "no" ; then
-        dnl Did not find OpenGL library pkg-config package, looking in the usual places...
-        AS_ECHO(["Did not find OpenGL library pkg-config package, looking in the usual places..."])
-        AC_CHECK_LIB([GLU], [main], [OPENGL_SETTING=yes], [OPENGL_SETTING=no],)
-        if test "$OPENGL_SETTING" = "yes" ; then
-            AC_CHECK_LIB([GL], [main], [OPENGL_SETTING=yes], [OPENGL_SETTING=no],)
-        fi
-        if test "$OPENGL_SETTING" = "yes" ; then
-            GOT_OPENGL=yes
-            AS_ECHO(["Using pre-installed libGLU libGL..."])
-            libopengl_LIBS="-lGL -lGLU"
-            libopengl_LDFLAGS=""
-        else
-            AS_ECHO(["Did not find OpenGL library anywhere, use --with-opengl-lib to set the location"])
-            AC_MSG_ERROR([Did not find OpenGL library anywhere, use --with-opengl-lib to set the location])
-        fi
-    fi
-    dnl Done checking for OpenGL libraries libGLU libGL
-
-    if test "$GOT_OPENGL" = "yes" ; then
-        dnl Check for OpenGL headers
-        AS_ECHO(["Check for OpenGL headers"])
-        GOT_OPENGL=no
-        OPENGL_SETTING=no
-        dnl First check if OpenGL location specified on the command line
-        AC_ARG_WITH(opengl-include, [  --with-opengl-include=DIR	Location of OpenGL headers],
-                [libopengl_CPPFLAGS="-I${withval}"] [GOT_OPENGL=yes], [GOT_OPENGL=no])
-        if test "$GOT_OPENGL" = "yes" ; then
-            dnl OpenGL header location specified: $libopengl_CPPFLAGS - check if Xm/Xm.h is there...
-            AS_ECHO(["OpenGL header location specified: $libopengl_CPPFLAGS - check if Xm/Xm.h is there..."])
-            save_CPPFLAGS=$CPPFLAGS
-            save_CFLAGS=$CFLAGS
-            CPPFLAGS="$CPPFLAGS $libopengl_CPPFLAGS"
-            CFLAGS="$CFLAGS $libopengl_CPPFLAGS"
-            AC_CHECK_HEADER(Xm/Xm.h, [OPENGL_SETTING=yes], [OPENGL_SETTING=no],)
-            CPPFLAGS=$save_CPPFLAGS
-            CFLAGS=$save_CFLAGS
-            if test "$OPENGL_SETTING" = "no"; then
-                AC_MSG_ERROR([Did not find Xm/Xm.h according to --with-opengl-include - check the installation!])
-            fi
-        else
-            dnl Looking for OpenGL headers in the usual places...
-            AS_ECHO(["Looking for OpenGL headers in the usual places..."])
-            AC_CHECK_HEADER(Xm/Xm.h, [OPENGL_SETTING=yes], [OPENGL_SETTING=no])
-            if test "$OPENGL_SETTING" = "yes" ; then
-                GOT_OPENGL=yes
-                AS_ECHO(["Using pre-installed OpenGL headers..."])
-            else
-                AS_ECHO(["Did not find OpenGL headers anywhere, use --with-opengl-include to set the location"])
-                AC_MSG_ERROR([Did not find OpenGL headers anywhere, use --with-opengl-include to set the location])
-            fi
-        fi
-        dnl Done checking for OpenGL headers
-    fi
-    
-    dnl Substitute OpenGL library and header arguments
-    AC_SUBST([libopengl_LIBS], [$libopengl_LIBS])
-    AC_SUBST([libopengl_CPPFLAGS], [$libopengl_CPPFLAGS])
-    if test "$GOT_OPENGL" = "yes" ; then
-        AC_DEFINE(GOT_GL, 1, [Turned on OpenGL define in config])
-    fi
-    AM_CONDITIONAL([BUILD_GL], [test "$GOT_OPENGL" = yes])
-
-else
-    dnl Failed to find Motif libraries and headers - did not look for OpenGL libraries and headers - unable to build visualization tools
-    AS_ECHO(["Failed to find Motif libraries and headers - did not look for OpenGL libraries and headers - unable to build visualization tools"])
-fi
-
-dnl--------------------------------------------------------------------
-dnl Shared Data Section
-dnl--------------------------------------------------------------------
-
-dnl variables for shared data
-mbsystemdatadir="$datadir/$PACKAGE"
-AC_SUBST(mbsystemdatadir)
-mbsystemhtmldir="$docdir/html"
-AC_SUBST(mbsystemhtmldir)
-mbsystempsdir="$docdir/ps"
-AC_SUBST(mbsystempsdir)
-
-dnl--------------------------------------------------------------------
-dnl Generate Makefiles
-dnl--------------------------------------------------------------------
-
-AS_ECHO([" "])
-AS_ECHO(["About to create Makefiles..."])
-AC_CONFIG_FILES([Makefile src/Makefile src/mbio/Makefile \
-	  src/surf/Makefile \
-	  src/bsio/Makefile \
-          src/gsf/Makefile \
-          src/mbaux/Makefile \
-	  src/utilities/Makefile src/gmt/Makefile \
-	  src/macros/Makefile src/mbedit/Makefile src/mbnavedit/Makefile \
-	  src/mbvelocitytool/Makefile src/mbnavadjust/Makefile \
-	  src/otps/Makefile \
-	  src/mbview/Makefile  src/mbgrdviz/Makefile  src/mbeditviz/Makefile  \
-	  src/man/Makefile src/man/man1/Makefile src/man/man3/Makefile \
-	  src/html/Makefile src/ps/Makefile src/share/Makefile])
-if test "$bundledproj" = "yes" ; then
-AC_CONFIG_FILES([src/proj/Makefile])
-fi
-AC_OUTPUT
-
-dnl Summary Report
-AS_ECHO([""])
-AS_ECHO(["------------------------------------------------------------------------------"])
-AS_ECHO(["MB-System Configure Summary"])
-AS_ECHO(["------------------------------------------------------------------------------"])
-AS_ECHO(["MB-System will be installed in: ${prefix}"])
-AS_ECHO(["Installation host:              ${host}"])
-if test "x$enable_static" = xyes ; then
-	AS_ECHO(["Building Static Libs: Yes"])
-else
-	AS_ECHO(["Building Static Libs: No"])
-fi
-if test "x$enable_shared" = xyes ; then
-	AS_ECHO(["Building Shared Libs: Yes"])
-else
-	AS_ECHO(["Building Shared Libs: No"])
-fi
-if test $BYTESWAP = "yes" ; then
-	AS_ECHO(["Byteswapping: Enabled"])
-else
-	AS_ECHO(["Byteswapping: Disabled"])
-fi
-if test "$GOT_FFTW" = "yes" ; then
-	AS_ECHO(["FFTW Support: Enabled"])
-else
-	AS_ECHO(["FFTW Support: Disabled"])
-fi
-if test "$GOT_MOTIF" = "yes" ; then
-	AS_ECHO(["Motif Support: Enabled"])
-else
-	AS_ECHO(["Motif Support: Disabled"])
-fi
-if test "$GOT_OPENGL" = "yes" ; then
-	AS_ECHO(["OpenGL Support: Enabled"])
-else
-	AS_ECHO(["OpenGL Support: Disabled"])
-fi
-AS_ECHO(["Using $OTPS_DIR for OSU Tidal Prediction Software"])
-
-if test "$bundledproj" = "yes" ; then
-	AS_ECHO(["Building using bundled proj package"])
-else
-	AS_ECHO(["Building using system libproj library, not bundled proj package"])
-fi
-
-AS_ECHO(["------------------------------------------------------------------------------"])
-AS_ECHO(["Key Variables:"])
-AS_ECHO(["    prefix:                   ${prefix}"])
-AS_ECHO(["    exec_prefix:              ${exec_prefix}"])
-AS_ECHO(["    datarootdir:              ${datarootdir}"])
-AS_ECHO(["    PACKAGE_TARNAME:          ${PACKAGE_TARNAME}"])
-AS_ECHO(["------------------------------------------------------------------------------"])
-AS_ECHO(["Installation Locations:"])
-AS_ECHO(["    executables:              ${bindir}"])
-AS_ECHO(["    libraries:                ${libdir}"])
-AS_ECHO(["    header files:             ${includedir}"])
-AS_ECHO(["    data files:               ${mbsystemdatadir}"])
-AS_ECHO(["    man pages:                ${mandir}"])
-AS_ECHO(["    Html documentation:       ${mbsystemhtmldir}"])
-AS_ECHO(["    Postscript documentation: ${mbsystempsdir}"])
-AS_ECHO(["------------------------------------------------------------------------------"])
-AS_ECHO(["See config.log for details of configure results"])
-AS_ECHO(["See INSTALL for further build instructions and hints"])
-AS_ECHO(["------------------------------------------------------------------------------"])
diff --git a/configure.ac.save b/configure.ac.save
deleted file mode 100644
index 4adc479..0000000
--- a/configure.ac.save
+++ /dev/null
@@ -1,869 +0,0 @@
-dnl--------------------------------------------------------------------
-dnl    The MB-system:	configure.ac	12/7/2011
-dnl    $Id: configure.ac 2242 2015-05-16 05:21:28Z caress $
-dnl
-dnl    Copyright (c) 2011-2015 by
-dnl    D. W. Caress (caress at lamont.ldgo.columbia.edu)
-dnl    and D. N. Chayes (dale at lamont.ldgo.columbia.edu)
-dnl    Lamont-Doherty Earth Observatory
-dnl    Palisades, NY  10964
-dnl
-dnl    See README file for copying and redistribution conditions.
-dnl--------------------------------------------------------------------
-
-dnl Require automake 2.65 or later
-AC_PREREQ([2.65])
-
-dnl Disable configure caching
-define([AC_CACHE_LOAD], )
-define([AC_CACHE_SAVE], )
-
-dnl Initialize and set version and version date
-AC_INIT([mbsystem],[5.5.2242],[http://listserver.mbari.org/sympa/arc/mbsystem],[mbsystem],[http://www.mbari.org/data/mbsystem/])
-
-AC_CONFIG_MACRO_DIR(m4)
-AC_LANG(C)
-AC_DEFINE(VERSION_DATE, "16 May 2015", [Set VERSION_DATE define in mb_config.h])
-
-dnl Check system arch
-AC_CANONICAL_HOST
-
-AS_ECHO([" "])
-AS_ECHO(["------------------------------------------------------------------------------"])
-AS_ECHO(["    The MB-system:	configure	12/7/2011"])
-AS_ECHO(["    $Id: configure.ac 2242 2015-05-16 05:21:28Z caress $"])
-AS_ECHO([" "])
-AS_ECHO(["    Copyright (c) 2011-2015 by"])
-AS_ECHO(["    D. W. Caress (caress at lamont.ldgo.columbia.edu)"])
-AS_ECHO(["    and D. N. Chayes (dale at lamont.ldgo.columbia.edu)"])
-AS_ECHO(["    Lamont-Doherty Earth Observatory"])
-AS_ECHO(["    Palisades, NY  10964"])
-AS_ECHO([" "])
-AS_ECHO(["    See README file for copying and redistribution conditions."])
-AS_ECHO(["------------------------------------------------------------------------------"])
-AS_ECHO([" "])
-AS_ECHO(["    The initial version of the MB-System autoconf-based build system"])
-AS_ECHO(["    was contributed by Bob Covill on 7 December 2011. Further"])
-AS_ECHO(["    refinement of the build system involved contributions from"])
-AS_ECHO(["    Bob Covill, Kurt Schwehr, Hamish Bowman, David Caress, and"])
-AS_ECHO(["    Christian Ferreira."])
-AS_ECHO([" "])
-AS_ECHO(["------------------------------------------------------------------------------"])
-AS_ECHO(["    To modify this build system..."])
-AS_ECHO(["------------------------------------------------------------------------------"])
-AS_ECHO([" "])
-AS_ECHO(["    Edit the file configure.ac in the top directory and the files"])
-AS_ECHO(["    Makefile.am in each directory under src. Then run the following sequence"])
-AS_ECHO(["    of commands:"])
-AS_ECHO([" "])
-AS_ECHO(["        # Build libtool files for LT_INIT"])
-AS_ECHO(["        libtoolize --force --copy"])
-AS_ECHO(["        aclocal"])
-AS_ECHO([" "])
-AS_ECHO(["        # Build custom header for configure"])
-AS_ECHO(["        autoheader"])
-AS_ECHO(["        automake --add-missing --include-deps"])
-AS_ECHO(["        autoconf"])
-AS_ECHO([" "])
-AS_ECHO(["        # To update configure files use the following:"])
-AS_ECHO(["        autoupdate"])
-AS_ECHO(["        autoreconf --force --install --warnings=all"])
-AS_ECHO([" "])
-AS_ECHO(["        # Reset the autotools version to 2.65 to accomodate some Linux distributions"])
-AS_ECHO(["        sed -i.bak s/2\.69/2\.65/ configure.ac"])
-AS_ECHO([" "])
-AS_ECHO(["    When you run ./configure, a number of configure options are saved to a"])
-AS_ECHO(["    header file:"])
-AS_ECHO(["        ./src/mbio/mb_config.h"])
-AS_ECHO(["    This file has a template:"])
-AS_ECHO(["        ./src/mbio/mb_config.h.in"])
-AS_ECHO(["    This file is conditionally included by:"])
-AS_ECHO(["        ./src/mbio/mb_define.h"])
-AS_ECHO(["    which is in turn included by essentially every MB-System C source file."])
-AS_ECHO([" "])
-AS_ECHO(["------------------------------------------------------------------------------"])
-AS_ECHO(["    To use the build system..."])
-AS_ECHO(["------------------------------------------------------------------------------"])
-AS_ECHO(["    To generate the makefiles needed to build MB-System, run ./configure"])
-AS_ECHO(["    with the options appropriate for your situation. These options are"])
-AS_ECHO(["    listed here:"])
-AS_ECHO(["        --prefix=install      - location for mbsystem (/usr/local/mbsystem)"])
-AS_ECHO(["        --with-netcdf-lib     - location of NetCDF libs"])
-AS_ECHO(["        --with-netcdf-include - location of NetCDF headers"])
-AS_ECHO(["        --with-proj-lib       - location of PROJ libs"])
-AS_ECHO(["        --with-proj-include   - location of PROJ headers"])
-AS_ECHO(["        --with-gmt-lib        - location of GMT libs"])
-AS_ECHO(["        --with-gmt-include    - location of GMT headers"])
-AS_ECHO(["        --with-fftw-lib       - location of FFTW3 libs (optional)"])
-AS_ECHO(["        --with-fftw-include   - location of FFTW3 headers (optional)"])
-AS_ECHO(["        --with-motif-lib      - location of Motif libs (optional)"])
-AS_ECHO(["        --with-motif-include  - location of Motif headers (optional)"])
-AS_ECHO(["        --with-opengl-lib     - location of OpenGL libs (optional)"])
-AS_ECHO(["        --with-opengl-include - location of OpenGL headers (optional)"])
-AS_ECHO(["        --with-otps-dir       - location of OTPS installation (optional)"])
-AS_ECHO(["        --enable-bundledproj  - build using bundled proj package - default is to link with libproj"])
-AS_ECHO([" "])
-AS_ECHO(["    After configure you can run the make utility in the usual fashion"])
-AS_ECHO(["        make"])
-AS_ECHO(["        make install"])
-AS_ECHO([" "])
-AS_ECHO(["    Some other useful make commands include: "])
-AS_ECHO(["        make clean (to clean up compiled code)"])
-AS_ECHO(["        make distclean (to clean up compiled code and configure output)"])
-AS_ECHO(["        make uninstall (to remove a previously installed version)"])
-AS_ECHO(["------------------------------------------------------------------------------"])
-AS_ECHO([" "])
-AS_ECHO(["Configure will now attempt to construct the Makefiles required to build MB-System"])
-AS_ECHO(["MB-System Version $PACKAGE_VERSION"])
-AS_ECHO(["HOST System Type: ${host}"])
-AS_ECHO([" "])
-
-AM_INIT_AUTOMAKE
-AM_MAINTAINER_MODE
-AC_CONFIG_HEADERS([src/mbio/mb_config.h])
-
-dnl Check for programs
-AC_PROG_CC
-AM_PROG_CC_C_O
-AC_PROG_INSTALL
-AM_PROG_AS
-m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
-AC_PROG_LN_S
-AC_PROG_MAKE_SET
-LT_INIT
-AC_SUBST([LIBTOOL_DEPS])
-LT_LIB_M
-
-dnl Check Endian size
-BYTESWAP=no
-AC_C_BIGENDIAN([BYTESWAP=no], [BYTESWAP=yes],
-	AC_MSG_ERROR(Unknown endian state),
-	AC_MSG_ERROR(Universial endianess not supported)
-)
-if test BYTESWAP == "no" ; then
-	AC_DEFINE(ENDIAN_BIG, 1, [Machine is bigendian, (Byteswapping off)])
-else
-	AC_DEFINE(BYTESWAPPED, 1, [Machine is littleendian, (Byteswapping on)])
-fi
-
-dnl Check for headers
-AC_HEADER_STDC
-
-dnl Check for math lib
-AC_CHECK_LIB(m,exp,,,)
-
-dnl check for signed char
-AC_TYPE_INT8_T
-
-dnl check for malloc header
-AC_CHECK_HEADER(malloc.h, AC_DEFINE(HAVE_MALLOC_H, 1, [Have malloc.h]))
-
-dnl Parse host_os from CANONICAL and deterimine
-dnl if solaris flag required
-case "${host_os}" in
-	solaris*|sunos*) CFLAGS="${CFLAGS} -DSUN" ;;
-	*) AS_ECHO(["Build does not require -DSUN CFLAG"]) ;;
-esac
-
-dnl check for win32 flag
-case "${host_os}" in
-	*mingw32*|cygwin*)
-	AC_DEFINE(WIN32, 1, [Turned on WIN32 define in config])
-	AS_ECHO(["Added WIN32 define to mb_config.h"])
-	;;
-	*)
-	AS_ECHO(["Not WIN32 system"])
-	;;
-esac
-
-dnl check for RPC XDR headers needed by mbio lib
-AC_CHECK_HEADERS(rpc/rpc.h)
-AC_CHECK_HEADERS(rpc/types.h, ,
-                 [AC_MSG_ERROR([Required header <rpc/types.h> not found, check include path and intsalled devel packages])],)
-
-dnl for win32
-dnl AC_CHECK_LIB(uuid, main)
-dnl AC_CHECK_LIB(ole32, main)
-dnl AC_CHECK_LIB(gw32c, main)
-dnl AC_CHECK_LIB(wsock32, main)
-AC_CHECK_LIB(ws2_32, main)
-
-AC_CHECK_FUNC(xdrmem_create, XDR_LIB=, [
- AC_CHECK_LIB(sun, xdrmem_create, XDR_LIB=-lsun, [
-  AC_CHECK_LIB(nsl, xdrmem_create, XDR_LIB=-lnsl, [
-   AC_CHECK_LIB(rpclib, xdrmem_create, XDR_LIB=-lrpclib, [
-    AC_CHECK_LIB(xdr, xdrmem_create, XDR_LIB=-lxdr, [
-     AC_CHECK_LIB(portablexdr, xdrmem_create, XDR_LIB=-lportablexdr,
-   [ AC_MSG_ERROR([*** Unable to locate XDR functions.]) ], -lws2_32 )
-], -lws2_32 )])])])])
-AC_SUBST(XDR_LIB)
-
-dnl Use OTPS (OSU Tidal Prediction Software) location if specified with --with-otps_dir, use default otherwise
-AS_ECHO(["Use OTPS (OSU Tidal Prediction Software) location if specified with --with-otps_dir, use default otherwise"])
-OTPS_DIR="/usr/local/OTPSnc"
-AC_ARG_WITH(otps_dir, [  --with-otps_dir=DIR        Location of OSU Tidal Prediction Software], [OTPS_DIR=${withval}])
-AC_SUBST(OTPS_DIR)
-
-dnl Check for netCDF library
-AS_ECHO(["Check for netCDF library libnetcdf"])
-GOT_CDF=no
-CDF_SETTING=no
-dnl First check if netcdf location specified on the command line
-AC_ARG_WITH(netcdf-lib, [  --with-netcdf-lib=DIR	Location of NetCDF library],
-	[netcdf_libdir="${withval}"] [GOT_CDF=yes], [GOT_CDF=no])
-if test "$GOT_CDF" = "yes" ; then
-    dnl NetCDF library location specified: $netcdf_libdir - check if libnetcdf is there...
-    AS_ECHO(["NetCDF library location specified: $netcdf_libdir - check if libnetcdf is there..."])
-    save_LDFLAGS=$LDFLAGS
-    LDFLAGS="$LDFLAGS -L$netcdf_libdir"
-    AC_CHECK_LIB([netcdf], [nc_open], [CDF_SETTING=yes], [CDF_SETTING=no], )
-    LDFLAGS="$save_LDFLAGS"
-    if test "$CDF_SETTING" = "no"; then
-	AC_MSG_ERROR([Did not find libnetcdf according to --with-netcdf-lib - check the installation!])
-    fi
-    libnetcdf_LIBS="-L$netcdf_libdir -R $netcdf_libdir -lnetcdf"
-    libnetcdf_LDFLAGS="-L$netcdf_libdir"
-else
-    dnl Look for pkg-config netCDF package...
-    AS_ECHO(["Look for pkg-config netCDF package..."])
-    PKG_CHECK_MODULES([libnetcdf], [netcdf], [GOT_CDF=yes], [GOT_CDF=no])
-    libnetcdf_LIBS="-lnetcdf"
-    libnetcdf_LDFLAGS=""
-fi
-if test "$GOT_CDF" = "no" ; then
-    dnl Did not find netCDF library pkg-config package, looking in the usual places...
-    AS_ECHO(["Did not find netCDF library pkg-config package, looking in the usual places..."])
-    AC_CHECK_LIB([netcdf], [nc_open], [CDF_SETTING=yes], [CDF_SETTING=no],)
-    if test "$CDF_SETTING" = "yes" ; then
-        GOT_CDF=yes
-        AS_ECHO(["Using pre-installed libnetcdf..."])
-        libnetcdf_LIBS="-lnetcdf"
-        libnetcdf_LDFLAGS=""
-    else
-        AS_ECHO(["Did not find netCDF library anywhere, use --with-netcdf-lib to set the location"])
-        AC_MSG_ERROR([Did not find netCDF library anywhere, use --with-netcdf-lib to set the location])
-    fi
-fi
-dnl Done checking for netCDF library libnetcdf
-
-dnl Check for netCDF headers
-AS_ECHO(["Check for netCDF headers"])
-GOT_CDF=no
-CDF_SETTING=no
-dnl First check if netcdf location specified on the command line
-AC_ARG_WITH(netcdf-include, [  --with-netcdf-include=DIR	Location of NetCDF headers],
-	[libnetcdf_CPPFLAGS="-I${withval}"] [GOT_CDF=yes], [GOT_CDF=no])
-if test "$GOT_CDF" = "yes" ; then
-    dnl NetCDF header location specified: $libnetcdf_CPPFLAGS - check if netcdf.h is there...
-    AS_ECHO(["NetCDF header location specified: $libnetcdf_CPPFLAGS - check if netcdf.h is there..."])
-    save_CPPFLAGS=$CPPFLAGS
-    save_CFLAGS=$CFLAGS
-    CPPFLAGS="$CPPFLAGS $libnetcdf_CPPFLAGS"
-    CFLAGS="$CFLAGS $libnetcdf_CPPFLAGS"
-    AC_CHECK_HEADER(netcdf.h, [CDF_SETTING=yes], [CDF_SETTING=no],)
-    CPPFLAGS=$save_CPPFLAGS
-    CFLAGS=$save_CFLAGS
-    if test "$CDF_SETTING" = "no"; then
-	AC_MSG_ERROR([Did not find netcdf.h according to --with-netcdf-include - check the installation!])
-    fi
-else
-    dnl Looking for netCDF headers in the usual places...
-    AS_ECHO(["Looking for netCDF headers in the usual places..."])
-    AC_CHECK_HEADER(netcdf.h, [CDF_SETTING=yes], [CDF_SETTING=no])
-    if test "$CDF_SETTING" = "yes" ; then
-        GOT_CDF=yes
-        AS_ECHO(["Using pre-installed netCDF headers..."])
-    else
-        AS_ECHO(["Did not find netCDF headers anywhere, use --with-netcdf-include to set the location"])
-        AC_MSG_ERROR([Did not find netCDF headers anywhere, use --with-netcdf-include to set the location])
-    fi
-fi
-AC_SUBST([libnetcdf_CPPFLAGS], [$libnetcdf_CPPFLAGS])
-dnl Done checking for netCDF headers
-
-dnl check whether to use bundled proj package or link with external libproj
-AC_ARG_ENABLE(bundledproj, [AS_HELP_STRING([--enable-bundledproj], [build and use the bundled proj package])],
-        [bundledproj=yes], [bundledproj=no])
-AM_CONDITIONAL([BUILD_PROJ], [test x"$bundledproj" = xyes])
-        
-dnl Using bundled PROJ
-if test "$bundledproj" = "yes" ; then
-    AS_ECHO(["Using bundled PROJ lib"])
-    libproj_LIBS="-lproj"
-    libproj_LDFLAGS=
-    AC_SUBST([libproj_LIBS], ["$libproj_LIBS"])
-
-dnl Linking with external PROJ
-else
-
-    dnl Check for PROJ lib
-    AS_ECHO(["Check for PROJ"])
-    GOT_PROJ=no
-    PROJ_SETTING=no
-    dnl first check for package
-    PKG_CHECK_MODULES([libproj], [proj], [GOT_PROJ=yes], [GOT_PROJ=no])
-    
-    dnl Package check failed so check manually
-    if test "$GOT_PROJ" = "no" ; then
-    
-    libproj_LIBS="-lproj"
-    libproj_LDFLAGS=
-    
-    dnl arg for command line
-    AC_ARG_WITH(proj-lib, [  --with-proj-lib=DIR	Location of PROJ library],
-            [proj_libdir="${withval}"] [GOT_PROJ=yes], [GOT_PROJ=no])
-    dnl First check if lib installed
-    if test "$GOT_PROJ" = "no" ; then
-     AC_CHECK_LIB([proj], [pj_init_plus], [PROJ_SETTING=yes], [PROJ_SETTING=no],)
-    fi
-     if test "$PROJ_SETTING" = "yes" ; then
-        GOT_PROJ=yes
-        AS_ECHO(["Using pre-installed libproj."])
-     else
-        if test "$GOT_PROJ" = "no" ; then
-            AC_MSG_ERROR([Did not find libproj, use --with-proj-lib])
-        else
-            AS_ECHO(["Looking for libproj in $proj_libdir ..."])
-            save_LDFLAGS=$LDFLAGS
-            LDFLAGS="$LDFLAGS -L$proj_libdir"
-            AC_CHECK_LIB([proj], [pj_init_plus], [PROJ_SETTING=yes], [PROJ_SETTING=no], )
-            LDFLAGS="$save_LDFLAGS"
-            if test "$PROJ_SETTING" = "no"; then
-               AC_MSG_ERROR([Did not find libproj, use --with-proj-lib or check installation])
-            fi
-            libproj_LIBS="-L$proj_libdir -R $proj_libdir $libproj_LIBS"
-            libproj_LDFLAGS="-L$proj_libdir"
-        fi
-     fi
-     dnl Use ac_subst to set vars that would be set by pkg_check
-     AC_SUBST([libproj_LIBS], ["$libproj_LIBS"])
-    fi
-    dnl done with PROJ lib
-
-    dnl Now check PROJ headers
-    GOT_PROJ=no
-    PROJ_SETTING=no
-    dnl add command line option
-    AC_ARG_WITH(proj-include, [  --with-proj-include=DIR	Location of PROJ headers],
-            [libproj_CPPFLAGS="-I${withval}"] [GOT_PROJ=yes], [GOT_PROJ=no])
-    dnl First check if PROJ headers installed
-    if test "$GOT_PROJ" = "no" ; then
-        AC_CHECK_HEADER(proj_api.h, [PROJ_SETTING=yes], [PROJ_SETTING=no])
-    fi
-    if test "$PROJ_SETTING" = "yes" ; then
-        GOT_PROJ=yes
-        AS_ECHO(["Using pre-installed PROJ headers."])
-    else
-        if test "$GOT_PROJ" = "no" ; then
-            AC_MSG_ERROR([Did not find required PROJ headers, use --with-proj-include])
-        else
-            AS_ECHO(["Checking proj_api.h in $libproj_CPPFLAGS..."])
-            save_CPPFLAGS=$CPPFLAGS
-            save_CFLAGS=$CFLAGS
-            CPPFLAGS="$CPPFLAGS $libproj_CPPFLAGS"
-            CFLAGS="$CFLAGS $libproj_CPPFLAGS"
-            AC_CHECK_HEADER(proj_api.h, [PROJ_SETTING=yes], [PROJ_SETTING=no],)
-            CPPFLAGS=$save_CPPFLAGS
-            CFLAGS=$save_CFLAGS
-            if test "$PROJ_SETTING" = "no"; then
-               AC_MSG_ERROR([Did not find required PROJ headers, use --with-proj-include])
-            fi
-        fi
-    fi
-    AC_SUBST([libproj_CPPFLAGS], [$libproj_CPPFLAGS])
-    dnl done with PROJ headers
-    
-fi
-dnl Done linking with external PROJ
-
-dnl Check for Generic Mapping Tools (GMT) libs
-dnl - these are libgmt, libpsl
-dnl Would certainly be nice if GMT had pkg-config file (gmt.pc)...
-AS_ECHO(["Check for Generic Mapping Tools (GMT)"])
-GOT_GMTPKG=no
-dnl first check for package
-PKG_CHECK_MODULES([libgmt], [gmt], [GOT_LIBGMT=yes], [GOT_LIBGMT=no])
-PKG_CHECK_MODULES([libpsl], [gmt], [GOT_LIBPSL=yes], [GOT_LIBPSL=no])
-if test "$GOT_LIBGMT" = "yes" ; then
-	GOT_GMTPKG=yes
-fi
-if test "$GOT_PSL" = "no" ; then
-	GOT_GMTPKG=no
-fi
-
-dnl pkg-config check failed so try to find libraries and headers manually
-if test "$GOT_GMTPKG" = "no" ; then
-
-	GMT_SETTING=no
-	GOT_GMTLIBS=no
-	libgmt_LIBS="-lgmt -lpsl"
-	dnl arg for command line
-	AC_ARG_WITH(gmt-lib, [  --with-gmt-lib=DIR	Location of GMT libraries],
-	       [gmt_libdir="${withval}"] [GOT_GMTLIBS=yes], [GOT_GMTLIBS=no])
-	dnl First check if lib installed
-	if test "$GOT_GMTLIBS" = "no" ; then
-		AC_CHECK_LIB([gmt], [GMT_begin], [GMT_SETTING=yes], [GMT_SETTING=no],)
-	fi
-	if test "$GMT_SETTING" = "yes" ; then
-		AS_ECHO(["Using pre-installed libgmt."])
-	else
-		if test "$GOT_GMTLIBS" = "no" ; then
-			AC_MSG_ERROR([Did not find libgmt, use --with-gmt-lib])
-		else
-			AS_ECHO(["Looking for libgmt in $gmt_libdir ..."])
-			save_LDFLAGS=$LDFLAGS
-			save_LIBS=$LIBS
-			LDFLAGS="$LDFLAGS -L$gmt_libdir $libnetcdf_LDFLAGS"
-			LIBS="$LDFLAGS -lnetcdf $LIBM"
-			AC_MSG_NOTICE(LDFLAGS $LDFLAGS)
-			AC_MSG_NOTICE(LIBS $LIBS)
-			AC_CHECK_LIB([gmt], [GMT_begin], [GMT_SETTING=yes], [GMT_SETTING=no], )
-			LDFLAGS="$save_LDFLAGS"
-			LIBS="$save_LIBS"
-			if test "$GMT_SETTING" = "no"; then
-				AC_MSG_ERROR([Did not find libgmt, use --with-gmt-lib or check installation])
-			fi
-			libgmt_LIBS="-L$gmt_libdir -R$gmt_libdir $libgmt_LIBS"
-		fi
-	fi
-
-	dnl Now look for GMT headers
-	GOT_GMTHEADERS=no
-	GMT_SETTING=no
-	libgmt_CPPFLAGS=
-	dnl add command line option
-	AC_ARG_WITH(gmt-include, [  --with-gmt-include=DIR	Location of GMT headers],
-		[libgmt_CPPFLAGS="-I${withval}"] [GOT_GMTHEADERS=yes], [GOT_GMTHEADERS=no])
-
-	dnl First check if gmt headers installed
-	dnl Only if no arg given
-	if test "$GOT_GMTHEADERS" = "no" ; then
-		AC_CHECK_HEADER(gmt.h, [GMT_SETTING=yes], [GMT_SETTING=no])
-	fi
-
-	if test "$GMT_SETTING" = "yes" ; then
-		GOT_GMTHEADERS=yes
-		AS_ECHO(["Using pre-installed gmt headers."])
-	else
-		if test "$GOT_GMTHEADERS" = "no" ; then
-			AC_MSG_ERROR([Did not find required GMT headers, use --with-gmt-include])
-		else
-			AS_ECHO(["Checking gmt.h in $libgmt_CPPFLAGS..."])
-			save_CPPFLAGS=$CPPFLAGS
-			save_CFLAGS=$CFLAGS
-			CPPFLAGS="$CPPFLAGS $libgmt_CPPFLAGS $libnetcdf_CPPFLAGS"
-			CFLAGS="$CFLAGS $libgmt_CPPFLAGS $libnetcdf_CPPFLAGS"
-			AC_CHECK_HEADER(gmt.h, [GMT_SETTING=yes], [GMT_SETTING=no])
-			CPPFLAGS=$save_CPPFLAGS
-			CFLAGS=$save_CFLAGS
-			if test "$GMT_SETTING" = "no"; then
-				AC_MSG_ERROR([Did not find required GMT headers, use --with-gmt-include])
-			fi
-		fi
-	fi
-	AS_ECHO(["Setting libgmt_CPPFLAGS=$libgmt_CPPFLAGS"])
-	AC_SUBST([libgmt_CPPFLAGS], [$libgmt_CPPFLAGS])
-	dnl done with GMT headers
-fi
-
-AS_ECHO(["Setting libgmt_LIBS=$libgmt_LIBS"])
-AC_SUBST([libgmt_LIBS], ["$libgmt_LIBS"])
-
-dnl done with GMT
-
-
-dnl Deal with FFTW for mbsegypsd
-dnl seems to want fftw3 ... do not check for older fftw?
-GOT_FFTW=no
-FFTW_SETTING=no
-USE_FFTW=
-libfftw_CPPFLAGS=
-dnl first check for package
-PKG_CHECK_MODULES([libfftw], [fftw3], [GOT_FFTW=yes], [GOT_FFTW=no])
-
-dnl Package check failed so check manually
-if test "$GOT_FFTW" = "no" ; then
-
-libfftw_LIBS="-lfftw3"
-dnl arg for command line
-AC_ARG_WITH(fftw-lib, [  --with-fftw-lib=DIR	Location of FFTW3 library],
-	[fftw_libdir="${withval}"] [GOT_FFTW=yes], [GOT_FFTW=no])
-dnl First check if lib installed
-if test "$GOT_FFTW" = "no" ; then
- AC_CHECK_LIB([fftw3], [fftw_plan_dft_1d], [FFTW_SETTING=yes], [FFTW_SETTING=no])
-fi
- if test "$FFTW_SETTING" = "yes" ; then
-    GOT_FFTW=yes
-    USE_FFTW=mbsegypsd
-    AS_ECHO(["Using pre-installed FFTW3 lib."])
- else
-    if test "$GOT_FFTW" = "no" ; then
-	AS_ECHO(["Did not find libfftw3, use --with-fftw-lib, (FFTW disabled)"])
-    else
-	AS_ECHO(["Looking for libfftw3 in $libfftw_CFLAGS ..."])
-	save_LDFLAGS=$LDFLAGS
-	LDFLAGS="$LDFLAGS -L$fftw_libdir"
-	AC_CHECK_LIB([fftw3], [fftw_plan_dft_1d], [FFTW_SETTING=yes], [FFTW_SETTING=no])
-	LDFLAGS="$save_LDFLAGS"
-	if test "$FFTW_SETTING" = "no"; then
-	   	AS_ECHO(["libfftw not found, FFTW support is disabled"])
-		GOT_FFTW=no
-		USE_FFTW=
-	else
-		GOT_FFTW=yes
-		USE_FFTW=mbsegypsd
-		libfftw_LIBS="-L$fftw_libdir -R $fftw_libdir $libfftw_LIBS"
-	fi
-    fi
- fi
- if test "$GOT_FFTW" = "yes" ; then
-	AC_SUBST([libfftw_LIBS], ["$libfftw_LIBS"])
- fi
-fi
-dnl done with FFTW lib
-
-
-dnl Now check FFTW headers
-dnl Only check for headers if lib check pass
-if test "$GOT_FFTW" = "yes" ; then
-GOT_FFTW=no
-FFTW_SETTING=no
-dnl add command line option
-AC_ARG_WITH(fftw-include, [  --with-fftw-include=DIR	Location of FFTW headers],
-	[libfftw_CPPFLAGS="-I${withval}"] [GOT_FFTW=yes], [GOT_FFTW=no])
-
-dnl First check if fftw headers installed
-if test "$GOT_FFTW" = "no" ; then
-  AC_CHECK_HEADER(fftw3.h, [FFTW_SETTING=yes], [FFTW_SETTING=no],)
-fi
- if test "$FFTW_SETTING" = "yes" ; then
-    GOT_FFTW=yes
-    AS_ECHO(["Using pre-installed fftw3 headers."])
- else
-    if test "$GOT_FFTW" = "no" ; then
-	AS_ECHO(["Did not find FFTW headers, use --with-fftw-inc, (FFTW Disabled)"])
-    else
-	AS_ECHO(["Checking fftw3.h in $libfftw_CPPFLAGS..."])
-	save_CPPFLAGS=$CPPFLAGS
-	save_CFLAGS=$CFLAGS
-	CPPFLAGS="$CPPFLAGS $libfftw_CPPFLAGS"
-	CFLAGS="$CFLAGS $libfftw_CPPFLAGS"
-	AC_CHECK_HEADER(fftw3.h, [FFTW_SETTING=yes], [FFTW_SETTING=no],)
-	CPPFLAGS=$save_CPPFLAGS
-	CFLAGS=$save_CFLAGS
-	if test "$FFTW_SETTING" = "no"; then
-	   AS_ECHO(["Did not find FFTW headers, FFTW support disabled"])
-	   GOT_FFTW=no
-	   USE_FFTW=
-	   FFTW_LIB=
-	fi
-    fi
- fi
-
-if test "$GOT_FFTW" = "yes" ; then
-	AC_SUBST([fftw_app], [$USE_FFTW])
-	AC_SUBST([libfftw_CPPFLAGS], [$libfftw_CPPFLAGS])
-fi
-dnl done with FFTW headers
-fi
-
-AM_CONDITIONAL([BUILD_FFTW], [test "$GOT_FFTW" = yes])
-
-
-dnl Deal with Motif for GUI
-dnl Xm, Xt and X11
-GOT_MOTIF=no
-MOTIF_SETTING=no
-motif_LIBS="-lXm -lXt -lX11"
-motif_CPPFLAGS=
-dnl arg for command line
-AC_ARG_WITH(motif-lib, [  --with-motif-lib=DIR	Location of MOTIF library],
-	[motif_libdir="${withval}"] [GOT_MOTIF=yes], [GOT_MOTIF=no])
-dnl First check if lib installed
-if test "$GOT_MOTIF" = "no" ; then
-  AC_CHECK_LIB([Xm], [XmCreatePushButton], [MOTIF_SETTING=yes], [MOTIF_SETTING=no])
-  if test "$MOTIF_SETTING" = "yes" ; then
-	AC_CHECK_LIB([Xt], [XtAppMainLoop], [MOTIF_SETTING=yes], [MOTIF_SETTING=no])
-	if test "$MOTIF_SETTING" = "yes" ; then
-		AC_CHECK_LIB([X11], [XSendEvent], [MOTIF_SETTING=yes], [MOTIF_SETTING=no])
-	fi
-  fi
-fi
-
-dnl Now try from args
- if test "$MOTIF_SETTING" = "yes" ; then
-    GOT_MOTIF=yes
-    AS_ECHO(["Using pre-installed MOTIF libs."])
- else
-    if test "$GOT_MOTIF" = "no" ; then
-	AS_ECHO(["Did not find Motif libs (Xt, Xm, and X11), use --with-motif-lib, (Motif disabled)"])
-    else
-	AS_ECHO(["Looking for Motif Libs in $motif_libdir ..."])
-	save_LDFLAGS=$LDFLAGS
-	save_LIBS=$LIBS
-	LDFLAGS="$LDFLAGS -L$motif_libdir"
-	LIBS="$LIBS $motif_LIBS"
-	AC_CHECK_LIB([Xm], [XmCreatePushButton], [MOTIF_SETTING=yes], [MOTIF_SETTING=no])
-  	if test "$MOTIF_SETTING" = "yes" ; then
-		AC_CHECK_LIB([Xt], [XtAppMainLoop], [MOTIF_SETTING=yes], [MOTIF_SETTING=no])
-		if test "$MOTIF_SETTING" = "yes" ; then
-			AC_CHECK_LIB([X11], [XSendEvent], [MOTIF_SETTING=yes], [MOTIF_SETTING=no])
-		fi
-  	fi
-	LDFLAGS=$save_LDFLAGS
-	LIBS=$save_LIBS
-	if test "$MOTIF_SETTING" = "no"; then
-	   	AS_ECHO(["Motif libs not found, Motif support is disabled"])
-		GOT_MOTIF=no
-	else
-		GOT_MOTIF=yes
-		motif_LIBS="-L$motif_libdir -R $motif_libdir $motif_LIBS"
-	fi
-    fi
- fi
-
-if test "$GOT_MOTIF" = "yes" ; then
-	AC_SUBST([motif_LIBS], ["$motif_LIBS"])
-fi
-dnl done with Motif libs
-
-dnl Now check Motif headers only if lib check passed
-if test "$GOT_MOTIF" = "yes" ; then
-GOT_MOTIF=no
-MOTIF_SETTING=no
-dnl add command line option
-AC_ARG_WITH(motif-include, [  --with-motif-include=DIR	Location of Motif headers],
-	[motif_CPPFLAGS="-I${withval}"] [GOT_MOTIF=yes], [GOT_MOTIF=no])
-
-dnl First check if Motif headers installed
-if test "$GOT_MOTIF" = "no" ; then
-  AC_CHECK_HEADER(X11/Intrinsic.h, [MOTIF_SETTING=yes], [MOTIF_SETTING=no],)
-fi
- if test "$MOTIF_SETTING" = "yes" ; then
-    GOT_MOTIF=yes
-    AS_ECHO(["Using pre-installed Motif headers."])
- else
-    if test "$GOT_MOTIF" = "no" ; then
-	AS_ECHO(["Did not find Motif headers, use --with-motif-inc, (Motif Disabled)"])
-    else
-	AS_ECHO(["Checking X11/Intrinsic.h in $MOTIF_INC_DIR..."])
-	save_CPPFLAGS=$CPPFLAGS
-	save_CFLAGS=$CFLAGS
-	CPPFLAGS="$CPPFLAGS $motif_CPPFLAGS"
-	CFLAGS="$CFLAGS $motif_CPPFLAGS"
-	AC_CHECK_HEADER(X11/Intrinsic.h, [MOTIF_SETTING=yes], [MOTIF_SETTING=no],)
-	CPPFLAGS=$save_CPPFLAGS
-	CFLAGS=$save_CFLAGS
-	if test "$MOTIF_SETTING" = "no"; then
-	   AS_ECHO(["Did not find Motif headers, Motif support disabled"])
-	   GOT_MOTIF=no
-	fi
-    fi
- fi
-
-if test "$GOT_MOTIF" = "yes" ; then
-	AC_SUBST([motif_CPPFLAGS], [$motif_CPPFLAGS])
-	AC_DEFINE(GOT_MOTIF, 1, [Turned on Motif define in config])
-fi
-dnl done with Motif headers
-fi
-
-AM_CONDITIONAL([BUILD_MOTIF], [test "$GOT_MOTIF" = yes])
-
-
-dnl OpenGL Check
-dnl Libs GL and GLU
-GOT_GL=no
-
-dnl Only check for GL if Motif Passed
-if test "$GOT_MOTIF" = "yes" ; then
-
-GL_SETTING=no
-GL_LIBS="-lGL -lGLU"
-GL_CPPFLAGS=
-dnl arg for command line
-AC_ARG_WITH(opengl-lib, [  --with-opengl-lib=DIR	Location of OpenGL library],
-	[opengl_libdir="${withval}"] [GOT_GL=yes], [GOT_GL=no])
-dnl First check if lib installed
-if test "$GOT_GL" = "no" ; then
-  AC_CHECK_LIB([GL], [main], [GL_SETTING=yes], [GL_SETTING=no])
-  if test "$GL_SETTING" = "yes" ; then
-	AC_CHECK_LIB([GLU], [main], [GL_SETTING=yes], [GL_SETTING=no], -lGL)
-  fi
-fi
-
-dnl Now try from args
- if test "$GL_SETTING" = "yes" ; then
-    GOT_GL=yes
-    AS_ECHO(["Using pre-installed OpenGL libs."])
- else
-    if test "$GOT_GL" = "no" ; then
-	AS_ECHO(["Did not find OpenGL libs (GL and GLU), use --with-opengl-lib, (OpenGL disabled)"])
-    else
-	AS_ECHO(["Looking for OpenGL Libs in $opengl_libdir ..."])
-	save_LDFLAGS=$LDFLAGS
-	save_LIBS=$LIBS
-	LDFLAGS="$LDFLAGS -L$opengl_libdir"
-	LIBS="$LIBS $GL_LIBS"
-	AC_CHECK_LIB([GL], [main], [GL_SETTING=yes], [GL_SETTING=no])
-  	if test "$GL_SETTING" = "yes" ; then
-		AC_CHECK_LIB([GLU], [main], [GL_SETTING=yes], [GL_SETTING=no])
-  	fi
-	LDFLAGS=$save_LDFLAGS
-	LIBS=$save_LIBS
-	if test "$GL_SETTING" = "no"; then
-	   	AS_ECHO(["OpenGL libs not found, OpenGL support is disabled"])
-		GOT_GL=no
-	else
-		GOT_GL=yes
-		GL_LIBS="-L$opengl_libdir -R $opengl_libdir $GL_LIBS"
-	fi
-    fi
- fi
-
-if test "$GOT_GL" = "yes" ; then
-	AC_SUBST([GL_LIBS], ["$GL_LIBS"])
-fi
-dnl done with GL libs
-
-
-dnl Now check OpenGL headers
-dnl Only check for headers if lib passed
-if test "$GOT_GL" = "yes" ; then
-GOT_GL=no
-GL_SETTING=no
-dnl add command line option
-AC_ARG_WITH(opengl-include, [  --with-opengl-include=DIR	Location of OpenGL headers],
-	[GL_CPPFLAGS="-I${withval}"] [GOT_GL=yes], [GOT_GL=no])
-
-dnl First check if OpenGL headers installed
-if test "$GOT_GL" = "no" ; then
-  AC_CHECK_HEADERS(GL/gl.h GL/glu.h GL/glx.h, [GL_SETTING=yes], [GL_SETTING=no])
-fi
- if test "$GL_SETTING" = "yes" ; then
-    GOT_GL=yes
-    AS_ECHO(["Using pre-installed OpenGL headers."])
- else
-    if test "$GOT_GL" = "no" ; then
-	AS_ECHO(["Did not find OpenGL headers, use --with-opengl-inc, (OpenGL Disabled)"])
-    else
-	AS_ECHO(["Checking OpenGL Headers in $GL_CPPFLAGS..."])
-	save_CPPFLAGS=$CPPFLAGS
-	save_CFLAGS=$CFLAGS
-	CPPFLAGS="$CPPFLAGS $GL_CPPFLAGS"
-	CFLAGS="$CFLAGS $GL_CPPFLAGS"
-	AC_CHECK_HEADERS(GL/gl.h GL/glu.h GL/glx.h, [GL_SETTING=yes], [GL_SETTING=no])
-	CPPFLAGS=$save_CPPFLAGS
-	CFLAGS=$save_CFLAGS
-	if test "$GL_SETTING" = "no"; then
-	   AS_ECHO(["Did not find OpenGL headers, OpenGL support disabled"])
-	   GOT_GL=no
-	fi
-    fi
- fi
-
-if test "$GOT_GL" = "yes" ; then
-	AC_SUBST([GL_CPPFLAGS], [$GL_CPPFLAGS])
-	AC_DEFINE(GOT_GL, 1, [Turned on OpenGL define in config])
-fi
-dnl done with OpenGL headers
-
-fi
-dnl done check for GL lib pass
-
-fi
-dnl Close Motif check for OpenGL
-
-AM_CONDITIONAL([BUILD_GL], [test "$GOT_GL" = yes])
-
-dnl variables for shared data
-mbsystemdatadir="$datadir/$PACKAGE"
-AC_SUBST(mbsystemdatadir)
-mbsystemhtmldir="$docdir/html"
-AC_SUBST(mbsystemhtmldir)
-mbsystempsdir="$docdir/ps"
-AC_SUBST(mbsystempsdir)
-
-AS_ECHO([" "])
-AS_ECHO(["About to create Makefiles..."])
-AC_CONFIG_FILES([Makefile src/Makefile src/mbio/Makefile \
-	  src/surf/Makefile \
-	  src/bsio/Makefile \
-          src/gsf/Makefile \
-          src/mbaux/Makefile \
-	  src/utilities/Makefile src/gmt/Makefile \
-	  src/macros/Makefile src/mbedit/Makefile src/mbnavedit/Makefile \
-	  src/mbvelocitytool/Makefile src/mbnavadjust/Makefile \
-	  src/otps/Makefile \
-	  src/mbview/Makefile  src/mbgrdviz/Makefile  src/mbeditviz/Makefile  \
-	  src/man/Makefile src/man/man1/Makefile src/man/man3/Makefile \
-	  src/html/Makefile src/ps/Makefile src/share/Makefile])
-if test "$bundledproj" = "yes" ; then
-AC_CONFIG_FILES([src/proj/Makefile])
-fi
-AC_OUTPUT
-
-dnl Summary Report
-AS_ECHO([""])
-AS_ECHO(["------------------------------------------------------------------------------"])
-AS_ECHO(["MB-System Configure Summary"])
-AS_ECHO(["------------------------------------------------------------------------------"])
-AS_ECHO(["MB-System will be installed in: ${prefix}"])
-AS_ECHO(["Installation host:              ${host}"])
-if test "x$enable_static" = xyes ; then
-	AS_ECHO(["Building Static Libs: Yes"])
-else
-	AS_ECHO(["Building Static Libs: No"])
-fi
-if test "x$enable_shared" = xyes ; then
-	AS_ECHO(["Building Shared Libs: Yes"])
-else
-	AS_ECHO(["Building Shared Libs: No"])
-fi
-if test $BYTESWAP = "yes" ; then
-	AS_ECHO(["Byteswapping: Enabled"])
-else
-	AS_ECHO(["Byteswapping: Disabled"])
-fi
-if test "$GOT_FFTW" = "yes" ; then
-	AS_ECHO(["FFTW Support: Enabled"])
-else
-	AS_ECHO(["FFTW Support: Disabled"])
-fi
-if test "$GOT_MOTIF" = "yes" ; then
-	AS_ECHO(["Motif Support: Enabled"])
-else
-	AS_ECHO(["Motif Support: Disabled"])
-fi
-if test "$GOT_GL" = "yes" ; then
-	AS_ECHO(["OpenGL Support: Enabled"])
-else
-	AS_ECHO(["OpenGL Support: Disabled"])
-fi
-AS_ECHO(["Using $OTPS_DIR for OSU Tidal Prediction Software"])
-
-if test "$bundledproj" = "yes" ; then
-	AS_ECHO(["Building using bundled proj package"])
-else
-	AS_ECHO(["Building using system libproj library, not bundled proj package"])
-fi
-
-AS_ECHO(["------------------------------------------------------------------------------"])
-AS_ECHO(["Key Variables:"])
-AS_ECHO(["    prefix:                   ${prefix}"])
-AS_ECHO(["    exec_prefix:              ${exec_prefix}"])
-AS_ECHO(["    datarootdir:              ${datarootdir}"])
-AS_ECHO(["    PACKAGE_TARNAME:          ${PACKAGE_TARNAME}"])
-AS_ECHO(["------------------------------------------------------------------------------"])
-AS_ECHO(["Installation Locations:"])
-AS_ECHO(["    executables:              ${bindir}"])
-AS_ECHO(["    libraries:                ${libdir}"])
-AS_ECHO(["    header files:             ${includedir}"])
-AS_ECHO(["    data files:               ${mbsystemdatadir}"])
-AS_ECHO(["    man pages:                ${mandir}"])
-AS_ECHO(["    Html documentation:       ${mbsystemhtmldir}"])
-AS_ECHO(["    Postscript documentation: ${mbsystempsdir}"])
-AS_ECHO(["------------------------------------------------------------------------------"])
-AS_ECHO(["See config.log for details of configure results"])
-AS_ECHO(["See INSTALL for further build instructions and hints"])
-AS_ECHO(["------------------------------------------------------------------------------"])
diff --git a/configure.cmd b/configure.cmd
deleted file mode 100755
index 9f895d2..0000000
--- a/configure.cmd
+++ /dev/null
@@ -1,283 +0,0 @@
-#-------------------------------------------------------------------------
-# Version: $Id: configure.cmd 2251 2015-07-01 01:02:06Z caress $
-#------------------------------------------------------------------------------
-# Notes on using the MB-System autotools based build system 
-#------------------------------------------------------------------------------
-#
-# David W. Caress
-# June 7, 2013
-#------------------------------------------------------------------------------
-#
-# This build system was begun by Bob Covill in 2011, and then completed
-# with a distributed, multi-continental effort by Bob Covill, Christian
-# Ferreira, Hamish Bowman, Kurt Schwehr, and David Caress in May to August
-# of 2013.
-#
-#------------------------------------------------------------------------------
-# To use the build system...
-#------------------------------------------------------------------------------
-#
-# Obtain the MB-System source tree by either downloading and unpacking an
-# MB-System source distribution tarball (e.g. mbsystem-5.5.2245.tar.gz) from:
-#   ftp://ftp.ldeo.columbia.edu/pub/mbsystem/
-# or by downloading directly from the source code archive at:
-#   http://svn.mb-system.org/listing.php?repname=MB-System
-#
-# To generate the makefiles needed to build MB-System, in a shell cd to the
-# top of the MB-System source tree and run ./configure with the options
-# appropriate for your situation. Some examples are given below.
-#
-# After configure you can run the make utility in the usual fashion
-make
-make install
-#
-# Some other useful make commands include:
-make clean (to clean up compiled code)
-make distclean (to clean up compiled code and configure output)
-make uninstall (to remove a previously installed version)
-#
-#------------------------------------------------------------------------------
-# Configure script command line options:
-#------------------------------------------------------------------------------
-#   Installation location:
-#------------------------
-#    --prefix              - This is the common installation prefix for all files.
-#                            If exec_prefix is defined to a different value, prefix
-#                            is used only for architecture-independent files.
-#                            [Default: /usr/local]
-#    --exec_prefix         - The installation prefix for architecture-dependent files.
-#                            By default it's the same as prefix. You should avoid
-#                            installing anything directly to exec_prefix. However,
-#                            the default value for directories containing
-#                            architecture-dependent files should be relative to
-#                            exec_prefix.
-#                            [Default: ${prefix} ==> /usr/local]
-#    --datarootdir         - The root of the directory tree for read-only architecture
-#                            -independent data files.
-#                            [Default: ${exec_prefix}/share ==> /usr/local/share]
-#    --bindir              - The directory for installing executables that users run.
-#                            [Default: ${exec_prefix}/bin ==> /usr/local/bin]
-#    --libdir              - The directory for installing object code libraries.
-#                            [Default: ${exec_prefix}/lib ==> /usr/local/lib]
-#    --includedir          - The directory for installing C header files.
-#                            [Default: ${exec_prefix}/include ==> /usr/local/include]
-#------------------------
-#   Prerequisite location:
-#------------------------
-#    --with-netcdf-lib     - location of NetCDF libs
-#    --with-netcdf-include - location of NetCDF headers
-#    --with-proj-lib       - location of PROJ libs
-#    --with-proj-include   - location of PROJ headers
-#    --with-gmt-lib        - location of GMT libs
-#    --with-gmt-include    - location of GMT headers
-#    --with-fftw-lib       - location of FFTW3 libs 
-#    --with-fftw-include   - location of FFTW3 headers 
-#    --with-motif-lib      - location of Motif libs 
-#    --with-motif-include  - location of Motif headers 
-#    --with-opengl-lib     - location of OpenGL libs 
-#    --with-opengl-include - location of OpenGL headers 
-#    --with-otps-dir       - location of OTPS installation 
-#------------------------
-#   Installation option:
-#------------------------
-#    --enable-bundledproj  - build using bundled proj package - the
-#				default is to link with libproj
-#
-#------------------------------------------------------------------------------
-# Setting X11 fonts used by mbgrdviz, mbeditviz, mbedit, mbnavedit, mbnavadjust
-# and mbvelocitytool:
-#------------------------------------------------------------------------------
-# By default the graphical utilities use three fonts: Helvetica, Times New
-# Roman, and Courier. This can be set in the CFLAGS environment variable by
-# including options of the form:
-#       -DSANS='\"helvetica\"' -DSERIF='\"times\"' -DMONO='\"courier\"'
-# In the examples below, the CFLAGS environment value is set for the configure
-# script by setting it on the same command line as ./configure. To set the
-# fonts to Lucida, one might add:
-#       -DSANS='\"lucida\"' -DSERIF='\"lucida\"' -DMONO='\"lucidatypewriter\"'
-# to the CFLAGS definition
-#
-#------------------------------------------------------------------------------
-# Mac Os X configure script command line examples:
-#------------------------------------------------------------------------------
-#
-# Build in /usr/local on a Mac 10.9 or 10.10 with most prerequisites installed
-# through Fink in /sw, and the OTPS program predict_time located
-# in /usr/local/OTPS2.
-# Prerequisite Fink packages include gmt, netcdf, proj, fftw3, and gv:
-#
-sudo CFLAGS="-I/opt/X11/include" LDFLAGS="-L/opt/X11/lib" \
-./configure \
-    --prefix=/usr/local \
-    --with-netcdf-include=/sw/include \
-    --with-netcdf-lib=/sw/lib \
-    --with-gmt-include=/sw/include/gmt \
-    --with-gmt-lib=/sw/lib \
-    --with-proj-include=/sw/include \
-    --with-proj-lib=/sw/lib \
-    --with-fftw-include=/sw/include \
-    --with-fftw-lib=/sw/lib \
-    --with-motif-include=/sw/include \
-    --with-motif-lib=/sw/lib \
-    --with-otps-dir=/usr/local/OTPS2
-#
-#------------------------------------------------------------------------------
-# Ubuntu Linux configure script command line examples:
-#------------------------------------------------------------------------------
-
-# Install on Ubuntu (12.04.02LTS or 14.04LTS) 
-#
-# At present (June 2015), GMT 5 is not available on Ubuntu as a standard package.
-# Consequently, one can use apt-get for all prerequisites except GMT 5.1.2,
-# which must be built locally from source and installed into /usr/local
-
-# Prerequisites for 64-bit installation excluding GMT
-# (for 32-bit replace libgdal-dev with gdal1-dev)
-sudo apt-get install xorg-dev libmotif-dev libmotif4 libxp-dev mesa-common-dev \
-    libsdl1.2-dev libsdl-image1.2-dev build-essential gfortran \
-    nautilus-open-terminal libfftw3-3 libfftw3-dev \
-    libnetcdf-dev netcdf-bin gdal-bin libgdal-dev libproj-dev libproj0 \
-    gv cmake
-    
-# GMT 5.1.2 is built from source using cmake and by default installs into
-# /usr/local in Ubuntu. Follow the directions in the GMT Wiki.
-# The specific installation points of the libraries and the header files will
-# vary according to the architecture.
-
-# In order for the shared libraries to work, one must either set the 
-# LD_LIBRARY_PATH environment variable in ~/.profile or ~/.bashrc
-export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
-# or one must set the CFLAGS environment variable during building to include
-# "-Wl,-rpath -Wl,LIBDIR"
-
-# On a machine with a 64-bit processor,
-# the following configure options are required to build MB-System:
-sudo CFLAGS="-Wl,-rpath -Wl,/usr/local/lib" \
-    ./configure --prefix=/usr/local \
-    --with-gmt-include=/usr/local/include/gmt \
-    --with-gmt-lib=/usr/local/lib/x86_64-linux-gnu
-
-# On a machine with a 32-bit processor,
-# the following configure options are required to build MB-System:
-sudo CFLAGS="-Wl,-rpath -Wl,/usr/local/lib" \
-    ./configure --prefix=/usr/local \
-    --with-gmt-include=/usr/local/include/gmt \
-    --with-gmt-lib=/usr/local/lib/i386-linux-gnu
-
-# Once configure has been run, build and install MB-System into /usr/local/bin,
-# /usr/local/lib, etc with the simple make commands:
-sudo make
-sudo make install
-
-#------------------------------------------------------------------------------
-# CentOs configure script command line examples:
-#------------------------------------------------------------------------------
-
-# Install on CentOs 6 or 7 using only yum for prerequisites
-
-# Prerequisites
-sudo yum install openmotif openmotif-devel fftw fftw-devel netcdf netcdf-devel \
-		proj proj-devel gdal-devel gmt gmt-devel gv
-
-# If the prerequisites have all been installed with yum and it is desired to
-# install MB-System in /usr/local, then only a simple call to configure is required:
-sudo ./configure
-#
-#------------------------------------------------------------------------------
-
-# Install on CentOs 6 or 7 using yum for prerequisites other than GMT
-#
-# Prerequisites
-sudo yum install openmotif openmotif-devel fftw fftw-devel netcdf netcdf-devel \
-		proj proj-devel gdal-devel gv
-
-# If GMT 5.1.2 has been installed from source into /usr/local, and it is desired to
-# install MB-System in /usr/local, then only the call to configure must specify
-# the location of the GMT libraries and header files:
-sudo ./configure --prefix=/usr/local \
-    --with-gmt-include=/usr/local/include/gmt \
-    --with-gmt-lib=/usr/local/lib64
-#
-#------------------------------------------------------------------------------
-# To modify the build system...
-#------------------------------------------------------------------------------
-#
-# Edit the file "configure.ac" in the top directory and "Makefile.am" in each
-# directory and then run the following sequence of commands:
-
-# Build libtool files for AM_PROG_LIBTOOL
-libtoolize --force --copy
-aclocal
-
-# Build custom header for configure
-autoheader
-automake --add-missing --include-deps
-autoconf
-
-# To update configure files use the following:
-autoupdate
-autoreconf --force --install --warnings=all
-
-# Reset the autotools version to 2.65 to accomodate some Linux distributions
-sed -i.bak s/2\.69/2\.65/ configure.ac
-
-# When you run ./configure, a number of configure options are saved to a
-# header file:
-#     ./src/mbio/mb_config.h
-# This file has a template:
-#     ./src/mbio/mb_config.h.in
-# This file is conditionally included by:
-#     ./src/mbio/mb_define.h
-# which is in turn included by essentially every MB-System C source file.
-#
-#------------------------------------------------------------------------------
-#
-# Full autoconf and build sequence after modifying the build system
-#   - Do this in the development tree prior to a commit to the source archive or
-#     prior to making a source distribution
-#
-# First clean up old installation and build
-make -j uninstall
-make -j clean
-
-# Reconstruct the build system, and then use it to build in place
-# in my personal development tree
-libtoolize --force --copy
-aclocal
-autoheader
-automake --add-missing --include-deps
-autoconf
-autoupdate
-
-autoreconf --force --install --warnings=all
-
-# Force configure.ac to reduce the automake version requirement from 2.69 to 2.65
-sed -i.bak s/2\.69/2\.65/ configure.ac
-
-CFLAGS="-g -Wall -Wmissing-prototypes -I/opt/X11/include " LDFLAGS="-L/opt/X11/lib" \
-./configure \
-    --prefix=/Users/caress/sandbox/mbsystem \
-    --disable-static \
-    --enable-shared \
-    --with-netcdf-include=/sw/include \
-    --with-netcdf-lib=/sw/lib \
-    --with-proj-include=/sw/include \
-    --with-proj-lib=/sw/lib \
-    --with-gmt-include=/sw/include/gmt \
-    --with-gmt-lib=/sw/lib \
-    --with-fftw-include=/sw/include \
-    --with-fftw-lib=/sw/lib \
-    --with-motif-include=/sw/include \
-    --with-motif-lib=/sw/lib \
-    --with-otps-dir=/usr/local/OTPS2
-
-make -j
-
-make -j install
-
-cd src/htmlsrc ; make_mbhtml ; cd ../..
-
-make -j install
-
-#
-#------------------------------------------------------------------------------
diff --git a/configureGMT5.cmd b/configureGMT5.cmd
deleted file mode 100644
index fe79c24..0000000
--- a/configureGMT5.cmd
+++ /dev/null
@@ -1,15 +0,0 @@
-
-CFLAGS="-g -Wall -I/opt/X11/include" LDFLAGS="-L/opt/X11/lib" \
-./configure \
-    --prefix=/Users/caress/sandbox/mbsystem \
-    --with-netcdf-include=/sw/include \
-    --with-netcdf-lib=/sw/lib \
-    --with-proj-include=/sw/include \
-    --with-proj-lib=/sw/lib \
-    --with-gmt-include=/usr/local/gmt/include \
-    --with-gmt-lib=/usr/local/gmt/lib \
-    --with-fftw-include=/sw/include \
-    --with-fftw-lib=/sw/lib \
-    --with-motif-include=/sw/include \
-    --with-motif-lib=/sw/lib \
-    --with-otps-dir=/usr/local/OTPS2
diff --git a/debian/changelog b/debian/changelog
deleted file mode 100644
index 2b07ff4..0000000
--- a/debian/changelog
+++ /dev/null
@@ -1,5 +0,0 @@
-mbsystem (5.5.2252-1) UNRELEASED; urgency=low
-
-  * Initial release (Closes: #<bug>)
-
- -- Andreas Tille <tille at debian.org>  Mon, 17 Aug 2015 13:53:13 +0200
diff --git a/debian/compat b/debian/compat
deleted file mode 100644
index ec63514..0000000
--- a/debian/compat
+++ /dev/null
@@ -1 +0,0 @@
-9
diff --git a/debian/control b/debian/control
deleted file mode 100644
index a5a056d..0000000
--- a/debian/control
+++ /dev/null
@@ -1,36 +0,0 @@
-Source: mbsystem
-Maintainer: Debian Science Maintainers <debian-science-maintainers at lists.alioth.debian.org>
-Uploaders: Andreas Tille <tille at debian.org>
-Section: science
-Priority: optional
-Build-Depends: debhelper (>= 9),
-               libnetcdf-dev,
-               libgmt-dev (>= 5.1.2),
-               libproj-dev,
-               libfftw3-dev,
-               libmotif-dev
-Standards-Version: 3.9.6
-Vcs-Browser: https://anonscm.debian.org/cgit/debian-science/packages/mbsystem.git
-Vcs-Git: git://anonscm.debian.org/debian-science/packages/mbsystem.git
-Homepage: http://www.ldeo.columbia.edu/res/pi/MB-System/
-
-Package: mbsystem
-Architecture: any
-Depends: ${shlibs:Depends},
-         ${misc:Depends}
-Description: processing and display of swath sonar data
- MB-System is an open source software package for the processing and
- display of bathymetry and backscatter imagery data derived from
- multibeam, interferometry, and sidescan sonars. The source code for MB-
- System is freely available (for free) by anonymous ftp (including "point
- and click" access through these web pages). A complete description is
- provided in web pages accessed through links below.
- .
- MB-System was originally developed at the Lamont-Doherty Earth
- Observatory of Columbia University (L-DEO) and is now a collaborative
- effort between the Monterey Bay Aquarium Research Institute (MBARI) and
- L-DEO. The National Science Foundation has provided the primary support
- for MB-System development since 1993. The Packard Foundation has
- provided significant support through MBARI since 1998. Additional
- support has derived from SeaBeam Instruments (1994-1997), NOAA (2002-
- 2004), and others.
diff --git a/debian/copyright b/debian/copyright
deleted file mode 100644
index c76e73d..0000000
--- a/debian/copyright
+++ /dev/null
@@ -1,11 +0,0 @@
-Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
-Upstream-Name: <pkg>
-Source: <path_to_download>
-
-Files: *
-Copyright: © 20xx-20yy <upstream>
-License: <license>
-
-Files: debian/*
-Copyright: © 2014 maintainername <maintainer at e.mail>
-License: <license>
diff --git a/debian/createmanpages b/debian/createmanpages
deleted file mode 100755
index febcd91..0000000
--- a/debian/createmanpages
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/bin/sh
-MANDIR=debian
-mkdir -p $MANDIR
-
-VERSION=`dpkg-parsechangelog | awk '/^Version:/ {print $2}' | sed -e 's/^[0-9]*://' -e 's/-.*//' -e 's/[+~]dfsg$//'`
-
-help2man --no-info --no-discard-stderr --help-option=" " \
-         --name='<optional description of the program>' \
-            --version-string="$VERSION" <programname> > $MANDIR/<programname>.1
-
-cat <<EOT
-Please enhance the help2man output.
-The following web page might be helpful in doing so:
-    http://liw.fi/manpages/
-EOT
-
diff --git a/debian/doc-base b/debian/doc-base
deleted file mode 100644
index 5e7e1d4..0000000
--- a/debian/doc-base
+++ /dev/null
@@ -1,20 +0,0 @@
-Document: <pkg>
-Title: <title for this doc>
-Author: <author of this doc>
-Abstract: <if you have no better clue the short and
- long description from debian/control might fit here as well>
-Section: Science/{Biology,Medicine} # see /usr/share/doc/doc-base/doc-base.txt.gz "2.3.3. The `section' field"
-
-# pick one of the below options
-Format: Text
-Files: /usr/share/doc/<pkg>/<pkg>.txt.gz
-
-Format: html
-Index: /usr/share/doc/<pkg>/html/index.html
-Files: /usr/share/doc/<pkg>/html/*
-
-Format: pdf
-Files: /usr/share/doc/<pkg>/<pkg>.pdf.gz
-
-Format: postscript
-Files: /usr/share/doc/<pkg>/<pkg>.ps.gz
diff --git a/debian/rules b/debian/rules
deleted file mode 100755
index 2696a27..0000000
--- a/debian/rules
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/usr/bin/make -f
-
-# DH_VERBOSE := 1
-
-# some helpful variables - uncomment them if needed
-# shamelessly stolen from http://jmtd.net/log/awk/
-#DEBVERS        := $(shell dpkg-parsechangelog | awk '/^Version:/ {print $$2}')
-#VERSION        := $(shell echo '$(DEBVERS)' | sed -e 's/^[0-9]*://' -e 's/-.*//')
-#DEBFLAVOR      := $(shell dpkg-parsechangelog | awk '/^Distribution:/ {print $$2}')
-#DEBPKGNAME     := $(shell dpkg-parsechangelog | awk '/^Source:/ {print $$2}')
-#DEBIAN_BRANCH  := $(shell awk 'BEGIN{FS="[= ]+"} /debian-branch/ {print $$2}' debian/gbp.conf)
-#GIT_TAG        := $(subst ~,_,$(VERSION))
-
-# alternatively to manually set those variables, you can
-#  include /usr/share/dpkg/default.mk
-# and use what is set there.
-
-%:
-	dh $@
-
-override_dh_auto_configure:
-	dh_auto_configure -- --with-gmt-include=/usr/include/gmt/
-
-override_dh_auto_clean:
-	dh_auto_clean
-	rm -rf config.log
diff --git a/debian/source/format b/debian/source/format
deleted file mode 100644
index 163aaf8..0000000
--- a/debian/source/format
+++ /dev/null
@@ -1 +0,0 @@
-3.0 (quilt)
diff --git a/debian/upstream/metadata b/debian/upstream/metadata
deleted file mode 100644
index d8b5812..0000000
--- a/debian/upstream/metadata
+++ /dev/null
@@ -1,12 +0,0 @@
-Reference:
-  Author: 
-  Title: 
-  Journal: 
-  Year: 
-  Volume: 
-  Number: 
-  Pages: 
-  DOI: 
-  PMID:
-  URL: 
-  eprint: 
diff --git a/debian/watch b/debian/watch
deleted file mode 100644
index 8484754..0000000
--- a/debian/watch
+++ /dev/null
@@ -1,3 +0,0 @@
-version=3
-
-ftp://ftp.ldeo.columbia.edu/pub/MB-System/mbsystem-(\d[\d.]*)\.tar\.gz
diff --git a/depcomp b/depcomp
deleted file mode 100755
index 4ebd5b3..0000000
--- a/depcomp
+++ /dev/null
@@ -1,791 +0,0 @@
-#! /bin/sh
-# depcomp - compile a program generating dependencies as side-effects
-
-scriptversion=2013-05-30.07; # UTC
-
-# Copyright (C) 1999-2013 Free Software Foundation, Inc.
-
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-# Originally written by Alexandre Oliva <oliva at dcc.unicamp.br>.
-
-case $1 in
-  '')
-    echo "$0: No command.  Try '$0 --help' for more information." 1>&2
-    exit 1;
-    ;;
-  -h | --h*)
-    cat <<\EOF
-Usage: depcomp [--help] [--version] PROGRAM [ARGS]
-
-Run PROGRAMS ARGS to compile a file, generating dependencies
-as side-effects.
-
-Environment variables:
-  depmode     Dependency tracking mode.
-  source      Source file read by 'PROGRAMS ARGS'.
-  object      Object file output by 'PROGRAMS ARGS'.
-  DEPDIR      directory where to store dependencies.
-  depfile     Dependency file to output.
-  tmpdepfile  Temporary file to use when outputting dependencies.
-  libtool     Whether libtool is used (yes/no).
-
-Report bugs to <bug-automake at gnu.org>.
-EOF
-    exit $?
-    ;;
-  -v | --v*)
-    echo "depcomp $scriptversion"
-    exit $?
-    ;;
-esac
-
-# Get the directory component of the given path, and save it in the
-# global variables '$dir'.  Note that this directory component will
-# be either empty or ending with a '/' character.  This is deliberate.
-set_dir_from ()
-{
-  case $1 in
-    */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;;
-      *) dir=;;
-  esac
-}
-
-# Get the suffix-stripped basename of the given path, and save it the
-# global variable '$base'.
-set_base_from ()
-{
-  base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'`
-}
-
-# If no dependency file was actually created by the compiler invocation,
-# we still have to create a dummy depfile, to avoid errors with the
-# Makefile "include basename.Plo" scheme.
-make_dummy_depfile ()
-{
-  echo "#dummy" > "$depfile"
-}
-
-# Factor out some common post-processing of the generated depfile.
-# Requires the auxiliary global variable '$tmpdepfile' to be set.
-aix_post_process_depfile ()
-{
-  # If the compiler actually managed to produce a dependency file,
-  # post-process it.
-  if test -f "$tmpdepfile"; then
-    # Each line is of the form 'foo.o: dependency.h'.
-    # Do two passes, one to just change these to
-    #   $object: dependency.h
-    # and one to simply output
-    #   dependency.h:
-    # which is needed to avoid the deleted-header problem.
-    { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile"
-      sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile"
-    } > "$depfile"
-    rm -f "$tmpdepfile"
-  else
-    make_dummy_depfile
-  fi
-}
-
-# A tabulation character.
-tab='	'
-# A newline character.
-nl='
-'
-# Character ranges might be problematic outside the C locale.
-# These definitions help.
-upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ
-lower=abcdefghijklmnopqrstuvwxyz
-digits=0123456789
-alpha=${upper}${lower}
-
-if test -z "$depmode" || test -z "$source" || test -z "$object"; then
-  echo "depcomp: Variables source, object and depmode must be set" 1>&2
-  exit 1
-fi
-
-# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
-depfile=${depfile-`echo "$object" |
-  sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
-tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
-
-rm -f "$tmpdepfile"
-
-# Avoid interferences from the environment.
-gccflag= dashmflag=
-
-# Some modes work just like other modes, but use different flags.  We
-# parameterize here, but still list the modes in the big case below,
-# to make depend.m4 easier to write.  Note that we *cannot* use a case
-# here, because this file can only contain one case statement.
-if test "$depmode" = hp; then
-  # HP compiler uses -M and no extra arg.
-  gccflag=-M
-  depmode=gcc
-fi
-
-if test "$depmode" = dashXmstdout; then
-  # This is just like dashmstdout with a different argument.
-  dashmflag=-xM
-  depmode=dashmstdout
-fi
-
-cygpath_u="cygpath -u -f -"
-if test "$depmode" = msvcmsys; then
-  # This is just like msvisualcpp but w/o cygpath translation.
-  # Just convert the backslash-escaped backslashes to single forward
-  # slashes to satisfy depend.m4
-  cygpath_u='sed s,\\\\,/,g'
-  depmode=msvisualcpp
-fi
-
-if test "$depmode" = msvc7msys; then
-  # This is just like msvc7 but w/o cygpath translation.
-  # Just convert the backslash-escaped backslashes to single forward
-  # slashes to satisfy depend.m4
-  cygpath_u='sed s,\\\\,/,g'
-  depmode=msvc7
-fi
-
-if test "$depmode" = xlc; then
-  # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information.
-  gccflag=-qmakedep=gcc,-MF
-  depmode=gcc
-fi
-
-case "$depmode" in
-gcc3)
-## gcc 3 implements dependency tracking that does exactly what
-## we want.  Yay!  Note: for some reason libtool 1.4 doesn't like
-## it if -MD -MP comes after the -MF stuff.  Hmm.
-## Unfortunately, FreeBSD c89 acceptance of flags depends upon
-## the command line argument order; so add the flags where they
-## appear in depend2.am.  Note that the slowdown incurred here
-## affects only configure: in makefiles, %FASTDEP% shortcuts this.
-  for arg
-  do
-    case $arg in
-    -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
-    *)  set fnord "$@" "$arg" ;;
-    esac
-    shift # fnord
-    shift # $arg
-  done
-  "$@"
-  stat=$?
-  if test $stat -ne 0; then
-    rm -f "$tmpdepfile"
-    exit $stat
-  fi
-  mv "$tmpdepfile" "$depfile"
-  ;;
-
-gcc)
-## Note that this doesn't just cater to obsosete pre-3.x GCC compilers.
-## but also to in-use compilers like IMB xlc/xlC and the HP C compiler.
-## (see the conditional assignment to $gccflag above).
-## There are various ways to get dependency output from gcc.  Here's
-## why we pick this rather obscure method:
-## - Don't want to use -MD because we'd like the dependencies to end
-##   up in a subdir.  Having to rename by hand is ugly.
-##   (We might end up doing this anyway to support other compilers.)
-## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
-##   -MM, not -M (despite what the docs say).  Also, it might not be
-##   supported by the other compilers which use the 'gcc' depmode.
-## - Using -M directly means running the compiler twice (even worse
-##   than renaming).
-  if test -z "$gccflag"; then
-    gccflag=-MD,
-  fi
-  "$@" -Wp,"$gccflag$tmpdepfile"
-  stat=$?
-  if test $stat -ne 0; then
-    rm -f "$tmpdepfile"
-    exit $stat
-  fi
-  rm -f "$depfile"
-  echo "$object : \\" > "$depfile"
-  # The second -e expression handles DOS-style file names with drive
-  # letters.
-  sed -e 's/^[^:]*: / /' \
-      -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
-## This next piece of magic avoids the "deleted header file" problem.
-## The problem is that when a header file which appears in a .P file
-## is deleted, the dependency causes make to die (because there is
-## typically no way to rebuild the header).  We avoid this by adding
-## dummy dependencies for each header file.  Too bad gcc doesn't do
-## this for us directly.
-## Some versions of gcc put a space before the ':'.  On the theory
-## that the space means something, we add a space to the output as
-## well.  hp depmode also adds that space, but also prefixes the VPATH
-## to the object.  Take care to not repeat it in the output.
-## Some versions of the HPUX 10.20 sed can't process this invocation
-## correctly.  Breaking it into two sed invocations is a workaround.
-  tr ' ' "$nl" < "$tmpdepfile" \
-    | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \
-    | sed -e 's/$/ :/' >> "$depfile"
-  rm -f "$tmpdepfile"
-  ;;
-
-hp)
-  # This case exists only to let depend.m4 do its work.  It works by
-  # looking at the text of this script.  This case will never be run,
-  # since it is checked for above.
-  exit 1
-  ;;
-
-sgi)
-  if test "$libtool" = yes; then
-    "$@" "-Wp,-MDupdate,$tmpdepfile"
-  else
-    "$@" -MDupdate "$tmpdepfile"
-  fi
-  stat=$?
-  if test $stat -ne 0; then
-    rm -f "$tmpdepfile"
-    exit $stat
-  fi
-  rm -f "$depfile"
-
-  if test -f "$tmpdepfile"; then  # yes, the sourcefile depend on other files
-    echo "$object : \\" > "$depfile"
-    # Clip off the initial element (the dependent).  Don't try to be
-    # clever and replace this with sed code, as IRIX sed won't handle
-    # lines with more than a fixed number of characters (4096 in
-    # IRIX 6.2 sed, 8192 in IRIX 6.5).  We also remove comment lines;
-    # the IRIX cc adds comments like '#:fec' to the end of the
-    # dependency line.
-    tr ' ' "$nl" < "$tmpdepfile" \
-      | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \
-      | tr "$nl" ' ' >> "$depfile"
-    echo >> "$depfile"
-    # The second pass generates a dummy entry for each header file.
-    tr ' ' "$nl" < "$tmpdepfile" \
-      | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
-      >> "$depfile"
-  else
-    make_dummy_depfile
-  fi
-  rm -f "$tmpdepfile"
-  ;;
-
-xlc)
-  # This case exists only to let depend.m4 do its work.  It works by
-  # looking at the text of this script.  This case will never be run,
-  # since it is checked for above.
-  exit 1
-  ;;
-
-aix)
-  # The C for AIX Compiler uses -M and outputs the dependencies
-  # in a .u file.  In older versions, this file always lives in the
-  # current directory.  Also, the AIX compiler puts '$object:' at the
-  # start of each line; $object doesn't have directory information.
-  # Version 6 uses the directory in both cases.
-  set_dir_from "$object"
-  set_base_from "$object"
-  if test "$libtool" = yes; then
-    tmpdepfile1=$dir$base.u
-    tmpdepfile2=$base.u
-    tmpdepfile3=$dir.libs/$base.u
-    "$@" -Wc,-M
-  else
-    tmpdepfile1=$dir$base.u
-    tmpdepfile2=$dir$base.u
-    tmpdepfile3=$dir$base.u
-    "$@" -M
-  fi
-  stat=$?
-  if test $stat -ne 0; then
-    rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
-    exit $stat
-  fi
-
-  for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
-  do
-    test -f "$tmpdepfile" && break
-  done
-  aix_post_process_depfile
-  ;;
-
-tcc)
-  # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26
-  # FIXME: That version still under development at the moment of writing.
-  #        Make that this statement remains true also for stable, released
-  #        versions.
-  # It will wrap lines (doesn't matter whether long or short) with a
-  # trailing '\', as in:
-  #
-  #   foo.o : \
-  #    foo.c \
-  #    foo.h \
-  #
-  # It will put a trailing '\' even on the last line, and will use leading
-  # spaces rather than leading tabs (at least since its commit 0394caf7
-  # "Emit spaces for -MD").
-  "$@" -MD -MF "$tmpdepfile"
-  stat=$?
-  if test $stat -ne 0; then
-    rm -f "$tmpdepfile"
-    exit $stat
-  fi
-  rm -f "$depfile"
-  # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'.
-  # We have to change lines of the first kind to '$object: \'.
-  sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile"
-  # And for each line of the second kind, we have to emit a 'dep.h:'
-  # dummy dependency, to avoid the deleted-header problem.
-  sed -n -e 's|^  *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile"
-  rm -f "$tmpdepfile"
-  ;;
-
-## The order of this option in the case statement is important, since the
-## shell code in configure will try each of these formats in the order
-## listed in this file.  A plain '-MD' option would be understood by many
-## compilers, so we must ensure this comes after the gcc and icc options.
-pgcc)
-  # Portland's C compiler understands '-MD'.
-  # Will always output deps to 'file.d' where file is the root name of the
-  # source file under compilation, even if file resides in a subdirectory.
-  # The object file name does not affect the name of the '.d' file.
-  # pgcc 10.2 will output
-  #    foo.o: sub/foo.c sub/foo.h
-  # and will wrap long lines using '\' :
-  #    foo.o: sub/foo.c ... \
-  #     sub/foo.h ... \
-  #     ...
-  set_dir_from "$object"
-  # Use the source, not the object, to determine the base name, since
-  # that's sadly what pgcc will do too.
-  set_base_from "$source"
-  tmpdepfile=$base.d
-
-  # For projects that build the same source file twice into different object
-  # files, the pgcc approach of using the *source* file root name can cause
-  # problems in parallel builds.  Use a locking strategy to avoid stomping on
-  # the same $tmpdepfile.
-  lockdir=$base.d-lock
-  trap "
-    echo '$0: caught signal, cleaning up...' >&2
-    rmdir '$lockdir'
-    exit 1
-  " 1 2 13 15
-  numtries=100
-  i=$numtries
-  while test $i -gt 0; do
-    # mkdir is a portable test-and-set.
-    if mkdir "$lockdir" 2>/dev/null; then
-      # This process acquired the lock.
-      "$@" -MD
-      stat=$?
-      # Release the lock.
-      rmdir "$lockdir"
-      break
-    else
-      # If the lock is being held by a different process, wait
-      # until the winning process is done or we timeout.
-      while test -d "$lockdir" && test $i -gt 0; do
-        sleep 1
-        i=`expr $i - 1`
-      done
-    fi
-    i=`expr $i - 1`
-  done
-  trap - 1 2 13 15
-  if test $i -le 0; then
-    echo "$0: failed to acquire lock after $numtries attempts" >&2
-    echo "$0: check lockdir '$lockdir'" >&2
-    exit 1
-  fi
-
-  if test $stat -ne 0; then
-    rm -f "$tmpdepfile"
-    exit $stat
-  fi
-  rm -f "$depfile"
-  # Each line is of the form `foo.o: dependent.h',
-  # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
-  # Do two passes, one to just change these to
-  # `$object: dependent.h' and one to simply `dependent.h:'.
-  sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
-  # Some versions of the HPUX 10.20 sed can't process this invocation
-  # correctly.  Breaking it into two sed invocations is a workaround.
-  sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \
-    | sed -e 's/$/ :/' >> "$depfile"
-  rm -f "$tmpdepfile"
-  ;;
-
-hp2)
-  # The "hp" stanza above does not work with aCC (C++) and HP's ia64
-  # compilers, which have integrated preprocessors.  The correct option
-  # to use with these is +Maked; it writes dependencies to a file named
-  # 'foo.d', which lands next to the object file, wherever that
-  # happens to be.
-  # Much of this is similar to the tru64 case; see comments there.
-  set_dir_from  "$object"
-  set_base_from "$object"
-  if test "$libtool" = yes; then
-    tmpdepfile1=$dir$base.d
-    tmpdepfile2=$dir.libs/$base.d
-    "$@" -Wc,+Maked
-  else
-    tmpdepfile1=$dir$base.d
-    tmpdepfile2=$dir$base.d
-    "$@" +Maked
-  fi
-  stat=$?
-  if test $stat -ne 0; then
-     rm -f "$tmpdepfile1" "$tmpdepfile2"
-     exit $stat
-  fi
-
-  for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
-  do
-    test -f "$tmpdepfile" && break
-  done
-  if test -f "$tmpdepfile"; then
-    sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile"
-    # Add 'dependent.h:' lines.
-    sed -ne '2,${
-               s/^ *//
-               s/ \\*$//
-               s/$/:/
-               p
-             }' "$tmpdepfile" >> "$depfile"
-  else
-    make_dummy_depfile
-  fi
-  rm -f "$tmpdepfile" "$tmpdepfile2"
-  ;;
-
-tru64)
-  # The Tru64 compiler uses -MD to generate dependencies as a side
-  # effect.  'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'.
-  # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
-  # dependencies in 'foo.d' instead, so we check for that too.
-  # Subdirectories are respected.
-  set_dir_from  "$object"
-  set_base_from "$object"
-
-  if test "$libtool" = yes; then
-    # Libtool generates 2 separate objects for the 2 libraries.  These
-    # two compilations output dependencies in $dir.libs/$base.o.d and
-    # in $dir$base.o.d.  We have to check for both files, because
-    # one of the two compilations can be disabled.  We should prefer
-    # $dir$base.o.d over $dir.libs/$base.o.d because the latter is
-    # automatically cleaned when .libs/ is deleted, while ignoring
-    # the former would cause a distcleancheck panic.
-    tmpdepfile1=$dir$base.o.d          # libtool 1.5
-    tmpdepfile2=$dir.libs/$base.o.d    # Likewise.
-    tmpdepfile3=$dir.libs/$base.d      # Compaq CCC V6.2-504
-    "$@" -Wc,-MD
-  else
-    tmpdepfile1=$dir$base.d
-    tmpdepfile2=$dir$base.d
-    tmpdepfile3=$dir$base.d
-    "$@" -MD
-  fi
-
-  stat=$?
-  if test $stat -ne 0; then
-    rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
-    exit $stat
-  fi
-
-  for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
-  do
-    test -f "$tmpdepfile" && break
-  done
-  # Same post-processing that is required for AIX mode.
-  aix_post_process_depfile
-  ;;
-
-msvc7)
-  if test "$libtool" = yes; then
-    showIncludes=-Wc,-showIncludes
-  else
-    showIncludes=-showIncludes
-  fi
-  "$@" $showIncludes > "$tmpdepfile"
-  stat=$?
-  grep -v '^Note: including file: ' "$tmpdepfile"
-  if test $stat -ne 0; then
-    rm -f "$tmpdepfile"
-    exit $stat
-  fi
-  rm -f "$depfile"
-  echo "$object : \\" > "$depfile"
-  # The first sed program below extracts the file names and escapes
-  # backslashes for cygpath.  The second sed program outputs the file
-  # name when reading, but also accumulates all include files in the
-  # hold buffer in order to output them again at the end.  This only
-  # works with sed implementations that can handle large buffers.
-  sed < "$tmpdepfile" -n '
-/^Note: including file:  *\(.*\)/ {
-  s//\1/
-  s/\\/\\\\/g
-  p
-}' | $cygpath_u | sort -u | sed -n '
-s/ /\\ /g
-s/\(.*\)/'"$tab"'\1 \\/p
-s/.\(.*\) \\/\1:/
-H
-$ {
-  s/.*/'"$tab"'/
-  G
-  p
-}' >> "$depfile"
-  echo >> "$depfile" # make sure the fragment doesn't end with a backslash
-  rm -f "$tmpdepfile"
-  ;;
-
-msvc7msys)
-  # This case exists only to let depend.m4 do its work.  It works by
-  # looking at the text of this script.  This case will never be run,
-  # since it is checked for above.
-  exit 1
-  ;;
-
-#nosideeffect)
-  # This comment above is used by automake to tell side-effect
-  # dependency tracking mechanisms from slower ones.
-
-dashmstdout)
-  # Important note: in order to support this mode, a compiler *must*
-  # always write the preprocessed file to stdout, regardless of -o.
-  "$@" || exit $?
-
-  # Remove the call to Libtool.
-  if test "$libtool" = yes; then
-    while test "X$1" != 'X--mode=compile'; do
-      shift
-    done
-    shift
-  fi
-
-  # Remove '-o $object'.
-  IFS=" "
-  for arg
-  do
-    case $arg in
-    -o)
-      shift
-      ;;
-    $object)
-      shift
-      ;;
-    *)
-      set fnord "$@" "$arg"
-      shift # fnord
-      shift # $arg
-      ;;
-    esac
-  done
-
-  test -z "$dashmflag" && dashmflag=-M
-  # Require at least two characters before searching for ':'
-  # in the target name.  This is to cope with DOS-style filenames:
-  # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise.
-  "$@" $dashmflag |
-    sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile"
-  rm -f "$depfile"
-  cat < "$tmpdepfile" > "$depfile"
-  # Some versions of the HPUX 10.20 sed can't process this sed invocation
-  # correctly.  Breaking it into two sed invocations is a workaround.
-  tr ' ' "$nl" < "$tmpdepfile" \
-    | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
-    | sed -e 's/$/ :/' >> "$depfile"
-  rm -f "$tmpdepfile"
-  ;;
-
-dashXmstdout)
-  # This case only exists to satisfy depend.m4.  It is never actually
-  # run, as this mode is specially recognized in the preamble.
-  exit 1
-  ;;
-
-makedepend)
-  "$@" || exit $?
-  # Remove any Libtool call
-  if test "$libtool" = yes; then
-    while test "X$1" != 'X--mode=compile'; do
-      shift
-    done
-    shift
-  fi
-  # X makedepend
-  shift
-  cleared=no eat=no
-  for arg
-  do
-    case $cleared in
-    no)
-      set ""; shift
-      cleared=yes ;;
-    esac
-    if test $eat = yes; then
-      eat=no
-      continue
-    fi
-    case "$arg" in
-    -D*|-I*)
-      set fnord "$@" "$arg"; shift ;;
-    # Strip any option that makedepend may not understand.  Remove
-    # the object too, otherwise makedepend will parse it as a source file.
-    -arch)
-      eat=yes ;;
-    -*|$object)
-      ;;
-    *)
-      set fnord "$@" "$arg"; shift ;;
-    esac
-  done
-  obj_suffix=`echo "$object" | sed 's/^.*\././'`
-  touch "$tmpdepfile"
-  ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
-  rm -f "$depfile"
-  # makedepend may prepend the VPATH from the source file name to the object.
-  # No need to regex-escape $object, excess matching of '.' is harmless.
-  sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile"
-  # Some versions of the HPUX 10.20 sed can't process the last invocation
-  # correctly.  Breaking it into two sed invocations is a workaround.
-  sed '1,2d' "$tmpdepfile" \
-    | tr ' ' "$nl" \
-    | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
-    | sed -e 's/$/ :/' >> "$depfile"
-  rm -f "$tmpdepfile" "$tmpdepfile".bak
-  ;;
-
-cpp)
-  # Important note: in order to support this mode, a compiler *must*
-  # always write the preprocessed file to stdout.
-  "$@" || exit $?
-
-  # Remove the call to Libtool.
-  if test "$libtool" = yes; then
-    while test "X$1" != 'X--mode=compile'; do
-      shift
-    done
-    shift
-  fi
-
-  # Remove '-o $object'.
-  IFS=" "
-  for arg
-  do
-    case $arg in
-    -o)
-      shift
-      ;;
-    $object)
-      shift
-      ;;
-    *)
-      set fnord "$@" "$arg"
-      shift # fnord
-      shift # $arg
-      ;;
-    esac
-  done
-
-  "$@" -E \
-    | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
-             -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
-    | sed '$ s: \\$::' > "$tmpdepfile"
-  rm -f "$depfile"
-  echo "$object : \\" > "$depfile"
-  cat < "$tmpdepfile" >> "$depfile"
-  sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
-  rm -f "$tmpdepfile"
-  ;;
-
-msvisualcpp)
-  # Important note: in order to support this mode, a compiler *must*
-  # always write the preprocessed file to stdout.
-  "$@" || exit $?
-
-  # Remove the call to Libtool.
-  if test "$libtool" = yes; then
-    while test "X$1" != 'X--mode=compile'; do
-      shift
-    done
-    shift
-  fi
-
-  IFS=" "
-  for arg
-  do
-    case "$arg" in
-    -o)
-      shift
-      ;;
-    $object)
-      shift
-      ;;
-    "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
-        set fnord "$@"
-        shift
-        shift
-        ;;
-    *)
-        set fnord "$@" "$arg"
-        shift
-        shift
-        ;;
-    esac
-  done
-  "$@" -E 2>/dev/null |
-  sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
-  rm -f "$depfile"
-  echo "$object : \\" > "$depfile"
-  sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile"
-  echo "$tab" >> "$depfile"
-  sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
-  rm -f "$tmpdepfile"
-  ;;
-
-msvcmsys)
-  # This case exists only to let depend.m4 do its work.  It works by
-  # looking at the text of this script.  This case will never be run,
-  # since it is checked for above.
-  exit 1
-  ;;
-
-none)
-  exec "$@"
-  ;;
-
-*)
-  echo "Unknown depmode $depmode" 1>&2
-  exit 1
-  ;;
-esac
-
-exit 0
-
-# Local Variables:
-# mode: shell-script
-# sh-indentation: 2
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "scriptversion="
-# time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-time-zone: "UTC"
-# time-stamp-end: "; # UTC"
-# End:
diff --git a/html/ChayesJul2003.gif b/html/ChayesJul2003.gif
deleted file mode 100644
index 1b60b9b..0000000
Binary files a/html/ChayesJul2003.gif and /dev/null differ
diff --git a/html/MBTeamJul2003.gif b/html/MBTeamJul2003.gif
deleted file mode 100644
index 64f1493..0000000
Binary files a/html/MBTeamJul2003.gif and /dev/null differ
diff --git a/html/ValJul2003.gif b/html/ValJul2003.gif
deleted file mode 100644
index 834fb52..0000000
Binary files a/html/ValJul2003.gif and /dev/null differ
diff --git a/html/caress2001.gif b/html/caress2001.gif
deleted file mode 100644
index 9ccc97e..0000000
Binary files a/html/caress2001.gif and /dev/null differ
diff --git a/html/gpl.html b/html/gpl.html
deleted file mode 100644
index 34b70e4..0000000
--- a/html/gpl.html
+++ /dev/null
@@ -1,604 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
-<HTML>
-<HEAD>
-   <TITLE>GNU General Public License</TITLE>
-  <meta http-equiv="Content-Type" content="text/html">
-  <meta name="Title" content="MB-System: Mapping the Seafloor">
-  <meta name="Author" content="David Caress, Dale Chayes">
-  <meta name="Description" content="open source software for processing bathymetry and backscatter data from multibeam and sidescan sonar">
-  <meta name="Keywords" content="seafloor,mapping,multibeam,sonar,bathymetry,sidescan,swath processing,open,source,software">
-</HEAD>
-<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#336699" VLINK="#997040" ALINK="#CC9900">
-<BODY>
-
-<CENTER>
-  <h3 style="text-align: center;">GNU GENERAL PUBLIC LICENSE</h3>
-  <p style="text-align: center;">Version 3, 29 June 2007</p>
-  <p>Copyright © 2007 Free Software Foundation, Inc. <http://fsf.org/></p>
-  <p> Everyone is permitted to copy and distribute verbatim copies
-    of this license document, but changing it is not allowed.</p>
-  <h3 align="center"><a name="preamble"></a>Preamble</h3>
-  <p align="left">The GNU General Public License is a free, copyleft license for
-    software and other kinds of works.</p>
-  <p align="left">The licenses for most software and other practical works are designed
-    to take away your freedom to share and change the works.  By contrast,
-    the GNU General Public License is intended to guarantee your freedom to
-    share and change all versions of a program--to make sure it remains free
-    software for all its users.  We, the Free Software Foundation, use the
-    GNU General Public License for most of our software; it applies also to
-    any other work released this way by its authors.  You can apply it to
-    your programs, too.</p>
-  <p align="left">When we speak of free software, we are referring to freedom, not
-    price.  Our General Public Licenses are designed to make sure that you
-    have the freedom to distribute copies of free software (and charge for
-    them if you wish), that you receive source code or can get it if you
-    want it, that you can change the software or use pieces of it in new
-    free programs, and that you know you can do these things.</p>
-  <p align="left">To protect your rights, we need to prevent others from denying you
-    these rights or asking you to surrender the rights.  Therefore, you have
-    certain responsibilities if you distribute copies of the software, or if
-    you modify it: responsibilities to respect the freedom of others.</p>
-  <p align="left">For example, if you distribute copies of such a program, whether
-    gratis or for a fee, you must pass on to the recipients the same
-    freedoms that you received.  You must make sure that they, too, receive
-    or can get the source code.  And you must show them these terms so they
-    know their rights.</p>
-  <p align="left">Developers that use the GNU GPL protect your rights with two steps:
-    (1) assert copyright on the software, and (2) offer you this License
-    giving you legal permission to copy, distribute and/or modify it.</p>
-  <p align="left">For the developers' and authors' protection, the GPL clearly explains
-    that there is no warranty for this free software.  For both users' and
-    authors' sake, the GPL requires that modified versions be marked as
-    changed, so that their problems will not be attributed erroneously to
-    authors of previous versions.</p>
-  <p align="left">Some devices are designed to deny users access to install or run
-    modified versions of the software inside them, although the manufacturer
-    can do so.  This is fundamentally incompatible with the aim of
-    protecting users' freedom to change the software.  The systematic
-    pattern of such abuse occurs in the area of products for individuals to
-    use, which is precisely where it is most unacceptable.  Therefore, we
-    have designed this version of the GPL to prohibit the practice for those
-    products.  If such problems arise substantially in other domains, we
-    stand ready to extend this provision to those domains in future versions
-    of the GPL, as needed to protect the freedom of users.</p>
-  <p align="left">Finally, every program is threatened constantly by software patents.
-    States should not allow patents to restrict development and use of
-    software on general-purpose computers, but in those that do, we wish to
-    avoid the special danger that patents applied to a free program could
-    make it effectively proprietary.  To prevent this, the GPL assures that
-    patents cannot be used to render the program non-free.</p>
-  <p align="left">The precise terms and conditions for copying, distribution and
-    modification follow.</p>
-  <h3 align="center"><a name="terms"></a>TERMS AND CONDITIONS</h3>
-  <h4 align="left"><a name="section0"></a>0. Definitions.</h4>
-  <p align="left">“This License” refers to version 3 of the GNU General Public License.</p>
-  <p align="left">“Copyright” also means copyright-like laws that apply to other kinds of
-    works, such as semiconductor masks.</p>
-  <p align="left">“The Program” refers to any copyrightable work licensed under this
-    License.  Each licensee is addressed as “you”.  “Licensees” and
-  “recipients” may be individuals or organizations.</p>
-  <p align="left">To “modify” a work means to copy from or adapt all or part of the work
-    in a fashion requiring copyright permission, other than the making of an
-    exact copy.  The resulting work is called a “modified version” of the
-    earlier work or a work “based on” the earlier work.</p>
-  <p align="left">A “covered work” means either the unmodified Program or a work based
-    on the Program.</p>
-  <p align="left">To “propagate” a work means to do anything with it that, without
-    permission, would make you directly or secondarily liable for
-    infringement under applicable copyright law, except executing it on a
-    computer or modifying a private copy.  Propagation includes copying,
-    distribution (with or without modification), making available to the
-    public, and in some countries other activities as well.</p>
-  <p align="left">To “convey” a work means any kind of propagation that enables other
-    parties to make or receive copies.  Mere interaction with a user through
-    a computer network, with no transfer of a copy, is not conveying.</p>
-  <p align="left">An interactive user interface displays “Appropriate Legal Notices”
-    to the extent that it includes a convenient and prominently visible
-    feature that (1) displays an appropriate copyright notice, and (2)
-    tells the user that there is no warranty for the work (except to the
-    extent that warranties are provided), that licensees may convey the
-    work under this License, and how to view a copy of this License.  If
-    the interface presents a list of user commands or options, such as a
-    menu, a prominent item in the list meets this criterion.</p>
-  <h4 align="left"><a name="section1"></a>1. Source Code.</h4>
-  <p align="left">The “source code” for a work means the preferred form of the work
-    for making modifications to it.  “Object code” means any non-source
-    form of a work.</p>
-  <p align="left">A “Standard Interface” means an interface that either is an official
-    standard defined by a recognized standards body, or, in the case of
-    interfaces specified for a particular programming language, one that
-    is widely used among developers working in that language.</p>
-  <p align="left">The “System Libraries” of an executable work include anything, other
-    than the work as a whole, that (a) is included in the normal form of
-    packaging a Major Component, but which is not part of that Major
-    Component, and (b) serves only to enable use of the work with that
-    Major Component, or to implement a Standard Interface for which an
-    implementation is available to the public in source code form.  A
-  “Major Component”, in this context, means a major essential component
-    (kernel, window system, and so on) of the specific operating system
-    (if any) on which the executable work runs, or a compiler used to
-    produce the work, or an object code interpreter used to run it.</p>
-  <p align="left">The “Corresponding Source” for a work in object code form means all
-    the source code needed to generate, install, and (for an executable
-    work) run the object code and to modify the work, including scripts to
-    control those activities.  However, it does not include the work's
-    System Libraries, or general-purpose tools or generally available free
-    programs which are used unmodified in performing those activities but
-    which are not part of the work.  For example, Corresponding Source
-    includes interface definition files associated with source files for
-    the work, and the source code for shared libraries and dynamically
-    linked subprograms that the work is specifically designed to require,
-    such as by intimate data communication or control flow between those
-    subprograms and other parts of the work.</p>
-  <p align="left">The Corresponding Source need not include anything that users
-    can regenerate automatically from other parts of the Corresponding
-    Source.</p>
-  <p align="left">The Corresponding Source for a work in source code form is that
-    same work.</p>
-  <h4 align="left"><a name="section2"></a>2. Basic Permissions.</h4>
-  <p align="left">All rights granted under this License are granted for the term of
-    copyright on the Program, and are irrevocable provided the stated
-    conditions are met.  This License explicitly affirms your unlimited
-    permission to run the unmodified Program.  The output from running a
-    covered work is covered by this License only if the output, given its
-    content, constitutes a covered work.  This License acknowledges your
-    rights of fair use or other equivalent, as provided by copyright law.</p>
-  <p align="left">You may make, run and propagate covered works that you do not
-    convey, without conditions so long as your license otherwise remains
-    in force.  You may convey covered works to others for the sole purpose
-    of having them make modifications exclusively for you, or provide you
-    with facilities for running those works, provided that you comply with
-    the terms of this License in conveying all material for which you do
-    not control copyright.  Those thus making or running the covered works
-    for you must do so exclusively on your behalf, under your direction
-    and control, on terms that prohibit them from making any copies of
-    your copyrighted material outside their relationship with you.</p>
-  <p align="left">Conveying under any other circumstances is permitted solely under
-    the conditions stated below.  Sublicensing is not allowed; section 10
-    makes it unnecessary.</p>
-  <h4 align="left"><a name="section3"></a>3. Protecting Users' Legal Rights From Anti-Circumvention Law.</h4>
-  <p align="left">No covered work shall be deemed part of an effective technological
-    measure under any applicable law fulfilling obligations under article
-    11 of the WIPO copyright treaty adopted on 20 December 1996, or
-    similar laws prohibiting or restricting circumvention of such
-    measures.</p>
-  <p align="left">When you convey a covered work, you waive any legal power to forbid
-    circumvention of technological measures to the extent such circumvention
-    is effected by exercising rights under this License with respect to
-    the covered work, and you disclaim any intention to limit operation or
-    modification of the work as a means of enforcing, against the work's
-    users, your or third parties' legal rights to forbid circumvention of
-    technological measures.</p>
-  <h4 align="left"><a name="section4"></a>4. Conveying Verbatim Copies.</h4>
-  <p align="left">You may convey verbatim copies of the Program's source code as you
-    receive it, in any medium, provided that you conspicuously and
-    appropriately publish on each copy an appropriate copyright notice;
-    keep intact all notices stating that this License and any
-    non-permissive terms added in accord with section 7 apply to the code;
-    keep intact all notices of the absence of any warranty; and give all
-    recipients a copy of this License along with the Program.</p>
-  <p align="left">You may charge any price or no price for each copy that you convey,
-    and you may offer support or warranty protection for a fee.</p>
-  <h4 align="left"><a name="section5"></a>5. Conveying Modified Source Versions.</h4>
-  <p align="left">You may convey a work based on the Program, or the modifications to
-    produce it from the Program, in the form of source code under the
-    terms of section 4, provided that you also meet all of these conditions:</p>
-  <div align="left">
-    <ul>
-      <li>a) The work must carry prominent notices stating that you modified
-        it, and giving a relevant date.</li>
-      <li>b) The work must carry prominent notices stating that it is
-        released under this License and any conditions added under section
-        7.  This requirement modifies the requirement in section 4 to
-        “keep intact all notices”.</li>
-      <li>c) You must license the entire work, as a whole, under this
-        License to anyone who comes into possession of a copy.  This
-        License will therefore apply, along with any applicable section 7
-        additional terms, to the whole of the work, and all its parts,
-        regardless of how they are packaged.  This License gives no
-        permission to license the work in any other way, but it does not
-        invalidate such permission if you have separately received it.</li>
-      <li>d) If the work has interactive user interfaces, each must display
-        Appropriate Legal Notices; however, if the Program has interactive
-        interfaces that do not display Appropriate Legal Notices, your
-        work need not make them do so.</li>
-    </ul>
-  </div>
-  <p align="left">A compilation of a covered work with other separate and independent
-    works, which are not by their nature extensions of the covered work,
-    and which are not combined with it such as to form a larger program,
-    in or on a volume of a storage or distribution medium, is called an
-  “aggregate” if the compilation and its resulting copyright are not
-    used to limit the access or legal rights of the compilation's users
-    beyond what the individual works permit.  Inclusion of a covered work
-    in an aggregate does not cause this License to apply to the other
-    parts of the aggregate.</p>
-  <h4 align="left"><a name="section6"></a>6. Conveying Non-Source Forms.</h4>
-  <p align="left">You may convey a covered work in object code form under the terms
-    of sections 4 and 5, provided that you also convey the
-    machine-readable Corresponding Source under the terms of this License,
-    in one of these ways:</p>
-  <div align="left">
-    <ul>
-      <li>a) Convey the object code in, or embodied in, a physical product
-        (including a physical distribution medium), accompanied by the
-        Corresponding Source fixed on a durable physical medium
-        customarily used for software interchange.</li>
-      <li>b) Convey the object code in, or embodied in, a physical product
-        (including a physical distribution medium), accompanied by a
-        written offer, valid for at least three years and valid for as
-        long as you offer spare parts or customer support for that product
-        model, to give anyone who possesses the object code either (1) a
-        copy of the Corresponding Source for all the software in the
-        product that is covered by this License, on a durable physical
-        medium customarily used for software interchange, for a price no
-        more than your reasonable cost of physically performing this
-        conveying of source, or (2) access to copy the
-        Corresponding Source from a network server at no charge.</li>
-      <li>c) Convey individual copies of the object code with a copy of the
-        written offer to provide the Corresponding Source.  This
-        alternative is allowed only occasionally and noncommercially, and
-        only if you received the object code with such an offer, in accord
-        with subsection 6b.</li>
-      <li>d) Convey the object code by offering access from a designated
-        place (gratis or for a charge), and offer equivalent access to the
-        Corresponding Source in the same way through the same place at no
-        further charge.  You need not require recipients to copy the
-        Corresponding Source along with the object code.  If the place to
-        copy the object code is a network server, the Corresponding Source
-        may be on a different server (operated by you or a third party)
-        that supports equivalent copying facilities, provided you maintain
-        clear directions next to the object code saying where to find the
-        Corresponding Source.  Regardless of what server hosts the
-        Corresponding Source, you remain obligated to ensure that it is
-        available for as long as needed to satisfy these requirements.</li>
-      <li>e) Convey the object code using peer-to-peer transmission, provided
-        you inform other peers where the object code and Corresponding
-        Source of the work are being offered to the general public at no
-        charge under subsection 6d.</li>
-    </ul>
-  </div>
-  <p align="left">A separable portion of the object code, whose source code is excluded
-    from the Corresponding Source as a System Library, need not be
-    included in conveying the object code work.</p>
-  <p align="left">A “User Product” is either (1) a “consumer product”, which means any
-    tangible personal property which is normally used for personal, family,
-    or household purposes, or (2) anything designed or sold for incorporation
-    into a dwelling.  In determining whether a product is a consumer product,
-    doubtful cases shall be resolved in favor of coverage.  For a particular
-    product received by a particular user, “normally used” refers to a
-    typical or common use of that class of product, regardless of the status
-    of the particular user or of the way in which the particular user
-    actually uses, or expects or is expected to use, the product.  A product
-    is a consumer product regardless of whether the product has substantial
-    commercial, industrial or non-consumer uses, unless such uses represent
-    the only significant mode of use of the product.</p>
-  <p align="left">“Installation Information” for a User Product means any methods,
-    procedures, authorization keys, or other information required to install
-    and execute modified versions of a covered work in that User Product from
-    a modified version of its Corresponding Source.  The information must
-    suffice to ensure that the continued functioning of the modified object
-    code is in no case prevented or interfered with solely because
-    modification has been made.</p>
-  <p align="left">If you convey an object code work under this section in, or with, or
-    specifically for use in, a User Product, and the conveying occurs as
-    part of a transaction in which the right of possession and use of the
-    User Product is transferred to the recipient in perpetuity or for a
-    fixed term (regardless of how the transaction is characterized), the
-    Corresponding Source conveyed under this section must be accompanied
-    by the Installation Information.  But this requirement does not apply
-    if neither you nor any third party retains the ability to install
-    modified object code on the User Product (for example, the work has
-    been installed in ROM).</p>
-  <p align="left">The requirement to provide Installation Information does not include a
-    requirement to continue to provide support service, warranty, or updates
-    for a work that has been modified or installed by the recipient, or for
-    the User Product in which it has been modified or installed.  Access to a
-    network may be denied when the modification itself materially and
-    adversely affects the operation of the network or violates the rules and
-    protocols for communication across the network.</p>
-  <p align="left">Corresponding Source conveyed, and Installation Information provided,
-    in accord with this section must be in a format that is publicly
-    documented (and with an implementation available to the public in
-    source code form), and must require no special password or key for
-    unpacking, reading or copying.</p>
-  <h4 align="left"><a name="section7"></a>7. Additional Terms.</h4>
-  <p align="left">“Additional permissions” are terms that supplement the terms of this
-    License by making exceptions from one or more of its conditions.
-    Additional permissions that are applicable to the entire Program shall
-    be treated as though they were included in this License, to the extent
-    that they are valid under applicable law.  If additional permissions
-    apply only to part of the Program, that part may be used separately
-    under those permissions, but the entire Program remains governed by
-    this License without regard to the additional permissions.</p>
-  <p align="left">When you convey a copy of a covered work, you may at your option
-    remove any additional permissions from that copy, or from any part of
-    it.  (Additional permissions may be written to require their own
-    removal in certain cases when you modify the work.)  You may place
-    additional permissions on material, added by you to a covered work,
-    for which you have or can give appropriate copyright permission.</p>
-  <p align="left">Notwithstanding any other provision of this License, for material you
-    add to a covered work, you may (if authorized by the copyright holders of
-    that material) supplement the terms of this License with terms:</p>
-  <div align="left">
-    <ul>
-      <li>a) Disclaiming warranty or limiting liability differently from the
-        terms of sections 15 and 16 of this License; or</li>
-      <li>b) Requiring preservation of specified reasonable legal notices or
-        author attributions in that material or in the Appropriate Legal
-        Notices displayed by works containing it; or</li>
-      <li>c) Prohibiting misrepresentation of the origin of that material, or
-        requiring that modified versions of such material be marked in
-        reasonable ways as different from the original version; or</li>
-      <li>d) Limiting the use for publicity purposes of names of licensors or
-        authors of the material; or</li>
-      <li>e) Declining to grant rights under trademark law for use of some
-        trade names, trademarks, or service marks; or</li>
-      <li>f) Requiring indemnification of licensors and authors of that
-        material by anyone who conveys the material (or modified versions of
-        it) with contractual assumptions of liability to the recipient, for
-        any liability that these contractual assumptions directly impose on
-        those licensors and authors.</li>
-    </ul>
-  </div>
-  <p align="left">All other non-permissive additional terms are considered “further
-    restrictions” within the meaning of section 10.  If the Program as you
-    received it, or any part of it, contains a notice stating that it is
-    governed by this License along with a term that is a further
-    restriction, you may remove that term.  If a license document contains
-    a further restriction but permits relicensing or conveying under this
-    License, you may add to a covered work material governed by the terms
-    of that license document, provided that the further restriction does
-    not survive such relicensing or conveying.</p>
-  <p align="left">If you add terms to a covered work in accord with this section, you
-    must place, in the relevant source files, a statement of the
-    additional terms that apply to those files, or a notice indicating
-    where to find the applicable terms.</p>
-  <p align="left">Additional terms, permissive or non-permissive, may be stated in the
-    form of a separately written license, or stated as exceptions;
-    the above requirements apply either way.</p>
-  <h4 align="left"><a name="section8"></a>8. Termination.</h4>
-  <p align="left">You may not propagate or modify a covered work except as expressly
-    provided under this License.  Any attempt otherwise to propagate or
-    modify it is void, and will automatically terminate your rights under
-    this License (including any patent licenses granted under the third
-    paragraph of section 11).</p>
-  <p align="left">However, if you cease all violation of this License, then your
-    license from a particular copyright holder is reinstated (a)
-    provisionally, unless and until the copyright holder explicitly and
-    finally terminates your license, and (b) permanently, if the copyright
-    holder fails to notify you of the violation by some reasonable means
-    prior to 60 days after the cessation.</p>
-  <p align="left">Moreover, your license from a particular copyright holder is
-    reinstated permanently if the copyright holder notifies you of the
-    violation by some reasonable means, this is the first time you have
-    received notice of violation of this License (for any work) from that
-    copyright holder, and you cure the violation prior to 30 days after
-    your receipt of the notice.</p>
-  <p align="left">Termination of your rights under this section does not terminate the
-    licenses of parties who have received copies or rights from you under
-    this License.  If your rights have been terminated and not permanently
-    reinstated, you do not qualify to receive new licenses for the same
-    material under section 10.</p>
-  <h4 align="left"><a name="section9"></a>9. Acceptance Not Required for Having Copies.</h4>
-  <p align="left">You are not required to accept this License in order to receive or
-    run a copy of the Program.  Ancillary propagation of a covered work
-    occurring solely as a consequence of using peer-to-peer transmission
-    to receive a copy likewise does not require acceptance.  However,
-    nothing other than this License grants you permission to propagate or
-    modify any covered work.  These actions infringe copyright if you do
-    not accept this License.  Therefore, by modifying or propagating a
-    covered work, you indicate your acceptance of this License to do so.</p>
-  <h4 align="left"><a name="section10"></a>10. Automatic Licensing of Downstream Recipients.</h4>
-  <p align="left">Each time you convey a covered work, the recipient automatically
-    receives a license from the original licensors, to run, modify and
-    propagate that work, subject to this License.  You are not responsible
-    for enforcing compliance by third parties with this License.</p>
-  <p align="left">An “entity transaction” is a transaction transferring control of an
-    organization, or substantially all assets of one, or subdividing an
-    organization, or merging organizations.  If propagation of a covered
-    work results from an entity transaction, each party to that
-    transaction who receives a copy of the work also receives whatever
-    licenses to the work the party's predecessor in interest had or could
-    give under the previous paragraph, plus a right to possession of the
-    Corresponding Source of the work from the predecessor in interest, if
-    the predecessor has it or can get it with reasonable efforts.</p>
-  <p align="left">You may not impose any further restrictions on the exercise of the
-    rights granted or affirmed under this License.  For example, you may
-    not impose a license fee, royalty, or other charge for exercise of
-    rights granted under this License, and you may not initiate litigation
-    (including a cross-claim or counterclaim in a lawsuit) alleging that
-    any patent claim is infringed by making, using, selling, offering for
-    sale, or importing the Program or any portion of it.</p>
-  <h4 align="left"><a name="section11"></a>11. Patents.</h4>
-  <p align="left">A “contributor” is a copyright holder who authorizes use under this
-    License of the Program or a work on which the Program is based.  The
-    work thus licensed is called the contributor's “contributor version”.</p>
-  <p align="left">A contributor's “essential patent claims” are all patent claims
-    owned or controlled by the contributor, whether already acquired or
-    hereafter acquired, that would be infringed by some manner, permitted
-    by this License, of making, using, or selling its contributor version,
-    but do not include claims that would be infringed only as a
-    consequence of further modification of the contributor version.  For
-    purposes of this definition, “control” includes the right to grant
-    patent sublicenses in a manner consistent with the requirements of
-    this License.</p>
-  <p align="left">Each contributor grants you a non-exclusive, worldwide, royalty-free
-    patent license under the contributor's essential patent claims, to
-    make, use, sell, offer for sale, import and otherwise run, modify and
-    propagate the contents of its contributor version.</p>
-  <p align="left">In the following three paragraphs, a “patent license” is any express
-    agreement or commitment, however denominated, not to enforce a patent
-    (such as an express permission to practice a patent or covenant not to
-    sue for patent infringement).  To “grant” such a patent license to a
-    party means to make such an agreement or commitment not to enforce a
-    patent against the party.</p>
-  <p align="left">If you convey a covered work, knowingly relying on a patent license,
-    and the Corresponding Source of the work is not available for anyone
-    to copy, free of charge and under the terms of this License, through a
-    publicly available network server or other readily accessible means,
-    then you must either (1) cause the Corresponding Source to be so
-    available, or (2) arrange to deprive yourself of the benefit of the
-    patent license for this particular work, or (3) arrange, in a manner
-    consistent with the requirements of this License, to extend the patent
-    license to downstream recipients.  “Knowingly relying” means you have
-    actual knowledge that, but for the patent license, your conveying the
-    covered work in a country, or your recipient's use of the covered work
-    in a country, would infringe one or more identifiable patents in that
-    country that you have reason to believe are valid.</p>
-  <p align="left">If, pursuant to or in connection with a single transaction or
-    arrangement, you convey, or propagate by procuring conveyance of, a
-    covered work, and grant a patent license to some of the parties
-    receiving the covered work authorizing them to use, propagate, modify
-    or convey a specific copy of the covered work, then the patent license
-    you grant is automatically extended to all recipients of the covered
-    work and works based on it.</p>
-  <p align="left">A patent license is “discriminatory” if it does not include within
-    the scope of its coverage, prohibits the exercise of, or is
-    conditioned on the non-exercise of one or more of the rights that are
-    specifically granted under this License.  You may not convey a covered
-    work if you are a party to an arrangement with a third party that is
-    in the business of distributing software, under which you make payment
-    to the third party based on the extent of your activity of conveying
-    the work, and under which the third party grants, to any of the
-    parties who would receive the covered work from you, a discriminatory
-    patent license (a) in connection with copies of the covered work
-    conveyed by you (or copies made from those copies), or (b) primarily
-    for and in connection with specific products or compilations that
-    contain the covered work, unless you entered into that arrangement,
-    or that patent license was granted, prior to 28 March 2007.</p>
-  <p align="left">Nothing in this License shall be construed as excluding or limiting
-    any implied license or other defenses to infringement that may
-    otherwise be available to you under applicable patent law.</p>
-  <h4 align="left"><a name="section12"></a>12. No Surrender of Others' Freedom.</h4>
-  <p align="left">If conditions are imposed on you (whether by court order, agreement or
-    otherwise) that contradict the conditions of this License, they do not
-    excuse you from the conditions of this License.  If you cannot convey a
-    covered work so as to satisfy simultaneously your obligations under this
-    License and any other pertinent obligations, then as a consequence you may
-    not convey it at all.  For example, if you agree to terms that obligate you
-    to collect a royalty for further conveying from those to whom you convey
-    the Program, the only way you could satisfy both those terms and this
-    License would be to refrain entirely from conveying the Program.</p>
-  <h4 align="left"><a name="section13"></a>13. Use with the GNU Affero General Public License.</h4>
-  <p align="left">Notwithstanding any other provision of this License, you have
-    permission to link or combine any covered work with a work licensed
-    under version 3 of the GNU Affero General Public License into a single
-    combined work, and to convey the resulting work.  The terms of this
-    License will continue to apply to the part which is the covered work,
-    but the special requirements of the GNU Affero General Public License,
-    section 13, concerning interaction through a network will apply to the
-    combination as such.</p>
-  <h4 align="left"><a name="section14"></a>14. Revised Versions of this License.</h4>
-  <p align="left">The Free Software Foundation may publish revised and/or new versions of
-    the GNU General Public License from time to time.  Such new versions will
-    be similar in spirit to the present version, but may differ in detail to
-    address new problems or concerns.</p>
-  <p align="left">Each version is given a distinguishing version number.  If the
-    Program specifies that a certain numbered version of the GNU General
-    Public License “or any later version” applies to it, you have the
-    option of following the terms and conditions either of that numbered
-    version or of any later version published by the Free Software
-    Foundation.  If the Program does not specify a version number of the
-    GNU General Public License, you may choose any version ever published
-    by the Free Software Foundation.</p>
-  <p align="left">If the Program specifies that a proxy can decide which future
-    versions of the GNU General Public License can be used, that proxy's
-    public statement of acceptance of a version permanently authorizes you
-    to choose that version for the Program.</p>
-  <p align="left">Later license versions may give you additional or different
-    permissions.  However, no additional obligations are imposed on any
-    author or copyright holder as a result of your choosing to follow a
-    later version.</p>
-  <h4 align="left"><a name="section15"></a>15. Disclaimer of Warranty.</h4>
-  <p align="left">THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
-    APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
-    HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM “AS IS” WITHOUT WARRANTY
-    OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
-    THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-    PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
-    IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
-    ALL NECESSARY SERVICING, REPAIR OR CORRECTION.</p>
-  <h4 align="left"><a name="section16"></a>16. Limitation of Liability.</h4>
-  <p align="left">IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-    WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
-    THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
-    GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
-    USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
-    DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
-    PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
-    EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
-    SUCH DAMAGES.</p>
-  <h4 align="left"><a name="section17"></a>17. Interpretation of Sections 15 and 16.</h4>
-  <p align="left">If the disclaimer of warranty and limitation of liability provided
-    above cannot be given local legal effect according to their terms,
-    reviewing courts shall apply local law that most closely approximates
-    an absolute waiver of all civil liability in connection with the
-    Program, unless a warranty or assumption of liability accompanies a
-    copy of the Program in return for a fee.</p>
-  <p align="center">END OF TERMS AND CONDITIONS</p>
-  <h3 align="center"><a name="howto"></a>How to Apply These Terms to Your New Programs</h3>
-  <p align="left">If you develop a new program, and you want it to be of the greatest
-    possible use to the public, the best way to achieve this is to make it
-    free software which everyone can redistribute and change under these terms.</p>
-  <p align="left">To do so, attach the following notices to the program.  It is safest
-    to attach them to the start of each source file to most effectively
-    state the exclusion of warranty; and each file should have at least
-    the “copyright” line and a pointer to where the full notice is found.</p>
-  <div align="left">
-    <pre>    <one line to give the program's name and a brief idea of what it does.>
-    Copyright (C) <year>  <name of author>
-
-    This program is free software: you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation, either version 3 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with this program.  If not, see <http://www.gnu.org/licenses/>.
-  </pre>
-  </div>
-  <p align="left">Also add information on how to contact you by electronic and paper mail.</p>
-  <p align="left">If the program does terminal interaction, make it output a short
-    notice like this when it starts in an interactive mode:</p>
-  <div align="left">
-    <pre>    <program>  Copyright (C) <year>  <name of author>
-    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
-    This is free software, and you are welcome to redistribute it
-    under certain conditions; type `show c' for details.
-  </pre>
-  </div>
-  <p align="left">The hypothetical commands `show w' and `show c' should show the appropriate
-    parts of the General Public License.  Of course, your program's commands
-    might be different; for a GUI interface, you would use an “about box”.</p>
-  <p align="left">You should also get your employer (if you work as a programmer) or school,
-    if any, to sign a “copyright disclaimer” for the program, if necessary.
-    For more information on this, and how to apply and follow the GNU GPL, see
-  <http://www.gnu.org/licenses/>.</p>
-  <p align="left">The GNU General Public License does not permit incorporating your program
-    into proprietary programs.  If your program is a subroutine library, you
-    may consider it more useful to permit linking proprietary applications with
-    the library.  If this is what you want to do, use the GNU Lesser General
-    Public License instead of this License.  But first, please read
-<http://www.gnu.org/philosophy/why-not-lgpl.html>.</p></CENTER>
-
-<CENTER>
-  <P>The above license was obtained from the <A HREF="http://www.gnu.org/">Free
-Software Foundation</A> in July, 2009.<BR>
-  Previous MB-System releases were licensed using the GNU General Public License version 2.<BR><BR>
-    Last Updated: $Date: 2004/12/18 01:29:20 $ $Revision: 5.3 $</P>
-</CENTER>
-
-<P>
-<HR WIDTH="67%"></P>
-
-<P><A HREF="mbsystem_home.html"><IMG SRC="mbsystem_logo_small.gif" BORDER=0 HEIGHT=55 WIDTH=158 ALIGN=BOTTOM></A><A HREF="mbsystem_home.html">Back
-to MB-System Home Page...</A></P>
-
-</BODY>
-</HTML>
diff --git a/html/index.html b/html/index.html
deleted file mode 100644
index e1c1169..0000000
--- a/html/index.html
+++ /dev/null
@@ -1,312 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
-<html>
-<head>
-  <title>MB-System Documentation</title>
-  <meta http-equiv="Content-Type" content="text/html">
-  <meta name="Title" content="MB-System: Mapping the Seafloor">
-  <meta name="Author" content="David Caress, Dale Chayes">
-  <meta name="Description"
- content="open source software for processing bathymetry and backscatter data from multibeam and sidescan sonar">
-  <meta name="Keywords"
- content="seafloor,mapping,multibeam,sonar,bathymetry,sidescan,swath processing,open,source,software">
-</head>
-<body alink="#cc9900" bgcolor="#ffffff" link="#336699" text="#000000"
- vlink="#997040">
-<h2 align="center"><img src="mbsystem_logo.gif" height="207" width="616"></h2>
-<center>
-<dl>
-  <dt><b><font size="+2">Seafloor Mapping Software:</font></b></dt>
-</dl>
-</center>
-<center>
-<dl>
-  <dt><b><font size="+2">Processing and Display</font></b></dt>
-</dl>
-</center>
-<center>
-<dl>
-  <dt><b><font size="+2">of Swath Sonar Data</font></b></dt>
-</dl>
-</center>
-<center>
-<dl>
-  <dt><b> </b></dt>
-</dl>
-</center>
-<center>
-<dl>
-  <dt><b><font size="+1"><a href="http://www.mbari.org/staff/caress">David
-W. Caress</a> (1) and <a href="http://www.ldeo.columbia.edu/%7Edale">Dale
-N. Chayes</a> (2)</font></b></dt>
-</dl>
-</center>
-<center>
-<dl>
-  <dt><b>1. <a href="http://www.mbari.org/">Monterey Bay Aquarium
-Research Institute</a></b></dt>
-</dl>
-</center>
-<center>
-<dl>
-  <dt><b>2. <a href="http://www.ldeo.columbia.edu/">Lamont-Doherty
-Earth Observatory</a></b></dt>
-</dl>
-</center>
-<center>
-<dl>
-  <dt><b>of <a href="http://www.columbia.edu/">Columbia University</a></b></dt>
-</dl>
-</center>
-<center>
-<p></p>
-<hr width="67%">
-<p></p>
-</center>
-<center>
-<dl>
-  <dt><b><font size="+1">Introduction</font></b></dt>
-</dl>
-</center>
-<p>MB-System is an open source software package for the processing and
-display of bathymetry and backscatter imagery data derived from
-multibeam,
-interferometry, and sidescan sonars. This software is distributed
-freely (and
-for free) in the form of source code for Unix platforms. The heart of
-the
-system is an input/output library called MBIO which allows programs to
-work
-transparently with any of a number of supported swath sonar data
-formats.
-This approach has allowed the creation of "generic" utilities which can
-be
-applied in a uniform manner to sonar data from a variety of sources.
-Most of
-the programs are command-line tools, but the package does include
-graphical
-tools for editing swath bathymetry, editing navigation, modeling
-bathymetry
-calculation, and adjusting survey navigation.</p>
-<p>The acronym MB stands for MultiBeam; this reflects the fact that the
-early
-development of MB-System focused on processing data from deep sea multibeam sonars (which were the only kind around back then). However, MB-System now supports several data formats from
-sidescan
-and interferometric sonars and works with data from all depth ranges.</p>
-<p>The <a href="http://www.nsf.gov">National Science Foundation</a>
-(NSF) has
-been the primary supporter of MB-System development. NSF initially
-provided
-grants to the authors at the <a href="http://www.ldeo.columbia.edu">
-Lamont-Doherty Earth Observatory</a> in 1993 (two years), and 1995
-(five
-years). <a href="http://www.seabeam.com/"> SeaBeam Instruments</a>
-also
-contributed significant effort from 1994 to 1999. This support has been
-renewed
-through successive parallel five year grants (2001-2006, 2006-2011, 2013-2017) to Caress at the <a
- href="http://www.mbari.org"> Monterey Bay Aquarium Research Institute</a>
-(MBARI) and to Chayes at Lamont. Since 2001, MBARI, with support from the Packard Foundation, has matched 
-the NSF support as part of its seafloor mapping program. </p>
-<p>The original NSF mandate was to create a set of generic tools which
-would
-work with all of the sonar data used in NSF-supported projects. Not
-surprisingly, the core of the MB-System user community consists of
-NSF-supported researchers at U.S. institutions such as the
-Lamont-Doherty
-Earth Observatory, the Scripps Institution of Oceanography, and the
-Woods
-Hole Oceanographic Institution. However, MB-System has also come to be
-used
-widely in the international marine geological community.</p>
-<p>The MB-System source code is distributed under the <a
- href="gpl.html"> GNU
-General Public License</a> as formulated by the <a
- href="http://www.gnu.org/">GNU Project.</a> MB-System
-installation depends on
-some other software packages (e.g. <a
- href="http://gmt.soest.hawaii.edu/"> GMT</a> and <a
- href="http://www.unidata.ucar.edu/software/netcdf/">netCDF</a> ), all of
-which are freely available as source code.</p>
-<p>This documention is distributed with and refers to the MB-System release
-with <a href="mbsystem_version.txt">this version</a>.</p>
-<center>
-<p></p>
-<hr width="67%">
-<p></p>
-</center>
-<center>
-<dl>
-  <dt><b><font size="+1">Information About MB-System:</font></b></dt>
-</dl>
-</center>
-<ul>
-  <li><a href="mbsystem_whatsnew.html">What's new in MB-System version 5</a></li>
-  <li><a href="mbsystem_capabilities.html">Short list of capabilities</a></li>
-  <li><a href="mbsystem_man_list.html">List of MB-System programs and
-links to manual pages</a></li>
-  <li><a href="mbsystem_formats.html">List of supported swath data
-formats</a></li>
-  <li><a href="mbsystem_how_to_get.html">How to get and install
-MB-System</a></li>
-  <li><a href="mbsystem_faq.html">Frequently Asked Questions (and
-answers)</a></li>
-  <li><a href="mbsystem_future.html">Future MB-System development plans</a></li>
-  <li><a href="mbsystem_copyright.html">Copyright and Caveat</a></li>
-</ul>
-<center>
-<p></p>
-<hr width="67%">
-<p></p>
-</center>
-<center>
-<center>
-<dl>
-  <dt><b><font size="+1">Contacting the MB-System Team:</font></b></dt>
-</dl>
-</center>
-<div style="text-align: justify;">
-Although the MB-System authors' personal email addresses are listed
-below, we
-greatly prefer that all inquiries, requests, and problem reports
-regarding
-MB-System be directed to the <a
- href="http://listserver.mbari.org/sympa/arc/mbsystem">MB-System
-Discussion list</a>.<br>
-<br>
-<span style="text-decoration: underline;"></span></div>
-<center>
-<hr width="67%"></center>
-<dl>
-  <dt><a name="MB-authors"></a> <b><font size="+1">The MB-System Core Team</font><font size="+1">:
-    </font></b></dt>
-</dl>
-</center>
-<center>
-<table cellpadding="0" cellspacing="0" width="100%">
-  <tbody>
-    <tr>
-      <td align="center" valign="top">
-      <dt><img alt="David W. Caress 2001" src="caress2001.gif" width="120"></dt>
-        <dt><b><a href="http://www.mbari.org/staff/caress">David W. Caress</a></b></dt>
-        <dt><a href="mailto:caress at mbari.org">caress at mbari.org</a></dt>
-        <dt>Software Engineer</dt>
-        <dt><a href="http://www.mbari.org">Monterey Bay Aquarium Research Institute</a></dt>
-        <dt>7700 Sandholdt Road</dt>
-        <dt>Moss Landing, CA 95039</dt>
-        <dt> </dt>
-      </td>
-    </tr>
-    <tr>
-      <td align="center" valign="top">
-      <dl>
-     <dt><img alt="Dale N. Chayes 2003" src="ChayesJul2003.gif" width="120"></dt>
-      <dt><b><a href="http://www.ldeo.columbia.edu/%7Edale">Dale N. Chayes</a></b></dt>
-        <dt><a href="mailto:dale at ldeo.columbia.edu">dale at ldeo.columbia.edu</a></dt>
-        <dt>Research Engineer</dt>
-        <dt><a href="http://www.ldeo.columbia.edu">Lamont-Doherty
-Earth Observatory</a> of <a href="http://www.columbia.edu">Columbia
-University</a></dt>
-        <dt>Palisades, NY 10964</dt>
-        <dd> </dd>
-      </dl>
-      </td>
-    </tr>
-    <tr>
-      <td align="center" valign="top">
-      <dt><img src="Christina_d_S_Ferreira_crop.jpg" width="120" alt="Christian dos Santos Ferreira 2014"></dt>
-      <dt><b><a href="https://www.marum.de/en/Christian_dos_Santos_Ferreira.html">Christian dos Santos Ferreira</a></b></dt>
-        <dt><a href="mailto:cferreira at marum.de">cferreira at marum.de</a></dt>
-        <dt>Seafloor Imaging Specialist<br>
-          <a href="http://www.marum.de">MARUM - Center for Marine Environmental Sciences</a><br>
-          <a href="http://www.uni-bremen.de">University of Bremen</a>, </dt>
-        <dt>Bremen, Germany</dt>
-        <dt> </dt>
-      </td>
-    </tr>
-  </tbody>
-</table>
-</center>
-<dd><br>
-</dd>
-<center>
-<p></p>
-<hr width="67%">
-<p></p>
-</center>
-<center>
-<dl>
-  <dt><a name="MB-documentors"></a> <b><font size="+1"> Documentation:</font></b></dt>
-</dl>
-</center>
-<center>
-
-<table cellpadding="0" cellspacing="0" width="100%">
-  <tbody>
-    <tr>
-      <td height="384" align="center" valign="top">
-      <div align="center">
-      <dt><img alt="Krystle Anderson 2013" src="KrystleAnderson2013.gif" width="120"></dt>
-        <dt><b>Krystle Anderson</b></dt>
-        <dt><a href="mailto:krystle at mbari.org">krystle at mbari.org</a></dt>
-        <dt>Research Technician</dt>
-        <dt><a href="http://www.mbari.org">Monterey Bay Aquarium Research Institute</a></dt>
-        <dt>7700 Sandholdt Road</dt>
-        <dt>Moss Landing, CA 95039</dt>
-        <dt> </dt>
-        <dt></dt>
-      </div>
-      <div align="center">
-      <dt><img alt="Val Schmidt at LDEO in July 2003" src="ValJul2003.gif" width="120"></dt>
-        <dt><b>Val Schmidt</b></dt>
-        <dt>(Emeritus)</dt>
-        <dt><a href="mailto:vschmidt at ccom.unh.edu">vschmidt at ccom.unh.edu</a></dt>
-        <dt>Research Engineer</dt>
-        <dt><a href="http://www.ccom.unh.edu">Center of Coastal and Ocean Mapping</a></dt>
-        <dt><a href="http://www.ccom.unh.edu">Joint Hydrographic Center</a> of</dt>
-        <dt><a href="http://www.unh.edu">University of New Hampshire</a></dt>
-        <dt>Durham, NH 03824</dt>
-      </div>
-      </td>
-    </tr>
-  </tbody>
-</table>
-</center>
-<center>
-<hr width="67%">
-<p></p>
-</center>
-<center>
-<dl>
-  <dt><a name="MB-team"></a> <b><font size="+1">The MB-System Team 2014:</font></b></dt>
-</dl>
-</center>
-<center>
-<dl>
-  <dt><b><font size="+1"><img alt="Ferreira, Caress, Chayes at MBARI February 2014" src="caress_chayes_ferreira_Feb2014.jpg"> </font></b></dt>
-</dl>
-</center>
-<center>
-<dl>
-  <dt><a name="MB-team"></a> <b><font size="+1">The MB-System Team circa 2003:</font></b></dt>
-</dl>
-</center>
-<center>
-<dl>
-  <dt><b><font size="+1"><img alt="July 2003 at IRI Building, LDEO" src="MBTeamJul2003.jpg"> </font></b></dt>
-</dl>
-</center>
-<dl>
-  <dt><br>
-  </dt>
-</dl>
-<center>
-<p>Last Updated: $Id: mbsystem_home.html 2180 2014-04-02 20:58:34Z caress $</p>
-</center>
-<p></p>
-<div align="center">
-<hr width="67%"></div>
-<br>
- 
-<p></p>
-</body>
-</html>
diff --git a/html/mbsystem.html b/html/mbsystem.html
deleted file mode 100644
index 2b09590..0000000
--- a/html/mbsystem.html
+++ /dev/null
@@ -1,1681 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<HTML VERSION="2.0">
-<HEAD>
-   <TITLE>MB-System Unix Manual Page: mbsystem</TITLE>
-<!-- WEBMAGIC VERSION NUMBER="2.0.2" -->
-<!-- WEBMAGIC TRANSLATION NAME="ServerRoot" SRC="/var/www/htdocs/" DST="/" -->
-<!-- WEBMAGIC TRANSLATION NAME="ProjectRoot" SRC="./" DST="" -->
-</HEAD>
-<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#336699" VLINK="#997040" ALINK="#CC9900">
-<BODY>
-<CENTER><H3><U>MB-System Unix Manual Page</U></H3></CENTER>
-<PRE>
-<H1>mbsystem</H1>
-Section:  MB-System 5.5  (1)<BR>Updated:  26 January 2015 <BR><A HREF="#index">Index</A>
-<HR>
-
-<A NAME="lbAB"> </A>
-<H2>NAME</H2>
-
-<B>mbsystem</B> - A set of utilities for manipulating and
-processing swath sonar bathymetry, amplitude, and sidescan data.
-<P>
-<A NAME="lbAC"> </A>
-<H2>VERSION</H2>
-
-Version 5.5
-<P>
-<A NAME="lbAD"> </A>
-<H2>AUTHORSHIP</H2>
-
-David W. Caress (<A HREF="mailto:caress at mbari.org">caress at mbari.org</A>)
-<BR>
-
-<BR>  Monterey Bay Aquarium Research Institute
-<BR>
-
-Dale N. Chayes (<A HREF="mailto:dale at ldeo.columbia.edu">dale at ldeo.columbia.edu</A>)
-<BR>
-
-<BR>  Lamont-Doherty Earth Observatory
-<P>
-<A NAME="lbAE"> </A>
-<H2>INTRODUCTION</H2>
-
-<B>MB-System</B> is a software package consisting of programs which manipulate, process, list, or
-display swath sonar bathymetry, amplitude, and sidescan data. This software is distributed freely
-(and for free) in the form of source code for Unix platforms. The heart of the system is an
-input/output library called <B>MBIO</B> which allows programs to work transparently with any of a
-number of supported swath sonar data formats. This approach has allowed the creation of
-"generic" utilities which can be applied in a uniform manner to sonar data from a variety of
-sources. Most of the programs are command-line tools, but the package does include graphical
-tools for editing swath bathymetry, editing navigation, modeling bathymetry calculation, and
-adjusting survey navigation.
-<P>
-The acronym MB stands for MultiBeam; this reflects the fact that the early development of
-<B>MB-System</B> focused on processing deep sea bathymetry data from ship-mounted multibeam
-sonars. However, <B>MB-System</B> now supports several data formats from sidescan and interferometric
-sonars and works with sonar data that map the seafloor at scales from centimeters to kilometers.
-<P>
-The original National Science Foundation (NSF) mandate in 1993 was to create a set of generic tools
-that would work with all of the sonar data collected on U.S. academic research vessels in NSF-supported
-projects. Not surprisingly, the early core of the <B>MB-System</B> user community consisted of
-NSF-supported researchers at U.S. institutions such as the Lamont-Doherty Earth Observatory, the Scripps
-Institution of Oceanography, and the Woods Hole Oceanographic Institution. However, in recent years
-<B>MB-System</B> has also come to be used widely in the international oceanographic community and in the
-marine technology industry.
-<P>
-The <B>MB-System</B> source code is distributed under the GNU General Public License as formulated
-by the GNU Project. <B>MB-System</B> installation depends on some other software packages (e.g.
-GMT and netCDF), all of which are freely available as source code.
-<P>
-<A NAME="lbAF"> </A>
-<H2>COPYRIGHT AND LICENSING</H2>
-
-<B>MB-System</B> Copyright (C) 1993-2015 by
-<BR>
-
-David W. Caress (<A HREF="mailto:caress at mbari.org">caress at mbari.org</A>)
-<BR>    Monterey Bay Aquarium Research Institute
-<BR>    Moss Landing, CA 95039
-<BR>
-
-Dale N. Chayes (<A HREF="mailto:dale at ldeo.columbia.edu">dale at ldeo.columbia.edu</A>)
-<BR>    Lamont-Doherty Earth Observatory of Columbia University
-<BR>    Palisades, NY 10964
-<BR>
-
-All Rights Reserved
-<BR>
-
-All Wrongs Remembered
-<P>
-The <B>MB-System</B> source code is distributed under the GNU General Public License as formulated
-by the GNU Project. Early <B>MB-System</B> distributions were described as "public domain",
-which meant there was no restrictions whatsoever on the use of the code. We adopted
-the more restrictive GNU GPL license in order to insure that anyone who distributes software
-based in whole or in part on <B>MB-System</B> also distributes the modified <B>MB-System</B> source code
-and any additional source code.
-<P>
-The GNU GPL also prohibits the distribution of proprietary executables linked with
-<B>MB-System</B> libraries unless the source code is also distributed. We waive this restriction on
-distributing proprietary compiled programs for specific software products if and only if those
-software products meet the following two conditions:
-<DL COMPACT><DT><DD>
-<DL COMPACT><DT>
-
-<DD>1) The software product was created, sold, and delivered to customers using source code
-derived from <B>MB-System</B> release 4.6 distributions.
-<BR>
-
-<DT>
-
-<DD>2) The software product was sold and delivered to customers prior to January 1, 2001.
-</DL></DL>
-
-<P>
-<A NAME="lbAG"> </A>
-<H2>HISTORY</H2>
-
-The development of <B>MB-System</B> began in 1990 as part of David Caress' research at
-the Lamont-Doherty Earth Observatory (LDEO), which involved swath bathymetry data collected
-with SeaBeam multibeam sonars. Development was accelerated in 1991 as part of an effort to
-support the new STN-Atlas Hydrosweep DS multibeam sonar on LDEO's ship, the R/V Maurice Ewing.
-Dale Chayes, a Lamont-Doherty engineer, was responsible for the maintenance and operation
-of the Ewing's Hydrosweep. As part of a grant in 1993 and 1994 to Chayes and Caress to upgrade
-the Hydrosweep operations on the Ewing, the National Science Foundation provided support
-to improve and extend <B>MB-System</B>. The intent of this initial grant was to provide a
-standard "generic" set of tools for processing and display of swath sonar data that could
-be used by the U.S. academic community. The first generally released version of <B>MB-System</B>
-(3.0) was made available in the Spring of 1993. This was followed by versions 3.1 and 3.2 in
-July, 1993, version 3.3 in November, 1993, and version 3.4 in December 1993. All of these
-early releases supported only SeaBeam and Hydrosweep data.
-<P>
-SeaBeam Instruments and Antarctic Support Associates provided additional support in
-1994 for the development of <B>MB-System</B>, with particular emphasis on capabilities related
-to the new SeaBeam 2100 series of sonars. A considerably enhanced <B>MB-System</B> version
-4.0 was released on October 22, 1994; this release followed an almost complete rewrite of
-the underlying source code. The new capabilities included support for sidescan as well as
-bathymetry data and support for data from a number of very different sonars.
-<P>
-The National Science Foundation funded a five year effort begun in 1995 to maintain and
-further develop <B>MB-System</B>. From 1994 to 1997, SeaBeam Instruments (a major
-multibeam sonar manufacturer and, at the time, the principal employer of David W.
-Caress) provided significant support for <B>MB-System</B> development and maintenance.
-Similarly, the Newport, RI office of the Science Applications International Corporation
-(SAIC) supported some <B>MB-System</B> development during 1997-1998, when David W.
-Caress worked there. Version 4.1 was released in November, 1994, followed by 4.2 in
-February 1995, 4.3 on March 12, 1996, 4.4 on August 27, 1996, and 4.5 on September 23,
-1997.
-<P>
-David Caress joined the Monterey Bay Aquarium Research Institute (MBARI) in
-September, 1998. Version 4.6 was released on April 16, 1999. The final update to version
-4.6 (4.6.10) was announced on March 8, 2000. The primary innovations during this period
-included support for the new generation of Simrad multibeam sonars and tools for
-generating data products that could be imported directly into GIS software packages.
-<P>
-The National Science Foundation has continued to support <B>MB-System</B> development through
-additional five year grants (2001-2006 & 2006-2011) to MBARI and
-L-DEO. The Packard Foundation matches the NSF support to Caress at MBARI. The version 5.0 release
-incorporated another substantial rewrite of the underlying code as well as providing
-significant new capabilities. Thirty one 5.0 "beta" distributions were released during
-2001-2003, with the full 5.0.0 version released on December 5, 2003. Active development
-continued with 5.1.0 released on November 26, 2006, 5.1.1 on December 31, 2008.
-and 5.1.2 on December 31, 2009. Since the advent of 5.0, over sixty "beta" and "official"
-distributions of <B>MB-System</B> have been released. Beginning with 5.2.1880 on December 30, 2010,
-<B>MB-System</B> distributions are tied to the revisions in the source code archive (the third number
-corresponds to the revision id in the archive).
-<P>
-Since 2004 a major theme of <B>MB-System</B> development has been the processing of multibeam, sidescan,
-and subbottom profiler data collected on submerged platforms, particularly autonomous
-underwater vehicles (AUVs).
-<P>
-<A NAME="lbAH"> </A>
-<H2>WHAT'S NEW ABOUT VERSION 5</H2>
-
-The version 5.0 release of <B>MB-System</B> included a number of changes and improvements relative
-to the version 4 releases. The most significant changes included:
-<P>
-<A NAME="lbAI"> </A>
-<H3>A new approach to managing data processing.</H3>
-
-<DL COMPACT>
-<DT>*<DD>
-Many tools - one output file. In previous versions of <B>MB-System</B>, each processing
-program read an input swath data file and produced an output swath data file. This
-"serial" processing scheme generally produced a large number of intermediate data
-files. <B>MB-System</B> version 5.0 features the integration of the editing and analysis
-tools with a single program, mbprocess, that outputs processed data files. The new
-"parallel" processing scheme covers bathymetry data processing, but does not yet
-incorporate the sidescan processing capabilities. All of the old tools and capabilities
-are still part of the distribution.
-<DT>*<DD>
-Recursive datalists. The lists of data files used by gridding and plotting programs can
-now be recursive, making it simpler to manage data from many different surveys.
-<DT>*<DD>
-Automatic format identification. <B>MB-System</B> programs will now attempt to
-automatically identify the swath data format based on the filename suffix.
-<DT>*<DD>
-Ancillary data files. Many common <B>MB-System</B> tasks (e.g. swath plotting
-and gridding) can be accomplished more rapidly using ancillary data files containing
-file statistics (".inf" files), quickly read bathymetry (".fbt" files), and
-(".fnv") files. Each of these files is named by adding the indicated four character
-suffix to the original swath data filename. The ".inf" files are created by directing
-the output of <B>mbinfo</B> to a file. The ".fbt" files are creating by using
-<B>mbcopy</B> to extract the bathymetry into a format 71 file. The ".fnv" files
-are created using <B>mblist</B> to create a text navigation list.
-These ancillary files are automatically created together using the
-program <B>mbdatalist</B>.
-<P>
-</DL>
-<A NAME="lbAJ"> </A>
-<H3>New tools.</H3>
-
-<DL COMPACT>
-<DT>*<DD>
-<B>mbnavadjust</B>. This new tool allows users to adjust poorly navigated surveys by
-matching features in overlapping swathes. It is particularly useful for processing
-surveys conducted from submerged platforms.
-<DT>*<DD>
-<B>mbprocess</B>. This new tool performs a variety of processing tasks and produces a
-single output processed swath data file. The program mbprocess can apply
-bathymetry edits from mbedit and mbclean, navigation edits from mbnavedit, sound
-velocity profile changes from mbvelocitytool, and a variety of other corrections.
-<DT>*<DD>
-<B>mbset</B>. This new tool allows users to create and modify the parameter files used to
-control the operation of mbprocess.
-<DT>*<DD>
-<B>mbdatalist</B>. This new tool allows users to list the files referenced by
-a recursive datalist structure. It can also be used to create the ancillary ".inf",
-".fbt", and ".fnv" files for all of the data files referenced in a recursive datalist
-structure.
-<DT>*<DD>
-<B>mbsvplist</B>. This new tool lists water sound velocity profiles embedded
-in swath data files, creating secondary files that
-can be read into MBvelocitytool.
-<DT>*<DD>
-<B>mbareaclean</B>. This new tool identifies and flags artifacts in swath sonar
-bathymetry data within a specified area of interest. The
-area is divided into a grid with square cells or bins, and the
-data are grouped according to these bins. Once all
-of  data  are read, statistical tests are applied
-to the soundings within each bin.
-<P>
-</DL>
-<A NAME="lbAK"> </A>
-<H3>Support for Projected Coordinate Systems.</H3>
-
-<DL COMPACT>
-<DT>*<DD>
-<B>MB-System</B> now incorporates the source code for the PROJ.4 Cartographic Projections library,
-providing support for (apparently) all commonly used geodetic coordinate systems.
-<B>PROJ.4</B> was developed by Gerald Evenden (then of the USGS), and was obtained from
-the <A HREF="http://www.remotesensing.org">www.remotesensing.org</A> website.
-<DT>*<DD>
-A large number of commonly used projected coordinate systems (e.g. UTM) are defined
-in a file (mbsystem/share/projections.dat) distributed with <B>MB-System</B>. These include
-all of the standard UTM zones, all of the standard state plate coordinate systems, and
-most of the European Petroleum Survey Group (EPSG) coordinate systems (also including UTM).
-<DT>*<DD>
-<B>MB-System</B> can now handle swath data that is navigated in a supported projected
-coordinate system. In particular, data files that are navigated with UTM eastings and
-northings instead of longitude and latitude can now be plotted and processed with
-<B>MB-System</B>.
-<DT>*<DD>
-The programs <B>mbgrid</B> and <B>mbmosaic</B> can now output grids and mosaics in any of
-the projected coordinate systems specified in mbsystem/share/projections.dat.
-<DT>*<DD>
-The TIFF images generated with <B>mbm_grdtiff</B> and <B>mbgrdtiff</B> now fully conform
-to the GeoTIFF standard, providing that the source grids or mosaics were generated
-using <B>mbgrid</B> or <B>mbmosaic</B> in either Geographic coordinates, UTM coordinates,
-or any of the EPSG coordinate systems specified in the projections.dat file. This means,
-for instance, that GeoTIFF images generated with <B>mbgrdtiff</B> will be properly
-georeferenced when they are imported into ESRI <B>ArcGIS</B> or other GIS packages.
-<P>
-</DL>
-<A NAME="lbAL"> </A>
-<H3>Restructuring the code.</H3>
-
-<DL COMPACT>
-<DT>*<DD>
-All of the C code now conforms to the ANSI C standard.
-<DT>*<DD>
-The underlying input/output library (<B>MBIO</B>) has been substantially rewritten. The
-structure has been streamlined, simplifying both future development and support of
-the existing code. The <B>MBIO</B> API has been greatly modified.
-<P>
-</DL>
-<A NAME="lbAM"> </A>
-<H3>Handling of old Simrad multibeam data.</H3>
-
-<DL COMPACT>
-<DT>*<DD>
-Vendor format data from the old Simrad multibeams (pre-1997 sonars) are now
-supported by a single format id (51) rather than a separate format id for each sonar
-model. The old format id's are automatically aliased to 51, so existing shellscripts
-will continue to work.
-<DT>*<DD>
-<B>MB-System</B> no longer supports beam flagging in format 51 data. The use of mbedit and mbclean on format 51
-data will cause the flagged beams to be irrevocably nulled. Previous versions of <B>MB-System</B> used the highest bit
-in the depth values to represent beam flags because no Simrad data seemed to use that bit. We have not obtained
-data with depth values using the full bit-range, conflicting with the old beam flagging scheme. We recommend
-that old Simrad data be translated to the extended processing format (57) which contains proper beam flags and
-supports all processing functions. Format 57 is also used for processing data from the current Simrad multibeam
-sonars.
-<DT>*<DD>
-Sidescan data from old Simrad multibeams (pre-1997 sonars) are now handled in the same manner as data from
-the newer sonars (e.g. EM3000, EM3000, EM120). The raw samples in the vendor data format are binned,
-averaged, and interpolated into a 1024 pixel sidescan swath. This binned sidescan is not saved in the vendor
-format, so (as above) it is recommended that the data be translated to an extended format (57) that stores both
-bathymetry beam flags and processed sidescan.
-<P>
-</DL>
-<A NAME="lbAN"> </A>
-<H3>Streamlining of MB-System Default Parameters.</H3>
-
-<DL COMPACT>
-<DT>*<DD>
-Prior to version 5.0, the <B>MB-System</B> defaults
-set by <B>mbdefaults</B> included the format id, a control for
-ping averaging, longitude and latitude bounds for windowing
-by area, and begin and end times for windowing in time. These
-values are no longer set in the .mbio_defaults file or controlled
-by <B>mbdefaults</B>. As noted above, the format id is automatically
-identified from the filename when possible. When filenames do not
-match one of the recognized structures, users must specify the
-format using the relevant programs <B>-F</B><I>format</I> option.
-The controls for ping averaging and windowing in time and space
-are rarely used, and must now be explicitly set in command
-line arguments.
-<P>
-</DL>
-<A NAME="lbAO"> </A>
-<H3>New Data Formats.</H3>
-
-<DL COMPACT>
-<DT>*<DD>
-Furuno HS10 multibeam bathymetry is supported as format 171.
-<DT>*<DD>
-SeaBeam 2120 multibeam data in the L3 Communications XSE format are supported as format 94 (already used
-to support Elac Bottomchart MkII XSE data).
-<DT>*<DD>
-Raw STN Atlas multibeam data generated by the upgraded Hydrosweep DS2 multibeam on the R/V Ewing are
-supported by read-only format 182. Processing is supported using the augmented read-write format 183.
-<DT>*<DD>
-The IFREMER netCDF multibeam archiving data format is supported as format 75. Similarly, the IFREMER
-netCDF navigation archiving data format is supported as format 167.
-<DT>*<DD>
-The STN Atlas processing data format SURF is supported as format 181. At
-present, SURF is supported as a read-only format. This allows plotting and gridding
-of the SURF data, but not processing. Writing or translating the SURF data to
-allow processing will be supported in a later version.
-<DT>*<DD>
-The Hawaii Mapping Research Group's new MR1 format is supported as format 64.
-This format is used to disseminate data from both the HMRG
-interferometric sonars (e.g. MR1) and the WHOI DSL 120
-deep-towed inteferometric sonar. This format has been
-supported by including the code for the HMRG library libmr1pr
-in the <B>MB-System MBIO</B> library. Thanks to Roger Davis and HMRG for
-making the code available under the GPL.
-<DT>*<DD>
-The Edgetech Jstar format for sidescan and subbottom data is
-now supported as formats 132 and 133.
-<P>
-</DL>
-<A NAME="lbAP"> </A>
-<H2>THE NEW VERSION 5 DATA PROCESSING STRUCTURE</H2>
-
-Previous versions of <B>MB-System</B> have emphasized
-processing utilities that operate serially, that is, that
-read in an input swath data file, modify it, and then
-output a second swath data file. Serial processing utilities do allow
-for great flexibility in processing because one uses only
-the programs required and, in general, the order in which
-the programs are used does matter. However, one consequence of serial
-processing has been that processing data frequently results in a large
-number of intermediate data files. For instance, if
-an EM300 data file called "mbari_1998_524.mb57" has
-spikes in the bathymetry, outliers in the navigation, and
-the bathymetry has been calculated using an incorrect model
-for the water sound speed structure, users of <B>MB-System</B>
-would previously have processed it with a sequence
-something like this:
-<P>
-<BR>     1) Run <B>mbclean</B> to automatically flag
-<BR>        the obvious bathymetric artifacts.
-<BR>            Input:  mbari_1998_524.mb57
-<BR>            Output: mbari_1998_524_c.mb57
-<P>
-<BR>     2) Run <B>mbedit</B> to interactively flag
-<BR>        bathymetric artifacts.
-<BR>            Input:  mbari_1998_524_c.mb57
-<BR>            Output: mbari_1998_524_ce.mb57
-<P>
-<BR>     3) Run <B>mbnavedit</B> to interactively clean
-<BR>        the navigation.
-<BR>            Input:  mbari_1998_524_ce.mb57
-<BR>            Output: mbari_1998_524_cen.mb57
-<P>
-<BR>     4) Run <B>mbvelocitytool</B> to generate an
-<BR>        appropriate sound velocity profile (SVP) for
-<BR>        recalculating the bathymetry.
-<BR>            Input:  mbari_1998_524_cen.mb57
-<BR>            Output: good.svp
-<P>
-<BR>     5) Run <B>mbbath</B> to recalculate the
-<BR>        bathymetry using the SVP file generated
-<BR>        using <B>mbvelocitytool</B>.
-<BR>            Input:  mbari_1998_524_cen.mb57
-<BR>            Input:  good.svp
-<BR>            Output: mbari_1998_524_cenb.mb57
-<P>
-<BR>     6) Run <B>mbsimradmakess</B> to recalculate the
-<BR>            sidescan while ignoring sidescan samples
-<BR>            from beams now flagged as bad.
-<BR>            Input:  mbari_1998_524_cenb.mb57
-<BR>            Output: mbari_1998_524_cenbs.mb57
-<P>
-<BR>     7) Run <B>mbbackangle</B> to calculate an amplitude
-<BR>      vs grazing angle table for correcting
-<BR>      sidescan.
-<BR>            Input:  mbari_1998_524_cenbs.mb57
-<BR>            Output: ampvsga.dat
-<P>
-<BR>     8) Run <B>mbanglecorrect</B> to correct the sidescan.
-<BR>            Input:  mbari_1998_524_cenbs.mb57
-<BR>            Input: ampvsga.dat
-<BR>            Output: mbari_1998_524_cenbsc.mb57
-<P>
-The result of this processing includes the input swath
-data file, the final swath data file, and five
-intermediate swath data files. The impact of this approach
-on data storage requirements is obvious (though some users
-have ameliorated the issue by working with scripts that
-automatically delete unneeded data files or by piping
-data from one non-graphical process to
-another to avoid making intermediate files).
-The serial processing approach
-also presents data management problems because data files
-frequently have different processing requirements, even
-within a single survey. We have found that working with
-very large datasets can be awkward when only a minority
-of data files require navigation editing or bathymetric
-recalculation, or when some data files require multiple
-episodes of bathymetry and navigation editing.
-<P>
-<B>MB-System</B> version 5 includes new utilities implementing
-a parallel processing scheme that simplifies the processing
-of most swath data. This scheme is centered around the program
-<B>mbprocess</B>, which can accomplish the following
-processing tasks in a single step:
-<DL COMPACT><DT><DD>
-<DL COMPACT>
-<DT>*<DD>
-Merge edited navigation generated by <B>mbnavedit</B>.
-<DT>*<DD>
-Apply bathymetry edit flags from <B>mbedit</B>
-and <B>mbclean</B>
-<DT>*<DD>
-Recalculate bathymetry from raw travel time and
-angle data by raytracing through water sound speed
-models from <B>mbvelocitytool</B> or <B>mbsvplist</B>.
-<DT>*<DD>
-Apply changes to roll bias, pitch bias, heading
-bias, and draft values.
-<DT>*<DD>
-Recalculate sidescan from raw backscatter samples
-(Simrad multibeam data only).
-<DT>*<DD>
-Recalculate sidescan from raw backscatter samples
-(Simrad multibeam data only).
-<DT>*<DD>
-Correct sidescan for amplitude vs grazing angle
-patterns.
-<DT>*<DD>
-Apply tides to bathymetry.
-<BR>
-
-</DL></DL>
-
-The actions of <B>mbprocess</B> are controlled by text
-parameter files. Each <B>mbprocess</B> parameter file is
-named by adding a ".par" suffix to the associated input
-swath data file and contains single line commands that set
-processing modes and parameters. Tools such as <B>mbedit</B>,
-<B>mbnavedit</B>, and <B>mbclean</B> all generate and/or modify
-parameter files in addition to generating parallel files
-used by <B>mbprocess</B>. The program <B>mbset</B>
-can also be used to create and modify <B>mbprocess</B>
-parameter files.
-<P>
-The same processing steps described above as a serial
-processing scheme can be accomplished with the new parallel
-processing scheme as follows:
-<P>
-<BR>     1) Run <B>mbdatalist</B> to create ancillary
-<BR>        data files containing statistics
-<BR>        (".inf"), quickly read bathymetry
-<BR>        (".fbt"), and quickly read navigation
-<BR>        (".fnv"). These files are used to
-<BR>        speed common operations such as swath
-<BR>        plotting and gridding.
-<BR>            Input:  mbari_1998_524.mb57
-<BR>            Output: mbari_1998_524.mb57.inf
-<BR>                    mbari_1998_524.mb57.fbt
-<BR>                    mbari_1998_524.mb57.fnv
-<P>
-<BR>     2) Run <B>mbclean</B> to identify
-<BR>        the obvious bathymetric artifacts
-<BR>        and output a list of the edit events.
-<BR>        The parameter file is created and
-<BR>        set to apply bathymetry flags from
-<BR>        the ".esf" file.
-<BR>            Input:  mbari_1998_524.mb57
-<BR>            Output: mbari_1998_524.mb57.esf
-<BR>                    mbari_1998_524.mb57.par
-<P>
-<BR>     3) Run <B>mbedit</B> to interactively
-<BR>        identify bathymetric artifacts
-<BR>        and output a list of the edit events.
-<BR>        The existing edits from <B>mbclean</B>
-<BR>        are loaded and applied prior to editing.
-<BR>        The parameter file is updated and
-<BR>        set to apply bathymetry flags from
-<BR>        the ".esf" file.
-<BR>            Input:  mbari_1998_524.mb57
-<BR>                    mbari_1998_524.mb57.esf
-<BR>                    mbari_1998_524.mb57.par
-<BR>            Output: mbari_1998_524.mb57.esf
-<BR>                    mbari_1998_524.mb57.par
-<P>
-<BR>     4) Run <B>mbnavedit</B> to interactively
-<BR>        clean the navigation. The edited
-<BR>        navigation is output to the ".nve" file.
-<BR>        The parameter file is updated and
-<BR>        set to merge the navigation from
-<BR>        the ".nve" file.
-<BR>            Input:  mbari_1998_524.mb57
-<BR>                    mbari_1998_524.mb57.par
-<BR>            Output: mbari_1998_524.mb57.nve
-<BR>                    mbari_1998_524.mb57.par
-<P>
-<BR>     5) Run <B>mbvelocitytool</B> to generate an
-<BR>        an appropriate sound velocity profile
-<BR>        (SVP) for recalculating the bathymetry.
-<BR>        The SVP is output to the ".svp" file.
-<BR>        The parameter file is updated and
-<BR>        set to recalculate the bathymetry by
-<BR>        raytracing through the SVP model from
-<BR>        the ".svp" file.
-<BR>            Input:  mbari_1998_524.mb57
-<BR>                    mbari_1998_524.mb57.par
-<BR>            Output: mbari_1998_524.mb57.svp
-<BR>                    mbari_1998_524.mb57.par
-<P>
-<BR>     6) Run <B>mbbackangle</B> to generate an
-<BR>        a set of amplitude vs grazing angle
-<BR>        tables at regular intervals in the
-<BR>        data. These tables are placed into
-<BR>        a single ".sga" file. The parameter
-<BR>        file is updated and set to correct
-<BR>        the sidescan by interpolating the
-<BR>        amplitude vs grazing angle table for
-<BR>        each ping.
-<BR>            Input:  mbari_1998_524.mb57
-<BR>                    mbari_1998_524.mb57.par
-<BR>            Output: mbari_1998_524.mb57.sga
-<BR>                    mbari_1998_524.mb57.par
-<P>
-<BR>     7) Run <B>mbset</B> to set the parameter file
-<BR>        so that mbprocess will recalculate
-<BR>        the sidescan (this is for Simrad
-<BR>        multibeam data only) while ignoring
-<BR>        sidescan samples from beams now flagged
-<BR>        as bad.
-<BR>            Input:  mbari_1998_524.mb57.par
-<BR>            Output: mbari_1998_524.mb57.par
-<P>
-<BR>     8) Run <B>mbprocess</B> to apply the bathymetric
-<BR>        edits, merge the cleaned navigation,
-<BR>        recalculate the bathymetry, recalculate
-<BR>        the sidescan, and correct the sidescan.
-<BR>        The processed swath data is written to
-<BR>        an output swath data file. The usual
-<BR>        ancillary data files containing statistics,
-<BR>        quickly read bathymetry, and quickly
-<BR>        read navigation are also created.
-<BR>            Input:  mbari_1998_524.mb57
-<BR>                    mbari_1998_524.mb57.esf
-<BR>                    mbari_1998_524.mb57.nve
-<BR>                    mbari_1998_524.mb57.svp
-<BR>                    mbari_1998_524.mb57.aga
-<BR>                    mbari_1998_524.mb57.par
-<BR>            Output: mbari_1998_524p.mb57
-<BR>                    mbari_1998_524p.mb57.inf
-<BR>                    mbari_1998_524p.mb57.fbt
-<BR>                    mbari_1998_524p.mb57.fnv
-<P>
-The result of this processing is a single output swath
-data file. Moreover, the processed output can be easily
-updated if, for example, additional bathymetry editing
-is required. If the <B>mbedit</B> program is used again,
-it will load the existing edit events from the ".esf"
-file and then update the ".esf" file. To incorporate the
-updated bathymetry edits, one just runs <B>mbprocess</B>
-again. One can similarly change the SVP file without
-impacting on the bathymetry editing or navigation editing
-components of the processing.
-<P>
-All of the old, serial processing utilities are still
-distributed with <B>MB-System</B>. However, some of the serial
-tools have been replaced by new versions of the same name
-(e.g. <B>mbedit</B>, <B>mbclean</B>, <B>mbbackangle</B>, and <B>mbnavedit</B>).
-In these cases, the old versions are preserved as programs
-with "old" added to their names (e.g. <B>mbeditold</B>,
-<B>mbcleanold</B>, <B>mbbackangleold</B>, and <B>mbnaveditold</B>).
-<P>
-<A NAME="lbAQ"> </A>
-<H2>THE NEW VERSION 5 DATALIST FILES</H2>
-
-Previous versions of <B>MB-System</B> have used lists of
-data files, or datalists, as input to several programs
-(e.g. <B>mbgrid</B>, <B>mbmosaic</B>, <B>mbinfo</B>,
-<B>mblist</B>, and <B>mbm_plot</B>). The basic datalist
-entry has consisted of a swath data name (often including
-the entire path) followed by a space and then the <B>MB-System</B> format
-id for that file. Datalist entry lines starting with
-the character '#' are considered comments. Version 5 extends
-the definition and usage of datalists in several
-significant ways. First, datalists may now be recursive.
-A datalist entry may be another datalist file, as indicated
-by a format id of -1. Second, datalists entries may contain
-a third column which is interpreted as a gridding weight
-value by <B>mbgird</B>. This third value may be used to
-weight some data higher than other data. For example, one might
-weight SeaBeam 2112 data with a value of 1.0 and lower
-quality SeaBeam classic data with a value of 0.001. The result
-would be that the newer 2112 data effectively overlies the less good
-data wherever overlap occurs. The third new feature of datalists
-works with data processed using the new parallel processing scheme.
-In the parallel processing scheme the raw data files are often,
-but not always,
-accompanied by processed files produced by <B>mbprocess</B>.
-It is awkward to maintain datalists that directly refer to the
-current best datafiles. If one inserts the text $PROCESSED
-into the first line of a datalist containing raw files,
-then programs like <B>mbgrid</B> will read the processed file
-if it exists, but otherwise will read the raw file. Similarly,
-a first line of $RAW will force the programs to only
-read the raw files directly referenced in the datalist. These
-options also work recursively. The first instance of
-a $PROCESSED or $RAW tag will prevail over all
-others encountered through a hierarchy of recursive datalists.
-The gridding weight values will also be applied recursively,
-so one can specify the gridding weight for a large number of
-data files by applying to a datalist entry which is itself
-a datalist referencing those files. However, gridding weights
-are by default overridden by any values applied to the file
-entries themselves (this behavior can be reversed using the
-datalist tag $NOLOCALWEIGHT).
-<P>
-<A NAME="lbAR"> </A>
-<H2>VERSION 5 FILE NAMING CONVENTIONS</H2>
-
-The version 5 <B>MB-System</B> programs make extensive use
-of standardized filename suffixes. These suffixes allow
-<B>MB-System</B> programs to know what kinds of files it is working
-with, and in particular to determine swath data formats without
-the user having to specify them. Although the processing will
-generally work even if a user does not use the standard
-filenaming convention, we can guarentee that the user's work
-will be much easier if the convention is followed. Quite
-simply, the convention is for swath files to end with a
-suffix of the format ".mbXX" or ".mbXXX", where XX or XXX
-is the two digit or three digit <B>MB-System</B> format id,
-respectively. For instance, a Simrad EM3000 file in the
-processing format 57 might have a name like:
-<BR> <TT>       </TT>0053_20020518_205816.mb57<BR>
-<BR>
-
-and a Reson 8101 file in the GSF format 121 might have
-a name like:
-<BR> <TT>       </TT>039_2106.mb121<BR>
-<BR>
-
-<B>MB-System</B> programs are able to recognize many standard
-filename conventions used by sonar vendors or data logging
-package vendors. For instance, filenames with a "_raw.all"
-suffix, like:
-<BR> <TT>       </TT>0053_20020518_205816_raw.all<BR>
-<BR>
-
-are recognized as either old (format 51) or new (format 56)
-Simrad multibeam data (and the programs also determine which
-of the two formats apply). Filenames ending with ".rec" are
-recognized as SeaBeam 2100 multibeam data. Filenames ending
-with ".xse" are known to be Elac Bottomchart or SeaBeam
-2100 multibeam data in the XSE format 94. In these instances
-the program <B>mbprocess</B> will automatically replace the
-vendor suffix with the <B>MB-System</B> convention suffix when
-it creates a processed output file.
-<P>
-<A NAME="lbAS"> </A>
-<H2>LIST OF MB-SYSTEM PROGRAMS AND MACROS</H2>
-
-See the individual manual pages for detailed information about
-specific programs.
-See the manual page for <B>MBIO</B> for information about the
-i/o library and the swath sonar data formats supported by <B>MBIO</B>.
-<P>
-These are the MB-system programs which are used in the
-version 5 parallel processing scheme. Those programs that
-are also relevant to the serial processing scheme are
-marked with an *:
-<BR> <B>mb7k2jstar</B>: Extract Jstar format (format 132) sidescan
-<BR> <TT>       </TT><TT>        </TT>and subbottom data from Reson 7k (format 88)<BR>
-<BR> <TT>       </TT><TT>        </TT>data files.<BR>
-<BR> <B>mb7k2ss</B>: Extract sidescan sonar data from Reson 7k format
-<BR> <TT>       </TT><TT>        </TT>data, bins and lays the sidescan onto the<BR>
-<BR> <TT>       </TT><TT>        </TT>seafloor, and outputs files in the MBF_MBLDEOIH<BR>
-<BR> <TT>       </TT><TT>        </TT>formst (MBIO format 71).<BR>
-<BR> <B>mb7kpreprocess</B>: Preprocess Reson 7k data (MBIO format 88),
-<BR> <TT>       </TT><TT>        </TT>including applying time lag and biases to<BR>
-<BR> <TT>       </TT><TT>        </TT>attitude and navigation data.<BR>
-<BR> <B>mbhysweeppreprocess</B>: Preprocess multibeam data in the
-<BR> <TT>       </TT><TT>        </TT>Hysweep HSX format (MBIO format 201).<BR>
-<BR> <B>mbkongsbergpreprocess</B>: Preprocess data from third generation
-<BR> <TT>       </TT><TT>        </TT>Kongsberg multibeam sonars (MBIO formats 58 and 59).<BR>
-<BR> <B>mbbackangle</B>:  Generates tables of the average
-<BR> <TT>       </TT><TT>        </TT>amplitude or sidescan values as a<BR>
-<BR> <TT>       </TT><TT>        </TT>function of the grazing angle with<BR>
-<BR> <TT>       </TT><TT>        </TT>the seafloor at regular intervals in<BR>
-<TT>        </TT><TT>        </TT>the data.<BR>
-<BR> <B>mbclean</B>:  Automatically identifies and
-<BR> <TT>       </TT><TT>        </TT>flags bad beams in swath sonar<BR>
-<BR> <TT>       </TT><TT>        </TT>bathymetry data.<BR>
-<BR> <B>mbcontour</B>*:  Generate GMT compatible Postscript
-<BR> <TT>       </TT><TT>        </TT>color swath contour plots.<BR>
-<BR> <B>mbcopy</B>*:  Copy swath sonar data files.
-<BR> <B>mbdatalist</B>:  Parses recursive datalist files
-<BR>  <TT>      </TT><TT>        </TT>and outputs the  complete  list  of<BR>
-<BR> <TT>       </TT><TT>        </TT>data  files,  formats,  and  file weights.<BR>
-<BR> <B>mbdefaults</B>*:  Set or list default mbio parameters
-<BR> <TT>       </TT><TT>        </TT>for reading and writing swath sonar data<BR>
-<BR> <B>mbedit</B>:  Interactive editor used to flag bad
-<BR> <TT>       </TT><TT>        </TT>beams in swath sonar bathymetry data.<BR>
-<BR> <B>mbextractsegy</B>: Extract subbottom profiler or
-<BR> <TT>       </TT><TT>        </TT>center beam reflection data to segy files.<BR>
-<BR> <B>mbformat</B>*:   List information about swath sonar
-<BR> <TT>       </TT><TT>        </TT>data formats supported by the <B>MBIO</B> library.<BR>
-<BR> <B>mbgetesf</B>*:  Extract list of flagging or unflagging
-<BR> <TT>       </TT><TT>        </TT>beam edit events from a swath sonar data<BR>
-<BR> <TT>       </TT><TT>        </TT>file in the edit save file (".esf") format<BR>
-<BR> <TT>       </TT><TT>        </TT>used by <B>mbedit</B>, <B>mbclean</B>, and<BR>
-<BR> <TT>       </TT><TT>        </TT><B>mbprocess</B>.<BR>
-<BR> <B>mbgrdtiff</B>: Generate TIFF image from gridded data
-<BR> <B>mbgrdviz</B>: Vizualize GMT grids.
-<BR> <B>mbgrid</B>*:  Grid bathymetry, amplitude, and sidescan
-<BR> <TT>       </TT><TT>        </TT>data from swath sonar data files.<BR>
-<BR> <B>mbhistogram</B>*:  Obtain histogram of bathymetry,
-<BR> <TT>       </TT><TT>        </TT>amplitude, or sidescan data from<BR>
-<BR>  <TT>      </TT><TT>        </TT>swath sonar data files.<BR>
-<BR> <B>mbinfo</B>*:  Output some basic statistics of
-<BR> <TT>       </TT><TT>        </TT>swath sonar data files.<BR>
-<BR> <B>mblevitus</B>*:  Create a water velocity profile
-<BR> <TT>       </TT><TT>        </TT>which is representative of the mean<BR>
-<BR> <TT>       </TT><TT>        </TT>annual water column for a specified<BR>
-<BR> <TT>       </TT><TT>        </TT>1 degree by 1 degree region.<BR>
-<BR> <B>mblist</B>*:  List data in swath sonar data files.
-<BR> <B>mbmosaic</B>*:  Mosaic sidescan and amplitude data.
-<BR> <B>mbnavadjust</B>:  Interactive navigation adjustment
-<BR> <TT>       </TT><TT>        </TT>package that adjusts navigation so<BR>
-<BR> <TT>       </TT><TT>        </TT>that swath bathymetry matches where<BR>
-<BR> <TT>       </TT><TT>        </TT>swathes overlap or cross.<BR>
-<BR> <B>mbnavedit</B>:  Interactive editor used to fix
-<BR> <TT>       </TT><TT>        </TT>problems with navigation in<BR>
-<BR> <TT>       </TT><TT>        </TT>swath sonar data files.<BR>
-<BR> <B>mbnavlist</B>*:  List navigation data in swath
-<BR> <TT>       </TT><TT>        </TT>sonar data files.<BR>
-<BR> <B>mbneptune2esf</B>: Extract bathymetry edits from
-<BR> <TT>       </TT><TT>        </TT>Simrad Neptune software into edit save<BR>
-<TT>        </TT><TT>        </TT>file format.<BR>
-<BR> <B>mbprocess</B>: Performs a variety of processing
-<BR> <TT>       </TT><TT>        </TT>tasks in a single step, including<BR>
-<BR> <TT>       </TT><TT>        </TT>merging navigation, applying<BR>
-<BR> <TT>       </TT><TT>        </TT>bathymetry edits, recalculating<BR>
-<BR> <TT>       </TT><TT>        </TT>bathymetry, and recalculating<BR>
-<BR> <TT>       </TT><TT>        </TT>sidescan.<BR>
-<BR> <B>mbps</B>*:    Simple perspective views of swath
-<BR> <TT>       </TT><TT>        </TT>bathymetry in Postscript.<BR>
-<BR> <B>mbrolltimelag</B>:  Estimate attitude time lag by cross
-<BR> <TT>       </TT><TT>        </TT>correlation of apparent bottom slope with the<BR>
-<BR> <TT>       </TT><TT>        </TT>roll time series:<BR>
-<BR> <B>mbsegygrid</B>: Generate time vs. trace number
-<BR> <TT>       </TT><TT>        </TT>grids of seismic data from segy files.<BR>
-<BR> <B>mbsegyinfo</B>: Output some basic statistics of
-<BR> <TT>       </TT><TT>        </TT>segy seismic data files.<BR>
-<BR> <B>mbsegylist</B>: List selected header values in
-<BR> <TT>       </TT><TT>        </TT>segy seismic data files.<BR>
-<BR> <B>mbset</B>:  Create and modify <B>mbprocess</B>
-<BR> <TT>       </TT><TT>        </TT>parameter files.<BR>
-<BR> <B>mbsvplist</B>*:  List water sound velocity profiles in swath
-<BR> <TT>       </TT><TT>        </TT>sonar data files.<BR>
-<BR> <B>mbswath</B>*:  Generate GMT compatible Postscript
-<BR> <TT>       </TT><TT>        </TT>color and color shaded relief swath plots.<BR>
-<BR> <B>mbvelocitytool</B>*:  Interactive program for
-<BR> <TT>       </TT><TT>        </TT>modeling the affect of the water<BR>
-<BR> <TT>       </TT><TT>        </TT>velocity profile on swath sonar<BR>
-<BR> <TT>       </TT><TT>        </TT>bathymetry calculations.<BR>
-<P>
-The following are MB-system programs which are not used in the
-version 5 parallel processing scheme. These programs are
-included in the version 5 releases for backward compatibility
-with the old serial processing scheme:
-<BR> <B>mbhsdump</B>:  Lists contents of the various sorts of
-<BR> <TT>       </TT><TT>        </TT>data records in Hydrosweep DS data.<BR>
-<BR> <B>mbanglecorrect</B>:  Apply a grazing angle correction
-<BR> <TT>       </TT><TT>        </TT>to beam amplitude or sidescan data.<BR>
-<BR> <B>mbbackangle</B>:  Generates a table of the average
-<BR> <TT>       </TT><TT>        </TT>amplitude or sidescan values as a<BR>
-<BR> <TT>       </TT><TT>        </TT>function of the grazing angle with<BR>
-<BR> <TT>       </TT><TT>        </TT>the seafloor.<BR>
-<BR> <B>mbbath</B>:  Generates bathymetry from travel times
-<BR> <TT>       </TT><TT>        </TT>in swath sonar data.<BR>
-<BR> <B>mbcleanold</B>:  Old tool that utomatically
-<BR> <TT>       </TT><TT>        </TT>identifies and flags bad beams<BR>
-<BR> <TT>       </TT><TT>        </TT>in swath sonar bathymetry data.<BR>
-<BR> <B>mbcut</B>:  Removes data from portions of swath
-<BR> <TT>       </TT><TT>        </TT>as specified by the user.<BR>
-<BR> <B>mbeditold</B>:  Old interactive editor used to flag bad
-<BR> <TT>       </TT><TT>        </TT>beams in swath sonar bathymetry data.<BR>
-<BR> <B>mbfilter</B>:   Apply some simple filter functions
-<BR> <TT>       </TT><TT>        </TT>to sidescan, beam amplitude, or<BR>
-<BR> <TT>       </TT><TT>        </TT>bathymetry data.<BR>
-<BR> <B>mbgetmask</B>:  Extract list of flagged or edited
-<BR> <TT>       </TT><TT>        </TT>beams from a swath sonar data file.<BR>
-<BR> <B>mbmask</B>:  Apply editing information obtained
-<BR> <TT>       </TT><TT>        </TT>from one file with <B>mbgetmask</B><BR>
-<BR> <TT>       </TT><TT>        </TT>to another file.<BR>
-<BR> <B>mbmerge</B>:  Merge swath sonar data with new
-<BR> <TT>       </TT><TT>        </TT>navigation.<BR>
-<BR> <B>mbnaveditold</B>:  Old interactive editor used to fix
-<BR> <TT>       </TT><TT>        </TT>problems with navigation in<BR>
-<BR> <TT>       </TT><TT>        </TT>swath sonar data files.<BR>
-<BR> <B>mbrollbias</B>:  Evaluate the roll bias of a
-<BR> <TT>       </TT><TT>        </TT>swath sonar system using two pieces<BR>
-<BR> <TT>       </TT><TT>        </TT>of coincident bathymetry data<BR>
-<BR> <TT>       </TT><TT>        </TT>collected with opposing ship headings.<BR>
-<BR> <B>mbsimradmakess</B>:  Regenerate sidescan imagery
-<BR> <TT>       </TT><TT>        </TT>from the raw amplitude samples contained<BR>
-<BR> <TT>       </TT><TT>        </TT>in data from Simrad EM300 and EM3000 sonars.<BR>
-<BR> <B>mbtide</B>:  Corrects swath sonar bathymetry
-<BR> <TT>       </TT><TT>        </TT>for tide data.<BR>
-<BR> <B>mbunclean</B>:  Unflags edited beams in swath sonar
-<BR> <TT>       </TT><TT>        </TT>bathymetry data.<BR>
-<P>
-Macros are programs or shellscripts which make use of programs
-from the MB-system and other software packages to accomplish common
-tasks easily.  These are the current MB-system macros:
-<BR> <B>mbm_arc2grd</B>:  Convert an ESRI ArcView ASCII grid file
-<BR> <TT>       </TT><TT>        </TT>to a GMT grid file.<BR>
-<BR> <B>mbm_copy</B>:  Translate groups of swath data files
-<BR> <TT>       </TT><TT>        </TT>between formats<BR>
-<BR> <B>mbm_dslnavfix</B>:  Reads a WHOI DSL AMS-120 processed
-<BR> <TT>       </TT><TT>        </TT>navigation file containing UTM northings<BR>
-<BR> <TT>       </TT><TT>        </TT>and eastings and outputs a navigation file<BR>
-<BR> <TT>       </TT><TT>        </TT>containing longitude and latitude which is<BR>
-<BR> <TT>       </TT><TT>        </TT>suitable for use with <B>mbmerge</B>.<BR>
-<BR> <B>mbm_fmtvel</B>:  Scans a Hydrosweep DS data file
-<BR> <TT>       </TT><TT>        </TT>and outputs a formatted table of<BR>
-<BR> <TT>       </TT><TT>        </TT>the mean water velocity and surface<BR>
-<BR> <TT>       </TT><TT>        </TT>water velocity values used in<BR>
-<BR> <TT>       </TT><TT>        </TT>processing that data.<BR>
-<BR> <B>mbm_grd2arc</B>:  Converts a GMT grid file to an ESRI ArcView
-<BR> <TT>       </TT><TT>        </TT>ASCII grid file.<BR>
-<BR> <B>mbm_grd2geovrml</B>:  Create and execute commands which
-<BR>  <TT>      </TT><TT>        </TT>generate a TerraVision tileset and GeoVRML<BR>
-<BR> <TT>       </TT><TT>        </TT>set  of  files  that can  be combined with<BR>
-<BR> <TT>       </TT><TT>        </TT>other data and viewed in a web browser.<BR>
-<BR> <B>mbm_grd3dplot</B>:  Reads a GMT GRD grid file and
-<BR> <TT>       </TT><TT>        </TT>writes a shellscript which will<BR>
-<BR> <TT>       </TT><TT>        </TT>generate a GMT 3D perspective view<BR>
-<BR> <TT>       </TT><TT>        </TT>of the data.<BR>
-<BR> <B>mbm_grdcut</B>:  Extracts a subarea of a GMT grid file.
-<BR> <B>mbm_grdplot</B>:  Reads a GMT GRD grid file and
-<BR> <TT>       </TT><TT>        </TT>writes a shellscript which will<BR>
-<BR> <TT>       </TT><TT>        </TT>generate a GMT map of the data.<BR>
-<BR> <B>mbm_grdtiff</B>:  Reads a GMT GRD grid file and writes a
-<BR> <TT>       </TT><TT>        </TT>shellscript which will generate a TIFF image<BR>
-<BR> <TT>       </TT><TT>        </TT>of the data.<BR>
-<BR> <B>mbm_grid</B>:  Reads a swath sonar data file and writes a
-<BR> <TT>       </TT><TT>        </TT>shellscript which will grid bathymetry data or<BR>
-<BR> <TT>       </TT><TT>        </TT>mosaic sidescan (or amplitude) data using<BR>
-<BR> <TT>       </TT><TT>        </TT>reasonable guesses at the appropriate grid<BR>
-<BR> <TT>       </TT><TT>        </TT>bounds and bin size.<BR>
-<BR> <B>mbm_makedatalist</B>: Generates an MB-System datalist
-<BR> <TT>       </TT><TT>        </TT>file referencing  all identifiable swath<BR>
-<BR> <TT>       </TT><TT>        </TT>files in the specified target directory.<BR>
-<BR> <B>mbm_plot</B>:  Reads a swath sonar data file and
-<BR> <TT>       </TT><TT>        </TT>writes a shellscript which will<BR>
-<BR> <TT>       </TT><TT>        </TT>generate a swath and/or contour<BR>
-<BR> <TT>       </TT><TT>        </TT>plot of the data.<BR>
-<BR> <B>mbm_rollerror</B>:  Reads a swath sonar data file,
-<BR> <TT>       </TT><TT>        </TT>calculates the noise in the vertical reference<BR>
-<BR> <TT>       </TT><TT>        </TT>used by the sonar, and generates a file<BR>
-<BR> <TT>       </TT><TT>        </TT>containing roll corrections which<BR>
-<BR> <TT>       </TT><TT>        </TT>can be applied to the data.<BR>
-<BR> <B>mbm_route2mission</B>:  Translate an mbgrdviz survey route
-<BR> <TT>       </TT><TT>        </TT>file into an MBARI AUV mission script.<BR>
-<BR> <B>mbm_stat</B>:  Runs <B>mbinfo</B> on a swath sonar data
-<BR> <TT>       </TT><TT>        </TT>file and extracts beam statistics from<BR>
-<BR> <TT>       </TT><TT>        </TT>the output of <B>mbinfo</B>.<BR>
-<BR> <B>mbm_utm</B>: Performs forward and inverse UTM projections
-<BR> <TT>       </TT><TT>        </TT>of ASCII data triples.<BR>
-<BR> <B>mbm_vrefcheck</B>:  Generates a plot of high pass
-<BR> <TT>       </TT><TT>        </TT>filtered apparent crosstrack seafloor slope.<BR>
-<BR> <B>mbm_xbt</B>:  Processes a Sparton XBT data file
-<BR> <TT>       </TT><TT>        </TT>and outputs a sound velocity profile<BR>
-<BR> <TT>       </TT><TT>        </TT>file which can be used to process<BR>
-<BR> <TT>       </TT><TT>        </TT>swath sonar data.<BR>
-<BR> <B>mbm_xyplot</B>:  Reads one or more ASCII "X-Y"
-<BR> <TT>       </TT><TT>        </TT>data files and writes a shellscript<BR>
-<BR> <TT>       </TT><TT>        </TT>which will generate an XY plot of the data.<BR>
-<P>
-<A NAME="lbAT"> </A>
-<H2>EXAMPLE PROCESSING APPROACH</H2>
-
-<P>
-An example processing stream for swath sonar data
-which uses the new, parallel processing
-scheme is provided here. Note that a '' character at
-the end of a line indicates
-that the command line should actually continue with the
-text on the next line. Refer to individual program manual
-pages for detailed information on the command arguments and
-functionality of the various programs.
-<P>
-<A NAME="lbAU"> </A>
-<H2>PROCESSING SEABEAM 2100 DATA</H2>
-
-<P>
-The following data processing stream is recommended for
-data obtained with SeaBeam 2100 series multibeam sonars.
-A number of SeaBeam 2112 sonars were installed on academic
-research vessels during the 1990's, including the R/V Knorr
-and R/V Atlantis operated by the Woods Hole Oceanographic
-Institution, the R/V Revelle operated by the Scripps Institution
-of Oceanography, the R/V Ronald Brown operated by NOAA,
-R/V Mirai and R/V Kairai operated by JAMSTEC and other vessels.
-This same approach is appropriate for data from all other
-multibeam sonars, with small variations. The issues and
-differences associated with data from certain other types
-of sonars are discussed in the following sections.
-<P>
-Consider a data file "sb199411211212.rec"
-containing one hour's worth of
-SeaBeam 2112 data in the vendor format (format 41).
-This file contains bathymetry, beam amplitude, and
-sidescan data. The following commands
-are typical for processing such data and generating
-preliminary maps.
-<P>
-<B>Step 1</B>: What's in the data file?
-<P>
-First we run <B>mbinfo</B> to obtain statistics about the contents
-of the data file:
-<P>
-<BR> <TT>       </TT>mbinfo -I sb199411211212.mb41<BR>
-<BR>
-
-Seeing reasonable output assures us that we in fact know what
-kind of data we are processing.
-<P>
-<B>Step 2</B>: Generate ancillary files.
-<P>
-Next, we run <B>mbdatalist</B> to generate the statistics (".inf"),
-quickly read bathymetry (".fbt"), and quickly read navigation
-(".fnv") files that make many tasks run faster:
-<P>
-<BR> <TT>       </TT>mbdatalist -I sb199411211212.mb41 \<BR>
-<BR> <TT>       </TT><TT>        </TT>-N -V<BR>
-<P>
-Running this program generates three output files, which we
-call ancillary files:
-<BR> <TT>       </TT>sb199411211212.mb41.inf<BR>
-<BR> <TT>       </TT>sb199411211212.mb41.fbt<BR>
-<BR> <TT>       </TT>sb199411211212.mb41.fnv<BR>
-<P>
-<B>Step 3</B>: Generate first cut plota.
-<P>
-We are now set up to process the data. However, first
-we visually check the data by generating a swath plot
-of color filled bathymetry overlaid with contours and
-navigation. This is easily accomplished with <B>mbm_plot</B>:
-<BR> <TT>       </TT>mbm_plot -I sb199411211212.mb41 \<BR>
-<BR> <TT>       </TT><TT>        </TT>-G1 -C -N -V \<BR>
-<BR> <TT>       </TT><TT>        </TT>-O ZSwathBathCont<BR>
-<TT>        </TT>ZSwathBathCont.cmd<BR>
-<BR>
-
-Here the ZSwathBathCont represents the plot name, and multiple
-files will be generated with names constructed by adding
-different suffixes to this name. The <B>mbm_plot</B> command
-generates a shellscript called ZSwathBathCont.cmd. Running
-this shellscript in turn generates a Postscript plot called
-ZSwathBathCont.ps, and then displays the plot to the screen
-using the Postscript viewer previously specified by the user with
-<B>mbdefaults</B>. The name ZSwathBathCont is descriptive but
-arbitrary. Users may specify any name they wish.
-<P>
-The types of swath plots produced by <B>mbm_plot</B> include:
-<BR>     - color fill bathymetry with contours
-<BR>     - shaded relief color fill bathymetry
-<BR>     - color fill bathymetry overlaid with amplitude
-<BR>     - grayscale amplitude
-<BR>     - grayscale sidescan
-<P>
-We have already generated the first type of plot. We now
-generate the other four as well:
-<BR> <TT>       </TT>mbm_plot -I sb199411211212.mb41 \<BR>
-<BR> <TT>       </TT><TT>        </TT>-G2 -N -V \<BR>
-<BR> <TT>       </TT><TT>        </TT>-O ZSwathBathShade<BR>
-<BR> <TT>       </TT>ZSwathBathShade.cmd<BR>
-<BR> <TT>       </TT>mbm_plot -I sb199411211212.mb41 \<BR>
-<BR> <TT>       </TT><TT>        </TT>-G3 -S0/1 -N -V \<BR>
-<BR> <TT>       </TT><TT>        </TT>-O ZSwathBathAmp<BR>
-<BR> <TT>       </TT>ZSwathBathAmp.cmd<BR>
-<BR> <TT>       </TT>mbm_plot -I sb199411211212.mb41 \<BR>
-<BR> <TT>       </TT><TT>        </TT>-G4 -S -N -V \<BR>
-<BR> <TT>       </TT><TT>        </TT>-O ZSwathAmp<BR>
-<BR> <TT>       </TT>ZSwathAmp.cmd<BR>
-<BR> <TT>       </TT>mbm_plot -I sb199411211212.mb41 \<BR>
-<BR> <TT>       </TT><TT>        </TT>-G5 -S -N -V \<BR>
-<BR> <TT>       </TT><TT>        </TT>-O ZSwathSS<BR>
-<BR> <TT>       </TT>ZSwathSS.cmd<BR>
-<BR>
-
-We use the -S option to apply histogram equalization to
-sidescan and amplitude data; note that for the bathymetry
-overlaid with amplitude map we use -S0/1 so that the
-the amplitude data used for shading is histogram
-equalized but the bathymetry is not.
-<P>
-<B>Step 3</B>: Apply Analysis Tools
-<P>
-We now have a reasonable idea of the data quality.
-There are several data analysis and editing tools that
-may be used to fix problems (or just to further investigate
-the data). These may be used in any order, at any time.
-<P>
-<B>Analysis Option A</B>: Automatic Bathymetry Editing.
-<P>
-The program <B>mbclean</B> applies some simple artifact
-detection algorithms to the bathymetry, effectively
-providing a means of automatically editing the bathymetry.
-We generally recommend that users edit the bathymetry
-interactively (see option B below) because
-no automated filter yet approaches
-(in our opinion) the ability of the human eye and brain
-to discern the difference between interesting seafloor
-morphology and sonar artifact. In particular, none of the
-filters available in <B>mbclean</B> come remotely close to
-performing satisfactorily in general. However, many users do
-find it useful to preprocess the data with <B>mbclean</B>
-before editing in the hope that many or most of the artifacts can flagged
-automatically. Again, we emphasize the importance of not
-depending solely on automatic filters. <B>If you care about
-your data, look at it.</B>
-<P>
-When we apply <B>mbclean</B>, we usually use a filter that flags all
-soundings that deviate more than a specified fraction of
-the local median depth from that median depth (the <B>-G</B>
-option). The choice of the filter or filters and the
-filter parameters used depends very much on the nature of the
-bathymetry data being processed:
-<BR> <TT>       </TT>mbclean -I sb199411211212.mb41 -G0.9/1.1 -V<BR>
-<BR>
-
-If an "edit save file" named sb199411211212.mb41.esf already
-exists, <B>mbclean</B> reads this file and applies the
-pre-existing edits prior to beginning its filtering.
-All pre-existing edit events and all newly generated flags
-by <B>mbclean</B> are output to a new
-"edit save file", again called sb199411211212.mb41.esf.
-Since this is the first
-of the analyis programs to be run on this data file, <B>mbclean</B>
-also creates an <B>mbprocess</B> parameter file called
-sb199411211212.mb41.par which contains all of the parameters
-and settings to be used by <B>mbprocess</B> in generating a
-processed swath file. If the parameter file already existed,
-<B>mbclean</B> would modify it so that the bathymetry edits
-would be applied when <B>mbprocess</B> is run.
-<P>
-<B>Analysis Option B</B>: Interactive Bathymetry Editing.
-<P>
-We use the interactive graphical tool <B>mbedit</B> to check
-the quality of the bathymetry
-and to flag artifacts as necessary. We can start <B>mbedit</B> with
-the simple command:
-<BR> <TT>       </TT>mbedit<BR>
-<BR>
-
-and then open a swath file using the pull down menus and dialogs.
-Alternatively, we can specify the swath file on the command
-line:
-<BR> <TT>       </TT>mbedit -I sb199411211212.mb41<BR>
-<BR>
-
-While we are editing the bathymetry, all edit
-events, both flag and unflag, are
-written to an "edit save file" called sb199411211212.mb41.esf. This
-file is closed when the <Done> or <Quit> button is clicked.
-In turn, this file of edit events will be read and these events
-applied if we run <B>mbclean</B>, or <B>mbprocess</B>, or if
-we choose to run <B>mbedit</B> again. If this is the first
-of the analyis programs to be run on this data file, <B>mbedit</B>
-also creates an <B>mbprocess</B> parameter file called
-sb199411211212.mb41.par which contains all of the parameters
-and settings to be used by <B>mbprocess</B> in generating a
-processed swath file. If the parameter file already existed,
-<B>mbedit</B> would modify it so that the bathymetry edits
-would be applied when <B>mbprocess</B> is run.
-<P>
-<B>Analysis Option C</B>: Editing the navigation.
-<P>
-We use the interactive graphical tool <B>mbnavedit</B> to check
-the quality of the navigation
-and to fix problems as necessary. We can start <B>mbnavedit</B> with
-the simple command:
-<BR> <TT>       </TT>mbnavedit<BR>
-<BR>
-
-and then open a swath file using the pull down menus and dialogs.
-Alternatively, we can specify the swath file on the command
-line:
-<BR> <TT>       </TT>mbnavedit -I sb199411211212.mb41<BR>
-<BR>
-
-When we have completed editing the navigation, we click the
-<Done> or <Quit> button. The program then writes the final
-navigation to an "edited navigation" file called sb199411211212.mb41.nve.
-The program <B>mbnavedit</B>
-also modifies (or creates if needed) an <B>mbprocess</B> parameter file
-and sets it so that the edited navigation is read and merged with the
-swath data when <B>mbprocess</B> is run.
-<P>
-<B>Analysis Option D</B>: Modeling sound velocity profiles.
-<P>
-We use the interactive graphical tool <B>mbvelocitytool</B> to model
-the effect of altering the sound velocity profile (SVP) used to
-calculate bathymetry from the raw travel times and angles stored
-in the swath data. We can start <B>mbvelocitytool</B> with
-the simple command:
-<BR> <TT>       </TT>mbvelocitytool<BR>
-<BR>
-
-and then open a swath file using the pull down menus and dialogs.
-Alternatively, we can specify the swath file on the command
-line:
-<BR> <TT>       </TT>mbvelocitytool -I sb199411211212.mb41<BR>
-<BR>
-
-If the <B>Levitus</B> database has been installed, <B>mbvelocitytool</B>
-will attempt to run <B>mblevitus</B> to extract a reference sound velocity
-profile for the approximate location of the swath data file. This SVP
-will be displayed along with the editable SVP used for modeling. See
-the <B>mbvelocitytool</B> manual page for details on its operation.
-If we conclude that the bathymetry data include artifacts associated with
-having been calculated using an incorrect SVP, and we arrive through
-modeling at an SVP which is more likely correct, we save this SVP
-using the <File->Save swath svp file> menu button. Then <B>mbvelocitytool</B>
-saves the edited SVP in a file named sb199411211212.mb41.svp, and
-also sets (or creates if needed)  the parameter file sb199411211212.mb41.par
-so that <B>mbprocess</B> will recalculate
-the bathymetry by raytracing through this SVP.
-<P>
-<B>Analysis Option E</B>: Correcting sidescan data.
-<P>
-We often find that sidescan imagery, despite the best efforts
-of sonar manufacturers, is dominated by a systematic variation
-in amplitude across the swath. Most commonly, the center or nadir
-region of the swath is characterized by high amplitudes, and the
-outer swath exhibits much lower amplitudes. This effect can be
-corrected by <B>mbprocess</B> provided that an appropriate model
-for the variation in amplitude with grazing angle is available.
-Since the amplitude vs grazing angle function varies with the
-type of seafloor, we need to construct separate amplitude vs grazing angle
-correction tables at regular intervals through each swath data file.
-We use the program <B>mbbackangle</B> to construct the amplitude vs.
-grazing angle tables:
-<BR> <TT>       </TT>mbbackangle -I sb199411211212.mb41 \<BR>
-<BR> <TT>       </TT><TT>        </TT>-P25 -N161/80 -V<BR>
-<BR>
-
-Here a new table is constructed every 25 pings, and the tables
-will consist of 161 angle bins ranging from -80 degrees to +80 degress
-grazing angles. The tables are written by <B>mbbackangle</B> to an
-amplitude vs. grazing angle file called sb199411211212.mb41.sga.
-Of course, the program also sets (or creates if needed)
-the parameter file sb199411211212.mb41.par
-so that <B>mbprocess</B> will correct the sidescan.
-<P>
-<B>Step 4</B>: Process the data.
-<P>
-The program that actually takes the input, raw swath data
-and produces processed swath data is <B>mbprocess</B>. This
-program operates using the parameters listed in the
-parameter file sb199411211212.mb41.par. To process the
-data, we run
-<BR> <TT>       </TT>mbprocess -I sb199411211212.mb41<BR>
-<BR>
-
-The program produces an output processed swath file called
-sb199411211212p.mb41 (a 'p' character is inserted in the
-filename just before the <B>MB-System</B> suffix. The program
-<B>mbprocess</B> also automatically generates the three basic
-ancillary data
-files for the processed swath file:
-<BR> <TT>       </TT>sb199411211212.mb41.inf<BR>
-<BR> <TT>       </TT>sb199411211212.mb41.fbt<BR>
-<BR> <TT>       </TT>sb199411211212.mb41.fnv<BR>
-<P>
-<B>Step 5</B>: Grid the bathymetry.
-<P>
-Now use <B>mbgrid</B> to grid the bathymetry. The greatest
-depth in the file is 4502 meters (from the mbinfo output).
-The 120 degree swath is 3.4 times the water depth wide, or
-15.3 km wide. This translates to an average acrosstrack
-spacing of 15300 m / 120 = 127.5 m. If a region of a grid
-has more than one data point in each grid cell or bin, we
-say that this region is "oversampled". If some bins in a
-region have no data points, we say that this region is
-"undersampled". We choose a grid cell spacing of 150 m,
-which will cause the grid to be oversampled towards
-the center of the swath, but undersampled towards the
-edges of the swath.
-<P>
-The program <B>mbgrid</B> takes a datalist as input, so we first
-construct that file:
-<BR> <TT>       </TT>echo sb199411211212p.mb41 41 > datalist_grid<BR>
-<P>
-Now run <B>mbgrid</B> using the gaussian weighted mean algorithm
-(-F1) and longitude and latitude grid cell spacings of
-150 m (-E150/150/m) to grid bathymetry (-A1). We use
-spline interpolation to fill in small gaps in the data
-no larger than two grid cells (-C2), and we set regions
-with no data to Nan values for compatibility with
-GMT programs (-N). We also specify -M so that grids of
-data density and data standard deviation will be
-generated:
-<BR> <TT>       </TT>mbgrid -Idatalist_grid -E150/150/m \<BR>
-<BR> <TT>       </TT><TT>        </TT>-R114.2208/114.4209/-31.9001/-31.6377 \<BR>
-<BR> <TT>       </TT><TT>        </TT>-OZGridBath -A1 -N -C2 -M -V<BR>
-<P>
-The program <B>mbgrid</B> creates a shellscript which, when
-executed, will generate a color fill plot overlaid with
-contours of the gridded bathymetry. Now run that shellscript:
-<BR> <TT>       </TT>ZGridBath.cmd<BR>
-<P>
-Shellscripts have also been created to generate plots of
-the data density and standard deviation grids:
-<BR> <TT>       </TT>ZGridBath_bath_num.cmd<BR>
-<BR> <TT>       </TT>ZGridBath_bath_sd.cmd<BR>
-<P>
-<B>Step 6</B>: Mosaic the corrected sidescan data.
-<P>
-The program <B>mbmosaic</B> operates in a fashion similar to
-<B>mbgrid</B>, but has special capabilities allowing users
-to prioritize which parts of the swath are used in the
-mosaic that are useful for sidescan data. In particular,
-it is possible to create mosaics which do not use the
-nadir region of the swath except where no other data is
-available, or to create mosaics of sidescan data with
-particular look azimuths. The sidescan data has a higher
-resolution than the bathymetry so a smaller grid size
-can be appropriate. However, we wish to overlay the
-sidescan on the bathymetry, so we use the same grid
-cell spacing of 150 m.
-<P>
-In order to give the nadir region a lower priority than
-the outer parts of the sidescan swath, create a file
-of data priorities (priorities range from 0 to 1) as
-a function of apparent grazing angle (negative angles
-are on the port side of the swath, zero is at nadir,
-and positive angles are on the starboard side of the
-swath):
-<BR> <TT>       </TT>-60.0 0.2<BR>
-<BR> <TT>       </TT>-45.0 1.0<BR>
-<BR> <TT>       </TT>-15.0 0.8<BR>
-<BR> <TT>       </TT>-14.9 0.1<BR>
-<BR> <TT>       </TT>14.9 0.1<BR>
-<BR> <TT>       </TT>15.0 0.8<BR>
-<BR> <TT>       </TT>45.0 1.0<BR>
-<BR> <TT>       </TT>60.0 0.2<BR>
-<P>
-Here the nadir region has been set to a low priority and
-the highest priority has been given to data from an
-apparent grazing angle of 45 degrees.
-<P>
-Now run <B>mbmosaic</B> to mosaic the bathymetry corrected sidescan
-data (-A4):
-<BR> <TT>       </TT>mbmosaic -Idatalist_grid -E150/150/m \<BR>
-<BR> <TT>       </TT><TT>        </TT>-R114.2208/114.4209/-31.9001/-31.6377 \<BR>
-<BR> <TT>       </TT><TT>        </TT>-Wangle_priority.dat -F0.10 \<BR>
-<BR> <TT>       </TT><TT>        </TT>-OZMosaicSS -A4 -N -C2 -M -V<BR>
-<P>
-Now run the plot shellscripts to view the gridded sidescan
-data in grayscale and the ancillary data density and
-standard deviation plots:
-<BR> <TT>       </TT>ZMosaicSS.cmd<BR>
-<BR> <TT>       </TT>ZMosaicSS_num.cmd<BR>
-<BR> <TT>       </TT>ZMosaicSS_sd.cmd<BR>
-<P>
-<B>Step 7</B>: Generate additional maps of the gridded data.
-<P>
-First, we use <B>mbm_grdplot</B> to generate a color shaded
-relief view of the bathymetry. We choose to illuminate
-the bathymetry from the northeast (azimuth of 45 degrees)
-and to use a shading magnitude of 0.4 (-A0.4/45).
-Because the data has been gridded as bathymetry (positive
-down) rather than as topography (positive up), the default
-plot will have "hot" colors for deep regions and "cold"
-colors for shallow regions; this is the opposite of the
-convention we usually use. In order to fix the colors, we have
-to either rescale the data by multiplying the bathymetry
-by -1 (accomplished with -MGS-1), or flip the color
-palette (accomplished with -D). We use the latter approach.
-Finally, because this grid is so small, the default shaded
-relief image is likely to be grainy. To fix this problem, we
-specify a dots per inch resolution of 72 (-MGQ72); this
-will take longer and generate a larger plotfile, but the
-plot will look better. We also use the -L option to specify
-the title and color scale label for the plot. Here is the
-command:
-<BR> <TT>       </TT>mbm_grdplot -IZGridBath.grd \<BR>
-<BR> <TT>       </TT><TT>        </TT>-G2 -A0.4/45 -D -MGQ72 -V \<BR>
-<BR> <TT>       </TT><TT>        </TT>-L"Shaded Relief Bathymetry":"Depth (meters)" \<BR>
-<BR> <TT>       </TT><TT>        </TT>-Osb199411211212_bathshade<BR>
-<BR> <TT>       </TT>ZGridBathShade.cmd<BR>
-<P>
-Second, we use <B>mbm_grdplot</B> to generate a color fill
-view of the bathymetry overlaid with the gridded sidescan.
-The sidescan overlay is specified using the -K option.
-We want the colors for the bathymetry to be chosen without
-histogram equalization, but we also want histogram
-equalization to be applied to the sidescan data used for
-shading. To do this, we use -S0/1, where the first number
-(0) specifies no histogram equalization of the color
-scale and the second number (1) causes histogram
-equalization of the shading sidescan data to be
-implemented. In order to maintain the convention that
-high sidescan amplitudes are black, we flip both the
-color palette (as in the previous example) and the
-shading scale with -D1/1. We could also flip the shading
-by specifying a negative shading magnitude (-A-0.4).
-In this case, we forgo specifying the image resolution,
-resulting in a grainy plot:
-<BR> <TT>       </TT>mbm_grdplot -IZGridBath.grd \<BR>
-<BR> <TT>       </TT><TT>        </TT>-G3 -KZMosaicSS.grd \<BR>
-<BR> <TT>       </TT><TT>        </TT>-S0/1 -D1/1 -A0.4 -V \<BR>
-<BR> <TT>       </TT><TT>        </TT>-L"Bathymetry Overlaid With Sidescan":"Depth (meters)" \<BR>
-<BR> <TT>       </TT><TT>        </TT>-OZGridBathSS<BR>
-<BR> <TT>       </TT>ZGridBathSS.cmd<BR>
-<P>
-<B>Step 8</B>: Generate 3D perspective views of the gridded data.
-<P>
-Now, generate a 3D perspective view of the gridded
-bathymetry with shading through synthetic illumination (-G2)
-using the macro <B>mbm_grd3dplot</B>. The grid file is in
-bathymetry (positive down) rather in topography (positive
-up), so the bathymetry needs to be rescaled by multiplying
-by -1 (-MGS-1). We choose an illumination magnitude of 0.4
-and an illumination azimuth of 45 degrees (-A0.4/45). We
-also choose a perspective azimuth of 250 degrees and an
-elevation of 30 degrees (-E240/30):
-<BR> <TT>       </TT>mbm_grd3dplot -IZGridBath.grd \<BR>
-<BR> <TT>       </TT><TT>        </TT>-G2 -A0.4/45 -E250/30 -MGS-1 -V \<BR>
-<BR> <TT>       </TT><TT>        </TT>-OZGridBath3D<BR>
-<BR> <TT>       </TT>ZGridBath3D.cmd<BR>
-<P>
-Now, generate a 3D perspective view of the gridded
-bathymetry shaded using the gridded sidescan data
-(-KZMosaicSS.grd). We want the sidescan data to
-be histogram equalized, so we use -S0/1. We also want
-the shading to be more prominent than the default
-shading magnitude of 0.2 would produce, so we use -A0.5:
-<BR> <TT>       </TT>mbm_grd3dplot -IZGridBath.grd \<BR>
-<BR> <TT>       </TT><TT>        </TT>-KZMosaicSS.grd \<BR>
-<BR> <TT>       </TT><TT>        </TT>-G3 -A0.5 -E250/30 -D0/1 -S0/1 -MGS-1 -V \<BR>
-<BR> <TT>       </TT><TT>        </TT>-Osb199411211212_bathss3d<BR>
-<BR> <TT>       </TT>ZGridBathSS3D.cmd<BR>
-<P>
-<A NAME="lbAV"> </A>
-<H2>PROCESSING THIRD GENERATION KONGSBERG MULTIBEAM DATA</H2>
-
-<P>
-The current generation of Kongsberg multibeam sonars (EM122, EM302, EM710)
-record data in files typically named with a *.all suffix. These binary
-files consist of many different data records, most of which are
-similarly structure but distinct from the records output by the
-earlier generations of Kongsberg (formerly Simrad) multibeams described
-in a later section. The raw Kongsberg format is supported in <B>MB-System</B>
-as format 58. However, format 58 lacks places to store some information
-that is important to processing. In particular, the raw Kongsberg format
-does not store beam flags, so the only to apply bathymetry edits is
-to null the flagged beams. This is not recommended, as it precludes
-unflagging flagged beams later determined to be good.
-<P>
-Also, the raw Kongsberg format stores the initial sidescan samples derived from subsampling
-the bottom returns in each of the formed beams. The locations of these
-samples on the seafloor are irregular, and the number of samples varies
-greatly from ping to ping. This raw sidescan is not well suited for
-mapmaking or processing because of the irregular locations. <B>MB-System</B>
-automatically bins and averages the available sidescan samples into
-a regularly spaced 1024 pixels with pixel sizes that vary only slightly
-from ping to ping. This resampled sidescan is what appears in swath plots
-and in the statistics reported by <B>mbinfo</B>. The raw format has no
-space to store the rebinned sidescan, so any corrections or other
-processing applied to the sidescan in formats 58 is lost.
-<P>
-We have defined a processing format (59) for Kongsberg multibeam that stores
-beam flags and rebinned sidescan in addition to all of the information
-in the raw file format 58. We strongly recommend that third generation
-Kongsberg multibeam data be translated into format 59 before processing. This can
-be accomplished, albeit unsatisfactorily, with mbcopy. For example, given a raw EM122 file called
-0006_20111219_201329_METEOR_EM122.all, we can translate it to format 59 using:
-<BR> <TT>       </TT>mbcopy -F58/59 -I 0006_20111219_201329_METEOR_EM122.all \<BR>
-<BR> <TT>       </TT><TT>        </TT>-O 0006_20111219_201329_METEOR_EM122.mb59<BR>
-<BR>
-
-If we have a number of EM122 files referenced through a datalist file called
-datalist_raw.mb-1, we can translate all of them using the macro <B>mbm_copy</B>:
-<BR> <TT>       </TT>mbm_copy -F59 -I datalist_raw.mb-1<BR>
-<BR>
-
-This macro simply executes <B>mbcopy</B> for each of the data referenced in
-the input datalist structure.
-<P>
-The problem with using <B>mbcopy</B> for translation
-between formats 58 and 59 is that the navigation, heading, and attitude
-contained in format 58 files are purely asynchronous, which means these values
-are defined according to their own time stamps and not the time stamps
-of the multibeam sonar pings. When format 58 data are read, the navigation,
-heading and attitude values must be read from their own data records and
-interpolated (or extrapolated) onto the time stamps of the multibeam pings
-for each survey record. This works fine if the relevant asynchronous navigation
-and attitude data are always found in the data files before the survey data
-from the same time, but that advantageious timing is neither assured nor common.
-A better approach is to use the tool <B>mbkongsbergpreprocess</B> to preprocess
-the Kongsberg multibeam data. This program makes two passes through reading
-each input file, the first to read and store the navigation and attitude data,
-and the second to properly interpolate the navigation and attitude values onto the
-multibeam survey pings. The usage is of the form:
-<BR> <TT>       </TT>mbkongsbergpreprocess -I datalist_raw.mb-1 -V<BR>
-<P>
-One further feature of Simrad multibeam data processing should be noted.
-Given that the raw sidescan samples are derived directly from the
-bottom returns identified by the sonar for each beam, it follows that
-whenever a bottom return pick is erroneous, the sidescan samples
-associated with that beam are also erroneous. Consequently, the binned
-sidescan shoulde be reprocessed following the application of beam flags
-to exclude the incorrect sidescan samples from the final imagery.
-Recalculating the Simrad sidescan is an <B>mbprocess</B> option which
-can set using <B>mbset</B>. To turn on sidescan calculation, we use:
-<BR> <TT>       </TT>mbset -I 0006_20111219_201329_METEOR_EM122.mb59 \<BR>
-<BR> <TT>       </TT><TT>        </TT>=PSSRECALCMOD:1 -V<BR>
-<BR>
-
-We can also turn off sidescan recalculation using:
-<BR> <TT>       </TT>mbset -I 0006_20111219_201329_METEOR_EM122.mb59 \<BR>
-<BR> <TT>       </TT><TT>        </TT>=PSSRECALCMOD:0 -V<BR>
-<P>
-In practice, <B>mbedit</B>, <B>mbeditviz</B> and <B>mbclean</B> automatically set the
-parameter file to turn on sidescan recalculation when writing an
-"edit save file" for format 59 data, so users should not have
-to set this parameter manually.
-<P>
-<A NAME="lbAW"> </A>
-<H2>PROCESSING OLDER KONGSBERG (FORMERLY SIMRAD) MULTIBEAM DATA</H2>
-
-<P>
-The older series of Simrad multibeam sonars (EM100, EM950, EM1000, EM12,
-EM12D, EM121A) recorded raw data
-in files typically named with an "_raw.all" suffix. These older data
-are supported in <B>MB-System</B> using format 51. The data
-from the second generation Simrad (Kongsberg) multibeams (EM3000, EM2000, EM1002, EM300,
-EM120) also come in files with the "_raw.all" suffix, but the
-format is different, and is supported by <B>MB-System</B> as format
-56. <B>MB-System</B> programs can automatically discern the difference
-between the two formats, and so the initial identification of the
-data type is easy with <B>mbinfo</B>.
-<P>
-However, both formats 51 and 56 lack places to store some information
-that is important to processing. In particular, the raw Simrad formats
-do not store beam flags, so the only to apply bathymetry edits is
-to null the flagged beams. This is not recommended, as it precludes
-unflagging flagged beams later determined to be good.
-<P>
-Also, the raw
-Simrad formats store the initial sidescan samples derived from subsampling
-the bottom returns in each of the formed beams. The locations of these
-samples on the seafloor are irregular, and the number of samples varies
-greatly from ping to ping. This raw sidescan is not well suited for
-mapmaking or processing because of the irregular locations. <B>MB-System</B>
-automatically bins and averages the available sidescan samples into
-a regularly spaced 1024 pixels with pixel sizes that vary only slightly
-from ping to ping. This resampled sidescan is what appears in swath plots
-and in the statistics reported by <B>mbinfo</B>. The raw formats have no
-space to store the rebinned sidescan, so any corrections or other
-processing applied to the sidescan in formats 51 and 56 is lost.
-<P>
-We have defined a processing format (57) for Simrad multibeam that stores
-beam flags and rebinned sidescan in addition to all of the information
-in either of the raw file formats (51 and 56).
-We strongly recommend that Simrad multibeam data from both old and
-newer sonars be translated into format 57 before processing. This is
-accomplished with mbcopy. For example, given a raw EM1000 file called
-0021_19960714_123418_raw.all, we translate it to format 57 using:
-<BR> <TT>       </TT>mbcopy -F51/57 -I 0021_19960714_123418_raw.all \<BR>
-<BR> <TT>       </TT><TT>        </TT>-O 0021_19960714_123418_raw.mb57<BR>
-<BR>
-
-Similarly, given a raw EM300 file called
-0005_20020425_034057_raw.all, we translate it to format 57 using:
-<BR> <TT>       </TT>mbcopy -F56/57 -I 0005_20020425_034057_raw.all \<BR>
-<BR> <TT>       </TT><TT>        </TT>-O 0005_20020425_034057.mb57<BR>
-<P>
-One further feature of Simrad multibeam data processing should be noted.
-Given that the raw sidescan samples are derived directly from the
-bottom returns identified by the sonar for each beam, it follows that
-whenever a bottom return pick is erroneous, the sidescan samples
-associated with that beam are also erroneous. Consequently, the binned
-sidescan shoulde be reprocessed following the application of beam flags
-to exclude the incorrect sidescan samples from the final imagery.
-Recalculating the Simrad sidescan is an <B>mbprocess</B> option which
-can set using <B>mbset</B>. To turn on sidescan calculation, we use:
-<BR> <TT>       </TT>mbset -I 0005_20020425_034057.mb57 \<BR>
-<BR> <TT>       </TT><TT>        </TT>=PSSRECALCMOD:1 -V<BR>
-<BR>
-
-We can also turn off sidescan recalculation using:
-<BR> <TT>       </TT>mbset -I 0005_20020425_034057.mb57 \<BR>
-<BR> <TT>       </TT><TT>        </TT>=PSSRECALCMOD:0 -V<BR>
-<P>
-In practice, <B>mbedit</B> and <B>mbclean</B> automatically set the
-parameter file to turn on sidescan recalculation when writing an
-"edit save file" for format 57 data, so users should not have
-to set this parameter manually.
-<P>
-<A NAME="lbAX"> </A>
-<H2>PROCESSING HYDROSWEEP DS DATA</H2>
-
-<P>
-Hydrosweep DS sonars were used on the R/V Maurice
-Ewing (operated by the Lamont-Doherty Earth Observatory
-and the R/V Thomas Thompson (operated by the University of
-Washington) from the early 1990's until 2001. The raw data
-was logged in a text format (21) that is slow to read and write.
-We recommend that users confronted with format 21 data translate
-it to format 24 before processing. Format 24 is a binary data
-format that contains all of the information in the raw file,
-but is on the order of 15 times faster to read and write.
-We accomplish the translation using <B>mbcopy</B>:
-<BR>  <TT>      </TT>mbcopy -F21/24 -Ihs_ew9204_134.mb21 \<BR>
-<BR> <TT>       </TT><TT>        </TT>-Ohsih_ew9204_134.mb24<BR>
-<BR>
-
-We also strongly recommend that users of Hydrosweep DS data
-recalculate the bathymetry using raytracing through an
-appropriate SVP, whether obtained using <B>mblevitus</B>,
-<B>mbvelocitytool</B>, or from other sources. The sonar
-calculates the raw bathymetry using a homogeneous water
-velocity model, and the results are almost always inferior
-to those obtained by doing the full raytracing calculations
-with a correct SVP.
-<P>
-Hydrosweep DS data do not contain sidescan, but they do
-contain per beam amplitude data. The amplitude data may
-be corrected in the same fashion as the sidescan. We
-run <B>mbbackangle</B> with the <B>-A</B><I>1</I> option
-to operate on the amplitude data:
-<BR> <TT>       </TT>mbbackangle -I sb199411211212.mb41 \<BR>
-<BR> <TT>       </TT><TT>        </TT>-A1 -P25 -N161/80 -V<BR>
-<BR>
-
-and then run <B>mbprocess</B> as usual.
-<P>
-<A NAME="lbAY"> </A>
-<H2>PROCESSING HYDROSWEEP MD DATA</H2>
-
-<P>
-Processing Hydrosweep MD data is similar to processing
-Hydrosweep DS data. In particular, recalculating
-bathymetry from the travel times is necessary because
-the sonar uses a homogeneous water velocity model.
-The difference is simply in the data formats used.
-The raw Hydrosweep MD data files (typically named
-with a ".R" suffix) contain only the travel times; the
-sonar calculated bathymetry is contained in parallel
-files (typically named with a ".P" suffix). The
-".R" files are supported as format 101. Format 102
-data files contain bathymetry in addition to the travel
-times. To translate the data from format 101 to 102 we
-use:
-<BR>  <TT>      </TT>mbcopy -F101/102 -Iys9409040607.R \<BR>
-<BR> <TT>       </TT><TT>        </TT>-Oys9409040607.mb102<BR>
-<BR>
-
-Bathymetry equivalent to that generated by the sonar
-will automatically be calculated in the copy process
-(the data stream includes the mean water velocity used
-by the sonar).
-<P>
-Hydrosweep MD data do not contain sidescan, but they do
-contain per beam amplitude data. The amplitude data may
-be corrected in the same fashion as the sidescan. We
-run <B>mbbackangle</B> with the <B>-A</B><I>1</I> option
-to operate on the amplitude data:
-<BR> <TT>       </TT>mbbackangle -I sb199411211212.mb41 \<BR>
-<BR> <TT>       </TT><TT>        </TT>-A1 -P25 -N161/80 -V<BR>
-<BR>
-
-and then run <B>mbprocess</B> as usual.
-<P>
-<A NAME="lbAZ"> </A>
-<H2>SEE ALSO</H2>
-
-<B><A HREF="mbio.html">mbio</A></B>(1)
-<P>
-<A NAME="lbBA"> </A>
-<H2>BUGS</H2>
-
-It doesn't do everything we want it to yet, it doesn't work with
-every kind of swath data ever collected, and sometimes it
-breaks.
-<P>
-
-<HR>
-<A NAME="index"> </A><H2>Index</H2>
-<DL>
-<DT><A HREF="#lbAB">NAME</A><DD>
-<DT><A HREF="#lbAC">VERSION</A><DD>
-<DT><A HREF="#lbAD">AUTHORSHIP</A><DD>
-<DT><A HREF="#lbAE">INTRODUCTION</A><DD>
-<DT><A HREF="#lbAF">COPYRIGHT AND LICENSING</A><DD>
-<DT><A HREF="#lbAG">HISTORY</A><DD>
-<DT><A HREF="#lbAH">WHAT'S NEW ABOUT VERSION 5</A><DD>
-<DL>
-<DT><A HREF="#lbAI">A new approach to managing data processing.</A><DD>
-<DT><A HREF="#lbAJ">New tools.</A><DD>
-<DT><A HREF="#lbAK">Support for Projected Coordinate Systems.</A><DD>
-<DT><A HREF="#lbAL">Restructuring the code.</A><DD>
-<DT><A HREF="#lbAM">Handling of old Simrad multibeam data.</A><DD>
-<DT><A HREF="#lbAN">Streamlining of MB-System Default Parameters.</A><DD>
-<DT><A HREF="#lbAO">New Data Formats.</A><DD>
-</DL>
-<DT><A HREF="#lbAP">THE NEW VERSION 5 DATA PROCESSING STRUCTURE</A><DD>
-<DT><A HREF="#lbAQ">THE NEW VERSION 5 DATALIST FILES</A><DD>
-<DT><A HREF="#lbAR">VERSION 5 FILE NAMING CONVENTIONS</A><DD>
-<DT><A HREF="#lbAS">LIST OF MB-SYSTEM PROGRAMS AND MACROS</A><DD>
-<DT><A HREF="#lbAT">EXAMPLE PROCESSING APPROACH</A><DD>
-<DT><A HREF="#lbAU">PROCESSING SEABEAM 2100 DATA</A><DD>
-<DT><A HREF="#lbAV">PROCESSING THIRD GENERATION KONGSBERG MULTIBEAM DATA</A><DD>
-<DT><A HREF="#lbAW">PROCESSING OLDER KONGSBERG (FORMERLY SIMRAD) MULTIBEAM DATA</A><DD>
-<DT><A HREF="#lbAX">PROCESSING HYDROSWEEP DS DATA</A><DD>
-<DT><A HREF="#lbAY">PROCESSING HYDROSWEEP MD DATA</A><DD>
-<DT><A HREF="#lbAZ">SEE ALSO</A><DD>
-<DT><A HREF="#lbBA">BUGS</A><DD>
-</DL>
-<HR>
-</PRE>
-
-<CENTER><P><BR>
-Last Updated: 26 January 2015</P></CENTER>
-
-<HR>
-<P><A HREF="mbsystem_man_list.html">Return to list of MB-System manual pages...</A></P>
-<P><A HREF="mbsystem_home.html"><IMG SRC="mbsystem_logo_small.gif" BORDER=0 HEIGHT=55 WIDTH=158 ALIGN=BOTTOM></A><A HREF="mbsystem_home.html">Back
-to MB-System Home Page...</A></P>
-
-</BODY>
-</HTML>
diff --git a/html/mbsystem_capabilities.html b/html/mbsystem_capabilities.html
deleted file mode 100644
index fb41b5e..0000000
--- a/html/mbsystem_capabilities.html
+++ /dev/null
@@ -1,254 +0,0 @@
-<!DOCTYPE html PUBLIC "-//w3c//dtd html 4.0 transitional//en">
-<html>
-<head>
-  <title>MB-System Capabilities</title>
-  <meta content="text/html" http-equiv="Content-Type">
-  <meta content="MB-System: Mapping the Seafloor" name="Title">
-  <meta content="David Caress, Dale Chayes" name="Author">
-  <meta
- content="open source software for processing bathymetry and backscatter data from multibeam and sidescan sonar"
- name="Description">
-  <meta
- content="seafloor,mapping,multibeam,sonar,bathymetry,sidescan,swath processing,open,source,software"
- name="Keywords">
-</head>
-<body alink="#cc9900" bgcolor="#ffffff" link="#336699" text="#000000"
- vlink="#997040">
-<center>
-<h4><u>Short List of MB-System Capabilities:</u></h4>
-</center>
-<ul>
-  <li>General Documentation</li>
-  <ul>
-    <li>MB-System manual page: <a href="mbsystem.html">mbsystem</a></li>
-    <li>MB-System I/O library manual page: <a href="mbio.html">mbio</a></li>
-  </ul>
-</ul>
-<ul>
-  <li>Version 5 Programs and Macros:</li>
-These are the programs and macros that are used in the version 5
-parallel processing
-scheme. Those programs that are also relevant to the older serial
-processing
-scheme are marked with an *.
-  <ul>
-    <li>General Functions</li>
-    <ul>
-      <li>List swath data formats supported by MB-System: <a
- href="mbformat.html">mbformat</a>*</li>
-      <li>Get swath data file information and statistics: <a
- href="mbinfo.html">mbinfo</a>*</li>
-      <li>Produce arbitrary ascii tables from swath data: <a
- href="mblist.html">mblist</a>*</li>
-      <li>Copy swath data with optional time/space windowing and format
-change: <a href="mbcopy.html">mbcopy</a>*</li>
-      <li>Translate groups of swath data files between formats: <a
- href="mbm_copy.html">mbm_copy</a></li>
-      <li>Translate groups of swath data files between formats using parallel processes: <a
- href="mbm_multicopy.html">mbm_multicopy</a></li>
-      <li>Set MB-System default parameters: <a href="mbdefaults.html">mbdefaults</a>*</li>
-      <li>List files referenced in a recursive datalist file tree: <a
- href="mbdatalist.html">mbdatalist</a></li>
-      <li>Generate ancilliary files used in data managment: <a
- href="mbdatalist.html">mbdatalist</a></li>
-      <li>Generate ancilliary files used in data managment using parallel processes: <a
- href="mbm_multidatalist.html">mbm_multidatalist</a></li>
-      <li>Generate an MB-System datalist file referencing all
-identifiable swath files in the specified target directory.: <a
- href="mbm_makedatalist.html">mbm_makedatalist</a></li>
-      <li>Create or modify parameter files used to control mbprocess: <a
- href="mbset.html">mbset</a></li>
-      <li>Apply specified processing tasks to a swath data file: <a
- href="mbprocess.html">mbprocess</a></li>
-      <li>Apply specified processing tasks to a swath data file using parallel processes: <a
- href="mbm_multiprocess.html">mbm_multiprocess</a></li>
-      <li>Convert between calendar time and unix time: <a href="mbtime.html">mbtime</a></li>
-    </ul>
-    <li>Water Properties Utilities</li>
-    <ul>
-      <li>Obtain reference water sound velocity profile (SVP): <a
- href="mblevitus.html">mblevitus</a>*</li>
-      <li>Calculate water sound absorption from water properties: <a href="mbabsorption.html">mbabsorption</a></li>
-      <li>List CTD data in swath sonar data files: <a href="mbctdlist.html">mbctdlist</a></li>
-      <li>Process data from a Seabird SBE53 pressure sensor into a tidal model for
-       use by mbprocess: <a href="mbm_bpr.html">mbm_bpr</a></li>
-      <li>Generate a sound velocity profile model from sound speed and depth values in swath files: <a href="mbm_makesvp.html">mbm_makesvp</a></li>
-      <li>Extract water sound velocity profiles
-(SVPs) from swath data files: <a href="mbsvplist.html">mbsvplist</a></li>
-  	  <li>Select the best
-available sound speed model for each swath file in a survey according to 
-user specified criteria: <a href="mbsvpselect.html">mbsvpselect</a></li>
-    </ul>
-    <li>Navigation Data Processing</li>
-    <ul>
-      <li>Interactive navigation editor: <a href="mbnavedit.html">mbnavedit</a></li>
-      <li>List navigation from ping records in a swath data file: <a
- href="mblist.html">mblist</a></li>
-      <li>List navigation from navigation records in a swath data file:
-        <a href="mbnavlist.html">mbnavlist</a></li>
-      <li>Create or modify parameter files used to control mbprocess: <a
- href="mbset.html">mbset</a></li>
-      <li>Merge navigation with swath data file (among other tasks): <a
- href="mbprocess.html">mbprocess</a></li>
-      <li>Adjust navigation to match bathymetric features in
-overlapping swathes: <a href="mbnavadjust.html">mbnavadjust</a></li>
-      <li>Merge two MBnavadjust projects: <a href="mbnavadjustmerge.html">mbnavadjustmerge</a></li>
-      <li> Merge inertial
-and surface tracking navigation for
-submerged sonar platforms (e.g. ROVs and AUVs): <a
- href="mbauvnavusbl.html">mbauvnavusbl</a></li>
-  <li> Output a list of the times when a survey passes the waypoints of a planned survey route: <a href="mbroutetime.html">mbroutetime</a></li>
-    </ul>
-
-    <li>Patch Test Analyis
-      <ul>
-        <li>Interactive 3D visualization data cleaning and attitude bias patch test: <a href="mbeditviz.html">mbeditviz</a></li>
-      </ul>
-    </li>
-    <li>Bathymetry Data Processing</li>
-    <ul>
-      <li>Automatic bathymetry data cleaning: <a
- href="mbareaclean.html">mbareaclean</a></li>
-      <li>Automatic bathymetry data cleaning: <a href="mbclean.html">mbclean</a></li>
-      <li>Interactive bathymetry data cleaning: <a href="mbedit.html">mbedit</a></li>
-      <li>Interactive 3D visualization data cleaning and attitude bias patch test: <a href="mbeditviz.html">mbeditviz</a></li>
-      <li>Extract bathymetry edits in edit save file format: <a
- href="mbgetesf.html">mbgetesf</a></li>
-      <li>Extract bathymetry edits from Simrad Neptune software into
-edit save file format: <a href="mbneptune2esf.html">mbneptune2esf</a></li>
-      <li>Obtain reference water sound velocity profile (SVP): <a
- href="mblevitus.html">mblevitus</a>*</li>
-      <li>Interactive modeling of SVP effects on bathymetry: <a
- href="mbvelocitytool.html">mbvelocitytool</a>*</li>
-      <li>Extract water sound velocity profiles
-(SVPs) from swath data files: <a href="mbsvplist.html">mbsvplist</a></li>
-  	  <li>Select the best
-available sound speed model for each swath file in a survey according to 
-user specified criteria: <a href="mbsvpselect.html">mbsvpselect</a></li>
-      <li>Create or modify parameter files used to control mbprocess: <a
- href="mbset.html">mbset</a></li>
-      <li>Recalculate or correct swath bathymetry and apply bathymetry
-edits from
-mbedit and mbclean: <a href="mbprocess.html">mbprocess</a></li>
-      <li>Obtain histogram of bathymetry data: <a
- href="mbhistogram.html">mbhistogram</a>*</li>
-      <li>Automatically grid bathymetry data: <a href="mbm_grid.html">mbm_grid</a>*</li>
-      <li>Grid bathymetry data: <a href="mbgrid.html">mbgrid</a>*</li>
-      <li>Extract subarea of GMT grid file: <a href="mbm_grdcut.html">mbm_grdcut</a>*</li>
-      <li>Perform forward and inverse UTM projections of ASCII data
-triples: <a href="mbm_utm.html">mbm_utm</a>*</li>
-      <li>Estimate attitude time lag by cross correlation of apparent
-bottom slope with the roll time series: <a href="mbrolltimelag.html">mbrolltimelag</a></li>
-    </ul>
-    <li>Sidescan and Amplitude Data Processing</li>
-    <ul>
-      <li>Obtain grazing angle correction tables from
-sidescan/amplitude data for
-use by mbprocess: <a href="mbbackangle.html">mbbackangle</a></li>
-      <li>Create or modify parameter files used to control mbprocess: <a
- href="mbset.html">mbset</a></li>
-      <li>Correct sidescan/amplitude data using tables generated by
-mbbackangle: <a href="mbprocess.html">mbprocess</a></li>
-      <li>Automatically mosaic sidescan/amplitude data: <a
- href="mbm_grid.html">mbm_grid</a>*</li>
-      <li>Mosaic sidescan/amplitude data: <a href="mbmosaic.html">mbmosaic</a>*</li>
-      <li>Grid sidescan/amplitude data: <a href="mbgrid.html">mbgrid</a>*</li>
-      <li>Extract subarea of GMT grid file: <a href="mbm_grdcut.html">mbm_grdcut</a>*</li>
-    </ul>
-    <li>Grid Vizualization</li>
-    <ul>
-      <li>GMT grid vizualization and survey planning: <a
- href="mbgrdviz.html">mbgrdviz</a>*</li>
-    </ul>
-    <li>Survey planning</li>
-    <ul>
-      <li>GMT grid vizualization and survey planning: <a
- href="mbgrdviz.html">mbgrdviz</a>*</li>
-      <li>Translate an mbgrdviz survey route file into an MBARI AUV
-mission script: <a href="mbm_route2mission.html">mbm_route2mission</a>*</li>
-    </ul>
-    <li>Postscript Graphics</li>
-    <ul>
-      <li>GMT compatible swath contouring: <a href="mbcontour.html">mbcontour</a>*</li>
-      <li>GMT compatible swath color fill plotting: <a
- href="mbswath.html">mbswath</a>*</li>
-      <li>Macro to generate GMT map of swath data:<a
- href="mbm_plot.html">
-mbm_plot</a>*</li>
-      <li>Macro to generate GMT map of gridded data: <a
- href="mbm_grdplot.html">mbm_grdplot</a>*</li>
-      <li>Macro to generate GMT perspective view of gridded data: <a
- href="mbm_grd3dplot.html">mbm_grd3dplot</a>*</li>
-      <li>Macro to generate GMT plot of xy data: <a
- href="mbm_xyplot.html">mbm_xyplot</a>*</li>
-      <li>Macro to generate GMT histogram plot of data: <a
- href="mbm_histplot.html">mbm_histplot</a>*</li>
-    </ul>
-    <li>Exporting Data Products to GIS and Visualization Packages</li>
-    <ul>
-      <li>Generate GeoTIFF image from GMT grid files: <a
- href="mbgrdtiff.html">mbgrdtiff</a>*</li>
-      <li>Macro to generate GeoTIFF image of gridded data: <a
- href="mbm_grdtiff.html">mbm_grdtiff</a>*</li>
-      <li>Convert GMT grid file to ArcView ASCII grid file: <a
- href="mbm_grd2arc.html">mbm_grd2arc</a>*</li>
-      <li>Convert ArcView ASCII grid file to GMT grid file: <a
- href="mbm_arc2grd.html">mbm_arc2grd</a>*</li>
-      <li>Convert GMT grid file to a set of tiled GeoVRML files: <a
- href="mbm_arc2grd.html">mbm_grd2geovrml</a>*</li>
-    </ul>
-    <li>Subbottom profiler (and center beam reflection) data processing</li>
-    <ul>
-      <li>Extract subbottom profiler data to segy files: <a
- href="mbextractsegy.html">mbextractsegy</a></li>
-      <li>Get segy data file information and statistics: <a
- href="mbsegyinfo.html">mbsegyinfo</a></li>
-      <li>Produce arbitrary ascii tables from segy data files: <a
- href="mbsegylist.html">mbsegylist</a></li>
-      <li>Grid seismic data from segy data files: <a
- href="mbsegygrid.html">mbsegygrid</a></li>
-      <li>Generate Power Spectral Density (PSD) estimates from segy data files: <a href="mbsegypsd.html">mbsegypsd</a></li>
-    </ul>
-    <li>Tide modeling and correction</li>
-    <ul>
-      <li>Generate open ocean tidal model using the Oregon State Ocean Tide Prediction Software (OTPSnc) package: <a href="mbotps.html">mbotps</a><br>
-      </li>
-    </ul>
-    <li>Format-specific processing, extraction, or translation</li>
-    <ul>
-      <li>Preprocess Reson 7k data (format 88), including applying time
-        lag and biases to attitude and navigation data: <a
- href="mb7kpreprocess.html">mb7kpreprocess</a></li>
-      <li> Preprocess data from third generation Kongsberg
-    multibeam sonars (e.g. EM122, EM302, EM710): <a href="mbkongsbergpreprocess.html">mbkongsbergpreprocess</a></li>
-      <li>List raw information contained in Hydrosweep DS data files (formats 21 and 24): <a href="mbhsdump.html">mbhsdump</a></li>
-      <li>Preprocess HYSWEEP HSX data (format 201), including applying time
-        lag and biases to attitude and navigation data: <a
- href="mbhysweeppreprocess.html">mbhysweeppreprocess</a></li>
-      <li>Preprocess SwathPlus SXP data (format 222), including applying time
-        lag and biases to attitude and navigation data: <a
- href="mbswplspreprocess.html">mbswplspreprocess</a></li>
-  <li>Scan a Hydrosweep swath sonar data file using the  program  mbhsdump  and generate a list in columnar format with time, date, latitude, longitude, C-mean, and C-keel entrys: <a href="mbm_fmtvel.html">mbm_fmtvel</a></li>
-      <li>Extract Jstar format (format 132) sidescan and subbottom data
-      from Reson 7k (format 88) data files: <a href="mb7k2jstar.html">mb7k2jstar</a>      </li>
-  <li> Extract Edgetech sidescan sonar data from Reson 7k format data, bin and lay the sidescan
-onto the seafloor, and output data in the MBF_MBLDEOIH formst (MBIO
-format id 71): <a href="mb7k2ss.html">mb7k2ss</a></li>
-  <li> <a href="mbauvloglist.html">mbauvloglist</a>: Generate
-    arbitrary text lists of values from MBARI AUV mission log files.<br>
-  </li>
-  </ul>
-  </ul>
-</ul>
-<center>
-  Last Updated: $Id: mbsystem_capabilities.html 2187 2014-05-28 23:56:32Z caress $
-</center>
-<ul>
-  <hr width="100%">
-  <p><a href="mbsystem_home.html"><img src="mbsystem_logo_small.gif"
- align="bottom" border="0" height="55" width="158"></a><a
- href="mbsystem_home.html">Back
-    to MB-System Home Page...</a> </p>
-</ul>
-</body>
-</html>
diff --git a/html/mbsystem_copyright.html b/html/mbsystem_copyright.html
deleted file mode 100644
index 516283c..0000000
--- a/html/mbsystem_copyright.html
+++ /dev/null
@@ -1,123 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
-<HTML>
-<HEAD>
-   <TITLE>MB-System Copyright</TITLE>
-  <meta http-equiv="Content-Type" content="text/html">
-  <meta name="Title" content="MB-System: Mapping the Seafloor">
-  <meta name="Author" content="David Caress, Dale Chayes">
-  <meta name="Description" content="open source software for processing bathymetry and backscatter data from multibeam and sidescan sonar">
-  <meta name="Keywords" content="seafloor,mapping,multibeam,sonar,bathymetry,sidescan,swath processing,open,source,software">
-</HEAD>
-<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#336699" VLINK="#997040" ALINK="#CC9900">
-<BODY>
-
-<CENTER><P><B><FONT SIZE=+2>MB-System Copyright</FONT></B></P></CENTER>
-
-<CENTER>
-  <DT>MB-System Copyright © 1993-2014</DT>
-</CENTER>
-
-<CENTER><DT>by David W. Caress and Dale N. Chayes</DT></CENTER>
-
-<CENTER><DT>All Rights Reserved.</DT></CENTER>
-
-<CENTER><DT>All Wrongs Remembered.</DT></CENTER>
-
-<CENTER><P>
-<HR WIDTH="67%"></P></CENTER>
-
-<CENTER><P><B><FONT SIZE=+2>MB-System Licensing</FONT></B></P></CENTER>
-
-<P>The MB-System source code is distributed under the <A HREF="gpl.html">GNU
-General Public License (version 3)</A> as formulated by the
-<A HREF="http://fsf.org/">Free Software Foundation.</A>
-Early MB-System distributions were described as "public domain",
-which meant there was no restriction whatsoever on the use of the code.
-For over a decade we have adopted the more restrictive GNU GPL license in order
-to insure that anyone who distributes software based in whole or in part
-on MB-System also distributes the modified MB-System source code and any
-additional source code. </P>
-
-<P>The GNU GPL also prohibits the distribution of proprietary
-executables linked with MB-System libraries unless the source code is also
-distributed. We waive this restriction on distributing proprietary compiled
-programs for specific software products if and only if those software products
-meet the following two conditions:</P>
-
-<UL>
-<LI>The software product was created, sold, and delivered to customers
-using source code derived from MB-System release 4.6 distributions.</LI>
-
-<LI>The software product was sold and delivered to customers prior to January
-1, 2001.</LI>
-</UL>
-
-<CENTER><P>
-<HR WIDTH="67%"></P></CENTER>
-
-<CENTER><P><B><FONT SIZE=+2>Acknowledgment of Source Code Derived From Other Sources</FONT></B></P></CENTER>
-
-<P>The MB-System distribution includes some source code derived from packages
-that are distributed separately and have been authored by programmers other
-than the MB-System team. This includes:</P>
-
-<UL>
-<LI>The <A HREF="https://www.leidos.com/maritime/gsf">Generic Sensor Format</A> (GSF) library source located in mbsystem/src/gsf.
-The GSF package is distributed by the
-<A HREF="https://www.leidos.com/maritime"> Leidos Maritime</A>
-under contract to the
-<A HREF="http://www.usno.navy.mil/NAVO">Naval Oceanographic Office</A>.</LI>
-
-<LI>The SURF API (SAPI) library source located in mbsystem/src/surf.
-The SAPI package has been released under the <A HREF="gpl.html">GNU
-General Public License</A> by <A HREF="http://www.atlashydro.com/">Atlas
-Hydrographic</A>.</LI>
-
-<LI>The MR1PR library source located in mbsystem/src/mr1pr. This package
-has been openly released by the
-<A HREF="http://www.soest.hawaii.edu/HMRG/">
-Hawaii Mapping Research Group</A>.</LI>
-
-<LI>The <A HREF="http://trac.osgeo.org/proj/">PROJ.4 library source</A> located in mbsystem/src/proj. This package
-was originally developed by Gerald Evenden of the
-<A HREF="http://www.usgs.gov/">United States
-Geological Survey</A>, and is now maintained and distributed under an MIT
-license (that is very close to public domain)
-by Frank Warmerdam in association with the <A HREF="http://www.osgeo.org/">
-Open Source Geospational Foundation</A></LI>
-
-<LI>The mb_beaudoin() function found in mbsystem/src/mbio/mb_angle.c was contributed by Jonathan Beaudoin of <A HREF="http://ccom.unh.edu"> CCOM/JHC University of New Hampshire</A> and John Hughes Clarke of the <A HREF="http://www.omg.unb.ca">Ocean Mapping Group, University of New Brunswick</A>. This code is licensed as part of MB-System under the <A HREF="gpl.html">GNU General Public License (version 3)</A>.</LI>
-
-<LI>The mb_mergesort() function found in mbsystem/src/mbio/mb_esf.c
-derives from the <A HREF="http://www.gnu-darwin.org/">GNU-Darwin Distribution</A>.
-This code is released under both the
-Apple Public Source License Version 1.1 and the BSD license, with
-original copyright by the Regents of the University of California.
-</LI>
-</UL>
-
-<CENTER><P>
-<HR WIDTH="67%"></P></CENTER>
-
-<CENTER><P><B><FONT SIZE=+2>MB-System Caveat</FONT></B></P></CENTER>
-
-<P>The MB-System software package does not come with any warranties, nor
-is it guarenteed to work on your computer or to do anything useful. The
-user assumes full responsibility for the use of this software. In particular,
-David W. Caress, Dale N. Chayes, the Lamont-Doherty Earth Observatory of
-Columbia University, the Monterey Bay Aquarium Research Institute, or any
-other individuals or organizations involved in the design and maintenance
-of the MB-System software package are NOT responsible for any damage that
-may follow from correct or incorrect use of these programs. </P>
-
-<CENTER><P><BR>
-Last Updated: $Id: mbsystem_copyright.html 2208 2014-10-29 08:18:46Z caress $</P></CENTER>
-
-<CENTER><P>
-<HR WIDTH="100%"></P></CENTER>
-
-<P><A HREF="mbsystem_home.html"><IMG SRC="mbsystem_logo_small.gif" BORDER=0 HEIGHT=55 WIDTH=158></A><A HREF="mbsystem_home.html">Back
-to MB-System Home Page...</A></P>
-
-</BODY>
-</HTML>
diff --git a/html/mbsystem_faq.html b/html/mbsystem_faq.html
deleted file mode 100644
index 2aaeff0..0000000
--- a/html/mbsystem_faq.html
+++ /dev/null
@@ -1,433 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
-<html>
-<head>
-  <title>MB-System Frequently Asked Questions</title>
-  <meta content="text/html" http-equiv="Content-Type">
-  <meta content="MB-System: Mapping the Seafloor" name="Title">
-  <meta content="David Caress, Dale Chayes" name="Author">
-  <meta
- content="open source software for processing bathymetry and backscatter data from multibeam and sidescan sonar"
- name="Description">
-  <meta
- content="seafloor,mapping,multibeam,sonar,bathymetry,sidescan,swath processing,open,source,software"
- name="Keywords">
-</head>
-<body alink="#cc9900" vlink="#997040" link="#336699" bgcolor="#ffffff"
- text="#000000">
-<center>
-<p><b><font size="+2">Frequently Asked Questions About MB-System</font></b></p>
-</center>
-<ul>
-  <li><b><a href="#MB-FAQ-whatis">What is MB-System?</a></b></li>
-  <li><b><a href="#MB-FAQ-cost">How much does MB-System cost?</a></b></li>
-  <li><b><a href="#MB-FAQ-creators">Who created MB-System?</a></b></li>
-  <li><b><a href="#MB-FAQ-computers">On which computers will MB-System
-work?</a></b></li>
-  <li><b><a href="#MB-FAQ-formats">What data formats are supported by 
-MB-System?</a></b></li>
-  <li><b><a href="mbsystem_faq.html#MB-FAQ-formatdoc">Where do I find
-data format documentation?</a></b></li>
-  <li><b><a href="#MB-FAQ-obtain">How do I obtain the MB-System source
-code?</a></b></li>
-  <li><b><a href="#MB-FAQ-licensing">How is the MB-System software
-licensed?</a></b></li>
-  <li><b><a href="#MB-FAQ-required">What other software is required for
-MB-System
-to work?</a></b></li>
-  <li><b><a href="#MB-FAQ-install">How do I install MB-System on my
-computer?</a></b></li>
-  <li><b><a href="#MB-FAQ-problems">How do I report problems with
-MB-System?</a></b></li>
-  <li><b><a href="#MB-FAQ-newformats">How do I arrange to have new data
-formats
-supported by MB-System?</a></b></li>
-  <li><b><a href="#MB-FAQ-updates">How are MB-System updates handled?</a></b></li>
-  <li><b><a href="#MB-FAQ-discussionlist">Is there an MB-System
-discussion list?</a></b></li>
-  <li><b><a href="#MB-FAQ-announcementlist">Is there an MB-System
-announcement list?</a></b></li>
-  <li><b><a href="#MB-FAQ-examples">Where can I find examples of how to
-use
-MB-System?</a></b></li>
-  <li><b><a href="#MB-FAQ-references">Are there any MB-System
-References?</a></b></li>
-  <li><b><a href="#MB-FAQ-future">What are the plans for future
-MB-System
-Development?</a></b></li>
-   <li><b><a href="#MB-FAQ-whopays">Who pays for MB-System development?</a></b></li>
-  <li><b><a href="#MB-FAQ-seamount">What seamount is shown in the
-MB-System
-logo?</a></b></li>
-  <li><b><a href="#MB-FAQ-history">What is the history of MB-System?</a></b></li>
-  <li><b><a href="#MB-FAQ-credit">Who else deserves credit for
-contributions
-to MB-System?</a></b></li>
- <li><b><a href="#MB-FAQ-y2k">Is MB-System Y2K compliant?</a></b></li>
-</ul>
-<p>
-</p>
-<hr width="67%">
-<p></p>
-<center>
-<p><b><font size="+2">Answers to Frequently Asked Questions</font></b></p>
-</center>
-<ul>
-  <li><a name="MB-FAQ-whatis"></a><b>What is MB-System?</b></li>
-  <p>MB-System is a software package consisting of programs which
-manipulate,
-process, list, or display swath sonar bathymetry, amplitude, and
-sidescan
-data. This software is distributed freely (and for free) in the form of
-source code for Unix platforms. The heart of the system is an
-input/output
-library called MBIO which allows programs to work transparently with
-any
-of a number of supported swath sonar data formats. This approach has
-allowed
-the creation of "generic" utilities which can be applied in a
-uniform manner to sonar data from a variety of sources.</p>
-  <li><a name="MB-FAQ-cost"></a><b>How much does MB-System cost?</b></li>
-  <p>The source code is freely available for free. The package can
-  also be installed via package managers for free on MacOSX, Ubuntu Linux,
-  Red Hat/CentOs Linux, and Debian Linux.</p>
-  <li><a name="MB-FAQ-creators"></a><b>Who created and maintains
-MB-System?</b></li>
-  <p>The originators and primary developers of MB-System are David W. Caress of the Monterey Bay
-Aquarium Research Institute (MBARI) and
-Dale N. Chayes of the Lamont-Doherty Earth Observatory (L-DEO) of
-Columbia
-University. The core MB-System development team also includes Christian dos Santos Ferreira of the Center for Marine Environmental Sciences (MARUM) at the University of Bremen. Krystle Anderson of MBARI is currently assisting the team in writing MB-System documentation. Val
-    Schmidt, formerly an engineer at L-DEO,and now now a research engineer at the <a href="http://ccom.unh.edu/">Center for Coastal and Ocean Mapping at the University of New Hampshire</a>, was the primary author of the first version of the MB-System Cookbook. See the home
-  page for <a href="mbsystem_home.html#MB-authors">pictures and addresses</a>.</p>
-  <li><a name="MB-FAQ-computers"></a><b>On which computers will
-    MB-System
-  work?</b></li>
-  <p>The source code for MB-System is written in ANSI C and Perl and should
-be
-portable to all unix-like platforms.  MB-System has been
-successfully
-installed on PC's and Macintoshes running Linux, Macintoshes running
-MacOS X,
-Sun workstations running
-under SunOS4.1 and Solaris, Silicon Graphics (SGI) workstations running
-under IRIX, Hewlett Packard workstations, Dec Alpha workstations, and
-PC's
-running under the Lynx realtime operating system.</p>
-  <li><a name="MB-FAQ-formats"></a><b>What data formats are supported
-by
-MB-System?</b></li>
-  <p><a href="mbsystem_formats.html">Click here </a>for a list of
-supported
-sonars and data formats.</p>
-  <li><b><a name="MB-FAQ-formatdoc"></a>Where do I find data format
-documentation?</b></li>
-</ul>
-<p style="margin-left: 40px;">Some of the swath mapping data formats
-supported by MB-System are documented on the main MB-System websites:<br>
-</p>
-<div style="margin-left: 80px;"><a
- href="http://www.mbari.org/data/mbsystem/formatdoc/">http://www.mbari.org/data/mbsystem/formatdoc/</a><br>
-<a href="http://www.ldeo.columbia.edu/MB-System/formatdoc/">http://www.ldeo.columbia.edu/MB-System/formatdoc/</a><br>
-</div>
-<ul>
-  <li><a name="MB-FAQ-obtain"></a><b>How do I obtain the MB-System
-source
-code?</b></li>
-  <p><a href="mbsystem_how_to_get.html#MB-get">Click here</a> for
-instructions
-on obtaining the MB-System source code distribution.</p>
-  <li><a name="MB-FAQ-licensing"></a><b>How is the MB-System software
-licensed?</b></li>
-  <p><a href="mbsystem_copyright.html">Click here</a> for information
-on
-MB-System copyright and licensing.</p>
-  <li><a name="MB-FAQ-required"></a><b>What other software is required
-for
-MB-System to work?</b></li>
-  <p><a href="mbsystem_how_to_get.html#MB-required">Click here</a> for
-information
-on other software required for an MB-System installation.</p>
-  <li><a name="MB-FAQ-install"></a><b>How do I install MB-System on my
-computer?</b></li>
-  <p><a href="mbsystem_how_to_get.html#MB-install">Click here</a> for
-MB-System
-installation information.</p>
-  <li><a name="MB-FAQ-problems"></a><b>How do I report problems with
-MB-System?</b></li>
-  <p>Although we make no promises about how rapidly problems will be
-fixed,
-we strongly encourage users to notify us of bugs (and fixes!).</p>
-  <p>Problems should be reported by posts to the <a
- href="#MB-FAQ-discussionlist">MB-System discussion list</a>.
-You will have to subscribe to the list in order to post to it (one can
-always unsubscribe at any time).
-If you are unable to access the MB-System Discussion List, you can
-email <a href="mailto:caress at mbari.org,dale at ldeo.columbia.edu">both
-David W, Caress and Dale N. Chayes</a> directly. However, due to our
-frequent travel, using the discussion list
-makes timely responses more likely.</p>
-  <li><a name="MB-FAQ-newformats"></a><b>How do I arrange to have new
-data
-formats supported by MB-System</b></li>
-  <p>In order to support a new data format, we will require a data
-format
-specification document and a data sample. We make no promises about how
-rapidly
-new formats can be supported. Format support requests by NSF-funded
-scientists
-are given priority. </p>
-  <p>We encourage users with data in unsupported formats to write the
-input/output
-modules themselves, and contribute the code to the MB-System project. </p>
-  <li><a name="MB-FAQ-updates"></a><b>How are MB-System updates handled?</b></li>
-  <p>Incremental bug fixes and code changes often occur between the
-    source code releases. These updates to individual source files are reflected in the source code archive, which can be accessed at:</p>
-  <dd><a href="http://svn.ilab.ldeo.columbia.edu/listing.php?repname=MB-System">http://svn.ilab.ldeo.columbia.edu/listing.php?repname=MB-System</a></dd>
-  <p>Periodically, we construct full source code distributions and make them available on the ftp site:</p>
-    <dd><a href="ftp://ftp.ldeo.columbia.edu/pub/MB-System/">ftp.ldeo.columbia.edu/pub/MB-System/</a></dd>
-  <p>These source code distributions consist of gzipped tarfiles with names of the form "MB-System5.3.1906.tar.gz", 
-  where 5.3 indicates the incrementing major and minor release id's, and
-  the third number indicates the corresponding revision level in the source code archive.</p>
-  <li><a name="MB-FAQ-discussionlist"></a><b>Is there an MB-System
-discussion list?</b></li>
-  <dt><br>
-We maintain an MB-System discussion email list to facillitate
-communication
-among MB-System developers and users. We encourage users with questions
-and/or problems
-to use this list rather than emailing the developers directly.
-One must subscribe to the list in order
-to post messages, but the message archive is publically viewable and
-searchable
-over a web interface. The maximum message size in this list is 100K.
-Please do not attempt to attach data samples
-to discussion list posts.</dt>
-  <br>
-  <dt>To read the archives go to:</dt>
-  <ul>
-    <dt><a href="http://listserver.mbari.org/sympa/arc/mbsystem">http://listserver.mbari.org/sympa/arc/mbsystem</a></dt>
-  </ul>
-  <dt>To subscribe go to:</dt>
-  <ul>
-    <dt><a
- href="http://listserver.mbari.org/sympa/subscribe/mbsystem">http://listserver.mbari.org/sympa/subscribe/mbsystem</a></dt>
-  </ul>
-  <br>
-  <li><a name="MB-FAQ-announcementlist"></a><b>Is there an MB-System
-announcement list?</b></li>
-  <dt><br>
-We maintain a second, very low traffic list of email addresses which is
-used solely for providing notification
-of major updates. If you would like to be notified when new releases
-are available, but do not
-wish to join the discussion list described above,
-please send an email message to:</dt>
-  <ul>
-    <dt>majordomo at ldeo.columbia.edu</dt>
-  </ul>
-  <dt>with a single line in the body of the message that says:</dt>
-  <ul>
-    <dt>subscribe mbsystem-l</dt>
-  </ul>
-  <dt>to be automatically added to the announcement list. <br>
-    <br>
-  </dt>
-  <li><a name="MB-FAQ-examples"></a><b>Where can I find examples of how
-to
-use MB-System?</b></li>
-  <dt><br>
-The MB-System Cookbook tutorial documentation by Val Schmidt,
-Dale N. Chayes,
-and David W. Caress is available from the Lamont-Doherty web site both
-as web pages and as a downloadable pdf document: </dt>
-  <ul>
-    <dt><a
- href="http://www.ldeo.columbia.edu/MB-System/mb-cookbook/index.html">MB-System
-5.0 Cookbook web pages</a></dt>
-  
-    <dt><a
- href="http://www.ldeo.columbia.edu/MB-System/mbcookbook.pdf">MB-System
-    5.0 Cookbook pdf file</a></dt>
-  </ul>
-  <br>
-  <li><a name="MB-FAQ-references"></a><b>Are there any MB-System
-References?</b></li>
-  <p>Papers specifically about MB-System:</p>
-  <blockquote>
-    <p><a href="http://ieeexplore.ieee.org/xpl/articleDetails.jsp?arnumber=528558">Caress, D. W., and D. N. Chayes, New software for processing
-      sidescan
-      data from sidescan-capable multibeam sonars, <i>Proceedings of the
-        IEEE
-        Oceans 95 Conference</i>, 997-1000, 1995.</a></p>
-    <p><a href="http://link.springer.com/article/10.1007/BF00313878">Caress, D. W., and D. N. Chayes, Improved processing of Hydrosweep
-      DS
-      multibeam data on the R/V Maurice Ewing, <i>Mar. Geophys. Res.</i>,
-      18,
-      631-650, 1996.</a></p>
-  </blockquote>
-  <p>This paper on high-resolution autonomous mapping features some of the more recent MB-System capabilities:</p>
-  <blockquote>
-    <p><a href="http://doc.nprb.org/web/research/research%20pubs/615_habitat_mapping_workshop/Individual%20Chapters%20High-Res/Ch4%20Caress%20et%20al.pdf">Caress, D.W., H. Thomas, W. J. Kirkwood, R. McEwen, R. Henthorn, E. A. Clague, C. K. Paull,  J. Paduan, and K. L. Maier, "High-Resolution Multibeam, Sidescan, and Subbottom Surveys Using the MBARI AUV D. Allan B.",  <em>Marine Habitat Mapping Technology for Alaska</em>, J.R. Reynolds and H.G. Greene (eds.) Alaska Sea Grant College Prog [...]
-  </blockquote>
-  <p>References to the software distributions:</p>
-  <blockquote>
-    <p>Caress, D. W., and D. N. Chayes, MB-System: Mapping the Seafloor, <a href="http://www.mbari.org/data/mbsystem/"> http://www.mbari.org/data/mbsystem</a> and <a href="http://www.ldeo.columbia.edu/res/pi/MB-System/"> http://www.ldeo.columbia.edu/res/pi/MB-System</a>, 2014.</p>
-  </blockquote>
-  <li><a name="MB-FAQ-future"></a><b>What are the plans for future
-    MB-System
-  Development?</b></li>
-  <p><a href="mbsystem_future.html">Click here</a> for some notions
-regarding
-future MB-System development.</p>
-  <li><a name="MB-FAQ-whopays"></a><b>Who pays for MB-System
-development?</b></li>
-  <p>MB-System is primarily supported by the Packard Foundation and the National Science Foundation. The Marine Geology and Geophysics program of the Ocean
-Sciences Division of NSF provides support through active grants (2013-2017) to the Monterey Bay Aquarium Research Institute (principal
-investigator
-David W. Caress) and the Lamont-Doherty Earth Observatory of Columbia
-University
-(principal investigator Dale N. Chayes). The Monterey Bay Aquarium
-Research
-Institute, funded by the Packard Foundation, matches 
-the NSF support for David W. Caress as part of its
-seafloor
-mapping program, and provides additional support as part of internal MBARI development projects and operations. Additional support also occasionally comes in the form
-of contract work for various government agencies and companies.</p>
-  <li><a name="MB-FAQ-seamount"></a><b>What seamount is shown in the
-MB-System
-logo?</b></li>
-  <p>The seamount shown in illuminated color 3D perspective in the
-MB-System
-logo is the northern Urville Seamount (or Dumont d'Urville du Nord, as
-it appears on French charts). This seamount is located in the Marquesas
-Islands at 9 35'S, 139 47'W. It was surveyed in 1991 and 1992 using the
-Hydrosweep DS multibeam sonar on the R/V Maurice Ewing.</p>
-  <li><a name="MB-FAQ-history"></a><b>What is the history of MB-System?</b></li>
-  <p>The development of MB-System began in 1990 as part of ongoing
-research
-at L-DEO involving swath bathymetry data collected with SeaBeam
-multibeam
-sonars. Development was accelerated in 1991 as part of the effort to
-support
-the STN-Atlas Hydrosweep DS multibeam sonar on L-DEO's ship, the R/V
-Maurice
-Ewing. The Marine Geology and Geophysics Program (Ocean Sciences Division) of the National Science Foundation (NSF) provided support in 1993 and
-1994
-to improve and extend MB-System. The intent of this initial grant was
-to
-provide a standard "generic" set of tools for processing and
-display of swath sonar data that could be used by the U.S. academic
-community.
-The first generally released version of MB-System (3.0) was made
-available
-in the Spring of 1993. This was followed by versions 3.1 and 3.2 in
-July,
-1993, version 3.3 in November, 1993, and version 3.4 in December 1993.
-All of these early releases supported only SeaBeam and Hydrosweep data.</p>
-  <p>SeaBeam Instruments and Antarctic Support Associates provided
-additional
-support in 1994 for the development of MB-System, with particular
-emphasis
-on capabilities related to the new SeaBeam 2100 series of sonars. A
-considerably
-enhanced MB-System version 4.0 was released on October 22, 1994; this
-release
-followed an almost complete rewrite of the underlying source code. The
-new capabilities included support for sidescan as well as bathymetry
-data
-and support for data from a number of very different sonars. </p>
-  <p>The NSF funded a five year effort begun in
-1995
-to maintain and further develop MB-System. From 1994 to 1997, SeaBeam
-Instruments
-(a major multibeam sonar manufacturer and, at the time, the principal
-employer
-of David W. Caress) provided significant support for MB-System
-development
-and maintenance. Similarly, the Newport, RI office of the Science
-Applications
-International Corporation (SAIC) supported some MB-System development
-during
-1997-1998, when David W. Caress worked there. Version 4.1 was released
-in November, 1994, followed by 4.2 in February 1995, 4.3 on March 12,
-1996,
-4.4 on August 27, 1996, and 4.5 on September 23, 1997.</p>
-  <p>David W. Caress joined the Monterey Bay Aquarium Research
-Institute
-(MBARI) in September, 1998. Version 4.6 was released on April 16, 1999.
-The final update to version 4.6 (4.6.10) was announced on March 8,
-2000.
-The primary innovations during this period included support for the new
-generation of Simrad multibeam sonars and tools for generating data
-products
-that could be imported directly into GIS software packages.</p>
-  <p>The NSF has funded additional five year grants
-to MBARI and L-DEO which have supported the MB-System project from 2001-2006, 2006-2011, and now from 2013-2017. The Packard Foundation, through its support of MBARI, has matched the NSF support and provided considerable additional support as part of MBARI's efforts to achieve high resolution seafloor mapping in the deep ocean using autonomous underwater vehicles (AUVs).The version 5.0 release incorporated
-a substantial rewrite of the underlying code as well as
-providing
-significant new capabilities
-The initial version 5.0 development took nearly three years. A first
-"beta" release was made on April 6, 2001, followed by thirty more beta
-releases, the last on April 29, 2003. Version 5.0.0 was finally 
-released on December 5, 2003. 
-The software has evolved considerably since that time, and now includes tools for 2D/3D visualization, 3D interactive data editing, navigation adjustment of surveys from submerged platforms, processing and display of subbottom profiler data, and many other features.
-
-Version 5.1 was released on November 26, 2006, version 5.2 on December 30, 2010, and version 5.3 on September 28, 2011. Dozens of incremental releases have been made before and since 5.3, and public access to the code archive allows users to be up to date with respect to development and maintenance regardless of the release schedule.</p>
-  <p>In January 2012 an <a href="http://www.mbari.org/data/mbsystem/2012NSFProposal/20120117MBPlanning.html">MB-System planning meeting</a> was held at the Lamont-Doherty Earth Observatory to lay out long range plans for MB-System development. With the renewal of NSF support in 2013, the MB-System team is now working to implement the <a href="http://www.mbari.org/data/mbsystem/2012NSFProposal/20120117MBPlanning.pdf">priorities from the planning meeting </a>as part of a major code rewrite [...]
-
-  <li><a name="MB-FAQ-credit"></a><b>Who else deserves credit for
-contributions
-to MB-System?</b></li>
-  <p>In addition to the core team (David Caress, Dale Chayes, Christian dos Santos Ferreira), a number of people have made contributions to the code included in
-MB-System.
-These include: </p>
-  <ul>
-    <li>Val Schmidt (University of New Hampshire, formerly Lamont-Doherty Earth Observatory) </li>
-    <li>Gordon Keith (CSIRO Marine and Atmospheric Research, Australia)</li>
-    <li>Kurt Schwehr (Google, formerly University of New Hampshire)</li>
-    <li>Suzanne O'Hara (Lamont-Doherty Earth Observatory) </li>
-    <li>Bob Covill (Tekmap Consulting, Nova Scotia)</li>
-    <li>Peter Lemmond (Woods Hole Oceanographic Institution)</li>
-    <li>Jonathan Beaudoin (CCOM/JHC, University of New Hamphsire)</li>
-    <li>John Hughes Clarke (OMG, University of New Brunswick)</li>
-    <li>Hamish Bowman (University of Otago, New Zealand)</li>
-    <li>Roger Davis (University of Hawaii) </li>
-    <li>Ammar Aljuhne (MARUM, University of Bremen, Germany)</li>
-    <li>Mike McCann (MBARI) </li>
-    <li>Hans Thomas (MBARI) </li>
-    <li>Daniel Scheirer (USGS, formerly Brown University)</li>
-    <li>Paul Cohen (formerly at SeaBeam Instruments)</li>
-    <li>Steve Dzurenko (formerly at SeaBeam Instruments, more recently at University of Texas)</li>
-    <li>David Brock (formerly with Antarctic Support Associates) </li>
-    <li>Alberto Malinverno (Lamont-Doherty Earth Observatory, later at
-    Schlumberger-Doll, now back at Lamont) </li>
-    <li>Russ Alexander (formerly with UCSB) </li>
-  </ul>
-  <p>Numerous users and vendors have provided information regarding
-data
-file formats and sonar system specific characteristics.</p>
-<li><a name="MB-FAQ-y2k"></a><b>Is MB-System Y2K compliant?</b></li>
-  <p>Remember when Y2K was a buzz word? If so, you are old like us. Not that it matters anymore, but MB-System became fully Y2K 
-compliant as of the final release of version 4.6. Surprisingly,
-a number of data formats associated with current commercial products
-still use two digits to represent the year. MB-System treats two digit year
-values as being in the 1900's if the year value is greater than or equal to
-62,
-and in the 2000's if the year value is less than 62. The use of 1962
-derives
-from the invention of the multibeam sonar in that year - there are no
-digital
-swath mapping data available from an earlier time.</p></ul>
-<center>
-<p><br>
-Last Updated: $Id: mbsystem_faq.html 2208 2014-10-29 08:18:46Z caress $</p>
-</center>
-<p>
-</p>
-<hr width="67%">
-<p></p>
-<p><a href="mbsystem_home.html"><img width="158" height="55" border="0"
- src="mbsystem_logo_small.gif"></a><a href="mbsystem_home.html">Back
-to MB-System Home Page...</a></p>
-</body>
-</html>
diff --git a/html/mbsystem_formats.html b/html/mbsystem_formats.html
deleted file mode 100644
index 69eff1a..0000000
--- a/html/mbsystem_formats.html
+++ /dev/null
@@ -1,1141 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
-<HTML>
-<HEAD>
-   <TITLE>MB-System Supported Data Formats</TITLE>
-</HEAD>
-<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#336699" VLINK="#997040" ALINK="#CC9900">
-
-<CENTER><P><B><FONT SIZE=+2>MB-System Supported Swath Data Formats</FONT></B></P></CENTER>
-
-<P>Each swath mapping sonar system outputs a data stream which includes
-some values or parameters unique to that system. In general, a number of
-different data formats have come into use for data from each of the sonar
-systems; many of these formats include only a subset of the original data
-stream. Internally, MBIO recognizes which sonar system each data format
-is associated with and uses a data structure including the complete data
-stream for that sonar. At present, formats associated with the following
-sonars are supported: </P>
-
-<UL>
-<LI>Sea Beam "classic" multibeam sonar </LI>
-
-<LI>Hydrosweep DS multibeam sonar </LI>
-
-<LI>Hydrosweep DS2 multibeam sonar </LI>
-
-<LI>Hydrosweep MD multibeam sonar </LI>
-
-<LI>Sea Beam 2000 multibeam sonar </LI>
-
-<LI>Sea Beam 2112 and 2136 multibeam sonars </LI>
-
-<LI>Sea Beam 2120 multibeam sonars </LI>
-
-<LI>Simrad EM12, EM121, EM950, and EM1000 multibeam sonars </LI>
-
-<LI>Simrad EM120, EM300, and EM3000 multibeam sonars</LI>
-
-<LI>Simrad EM122, EM302, EM710, and EM3002 multibeam sonars</LI>
-
-<LI>Simrad Mesotech SM2000 multibeam sonar</LI>
-
-<LI>Hawaii MR-1 shallow tow interferometric sonar </LI>
-
-<LI>ELAC Bottomchart and Bottomchart MkII shallow water multibeam sonars</LI>
-
-<LI>Reson Seabat multibeam sonars (e.g. 9001, 8081, 7125)</LI>
-
-<LI>WHOI DSL AMS-120 deep tow interferometric sonar </LI>
-
-<LI>Sea Scan sidescan sonar</LI>
-
-<LI>Furuno HS-1 multibeam sonar</LI>
-
-<LI>Edgetech sidescan and subbottom profiler sonars</LI>
-
-<LI>Imagenex DeltaT multibeam sonars</LI>
-
-<LI>Odom ES3 multibeam sonar</LI>
-
-</UL>
-
-<P>The following swath mapping sonar data formats are currently supported by MB-System:</P>
-
-
-<UL>
-<LI>MBIO Data Format ID:  11 </LI>
-
-<UL>
-<LI>Format name:          MBF_SBSIOMRG</LI>
-
-<LI>Informal Description: SIO merge Sea Beam</LI>
-
-<LI>Attributes:           Sea Beam, bathymetry, 16 beams, binary, uncentered,
-                      SIO.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  12 </LI>
-
-<UL>
-<LI>Format name:          MBF_SBSIOCEN</LI>
-
-<LI>Informal Description: SIO centered Sea Beam</LI>
-
-<LI>Attributes:           Sea Beam, bathymetry, 19 beams, binary, centered,
-                      SIO.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  13 </LI>
-
-<UL>
-<LI>Format name:          MBF_SBSIOLSI</LI>
-
-<LI>Informal Description: SIO LSI Sea Beam</LI>
-
-<LI>Attributes:           Sea Beam, bathymetry, 19 beams, binary, centered, 
-                      obsolete, SIO.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  14 </LI>
-
-<UL>
-<LI>Format name:          MBF_SBURICEN</LI>
-
-<LI>Informal Description: URI Sea Beam</LI>
-
-<LI>Attributes:           Sea Beam, bathymetry, 19 beams, binary, centered,
-                      URI.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  15 </LI>
-
-<UL>
-<LI>Format name:          MBF_SBURIVAX</LI>
-
-<LI>Informal Description: URI Sea Beam from VAX</LI>
-
-<LI>Attributes:           Sea Beam, bathymetry, 19 beams, binary, centered,
-                      VAX byte order, URI.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  16 </LI>
-
-<UL>
-<LI>Format name:          MBF_SBSIOSWB</LI>
-
-<LI>Informal Description: SIO Swath-bathy SeaBeam</LI>
-
-<LI>Attributes:           Sea Beam, bathymetry, 19 beams, binary, centered,
-                      SIO.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  17 </LI>
-
-<UL>
-<LI>Format name:          MBF_SBIFREMR</LI>
-
-<LI>Informal Description: IFREMER Archive SeaBeam</LI>
-
-<LI>Attributes:           Sea Beam, bathymetry, 19 beams, ascii, centered,
-                      IFREMER.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  21 </LI>
-
-<UL>
-<LI>Format name:          MBF_HSATLRAW</LI>
-
-<LI>Informal Description: Raw Hydrosweep</LI>
-
-<LI>Attributes:           Hydrosweep DS, bathymetry and amplitude, 59 beams,
-                      ascii, Atlas Electronik.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  22 </LI>
-
-<UL>
-<LI>Format name:          MBF_HSLDEDMB</LI>
-
-<LI>Informal Description: EDMB Hydrosweep</LI>
-
-<LI>Attributes:           Hydrosweep DS, bathymetry, 59 beams, binary, NRL.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  23 </LI>
-
-<UL>
-<LI>Format name:          MBF_HSURICEN</LI>
-
-<LI>Informal Description: URI Hydrosweep</LI>
-
-<LI>Attributes:           Hydrosweep DS, 59 beams, bathymetry, binary, URI.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  24 </LI>
-
-<UL>
-<LI>Format name:          MBF_HSLDEOIH</LI>
-
-<LI>Informal Description: L-DEO in-house binary Hydrosweep</LI>
-
-<LI>Attributes:           Hydrosweep DS, 59 beams, bathymetry and amplitude, 
-                      binary, centered, L-DEO.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  25 </LI>
-
-<UL>
-<LI>Format name:          MBF_HSURIVAX</LI>
-
-<LI>Informal Description: URI Hydrosweep from VAX</LI>
-
-<LI>Attributes:           Hydrosweep DS, 59 beams, bathymetry, binary,
-                      VAX byte order, URI.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  26 </LI>
-
-<UL>
-<LI>Format name:          MBF_HSUNKNWN</LI>
-
-<LI>Informal Description: Unknown Hydrosweep</LI>
-
-<LI>Attributes:           Hydrosweep DS, bathymetry, 59 beams, ascii, unknown origin, SOPAC.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  32 </LI>
-
-<UL>
-<LI>Format name:          MBF_SB2000SB</LI>
-
-<LI>Informal Description: SIO Swath-bathy SeaBeam 2000 format</LI>
-
-<LI>Attributes:           SeaBeam 2000, bathymetry, 121 beams, 
-                      binary,  SIO.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  33 </LI>
-
-<UL>
-<LI>Format name:          MBF_SB2000SS</LI>
-
-<LI>Informal Description: SIO Swath-bathy SeaBeam 2000 format</LI>
-
-<LI>Attributes:           SeaBeam 2000, sidescan,
-                      1000 pixels for 4-bit sidescan,
-                      2000 pixels for 12+-bit sidescan,
-                      binary,  SIO.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  41 </LI>
-
-<UL>
-<LI>Format name:          MBF_SB2100RW</LI>
-
-<LI>Informal Description: SeaBeam 2100 series vender format</LI>
-
-<LI>Attributes:           SeaBeam 2100, bathymetry, amplitude 
-                      and sidescan, 151 beams and 2000 pixels, ascii 
-                      with binary sidescan, SeaBeam Instruments.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  42 </LI>
-
-<UL>
-<LI>Format name:          MBF_SB2100B1</LI>
-
-<LI>Informal Description: SeaBeam 2100 series vender format</LI>
-
-<LI>Attributes:           SeaBeam 2100, bathymetry, amplitude 
-                      and sidescan, 151 beams bathymetry,
-                      2000 pixels sidescan, binary,
-                      SeaBeam Instruments and L-DEO.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  43 </LI>
-
-<UL>
-<LI>Format name:          MBF_SB2100B2</LI>
-
-<LI>Informal Description: SeaBeam 2100 series vender format</LI>
-
-<LI>Attributes:           SeaBeam 2100, bathymetry and amplitude,  
-                      151 beams bathymetry,
-                      binary,
-                      SeaBeam Instruments and L-DEO.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  51 </LI>
-
-<UL>
-<LI>Format name:          MBF_EMOLDRAW</LI>
-
-<LI>Informal Description: Old Simrad vendor multibeam format</LI>
-
-<LI>Attributes:           Simrad EM1000, EM12S, EM12D, 
-                      and EM121 multibeam sonars,
-                      bathymetry, amplitude, and sidescan,
-                      60 beams for EM1000, 81 beams for EM12S/D,
-		      121 beams for EM121, variable pixels,
-		      ascii + binary, Simrad.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  53 </LI>
-
-<UL>
-<LI>Format name:          MBF_EM12IFRM</LI>
-
-<LI>Informal Description: IFREMER TRISMUS format for Simrad EM12</LI>
-
-<LI>Attributes:           Simrad EM12S and EM12D,
-                     bathymetry, amplitude, and sidescan
-                      81 beams, variable pixels, binary,
-                      read-only, IFREMER.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  54 </LI>
-
-<UL>
-<LI>Format name:          MBF_EM12DARW</LI>
-
-<LI>Informal Description: Simrad EM12S RRS Darwin processed format</LI>
-
-<LI>Attributes:           Simrad EM12S, bathymetry and amplitude,
-                      81 beams, binary, Oxford University.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  56 </LI>
-
-<UL>
-<LI>Format name:          MBF_EM300RAW</LI>
-
-<LI>Informal Description: Simrad current multibeam vendor format</LI>
-
-<LI>Attributes:           Simrad EM120, EM300, EM1002, EM3000, 
-                      bathymetry, amplitude, and sidescan,
-                      up to 254 beams, variable pixels, ascii + binary, Simrad.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  57 </LI>
-
-<UL>
-<LI>Format name:          MBF_EM300MBA</LI>
-
-<LI>Informal Description: Simrad multibeam processing format</LI>
-
-<LI>Attributes:           Old and new Simrad multibeams, 
-                      EM12S, EM12D, EM121, EM120, EM300, 
-                      EM100, EM1000, EM950, EM1002, EM3000, 
-                      bathymetry, amplitude, and sidescan,
-                      up to 254 beams, variable pixels, ascii + binary, MBARI.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  58 </LI>
-
-<UL>
-<LI>Format name:          MBF_EM710RAW</LI>
-
-<LI>Informal Description: Kongsberg current multibeam vendor format</LI>
-
-<LI>Attributes:           Kongsberg EM122, EM302, EM710,
-                      bathymetry, amplitude, and sidescan,
-                      up to 400 beams, variable pixels, binary, Kongsberg.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  59 </LI>
-
-<UL>
-<LI>Format name:          MBF_EM710MBA</LI>
-
-<LI>Informal Description: Kongsberg current multibeam vendor format</LI>
-
-<LI>Attributes:           Kongsberg EM122, EM302, EM710,
-                      bathymetry, amplitude, and sidescan,
-                      up to 400 beams, variable pixels, binary, Kongsberg.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  61 </LI>
-
-<UL>
-<LI>Format name:      MBF_MR1PRHIG</LI>
-
-<LI>Informal Description: Obsolete SOEST MR1 post processed format</LI>
-
-<LI>Attributes:           SOEST MR1, bathymetry and sidescan,
-                      variable beams and pixels, xdr binary, 
-                      SOEST, University of Hawaii.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  62 </LI>
-
-<UL>
-<LI>Format name:          MBF_MR1ALDEO</LI>
-
-<LI>Informal Description: L-DEO MR1 post processed format with travel times</LI>
-
-<LI>Attributes:           L-DEO MR1, bathymetry and sidescan,
-                      variable beams and pixels, xdr binary, 
-                      L-DEO.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  63 </LI>
-
-<UL>
-<LI>Format name:          MBF_MR1BLDEO</LI>
-
-<LI>Informal Description: L-DEO small MR1 post processed format with travel times</LI>
-
-<LI>Attributes:           L-DEO MR1, bathymetry and sidescan,
-                      variable beams and pixels, xdr binary, 
-                      L-DEO.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  64 </LI>
-
-<UL>
-<LI>Format name:          MBF_MR1PRVR2</LI>
-
-<LI>Informal Description: SOEST MR1 post processed format</LI>
-
-<LI>Attributes:           SOEST MR1, bathymetry and sidescan,
-                      variable beams and pixels, xdr binary, 
-                      SOEST, University of Hawaii.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  71 </LI>
-
-<UL>
-<LI>Format name:          MBF_MBLDEOIH</LI>
-
-<LI>Informal Description: L-DEO in-house generic multibeam</LI>
-
-<LI>Attributes:           Data from all sonar systems, bathymetry, 
-                      amplitude and sidescan, variable beams and pixels, 
-                      binary, centered, L-DEO.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  75 </LI>
-
-<UL>
-<LI>Format name:          MBF_MBNETCDF</LI>
-
-<LI>Informal Description: CARAIBES CDF multibeam</LI>
-
-<LI>Attributes:           Data from all sonar systems, bathymetry only, 
-                      variable beams, netCDF, IFREMER.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  76 </LI>
-
-<UL>
-<LI>Format name:          MBF_MBNCDFXT</LI>
-
-<LI>Informal Description: CARAIBES CDF multibeam extended</LI>
-
-<LI>Attributes:           Superset of MBF_MBNETCDF, includes (at least SIMRAD EM12) amplitude, 
-                      variable beams, netCDF, IFREMER.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  81 </LI>
-
-<UL>
-<LI>Format name:          MBF_CBAT9001</LI>
-
-<LI>Informal Description: Reson SeaBat 9001 shallow water multibeam</LI>
-
-<LI>Attributes:           60 beam bathymetry and amplitude,
-                      binary, University of New Brunswick.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  82 </LI>
-
-<UL>
-<LI>Format name:          MBF_CBAT8101</LI>
-
-<LI>Informal Description: Reson SeaBat 8101 shallow water multibeam</LI>
-
-<LI>Attributes:           101 beam bathymetry and amplitude,
-                      binary, SeaBeam Instruments.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  83 </LI>
-
-<UL>
-<LI>Format name:          MBF_HYPC8101</LI>
-
-<LI>Informal Description: Reson SeaBat 8101 shallow water multibeam</LI>
-
-<LI>Attributes:           101 beam bathymetry,
-                      ASCII, read-only, Coastal Oceanographics.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  84 </LI>
-
-<UL>
-<LI>Format name:          MBF_XTFR8101</LI>
-
-<LI>Informal Description: XTF format Reson SeaBat 81XX</LI>
-
-<LI>Attributes:           240 beam bathymetry and amplitude,
-		      1024 pixel sidescan
-                      binary, read-only,
-                      Triton-Elics.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  88 </LI>
-
-<UL>
-<LI>Format name:          MBF_RESON7KR</LI>
-
-<LI>Informal Description: Reson 7K multibeam vendor format</LI>
-
-<LI>Attributes:           Reson 7K series multibeam sonars, 
-                      bathymetry, amplitude, three channels sidescan, and subbottom
-                      up to 254 beams, variable pixels, binary, Reson.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  91 </LI>
-
-<UL>
-<LI>Format name:          MBF_BCHRTUNB</LI>
-
-<LI>Informal Description: Elac BottomChart shallow water multibeam</LI>
-
-<LI>Attributes:           56 beam bathymetry and amplitude,
-                      binary, University of New Brunswick.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  92 </LI>
-
-<UL>
-<LI>Format name:          MBF_ELMK2UNB</LI>
-
-<LI>Informal Description: Elac BottomChart MkII shallow water multibeam</LI>
-
-<LI>Attributes:           126 beam bathymetry and amplitude,
-                      binary, University of New Brunswick.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  93 </LI>
-
-<UL>
-<LI>Format name:          MBF_BCHRXUNB</LI>
-
-<LI>Informal Description: Elac BottomChart shallow water multibeam</LI>
-
-<LI>Attributes:           56 beam bathymetry and amplitude,
-                      binary, University of New Brunswick.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  94 </LI>
-
-<UL>
-<LI>Format name:          MBF_L3XSERAW</LI>
-
-<LI>Informal Description: ELAC/SeaBeam XSE vendor format</LI>
-
-<LI>Attributes:           Bottomchart MkII 50 kHz and 180 kHz multibeam, 
-                      SeaBeam 2120 20 KHz multibeam,
-                      bathymetry, amplitude and sidescan,
-                      variable beams and pixels, binary, 
-                      L3 Communications (Elac Nautik 
-                      and SeaBeam Instruments).</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  101 </LI>
-
-<UL>
-<LI>Format name:          MBF_HSMDARAW</LI>
-
-<LI>Informal Description: Atlas HSMD medium depth multibeam raw format</LI>
-
-<LI>Attributes:           40 beam bathymetry, 160 pixel sidescan,
-                      XDR (binary), STN Atlas Elektronik.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  102 </LI>
-
-<UL>
-<LI>Format name:          MBF_HSMDLDIH</LI>
-
-<LI>Informal Description: Atlas HSMD medium depth multibeam processed format</LI>
-
-<LI>Attributes:           40 beam bathymetry, 160 pixel sidescan,
-                      XDR (binary), L-DEO.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  111 </LI>
-
-<UL>
-<LI>Format name:          MBF_DSL120PF</LI>
-
-<LI>Informal Description: WHOI DSL AMS-120 processed format</LI>
-
-<LI>Attributes:           2048 beam bathymetry, 8192 pixel sidescan,
-                      binary, parallel bathymetry and amplitude files, WHOI DSL.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  112 </LI>
-
-<UL>
-<LI>Format name:          MBF_DSL120SF</LI>
-
-<LI>Informal Description: WHOI DSL AMS-120 processed format</LI>
-
-<LI>Attributes:           2048 beam bathymetry, 8192 pixel sidescan,
-                      binary, single files, WHOI DSL.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  121 </LI>
-
-<UL>
-<LI>Format name:          MBF_GSFGENMB</LI>
-
-<LI>Informal Description: SAIC Generic Sensor Format (GSF)</LI>
-
-<LI>Attributes:           variable beams,  bathymetry and amplitude,
-                      binary, single files, SAIC. </LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  131 </LI>
-
-<UL>
-<LI>Format name:          MBF_MSTIFFSS</LI>
-
-<LI>Informal Description: MSTIFF sidescan format</LI>
-
-<LI>Attributes:           variable pixels,  sidescan,
-                      binary TIFF variant, single files, Sea Scan. </LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  132 </LI>
-
-<UL>
-<LI>Format name:          MBF_EDGJSTAR</LI>
-
-<LI>Informal Description: Edgetech Jstar format</LI>
-
-<LI>Attributes:           variable pixels, dual frequency sidescan and subbottom,
-                      binary SEGY variant, single files,
-                      low frequency sidescan returned as
-                      survey data, Edgetech. </LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  133 </LI>
-
-<UL>
-<LI>Format name:          MBF_EDGJSTR2</LI>
-
-<LI>Informal Description: Edgetech Jstar format</LI>
-
-<LI>Attributes:           variable pixels, dual frequency sidescan and subbottom,
-                      binary SEGY variant, single files,
-                      high frequency sidescan returned as
-                      survey data, Edgetech. </LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  141 </LI>
-
-<UL>
-<LI>Format name:          MBF_OICGEODA</LI>
-
-<LI>Informal Description: OIC swath sonar format</LI>
-
-<LI>Attributes:           variable beam bathymetry and
-                      amplitude, variable pixel sidescan, binary,
-		      Oceanic Imaging Consultants</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  142 </LI>
-
-<UL>
-<LI>Format name:          MBF_OICMBARI</LI>
-
-<LI>Informal Description: OIC-style extended swath sonar format</LI>
-
-<LI>Attributes:           variable beam bathymetry and
-                      amplitude, variable pixel sidescan, binary,
-		      MBARI</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  151 </LI>
-
-<UL>
-<LI>Format name:          MBF_OMGHDCSJ</LI>
-
-<LI>Informal Description: UNB OMG HDCS format (the John Hughes Clarke format)</LI>
-
-<LI>Attributes:           variable beam bathymetry and
-                      amplitude, variable pixel sidescan, binary,
-		      UNB</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  160 </LI>
-
-<UL>
-<LI>Format name:          MBF_SEGYSEGY</LI>
-
-<LI>Informal Description: SEGY seismic data format</LI>
-
-<LI>Attributes:           seismic or subbottom trace data,
-                      single beam bathymetry, nav,
-                      binary, SEG (SIOSEIS variant)</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  161 </LI>
-
-<UL>
-<LI>Format name:          MBF_MGD77DAT</LI>
-
-<LI>Informal Description: NGDC MGD77 underway geophysics format</LI>
-
-<LI>Attributes:           single beam bathymetry, nav, magnetics,
-                      gravity, ascii, NOAA NGDC</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  162 </LI>
-
-<UL>
-<LI>Format name:          MBF_ASCIIXYZ</LI>
-
-<LI>Informal Description: Generic XYZ sounding format</LI>
-
-<LI>Attributes:           XYZ (lon lat depth) ASCII soundings, generic</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  163 </LI>
-
-<UL>
-<LI>Format name:          MBF_ASCIIYXZ</LI>
-
-<LI>Informal Description: Generic YXZ sounding format</LI>
-
-<LI>Attributes:           YXZ (lat lon depth) ASCII soundings, generic</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  164 </LI>
-
-<UL>
-<LI>Format name:         MBF_HYDROB93</LI>
-
-<LI>Informal Description: NGDC binary hydrographic sounding format</LI>
-
-<LI>Attributes:           XYZ (lon lat depth) binary soundings</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  165 </LI>
-
-<UL>
-<LI>Format name:          MBF_MBARIROV</LI>
-
-<LI>Informal Description: MBARI ROV navigation format</LI>
-
-<LI>Attributes:           ROV navigation, MBARI</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  166 </LI>
-
-<UL>
-<LI>Format name:          MBF_MBPRONAV</LI>
-
-<LI>Informal Description: MB-System simple navigation format</LI>
-
-<LI>Attributes:           navigation, MBARI</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  167 </LI>
-
-<UL>
-<LI>Format name:          MBF_NVNETCDF</LI>
-
-<LI>Informal Description: CARAIBES CDF navigation</LI>
-
-<LI>Attributes:           netCDF, IFREMER.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  168 </LI>
-
-<UL>
-<LI>Format name:          MBF_ASCIIXYT</LI>
-
-<LI>Informal Description: Generic XYT sounding format</LI>
-
-<LI>Attributes:           XYT (lon lat topography) ASCII soundings, generic</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  169 </LI>
-
-<UL>
-<LI>Format name:          MBF_ASCIIYXT</LI>
-
-<LI>Informal Description: Generic YXT sounding format</LI>
-
-<LI>Attributes:           YXT (lat lon topograpy) ASCII soundings, generic</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  170 </LI>
-
-<UL>
-<LI>Format name:          MBF_MBARROV2</LI>
-
-<LI>Informal Description: MBARI ROV navigation format</LI>
-
-<LI>Attributes:           ROV navigation, MBARI</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  171 </LI>
-
-<UL>
-<LI>Format name:          MBF_HS10JAMS</LI>
-
-<LI>Informal Description: Furuno HS-10 multibeam format,</LI>
-
-<LI>Attributes:           45 beams bathymetry and amplitude,
-                      ascii, JAMSTEC</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  172 </LI>
-
-<UL>
-<LI>Format name:          MBF_HIR2RNAV</LI>
-
-<LI>Informal Description: SIO GDC R2R navigation format</LI>
-
-<LI>Attributes:           R2R navigation, ascii, SIO</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  173 </LI>
-
-<UL>
-<LI>Format name:          MBF_MGD77TXT</LI>
-
-<LI>Informal Description: NGDC MGD77 underway geophysics format</LI>
-
-<LI>Attributes:           single beam bathymetry, nav, magnetics, gravity,
-                      122 byte ascii records with CRLF line breaks, NOAA NGDC</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  174 </LI>
-
-<UL>
-<LI>Format name:          MBF_MGD77TAB</LI>
-
-<LI>Informal Description: NGDC MGD77 underway geophysics format</LI>
-
-<LI>Attributes:           single beam bathymetry, nav, magnetics, gravity,
-                      122 byte ascii records with CRLF line breaks, NOAA NGDC</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  181 </LI>
-
-<UL>
-<LI>Format name:          MBF_SAMESURF</LI>
-
-<LI>Informal Description: SAM Electronics SURF format.</LI>
-
-<LI>Attributes:           variable beams,  bathymetry, amplitude,  and sidescan,
-                      binary, single files, SAM Electronics (formerly Krupp-Atlas Electronik). </LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  182 </LI>
-
-<UL>
-<LI>Format name:          MBF_HSDS2RAW</LI>
-
-<LI>Informal Description: STN Atlas raw multibeam format</LI>
-
-<LI>Attributes:           STN Atlas multibeam sonars, 
-                      Hydrosweep DS2, Hydrosweep MD, 
-                      Fansweep 10, Fansweep 20, 
-                      bathymetry, amplitude, and sidescan,
-                      up to 1440 beams and 4096 pixels,
-                      XDR binary, STN Atlas.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  183 </LI>
-
-<UL>
-<LI>Format name:          MBF_HSDS2LAM</LI>
-
-<LI>Informal Description: L-DEO HSDS2 processing format</LI>
-
-<LI>Attributes:           STN Atlas multibeam sonars, 
-                      Hydrosweep DS2, Hydrosweep MD, 
-                      Fansweep 10, Fansweep 20, 
-                      bathymetry, amplitude, and sidescan,
-                      up to 1440 beams and 4096 pixels,
-                      XDR binary, L-DEO.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  191 </LI>
-
-<UL>
-<LI>Format name:          MBF_IMAGE83P</LI>
-
-<LI>Informal Description: Imagenex DeltaT Multibeam</LI>
-
-<LI>Attributes:           Multibeam, bathymetry, 480 beams, ascii + binary, Imagenex.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  192 </LI>
-
-<UL>
-<LI>Format name:          MBF_IMAGEMBA</LI>
-
-<LI>Informal Description: MBARI DeltaT Multibeam</LI>
-
-<LI>Attributes:           Multibeam, bathymetry, 480 beams, ascii + binary, MBARI.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  201 </LI>
-
-<UL>
-<LI>Format name:          MBF_HYSWEEP1</LI>
-
-<LI>Informal Description: HYSWEEP multibeam data format</LI>
-
-<LI>Attributes:           Many multibeam sonars, 
-                      bathymetry, amplitude
-                      variable beams, ascii, HYPACK.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  211 </LI>
-
-<UL>
-<LI>Format name:          MBF_XTFB1624</LI>
-
-<LI>Informal Description: XTF format Benthos Sidescan SIS1624</LI>
-
-<LI>Attributes:           variable pixels, dual frequency sidescan and subbottom,
-                      xtf variant, single files,
-                      low frequency sidescan returned as
-                      survey data, Benthos. </LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  221 </LI>
-
-<UL>
-<LI>Format name:          MBF_SWPLSSXI</LI>
-
-<LI>Informal Description: SEA interferometric sonar vendor intermediate format</LI>
-
-<LI>Attributes:           SEA SWATHplus,
-                      bathymetry and amplitude,
-                      variable beams, binary, SEA.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  222 </LI>
-
-<UL>
-<LI>Format name:          MBF_SWPLSSXP</LI>
-
-<LI>Informal Description: SEA interferometric sonar vendor processed data format</LI>
-
-<LI>Attributes:           SEA SWATHplus,
-                      bathymetry and amplitude,
-                      variable beams, binary, SEA.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  231 </LI>
-
-<UL>
-<LI>Format name:          MBF_3DDEPTHP</LI>
-
-<LI>Informal Description: 3DatDepth prototype binary swath mapping LIDAR format</LI>
-
-<LI>Attributes:           3DatDepth LIDAR, variable pulses, bathymetry and amplitude, 
-                      binary, 3DatDepth.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  241 </LI>
-
-<UL>
-<LI>Format name:          MBF_WASSPENL</LI>
-
-<LI>Informal Description: WASSP Multibeam Vendor Format</LI>
-
-<LI>Attributes:           WASSP multibeams, 
-                      bathymetry and amplitude,
-		      122 or 244 beams, binary, Electronic Navigation Ltd.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  251 </LI>
-
-<UL>
-<LI>Format name:          MBF_PHOTGRAM</LI>
-
-<LI>Informal Description: Example format</LI>
-
-<LI>Attributes:           Name the relevant sensor(s), 
-                      what data types are supported
-                      how many beams and pixels, file type (ascii, binary, netCDF), Organization that defined this format.</LI>
-</UL>
-</UL>
-
-<CENTER><P><BR>
-Last Updated: $Id: mb_format.h 2215 2014-11-29 22:21:19Z caress $ $Revision: $</P></CENTER>
-
-<P>
-<HR WIDTH="100%"></P>
-
-<P><IMG SRC="mbsystem_logo_small.gif" HEIGHT=55 WIDTH=158><A HREF="mbsystem_home.html">Back
-to MB-System Home Page...</A></P>
-
-</BODY>
-</HTML>
diff --git a/html/mbsystem_future.html b/html/mbsystem_future.html
deleted file mode 100644
index edefb40..0000000
--- a/html/mbsystem_future.html
+++ /dev/null
@@ -1,122 +0,0 @@
-<!DOCTYPE html PUBLIC "-//w3c//dtd html 4.0 transitional//en">
-<html>
-<head>
-  <title>MB-System Development Plan</title>
-  <meta content="text/html" http-equiv="Content-Type">
-  <meta content="MB-System: Mapping the Seafloor" name="Title">
-  <meta content="David Caress, Dale Chayes" name="Author">
-  <meta
- content="open source software for processing bathymetry and backscatter data from multibeam and sidescan sonar"
- name="Description">
-  <meta
- content="seafloor,mapping,multibeam,sonar,bathymetry,sidescan,swath processing,open,source,software"
- name="Keywords">
-</head>
-<body alink="#cc9900" vlink="#997040" link="#336699" bgcolor="#ffffff"
- text="#000000">
-<center>
-<h1>MB-System Development Plan</h1>
-</center>
-<p>On January 17-18, 2012, an MB-System planning meeting was held at the Lamont-Doherty Earth Observatory to define the priorities for the next five years of MB-System development. This meeting brought together  a small group composed of the core MB-System developers, users that have substantially contributed to the project over the past few years, and representatives of organizations that have expressed interest in parallel development efforts contributing to MB-System.The priorities id [...]
-<p>Full notes from this meeting have been posted <a href="http://www.mbari.org/data/mbsystem/2012NSFProposal/20120117MBPlanning.html">here</a> and <a href="http://www.ldeo.columbia.edu/res/pi/MB-System/2012NSFProposal/20120117MBPlanning.html">here</a>.
-<br>The proposal has been posted <a href="http://www.mbari.org/data/mbsystem/2012NSFProposal/20120815MB-SystemNSFProposal.pdf">here</a> and <a href="http://www.ldeo.columbia.edu/res/pi/MB-System/2012NSFProposal/20120815MB-SystemNSFProposal.pdf">here</a>.</p>
-<p>The focus of the NSF-funded software development efforts at MBARI and L-DEO will be:</p>
-<ul>
-  <li><strong>Re-architect underlying MBIO library</strong><br>The scope of requested new capabilities require substantially recasting the MBIO application programming interface (API) and the associated functions:</li>
-  <ul>
-    <li>Store and pass beam quality information needed for determining if soundings meet IHO (International Hydrographic Organization) quality standards.</li>
-    <li>Recast the internal coordinate systems consistently through the code.</li>
-    <li>Handle corrections to sensor offsets and biases for all sensors.</li>
-  </ul>
-</ul>
-<ul>
-  <li><strong>Support new and important data formats</strong></li>
-  <ul>
-    <li>Keep up to date with data from Kongsberg multibeam installations on UNOLS vessels</li>
-    <li>Keep up to date ith data from Reson multibeam installations on WHOI NSDF platforms (Sentry, Jason, Alvin)</li>
-    <li>Support input from Bathymetry Attributed Grid (BAG) files</li>
-    <li>Support other data formats associated with NSF-supported projects as they become relevant.</li>
-  </ul>
-</ul>
-<ul>
-  <li><strong>Improve performance of common tasks</strong>
-<br>Several straightforward improvements have been identified that can substantially reduce the time required for analysis and processing:</li>
-  <ul>
-    <li>Augmenting the datalist scheme so that surveys as well as individual files have .inf metadata files, and thus data trees outside bounds of interest can be skipped.</li>
-    <li>Recasting ancillary files (esp. fbt) for improved read performance.</li>
-    <li>Allow raw files and processed files to be located on different filesystems to improve processing performance.</li>
-  </ul>
-</ul>
-<ul>
-  <li><strong>Fix existing problems with support of current generation Kongsberg data</strong>
-  <br>The beam angles for current generation Kongsberg multibeam sonar data are not calculated correctly, and an iterative method used to estimate these angles in an optional pre-processing stage is slow. Fixing this issue is high priority.<strong></strong></li>
-</ul>
-<ul>
-  <li><strong>Improve <em>mbeditivz</em></strong>
-<br>Improve patch test calibration capability of <em>mbeditviz</em> by allowing the soundings to be colored according to a variety of parameters.</li>
-</ul>
-<ul>
-  <li><strong>Add capability to generate additional data products:</strong></li>
-  <ul>
-    <li>Shapefiles for ESRI and other GIS</li>
-    <li>KML file for Google Earth</li>
-    <li>Bathymetry Attributed Grid (BAG) files</li>
-  </ul>
-</ul>
-<ul>
-  <li><strong>Support reading from compressed files in gzip format.</strong>
-<br>This will reduce data storage requirements, and is a priority of NGDC, MGDS, and R2R.</li>
-</ul>
-<ul>
-  <li><strong>Rewrite the graphical utilities to use Qt graphics </strong>
-  <br>The interactive programs currently use obsolete Motif/X11 graphics. In addition to improving performance and moving MB to a modern graphics context, switching to Qt will enable true cross-platform portability, including to Windows computers. </li>
-</ul>
-<ul>
-  <li><strong>Develop tools for working with multibeam water column data</strong>
-  <br>The use of recorded beamformed time series data from multibeam sonars to image biological and other water column targets is of great interest to many users. This issue was the highest ranked desired capability at the MB-System planning meeting. Water column data are also an asset in troubleshooting interference in multibeam sonar systems. We will develop a new MB-System tool to display water column data and to identify and display targets. <strong><u></u></strong></li>
-</ul>
-<ul>
-  <li><strong>Implement the CHRT algorithm as an MB-System tool. </strong>
-  <br>CUBE is an algorithm developed by Brian Calder [Calder and Mayer, 2003] that automatically processes swath bathymetry soundings and provides depth estimates and uncertainties at defined points and identifies soundings inconsistent with the best estimates. Thus, CUBE can be used both to identify bad (or suspect) soundings and to generate gridded bathymetry models. This is a particularly useful feature in shallow water data sets with very large numbers of tracks and soundings. The CU [...]
-</ul>
-<ul>
-  <li><strong>Develop real-time display tool</strong>
-  <br>We will implement a display tool that reads swath data from real-time streams, updates a gridded representation of the bathymetry, and displays the current grid and tracklines in a 2D/3D view using the new, Qt-based <em>mbview</em> visualization library.</li>
-</ul>
-<ul>
-  <li><strong>Develop a “test suite” to allow automatic determination that an MB-System installation is successful. </strong>
-  <br>As MB-System has become more complex it has become clear that we need an automated method to verify new builds. Using our existing example data set, we will develop a test procedure implemented in a script that will exercise a new build of MB-System and compare the results against a pre-defined set of results. </li>
-</ul>
-<p>The participants of the MB-System planning meeting also identified updating documentation and improving training resources for both users and developers as significant priorities. We plan to:</p>
-<ul>
-  <li><strong>Rewrite the MB-System Cookbook to reflect the current software. </strong>
-  <br>We will rewrite the cookbook to reflect the current state of the software.<strong></strong></li>
-</ul>
-<ul>
-  <li><strong>Create an MB-System Wiki to store and disseminate user-created documentation and training materials. </strong>
-  <br>A number of users have created their own MB-System presentations, how-to documents, and even some quite good how-to videos. </li>
-</ul>
-<ul>
-  <li><strong>Hold MB-System workshops to assist groups that want to develop data format modules and applications and for user training. </strong>
-    <br>
-    We proposed to hold annual workshops intended for 10-20 participants each. During years 1, 3, and 5 we intended to hold developer workshops at MBARI. During years 2 and 4 we intended to hold user workshops at LDEO.
-    <ul>
-      <li>NSF was unable to fund these workshops</li>
-      <li>We are looking for alternative support for at least some workshops.</li>
-    </ul>
-  </li>
-</ul>
-<center>
-  <p><br>
-Last Updated: $Id: mbsystem_future.html 2135 2013-08-07 23:29:13Z caress $</p>
-</center>
-<p>
-</p>
-<hr width="67%">
-<p><a href="mbsystem_home.html"><img align="bottom" width="158"
- height="55" border="0" src="mbsystem_logo_small.gif"></a><a
- href="mbsystem_home.html">Back
-to MB-System Home Page...</a>
-</p>
-</body>
-</html>
diff --git a/html/mbsystem_home.html b/html/mbsystem_home.html
deleted file mode 100644
index e1c1169..0000000
--- a/html/mbsystem_home.html
+++ /dev/null
@@ -1,312 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
-<html>
-<head>
-  <title>MB-System Documentation</title>
-  <meta http-equiv="Content-Type" content="text/html">
-  <meta name="Title" content="MB-System: Mapping the Seafloor">
-  <meta name="Author" content="David Caress, Dale Chayes">
-  <meta name="Description"
- content="open source software for processing bathymetry and backscatter data from multibeam and sidescan sonar">
-  <meta name="Keywords"
- content="seafloor,mapping,multibeam,sonar,bathymetry,sidescan,swath processing,open,source,software">
-</head>
-<body alink="#cc9900" bgcolor="#ffffff" link="#336699" text="#000000"
- vlink="#997040">
-<h2 align="center"><img src="mbsystem_logo.gif" height="207" width="616"></h2>
-<center>
-<dl>
-  <dt><b><font size="+2">Seafloor Mapping Software:</font></b></dt>
-</dl>
-</center>
-<center>
-<dl>
-  <dt><b><font size="+2">Processing and Display</font></b></dt>
-</dl>
-</center>
-<center>
-<dl>
-  <dt><b><font size="+2">of Swath Sonar Data</font></b></dt>
-</dl>
-</center>
-<center>
-<dl>
-  <dt><b> </b></dt>
-</dl>
-</center>
-<center>
-<dl>
-  <dt><b><font size="+1"><a href="http://www.mbari.org/staff/caress">David
-W. Caress</a> (1) and <a href="http://www.ldeo.columbia.edu/%7Edale">Dale
-N. Chayes</a> (2)</font></b></dt>
-</dl>
-</center>
-<center>
-<dl>
-  <dt><b>1. <a href="http://www.mbari.org/">Monterey Bay Aquarium
-Research Institute</a></b></dt>
-</dl>
-</center>
-<center>
-<dl>
-  <dt><b>2. <a href="http://www.ldeo.columbia.edu/">Lamont-Doherty
-Earth Observatory</a></b></dt>
-</dl>
-</center>
-<center>
-<dl>
-  <dt><b>of <a href="http://www.columbia.edu/">Columbia University</a></b></dt>
-</dl>
-</center>
-<center>
-<p></p>
-<hr width="67%">
-<p></p>
-</center>
-<center>
-<dl>
-  <dt><b><font size="+1">Introduction</font></b></dt>
-</dl>
-</center>
-<p>MB-System is an open source software package for the processing and
-display of bathymetry and backscatter imagery data derived from
-multibeam,
-interferometry, and sidescan sonars. This software is distributed
-freely (and
-for free) in the form of source code for Unix platforms. The heart of
-the
-system is an input/output library called MBIO which allows programs to
-work
-transparently with any of a number of supported swath sonar data
-formats.
-This approach has allowed the creation of "generic" utilities which can
-be
-applied in a uniform manner to sonar data from a variety of sources.
-Most of
-the programs are command-line tools, but the package does include
-graphical
-tools for editing swath bathymetry, editing navigation, modeling
-bathymetry
-calculation, and adjusting survey navigation.</p>
-<p>The acronym MB stands for MultiBeam; this reflects the fact that the
-early
-development of MB-System focused on processing data from deep sea multibeam sonars (which were the only kind around back then). However, MB-System now supports several data formats from
-sidescan
-and interferometric sonars and works with data from all depth ranges.</p>
-<p>The <a href="http://www.nsf.gov">National Science Foundation</a>
-(NSF) has
-been the primary supporter of MB-System development. NSF initially
-provided
-grants to the authors at the <a href="http://www.ldeo.columbia.edu">
-Lamont-Doherty Earth Observatory</a> in 1993 (two years), and 1995
-(five
-years). <a href="http://www.seabeam.com/"> SeaBeam Instruments</a>
-also
-contributed significant effort from 1994 to 1999. This support has been
-renewed
-through successive parallel five year grants (2001-2006, 2006-2011, 2013-2017) to Caress at the <a
- href="http://www.mbari.org"> Monterey Bay Aquarium Research Institute</a>
-(MBARI) and to Chayes at Lamont. Since 2001, MBARI, with support from the Packard Foundation, has matched 
-the NSF support as part of its seafloor mapping program. </p>
-<p>The original NSF mandate was to create a set of generic tools which
-would
-work with all of the sonar data used in NSF-supported projects. Not
-surprisingly, the core of the MB-System user community consists of
-NSF-supported researchers at U.S. institutions such as the
-Lamont-Doherty
-Earth Observatory, the Scripps Institution of Oceanography, and the
-Woods
-Hole Oceanographic Institution. However, MB-System has also come to be
-used
-widely in the international marine geological community.</p>
-<p>The MB-System source code is distributed under the <a
- href="gpl.html"> GNU
-General Public License</a> as formulated by the <a
- href="http://www.gnu.org/">GNU Project.</a> MB-System
-installation depends on
-some other software packages (e.g. <a
- href="http://gmt.soest.hawaii.edu/"> GMT</a> and <a
- href="http://www.unidata.ucar.edu/software/netcdf/">netCDF</a> ), all of
-which are freely available as source code.</p>
-<p>This documention is distributed with and refers to the MB-System release
-with <a href="mbsystem_version.txt">this version</a>.</p>
-<center>
-<p></p>
-<hr width="67%">
-<p></p>
-</center>
-<center>
-<dl>
-  <dt><b><font size="+1">Information About MB-System:</font></b></dt>
-</dl>
-</center>
-<ul>
-  <li><a href="mbsystem_whatsnew.html">What's new in MB-System version 5</a></li>
-  <li><a href="mbsystem_capabilities.html">Short list of capabilities</a></li>
-  <li><a href="mbsystem_man_list.html">List of MB-System programs and
-links to manual pages</a></li>
-  <li><a href="mbsystem_formats.html">List of supported swath data
-formats</a></li>
-  <li><a href="mbsystem_how_to_get.html">How to get and install
-MB-System</a></li>
-  <li><a href="mbsystem_faq.html">Frequently Asked Questions (and
-answers)</a></li>
-  <li><a href="mbsystem_future.html">Future MB-System development plans</a></li>
-  <li><a href="mbsystem_copyright.html">Copyright and Caveat</a></li>
-</ul>
-<center>
-<p></p>
-<hr width="67%">
-<p></p>
-</center>
-<center>
-<center>
-<dl>
-  <dt><b><font size="+1">Contacting the MB-System Team:</font></b></dt>
-</dl>
-</center>
-<div style="text-align: justify;">
-Although the MB-System authors' personal email addresses are listed
-below, we
-greatly prefer that all inquiries, requests, and problem reports
-regarding
-MB-System be directed to the <a
- href="http://listserver.mbari.org/sympa/arc/mbsystem">MB-System
-Discussion list</a>.<br>
-<br>
-<span style="text-decoration: underline;"></span></div>
-<center>
-<hr width="67%"></center>
-<dl>
-  <dt><a name="MB-authors"></a> <b><font size="+1">The MB-System Core Team</font><font size="+1">:
-    </font></b></dt>
-</dl>
-</center>
-<center>
-<table cellpadding="0" cellspacing="0" width="100%">
-  <tbody>
-    <tr>
-      <td align="center" valign="top">
-      <dt><img alt="David W. Caress 2001" src="caress2001.gif" width="120"></dt>
-        <dt><b><a href="http://www.mbari.org/staff/caress">David W. Caress</a></b></dt>
-        <dt><a href="mailto:caress at mbari.org">caress at mbari.org</a></dt>
-        <dt>Software Engineer</dt>
-        <dt><a href="http://www.mbari.org">Monterey Bay Aquarium Research Institute</a></dt>
-        <dt>7700 Sandholdt Road</dt>
-        <dt>Moss Landing, CA 95039</dt>
-        <dt> </dt>
-      </td>
-    </tr>
-    <tr>
-      <td align="center" valign="top">
-      <dl>
-     <dt><img alt="Dale N. Chayes 2003" src="ChayesJul2003.gif" width="120"></dt>
-      <dt><b><a href="http://www.ldeo.columbia.edu/%7Edale">Dale N. Chayes</a></b></dt>
-        <dt><a href="mailto:dale at ldeo.columbia.edu">dale at ldeo.columbia.edu</a></dt>
-        <dt>Research Engineer</dt>
-        <dt><a href="http://www.ldeo.columbia.edu">Lamont-Doherty
-Earth Observatory</a> of <a href="http://www.columbia.edu">Columbia
-University</a></dt>
-        <dt>Palisades, NY 10964</dt>
-        <dd> </dd>
-      </dl>
-      </td>
-    </tr>
-    <tr>
-      <td align="center" valign="top">
-      <dt><img src="Christina_d_S_Ferreira_crop.jpg" width="120" alt="Christian dos Santos Ferreira 2014"></dt>
-      <dt><b><a href="https://www.marum.de/en/Christian_dos_Santos_Ferreira.html">Christian dos Santos Ferreira</a></b></dt>
-        <dt><a href="mailto:cferreira at marum.de">cferreira at marum.de</a></dt>
-        <dt>Seafloor Imaging Specialist<br>
-          <a href="http://www.marum.de">MARUM - Center for Marine Environmental Sciences</a><br>
-          <a href="http://www.uni-bremen.de">University of Bremen</a>, </dt>
-        <dt>Bremen, Germany</dt>
-        <dt> </dt>
-      </td>
-    </tr>
-  </tbody>
-</table>
-</center>
-<dd><br>
-</dd>
-<center>
-<p></p>
-<hr width="67%">
-<p></p>
-</center>
-<center>
-<dl>
-  <dt><a name="MB-documentors"></a> <b><font size="+1"> Documentation:</font></b></dt>
-</dl>
-</center>
-<center>
-
-<table cellpadding="0" cellspacing="0" width="100%">
-  <tbody>
-    <tr>
-      <td height="384" align="center" valign="top">
-      <div align="center">
-      <dt><img alt="Krystle Anderson 2013" src="KrystleAnderson2013.gif" width="120"></dt>
-        <dt><b>Krystle Anderson</b></dt>
-        <dt><a href="mailto:krystle at mbari.org">krystle at mbari.org</a></dt>
-        <dt>Research Technician</dt>
-        <dt><a href="http://www.mbari.org">Monterey Bay Aquarium Research Institute</a></dt>
-        <dt>7700 Sandholdt Road</dt>
-        <dt>Moss Landing, CA 95039</dt>
-        <dt> </dt>
-        <dt></dt>
-      </div>
-      <div align="center">
-      <dt><img alt="Val Schmidt at LDEO in July 2003" src="ValJul2003.gif" width="120"></dt>
-        <dt><b>Val Schmidt</b></dt>
-        <dt>(Emeritus)</dt>
-        <dt><a href="mailto:vschmidt at ccom.unh.edu">vschmidt at ccom.unh.edu</a></dt>
-        <dt>Research Engineer</dt>
-        <dt><a href="http://www.ccom.unh.edu">Center of Coastal and Ocean Mapping</a></dt>
-        <dt><a href="http://www.ccom.unh.edu">Joint Hydrographic Center</a> of</dt>
-        <dt><a href="http://www.unh.edu">University of New Hampshire</a></dt>
-        <dt>Durham, NH 03824</dt>
-      </div>
-      </td>
-    </tr>
-  </tbody>
-</table>
-</center>
-<center>
-<hr width="67%">
-<p></p>
-</center>
-<center>
-<dl>
-  <dt><a name="MB-team"></a> <b><font size="+1">The MB-System Team 2014:</font></b></dt>
-</dl>
-</center>
-<center>
-<dl>
-  <dt><b><font size="+1"><img alt="Ferreira, Caress, Chayes at MBARI February 2014" src="caress_chayes_ferreira_Feb2014.jpg"> </font></b></dt>
-</dl>
-</center>
-<center>
-<dl>
-  <dt><a name="MB-team"></a> <b><font size="+1">The MB-System Team circa 2003:</font></b></dt>
-</dl>
-</center>
-<center>
-<dl>
-  <dt><b><font size="+1"><img alt="July 2003 at IRI Building, LDEO" src="MBTeamJul2003.jpg"> </font></b></dt>
-</dl>
-</center>
-<dl>
-  <dt><br>
-  </dt>
-</dl>
-<center>
-<p>Last Updated: $Id: mbsystem_home.html 2180 2014-04-02 20:58:34Z caress $</p>
-</center>
-<p></p>
-<div align="center">
-<hr width="67%"></div>
-<br>
- 
-<p></p>
-</body>
-</html>
diff --git a/html/mbsystem_how_to_get.html b/html/mbsystem_how_to_get.html
deleted file mode 100644
index 9a2ffbe..0000000
--- a/html/mbsystem_how_to_get.html
+++ /dev/null
@@ -1,580 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
-<html>
-<head>
-  <title>How to Get and Install MB-System</title>
-  <meta content="text/html" http-equiv="Content-Type">
-  <meta content="MB-System: Mapping the Seafloor" name="Title">
-  <meta content="David Caress, Dale Chayes" name="Author">
-  <meta
- content="open source software for processing bathymetry and backscatter data from multibeam and sidescan sonar"
- name="Description">
-  <meta
- content="seafloor,mapping,multibeam,sonar,bathymetry,sidescan,swath processing,open,source,software"
- name="Keywords">
-</head>
-<body alink="#cc9900" vlink="#997040" link="#336699" bgcolor="#ffffff"
- text="#000000">
-<center>
-  <dd><a name="MB-get-and-install"></a><b><font size="+2">How to Get and Install MB-System</font></b></dd>
-</center>
-<ul>
-  <ul>
-<ul>
-    <li><a href="#MB-get">How to get the MB-System source distribution</a></li>
-    <li><a href="#Subversion">Access MB-System source version control system</a></li>
-    <li><a href="#MB-dist">Packaged MB-System distributions</a></li>
-    <li><a href="#MB-required">Other required and suggested software and data</a></li>
-    <li><a href="#MB-unpack">How to unpack an MB-System source code distribution</a></li>
-    <li><a href="#MB-install">How to install MB-System using the configure script</a></li>
-    <li><a href="#MB-install-old">How to install MB-System using the install_makefiles script</a></li>
-</ul>
-</ul>
-</ul>
-<center>
-<p></p>
-<hr width="67%">
-<p></p>
-</center>
-<center>
-  <dd><a name="MB-get"></a><b><font size="+2">How to Get The MB-System Source Distribution</font></b></dd>
-</center>
-<p>The source code for MB-System is available as a compressed tar
-archive
-by anonymous ftp to the Lamont-Doherty Earth Observatory of Columbia
-University.
-This archive file is about 3 megabytes in size and, depending on the
-speed of your internet connection, may take a few minutes to transfer.</p>
-<p>Click<a
- href="ftp://ftp.ldeo.columbia.edu/pub/MB-System/MB-System.tar.gz"> here to ftp</a> the current MB-System release as a compressed tar archive.</p>
-<p>Click <a href="ftp://ftp.ldeo.columbia.edu/pub/MB-System/">here to
-get point-and-click ftp access</a> to all of the MB-System related
-files
-available from Lamont (these may include data examples and beta
-distributions
-of MB-System ).</p>
-<p>If access through the above links fails, try running ftp from a
-terminal shell.
-The following commands represent a typical anonymous ftp session (note
-that
-your at email.address literally means to enter your email address, and that many modern ftp clients do not require the "binary" command).</p>
-<ul>
-  % ftp ftp.ldeo.columbia.edu<br>
-Name: anonymous<br>
-Password: your at email.address<br>
-> cd pub/MB-System<br>
-> binary<br>
-> get MB-System.tar.gz<br>
-> quit<br>
-</ul>
-If anonymous ftp fails with an error message like: "Sorry no DNS entry"
-after the email address is entered as the anonymous password, this
-means that the internet address (also called IP address) of the
-computer in use is
-not known to the Lamont network to be legitimate. As a security
-measure,
-illegitimate IP addresses are not allowed to connect to the Lamont
-network.
-The Lamont ftp server attempts to look up or resolve IP addresses using
-the primary Domain Name Service (DNS) servers associated with the
-internet as a whole. So, this problem arises when computers use IP
-addresses are not properly registered with the global DNS servers. This
-situation sometimes
-exists for computers connecting through improperly configured firewalls
-or Network Address Translation (NAT) devices. Users facing this issue
-can often
-succeed by running ftp from a "better connected" server in their
-organization. Otherwise, they will need to contact their internet
-service
-provider or their network/computing support staff.
-
-<center>
-<p></p>
-<hr width="67%">
-<p></p>
-</center>
-<center>
-  <dt><b><font size="+2"><a name="Subversion" id="Subversion"></a>Access MB-System Source Version Control System</font></b></dt>
-</center>
-<dl>
-  <dt>
-The MB-System source code is archived and managed using  <a href="http://subversion.tigris.org/">Subversion</a>, an open source version control system. The MB-System and MB-Cookbook Subversion repositories can be browsed through a web interface at: </dt>
-  <dd><a href="http://svn.ilab.ldeo.columbia.edu/">http://svn.ilab.ldeo.columbia.edu/</a></dd>
-  <dt> </dt>
-  <dt>The MB-System repository is at:</dt>
-  <dd><a href="http://svn.ilab.ldeo.columbia.edu/listing.php?repname=MB-System">http://svn.ilab.ldeo.columbia.edu/listing.php?repname=MB-System</a></dd>
-  <dt>The entire repository, or individual files, can be downloaded through this web interface. Clicking the the link above to bring up the WebSVN interface showing the most recent revision to the MB-System code base, along with a list of paths including "branches", "tags", and "trunk". To download the entire code base, click on the "Download" link to the right of  "trunk". To browse the structure and download individual files, click on the "trunk" link. Users can build MB-System using t [...]
-</dl>
-
-
-<center>
-  <p></p>
-  <hr width="67%">
-  <p></p>
-</center>
-<center><a name="MB-dist"></a><b><font size="+2">Packaged MB-System Distributions</font></b></dd>
-</center>
-<p>MB-System is included in <a href="http://sites.google.com/site/poseidonlinux/">Poseidon Linux</a>, the "Scientific GNU/Linux". Poseidon is an Ubuntu Linux based distribution including a selection of open source software packages intended to support scientific research. In particular, it offers several specific tools in the areas of GIS, 3D Visualization, Mathematics, Statistics and several other fields of research.</p>
-  <p>MB-System has been packaged for MacOS X as part of the <a href="http://www.finkproject.org/">Fink Project</a>. The MB-System Fink package can be found at:</p>
-<dd><a href="http://pdb.finkproject.org/pdb/package.php/mbsystem">http://pdb.finkproject.org/pdb/package.php/mbsystem</a></dd>
-  <p>MB-System has also been packaged for MacOs X as part of <a href="http://brew.sh">Homebrew</a>.
- If you have Homebrew installed, then MB-System and its prerequisites can be installed using these two commands:</p>
-<dd>brew tap homebrew/science</dd>
-<dd>brew install mbsystem</dd>
-<p>The <a href="http://live.osgeo.org/">OSGeo-Live</a>
-  distribution includes MB-System. OSGeo-Live is a self-contained bootable DVD, USB thumb drive or Virtual Machine based on <a href="http://xubuntu.org">Xubuntu</a> that includes a wide variety of open source geospatial software.
-<p>The <a href="http://www.sio.ucsd.edu/">Scripps Institution of Oceanography</a>'s <a href="https://scripps.ucsd.edu/ships/shipboard-technical-support/">Shipboard Technical Support</a> group maintains a repository of open source software RPM distributions for Red Hat Enterprise Linux and CentOS Linux. This repository includes both source and binary distributions of MB-System, GMT, and netCDF that can be accessed using the yum utility. The MB-System RPMs require the GMT and netCDF RPMs,  [...]
-  This repository can be found at:
-<ul>
-    <a href="http://sts.ucsd.edu/repos/centos-5/local">http://sts.ucsd.edu/repos/centos-5/local</a>
-</ul>
-  The SIO-STS gpg signing key is
-  <ul>
-    <a href="http://sts.ucsd.edu/repos/centos-5/local/RPM-GPG-KEY-STS">http://sts.ucsd.edu/repos/centos-5/local/RPM-GPG-KEY-STS</a>
-  </ul>
-<p>Thanks to Christian Ferreira for creating and distributing Poseidon Linux, to Kurt Schwehr for maintaing the Fink MB-System package, to Anthony Lukach for maintaining the Homebrew MB-System package, to Hamish Bowman for maintaining the OSGeo-Live MB-System package, and to Frank Delahoyde for maintaining the CentOS MB-System RPM distribution.</p>
-<center>
-  <p></p>
-  <hr width="67%">
-  <p></p>
-</center>
-
-<center><dd><a name="MB-required"></a><b><font size="+2">Other Required
-and
-Suggested Software and Data</font></b></dd>
-</center>
-<p>MB-System requires a number of other software packages and databases
-to be fully functional. These are:</p>
-<ul>
-  <li><b>GMT</b> version 4.5 or later: MB-System makes use of the
-Generic
-Mapping Tools (GMT) libraries and programs for much of its graphics.
-GMT
-also includes a detailed global coastline database. GMT has been
-developed
-by Professor Paul Wessel of SOEST (School of Ocean and Earth Science
-and
-Technology at the Univeristy of Hawaii) and Dr. Walter H. F. Smith of
-NOAA.
-The GMT source code is available from the <a
- href="http://gmt.soest.hawaii.edu/">GMT
-web page</a>.</li>
-  <li><b>NetCDF</b> version 3.5.1 or later: Both GMT and MB-System
-require
-the <a href="http://www.unidata.ucar.edu/software/netcdf/">NCAR
-netCDF
-library</a>.</li>
-  <li><b>Perl</b> version 5.0 or later: Perl is a fast, well
-documented
-scripting language used widely in the Linux/Unix world. MB-System contains a
-number of perl scripts used both for installation and to ease common
-tasks. Most of the current Unix operating systems include perl. If
-you need to obtain the perl source code, first check with your local
-system administrator - you will probably find perl already available
-locally. The perl source code can be obtained from the
-<a href="http://www.gnu.org/directory">GNU
-software archives</a> of the <a href="http://www.gnu.org">Free
-Software Foundation</a>.</li>
-  <li><b>Perl</b> Parallel-Forkmanager module: this Perl module is required for the
-  parallel processing macros mbm_multicopy, mbm_multidatalist, and mbm_multiprocess
-  to work. An easily installed package is available from from www.cpan.org.</li>
-  <li><b>X11</b>: The interactive graphical utilities in MB-System (MBedit, MBnavedit, MBvelocitytool, MBgrdviz, MBeditviz) use and require the X11 windowing system. </li>
-  <li><b>Motif</b>: The interactive graphical utilities in MB-System (MBedit, MBnavedit, MBvelocitytool, MBgrdviz, MBeditviz) use version 2 of the Motif widget set, and Motif libraries
-    are required for these utilities to be built and to run.
-    Most current Unix/Linux operating systems include the required Motif
-    libraries, either in the original proprietary form (Motif), or the not-quite-open-source form (OpenMotif). If you do not have these libraries, the OpenMotif 2 source is available through
-    <a href="http://www.openmotif.org/">Motifzone</a>. An old alternative open source Motif-compatible
-    distribution called <a href="http://www.lesstif.org">LessTif </a>does not work with the new OpenGL based MB-System programs (MBgrdviz, MBeditviz) and should be avoided. </li>
-  <li><b>Levitus Database</b>: The MB-System program mblevitus depends
-on
-a 16 MByte data file that is not included in the MB-System tarfile.
-Click
-    <a href="ftp://ftp.ldeo.columbia.edu/pub/MB-System/annual.gz">here</a>
-to ftp this file. Be sure to uncompress the file and to set the
-"LEVITUS"
-flag in the install_makefiles appropriately, as described below in the
-installation section.</li>
-  <li><strong>FFTW</strong>: The "Fastest Fourier Transform in the West" package is used by the sonagram calculation program MBbsegypsd to calculate, well, Fast Fourier Transforms. <a href="http://www.fftw.org/">FFTW</a> is commonly used and thus available on or for most current Unix operating systems.</li>
-  <li><strong>OTPSnc</strong>: The Oregon State Ocean Tide Prediction Software package is required for the tidal modeling program MBotps (which in fact is just a convenient front end for the old-style-batch interface of OTPS). The OTPSnc package can be obtained from the<a href="http://www.oce.orst.edu/research/po/research/tide/"> tidal modeling group</a> at <a href="http://www.oce.orst.edu/">Oregon State University</a>.</li>
-</ul>
-<p>MB-System produces Postscript based graphics. Most current Unix
-operating
-systems provide a program which serves as a screen-based Postscript
-viewer.
-If you do not have a Postscript viewer, one option is to obtain one of
-several Ghostscript-based
-packages from the Free Software Foundation.</p>
-<ul>
-  <li><b>ghostview</b>: Open source screen Postscript viewer. The
-source code can be obtained from the <a
- href="http://www.gnu.org/directory">GNU
-software archives</a> of the <a href="http://www.gnu.org">Free
-Software
-Foundation</a>.</li>
-</ul>
-<ul>
-  <li><b>gv</b>: Open source screen Postscript viewer. This
-package is a bit more sophisticated than ghostview and can handle
-poster-sized plots. The
-source code can be obtained from the <a
- href="http://www.gnu.org/directory">GNU
-software archives</a> of the <a href="http://www.gnu.org">Free
-Software
-Foundation</a>.</li></ul>
-<p>Users of MacOs X should note that many of the above packages can be
-painlessly installed using the fink package available from the
-<a href="http://fink.sourceforge.net/">Fink Project</a>.</p>
-<center>
-<p></p>
-<hr width="67%">
-</center>
-<center>
-<p><a name="MB-unpack"></a><b><font size="+2">How to Unpack an MB-System Source Code Distribution</font></b></p>
-</center>
-<p>The MB-System source code is extracted from the distribution using the tar utility:</p>
-<ul>
-  <pre>tar xvzf MB-System.tar.gz</pre>
-</ul>
-<p>or for some older systems with feature-limited versions of tar, a combination of gunzip and tar:</p>
-<ul>
-  <pre>gunzip MB-System.tar.gz
-tar xvf MB-System.tar</pre>
-</ul>
-<p>This will create a directory called (for the 5.4.2035 distribution): </p>
-<ul>
-  <pre>mbsystem-5.4.2136</pre>
-</ul>
-<p>In order to build and install MB-System from an interactive shell, you need to change your current directory to the distribution:</p>
-<ul>
-  <pre>cd mbsystem-5.4.2136</pre>
-</ul>
-<center>
-<p></p>
-<hr width="67%">
-</center>
-<center>
-<p><a name="MB-install"></a><b><font size="+2">How to Install MB-System Using the Configure Script</font></b></p>
-</center>
-<p>The configure script has been generated using the autoconf package. The current configure script does not resolve all of the flags and locations needed to build MB-System on all platforms, but does allow for flexible installation and generation and use of shared libraries without requiring interactive editing. These improvements make MB-System distributions much more amenable to inclusion in package manager systems like Debian and Fink. We hope to improve the configure script so that  [...]
-<p>The basic steps for building MB-System using the configure script are:</p>
-<p>1. Move to the top of the MB-System distribution directory:</p>
-<ul>
-        cd mbsystem-5.4.2176
-</ul>
-
-<p>2. Run the configure script to generate the Makefile files throughout the
-    distribution directory structure. The command line options for configure
-    are discussed below.</p>
-<ul>
-        [...pre-options...]./configure [...options...]
-</ul>
-
-    3. Run the make utility to build the software within the source distribution.
-<ul>
-        make
-</ul>
-
-    4. Run the make utility with the install option to install the software
-    within the target location that was specified while running configure. This step copies the libraries, programs, scripts, manual pages, and web pages to the target destinations.
-    <ul>
-        make install
-</ul>
-<p>The configure script is intended to discern the enviroment, locate prerequisite
-packages, and construct the makefiles with a minimum of user intervention. In
-practice, users generally need to set at least some options when using the
-configure script in order to successfully build, install, and run MB-System.
-If NetCDF and GMT installations cannot be located, MB-System cannot be built. If
-FFTW3, Motif, or OpenGL cannot be found MB-System will be built, but without
-the applications that depend on these packages.</p>
-<p>Depending on how user permissions are set on your system and where the package is to be installed, it may be necessary to execute some or all of the above commands with superuser privileges. On older styles of Unix and Linux, this was typically accomplished by using the su command to become root, or superuser, a step that requires knowing the root password for the system. Following a successful invocation of su in a command shell, all commands have superuser privileges. On MacOsX and  [...]
-<ul>
-  <pre>sudo ./configure
-sudo make
-sudo make install</pre>
-</ul>
-<p>The default destination is /usr/local, and so one should find the MB-System executable programs and scripts in /usr/local/bin, the shared libraries in /usr/local/lib, the manual pages in /usr/local/man, and the projection and Levitus databases accessed by MB-System in /usr/local/share/mbsystem. However, one can control the installation destination of the configure script on the command line by using a "--prefix" argument. For example, to install MB-System into /Users/caress/sandbox/mb [...]
-<ul>
-  <pre>sudo ./configure \
---prefix=/Users/caress/sandbox/mbsystem
-</pre>
-</ul>
-<p>The complete list of configure's installation location options is:</p>
-<ul>
-<pre>
---prefix 				This is the common installation prefix for all files.
- 						If exec_prefix is defined to a different value, prefix
- 						is used only for architecture-independent files.
- 						[Default: /usr/local]
---exec_prefix 			The installation prefix for architecture-dependent files.
-						By default it's the same as prefix. You should avoid
-						installing anything directly to exec_prefix. However,
-						the default value for directories containing
-						architecture-dependent files should be relative to
-						exec_prefix.
-						[Default: ${prefix} ==> /usr/local]
---datarootdir 			The root of the directory tree for read-only architecture
-						-independent data files.
-						[Default: ${exec_prefix}/share ==> /usr/local/share]
---bindir 				The directory for installing executables that users run.
-						[Default: ${exec_prefix}/bin ==> /usr/local/bin]
---libdir 				The directory for installing object code libraries.
-						[Default: ${exec_prefix}/lib ==> /usr/local/lib]
---includedir 			The directory for installing C header files.
-						[Default: ${exec_prefix}/include ==> /usr/local/include]
-</pre>
-</ul>
-<p>MB-System depends on librarys from a number of different packages, including NetCDF, GMT, FFTW3, X11, and Motif. Sometimes a user will have more than one installation of a package available, and specifying which is used is desirable. Also, unfortunately the configure script does not always successfully find all needed packages. Consequently, the configure script allows users to set the locations on the command line when necessary. 
-The configure command line options controlling the locations of prerequisites are:</p>
-<ul>
-<pre>
---with-netcdf-lib 		Location of NetCDF libs
---with-netcdf-include 	Location of NetCDF headers
---with-gmt-lib 		Location of GMT libs
---with-gmt-include 	Location of GMT headers
---with-fftw-lib 		Location of FFTW3 libs (optional)
---with-fftw-include 	Location of FFTW3 headers (optional)
---with-motif-lib 		Location of Motif libs (optional)
---with-motif-include 	Location of Motif headers (optional)
---with-opengl-lib 		Location of OpenGL libs (optional)
---with-opengl-include 	Location of OpenGL headers (optional)
---with-otps-dir		Location of OTPS installation (optional)
-</pre>
-</ul>
-<p>The MB-System distribution includes the source code for the GSF and the PROJ4 packages. By default, the configure script seeks to build the GSF library as libmbgsf and seeks to link with a libproj built external to MB-System. Configure accepts commands to build MB-System without GSF or to use the included PROJ4 source.</p>
-<ul>
-<pre>
---without-gsf			Build without including or supporting GSF
-						The default is to build the bundled 
-						gsf library as libmbgsf and link with it
---enable-bundledproj	Build using bundled proj package - the
-						default is to link with libproj
-</pre>
-</ul>
-<p>Note that specification of FFTW3, Motif, and OpenGL is optional. If the configure script does not find these packages and the user does not specify their locations, then some MB-System programs will not be built. Lack of FFTW3 means that mbsegypsd is not built. No OpenGL results in the visualization programs mbgrdviz and mbeditviz not being built. Lack of Motif means that no graphical programs of any type are built. </p>
-
-<strong>Mac OS X</strong>
-<p>Many MacOsX users have their NetCDF, GMT, FFTW3, and OpenMotif installations through the Fink package manager, which installs packages in /sw. The configure script fails to find packages in /sw, and so the user must explicitly specify those packages. The OTPS tide modeling software used by mbotps is not packaged in Fink, and so must be manually installed by a user if mbotps is to work correctly. Installation of MB-System on a Mac running MacOsX 10.9 will likely use a configure command [...]
-<ul>
-<pre>
-sudo CFLAGS="-I/opt/X11/include -L/opt/X11/lib" \
-./configure \
-    --with-netcdf-include=/sw/include \
-    --with-netcdf-lib=/sw/lib \
-    --with-gmt-include=/sw/include \
-    --with-gmt-lib=/sw/lib \
-    --with-proj-include=/sw/include \
-    --with-proj-lib=/sw/lib \
-    --with-fftw-include=/sw/include \
-    --with-fftw-lib=/sw/lib \
-    --with-motif-include=/sw/include \
-    --with-motif-lib=/sw/lib \
-    --with-otps-dir=/usr/local/tides/OTPS2
-</pre>
-</ul>
-<p>As shown here, one can also add to the commands seen by the compiler ("CFLAGS") and linker ("LDFLAGS") if desired or necessary by prefacing the configure command with arguments setting the environment variables CFLAGS and LDFLAGS. Here the current location of X11 header files and libraries must be specified because the new (to MacOsX) location of X11 in /opt is not known to the configure script. Another example is that in order to compile MB-System for user with a debugger, all compil [...]
-<ul>
-<pre>
-sudo CFLAGS="-g -I/opt/X11/include -L/opt/X11/lib" \
-./configure \
-    --with-netcdf-include=/sw/include \
-    --with-netcdf-lib=/sw/lib \
-    --with-gmt-include=/sw/include \
-    --with-gmt-lib=/sw/lib \
-    --with-proj-include=/sw/include \
-    --with-proj-lib=/sw/lib \
-    --with-fftw-include=/sw/include \
-    --with-fftw-lib=/sw/lib \
-    --with-motif-include=/sw/include \
-    --with-motif-lib=/sw/lib \
-    --with-otps-dir=/usr/local/tides/OTPS2
-</pre>
-</ul>
-
-<strong>Ubuntu Linux</strong>
-<p>For Ubuntu Linux 12.04.02LTS, the following use of the apt-get utility will install 
-all of the MB-System prerequisites excepting OTPS:</p>
-<ul>
-<pre>
-sudo apt-get install xorg-dev libmotif-dev libmotif4 libxp-dev mesa-common-dev \
-    libsdl1.2-dev libsdl-image1.2-dev build-essential gfortran \
-    nautilus-open-terminal libfftw3-3 libfftw3-dev \
-    libnetcdf-dev netcdf-bin gdal-bin gdal1-dev gmt libgmt-dev gv
-</pre>
-</ul>
-<p>Because GMT is installed in an unusual way on Ubuntu, it is necessary to augment 
-the PATH and LD_LIBRARY_PATH environment variables by adding the following two
-lines to each user's ~/.bashrc file:</p>
-<ul>
-<pre>
-export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
-export PATH=/usr/lib/gmt/bin:$PATH
-</pre>
-</ul>
-
-<p>By default, the Ubuntu GMT installation is not known to pkg-config, and the installation
-points of the libraries and the header files must be specified:</p>
-<ul>
-  <pre>
-sudo ./configure --prefix=/usr/local \
-    --with-gmt-include=/usr/include/gmt \
-    --with-gmt-lib=/usr/lib
-</pre></ul>
-<p> Although the GMT installation does not include a pkg-config *.pc file, 
-it is simple to construct one. On Ubuntu pkg-config looks in /usr/lib/pkgconfig,
-so one can put a file there called gmt.pc with the contents:
-<ul><pre>
-# start gmt.pc
-prefix=/usr
-exec_prefix=${prefix}
-libdir=${exec_prefix}/lib
-includedir=${prefix}/include/gmt
-ccompiler=gcc
-cppcompiler=g++
-
-Name: gmt
-Description: GMT Libraries
-Version: 4.5.6
-Libs: -L${libdir} -lgmt -lgmtps -lpsl
-Cflags: -I${includedir}
-# end gmt.pc
-</pre></ul>
-
-<p>
-If the GMT installation has been augmented with a /usr/lib/pkgconfig/gmt.pc
-file so that pkg-config knows about GMT, then the configure call to install
-in /usr/local is just: </p>
-<ul>
-  <pre>
-sudo ./configure
-</pre></ul>
-
-<strong>CentOs or Red Hat Linux</strong> 
-
-<p>The package manager usually used on CentOs or Red Hat Linux systems is yum. To install 
-all of the MB-System prerequisites use the command:</p>
-<ul><pre>
-sudo yum install openmotif openmotif-devel fftw fftw-devel netcdf netcdf-devel \
-		proj proj-devel gdal-devel gmt gmt-devel gv nedit
-</pre></ul>
-
-<p>If the prerequisites have all been installed with yum and it is desired to
-install MB-System in /usr/local, then only a simple call to configure is required:</p>
-<ul>
-  <pre>
-sudo ./configure
-</pre></ul>
-
-<center>
-  <p></p>
-<hr width="67%">
-</center>
-<center>
-<p><a name="MB-install-old"></a><b><font size="+2">How to Install MB-System Using the Install_makefiles Script</font></b></p>
-</center>
-<p>For over two decades, the only means to build MB-System distributions was a crude Perl script called install_makefiles that needed to be edited to set the operating system and the locations of prerequisite packages. Although a autoconf-type configure script is now provided, as described above, the old install_makefiles script is still included in the MB-System distribution and remains an alternative means to build and install MB-System.</p>
-<p>In order to
-use this alternative build system, you must edit the perl script
-mbsystem/install_makefiles, and set a number of parameters to reflect the system architecture, the location of the installation, and the locations of certain required libraries.
-This script will read template makefiles in the MB-System
-source
-directories and create makefiles with the correct dependencies, compile flags, and link flags. The important parameters to be set in install_makefiles are listed below. The install_makefiles script includes comments suggesting parameters to use for many common computer systems.</p>
-<p>These parameters must be set for all installations:</p>
-<ul>
-  <li> MBSYSTEM_HOME	- Absolute path to the directory containing install_makefiles.</li>
-  <li>OS		- Operating system (Recognized options are: DARWIN, LINUX, CYGWIN, SUN, IRIX, IRIX64, SOLARIS, HPUX, LYNX, CYGWIN or OTHER).</li>
-  <li>CFLAGS		- Compile flags for C source files. These vary with different operating systems and installations.</li>
-  <li>LFLAGS		- Load flags for all object files.</li>
-  <li>NETCDFLIBDIR	- Location of NetCDF library libnetcdf.a</li>
-  <li>NETCDFINCDIR	- Location of NetCDF include file netcdf.h</li>
-  <li>GMTLIBDIR-	Location of GMT libraries libgmt.a and libpsl.a</li>
-  <li>GMTINCDIR	- Location of GMT include files gmt.h, grd.h, and pslib.h</li>
-  <li>LEVITUS		- Path of Levitus global water properties data file. This is usually $MBSYSTEM_HOME/share/annual.</li>
-  <li>PROJECTIONS	- Path of PROJ4 projections database. This is usually $MBSYSTEM_HOME/share/Projections.dat.<br>
-  </li>
-</ul>
-<p>These two parameters are required to build the graphical tools mbedit, mbnavedit, mbvelocitytool, mbnavadjust,                                mbgrdviz, and mbeditviz. If these parameters are not both set, no graphical tools will be built.</p>
-<ul>
-  <li>MOTIFINCDIR	- Location of Motif include files.</li>
-  <li>MOTIFLIBS	- X11 and Motif libraries required for graphical tools.<br>
-  </li>
-</ul>
-<p>This parameter must be set to build the  openGL tools mbgrdviz and mbeditviz:</p>
-<ul>
-  <li>OPENGLLIBS	- OpenGL libraries required for new graphical tools, including mbgrdviz and mbeditviz. If this parameter is not set, mbgrdviz and mbeditviz will not be built<br>
-  </li>
-</ul>
-<p>This parameter must be set to build the sonogram calculation program mbsegypsd:</p>
-<ul>
-  <li>FFTWLIBDIR	- location of FFTW library providing fast Fourier transform.</li>
-  <li>FFTWINCDIR - location of FFTW include files</li>
-</ul>
-<p>This parameter must be set for the tidal modeling program mbotps to work:</p>
-<ul>
-  <li>OTPSDIR	- location of OTPSnc tide prediction program predict_tide.</li>
-</ul>
-<p>This optional parameter can be used to specify a  non-default C compiler:</p>
-<ul>
-  <li>CC		- C compiler to be used.<br>
-  </li>
-</ul>
-<p>These optional parameters can be used to  specify linking with an independent installation of the PROJ4 library. In this case, the PROJ4 library included with MB-System will not be built.</p>
-<ul>
-  <li>PROJLIB         - Path to PROJ4 library (usually libproj.a)</li>
-  <li>PROJINCDIR      - Location of PROJ4 include file proj_api.h<br>
-  </li>
-</ul>
-<p>These optional parameters can be used to  specify linking with an independent installation of the GSF library. In this case, the GSF library included with MB-System will not be built.</p>
-<ul>
-  <li>GSFLIB          - Path to GSF library (usually libgsf.a)</li>
-  <li>GSFINCDIR       - Location of GSF include file gsf.h</li>
-</ul>
-<p>To
-  execute
-  install_makefiles, do the following:</p>
-<ul>
-  <pre>% cd mbsystem-5.3.1955 </pre>
-  <pre>% install_makefiles</pre>
-</ul>
-<p>Because install_makefiles is a perl script, the executable perl must
-be available in the installer's path. Once install_makefiles has been
-correctly
-configured and run, give the command "make all" to generate the
-executable programs:</p>
-<ul>
-  <pre>% make all</pre>
-</ul>
-<p>The make command will descend recursively down through the directory
-structure, compiling source files, linking object files, and copying
-executables
-and manual pages to the appropriate directories. The executables will
-be
-placed in mbsystem-5.1.3/bin, the libraries in mbsystem-5.1.3/lib, and
-the manual pages
-in mbsystem-5.1.3/man/man1.</p>
-<p>Naturally, in order for users to use the MB-System utilities, the
-directory
-containing the executables must be included in their path. Altering the user path variable is generally accomplished by editing the initialization files hidden in the user's home directory. Which files need to be edited depends on which command line shell is being used. If the user works with <em>csh</em>, then the <em>.cshrc</em> and <em>.login </em>files need to be changed. If the shell is <em>bash</em>, then the <em>.bashrc</em> and <em>.profile</em> files must be altered. See the man [...]
-executable
-<em>perl</em> must also be available in the user's path for most of the macros
-to
-work.</p>
-<p>Most users will also wish to specify which program they generally
-use
-to view Postscript plots on their screen. This parameter is set
-
-with the mbdefaults program (see the mbdefaults manual page for
-details).
-Popular open source options for Postscript display include ghostview and gv. The postscript plots can also be imported into proprietary tools like Adobe Illustrator, Adobe Acrobat, or Preview on MacOs X. On old Unix machines,  pageview worked well on Sun workstations running Solaris, and xpsview on on Silicon
-Graphics machines running Irix.</p>
-<center>
-<p><br>
-Last Updated: $Id: mbsystem_how_to_get.html 2185 2014-05-11 06:34:36Z caress $</p>
-</center>
-<p>
-</p>
-<hr width="67%">
-<p></p>
-<p><a href="mbsystem_home.html"><img width="158" height="55" border="0"
- src="mbsystem_logo_small.gif"></a><a href="mbsystem_home.html">Back
-to MB-System Home Page...</a></p>
-</body>
-</html>
diff --git a/html/mbsystem_logo.gif b/html/mbsystem_logo.gif
deleted file mode 100644
index d07c130..0000000
Binary files a/html/mbsystem_logo.gif and /dev/null differ
diff --git a/html/mbsystem_logo_small.gif b/html/mbsystem_logo_small.gif
deleted file mode 100644
index 780b161..0000000
Binary files a/html/mbsystem_logo_small.gif and /dev/null differ
diff --git a/html/mbsystem_man_list.html b/html/mbsystem_man_list.html
deleted file mode 100644
index 64fa019..0000000
--- a/html/mbsystem_man_list.html
+++ /dev/null
@@ -1,267 +0,0 @@
-<!DOCTYPE html PUBLIC "-//w3c//dtd html 4.0 transitional//en">
-<html>
-<head>
-  <title>List of MB-System Programs</title>
-  <meta http-equiv="Content-Type" content="text/html">
-  <meta name="Title" content="MB-System: Mapping the Seafloor">
-  <meta name="Author" content="David Caress, Dale Chayes">
-  <meta name="Description"
- content="open source software for processing bathymetry and backscatter data from multibeam and sidescan sonar">
-  <meta name="Keywords"
- content="seafloor,mapping,multibeam,sonar,bathymetry,sidescan,swath processing,open,source,software">
-</head>
-<body alink="#cc9900" bgcolor="#ffffff" link="#336699" text="#000000"
- vlink="#997040">
-<center>
-<h4><u>List of MB-System Programs:</u></h4>
-</center>
-Manual Page for the MB-System package:
-<ul>
-  <li> <a href="mbsystem.html">mbsystem</a></li>
-</ul>
-Manual Page for the MB-System i/o library:
-<ul>
-  <li> <a href="mbio.html">mbio</a></li>
-</ul>
-These are the current MB-system programs with links to the Unix manual
-pages:
-<ul>
-  <li><a href="mbabsorption.html">mbabsorption</a>: Calculates water sound absorption as a function of water properties.</li>
-  <li> <a href="mbareaclean.html">mbareaclean</a>: Identifies and
-flags
-bad beams in swath
-sonar bathymetry data within a specified area.</li>
-  <li> <a href="mbauvloglist.html">mbauvloglist</a>: Generate
-arbitrary text lists of values from MBARI AUV mission log files.</li>
-  <li> <a href="mbauvnavusbl.html">mbauvnavusbl</a>: Merge inertial
-and surface tracking navigation for
-submerged sonar platforms (e.g. ROVs and AUVs).</li>
-  <li> <a href="mbbackangle.html">mbbackangle</a>: Generates corrections
-for sidescan and/or amplitude data by calculating average amplitudes
-as a function of the seafloor
-grazing angle.</li>
-  <li> <a href="mbclean.html">mbclean</a>: Identifies and flags bad
-beams in swath sonar bathymetry data.</li>
-  <li> <a href="mbcontour.html">mbcontour</a>: Generate GMT compatible
-Postscript
-color swath contour plots.</li>
-  <li> <a href="mbcopy.html">mbcopy</a>: Copy swath sonar data files.</li>
-  <li> <a href="mbctdlist.html">mbctdlist</a>: List CTD data in swath sonar data files.</li>
-  <li> <a href="mbdatalist.html">mbdatalist</a>: Parses recursive
-datalist
-files and outputs the
-complete list of data files and formats.</li>
-  <li> <a href="mbdefaults.html">mbdefaults</a>: Set or list default
-mbio
-parameters
-for reading and writing swath sonar data</li>
-  <li><a href="mbdumpesf.html">mbdumpesf</a>: mbdumpesf reads an MB-System edit save file and dumps the contents as an ascii table to stdout.</li>
-  <li> <a href="mbedit.html">mbedit</a>: Interactive editor used to
-flag
-bad beams
-in swath sonar bathymetry data.</li>
-  <li><a href="mbeditviz.html">mbeditviz</a>: Interactive 3D visualization bathymetry editing and attitude bias patch test.</li>
-  <li><a href="mbextractsegy.html">mbextractsegy</a>:
-    Extract subbottom profiler or center beam reflection data to segy files.</li>
-  <li><a href="mbfilter.html">mbfilter</a>:
-    Apply  one or more simple filters to sidescan and/or beam amplitude data.</li>
-  <li><a href="mbformat.html">mbformat</a>: List information about
-    swath
-    sonar
-  data formats supported by the MBIO library.</li>
-  <li> <a href="mbgetesf.html">mbgetesf</a>: Extract bathymetry edits
-in
-edit
-save file format.</li>
-  <li> <a href="mbgrdtiff.html">mbgrdtiff</a>: Generate TIFF image
-from
-gridded
-data.</li>
-  <li> <a href="mbgrdviz.html">mbgrdviz</a>: Vizualize GMT grids.</li>
-  <li> <a href="mbgrid.html">mbgrid</a>: Grid bathymetry, amplitude,
-and
-sidescan
-data from swath sonar data files.</li>
-  <li> <a href="mbhistogram.html">mbhistogram</a>: Obtain histogram of
-bathymetry,
-amplitude, or sidescan data from swath sonar data files.</li>
-  <li> <a href="mbhsdump.html">mbhsdump</a>: List raw information contained 
-  in Hydrosweep DS data files (formats 21 and 24).</li>
-  <li><a href="mbhysweeppreprocess.html">mbhysweeppreprocess</a>: Preprocess
-Hysweep HSX data (format 201), including applying time lag and biases to
-attitude and navigation data.</li>
-  <li> <a href="mbinfo.html">mbinfo</a>: Output some basic statistics
-    of
-    swath
-  sonar data files.</li>
-  <li> <a href="mbkongsbergpreprocess.html">mbkongsbergpreprocess</a>: performs
-    preprocessing of data from third generation Kongsberg
-    multibeam sonars (e.g. EM122, EM302, EM710).</li>
-  <li> <a href="mblevitus.html">mblevitus</a>: Create a water velocity
-profile
-which is representative of the mean annual water column for a specified
-1 degree by 1 degree region.</li>
-  <li> <a href="mblist.html">mblist</a>: List data in swath sonar data
-files.</li>
-  <li> <a href="mbmosaic.html">mbmosaic</a>: Mosaic sidescan and
-amplitude
-data.</li>
-  <li> <a href="mbnavadjust.html">mbnavadjust</a>: Package  that solves for optimal navigation by matching bathymetry of overlapping swathes.</li>
-  <li> <a href="mbnavadjustmerge.html">mbnavadjustmerge</a>: Merge two mbnavadjust projects.</li>
-  <li><a href="mbnavedit.html">mbnavedit</a>: Interactive editor used
-    to
-    fix
-  problems with navigation in swath sonar data files.</li>
-  <li><a href="mbnavlist.html">mbnavlist</a>: List navigation data in
-    swath sonar
-  data files.</li>
-  <li> <a href="mbneptune2esf.html">mbneptune2esf</a>: Extract
-    bathymetry edits from Simrad Neptune software into edit save file
-  format.</li>
-  <li><a href="mbotps.html">mbotps</a>: Generate open ocean tidal model for specified time and location using the Oregon State Tidal Prediction Software (OTPS) package.</li>
-  <li> <a href="mbprocess.html">mbprocess</a>: Process swath sonar
-data
-files, including
-merging navigation, applying bathymetry edits, recalculating
-bathymetry by raytracing, and applying a variety of other corrections.</li>
-  <li> <a href="mbps.html">mbps</a>: Simple perspective views of swath
-bathymetry
-in Postscript.</li>
-  <li> <a href="mbrollbias.html">mbrollbias</a>: Evaluate the roll bias of a
-swath sonar system using two pieces of coincident bathymetry data
-collected with opposing ship headings.</li>
-  <li><a href="mbrolltimelag.html">mbrolltimelag</a> Estimate attitude
-    time lag by cross correlation of apparent bottom slope with the roll
-    time series: </li>
-  <li><a href="mbroutetime.html">mbroutetime</a> Outputs a list of the times when a survey passes the waypoints of a planned survey route.</li>
-  <li><a href="mbsegygrid.html">mbsegygrid</a>:
-    Generate time vs. trace number grids of seismic data from segy files.<br>
-  </li>
-  <li><a href="mbsegyinfo.html">mbsegyinfo</a>:
-Output some basic statistics of segy seismic data files.</li>
-  <li><a href="mbsegylist.html">mbsegylist</a>:
-    List selected header values in segy seismic data files.</li>
-  <li><a href="mbsegypsd.html">mbsegypsd</a>:
-    Calculates the power spectral density function of each trace in a segy data file, outputting the results as a GMT grid file..</li>
-  <li><a href="mbset.html">mbset</a>:
-    Create and modify parameter files used
-  to control mbprocess.</li>
-  <li> <a href="mbstripnan.html">mbstripnan</a>: Filter to remove NaN
-nodes.</li>
-  <li> <a href="mbsvplist.html">mbsvplist</a>: Extract water sound
-velocity profiles
-(SVPs) from swath data files.</li>
-  <li> <a href="mbsvpselect.html">mbsvpselect</a>: Select the best
-available sound speed model for each swath file in a survey according to 
-user specified criteria.</li>
-  <li> <a href="mbswath.html">mbswath</a>: Generate GMT compatible
-Postscript
-color and color shaded relief swath plots.</li>
-  <li> <a href="mbswplspreprocess.html">mbswplspreprocess</a>: Preprocess
-SwathPlus SXP data (format 222), including applying time lag and biases to
-attitude and navigation data.</li>
-  <li> <a href="mbtime.html">mbtime</a>: Converts between calendar time
-and unix time.</li>
-  <li> <a href="mbvelocitytool.html">mbvelocitytool</a>: Interactive
-program for
-modeling the affect of the water velocity profile on swath sonar
-bathymetry
-calculations.</li>
-  <li> <a href="mb7k2jstar.html">mb7k2jstar</a>: Extract Jstar format
-(format 132) sidescan and subbottom data from Reson 7k (format 88) data
-files.</li>
-  <li> <a href="mb7k2ss.html">mb7k2ss</a>: mb7k2ss extracts Edgetech
-sidescan sonar data from Reson 7k format data, bins and lays the sidescan
-onto the seafloor, and outputs files in the MBF_MBLDEOIH formst (MBIO
-format id 71).</li>
-  <li> <a href="mb7kpreprocess.html">mb7kpreprocess</a>: Preprocess
-Reson 7k data (format 88), including applying time lag and biases to
-attitude and navigation data.</li>
-</ul>
-Macros are programs or shellscripts which make use of programs from the
-MB-System and other software packages to accomplish common tasks
-easily.
-These are the current MB-System macros:
-<ul>
-  <li> <a href="mbm_arc2grd.html">mbm_arc2grd</a>: Convert an ArcView
-ASCII grid
-file to a GMT grid file.</li>
-  <li> <a href="mbm_copy.html">mbm_copy</a>: Translate groups of swath
-data files between formats</li>
-  <li> <a href="mbm_bpr.html">mbm_bpr</a>: Process data from a Seabird SBE53 pressure sensor into a tidal model for
-       use by mbprocess.</li>
-  <li> <a href="mbm_fmtvel.html">mbm_fmtvel</a>: Scans a Hydrosweep swath sonar data file using the  program  mbhsdump  and generates  a list in columnar format with time, date, latitude, longitude, C-mean, and C-keel entrys.</li>
-  <li> <a href="mbm_grd2arc.html">mbm_grd2arc</a>: Convert a GMT grid
-    file to an ArcView ASCII grid file.</li>
-  <li> <a href="mbm_grd2geovrml.html">mbm_grd2geovrml</a>: Create and
-    execute commands which generate a TerraVision tileset and GeoVRML set
-    of files that can be combined with other data and viewed in a web
-  browser.</li>
-  <li> <a href="mbm_grd3dplot.html">mbm_grd3dplot</a>: Reads a GMT GRD
-    grid file
-    and writes a shellscript which will generate a GMT 3D perspective view
-    of the data.</li>
-  <li> <a href="mbm_grdcut.html">mbm_grdcut</a>: Extract a subarea of
-    a
-    GMT grid
-  file.</li>
-  <li><a href="mbm_grdinfo.html">mbm_grdinfo</a>: Get information
-regarding a GMT grd file when the region of interest is a
-subset of the area covered in the input file. </li>
-  <li> <a href="mbm_grdplot.html">mbm_grdplot</a>: Reads a GMT GRD
-grid file and writes a shellscript which will generate a GMT map of the data.</li>
-  <li> <a href="mbm_grdtiff.html">mbm_grdtiff</a>: Reads a GMT GRD
-grid file and writes a shellscript which will generate a TIFF image of the data.</li>
-  <li><a href="mbm_grid.html">mbm_grid</a>: Reads a swath sonar data
-    file and writes a shellscript which will grid bathymetry data or mosaic
-    sidescan (or amplitude) data using reasonable guesses at the appropriate
-  grid bounds and bin size.</li>
-  <li><a href="mbm_histplot.html">mbm_histplot</a>: Create an executable
-    shellscript which will generate a GMT histogram plot of a dataset.</li>
-  <li><a href="mbm_makedatalist.html">mbm_makedatalist</a>: Generates
-    an MB-System datalist file referencing all identifiable swath files in
-  the specified target directory.</li>
-  <li><a href="mbm_makesvp.html">mbm_makesvp</a>: Generate a sound velocity profile model from sound speed and depth values in swath files.</li>
-  <li> <a href="mbm_multicopy.html">mbm_multicopy</a>: Translate groups of swath
-data files between formats using parallel processes.</li>
-  <li><a href="mbm_multidatalist.html">mbm_multidatalist</a>: Generates
-  ancilliary files used in data managment using parallel processes.</li>
-  <li><a href="mbm_multiprocess.html">mbm_multiprocess</a>: Apply specified
-  processing tasks to a swath data file using parallel processes.</li>
-  <li> <a href="mbm_plot.html">mbm_plot</a>: Reads a swath sonar data
-file
-and
-writes a shellscript which will generate a swath and/or contour plot of
-the data.</li>
-  <li> <a href="mbm_route2mission.html">mbm_route2mission</a>:
-Translate an mbgrdviz survey route file into an MBARI AUV mission
-script.</li>
-  <li> <a href="mbm_stat.html">mbm_stat</a>: Runs mbinfo on a swath
-sonar data file and extracts beam statistics from the output of mbinfo.</li>
-  <li> <a href="mbm_utm.html">mbm_utm</a>: Performs forward and
-inverse
-UTM projections
-of ASCII data triples. </li>
-  <li> <a href="mbm_xbt.html">mbm_xbt</a>: Processes a Sparton XBT
-data
-file and
-outputs a sound velocity profile file which can be used to process
-swath
-sonar data.</li>
-  <li> <a href="mbm_xyplot.html">mbm_xyplot</a>: Reads one or more xy
-data
-files
-and writes a shellscript which will generate GMT plot of the data.</li>
-</ul>
-<center>Last Updated: $Id: mbsystem_man_list.html 2187 2014-05-28 23:56:32Z caress $
-</center>
-<p>
-</p>
-<hr width="67%">
-<p><a href="mbsystem_home.html"><img src="mbsystem_logo_small.gif"
- align="bottom" border="0" height="51" width="154"></a><a
- href="mbsystem_home.html">Back
-to MB-System Home Page...</a>
-</p>
-</body>
-</html>
diff --git a/html/mbsystem_whatsnew.html b/html/mbsystem_whatsnew.html
deleted file mode 100644
index 8b7200a..0000000
--- a/html/mbsystem_whatsnew.html
+++ /dev/null
@@ -1,393 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
-<HTML>
-<HEAD>
-   <TITLE>What's New in MB-System</TITLE>
-  <meta http-equiv="Content-Type" content="text/html">
-  <meta name="Title" content="MB-System: Mapping the Seafloor">
-  <meta name="Author" content="David Caress, Dale Chayes">
-  <meta name="Description" content="open source software for processing bathymetry and backscatter data from multibeam and sidescan sonar">
-  <meta name="Keywords" content="seafloor,mapping,multibeam,sonar,bathymetry,sidescan,swath processing,open,source,software">
-</HEAD>
-<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#336699" VLINK="#997040" ALINK="#CC9900">
-
-<H1 ALIGN=CENTER>What's New in MB-System Version 5.4</H1>
-
-<P>The version 5.4.x releases of MB-System includes a number of changes and
-improvements relative to the earlier version 5 releases. The most significant change is the addition of an autoconf-based build system including a configure script. A detailed listing of bug fixes and other changes is found in the <a href="ChangeLog.txt">ChangeLog</a> file. The most prominent particulars follow: </P>
-
-<UL>
-  <LI>New autoconf based build system.</LI>
-  
-  <UL>
-  <LI>The MB-System distribution now comes with a configure script that can be used to build the software without editing any files.</LI>
-  <LI>The configure script generates Makefiles that support installing the executables, libraries, header files, and man pages in locations outside the MB-System source directories (e.g. in /usr/local).</LI>
-  <LI>The configure script generated Makefiles build shared libraries.</LI>
-  <LI>The older "install_makefiles" build system is still included in the distribution, and can be used to build MB-System.</LI>
-  </UL>
-</UL>  
-<UL>
-  <LI>Support for several new data formats.</LI>
-  <UL>
-  <LI>SEA Swathplus interferometric sonar SXP data format is supported as format 222 (MBF_SWPLSSXP).</LI>
-  <LI>3DatDepth lidar data format is supported as format 231 (MBF_3DDEPTHP).</LI>
-  <LI>Electronic Navigation Ltd. WASSP multibeam sonar data format supported as format 241 (MBF_WASSPENL).</LI>
-  <LI>NGDC MGD77T data format for tab delimited underway marine geophysical data is supported as format 174 (MBF_MGD77TAB).</LI>
-  </UL>
-</UL>
-<UL>
-  <LI>New programs:</LI>
-  <UL>
-  <LI>MBsvpselect: This program chooses and implements the best available sound speed model for each swath file in a survey according to user specified criteria.</LI>
-  </UL>
-</UL>
-
-<H1 ALIGN=CENTER>What Was New in MB-System Version 5.3</H1>
-
-<P>The version 5.3.x releases of MB-System included a number of changes and
-improvements relative to the earlier version 5 releases. Two of these changes, a new "fast bathymetry" or fbt file format, and the implementation of file locking, will generate files that older versions of MB-System cannot read. Consequently, we recommend that any MB-System users that work together on common datasets upgrade simultaneously to release 5.3.1887 or higher. The particulars follow: </P>
-
-<UL>
-  <LI>Changes to the "fbt" or "fast bathymetry" files in the MB-System processing environment.</LI>
-  
-  <UL>
-  <LI>We updated the definition of swath format MBF_LDEOIH (format 71),
-which is used for the "fast bathymetry" or *.fbt files in MB-System
-processing environments. </LI>
-  <LI>The previous form of *.fbt files had a
-    serious limitation in that bathymetry from multibeams operated
-    near the seafloor in deep water did not represent the full
-    numerical resolution of those data. </LI>
-  <LI>The updated format allows for
-    depth and distance resolution to 0.001 m even in the deep ocean.    </LI>
-  <LI>Old *.fbt files are read transparently, but newly written files
-    will not be readable by older versions of MB-System.. </LI>
-  </UL>
-</UL>
-
-
-<UL>
-  <LI>File locking by data editing tools MBedit, MBeditvia, MBnavedit, MBclean, and the processing program MBprocess.</LI>
-  
-  <UL>
-  <LI>A file locking mechanism has been implemented to allow multiple users to work on the same projects without interfering. The intent is for this mechansim to work on heterogeneous networks, which means that the data can be on non-Posix filesystems mounted on multiple computers running different operating systems.</LI>
-    
-  <LI>The file locking is implemented in a crude fashion involving the creation and deletion of "lock files". These are text files with a ".lck" suffix that are created in parallel with the associated "raw" swath files. If a lock file exists, the swath file has been locked by a program and cannot be opened for editing or processing by any other program. When a program completes its work on or with a swath file, it removes the lock by deleting the file.</LI>
-    
-  <LI>The lock files include text indicating the program that generated the lock, the time the lock was created, the purpose (e.g. bathymetry editing), which user generated the lock, and what machine that user was logged into.</LI>
-    
-  <LI>File locking is implemented for MBedit, MBeditviz, MBnavedit, and MBprocess.</LI>
-  <LI>An example of the contents of a lock file is:<br>
-             # File /Volumes/MappingAUVOps2011/20110525m1/20110525_202216.mb88 <br>
-             # Locked by user <caress> on cpu <diebold.shore.mbari.org> at <Fri May 27 09:45:42 2011><br>
-             Locking Program: MBedit<br>
-             Locking User: caress<br>
-             Locking CPU: diebold.shore.mbari.org<br>
-             Locking Time: Fri May 27 09:45:42 2011<br>
-             Locking Purpose ID: 2<br>
-             Locking Purpose Description: Edit Bathymetry<BR>
-  </LI>
-  <LI>The primary negative consequence of file locking is the potential creation of orphaned lock files if a locking program crashes or is interrupted. The mbdatalist tool can now be used to detect lock files (-S option) in any of the files references through a datalist, or to remove any lock files (-Y option).</LI>
-  </UL>
-</UL>
-
-<UL>
-  <LI>MBedit and MBnavedit can now operate on datalists.</LI>
-  
-  <UL>
-  <LI>Previously, these two editing tools opened one file at a time, specified from a file opening dialog accessed by clicking the <File> button.</LI>
-  <LI>Now, <File> is a pull down menu with two options: <Open> and <File Selection List>. The first brings up the same file opening dialog as before. The second brings up a list dialog showing all of the files available for editing.</LI>
-  <LI>If a user opens a single file for editing, that file will be added to an internal list of files available for editing, and then loaded.</LI>
-  <LI>If a user opens a datalist, then all of the files referenced through the recursive datalist structure will be added to the internal list of files available for editing, and the first file will be loaded.</LI>
-  <LI>The user can, by selecting the <File->File Selection List> menu item, display the internal list of available files. Selecting a file in this list will cause that file to be loaded for editing. If another file was already loaded, it will be closed out gracefully before the new file is loaded.</LI>
-  <LI>The list of available files also indicates which files have been previously edited (so that ".esf" or ".nve" files exist) and which are currently locked by other programs and users.</LI>
-  </UL>
-</UL>
-
-<UL>
-  <LI>Pseudo-Parallel Processing With MBprocess</LI>
-  
-  <UL>
-  <LI>Updating the processing of one or more surveys with MBprocess can be time consuming because each swath file must be processed in turn.</LI>
-  <LI>Since the processing of each file depends only on the parameter and ancilliary files parallel to that file, the use of MBprocess is inherently parallelizable.</LI>
-  <LI>The file locking mechanism described above allows users to simultaneously run multiple instances of MBprocess on the same datalist structure.</LI>
-  <LI>Each MBprocess instance will parse through the datalist structure and attempt to process each swath file in turn.</LI>
-  <LI>Swath files will be skipped if they are up-to-date, or if they are locked.</LI>
-  <LI>The MBprocess instances can be on different computers, as long as the same filesystems are mounted.</LI>
-  <LI>The benefit of this pseudo-parallel processing tends to be limited by the network throughput. For instance, at MBARI the swath data are served on CIFS or Samba filesystems over Gigabet ethernet. We find that processing runs go faster with up to six MBprocess instances running on up to three different computers, but that adding more  than six processes causes the entire run to take longer.    </LI>
-  </UL>
-</UL>
-
-<UL>
-  <li>New data formats:
-    <ul>
-      <li>HYSWEEP HSX multibeam data format (format id 201)</li>
-    </ul>
-  </li>
-</UL>
-<H1 ALIGN=CENTER>What Was New in MB-System Versions 5.1 and 5.2</H1>
-
-<P>The version 5.1.x and 5.2.z releases of MB-System included a number of changes and
-improvements relative to the version 4 releases. The most significant changes
-included: </P>
-
-<UL>
-  <LI>A new approach to managing data processing.</LI>
-  
-  <UL>
-  <LI>Many tools - one output file. In previous versions of MB-System, each
-    processing program read an input swath data file and produced an output
-    swath data file. This "serial" processing scheme generally produced
-    a large number of intermediate data files. MB-System version 5.0 features
-    the integration of the editing and analysis tools with a single program,
-    mbprocess, that outputs processed data files. The new "parallel"
-    processing scheme covers bathymetry data processing, but does not yet incorporate
-    the sidescan processing capabilities. All of the old tools and capabilities
-    are still part of the distribution.</LI>
-    
-  <LI>Recursive datalists. The lists of data files used by gridding and plotting
-    programs can now be recursive, making it simpler to manage data from many
-    different surveys.</LI>
-    
-  <LI>Automatic format identification. MB-System programs will now attempt
-    to automatically identify the swath data format based on the filename suffix.</LI>
-    
-  <LI>Extended inf files. Users can generate inf files by directing the output
-    of mbinfo to a file named by adding an ".inf" suffix to the swath
-    data file name. Several programs can parse inf files, if they exist, to
-    quickly obtain data locations or ranges. This feature speeds operations
-    such as gridding, mosaicing, and automated plotting.<BR>
-  <BR>
-  </LI>
-  </UL>
-  
-  <LI>New command line tools.</LI>
-  
-  <UL>
-  <LI>MBprocess. This new tool performs a variety of processing tasks and
-    produces a single output processed swath data file. The program mbprocess
-    can apply bathymetry edits from mbedit and mbclean, navigation edits from
-    mbnavedit, sound velocity profile changes from mbvelocitytool, and a variety
-    of other corrections.</LI>
-    
-  <LI>MBset. This new tool allows users to create and modify the parameter
-    files used to control the operation of mbprocess.</LI>
-    
-  <LI>MBdatalist. This new tool allows users to list the files referenced by
-    a recursive datalist structure. It can also be used to create the ancillary ".inf",
-  ".fbt", and ".fnv" files for all of the data files referenced in a recursive datalist
-    structure. </LI>
-    
-  <LI>MBsvplist. This new tool lists water sound velocity profiles embedded
-    in swath data files, creating secondary files that 
-    can be read into MBvelocitytool.</LI>
-    
-  <LI>MBareaclean. This new tool identifies and flags artifacts in swath sonar
-    bathymetry data within a specified area of interest. The
-    area is divided into a grid with square cells or bins, and the
-    data are grouped according to these bins. Once all
-    of  data  are read, statistical tests are applied 
-    to the soundings within each bin.</LI>
-  <LI>MBotps. This new tool uses the Oregon State Tidal Prediction Software (OTPSnc) package to calculate open ocean tidal models for bathymetry correction.</LI>
-    
-  <LI>MBextractsegy. This new tool extracts subbottom profiler data
-    from swath files to SEGY format files.</LI>
-    
-  <LI>MBsegyinfo. This new tool extracts SEGY data file information and statistics.
-    
-  <LI>MBsegylist. This new tool produces arbitrary ascii tables from SEGY data files.
-    
-  <LI>MBsegygrid. This new tool grids seismic and subbottom data from SEGY data files.
-  <LI>MBsegypsd. This new tool calculates sonograms from SEGY data files.<BR>
-    <BR>
-  </UL>
-  
-  <LI>Improved bathymetry and navigation editors.</LI>
-  
-  <UL>
-  <LI>MBedit and MBnavedit now swallow data files whole rather than reading
-    in limited size buffers.</LI>
-    
-  <LI>MBedit now outputs beam edit events rather than an entire swath file.
-    The edits are applied by MBprocess.</LI>
-    
-  <LI>MBnavedit now outputs the edited navigation rather than an entire swath
-    file. The edited navigation is merged using MBprocess.</LI>
-    
-  <LI>Both editors show the position of the currently displayed data within
-    the entire data file.</LI>
-  <LI>MBnavedit has two navigation modeling modes relevant to swath data
-    collected using poorly navigated ROVs and towfishes. One mode applies a
-    dead reckoning model with interactively set drifts, and the other involves
-    inverting for an optimally smooth navigation by penalizing speed and acceleration.<BR>
-  </LI>
-  <LI>MBnavadjust. This new tool allows users to adjust poorly navigated
-    surveys by matching features in overlapping swathes. It is particularly
-    useful for processing surveys conducted from submerged platforms.</LI>
-  </UL>
-</UL>
-<UL>
-  <li>New Visualization Based Tools
-  </li>
-  <ul>
-    <li>MBgrdviz is a  GMT grid 2D/3D visualization utility. MBgrdviz also allows the display of sonar navigation, sites, and routes, and interactive survey planning.</li>
-  </ul>
-  <UL>
-    <LI>MBeditviz is an interactive 3D visualization bathymetry editor and patch test tool.</LI>
-  </UL>
-</UL>
-<UL>
-  <li>Support for Projected Coordinate Systems
-  </li>
-  <ul>
-    <li>MB-System now incorporates the  source  code  for  the
-      PROJ.4  Cartographic  Projections  library,  providing
-      support for (apparently) all  commonly  used  geodetic
-      coordinate  systems.   PROJ.4  was developed by Gerald
-      Evenden (then of the USGS), and was obtained from  the
-      www.remotesensing.org website.</li>
-  </ul>
-  <UL>
-    
-    <LI>A  large  number of commonly used projected coordinate
-      systems (e.g. UTM)  are  defined  in  a  file  
-      (mbsystem/share/projections.dat) distributed with MB-System.
-      These include all of the standard UTM  zones,  all  of
-      the  standard state plate coordinate systems, and most
-      of the European Petroleum Survey Group (EPSG)  coordinate 
-    systems (also including UTM).</LI>
-    
-    <LI>MB-System  can now handle swath data that is navigated
-      in a supported projected coordinate system. In particular, 
-      data files that are navigated with UTM eastings
-      and northings instead of longitude  and  latitude  can
-    now be plotted and processed with MB-System.</LI>
-    
-    <LI>The  programs mbgrid and mbmosaic can now output grids
-      and mosaics in any of the projected coordinate systems
-    specified in mbsystem/share/projections.dat.</LI>
-    
-    <LI>The   TIFF   images  generated  with  mbm_grdtiff  and
-      mbgrdtiff now fully conform to  the  GeoTIFF  standard,
-      providing that the source grids or mosaics were generated 
-      using mbgrid or  mbmosaic  in  either  Geographic
-      coordinates, UTM coordinates, or any of the EPSG coordinate 
-      systems specified in the projections.dat  file.
-      This  means,  for instance, that GeoTIFF images generated 
-      with mbgrdtiff  will  be  properly  georeferenced
-      when  they  are imported into ESRI ArcGIS or other GIS
-      packages.<BR>
-      <BR>
-    </LI>
-  </UL>
-  
-  <LI>Restructuring the code.</LI>
-  
-  <UL>
-    <LI>All of the C code now conforms to the ANSI C standard.</LI>
-    
-    <LI>The underlying input/output library (MBIO) has been substantially rewritten.
-      The structure has been streamlined, simplifying both future development
-    and support of the existing code. The MBIO API has been greatly modified.</LI>
-  </UL>
-</UL>
-<UL>
-  <LI>Handling of old Simrad multibeam data.</LI>
-  
-  <UL>
-  <LI>Vendor format data from the old Simrad multibeams (pre-1997 sonars)
-    are now supported by a single format id (51) rather than a separate format
-    id for each sonar model. The old format id's are automatically aliased
-    to 51, so existing shellscripts will continue to work.</LI>
-    
-  <LI>MB-System no longer supports beam flagging in format 51 data. The
-    use of mbedit and mbclean on format 51 data will cause the flagged
-    beams to be irrevocably nulled. Previous versions of MB-System used
-    the highest bit in the depth values to represent beam flags because
-    no Simrad data seemed to use that bit. We have not obtained data 
-    with depth values using the full bit-range, conflicting with the
-    old beam flagging scheme. We recommend that old Simrad data be translated
-    to the extended processing format (57) which contains proper beam
-    flags and supports all processing functions. Format 57 is also used for processing data from
-    the current Simrad multibeam sonars.
-    
-  <LI>Sidescan data from old Simrad multibeams (pre-1997 sonars) are now
-    handled in the same manner as data from the newer sonars (e.g. EM3000,
-    EM3000, EM120). The raw samples in the vendor data format are binned, averaged,
-    and interpolated into a 1024 pixel sidescan swath. This binned sidescan
-    is not saved in the vendor format, so (as above) it is recommended that the data be
-    translated to an extended format (57) that stores both bathymetry beam flags
-    and processed sidescan. </LI>
-  </UL>
-</UL>
-
-<UL>
-<LI>Streamlining of MB-System Default Parameters.</LI>
-
-<UL>
-<LI>Prior to version 5.0, the MB-System defaults
-set by mbdefaults included the format id, a control for
-ping averaging, longitude and latitude bounds for windowing
-by area, and begin and end times for windowing in time. These
-values are no longer set in the .mbio_defaults file or controlled
-by mbdefaults. As noted above, the format id is automatically
-identified from the filename when possible. When filenames do not
-match one of the recognized structures, users must specify the
-format using the relevant programs -Fformat option.
-The controls for ping averaging and windowing in time and space
-are rarely used, and must now be explicitly set in command
-line arguments.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>New Data Formats</LI>
-
-<UL>
-<LI>Furuno HS10 multibeam bathymetry is supported as format 171.</LI>
-
-<LI>SeaBeam 2120 multibeam data in the L3 Communications XSE format are
-supported as format 94 (already used to support Elac Bottomchart MkII XSE
-data).</LI>
-
-<LI>Raw STN Atlas multibeam data generated by the upgraded Hydrosweep DS2
-multibeam on the R/V Ewing are supported by read-only format 182.
-Processing is supported using the augmented read-write format 183.</LI>
-
-<LI>The IFREMER netCDF multibeam archiving data format is supported
-as format 75. Similarly, the IFREMER netCDF navigation 
-archiving data format is supported
-as format 167.</LI>
-
-<LI>The STN Atlas processing data format SURF is supported as format 181. At
-present, SURF is supported as a read-only format. This allows plotting and gridding
-of the SURF data, but not processing. Writing or translating the SURF data to
-allow processing will be supported in a later version.
-</LI>
-
-<LI>The Hawaii Mapping Research Group's  MR1 format is supported as
-format 64. This format is used to disseminate data from both the
-HMRG interferometric sonars (e.g. MR1) and the WHOI DSL 120 deep-towed
-inteferometric sonar. This format has been supported by including
-the code for the HMRG library libmr1pr in the MB-System library. Thanks
-to Roger Davis and HMRG for making the code available under the GPL.</LI>
-
-<LI>The Reson 7k format produced by the 7000 series Reson SeaBat multibeams
-and the Reson 6046 datalogger is now supported as format 88. This format
-can incoporate sidescan sonar and subbottom profiler data as well as the
-multibeam data.</LI>
-<LI>Third generation Simrad multibeams (EM122, EM302, EM710) are supported by formats 58 and 59.</LI>
-<LI>Imagenex and Odom DeltaT multibeams are supported by formats 191 and 192.</LI>
-</UL>
-</UL>
-
-<CENTER><P><BR>
-Last Updated: $Id: mbsystem_whatsnew.html 2183 2014-04-16 19:54:45Z caress $ </P></CENTER>
-
-<P>
-<HR WIDTH="67%"></P>
-
-<P><A HREF="mbsystem_home.html"><IMG SRC="mbsystem_logo_small.gif" BORDER=0 HEIGHT=55 WIDTH=158 ALIGN=BOTTOM></A><A HREF="mbsystem_home.html">Back
-to MB-System Home Page...</A> </P>
-
-</BODY>
-</HTML>
diff --git a/install-sh b/install-sh
deleted file mode 100755
index 377bb86..0000000
--- a/install-sh
+++ /dev/null
@@ -1,527 +0,0 @@
-#!/bin/sh
-# install - install a program, script, or datafile
-
-scriptversion=2011-11-20.07; # UTC
-
-# This originates from X11R5 (mit/util/scripts/install.sh), which was
-# later released in X11R6 (xc/config/util/install.sh) with the
-# following copyright and license.
-#
-# Copyright (C) 1994 X Consortium
-#
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documentation files (the "Software"), to
-# deal in the Software without restriction, including without limitation the
-# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-# sell copies of the Software, and to permit persons to whom the Software is
-# furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
-# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
-# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-#
-# Except as contained in this notice, the name of the X Consortium shall not
-# be used in advertising or otherwise to promote the sale, use or other deal-
-# ings in this Software without prior written authorization from the X Consor-
-# tium.
-#
-#
-# FSF changes to this file are in the public domain.
-#
-# Calling this script install-sh is preferred over install.sh, to prevent
-# 'make' implicit rules from creating a file called install from it
-# when there is no Makefile.
-#
-# This script is compatible with the BSD install script, but was written
-# from scratch.
-
-nl='
-'
-IFS=" ""	$nl"
-
-# set DOITPROG to echo to test this script
-
-# Don't use :- since 4.3BSD and earlier shells don't like it.
-doit=${DOITPROG-}
-if test -z "$doit"; then
-  doit_exec=exec
-else
-  doit_exec=$doit
-fi
-
-# Put in absolute file names if you don't have them in your path;
-# or use environment vars.
-
-chgrpprog=${CHGRPPROG-chgrp}
-chmodprog=${CHMODPROG-chmod}
-chownprog=${CHOWNPROG-chown}
-cmpprog=${CMPPROG-cmp}
-cpprog=${CPPROG-cp}
-mkdirprog=${MKDIRPROG-mkdir}
-mvprog=${MVPROG-mv}
-rmprog=${RMPROG-rm}
-stripprog=${STRIPPROG-strip}
-
-posix_glob='?'
-initialize_posix_glob='
-  test "$posix_glob" != "?" || {
-    if (set -f) 2>/dev/null; then
-      posix_glob=
-    else
-      posix_glob=:
-    fi
-  }
-'
-
-posix_mkdir=
-
-# Desired mode of installed file.
-mode=0755
-
-chgrpcmd=
-chmodcmd=$chmodprog
-chowncmd=
-mvcmd=$mvprog
-rmcmd="$rmprog -f"
-stripcmd=
-
-src=
-dst=
-dir_arg=
-dst_arg=
-
-copy_on_change=false
-no_target_directory=
-
-usage="\
-Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
-   or: $0 [OPTION]... SRCFILES... DIRECTORY
-   or: $0 [OPTION]... -t DIRECTORY SRCFILES...
-   or: $0 [OPTION]... -d DIRECTORIES...
-
-In the 1st form, copy SRCFILE to DSTFILE.
-In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
-In the 4th, create DIRECTORIES.
-
-Options:
-     --help     display this help and exit.
-     --version  display version info and exit.
-
-  -c            (ignored)
-  -C            install only if different (preserve the last data modification time)
-  -d            create directories instead of installing files.
-  -g GROUP      $chgrpprog installed files to GROUP.
-  -m MODE       $chmodprog installed files to MODE.
-  -o USER       $chownprog installed files to USER.
-  -s            $stripprog installed files.
-  -t DIRECTORY  install into DIRECTORY.
-  -T            report an error if DSTFILE is a directory.
-
-Environment variables override the default commands:
-  CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
-  RMPROG STRIPPROG
-"
-
-while test $# -ne 0; do
-  case $1 in
-    -c) ;;
-
-    -C) copy_on_change=true;;
-
-    -d) dir_arg=true;;
-
-    -g) chgrpcmd="$chgrpprog $2"
-	shift;;
-
-    --help) echo "$usage"; exit $?;;
-
-    -m) mode=$2
-	case $mode in
-	  *' '* | *'	'* | *'
-'*	  | *'*'* | *'?'* | *'['*)
-	    echo "$0: invalid mode: $mode" >&2
-	    exit 1;;
-	esac
-	shift;;
-
-    -o) chowncmd="$chownprog $2"
-	shift;;
-
-    -s) stripcmd=$stripprog;;
-
-    -t) dst_arg=$2
-	# Protect names problematic for 'test' and other utilities.
-	case $dst_arg in
-	  -* | [=\(\)!]) dst_arg=./$dst_arg;;
-	esac
-	shift;;
-
-    -T) no_target_directory=true;;
-
-    --version) echo "$0 $scriptversion"; exit $?;;
-
-    --)	shift
-	break;;
-
-    -*)	echo "$0: invalid option: $1" >&2
-	exit 1;;
-
-    *)  break;;
-  esac
-  shift
-done
-
-if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
-  # When -d is used, all remaining arguments are directories to create.
-  # When -t is used, the destination is already specified.
-  # Otherwise, the last argument is the destination.  Remove it from $@.
-  for arg
-  do
-    if test -n "$dst_arg"; then
-      # $@ is not empty: it contains at least $arg.
-      set fnord "$@" "$dst_arg"
-      shift # fnord
-    fi
-    shift # arg
-    dst_arg=$arg
-    # Protect names problematic for 'test' and other utilities.
-    case $dst_arg in
-      -* | [=\(\)!]) dst_arg=./$dst_arg;;
-    esac
-  done
-fi
-
-if test $# -eq 0; then
-  if test -z "$dir_arg"; then
-    echo "$0: no input file specified." >&2
-    exit 1
-  fi
-  # It's OK to call 'install-sh -d' without argument.
-  # This can happen when creating conditional directories.
-  exit 0
-fi
-
-if test -z "$dir_arg"; then
-  do_exit='(exit $ret); exit $ret'
-  trap "ret=129; $do_exit" 1
-  trap "ret=130; $do_exit" 2
-  trap "ret=141; $do_exit" 13
-  trap "ret=143; $do_exit" 15
-
-  # Set umask so as not to create temps with too-generous modes.
-  # However, 'strip' requires both read and write access to temps.
-  case $mode in
-    # Optimize common cases.
-    *644) cp_umask=133;;
-    *755) cp_umask=22;;
-
-    *[0-7])
-      if test -z "$stripcmd"; then
-	u_plus_rw=
-      else
-	u_plus_rw='% 200'
-      fi
-      cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
-    *)
-      if test -z "$stripcmd"; then
-	u_plus_rw=
-      else
-	u_plus_rw=,u+rw
-      fi
-      cp_umask=$mode$u_plus_rw;;
-  esac
-fi
-
-for src
-do
-  # Protect names problematic for 'test' and other utilities.
-  case $src in
-    -* | [=\(\)!]) src=./$src;;
-  esac
-
-  if test -n "$dir_arg"; then
-    dst=$src
-    dstdir=$dst
-    test -d "$dstdir"
-    dstdir_status=$?
-  else
-
-    # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
-    # might cause directories to be created, which would be especially bad
-    # if $src (and thus $dsttmp) contains '*'.
-    if test ! -f "$src" && test ! -d "$src"; then
-      echo "$0: $src does not exist." >&2
-      exit 1
-    fi
-
-    if test -z "$dst_arg"; then
-      echo "$0: no destination specified." >&2
-      exit 1
-    fi
-    dst=$dst_arg
-
-    # If destination is a directory, append the input filename; won't work
-    # if double slashes aren't ignored.
-    if test -d "$dst"; then
-      if test -n "$no_target_directory"; then
-	echo "$0: $dst_arg: Is a directory" >&2
-	exit 1
-      fi
-      dstdir=$dst
-      dst=$dstdir/`basename "$src"`
-      dstdir_status=0
-    else
-      # Prefer dirname, but fall back on a substitute if dirname fails.
-      dstdir=`
-	(dirname "$dst") 2>/dev/null ||
-	expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-	     X"$dst" : 'X\(//\)[^/]' \| \
-	     X"$dst" : 'X\(//\)$' \| \
-	     X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
-	echo X"$dst" |
-	    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
-		   s//\1/
-		   q
-		 }
-		 /^X\(\/\/\)[^/].*/{
-		   s//\1/
-		   q
-		 }
-		 /^X\(\/\/\)$/{
-		   s//\1/
-		   q
-		 }
-		 /^X\(\/\).*/{
-		   s//\1/
-		   q
-		 }
-		 s/.*/./; q'
-      `
-
-      test -d "$dstdir"
-      dstdir_status=$?
-    fi
-  fi
-
-  obsolete_mkdir_used=false
-
-  if test $dstdir_status != 0; then
-    case $posix_mkdir in
-      '')
-	# Create intermediate dirs using mode 755 as modified by the umask.
-	# This is like FreeBSD 'install' as of 1997-10-28.
-	umask=`umask`
-	case $stripcmd.$umask in
-	  # Optimize common cases.
-	  *[2367][2367]) mkdir_umask=$umask;;
-	  .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
-
-	  *[0-7])
-	    mkdir_umask=`expr $umask + 22 \
-	      - $umask % 100 % 40 + $umask % 20 \
-	      - $umask % 10 % 4 + $umask % 2
-	    `;;
-	  *) mkdir_umask=$umask,go-w;;
-	esac
-
-	# With -d, create the new directory with the user-specified mode.
-	# Otherwise, rely on $mkdir_umask.
-	if test -n "$dir_arg"; then
-	  mkdir_mode=-m$mode
-	else
-	  mkdir_mode=
-	fi
-
-	posix_mkdir=false
-	case $umask in
-	  *[123567][0-7][0-7])
-	    # POSIX mkdir -p sets u+wx bits regardless of umask, which
-	    # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
-	    ;;
-	  *)
-	    tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
-	    trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
-
-	    if (umask $mkdir_umask &&
-		exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
-	    then
-	      if test -z "$dir_arg" || {
-		   # Check for POSIX incompatibilities with -m.
-		   # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
-		   # other-writable bit of parent directory when it shouldn't.
-		   # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
-		   ls_ld_tmpdir=`ls -ld "$tmpdir"`
-		   case $ls_ld_tmpdir in
-		     d????-?r-*) different_mode=700;;
-		     d????-?--*) different_mode=755;;
-		     *) false;;
-		   esac &&
-		   $mkdirprog -m$different_mode -p -- "$tmpdir" && {
-		     ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
-		     test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
-		   }
-		 }
-	      then posix_mkdir=:
-	      fi
-	      rmdir "$tmpdir/d" "$tmpdir"
-	    else
-	      # Remove any dirs left behind by ancient mkdir implementations.
-	      rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
-	    fi
-	    trap '' 0;;
-	esac;;
-    esac
-
-    if
-      $posix_mkdir && (
-	umask $mkdir_umask &&
-	$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
-      )
-    then :
-    else
-
-      # The umask is ridiculous, or mkdir does not conform to POSIX,
-      # or it failed possibly due to a race condition.  Create the
-      # directory the slow way, step by step, checking for races as we go.
-
-      case $dstdir in
-	/*) prefix='/';;
-	[-=\(\)!]*) prefix='./';;
-	*)  prefix='';;
-      esac
-
-      eval "$initialize_posix_glob"
-
-      oIFS=$IFS
-      IFS=/
-      $posix_glob set -f
-      set fnord $dstdir
-      shift
-      $posix_glob set +f
-      IFS=$oIFS
-
-      prefixes=
-
-      for d
-      do
-	test X"$d" = X && continue
-
-	prefix=$prefix$d
-	if test -d "$prefix"; then
-	  prefixes=
-	else
-	  if $posix_mkdir; then
-	    (umask=$mkdir_umask &&
-	     $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
-	    # Don't fail if two instances are running concurrently.
-	    test -d "$prefix" || exit 1
-	  else
-	    case $prefix in
-	      *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
-	      *) qprefix=$prefix;;
-	    esac
-	    prefixes="$prefixes '$qprefix'"
-	  fi
-	fi
-	prefix=$prefix/
-      done
-
-      if test -n "$prefixes"; then
-	# Don't fail if two instances are running concurrently.
-	(umask $mkdir_umask &&
-	 eval "\$doit_exec \$mkdirprog $prefixes") ||
-	  test -d "$dstdir" || exit 1
-	obsolete_mkdir_used=true
-      fi
-    fi
-  fi
-
-  if test -n "$dir_arg"; then
-    { test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
-    { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
-    { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
-      test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
-  else
-
-    # Make a couple of temp file names in the proper directory.
-    dsttmp=$dstdir/_inst.$$_
-    rmtmp=$dstdir/_rm.$$_
-
-    # Trap to clean up those temp files at exit.
-    trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
-
-    # Copy the file name to the temp name.
-    (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
-
-    # and set any options; do chmod last to preserve setuid bits.
-    #
-    # If any of these fail, we abort the whole thing.  If we want to
-    # ignore errors from any of these, just make sure not to ignore
-    # errors from the above "$doit $cpprog $src $dsttmp" command.
-    #
-    { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
-    { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
-    { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
-    { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
-
-    # If -C, don't bother to copy if it wouldn't change the file.
-    if $copy_on_change &&
-       old=`LC_ALL=C ls -dlL "$dst"	2>/dev/null` &&
-       new=`LC_ALL=C ls -dlL "$dsttmp"	2>/dev/null` &&
-
-       eval "$initialize_posix_glob" &&
-       $posix_glob set -f &&
-       set X $old && old=:$2:$4:$5:$6 &&
-       set X $new && new=:$2:$4:$5:$6 &&
-       $posix_glob set +f &&
-
-       test "$old" = "$new" &&
-       $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
-    then
-      rm -f "$dsttmp"
-    else
-      # Rename the file to the real destination.
-      $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
-
-      # The rename failed, perhaps because mv can't rename something else
-      # to itself, or perhaps because mv is so ancient that it does not
-      # support -f.
-      {
-	# Now remove or move aside any old file at destination location.
-	# We try this two ways since rm can't unlink itself on some
-	# systems and the destination file might be busy for other
-	# reasons.  In this case, the final cleanup might fail but the new
-	# file should still install successfully.
-	{
-	  test ! -f "$dst" ||
-	  $doit $rmcmd -f "$dst" 2>/dev/null ||
-	  { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
-	    { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
-	  } ||
-	  { echo "$0: cannot unlink or rename $dst" >&2
-	    (exit 1); exit 1
-	  }
-	} &&
-
-	# Now rename the file to the real destination.
-	$doit $mvcmd "$dsttmp" "$dst"
-      }
-    fi || exit 1
-
-    trap '' 0
-  fi
-done
-
-# Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "scriptversion="
-# time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-time-zone: "UTC"
-# time-stamp-end: "; # UTC"
-# End:
diff --git a/libtool b/libtool
deleted file mode 100755
index 34f737e..0000000
--- a/libtool
+++ /dev/null
@@ -1,11642 +0,0 @@
-#! /bin/sh
-# Generated automatically by config.status (mbsystem) 5.5.2252
-# Libtool was configured on host tharp.shore.mbari.org:
-# NOTE: Changes made to this file will be lost: look at ltmain.sh.
-
-# Provide generalized library-building support services.
-# Written by Gordon Matzigkeit, 1996
-
-# Copyright (C) 2014 Free Software Foundation, Inc.
-# This is free software; see the source for copying conditions.  There is NO
-# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
-# GNU Libtool is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of of the License, or
-# (at your option) any later version.
-#
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program or library that is built
-# using GNU Libtool, you may include this file under the  same
-# distribution terms that you use for the rest of that program.
-#
-# GNU Libtool is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-
-# The names of the tagged configurations supported by this script.
-available_tags=''
-
-# Configured defaults for sys_lib_dlsearch_path munging.
-: ${LT_SYS_LIBRARY_PATH=""}
-
-# ### BEGIN LIBTOOL CONFIG
-
-# Which release of libtool.m4 was used?
-macro_version=2.4.6
-macro_revision=2.4.6
-
-# Whether or not to build shared libraries.
-build_libtool_libs=yes
-
-# Whether or not to build static libraries.
-build_old_libs=no
-
-# What type of objects to build.
-pic_mode=default
-
-# Whether or not to optimize for fast installation.
-fast_install=needless
-
-# Shared archive member basename,for filename based shared library versioning on AIX.
-shared_archive_member_spec=
-
-# Shell to use when invoking shell scripts.
-SHELL="/bin/sh"
-
-# An echo program that protects backslashes.
-ECHO="printf %s\\n"
-
-# The PATH separator for the build system.
-PATH_SEPARATOR=":"
-
-# The host system.
-host_alias=
-host=x86_64-apple-darwin13.4.0
-host_os=darwin13.4.0
-
-# The build system.
-build_alias=
-build=x86_64-apple-darwin13.4.0
-build_os=darwin13.4.0
-
-# A sed program that does not truncate output.
-SED="/sw/bin/sed"
-
-# Sed that helps us avoid accidentally triggering echo(1) options like -n.
-Xsed="$SED -e 1s/^X//"
-
-# A grep program that handles long lines.
-GREP="/sw/bin/grep"
-
-# An ERE matcher.
-EGREP="/sw/bin/grep -E"
-
-# A literal string matcher.
-FGREP="/sw/bin/grep -F"
-
-# A BSD- or MS-compatible name lister.
-NM="/usr/bin/nm"
-
-# Whether we need soft or hard links.
-LN_S="ln -s"
-
-# What is the maximum length of a command?
-max_cmd_len=196608
-
-# Object file suffix (normally "o").
-objext=o
-
-# Executable file suffix (normally "").
-exeext=
-
-# whether the shell understands "unset".
-lt_unset=unset
-
-# turn spaces into newlines.
-SP2NL="tr \\040 \\012"
-
-# turn newlines into spaces.
-NL2SP="tr \\015\\012 \\040\\040"
-
-# convert $build file names to $host format.
-to_host_file_cmd=func_convert_file_noop
-
-# convert $build files to toolchain format.
-to_tool_file_cmd=func_convert_file_noop
-
-# An object symbol dumper.
-OBJDUMP="false"
-
-# Method to check whether dependent libraries are shared objects.
-deplibs_check_method="pass_all"
-
-# Command to use when deplibs_check_method = "file_magic".
-file_magic_cmd="\$MAGIC_CMD"
-
-# How to find potential files when deplibs_check_method = "file_magic".
-file_magic_glob=""
-
-# Find potential files using nocaseglob when deplibs_check_method = "file_magic".
-want_nocaseglob="no"
-
-# DLL creation program.
-DLLTOOL="false"
-
-# Command to associate shared and link libraries.
-sharedlib_from_linklib_cmd="printf %s\\n"
-
-# The archiver.
-AR="ar"
-
-# Flags to create an archive.
-AR_FLAGS="cru"
-
-# How to feed a file listing to the archiver.
-archiver_list_spec=""
-
-# A symbol stripping program.
-STRIP="strip"
-
-# Commands used to install an old-style archive.
-RANLIB="ranlib"
-old_postinstall_cmds="chmod 644 \$oldlib~\$RANLIB \$tool_oldlib"
-old_postuninstall_cmds=""
-
-# Whether to use a lock for old archive extraction.
-lock_old_archive_extraction=yes
-
-# A C compiler.
-LTCC="gcc"
-
-# LTCC compiler flags.
-LTCFLAGS="-g -Wall -Wmissing-prototypes -I/opt/X11/include "
-
-# Take the output of nm and produce a listing of raw symbols and C names.
-global_symbol_pipe="sed -n -e 's/^.*[	 ]\\([BCDEGRST][BCDEGRST]*\\)[	 ][	 ]*_\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 _\\2 \\2/p' | sed '/ __gnu_lto/d'"
-
-# Transform the output of nm in a proper C declaration.
-global_symbol_to_cdecl="sed -n -e 's/^T .* \\(.*\\)\$/extern int \\1();/p' -e 's/^[BCDEGRST][BCDEGRST]* .* \\(.*\\)\$/extern char \\1;/p'"
-
-# Transform the output of nm into a list of symbols to manually relocate.
-global_symbol_to_import=""
-
-# Transform the output of nm in a C name address pair.
-global_symbol_to_c_name_address="sed -n -e 's/^: \\(.*\\) .*\$/  {\"\\1\", (void *) 0},/p' -e 's/^[BCDEGRST][BCDEGRST]* .* \\(.*\\)\$/  {\"\\1\", (void *) \\&\\1},/p'"
-
-# Transform the output of nm in a C name address pair when lib prefix is needed.
-global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \\(.*\\) .*\$/  {\"\\1\", (void *) 0},/p' -e 's/^[BCDEGRST][BCDEGRST]* .* \\(lib.*\\)\$/  {\"\\1\", (void *) \\&\\1},/p' -e 's/^[BCDEGRST][BCDEGRST]* .* \\(.*\\)\$/  {\"lib\\1\", (void *) \\&\\1},/p'"
-
-# The name lister interface.
-nm_interface="BSD nm"
-
-# Specify filename containing input files for $NM.
-nm_file_list_spec=""
-
-# The root where to search for dependent libraries,and where our libraries should be installed.
-lt_sysroot=
-
-# Command to truncate a binary pipe.
-lt_truncate_bin="/bin/dd bs=4096 count=1"
-
-# The name of the directory that contains temporary libtool files.
-objdir=.libs
-
-# Used to examine libraries when file_magic_cmd begins with "file".
-MAGIC_CMD=file
-
-# Must we lock files when doing compilation?
-need_locks="no"
-
-# Manifest tool.
-MANIFEST_TOOL=":"
-
-# Tool to manipulate archived DWARF debug symbol files on Mac OS X.
-DSYMUTIL="dsymutil"
-
-# Tool to change global to local symbols on Mac OS X.
-NMEDIT="nmedit"
-
-# Tool to manipulate fat objects and archives on Mac OS X.
-LIPO="lipo"
-
-# ldd/readelf like tool for Mach-O binaries on Mac OS X.
-OTOOL="otool"
-
-# ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4.
-OTOOL64=":"
-
-# Old archive suffix (normally "a").
-libext=a
-
-# Shared library suffix (normally ".so").
-shrext_cmds="\`test .\$module = .yes && echo .so || echo .dylib\`"
-
-# The commands to extract the exported symbol list from a shared archive.
-extract_expsyms_cmds=""
-
-# Variables whose values should be saved in libtool wrapper scripts and
-# restored at link time.
-variables_saved_for_relink="PATH DYLD_LIBRARY_PATH  GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
-
-# Do we need the "lib" prefix for modules?
-need_lib_prefix=no
-
-# Do we need a version for libraries?
-need_version=no
-
-# Library versioning type.
-version_type=darwin
-
-# Shared library runtime path variable.
-runpath_var=
-
-# Shared library path variable.
-shlibpath_var=DYLD_LIBRARY_PATH
-
-# Is shlibpath searched before the hard-coded library search path?
-shlibpath_overrides_runpath=yes
-
-# Format of library name prefix.
-libname_spec="lib\$name"
-
-# List of archive names.  First name is the real one, the rest are links.
-# The last name is the one that the linker finds with -lNAME
-library_names_spec="\$libname\$release\$major\$shared_ext \$libname\$shared_ext"
-
-# The coded name of the library, if different from the real name.
-soname_spec="\$libname\$release\$major\$shared_ext"
-
-# Permission mode override for installation of shared libraries.
-install_override_mode=""
-
-# Command to use after installation of a shared archive.
-postinstall_cmds=""
-
-# Command to use after uninstallation of a shared archive.
-postuninstall_cmds=""
-
-# Commands used to finish a libtool library installation in a directory.
-finish_cmds=""
-
-# As "finish_cmds", except a single script fragment to be evaled but
-# not shown.
-finish_eval=""
-
-# Whether we should hardcode library paths into libraries.
-hardcode_into_libs=no
-
-# Compile-time system search path for libraries.
-sys_lib_search_path_spec="/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/6.0  /usr/local/lib"
-
-# Detected run-time system search path for libraries.
-sys_lib_dlsearch_path_spec="/usr/local/lib /lib /usr/lib"
-
-# Explicit LT_SYS_LIBRARY_PATH set during ./configure time.
-configure_time_lt_sys_library_path=""
-
-# Whether dlopen is supported.
-dlopen_support=unknown
-
-# Whether dlopen of programs is supported.
-dlopen_self=unknown
-
-# Whether dlopen of statically linked programs is supported.
-dlopen_self_static=unknown
-
-# Commands to strip libraries.
-old_striplib="strip -S"
-striplib="strip -x"
-
-
-# The linker used to build libraries.
-LD="/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld"
-
-# How to create reloadable object files.
-reload_flag=" -r"
-reload_cmds="\$LTCC \$LTCFLAGS -nostdlib \$wl-r -o \$output\$reload_objs"
-
-# Commands used to build an old-style archive.
-old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs~\$RANLIB \$tool_oldlib"
-
-# A language specific compiler.
-CC="gcc"
-
-# Is the compiler the GNU compiler?
-with_gcc=yes
-
-# Compiler flag to turn off builtin functions.
-no_builtin_flag=" -fno-builtin -fno-rtti -fno-exceptions"
-
-# Additional compiler flags for building library objects.
-pic_flag=" -fno-common -DPIC"
-
-# How to pass a linker flag through the compiler.
-wl="-Wl,"
-
-# Compiler flag to prevent dynamic linking.
-link_static_flag=""
-
-# Does compiler simultaneously support -c and -o options?
-compiler_c_o="yes"
-
-# Whether or not to add -lc for building shared libraries.
-build_libtool_need_lc=no
-
-# Whether or not to disallow shared libs when runtime libs are static.
-allow_libtool_libs_with_static_runtimes=no
-
-# Compiler flag to allow reflexive dlopens.
-export_dynamic_flag_spec=""
-
-# Compiler flag to generate shared objects directly from archives.
-whole_archive_flag_spec="\`for conv in \$convenience\\\"\\\"; do test  -n \\\"\$conv\\\" && new_convenience=\\\"\$new_convenience \$wl-force_load,\$conv\\\"; done; func_echo_all \\\"\$new_convenience\\\"\`"
-
-# Whether the compiler copes with passing no objects directly.
-compiler_needs_object="no"
-
-# Create an old-style archive from a shared archive.
-old_archive_from_new_cmds=""
-
-# Create a temporary old-style archive to link instead of a shared archive.
-old_archive_from_expsyms_cmds=""
-
-# Commands used to build a shared archive.
-archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring \$single_module"
-archive_expsym_cmds="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring \$single_module \$wl-exported_symbols_list,\$output_objdir/\$libname-symbols.expsym"
-
-# Commands used to build a loadable module if different from building
-# a shared archive.
-module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags"
-module_expsym_cmds="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags \$wl-exported_symbols_list,\$output_objdir/\$libname-symbols.expsym"
-
-# Whether we are building with GNU ld or not.
-with_gnu_ld="no"
-
-# Flag that allows shared libraries with undefined symbols to be built.
-allow_undefined_flag="\$wl-undefined \${wl}dynamic_lookup"
-
-# Flag that enforces no undefined symbols.
-no_undefined_flag=""
-
-# Flag to hardcode $libdir into a binary during linking.
-# This must work even if $libdir does not exist
-hardcode_libdir_flag_spec=""
-
-# Whether we need a single "-rpath" flag with a separated argument.
-hardcode_libdir_separator=""
-
-# Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
-# DIR into the resulting binary.
-hardcode_direct=no
-
-# Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
-# DIR into the resulting binary and the resulting library dependency is
-# "absolute",i.e impossible to change by setting $shlibpath_var if the
-# library is relocated.
-hardcode_direct_absolute=no
-
-# Set to "yes" if using the -LDIR flag during linking hardcodes DIR
-# into the resulting binary.
-hardcode_minus_L=no
-
-# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
-# into the resulting binary.
-hardcode_shlibpath_var=unsupported
-
-# Set to "yes" if building a shared library automatically hardcodes DIR
-# into the library and all subsequent libraries and executables linked
-# against it.
-hardcode_automatic=yes
-
-# Set to yes if linker adds runtime paths of dependent libraries
-# to runtime path list.
-inherit_rpath=no
-
-# Whether libtool must link a program against all its dependency libraries.
-link_all_deplibs=yes
-
-# Set to "yes" if exported symbols are required.
-always_export_symbols=no
-
-# The commands to list exported symbols.
-export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | \$SED 's/.* //' | sort | uniq > \$export_symbols"
-
-# Symbols that should not be listed in the preloaded symbols.
-exclude_expsyms="_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*"
-
-# Symbols that must always be exported.
-include_expsyms=""
-
-# Commands necessary for linking programs (against libraries) with templates.
-prelink_cmds=""
-
-# Commands necessary for finishing linking programs.
-postlink_cmds=""
-
-# Specify filename containing input files.
-file_list_spec=""
-
-# How to hardcode a shared library path into an executable.
-hardcode_action=immediate
-
-# ### END LIBTOOL CONFIG
-
-
-# ### BEGIN FUNCTIONS SHARED WITH CONFIGURE
-
-# func_munge_path_list VARIABLE PATH
-# -----------------------------------
-# VARIABLE is name of variable containing _space_ separated list of
-# directories to be munged by the contents of PATH, which is string
-# having a format:
-# "DIR[:DIR]:"
-#       string "DIR[ DIR]" will be prepended to VARIABLE
-# ":DIR[:DIR]"
-#       string "DIR[ DIR]" will be appended to VARIABLE
-# "DIRP[:DIRP]::[DIRA:]DIRA"
-#       string "DIRP[ DIRP]" will be prepended to VARIABLE and string
-#       "DIRA[ DIRA]" will be appended to VARIABLE
-# "DIR[:DIR]"
-#       VARIABLE will be replaced by "DIR[ DIR]"
-func_munge_path_list ()
-{
-    case x$2 in
-    x)
-        ;;
-    *:)
-        eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\"
-        ;;
-    x:*)
-        eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\"
-        ;;
-    *::*)
-        eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\"
-        eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\"
-        ;;
-    *)
-        eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\"
-        ;;
-    esac
-}
-
-
-# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
-func_cc_basename ()
-{
-    for cc_temp in $*""; do
-      case $cc_temp in
-        compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
-        distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
-        \-*) ;;
-        *) break;;
-      esac
-    done
-    func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
-}
-
-
-# ### END FUNCTIONS SHARED WITH CONFIGURE
-
-#! /bin/sh
-## DO NOT EDIT - This file generated from ./build-aux/ltmain.in
-##               by inline-source v2014-01-03.01
-
-# libtool (GNU libtool) 2.4.6
-# Provide generalized library-building support services.
-# Written by Gordon Matzigkeit <gord at gnu.ai.mit.edu>, 1996
-
-# Copyright (C) 1996-2015 Free Software Foundation, Inc.
-# This is free software; see the source for copying conditions.  There is NO
-# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
-# GNU Libtool is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# As a special exception to the GNU General Public License,
-# if you distribute this file as part of a program or library that
-# is built using GNU Libtool, you may include this file under the
-# same distribution terms that you use for the rest of that program.
-#
-# GNU Libtool is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-
-PROGRAM=libtool
-PACKAGE=libtool
-VERSION=2.4.6
-package_revision=2.4.6
-
-
-## ------ ##
-## Usage. ##
-## ------ ##
-
-# Run './libtool --help' for help with using this script from the
-# command line.
-
-
-## ------------------------------- ##
-## User overridable command paths. ##
-## ------------------------------- ##
-
-# After configure completes, it has a better idea of some of the
-# shell tools we need than the defaults used by the functions shared
-# with bootstrap, so set those here where they can still be over-
-# ridden by the user, but otherwise take precedence.
-
-: ${AUTOCONF="autoconf"}
-: ${AUTOMAKE="automake"}
-
-
-## -------------------------- ##
-## Source external libraries. ##
-## -------------------------- ##
-
-# Much of our low-level functionality needs to be sourced from external
-# libraries, which are installed to $pkgauxdir.
-
-# Set a version string for this script.
-scriptversion=2015-01-20.17; # UTC
-
-# General shell script boiler plate, and helper functions.
-# Written by Gary V. Vaughan, 2004
-
-# Copyright (C) 2004-2015 Free Software Foundation, Inc.
-# This is free software; see the source for copying conditions.  There is NO
-# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-
-# As a special exception to the GNU General Public License, if you distribute
-# this file as part of a program or library that is built using GNU Libtool,
-# you may include this file under the same distribution terms that you use
-# for the rest of that program.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNES FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-# Please report bugs or propose patches to gary at gnu.org.
-
-
-## ------ ##
-## Usage. ##
-## ------ ##
-
-# Evaluate this file near the top of your script to gain access to
-# the functions and variables defined here:
-#
-#   . `echo "$0" | ${SED-sed} 's|[^/]*$||'`/build-aux/funclib.sh
-#
-# If you need to override any of the default environment variable
-# settings, do that before evaluating this file.
-
-
-## -------------------- ##
-## Shell normalisation. ##
-## -------------------- ##
-
-# Some shells need a little help to be as Bourne compatible as possible.
-# Before doing anything else, make sure all that help has been provided!
-
-DUALCASE=1; export DUALCASE # for MKS sh
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
-  emulate sh
-  NULLCMD=:
-  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
-  # is contrary to our usage.  Disable this feature.
-  alias -g '${1+"$@"}'='"$@"'
-  setopt NO_GLOB_SUBST
-else
-  case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac
-fi
-
-# NLS nuisances: We save the old values in case they are required later.
-_G_user_locale=
-_G_safe_locale=
-for _G_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
-do
-  eval "if test set = \"\${$_G_var+set}\"; then
-          save_$_G_var=\$$_G_var
-          $_G_var=C
-	  export $_G_var
-	  _G_user_locale=\"$_G_var=\\\$save_\$_G_var; \$_G_user_locale\"
-	  _G_safe_locale=\"$_G_var=C; \$_G_safe_locale\"
-	fi"
-done
-
-# CDPATH.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-# Make sure IFS has a sensible default
-sp=' '
-nl='
-'
-IFS="$sp	$nl"
-
-# There are apparently some retarded systems that use ';' as a PATH separator!
-if test "${PATH_SEPARATOR+set}" != set; then
-  PATH_SEPARATOR=:
-  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
-    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
-      PATH_SEPARATOR=';'
-  }
-fi
-
-
-
-## ------------------------- ##
-## Locate command utilities. ##
-## ------------------------- ##
-
-
-# func_executable_p FILE
-# ----------------------
-# Check that FILE is an executable regular file.
-func_executable_p ()
-{
-    test -f "$1" && test -x "$1"
-}
-
-
-# func_path_progs PROGS_LIST CHECK_FUNC [PATH]
-# --------------------------------------------
-# Search for either a program that responds to --version with output
-# containing "GNU", or else returned by CHECK_FUNC otherwise, by
-# trying all the directories in PATH with each of the elements of
-# PROGS_LIST.
-#
-# CHECK_FUNC should accept the path to a candidate program, and
-# set $func_check_prog_result if it truncates its output less than
-# $_G_path_prog_max characters.
-func_path_progs ()
-{
-    _G_progs_list=$1
-    _G_check_func=$2
-    _G_PATH=${3-"$PATH"}
-
-    _G_path_prog_max=0
-    _G_path_prog_found=false
-    _G_save_IFS=$IFS; IFS=${PATH_SEPARATOR-:}
-    for _G_dir in $_G_PATH; do
-      IFS=$_G_save_IFS
-      test -z "$_G_dir" && _G_dir=.
-      for _G_prog_name in $_G_progs_list; do
-        for _exeext in '' .EXE; do
-          _G_path_prog=$_G_dir/$_G_prog_name$_exeext
-          func_executable_p "$_G_path_prog" || continue
-          case `"$_G_path_prog" --version 2>&1` in
-            *GNU*) func_path_progs_result=$_G_path_prog _G_path_prog_found=: ;;
-            *)     $_G_check_func $_G_path_prog
-		   func_path_progs_result=$func_check_prog_result
-		   ;;
-          esac
-          $_G_path_prog_found && break 3
-        done
-      done
-    done
-    IFS=$_G_save_IFS
-    test -z "$func_path_progs_result" && {
-      echo "no acceptable sed could be found in \$PATH" >&2
-      exit 1
-    }
-}
-
-
-# We want to be able to use the functions in this file before configure
-# has figured out where the best binaries are kept, which means we have
-# to search for them ourselves - except when the results are already set
-# where we skip the searches.
-
-# Unless the user overrides by setting SED, search the path for either GNU
-# sed, or the sed that truncates its output the least.
-test -z "$SED" && {
-  _G_sed_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
-  for _G_i in 1 2 3 4 5 6 7; do
-    _G_sed_script=$_G_sed_script$nl$_G_sed_script
-  done
-  echo "$_G_sed_script" 2>/dev/null | sed 99q >conftest.sed
-  _G_sed_script=
-
-  func_check_prog_sed ()
-  {
-    _G_path_prog=$1
-
-    _G_count=0
-    printf 0123456789 >conftest.in
-    while :
-    do
-      cat conftest.in conftest.in >conftest.tmp
-      mv conftest.tmp conftest.in
-      cp conftest.in conftest.nl
-      echo '' >> conftest.nl
-      "$_G_path_prog" -f conftest.sed <conftest.nl >conftest.out 2>/dev/null || break
-      diff conftest.out conftest.nl >/dev/null 2>&1 || break
-      _G_count=`expr $_G_count + 1`
-      if test "$_G_count" -gt "$_G_path_prog_max"; then
-        # Best one so far, save it but keep looking for a better one
-        func_check_prog_result=$_G_path_prog
-        _G_path_prog_max=$_G_count
-      fi
-      # 10*(2^10) chars as input seems more than enough
-      test 10 -lt "$_G_count" && break
-    done
-    rm -f conftest.in conftest.tmp conftest.nl conftest.out
-  }
-
-  func_path_progs "sed gsed" func_check_prog_sed $PATH:/usr/xpg4/bin
-  rm -f conftest.sed
-  SED=$func_path_progs_result
-}
-
-
-# Unless the user overrides by setting GREP, search the path for either GNU
-# grep, or the grep that truncates its output the least.
-test -z "$GREP" && {
-  func_check_prog_grep ()
-  {
-    _G_path_prog=$1
-
-    _G_count=0
-    _G_path_prog_max=0
-    printf 0123456789 >conftest.in
-    while :
-    do
-      cat conftest.in conftest.in >conftest.tmp
-      mv conftest.tmp conftest.in
-      cp conftest.in conftest.nl
-      echo 'GREP' >> conftest.nl
-      "$_G_path_prog" -e 'GREP$' -e '-(cannot match)-' <conftest.nl >conftest.out 2>/dev/null || break
-      diff conftest.out conftest.nl >/dev/null 2>&1 || break
-      _G_count=`expr $_G_count + 1`
-      if test "$_G_count" -gt "$_G_path_prog_max"; then
-        # Best one so far, save it but keep looking for a better one
-        func_check_prog_result=$_G_path_prog
-        _G_path_prog_max=$_G_count
-      fi
-      # 10*(2^10) chars as input seems more than enough
-      test 10 -lt "$_G_count" && break
-    done
-    rm -f conftest.in conftest.tmp conftest.nl conftest.out
-  }
-
-  func_path_progs "grep ggrep" func_check_prog_grep $PATH:/usr/xpg4/bin
-  GREP=$func_path_progs_result
-}
-
-
-## ------------------------------- ##
-## User overridable command paths. ##
-## ------------------------------- ##
-
-# All uppercase variable names are used for environment variables.  These
-# variables can be overridden by the user before calling a script that
-# uses them if a suitable command of that name is not already available
-# in the command search PATH.
-
-: ${CP="cp -f"}
-: ${ECHO="printf %s\n"}
-: ${EGREP="$GREP -E"}
-: ${FGREP="$GREP -F"}
-: ${LN_S="ln -s"}
-: ${MAKE="make"}
-: ${MKDIR="mkdir"}
-: ${MV="mv -f"}
-: ${RM="rm -f"}
-: ${SHELL="${CONFIG_SHELL-/bin/sh}"}
-
-
-## -------------------- ##
-## Useful sed snippets. ##
-## -------------------- ##
-
-sed_dirname='s|/[^/]*$||'
-sed_basename='s|^.*/||'
-
-# Sed substitution that helps us do robust quoting.  It backslashifies
-# metacharacters that are still active within double-quoted strings.
-sed_quote_subst='s|\([`"$\\]\)|\\\1|g'
-
-# Same as above, but do not quote variable references.
-sed_double_quote_subst='s/\(["`\\]\)/\\\1/g'
-
-# Sed substitution that turns a string into a regex matching for the
-# string literally.
-sed_make_literal_regex='s|[].[^$\\*\/]|\\&|g'
-
-# Sed substitution that converts a w32 file name or path
-# that contains forward slashes, into one that contains
-# (escaped) backslashes.  A very naive implementation.
-sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
-
-# Re-'\' parameter expansions in output of sed_double_quote_subst that
-# were '\'-ed in input to the same.  If an odd number of '\' preceded a
-# '$' in input to sed_double_quote_subst, that '$' was protected from
-# expansion.  Since each input '\' is now two '\'s, look for any number
-# of runs of four '\'s followed by two '\'s and then a '$'.  '\' that '$'.
-_G_bs='\\'
-_G_bs2='\\\\'
-_G_bs4='\\\\\\\\'
-_G_dollar='\$'
-sed_double_backslash="\
-  s/$_G_bs4/&\\
-/g
-  s/^$_G_bs2$_G_dollar/$_G_bs&/
-  s/\\([^$_G_bs]\\)$_G_bs2$_G_dollar/\\1$_G_bs2$_G_bs$_G_dollar/g
-  s/\n//g"
-
-
-## ----------------- ##
-## Global variables. ##
-## ----------------- ##
-
-# Except for the global variables explicitly listed below, the following
-# functions in the '^func_' namespace, and the '^require_' namespace
-# variables initialised in the 'Resource management' section, sourcing
-# this file will not pollute your global namespace with anything
-# else. There's no portable way to scope variables in Bourne shell
-# though, so actually running these functions will sometimes place
-# results into a variable named after the function, and often use
-# temporary variables in the '^_G_' namespace. If you are careful to
-# avoid using those namespaces casually in your sourcing script, things
-# should continue to work as you expect. And, of course, you can freely
-# overwrite any of the functions or variables defined here before
-# calling anything to customize them.
-
-EXIT_SUCCESS=0
-EXIT_FAILURE=1
-EXIT_MISMATCH=63  # $? = 63 is used to indicate version mismatch to missing.
-EXIT_SKIP=77	  # $? = 77 is used to indicate a skipped test to automake.
-
-# Allow overriding, eg assuming that you follow the convention of
-# putting '$debug_cmd' at the start of all your functions, you can get
-# bash to show function call trace with:
-#
-#    debug_cmd='eval echo "${FUNCNAME[0]} $*" >&2' bash your-script-name
-debug_cmd=${debug_cmd-":"}
-exit_cmd=:
-
-# By convention, finish your script with:
-#
-#    exit $exit_status
-#
-# so that you can set exit_status to non-zero if you want to indicate
-# something went wrong during execution without actually bailing out at
-# the point of failure.
-exit_status=$EXIT_SUCCESS
-
-# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
-# is ksh but when the shell is invoked as "sh" and the current value of
-# the _XPG environment variable is not equal to 1 (one), the special
-# positional parameter $0, within a function call, is the name of the
-# function.
-progpath=$0
-
-# The name of this program.
-progname=`$ECHO "$progpath" |$SED "$sed_basename"`
-
-# Make sure we have an absolute progpath for reexecution:
-case $progpath in
-  [\\/]*|[A-Za-z]:\\*) ;;
-  *[\\/]*)
-     progdir=`$ECHO "$progpath" |$SED "$sed_dirname"`
-     progdir=`cd "$progdir" && pwd`
-     progpath=$progdir/$progname
-     ;;
-  *)
-     _G_IFS=$IFS
-     IFS=${PATH_SEPARATOR-:}
-     for progdir in $PATH; do
-       IFS=$_G_IFS
-       test -x "$progdir/$progname" && break
-     done
-     IFS=$_G_IFS
-     test -n "$progdir" || progdir=`pwd`
-     progpath=$progdir/$progname
-     ;;
-esac
-
-
-## ----------------- ##
-## Standard options. ##
-## ----------------- ##
-
-# The following options affect the operation of the functions defined
-# below, and should be set appropriately depending on run-time para-
-# meters passed on the command line.
-
-opt_dry_run=false
-opt_quiet=false
-opt_verbose=false
-
-# Categories 'all' and 'none' are always available.  Append any others
-# you will pass as the first argument to func_warning from your own
-# code.
-warning_categories=
-
-# By default, display warnings according to 'opt_warning_types'.  Set
-# 'warning_func'  to ':' to elide all warnings, or func_fatal_error to
-# treat the next displayed warning as a fatal error.
-warning_func=func_warn_and_continue
-
-# Set to 'all' to display all warnings, 'none' to suppress all
-# warnings, or a space delimited list of some subset of
-# 'warning_categories' to display only the listed warnings.
-opt_warning_types=all
-
-
-## -------------------- ##
-## Resource management. ##
-## -------------------- ##
-
-# This section contains definitions for functions that each ensure a
-# particular resource (a file, or a non-empty configuration variable for
-# example) is available, and if appropriate to extract default values
-# from pertinent package files. Call them using their associated
-# 'require_*' variable to ensure that they are executed, at most, once.
-#
-# It's entirely deliberate that calling these functions can set
-# variables that don't obey the namespace limitations obeyed by the rest
-# of this file, in order that that they be as useful as possible to
-# callers.
-
-
-# require_term_colors
-# -------------------
-# Allow display of bold text on terminals that support it.
-require_term_colors=func_require_term_colors
-func_require_term_colors ()
-{
-    $debug_cmd
-
-    test -t 1 && {
-      # COLORTERM and USE_ANSI_COLORS environment variables take
-      # precedence, because most terminfo databases neglect to describe
-      # whether color sequences are supported.
-      test -n "${COLORTERM+set}" && : ${USE_ANSI_COLORS="1"}
-
-      if test 1 = "$USE_ANSI_COLORS"; then
-        # Standard ANSI escape sequences
-        tc_reset=''
-        tc_bold='';   tc_standout=''
-        tc_red='';   tc_green=''
-        tc_blue='';  tc_cyan=''
-      else
-        # Otherwise trust the terminfo database after all.
-        test -n "`tput sgr0 2>/dev/null`" && {
-          tc_reset=`tput sgr0`
-          test -n "`tput bold 2>/dev/null`" && tc_bold=`tput bold`
-          tc_standout=$tc_bold
-          test -n "`tput smso 2>/dev/null`" && tc_standout=`tput smso`
-          test -n "`tput setaf 1 2>/dev/null`" && tc_red=`tput setaf 1`
-          test -n "`tput setaf 2 2>/dev/null`" && tc_green=`tput setaf 2`
-          test -n "`tput setaf 4 2>/dev/null`" && tc_blue=`tput setaf 4`
-          test -n "`tput setaf 5 2>/dev/null`" && tc_cyan=`tput setaf 5`
-        }
-      fi
-    }
-
-    require_term_colors=:
-}
-
-
-## ----------------- ##
-## Function library. ##
-## ----------------- ##
-
-# This section contains a variety of useful functions to call in your
-# scripts. Take note of the portable wrappers for features provided by
-# some modern shells, which will fall back to slower equivalents on
-# less featureful shells.
-
-
-# func_append VAR VALUE
-# ---------------------
-# Append VALUE onto the existing contents of VAR.
-
-  # We should try to minimise forks, especially on Windows where they are
-  # unreasonably slow, so skip the feature probes when bash or zsh are
-  # being used:
-  if test set = "${BASH_VERSION+set}${ZSH_VERSION+set}"; then
-    : ${_G_HAVE_ARITH_OP="yes"}
-    : ${_G_HAVE_XSI_OPS="yes"}
-    # The += operator was introduced in bash 3.1
-    case $BASH_VERSION in
-      [12].* | 3.0 | 3.0*) ;;
-      *)
-        : ${_G_HAVE_PLUSEQ_OP="yes"}
-        ;;
-    esac
-  fi
-
-  # _G_HAVE_PLUSEQ_OP
-  # Can be empty, in which case the shell is probed, "yes" if += is
-  # useable or anything else if it does not work.
-  test -z "$_G_HAVE_PLUSEQ_OP" \
-    && (eval 'x=a; x+=" b"; test "a b" = "$x"') 2>/dev/null \
-    && _G_HAVE_PLUSEQ_OP=yes
-
-if test yes = "$_G_HAVE_PLUSEQ_OP"
-then
-  # This is an XSI compatible shell, allowing a faster implementation...
-  eval 'func_append ()
-  {
-    $debug_cmd
-
-    eval "$1+=\$2"
-  }'
-else
-  # ...otherwise fall back to using expr, which is often a shell builtin.
-  func_append ()
-  {
-    $debug_cmd
-
-    eval "$1=\$$1\$2"
-  }
-fi
-
-
-# func_append_quoted VAR VALUE
-# ----------------------------
-# Quote VALUE and append to the end of shell variable VAR, separated
-# by a space.
-if test yes = "$_G_HAVE_PLUSEQ_OP"; then
-  eval 'func_append_quoted ()
-  {
-    $debug_cmd
-
-    func_quote_for_eval "$2"
-    eval "$1+=\\ \$func_quote_for_eval_result"
-  }'
-else
-  func_append_quoted ()
-  {
-    $debug_cmd
-
-    func_quote_for_eval "$2"
-    eval "$1=\$$1\\ \$func_quote_for_eval_result"
-  }
-fi
-
-
-# func_append_uniq VAR VALUE
-# --------------------------
-# Append unique VALUE onto the existing contents of VAR, assuming
-# entries are delimited by the first character of VALUE.  For example:
-#
-#   func_append_uniq options " --another-option option-argument"
-#
-# will only append to $options if " --another-option option-argument "
-# is not already present somewhere in $options already (note spaces at
-# each end implied by leading space in second argument).
-func_append_uniq ()
-{
-    $debug_cmd
-
-    eval _G_current_value='`$ECHO $'$1'`'
-    _G_delim=`expr "$2" : '\(.\)'`
-
-    case $_G_delim$_G_current_value$_G_delim in
-      *"$2$_G_delim"*) ;;
-      *) func_append "$@" ;;
-    esac
-}
-
-
-# func_arith TERM...
-# ------------------
-# Set func_arith_result to the result of evaluating TERMs.
-  test -z "$_G_HAVE_ARITH_OP" \
-    && (eval 'test 2 = $(( 1 + 1 ))') 2>/dev/null \
-    && _G_HAVE_ARITH_OP=yes
-
-if test yes = "$_G_HAVE_ARITH_OP"; then
-  eval 'func_arith ()
-  {
-    $debug_cmd
-
-    func_arith_result=$(( $* ))
-  }'
-else
-  func_arith ()
-  {
-    $debug_cmd
-
-    func_arith_result=`expr "$@"`
-  }
-fi
-
-
-# func_basename FILE
-# ------------------
-# Set func_basename_result to FILE with everything up to and including
-# the last / stripped.
-if test yes = "$_G_HAVE_XSI_OPS"; then
-  # If this shell supports suffix pattern removal, then use it to avoid
-  # forking. Hide the definitions single quotes in case the shell chokes
-  # on unsupported syntax...
-  _b='func_basename_result=${1##*/}'
-  _d='case $1 in
-        */*) func_dirname_result=${1%/*}$2 ;;
-        *  ) func_dirname_result=$3        ;;
-      esac'
-
-else
-  # ...otherwise fall back to using sed.
-  _b='func_basename_result=`$ECHO "$1" |$SED "$sed_basename"`'
-  _d='func_dirname_result=`$ECHO "$1"  |$SED "$sed_dirname"`
-      if test "X$func_dirname_result" = "X$1"; then
-        func_dirname_result=$3
-      else
-        func_append func_dirname_result "$2"
-      fi'
-fi
-
-eval 'func_basename ()
-{
-    $debug_cmd
-
-    '"$_b"'
-}'
-
-
-# func_dirname FILE APPEND NONDIR_REPLACEMENT
-# -------------------------------------------
-# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
-# otherwise set result to NONDIR_REPLACEMENT.
-eval 'func_dirname ()
-{
-    $debug_cmd
-
-    '"$_d"'
-}'
-
-
-# func_dirname_and_basename FILE APPEND NONDIR_REPLACEMENT
-# --------------------------------------------------------
-# Perform func_basename and func_dirname in a single function
-# call:
-#   dirname:  Compute the dirname of FILE.  If nonempty,
-#             add APPEND to the result, otherwise set result
-#             to NONDIR_REPLACEMENT.
-#             value returned in "$func_dirname_result"
-#   basename: Compute filename of FILE.
-#             value retuned in "$func_basename_result"
-# For efficiency, we do not delegate to the functions above but instead
-# duplicate the functionality here.
-eval 'func_dirname_and_basename ()
-{
-    $debug_cmd
-
-    '"$_b"'
-    '"$_d"'
-}'
-
-
-# func_echo ARG...
-# ----------------
-# Echo program name prefixed message.
-func_echo ()
-{
-    $debug_cmd
-
-    _G_message=$*
-
-    func_echo_IFS=$IFS
-    IFS=$nl
-    for _G_line in $_G_message; do
-      IFS=$func_echo_IFS
-      $ECHO "$progname: $_G_line"
-    done
-    IFS=$func_echo_IFS
-}
-
-
-# func_echo_all ARG...
-# --------------------
-# Invoke $ECHO with all args, space-separated.
-func_echo_all ()
-{
-    $ECHO "$*"
-}
-
-
-# func_echo_infix_1 INFIX ARG...
-# ------------------------------
-# Echo program name, followed by INFIX on the first line, with any
-# additional lines not showing INFIX.
-func_echo_infix_1 ()
-{
-    $debug_cmd
-
-    $require_term_colors
-
-    _G_infix=$1; shift
-    _G_indent=$_G_infix
-    _G_prefix="$progname: $_G_infix: "
-    _G_message=$*
-
-    # Strip color escape sequences before counting printable length
-    for _G_tc in "$tc_reset" "$tc_bold" "$tc_standout" "$tc_red" "$tc_green" "$tc_blue" "$tc_cyan"
-    do
-      test -n "$_G_tc" && {
-        _G_esc_tc=`$ECHO "$_G_tc" | $SED "$sed_make_literal_regex"`
-        _G_indent=`$ECHO "$_G_indent" | $SED "s|$_G_esc_tc||g"`
-      }
-    done
-    _G_indent="$progname: "`echo "$_G_indent" | $SED 's|.| |g'`"  " ## exclude from sc_prohibit_nested_quotes
-
-    func_echo_infix_1_IFS=$IFS
-    IFS=$nl
-    for _G_line in $_G_message; do
-      IFS=$func_echo_infix_1_IFS
-      $ECHO "$_G_prefix$tc_bold$_G_line$tc_reset" >&2
-      _G_prefix=$_G_indent
-    done
-    IFS=$func_echo_infix_1_IFS
-}
-
-
-# func_error ARG...
-# -----------------
-# Echo program name prefixed message to standard error.
-func_error ()
-{
-    $debug_cmd
-
-    $require_term_colors
-
-    func_echo_infix_1 "  $tc_standout${tc_red}error$tc_reset" "$*" >&2
-}
-
-
-# func_fatal_error ARG...
-# -----------------------
-# Echo program name prefixed message to standard error, and exit.
-func_fatal_error ()
-{
-    $debug_cmd
-
-    func_error "$*"
-    exit $EXIT_FAILURE
-}
-
-
-# func_grep EXPRESSION FILENAME
-# -----------------------------
-# Check whether EXPRESSION matches any line of FILENAME, without output.
-func_grep ()
-{
-    $debug_cmd
-
-    $GREP "$1" "$2" >/dev/null 2>&1
-}
-
-
-# func_len STRING
-# ---------------
-# Set func_len_result to the length of STRING. STRING may not
-# start with a hyphen.
-  test -z "$_G_HAVE_XSI_OPS" \
-    && (eval 'x=a/b/c;
-      test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \
-    && _G_HAVE_XSI_OPS=yes
-
-if test yes = "$_G_HAVE_XSI_OPS"; then
-  eval 'func_len ()
-  {
-    $debug_cmd
-
-    func_len_result=${#1}
-  }'
-else
-  func_len ()
-  {
-    $debug_cmd
-
-    func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len`
-  }
-fi
-
-
-# func_mkdir_p DIRECTORY-PATH
-# ---------------------------
-# Make sure the entire path to DIRECTORY-PATH is available.
-func_mkdir_p ()
-{
-    $debug_cmd
-
-    _G_directory_path=$1
-    _G_dir_list=
-
-    if test -n "$_G_directory_path" && test : != "$opt_dry_run"; then
-
-      # Protect directory names starting with '-'
-      case $_G_directory_path in
-        -*) _G_directory_path=./$_G_directory_path ;;
-      esac
-
-      # While some portion of DIR does not yet exist...
-      while test ! -d "$_G_directory_path"; do
-        # ...make a list in topmost first order.  Use a colon delimited
-	# list incase some portion of path contains whitespace.
-        _G_dir_list=$_G_directory_path:$_G_dir_list
-
-        # If the last portion added has no slash in it, the list is done
-        case $_G_directory_path in */*) ;; *) break ;; esac
-
-        # ...otherwise throw away the child directory and loop
-        _G_directory_path=`$ECHO "$_G_directory_path" | $SED -e "$sed_dirname"`
-      done
-      _G_dir_list=`$ECHO "$_G_dir_list" | $SED 's|:*$||'`
-
-      func_mkdir_p_IFS=$IFS; IFS=:
-      for _G_dir in $_G_dir_list; do
-	IFS=$func_mkdir_p_IFS
-        # mkdir can fail with a 'File exist' error if two processes
-        # try to create one of the directories concurrently.  Don't
-        # stop in that case!
-        $MKDIR "$_G_dir" 2>/dev/null || :
-      done
-      IFS=$func_mkdir_p_IFS
-
-      # Bail out if we (or some other process) failed to create a directory.
-      test -d "$_G_directory_path" || \
-        func_fatal_error "Failed to create '$1'"
-    fi
-}
-
-
-# func_mktempdir [BASENAME]
-# -------------------------
-# Make a temporary directory that won't clash with other running
-# libtool processes, and avoids race conditions if possible.  If
-# given, BASENAME is the basename for that directory.
-func_mktempdir ()
-{
-    $debug_cmd
-
-    _G_template=${TMPDIR-/tmp}/${1-$progname}
-
-    if test : = "$opt_dry_run"; then
-      # Return a directory name, but don't create it in dry-run mode
-      _G_tmpdir=$_G_template-$$
-    else
-
-      # If mktemp works, use that first and foremost
-      _G_tmpdir=`mktemp -d "$_G_template-XXXXXXXX" 2>/dev/null`
-
-      if test ! -d "$_G_tmpdir"; then
-        # Failing that, at least try and use $RANDOM to avoid a race
-        _G_tmpdir=$_G_template-${RANDOM-0}$$
-
-        func_mktempdir_umask=`umask`
-        umask 0077
-        $MKDIR "$_G_tmpdir"
-        umask $func_mktempdir_umask
-      fi
-
-      # If we're not in dry-run mode, bomb out on failure
-      test -d "$_G_tmpdir" || \
-        func_fatal_error "cannot create temporary directory '$_G_tmpdir'"
-    fi
-
-    $ECHO "$_G_tmpdir"
-}
-
-
-# func_normal_abspath PATH
-# ------------------------
-# Remove doubled-up and trailing slashes, "." path components,
-# and cancel out any ".." path components in PATH after making
-# it an absolute path.
-func_normal_abspath ()
-{
-    $debug_cmd
-
-    # These SED scripts presuppose an absolute path with a trailing slash.
-    _G_pathcar='s|^/\([^/]*\).*$|\1|'
-    _G_pathcdr='s|^/[^/]*||'
-    _G_removedotparts=':dotsl
-		s|/\./|/|g
-		t dotsl
-		s|/\.$|/|'
-    _G_collapseslashes='s|/\{1,\}|/|g'
-    _G_finalslash='s|/*$|/|'
-
-    # Start from root dir and reassemble the path.
-    func_normal_abspath_result=
-    func_normal_abspath_tpath=$1
-    func_normal_abspath_altnamespace=
-    case $func_normal_abspath_tpath in
-      "")
-        # Empty path, that just means $cwd.
-        func_stripname '' '/' "`pwd`"
-        func_normal_abspath_result=$func_stripname_result
-        return
-        ;;
-      # The next three entries are used to spot a run of precisely
-      # two leading slashes without using negated character classes;
-      # we take advantage of case's first-match behaviour.
-      ///*)
-        # Unusual form of absolute path, do nothing.
-        ;;
-      //*)
-        # Not necessarily an ordinary path; POSIX reserves leading '//'
-        # and for example Cygwin uses it to access remote file shares
-        # over CIFS/SMB, so we conserve a leading double slash if found.
-        func_normal_abspath_altnamespace=/
-        ;;
-      /*)
-        # Absolute path, do nothing.
-        ;;
-      *)
-        # Relative path, prepend $cwd.
-        func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath
-        ;;
-    esac
-
-    # Cancel out all the simple stuff to save iterations.  We also want
-    # the path to end with a slash for ease of parsing, so make sure
-    # there is one (and only one) here.
-    func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
-          -e "$_G_removedotparts" -e "$_G_collapseslashes" -e "$_G_finalslash"`
-    while :; do
-      # Processed it all yet?
-      if test / = "$func_normal_abspath_tpath"; then
-        # If we ascended to the root using ".." the result may be empty now.
-        if test -z "$func_normal_abspath_result"; then
-          func_normal_abspath_result=/
-        fi
-        break
-      fi
-      func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \
-          -e "$_G_pathcar"`
-      func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
-          -e "$_G_pathcdr"`
-      # Figure out what to do with it
-      case $func_normal_abspath_tcomponent in
-        "")
-          # Trailing empty path component, ignore it.
-          ;;
-        ..)
-          # Parent dir; strip last assembled component from result.
-          func_dirname "$func_normal_abspath_result"
-          func_normal_abspath_result=$func_dirname_result
-          ;;
-        *)
-          # Actual path component, append it.
-          func_append func_normal_abspath_result "/$func_normal_abspath_tcomponent"
-          ;;
-      esac
-    done
-    # Restore leading double-slash if one was found on entry.
-    func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result
-}
-
-
-# func_notquiet ARG...
-# --------------------
-# Echo program name prefixed message only when not in quiet mode.
-func_notquiet ()
-{
-    $debug_cmd
-
-    $opt_quiet || func_echo ${1+"$@"}
-
-    # A bug in bash halts the script if the last line of a function
-    # fails when set -e is in force, so we need another command to
-    # work around that:
-    :
-}
-
-
-# func_relative_path SRCDIR DSTDIR
-# --------------------------------
-# Set func_relative_path_result to the relative path from SRCDIR to DSTDIR.
-func_relative_path ()
-{
-    $debug_cmd
-
-    func_relative_path_result=
-    func_normal_abspath "$1"
-    func_relative_path_tlibdir=$func_normal_abspath_result
-    func_normal_abspath "$2"
-    func_relative_path_tbindir=$func_normal_abspath_result
-
-    # Ascend the tree starting from libdir
-    while :; do
-      # check if we have found a prefix of bindir
-      case $func_relative_path_tbindir in
-        $func_relative_path_tlibdir)
-          # found an exact match
-          func_relative_path_tcancelled=
-          break
-          ;;
-        $func_relative_path_tlibdir*)
-          # found a matching prefix
-          func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir"
-          func_relative_path_tcancelled=$func_stripname_result
-          if test -z "$func_relative_path_result"; then
-            func_relative_path_result=.
-          fi
-          break
-          ;;
-        *)
-          func_dirname $func_relative_path_tlibdir
-          func_relative_path_tlibdir=$func_dirname_result
-          if test -z "$func_relative_path_tlibdir"; then
-            # Have to descend all the way to the root!
-            func_relative_path_result=../$func_relative_path_result
-            func_relative_path_tcancelled=$func_relative_path_tbindir
-            break
-          fi
-          func_relative_path_result=../$func_relative_path_result
-          ;;
-      esac
-    done
-
-    # Now calculate path; take care to avoid doubling-up slashes.
-    func_stripname '' '/' "$func_relative_path_result"
-    func_relative_path_result=$func_stripname_result
-    func_stripname '/' '/' "$func_relative_path_tcancelled"
-    if test -n "$func_stripname_result"; then
-      func_append func_relative_path_result "/$func_stripname_result"
-    fi
-
-    # Normalisation. If bindir is libdir, return '.' else relative path.
-    if test -n "$func_relative_path_result"; then
-      func_stripname './' '' "$func_relative_path_result"
-      func_relative_path_result=$func_stripname_result
-    fi
-
-    test -n "$func_relative_path_result" || func_relative_path_result=.
-
-    :
-}
-
-
-# func_quote_for_eval ARG...
-# --------------------------
-# Aesthetically quote ARGs to be evaled later.
-# This function returns two values:
-#   i) func_quote_for_eval_result
-#      double-quoted, suitable for a subsequent eval
-#  ii) func_quote_for_eval_unquoted_result
-#      has all characters that are still active within double
-#      quotes backslashified.
-func_quote_for_eval ()
-{
-    $debug_cmd
-
-    func_quote_for_eval_unquoted_result=
-    func_quote_for_eval_result=
-    while test 0 -lt $#; do
-      case $1 in
-        *[\\\`\"\$]*)
-	  _G_unquoted_arg=`printf '%s\n' "$1" |$SED "$sed_quote_subst"` ;;
-        *)
-          _G_unquoted_arg=$1 ;;
-      esac
-      if test -n "$func_quote_for_eval_unquoted_result"; then
-	func_append func_quote_for_eval_unquoted_result " $_G_unquoted_arg"
-      else
-        func_append func_quote_for_eval_unquoted_result "$_G_unquoted_arg"
-      fi
-
-      case $_G_unquoted_arg in
-        # Double-quote args containing shell metacharacters to delay
-        # word splitting, command substitution and variable expansion
-        # for a subsequent eval.
-        # Many Bourne shells cannot handle close brackets correctly
-        # in scan sets, so we specify it separately.
-        *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
-          _G_quoted_arg=\"$_G_unquoted_arg\"
-          ;;
-        *)
-          _G_quoted_arg=$_G_unquoted_arg
-	  ;;
-      esac
-
-      if test -n "$func_quote_for_eval_result"; then
-	func_append func_quote_for_eval_result " $_G_quoted_arg"
-      else
-        func_append func_quote_for_eval_result "$_G_quoted_arg"
-      fi
-      shift
-    done
-}
-
-
-# func_quote_for_expand ARG
-# -------------------------
-# Aesthetically quote ARG to be evaled later; same as above,
-# but do not quote variable references.
-func_quote_for_expand ()
-{
-    $debug_cmd
-
-    case $1 in
-      *[\\\`\"]*)
-	_G_arg=`$ECHO "$1" | $SED \
-	    -e "$sed_double_quote_subst" -e "$sed_double_backslash"` ;;
-      *)
-        _G_arg=$1 ;;
-    esac
-
-    case $_G_arg in
-      # Double-quote args containing shell metacharacters to delay
-      # word splitting and command substitution for a subsequent eval.
-      # Many Bourne shells cannot handle close brackets correctly
-      # in scan sets, so we specify it separately.
-      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
-        _G_arg=\"$_G_arg\"
-        ;;
-    esac
-
-    func_quote_for_expand_result=$_G_arg
-}
-
-
-# func_stripname PREFIX SUFFIX NAME
-# ---------------------------------
-# strip PREFIX and SUFFIX from NAME, and store in func_stripname_result.
-# PREFIX and SUFFIX must not contain globbing or regex special
-# characters, hashes, percent signs, but SUFFIX may contain a leading
-# dot (in which case that matches only a dot).
-if test yes = "$_G_HAVE_XSI_OPS"; then
-  eval 'func_stripname ()
-  {
-    $debug_cmd
-
-    # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
-    # positional parameters, so assign one to ordinary variable first.
-    func_stripname_result=$3
-    func_stripname_result=${func_stripname_result#"$1"}
-    func_stripname_result=${func_stripname_result%"$2"}
-  }'
-else
-  func_stripname ()
-  {
-    $debug_cmd
-
-    case $2 in
-      .*) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%\\\\$2\$%%"`;;
-      *)  func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%$2\$%%"`;;
-    esac
-  }
-fi
-
-
-# func_show_eval CMD [FAIL_EXP]
-# -----------------------------
-# Unless opt_quiet is true, then output CMD.  Then, if opt_dryrun is
-# not true, evaluate CMD.  If the evaluation of CMD fails, and FAIL_EXP
-# is given, then evaluate it.
-func_show_eval ()
-{
-    $debug_cmd
-
-    _G_cmd=$1
-    _G_fail_exp=${2-':'}
-
-    func_quote_for_expand "$_G_cmd"
-    eval "func_notquiet $func_quote_for_expand_result"
-
-    $opt_dry_run || {
-      eval "$_G_cmd"
-      _G_status=$?
-      if test 0 -ne "$_G_status"; then
-	eval "(exit $_G_status); $_G_fail_exp"
-      fi
-    }
-}
-
-
-# func_show_eval_locale CMD [FAIL_EXP]
-# ------------------------------------
-# Unless opt_quiet is true, then output CMD.  Then, if opt_dryrun is
-# not true, evaluate CMD.  If the evaluation of CMD fails, and FAIL_EXP
-# is given, then evaluate it.  Use the saved locale for evaluation.
-func_show_eval_locale ()
-{
-    $debug_cmd
-
-    _G_cmd=$1
-    _G_fail_exp=${2-':'}
-
-    $opt_quiet || {
-      func_quote_for_expand "$_G_cmd"
-      eval "func_echo $func_quote_for_expand_result"
-    }
-
-    $opt_dry_run || {
-      eval "$_G_user_locale
-	    $_G_cmd"
-      _G_status=$?
-      eval "$_G_safe_locale"
-      if test 0 -ne "$_G_status"; then
-	eval "(exit $_G_status); $_G_fail_exp"
-      fi
-    }
-}
-
-
-# func_tr_sh
-# ----------
-# Turn $1 into a string suitable for a shell variable name.
-# Result is stored in $func_tr_sh_result.  All characters
-# not in the set a-zA-Z0-9_ are replaced with '_'. Further,
-# if $1 begins with a digit, a '_' is prepended as well.
-func_tr_sh ()
-{
-    $debug_cmd
-
-    case $1 in
-    [0-9]* | *[!a-zA-Z0-9_]*)
-      func_tr_sh_result=`$ECHO "$1" | $SED -e 's/^\([0-9]\)/_\1/' -e 's/[^a-zA-Z0-9_]/_/g'`
-      ;;
-    * )
-      func_tr_sh_result=$1
-      ;;
-    esac
-}
-
-
-# func_verbose ARG...
-# -------------------
-# Echo program name prefixed message in verbose mode only.
-func_verbose ()
-{
-    $debug_cmd
-
-    $opt_verbose && func_echo "$*"
-
-    :
-}
-
-
-# func_warn_and_continue ARG...
-# -----------------------------
-# Echo program name prefixed warning message to standard error.
-func_warn_and_continue ()
-{
-    $debug_cmd
-
-    $require_term_colors
-
-    func_echo_infix_1 "${tc_red}warning$tc_reset" "$*" >&2
-}
-
-
-# func_warning CATEGORY ARG...
-# ----------------------------
-# Echo program name prefixed warning message to standard error. Warning
-# messages can be filtered according to CATEGORY, where this function
-# elides messages where CATEGORY is not listed in the global variable
-# 'opt_warning_types'.
-func_warning ()
-{
-    $debug_cmd
-
-    # CATEGORY must be in the warning_categories list!
-    case " $warning_categories " in
-      *" $1 "*) ;;
-      *) func_internal_error "invalid warning category '$1'" ;;
-    esac
-
-    _G_category=$1
-    shift
-
-    case " $opt_warning_types " in
-      *" $_G_category "*) $warning_func ${1+"$@"} ;;
-    esac
-}
-
-
-# func_sort_ver VER1 VER2
-# -----------------------
-# 'sort -V' is not generally available.
-# Note this deviates from the version comparison in automake
-# in that it treats 1.5 < 1.5.0, and treats 1.4.4a < 1.4-p3a
-# but this should suffice as we won't be specifying old
-# version formats or redundant trailing .0 in bootstrap.conf.
-# If we did want full compatibility then we should probably
-# use m4_version_compare from autoconf.
-func_sort_ver ()
-{
-    $debug_cmd
-
-    printf '%s\n%s\n' "$1" "$2" \
-      | sort -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n -k 5,5n -k 6,6n -k 7,7n -k 8,8n -k 9,9n
-}
-
-# func_lt_ver PREV CURR
-# ---------------------
-# Return true if PREV and CURR are in the correct order according to
-# func_sort_ver, otherwise false.  Use it like this:
-#
-#  func_lt_ver "$prev_ver" "$proposed_ver" || func_fatal_error "..."
-func_lt_ver ()
-{
-    $debug_cmd
-
-    test "x$1" = x`func_sort_ver "$1" "$2" | $SED 1q`
-}
-
-
-# Local variables:
-# mode: shell-script
-# sh-indentation: 2
-# eval: (add-hook 'before-save-hook 'time-stamp)
-# time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC"
-# time-stamp-time-zone: "UTC"
-# End:
-#! /bin/sh
-
-# Set a version string for this script.
-scriptversion=2014-01-07.03; # UTC
-
-# A portable, pluggable option parser for Bourne shell.
-# Written by Gary V. Vaughan, 2010
-
-# Copyright (C) 2010-2015 Free Software Foundation, Inc.
-# This is free software; see the source for copying conditions.  There is NO
-# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-# Please report bugs or propose patches to gary at gnu.org.
-
-
-## ------ ##
-## Usage. ##
-## ------ ##
-
-# This file is a library for parsing options in your shell scripts along
-# with assorted other useful supporting features that you can make use
-# of too.
-#
-# For the simplest scripts you might need only:
-#
-#   #!/bin/sh
-#   . relative/path/to/funclib.sh
-#   . relative/path/to/options-parser
-#   scriptversion=1.0
-#   func_options ${1+"$@"}
-#   eval set dummy "$func_options_result"; shift
-#   ...rest of your script...
-#
-# In order for the '--version' option to work, you will need to have a
-# suitably formatted comment like the one at the top of this file
-# starting with '# Written by ' and ending with '# warranty; '.
-#
-# For '-h' and '--help' to work, you will also need a one line
-# description of your script's purpose in a comment directly above the
-# '# Written by ' line, like the one at the top of this file.
-#
-# The default options also support '--debug', which will turn on shell
-# execution tracing (see the comment above debug_cmd below for another
-# use), and '--verbose' and the func_verbose function to allow your script
-# to display verbose messages only when your user has specified
-# '--verbose'.
-#
-# After sourcing this file, you can plug processing for additional
-# options by amending the variables from the 'Configuration' section
-# below, and following the instructions in the 'Option parsing'
-# section further down.
-
-## -------------- ##
-## Configuration. ##
-## -------------- ##
-
-# You should override these variables in your script after sourcing this
-# file so that they reflect the customisations you have added to the
-# option parser.
-
-# The usage line for option parsing errors and the start of '-h' and
-# '--help' output messages. You can embed shell variables for delayed
-# expansion at the time the message is displayed, but you will need to
-# quote other shell meta-characters carefully to prevent them being
-# expanded when the contents are evaled.
-usage='$progpath [OPTION]...'
-
-# Short help message in response to '-h' and '--help'.  Add to this or
-# override it after sourcing this library to reflect the full set of
-# options your script accepts.
-usage_message="\
-       --debug        enable verbose shell tracing
-   -W, --warnings=CATEGORY
-                      report the warnings falling in CATEGORY [all]
-   -v, --verbose      verbosely report processing
-       --version      print version information and exit
-   -h, --help         print short or long help message and exit
-"
-
-# Additional text appended to 'usage_message' in response to '--help'.
-long_help_message="
-Warning categories include:
-       'all'          show all warnings
-       'none'         turn off all the warnings
-       'error'        warnings are treated as fatal errors"
-
-# Help message printed before fatal option parsing errors.
-fatal_help="Try '\$progname --help' for more information."
-
-
-
-## ------------------------- ##
-## Hook function management. ##
-## ------------------------- ##
-
-# This section contains functions for adding, removing, and running hooks
-# to the main code.  A hook is just a named list of of function, that can
-# be run in order later on.
-
-# func_hookable FUNC_NAME
-# -----------------------
-# Declare that FUNC_NAME will run hooks added with
-# 'func_add_hook FUNC_NAME ...'.
-func_hookable ()
-{
-    $debug_cmd
-
-    func_append hookable_fns " $1"
-}
-
-
-# func_add_hook FUNC_NAME HOOK_FUNC
-# ---------------------------------
-# Request that FUNC_NAME call HOOK_FUNC before it returns.  FUNC_NAME must
-# first have been declared "hookable" by a call to 'func_hookable'.
-func_add_hook ()
-{
-    $debug_cmd
-
-    case " $hookable_fns " in
-      *" $1 "*) ;;
-      *) func_fatal_error "'$1' does not accept hook functions." ;;
-    esac
-
-    eval func_append ${1}_hooks '" $2"'
-}
-
-
-# func_remove_hook FUNC_NAME HOOK_FUNC
-# ------------------------------------
-# Remove HOOK_FUNC from the list of functions called by FUNC_NAME.
-func_remove_hook ()
-{
-    $debug_cmd
-
-    eval ${1}_hooks='`$ECHO "\$'$1'_hooks" |$SED "s| '$2'||"`'
-}
-
-
-# func_run_hooks FUNC_NAME [ARG]...
-# ---------------------------------
-# Run all hook functions registered to FUNC_NAME.
-# It is assumed that the list of hook functions contains nothing more
-# than a whitespace-delimited list of legal shell function names, and
-# no effort is wasted trying to catch shell meta-characters or preserve
-# whitespace.
-func_run_hooks ()
-{
-    $debug_cmd
-
-    case " $hookable_fns " in
-      *" $1 "*) ;;
-      *) func_fatal_error "'$1' does not support hook funcions.n" ;;
-    esac
-
-    eval _G_hook_fns=\$$1_hooks; shift
-
-    for _G_hook in $_G_hook_fns; do
-      eval $_G_hook '"$@"'
-
-      # store returned options list back into positional
-      # parameters for next 'cmd' execution.
-      eval _G_hook_result=\$${_G_hook}_result
-      eval set dummy "$_G_hook_result"; shift
-    done
-
-    func_quote_for_eval ${1+"$@"}
-    func_run_hooks_result=$func_quote_for_eval_result
-}
-
-
-
-## --------------- ##
-## Option parsing. ##
-## --------------- ##
-
-# In order to add your own option parsing hooks, you must accept the
-# full positional parameter list in your hook function, remove any
-# options that you action, and then pass back the remaining unprocessed
-# options in '<hooked_function_name>_result', escaped suitably for
-# 'eval'.  Like this:
-#
-#    my_options_prep ()
-#    {
-#        $debug_cmd
-#
-#        # Extend the existing usage message.
-#        usage_message=$usage_message'
-#      -s, --silent       don'\''t print informational messages
-#    '
-#
-#        func_quote_for_eval ${1+"$@"}
-#        my_options_prep_result=$func_quote_for_eval_result
-#    }
-#    func_add_hook func_options_prep my_options_prep
-#
-#
-#    my_silent_option ()
-#    {
-#        $debug_cmd
-#
-#        # Note that for efficiency, we parse as many options as we can
-#        # recognise in a loop before passing the remainder back to the
-#        # caller on the first unrecognised argument we encounter.
-#        while test $# -gt 0; do
-#          opt=$1; shift
-#          case $opt in
-#            --silent|-s) opt_silent=: ;;
-#            # Separate non-argument short options:
-#            -s*)         func_split_short_opt "$_G_opt"
-#                         set dummy "$func_split_short_opt_name" \
-#                             "-$func_split_short_opt_arg" ${1+"$@"}
-#                         shift
-#                         ;;
-#            *)            set dummy "$_G_opt" "$*"; shift; break ;;
-#          esac
-#        done
-#
-#        func_quote_for_eval ${1+"$@"}
-#        my_silent_option_result=$func_quote_for_eval_result
-#    }
-#    func_add_hook func_parse_options my_silent_option
-#
-#
-#    my_option_validation ()
-#    {
-#        $debug_cmd
-#
-#        $opt_silent && $opt_verbose && func_fatal_help "\
-#    '--silent' and '--verbose' options are mutually exclusive."
-#
-#        func_quote_for_eval ${1+"$@"}
-#        my_option_validation_result=$func_quote_for_eval_result
-#    }
-#    func_add_hook func_validate_options my_option_validation
-#
-# You'll alse need to manually amend $usage_message to reflect the extra
-# options you parse.  It's preferable to append if you can, so that
-# multiple option parsing hooks can be added safely.
-
-
-# func_options [ARG]...
-# ---------------------
-# All the functions called inside func_options are hookable. See the
-# individual implementations for details.
-func_hookable func_options
-func_options ()
-{
-    $debug_cmd
-
-    func_options_prep ${1+"$@"}
-    eval func_parse_options \
-        ${func_options_prep_result+"$func_options_prep_result"}
-    eval func_validate_options \
-        ${func_parse_options_result+"$func_parse_options_result"}
-
-    eval func_run_hooks func_options \
-        ${func_validate_options_result+"$func_validate_options_result"}
-
-    # save modified positional parameters for caller
-    func_options_result=$func_run_hooks_result
-}
-
-
-# func_options_prep [ARG]...
-# --------------------------
-# All initialisations required before starting the option parse loop.
-# Note that when calling hook functions, we pass through the list of
-# positional parameters.  If a hook function modifies that list, and
-# needs to propogate that back to rest of this script, then the complete
-# modified list must be put in 'func_run_hooks_result' before
-# returning.
-func_hookable func_options_prep
-func_options_prep ()
-{
-    $debug_cmd
-
-    # Option defaults:
-    opt_verbose=false
-    opt_warning_types=
-
-    func_run_hooks func_options_prep ${1+"$@"}
-
-    # save modified positional parameters for caller
-    func_options_prep_result=$func_run_hooks_result
-}
-
-
-# func_parse_options [ARG]...
-# ---------------------------
-# The main option parsing loop.
-func_hookable func_parse_options
-func_parse_options ()
-{
-    $debug_cmd
-
-    func_parse_options_result=
-
-    # this just eases exit handling
-    while test $# -gt 0; do
-      # Defer to hook functions for initial option parsing, so they
-      # get priority in the event of reusing an option name.
-      func_run_hooks func_parse_options ${1+"$@"}
-
-      # Adjust func_parse_options positional parameters to match
-      eval set dummy "$func_run_hooks_result"; shift
-
-      # Break out of the loop if we already parsed every option.
-      test $# -gt 0 || break
-
-      _G_opt=$1
-      shift
-      case $_G_opt in
-        --debug|-x)   debug_cmd='set -x'
-                      func_echo "enabling shell trace mode"
-                      $debug_cmd
-                      ;;
-
-        --no-warnings|--no-warning|--no-warn)
-                      set dummy --warnings none ${1+"$@"}
-                      shift
-		      ;;
-
-        --warnings|--warning|-W)
-                      test $# = 0 && func_missing_arg $_G_opt && break
-                      case " $warning_categories $1" in
-                        *" $1 "*)
-                          # trailing space prevents matching last $1 above
-                          func_append_uniq opt_warning_types " $1"
-                          ;;
-                        *all)
-                          opt_warning_types=$warning_categories
-                          ;;
-                        *none)
-                          opt_warning_types=none
-                          warning_func=:
-                          ;;
-                        *error)
-                          opt_warning_types=$warning_categories
-                          warning_func=func_fatal_error
-                          ;;
-                        *)
-                          func_fatal_error \
-                             "unsupported warning category: '$1'"
-                          ;;
-                      esac
-                      shift
-                      ;;
-
-        --verbose|-v) opt_verbose=: ;;
-        --version)    func_version ;;
-        -\?|-h)       func_usage ;;
-        --help)       func_help ;;
-
-	# Separate optargs to long options (plugins may need this):
-	--*=*)        func_split_equals "$_G_opt"
-	              set dummy "$func_split_equals_lhs" \
-                          "$func_split_equals_rhs" ${1+"$@"}
-                      shift
-                      ;;
-
-       # Separate optargs to short options:
-        -W*)
-                      func_split_short_opt "$_G_opt"
-                      set dummy "$func_split_short_opt_name" \
-                          "$func_split_short_opt_arg" ${1+"$@"}
-                      shift
-                      ;;
-
-        # Separate non-argument short options:
-        -\?*|-h*|-v*|-x*)
-                      func_split_short_opt "$_G_opt"
-                      set dummy "$func_split_short_opt_name" \
-                          "-$func_split_short_opt_arg" ${1+"$@"}
-                      shift
-                      ;;
-
-        --)           break ;;
-        -*)           func_fatal_help "unrecognised option: '$_G_opt'" ;;
-        *)            set dummy "$_G_opt" ${1+"$@"}; shift; break ;;
-      esac
-    done
-
-    # save modified positional parameters for caller
-    func_quote_for_eval ${1+"$@"}
-    func_parse_options_result=$func_quote_for_eval_result
-}
-
-
-# func_validate_options [ARG]...
-# ------------------------------
-# Perform any sanity checks on option settings and/or unconsumed
-# arguments.
-func_hookable func_validate_options
-func_validate_options ()
-{
-    $debug_cmd
-
-    # Display all warnings if -W was not given.
-    test -n "$opt_warning_types" || opt_warning_types=" $warning_categories"
-
-    func_run_hooks func_validate_options ${1+"$@"}
-
-    # Bail if the options were screwed!
-    $exit_cmd $EXIT_FAILURE
-
-    # save modified positional parameters for caller
-    func_validate_options_result=$func_run_hooks_result
-}
-
-
-
-## ----------------- ##
-## Helper functions. ##
-## ----------------- ##
-
-# This section contains the helper functions used by the rest of the
-# hookable option parser framework in ascii-betical order.
-
-
-# func_fatal_help ARG...
-# ----------------------
-# Echo program name prefixed message to standard error, followed by
-# a help hint, and exit.
-func_fatal_help ()
-{
-    $debug_cmd
-
-    eval \$ECHO \""Usage: $usage"\"
-    eval \$ECHO \""$fatal_help"\"
-    func_error ${1+"$@"}
-    exit $EXIT_FAILURE
-}
-
-
-# func_help
-# ---------
-# Echo long help message to standard output and exit.
-func_help ()
-{
-    $debug_cmd
-
-    func_usage_message
-    $ECHO "$long_help_message"
-    exit 0
-}
-
-
-# func_missing_arg ARGNAME
-# ------------------------
-# Echo program name prefixed message to standard error and set global
-# exit_cmd.
-func_missing_arg ()
-{
-    $debug_cmd
-
-    func_error "Missing argument for '$1'."
-    exit_cmd=exit
-}
-
-
-# func_split_equals STRING
-# ------------------------
-# Set func_split_equals_lhs and func_split_equals_rhs shell variables after
-# splitting STRING at the '=' sign.
-test -z "$_G_HAVE_XSI_OPS" \
-    && (eval 'x=a/b/c;
-      test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \
-    && _G_HAVE_XSI_OPS=yes
-
-if test yes = "$_G_HAVE_XSI_OPS"
-then
-  # This is an XSI compatible shell, allowing a faster implementation...
-  eval 'func_split_equals ()
-  {
-      $debug_cmd
-
-      func_split_equals_lhs=${1%%=*}
-      func_split_equals_rhs=${1#*=}
-      test "x$func_split_equals_lhs" = "x$1" \
-        && func_split_equals_rhs=
-  }'
-else
-  # ...otherwise fall back to using expr, which is often a shell builtin.
-  func_split_equals ()
-  {
-      $debug_cmd
-
-      func_split_equals_lhs=`expr "x$1" : 'x\([^=]*\)'`
-      func_split_equals_rhs=
-      test "x$func_split_equals_lhs" = "x$1" \
-        || func_split_equals_rhs=`expr "x$1" : 'x[^=]*=\(.*\)$'`
-  }
-fi #func_split_equals
-
-
-# func_split_short_opt SHORTOPT
-# -----------------------------
-# Set func_split_short_opt_name and func_split_short_opt_arg shell
-# variables after splitting SHORTOPT after the 2nd character.
-if test yes = "$_G_HAVE_XSI_OPS"
-then
-  # This is an XSI compatible shell, allowing a faster implementation...
-  eval 'func_split_short_opt ()
-  {
-      $debug_cmd
-
-      func_split_short_opt_arg=${1#??}
-      func_split_short_opt_name=${1%"$func_split_short_opt_arg"}
-  }'
-else
-  # ...otherwise fall back to using expr, which is often a shell builtin.
-  func_split_short_opt ()
-  {
-      $debug_cmd
-
-      func_split_short_opt_name=`expr "x$1" : 'x-\(.\)'`
-      func_split_short_opt_arg=`expr "x$1" : 'x-.\(.*\)$'`
-  }
-fi #func_split_short_opt
-
-
-# func_usage
-# ----------
-# Echo short help message to standard output and exit.
-func_usage ()
-{
-    $debug_cmd
-
-    func_usage_message
-    $ECHO "Run '$progname --help |${PAGER-more}' for full usage"
-    exit 0
-}
-
-
-# func_usage_message
-# ------------------
-# Echo short help message to standard output.
-func_usage_message ()
-{
-    $debug_cmd
-
-    eval \$ECHO \""Usage: $usage"\"
-    echo
-    $SED -n 's|^# ||
-        /^Written by/{
-          x;p;x
-        }
-	h
-	/^Written by/q' < "$progpath"
-    echo
-    eval \$ECHO \""$usage_message"\"
-}
-
-
-# func_version
-# ------------
-# Echo version message to standard output and exit.
-func_version ()
-{
-    $debug_cmd
-
-    printf '%s\n' "$progname $scriptversion"
-    $SED -n '
-        /(C)/!b go
-        :more
-        /\./!{
-          N
-          s|\n# | |
-          b more
-        }
-        :go
-        /^# Written by /,/# warranty; / {
-          s|^# ||
-          s|^# *$||
-          s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2|
-          p
-        }
-        /^# Written by / {
-          s|^# ||
-          p
-        }
-        /^warranty; /q' < "$progpath"
-
-    exit $?
-}
-
-
-# Local variables:
-# mode: shell-script
-# sh-indentation: 2
-# eval: (add-hook 'before-save-hook 'time-stamp)
-# time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC"
-# time-stamp-time-zone: "UTC"
-# End:
-
-# Set a version string.
-scriptversion='(GNU libtool) 2.4.6'
-
-
-# func_echo ARG...
-# ----------------
-# Libtool also displays the current mode in messages, so override
-# funclib.sh func_echo with this custom definition.
-func_echo ()
-{
-    $debug_cmd
-
-    _G_message=$*
-
-    func_echo_IFS=$IFS
-    IFS=$nl
-    for _G_line in $_G_message; do
-      IFS=$func_echo_IFS
-      $ECHO "$progname${opt_mode+: $opt_mode}: $_G_line"
-    done
-    IFS=$func_echo_IFS
-}
-
-
-# func_warning ARG...
-# -------------------
-# Libtool warnings are not categorized, so override funclib.sh
-# func_warning with this simpler definition.
-func_warning ()
-{
-    $debug_cmd
-
-    $warning_func ${1+"$@"}
-}
-
-
-## ---------------- ##
-## Options parsing. ##
-## ---------------- ##
-
-# Hook in the functions to make sure our own options are parsed during
-# the option parsing loop.
-
-usage='$progpath [OPTION]... [MODE-ARG]...'
-
-# Short help message in response to '-h'.
-usage_message="Options:
-       --config             show all configuration variables
-       --debug              enable verbose shell tracing
-   -n, --dry-run            display commands without modifying any files
-       --features           display basic configuration information and exit
-       --mode=MODE          use operation mode MODE
-       --no-warnings        equivalent to '-Wnone'
-       --preserve-dup-deps  don't remove duplicate dependency libraries
-       --quiet, --silent    don't print informational messages
-       --tag=TAG            use configuration variables from tag TAG
-   -v, --verbose            print more informational messages than default
-       --version            print version information
-   -W, --warnings=CATEGORY  report the warnings falling in CATEGORY [all]
-   -h, --help, --help-all   print short, long, or detailed help message
-"
-
-# Additional text appended to 'usage_message' in response to '--help'.
-func_help ()
-{
-    $debug_cmd
-
-    func_usage_message
-    $ECHO "$long_help_message
-
-MODE must be one of the following:
-
-       clean           remove files from the build directory
-       compile         compile a source file into a libtool object
-       execute         automatically set library path, then run a program
-       finish          complete the installation of libtool libraries
-       install         install libraries or executables
-       link            create a library or an executable
-       uninstall       remove libraries from an installed directory
-
-MODE-ARGS vary depending on the MODE.  When passed as first option,
-'--mode=MODE' may be abbreviated as 'MODE' or a unique abbreviation of that.
-Try '$progname --help --mode=MODE' for a more detailed description of MODE.
-
-When reporting a bug, please describe a test case to reproduce it and
-include the following information:
-
-       host-triplet:   $host
-       shell:          $SHELL
-       compiler:       $LTCC
-       compiler flags: $LTCFLAGS
-       linker:         $LD (gnu? $with_gnu_ld)
-       version:        $progname (GNU libtool) 2.4.6
-       automake:       `($AUTOMAKE --version) 2>/dev/null |$SED 1q`
-       autoconf:       `($AUTOCONF --version) 2>/dev/null |$SED 1q`
-
-Report bugs to <bug-libtool at gnu.org>.
-GNU libtool home page: <http://www.gnu.org/software/libtool/>.
-General help using GNU software: <http://www.gnu.org/gethelp/>."
-    exit 0
-}
-
-
-# func_lo2o OBJECT-NAME
-# ---------------------
-# Transform OBJECT-NAME from a '.lo' suffix to the platform specific
-# object suffix.
-
-lo2o=s/\\.lo\$/.$objext/
-o2lo=s/\\.$objext\$/.lo/
-
-if test yes = "$_G_HAVE_XSI_OPS"; then
-  eval 'func_lo2o ()
-  {
-    case $1 in
-      *.lo) func_lo2o_result=${1%.lo}.$objext ;;
-      *   ) func_lo2o_result=$1               ;;
-    esac
-  }'
-
-  # func_xform LIBOBJ-OR-SOURCE
-  # ---------------------------
-  # Transform LIBOBJ-OR-SOURCE from a '.o' or '.c' (or otherwise)
-  # suffix to a '.lo' libtool-object suffix.
-  eval 'func_xform ()
-  {
-    func_xform_result=${1%.*}.lo
-  }'
-else
-  # ...otherwise fall back to using sed.
-  func_lo2o ()
-  {
-    func_lo2o_result=`$ECHO "$1" | $SED "$lo2o"`
-  }
-
-  func_xform ()
-  {
-    func_xform_result=`$ECHO "$1" | $SED 's|\.[^.]*$|.lo|'`
-  }
-fi
-
-
-# func_fatal_configuration ARG...
-# -------------------------------
-# Echo program name prefixed message to standard error, followed by
-# a configuration failure hint, and exit.
-func_fatal_configuration ()
-{
-    func__fatal_error ${1+"$@"} \
-      "See the $PACKAGE documentation for more information." \
-      "Fatal configuration error."
-}
-
-
-# func_config
-# -----------
-# Display the configuration for all the tags in this script.
-func_config ()
-{
-    re_begincf='^# ### BEGIN LIBTOOL'
-    re_endcf='^# ### END LIBTOOL'
-
-    # Default configuration.
-    $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath"
-
-    # Now print the configurations for the tags.
-    for tagname in $taglist; do
-      $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath"
-    done
-
-    exit $?
-}
-
-
-# func_features
-# -------------
-# Display the features supported by this script.
-func_features ()
-{
-    echo "host: $host"
-    if test yes = "$build_libtool_libs"; then
-      echo "enable shared libraries"
-    else
-      echo "disable shared libraries"
-    fi
-    if test yes = "$build_old_libs"; then
-      echo "enable static libraries"
-    else
-      echo "disable static libraries"
-    fi
-
-    exit $?
-}
-
-
-# func_enable_tag TAGNAME
-# -----------------------
-# Verify that TAGNAME is valid, and either flag an error and exit, or
-# enable the TAGNAME tag.  We also add TAGNAME to the global $taglist
-# variable here.
-func_enable_tag ()
-{
-    # Global variable:
-    tagname=$1
-
-    re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
-    re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
-    sed_extractcf=/$re_begincf/,/$re_endcf/p
-
-    # Validate tagname.
-    case $tagname in
-      *[!-_A-Za-z0-9,/]*)
-        func_fatal_error "invalid tag name: $tagname"
-        ;;
-    esac
-
-    # Don't test for the "default" C tag, as we know it's
-    # there but not specially marked.
-    case $tagname in
-        CC) ;;
-    *)
-        if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then
-	  taglist="$taglist $tagname"
-
-	  # Evaluate the configuration.  Be careful to quote the path
-	  # and the sed script, to avoid splitting on whitespace, but
-	  # also don't use non-portable quotes within backquotes within
-	  # quotes we have to do it in 2 steps:
-	  extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"`
-	  eval "$extractedcf"
-        else
-	  func_error "ignoring unknown tag $tagname"
-        fi
-        ;;
-    esac
-}
-
-
-# func_check_version_match
-# ------------------------
-# Ensure that we are using m4 macros, and libtool script from the same
-# release of libtool.
-func_check_version_match ()
-{
-    if test "$package_revision" != "$macro_revision"; then
-      if test "$VERSION" != "$macro_version"; then
-        if test -z "$macro_version"; then
-          cat >&2 <<_LT_EOF
-$progname: Version mismatch error.  This is $PACKAGE $VERSION, but the
-$progname: definition of this LT_INIT comes from an older release.
-$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
-$progname: and run autoconf again.
-_LT_EOF
-        else
-          cat >&2 <<_LT_EOF
-$progname: Version mismatch error.  This is $PACKAGE $VERSION, but the
-$progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
-$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
-$progname: and run autoconf again.
-_LT_EOF
-        fi
-      else
-        cat >&2 <<_LT_EOF
-$progname: Version mismatch error.  This is $PACKAGE $VERSION, revision $package_revision,
-$progname: but the definition of this LT_INIT comes from revision $macro_revision.
-$progname: You should recreate aclocal.m4 with macros from revision $package_revision
-$progname: of $PACKAGE $VERSION and run autoconf again.
-_LT_EOF
-      fi
-
-      exit $EXIT_MISMATCH
-    fi
-}
-
-
-# libtool_options_prep [ARG]...
-# -----------------------------
-# Preparation for options parsed by libtool.
-libtool_options_prep ()
-{
-    $debug_mode
-
-    # Option defaults:
-    opt_config=false
-    opt_dlopen=
-    opt_dry_run=false
-    opt_help=false
-    opt_mode=
-    opt_preserve_dup_deps=false
-    opt_quiet=false
-
-    nonopt=
-    preserve_args=
-
-    # Shorthand for --mode=foo, only valid as the first argument
-    case $1 in
-    clean|clea|cle|cl)
-      shift; set dummy --mode clean ${1+"$@"}; shift
-      ;;
-    compile|compil|compi|comp|com|co|c)
-      shift; set dummy --mode compile ${1+"$@"}; shift
-      ;;
-    execute|execut|execu|exec|exe|ex|e)
-      shift; set dummy --mode execute ${1+"$@"}; shift
-      ;;
-    finish|finis|fini|fin|fi|f)
-      shift; set dummy --mode finish ${1+"$@"}; shift
-      ;;
-    install|instal|insta|inst|ins|in|i)
-      shift; set dummy --mode install ${1+"$@"}; shift
-      ;;
-    link|lin|li|l)
-      shift; set dummy --mode link ${1+"$@"}; shift
-      ;;
-    uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
-      shift; set dummy --mode uninstall ${1+"$@"}; shift
-      ;;
-    esac
-
-    # Pass back the list of options.
-    func_quote_for_eval ${1+"$@"}
-    libtool_options_prep_result=$func_quote_for_eval_result
-}
-func_add_hook func_options_prep libtool_options_prep
-
-
-# libtool_parse_options [ARG]...
-# ---------------------------------
-# Provide handling for libtool specific options.
-libtool_parse_options ()
-{
-    $debug_cmd
-
-    # Perform our own loop to consume as many options as possible in
-    # each iteration.
-    while test $# -gt 0; do
-      _G_opt=$1
-      shift
-      case $_G_opt in
-        --dry-run|--dryrun|-n)
-                        opt_dry_run=:
-                        ;;
-
-        --config)       func_config ;;
-
-        --dlopen|-dlopen)
-                        opt_dlopen="${opt_dlopen+$opt_dlopen
-}$1"
-                        shift
-                        ;;
-
-        --preserve-dup-deps)
-                        opt_preserve_dup_deps=: ;;
-
-        --features)     func_features ;;
-
-        --finish)       set dummy --mode finish ${1+"$@"}; shift ;;
-
-        --help)         opt_help=: ;;
-
-        --help-all)     opt_help=': help-all' ;;
-
-        --mode)         test $# = 0 && func_missing_arg $_G_opt && break
-                        opt_mode=$1
-                        case $1 in
-                          # Valid mode arguments:
-                          clean|compile|execute|finish|install|link|relink|uninstall) ;;
-
-                          # Catch anything else as an error
-                          *) func_error "invalid argument for $_G_opt"
-                             exit_cmd=exit
-                             break
-                             ;;
-                        esac
-                        shift
-                        ;;
-
-        --no-silent|--no-quiet)
-                        opt_quiet=false
-                        func_append preserve_args " $_G_opt"
-                        ;;
-
-        --no-warnings|--no-warning|--no-warn)
-                        opt_warning=false
-                        func_append preserve_args " $_G_opt"
-                        ;;
-
-        --no-verbose)
-                        opt_verbose=false
-                        func_append preserve_args " $_G_opt"
-                        ;;
-
-        --silent|--quiet)
-                        opt_quiet=:
-                        opt_verbose=false
-                        func_append preserve_args " $_G_opt"
-                        ;;
-
-        --tag)          test $# = 0 && func_missing_arg $_G_opt && break
-                        opt_tag=$1
-                        func_append preserve_args " $_G_opt $1"
-                        func_enable_tag "$1"
-                        shift
-                        ;;
-
-        --verbose|-v)   opt_quiet=false
-                        opt_verbose=:
-                        func_append preserve_args " $_G_opt"
-                        ;;
-
-	# An option not handled by this hook function:
-        *)		set dummy "$_G_opt" ${1+"$@"};	shift; break  ;;
-      esac
-    done
-
-
-    # save modified positional parameters for caller
-    func_quote_for_eval ${1+"$@"}
-    libtool_parse_options_result=$func_quote_for_eval_result
-}
-func_add_hook func_parse_options libtool_parse_options
-
-
-
-# libtool_validate_options [ARG]...
-# ---------------------------------
-# Perform any sanity checks on option settings and/or unconsumed
-# arguments.
-libtool_validate_options ()
-{
-    # save first non-option argument
-    if test 0 -lt $#; then
-      nonopt=$1
-      shift
-    fi
-
-    # preserve --debug
-    test : = "$debug_cmd" || func_append preserve_args " --debug"
-
-    case $host in
-      # Solaris2 added to fix http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16452
-      # see also: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59788
-      *cygwin* | *mingw* | *pw32* | *cegcc* | *solaris2* | *os2*)
-        # don't eliminate duplications in $postdeps and $predeps
-        opt_duplicate_compiler_generated_deps=:
-        ;;
-      *)
-        opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps
-        ;;
-    esac
-
-    $opt_help || {
-      # Sanity checks first:
-      func_check_version_match
-
-      test yes != "$build_libtool_libs" \
-        && test yes != "$build_old_libs" \
-        && func_fatal_configuration "not configured to build any kind of library"
-
-      # Darwin sucks
-      eval std_shrext=\"$shrext_cmds\"
-
-      # Only execute mode is allowed to have -dlopen flags.
-      if test -n "$opt_dlopen" && test execute != "$opt_mode"; then
-        func_error "unrecognized option '-dlopen'"
-        $ECHO "$help" 1>&2
-        exit $EXIT_FAILURE
-      fi
-
-      # Change the help message to a mode-specific one.
-      generic_help=$help
-      help="Try '$progname --help --mode=$opt_mode' for more information."
-    }
-
-    # Pass back the unparsed argument list
-    func_quote_for_eval ${1+"$@"}
-    libtool_validate_options_result=$func_quote_for_eval_result
-}
-func_add_hook func_validate_options libtool_validate_options
-
-
-# Process options as early as possible so that --help and --version
-# can return quickly.
-func_options ${1+"$@"}
-eval set dummy "$func_options_result"; shift
-
-
-
-## ----------- ##
-##    Main.    ##
-## ----------- ##
-
-magic='%%%MAGIC variable%%%'
-magic_exe='%%%MAGIC EXE variable%%%'
-
-# Global variables.
-extracted_archives=
-extracted_serial=0
-
-# If this variable is set in any of the actions, the command in it
-# will be execed at the end.  This prevents here-documents from being
-# left over by shells.
-exec_cmd=
-
-
-# A function that is used when there is no print builtin or printf.
-func_fallback_echo ()
-{
-  eval 'cat <<_LTECHO_EOF
-$1
-_LTECHO_EOF'
-}
-
-# func_generated_by_libtool
-# True iff stdin has been generated by Libtool. This function is only
-# a basic sanity check; it will hardly flush out determined imposters.
-func_generated_by_libtool_p ()
-{
-  $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
-}
-
-# func_lalib_p file
-# True iff FILE is a libtool '.la' library or '.lo' object file.
-# This function is only a basic sanity check; it will hardly flush out
-# determined imposters.
-func_lalib_p ()
-{
-    test -f "$1" &&
-      $SED -e 4q "$1" 2>/dev/null | func_generated_by_libtool_p
-}
-
-# func_lalib_unsafe_p file
-# True iff FILE is a libtool '.la' library or '.lo' object file.
-# This function implements the same check as func_lalib_p without
-# resorting to external programs.  To this end, it redirects stdin and
-# closes it afterwards, without saving the original file descriptor.
-# As a safety measure, use it only where a negative result would be
-# fatal anyway.  Works if 'file' does not exist.
-func_lalib_unsafe_p ()
-{
-    lalib_p=no
-    if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then
-	for lalib_p_l in 1 2 3 4
-	do
-	    read lalib_p_line
-	    case $lalib_p_line in
-		\#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;;
-	    esac
-	done
-	exec 0<&5 5<&-
-    fi
-    test yes = "$lalib_p"
-}
-
-# func_ltwrapper_script_p file
-# True iff FILE is a libtool wrapper script
-# This function is only a basic sanity check; it will hardly flush out
-# determined imposters.
-func_ltwrapper_script_p ()
-{
-    test -f "$1" &&
-      $lt_truncate_bin < "$1" 2>/dev/null | func_generated_by_libtool_p
-}
-
-# func_ltwrapper_executable_p file
-# True iff FILE is a libtool wrapper executable
-# This function is only a basic sanity check; it will hardly flush out
-# determined imposters.
-func_ltwrapper_executable_p ()
-{
-    func_ltwrapper_exec_suffix=
-    case $1 in
-    *.exe) ;;
-    *) func_ltwrapper_exec_suffix=.exe ;;
-    esac
-    $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1
-}
-
-# func_ltwrapper_scriptname file
-# Assumes file is an ltwrapper_executable
-# uses $file to determine the appropriate filename for a
-# temporary ltwrapper_script.
-func_ltwrapper_scriptname ()
-{
-    func_dirname_and_basename "$1" "" "."
-    func_stripname '' '.exe' "$func_basename_result"
-    func_ltwrapper_scriptname_result=$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper
-}
-
-# func_ltwrapper_p file
-# True iff FILE is a libtool wrapper script or wrapper executable
-# This function is only a basic sanity check; it will hardly flush out
-# determined imposters.
-func_ltwrapper_p ()
-{
-    func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1"
-}
-
-
-# func_execute_cmds commands fail_cmd
-# Execute tilde-delimited COMMANDS.
-# If FAIL_CMD is given, eval that upon failure.
-# FAIL_CMD may read-access the current command in variable CMD!
-func_execute_cmds ()
-{
-    $debug_cmd
-
-    save_ifs=$IFS; IFS='~'
-    for cmd in $1; do
-      IFS=$sp$nl
-      eval cmd=\"$cmd\"
-      IFS=$save_ifs
-      func_show_eval "$cmd" "${2-:}"
-    done
-    IFS=$save_ifs
-}
-
-
-# func_source file
-# Source FILE, adding directory component if necessary.
-# Note that it is not necessary on cygwin/mingw to append a dot to
-# FILE even if both FILE and FILE.exe exist: automatic-append-.exe
-# behavior happens only for exec(3), not for open(2)!  Also, sourcing
-# 'FILE.' does not work on cygwin managed mounts.
-func_source ()
-{
-    $debug_cmd
-
-    case $1 in
-    */* | *\\*)	. "$1" ;;
-    *)		. "./$1" ;;
-    esac
-}
-
-
-# func_resolve_sysroot PATH
-# Replace a leading = in PATH with a sysroot.  Store the result into
-# func_resolve_sysroot_result
-func_resolve_sysroot ()
-{
-  func_resolve_sysroot_result=$1
-  case $func_resolve_sysroot_result in
-  =*)
-    func_stripname '=' '' "$func_resolve_sysroot_result"
-    func_resolve_sysroot_result=$lt_sysroot$func_stripname_result
-    ;;
-  esac
-}
-
-# func_replace_sysroot PATH
-# If PATH begins with the sysroot, replace it with = and
-# store the result into func_replace_sysroot_result.
-func_replace_sysroot ()
-{
-  case $lt_sysroot:$1 in
-  ?*:"$lt_sysroot"*)
-    func_stripname "$lt_sysroot" '' "$1"
-    func_replace_sysroot_result='='$func_stripname_result
-    ;;
-  *)
-    # Including no sysroot.
-    func_replace_sysroot_result=$1
-    ;;
-  esac
-}
-
-# func_infer_tag arg
-# Infer tagged configuration to use if any are available and
-# if one wasn't chosen via the "--tag" command line option.
-# Only attempt this if the compiler in the base compile
-# command doesn't match the default compiler.
-# arg is usually of the form 'gcc ...'
-func_infer_tag ()
-{
-    $debug_cmd
-
-    if test -n "$available_tags" && test -z "$tagname"; then
-      CC_quoted=
-      for arg in $CC; do
-	func_append_quoted CC_quoted "$arg"
-      done
-      CC_expanded=`func_echo_all $CC`
-      CC_quoted_expanded=`func_echo_all $CC_quoted`
-      case $@ in
-      # Blanks in the command may have been stripped by the calling shell,
-      # but not from the CC environment variable when configure was run.
-      " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
-      " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;;
-      # Blanks at the start of $base_compile will cause this to fail
-      # if we don't check for them as well.
-      *)
-	for z in $available_tags; do
-	  if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
-	    # Evaluate the configuration.
-	    eval "`$SED -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
-	    CC_quoted=
-	    for arg in $CC; do
-	      # Double-quote args containing other shell metacharacters.
-	      func_append_quoted CC_quoted "$arg"
-	    done
-	    CC_expanded=`func_echo_all $CC`
-	    CC_quoted_expanded=`func_echo_all $CC_quoted`
-	    case "$@ " in
-	    " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
-	    " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*)
-	      # The compiler in the base compile command matches
-	      # the one in the tagged configuration.
-	      # Assume this is the tagged configuration we want.
-	      tagname=$z
-	      break
-	      ;;
-	    esac
-	  fi
-	done
-	# If $tagname still isn't set, then no tagged configuration
-	# was found and let the user know that the "--tag" command
-	# line option must be used.
-	if test -z "$tagname"; then
-	  func_echo "unable to infer tagged configuration"
-	  func_fatal_error "specify a tag with '--tag'"
-#	else
-#	  func_verbose "using $tagname tagged configuration"
-	fi
-	;;
-      esac
-    fi
-}
-
-
-
-# func_write_libtool_object output_name pic_name nonpic_name
-# Create a libtool object file (analogous to a ".la" file),
-# but don't create it if we're doing a dry run.
-func_write_libtool_object ()
-{
-    write_libobj=$1
-    if test yes = "$build_libtool_libs"; then
-      write_lobj=\'$2\'
-    else
-      write_lobj=none
-    fi
-
-    if test yes = "$build_old_libs"; then
-      write_oldobj=\'$3\'
-    else
-      write_oldobj=none
-    fi
-
-    $opt_dry_run || {
-      cat >${write_libobj}T <<EOF
-# $write_libobj - a libtool object file
-# Generated by $PROGRAM (GNU $PACKAGE) $VERSION
-#
-# Please DO NOT delete this file!
-# It is necessary for linking the library.
-
-# Name of the PIC object.
-pic_object=$write_lobj
-
-# Name of the non-PIC object
-non_pic_object=$write_oldobj
-
-EOF
-      $MV "${write_libobj}T" "$write_libobj"
-    }
-}
-
-
-##################################################
-# FILE NAME AND PATH CONVERSION HELPER FUNCTIONS #
-##################################################
-
-# func_convert_core_file_wine_to_w32 ARG
-# Helper function used by file name conversion functions when $build is *nix,
-# and $host is mingw, cygwin, or some other w32 environment. Relies on a
-# correctly configured wine environment available, with the winepath program
-# in $build's $PATH.
-#
-# ARG is the $build file name to be converted to w32 format.
-# Result is available in $func_convert_core_file_wine_to_w32_result, and will
-# be empty on error (or when ARG is empty)
-func_convert_core_file_wine_to_w32 ()
-{
-  $debug_cmd
-
-  func_convert_core_file_wine_to_w32_result=$1
-  if test -n "$1"; then
-    # Unfortunately, winepath does not exit with a non-zero error code, so we
-    # are forced to check the contents of stdout. On the other hand, if the
-    # command is not found, the shell will set an exit code of 127 and print
-    # *an error message* to stdout. So we must check for both error code of
-    # zero AND non-empty stdout, which explains the odd construction:
-    func_convert_core_file_wine_to_w32_tmp=`winepath -w "$1" 2>/dev/null`
-    if test "$?" -eq 0 && test -n "$func_convert_core_file_wine_to_w32_tmp"; then
-      func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" |
-        $SED -e "$sed_naive_backslashify"`
-    else
-      func_convert_core_file_wine_to_w32_result=
-    fi
-  fi
-}
-# end: func_convert_core_file_wine_to_w32
-
-
-# func_convert_core_path_wine_to_w32 ARG
-# Helper function used by path conversion functions when $build is *nix, and
-# $host is mingw, cygwin, or some other w32 environment. Relies on a correctly
-# configured wine environment available, with the winepath program in $build's
-# $PATH. Assumes ARG has no leading or trailing path separator characters.
-#
-# ARG is path to be converted from $build format to win32.
-# Result is available in $func_convert_core_path_wine_to_w32_result.
-# Unconvertible file (directory) names in ARG are skipped; if no directory names
-# are convertible, then the result may be empty.
-func_convert_core_path_wine_to_w32 ()
-{
-  $debug_cmd
-
-  # unfortunately, winepath doesn't convert paths, only file names
-  func_convert_core_path_wine_to_w32_result=
-  if test -n "$1"; then
-    oldIFS=$IFS
-    IFS=:
-    for func_convert_core_path_wine_to_w32_f in $1; do
-      IFS=$oldIFS
-      func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f"
-      if test -n "$func_convert_core_file_wine_to_w32_result"; then
-        if test -z "$func_convert_core_path_wine_to_w32_result"; then
-          func_convert_core_path_wine_to_w32_result=$func_convert_core_file_wine_to_w32_result
-        else
-          func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result"
-        fi
-      fi
-    done
-    IFS=$oldIFS
-  fi
-}
-# end: func_convert_core_path_wine_to_w32
-
-
-# func_cygpath ARGS...
-# Wrapper around calling the cygpath program via LT_CYGPATH. This is used when
-# when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2)
-# $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or
-# (2), returns the Cygwin file name or path in func_cygpath_result (input
-# file name or path is assumed to be in w32 format, as previously converted
-# from $build's *nix or MSYS format). In case (3), returns the w32 file name
-# or path in func_cygpath_result (input file name or path is assumed to be in
-# Cygwin format). Returns an empty string on error.
-#
-# ARGS are passed to cygpath, with the last one being the file name or path to
-# be converted.
-#
-# Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH
-# environment variable; do not put it in $PATH.
-func_cygpath ()
-{
-  $debug_cmd
-
-  if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then
-    func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null`
-    if test "$?" -ne 0; then
-      # on failure, ensure result is empty
-      func_cygpath_result=
-    fi
-  else
-    func_cygpath_result=
-    func_error "LT_CYGPATH is empty or specifies non-existent file: '$LT_CYGPATH'"
-  fi
-}
-#end: func_cygpath
-
-
-# func_convert_core_msys_to_w32 ARG
-# Convert file name or path ARG from MSYS format to w32 format.  Return
-# result in func_convert_core_msys_to_w32_result.
-func_convert_core_msys_to_w32 ()
-{
-  $debug_cmd
-
-  # awkward: cmd appends spaces to result
-  func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null |
-    $SED -e 's/[ ]*$//' -e "$sed_naive_backslashify"`
-}
-#end: func_convert_core_msys_to_w32
-
-
-# func_convert_file_check ARG1 ARG2
-# Verify that ARG1 (a file name in $build format) was converted to $host
-# format in ARG2. Otherwise, emit an error message, but continue (resetting
-# func_to_host_file_result to ARG1).
-func_convert_file_check ()
-{
-  $debug_cmd
-
-  if test -z "$2" && test -n "$1"; then
-    func_error "Could not determine host file name corresponding to"
-    func_error "  '$1'"
-    func_error "Continuing, but uninstalled executables may not work."
-    # Fallback:
-    func_to_host_file_result=$1
-  fi
-}
-# end func_convert_file_check
-
-
-# func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH
-# Verify that FROM_PATH (a path in $build format) was converted to $host
-# format in TO_PATH. Otherwise, emit an error message, but continue, resetting
-# func_to_host_file_result to a simplistic fallback value (see below).
-func_convert_path_check ()
-{
-  $debug_cmd
-
-  if test -z "$4" && test -n "$3"; then
-    func_error "Could not determine the host path corresponding to"
-    func_error "  '$3'"
-    func_error "Continuing, but uninstalled executables may not work."
-    # Fallback.  This is a deliberately simplistic "conversion" and
-    # should not be "improved".  See libtool.info.
-    if test "x$1" != "x$2"; then
-      lt_replace_pathsep_chars="s|$1|$2|g"
-      func_to_host_path_result=`echo "$3" |
-        $SED -e "$lt_replace_pathsep_chars"`
-    else
-      func_to_host_path_result=$3
-    fi
-  fi
-}
-# end func_convert_path_check
-
-
-# func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG
-# Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT
-# and appending REPL if ORIG matches BACKPAT.
-func_convert_path_front_back_pathsep ()
-{
-  $debug_cmd
-
-  case $4 in
-  $1 ) func_to_host_path_result=$3$func_to_host_path_result
-    ;;
-  esac
-  case $4 in
-  $2 ) func_append func_to_host_path_result "$3"
-    ;;
-  esac
-}
-# end func_convert_path_front_back_pathsep
-
-
-##################################################
-# $build to $host FILE NAME CONVERSION FUNCTIONS #
-##################################################
-# invoked via '$to_host_file_cmd ARG'
-#
-# In each case, ARG is the path to be converted from $build to $host format.
-# Result will be available in $func_to_host_file_result.
-
-
-# func_to_host_file ARG
-# Converts the file name ARG from $build format to $host format. Return result
-# in func_to_host_file_result.
-func_to_host_file ()
-{
-  $debug_cmd
-
-  $to_host_file_cmd "$1"
-}
-# end func_to_host_file
-
-
-# func_to_tool_file ARG LAZY
-# converts the file name ARG from $build format to toolchain format. Return
-# result in func_to_tool_file_result.  If the conversion in use is listed
-# in (the comma separated) LAZY, no conversion takes place.
-func_to_tool_file ()
-{
-  $debug_cmd
-
-  case ,$2, in
-    *,"$to_tool_file_cmd",*)
-      func_to_tool_file_result=$1
-      ;;
-    *)
-      $to_tool_file_cmd "$1"
-      func_to_tool_file_result=$func_to_host_file_result
-      ;;
-  esac
-}
-# end func_to_tool_file
-
-
-# func_convert_file_noop ARG
-# Copy ARG to func_to_host_file_result.
-func_convert_file_noop ()
-{
-  func_to_host_file_result=$1
-}
-# end func_convert_file_noop
-
-
-# func_convert_file_msys_to_w32 ARG
-# Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic
-# conversion to w32 is not available inside the cwrapper.  Returns result in
-# func_to_host_file_result.
-func_convert_file_msys_to_w32 ()
-{
-  $debug_cmd
-
-  func_to_host_file_result=$1
-  if test -n "$1"; then
-    func_convert_core_msys_to_w32 "$1"
-    func_to_host_file_result=$func_convert_core_msys_to_w32_result
-  fi
-  func_convert_file_check "$1" "$func_to_host_file_result"
-}
-# end func_convert_file_msys_to_w32
-
-
-# func_convert_file_cygwin_to_w32 ARG
-# Convert file name ARG from Cygwin to w32 format.  Returns result in
-# func_to_host_file_result.
-func_convert_file_cygwin_to_w32 ()
-{
-  $debug_cmd
-
-  func_to_host_file_result=$1
-  if test -n "$1"; then
-    # because $build is cygwin, we call "the" cygpath in $PATH; no need to use
-    # LT_CYGPATH in this case.
-    func_to_host_file_result=`cygpath -m "$1"`
-  fi
-  func_convert_file_check "$1" "$func_to_host_file_result"
-}
-# end func_convert_file_cygwin_to_w32
-
-
-# func_convert_file_nix_to_w32 ARG
-# Convert file name ARG from *nix to w32 format.  Requires a wine environment
-# and a working winepath. Returns result in func_to_host_file_result.
-func_convert_file_nix_to_w32 ()
-{
-  $debug_cmd
-
-  func_to_host_file_result=$1
-  if test -n "$1"; then
-    func_convert_core_file_wine_to_w32 "$1"
-    func_to_host_file_result=$func_convert_core_file_wine_to_w32_result
-  fi
-  func_convert_file_check "$1" "$func_to_host_file_result"
-}
-# end func_convert_file_nix_to_w32
-
-
-# func_convert_file_msys_to_cygwin ARG
-# Convert file name ARG from MSYS to Cygwin format.  Requires LT_CYGPATH set.
-# Returns result in func_to_host_file_result.
-func_convert_file_msys_to_cygwin ()
-{
-  $debug_cmd
-
-  func_to_host_file_result=$1
-  if test -n "$1"; then
-    func_convert_core_msys_to_w32 "$1"
-    func_cygpath -u "$func_convert_core_msys_to_w32_result"
-    func_to_host_file_result=$func_cygpath_result
-  fi
-  func_convert_file_check "$1" "$func_to_host_file_result"
-}
-# end func_convert_file_msys_to_cygwin
-
-
-# func_convert_file_nix_to_cygwin ARG
-# Convert file name ARG from *nix to Cygwin format.  Requires Cygwin installed
-# in a wine environment, working winepath, and LT_CYGPATH set.  Returns result
-# in func_to_host_file_result.
-func_convert_file_nix_to_cygwin ()
-{
-  $debug_cmd
-
-  func_to_host_file_result=$1
-  if test -n "$1"; then
-    # convert from *nix to w32, then use cygpath to convert from w32 to cygwin.
-    func_convert_core_file_wine_to_w32 "$1"
-    func_cygpath -u "$func_convert_core_file_wine_to_w32_result"
-    func_to_host_file_result=$func_cygpath_result
-  fi
-  func_convert_file_check "$1" "$func_to_host_file_result"
-}
-# end func_convert_file_nix_to_cygwin
-
-
-#############################################
-# $build to $host PATH CONVERSION FUNCTIONS #
-#############################################
-# invoked via '$to_host_path_cmd ARG'
-#
-# In each case, ARG is the path to be converted from $build to $host format.
-# The result will be available in $func_to_host_path_result.
-#
-# Path separators are also converted from $build format to $host format.  If
-# ARG begins or ends with a path separator character, it is preserved (but
-# converted to $host format) on output.
-#
-# All path conversion functions are named using the following convention:
-#   file name conversion function    : func_convert_file_X_to_Y ()
-#   path conversion function         : func_convert_path_X_to_Y ()
-# where, for any given $build/$host combination the 'X_to_Y' value is the
-# same.  If conversion functions are added for new $build/$host combinations,
-# the two new functions must follow this pattern, or func_init_to_host_path_cmd
-# will break.
-
-
-# func_init_to_host_path_cmd
-# Ensures that function "pointer" variable $to_host_path_cmd is set to the
-# appropriate value, based on the value of $to_host_file_cmd.
-to_host_path_cmd=
-func_init_to_host_path_cmd ()
-{
-  $debug_cmd
-
-  if test -z "$to_host_path_cmd"; then
-    func_stripname 'func_convert_file_' '' "$to_host_file_cmd"
-    to_host_path_cmd=func_convert_path_$func_stripname_result
-  fi
-}
-
-
-# func_to_host_path ARG
-# Converts the path ARG from $build format to $host format. Return result
-# in func_to_host_path_result.
-func_to_host_path ()
-{
-  $debug_cmd
-
-  func_init_to_host_path_cmd
-  $to_host_path_cmd "$1"
-}
-# end func_to_host_path
-
-
-# func_convert_path_noop ARG
-# Copy ARG to func_to_host_path_result.
-func_convert_path_noop ()
-{
-  func_to_host_path_result=$1
-}
-# end func_convert_path_noop
-
-
-# func_convert_path_msys_to_w32 ARG
-# Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic
-# conversion to w32 is not available inside the cwrapper.  Returns result in
-# func_to_host_path_result.
-func_convert_path_msys_to_w32 ()
-{
-  $debug_cmd
-
-  func_to_host_path_result=$1
-  if test -n "$1"; then
-    # Remove leading and trailing path separator characters from ARG.  MSYS
-    # behavior is inconsistent here; cygpath turns them into '.;' and ';.';
-    # and winepath ignores them completely.
-    func_stripname : : "$1"
-    func_to_host_path_tmp1=$func_stripname_result
-    func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
-    func_to_host_path_result=$func_convert_core_msys_to_w32_result
-    func_convert_path_check : ";" \
-      "$func_to_host_path_tmp1" "$func_to_host_path_result"
-    func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
-  fi
-}
-# end func_convert_path_msys_to_w32
-
-
-# func_convert_path_cygwin_to_w32 ARG
-# Convert path ARG from Cygwin to w32 format.  Returns result in
-# func_to_host_file_result.
-func_convert_path_cygwin_to_w32 ()
-{
-  $debug_cmd
-
-  func_to_host_path_result=$1
-  if test -n "$1"; then
-    # See func_convert_path_msys_to_w32:
-    func_stripname : : "$1"
-    func_to_host_path_tmp1=$func_stripname_result
-    func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"`
-    func_convert_path_check : ";" \
-      "$func_to_host_path_tmp1" "$func_to_host_path_result"
-    func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
-  fi
-}
-# end func_convert_path_cygwin_to_w32
-
-
-# func_convert_path_nix_to_w32 ARG
-# Convert path ARG from *nix to w32 format.  Requires a wine environment and
-# a working winepath.  Returns result in func_to_host_file_result.
-func_convert_path_nix_to_w32 ()
-{
-  $debug_cmd
-
-  func_to_host_path_result=$1
-  if test -n "$1"; then
-    # See func_convert_path_msys_to_w32:
-    func_stripname : : "$1"
-    func_to_host_path_tmp1=$func_stripname_result
-    func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
-    func_to_host_path_result=$func_convert_core_path_wine_to_w32_result
-    func_convert_path_check : ";" \
-      "$func_to_host_path_tmp1" "$func_to_host_path_result"
-    func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
-  fi
-}
-# end func_convert_path_nix_to_w32
-
-
-# func_convert_path_msys_to_cygwin ARG
-# Convert path ARG from MSYS to Cygwin format.  Requires LT_CYGPATH set.
-# Returns result in func_to_host_file_result.
-func_convert_path_msys_to_cygwin ()
-{
-  $debug_cmd
-
-  func_to_host_path_result=$1
-  if test -n "$1"; then
-    # See func_convert_path_msys_to_w32:
-    func_stripname : : "$1"
-    func_to_host_path_tmp1=$func_stripname_result
-    func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
-    func_cygpath -u -p "$func_convert_core_msys_to_w32_result"
-    func_to_host_path_result=$func_cygpath_result
-    func_convert_path_check : : \
-      "$func_to_host_path_tmp1" "$func_to_host_path_result"
-    func_convert_path_front_back_pathsep ":*" "*:" : "$1"
-  fi
-}
-# end func_convert_path_msys_to_cygwin
-
-
-# func_convert_path_nix_to_cygwin ARG
-# Convert path ARG from *nix to Cygwin format.  Requires Cygwin installed in a
-# a wine environment, working winepath, and LT_CYGPATH set.  Returns result in
-# func_to_host_file_result.
-func_convert_path_nix_to_cygwin ()
-{
-  $debug_cmd
-
-  func_to_host_path_result=$1
-  if test -n "$1"; then
-    # Remove leading and trailing path separator characters from
-    # ARG. msys behavior is inconsistent here, cygpath turns them
-    # into '.;' and ';.', and winepath ignores them completely.
-    func_stripname : : "$1"
-    func_to_host_path_tmp1=$func_stripname_result
-    func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
-    func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result"
-    func_to_host_path_result=$func_cygpath_result
-    func_convert_path_check : : \
-      "$func_to_host_path_tmp1" "$func_to_host_path_result"
-    func_convert_path_front_back_pathsep ":*" "*:" : "$1"
-  fi
-}
-# end func_convert_path_nix_to_cygwin
-
-
-# func_dll_def_p FILE
-# True iff FILE is a Windows DLL '.def' file.
-# Keep in sync with _LT_DLL_DEF_P in libtool.m4
-func_dll_def_p ()
-{
-  $debug_cmd
-
-  func_dll_def_p_tmp=`$SED -n \
-    -e 's/^[	 ]*//' \
-    -e '/^\(;.*\)*$/d' \
-    -e 's/^\(EXPORTS\|LIBRARY\)\([	 ].*\)*$/DEF/p' \
-    -e q \
-    "$1"`
-  test DEF = "$func_dll_def_p_tmp"
-}
-
-
-# func_mode_compile arg...
-func_mode_compile ()
-{
-    $debug_cmd
-
-    # Get the compilation command and the source file.
-    base_compile=
-    srcfile=$nonopt  #  always keep a non-empty value in "srcfile"
-    suppress_opt=yes
-    suppress_output=
-    arg_mode=normal
-    libobj=
-    later=
-    pie_flag=
-
-    for arg
-    do
-      case $arg_mode in
-      arg  )
-	# do not "continue".  Instead, add this to base_compile
-	lastarg=$arg
-	arg_mode=normal
-	;;
-
-      target )
-	libobj=$arg
-	arg_mode=normal
-	continue
-	;;
-
-      normal )
-	# Accept any command-line options.
-	case $arg in
-	-o)
-	  test -n "$libobj" && \
-	    func_fatal_error "you cannot specify '-o' more than once"
-	  arg_mode=target
-	  continue
-	  ;;
-
-	-pie | -fpie | -fPIE)
-          func_append pie_flag " $arg"
-	  continue
-	  ;;
-
-	-shared | -static | -prefer-pic | -prefer-non-pic)
-	  func_append later " $arg"
-	  continue
-	  ;;
-
-	-no-suppress)
-	  suppress_opt=no
-	  continue
-	  ;;
-
-	-Xcompiler)
-	  arg_mode=arg  #  the next one goes into the "base_compile" arg list
-	  continue      #  The current "srcfile" will either be retained or
-	  ;;            #  replaced later.  I would guess that would be a bug.
-
-	-Wc,*)
-	  func_stripname '-Wc,' '' "$arg"
-	  args=$func_stripname_result
-	  lastarg=
-	  save_ifs=$IFS; IFS=,
-	  for arg in $args; do
-	    IFS=$save_ifs
-	    func_append_quoted lastarg "$arg"
-	  done
-	  IFS=$save_ifs
-	  func_stripname ' ' '' "$lastarg"
-	  lastarg=$func_stripname_result
-
-	  # Add the arguments to base_compile.
-	  func_append base_compile " $lastarg"
-	  continue
-	  ;;
-
-	*)
-	  # Accept the current argument as the source file.
-	  # The previous "srcfile" becomes the current argument.
-	  #
-	  lastarg=$srcfile
-	  srcfile=$arg
-	  ;;
-	esac  #  case $arg
-	;;
-      esac    #  case $arg_mode
-
-      # Aesthetically quote the previous argument.
-      func_append_quoted base_compile "$lastarg"
-    done # for arg
-
-    case $arg_mode in
-    arg)
-      func_fatal_error "you must specify an argument for -Xcompile"
-      ;;
-    target)
-      func_fatal_error "you must specify a target with '-o'"
-      ;;
-    *)
-      # Get the name of the library object.
-      test -z "$libobj" && {
-	func_basename "$srcfile"
-	libobj=$func_basename_result
-      }
-      ;;
-    esac
-
-    # Recognize several different file suffixes.
-    # If the user specifies -o file.o, it is replaced with file.lo
-    case $libobj in
-    *.[cCFSifmso] | \
-    *.ada | *.adb | *.ads | *.asm | \
-    *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \
-    *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup)
-      func_xform "$libobj"
-      libobj=$func_xform_result
-      ;;
-    esac
-
-    case $libobj in
-    *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;;
-    *)
-      func_fatal_error "cannot determine name of library object from '$libobj'"
-      ;;
-    esac
-
-    func_infer_tag $base_compile
-
-    for arg in $later; do
-      case $arg in
-      -shared)
-	test yes = "$build_libtool_libs" \
-	  || func_fatal_configuration "cannot build a shared library"
-	build_old_libs=no
-	continue
-	;;
-
-      -static)
-	build_libtool_libs=no
-	build_old_libs=yes
-	continue
-	;;
-
-      -prefer-pic)
-	pic_mode=yes
-	continue
-	;;
-
-      -prefer-non-pic)
-	pic_mode=no
-	continue
-	;;
-      esac
-    done
-
-    func_quote_for_eval "$libobj"
-    test "X$libobj" != "X$func_quote_for_eval_result" \
-      && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"'	 &()|`$[]' \
-      && func_warning "libobj name '$libobj' may not contain shell special characters."
-    func_dirname_and_basename "$obj" "/" ""
-    objname=$func_basename_result
-    xdir=$func_dirname_result
-    lobj=$xdir$objdir/$objname
-
-    test -z "$base_compile" && \
-      func_fatal_help "you must specify a compilation command"
-
-    # Delete any leftover library objects.
-    if test yes = "$build_old_libs"; then
-      removelist="$obj $lobj $libobj ${libobj}T"
-    else
-      removelist="$lobj $libobj ${libobj}T"
-    fi
-
-    # On Cygwin there's no "real" PIC flag so we must build both object types
-    case $host_os in
-    cygwin* | mingw* | pw32* | os2* | cegcc*)
-      pic_mode=default
-      ;;
-    esac
-    if test no = "$pic_mode" && test pass_all != "$deplibs_check_method"; then
-      # non-PIC code in shared libraries is not supported
-      pic_mode=default
-    fi
-
-    # Calculate the filename of the output object if compiler does
-    # not support -o with -c
-    if test no = "$compiler_c_o"; then
-      output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.$objext
-      lockfile=$output_obj.lock
-    else
-      output_obj=
-      need_locks=no
-      lockfile=
-    fi
-
-    # Lock this critical section if it is needed
-    # We use this script file to make the link, it avoids creating a new file
-    if test yes = "$need_locks"; then
-      until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
-	func_echo "Waiting for $lockfile to be removed"
-	sleep 2
-      done
-    elif test warn = "$need_locks"; then
-      if test -f "$lockfile"; then
-	$ECHO "\
-*** ERROR, $lockfile exists and contains:
-`cat $lockfile 2>/dev/null`
-
-This indicates that another process is trying to use the same
-temporary object file, and libtool could not work around it because
-your compiler does not support '-c' and '-o' together.  If you
-repeat this compilation, it may succeed, by chance, but you had better
-avoid parallel builds (make -j) in this platform, or get a better
-compiler."
-
-	$opt_dry_run || $RM $removelist
-	exit $EXIT_FAILURE
-      fi
-      func_append removelist " $output_obj"
-      $ECHO "$srcfile" > "$lockfile"
-    fi
-
-    $opt_dry_run || $RM $removelist
-    func_append removelist " $lockfile"
-    trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15
-
-    func_to_tool_file "$srcfile" func_convert_file_msys_to_w32
-    srcfile=$func_to_tool_file_result
-    func_quote_for_eval "$srcfile"
-    qsrcfile=$func_quote_for_eval_result
-
-    # Only build a PIC object if we are building libtool libraries.
-    if test yes = "$build_libtool_libs"; then
-      # Without this assignment, base_compile gets emptied.
-      fbsd_hideous_sh_bug=$base_compile
-
-      if test no != "$pic_mode"; then
-	command="$base_compile $qsrcfile $pic_flag"
-      else
-	# Don't build PIC code
-	command="$base_compile $qsrcfile"
-      fi
-
-      func_mkdir_p "$xdir$objdir"
-
-      if test -z "$output_obj"; then
-	# Place PIC objects in $objdir
-	func_append command " -o $lobj"
-      fi
-
-      func_show_eval_locale "$command"	\
-          'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE'
-
-      if test warn = "$need_locks" &&
-	 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
-	$ECHO "\
-*** ERROR, $lockfile contains:
-`cat $lockfile 2>/dev/null`
-
-but it should contain:
-$srcfile
-
-This indicates that another process is trying to use the same
-temporary object file, and libtool could not work around it because
-your compiler does not support '-c' and '-o' together.  If you
-repeat this compilation, it may succeed, by chance, but you had better
-avoid parallel builds (make -j) in this platform, or get a better
-compiler."
-
-	$opt_dry_run || $RM $removelist
-	exit $EXIT_FAILURE
-      fi
-
-      # Just move the object if needed, then go on to compile the next one
-      if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
-	func_show_eval '$MV "$output_obj" "$lobj"' \
-	  'error=$?; $opt_dry_run || $RM $removelist; exit $error'
-      fi
-
-      # Allow error messages only from the first compilation.
-      if test yes = "$suppress_opt"; then
-	suppress_output=' >/dev/null 2>&1'
-      fi
-    fi
-
-    # Only build a position-dependent object if we build old libraries.
-    if test yes = "$build_old_libs"; then
-      if test yes != "$pic_mode"; then
-	# Don't build PIC code
-	command="$base_compile $qsrcfile$pie_flag"
-      else
-	command="$base_compile $qsrcfile $pic_flag"
-      fi
-      if test yes = "$compiler_c_o"; then
-	func_append command " -o $obj"
-      fi
-
-      # Suppress compiler output if we already did a PIC compilation.
-      func_append command "$suppress_output"
-      func_show_eval_locale "$command" \
-        '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
-
-      if test warn = "$need_locks" &&
-	 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
-	$ECHO "\
-*** ERROR, $lockfile contains:
-`cat $lockfile 2>/dev/null`
-
-but it should contain:
-$srcfile
-
-This indicates that another process is trying to use the same
-temporary object file, and libtool could not work around it because
-your compiler does not support '-c' and '-o' together.  If you
-repeat this compilation, it may succeed, by chance, but you had better
-avoid parallel builds (make -j) in this platform, or get a better
-compiler."
-
-	$opt_dry_run || $RM $removelist
-	exit $EXIT_FAILURE
-      fi
-
-      # Just move the object if needed
-      if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
-	func_show_eval '$MV "$output_obj" "$obj"' \
-	  'error=$?; $opt_dry_run || $RM $removelist; exit $error'
-      fi
-    fi
-
-    $opt_dry_run || {
-      func_write_libtool_object "$libobj" "$objdir/$objname" "$objname"
-
-      # Unlock the critical section if it was locked
-      if test no != "$need_locks"; then
-	removelist=$lockfile
-        $RM "$lockfile"
-      fi
-    }
-
-    exit $EXIT_SUCCESS
-}
-
-$opt_help || {
-  test compile = "$opt_mode" && func_mode_compile ${1+"$@"}
-}
-
-func_mode_help ()
-{
-    # We need to display help for each of the modes.
-    case $opt_mode in
-      "")
-        # Generic help is extracted from the usage comments
-        # at the start of this file.
-        func_help
-        ;;
-
-      clean)
-        $ECHO \
-"Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
-
-Remove files from the build directory.
-
-RM is the name of the program to use to delete files associated with each FILE
-(typically '/bin/rm').  RM-OPTIONS are options (such as '-f') to be passed
-to RM.
-
-If FILE is a libtool library, object or program, all the files associated
-with it are deleted. Otherwise, only FILE itself is deleted using RM."
-        ;;
-
-      compile)
-      $ECHO \
-"Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
-
-Compile a source file into a libtool library object.
-
-This mode accepts the following additional options:
-
-  -o OUTPUT-FILE    set the output file name to OUTPUT-FILE
-  -no-suppress      do not suppress compiler output for multiple passes
-  -prefer-pic       try to build PIC objects only
-  -prefer-non-pic   try to build non-PIC objects only
-  -shared           do not build a '.o' file suitable for static linking
-  -static           only build a '.o' file suitable for static linking
-  -Wc,FLAG          pass FLAG directly to the compiler
-
-COMPILE-COMMAND is a command to be used in creating a 'standard' object file
-from the given SOURCEFILE.
-
-The output file name is determined by removing the directory component from
-SOURCEFILE, then substituting the C source code suffix '.c' with the
-library object suffix, '.lo'."
-        ;;
-
-      execute)
-        $ECHO \
-"Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]...
-
-Automatically set library path, then run a program.
-
-This mode accepts the following additional options:
-
-  -dlopen FILE      add the directory containing FILE to the library path
-
-This mode sets the library path environment variable according to '-dlopen'
-flags.
-
-If any of the ARGS are libtool executable wrappers, then they are translated
-into their corresponding uninstalled binary, and any of their required library
-directories are added to the library path.
-
-Then, COMMAND is executed, with ARGS as arguments."
-        ;;
-
-      finish)
-        $ECHO \
-"Usage: $progname [OPTION]... --mode=finish [LIBDIR]...
-
-Complete the installation of libtool libraries.
-
-Each LIBDIR is a directory that contains libtool libraries.
-
-The commands that this mode executes may require superuser privileges.  Use
-the '--dry-run' option if you just want to see what would be executed."
-        ;;
-
-      install)
-        $ECHO \
-"Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND...
-
-Install executables or libraries.
-
-INSTALL-COMMAND is the installation command.  The first component should be
-either the 'install' or 'cp' program.
-
-The following components of INSTALL-COMMAND are treated specially:
-
-  -inst-prefix-dir PREFIX-DIR  Use PREFIX-DIR as a staging area for installation
-
-The rest of the components are interpreted as arguments to that command (only
-BSD-compatible install options are recognized)."
-        ;;
-
-      link)
-        $ECHO \
-"Usage: $progname [OPTION]... --mode=link LINK-COMMAND...
-
-Link object files or libraries together to form another library, or to
-create an executable program.
-
-LINK-COMMAND is a command using the C compiler that you would use to create
-a program from several object files.
-
-The following components of LINK-COMMAND are treated specially:
-
-  -all-static       do not do any dynamic linking at all
-  -avoid-version    do not add a version suffix if possible
-  -bindir BINDIR    specify path to binaries directory (for systems where
-                    libraries must be found in the PATH setting at runtime)
-  -dlopen FILE      '-dlpreopen' FILE if it cannot be dlopened at runtime
-  -dlpreopen FILE   link in FILE and add its symbols to lt_preloaded_symbols
-  -export-dynamic   allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
-  -export-symbols SYMFILE
-                    try to export only the symbols listed in SYMFILE
-  -export-symbols-regex REGEX
-                    try to export only the symbols matching REGEX
-  -LLIBDIR          search LIBDIR for required installed libraries
-  -lNAME            OUTPUT-FILE requires the installed library libNAME
-  -module           build a library that can dlopened
-  -no-fast-install  disable the fast-install mode
-  -no-install       link a not-installable executable
-  -no-undefined     declare that a library does not refer to external symbols
-  -o OUTPUT-FILE    create OUTPUT-FILE from the specified objects
-  -objectlist FILE  use a list of object files found in FILE to specify objects
-  -os2dllname NAME  force a short DLL name on OS/2 (no effect on other OSes)
-  -precious-files-regex REGEX
-                    don't remove output files matching REGEX
-  -release RELEASE  specify package release information
-  -rpath LIBDIR     the created library will eventually be installed in LIBDIR
-  -R[ ]LIBDIR       add LIBDIR to the runtime path of programs and libraries
-  -shared           only do dynamic linking of libtool libraries
-  -shrext SUFFIX    override the standard shared library file extension
-  -static           do not do any dynamic linking of uninstalled libtool libraries
-  -static-libtool-libs
-                    do not do any dynamic linking of libtool libraries
-  -version-info CURRENT[:REVISION[:AGE]]
-                    specify library version info [each variable defaults to 0]
-  -weak LIBNAME     declare that the target provides the LIBNAME interface
-  -Wc,FLAG
-  -Xcompiler FLAG   pass linker-specific FLAG directly to the compiler
-  -Wl,FLAG
-  -Xlinker FLAG     pass linker-specific FLAG directly to the linker
-  -XCClinker FLAG   pass link-specific FLAG to the compiler driver (CC)
-
-All other options (arguments beginning with '-') are ignored.
-
-Every other argument is treated as a filename.  Files ending in '.la' are
-treated as uninstalled libtool libraries, other files are standard or library
-object files.
-
-If the OUTPUT-FILE ends in '.la', then a libtool library is created,
-only library objects ('.lo' files) may be specified, and '-rpath' is
-required, except when creating a convenience library.
-
-If OUTPUT-FILE ends in '.a' or '.lib', then a standard library is created
-using 'ar' and 'ranlib', or on Windows using 'lib'.
-
-If OUTPUT-FILE ends in '.lo' or '.$objext', then a reloadable object file
-is created, otherwise an executable program is created."
-        ;;
-
-      uninstall)
-        $ECHO \
-"Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
-
-Remove libraries from an installation directory.
-
-RM is the name of the program to use to delete files associated with each FILE
-(typically '/bin/rm').  RM-OPTIONS are options (such as '-f') to be passed
-to RM.
-
-If FILE is a libtool library, all the files associated with it are deleted.
-Otherwise, only FILE itself is deleted using RM."
-        ;;
-
-      *)
-        func_fatal_help "invalid operation mode '$opt_mode'"
-        ;;
-    esac
-
-    echo
-    $ECHO "Try '$progname --help' for more information about other modes."
-}
-
-# Now that we've collected a possible --mode arg, show help if necessary
-if $opt_help; then
-  if test : = "$opt_help"; then
-    func_mode_help
-  else
-    {
-      func_help noexit
-      for opt_mode in compile link execute install finish uninstall clean; do
-	func_mode_help
-      done
-    } | $SED -n '1p; 2,$s/^Usage:/  or: /p'
-    {
-      func_help noexit
-      for opt_mode in compile link execute install finish uninstall clean; do
-	echo
-	func_mode_help
-      done
-    } |
-    $SED '1d
-      /^When reporting/,/^Report/{
-	H
-	d
-      }
-      $x
-      /information about other modes/d
-      /more detailed .*MODE/d
-      s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/'
-  fi
-  exit $?
-fi
-
-
-# func_mode_execute arg...
-func_mode_execute ()
-{
-    $debug_cmd
-
-    # The first argument is the command name.
-    cmd=$nonopt
-    test -z "$cmd" && \
-      func_fatal_help "you must specify a COMMAND"
-
-    # Handle -dlopen flags immediately.
-    for file in $opt_dlopen; do
-      test -f "$file" \
-	|| func_fatal_help "'$file' is not a file"
-
-      dir=
-      case $file in
-      *.la)
-	func_resolve_sysroot "$file"
-	file=$func_resolve_sysroot_result
-
-	# Check to see that this really is a libtool archive.
-	func_lalib_unsafe_p "$file" \
-	  || func_fatal_help "'$lib' is not a valid libtool archive"
-
-	# Read the libtool library.
-	dlname=
-	library_names=
-	func_source "$file"
-
-	# Skip this library if it cannot be dlopened.
-	if test -z "$dlname"; then
-	  # Warn if it was a shared library.
-	  test -n "$library_names" && \
-	    func_warning "'$file' was not linked with '-export-dynamic'"
-	  continue
-	fi
-
-	func_dirname "$file" "" "."
-	dir=$func_dirname_result
-
-	if test -f "$dir/$objdir/$dlname"; then
-	  func_append dir "/$objdir"
-	else
-	  if test ! -f "$dir/$dlname"; then
-	    func_fatal_error "cannot find '$dlname' in '$dir' or '$dir/$objdir'"
-	  fi
-	fi
-	;;
-
-      *.lo)
-	# Just add the directory containing the .lo file.
-	func_dirname "$file" "" "."
-	dir=$func_dirname_result
-	;;
-
-      *)
-	func_warning "'-dlopen' is ignored for non-libtool libraries and objects"
-	continue
-	;;
-      esac
-
-      # Get the absolute pathname.
-      absdir=`cd "$dir" && pwd`
-      test -n "$absdir" && dir=$absdir
-
-      # Now add the directory to shlibpath_var.
-      if eval "test -z \"\$$shlibpath_var\""; then
-	eval "$shlibpath_var=\"\$dir\""
-      else
-	eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
-      fi
-    done
-
-    # This variable tells wrapper scripts just to set shlibpath_var
-    # rather than running their programs.
-    libtool_execute_magic=$magic
-
-    # Check if any of the arguments is a wrapper script.
-    args=
-    for file
-    do
-      case $file in
-      -* | *.la | *.lo ) ;;
-      *)
-	# Do a test to see if this is really a libtool program.
-	if func_ltwrapper_script_p "$file"; then
-	  func_source "$file"
-	  # Transform arg to wrapped name.
-	  file=$progdir/$program
-	elif func_ltwrapper_executable_p "$file"; then
-	  func_ltwrapper_scriptname "$file"
-	  func_source "$func_ltwrapper_scriptname_result"
-	  # Transform arg to wrapped name.
-	  file=$progdir/$program
-	fi
-	;;
-      esac
-      # Quote arguments (to preserve shell metacharacters).
-      func_append_quoted args "$file"
-    done
-
-    if $opt_dry_run; then
-      # Display what would be done.
-      if test -n "$shlibpath_var"; then
-	eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
-	echo "export $shlibpath_var"
-      fi
-      $ECHO "$cmd$args"
-      exit $EXIT_SUCCESS
-    else
-      if test -n "$shlibpath_var"; then
-	# Export the shlibpath_var.
-	eval "export $shlibpath_var"
-      fi
-
-      # Restore saved environment variables
-      for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
-      do
-	eval "if test \"\${save_$lt_var+set}\" = set; then
-                $lt_var=\$save_$lt_var; export $lt_var
-	      else
-		$lt_unset $lt_var
-	      fi"
-      done
-
-      # Now prepare to actually exec the command.
-      exec_cmd=\$cmd$args
-    fi
-}
-
-test execute = "$opt_mode" && func_mode_execute ${1+"$@"}
-
-
-# func_mode_finish arg...
-func_mode_finish ()
-{
-    $debug_cmd
-
-    libs=
-    libdirs=
-    admincmds=
-
-    for opt in "$nonopt" ${1+"$@"}
-    do
-      if test -d "$opt"; then
-	func_append libdirs " $opt"
-
-      elif test -f "$opt"; then
-	if func_lalib_unsafe_p "$opt"; then
-	  func_append libs " $opt"
-	else
-	  func_warning "'$opt' is not a valid libtool archive"
-	fi
-
-      else
-	func_fatal_error "invalid argument '$opt'"
-      fi
-    done
-
-    if test -n "$libs"; then
-      if test -n "$lt_sysroot"; then
-        sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"`
-        sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;"
-      else
-        sysroot_cmd=
-      fi
-
-      # Remove sysroot references
-      if $opt_dry_run; then
-        for lib in $libs; do
-          echo "removing references to $lt_sysroot and '=' prefixes from $lib"
-        done
-      else
-        tmpdir=`func_mktempdir`
-        for lib in $libs; do
-	  $SED -e "$sysroot_cmd s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \
-	    > $tmpdir/tmp-la
-	  mv -f $tmpdir/tmp-la $lib
-	done
-        ${RM}r "$tmpdir"
-      fi
-    fi
-
-    if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
-      for libdir in $libdirs; do
-	if test -n "$finish_cmds"; then
-	  # Do each command in the finish commands.
-	  func_execute_cmds "$finish_cmds" 'admincmds="$admincmds
-'"$cmd"'"'
-	fi
-	if test -n "$finish_eval"; then
-	  # Do the single finish_eval.
-	  eval cmds=\"$finish_eval\"
-	  $opt_dry_run || eval "$cmds" || func_append admincmds "
-       $cmds"
-	fi
-      done
-    fi
-
-    # Exit here if they wanted silent mode.
-    $opt_quiet && exit $EXIT_SUCCESS
-
-    if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
-      echo "----------------------------------------------------------------------"
-      echo "Libraries have been installed in:"
-      for libdir in $libdirs; do
-	$ECHO "   $libdir"
-      done
-      echo
-      echo "If you ever happen to want to link against installed libraries"
-      echo "in a given directory, LIBDIR, you must either use libtool, and"
-      echo "specify the full pathname of the library, or use the '-LLIBDIR'"
-      echo "flag during linking and do at least one of the following:"
-      if test -n "$shlibpath_var"; then
-	echo "   - add LIBDIR to the '$shlibpath_var' environment variable"
-	echo "     during execution"
-      fi
-      if test -n "$runpath_var"; then
-	echo "   - add LIBDIR to the '$runpath_var' environment variable"
-	echo "     during linking"
-      fi
-      if test -n "$hardcode_libdir_flag_spec"; then
-	libdir=LIBDIR
-	eval flag=\"$hardcode_libdir_flag_spec\"
-
-	$ECHO "   - use the '$flag' linker flag"
-      fi
-      if test -n "$admincmds"; then
-	$ECHO "   - have your system administrator run these commands:$admincmds"
-      fi
-      if test -f /etc/ld.so.conf; then
-	echo "   - have your system administrator add LIBDIR to '/etc/ld.so.conf'"
-      fi
-      echo
-
-      echo "See any operating system documentation about shared libraries for"
-      case $host in
-	solaris2.[6789]|solaris2.1[0-9])
-	  echo "more information, such as the ld(1), crle(1) and ld.so(8) manual"
-	  echo "pages."
-	  ;;
-	*)
-	  echo "more information, such as the ld(1) and ld.so(8) manual pages."
-	  ;;
-      esac
-      echo "----------------------------------------------------------------------"
-    fi
-    exit $EXIT_SUCCESS
-}
-
-test finish = "$opt_mode" && func_mode_finish ${1+"$@"}
-
-
-# func_mode_install arg...
-func_mode_install ()
-{
-    $debug_cmd
-
-    # There may be an optional sh(1) argument at the beginning of
-    # install_prog (especially on Windows NT).
-    if test "$SHELL" = "$nonopt" || test /bin/sh = "$nonopt" ||
-       # Allow the use of GNU shtool's install command.
-       case $nonopt in *shtool*) :;; *) false;; esac
-    then
-      # Aesthetically quote it.
-      func_quote_for_eval "$nonopt"
-      install_prog="$func_quote_for_eval_result "
-      arg=$1
-      shift
-    else
-      install_prog=
-      arg=$nonopt
-    fi
-
-    # The real first argument should be the name of the installation program.
-    # Aesthetically quote it.
-    func_quote_for_eval "$arg"
-    func_append install_prog "$func_quote_for_eval_result"
-    install_shared_prog=$install_prog
-    case " $install_prog " in
-      *[\\\ /]cp\ *) install_cp=: ;;
-      *) install_cp=false ;;
-    esac
-
-    # We need to accept at least all the BSD install flags.
-    dest=
-    files=
-    opts=
-    prev=
-    install_type=
-    isdir=false
-    stripme=
-    no_mode=:
-    for arg
-    do
-      arg2=
-      if test -n "$dest"; then
-	func_append files " $dest"
-	dest=$arg
-	continue
-      fi
-
-      case $arg in
-      -d) isdir=: ;;
-      -f)
-	if $install_cp; then :; else
-	  prev=$arg
-	fi
-	;;
-      -g | -m | -o)
-	prev=$arg
-	;;
-      -s)
-	stripme=" -s"
-	continue
-	;;
-      -*)
-	;;
-      *)
-	# If the previous option needed an argument, then skip it.
-	if test -n "$prev"; then
-	  if test X-m = "X$prev" && test -n "$install_override_mode"; then
-	    arg2=$install_override_mode
-	    no_mode=false
-	  fi
-	  prev=
-	else
-	  dest=$arg
-	  continue
-	fi
-	;;
-      esac
-
-      # Aesthetically quote the argument.
-      func_quote_for_eval "$arg"
-      func_append install_prog " $func_quote_for_eval_result"
-      if test -n "$arg2"; then
-	func_quote_for_eval "$arg2"
-      fi
-      func_append install_shared_prog " $func_quote_for_eval_result"
-    done
-
-    test -z "$install_prog" && \
-      func_fatal_help "you must specify an install program"
-
-    test -n "$prev" && \
-      func_fatal_help "the '$prev' option requires an argument"
-
-    if test -n "$install_override_mode" && $no_mode; then
-      if $install_cp; then :; else
-	func_quote_for_eval "$install_override_mode"
-	func_append install_shared_prog " -m $func_quote_for_eval_result"
-      fi
-    fi
-
-    if test -z "$files"; then
-      if test -z "$dest"; then
-	func_fatal_help "no file or destination specified"
-      else
-	func_fatal_help "you must specify a destination"
-      fi
-    fi
-
-    # Strip any trailing slash from the destination.
-    func_stripname '' '/' "$dest"
-    dest=$func_stripname_result
-
-    # Check to see that the destination is a directory.
-    test -d "$dest" && isdir=:
-    if $isdir; then
-      destdir=$dest
-      destname=
-    else
-      func_dirname_and_basename "$dest" "" "."
-      destdir=$func_dirname_result
-      destname=$func_basename_result
-
-      # Not a directory, so check to see that there is only one file specified.
-      set dummy $files; shift
-      test "$#" -gt 1 && \
-	func_fatal_help "'$dest' is not a directory"
-    fi
-    case $destdir in
-    [\\/]* | [A-Za-z]:[\\/]*) ;;
-    *)
-      for file in $files; do
-	case $file in
-	*.lo) ;;
-	*)
-	  func_fatal_help "'$destdir' must be an absolute directory name"
-	  ;;
-	esac
-      done
-      ;;
-    esac
-
-    # This variable tells wrapper scripts just to set variables rather
-    # than running their programs.
-    libtool_install_magic=$magic
-
-    staticlibs=
-    future_libdirs=
-    current_libdirs=
-    for file in $files; do
-
-      # Do each installation.
-      case $file in
-      *.$libext)
-	# Do the static libraries later.
-	func_append staticlibs " $file"
-	;;
-
-      *.la)
-	func_resolve_sysroot "$file"
-	file=$func_resolve_sysroot_result
-
-	# Check to see that this really is a libtool archive.
-	func_lalib_unsafe_p "$file" \
-	  || func_fatal_help "'$file' is not a valid libtool archive"
-
-	library_names=
-	old_library=
-	relink_command=
-	func_source "$file"
-
-	# Add the libdir to current_libdirs if it is the destination.
-	if test "X$destdir" = "X$libdir"; then
-	  case "$current_libdirs " in
-	  *" $libdir "*) ;;
-	  *) func_append current_libdirs " $libdir" ;;
-	  esac
-	else
-	  # Note the libdir as a future libdir.
-	  case "$future_libdirs " in
-	  *" $libdir "*) ;;
-	  *) func_append future_libdirs " $libdir" ;;
-	  esac
-	fi
-
-	func_dirname "$file" "/" ""
-	dir=$func_dirname_result
-	func_append dir "$objdir"
-
-	if test -n "$relink_command"; then
-	  # Determine the prefix the user has applied to our future dir.
-	  inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"`
-
-	  # Don't allow the user to place us outside of our expected
-	  # location b/c this prevents finding dependent libraries that
-	  # are installed to the same prefix.
-	  # At present, this check doesn't affect windows .dll's that
-	  # are installed into $libdir/../bin (currently, that works fine)
-	  # but it's something to keep an eye on.
-	  test "$inst_prefix_dir" = "$destdir" && \
-	    func_fatal_error "error: cannot install '$file' to a directory not ending in $libdir"
-
-	  if test -n "$inst_prefix_dir"; then
-	    # Stick the inst_prefix_dir data into the link command.
-	    relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
-	  else
-	    relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
-	  fi
-
-	  func_warning "relinking '$file'"
-	  func_show_eval "$relink_command" \
-	    'func_fatal_error "error: relink '\''$file'\'' with the above command before installing it"'
-	fi
-
-	# See the names of the shared library.
-	set dummy $library_names; shift
-	if test -n "$1"; then
-	  realname=$1
-	  shift
-
-	  srcname=$realname
-	  test -n "$relink_command" && srcname=${realname}T
-
-	  # Install the shared library and build the symlinks.
-	  func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \
-	      'exit $?'
-	  tstripme=$stripme
-	  case $host_os in
-	  cygwin* | mingw* | pw32* | cegcc*)
-	    case $realname in
-	    *.dll.a)
-	      tstripme=
-	      ;;
-	    esac
-	    ;;
-	  os2*)
-	    case $realname in
-	    *_dll.a)
-	      tstripme=
-	      ;;
-	    esac
-	    ;;
-	  esac
-	  if test -n "$tstripme" && test -n "$striplib"; then
-	    func_show_eval "$striplib $destdir/$realname" 'exit $?'
-	  fi
-
-	  if test "$#" -gt 0; then
-	    # Delete the old symlinks, and create new ones.
-	    # Try 'ln -sf' first, because the 'ln' binary might depend on
-	    # the symlink we replace!  Solaris /bin/ln does not understand -f,
-	    # so we also need to try rm && ln -s.
-	    for linkname
-	    do
-	      test "$linkname" != "$realname" \
-		&& func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })"
-	    done
-	  fi
-
-	  # Do each command in the postinstall commands.
-	  lib=$destdir/$realname
-	  func_execute_cmds "$postinstall_cmds" 'exit $?'
-	fi
-
-	# Install the pseudo-library for information purposes.
-	func_basename "$file"
-	name=$func_basename_result
-	instname=$dir/${name}i
-	func_show_eval "$install_prog $instname $destdir/$name" 'exit $?'
-
-	# Maybe install the static library, too.
-	test -n "$old_library" && func_append staticlibs " $dir/$old_library"
-	;;
-
-      *.lo)
-	# Install (i.e. copy) a libtool object.
-
-	# Figure out destination file name, if it wasn't already specified.
-	if test -n "$destname"; then
-	  destfile=$destdir/$destname
-	else
-	  func_basename "$file"
-	  destfile=$func_basename_result
-	  destfile=$destdir/$destfile
-	fi
-
-	# Deduce the name of the destination old-style object file.
-	case $destfile in
-	*.lo)
-	  func_lo2o "$destfile"
-	  staticdest=$func_lo2o_result
-	  ;;
-	*.$objext)
-	  staticdest=$destfile
-	  destfile=
-	  ;;
-	*)
-	  func_fatal_help "cannot copy a libtool object to '$destfile'"
-	  ;;
-	esac
-
-	# Install the libtool object if requested.
-	test -n "$destfile" && \
-	  func_show_eval "$install_prog $file $destfile" 'exit $?'
-
-	# Install the old object if enabled.
-	if test yes = "$build_old_libs"; then
-	  # Deduce the name of the old-style object file.
-	  func_lo2o "$file"
-	  staticobj=$func_lo2o_result
-	  func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?'
-	fi
-	exit $EXIT_SUCCESS
-	;;
-
-      *)
-	# Figure out destination file name, if it wasn't already specified.
-	if test -n "$destname"; then
-	  destfile=$destdir/$destname
-	else
-	  func_basename "$file"
-	  destfile=$func_basename_result
-	  destfile=$destdir/$destfile
-	fi
-
-	# If the file is missing, and there is a .exe on the end, strip it
-	# because it is most likely a libtool script we actually want to
-	# install
-	stripped_ext=
-	case $file in
-	  *.exe)
-	    if test ! -f "$file"; then
-	      func_stripname '' '.exe' "$file"
-	      file=$func_stripname_result
-	      stripped_ext=.exe
-	    fi
-	    ;;
-	esac
-
-	# Do a test to see if this is really a libtool program.
-	case $host in
-	*cygwin* | *mingw*)
-	    if func_ltwrapper_executable_p "$file"; then
-	      func_ltwrapper_scriptname "$file"
-	      wrapper=$func_ltwrapper_scriptname_result
-	    else
-	      func_stripname '' '.exe' "$file"
-	      wrapper=$func_stripname_result
-	    fi
-	    ;;
-	*)
-	    wrapper=$file
-	    ;;
-	esac
-	if func_ltwrapper_script_p "$wrapper"; then
-	  notinst_deplibs=
-	  relink_command=
-
-	  func_source "$wrapper"
-
-	  # Check the variables that should have been set.
-	  test -z "$generated_by_libtool_version" && \
-	    func_fatal_error "invalid libtool wrapper script '$wrapper'"
-
-	  finalize=:
-	  for lib in $notinst_deplibs; do
-	    # Check to see that each library is installed.
-	    libdir=
-	    if test -f "$lib"; then
-	      func_source "$lib"
-	    fi
-	    libfile=$libdir/`$ECHO "$lib" | $SED 's%^.*/%%g'`
-	    if test -n "$libdir" && test ! -f "$libfile"; then
-	      func_warning "'$lib' has not been installed in '$libdir'"
-	      finalize=false
-	    fi
-	  done
-
-	  relink_command=
-	  func_source "$wrapper"
-
-	  outputname=
-	  if test no = "$fast_install" && test -n "$relink_command"; then
-	    $opt_dry_run || {
-	      if $finalize; then
-	        tmpdir=`func_mktempdir`
-		func_basename "$file$stripped_ext"
-		file=$func_basename_result
-	        outputname=$tmpdir/$file
-	        # Replace the output file specification.
-	        relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'`
-
-	        $opt_quiet || {
-	          func_quote_for_expand "$relink_command"
-		  eval "func_echo $func_quote_for_expand_result"
-	        }
-	        if eval "$relink_command"; then :
-	          else
-		  func_error "error: relink '$file' with the above command before installing it"
-		  $opt_dry_run || ${RM}r "$tmpdir"
-		  continue
-	        fi
-	        file=$outputname
-	      else
-	        func_warning "cannot relink '$file'"
-	      fi
-	    }
-	  else
-	    # Install the binary that we compiled earlier.
-	    file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"`
-	  fi
-	fi
-
-	# remove .exe since cygwin /usr/bin/install will append another
-	# one anyway
-	case $install_prog,$host in
-	*/usr/bin/install*,*cygwin*)
-	  case $file:$destfile in
-	  *.exe:*.exe)
-	    # this is ok
-	    ;;
-	  *.exe:*)
-	    destfile=$destfile.exe
-	    ;;
-	  *:*.exe)
-	    func_stripname '' '.exe' "$destfile"
-	    destfile=$func_stripname_result
-	    ;;
-	  esac
-	  ;;
-	esac
-	func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?'
-	$opt_dry_run || if test -n "$outputname"; then
-	  ${RM}r "$tmpdir"
-	fi
-	;;
-      esac
-    done
-
-    for file in $staticlibs; do
-      func_basename "$file"
-      name=$func_basename_result
-
-      # Set up the ranlib parameters.
-      oldlib=$destdir/$name
-      func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
-      tool_oldlib=$func_to_tool_file_result
-
-      func_show_eval "$install_prog \$file \$oldlib" 'exit $?'
-
-      if test -n "$stripme" && test -n "$old_striplib"; then
-	func_show_eval "$old_striplib $tool_oldlib" 'exit $?'
-      fi
-
-      # Do each command in the postinstall commands.
-      func_execute_cmds "$old_postinstall_cmds" 'exit $?'
-    done
-
-    test -n "$future_libdirs" && \
-      func_warning "remember to run '$progname --finish$future_libdirs'"
-
-    if test -n "$current_libdirs"; then
-      # Maybe just do a dry run.
-      $opt_dry_run && current_libdirs=" -n$current_libdirs"
-      exec_cmd='$SHELL "$progpath" $preserve_args --finish$current_libdirs'
-    else
-      exit $EXIT_SUCCESS
-    fi
-}
-
-test install = "$opt_mode" && func_mode_install ${1+"$@"}
-
-
-# func_generate_dlsyms outputname originator pic_p
-# Extract symbols from dlprefiles and create ${outputname}S.o with
-# a dlpreopen symbol table.
-func_generate_dlsyms ()
-{
-    $debug_cmd
-
-    my_outputname=$1
-    my_originator=$2
-    my_pic_p=${3-false}
-    my_prefix=`$ECHO "$my_originator" | $SED 's%[^a-zA-Z0-9]%_%g'`
-    my_dlsyms=
-
-    if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then
-      if test -n "$NM" && test -n "$global_symbol_pipe"; then
-	my_dlsyms=${my_outputname}S.c
-      else
-	func_error "not configured to extract global symbols from dlpreopened files"
-      fi
-    fi
-
-    if test -n "$my_dlsyms"; then
-      case $my_dlsyms in
-      "") ;;
-      *.c)
-	# Discover the nlist of each of the dlfiles.
-	nlist=$output_objdir/$my_outputname.nm
-
-	func_show_eval "$RM $nlist ${nlist}S ${nlist}T"
-
-	# Parse the name list into a source file.
-	func_verbose "creating $output_objdir/$my_dlsyms"
-
-	$opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\
-/* $my_dlsyms - symbol resolution table for '$my_outputname' dlsym emulation. */
-/* Generated by $PROGRAM (GNU $PACKAGE) $VERSION */
-
-#ifdef __cplusplus
-extern \"C\" {
-#endif
-
-#if defined __GNUC__ && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4))
-#pragma GCC diagnostic ignored \"-Wstrict-prototypes\"
-#endif
-
-/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
-#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE
-/* DATA imports from DLLs on WIN32 can't be const, because runtime
-   relocations are performed -- see ld's documentation on pseudo-relocs.  */
-# define LT_DLSYM_CONST
-#elif defined __osf__
-/* This system does not cope well with relocations in const data.  */
-# define LT_DLSYM_CONST
-#else
-# define LT_DLSYM_CONST const
-#endif
-
-#define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0)
-
-/* External symbol declarations for the compiler. */\
-"
-
-	if test yes = "$dlself"; then
-	  func_verbose "generating symbol list for '$output'"
-
-	  $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist"
-
-	  # Add our own program objects to the symbol list.
-	  progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP`
-	  for progfile in $progfiles; do
-	    func_to_tool_file "$progfile" func_convert_file_msys_to_w32
-	    func_verbose "extracting global C symbols from '$func_to_tool_file_result'"
-	    $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'"
-	  done
-
-	  if test -n "$exclude_expsyms"; then
-	    $opt_dry_run || {
-	      eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
-	      eval '$MV "$nlist"T "$nlist"'
-	    }
-	  fi
-
-	  if test -n "$export_symbols_regex"; then
-	    $opt_dry_run || {
-	      eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
-	      eval '$MV "$nlist"T "$nlist"'
-	    }
-	  fi
-
-	  # Prepare the list of exported symbols
-	  if test -z "$export_symbols"; then
-	    export_symbols=$output_objdir/$outputname.exp
-	    $opt_dry_run || {
-	      $RM $export_symbols
-	      eval "$SED -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
-	      case $host in
-	      *cygwin* | *mingw* | *cegcc* )
-                eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
-                eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
-	        ;;
-	      esac
-	    }
-	  else
-	    $opt_dry_run || {
-	      eval "$SED -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
-	      eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
-	      eval '$MV "$nlist"T "$nlist"'
-	      case $host in
-	        *cygwin* | *mingw* | *cegcc* )
-	          eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
-	          eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
-	          ;;
-	      esac
-	    }
-	  fi
-	fi
-
-	for dlprefile in $dlprefiles; do
-	  func_verbose "extracting global C symbols from '$dlprefile'"
-	  func_basename "$dlprefile"
-	  name=$func_basename_result
-          case $host in
-	    *cygwin* | *mingw* | *cegcc* )
-	      # if an import library, we need to obtain dlname
-	      if func_win32_import_lib_p "$dlprefile"; then
-	        func_tr_sh "$dlprefile"
-	        eval "curr_lafile=\$libfile_$func_tr_sh_result"
-	        dlprefile_dlbasename=
-	        if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then
-	          # Use subshell, to avoid clobbering current variable values
-	          dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"`
-	          if test -n "$dlprefile_dlname"; then
-	            func_basename "$dlprefile_dlname"
-	            dlprefile_dlbasename=$func_basename_result
-	          else
-	            # no lafile. user explicitly requested -dlpreopen <import library>.
-	            $sharedlib_from_linklib_cmd "$dlprefile"
-	            dlprefile_dlbasename=$sharedlib_from_linklib_result
-	          fi
-	        fi
-	        $opt_dry_run || {
-	          if test -n "$dlprefile_dlbasename"; then
-	            eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"'
-	          else
-	            func_warning "Could not compute DLL name from $name"
-	            eval '$ECHO ": $name " >> "$nlist"'
-	          fi
-	          func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
-	          eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe |
-	            $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'"
-	        }
-	      else # not an import lib
-	        $opt_dry_run || {
-	          eval '$ECHO ": $name " >> "$nlist"'
-	          func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
-	          eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
-	        }
-	      fi
-	    ;;
-	    *)
-	      $opt_dry_run || {
-	        eval '$ECHO ": $name " >> "$nlist"'
-	        func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
-	        eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
-	      }
-	    ;;
-          esac
-	done
-
-	$opt_dry_run || {
-	  # Make sure we have at least an empty file.
-	  test -f "$nlist" || : > "$nlist"
-
-	  if test -n "$exclude_expsyms"; then
-	    $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
-	    $MV "$nlist"T "$nlist"
-	  fi
-
-	  # Try sorting and uniquifying the output.
-	  if $GREP -v "^: " < "$nlist" |
-	      if sort -k 3 </dev/null >/dev/null 2>&1; then
-		sort -k 3
-	      else
-		sort +2
-	      fi |
-	      uniq > "$nlist"S; then
-	    :
-	  else
-	    $GREP -v "^: " < "$nlist" > "$nlist"S
-	  fi
-
-	  if test -f "$nlist"S; then
-	    eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"'
-	  else
-	    echo '/* NONE */' >> "$output_objdir/$my_dlsyms"
-	  fi
-
-	  func_show_eval '$RM "${nlist}I"'
-	  if test -n "$global_symbol_to_import"; then
-	    eval "$global_symbol_to_import"' < "$nlist"S > "$nlist"I'
-	  fi
-
-	  echo >> "$output_objdir/$my_dlsyms" "\
-
-/* The mapping between symbol names and symbols.  */
-typedef struct {
-  const char *name;
-  void *address;
-} lt_dlsymlist;
-extern LT_DLSYM_CONST lt_dlsymlist
-lt_${my_prefix}_LTX_preloaded_symbols[];\
-"
-
-	  if test -s "$nlist"I; then
-	    echo >> "$output_objdir/$my_dlsyms" "\
-static void lt_syminit(void)
-{
-  LT_DLSYM_CONST lt_dlsymlist *symbol = lt_${my_prefix}_LTX_preloaded_symbols;
-  for (; symbol->name; ++symbol)
-    {"
-	    $SED 's/.*/      if (STREQ (symbol->name, \"&\")) symbol->address = (void *) \&&;/' < "$nlist"I >> "$output_objdir/$my_dlsyms"
-	    echo >> "$output_objdir/$my_dlsyms" "\
-    }
-}"
-	  fi
-	  echo >> "$output_objdir/$my_dlsyms" "\
-LT_DLSYM_CONST lt_dlsymlist
-lt_${my_prefix}_LTX_preloaded_symbols[] =
-{ {\"$my_originator\", (void *) 0},"
-
-	  if test -s "$nlist"I; then
-	    echo >> "$output_objdir/$my_dlsyms" "\
-  {\"@INIT@\", (void *) &lt_syminit},"
-	  fi
-
-	  case $need_lib_prefix in
-	  no)
-	    eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms"
-	    ;;
-	  *)
-	    eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms"
-	    ;;
-	  esac
-	  echo >> "$output_objdir/$my_dlsyms" "\
-  {0, (void *) 0}
-};
-
-/* This works around a problem in FreeBSD linker */
-#ifdef FREEBSD_WORKAROUND
-static const void *lt_preloaded_setup() {
-  return lt_${my_prefix}_LTX_preloaded_symbols;
-}
-#endif
-
-#ifdef __cplusplus
-}
-#endif\
-"
-	} # !$opt_dry_run
-
-	pic_flag_for_symtable=
-	case "$compile_command " in
-	*" -static "*) ;;
-	*)
-	  case $host in
-	  # compiling the symbol table file with pic_flag works around
-	  # a FreeBSD bug that causes programs to crash when -lm is
-	  # linked before any other PIC object.  But we must not use
-	  # pic_flag when linking with -static.  The problem exists in
-	  # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
-	  *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
-	    pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;;
-	  *-*-hpux*)
-	    pic_flag_for_symtable=" $pic_flag"  ;;
-	  *)
-	    $my_pic_p && pic_flag_for_symtable=" $pic_flag"
-	    ;;
-	  esac
-	  ;;
-	esac
-	symtab_cflags=
-	for arg in $LTCFLAGS; do
-	  case $arg in
-	  -pie | -fpie | -fPIE) ;;
-	  *) func_append symtab_cflags " $arg" ;;
-	  esac
-	done
-
-	# Now compile the dynamic symbol file.
-	func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?'
-
-	# Clean up the generated files.
-	func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T" "${nlist}I"'
-
-	# Transform the symbol file into the correct name.
-	symfileobj=$output_objdir/${my_outputname}S.$objext
-	case $host in
-	*cygwin* | *mingw* | *cegcc* )
-	  if test -f "$output_objdir/$my_outputname.def"; then
-	    compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
-	    finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
-	  else
-	    compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
-	    finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
-	  fi
-	  ;;
-	*)
-	  compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
-	  finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
-	  ;;
-	esac
-	;;
-      *)
-	func_fatal_error "unknown suffix for '$my_dlsyms'"
-	;;
-      esac
-    else
-      # We keep going just in case the user didn't refer to
-      # lt_preloaded_symbols.  The linker will fail if global_symbol_pipe
-      # really was required.
-
-      # Nullify the symbol file.
-      compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"`
-      finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"`
-    fi
-}
-
-# func_cygming_gnu_implib_p ARG
-# This predicate returns with zero status (TRUE) if
-# ARG is a GNU/binutils-style import library. Returns
-# with nonzero status (FALSE) otherwise.
-func_cygming_gnu_implib_p ()
-{
-  $debug_cmd
-
-  func_to_tool_file "$1" func_convert_file_msys_to_w32
-  func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'`
-  test -n "$func_cygming_gnu_implib_tmp"
-}
-
-# func_cygming_ms_implib_p ARG
-# This predicate returns with zero status (TRUE) if
-# ARG is an MS-style import library. Returns
-# with nonzero status (FALSE) otherwise.
-func_cygming_ms_implib_p ()
-{
-  $debug_cmd
-
-  func_to_tool_file "$1" func_convert_file_msys_to_w32
-  func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'`
-  test -n "$func_cygming_ms_implib_tmp"
-}
-
-# func_win32_libid arg
-# return the library type of file 'arg'
-#
-# Need a lot of goo to handle *both* DLLs and import libs
-# Has to be a shell function in order to 'eat' the argument
-# that is supplied when $file_magic_command is called.
-# Despite the name, also deal with 64 bit binaries.
-func_win32_libid ()
-{
-  $debug_cmd
-
-  win32_libid_type=unknown
-  win32_fileres=`file -L $1 2>/dev/null`
-  case $win32_fileres in
-  *ar\ archive\ import\ library*) # definitely import
-    win32_libid_type="x86 archive import"
-    ;;
-  *ar\ archive*) # could be an import, or static
-    # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD.
-    if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
-       $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then
-      case $nm_interface in
-      "MS dumpbin")
-	if func_cygming_ms_implib_p "$1" ||
-	   func_cygming_gnu_implib_p "$1"
-	then
-	  win32_nmres=import
-	else
-	  win32_nmres=
-	fi
-	;;
-      *)
-	func_to_tool_file "$1" func_convert_file_msys_to_w32
-	win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" |
-	  $SED -n -e '
-	    1,100{
-		/ I /{
-		    s|.*|import|
-		    p
-		    q
-		}
-	    }'`
-	;;
-      esac
-      case $win32_nmres in
-      import*)  win32_libid_type="x86 archive import";;
-      *)        win32_libid_type="x86 archive static";;
-      esac
-    fi
-    ;;
-  *DLL*)
-    win32_libid_type="x86 DLL"
-    ;;
-  *executable*) # but shell scripts are "executable" too...
-    case $win32_fileres in
-    *MS\ Windows\ PE\ Intel*)
-      win32_libid_type="x86 DLL"
-      ;;
-    esac
-    ;;
-  esac
-  $ECHO "$win32_libid_type"
-}
-
-# func_cygming_dll_for_implib ARG
-#
-# Platform-specific function to extract the
-# name of the DLL associated with the specified
-# import library ARG.
-# Invoked by eval'ing the libtool variable
-#    $sharedlib_from_linklib_cmd
-# Result is available in the variable
-#    $sharedlib_from_linklib_result
-func_cygming_dll_for_implib ()
-{
-  $debug_cmd
-
-  sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"`
-}
-
-# func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs
-#
-# The is the core of a fallback implementation of a
-# platform-specific function to extract the name of the
-# DLL associated with the specified import library LIBNAME.
-#
-# SECTION_NAME is either .idata$6 or .idata$7, depending
-# on the platform and compiler that created the implib.
-#
-# Echos the name of the DLL associated with the
-# specified import library.
-func_cygming_dll_for_implib_fallback_core ()
-{
-  $debug_cmd
-
-  match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"`
-  $OBJDUMP -s --section "$1" "$2" 2>/dev/null |
-    $SED '/^Contents of section '"$match_literal"':/{
-      # Place marker at beginning of archive member dllname section
-      s/.*/====MARK====/
-      p
-      d
-    }
-    # These lines can sometimes be longer than 43 characters, but
-    # are always uninteresting
-    /:[	 ]*file format pe[i]\{,1\}-/d
-    /^In archive [^:]*:/d
-    # Ensure marker is printed
-    /^====MARK====/p
-    # Remove all lines with less than 43 characters
-    /^.\{43\}/!d
-    # From remaining lines, remove first 43 characters
-    s/^.\{43\}//' |
-    $SED -n '
-      # Join marker and all lines until next marker into a single line
-      /^====MARK====/ b para
-      H
-      $ b para
-      b
-      :para
-      x
-      s/\n//g
-      # Remove the marker
-      s/^====MARK====//
-      # Remove trailing dots and whitespace
-      s/[\. \t]*$//
-      # Print
-      /./p' |
-    # we now have a list, one entry per line, of the stringified
-    # contents of the appropriate section of all members of the
-    # archive that possess that section. Heuristic: eliminate
-    # all those that have a first or second character that is
-    # a '.' (that is, objdump's representation of an unprintable
-    # character.) This should work for all archives with less than
-    # 0x302f exports -- but will fail for DLLs whose name actually
-    # begins with a literal '.' or a single character followed by
-    # a '.'.
-    #
-    # Of those that remain, print the first one.
-    $SED -e '/^\./d;/^.\./d;q'
-}
-
-# func_cygming_dll_for_implib_fallback ARG
-# Platform-specific function to extract the
-# name of the DLL associated with the specified
-# import library ARG.
-#
-# This fallback implementation is for use when $DLLTOOL
-# does not support the --identify-strict option.
-# Invoked by eval'ing the libtool variable
-#    $sharedlib_from_linklib_cmd
-# Result is available in the variable
-#    $sharedlib_from_linklib_result
-func_cygming_dll_for_implib_fallback ()
-{
-  $debug_cmd
-
-  if func_cygming_gnu_implib_p "$1"; then
-    # binutils import library
-    sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"`
-  elif func_cygming_ms_implib_p "$1"; then
-    # ms-generated import library
-    sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"`
-  else
-    # unknown
-    sharedlib_from_linklib_result=
-  fi
-}
-
-
-# func_extract_an_archive dir oldlib
-func_extract_an_archive ()
-{
-    $debug_cmd
-
-    f_ex_an_ar_dir=$1; shift
-    f_ex_an_ar_oldlib=$1
-    if test yes = "$lock_old_archive_extraction"; then
-      lockfile=$f_ex_an_ar_oldlib.lock
-      until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
-	func_echo "Waiting for $lockfile to be removed"
-	sleep 2
-      done
-    fi
-    func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \
-		   'stat=$?; rm -f "$lockfile"; exit $stat'
-    if test yes = "$lock_old_archive_extraction"; then
-      $opt_dry_run || rm -f "$lockfile"
-    fi
-    if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
-     :
-    else
-      func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib"
-    fi
-}
-
-
-# func_extract_archives gentop oldlib ...
-func_extract_archives ()
-{
-    $debug_cmd
-
-    my_gentop=$1; shift
-    my_oldlibs=${1+"$@"}
-    my_oldobjs=
-    my_xlib=
-    my_xabs=
-    my_xdir=
-
-    for my_xlib in $my_oldlibs; do
-      # Extract the objects.
-      case $my_xlib in
-	[\\/]* | [A-Za-z]:[\\/]*) my_xabs=$my_xlib ;;
-	*) my_xabs=`pwd`"/$my_xlib" ;;
-      esac
-      func_basename "$my_xlib"
-      my_xlib=$func_basename_result
-      my_xlib_u=$my_xlib
-      while :; do
-        case " $extracted_archives " in
-	*" $my_xlib_u "*)
-	  func_arith $extracted_serial + 1
-	  extracted_serial=$func_arith_result
-	  my_xlib_u=lt$extracted_serial-$my_xlib ;;
-	*) break ;;
-	esac
-      done
-      extracted_archives="$extracted_archives $my_xlib_u"
-      my_xdir=$my_gentop/$my_xlib_u
-
-      func_mkdir_p "$my_xdir"
-
-      case $host in
-      *-darwin*)
-	func_verbose "Extracting $my_xabs"
-	# Do not bother doing anything if just a dry run
-	$opt_dry_run || {
-	  darwin_orig_dir=`pwd`
-	  cd $my_xdir || exit $?
-	  darwin_archive=$my_xabs
-	  darwin_curdir=`pwd`
-	  func_basename "$darwin_archive"
-	  darwin_base_archive=$func_basename_result
-	  darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true`
-	  if test -n "$darwin_arches"; then
-	    darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'`
-	    darwin_arch=
-	    func_verbose "$darwin_base_archive has multiple architectures $darwin_arches"
-	    for darwin_arch in  $darwin_arches; do
-	      func_mkdir_p "unfat-$$/$darwin_base_archive-$darwin_arch"
-	      $LIPO -thin $darwin_arch -output "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" "$darwin_archive"
-	      cd "unfat-$$/$darwin_base_archive-$darwin_arch"
-	      func_extract_an_archive "`pwd`" "$darwin_base_archive"
-	      cd "$darwin_curdir"
-	      $RM "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive"
-	    done # $darwin_arches
-            ## Okay now we've a bunch of thin objects, gotta fatten them up :)
-	    darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$sed_basename" | sort -u`
-	    darwin_file=
-	    darwin_files=
-	    for darwin_file in $darwin_filelist; do
-	      darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP`
-	      $LIPO -create -output "$darwin_file" $darwin_files
-	    done # $darwin_filelist
-	    $RM -rf unfat-$$
-	    cd "$darwin_orig_dir"
-	  else
-	    cd $darwin_orig_dir
-	    func_extract_an_archive "$my_xdir" "$my_xabs"
-	  fi # $darwin_arches
-	} # !$opt_dry_run
-	;;
-      *)
-        func_extract_an_archive "$my_xdir" "$my_xabs"
-	;;
-      esac
-      my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP`
-    done
-
-    func_extract_archives_result=$my_oldobjs
-}
-
-
-# func_emit_wrapper [arg=no]
-#
-# Emit a libtool wrapper script on stdout.
-# Don't directly open a file because we may want to
-# incorporate the script contents within a cygwin/mingw
-# wrapper executable.  Must ONLY be called from within
-# func_mode_link because it depends on a number of variables
-# set therein.
-#
-# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
-# variable will take.  If 'yes', then the emitted script
-# will assume that the directory where it is stored is
-# the $objdir directory.  This is a cygwin/mingw-specific
-# behavior.
-func_emit_wrapper ()
-{
-	func_emit_wrapper_arg1=${1-no}
-
-	$ECHO "\
-#! $SHELL
-
-# $output - temporary wrapper script for $objdir/$outputname
-# Generated by $PROGRAM (GNU $PACKAGE) $VERSION
-#
-# The $output program cannot be directly executed until all the libtool
-# libraries that it depends on are installed.
-#
-# This wrapper script should never be moved out of the build directory.
-# If it is, it will not operate correctly.
-
-# Sed substitution that helps us do robust quoting.  It backslashifies
-# metacharacters that are still active within double-quoted strings.
-sed_quote_subst='$sed_quote_subst'
-
-# Be Bourne compatible
-if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then
-  emulate sh
-  NULLCMD=:
-  # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which
-  # is contrary to our usage.  Disable this feature.
-  alias -g '\${1+\"\$@\"}'='\"\$@\"'
-  setopt NO_GLOB_SUBST
-else
-  case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac
-fi
-BIN_SH=xpg4; export BIN_SH # for Tru64
-DUALCASE=1; export DUALCASE # for MKS sh
-
-# The HP-UX ksh and POSIX shell print the target directory to stdout
-# if CDPATH is set.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-relink_command=\"$relink_command\"
-
-# This environment variable determines our operation mode.
-if test \"\$libtool_install_magic\" = \"$magic\"; then
-  # install mode needs the following variables:
-  generated_by_libtool_version='$macro_version'
-  notinst_deplibs='$notinst_deplibs'
-else
-  # When we are sourced in execute mode, \$file and \$ECHO are already set.
-  if test \"\$libtool_execute_magic\" != \"$magic\"; then
-    file=\"\$0\""
-
-    qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"`
-    $ECHO "\
-
-# A function that is used when there is no print builtin or printf.
-func_fallback_echo ()
-{
-  eval 'cat <<_LTECHO_EOF
-\$1
-_LTECHO_EOF'
-}
-    ECHO=\"$qECHO\"
-  fi
-
-# Very basic option parsing. These options are (a) specific to
-# the libtool wrapper, (b) are identical between the wrapper
-# /script/ and the wrapper /executable/ that is used only on
-# windows platforms, and (c) all begin with the string "--lt-"
-# (application programs are unlikely to have options that match
-# this pattern).
-#
-# There are only two supported options: --lt-debug and
-# --lt-dump-script. There is, deliberately, no --lt-help.
-#
-# The first argument to this parsing function should be the
-# script's $0 value, followed by "$@".
-lt_option_debug=
-func_parse_lt_options ()
-{
-  lt_script_arg0=\$0
-  shift
-  for lt_opt
-  do
-    case \"\$lt_opt\" in
-    --lt-debug) lt_option_debug=1 ;;
-    --lt-dump-script)
-        lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\`
-        test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=.
-        lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\`
-        cat \"\$lt_dump_D/\$lt_dump_F\"
-        exit 0
-      ;;
-    --lt-*)
-        \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2
-        exit 1
-      ;;
-    esac
-  done
-
-  # Print the debug banner immediately:
-  if test -n \"\$lt_option_debug\"; then
-    echo \"$outputname:$output:\$LINENO: libtool wrapper (GNU $PACKAGE) $VERSION\" 1>&2
-  fi
-}
-
-# Used when --lt-debug. Prints its arguments to stdout
-# (redirection is the responsibility of the caller)
-func_lt_dump_args ()
-{
-  lt_dump_args_N=1;
-  for lt_arg
-  do
-    \$ECHO \"$outputname:$output:\$LINENO: newargv[\$lt_dump_args_N]: \$lt_arg\"
-    lt_dump_args_N=\`expr \$lt_dump_args_N + 1\`
-  done
-}
-
-# Core function for launching the target application
-func_exec_program_core ()
-{
-"
-  case $host in
-  # Backslashes separate directories on plain windows
-  *-*-mingw | *-*-os2* | *-cegcc*)
-    $ECHO "\
-      if test -n \"\$lt_option_debug\"; then
-        \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir\\\\\$program\" 1>&2
-        func_lt_dump_args \${1+\"\$@\"} 1>&2
-      fi
-      exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
-"
-    ;;
-
-  *)
-    $ECHO "\
-      if test -n \"\$lt_option_debug\"; then
-        \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir/\$program\" 1>&2
-        func_lt_dump_args \${1+\"\$@\"} 1>&2
-      fi
-      exec \"\$progdir/\$program\" \${1+\"\$@\"}
-"
-    ;;
-  esac
-  $ECHO "\
-      \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2
-      exit 1
-}
-
-# A function to encapsulate launching the target application
-# Strips options in the --lt-* namespace from \$@ and
-# launches target application with the remaining arguments.
-func_exec_program ()
-{
-  case \" \$* \" in
-  *\\ --lt-*)
-    for lt_wr_arg
-    do
-      case \$lt_wr_arg in
-      --lt-*) ;;
-      *) set x \"\$@\" \"\$lt_wr_arg\"; shift;;
-      esac
-      shift
-    done ;;
-  esac
-  func_exec_program_core \${1+\"\$@\"}
-}
-
-  # Parse options
-  func_parse_lt_options \"\$0\" \${1+\"\$@\"}
-
-  # Find the directory that this script lives in.
-  thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\`
-  test \"x\$thisdir\" = \"x\$file\" && thisdir=.
-
-  # Follow symbolic links until we get to the real thisdir.
-  file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\`
-  while test -n \"\$file\"; do
-    destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\`
-
-    # If there was a directory component, then change thisdir.
-    if test \"x\$destdir\" != \"x\$file\"; then
-      case \"\$destdir\" in
-      [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
-      *) thisdir=\"\$thisdir/\$destdir\" ;;
-      esac
-    fi
-
-    file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\`
-    file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\`
-  done
-
-  # Usually 'no', except on cygwin/mingw when embedded into
-  # the cwrapper.
-  WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1
-  if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then
-    # special case for '.'
-    if test \"\$thisdir\" = \".\"; then
-      thisdir=\`pwd\`
-    fi
-    # remove .libs from thisdir
-    case \"\$thisdir\" in
-    *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;;
-    $objdir )   thisdir=. ;;
-    esac
-  fi
-
-  # Try to get the absolute directory name.
-  absdir=\`cd \"\$thisdir\" && pwd\`
-  test -n \"\$absdir\" && thisdir=\"\$absdir\"
-"
-
-	if test yes = "$fast_install"; then
-	  $ECHO "\
-  program=lt-'$outputname'$exeext
-  progdir=\"\$thisdir/$objdir\"
-
-  if test ! -f \"\$progdir/\$program\" ||
-     { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | $SED 1q\`; \\
-       test \"X\$file\" != \"X\$progdir/\$program\"; }; then
-
-    file=\"\$\$-\$program\"
-
-    if test ! -d \"\$progdir\"; then
-      $MKDIR \"\$progdir\"
-    else
-      $RM \"\$progdir/\$file\"
-    fi"
-
-	  $ECHO "\
-
-    # relink executable if necessary
-    if test -n \"\$relink_command\"; then
-      if relink_command_output=\`eval \$relink_command 2>&1\`; then :
-      else
-	\$ECHO \"\$relink_command_output\" >&2
-	$RM \"\$progdir/\$file\"
-	exit 1
-      fi
-    fi
-
-    $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
-    { $RM \"\$progdir/\$program\";
-      $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; }
-    $RM \"\$progdir/\$file\"
-  fi"
-	else
-	  $ECHO "\
-  program='$outputname'
-  progdir=\"\$thisdir/$objdir\"
-"
-	fi
-
-	$ECHO "\
-
-  if test -f \"\$progdir/\$program\"; then"
-
-	# fixup the dll searchpath if we need to.
-	#
-	# Fix the DLL searchpath if we need to.  Do this before prepending
-	# to shlibpath, because on Windows, both are PATH and uninstalled
-	# libraries must come first.
-	if test -n "$dllsearchpath"; then
-	  $ECHO "\
-    # Add the dll search path components to the executable PATH
-    PATH=$dllsearchpath:\$PATH
-"
-	fi
-
-	# Export our shlibpath_var if we have one.
-	if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
-	  $ECHO "\
-    # Add our own library path to $shlibpath_var
-    $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
-
-    # Some systems cannot cope with colon-terminated $shlibpath_var
-    # The second colon is a workaround for a bug in BeOS R4 sed
-    $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\`
-
-    export $shlibpath_var
-"
-	fi
-
-	$ECHO "\
-    if test \"\$libtool_execute_magic\" != \"$magic\"; then
-      # Run the actual program with our arguments.
-      func_exec_program \${1+\"\$@\"}
-    fi
-  else
-    # The program doesn't exist.
-    \$ECHO \"\$0: error: '\$progdir/\$program' does not exist\" 1>&2
-    \$ECHO \"This script is just a wrapper for \$program.\" 1>&2
-    \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
-    exit 1
-  fi
-fi\
-"
-}
-
-
-# func_emit_cwrapperexe_src
-# emit the source code for a wrapper executable on stdout
-# Must ONLY be called from within func_mode_link because
-# it depends on a number of variable set therein.
-func_emit_cwrapperexe_src ()
-{
-	cat <<EOF
-
-/* $cwrappersource - temporary wrapper executable for $objdir/$outputname
-   Generated by $PROGRAM (GNU $PACKAGE) $VERSION
-
-   The $output program cannot be directly executed until all the libtool
-   libraries that it depends on are installed.
-
-   This wrapper executable should never be moved out of the build directory.
-   If it is, it will not operate correctly.
-*/
-EOF
-	    cat <<"EOF"
-#ifdef _MSC_VER
-# define _CRT_SECURE_NO_DEPRECATE 1
-#endif
-#include <stdio.h>
-#include <stdlib.h>
-#ifdef _MSC_VER
-# include <direct.h>
-# include <process.h>
-# include <io.h>
-#else
-# include <unistd.h>
-# include <stdint.h>
-# ifdef __CYGWIN__
-#  include <io.h>
-# endif
-#endif
-#include <malloc.h>
-#include <stdarg.h>
-#include <assert.h>
-#include <string.h>
-#include <ctype.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <sys/stat.h>
-
-#define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0)
-
-/* declarations of non-ANSI functions */
-#if defined __MINGW32__
-# ifdef __STRICT_ANSI__
-int _putenv (const char *);
-# endif
-#elif defined __CYGWIN__
-# ifdef __STRICT_ANSI__
-char *realpath (const char *, char *);
-int putenv (char *);
-int setenv (const char *, const char *, int);
-# endif
-/* #elif defined other_platform || defined ... */
-#endif
-
-/* portability defines, excluding path handling macros */
-#if defined _MSC_VER
-# define setmode _setmode
-# define stat    _stat
-# define chmod   _chmod
-# define getcwd  _getcwd
-# define putenv  _putenv
-# define S_IXUSR _S_IEXEC
-#elif defined __MINGW32__
-# define setmode _setmode
-# define stat    _stat
-# define chmod   _chmod
-# define getcwd  _getcwd
-# define putenv  _putenv
-#elif defined __CYGWIN__
-# define HAVE_SETENV
-# define FOPEN_WB "wb"
-/* #elif defined other platforms ... */
-#endif
-
-#if defined PATH_MAX
-# define LT_PATHMAX PATH_MAX
-#elif defined MAXPATHLEN
-# define LT_PATHMAX MAXPATHLEN
-#else
-# define LT_PATHMAX 1024
-#endif
-
-#ifndef S_IXOTH
-# define S_IXOTH 0
-#endif
-#ifndef S_IXGRP
-# define S_IXGRP 0
-#endif
-
-/* path handling portability macros */
-#ifndef DIR_SEPARATOR
-# define DIR_SEPARATOR '/'
-# define PATH_SEPARATOR ':'
-#endif
-
-#if defined _WIN32 || defined __MSDOS__ || defined __DJGPP__ || \
-  defined __OS2__
-# define HAVE_DOS_BASED_FILE_SYSTEM
-# define FOPEN_WB "wb"
-# ifndef DIR_SEPARATOR_2
-#  define DIR_SEPARATOR_2 '\\'
-# endif
-# ifndef PATH_SEPARATOR_2
-#  define PATH_SEPARATOR_2 ';'
-# endif
-#endif
-
-#ifndef DIR_SEPARATOR_2
-# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
-#else /* DIR_SEPARATOR_2 */
-# define IS_DIR_SEPARATOR(ch) \
-	(((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
-#endif /* DIR_SEPARATOR_2 */
-
-#ifndef PATH_SEPARATOR_2
-# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
-#else /* PATH_SEPARATOR_2 */
-# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
-#endif /* PATH_SEPARATOR_2 */
-
-#ifndef FOPEN_WB
-# define FOPEN_WB "w"
-#endif
-#ifndef _O_BINARY
-# define _O_BINARY 0
-#endif
-
-#define XMALLOC(type, num)      ((type *) xmalloc ((num) * sizeof(type)))
-#define XFREE(stale) do { \
-  if (stale) { free (stale); stale = 0; } \
-} while (0)
-
-#if defined LT_DEBUGWRAPPER
-static int lt_debug = 1;
-#else
-static int lt_debug = 0;
-#endif
-
-const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */
-
-void *xmalloc (size_t num);
-char *xstrdup (const char *string);
-const char *base_name (const char *name);
-char *find_executable (const char *wrapper);
-char *chase_symlinks (const char *pathspec);
-int make_executable (const char *path);
-int check_executable (const char *path);
-char *strendzap (char *str, const char *pat);
-void lt_debugprintf (const char *file, int line, const char *fmt, ...);
-void lt_fatal (const char *file, int line, const char *message, ...);
-static const char *nonnull (const char *s);
-static const char *nonempty (const char *s);
-void lt_setenv (const char *name, const char *value);
-char *lt_extend_str (const char *orig_value, const char *add, int to_end);
-void lt_update_exe_path (const char *name, const char *value);
-void lt_update_lib_path (const char *name, const char *value);
-char **prepare_spawn (char **argv);
-void lt_dump_script (FILE *f);
-EOF
-
-	    cat <<EOF
-#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 5)
-# define externally_visible volatile
-#else
-# define externally_visible __attribute__((externally_visible)) volatile
-#endif
-externally_visible const char * MAGIC_EXE = "$magic_exe";
-const char * LIB_PATH_VARNAME = "$shlibpath_var";
-EOF
-
-	    if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
-              func_to_host_path "$temp_rpath"
-	      cat <<EOF
-const char * LIB_PATH_VALUE   = "$func_to_host_path_result";
-EOF
-	    else
-	      cat <<"EOF"
-const char * LIB_PATH_VALUE   = "";
-EOF
-	    fi
-
-	    if test -n "$dllsearchpath"; then
-              func_to_host_path "$dllsearchpath:"
-	      cat <<EOF
-const char * EXE_PATH_VARNAME = "PATH";
-const char * EXE_PATH_VALUE   = "$func_to_host_path_result";
-EOF
-	    else
-	      cat <<"EOF"
-const char * EXE_PATH_VARNAME = "";
-const char * EXE_PATH_VALUE   = "";
-EOF
-	    fi
-
-	    if test yes = "$fast_install"; then
-	      cat <<EOF
-const char * TARGET_PROGRAM_NAME = "lt-$outputname"; /* hopefully, no .exe */
-EOF
-	    else
-	      cat <<EOF
-const char * TARGET_PROGRAM_NAME = "$outputname"; /* hopefully, no .exe */
-EOF
-	    fi
-
-
-	    cat <<"EOF"
-
-#define LTWRAPPER_OPTION_PREFIX         "--lt-"
-
-static const char *ltwrapper_option_prefix = LTWRAPPER_OPTION_PREFIX;
-static const char *dumpscript_opt       = LTWRAPPER_OPTION_PREFIX "dump-script";
-static const char *debug_opt            = LTWRAPPER_OPTION_PREFIX "debug";
-
-int
-main (int argc, char *argv[])
-{
-  char **newargz;
-  int  newargc;
-  char *tmp_pathspec;
-  char *actual_cwrapper_path;
-  char *actual_cwrapper_name;
-  char *target_name;
-  char *lt_argv_zero;
-  int rval = 127;
-
-  int i;
-
-  program_name = (char *) xstrdup (base_name (argv[0]));
-  newargz = XMALLOC (char *, (size_t) argc + 1);
-
-  /* very simple arg parsing; don't want to rely on getopt
-   * also, copy all non cwrapper options to newargz, except
-   * argz[0], which is handled differently
-   */
-  newargc=0;
-  for (i = 1; i < argc; i++)
-    {
-      if (STREQ (argv[i], dumpscript_opt))
-	{
-EOF
-	    case $host in
-	      *mingw* | *cygwin* )
-		# make stdout use "unix" line endings
-		echo "          setmode(1,_O_BINARY);"
-		;;
-	      esac
-
-	    cat <<"EOF"
-	  lt_dump_script (stdout);
-	  return 0;
-	}
-      if (STREQ (argv[i], debug_opt))
-	{
-          lt_debug = 1;
-          continue;
-	}
-      if (STREQ (argv[i], ltwrapper_option_prefix))
-        {
-          /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
-             namespace, but it is not one of the ones we know about and
-             have already dealt with, above (inluding dump-script), then
-             report an error. Otherwise, targets might begin to believe
-             they are allowed to use options in the LTWRAPPER_OPTION_PREFIX
-             namespace. The first time any user complains about this, we'll
-             need to make LTWRAPPER_OPTION_PREFIX a configure-time option
-             or a configure.ac-settable value.
-           */
-          lt_fatal (__FILE__, __LINE__,
-		    "unrecognized %s option: '%s'",
-                    ltwrapper_option_prefix, argv[i]);
-        }
-      /* otherwise ... */
-      newargz[++newargc] = xstrdup (argv[i]);
-    }
-  newargz[++newargc] = NULL;
-
-EOF
-	    cat <<EOF
-  /* The GNU banner must be the first non-error debug message */
-  lt_debugprintf (__FILE__, __LINE__, "libtool wrapper (GNU $PACKAGE) $VERSION\n");
-EOF
-	    cat <<"EOF"
-  lt_debugprintf (__FILE__, __LINE__, "(main) argv[0]: %s\n", argv[0]);
-  lt_debugprintf (__FILE__, __LINE__, "(main) program_name: %s\n", program_name);
-
-  tmp_pathspec = find_executable (argv[0]);
-  if (tmp_pathspec == NULL)
-    lt_fatal (__FILE__, __LINE__, "couldn't find %s", argv[0]);
-  lt_debugprintf (__FILE__, __LINE__,
-                  "(main) found exe (before symlink chase) at: %s\n",
-		  tmp_pathspec);
-
-  actual_cwrapper_path = chase_symlinks (tmp_pathspec);
-  lt_debugprintf (__FILE__, __LINE__,
-                  "(main) found exe (after symlink chase) at: %s\n",
-		  actual_cwrapper_path);
-  XFREE (tmp_pathspec);
-
-  actual_cwrapper_name = xstrdup (base_name (actual_cwrapper_path));
-  strendzap (actual_cwrapper_path, actual_cwrapper_name);
-
-  /* wrapper name transforms */
-  strendzap (actual_cwrapper_name, ".exe");
-  tmp_pathspec = lt_extend_str (actual_cwrapper_name, ".exe", 1);
-  XFREE (actual_cwrapper_name);
-  actual_cwrapper_name = tmp_pathspec;
-  tmp_pathspec = 0;
-
-  /* target_name transforms -- use actual target program name; might have lt- prefix */
-  target_name = xstrdup (base_name (TARGET_PROGRAM_NAME));
-  strendzap (target_name, ".exe");
-  tmp_pathspec = lt_extend_str (target_name, ".exe", 1);
-  XFREE (target_name);
-  target_name = tmp_pathspec;
-  tmp_pathspec = 0;
-
-  lt_debugprintf (__FILE__, __LINE__,
-		  "(main) libtool target name: %s\n",
-		  target_name);
-EOF
-
-	    cat <<EOF
-  newargz[0] =
-    XMALLOC (char, (strlen (actual_cwrapper_path) +
-		    strlen ("$objdir") + 1 + strlen (actual_cwrapper_name) + 1));
-  strcpy (newargz[0], actual_cwrapper_path);
-  strcat (newargz[0], "$objdir");
-  strcat (newargz[0], "/");
-EOF
-
-	    cat <<"EOF"
-  /* stop here, and copy so we don't have to do this twice */
-  tmp_pathspec = xstrdup (newargz[0]);
-
-  /* do NOT want the lt- prefix here, so use actual_cwrapper_name */
-  strcat (newargz[0], actual_cwrapper_name);
-
-  /* DO want the lt- prefix here if it exists, so use target_name */
-  lt_argv_zero = lt_extend_str (tmp_pathspec, target_name, 1);
-  XFREE (tmp_pathspec);
-  tmp_pathspec = NULL;
-EOF
-
-	    case $host_os in
-	      mingw*)
-	    cat <<"EOF"
-  {
-    char* p;
-    while ((p = strchr (newargz[0], '\\')) != NULL)
-      {
-	*p = '/';
-      }
-    while ((p = strchr (lt_argv_zero, '\\')) != NULL)
-      {
-	*p = '/';
-      }
-  }
-EOF
-	    ;;
-	    esac
-
-	    cat <<"EOF"
-  XFREE (target_name);
-  XFREE (actual_cwrapper_path);
-  XFREE (actual_cwrapper_name);
-
-  lt_setenv ("BIN_SH", "xpg4"); /* for Tru64 */
-  lt_setenv ("DUALCASE", "1");  /* for MSK sh */
-  /* Update the DLL searchpath.  EXE_PATH_VALUE ($dllsearchpath) must
-     be prepended before (that is, appear after) LIB_PATH_VALUE ($temp_rpath)
-     because on Windows, both *_VARNAMEs are PATH but uninstalled
-     libraries must come first. */
-  lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE);
-  lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE);
-
-  lt_debugprintf (__FILE__, __LINE__, "(main) lt_argv_zero: %s\n",
-		  nonnull (lt_argv_zero));
-  for (i = 0; i < newargc; i++)
-    {
-      lt_debugprintf (__FILE__, __LINE__, "(main) newargz[%d]: %s\n",
-		      i, nonnull (newargz[i]));
-    }
-
-EOF
-
-	    case $host_os in
-	      mingw*)
-		cat <<"EOF"
-  /* execv doesn't actually work on mingw as expected on unix */
-  newargz = prepare_spawn (newargz);
-  rval = (int) _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
-  if (rval == -1)
-    {
-      /* failed to start process */
-      lt_debugprintf (__FILE__, __LINE__,
-		      "(main) failed to launch target \"%s\": %s\n",
-		      lt_argv_zero, nonnull (strerror (errno)));
-      return 127;
-    }
-  return rval;
-EOF
-		;;
-	      *)
-		cat <<"EOF"
-  execv (lt_argv_zero, newargz);
-  return rval; /* =127, but avoids unused variable warning */
-EOF
-		;;
-	    esac
-
-	    cat <<"EOF"
-}
-
-void *
-xmalloc (size_t num)
-{
-  void *p = (void *) malloc (num);
-  if (!p)
-    lt_fatal (__FILE__, __LINE__, "memory exhausted");
-
-  return p;
-}
-
-char *
-xstrdup (const char *string)
-{
-  return string ? strcpy ((char *) xmalloc (strlen (string) + 1),
-			  string) : NULL;
-}
-
-const char *
-base_name (const char *name)
-{
-  const char *base;
-
-#if defined HAVE_DOS_BASED_FILE_SYSTEM
-  /* Skip over the disk name in MSDOS pathnames. */
-  if (isalpha ((unsigned char) name[0]) && name[1] == ':')
-    name += 2;
-#endif
-
-  for (base = name; *name; name++)
-    if (IS_DIR_SEPARATOR (*name))
-      base = name + 1;
-  return base;
-}
-
-int
-check_executable (const char *path)
-{
-  struct stat st;
-
-  lt_debugprintf (__FILE__, __LINE__, "(check_executable): %s\n",
-                  nonempty (path));
-  if ((!path) || (!*path))
-    return 0;
-
-  if ((stat (path, &st) >= 0)
-      && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)))
-    return 1;
-  else
-    return 0;
-}
-
-int
-make_executable (const char *path)
-{
-  int rval = 0;
-  struct stat st;
-
-  lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n",
-                  nonempty (path));
-  if ((!path) || (!*path))
-    return 0;
-
-  if (stat (path, &st) >= 0)
-    {
-      rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR);
-    }
-  return rval;
-}
-
-/* Searches for the full path of the wrapper.  Returns
-   newly allocated full path name if found, NULL otherwise
-   Does not chase symlinks, even on platforms that support them.
-*/
-char *
-find_executable (const char *wrapper)
-{
-  int has_slash = 0;
-  const char *p;
-  const char *p_next;
-  /* static buffer for getcwd */
-  char tmp[LT_PATHMAX + 1];
-  size_t tmp_len;
-  char *concat_name;
-
-  lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n",
-                  nonempty (wrapper));
-
-  if ((wrapper == NULL) || (*wrapper == '\0'))
-    return NULL;
-
-  /* Absolute path? */
-#if defined HAVE_DOS_BASED_FILE_SYSTEM
-  if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':')
-    {
-      concat_name = xstrdup (wrapper);
-      if (check_executable (concat_name))
-	return concat_name;
-      XFREE (concat_name);
-    }
-  else
-    {
-#endif
-      if (IS_DIR_SEPARATOR (wrapper[0]))
-	{
-	  concat_name = xstrdup (wrapper);
-	  if (check_executable (concat_name))
-	    return concat_name;
-	  XFREE (concat_name);
-	}
-#if defined HAVE_DOS_BASED_FILE_SYSTEM
-    }
-#endif
-
-  for (p = wrapper; *p; p++)
-    if (*p == '/')
-      {
-	has_slash = 1;
-	break;
-      }
-  if (!has_slash)
-    {
-      /* no slashes; search PATH */
-      const char *path = getenv ("PATH");
-      if (path != NULL)
-	{
-	  for (p = path; *p; p = p_next)
-	    {
-	      const char *q;
-	      size_t p_len;
-	      for (q = p; *q; q++)
-		if (IS_PATH_SEPARATOR (*q))
-		  break;
-	      p_len = (size_t) (q - p);
-	      p_next = (*q == '\0' ? q : q + 1);
-	      if (p_len == 0)
-		{
-		  /* empty path: current directory */
-		  if (getcwd (tmp, LT_PATHMAX) == NULL)
-		    lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
-                              nonnull (strerror (errno)));
-		  tmp_len = strlen (tmp);
-		  concat_name =
-		    XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
-		  memcpy (concat_name, tmp, tmp_len);
-		  concat_name[tmp_len] = '/';
-		  strcpy (concat_name + tmp_len + 1, wrapper);
-		}
-	      else
-		{
-		  concat_name =
-		    XMALLOC (char, p_len + 1 + strlen (wrapper) + 1);
-		  memcpy (concat_name, p, p_len);
-		  concat_name[p_len] = '/';
-		  strcpy (concat_name + p_len + 1, wrapper);
-		}
-	      if (check_executable (concat_name))
-		return concat_name;
-	      XFREE (concat_name);
-	    }
-	}
-      /* not found in PATH; assume curdir */
-    }
-  /* Relative path | not found in path: prepend cwd */
-  if (getcwd (tmp, LT_PATHMAX) == NULL)
-    lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
-              nonnull (strerror (errno)));
-  tmp_len = strlen (tmp);
-  concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
-  memcpy (concat_name, tmp, tmp_len);
-  concat_name[tmp_len] = '/';
-  strcpy (concat_name + tmp_len + 1, wrapper);
-
-  if (check_executable (concat_name))
-    return concat_name;
-  XFREE (concat_name);
-  return NULL;
-}
-
-char *
-chase_symlinks (const char *pathspec)
-{
-#ifndef S_ISLNK
-  return xstrdup (pathspec);
-#else
-  char buf[LT_PATHMAX];
-  struct stat s;
-  char *tmp_pathspec = xstrdup (pathspec);
-  char *p;
-  int has_symlinks = 0;
-  while (strlen (tmp_pathspec) && !has_symlinks)
-    {
-      lt_debugprintf (__FILE__, __LINE__,
-		      "checking path component for symlinks: %s\n",
-		      tmp_pathspec);
-      if (lstat (tmp_pathspec, &s) == 0)
-	{
-	  if (S_ISLNK (s.st_mode) != 0)
-	    {
-	      has_symlinks = 1;
-	      break;
-	    }
-
-	  /* search backwards for last DIR_SEPARATOR */
-	  p = tmp_pathspec + strlen (tmp_pathspec) - 1;
-	  while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
-	    p--;
-	  if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
-	    {
-	      /* no more DIR_SEPARATORS left */
-	      break;
-	    }
-	  *p = '\0';
-	}
-      else
-	{
-	  lt_fatal (__FILE__, __LINE__,
-		    "error accessing file \"%s\": %s",
-		    tmp_pathspec, nonnull (strerror (errno)));
-	}
-    }
-  XFREE (tmp_pathspec);
-
-  if (!has_symlinks)
-    {
-      return xstrdup (pathspec);
-    }
-
-  tmp_pathspec = realpath (pathspec, buf);
-  if (tmp_pathspec == 0)
-    {
-      lt_fatal (__FILE__, __LINE__,
-		"could not follow symlinks for %s", pathspec);
-    }
-  return xstrdup (tmp_pathspec);
-#endif
-}
-
-char *
-strendzap (char *str, const char *pat)
-{
-  size_t len, patlen;
-
-  assert (str != NULL);
-  assert (pat != NULL);
-
-  len = strlen (str);
-  patlen = strlen (pat);
-
-  if (patlen <= len)
-    {
-      str += len - patlen;
-      if (STREQ (str, pat))
-	*str = '\0';
-    }
-  return str;
-}
-
-void
-lt_debugprintf (const char *file, int line, const char *fmt, ...)
-{
-  va_list args;
-  if (lt_debug)
-    {
-      (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line);
-      va_start (args, fmt);
-      (void) vfprintf (stderr, fmt, args);
-      va_end (args);
-    }
-}
-
-static void
-lt_error_core (int exit_status, const char *file,
-	       int line, const char *mode,
-	       const char *message, va_list ap)
-{
-  fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode);
-  vfprintf (stderr, message, ap);
-  fprintf (stderr, ".\n");
-
-  if (exit_status >= 0)
-    exit (exit_status);
-}
-
-void
-lt_fatal (const char *file, int line, const char *message, ...)
-{
-  va_list ap;
-  va_start (ap, message);
-  lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap);
-  va_end (ap);
-}
-
-static const char *
-nonnull (const char *s)
-{
-  return s ? s : "(null)";
-}
-
-static const char *
-nonempty (const char *s)
-{
-  return (s && !*s) ? "(empty)" : nonnull (s);
-}
-
-void
-lt_setenv (const char *name, const char *value)
-{
-  lt_debugprintf (__FILE__, __LINE__,
-		  "(lt_setenv) setting '%s' to '%s'\n",
-                  nonnull (name), nonnull (value));
-  {
-#ifdef HAVE_SETENV
-    /* always make a copy, for consistency with !HAVE_SETENV */
-    char *str = xstrdup (value);
-    setenv (name, str, 1);
-#else
-    size_t len = strlen (name) + 1 + strlen (value) + 1;
-    char *str = XMALLOC (char, len);
-    sprintf (str, "%s=%s", name, value);
-    if (putenv (str) != EXIT_SUCCESS)
-      {
-        XFREE (str);
-      }
-#endif
-  }
-}
-
-char *
-lt_extend_str (const char *orig_value, const char *add, int to_end)
-{
-  char *new_value;
-  if (orig_value && *orig_value)
-    {
-      size_t orig_value_len = strlen (orig_value);
-      size_t add_len = strlen (add);
-      new_value = XMALLOC (char, add_len + orig_value_len + 1);
-      if (to_end)
-        {
-          strcpy (new_value, orig_value);
-          strcpy (new_value + orig_value_len, add);
-        }
-      else
-        {
-          strcpy (new_value, add);
-          strcpy (new_value + add_len, orig_value);
-        }
-    }
-  else
-    {
-      new_value = xstrdup (add);
-    }
-  return new_value;
-}
-
-void
-lt_update_exe_path (const char *name, const char *value)
-{
-  lt_debugprintf (__FILE__, __LINE__,
-		  "(lt_update_exe_path) modifying '%s' by prepending '%s'\n",
-                  nonnull (name), nonnull (value));
-
-  if (name && *name && value && *value)
-    {
-      char *new_value = lt_extend_str (getenv (name), value, 0);
-      /* some systems can't cope with a ':'-terminated path #' */
-      size_t len = strlen (new_value);
-      while ((len > 0) && IS_PATH_SEPARATOR (new_value[len-1]))
-        {
-          new_value[--len] = '\0';
-        }
-      lt_setenv (name, new_value);
-      XFREE (new_value);
-    }
-}
-
-void
-lt_update_lib_path (const char *name, const char *value)
-{
-  lt_debugprintf (__FILE__, __LINE__,
-		  "(lt_update_lib_path) modifying '%s' by prepending '%s'\n",
-                  nonnull (name), nonnull (value));
-
-  if (name && *name && value && *value)
-    {
-      char *new_value = lt_extend_str (getenv (name), value, 0);
-      lt_setenv (name, new_value);
-      XFREE (new_value);
-    }
-}
-
-EOF
-	    case $host_os in
-	      mingw*)
-		cat <<"EOF"
-
-/* Prepares an argument vector before calling spawn().
-   Note that spawn() does not by itself call the command interpreter
-     (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") :
-      ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
-         GetVersionEx(&v);
-         v.dwPlatformId == VER_PLATFORM_WIN32_NT;
-      }) ? "cmd.exe" : "command.com").
-   Instead it simply concatenates the arguments, separated by ' ', and calls
-   CreateProcess().  We must quote the arguments since Win32 CreateProcess()
-   interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a
-   special way:
-   - Space and tab are interpreted as delimiters. They are not treated as
-     delimiters if they are surrounded by double quotes: "...".
-   - Unescaped double quotes are removed from the input. Their only effect is
-     that within double quotes, space and tab are treated like normal
-     characters.
-   - Backslashes not followed by double quotes are not special.
-   - But 2*n+1 backslashes followed by a double quote become
-     n backslashes followed by a double quote (n >= 0):
-       \" -> "
-       \\\" -> \"
-       \\\\\" -> \\"
- */
-#define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037"
-#define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037"
-char **
-prepare_spawn (char **argv)
-{
-  size_t argc;
-  char **new_argv;
-  size_t i;
-
-  /* Count number of arguments.  */
-  for (argc = 0; argv[argc] != NULL; argc++)
-    ;
-
-  /* Allocate new argument vector.  */
-  new_argv = XMALLOC (char *, argc + 1);
-
-  /* Put quoted arguments into the new argument vector.  */
-  for (i = 0; i < argc; i++)
-    {
-      const char *string = argv[i];
-
-      if (string[0] == '\0')
-	new_argv[i] = xstrdup ("\"\"");
-      else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL)
-	{
-	  int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL);
-	  size_t length;
-	  unsigned int backslashes;
-	  const char *s;
-	  char *quoted_string;
-	  char *p;
-
-	  length = 0;
-	  backslashes = 0;
-	  if (quote_around)
-	    length++;
-	  for (s = string; *s != '\0'; s++)
-	    {
-	      char c = *s;
-	      if (c == '"')
-		length += backslashes + 1;
-	      length++;
-	      if (c == '\\')
-		backslashes++;
-	      else
-		backslashes = 0;
-	    }
-	  if (quote_around)
-	    length += backslashes + 1;
-
-	  quoted_string = XMALLOC (char, length + 1);
-
-	  p = quoted_string;
-	  backslashes = 0;
-	  if (quote_around)
-	    *p++ = '"';
-	  for (s = string; *s != '\0'; s++)
-	    {
-	      char c = *s;
-	      if (c == '"')
-		{
-		  unsigned int j;
-		  for (j = backslashes + 1; j > 0; j--)
-		    *p++ = '\\';
-		}
-	      *p++ = c;
-	      if (c == '\\')
-		backslashes++;
-	      else
-		backslashes = 0;
-	    }
-	  if (quote_around)
-	    {
-	      unsigned int j;
-	      for (j = backslashes; j > 0; j--)
-		*p++ = '\\';
-	      *p++ = '"';
-	    }
-	  *p = '\0';
-
-	  new_argv[i] = quoted_string;
-	}
-      else
-	new_argv[i] = (char *) string;
-    }
-  new_argv[argc] = NULL;
-
-  return new_argv;
-}
-EOF
-		;;
-	    esac
-
-            cat <<"EOF"
-void lt_dump_script (FILE* f)
-{
-EOF
-	    func_emit_wrapper yes |
-	      $SED -n -e '
-s/^\(.\{79\}\)\(..*\)/\1\
-\2/
-h
-s/\([\\"]\)/\\\1/g
-s/$/\\n/
-s/\([^\n]*\).*/  fputs ("\1", f);/p
-g
-D'
-            cat <<"EOF"
-}
-EOF
-}
-# end: func_emit_cwrapperexe_src
-
-# func_win32_import_lib_p ARG
-# True if ARG is an import lib, as indicated by $file_magic_cmd
-func_win32_import_lib_p ()
-{
-    $debug_cmd
-
-    case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in
-    *import*) : ;;
-    *) false ;;
-    esac
-}
-
-# func_suncc_cstd_abi
-# !!ONLY CALL THIS FOR SUN CC AFTER $compile_command IS FULLY EXPANDED!!
-# Several compiler flags select an ABI that is incompatible with the
-# Cstd library. Avoid specifying it if any are in CXXFLAGS.
-func_suncc_cstd_abi ()
-{
-    $debug_cmd
-
-    case " $compile_command " in
-    *" -compat=g "*|*\ -std=c++[0-9][0-9]\ *|*" -library=stdcxx4 "*|*" -library=stlport4 "*)
-      suncc_use_cstd_abi=no
-      ;;
-    *)
-      suncc_use_cstd_abi=yes
-      ;;
-    esac
-}
-
-# func_mode_link arg...
-func_mode_link ()
-{
-    $debug_cmd
-
-    case $host in
-    *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
-      # It is impossible to link a dll without this setting, and
-      # we shouldn't force the makefile maintainer to figure out
-      # what system we are compiling for in order to pass an extra
-      # flag for every libtool invocation.
-      # allow_undefined=no
-
-      # FIXME: Unfortunately, there are problems with the above when trying
-      # to make a dll that has undefined symbols, in which case not
-      # even a static library is built.  For now, we need to specify
-      # -no-undefined on the libtool link line when we can be certain
-      # that all symbols are satisfied, otherwise we get a static library.
-      allow_undefined=yes
-      ;;
-    *)
-      allow_undefined=yes
-      ;;
-    esac
-    libtool_args=$nonopt
-    base_compile="$nonopt $@"
-    compile_command=$nonopt
-    finalize_command=$nonopt
-
-    compile_rpath=
-    finalize_rpath=
-    compile_shlibpath=
-    finalize_shlibpath=
-    convenience=
-    old_convenience=
-    deplibs=
-    old_deplibs=
-    compiler_flags=
-    linker_flags=
-    dllsearchpath=
-    lib_search_path=`pwd`
-    inst_prefix_dir=
-    new_inherited_linker_flags=
-
-    avoid_version=no
-    bindir=
-    dlfiles=
-    dlprefiles=
-    dlself=no
-    export_dynamic=no
-    export_symbols=
-    export_symbols_regex=
-    generated=
-    libobjs=
-    ltlibs=
-    module=no
-    no_install=no
-    objs=
-    os2dllname=
-    non_pic_objects=
-    precious_files_regex=
-    prefer_static_libs=no
-    preload=false
-    prev=
-    prevarg=
-    release=
-    rpath=
-    xrpath=
-    perm_rpath=
-    temp_rpath=
-    thread_safe=no
-    vinfo=
-    vinfo_number=no
-    weak_libs=
-    single_module=$wl-single_module
-    func_infer_tag $base_compile
-
-    # We need to know -static, to get the right output filenames.
-    for arg
-    do
-      case $arg in
-      -shared)
-	test yes != "$build_libtool_libs" \
-	  && func_fatal_configuration "cannot build a shared library"
-	build_old_libs=no
-	break
-	;;
-      -all-static | -static | -static-libtool-libs)
-	case $arg in
-	-all-static)
-	  if test yes = "$build_libtool_libs" && test -z "$link_static_flag"; then
-	    func_warning "complete static linking is impossible in this configuration"
-	  fi
-	  if test -n "$link_static_flag"; then
-	    dlopen_self=$dlopen_self_static
-	  fi
-	  prefer_static_libs=yes
-	  ;;
-	-static)
-	  if test -z "$pic_flag" && test -n "$link_static_flag"; then
-	    dlopen_self=$dlopen_self_static
-	  fi
-	  prefer_static_libs=built
-	  ;;
-	-static-libtool-libs)
-	  if test -z "$pic_flag" && test -n "$link_static_flag"; then
-	    dlopen_self=$dlopen_self_static
-	  fi
-	  prefer_static_libs=yes
-	  ;;
-	esac
-	build_libtool_libs=no
-	build_old_libs=yes
-	break
-	;;
-      esac
-    done
-
-    # See if our shared archives depend on static archives.
-    test -n "$old_archive_from_new_cmds" && build_old_libs=yes
-
-    # Go through the arguments, transforming them on the way.
-    while test "$#" -gt 0; do
-      arg=$1
-      shift
-      func_quote_for_eval "$arg"
-      qarg=$func_quote_for_eval_unquoted_result
-      func_append libtool_args " $func_quote_for_eval_result"
-
-      # If the previous option needs an argument, assign it.
-      if test -n "$prev"; then
-	case $prev in
-	output)
-	  func_append compile_command " @OUTPUT@"
-	  func_append finalize_command " @OUTPUT@"
-	  ;;
-	esac
-
-	case $prev in
-	bindir)
-	  bindir=$arg
-	  prev=
-	  continue
-	  ;;
-	dlfiles|dlprefiles)
-	  $preload || {
-	    # Add the symbol object into the linking commands.
-	    func_append compile_command " @SYMFILE@"
-	    func_append finalize_command " @SYMFILE@"
-	    preload=:
-	  }
-	  case $arg in
-	  *.la | *.lo) ;;  # We handle these cases below.
-	  force)
-	    if test no = "$dlself"; then
-	      dlself=needless
-	      export_dynamic=yes
-	    fi
-	    prev=
-	    continue
-	    ;;
-	  self)
-	    if test dlprefiles = "$prev"; then
-	      dlself=yes
-	    elif test dlfiles = "$prev" && test yes != "$dlopen_self"; then
-	      dlself=yes
-	    else
-	      dlself=needless
-	      export_dynamic=yes
-	    fi
-	    prev=
-	    continue
-	    ;;
-	  *)
-	    if test dlfiles = "$prev"; then
-	      func_append dlfiles " $arg"
-	    else
-	      func_append dlprefiles " $arg"
-	    fi
-	    prev=
-	    continue
-	    ;;
-	  esac
-	  ;;
-	expsyms)
-	  export_symbols=$arg
-	  test -f "$arg" \
-	    || func_fatal_error "symbol file '$arg' does not exist"
-	  prev=
-	  continue
-	  ;;
-	expsyms_regex)
-	  export_symbols_regex=$arg
-	  prev=
-	  continue
-	  ;;
-	framework)
-	  case $host in
-	    *-*-darwin*)
-	      case "$deplibs " in
-		*" $qarg.ltframework "*) ;;
-		*) func_append deplibs " $qarg.ltframework" # this is fixed later
-		   ;;
-	      esac
-	      ;;
-	  esac
-	  prev=
-	  continue
-	  ;;
-	inst_prefix)
-	  inst_prefix_dir=$arg
-	  prev=
-	  continue
-	  ;;
-	mllvm)
-	  # Clang does not use LLVM to link, so we can simply discard any
-	  # '-mllvm $arg' options when doing the link step.
-	  prev=
-	  continue
-	  ;;
-	objectlist)
-	  if test -f "$arg"; then
-	    save_arg=$arg
-	    moreargs=
-	    for fil in `cat "$save_arg"`
-	    do
-#	      func_append moreargs " $fil"
-	      arg=$fil
-	      # A libtool-controlled object.
-
-	      # Check to see that this really is a libtool object.
-	      if func_lalib_unsafe_p "$arg"; then
-		pic_object=
-		non_pic_object=
-
-		# Read the .lo file
-		func_source "$arg"
-
-		if test -z "$pic_object" ||
-		   test -z "$non_pic_object" ||
-		   test none = "$pic_object" &&
-		   test none = "$non_pic_object"; then
-		  func_fatal_error "cannot find name of object for '$arg'"
-		fi
-
-		# Extract subdirectory from the argument.
-		func_dirname "$arg" "/" ""
-		xdir=$func_dirname_result
-
-		if test none != "$pic_object"; then
-		  # Prepend the subdirectory the object is found in.
-		  pic_object=$xdir$pic_object
-
-		  if test dlfiles = "$prev"; then
-		    if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then
-		      func_append dlfiles " $pic_object"
-		      prev=
-		      continue
-		    else
-		      # If libtool objects are unsupported, then we need to preload.
-		      prev=dlprefiles
-		    fi
-		  fi
-
-		  # CHECK ME:  I think I busted this.  -Ossama
-		  if test dlprefiles = "$prev"; then
-		    # Preload the old-style object.
-		    func_append dlprefiles " $pic_object"
-		    prev=
-		  fi
-
-		  # A PIC object.
-		  func_append libobjs " $pic_object"
-		  arg=$pic_object
-		fi
-
-		# Non-PIC object.
-		if test none != "$non_pic_object"; then
-		  # Prepend the subdirectory the object is found in.
-		  non_pic_object=$xdir$non_pic_object
-
-		  # A standard non-PIC object
-		  func_append non_pic_objects " $non_pic_object"
-		  if test -z "$pic_object" || test none = "$pic_object"; then
-		    arg=$non_pic_object
-		  fi
-		else
-		  # If the PIC object exists, use it instead.
-		  # $xdir was prepended to $pic_object above.
-		  non_pic_object=$pic_object
-		  func_append non_pic_objects " $non_pic_object"
-		fi
-	      else
-		# Only an error if not doing a dry-run.
-		if $opt_dry_run; then
-		  # Extract subdirectory from the argument.
-		  func_dirname "$arg" "/" ""
-		  xdir=$func_dirname_result
-
-		  func_lo2o "$arg"
-		  pic_object=$xdir$objdir/$func_lo2o_result
-		  non_pic_object=$xdir$func_lo2o_result
-		  func_append libobjs " $pic_object"
-		  func_append non_pic_objects " $non_pic_object"
-	        else
-		  func_fatal_error "'$arg' is not a valid libtool object"
-		fi
-	      fi
-	    done
-	  else
-	    func_fatal_error "link input file '$arg' does not exist"
-	  fi
-	  arg=$save_arg
-	  prev=
-	  continue
-	  ;;
-	os2dllname)
-	  os2dllname=$arg
-	  prev=
-	  continue
-	  ;;
-	precious_regex)
-	  precious_files_regex=$arg
-	  prev=
-	  continue
-	  ;;
-	release)
-	  release=-$arg
-	  prev=
-	  continue
-	  ;;
-	rpath | xrpath)
-	  # We need an absolute path.
-	  case $arg in
-	  [\\/]* | [A-Za-z]:[\\/]*) ;;
-	  *)
-	    func_fatal_error "only absolute run-paths are allowed"
-	    ;;
-	  esac
-	  if test rpath = "$prev"; then
-	    case "$rpath " in
-	    *" $arg "*) ;;
-	    *) func_append rpath " $arg" ;;
-	    esac
-	  else
-	    case "$xrpath " in
-	    *" $arg "*) ;;
-	    *) func_append xrpath " $arg" ;;
-	    esac
-	  fi
-	  prev=
-	  continue
-	  ;;
-	shrext)
-	  shrext_cmds=$arg
-	  prev=
-	  continue
-	  ;;
-	weak)
-	  func_append weak_libs " $arg"
-	  prev=
-	  continue
-	  ;;
-	xcclinker)
-	  func_append linker_flags " $qarg"
-	  func_append compiler_flags " $qarg"
-	  prev=
-	  func_append compile_command " $qarg"
-	  func_append finalize_command " $qarg"
-	  continue
-	  ;;
-	xcompiler)
-	  func_append compiler_flags " $qarg"
-	  prev=
-	  func_append compile_command " $qarg"
-	  func_append finalize_command " $qarg"
-	  continue
-	  ;;
-	xlinker)
-	  func_append linker_flags " $qarg"
-	  func_append compiler_flags " $wl$qarg"
-	  prev=
-	  func_append compile_command " $wl$qarg"
-	  func_append finalize_command " $wl$qarg"
-	  continue
-	  ;;
-	*)
-	  eval "$prev=\"\$arg\""
-	  prev=
-	  continue
-	  ;;
-	esac
-      fi # test -n "$prev"
-
-      prevarg=$arg
-
-      case $arg in
-      -all-static)
-	if test -n "$link_static_flag"; then
-	  # See comment for -static flag below, for more details.
-	  func_append compile_command " $link_static_flag"
-	  func_append finalize_command " $link_static_flag"
-	fi
-	continue
-	;;
-
-      -allow-undefined)
-	# FIXME: remove this flag sometime in the future.
-	func_fatal_error "'-allow-undefined' must not be used because it is the default"
-	;;
-
-      -avoid-version)
-	avoid_version=yes
-	continue
-	;;
-
-      -bindir)
-	prev=bindir
-	continue
-	;;
-
-      -dlopen)
-	prev=dlfiles
-	continue
-	;;
-
-      -dlpreopen)
-	prev=dlprefiles
-	continue
-	;;
-
-      -export-dynamic)
-	export_dynamic=yes
-	continue
-	;;
-
-      -export-symbols | -export-symbols-regex)
-	if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
-	  func_fatal_error "more than one -exported-symbols argument is not allowed"
-	fi
-	if test X-export-symbols = "X$arg"; then
-	  prev=expsyms
-	else
-	  prev=expsyms_regex
-	fi
-	continue
-	;;
-
-      -framework)
-	prev=framework
-	continue
-	;;
-
-      -inst-prefix-dir)
-	prev=inst_prefix
-	continue
-	;;
-
-      # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
-      # so, if we see these flags be careful not to treat them like -L
-      -L[A-Z][A-Z]*:*)
-	case $with_gcc/$host in
-	no/*-*-irix* | /*-*-irix*)
-	  func_append compile_command " $arg"
-	  func_append finalize_command " $arg"
-	  ;;
-	esac
-	continue
-	;;
-
-      -L*)
-	func_stripname "-L" '' "$arg"
-	if test -z "$func_stripname_result"; then
-	  if test "$#" -gt 0; then
-	    func_fatal_error "require no space between '-L' and '$1'"
-	  else
-	    func_fatal_error "need path for '-L' option"
-	  fi
-	fi
-	func_resolve_sysroot "$func_stripname_result"
-	dir=$func_resolve_sysroot_result
-	# We need an absolute path.
-	case $dir in
-	[\\/]* | [A-Za-z]:[\\/]*) ;;
-	*)
-	  absdir=`cd "$dir" && pwd`
-	  test -z "$absdir" && \
-	    func_fatal_error "cannot determine absolute directory name of '$dir'"
-	  dir=$absdir
-	  ;;
-	esac
-	case "$deplibs " in
-	*" -L$dir "* | *" $arg "*)
-	  # Will only happen for absolute or sysroot arguments
-	  ;;
-	*)
-	  # Preserve sysroot, but never include relative directories
-	  case $dir in
-	    [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;;
-	    *) func_append deplibs " -L$dir" ;;
-	  esac
-	  func_append lib_search_path " $dir"
-	  ;;
-	esac
-	case $host in
-	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
-	  testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'`
-	  case :$dllsearchpath: in
-	  *":$dir:"*) ;;
-	  ::) dllsearchpath=$dir;;
-	  *) func_append dllsearchpath ":$dir";;
-	  esac
-	  case :$dllsearchpath: in
-	  *":$testbindir:"*) ;;
-	  ::) dllsearchpath=$testbindir;;
-	  *) func_append dllsearchpath ":$testbindir";;
-	  esac
-	  ;;
-	esac
-	continue
-	;;
-
-      -l*)
-	if test X-lc = "X$arg" || test X-lm = "X$arg"; then
-	  case $host in
-	  *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*)
-	    # These systems don't actually have a C or math library (as such)
-	    continue
-	    ;;
-	  *-*-os2*)
-	    # These systems don't actually have a C library (as such)
-	    test X-lc = "X$arg" && continue
-	    ;;
-	  *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*)
-	    # Do not include libc due to us having libc/libc_r.
-	    test X-lc = "X$arg" && continue
-	    ;;
-	  *-*-rhapsody* | *-*-darwin1.[012])
-	    # Rhapsody C and math libraries are in the System framework
-	    func_append deplibs " System.ltframework"
-	    continue
-	    ;;
-	  *-*-sco3.2v5* | *-*-sco5v6*)
-	    # Causes problems with __ctype
-	    test X-lc = "X$arg" && continue
-	    ;;
-	  *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
-	    # Compiler inserts libc in the correct place for threads to work
-	    test X-lc = "X$arg" && continue
-	    ;;
-	  esac
-	elif test X-lc_r = "X$arg"; then
-	 case $host in
-	 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*)
-	   # Do not include libc_r directly, use -pthread flag.
-	   continue
-	   ;;
-	 esac
-	fi
-	func_append deplibs " $arg"
-	continue
-	;;
-
-      -mllvm)
-	prev=mllvm
-	continue
-	;;
-
-      -module)
-	module=yes
-	continue
-	;;
-
-      # Tru64 UNIX uses -model [arg] to determine the layout of C++
-      # classes, name mangling, and exception handling.
-      # Darwin uses the -arch flag to determine output architecture.
-      -model|-arch|-isysroot|--sysroot)
-	func_append compiler_flags " $arg"
-	func_append compile_command " $arg"
-	func_append finalize_command " $arg"
-	prev=xcompiler
-	continue
-	;;
-
-      -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
-      |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
-	func_append compiler_flags " $arg"
-	func_append compile_command " $arg"
-	func_append finalize_command " $arg"
-	case "$new_inherited_linker_flags " in
-	    *" $arg "*) ;;
-	    * ) func_append new_inherited_linker_flags " $arg" ;;
-	esac
-	continue
-	;;
-
-      -multi_module)
-	single_module=$wl-multi_module
-	continue
-	;;
-
-      -no-fast-install)
-	fast_install=no
-	continue
-	;;
-
-      -no-install)
-	case $host in
-	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*)
-	  # The PATH hackery in wrapper scripts is required on Windows
-	  # and Darwin in order for the loader to find any dlls it needs.
-	  func_warning "'-no-install' is ignored for $host"
-	  func_warning "assuming '-no-fast-install' instead"
-	  fast_install=no
-	  ;;
-	*) no_install=yes ;;
-	esac
-	continue
-	;;
-
-      -no-undefined)
-	allow_undefined=no
-	continue
-	;;
-
-      -objectlist)
-	prev=objectlist
-	continue
-	;;
-
-      -os2dllname)
-	prev=os2dllname
-	continue
-	;;
-
-      -o) prev=output ;;
-
-      -precious-files-regex)
-	prev=precious_regex
-	continue
-	;;
-
-      -release)
-	prev=release
-	continue
-	;;
-
-      -rpath)
-	prev=rpath
-	continue
-	;;
-
-      -R)
-	prev=xrpath
-	continue
-	;;
-
-      -R*)
-	func_stripname '-R' '' "$arg"
-	dir=$func_stripname_result
-	# We need an absolute path.
-	case $dir in
-	[\\/]* | [A-Za-z]:[\\/]*) ;;
-	=*)
-	  func_stripname '=' '' "$dir"
-	  dir=$lt_sysroot$func_stripname_result
-	  ;;
-	*)
-	  func_fatal_error "only absolute run-paths are allowed"
-	  ;;
-	esac
-	case "$xrpath " in
-	*" $dir "*) ;;
-	*) func_append xrpath " $dir" ;;
-	esac
-	continue
-	;;
-
-      -shared)
-	# The effects of -shared are defined in a previous loop.
-	continue
-	;;
-
-      -shrext)
-	prev=shrext
-	continue
-	;;
-
-      -static | -static-libtool-libs)
-	# The effects of -static are defined in a previous loop.
-	# We used to do the same as -all-static on platforms that
-	# didn't have a PIC flag, but the assumption that the effects
-	# would be equivalent was wrong.  It would break on at least
-	# Digital Unix and AIX.
-	continue
-	;;
-
-      -thread-safe)
-	thread_safe=yes
-	continue
-	;;
-
-      -version-info)
-	prev=vinfo
-	continue
-	;;
-
-      -version-number)
-	prev=vinfo
-	vinfo_number=yes
-	continue
-	;;
-
-      -weak)
-        prev=weak
-	continue
-	;;
-
-      -Wc,*)
-	func_stripname '-Wc,' '' "$arg"
-	args=$func_stripname_result
-	arg=
-	save_ifs=$IFS; IFS=,
-	for flag in $args; do
-	  IFS=$save_ifs
-          func_quote_for_eval "$flag"
-	  func_append arg " $func_quote_for_eval_result"
-	  func_append compiler_flags " $func_quote_for_eval_result"
-	done
-	IFS=$save_ifs
-	func_stripname ' ' '' "$arg"
-	arg=$func_stripname_result
-	;;
-
-      -Wl,*)
-	func_stripname '-Wl,' '' "$arg"
-	args=$func_stripname_result
-	arg=
-	save_ifs=$IFS; IFS=,
-	for flag in $args; do
-	  IFS=$save_ifs
-          func_quote_for_eval "$flag"
-	  func_append arg " $wl$func_quote_for_eval_result"
-	  func_append compiler_flags " $wl$func_quote_for_eval_result"
-	  func_append linker_flags " $func_quote_for_eval_result"
-	done
-	IFS=$save_ifs
-	func_stripname ' ' '' "$arg"
-	arg=$func_stripname_result
-	;;
-
-      -Xcompiler)
-	prev=xcompiler
-	continue
-	;;
-
-      -Xlinker)
-	prev=xlinker
-	continue
-	;;
-
-      -XCClinker)
-	prev=xcclinker
-	continue
-	;;
-
-      # -msg_* for osf cc
-      -msg_*)
-	func_quote_for_eval "$arg"
-	arg=$func_quote_for_eval_result
-	;;
-
-      # Flags to be passed through unchanged, with rationale:
-      # -64, -mips[0-9]      enable 64-bit mode for the SGI compiler
-      # -r[0-9][0-9]*        specify processor for the SGI compiler
-      # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler
-      # +DA*, +DD*           enable 64-bit mode for the HP compiler
-      # -q*                  compiler args for the IBM compiler
-      # -m*, -t[45]*, -txscale* architecture-specific flags for GCC
-      # -F/path              path to uninstalled frameworks, gcc on darwin
-      # -p, -pg, --coverage, -fprofile-*  profiling flags for GCC
-      # -fstack-protector*   stack protector flags for GCC
-      # @file                GCC response files
-      # -tp=*                Portland pgcc target processor selection
-      # --sysroot=*          for sysroot support
-      # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
-      # -stdlib=*            select c++ std lib with clang
-      -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
-      -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
-      -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*)
-        func_quote_for_eval "$arg"
-	arg=$func_quote_for_eval_result
-        func_append compile_command " $arg"
-        func_append finalize_command " $arg"
-        func_append compiler_flags " $arg"
-        continue
-        ;;
-
-      -Z*)
-        if test os2 = "`expr $host : '.*\(os2\)'`"; then
-          # OS/2 uses -Zxxx to specify OS/2-specific options
-	  compiler_flags="$compiler_flags $arg"
-	  func_append compile_command " $arg"
-	  func_append finalize_command " $arg"
-	  case $arg in
-	  -Zlinker | -Zstack)
-	    prev=xcompiler
-	    ;;
-	  esac
-	  continue
-        else
-	  # Otherwise treat like 'Some other compiler flag' below
-	  func_quote_for_eval "$arg"
-	  arg=$func_quote_for_eval_result
-        fi
-	;;
-
-      # Some other compiler flag.
-      -* | +*)
-        func_quote_for_eval "$arg"
-	arg=$func_quote_for_eval_result
-	;;
-
-      *.$objext)
-	# A standard object.
-	func_append objs " $arg"
-	;;
-
-      *.lo)
-	# A libtool-controlled object.
-
-	# Check to see that this really is a libtool object.
-	if func_lalib_unsafe_p "$arg"; then
-	  pic_object=
-	  non_pic_object=
-
-	  # Read the .lo file
-	  func_source "$arg"
-
-	  if test -z "$pic_object" ||
-	     test -z "$non_pic_object" ||
-	     test none = "$pic_object" &&
-	     test none = "$non_pic_object"; then
-	    func_fatal_error "cannot find name of object for '$arg'"
-	  fi
-
-	  # Extract subdirectory from the argument.
-	  func_dirname "$arg" "/" ""
-	  xdir=$func_dirname_result
-
-	  test none = "$pic_object" || {
-	    # Prepend the subdirectory the object is found in.
-	    pic_object=$xdir$pic_object
-
-	    if test dlfiles = "$prev"; then
-	      if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then
-		func_append dlfiles " $pic_object"
-		prev=
-		continue
-	      else
-		# If libtool objects are unsupported, then we need to preload.
-		prev=dlprefiles
-	      fi
-	    fi
-
-	    # CHECK ME:  I think I busted this.  -Ossama
-	    if test dlprefiles = "$prev"; then
-	      # Preload the old-style object.
-	      func_append dlprefiles " $pic_object"
-	      prev=
-	    fi
-
-	    # A PIC object.
-	    func_append libobjs " $pic_object"
-	    arg=$pic_object
-	  }
-
-	  # Non-PIC object.
-	  if test none != "$non_pic_object"; then
-	    # Prepend the subdirectory the object is found in.
-	    non_pic_object=$xdir$non_pic_object
-
-	    # A standard non-PIC object
-	    func_append non_pic_objects " $non_pic_object"
-	    if test -z "$pic_object" || test none = "$pic_object"; then
-	      arg=$non_pic_object
-	    fi
-	  else
-	    # If the PIC object exists, use it instead.
-	    # $xdir was prepended to $pic_object above.
-	    non_pic_object=$pic_object
-	    func_append non_pic_objects " $non_pic_object"
-	  fi
-	else
-	  # Only an error if not doing a dry-run.
-	  if $opt_dry_run; then
-	    # Extract subdirectory from the argument.
-	    func_dirname "$arg" "/" ""
-	    xdir=$func_dirname_result
-
-	    func_lo2o "$arg"
-	    pic_object=$xdir$objdir/$func_lo2o_result
-	    non_pic_object=$xdir$func_lo2o_result
-	    func_append libobjs " $pic_object"
-	    func_append non_pic_objects " $non_pic_object"
-	  else
-	    func_fatal_error "'$arg' is not a valid libtool object"
-	  fi
-	fi
-	;;
-
-      *.$libext)
-	# An archive.
-	func_append deplibs " $arg"
-	func_append old_deplibs " $arg"
-	continue
-	;;
-
-      *.la)
-	# A libtool-controlled library.
-
-	func_resolve_sysroot "$arg"
-	if test dlfiles = "$prev"; then
-	  # This library was specified with -dlopen.
-	  func_append dlfiles " $func_resolve_sysroot_result"
-	  prev=
-	elif test dlprefiles = "$prev"; then
-	  # The library was specified with -dlpreopen.
-	  func_append dlprefiles " $func_resolve_sysroot_result"
-	  prev=
-	else
-	  func_append deplibs " $func_resolve_sysroot_result"
-	fi
-	continue
-	;;
-
-      # Some other compiler argument.
-      *)
-	# Unknown arguments in both finalize_command and compile_command need
-	# to be aesthetically quoted because they are evaled later.
-	func_quote_for_eval "$arg"
-	arg=$func_quote_for_eval_result
-	;;
-      esac # arg
-
-      # Now actually substitute the argument into the commands.
-      if test -n "$arg"; then
-	func_append compile_command " $arg"
-	func_append finalize_command " $arg"
-      fi
-    done # argument parsing loop
-
-    test -n "$prev" && \
-      func_fatal_help "the '$prevarg' option requires an argument"
-
-    if test yes = "$export_dynamic" && test -n "$export_dynamic_flag_spec"; then
-      eval arg=\"$export_dynamic_flag_spec\"
-      func_append compile_command " $arg"
-      func_append finalize_command " $arg"
-    fi
-
-    oldlibs=
-    # calculate the name of the file, without its directory
-    func_basename "$output"
-    outputname=$func_basename_result
-    libobjs_save=$libobjs
-
-    if test -n "$shlibpath_var"; then
-      # get the directories listed in $shlibpath_var
-      eval shlib_search_path=\`\$ECHO \"\$$shlibpath_var\" \| \$SED \'s/:/ /g\'\`
-    else
-      shlib_search_path=
-    fi
-    eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
-    eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
-
-    # Definition is injected by LT_CONFIG during libtool generation.
-    func_munge_path_list sys_lib_dlsearch_path "$LT_SYS_LIBRARY_PATH"
-
-    func_dirname "$output" "/" ""
-    output_objdir=$func_dirname_result$objdir
-    func_to_tool_file "$output_objdir/"
-    tool_output_objdir=$func_to_tool_file_result
-    # Create the object directory.
-    func_mkdir_p "$output_objdir"
-
-    # Determine the type of output
-    case $output in
-    "")
-      func_fatal_help "you must specify an output file"
-      ;;
-    *.$libext) linkmode=oldlib ;;
-    *.lo | *.$objext) linkmode=obj ;;
-    *.la) linkmode=lib ;;
-    *) linkmode=prog ;; # Anything else should be a program.
-    esac
-
-    specialdeplibs=
-
-    libs=
-    # Find all interdependent deplibs by searching for libraries
-    # that are linked more than once (e.g. -la -lb -la)
-    for deplib in $deplibs; do
-      if $opt_preserve_dup_deps; then
-	case "$libs " in
-	*" $deplib "*) func_append specialdeplibs " $deplib" ;;
-	esac
-      fi
-      func_append libs " $deplib"
-    done
-
-    if test lib = "$linkmode"; then
-      libs="$predeps $libs $compiler_lib_search_path $postdeps"
-
-      # Compute libraries that are listed more than once in $predeps
-      # $postdeps and mark them as special (i.e., whose duplicates are
-      # not to be eliminated).
-      pre_post_deps=
-      if $opt_duplicate_compiler_generated_deps; then
-	for pre_post_dep in $predeps $postdeps; do
-	  case "$pre_post_deps " in
-	  *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;;
-	  esac
-	  func_append pre_post_deps " $pre_post_dep"
-	done
-      fi
-      pre_post_deps=
-    fi
-
-    deplibs=
-    newdependency_libs=
-    newlib_search_path=
-    need_relink=no # whether we're linking any uninstalled libtool libraries
-    notinst_deplibs= # not-installed libtool libraries
-    notinst_path= # paths that contain not-installed libtool libraries
-
-    case $linkmode in
-    lib)
-	passes="conv dlpreopen link"
-	for file in $dlfiles $dlprefiles; do
-	  case $file in
-	  *.la) ;;
-	  *)
-	    func_fatal_help "libraries can '-dlopen' only libtool libraries: $file"
-	    ;;
-	  esac
-	done
-	;;
-    prog)
-	compile_deplibs=
-	finalize_deplibs=
-	alldeplibs=false
-	newdlfiles=
-	newdlprefiles=
-	passes="conv scan dlopen dlpreopen link"
-	;;
-    *)  passes="conv"
-	;;
-    esac
-
-    for pass in $passes; do
-      # The preopen pass in lib mode reverses $deplibs; put it back here
-      # so that -L comes before libs that need it for instance...
-      if test lib,link = "$linkmode,$pass"; then
-	## FIXME: Find the place where the list is rebuilt in the wrong
-	##        order, and fix it there properly
-        tmp_deplibs=
-	for deplib in $deplibs; do
-	  tmp_deplibs="$deplib $tmp_deplibs"
-	done
-	deplibs=$tmp_deplibs
-      fi
-
-      if test lib,link = "$linkmode,$pass" ||
-	 test prog,scan = "$linkmode,$pass"; then
-	libs=$deplibs
-	deplibs=
-      fi
-      if test prog = "$linkmode"; then
-	case $pass in
-	dlopen) libs=$dlfiles ;;
-	dlpreopen) libs=$dlprefiles ;;
-	link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
-	esac
-      fi
-      if test lib,dlpreopen = "$linkmode,$pass"; then
-	# Collect and forward deplibs of preopened libtool libs
-	for lib in $dlprefiles; do
-	  # Ignore non-libtool-libs
-	  dependency_libs=
-	  func_resolve_sysroot "$lib"
-	  case $lib in
-	  *.la)	func_source "$func_resolve_sysroot_result" ;;
-	  esac
-
-	  # Collect preopened libtool deplibs, except any this library
-	  # has declared as weak libs
-	  for deplib in $dependency_libs; do
-	    func_basename "$deplib"
-            deplib_base=$func_basename_result
-	    case " $weak_libs " in
-	    *" $deplib_base "*) ;;
-	    *) func_append deplibs " $deplib" ;;
-	    esac
-	  done
-	done
-	libs=$dlprefiles
-      fi
-      if test dlopen = "$pass"; then
-	# Collect dlpreopened libraries
-	save_deplibs=$deplibs
-	deplibs=
-      fi
-
-      for deplib in $libs; do
-	lib=
-	found=false
-	case $deplib in
-	-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
-        |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
-	  if test prog,link = "$linkmode,$pass"; then
-	    compile_deplibs="$deplib $compile_deplibs"
-	    finalize_deplibs="$deplib $finalize_deplibs"
-	  else
-	    func_append compiler_flags " $deplib"
-	    if test lib = "$linkmode"; then
-		case "$new_inherited_linker_flags " in
-		    *" $deplib "*) ;;
-		    * ) func_append new_inherited_linker_flags " $deplib" ;;
-		esac
-	    fi
-	  fi
-	  continue
-	  ;;
-	-l*)
-	  if test lib != "$linkmode" && test prog != "$linkmode"; then
-	    func_warning "'-l' is ignored for archives/objects"
-	    continue
-	  fi
-	  func_stripname '-l' '' "$deplib"
-	  name=$func_stripname_result
-	  if test lib = "$linkmode"; then
-	    searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
-	  else
-	    searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path"
-	  fi
-	  for searchdir in $searchdirs; do
-	    for search_ext in .la $std_shrext .so .a; do
-	      # Search the libtool library
-	      lib=$searchdir/lib$name$search_ext
-	      if test -f "$lib"; then
-		if test .la = "$search_ext"; then
-		  found=:
-		else
-		  found=false
-		fi
-		break 2
-	      fi
-	    done
-	  done
-	  if $found; then
-	    # deplib is a libtool library
-	    # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
-	    # We need to do some special things here, and not later.
-	    if test yes = "$allow_libtool_libs_with_static_runtimes"; then
-	      case " $predeps $postdeps " in
-	      *" $deplib "*)
-		if func_lalib_p "$lib"; then
-		  library_names=
-		  old_library=
-		  func_source "$lib"
-		  for l in $old_library $library_names; do
-		    ll=$l
-		  done
-		  if test "X$ll" = "X$old_library"; then # only static version available
-		    found=false
-		    func_dirname "$lib" "" "."
-		    ladir=$func_dirname_result
-		    lib=$ladir/$old_library
-		    if test prog,link = "$linkmode,$pass"; then
-		      compile_deplibs="$deplib $compile_deplibs"
-		      finalize_deplibs="$deplib $finalize_deplibs"
-		    else
-		      deplibs="$deplib $deplibs"
-		      test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs"
-		    fi
-		    continue
-		  fi
-		fi
-		;;
-	      *) ;;
-	      esac
-	    fi
-	  else
-	    # deplib doesn't seem to be a libtool library
-	    if test prog,link = "$linkmode,$pass"; then
-	      compile_deplibs="$deplib $compile_deplibs"
-	      finalize_deplibs="$deplib $finalize_deplibs"
-	    else
-	      deplibs="$deplib $deplibs"
-	      test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs"
-	    fi
-	    continue
-	  fi
-	  ;; # -l
-	*.ltframework)
-	  if test prog,link = "$linkmode,$pass"; then
-	    compile_deplibs="$deplib $compile_deplibs"
-	    finalize_deplibs="$deplib $finalize_deplibs"
-	  else
-	    deplibs="$deplib $deplibs"
-	    if test lib = "$linkmode"; then
-		case "$new_inherited_linker_flags " in
-		    *" $deplib "*) ;;
-		    * ) func_append new_inherited_linker_flags " $deplib" ;;
-		esac
-	    fi
-	  fi
-	  continue
-	  ;;
-	-L*)
-	  case $linkmode in
-	  lib)
-	    deplibs="$deplib $deplibs"
-	    test conv = "$pass" && continue
-	    newdependency_libs="$deplib $newdependency_libs"
-	    func_stripname '-L' '' "$deplib"
-	    func_resolve_sysroot "$func_stripname_result"
-	    func_append newlib_search_path " $func_resolve_sysroot_result"
-	    ;;
-	  prog)
-	    if test conv = "$pass"; then
-	      deplibs="$deplib $deplibs"
-	      continue
-	    fi
-	    if test scan = "$pass"; then
-	      deplibs="$deplib $deplibs"
-	    else
-	      compile_deplibs="$deplib $compile_deplibs"
-	      finalize_deplibs="$deplib $finalize_deplibs"
-	    fi
-	    func_stripname '-L' '' "$deplib"
-	    func_resolve_sysroot "$func_stripname_result"
-	    func_append newlib_search_path " $func_resolve_sysroot_result"
-	    ;;
-	  *)
-	    func_warning "'-L' is ignored for archives/objects"
-	    ;;
-	  esac # linkmode
-	  continue
-	  ;; # -L
-	-R*)
-	  if test link = "$pass"; then
-	    func_stripname '-R' '' "$deplib"
-	    func_resolve_sysroot "$func_stripname_result"
-	    dir=$func_resolve_sysroot_result
-	    # Make sure the xrpath contains only unique directories.
-	    case "$xrpath " in
-	    *" $dir "*) ;;
-	    *) func_append xrpath " $dir" ;;
-	    esac
-	  fi
-	  deplibs="$deplib $deplibs"
-	  continue
-	  ;;
-	*.la)
-	  func_resolve_sysroot "$deplib"
-	  lib=$func_resolve_sysroot_result
-	  ;;
-	*.$libext)
-	  if test conv = "$pass"; then
-	    deplibs="$deplib $deplibs"
-	    continue
-	  fi
-	  case $linkmode in
-	  lib)
-	    # Linking convenience modules into shared libraries is allowed,
-	    # but linking other static libraries is non-portable.
-	    case " $dlpreconveniencelibs " in
-	    *" $deplib "*) ;;
-	    *)
-	      valid_a_lib=false
-	      case $deplibs_check_method in
-		match_pattern*)
-		  set dummy $deplibs_check_method; shift
-		  match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
-		  if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \
-		    | $EGREP "$match_pattern_regex" > /dev/null; then
-		    valid_a_lib=:
-		  fi
-		;;
-		pass_all)
-		  valid_a_lib=:
-		;;
-	      esac
-	      if $valid_a_lib; then
-		echo
-		$ECHO "*** Warning: Linking the shared library $output against the"
-		$ECHO "*** static library $deplib is not portable!"
-		deplibs="$deplib $deplibs"
-	      else
-		echo
-		$ECHO "*** Warning: Trying to link with static lib archive $deplib."
-		echo "*** I have the capability to make that library automatically link in when"
-		echo "*** you link to this library.  But I can only do this if you have a"
-		echo "*** shared version of the library, which you do not appear to have"
-		echo "*** because the file extensions .$libext of this argument makes me believe"
-		echo "*** that it is just a static archive that I should not use here."
-	      fi
-	      ;;
-	    esac
-	    continue
-	    ;;
-	  prog)
-	    if test link != "$pass"; then
-	      deplibs="$deplib $deplibs"
-	    else
-	      compile_deplibs="$deplib $compile_deplibs"
-	      finalize_deplibs="$deplib $finalize_deplibs"
-	    fi
-	    continue
-	    ;;
-	  esac # linkmode
-	  ;; # *.$libext
-	*.lo | *.$objext)
-	  if test conv = "$pass"; then
-	    deplibs="$deplib $deplibs"
-	  elif test prog = "$linkmode"; then
-	    if test dlpreopen = "$pass" || test yes != "$dlopen_support" || test no = "$build_libtool_libs"; then
-	      # If there is no dlopen support or we're linking statically,
-	      # we need to preload.
-	      func_append newdlprefiles " $deplib"
-	      compile_deplibs="$deplib $compile_deplibs"
-	      finalize_deplibs="$deplib $finalize_deplibs"
-	    else
-	      func_append newdlfiles " $deplib"
-	    fi
-	  fi
-	  continue
-	  ;;
-	%DEPLIBS%)
-	  alldeplibs=:
-	  continue
-	  ;;
-	esac # case $deplib
-
-	$found || test -f "$lib" \
-	  || func_fatal_error "cannot find the library '$lib' or unhandled argument '$deplib'"
-
-	# Check to see that this really is a libtool archive.
-	func_lalib_unsafe_p "$lib" \
-	  || func_fatal_error "'$lib' is not a valid libtool archive"
-
-	func_dirname "$lib" "" "."
-	ladir=$func_dirname_result
-
-	dlname=
-	dlopen=
-	dlpreopen=
-	libdir=
-	library_names=
-	old_library=
-	inherited_linker_flags=
-	# If the library was installed with an old release of libtool,
-	# it will not redefine variables installed, or shouldnotlink
-	installed=yes
-	shouldnotlink=no
-	avoidtemprpath=
-
-
-	# Read the .la file
-	func_source "$lib"
-
-	# Convert "-framework foo" to "foo.ltframework"
-	if test -n "$inherited_linker_flags"; then
-	  tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'`
-	  for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do
-	    case " $new_inherited_linker_flags " in
-	      *" $tmp_inherited_linker_flag "*) ;;
-	      *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";;
-	    esac
-	  done
-	fi
-	dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
-	if test lib,link = "$linkmode,$pass" ||
-	   test prog,scan = "$linkmode,$pass" ||
-	   { test prog != "$linkmode" && test lib != "$linkmode"; }; then
-	  test -n "$dlopen" && func_append dlfiles " $dlopen"
-	  test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen"
-	fi
-
-	if test conv = "$pass"; then
-	  # Only check for convenience libraries
-	  deplibs="$lib $deplibs"
-	  if test -z "$libdir"; then
-	    if test -z "$old_library"; then
-	      func_fatal_error "cannot find name of link library for '$lib'"
-	    fi
-	    # It is a libtool convenience library, so add in its objects.
-	    func_append convenience " $ladir/$objdir/$old_library"
-	    func_append old_convenience " $ladir/$objdir/$old_library"
-	  elif test prog != "$linkmode" && test lib != "$linkmode"; then
-	    func_fatal_error "'$lib' is not a convenience library"
-	  fi
-	  tmp_libs=
-	  for deplib in $dependency_libs; do
-	    deplibs="$deplib $deplibs"
-	    if $opt_preserve_dup_deps; then
-	      case "$tmp_libs " in
-	      *" $deplib "*) func_append specialdeplibs " $deplib" ;;
-	      esac
-	    fi
-	    func_append tmp_libs " $deplib"
-	  done
-	  continue
-	fi # $pass = conv
-
-
-	# Get the name of the library we link against.
-	linklib=
-	if test -n "$old_library" &&
-	   { test yes = "$prefer_static_libs" ||
-	     test built,no = "$prefer_static_libs,$installed"; }; then
-	  linklib=$old_library
-	else
-	  for l in $old_library $library_names; do
-	    linklib=$l
-	  done
-	fi
-	if test -z "$linklib"; then
-	  func_fatal_error "cannot find name of link library for '$lib'"
-	fi
-
-	# This library was specified with -dlopen.
-	if test dlopen = "$pass"; then
-	  test -z "$libdir" \
-	    && func_fatal_error "cannot -dlopen a convenience library: '$lib'"
-	  if test -z "$dlname" ||
-	     test yes != "$dlopen_support" ||
-	     test no = "$build_libtool_libs"
-	  then
-	    # If there is no dlname, no dlopen support or we're linking
-	    # statically, we need to preload.  We also need to preload any
-	    # dependent libraries so libltdl's deplib preloader doesn't
-	    # bomb out in the load deplibs phase.
-	    func_append dlprefiles " $lib $dependency_libs"
-	  else
-	    func_append newdlfiles " $lib"
-	  fi
-	  continue
-	fi # $pass = dlopen
-
-	# We need an absolute path.
-	case $ladir in
-	[\\/]* | [A-Za-z]:[\\/]*) abs_ladir=$ladir ;;
-	*)
-	  abs_ladir=`cd "$ladir" && pwd`
-	  if test -z "$abs_ladir"; then
-	    func_warning "cannot determine absolute directory name of '$ladir'"
-	    func_warning "passing it literally to the linker, although it might fail"
-	    abs_ladir=$ladir
-	  fi
-	  ;;
-	esac
-	func_basename "$lib"
-	laname=$func_basename_result
-
-	# Find the relevant object directory and library name.
-	if test yes = "$installed"; then
-	  if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
-	    func_warning "library '$lib' was moved."
-	    dir=$ladir
-	    absdir=$abs_ladir
-	    libdir=$abs_ladir
-	  else
-	    dir=$lt_sysroot$libdir
-	    absdir=$lt_sysroot$libdir
-	  fi
-	  test yes = "$hardcode_automatic" && avoidtemprpath=yes
-	else
-	  if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
-	    dir=$ladir
-	    absdir=$abs_ladir
-	    # Remove this search path later
-	    func_append notinst_path " $abs_ladir"
-	  else
-	    dir=$ladir/$objdir
-	    absdir=$abs_ladir/$objdir
-	    # Remove this search path later
-	    func_append notinst_path " $abs_ladir"
-	  fi
-	fi # $installed = yes
-	func_stripname 'lib' '.la' "$laname"
-	name=$func_stripname_result
-
-	# This library was specified with -dlpreopen.
-	if test dlpreopen = "$pass"; then
-	  if test -z "$libdir" && test prog = "$linkmode"; then
-	    func_fatal_error "only libraries may -dlpreopen a convenience library: '$lib'"
-	  fi
-	  case $host in
-	    # special handling for platforms with PE-DLLs.
-	    *cygwin* | *mingw* | *cegcc* )
-	      # Linker will automatically link against shared library if both
-	      # static and shared are present.  Therefore, ensure we extract
-	      # symbols from the import library if a shared library is present
-	      # (otherwise, the dlopen module name will be incorrect).  We do
-	      # this by putting the import library name into $newdlprefiles.
-	      # We recover the dlopen module name by 'saving' the la file
-	      # name in a special purpose variable, and (later) extracting the
-	      # dlname from the la file.
-	      if test -n "$dlname"; then
-	        func_tr_sh "$dir/$linklib"
-	        eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname"
-	        func_append newdlprefiles " $dir/$linklib"
-	      else
-	        func_append newdlprefiles " $dir/$old_library"
-	        # Keep a list of preopened convenience libraries to check
-	        # that they are being used correctly in the link pass.
-	        test -z "$libdir" && \
-	          func_append dlpreconveniencelibs " $dir/$old_library"
-	      fi
-	    ;;
-	    * )
-	      # Prefer using a static library (so that no silly _DYNAMIC symbols
-	      # are required to link).
-	      if test -n "$old_library"; then
-	        func_append newdlprefiles " $dir/$old_library"
-	        # Keep a list of preopened convenience libraries to check
-	        # that they are being used correctly in the link pass.
-	        test -z "$libdir" && \
-	          func_append dlpreconveniencelibs " $dir/$old_library"
-	      # Otherwise, use the dlname, so that lt_dlopen finds it.
-	      elif test -n "$dlname"; then
-	        func_append newdlprefiles " $dir/$dlname"
-	      else
-	        func_append newdlprefiles " $dir/$linklib"
-	      fi
-	    ;;
-	  esac
-	fi # $pass = dlpreopen
-
-	if test -z "$libdir"; then
-	  # Link the convenience library
-	  if test lib = "$linkmode"; then
-	    deplibs="$dir/$old_library $deplibs"
-	  elif test prog,link = "$linkmode,$pass"; then
-	    compile_deplibs="$dir/$old_library $compile_deplibs"
-	    finalize_deplibs="$dir/$old_library $finalize_deplibs"
-	  else
-	    deplibs="$lib $deplibs" # used for prog,scan pass
-	  fi
-	  continue
-	fi
-
-
-	if test prog = "$linkmode" && test link != "$pass"; then
-	  func_append newlib_search_path " $ladir"
-	  deplibs="$lib $deplibs"
-
-	  linkalldeplibs=false
-	  if test no != "$link_all_deplibs" || test -z "$library_names" ||
-	     test no = "$build_libtool_libs"; then
-	    linkalldeplibs=:
-	  fi
-
-	  tmp_libs=
-	  for deplib in $dependency_libs; do
-	    case $deplib in
-	    -L*) func_stripname '-L' '' "$deplib"
-	         func_resolve_sysroot "$func_stripname_result"
-	         func_append newlib_search_path " $func_resolve_sysroot_result"
-		 ;;
-	    esac
-	    # Need to link against all dependency_libs?
-	    if $linkalldeplibs; then
-	      deplibs="$deplib $deplibs"
-	    else
-	      # Need to hardcode shared library paths
-	      # or/and link against static libraries
-	      newdependency_libs="$deplib $newdependency_libs"
-	    fi
-	    if $opt_preserve_dup_deps; then
-	      case "$tmp_libs " in
-	      *" $deplib "*) func_append specialdeplibs " $deplib" ;;
-	      esac
-	    fi
-	    func_append tmp_libs " $deplib"
-	  done # for deplib
-	  continue
-	fi # $linkmode = prog...
-
-	if test prog,link = "$linkmode,$pass"; then
-	  if test -n "$library_names" &&
-	     { { test no = "$prefer_static_libs" ||
-	         test built,yes = "$prefer_static_libs,$installed"; } ||
-	       test -z "$old_library"; }; then
-	    # We need to hardcode the library path
-	    if test -n "$shlibpath_var" && test -z "$avoidtemprpath"; then
-	      # Make sure the rpath contains only unique directories.
-	      case $temp_rpath: in
-	      *"$absdir:"*) ;;
-	      *) func_append temp_rpath "$absdir:" ;;
-	      esac
-	    fi
-
-	    # Hardcode the library path.
-	    # Skip directories that are in the system default run-time
-	    # search path.
-	    case " $sys_lib_dlsearch_path " in
-	    *" $absdir "*) ;;
-	    *)
-	      case "$compile_rpath " in
-	      *" $absdir "*) ;;
-	      *) func_append compile_rpath " $absdir" ;;
-	      esac
-	      ;;
-	    esac
-	    case " $sys_lib_dlsearch_path " in
-	    *" $libdir "*) ;;
-	    *)
-	      case "$finalize_rpath " in
-	      *" $libdir "*) ;;
-	      *) func_append finalize_rpath " $libdir" ;;
-	      esac
-	      ;;
-	    esac
-	  fi # $linkmode,$pass = prog,link...
-
-	  if $alldeplibs &&
-	     { test pass_all = "$deplibs_check_method" ||
-	       { test yes = "$build_libtool_libs" &&
-		 test -n "$library_names"; }; }; then
-	    # We only need to search for static libraries
-	    continue
-	  fi
-	fi
-
-	link_static=no # Whether the deplib will be linked statically
-	use_static_libs=$prefer_static_libs
-	if test built = "$use_static_libs" && test yes = "$installed"; then
-	  use_static_libs=no
-	fi
-	if test -n "$library_names" &&
-	   { test no = "$use_static_libs" || test -z "$old_library"; }; then
-	  case $host in
-	  *cygwin* | *mingw* | *cegcc* | *os2*)
-	      # No point in relinking DLLs because paths are not encoded
-	      func_append notinst_deplibs " $lib"
-	      need_relink=no
-	    ;;
-	  *)
-	    if test no = "$installed"; then
-	      func_append notinst_deplibs " $lib"
-	      need_relink=yes
-	    fi
-	    ;;
-	  esac
-	  # This is a shared library
-
-	  # Warn about portability, can't link against -module's on some
-	  # systems (darwin).  Don't bleat about dlopened modules though!
-	  dlopenmodule=
-	  for dlpremoduletest in $dlprefiles; do
-	    if test "X$dlpremoduletest" = "X$lib"; then
-	      dlopenmodule=$dlpremoduletest
-	      break
-	    fi
-	  done
-	  if test -z "$dlopenmodule" && test yes = "$shouldnotlink" && test link = "$pass"; then
-	    echo
-	    if test prog = "$linkmode"; then
-	      $ECHO "*** Warning: Linking the executable $output against the loadable module"
-	    else
-	      $ECHO "*** Warning: Linking the shared library $output against the loadable module"
-	    fi
-	    $ECHO "*** $linklib is not portable!"
-	  fi
-	  if test lib = "$linkmode" &&
-	     test yes = "$hardcode_into_libs"; then
-	    # Hardcode the library path.
-	    # Skip directories that are in the system default run-time
-	    # search path.
-	    case " $sys_lib_dlsearch_path " in
-	    *" $absdir "*) ;;
-	    *)
-	      case "$compile_rpath " in
-	      *" $absdir "*) ;;
-	      *) func_append compile_rpath " $absdir" ;;
-	      esac
-	      ;;
-	    esac
-	    case " $sys_lib_dlsearch_path " in
-	    *" $libdir "*) ;;
-	    *)
-	      case "$finalize_rpath " in
-	      *" $libdir "*) ;;
-	      *) func_append finalize_rpath " $libdir" ;;
-	      esac
-	      ;;
-	    esac
-	  fi
-
-	  if test -n "$old_archive_from_expsyms_cmds"; then
-	    # figure out the soname
-	    set dummy $library_names
-	    shift
-	    realname=$1
-	    shift
-	    libname=`eval "\\$ECHO \"$libname_spec\""`
-	    # use dlname if we got it. it's perfectly good, no?
-	    if test -n "$dlname"; then
-	      soname=$dlname
-	    elif test -n "$soname_spec"; then
-	      # bleh windows
-	      case $host in
-	      *cygwin* | mingw* | *cegcc* | *os2*)
-	        func_arith $current - $age
-		major=$func_arith_result
-		versuffix=-$major
-		;;
-	      esac
-	      eval soname=\"$soname_spec\"
-	    else
-	      soname=$realname
-	    fi
-
-	    # Make a new name for the extract_expsyms_cmds to use
-	    soroot=$soname
-	    func_basename "$soroot"
-	    soname=$func_basename_result
-	    func_stripname 'lib' '.dll' "$soname"
-	    newlib=libimp-$func_stripname_result.a
-
-	    # If the library has no export list, then create one now
-	    if test -f "$output_objdir/$soname-def"; then :
-	    else
-	      func_verbose "extracting exported symbol list from '$soname'"
-	      func_execute_cmds "$extract_expsyms_cmds" 'exit $?'
-	    fi
-
-	    # Create $newlib
-	    if test -f "$output_objdir/$newlib"; then :; else
-	      func_verbose "generating import library for '$soname'"
-	      func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?'
-	    fi
-	    # make sure the library variables are pointing to the new library
-	    dir=$output_objdir
-	    linklib=$newlib
-	  fi # test -n "$old_archive_from_expsyms_cmds"
-
-	  if test prog = "$linkmode" || test relink != "$opt_mode"; then
-	    add_shlibpath=
-	    add_dir=
-	    add=
-	    lib_linked=yes
-	    case $hardcode_action in
-	    immediate | unsupported)
-	      if test no = "$hardcode_direct"; then
-		add=$dir/$linklib
-		case $host in
-		  *-*-sco3.2v5.0.[024]*) add_dir=-L$dir ;;
-		  *-*-sysv4*uw2*) add_dir=-L$dir ;;
-		  *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
-		    *-*-unixware7*) add_dir=-L$dir ;;
-		  *-*-darwin* )
-		    # if the lib is a (non-dlopened) module then we cannot
-		    # link against it, someone is ignoring the earlier warnings
-		    if /usr/bin/file -L $add 2> /dev/null |
-			 $GREP ": [^:]* bundle" >/dev/null; then
-		      if test "X$dlopenmodule" != "X$lib"; then
-			$ECHO "*** Warning: lib $linklib is a module, not a shared library"
-			if test -z "$old_library"; then
-			  echo
-			  echo "*** And there doesn't seem to be a static archive available"
-			  echo "*** The link will probably fail, sorry"
-			else
-			  add=$dir/$old_library
-			fi
-		      elif test -n "$old_library"; then
-			add=$dir/$old_library
-		      fi
-		    fi
-		esac
-	      elif test no = "$hardcode_minus_L"; then
-		case $host in
-		*-*-sunos*) add_shlibpath=$dir ;;
-		esac
-		add_dir=-L$dir
-		add=-l$name
-	      elif test no = "$hardcode_shlibpath_var"; then
-		add_shlibpath=$dir
-		add=-l$name
-	      else
-		lib_linked=no
-	      fi
-	      ;;
-	    relink)
-	      if test yes = "$hardcode_direct" &&
-	         test no = "$hardcode_direct_absolute"; then
-		add=$dir/$linklib
-	      elif test yes = "$hardcode_minus_L"; then
-		add_dir=-L$absdir
-		# Try looking first in the location we're being installed to.
-		if test -n "$inst_prefix_dir"; then
-		  case $libdir in
-		    [\\/]*)
-		      func_append add_dir " -L$inst_prefix_dir$libdir"
-		      ;;
-		  esac
-		fi
-		add=-l$name
-	      elif test yes = "$hardcode_shlibpath_var"; then
-		add_shlibpath=$dir
-		add=-l$name
-	      else
-		lib_linked=no
-	      fi
-	      ;;
-	    *) lib_linked=no ;;
-	    esac
-
-	    if test yes != "$lib_linked"; then
-	      func_fatal_configuration "unsupported hardcode properties"
-	    fi
-
-	    if test -n "$add_shlibpath"; then
-	      case :$compile_shlibpath: in
-	      *":$add_shlibpath:"*) ;;
-	      *) func_append compile_shlibpath "$add_shlibpath:" ;;
-	      esac
-	    fi
-	    if test prog = "$linkmode"; then
-	      test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
-	      test -n "$add" && compile_deplibs="$add $compile_deplibs"
-	    else
-	      test -n "$add_dir" && deplibs="$add_dir $deplibs"
-	      test -n "$add" && deplibs="$add $deplibs"
-	      if test yes != "$hardcode_direct" &&
-		 test yes != "$hardcode_minus_L" &&
-		 test yes = "$hardcode_shlibpath_var"; then
-		case :$finalize_shlibpath: in
-		*":$libdir:"*) ;;
-		*) func_append finalize_shlibpath "$libdir:" ;;
-		esac
-	      fi
-	    fi
-	  fi
-
-	  if test prog = "$linkmode" || test relink = "$opt_mode"; then
-	    add_shlibpath=
-	    add_dir=
-	    add=
-	    # Finalize command for both is simple: just hardcode it.
-	    if test yes = "$hardcode_direct" &&
-	       test no = "$hardcode_direct_absolute"; then
-	      add=$libdir/$linklib
-	    elif test yes = "$hardcode_minus_L"; then
-	      add_dir=-L$libdir
-	      add=-l$name
-	    elif test yes = "$hardcode_shlibpath_var"; then
-	      case :$finalize_shlibpath: in
-	      *":$libdir:"*) ;;
-	      *) func_append finalize_shlibpath "$libdir:" ;;
-	      esac
-	      add=-l$name
-	    elif test yes = "$hardcode_automatic"; then
-	      if test -n "$inst_prefix_dir" &&
-		 test -f "$inst_prefix_dir$libdir/$linklib"; then
-		add=$inst_prefix_dir$libdir/$linklib
-	      else
-		add=$libdir/$linklib
-	      fi
-	    else
-	      # We cannot seem to hardcode it, guess we'll fake it.
-	      add_dir=-L$libdir
-	      # Try looking first in the location we're being installed to.
-	      if test -n "$inst_prefix_dir"; then
-		case $libdir in
-		  [\\/]*)
-		    func_append add_dir " -L$inst_prefix_dir$libdir"
-		    ;;
-		esac
-	      fi
-	      add=-l$name
-	    fi
-
-	    if test prog = "$linkmode"; then
-	      test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
-	      test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
-	    else
-	      test -n "$add_dir" && deplibs="$add_dir $deplibs"
-	      test -n "$add" && deplibs="$add $deplibs"
-	    fi
-	  fi
-	elif test prog = "$linkmode"; then
-	  # Here we assume that one of hardcode_direct or hardcode_minus_L
-	  # is not unsupported.  This is valid on all known static and
-	  # shared platforms.
-	  if test unsupported != "$hardcode_direct"; then
-	    test -n "$old_library" && linklib=$old_library
-	    compile_deplibs="$dir/$linklib $compile_deplibs"
-	    finalize_deplibs="$dir/$linklib $finalize_deplibs"
-	  else
-	    compile_deplibs="-l$name -L$dir $compile_deplibs"
-	    finalize_deplibs="-l$name -L$dir $finalize_deplibs"
-	  fi
-	elif test yes = "$build_libtool_libs"; then
-	  # Not a shared library
-	  if test pass_all != "$deplibs_check_method"; then
-	    # We're trying link a shared library against a static one
-	    # but the system doesn't support it.
-
-	    # Just print a warning and add the library to dependency_libs so
-	    # that the program can be linked against the static library.
-	    echo
-	    $ECHO "*** Warning: This system cannot link to static lib archive $lib."
-	    echo "*** I have the capability to make that library automatically link in when"
-	    echo "*** you link to this library.  But I can only do this if you have a"
-	    echo "*** shared version of the library, which you do not appear to have."
-	    if test yes = "$module"; then
-	      echo "*** But as you try to build a module library, libtool will still create "
-	      echo "*** a static module, that should work as long as the dlopening application"
-	      echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
-	      if test -z "$global_symbol_pipe"; then
-		echo
-		echo "*** However, this would only work if libtool was able to extract symbol"
-		echo "*** lists from a program, using 'nm' or equivalent, but libtool could"
-		echo "*** not find such a program.  So, this module is probably useless."
-		echo "*** 'nm' from GNU binutils and a full rebuild may help."
-	      fi
-	      if test no = "$build_old_libs"; then
-		build_libtool_libs=module
-		build_old_libs=yes
-	      else
-		build_libtool_libs=no
-	      fi
-	    fi
-	  else
-	    deplibs="$dir/$old_library $deplibs"
-	    link_static=yes
-	  fi
-	fi # link shared/static library?
-
-	if test lib = "$linkmode"; then
-	  if test -n "$dependency_libs" &&
-	     { test yes != "$hardcode_into_libs" ||
-	       test yes = "$build_old_libs" ||
-	       test yes = "$link_static"; }; then
-	    # Extract -R from dependency_libs
-	    temp_deplibs=
-	    for libdir in $dependency_libs; do
-	      case $libdir in
-	      -R*) func_stripname '-R' '' "$libdir"
-	           temp_xrpath=$func_stripname_result
-		   case " $xrpath " in
-		   *" $temp_xrpath "*) ;;
-		   *) func_append xrpath " $temp_xrpath";;
-		   esac;;
-	      *) func_append temp_deplibs " $libdir";;
-	      esac
-	    done
-	    dependency_libs=$temp_deplibs
-	  fi
-
-	  func_append newlib_search_path " $absdir"
-	  # Link against this library
-	  test no = "$link_static" && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
-	  # ... and its dependency_libs
-	  tmp_libs=
-	  for deplib in $dependency_libs; do
-	    newdependency_libs="$deplib $newdependency_libs"
-	    case $deplib in
-              -L*) func_stripname '-L' '' "$deplib"
-                   func_resolve_sysroot "$func_stripname_result";;
-              *) func_resolve_sysroot "$deplib" ;;
-            esac
-	    if $opt_preserve_dup_deps; then
-	      case "$tmp_libs " in
-	      *" $func_resolve_sysroot_result "*)
-                func_append specialdeplibs " $func_resolve_sysroot_result" ;;
-	      esac
-	    fi
-	    func_append tmp_libs " $func_resolve_sysroot_result"
-	  done
-
-	  if test no != "$link_all_deplibs"; then
-	    # Add the search paths of all dependency libraries
-	    for deplib in $dependency_libs; do
-	      path=
-	      case $deplib in
-	      -L*) path=$deplib ;;
-	      *.la)
-	        func_resolve_sysroot "$deplib"
-	        deplib=$func_resolve_sysroot_result
-	        func_dirname "$deplib" "" "."
-		dir=$func_dirname_result
-		# We need an absolute path.
-		case $dir in
-		[\\/]* | [A-Za-z]:[\\/]*) absdir=$dir ;;
-		*)
-		  absdir=`cd "$dir" && pwd`
-		  if test -z "$absdir"; then
-		    func_warning "cannot determine absolute directory name of '$dir'"
-		    absdir=$dir
-		  fi
-		  ;;
-		esac
-		if $GREP "^installed=no" $deplib > /dev/null; then
-		case $host in
-		*-*-darwin*)
-		  depdepl=
-		  eval deplibrary_names=`$SED -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
-		  if test -n "$deplibrary_names"; then
-		    for tmp in $deplibrary_names; do
-		      depdepl=$tmp
-		    done
-		    if test -f "$absdir/$objdir/$depdepl"; then
-		      depdepl=$absdir/$objdir/$depdepl
-		      darwin_install_name=`$OTOOL -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
-                      if test -z "$darwin_install_name"; then
-                          darwin_install_name=`$OTOOL64 -L $depdepl  | awk '{if (NR == 2) {print $1;exit}}'`
-                      fi
-		      func_append compiler_flags " $wl-dylib_file $wl$darwin_install_name:$depdepl"
-		      func_append linker_flags " -dylib_file $darwin_install_name:$depdepl"
-		      path=
-		    fi
-		  fi
-		  ;;
-		*)
-		  path=-L$absdir/$objdir
-		  ;;
-		esac
-		else
-		  eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
-		  test -z "$libdir" && \
-		    func_fatal_error "'$deplib' is not a valid libtool archive"
-		  test "$absdir" != "$libdir" && \
-		    func_warning "'$deplib' seems to be moved"
-
-		  path=-L$absdir
-		fi
-		;;
-	      esac
-	      case " $deplibs " in
-	      *" $path "*) ;;
-	      *) deplibs="$path $deplibs" ;;
-	      esac
-	    done
-	  fi # link_all_deplibs != no
-	fi # linkmode = lib
-      done # for deplib in $libs
-      if test link = "$pass"; then
-	if test prog = "$linkmode"; then
-	  compile_deplibs="$new_inherited_linker_flags $compile_deplibs"
-	  finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs"
-	else
-	  compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
-	fi
-      fi
-      dependency_libs=$newdependency_libs
-      if test dlpreopen = "$pass"; then
-	# Link the dlpreopened libraries before other libraries
-	for deplib in $save_deplibs; do
-	  deplibs="$deplib $deplibs"
-	done
-      fi
-      if test dlopen != "$pass"; then
-	test conv = "$pass" || {
-	  # Make sure lib_search_path contains only unique directories.
-	  lib_search_path=
-	  for dir in $newlib_search_path; do
-	    case "$lib_search_path " in
-	    *" $dir "*) ;;
-	    *) func_append lib_search_path " $dir" ;;
-	    esac
-	  done
-	  newlib_search_path=
-	}
-
-	if test prog,link = "$linkmode,$pass"; then
-	  vars="compile_deplibs finalize_deplibs"
-	else
-	  vars=deplibs
-	fi
-	for var in $vars dependency_libs; do
-	  # Add libraries to $var in reverse order
-	  eval tmp_libs=\"\$$var\"
-	  new_libs=
-	  for deplib in $tmp_libs; do
-	    # FIXME: Pedantically, this is the right thing to do, so
-	    #        that some nasty dependency loop isn't accidentally
-	    #        broken:
-	    #new_libs="$deplib $new_libs"
-	    # Pragmatically, this seems to cause very few problems in
-	    # practice:
-	    case $deplib in
-	    -L*) new_libs="$deplib $new_libs" ;;
-	    -R*) ;;
-	    *)
-	      # And here is the reason: when a library appears more
-	      # than once as an explicit dependence of a library, or
-	      # is implicitly linked in more than once by the
-	      # compiler, it is considered special, and multiple
-	      # occurrences thereof are not removed.  Compare this
-	      # with having the same library being listed as a
-	      # dependency of multiple other libraries: in this case,
-	      # we know (pedantically, we assume) the library does not
-	      # need to be listed more than once, so we keep only the
-	      # last copy.  This is not always right, but it is rare
-	      # enough that we require users that really mean to play
-	      # such unportable linking tricks to link the library
-	      # using -Wl,-lname, so that libtool does not consider it
-	      # for duplicate removal.
-	      case " $specialdeplibs " in
-	      *" $deplib "*) new_libs="$deplib $new_libs" ;;
-	      *)
-		case " $new_libs " in
-		*" $deplib "*) ;;
-		*) new_libs="$deplib $new_libs" ;;
-		esac
-		;;
-	      esac
-	      ;;
-	    esac
-	  done
-	  tmp_libs=
-	  for deplib in $new_libs; do
-	    case $deplib in
-	    -L*)
-	      case " $tmp_libs " in
-	      *" $deplib "*) ;;
-	      *) func_append tmp_libs " $deplib" ;;
-	      esac
-	      ;;
-	    *) func_append tmp_libs " $deplib" ;;
-	    esac
-	  done
-	  eval $var=\"$tmp_libs\"
-	done # for var
-      fi
-
-      # Add Sun CC postdeps if required:
-      test CXX = "$tagname" && {
-        case $host_os in
-        linux*)
-          case `$CC -V 2>&1 | sed 5q` in
-          *Sun\ C*) # Sun C++ 5.9
-            func_suncc_cstd_abi
-
-            if test no != "$suncc_use_cstd_abi"; then
-              func_append postdeps ' -library=Cstd -library=Crun'
-            fi
-            ;;
-          esac
-          ;;
-
-        solaris*)
-          func_cc_basename "$CC"
-          case $func_cc_basename_result in
-          CC* | sunCC*)
-            func_suncc_cstd_abi
-
-            if test no != "$suncc_use_cstd_abi"; then
-              func_append postdeps ' -library=Cstd -library=Crun'
-            fi
-            ;;
-          esac
-          ;;
-        esac
-      }
-
-      # Last step: remove runtime libs from dependency_libs
-      # (they stay in deplibs)
-      tmp_libs=
-      for i in $dependency_libs; do
-	case " $predeps $postdeps $compiler_lib_search_path " in
-	*" $i "*)
-	  i=
-	  ;;
-	esac
-	if test -n "$i"; then
-	  func_append tmp_libs " $i"
-	fi
-      done
-      dependency_libs=$tmp_libs
-    done # for pass
-    if test prog = "$linkmode"; then
-      dlfiles=$newdlfiles
-    fi
-    if test prog = "$linkmode" || test lib = "$linkmode"; then
-      dlprefiles=$newdlprefiles
-    fi
-
-    case $linkmode in
-    oldlib)
-      if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then
-	func_warning "'-dlopen' is ignored for archives"
-      fi
-
-      case " $deplibs" in
-      *\ -l* | *\ -L*)
-	func_warning "'-l' and '-L' are ignored for archives" ;;
-      esac
-
-      test -n "$rpath" && \
-	func_warning "'-rpath' is ignored for archives"
-
-      test -n "$xrpath" && \
-	func_warning "'-R' is ignored for archives"
-
-      test -n "$vinfo" && \
-	func_warning "'-version-info/-version-number' is ignored for archives"
-
-      test -n "$release" && \
-	func_warning "'-release' is ignored for archives"
-
-      test -n "$export_symbols$export_symbols_regex" && \
-	func_warning "'-export-symbols' is ignored for archives"
-
-      # Now set the variables for building old libraries.
-      build_libtool_libs=no
-      oldlibs=$output
-      func_append objs "$old_deplibs"
-      ;;
-
-    lib)
-      # Make sure we only generate libraries of the form 'libNAME.la'.
-      case $outputname in
-      lib*)
-	func_stripname 'lib' '.la' "$outputname"
-	name=$func_stripname_result
-	eval shared_ext=\"$shrext_cmds\"
-	eval libname=\"$libname_spec\"
-	;;
-      *)
-	test no = "$module" \
-	  && func_fatal_help "libtool library '$output' must begin with 'lib'"
-
-	if test no != "$need_lib_prefix"; then
-	  # Add the "lib" prefix for modules if required
-	  func_stripname '' '.la' "$outputname"
-	  name=$func_stripname_result
-	  eval shared_ext=\"$shrext_cmds\"
-	  eval libname=\"$libname_spec\"
-	else
-	  func_stripname '' '.la' "$outputname"
-	  libname=$func_stripname_result
-	fi
-	;;
-      esac
-
-      if test -n "$objs"; then
-	if test pass_all != "$deplibs_check_method"; then
-	  func_fatal_error "cannot build libtool library '$output' from non-libtool objects on this host:$objs"
-	else
-	  echo
-	  $ECHO "*** Warning: Linking the shared library $output against the non-libtool"
-	  $ECHO "*** objects $objs is not portable!"
-	  func_append libobjs " $objs"
-	fi
-      fi
-
-      test no = "$dlself" \
-	|| func_warning "'-dlopen self' is ignored for libtool libraries"
-
-      set dummy $rpath
-      shift
-      test 1 -lt "$#" \
-	&& func_warning "ignoring multiple '-rpath's for a libtool library"
-
-      install_libdir=$1
-
-      oldlibs=
-      if test -z "$rpath"; then
-	if test yes = "$build_libtool_libs"; then
-	  # Building a libtool convenience library.
-	  # Some compilers have problems with a '.al' extension so
-	  # convenience libraries should have the same extension an
-	  # archive normally would.
-	  oldlibs="$output_objdir/$libname.$libext $oldlibs"
-	  build_libtool_libs=convenience
-	  build_old_libs=yes
-	fi
-
-	test -n "$vinfo" && \
-	  func_warning "'-version-info/-version-number' is ignored for convenience libraries"
-
-	test -n "$release" && \
-	  func_warning "'-release' is ignored for convenience libraries"
-      else
-
-	# Parse the version information argument.
-	save_ifs=$IFS; IFS=:
-	set dummy $vinfo 0 0 0
-	shift
-	IFS=$save_ifs
-
-	test -n "$7" && \
-	  func_fatal_help "too many parameters to '-version-info'"
-
-	# convert absolute version numbers to libtool ages
-	# this retains compatibility with .la files and attempts
-	# to make the code below a bit more comprehensible
-
-	case $vinfo_number in
-	yes)
-	  number_major=$1
-	  number_minor=$2
-	  number_revision=$3
-	  #
-	  # There are really only two kinds -- those that
-	  # use the current revision as the major version
-	  # and those that subtract age and use age as
-	  # a minor version.  But, then there is irix
-	  # that has an extra 1 added just for fun
-	  #
-	  case $version_type in
-	  # correct linux to gnu/linux during the next big refactor
-	  darwin|freebsd-elf|linux|osf|windows|none)
-	    func_arith $number_major + $number_minor
-	    current=$func_arith_result
-	    age=$number_minor
-	    revision=$number_revision
-	    ;;
-	  freebsd-aout|qnx|sunos)
-	    current=$number_major
-	    revision=$number_minor
-	    age=0
-	    ;;
-	  irix|nonstopux)
-	    func_arith $number_major + $number_minor
-	    current=$func_arith_result
-	    age=$number_minor
-	    revision=$number_minor
-	    lt_irix_increment=no
-	    ;;
-	  esac
-	  ;;
-	no)
-	  current=$1
-	  revision=$2
-	  age=$3
-	  ;;
-	esac
-
-	# Check that each of the things are valid numbers.
-	case $current in
-	0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
-	*)
-	  func_error "CURRENT '$current' must be a nonnegative integer"
-	  func_fatal_error "'$vinfo' is not valid version information"
-	  ;;
-	esac
-
-	case $revision in
-	0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
-	*)
-	  func_error "REVISION '$revision' must be a nonnegative integer"
-	  func_fatal_error "'$vinfo' is not valid version information"
-	  ;;
-	esac
-
-	case $age in
-	0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
-	*)
-	  func_error "AGE '$age' must be a nonnegative integer"
-	  func_fatal_error "'$vinfo' is not valid version information"
-	  ;;
-	esac
-
-	if test "$age" -gt "$current"; then
-	  func_error "AGE '$age' is greater than the current interface number '$current'"
-	  func_fatal_error "'$vinfo' is not valid version information"
-	fi
-
-	# Calculate the version variables.
-	major=
-	versuffix=
-	verstring=
-	case $version_type in
-	none) ;;
-
-	darwin)
-	  # Like Linux, but with the current version available in
-	  # verstring for coding it into the library header
-	  func_arith $current - $age
-	  major=.$func_arith_result
-	  versuffix=$major.$age.$revision
-	  # Darwin ld doesn't like 0 for these options...
-	  func_arith $current + 1
-	  minor_current=$func_arith_result
-	  xlcverstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision"
-	  verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
-          # On Darwin other compilers
-          case $CC in
-              nagfor*)
-                  verstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision"
-                  ;;
-              *)
-                  verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
-                  ;;
-          esac
-	  ;;
-
-	freebsd-aout)
-	  major=.$current
-	  versuffix=.$current.$revision
-	  ;;
-
-	freebsd-elf)
-	  func_arith $current - $age
-	  major=.$func_arith_result
-	  versuffix=$major.$age.$revision
-	  ;;
-
-	irix | nonstopux)
-	  if test no = "$lt_irix_increment"; then
-	    func_arith $current - $age
-	  else
-	    func_arith $current - $age + 1
-	  fi
-	  major=$func_arith_result
-
-	  case $version_type in
-	    nonstopux) verstring_prefix=nonstopux ;;
-	    *)         verstring_prefix=sgi ;;
-	  esac
-	  verstring=$verstring_prefix$major.$revision
-
-	  # Add in all the interfaces that we are compatible with.
-	  loop=$revision
-	  while test 0 -ne "$loop"; do
-	    func_arith $revision - $loop
-	    iface=$func_arith_result
-	    func_arith $loop - 1
-	    loop=$func_arith_result
-	    verstring=$verstring_prefix$major.$iface:$verstring
-	  done
-
-	  # Before this point, $major must not contain '.'.
-	  major=.$major
-	  versuffix=$major.$revision
-	  ;;
-
-	linux) # correct to gnu/linux during the next big refactor
-	  func_arith $current - $age
-	  major=.$func_arith_result
-	  versuffix=$major.$age.$revision
-	  ;;
-
-	osf)
-	  func_arith $current - $age
-	  major=.$func_arith_result
-	  versuffix=.$current.$age.$revision
-	  verstring=$current.$age.$revision
-
-	  # Add in all the interfaces that we are compatible with.
-	  loop=$age
-	  while test 0 -ne "$loop"; do
-	    func_arith $current - $loop
-	    iface=$func_arith_result
-	    func_arith $loop - 1
-	    loop=$func_arith_result
-	    verstring=$verstring:$iface.0
-	  done
-
-	  # Make executables depend on our current version.
-	  func_append verstring ":$current.0"
-	  ;;
-
-	qnx)
-	  major=.$current
-	  versuffix=.$current
-	  ;;
-
-	sco)
-	  major=.$current
-	  versuffix=.$current
-	  ;;
-
-	sunos)
-	  major=.$current
-	  versuffix=.$current.$revision
-	  ;;
-
-	windows)
-	  # Use '-' rather than '.', since we only want one
-	  # extension on DOS 8.3 file systems.
-	  func_arith $current - $age
-	  major=$func_arith_result
-	  versuffix=-$major
-	  ;;
-
-	*)
-	  func_fatal_configuration "unknown library version type '$version_type'"
-	  ;;
-	esac
-
-	# Clear the version info if we defaulted, and they specified a release.
-	if test -z "$vinfo" && test -n "$release"; then
-	  major=
-	  case $version_type in
-	  darwin)
-	    # we can't check for "0.0" in archive_cmds due to quoting
-	    # problems, so we reset it completely
-	    verstring=
-	    ;;
-	  *)
-	    verstring=0.0
-	    ;;
-	  esac
-	  if test no = "$need_version"; then
-	    versuffix=
-	  else
-	    versuffix=.0.0
-	  fi
-	fi
-
-	# Remove version info from name if versioning should be avoided
-	if test yes,no = "$avoid_version,$need_version"; then
-	  major=
-	  versuffix=
-	  verstring=
-	fi
-
-	# Check to see if the archive will have undefined symbols.
-	if test yes = "$allow_undefined"; then
-	  if test unsupported = "$allow_undefined_flag"; then
-	    if test yes = "$build_old_libs"; then
-	      func_warning "undefined symbols not allowed in $host shared libraries; building static only"
-	      build_libtool_libs=no
-	    else
-	      func_fatal_error "can't build $host shared library unless -no-undefined is specified"
-	    fi
-	  fi
-	else
-	  # Don't allow undefined symbols.
-	  allow_undefined_flag=$no_undefined_flag
-	fi
-
-      fi
-
-      func_generate_dlsyms "$libname" "$libname" :
-      func_append libobjs " $symfileobj"
-      test " " = "$libobjs" && libobjs=
-
-      if test relink != "$opt_mode"; then
-	# Remove our outputs, but don't remove object files since they
-	# may have been created when compiling PIC objects.
-	removelist=
-	tempremovelist=`$ECHO "$output_objdir/*"`
-	for p in $tempremovelist; do
-	  case $p in
-	    *.$objext | *.gcno)
-	       ;;
-	    $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/$libname$release.*)
-	       if test -n "$precious_files_regex"; then
-		 if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
-		 then
-		   continue
-		 fi
-	       fi
-	       func_append removelist " $p"
-	       ;;
-	    *) ;;
-	  esac
-	done
-	test -n "$removelist" && \
-	  func_show_eval "${RM}r \$removelist"
-      fi
-
-      # Now set the variables for building old libraries.
-      if test yes = "$build_old_libs" && test convenience != "$build_libtool_libs"; then
-	func_append oldlibs " $output_objdir/$libname.$libext"
-
-	# Transform .lo files to .o files.
-	oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; $lo2o" | $NL2SP`
-      fi
-
-      # Eliminate all temporary directories.
-      #for path in $notinst_path; do
-      #	lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"`
-      #	deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"`
-      #	dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"`
-      #done
-
-      if test -n "$xrpath"; then
-	# If the user specified any rpath flags, then add them.
-	temp_xrpath=
-	for libdir in $xrpath; do
-	  func_replace_sysroot "$libdir"
-	  func_append temp_xrpath " -R$func_replace_sysroot_result"
-	  case "$finalize_rpath " in
-	  *" $libdir "*) ;;
-	  *) func_append finalize_rpath " $libdir" ;;
-	  esac
-	done
-	if test yes != "$hardcode_into_libs" || test yes = "$build_old_libs"; then
-	  dependency_libs="$temp_xrpath $dependency_libs"
-	fi
-      fi
-
-      # Make sure dlfiles contains only unique files that won't be dlpreopened
-      old_dlfiles=$dlfiles
-      dlfiles=
-      for lib in $old_dlfiles; do
-	case " $dlprefiles $dlfiles " in
-	*" $lib "*) ;;
-	*) func_append dlfiles " $lib" ;;
-	esac
-      done
-
-      # Make sure dlprefiles contains only unique files
-      old_dlprefiles=$dlprefiles
-      dlprefiles=
-      for lib in $old_dlprefiles; do
-	case "$dlprefiles " in
-	*" $lib "*) ;;
-	*) func_append dlprefiles " $lib" ;;
-	esac
-      done
-
-      if test yes = "$build_libtool_libs"; then
-	if test -n "$rpath"; then
-	  case $host in
-	  *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*)
-	    # these systems don't actually have a c library (as such)!
-	    ;;
-	  *-*-rhapsody* | *-*-darwin1.[012])
-	    # Rhapsody C library is in the System framework
-	    func_append deplibs " System.ltframework"
-	    ;;
-	  *-*-netbsd*)
-	    # Don't link with libc until the a.out ld.so is fixed.
-	    ;;
-	  *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
-	    # Do not include libc due to us having libc/libc_r.
-	    ;;
-	  *-*-sco3.2v5* | *-*-sco5v6*)
-	    # Causes problems with __ctype
-	    ;;
-	  *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
-	    # Compiler inserts libc in the correct place for threads to work
-	    ;;
-	  *)
-	    # Add libc to deplibs on all other systems if necessary.
-	    if test yes = "$build_libtool_need_lc"; then
-	      func_append deplibs " -lc"
-	    fi
-	    ;;
-	  esac
-	fi
-
-	# Transform deplibs into only deplibs that can be linked in shared.
-	name_save=$name
-	libname_save=$libname
-	release_save=$release
-	versuffix_save=$versuffix
-	major_save=$major
-	# I'm not sure if I'm treating the release correctly.  I think
-	# release should show up in the -l (ie -lgmp5) so we don't want to
-	# add it in twice.  Is that correct?
-	release=
-	versuffix=
-	major=
-	newdeplibs=
-	droppeddeps=no
-	case $deplibs_check_method in
-	pass_all)
-	  # Don't check for shared/static.  Everything works.
-	  # This might be a little naive.  We might want to check
-	  # whether the library exists or not.  But this is on
-	  # osf3 & osf4 and I'm not really sure... Just
-	  # implementing what was already the behavior.
-	  newdeplibs=$deplibs
-	  ;;
-	test_compile)
-	  # This code stresses the "libraries are programs" paradigm to its
-	  # limits. Maybe even breaks it.  We compile a program, linking it
-	  # against the deplibs as a proxy for the library.  Then we can check
-	  # whether they linked in statically or dynamically with ldd.
-	  $opt_dry_run || $RM conftest.c
-	  cat > conftest.c <<EOF
-	  int main() { return 0; }
-EOF
-	  $opt_dry_run || $RM conftest
-	  if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then
-	    ldd_output=`ldd conftest`
-	    for i in $deplibs; do
-	      case $i in
-	      -l*)
-		func_stripname -l '' "$i"
-		name=$func_stripname_result
-		if test yes = "$allow_libtool_libs_with_static_runtimes"; then
-		  case " $predeps $postdeps " in
-		  *" $i "*)
-		    func_append newdeplibs " $i"
-		    i=
-		    ;;
-		  esac
-		fi
-		if test -n "$i"; then
-		  libname=`eval "\\$ECHO \"$libname_spec\""`
-		  deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
-		  set dummy $deplib_matches; shift
-		  deplib_match=$1
-		  if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0; then
-		    func_append newdeplibs " $i"
-		  else
-		    droppeddeps=yes
-		    echo
-		    $ECHO "*** Warning: dynamic linker does not accept needed library $i."
-		    echo "*** I have the capability to make that library automatically link in when"
-		    echo "*** you link to this library.  But I can only do this if you have a"
-		    echo "*** shared version of the library, which I believe you do not have"
-		    echo "*** because a test_compile did reveal that the linker did not use it for"
-		    echo "*** its dynamic dependency list that programs get resolved with at runtime."
-		  fi
-		fi
-		;;
-	      *)
-		func_append newdeplibs " $i"
-		;;
-	      esac
-	    done
-	  else
-	    # Error occurred in the first compile.  Let's try to salvage
-	    # the situation: Compile a separate program for each library.
-	    for i in $deplibs; do
-	      case $i in
-	      -l*)
-		func_stripname -l '' "$i"
-		name=$func_stripname_result
-		$opt_dry_run || $RM conftest
-		if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
-		  ldd_output=`ldd conftest`
-		  if test yes = "$allow_libtool_libs_with_static_runtimes"; then
-		    case " $predeps $postdeps " in
-		    *" $i "*)
-		      func_append newdeplibs " $i"
-		      i=
-		      ;;
-		    esac
-		  fi
-		  if test -n "$i"; then
-		    libname=`eval "\\$ECHO \"$libname_spec\""`
-		    deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
-		    set dummy $deplib_matches; shift
-		    deplib_match=$1
-		    if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0; then
-		      func_append newdeplibs " $i"
-		    else
-		      droppeddeps=yes
-		      echo
-		      $ECHO "*** Warning: dynamic linker does not accept needed library $i."
-		      echo "*** I have the capability to make that library automatically link in when"
-		      echo "*** you link to this library.  But I can only do this if you have a"
-		      echo "*** shared version of the library, which you do not appear to have"
-		      echo "*** because a test_compile did reveal that the linker did not use this one"
-		      echo "*** as a dynamic dependency that programs can get resolved with at runtime."
-		    fi
-		  fi
-		else
-		  droppeddeps=yes
-		  echo
-		  $ECHO "*** Warning!  Library $i is needed by this library but I was not able to"
-		  echo "*** make it link in!  You will probably need to install it or some"
-		  echo "*** library that it depends on before this library will be fully"
-		  echo "*** functional.  Installing it before continuing would be even better."
-		fi
-		;;
-	      *)
-		func_append newdeplibs " $i"
-		;;
-	      esac
-	    done
-	  fi
-	  ;;
-	file_magic*)
-	  set dummy $deplibs_check_method; shift
-	  file_magic_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
-	  for a_deplib in $deplibs; do
-	    case $a_deplib in
-	    -l*)
-	      func_stripname -l '' "$a_deplib"
-	      name=$func_stripname_result
-	      if test yes = "$allow_libtool_libs_with_static_runtimes"; then
-		case " $predeps $postdeps " in
-		*" $a_deplib "*)
-		  func_append newdeplibs " $a_deplib"
-		  a_deplib=
-		  ;;
-		esac
-	      fi
-	      if test -n "$a_deplib"; then
-		libname=`eval "\\$ECHO \"$libname_spec\""`
-		if test -n "$file_magic_glob"; then
-		  libnameglob=`func_echo_all "$libname" | $SED -e $file_magic_glob`
-		else
-		  libnameglob=$libname
-		fi
-		test yes = "$want_nocaseglob" && nocaseglob=`shopt -p nocaseglob`
-		for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
-		  if test yes = "$want_nocaseglob"; then
-		    shopt -s nocaseglob
-		    potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
-		    $nocaseglob
-		  else
-		    potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
-		  fi
-		  for potent_lib in $potential_libs; do
-		      # Follow soft links.
-		      if ls -lLd "$potent_lib" 2>/dev/null |
-			 $GREP " -> " >/dev/null; then
-			continue
-		      fi
-		      # The statement above tries to avoid entering an
-		      # endless loop below, in case of cyclic links.
-		      # We might still enter an endless loop, since a link
-		      # loop can be closed while we follow links,
-		      # but so what?
-		      potlib=$potent_lib
-		      while test -h "$potlib" 2>/dev/null; do
-			potliblink=`ls -ld $potlib | $SED 's/.* -> //'`
-			case $potliblink in
-			[\\/]* | [A-Za-z]:[\\/]*) potlib=$potliblink;;
-			*) potlib=`$ECHO "$potlib" | $SED 's|[^/]*$||'`"$potliblink";;
-			esac
-		      done
-		      if eval $file_magic_cmd \"\$potlib\" 2>/dev/null |
-			 $SED -e 10q |
-			 $EGREP "$file_magic_regex" > /dev/null; then
-			func_append newdeplibs " $a_deplib"
-			a_deplib=
-			break 2
-		      fi
-		  done
-		done
-	      fi
-	      if test -n "$a_deplib"; then
-		droppeddeps=yes
-		echo
-		$ECHO "*** Warning: linker path does not have real file for library $a_deplib."
-		echo "*** I have the capability to make that library automatically link in when"
-		echo "*** you link to this library.  But I can only do this if you have a"
-		echo "*** shared version of the library, which you do not appear to have"
-		echo "*** because I did check the linker path looking for a file starting"
-		if test -z "$potlib"; then
-		  $ECHO "*** with $libname but no candidates were found. (...for file magic test)"
-		else
-		  $ECHO "*** with $libname and none of the candidates passed a file format test"
-		  $ECHO "*** using a file magic. Last file checked: $potlib"
-		fi
-	      fi
-	      ;;
-	    *)
-	      # Add a -L argument.
-	      func_append newdeplibs " $a_deplib"
-	      ;;
-	    esac
-	  done # Gone through all deplibs.
-	  ;;
-	match_pattern*)
-	  set dummy $deplibs_check_method; shift
-	  match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
-	  for a_deplib in $deplibs; do
-	    case $a_deplib in
-	    -l*)
-	      func_stripname -l '' "$a_deplib"
-	      name=$func_stripname_result
-	      if test yes = "$allow_libtool_libs_with_static_runtimes"; then
-		case " $predeps $postdeps " in
-		*" $a_deplib "*)
-		  func_append newdeplibs " $a_deplib"
-		  a_deplib=
-		  ;;
-		esac
-	      fi
-	      if test -n "$a_deplib"; then
-		libname=`eval "\\$ECHO \"$libname_spec\""`
-		for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
-		  potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
-		  for potent_lib in $potential_libs; do
-		    potlib=$potent_lib # see symlink-check above in file_magic test
-		    if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \
-		       $EGREP "$match_pattern_regex" > /dev/null; then
-		      func_append newdeplibs " $a_deplib"
-		      a_deplib=
-		      break 2
-		    fi
-		  done
-		done
-	      fi
-	      if test -n "$a_deplib"; then
-		droppeddeps=yes
-		echo
-		$ECHO "*** Warning: linker path does not have real file for library $a_deplib."
-		echo "*** I have the capability to make that library automatically link in when"
-		echo "*** you link to this library.  But I can only do this if you have a"
-		echo "*** shared version of the library, which you do not appear to have"
-		echo "*** because I did check the linker path looking for a file starting"
-		if test -z "$potlib"; then
-		  $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)"
-		else
-		  $ECHO "*** with $libname and none of the candidates passed a file format test"
-		  $ECHO "*** using a regex pattern. Last file checked: $potlib"
-		fi
-	      fi
-	      ;;
-	    *)
-	      # Add a -L argument.
-	      func_append newdeplibs " $a_deplib"
-	      ;;
-	    esac
-	  done # Gone through all deplibs.
-	  ;;
-	none | unknown | *)
-	  newdeplibs=
-	  tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'`
-	  if test yes = "$allow_libtool_libs_with_static_runtimes"; then
-	    for i in $predeps $postdeps; do
-	      # can't use Xsed below, because $i might contain '/'
-	      tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s|$i||"`
-	    done
-	  fi
-	  case $tmp_deplibs in
-	  *[!\	\ ]*)
-	    echo
-	    if test none = "$deplibs_check_method"; then
-	      echo "*** Warning: inter-library dependencies are not supported in this platform."
-	    else
-	      echo "*** Warning: inter-library dependencies are not known to be supported."
-	    fi
-	    echo "*** All declared inter-library dependencies are being dropped."
-	    droppeddeps=yes
-	    ;;
-	  esac
-	  ;;
-	esac
-	versuffix=$versuffix_save
-	major=$major_save
-	release=$release_save
-	libname=$libname_save
-	name=$name_save
-
-	case $host in
-	*-*-rhapsody* | *-*-darwin1.[012])
-	  # On Rhapsody replace the C library with the System framework
-	  newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'`
-	  ;;
-	esac
-
-	if test yes = "$droppeddeps"; then
-	  if test yes = "$module"; then
-	    echo
-	    echo "*** Warning: libtool could not satisfy all declared inter-library"
-	    $ECHO "*** dependencies of module $libname.  Therefore, libtool will create"
-	    echo "*** a static module, that should work as long as the dlopening"
-	    echo "*** application is linked with the -dlopen flag."
-	    if test -z "$global_symbol_pipe"; then
-	      echo
-	      echo "*** However, this would only work if libtool was able to extract symbol"
-	      echo "*** lists from a program, using 'nm' or equivalent, but libtool could"
-	      echo "*** not find such a program.  So, this module is probably useless."
-	      echo "*** 'nm' from GNU binutils and a full rebuild may help."
-	    fi
-	    if test no = "$build_old_libs"; then
-	      oldlibs=$output_objdir/$libname.$libext
-	      build_libtool_libs=module
-	      build_old_libs=yes
-	    else
-	      build_libtool_libs=no
-	    fi
-	  else
-	    echo "*** The inter-library dependencies that have been dropped here will be"
-	    echo "*** automatically added whenever a program is linked with this library"
-	    echo "*** or is declared to -dlopen it."
-
-	    if test no = "$allow_undefined"; then
-	      echo
-	      echo "*** Since this library must not contain undefined symbols,"
-	      echo "*** because either the platform does not support them or"
-	      echo "*** it was explicitly requested with -no-undefined,"
-	      echo "*** libtool will only create a static version of it."
-	      if test no = "$build_old_libs"; then
-		oldlibs=$output_objdir/$libname.$libext
-		build_libtool_libs=module
-		build_old_libs=yes
-	      else
-		build_libtool_libs=no
-	      fi
-	    fi
-	  fi
-	fi
-	# Done checking deplibs!
-	deplibs=$newdeplibs
-      fi
-      # Time to change all our "foo.ltframework" stuff back to "-framework foo"
-      case $host in
-	*-*-darwin*)
-	  newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
-	  new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
-	  deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
-	  ;;
-      esac
-
-      # move library search paths that coincide with paths to not yet
-      # installed libraries to the beginning of the library search list
-      new_libs=
-      for path in $notinst_path; do
-	case " $new_libs " in
-	*" -L$path/$objdir "*) ;;
-	*)
-	  case " $deplibs " in
-	  *" -L$path/$objdir "*)
-	    func_append new_libs " -L$path/$objdir" ;;
-	  esac
-	  ;;
-	esac
-      done
-      for deplib in $deplibs; do
-	case $deplib in
-	-L*)
-	  case " $new_libs " in
-	  *" $deplib "*) ;;
-	  *) func_append new_libs " $deplib" ;;
-	  esac
-	  ;;
-	*) func_append new_libs " $deplib" ;;
-	esac
-      done
-      deplibs=$new_libs
-
-      # All the library-specific variables (install_libdir is set above).
-      library_names=
-      old_library=
-      dlname=
-
-      # Test again, we may have decided not to build it any more
-      if test yes = "$build_libtool_libs"; then
-	# Remove $wl instances when linking with ld.
-	# FIXME: should test the right _cmds variable.
-	case $archive_cmds in
-	  *\$LD\ *) wl= ;;
-        esac
-	if test yes = "$hardcode_into_libs"; then
-	  # Hardcode the library paths
-	  hardcode_libdirs=
-	  dep_rpath=
-	  rpath=$finalize_rpath
-	  test relink = "$opt_mode" || rpath=$compile_rpath$rpath
-	  for libdir in $rpath; do
-	    if test -n "$hardcode_libdir_flag_spec"; then
-	      if test -n "$hardcode_libdir_separator"; then
-		func_replace_sysroot "$libdir"
-		libdir=$func_replace_sysroot_result
-		if test -z "$hardcode_libdirs"; then
-		  hardcode_libdirs=$libdir
-		else
-		  # Just accumulate the unique libdirs.
-		  case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
-		  *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
-		    ;;
-		  *)
-		    func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
-		    ;;
-		  esac
-		fi
-	      else
-		eval flag=\"$hardcode_libdir_flag_spec\"
-		func_append dep_rpath " $flag"
-	      fi
-	    elif test -n "$runpath_var"; then
-	      case "$perm_rpath " in
-	      *" $libdir "*) ;;
-	      *) func_append perm_rpath " $libdir" ;;
-	      esac
-	    fi
-	  done
-	  # Substitute the hardcoded libdirs into the rpath.
-	  if test -n "$hardcode_libdir_separator" &&
-	     test -n "$hardcode_libdirs"; then
-	    libdir=$hardcode_libdirs
-	    eval "dep_rpath=\"$hardcode_libdir_flag_spec\""
-	  fi
-	  if test -n "$runpath_var" && test -n "$perm_rpath"; then
-	    # We should set the runpath_var.
-	    rpath=
-	    for dir in $perm_rpath; do
-	      func_append rpath "$dir:"
-	    done
-	    eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
-	  fi
-	  test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
-	fi
-
-	shlibpath=$finalize_shlibpath
-	test relink = "$opt_mode" || shlibpath=$compile_shlibpath$shlibpath
-	if test -n "$shlibpath"; then
-	  eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
-	fi
-
-	# Get the real and link names of the library.
-	eval shared_ext=\"$shrext_cmds\"
-	eval library_names=\"$library_names_spec\"
-	set dummy $library_names
-	shift
-	realname=$1
-	shift
-
-	if test -n "$soname_spec"; then
-	  eval soname=\"$soname_spec\"
-	else
-	  soname=$realname
-	fi
-	if test -z "$dlname"; then
-	  dlname=$soname
-	fi
-
-	lib=$output_objdir/$realname
-	linknames=
-	for link
-	do
-	  func_append linknames " $link"
-	done
-
-	# Use standard objects if they are pic
-	test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP`
-	test "X$libobjs" = "X " && libobjs=
-
-	delfiles=
-	if test -n "$export_symbols" && test -n "$include_expsyms"; then
-	  $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp"
-	  export_symbols=$output_objdir/$libname.uexp
-	  func_append delfiles " $export_symbols"
-	fi
-
-	orig_export_symbols=
-	case $host_os in
-	cygwin* | mingw* | cegcc*)
-	  if test -n "$export_symbols" && test -z "$export_symbols_regex"; then
-	    # exporting using user supplied symfile
-	    func_dll_def_p "$export_symbols" || {
-	      # and it's NOT already a .def file. Must figure out
-	      # which of the given symbols are data symbols and tag
-	      # them as such. So, trigger use of export_symbols_cmds.
-	      # export_symbols gets reassigned inside the "prepare
-	      # the list of exported symbols" if statement, so the
-	      # include_expsyms logic still works.
-	      orig_export_symbols=$export_symbols
-	      export_symbols=
-	      always_export_symbols=yes
-	    }
-	  fi
-	  ;;
-	esac
-
-	# Prepare the list of exported symbols
-	if test -z "$export_symbols"; then
-	  if test yes = "$always_export_symbols" || test -n "$export_symbols_regex"; then
-	    func_verbose "generating symbol list for '$libname.la'"
-	    export_symbols=$output_objdir/$libname.exp
-	    $opt_dry_run || $RM $export_symbols
-	    cmds=$export_symbols_cmds
-	    save_ifs=$IFS; IFS='~'
-	    for cmd1 in $cmds; do
-	      IFS=$save_ifs
-	      # Take the normal branch if the nm_file_list_spec branch
-	      # doesn't work or if tool conversion is not needed.
-	      case $nm_file_list_spec~$to_tool_file_cmd in
-		*~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*)
-		  try_normal_branch=yes
-		  eval cmd=\"$cmd1\"
-		  func_len " $cmd"
-		  len=$func_len_result
-		  ;;
-		*)
-		  try_normal_branch=no
-		  ;;
-	      esac
-	      if test yes = "$try_normal_branch" \
-		 && { test "$len" -lt "$max_cmd_len" \
-		      || test "$max_cmd_len" -le -1; }
-	      then
-		func_show_eval "$cmd" 'exit $?'
-		skipped_export=false
-	      elif test -n "$nm_file_list_spec"; then
-		func_basename "$output"
-		output_la=$func_basename_result
-		save_libobjs=$libobjs
-		save_output=$output
-		output=$output_objdir/$output_la.nm
-		func_to_tool_file "$output"
-		libobjs=$nm_file_list_spec$func_to_tool_file_result
-		func_append delfiles " $output"
-		func_verbose "creating $NM input file list: $output"
-		for obj in $save_libobjs; do
-		  func_to_tool_file "$obj"
-		  $ECHO "$func_to_tool_file_result"
-		done > "$output"
-		eval cmd=\"$cmd1\"
-		func_show_eval "$cmd" 'exit $?'
-		output=$save_output
-		libobjs=$save_libobjs
-		skipped_export=false
-	      else
-		# The command line is too long to execute in one step.
-		func_verbose "using reloadable object file for export list..."
-		skipped_export=:
-		# Break out early, otherwise skipped_export may be
-		# set to false by a later but shorter cmd.
-		break
-	      fi
-	    done
-	    IFS=$save_ifs
-	    if test -n "$export_symbols_regex" && test : != "$skipped_export"; then
-	      func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
-	      func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
-	    fi
-	  fi
-	fi
-
-	if test -n "$export_symbols" && test -n "$include_expsyms"; then
-	  tmp_export_symbols=$export_symbols
-	  test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols
-	  $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
-	fi
-
-	if test : != "$skipped_export" && test -n "$orig_export_symbols"; then
-	  # The given exports_symbols file has to be filtered, so filter it.
-	  func_verbose "filter symbol list for '$libname.la' to tag DATA exports"
-	  # FIXME: $output_objdir/$libname.filter potentially contains lots of
-	  # 's' commands, which not all seds can handle. GNU sed should be fine
-	  # though. Also, the filter scales superlinearly with the number of
-	  # global variables. join(1) would be nice here, but unfortunately
-	  # isn't a blessed tool.
-	  $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
-	  func_append delfiles " $export_symbols $output_objdir/$libname.filter"
-	  export_symbols=$output_objdir/$libname.def
-	  $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
-	fi
-
-	tmp_deplibs=
-	for test_deplib in $deplibs; do
-	  case " $convenience " in
-	  *" $test_deplib "*) ;;
-	  *)
-	    func_append tmp_deplibs " $test_deplib"
-	    ;;
-	  esac
-	done
-	deplibs=$tmp_deplibs
-
-	if test -n "$convenience"; then
-	  if test -n "$whole_archive_flag_spec" &&
-	    test yes = "$compiler_needs_object" &&
-	    test -z "$libobjs"; then
-	    # extract the archives, so we have objects to list.
-	    # TODO: could optimize this to just extract one archive.
-	    whole_archive_flag_spec=
-	  fi
-	  if test -n "$whole_archive_flag_spec"; then
-	    save_libobjs=$libobjs
-	    eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
-	    test "X$libobjs" = "X " && libobjs=
-	  else
-	    gentop=$output_objdir/${outputname}x
-	    func_append generated " $gentop"
-
-	    func_extract_archives $gentop $convenience
-	    func_append libobjs " $func_extract_archives_result"
-	    test "X$libobjs" = "X " && libobjs=
-	  fi
-	fi
-
-	if test yes = "$thread_safe" && test -n "$thread_safe_flag_spec"; then
-	  eval flag=\"$thread_safe_flag_spec\"
-	  func_append linker_flags " $flag"
-	fi
-
-	# Make a backup of the uninstalled library when relinking
-	if test relink = "$opt_mode"; then
-	  $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $?
-	fi
-
-	# Do each of the archive commands.
-	if test yes = "$module" && test -n "$module_cmds"; then
-	  if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
-	    eval test_cmds=\"$module_expsym_cmds\"
-	    cmds=$module_expsym_cmds
-	  else
-	    eval test_cmds=\"$module_cmds\"
-	    cmds=$module_cmds
-	  fi
-	else
-	  if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
-	    eval test_cmds=\"$archive_expsym_cmds\"
-	    cmds=$archive_expsym_cmds
-	  else
-	    eval test_cmds=\"$archive_cmds\"
-	    cmds=$archive_cmds
-	  fi
-	fi
-
-	if test : != "$skipped_export" &&
-	   func_len " $test_cmds" &&
-	   len=$func_len_result &&
-	   test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
-	  :
-	else
-	  # The command line is too long to link in one step, link piecewise
-	  # or, if using GNU ld and skipped_export is not :, use a linker
-	  # script.
-
-	  # Save the value of $output and $libobjs because we want to
-	  # use them later.  If we have whole_archive_flag_spec, we
-	  # want to use save_libobjs as it was before
-	  # whole_archive_flag_spec was expanded, because we can't
-	  # assume the linker understands whole_archive_flag_spec.
-	  # This may have to be revisited, in case too many
-	  # convenience libraries get linked in and end up exceeding
-	  # the spec.
-	  if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
-	    save_libobjs=$libobjs
-	  fi
-	  save_output=$output
-	  func_basename "$output"
-	  output_la=$func_basename_result
-
-	  # Clear the reloadable object creation command queue and
-	  # initialize k to one.
-	  test_cmds=
-	  concat_cmds=
-	  objlist=
-	  last_robj=
-	  k=1
-
-	  if test -n "$save_libobjs" && test : != "$skipped_export" && test yes = "$with_gnu_ld"; then
-	    output=$output_objdir/$output_la.lnkscript
-	    func_verbose "creating GNU ld script: $output"
-	    echo 'INPUT (' > $output
-	    for obj in $save_libobjs
-	    do
-	      func_to_tool_file "$obj"
-	      $ECHO "$func_to_tool_file_result" >> $output
-	    done
-	    echo ')' >> $output
-	    func_append delfiles " $output"
-	    func_to_tool_file "$output"
-	    output=$func_to_tool_file_result
-	  elif test -n "$save_libobjs" && test : != "$skipped_export" && test -n "$file_list_spec"; then
-	    output=$output_objdir/$output_la.lnk
-	    func_verbose "creating linker input file list: $output"
-	    : > $output
-	    set x $save_libobjs
-	    shift
-	    firstobj=
-	    if test yes = "$compiler_needs_object"; then
-	      firstobj="$1 "
-	      shift
-	    fi
-	    for obj
-	    do
-	      func_to_tool_file "$obj"
-	      $ECHO "$func_to_tool_file_result" >> $output
-	    done
-	    func_append delfiles " $output"
-	    func_to_tool_file "$output"
-	    output=$firstobj\"$file_list_spec$func_to_tool_file_result\"
-	  else
-	    if test -n "$save_libobjs"; then
-	      func_verbose "creating reloadable object files..."
-	      output=$output_objdir/$output_la-$k.$objext
-	      eval test_cmds=\"$reload_cmds\"
-	      func_len " $test_cmds"
-	      len0=$func_len_result
-	      len=$len0
-
-	      # Loop over the list of objects to be linked.
-	      for obj in $save_libobjs
-	      do
-		func_len " $obj"
-		func_arith $len + $func_len_result
-		len=$func_arith_result
-		if test -z "$objlist" ||
-		   test "$len" -lt "$max_cmd_len"; then
-		  func_append objlist " $obj"
-		else
-		  # The command $test_cmds is almost too long, add a
-		  # command to the queue.
-		  if test 1 -eq "$k"; then
-		    # The first file doesn't have a previous command to add.
-		    reload_objs=$objlist
-		    eval concat_cmds=\"$reload_cmds\"
-		  else
-		    # All subsequent reloadable object files will link in
-		    # the last one created.
-		    reload_objs="$objlist $last_robj"
-		    eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\"
-		  fi
-		  last_robj=$output_objdir/$output_la-$k.$objext
-		  func_arith $k + 1
-		  k=$func_arith_result
-		  output=$output_objdir/$output_la-$k.$objext
-		  objlist=" $obj"
-		  func_len " $last_robj"
-		  func_arith $len0 + $func_len_result
-		  len=$func_arith_result
-		fi
-	      done
-	      # Handle the remaining objects by creating one last
-	      # reloadable object file.  All subsequent reloadable object
-	      # files will link in the last one created.
-	      test -z "$concat_cmds" || concat_cmds=$concat_cmds~
-	      reload_objs="$objlist $last_robj"
-	      eval concat_cmds=\"\$concat_cmds$reload_cmds\"
-	      if test -n "$last_robj"; then
-	        eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
-	      fi
-	      func_append delfiles " $output"
-
-	    else
-	      output=
-	    fi
-
-	    ${skipped_export-false} && {
-	      func_verbose "generating symbol list for '$libname.la'"
-	      export_symbols=$output_objdir/$libname.exp
-	      $opt_dry_run || $RM $export_symbols
-	      libobjs=$output
-	      # Append the command to create the export file.
-	      test -z "$concat_cmds" || concat_cmds=$concat_cmds~
-	      eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\"
-	      if test -n "$last_robj"; then
-		eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
-	      fi
-	    }
-
-	    test -n "$save_libobjs" &&
-	      func_verbose "creating a temporary reloadable object file: $output"
-
-	    # Loop through the commands generated above and execute them.
-	    save_ifs=$IFS; IFS='~'
-	    for cmd in $concat_cmds; do
-	      IFS=$save_ifs
-	      $opt_quiet || {
-		  func_quote_for_expand "$cmd"
-		  eval "func_echo $func_quote_for_expand_result"
-	      }
-	      $opt_dry_run || eval "$cmd" || {
-		lt_exit=$?
-
-		# Restore the uninstalled library and exit
-		if test relink = "$opt_mode"; then
-		  ( cd "$output_objdir" && \
-		    $RM "${realname}T" && \
-		    $MV "${realname}U" "$realname" )
-		fi
-
-		exit $lt_exit
-	      }
-	    done
-	    IFS=$save_ifs
-
-	    if test -n "$export_symbols_regex" && ${skipped_export-false}; then
-	      func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
-	      func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
-	    fi
-	  fi
-
-          ${skipped_export-false} && {
-	    if test -n "$export_symbols" && test -n "$include_expsyms"; then
-	      tmp_export_symbols=$export_symbols
-	      test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols
-	      $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
-	    fi
-
-	    if test -n "$orig_export_symbols"; then
-	      # The given exports_symbols file has to be filtered, so filter it.
-	      func_verbose "filter symbol list for '$libname.la' to tag DATA exports"
-	      # FIXME: $output_objdir/$libname.filter potentially contains lots of
-	      # 's' commands, which not all seds can handle. GNU sed should be fine
-	      # though. Also, the filter scales superlinearly with the number of
-	      # global variables. join(1) would be nice here, but unfortunately
-	      # isn't a blessed tool.
-	      $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
-	      func_append delfiles " $export_symbols $output_objdir/$libname.filter"
-	      export_symbols=$output_objdir/$libname.def
-	      $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
-	    fi
-	  }
-
-	  libobjs=$output
-	  # Restore the value of output.
-	  output=$save_output
-
-	  if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
-	    eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
-	    test "X$libobjs" = "X " && libobjs=
-	  fi
-	  # Expand the library linking commands again to reset the
-	  # value of $libobjs for piecewise linking.
-
-	  # Do each of the archive commands.
-	  if test yes = "$module" && test -n "$module_cmds"; then
-	    if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
-	      cmds=$module_expsym_cmds
-	    else
-	      cmds=$module_cmds
-	    fi
-	  else
-	    if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
-	      cmds=$archive_expsym_cmds
-	    else
-	      cmds=$archive_cmds
-	    fi
-	  fi
-	fi
-
-	if test -n "$delfiles"; then
-	  # Append the command to remove temporary files to $cmds.
-	  eval cmds=\"\$cmds~\$RM $delfiles\"
-	fi
-
-	# Add any objects from preloaded convenience libraries
-	if test -n "$dlprefiles"; then
-	  gentop=$output_objdir/${outputname}x
-	  func_append generated " $gentop"
-
-	  func_extract_archives $gentop $dlprefiles
-	  func_append libobjs " $func_extract_archives_result"
-	  test "X$libobjs" = "X " && libobjs=
-	fi
-
-	save_ifs=$IFS; IFS='~'
-	for cmd in $cmds; do
-	  IFS=$sp$nl
-	  eval cmd=\"$cmd\"
-	  IFS=$save_ifs
-	  $opt_quiet || {
-	    func_quote_for_expand "$cmd"
-	    eval "func_echo $func_quote_for_expand_result"
-	  }
-	  $opt_dry_run || eval "$cmd" || {
-	    lt_exit=$?
-
-	    # Restore the uninstalled library and exit
-	    if test relink = "$opt_mode"; then
-	      ( cd "$output_objdir" && \
-	        $RM "${realname}T" && \
-		$MV "${realname}U" "$realname" )
-	    fi
-
-	    exit $lt_exit
-	  }
-	done
-	IFS=$save_ifs
-
-	# Restore the uninstalled library and exit
-	if test relink = "$opt_mode"; then
-	  $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $?
-
-	  if test -n "$convenience"; then
-	    if test -z "$whole_archive_flag_spec"; then
-	      func_show_eval '${RM}r "$gentop"'
-	    fi
-	  fi
-
-	  exit $EXIT_SUCCESS
-	fi
-
-	# Create links to the real library.
-	for linkname in $linknames; do
-	  if test "$realname" != "$linkname"; then
-	    func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?'
-	  fi
-	done
-
-	# If -module or -export-dynamic was specified, set the dlname.
-	if test yes = "$module" || test yes = "$export_dynamic"; then
-	  # On all known operating systems, these are identical.
-	  dlname=$soname
-	fi
-      fi
-      ;;
-
-    obj)
-      if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then
-	func_warning "'-dlopen' is ignored for objects"
-      fi
-
-      case " $deplibs" in
-      *\ -l* | *\ -L*)
-	func_warning "'-l' and '-L' are ignored for objects" ;;
-      esac
-
-      test -n "$rpath" && \
-	func_warning "'-rpath' is ignored for objects"
-
-      test -n "$xrpath" && \
-	func_warning "'-R' is ignored for objects"
-
-      test -n "$vinfo" && \
-	func_warning "'-version-info' is ignored for objects"
-
-      test -n "$release" && \
-	func_warning "'-release' is ignored for objects"
-
-      case $output in
-      *.lo)
-	test -n "$objs$old_deplibs" && \
-	  func_fatal_error "cannot build library object '$output' from non-libtool objects"
-
-	libobj=$output
-	func_lo2o "$libobj"
-	obj=$func_lo2o_result
-	;;
-      *)
-	libobj=
-	obj=$output
-	;;
-      esac
-
-      # Delete the old objects.
-      $opt_dry_run || $RM $obj $libobj
-
-      # Objects from convenience libraries.  This assumes
-      # single-version convenience libraries.  Whenever we create
-      # different ones for PIC/non-PIC, this we'll have to duplicate
-      # the extraction.
-      reload_conv_objs=
-      gentop=
-      # if reload_cmds runs $LD directly, get rid of -Wl from
-      # whole_archive_flag_spec and hope we can get by with turning comma
-      # into space.
-      case $reload_cmds in
-        *\$LD[\ \$]*) wl= ;;
-      esac
-      if test -n "$convenience"; then
-	if test -n "$whole_archive_flag_spec"; then
-	  eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
-	  test -n "$wl" || tmp_whole_archive_flags=`$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'`
-	  reload_conv_objs=$reload_objs\ $tmp_whole_archive_flags
-	else
-	  gentop=$output_objdir/${obj}x
-	  func_append generated " $gentop"
-
-	  func_extract_archives $gentop $convenience
-	  reload_conv_objs="$reload_objs $func_extract_archives_result"
-	fi
-      fi
-
-      # If we're not building shared, we need to use non_pic_objs
-      test yes = "$build_libtool_libs" || libobjs=$non_pic_objects
-
-      # Create the old-style object.
-      reload_objs=$objs$old_deplibs' '`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; /\.lib$/d; $lo2o" | $NL2SP`' '$reload_conv_objs
-
-      output=$obj
-      func_execute_cmds "$reload_cmds" 'exit $?'
-
-      # Exit if we aren't doing a library object file.
-      if test -z "$libobj"; then
-	if test -n "$gentop"; then
-	  func_show_eval '${RM}r "$gentop"'
-	fi
-
-	exit $EXIT_SUCCESS
-      fi
-
-      test yes = "$build_libtool_libs" || {
-	if test -n "$gentop"; then
-	  func_show_eval '${RM}r "$gentop"'
-	fi
-
-	# Create an invalid libtool object if no PIC, so that we don't
-	# accidentally link it into a program.
-	# $show "echo timestamp > $libobj"
-	# $opt_dry_run || eval "echo timestamp > $libobj" || exit $?
-	exit $EXIT_SUCCESS
-      }
-
-      if test -n "$pic_flag" || test default != "$pic_mode"; then
-	# Only do commands if we really have different PIC objects.
-	reload_objs="$libobjs $reload_conv_objs"
-	output=$libobj
-	func_execute_cmds "$reload_cmds" 'exit $?'
-      fi
-
-      if test -n "$gentop"; then
-	func_show_eval '${RM}r "$gentop"'
-      fi
-
-      exit $EXIT_SUCCESS
-      ;;
-
-    prog)
-      case $host in
-	*cygwin*) func_stripname '' '.exe' "$output"
-	          output=$func_stripname_result.exe;;
-      esac
-      test -n "$vinfo" && \
-	func_warning "'-version-info' is ignored for programs"
-
-      test -n "$release" && \
-	func_warning "'-release' is ignored for programs"
-
-      $preload \
-	&& test unknown,unknown,unknown = "$dlopen_support,$dlopen_self,$dlopen_self_static" \
-	&& func_warning "'LT_INIT([dlopen])' not used. Assuming no dlopen support."
-
-      case $host in
-      *-*-rhapsody* | *-*-darwin1.[012])
-	# On Rhapsody replace the C library is the System framework
-	compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'`
-	finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'`
-	;;
-      esac
-
-      case $host in
-      *-*-darwin*)
-	# Don't allow lazy linking, it breaks C++ global constructors
-	# But is supposedly fixed on 10.4 or later (yay!).
-	if test CXX = "$tagname"; then
-	  case ${MACOSX_DEPLOYMENT_TARGET-10.0} in
-	    10.[0123])
-	      func_append compile_command " $wl-bind_at_load"
-	      func_append finalize_command " $wl-bind_at_load"
-	    ;;
-	  esac
-	fi
-	# Time to change all our "foo.ltframework" stuff back to "-framework foo"
-	compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
-	finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
-	;;
-      esac
-
-
-      # move library search paths that coincide with paths to not yet
-      # installed libraries to the beginning of the library search list
-      new_libs=
-      for path in $notinst_path; do
-	case " $new_libs " in
-	*" -L$path/$objdir "*) ;;
-	*)
-	  case " $compile_deplibs " in
-	  *" -L$path/$objdir "*)
-	    func_append new_libs " -L$path/$objdir" ;;
-	  esac
-	  ;;
-	esac
-      done
-      for deplib in $compile_deplibs; do
-	case $deplib in
-	-L*)
-	  case " $new_libs " in
-	  *" $deplib "*) ;;
-	  *) func_append new_libs " $deplib" ;;
-	  esac
-	  ;;
-	*) func_append new_libs " $deplib" ;;
-	esac
-      done
-      compile_deplibs=$new_libs
-
-
-      func_append compile_command " $compile_deplibs"
-      func_append finalize_command " $finalize_deplibs"
-
-      if test -n "$rpath$xrpath"; then
-	# If the user specified any rpath flags, then add them.
-	for libdir in $rpath $xrpath; do
-	  # This is the magic to use -rpath.
-	  case "$finalize_rpath " in
-	  *" $libdir "*) ;;
-	  *) func_append finalize_rpath " $libdir" ;;
-	  esac
-	done
-      fi
-
-      # Now hardcode the library paths
-      rpath=
-      hardcode_libdirs=
-      for libdir in $compile_rpath $finalize_rpath; do
-	if test -n "$hardcode_libdir_flag_spec"; then
-	  if test -n "$hardcode_libdir_separator"; then
-	    if test -z "$hardcode_libdirs"; then
-	      hardcode_libdirs=$libdir
-	    else
-	      # Just accumulate the unique libdirs.
-	      case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
-	      *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
-		;;
-	      *)
-		func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
-		;;
-	      esac
-	    fi
-	  else
-	    eval flag=\"$hardcode_libdir_flag_spec\"
-	    func_append rpath " $flag"
-	  fi
-	elif test -n "$runpath_var"; then
-	  case "$perm_rpath " in
-	  *" $libdir "*) ;;
-	  *) func_append perm_rpath " $libdir" ;;
-	  esac
-	fi
-	case $host in
-	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
-	  testbindir=`$ECHO "$libdir" | $SED -e 's*/lib$*/bin*'`
-	  case :$dllsearchpath: in
-	  *":$libdir:"*) ;;
-	  ::) dllsearchpath=$libdir;;
-	  *) func_append dllsearchpath ":$libdir";;
-	  esac
-	  case :$dllsearchpath: in
-	  *":$testbindir:"*) ;;
-	  ::) dllsearchpath=$testbindir;;
-	  *) func_append dllsearchpath ":$testbindir";;
-	  esac
-	  ;;
-	esac
-      done
-      # Substitute the hardcoded libdirs into the rpath.
-      if test -n "$hardcode_libdir_separator" &&
-	 test -n "$hardcode_libdirs"; then
-	libdir=$hardcode_libdirs
-	eval rpath=\" $hardcode_libdir_flag_spec\"
-      fi
-      compile_rpath=$rpath
-
-      rpath=
-      hardcode_libdirs=
-      for libdir in $finalize_rpath; do
-	if test -n "$hardcode_libdir_flag_spec"; then
-	  if test -n "$hardcode_libdir_separator"; then
-	    if test -z "$hardcode_libdirs"; then
-	      hardcode_libdirs=$libdir
-	    else
-	      # Just accumulate the unique libdirs.
-	      case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
-	      *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
-		;;
-	      *)
-		func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
-		;;
-	      esac
-	    fi
-	  else
-	    eval flag=\"$hardcode_libdir_flag_spec\"
-	    func_append rpath " $flag"
-	  fi
-	elif test -n "$runpath_var"; then
-	  case "$finalize_perm_rpath " in
-	  *" $libdir "*) ;;
-	  *) func_append finalize_perm_rpath " $libdir" ;;
-	  esac
-	fi
-      done
-      # Substitute the hardcoded libdirs into the rpath.
-      if test -n "$hardcode_libdir_separator" &&
-	 test -n "$hardcode_libdirs"; then
-	libdir=$hardcode_libdirs
-	eval rpath=\" $hardcode_libdir_flag_spec\"
-      fi
-      finalize_rpath=$rpath
-
-      if test -n "$libobjs" && test yes = "$build_old_libs"; then
-	# Transform all the library objects into standard objects.
-	compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
-	finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
-      fi
-
-      func_generate_dlsyms "$outputname" "@PROGRAM@" false
-
-      # template prelinking step
-      if test -n "$prelink_cmds"; then
-	func_execute_cmds "$prelink_cmds" 'exit $?'
-      fi
-
-      wrappers_required=:
-      case $host in
-      *cegcc* | *mingw32ce*)
-        # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway.
-        wrappers_required=false
-        ;;
-      *cygwin* | *mingw* )
-        test yes = "$build_libtool_libs" || wrappers_required=false
-        ;;
-      *)
-        if test no = "$need_relink" || test yes != "$build_libtool_libs"; then
-          wrappers_required=false
-        fi
-        ;;
-      esac
-      $wrappers_required || {
-	# Replace the output file specification.
-	compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
-	link_command=$compile_command$compile_rpath
-
-	# We have no uninstalled library dependencies, so finalize right now.
-	exit_status=0
-	func_show_eval "$link_command" 'exit_status=$?'
-
-	if test -n "$postlink_cmds"; then
-	  func_to_tool_file "$output"
-	  postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
-	  func_execute_cmds "$postlink_cmds" 'exit $?'
-	fi
-
-	# Delete the generated files.
-	if test -f "$output_objdir/${outputname}S.$objext"; then
-	  func_show_eval '$RM "$output_objdir/${outputname}S.$objext"'
-	fi
-
-	exit $exit_status
-      }
-
-      if test -n "$compile_shlibpath$finalize_shlibpath"; then
-	compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
-      fi
-      if test -n "$finalize_shlibpath"; then
-	finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
-      fi
-
-      compile_var=
-      finalize_var=
-      if test -n "$runpath_var"; then
-	if test -n "$perm_rpath"; then
-	  # We should set the runpath_var.
-	  rpath=
-	  for dir in $perm_rpath; do
-	    func_append rpath "$dir:"
-	  done
-	  compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
-	fi
-	if test -n "$finalize_perm_rpath"; then
-	  # We should set the runpath_var.
-	  rpath=
-	  for dir in $finalize_perm_rpath; do
-	    func_append rpath "$dir:"
-	  done
-	  finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
-	fi
-      fi
-
-      if test yes = "$no_install"; then
-	# We don't need to create a wrapper script.
-	link_command=$compile_var$compile_command$compile_rpath
-	# Replace the output file specification.
-	link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
-	# Delete the old output file.
-	$opt_dry_run || $RM $output
-	# Link the executable and exit
-	func_show_eval "$link_command" 'exit $?'
-
-	if test -n "$postlink_cmds"; then
-	  func_to_tool_file "$output"
-	  postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
-	  func_execute_cmds "$postlink_cmds" 'exit $?'
-	fi
-
-	exit $EXIT_SUCCESS
-      fi
-
-      case $hardcode_action,$fast_install in
-        relink,*)
-	  # Fast installation is not supported
-	  link_command=$compile_var$compile_command$compile_rpath
-	  relink_command=$finalize_var$finalize_command$finalize_rpath
-
-	  func_warning "this platform does not like uninstalled shared libraries"
-	  func_warning "'$output' will be relinked during installation"
-	  ;;
-        *,yes)
-	  link_command=$finalize_var$compile_command$finalize_rpath
-	  relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'`
-          ;;
-	*,no)
-	  link_command=$compile_var$compile_command$compile_rpath
-	  relink_command=$finalize_var$finalize_command$finalize_rpath
-          ;;
-	*,needless)
-	  link_command=$finalize_var$compile_command$finalize_rpath
-	  relink_command=
-          ;;
-      esac
-
-      # Replace the output file specification.
-      link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
-
-      # Delete the old output files.
-      $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname
-
-      func_show_eval "$link_command" 'exit $?'
-
-      if test -n "$postlink_cmds"; then
-	func_to_tool_file "$output_objdir/$outputname"
-	postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
-	func_execute_cmds "$postlink_cmds" 'exit $?'
-      fi
-
-      # Now create the wrapper script.
-      func_verbose "creating $output"
-
-      # Quote the relink command for shipping.
-      if test -n "$relink_command"; then
-	# Preserve any variables that may affect compiler behavior
-	for var in $variables_saved_for_relink; do
-	  if eval test -z \"\${$var+set}\"; then
-	    relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
-	  elif eval var_value=\$$var; test -z "$var_value"; then
-	    relink_command="$var=; export $var; $relink_command"
-	  else
-	    func_quote_for_eval "$var_value"
-	    relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
-	  fi
-	done
-	relink_command="(cd `pwd`; $relink_command)"
-	relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
-      fi
-
-      # Only actually do things if not in dry run mode.
-      $opt_dry_run || {
-	# win32 will think the script is a binary if it has
-	# a .exe suffix, so we strip it off here.
-	case $output in
-	  *.exe) func_stripname '' '.exe' "$output"
-	         output=$func_stripname_result ;;
-	esac
-	# test for cygwin because mv fails w/o .exe extensions
-	case $host in
-	  *cygwin*)
-	    exeext=.exe
-	    func_stripname '' '.exe' "$outputname"
-	    outputname=$func_stripname_result ;;
-	  *) exeext= ;;
-	esac
-	case $host in
-	  *cygwin* | *mingw* )
-	    func_dirname_and_basename "$output" "" "."
-	    output_name=$func_basename_result
-	    output_path=$func_dirname_result
-	    cwrappersource=$output_path/$objdir/lt-$output_name.c
-	    cwrapper=$output_path/$output_name.exe
-	    $RM $cwrappersource $cwrapper
-	    trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
-
-	    func_emit_cwrapperexe_src > $cwrappersource
-
-	    # The wrapper executable is built using the $host compiler,
-	    # because it contains $host paths and files. If cross-
-	    # compiling, it, like the target executable, must be
-	    # executed on the $host or under an emulation environment.
-	    $opt_dry_run || {
-	      $LTCC $LTCFLAGS -o $cwrapper $cwrappersource
-	      $STRIP $cwrapper
-	    }
-
-	    # Now, create the wrapper script for func_source use:
-	    func_ltwrapper_scriptname $cwrapper
-	    $RM $func_ltwrapper_scriptname_result
-	    trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15
-	    $opt_dry_run || {
-	      # note: this script will not be executed, so do not chmod.
-	      if test "x$build" = "x$host"; then
-		$cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result
-	      else
-		func_emit_wrapper no > $func_ltwrapper_scriptname_result
-	      fi
-	    }
-	  ;;
-	  * )
-	    $RM $output
-	    trap "$RM $output; exit $EXIT_FAILURE" 1 2 15
-
-	    func_emit_wrapper no > $output
-	    chmod +x $output
-	  ;;
-	esac
-      }
-      exit $EXIT_SUCCESS
-      ;;
-    esac
-
-    # See if we need to build an old-fashioned archive.
-    for oldlib in $oldlibs; do
-
-      case $build_libtool_libs in
-        convenience)
-	  oldobjs="$libobjs_save $symfileobj"
-	  addlibs=$convenience
-	  build_libtool_libs=no
-	  ;;
-	module)
-	  oldobjs=$libobjs_save
-	  addlibs=$old_convenience
-	  build_libtool_libs=no
-          ;;
-	*)
-	  oldobjs="$old_deplibs $non_pic_objects"
-	  $preload && test -f "$symfileobj" \
-	    && func_append oldobjs " $symfileobj"
-	  addlibs=$old_convenience
-	  ;;
-      esac
-
-      if test -n "$addlibs"; then
-	gentop=$output_objdir/${outputname}x
-	func_append generated " $gentop"
-
-	func_extract_archives $gentop $addlibs
-	func_append oldobjs " $func_extract_archives_result"
-      fi
-
-      # Do each command in the archive commands.
-      if test -n "$old_archive_from_new_cmds" && test yes = "$build_libtool_libs"; then
-	cmds=$old_archive_from_new_cmds
-      else
-
-	# Add any objects from preloaded convenience libraries
-	if test -n "$dlprefiles"; then
-	  gentop=$output_objdir/${outputname}x
-	  func_append generated " $gentop"
-
-	  func_extract_archives $gentop $dlprefiles
-	  func_append oldobjs " $func_extract_archives_result"
-	fi
-
-	# POSIX demands no paths to be encoded in archives.  We have
-	# to avoid creating archives with duplicate basenames if we
-	# might have to extract them afterwards, e.g., when creating a
-	# static archive out of a convenience library, or when linking
-	# the entirety of a libtool archive into another (currently
-	# not supported by libtool).
-	if (for obj in $oldobjs
-	    do
-	      func_basename "$obj"
-	      $ECHO "$func_basename_result"
-	    done | sort | sort -uc >/dev/null 2>&1); then
-	  :
-	else
-	  echo "copying selected object files to avoid basename conflicts..."
-	  gentop=$output_objdir/${outputname}x
-	  func_append generated " $gentop"
-	  func_mkdir_p "$gentop"
-	  save_oldobjs=$oldobjs
-	  oldobjs=
-	  counter=1
-	  for obj in $save_oldobjs
-	  do
-	    func_basename "$obj"
-	    objbase=$func_basename_result
-	    case " $oldobjs " in
-	    " ") oldobjs=$obj ;;
-	    *[\ /]"$objbase "*)
-	      while :; do
-		# Make sure we don't pick an alternate name that also
-		# overlaps.
-		newobj=lt$counter-$objbase
-		func_arith $counter + 1
-		counter=$func_arith_result
-		case " $oldobjs " in
-		*[\ /]"$newobj "*) ;;
-		*) if test ! -f "$gentop/$newobj"; then break; fi ;;
-		esac
-	      done
-	      func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
-	      func_append oldobjs " $gentop/$newobj"
-	      ;;
-	    *) func_append oldobjs " $obj" ;;
-	    esac
-	  done
-	fi
-	func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
-	tool_oldlib=$func_to_tool_file_result
-	eval cmds=\"$old_archive_cmds\"
-
-	func_len " $cmds"
-	len=$func_len_result
-	if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
-	  cmds=$old_archive_cmds
-	elif test -n "$archiver_list_spec"; then
-	  func_verbose "using command file archive linking..."
-	  for obj in $oldobjs
-	  do
-	    func_to_tool_file "$obj"
-	    $ECHO "$func_to_tool_file_result"
-	  done > $output_objdir/$libname.libcmd
-	  func_to_tool_file "$output_objdir/$libname.libcmd"
-	  oldobjs=" $archiver_list_spec$func_to_tool_file_result"
-	  cmds=$old_archive_cmds
-	else
-	  # the command line is too long to link in one step, link in parts
-	  func_verbose "using piecewise archive linking..."
-	  save_RANLIB=$RANLIB
-	  RANLIB=:
-	  objlist=
-	  concat_cmds=
-	  save_oldobjs=$oldobjs
-	  oldobjs=
-	  # Is there a better way of finding the last object in the list?
-	  for obj in $save_oldobjs
-	  do
-	    last_oldobj=$obj
-	  done
-	  eval test_cmds=\"$old_archive_cmds\"
-	  func_len " $test_cmds"
-	  len0=$func_len_result
-	  len=$len0
-	  for obj in $save_oldobjs
-	  do
-	    func_len " $obj"
-	    func_arith $len + $func_len_result
-	    len=$func_arith_result
-	    func_append objlist " $obj"
-	    if test "$len" -lt "$max_cmd_len"; then
-	      :
-	    else
-	      # the above command should be used before it gets too long
-	      oldobjs=$objlist
-	      if test "$obj" = "$last_oldobj"; then
-		RANLIB=$save_RANLIB
-	      fi
-	      test -z "$concat_cmds" || concat_cmds=$concat_cmds~
-	      eval concat_cmds=\"\$concat_cmds$old_archive_cmds\"
-	      objlist=
-	      len=$len0
-	    fi
-	  done
-	  RANLIB=$save_RANLIB
-	  oldobjs=$objlist
-	  if test -z "$oldobjs"; then
-	    eval cmds=\"\$concat_cmds\"
-	  else
-	    eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
-	  fi
-	fi
-      fi
-      func_execute_cmds "$cmds" 'exit $?'
-    done
-
-    test -n "$generated" && \
-      func_show_eval "${RM}r$generated"
-
-    # Now create the libtool archive.
-    case $output in
-    *.la)
-      old_library=
-      test yes = "$build_old_libs" && old_library=$libname.$libext
-      func_verbose "creating $output"
-
-      # Preserve any variables that may affect compiler behavior
-      for var in $variables_saved_for_relink; do
-	if eval test -z \"\${$var+set}\"; then
-	  relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
-	elif eval var_value=\$$var; test -z "$var_value"; then
-	  relink_command="$var=; export $var; $relink_command"
-	else
-	  func_quote_for_eval "$var_value"
-	  relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
-	fi
-      done
-      # Quote the link command for shipping.
-      relink_command="(cd `pwd`; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
-      relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
-      if test yes = "$hardcode_automatic"; then
-	relink_command=
-      fi
-
-      # Only create the output if not a dry run.
-      $opt_dry_run || {
-	for installed in no yes; do
-	  if test yes = "$installed"; then
-	    if test -z "$install_libdir"; then
-	      break
-	    fi
-	    output=$output_objdir/${outputname}i
-	    # Replace all uninstalled libtool libraries with the installed ones
-	    newdependency_libs=
-	    for deplib in $dependency_libs; do
-	      case $deplib in
-	      *.la)
-		func_basename "$deplib"
-		name=$func_basename_result
-		func_resolve_sysroot "$deplib"
-		eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result`
-		test -z "$libdir" && \
-		  func_fatal_error "'$deplib' is not a valid libtool archive"
-		func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name"
-		;;
-	      -L*)
-		func_stripname -L '' "$deplib"
-		func_replace_sysroot "$func_stripname_result"
-		func_append newdependency_libs " -L$func_replace_sysroot_result"
-		;;
-	      -R*)
-		func_stripname -R '' "$deplib"
-		func_replace_sysroot "$func_stripname_result"
-		func_append newdependency_libs " -R$func_replace_sysroot_result"
-		;;
-	      *) func_append newdependency_libs " $deplib" ;;
-	      esac
-	    done
-	    dependency_libs=$newdependency_libs
-	    newdlfiles=
-
-	    for lib in $dlfiles; do
-	      case $lib in
-	      *.la)
-	        func_basename "$lib"
-		name=$func_basename_result
-		eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
-		test -z "$libdir" && \
-		  func_fatal_error "'$lib' is not a valid libtool archive"
-		func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name"
-		;;
-	      *) func_append newdlfiles " $lib" ;;
-	      esac
-	    done
-	    dlfiles=$newdlfiles
-	    newdlprefiles=
-	    for lib in $dlprefiles; do
-	      case $lib in
-	      *.la)
-		# Only pass preopened files to the pseudo-archive (for
-		# eventual linking with the app. that links it) if we
-		# didn't already link the preopened objects directly into
-		# the library:
-		func_basename "$lib"
-		name=$func_basename_result
-		eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
-		test -z "$libdir" && \
-		  func_fatal_error "'$lib' is not a valid libtool archive"
-		func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name"
-		;;
-	      esac
-	    done
-	    dlprefiles=$newdlprefiles
-	  else
-	    newdlfiles=
-	    for lib in $dlfiles; do
-	      case $lib in
-		[\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;;
-		*) abs=`pwd`"/$lib" ;;
-	      esac
-	      func_append newdlfiles " $abs"
-	    done
-	    dlfiles=$newdlfiles
-	    newdlprefiles=
-	    for lib in $dlprefiles; do
-	      case $lib in
-		[\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;;
-		*) abs=`pwd`"/$lib" ;;
-	      esac
-	      func_append newdlprefiles " $abs"
-	    done
-	    dlprefiles=$newdlprefiles
-	  fi
-	  $RM $output
-	  # place dlname in correct position for cygwin
-	  # In fact, it would be nice if we could use this code for all target
-	  # systems that can't hard-code library paths into their executables
-	  # and that have no shared library path variable independent of PATH,
-	  # but it turns out we can't easily determine that from inspecting
-	  # libtool variables, so we have to hard-code the OSs to which it
-	  # applies here; at the moment, that means platforms that use the PE
-	  # object format with DLL files.  See the long comment at the top of
-	  # tests/bindir.at for full details.
-	  tdlname=$dlname
-	  case $host,$output,$installed,$module,$dlname in
-	    *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll)
-	      # If a -bindir argument was supplied, place the dll there.
-	      if test -n "$bindir"; then
-		func_relative_path "$install_libdir" "$bindir"
-		tdlname=$func_relative_path_result/$dlname
-	      else
-		# Otherwise fall back on heuristic.
-		tdlname=../bin/$dlname
-	      fi
-	      ;;
-	  esac
-	  $ECHO > $output "\
-# $outputname - a libtool library file
-# Generated by $PROGRAM (GNU $PACKAGE) $VERSION
-#
-# Please DO NOT delete this file!
-# It is necessary for linking the library.
-
-# The name that we can dlopen(3).
-dlname='$tdlname'
-
-# Names of this library.
-library_names='$library_names'
-
-# The name of the static archive.
-old_library='$old_library'
-
-# Linker flags that cannot go in dependency_libs.
-inherited_linker_flags='$new_inherited_linker_flags'
-
-# Libraries that this one depends upon.
-dependency_libs='$dependency_libs'
-
-# Names of additional weak libraries provided by this library
-weak_library_names='$weak_libs'
-
-# Version information for $libname.
-current=$current
-age=$age
-revision=$revision
-
-# Is this an already installed library?
-installed=$installed
-
-# Should we warn about portability when linking against -modules?
-shouldnotlink=$module
-
-# Files to dlopen/dlpreopen
-dlopen='$dlfiles'
-dlpreopen='$dlprefiles'
-
-# Directory that this library needs to be installed in:
-libdir='$install_libdir'"
-	  if test no,yes = "$installed,$need_relink"; then
-	    $ECHO >> $output "\
-relink_command=\"$relink_command\""
-	  fi
-	done
-      }
-
-      # Do a symbolic link so that the libtool archive can be found in
-      # LD_LIBRARY_PATH before the program is installed.
-      func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?'
-      ;;
-    esac
-    exit $EXIT_SUCCESS
-}
-
-if test link = "$opt_mode" || test relink = "$opt_mode"; then
-  func_mode_link ${1+"$@"}
-fi
-
-
-# func_mode_uninstall arg...
-func_mode_uninstall ()
-{
-    $debug_cmd
-
-    RM=$nonopt
-    files=
-    rmforce=false
-    exit_status=0
-
-    # This variable tells wrapper scripts just to set variables rather
-    # than running their programs.
-    libtool_install_magic=$magic
-
-    for arg
-    do
-      case $arg in
-      -f) func_append RM " $arg"; rmforce=: ;;
-      -*) func_append RM " $arg" ;;
-      *) func_append files " $arg" ;;
-      esac
-    done
-
-    test -z "$RM" && \
-      func_fatal_help "you must specify an RM program"
-
-    rmdirs=
-
-    for file in $files; do
-      func_dirname "$file" "" "."
-      dir=$func_dirname_result
-      if test . = "$dir"; then
-	odir=$objdir
-      else
-	odir=$dir/$objdir
-      fi
-      func_basename "$file"
-      name=$func_basename_result
-      test uninstall = "$opt_mode" && odir=$dir
-
-      # Remember odir for removal later, being careful to avoid duplicates
-      if test clean = "$opt_mode"; then
-	case " $rmdirs " in
-	  *" $odir "*) ;;
-	  *) func_append rmdirs " $odir" ;;
-	esac
-      fi
-
-      # Don't error if the file doesn't exist and rm -f was used.
-      if { test -L "$file"; } >/dev/null 2>&1 ||
-	 { test -h "$file"; } >/dev/null 2>&1 ||
-	 test -f "$file"; then
-	:
-      elif test -d "$file"; then
-	exit_status=1
-	continue
-      elif $rmforce; then
-	continue
-      fi
-
-      rmfiles=$file
-
-      case $name in
-      *.la)
-	# Possibly a libtool archive, so verify it.
-	if func_lalib_p "$file"; then
-	  func_source $dir/$name
-
-	  # Delete the libtool libraries and symlinks.
-	  for n in $library_names; do
-	    func_append rmfiles " $odir/$n"
-	  done
-	  test -n "$old_library" && func_append rmfiles " $odir/$old_library"
-
-	  case $opt_mode in
-	  clean)
-	    case " $library_names " in
-	    *" $dlname "*) ;;
-	    *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;;
-	    esac
-	    test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i"
-	    ;;
-	  uninstall)
-	    if test -n "$library_names"; then
-	      # Do each command in the postuninstall commands.
-	      func_execute_cmds "$postuninstall_cmds" '$rmforce || exit_status=1'
-	    fi
-
-	    if test -n "$old_library"; then
-	      # Do each command in the old_postuninstall commands.
-	      func_execute_cmds "$old_postuninstall_cmds" '$rmforce || exit_status=1'
-	    fi
-	    # FIXME: should reinstall the best remaining shared library.
-	    ;;
-	  esac
-	fi
-	;;
-
-      *.lo)
-	# Possibly a libtool object, so verify it.
-	if func_lalib_p "$file"; then
-
-	  # Read the .lo file
-	  func_source $dir/$name
-
-	  # Add PIC object to the list of files to remove.
-	  if test -n "$pic_object" && test none != "$pic_object"; then
-	    func_append rmfiles " $dir/$pic_object"
-	  fi
-
-	  # Add non-PIC object to the list of files to remove.
-	  if test -n "$non_pic_object" && test none != "$non_pic_object"; then
-	    func_append rmfiles " $dir/$non_pic_object"
-	  fi
-	fi
-	;;
-
-      *)
-	if test clean = "$opt_mode"; then
-	  noexename=$name
-	  case $file in
-	  *.exe)
-	    func_stripname '' '.exe' "$file"
-	    file=$func_stripname_result
-	    func_stripname '' '.exe' "$name"
-	    noexename=$func_stripname_result
-	    # $file with .exe has already been added to rmfiles,
-	    # add $file without .exe
-	    func_append rmfiles " $file"
-	    ;;
-	  esac
-	  # Do a test to see if this is a libtool program.
-	  if func_ltwrapper_p "$file"; then
-	    if func_ltwrapper_executable_p "$file"; then
-	      func_ltwrapper_scriptname "$file"
-	      relink_command=
-	      func_source $func_ltwrapper_scriptname_result
-	      func_append rmfiles " $func_ltwrapper_scriptname_result"
-	    else
-	      relink_command=
-	      func_source $dir/$noexename
-	    fi
-
-	    # note $name still contains .exe if it was in $file originally
-	    # as does the version of $file that was added into $rmfiles
-	    func_append rmfiles " $odir/$name $odir/${name}S.$objext"
-	    if test yes = "$fast_install" && test -n "$relink_command"; then
-	      func_append rmfiles " $odir/lt-$name"
-	    fi
-	    if test "X$noexename" != "X$name"; then
-	      func_append rmfiles " $odir/lt-$noexename.c"
-	    fi
-	  fi
-	fi
-	;;
-      esac
-      func_show_eval "$RM $rmfiles" 'exit_status=1'
-    done
-
-    # Try to remove the $objdir's in the directories where we deleted files
-    for dir in $rmdirs; do
-      if test -d "$dir"; then
-	func_show_eval "rmdir $dir >/dev/null 2>&1"
-      fi
-    done
-
-    exit $exit_status
-}
-
-if test uninstall = "$opt_mode" || test clean = "$opt_mode"; then
-  func_mode_uninstall ${1+"$@"}
-fi
-
-test -z "$opt_mode" && {
-  help=$generic_help
-  func_fatal_help "you must specify a MODE"
-}
-
-test -z "$exec_cmd" && \
-  func_fatal_help "invalid operation mode '$opt_mode'"
-
-if test -n "$exec_cmd"; then
-  eval exec "$exec_cmd"
-  exit $EXIT_FAILURE
-fi
-
-exit $exit_status
-
-
-# The TAGs below are defined such that we never get into a situation
-# where we disable both kinds of libraries.  Given conflicting
-# choices, we go for a static library, that is the most portable,
-# since we can't tell whether shared libraries were disabled because
-# the user asked for that or because the platform doesn't support
-# them.  This is particularly important on AIX, because we don't
-# support having both static and shared libraries enabled at the same
-# time on that platform, so we default to a shared-only configuration.
-# If a disable-shared tag is given, we'll fallback to a static-only
-# configuration.  But we'll never go from static-only to shared-only.
-
-# ### BEGIN LIBTOOL TAG CONFIG: disable-shared
-build_libtool_libs=no
-build_old_libs=yes
-# ### END LIBTOOL TAG CONFIG: disable-shared
-
-# ### BEGIN LIBTOOL TAG CONFIG: disable-static
-build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
-# ### END LIBTOOL TAG CONFIG: disable-static
-
-# Local Variables:
-# mode:shell-script
-# sh-indentation:2
-# End:
diff --git a/ltmain.sh b/ltmain.sh
deleted file mode 100644
index 0f0a2da..0000000
--- a/ltmain.sh
+++ /dev/null
@@ -1,11147 +0,0 @@
-#! /bin/sh
-## DO NOT EDIT - This file generated from ./build-aux/ltmain.in
-##               by inline-source v2014-01-03.01
-
-# libtool (GNU libtool) 2.4.6
-# Provide generalized library-building support services.
-# Written by Gordon Matzigkeit <gord at gnu.ai.mit.edu>, 1996
-
-# Copyright (C) 1996-2015 Free Software Foundation, Inc.
-# This is free software; see the source for copying conditions.  There is NO
-# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
-# GNU Libtool is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# As a special exception to the GNU General Public License,
-# if you distribute this file as part of a program or library that
-# is built using GNU Libtool, you may include this file under the
-# same distribution terms that you use for the rest of that program.
-#
-# GNU Libtool is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-
-PROGRAM=libtool
-PACKAGE=libtool
-VERSION=2.4.6
-package_revision=2.4.6
-
-
-## ------ ##
-## Usage. ##
-## ------ ##
-
-# Run './libtool --help' for help with using this script from the
-# command line.
-
-
-## ------------------------------- ##
-## User overridable command paths. ##
-## ------------------------------- ##
-
-# After configure completes, it has a better idea of some of the
-# shell tools we need than the defaults used by the functions shared
-# with bootstrap, so set those here where they can still be over-
-# ridden by the user, but otherwise take precedence.
-
-: ${AUTOCONF="autoconf"}
-: ${AUTOMAKE="automake"}
-
-
-## -------------------------- ##
-## Source external libraries. ##
-## -------------------------- ##
-
-# Much of our low-level functionality needs to be sourced from external
-# libraries, which are installed to $pkgauxdir.
-
-# Set a version string for this script.
-scriptversion=2015-01-20.17; # UTC
-
-# General shell script boiler plate, and helper functions.
-# Written by Gary V. Vaughan, 2004
-
-# Copyright (C) 2004-2015 Free Software Foundation, Inc.
-# This is free software; see the source for copying conditions.  There is NO
-# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-
-# As a special exception to the GNU General Public License, if you distribute
-# this file as part of a program or library that is built using GNU Libtool,
-# you may include this file under the same distribution terms that you use
-# for the rest of that program.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNES FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-# Please report bugs or propose patches to gary at gnu.org.
-
-
-## ------ ##
-## Usage. ##
-## ------ ##
-
-# Evaluate this file near the top of your script to gain access to
-# the functions and variables defined here:
-#
-#   . `echo "$0" | ${SED-sed} 's|[^/]*$||'`/build-aux/funclib.sh
-#
-# If you need to override any of the default environment variable
-# settings, do that before evaluating this file.
-
-
-## -------------------- ##
-## Shell normalisation. ##
-## -------------------- ##
-
-# Some shells need a little help to be as Bourne compatible as possible.
-# Before doing anything else, make sure all that help has been provided!
-
-DUALCASE=1; export DUALCASE # for MKS sh
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
-  emulate sh
-  NULLCMD=:
-  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
-  # is contrary to our usage.  Disable this feature.
-  alias -g '${1+"$@"}'='"$@"'
-  setopt NO_GLOB_SUBST
-else
-  case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac
-fi
-
-# NLS nuisances: We save the old values in case they are required later.
-_G_user_locale=
-_G_safe_locale=
-for _G_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
-do
-  eval "if test set = \"\${$_G_var+set}\"; then
-          save_$_G_var=\$$_G_var
-          $_G_var=C
-	  export $_G_var
-	  _G_user_locale=\"$_G_var=\\\$save_\$_G_var; \$_G_user_locale\"
-	  _G_safe_locale=\"$_G_var=C; \$_G_safe_locale\"
-	fi"
-done
-
-# CDPATH.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-# Make sure IFS has a sensible default
-sp=' '
-nl='
-'
-IFS="$sp	$nl"
-
-# There are apparently some retarded systems that use ';' as a PATH separator!
-if test "${PATH_SEPARATOR+set}" != set; then
-  PATH_SEPARATOR=:
-  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
-    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
-      PATH_SEPARATOR=';'
-  }
-fi
-
-
-
-## ------------------------- ##
-## Locate command utilities. ##
-## ------------------------- ##
-
-
-# func_executable_p FILE
-# ----------------------
-# Check that FILE is an executable regular file.
-func_executable_p ()
-{
-    test -f "$1" && test -x "$1"
-}
-
-
-# func_path_progs PROGS_LIST CHECK_FUNC [PATH]
-# --------------------------------------------
-# Search for either a program that responds to --version with output
-# containing "GNU", or else returned by CHECK_FUNC otherwise, by
-# trying all the directories in PATH with each of the elements of
-# PROGS_LIST.
-#
-# CHECK_FUNC should accept the path to a candidate program, and
-# set $func_check_prog_result if it truncates its output less than
-# $_G_path_prog_max characters.
-func_path_progs ()
-{
-    _G_progs_list=$1
-    _G_check_func=$2
-    _G_PATH=${3-"$PATH"}
-
-    _G_path_prog_max=0
-    _G_path_prog_found=false
-    _G_save_IFS=$IFS; IFS=${PATH_SEPARATOR-:}
-    for _G_dir in $_G_PATH; do
-      IFS=$_G_save_IFS
-      test -z "$_G_dir" && _G_dir=.
-      for _G_prog_name in $_G_progs_list; do
-        for _exeext in '' .EXE; do
-          _G_path_prog=$_G_dir/$_G_prog_name$_exeext
-          func_executable_p "$_G_path_prog" || continue
-          case `"$_G_path_prog" --version 2>&1` in
-            *GNU*) func_path_progs_result=$_G_path_prog _G_path_prog_found=: ;;
-            *)     $_G_check_func $_G_path_prog
-		   func_path_progs_result=$func_check_prog_result
-		   ;;
-          esac
-          $_G_path_prog_found && break 3
-        done
-      done
-    done
-    IFS=$_G_save_IFS
-    test -z "$func_path_progs_result" && {
-      echo "no acceptable sed could be found in \$PATH" >&2
-      exit 1
-    }
-}
-
-
-# We want to be able to use the functions in this file before configure
-# has figured out where the best binaries are kept, which means we have
-# to search for them ourselves - except when the results are already set
-# where we skip the searches.
-
-# Unless the user overrides by setting SED, search the path for either GNU
-# sed, or the sed that truncates its output the least.
-test -z "$SED" && {
-  _G_sed_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
-  for _G_i in 1 2 3 4 5 6 7; do
-    _G_sed_script=$_G_sed_script$nl$_G_sed_script
-  done
-  echo "$_G_sed_script" 2>/dev/null | sed 99q >conftest.sed
-  _G_sed_script=
-
-  func_check_prog_sed ()
-  {
-    _G_path_prog=$1
-
-    _G_count=0
-    printf 0123456789 >conftest.in
-    while :
-    do
-      cat conftest.in conftest.in >conftest.tmp
-      mv conftest.tmp conftest.in
-      cp conftest.in conftest.nl
-      echo '' >> conftest.nl
-      "$_G_path_prog" -f conftest.sed <conftest.nl >conftest.out 2>/dev/null || break
-      diff conftest.out conftest.nl >/dev/null 2>&1 || break
-      _G_count=`expr $_G_count + 1`
-      if test "$_G_count" -gt "$_G_path_prog_max"; then
-        # Best one so far, save it but keep looking for a better one
-        func_check_prog_result=$_G_path_prog
-        _G_path_prog_max=$_G_count
-      fi
-      # 10*(2^10) chars as input seems more than enough
-      test 10 -lt "$_G_count" && break
-    done
-    rm -f conftest.in conftest.tmp conftest.nl conftest.out
-  }
-
-  func_path_progs "sed gsed" func_check_prog_sed $PATH:/usr/xpg4/bin
-  rm -f conftest.sed
-  SED=$func_path_progs_result
-}
-
-
-# Unless the user overrides by setting GREP, search the path for either GNU
-# grep, or the grep that truncates its output the least.
-test -z "$GREP" && {
-  func_check_prog_grep ()
-  {
-    _G_path_prog=$1
-
-    _G_count=0
-    _G_path_prog_max=0
-    printf 0123456789 >conftest.in
-    while :
-    do
-      cat conftest.in conftest.in >conftest.tmp
-      mv conftest.tmp conftest.in
-      cp conftest.in conftest.nl
-      echo 'GREP' >> conftest.nl
-      "$_G_path_prog" -e 'GREP$' -e '-(cannot match)-' <conftest.nl >conftest.out 2>/dev/null || break
-      diff conftest.out conftest.nl >/dev/null 2>&1 || break
-      _G_count=`expr $_G_count + 1`
-      if test "$_G_count" -gt "$_G_path_prog_max"; then
-        # Best one so far, save it but keep looking for a better one
-        func_check_prog_result=$_G_path_prog
-        _G_path_prog_max=$_G_count
-      fi
-      # 10*(2^10) chars as input seems more than enough
-      test 10 -lt "$_G_count" && break
-    done
-    rm -f conftest.in conftest.tmp conftest.nl conftest.out
-  }
-
-  func_path_progs "grep ggrep" func_check_prog_grep $PATH:/usr/xpg4/bin
-  GREP=$func_path_progs_result
-}
-
-
-## ------------------------------- ##
-## User overridable command paths. ##
-## ------------------------------- ##
-
-# All uppercase variable names are used for environment variables.  These
-# variables can be overridden by the user before calling a script that
-# uses them if a suitable command of that name is not already available
-# in the command search PATH.
-
-: ${CP="cp -f"}
-: ${ECHO="printf %s\n"}
-: ${EGREP="$GREP -E"}
-: ${FGREP="$GREP -F"}
-: ${LN_S="ln -s"}
-: ${MAKE="make"}
-: ${MKDIR="mkdir"}
-: ${MV="mv -f"}
-: ${RM="rm -f"}
-: ${SHELL="${CONFIG_SHELL-/bin/sh}"}
-
-
-## -------------------- ##
-## Useful sed snippets. ##
-## -------------------- ##
-
-sed_dirname='s|/[^/]*$||'
-sed_basename='s|^.*/||'
-
-# Sed substitution that helps us do robust quoting.  It backslashifies
-# metacharacters that are still active within double-quoted strings.
-sed_quote_subst='s|\([`"$\\]\)|\\\1|g'
-
-# Same as above, but do not quote variable references.
-sed_double_quote_subst='s/\(["`\\]\)/\\\1/g'
-
-# Sed substitution that turns a string into a regex matching for the
-# string literally.
-sed_make_literal_regex='s|[].[^$\\*\/]|\\&|g'
-
-# Sed substitution that converts a w32 file name or path
-# that contains forward slashes, into one that contains
-# (escaped) backslashes.  A very naive implementation.
-sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
-
-# Re-'\' parameter expansions in output of sed_double_quote_subst that
-# were '\'-ed in input to the same.  If an odd number of '\' preceded a
-# '$' in input to sed_double_quote_subst, that '$' was protected from
-# expansion.  Since each input '\' is now two '\'s, look for any number
-# of runs of four '\'s followed by two '\'s and then a '$'.  '\' that '$'.
-_G_bs='\\'
-_G_bs2='\\\\'
-_G_bs4='\\\\\\\\'
-_G_dollar='\$'
-sed_double_backslash="\
-  s/$_G_bs4/&\\
-/g
-  s/^$_G_bs2$_G_dollar/$_G_bs&/
-  s/\\([^$_G_bs]\\)$_G_bs2$_G_dollar/\\1$_G_bs2$_G_bs$_G_dollar/g
-  s/\n//g"
-
-
-## ----------------- ##
-## Global variables. ##
-## ----------------- ##
-
-# Except for the global variables explicitly listed below, the following
-# functions in the '^func_' namespace, and the '^require_' namespace
-# variables initialised in the 'Resource management' section, sourcing
-# this file will not pollute your global namespace with anything
-# else. There's no portable way to scope variables in Bourne shell
-# though, so actually running these functions will sometimes place
-# results into a variable named after the function, and often use
-# temporary variables in the '^_G_' namespace. If you are careful to
-# avoid using those namespaces casually in your sourcing script, things
-# should continue to work as you expect. And, of course, you can freely
-# overwrite any of the functions or variables defined here before
-# calling anything to customize them.
-
-EXIT_SUCCESS=0
-EXIT_FAILURE=1
-EXIT_MISMATCH=63  # $? = 63 is used to indicate version mismatch to missing.
-EXIT_SKIP=77	  # $? = 77 is used to indicate a skipped test to automake.
-
-# Allow overriding, eg assuming that you follow the convention of
-# putting '$debug_cmd' at the start of all your functions, you can get
-# bash to show function call trace with:
-#
-#    debug_cmd='eval echo "${FUNCNAME[0]} $*" >&2' bash your-script-name
-debug_cmd=${debug_cmd-":"}
-exit_cmd=:
-
-# By convention, finish your script with:
-#
-#    exit $exit_status
-#
-# so that you can set exit_status to non-zero if you want to indicate
-# something went wrong during execution without actually bailing out at
-# the point of failure.
-exit_status=$EXIT_SUCCESS
-
-# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
-# is ksh but when the shell is invoked as "sh" and the current value of
-# the _XPG environment variable is not equal to 1 (one), the special
-# positional parameter $0, within a function call, is the name of the
-# function.
-progpath=$0
-
-# The name of this program.
-progname=`$ECHO "$progpath" |$SED "$sed_basename"`
-
-# Make sure we have an absolute progpath for reexecution:
-case $progpath in
-  [\\/]*|[A-Za-z]:\\*) ;;
-  *[\\/]*)
-     progdir=`$ECHO "$progpath" |$SED "$sed_dirname"`
-     progdir=`cd "$progdir" && pwd`
-     progpath=$progdir/$progname
-     ;;
-  *)
-     _G_IFS=$IFS
-     IFS=${PATH_SEPARATOR-:}
-     for progdir in $PATH; do
-       IFS=$_G_IFS
-       test -x "$progdir/$progname" && break
-     done
-     IFS=$_G_IFS
-     test -n "$progdir" || progdir=`pwd`
-     progpath=$progdir/$progname
-     ;;
-esac
-
-
-## ----------------- ##
-## Standard options. ##
-## ----------------- ##
-
-# The following options affect the operation of the functions defined
-# below, and should be set appropriately depending on run-time para-
-# meters passed on the command line.
-
-opt_dry_run=false
-opt_quiet=false
-opt_verbose=false
-
-# Categories 'all' and 'none' are always available.  Append any others
-# you will pass as the first argument to func_warning from your own
-# code.
-warning_categories=
-
-# By default, display warnings according to 'opt_warning_types'.  Set
-# 'warning_func'  to ':' to elide all warnings, or func_fatal_error to
-# treat the next displayed warning as a fatal error.
-warning_func=func_warn_and_continue
-
-# Set to 'all' to display all warnings, 'none' to suppress all
-# warnings, or a space delimited list of some subset of
-# 'warning_categories' to display only the listed warnings.
-opt_warning_types=all
-
-
-## -------------------- ##
-## Resource management. ##
-## -------------------- ##
-
-# This section contains definitions for functions that each ensure a
-# particular resource (a file, or a non-empty configuration variable for
-# example) is available, and if appropriate to extract default values
-# from pertinent package files. Call them using their associated
-# 'require_*' variable to ensure that they are executed, at most, once.
-#
-# It's entirely deliberate that calling these functions can set
-# variables that don't obey the namespace limitations obeyed by the rest
-# of this file, in order that that they be as useful as possible to
-# callers.
-
-
-# require_term_colors
-# -------------------
-# Allow display of bold text on terminals that support it.
-require_term_colors=func_require_term_colors
-func_require_term_colors ()
-{
-    $debug_cmd
-
-    test -t 1 && {
-      # COLORTERM and USE_ANSI_COLORS environment variables take
-      # precedence, because most terminfo databases neglect to describe
-      # whether color sequences are supported.
-      test -n "${COLORTERM+set}" && : ${USE_ANSI_COLORS="1"}
-
-      if test 1 = "$USE_ANSI_COLORS"; then
-        # Standard ANSI escape sequences
-        tc_reset=''
-        tc_bold='';   tc_standout=''
-        tc_red='';   tc_green=''
-        tc_blue='';  tc_cyan=''
-      else
-        # Otherwise trust the terminfo database after all.
-        test -n "`tput sgr0 2>/dev/null`" && {
-          tc_reset=`tput sgr0`
-          test -n "`tput bold 2>/dev/null`" && tc_bold=`tput bold`
-          tc_standout=$tc_bold
-          test -n "`tput smso 2>/dev/null`" && tc_standout=`tput smso`
-          test -n "`tput setaf 1 2>/dev/null`" && tc_red=`tput setaf 1`
-          test -n "`tput setaf 2 2>/dev/null`" && tc_green=`tput setaf 2`
-          test -n "`tput setaf 4 2>/dev/null`" && tc_blue=`tput setaf 4`
-          test -n "`tput setaf 5 2>/dev/null`" && tc_cyan=`tput setaf 5`
-        }
-      fi
-    }
-
-    require_term_colors=:
-}
-
-
-## ----------------- ##
-## Function library. ##
-## ----------------- ##
-
-# This section contains a variety of useful functions to call in your
-# scripts. Take note of the portable wrappers for features provided by
-# some modern shells, which will fall back to slower equivalents on
-# less featureful shells.
-
-
-# func_append VAR VALUE
-# ---------------------
-# Append VALUE onto the existing contents of VAR.
-
-  # We should try to minimise forks, especially on Windows where they are
-  # unreasonably slow, so skip the feature probes when bash or zsh are
-  # being used:
-  if test set = "${BASH_VERSION+set}${ZSH_VERSION+set}"; then
-    : ${_G_HAVE_ARITH_OP="yes"}
-    : ${_G_HAVE_XSI_OPS="yes"}
-    # The += operator was introduced in bash 3.1
-    case $BASH_VERSION in
-      [12].* | 3.0 | 3.0*) ;;
-      *)
-        : ${_G_HAVE_PLUSEQ_OP="yes"}
-        ;;
-    esac
-  fi
-
-  # _G_HAVE_PLUSEQ_OP
-  # Can be empty, in which case the shell is probed, "yes" if += is
-  # useable or anything else if it does not work.
-  test -z "$_G_HAVE_PLUSEQ_OP" \
-    && (eval 'x=a; x+=" b"; test "a b" = "$x"') 2>/dev/null \
-    && _G_HAVE_PLUSEQ_OP=yes
-
-if test yes = "$_G_HAVE_PLUSEQ_OP"
-then
-  # This is an XSI compatible shell, allowing a faster implementation...
-  eval 'func_append ()
-  {
-    $debug_cmd
-
-    eval "$1+=\$2"
-  }'
-else
-  # ...otherwise fall back to using expr, which is often a shell builtin.
-  func_append ()
-  {
-    $debug_cmd
-
-    eval "$1=\$$1\$2"
-  }
-fi
-
-
-# func_append_quoted VAR VALUE
-# ----------------------------
-# Quote VALUE and append to the end of shell variable VAR, separated
-# by a space.
-if test yes = "$_G_HAVE_PLUSEQ_OP"; then
-  eval 'func_append_quoted ()
-  {
-    $debug_cmd
-
-    func_quote_for_eval "$2"
-    eval "$1+=\\ \$func_quote_for_eval_result"
-  }'
-else
-  func_append_quoted ()
-  {
-    $debug_cmd
-
-    func_quote_for_eval "$2"
-    eval "$1=\$$1\\ \$func_quote_for_eval_result"
-  }
-fi
-
-
-# func_append_uniq VAR VALUE
-# --------------------------
-# Append unique VALUE onto the existing contents of VAR, assuming
-# entries are delimited by the first character of VALUE.  For example:
-#
-#   func_append_uniq options " --another-option option-argument"
-#
-# will only append to $options if " --another-option option-argument "
-# is not already present somewhere in $options already (note spaces at
-# each end implied by leading space in second argument).
-func_append_uniq ()
-{
-    $debug_cmd
-
-    eval _G_current_value='`$ECHO $'$1'`'
-    _G_delim=`expr "$2" : '\(.\)'`
-
-    case $_G_delim$_G_current_value$_G_delim in
-      *"$2$_G_delim"*) ;;
-      *) func_append "$@" ;;
-    esac
-}
-
-
-# func_arith TERM...
-# ------------------
-# Set func_arith_result to the result of evaluating TERMs.
-  test -z "$_G_HAVE_ARITH_OP" \
-    && (eval 'test 2 = $(( 1 + 1 ))') 2>/dev/null \
-    && _G_HAVE_ARITH_OP=yes
-
-if test yes = "$_G_HAVE_ARITH_OP"; then
-  eval 'func_arith ()
-  {
-    $debug_cmd
-
-    func_arith_result=$(( $* ))
-  }'
-else
-  func_arith ()
-  {
-    $debug_cmd
-
-    func_arith_result=`expr "$@"`
-  }
-fi
-
-
-# func_basename FILE
-# ------------------
-# Set func_basename_result to FILE with everything up to and including
-# the last / stripped.
-if test yes = "$_G_HAVE_XSI_OPS"; then
-  # If this shell supports suffix pattern removal, then use it to avoid
-  # forking. Hide the definitions single quotes in case the shell chokes
-  # on unsupported syntax...
-  _b='func_basename_result=${1##*/}'
-  _d='case $1 in
-        */*) func_dirname_result=${1%/*}$2 ;;
-        *  ) func_dirname_result=$3        ;;
-      esac'
-
-else
-  # ...otherwise fall back to using sed.
-  _b='func_basename_result=`$ECHO "$1" |$SED "$sed_basename"`'
-  _d='func_dirname_result=`$ECHO "$1"  |$SED "$sed_dirname"`
-      if test "X$func_dirname_result" = "X$1"; then
-        func_dirname_result=$3
-      else
-        func_append func_dirname_result "$2"
-      fi'
-fi
-
-eval 'func_basename ()
-{
-    $debug_cmd
-
-    '"$_b"'
-}'
-
-
-# func_dirname FILE APPEND NONDIR_REPLACEMENT
-# -------------------------------------------
-# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
-# otherwise set result to NONDIR_REPLACEMENT.
-eval 'func_dirname ()
-{
-    $debug_cmd
-
-    '"$_d"'
-}'
-
-
-# func_dirname_and_basename FILE APPEND NONDIR_REPLACEMENT
-# --------------------------------------------------------
-# Perform func_basename and func_dirname in a single function
-# call:
-#   dirname:  Compute the dirname of FILE.  If nonempty,
-#             add APPEND to the result, otherwise set result
-#             to NONDIR_REPLACEMENT.
-#             value returned in "$func_dirname_result"
-#   basename: Compute filename of FILE.
-#             value retuned in "$func_basename_result"
-# For efficiency, we do not delegate to the functions above but instead
-# duplicate the functionality here.
-eval 'func_dirname_and_basename ()
-{
-    $debug_cmd
-
-    '"$_b"'
-    '"$_d"'
-}'
-
-
-# func_echo ARG...
-# ----------------
-# Echo program name prefixed message.
-func_echo ()
-{
-    $debug_cmd
-
-    _G_message=$*
-
-    func_echo_IFS=$IFS
-    IFS=$nl
-    for _G_line in $_G_message; do
-      IFS=$func_echo_IFS
-      $ECHO "$progname: $_G_line"
-    done
-    IFS=$func_echo_IFS
-}
-
-
-# func_echo_all ARG...
-# --------------------
-# Invoke $ECHO with all args, space-separated.
-func_echo_all ()
-{
-    $ECHO "$*"
-}
-
-
-# func_echo_infix_1 INFIX ARG...
-# ------------------------------
-# Echo program name, followed by INFIX on the first line, with any
-# additional lines not showing INFIX.
-func_echo_infix_1 ()
-{
-    $debug_cmd
-
-    $require_term_colors
-
-    _G_infix=$1; shift
-    _G_indent=$_G_infix
-    _G_prefix="$progname: $_G_infix: "
-    _G_message=$*
-
-    # Strip color escape sequences before counting printable length
-    for _G_tc in "$tc_reset" "$tc_bold" "$tc_standout" "$tc_red" "$tc_green" "$tc_blue" "$tc_cyan"
-    do
-      test -n "$_G_tc" && {
-        _G_esc_tc=`$ECHO "$_G_tc" | $SED "$sed_make_literal_regex"`
-        _G_indent=`$ECHO "$_G_indent" | $SED "s|$_G_esc_tc||g"`
-      }
-    done
-    _G_indent="$progname: "`echo "$_G_indent" | $SED 's|.| |g'`"  " ## exclude from sc_prohibit_nested_quotes
-
-    func_echo_infix_1_IFS=$IFS
-    IFS=$nl
-    for _G_line in $_G_message; do
-      IFS=$func_echo_infix_1_IFS
-      $ECHO "$_G_prefix$tc_bold$_G_line$tc_reset" >&2
-      _G_prefix=$_G_indent
-    done
-    IFS=$func_echo_infix_1_IFS
-}
-
-
-# func_error ARG...
-# -----------------
-# Echo program name prefixed message to standard error.
-func_error ()
-{
-    $debug_cmd
-
-    $require_term_colors
-
-    func_echo_infix_1 "  $tc_standout${tc_red}error$tc_reset" "$*" >&2
-}
-
-
-# func_fatal_error ARG...
-# -----------------------
-# Echo program name prefixed message to standard error, and exit.
-func_fatal_error ()
-{
-    $debug_cmd
-
-    func_error "$*"
-    exit $EXIT_FAILURE
-}
-
-
-# func_grep EXPRESSION FILENAME
-# -----------------------------
-# Check whether EXPRESSION matches any line of FILENAME, without output.
-func_grep ()
-{
-    $debug_cmd
-
-    $GREP "$1" "$2" >/dev/null 2>&1
-}
-
-
-# func_len STRING
-# ---------------
-# Set func_len_result to the length of STRING. STRING may not
-# start with a hyphen.
-  test -z "$_G_HAVE_XSI_OPS" \
-    && (eval 'x=a/b/c;
-      test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \
-    && _G_HAVE_XSI_OPS=yes
-
-if test yes = "$_G_HAVE_XSI_OPS"; then
-  eval 'func_len ()
-  {
-    $debug_cmd
-
-    func_len_result=${#1}
-  }'
-else
-  func_len ()
-  {
-    $debug_cmd
-
-    func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len`
-  }
-fi
-
-
-# func_mkdir_p DIRECTORY-PATH
-# ---------------------------
-# Make sure the entire path to DIRECTORY-PATH is available.
-func_mkdir_p ()
-{
-    $debug_cmd
-
-    _G_directory_path=$1
-    _G_dir_list=
-
-    if test -n "$_G_directory_path" && test : != "$opt_dry_run"; then
-
-      # Protect directory names starting with '-'
-      case $_G_directory_path in
-        -*) _G_directory_path=./$_G_directory_path ;;
-      esac
-
-      # While some portion of DIR does not yet exist...
-      while test ! -d "$_G_directory_path"; do
-        # ...make a list in topmost first order.  Use a colon delimited
-	# list incase some portion of path contains whitespace.
-        _G_dir_list=$_G_directory_path:$_G_dir_list
-
-        # If the last portion added has no slash in it, the list is done
-        case $_G_directory_path in */*) ;; *) break ;; esac
-
-        # ...otherwise throw away the child directory and loop
-        _G_directory_path=`$ECHO "$_G_directory_path" | $SED -e "$sed_dirname"`
-      done
-      _G_dir_list=`$ECHO "$_G_dir_list" | $SED 's|:*$||'`
-
-      func_mkdir_p_IFS=$IFS; IFS=:
-      for _G_dir in $_G_dir_list; do
-	IFS=$func_mkdir_p_IFS
-        # mkdir can fail with a 'File exist' error if two processes
-        # try to create one of the directories concurrently.  Don't
-        # stop in that case!
-        $MKDIR "$_G_dir" 2>/dev/null || :
-      done
-      IFS=$func_mkdir_p_IFS
-
-      # Bail out if we (or some other process) failed to create a directory.
-      test -d "$_G_directory_path" || \
-        func_fatal_error "Failed to create '$1'"
-    fi
-}
-
-
-# func_mktempdir [BASENAME]
-# -------------------------
-# Make a temporary directory that won't clash with other running
-# libtool processes, and avoids race conditions if possible.  If
-# given, BASENAME is the basename for that directory.
-func_mktempdir ()
-{
-    $debug_cmd
-
-    _G_template=${TMPDIR-/tmp}/${1-$progname}
-
-    if test : = "$opt_dry_run"; then
-      # Return a directory name, but don't create it in dry-run mode
-      _G_tmpdir=$_G_template-$$
-    else
-
-      # If mktemp works, use that first and foremost
-      _G_tmpdir=`mktemp -d "$_G_template-XXXXXXXX" 2>/dev/null`
-
-      if test ! -d "$_G_tmpdir"; then
-        # Failing that, at least try and use $RANDOM to avoid a race
-        _G_tmpdir=$_G_template-${RANDOM-0}$$
-
-        func_mktempdir_umask=`umask`
-        umask 0077
-        $MKDIR "$_G_tmpdir"
-        umask $func_mktempdir_umask
-      fi
-
-      # If we're not in dry-run mode, bomb out on failure
-      test -d "$_G_tmpdir" || \
-        func_fatal_error "cannot create temporary directory '$_G_tmpdir'"
-    fi
-
-    $ECHO "$_G_tmpdir"
-}
-
-
-# func_normal_abspath PATH
-# ------------------------
-# Remove doubled-up and trailing slashes, "." path components,
-# and cancel out any ".." path components in PATH after making
-# it an absolute path.
-func_normal_abspath ()
-{
-    $debug_cmd
-
-    # These SED scripts presuppose an absolute path with a trailing slash.
-    _G_pathcar='s|^/\([^/]*\).*$|\1|'
-    _G_pathcdr='s|^/[^/]*||'
-    _G_removedotparts=':dotsl
-		s|/\./|/|g
-		t dotsl
-		s|/\.$|/|'
-    _G_collapseslashes='s|/\{1,\}|/|g'
-    _G_finalslash='s|/*$|/|'
-
-    # Start from root dir and reassemble the path.
-    func_normal_abspath_result=
-    func_normal_abspath_tpath=$1
-    func_normal_abspath_altnamespace=
-    case $func_normal_abspath_tpath in
-      "")
-        # Empty path, that just means $cwd.
-        func_stripname '' '/' "`pwd`"
-        func_normal_abspath_result=$func_stripname_result
-        return
-        ;;
-      # The next three entries are used to spot a run of precisely
-      # two leading slashes without using negated character classes;
-      # we take advantage of case's first-match behaviour.
-      ///*)
-        # Unusual form of absolute path, do nothing.
-        ;;
-      //*)
-        # Not necessarily an ordinary path; POSIX reserves leading '//'
-        # and for example Cygwin uses it to access remote file shares
-        # over CIFS/SMB, so we conserve a leading double slash if found.
-        func_normal_abspath_altnamespace=/
-        ;;
-      /*)
-        # Absolute path, do nothing.
-        ;;
-      *)
-        # Relative path, prepend $cwd.
-        func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath
-        ;;
-    esac
-
-    # Cancel out all the simple stuff to save iterations.  We also want
-    # the path to end with a slash for ease of parsing, so make sure
-    # there is one (and only one) here.
-    func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
-          -e "$_G_removedotparts" -e "$_G_collapseslashes" -e "$_G_finalslash"`
-    while :; do
-      # Processed it all yet?
-      if test / = "$func_normal_abspath_tpath"; then
-        # If we ascended to the root using ".." the result may be empty now.
-        if test -z "$func_normal_abspath_result"; then
-          func_normal_abspath_result=/
-        fi
-        break
-      fi
-      func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \
-          -e "$_G_pathcar"`
-      func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
-          -e "$_G_pathcdr"`
-      # Figure out what to do with it
-      case $func_normal_abspath_tcomponent in
-        "")
-          # Trailing empty path component, ignore it.
-          ;;
-        ..)
-          # Parent dir; strip last assembled component from result.
-          func_dirname "$func_normal_abspath_result"
-          func_normal_abspath_result=$func_dirname_result
-          ;;
-        *)
-          # Actual path component, append it.
-          func_append func_normal_abspath_result "/$func_normal_abspath_tcomponent"
-          ;;
-      esac
-    done
-    # Restore leading double-slash if one was found on entry.
-    func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result
-}
-
-
-# func_notquiet ARG...
-# --------------------
-# Echo program name prefixed message only when not in quiet mode.
-func_notquiet ()
-{
-    $debug_cmd
-
-    $opt_quiet || func_echo ${1+"$@"}
-
-    # A bug in bash halts the script if the last line of a function
-    # fails when set -e is in force, so we need another command to
-    # work around that:
-    :
-}
-
-
-# func_relative_path SRCDIR DSTDIR
-# --------------------------------
-# Set func_relative_path_result to the relative path from SRCDIR to DSTDIR.
-func_relative_path ()
-{
-    $debug_cmd
-
-    func_relative_path_result=
-    func_normal_abspath "$1"
-    func_relative_path_tlibdir=$func_normal_abspath_result
-    func_normal_abspath "$2"
-    func_relative_path_tbindir=$func_normal_abspath_result
-
-    # Ascend the tree starting from libdir
-    while :; do
-      # check if we have found a prefix of bindir
-      case $func_relative_path_tbindir in
-        $func_relative_path_tlibdir)
-          # found an exact match
-          func_relative_path_tcancelled=
-          break
-          ;;
-        $func_relative_path_tlibdir*)
-          # found a matching prefix
-          func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir"
-          func_relative_path_tcancelled=$func_stripname_result
-          if test -z "$func_relative_path_result"; then
-            func_relative_path_result=.
-          fi
-          break
-          ;;
-        *)
-          func_dirname $func_relative_path_tlibdir
-          func_relative_path_tlibdir=$func_dirname_result
-          if test -z "$func_relative_path_tlibdir"; then
-            # Have to descend all the way to the root!
-            func_relative_path_result=../$func_relative_path_result
-            func_relative_path_tcancelled=$func_relative_path_tbindir
-            break
-          fi
-          func_relative_path_result=../$func_relative_path_result
-          ;;
-      esac
-    done
-
-    # Now calculate path; take care to avoid doubling-up slashes.
-    func_stripname '' '/' "$func_relative_path_result"
-    func_relative_path_result=$func_stripname_result
-    func_stripname '/' '/' "$func_relative_path_tcancelled"
-    if test -n "$func_stripname_result"; then
-      func_append func_relative_path_result "/$func_stripname_result"
-    fi
-
-    # Normalisation. If bindir is libdir, return '.' else relative path.
-    if test -n "$func_relative_path_result"; then
-      func_stripname './' '' "$func_relative_path_result"
-      func_relative_path_result=$func_stripname_result
-    fi
-
-    test -n "$func_relative_path_result" || func_relative_path_result=.
-
-    :
-}
-
-
-# func_quote_for_eval ARG...
-# --------------------------
-# Aesthetically quote ARGs to be evaled later.
-# This function returns two values:
-#   i) func_quote_for_eval_result
-#      double-quoted, suitable for a subsequent eval
-#  ii) func_quote_for_eval_unquoted_result
-#      has all characters that are still active within double
-#      quotes backslashified.
-func_quote_for_eval ()
-{
-    $debug_cmd
-
-    func_quote_for_eval_unquoted_result=
-    func_quote_for_eval_result=
-    while test 0 -lt $#; do
-      case $1 in
-        *[\\\`\"\$]*)
-	  _G_unquoted_arg=`printf '%s\n' "$1" |$SED "$sed_quote_subst"` ;;
-        *)
-          _G_unquoted_arg=$1 ;;
-      esac
-      if test -n "$func_quote_for_eval_unquoted_result"; then
-	func_append func_quote_for_eval_unquoted_result " $_G_unquoted_arg"
-      else
-        func_append func_quote_for_eval_unquoted_result "$_G_unquoted_arg"
-      fi
-
-      case $_G_unquoted_arg in
-        # Double-quote args containing shell metacharacters to delay
-        # word splitting, command substitution and variable expansion
-        # for a subsequent eval.
-        # Many Bourne shells cannot handle close brackets correctly
-        # in scan sets, so we specify it separately.
-        *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
-          _G_quoted_arg=\"$_G_unquoted_arg\"
-          ;;
-        *)
-          _G_quoted_arg=$_G_unquoted_arg
-	  ;;
-      esac
-
-      if test -n "$func_quote_for_eval_result"; then
-	func_append func_quote_for_eval_result " $_G_quoted_arg"
-      else
-        func_append func_quote_for_eval_result "$_G_quoted_arg"
-      fi
-      shift
-    done
-}
-
-
-# func_quote_for_expand ARG
-# -------------------------
-# Aesthetically quote ARG to be evaled later; same as above,
-# but do not quote variable references.
-func_quote_for_expand ()
-{
-    $debug_cmd
-
-    case $1 in
-      *[\\\`\"]*)
-	_G_arg=`$ECHO "$1" | $SED \
-	    -e "$sed_double_quote_subst" -e "$sed_double_backslash"` ;;
-      *)
-        _G_arg=$1 ;;
-    esac
-
-    case $_G_arg in
-      # Double-quote args containing shell metacharacters to delay
-      # word splitting and command substitution for a subsequent eval.
-      # Many Bourne shells cannot handle close brackets correctly
-      # in scan sets, so we specify it separately.
-      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
-        _G_arg=\"$_G_arg\"
-        ;;
-    esac
-
-    func_quote_for_expand_result=$_G_arg
-}
-
-
-# func_stripname PREFIX SUFFIX NAME
-# ---------------------------------
-# strip PREFIX and SUFFIX from NAME, and store in func_stripname_result.
-# PREFIX and SUFFIX must not contain globbing or regex special
-# characters, hashes, percent signs, but SUFFIX may contain a leading
-# dot (in which case that matches only a dot).
-if test yes = "$_G_HAVE_XSI_OPS"; then
-  eval 'func_stripname ()
-  {
-    $debug_cmd
-
-    # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
-    # positional parameters, so assign one to ordinary variable first.
-    func_stripname_result=$3
-    func_stripname_result=${func_stripname_result#"$1"}
-    func_stripname_result=${func_stripname_result%"$2"}
-  }'
-else
-  func_stripname ()
-  {
-    $debug_cmd
-
-    case $2 in
-      .*) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%\\\\$2\$%%"`;;
-      *)  func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%$2\$%%"`;;
-    esac
-  }
-fi
-
-
-# func_show_eval CMD [FAIL_EXP]
-# -----------------------------
-# Unless opt_quiet is true, then output CMD.  Then, if opt_dryrun is
-# not true, evaluate CMD.  If the evaluation of CMD fails, and FAIL_EXP
-# is given, then evaluate it.
-func_show_eval ()
-{
-    $debug_cmd
-
-    _G_cmd=$1
-    _G_fail_exp=${2-':'}
-
-    func_quote_for_expand "$_G_cmd"
-    eval "func_notquiet $func_quote_for_expand_result"
-
-    $opt_dry_run || {
-      eval "$_G_cmd"
-      _G_status=$?
-      if test 0 -ne "$_G_status"; then
-	eval "(exit $_G_status); $_G_fail_exp"
-      fi
-    }
-}
-
-
-# func_show_eval_locale CMD [FAIL_EXP]
-# ------------------------------------
-# Unless opt_quiet is true, then output CMD.  Then, if opt_dryrun is
-# not true, evaluate CMD.  If the evaluation of CMD fails, and FAIL_EXP
-# is given, then evaluate it.  Use the saved locale for evaluation.
-func_show_eval_locale ()
-{
-    $debug_cmd
-
-    _G_cmd=$1
-    _G_fail_exp=${2-':'}
-
-    $opt_quiet || {
-      func_quote_for_expand "$_G_cmd"
-      eval "func_echo $func_quote_for_expand_result"
-    }
-
-    $opt_dry_run || {
-      eval "$_G_user_locale
-	    $_G_cmd"
-      _G_status=$?
-      eval "$_G_safe_locale"
-      if test 0 -ne "$_G_status"; then
-	eval "(exit $_G_status); $_G_fail_exp"
-      fi
-    }
-}
-
-
-# func_tr_sh
-# ----------
-# Turn $1 into a string suitable for a shell variable name.
-# Result is stored in $func_tr_sh_result.  All characters
-# not in the set a-zA-Z0-9_ are replaced with '_'. Further,
-# if $1 begins with a digit, a '_' is prepended as well.
-func_tr_sh ()
-{
-    $debug_cmd
-
-    case $1 in
-    [0-9]* | *[!a-zA-Z0-9_]*)
-      func_tr_sh_result=`$ECHO "$1" | $SED -e 's/^\([0-9]\)/_\1/' -e 's/[^a-zA-Z0-9_]/_/g'`
-      ;;
-    * )
-      func_tr_sh_result=$1
-      ;;
-    esac
-}
-
-
-# func_verbose ARG...
-# -------------------
-# Echo program name prefixed message in verbose mode only.
-func_verbose ()
-{
-    $debug_cmd
-
-    $opt_verbose && func_echo "$*"
-
-    :
-}
-
-
-# func_warn_and_continue ARG...
-# -----------------------------
-# Echo program name prefixed warning message to standard error.
-func_warn_and_continue ()
-{
-    $debug_cmd
-
-    $require_term_colors
-
-    func_echo_infix_1 "${tc_red}warning$tc_reset" "$*" >&2
-}
-
-
-# func_warning CATEGORY ARG...
-# ----------------------------
-# Echo program name prefixed warning message to standard error. Warning
-# messages can be filtered according to CATEGORY, where this function
-# elides messages where CATEGORY is not listed in the global variable
-# 'opt_warning_types'.
-func_warning ()
-{
-    $debug_cmd
-
-    # CATEGORY must be in the warning_categories list!
-    case " $warning_categories " in
-      *" $1 "*) ;;
-      *) func_internal_error "invalid warning category '$1'" ;;
-    esac
-
-    _G_category=$1
-    shift
-
-    case " $opt_warning_types " in
-      *" $_G_category "*) $warning_func ${1+"$@"} ;;
-    esac
-}
-
-
-# func_sort_ver VER1 VER2
-# -----------------------
-# 'sort -V' is not generally available.
-# Note this deviates from the version comparison in automake
-# in that it treats 1.5 < 1.5.0, and treats 1.4.4a < 1.4-p3a
-# but this should suffice as we won't be specifying old
-# version formats or redundant trailing .0 in bootstrap.conf.
-# If we did want full compatibility then we should probably
-# use m4_version_compare from autoconf.
-func_sort_ver ()
-{
-    $debug_cmd
-
-    printf '%s\n%s\n' "$1" "$2" \
-      | sort -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n -k 5,5n -k 6,6n -k 7,7n -k 8,8n -k 9,9n
-}
-
-# func_lt_ver PREV CURR
-# ---------------------
-# Return true if PREV and CURR are in the correct order according to
-# func_sort_ver, otherwise false.  Use it like this:
-#
-#  func_lt_ver "$prev_ver" "$proposed_ver" || func_fatal_error "..."
-func_lt_ver ()
-{
-    $debug_cmd
-
-    test "x$1" = x`func_sort_ver "$1" "$2" | $SED 1q`
-}
-
-
-# Local variables:
-# mode: shell-script
-# sh-indentation: 2
-# eval: (add-hook 'before-save-hook 'time-stamp)
-# time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC"
-# time-stamp-time-zone: "UTC"
-# End:
-#! /bin/sh
-
-# Set a version string for this script.
-scriptversion=2014-01-07.03; # UTC
-
-# A portable, pluggable option parser for Bourne shell.
-# Written by Gary V. Vaughan, 2010
-
-# Copyright (C) 2010-2015 Free Software Foundation, Inc.
-# This is free software; see the source for copying conditions.  There is NO
-# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-# Please report bugs or propose patches to gary at gnu.org.
-
-
-## ------ ##
-## Usage. ##
-## ------ ##
-
-# This file is a library for parsing options in your shell scripts along
-# with assorted other useful supporting features that you can make use
-# of too.
-#
-# For the simplest scripts you might need only:
-#
-#   #!/bin/sh
-#   . relative/path/to/funclib.sh
-#   . relative/path/to/options-parser
-#   scriptversion=1.0
-#   func_options ${1+"$@"}
-#   eval set dummy "$func_options_result"; shift
-#   ...rest of your script...
-#
-# In order for the '--version' option to work, you will need to have a
-# suitably formatted comment like the one at the top of this file
-# starting with '# Written by ' and ending with '# warranty; '.
-#
-# For '-h' and '--help' to work, you will also need a one line
-# description of your script's purpose in a comment directly above the
-# '# Written by ' line, like the one at the top of this file.
-#
-# The default options also support '--debug', which will turn on shell
-# execution tracing (see the comment above debug_cmd below for another
-# use), and '--verbose' and the func_verbose function to allow your script
-# to display verbose messages only when your user has specified
-# '--verbose'.
-#
-# After sourcing this file, you can plug processing for additional
-# options by amending the variables from the 'Configuration' section
-# below, and following the instructions in the 'Option parsing'
-# section further down.
-
-## -------------- ##
-## Configuration. ##
-## -------------- ##
-
-# You should override these variables in your script after sourcing this
-# file so that they reflect the customisations you have added to the
-# option parser.
-
-# The usage line for option parsing errors and the start of '-h' and
-# '--help' output messages. You can embed shell variables for delayed
-# expansion at the time the message is displayed, but you will need to
-# quote other shell meta-characters carefully to prevent them being
-# expanded when the contents are evaled.
-usage='$progpath [OPTION]...'
-
-# Short help message in response to '-h' and '--help'.  Add to this or
-# override it after sourcing this library to reflect the full set of
-# options your script accepts.
-usage_message="\
-       --debug        enable verbose shell tracing
-   -W, --warnings=CATEGORY
-                      report the warnings falling in CATEGORY [all]
-   -v, --verbose      verbosely report processing
-       --version      print version information and exit
-   -h, --help         print short or long help message and exit
-"
-
-# Additional text appended to 'usage_message' in response to '--help'.
-long_help_message="
-Warning categories include:
-       'all'          show all warnings
-       'none'         turn off all the warnings
-       'error'        warnings are treated as fatal errors"
-
-# Help message printed before fatal option parsing errors.
-fatal_help="Try '\$progname --help' for more information."
-
-
-
-## ------------------------- ##
-## Hook function management. ##
-## ------------------------- ##
-
-# This section contains functions for adding, removing, and running hooks
-# to the main code.  A hook is just a named list of of function, that can
-# be run in order later on.
-
-# func_hookable FUNC_NAME
-# -----------------------
-# Declare that FUNC_NAME will run hooks added with
-# 'func_add_hook FUNC_NAME ...'.
-func_hookable ()
-{
-    $debug_cmd
-
-    func_append hookable_fns " $1"
-}
-
-
-# func_add_hook FUNC_NAME HOOK_FUNC
-# ---------------------------------
-# Request that FUNC_NAME call HOOK_FUNC before it returns.  FUNC_NAME must
-# first have been declared "hookable" by a call to 'func_hookable'.
-func_add_hook ()
-{
-    $debug_cmd
-
-    case " $hookable_fns " in
-      *" $1 "*) ;;
-      *) func_fatal_error "'$1' does not accept hook functions." ;;
-    esac
-
-    eval func_append ${1}_hooks '" $2"'
-}
-
-
-# func_remove_hook FUNC_NAME HOOK_FUNC
-# ------------------------------------
-# Remove HOOK_FUNC from the list of functions called by FUNC_NAME.
-func_remove_hook ()
-{
-    $debug_cmd
-
-    eval ${1}_hooks='`$ECHO "\$'$1'_hooks" |$SED "s| '$2'||"`'
-}
-
-
-# func_run_hooks FUNC_NAME [ARG]...
-# ---------------------------------
-# Run all hook functions registered to FUNC_NAME.
-# It is assumed that the list of hook functions contains nothing more
-# than a whitespace-delimited list of legal shell function names, and
-# no effort is wasted trying to catch shell meta-characters or preserve
-# whitespace.
-func_run_hooks ()
-{
-    $debug_cmd
-
-    case " $hookable_fns " in
-      *" $1 "*) ;;
-      *) func_fatal_error "'$1' does not support hook funcions.n" ;;
-    esac
-
-    eval _G_hook_fns=\$$1_hooks; shift
-
-    for _G_hook in $_G_hook_fns; do
-      eval $_G_hook '"$@"'
-
-      # store returned options list back into positional
-      # parameters for next 'cmd' execution.
-      eval _G_hook_result=\$${_G_hook}_result
-      eval set dummy "$_G_hook_result"; shift
-    done
-
-    func_quote_for_eval ${1+"$@"}
-    func_run_hooks_result=$func_quote_for_eval_result
-}
-
-
-
-## --------------- ##
-## Option parsing. ##
-## --------------- ##
-
-# In order to add your own option parsing hooks, you must accept the
-# full positional parameter list in your hook function, remove any
-# options that you action, and then pass back the remaining unprocessed
-# options in '<hooked_function_name>_result', escaped suitably for
-# 'eval'.  Like this:
-#
-#    my_options_prep ()
-#    {
-#        $debug_cmd
-#
-#        # Extend the existing usage message.
-#        usage_message=$usage_message'
-#      -s, --silent       don'\''t print informational messages
-#    '
-#
-#        func_quote_for_eval ${1+"$@"}
-#        my_options_prep_result=$func_quote_for_eval_result
-#    }
-#    func_add_hook func_options_prep my_options_prep
-#
-#
-#    my_silent_option ()
-#    {
-#        $debug_cmd
-#
-#        # Note that for efficiency, we parse as many options as we can
-#        # recognise in a loop before passing the remainder back to the
-#        # caller on the first unrecognised argument we encounter.
-#        while test $# -gt 0; do
-#          opt=$1; shift
-#          case $opt in
-#            --silent|-s) opt_silent=: ;;
-#            # Separate non-argument short options:
-#            -s*)         func_split_short_opt "$_G_opt"
-#                         set dummy "$func_split_short_opt_name" \
-#                             "-$func_split_short_opt_arg" ${1+"$@"}
-#                         shift
-#                         ;;
-#            *)            set dummy "$_G_opt" "$*"; shift; break ;;
-#          esac
-#        done
-#
-#        func_quote_for_eval ${1+"$@"}
-#        my_silent_option_result=$func_quote_for_eval_result
-#    }
-#    func_add_hook func_parse_options my_silent_option
-#
-#
-#    my_option_validation ()
-#    {
-#        $debug_cmd
-#
-#        $opt_silent && $opt_verbose && func_fatal_help "\
-#    '--silent' and '--verbose' options are mutually exclusive."
-#
-#        func_quote_for_eval ${1+"$@"}
-#        my_option_validation_result=$func_quote_for_eval_result
-#    }
-#    func_add_hook func_validate_options my_option_validation
-#
-# You'll alse need to manually amend $usage_message to reflect the extra
-# options you parse.  It's preferable to append if you can, so that
-# multiple option parsing hooks can be added safely.
-
-
-# func_options [ARG]...
-# ---------------------
-# All the functions called inside func_options are hookable. See the
-# individual implementations for details.
-func_hookable func_options
-func_options ()
-{
-    $debug_cmd
-
-    func_options_prep ${1+"$@"}
-    eval func_parse_options \
-        ${func_options_prep_result+"$func_options_prep_result"}
-    eval func_validate_options \
-        ${func_parse_options_result+"$func_parse_options_result"}
-
-    eval func_run_hooks func_options \
-        ${func_validate_options_result+"$func_validate_options_result"}
-
-    # save modified positional parameters for caller
-    func_options_result=$func_run_hooks_result
-}
-
-
-# func_options_prep [ARG]...
-# --------------------------
-# All initialisations required before starting the option parse loop.
-# Note that when calling hook functions, we pass through the list of
-# positional parameters.  If a hook function modifies that list, and
-# needs to propogate that back to rest of this script, then the complete
-# modified list must be put in 'func_run_hooks_result' before
-# returning.
-func_hookable func_options_prep
-func_options_prep ()
-{
-    $debug_cmd
-
-    # Option defaults:
-    opt_verbose=false
-    opt_warning_types=
-
-    func_run_hooks func_options_prep ${1+"$@"}
-
-    # save modified positional parameters for caller
-    func_options_prep_result=$func_run_hooks_result
-}
-
-
-# func_parse_options [ARG]...
-# ---------------------------
-# The main option parsing loop.
-func_hookable func_parse_options
-func_parse_options ()
-{
-    $debug_cmd
-
-    func_parse_options_result=
-
-    # this just eases exit handling
-    while test $# -gt 0; do
-      # Defer to hook functions for initial option parsing, so they
-      # get priority in the event of reusing an option name.
-      func_run_hooks func_parse_options ${1+"$@"}
-
-      # Adjust func_parse_options positional parameters to match
-      eval set dummy "$func_run_hooks_result"; shift
-
-      # Break out of the loop if we already parsed every option.
-      test $# -gt 0 || break
-
-      _G_opt=$1
-      shift
-      case $_G_opt in
-        --debug|-x)   debug_cmd='set -x'
-                      func_echo "enabling shell trace mode"
-                      $debug_cmd
-                      ;;
-
-        --no-warnings|--no-warning|--no-warn)
-                      set dummy --warnings none ${1+"$@"}
-                      shift
-		      ;;
-
-        --warnings|--warning|-W)
-                      test $# = 0 && func_missing_arg $_G_opt && break
-                      case " $warning_categories $1" in
-                        *" $1 "*)
-                          # trailing space prevents matching last $1 above
-                          func_append_uniq opt_warning_types " $1"
-                          ;;
-                        *all)
-                          opt_warning_types=$warning_categories
-                          ;;
-                        *none)
-                          opt_warning_types=none
-                          warning_func=:
-                          ;;
-                        *error)
-                          opt_warning_types=$warning_categories
-                          warning_func=func_fatal_error
-                          ;;
-                        *)
-                          func_fatal_error \
-                             "unsupported warning category: '$1'"
-                          ;;
-                      esac
-                      shift
-                      ;;
-
-        --verbose|-v) opt_verbose=: ;;
-        --version)    func_version ;;
-        -\?|-h)       func_usage ;;
-        --help)       func_help ;;
-
-	# Separate optargs to long options (plugins may need this):
-	--*=*)        func_split_equals "$_G_opt"
-	              set dummy "$func_split_equals_lhs" \
-                          "$func_split_equals_rhs" ${1+"$@"}
-                      shift
-                      ;;
-
-       # Separate optargs to short options:
-        -W*)
-                      func_split_short_opt "$_G_opt"
-                      set dummy "$func_split_short_opt_name" \
-                          "$func_split_short_opt_arg" ${1+"$@"}
-                      shift
-                      ;;
-
-        # Separate non-argument short options:
-        -\?*|-h*|-v*|-x*)
-                      func_split_short_opt "$_G_opt"
-                      set dummy "$func_split_short_opt_name" \
-                          "-$func_split_short_opt_arg" ${1+"$@"}
-                      shift
-                      ;;
-
-        --)           break ;;
-        -*)           func_fatal_help "unrecognised option: '$_G_opt'" ;;
-        *)            set dummy "$_G_opt" ${1+"$@"}; shift; break ;;
-      esac
-    done
-
-    # save modified positional parameters for caller
-    func_quote_for_eval ${1+"$@"}
-    func_parse_options_result=$func_quote_for_eval_result
-}
-
-
-# func_validate_options [ARG]...
-# ------------------------------
-# Perform any sanity checks on option settings and/or unconsumed
-# arguments.
-func_hookable func_validate_options
-func_validate_options ()
-{
-    $debug_cmd
-
-    # Display all warnings if -W was not given.
-    test -n "$opt_warning_types" || opt_warning_types=" $warning_categories"
-
-    func_run_hooks func_validate_options ${1+"$@"}
-
-    # Bail if the options were screwed!
-    $exit_cmd $EXIT_FAILURE
-
-    # save modified positional parameters for caller
-    func_validate_options_result=$func_run_hooks_result
-}
-
-
-
-## ----------------- ##
-## Helper functions. ##
-## ----------------- ##
-
-# This section contains the helper functions used by the rest of the
-# hookable option parser framework in ascii-betical order.
-
-
-# func_fatal_help ARG...
-# ----------------------
-# Echo program name prefixed message to standard error, followed by
-# a help hint, and exit.
-func_fatal_help ()
-{
-    $debug_cmd
-
-    eval \$ECHO \""Usage: $usage"\"
-    eval \$ECHO \""$fatal_help"\"
-    func_error ${1+"$@"}
-    exit $EXIT_FAILURE
-}
-
-
-# func_help
-# ---------
-# Echo long help message to standard output and exit.
-func_help ()
-{
-    $debug_cmd
-
-    func_usage_message
-    $ECHO "$long_help_message"
-    exit 0
-}
-
-
-# func_missing_arg ARGNAME
-# ------------------------
-# Echo program name prefixed message to standard error and set global
-# exit_cmd.
-func_missing_arg ()
-{
-    $debug_cmd
-
-    func_error "Missing argument for '$1'."
-    exit_cmd=exit
-}
-
-
-# func_split_equals STRING
-# ------------------------
-# Set func_split_equals_lhs and func_split_equals_rhs shell variables after
-# splitting STRING at the '=' sign.
-test -z "$_G_HAVE_XSI_OPS" \
-    && (eval 'x=a/b/c;
-      test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \
-    && _G_HAVE_XSI_OPS=yes
-
-if test yes = "$_G_HAVE_XSI_OPS"
-then
-  # This is an XSI compatible shell, allowing a faster implementation...
-  eval 'func_split_equals ()
-  {
-      $debug_cmd
-
-      func_split_equals_lhs=${1%%=*}
-      func_split_equals_rhs=${1#*=}
-      test "x$func_split_equals_lhs" = "x$1" \
-        && func_split_equals_rhs=
-  }'
-else
-  # ...otherwise fall back to using expr, which is often a shell builtin.
-  func_split_equals ()
-  {
-      $debug_cmd
-
-      func_split_equals_lhs=`expr "x$1" : 'x\([^=]*\)'`
-      func_split_equals_rhs=
-      test "x$func_split_equals_lhs" = "x$1" \
-        || func_split_equals_rhs=`expr "x$1" : 'x[^=]*=\(.*\)$'`
-  }
-fi #func_split_equals
-
-
-# func_split_short_opt SHORTOPT
-# -----------------------------
-# Set func_split_short_opt_name and func_split_short_opt_arg shell
-# variables after splitting SHORTOPT after the 2nd character.
-if test yes = "$_G_HAVE_XSI_OPS"
-then
-  # This is an XSI compatible shell, allowing a faster implementation...
-  eval 'func_split_short_opt ()
-  {
-      $debug_cmd
-
-      func_split_short_opt_arg=${1#??}
-      func_split_short_opt_name=${1%"$func_split_short_opt_arg"}
-  }'
-else
-  # ...otherwise fall back to using expr, which is often a shell builtin.
-  func_split_short_opt ()
-  {
-      $debug_cmd
-
-      func_split_short_opt_name=`expr "x$1" : 'x-\(.\)'`
-      func_split_short_opt_arg=`expr "x$1" : 'x-.\(.*\)$'`
-  }
-fi #func_split_short_opt
-
-
-# func_usage
-# ----------
-# Echo short help message to standard output and exit.
-func_usage ()
-{
-    $debug_cmd
-
-    func_usage_message
-    $ECHO "Run '$progname --help |${PAGER-more}' for full usage"
-    exit 0
-}
-
-
-# func_usage_message
-# ------------------
-# Echo short help message to standard output.
-func_usage_message ()
-{
-    $debug_cmd
-
-    eval \$ECHO \""Usage: $usage"\"
-    echo
-    $SED -n 's|^# ||
-        /^Written by/{
-          x;p;x
-        }
-	h
-	/^Written by/q' < "$progpath"
-    echo
-    eval \$ECHO \""$usage_message"\"
-}
-
-
-# func_version
-# ------------
-# Echo version message to standard output and exit.
-func_version ()
-{
-    $debug_cmd
-
-    printf '%s\n' "$progname $scriptversion"
-    $SED -n '
-        /(C)/!b go
-        :more
-        /\./!{
-          N
-          s|\n# | |
-          b more
-        }
-        :go
-        /^# Written by /,/# warranty; / {
-          s|^# ||
-          s|^# *$||
-          s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2|
-          p
-        }
-        /^# Written by / {
-          s|^# ||
-          p
-        }
-        /^warranty; /q' < "$progpath"
-
-    exit $?
-}
-
-
-# Local variables:
-# mode: shell-script
-# sh-indentation: 2
-# eval: (add-hook 'before-save-hook 'time-stamp)
-# time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC"
-# time-stamp-time-zone: "UTC"
-# End:
-
-# Set a version string.
-scriptversion='(GNU libtool) 2.4.6'
-
-
-# func_echo ARG...
-# ----------------
-# Libtool also displays the current mode in messages, so override
-# funclib.sh func_echo with this custom definition.
-func_echo ()
-{
-    $debug_cmd
-
-    _G_message=$*
-
-    func_echo_IFS=$IFS
-    IFS=$nl
-    for _G_line in $_G_message; do
-      IFS=$func_echo_IFS
-      $ECHO "$progname${opt_mode+: $opt_mode}: $_G_line"
-    done
-    IFS=$func_echo_IFS
-}
-
-
-# func_warning ARG...
-# -------------------
-# Libtool warnings are not categorized, so override funclib.sh
-# func_warning with this simpler definition.
-func_warning ()
-{
-    $debug_cmd
-
-    $warning_func ${1+"$@"}
-}
-
-
-## ---------------- ##
-## Options parsing. ##
-## ---------------- ##
-
-# Hook in the functions to make sure our own options are parsed during
-# the option parsing loop.
-
-usage='$progpath [OPTION]... [MODE-ARG]...'
-
-# Short help message in response to '-h'.
-usage_message="Options:
-       --config             show all configuration variables
-       --debug              enable verbose shell tracing
-   -n, --dry-run            display commands without modifying any files
-       --features           display basic configuration information and exit
-       --mode=MODE          use operation mode MODE
-       --no-warnings        equivalent to '-Wnone'
-       --preserve-dup-deps  don't remove duplicate dependency libraries
-       --quiet, --silent    don't print informational messages
-       --tag=TAG            use configuration variables from tag TAG
-   -v, --verbose            print more informational messages than default
-       --version            print version information
-   -W, --warnings=CATEGORY  report the warnings falling in CATEGORY [all]
-   -h, --help, --help-all   print short, long, or detailed help message
-"
-
-# Additional text appended to 'usage_message' in response to '--help'.
-func_help ()
-{
-    $debug_cmd
-
-    func_usage_message
-    $ECHO "$long_help_message
-
-MODE must be one of the following:
-
-       clean           remove files from the build directory
-       compile         compile a source file into a libtool object
-       execute         automatically set library path, then run a program
-       finish          complete the installation of libtool libraries
-       install         install libraries or executables
-       link            create a library or an executable
-       uninstall       remove libraries from an installed directory
-
-MODE-ARGS vary depending on the MODE.  When passed as first option,
-'--mode=MODE' may be abbreviated as 'MODE' or a unique abbreviation of that.
-Try '$progname --help --mode=MODE' for a more detailed description of MODE.
-
-When reporting a bug, please describe a test case to reproduce it and
-include the following information:
-
-       host-triplet:   $host
-       shell:          $SHELL
-       compiler:       $LTCC
-       compiler flags: $LTCFLAGS
-       linker:         $LD (gnu? $with_gnu_ld)
-       version:        $progname (GNU libtool) 2.4.6
-       automake:       `($AUTOMAKE --version) 2>/dev/null |$SED 1q`
-       autoconf:       `($AUTOCONF --version) 2>/dev/null |$SED 1q`
-
-Report bugs to <bug-libtool at gnu.org>.
-GNU libtool home page: <http://www.gnu.org/software/libtool/>.
-General help using GNU software: <http://www.gnu.org/gethelp/>."
-    exit 0
-}
-
-
-# func_lo2o OBJECT-NAME
-# ---------------------
-# Transform OBJECT-NAME from a '.lo' suffix to the platform specific
-# object suffix.
-
-lo2o=s/\\.lo\$/.$objext/
-o2lo=s/\\.$objext\$/.lo/
-
-if test yes = "$_G_HAVE_XSI_OPS"; then
-  eval 'func_lo2o ()
-  {
-    case $1 in
-      *.lo) func_lo2o_result=${1%.lo}.$objext ;;
-      *   ) func_lo2o_result=$1               ;;
-    esac
-  }'
-
-  # func_xform LIBOBJ-OR-SOURCE
-  # ---------------------------
-  # Transform LIBOBJ-OR-SOURCE from a '.o' or '.c' (or otherwise)
-  # suffix to a '.lo' libtool-object suffix.
-  eval 'func_xform ()
-  {
-    func_xform_result=${1%.*}.lo
-  }'
-else
-  # ...otherwise fall back to using sed.
-  func_lo2o ()
-  {
-    func_lo2o_result=`$ECHO "$1" | $SED "$lo2o"`
-  }
-
-  func_xform ()
-  {
-    func_xform_result=`$ECHO "$1" | $SED 's|\.[^.]*$|.lo|'`
-  }
-fi
-
-
-# func_fatal_configuration ARG...
-# -------------------------------
-# Echo program name prefixed message to standard error, followed by
-# a configuration failure hint, and exit.
-func_fatal_configuration ()
-{
-    func__fatal_error ${1+"$@"} \
-      "See the $PACKAGE documentation for more information." \
-      "Fatal configuration error."
-}
-
-
-# func_config
-# -----------
-# Display the configuration for all the tags in this script.
-func_config ()
-{
-    re_begincf='^# ### BEGIN LIBTOOL'
-    re_endcf='^# ### END LIBTOOL'
-
-    # Default configuration.
-    $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath"
-
-    # Now print the configurations for the tags.
-    for tagname in $taglist; do
-      $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath"
-    done
-
-    exit $?
-}
-
-
-# func_features
-# -------------
-# Display the features supported by this script.
-func_features ()
-{
-    echo "host: $host"
-    if test yes = "$build_libtool_libs"; then
-      echo "enable shared libraries"
-    else
-      echo "disable shared libraries"
-    fi
-    if test yes = "$build_old_libs"; then
-      echo "enable static libraries"
-    else
-      echo "disable static libraries"
-    fi
-
-    exit $?
-}
-
-
-# func_enable_tag TAGNAME
-# -----------------------
-# Verify that TAGNAME is valid, and either flag an error and exit, or
-# enable the TAGNAME tag.  We also add TAGNAME to the global $taglist
-# variable here.
-func_enable_tag ()
-{
-    # Global variable:
-    tagname=$1
-
-    re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
-    re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
-    sed_extractcf=/$re_begincf/,/$re_endcf/p
-
-    # Validate tagname.
-    case $tagname in
-      *[!-_A-Za-z0-9,/]*)
-        func_fatal_error "invalid tag name: $tagname"
-        ;;
-    esac
-
-    # Don't test for the "default" C tag, as we know it's
-    # there but not specially marked.
-    case $tagname in
-        CC) ;;
-    *)
-        if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then
-	  taglist="$taglist $tagname"
-
-	  # Evaluate the configuration.  Be careful to quote the path
-	  # and the sed script, to avoid splitting on whitespace, but
-	  # also don't use non-portable quotes within backquotes within
-	  # quotes we have to do it in 2 steps:
-	  extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"`
-	  eval "$extractedcf"
-        else
-	  func_error "ignoring unknown tag $tagname"
-        fi
-        ;;
-    esac
-}
-
-
-# func_check_version_match
-# ------------------------
-# Ensure that we are using m4 macros, and libtool script from the same
-# release of libtool.
-func_check_version_match ()
-{
-    if test "$package_revision" != "$macro_revision"; then
-      if test "$VERSION" != "$macro_version"; then
-        if test -z "$macro_version"; then
-          cat >&2 <<_LT_EOF
-$progname: Version mismatch error.  This is $PACKAGE $VERSION, but the
-$progname: definition of this LT_INIT comes from an older release.
-$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
-$progname: and run autoconf again.
-_LT_EOF
-        else
-          cat >&2 <<_LT_EOF
-$progname: Version mismatch error.  This is $PACKAGE $VERSION, but the
-$progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
-$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
-$progname: and run autoconf again.
-_LT_EOF
-        fi
-      else
-        cat >&2 <<_LT_EOF
-$progname: Version mismatch error.  This is $PACKAGE $VERSION, revision $package_revision,
-$progname: but the definition of this LT_INIT comes from revision $macro_revision.
-$progname: You should recreate aclocal.m4 with macros from revision $package_revision
-$progname: of $PACKAGE $VERSION and run autoconf again.
-_LT_EOF
-      fi
-
-      exit $EXIT_MISMATCH
-    fi
-}
-
-
-# libtool_options_prep [ARG]...
-# -----------------------------
-# Preparation for options parsed by libtool.
-libtool_options_prep ()
-{
-    $debug_mode
-
-    # Option defaults:
-    opt_config=false
-    opt_dlopen=
-    opt_dry_run=false
-    opt_help=false
-    opt_mode=
-    opt_preserve_dup_deps=false
-    opt_quiet=false
-
-    nonopt=
-    preserve_args=
-
-    # Shorthand for --mode=foo, only valid as the first argument
-    case $1 in
-    clean|clea|cle|cl)
-      shift; set dummy --mode clean ${1+"$@"}; shift
-      ;;
-    compile|compil|compi|comp|com|co|c)
-      shift; set dummy --mode compile ${1+"$@"}; shift
-      ;;
-    execute|execut|execu|exec|exe|ex|e)
-      shift; set dummy --mode execute ${1+"$@"}; shift
-      ;;
-    finish|finis|fini|fin|fi|f)
-      shift; set dummy --mode finish ${1+"$@"}; shift
-      ;;
-    install|instal|insta|inst|ins|in|i)
-      shift; set dummy --mode install ${1+"$@"}; shift
-      ;;
-    link|lin|li|l)
-      shift; set dummy --mode link ${1+"$@"}; shift
-      ;;
-    uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
-      shift; set dummy --mode uninstall ${1+"$@"}; shift
-      ;;
-    esac
-
-    # Pass back the list of options.
-    func_quote_for_eval ${1+"$@"}
-    libtool_options_prep_result=$func_quote_for_eval_result
-}
-func_add_hook func_options_prep libtool_options_prep
-
-
-# libtool_parse_options [ARG]...
-# ---------------------------------
-# Provide handling for libtool specific options.
-libtool_parse_options ()
-{
-    $debug_cmd
-
-    # Perform our own loop to consume as many options as possible in
-    # each iteration.
-    while test $# -gt 0; do
-      _G_opt=$1
-      shift
-      case $_G_opt in
-        --dry-run|--dryrun|-n)
-                        opt_dry_run=:
-                        ;;
-
-        --config)       func_config ;;
-
-        --dlopen|-dlopen)
-                        opt_dlopen="${opt_dlopen+$opt_dlopen
-}$1"
-                        shift
-                        ;;
-
-        --preserve-dup-deps)
-                        opt_preserve_dup_deps=: ;;
-
-        --features)     func_features ;;
-
-        --finish)       set dummy --mode finish ${1+"$@"}; shift ;;
-
-        --help)         opt_help=: ;;
-
-        --help-all)     opt_help=': help-all' ;;
-
-        --mode)         test $# = 0 && func_missing_arg $_G_opt && break
-                        opt_mode=$1
-                        case $1 in
-                          # Valid mode arguments:
-                          clean|compile|execute|finish|install|link|relink|uninstall) ;;
-
-                          # Catch anything else as an error
-                          *) func_error "invalid argument for $_G_opt"
-                             exit_cmd=exit
-                             break
-                             ;;
-                        esac
-                        shift
-                        ;;
-
-        --no-silent|--no-quiet)
-                        opt_quiet=false
-                        func_append preserve_args " $_G_opt"
-                        ;;
-
-        --no-warnings|--no-warning|--no-warn)
-                        opt_warning=false
-                        func_append preserve_args " $_G_opt"
-                        ;;
-
-        --no-verbose)
-                        opt_verbose=false
-                        func_append preserve_args " $_G_opt"
-                        ;;
-
-        --silent|--quiet)
-                        opt_quiet=:
-                        opt_verbose=false
-                        func_append preserve_args " $_G_opt"
-                        ;;
-
-        --tag)          test $# = 0 && func_missing_arg $_G_opt && break
-                        opt_tag=$1
-                        func_append preserve_args " $_G_opt $1"
-                        func_enable_tag "$1"
-                        shift
-                        ;;
-
-        --verbose|-v)   opt_quiet=false
-                        opt_verbose=:
-                        func_append preserve_args " $_G_opt"
-                        ;;
-
-	# An option not handled by this hook function:
-        *)		set dummy "$_G_opt" ${1+"$@"};	shift; break  ;;
-      esac
-    done
-
-
-    # save modified positional parameters for caller
-    func_quote_for_eval ${1+"$@"}
-    libtool_parse_options_result=$func_quote_for_eval_result
-}
-func_add_hook func_parse_options libtool_parse_options
-
-
-
-# libtool_validate_options [ARG]...
-# ---------------------------------
-# Perform any sanity checks on option settings and/or unconsumed
-# arguments.
-libtool_validate_options ()
-{
-    # save first non-option argument
-    if test 0 -lt $#; then
-      nonopt=$1
-      shift
-    fi
-
-    # preserve --debug
-    test : = "$debug_cmd" || func_append preserve_args " --debug"
-
-    case $host in
-      # Solaris2 added to fix http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16452
-      # see also: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59788
-      *cygwin* | *mingw* | *pw32* | *cegcc* | *solaris2* | *os2*)
-        # don't eliminate duplications in $postdeps and $predeps
-        opt_duplicate_compiler_generated_deps=:
-        ;;
-      *)
-        opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps
-        ;;
-    esac
-
-    $opt_help || {
-      # Sanity checks first:
-      func_check_version_match
-
-      test yes != "$build_libtool_libs" \
-        && test yes != "$build_old_libs" \
-        && func_fatal_configuration "not configured to build any kind of library"
-
-      # Darwin sucks
-      eval std_shrext=\"$shrext_cmds\"
-
-      # Only execute mode is allowed to have -dlopen flags.
-      if test -n "$opt_dlopen" && test execute != "$opt_mode"; then
-        func_error "unrecognized option '-dlopen'"
-        $ECHO "$help" 1>&2
-        exit $EXIT_FAILURE
-      fi
-
-      # Change the help message to a mode-specific one.
-      generic_help=$help
-      help="Try '$progname --help --mode=$opt_mode' for more information."
-    }
-
-    # Pass back the unparsed argument list
-    func_quote_for_eval ${1+"$@"}
-    libtool_validate_options_result=$func_quote_for_eval_result
-}
-func_add_hook func_validate_options libtool_validate_options
-
-
-# Process options as early as possible so that --help and --version
-# can return quickly.
-func_options ${1+"$@"}
-eval set dummy "$func_options_result"; shift
-
-
-
-## ----------- ##
-##    Main.    ##
-## ----------- ##
-
-magic='%%%MAGIC variable%%%'
-magic_exe='%%%MAGIC EXE variable%%%'
-
-# Global variables.
-extracted_archives=
-extracted_serial=0
-
-# If this variable is set in any of the actions, the command in it
-# will be execed at the end.  This prevents here-documents from being
-# left over by shells.
-exec_cmd=
-
-
-# A function that is used when there is no print builtin or printf.
-func_fallback_echo ()
-{
-  eval 'cat <<_LTECHO_EOF
-$1
-_LTECHO_EOF'
-}
-
-# func_generated_by_libtool
-# True iff stdin has been generated by Libtool. This function is only
-# a basic sanity check; it will hardly flush out determined imposters.
-func_generated_by_libtool_p ()
-{
-  $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
-}
-
-# func_lalib_p file
-# True iff FILE is a libtool '.la' library or '.lo' object file.
-# This function is only a basic sanity check; it will hardly flush out
-# determined imposters.
-func_lalib_p ()
-{
-    test -f "$1" &&
-      $SED -e 4q "$1" 2>/dev/null | func_generated_by_libtool_p
-}
-
-# func_lalib_unsafe_p file
-# True iff FILE is a libtool '.la' library or '.lo' object file.
-# This function implements the same check as func_lalib_p without
-# resorting to external programs.  To this end, it redirects stdin and
-# closes it afterwards, without saving the original file descriptor.
-# As a safety measure, use it only where a negative result would be
-# fatal anyway.  Works if 'file' does not exist.
-func_lalib_unsafe_p ()
-{
-    lalib_p=no
-    if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then
-	for lalib_p_l in 1 2 3 4
-	do
-	    read lalib_p_line
-	    case $lalib_p_line in
-		\#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;;
-	    esac
-	done
-	exec 0<&5 5<&-
-    fi
-    test yes = "$lalib_p"
-}
-
-# func_ltwrapper_script_p file
-# True iff FILE is a libtool wrapper script
-# This function is only a basic sanity check; it will hardly flush out
-# determined imposters.
-func_ltwrapper_script_p ()
-{
-    test -f "$1" &&
-      $lt_truncate_bin < "$1" 2>/dev/null | func_generated_by_libtool_p
-}
-
-# func_ltwrapper_executable_p file
-# True iff FILE is a libtool wrapper executable
-# This function is only a basic sanity check; it will hardly flush out
-# determined imposters.
-func_ltwrapper_executable_p ()
-{
-    func_ltwrapper_exec_suffix=
-    case $1 in
-    *.exe) ;;
-    *) func_ltwrapper_exec_suffix=.exe ;;
-    esac
-    $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1
-}
-
-# func_ltwrapper_scriptname file
-# Assumes file is an ltwrapper_executable
-# uses $file to determine the appropriate filename for a
-# temporary ltwrapper_script.
-func_ltwrapper_scriptname ()
-{
-    func_dirname_and_basename "$1" "" "."
-    func_stripname '' '.exe' "$func_basename_result"
-    func_ltwrapper_scriptname_result=$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper
-}
-
-# func_ltwrapper_p file
-# True iff FILE is a libtool wrapper script or wrapper executable
-# This function is only a basic sanity check; it will hardly flush out
-# determined imposters.
-func_ltwrapper_p ()
-{
-    func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1"
-}
-
-
-# func_execute_cmds commands fail_cmd
-# Execute tilde-delimited COMMANDS.
-# If FAIL_CMD is given, eval that upon failure.
-# FAIL_CMD may read-access the current command in variable CMD!
-func_execute_cmds ()
-{
-    $debug_cmd
-
-    save_ifs=$IFS; IFS='~'
-    for cmd in $1; do
-      IFS=$sp$nl
-      eval cmd=\"$cmd\"
-      IFS=$save_ifs
-      func_show_eval "$cmd" "${2-:}"
-    done
-    IFS=$save_ifs
-}
-
-
-# func_source file
-# Source FILE, adding directory component if necessary.
-# Note that it is not necessary on cygwin/mingw to append a dot to
-# FILE even if both FILE and FILE.exe exist: automatic-append-.exe
-# behavior happens only for exec(3), not for open(2)!  Also, sourcing
-# 'FILE.' does not work on cygwin managed mounts.
-func_source ()
-{
-    $debug_cmd
-
-    case $1 in
-    */* | *\\*)	. "$1" ;;
-    *)		. "./$1" ;;
-    esac
-}
-
-
-# func_resolve_sysroot PATH
-# Replace a leading = in PATH with a sysroot.  Store the result into
-# func_resolve_sysroot_result
-func_resolve_sysroot ()
-{
-  func_resolve_sysroot_result=$1
-  case $func_resolve_sysroot_result in
-  =*)
-    func_stripname '=' '' "$func_resolve_sysroot_result"
-    func_resolve_sysroot_result=$lt_sysroot$func_stripname_result
-    ;;
-  esac
-}
-
-# func_replace_sysroot PATH
-# If PATH begins with the sysroot, replace it with = and
-# store the result into func_replace_sysroot_result.
-func_replace_sysroot ()
-{
-  case $lt_sysroot:$1 in
-  ?*:"$lt_sysroot"*)
-    func_stripname "$lt_sysroot" '' "$1"
-    func_replace_sysroot_result='='$func_stripname_result
-    ;;
-  *)
-    # Including no sysroot.
-    func_replace_sysroot_result=$1
-    ;;
-  esac
-}
-
-# func_infer_tag arg
-# Infer tagged configuration to use if any are available and
-# if one wasn't chosen via the "--tag" command line option.
-# Only attempt this if the compiler in the base compile
-# command doesn't match the default compiler.
-# arg is usually of the form 'gcc ...'
-func_infer_tag ()
-{
-    $debug_cmd
-
-    if test -n "$available_tags" && test -z "$tagname"; then
-      CC_quoted=
-      for arg in $CC; do
-	func_append_quoted CC_quoted "$arg"
-      done
-      CC_expanded=`func_echo_all $CC`
-      CC_quoted_expanded=`func_echo_all $CC_quoted`
-      case $@ in
-      # Blanks in the command may have been stripped by the calling shell,
-      # but not from the CC environment variable when configure was run.
-      " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
-      " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;;
-      # Blanks at the start of $base_compile will cause this to fail
-      # if we don't check for them as well.
-      *)
-	for z in $available_tags; do
-	  if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
-	    # Evaluate the configuration.
-	    eval "`$SED -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
-	    CC_quoted=
-	    for arg in $CC; do
-	      # Double-quote args containing other shell metacharacters.
-	      func_append_quoted CC_quoted "$arg"
-	    done
-	    CC_expanded=`func_echo_all $CC`
-	    CC_quoted_expanded=`func_echo_all $CC_quoted`
-	    case "$@ " in
-	    " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
-	    " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*)
-	      # The compiler in the base compile command matches
-	      # the one in the tagged configuration.
-	      # Assume this is the tagged configuration we want.
-	      tagname=$z
-	      break
-	      ;;
-	    esac
-	  fi
-	done
-	# If $tagname still isn't set, then no tagged configuration
-	# was found and let the user know that the "--tag" command
-	# line option must be used.
-	if test -z "$tagname"; then
-	  func_echo "unable to infer tagged configuration"
-	  func_fatal_error "specify a tag with '--tag'"
-#	else
-#	  func_verbose "using $tagname tagged configuration"
-	fi
-	;;
-      esac
-    fi
-}
-
-
-
-# func_write_libtool_object output_name pic_name nonpic_name
-# Create a libtool object file (analogous to a ".la" file),
-# but don't create it if we're doing a dry run.
-func_write_libtool_object ()
-{
-    write_libobj=$1
-    if test yes = "$build_libtool_libs"; then
-      write_lobj=\'$2\'
-    else
-      write_lobj=none
-    fi
-
-    if test yes = "$build_old_libs"; then
-      write_oldobj=\'$3\'
-    else
-      write_oldobj=none
-    fi
-
-    $opt_dry_run || {
-      cat >${write_libobj}T <<EOF
-# $write_libobj - a libtool object file
-# Generated by $PROGRAM (GNU $PACKAGE) $VERSION
-#
-# Please DO NOT delete this file!
-# It is necessary for linking the library.
-
-# Name of the PIC object.
-pic_object=$write_lobj
-
-# Name of the non-PIC object
-non_pic_object=$write_oldobj
-
-EOF
-      $MV "${write_libobj}T" "$write_libobj"
-    }
-}
-
-
-##################################################
-# FILE NAME AND PATH CONVERSION HELPER FUNCTIONS #
-##################################################
-
-# func_convert_core_file_wine_to_w32 ARG
-# Helper function used by file name conversion functions when $build is *nix,
-# and $host is mingw, cygwin, or some other w32 environment. Relies on a
-# correctly configured wine environment available, with the winepath program
-# in $build's $PATH.
-#
-# ARG is the $build file name to be converted to w32 format.
-# Result is available in $func_convert_core_file_wine_to_w32_result, and will
-# be empty on error (or when ARG is empty)
-func_convert_core_file_wine_to_w32 ()
-{
-  $debug_cmd
-
-  func_convert_core_file_wine_to_w32_result=$1
-  if test -n "$1"; then
-    # Unfortunately, winepath does not exit with a non-zero error code, so we
-    # are forced to check the contents of stdout. On the other hand, if the
-    # command is not found, the shell will set an exit code of 127 and print
-    # *an error message* to stdout. So we must check for both error code of
-    # zero AND non-empty stdout, which explains the odd construction:
-    func_convert_core_file_wine_to_w32_tmp=`winepath -w "$1" 2>/dev/null`
-    if test "$?" -eq 0 && test -n "$func_convert_core_file_wine_to_w32_tmp"; then
-      func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" |
-        $SED -e "$sed_naive_backslashify"`
-    else
-      func_convert_core_file_wine_to_w32_result=
-    fi
-  fi
-}
-# end: func_convert_core_file_wine_to_w32
-
-
-# func_convert_core_path_wine_to_w32 ARG
-# Helper function used by path conversion functions when $build is *nix, and
-# $host is mingw, cygwin, or some other w32 environment. Relies on a correctly
-# configured wine environment available, with the winepath program in $build's
-# $PATH. Assumes ARG has no leading or trailing path separator characters.
-#
-# ARG is path to be converted from $build format to win32.
-# Result is available in $func_convert_core_path_wine_to_w32_result.
-# Unconvertible file (directory) names in ARG are skipped; if no directory names
-# are convertible, then the result may be empty.
-func_convert_core_path_wine_to_w32 ()
-{
-  $debug_cmd
-
-  # unfortunately, winepath doesn't convert paths, only file names
-  func_convert_core_path_wine_to_w32_result=
-  if test -n "$1"; then
-    oldIFS=$IFS
-    IFS=:
-    for func_convert_core_path_wine_to_w32_f in $1; do
-      IFS=$oldIFS
-      func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f"
-      if test -n "$func_convert_core_file_wine_to_w32_result"; then
-        if test -z "$func_convert_core_path_wine_to_w32_result"; then
-          func_convert_core_path_wine_to_w32_result=$func_convert_core_file_wine_to_w32_result
-        else
-          func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result"
-        fi
-      fi
-    done
-    IFS=$oldIFS
-  fi
-}
-# end: func_convert_core_path_wine_to_w32
-
-
-# func_cygpath ARGS...
-# Wrapper around calling the cygpath program via LT_CYGPATH. This is used when
-# when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2)
-# $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or
-# (2), returns the Cygwin file name or path in func_cygpath_result (input
-# file name or path is assumed to be in w32 format, as previously converted
-# from $build's *nix or MSYS format). In case (3), returns the w32 file name
-# or path in func_cygpath_result (input file name or path is assumed to be in
-# Cygwin format). Returns an empty string on error.
-#
-# ARGS are passed to cygpath, with the last one being the file name or path to
-# be converted.
-#
-# Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH
-# environment variable; do not put it in $PATH.
-func_cygpath ()
-{
-  $debug_cmd
-
-  if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then
-    func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null`
-    if test "$?" -ne 0; then
-      # on failure, ensure result is empty
-      func_cygpath_result=
-    fi
-  else
-    func_cygpath_result=
-    func_error "LT_CYGPATH is empty or specifies non-existent file: '$LT_CYGPATH'"
-  fi
-}
-#end: func_cygpath
-
-
-# func_convert_core_msys_to_w32 ARG
-# Convert file name or path ARG from MSYS format to w32 format.  Return
-# result in func_convert_core_msys_to_w32_result.
-func_convert_core_msys_to_w32 ()
-{
-  $debug_cmd
-
-  # awkward: cmd appends spaces to result
-  func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null |
-    $SED -e 's/[ ]*$//' -e "$sed_naive_backslashify"`
-}
-#end: func_convert_core_msys_to_w32
-
-
-# func_convert_file_check ARG1 ARG2
-# Verify that ARG1 (a file name in $build format) was converted to $host
-# format in ARG2. Otherwise, emit an error message, but continue (resetting
-# func_to_host_file_result to ARG1).
-func_convert_file_check ()
-{
-  $debug_cmd
-
-  if test -z "$2" && test -n "$1"; then
-    func_error "Could not determine host file name corresponding to"
-    func_error "  '$1'"
-    func_error "Continuing, but uninstalled executables may not work."
-    # Fallback:
-    func_to_host_file_result=$1
-  fi
-}
-# end func_convert_file_check
-
-
-# func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH
-# Verify that FROM_PATH (a path in $build format) was converted to $host
-# format in TO_PATH. Otherwise, emit an error message, but continue, resetting
-# func_to_host_file_result to a simplistic fallback value (see below).
-func_convert_path_check ()
-{
-  $debug_cmd
-
-  if test -z "$4" && test -n "$3"; then
-    func_error "Could not determine the host path corresponding to"
-    func_error "  '$3'"
-    func_error "Continuing, but uninstalled executables may not work."
-    # Fallback.  This is a deliberately simplistic "conversion" and
-    # should not be "improved".  See libtool.info.
-    if test "x$1" != "x$2"; then
-      lt_replace_pathsep_chars="s|$1|$2|g"
-      func_to_host_path_result=`echo "$3" |
-        $SED -e "$lt_replace_pathsep_chars"`
-    else
-      func_to_host_path_result=$3
-    fi
-  fi
-}
-# end func_convert_path_check
-
-
-# func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG
-# Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT
-# and appending REPL if ORIG matches BACKPAT.
-func_convert_path_front_back_pathsep ()
-{
-  $debug_cmd
-
-  case $4 in
-  $1 ) func_to_host_path_result=$3$func_to_host_path_result
-    ;;
-  esac
-  case $4 in
-  $2 ) func_append func_to_host_path_result "$3"
-    ;;
-  esac
-}
-# end func_convert_path_front_back_pathsep
-
-
-##################################################
-# $build to $host FILE NAME CONVERSION FUNCTIONS #
-##################################################
-# invoked via '$to_host_file_cmd ARG'
-#
-# In each case, ARG is the path to be converted from $build to $host format.
-# Result will be available in $func_to_host_file_result.
-
-
-# func_to_host_file ARG
-# Converts the file name ARG from $build format to $host format. Return result
-# in func_to_host_file_result.
-func_to_host_file ()
-{
-  $debug_cmd
-
-  $to_host_file_cmd "$1"
-}
-# end func_to_host_file
-
-
-# func_to_tool_file ARG LAZY
-# converts the file name ARG from $build format to toolchain format. Return
-# result in func_to_tool_file_result.  If the conversion in use is listed
-# in (the comma separated) LAZY, no conversion takes place.
-func_to_tool_file ()
-{
-  $debug_cmd
-
-  case ,$2, in
-    *,"$to_tool_file_cmd",*)
-      func_to_tool_file_result=$1
-      ;;
-    *)
-      $to_tool_file_cmd "$1"
-      func_to_tool_file_result=$func_to_host_file_result
-      ;;
-  esac
-}
-# end func_to_tool_file
-
-
-# func_convert_file_noop ARG
-# Copy ARG to func_to_host_file_result.
-func_convert_file_noop ()
-{
-  func_to_host_file_result=$1
-}
-# end func_convert_file_noop
-
-
-# func_convert_file_msys_to_w32 ARG
-# Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic
-# conversion to w32 is not available inside the cwrapper.  Returns result in
-# func_to_host_file_result.
-func_convert_file_msys_to_w32 ()
-{
-  $debug_cmd
-
-  func_to_host_file_result=$1
-  if test -n "$1"; then
-    func_convert_core_msys_to_w32 "$1"
-    func_to_host_file_result=$func_convert_core_msys_to_w32_result
-  fi
-  func_convert_file_check "$1" "$func_to_host_file_result"
-}
-# end func_convert_file_msys_to_w32
-
-
-# func_convert_file_cygwin_to_w32 ARG
-# Convert file name ARG from Cygwin to w32 format.  Returns result in
-# func_to_host_file_result.
-func_convert_file_cygwin_to_w32 ()
-{
-  $debug_cmd
-
-  func_to_host_file_result=$1
-  if test -n "$1"; then
-    # because $build is cygwin, we call "the" cygpath in $PATH; no need to use
-    # LT_CYGPATH in this case.
-    func_to_host_file_result=`cygpath -m "$1"`
-  fi
-  func_convert_file_check "$1" "$func_to_host_file_result"
-}
-# end func_convert_file_cygwin_to_w32
-
-
-# func_convert_file_nix_to_w32 ARG
-# Convert file name ARG from *nix to w32 format.  Requires a wine environment
-# and a working winepath. Returns result in func_to_host_file_result.
-func_convert_file_nix_to_w32 ()
-{
-  $debug_cmd
-
-  func_to_host_file_result=$1
-  if test -n "$1"; then
-    func_convert_core_file_wine_to_w32 "$1"
-    func_to_host_file_result=$func_convert_core_file_wine_to_w32_result
-  fi
-  func_convert_file_check "$1" "$func_to_host_file_result"
-}
-# end func_convert_file_nix_to_w32
-
-
-# func_convert_file_msys_to_cygwin ARG
-# Convert file name ARG from MSYS to Cygwin format.  Requires LT_CYGPATH set.
-# Returns result in func_to_host_file_result.
-func_convert_file_msys_to_cygwin ()
-{
-  $debug_cmd
-
-  func_to_host_file_result=$1
-  if test -n "$1"; then
-    func_convert_core_msys_to_w32 "$1"
-    func_cygpath -u "$func_convert_core_msys_to_w32_result"
-    func_to_host_file_result=$func_cygpath_result
-  fi
-  func_convert_file_check "$1" "$func_to_host_file_result"
-}
-# end func_convert_file_msys_to_cygwin
-
-
-# func_convert_file_nix_to_cygwin ARG
-# Convert file name ARG from *nix to Cygwin format.  Requires Cygwin installed
-# in a wine environment, working winepath, and LT_CYGPATH set.  Returns result
-# in func_to_host_file_result.
-func_convert_file_nix_to_cygwin ()
-{
-  $debug_cmd
-
-  func_to_host_file_result=$1
-  if test -n "$1"; then
-    # convert from *nix to w32, then use cygpath to convert from w32 to cygwin.
-    func_convert_core_file_wine_to_w32 "$1"
-    func_cygpath -u "$func_convert_core_file_wine_to_w32_result"
-    func_to_host_file_result=$func_cygpath_result
-  fi
-  func_convert_file_check "$1" "$func_to_host_file_result"
-}
-# end func_convert_file_nix_to_cygwin
-
-
-#############################################
-# $build to $host PATH CONVERSION FUNCTIONS #
-#############################################
-# invoked via '$to_host_path_cmd ARG'
-#
-# In each case, ARG is the path to be converted from $build to $host format.
-# The result will be available in $func_to_host_path_result.
-#
-# Path separators are also converted from $build format to $host format.  If
-# ARG begins or ends with a path separator character, it is preserved (but
-# converted to $host format) on output.
-#
-# All path conversion functions are named using the following convention:
-#   file name conversion function    : func_convert_file_X_to_Y ()
-#   path conversion function         : func_convert_path_X_to_Y ()
-# where, for any given $build/$host combination the 'X_to_Y' value is the
-# same.  If conversion functions are added for new $build/$host combinations,
-# the two new functions must follow this pattern, or func_init_to_host_path_cmd
-# will break.
-
-
-# func_init_to_host_path_cmd
-# Ensures that function "pointer" variable $to_host_path_cmd is set to the
-# appropriate value, based on the value of $to_host_file_cmd.
-to_host_path_cmd=
-func_init_to_host_path_cmd ()
-{
-  $debug_cmd
-
-  if test -z "$to_host_path_cmd"; then
-    func_stripname 'func_convert_file_' '' "$to_host_file_cmd"
-    to_host_path_cmd=func_convert_path_$func_stripname_result
-  fi
-}
-
-
-# func_to_host_path ARG
-# Converts the path ARG from $build format to $host format. Return result
-# in func_to_host_path_result.
-func_to_host_path ()
-{
-  $debug_cmd
-
-  func_init_to_host_path_cmd
-  $to_host_path_cmd "$1"
-}
-# end func_to_host_path
-
-
-# func_convert_path_noop ARG
-# Copy ARG to func_to_host_path_result.
-func_convert_path_noop ()
-{
-  func_to_host_path_result=$1
-}
-# end func_convert_path_noop
-
-
-# func_convert_path_msys_to_w32 ARG
-# Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic
-# conversion to w32 is not available inside the cwrapper.  Returns result in
-# func_to_host_path_result.
-func_convert_path_msys_to_w32 ()
-{
-  $debug_cmd
-
-  func_to_host_path_result=$1
-  if test -n "$1"; then
-    # Remove leading and trailing path separator characters from ARG.  MSYS
-    # behavior is inconsistent here; cygpath turns them into '.;' and ';.';
-    # and winepath ignores them completely.
-    func_stripname : : "$1"
-    func_to_host_path_tmp1=$func_stripname_result
-    func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
-    func_to_host_path_result=$func_convert_core_msys_to_w32_result
-    func_convert_path_check : ";" \
-      "$func_to_host_path_tmp1" "$func_to_host_path_result"
-    func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
-  fi
-}
-# end func_convert_path_msys_to_w32
-
-
-# func_convert_path_cygwin_to_w32 ARG
-# Convert path ARG from Cygwin to w32 format.  Returns result in
-# func_to_host_file_result.
-func_convert_path_cygwin_to_w32 ()
-{
-  $debug_cmd
-
-  func_to_host_path_result=$1
-  if test -n "$1"; then
-    # See func_convert_path_msys_to_w32:
-    func_stripname : : "$1"
-    func_to_host_path_tmp1=$func_stripname_result
-    func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"`
-    func_convert_path_check : ";" \
-      "$func_to_host_path_tmp1" "$func_to_host_path_result"
-    func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
-  fi
-}
-# end func_convert_path_cygwin_to_w32
-
-
-# func_convert_path_nix_to_w32 ARG
-# Convert path ARG from *nix to w32 format.  Requires a wine environment and
-# a working winepath.  Returns result in func_to_host_file_result.
-func_convert_path_nix_to_w32 ()
-{
-  $debug_cmd
-
-  func_to_host_path_result=$1
-  if test -n "$1"; then
-    # See func_convert_path_msys_to_w32:
-    func_stripname : : "$1"
-    func_to_host_path_tmp1=$func_stripname_result
-    func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
-    func_to_host_path_result=$func_convert_core_path_wine_to_w32_result
-    func_convert_path_check : ";" \
-      "$func_to_host_path_tmp1" "$func_to_host_path_result"
-    func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
-  fi
-}
-# end func_convert_path_nix_to_w32
-
-
-# func_convert_path_msys_to_cygwin ARG
-# Convert path ARG from MSYS to Cygwin format.  Requires LT_CYGPATH set.
-# Returns result in func_to_host_file_result.
-func_convert_path_msys_to_cygwin ()
-{
-  $debug_cmd
-
-  func_to_host_path_result=$1
-  if test -n "$1"; then
-    # See func_convert_path_msys_to_w32:
-    func_stripname : : "$1"
-    func_to_host_path_tmp1=$func_stripname_result
-    func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
-    func_cygpath -u -p "$func_convert_core_msys_to_w32_result"
-    func_to_host_path_result=$func_cygpath_result
-    func_convert_path_check : : \
-      "$func_to_host_path_tmp1" "$func_to_host_path_result"
-    func_convert_path_front_back_pathsep ":*" "*:" : "$1"
-  fi
-}
-# end func_convert_path_msys_to_cygwin
-
-
-# func_convert_path_nix_to_cygwin ARG
-# Convert path ARG from *nix to Cygwin format.  Requires Cygwin installed in a
-# a wine environment, working winepath, and LT_CYGPATH set.  Returns result in
-# func_to_host_file_result.
-func_convert_path_nix_to_cygwin ()
-{
-  $debug_cmd
-
-  func_to_host_path_result=$1
-  if test -n "$1"; then
-    # Remove leading and trailing path separator characters from
-    # ARG. msys behavior is inconsistent here, cygpath turns them
-    # into '.;' and ';.', and winepath ignores them completely.
-    func_stripname : : "$1"
-    func_to_host_path_tmp1=$func_stripname_result
-    func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
-    func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result"
-    func_to_host_path_result=$func_cygpath_result
-    func_convert_path_check : : \
-      "$func_to_host_path_tmp1" "$func_to_host_path_result"
-    func_convert_path_front_back_pathsep ":*" "*:" : "$1"
-  fi
-}
-# end func_convert_path_nix_to_cygwin
-
-
-# func_dll_def_p FILE
-# True iff FILE is a Windows DLL '.def' file.
-# Keep in sync with _LT_DLL_DEF_P in libtool.m4
-func_dll_def_p ()
-{
-  $debug_cmd
-
-  func_dll_def_p_tmp=`$SED -n \
-    -e 's/^[	 ]*//' \
-    -e '/^\(;.*\)*$/d' \
-    -e 's/^\(EXPORTS\|LIBRARY\)\([	 ].*\)*$/DEF/p' \
-    -e q \
-    "$1"`
-  test DEF = "$func_dll_def_p_tmp"
-}
-
-
-# func_mode_compile arg...
-func_mode_compile ()
-{
-    $debug_cmd
-
-    # Get the compilation command and the source file.
-    base_compile=
-    srcfile=$nonopt  #  always keep a non-empty value in "srcfile"
-    suppress_opt=yes
-    suppress_output=
-    arg_mode=normal
-    libobj=
-    later=
-    pie_flag=
-
-    for arg
-    do
-      case $arg_mode in
-      arg  )
-	# do not "continue".  Instead, add this to base_compile
-	lastarg=$arg
-	arg_mode=normal
-	;;
-
-      target )
-	libobj=$arg
-	arg_mode=normal
-	continue
-	;;
-
-      normal )
-	# Accept any command-line options.
-	case $arg in
-	-o)
-	  test -n "$libobj" && \
-	    func_fatal_error "you cannot specify '-o' more than once"
-	  arg_mode=target
-	  continue
-	  ;;
-
-	-pie | -fpie | -fPIE)
-          func_append pie_flag " $arg"
-	  continue
-	  ;;
-
-	-shared | -static | -prefer-pic | -prefer-non-pic)
-	  func_append later " $arg"
-	  continue
-	  ;;
-
-	-no-suppress)
-	  suppress_opt=no
-	  continue
-	  ;;
-
-	-Xcompiler)
-	  arg_mode=arg  #  the next one goes into the "base_compile" arg list
-	  continue      #  The current "srcfile" will either be retained or
-	  ;;            #  replaced later.  I would guess that would be a bug.
-
-	-Wc,*)
-	  func_stripname '-Wc,' '' "$arg"
-	  args=$func_stripname_result
-	  lastarg=
-	  save_ifs=$IFS; IFS=,
-	  for arg in $args; do
-	    IFS=$save_ifs
-	    func_append_quoted lastarg "$arg"
-	  done
-	  IFS=$save_ifs
-	  func_stripname ' ' '' "$lastarg"
-	  lastarg=$func_stripname_result
-
-	  # Add the arguments to base_compile.
-	  func_append base_compile " $lastarg"
-	  continue
-	  ;;
-
-	*)
-	  # Accept the current argument as the source file.
-	  # The previous "srcfile" becomes the current argument.
-	  #
-	  lastarg=$srcfile
-	  srcfile=$arg
-	  ;;
-	esac  #  case $arg
-	;;
-      esac    #  case $arg_mode
-
-      # Aesthetically quote the previous argument.
-      func_append_quoted base_compile "$lastarg"
-    done # for arg
-
-    case $arg_mode in
-    arg)
-      func_fatal_error "you must specify an argument for -Xcompile"
-      ;;
-    target)
-      func_fatal_error "you must specify a target with '-o'"
-      ;;
-    *)
-      # Get the name of the library object.
-      test -z "$libobj" && {
-	func_basename "$srcfile"
-	libobj=$func_basename_result
-      }
-      ;;
-    esac
-
-    # Recognize several different file suffixes.
-    # If the user specifies -o file.o, it is replaced with file.lo
-    case $libobj in
-    *.[cCFSifmso] | \
-    *.ada | *.adb | *.ads | *.asm | \
-    *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \
-    *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup)
-      func_xform "$libobj"
-      libobj=$func_xform_result
-      ;;
-    esac
-
-    case $libobj in
-    *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;;
-    *)
-      func_fatal_error "cannot determine name of library object from '$libobj'"
-      ;;
-    esac
-
-    func_infer_tag $base_compile
-
-    for arg in $later; do
-      case $arg in
-      -shared)
-	test yes = "$build_libtool_libs" \
-	  || func_fatal_configuration "cannot build a shared library"
-	build_old_libs=no
-	continue
-	;;
-
-      -static)
-	build_libtool_libs=no
-	build_old_libs=yes
-	continue
-	;;
-
-      -prefer-pic)
-	pic_mode=yes
-	continue
-	;;
-
-      -prefer-non-pic)
-	pic_mode=no
-	continue
-	;;
-      esac
-    done
-
-    func_quote_for_eval "$libobj"
-    test "X$libobj" != "X$func_quote_for_eval_result" \
-      && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"'	 &()|`$[]' \
-      && func_warning "libobj name '$libobj' may not contain shell special characters."
-    func_dirname_and_basename "$obj" "/" ""
-    objname=$func_basename_result
-    xdir=$func_dirname_result
-    lobj=$xdir$objdir/$objname
-
-    test -z "$base_compile" && \
-      func_fatal_help "you must specify a compilation command"
-
-    # Delete any leftover library objects.
-    if test yes = "$build_old_libs"; then
-      removelist="$obj $lobj $libobj ${libobj}T"
-    else
-      removelist="$lobj $libobj ${libobj}T"
-    fi
-
-    # On Cygwin there's no "real" PIC flag so we must build both object types
-    case $host_os in
-    cygwin* | mingw* | pw32* | os2* | cegcc*)
-      pic_mode=default
-      ;;
-    esac
-    if test no = "$pic_mode" && test pass_all != "$deplibs_check_method"; then
-      # non-PIC code in shared libraries is not supported
-      pic_mode=default
-    fi
-
-    # Calculate the filename of the output object if compiler does
-    # not support -o with -c
-    if test no = "$compiler_c_o"; then
-      output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.$objext
-      lockfile=$output_obj.lock
-    else
-      output_obj=
-      need_locks=no
-      lockfile=
-    fi
-
-    # Lock this critical section if it is needed
-    # We use this script file to make the link, it avoids creating a new file
-    if test yes = "$need_locks"; then
-      until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
-	func_echo "Waiting for $lockfile to be removed"
-	sleep 2
-      done
-    elif test warn = "$need_locks"; then
-      if test -f "$lockfile"; then
-	$ECHO "\
-*** ERROR, $lockfile exists and contains:
-`cat $lockfile 2>/dev/null`
-
-This indicates that another process is trying to use the same
-temporary object file, and libtool could not work around it because
-your compiler does not support '-c' and '-o' together.  If you
-repeat this compilation, it may succeed, by chance, but you had better
-avoid parallel builds (make -j) in this platform, or get a better
-compiler."
-
-	$opt_dry_run || $RM $removelist
-	exit $EXIT_FAILURE
-      fi
-      func_append removelist " $output_obj"
-      $ECHO "$srcfile" > "$lockfile"
-    fi
-
-    $opt_dry_run || $RM $removelist
-    func_append removelist " $lockfile"
-    trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15
-
-    func_to_tool_file "$srcfile" func_convert_file_msys_to_w32
-    srcfile=$func_to_tool_file_result
-    func_quote_for_eval "$srcfile"
-    qsrcfile=$func_quote_for_eval_result
-
-    # Only build a PIC object if we are building libtool libraries.
-    if test yes = "$build_libtool_libs"; then
-      # Without this assignment, base_compile gets emptied.
-      fbsd_hideous_sh_bug=$base_compile
-
-      if test no != "$pic_mode"; then
-	command="$base_compile $qsrcfile $pic_flag"
-      else
-	# Don't build PIC code
-	command="$base_compile $qsrcfile"
-      fi
-
-      func_mkdir_p "$xdir$objdir"
-
-      if test -z "$output_obj"; then
-	# Place PIC objects in $objdir
-	func_append command " -o $lobj"
-      fi
-
-      func_show_eval_locale "$command"	\
-          'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE'
-
-      if test warn = "$need_locks" &&
-	 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
-	$ECHO "\
-*** ERROR, $lockfile contains:
-`cat $lockfile 2>/dev/null`
-
-but it should contain:
-$srcfile
-
-This indicates that another process is trying to use the same
-temporary object file, and libtool could not work around it because
-your compiler does not support '-c' and '-o' together.  If you
-repeat this compilation, it may succeed, by chance, but you had better
-avoid parallel builds (make -j) in this platform, or get a better
-compiler."
-
-	$opt_dry_run || $RM $removelist
-	exit $EXIT_FAILURE
-      fi
-
-      # Just move the object if needed, then go on to compile the next one
-      if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
-	func_show_eval '$MV "$output_obj" "$lobj"' \
-	  'error=$?; $opt_dry_run || $RM $removelist; exit $error'
-      fi
-
-      # Allow error messages only from the first compilation.
-      if test yes = "$suppress_opt"; then
-	suppress_output=' >/dev/null 2>&1'
-      fi
-    fi
-
-    # Only build a position-dependent object if we build old libraries.
-    if test yes = "$build_old_libs"; then
-      if test yes != "$pic_mode"; then
-	# Don't build PIC code
-	command="$base_compile $qsrcfile$pie_flag"
-      else
-	command="$base_compile $qsrcfile $pic_flag"
-      fi
-      if test yes = "$compiler_c_o"; then
-	func_append command " -o $obj"
-      fi
-
-      # Suppress compiler output if we already did a PIC compilation.
-      func_append command "$suppress_output"
-      func_show_eval_locale "$command" \
-        '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
-
-      if test warn = "$need_locks" &&
-	 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
-	$ECHO "\
-*** ERROR, $lockfile contains:
-`cat $lockfile 2>/dev/null`
-
-but it should contain:
-$srcfile
-
-This indicates that another process is trying to use the same
-temporary object file, and libtool could not work around it because
-your compiler does not support '-c' and '-o' together.  If you
-repeat this compilation, it may succeed, by chance, but you had better
-avoid parallel builds (make -j) in this platform, or get a better
-compiler."
-
-	$opt_dry_run || $RM $removelist
-	exit $EXIT_FAILURE
-      fi
-
-      # Just move the object if needed
-      if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
-	func_show_eval '$MV "$output_obj" "$obj"' \
-	  'error=$?; $opt_dry_run || $RM $removelist; exit $error'
-      fi
-    fi
-
-    $opt_dry_run || {
-      func_write_libtool_object "$libobj" "$objdir/$objname" "$objname"
-
-      # Unlock the critical section if it was locked
-      if test no != "$need_locks"; then
-	removelist=$lockfile
-        $RM "$lockfile"
-      fi
-    }
-
-    exit $EXIT_SUCCESS
-}
-
-$opt_help || {
-  test compile = "$opt_mode" && func_mode_compile ${1+"$@"}
-}
-
-func_mode_help ()
-{
-    # We need to display help for each of the modes.
-    case $opt_mode in
-      "")
-        # Generic help is extracted from the usage comments
-        # at the start of this file.
-        func_help
-        ;;
-
-      clean)
-        $ECHO \
-"Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
-
-Remove files from the build directory.
-
-RM is the name of the program to use to delete files associated with each FILE
-(typically '/bin/rm').  RM-OPTIONS are options (such as '-f') to be passed
-to RM.
-
-If FILE is a libtool library, object or program, all the files associated
-with it are deleted. Otherwise, only FILE itself is deleted using RM."
-        ;;
-
-      compile)
-      $ECHO \
-"Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
-
-Compile a source file into a libtool library object.
-
-This mode accepts the following additional options:
-
-  -o OUTPUT-FILE    set the output file name to OUTPUT-FILE
-  -no-suppress      do not suppress compiler output for multiple passes
-  -prefer-pic       try to build PIC objects only
-  -prefer-non-pic   try to build non-PIC objects only
-  -shared           do not build a '.o' file suitable for static linking
-  -static           only build a '.o' file suitable for static linking
-  -Wc,FLAG          pass FLAG directly to the compiler
-
-COMPILE-COMMAND is a command to be used in creating a 'standard' object file
-from the given SOURCEFILE.
-
-The output file name is determined by removing the directory component from
-SOURCEFILE, then substituting the C source code suffix '.c' with the
-library object suffix, '.lo'."
-        ;;
-
-      execute)
-        $ECHO \
-"Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]...
-
-Automatically set library path, then run a program.
-
-This mode accepts the following additional options:
-
-  -dlopen FILE      add the directory containing FILE to the library path
-
-This mode sets the library path environment variable according to '-dlopen'
-flags.
-
-If any of the ARGS are libtool executable wrappers, then they are translated
-into their corresponding uninstalled binary, and any of their required library
-directories are added to the library path.
-
-Then, COMMAND is executed, with ARGS as arguments."
-        ;;
-
-      finish)
-        $ECHO \
-"Usage: $progname [OPTION]... --mode=finish [LIBDIR]...
-
-Complete the installation of libtool libraries.
-
-Each LIBDIR is a directory that contains libtool libraries.
-
-The commands that this mode executes may require superuser privileges.  Use
-the '--dry-run' option if you just want to see what would be executed."
-        ;;
-
-      install)
-        $ECHO \
-"Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND...
-
-Install executables or libraries.
-
-INSTALL-COMMAND is the installation command.  The first component should be
-either the 'install' or 'cp' program.
-
-The following components of INSTALL-COMMAND are treated specially:
-
-  -inst-prefix-dir PREFIX-DIR  Use PREFIX-DIR as a staging area for installation
-
-The rest of the components are interpreted as arguments to that command (only
-BSD-compatible install options are recognized)."
-        ;;
-
-      link)
-        $ECHO \
-"Usage: $progname [OPTION]... --mode=link LINK-COMMAND...
-
-Link object files or libraries together to form another library, or to
-create an executable program.
-
-LINK-COMMAND is a command using the C compiler that you would use to create
-a program from several object files.
-
-The following components of LINK-COMMAND are treated specially:
-
-  -all-static       do not do any dynamic linking at all
-  -avoid-version    do not add a version suffix if possible
-  -bindir BINDIR    specify path to binaries directory (for systems where
-                    libraries must be found in the PATH setting at runtime)
-  -dlopen FILE      '-dlpreopen' FILE if it cannot be dlopened at runtime
-  -dlpreopen FILE   link in FILE and add its symbols to lt_preloaded_symbols
-  -export-dynamic   allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
-  -export-symbols SYMFILE
-                    try to export only the symbols listed in SYMFILE
-  -export-symbols-regex REGEX
-                    try to export only the symbols matching REGEX
-  -LLIBDIR          search LIBDIR for required installed libraries
-  -lNAME            OUTPUT-FILE requires the installed library libNAME
-  -module           build a library that can dlopened
-  -no-fast-install  disable the fast-install mode
-  -no-install       link a not-installable executable
-  -no-undefined     declare that a library does not refer to external symbols
-  -o OUTPUT-FILE    create OUTPUT-FILE from the specified objects
-  -objectlist FILE  use a list of object files found in FILE to specify objects
-  -os2dllname NAME  force a short DLL name on OS/2 (no effect on other OSes)
-  -precious-files-regex REGEX
-                    don't remove output files matching REGEX
-  -release RELEASE  specify package release information
-  -rpath LIBDIR     the created library will eventually be installed in LIBDIR
-  -R[ ]LIBDIR       add LIBDIR to the runtime path of programs and libraries
-  -shared           only do dynamic linking of libtool libraries
-  -shrext SUFFIX    override the standard shared library file extension
-  -static           do not do any dynamic linking of uninstalled libtool libraries
-  -static-libtool-libs
-                    do not do any dynamic linking of libtool libraries
-  -version-info CURRENT[:REVISION[:AGE]]
-                    specify library version info [each variable defaults to 0]
-  -weak LIBNAME     declare that the target provides the LIBNAME interface
-  -Wc,FLAG
-  -Xcompiler FLAG   pass linker-specific FLAG directly to the compiler
-  -Wl,FLAG
-  -Xlinker FLAG     pass linker-specific FLAG directly to the linker
-  -XCClinker FLAG   pass link-specific FLAG to the compiler driver (CC)
-
-All other options (arguments beginning with '-') are ignored.
-
-Every other argument is treated as a filename.  Files ending in '.la' are
-treated as uninstalled libtool libraries, other files are standard or library
-object files.
-
-If the OUTPUT-FILE ends in '.la', then a libtool library is created,
-only library objects ('.lo' files) may be specified, and '-rpath' is
-required, except when creating a convenience library.
-
-If OUTPUT-FILE ends in '.a' or '.lib', then a standard library is created
-using 'ar' and 'ranlib', or on Windows using 'lib'.
-
-If OUTPUT-FILE ends in '.lo' or '.$objext', then a reloadable object file
-is created, otherwise an executable program is created."
-        ;;
-
-      uninstall)
-        $ECHO \
-"Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
-
-Remove libraries from an installation directory.
-
-RM is the name of the program to use to delete files associated with each FILE
-(typically '/bin/rm').  RM-OPTIONS are options (such as '-f') to be passed
-to RM.
-
-If FILE is a libtool library, all the files associated with it are deleted.
-Otherwise, only FILE itself is deleted using RM."
-        ;;
-
-      *)
-        func_fatal_help "invalid operation mode '$opt_mode'"
-        ;;
-    esac
-
-    echo
-    $ECHO "Try '$progname --help' for more information about other modes."
-}
-
-# Now that we've collected a possible --mode arg, show help if necessary
-if $opt_help; then
-  if test : = "$opt_help"; then
-    func_mode_help
-  else
-    {
-      func_help noexit
-      for opt_mode in compile link execute install finish uninstall clean; do
-	func_mode_help
-      done
-    } | $SED -n '1p; 2,$s/^Usage:/  or: /p'
-    {
-      func_help noexit
-      for opt_mode in compile link execute install finish uninstall clean; do
-	echo
-	func_mode_help
-      done
-    } |
-    $SED '1d
-      /^When reporting/,/^Report/{
-	H
-	d
-      }
-      $x
-      /information about other modes/d
-      /more detailed .*MODE/d
-      s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/'
-  fi
-  exit $?
-fi
-
-
-# func_mode_execute arg...
-func_mode_execute ()
-{
-    $debug_cmd
-
-    # The first argument is the command name.
-    cmd=$nonopt
-    test -z "$cmd" && \
-      func_fatal_help "you must specify a COMMAND"
-
-    # Handle -dlopen flags immediately.
-    for file in $opt_dlopen; do
-      test -f "$file" \
-	|| func_fatal_help "'$file' is not a file"
-
-      dir=
-      case $file in
-      *.la)
-	func_resolve_sysroot "$file"
-	file=$func_resolve_sysroot_result
-
-	# Check to see that this really is a libtool archive.
-	func_lalib_unsafe_p "$file" \
-	  || func_fatal_help "'$lib' is not a valid libtool archive"
-
-	# Read the libtool library.
-	dlname=
-	library_names=
-	func_source "$file"
-
-	# Skip this library if it cannot be dlopened.
-	if test -z "$dlname"; then
-	  # Warn if it was a shared library.
-	  test -n "$library_names" && \
-	    func_warning "'$file' was not linked with '-export-dynamic'"
-	  continue
-	fi
-
-	func_dirname "$file" "" "."
-	dir=$func_dirname_result
-
-	if test -f "$dir/$objdir/$dlname"; then
-	  func_append dir "/$objdir"
-	else
-	  if test ! -f "$dir/$dlname"; then
-	    func_fatal_error "cannot find '$dlname' in '$dir' or '$dir/$objdir'"
-	  fi
-	fi
-	;;
-
-      *.lo)
-	# Just add the directory containing the .lo file.
-	func_dirname "$file" "" "."
-	dir=$func_dirname_result
-	;;
-
-      *)
-	func_warning "'-dlopen' is ignored for non-libtool libraries and objects"
-	continue
-	;;
-      esac
-
-      # Get the absolute pathname.
-      absdir=`cd "$dir" && pwd`
-      test -n "$absdir" && dir=$absdir
-
-      # Now add the directory to shlibpath_var.
-      if eval "test -z \"\$$shlibpath_var\""; then
-	eval "$shlibpath_var=\"\$dir\""
-      else
-	eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
-      fi
-    done
-
-    # This variable tells wrapper scripts just to set shlibpath_var
-    # rather than running their programs.
-    libtool_execute_magic=$magic
-
-    # Check if any of the arguments is a wrapper script.
-    args=
-    for file
-    do
-      case $file in
-      -* | *.la | *.lo ) ;;
-      *)
-	# Do a test to see if this is really a libtool program.
-	if func_ltwrapper_script_p "$file"; then
-	  func_source "$file"
-	  # Transform arg to wrapped name.
-	  file=$progdir/$program
-	elif func_ltwrapper_executable_p "$file"; then
-	  func_ltwrapper_scriptname "$file"
-	  func_source "$func_ltwrapper_scriptname_result"
-	  # Transform arg to wrapped name.
-	  file=$progdir/$program
-	fi
-	;;
-      esac
-      # Quote arguments (to preserve shell metacharacters).
-      func_append_quoted args "$file"
-    done
-
-    if $opt_dry_run; then
-      # Display what would be done.
-      if test -n "$shlibpath_var"; then
-	eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
-	echo "export $shlibpath_var"
-      fi
-      $ECHO "$cmd$args"
-      exit $EXIT_SUCCESS
-    else
-      if test -n "$shlibpath_var"; then
-	# Export the shlibpath_var.
-	eval "export $shlibpath_var"
-      fi
-
-      # Restore saved environment variables
-      for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
-      do
-	eval "if test \"\${save_$lt_var+set}\" = set; then
-                $lt_var=\$save_$lt_var; export $lt_var
-	      else
-		$lt_unset $lt_var
-	      fi"
-      done
-
-      # Now prepare to actually exec the command.
-      exec_cmd=\$cmd$args
-    fi
-}
-
-test execute = "$opt_mode" && func_mode_execute ${1+"$@"}
-
-
-# func_mode_finish arg...
-func_mode_finish ()
-{
-    $debug_cmd
-
-    libs=
-    libdirs=
-    admincmds=
-
-    for opt in "$nonopt" ${1+"$@"}
-    do
-      if test -d "$opt"; then
-	func_append libdirs " $opt"
-
-      elif test -f "$opt"; then
-	if func_lalib_unsafe_p "$opt"; then
-	  func_append libs " $opt"
-	else
-	  func_warning "'$opt' is not a valid libtool archive"
-	fi
-
-      else
-	func_fatal_error "invalid argument '$opt'"
-      fi
-    done
-
-    if test -n "$libs"; then
-      if test -n "$lt_sysroot"; then
-        sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"`
-        sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;"
-      else
-        sysroot_cmd=
-      fi
-
-      # Remove sysroot references
-      if $opt_dry_run; then
-        for lib in $libs; do
-          echo "removing references to $lt_sysroot and '=' prefixes from $lib"
-        done
-      else
-        tmpdir=`func_mktempdir`
-        for lib in $libs; do
-	  $SED -e "$sysroot_cmd s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \
-	    > $tmpdir/tmp-la
-	  mv -f $tmpdir/tmp-la $lib
-	done
-        ${RM}r "$tmpdir"
-      fi
-    fi
-
-    if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
-      for libdir in $libdirs; do
-	if test -n "$finish_cmds"; then
-	  # Do each command in the finish commands.
-	  func_execute_cmds "$finish_cmds" 'admincmds="$admincmds
-'"$cmd"'"'
-	fi
-	if test -n "$finish_eval"; then
-	  # Do the single finish_eval.
-	  eval cmds=\"$finish_eval\"
-	  $opt_dry_run || eval "$cmds" || func_append admincmds "
-       $cmds"
-	fi
-      done
-    fi
-
-    # Exit here if they wanted silent mode.
-    $opt_quiet && exit $EXIT_SUCCESS
-
-    if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
-      echo "----------------------------------------------------------------------"
-      echo "Libraries have been installed in:"
-      for libdir in $libdirs; do
-	$ECHO "   $libdir"
-      done
-      echo
-      echo "If you ever happen to want to link against installed libraries"
-      echo "in a given directory, LIBDIR, you must either use libtool, and"
-      echo "specify the full pathname of the library, or use the '-LLIBDIR'"
-      echo "flag during linking and do at least one of the following:"
-      if test -n "$shlibpath_var"; then
-	echo "   - add LIBDIR to the '$shlibpath_var' environment variable"
-	echo "     during execution"
-      fi
-      if test -n "$runpath_var"; then
-	echo "   - add LIBDIR to the '$runpath_var' environment variable"
-	echo "     during linking"
-      fi
-      if test -n "$hardcode_libdir_flag_spec"; then
-	libdir=LIBDIR
-	eval flag=\"$hardcode_libdir_flag_spec\"
-
-	$ECHO "   - use the '$flag' linker flag"
-      fi
-      if test -n "$admincmds"; then
-	$ECHO "   - have your system administrator run these commands:$admincmds"
-      fi
-      if test -f /etc/ld.so.conf; then
-	echo "   - have your system administrator add LIBDIR to '/etc/ld.so.conf'"
-      fi
-      echo
-
-      echo "See any operating system documentation about shared libraries for"
-      case $host in
-	solaris2.[6789]|solaris2.1[0-9])
-	  echo "more information, such as the ld(1), crle(1) and ld.so(8) manual"
-	  echo "pages."
-	  ;;
-	*)
-	  echo "more information, such as the ld(1) and ld.so(8) manual pages."
-	  ;;
-      esac
-      echo "----------------------------------------------------------------------"
-    fi
-    exit $EXIT_SUCCESS
-}
-
-test finish = "$opt_mode" && func_mode_finish ${1+"$@"}
-
-
-# func_mode_install arg...
-func_mode_install ()
-{
-    $debug_cmd
-
-    # There may be an optional sh(1) argument at the beginning of
-    # install_prog (especially on Windows NT).
-    if test "$SHELL" = "$nonopt" || test /bin/sh = "$nonopt" ||
-       # Allow the use of GNU shtool's install command.
-       case $nonopt in *shtool*) :;; *) false;; esac
-    then
-      # Aesthetically quote it.
-      func_quote_for_eval "$nonopt"
-      install_prog="$func_quote_for_eval_result "
-      arg=$1
-      shift
-    else
-      install_prog=
-      arg=$nonopt
-    fi
-
-    # The real first argument should be the name of the installation program.
-    # Aesthetically quote it.
-    func_quote_for_eval "$arg"
-    func_append install_prog "$func_quote_for_eval_result"
-    install_shared_prog=$install_prog
-    case " $install_prog " in
-      *[\\\ /]cp\ *) install_cp=: ;;
-      *) install_cp=false ;;
-    esac
-
-    # We need to accept at least all the BSD install flags.
-    dest=
-    files=
-    opts=
-    prev=
-    install_type=
-    isdir=false
-    stripme=
-    no_mode=:
-    for arg
-    do
-      arg2=
-      if test -n "$dest"; then
-	func_append files " $dest"
-	dest=$arg
-	continue
-      fi
-
-      case $arg in
-      -d) isdir=: ;;
-      -f)
-	if $install_cp; then :; else
-	  prev=$arg
-	fi
-	;;
-      -g | -m | -o)
-	prev=$arg
-	;;
-      -s)
-	stripme=" -s"
-	continue
-	;;
-      -*)
-	;;
-      *)
-	# If the previous option needed an argument, then skip it.
-	if test -n "$prev"; then
-	  if test X-m = "X$prev" && test -n "$install_override_mode"; then
-	    arg2=$install_override_mode
-	    no_mode=false
-	  fi
-	  prev=
-	else
-	  dest=$arg
-	  continue
-	fi
-	;;
-      esac
-
-      # Aesthetically quote the argument.
-      func_quote_for_eval "$arg"
-      func_append install_prog " $func_quote_for_eval_result"
-      if test -n "$arg2"; then
-	func_quote_for_eval "$arg2"
-      fi
-      func_append install_shared_prog " $func_quote_for_eval_result"
-    done
-
-    test -z "$install_prog" && \
-      func_fatal_help "you must specify an install program"
-
-    test -n "$prev" && \
-      func_fatal_help "the '$prev' option requires an argument"
-
-    if test -n "$install_override_mode" && $no_mode; then
-      if $install_cp; then :; else
-	func_quote_for_eval "$install_override_mode"
-	func_append install_shared_prog " -m $func_quote_for_eval_result"
-      fi
-    fi
-
-    if test -z "$files"; then
-      if test -z "$dest"; then
-	func_fatal_help "no file or destination specified"
-      else
-	func_fatal_help "you must specify a destination"
-      fi
-    fi
-
-    # Strip any trailing slash from the destination.
-    func_stripname '' '/' "$dest"
-    dest=$func_stripname_result
-
-    # Check to see that the destination is a directory.
-    test -d "$dest" && isdir=:
-    if $isdir; then
-      destdir=$dest
-      destname=
-    else
-      func_dirname_and_basename "$dest" "" "."
-      destdir=$func_dirname_result
-      destname=$func_basename_result
-
-      # Not a directory, so check to see that there is only one file specified.
-      set dummy $files; shift
-      test "$#" -gt 1 && \
-	func_fatal_help "'$dest' is not a directory"
-    fi
-    case $destdir in
-    [\\/]* | [A-Za-z]:[\\/]*) ;;
-    *)
-      for file in $files; do
-	case $file in
-	*.lo) ;;
-	*)
-	  func_fatal_help "'$destdir' must be an absolute directory name"
-	  ;;
-	esac
-      done
-      ;;
-    esac
-
-    # This variable tells wrapper scripts just to set variables rather
-    # than running their programs.
-    libtool_install_magic=$magic
-
-    staticlibs=
-    future_libdirs=
-    current_libdirs=
-    for file in $files; do
-
-      # Do each installation.
-      case $file in
-      *.$libext)
-	# Do the static libraries later.
-	func_append staticlibs " $file"
-	;;
-
-      *.la)
-	func_resolve_sysroot "$file"
-	file=$func_resolve_sysroot_result
-
-	# Check to see that this really is a libtool archive.
-	func_lalib_unsafe_p "$file" \
-	  || func_fatal_help "'$file' is not a valid libtool archive"
-
-	library_names=
-	old_library=
-	relink_command=
-	func_source "$file"
-
-	# Add the libdir to current_libdirs if it is the destination.
-	if test "X$destdir" = "X$libdir"; then
-	  case "$current_libdirs " in
-	  *" $libdir "*) ;;
-	  *) func_append current_libdirs " $libdir" ;;
-	  esac
-	else
-	  # Note the libdir as a future libdir.
-	  case "$future_libdirs " in
-	  *" $libdir "*) ;;
-	  *) func_append future_libdirs " $libdir" ;;
-	  esac
-	fi
-
-	func_dirname "$file" "/" ""
-	dir=$func_dirname_result
-	func_append dir "$objdir"
-
-	if test -n "$relink_command"; then
-	  # Determine the prefix the user has applied to our future dir.
-	  inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"`
-
-	  # Don't allow the user to place us outside of our expected
-	  # location b/c this prevents finding dependent libraries that
-	  # are installed to the same prefix.
-	  # At present, this check doesn't affect windows .dll's that
-	  # are installed into $libdir/../bin (currently, that works fine)
-	  # but it's something to keep an eye on.
-	  test "$inst_prefix_dir" = "$destdir" && \
-	    func_fatal_error "error: cannot install '$file' to a directory not ending in $libdir"
-
-	  if test -n "$inst_prefix_dir"; then
-	    # Stick the inst_prefix_dir data into the link command.
-	    relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
-	  else
-	    relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
-	  fi
-
-	  func_warning "relinking '$file'"
-	  func_show_eval "$relink_command" \
-	    'func_fatal_error "error: relink '\''$file'\'' with the above command before installing it"'
-	fi
-
-	# See the names of the shared library.
-	set dummy $library_names; shift
-	if test -n "$1"; then
-	  realname=$1
-	  shift
-
-	  srcname=$realname
-	  test -n "$relink_command" && srcname=${realname}T
-
-	  # Install the shared library and build the symlinks.
-	  func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \
-	      'exit $?'
-	  tstripme=$stripme
-	  case $host_os in
-	  cygwin* | mingw* | pw32* | cegcc*)
-	    case $realname in
-	    *.dll.a)
-	      tstripme=
-	      ;;
-	    esac
-	    ;;
-	  os2*)
-	    case $realname in
-	    *_dll.a)
-	      tstripme=
-	      ;;
-	    esac
-	    ;;
-	  esac
-	  if test -n "$tstripme" && test -n "$striplib"; then
-	    func_show_eval "$striplib $destdir/$realname" 'exit $?'
-	  fi
-
-	  if test "$#" -gt 0; then
-	    # Delete the old symlinks, and create new ones.
-	    # Try 'ln -sf' first, because the 'ln' binary might depend on
-	    # the symlink we replace!  Solaris /bin/ln does not understand -f,
-	    # so we also need to try rm && ln -s.
-	    for linkname
-	    do
-	      test "$linkname" != "$realname" \
-		&& func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })"
-	    done
-	  fi
-
-	  # Do each command in the postinstall commands.
-	  lib=$destdir/$realname
-	  func_execute_cmds "$postinstall_cmds" 'exit $?'
-	fi
-
-	# Install the pseudo-library for information purposes.
-	func_basename "$file"
-	name=$func_basename_result
-	instname=$dir/${name}i
-	func_show_eval "$install_prog $instname $destdir/$name" 'exit $?'
-
-	# Maybe install the static library, too.
-	test -n "$old_library" && func_append staticlibs " $dir/$old_library"
-	;;
-
-      *.lo)
-	# Install (i.e. copy) a libtool object.
-
-	# Figure out destination file name, if it wasn't already specified.
-	if test -n "$destname"; then
-	  destfile=$destdir/$destname
-	else
-	  func_basename "$file"
-	  destfile=$func_basename_result
-	  destfile=$destdir/$destfile
-	fi
-
-	# Deduce the name of the destination old-style object file.
-	case $destfile in
-	*.lo)
-	  func_lo2o "$destfile"
-	  staticdest=$func_lo2o_result
-	  ;;
-	*.$objext)
-	  staticdest=$destfile
-	  destfile=
-	  ;;
-	*)
-	  func_fatal_help "cannot copy a libtool object to '$destfile'"
-	  ;;
-	esac
-
-	# Install the libtool object if requested.
-	test -n "$destfile" && \
-	  func_show_eval "$install_prog $file $destfile" 'exit $?'
-
-	# Install the old object if enabled.
-	if test yes = "$build_old_libs"; then
-	  # Deduce the name of the old-style object file.
-	  func_lo2o "$file"
-	  staticobj=$func_lo2o_result
-	  func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?'
-	fi
-	exit $EXIT_SUCCESS
-	;;
-
-      *)
-	# Figure out destination file name, if it wasn't already specified.
-	if test -n "$destname"; then
-	  destfile=$destdir/$destname
-	else
-	  func_basename "$file"
-	  destfile=$func_basename_result
-	  destfile=$destdir/$destfile
-	fi
-
-	# If the file is missing, and there is a .exe on the end, strip it
-	# because it is most likely a libtool script we actually want to
-	# install
-	stripped_ext=
-	case $file in
-	  *.exe)
-	    if test ! -f "$file"; then
-	      func_stripname '' '.exe' "$file"
-	      file=$func_stripname_result
-	      stripped_ext=.exe
-	    fi
-	    ;;
-	esac
-
-	# Do a test to see if this is really a libtool program.
-	case $host in
-	*cygwin* | *mingw*)
-	    if func_ltwrapper_executable_p "$file"; then
-	      func_ltwrapper_scriptname "$file"
-	      wrapper=$func_ltwrapper_scriptname_result
-	    else
-	      func_stripname '' '.exe' "$file"
-	      wrapper=$func_stripname_result
-	    fi
-	    ;;
-	*)
-	    wrapper=$file
-	    ;;
-	esac
-	if func_ltwrapper_script_p "$wrapper"; then
-	  notinst_deplibs=
-	  relink_command=
-
-	  func_source "$wrapper"
-
-	  # Check the variables that should have been set.
-	  test -z "$generated_by_libtool_version" && \
-	    func_fatal_error "invalid libtool wrapper script '$wrapper'"
-
-	  finalize=:
-	  for lib in $notinst_deplibs; do
-	    # Check to see that each library is installed.
-	    libdir=
-	    if test -f "$lib"; then
-	      func_source "$lib"
-	    fi
-	    libfile=$libdir/`$ECHO "$lib" | $SED 's%^.*/%%g'`
-	    if test -n "$libdir" && test ! -f "$libfile"; then
-	      func_warning "'$lib' has not been installed in '$libdir'"
-	      finalize=false
-	    fi
-	  done
-
-	  relink_command=
-	  func_source "$wrapper"
-
-	  outputname=
-	  if test no = "$fast_install" && test -n "$relink_command"; then
-	    $opt_dry_run || {
-	      if $finalize; then
-	        tmpdir=`func_mktempdir`
-		func_basename "$file$stripped_ext"
-		file=$func_basename_result
-	        outputname=$tmpdir/$file
-	        # Replace the output file specification.
-	        relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'`
-
-	        $opt_quiet || {
-	          func_quote_for_expand "$relink_command"
-		  eval "func_echo $func_quote_for_expand_result"
-	        }
-	        if eval "$relink_command"; then :
-	          else
-		  func_error "error: relink '$file' with the above command before installing it"
-		  $opt_dry_run || ${RM}r "$tmpdir"
-		  continue
-	        fi
-	        file=$outputname
-	      else
-	        func_warning "cannot relink '$file'"
-	      fi
-	    }
-	  else
-	    # Install the binary that we compiled earlier.
-	    file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"`
-	  fi
-	fi
-
-	# remove .exe since cygwin /usr/bin/install will append another
-	# one anyway
-	case $install_prog,$host in
-	*/usr/bin/install*,*cygwin*)
-	  case $file:$destfile in
-	  *.exe:*.exe)
-	    # this is ok
-	    ;;
-	  *.exe:*)
-	    destfile=$destfile.exe
-	    ;;
-	  *:*.exe)
-	    func_stripname '' '.exe' "$destfile"
-	    destfile=$func_stripname_result
-	    ;;
-	  esac
-	  ;;
-	esac
-	func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?'
-	$opt_dry_run || if test -n "$outputname"; then
-	  ${RM}r "$tmpdir"
-	fi
-	;;
-      esac
-    done
-
-    for file in $staticlibs; do
-      func_basename "$file"
-      name=$func_basename_result
-
-      # Set up the ranlib parameters.
-      oldlib=$destdir/$name
-      func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
-      tool_oldlib=$func_to_tool_file_result
-
-      func_show_eval "$install_prog \$file \$oldlib" 'exit $?'
-
-      if test -n "$stripme" && test -n "$old_striplib"; then
-	func_show_eval "$old_striplib $tool_oldlib" 'exit $?'
-      fi
-
-      # Do each command in the postinstall commands.
-      func_execute_cmds "$old_postinstall_cmds" 'exit $?'
-    done
-
-    test -n "$future_libdirs" && \
-      func_warning "remember to run '$progname --finish$future_libdirs'"
-
-    if test -n "$current_libdirs"; then
-      # Maybe just do a dry run.
-      $opt_dry_run && current_libdirs=" -n$current_libdirs"
-      exec_cmd='$SHELL "$progpath" $preserve_args --finish$current_libdirs'
-    else
-      exit $EXIT_SUCCESS
-    fi
-}
-
-test install = "$opt_mode" && func_mode_install ${1+"$@"}
-
-
-# func_generate_dlsyms outputname originator pic_p
-# Extract symbols from dlprefiles and create ${outputname}S.o with
-# a dlpreopen symbol table.
-func_generate_dlsyms ()
-{
-    $debug_cmd
-
-    my_outputname=$1
-    my_originator=$2
-    my_pic_p=${3-false}
-    my_prefix=`$ECHO "$my_originator" | $SED 's%[^a-zA-Z0-9]%_%g'`
-    my_dlsyms=
-
-    if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then
-      if test -n "$NM" && test -n "$global_symbol_pipe"; then
-	my_dlsyms=${my_outputname}S.c
-      else
-	func_error "not configured to extract global symbols from dlpreopened files"
-      fi
-    fi
-
-    if test -n "$my_dlsyms"; then
-      case $my_dlsyms in
-      "") ;;
-      *.c)
-	# Discover the nlist of each of the dlfiles.
-	nlist=$output_objdir/$my_outputname.nm
-
-	func_show_eval "$RM $nlist ${nlist}S ${nlist}T"
-
-	# Parse the name list into a source file.
-	func_verbose "creating $output_objdir/$my_dlsyms"
-
-	$opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\
-/* $my_dlsyms - symbol resolution table for '$my_outputname' dlsym emulation. */
-/* Generated by $PROGRAM (GNU $PACKAGE) $VERSION */
-
-#ifdef __cplusplus
-extern \"C\" {
-#endif
-
-#if defined __GNUC__ && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4))
-#pragma GCC diagnostic ignored \"-Wstrict-prototypes\"
-#endif
-
-/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
-#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE
-/* DATA imports from DLLs on WIN32 can't be const, because runtime
-   relocations are performed -- see ld's documentation on pseudo-relocs.  */
-# define LT_DLSYM_CONST
-#elif defined __osf__
-/* This system does not cope well with relocations in const data.  */
-# define LT_DLSYM_CONST
-#else
-# define LT_DLSYM_CONST const
-#endif
-
-#define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0)
-
-/* External symbol declarations for the compiler. */\
-"
-
-	if test yes = "$dlself"; then
-	  func_verbose "generating symbol list for '$output'"
-
-	  $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist"
-
-	  # Add our own program objects to the symbol list.
-	  progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP`
-	  for progfile in $progfiles; do
-	    func_to_tool_file "$progfile" func_convert_file_msys_to_w32
-	    func_verbose "extracting global C symbols from '$func_to_tool_file_result'"
-	    $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'"
-	  done
-
-	  if test -n "$exclude_expsyms"; then
-	    $opt_dry_run || {
-	      eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
-	      eval '$MV "$nlist"T "$nlist"'
-	    }
-	  fi
-
-	  if test -n "$export_symbols_regex"; then
-	    $opt_dry_run || {
-	      eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
-	      eval '$MV "$nlist"T "$nlist"'
-	    }
-	  fi
-
-	  # Prepare the list of exported symbols
-	  if test -z "$export_symbols"; then
-	    export_symbols=$output_objdir/$outputname.exp
-	    $opt_dry_run || {
-	      $RM $export_symbols
-	      eval "$SED -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
-	      case $host in
-	      *cygwin* | *mingw* | *cegcc* )
-                eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
-                eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
-	        ;;
-	      esac
-	    }
-	  else
-	    $opt_dry_run || {
-	      eval "$SED -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
-	      eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
-	      eval '$MV "$nlist"T "$nlist"'
-	      case $host in
-	        *cygwin* | *mingw* | *cegcc* )
-	          eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
-	          eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
-	          ;;
-	      esac
-	    }
-	  fi
-	fi
-
-	for dlprefile in $dlprefiles; do
-	  func_verbose "extracting global C symbols from '$dlprefile'"
-	  func_basename "$dlprefile"
-	  name=$func_basename_result
-          case $host in
-	    *cygwin* | *mingw* | *cegcc* )
-	      # if an import library, we need to obtain dlname
-	      if func_win32_import_lib_p "$dlprefile"; then
-	        func_tr_sh "$dlprefile"
-	        eval "curr_lafile=\$libfile_$func_tr_sh_result"
-	        dlprefile_dlbasename=
-	        if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then
-	          # Use subshell, to avoid clobbering current variable values
-	          dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"`
-	          if test -n "$dlprefile_dlname"; then
-	            func_basename "$dlprefile_dlname"
-	            dlprefile_dlbasename=$func_basename_result
-	          else
-	            # no lafile. user explicitly requested -dlpreopen <import library>.
-	            $sharedlib_from_linklib_cmd "$dlprefile"
-	            dlprefile_dlbasename=$sharedlib_from_linklib_result
-	          fi
-	        fi
-	        $opt_dry_run || {
-	          if test -n "$dlprefile_dlbasename"; then
-	            eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"'
-	          else
-	            func_warning "Could not compute DLL name from $name"
-	            eval '$ECHO ": $name " >> "$nlist"'
-	          fi
-	          func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
-	          eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe |
-	            $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'"
-	        }
-	      else # not an import lib
-	        $opt_dry_run || {
-	          eval '$ECHO ": $name " >> "$nlist"'
-	          func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
-	          eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
-	        }
-	      fi
-	    ;;
-	    *)
-	      $opt_dry_run || {
-	        eval '$ECHO ": $name " >> "$nlist"'
-	        func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
-	        eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
-	      }
-	    ;;
-          esac
-	done
-
-	$opt_dry_run || {
-	  # Make sure we have at least an empty file.
-	  test -f "$nlist" || : > "$nlist"
-
-	  if test -n "$exclude_expsyms"; then
-	    $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
-	    $MV "$nlist"T "$nlist"
-	  fi
-
-	  # Try sorting and uniquifying the output.
-	  if $GREP -v "^: " < "$nlist" |
-	      if sort -k 3 </dev/null >/dev/null 2>&1; then
-		sort -k 3
-	      else
-		sort +2
-	      fi |
-	      uniq > "$nlist"S; then
-	    :
-	  else
-	    $GREP -v "^: " < "$nlist" > "$nlist"S
-	  fi
-
-	  if test -f "$nlist"S; then
-	    eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"'
-	  else
-	    echo '/* NONE */' >> "$output_objdir/$my_dlsyms"
-	  fi
-
-	  func_show_eval '$RM "${nlist}I"'
-	  if test -n "$global_symbol_to_import"; then
-	    eval "$global_symbol_to_import"' < "$nlist"S > "$nlist"I'
-	  fi
-
-	  echo >> "$output_objdir/$my_dlsyms" "\
-
-/* The mapping between symbol names and symbols.  */
-typedef struct {
-  const char *name;
-  void *address;
-} lt_dlsymlist;
-extern LT_DLSYM_CONST lt_dlsymlist
-lt_${my_prefix}_LTX_preloaded_symbols[];\
-"
-
-	  if test -s "$nlist"I; then
-	    echo >> "$output_objdir/$my_dlsyms" "\
-static void lt_syminit(void)
-{
-  LT_DLSYM_CONST lt_dlsymlist *symbol = lt_${my_prefix}_LTX_preloaded_symbols;
-  for (; symbol->name; ++symbol)
-    {"
-	    $SED 's/.*/      if (STREQ (symbol->name, \"&\")) symbol->address = (void *) \&&;/' < "$nlist"I >> "$output_objdir/$my_dlsyms"
-	    echo >> "$output_objdir/$my_dlsyms" "\
-    }
-}"
-	  fi
-	  echo >> "$output_objdir/$my_dlsyms" "\
-LT_DLSYM_CONST lt_dlsymlist
-lt_${my_prefix}_LTX_preloaded_symbols[] =
-{ {\"$my_originator\", (void *) 0},"
-
-	  if test -s "$nlist"I; then
-	    echo >> "$output_objdir/$my_dlsyms" "\
-  {\"@INIT@\", (void *) &lt_syminit},"
-	  fi
-
-	  case $need_lib_prefix in
-	  no)
-	    eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms"
-	    ;;
-	  *)
-	    eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms"
-	    ;;
-	  esac
-	  echo >> "$output_objdir/$my_dlsyms" "\
-  {0, (void *) 0}
-};
-
-/* This works around a problem in FreeBSD linker */
-#ifdef FREEBSD_WORKAROUND
-static const void *lt_preloaded_setup() {
-  return lt_${my_prefix}_LTX_preloaded_symbols;
-}
-#endif
-
-#ifdef __cplusplus
-}
-#endif\
-"
-	} # !$opt_dry_run
-
-	pic_flag_for_symtable=
-	case "$compile_command " in
-	*" -static "*) ;;
-	*)
-	  case $host in
-	  # compiling the symbol table file with pic_flag works around
-	  # a FreeBSD bug that causes programs to crash when -lm is
-	  # linked before any other PIC object.  But we must not use
-	  # pic_flag when linking with -static.  The problem exists in
-	  # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
-	  *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
-	    pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;;
-	  *-*-hpux*)
-	    pic_flag_for_symtable=" $pic_flag"  ;;
-	  *)
-	    $my_pic_p && pic_flag_for_symtable=" $pic_flag"
-	    ;;
-	  esac
-	  ;;
-	esac
-	symtab_cflags=
-	for arg in $LTCFLAGS; do
-	  case $arg in
-	  -pie | -fpie | -fPIE) ;;
-	  *) func_append symtab_cflags " $arg" ;;
-	  esac
-	done
-
-	# Now compile the dynamic symbol file.
-	func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?'
-
-	# Clean up the generated files.
-	func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T" "${nlist}I"'
-
-	# Transform the symbol file into the correct name.
-	symfileobj=$output_objdir/${my_outputname}S.$objext
-	case $host in
-	*cygwin* | *mingw* | *cegcc* )
-	  if test -f "$output_objdir/$my_outputname.def"; then
-	    compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
-	    finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
-	  else
-	    compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
-	    finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
-	  fi
-	  ;;
-	*)
-	  compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
-	  finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
-	  ;;
-	esac
-	;;
-      *)
-	func_fatal_error "unknown suffix for '$my_dlsyms'"
-	;;
-      esac
-    else
-      # We keep going just in case the user didn't refer to
-      # lt_preloaded_symbols.  The linker will fail if global_symbol_pipe
-      # really was required.
-
-      # Nullify the symbol file.
-      compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"`
-      finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"`
-    fi
-}
-
-# func_cygming_gnu_implib_p ARG
-# This predicate returns with zero status (TRUE) if
-# ARG is a GNU/binutils-style import library. Returns
-# with nonzero status (FALSE) otherwise.
-func_cygming_gnu_implib_p ()
-{
-  $debug_cmd
-
-  func_to_tool_file "$1" func_convert_file_msys_to_w32
-  func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'`
-  test -n "$func_cygming_gnu_implib_tmp"
-}
-
-# func_cygming_ms_implib_p ARG
-# This predicate returns with zero status (TRUE) if
-# ARG is an MS-style import library. Returns
-# with nonzero status (FALSE) otherwise.
-func_cygming_ms_implib_p ()
-{
-  $debug_cmd
-
-  func_to_tool_file "$1" func_convert_file_msys_to_w32
-  func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'`
-  test -n "$func_cygming_ms_implib_tmp"
-}
-
-# func_win32_libid arg
-# return the library type of file 'arg'
-#
-# Need a lot of goo to handle *both* DLLs and import libs
-# Has to be a shell function in order to 'eat' the argument
-# that is supplied when $file_magic_command is called.
-# Despite the name, also deal with 64 bit binaries.
-func_win32_libid ()
-{
-  $debug_cmd
-
-  win32_libid_type=unknown
-  win32_fileres=`file -L $1 2>/dev/null`
-  case $win32_fileres in
-  *ar\ archive\ import\ library*) # definitely import
-    win32_libid_type="x86 archive import"
-    ;;
-  *ar\ archive*) # could be an import, or static
-    # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD.
-    if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
-       $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then
-      case $nm_interface in
-      "MS dumpbin")
-	if func_cygming_ms_implib_p "$1" ||
-	   func_cygming_gnu_implib_p "$1"
-	then
-	  win32_nmres=import
-	else
-	  win32_nmres=
-	fi
-	;;
-      *)
-	func_to_tool_file "$1" func_convert_file_msys_to_w32
-	win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" |
-	  $SED -n -e '
-	    1,100{
-		/ I /{
-		    s|.*|import|
-		    p
-		    q
-		}
-	    }'`
-	;;
-      esac
-      case $win32_nmres in
-      import*)  win32_libid_type="x86 archive import";;
-      *)        win32_libid_type="x86 archive static";;
-      esac
-    fi
-    ;;
-  *DLL*)
-    win32_libid_type="x86 DLL"
-    ;;
-  *executable*) # but shell scripts are "executable" too...
-    case $win32_fileres in
-    *MS\ Windows\ PE\ Intel*)
-      win32_libid_type="x86 DLL"
-      ;;
-    esac
-    ;;
-  esac
-  $ECHO "$win32_libid_type"
-}
-
-# func_cygming_dll_for_implib ARG
-#
-# Platform-specific function to extract the
-# name of the DLL associated with the specified
-# import library ARG.
-# Invoked by eval'ing the libtool variable
-#    $sharedlib_from_linklib_cmd
-# Result is available in the variable
-#    $sharedlib_from_linklib_result
-func_cygming_dll_for_implib ()
-{
-  $debug_cmd
-
-  sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"`
-}
-
-# func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs
-#
-# The is the core of a fallback implementation of a
-# platform-specific function to extract the name of the
-# DLL associated with the specified import library LIBNAME.
-#
-# SECTION_NAME is either .idata$6 or .idata$7, depending
-# on the platform and compiler that created the implib.
-#
-# Echos the name of the DLL associated with the
-# specified import library.
-func_cygming_dll_for_implib_fallback_core ()
-{
-  $debug_cmd
-
-  match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"`
-  $OBJDUMP -s --section "$1" "$2" 2>/dev/null |
-    $SED '/^Contents of section '"$match_literal"':/{
-      # Place marker at beginning of archive member dllname section
-      s/.*/====MARK====/
-      p
-      d
-    }
-    # These lines can sometimes be longer than 43 characters, but
-    # are always uninteresting
-    /:[	 ]*file format pe[i]\{,1\}-/d
-    /^In archive [^:]*:/d
-    # Ensure marker is printed
-    /^====MARK====/p
-    # Remove all lines with less than 43 characters
-    /^.\{43\}/!d
-    # From remaining lines, remove first 43 characters
-    s/^.\{43\}//' |
-    $SED -n '
-      # Join marker and all lines until next marker into a single line
-      /^====MARK====/ b para
-      H
-      $ b para
-      b
-      :para
-      x
-      s/\n//g
-      # Remove the marker
-      s/^====MARK====//
-      # Remove trailing dots and whitespace
-      s/[\. \t]*$//
-      # Print
-      /./p' |
-    # we now have a list, one entry per line, of the stringified
-    # contents of the appropriate section of all members of the
-    # archive that possess that section. Heuristic: eliminate
-    # all those that have a first or second character that is
-    # a '.' (that is, objdump's representation of an unprintable
-    # character.) This should work for all archives with less than
-    # 0x302f exports -- but will fail for DLLs whose name actually
-    # begins with a literal '.' or a single character followed by
-    # a '.'.
-    #
-    # Of those that remain, print the first one.
-    $SED -e '/^\./d;/^.\./d;q'
-}
-
-# func_cygming_dll_for_implib_fallback ARG
-# Platform-specific function to extract the
-# name of the DLL associated with the specified
-# import library ARG.
-#
-# This fallback implementation is for use when $DLLTOOL
-# does not support the --identify-strict option.
-# Invoked by eval'ing the libtool variable
-#    $sharedlib_from_linklib_cmd
-# Result is available in the variable
-#    $sharedlib_from_linklib_result
-func_cygming_dll_for_implib_fallback ()
-{
-  $debug_cmd
-
-  if func_cygming_gnu_implib_p "$1"; then
-    # binutils import library
-    sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"`
-  elif func_cygming_ms_implib_p "$1"; then
-    # ms-generated import library
-    sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"`
-  else
-    # unknown
-    sharedlib_from_linklib_result=
-  fi
-}
-
-
-# func_extract_an_archive dir oldlib
-func_extract_an_archive ()
-{
-    $debug_cmd
-
-    f_ex_an_ar_dir=$1; shift
-    f_ex_an_ar_oldlib=$1
-    if test yes = "$lock_old_archive_extraction"; then
-      lockfile=$f_ex_an_ar_oldlib.lock
-      until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
-	func_echo "Waiting for $lockfile to be removed"
-	sleep 2
-      done
-    fi
-    func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \
-		   'stat=$?; rm -f "$lockfile"; exit $stat'
-    if test yes = "$lock_old_archive_extraction"; then
-      $opt_dry_run || rm -f "$lockfile"
-    fi
-    if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
-     :
-    else
-      func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib"
-    fi
-}
-
-
-# func_extract_archives gentop oldlib ...
-func_extract_archives ()
-{
-    $debug_cmd
-
-    my_gentop=$1; shift
-    my_oldlibs=${1+"$@"}
-    my_oldobjs=
-    my_xlib=
-    my_xabs=
-    my_xdir=
-
-    for my_xlib in $my_oldlibs; do
-      # Extract the objects.
-      case $my_xlib in
-	[\\/]* | [A-Za-z]:[\\/]*) my_xabs=$my_xlib ;;
-	*) my_xabs=`pwd`"/$my_xlib" ;;
-      esac
-      func_basename "$my_xlib"
-      my_xlib=$func_basename_result
-      my_xlib_u=$my_xlib
-      while :; do
-        case " $extracted_archives " in
-	*" $my_xlib_u "*)
-	  func_arith $extracted_serial + 1
-	  extracted_serial=$func_arith_result
-	  my_xlib_u=lt$extracted_serial-$my_xlib ;;
-	*) break ;;
-	esac
-      done
-      extracted_archives="$extracted_archives $my_xlib_u"
-      my_xdir=$my_gentop/$my_xlib_u
-
-      func_mkdir_p "$my_xdir"
-
-      case $host in
-      *-darwin*)
-	func_verbose "Extracting $my_xabs"
-	# Do not bother doing anything if just a dry run
-	$opt_dry_run || {
-	  darwin_orig_dir=`pwd`
-	  cd $my_xdir || exit $?
-	  darwin_archive=$my_xabs
-	  darwin_curdir=`pwd`
-	  func_basename "$darwin_archive"
-	  darwin_base_archive=$func_basename_result
-	  darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true`
-	  if test -n "$darwin_arches"; then
-	    darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'`
-	    darwin_arch=
-	    func_verbose "$darwin_base_archive has multiple architectures $darwin_arches"
-	    for darwin_arch in  $darwin_arches; do
-	      func_mkdir_p "unfat-$$/$darwin_base_archive-$darwin_arch"
-	      $LIPO -thin $darwin_arch -output "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" "$darwin_archive"
-	      cd "unfat-$$/$darwin_base_archive-$darwin_arch"
-	      func_extract_an_archive "`pwd`" "$darwin_base_archive"
-	      cd "$darwin_curdir"
-	      $RM "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive"
-	    done # $darwin_arches
-            ## Okay now we've a bunch of thin objects, gotta fatten them up :)
-	    darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$sed_basename" | sort -u`
-	    darwin_file=
-	    darwin_files=
-	    for darwin_file in $darwin_filelist; do
-	      darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP`
-	      $LIPO -create -output "$darwin_file" $darwin_files
-	    done # $darwin_filelist
-	    $RM -rf unfat-$$
-	    cd "$darwin_orig_dir"
-	  else
-	    cd $darwin_orig_dir
-	    func_extract_an_archive "$my_xdir" "$my_xabs"
-	  fi # $darwin_arches
-	} # !$opt_dry_run
-	;;
-      *)
-        func_extract_an_archive "$my_xdir" "$my_xabs"
-	;;
-      esac
-      my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP`
-    done
-
-    func_extract_archives_result=$my_oldobjs
-}
-
-
-# func_emit_wrapper [arg=no]
-#
-# Emit a libtool wrapper script on stdout.
-# Don't directly open a file because we may want to
-# incorporate the script contents within a cygwin/mingw
-# wrapper executable.  Must ONLY be called from within
-# func_mode_link because it depends on a number of variables
-# set therein.
-#
-# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
-# variable will take.  If 'yes', then the emitted script
-# will assume that the directory where it is stored is
-# the $objdir directory.  This is a cygwin/mingw-specific
-# behavior.
-func_emit_wrapper ()
-{
-	func_emit_wrapper_arg1=${1-no}
-
-	$ECHO "\
-#! $SHELL
-
-# $output - temporary wrapper script for $objdir/$outputname
-# Generated by $PROGRAM (GNU $PACKAGE) $VERSION
-#
-# The $output program cannot be directly executed until all the libtool
-# libraries that it depends on are installed.
-#
-# This wrapper script should never be moved out of the build directory.
-# If it is, it will not operate correctly.
-
-# Sed substitution that helps us do robust quoting.  It backslashifies
-# metacharacters that are still active within double-quoted strings.
-sed_quote_subst='$sed_quote_subst'
-
-# Be Bourne compatible
-if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then
-  emulate sh
-  NULLCMD=:
-  # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which
-  # is contrary to our usage.  Disable this feature.
-  alias -g '\${1+\"\$@\"}'='\"\$@\"'
-  setopt NO_GLOB_SUBST
-else
-  case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac
-fi
-BIN_SH=xpg4; export BIN_SH # for Tru64
-DUALCASE=1; export DUALCASE # for MKS sh
-
-# The HP-UX ksh and POSIX shell print the target directory to stdout
-# if CDPATH is set.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-relink_command=\"$relink_command\"
-
-# This environment variable determines our operation mode.
-if test \"\$libtool_install_magic\" = \"$magic\"; then
-  # install mode needs the following variables:
-  generated_by_libtool_version='$macro_version'
-  notinst_deplibs='$notinst_deplibs'
-else
-  # When we are sourced in execute mode, \$file and \$ECHO are already set.
-  if test \"\$libtool_execute_magic\" != \"$magic\"; then
-    file=\"\$0\""
-
-    qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"`
-    $ECHO "\
-
-# A function that is used when there is no print builtin or printf.
-func_fallback_echo ()
-{
-  eval 'cat <<_LTECHO_EOF
-\$1
-_LTECHO_EOF'
-}
-    ECHO=\"$qECHO\"
-  fi
-
-# Very basic option parsing. These options are (a) specific to
-# the libtool wrapper, (b) are identical between the wrapper
-# /script/ and the wrapper /executable/ that is used only on
-# windows platforms, and (c) all begin with the string "--lt-"
-# (application programs are unlikely to have options that match
-# this pattern).
-#
-# There are only two supported options: --lt-debug and
-# --lt-dump-script. There is, deliberately, no --lt-help.
-#
-# The first argument to this parsing function should be the
-# script's $0 value, followed by "$@".
-lt_option_debug=
-func_parse_lt_options ()
-{
-  lt_script_arg0=\$0
-  shift
-  for lt_opt
-  do
-    case \"\$lt_opt\" in
-    --lt-debug) lt_option_debug=1 ;;
-    --lt-dump-script)
-        lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\`
-        test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=.
-        lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\`
-        cat \"\$lt_dump_D/\$lt_dump_F\"
-        exit 0
-      ;;
-    --lt-*)
-        \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2
-        exit 1
-      ;;
-    esac
-  done
-
-  # Print the debug banner immediately:
-  if test -n \"\$lt_option_debug\"; then
-    echo \"$outputname:$output:\$LINENO: libtool wrapper (GNU $PACKAGE) $VERSION\" 1>&2
-  fi
-}
-
-# Used when --lt-debug. Prints its arguments to stdout
-# (redirection is the responsibility of the caller)
-func_lt_dump_args ()
-{
-  lt_dump_args_N=1;
-  for lt_arg
-  do
-    \$ECHO \"$outputname:$output:\$LINENO: newargv[\$lt_dump_args_N]: \$lt_arg\"
-    lt_dump_args_N=\`expr \$lt_dump_args_N + 1\`
-  done
-}
-
-# Core function for launching the target application
-func_exec_program_core ()
-{
-"
-  case $host in
-  # Backslashes separate directories on plain windows
-  *-*-mingw | *-*-os2* | *-cegcc*)
-    $ECHO "\
-      if test -n \"\$lt_option_debug\"; then
-        \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir\\\\\$program\" 1>&2
-        func_lt_dump_args \${1+\"\$@\"} 1>&2
-      fi
-      exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
-"
-    ;;
-
-  *)
-    $ECHO "\
-      if test -n \"\$lt_option_debug\"; then
-        \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir/\$program\" 1>&2
-        func_lt_dump_args \${1+\"\$@\"} 1>&2
-      fi
-      exec \"\$progdir/\$program\" \${1+\"\$@\"}
-"
-    ;;
-  esac
-  $ECHO "\
-      \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2
-      exit 1
-}
-
-# A function to encapsulate launching the target application
-# Strips options in the --lt-* namespace from \$@ and
-# launches target application with the remaining arguments.
-func_exec_program ()
-{
-  case \" \$* \" in
-  *\\ --lt-*)
-    for lt_wr_arg
-    do
-      case \$lt_wr_arg in
-      --lt-*) ;;
-      *) set x \"\$@\" \"\$lt_wr_arg\"; shift;;
-      esac
-      shift
-    done ;;
-  esac
-  func_exec_program_core \${1+\"\$@\"}
-}
-
-  # Parse options
-  func_parse_lt_options \"\$0\" \${1+\"\$@\"}
-
-  # Find the directory that this script lives in.
-  thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\`
-  test \"x\$thisdir\" = \"x\$file\" && thisdir=.
-
-  # Follow symbolic links until we get to the real thisdir.
-  file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\`
-  while test -n \"\$file\"; do
-    destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\`
-
-    # If there was a directory component, then change thisdir.
-    if test \"x\$destdir\" != \"x\$file\"; then
-      case \"\$destdir\" in
-      [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
-      *) thisdir=\"\$thisdir/\$destdir\" ;;
-      esac
-    fi
-
-    file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\`
-    file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\`
-  done
-
-  # Usually 'no', except on cygwin/mingw when embedded into
-  # the cwrapper.
-  WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1
-  if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then
-    # special case for '.'
-    if test \"\$thisdir\" = \".\"; then
-      thisdir=\`pwd\`
-    fi
-    # remove .libs from thisdir
-    case \"\$thisdir\" in
-    *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;;
-    $objdir )   thisdir=. ;;
-    esac
-  fi
-
-  # Try to get the absolute directory name.
-  absdir=\`cd \"\$thisdir\" && pwd\`
-  test -n \"\$absdir\" && thisdir=\"\$absdir\"
-"
-
-	if test yes = "$fast_install"; then
-	  $ECHO "\
-  program=lt-'$outputname'$exeext
-  progdir=\"\$thisdir/$objdir\"
-
-  if test ! -f \"\$progdir/\$program\" ||
-     { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | $SED 1q\`; \\
-       test \"X\$file\" != \"X\$progdir/\$program\"; }; then
-
-    file=\"\$\$-\$program\"
-
-    if test ! -d \"\$progdir\"; then
-      $MKDIR \"\$progdir\"
-    else
-      $RM \"\$progdir/\$file\"
-    fi"
-
-	  $ECHO "\
-
-    # relink executable if necessary
-    if test -n \"\$relink_command\"; then
-      if relink_command_output=\`eval \$relink_command 2>&1\`; then :
-      else
-	\$ECHO \"\$relink_command_output\" >&2
-	$RM \"\$progdir/\$file\"
-	exit 1
-      fi
-    fi
-
-    $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
-    { $RM \"\$progdir/\$program\";
-      $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; }
-    $RM \"\$progdir/\$file\"
-  fi"
-	else
-	  $ECHO "\
-  program='$outputname'
-  progdir=\"\$thisdir/$objdir\"
-"
-	fi
-
-	$ECHO "\
-
-  if test -f \"\$progdir/\$program\"; then"
-
-	# fixup the dll searchpath if we need to.
-	#
-	# Fix the DLL searchpath if we need to.  Do this before prepending
-	# to shlibpath, because on Windows, both are PATH and uninstalled
-	# libraries must come first.
-	if test -n "$dllsearchpath"; then
-	  $ECHO "\
-    # Add the dll search path components to the executable PATH
-    PATH=$dllsearchpath:\$PATH
-"
-	fi
-
-	# Export our shlibpath_var if we have one.
-	if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
-	  $ECHO "\
-    # Add our own library path to $shlibpath_var
-    $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
-
-    # Some systems cannot cope with colon-terminated $shlibpath_var
-    # The second colon is a workaround for a bug in BeOS R4 sed
-    $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\`
-
-    export $shlibpath_var
-"
-	fi
-
-	$ECHO "\
-    if test \"\$libtool_execute_magic\" != \"$magic\"; then
-      # Run the actual program with our arguments.
-      func_exec_program \${1+\"\$@\"}
-    fi
-  else
-    # The program doesn't exist.
-    \$ECHO \"\$0: error: '\$progdir/\$program' does not exist\" 1>&2
-    \$ECHO \"This script is just a wrapper for \$program.\" 1>&2
-    \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
-    exit 1
-  fi
-fi\
-"
-}
-
-
-# func_emit_cwrapperexe_src
-# emit the source code for a wrapper executable on stdout
-# Must ONLY be called from within func_mode_link because
-# it depends on a number of variable set therein.
-func_emit_cwrapperexe_src ()
-{
-	cat <<EOF
-
-/* $cwrappersource - temporary wrapper executable for $objdir/$outputname
-   Generated by $PROGRAM (GNU $PACKAGE) $VERSION
-
-   The $output program cannot be directly executed until all the libtool
-   libraries that it depends on are installed.
-
-   This wrapper executable should never be moved out of the build directory.
-   If it is, it will not operate correctly.
-*/
-EOF
-	    cat <<"EOF"
-#ifdef _MSC_VER
-# define _CRT_SECURE_NO_DEPRECATE 1
-#endif
-#include <stdio.h>
-#include <stdlib.h>
-#ifdef _MSC_VER
-# include <direct.h>
-# include <process.h>
-# include <io.h>
-#else
-# include <unistd.h>
-# include <stdint.h>
-# ifdef __CYGWIN__
-#  include <io.h>
-# endif
-#endif
-#include <malloc.h>
-#include <stdarg.h>
-#include <assert.h>
-#include <string.h>
-#include <ctype.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <sys/stat.h>
-
-#define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0)
-
-/* declarations of non-ANSI functions */
-#if defined __MINGW32__
-# ifdef __STRICT_ANSI__
-int _putenv (const char *);
-# endif
-#elif defined __CYGWIN__
-# ifdef __STRICT_ANSI__
-char *realpath (const char *, char *);
-int putenv (char *);
-int setenv (const char *, const char *, int);
-# endif
-/* #elif defined other_platform || defined ... */
-#endif
-
-/* portability defines, excluding path handling macros */
-#if defined _MSC_VER
-# define setmode _setmode
-# define stat    _stat
-# define chmod   _chmod
-# define getcwd  _getcwd
-# define putenv  _putenv
-# define S_IXUSR _S_IEXEC
-#elif defined __MINGW32__
-# define setmode _setmode
-# define stat    _stat
-# define chmod   _chmod
-# define getcwd  _getcwd
-# define putenv  _putenv
-#elif defined __CYGWIN__
-# define HAVE_SETENV
-# define FOPEN_WB "wb"
-/* #elif defined other platforms ... */
-#endif
-
-#if defined PATH_MAX
-# define LT_PATHMAX PATH_MAX
-#elif defined MAXPATHLEN
-# define LT_PATHMAX MAXPATHLEN
-#else
-# define LT_PATHMAX 1024
-#endif
-
-#ifndef S_IXOTH
-# define S_IXOTH 0
-#endif
-#ifndef S_IXGRP
-# define S_IXGRP 0
-#endif
-
-/* path handling portability macros */
-#ifndef DIR_SEPARATOR
-# define DIR_SEPARATOR '/'
-# define PATH_SEPARATOR ':'
-#endif
-
-#if defined _WIN32 || defined __MSDOS__ || defined __DJGPP__ || \
-  defined __OS2__
-# define HAVE_DOS_BASED_FILE_SYSTEM
-# define FOPEN_WB "wb"
-# ifndef DIR_SEPARATOR_2
-#  define DIR_SEPARATOR_2 '\\'
-# endif
-# ifndef PATH_SEPARATOR_2
-#  define PATH_SEPARATOR_2 ';'
-# endif
-#endif
-
-#ifndef DIR_SEPARATOR_2
-# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
-#else /* DIR_SEPARATOR_2 */
-# define IS_DIR_SEPARATOR(ch) \
-	(((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
-#endif /* DIR_SEPARATOR_2 */
-
-#ifndef PATH_SEPARATOR_2
-# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
-#else /* PATH_SEPARATOR_2 */
-# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
-#endif /* PATH_SEPARATOR_2 */
-
-#ifndef FOPEN_WB
-# define FOPEN_WB "w"
-#endif
-#ifndef _O_BINARY
-# define _O_BINARY 0
-#endif
-
-#define XMALLOC(type, num)      ((type *) xmalloc ((num) * sizeof(type)))
-#define XFREE(stale) do { \
-  if (stale) { free (stale); stale = 0; } \
-} while (0)
-
-#if defined LT_DEBUGWRAPPER
-static int lt_debug = 1;
-#else
-static int lt_debug = 0;
-#endif
-
-const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */
-
-void *xmalloc (size_t num);
-char *xstrdup (const char *string);
-const char *base_name (const char *name);
-char *find_executable (const char *wrapper);
-char *chase_symlinks (const char *pathspec);
-int make_executable (const char *path);
-int check_executable (const char *path);
-char *strendzap (char *str, const char *pat);
-void lt_debugprintf (const char *file, int line, const char *fmt, ...);
-void lt_fatal (const char *file, int line, const char *message, ...);
-static const char *nonnull (const char *s);
-static const char *nonempty (const char *s);
-void lt_setenv (const char *name, const char *value);
-char *lt_extend_str (const char *orig_value, const char *add, int to_end);
-void lt_update_exe_path (const char *name, const char *value);
-void lt_update_lib_path (const char *name, const char *value);
-char **prepare_spawn (char **argv);
-void lt_dump_script (FILE *f);
-EOF
-
-	    cat <<EOF
-#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 5)
-# define externally_visible volatile
-#else
-# define externally_visible __attribute__((externally_visible)) volatile
-#endif
-externally_visible const char * MAGIC_EXE = "$magic_exe";
-const char * LIB_PATH_VARNAME = "$shlibpath_var";
-EOF
-
-	    if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
-              func_to_host_path "$temp_rpath"
-	      cat <<EOF
-const char * LIB_PATH_VALUE   = "$func_to_host_path_result";
-EOF
-	    else
-	      cat <<"EOF"
-const char * LIB_PATH_VALUE   = "";
-EOF
-	    fi
-
-	    if test -n "$dllsearchpath"; then
-              func_to_host_path "$dllsearchpath:"
-	      cat <<EOF
-const char * EXE_PATH_VARNAME = "PATH";
-const char * EXE_PATH_VALUE   = "$func_to_host_path_result";
-EOF
-	    else
-	      cat <<"EOF"
-const char * EXE_PATH_VARNAME = "";
-const char * EXE_PATH_VALUE   = "";
-EOF
-	    fi
-
-	    if test yes = "$fast_install"; then
-	      cat <<EOF
-const char * TARGET_PROGRAM_NAME = "lt-$outputname"; /* hopefully, no .exe */
-EOF
-	    else
-	      cat <<EOF
-const char * TARGET_PROGRAM_NAME = "$outputname"; /* hopefully, no .exe */
-EOF
-	    fi
-
-
-	    cat <<"EOF"
-
-#define LTWRAPPER_OPTION_PREFIX         "--lt-"
-
-static const char *ltwrapper_option_prefix = LTWRAPPER_OPTION_PREFIX;
-static const char *dumpscript_opt       = LTWRAPPER_OPTION_PREFIX "dump-script";
-static const char *debug_opt            = LTWRAPPER_OPTION_PREFIX "debug";
-
-int
-main (int argc, char *argv[])
-{
-  char **newargz;
-  int  newargc;
-  char *tmp_pathspec;
-  char *actual_cwrapper_path;
-  char *actual_cwrapper_name;
-  char *target_name;
-  char *lt_argv_zero;
-  int rval = 127;
-
-  int i;
-
-  program_name = (char *) xstrdup (base_name (argv[0]));
-  newargz = XMALLOC (char *, (size_t) argc + 1);
-
-  /* very simple arg parsing; don't want to rely on getopt
-   * also, copy all non cwrapper options to newargz, except
-   * argz[0], which is handled differently
-   */
-  newargc=0;
-  for (i = 1; i < argc; i++)
-    {
-      if (STREQ (argv[i], dumpscript_opt))
-	{
-EOF
-	    case $host in
-	      *mingw* | *cygwin* )
-		# make stdout use "unix" line endings
-		echo "          setmode(1,_O_BINARY);"
-		;;
-	      esac
-
-	    cat <<"EOF"
-	  lt_dump_script (stdout);
-	  return 0;
-	}
-      if (STREQ (argv[i], debug_opt))
-	{
-          lt_debug = 1;
-          continue;
-	}
-      if (STREQ (argv[i], ltwrapper_option_prefix))
-        {
-          /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
-             namespace, but it is not one of the ones we know about and
-             have already dealt with, above (inluding dump-script), then
-             report an error. Otherwise, targets might begin to believe
-             they are allowed to use options in the LTWRAPPER_OPTION_PREFIX
-             namespace. The first time any user complains about this, we'll
-             need to make LTWRAPPER_OPTION_PREFIX a configure-time option
-             or a configure.ac-settable value.
-           */
-          lt_fatal (__FILE__, __LINE__,
-		    "unrecognized %s option: '%s'",
-                    ltwrapper_option_prefix, argv[i]);
-        }
-      /* otherwise ... */
-      newargz[++newargc] = xstrdup (argv[i]);
-    }
-  newargz[++newargc] = NULL;
-
-EOF
-	    cat <<EOF
-  /* The GNU banner must be the first non-error debug message */
-  lt_debugprintf (__FILE__, __LINE__, "libtool wrapper (GNU $PACKAGE) $VERSION\n");
-EOF
-	    cat <<"EOF"
-  lt_debugprintf (__FILE__, __LINE__, "(main) argv[0]: %s\n", argv[0]);
-  lt_debugprintf (__FILE__, __LINE__, "(main) program_name: %s\n", program_name);
-
-  tmp_pathspec = find_executable (argv[0]);
-  if (tmp_pathspec == NULL)
-    lt_fatal (__FILE__, __LINE__, "couldn't find %s", argv[0]);
-  lt_debugprintf (__FILE__, __LINE__,
-                  "(main) found exe (before symlink chase) at: %s\n",
-		  tmp_pathspec);
-
-  actual_cwrapper_path = chase_symlinks (tmp_pathspec);
-  lt_debugprintf (__FILE__, __LINE__,
-                  "(main) found exe (after symlink chase) at: %s\n",
-		  actual_cwrapper_path);
-  XFREE (tmp_pathspec);
-
-  actual_cwrapper_name = xstrdup (base_name (actual_cwrapper_path));
-  strendzap (actual_cwrapper_path, actual_cwrapper_name);
-
-  /* wrapper name transforms */
-  strendzap (actual_cwrapper_name, ".exe");
-  tmp_pathspec = lt_extend_str (actual_cwrapper_name, ".exe", 1);
-  XFREE (actual_cwrapper_name);
-  actual_cwrapper_name = tmp_pathspec;
-  tmp_pathspec = 0;
-
-  /* target_name transforms -- use actual target program name; might have lt- prefix */
-  target_name = xstrdup (base_name (TARGET_PROGRAM_NAME));
-  strendzap (target_name, ".exe");
-  tmp_pathspec = lt_extend_str (target_name, ".exe", 1);
-  XFREE (target_name);
-  target_name = tmp_pathspec;
-  tmp_pathspec = 0;
-
-  lt_debugprintf (__FILE__, __LINE__,
-		  "(main) libtool target name: %s\n",
-		  target_name);
-EOF
-
-	    cat <<EOF
-  newargz[0] =
-    XMALLOC (char, (strlen (actual_cwrapper_path) +
-		    strlen ("$objdir") + 1 + strlen (actual_cwrapper_name) + 1));
-  strcpy (newargz[0], actual_cwrapper_path);
-  strcat (newargz[0], "$objdir");
-  strcat (newargz[0], "/");
-EOF
-
-	    cat <<"EOF"
-  /* stop here, and copy so we don't have to do this twice */
-  tmp_pathspec = xstrdup (newargz[0]);
-
-  /* do NOT want the lt- prefix here, so use actual_cwrapper_name */
-  strcat (newargz[0], actual_cwrapper_name);
-
-  /* DO want the lt- prefix here if it exists, so use target_name */
-  lt_argv_zero = lt_extend_str (tmp_pathspec, target_name, 1);
-  XFREE (tmp_pathspec);
-  tmp_pathspec = NULL;
-EOF
-
-	    case $host_os in
-	      mingw*)
-	    cat <<"EOF"
-  {
-    char* p;
-    while ((p = strchr (newargz[0], '\\')) != NULL)
-      {
-	*p = '/';
-      }
-    while ((p = strchr (lt_argv_zero, '\\')) != NULL)
-      {
-	*p = '/';
-      }
-  }
-EOF
-	    ;;
-	    esac
-
-	    cat <<"EOF"
-  XFREE (target_name);
-  XFREE (actual_cwrapper_path);
-  XFREE (actual_cwrapper_name);
-
-  lt_setenv ("BIN_SH", "xpg4"); /* for Tru64 */
-  lt_setenv ("DUALCASE", "1");  /* for MSK sh */
-  /* Update the DLL searchpath.  EXE_PATH_VALUE ($dllsearchpath) must
-     be prepended before (that is, appear after) LIB_PATH_VALUE ($temp_rpath)
-     because on Windows, both *_VARNAMEs are PATH but uninstalled
-     libraries must come first. */
-  lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE);
-  lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE);
-
-  lt_debugprintf (__FILE__, __LINE__, "(main) lt_argv_zero: %s\n",
-		  nonnull (lt_argv_zero));
-  for (i = 0; i < newargc; i++)
-    {
-      lt_debugprintf (__FILE__, __LINE__, "(main) newargz[%d]: %s\n",
-		      i, nonnull (newargz[i]));
-    }
-
-EOF
-
-	    case $host_os in
-	      mingw*)
-		cat <<"EOF"
-  /* execv doesn't actually work on mingw as expected on unix */
-  newargz = prepare_spawn (newargz);
-  rval = (int) _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
-  if (rval == -1)
-    {
-      /* failed to start process */
-      lt_debugprintf (__FILE__, __LINE__,
-		      "(main) failed to launch target \"%s\": %s\n",
-		      lt_argv_zero, nonnull (strerror (errno)));
-      return 127;
-    }
-  return rval;
-EOF
-		;;
-	      *)
-		cat <<"EOF"
-  execv (lt_argv_zero, newargz);
-  return rval; /* =127, but avoids unused variable warning */
-EOF
-		;;
-	    esac
-
-	    cat <<"EOF"
-}
-
-void *
-xmalloc (size_t num)
-{
-  void *p = (void *) malloc (num);
-  if (!p)
-    lt_fatal (__FILE__, __LINE__, "memory exhausted");
-
-  return p;
-}
-
-char *
-xstrdup (const char *string)
-{
-  return string ? strcpy ((char *) xmalloc (strlen (string) + 1),
-			  string) : NULL;
-}
-
-const char *
-base_name (const char *name)
-{
-  const char *base;
-
-#if defined HAVE_DOS_BASED_FILE_SYSTEM
-  /* Skip over the disk name in MSDOS pathnames. */
-  if (isalpha ((unsigned char) name[0]) && name[1] == ':')
-    name += 2;
-#endif
-
-  for (base = name; *name; name++)
-    if (IS_DIR_SEPARATOR (*name))
-      base = name + 1;
-  return base;
-}
-
-int
-check_executable (const char *path)
-{
-  struct stat st;
-
-  lt_debugprintf (__FILE__, __LINE__, "(check_executable): %s\n",
-                  nonempty (path));
-  if ((!path) || (!*path))
-    return 0;
-
-  if ((stat (path, &st) >= 0)
-      && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)))
-    return 1;
-  else
-    return 0;
-}
-
-int
-make_executable (const char *path)
-{
-  int rval = 0;
-  struct stat st;
-
-  lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n",
-                  nonempty (path));
-  if ((!path) || (!*path))
-    return 0;
-
-  if (stat (path, &st) >= 0)
-    {
-      rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR);
-    }
-  return rval;
-}
-
-/* Searches for the full path of the wrapper.  Returns
-   newly allocated full path name if found, NULL otherwise
-   Does not chase symlinks, even on platforms that support them.
-*/
-char *
-find_executable (const char *wrapper)
-{
-  int has_slash = 0;
-  const char *p;
-  const char *p_next;
-  /* static buffer for getcwd */
-  char tmp[LT_PATHMAX + 1];
-  size_t tmp_len;
-  char *concat_name;
-
-  lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n",
-                  nonempty (wrapper));
-
-  if ((wrapper == NULL) || (*wrapper == '\0'))
-    return NULL;
-
-  /* Absolute path? */
-#if defined HAVE_DOS_BASED_FILE_SYSTEM
-  if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':')
-    {
-      concat_name = xstrdup (wrapper);
-      if (check_executable (concat_name))
-	return concat_name;
-      XFREE (concat_name);
-    }
-  else
-    {
-#endif
-      if (IS_DIR_SEPARATOR (wrapper[0]))
-	{
-	  concat_name = xstrdup (wrapper);
-	  if (check_executable (concat_name))
-	    return concat_name;
-	  XFREE (concat_name);
-	}
-#if defined HAVE_DOS_BASED_FILE_SYSTEM
-    }
-#endif
-
-  for (p = wrapper; *p; p++)
-    if (*p == '/')
-      {
-	has_slash = 1;
-	break;
-      }
-  if (!has_slash)
-    {
-      /* no slashes; search PATH */
-      const char *path = getenv ("PATH");
-      if (path != NULL)
-	{
-	  for (p = path; *p; p = p_next)
-	    {
-	      const char *q;
-	      size_t p_len;
-	      for (q = p; *q; q++)
-		if (IS_PATH_SEPARATOR (*q))
-		  break;
-	      p_len = (size_t) (q - p);
-	      p_next = (*q == '\0' ? q : q + 1);
-	      if (p_len == 0)
-		{
-		  /* empty path: current directory */
-		  if (getcwd (tmp, LT_PATHMAX) == NULL)
-		    lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
-                              nonnull (strerror (errno)));
-		  tmp_len = strlen (tmp);
-		  concat_name =
-		    XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
-		  memcpy (concat_name, tmp, tmp_len);
-		  concat_name[tmp_len] = '/';
-		  strcpy (concat_name + tmp_len + 1, wrapper);
-		}
-	      else
-		{
-		  concat_name =
-		    XMALLOC (char, p_len + 1 + strlen (wrapper) + 1);
-		  memcpy (concat_name, p, p_len);
-		  concat_name[p_len] = '/';
-		  strcpy (concat_name + p_len + 1, wrapper);
-		}
-	      if (check_executable (concat_name))
-		return concat_name;
-	      XFREE (concat_name);
-	    }
-	}
-      /* not found in PATH; assume curdir */
-    }
-  /* Relative path | not found in path: prepend cwd */
-  if (getcwd (tmp, LT_PATHMAX) == NULL)
-    lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
-              nonnull (strerror (errno)));
-  tmp_len = strlen (tmp);
-  concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
-  memcpy (concat_name, tmp, tmp_len);
-  concat_name[tmp_len] = '/';
-  strcpy (concat_name + tmp_len + 1, wrapper);
-
-  if (check_executable (concat_name))
-    return concat_name;
-  XFREE (concat_name);
-  return NULL;
-}
-
-char *
-chase_symlinks (const char *pathspec)
-{
-#ifndef S_ISLNK
-  return xstrdup (pathspec);
-#else
-  char buf[LT_PATHMAX];
-  struct stat s;
-  char *tmp_pathspec = xstrdup (pathspec);
-  char *p;
-  int has_symlinks = 0;
-  while (strlen (tmp_pathspec) && !has_symlinks)
-    {
-      lt_debugprintf (__FILE__, __LINE__,
-		      "checking path component for symlinks: %s\n",
-		      tmp_pathspec);
-      if (lstat (tmp_pathspec, &s) == 0)
-	{
-	  if (S_ISLNK (s.st_mode) != 0)
-	    {
-	      has_symlinks = 1;
-	      break;
-	    }
-
-	  /* search backwards for last DIR_SEPARATOR */
-	  p = tmp_pathspec + strlen (tmp_pathspec) - 1;
-	  while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
-	    p--;
-	  if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
-	    {
-	      /* no more DIR_SEPARATORS left */
-	      break;
-	    }
-	  *p = '\0';
-	}
-      else
-	{
-	  lt_fatal (__FILE__, __LINE__,
-		    "error accessing file \"%s\": %s",
-		    tmp_pathspec, nonnull (strerror (errno)));
-	}
-    }
-  XFREE (tmp_pathspec);
-
-  if (!has_symlinks)
-    {
-      return xstrdup (pathspec);
-    }
-
-  tmp_pathspec = realpath (pathspec, buf);
-  if (tmp_pathspec == 0)
-    {
-      lt_fatal (__FILE__, __LINE__,
-		"could not follow symlinks for %s", pathspec);
-    }
-  return xstrdup (tmp_pathspec);
-#endif
-}
-
-char *
-strendzap (char *str, const char *pat)
-{
-  size_t len, patlen;
-
-  assert (str != NULL);
-  assert (pat != NULL);
-
-  len = strlen (str);
-  patlen = strlen (pat);
-
-  if (patlen <= len)
-    {
-      str += len - patlen;
-      if (STREQ (str, pat))
-	*str = '\0';
-    }
-  return str;
-}
-
-void
-lt_debugprintf (const char *file, int line, const char *fmt, ...)
-{
-  va_list args;
-  if (lt_debug)
-    {
-      (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line);
-      va_start (args, fmt);
-      (void) vfprintf (stderr, fmt, args);
-      va_end (args);
-    }
-}
-
-static void
-lt_error_core (int exit_status, const char *file,
-	       int line, const char *mode,
-	       const char *message, va_list ap)
-{
-  fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode);
-  vfprintf (stderr, message, ap);
-  fprintf (stderr, ".\n");
-
-  if (exit_status >= 0)
-    exit (exit_status);
-}
-
-void
-lt_fatal (const char *file, int line, const char *message, ...)
-{
-  va_list ap;
-  va_start (ap, message);
-  lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap);
-  va_end (ap);
-}
-
-static const char *
-nonnull (const char *s)
-{
-  return s ? s : "(null)";
-}
-
-static const char *
-nonempty (const char *s)
-{
-  return (s && !*s) ? "(empty)" : nonnull (s);
-}
-
-void
-lt_setenv (const char *name, const char *value)
-{
-  lt_debugprintf (__FILE__, __LINE__,
-		  "(lt_setenv) setting '%s' to '%s'\n",
-                  nonnull (name), nonnull (value));
-  {
-#ifdef HAVE_SETENV
-    /* always make a copy, for consistency with !HAVE_SETENV */
-    char *str = xstrdup (value);
-    setenv (name, str, 1);
-#else
-    size_t len = strlen (name) + 1 + strlen (value) + 1;
-    char *str = XMALLOC (char, len);
-    sprintf (str, "%s=%s", name, value);
-    if (putenv (str) != EXIT_SUCCESS)
-      {
-        XFREE (str);
-      }
-#endif
-  }
-}
-
-char *
-lt_extend_str (const char *orig_value, const char *add, int to_end)
-{
-  char *new_value;
-  if (orig_value && *orig_value)
-    {
-      size_t orig_value_len = strlen (orig_value);
-      size_t add_len = strlen (add);
-      new_value = XMALLOC (char, add_len + orig_value_len + 1);
-      if (to_end)
-        {
-          strcpy (new_value, orig_value);
-          strcpy (new_value + orig_value_len, add);
-        }
-      else
-        {
-          strcpy (new_value, add);
-          strcpy (new_value + add_len, orig_value);
-        }
-    }
-  else
-    {
-      new_value = xstrdup (add);
-    }
-  return new_value;
-}
-
-void
-lt_update_exe_path (const char *name, const char *value)
-{
-  lt_debugprintf (__FILE__, __LINE__,
-		  "(lt_update_exe_path) modifying '%s' by prepending '%s'\n",
-                  nonnull (name), nonnull (value));
-
-  if (name && *name && value && *value)
-    {
-      char *new_value = lt_extend_str (getenv (name), value, 0);
-      /* some systems can't cope with a ':'-terminated path #' */
-      size_t len = strlen (new_value);
-      while ((len > 0) && IS_PATH_SEPARATOR (new_value[len-1]))
-        {
-          new_value[--len] = '\0';
-        }
-      lt_setenv (name, new_value);
-      XFREE (new_value);
-    }
-}
-
-void
-lt_update_lib_path (const char *name, const char *value)
-{
-  lt_debugprintf (__FILE__, __LINE__,
-		  "(lt_update_lib_path) modifying '%s' by prepending '%s'\n",
-                  nonnull (name), nonnull (value));
-
-  if (name && *name && value && *value)
-    {
-      char *new_value = lt_extend_str (getenv (name), value, 0);
-      lt_setenv (name, new_value);
-      XFREE (new_value);
-    }
-}
-
-EOF
-	    case $host_os in
-	      mingw*)
-		cat <<"EOF"
-
-/* Prepares an argument vector before calling spawn().
-   Note that spawn() does not by itself call the command interpreter
-     (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") :
-      ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
-         GetVersionEx(&v);
-         v.dwPlatformId == VER_PLATFORM_WIN32_NT;
-      }) ? "cmd.exe" : "command.com").
-   Instead it simply concatenates the arguments, separated by ' ', and calls
-   CreateProcess().  We must quote the arguments since Win32 CreateProcess()
-   interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a
-   special way:
-   - Space and tab are interpreted as delimiters. They are not treated as
-     delimiters if they are surrounded by double quotes: "...".
-   - Unescaped double quotes are removed from the input. Their only effect is
-     that within double quotes, space and tab are treated like normal
-     characters.
-   - Backslashes not followed by double quotes are not special.
-   - But 2*n+1 backslashes followed by a double quote become
-     n backslashes followed by a double quote (n >= 0):
-       \" -> "
-       \\\" -> \"
-       \\\\\" -> \\"
- */
-#define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037"
-#define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037"
-char **
-prepare_spawn (char **argv)
-{
-  size_t argc;
-  char **new_argv;
-  size_t i;
-
-  /* Count number of arguments.  */
-  for (argc = 0; argv[argc] != NULL; argc++)
-    ;
-
-  /* Allocate new argument vector.  */
-  new_argv = XMALLOC (char *, argc + 1);
-
-  /* Put quoted arguments into the new argument vector.  */
-  for (i = 0; i < argc; i++)
-    {
-      const char *string = argv[i];
-
-      if (string[0] == '\0')
-	new_argv[i] = xstrdup ("\"\"");
-      else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL)
-	{
-	  int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL);
-	  size_t length;
-	  unsigned int backslashes;
-	  const char *s;
-	  char *quoted_string;
-	  char *p;
-
-	  length = 0;
-	  backslashes = 0;
-	  if (quote_around)
-	    length++;
-	  for (s = string; *s != '\0'; s++)
-	    {
-	      char c = *s;
-	      if (c == '"')
-		length += backslashes + 1;
-	      length++;
-	      if (c == '\\')
-		backslashes++;
-	      else
-		backslashes = 0;
-	    }
-	  if (quote_around)
-	    length += backslashes + 1;
-
-	  quoted_string = XMALLOC (char, length + 1);
-
-	  p = quoted_string;
-	  backslashes = 0;
-	  if (quote_around)
-	    *p++ = '"';
-	  for (s = string; *s != '\0'; s++)
-	    {
-	      char c = *s;
-	      if (c == '"')
-		{
-		  unsigned int j;
-		  for (j = backslashes + 1; j > 0; j--)
-		    *p++ = '\\';
-		}
-	      *p++ = c;
-	      if (c == '\\')
-		backslashes++;
-	      else
-		backslashes = 0;
-	    }
-	  if (quote_around)
-	    {
-	      unsigned int j;
-	      for (j = backslashes; j > 0; j--)
-		*p++ = '\\';
-	      *p++ = '"';
-	    }
-	  *p = '\0';
-
-	  new_argv[i] = quoted_string;
-	}
-      else
-	new_argv[i] = (char *) string;
-    }
-  new_argv[argc] = NULL;
-
-  return new_argv;
-}
-EOF
-		;;
-	    esac
-
-            cat <<"EOF"
-void lt_dump_script (FILE* f)
-{
-EOF
-	    func_emit_wrapper yes |
-	      $SED -n -e '
-s/^\(.\{79\}\)\(..*\)/\1\
-\2/
-h
-s/\([\\"]\)/\\\1/g
-s/$/\\n/
-s/\([^\n]*\).*/  fputs ("\1", f);/p
-g
-D'
-            cat <<"EOF"
-}
-EOF
-}
-# end: func_emit_cwrapperexe_src
-
-# func_win32_import_lib_p ARG
-# True if ARG is an import lib, as indicated by $file_magic_cmd
-func_win32_import_lib_p ()
-{
-    $debug_cmd
-
-    case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in
-    *import*) : ;;
-    *) false ;;
-    esac
-}
-
-# func_suncc_cstd_abi
-# !!ONLY CALL THIS FOR SUN CC AFTER $compile_command IS FULLY EXPANDED!!
-# Several compiler flags select an ABI that is incompatible with the
-# Cstd library. Avoid specifying it if any are in CXXFLAGS.
-func_suncc_cstd_abi ()
-{
-    $debug_cmd
-
-    case " $compile_command " in
-    *" -compat=g "*|*\ -std=c++[0-9][0-9]\ *|*" -library=stdcxx4 "*|*" -library=stlport4 "*)
-      suncc_use_cstd_abi=no
-      ;;
-    *)
-      suncc_use_cstd_abi=yes
-      ;;
-    esac
-}
-
-# func_mode_link arg...
-func_mode_link ()
-{
-    $debug_cmd
-
-    case $host in
-    *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
-      # It is impossible to link a dll without this setting, and
-      # we shouldn't force the makefile maintainer to figure out
-      # what system we are compiling for in order to pass an extra
-      # flag for every libtool invocation.
-      # allow_undefined=no
-
-      # FIXME: Unfortunately, there are problems with the above when trying
-      # to make a dll that has undefined symbols, in which case not
-      # even a static library is built.  For now, we need to specify
-      # -no-undefined on the libtool link line when we can be certain
-      # that all symbols are satisfied, otherwise we get a static library.
-      allow_undefined=yes
-      ;;
-    *)
-      allow_undefined=yes
-      ;;
-    esac
-    libtool_args=$nonopt
-    base_compile="$nonopt $@"
-    compile_command=$nonopt
-    finalize_command=$nonopt
-
-    compile_rpath=
-    finalize_rpath=
-    compile_shlibpath=
-    finalize_shlibpath=
-    convenience=
-    old_convenience=
-    deplibs=
-    old_deplibs=
-    compiler_flags=
-    linker_flags=
-    dllsearchpath=
-    lib_search_path=`pwd`
-    inst_prefix_dir=
-    new_inherited_linker_flags=
-
-    avoid_version=no
-    bindir=
-    dlfiles=
-    dlprefiles=
-    dlself=no
-    export_dynamic=no
-    export_symbols=
-    export_symbols_regex=
-    generated=
-    libobjs=
-    ltlibs=
-    module=no
-    no_install=no
-    objs=
-    os2dllname=
-    non_pic_objects=
-    precious_files_regex=
-    prefer_static_libs=no
-    preload=false
-    prev=
-    prevarg=
-    release=
-    rpath=
-    xrpath=
-    perm_rpath=
-    temp_rpath=
-    thread_safe=no
-    vinfo=
-    vinfo_number=no
-    weak_libs=
-    single_module=$wl-single_module
-    func_infer_tag $base_compile
-
-    # We need to know -static, to get the right output filenames.
-    for arg
-    do
-      case $arg in
-      -shared)
-	test yes != "$build_libtool_libs" \
-	  && func_fatal_configuration "cannot build a shared library"
-	build_old_libs=no
-	break
-	;;
-      -all-static | -static | -static-libtool-libs)
-	case $arg in
-	-all-static)
-	  if test yes = "$build_libtool_libs" && test -z "$link_static_flag"; then
-	    func_warning "complete static linking is impossible in this configuration"
-	  fi
-	  if test -n "$link_static_flag"; then
-	    dlopen_self=$dlopen_self_static
-	  fi
-	  prefer_static_libs=yes
-	  ;;
-	-static)
-	  if test -z "$pic_flag" && test -n "$link_static_flag"; then
-	    dlopen_self=$dlopen_self_static
-	  fi
-	  prefer_static_libs=built
-	  ;;
-	-static-libtool-libs)
-	  if test -z "$pic_flag" && test -n "$link_static_flag"; then
-	    dlopen_self=$dlopen_self_static
-	  fi
-	  prefer_static_libs=yes
-	  ;;
-	esac
-	build_libtool_libs=no
-	build_old_libs=yes
-	break
-	;;
-      esac
-    done
-
-    # See if our shared archives depend on static archives.
-    test -n "$old_archive_from_new_cmds" && build_old_libs=yes
-
-    # Go through the arguments, transforming them on the way.
-    while test "$#" -gt 0; do
-      arg=$1
-      shift
-      func_quote_for_eval "$arg"
-      qarg=$func_quote_for_eval_unquoted_result
-      func_append libtool_args " $func_quote_for_eval_result"
-
-      # If the previous option needs an argument, assign it.
-      if test -n "$prev"; then
-	case $prev in
-	output)
-	  func_append compile_command " @OUTPUT@"
-	  func_append finalize_command " @OUTPUT@"
-	  ;;
-	esac
-
-	case $prev in
-	bindir)
-	  bindir=$arg
-	  prev=
-	  continue
-	  ;;
-	dlfiles|dlprefiles)
-	  $preload || {
-	    # Add the symbol object into the linking commands.
-	    func_append compile_command " @SYMFILE@"
-	    func_append finalize_command " @SYMFILE@"
-	    preload=:
-	  }
-	  case $arg in
-	  *.la | *.lo) ;;  # We handle these cases below.
-	  force)
-	    if test no = "$dlself"; then
-	      dlself=needless
-	      export_dynamic=yes
-	    fi
-	    prev=
-	    continue
-	    ;;
-	  self)
-	    if test dlprefiles = "$prev"; then
-	      dlself=yes
-	    elif test dlfiles = "$prev" && test yes != "$dlopen_self"; then
-	      dlself=yes
-	    else
-	      dlself=needless
-	      export_dynamic=yes
-	    fi
-	    prev=
-	    continue
-	    ;;
-	  *)
-	    if test dlfiles = "$prev"; then
-	      func_append dlfiles " $arg"
-	    else
-	      func_append dlprefiles " $arg"
-	    fi
-	    prev=
-	    continue
-	    ;;
-	  esac
-	  ;;
-	expsyms)
-	  export_symbols=$arg
-	  test -f "$arg" \
-	    || func_fatal_error "symbol file '$arg' does not exist"
-	  prev=
-	  continue
-	  ;;
-	expsyms_regex)
-	  export_symbols_regex=$arg
-	  prev=
-	  continue
-	  ;;
-	framework)
-	  case $host in
-	    *-*-darwin*)
-	      case "$deplibs " in
-		*" $qarg.ltframework "*) ;;
-		*) func_append deplibs " $qarg.ltframework" # this is fixed later
-		   ;;
-	      esac
-	      ;;
-	  esac
-	  prev=
-	  continue
-	  ;;
-	inst_prefix)
-	  inst_prefix_dir=$arg
-	  prev=
-	  continue
-	  ;;
-	mllvm)
-	  # Clang does not use LLVM to link, so we can simply discard any
-	  # '-mllvm $arg' options when doing the link step.
-	  prev=
-	  continue
-	  ;;
-	objectlist)
-	  if test -f "$arg"; then
-	    save_arg=$arg
-	    moreargs=
-	    for fil in `cat "$save_arg"`
-	    do
-#	      func_append moreargs " $fil"
-	      arg=$fil
-	      # A libtool-controlled object.
-
-	      # Check to see that this really is a libtool object.
-	      if func_lalib_unsafe_p "$arg"; then
-		pic_object=
-		non_pic_object=
-
-		# Read the .lo file
-		func_source "$arg"
-
-		if test -z "$pic_object" ||
-		   test -z "$non_pic_object" ||
-		   test none = "$pic_object" &&
-		   test none = "$non_pic_object"; then
-		  func_fatal_error "cannot find name of object for '$arg'"
-		fi
-
-		# Extract subdirectory from the argument.
-		func_dirname "$arg" "/" ""
-		xdir=$func_dirname_result
-
-		if test none != "$pic_object"; then
-		  # Prepend the subdirectory the object is found in.
-		  pic_object=$xdir$pic_object
-
-		  if test dlfiles = "$prev"; then
-		    if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then
-		      func_append dlfiles " $pic_object"
-		      prev=
-		      continue
-		    else
-		      # If libtool objects are unsupported, then we need to preload.
-		      prev=dlprefiles
-		    fi
-		  fi
-
-		  # CHECK ME:  I think I busted this.  -Ossama
-		  if test dlprefiles = "$prev"; then
-		    # Preload the old-style object.
-		    func_append dlprefiles " $pic_object"
-		    prev=
-		  fi
-
-		  # A PIC object.
-		  func_append libobjs " $pic_object"
-		  arg=$pic_object
-		fi
-
-		# Non-PIC object.
-		if test none != "$non_pic_object"; then
-		  # Prepend the subdirectory the object is found in.
-		  non_pic_object=$xdir$non_pic_object
-
-		  # A standard non-PIC object
-		  func_append non_pic_objects " $non_pic_object"
-		  if test -z "$pic_object" || test none = "$pic_object"; then
-		    arg=$non_pic_object
-		  fi
-		else
-		  # If the PIC object exists, use it instead.
-		  # $xdir was prepended to $pic_object above.
-		  non_pic_object=$pic_object
-		  func_append non_pic_objects " $non_pic_object"
-		fi
-	      else
-		# Only an error if not doing a dry-run.
-		if $opt_dry_run; then
-		  # Extract subdirectory from the argument.
-		  func_dirname "$arg" "/" ""
-		  xdir=$func_dirname_result
-
-		  func_lo2o "$arg"
-		  pic_object=$xdir$objdir/$func_lo2o_result
-		  non_pic_object=$xdir$func_lo2o_result
-		  func_append libobjs " $pic_object"
-		  func_append non_pic_objects " $non_pic_object"
-	        else
-		  func_fatal_error "'$arg' is not a valid libtool object"
-		fi
-	      fi
-	    done
-	  else
-	    func_fatal_error "link input file '$arg' does not exist"
-	  fi
-	  arg=$save_arg
-	  prev=
-	  continue
-	  ;;
-	os2dllname)
-	  os2dllname=$arg
-	  prev=
-	  continue
-	  ;;
-	precious_regex)
-	  precious_files_regex=$arg
-	  prev=
-	  continue
-	  ;;
-	release)
-	  release=-$arg
-	  prev=
-	  continue
-	  ;;
-	rpath | xrpath)
-	  # We need an absolute path.
-	  case $arg in
-	  [\\/]* | [A-Za-z]:[\\/]*) ;;
-	  *)
-	    func_fatal_error "only absolute run-paths are allowed"
-	    ;;
-	  esac
-	  if test rpath = "$prev"; then
-	    case "$rpath " in
-	    *" $arg "*) ;;
-	    *) func_append rpath " $arg" ;;
-	    esac
-	  else
-	    case "$xrpath " in
-	    *" $arg "*) ;;
-	    *) func_append xrpath " $arg" ;;
-	    esac
-	  fi
-	  prev=
-	  continue
-	  ;;
-	shrext)
-	  shrext_cmds=$arg
-	  prev=
-	  continue
-	  ;;
-	weak)
-	  func_append weak_libs " $arg"
-	  prev=
-	  continue
-	  ;;
-	xcclinker)
-	  func_append linker_flags " $qarg"
-	  func_append compiler_flags " $qarg"
-	  prev=
-	  func_append compile_command " $qarg"
-	  func_append finalize_command " $qarg"
-	  continue
-	  ;;
-	xcompiler)
-	  func_append compiler_flags " $qarg"
-	  prev=
-	  func_append compile_command " $qarg"
-	  func_append finalize_command " $qarg"
-	  continue
-	  ;;
-	xlinker)
-	  func_append linker_flags " $qarg"
-	  func_append compiler_flags " $wl$qarg"
-	  prev=
-	  func_append compile_command " $wl$qarg"
-	  func_append finalize_command " $wl$qarg"
-	  continue
-	  ;;
-	*)
-	  eval "$prev=\"\$arg\""
-	  prev=
-	  continue
-	  ;;
-	esac
-      fi # test -n "$prev"
-
-      prevarg=$arg
-
-      case $arg in
-      -all-static)
-	if test -n "$link_static_flag"; then
-	  # See comment for -static flag below, for more details.
-	  func_append compile_command " $link_static_flag"
-	  func_append finalize_command " $link_static_flag"
-	fi
-	continue
-	;;
-
-      -allow-undefined)
-	# FIXME: remove this flag sometime in the future.
-	func_fatal_error "'-allow-undefined' must not be used because it is the default"
-	;;
-
-      -avoid-version)
-	avoid_version=yes
-	continue
-	;;
-
-      -bindir)
-	prev=bindir
-	continue
-	;;
-
-      -dlopen)
-	prev=dlfiles
-	continue
-	;;
-
-      -dlpreopen)
-	prev=dlprefiles
-	continue
-	;;
-
-      -export-dynamic)
-	export_dynamic=yes
-	continue
-	;;
-
-      -export-symbols | -export-symbols-regex)
-	if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
-	  func_fatal_error "more than one -exported-symbols argument is not allowed"
-	fi
-	if test X-export-symbols = "X$arg"; then
-	  prev=expsyms
-	else
-	  prev=expsyms_regex
-	fi
-	continue
-	;;
-
-      -framework)
-	prev=framework
-	continue
-	;;
-
-      -inst-prefix-dir)
-	prev=inst_prefix
-	continue
-	;;
-
-      # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
-      # so, if we see these flags be careful not to treat them like -L
-      -L[A-Z][A-Z]*:*)
-	case $with_gcc/$host in
-	no/*-*-irix* | /*-*-irix*)
-	  func_append compile_command " $arg"
-	  func_append finalize_command " $arg"
-	  ;;
-	esac
-	continue
-	;;
-
-      -L*)
-	func_stripname "-L" '' "$arg"
-	if test -z "$func_stripname_result"; then
-	  if test "$#" -gt 0; then
-	    func_fatal_error "require no space between '-L' and '$1'"
-	  else
-	    func_fatal_error "need path for '-L' option"
-	  fi
-	fi
-	func_resolve_sysroot "$func_stripname_result"
-	dir=$func_resolve_sysroot_result
-	# We need an absolute path.
-	case $dir in
-	[\\/]* | [A-Za-z]:[\\/]*) ;;
-	*)
-	  absdir=`cd "$dir" && pwd`
-	  test -z "$absdir" && \
-	    func_fatal_error "cannot determine absolute directory name of '$dir'"
-	  dir=$absdir
-	  ;;
-	esac
-	case "$deplibs " in
-	*" -L$dir "* | *" $arg "*)
-	  # Will only happen for absolute or sysroot arguments
-	  ;;
-	*)
-	  # Preserve sysroot, but never include relative directories
-	  case $dir in
-	    [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;;
-	    *) func_append deplibs " -L$dir" ;;
-	  esac
-	  func_append lib_search_path " $dir"
-	  ;;
-	esac
-	case $host in
-	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
-	  testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'`
-	  case :$dllsearchpath: in
-	  *":$dir:"*) ;;
-	  ::) dllsearchpath=$dir;;
-	  *) func_append dllsearchpath ":$dir";;
-	  esac
-	  case :$dllsearchpath: in
-	  *":$testbindir:"*) ;;
-	  ::) dllsearchpath=$testbindir;;
-	  *) func_append dllsearchpath ":$testbindir";;
-	  esac
-	  ;;
-	esac
-	continue
-	;;
-
-      -l*)
-	if test X-lc = "X$arg" || test X-lm = "X$arg"; then
-	  case $host in
-	  *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*)
-	    # These systems don't actually have a C or math library (as such)
-	    continue
-	    ;;
-	  *-*-os2*)
-	    # These systems don't actually have a C library (as such)
-	    test X-lc = "X$arg" && continue
-	    ;;
-	  *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*)
-	    # Do not include libc due to us having libc/libc_r.
-	    test X-lc = "X$arg" && continue
-	    ;;
-	  *-*-rhapsody* | *-*-darwin1.[012])
-	    # Rhapsody C and math libraries are in the System framework
-	    func_append deplibs " System.ltframework"
-	    continue
-	    ;;
-	  *-*-sco3.2v5* | *-*-sco5v6*)
-	    # Causes problems with __ctype
-	    test X-lc = "X$arg" && continue
-	    ;;
-	  *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
-	    # Compiler inserts libc in the correct place for threads to work
-	    test X-lc = "X$arg" && continue
-	    ;;
-	  esac
-	elif test X-lc_r = "X$arg"; then
-	 case $host in
-	 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*)
-	   # Do not include libc_r directly, use -pthread flag.
-	   continue
-	   ;;
-	 esac
-	fi
-	func_append deplibs " $arg"
-	continue
-	;;
-
-      -mllvm)
-	prev=mllvm
-	continue
-	;;
-
-      -module)
-	module=yes
-	continue
-	;;
-
-      # Tru64 UNIX uses -model [arg] to determine the layout of C++
-      # classes, name mangling, and exception handling.
-      # Darwin uses the -arch flag to determine output architecture.
-      -model|-arch|-isysroot|--sysroot)
-	func_append compiler_flags " $arg"
-	func_append compile_command " $arg"
-	func_append finalize_command " $arg"
-	prev=xcompiler
-	continue
-	;;
-
-      -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
-      |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
-	func_append compiler_flags " $arg"
-	func_append compile_command " $arg"
-	func_append finalize_command " $arg"
-	case "$new_inherited_linker_flags " in
-	    *" $arg "*) ;;
-	    * ) func_append new_inherited_linker_flags " $arg" ;;
-	esac
-	continue
-	;;
-
-      -multi_module)
-	single_module=$wl-multi_module
-	continue
-	;;
-
-      -no-fast-install)
-	fast_install=no
-	continue
-	;;
-
-      -no-install)
-	case $host in
-	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*)
-	  # The PATH hackery in wrapper scripts is required on Windows
-	  # and Darwin in order for the loader to find any dlls it needs.
-	  func_warning "'-no-install' is ignored for $host"
-	  func_warning "assuming '-no-fast-install' instead"
-	  fast_install=no
-	  ;;
-	*) no_install=yes ;;
-	esac
-	continue
-	;;
-
-      -no-undefined)
-	allow_undefined=no
-	continue
-	;;
-
-      -objectlist)
-	prev=objectlist
-	continue
-	;;
-
-      -os2dllname)
-	prev=os2dllname
-	continue
-	;;
-
-      -o) prev=output ;;
-
-      -precious-files-regex)
-	prev=precious_regex
-	continue
-	;;
-
-      -release)
-	prev=release
-	continue
-	;;
-
-      -rpath)
-	prev=rpath
-	continue
-	;;
-
-      -R)
-	prev=xrpath
-	continue
-	;;
-
-      -R*)
-	func_stripname '-R' '' "$arg"
-	dir=$func_stripname_result
-	# We need an absolute path.
-	case $dir in
-	[\\/]* | [A-Za-z]:[\\/]*) ;;
-	=*)
-	  func_stripname '=' '' "$dir"
-	  dir=$lt_sysroot$func_stripname_result
-	  ;;
-	*)
-	  func_fatal_error "only absolute run-paths are allowed"
-	  ;;
-	esac
-	case "$xrpath " in
-	*" $dir "*) ;;
-	*) func_append xrpath " $dir" ;;
-	esac
-	continue
-	;;
-
-      -shared)
-	# The effects of -shared are defined in a previous loop.
-	continue
-	;;
-
-      -shrext)
-	prev=shrext
-	continue
-	;;
-
-      -static | -static-libtool-libs)
-	# The effects of -static are defined in a previous loop.
-	# We used to do the same as -all-static on platforms that
-	# didn't have a PIC flag, but the assumption that the effects
-	# would be equivalent was wrong.  It would break on at least
-	# Digital Unix and AIX.
-	continue
-	;;
-
-      -thread-safe)
-	thread_safe=yes
-	continue
-	;;
-
-      -version-info)
-	prev=vinfo
-	continue
-	;;
-
-      -version-number)
-	prev=vinfo
-	vinfo_number=yes
-	continue
-	;;
-
-      -weak)
-        prev=weak
-	continue
-	;;
-
-      -Wc,*)
-	func_stripname '-Wc,' '' "$arg"
-	args=$func_stripname_result
-	arg=
-	save_ifs=$IFS; IFS=,
-	for flag in $args; do
-	  IFS=$save_ifs
-          func_quote_for_eval "$flag"
-	  func_append arg " $func_quote_for_eval_result"
-	  func_append compiler_flags " $func_quote_for_eval_result"
-	done
-	IFS=$save_ifs
-	func_stripname ' ' '' "$arg"
-	arg=$func_stripname_result
-	;;
-
-      -Wl,*)
-	func_stripname '-Wl,' '' "$arg"
-	args=$func_stripname_result
-	arg=
-	save_ifs=$IFS; IFS=,
-	for flag in $args; do
-	  IFS=$save_ifs
-          func_quote_for_eval "$flag"
-	  func_append arg " $wl$func_quote_for_eval_result"
-	  func_append compiler_flags " $wl$func_quote_for_eval_result"
-	  func_append linker_flags " $func_quote_for_eval_result"
-	done
-	IFS=$save_ifs
-	func_stripname ' ' '' "$arg"
-	arg=$func_stripname_result
-	;;
-
-      -Xcompiler)
-	prev=xcompiler
-	continue
-	;;
-
-      -Xlinker)
-	prev=xlinker
-	continue
-	;;
-
-      -XCClinker)
-	prev=xcclinker
-	continue
-	;;
-
-      # -msg_* for osf cc
-      -msg_*)
-	func_quote_for_eval "$arg"
-	arg=$func_quote_for_eval_result
-	;;
-
-      # Flags to be passed through unchanged, with rationale:
-      # -64, -mips[0-9]      enable 64-bit mode for the SGI compiler
-      # -r[0-9][0-9]*        specify processor for the SGI compiler
-      # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler
-      # +DA*, +DD*           enable 64-bit mode for the HP compiler
-      # -q*                  compiler args for the IBM compiler
-      # -m*, -t[45]*, -txscale* architecture-specific flags for GCC
-      # -F/path              path to uninstalled frameworks, gcc on darwin
-      # -p, -pg, --coverage, -fprofile-*  profiling flags for GCC
-      # -fstack-protector*   stack protector flags for GCC
-      # @file                GCC response files
-      # -tp=*                Portland pgcc target processor selection
-      # --sysroot=*          for sysroot support
-      # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
-      # -stdlib=*            select c++ std lib with clang
-      -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
-      -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
-      -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*)
-        func_quote_for_eval "$arg"
-	arg=$func_quote_for_eval_result
-        func_append compile_command " $arg"
-        func_append finalize_command " $arg"
-        func_append compiler_flags " $arg"
-        continue
-        ;;
-
-      -Z*)
-        if test os2 = "`expr $host : '.*\(os2\)'`"; then
-          # OS/2 uses -Zxxx to specify OS/2-specific options
-	  compiler_flags="$compiler_flags $arg"
-	  func_append compile_command " $arg"
-	  func_append finalize_command " $arg"
-	  case $arg in
-	  -Zlinker | -Zstack)
-	    prev=xcompiler
-	    ;;
-	  esac
-	  continue
-        else
-	  # Otherwise treat like 'Some other compiler flag' below
-	  func_quote_for_eval "$arg"
-	  arg=$func_quote_for_eval_result
-        fi
-	;;
-
-      # Some other compiler flag.
-      -* | +*)
-        func_quote_for_eval "$arg"
-	arg=$func_quote_for_eval_result
-	;;
-
-      *.$objext)
-	# A standard object.
-	func_append objs " $arg"
-	;;
-
-      *.lo)
-	# A libtool-controlled object.
-
-	# Check to see that this really is a libtool object.
-	if func_lalib_unsafe_p "$arg"; then
-	  pic_object=
-	  non_pic_object=
-
-	  # Read the .lo file
-	  func_source "$arg"
-
-	  if test -z "$pic_object" ||
-	     test -z "$non_pic_object" ||
-	     test none = "$pic_object" &&
-	     test none = "$non_pic_object"; then
-	    func_fatal_error "cannot find name of object for '$arg'"
-	  fi
-
-	  # Extract subdirectory from the argument.
-	  func_dirname "$arg" "/" ""
-	  xdir=$func_dirname_result
-
-	  test none = "$pic_object" || {
-	    # Prepend the subdirectory the object is found in.
-	    pic_object=$xdir$pic_object
-
-	    if test dlfiles = "$prev"; then
-	      if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then
-		func_append dlfiles " $pic_object"
-		prev=
-		continue
-	      else
-		# If libtool objects are unsupported, then we need to preload.
-		prev=dlprefiles
-	      fi
-	    fi
-
-	    # CHECK ME:  I think I busted this.  -Ossama
-	    if test dlprefiles = "$prev"; then
-	      # Preload the old-style object.
-	      func_append dlprefiles " $pic_object"
-	      prev=
-	    fi
-
-	    # A PIC object.
-	    func_append libobjs " $pic_object"
-	    arg=$pic_object
-	  }
-
-	  # Non-PIC object.
-	  if test none != "$non_pic_object"; then
-	    # Prepend the subdirectory the object is found in.
-	    non_pic_object=$xdir$non_pic_object
-
-	    # A standard non-PIC object
-	    func_append non_pic_objects " $non_pic_object"
-	    if test -z "$pic_object" || test none = "$pic_object"; then
-	      arg=$non_pic_object
-	    fi
-	  else
-	    # If the PIC object exists, use it instead.
-	    # $xdir was prepended to $pic_object above.
-	    non_pic_object=$pic_object
-	    func_append non_pic_objects " $non_pic_object"
-	  fi
-	else
-	  # Only an error if not doing a dry-run.
-	  if $opt_dry_run; then
-	    # Extract subdirectory from the argument.
-	    func_dirname "$arg" "/" ""
-	    xdir=$func_dirname_result
-
-	    func_lo2o "$arg"
-	    pic_object=$xdir$objdir/$func_lo2o_result
-	    non_pic_object=$xdir$func_lo2o_result
-	    func_append libobjs " $pic_object"
-	    func_append non_pic_objects " $non_pic_object"
-	  else
-	    func_fatal_error "'$arg' is not a valid libtool object"
-	  fi
-	fi
-	;;
-
-      *.$libext)
-	# An archive.
-	func_append deplibs " $arg"
-	func_append old_deplibs " $arg"
-	continue
-	;;
-
-      *.la)
-	# A libtool-controlled library.
-
-	func_resolve_sysroot "$arg"
-	if test dlfiles = "$prev"; then
-	  # This library was specified with -dlopen.
-	  func_append dlfiles " $func_resolve_sysroot_result"
-	  prev=
-	elif test dlprefiles = "$prev"; then
-	  # The library was specified with -dlpreopen.
-	  func_append dlprefiles " $func_resolve_sysroot_result"
-	  prev=
-	else
-	  func_append deplibs " $func_resolve_sysroot_result"
-	fi
-	continue
-	;;
-
-      # Some other compiler argument.
-      *)
-	# Unknown arguments in both finalize_command and compile_command need
-	# to be aesthetically quoted because they are evaled later.
-	func_quote_for_eval "$arg"
-	arg=$func_quote_for_eval_result
-	;;
-      esac # arg
-
-      # Now actually substitute the argument into the commands.
-      if test -n "$arg"; then
-	func_append compile_command " $arg"
-	func_append finalize_command " $arg"
-      fi
-    done # argument parsing loop
-
-    test -n "$prev" && \
-      func_fatal_help "the '$prevarg' option requires an argument"
-
-    if test yes = "$export_dynamic" && test -n "$export_dynamic_flag_spec"; then
-      eval arg=\"$export_dynamic_flag_spec\"
-      func_append compile_command " $arg"
-      func_append finalize_command " $arg"
-    fi
-
-    oldlibs=
-    # calculate the name of the file, without its directory
-    func_basename "$output"
-    outputname=$func_basename_result
-    libobjs_save=$libobjs
-
-    if test -n "$shlibpath_var"; then
-      # get the directories listed in $shlibpath_var
-      eval shlib_search_path=\`\$ECHO \"\$$shlibpath_var\" \| \$SED \'s/:/ /g\'\`
-    else
-      shlib_search_path=
-    fi
-    eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
-    eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
-
-    # Definition is injected by LT_CONFIG during libtool generation.
-    func_munge_path_list sys_lib_dlsearch_path "$LT_SYS_LIBRARY_PATH"
-
-    func_dirname "$output" "/" ""
-    output_objdir=$func_dirname_result$objdir
-    func_to_tool_file "$output_objdir/"
-    tool_output_objdir=$func_to_tool_file_result
-    # Create the object directory.
-    func_mkdir_p "$output_objdir"
-
-    # Determine the type of output
-    case $output in
-    "")
-      func_fatal_help "you must specify an output file"
-      ;;
-    *.$libext) linkmode=oldlib ;;
-    *.lo | *.$objext) linkmode=obj ;;
-    *.la) linkmode=lib ;;
-    *) linkmode=prog ;; # Anything else should be a program.
-    esac
-
-    specialdeplibs=
-
-    libs=
-    # Find all interdependent deplibs by searching for libraries
-    # that are linked more than once (e.g. -la -lb -la)
-    for deplib in $deplibs; do
-      if $opt_preserve_dup_deps; then
-	case "$libs " in
-	*" $deplib "*) func_append specialdeplibs " $deplib" ;;
-	esac
-      fi
-      func_append libs " $deplib"
-    done
-
-    if test lib = "$linkmode"; then
-      libs="$predeps $libs $compiler_lib_search_path $postdeps"
-
-      # Compute libraries that are listed more than once in $predeps
-      # $postdeps and mark them as special (i.e., whose duplicates are
-      # not to be eliminated).
-      pre_post_deps=
-      if $opt_duplicate_compiler_generated_deps; then
-	for pre_post_dep in $predeps $postdeps; do
-	  case "$pre_post_deps " in
-	  *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;;
-	  esac
-	  func_append pre_post_deps " $pre_post_dep"
-	done
-      fi
-      pre_post_deps=
-    fi
-
-    deplibs=
-    newdependency_libs=
-    newlib_search_path=
-    need_relink=no # whether we're linking any uninstalled libtool libraries
-    notinst_deplibs= # not-installed libtool libraries
-    notinst_path= # paths that contain not-installed libtool libraries
-
-    case $linkmode in
-    lib)
-	passes="conv dlpreopen link"
-	for file in $dlfiles $dlprefiles; do
-	  case $file in
-	  *.la) ;;
-	  *)
-	    func_fatal_help "libraries can '-dlopen' only libtool libraries: $file"
-	    ;;
-	  esac
-	done
-	;;
-    prog)
-	compile_deplibs=
-	finalize_deplibs=
-	alldeplibs=false
-	newdlfiles=
-	newdlprefiles=
-	passes="conv scan dlopen dlpreopen link"
-	;;
-    *)  passes="conv"
-	;;
-    esac
-
-    for pass in $passes; do
-      # The preopen pass in lib mode reverses $deplibs; put it back here
-      # so that -L comes before libs that need it for instance...
-      if test lib,link = "$linkmode,$pass"; then
-	## FIXME: Find the place where the list is rebuilt in the wrong
-	##        order, and fix it there properly
-        tmp_deplibs=
-	for deplib in $deplibs; do
-	  tmp_deplibs="$deplib $tmp_deplibs"
-	done
-	deplibs=$tmp_deplibs
-      fi
-
-      if test lib,link = "$linkmode,$pass" ||
-	 test prog,scan = "$linkmode,$pass"; then
-	libs=$deplibs
-	deplibs=
-      fi
-      if test prog = "$linkmode"; then
-	case $pass in
-	dlopen) libs=$dlfiles ;;
-	dlpreopen) libs=$dlprefiles ;;
-	link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
-	esac
-      fi
-      if test lib,dlpreopen = "$linkmode,$pass"; then
-	# Collect and forward deplibs of preopened libtool libs
-	for lib in $dlprefiles; do
-	  # Ignore non-libtool-libs
-	  dependency_libs=
-	  func_resolve_sysroot "$lib"
-	  case $lib in
-	  *.la)	func_source "$func_resolve_sysroot_result" ;;
-	  esac
-
-	  # Collect preopened libtool deplibs, except any this library
-	  # has declared as weak libs
-	  for deplib in $dependency_libs; do
-	    func_basename "$deplib"
-            deplib_base=$func_basename_result
-	    case " $weak_libs " in
-	    *" $deplib_base "*) ;;
-	    *) func_append deplibs " $deplib" ;;
-	    esac
-	  done
-	done
-	libs=$dlprefiles
-      fi
-      if test dlopen = "$pass"; then
-	# Collect dlpreopened libraries
-	save_deplibs=$deplibs
-	deplibs=
-      fi
-
-      for deplib in $libs; do
-	lib=
-	found=false
-	case $deplib in
-	-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
-        |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
-	  if test prog,link = "$linkmode,$pass"; then
-	    compile_deplibs="$deplib $compile_deplibs"
-	    finalize_deplibs="$deplib $finalize_deplibs"
-	  else
-	    func_append compiler_flags " $deplib"
-	    if test lib = "$linkmode"; then
-		case "$new_inherited_linker_flags " in
-		    *" $deplib "*) ;;
-		    * ) func_append new_inherited_linker_flags " $deplib" ;;
-		esac
-	    fi
-	  fi
-	  continue
-	  ;;
-	-l*)
-	  if test lib != "$linkmode" && test prog != "$linkmode"; then
-	    func_warning "'-l' is ignored for archives/objects"
-	    continue
-	  fi
-	  func_stripname '-l' '' "$deplib"
-	  name=$func_stripname_result
-	  if test lib = "$linkmode"; then
-	    searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
-	  else
-	    searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path"
-	  fi
-	  for searchdir in $searchdirs; do
-	    for search_ext in .la $std_shrext .so .a; do
-	      # Search the libtool library
-	      lib=$searchdir/lib$name$search_ext
-	      if test -f "$lib"; then
-		if test .la = "$search_ext"; then
-		  found=:
-		else
-		  found=false
-		fi
-		break 2
-	      fi
-	    done
-	  done
-	  if $found; then
-	    # deplib is a libtool library
-	    # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
-	    # We need to do some special things here, and not later.
-	    if test yes = "$allow_libtool_libs_with_static_runtimes"; then
-	      case " $predeps $postdeps " in
-	      *" $deplib "*)
-		if func_lalib_p "$lib"; then
-		  library_names=
-		  old_library=
-		  func_source "$lib"
-		  for l in $old_library $library_names; do
-		    ll=$l
-		  done
-		  if test "X$ll" = "X$old_library"; then # only static version available
-		    found=false
-		    func_dirname "$lib" "" "."
-		    ladir=$func_dirname_result
-		    lib=$ladir/$old_library
-		    if test prog,link = "$linkmode,$pass"; then
-		      compile_deplibs="$deplib $compile_deplibs"
-		      finalize_deplibs="$deplib $finalize_deplibs"
-		    else
-		      deplibs="$deplib $deplibs"
-		      test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs"
-		    fi
-		    continue
-		  fi
-		fi
-		;;
-	      *) ;;
-	      esac
-	    fi
-	  else
-	    # deplib doesn't seem to be a libtool library
-	    if test prog,link = "$linkmode,$pass"; then
-	      compile_deplibs="$deplib $compile_deplibs"
-	      finalize_deplibs="$deplib $finalize_deplibs"
-	    else
-	      deplibs="$deplib $deplibs"
-	      test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs"
-	    fi
-	    continue
-	  fi
-	  ;; # -l
-	*.ltframework)
-	  if test prog,link = "$linkmode,$pass"; then
-	    compile_deplibs="$deplib $compile_deplibs"
-	    finalize_deplibs="$deplib $finalize_deplibs"
-	  else
-	    deplibs="$deplib $deplibs"
-	    if test lib = "$linkmode"; then
-		case "$new_inherited_linker_flags " in
-		    *" $deplib "*) ;;
-		    * ) func_append new_inherited_linker_flags " $deplib" ;;
-		esac
-	    fi
-	  fi
-	  continue
-	  ;;
-	-L*)
-	  case $linkmode in
-	  lib)
-	    deplibs="$deplib $deplibs"
-	    test conv = "$pass" && continue
-	    newdependency_libs="$deplib $newdependency_libs"
-	    func_stripname '-L' '' "$deplib"
-	    func_resolve_sysroot "$func_stripname_result"
-	    func_append newlib_search_path " $func_resolve_sysroot_result"
-	    ;;
-	  prog)
-	    if test conv = "$pass"; then
-	      deplibs="$deplib $deplibs"
-	      continue
-	    fi
-	    if test scan = "$pass"; then
-	      deplibs="$deplib $deplibs"
-	    else
-	      compile_deplibs="$deplib $compile_deplibs"
-	      finalize_deplibs="$deplib $finalize_deplibs"
-	    fi
-	    func_stripname '-L' '' "$deplib"
-	    func_resolve_sysroot "$func_stripname_result"
-	    func_append newlib_search_path " $func_resolve_sysroot_result"
-	    ;;
-	  *)
-	    func_warning "'-L' is ignored for archives/objects"
-	    ;;
-	  esac # linkmode
-	  continue
-	  ;; # -L
-	-R*)
-	  if test link = "$pass"; then
-	    func_stripname '-R' '' "$deplib"
-	    func_resolve_sysroot "$func_stripname_result"
-	    dir=$func_resolve_sysroot_result
-	    # Make sure the xrpath contains only unique directories.
-	    case "$xrpath " in
-	    *" $dir "*) ;;
-	    *) func_append xrpath " $dir" ;;
-	    esac
-	  fi
-	  deplibs="$deplib $deplibs"
-	  continue
-	  ;;
-	*.la)
-	  func_resolve_sysroot "$deplib"
-	  lib=$func_resolve_sysroot_result
-	  ;;
-	*.$libext)
-	  if test conv = "$pass"; then
-	    deplibs="$deplib $deplibs"
-	    continue
-	  fi
-	  case $linkmode in
-	  lib)
-	    # Linking convenience modules into shared libraries is allowed,
-	    # but linking other static libraries is non-portable.
-	    case " $dlpreconveniencelibs " in
-	    *" $deplib "*) ;;
-	    *)
-	      valid_a_lib=false
-	      case $deplibs_check_method in
-		match_pattern*)
-		  set dummy $deplibs_check_method; shift
-		  match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
-		  if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \
-		    | $EGREP "$match_pattern_regex" > /dev/null; then
-		    valid_a_lib=:
-		  fi
-		;;
-		pass_all)
-		  valid_a_lib=:
-		;;
-	      esac
-	      if $valid_a_lib; then
-		echo
-		$ECHO "*** Warning: Linking the shared library $output against the"
-		$ECHO "*** static library $deplib is not portable!"
-		deplibs="$deplib $deplibs"
-	      else
-		echo
-		$ECHO "*** Warning: Trying to link with static lib archive $deplib."
-		echo "*** I have the capability to make that library automatically link in when"
-		echo "*** you link to this library.  But I can only do this if you have a"
-		echo "*** shared version of the library, which you do not appear to have"
-		echo "*** because the file extensions .$libext of this argument makes me believe"
-		echo "*** that it is just a static archive that I should not use here."
-	      fi
-	      ;;
-	    esac
-	    continue
-	    ;;
-	  prog)
-	    if test link != "$pass"; then
-	      deplibs="$deplib $deplibs"
-	    else
-	      compile_deplibs="$deplib $compile_deplibs"
-	      finalize_deplibs="$deplib $finalize_deplibs"
-	    fi
-	    continue
-	    ;;
-	  esac # linkmode
-	  ;; # *.$libext
-	*.lo | *.$objext)
-	  if test conv = "$pass"; then
-	    deplibs="$deplib $deplibs"
-	  elif test prog = "$linkmode"; then
-	    if test dlpreopen = "$pass" || test yes != "$dlopen_support" || test no = "$build_libtool_libs"; then
-	      # If there is no dlopen support or we're linking statically,
-	      # we need to preload.
-	      func_append newdlprefiles " $deplib"
-	      compile_deplibs="$deplib $compile_deplibs"
-	      finalize_deplibs="$deplib $finalize_deplibs"
-	    else
-	      func_append newdlfiles " $deplib"
-	    fi
-	  fi
-	  continue
-	  ;;
-	%DEPLIBS%)
-	  alldeplibs=:
-	  continue
-	  ;;
-	esac # case $deplib
-
-	$found || test -f "$lib" \
-	  || func_fatal_error "cannot find the library '$lib' or unhandled argument '$deplib'"
-
-	# Check to see that this really is a libtool archive.
-	func_lalib_unsafe_p "$lib" \
-	  || func_fatal_error "'$lib' is not a valid libtool archive"
-
-	func_dirname "$lib" "" "."
-	ladir=$func_dirname_result
-
-	dlname=
-	dlopen=
-	dlpreopen=
-	libdir=
-	library_names=
-	old_library=
-	inherited_linker_flags=
-	# If the library was installed with an old release of libtool,
-	# it will not redefine variables installed, or shouldnotlink
-	installed=yes
-	shouldnotlink=no
-	avoidtemprpath=
-
-
-	# Read the .la file
-	func_source "$lib"
-
-	# Convert "-framework foo" to "foo.ltframework"
-	if test -n "$inherited_linker_flags"; then
-	  tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'`
-	  for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do
-	    case " $new_inherited_linker_flags " in
-	      *" $tmp_inherited_linker_flag "*) ;;
-	      *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";;
-	    esac
-	  done
-	fi
-	dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
-	if test lib,link = "$linkmode,$pass" ||
-	   test prog,scan = "$linkmode,$pass" ||
-	   { test prog != "$linkmode" && test lib != "$linkmode"; }; then
-	  test -n "$dlopen" && func_append dlfiles " $dlopen"
-	  test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen"
-	fi
-
-	if test conv = "$pass"; then
-	  # Only check for convenience libraries
-	  deplibs="$lib $deplibs"
-	  if test -z "$libdir"; then
-	    if test -z "$old_library"; then
-	      func_fatal_error "cannot find name of link library for '$lib'"
-	    fi
-	    # It is a libtool convenience library, so add in its objects.
-	    func_append convenience " $ladir/$objdir/$old_library"
-	    func_append old_convenience " $ladir/$objdir/$old_library"
-	  elif test prog != "$linkmode" && test lib != "$linkmode"; then
-	    func_fatal_error "'$lib' is not a convenience library"
-	  fi
-	  tmp_libs=
-	  for deplib in $dependency_libs; do
-	    deplibs="$deplib $deplibs"
-	    if $opt_preserve_dup_deps; then
-	      case "$tmp_libs " in
-	      *" $deplib "*) func_append specialdeplibs " $deplib" ;;
-	      esac
-	    fi
-	    func_append tmp_libs " $deplib"
-	  done
-	  continue
-	fi # $pass = conv
-
-
-	# Get the name of the library we link against.
-	linklib=
-	if test -n "$old_library" &&
-	   { test yes = "$prefer_static_libs" ||
-	     test built,no = "$prefer_static_libs,$installed"; }; then
-	  linklib=$old_library
-	else
-	  for l in $old_library $library_names; do
-	    linklib=$l
-	  done
-	fi
-	if test -z "$linklib"; then
-	  func_fatal_error "cannot find name of link library for '$lib'"
-	fi
-
-	# This library was specified with -dlopen.
-	if test dlopen = "$pass"; then
-	  test -z "$libdir" \
-	    && func_fatal_error "cannot -dlopen a convenience library: '$lib'"
-	  if test -z "$dlname" ||
-	     test yes != "$dlopen_support" ||
-	     test no = "$build_libtool_libs"
-	  then
-	    # If there is no dlname, no dlopen support or we're linking
-	    # statically, we need to preload.  We also need to preload any
-	    # dependent libraries so libltdl's deplib preloader doesn't
-	    # bomb out in the load deplibs phase.
-	    func_append dlprefiles " $lib $dependency_libs"
-	  else
-	    func_append newdlfiles " $lib"
-	  fi
-	  continue
-	fi # $pass = dlopen
-
-	# We need an absolute path.
-	case $ladir in
-	[\\/]* | [A-Za-z]:[\\/]*) abs_ladir=$ladir ;;
-	*)
-	  abs_ladir=`cd "$ladir" && pwd`
-	  if test -z "$abs_ladir"; then
-	    func_warning "cannot determine absolute directory name of '$ladir'"
-	    func_warning "passing it literally to the linker, although it might fail"
-	    abs_ladir=$ladir
-	  fi
-	  ;;
-	esac
-	func_basename "$lib"
-	laname=$func_basename_result
-
-	# Find the relevant object directory and library name.
-	if test yes = "$installed"; then
-	  if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
-	    func_warning "library '$lib' was moved."
-	    dir=$ladir
-	    absdir=$abs_ladir
-	    libdir=$abs_ladir
-	  else
-	    dir=$lt_sysroot$libdir
-	    absdir=$lt_sysroot$libdir
-	  fi
-	  test yes = "$hardcode_automatic" && avoidtemprpath=yes
-	else
-	  if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
-	    dir=$ladir
-	    absdir=$abs_ladir
-	    # Remove this search path later
-	    func_append notinst_path " $abs_ladir"
-	  else
-	    dir=$ladir/$objdir
-	    absdir=$abs_ladir/$objdir
-	    # Remove this search path later
-	    func_append notinst_path " $abs_ladir"
-	  fi
-	fi # $installed = yes
-	func_stripname 'lib' '.la' "$laname"
-	name=$func_stripname_result
-
-	# This library was specified with -dlpreopen.
-	if test dlpreopen = "$pass"; then
-	  if test -z "$libdir" && test prog = "$linkmode"; then
-	    func_fatal_error "only libraries may -dlpreopen a convenience library: '$lib'"
-	  fi
-	  case $host in
-	    # special handling for platforms with PE-DLLs.
-	    *cygwin* | *mingw* | *cegcc* )
-	      # Linker will automatically link against shared library if both
-	      # static and shared are present.  Therefore, ensure we extract
-	      # symbols from the import library if a shared library is present
-	      # (otherwise, the dlopen module name will be incorrect).  We do
-	      # this by putting the import library name into $newdlprefiles.
-	      # We recover the dlopen module name by 'saving' the la file
-	      # name in a special purpose variable, and (later) extracting the
-	      # dlname from the la file.
-	      if test -n "$dlname"; then
-	        func_tr_sh "$dir/$linklib"
-	        eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname"
-	        func_append newdlprefiles " $dir/$linklib"
-	      else
-	        func_append newdlprefiles " $dir/$old_library"
-	        # Keep a list of preopened convenience libraries to check
-	        # that they are being used correctly in the link pass.
-	        test -z "$libdir" && \
-	          func_append dlpreconveniencelibs " $dir/$old_library"
-	      fi
-	    ;;
-	    * )
-	      # Prefer using a static library (so that no silly _DYNAMIC symbols
-	      # are required to link).
-	      if test -n "$old_library"; then
-	        func_append newdlprefiles " $dir/$old_library"
-	        # Keep a list of preopened convenience libraries to check
-	        # that they are being used correctly in the link pass.
-	        test -z "$libdir" && \
-	          func_append dlpreconveniencelibs " $dir/$old_library"
-	      # Otherwise, use the dlname, so that lt_dlopen finds it.
-	      elif test -n "$dlname"; then
-	        func_append newdlprefiles " $dir/$dlname"
-	      else
-	        func_append newdlprefiles " $dir/$linklib"
-	      fi
-	    ;;
-	  esac
-	fi # $pass = dlpreopen
-
-	if test -z "$libdir"; then
-	  # Link the convenience library
-	  if test lib = "$linkmode"; then
-	    deplibs="$dir/$old_library $deplibs"
-	  elif test prog,link = "$linkmode,$pass"; then
-	    compile_deplibs="$dir/$old_library $compile_deplibs"
-	    finalize_deplibs="$dir/$old_library $finalize_deplibs"
-	  else
-	    deplibs="$lib $deplibs" # used for prog,scan pass
-	  fi
-	  continue
-	fi
-
-
-	if test prog = "$linkmode" && test link != "$pass"; then
-	  func_append newlib_search_path " $ladir"
-	  deplibs="$lib $deplibs"
-
-	  linkalldeplibs=false
-	  if test no != "$link_all_deplibs" || test -z "$library_names" ||
-	     test no = "$build_libtool_libs"; then
-	    linkalldeplibs=:
-	  fi
-
-	  tmp_libs=
-	  for deplib in $dependency_libs; do
-	    case $deplib in
-	    -L*) func_stripname '-L' '' "$deplib"
-	         func_resolve_sysroot "$func_stripname_result"
-	         func_append newlib_search_path " $func_resolve_sysroot_result"
-		 ;;
-	    esac
-	    # Need to link against all dependency_libs?
-	    if $linkalldeplibs; then
-	      deplibs="$deplib $deplibs"
-	    else
-	      # Need to hardcode shared library paths
-	      # or/and link against static libraries
-	      newdependency_libs="$deplib $newdependency_libs"
-	    fi
-	    if $opt_preserve_dup_deps; then
-	      case "$tmp_libs " in
-	      *" $deplib "*) func_append specialdeplibs " $deplib" ;;
-	      esac
-	    fi
-	    func_append tmp_libs " $deplib"
-	  done # for deplib
-	  continue
-	fi # $linkmode = prog...
-
-	if test prog,link = "$linkmode,$pass"; then
-	  if test -n "$library_names" &&
-	     { { test no = "$prefer_static_libs" ||
-	         test built,yes = "$prefer_static_libs,$installed"; } ||
-	       test -z "$old_library"; }; then
-	    # We need to hardcode the library path
-	    if test -n "$shlibpath_var" && test -z "$avoidtemprpath"; then
-	      # Make sure the rpath contains only unique directories.
-	      case $temp_rpath: in
-	      *"$absdir:"*) ;;
-	      *) func_append temp_rpath "$absdir:" ;;
-	      esac
-	    fi
-
-	    # Hardcode the library path.
-	    # Skip directories that are in the system default run-time
-	    # search path.
-	    case " $sys_lib_dlsearch_path " in
-	    *" $absdir "*) ;;
-	    *)
-	      case "$compile_rpath " in
-	      *" $absdir "*) ;;
-	      *) func_append compile_rpath " $absdir" ;;
-	      esac
-	      ;;
-	    esac
-	    case " $sys_lib_dlsearch_path " in
-	    *" $libdir "*) ;;
-	    *)
-	      case "$finalize_rpath " in
-	      *" $libdir "*) ;;
-	      *) func_append finalize_rpath " $libdir" ;;
-	      esac
-	      ;;
-	    esac
-	  fi # $linkmode,$pass = prog,link...
-
-	  if $alldeplibs &&
-	     { test pass_all = "$deplibs_check_method" ||
-	       { test yes = "$build_libtool_libs" &&
-		 test -n "$library_names"; }; }; then
-	    # We only need to search for static libraries
-	    continue
-	  fi
-	fi
-
-	link_static=no # Whether the deplib will be linked statically
-	use_static_libs=$prefer_static_libs
-	if test built = "$use_static_libs" && test yes = "$installed"; then
-	  use_static_libs=no
-	fi
-	if test -n "$library_names" &&
-	   { test no = "$use_static_libs" || test -z "$old_library"; }; then
-	  case $host in
-	  *cygwin* | *mingw* | *cegcc* | *os2*)
-	      # No point in relinking DLLs because paths are not encoded
-	      func_append notinst_deplibs " $lib"
-	      need_relink=no
-	    ;;
-	  *)
-	    if test no = "$installed"; then
-	      func_append notinst_deplibs " $lib"
-	      need_relink=yes
-	    fi
-	    ;;
-	  esac
-	  # This is a shared library
-
-	  # Warn about portability, can't link against -module's on some
-	  # systems (darwin).  Don't bleat about dlopened modules though!
-	  dlopenmodule=
-	  for dlpremoduletest in $dlprefiles; do
-	    if test "X$dlpremoduletest" = "X$lib"; then
-	      dlopenmodule=$dlpremoduletest
-	      break
-	    fi
-	  done
-	  if test -z "$dlopenmodule" && test yes = "$shouldnotlink" && test link = "$pass"; then
-	    echo
-	    if test prog = "$linkmode"; then
-	      $ECHO "*** Warning: Linking the executable $output against the loadable module"
-	    else
-	      $ECHO "*** Warning: Linking the shared library $output against the loadable module"
-	    fi
-	    $ECHO "*** $linklib is not portable!"
-	  fi
-	  if test lib = "$linkmode" &&
-	     test yes = "$hardcode_into_libs"; then
-	    # Hardcode the library path.
-	    # Skip directories that are in the system default run-time
-	    # search path.
-	    case " $sys_lib_dlsearch_path " in
-	    *" $absdir "*) ;;
-	    *)
-	      case "$compile_rpath " in
-	      *" $absdir "*) ;;
-	      *) func_append compile_rpath " $absdir" ;;
-	      esac
-	      ;;
-	    esac
-	    case " $sys_lib_dlsearch_path " in
-	    *" $libdir "*) ;;
-	    *)
-	      case "$finalize_rpath " in
-	      *" $libdir "*) ;;
-	      *) func_append finalize_rpath " $libdir" ;;
-	      esac
-	      ;;
-	    esac
-	  fi
-
-	  if test -n "$old_archive_from_expsyms_cmds"; then
-	    # figure out the soname
-	    set dummy $library_names
-	    shift
-	    realname=$1
-	    shift
-	    libname=`eval "\\$ECHO \"$libname_spec\""`
-	    # use dlname if we got it. it's perfectly good, no?
-	    if test -n "$dlname"; then
-	      soname=$dlname
-	    elif test -n "$soname_spec"; then
-	      # bleh windows
-	      case $host in
-	      *cygwin* | mingw* | *cegcc* | *os2*)
-	        func_arith $current - $age
-		major=$func_arith_result
-		versuffix=-$major
-		;;
-	      esac
-	      eval soname=\"$soname_spec\"
-	    else
-	      soname=$realname
-	    fi
-
-	    # Make a new name for the extract_expsyms_cmds to use
-	    soroot=$soname
-	    func_basename "$soroot"
-	    soname=$func_basename_result
-	    func_stripname 'lib' '.dll' "$soname"
-	    newlib=libimp-$func_stripname_result.a
-
-	    # If the library has no export list, then create one now
-	    if test -f "$output_objdir/$soname-def"; then :
-	    else
-	      func_verbose "extracting exported symbol list from '$soname'"
-	      func_execute_cmds "$extract_expsyms_cmds" 'exit $?'
-	    fi
-
-	    # Create $newlib
-	    if test -f "$output_objdir/$newlib"; then :; else
-	      func_verbose "generating import library for '$soname'"
-	      func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?'
-	    fi
-	    # make sure the library variables are pointing to the new library
-	    dir=$output_objdir
-	    linklib=$newlib
-	  fi # test -n "$old_archive_from_expsyms_cmds"
-
-	  if test prog = "$linkmode" || test relink != "$opt_mode"; then
-	    add_shlibpath=
-	    add_dir=
-	    add=
-	    lib_linked=yes
-	    case $hardcode_action in
-	    immediate | unsupported)
-	      if test no = "$hardcode_direct"; then
-		add=$dir/$linklib
-		case $host in
-		  *-*-sco3.2v5.0.[024]*) add_dir=-L$dir ;;
-		  *-*-sysv4*uw2*) add_dir=-L$dir ;;
-		  *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
-		    *-*-unixware7*) add_dir=-L$dir ;;
-		  *-*-darwin* )
-		    # if the lib is a (non-dlopened) module then we cannot
-		    # link against it, someone is ignoring the earlier warnings
-		    if /usr/bin/file -L $add 2> /dev/null |
-			 $GREP ": [^:]* bundle" >/dev/null; then
-		      if test "X$dlopenmodule" != "X$lib"; then
-			$ECHO "*** Warning: lib $linklib is a module, not a shared library"
-			if test -z "$old_library"; then
-			  echo
-			  echo "*** And there doesn't seem to be a static archive available"
-			  echo "*** The link will probably fail, sorry"
-			else
-			  add=$dir/$old_library
-			fi
-		      elif test -n "$old_library"; then
-			add=$dir/$old_library
-		      fi
-		    fi
-		esac
-	      elif test no = "$hardcode_minus_L"; then
-		case $host in
-		*-*-sunos*) add_shlibpath=$dir ;;
-		esac
-		add_dir=-L$dir
-		add=-l$name
-	      elif test no = "$hardcode_shlibpath_var"; then
-		add_shlibpath=$dir
-		add=-l$name
-	      else
-		lib_linked=no
-	      fi
-	      ;;
-	    relink)
-	      if test yes = "$hardcode_direct" &&
-	         test no = "$hardcode_direct_absolute"; then
-		add=$dir/$linklib
-	      elif test yes = "$hardcode_minus_L"; then
-		add_dir=-L$absdir
-		# Try looking first in the location we're being installed to.
-		if test -n "$inst_prefix_dir"; then
-		  case $libdir in
-		    [\\/]*)
-		      func_append add_dir " -L$inst_prefix_dir$libdir"
-		      ;;
-		  esac
-		fi
-		add=-l$name
-	      elif test yes = "$hardcode_shlibpath_var"; then
-		add_shlibpath=$dir
-		add=-l$name
-	      else
-		lib_linked=no
-	      fi
-	      ;;
-	    *) lib_linked=no ;;
-	    esac
-
-	    if test yes != "$lib_linked"; then
-	      func_fatal_configuration "unsupported hardcode properties"
-	    fi
-
-	    if test -n "$add_shlibpath"; then
-	      case :$compile_shlibpath: in
-	      *":$add_shlibpath:"*) ;;
-	      *) func_append compile_shlibpath "$add_shlibpath:" ;;
-	      esac
-	    fi
-	    if test prog = "$linkmode"; then
-	      test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
-	      test -n "$add" && compile_deplibs="$add $compile_deplibs"
-	    else
-	      test -n "$add_dir" && deplibs="$add_dir $deplibs"
-	      test -n "$add" && deplibs="$add $deplibs"
-	      if test yes != "$hardcode_direct" &&
-		 test yes != "$hardcode_minus_L" &&
-		 test yes = "$hardcode_shlibpath_var"; then
-		case :$finalize_shlibpath: in
-		*":$libdir:"*) ;;
-		*) func_append finalize_shlibpath "$libdir:" ;;
-		esac
-	      fi
-	    fi
-	  fi
-
-	  if test prog = "$linkmode" || test relink = "$opt_mode"; then
-	    add_shlibpath=
-	    add_dir=
-	    add=
-	    # Finalize command for both is simple: just hardcode it.
-	    if test yes = "$hardcode_direct" &&
-	       test no = "$hardcode_direct_absolute"; then
-	      add=$libdir/$linklib
-	    elif test yes = "$hardcode_minus_L"; then
-	      add_dir=-L$libdir
-	      add=-l$name
-	    elif test yes = "$hardcode_shlibpath_var"; then
-	      case :$finalize_shlibpath: in
-	      *":$libdir:"*) ;;
-	      *) func_append finalize_shlibpath "$libdir:" ;;
-	      esac
-	      add=-l$name
-	    elif test yes = "$hardcode_automatic"; then
-	      if test -n "$inst_prefix_dir" &&
-		 test -f "$inst_prefix_dir$libdir/$linklib"; then
-		add=$inst_prefix_dir$libdir/$linklib
-	      else
-		add=$libdir/$linklib
-	      fi
-	    else
-	      # We cannot seem to hardcode it, guess we'll fake it.
-	      add_dir=-L$libdir
-	      # Try looking first in the location we're being installed to.
-	      if test -n "$inst_prefix_dir"; then
-		case $libdir in
-		  [\\/]*)
-		    func_append add_dir " -L$inst_prefix_dir$libdir"
-		    ;;
-		esac
-	      fi
-	      add=-l$name
-	    fi
-
-	    if test prog = "$linkmode"; then
-	      test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
-	      test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
-	    else
-	      test -n "$add_dir" && deplibs="$add_dir $deplibs"
-	      test -n "$add" && deplibs="$add $deplibs"
-	    fi
-	  fi
-	elif test prog = "$linkmode"; then
-	  # Here we assume that one of hardcode_direct or hardcode_minus_L
-	  # is not unsupported.  This is valid on all known static and
-	  # shared platforms.
-	  if test unsupported != "$hardcode_direct"; then
-	    test -n "$old_library" && linklib=$old_library
-	    compile_deplibs="$dir/$linklib $compile_deplibs"
-	    finalize_deplibs="$dir/$linklib $finalize_deplibs"
-	  else
-	    compile_deplibs="-l$name -L$dir $compile_deplibs"
-	    finalize_deplibs="-l$name -L$dir $finalize_deplibs"
-	  fi
-	elif test yes = "$build_libtool_libs"; then
-	  # Not a shared library
-	  if test pass_all != "$deplibs_check_method"; then
-	    # We're trying link a shared library against a static one
-	    # but the system doesn't support it.
-
-	    # Just print a warning and add the library to dependency_libs so
-	    # that the program can be linked against the static library.
-	    echo
-	    $ECHO "*** Warning: This system cannot link to static lib archive $lib."
-	    echo "*** I have the capability to make that library automatically link in when"
-	    echo "*** you link to this library.  But I can only do this if you have a"
-	    echo "*** shared version of the library, which you do not appear to have."
-	    if test yes = "$module"; then
-	      echo "*** But as you try to build a module library, libtool will still create "
-	      echo "*** a static module, that should work as long as the dlopening application"
-	      echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
-	      if test -z "$global_symbol_pipe"; then
-		echo
-		echo "*** However, this would only work if libtool was able to extract symbol"
-		echo "*** lists from a program, using 'nm' or equivalent, but libtool could"
-		echo "*** not find such a program.  So, this module is probably useless."
-		echo "*** 'nm' from GNU binutils and a full rebuild may help."
-	      fi
-	      if test no = "$build_old_libs"; then
-		build_libtool_libs=module
-		build_old_libs=yes
-	      else
-		build_libtool_libs=no
-	      fi
-	    fi
-	  else
-	    deplibs="$dir/$old_library $deplibs"
-	    link_static=yes
-	  fi
-	fi # link shared/static library?
-
-	if test lib = "$linkmode"; then
-	  if test -n "$dependency_libs" &&
-	     { test yes != "$hardcode_into_libs" ||
-	       test yes = "$build_old_libs" ||
-	       test yes = "$link_static"; }; then
-	    # Extract -R from dependency_libs
-	    temp_deplibs=
-	    for libdir in $dependency_libs; do
-	      case $libdir in
-	      -R*) func_stripname '-R' '' "$libdir"
-	           temp_xrpath=$func_stripname_result
-		   case " $xrpath " in
-		   *" $temp_xrpath "*) ;;
-		   *) func_append xrpath " $temp_xrpath";;
-		   esac;;
-	      *) func_append temp_deplibs " $libdir";;
-	      esac
-	    done
-	    dependency_libs=$temp_deplibs
-	  fi
-
-	  func_append newlib_search_path " $absdir"
-	  # Link against this library
-	  test no = "$link_static" && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
-	  # ... and its dependency_libs
-	  tmp_libs=
-	  for deplib in $dependency_libs; do
-	    newdependency_libs="$deplib $newdependency_libs"
-	    case $deplib in
-              -L*) func_stripname '-L' '' "$deplib"
-                   func_resolve_sysroot "$func_stripname_result";;
-              *) func_resolve_sysroot "$deplib" ;;
-            esac
-	    if $opt_preserve_dup_deps; then
-	      case "$tmp_libs " in
-	      *" $func_resolve_sysroot_result "*)
-                func_append specialdeplibs " $func_resolve_sysroot_result" ;;
-	      esac
-	    fi
-	    func_append tmp_libs " $func_resolve_sysroot_result"
-	  done
-
-	  if test no != "$link_all_deplibs"; then
-	    # Add the search paths of all dependency libraries
-	    for deplib in $dependency_libs; do
-	      path=
-	      case $deplib in
-	      -L*) path=$deplib ;;
-	      *.la)
-	        func_resolve_sysroot "$deplib"
-	        deplib=$func_resolve_sysroot_result
-	        func_dirname "$deplib" "" "."
-		dir=$func_dirname_result
-		# We need an absolute path.
-		case $dir in
-		[\\/]* | [A-Za-z]:[\\/]*) absdir=$dir ;;
-		*)
-		  absdir=`cd "$dir" && pwd`
-		  if test -z "$absdir"; then
-		    func_warning "cannot determine absolute directory name of '$dir'"
-		    absdir=$dir
-		  fi
-		  ;;
-		esac
-		if $GREP "^installed=no" $deplib > /dev/null; then
-		case $host in
-		*-*-darwin*)
-		  depdepl=
-		  eval deplibrary_names=`$SED -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
-		  if test -n "$deplibrary_names"; then
-		    for tmp in $deplibrary_names; do
-		      depdepl=$tmp
-		    done
-		    if test -f "$absdir/$objdir/$depdepl"; then
-		      depdepl=$absdir/$objdir/$depdepl
-		      darwin_install_name=`$OTOOL -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
-                      if test -z "$darwin_install_name"; then
-                          darwin_install_name=`$OTOOL64 -L $depdepl  | awk '{if (NR == 2) {print $1;exit}}'`
-                      fi
-		      func_append compiler_flags " $wl-dylib_file $wl$darwin_install_name:$depdepl"
-		      func_append linker_flags " -dylib_file $darwin_install_name:$depdepl"
-		      path=
-		    fi
-		  fi
-		  ;;
-		*)
-		  path=-L$absdir/$objdir
-		  ;;
-		esac
-		else
-		  eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
-		  test -z "$libdir" && \
-		    func_fatal_error "'$deplib' is not a valid libtool archive"
-		  test "$absdir" != "$libdir" && \
-		    func_warning "'$deplib' seems to be moved"
-
-		  path=-L$absdir
-		fi
-		;;
-	      esac
-	      case " $deplibs " in
-	      *" $path "*) ;;
-	      *) deplibs="$path $deplibs" ;;
-	      esac
-	    done
-	  fi # link_all_deplibs != no
-	fi # linkmode = lib
-      done # for deplib in $libs
-      if test link = "$pass"; then
-	if test prog = "$linkmode"; then
-	  compile_deplibs="$new_inherited_linker_flags $compile_deplibs"
-	  finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs"
-	else
-	  compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
-	fi
-      fi
-      dependency_libs=$newdependency_libs
-      if test dlpreopen = "$pass"; then
-	# Link the dlpreopened libraries before other libraries
-	for deplib in $save_deplibs; do
-	  deplibs="$deplib $deplibs"
-	done
-      fi
-      if test dlopen != "$pass"; then
-	test conv = "$pass" || {
-	  # Make sure lib_search_path contains only unique directories.
-	  lib_search_path=
-	  for dir in $newlib_search_path; do
-	    case "$lib_search_path " in
-	    *" $dir "*) ;;
-	    *) func_append lib_search_path " $dir" ;;
-	    esac
-	  done
-	  newlib_search_path=
-	}
-
-	if test prog,link = "$linkmode,$pass"; then
-	  vars="compile_deplibs finalize_deplibs"
-	else
-	  vars=deplibs
-	fi
-	for var in $vars dependency_libs; do
-	  # Add libraries to $var in reverse order
-	  eval tmp_libs=\"\$$var\"
-	  new_libs=
-	  for deplib in $tmp_libs; do
-	    # FIXME: Pedantically, this is the right thing to do, so
-	    #        that some nasty dependency loop isn't accidentally
-	    #        broken:
-	    #new_libs="$deplib $new_libs"
-	    # Pragmatically, this seems to cause very few problems in
-	    # practice:
-	    case $deplib in
-	    -L*) new_libs="$deplib $new_libs" ;;
-	    -R*) ;;
-	    *)
-	      # And here is the reason: when a library appears more
-	      # than once as an explicit dependence of a library, or
-	      # is implicitly linked in more than once by the
-	      # compiler, it is considered special, and multiple
-	      # occurrences thereof are not removed.  Compare this
-	      # with having the same library being listed as a
-	      # dependency of multiple other libraries: in this case,
-	      # we know (pedantically, we assume) the library does not
-	      # need to be listed more than once, so we keep only the
-	      # last copy.  This is not always right, but it is rare
-	      # enough that we require users that really mean to play
-	      # such unportable linking tricks to link the library
-	      # using -Wl,-lname, so that libtool does not consider it
-	      # for duplicate removal.
-	      case " $specialdeplibs " in
-	      *" $deplib "*) new_libs="$deplib $new_libs" ;;
-	      *)
-		case " $new_libs " in
-		*" $deplib "*) ;;
-		*) new_libs="$deplib $new_libs" ;;
-		esac
-		;;
-	      esac
-	      ;;
-	    esac
-	  done
-	  tmp_libs=
-	  for deplib in $new_libs; do
-	    case $deplib in
-	    -L*)
-	      case " $tmp_libs " in
-	      *" $deplib "*) ;;
-	      *) func_append tmp_libs " $deplib" ;;
-	      esac
-	      ;;
-	    *) func_append tmp_libs " $deplib" ;;
-	    esac
-	  done
-	  eval $var=\"$tmp_libs\"
-	done # for var
-      fi
-
-      # Add Sun CC postdeps if required:
-      test CXX = "$tagname" && {
-        case $host_os in
-        linux*)
-          case `$CC -V 2>&1 | sed 5q` in
-          *Sun\ C*) # Sun C++ 5.9
-            func_suncc_cstd_abi
-
-            if test no != "$suncc_use_cstd_abi"; then
-              func_append postdeps ' -library=Cstd -library=Crun'
-            fi
-            ;;
-          esac
-          ;;
-
-        solaris*)
-          func_cc_basename "$CC"
-          case $func_cc_basename_result in
-          CC* | sunCC*)
-            func_suncc_cstd_abi
-
-            if test no != "$suncc_use_cstd_abi"; then
-              func_append postdeps ' -library=Cstd -library=Crun'
-            fi
-            ;;
-          esac
-          ;;
-        esac
-      }
-
-      # Last step: remove runtime libs from dependency_libs
-      # (they stay in deplibs)
-      tmp_libs=
-      for i in $dependency_libs; do
-	case " $predeps $postdeps $compiler_lib_search_path " in
-	*" $i "*)
-	  i=
-	  ;;
-	esac
-	if test -n "$i"; then
-	  func_append tmp_libs " $i"
-	fi
-      done
-      dependency_libs=$tmp_libs
-    done # for pass
-    if test prog = "$linkmode"; then
-      dlfiles=$newdlfiles
-    fi
-    if test prog = "$linkmode" || test lib = "$linkmode"; then
-      dlprefiles=$newdlprefiles
-    fi
-
-    case $linkmode in
-    oldlib)
-      if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then
-	func_warning "'-dlopen' is ignored for archives"
-      fi
-
-      case " $deplibs" in
-      *\ -l* | *\ -L*)
-	func_warning "'-l' and '-L' are ignored for archives" ;;
-      esac
-
-      test -n "$rpath" && \
-	func_warning "'-rpath' is ignored for archives"
-
-      test -n "$xrpath" && \
-	func_warning "'-R' is ignored for archives"
-
-      test -n "$vinfo" && \
-	func_warning "'-version-info/-version-number' is ignored for archives"
-
-      test -n "$release" && \
-	func_warning "'-release' is ignored for archives"
-
-      test -n "$export_symbols$export_symbols_regex" && \
-	func_warning "'-export-symbols' is ignored for archives"
-
-      # Now set the variables for building old libraries.
-      build_libtool_libs=no
-      oldlibs=$output
-      func_append objs "$old_deplibs"
-      ;;
-
-    lib)
-      # Make sure we only generate libraries of the form 'libNAME.la'.
-      case $outputname in
-      lib*)
-	func_stripname 'lib' '.la' "$outputname"
-	name=$func_stripname_result
-	eval shared_ext=\"$shrext_cmds\"
-	eval libname=\"$libname_spec\"
-	;;
-      *)
-	test no = "$module" \
-	  && func_fatal_help "libtool library '$output' must begin with 'lib'"
-
-	if test no != "$need_lib_prefix"; then
-	  # Add the "lib" prefix for modules if required
-	  func_stripname '' '.la' "$outputname"
-	  name=$func_stripname_result
-	  eval shared_ext=\"$shrext_cmds\"
-	  eval libname=\"$libname_spec\"
-	else
-	  func_stripname '' '.la' "$outputname"
-	  libname=$func_stripname_result
-	fi
-	;;
-      esac
-
-      if test -n "$objs"; then
-	if test pass_all != "$deplibs_check_method"; then
-	  func_fatal_error "cannot build libtool library '$output' from non-libtool objects on this host:$objs"
-	else
-	  echo
-	  $ECHO "*** Warning: Linking the shared library $output against the non-libtool"
-	  $ECHO "*** objects $objs is not portable!"
-	  func_append libobjs " $objs"
-	fi
-      fi
-
-      test no = "$dlself" \
-	|| func_warning "'-dlopen self' is ignored for libtool libraries"
-
-      set dummy $rpath
-      shift
-      test 1 -lt "$#" \
-	&& func_warning "ignoring multiple '-rpath's for a libtool library"
-
-      install_libdir=$1
-
-      oldlibs=
-      if test -z "$rpath"; then
-	if test yes = "$build_libtool_libs"; then
-	  # Building a libtool convenience library.
-	  # Some compilers have problems with a '.al' extension so
-	  # convenience libraries should have the same extension an
-	  # archive normally would.
-	  oldlibs="$output_objdir/$libname.$libext $oldlibs"
-	  build_libtool_libs=convenience
-	  build_old_libs=yes
-	fi
-
-	test -n "$vinfo" && \
-	  func_warning "'-version-info/-version-number' is ignored for convenience libraries"
-
-	test -n "$release" && \
-	  func_warning "'-release' is ignored for convenience libraries"
-      else
-
-	# Parse the version information argument.
-	save_ifs=$IFS; IFS=:
-	set dummy $vinfo 0 0 0
-	shift
-	IFS=$save_ifs
-
-	test -n "$7" && \
-	  func_fatal_help "too many parameters to '-version-info'"
-
-	# convert absolute version numbers to libtool ages
-	# this retains compatibility with .la files and attempts
-	# to make the code below a bit more comprehensible
-
-	case $vinfo_number in
-	yes)
-	  number_major=$1
-	  number_minor=$2
-	  number_revision=$3
-	  #
-	  # There are really only two kinds -- those that
-	  # use the current revision as the major version
-	  # and those that subtract age and use age as
-	  # a minor version.  But, then there is irix
-	  # that has an extra 1 added just for fun
-	  #
-	  case $version_type in
-	  # correct linux to gnu/linux during the next big refactor
-	  darwin|freebsd-elf|linux|osf|windows|none)
-	    func_arith $number_major + $number_minor
-	    current=$func_arith_result
-	    age=$number_minor
-	    revision=$number_revision
-	    ;;
-	  freebsd-aout|qnx|sunos)
-	    current=$number_major
-	    revision=$number_minor
-	    age=0
-	    ;;
-	  irix|nonstopux)
-	    func_arith $number_major + $number_minor
-	    current=$func_arith_result
-	    age=$number_minor
-	    revision=$number_minor
-	    lt_irix_increment=no
-	    ;;
-	  esac
-	  ;;
-	no)
-	  current=$1
-	  revision=$2
-	  age=$3
-	  ;;
-	esac
-
-	# Check that each of the things are valid numbers.
-	case $current in
-	0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
-	*)
-	  func_error "CURRENT '$current' must be a nonnegative integer"
-	  func_fatal_error "'$vinfo' is not valid version information"
-	  ;;
-	esac
-
-	case $revision in
-	0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
-	*)
-	  func_error "REVISION '$revision' must be a nonnegative integer"
-	  func_fatal_error "'$vinfo' is not valid version information"
-	  ;;
-	esac
-
-	case $age in
-	0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
-	*)
-	  func_error "AGE '$age' must be a nonnegative integer"
-	  func_fatal_error "'$vinfo' is not valid version information"
-	  ;;
-	esac
-
-	if test "$age" -gt "$current"; then
-	  func_error "AGE '$age' is greater than the current interface number '$current'"
-	  func_fatal_error "'$vinfo' is not valid version information"
-	fi
-
-	# Calculate the version variables.
-	major=
-	versuffix=
-	verstring=
-	case $version_type in
-	none) ;;
-
-	darwin)
-	  # Like Linux, but with the current version available in
-	  # verstring for coding it into the library header
-	  func_arith $current - $age
-	  major=.$func_arith_result
-	  versuffix=$major.$age.$revision
-	  # Darwin ld doesn't like 0 for these options...
-	  func_arith $current + 1
-	  minor_current=$func_arith_result
-	  xlcverstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision"
-	  verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
-          # On Darwin other compilers
-          case $CC in
-              nagfor*)
-                  verstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision"
-                  ;;
-              *)
-                  verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
-                  ;;
-          esac
-	  ;;
-
-	freebsd-aout)
-	  major=.$current
-	  versuffix=.$current.$revision
-	  ;;
-
-	freebsd-elf)
-	  func_arith $current - $age
-	  major=.$func_arith_result
-	  versuffix=$major.$age.$revision
-	  ;;
-
-	irix | nonstopux)
-	  if test no = "$lt_irix_increment"; then
-	    func_arith $current - $age
-	  else
-	    func_arith $current - $age + 1
-	  fi
-	  major=$func_arith_result
-
-	  case $version_type in
-	    nonstopux) verstring_prefix=nonstopux ;;
-	    *)         verstring_prefix=sgi ;;
-	  esac
-	  verstring=$verstring_prefix$major.$revision
-
-	  # Add in all the interfaces that we are compatible with.
-	  loop=$revision
-	  while test 0 -ne "$loop"; do
-	    func_arith $revision - $loop
-	    iface=$func_arith_result
-	    func_arith $loop - 1
-	    loop=$func_arith_result
-	    verstring=$verstring_prefix$major.$iface:$verstring
-	  done
-
-	  # Before this point, $major must not contain '.'.
-	  major=.$major
-	  versuffix=$major.$revision
-	  ;;
-
-	linux) # correct to gnu/linux during the next big refactor
-	  func_arith $current - $age
-	  major=.$func_arith_result
-	  versuffix=$major.$age.$revision
-	  ;;
-
-	osf)
-	  func_arith $current - $age
-	  major=.$func_arith_result
-	  versuffix=.$current.$age.$revision
-	  verstring=$current.$age.$revision
-
-	  # Add in all the interfaces that we are compatible with.
-	  loop=$age
-	  while test 0 -ne "$loop"; do
-	    func_arith $current - $loop
-	    iface=$func_arith_result
-	    func_arith $loop - 1
-	    loop=$func_arith_result
-	    verstring=$verstring:$iface.0
-	  done
-
-	  # Make executables depend on our current version.
-	  func_append verstring ":$current.0"
-	  ;;
-
-	qnx)
-	  major=.$current
-	  versuffix=.$current
-	  ;;
-
-	sco)
-	  major=.$current
-	  versuffix=.$current
-	  ;;
-
-	sunos)
-	  major=.$current
-	  versuffix=.$current.$revision
-	  ;;
-
-	windows)
-	  # Use '-' rather than '.', since we only want one
-	  # extension on DOS 8.3 file systems.
-	  func_arith $current - $age
-	  major=$func_arith_result
-	  versuffix=-$major
-	  ;;
-
-	*)
-	  func_fatal_configuration "unknown library version type '$version_type'"
-	  ;;
-	esac
-
-	# Clear the version info if we defaulted, and they specified a release.
-	if test -z "$vinfo" && test -n "$release"; then
-	  major=
-	  case $version_type in
-	  darwin)
-	    # we can't check for "0.0" in archive_cmds due to quoting
-	    # problems, so we reset it completely
-	    verstring=
-	    ;;
-	  *)
-	    verstring=0.0
-	    ;;
-	  esac
-	  if test no = "$need_version"; then
-	    versuffix=
-	  else
-	    versuffix=.0.0
-	  fi
-	fi
-
-	# Remove version info from name if versioning should be avoided
-	if test yes,no = "$avoid_version,$need_version"; then
-	  major=
-	  versuffix=
-	  verstring=
-	fi
-
-	# Check to see if the archive will have undefined symbols.
-	if test yes = "$allow_undefined"; then
-	  if test unsupported = "$allow_undefined_flag"; then
-	    if test yes = "$build_old_libs"; then
-	      func_warning "undefined symbols not allowed in $host shared libraries; building static only"
-	      build_libtool_libs=no
-	    else
-	      func_fatal_error "can't build $host shared library unless -no-undefined is specified"
-	    fi
-	  fi
-	else
-	  # Don't allow undefined symbols.
-	  allow_undefined_flag=$no_undefined_flag
-	fi
-
-      fi
-
-      func_generate_dlsyms "$libname" "$libname" :
-      func_append libobjs " $symfileobj"
-      test " " = "$libobjs" && libobjs=
-
-      if test relink != "$opt_mode"; then
-	# Remove our outputs, but don't remove object files since they
-	# may have been created when compiling PIC objects.
-	removelist=
-	tempremovelist=`$ECHO "$output_objdir/*"`
-	for p in $tempremovelist; do
-	  case $p in
-	    *.$objext | *.gcno)
-	       ;;
-	    $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/$libname$release.*)
-	       if test -n "$precious_files_regex"; then
-		 if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
-		 then
-		   continue
-		 fi
-	       fi
-	       func_append removelist " $p"
-	       ;;
-	    *) ;;
-	  esac
-	done
-	test -n "$removelist" && \
-	  func_show_eval "${RM}r \$removelist"
-      fi
-
-      # Now set the variables for building old libraries.
-      if test yes = "$build_old_libs" && test convenience != "$build_libtool_libs"; then
-	func_append oldlibs " $output_objdir/$libname.$libext"
-
-	# Transform .lo files to .o files.
-	oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; $lo2o" | $NL2SP`
-      fi
-
-      # Eliminate all temporary directories.
-      #for path in $notinst_path; do
-      #	lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"`
-      #	deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"`
-      #	dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"`
-      #done
-
-      if test -n "$xrpath"; then
-	# If the user specified any rpath flags, then add them.
-	temp_xrpath=
-	for libdir in $xrpath; do
-	  func_replace_sysroot "$libdir"
-	  func_append temp_xrpath " -R$func_replace_sysroot_result"
-	  case "$finalize_rpath " in
-	  *" $libdir "*) ;;
-	  *) func_append finalize_rpath " $libdir" ;;
-	  esac
-	done
-	if test yes != "$hardcode_into_libs" || test yes = "$build_old_libs"; then
-	  dependency_libs="$temp_xrpath $dependency_libs"
-	fi
-      fi
-
-      # Make sure dlfiles contains only unique files that won't be dlpreopened
-      old_dlfiles=$dlfiles
-      dlfiles=
-      for lib in $old_dlfiles; do
-	case " $dlprefiles $dlfiles " in
-	*" $lib "*) ;;
-	*) func_append dlfiles " $lib" ;;
-	esac
-      done
-
-      # Make sure dlprefiles contains only unique files
-      old_dlprefiles=$dlprefiles
-      dlprefiles=
-      for lib in $old_dlprefiles; do
-	case "$dlprefiles " in
-	*" $lib "*) ;;
-	*) func_append dlprefiles " $lib" ;;
-	esac
-      done
-
-      if test yes = "$build_libtool_libs"; then
-	if test -n "$rpath"; then
-	  case $host in
-	  *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*)
-	    # these systems don't actually have a c library (as such)!
-	    ;;
-	  *-*-rhapsody* | *-*-darwin1.[012])
-	    # Rhapsody C library is in the System framework
-	    func_append deplibs " System.ltframework"
-	    ;;
-	  *-*-netbsd*)
-	    # Don't link with libc until the a.out ld.so is fixed.
-	    ;;
-	  *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
-	    # Do not include libc due to us having libc/libc_r.
-	    ;;
-	  *-*-sco3.2v5* | *-*-sco5v6*)
-	    # Causes problems with __ctype
-	    ;;
-	  *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
-	    # Compiler inserts libc in the correct place for threads to work
-	    ;;
-	  *)
-	    # Add libc to deplibs on all other systems if necessary.
-	    if test yes = "$build_libtool_need_lc"; then
-	      func_append deplibs " -lc"
-	    fi
-	    ;;
-	  esac
-	fi
-
-	# Transform deplibs into only deplibs that can be linked in shared.
-	name_save=$name
-	libname_save=$libname
-	release_save=$release
-	versuffix_save=$versuffix
-	major_save=$major
-	# I'm not sure if I'm treating the release correctly.  I think
-	# release should show up in the -l (ie -lgmp5) so we don't want to
-	# add it in twice.  Is that correct?
-	release=
-	versuffix=
-	major=
-	newdeplibs=
-	droppeddeps=no
-	case $deplibs_check_method in
-	pass_all)
-	  # Don't check for shared/static.  Everything works.
-	  # This might be a little naive.  We might want to check
-	  # whether the library exists or not.  But this is on
-	  # osf3 & osf4 and I'm not really sure... Just
-	  # implementing what was already the behavior.
-	  newdeplibs=$deplibs
-	  ;;
-	test_compile)
-	  # This code stresses the "libraries are programs" paradigm to its
-	  # limits. Maybe even breaks it.  We compile a program, linking it
-	  # against the deplibs as a proxy for the library.  Then we can check
-	  # whether they linked in statically or dynamically with ldd.
-	  $opt_dry_run || $RM conftest.c
-	  cat > conftest.c <<EOF
-	  int main() { return 0; }
-EOF
-	  $opt_dry_run || $RM conftest
-	  if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then
-	    ldd_output=`ldd conftest`
-	    for i in $deplibs; do
-	      case $i in
-	      -l*)
-		func_stripname -l '' "$i"
-		name=$func_stripname_result
-		if test yes = "$allow_libtool_libs_with_static_runtimes"; then
-		  case " $predeps $postdeps " in
-		  *" $i "*)
-		    func_append newdeplibs " $i"
-		    i=
-		    ;;
-		  esac
-		fi
-		if test -n "$i"; then
-		  libname=`eval "\\$ECHO \"$libname_spec\""`
-		  deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
-		  set dummy $deplib_matches; shift
-		  deplib_match=$1
-		  if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0; then
-		    func_append newdeplibs " $i"
-		  else
-		    droppeddeps=yes
-		    echo
-		    $ECHO "*** Warning: dynamic linker does not accept needed library $i."
-		    echo "*** I have the capability to make that library automatically link in when"
-		    echo "*** you link to this library.  But I can only do this if you have a"
-		    echo "*** shared version of the library, which I believe you do not have"
-		    echo "*** because a test_compile did reveal that the linker did not use it for"
-		    echo "*** its dynamic dependency list that programs get resolved with at runtime."
-		  fi
-		fi
-		;;
-	      *)
-		func_append newdeplibs " $i"
-		;;
-	      esac
-	    done
-	  else
-	    # Error occurred in the first compile.  Let's try to salvage
-	    # the situation: Compile a separate program for each library.
-	    for i in $deplibs; do
-	      case $i in
-	      -l*)
-		func_stripname -l '' "$i"
-		name=$func_stripname_result
-		$opt_dry_run || $RM conftest
-		if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
-		  ldd_output=`ldd conftest`
-		  if test yes = "$allow_libtool_libs_with_static_runtimes"; then
-		    case " $predeps $postdeps " in
-		    *" $i "*)
-		      func_append newdeplibs " $i"
-		      i=
-		      ;;
-		    esac
-		  fi
-		  if test -n "$i"; then
-		    libname=`eval "\\$ECHO \"$libname_spec\""`
-		    deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
-		    set dummy $deplib_matches; shift
-		    deplib_match=$1
-		    if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0; then
-		      func_append newdeplibs " $i"
-		    else
-		      droppeddeps=yes
-		      echo
-		      $ECHO "*** Warning: dynamic linker does not accept needed library $i."
-		      echo "*** I have the capability to make that library automatically link in when"
-		      echo "*** you link to this library.  But I can only do this if you have a"
-		      echo "*** shared version of the library, which you do not appear to have"
-		      echo "*** because a test_compile did reveal that the linker did not use this one"
-		      echo "*** as a dynamic dependency that programs can get resolved with at runtime."
-		    fi
-		  fi
-		else
-		  droppeddeps=yes
-		  echo
-		  $ECHO "*** Warning!  Library $i is needed by this library but I was not able to"
-		  echo "*** make it link in!  You will probably need to install it or some"
-		  echo "*** library that it depends on before this library will be fully"
-		  echo "*** functional.  Installing it before continuing would be even better."
-		fi
-		;;
-	      *)
-		func_append newdeplibs " $i"
-		;;
-	      esac
-	    done
-	  fi
-	  ;;
-	file_magic*)
-	  set dummy $deplibs_check_method; shift
-	  file_magic_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
-	  for a_deplib in $deplibs; do
-	    case $a_deplib in
-	    -l*)
-	      func_stripname -l '' "$a_deplib"
-	      name=$func_stripname_result
-	      if test yes = "$allow_libtool_libs_with_static_runtimes"; then
-		case " $predeps $postdeps " in
-		*" $a_deplib "*)
-		  func_append newdeplibs " $a_deplib"
-		  a_deplib=
-		  ;;
-		esac
-	      fi
-	      if test -n "$a_deplib"; then
-		libname=`eval "\\$ECHO \"$libname_spec\""`
-		if test -n "$file_magic_glob"; then
-		  libnameglob=`func_echo_all "$libname" | $SED -e $file_magic_glob`
-		else
-		  libnameglob=$libname
-		fi
-		test yes = "$want_nocaseglob" && nocaseglob=`shopt -p nocaseglob`
-		for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
-		  if test yes = "$want_nocaseglob"; then
-		    shopt -s nocaseglob
-		    potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
-		    $nocaseglob
-		  else
-		    potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
-		  fi
-		  for potent_lib in $potential_libs; do
-		      # Follow soft links.
-		      if ls -lLd "$potent_lib" 2>/dev/null |
-			 $GREP " -> " >/dev/null; then
-			continue
-		      fi
-		      # The statement above tries to avoid entering an
-		      # endless loop below, in case of cyclic links.
-		      # We might still enter an endless loop, since a link
-		      # loop can be closed while we follow links,
-		      # but so what?
-		      potlib=$potent_lib
-		      while test -h "$potlib" 2>/dev/null; do
-			potliblink=`ls -ld $potlib | $SED 's/.* -> //'`
-			case $potliblink in
-			[\\/]* | [A-Za-z]:[\\/]*) potlib=$potliblink;;
-			*) potlib=`$ECHO "$potlib" | $SED 's|[^/]*$||'`"$potliblink";;
-			esac
-		      done
-		      if eval $file_magic_cmd \"\$potlib\" 2>/dev/null |
-			 $SED -e 10q |
-			 $EGREP "$file_magic_regex" > /dev/null; then
-			func_append newdeplibs " $a_deplib"
-			a_deplib=
-			break 2
-		      fi
-		  done
-		done
-	      fi
-	      if test -n "$a_deplib"; then
-		droppeddeps=yes
-		echo
-		$ECHO "*** Warning: linker path does not have real file for library $a_deplib."
-		echo "*** I have the capability to make that library automatically link in when"
-		echo "*** you link to this library.  But I can only do this if you have a"
-		echo "*** shared version of the library, which you do not appear to have"
-		echo "*** because I did check the linker path looking for a file starting"
-		if test -z "$potlib"; then
-		  $ECHO "*** with $libname but no candidates were found. (...for file magic test)"
-		else
-		  $ECHO "*** with $libname and none of the candidates passed a file format test"
-		  $ECHO "*** using a file magic. Last file checked: $potlib"
-		fi
-	      fi
-	      ;;
-	    *)
-	      # Add a -L argument.
-	      func_append newdeplibs " $a_deplib"
-	      ;;
-	    esac
-	  done # Gone through all deplibs.
-	  ;;
-	match_pattern*)
-	  set dummy $deplibs_check_method; shift
-	  match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
-	  for a_deplib in $deplibs; do
-	    case $a_deplib in
-	    -l*)
-	      func_stripname -l '' "$a_deplib"
-	      name=$func_stripname_result
-	      if test yes = "$allow_libtool_libs_with_static_runtimes"; then
-		case " $predeps $postdeps " in
-		*" $a_deplib "*)
-		  func_append newdeplibs " $a_deplib"
-		  a_deplib=
-		  ;;
-		esac
-	      fi
-	      if test -n "$a_deplib"; then
-		libname=`eval "\\$ECHO \"$libname_spec\""`
-		for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
-		  potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
-		  for potent_lib in $potential_libs; do
-		    potlib=$potent_lib # see symlink-check above in file_magic test
-		    if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \
-		       $EGREP "$match_pattern_regex" > /dev/null; then
-		      func_append newdeplibs " $a_deplib"
-		      a_deplib=
-		      break 2
-		    fi
-		  done
-		done
-	      fi
-	      if test -n "$a_deplib"; then
-		droppeddeps=yes
-		echo
-		$ECHO "*** Warning: linker path does not have real file for library $a_deplib."
-		echo "*** I have the capability to make that library automatically link in when"
-		echo "*** you link to this library.  But I can only do this if you have a"
-		echo "*** shared version of the library, which you do not appear to have"
-		echo "*** because I did check the linker path looking for a file starting"
-		if test -z "$potlib"; then
-		  $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)"
-		else
-		  $ECHO "*** with $libname and none of the candidates passed a file format test"
-		  $ECHO "*** using a regex pattern. Last file checked: $potlib"
-		fi
-	      fi
-	      ;;
-	    *)
-	      # Add a -L argument.
-	      func_append newdeplibs " $a_deplib"
-	      ;;
-	    esac
-	  done # Gone through all deplibs.
-	  ;;
-	none | unknown | *)
-	  newdeplibs=
-	  tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'`
-	  if test yes = "$allow_libtool_libs_with_static_runtimes"; then
-	    for i in $predeps $postdeps; do
-	      # can't use Xsed below, because $i might contain '/'
-	      tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s|$i||"`
-	    done
-	  fi
-	  case $tmp_deplibs in
-	  *[!\	\ ]*)
-	    echo
-	    if test none = "$deplibs_check_method"; then
-	      echo "*** Warning: inter-library dependencies are not supported in this platform."
-	    else
-	      echo "*** Warning: inter-library dependencies are not known to be supported."
-	    fi
-	    echo "*** All declared inter-library dependencies are being dropped."
-	    droppeddeps=yes
-	    ;;
-	  esac
-	  ;;
-	esac
-	versuffix=$versuffix_save
-	major=$major_save
-	release=$release_save
-	libname=$libname_save
-	name=$name_save
-
-	case $host in
-	*-*-rhapsody* | *-*-darwin1.[012])
-	  # On Rhapsody replace the C library with the System framework
-	  newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'`
-	  ;;
-	esac
-
-	if test yes = "$droppeddeps"; then
-	  if test yes = "$module"; then
-	    echo
-	    echo "*** Warning: libtool could not satisfy all declared inter-library"
-	    $ECHO "*** dependencies of module $libname.  Therefore, libtool will create"
-	    echo "*** a static module, that should work as long as the dlopening"
-	    echo "*** application is linked with the -dlopen flag."
-	    if test -z "$global_symbol_pipe"; then
-	      echo
-	      echo "*** However, this would only work if libtool was able to extract symbol"
-	      echo "*** lists from a program, using 'nm' or equivalent, but libtool could"
-	      echo "*** not find such a program.  So, this module is probably useless."
-	      echo "*** 'nm' from GNU binutils and a full rebuild may help."
-	    fi
-	    if test no = "$build_old_libs"; then
-	      oldlibs=$output_objdir/$libname.$libext
-	      build_libtool_libs=module
-	      build_old_libs=yes
-	    else
-	      build_libtool_libs=no
-	    fi
-	  else
-	    echo "*** The inter-library dependencies that have been dropped here will be"
-	    echo "*** automatically added whenever a program is linked with this library"
-	    echo "*** or is declared to -dlopen it."
-
-	    if test no = "$allow_undefined"; then
-	      echo
-	      echo "*** Since this library must not contain undefined symbols,"
-	      echo "*** because either the platform does not support them or"
-	      echo "*** it was explicitly requested with -no-undefined,"
-	      echo "*** libtool will only create a static version of it."
-	      if test no = "$build_old_libs"; then
-		oldlibs=$output_objdir/$libname.$libext
-		build_libtool_libs=module
-		build_old_libs=yes
-	      else
-		build_libtool_libs=no
-	      fi
-	    fi
-	  fi
-	fi
-	# Done checking deplibs!
-	deplibs=$newdeplibs
-      fi
-      # Time to change all our "foo.ltframework" stuff back to "-framework foo"
-      case $host in
-	*-*-darwin*)
-	  newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
-	  new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
-	  deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
-	  ;;
-      esac
-
-      # move library search paths that coincide with paths to not yet
-      # installed libraries to the beginning of the library search list
-      new_libs=
-      for path in $notinst_path; do
-	case " $new_libs " in
-	*" -L$path/$objdir "*) ;;
-	*)
-	  case " $deplibs " in
-	  *" -L$path/$objdir "*)
-	    func_append new_libs " -L$path/$objdir" ;;
-	  esac
-	  ;;
-	esac
-      done
-      for deplib in $deplibs; do
-	case $deplib in
-	-L*)
-	  case " $new_libs " in
-	  *" $deplib "*) ;;
-	  *) func_append new_libs " $deplib" ;;
-	  esac
-	  ;;
-	*) func_append new_libs " $deplib" ;;
-	esac
-      done
-      deplibs=$new_libs
-
-      # All the library-specific variables (install_libdir is set above).
-      library_names=
-      old_library=
-      dlname=
-
-      # Test again, we may have decided not to build it any more
-      if test yes = "$build_libtool_libs"; then
-	# Remove $wl instances when linking with ld.
-	# FIXME: should test the right _cmds variable.
-	case $archive_cmds in
-	  *\$LD\ *) wl= ;;
-        esac
-	if test yes = "$hardcode_into_libs"; then
-	  # Hardcode the library paths
-	  hardcode_libdirs=
-	  dep_rpath=
-	  rpath=$finalize_rpath
-	  test relink = "$opt_mode" || rpath=$compile_rpath$rpath
-	  for libdir in $rpath; do
-	    if test -n "$hardcode_libdir_flag_spec"; then
-	      if test -n "$hardcode_libdir_separator"; then
-		func_replace_sysroot "$libdir"
-		libdir=$func_replace_sysroot_result
-		if test -z "$hardcode_libdirs"; then
-		  hardcode_libdirs=$libdir
-		else
-		  # Just accumulate the unique libdirs.
-		  case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
-		  *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
-		    ;;
-		  *)
-		    func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
-		    ;;
-		  esac
-		fi
-	      else
-		eval flag=\"$hardcode_libdir_flag_spec\"
-		func_append dep_rpath " $flag"
-	      fi
-	    elif test -n "$runpath_var"; then
-	      case "$perm_rpath " in
-	      *" $libdir "*) ;;
-	      *) func_append perm_rpath " $libdir" ;;
-	      esac
-	    fi
-	  done
-	  # Substitute the hardcoded libdirs into the rpath.
-	  if test -n "$hardcode_libdir_separator" &&
-	     test -n "$hardcode_libdirs"; then
-	    libdir=$hardcode_libdirs
-	    eval "dep_rpath=\"$hardcode_libdir_flag_spec\""
-	  fi
-	  if test -n "$runpath_var" && test -n "$perm_rpath"; then
-	    # We should set the runpath_var.
-	    rpath=
-	    for dir in $perm_rpath; do
-	      func_append rpath "$dir:"
-	    done
-	    eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
-	  fi
-	  test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
-	fi
-
-	shlibpath=$finalize_shlibpath
-	test relink = "$opt_mode" || shlibpath=$compile_shlibpath$shlibpath
-	if test -n "$shlibpath"; then
-	  eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
-	fi
-
-	# Get the real and link names of the library.
-	eval shared_ext=\"$shrext_cmds\"
-	eval library_names=\"$library_names_spec\"
-	set dummy $library_names
-	shift
-	realname=$1
-	shift
-
-	if test -n "$soname_spec"; then
-	  eval soname=\"$soname_spec\"
-	else
-	  soname=$realname
-	fi
-	if test -z "$dlname"; then
-	  dlname=$soname
-	fi
-
-	lib=$output_objdir/$realname
-	linknames=
-	for link
-	do
-	  func_append linknames " $link"
-	done
-
-	# Use standard objects if they are pic
-	test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP`
-	test "X$libobjs" = "X " && libobjs=
-
-	delfiles=
-	if test -n "$export_symbols" && test -n "$include_expsyms"; then
-	  $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp"
-	  export_symbols=$output_objdir/$libname.uexp
-	  func_append delfiles " $export_symbols"
-	fi
-
-	orig_export_symbols=
-	case $host_os in
-	cygwin* | mingw* | cegcc*)
-	  if test -n "$export_symbols" && test -z "$export_symbols_regex"; then
-	    # exporting using user supplied symfile
-	    func_dll_def_p "$export_symbols" || {
-	      # and it's NOT already a .def file. Must figure out
-	      # which of the given symbols are data symbols and tag
-	      # them as such. So, trigger use of export_symbols_cmds.
-	      # export_symbols gets reassigned inside the "prepare
-	      # the list of exported symbols" if statement, so the
-	      # include_expsyms logic still works.
-	      orig_export_symbols=$export_symbols
-	      export_symbols=
-	      always_export_symbols=yes
-	    }
-	  fi
-	  ;;
-	esac
-
-	# Prepare the list of exported symbols
-	if test -z "$export_symbols"; then
-	  if test yes = "$always_export_symbols" || test -n "$export_symbols_regex"; then
-	    func_verbose "generating symbol list for '$libname.la'"
-	    export_symbols=$output_objdir/$libname.exp
-	    $opt_dry_run || $RM $export_symbols
-	    cmds=$export_symbols_cmds
-	    save_ifs=$IFS; IFS='~'
-	    for cmd1 in $cmds; do
-	      IFS=$save_ifs
-	      # Take the normal branch if the nm_file_list_spec branch
-	      # doesn't work or if tool conversion is not needed.
-	      case $nm_file_list_spec~$to_tool_file_cmd in
-		*~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*)
-		  try_normal_branch=yes
-		  eval cmd=\"$cmd1\"
-		  func_len " $cmd"
-		  len=$func_len_result
-		  ;;
-		*)
-		  try_normal_branch=no
-		  ;;
-	      esac
-	      if test yes = "$try_normal_branch" \
-		 && { test "$len" -lt "$max_cmd_len" \
-		      || test "$max_cmd_len" -le -1; }
-	      then
-		func_show_eval "$cmd" 'exit $?'
-		skipped_export=false
-	      elif test -n "$nm_file_list_spec"; then
-		func_basename "$output"
-		output_la=$func_basename_result
-		save_libobjs=$libobjs
-		save_output=$output
-		output=$output_objdir/$output_la.nm
-		func_to_tool_file "$output"
-		libobjs=$nm_file_list_spec$func_to_tool_file_result
-		func_append delfiles " $output"
-		func_verbose "creating $NM input file list: $output"
-		for obj in $save_libobjs; do
-		  func_to_tool_file "$obj"
-		  $ECHO "$func_to_tool_file_result"
-		done > "$output"
-		eval cmd=\"$cmd1\"
-		func_show_eval "$cmd" 'exit $?'
-		output=$save_output
-		libobjs=$save_libobjs
-		skipped_export=false
-	      else
-		# The command line is too long to execute in one step.
-		func_verbose "using reloadable object file for export list..."
-		skipped_export=:
-		# Break out early, otherwise skipped_export may be
-		# set to false by a later but shorter cmd.
-		break
-	      fi
-	    done
-	    IFS=$save_ifs
-	    if test -n "$export_symbols_regex" && test : != "$skipped_export"; then
-	      func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
-	      func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
-	    fi
-	  fi
-	fi
-
-	if test -n "$export_symbols" && test -n "$include_expsyms"; then
-	  tmp_export_symbols=$export_symbols
-	  test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols
-	  $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
-	fi
-
-	if test : != "$skipped_export" && test -n "$orig_export_symbols"; then
-	  # The given exports_symbols file has to be filtered, so filter it.
-	  func_verbose "filter symbol list for '$libname.la' to tag DATA exports"
-	  # FIXME: $output_objdir/$libname.filter potentially contains lots of
-	  # 's' commands, which not all seds can handle. GNU sed should be fine
-	  # though. Also, the filter scales superlinearly with the number of
-	  # global variables. join(1) would be nice here, but unfortunately
-	  # isn't a blessed tool.
-	  $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
-	  func_append delfiles " $export_symbols $output_objdir/$libname.filter"
-	  export_symbols=$output_objdir/$libname.def
-	  $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
-	fi
-
-	tmp_deplibs=
-	for test_deplib in $deplibs; do
-	  case " $convenience " in
-	  *" $test_deplib "*) ;;
-	  *)
-	    func_append tmp_deplibs " $test_deplib"
-	    ;;
-	  esac
-	done
-	deplibs=$tmp_deplibs
-
-	if test -n "$convenience"; then
-	  if test -n "$whole_archive_flag_spec" &&
-	    test yes = "$compiler_needs_object" &&
-	    test -z "$libobjs"; then
-	    # extract the archives, so we have objects to list.
-	    # TODO: could optimize this to just extract one archive.
-	    whole_archive_flag_spec=
-	  fi
-	  if test -n "$whole_archive_flag_spec"; then
-	    save_libobjs=$libobjs
-	    eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
-	    test "X$libobjs" = "X " && libobjs=
-	  else
-	    gentop=$output_objdir/${outputname}x
-	    func_append generated " $gentop"
-
-	    func_extract_archives $gentop $convenience
-	    func_append libobjs " $func_extract_archives_result"
-	    test "X$libobjs" = "X " && libobjs=
-	  fi
-	fi
-
-	if test yes = "$thread_safe" && test -n "$thread_safe_flag_spec"; then
-	  eval flag=\"$thread_safe_flag_spec\"
-	  func_append linker_flags " $flag"
-	fi
-
-	# Make a backup of the uninstalled library when relinking
-	if test relink = "$opt_mode"; then
-	  $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $?
-	fi
-
-	# Do each of the archive commands.
-	if test yes = "$module" && test -n "$module_cmds"; then
-	  if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
-	    eval test_cmds=\"$module_expsym_cmds\"
-	    cmds=$module_expsym_cmds
-	  else
-	    eval test_cmds=\"$module_cmds\"
-	    cmds=$module_cmds
-	  fi
-	else
-	  if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
-	    eval test_cmds=\"$archive_expsym_cmds\"
-	    cmds=$archive_expsym_cmds
-	  else
-	    eval test_cmds=\"$archive_cmds\"
-	    cmds=$archive_cmds
-	  fi
-	fi
-
-	if test : != "$skipped_export" &&
-	   func_len " $test_cmds" &&
-	   len=$func_len_result &&
-	   test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
-	  :
-	else
-	  # The command line is too long to link in one step, link piecewise
-	  # or, if using GNU ld and skipped_export is not :, use a linker
-	  # script.
-
-	  # Save the value of $output and $libobjs because we want to
-	  # use them later.  If we have whole_archive_flag_spec, we
-	  # want to use save_libobjs as it was before
-	  # whole_archive_flag_spec was expanded, because we can't
-	  # assume the linker understands whole_archive_flag_spec.
-	  # This may have to be revisited, in case too many
-	  # convenience libraries get linked in and end up exceeding
-	  # the spec.
-	  if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
-	    save_libobjs=$libobjs
-	  fi
-	  save_output=$output
-	  func_basename "$output"
-	  output_la=$func_basename_result
-
-	  # Clear the reloadable object creation command queue and
-	  # initialize k to one.
-	  test_cmds=
-	  concat_cmds=
-	  objlist=
-	  last_robj=
-	  k=1
-
-	  if test -n "$save_libobjs" && test : != "$skipped_export" && test yes = "$with_gnu_ld"; then
-	    output=$output_objdir/$output_la.lnkscript
-	    func_verbose "creating GNU ld script: $output"
-	    echo 'INPUT (' > $output
-	    for obj in $save_libobjs
-	    do
-	      func_to_tool_file "$obj"
-	      $ECHO "$func_to_tool_file_result" >> $output
-	    done
-	    echo ')' >> $output
-	    func_append delfiles " $output"
-	    func_to_tool_file "$output"
-	    output=$func_to_tool_file_result
-	  elif test -n "$save_libobjs" && test : != "$skipped_export" && test -n "$file_list_spec"; then
-	    output=$output_objdir/$output_la.lnk
-	    func_verbose "creating linker input file list: $output"
-	    : > $output
-	    set x $save_libobjs
-	    shift
-	    firstobj=
-	    if test yes = "$compiler_needs_object"; then
-	      firstobj="$1 "
-	      shift
-	    fi
-	    for obj
-	    do
-	      func_to_tool_file "$obj"
-	      $ECHO "$func_to_tool_file_result" >> $output
-	    done
-	    func_append delfiles " $output"
-	    func_to_tool_file "$output"
-	    output=$firstobj\"$file_list_spec$func_to_tool_file_result\"
-	  else
-	    if test -n "$save_libobjs"; then
-	      func_verbose "creating reloadable object files..."
-	      output=$output_objdir/$output_la-$k.$objext
-	      eval test_cmds=\"$reload_cmds\"
-	      func_len " $test_cmds"
-	      len0=$func_len_result
-	      len=$len0
-
-	      # Loop over the list of objects to be linked.
-	      for obj in $save_libobjs
-	      do
-		func_len " $obj"
-		func_arith $len + $func_len_result
-		len=$func_arith_result
-		if test -z "$objlist" ||
-		   test "$len" -lt "$max_cmd_len"; then
-		  func_append objlist " $obj"
-		else
-		  # The command $test_cmds is almost too long, add a
-		  # command to the queue.
-		  if test 1 -eq "$k"; then
-		    # The first file doesn't have a previous command to add.
-		    reload_objs=$objlist
-		    eval concat_cmds=\"$reload_cmds\"
-		  else
-		    # All subsequent reloadable object files will link in
-		    # the last one created.
-		    reload_objs="$objlist $last_robj"
-		    eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\"
-		  fi
-		  last_robj=$output_objdir/$output_la-$k.$objext
-		  func_arith $k + 1
-		  k=$func_arith_result
-		  output=$output_objdir/$output_la-$k.$objext
-		  objlist=" $obj"
-		  func_len " $last_robj"
-		  func_arith $len0 + $func_len_result
-		  len=$func_arith_result
-		fi
-	      done
-	      # Handle the remaining objects by creating one last
-	      # reloadable object file.  All subsequent reloadable object
-	      # files will link in the last one created.
-	      test -z "$concat_cmds" || concat_cmds=$concat_cmds~
-	      reload_objs="$objlist $last_robj"
-	      eval concat_cmds=\"\$concat_cmds$reload_cmds\"
-	      if test -n "$last_robj"; then
-	        eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
-	      fi
-	      func_append delfiles " $output"
-
-	    else
-	      output=
-	    fi
-
-	    ${skipped_export-false} && {
-	      func_verbose "generating symbol list for '$libname.la'"
-	      export_symbols=$output_objdir/$libname.exp
-	      $opt_dry_run || $RM $export_symbols
-	      libobjs=$output
-	      # Append the command to create the export file.
-	      test -z "$concat_cmds" || concat_cmds=$concat_cmds~
-	      eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\"
-	      if test -n "$last_robj"; then
-		eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
-	      fi
-	    }
-
-	    test -n "$save_libobjs" &&
-	      func_verbose "creating a temporary reloadable object file: $output"
-
-	    # Loop through the commands generated above and execute them.
-	    save_ifs=$IFS; IFS='~'
-	    for cmd in $concat_cmds; do
-	      IFS=$save_ifs
-	      $opt_quiet || {
-		  func_quote_for_expand "$cmd"
-		  eval "func_echo $func_quote_for_expand_result"
-	      }
-	      $opt_dry_run || eval "$cmd" || {
-		lt_exit=$?
-
-		# Restore the uninstalled library and exit
-		if test relink = "$opt_mode"; then
-		  ( cd "$output_objdir" && \
-		    $RM "${realname}T" && \
-		    $MV "${realname}U" "$realname" )
-		fi
-
-		exit $lt_exit
-	      }
-	    done
-	    IFS=$save_ifs
-
-	    if test -n "$export_symbols_regex" && ${skipped_export-false}; then
-	      func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
-	      func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
-	    fi
-	  fi
-
-          ${skipped_export-false} && {
-	    if test -n "$export_symbols" && test -n "$include_expsyms"; then
-	      tmp_export_symbols=$export_symbols
-	      test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols
-	      $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
-	    fi
-
-	    if test -n "$orig_export_symbols"; then
-	      # The given exports_symbols file has to be filtered, so filter it.
-	      func_verbose "filter symbol list for '$libname.la' to tag DATA exports"
-	      # FIXME: $output_objdir/$libname.filter potentially contains lots of
-	      # 's' commands, which not all seds can handle. GNU sed should be fine
-	      # though. Also, the filter scales superlinearly with the number of
-	      # global variables. join(1) would be nice here, but unfortunately
-	      # isn't a blessed tool.
-	      $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
-	      func_append delfiles " $export_symbols $output_objdir/$libname.filter"
-	      export_symbols=$output_objdir/$libname.def
-	      $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
-	    fi
-	  }
-
-	  libobjs=$output
-	  # Restore the value of output.
-	  output=$save_output
-
-	  if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
-	    eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
-	    test "X$libobjs" = "X " && libobjs=
-	  fi
-	  # Expand the library linking commands again to reset the
-	  # value of $libobjs for piecewise linking.
-
-	  # Do each of the archive commands.
-	  if test yes = "$module" && test -n "$module_cmds"; then
-	    if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
-	      cmds=$module_expsym_cmds
-	    else
-	      cmds=$module_cmds
-	    fi
-	  else
-	    if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
-	      cmds=$archive_expsym_cmds
-	    else
-	      cmds=$archive_cmds
-	    fi
-	  fi
-	fi
-
-	if test -n "$delfiles"; then
-	  # Append the command to remove temporary files to $cmds.
-	  eval cmds=\"\$cmds~\$RM $delfiles\"
-	fi
-
-	# Add any objects from preloaded convenience libraries
-	if test -n "$dlprefiles"; then
-	  gentop=$output_objdir/${outputname}x
-	  func_append generated " $gentop"
-
-	  func_extract_archives $gentop $dlprefiles
-	  func_append libobjs " $func_extract_archives_result"
-	  test "X$libobjs" = "X " && libobjs=
-	fi
-
-	save_ifs=$IFS; IFS='~'
-	for cmd in $cmds; do
-	  IFS=$sp$nl
-	  eval cmd=\"$cmd\"
-	  IFS=$save_ifs
-	  $opt_quiet || {
-	    func_quote_for_expand "$cmd"
-	    eval "func_echo $func_quote_for_expand_result"
-	  }
-	  $opt_dry_run || eval "$cmd" || {
-	    lt_exit=$?
-
-	    # Restore the uninstalled library and exit
-	    if test relink = "$opt_mode"; then
-	      ( cd "$output_objdir" && \
-	        $RM "${realname}T" && \
-		$MV "${realname}U" "$realname" )
-	    fi
-
-	    exit $lt_exit
-	  }
-	done
-	IFS=$save_ifs
-
-	# Restore the uninstalled library and exit
-	if test relink = "$opt_mode"; then
-	  $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $?
-
-	  if test -n "$convenience"; then
-	    if test -z "$whole_archive_flag_spec"; then
-	      func_show_eval '${RM}r "$gentop"'
-	    fi
-	  fi
-
-	  exit $EXIT_SUCCESS
-	fi
-
-	# Create links to the real library.
-	for linkname in $linknames; do
-	  if test "$realname" != "$linkname"; then
-	    func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?'
-	  fi
-	done
-
-	# If -module or -export-dynamic was specified, set the dlname.
-	if test yes = "$module" || test yes = "$export_dynamic"; then
-	  # On all known operating systems, these are identical.
-	  dlname=$soname
-	fi
-      fi
-      ;;
-
-    obj)
-      if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then
-	func_warning "'-dlopen' is ignored for objects"
-      fi
-
-      case " $deplibs" in
-      *\ -l* | *\ -L*)
-	func_warning "'-l' and '-L' are ignored for objects" ;;
-      esac
-
-      test -n "$rpath" && \
-	func_warning "'-rpath' is ignored for objects"
-
-      test -n "$xrpath" && \
-	func_warning "'-R' is ignored for objects"
-
-      test -n "$vinfo" && \
-	func_warning "'-version-info' is ignored for objects"
-
-      test -n "$release" && \
-	func_warning "'-release' is ignored for objects"
-
-      case $output in
-      *.lo)
-	test -n "$objs$old_deplibs" && \
-	  func_fatal_error "cannot build library object '$output' from non-libtool objects"
-
-	libobj=$output
-	func_lo2o "$libobj"
-	obj=$func_lo2o_result
-	;;
-      *)
-	libobj=
-	obj=$output
-	;;
-      esac
-
-      # Delete the old objects.
-      $opt_dry_run || $RM $obj $libobj
-
-      # Objects from convenience libraries.  This assumes
-      # single-version convenience libraries.  Whenever we create
-      # different ones for PIC/non-PIC, this we'll have to duplicate
-      # the extraction.
-      reload_conv_objs=
-      gentop=
-      # if reload_cmds runs $LD directly, get rid of -Wl from
-      # whole_archive_flag_spec and hope we can get by with turning comma
-      # into space.
-      case $reload_cmds in
-        *\$LD[\ \$]*) wl= ;;
-      esac
-      if test -n "$convenience"; then
-	if test -n "$whole_archive_flag_spec"; then
-	  eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
-	  test -n "$wl" || tmp_whole_archive_flags=`$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'`
-	  reload_conv_objs=$reload_objs\ $tmp_whole_archive_flags
-	else
-	  gentop=$output_objdir/${obj}x
-	  func_append generated " $gentop"
-
-	  func_extract_archives $gentop $convenience
-	  reload_conv_objs="$reload_objs $func_extract_archives_result"
-	fi
-      fi
-
-      # If we're not building shared, we need to use non_pic_objs
-      test yes = "$build_libtool_libs" || libobjs=$non_pic_objects
-
-      # Create the old-style object.
-      reload_objs=$objs$old_deplibs' '`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; /\.lib$/d; $lo2o" | $NL2SP`' '$reload_conv_objs
-
-      output=$obj
-      func_execute_cmds "$reload_cmds" 'exit $?'
-
-      # Exit if we aren't doing a library object file.
-      if test -z "$libobj"; then
-	if test -n "$gentop"; then
-	  func_show_eval '${RM}r "$gentop"'
-	fi
-
-	exit $EXIT_SUCCESS
-      fi
-
-      test yes = "$build_libtool_libs" || {
-	if test -n "$gentop"; then
-	  func_show_eval '${RM}r "$gentop"'
-	fi
-
-	# Create an invalid libtool object if no PIC, so that we don't
-	# accidentally link it into a program.
-	# $show "echo timestamp > $libobj"
-	# $opt_dry_run || eval "echo timestamp > $libobj" || exit $?
-	exit $EXIT_SUCCESS
-      }
-
-      if test -n "$pic_flag" || test default != "$pic_mode"; then
-	# Only do commands if we really have different PIC objects.
-	reload_objs="$libobjs $reload_conv_objs"
-	output=$libobj
-	func_execute_cmds "$reload_cmds" 'exit $?'
-      fi
-
-      if test -n "$gentop"; then
-	func_show_eval '${RM}r "$gentop"'
-      fi
-
-      exit $EXIT_SUCCESS
-      ;;
-
-    prog)
-      case $host in
-	*cygwin*) func_stripname '' '.exe' "$output"
-	          output=$func_stripname_result.exe;;
-      esac
-      test -n "$vinfo" && \
-	func_warning "'-version-info' is ignored for programs"
-
-      test -n "$release" && \
-	func_warning "'-release' is ignored for programs"
-
-      $preload \
-	&& test unknown,unknown,unknown = "$dlopen_support,$dlopen_self,$dlopen_self_static" \
-	&& func_warning "'LT_INIT([dlopen])' not used. Assuming no dlopen support."
-
-      case $host in
-      *-*-rhapsody* | *-*-darwin1.[012])
-	# On Rhapsody replace the C library is the System framework
-	compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'`
-	finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'`
-	;;
-      esac
-
-      case $host in
-      *-*-darwin*)
-	# Don't allow lazy linking, it breaks C++ global constructors
-	# But is supposedly fixed on 10.4 or later (yay!).
-	if test CXX = "$tagname"; then
-	  case ${MACOSX_DEPLOYMENT_TARGET-10.0} in
-	    10.[0123])
-	      func_append compile_command " $wl-bind_at_load"
-	      func_append finalize_command " $wl-bind_at_load"
-	    ;;
-	  esac
-	fi
-	# Time to change all our "foo.ltframework" stuff back to "-framework foo"
-	compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
-	finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
-	;;
-      esac
-
-
-      # move library search paths that coincide with paths to not yet
-      # installed libraries to the beginning of the library search list
-      new_libs=
-      for path in $notinst_path; do
-	case " $new_libs " in
-	*" -L$path/$objdir "*) ;;
-	*)
-	  case " $compile_deplibs " in
-	  *" -L$path/$objdir "*)
-	    func_append new_libs " -L$path/$objdir" ;;
-	  esac
-	  ;;
-	esac
-      done
-      for deplib in $compile_deplibs; do
-	case $deplib in
-	-L*)
-	  case " $new_libs " in
-	  *" $deplib "*) ;;
-	  *) func_append new_libs " $deplib" ;;
-	  esac
-	  ;;
-	*) func_append new_libs " $deplib" ;;
-	esac
-      done
-      compile_deplibs=$new_libs
-
-
-      func_append compile_command " $compile_deplibs"
-      func_append finalize_command " $finalize_deplibs"
-
-      if test -n "$rpath$xrpath"; then
-	# If the user specified any rpath flags, then add them.
-	for libdir in $rpath $xrpath; do
-	  # This is the magic to use -rpath.
-	  case "$finalize_rpath " in
-	  *" $libdir "*) ;;
-	  *) func_append finalize_rpath " $libdir" ;;
-	  esac
-	done
-      fi
-
-      # Now hardcode the library paths
-      rpath=
-      hardcode_libdirs=
-      for libdir in $compile_rpath $finalize_rpath; do
-	if test -n "$hardcode_libdir_flag_spec"; then
-	  if test -n "$hardcode_libdir_separator"; then
-	    if test -z "$hardcode_libdirs"; then
-	      hardcode_libdirs=$libdir
-	    else
-	      # Just accumulate the unique libdirs.
-	      case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
-	      *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
-		;;
-	      *)
-		func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
-		;;
-	      esac
-	    fi
-	  else
-	    eval flag=\"$hardcode_libdir_flag_spec\"
-	    func_append rpath " $flag"
-	  fi
-	elif test -n "$runpath_var"; then
-	  case "$perm_rpath " in
-	  *" $libdir "*) ;;
-	  *) func_append perm_rpath " $libdir" ;;
-	  esac
-	fi
-	case $host in
-	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
-	  testbindir=`$ECHO "$libdir" | $SED -e 's*/lib$*/bin*'`
-	  case :$dllsearchpath: in
-	  *":$libdir:"*) ;;
-	  ::) dllsearchpath=$libdir;;
-	  *) func_append dllsearchpath ":$libdir";;
-	  esac
-	  case :$dllsearchpath: in
-	  *":$testbindir:"*) ;;
-	  ::) dllsearchpath=$testbindir;;
-	  *) func_append dllsearchpath ":$testbindir";;
-	  esac
-	  ;;
-	esac
-      done
-      # Substitute the hardcoded libdirs into the rpath.
-      if test -n "$hardcode_libdir_separator" &&
-	 test -n "$hardcode_libdirs"; then
-	libdir=$hardcode_libdirs
-	eval rpath=\" $hardcode_libdir_flag_spec\"
-      fi
-      compile_rpath=$rpath
-
-      rpath=
-      hardcode_libdirs=
-      for libdir in $finalize_rpath; do
-	if test -n "$hardcode_libdir_flag_spec"; then
-	  if test -n "$hardcode_libdir_separator"; then
-	    if test -z "$hardcode_libdirs"; then
-	      hardcode_libdirs=$libdir
-	    else
-	      # Just accumulate the unique libdirs.
-	      case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
-	      *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
-		;;
-	      *)
-		func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
-		;;
-	      esac
-	    fi
-	  else
-	    eval flag=\"$hardcode_libdir_flag_spec\"
-	    func_append rpath " $flag"
-	  fi
-	elif test -n "$runpath_var"; then
-	  case "$finalize_perm_rpath " in
-	  *" $libdir "*) ;;
-	  *) func_append finalize_perm_rpath " $libdir" ;;
-	  esac
-	fi
-      done
-      # Substitute the hardcoded libdirs into the rpath.
-      if test -n "$hardcode_libdir_separator" &&
-	 test -n "$hardcode_libdirs"; then
-	libdir=$hardcode_libdirs
-	eval rpath=\" $hardcode_libdir_flag_spec\"
-      fi
-      finalize_rpath=$rpath
-
-      if test -n "$libobjs" && test yes = "$build_old_libs"; then
-	# Transform all the library objects into standard objects.
-	compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
-	finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
-      fi
-
-      func_generate_dlsyms "$outputname" "@PROGRAM@" false
-
-      # template prelinking step
-      if test -n "$prelink_cmds"; then
-	func_execute_cmds "$prelink_cmds" 'exit $?'
-      fi
-
-      wrappers_required=:
-      case $host in
-      *cegcc* | *mingw32ce*)
-        # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway.
-        wrappers_required=false
-        ;;
-      *cygwin* | *mingw* )
-        test yes = "$build_libtool_libs" || wrappers_required=false
-        ;;
-      *)
-        if test no = "$need_relink" || test yes != "$build_libtool_libs"; then
-          wrappers_required=false
-        fi
-        ;;
-      esac
-      $wrappers_required || {
-	# Replace the output file specification.
-	compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
-	link_command=$compile_command$compile_rpath
-
-	# We have no uninstalled library dependencies, so finalize right now.
-	exit_status=0
-	func_show_eval "$link_command" 'exit_status=$?'
-
-	if test -n "$postlink_cmds"; then
-	  func_to_tool_file "$output"
-	  postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
-	  func_execute_cmds "$postlink_cmds" 'exit $?'
-	fi
-
-	# Delete the generated files.
-	if test -f "$output_objdir/${outputname}S.$objext"; then
-	  func_show_eval '$RM "$output_objdir/${outputname}S.$objext"'
-	fi
-
-	exit $exit_status
-      }
-
-      if test -n "$compile_shlibpath$finalize_shlibpath"; then
-	compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
-      fi
-      if test -n "$finalize_shlibpath"; then
-	finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
-      fi
-
-      compile_var=
-      finalize_var=
-      if test -n "$runpath_var"; then
-	if test -n "$perm_rpath"; then
-	  # We should set the runpath_var.
-	  rpath=
-	  for dir in $perm_rpath; do
-	    func_append rpath "$dir:"
-	  done
-	  compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
-	fi
-	if test -n "$finalize_perm_rpath"; then
-	  # We should set the runpath_var.
-	  rpath=
-	  for dir in $finalize_perm_rpath; do
-	    func_append rpath "$dir:"
-	  done
-	  finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
-	fi
-      fi
-
-      if test yes = "$no_install"; then
-	# We don't need to create a wrapper script.
-	link_command=$compile_var$compile_command$compile_rpath
-	# Replace the output file specification.
-	link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
-	# Delete the old output file.
-	$opt_dry_run || $RM $output
-	# Link the executable and exit
-	func_show_eval "$link_command" 'exit $?'
-
-	if test -n "$postlink_cmds"; then
-	  func_to_tool_file "$output"
-	  postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
-	  func_execute_cmds "$postlink_cmds" 'exit $?'
-	fi
-
-	exit $EXIT_SUCCESS
-      fi
-
-      case $hardcode_action,$fast_install in
-        relink,*)
-	  # Fast installation is not supported
-	  link_command=$compile_var$compile_command$compile_rpath
-	  relink_command=$finalize_var$finalize_command$finalize_rpath
-
-	  func_warning "this platform does not like uninstalled shared libraries"
-	  func_warning "'$output' will be relinked during installation"
-	  ;;
-        *,yes)
-	  link_command=$finalize_var$compile_command$finalize_rpath
-	  relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'`
-          ;;
-	*,no)
-	  link_command=$compile_var$compile_command$compile_rpath
-	  relink_command=$finalize_var$finalize_command$finalize_rpath
-          ;;
-	*,needless)
-	  link_command=$finalize_var$compile_command$finalize_rpath
-	  relink_command=
-          ;;
-      esac
-
-      # Replace the output file specification.
-      link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
-
-      # Delete the old output files.
-      $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname
-
-      func_show_eval "$link_command" 'exit $?'
-
-      if test -n "$postlink_cmds"; then
-	func_to_tool_file "$output_objdir/$outputname"
-	postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
-	func_execute_cmds "$postlink_cmds" 'exit $?'
-      fi
-
-      # Now create the wrapper script.
-      func_verbose "creating $output"
-
-      # Quote the relink command for shipping.
-      if test -n "$relink_command"; then
-	# Preserve any variables that may affect compiler behavior
-	for var in $variables_saved_for_relink; do
-	  if eval test -z \"\${$var+set}\"; then
-	    relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
-	  elif eval var_value=\$$var; test -z "$var_value"; then
-	    relink_command="$var=; export $var; $relink_command"
-	  else
-	    func_quote_for_eval "$var_value"
-	    relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
-	  fi
-	done
-	relink_command="(cd `pwd`; $relink_command)"
-	relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
-      fi
-
-      # Only actually do things if not in dry run mode.
-      $opt_dry_run || {
-	# win32 will think the script is a binary if it has
-	# a .exe suffix, so we strip it off here.
-	case $output in
-	  *.exe) func_stripname '' '.exe' "$output"
-	         output=$func_stripname_result ;;
-	esac
-	# test for cygwin because mv fails w/o .exe extensions
-	case $host in
-	  *cygwin*)
-	    exeext=.exe
-	    func_stripname '' '.exe' "$outputname"
-	    outputname=$func_stripname_result ;;
-	  *) exeext= ;;
-	esac
-	case $host in
-	  *cygwin* | *mingw* )
-	    func_dirname_and_basename "$output" "" "."
-	    output_name=$func_basename_result
-	    output_path=$func_dirname_result
-	    cwrappersource=$output_path/$objdir/lt-$output_name.c
-	    cwrapper=$output_path/$output_name.exe
-	    $RM $cwrappersource $cwrapper
-	    trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
-
-	    func_emit_cwrapperexe_src > $cwrappersource
-
-	    # The wrapper executable is built using the $host compiler,
-	    # because it contains $host paths and files. If cross-
-	    # compiling, it, like the target executable, must be
-	    # executed on the $host or under an emulation environment.
-	    $opt_dry_run || {
-	      $LTCC $LTCFLAGS -o $cwrapper $cwrappersource
-	      $STRIP $cwrapper
-	    }
-
-	    # Now, create the wrapper script for func_source use:
-	    func_ltwrapper_scriptname $cwrapper
-	    $RM $func_ltwrapper_scriptname_result
-	    trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15
-	    $opt_dry_run || {
-	      # note: this script will not be executed, so do not chmod.
-	      if test "x$build" = "x$host"; then
-		$cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result
-	      else
-		func_emit_wrapper no > $func_ltwrapper_scriptname_result
-	      fi
-	    }
-	  ;;
-	  * )
-	    $RM $output
-	    trap "$RM $output; exit $EXIT_FAILURE" 1 2 15
-
-	    func_emit_wrapper no > $output
-	    chmod +x $output
-	  ;;
-	esac
-      }
-      exit $EXIT_SUCCESS
-      ;;
-    esac
-
-    # See if we need to build an old-fashioned archive.
-    for oldlib in $oldlibs; do
-
-      case $build_libtool_libs in
-        convenience)
-	  oldobjs="$libobjs_save $symfileobj"
-	  addlibs=$convenience
-	  build_libtool_libs=no
-	  ;;
-	module)
-	  oldobjs=$libobjs_save
-	  addlibs=$old_convenience
-	  build_libtool_libs=no
-          ;;
-	*)
-	  oldobjs="$old_deplibs $non_pic_objects"
-	  $preload && test -f "$symfileobj" \
-	    && func_append oldobjs " $symfileobj"
-	  addlibs=$old_convenience
-	  ;;
-      esac
-
-      if test -n "$addlibs"; then
-	gentop=$output_objdir/${outputname}x
-	func_append generated " $gentop"
-
-	func_extract_archives $gentop $addlibs
-	func_append oldobjs " $func_extract_archives_result"
-      fi
-
-      # Do each command in the archive commands.
-      if test -n "$old_archive_from_new_cmds" && test yes = "$build_libtool_libs"; then
-	cmds=$old_archive_from_new_cmds
-      else
-
-	# Add any objects from preloaded convenience libraries
-	if test -n "$dlprefiles"; then
-	  gentop=$output_objdir/${outputname}x
-	  func_append generated " $gentop"
-
-	  func_extract_archives $gentop $dlprefiles
-	  func_append oldobjs " $func_extract_archives_result"
-	fi
-
-	# POSIX demands no paths to be encoded in archives.  We have
-	# to avoid creating archives with duplicate basenames if we
-	# might have to extract them afterwards, e.g., when creating a
-	# static archive out of a convenience library, or when linking
-	# the entirety of a libtool archive into another (currently
-	# not supported by libtool).
-	if (for obj in $oldobjs
-	    do
-	      func_basename "$obj"
-	      $ECHO "$func_basename_result"
-	    done | sort | sort -uc >/dev/null 2>&1); then
-	  :
-	else
-	  echo "copying selected object files to avoid basename conflicts..."
-	  gentop=$output_objdir/${outputname}x
-	  func_append generated " $gentop"
-	  func_mkdir_p "$gentop"
-	  save_oldobjs=$oldobjs
-	  oldobjs=
-	  counter=1
-	  for obj in $save_oldobjs
-	  do
-	    func_basename "$obj"
-	    objbase=$func_basename_result
-	    case " $oldobjs " in
-	    " ") oldobjs=$obj ;;
-	    *[\ /]"$objbase "*)
-	      while :; do
-		# Make sure we don't pick an alternate name that also
-		# overlaps.
-		newobj=lt$counter-$objbase
-		func_arith $counter + 1
-		counter=$func_arith_result
-		case " $oldobjs " in
-		*[\ /]"$newobj "*) ;;
-		*) if test ! -f "$gentop/$newobj"; then break; fi ;;
-		esac
-	      done
-	      func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
-	      func_append oldobjs " $gentop/$newobj"
-	      ;;
-	    *) func_append oldobjs " $obj" ;;
-	    esac
-	  done
-	fi
-	func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
-	tool_oldlib=$func_to_tool_file_result
-	eval cmds=\"$old_archive_cmds\"
-
-	func_len " $cmds"
-	len=$func_len_result
-	if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
-	  cmds=$old_archive_cmds
-	elif test -n "$archiver_list_spec"; then
-	  func_verbose "using command file archive linking..."
-	  for obj in $oldobjs
-	  do
-	    func_to_tool_file "$obj"
-	    $ECHO "$func_to_tool_file_result"
-	  done > $output_objdir/$libname.libcmd
-	  func_to_tool_file "$output_objdir/$libname.libcmd"
-	  oldobjs=" $archiver_list_spec$func_to_tool_file_result"
-	  cmds=$old_archive_cmds
-	else
-	  # the command line is too long to link in one step, link in parts
-	  func_verbose "using piecewise archive linking..."
-	  save_RANLIB=$RANLIB
-	  RANLIB=:
-	  objlist=
-	  concat_cmds=
-	  save_oldobjs=$oldobjs
-	  oldobjs=
-	  # Is there a better way of finding the last object in the list?
-	  for obj in $save_oldobjs
-	  do
-	    last_oldobj=$obj
-	  done
-	  eval test_cmds=\"$old_archive_cmds\"
-	  func_len " $test_cmds"
-	  len0=$func_len_result
-	  len=$len0
-	  for obj in $save_oldobjs
-	  do
-	    func_len " $obj"
-	    func_arith $len + $func_len_result
-	    len=$func_arith_result
-	    func_append objlist " $obj"
-	    if test "$len" -lt "$max_cmd_len"; then
-	      :
-	    else
-	      # the above command should be used before it gets too long
-	      oldobjs=$objlist
-	      if test "$obj" = "$last_oldobj"; then
-		RANLIB=$save_RANLIB
-	      fi
-	      test -z "$concat_cmds" || concat_cmds=$concat_cmds~
-	      eval concat_cmds=\"\$concat_cmds$old_archive_cmds\"
-	      objlist=
-	      len=$len0
-	    fi
-	  done
-	  RANLIB=$save_RANLIB
-	  oldobjs=$objlist
-	  if test -z "$oldobjs"; then
-	    eval cmds=\"\$concat_cmds\"
-	  else
-	    eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
-	  fi
-	fi
-      fi
-      func_execute_cmds "$cmds" 'exit $?'
-    done
-
-    test -n "$generated" && \
-      func_show_eval "${RM}r$generated"
-
-    # Now create the libtool archive.
-    case $output in
-    *.la)
-      old_library=
-      test yes = "$build_old_libs" && old_library=$libname.$libext
-      func_verbose "creating $output"
-
-      # Preserve any variables that may affect compiler behavior
-      for var in $variables_saved_for_relink; do
-	if eval test -z \"\${$var+set}\"; then
-	  relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
-	elif eval var_value=\$$var; test -z "$var_value"; then
-	  relink_command="$var=; export $var; $relink_command"
-	else
-	  func_quote_for_eval "$var_value"
-	  relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
-	fi
-      done
-      # Quote the link command for shipping.
-      relink_command="(cd `pwd`; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
-      relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
-      if test yes = "$hardcode_automatic"; then
-	relink_command=
-      fi
-
-      # Only create the output if not a dry run.
-      $opt_dry_run || {
-	for installed in no yes; do
-	  if test yes = "$installed"; then
-	    if test -z "$install_libdir"; then
-	      break
-	    fi
-	    output=$output_objdir/${outputname}i
-	    # Replace all uninstalled libtool libraries with the installed ones
-	    newdependency_libs=
-	    for deplib in $dependency_libs; do
-	      case $deplib in
-	      *.la)
-		func_basename "$deplib"
-		name=$func_basename_result
-		func_resolve_sysroot "$deplib"
-		eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result`
-		test -z "$libdir" && \
-		  func_fatal_error "'$deplib' is not a valid libtool archive"
-		func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name"
-		;;
-	      -L*)
-		func_stripname -L '' "$deplib"
-		func_replace_sysroot "$func_stripname_result"
-		func_append newdependency_libs " -L$func_replace_sysroot_result"
-		;;
-	      -R*)
-		func_stripname -R '' "$deplib"
-		func_replace_sysroot "$func_stripname_result"
-		func_append newdependency_libs " -R$func_replace_sysroot_result"
-		;;
-	      *) func_append newdependency_libs " $deplib" ;;
-	      esac
-	    done
-	    dependency_libs=$newdependency_libs
-	    newdlfiles=
-
-	    for lib in $dlfiles; do
-	      case $lib in
-	      *.la)
-	        func_basename "$lib"
-		name=$func_basename_result
-		eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
-		test -z "$libdir" && \
-		  func_fatal_error "'$lib' is not a valid libtool archive"
-		func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name"
-		;;
-	      *) func_append newdlfiles " $lib" ;;
-	      esac
-	    done
-	    dlfiles=$newdlfiles
-	    newdlprefiles=
-	    for lib in $dlprefiles; do
-	      case $lib in
-	      *.la)
-		# Only pass preopened files to the pseudo-archive (for
-		# eventual linking with the app. that links it) if we
-		# didn't already link the preopened objects directly into
-		# the library:
-		func_basename "$lib"
-		name=$func_basename_result
-		eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
-		test -z "$libdir" && \
-		  func_fatal_error "'$lib' is not a valid libtool archive"
-		func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name"
-		;;
-	      esac
-	    done
-	    dlprefiles=$newdlprefiles
-	  else
-	    newdlfiles=
-	    for lib in $dlfiles; do
-	      case $lib in
-		[\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;;
-		*) abs=`pwd`"/$lib" ;;
-	      esac
-	      func_append newdlfiles " $abs"
-	    done
-	    dlfiles=$newdlfiles
-	    newdlprefiles=
-	    for lib in $dlprefiles; do
-	      case $lib in
-		[\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;;
-		*) abs=`pwd`"/$lib" ;;
-	      esac
-	      func_append newdlprefiles " $abs"
-	    done
-	    dlprefiles=$newdlprefiles
-	  fi
-	  $RM $output
-	  # place dlname in correct position for cygwin
-	  # In fact, it would be nice if we could use this code for all target
-	  # systems that can't hard-code library paths into their executables
-	  # and that have no shared library path variable independent of PATH,
-	  # but it turns out we can't easily determine that from inspecting
-	  # libtool variables, so we have to hard-code the OSs to which it
-	  # applies here; at the moment, that means platforms that use the PE
-	  # object format with DLL files.  See the long comment at the top of
-	  # tests/bindir.at for full details.
-	  tdlname=$dlname
-	  case $host,$output,$installed,$module,$dlname in
-	    *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll)
-	      # If a -bindir argument was supplied, place the dll there.
-	      if test -n "$bindir"; then
-		func_relative_path "$install_libdir" "$bindir"
-		tdlname=$func_relative_path_result/$dlname
-	      else
-		# Otherwise fall back on heuristic.
-		tdlname=../bin/$dlname
-	      fi
-	      ;;
-	  esac
-	  $ECHO > $output "\
-# $outputname - a libtool library file
-# Generated by $PROGRAM (GNU $PACKAGE) $VERSION
-#
-# Please DO NOT delete this file!
-# It is necessary for linking the library.
-
-# The name that we can dlopen(3).
-dlname='$tdlname'
-
-# Names of this library.
-library_names='$library_names'
-
-# The name of the static archive.
-old_library='$old_library'
-
-# Linker flags that cannot go in dependency_libs.
-inherited_linker_flags='$new_inherited_linker_flags'
-
-# Libraries that this one depends upon.
-dependency_libs='$dependency_libs'
-
-# Names of additional weak libraries provided by this library
-weak_library_names='$weak_libs'
-
-# Version information for $libname.
-current=$current
-age=$age
-revision=$revision
-
-# Is this an already installed library?
-installed=$installed
-
-# Should we warn about portability when linking against -modules?
-shouldnotlink=$module
-
-# Files to dlopen/dlpreopen
-dlopen='$dlfiles'
-dlpreopen='$dlprefiles'
-
-# Directory that this library needs to be installed in:
-libdir='$install_libdir'"
-	  if test no,yes = "$installed,$need_relink"; then
-	    $ECHO >> $output "\
-relink_command=\"$relink_command\""
-	  fi
-	done
-      }
-
-      # Do a symbolic link so that the libtool archive can be found in
-      # LD_LIBRARY_PATH before the program is installed.
-      func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?'
-      ;;
-    esac
-    exit $EXIT_SUCCESS
-}
-
-if test link = "$opt_mode" || test relink = "$opt_mode"; then
-  func_mode_link ${1+"$@"}
-fi
-
-
-# func_mode_uninstall arg...
-func_mode_uninstall ()
-{
-    $debug_cmd
-
-    RM=$nonopt
-    files=
-    rmforce=false
-    exit_status=0
-
-    # This variable tells wrapper scripts just to set variables rather
-    # than running their programs.
-    libtool_install_magic=$magic
-
-    for arg
-    do
-      case $arg in
-      -f) func_append RM " $arg"; rmforce=: ;;
-      -*) func_append RM " $arg" ;;
-      *) func_append files " $arg" ;;
-      esac
-    done
-
-    test -z "$RM" && \
-      func_fatal_help "you must specify an RM program"
-
-    rmdirs=
-
-    for file in $files; do
-      func_dirname "$file" "" "."
-      dir=$func_dirname_result
-      if test . = "$dir"; then
-	odir=$objdir
-      else
-	odir=$dir/$objdir
-      fi
-      func_basename "$file"
-      name=$func_basename_result
-      test uninstall = "$opt_mode" && odir=$dir
-
-      # Remember odir for removal later, being careful to avoid duplicates
-      if test clean = "$opt_mode"; then
-	case " $rmdirs " in
-	  *" $odir "*) ;;
-	  *) func_append rmdirs " $odir" ;;
-	esac
-      fi
-
-      # Don't error if the file doesn't exist and rm -f was used.
-      if { test -L "$file"; } >/dev/null 2>&1 ||
-	 { test -h "$file"; } >/dev/null 2>&1 ||
-	 test -f "$file"; then
-	:
-      elif test -d "$file"; then
-	exit_status=1
-	continue
-      elif $rmforce; then
-	continue
-      fi
-
-      rmfiles=$file
-
-      case $name in
-      *.la)
-	# Possibly a libtool archive, so verify it.
-	if func_lalib_p "$file"; then
-	  func_source $dir/$name
-
-	  # Delete the libtool libraries and symlinks.
-	  for n in $library_names; do
-	    func_append rmfiles " $odir/$n"
-	  done
-	  test -n "$old_library" && func_append rmfiles " $odir/$old_library"
-
-	  case $opt_mode in
-	  clean)
-	    case " $library_names " in
-	    *" $dlname "*) ;;
-	    *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;;
-	    esac
-	    test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i"
-	    ;;
-	  uninstall)
-	    if test -n "$library_names"; then
-	      # Do each command in the postuninstall commands.
-	      func_execute_cmds "$postuninstall_cmds" '$rmforce || exit_status=1'
-	    fi
-
-	    if test -n "$old_library"; then
-	      # Do each command in the old_postuninstall commands.
-	      func_execute_cmds "$old_postuninstall_cmds" '$rmforce || exit_status=1'
-	    fi
-	    # FIXME: should reinstall the best remaining shared library.
-	    ;;
-	  esac
-	fi
-	;;
-
-      *.lo)
-	# Possibly a libtool object, so verify it.
-	if func_lalib_p "$file"; then
-
-	  # Read the .lo file
-	  func_source $dir/$name
-
-	  # Add PIC object to the list of files to remove.
-	  if test -n "$pic_object" && test none != "$pic_object"; then
-	    func_append rmfiles " $dir/$pic_object"
-	  fi
-
-	  # Add non-PIC object to the list of files to remove.
-	  if test -n "$non_pic_object" && test none != "$non_pic_object"; then
-	    func_append rmfiles " $dir/$non_pic_object"
-	  fi
-	fi
-	;;
-
-      *)
-	if test clean = "$opt_mode"; then
-	  noexename=$name
-	  case $file in
-	  *.exe)
-	    func_stripname '' '.exe' "$file"
-	    file=$func_stripname_result
-	    func_stripname '' '.exe' "$name"
-	    noexename=$func_stripname_result
-	    # $file with .exe has already been added to rmfiles,
-	    # add $file without .exe
-	    func_append rmfiles " $file"
-	    ;;
-	  esac
-	  # Do a test to see if this is a libtool program.
-	  if func_ltwrapper_p "$file"; then
-	    if func_ltwrapper_executable_p "$file"; then
-	      func_ltwrapper_scriptname "$file"
-	      relink_command=
-	      func_source $func_ltwrapper_scriptname_result
-	      func_append rmfiles " $func_ltwrapper_scriptname_result"
-	    else
-	      relink_command=
-	      func_source $dir/$noexename
-	    fi
-
-	    # note $name still contains .exe if it was in $file originally
-	    # as does the version of $file that was added into $rmfiles
-	    func_append rmfiles " $odir/$name $odir/${name}S.$objext"
-	    if test yes = "$fast_install" && test -n "$relink_command"; then
-	      func_append rmfiles " $odir/lt-$name"
-	    fi
-	    if test "X$noexename" != "X$name"; then
-	      func_append rmfiles " $odir/lt-$noexename.c"
-	    fi
-	  fi
-	fi
-	;;
-      esac
-      func_show_eval "$RM $rmfiles" 'exit_status=1'
-    done
-
-    # Try to remove the $objdir's in the directories where we deleted files
-    for dir in $rmdirs; do
-      if test -d "$dir"; then
-	func_show_eval "rmdir $dir >/dev/null 2>&1"
-      fi
-    done
-
-    exit $exit_status
-}
-
-if test uninstall = "$opt_mode" || test clean = "$opt_mode"; then
-  func_mode_uninstall ${1+"$@"}
-fi
-
-test -z "$opt_mode" && {
-  help=$generic_help
-  func_fatal_help "you must specify a MODE"
-}
-
-test -z "$exec_cmd" && \
-  func_fatal_help "invalid operation mode '$opt_mode'"
-
-if test -n "$exec_cmd"; then
-  eval exec "$exec_cmd"
-  exit $EXIT_FAILURE
-fi
-
-exit $exit_status
-
-
-# The TAGs below are defined such that we never get into a situation
-# where we disable both kinds of libraries.  Given conflicting
-# choices, we go for a static library, that is the most portable,
-# since we can't tell whether shared libraries were disabled because
-# the user asked for that or because the platform doesn't support
-# them.  This is particularly important on AIX, because we don't
-# support having both static and shared libraries enabled at the same
-# time on that platform, so we default to a shared-only configuration.
-# If a disable-shared tag is given, we'll fallback to a static-only
-# configuration.  But we'll never go from static-only to shared-only.
-
-# ### BEGIN LIBTOOL TAG CONFIG: disable-shared
-build_libtool_libs=no
-build_old_libs=yes
-# ### END LIBTOOL TAG CONFIG: disable-shared
-
-# ### BEGIN LIBTOOL TAG CONFIG: disable-static
-build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
-# ### END LIBTOOL TAG CONFIG: disable-static
-
-# Local Variables:
-# mode:shell-script
-# sh-indentation:2
-# End:
diff --git a/missing b/missing
deleted file mode 100755
index db98974..0000000
--- a/missing
+++ /dev/null
@@ -1,215 +0,0 @@
-#! /bin/sh
-# Common wrapper for a few potentially missing GNU programs.
-
-scriptversion=2013-10-28.13; # UTC
-
-# Copyright (C) 1996-2013 Free Software Foundation, Inc.
-# Originally written by Fran,cois Pinard <pinard at iro.umontreal.ca>, 1996.
-
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-if test $# -eq 0; then
-  echo 1>&2 "Try '$0 --help' for more information"
-  exit 1
-fi
-
-case $1 in
-
-  --is-lightweight)
-    # Used by our autoconf macros to check whether the available missing
-    # script is modern enough.
-    exit 0
-    ;;
-
-  --run)
-    # Back-compat with the calling convention used by older automake.
-    shift
-    ;;
-
-  -h|--h|--he|--hel|--help)
-    echo "\
-$0 [OPTION]... PROGRAM [ARGUMENT]...
-
-Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due
-to PROGRAM being missing or too old.
-
-Options:
-  -h, --help      display this help and exit
-  -v, --version   output version information and exit
-
-Supported PROGRAM values:
-  aclocal   autoconf  autoheader   autom4te  automake  makeinfo
-  bison     yacc      flex         lex       help2man
-
-Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and
-'g' are ignored when checking the name.
-
-Send bug reports to <bug-automake at gnu.org>."
-    exit $?
-    ;;
-
-  -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
-    echo "missing $scriptversion (GNU Automake)"
-    exit $?
-    ;;
-
-  -*)
-    echo 1>&2 "$0: unknown '$1' option"
-    echo 1>&2 "Try '$0 --help' for more information"
-    exit 1
-    ;;
-
-esac
-
-# Run the given program, remember its exit status.
-"$@"; st=$?
-
-# If it succeeded, we are done.
-test $st -eq 0 && exit 0
-
-# Also exit now if we it failed (or wasn't found), and '--version' was
-# passed; such an option is passed most likely to detect whether the
-# program is present and works.
-case $2 in --version|--help) exit $st;; esac
-
-# Exit code 63 means version mismatch.  This often happens when the user
-# tries to use an ancient version of a tool on a file that requires a
-# minimum version.
-if test $st -eq 63; then
-  msg="probably too old"
-elif test $st -eq 127; then
-  # Program was missing.
-  msg="missing on your system"
-else
-  # Program was found and executed, but failed.  Give up.
-  exit $st
-fi
-
-perl_URL=http://www.perl.org/
-flex_URL=http://flex.sourceforge.net/
-gnu_software_URL=http://www.gnu.org/software
-
-program_details ()
-{
-  case $1 in
-    aclocal|automake)
-      echo "The '$1' program is part of the GNU Automake package:"
-      echo "<$gnu_software_URL/automake>"
-      echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:"
-      echo "<$gnu_software_URL/autoconf>"
-      echo "<$gnu_software_URL/m4/>"
-      echo "<$perl_URL>"
-      ;;
-    autoconf|autom4te|autoheader)
-      echo "The '$1' program is part of the GNU Autoconf package:"
-      echo "<$gnu_software_URL/autoconf/>"
-      echo "It also requires GNU m4 and Perl in order to run:"
-      echo "<$gnu_software_URL/m4/>"
-      echo "<$perl_URL>"
-      ;;
-  esac
-}
-
-give_advice ()
-{
-  # Normalize program name to check for.
-  normalized_program=`echo "$1" | sed '
-    s/^gnu-//; t
-    s/^gnu//; t
-    s/^g//; t'`
-
-  printf '%s\n' "'$1' is $msg."
-
-  configure_deps="'configure.ac' or m4 files included by 'configure.ac'"
-  case $normalized_program in
-    autoconf*)
-      echo "You should only need it if you modified 'configure.ac',"
-      echo "or m4 files included by it."
-      program_details 'autoconf'
-      ;;
-    autoheader*)
-      echo "You should only need it if you modified 'acconfig.h' or"
-      echo "$configure_deps."
-      program_details 'autoheader'
-      ;;
-    automake*)
-      echo "You should only need it if you modified 'Makefile.am' or"
-      echo "$configure_deps."
-      program_details 'automake'
-      ;;
-    aclocal*)
-      echo "You should only need it if you modified 'acinclude.m4' or"
-      echo "$configure_deps."
-      program_details 'aclocal'
-      ;;
-   autom4te*)
-      echo "You might have modified some maintainer files that require"
-      echo "the 'autom4te' program to be rebuilt."
-      program_details 'autom4te'
-      ;;
-    bison*|yacc*)
-      echo "You should only need it if you modified a '.y' file."
-      echo "You may want to install the GNU Bison package:"
-      echo "<$gnu_software_URL/bison/>"
-      ;;
-    lex*|flex*)
-      echo "You should only need it if you modified a '.l' file."
-      echo "You may want to install the Fast Lexical Analyzer package:"
-      echo "<$flex_URL>"
-      ;;
-    help2man*)
-      echo "You should only need it if you modified a dependency" \
-           "of a man page."
-      echo "You may want to install the GNU Help2man package:"
-      echo "<$gnu_software_URL/help2man/>"
-    ;;
-    makeinfo*)
-      echo "You should only need it if you modified a '.texi' file, or"
-      echo "any other file indirectly affecting the aspect of the manual."
-      echo "You might want to install the Texinfo package:"
-      echo "<$gnu_software_URL/texinfo/>"
-      echo "The spurious makeinfo call might also be the consequence of"
-      echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might"
-      echo "want to install GNU make:"
-      echo "<$gnu_software_URL/make/>"
-      ;;
-    *)
-      echo "You might have modified some files without having the proper"
-      echo "tools for further handling them.  Check the 'README' file, it"
-      echo "often tells you about the needed prerequisites for installing"
-      echo "this package.  You may also peek at any GNU archive site, in"
-      echo "case some other package contains this missing '$1' program."
-      ;;
-  esac
-}
-
-give_advice "$1" | sed -e '1s/^/WARNING: /' \
-                       -e '2,$s/^/         /' >&2
-
-# Propagate the correct exit status (expected to be 127 for a program
-# not found, 63 for a program that failed due to version mismatch).
-exit $st
-
-# Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "scriptversion="
-# time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-time-zone: "UTC"
-# time-stamp-end: "; # UTC"
-# End:
diff --git a/src/Makefile.am b/src/Makefile.am
deleted file mode 100644
index a9b10e6..0000000
--- a/src/Makefile.am
+++ /dev/null
@@ -1,15 +0,0 @@
-if BUILD_MOTIF
-  XBUILD_SUB_MOTIF = mbedit mbnavedit mbvelocitytool mbnavadjust
-endif
-if BUILD_GL
-  XBUILD_SUB_GL = mbview mbgrdviz mbeditviz
-endif
-if BUILD_PROJ
-  XBUILD_SUB_PROJ = proj
-endif
-
-SUBDIRS = $(XBUILD_SUB_PROJ) gsf surf bsio mbio mbaux \
-	utilities gmt otps macros \
-	$(XBUILD_SUB_MOTIF) $(XBUILD_SUB_GL) \
-	man html ps share
-
diff --git a/src/Makefile.in b/src/Makefile.in
deleted file mode 100644
index 574555e..0000000
--- a/src/Makefile.in
+++ /dev/null
@@ -1,650 +0,0 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
-
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
-am__make_running_with_option = \
-  case $${target_option-} in \
-      ?) ;; \
-      *) echo "am__make_running_with_option: internal error: invalid" \
-              "target option '$${target_option-}' specified" >&2; \
-         exit 1;; \
-  esac; \
-  has_opt=no; \
-  sane_makeflags=$$MAKEFLAGS; \
-  if $(am__is_gnu_make); then \
-    sane_makeflags=$$MFLAGS; \
-  else \
-    case $$MAKEFLAGS in \
-      *\\[\ \	]*) \
-        bs=\\; \
-        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
-          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
-    esac; \
-  fi; \
-  skip_next=no; \
-  strip_trailopt () \
-  { \
-    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
-  }; \
-  for flg in $$sane_makeflags; do \
-    test $$skip_next = yes && { skip_next=no; continue; }; \
-    case $$flg in \
-      *=*|--*) continue;; \
-        -*I) strip_trailopt 'I'; skip_next=yes;; \
-      -*I?*) strip_trailopt 'I';; \
-        -*O) strip_trailopt 'O'; skip_next=yes;; \
-      -*O?*) strip_trailopt 'O';; \
-        -*l) strip_trailopt 'l'; skip_next=yes;; \
-      -*l?*) strip_trailopt 'l';; \
-      -[dEDm]) skip_next=yes;; \
-      -[JT]) skip_next=yes;; \
-    esac; \
-    case $$flg in \
-      *$$target_option*) has_opt=yes; break;; \
-    esac; \
-  done; \
-  test $$has_opt = yes
-am__make_dryrun = (target_option=n; $(am__make_running_with_option))
-am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-subdir = src
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
-	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
-	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
-	$(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-	$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/src/mbio/mb_config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-AM_V_P = $(am__v_P_ at AM_V@)
-am__v_P_ = $(am__v_P_ at AM_DEFAULT_V@)
-am__v_P_0 = false
-am__v_P_1 = :
-AM_V_GEN = $(am__v_GEN_ at AM_V@)
-am__v_GEN_ = $(am__v_GEN_ at AM_DEFAULT_V@)
-am__v_GEN_0 = @echo "  GEN     " $@;
-am__v_GEN_1 = 
-AM_V_at = $(am__v_at_ at AM_V@)
-am__v_at_ = $(am__v_at_ at AM_DEFAULT_V@)
-am__v_at_0 = @
-am__v_at_1 = 
-SOURCES =
-DIST_SOURCES =
-RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
-	ctags-recursive dvi-recursive html-recursive info-recursive \
-	install-data-recursive install-dvi-recursive \
-	install-exec-recursive install-html-recursive \
-	install-info-recursive install-pdf-recursive \
-	install-ps-recursive install-recursive installcheck-recursive \
-	installdirs-recursive pdf-recursive ps-recursive \
-	tags-recursive uninstall-recursive
-am__can_run_installinfo = \
-  case $$AM_UPDATE_INFO_DIR in \
-    n|no|NO) false;; \
-    *) (install-info --version) >/dev/null 2>&1;; \
-  esac
-RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
-  distclean-recursive maintainer-clean-recursive
-am__recursive_targets = \
-  $(RECURSIVE_TARGETS) \
-  $(RECURSIVE_CLEAN_TARGETS) \
-  $(am__extra_recursive_targets)
-AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
-	distdir
-am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
-# Read a list of newline-separated strings from the standard input,
-# and print each of them once, without duplicates.  Input order is
-# *not* preserved.
-am__uniquify_input = $(AWK) '\
-  BEGIN { nonempty = 0; } \
-  { items[$$0] = 1; nonempty = 1; } \
-  END { if (nonempty) { for (i in items) print i; }; } \
-'
-# Make sure the list of sources is unique.  This is necessary because,
-# e.g., the same source file might be shared among _SOURCES variables
-# for different programs/libraries.
-am__define_uniq_tagged_files = \
-  list='$(am__tagged_files)'; \
-  unique=`for i in $$list; do \
-    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-  done | $(am__uniquify_input)`
-ETAGS = etags
-CTAGS = ctags
-DIST_SUBDIRS = proj gsf surf bsio mbio mbaux utilities gmt otps macros \
-	mbedit mbnavedit mbvelocitytool mbnavadjust mbview mbgrdviz \
-	mbeditviz man html ps share
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-am__relativize = \
-  dir0=`pwd`; \
-  sed_first='s,^\([^/]*\)/.*$$,\1,'; \
-  sed_rest='s,^[^/]*/*,,'; \
-  sed_last='s,^.*/\([^/]*\)$$,\1,'; \
-  sed_butlast='s,/*[^/]*$$,,'; \
-  while test -n "$$dir1"; do \
-    first=`echo "$$dir1" | sed -e "$$sed_first"`; \
-    if test "$$first" != "."; then \
-      if test "$$first" = ".."; then \
-        dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
-        dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
-      else \
-        first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
-        if test "$$first2" = "$$first"; then \
-          dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
-        else \
-          dir2="../$$dir2"; \
-        fi; \
-        dir0="$$dir0"/"$$first"; \
-      fi; \
-    fi; \
-    dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
-  done; \
-  reldir="$$dir2"
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-CC = @CC@
-CCAS = @CCAS@
-CCASDEPMODE = @CCASDEPMODE@
-CCASFLAGS = @CCASFLAGS@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DLLTOOL = @DLLTOOL@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GREP = @GREP@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBM = @LIBM@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIBTOOL_DEPS = @LIBTOOL_DEPS@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LTLIBOBJS = @LTLIBOBJS@
-LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
-MAINT = @MAINT@
-MAKEINFO = @MAKEINFO@
-MANIFEST_TOOL = @MANIFEST_TOOL@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-OTPS_DIR = @OTPS_DIR@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_URL = @PACKAGE_URL@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PKG_CONFIG = @PKG_CONFIG@
-PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
-PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-VERSION = @VERSION@
-XDR_LIB = @XDR_LIB@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_AR = @ac_ct_AR@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-fftw_app = @fftw_app@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libGLU_CFLAGS = @libGLU_CFLAGS@
-libGLU_LIBS = @libGLU_LIBS@
-libXm_CFLAGS = @libXm_CFLAGS@
-libXm_LIBS = @libXm_LIBS@
-libdir = @libdir@
-libexecdir = @libexecdir@
-libfftw3_CFLAGS = @libfftw3_CFLAGS@
-libfftw3_LIBS = @libfftw3_LIBS@
-libfftw_CPPFLAGS = @libfftw_CPPFLAGS@
-libfftw_LIBS = @libfftw_LIBS@
-libgmt_CFLAGS = @libgmt_CFLAGS@
-libgmt_CPPFLAGS = @libgmt_CPPFLAGS@
-libgmt_LIBS = @libgmt_LIBS@
-libmotif_CPPFLAGS = @libmotif_CPPFLAGS@
-libmotif_LIBS = @libmotif_LIBS@
-libnetcdf_CFLAGS = @libnetcdf_CFLAGS@
-libnetcdf_CPPFLAGS = @libnetcdf_CPPFLAGS@
-libnetcdf_LIBS = @libnetcdf_LIBS@
-libopengl_CPPFLAGS = @libopengl_CPPFLAGS@
-libopengl_LIBS = @libopengl_LIBS@
-libproj_CFLAGS = @libproj_CFLAGS@
-libproj_CPPFLAGS = @libproj_CPPFLAGS@
-libproj_LIBS = @libproj_LIBS@
-libpsl_CFLAGS = @libpsl_CFLAGS@
-libpsl_LIBS = @libpsl_LIBS@
-localedir = @localedir@
-localstatedir = @localstatedir@
-mandir = @mandir@
-mbsystemdatadir = @mbsystemdatadir@
-mbsystemhtmldir = @mbsystemhtmldir@
-mbsystempsdir = @mbsystempsdir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
- at BUILD_MOTIF_TRUE@XBUILD_SUB_MOTIF = mbedit mbnavedit mbvelocitytool mbnavadjust
- at BUILD_GL_TRUE@XBUILD_SUB_GL = mbview mbgrdviz mbeditviz
- at BUILD_PROJ_TRUE@XBUILD_SUB_PROJ = proj
-SUBDIRS = $(XBUILD_SUB_PROJ) gsf surf bsio mbio mbaux \
-	utilities gmt otps macros \
-	$(XBUILD_SUB_MOTIF) $(XBUILD_SUB_GL) \
-	man html ps share
-
-all: all-recursive
-
-.SUFFIXES:
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
-	@for dep in $?; do \
-	  case '$(am__configure_deps)' in \
-	    *$$dep*) \
-	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-	        && { if test -f $@; then exit 0; else break; fi; }; \
-	      exit 1;; \
-	  esac; \
-	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \
-	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --gnu src/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	@case '$?' in \
-	  *config.status*) \
-	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-	esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-
-mostlyclean-libtool:
-	-rm -f *.lo
-
-clean-libtool:
-	-rm -rf .libs _libs
-
-# This directory's subdirectories are mostly independent; you can cd
-# into them and run 'make' without going through this Makefile.
-# To change the values of 'make' variables: instead of editing Makefiles,
-# (1) if the variable is set in 'config.status', edit 'config.status'
-#     (which will cause the Makefiles to be regenerated when you run 'make');
-# (2) otherwise, pass the desired values on the 'make' command line.
-$(am__recursive_targets):
-	@fail=; \
-	if $(am__make_keepgoing); then \
-	  failcom='fail=yes'; \
-	else \
-	  failcom='exit 1'; \
-	fi; \
-	dot_seen=no; \
-	target=`echo $@ | sed s/-recursive//`; \
-	case "$@" in \
-	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
-	  *) list='$(SUBDIRS)' ;; \
-	esac; \
-	for subdir in $$list; do \
-	  echo "Making $$target in $$subdir"; \
-	  if test "$$subdir" = "."; then \
-	    dot_seen=yes; \
-	    local_target="$$target-am"; \
-	  else \
-	    local_target="$$target"; \
-	  fi; \
-	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
-	  || eval $$failcom; \
-	done; \
-	if test "$$dot_seen" = "no"; then \
-	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
-	fi; test -z "$$fail"
-
-ID: $(am__tagged_files)
-	$(am__define_uniq_tagged_files); mkid -fID $$unique
-tags: tags-recursive
-TAGS: tags
-
-tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
-	set x; \
-	here=`pwd`; \
-	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
-	  include_option=--etags-include; \
-	  empty_fix=.; \
-	else \
-	  include_option=--include; \
-	  empty_fix=; \
-	fi; \
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
-	    test ! -f $$subdir/TAGS || \
-	      set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
-	  fi; \
-	done; \
-	$(am__define_uniq_tagged_files); \
-	shift; \
-	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
-	  test -n "$$unique" || unique=$$empty_fix; \
-	  if test $$# -gt 0; then \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      "$$@" $$unique; \
-	  else \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      $$unique; \
-	  fi; \
-	fi
-ctags: ctags-recursive
-
-CTAGS: ctags
-ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
-	$(am__define_uniq_tagged_files); \
-	test -z "$(CTAGS_ARGS)$$unique" \
-	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$unique
-
-GTAGS:
-	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && $(am__cd) $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) "$$here"
-cscopelist: cscopelist-recursive
-
-cscopelist-am: $(am__tagged_files)
-	list='$(am__tagged_files)'; \
-	case "$(srcdir)" in \
-	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
-	  *) sdir=$(subdir)/$(srcdir) ;; \
-	esac; \
-	for i in $$list; do \
-	  if test -f "$$i"; then \
-	    echo "$(subdir)/$$i"; \
-	  else \
-	    echo "$$sdir/$$i"; \
-	  fi; \
-	done >> $(top_builddir)/cscope.files
-
-distclean-tags:
-	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	list='$(DISTFILES)'; \
-	  dist_files=`for file in $$list; do echo $$file; done | \
-	  sed -e "s|^$$srcdirstrip/||;t" \
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
-	case $$dist_files in \
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
-			   sort -u` ;; \
-	esac; \
-	for file in $$dist_files; do \
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  if test -d $$d/$$file; then \
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
-	    if test -d "$(distdir)/$$file"; then \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
-	  else \
-	    test -f "$(distdir)/$$file" \
-	    || cp -p $$d/$$file "$(distdir)/$$file" \
-	    || exit 1; \
-	  fi; \
-	done
-	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
-	    $(am__make_dryrun) \
-	      || test -d "$(distdir)/$$subdir" \
-	      || $(MKDIR_P) "$(distdir)/$$subdir" \
-	      || exit 1; \
-	    dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
-	    $(am__relativize); \
-	    new_distdir=$$reldir; \
-	    dir1=$$subdir; dir2="$(top_distdir)"; \
-	    $(am__relativize); \
-	    new_top_distdir=$$reldir; \
-	    echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
-	    echo "     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
-	    ($(am__cd) $$subdir && \
-	      $(MAKE) $(AM_MAKEFLAGS) \
-	        top_distdir="$$new_top_distdir" \
-	        distdir="$$new_distdir" \
-		am__remove_distdir=: \
-		am__skip_length_check=: \
-		am__skip_mode_fix=: \
-	        distdir) \
-	      || exit 1; \
-	  fi; \
-	done
-check-am: all-am
-check: check-recursive
-all-am: Makefile
-installdirs: installdirs-recursive
-installdirs-am:
-install: install-recursive
-install-exec: install-exec-recursive
-install-data: install-data-recursive
-uninstall: uninstall-recursive
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-recursive
-install-strip:
-	if test -z '$(STRIP)'; then \
-	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	      install; \
-	else \
-	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
-	fi
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
-	@echo "This command is intended for maintainers to use"
-	@echo "it deletes files that may require special tools to rebuild."
-clean: clean-recursive
-
-clean-am: clean-generic clean-libtool mostlyclean-am
-
-distclean: distclean-recursive
-	-rm -f Makefile
-distclean-am: clean-am distclean-generic distclean-tags
-
-dvi: dvi-recursive
-
-dvi-am:
-
-html: html-recursive
-
-html-am:
-
-info: info-recursive
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-recursive
-
-install-dvi-am:
-
-install-exec-am:
-
-install-html: install-html-recursive
-
-install-html-am:
-
-install-info: install-info-recursive
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-recursive
-
-install-pdf-am:
-
-install-ps: install-ps-recursive
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-recursive
-	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-recursive
-
-mostlyclean-am: mostlyclean-generic mostlyclean-libtool
-
-pdf: pdf-recursive
-
-pdf-am:
-
-ps: ps-recursive
-
-ps-am:
-
-uninstall-am:
-
-.MAKE: $(am__recursive_targets) install-am install-strip
-
-.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \
-	check-am clean clean-generic clean-libtool cscopelist-am ctags \
-	ctags-am distclean distclean-generic distclean-libtool \
-	distclean-tags distdir dvi dvi-am html html-am info info-am \
-	install install-am install-data install-data-am install-dvi \
-	install-dvi-am install-exec install-exec-am install-html \
-	install-html-am install-info install-info-am install-man \
-	install-pdf install-pdf-am install-ps install-ps-am \
-	install-strip installcheck installcheck-am installdirs \
-	installdirs-am maintainer-clean maintainer-clean-generic \
-	mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
-	ps ps-am tags tags-am uninstall uninstall-am
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/bsio/Makefile.am b/src/bsio/Makefile.am
deleted file mode 100644
index ab8ac07..0000000
--- a/src/bsio/Makefile.am
+++ /dev/null
@@ -1,16 +0,0 @@
-AM_CPPFLAGS = -I${top_srcdir}/src/mbio
-
-include_HEADERS = mbbs.h mbbs_defines.h mbbs_mem.h
-
-lib_LTLIBRARIES = libmbbsio.la
-
-libmbbsio_la_LDFLAGS = -no-undefined -version-info 0:0:0
-
-libmbbsio_la_LIBADD = ${XDR_LIB}
-
-libmbbsio_la_SOURCES = mbbs_io.c mbbs_iomrv1.c \
-                        mbbs_iomrv2.c mbbs_memalloc.c \
-                        mbbs_misc.c mbbs_swapbytes.c \
-                        mbbs_tm.c mbbs_utils.c \
-                        mbbs_wrhdrfields.c mbbs_wrsampflags.c
-
diff --git a/src/bsio/Makefile.in b/src/bsio/Makefile.in
deleted file mode 100644
index 8f791fd..0000000
--- a/src/bsio/Makefile.in
+++ /dev/null
@@ -1,713 +0,0 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
-
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-
-
-VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
-am__make_running_with_option = \
-  case $${target_option-} in \
-      ?) ;; \
-      *) echo "am__make_running_with_option: internal error: invalid" \
-              "target option '$${target_option-}' specified" >&2; \
-         exit 1;; \
-  esac; \
-  has_opt=no; \
-  sane_makeflags=$$MAKEFLAGS; \
-  if $(am__is_gnu_make); then \
-    sane_makeflags=$$MFLAGS; \
-  else \
-    case $$MAKEFLAGS in \
-      *\\[\ \	]*) \
-        bs=\\; \
-        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
-          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
-    esac; \
-  fi; \
-  skip_next=no; \
-  strip_trailopt () \
-  { \
-    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
-  }; \
-  for flg in $$sane_makeflags; do \
-    test $$skip_next = yes && { skip_next=no; continue; }; \
-    case $$flg in \
-      *=*|--*) continue;; \
-        -*I) strip_trailopt 'I'; skip_next=yes;; \
-      -*I?*) strip_trailopt 'I';; \
-        -*O) strip_trailopt 'O'; skip_next=yes;; \
-      -*O?*) strip_trailopt 'O';; \
-        -*l) strip_trailopt 'l'; skip_next=yes;; \
-      -*l?*) strip_trailopt 'l';; \
-      -[dEDm]) skip_next=yes;; \
-      -[JT]) skip_next=yes;; \
-    esac; \
-    case $$flg in \
-      *$$target_option*) has_opt=yes; break;; \
-    esac; \
-  done; \
-  test $$has_opt = yes
-am__make_dryrun = (target_option=n; $(am__make_running_with_option))
-am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-subdir = src/bsio
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/depcomp $(include_HEADERS)
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
-	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
-	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
-	$(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-	$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/src/mbio/mb_config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
-am__vpath_adj = case $$p in \
-    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
-    *) f=$$p;; \
-  esac;
-am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
-am__install_max = 40
-am__nobase_strip_setup = \
-  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
-am__nobase_strip = \
-  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
-am__nobase_list = $(am__nobase_strip_setup); \
-  for p in $$list; do echo "$$p $$p"; done | \
-  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
-  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
-    if (++n[$$2] == $(am__install_max)) \
-      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
-    END { for (dir in files) print dir, files[dir] }'
-am__base_list = \
-  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
-  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
-am__uninstall_files_from_dir = { \
-  test -z "$$files" \
-    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
-    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
-         $(am__cd) "$$dir" && rm -f $$files; }; \
-  }
-am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includedir)"
-LTLIBRARIES = $(lib_LTLIBRARIES)
-am__DEPENDENCIES_1 =
-libmbbsio_la_DEPENDENCIES = $(am__DEPENDENCIES_1)
-am_libmbbsio_la_OBJECTS = mbbs_io.lo mbbs_iomrv1.lo mbbs_iomrv2.lo \
-	mbbs_memalloc.lo mbbs_misc.lo mbbs_swapbytes.lo mbbs_tm.lo \
-	mbbs_utils.lo mbbs_wrhdrfields.lo mbbs_wrsampflags.lo
-libmbbsio_la_OBJECTS = $(am_libmbbsio_la_OBJECTS)
-AM_V_lt = $(am__v_lt_ at AM_V@)
-am__v_lt_ = $(am__v_lt_ at AM_DEFAULT_V@)
-am__v_lt_0 = --silent
-am__v_lt_1 = 
-libmbbsio_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
-	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
-	$(libmbbsio_la_LDFLAGS) $(LDFLAGS) -o $@
-AM_V_P = $(am__v_P_ at AM_V@)
-am__v_P_ = $(am__v_P_ at AM_DEFAULT_V@)
-am__v_P_0 = false
-am__v_P_1 = :
-AM_V_GEN = $(am__v_GEN_ at AM_V@)
-am__v_GEN_ = $(am__v_GEN_ at AM_DEFAULT_V@)
-am__v_GEN_0 = @echo "  GEN     " $@;
-am__v_GEN_1 = 
-AM_V_at = $(am__v_at_ at AM_V@)
-am__v_at_ = $(am__v_at_ at AM_DEFAULT_V@)
-am__v_at_0 = @
-am__v_at_1 = 
-DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)/src/mbio
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
-am__mv = mv -f
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
-	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
-	$(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
-	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
-	$(AM_CFLAGS) $(CFLAGS)
-AM_V_CC = $(am__v_CC_ at AM_V@)
-am__v_CC_ = $(am__v_CC_ at AM_DEFAULT_V@)
-am__v_CC_0 = @echo "  CC      " $@;
-am__v_CC_1 = 
-CCLD = $(CC)
-LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
-	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
-	$(AM_LDFLAGS) $(LDFLAGS) -o $@
-AM_V_CCLD = $(am__v_CCLD_ at AM_V@)
-am__v_CCLD_ = $(am__v_CCLD_ at AM_DEFAULT_V@)
-am__v_CCLD_0 = @echo "  CCLD    " $@;
-am__v_CCLD_1 = 
-SOURCES = $(libmbbsio_la_SOURCES)
-DIST_SOURCES = $(libmbbsio_la_SOURCES)
-am__can_run_installinfo = \
-  case $$AM_UPDATE_INFO_DIR in \
-    n|no|NO) false;; \
-    *) (install-info --version) >/dev/null 2>&1;; \
-  esac
-HEADERS = $(include_HEADERS)
-am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
-# Read a list of newline-separated strings from the standard input,
-# and print each of them once, without duplicates.  Input order is
-# *not* preserved.
-am__uniquify_input = $(AWK) '\
-  BEGIN { nonempty = 0; } \
-  { items[$$0] = 1; nonempty = 1; } \
-  END { if (nonempty) { for (i in items) print i; }; } \
-'
-# Make sure the list of sources is unique.  This is necessary because,
-# e.g., the same source file might be shared among _SOURCES variables
-# for different programs/libraries.
-am__define_uniq_tagged_files = \
-  list='$(am__tagged_files)'; \
-  unique=`for i in $$list; do \
-    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-  done | $(am__uniquify_input)`
-ETAGS = etags
-CTAGS = ctags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-CC = @CC@
-CCAS = @CCAS@
-CCASDEPMODE = @CCASDEPMODE@
-CCASFLAGS = @CCASFLAGS@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DLLTOOL = @DLLTOOL@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GREP = @GREP@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBM = @LIBM@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIBTOOL_DEPS = @LIBTOOL_DEPS@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LTLIBOBJS = @LTLIBOBJS@
-LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
-MAINT = @MAINT@
-MAKEINFO = @MAKEINFO@
-MANIFEST_TOOL = @MANIFEST_TOOL@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-OTPS_DIR = @OTPS_DIR@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_URL = @PACKAGE_URL@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PKG_CONFIG = @PKG_CONFIG@
-PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
-PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-VERSION = @VERSION@
-XDR_LIB = @XDR_LIB@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_AR = @ac_ct_AR@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-fftw_app = @fftw_app@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libGLU_CFLAGS = @libGLU_CFLAGS@
-libGLU_LIBS = @libGLU_LIBS@
-libXm_CFLAGS = @libXm_CFLAGS@
-libXm_LIBS = @libXm_LIBS@
-libdir = @libdir@
-libexecdir = @libexecdir@
-libfftw3_CFLAGS = @libfftw3_CFLAGS@
-libfftw3_LIBS = @libfftw3_LIBS@
-libfftw_CPPFLAGS = @libfftw_CPPFLAGS@
-libfftw_LIBS = @libfftw_LIBS@
-libgmt_CFLAGS = @libgmt_CFLAGS@
-libgmt_CPPFLAGS = @libgmt_CPPFLAGS@
-libgmt_LIBS = @libgmt_LIBS@
-libmotif_CPPFLAGS = @libmotif_CPPFLAGS@
-libmotif_LIBS = @libmotif_LIBS@
-libnetcdf_CFLAGS = @libnetcdf_CFLAGS@
-libnetcdf_CPPFLAGS = @libnetcdf_CPPFLAGS@
-libnetcdf_LIBS = @libnetcdf_LIBS@
-libopengl_CPPFLAGS = @libopengl_CPPFLAGS@
-libopengl_LIBS = @libopengl_LIBS@
-libproj_CFLAGS = @libproj_CFLAGS@
-libproj_CPPFLAGS = @libproj_CPPFLAGS@
-libproj_LIBS = @libproj_LIBS@
-libpsl_CFLAGS = @libpsl_CFLAGS@
-libpsl_LIBS = @libpsl_LIBS@
-localedir = @localedir@
-localstatedir = @localstatedir@
-mandir = @mandir@
-mbsystemdatadir = @mbsystemdatadir@
-mbsystemhtmldir = @mbsystemhtmldir@
-mbsystempsdir = @mbsystempsdir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-AM_CPPFLAGS = -I${top_srcdir}/src/mbio
-include_HEADERS = mbbs.h mbbs_defines.h mbbs_mem.h
-lib_LTLIBRARIES = libmbbsio.la
-libmbbsio_la_LDFLAGS = -no-undefined -version-info 0:0:0
-libmbbsio_la_LIBADD = ${XDR_LIB}
-libmbbsio_la_SOURCES = mbbs_io.c mbbs_iomrv1.c \
-                        mbbs_iomrv2.c mbbs_memalloc.c \
-                        mbbs_misc.c mbbs_swapbytes.c \
-                        mbbs_tm.c mbbs_utils.c \
-                        mbbs_wrhdrfields.c mbbs_wrsampflags.c
-
-all: all-am
-
-.SUFFIXES:
-.SUFFIXES: .c .lo .o .obj
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
-	@for dep in $?; do \
-	  case '$(am__configure_deps)' in \
-	    *$$dep*) \
-	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-	        && { if test -f $@; then exit 0; else break; fi; }; \
-	      exit 1;; \
-	  esac; \
-	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/bsio/Makefile'; \
-	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --gnu src/bsio/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	@case '$?' in \
-	  *config.status*) \
-	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-	esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-
-install-libLTLIBRARIES: $(lib_LTLIBRARIES)
-	@$(NORMAL_INSTALL)
-	@list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
-	list2=; for p in $$list; do \
-	  if test -f $$p; then \
-	    list2="$$list2 $$p"; \
-	  else :; fi; \
-	done; \
-	test -z "$$list2" || { \
-	  echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \
-	  $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \
-	}
-
-uninstall-libLTLIBRARIES:
-	@$(NORMAL_UNINSTALL)
-	@list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
-	for p in $$list; do \
-	  $(am__strip_dir) \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \
-	done
-
-clean-libLTLIBRARIES:
-	-test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
-	@list='$(lib_LTLIBRARIES)'; \
-	locs=`for p in $$list; do echo $$p; done | \
-	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
-	      sort -u`; \
-	test -z "$$locs" || { \
-	  echo rm -f $${locs}; \
-	  rm -f $${locs}; \
-	}
-
-libmbbsio.la: $(libmbbsio_la_OBJECTS) $(libmbbsio_la_DEPENDENCIES) $(EXTRA_libmbbsio_la_DEPENDENCIES) 
-	$(AM_V_CCLD)$(libmbbsio_la_LINK) -rpath $(libdir) $(libmbbsio_la_OBJECTS) $(libmbbsio_la_LIBADD) $(LIBS)
-
-mostlyclean-compile:
-	-rm -f *.$(OBJEXT)
-
-distclean-compile:
-	-rm -f *.tab.c
-
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbbs_io.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbbs_iomrv1.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbbs_iomrv2.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbbs_memalloc.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbbs_misc.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbbs_swapbytes.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbbs_tm.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbbs_utils.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbbs_wrhdrfields.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbbs_wrsampflags.Plo at am__quote@
-
-.c.o:
- at am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(COMPILE) -c -o $@ $<
-
-.c.obj:
- at am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
- at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-
-.c.lo:
- at am__fastdepCC_TRUE@	$(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(LTCOMPILE) -c -o $@ $<
-
-mostlyclean-libtool:
-	-rm -f *.lo
-
-clean-libtool:
-	-rm -rf .libs _libs
-install-includeHEADERS: $(include_HEADERS)
-	@$(NORMAL_INSTALL)
-	@list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \
-	if test -n "$$list"; then \
-	  echo " $(MKDIR_P) '$(DESTDIR)$(includedir)'"; \
-	  $(MKDIR_P) "$(DESTDIR)$(includedir)" || exit 1; \
-	fi; \
-	for p in $$list; do \
-	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
-	  echo "$$d$$p"; \
-	done | $(am__base_list) | \
-	while read files; do \
-	  echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includedir)'"; \
-	  $(INSTALL_HEADER) $$files "$(DESTDIR)$(includedir)" || exit $$?; \
-	done
-
-uninstall-includeHEADERS:
-	@$(NORMAL_UNINSTALL)
-	@list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \
-	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
-	dir='$(DESTDIR)$(includedir)'; $(am__uninstall_files_from_dir)
-
-ID: $(am__tagged_files)
-	$(am__define_uniq_tagged_files); mkid -fID $$unique
-tags: tags-am
-TAGS: tags
-
-tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
-	set x; \
-	here=`pwd`; \
-	$(am__define_uniq_tagged_files); \
-	shift; \
-	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
-	  test -n "$$unique" || unique=$$empty_fix; \
-	  if test $$# -gt 0; then \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      "$$@" $$unique; \
-	  else \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      $$unique; \
-	  fi; \
-	fi
-ctags: ctags-am
-
-CTAGS: ctags
-ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
-	$(am__define_uniq_tagged_files); \
-	test -z "$(CTAGS_ARGS)$$unique" \
-	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$unique
-
-GTAGS:
-	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && $(am__cd) $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) "$$here"
-cscopelist: cscopelist-am
-
-cscopelist-am: $(am__tagged_files)
-	list='$(am__tagged_files)'; \
-	case "$(srcdir)" in \
-	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
-	  *) sdir=$(subdir)/$(srcdir) ;; \
-	esac; \
-	for i in $$list; do \
-	  if test -f "$$i"; then \
-	    echo "$(subdir)/$$i"; \
-	  else \
-	    echo "$$sdir/$$i"; \
-	  fi; \
-	done >> $(top_builddir)/cscope.files
-
-distclean-tags:
-	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	list='$(DISTFILES)'; \
-	  dist_files=`for file in $$list; do echo $$file; done | \
-	  sed -e "s|^$$srcdirstrip/||;t" \
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
-	case $$dist_files in \
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
-			   sort -u` ;; \
-	esac; \
-	for file in $$dist_files; do \
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  if test -d $$d/$$file; then \
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
-	    if test -d "$(distdir)/$$file"; then \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
-	  else \
-	    test -f "$(distdir)/$$file" \
-	    || cp -p $$d/$$file "$(distdir)/$$file" \
-	    || exit 1; \
-	  fi; \
-	done
-check-am: all-am
-check: check-am
-all-am: Makefile $(LTLIBRARIES) $(HEADERS)
-installdirs:
-	for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includedir)"; do \
-	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
-	done
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
-	if test -z '$(STRIP)'; then \
-	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	      install; \
-	else \
-	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
-	fi
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
-	@echo "This command is intended for maintainers to use"
-	@echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \
-	mostlyclean-am
-
-distclean: distclean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
-	distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am: install-includeHEADERS
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am: install-libLTLIBRARIES
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic \
-	mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am: uninstall-includeHEADERS uninstall-libLTLIBRARIES
-
-.MAKE: install-am install-strip
-
-.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
-	clean-libLTLIBRARIES clean-libtool cscopelist-am ctags \
-	ctags-am distclean distclean-compile distclean-generic \
-	distclean-libtool distclean-tags distdir dvi dvi-am html \
-	html-am info info-am install install-am install-data \
-	install-data-am install-dvi install-dvi-am install-exec \
-	install-exec-am install-html install-html-am \
-	install-includeHEADERS install-info install-info-am \
-	install-libLTLIBRARIES install-man install-pdf install-pdf-am \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-compile \
-	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-	tags tags-am uninstall uninstall-am uninstall-includeHEADERS \
-	uninstall-libLTLIBRARIES
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/bsio/bs.3 b/src/bsio/bs.3
deleted file mode 100644
index 313b6d4..0000000
--- a/src/bsio/bs.3
+++ /dev/null
@@ -1,684 +0,0 @@
-.TH BS 3 "13 February 2012"
-.SH NAME
-BS \- BS file data library
-.SH DESCRIPTION
-.LP
-/usr/lib/libbs.a is a collection of functions which allow a programmer to
-manipulate Hawaii Mapping Research Group (HMRG) BS data files.
-.SH USAGE
-.LP
-Following is a description of all available subroutines in the BS library.
-An application referencing any of these routines must be linked to the
-library at compile time by specifying the \fB-lbs\fR flag. The memory
-allocation library may also need to be referenced via the \fB-lmem\fR flag
-if the application calls certain of the routines described below.
-.LP
-Most of the subroutines described below which return an integer will return
-either \fB\s-1BS_SUCCESS\s0\fR or a defined failure code such as
-\fB\s-1BS_READ\s0\fR, \fB\s-1BS_MEMALLOC\s0\fR, etc. (See \fB\s-1ERROR
-CODES\s0\fR below.) Return values for all other functions will be
-explicitly described.
-.LP
-Many of the subroutines which relate to input or output require a pointer
-to an open XDR stream as one of the arguments. Such a stream will generally
-be obtained by calling \fBxdrstdio_create()\fR on an open file pointer.
-All of the input functions assume that the XDR stream is appropriately
-positioned at the time of the function call, e.g., a function which
-attempts to read a particular type of header will succeed only if the XDR
-stream is currently positioned at the beginning of such a header.
-.LP
-Note that the file reading functions described below are capable of reading
-files stored in certain obsolete versions of the file format as well as
-files stored in the current format. The file writing functions, however,
-will always write output files in the current format regardless of the
-value of the \fBbsf_version\fR field of the file header which defines
-the format version.
-.sp 6p
-\fB#include <rpc/rpc.h>\fR
-.br
-\fB#include <sys/time.h>\fR
-.br
-\fB#include <sys/ipc.h>\fR
-.br
-\fB#include <sys/shm.h>\fR
-.br
-\fB#include <local/bs.h>\fR
-.sp 6p
-\fBint
-.br
-bs_rdbsfhdr(BSFile *\fIbsf\fB, XDR *\fIxdrs\fB)\fR
-.sp 2p
-reads the next BS file header from the XDR input stream \fIxdrs\fR and
-stores it into the user-allocated structure \fIbsf\fR.
-.sp 6p
-\fBint
-.br
-bs_wrbsfhdr(BSFile *\fIbsf \fB, XDR *\fIxdrs\fB)\fR
-.sp 2p
-writes the BS file header \fIbsf\fR to the XDR output stream \fIxdrs\fR.
-.sp 6p
-\fBint
-.br
-bs_freebsfmem(BSFile *\fIbsf\fB)\fR
-.sp 2p
-frees all memory referenced by the structure members of \fIbsf\fR which
-was allocated by \fBbs_rdbsfhdr()\fR. It does not free the memory
-addressed by \fIbsf\fR itself. The function should generally be used
-between successive calls to \fBbs_rdbsfhdr()\fR.
-.sp 6p
-\fBint
-.br
-bs_rdversion(FILE *\fIfp\fB, int \fI*version\fB)\fR
-.sp 2p
-reads the file format version of \fIfp\fR and stores it into \fIversion\fR.
-The function should be called only with \fIfp\fR at the very beginning of
-the input stream, which in this case is a file pointer rather than the
-more common XDR stream. It is normally used only when an application needs
-to determine the format version of a dataset and no subsequent reading is
-intended. Nearly all callers should instead use \fBbs_rdbsfhdr()\fR as
-described above to read the entire BS file header (including the format
-version) and leave the input stream positioned in a more useful location,
-i.e., at the beginning of the first ping header.
-.sp 6p
-\fBint
-.br
-bs_rdpnghdr(Ping *\fIpng\fB, XDR *\fIxdrs\fB, int \fIversion\fB)\fR
-.sp 2p
-reads the next BS ping header from the XDR input stream \fIxdrs\fR and
-stores it into the user-allocated structure \fIpng\fR. The version of the
-file format being read must be indicated by \fIversion\fR, which should
-normally be the value of the \fIbsf_version\fR field of the input file's
-file header record.
-.sp 6p
-\fBint
-.br
-bs_wrpnghdr(Ping *\fIpng\fB, XDR *\fIxdrs\fB)\fR
-.sp 2p
-writes the ping header \fIpng\fR to the XDR output stream \fIxdrs\fR.
-.sp 6p
-\fBint
-.br
-bs_pngdatabufsz(Ping *\fIpng\fB, unsigned long long *\fIpngsz\fB)\fR
-.sp 2p
-writes into \fIpngsz\fR the size in bytes of the smallest buffer capable
-of holding the various data (e.g., sensor, bathymetry, sidescan, auxiliary
-beam information, etc.) associated with \fIpng\fR. The function itself
-returns \fB\s-1BS_SUCCESS\s0\fR or an error code in the event that a valid
-buffer size cannot be determined due to negative or otherwise invalid sample
-count values as described by \fIpng\fR. A reasonable (but possibly not
-airtight and definitely not precise) effort is made to guard against pings
-with overly large sample counts, as the original format implementation
-implicitly limited the maximum ping buffer size to be no greater than the
-number of bytes which could be described by a signed 32-bit integer, i.e.,
-\fB\s-1BS_MAXSIGNEDINT32\s0\fR (2147483647). This routine has been coded to
-enforce that limitation, but will attempt if possible to determine the
-actual size of a ping buffer even when it would be greater than this limit.
-In any case where the size of the ping is known to be over the limit, or it
-is believed that it might be over the limit under circumstances which
-diminish the precision of the size computation due to overflow issues, the
-function will return \fB\s-1BS_HUGEPING\s0\fR. In such cases the value
-written into \fIpngsz\fR will be accurate if and only if the host
-architecture supports 8-byte (or larger) unsigned long long integers.
-.sp 6p
-\fBMemType *
-.br
-bs_pngmemalloc(Ping *\fIpng\fB)\fR
-.sp 2p
-allocates enough memory to store the data associated with the ping
-header \fIpng\fR. A pointer to the allocated memory is returned. (The
-pointer may be a null pointer if the function fails for any reason.)
-The quantity of memory allocated is dependent upon the number of data
-samples and padding samples indicated by \fIpng\fR. Padding samples,
-i.e., meaningless placeholder samples that are immediately contiguous and
-subsequent to valid data samples, are never stored to files, but it is 
-sometimes convenient to allocate this additional sample memory at the
-time a ping is read in order to perform an operation that may result
-in an increase in the number of meaningful samples associated with that
-ping. An arbitrary amount of such additional memory can be allocated with
-this function by setting \fIpng\(->\fBpng_snspad\fR and the \fBps_btypad\fR
-and \fBps_sspad\fR fields of the \fIpng\(->\fBpng_sides[\s-1ACP_PORT\s0]\fR and
-\fIpng\(->\fBpng_sides[\s-1ACP_STBD\s0]\fR substructures to appropriate values
-before the function is called.
-.sp 6p
-\fBint
-.br
-bs_pngrealloc(Ping *\fIpng\fB, MemType **\fIdata\fB, unsigned int *\fIdatasz)\fR
-.sp 2p
-allocates memory similarly to \fBbs_pngmemalloc()\fR as described above but
-is generally more convenient to use. Its second and third arguments are the
-addresses of a buffer pointer and an integer describing the size of the
-buffer. The buffer pointer and the integer should be set to the null pointer
-and 0, respectively, before the first call to this routine. Each time the
-routine is called it will determine the smallest buffer size sufficient to hold
-the data samples and padding samples indicated by \fIpng\fR. If the buffer
-pointed to by *\fIdata\fR is large enough (as described by *\fIdatasz\fR) to
-hold those samples then it is zeroed and nothing else is done, otherwise the
-existing buffer (if any) is freed, a new buffer is allocated, and *\fIdata\fR
-and *\fIdatasz\fR are updated to reflect the new buffer and its size. Note
-that, unlike \fBbs_pngmemalloc()\fR, the return value of this function is an
-error code (e.g., \fB\s-1BS_SUCCESS\s0\fR) and not a pointer to the buffer.
-.sp 6p
-\fBint
-.br
-bs_rdpngdata(Ping *\fIpng\fB, MemType *\fIdata\fB, XDR *\fIxdrs\fB)\fR
-.sp 2p
-reads ping data from the XDR input stream \fIxdrs\fR and stores it
-into the memory pointed to by \fIdata\fR. The number of data samples to be
-read is obtained from the header structure \fIpng\fR. This routine assumes
-that the \fIdata\fR memory has already been allocated (e.g., by
-\fBbs_pngrealloc()\fR). Note that each bathymetry sample consists of either
-two or three consecutive floating point values depending upon the value of
-\fI\%png\(->\fBpng_flags\fR. If the \fB\s-1PNG_XYZ\s0\fR bit of the latter is
-set then each sample is an x/y/z triplet with the first value representing
-across-track distance, the second value representing along-track distance
-and the third value representing depth. If the \fB\s-1PNG_XYZ\s0\fR bit is
-not set then the data are in x/z format, i.e., the along-track distance is
-not present. Compass samples are read and stored into the first
-\fIpng\(->\fBpng_compass.sns_nsamps*sizeof(float)\fR bytes of \fIdata\fR.
-Towfish depth samples are read and stored into the next
-\fIpng\(->\fBpng_depth.sns_nsamps*sizeof(float)\fR bytes.
-Pitch samples are read and stored into the next
-\fIpng\(->\fBpng_pitch.sns_nsamps*sizeof(float)\fR
-bytes. Roll samples are read and stored into the next
-\fIpng\(->\fBpng_roll.sns_nsamps*sizeof(float)\fR bytes.
-Port bathymetry samples are read and stored into the next
-\fI\%bsi*png\(->\fBpng_sides[\s-1ACP_PORT\s0].ps_btycount*sizeof(float)\fR
-bytes, where \fIbsi\fR is 2 or 3 depending on whether the samples are in x/z
-or x/y/z format. Port bathymetry flags are read and stored into the next
-\fI\%png\(->\fBpng_sides[\s-1ACP_PORT\s0].ps_btycount*sizeof(unsigned int)\fR
-bytes. Port sidescan samples are read and stored into the next
-\fI\%png\(->\fBpng_sides[\s-1ACP_PORT\s0].ps_sscount*sizeof(float)\fR bytes.
-Port sidescan flags are read and stored into the next
-\fI\%png\(->\fBpng_sides[\s-1ACP_PORT\s0].ps_sscount*sizeof(unsigned char)\fR
-bytes. Starboard bathymetry samples are read and stored into the next
-\fI\%bsi*png\(->\fBpng_sides[\s-1ACP_STBD\s0].ps_btycount*sizeof(float)\fR
-bytes (where \fIbsi\fR is 2 or 3 as described above). Starboard bathymetry
-flags are read and stored into the next
-\fI\%png\(->\fBpng_sides[\s-1ACP_STBD\s0].ps_btycount*sizeof(unsigned int)\fR
-bytes. Starboard sidescan samples are read and stored into the next
-\fI\%png\(->\fBpng_sides[\s-1ACP_STBD\s0].ps_sscount*sizeof(float)\fR bytes.
-Starboard sidescan flags are read and stored into the next
-\fI\%png\(->\fBpng_sides[\s-1ACP_STBD\s0].ps_sscount*sizeof(unsigned char)\fR
-bytes. Port auxiliary beam information is read and stored into the next
-\fI\%png\(->\fBpng_sides[\s-1ACP_PORT\s0].ps_btycount*sizeof(AuxBeamInfo)\fR
-bytes. Finally, starboard auxiliary beam information is read and stored
-into the last
-\fI\%png\(->\fBpng_sides[\s-1ACP_STBD\s0].ps_btycount*sizeof(AuxBeamInfo)\fR
-bytes.
-If sample padding has been specified by the \fIpng\fR header as described
-above, each group of samples as described above may be separated from the
-preceding group by a byte offset corresponding to the amount of padding
-applied to the previous group. For instance, if the port bathymetry has
-been padded, then (i) the port bathymetry flags will be offset from the
-end of the port bathymetry samples by a gap which is
-\%\fIbsi*png\(->\fBpng_sides[\s-1ACP_PORT\s0].ps_btypad*sizeof(float)\fR bytes
-in length (where \fIbsi\fR is 2 or 3 as described above), (ii) the port
-sidescan samples will be offset from the end of the port bathymetry flags
-by a gap which is
-\%\fIpng\(->\fBpng_sides[\s-1ACP_PORT\s0].ps_btypad*sizeof(unsigned int)\fR
-bytes in length, and (iii) the starboard auxiliary beam information will be
-offset from the end of the port auxiliary beam information by a gap which is
-\%\fIpng\(->\fBpng_sides[\s-1ACP_PORT\s0].ps_btypad*sizeof(AuxBeamInfo)\fR
-bytes in length. Sensor sample padding as specified by
-\fIpng\(->\fBpng_snspad\fR is applied between the last group of sensor samples
-and the port bathymetry, not between each group (e.g., compass and depth)
-of sensor samples. Note that the port auxiliary beam information is
-constrained to begin on a byte which is offset from \fIdata\fR by a
-multiple of \fB\s-1PNG_BYTEALIGNSZ\s0\fR bytes.
-.sp 6p
-\fBint
-.br
-bs_wrpngdata(Ping *\fIpng\fB, MemType *\fIdata\fB, XDR *\fIxdrs\fB)\fR
-.sp 2p
-writes the ping data pointed to by \fIdata\fR and associated with the ping
-header \fIpng\fR to the XDR output stream \fIxdrs\fR. The number of data
-samples to be written is obtained from \fIpng\fR. (See \fBbs_rdpngdata()\fR
-above for a detailed description of the organization of the contents
-of \fIdata\fR.) Padding samples, if any, are not written, but their
-presence as indicated by the \fBpng_snspad\fR, \fBps_btypad\fR and
-\fBps_sspad\fR fields of \fIpng\fR will affect the offsets from \fIdata\fR
-at which the various bathymetry samples, bathymetry flags, sidescan samples
-and auxiliary beam information are presumed to be located.
-.sp 6p
-\fBint
-.br
-bs_getpngdataptrs(Ping *\fIpng\fB, MemType *\fIdata\fB, PingData *\fIpngdata\fB)\fR
-.sp 2p
-returns into the fields of \fIpngdata\fR pointers to the various components
-(e.g., sensor samples, bathymetry samples, bathymetry flags, sidescan
-samples and auxiliary beam information) of the \fIdata\fR buffer associated
-with \fIpng\fR. Null pointers may be returned into fields when certain
-components are not present, e.g., auxiliary beam information.
-.sp 6p
-\fBint
-.br
-bs_rdpngpddata(Ping *\fIpng\fB, PingData *\fIpngdata\fB, XDR *\fIxdrs\fB)\fR
-.sp 2p
-reads the ping data associated with the ping header \fIpng\fR from the XDR
-input stream \fIxdrs\fR, storing the various components of the data into
-the memory buffers pointed to by the fields of \fIpngdata\fR. This routine
-assumes that these buffers have already been allocated. The number of data
-samples to be read is obtained from \fIpng\fR.
-.sp 6p
-\fBint
-.br
-bs_wrpngpddata(Ping *\fIpng\fB, PingData *\fIpngdata\fB, XDR *\fIxdrs\fB)\fR
-.sp 2p
-writes the ping data whose various components are pointed to by the fields
-of \fIpngdata\fR and are associated with the ping header \fIpng\fR to the
-XDR output stream \fIxdrs\fR. The number of data samples to be written is
-obtained from \fIpng\fR.
-.sp 6p
-\fBint
-.br
-bs_rdpng(Ping *\fIpng\fB, MemType **\fIdata\fB, XDR *\fIxdrs\fB, int \fIversion\fB)\fR
-.sp 2p
-reads a ping from the XDR input stream \fIxdrs\fR. The header will be stored
-into \fIpng\fR, and the data will be stored into \fI*data\fR. This routine
-allocates the memory pointed to by \fI*data\fR. (The \fIdata\fR parameter
-should be passed as the address of a memory pointer variable, which will be
-set to point to the newly allocated memory.) The version of the file format
-being read must be indicated by \fIversion\fR, which should normally be the
-value of the \fBbsf_version\fR field of the input file's file header record.
-This function performs the same operation as calling \fBbs_rdpnghdr(),
-bs_pngmemalloc()\fR and \fBbs_rdpngdata()\fR in succession. Note that it is
-not possible to allocate sample padding with this routine.
-.sp 6p
-\fBint
-.br
-bs_wrpng(Ping *\fIpng\fB, MemType *\fIdata\fB, XDR *\fIxdrs\fB)\fR
-.sp 2p
-writes both the ping header pointed to by \fIpng\fR and the data pointed to
-by \fIdata\fR to the XDR output stream \fIxdrs\fR.
-.sp 6p
-\fBint
-.br
-bs_seekpng(int \fIn\fB, XDR *\fIxdrs\fB, int \fIversion\fB)\fR
-.sp 2p
-skips over the next \fIn\fR pings in the XDR input stream \fIxdrs\fR,
-leaving the stream positioned at the beginning of the next ping. The
-version of the file format being read must be indicated by \fIversion\fR,
-which should normally be the value of the \fBbsf_version\fR field of the
-input file's file header record.
-.sp 6p
-\fBint
-.br
-bs_seekpngdata(Ping *\fIpng\fB, XDR *\fIxdrs\fB)\fR
-.sp 2p
-skips over a ping data segment (whose size is described by \fIpng\fR) in
-the XDR input stream \fIxdrs\fR, leaving the stream positioned at the
-beginning of the next ping.
-.sp 6p
-\fBint
-.br
-bs_copypng(int \fIn\fB, XDR *\fIxdris\fB, XDR *\fIxdros\fB, int \fIversion\fB)\fR
-.sp 2p
-copies the next \fIn\fR pings from the XDR input stream \fIxdris\fR to the
-XDR output stream \fIxdros\fR, leaving the input stream positioned at the
-beginning of the next ping. The version of the file format being read must
-be indicated by \fIversion\fR, which should normally be the value of the
-\fBbsf_version\fR field of the input file's file header record.
-.LP
-The stream-oriented nature of the I/O routines described above dictates
-that BS datafiles will generally be processed by reading an input file
-and then writing a new output file, where the latter is written in full
-from beginning to end. It is convenient in some circumstances, however,
-to modify an existing file in place rather than create a new file,
-particularly in the case where only the file header flags and/or a small
-number of ping header field values or ping sample values or flags must be
-altered, e.g., ping flags, navigation data, individual bathymetry or sidescan
-sample flags, etc. A crude mechanism is provided to enable this via the
-publicly accessable global variable
-.sp 6p
-\fBunsigned long bs_iobytecnt\fR
-.sp 2p
-and a small number of write functions. The \fBbs_iobytecnt\fR variable
-is always set by all of the above I/O routines to the exact number of
-bytes transferred from/to an input/output file by any particular call
-to such a routine. (The \fBbs_copypng()\fR function which both reads
-and writes data stores the number of written output bytes to
-\fBbs_iobytecnt\fR.) A calling program can therefore monitor this
-variable carefully and retain knowledge of the exact file byte offsets
-(from the beginning of the file) of each ping header in the file.
-These remembered ping header byte offsets, which must take into account
-the number of bytes used to store the initial file header as well as
-each ping header and each ping data segment, can then be passed to the
-functions
-.sp 6p
-\fBint
-.br
-bs_wrpflags(int \fIversion\fB, FILE *\fIfp\fB, long \fIphoffset\fB, unsigned int \fIflags\fB)\fR
-.sp 2p
-\fBint
-.br
-bs_wrsllc(int \fIversion\fB, FILE *\fIfp\fB, long \fIphoffset\fB, double \fIslon\fB, double \fIslat\fB, float \fIscourse\fB)\fR
-.sp 2p
-and
-.sp 6p
-\fBint
-.br
-bs_wrtllc(int \fIversion\fB, FILE *\fIfp\fB, long \fIphoffset\fB, double \fItlon\fB, double \fItlat\fB, float \fItcourse\fB)\fR
-.sp 2p
-to directly rewrite the ping flags (via the first function), the longitude,
-latitude and course of the ship (via the second function) and the longitude,
-latitude and course of the towfish (via the third function), where
-\fIversion\fR is the BS file format version as recorded in the file's
-\fBbsf_version\fR file header field. The function
-.sp 6p
-\fBint
-.br
-bs_wrtll(int \fIversion\fB, FILE *\fIfp\fB, long \fIphoffset\fB, double \fItlon\fB, double \fItlat\fB)\fR
-.sp 2p
-directly rewrites only the longitude and latitude of the towfish.
-.sp 6p
-\fBint
-.br
-bs_wrfflagssetbits(FILE *\fIfp\fB, unsigned int \fIbitmask\fB)\fR
-.sp 2p
-and
-.sp 6p
-\fBint
-.br
-bs_wrfflagsclrbits(FILE *\fIfp\fB, unsigned int \fIbitmask\fB)\fR
-.sp 2p
-are similarly used to set and/or clear the bits of \fIbitmask\fR to and/or from
-the file header flags while preserving the state of all other bit flags, while
-.sp 6p
-\fBint
-.br
-bs_wrpflagssetbits(int \fIversion\fB, FILE *\fIfp\fB, long \fIphoffset\fB, unsigned int \fIbitmask\fB)\fR
-.sp 2p
-and
-.sp 6p
-\fBint
-.br
-bs_wrpflagsclrbits(int \fIversion\fB, FILE *\fIfp\fB, long \fIphoffset\fB, unsigned int \fIbitmask\fB)\fR
-.sp 2p
-may be used to set and/or clear the bits of \fIbitmask\fR to and/or from the
-ping flags while preserving the state of all other bit flags.
-.sp 6p
-\fBint
-.br
-bs_setswradius(int \fIversion\fB, FILE *\fIfp\fB, long \fIphoffset\fB, int \fIside\fB, unsigned int \fIdatatypemask\fB, float \fIswradius\fB)\fR
-.sp 2p
-flags all samples of any data type whose mask bit is present in
-\fIdatatypemask\fR (which must contain either or both of the mask bits
-\fB\s-1BS_DTM_BATHYMETRY\s0\fR and/or \fB\s-1BS_DTM_SIDESCAN\s0\fR) on the
-named \fIside\fR (either \fB\s-1ACP_PORT\s0\fR or \fB\s-1ACP_STBD\s0\fR)
-at across-track distances greater than \fIswradius\fR with
-\fB\s-1{BTYD,SSD}_SWEDGE\s0\fR for the ping whose header is located at the
-named file byte offset, thus effectively trimming the swath radius of that
-\fIside\fR of the ping to \fIswradius\fR.
-.LP
-Note that a file pointer rather than an XDR stream is passed to all of these
-file and ping header field and sample flag rewrite functions, which will
-internally seek to the specified file byte offset \fIphoffset\fR marking the
-start of some particular ping header and write XDR-formatted data at
-appropriate offsets from that point. The file pointer will be positioned
-just after the modified bytes when these routines return. Note that these
-functions are exceedingly dangerous insofar as the use of an incorrect
-\fIphoffset\fR which does not actually reference the exact beginning of a
-ping header will certainly result in a fatally corrupted datafile.
-.LP
-\fBint
-.br
-bs_xdrstring(XDR *\fIxdrs\fB, char **\fIcpp\fB, unsigned long *\fIbytecnt\fB)\fR
-.sp 2p
-was originally created only for internal use by the various BS I/O routines
-described above, but has since been made publicly available due to its more
-generally useful performance of XDR character string encoding and decoding. It
-is not typically used by any calling application to access BS datafiles, but
-rather to access other files used by HMRG software which employ a similar
-style of XDR character string storage where the string is stored as an integer
-(the string length) followed by the bytes of the string (if the length is
-greater than 0). The routine returns 1 if successful and 0 otherwise, also
-recording the total number of bytes transferred (including the leading
-integer) into *\fIbytecnt\fR.
-.LP
-\fBint
-.br
-bs_appendstr(char **\fIfield\fB, char *\fIstring\fB)\fR
-.sp 2p
-appends the specified \fIstring\fR to any character string \fIfield\fR of an
-existing BS header. Note that the \fIfield\fR parameter must be the address
-of the header's character string field, and not the string itself. This
-routine will allocate new memory for the appended string and deallocate the
-memory consumed by the previous string where appropriate.
-.sp 6p
-\fBint
-.br
-bs_replacestr(char **\fIfield\fB, char *\fIstring\fB)\fR
-.sp 2p
-replaces an existing character string \fIfield\fR of an BS header with
-the specified \fIstring\fR. Note that the \fIfield\fR parameter must be
-the address of the header's character string field, and not the string
-itself. This routine will allocate new memory for the replacement string
-and deallocate the memory consumed by the previous string where appropriate.
-(A copy is made of the character string pointed to by \fIstring\fR, so
-\fIstring\fR may be safely deallocated, overwritten, etc., after the
-function returns.)
-.sp 6p
-\fBint
-.br
-bs_striptail(char *\fIstring\fB, char \fIc\fB)\fR
-.sp 2p
-strips all consecutive instances of \fIc\fR from the end of \fIstring\fR.
-.sp 6p
-\fBint
-.br
-bs_appendlog(BSFile *\fIbsf\fB, char **\fIargv\fB)\fR
-.sp 2p
-appends the specified argument vector \fIargv\fR to the log field of the
-named BS header, inserting a blank space between each of the character
-strings pointed to by \fIargv\fR and appending a trailing semicolon to the
-final string. The routine will also append a newline to the pre-existing
-log field before appending \fIargv\fR if that pre-existing log field is
-non-empty. The last element of the \fIargv\fR array of character pointers 
-must be a null pointer. This routine will allocate new memory for the
-modified log field and deallocate the memory consumed by the previous log
-field.
-.LP
-Two routines are provided for the generation of single- and double-precision
-IEEE NaN (not-a-number) quantities which are used by the \fBbsfile\fR(4)
-format to note that the value of a certain parameter (e.g., the towfish
-pulse length as described by the \fBps_pulse\fR field of the \fBPingSide\fR
-data structure) is unknown.
-.sp 6p
-\fBfloat
-.br
-bs_nanf()\fR
-.sp 2p
-and
-.sp 6p
-\fBdouble
-.br
-bs_nand()\fR
-.sp 2p
-respectively generate these single- and double-precision NaN quantities.
-Each of the routines
-.sp 6p
-\fBint
-.br
-bs_isnanf(float \fIf\fB)\fR
-.sp 2p
-and
-.sp 6p
-\fBint
-.br
-bs_isnand(double \fId\fB)\fR
-.sp 2p
-will return 1 if its argument is a NaN quantity and 0 otherwise.
-.LP
-A group of routines are provided for the manipulation of ping marks,
-which are used to flag pings either within a single program or between
-cooperating applications. A ping mark will have an integer value which is
-either \fB\s-1BS_NULLMARK\s0\fR or some bitwise combination of the bitflags
-\fB\s-1BS_LOWMARK\s0\fR and/or \fB\s-1BS_HIGHMARK\s0\fR. Each side of
-a ping, \fB\s-1ACP_PORT\s0\fR and \fB\s-1ACP_STBD\s0\fR, is
-marked separately.
-.sp 6p
-\fBvoid *
-.br
-bs_mrkmemalloc(int \fIsize\fB)\fR
-.sp 2p
-allocates enough memory to maintain ping marks for a group of \fIsize\fR
-pings, sets all of those marks to \fB\s-1BS_NULLMARK\s0\fR and returns a
-pointer to that memory. (The pointer may be a null pointer if the function
-fails for any reason.)
-.sp 6p
-\fBint
-.br
-bs_mrkget(void *\fImarkers\fB, int \fIside\fB, int \fIpingid\fB)\fR
-.sp 2p
-returns the mark value of the specified \fIpingid\fR on the declared
-\fIside\fR from the ping mark memory buffer \fImarkers\fR.
-.sp 6p
-\fBvoid
-.br
-bs_mrkset(void *\fImarkers\fB, int \fIside\fB, int \fIpingid\fB, int \fIvalue\fB)\fR
-.sp 2p
-sets the mark value of the specified \fIpingid\fR on the declared \fIside\fR
-in the ping mark memory buffer \fImarkers\fR to the stated \fIvalue\fR.
-.LP
-The pre-processor macro
-.sp 6p
-\fBint
-.br
-\fBbs_pngvisible(\fIflags\fB)\fR
-.sp 2p
-returns zero if either of the \fB\s-1PNG_HIDE\s0\fR or
-\fB\s-1PNG_LOWQUALITY\s0\fR bits of \fIflags\fR (which should be the
-\fBpng_flags\fR field of a \fBPing\fR structure) is set, and non-zero otherwise.
-The
-.sp 6p
-\fBint
-.br
-\fBbs_pngmscvisible(\fIflags\fB)\fR
-.sp 2p
-macro returns zero if any of the \fB\s-1PNG_MSCHIDE\s0\fR, \fB\s-1PNG_HIDE\s0\fR
-or \fB\s-1PNG_LOWQUALITY\s0\fR bits of \fIflags\fR (which should be the
-\fBpng_flags\fR field of a \fBPing\fR structure) is set, and non-zero otherwise.
-.LP
-The routine
-.sp 6p
-\fBint
-.br
-\fBbs_splitfile(char *\fIdirnm\fB, char *\fIbsfnm0\fB, char *\fIbsfnm1\fB, int \fIpngid\fB, char *\fIlogprefix\fB)\fR
-.sp 2p
-splits the existing BS datafile \fIbsfnm0\fR located in directory \fIdirnm\fR
-into two pieces, leaving the initial \fIpngid\fR pings in \fIbsfnm0\fR and
-creating a new file \fIbsfnm1\fR to contain the remaining pings. (Note that
-a new \fIbsfnm0\fR will actually be recreated from the original \fIbsfnm0\fR
-which is then removed.) The \fIdirnm\fR argument may be set to a null pointer
-to indicate that the operation should be performed within the current
-directory. The \fIlogprefix\fR argument, which may also be a null pointer,
-should point to a short string (typically just the name of the calling
-program) which will be incorporated into both output files' log entries
-along with \fIpngid\fR by the routine.
-.LP
-Finally, the routines
-.sp 6p
-\fBint
-.br
-bs_tmparse(char *\fIstr\fB, int \fImode\fB, double *\fItmval\fB)\fR
-.sp 2p
-and
-.sp 6p
-\fBint
-.br
-bs_tmparsegmttz(char *\fIstr\fB, int \fImode\fB, double *\fItmval\fB)\fR
-.sp 2p
-parse a character string \fIstr\fR of the form
-.sp 2p
-	\fIyear\fB/\fIjulianday\fB-\fIhour\fB:\fIminute\fB:\fIsecond\fR
-.sp 2p
-(when \fImode\fR is \fB\s-1TM_JULIAN\s0\fR) or
-.sp 2p
-	\fIyear\fB/\fImonth\fB/\fIday\fB-\fIhour\fB:\fIminute\fB:\fIsecond\fR
-.sp 2p
-(when \fImode\fR is \fB\s-1TM_CALENDAR\s0\fR), setting *\fItmval\fR equal
-to the number of seconds since January 1, 1970, represented by the time
-described within \fIstr\fR. \fBbs_tmparsegmttz()\fR should be used only
-when the calling application's environment is using the GMT timezone, but
-is considerably more efficient in terms of memory usage than the more
-general \fBbs_tmparse()\fR when the routine is to be called a large number
-of times. The routines will allow any of the field separation
-characters '\fB/\fR', '\fB-\fR', '\fB:\fR' and/or ' ' to be used
-interchangeably within \fIstr\fR, e.g., '92-67-1-23-56' and '92/67 1:23:56'
-denote the same time value. All fields except the \fIyear\fR are optional
-and, if not specified, will be set to appropriate minimum values. If any
-particular field other than the \fIyear\fR is specified, however, then all
-other fields which would normally precede that field within the string
-must also be specified. The \fIyear\fR will be interpreted explicitly unless
-it is (i) between 0 and 49, in which case it will be interpreted as
-2000+\fIyear\fR, or (ii) between 50 and 99, in which case it will be
-interpreted as 1900+\fIyear\fR. Month and day values are specified in normal
-human (rather than Unix) format, meaning that the \fIjulianday\fR may range
-from 1 to 366, while the calendar \fImonth\fR and \fIday\fR may range from
-1 to 12 and 1 to 31 respectively. The \fIsecond\fR field may include a
-decimal fraction if so desired, while all other fields must be non-negative
-integers. The length of \fIstr\fR may not exceed \fB\s-1TM_MAXSTRLEN\s0\fR.
-.SH ERROR CODES
-.LP
-The following error codes are defined by /usr/local/bs.h.
-.sp 6p
-#define BS_SUCCESS			(0)
-.br
-#define BS_FAILURE			(1)
-.br
-#define BS_FILTERWAIT		(2)
-.br
-#define BS_MISC			(3)
-.br
-#define BS_BADARG			(4)
-.br
-#define BS_MEMALLOC			(5)
-.br
-#define BS_OPEN			(6)
-.br
-#define BS_READ			(7)
-.br
-#define BS_WRITE			(8)
-.br
-#define BS_SYSVIPC			(9)
-.br
-#define BS_X11				(10)
-.br
-#define BS_SIGNAL			(11)
-.br
-#define BS_PIPE				(12)
-.br
-#define BS_FCNTL			(13)
-.br
-#define BS_FORK			(14)
-.br
-#define BS_DUP2			(15)
-.br
-#define BS_CHDIR			(16)
-.br
-#define BS_EXEC			(17)
-.br
-#define BS_PDB				(18)
-.br
-#define BS_EOF				(19)
-.br
-#define BS_BADDATA			(20)
-.br
-#define BS_FSEEK			(21)
-.br
-#define BS_ACCESS			(22)
-.br
-#define BS_RENAME			(23)
-.br
-#define BS_BADARCH			(24)
-.br
-#define BS_HUGEPING			(25)
-.br
-#define BS_GTK				(26)
-.br
-#define BS_CAIRO			(27)
-.br
-.SH SEE ALSO
-.BR bsfile (4)
-.SH AUTHOR
-Roger Davis, July 2005.
diff --git a/src/bsio/bs2asc.1 b/src/bsio/bs2asc.1
deleted file mode 100644
index cfe1ad0..0000000
--- a/src/bsio/bs2asc.1
+++ /dev/null
@@ -1,104 +0,0 @@
-.TH bs2asc 1 "22 July 2005"
-.SH NAME
-bs2asc \- BS to ASCII conversion program
-.SH SYNOPSIS
-\fBbs2asc [ -f \fIfilename\fB ] [ -h | -d ] [ -nip ] [ -nsns ]
-[ -nb ] [ -nbd ] [ -nbf ] [ -nabi ] [ -ns ] [ -nsd ] [ -nsf ]
-[ -i ] [ -pco ] [ -jt | -ct ] [ -s \fIskip\fB ] [ -c \fIcount\fB ] [ -H ]
--sm \fIshmcid\fB | <\fIbsfile\fB >\fIASCIIfile\fB
-\fR
-.SH DESCRIPTION
-.LP
-\fBbs2asc\fR converts the information contained within a BS dataset in
-\fBbsfile\fR(4) format from binary XDR format to a human-readable ASCII
-format.
-.SH OPTIONS
-.TP
-\fB\-f\fI filename
-\fRWrite the ASCII output to the named file instead of the default \fIstdout\fR.
-.TP
-\fB\-h
-\fRConvert and output the file header and ping headers only. (The file header
-will not be output if the \fB-sm\fR option has been specified.)
-.TP
-\fB\-d
-\fRConvert and output the ping data only.
-.TP
-\fB\-nip
-\fRLimit the conversion and output of pings whose \fB\s-1PNG_HIDE\s0\fR or
-\fB\s-1PNG_LOWQUALITY\s0\fR flag is set by just outputting the ping number,
-flag value and timestamp.
-.TP
-\fB\-nsns
-\fRDo not output sensor (i.e., compass, depth, pitch and roll) data.
-.TP
-\fB\-nb
-\fRDo not output bathymetry data.
-.TP
-\fB\-nbd
-\fRDo not output bathymetry data which have been flagged for deletion.
-.TP
-\fB\-nbf
-\fRDo not output bathymetry flags.
-.TP
-\fB\-nabi
-\fRDo not output auxiliary beam information.
-.TP
-\fB\-ns
-\fRDo not output sidescan data.
-.TP
-\fB\-nsd
-\fRDo not output sidescan data which have been flagged for deletion.
-.TP
-\fB\-nsf
-\fRDo not output sidescan flags.
-.TP
-\fB\-i
-\fRIgnore the ping count contained in the file header. This value is normally
-used as an upper bound on the number of pings to be converted to ASCII, and is
-also used to check the validity of any skip and/or count values passed to the
-program via the \fB-s\fR and/or \fB-c\fR options. It may be useful to ignore
-this count in situations where it is known to be incorrect (such as a file
-that has been only partially written by another program which has not yet
-updated the header count). This option may not be used in conjunction with
-the \fB-sm\fR option.
-.TP
-\fB\-pco
-\fROutput the ping count only and immediately exit. Default program behavior
-displays considerably more information. Note that the program makes no
-attempt to verify that the input actually contains the number of pings
-claimed by its file header.
-.TP
-\fB\-jt
-\fRUse the default julian format for the display of time values.
-.TP
-\fB\-ct
-\fRUse calendar (i.e., month and day) format for the display of time values.
-The default format is julian.
-.TP
-\fB\-s\fI skip
-\fRSkip the specified number of pings at the beginning of the dataset
-before converting any subsequent pings. The default value is 0.
-.TP
-\fB\-c\fI count
-\fRApply the conversion operation only to the specified number of pings.
-The default value is the total number of pings in the dataset minus
-the number of initial pings to be skipped as specified by the \fB-s\fR
-option, if any.
-.TP
-\fB\-H\fI
-\fRDisplay help information.
-.TP
-\fB\-sm\fI shmcid
-\fRRun the program in shared memory mode using the shared memory control
-block \fIshmcid\fR. The default mode of operation is to read a BS input
-file from \fIstdin\fR. The \fB-sm\fR option should be used only when the
-program is invoked by specialized controlling software such as \fBssp\fR(1)
-which is capable of implementing the required shared memory protocol.
-.SH SEE ALSO
-.BR ssp (1),
-.BR bsfile (4)
-.SH AUTHOR
-Originally written as \fBmr2asc\fR to support \fBmr1file\fR(4) format by
-Roger Davis, September 1991. Enhanced to support new \fBbsfile\fR(4) format
-in July, 2005.
diff --git a/src/bsio/bs2asc.c b/src/bsio/bs2asc.c
deleted file mode 100644
index 4bf5155..0000000
--- a/src/bsio/bs2asc.c
+++ /dev/null
@@ -1,900 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbbs2asc.c	3/3/2014
- *	$Id: bs2asc.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 2014-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/* This source code is part of the mbbsio library used to read and write
- * swath sonar data in the bsio format devised and used by the
- * Hawaii Mapping Research Group of the University of Hawaii.
- * This source code was made available by Roger Davis of the
- * University of Hawaii under the GPL. Minor modifications have
- * been made to the version distributed here as part of MB-System.
- *
- * Author:	Roger Davis (primary author)
- * Author:	D. W. Caress (MB-System revisions)
- * Date:	March 3, 2014 (MB-System revisions)
- *
- *--------------------------------------------------------------------*/
-/*
- *	Copyright (c) 1991 by University of Hawaii.
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <time.h>
-#include <sys/time.h>
-#include <sys/types.h>
-#include <sys/ipc.h>
-#include <sys/shm.h>
-#include <math.h>
-
-#include "mbbs.h"
-
-#define OUTPUT_ALL		(0)
-#define OUTPUT_HDRSONLY		(1)
-#define OUTPUT_DATAONLY		(2)
-
-#define TM_JULIAN		(0)
-#define TM_CALENDAR		(1)
-
-#define SSLINESZ		(5)
-
-#include <stdlib.h>
-
-char *progname;
-int skip, count;
-int iomode;
-int ignorecnt;
-FILE *fp;
-int output, tmmode;
-int showivisping;
-int showsns, showbty, showss;
-int showbtyd, showbtyfl, showabi;
-int showssd, showssfl;
-int pngcntonly;
-int smcid;
-int slantrng;
-BSFile bsf;
-SMControl *smctl;
-void *smbuf;
-int *smind;
-XDR xdri;
-MemType *databuf;
-unsigned int databufsz;
-char *sdstr[ACP_NSIDES]= {
-	"Port",
-	"Starboard"
-};
-
-int
-main(int argc, char **argv)
-{
-	char *cp;
-	Ping png, *pngp;
-	int err, i, j, side, npts, bsi;
-	PingData pd;
-	float *bty, *ss;
-	AuxBeamInfo *abi;
-	void usage();
-	void pr_bsfhdr(BSFile *), pr_pnghdr(Ping *);
-
-	if ((progname= strrchr(*argv, (int) '/')) != (char *) NULL)
-		progname++;
-	else
-		progname= *argv;
-
-	skip= 0;
-	count= BS_UNDEFINED;
-	iomode= BS_FILEIO;
-	fp= stdout;
-	output= OUTPUT_ALL;
-	ignorecnt= 0;
-	showivisping= 1;
-	showsns= showbty= showss= 1;
-	showbtyd= showbtyfl= showabi= 1;
-	showssd= showssfl= 1;
-	pngcntonly= 0;
-	tmmode= TM_JULIAN;
-
-	databuf= (MemType *) 0;
-	databufsz= 0;
-
-	for (argc--, argv++; argc > 0; argc--, argv++) {
-		if (!strcmp(*argv, "-s")) {
-			if (argc < 2)
-				usage();
-			argc--, argv++;
-			skip= (int) strtol(*argv, &cp, 10);
-			if ((cp == *argv) || (*cp != '\0')) {
-				(void) fprintf(stderr, "%s: invalid skip value\n", progname);
-				exit(BS_BADARG);
-			}
-			if (skip < 0) {
-				(void) fprintf(stderr, "%s: skip value may not be less than 0\n", progname);
-				exit(BS_BADARG);
-			}
-		}
-		else if (!strcmp(*argv, "-c")) {
-			if (argc < 2)
-				usage();
-			argc--, argv++;
-			count= (int) strtol(*argv, &cp, 10);
-			if ((cp == *argv) || (*cp != '\0')) {
-				(void) fprintf(stderr, "%s: invalid count value\n", progname);
-				exit(BS_BADARG);
-			}
-			if (count < 0) {
-				(void) fprintf(stderr, "%s: count value may not be less than 0\n", progname);
-				exit(BS_BADARG);
-			}
-		}
-		else if (!strcmp(*argv, "-sm")) {
-			if (argc < 2)
-				usage();
-			iomode= BS_SHAREDMEM;
-			argc--, argv++;
-			smcid= (int) strtol(*argv, &cp, 10);
-			if ((cp == *argv) || (*cp != '\0')) {
-				(void) fprintf(stderr, "%s: invalid shared memory control block ID\n", progname);
-				exit(BS_BADARG);
-			}
-		}
-		else if (!strcmp(*argv, "-f")) {
-			if (argc < 2)
-				usage();
-			argc--, argv++;
-			if ((fp= fopen(*argv, "w")) == (FILE *) NULL) {
-				(void) fprintf(stderr, "%s: cannot open file '%s'\n", progname, *argv);
-				exit(BS_OPEN);
-			}
-		}
-		else if (!strcmp(*argv, "-h"))
-			output= OUTPUT_HDRSONLY;
-		else if (!strcmp(*argv, "-d"))
-			output= OUTPUT_DATAONLY;
-		else if (!strcmp(*argv, "-nip"))
-			showivisping= 0;
-		else if (!strcmp(*argv, "-nsns"))
-			showsns= 0;
-		else if (!strcmp(*argv, "-nb"))
-			showbty= 0;
-		else if (!strcmp(*argv, "-nbd"))
-			showbtyd= 0;
-		else if (!strcmp(*argv, "-nbf"))
-			showbtyfl= 0;
-		else if (!strcmp(*argv, "-nabi"))
-			showabi= 0;
-		else if (!strcmp(*argv, "-ns"))
-			showss= 0;
-		else if (!strcmp(*argv, "-nsd"))
-			showssd= 0;
-		else if (!strcmp(*argv, "-nsf"))
-			showssfl= 0;
-		else if (!strcmp(*argv, "-i"))
-			ignorecnt= 1;
-		else if (!strcmp(*argv, "-pco"))
-			pngcntonly= 1;
-		else if (!strcmp(*argv, "-jt"))
-			tmmode= TM_JULIAN;
-		else if (!strcmp(*argv, "-ct"))
-			tmmode= TM_CALENDAR;
-		else if (!strcmp(*argv, "-H"))
-			usage();
-
-		/* ignored options */
-		else if (!strcmp(*argv, "-tv")) {
-			if (argc < 3)
-				usage();
-			argc-= 2, argv+= 2;
-		}
-		else if (!strcmp(*argv, "-spm"))
-			continue;
-		else if (!strcmp(*argv, "-ppm"))
-			continue;
-		else if (!strncmp(*argv, "-pb", 3))
-			continue;
-		else if (!strncmp(*argv, "-pp", 3))
-			continue;
-		else if (!strncmp(*argv, "-ps", 3))
-			continue;
-	}
-
-	switch (iomode) {
-	case BS_FILEIO:
-		xdrstdio_create(&xdri, stdin, XDR_DECODE);
-
-		if ((err= mbbs_rdbsfhdr(&bsf, &xdri)) != BS_SUCCESS) {
-			(void) fprintf(stderr, "%s: cannot read BS file header\n", progname);
-			exit(err);
-		}
-		if (bsf.bsf_flags & BS_SSSLANTRNG)
-			slantrng= 1;
-		else
-			slantrng= 0;
-		if (pngcntonly) {
-			(void) fprintf(fp, "%1d\n", bsf.bsf_count);
-			(void) fflush(fp);
-			exit(BS_SUCCESS);
-		}
-		if (ignorecnt == 1)
-			;
-		else if (count == BS_UNDEFINED) {
-			if ((count= bsf.bsf_count-skip) < 0) {
-				(void) fprintf(stderr, "%s: skip request exceeds number of available pings\n", progname);
-				exit(BS_BADARG);
-			}
-		}
-		else {
-			if (skip+count > bsf.bsf_count) {
-				(void) fprintf(stderr, "%s: skip and count requests exceed number of available pings\n", progname);
-				exit(BS_BADARG);
-			}
-		}
-		if ((err= mbbs_seekpng(skip, &xdri, bsf.bsf_version)) != BS_SUCCESS) {
-			(void) fprintf(stderr, "%s: ping seek error\n", progname);
-			exit(err);
-		}
-		if (output != OUTPUT_DATAONLY)
-			pr_bsfhdr(&bsf);
-
-		break;
-	case BS_SHAREDMEM:
-		if (pngcntonly) {
-			(void) fprintf(fp, "%1d\n", smctl->sm_count);
-			(void) fflush(fp);
-			exit(BS_SUCCESS);
-		}
-		if (ignorecnt == 1) {
-			(void) fprintf(stderr, "%s: count cannot be ignored in shared memory mode\n", progname);
-			exit(BS_BADARG);
-		}
-		if ((smctl= (SMControl *) shmat(smcid, (MemType *) 0, (int) 0)) == (SMControl *) -1) {
-			(void) fprintf(stderr, "%s: shared memory attach failure\n", progname);
-			exit(BS_SYSVIPC);
-		}
-		if (smctl->sm_slantrng)
-			slantrng= 1;
-		else
-			slantrng= 0;
-		if (count == BS_UNDEFINED) {
-			if ((count= smctl->sm_count-skip) < 0) {
-				(void) fprintf(stderr, "%s: skip request exceeds number of available pings\n", progname);
-				smctl->sm_status= BS_BADARG;
-				exit(BS_BADARG);
-			}
-		}
-		else if (skip+count > smctl->sm_count) {
-			(void) fprintf(stderr, "%s: skip and count requests exceed number of available pings\n", progname);
-			smctl->sm_status= BS_BADARG;
-			exit(BS_BADARG);
-		}
-		if ((smind= (int *) shmat(smctl->sm_shmiid, (MemType *) 0, (int) 0)) == (int *) -1) {
-			(void) fprintf(stderr, "%s: shared memory attach failure\n", progname);
-			smctl->sm_status= BS_SYSVIPC;
-			exit(BS_SYSVIPC);
-		}
-		if ((smbuf= (void *) shmat(smctl->sm_shmdid, (MemType *) 0, (int) 0)) == (void *) -1) {
-			(void) fprintf(stderr, "%s: shared memory attach failure\n", progname);
-			smctl->sm_status= BS_SYSVIPC;
-			exit(BS_SYSVIPC);
-		}
-		(void) strcpy(smctl->sm_msg, "ASCII output");
-		smctl->sm_msgtype= SMC_MSGALTPCT;
-		cp= (char *) smbuf;
-		cp+= smind[skip];
-		pngp= (Ping *) cp;
-		break;
-	}
-
-	for (i= 0; (i < count) || ((count == BS_UNDEFINED) && (ignorecnt == 1)); i++) {
-		switch (iomode) {
-		case BS_FILEIO:
-			if ((err= mbbs_rdpnghdr(&png, &xdri, bsf.bsf_version)) != BS_SUCCESS) {
-				(void) fprintf(stderr, "%s: cannot read header from ping %1d\n", progname, (int) (skip+i));
-				exit(err);
-			}
-			if ((err= mbbs_pngrealloc(&png, &databuf, &databufsz)) != BS_SUCCESS) {
-				(void) fprintf(stderr, "%s: memory allocation error for ping %1d\n", progname, (int) (skip+i));
-				exit(err);
-			}
-			if ((err= mbbs_rdpngdata(&png, databuf, &xdri)) != BS_SUCCESS) {
-				(void) fprintf(stderr, "%s: cannot read data from ping %1d\n", progname, (int) (skip+i));
-				exit(err);
-			}
-			pngp= &png;
-			break;
-		case BS_SHAREDMEM:
-			cp= (char *) pngp;
-			cp+= sizeof(Ping);
-			databuf= (float *) cp;
-			break;
-		}
-		if ((err= mbbs_getpngdataptrs(pngp, databuf, &pd)) != BS_SUCCESS) {
-			(void) fprintf(stderr, "%s: cannot get ping data pointers\n", progname);
-			exit(err);
-		}
-
-		(void) fprintf(fp, "\n\nPing %1d ****\n\n", (int) (i+skip));
-		if (output != OUTPUT_DATAONLY)
-			pr_pnghdr(pngp);
-
-		if ((output != OUTPUT_HDRSONLY) &&
-		    (showivisping || mbbs_pngvisible(pngp->png_flags))) {
-			if (showsns) {
-				(void) fprintf(fp, "\nCompass Data:\n");
-				for (j= 0; j < pngp->png_compass.sns_nsamps; j++) {
-					if (mbbs_isnanf(pd.pd_compass[j]))
-						(void) fprintf(fp, "   ?\n");
-					else
-						(void) fprintf(fp, "%4.2f\n", pd.pd_compass[j]);
-				}
-
-				(void) fprintf(fp, "\nDepth Data:\n");
-				for (j= 0; j < pngp->png_depth.sns_nsamps; j++) {
-					if (mbbs_isnanf(pd.pd_depth[j]))
-						(void) fprintf(fp, "   ?\n");
-					else
-						(void) fprintf(fp, "%4.2f\n", pd.pd_depth[j]);
-				}
-
-				(void) fprintf(fp, "\nPitch Data:\n");
-				for (j= 0; j < pngp->png_pitch.sns_nsamps; j++) {
-					if (mbbs_isnanf(pd.pd_pitch[j]))
-						(void) fprintf(fp, "   ?\n");
-					else
-						(void) fprintf(fp, "%4.2f\n", pd.pd_pitch[j]);
-				}
-
-				(void) fprintf(fp, "\nRoll Data:\n");
-				for (j= 0; j < pngp->png_roll.sns_nsamps; j++) {
-					if (mbbs_isnanf(pd.pd_roll[j]))
-						(void) fprintf(fp, "   ?\n");
-					else
-						(void) fprintf(fp, "%4.2f\n", pd.pd_roll[j]);
-				}
-			}
-
-			if (showbty) {
-				if (pngp->png_flags & PNG_XYZ)
-					bsi= 3;
-				else
-					bsi= 2;
-				for (side= ACP_PORT; side < ACP_NSIDES; side++) {
-					(void) fprintf(fp, "\n%s Bathymetry Data:\n[Index]        X        ", side == ACP_PORT ? "Port" : "Starboard");
-					if (bsi == 3)
-						(void) fprintf(fp, "Y        ");
-					(void) fprintf(fp, "Z    ");
-					if (showbtyfl)
-						(void) fprintf(fp, "Flag    ");
-					if ((pngp->png_flags & PNG_ABI) && showabi)
-						(void) fprintf(fp, "Beam    SSAT0    SSAT1 ABIFlag");
-					(void) fprintf(fp, "\n");
-					if ((npts= pngp->png_sides[side].ps_btycount) == 0)
-						continue;
-					bty= pd.pd_bty[side];
-					for (j= 0; j < npts; j++) {
-						if (!showbtyd && pd.pd_btyflags[side][j])
-							continue;
-						(void) fprintf(fp, "[%5d]   %8.2f ", j, bty[bsi*j]);
-						if (bsi == 3)
-							(void) fprintf(fp, "%8.2f %8.2f", bty[(bsi*j)+1], bty[(bsi*j)+2]);
-						else
-							(void) fprintf(fp, "%8.2f", bty[(bsi*j)+1]);
-						if (showbtyfl)
-							(void) fprintf(fp, "%#6x  ", pd.pd_btyflags[side][j]);
-						if ((pngp->png_flags & PNG_ABI) && showabi) {
-							abi= &(pd.pd_abi[side][j]);
-							(void) fprintf(fp, "%6d ", abi->abi_id);
-							if (mbbs_isnanf(abi->abi_ssat0))
-								(void) fprintf(fp, "       ? ");
-							else
-								(void) fprintf(fp, "%8.2f ", abi->abi_ssat0);
-							if (mbbs_isnanf(abi->abi_ssat1))
-								(void) fprintf(fp, "       ?  ");
-							else
-								(void) fprintf(fp, "%8.2f  ", abi->abi_ssat1);
-							(void) fprintf(fp, "%#6x", abi->abi_flags);
-						}
-						(void) fprintf(fp, "\n");
-					}
-				}
-			}
-
-			if (showss) {
-				for (side= ACP_PORT; side < ACP_NSIDES; side++) {
-					(void) fprintf(fp, "\n%s Sidescan Data:\n[Index]      Intensity", side == ACP_PORT ? "Port" : "Starboard");
-					if (showssfl)
-						(void) fprintf(fp, "     Flag");
-					(void) fprintf(fp, "\n");
-					npts= pngp->png_sides[side].ps_sscount;
-					ss= pd.pd_ss[side];
-					for (j= 0; j < npts; j++) {
-						if (!showssd && pd.pd_ssflags[side][j])
-							continue;
-						(void) fprintf(fp, "[%5d]   %12.2f", j, ss[j]);
-						if (showssfl)
-							(void) fprintf(fp, "   %#6x", (unsigned int) pd.pd_ssflags[side][j]);
-						(void) fprintf(fp, "\n");
-					}
-				}
-			}
-		}
-
-		(void) fprintf(fp, "\n");
-
-		switch (iomode) {
-		case BS_FILEIO:
-			break;
-		case BS_SHAREDMEM:
-			smctl->sm_ping= skip+i;
-			if (i < count-1) {
-				cp= (char *) smbuf;
-				cp+= smind[skip+i+1];
-				pngp= (Ping *) cp;
-			}
-			break;
-		}
-	}
-
-	switch (iomode) {
-	case BS_FILEIO:
-		break;
-	case BS_SHAREDMEM:
-		smctl->sm_status= BS_SUCCESS;
-		smctl->sm_redraw= SMC_RDRNONE;
-		break;
-	}
-
-	exit(BS_SUCCESS);
-}
-
-void
-usage()
-{
-	(void) fprintf(stderr, "usage: %s [ -f filenm] [ -h | -d ] [ -nip ] [ -nsns ] [ -nb ] [ -nbd ] [ -nbf ] [ -nabi ] [ -ns ] [ -nsd ] [ -nsf ] [ -i ] [ -pco ] [ -jt | -ct ] [ -s skip ] [ -c count ] [ -H ] -sm shmcid | < bsfile > ASCIIfile\n", progname);
-	exit(BS_BADARG);
-}
-
-void
-pr_bsfhdr(BSFile *bsf)
-{
-	(void) fprintf(fp, "Format Version: ");
-	switch (bsf->bsf_version) {
-	case MR1_VERSION_1_0:
-		(void) fprintf(fp, "MR1 1.0\n");
-		break;
-	case MR1_VERSION_2_0:
-		(void) fprintf(fp, "MR1 2.0\n");
-		break;
-	case BS_VERSION_1_0:
-		(void) fprintf(fp, "BS 1.0\n");
-		break;
-	case BS_VERSION_1_1:
-		(void) fprintf(fp, "BS 1.1\n");
-		break;
-	case BS_VERSION_1_2:
-		(void) fprintf(fp, "BS 1.2\n");
-		break;
-	case BS_VERSION_1_3:
-		(void) fprintf(fp, "BS 1.3\n");
-		break;
-	case BS_VERSION_1_4:
-		(void) fprintf(fp, "BS 1.4\n");
-		break;
-	default:
-		(void) fprintf(fp, "Unknown\n");
-		break;
-	}
-	(void) fprintf(fp, "Ping Count: %d\n", bsf->bsf_count);
-
-	(void) fprintf(fp, "Flags: %#x", bsf->bsf_flags);
-	if (bsf->bsf_flags) {
-		(void) fprintf(fp, " (");
-		if (bsf->bsf_flags & BS_SSSLANTRNG)
-			(void) fprintf(fp, " SSSLANTRNG");
-		if (bsf->bsf_flags & BS_MSCPINGDELRST)
-			(void) fprintf(fp, " BS_MSCPINGDELRST");
-		if (bsf->bsf_flags & BS_MSCNAVEDIT)
-			(void) fprintf(fp, " BS_MSCNAVEDIT");
-		if (bsf->bsf_flags & BS_MSCEDGETRIM)
-			(void) fprintf(fp, " BS_MSCEDGETRIM");
-		(void) fprintf(fp, " )");
-	}
-	(void) fprintf(fp, "\n");
-
-	(void) fprintf(fp, "Acquisition Instrument: ");
-	switch (bsf->bsf_inst) {
-	case BS_INST_UNDEFINED:
-		(void) fprintf(fp, "?\n");
-		break;
-	case BS_INST_MR1:
-		(void) fprintf(fp, "MR1\n");
-		break;
-	case BS_INST_SEAMAPB:
-		(void) fprintf(fp, "Seamap-B\n");
-		break;
-	case BS_INST_IMI30:
-		(void) fprintf(fp, "IMI-30\n");
-		break;
-	case BS_INST_IMI12:
-		(void) fprintf(fp, "IMI-12\n");
-		break;
-	case BS_INST_DSL120A:
-		(void) fprintf(fp, "DSL-120A\n");
-		break;
-	case BS_INST_SEAMAPC:
-		(void) fprintf(fp, "Seamap-C\n");
-		break;
-	case BS_INST_SCAMP:
-		(void) fprintf(fp, "SCAMP\n");
-		break;
-	case BS_INST_EM120:
-		(void) fprintf(fp, "K/S EM120\n");
-		break;
-	case BS_INST_EM1002:
-		(void) fprintf(fp, "K/S EM1002\n");
-		break;
-	case BS_INST_EM300:
-		(void) fprintf(fp, "K/S EM300\n");
-		break;
-	case BS_INST_EM3000:
-		(void) fprintf(fp, "K/S EM3000\n");
-		break;
-	case BS_INST_EM3002:
-		(void) fprintf(fp, "K/S EM3002\n");
-		break;
-	case BS_INST_EM3000D:
-		(void) fprintf(fp, "K/S EM3000D\n");
-		break;
-	case BS_INST_EM3002D:
-		(void) fprintf(fp, "K/S EM3002D\n");
-		break;
-	case BS_INST_EM2000:
-		(void) fprintf(fp, "K/S EM2000\n");
-		break;
-	case BS_INST_EM122:
-		(void) fprintf(fp, "K/S EM122\n");
-		break;
-	case BS_INST_EM302:
-		(void) fprintf(fp, "K/S EM302\n");
-		break;
-	case BS_INST_EM710:
-		(void) fprintf(fp, "K/S EM710\n");
-		break;
-	case BS_INST_SM2000:
-		(void) fprintf(fp, "K/S SM2000\n");
-		break;
-	case BS_INST_RESON8101:
-		(void) fprintf(fp, "Reson 8101\n");
-		break;
-	case BS_INST_RESON8111:
-		(void) fprintf(fp, "Reson 8111\n");
-		break;
-	case BS_INST_RESON8124:
-		(void) fprintf(fp, "Reson 8124\n");
-		break;
-	case BS_INST_RESON8125:
-		(void) fprintf(fp, "Reson 8125\n");
-		break;
-	case BS_INST_RESON8150:
-		(void) fprintf(fp, "Reson 8150\n");
-		break;
-	case BS_INST_RESON8160:
-		(void) fprintf(fp, "Reson 8160\n");
-		break;
-	case BS_INST_AMS120:
-		(void) fprintf(fp, "AMS-120\n");
-		break;
-	case BS_INST_REMUS:
-		(void) fprintf(fp, "Remus\n");
-		break;
-	case BS_INST_KLEIN5000:
-		(void) fprintf(fp, "Klein 5000\n");
-		break;
-	case BS_INST_SEABEAM2000:
-		(void) fprintf(fp, "SeaBeam 2000\n");
-		break;
-	case BS_INST_SEABEAM2100:
-		(void) fprintf(fp, "SeaBeam 2100\n");
-		break;
-	case BS_INST_SEABEAM3012:
-		(void) fprintf(fp, "SeaBeam 3012\n");
-		break;
-	case BS_INST_SSI:
-		(void) fprintf(fp, "SSI\n");
-		break;
-	case BS_INST_SAICLLS:
-		(void) fprintf(fp, "SAIC Laser Line Scan\n");
-		break;
-	case BS_INST_EDGETECHSS:
-		(void) fprintf(fp, "Edgetech Sidescan\n");
-		break;
-	case BS_INST_EDGETECHSSM:
-		(void) fprintf(fp, "Edgetech Mid-Frequency Sidescan\n");
-		break;
-	case BS_INST_EDGETECHSSH:
-		(void) fprintf(fp, "Edgetech High-Frequency Sidescan\n");
-		break;
-	case BS_INST_EDGETECHSB:
-		(void) fprintf(fp, "Edgetech Subbottom\n");
-		break;
-	default:
-		(void) fprintf(fp, "%1d (unrecognized)\n", bsf->bsf_inst);
-		break;
-	}
-
-	(void) fprintf(fp, "Source Format: ");
-	switch (bsf->bsf_srcformat) {
-	case BS_SFMT_UNDEFINED:
-		(void) fprintf(fp, "?\n");
-		break;
-	case BS_SFMT_MR1:
-		(void) fprintf(fp, "MR1\n");
-		break;
-	case BS_SFMT_TTS:
-		(void) fprintf(fp, "TTS\n");
-		break;
-	case BS_SFMT_GSF:
-		(void) fprintf(fp, "GSF\n");
-		break;
-	case BS_SFMT_GSFDUAL:
-		(void) fprintf(fp, "GSF Dual\n");
-		break;
-	case BS_SFMT_XTF:
-		(void) fprintf(fp, "XTF\n");
-		break;
-	case BS_SFMT_SIMRADEM:
-		(void) fprintf(fp, "Simrad EM\n");
-		break;
-	case BS_SFMT_SIMRADMPB:
-		(void) fprintf(fp, "Simrad MPB\n");
-		break;
-	case BS_SFMT_OIC:
-		(void) fprintf(fp, "OIC\n");
-		break;
-	case BS_SFMT_OICLLS:
-		(void) fprintf(fp, "OIC Laser Line Scan\n");
-		break;
-	case BS_SFMT_MSTIFF:
-		(void) fprintf(fp, "MSTIFF\n");
-		break;
-	case BS_SFMT_SIOSB2000:
-		(void) fprintf(fp, "SIO SB2000\n");
-		break;
-	case BS_SFMT_SSIV21:
-		(void) fprintf(fp, "SSI V21\n");
-		break;
-	case BS_SFMT_XSE:
-		(void) fprintf(fp, "XSE\n");
-		break;
-	case BS_SFMT_JSF:
-		(void) fprintf(fp, "JSF\n");
-		break;
-	default:
-		(void) fprintf(fp, "%1d (unrecognized)\n", bsf->bsf_srcformat);
-		break;
-	}
-
-	if (bsf->bsf_srcfilenm != (char *) NULL)
-		(void) fprintf(fp, "Source File: %s\n", bsf->bsf_srcfilenm);
-	else
-		(void) fprintf(fp, "Source File: ?\n");
-
-	if (bsf->bsf_log != (char *) NULL)
-		(void) fprintf(fp, "Log: %s\n", bsf->bsf_log);
-	else
-		(void) fprintf(fp, "Log:\n");
-
-	return;
-}
-
-void
-pr_pnghdr(Ping *png)
-{
-	int side;
-	PingSide *ps;
-	char *ss;
-	time_t t;
-	struct tm *tmp;
-	long msec;
-	int mbbs_isnanf(float);
-	int mbbs_isnand(double);
-
-	(void) fprintf(fp, "Flags: %#x", png->png_flags);
-	if (png->png_flags) {
-		(void) fprintf(fp, " (");
-		if (png->png_flags & PNG_XYZ)
-			(void) fprintf(fp, " XYZ");
-		if (png->png_flags & PNG_ABI)
-			(void) fprintf(fp, " ABI");
-		if (png->png_flags & PNG_BTYSSFLAGSABSENT)
-			(void) fprintf(fp, " BTYSSFLAGSABSENT");
-		if (png->png_flags & PNG_HIDE)
-			(void) fprintf(fp, " HIDE");
-		if (png->png_flags & PNG_LOWQUALITY)
-			(void) fprintf(fp, " LOWQUALITY");
-		if (png->png_flags & PNG_MSCHIDE)
-			(void) fprintf(fp, " MSCHIDE");
-		(void) fprintf(fp, " )");
-	}
-	(void) fprintf(fp, "\n");
-
-	t= (time_t) png->png_tm.tv_sec;
-	tmp= gmtime(&t);
-	msec= (long) (png->png_tm.tv_usec/1000);
-	switch (tmmode) {
-	case TM_JULIAN:
-		(void) fprintf(fp, "Time: %1d/%03d %02d:%02d:%02d.%03ld\n", (int) (tmp->tm_year+1900), (int) (tmp->tm_yday+1), tmp->tm_hour, tmp->tm_min, tmp->tm_sec, msec);
-		break;
-	case TM_CALENDAR:
-		(void) fprintf(fp, "Time: %1d/%1d/%1d %02d:%02d:%02d.%03ld\n", (int) (tmp->tm_year+1900), (int) (tmp->tm_mon+1), tmp->tm_mday, tmp->tm_hour, tmp->tm_min, tmp->tm_sec, msec);
-		break;
-	}
-
-	if (!showivisping && !mbbs_pngvisible(png->png_flags))
-		return;
-
-	if (mbbs_isnanf(png->png_period))
-		(void) fprintf(fp, "Ping Period: ?\n");
-	else
-		(void) fprintf(fp, "Ping Period: %4.2f\n", png->png_period);
-
-	if (mbbs_isnand(png->png_slon))
-		(void) fprintf(fp, "Ship Longitude: ?\n");
-	else
-		(void) fprintf(fp, "Ship Longitude: %12.10f\n", png->png_slon);
-	if (mbbs_isnand(png->png_slat))
-		(void) fprintf(fp, "Ship Latitude: ?\n");
-	else
-		(void) fprintf(fp, "Ship Latitude: %12.10f\n", png->png_slat);
-	if (mbbs_isnanf(png->png_scourse))
-		(void) fprintf(fp, "Ship Course: ?\n");
-	else
-		(void) fprintf(fp, "Ship Course: %4.2f\n", png->png_scourse);
-	if (mbbs_isnanf(png->png_laybackrng))
-		(void) fprintf(fp, "Layback Range: ?\n");
-	else
-		(void) fprintf(fp, "Layback Range: %4.2f\n", png->png_laybackrng);
-	if (mbbs_isnanf(png->png_laybackbrg))
-		(void) fprintf(fp, "Layback Bearing: ?\n");
-	else
-		(void) fprintf(fp, "Layback Bearing: %4.2f\n", png->png_laybackbrg);
-	if (mbbs_isnand(png->png_tlon))
-		(void) fprintf(fp, "Towfish Longitude: ?\n");
-	else
-		(void) fprintf(fp, "Towfish Longitude: %12.10f\n", png->png_tlon);
-	if (mbbs_isnand(png->png_tlat))
-		(void) fprintf(fp, "Towfish Latitude: ?\n");
-	else
-		(void) fprintf(fp, "Towfish Latitude: %12.10f\n", png->png_tlat);
-	if (mbbs_isnanf(png->png_tcourse))
-		(void) fprintf(fp, "Towfish Course: ?\n");
-	else
-		(void) fprintf(fp, "Towfish Course: %4.2f\n", png->png_tcourse);
-	if (mbbs_isnanf(png->png_compass.sns_int))
-		(void) fprintf(fp, "Compass Sample Interval: ?\n");
-	else
-		(void) fprintf(fp, "Compass Sample Interval: %5.3f\n", png->png_compass.sns_int);
-	(void) fprintf(fp, "Compass Sample Count: %1d\n", png->png_compass.sns_nsamps);
-	if (mbbs_isnanf(png->png_compass.sns_repval))
-		(void) fprintf(fp, "Compass Representative Value: ?\n");
-	else
-		(void) fprintf(fp, "Compass Representative Value: %4.2f\n", png->png_compass.sns_repval);
-	if (mbbs_isnanf(png->png_depth.sns_int))
-		(void) fprintf(fp, "Depth Sample Interval: ?\n");
-	else
-		(void) fprintf(fp, "Depth Sample Interval: %5.3f\n", png->png_depth.sns_int);
-	(void) fprintf(fp, "Depth Sample Count: %1d\n", png->png_depth.sns_nsamps);
-	if (mbbs_isnanf(png->png_depth.sns_repval))
-		(void) fprintf(fp, "Depth Representative Value: ?\n");
-	else
-		(void) fprintf(fp, "Depth Representative Value: %4.2f\n", png->png_depth.sns_repval);
-	if (mbbs_isnanf(png->png_pitch.sns_int))
-		(void) fprintf(fp, "Pitch Sample Interval: ?\n");
-	else
-		(void) fprintf(fp, "Pitch Sample Interval: %5.3f\n", png->png_pitch.sns_int);
-	(void) fprintf(fp, "Pitch Sample Count: %1d\n", png->png_pitch.sns_nsamps);
-	if (mbbs_isnanf(png->png_pitch.sns_repval))
-		(void) fprintf(fp, "Pitch Representative Value: ?\n");
-	else
-		(void) fprintf(fp, "Pitch Representative Value: %4.2f\n", png->png_pitch.sns_repval);
-	if (mbbs_isnanf(png->png_roll.sns_int))
-		(void) fprintf(fp, "Roll Sample Interval: ?\n");
-	else
-		(void) fprintf(fp, "Roll Sample Interval: %5.3f\n", png->png_roll.sns_int);
-	(void) fprintf(fp, "Roll Sample Count: %1d\n", png->png_roll.sns_nsamps);
-	if (mbbs_isnanf(png->png_roll.sns_repval))
-		(void) fprintf(fp, "Roll Representative Value: ?\n");
-	else
-		(void) fprintf(fp, "Roll Representative Value: %4.2f\n", png->png_roll.sns_repval);
-	if (mbbs_isnanf(png->png_temp))
-		(void) fprintf(fp, "Temperature: ?\n");
-	else
-		(void) fprintf(fp, "Temperature: %6.4f\n", png->png_temp);
-	if (slantrng)
-		(void) fprintf(fp, "Sidescan Increment: %7.5f\n", png->png_ssincr);
-	else
-		(void) fprintf(fp, "Sidescan Increment: %5.3f\n", png->png_ssincr);
-	switch (png->png_ssyoffsetmode) {
-	case PNG_SSYOM_UNKNOWN:
-		(void) fprintf(fp, "Sidescan Along-Track Offset Mode: Unknown\n");
-		break;
-	case PNG_SSYOM_CONSTANT:
-		(void) fprintf(fp, "Sidescan Along-Track Offset Mode: Constant\n");
-		break;
-	case PNG_SSYOM_USEBTYY:
-		(void) fprintf(fp, "Sidescan Along-Track Offset Mode: Use Bathymetry Y-Offsets\n");
-		break;
-	}
-	if (mbbs_isnanf(png->png_alt))
-		(void) fprintf(fp, "Altitude: ?\n");
-	else
-		(void) fprintf(fp, "Altitude: %4.2f\n", png->png_alt);
-	if (mbbs_isnanf(png->png_magcorr))
-		(void) fprintf(fp, "Magnetic Correction: ?\n");
-	else
-		(void) fprintf(fp, "Magnetic Correction: %4.2f\n", png->png_magcorr);
-	if (mbbs_isnanf(png->png_sndvel))
-		(void) fprintf(fp, "Sound Velocity: ?\n");
-	else
-		(void) fprintf(fp, "Sound Velocity: %4.2f\n", png->png_sndvel);
-	if (mbbs_isnanf(png->png_cond))
-		(void) fprintf(fp, "Conductivity: ?\n");
-	else
-		(void) fprintf(fp, "Conductivity: %6.4f\n", png->png_cond);
-	if (mbbs_isnanf(png->png_magx))
-		(void) fprintf(fp, "Magnetic Field X: ?\n");
-	else
-		(void) fprintf(fp, "Magnetic Field X: %4.2f\n", png->png_magx);
-	if (mbbs_isnanf(png->png_magy))
-		(void) fprintf(fp, "Magnetic Field Y: ?\n");
-	else
-		(void) fprintf(fp, "Magnetic Field Y: %4.2f\n", png->png_magy);
-	if (mbbs_isnanf(png->png_magz))
-		(void) fprintf(fp, "Magnetic Field Z: ?\n");
-	else
-		(void) fprintf(fp, "Magnetic Field Z: %4.2f\n", png->png_magz);
-
-	for (side= ACP_PORT; side < ACP_NSIDES; side++) {
-		ps= &(png->png_sides[side]);
-		ss= sdstr[side];
-		if (mbbs_isnanf(ps->ps_xmitpwr))
-			(void) fprintf(fp, "%s Transmit Power: ?\n", ss);
-		else
-			(void) fprintf(fp, "%s Transmit Power: %4.2f\n", ss, ps->ps_xmitpwr);
-		if (mbbs_isnanf(ps->ps_gain))
-			(void) fprintf(fp, "%s Gain: ?\n", ss);
-		else
-			(void) fprintf(fp, "%s Gain: %4.2f\n", ss, ps->ps_gain);
-		if (mbbs_isnanf(ps->ps_pulse))
-			(void) fprintf(fp, "%s Pulse Length: ?\n", ss);
-		else
-			(void) fprintf(fp, "%s Pulse Length: %4.2f\n", ss, ps->ps_pulse);
-		if (mbbs_isnanf(ps->ps_bdrange))
-			(void) fprintf(fp, "%s Bottom Detect Range: ?\n", ss);
-		else
-			(void) fprintf(fp, "%s Bottom Detect Range: %4.2f\n", ss, ps->ps_bdrange);
-		(void) fprintf(fp, "%s Bathymetry Count: %1d\n", ss, ps->ps_btycount);
-		if (slantrng)
-			(void) fprintf(fp, "%s Sidescan Across-Track Offset: %7.5f\n", ss, ps->ps_ssxoffset);
-		else
-			(void) fprintf(fp, "%s Sidescan Across-Track Offset: %5.3f\n", ss, ps->ps_ssxoffset);
-		(void) fprintf(fp, "%s Sidescan Count: %1d\n", ss, ps->ps_sscount);
-		(void) fprintf(fp, "%s Sidescan Nadir Mask: %4.2f\n", ss, ps->ps_ssndrmask);
-		if (mbbs_isnanf(ps->ps_ssyoffset))
-			(void) fprintf(fp, "Sidescan Along-Track Offset: ?\n");
-		else
-			(void) fprintf(fp, "Sidescan Along-Track Offset: %4.2f\n", ps->ps_ssyoffset);
-	}
-
-	return;
-}
diff --git a/src/bsio/bsfile.4 b/src/bsio/bsfile.4
deleted file mode 100644
index 8ad9312..0000000
--- a/src/bsio/bsfile.4
+++ /dev/null
@@ -1,622 +0,0 @@
-.TH bsfile 4 "31 December 2011"
-.SH NAME
-bsfile \- file format for Hawaii Mapping Research Group BS software
-.SH SYNOPSIS
-\fB#include <local/bs.h>\fR
-.SH DESCRIPTION
-.LP
-A BS file is used for the storage of binary ping data operated upon by the
-Hawaii Mapping Research Group's BS processing system. The file is portable
-among machines of varying architecture by virtue of its XDR implementation.
-It is composed of a file header which describes the number of pings
-contained in the file followed by the pings themselves. Each ping contains
-a header structure followed by a stream of sensor (i.e., towfish compass,
-depth, pitch and roll), bathymetry and sidescan data of arbitrary length.
-.LP
-This file format was originally known as MR1 format due to its initial
-purpose of supporting the HAWAII-MR1 sonar. The format was renamed as
-BS in 2005 to indicate its more general support for bathymetry and
-sidescan data from various instruments, as well as to differentiate it
-from the raw HAWAII-MR1 acquisition format which is radically different.
-Any perceived comment on its inherent quality is wholly unintentional.
-.LP
-Following is a partial listing of the contents of the file bs.h which define
-the file and ping header structures and a few relevant constants:
-.sp 24p
-/* version number, guaranteed to be strictly
-.br
-   increasing and in chronological order */
-.br
-#define MR1_VERSION_1_0		(6666)		/* obsolete version */
-.br
-#define MR1_VERSION_2_0		(6667)		/* obsolete version */
-.br
-#define BS_VERSION_1_0		(6668)		/* obsolete as of 2007/06/28 */
-.br
-#define BS_VERSION_1_1		(6669)		/* obsolete as of 2007/11/27 */
-.br
-#define BS_VERSION_1_2		(6670)		/* obsolete as of 2008/04/14 */
-.br
-#define BS_VERSION_1_3		(6671)		/* obsolete as of 2010/03/10 */
-.br
-#define BS_VERSION_1_4		(6672)		/* current version */
-
-.br
-/* file flag bits */
-.br
-#define BS_CLEAR			(0x0)
-.br
-#define BS_SSSLANTRNG		(0x1)		/* sidescan are slant range */
-.br
-#define BS_MSCPINGDELRST		(0x2)		/* ping delete/restore via mosaic GUI */
-.br
-#define BS_MSCNAVEDIT		(0x4)		/* navigation edits via mosaic GUI */
-.br
-#define BS_MSCBRKFILE		(0x8)		/* file break via mosaic GUI */
-.br
-#define BS_MSCEDGETRIM		(0x10)		/* edge trims via mosaic GUI */
-.br
-
-.br
-/* acquisition instruments */
-.br
-#define BS_INST_UNDEFINED		(-1)
-.br
-#define BS_INST_MR1			(0)
-.br
-#define BS_INST_SEAMAPB		(1)
-.br
-#define BS_INST_IMI30			(2)
-.br
-#define BS_INST_IMI12			(3)
-.br
-#define BS_INST_DSL120A		(4)
-.br
-#define BS_INST_SEAMAPC		(100)
-.br
-#define BS_INST_SCAMP		(150)
-.br
-#define BS_INST_EM120			(2000)
-.br
-#define BS_INST_EM1002		(2001)
-.br
-#define BS_INST_EM300			(2002)
-.br
-#define BS_INST_EM3000		(2003)
-.br
-#define BS_INST_EM3002		(2004)
-.br
-#define BS_INST_EM3000D		(2005)
-.br
-#define BS_INST_EM3002D		(2006)
-.br
-#define BS_INST_EM2000		(2007)
-.br
-#define BS_INST_EM122			(2008)
-.br
-#define BS_INST_EM302			(2009)
-.br
-#define BS_INST_EM710			(2010)
-.br
-#define BS_INST_SM2000		(2050)
-.br
-#define BS_INST_RESON8101		(3000)
-.br
-#define BS_INST_RESON8111		(3001)
-.br
-#define BS_INST_RESON8124		(3002)
-.br
-#define BS_INST_RESON8125		(3003)
-.br
-#define BS_INST_RESON8150		(3004)
-.br
-#define BS_INST_RESON8160		(3005)
-.br
-#define BS_INST_AMS120		(4000)
-.br
-#define BS_INST_REMUS		(4100)
-.br
-#define BS_INST_KLEIN5000		(5000)
-.br
-#define BS_INST_SEABEAM2000	(6000)
-.br
-#define BS_INST_SEABEAM2100	(6010)
-.br
-#define BS_INST_SEABEAM3012	(6050)
-.br
-#define BS_INST_SSI			(7000)
-.br
-#define BS_INST_SAICLLS		(8000)
-.br
-#define BS_INST_EDGETECHSS		(9000)
-.br
-#define BS_INST_EDGETECHSSM		(9001)
-.br
-#define BS_INST_EDGETECHSSH		(9002)
-.br
-#define BS_INST_EDGETECHSB		(9003)
-.br
-
-.br
-/* source file formats */
-.br
-#define BS_SFMT_UNDEFINED		(-1)
-.br
-#define BS_SFMT_MR1			(0)
-.br
-#define BS_SFMT_TTS			(1)
-.br
-#define BS_SFMT_GSF			(1000)
-.br
-#define BS_SFMT_GSFDUAL		(1001)
-.br
-#define BS_SFMT_XTF			(1100)
-.br
-#define BS_SFMT_SIMRADEM		(2000)
-.br
-#define BS_SFMT_SIMRADMPB		(2001)
-.br
-#define BS_SFMT_OIC			(4000)
-.br
-#define BS_SFMT_OICLLS		(4001)
-.br
-#define BS_SFMT_MSTIFF		(4100)
-.br
-#define BS_SFMT_SIOSB2000		(6000)
-.br
-#define BS_SFMT_SSIV21		(7000)
-.br
-#define BS_SFMT_XSE			(8000)
-.br
-#define BS_SFMT_JSF			(9000)
-.br
-
-.br
-/* data type mask bits */
-.br
-#define BS_DTM_NONE			(0)
-.br
-#define BS_DTM_COMPASS			(0x1)
-.br
-#define BS_DTM_DEPTH			(0x2)
-.br
-#define BS_DTM_PITCH			(0x4)
-.br
-#define BS_DTM_ROLL			(0x8)
-.br
-#define BS_DTM_BATHYMETRY		(0x10)
-.br
-#define BS_DTM_SIDESCAN			(0x20)
-.br
-
-.br
-typedef struct bsf_struct {
-.br
-	int bsf_version;			/* file format version number */
-.br
-	int bsf_count;			/* number of objects */
-.br
-	unsigned int bsf_flags;		/* BS_SSSLANTRNG, etc. */
-.br
-	int bsf_inst;			/* acquisition instrument */
-.br
-	int bsf_srcformat;		/* source file format */
-.br
-	char *bsf_srcfilenm;		/* source file name */
-.br
-	char *bsf_log;			/* processing log */
-.br
-} BSFile;
-.br
-
-.br
-typedef struct sns_struct {
-.br
-	float sns_int;			/* sample interval (secs) */
-.br
-	int sns_nsamps;			/* number of samples */
-.br
-	float sns_repval;			/* single representative value of the sensor
-.br
-					   for an entire ping, usually derived from
-.br
-					   the full set of samples for that ping */
-.br
-} Sensor;
-.br
-
-.br
-typedef struct ps_struct {
-.br
-	float ps_xmitpwr;			/* transmitter power (1=full) */
-.br
-	float ps_gain;			/* gain setting */
-.br
-	float ps_pulse;			/* pulse length (millisecs) */
-.br
-	float ps_bdrange;			/* bottom detect range (m) */
-.br
-	int ps_btycount;			/* number of bathymetry samples */
-.br
-	int ps_btypad;			/* number of trailing bathymetry pad samples */
-.br
-	float ps_ssxoffset;			/* across-track distance (m) or, for
-.br
-					   BS_SSSLANTRNG files, time (s) to first
-.br
-					   sidescan sample */
-.br
-	int ps_sscount;			/* number of sidescan samples */
-.br
-	int ps_sspad;			/* number of trailing sidescan pad samples */
-.br
-	float ps_ssndrmask;		/* across-track distance to outer edge
-.br
-					   of nadir region data to be masked */
-.br
-	float ps_ssyoffset;			/* sidescan along-track offset (m) */
-.br
-} PingSide;
-.br
-
-.br
-#define PNG_CLEAR			(0x0)
-.br
-#define PNG_XYZ			(0x1)	/* bathymetry is x/y/z instead
-.br
-						   of x/z only */
-.br
-#define PNG_ABI			(0x2)	/* auxiliary beam info present */
-.br
-#define PNG_BTYSSFLAGSABSENT	(0x4)	/* indicates that input file does
-.br
-						   not contain bathymetry or
-.br
-						   sidescan flags, i.e., the file
-.br
-						   is in an older flagless format
-.br
-						   version; all output files are
-.br
-						   written with flags and this bit
-.br
-						   is always unset when written
-.br
-						   to output */
-.br
-#define PNG_HIDE			(0x8)	/* ping should not be displayed */
-.br
-#define PNG_LOWQUALITY		(0x10)	/* ping is of unacceptably low quality */
-.br
-#define PNG_MSCHIDE			(0x20)	/* ping should not be displayed
-.br
-						   in a mosaic */
-.br
-/* sidescan along-track offset mode */
-.br
-#define PNG_SSYOM_UNKNOWN	(0)	/* unknown (all pre-BS-1.4 files) */
-.br
-#define PNG_SSYOM_CONSTANT	(1)	/* constant offset for entire ping */
-.br
-#define PNG_SSYOM_USEBTYY	(2)	/* use bathymetry y-offsets */
-.br
-
-.br
-#define PNG_BYTEALIGNSZ		(8)	/* byte alignment constraint for
-.br
-						   beginning of auxiliary beam
-.br
-						   info section of data buffer */
-.br
-
-.br
-typedef struct png_struct {
-.br
-	unsigned int png_flags;		/* PNG_XYZ, etc. */
-.br
-	struct timeval png_tm;		/* timestamp */
-.br
-	float png_period;			/* ping period (secs) */
-.br
-	double png_slon;			/* ship longitude (deg) */
-.br
-	double png_slat;			/* ship latitude (deg) */
-.br
-	float png_scourse;		/* ship course (deg) */
-.br
-	float png_laybackrng;		/* towfish layback range (m) */
-.br
-	float png_laybackbrg;		/* towfish layback bearing (deg, where 0=shipaxis,
-.br
-					   pos=port, neg=starboard) */
-.br
-	double png_tlon;			/* towfish longitude (deg) */
-.br
-	double png_tlat;			/* towfish latitude (deg) */
-.br
-	float png_tcourse;		/* towfish course (deg) */
-.br
-	Sensor png_compass;		/* towfish compass heading (deg, where 0=N, 90=E)
-.br
-					   with no magnetic correction applied to either
-.br
-					   the representative value or the sample array */
-.br
-	Sensor png_depth;		/* towfish depth (m) */
-.br
-	Sensor png_pitch;		/* towfish pitch (deg, where + is nose up) */
-.br
-	Sensor png_roll;			/* towfish roll (deg, where + is port down) */
-.br
-	int png_snspad;			/* number of invalid trailing pad sensor samples */
-.br
-	float png_temp;			/* water temperature (deg C) */
-.br
-	float png_ssincr;			/* sidescan increment in across-track distance (m)
-.br
-					   or, for BS_SSSLANTRNG files, time (s) */
-.br
-	int png_ssyoffsetmode;		/* sidescan along-track offset mode */
-.br
-	float png_alt;			/* towfish altitude (m) */
-.br
-	float png_magcorr;		/* magnetic correction (deg) */
-.br
-	float png_sndvel;			/* sound velocity (m/sec) */
-.br
-	float png_cond;			/* conductivity (siemens/m) */
-.br
-	float png_magx;			/* magnetic field x (microteslas) */
-.br
-	float png_magy;			/* magnetic field y (microteslas) */
-.br
-	float png_magz;			/* magnetic field z (microteslas) */
-.br
-	PingSide png_sides[ACP_NSIDES];
-.br
-} Ping;
-.br
-
-.br
-/* bathymetry per-sample flag bits
-.br
-   (must fit in a 4-byte integer) */
-.br
-#define BTYD_CLEAR		(0x0)	/* no flag -- sample is valid */
-.br
-#define BTYD_MISC		(0x1)	/* invalidated for non-specific reason */
-.br
-#define BTYD_EXTERNAL	(0x2)	/* invalidated by external (non-HMRG) software */
-.br
-#define BTYD_MINMAXCLIP	(0x4)	/* deleted by min/max depth clip */
-.br
-#define BTYD_MAXANGLE	(0x8)	/* exceeds maximum angle */
-.br
-#define BTYD_MINANGLE	(0x10)	/* less than minimum angle */
-.br
-#define BTYD_SWEDGE		(0x20)	/* deleted from edge of swath */
-.br
-#define BTYD_SWRECT		(0x40)	/* deleted swath rectangle interior */
-.br
-#define BTYD_MFSWAPERR	(0x80)	/* mapping function swap error */
-.br
-#define BTYD_SRFABOVECLIP	(0x100)	/* clipped from above a surface */
-.br
-#define BTYD_SRFBELOWCLIP	(0x200)	/* clipped from below a surface */
-.br
-#define BTYD_XZPRECT		(0x400)	/* deleted xz-profile rectangle interior */
-.br
-
-.br
-/* sidescan per-sample flag bits (must
-.br
-   fit in a 1-byte unsigned char) */
-.br
-#define SSD_CLEAR		(0x0)	/* no flag -- sample is valid */
-.br
-#define SSD_MISC		(0x1)	/* invalidated for non-specific reason */
-.br
-#define SSD_EXTERNAL	(0x2)	/* invalidated by external (non-HMRG) software */
-.br
-#define SSD_MAXANGLE	(0x4)	/* exceeds maximum angle */
-.br
-#define SSD_MINANGLE	(0x8)	/* less than minimum angle */
-.br
-#define SSD_SWEDGE		(0x10)	/* deleted from edge of swath */
-.br
-#define SSD_SWRECT		(0x20)	/* deleted swath rectangle interior */
-.br
-
-.br
-/* AuxBeamInfo --
-.br
-   This structure contains various bits of per-beam information
-.br
-   necessary to reconvert back to a source multibeam format. */
-.br
-
-.br
-/* auxiliary beam information flag bits */
-.br
-#define ABI_CLEAR		(0x0)
-.br
-#define ABI_SSVALID		(0x1)	/* sidescan valid */
-.br
-
-.br
-typedef struct abi_struct {
-.br
-	unsigned int abi_flags;		/* ABI_SSVALID, etc. */
-.br
-	int abi_id;			/* beam number */
-.br
-	float abi_ssat0;			/* across-track distance of first sidescan sample */
-.br
-	float abi_ssat1;			/* across-track distance of last sidescan sample */
-.br
-} AuxBeamInfo;
-.br
-
-.br
-typedef struct pd_struct {
-.br
-	float *pd_compass;
-.br
-	float *pd_depth;
-.br
-	float *pd_pitch;
-.br
-	float *pd_roll;
-.br
-	float *pd_bty[ACP_NSIDES];
-.br
-	unsigned int *pd_btyflags[ACP_NSIDES];
-.br
-	float *pd_ss[ACP_NSIDES];
-.br
-	unsigned char *pd_ssflags[ACP_NSIDES];
-.br
-	AuxBeamInfo *pd_abi[ACP_NSIDES];
-.br
-} PingData;
-.LP
-The first data object in the file is a \fIBSFile\fR structure. The
-structure is stored in the file by storing one XDR primitive for each
-of the structure's fields. These are stored in the same order as the
-fields are defined within the structure, i.e., an initial 4-byte XDR
-integer containing the file format version number, a second 4-byte XDR
-integer representing the count of pings contained within the file,
-a 4-byte XDR unsigned integer containing various flag bits, another
-4-byte XDR integer representing the type of acquisition instrument,
-if any, which originally generated the data which is either in the
-file or from which the file's data were derived, another 4-byte XDR
-integer describing the source format of the data, if any, from which
-the file's data were derived, a string which is the name of the file
-containing the data, if any, from which the file's data were derived
-and finally a string containing a log entry. (Note that strings are
-stored as a 4-byte XDR integer describing the string's length followed
-by the bytes of the string, if any. No null terminator byte is stored
-in the file.)
-.LP
-The remainder of the file consists of a sequence of 0 or more pings,
-where each ping consists of some ping header information immediately
-followed by that ping's data samples. The ping header data is stored
-by storing one XDR primitive for each of the \fIPing\fR structure's
-fields. These primitives are written in the order in which they are
-defined within the \fIPing\fR structure, with the exception of the
-\fIpng_snspad\fR field which is not stored in the file (as no sensor
-sample padding is ever written to a file and hence the value of this
-field is assumed to be 0). Wherever a field is of non-primitive type,
-i.e., is not a simple \fIint, unsigned int, float, double\fR, etc., but
-is rather a structure of some other type (i.e., \fIstruct timeval, Sensor\fR
-or \fIPingSide\fR), then that substructure is stored by storing one XDR
-primitive for each of its fields in turn with certain exceptions as
-follows: (i) the fields of the \fIpng_tm\fR substructure are stored as
-4-byte XDR integers regardless of whether the host platform is 32- or
-64-bit, and (ii) the \fIps_btypad\fR and \fIps_sspad\fR fields of the
-\fIPingSide\fR structure are not stored (as no bathymetry or sidescan
-sample padding is ever written to a file and hence the values of these
-fields are assumed to be 0). Note that the last member of the \fIPing\fR
-structure is an array of two \fIPingSide\fR structure elements. The port
-\fIPingSide\fR structure is stored first and the starboard \fIPingSide\fR
-structure is stored second.
-.LP
-Immediately after each ping's header its data samples are stored in the
-following order: (i) towfish compass, (ii) towfish depth, (iii) towfish
-pitch, (iv) towfish roll, (v) port bathymetry, (vi) port bathymetry flags,
-(vii) port sidescan, (viii) port sidescan flags, (ix) starboard bathymetry,
-(x) starboard bathymetry flags, (xi) starboard sidescan, (xii) starboard
-sidescan flags, (xiii) port auxiliary beam information, and
-(xiv) starboard auxiliary beam information.
-.LP
-The numbers of towfish compass, depth, pitch and roll samples are contained
-in the \fIsns_nsamps\fR fields of the \fIpng_compass\fR, \fIpng_depth\fR,
-\fIpng_pitch\fR and \fIpng_roll\fR \fISensor\fR structures embedded within
-the \fIPing\fR structure. A single 4-byte XDR float is stored for each
-sample from these sensors.
-.LP
-The numbers of bathymetry samples for the two sides are contained
-in the \fIps_btycount\fR fields of the port and starboard
-\fIPingSide\fR structures embedded within the \fIPing\fR structure.
-Each bathymetry sample consists of either two or three consecutive 4-byte
-XDR float values depending upon the value of the \fIPing\fR structure's
-\fIpng_flags\fR field. If the \fB\s-1PNG_XYZ\s0\fR bit of the latter is
-set then each sample is an x/y/z triplet with the first value
-representing across-track distance, the second value representing
-along-track distance and the third value representing depth. If the
-\fB\s-1PNG_XYZ\s0\fR bit is not set then the data are in x/z format, i.e.,
-the along-track distance is not present. The samples of each side must
-be sorted in order of increasing x, i.e., increasing across-track distance.
-Note that x will nearly always be non-negative for samples on both sides,
-e.g., an x-value of 5 indicates that a port sample lies 5 meters to the
-port side of nadir or that a starboard sample lies 5 meters to the
-starboard side of nadir. Negative x-values are rare though legal, and
-indicate that a sample actually lies on the opposite side of nadir, e.g.
-a port sample with an x-value of -5 lies 5 meters to the starboard side
-of nadir.
-.LP
-A sequence of bathymetry flag values follows the bathymetry samples, one
-flag value per sample where each flag value is stored as a 4-byte XDR
-unsigned integer. Each flag value is a composite bitmask of the bit-fields
-\fB\s-1BTYD_MISC, BTYD_DEPTHCLIP\s0\fR, etc., and indicates whether
-a particular sample has been flagged as invalid for one or more
-reasons. A flag value of \fB\s-1BTYD_CLEAR\s0\fR indicates that a
-sample has not been flagged as invalid.
-.LP
-The numbers of sidescan samples for the two sides are contained in the
-\fIps_sscount\fR fields of the port and starboard \fIPingSide\fR
-structures embedded within the \fIPing\fR structure. Each sidescan sample
-consists of a single 4-byte XDR float value representing a reflection
-intensity. Samples are stored in order of their increasing distance from
-swath nadir or, if the \fB\s-1BS_SSSLANTRNG\s0\fR bit of the
-\fIbsf_flags\fR field of the \fIBSFile\fR structure is set, in order of
-their increasing time from the start of the ping.
-.LP
-A sequence of sidescan flag values follows the sidescan samples, one
-flag value per sample where the complete set of flag values for each side
-of a ping is stored as a single XDR byte array (via \fBxdr_bytes()\fR)
-containing a 1-byte flag value per sidescan sample. Each flag value is
-a composite bitmask of the bit-fields \fB\s-1SSD_MISC, SSD_MAXANGLE\s0\fR,
-etc., and indicates whether a particular sample has been flagged as invalid
-for one or more reasons. A flag value of \fB\s-1SSD_CLEAR\s0\fR indicates
-that a sample has not been flagged as invalid.
-.LP
-The final component of the ping data samples is the optional auxiliary
-beam information. If this component is present, a single \fIAuxBeamInfo\fR
-structure will be stored for each bathymetry sample. Those structures
-corresponding to the port data are stored first, followed by those
-structures corresponding to the starboard data. Each such structure is
-stored by storing one XDR primitive for each of its fields, written in the
-order in which they are defined within the \fIAuxBeamInfo\fR structure.
-.LP
-Note that the ordering of bathymetry samples, bathymetry flags and auxiliary
-beam information structures, which are all in one-to-one correspondence,
-is identical, e.g., the \fIn\fRth port bathymetry sample corresponds to
-the \fIn\fRth port bathymetry flag value and the \fIn\fRth port auxiliary
-beam information structure.
-.LP
-Although the sample padding described in the \fBbs\fR(3) manual page may
-be present within an in-memory image of a BS data set, such padding will
-never be stored into a BS disk file. Consequently, the various
-\fIpng_snspad, ps_btypad\fR and \fIps_sspad\fR fields are never written
-to BS files and are assumed to be 0 as noted above.
-.LP
-IEEE NaN (not-a-number) is used by this format to indicate that the value
-of a particular header field (e.g., towfish altitude) or data sample is
-unknown. It is common for most of the sensor samples (e.g., roll) in files
-derived from HAWAII-MR1, for instance, to be stored as NaNs because that
-instrument logs such samples at an irregular rate. Those samples are then
-transformed into a set of regularly logged samples by filling the gaps
-between the real samples with NaN placeholder values, with the expectation
-that in some later processing stage those placeholder values will be turned
-into real numbers via some form of interpolation.
-.LP
-I/O routines which read and write the structures described here are
-available from the \fBbs\fR(3) library.
-.SH FILES
-\fB/usr/include/local/bs.h\fR
-.SH SEE ALSO
-.BR bs (3),
-.BR bs2asc (1)
-.SH AUTHOR
-Roger Davis, July 2005.
diff --git a/src/bsio/mbbs.h b/src/bsio/mbbs.h
deleted file mode 100644
index e6ea6bb..0000000
--- a/src/bsio/mbbs.h
+++ /dev/null
@@ -1,154 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbbs.h	3/3/2014
- *	$Id: mbbs.h 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 2014-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/* This source code is part of the mbbsio library used to read and write
- * swath sonar data in the bsio format devised and used by the
- * Hawaii Mapping Research Group of the University of Hawaii.
- * This source code was made available by Roger Davis of the
- * University of Hawaii under the GPL. Minor modifications have
- * been made to the version distributed here as part of MB-System.
- *
- * Author:	Roger Davis (primary author)
- * Author:	D. W. Caress (MB-System revisions)
- * Date:	March 3, 2014 (MB-System revisions)
- *
- *--------------------------------------------------------------------*/
-/*
- *	Copyright (c) 2005 by University of Hawaii.
- */
-
-/*
- *	bs.h --
- *	Hawaii Mapping Research Group BS file processing definitions.
- */
-
-#ifndef __MBBS__
-#define __MBBS__
-
-#include "mbbs_defines.h"
-
-#define mbbs_pngvisible(f)	((int) (!(((unsigned int) f) & PNG_HIDE) && \
-				        !(((unsigned int) f) & PNG_LOWQUALITY)))
-#define mbbs_pngmscvisible(f)	((int) (!(((unsigned int) f) & PNG_MSCHIDE) && \
-					!(((unsigned int) f) & PNG_HIDE) && \
-				        !(((unsigned int) f) & PNG_LOWQUALITY)))
-
-extern unsigned long mbbs_iobytecnt;
-
-#if defined(c_plusplus) || defined(__cplusplus)
-extern "C" {
-
-int			mbbs_appendlog(BSFile *, char **);
-int			mbbs_appendstr(char **, char *);
-void			mbbs_cal2jul(struct tm *);
-int			mbbs_copypng(int, XDR *, XDR *, int);
-int			mbbs_freebsfmem(BSFile *);
-int			mbbs_getpngdataptrs(Ping *, MemType *, PingData *);
-int			mbbs_isnand(double);
-int			mbbs_isnanf(float);
-void			mbbs_jul2cal(struct tm *);
-int			mbbs_leapyr(struct tm *);
-int			mbbs_mrkget(void *, int, int);
-void *			mbbs_mrkmemalloc(int);
-void			mbbs_mrkset(void *, int, int, int);
-double			mbbs_nand();
-float			mbbs_nanf();
-int			mbbs_pngdatabufsz(Ping *, unsigned long long *);
-MemType *		mbbs_pngmemalloc(Ping *);
-int			mbbs_pngrealloc(Ping *, MemType **, unsigned int *);
-int			mbbs_rdbsfhdr(BSFile *, XDR *);
-int			mbbs_rdpng(Ping *, MemType **, XDR *, int);
-int			mbbs_rdpngdata(Ping *, MemType *, XDR *);
-int			mbbs_rdpnghdr(Ping *, XDR *, int);
-int			mbbs_rdpngpddata(Ping *, PingData *, XDR *);
-int			mbbs_rdversion(FILE *, int *);
-int			mbbs_replacestr(char **, char *);
-int			mbbs_seekpng(int, XDR *, int);
-int			mbbs_seekpngdata(Ping *, XDR *);
-int			mbbs_setgmttz();
-int			mbbs_setswradius(int, FILE *, long, int, unsigned int, float);
-int			mbbs_splitfile(char *, char *, char *, int, char *);
-int			mbbs_striptail(char *, char);
-int			mbbs_tmparse(char *, int, double *);
-int			mbbs_tmparsegmttz(char *, int, double *);
-int			mbbs_wrbsfhdr(BSFile *, XDR *);
-int			mbbs_wrfflagsclrbits(FILE *, unsigned int);
-int			mbbs_wrfflagssetbits(FILE *, unsigned int);
-int			mbbs_wrpflagsclrbits(int, FILE *, long, unsigned int);
-int			mbbs_wrpflags(int, FILE *, long, unsigned int);
-int			mbbs_wrpflagssetbits(int, FILE *, long, unsigned int);
-int			mbbs_wrpng(Ping *, MemType *, XDR *);
-int			mbbs_wrpngdata(Ping *, MemType *, XDR *);
-int			mbbs_wrpngpddata(Ping *, PingData *, XDR *);
-int			mbbs_wrpnghdr(Ping *, XDR *);
-int			mbbs_wrsllc(int, FILE *, long, double, double, float);
-int			mbbs_wrtll(int, FILE *, long, double, double);
-int			mbbs_wrtllc(int, FILE *, long, double, double, float);
-int			mbbs_xdrstring(XDR *, char **, unsigned long *);
-
-}
-
-#else
-
-extern int		mbbs_appendlog(BSFile *, char **);
-extern int		mbbs_appendstr(char **, char *);
-extern void		mbbs_cal2jul(struct tm *);
-extern int		mbbs_copypng(int, XDR *, XDR *, int);
-extern int		mbbs_freebsfmem(BSFile *);
-extern int		mbbs_getpngdataptrs(Ping *, MemType *, PingData *);
-extern int		mbbs_isnand(double);
-extern int		mbbs_isnanf(float);
-extern void		mbbs_jul2cal(struct tm *);
-extern int		mbbs_leapyr(struct tm *);
-extern int		mbbs_mrkget(void *, int, int);
-extern void *		mbbs_mrkmemalloc(int);
-extern void		mbbs_mrkset(void *, int, int, int);
-extern double		mbbs_nand();
-extern float		mbbs_nanf();
-extern int		mbbs_pngdatabufsz(Ping *, unsigned long long *);
-extern MemType *	mbbs_pngmemalloc(Ping *);
-extern int		mbbs_pngrealloc(Ping *, MemType **, unsigned int *);
-extern int		mbbs_rdbsfhdr(BSFile *, XDR *);
-extern int		mbbs_rdpng(Ping *, MemType **, XDR *, int);
-extern int		mbbs_rdpngdata(Ping *, MemType *, XDR *);
-extern int		mbbs_rdpnghdr(Ping *, XDR *, int);
-extern int		mbbs_rdpngpddata(Ping *, PingData *, XDR *);
-extern int		mbbs_rdversion(FILE *, int *);
-extern int		mbbs_replacestr(char **, char *);
-extern int		mbbs_seekpng(int, XDR *, int);
-extern int		mbbs_seekpngdata(Ping *, XDR *);
-extern int		mbbs_setgmttz();
-extern int		mbbs_setswradius(int, FILE *, long, int, unsigned int, float);
-extern int		mbbs_splitfile(char *, char *, char *, int, char *);
-extern int		mbbs_striptail(char *, char);
-extern int		mbbs_tmparse(char *, int, double *);
-extern int		mbbs_tmparsegmttz(char *, int, double *);
-extern int		mbbs_wrbsfhdr(BSFile *, XDR *);
-extern int		mbbs_wrfflagsclrbits(FILE *, unsigned int);
-extern int		mbbs_wrfflagssetbits(FILE *, unsigned int);
-extern int		mbbs_wrpflagsclrbits(int, FILE *, long, unsigned int);
-extern int		mbbs_wrpflags(int, FILE *, long, unsigned int);
-extern int		mbbs_wrpflagssetbits(int, FILE *, long, unsigned int);
-extern int		mbbs_wrpng(Ping *, MemType *, XDR *);
-extern int		mbbs_wrpngdata(Ping *, MemType *, XDR *);
-extern int		mbbs_wrpnghdr(Ping *, XDR *);
-extern int		mbbs_wrpngpddata(Ping *, PingData *, XDR *);
-extern int		mbbs_wrsllc(int, FILE *, long, double, double, float);
-extern int		mbbs_wrtll(int, FILE *, long, double, double);
-extern int		mbbs_wrtllc(int, FILE *, long, double, double, float);
-extern int		mbbs_xdrstring(XDR *, char **, unsigned long *);
-
-#endif /* defined(c_plusplus) || defined(__cplusplus) */
-
-#endif /* __MBBS__ */
diff --git a/src/bsio/mbbs_defines.h b/src/bsio/mbbs_defines.h
deleted file mode 100644
index fe26236..0000000
--- a/src/bsio/mbbs_defines.h
+++ /dev/null
@@ -1,563 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbbs_defines.h	3/3/2014
- *	$Id: mbbs_defines.h 2239 2015-05-07 00:51:42Z caress $
- *
- *    Copyright (c) 2014-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/* This source code is part of the mbbsio library used to read and write
- * swath sonar data in the bsio format devised and used by the
- * Hawaii Mapping Research Group of the University of Hawaii.
- * This source code was made available by Roger Davis of the
- * University of Hawaii under the GPL. Minor modifications have
- * been made to the version distributed here as part of MB-System.
- *
- * Author:	Roger Davis (primary author)
- * Author:	D. W. Caress (MB-System revisions)
- * Date:	March 3, 2014 (MB-System revisions)
- *
- *--------------------------------------------------------------------*/
-/*
- *	Copyright (c) 2004 by University of Hawaii.
- */
-
-/*
- *	bs_defines.h --
- *	Hawaii Mapping Research Group BS (bathymetry/sidescan)
- *	file format definitions.
- */
-
-#ifndef __MBBS_DEFINES__
-#define __MBBS_DEFINES__
-
-#include <time.h>
-#ifndef WIN32
-#include <sys/time.h>
-#endif
-
-/* The preprocessor code inserted here to insure access to
- * XDR definitions is changed from the HMRG codebase */
-
-#ifdef HAVE_CONFIG_H
-#include <mb_config.h>
-
-/* XDR i/o include file */
-#ifdef HAVE_RPC_RPC_H
-# include <rpc/rpc.h>
-#endif
-#ifdef HAVE_RPC_TYPES_H
-# include <rpc/types.h>
-# include <rpc/xdr.h>
-#endif
-
-#else /* no HAVE_CONFIG_H */
-
-/* XDR i/o include file */
-#ifdef IRIX
-#include <rpc/rpc.h>
-#endif
-#ifdef IRIX64
-#include <rpc/rpc.h>
-#endif
-#ifdef SOLARIS
-#include <rpc/rpc.h>
-#endif
-#ifdef LINUX
-#include <rpc/rpc.h>
-#endif
-#ifdef LYNX
-#include <rpc/rpc.h>
-#endif
-#ifdef SUN
-#include <rpc/xdr.h>
-#endif
-#ifdef HPUX
-#include <rpc/rpc.h>
-#endif
-#ifdef DARWIN
-#include <rpc/types.h>
-#include <rpc/xdr.h>
-#endif
-#ifdef CYGWIN
-#include <rpc/types.h>
-#include <rpc/xdr.h>
-#endif
-#ifdef WIN32
-#include <rpc/rpc.h>
-#endif
-#ifdef OTHER
-#include <rpc/types.h>
-#include <rpc/xdr.h>
-#endif
-
-#ifdef WIN32
-#include <float.h>
-#define isnan _isnan
-#endif
-
-#endif /* HAVE_CONFIG_H */
-
-/* Some type definitions given here are in a separate
- * header file unixversion.h in the original HMRG codebase */
-#define CFree			free
-#define MemType			void
-#define MemSizeType		size_t
-#define StrSizeType		size_t
-#define MemCopy(m0, m1, n)	(void) memmove((void *) (m1), (void *) (m0), (size_t) (n))
-#define MemZero(m, n)		(void) memset((void *) (m), (int) 0, (size_t) (n))
-
-
-/* The ACPSIDES definitions are in a separate header file
- * acpsides.h in the original HMRG codebase */
-#ifndef __ACPSIDES__
-#define __ACPSIDES__
-
-/* do not change these **EVER**!! */
-#define ACP_PORT		(0)
-#define ACP_STBD		(1)
-#define ACP_NSIDES		(2)
-
-#define ACP_UNKNOWN		(ACP_STBD+1)
-#define ACP_BOTH		(ACP_STBD+2)
-#define ACP_NONE		(ACP_STBD+3)
-
-#endif /* __ACPSIDES__ */
-
-/* version number, guaranteed to be strictly
-   increasing and in chronological order */
-#define MR1_VERSION_1_0		(6666)		/* obsolete */
-#define MR1_VERSION_2_0		(6667)		/* obsolete */
-#define BS_VERSION_1_0		(6668)		/* obsolete as of 2007/06/28 */
-#define BS_VERSION_1_1		(6669)		/* obsolete as of 2007/11/27 */
-#define BS_VERSION_1_2		(6670)		/* obsolete as of 2008/04/14 */
-#define BS_VERSION_1_3		(6671)		/* obsolete as of 2010/03/10 */
-#define BS_VERSION_1_4		(6672)		/* current version */
-/* always update the following definition
-   when a new version is added! */
-#define BS_VERSION_CURR		(BS_VERSION_1_4)
-
-/* file flag bits */
-#define BS_CLEAR		(0x0)
-#define BS_SSSLANTRNG		(0x1)		/* sidescan are slant range */
-#define BS_MSCPINGDELRST	(0x2)		/* ping delete/restore via							   mosaic GUI */
-#define BS_MSCNAVEDIT		(0x4)		/* navigation edits via
-						   mosaic GUI */
-#define BS_MSCBRKFILE		(0x8)		/* file break via mosaic GUI */
-#define BS_MSCEDGETRIM		(0x10)		/* edge trims via mosaic GUI */
-
-/* acquisition instruments */
-#define BS_INST_UNDEFINED	(-1)
-#define BS_INST_MR1		(0)
-#define BS_INST_SEAMAPB		(1)
-#define BS_INST_IMI30		(2)
-#define BS_INST_IMI12		(3)
-#define BS_INST_DSL120A		(4)
-#define BS_INST_SEAMAPC		(100)
-#define BS_INST_SCAMP		(150)
-#define BS_INST_EM120		(2000)
-#define BS_INST_EM1002		(2001)
-#define BS_INST_EM300		(2002)
-#define BS_INST_EM3000		(2003)
-#define BS_INST_EM3002		(2004)
-#define BS_INST_EM3000D		(2005)
-#define BS_INST_EM3002D		(2006)
-#define BS_INST_EM2000		(2007)
-#define BS_INST_EM122		(2008)
-#define BS_INST_EM302		(2009)
-#define BS_INST_EM710		(2010)
-#define BS_INST_SM2000		(2050)
-#define BS_INST_RESON8101	(3000)
-#define BS_INST_RESON8111	(3001)
-#define BS_INST_RESON8124	(3002)
-#define BS_INST_RESON8125	(3003)
-#define BS_INST_RESON8150	(3004)
-#define BS_INST_RESON8160	(3005)
-#define BS_INST_AMS120		(4000)
-#define BS_INST_REMUS		(4100)
-#define BS_INST_KLEIN5000	(5000)
-#define BS_INST_SEABEAM2000	(6000)
-#define BS_INST_SEABEAM2100	(6010)
-#define BS_INST_SEABEAM3012	(6050)
-#define BS_INST_SSI		(7000)
-#define BS_INST_SAICLLS		(8000)
-#define BS_INST_EDGETECHSS	(9000)
-#define BS_INST_EDGETECHSSM	(9001)
-#define BS_INST_EDGETECHSSH	(9002)
-#define BS_INST_EDGETECHSB	(9003)
-
-/* source file formats */
-#define BS_SFMT_UNDEFINED	(-1)
-#define BS_SFMT_MR1		(0)
-#define BS_SFMT_TTS		(1)
-#define BS_SFMT_GSF		(1000)
-#define BS_SFMT_GSFDUAL		(1001)
-#define BS_SFMT_XTF		(1100)
-#define BS_SFMT_SIMRADEM	(2000)
-#define BS_SFMT_SIMRADMPB	(2001)
-#define BS_SFMT_OIC		(4000)
-#define BS_SFMT_OICLLS		(4001)
-#define BS_SFMT_MSTIFF		(4100)
-#define BS_SFMT_SIOSB2000	(6000)
-#define BS_SFMT_SSIV21		(7000)
-#define BS_SFMT_XSE		(8000)
-#define BS_SFMT_JSF		(9000)
-
-/* data type mask bits */
-#define BS_DTM_NONE		(0)
-#define BS_DTM_COMPASS		(0x1)
-#define BS_DTM_DEPTH		(0x2)
-#define BS_DTM_PITCH		(0x4)
-#define BS_DTM_ROLL		(0x8)
-#define BS_DTM_BATHYMETRY	(0x10)
-#define BS_DTM_SIDESCAN		(0x20)
-
-/* BSFile --
-   This structure appears at the beginning of all BS
-   files. It describes the format version and
-   number of data objects contained within the file. */
-
-typedef struct bsf_struct {
-	int bsf_version;	/* file format version number */
-	int bsf_count;		/* number of objects */
-	unsigned int bsf_flags;	/* BS_SSSLANTRNG, etc. */
-	int bsf_inst;		/* acquisition instrument */
-	int bsf_srcformat;	/* source file format */
-	char *bsf_srcfilenm;	/* source file name */
-	char *bsf_log;		/* processing log */
-} BSFile;
-
-/* Sensor --
-   This structure describes the sample interval, number
-   of samples and the samples themselves for a single
-   sensor (e.g., roll). Unknown sample values are indicated
-   by NaN. */
-
-typedef struct sns_struct {
-	float sns_int;		/* sample interval (secs) */
-	int sns_nsamps;		/* number of samples */
-	float sns_repval;	/* single representative value of the sensor
-				   for an entire ping, usually derived from
-				   the full set of samples for that ping */
-} Sensor;
-
-/* PingSide --
-   This structure describes either the
-   port or starboard side of a single ping. */
-
-typedef struct ps_struct {
-	float ps_xmitpwr;	/* transmitter power (1=full) */
-	float ps_gain;		/* gain setting (units?) */
-	float ps_pulse;		/* pulse length (millisecs) */
-	float ps_bdrange;	/* bottom detect range (m) */
-	int ps_btycount;	/* number of valid bathymetry samples */
-	int ps_btypad;		/* number of invalid trailing pad samples */
-	float ps_ssxoffset;	/* across-track distance (m) or, for
-				   BS_SSSLANTRNG files, time (s) to first
-				   sidescan sample */
-	int ps_sscount;		/* number of valid sidescan samples */
-	int ps_sspad;		/* number of invalid trailing pad samples */
-	float ps_ssndrmask;	/* across-track distance to outer edge
-				   of nadir region data to be masked */
-	float ps_ssyoffset;	/* sidescan along-track offset (m) */
-} PingSide;
-
-/* Ping --
-   This structure describes the single ping of bathymetry
-   and sidescan data which follows it in a BS sidescan file.
-   A file may have any number of such pings. */
-
-#define PNG_CLEAR		(0x0)
-#define PNG_XYZ			(0x1)	/* bathymetry is x/y/z instead
-					   of x/z only */
-#define PNG_ABI			(0x2)	/* auxiliary beam info present */
-#define PNG_BTYSSFLAGSABSENT	(0x4)	/* indicates that input file does
-					   not contain bathymetry or
-					   sidescan flags, i.e., the file
-					   is in an older flagless format
-					   version; all output files are
-					   written with flags and this bit
-					   is always unset when written
-					   to output */
-#define PNG_HIDE		(0x8)	/* ping should not be displayed */
-#define PNG_LOWQUALITY		(0x10)	/* ping is of unacceptably low quality */
-#define PNG_MSCHIDE		(0x20)	/* ping should not be displayed
-					   in a mosaic */
-
-/* sidescan along-track offset mode */
-#define PNG_SSYOM_UNKNOWN	(0)	/* unknown (all pre-BS-1.4 files) */
-#define PNG_SSYOM_CONSTANT	(1)	/* constant offset for entire ping */
-#define PNG_SSYOM_USEBTYY	(2)	/* use bathymetry y-offsets */
-
-#define PNG_BYTEALIGNSZ		(8)	/* byte alignment constraint for
-					   beginning of auxiliary beam
-					   info section of data buffer */
-
-typedef struct png_struct {
-	unsigned int png_flags;	/* PNG_XYZ, etc. */
-	struct timeval png_tm;	/* timestamp */
-	float png_period;	/* ping period (secs) */
-	double png_slon;	/* ship longitude (deg) */
-	double png_slat;	/* ship latitude (deg) */
-	float png_scourse;	/* ship course (deg) */
-	float png_laybackrng;	/* towfish layback range (m) */
-	float png_laybackbrg;	/* towfish layback bearing (deg, where 0=shipaxis,
-				   pos=port, neg=starboard) */
-	double png_tlon;	/* towfish longitude (deg) */
-	double png_tlat;	/* towfish latitude (deg) */
-	float png_tcourse;	/* towfish course (deg) */
-	Sensor png_compass;	/* towfish compass heading (deg, where 0=N, 90=E),
-				   with no magnetic correction applied to either
-				   the representative value or the sample array */
-	Sensor png_depth;	/* towfish depth (m) */
-	Sensor png_pitch;	/* towfish pitch (deg, where + is nose up) */
-	Sensor png_roll;	/* towfish roll (deg, where + is port down) */
-	int png_snspad;		/* number of invalid trailing pad sensor samples */
-	float png_temp;		/* water temperature (deg C) */
-	float png_ssincr;	/* sidescan increment in across-track distance (m)
-				   or, for BS_SSSLANTRNG files, time (s) */
-	int png_ssyoffsetmode;	/* sidescan along-track offset mode */
-	float png_alt;		/* towfish altitude (m) */
-	float png_magcorr;	/* magnetic correction (deg) */
-	float png_sndvel;	/* sound velocity (m/sec) */
-	float png_cond;		/* conductivity (siemens/m) */
-	float png_magx;		/* magnetic field x (microteslas) */
-	float png_magy;		/* magnetic field y (microteslas) */
-	float png_magz;		/* magnetic field z (microteslas) */
-	PingSide png_sides[ACP_NSIDES];
-} Ping;
-
-/* bathymetry per-sample flag bits
-   (must fit in a 4-byte integer) */
-#define BTYD_CLEAR		(0x0)	/* no flag -- sample is valid */
-#define BTYD_MISC		(0x1)	/* invalidated for non-specific reason */
-#define BTYD_EXTERNAL		(0x2)	/* invalidated by external (non-HMRG) software */
-#define BTYD_MINMAXCLIP		(0x4)	/* deleted by min/max depth clip */
-#define BTYD_MAXANGLE		(0x8)	/* exceeds maximum angle */
-#define BTYD_MINANGLE		(0x10)	/* less than minimum angle */
-#define BTYD_SWEDGE		(0x20)	/* deleted from edge of swath */
-#define BTYD_SWRECT		(0x40)	/* deleted swath rectangle interior */
-#define BTYD_MFSWAPERR		(0x80)	/* mapping function swap error */
-#define BTYD_SRFABOVECLIP	(0x100)	/* clipped from above a surface */
-#define BTYD_SRFBELOWCLIP	(0x200)	/* clipped from below a surface */
-#define BTYD_XZPRECT		(0x400)	/* deleted xz-profile rectangle interior */
-
-/* sidescan per-sample flag bits (must
-   fit in a 1-byte unsigned char) */
-#define SSD_CLEAR		(0x0)	/* no flag -- sample is valid */
-#define SSD_MISC		(0x1)	/* invalidated for non-specific reason */
-#define SSD_EXTERNAL		(0x2)	/* invalidated by external (non-HMRG) software */
-#define SSD_MAXANGLE		(0x4)	/* exceeds maximum angle */
-#define SSD_MINANGLE		(0x8)	/* less than minimum angle */
-#define SSD_SWEDGE		(0x10)	/* deleted from edge of swath */
-#define SSD_SWRECT		(0x20)	/* deleted swath rectangle interior */
-
-/* AuxBeamInfo --
-   This structure contains various bits of per-beam information
-   necessary to reconvert back to a source multibeam format. */
-
-/* auxiliary beam information flag bits */
-#define ABI_CLEAR		(0x0)
-#define ABI_SSVALID		(0x1)	/* abi_ssat{0,1} distances valid */
-
-typedef struct abi_struct {
-	unsigned int abi_flags;	/* ABI_SSVALID, etc. */
-	int abi_id;		/* beam number */
-	float abi_ssat0;	/* across-track distance of first sidescan sample */
-	float abi_ssat1;	/* across-track distance of last sidescan sample */
-} AuxBeamInfo;
-
-/* PingData --
-   This structure contains pointers to sections of a data buffer holding
-   all of the ping's samples, i.e., sensors, bathymetry, bathymetry flags,
-   sidescan, sidescan flags and auxiliary beam information.
-   Samples are stored in the buffer in the following order:
-
-	compass
-	depth
-	pitch
-	roll
-	port bathymetry
-	port bathymetry flags
-	port sidescan
-	port sidescan flags
-	starboard bathymetry
-	starboard bathymetry flags
-	starboard sidescan
-	starboard sidescan flags
-	port auxiliary beam information
-	starboard auxiliary beam information
-
-   The sections containing the port bathymetry, starboard bathymetry,
-   and auxiliary beam information must start on a PNG_BYTEALIGNSZ byte
-   boundary. Note that when bathymetry sample padding is in effect for
-   a particular side, that padding must be present after each of the
-   bathymetry, bathymetry flags and auxiliary beam information sections
-   of that side. When sidescan sample padding is in effect for a particular
-   side, that padding must be present after each of the sidescan and
-   sidescan flags sections of that side. */
-
-typedef struct pd_struct {
-	float *pd_compass;
-	float *pd_depth;
-	float *pd_pitch;
-	float *pd_roll;
-	float *pd_bty[ACP_NSIDES];
-	unsigned int *pd_btyflags[ACP_NSIDES];
-	float *pd_ss[ACP_NSIDES];
-	unsigned char *pd_ssflags[ACP_NSIDES];
-	AuxBeamInfo *pd_abi[ACP_NSIDES];
-} PingData;
-
-/* SMControl --
-   This structure describes a shared memory control
-   block used to pass information back and forth between
-   cooperating BS processing programs. */
-
-#define SMC_RDRNONE		(0x0)
-#define SMC_RDRDATA		(0x1)
-#define SMC_RDRMARKS		(0x2)
-#define SMC_MSGSTDPCT		(0)
-#define SMC_MSGALTPCT		(1)
-#define SMC_MSGOTHER		(2)
-#define SMC_MAXMSG		(40)
-
-typedef struct sm_struct {
-	int sm_shmiid;		/* shared memory ID of ping offsets */
-	int sm_shmmid;		/* shared memory ID of ping marks */
-	int sm_shmdid;		/* shared memory ID of actual data block */
-	int sm_count;		/* total number of objects in data block */
-	int sm_slantrng;	/* non-zero if data are slant range */
-	int sm_ping;		/* number of last processed ping */
-	int sm_status;		/* IPC status flag */
-	int sm_redraw;		/* data and ping mark redraw flag */
-	int sm_msgtype;		/* message format identifier */
-	char sm_msg[SMC_MAXMSG+1];
-} SMControl;
-
-/* time string parser definitions */
-#define TM_JULIAN		(0)
-#define TM_CALENDAR		(1)
-#define TM_MAXSTRLEN		(120)
-
-#define TM_TZ_UNKNOWN		(0)
-#define TM_TZ_GMT		(1)
-
-#define BS_UNDEFINED		(-1)
-
-/* error codes */
-#define BS_SUCCESS		(0)
-#define BS_FAILURE		(1)
-#define BS_FILTERWAIT		(2)
-#define BS_MISC			(3)
-#define BS_BADARG		(4)
-#define BS_MEMALLOC		(5)
-#define BS_OPEN			(6)
-#define BS_READ			(7)
-#define BS_WRITE		(8)
-#define BS_SYSVIPC		(9)
-#define BS_X11			(10)
-#define BS_SIGNAL		(11)
-#define BS_PIPE			(12)
-#define BS_FCNTL		(13)
-#define BS_FORK			(14)
-#define BS_DUP2			(15)
-#define BS_CHDIR		(16)
-#define BS_EXEC			(17)
-#define BS_PDB			(18)
-#define BS_EOF			(19)
-#define BS_BADDATA		(20)
-#define BS_FSEEK		(21)
-#define BS_ACCESS		(22)
-#define BS_RENAME		(23)
-#define BS_BADARCH		(24)
-#define BS_HUGEPING		(25)
-#define BS_GTK			(26)
-#define BS_CAIRO		(27)
-
-/* data access mode */
-#define BS_FILEIO		(0)
-#define BS_SHAREDMEM		(1)
-
-/* ping flags */
-#define BS_NULLMARK		(0x0)
-#define BS_LOWMARK		(0x1)
-#define BS_HIGHMARK		(0x2)
-
-#define BS_MAXSIGNEDINT32	(2147483647)
-
-/* the following restrictions on per-ping data sizes are
-   enforced only when sizeof(unsigned long long) is less
-   than 8 bytes and we cannot easily determine an actual
-   total ping size without risking integer overflow; change
-   these values only with great caution, making sure that
-   the largest aggregate ping buffer size does not
-   exceed BS_MAXSIGNEDINT32 */
-#define BS_MAXATTSAMPS		(10000000)
-#define BS_MAXBTYSAMPS		(10000000)
-#define BS_MAXSSSAMPS		(100000000)
-
-/*
-   The material within the enclosing '#ifdef __BS_OBSOLETE__'
-   which follows is documentation of now-obsolete versions of the
-   post-processing file format.
-*/
-#ifdef __BS_V_1_0_OBSOLETE__
-
-#if defined(__MR1_V_2_0__)
-
-typedef struct mf_struct {
-	int mf_version;		/* MR1_VERSION_2_0 */
-	int mf_count;		/* number of objects */
-	char *mf_log;		/* processing log */
-} MR1File;
-
-#else
-#if defined(__MR1_V_1_0__)
-
-typedef struct mf_struct {
-	int mf_version;		/* MR1_VERSION_1_0 */
-	int mf_count;		/* number of objects */
-	char *mf_log;		/* processing log */
-} MR1File;
-
-typedef struct ps_struct {
-	float ps_trans[2];	/* transmitter settings (units?) */
-	float ps_gain;		/* gain setting (units?) */
-	float ps_pulse;		/* pulse length (units?) */
-	int ps_btycount;	/* number of valid bathymetry samples */
-	int ps_btypad;		/* number of invalid trailing pad samples */
-	float ps_ssoffset;	/* across-track distance to first sidescan sample */
-	int ps_sscount;		/* number of valid sidescan samples */
-	int ps_sspad;		/* number of invalid trailing pad samples */
-} PingSide;
-
-typedef struct png_struct {
-	struct timeval png_tm;	/* timestamp */
-	double png_lon;		/* longitude (deg) */
-	double png_lat;		/* latitude (deg) */
-	float png_course;	/* course determined from lats and longs (deg) */
-	float png_compass;	/* compass heading of vehicle 0=N,90=E, etc. (deg) */
-	float png_prdepth;	/* pressure depth (m) */
-	float png_alt;		/* altitude of vehicle (m) */
-	float png_pitch;	/* vehicle pitch (deg) */
-	float png_roll;		/* vehicle roll (deg) */
-	float png_temp;		/* water temperature (deg) */
-	float png_atssincr;	/* across-track sidescan increment (m) */
-	PingSide png_port;
-	PingSide png_stbd;
-} Ping;
-
-#endif /* defined(__MR1_V_1_0__) */
-
-#endif /* defined(__MR1_V_2_0__) */
-
-#endif /* __BS_V_1_0_OBSOLETE__ */
-
-#endif /* __MBBS_DEFINES__ */
diff --git a/src/bsio/mbbs_io.c b/src/bsio/mbbs_io.c
deleted file mode 100644
index 749f8ea..0000000
--- a/src/bsio/mbbs_io.c
+++ /dev/null
@@ -1,1432 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbbs_io.c	3/3/2014
- *	$Id: mbbs_io.c 2239 2015-05-07 00:51:42Z caress $
- *
- *    Copyright (c) 2014-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/* This source code is part of the mbbsio library used to read and write
- * swath sonar data in the bsio format devised and used by the
- * Hawaii Mapping Research Group of the University of Hawaii.
- * This source code was made available by Roger Davis of the
- * University of Hawaii under the GPL. Minor modifications have
- * been made to the version distributed here as part of MB-System.
- *
- * Author:	Roger Davis (primary author)
- * Author:	D. W. Caress (MB-System revisions)
- * Date:	March 3, 2014 (MB-System revisions)
- *
- *--------------------------------------------------------------------*/
-/*
- *	Copyright (c) 2005 by University of Hawaii.
- */
-
-/*
-   io.c --
-   I/O routines for Hawaii Mapping Research Group BS files.
-*/
-
-#include <stdio.h>
-#include <string.h>
-#include <math.h>
-#include <stdlib.h>
-#ifdef WIN32
-#include <stdint.h>		/* To get INT32_MIN, INT32_MAX, etc ... */
-#endif
-
-#include "mbbs_defines.h"
-#include "mbbs_mem.h"
-
-extern int	mbbs_getpngdataptrs(Ping *, MemType *, PingData *);
-extern double	mbbs_nand();
-extern float	mbbs_nanf();
-extern MemType	*mbbs_pngmemalloc(Ping *);
-extern int	mbbs_mr1_xdrpnghdrv1(Ping *, XDR *);
-extern int	mbbs_mr1_xdrpnghdrv2(Ping *, XDR *);
-
-unsigned long bs_iobytecnt;
-int bs_ionaninit= 0;
-float bs_ionanf;
-double bs_ionand;
-
-static unsigned char *ssflagbuf= (unsigned char *) 0;
-static unsigned int ssflagbufsz= 0;
-
-int
-mbbs_rdbsfhdr(BSFile *bsf, XDR *xdrs)
-/*
-   User-callable routine.
-   Gets the next BSFile header from the XDR stream pointed
-   to by xdrs and returns this header in the structure bsf.
-   xdrs is assumed to be positioned at the next header,
-   and does not search.
-   Returns BS_SUCCESS, BS_BADARCH or BS_READ.
-*/
-{
-	int mbbs_xdrbsfhdr(BSFile *, XDR *);
-
-	if (sizeof(int) < 4)
-		return BS_BADARCH;
-
-	if (mbbs_xdrbsfhdr(bsf, xdrs))
-		return BS_SUCCESS;
-	else
-		return BS_READ;
-}
-
-int
-mbbs_wrbsfhdr(BSFile *bsf, XDR *xdrs)
-/*
-   User-callable routine.
-   Writes the BSFile header bsf onto the XDR stream pointed to by xdrs.
-   Returns BS_SUCCESS, BS_BADARCH or BS_READ.
-*/
-{
-	int mbbs_xdrbsfhdr(BSFile *, XDR *);
-
-	if (sizeof(int) < 4)
-		return BS_BADARCH;
-
-	if (mbbs_xdrbsfhdr(bsf, xdrs))
-		return BS_SUCCESS;
-	else
-		return BS_WRITE;
-}
-
-int
-mbbs_freebsfmem(BSFile *bsf)
-{
-	if (bsf == (BSFile *) 0)
-		return BS_BADARG;
-
-	if (bsf->bsf_srcfilenm != (char *) 0) {
-		CFree((MemType *) bsf->bsf_srcfilenm);
-		bsf->bsf_srcfilenm= (char *) 0;
-	}
-	if (bsf->bsf_log != (char *) 0) {
-		CFree((MemType *) bsf->bsf_log);
-		bsf->bsf_log= (char *) 0;
-	}
-
-	return BS_SUCCESS;
-}
-
-int
-mbbs_rdpnghdr(Ping *png, XDR *xdrs, int version)
-/*
-   User-callable routine.
-   Gets the next Ping header from the XDR stream pointed
-   to by xdrs and returns this header in the structure png.
-   xdrs is assumed to be positioned at the next header,
-   and does not search. version should be the bs_version value
-   from the file header which indicates the version of the file.
-   Returns BS_SUCCESS, BS_BADARCH, BS_BADARG or BS_READ.
-*/
-{
-	int mbbs_xdrpnghdr(Ping *, XDR *, int);
-
-	if (sizeof(int) < 4)
-		return BS_BADARCH;
-
-	switch (version) {
-	case MR1_VERSION_1_0:
-		if (mbbs_mr1_xdrpnghdrv1(png, xdrs))
-			return BS_SUCCESS;
-		else
-			return BS_READ;
-	case MR1_VERSION_2_0:
-		if (mbbs_mr1_xdrpnghdrv2(png, xdrs))
-			return BS_SUCCESS;
-		else
-			return BS_READ;
-	case BS_VERSION_1_0:
-	case BS_VERSION_1_1:
-	case BS_VERSION_1_2:
-	case BS_VERSION_1_3:
-	case BS_VERSION_1_4:
-		if (mbbs_xdrpnghdr(png, xdrs, version))
-			return BS_SUCCESS;
-		else
-			return BS_READ;
-	default:
-		return BS_BADARG;
-	}
-}
-
-int
-mbbs_wrpnghdr(Ping *png, XDR *xdrs)
-/*
-   User-callable routine.
-   Writes the Ping header png onto the XDR stream pointed to by xdrs.
-   Returns BS_SUCCESS, BS_BADARCH or BS_WRITE.
-*/
-{
-	int mbbs_xdrpnghdr(Ping *, XDR *, int);
-
-	if (sizeof(int) < 4)
-		return BS_BADARCH;
-
-	if (mbbs_xdrpnghdr(png, xdrs, (int) BS_VERSION_CURR))
-		return BS_SUCCESS;
-	else
-		return BS_WRITE;
-}
-
-int
-mbbs_rdpngdata(Ping *png, MemType *data, XDR *xdrs)
-/*
-   User-callable routine.
-   Reads sample data from the XDR stream pointed to by xdrs into
-   the memory pointed to by data argument. It assumes that
-   the stream is positioned correctly (i.e., right after the
-   header), and does not search.
-   Returns BS_SUCCESS, BS_BADARCH or BS_READ.
-*/
-{
-	int mbbs_xdrpngdata(Ping *, MemType *, XDR *);
-
-	if (sizeof(int) < 4)
-		return BS_BADARCH;
-
-	if (mbbs_xdrpngdata(png, data, xdrs))
-		return BS_SUCCESS;
-	else
-		return BS_READ;
-}
-
-int
-mbbs_wrpngdata(Ping *png, MemType *data, XDR *xdrs)
-/*
-   User-callable routine.
-   Writes sample data to the XDR stream pointed to by xdrs.
-   Returns BS_SUCCESS, BS_BADARCH or BS_WRITE.
-*/
-{
-	int mbbs_xdrpngdata(Ping *, MemType *, XDR *);
-
-	if (sizeof(int) < 4)
-		return BS_BADARCH;
-
-	if (mbbs_xdrpngdata(png, data, xdrs))
-		return BS_SUCCESS;
-	else
-		return BS_WRITE;
-}
-
-int
-mbbs_rdpngpddata(Ping *png, PingData *pddata, XDR *xdrs)
-/*
-   User-callable routine.
-   Reads sample data from the XDR stream pointed to by xdrs.
-   Returns BS_SUCCESS, BS_BADARCH or BS_WRITE.
-*/
-{
-	int mbbs_xdrpngpddata(Ping *, PingData *, XDR *);
-
-	if (sizeof(int) < 4)
-		return BS_BADARCH;
-
-	if (mbbs_xdrpngpddata(png, pddata, xdrs))
-		return BS_SUCCESS;
-	else
-		return BS_WRITE;
-}
-
-int
-mbbs_wrpngpddata(Ping *png, PingData *pddata, XDR *xdrs)
-/*
-   User-callable routine.
-   Writes sample data to the XDR stream pointed to by xdrs.
-   Returns BS_SUCCESS, BS_BADARCH or BS_WRITE.
-*/
-{
-	int mbbs_xdrpngpddata(Ping *, PingData *, XDR *);
-
-	if (sizeof(int) < 4)
-		return BS_BADARCH;
-
-	if (mbbs_xdrpngpddata(png, pddata, xdrs))
-		return BS_SUCCESS;
-	else
-		return BS_WRITE;
-}
-
-int
-mbbs_rdpng(Ping *png, MemType **data, XDR *xdrs, int version)
-/*
-   User-callable routine.
-   Gets ping header and data from the XDR stream
-   pointed to by xdrs. It assumes that the stream is positioned
-   at the beginning of the header, and does not search (although
-   it does some error checking). Memory for the actual sample
-   data is allocated. version should be the bs_version value
-   from the file header which indicates the version of the file.
-   Returns BS_SUCCESS, BS_BADARCH, BS_BADARG, BS_MEMALLOC or BS_READ.
-*/
-{
-	unsigned long ibcsv;
-
-	if (sizeof(int) < 4)
-		return BS_BADARCH;
-
-	bs_iobytecnt= 0;
-
-	switch (version) {
-	case MR1_VERSION_1_0:
-	case MR1_VERSION_2_0:
-	case BS_VERSION_1_0:
-	case BS_VERSION_1_1:
-	case BS_VERSION_1_2:
-	case BS_VERSION_1_3:
-	case BS_VERSION_1_4:
-		break;
-	default:
-		return BS_BADARG;
-	}
-
-	if (mbbs_rdpnghdr(png, xdrs, version) != BS_SUCCESS)
-		return BS_READ;
-
-	if ((*data= mbbs_pngmemalloc(png)) == (MemType *) 0)
-		return BS_MEMALLOC;
-
-	ibcsv= bs_iobytecnt;
-	if (mbbs_rdpngdata(png, *data, xdrs) < 0)
-		return BS_READ;
-	bs_iobytecnt+= ibcsv;
-
-	return BS_SUCCESS;
-}
-
-int
-mbbs_wrpng(Ping *png, MemType *data, XDR *xdrs)
-/*
-   User-callable routine.
-   Writes ping header and data to the
-   XDR stream pointed to by xdrs.
-   Returns BS_SUCCESS, BS_BADARCH or BS_WRITE.
-*/
-{
-	unsigned long ibcsv;
-
-	if (sizeof(int) < 4)
-		return BS_BADARCH;
-
-	bs_iobytecnt= 0;
-
-	if (mbbs_wrpnghdr(png, xdrs) != BS_SUCCESS)
-		return BS_WRITE;
-
-	ibcsv= bs_iobytecnt;
-	if (mbbs_wrpngdata(png, data, xdrs) != BS_SUCCESS)
-		return BS_WRITE;
-	bs_iobytecnt+= ibcsv;
-
-	return BS_SUCCESS;
-}
-
-int
-mbbs_seekpng(int count, XDR *xdrs, int version)
-/*
-   User-callable routine.
-   Seeks past the next n pings in the XDR stream pointed to by xdrs.
-   version should be the bs_version value from the file header which
-   indicates the version of the file.
-   Returns BS_SUCCESS, BS_BADARCH, BS_BADARG or BS_READ.
-*/
-{
-	Ping png;
-	int i, j, err, bsi, side, n, ii, rem;
-	unsigned int ui;
-	u_int ui1;
-	float f;
-	char *cp;
-	unsigned long ibcsv;
-
-	if (sizeof(int) < 4)
-		return BS_BADARCH;
-
-	bs_iobytecnt= 0;
-
-	switch (version) {
-	case MR1_VERSION_1_0:
-	case MR1_VERSION_2_0:
-	case BS_VERSION_1_0:
-	case BS_VERSION_1_1:
-	case BS_VERSION_1_2:
-	case BS_VERSION_1_3:
-	case BS_VERSION_1_4:
-		break;
-	default:
-		return BS_BADARG;
-	}
-
-	for (i= 0; i < count; i++) {
-		ibcsv= bs_iobytecnt;
-		if ((err= mbbs_rdpnghdr(&png, xdrs, version)) != BS_SUCCESS)
-			return err;
-		bs_iobytecnt+= ibcsv;
-
-		/* sensor data */
-		n= png.png_compass.sns_nsamps+
-		   png.png_depth.sns_nsamps+
-		   png.png_pitch.sns_nsamps+
-		   png.png_roll.sns_nsamps;
-		for (j= 0; j < n; j++) {
-			if (!xdr_float(xdrs, &f))
-				return BS_READ;
-			bs_iobytecnt+= 4;
-		}
-
-		if (png.png_flags & PNG_XYZ)
-			bsi= 3;
-		else
-			bsi= 2;
-
-		for (side= ACP_PORT; side < ACP_NSIDES; side++) {
-
-			/* bathymetry samples */
-			n= bsi*png.png_sides[side].ps_btycount;
-			for (j= 0; j < n; j++) {
-				if (!xdr_float(xdrs, &f))
-					return BS_READ;
-				bs_iobytecnt+= 4;
-			}
-
-			/* bathymetry flags */
-			if (!(png.png_flags & PNG_BTYSSFLAGSABSENT)) {
-				n= png.png_sides[side].ps_btycount;
-				for (j= 0; j < n; j++) {
-					if (!xdr_u_int(xdrs, &ui))
-						return BS_READ;
-					bs_iobytecnt+= 4;
-				}
-			}
-
-			if ((n= png.png_sides[side].ps_sscount) > 0) {
-
-				/* sidescan samples */
-				for (j= 0; j < n; j++) {
-					if (!xdr_float(xdrs, &f))
-						return BS_READ;
-					bs_iobytecnt+= 4;
-				}
-
-				/* sidescan flags */
-				if (!(png.png_flags & PNG_BTYSSFLAGSABSENT)) {
-					if ((err= mbbs_memalloc((MemType **) &ssflagbuf, &ssflagbufsz, (unsigned int) n, (size_t) 1)) != MEM_SUCCESS) {
-						switch (err) {
-						case MEM_BADARG:
-							return BS_BADARG;
-						case MEM_OOB:
-							return BS_BADARG;
-						case MEM_CALLOC:
-							return BS_MEMALLOC;
-						default:
-							return BS_FAILURE;
-						}
-					}
-					cp= (char *) ssflagbuf;
-					ui1= (u_int) n;
-					if (!xdr_bytes(xdrs, &cp, &ui1, (u_int) n))
-						return BS_READ;
-					bs_iobytecnt+= 4+n;
-					if ((rem= bs_iobytecnt%4) > 0)
-						bs_iobytecnt+= 4-rem;
-				}
-			}
-		}
-
-		/* auxiliary beam info */
-		if (png.png_flags & PNG_ABI) {
-			for (side= ACP_PORT; side < ACP_NSIDES; side++) {
-				n= png.png_sides[side].ps_btycount;
-				for (j= 0; j < n; j++) {
-					if (!xdr_u_int(xdrs, &ui))
-						return BS_READ;
-					bs_iobytecnt+= 4;
-					if (!xdr_int(xdrs, &ii))
-						return BS_READ;
-					bs_iobytecnt+= 4;
-					if (!xdr_float(xdrs, &f))
-						return BS_READ;
-					bs_iobytecnt+= 4;
-					if (!xdr_float(xdrs, &f))
-						return BS_READ;
-					bs_iobytecnt+= 4;
-				}
-			}
-		}
-	}
-
-	return BS_SUCCESS;
-}
-
-int
-mbbs_seekpngdata(Ping *png, XDR *xdrs)
-/*
-   User-callable routine.
-   Seeks past a single ping data segment
-   to the beginning of the next ping header
-   in the XDR stream pointed to by xdrs.
-   Returns BS_SUCCESS, BS_BADARCH or BS_READ.
-*/
-{
-	int j, bsi, side, err, n, ii, rem;
-	unsigned int ui;
-	u_int ui1;
-	float f;
-	char *cp;
-
-	if (sizeof(int) < 4)
-		return BS_BADARCH;
-
-	bs_iobytecnt= 0;
-
-	/* sensor data */
-	n= png->png_compass.sns_nsamps+
-	   png->png_depth.sns_nsamps+
-	   png->png_pitch.sns_nsamps+
-	   png->png_roll.sns_nsamps;
-	for (j= 0; j < n; j++) {
-		if (!xdr_float(xdrs, &f))
-			return BS_READ;
-		bs_iobytecnt+= 4;
-	}
-
-	if (png->png_flags & PNG_XYZ)
-		bsi= 3;
-	else
-		bsi= 2;
-
-	for (side= ACP_PORT; side < ACP_NSIDES; side++) {
-
-		/* bathymetry samples */
-		n= bsi*png->png_sides[side].ps_btycount;
-		for (j= 0; j < n; j++) {
-			if (!xdr_float(xdrs, &f))
-				return BS_READ;
-			bs_iobytecnt+= 4;
-		}
-
-		/* bathymetry flags */
-		if (!(png->png_flags & PNG_BTYSSFLAGSABSENT)) {
-			n= png->png_sides[side].ps_btycount;
-			for (j= 0; j < n; j++) {
-				if (!xdr_u_int(xdrs, &ui))
-					return BS_READ;
-				bs_iobytecnt+= 4;
-			}
-		}
-
-		if ((n= png->png_sides[side].ps_sscount) > 0) {
-
-			/* sidescan samples */
-			for (j= 0; j < n; j++) {
-				if (!xdr_float(xdrs, &f))
-					return BS_READ;
-				bs_iobytecnt+= 4;
-			}
-
-			/* sidescan flags */
-			if (!(png->png_flags & PNG_BTYSSFLAGSABSENT)) {
-				if ((err= mbbs_memalloc((MemType **) &ssflagbuf, &ssflagbufsz, (unsigned int) n, (size_t) 1)) != MEM_SUCCESS) {
-					switch (err) {
-					case MEM_BADARG:
-						return BS_BADARG;
-					case MEM_OOB:
-						return BS_BADARG;
-					case MEM_CALLOC:
-						return BS_MEMALLOC;
-					default:
-						return BS_FAILURE;
-					}
-				}
-				cp= (char *) ssflagbuf;
-				ui1= (u_int) n;
-				if (!xdr_bytes(xdrs, &cp, &ui1, (u_int) n))
-					return BS_READ;
-				bs_iobytecnt+= 4+n;
-				if ((rem= bs_iobytecnt%4) > 0)
-					bs_iobytecnt+= 4-rem;
-			}
-		}
-	}
-
-	/* auxiliary beam info */
-	if (png->png_flags & PNG_ABI) {
-		for (side= ACP_PORT; side < ACP_NSIDES; side++) {
-			n= png->png_sides[side].ps_btycount;
-			for (j= 0; j < n; j++) {
-				if (!xdr_u_int(xdrs, &ui))
-					return BS_READ;
-				bs_iobytecnt+= 4;
-				if (!xdr_int(xdrs, &ii))
-					return BS_READ;
-				bs_iobytecnt+= 4;
-				if (!xdr_float(xdrs, &f))
-					return BS_READ;
-				bs_iobytecnt+= 4;
-				if (!xdr_float(xdrs, &f))
-					return BS_READ;
-				bs_iobytecnt+= 4;
-			}
-		}
-	}
-
-	return BS_SUCCESS;
-}
-
-int
-mbbs_copypng(int count, XDR *xdris, XDR *xdros, int version)
-/*
-   User-callable routine.
-   Copies the next n pings from the XDR input stream
-   pointed to by xdris to the XDR output stream pointed
-   to by xdros. version should be the bs_version value
-   from the file header which indicates the version of the file.
-   Note that this routine will set bs_iobytecnt to the count
-   of bytes written, not bytes read!
-   Returns BS_SUCCESS, BS_BADARCH, BS_BADARG, BS_READ or BS_WRITE.
-*/
-{
-	Ping png;
-	int i, j, bsi, side, n, err, ii, rem;
-	unsigned int flags, ui;
-	u_int ui1;
-	float f;
-	char *cp;
-	unsigned int ibcsv;
-
-	if (sizeof(int) < 4)
-		return BS_BADARCH;
-
-	bs_iobytecnt= 0;
-
-	for (i= 0; i < count; i++) {
-
-		/* note that we want bs_iobytecnt to be a count
-		   of the bytes written, not the bytes read! */
-		ibcsv= bs_iobytecnt;
-		if ((err= mbbs_rdpnghdr(&png, xdris, version)) != BS_SUCCESS)
-			return err;
-		bs_iobytecnt= ibcsv;
-
-		flags= png.png_flags;
-		png.png_flags&= ~PNG_BTYSSFLAGSABSENT;
-		ibcsv= bs_iobytecnt;
-		if ((err= mbbs_wrpnghdr(&png, xdros)) != BS_SUCCESS)
-			return err;
-		bs_iobytecnt+= ibcsv;
-
-		/* sensor data */
-		n= png.png_compass.sns_nsamps+
-		   png.png_depth.sns_nsamps+
-		   png.png_pitch.sns_nsamps+
-		   png.png_roll.sns_nsamps;
-		for (j= 0; j < n; j++) {
-			if (!xdr_float(xdris, &f))
-				return BS_READ;
-			if (!xdr_float(xdros, &f))
-				return BS_WRITE;
-			bs_iobytecnt+= 4;
-		}
-
-		if (png.png_flags & PNG_XYZ)
-			bsi= 3;
-		else
-			bsi= 2;
-
-		for (side= ACP_PORT; side < ACP_NSIDES; side++) {
-
-			/* bathymetry samples */
-			n= bsi*png.png_sides[side].ps_btycount;
-			for (j= 0; j < n; j++) {
-				if (!xdr_float(xdris, &f))
-					return BS_READ;
-				if (!xdr_float(xdros, &f))
-					return BS_WRITE;
-				bs_iobytecnt+= 4;
-			}
-
-			/* bathymetry flags */
-			n= png.png_sides[side].ps_btycount;
-			for (j= 0; j < n; j++) {
-				if (!(flags & PNG_BTYSSFLAGSABSENT)) {
-					if (!xdr_u_int(xdris, &ui))
-						return BS_READ;
-				}
-				else
-					ui= BTYD_CLEAR;
-				if (!xdr_u_int(xdros, &ui))
-					return BS_WRITE;
-				bs_iobytecnt+= 4;
-			}
-
-			if ((n= png.png_sides[side].ps_sscount) > 0) {
-
-				/* sidescan samples */
-				for (j= 0; j < n; j++) {
-					if (!xdr_float(xdris, &f))
-						return BS_READ;
-					if (!xdr_float(xdros, &f))
-						return BS_WRITE;
-					bs_iobytecnt+= 4;
-				}
-
-				/* sidescan flags */
-				if ((err= mbbs_memalloc((MemType **) &ssflagbuf, &ssflagbufsz, (unsigned int) n, (size_t) 1)) != MEM_SUCCESS) {
-					switch (err) {
-					case MEM_BADARG:
-						return BS_BADARG;
-					case MEM_OOB:
-						return BS_BADARG;
-					case MEM_CALLOC:
-						return BS_MEMALLOC;
-					default:
-						return BS_FAILURE;
-					}
-				}
-				cp= (char *) ssflagbuf;
-				ui1= (u_int) n;
-				if (!(flags & PNG_BTYSSFLAGSABSENT)) {
-					if (!xdr_bytes(xdris, &cp, &ui1, (u_int) n))
-						return BS_READ;
-				}
-				else {
-					for (j= 0; j < n; j++)
-						ssflagbuf[j]= SSD_CLEAR;
-				}
-				if (!xdr_bytes(xdros, &cp, &ui1, (u_int) n))
-					return BS_READ;
-				bs_iobytecnt+= 4+n;
-				if ((rem= bs_iobytecnt%4) > 0)
-					bs_iobytecnt+= 4-rem;
-			}
-		}
-
-		/* auxiliary beam info */
-		if (png.png_flags & PNG_ABI) {
-			for (side= ACP_PORT; side < ACP_NSIDES; side++) {
-				n= png.png_sides[side].ps_btycount;
-				for (j= 0; j < n; j++) {
-					if (!xdr_u_int(xdris, &ui))
-						return BS_READ;
-					if (!xdr_u_int(xdros, &ui))
-						return BS_WRITE;
-					bs_iobytecnt+= 4;
-					if (!xdr_int(xdris, &ii))
-						return BS_READ;
-					if (!xdr_int(xdros, &ii))
-						return BS_WRITE;
-					bs_iobytecnt+= 4;
-					if (!xdr_float(xdris, &f))
-						return BS_READ;
-					if (!xdr_float(xdros, &f))
-						return BS_WRITE;
-					bs_iobytecnt+= 4;
-					if (!xdr_float(xdris, &f))
-						return BS_READ;
-					if (!xdr_float(xdros, &f))
-						return BS_WRITE;
-					bs_iobytecnt+= 4;
-				}
-			}
-		}
-	}
-
-	return BS_SUCCESS;
-}
-
-int
-mbbs_xdrbsfhdr(BSFile *bsf, XDR *xdrs)
-/*
-   Internal routine.
-   Does XDR encoding and decoding of an BS file header.
-   Returns 1 if successful, 0 otherwise.
-*/
-{
-	char **cpp;
-	int version;
-	unsigned long strbc;
-	int mbbs_xdrstring(XDR *, char **, unsigned long *);
-
-	bs_iobytecnt= 0;
-
-	switch (xdrs->x_op) {
-	case XDR_DECODE:
-		if (!xdr_int(xdrs, &(bsf->bsf_version)))
-			return 0;
-		bs_iobytecnt+= 4;
-		switch (bsf->bsf_version) {
-		case MR1_VERSION_1_0:
-		case MR1_VERSION_2_0:
-		case BS_VERSION_1_0:
-		case BS_VERSION_1_1:
-		case BS_VERSION_1_2:
-		case BS_VERSION_1_3:
-		case BS_VERSION_1_4:
-			break;
-		default:
-			return 0;
-		}
-		break;
-	case XDR_ENCODE:
-		version= BS_VERSION_CURR;
-		if (!xdr_int(xdrs, &version))
-			return 0;
-		bs_iobytecnt+= 4;
-		break;
-	default:
-		return 0;
-	}
-
-	if (!xdr_int(xdrs, &(bsf->bsf_count)))
-		return 0;
-	bs_iobytecnt+= 4;
-
-	switch (xdrs->x_op) {
-	case XDR_DECODE:
-		switch (bsf->bsf_version) {
-		case MR1_VERSION_1_0:
-		case MR1_VERSION_2_0:
-		case BS_VERSION_1_0:
-		case BS_VERSION_1_1:
-		case BS_VERSION_1_2:
-			bsf->bsf_flags= BS_CLEAR;
-			break;
-		default:
-			if (!xdr_u_int(xdrs, &(bsf->bsf_flags)))
-				return 0;
-			bs_iobytecnt+= 4;
-		}
-		break;
-	case XDR_ENCODE:
-		if (!xdr_u_int(xdrs, &(bsf->bsf_flags)))
-			return 0;
-		bs_iobytecnt+= 4;
-		break;
-	default:	/* shut up compiler warnings */
-		break;
-	}
-
-	switch (xdrs->x_op) {
-	case XDR_DECODE:
-		switch (bsf->bsf_version) {
-		case MR1_VERSION_1_0:
-		case MR1_VERSION_2_0:
-			bsf->bsf_inst= BS_INST_UNDEFINED;
-			bsf->bsf_srcformat= BS_SFMT_UNDEFINED;
-			bsf->bsf_srcfilenm= (char *) 0;
-			break;
-		default:
-			if (!xdr_int(xdrs, &(bsf->bsf_inst)))
-				return 0;
-			bs_iobytecnt+= 4;
-			if (!xdr_int(xdrs, &(bsf->bsf_srcformat)))
-				return 0;
-			bs_iobytecnt+= 4;
-			cpp= &(bsf->bsf_srcfilenm);
-			if (!mbbs_xdrstring(xdrs, cpp, &strbc))
-				return 0;
-			bs_iobytecnt+= strbc;
-			break;
-		}
-		break;
-	case XDR_ENCODE:
-		if (!xdr_int(xdrs, &(bsf->bsf_inst)))
-			return 0;
-		bs_iobytecnt+= 4;
-		if (!xdr_int(xdrs, &(bsf->bsf_srcformat)))
-			return 0;
-		bs_iobytecnt+= 4;
-		cpp= &(bsf->bsf_srcfilenm);
-		if (!mbbs_xdrstring(xdrs, cpp, &strbc))
-			return 0;
-		bs_iobytecnt+= strbc;
-		break;
-	default:
-		return 0;
-	}
-
-	cpp= &(bsf->bsf_log);
-	if (!mbbs_xdrstring(xdrs, cpp, &strbc))
-		return 0;
-	bs_iobytecnt+= strbc;
-
-	return 1;
-}
-
-int
-mbbs_xdrpnghdr(Ping *png, XDR *xdrs, int version)
-/*
-   Internal routine.
-   Does XDR encoding and decoding of a BS ping header.
-   Returns 1 if successful, 0 otherwise.
-*/
-{
-	unsigned int flags;
-	int tvsec, tvusec;
-	unsigned long sidebc;
-	int mbbs_xdrside(PingSide *, XDR *, int, unsigned long *);
-
-	switch (version) {
-	case BS_VERSION_1_0:
-	case BS_VERSION_1_1:
-	case BS_VERSION_1_2:
-	case BS_VERSION_1_3:
-
-		/* output in obsolete format not allowed! */
-		if (xdrs->x_op == XDR_ENCODE)
-			return 0;
-
-		break;
-	case BS_VERSION_1_4:
-		break;
-	default:
-		return 0;
-	}
-
-	bs_iobytecnt= 0;
-
-	if (!bs_ionaninit) {
-		bs_ionanf= mbbs_nanf();
-		bs_ionand= mbbs_nand();
-		bs_ionaninit= 1;
-	}
-
-	/* always clear the PNG_BTYSSFLAGSABSENT bit when writing
-	   since all current format output files are guaranteed to
-	   include bathymetry and sidescan flags -- this bit should
-	   normally be set only by I/O functions from this library
-	   when reading flagless older format version files */	
-	if (xdrs->x_op == XDR_ENCODE) {
-		flags= png->png_flags;
-		flags&= ~PNG_BTYSSFLAGSABSENT;
-	}
-	if (!xdr_u_int(xdrs, &flags))
-		return 0;
-	bs_iobytecnt+= 4;
-	if (xdrs->x_op == XDR_DECODE)
-		png->png_flags= flags;
-
-	/* depending upon the platform, the size of the timeval
-	   struct's fields may be 4 or 8 bytes; for backward
-	   compatibility with old files that use 4-byte fields,
-	   we force these quantities into 4-byte primitives when
-	   doing output, returning an error when overflow would result */
-	if (xdrs->x_op == XDR_ENCODE) {
-		if (((long) png->png_tm.tv_sec < INT32_MIN) ||
-		    ((long) png->png_tm.tv_sec > INT32_MAX))
-			return 0;
-
-		/* on some platforms where tv_usec is 4 bytes (e.g., mac_x8664
-		   under MacOS 10.7) the following may generate a compiler
-		   warning about an invalid comparison -- it's probably best to
-		   leave this as is rather than code around this unusual size
-		   and risk failure in the future if it's ever increased */
-		if ((sizeof png->png_tm.tv_usec > 4) &&
-		    (((long) png->png_tm.tv_usec < INT32_MIN) ||
-		     ((long) png->png_tm.tv_usec > INT32_MAX)))
-			return 0;
-
-		tvsec= (int) png->png_tm.tv_sec;
-		tvusec= (int) png->png_tm.tv_usec;
-	}
-	if (!xdr_int(xdrs, &tvsec))
-		return 0;
-	bs_iobytecnt+= 4;
-	if (!xdr_int(xdrs, &tvusec))
-		return 0;
-	bs_iobytecnt+= 4;
-	if (xdrs->x_op == XDR_DECODE) {
-		png->png_tm.tv_sec= tvsec;
-		png->png_tm.tv_usec= tvusec;
-	}
-
-	if (!xdr_float(xdrs, &(png->png_period)))
-		return 0;
-	bs_iobytecnt+= 4;
-	if (!xdr_double(xdrs, &(png->png_slon)))
-		return 0;
-	bs_iobytecnt+= 8;
-	if (!xdr_double(xdrs, &(png->png_slat)))
-		return 0;
-	bs_iobytecnt+= 8;
-	if (!xdr_float(xdrs, &(png->png_scourse)))
-		return 0;
-	bs_iobytecnt+= 4;
-	if (!xdr_float(xdrs, &(png->png_laybackrng)))
-		return 0;
-	bs_iobytecnt+= 4;
-	if (!xdr_float(xdrs, &(png->png_laybackbrg)))
-		return 0;
-	bs_iobytecnt+= 4;
-	if (!xdr_double(xdrs, &(png->png_tlon)))
-		return 0;
-	bs_iobytecnt+= 8;
-	if (!xdr_double(xdrs, &(png->png_tlat)))
-		return 0;
-	bs_iobytecnt+= 8;
-	if (!xdr_float(xdrs, &(png->png_tcourse)))
-		return 0;
-	bs_iobytecnt+= 4;
-
-	if (!xdr_float(xdrs, &(png->png_compass.sns_int)))
-		return 0;
-	bs_iobytecnt+= 4;
-	if (!xdr_int(xdrs, &(png->png_compass.sns_nsamps)))
-		return 0;
-	bs_iobytecnt+= 4;
-	if (png->png_compass.sns_nsamps < 0)
-		return 0;
-	if (!xdr_float(xdrs, &(png->png_compass.sns_repval)))
-		return 0;
-	bs_iobytecnt+= 4;
-	if (!xdr_float(xdrs, &(png->png_depth.sns_int)))
-		return 0;
-	bs_iobytecnt+= 4;
-	if (!xdr_int(xdrs, &(png->png_depth.sns_nsamps)))
-		return 0;
-	bs_iobytecnt+= 4;
-	if (png->png_depth.sns_nsamps < 0)
-		return 0;
-	if (!xdr_float(xdrs, &(png->png_depth.sns_repval)))
-		return 0;
-	bs_iobytecnt+= 4;
-	if (!xdr_float(xdrs, &(png->png_pitch.sns_int)))
-		return 0;
-	bs_iobytecnt+= 4;
-	if (!xdr_int(xdrs, &(png->png_pitch.sns_nsamps)))
-		return 0;
-	bs_iobytecnt+= 4;
-	if (png->png_pitch.sns_nsamps < 0)
-		return 0;
-	if (!xdr_float(xdrs, &(png->png_pitch.sns_repval)))
-		return 0;
-	bs_iobytecnt+= 4;
-	if (!xdr_float(xdrs, &(png->png_roll.sns_int)))
-		return 0;
-	bs_iobytecnt+= 4;
-	if (!xdr_int(xdrs, &(png->png_roll.sns_nsamps)))
-		return 0;
-	bs_iobytecnt+= 4;
-	if (png->png_roll.sns_nsamps < 0)
-		return 0;
-	if (!xdr_float(xdrs, &(png->png_roll.sns_repval)))
-		return 0;
-	bs_iobytecnt+= 4;
-	if (xdrs->x_op == XDR_DECODE)
-		png->png_snspad= 0;
-
-	if (!xdr_float(xdrs, &(png->png_temp)))
-		return 0;
-	bs_iobytecnt+= 4;
-	if (!xdr_float(xdrs, &(png->png_ssincr)))
-		return 0;
-	bs_iobytecnt+= 4;
-	if (version >= BS_VERSION_1_4) {
-		if (!xdr_int(xdrs, &(png->png_ssyoffsetmode)))
-			return 0;
-		bs_iobytecnt+= 4;
-	}
-	else {
-		if (xdrs->x_op == XDR_DECODE)
-			png->png_ssyoffsetmode= PNG_SSYOM_UNKNOWN;
-	}
-	if (!xdr_float(xdrs, &(png->png_alt)))
-		return 0;
-	bs_iobytecnt+= 4;
-	if (!xdr_float(xdrs, &(png->png_magcorr)))
-		return 0;
-	bs_iobytecnt+= 4;
-	if (!xdr_float(xdrs, &(png->png_sndvel)))
-		return 0;
-	bs_iobytecnt+= 4;
-	if (version >= BS_VERSION_1_1) {
-		if (!xdr_float(xdrs, &(png->png_cond)))
-			return 0;
-		bs_iobytecnt+= 4;
-		if (!xdr_float(xdrs, &(png->png_magx)))
-			return 0;
-		bs_iobytecnt+= 4;
-		if (!xdr_float(xdrs, &(png->png_magy)))
-			return 0;
-		bs_iobytecnt+= 4;
-		if (!xdr_float(xdrs, &(png->png_magz)))
-			return 0;
-		bs_iobytecnt+= 4;
-	}
-	else {
-		if (xdrs->x_op == XDR_DECODE) {
-			png->png_cond= bs_ionanf;
-			png->png_magx= bs_ionanf;
-			png->png_magy= bs_ionanf;
-			png->png_magz= bs_ionanf;
-		}
-	}
-
-	if (!mbbs_xdrside(&(png->png_sides[ACP_PORT]), xdrs, version, &sidebc))
-		return 0;
-	bs_iobytecnt+= sidebc;
-	if (!mbbs_xdrside(&(png->png_sides[ACP_STBD]), xdrs, version, &sidebc))
-		return 0;
-	bs_iobytecnt+= sidebc;
-
-	return 1;
-}
-
-int
-mbbs_xdrside(PingSide *ps, XDR *xdrs, int version, unsigned long *bytecnt)
-/*
-   Internal routine.
-   Does XDR encoding and decoding of a PingSide header.
-   Records the total number of bytes transferred into *bytecnt.
-   Returns 1 if successful, 0 otherwise.
-*/
-{
-	*bytecnt= 0;
-
-	if (!xdr_float(xdrs, &(ps->ps_xmitpwr)))
-		return 0;
-	*bytecnt+= 4;
-	if (!xdr_float(xdrs, &(ps->ps_gain)))
-		return 0;
-	*bytecnt+= 4;
-	if (!xdr_float(xdrs, &(ps->ps_pulse)))
-		return 0;
-	*bytecnt+= 4;
-	if (!xdr_float(xdrs, &(ps->ps_bdrange)))
-		return 0;
-	*bytecnt+= 4;
-	if (!xdr_int(xdrs, &(ps->ps_btycount)))
-		return 0;
-	*bytecnt+= 4;
-	if (ps->ps_btycount < 0)
-		return 0;
-	if (xdrs->x_op == XDR_DECODE)
-		ps->ps_btypad= 0;
-	if (!xdr_float(xdrs, &(ps->ps_ssxoffset)))
-		return 0;
-	*bytecnt+= 4;
-	if (!xdr_int(xdrs, &(ps->ps_sscount)))
-		return 0;
-	*bytecnt+= 4;
-	if (ps->ps_sscount < 0)
-		return 0;
-	if (xdrs->x_op == XDR_DECODE)
-		ps->ps_sspad= 0;
-	if (version >= BS_VERSION_1_2) {
-		if (!xdr_float(xdrs, &(ps->ps_ssndrmask)))
-			return 0;
-		*bytecnt+= 4;
-	}
-	else {
-		if (xdrs->x_op == XDR_DECODE)
-			ps->ps_ssndrmask= 0.;
-	}
-	if (version >= BS_VERSION_1_4) {
-		if (!xdr_float(xdrs, &(ps->ps_ssyoffset)))
-			return 0;
-		bs_iobytecnt+= 4;
-	}
-	else {
-		if (xdrs->x_op == XDR_DECODE)
-			ps->ps_ssyoffset= bs_ionanf;
-	}
-
-	return 1;
-}
-
-int
-mbbs_xdrpngdata(Ping *png, MemType *data, XDR *xdrs)
-/*
-   Internal routine.
-*/
-{
-	PingData pd;
-	int mbbs_xdrpngpddata(Ping *, PingData *, XDR *);
-
-	if (mbbs_getpngdataptrs(png, data, &pd) != BS_SUCCESS)
-		return 0;
-
-	return mbbs_xdrpngpddata(png, &pd, xdrs);
-}
-
-int
-mbbs_xdrpngpddata(Ping *png, PingData *pddata, XDR *xdrs)
-/*
-   Internal routine.
-*/
-{
-	float *fp;
-	int i, side, n, bsi, rem;
-	unsigned int *uip;
-	unsigned char *ucp;
-	char *cp;
-	u_int ui1;
-	AuxBeamInfo *abi;
-
-	bs_iobytecnt= 0;
-
-	/* compass */
-	n= png->png_compass.sns_nsamps;
-	fp= pddata->pd_compass;
-	if ((n > 0) && (fp == (float *) 0))
-		return 0;
-	for (i= 0; i < n; i++) {
-		if (!xdr_float(xdrs, fp++))
-			return 0;
-		bs_iobytecnt+= 4;
-	}
-
-	/* depth */
-	n= png->png_depth.sns_nsamps;
-	fp= pddata->pd_depth;
-	if ((n > 0) && (fp == (float *) 0))
-		return 0;
-	for (i= 0; i < n; i++) {
-		if (!xdr_float(xdrs, fp++))
-			return 0;
-		bs_iobytecnt+= 4;
-	}
-
-	/* pitch */
-	n= png->png_pitch.sns_nsamps;
-	fp= pddata->pd_pitch;
-	if ((n > 0) && (fp == (float *) 0))
-		return 0;
-	for (i= 0; i < n; i++) {
-		if (!xdr_float(xdrs, fp++))
-			return 0;
-		bs_iobytecnt+= 4;
-	}
-
-	/* roll */
-	n= png->png_roll.sns_nsamps;
-	fp= pddata->pd_roll;
-	if ((n > 0) && (fp == (float *) 0))
-		return 0;
-	for (i= 0; i < n; i++) {
-		if (!xdr_float(xdrs, fp++))
-			return 0;
-		bs_iobytecnt+= 4;
-	}
-
-	if (png->png_flags & PNG_XYZ)
-		bsi= 3;
-	else
-		bsi= 2;
-	for (side= ACP_PORT; side < ACP_NSIDES; side++) {
-
-		/* bathymetry */
-		n= bsi*png->png_sides[side].ps_btycount;
-		/* watch for overflow! */
-		if (n < 0)
-			return 0;
-		fp= pddata->pd_bty[side];
-		if ((n > 0) && (fp == (float *) 0))
-			return 0;
-		for (i= 0; i < n; i++) {
-			if (!xdr_float(xdrs, fp++))
-				return 0;
-			bs_iobytecnt+= 4;
-		}
-
-		/* bathymetry flags */
-		n= png->png_sides[side].ps_btycount;
-		uip= pddata->pd_btyflags[side];
-		if ((n > 0) && (uip == (unsigned int *) 0))
-			return 0;
-		for (i= 0; i < n; i++) {
-			if (xdrs->x_op == XDR_DECODE) {
-				if (!(png->png_flags & PNG_BTYSSFLAGSABSENT)) {
-					if (!xdr_u_int(xdrs, uip++))
-						return 0;
-					bs_iobytecnt+= 4;
-				}
-				else
-					*(uip++)= BTYD_CLEAR;
-			}
-			else {
-				if (!xdr_u_int(xdrs, uip++))
-					return 0;
-				bs_iobytecnt+= 4;
-			}
-		}
-
-		/* sidescan */
-		n= png->png_sides[side].ps_sscount;
-		fp= pddata->pd_ss[side];
-		if ((n > 0) && (fp == (float *) 0))
-			return 0;
-		for (i= 0; i < n; i++) {
-			if (!xdr_float(xdrs, fp++))
-				return 0;
-			bs_iobytecnt+= 4;
-		}
-
-		/* sidescan flags */
-		n= png->png_sides[side].ps_sscount;
-		ucp= pddata->pd_ssflags[side];
-		if ((n > 0) && (ucp == (unsigned char *) 0))
-			return 0;
-		if (n > 0) {
-			cp= (char *) ucp;
-			ui1= (u_int) n;
-			if (xdrs->x_op == XDR_DECODE) {
-				if (!(png->png_flags & PNG_BTYSSFLAGSABSENT)) {
-					if (!xdr_bytes(xdrs, &cp, &ui1, (u_int) n))
-						return 0;
-					bs_iobytecnt+= 4+n;
-					if ((rem= bs_iobytecnt%4) > 0)
-						bs_iobytecnt+= 4-rem;
-				}
-				else {
-					for (i= 0; i < n; i++)
-						ucp[i]= SSD_CLEAR;
-				}
-			}
-			else {
-				if (!xdr_bytes(xdrs, &cp, &ui1, (u_int) n))
-					return 0;
-				bs_iobytecnt+= 4+n;
-				if ((rem= bs_iobytecnt%4) > 0)
-					bs_iobytecnt+= 4-rem;
-			}
-		}
-	}
-
-	/* auxiliary beam information */
-	if (png->png_flags & PNG_ABI) {
-		for (side= ACP_PORT; side < ACP_NSIDES; side++) {
-			n= png->png_sides[side].ps_btycount;
-			abi= pddata->pd_abi[side];
-			if ((n > 0) && (abi == (AuxBeamInfo *) 0))
-				return 0;
-			for (i= 0; i < n; i++, abi++) {
-				if (!xdr_u_int(xdrs, &(abi->abi_flags)))
-					return 0;
-				bs_iobytecnt+= 4;
-				if (!xdr_int(xdrs, &(abi->abi_id)))
-					return 0;
-				bs_iobytecnt+= 4;
-				if (!xdr_float(xdrs, &(abi->abi_ssat0)))
-					return 0;
-				bs_iobytecnt+= 4;
-				if (!xdr_float(xdrs, &(abi->abi_ssat1)))
-					return 0;
-				bs_iobytecnt+= 4;
-			}
-		}
-	}
-
-	return 1;
-}
-
-int
-mbbs_xdrstring(XDR *xdrs, char **cpp, unsigned long *bytecnt)
-/*
-   User-callable routine.
-   Does XDR encoding and decoding of character strings.
-   These are stored as an integer (the string length) followed
-   by the bytes of the string (if the length is greater than 0).
-   Records the total number of bytes transferred (including
-   the leading integer) into *bytecnt.
-   Returns 1 if successful, 0 otherwise.
-*/
-{
-	int len, rem;
-	u_int ul;
-
-	*bytecnt= 0;
-
-	switch (xdrs->x_op) {
-	case XDR_ENCODE:
-		if ((*cpp == (char *) 0) || (strlen(*cpp) == (StrSizeType) 0)) {
-			len= 0;
-			if (!xdr_int(xdrs, &len))
-				return 0;
-			*bytecnt+= 4;
-		}
-		else {
-			len= (int) strlen(*cpp);
-			if (!xdr_int(xdrs, &len))
-				return 0;
-			*bytecnt+= 4;
-			ul= (u_int) len;
-			if (!xdr_bytes(xdrs, cpp, &ul, (u_int) len))
-				return 0;
-			*bytecnt+= 4+len;
-			if ((rem= (*bytecnt)%4) > 0)
-				*bytecnt+= 4-rem;
-		}
-		break;
-	case XDR_DECODE:
-		if (!xdr_int(xdrs, &len))
-			return 0;
-		*bytecnt+= 4;
-		if (len == 0)
-			*cpp= (char *) 0;
-		else if (len < 0)
-			return 0;
-		else {
-			if ((*cpp= (char *) calloc((MemSizeType) (len+1), sizeof(char))) == (char *) 0)
-				return 0;
-			ul= (u_int) len;
-			if (!xdr_bytes(xdrs, cpp, &ul, (u_int) len))
-				return 0;
-			if (ul != (u_int) len)
-				return 0;
-			(*cpp)[len]= '\0';
-			*bytecnt+= 4+len;
-			if ((rem= (*bytecnt)%4) > 0)
-				*bytecnt+= 4-rem;
-		}
-		break;
-	default:	/* shut up compiler warnings */
-		break;
-	}
-
-	return 1;
-}
-
-int
-mbbs_rdversion(FILE *fp, int *version)
-{
-	XDR xdrs;
-
-	if (sizeof(int) < 4)
-		return BS_BADARCH;
-
-	bs_iobytecnt= 0;
-
-	xdrstdio_create(&xdrs, fp, XDR_DECODE);
-
-	if (!xdr_int(&xdrs, version))
-		return BS_FAILURE;
-	bs_iobytecnt+= 4;
-	switch (*version) {
-	case MR1_VERSION_1_0:
-	case MR1_VERSION_2_0:
-	case BS_VERSION_1_0:
-	case BS_VERSION_1_1:
-	case BS_VERSION_1_2:
-	case BS_VERSION_1_3:
-	case BS_VERSION_1_4:
-		break;
-	default:
-		return BS_BADDATA;
-	}
-
-	xdr_destroy(&xdrs);
-
-	return BS_SUCCESS;
-}
diff --git a/src/bsio/mbbs_iomrv1.c b/src/bsio/mbbs_iomrv1.c
deleted file mode 100644
index ca57bd9..0000000
--- a/src/bsio/mbbs_iomrv1.c
+++ /dev/null
@@ -1,235 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbbs_iomrv1.c	3/3/2014
- *	$Id: mbbs_iomrv1.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 2014-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/* This source code is part of the mbbsio library used to read and write
- * swath sonar data in the bsio format devised and used by the
- * Hawaii Mapping Research Group of the University of Hawaii.
- * This source code was made available by Roger Davis of the
- * University of Hawaii under the GPL. Minor modifications have
- * been made to the version distributed here as part of MB-System.
- *
- * Author:	Roger Davis (primary author)
- * Author:	D. W. Caress (MB-System revisions)
- * Date:	March 3, 2014 (MB-System revisions)
- *
- *--------------------------------------------------------------------*/
-/*
- *	Copyright (c) 1991 by University of Hawaii.
- */
-
-/*
-   iomrv1.c --
-   I/O routines for obsolete Hawaii Mapping Research Group
-   MR1 version 1 files.
-*/
-
-#include <stdio.h>
-
-#include "mbbs_defines.h"
-
-extern double mbbs_nand();
-extern float mbbs_nanf();
-
-extern unsigned long bs_iobytecnt;
-extern int bs_ionaninit;
-extern float bs_ionanf;
-extern double bs_ionand;
-
-int
-mbbs_mr1_xdrpnghdrv1(Ping *png, XDR *xdrs)
-/*
-   Internal routine.
-   Does XDR decoding of an MR1 version 1 ping header.
-   Returns 1 if successful, 0 otherwise.
-*/
-{
-	int tvsec, tvusec;
-	unsigned long sidebc;
-	int mr1_xdrsidev1(PingSide *, XDR *, unsigned long *);
-
-	bs_iobytecnt= 0;
-
-	/* output in obsolete format not allowed! */
-	if (xdrs->x_op == XDR_ENCODE)
-		return 0;
-
-	if (!bs_ionaninit) {
-		bs_ionanf= mbbs_nanf();
-		bs_ionand= mbbs_nand();
-		bs_ionaninit= 1;
-	}
-
-	png->png_flags= PNG_BTYSSFLAGSABSENT;
-
-	/* depending upon the platform, the size of the timeval
-	   struct's fields may be 4 or 8 bytes; for backward
-	   compatibility with old files that use 4-byte fields,
-	   we use 4-byte primitives */
-	if (!xdr_int(xdrs, &tvsec))
-		return 0;
-	bs_iobytecnt+= 4;
-	png->png_tm.tv_sec= tvsec;
-	if (!xdr_int(xdrs, &tvusec))
-		return 0;
-	bs_iobytecnt+= 4;
-	png->png_tm.tv_usec= tvusec;
-
-	png->png_period= bs_ionanf;
-	png->png_slon= bs_ionand;
-	png->png_slat= bs_ionand;
-	png->png_scourse= bs_ionanf;
-	png->png_laybackrng= bs_ionanf;
-	png->png_laybackbrg= bs_ionanf;
-
-	if (!xdr_double(xdrs, &(png->png_tlon)))
-		return 0;
-	bs_iobytecnt+= 8;
-	if (!xdr_double(xdrs, &(png->png_tlat)))
-		return 0;
-	bs_iobytecnt+= 8;
-	if (!xdr_float(xdrs, &(png->png_tcourse)))
-		return 0;
-	bs_iobytecnt+= 4;
-
-	png->png_compass.sns_int= bs_ionanf;
-	png->png_compass.sns_nsamps= 0;
-	if (!xdr_float(xdrs, &(png->png_compass.sns_repval)))
-		return 0;
-	bs_iobytecnt+= 4;
-
-	png->png_depth.sns_int= bs_ionanf;
-	png->png_depth.sns_nsamps= 0;
-	if (!xdr_float(xdrs, &(png->png_depth.sns_repval)))
-		return 0;
-	bs_iobytecnt+= 4;
-
-	if (!xdr_float(xdrs, &(png->png_alt)))
-		return 0;
-	bs_iobytecnt+= 4;
-
-	png->png_pitch.sns_int= bs_ionanf;
-	png->png_pitch.sns_nsamps= 0;
-	if (!xdr_float(xdrs, &(png->png_pitch.sns_repval)))
-		return 0;
-	bs_iobytecnt+= 4;
-
-	png->png_roll.sns_int= bs_ionanf;
-	png->png_roll.sns_nsamps= 0;
-	if (!xdr_float(xdrs, &(png->png_roll.sns_repval)))
-		return 0;
-	bs_iobytecnt+= 4;
-
-	png->png_snspad= 0;
-
-	if (!xdr_float(xdrs, &(png->png_temp)))
-		return 0;
-	bs_iobytecnt+= 4;
-	if (!xdr_float(xdrs, &(png->png_ssincr)))
-		return 0;
-	bs_iobytecnt+= 4;
-
-	png->png_ssyoffsetmode= PNG_SSYOM_UNKNOWN;
-	png->png_magcorr= bs_ionanf;
-	png->png_sndvel= bs_ionanf;
-	png->png_cond= bs_ionanf;
-	png->png_magx= bs_ionanf;
-	png->png_magy= bs_ionanf;
-	png->png_magz= bs_ionanf;
-
-	if (!mr1_xdrsidev1(&(png->png_sides[ACP_PORT]), xdrs, &sidebc))
-		return 0;
-	bs_iobytecnt+= sidebc;
-	png->png_sides[ACP_PORT].ps_bdrange= png->png_alt;
-	png->png_sides[ACP_PORT].ps_ssndrmask= 0.;
-	png->png_sides[ACP_PORT].ps_ssyoffset= bs_ionanf;
-
-	if (!mr1_xdrsidev1(&(png->png_sides[ACP_STBD]), xdrs, &sidebc))
-		return 0;
-	bs_iobytecnt+= sidebc;
-	png->png_sides[ACP_STBD].ps_bdrange= png->png_alt;
-	png->png_sides[ACP_STBD].ps_ssndrmask= 0.;
-	png->png_sides[ACP_STBD].ps_ssyoffset= bs_ionanf;
-
-	return 1;
-}
-
-int
-mr1_xdrsidev1(PingSide *ps, XDR *xdrs, unsigned long *bytecnt)
-/*
-   Internal routine.
-   Does XDR decoding of an obsolete MR1 version 1 PingSide header.
-   Records the total number of bytes transferred into *bytecnt.
-   Returns 1 if successful, 0 otherwise.
-*/
-{
-	*bytecnt= 0;
-
-	/* output in obsolete format not allowed! */
-	if (xdrs->x_op == XDR_ENCODE)
-		return 0;
-
-	if (!bs_ionaninit) {
-		bs_ionanf= mbbs_nanf();
-		bs_ionand= mbbs_nand();
-		bs_ionaninit= 1;
-	}
-
-	/* HMRG code never archived anything to the old ps_trans[]
-	   fields, so their contents are meaningless -- this code
-	   reads those meaningless values and then stores a NaN
-	   to the new ps_xmitpwr field */
-	if (!xdr_float(xdrs, &(ps->ps_xmitpwr)))
-		return 0;
-	*bytecnt+= 4;
-	if (!xdr_float(xdrs, &(ps->ps_xmitpwr)))
-		return 0;
-	*bytecnt+= 4;
-	ps->ps_xmitpwr= bs_ionanf;
-
-	/* HMRG code never archived anything to the ps_gain field
-	   prior to the format MR1 version 2 changeover -- this code
-	   reads that meaningless value and then stores a NaN
-	   to the ps_gain field */
-	if (!xdr_float(xdrs, &(ps->ps_gain)))
-		return 0;
-	*bytecnt+= 4;
-	ps->ps_gain= bs_ionanf;
-
-	/* HMRG code never archived anything to the ps_pulse field
-	   prior to the format MR1 version 2 changeover with the exception
-	   of one format conversion program (sb4b2mr) -- this code
-	   reads that value and then replaces it with a NaN unless
-	   it is non-zero */
-	if (!xdr_float(xdrs, &(ps->ps_pulse)))
-		return 0;
-	*bytecnt+= 4;
-	if (ps->ps_pulse == 0.)
-		ps->ps_pulse= bs_ionanf;
-
-	if (!xdr_int(xdrs, &(ps->ps_btycount)))
-		return 0;
-	*bytecnt+= 4;
-	if (xdrs->x_op == XDR_DECODE)
-		ps->ps_btypad= 0;
-	if (!xdr_float(xdrs, &(ps->ps_ssxoffset)))
-		return 0;
-	*bytecnt+= 4;
-	if (!xdr_int(xdrs, &(ps->ps_sscount)))
-		return 0;
-	*bytecnt+= 4;
-	if (xdrs->x_op == XDR_DECODE)
-		ps->ps_sspad= 0;
-
-	return 1;
-}
diff --git a/src/bsio/mbbs_iomrv2.c b/src/bsio/mbbs_iomrv2.c
deleted file mode 100644
index ed13eef..0000000
--- a/src/bsio/mbbs_iomrv2.c
+++ /dev/null
@@ -1,233 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbbs_iomrv2.c	3/3/2014
- *	$Id: mbbs_iomrv2.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 2014-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/* This source code is part of the mbbsio library used to read and write
- * swath sonar data in the bsio format devised and used by the
- * Hawaii Mapping Research Group of the University of Hawaii.
- * This source code was made available by Roger Davis of the
- * University of Hawaii under the GPL. Minor modifications have
- * been made to the version distributed here as part of MB-System.
- *
- * Author:	Roger Davis (primary author)
- * Author:	D. W. Caress (MB-System revisions)
- * Date:	March 3, 2014 (MB-System revisions)
- *
- *--------------------------------------------------------------------*/
-/*
- *	Copyright (c) 2005 by University of Hawaii.
- */
-
-/*
-   io.c --
-   I/O routines for obsolete Hawaii Mapping Research Group
-   MR1 version 2 files.
-*/
-
-#include <stdio.h>
-
-#include "mbbs_defines.h"
-
-extern double mbbs_nand();
-extern float mbbs_nanf();
-
-extern unsigned long bs_iobytecnt;
-extern int bs_ionaninit;
-extern float bs_ionanf;
-extern double bs_ionand;
-
-int
-mbbs_mr1_xdrpnghdrv2(Ping *png, XDR *xdrs)
-/*
-   Internal routine.
-   Does XDR decoding of an obsolete MR1 version 2 ping header.
-   Returns 1 if successful, 0 otherwise.
-*/
-{
-	int tvsec, tvusec;
-	unsigned long sidebc;
-	int mr1_xdrsidev2(PingSide *, XDR *, unsigned long *);
-
-	bs_iobytecnt= 0;
-
-	/* output in obsolete format not allowed! */
-	if (xdrs->x_op == XDR_ENCODE)
-		return 0;
-
-	if (!bs_ionaninit) {
-		bs_ionanf= mbbs_nanf();
-		bs_ionand= mbbs_nand();
-		bs_ionaninit= 1;
-	}
-
-	png->png_flags= PNG_BTYSSFLAGSABSENT;
-
-	/* depending upon the platform, the size of the timeval
-	   struct's fields may be 4 or 8 bytes; for backward
-	   compatibility with old files that use 4-byte fields,
-	   we use 4-byte primitives */
-	if (!xdr_int(xdrs, &tvsec))
-		return 0;
-	bs_iobytecnt+= 4;
-	png->png_tm.tv_sec= tvsec;
-	if (!xdr_int(xdrs, &tvusec))
-		return 0;
-	bs_iobytecnt+= 4;
-	png->png_tm.tv_usec= tvusec;
-
-	if (!xdr_float(xdrs, &(png->png_period)))
-		return 0;
-	bs_iobytecnt+= 4;
-	if (!xdr_double(xdrs, &(png->png_slon)))
-		return 0;
-	bs_iobytecnt+= 8;
-	if (!xdr_double(xdrs, &(png->png_slat)))
-		return 0;
-	bs_iobytecnt+= 8;
-	if (!xdr_float(xdrs, &(png->png_scourse)))
-		return 0;
-	bs_iobytecnt+= 4;
-	if (!xdr_float(xdrs, &(png->png_laybackrng)))
-		return 0;
-	bs_iobytecnt+= 4;
-	if (!xdr_float(xdrs, &(png->png_laybackbrg)))
-		return 0;
-	bs_iobytecnt+= 4;
-	if (!xdr_double(xdrs, &(png->png_tlon)))
-		return 0;
-	bs_iobytecnt+= 8;
-	if (!xdr_double(xdrs, &(png->png_tlat)))
-		return 0;
-	bs_iobytecnt+= 8;
-	if (!xdr_float(xdrs, &(png->png_tcourse)))
-		return 0;
-	bs_iobytecnt+= 4;
-
-	if (!xdr_float(xdrs, &(png->png_compass.sns_int)))
-		return 0;
-	bs_iobytecnt+= 4;
-	if (!xdr_int(xdrs, &(png->png_compass.sns_nsamps)))
-		return 0;
-	bs_iobytecnt+= 4;
-	if (!xdr_float(xdrs, &(png->png_compass.sns_repval)))
-		return 0;
-	bs_iobytecnt+= 4;
-	if (!xdr_float(xdrs, &(png->png_depth.sns_int)))
-		return 0;
-	bs_iobytecnt+= 4;
-	if (!xdr_int(xdrs, &(png->png_depth.sns_nsamps)))
-		return 0;
-	bs_iobytecnt+= 4;
-	if (!xdr_float(xdrs, &(png->png_depth.sns_repval)))
-		return 0;
-	bs_iobytecnt+= 4;
-	if (!xdr_float(xdrs, &(png->png_pitch.sns_int)))
-		return 0;
-	bs_iobytecnt+= 4;
-	if (!xdr_int(xdrs, &(png->png_pitch.sns_nsamps)))
-		return 0;
-	bs_iobytecnt+= 4;
-	if (!xdr_float(xdrs, &(png->png_pitch.sns_repval)))
-		return 0;
-	bs_iobytecnt+= 4;
-	if (!xdr_float(xdrs, &(png->png_roll.sns_int)))
-		return 0;
-	bs_iobytecnt+= 4;
-	if (!xdr_int(xdrs, &(png->png_roll.sns_nsamps)))
-		return 0;
-	bs_iobytecnt+= 4;
-	if (!xdr_float(xdrs, &(png->png_roll.sns_repval)))
-		return 0;
-	bs_iobytecnt+= 4;
-	png->png_snspad= 0;
-
-	if (!xdr_float(xdrs, &(png->png_temp)))
-		return 0;
-	bs_iobytecnt+= 4;
-	if (!xdr_float(xdrs, &(png->png_ssincr)))
-		return 0;
-	bs_iobytecnt+= 4;
-
-	png->png_ssyoffsetmode= PNG_SSYOM_UNKNOWN;
-
-	if (!xdr_float(xdrs, &(png->png_alt)))
-		return 0;
-	bs_iobytecnt+= 4;
-	if (!xdr_float(xdrs, &(png->png_magcorr)))
-		return 0;
-	bs_iobytecnt+= 4;
-	if (!xdr_float(xdrs, &(png->png_sndvel)))
-		return 0;
-	bs_iobytecnt+= 4;
-
-	png->png_cond= bs_ionanf;
-	png->png_magx= bs_ionanf;
-	png->png_magy= bs_ionanf;
-	png->png_magz= bs_ionanf;
-
-	if (!mr1_xdrsidev2(&(png->png_sides[ACP_PORT]), xdrs, &sidebc))
-		return 0;
-	bs_iobytecnt+= sidebc;
-	png->png_sides[ACP_PORT].ps_ssndrmask= 0.;
-	png->png_sides[ACP_PORT].ps_ssyoffset= bs_ionanf;
-
-	if (!mr1_xdrsidev2(&(png->png_sides[ACP_STBD]), xdrs, &sidebc))
-		return 0;
-	bs_iobytecnt+= sidebc;
-	png->png_sides[ACP_STBD].ps_ssndrmask= 0.;
-	png->png_sides[ACP_STBD].ps_ssyoffset= bs_ionanf;
-
-	return 1;
-}
-
-int
-mr1_xdrsidev2(PingSide *ps, XDR *xdrs, unsigned long *bytecnt)
-/*
-   Internal routine.
-   Does XDR decoding of an obsolete MR1 version 2 PingSide header.
-   Records the total number of bytes transferred into *bytecnt.
-   Returns 1 if successful, 0 otherwise.
-*/
-{
-	*bytecnt= 0;
-
-	/* output in obsolete format not allowed! */
-	if (xdrs->x_op == XDR_ENCODE)
-		return 0;
-
-	if (!xdr_float(xdrs, &(ps->ps_xmitpwr)))
-		return 0;
-	*bytecnt+= 4;
-	if (!xdr_float(xdrs, &(ps->ps_gain)))
-		return 0;
-	*bytecnt+= 4;
-	if (!xdr_float(xdrs, &(ps->ps_pulse)))
-		return 0;
-	*bytecnt+= 4;
-	if (!xdr_float(xdrs, &(ps->ps_bdrange)))
-		return 0;
-	*bytecnt+= 4;
-	if (!xdr_int(xdrs, &(ps->ps_btycount)))
-		return 0;
-	*bytecnt+= 4;
-	ps->ps_btypad= 0;
-	if (!xdr_float(xdrs, &(ps->ps_ssxoffset)))
-		return 0;
-	*bytecnt+= 4;
-	if (!xdr_int(xdrs, &(ps->ps_sscount)))
-		return 0;
-	*bytecnt+= 4;
-	ps->ps_sspad= 0;
-
-	return 1;
-}
diff --git a/src/bsio/mbbs_mem.h b/src/bsio/mbbs_mem.h
deleted file mode 100644
index aafdd37..0000000
--- a/src/bsio/mbbs_mem.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbbs_mem.h	3/3/2014
- *	$Id: mbbs_mem.h 2239 2015-05-07 00:51:42Z caress $
- *
- *    Copyright (c) 2014-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/* This source code is part of the mbbsio library used to read and write
- * swath sonar data in the bsio format devised and used by the
- * Hawaii Mapping Research Group of the University of Hawaii.
- * This source code was made available by Roger Davis of the
- * University of Hawaii under the GPL. Minor modifications have
- * been made to the version distributed here as part of MB-System.
- *
- * Author:	Roger Davis (primary author)
- * Author:	D. W. Caress (MB-System revisions)
- * Date:	March 3, 2014 (MB-System revisions)
- *
- *--------------------------------------------------------------------*/
-/*
- *	Copyright (c) 1998 by University of Hawaii.
- */
-
-#ifndef __MBBS_MEM__
-#define __MBBS_MEM__
-
-#include <sys/types.h>
-#ifndef WIN32
-#include <sys/shm.h>
-#endif
-
-#define MEM_SUCCESS	(0)
-#define MEM_BADARG	(1)
-#define MEM_CALLOC	(2)
-#define MEM_OOB		(3)
-#define MEM_SHMGET	(4)
-#define MEM_SHMATT	(5)
-#define MEM_SHMDET	(6)
-#define MEM_SHMRM	(7)
-
-#define MEM_SHMNULLID	(-1)
-
-#if defined(c_plusplus) || defined(__cplusplus)
-
-extern "C" {
-
-int		mbbs_memalloc(MemType **, unsigned int *, unsigned int, size_t);
-int		mbbs_memallocsh(MemType **, int *, unsigned int *, unsigned int,
-			   size_t);
-void		mbbs_memmaxalloc(unsigned long);
-void		mbbs_revbytes(void *, unsigned int);
-void		mbbs_swapbytes(void *, unsigned int);
-
-}
-
-#else
-
-extern int	mbbs_memalloc(MemType **, unsigned int *, unsigned int, size_t);
-extern int	mbbs_memallocsh(MemType **, int *, unsigned int *, unsigned int,
-			   size_t);
-extern void	mbbs_memmaxalloc(unsigned long);
-extern void	mbbs_revbytes(void *, unsigned int);
-extern void	mbbs_swapbytes(void *, unsigned int);
-
-#endif /* defined(c_plusplus) || defined(__cplusplus) */
-
-#endif /* __MBBS_MEM__ */
diff --git a/src/bsio/mbbs_memalloc.c b/src/bsio/mbbs_memalloc.c
deleted file mode 100644
index 49e7674..0000000
--- a/src/bsio/mbbs_memalloc.c
+++ /dev/null
@@ -1,134 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbbs_memalloc.c	3/3/2014
- *	$Id: mbbs_memalloc.c 2239 2015-05-07 00:51:42Z caress $
- *
- *    Copyright (c) 2014-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/* This source code is part of the mbbsio library used to read and write
- * swath sonar data in the bsio format devised and used by the
- * Hawaii Mapping Research Group of the University of Hawaii.
- * This source code was made available by Roger Davis of the
- * University of Hawaii under the GPL. Minor modifications have
- * been made to the version distributed here as part of MB-System.
- *
- * Author:	Roger Davis (primary author)
- * Author:	D. W. Caress (MB-System revisions)
- * Date:	March 3, 2014 (MB-System revisions)
- *
- *--------------------------------------------------------------------*/
-/*
- *	Copyright (c) 1992 by University of Hawaii.
- */
-
-#include <string.h>
-#include <stdlib.h>
-
-#include "mbbs_defines.h"
-#include "mbbs_mem.h"
-
-/* maximum allocation size allowed (0 => no limit) */
-static unsigned long mem_maxallocsz= 0;
-
-#ifndef WIN32
-static key_t mem_key= (key_t) IPC_PRIVATE;
-#endif
-static int mem_shmflag= 0666;
-
-void
-mbbs_memmaxalloc(unsigned long m)
-{
-	mem_maxallocsz= m;
-
-	return;
-}
-
-int
-mbbs_memalloc(MemType **buf, unsigned int *bufsz, unsigned int nobj, size_t objsz)
-{
-	if (buf == (MemType **) 0)
-		return MEM_BADARG;
-	if (bufsz == (unsigned int *) 0)
-		return MEM_BADARG;
-
-	/* sufficient memory already allocated? */
-	if (*bufsz >= nobj) {
-		if ((*buf != (MemType *) 0) && (nobj != 0) && (objsz != 0))
-			MemZero(*buf, nobj*objsz);
-		return MEM_SUCCESS;
-	}
-
-	if ((mem_maxallocsz != 0) && (mem_maxallocsz < (unsigned long) (nobj*objsz)))
-		return MEM_OOB;
-
-	/* free any existing memory */
-	if (*buf != (MemType *) 0)
-		CFree((MemType *) *buf);
-	*bufsz= 0;
-
-	/* allocate new memory */
-	if ((*buf= (MemType *) calloc((MemSizeType) nobj, (MemSizeType) objsz)) == (MemType *) 0)
-		return MEM_CALLOC;
-	*bufsz= nobj;
-
-	return MEM_SUCCESS;
-}
-
-#ifndef WIN32
-int
-mbbs_memallocsh(MemType **buf, int *shmid, unsigned int *bufsz, unsigned int nobj, size_t objsz)
-{
-	if (buf == (MemType **) 0)
-		return MEM_BADARG;
-	if (shmid == (int *) 0)
-		return MEM_BADARG;
-	if (bufsz == (unsigned int *) 0)
-		return MEM_BADARG;
-
-	/* sufficient memory already allocated? */
-	if (*bufsz >= nobj) {
-		if ((*buf != (MemType *) 0) && (nobj != 0) && (objsz != 0))
-			MemZero(*buf, nobj*objsz);
-		return MEM_SUCCESS;
-	}
-
-	if ((mem_maxallocsz != 0) && (mem_maxallocsz < (unsigned long) (nobj*objsz)))
-		return MEM_OOB;
-
-	/* free any existing memory */
-	if ((*buf != (MemType *) 0) && (*shmid != MEM_SHMNULLID)) {
-		if (shmdt((MemType *) *buf) < 0)
-			return MEM_SHMDET;
-		*buf= (MemType *) 0;
-		*bufsz= 0;
-		if (shmctl(*shmid, IPC_RMID, (struct shmid_ds *) 0) < 0) {
-			*shmid= MEM_SHMNULLID;
-			return MEM_SHMRM;
-		}
-	}
-	*buf= (MemType *) 0;
-	*bufsz= 0;
-	*shmid= MEM_SHMNULLID;
-
-	/* allocate new memory */
-	if ((*shmid= shmget(mem_key, (MemSizeType) (nobj*objsz), mem_shmflag)) < 0) {
-		*shmid= MEM_SHMNULLID;
-		return MEM_SHMGET;
-	}
-	if ((*buf= (MemType *) shmat(*shmid, (MemType *) 0, (int) 0)) == (MemType *) -1) {
-		(void) shmctl(*shmid, IPC_RMID, (struct shmid_ds *) 0);
-		*shmid= MEM_SHMNULLID;
-		return MEM_SHMATT;
-	}
-	*bufsz= nobj;
-
-	return MEM_SUCCESS;
-}
-#endif
diff --git a/src/bsio/mbbs_misc.c b/src/bsio/mbbs_misc.c
deleted file mode 100644
index c0d6ac9..0000000
--- a/src/bsio/mbbs_misc.c
+++ /dev/null
@@ -1,655 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbbs_misc.c	3/3/2014
- *	$Id: mbbs_misc.c 2239 2015-05-07 00:51:42Z caress $
- *
- *    Copyright (c) 2014-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/* This source code is part of the mbbsio library used to read and write
- * swath sonar data in the bsio format devised and used by the
- * Hawaii Mapping Research Group of the University of Hawaii.
- * This source code was made available by Roger Davis of the
- * University of Hawaii under the GPL. Minor modifications have
- * been made to the version distributed here as part of MB-System.
- *
- * Author:	Roger Davis (primary author)
- * Author:	D. W. Caress (MB-System revisions)
- * Date:	March 3, 2014 (MB-System revisions)
- *
- *--------------------------------------------------------------------*/
-/*
- *	Copyright (c) 1991 by University of Hawaii.
- */
-
-/*
-   misc.c --
-   Miscellaneous routines for MR1 post-processing software.
-*/
-
-#include <stdlib.h>
-#include <string.h>
-#ifndef WIN32
-#include <sys/time.h>		/* Why this include? time.h is included by mbbs_defines.h */
-#endif
-#include <math.h>
-
-#include "mbbs_defines.h"
-#include "mbbs_mem.h"
-
-int
-mbbs_pngdatabufsz(Ping *png, unsigned long long *pngsz)
-/*
-   User-callable routine.
-
-   Returns the size in bytes of the smallest buffer capable of
-   holding the sensor, bathymetry, bathymetry flag, sidescan and
-   auxiliary beam information data referred to by png into *pngsz.
-
-   Returns BS_SUCCESS or an error code. A reasonable (but possibly
-   not airtight and definitely not precise) effort is made to guard
-   against pings with negative or overly large sample counts.
-
-   Note that the original design of the BS format implicitly
-   limited the maximum ping buffer size to be no greater than the
-   number of bytes which could be described by a signed 32-bit
-   integer, i.e., BS_MAXSIGNEDINT32 (2147483647). This routine has
-   been coded to enforce that limitation, but will attempt if possible
-   to determine the actual size of a ping buffer even when it would
-   be greater than this limit. In any case where the size of the
-   ping is known to be over the limit, or it is believed that it
-   might be over the limit, the function will return BS_HUGEPING.
-   In such cases the value written to *pngsz will be accurate if and
-   only if the host architecture supports 8-byte (or larger) unsigned
-   long long integers.
-*/
-{
-	int retval, npbty, npss, nsbty, nsss;
-	unsigned long long maxsignedint32, nbytes;
-	unsigned long long nfloats, nuints, nuchars, nabis, bsi, k;
-	unsigned long long ullncompass, ullndepth, ullnpitch, ullnroll;
-	unsigned long long ullpbtyc, ullpbtyp, ullpssc, ullpssp;
-	unsigned long long ullsbtyc, ullsbtyp, ullsssc, ullsssp;
-
-	if (pngsz == (unsigned long long *) 0)
-		return BS_BADARG;
-
-	*pngsz= 0;
-
-	if (sizeof(int) < 4)
-		return BS_BADARCH;
-	if (png == (Ping *) 0)
-		return BS_BADARG;
-
-	/* any negative sample count will cause trouble */
-	if ((png->png_compass.sns_nsamps < 0) ||
-	    (png->png_depth.sns_nsamps < 0) ||
-	    (png->png_pitch.sns_nsamps < 0) ||
-	    (png->png_roll.sns_nsamps < 0) ||
-	    (png->png_sides[ACP_PORT].ps_btycount < 0) ||
-	    (png->png_sides[ACP_PORT].ps_btypad < 0) ||
-	    (png->png_sides[ACP_PORT].ps_sscount < 0) ||
-	    (png->png_sides[ACP_PORT].ps_sspad < 0) ||
-	    (png->png_sides[ACP_STBD].ps_btycount < 0) ||
-	    (png->png_sides[ACP_STBD].ps_btypad < 0) ||
-	    (png->png_sides[ACP_STBD].ps_sscount < 0) ||
-	    (png->png_sides[ACP_STBD].ps_sspad < 0))
-		return BS_BADDATA;
-
-	/* assume success until we discover otherwise */
-	retval= BS_SUCCESS;
-
-	/* we cannot accurately check for oversized pings
-	   on hosts where sizeof(unsigned long long) is
-	   less than 8 bytes, so adopt greater restrictions
-	   on data sizes as necessary */
-	if (sizeof(unsigned long long) < 8) {
-		npbty= png->png_sides[ACP_PORT].ps_btycount+
-		       png->png_sides[ACP_PORT].ps_btypad;
-		npss= png->png_sides[ACP_PORT].ps_sscount+
-		      png->png_sides[ACP_PORT].ps_sspad;
-		nsbty= png->png_sides[ACP_STBD].ps_btycount+
-		       png->png_sides[ACP_STBD].ps_btypad;
-		nsss= png->png_sides[ACP_STBD].ps_sscount+
-		      png->png_sides[ACP_STBD].ps_sspad;
-
-		/* negative sums here probably indicate additive
-		   overflow since the input operands were positive */
-		if (npbty < 0)
-			retval= BS_HUGEPING;
-		else if (npss < 0)
-			retval= BS_HUGEPING;
-		else if (nsbty < 0)
-			retval= BS_HUGEPING;
-		else if (nsss < 0)
-			retval= BS_HUGEPING;
-
-		else if ((png->png_compass.sns_nsamps > BS_MAXATTSAMPS) ||
-			 (png->png_depth.sns_nsamps > BS_MAXATTSAMPS) ||
-			 (png->png_pitch.sns_nsamps > BS_MAXATTSAMPS) ||
-			 (png->png_roll.sns_nsamps > BS_MAXATTSAMPS) ||
-			 (npbty > BS_MAXBTYSAMPS) ||
-			 (npss > BS_MAXSSSAMPS) ||
-			 (nsbty > BS_MAXBTYSAMPS) ||
-			 (nsss > BS_MAXSSSAMPS))
-			retval= BS_HUGEPING;
-
-		if (retval != BS_SUCCESS)
-			return retval;
-	}
-
-	if (png->png_flags & PNG_XYZ)
-		bsi= 3;
-	else
-		bsi= 2;
-
-	/* explicitly cast everything to unsigned long long */
-	ullncompass= (unsigned long long) png->png_compass.sns_nsamps;
-	ullndepth= (unsigned long long) png->png_depth.sns_nsamps;
-	ullnpitch= (unsigned long long) png->png_pitch.sns_nsamps;
-	ullnroll= (unsigned long long) png->png_roll.sns_nsamps;
-	ullpbtyc= (unsigned long long) png->png_sides[ACP_PORT].ps_btycount;
-	ullpbtyp= (unsigned long long) png->png_sides[ACP_PORT].ps_btypad;
-	ullpssc= (unsigned long long) png->png_sides[ACP_PORT].ps_sscount;
-	ullpssp= (unsigned long long) png->png_sides[ACP_PORT].ps_sspad;
-	ullsbtyc= (unsigned long long) png->png_sides[ACP_STBD].ps_btycount;
-	ullsbtyp= (unsigned long long) png->png_sides[ACP_STBD].ps_btypad;
-	ullsssc= (unsigned long long) png->png_sides[ACP_STBD].ps_sscount;
-	ullsssp= (unsigned long long) png->png_sides[ACP_STBD].ps_sspad;
-
-	nbytes= 0;
-
-	/* sensor section */
-	nfloats= ullncompass+ullndepth+ullnpitch+ullnroll;
-	nbytes+= nfloats*((unsigned long long) sizeof(float));
-
-	/* port bathymetry/sidescan data and flags */
-	nfloats= (bsi*(ullpbtyc+ullpbtyp))+ullpssc+ullpssp;
-	nuints= ullpbtyc+ullpbtyp;
-	nuchars= ullpssc+ullpssp;
-	nbytes+= (nfloats*((unsigned long long) sizeof(float)))+
-		 (nuints*((unsigned long long) sizeof(unsigned int)))+
-		 nuchars;
-
-	/* make sure start of starboard data/flags
-	   section is properly byte-aligned */
-	if ((k= nbytes%PNG_BYTEALIGNSZ) != 0)
-		nbytes+= PNG_BYTEALIGNSZ-k;
-
-	/* starboard bathymetry/sidescan data and flags */
-	nfloats= (bsi*(ullsbtyc+ullsbtyp))+ullsssc+ullsssp;
-	nuints= ullsbtyc+ullsbtyp;
-	nuchars= ullsssc+ullsssp;
-	nbytes+= (nfloats*((unsigned long long) sizeof(float)))+
-		 (nuints*((unsigned long long) sizeof(unsigned int)))+
-		 nuchars;
-
-	/* make sure start of auxiliary beam
-	   information is properly byte-aligned */
-	if ((k= nbytes%PNG_BYTEALIGNSZ) != 0)
-		nbytes+= PNG_BYTEALIGNSZ-k;
-
-	/* auxiliary beam information */
-	if (png->png_flags & PNG_ABI) {
-		nabis= ullpbtyc+ullpbtyp+ullsbtyc+ullsbtyp;
-		nbytes+= nabis*((unsigned long long) sizeof(AuxBeamInfo));
-	}
-
-	*pngsz= nbytes;
-
-	if (sizeof(unsigned long long) >= 8) {
-		maxsignedint32= (unsigned long long) BS_MAXSIGNEDINT32;
-		if (*pngsz > maxsignedint32)
-			retval= BS_HUGEPING;
-	}
-
-	return retval;
-}
-
-MemType *
-mbbs_pngmemalloc(Ping *png)
-/*
-   User-callable routine.
-   Allocates memory for ping data arrays.
-   Returns a pointer to the allocated memory.
-*/
-{
-	unsigned long long ullnbytes;
-	unsigned int nbytes;
-	int err;
-
-	if (sizeof(int) < 4)
-		return (MemType *) 0;
-
-	if ((err= mbbs_pngdatabufsz(png, &ullnbytes)) != BS_SUCCESS)
-		return (MemType *) 0;
-
-	/* this should be safe to do if the
-	   preceding call has not returned
-	   BS_HUGEPING (or any other error) */
-	nbytes= (unsigned int) ullnbytes;
-
-	return (float *) calloc((MemSizeType) nbytes, (MemSizeType) 1);
-}
-
-int
-mbbs_pngrealloc(Ping *png, MemType **buf, unsigned int *bufsz)
-/*
-   User-callable routine.
-
-   Reallocates memory for ping data arrays.
-
-   Returns BS_SUCCESS or any of various error codes, also
-   returns a pointer to the reallocated (if necessary) buffer
-   into *buf and the size in bytes of the buffer into bufsz.
-*/
-{
-	unsigned long long ullnbytes;
-	unsigned int nbytes;
-	int err, retval;
-
-	if (sizeof(int) < 4)
-		return BS_BADARCH;
-
-	if (png == (Ping *) 0)
-		return BS_BADARG;
-
-	if ((err= mbbs_pngdatabufsz(png, &ullnbytes)) != BS_SUCCESS)
-		return err;
-
-	/* this should be safe to do if the 
-	   preceding call has not returned 
-	   BS_HUGEPING (or any other error) */
-	nbytes= (unsigned int) ullnbytes;
-
-	if ((retval= mbbs_memalloc(buf, bufsz, nbytes, (size_t) 1)) != MEM_SUCCESS) {
-		switch (retval) {
-		case MEM_BADARG:
-			return BS_BADARG;
-		case MEM_OOB:
-			return BS_BADARG;
-		case MEM_CALLOC:
-			return BS_MEMALLOC;
-		default:
-			return BS_FAILURE;
-		}
-	}
-
-	return BS_SUCCESS;
-}
-
-int
-mbbs_getpngdataptrs(Ping *png, MemType *data, PingData *pd)
-/*
-   User-callable routine.
-
-   Returns pointers to the various sections (e.g., sensor, bathymetry,
-   etc.) of a ping's data sample buffer into the fields of pd.
-
-   Returns BS_SUCCESS or BS_BADARG.
-*/
-{
-	float *fp;
-	int err, bsi, side, k;
-	unsigned long long ullnbytes;
-	unsigned int *uip, nbytes;
-	unsigned char *ucp0, *ucp1;
-
-	if (sizeof(int) < 4)
-		return BS_BADARCH;
-
-	if (png == (Ping *) 0)
-		return BS_BADARG;
-
-	if ((err= mbbs_pngdatabufsz(png, &ullnbytes)) != BS_SUCCESS)
-		return err;
-
-	/* this may or may not be the right thing to do,
-	   but not doing it will break almost any HMRG program
-	   which encounters a ping with no data */
-	if (ullnbytes == 0)
-		return BS_SUCCESS;
-
-	if (data == (MemType *) 0)
-		return BS_BADARG;
-	if (pd == (PingData *) 0)
-		return BS_BADARG;
-
-	fp= (float *) data;
-	pd->pd_compass= fp;
-	fp+= png->png_compass.sns_nsamps;
-	pd->pd_depth= fp;
-	fp+= png->png_depth.sns_nsamps;
-	pd->pd_pitch= fp;
-	fp+= png->png_pitch.sns_nsamps;
-	pd->pd_roll= fp;
-	fp+= png->png_roll.sns_nsamps;
-	fp+= png->png_snspad;
-	ucp1= (unsigned char *) fp;
-
-	if (png->png_flags & PNG_XYZ)
-		bsi= 3;
-	else
-		bsi= 2;
-
-	for (side= ACP_PORT; side < ACP_NSIDES; side++) {
-		fp= (float *) ucp1;
-
-		pd->pd_bty[side]= fp;
-		fp+= (bsi*(png->png_sides[side].ps_btycount+png->png_sides[side].ps_btypad));
-
-		uip= (unsigned int *) fp;
-		pd->pd_btyflags[side]= uip;
-		uip+= png->png_sides[side].ps_btycount+png->png_sides[side].ps_btypad;
-
-		fp= (float *) uip;
-		pd->pd_ss[side]= fp;
-		fp+= png->png_sides[side].ps_sscount+png->png_sides[side].ps_sspad;
-
-		ucp1= (unsigned char *) fp;
-		pd->pd_ssflags[side]= ucp1;
-		ucp1+= png->png_sides[side].ps_sscount+png->png_sides[side].ps_sspad;
-
-		/* make sure start of next data
-		   section is properly byte-aligned */
-		ucp0= (unsigned char *) data;
-		nbytes= (unsigned int) (ucp1-ucp0);
-		if ((k= nbytes%PNG_BYTEALIGNSZ) != 0)
-			ucp1+= PNG_BYTEALIGNSZ-k;
-	}
-
-	if (png->png_flags & PNG_ABI) {
-		pd->pd_abi[ACP_PORT]= (AuxBeamInfo *) ucp1;
-		pd->pd_abi[ACP_STBD]= pd->pd_abi[ACP_PORT]+
-				      png->png_sides[ACP_PORT].ps_btycount+
-				      png->png_sides[ACP_PORT].ps_btypad;
-	}
-	else
-		pd->pd_abi[ACP_PORT]= pd->pd_abi[ACP_STBD]= (AuxBeamInfo *) 0;
-
-
-	return BS_SUCCESS;
-}
-
-int
-mbbs_appendstr(char **field, char *str)
-/*
-   User-callable routine.
-   Append a string to the specified string field.
-   Returns BS_SUCCESS, BS_BADARG or BS_MEMALLOC.
-*/
-{
-	StrSizeType len;
-	char *newfield;
-
-	if (field == (char **) 0)
-		return BS_BADARG;
-	if ((str == (char *) 0) || (strlen(str) == 0))
-		return BS_SUCCESS;
-
-	if (*field != (char *) 0)
-		len= strlen(*field);
-	else
-		len= (StrSizeType) 0;
-	len+= strlen(str)+1;
-
-	if ((newfield= (char *) calloc((MemSizeType) len, sizeof(char))) == (char *) 0)
-		return BS_MEMALLOC;
-	if (*field != (char *) 0)
-		(void) strcpy(newfield, *field);
-	(void) strcat(newfield, str);
-	if (*field != (char *) 0)
-		CFree((MemType *) *field);
-	*field= newfield;
-
-	return BS_SUCCESS;
-}
-
-int
-mbbs_appendlog(BSFile *bsf, char **argv)
-/*
-   User-callable routine.
-   Appends the specified argument list to the file log
-   with (i) a leading newline (if the current file log is
-   non-empty), (ii) separating blank spaces between the
-   strings of the argument list and (iii) a trailing semicolon.
-   Returns BS_SUCCESS, BS_BADARCH, BS_BADARG or BS_MEMALLOC.
-*/
-{
-	char **av;
-	int firstarg;
-	StrSizeType len;
-	char *newlog;
-
-	if (sizeof(int) < 4)
-		return BS_BADARCH;
-
-	if (bsf == (BSFile *) 0)
-		return BS_BADARG;
-	if (argv == (char **) 0)
-		return BS_BADARG;
-
-	for (av= argv, len= 0; *av != (char *) 0; av++) {
-		if (strlen(*av) > 0)
-			len+= strlen(*av)+1;
-	}
-	if (len == (StrSizeType) 0)
-		return BS_SUCCESS;
-	if ((bsf->bsf_log != (char *) 0) && (strlen(bsf->bsf_log) > 0))
-		len+= strlen(bsf->bsf_log);
-	else
-		len-= 1;
-	len+= 2;
-
-	if ((newlog= (char *) calloc((MemSizeType) len, sizeof(char))) == (char *) 0)
-		return BS_MEMALLOC;
-	if ((bsf->bsf_log != (char *) 0) && (strlen(bsf->bsf_log) > 0))
-		(void) strcpy(newlog, bsf->bsf_log);
-	else
-		(void) strcpy(newlog, "");
-
-	for (av= argv, firstarg= 1; *av != (char *) 0; av++) {
-		if (strlen(*av) > 0) {
-			if (firstarg) {
-				if ((bsf->bsf_log != (char *) 0) && (strlen(bsf->bsf_log) > 0))
-					(void) strcat(newlog, "\n");
-				firstarg= 0;
-			}
-			else
-				(void) strcat(newlog, " ");
-			(void) strcat(newlog, *av);
-		}
-	}
-	(void) strcat(newlog, ";");
-
-	if (bsf->bsf_log != (char *) 0)
-		CFree((MemType *) bsf->bsf_log);
-	bsf->bsf_log= newlog;
-
-	return BS_SUCCESS;
-}
-
-int
-mbbs_replacestr(char **field, char *str)
-/*
-   User-callable routine.
-   Copy a string to the specified string field.
-   Returns BS_SUCCESS, BS_BADARG or BS_MEMALLOC.
-*/
-{
-	StrSizeType olen, nlen;
-	char *newfield;
-
-	if (field == (char **) 0)
-		return BS_BADARG;
-	if ((str == (char *) 0) || (strlen(str) == 0)) {
-		if (*field != (char *) 0) {
-			CFree((MemType *) *field);
-			*field= (char *) 0;
-		}
-		return BS_SUCCESS;
-	}
-
-	if (*field != (char *) 0)
-		olen= strlen(*field)+1;
-	else
-		olen= 0;
-	nlen= strlen(str)+1;
-
-	if (nlen != olen) {
-		if ((newfield= (char *) calloc((MemSizeType) nlen, sizeof(char))) == (char *) 0)
-			return BS_MEMALLOC;
-		(void) strcpy(newfield, str);
-		if (*field != (char *) 0)
-			CFree((MemType *) *field);
-		*field= newfield;
-	}
-	else
-		(void) strcpy(*field, str);
-
-	return BS_SUCCESS;
-}
-
-int
-mbbs_striptail(char *str, char c)
-/*
-   User-callable routine.
-   Strips all consecutive instances of c from the end of str.
-   Returns BS_SUCCESS or BS_BADARG.
-*/
-{
-	StrSizeType len;
-	char *cp;
-
-	if ((str == (char *) 0) || ((len= strlen(str)) == (StrSizeType) 0))
-		return BS_BADARG;
-	if (c == '\0')
-		return BS_BADARG;
-
-	for (cp= str+len-1; cp >= str; cp--) {
-		if (*cp == c)
-			*cp= '\0';
-		else
-			break;
-	}
-
-	return BS_SUCCESS;
-}
-
-void *
-mbbs_mrkmemalloc(int size)
-/*
-   User-callable routine.
-   Allocates ping mark memory and sets all marks to BS_NULLMARK (i.e., 0).
-*/
-{
-	unsigned int bufsz;
-
-	bufsz= size/2;
-	if (size%2 != 0)
-		bufsz++;
-	return (void *) calloc((MemSizeType) bufsz, sizeof(char));
-}
-
-int
-mbbs_mrkget(void *mrkbuf, int side, int index)
-/*
-   User-callable routine.
-   Returns the ping mark value of the specified ping index.
-*/
-{
-	char *c;
-
-	c= (char *) mrkbuf;
-	c+= index/2;
-	return ((*c >> (((index%2)*4)+(side*2))) & 0x3);
-}
-
-void
-mbbs_mrkset(void *mrkbuf, int side, int index, int value)
-/*
-   User-callable routine.
-   Sets the ping mark value of the specified ping index.
-*/
-{
-	char *c;
-	unsigned char uv;
-
-	c= (char *) mrkbuf;
-	c+= index/2;
-	*c&= ~(0x3 << (((index%2)*4)+(side*2)));
-	uv= (unsigned char) ((value & 0x3) << (((index%2)*4)+(side*2)));
-	*c|= uv;
-	return;
-}
-
-/*
-   The following routines return single- and double-precision NaNs.
-   They use specific bit patterns when the size in bytes of the
-   floating point storage units and the bit patterns are the same,
-   otherwise they fall back to 0./0., which hopefully will work
-   in all other cases.
-*/
-
-float
-mbbs_nanf()
-{
-	unsigned int ui;
-	float f;
-
-/* mbbs_misc.c(607) : error C2124: divide or mod by zero */
-/*
-	if (sizeof(float) != sizeof(unsigned int))
-		f= 0./0.;
-	else {
-*/
-		ui= 0xffc00000;
-		MemCopy(&ui, &f, sizeof(float));
-/*	} */
-
-	return f;
-}
-
-double
-mbbs_nand()
-{
-	unsigned long long ull;
-	double d;
-
-/*	if (sizeof(double) != sizeof(unsigned long long))
-		d= 0./0.;
-	else {
-*/
-		ull= 0xfff8000000000000ULL;
-		MemCopy(&ull, &d, sizeof(double));
-/*	} */
-
-	return d;
-}
-
-int
-mbbs_isnanf(float f)
-{
-#if defined(SOLARIS) || defined(IRIX)
-        return isnanf(f);
-#else
-	/* hope this works! */
-        return isnan((double) f);
-#endif /* defined(SOLARIS) || defined(IRIX) */
-}
-
-int
-mbbs_isnand(double d)
-{
-#if defined(SOLARIS) || defined(IRIX)
-        return isnand(d);
-#else
-        return isnan(d);
-#endif /* defined(SOLARIS) || defined(IRIX) */
-}
diff --git a/src/bsio/mbbs_swapbytes.c b/src/bsio/mbbs_swapbytes.c
deleted file mode 100644
index 885a680..0000000
--- a/src/bsio/mbbs_swapbytes.c
+++ /dev/null
@@ -1,66 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbbs_swapbytes.c	3/3/2014
- *	$Id: mbbs_swapbytes.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 2014-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/* This source code is part of the mbbsio library used to read and write
- * swath sonar data in the bsio format devised and used by the
- * Hawaii Mapping Research Group of the University of Hawaii.
- * This source code was made available by Roger Davis of the
- * University of Hawaii under the GPL. Minor modifications have
- * been made to the version distributed here as part of MB-System.
- *
- * Author:	Roger Davis (primary author)
- * Author:	D. W. Caress (MB-System revisions)
- * Date:	March 3, 2014 (MB-System revisions)
- *
- *--------------------------------------------------------------------*/
-/*
- *	Copyright (c) 1998 by University of Hawaii.
- */
-
-#include "mbbs_defines.h"
-#include "mbbs_mem.h"
-
-void
-swapbytes(MemType *buf, unsigned int bufsz)
-{
-	unsigned char *a, *b, tmp;
-	unsigned int nswap;
-
-	a= (unsigned char *) buf;
-	b= a+1;
-	for (nswap= bufsz/2; nswap > 0; nswap--, a+= 2, b+= 2) {
-		tmp= *a;
-		*a= *b;
-		*b= tmp;
-	}
-
-	return;
-}
-
-void
-revbytes(MemType *buf, unsigned int bufsz)
-{
-	unsigned char *a, *b, tmp;
-	unsigned int nrev;
-
-	a= (unsigned char *) buf;
-	b= a+bufsz-1;
-	for (nrev= bufsz/2; nrev > 0; nrev--, a++, b--) {
-		tmp= *a;
-		*a= *b;
-		*b= tmp;
-	}
-
-	return;
-}
diff --git a/src/bsio/mbbs_tm.c b/src/bsio/mbbs_tm.c
deleted file mode 100644
index c1700ca..0000000
--- a/src/bsio/mbbs_tm.c
+++ /dev/null
@@ -1,343 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbbs_tm.c	3/3/2014
- *	$Id: mbbs_tm.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 2014-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/* This source code is part of the mbbsio library used to read and write
- * swath sonar data in the bsio format devised and used by the
- * Hawaii Mapping Research Group of the University of Hawaii.
- * This source code was made available by Roger Davis of the
- * University of Hawaii under the GPL. Minor modifications have
- * been made to the version distributed here as part of MB-System.
- *
- * Author:	Roger Davis (primary author)
- * Author:	D. W. Caress (MB-System revisions)
- * Date:	March 3, 2014 (MB-System revisions)
- *
- *--------------------------------------------------------------------*/
-/*
- *	Copyright (c) 1993 by University of Hawaii.
- */
-
-#include <string.h>
-#include <stdlib.h>
-#include <sys/types.h>
-
-#include "mbbs_defines.h"
-
-static int tm_monthdays[]= { 31, 28, 31, 30, 31, 30,
-			     31, 31, 30, 31, 30, 31,
-			     31 };
-static int tm_callertz= TM_TZ_UNKNOWN;
-
-static char *tm_newtzval, *tm_oldtzval;
-static int tm_rsttzval, tm_clrtzval;
-
-int
-mbbs_tmparsegmttz(char *str, int tmmode, double *dtm)
-/*
-   It turns out that making large numbers of calls to mbbs_tmparse()
-   is very expensive memory-wise due to the repeated calloc() calls
-   which are performed whenever mbbs_setgmttz() and mbbs_rsttz() are
-   called by mbbs_tmparse(). It is much cheaper to have the caller
-   set the time zone to GMT once, if possible, and then call this
-   routine instead. This routine sets and restores a special flag
-   that turns both mbbs_setgmttz() and mbbs_rsttz() into no-ops.
-*/
-{
-	int err;
-	int mbbs_tmparse(char *, int, double *);
-
-	tm_callertz= TM_TZ_GMT;
-	err= mbbs_tmparse(str, tmmode, dtm);
-	tm_callertz= TM_TZ_UNKNOWN;
-
-	return err;
-}
-
-int
-mbbs_tmparse(char *str, int tmmode, double *dtm)
-{
-	char tmstrcp[TM_MAXSTRLEN+1];
-	struct tm ts;
-	char *token, *cp;
-	double seconds, fraction;
-	int err;
-	time_t tmt;
-	int mbbs_setgmttz();
-	int mbbs_rsttz(int);
-	void mbbs_jul2cal(struct tm *), mbbs_cal2jul(struct tm *);
-
-	switch (tmmode) {
-	case TM_JULIAN:
-	case TM_CALENDAR:
-		break;
-	default:
-		return BS_BADARG;
-	}
-
-	/* mktime() gives unreliable results unless
-	   the time zone is explicitly set to GMT */
-	if ((err= mbbs_setgmttz()) != BS_SUCCESS)
-		return err;
-
-	if ((str == (char *) 0) || (strlen(str) == 0))
-		return mbbs_rsttz(BS_BADARG);
-	else if (strlen(str) <= TM_MAXSTRLEN)
-		(void) strcpy(tmstrcp, str);
-	else
-		return mbbs_rsttz(BS_BADARG);
-
-	ts.tm_sec= 0;
-	ts.tm_min= 0;
-	ts.tm_hour= 0;
-	ts.tm_mday= 1;
-	ts.tm_mon= 0;
-	ts.tm_wday= 0;
-	ts.tm_yday= 0;
-	ts.tm_isdst= 0;
-
-	if ((token= strtok(tmstrcp, ":/- ")) == (char *) 0)
-		 return mbbs_rsttz(BS_BADARG);
-	ts.tm_year= (int) strtol(token, &cp, 10);
-	if ((cp == token) || (*cp != '\0'))
-		 return mbbs_rsttz(BS_BADARG);
-	if (ts.tm_year < 0)
-		 return mbbs_rsttz(BS_BADARG);
-	if (ts.tm_year < 100) {
-
-		/* this breaks in 2050 ;-> */
-		if (ts.tm_year < 50)
-			ts.tm_year+= 2000;
-		else
-			ts.tm_year+= 1900;
-	}
-	ts.tm_year-= 1900;
-
-	if ((token= strtok((char *) 0, ":/- ")) == (char *) 0) {
-		if ((tmt= mktime(&ts)) == (time_t) -1)
-			return mbbs_rsttz(BS_FAILURE);
-		*dtm= (double) tmt;
-		return mbbs_rsttz(BS_SUCCESS);
-	}
-	switch (tmmode) {
-	case TM_JULIAN:
-		ts.tm_yday= (int) strtol(token, &cp, 10);
-		if ((cp == token) || (*cp != '\0'))
-			 return mbbs_rsttz(BS_BADARG);
-		if ((ts.tm_yday < 1) || (ts.tm_yday > 366))
-			 return mbbs_rsttz(BS_BADARG);
-		ts.tm_yday-= 1;
-		mbbs_jul2cal(&ts);
-		break;
-
-	case TM_CALENDAR:
-		ts.tm_mon= (int) strtol(token, &cp, 10);
-		if ((cp == token) || (*cp != '\0'))
-			 return mbbs_rsttz(BS_BADARG);
-		if ((ts.tm_mon < 1) || (ts.tm_mon > 12))
-			 return mbbs_rsttz(BS_BADARG);
-		ts.tm_mon-= 1;
-
-		if ((token= strtok((char *) 0, ":/- ")) == (char *) 0) {
-			mbbs_cal2jul(&ts);
-			if ((tmt= mktime(&ts)) == (time_t) -1)
-				return mbbs_rsttz(BS_FAILURE);
-			*dtm= (double) tmt;
-			return mbbs_rsttz(BS_SUCCESS);
-		}
-		ts.tm_mday= (int) strtol(token, &cp, 10);
-		if ((cp == token) || (*cp != '\0'))
-			 return mbbs_rsttz(BS_BADARG);
-		if ((ts.tm_mday < 1) || (ts.tm_mday > 31))
-			 return mbbs_rsttz(BS_BADARG);
-		mbbs_cal2jul(&ts);
-		break;
-	}
-
-	if ((token= strtok((char *) 0, ":/- ")) == (char *) 0) {
-		if ((tmt= mktime(&ts)) == (time_t) -1)
-			return mbbs_rsttz(BS_FAILURE);
-		*dtm= (double) tmt;
-		return mbbs_rsttz(BS_SUCCESS);
-	}
-	ts.tm_hour= (int) strtol(token, &cp, 10);
-	if ((cp == token) || (*cp != '\0'))
-		 return mbbs_rsttz(BS_BADARG);
-	if ((ts.tm_hour < 0) || (ts.tm_hour > 23))
-		 return mbbs_rsttz(BS_BADARG);
-
-	if ((token= strtok((char *) 0, ":/- ")) == (char *) 0) {
-		if ((tmt= mktime(&ts)) == (time_t) -1)
-			return mbbs_rsttz(BS_FAILURE);
-		*dtm= (double) tmt;
-		return mbbs_rsttz(BS_SUCCESS);
-	}
-	ts.tm_min= (int) strtol(token, &cp, 10);
-	if ((cp == token) || (*cp != '\0'))
-		 return mbbs_rsttz(BS_BADARG);
-	if ((ts.tm_min < 0) || (ts.tm_min > 59))
-		 return mbbs_rsttz(BS_BADARG);
-
-	if ((token= strtok((char *) 0, ":/- ")) == (char *) 0) {
-		if ((tmt= mktime(&ts)) == (time_t) -1)
-			return mbbs_rsttz(BS_FAILURE);
-		*dtm= (double) tmt;
-		return mbbs_rsttz(BS_SUCCESS);
-	}
-	seconds= strtod(token, &cp);
-	if ((cp == token) || (*cp != '\0'))
-		 return mbbs_rsttz(BS_BADARG);
-	if ((seconds < 0.) || (seconds >= 60.))
-		 return mbbs_rsttz(BS_BADARG);
-	ts.tm_sec= (int) seconds;
-	fraction= seconds-((double) ts.tm_sec);
-
-	if ((tmt= mktime(&ts)) == (time_t) -1)
-		return mbbs_rsttz(BS_FAILURE);
-	*dtm= ((double) tmt)+fraction;
-
-	return mbbs_rsttz(BS_SUCCESS);
-}
-
-int
-mbbs_setgmttz()
-/*
-   Set the timezone to GMT if necessary so that
-   SYSV mktime() will work properly. A call to this
-   function should always be followed by a call to
-   mbbs_rsttz() to undo its effect, if any.
-*/
-{
-	char *tz;
-
-	if (tm_callertz == TM_TZ_GMT)
-		return BS_SUCCESS;
-
-	tm_rsttzval= tm_clrtzval= 0;
-	if (((tz= getenv("TZ")) != (char *) 0) && (strlen(tz) > 0)) {
-		if (strcmp(tz, "GMT")) {
-			if ((tm_oldtzval= (char *) calloc((size_t) (strlen("TZ=")+strlen(tz)+1), sizeof(char))) == (char *) 0)
-				return BS_MEMALLOC;
-			(void) strcpy(tm_oldtzval, "TZ=");
-			(void) strcat(tm_oldtzval, tz);
-			if ((tm_newtzval= (char *) calloc((size_t) (strlen("TZ=GMT")+1), sizeof(char))) == (char *) 0) {
-				free((void *) tm_oldtzval);
-				return BS_MEMALLOC;
-			}
-			(void) strcpy(tm_newtzval, "TZ=GMT");
-			if (putenv(tm_newtzval) != 0) {
-				free((void *) tm_oldtzval);
-				free((void *) tm_newtzval);
-				return BS_FAILURE;
-			}
-			tm_rsttzval= 1;
-		}
-	}
-	else {
-		if ((tm_newtzval= (char *) calloc((size_t) (strlen("TZ=GMT")+1), sizeof(char))) == (char *) 0)
-			return BS_MEMALLOC;
-		(void) strcpy(tm_newtzval, "TZ=GMT");
-		if (putenv(tm_newtzval) != 0) {
-			free((void *) tm_newtzval);
-			return BS_FAILURE;
-		}
-		tm_clrtzval= 1;
-	}
-
-	return BS_SUCCESS;
-}
-
-int
-mbbs_rsttz(int code)
-/*
-   Attempt to restore the original timezone that was replaced
-   by a preceding mbbs_setgmttz() call. If there was no original
-   timezone, just zero the value. This function is always called
-   from within a return statement, so always return the code
-   passed in as an argument regardless of whether the environment
-   is successfully restored to its original state.
-*/
-{
-	if (tm_callertz == TM_TZ_GMT)
-		return code;
-	if (tm_rsttzval)
-		(void) putenv(tm_oldtzval);
-	else if (tm_clrtzval) {
-		if ((tm_newtzval= (char *) calloc((size_t) (strlen("TZ=")+1), sizeof(char))) == (char *) 0)
-			return code;
-		(void) strcpy(tm_newtzval, "TZ=");
-		(void) putenv(tm_newtzval);
-	}
-
-	return code;
-}
-
-void
-mbbs_jul2cal(struct tm *ts)
-/*
-   Derive Unix calendar month (0-11) and day (1-31)
-   from Unix year (real year minus 1900) and julian day (0-365).
-*/
-{
-	int mdays, leap;
-	int mbbs_leapyr(struct tm *);
-
-	leap= mbbs_leapyr(ts);
-	ts->tm_mday= ts->tm_yday+1;
-	for (ts->tm_mon= 0; ts->tm_mon < 12; ts->tm_mon++) {
-		mdays= tm_monthdays[ts->tm_mon];
-		if (leap && (ts->tm_mon == 1))
-			mdays++;
-		if (ts->tm_mday <= mdays)
-			return;
-		ts->tm_mday-= mdays;
-	}
-
-	return;
-}
-
-void
-mbbs_cal2jul(struct tm *ts)
-/*
-   Derive Unix julian day (0-365) from Unix year (real year
-   minus 1900), calendar month (0-11) and day (1-31).
-*/
-{
-	int leap, month, mdays;
-	int mbbs_leapyr(struct tm *);
-
-	leap= mbbs_leapyr(ts);
-	ts->tm_yday= 0;
-	for (month= 0; month < ts->tm_mon; month++){
-		mdays= tm_monthdays[month];
-		if (leap && (month == 1))
-			mdays++;
-		ts->tm_yday+= mdays;
-	}
-	ts->tm_yday+= ts->tm_mday-1;
-
-	return;
-}
-
-int
-mbbs_leapyr(struct tm *ts)
-/*
-   Returns 1 if leap year, 0 otherwise.
-*/
-{
-	int year;
-
-	year= ts->tm_year+1900;
-
-	return ((year%4 == 0) && ((year%100 != 0) || (year%400 == 0)));
-}
diff --git a/src/bsio/mbbs_utils.c b/src/bsio/mbbs_utils.c
deleted file mode 100644
index c36ce8b..0000000
--- a/src/bsio/mbbs_utils.c
+++ /dev/null
@@ -1,268 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbbs_utils.c	3/3/2014
- *	$Id: mbbs_utils.c 2239 2015-05-07 00:51:42Z caress $
- *
- *    Copyright (c) 2014-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/* This source code is part of the mbbsio library used to read and write
- * swath sonar data in the bsio format devised and used by the
- * Hawaii Mapping Research Group of the University of Hawaii.
- * This source code was made available by Roger Davis of the
- * University of Hawaii under the GPL. Minor modifications have
- * been made to the version distributed here as part of MB-System.
- *
- * Author:	Roger Davis (primary author)
- * Author:	D. W. Caress (MB-System revisions)
- * Date:	March 3, 2014 (MB-System revisions)
- *
- *--------------------------------------------------------------------*/
-/*
- *	Copyright (c) 2010 by University of Hawaii.
- */
-
-/*
-   utils.c --
-   Higher-level utilities for Hawaii Mapping Research Group BS files.
-*/
-
-#include <stdio.h>
-#include <string.h>
-#include <math.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <fcntl.h>
-
-#include "mbbs_defines.h"
-
-/* Ugly patch because Windows has no fchdir() function */ 
-#ifdef WIN32
-#define fchdir(lixo) chdir(".")
-#	ifndef F_OK
-#		define F_OK 00
-	#endif
-#endif
-
-extern int	mbbs_appendstr(char **, char *);
-extern int	mbbs_copypng(int, XDR *, XDR *, int);
-extern int	mbbs_freebsfmem(BSFile *);
-extern int	mbbs_rdbsfhdr(BSFile *, XDR *);
-extern int	mbbs_wrbsfhdr(BSFile *, XDR *);
-
-int
-mbbs_splitfile(char *dirnm, char *bsfnm0, char *bsfnm1, int pngid, char *logprefix)
-{
-	int chngdir, origdirfd, err;
-	char tmpfilenm[80], prefix[80], newlogtail[120];
-	char *lp, *tailstr;
-	FILE *ifp, *ofp;
-	XDR xdri, xdro;
-	BSFile bsfi, bsfo;
-
-	if (sizeof(int) < 4)
-		return BS_BADARCH;
-
-	if ((bsfnm0 == (char *) 0) ||
-	    ((int) strlen(bsfnm0) == 0) ||
-	    (bsfnm1 == (char *) 0) ||
-	    ((int) strlen(bsfnm1) == 0) ||
-	    (pngid < 0))
-		return BS_BADARG;
-
-	if ((dirnm == (char *) 0) ||
-	    ((int) strlen(dirnm) == 0))
-		chngdir= 0;
-	else
-		chngdir= 1;
-
-	if (chngdir) {
-		if ((origdirfd= open(".", O_RDONLY)) < 0)
-			return BS_OPEN;
-		if (chdir(dirnm) < 0) {
-			(void) close(origdirfd);
-			return BS_CHDIR;
-		}
-	}
-
-	/* rename original file to temporary name */
-	(void) strcpy(tmpfilenm, "BSLIBsplittmp");
-	if (access(tmpfilenm, F_OK) == 0) {
-		if (chngdir) {
-			(void) fchdir(origdirfd);
-			(void) close(origdirfd);
-		}
-		return BS_ACCESS;
-	}
-	if (rename(bsfnm0, tmpfilenm) < 0) {
-		if (chngdir) {
-			(void) fchdir(origdirfd);
-			(void) close(origdirfd);
-		}
-		return BS_RENAME;
-	}
-
-	if ((ifp= fopen(tmpfilenm, "r")) == (FILE *) 0) {
-		(void) rename(tmpfilenm, bsfnm0);
-		if (chngdir) {
-			(void) fchdir(origdirfd);
-			(void) close(origdirfd);
-		}
-		return BS_OPEN;
-	}
-	xdrstdio_create(&xdri, ifp, XDR_DECODE);
-	if ((err= mbbs_rdbsfhdr(&bsfi, &xdri)) != BS_SUCCESS) {
-		(void) fclose(ifp);
-		(void) rename(tmpfilenm, bsfnm0);
-		if (chngdir) {
-			(void) fchdir(origdirfd);
-			(void) close(origdirfd);
-		}
-		return err;
-	}
-	if (pngid >= bsfi.bsf_count) {
-		(void) mbbs_freebsfmem(&bsfi);
-		(void) fclose(ifp);
-		(void) rename(tmpfilenm, bsfnm0);
-		if (chngdir) {
-			(void) fchdir(origdirfd);
-			(void) close(origdirfd);
-		}
-		return BS_BADARG;
-	}
-	MemCopy(&bsfi, &bsfo, sizeof(BSFile));
-
-	/* these strings now belong to the output header! */
-	bsfi.bsf_srcfilenm= (char *) 0;
-	bsfi.bsf_log= (char *) 0;
-
-	if ((logprefix == (char *) 0) ||
-	    ((int) strlen(logprefix) == 0)) {
-		(void) sprintf(prefix, "BSLIB::bs_split()");
-		lp= prefix;
-	}
-	else if ((int) strlen(logprefix) > 50) {
-		(void) strncpy(prefix, logprefix, 47);
-		prefix[47]= '\0';
-		(void) strcat(prefix, "...");
-		lp= prefix;
-	}
-	else
-		lp= logprefix;
-	if ((int) strlen(bsfo.bsf_log) > 0)
-		(void) sprintf(newlogtail, "\n%s [ BreakFile @ Ping%1d HEAD ] ;", lp, pngid);
-	else
-		(void) sprintf(newlogtail, "%s [ BreakFile @ Ping%1d HEAD ] ;", lp, pngid);
-	if ((err= mbbs_appendstr(&(bsfo.bsf_log), newlogtail)) != BS_SUCCESS) {
-		(void) mbbs_freebsfmem(&bsfo);
-		(void) fclose(ifp);
-		(void) rename(tmpfilenm, bsfnm0);
-		if (chngdir) {
-			(void) fchdir(origdirfd);
-			(void) close(origdirfd);
-		}
-		return err;
-	}
-
-	/* eventually we will replace the "HEAD ] ;" substring just
-	   appended to the log with "TAIL ] ;", so locate it now */
-	tailstr= bsfo.bsf_log;
-	tailstr+= (int) strlen(bsfo.bsf_log);
-	for ( ; *tailstr != 'H'; tailstr--);
-
-	/* copy first part of original file */
-	if ((ofp= fopen(bsfnm0, "w")) == (FILE *) 0) {
-		(void) mbbs_freebsfmem(&bsfo);
-		(void) fclose(ifp);
-		(void) rename(tmpfilenm, bsfnm0);
-		if (chngdir) {
-			(void) fchdir(origdirfd);
-			(void) close(origdirfd);
-		}
-		return BS_OPEN;
-	}
-	xdrstdio_create(&xdro, ofp, XDR_ENCODE);
-	bsfo.bsf_count= pngid;
-	if ((err= mbbs_wrbsfhdr(&bsfo, &xdro)) != BS_SUCCESS) {
-		(void) fclose(ofp);
-		(void) mbbs_freebsfmem(&bsfo);
-		(void) fclose(ifp);
-		(void) rename(tmpfilenm, bsfnm0);
-		if (chngdir) {
-			(void) fchdir(origdirfd);
-			(void) close(origdirfd);
-		}
-		return err;
-	}
-	if ((err= mbbs_copypng(bsfo.bsf_count, &xdri, &xdro, bsfi.bsf_version)) != BS_SUCCESS) {
-		(void) fclose(ofp);
-		(void) mbbs_freebsfmem(&bsfo);
-		(void) fclose(ifp);
-		(void) rename(tmpfilenm, bsfnm0);
-		if (chngdir) {
-			(void) fchdir(origdirfd);
-			(void) close(origdirfd);
-		}
-		return err;
-	}
-	xdr_destroy(&xdro);
-	(void) fclose(ofp);
-
-	/* copy second part of original file */
-	if ((ofp= fopen(bsfnm1, "w")) == (FILE *) 0) {
-		(void) mbbs_freebsfmem(&bsfo);
-		(void) fclose(ifp);
-		(void) rename(tmpfilenm, bsfnm0);
-		if (chngdir) {
-			(void) fchdir(origdirfd);
-			(void) close(origdirfd);
-		}
-		return BS_OPEN;
-	}
-	xdrstdio_create(&xdro, ofp, XDR_ENCODE);
-	bsfo.bsf_count= bsfi.bsf_count-pngid;
-	(void) strcpy(tailstr, "TAIL ] ;");
-	if ((err= mbbs_wrbsfhdr(&bsfo, &xdro)) != BS_SUCCESS) {
-		(void) fclose(ofp);
-		(void) mbbs_freebsfmem(&bsfo);
-		(void) fclose(ifp);
-		(void) rename(tmpfilenm, bsfnm0);
-		if (chngdir) {
-			(void) fchdir(origdirfd);
-			(void) close(origdirfd);
-		}
-		return err;
-	}
-	if ((err= mbbs_copypng(bsfo.bsf_count, &xdri, &xdro, bsfi.bsf_version)) != BS_SUCCESS) {
-		(void) fclose(ofp);
-		(void) mbbs_freebsfmem(&bsfo);
-		(void) fclose(ifp);
-		(void) rename(tmpfilenm, bsfnm0);
-		if (chngdir) {
-			(void) fchdir(origdirfd);
-			(void) close(origdirfd);
-		}
-		return err;
-	}
-	xdr_destroy(&xdro);
-	(void) fclose(ofp);
-
-	(void) mbbs_freebsfmem(&bsfo);
-	(void) fclose(ifp);
-	(void) unlink(tmpfilenm);
-	if (chngdir) {
-		if (fchdir(origdirfd) != 0) {
-			(void) close(origdirfd);
-			return BS_CHDIR;
-		}
-		(void) close(origdirfd);
-	}
-
-	return BS_SUCCESS;
-}
diff --git a/src/bsio/mbbs_wrhdrfields.c b/src/bsio/mbbs_wrhdrfields.c
deleted file mode 100644
index 5f9d05f..0000000
--- a/src/bsio/mbbs_wrhdrfields.c
+++ /dev/null
@@ -1,421 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbbs_wrhdrfields.c	3/3/2014
- *	$Id: mbbs_wrhdrfields.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 2014-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/* This source code is part of the mbbsio library used to read and write
- * swath sonar data in the bsio format devised and used by the
- * Hawaii Mapping Research Group of the University of Hawaii.
- * This source code was made available by Roger Davis of the
- * University of Hawaii under the GPL. Minor modifications have
- * been made to the version distributed here as part of MB-System.
- *
- * Author:	Roger Davis (primary author)
- * Author:	D. W. Caress (MB-System revisions)
- * Date:	March 3, 2014 (MB-System revisions)
- *
- *--------------------------------------------------------------------*/
-/*
- *	Copyright (c) 2006 by University of Hawaii.
- */
-
-/*
-   wrhdrfields.c --
-   Routines to rewrite individual file and/or ping header
-   fields of Hawaii Mapping Research Group BS files.
-*/
-
-#include <stdio.h>
-
-#include "mbbs_defines.h"
-
-extern unsigned long bs_iobytecnt;
-
-int
-mbbs_wrfflagssetbits(FILE *fp, unsigned int bitmask)
-/*
-   Set the bits from bitmask in the file header flags field.
-*/
-{
-	XDR xdr;
-	int version, count;
-	unsigned int flags;
-
-	if (fseek(fp, (long) 0, SEEK_SET) != 0)
-		return BS_FSEEK;
-	xdrstdio_create(&xdr, fp, XDR_DECODE);
-
-	bs_iobytecnt= 0;
-	if (!xdr_int(&xdr, &version))
-		return BS_READ;
-	switch (version) {
-	case MR1_VERSION_1_0:
-	case MR1_VERSION_2_0:
-	case BS_VERSION_1_0:
-	case BS_VERSION_1_1:
-	case BS_VERSION_1_2:
-		return BS_BADDATA;
-	default:
-		break;
-	}
-	bs_iobytecnt+= 4;
-	if (!xdr_int(&xdr, &count))
-		return BS_READ;
-	bs_iobytecnt+= 4;
-	if (!xdr_u_int(&xdr, &flags))
-		return BS_READ;
-	bs_iobytecnt+= 4;
-
-	xdr_destroy(&xdr);
-
-	flags|= bitmask;
-
-	if (fseek(fp, (long) -4, SEEK_CUR) != 0)
-		return BS_FSEEK;
-	bs_iobytecnt-= 4;
-	xdrstdio_create(&xdr, fp, XDR_ENCODE);
-	if (!xdr_u_int(&xdr, &flags))
-		return BS_WRITE;
-	bs_iobytecnt+= 4;
-	xdr_destroy(&xdr);
-	(void) fflush(fp);
-
-	return BS_SUCCESS;
-}
-
-int
-mbbs_wrfflagsclrbits(FILE *fp, unsigned int bitmask)
-/*
-   Clear the bits of bitmask from the file header flags field.
-*/
-{
-	XDR xdr;
-	int version, count;
-	unsigned int flags;
-
-	if (fseek(fp, (long) 0, SEEK_SET) != 0)
-		return BS_FSEEK;
-	xdrstdio_create(&xdr, fp, XDR_DECODE);
-
-	bs_iobytecnt= 0;
-	if (!xdr_int(&xdr, &version))
-		return BS_READ;
-	switch (version) {
-	case MR1_VERSION_1_0:
-	case MR1_VERSION_2_0:
-	case BS_VERSION_1_0:
-	case BS_VERSION_1_1:
-	case BS_VERSION_1_2:
-		return BS_BADDATA;
-	default:
-		break;
-	}
-	bs_iobytecnt+= 4;
-	if (!xdr_int(&xdr, &count))
-		return BS_READ;
-	bs_iobytecnt+= 4;
-	if (!xdr_u_int(&xdr, &flags))
-		return BS_READ;
-	bs_iobytecnt+= 4;
-
-	xdr_destroy(&xdr);
-
-	flags&= ~bitmask;
-
-	if (fseek(fp, (long) -4, SEEK_CUR) != 0)
-		return BS_FSEEK;
-	bs_iobytecnt-= 4;
-	xdrstdio_create(&xdr, fp, XDR_ENCODE);
-	if (!xdr_u_int(&xdr, &flags))
-		return BS_WRITE;
-	bs_iobytecnt+= 4;
-	xdr_destroy(&xdr);
-	(void) fflush(fp);
-
-	return BS_SUCCESS;
-}
-
-int
-mbbs_wrpflags(int version, FILE *fp, long phoffset, unsigned int flags)
-/*
-   Writes the ping flags field of a ping header
-   located at an arbitrary file byte offset.
-*/
-{
-	XDR xdr;
-
-	bs_iobytecnt= 0;
-
-	switch (version) {
-	case MR1_VERSION_1_0:
-	case MR1_VERSION_2_0:
-		return BS_BADDATA;
-	case BS_VERSION_1_0:
-	case BS_VERSION_1_1:
-	case BS_VERSION_1_2:
-	case BS_VERSION_1_3:
-	case BS_VERSION_1_4:
-		break;
-	default:
-		return BS_BADDATA;
-	}
-
-	if (fseek(fp, phoffset, SEEK_SET) != 0)
-		return BS_FSEEK;
-	xdrstdio_create(&xdr, fp, XDR_ENCODE);
-	if (!xdr_u_int(&xdr, &flags))
-		return BS_WRITE;
-	bs_iobytecnt+= 4;
-	xdr_destroy(&xdr);
-	(void) fflush(fp);
-
-	return BS_SUCCESS;
-}
-
-int
-mbbs_wrpflagssetbits(int version, FILE *fp, long phoffset, unsigned int bitmask)
-/*
-   Set the bits from bitmask in the ping flags field of
-   a ping header located at an arbitrary file byte offset.
-*/
-{
-	XDR xdr;
-	unsigned int flags;
-
-	bs_iobytecnt= 0;
-
-	switch (version) {
-	case MR1_VERSION_1_0:
-	case MR1_VERSION_2_0:
-		return BS_BADDATA;
-	case BS_VERSION_1_0:
-	case BS_VERSION_1_1:
-	case BS_VERSION_1_2:
-	case BS_VERSION_1_3:
-	case BS_VERSION_1_4:
-		break;
-	default:
-		return BS_BADDATA;
-	}
-
-	if (fseek(fp, phoffset, SEEK_SET) != 0)
-		return BS_FSEEK;
-	xdrstdio_create(&xdr, fp, XDR_DECODE);
-	if (!xdr_u_int(&xdr, &flags))
-		return BS_READ;
-	bs_iobytecnt+= 4;
-	xdr_destroy(&xdr);
-
-	flags|= bitmask;
-
-	if (fseek(fp, phoffset, SEEK_SET) != 0)
-		return BS_FSEEK;
-	bs_iobytecnt-= 4;
-	xdrstdio_create(&xdr, fp, XDR_ENCODE);
-	if (!xdr_u_int(&xdr, &flags))
-		return BS_WRITE;
-	bs_iobytecnt+= 4;
-	xdr_destroy(&xdr);
-	(void) fflush(fp);
-
-	return BS_SUCCESS;
-}
-
-int
-mbbs_wrpflagsclrbits(int version, FILE *fp, long phoffset, unsigned int bitmask)
-/*
-   Clear the bits in bitmask from the ping flags field of
-   a ping header located at an arbitrary file byte offset.
-*/
-{
-	XDR xdr;
-	unsigned int flags;
-
-	bs_iobytecnt= 0;
-
-	switch (version) {
-	case MR1_VERSION_1_0:
-	case MR1_VERSION_2_0:
-		return BS_BADDATA;
-	case BS_VERSION_1_0:
-	case BS_VERSION_1_1:
-	case BS_VERSION_1_2:
-	case BS_VERSION_1_3:
-	case BS_VERSION_1_4:
-		break;
-	default:
-		return BS_BADDATA;
-	}
-
-	if (fseek(fp, phoffset, SEEK_SET) != 0)
-		return BS_FSEEK;
-	xdrstdio_create(&xdr, fp, XDR_DECODE);
-	if (!xdr_u_int(&xdr, &flags))
-		return BS_READ;
-	bs_iobytecnt+= 4;
-	xdr_destroy(&xdr);
-
-	flags&= ~bitmask;
-
-	if (fseek(fp, phoffset, SEEK_SET) != 0)
-		return BS_FSEEK;
-	bs_iobytecnt-= 4;
-	xdrstdio_create(&xdr, fp, XDR_ENCODE);
-	if (!xdr_u_int(&xdr, &flags))
-		return BS_WRITE;
-	bs_iobytecnt+= 4;
-	xdr_destroy(&xdr);
-	(void) fflush(fp);
-
-	return BS_SUCCESS;
-}
-
-int
-mbbs_wrsllc(int version, FILE *fp, long phoffset, double slon, double slat, float scourse)
-/*
-   Writes ship longitude, latitude and course fields
-   of a ping header located at an arbitrary file byte offset.
-*/
-{
-	XDR xdr;
-
-	bs_iobytecnt= 0;
-
-	switch (version) {
-	case MR1_VERSION_1_0:
-		return BS_BADDATA;
-	case MR1_VERSION_2_0:
-		phoffset+= 12;
-		break;
-	case BS_VERSION_1_0:
-	case BS_VERSION_1_1:
-	case BS_VERSION_1_2:
-	case BS_VERSION_1_3:
-	case BS_VERSION_1_4:
-		phoffset+= 16;
-		break;
-	default:
-		return BS_BADDATA;
-	}
-
-	if (fseek(fp, phoffset, SEEK_SET) != 0)
-		return BS_FSEEK;
-	xdrstdio_create(&xdr, fp, XDR_ENCODE);
-
-	if (!xdr_double(&xdr, &slon))
-		return BS_WRITE;
-	bs_iobytecnt+= 8;
-	if (!xdr_double(&xdr, &slat))
-		return BS_WRITE;
-	bs_iobytecnt+= 8;
-	if (!xdr_float(&xdr, &scourse))
-		return BS_WRITE;
-	bs_iobytecnt+= 4;
-
-	xdr_destroy(&xdr);
-	(void) fflush(fp);
-
-	return BS_SUCCESS;
-}
-
-int
-mbbs_wrtllc(int version, FILE *fp, long phoffset, double tlon, double tlat, float tcourse)
-/*
-   Writes towfish longitude, latitude and course fields
-   of a ping header located at an arbitrary file byte offset.
-*/
-{
-	XDR xdr;
-
-	bs_iobytecnt= 0;
-
-	switch (version) {
-	case MR1_VERSION_1_0:
-		return BS_BADDATA;
-	case MR1_VERSION_2_0:
-		phoffset+= 40;
-		break;
-	case BS_VERSION_1_0:
-	case BS_VERSION_1_1:
-	case BS_VERSION_1_2:
-	case BS_VERSION_1_3:
-	case BS_VERSION_1_4:
-		phoffset+= 44;
-		break;
-	default:
-		return BS_BADDATA;
-	}
-
-	if (fseek(fp, phoffset, SEEK_SET) != 0)
-		return BS_FSEEK;
-	xdrstdio_create(&xdr, fp, XDR_ENCODE);
-
-	if (!xdr_double(&xdr, &tlon))
-		return BS_WRITE;
-	bs_iobytecnt+= 8;
-	if (!xdr_double(&xdr, &tlat))
-		return BS_WRITE;
-	bs_iobytecnt+= 8;
-	if (!xdr_float(&xdr, &tcourse))
-		return BS_WRITE;
-	bs_iobytecnt+= 4;
-
-	xdr_destroy(&xdr);
-	(void) fflush(fp);
-
-	return BS_SUCCESS;
-}
-
-int
-mbbs_wrtll(int version, FILE *fp, long phoffset, double tlon, double tlat)
-/*
-   Writes towfish longitude and latitude fields of a
-   ping header located at an arbitrary file byte offset.
-*/
-{
-	XDR xdr;
-
-	bs_iobytecnt= 0;
-
-	switch (version) {
-	case MR1_VERSION_1_0:
-		return BS_BADDATA;
-	case MR1_VERSION_2_0:
-		phoffset+= 40;
-		break;
-	case BS_VERSION_1_0:
-	case BS_VERSION_1_1:
-	case BS_VERSION_1_2:
-	case BS_VERSION_1_3:
-	case BS_VERSION_1_4:
-		phoffset+= 44;
-		break;
-	default:
-		return BS_BADDATA;
-	}
-
-	if (fseek(fp, phoffset, SEEK_SET) != 0)
-		return BS_FSEEK;
-	xdrstdio_create(&xdr, fp, XDR_ENCODE);
-
-	if (!xdr_double(&xdr, &tlon))
-		return BS_WRITE;
-	bs_iobytecnt+= 8;
-	if (!xdr_double(&xdr, &tlat))
-		return BS_WRITE;
-	bs_iobytecnt+= 8;
-
-	xdr_destroy(&xdr);
-	(void) fflush(fp);
-
-	return BS_SUCCESS;
-}
diff --git a/src/bsio/mbbs_wrsampflags.c b/src/bsio/mbbs_wrsampflags.c
deleted file mode 100644
index cb5228b..0000000
--- a/src/bsio/mbbs_wrsampflags.c
+++ /dev/null
@@ -1,182 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbbs_wrsampflags.c	3/3/2014
- *	$Id: mbbs_wrsampflags.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 2014-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/* This source code is part of the mbbsio library used to read and write
- * swath sonar data in the bsio format devised and used by the
- * Hawaii Mapping Research Group of the University of Hawaii.
- * This source code was made available by Roger Davis of the
- * University of Hawaii under the GPL. Minor modifications have
- * been made to the version distributed here as part of MB-System.
- *
- * Author:	Roger Davis (primary author)
- * Author:	D. W. Caress (MB-System revisions)
- * Date:	March 3, 2014 (MB-System revisions)
- *
- *--------------------------------------------------------------------*/
-/*
- *	Copyright (c) 2011 by University of Hawaii.
- */
-
-/*
-   wrsampflags.c --
-   Routines to rewrite ping sample flags within
-   Hawaii Mapping Research Group BS files.
-*/
-
-#include <stdio.h>
-
-#include "mbbs_defines.h"
-
-extern int	mbbs_getpngdataptrs(Ping *, MemType *, PingData *);
-extern int	mbbs_pngrealloc(Ping *, MemType **, unsigned int *);
-extern int	mbbs_rdpngdata(Ping *, MemType *, XDR *);
-extern int	mbbs_wrpngdata(Ping *, MemType *, XDR *);
-extern int	mbbs_xdrpnghdr(Ping *, XDR *, int);
-
-extern unsigned long bs_iobytecnt;
-
-static MemType *bswsf_databuf= (MemType *) 0;
-static unsigned int bswsf_databufsz= 0;
-
-int
-mbbs_setswradius(int version, FILE *fp, long phoffset, int side, unsigned int dtmask, float swradius)
-/*
-   Flags all samples of the specified datatype on the named side at
-   across-track distances greater than swradius with {BTYD,SSD}_SWEDGE for
-   the ping whose header is located at an arbitrary file byte offset.
-*/
-{
-	Ping png;
-	PingData pngdata;
-	XDR xdr;
-	int err, i, trimbty, trimss;
-	int bsi, nbtyvals, nssvals, ssstart;
-	long pdoffset;
-	float *bty;
-	float sscutoff;
-	unsigned int *btyflags;
-	unsigned char *ssflags;
-	unsigned long datasz;
-
-	switch (version) {
-	case MR1_VERSION_1_0:
-	case MR1_VERSION_2_0:
-		return BS_BADDATA;
-	case BS_VERSION_1_0:
-	case BS_VERSION_1_1:
-	case BS_VERSION_1_2:
-	case BS_VERSION_1_3:
-	case BS_VERSION_1_4:
-		break;
-	default:
-		return BS_BADDATA;
-	}
-
-	if (fp == (FILE *) 0)
-		return BS_BADARG;
-
-	switch (side) {
-	case ACP_PORT:
-	case ACP_STBD:
-		break;
-	default:
-		return BS_BADARG;
-	}
-
-	if (!(dtmask & BS_DTM_BATHYMETRY) &&
-	    !(dtmask & BS_DTM_SIDESCAN))
-		return BS_BADARG;
-
-	if (swradius < 0.)
-		return BS_BADARG;
-
-	if (fseek(fp, phoffset, SEEK_SET) != 0)
-		return BS_FSEEK;
-	xdrstdio_create(&xdr, fp, XDR_DECODE);
-
-	if (!mbbs_xdrpnghdr(&png, &xdr, version)) {
-		xdr_destroy(&xdr);
-		return BS_READ;
-	}
-	trimbty= trimss= 0;
-	if (dtmask & BS_DTM_BATHYMETRY) {
-		if ((nbtyvals= png.png_sides[side].ps_btycount) > 0)
-			trimbty= 1;
-	}
-	if (dtmask & BS_DTM_SIDESCAN) {
-		if ((sscutoff= swradius-png.png_sides[side].ps_ssxoffset) < 0.)
-			sscutoff= 0.;
-		ssstart= sscutoff/png.png_ssincr;
-		if ((nssvals= png.png_sides[side].ps_sscount) > ssstart)
-			trimss= 1;
-	}
-	if (!trimbty && !trimss) {
-		xdr_destroy(&xdr);
-		return BS_SUCCESS;
-	}
-
-	/* remember current file offset at end of ping header */
-	pdoffset= phoffset+bs_iobytecnt;
-
-	if ((err= mbbs_pngrealloc(&png, &bswsf_databuf, &bswsf_databufsz)) != BS_SUCCESS) {
-		xdr_destroy(&xdr);
-		return err;
-	}
-	if ((err= mbbs_rdpngdata(&png, bswsf_databuf, &xdr)) != BS_SUCCESS) {
-		xdr_destroy(&xdr);
-		return err;
-	}
-	datasz= bs_iobytecnt;
-	xdr_destroy(&xdr);
-
-	if ((err= mbbs_getpngdataptrs(&png, bswsf_databuf, &pngdata)) != BS_SUCCESS)
-		return err;
-
-	/* set {BTYD,SSD}_SWEDGE on all desired samples */
-	if (dtmask & BS_DTM_BATHYMETRY) {
-		if (png.png_flags & PNG_XYZ)
-			bsi= 3;
-		else
-			bsi= 2;
-		if ((bty= pngdata.pd_bty[side]) == (float *) 0)
-			return BS_BADDATA;
-		if ((btyflags= pngdata.pd_btyflags[side]) == (unsigned int *) 0)
-			return BS_BADDATA;
-		for (i= 0; i < nbtyvals; i++) {
-			if (bty[bsi*i] > swradius)
-				btyflags[i]|= BTYD_SWEDGE;
-		}
-	}
-	if (dtmask & BS_DTM_SIDESCAN) {
-		if ((ssflags= pngdata.pd_ssflags[side]) == (unsigned char *) 0)
-			return BS_BADDATA;
-		for (i= ssstart; i < nssvals; i++)
-			ssflags[i]|= SSD_SWEDGE;
-	}
-
-	/* seek to beginning of ping data region and rewrite it */
-	if (fseek(fp, pdoffset, SEEK_SET) != 0)
-		return BS_FSEEK;
-	xdrstdio_create(&xdr, fp, XDR_ENCODE);
-	if ((err= mbbs_wrpngdata(&png, bswsf_databuf, &xdr)) != BS_SUCCESS) {
-		xdr_destroy(&xdr);
-		return err;
-	}
-
-	bs_iobytecnt= datasz;
-	xdr_destroy(&xdr);
-	(void) fflush(fp);
-
-	return BS_SUCCESS;
-}
diff --git a/src/gmt/Makefile.am b/src/gmt/Makefile.am
deleted file mode 100644
index 16bddd2..0000000
--- a/src/gmt/Makefile.am
+++ /dev/null
@@ -1,15 +0,0 @@
-lib_LTLIBRARIES = libmbgmt.la
-
-include_HEADERS = 
-
-AM_CPPFLAGS = -I${top_srcdir}/src/mbio \
-	      -I${top_srcdir}/src/mbaux \
-	      ${libgmt_CPPFLAGS} \
-	      ${libnetcdf_CPPFLAGS}
-AM_CFLAGS = ${libgmt_CFLAGS} ${libnetcdf_CFLAGS}
-
-libmbgmt_la_LDFLAGS = -no-undefined -version-info 0:0:0
-libmbgmt_la_SOURCES = mbswath.c mbcontour.c mbgrdtiff.c
-libmbgmt_la_LIBADD = ${top_builddir}/src/mbio/libmbio.la \
-			${top_builddir}/src/mbaux/libmbaux.la \
-			${libgmt_LIBS} ${libnetcdf_LIBS}
diff --git a/src/gmt/Makefile.in b/src/gmt/Makefile.in
deleted file mode 100644
index adbf396..0000000
--- a/src/gmt/Makefile.in
+++ /dev/null
@@ -1,709 +0,0 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
-
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-
-
-VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
-am__make_running_with_option = \
-  case $${target_option-} in \
-      ?) ;; \
-      *) echo "am__make_running_with_option: internal error: invalid" \
-              "target option '$${target_option-}' specified" >&2; \
-         exit 1;; \
-  esac; \
-  has_opt=no; \
-  sane_makeflags=$$MAKEFLAGS; \
-  if $(am__is_gnu_make); then \
-    sane_makeflags=$$MFLAGS; \
-  else \
-    case $$MAKEFLAGS in \
-      *\\[\ \	]*) \
-        bs=\\; \
-        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
-          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
-    esac; \
-  fi; \
-  skip_next=no; \
-  strip_trailopt () \
-  { \
-    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
-  }; \
-  for flg in $$sane_makeflags; do \
-    test $$skip_next = yes && { skip_next=no; continue; }; \
-    case $$flg in \
-      *=*|--*) continue;; \
-        -*I) strip_trailopt 'I'; skip_next=yes;; \
-      -*I?*) strip_trailopt 'I';; \
-        -*O) strip_trailopt 'O'; skip_next=yes;; \
-      -*O?*) strip_trailopt 'O';; \
-        -*l) strip_trailopt 'l'; skip_next=yes;; \
-      -*l?*) strip_trailopt 'l';; \
-      -[dEDm]) skip_next=yes;; \
-      -[JT]) skip_next=yes;; \
-    esac; \
-    case $$flg in \
-      *$$target_option*) has_opt=yes; break;; \
-    esac; \
-  done; \
-  test $$has_opt = yes
-am__make_dryrun = (target_option=n; $(am__make_running_with_option))
-am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-subdir = src/gmt
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/depcomp $(include_HEADERS)
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
-	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
-	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
-	$(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-	$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/src/mbio/mb_config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
-am__vpath_adj = case $$p in \
-    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
-    *) f=$$p;; \
-  esac;
-am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
-am__install_max = 40
-am__nobase_strip_setup = \
-  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
-am__nobase_strip = \
-  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
-am__nobase_list = $(am__nobase_strip_setup); \
-  for p in $$list; do echo "$$p $$p"; done | \
-  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
-  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
-    if (++n[$$2] == $(am__install_max)) \
-      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
-    END { for (dir in files) print dir, files[dir] }'
-am__base_list = \
-  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
-  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
-am__uninstall_files_from_dir = { \
-  test -z "$$files" \
-    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
-    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
-         $(am__cd) "$$dir" && rm -f $$files; }; \
-  }
-am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includedir)"
-LTLIBRARIES = $(lib_LTLIBRARIES)
-am__DEPENDENCIES_1 =
-libmbgmt_la_DEPENDENCIES = ${top_builddir}/src/mbio/libmbio.la \
-	${top_builddir}/src/mbaux/libmbaux.la $(am__DEPENDENCIES_1) \
-	$(am__DEPENDENCIES_1)
-am_libmbgmt_la_OBJECTS = mbswath.lo mbcontour.lo mbgrdtiff.lo
-libmbgmt_la_OBJECTS = $(am_libmbgmt_la_OBJECTS)
-AM_V_lt = $(am__v_lt_ at AM_V@)
-am__v_lt_ = $(am__v_lt_ at AM_DEFAULT_V@)
-am__v_lt_0 = --silent
-am__v_lt_1 = 
-libmbgmt_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
-	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
-	$(libmbgmt_la_LDFLAGS) $(LDFLAGS) -o $@
-AM_V_P = $(am__v_P_ at AM_V@)
-am__v_P_ = $(am__v_P_ at AM_DEFAULT_V@)
-am__v_P_0 = false
-am__v_P_1 = :
-AM_V_GEN = $(am__v_GEN_ at AM_V@)
-am__v_GEN_ = $(am__v_GEN_ at AM_DEFAULT_V@)
-am__v_GEN_0 = @echo "  GEN     " $@;
-am__v_GEN_1 = 
-AM_V_at = $(am__v_at_ at AM_V@)
-am__v_at_ = $(am__v_at_ at AM_DEFAULT_V@)
-am__v_at_0 = @
-am__v_at_1 = 
-DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)/src/mbio
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
-am__mv = mv -f
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
-	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
-	$(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
-	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
-	$(AM_CFLAGS) $(CFLAGS)
-AM_V_CC = $(am__v_CC_ at AM_V@)
-am__v_CC_ = $(am__v_CC_ at AM_DEFAULT_V@)
-am__v_CC_0 = @echo "  CC      " $@;
-am__v_CC_1 = 
-CCLD = $(CC)
-LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
-	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
-	$(AM_LDFLAGS) $(LDFLAGS) -o $@
-AM_V_CCLD = $(am__v_CCLD_ at AM_V@)
-am__v_CCLD_ = $(am__v_CCLD_ at AM_DEFAULT_V@)
-am__v_CCLD_0 = @echo "  CCLD    " $@;
-am__v_CCLD_1 = 
-SOURCES = $(libmbgmt_la_SOURCES)
-DIST_SOURCES = $(libmbgmt_la_SOURCES)
-am__can_run_installinfo = \
-  case $$AM_UPDATE_INFO_DIR in \
-    n|no|NO) false;; \
-    *) (install-info --version) >/dev/null 2>&1;; \
-  esac
-HEADERS = $(include_HEADERS)
-am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
-# Read a list of newline-separated strings from the standard input,
-# and print each of them once, without duplicates.  Input order is
-# *not* preserved.
-am__uniquify_input = $(AWK) '\
-  BEGIN { nonempty = 0; } \
-  { items[$$0] = 1; nonempty = 1; } \
-  END { if (nonempty) { for (i in items) print i; }; } \
-'
-# Make sure the list of sources is unique.  This is necessary because,
-# e.g., the same source file might be shared among _SOURCES variables
-# for different programs/libraries.
-am__define_uniq_tagged_files = \
-  list='$(am__tagged_files)'; \
-  unique=`for i in $$list; do \
-    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-  done | $(am__uniquify_input)`
-ETAGS = etags
-CTAGS = ctags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-CC = @CC@
-CCAS = @CCAS@
-CCASDEPMODE = @CCASDEPMODE@
-CCASFLAGS = @CCASFLAGS@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DLLTOOL = @DLLTOOL@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GREP = @GREP@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBM = @LIBM@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIBTOOL_DEPS = @LIBTOOL_DEPS@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LTLIBOBJS = @LTLIBOBJS@
-LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
-MAINT = @MAINT@
-MAKEINFO = @MAKEINFO@
-MANIFEST_TOOL = @MANIFEST_TOOL@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-OTPS_DIR = @OTPS_DIR@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_URL = @PACKAGE_URL@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PKG_CONFIG = @PKG_CONFIG@
-PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
-PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-VERSION = @VERSION@
-XDR_LIB = @XDR_LIB@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_AR = @ac_ct_AR@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-fftw_app = @fftw_app@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libGLU_CFLAGS = @libGLU_CFLAGS@
-libGLU_LIBS = @libGLU_LIBS@
-libXm_CFLAGS = @libXm_CFLAGS@
-libXm_LIBS = @libXm_LIBS@
-libdir = @libdir@
-libexecdir = @libexecdir@
-libfftw3_CFLAGS = @libfftw3_CFLAGS@
-libfftw3_LIBS = @libfftw3_LIBS@
-libfftw_CPPFLAGS = @libfftw_CPPFLAGS@
-libfftw_LIBS = @libfftw_LIBS@
-libgmt_CFLAGS = @libgmt_CFLAGS@
-libgmt_CPPFLAGS = @libgmt_CPPFLAGS@
-libgmt_LIBS = @libgmt_LIBS@
-libmotif_CPPFLAGS = @libmotif_CPPFLAGS@
-libmotif_LIBS = @libmotif_LIBS@
-libnetcdf_CFLAGS = @libnetcdf_CFLAGS@
-libnetcdf_CPPFLAGS = @libnetcdf_CPPFLAGS@
-libnetcdf_LIBS = @libnetcdf_LIBS@
-libopengl_CPPFLAGS = @libopengl_CPPFLAGS@
-libopengl_LIBS = @libopengl_LIBS@
-libproj_CFLAGS = @libproj_CFLAGS@
-libproj_CPPFLAGS = @libproj_CPPFLAGS@
-libproj_LIBS = @libproj_LIBS@
-libpsl_CFLAGS = @libpsl_CFLAGS@
-libpsl_LIBS = @libpsl_LIBS@
-localedir = @localedir@
-localstatedir = @localstatedir@
-mandir = @mandir@
-mbsystemdatadir = @mbsystemdatadir@
-mbsystemhtmldir = @mbsystemhtmldir@
-mbsystempsdir = @mbsystempsdir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-lib_LTLIBRARIES = libmbgmt.la
-include_HEADERS = 
-AM_CPPFLAGS = -I${top_srcdir}/src/mbio \
-	      -I${top_srcdir}/src/mbaux \
-	      ${libgmt_CPPFLAGS} \
-	      ${libnetcdf_CPPFLAGS}
-
-AM_CFLAGS = ${libgmt_CFLAGS} ${libnetcdf_CFLAGS}
-libmbgmt_la_LDFLAGS = -no-undefined -version-info 0:0:0
-libmbgmt_la_SOURCES = mbswath.c mbcontour.c mbgrdtiff.c
-libmbgmt_la_LIBADD = ${top_builddir}/src/mbio/libmbio.la \
-			${top_builddir}/src/mbaux/libmbaux.la \
-			${libgmt_LIBS} ${libnetcdf_LIBS}
-
-all: all-am
-
-.SUFFIXES:
-.SUFFIXES: .c .lo .o .obj
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
-	@for dep in $?; do \
-	  case '$(am__configure_deps)' in \
-	    *$$dep*) \
-	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-	        && { if test -f $@; then exit 0; else break; fi; }; \
-	      exit 1;; \
-	  esac; \
-	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/gmt/Makefile'; \
-	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --gnu src/gmt/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	@case '$?' in \
-	  *config.status*) \
-	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-	esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-
-install-libLTLIBRARIES: $(lib_LTLIBRARIES)
-	@$(NORMAL_INSTALL)
-	@list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
-	list2=; for p in $$list; do \
-	  if test -f $$p; then \
-	    list2="$$list2 $$p"; \
-	  else :; fi; \
-	done; \
-	test -z "$$list2" || { \
-	  echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \
-	  $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \
-	}
-
-uninstall-libLTLIBRARIES:
-	@$(NORMAL_UNINSTALL)
-	@list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
-	for p in $$list; do \
-	  $(am__strip_dir) \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \
-	done
-
-clean-libLTLIBRARIES:
-	-test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
-	@list='$(lib_LTLIBRARIES)'; \
-	locs=`for p in $$list; do echo $$p; done | \
-	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
-	      sort -u`; \
-	test -z "$$locs" || { \
-	  echo rm -f $${locs}; \
-	  rm -f $${locs}; \
-	}
-
-libmbgmt.la: $(libmbgmt_la_OBJECTS) $(libmbgmt_la_DEPENDENCIES) $(EXTRA_libmbgmt_la_DEPENDENCIES) 
-	$(AM_V_CCLD)$(libmbgmt_la_LINK) -rpath $(libdir) $(libmbgmt_la_OBJECTS) $(libmbgmt_la_LIBADD) $(LIBS)
-
-mostlyclean-compile:
-	-rm -f *.$(OBJEXT)
-
-distclean-compile:
-	-rm -f *.tab.c
-
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbcontour.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbgrdtiff.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbswath.Plo at am__quote@
-
-.c.o:
- at am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(COMPILE) -c -o $@ $<
-
-.c.obj:
- at am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
- at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-
-.c.lo:
- at am__fastdepCC_TRUE@	$(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(LTCOMPILE) -c -o $@ $<
-
-mostlyclean-libtool:
-	-rm -f *.lo
-
-clean-libtool:
-	-rm -rf .libs _libs
-install-includeHEADERS: $(include_HEADERS)
-	@$(NORMAL_INSTALL)
-	@list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \
-	if test -n "$$list"; then \
-	  echo " $(MKDIR_P) '$(DESTDIR)$(includedir)'"; \
-	  $(MKDIR_P) "$(DESTDIR)$(includedir)" || exit 1; \
-	fi; \
-	for p in $$list; do \
-	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
-	  echo "$$d$$p"; \
-	done | $(am__base_list) | \
-	while read files; do \
-	  echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includedir)'"; \
-	  $(INSTALL_HEADER) $$files "$(DESTDIR)$(includedir)" || exit $$?; \
-	done
-
-uninstall-includeHEADERS:
-	@$(NORMAL_UNINSTALL)
-	@list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \
-	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
-	dir='$(DESTDIR)$(includedir)'; $(am__uninstall_files_from_dir)
-
-ID: $(am__tagged_files)
-	$(am__define_uniq_tagged_files); mkid -fID $$unique
-tags: tags-am
-TAGS: tags
-
-tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
-	set x; \
-	here=`pwd`; \
-	$(am__define_uniq_tagged_files); \
-	shift; \
-	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
-	  test -n "$$unique" || unique=$$empty_fix; \
-	  if test $$# -gt 0; then \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      "$$@" $$unique; \
-	  else \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      $$unique; \
-	  fi; \
-	fi
-ctags: ctags-am
-
-CTAGS: ctags
-ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
-	$(am__define_uniq_tagged_files); \
-	test -z "$(CTAGS_ARGS)$$unique" \
-	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$unique
-
-GTAGS:
-	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && $(am__cd) $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) "$$here"
-cscopelist: cscopelist-am
-
-cscopelist-am: $(am__tagged_files)
-	list='$(am__tagged_files)'; \
-	case "$(srcdir)" in \
-	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
-	  *) sdir=$(subdir)/$(srcdir) ;; \
-	esac; \
-	for i in $$list; do \
-	  if test -f "$$i"; then \
-	    echo "$(subdir)/$$i"; \
-	  else \
-	    echo "$$sdir/$$i"; \
-	  fi; \
-	done >> $(top_builddir)/cscope.files
-
-distclean-tags:
-	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	list='$(DISTFILES)'; \
-	  dist_files=`for file in $$list; do echo $$file; done | \
-	  sed -e "s|^$$srcdirstrip/||;t" \
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
-	case $$dist_files in \
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
-			   sort -u` ;; \
-	esac; \
-	for file in $$dist_files; do \
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  if test -d $$d/$$file; then \
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
-	    if test -d "$(distdir)/$$file"; then \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
-	  else \
-	    test -f "$(distdir)/$$file" \
-	    || cp -p $$d/$$file "$(distdir)/$$file" \
-	    || exit 1; \
-	  fi; \
-	done
-check-am: all-am
-check: check-am
-all-am: Makefile $(LTLIBRARIES) $(HEADERS)
-installdirs:
-	for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includedir)"; do \
-	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
-	done
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
-	if test -z '$(STRIP)'; then \
-	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	      install; \
-	else \
-	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
-	fi
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
-	@echo "This command is intended for maintainers to use"
-	@echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \
-	mostlyclean-am
-
-distclean: distclean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
-	distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am: install-includeHEADERS
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am: install-libLTLIBRARIES
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic \
-	mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am: uninstall-includeHEADERS uninstall-libLTLIBRARIES
-
-.MAKE: install-am install-strip
-
-.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
-	clean-libLTLIBRARIES clean-libtool cscopelist-am ctags \
-	ctags-am distclean distclean-compile distclean-generic \
-	distclean-libtool distclean-tags distdir dvi dvi-am html \
-	html-am info info-am install install-am install-data \
-	install-data-am install-dvi install-dvi-am install-exec \
-	install-exec-am install-html install-html-am \
-	install-includeHEADERS install-info install-info-am \
-	install-libLTLIBRARIES install-man install-pdf install-pdf-am \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-compile \
-	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-	tags tags-am uninstall uninstall-am uninstall-includeHEADERS \
-	uninstall-libLTLIBRARIES
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/gmt/common_byteswap.h b/src/gmt/common_byteswap.h
deleted file mode 100644
index dac45a0..0000000
--- a/src/gmt/common_byteswap.h
+++ /dev/null
@@ -1,135 +0,0 @@
-/*--------------------------------------------------------------------
- *	$Id: common_byteswap.h 2244 2015-05-27 05:32:38Z caress $
- *
- *	Copyright (c) 1991-2015 by P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis and F. Wobbe
- *	See LICENSE.TXT file for copying and redistribution conditions.
- *
- *	This program is free software; you can redistribute it and/or modify
- *	it under the terms of the GNU Lesser General Public License as published by
- *	the Free Software Foundation; version 3 or any later version.
- *
- *	This program is distributed in the hope that it will be useful,
- *	but WITHOUT ANY WARRANTY; without even the implied warranty of
- *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *	GNU Lesser General Public License for more details.
- *
- *	Contact info: gmt.soest.hawaii.edu
- *--------------------------------------------------------------------*/
-/*
- * common_byteswap.h contains inline functions for byteswapping
- *
- * Author:  Florian Wobbe
- * Date:    12-APR-2012
- * Version: 5
- */
-
-#pragma once
-#ifndef _COMMON_BYTESWAP_H
-#define _COMMON_BYTESWAP_H
-
-#include "gmt_config.h"
-
-#ifdef HAVE_STDINT_H_          /* VS 2010 has stdint.h */
-#	include <stdint.h>
-#else
-#	include "compat/stdint.h"    /* msinttypes for VC++ */
-#endif /* HAVE_STDINT_H_ */
-
-/*
- * Default inline functions that the compiler should optimize properly. Use
- * these functions if you know that you are dealing with constant values.
- */
-static inline uint16_t inline_bswap16 (uint16_t x) {
-	return
-		(((x & 0x00FFU) << 8) |
-		 ((x & 0xFF00U) >> 8));
-}
-
-static inline uint32_t inline_bswap32 (uint32_t x) {
-	return
-		(((x & 0xFF000000U) >> 24) |
-		 ((x & 0x00FF0000U) >>  8) |
-		 ((x & 0x0000FF00U) <<  8) |
-		 ((x & 0x000000FFU) << 24));
-}
-
-static inline uint64_t inline_bswap64 (uint64_t x) {
-	return
-		(((x & 0x00000000000000FFULL) << 56) |
-		 ((x & 0x000000000000FF00ULL) << 40) |
-		 ((x & 0x0000000000FF0000ULL) << 24) |
-		 ((x & 0x00000000FF000000ULL) << 8) |
-		 ((x & 0x000000FF00000000ULL) >> 8) |
-		 ((x & 0x0000FF0000000000ULL) >> 24) |
-		 ((x & 0x00FF000000000000ULL) >> 40) |
-		 ((x & 0xFF00000000000000ULL) >> 56));
-}
-
-/*
- * Use builtin functions for bswap16, bswap32, and bswap64 or - if not
- * available - use the default inline functions defined above.
- */
-
-/* Define bswap16 */
-#undef bswap16
-#ifdef HAVE___BUILTIN_BSWAP16
-#	define bswap16 __builtin_bswap16
-#elif defined __GNUC__ && (defined __i386__ || defined __x86_64__)
-#	define bswap16 gnuc_bswap16
-	static inline uint16_t gnuc_bswap16(uint16_t x) {
-		if (__builtin_constant_p(x))
-			x = inline_bswap16(x);
-		else {
-#		ifdef __x86_64__
-			__asm__("xchgb %h0, %b0" : "+Q" (x));
-#		elif defined __i386__
-			__asm__("xchgb %h0, %b0" : "+q" (x));
-#		endif
-		}
-		return x;
-	}
-#elif defined HAVE__BYTESWAP_USHORT /* HAVE___BUILTIN_BSWAP16 */
-#	define bswap16 _byteswap_ushort
-#else /* HAVE___BUILTIN_BSWAP16 */
-#	define bswap16 inline_bswap16
-#endif /* HAVE___BUILTIN_BSWAP16 */
-
-/* Define bswap32 */
-#undef bswap32
-#ifdef HAVE___BUILTIN_BSWAP32
-#	define bswap32 __builtin_bswap32
-#elif defined __GNUC__ && (defined __i386__ || defined __x86_64__)
-#	define bswap32 gnuc_bswap32
-	static inline uint32_t gnuc_bswap32(uint32_t x) {
-		if (__builtin_constant_p(x))
-			x = inline_bswap32(x);
-		else
-			__asm__("bswap %0" : "+r" (x));
-		return x;
-	}
-#elif defined HAVE__BYTESWAP_ULONG /* HAVE___BUILTIN_BSWAP32 */
-#	define bswap32 _byteswap_ulong
-#else /* HAVE___BUILTIN_BSWAP32 */
-#	define bswap32 inline_bswap32
-#endif /* HAVE___BUILTIN_BSWAP32 */
-
-/* Define bswap64 */
-#undef bswap64
-#ifdef HAVE___BUILTIN_BSWAP64
-#	define bswap64 __builtin_bswap64
-#elif defined __GNUC__ && defined __x86_64__
-#	define bswap64 gnuc_bswap64
-	static inline uint64_t gnuc_bswap64(uint64_t x) {
-		if (__builtin_constant_p(x))
-			x = inline_bswap64(x);
-		else
-			__asm__ ("bswap  %0" : "+r" (x));
-		return x;
-	}
-#elif defined HAVE__BYTESWAP_UINT64 /* HAVE___BUILTIN_BSWAP64 */
-#	define bswap64 _byteswap_uint64
-#else /* HAVE___BUILTIN_BSWAP64 */
-#	define bswap64 inline_bswap64
-#endif /* HAVE___BUILTIN_BSWAP64 */
-
-#endif /* !_COMMON_BYTESWAP_H */
diff --git a/src/gmt/common_math.h b/src/gmt/common_math.h
deleted file mode 100644
index 3a2c896..0000000
--- a/src/gmt/common_math.h
+++ /dev/null
@@ -1,107 +0,0 @@
-/*--------------------------------------------------------------------
- * $Id: common_math.h 13846 2014-12-28 21:46:54Z pwessel $
- *
- * Copyright (c) 1991-2015 by P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis and F. Wobbe
- * See LICENSE.TXT file for copying and redistribution conditions.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; version 3 or any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Lesser General Public License for more details.
- *
- * Contact info: gmt.soest.hawaii.edu
- *--------------------------------------------------------------------*/
-/*
- * common_math.h declares shared math functions
- *
- * Author:  Florian Wobbe
- * Date:    10-MAR-2012
- * Version: 5
- */
-
-#pragma once
-#ifndef _COMMON_MATH_H
-#define _COMMON_MATH_H
-
-#ifdef __cplusplus      /* Basic C++ support */
-extern "C" {
-#endif
-
-	/* CMake definitions: This must be first! */
-//#include "gmt_config.h"
-
-	/* Declaration modifiers for DLL support (MSC et al) */
-#include "declspec.h"
-
-//#ifdef HAVE_STDINT_H_       /* VS 2010 has stdint.h */
-#	include <stdint.h>
-//#else
-//#	include "compat/stdint.h" /* msinttypes for VC++ */
-//#endif /* HAVE_STDINT_H_ */
-
-//#ifdef HAVE_STDBOOL_H_
-#	include <stdbool.h>
-//#else
-//#	include "compat/stdbool.h"
-//#endif /* HAVE_STDBOOL_H_ */
-
-	/* int32_abs function that works with int32_t */
-#if defined(SIZEOF_INT) && SIZEOF_INT == 4 && defined(HAVE_ABS)
-#	define int32_abs abs
-#elif defined(SIZEOF_LONG) && SIZEOF_LONG == 4
-#	define int32_abs labs
-#else
-#	define int32_abs(x) ((int32_t)(((x) >= 0) ? (x) : -(x)))
-#endif
-
-	/* int64_abs function that works with int64_t */
-#if defined(_WIN64)
-#	define int64_abs _abs64
-#elif defined(SIZEOF_INT) && SIZEOF_INT == 8 && defined(HAVE_ABS)
-#	define int64_abs abs
-#elif defined(SIZEOF_LONG) && SIZEOF_LONG == 8
-#	define int64_abs labs
-#elif defined(SIZEOF_LONG_LONG) && SIZEOF_LONG_LONG == 8 && defined(HAVE_LLABS)
-#	define int64_abs llabs
-#else
-#	define int64_abs(x) ((int64_t)(((x) >= 0) ? (x) : -(x)))
-#endif
-
-	/* Limit casting to one place (here) for dropping lrint output to signed or unsigned ints */
-#define irint(x) ((int)lrint(x))
-#define urint(x) ((unsigned int)lrint(x))
-#define irintf(x) ((int)lrintf(x))
-#define urintf(x) ((unsigned int)lrintf(x))
-
-	/* Safe rounding of float and double to signed and unsigned 64 bit ints */
-#if defined(SIZEOF_INT) && SIZEOF_LONG == 8
-#	define irint64(x) lrint(x)
-#	define urint64(x) ((uint64_t)lrint(x))
-#	define irint64f(x) lrintf(x)
-#	define urint64f(x) ((uint64_t)lrintf(x))
-#else /* SIZEOF_LONG_LONG == 8 by ISO C definition */
-#	define irint64(x) llrint(x)
-#	define urint64(x) ((uint64_t)llrint(x))
-#	define irint64f(x) llrintf(x)
-#	define urint64f(x) ((uint64_t)llrintf(x))
-#endif
-
-	EXTERN_MSC bool floatAlmostEqualUlpsAndAbs(float A, float B, float maxDiff, int maxUlpsDiff);
-	EXTERN_MSC bool doubleAlmostEqualUlpsAndAbs(double A, double B, double maxDiff, int maxUlpsDiff);
-	EXTERN_MSC bool floatAlmostEqualUlps(float A, float B, int maxUlpsDiff);
-	EXTERN_MSC bool doubleAlmostEqualUlps(double A, double B, int maxUlpsDiff);
-
-#	define floatAlmostEqual(A, B) (floatAlmostEqualUlps(A, B, 5))
-#	define doubleAlmostEqual(A, B) (doubleAlmostEqualUlps(A, B, 5))
-#	define floatAlmostEqualZero(A, B) (floatAlmostEqualUlpsAndAbs(A, B, 5*FLT_EPSILON, 5))
-#	define doubleAlmostEqualZero(A, B) (doubleAlmostEqualUlpsAndAbs(A, B, 5*DBL_EPSILON, 5))
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* !_COMMON_MATH_H */
diff --git a/src/gmt/common_runpath.h b/src/gmt/common_runpath.h
deleted file mode 100644
index 687e054..0000000
--- a/src/gmt/common_runpath.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/*--------------------------------------------------------------------
- *	$Id: common_runpath.h 2244 2015-05-27 05:32:38Z caress $
- *
- *	Copyright (c) 1991-2015 by P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis and F. Wobbe
- *	See LICENSE.TXT file for copying and redistribution conditions.
- *
- *	This program is free software; you can redistribute it and/or modify
- *	it under the terms of the GNU Lesser General Public License as published by
- *	the Free Software Foundation; version 3 or any later version.
- *
- *	This program is distributed in the hope that it will be useful,
- *	but WITHOUT ANY WARRANTY; without even the implied warranty of
- *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *	GNU Lesser General Public License for more details.
- *
- *	Contact info: gmt.soest.hawaii.edu
- *--------------------------------------------------------------------*/
-/*
- * common_runpath.h contains prototypes of functions shared between GMT and PSL
- *
- * Author:  Florian Wobbe
- * Date:    3-MAR-2012
- * Version: 5
- */
-
-#pragma once
-#ifndef _COMMON_RUNPATH_H
-#define _COMMON_RUNPATH_H
-
-#ifdef __cplusplus      /* Basic C++ support */
-extern "C" {
-#endif
-
-/* CMake definitions: This must be first! */
-#include "gmt_config.h"
-
-/* Declaration modifiers for DLL support (MSC et al) */
-#include "declspec.h"
-
-/* Prototypes */
-#if defined (__APPLE__)
-#	define GMT_runtime_bindir(result, argv) GMT_runtime_bindir_osx(result)
-	EXTERN_MSC char *GMT_runtime_bindir_osx (char *result);
-#elif defined (_WIN32)
-#	define GMT_runtime_bindir(result, argv) GMT_runtime_bindir_win32(result)
-	EXTERN_MSC char *GMT_runtime_bindir_win32 (char *result);
-#else
-	EXTERN_MSC char *GMT_runtime_bindir (char *result, const char *candidate);
-#endif
-
-EXTERN_MSC char *GMT_runtime_libdir (char *result);
-EXTERN_MSC char *GMT_guess_sharedir (char *sharedir, const char *runpath);
-EXTERN_MSC int GMT_verify_sharedir_version (const char *dir);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif  /* !_COMMON_RUNPATH_H */
diff --git a/src/gmt/common_sighandler.h b/src/gmt/common_sighandler.h
deleted file mode 100644
index e793229..0000000
--- a/src/gmt/common_sighandler.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/*--------------------------------------------------------------------
- *	$Id: common_sighandler.h 13846 2014-12-28 21:46:54Z pwessel $
- *
- *	Copyright (c) 1991-2015 by P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis and F. Wobbe
- *	See LICENSE.TXT file for copying and redistribution conditions.
- *
- *	This program is free software; you can redistribute it and/or modify
- *	it under the terms of the GNU Lesser General Public License as published by
- *	the Free Software Foundation; version 3 or any later version.
- *
- *	This program is distributed in the hope that it will be useful,
- *	but WITHOUT ANY WARRANTY; without even the implied warranty of
- *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *	GNU Lesser General Public License for more details.
- *
- *	Contact info: gmt.soest.hawaii.edu
- *--------------------------------------------------------------------*/
-/*
- * common_sighandler.h contains the prototype of a signal-handling function
- *
- * Author:  Florian Wobbe
- * Date:    5-SEP-2013
- * Version: 5
- */
-
-#pragma once
-#ifndef _COMMON_SIGHANDLER_H
-#define _COMMON_SIGHANDLER_H
-
-#if !(defined WIN32 || defined NO_SIGHANDLER)
-void sig_handler(int sig_num, siginfo_t *info, void *ucontext);
-#endif /* !(defined WIN32 || defined NO_SIGHANDLER) */
-
-#endif /* !_COMMON_SIGHANDLER_H */
diff --git a/src/gmt/common_string.h b/src/gmt/common_string.h
deleted file mode 100644
index f2b554c..0000000
--- a/src/gmt/common_string.h
+++ /dev/null
@@ -1,88 +0,0 @@
-/*--------------------------------------------------------------------
- *	$Id: common_string.h 2244 2015-05-27 05:32:38Z caress $
- *
- *	Copyright (c) 1991-2015 by P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis and F. Wobbe
- *	See LICENSE.TXT file for copying and redistribution conditions.
- *
- *	This program is free software; you can redistribute it and/or modify
- *	it under the terms of the GNU Lesser General Public License as published by
- *	the Free Software Foundation; version 3 or any later version.
- *
- *	This program is distributed in the hope that it will be useful,
- *	but WITHOUT ANY WARRANTY; without even the implied warranty of
- *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *	GNU Lesser General Public License for more details.
- *
- *	Contact info: gmt.soest.hawaii.edu
- *--------------------------------------------------------------------*/
-/*
- * common_string.h contains prototypes of functions shared between GMT and PSL
- *
- * Author:  Florian Wobbe
- * Date:    3-MAR-2012
- * Version: 5
- */
-
-#pragma once
-#ifndef _COMMON_STRING_H
-#define _COMMON_STRING_H
-
-#ifdef __cplusplus      /* Basic C++ support */
-extern "C" {
-#endif
-
-/* CMake definitions: This must be first! */
-//#include "gmt_config.h"
-
-/* Declaration modifiers for DLL support (MSC et al) */
-#include "declspec.h"
-
-//#ifdef HAVE_STDBOOL_H_
-//#	include <stdbool.h>
-//#else
-//#	include "compat/stdbool.h"
-//#endif /* HAVE_STDBOOL_H_ */
-
-#include <limits.h> /* defines PATH_MAX */
-#include <stdlib.h> /* defines _MAX_PATH on WIN32 */
-#if ! defined PATH_MAX && defined _MAX_PATH
-#	define PATH_MAX _MAX_PATH
-#endif
-#ifndef PATH_MAX
-#	define PATH_MAX 1024
-#endif
-
-EXTERN_MSC unsigned int GMT_strtok (const char *string, const char *sep, unsigned int *start, char *token);
-EXTERN_MSC void GMT_chop (char *string);
-EXTERN_MSC char *GMT_chop_ext (char *string);
-EXTERN_MSC void GMT_strstrip(char *string, bool strip_leading);
-EXTERN_MSC void GMT_cr2lf (char *string);
-EXTERN_MSC void GMT_strlshift (char *string, size_t n);
-EXTERN_MSC void GMT_strrepc (char *string, int c, int r);
-EXTERN_MSC size_t GMT_strlcmp (char *str1, char *str2);
-
-#ifdef WIN32
-EXTERN_MSC void DOS_path_fix (char *dir);
-#else
-# define DOS_path_fix(e) ((void)0) /* dummy function */
-#endif
-
-//#if !defined(HAVE_STRTOK_R) && !defined(HAVE_STRTOK_S)
-//EXTERN_MSC char *strtok_r (char *s, const char *delim, char **save_ptr);
-//#endif
-
-//#ifndef DECLARED_STRSEP
-//EXTERN_MSC char *strsep (char **stringp, const char *delim);
-//#endif
-EXTERN_MSC char *strsepz (char **stringp, const char *delim);
-EXTERN_MSC char *stresep (char **stringp, const char *delim, int esc);
-
-EXTERN_MSC int match_string_in_file (const char *filename, const char *string);
-
-EXTERN_MSC char *GMT_basename(const char *path);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* !_COMMON_STRING_H */
diff --git a/src/gmt/gmt_calclock.h b/src/gmt/gmt_calclock.h
deleted file mode 100644
index cc3103f..0000000
--- a/src/gmt/gmt_calclock.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/*--------------------------------------------------------------------
- *	$Id: gmt_calclock.h 13846 2014-12-28 21:46:54Z pwessel $
- *
- *	Copyright (c) 1991-2015 by P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis and F. Wobbe
- *	See LICENSE.TXT file for copying and redistribution conditions.
- *
- *	This program is free software; you can redistribute it and/or modify
- *	it under the terms of the GNU Lesser General Public License as published by
- *	the Free Software Foundation; version 3 or any later version.
- *
- *	This program is distributed in the hope that it will be useful,
- *	but WITHOUT ANY WARRANTY; without even the implied warranty of
- *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *	GNU Lesser General Public License for more details.
- *
- *	Contact info: gmt.soest.hawaii.edu
- *--------------------------------------------------------------------*/
-/* Header file for Generic Mapping Tools conversions
- *      between [calendar, clock] and time.
- *      
- *      Calendar conversions are inspired partly by
- *      Dershowitz and Reingold.
- *      
- * Author:	W H F Smith
- * Date:	1 JAN 2010
- * Version:	5 API
- *
- */
-
-#pragma once
-#ifndef _GMT_CALCLOCK_H
-#define _GMT_CALCLOCK_H
-
-struct GMT_gcal {	/* (proleptic) Gregorian calendar  */
-	int year;		/* signed; negative and 0 allowed  */
-	unsigned int month;	/* Always between 1 and 12  */
-	unsigned int day_m;	/* Day of month; always in 1 - 31  */
-	unsigned int day_y;	/* Day of year; 1 thru 366  */
-	unsigned int day_w;	/* Day of week; 0 (Sun) thru 6 (Sat)  */
-	int iso_y;		/* ISO year; not necessarily == year */
-	unsigned int iso_w;	/* ISO week of iso_y; must be in 1 -- 53  */
-	unsigned int iso_d;	/* ISO day of iso_w; uses 1 (Mon) thru 7 (Sun)  */
-	unsigned int hour;	/* 00 through 23  */
-	unsigned int min;	/* 00 through 59  */
-	double sec;		/* 00 through 59.xxxx; leap not yet handled  */
-};
-
-struct GMT_Y2K_FIX {	/* The issue that refuses to go away... */
-	unsigned int y2_cutoff;	/* The 2-digit offset year.  If y2 >= y2_cuttoff, add y100 else add y200 */
-	int y100;	/* The multiple of 100 to add to the 2-digit year if we are above the time_Y2K_offset_year */
-	int y200;	/* The multiple of 100 to add to the 2-digit year if we are below the time_Y2K_offset_year */
-};
-
-struct GMT_MOMENT_INTERVAL {
-	struct GMT_gcal	cc[2];		
-	double dt[2];		
-	double sd[2];		/* Seconds since the start of the day.  */
-	int64_t rd[2];
-	unsigned int step;
-	char unit;
-};
-
-struct GMT_TRUNCATE_TIME {		/* Used when TIME_IS_INTERVAL is not OFF */
-	struct GMT_MOMENT_INTERVAL T;
-	unsigned int direction;		/* 0 [+] to center on next interval, 1 [-] for previous interval */
-};
-
-#endif /* !_GMT_CALCLOCK_H */
diff --git a/src/gmt/gmt_colors.h b/src/gmt/gmt_colors.h
deleted file mode 100644
index 60af0a7..0000000
--- a/src/gmt/gmt_colors.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/*--------------------------------------------------------------------
- *	$Id: gmt_colors.h 2242 2015-05-16 05:21:28Z caress $
- *
- *	Copyright (c) 1991-2015 by P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis and F. Wobbe
- *	See LICENSE.TXT file for copying and redistribution conditions.
- *
- *	This program is free software; you can redistribute it and/or modify
- *	it under the terms of the GNU Lesser General Public License as published by
- *	the Free Software Foundation; version 3 or any later version.
- *
- *	This program is distributed in the hope that it will be useful,
- *	but WITHOUT ANY WARRANTY; without even the implied warranty of
- *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *	GNU Lesser General Public License for more details.
- *
- *	Contact info: gmt.soest.hawaii.edu
- *--------------------------------------------------------------------*/
-/*
- * Miscellaneous definitions and structures related to color.
- *
- * Author: Paul Wessel
- * Date:	1-JAN-2010
- * Version:	5 API
- */
-
-#ifndef _GMT_COLORS_H
-#define _GMT_COLORS_H
-
-/* Copy two RGB[T] arrays (a = b) */
-#define GMT_rgb_copy(a,b) memcpy (a, b, 4 * sizeof(double))
-
-/* To compare is two colors are ~ the same */
-#define GMT_eq(a,b) (fabs((a)-(b)) < GMT_CONV4_LIMIT)
-#define GMT_same_rgb(a,b) (GMT_eq(a[0],b[0]) && GMT_eq(a[1],b[1]) && GMT_eq(a[2],b[2]) && GMT_eq(a[3],b[3]))
-
-/* Macros for conversion of RGB in 0-1 range to 0-255 range */
-#define GMT_s255(s) ((s) * 255.0)
-#define GMT_t255(t) GMT_q(GMT_s255(t[0])),GMT_q(GMT_s255(t[1])),GMT_q(GMT_s255(t[2]))
-#define GMT_u255(s) ((unsigned char)rint(GMT_s255(s)))
-
-/* Macros for conversion of RGB in 0-255 range to 0-1 range */
-#define GMT_is255(s) ((s) / 255.0)
-#define GMT_it255(t) GMT_is255(t[0]),GMT_is255(t[1]),GMT_is255(t[2])
-
-/* Macro to avoid small numbers in color codes */
-#define GMT_q(s) ((s) < 1e-5 ? 0.0 : (s))
-
-/* How B/W TV's convert RGB to Gray */
-#define GMT_YIQ(rgb) (0.299 * rgb[0] + 0.587 * rgb[1] + 0.114 * rgb[2])
-
-/* Determine if a RGB combination is grayshade */
-#define GMT_is_gray(rgb) (GMT_eq(rgb[0],rgb[1]) && GMT_eq(rgb[1],rgb[2]))
-
-/* Determine if a RGB combination is in fact B/W */
-#define GMT_is_bw(rgb) (GMT_is_gray(rgb) && (GMT_eq(rgb[0],0.0) || GMT_eq(rgb[0],1.0)))
-
-/* Force component to be in 0 <= s <= 255 range */
-#define GMT_0_255_truncate(s) ((s < 0) ? 0 : ((s > 255) ? 255 : s))	/* Truncate to allowable 0-255 range */
-
-#endif /* _GMT_COLORS_H */
diff --git a/src/gmt/gmt_common.h b/src/gmt/gmt_common.h
deleted file mode 100644
index 0a5ff54..0000000
--- a/src/gmt/gmt_common.h
+++ /dev/null
@@ -1,187 +0,0 @@
-/*--------------------------------------------------------------------
- *	$Id: gmt_common.h 2242 2015-05-16 05:21:28Z caress $
- *
- *	Copyright (c) 1991-2015 by P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis and F. Wobbe
- *	See LICENSE.TXT file for copying and redistribution conditions.
- *
- *	This program is free software; you can redistribute it and/or modify
- *	it under the terms of the GNU Lesser General Public License as published by
- *	the Free Software Foundation; version 3 or any later version.
- *
- *	This program is distributed in the hope that it will be useful,
- *	but WITHOUT ANY WARRANTY; without even the implied warranty of
- *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *	GNU Lesser General Public License for more details.
- *
- *	Contact info: gmt.soest.hawaii.edu
- *--------------------------------------------------------------------*/
- 
-/*
- * Holds current selections for the family of common GMT options.
- *
- * Author: 	Paul Wessel
- * Date:	01-JAN-2011
- * Version:	5 API
- */
- 
-#ifndef _GMT_COMMON_H
-#define _GMT_COMMON_H
-
-/* Constants related to detecting data gaps which should be treated as segment boundaries */
-enum GMT_enum_gaps {GMT_NEGGAP_IN_COL = 0,	/* Check if previous minus current column value exceeds <gap> */
-	GMT_POSGAP_IN_COL,			/* Check if current minus previous column value exceeds <gap> */
-	GMT_ABSGAP_IN_COL,			/* Check if |current minus previous column value| exceeds <gap> */
-	GMT_NEGGAP_IN_MAP_COL,			/* Check if previous minus current column value exceeds <gap> after map projection */
-	GMT_POSGAP_IN_MAP_COL,			/* Check if current minus previous column value exceeds <gap> after map projection */
-	GMT_ABSGAP_IN_MAP_COL,			/* Check if |current minus previous column value| exceeds <gap> after map projection */
-	GMT_GAP_IN_GDIST,			/* Check if great-circle distance between successive points exceeds <gap> (in km,m,nm, etc)*/
-	GMT_GAP_IN_CDIST,			/* Check if Cartesian distance between successive points exceeds <gap> */
-	GMT_GAP_IN_PDIST,			/* Check if Cartesian distance between successive points exceeds <gap> after map projection */
-	GMT_GAP_IN_DDIST,			/* Check if great-circle distance between successive points exceeds <gap> (in arc degrees,min,sec) */
-	GMT_N_GAP_METHODS};
-
-#define MAX_ASPATIAL 64		/* No more than 64 aspatial options in -a */
-
-#define GMT_SHORTHAND_OPTIONS	"BJRXYcp"	/* All of the shorthand options */
-#define GMT_CRITICAL_OPT_ORDER "-VJfRb"		/* If given options among these must be parsed first and in this order */
-
-struct GMT_COMMON {
-	/* Structure with all information given via the common GMT command-line options -R -J .. */
-	struct synopsis {	/* \0 (zero) or ^ */
-		bool active;
-		bool extended;	/* + to also show non-common options */
-	} synopsis;
-	struct B {	/* -B<params> */
-		bool active[2];	/* 0 = primary annotation, 1 = secondary annotations */
-		int mode;	/* 5 = GMT 5 syntax, 4 = GMT 4 syntax, 1 = Either, -1 = mix (error), 0 = not set yet */
-		char string[2][GMT_LEN256];
-	} B;	
-	struct API_I {	/* -I<xinc>[/<yinc>] grids only, and for API use only */
-		bool active;
-		double inc[2];
-	} API_I;	
-	struct J {	/* -J<params> */
-		bool active, zactive;
-		unsigned int id;
-		double par[6];
-		char string[GMT_LEN256];
-	} J;		
-	struct K {	/* -K */
-		bool active;
-	} K;	
-	struct O {	/* -O */
-		bool active;
-	} O;
-	struct P {	/* -P */
-		bool active;
-	} P;
-	struct R {	/* -Rw/e/s/n[/z_min/z_max][r] */
-		bool active;
-		bool oblique;	/* true when -R...r was given (oblique map, probably), else false (map borders are meridians/parallels) */
-		double wesn[6];		/* Boundaries of west, east, south, north, low-z and hi-z */
-		double wesn_orig[4];	/* Original Boundaries of west, east, south, north (oblique projection may reset wesn above) */
-		char string[GMT_LEN256];
-	} R;
-	struct U {	/* -U */
-		bool active;
-		unsigned int just;
-		double x, y;
-		char *label;		/* Content not counted by sizeof (struct) */
-	} U;
-	struct V {	/* -V */
-		bool active;
-	} V;
-	struct X {	/* -X */
-		bool active;
-		double off;
-		char mode;	/* r, a, or c */
-	} X;
-	struct Y {	/* -Y */
-		bool active;
-		double off;
-		char mode;	/* r, a, or c */
-	} Y;
-	struct a {	/* -a<col>=<name>[:<type>][,col>=<name>[:<type>], etc][+g<geometry>] */
-		bool active;
-		unsigned int geometry;
-		unsigned int n_aspatial;
-		bool clip;		/* true if we wish to clip lines/polygons at Dateline [false] */
-		bool output;		/* true when we wish to build OGR output */
-		int col[MAX_ASPATIAL];	/* Col id, include negative items such as GMT_IS_T (-5) */
-		int ogr[MAX_ASPATIAL];	/* Column order, or -1 if not set */
-		unsigned int type[MAX_ASPATIAL];
-		char *name[MAX_ASPATIAL];
-	} a;
-	struct b {	/* -b[i][o][s|S][d|D][#cols][cvar1/var2/...] */
-		bool active[2];		/* true if current input/output is in native binary format */
-		bool o_delay;		/* true if we dont know number of output columns until we have read at least one input record */
-		enum GMT_swap_direction swab[2];	/* k_swap_in or k_swap_out if current binary input/output must be byte-swapped, else k_swap_none */
-		uint64_t ncol[2];		/* Number of expected columns of input/output
-						   0 means it will be determined by program */
-		char type[2];			/* Default column type, if set [d for double] */
-		char varnames[GMT_BUFSIZ];	/* List of variable names to be input/output in netCDF mode [GMT4 COMPATIBILITY ONLY] */
-	} b;
-	struct c {	/* -c */
-		bool active;
-		unsigned int copies;
-	} c;
-	struct f {	/* -f[i|o]<col>|<colrange>[t|T|g],.. */
-		bool active[2];	/* For GMT_IN|OUT */
-	} f;
-	struct g {	/* -g[+]x|x|y|Y|d|Y<gap>[unit]  */
-		bool active;
-		unsigned int n_methods;			/* How many different criteria to apply */
-		uint64_t n_col;				/* Largest column-number needed to be read */
-		bool match_all;			/* If true then all specified criteria must be met to be a gap [default is any of them] */
-		enum GMT_enum_gaps method[GMT_N_GAP_METHODS];	/* How distances are computed for each criteria */
-		uint64_t col[GMT_N_GAP_METHODS];	/* Which column to use (-1 for x,y distance) */
-		double gap[GMT_N_GAP_METHODS];		/* The critical distances for each criteria */
-		double (*get_dist[GMT_N_GAP_METHODS]) (struct GMT_CTRL *GMT, uint64_t);	/* Pointers to functions that compute those distances */
-	} g;
-	struct h {	/* -h[i|o][<nrecs>][+d][+c][+r<remark>][+t<title>] */
-		bool active;
-		bool add_colnames;
-		unsigned int mode;
-		unsigned int n_recs;
-		char *title;
-		char *remark;
-		char *colnames;	/* Not set by -h but maintained here */
-	} h;	
-	struct i {	/* -i<col>|<colrange>,.. */
-		bool active;
-		uint64_t n_cols;
-	} i;
-	struct n {	/* -n[b|c|l|n][+a][+b<BC>][+c][+t<threshold>] */
-		bool active;
-		bool antialias;	/* Defaults to true, if supported */
-		bool truncate;	/* Defaults to false */
-		unsigned int interpolant;	/* Defaults to BCR_BICUBIC */
-		bool bc_set;	/* true if +b was parsed */
-		char BC[4];		/* For BC settings via +bg|n[x|y]|p[x|y] */
-		double threshold;	/* Defaults to 0.5 */
-	} n;
-	struct o {	/* -o<col>|<colrange>,.. */
-		bool active;
-		uint64_t n_cols;
-	} o;
-	struct p {	/* -p<az>/<el>[+wlon0/lat0[/z0]][+vx0[cip]/y0[cip]] */
-		bool active;
-	} p;
-	struct r {	/* -r */
-		bool active;
-		unsigned int registration;
-	} r;
-	struct s {	/* -s[r] */
-		bool active;
-	} s;
-	struct t {	/* -t<transparency> */
-		bool active;
-		double value;
-	} t;
-	struct colon {	/* -:[i|o] */
-		bool active;
-		bool toggle[2];
-	} colon;
-};
-
-#endif /* _GMT_COMMON_H */
diff --git a/src/gmt/gmt_config.h b/src/gmt/gmt_config.h
deleted file mode 100644
index e69de29..0000000
diff --git a/src/gmt/gmt_constants.h b/src/gmt/gmt_constants.h
deleted file mode 100644
index ccac745..0000000
--- a/src/gmt/gmt_constants.h
+++ /dev/null
@@ -1,224 +0,0 @@
-/*--------------------------------------------------------------------
- *	$Id: gmt_constants.h 2242 2015-05-16 05:21:28Z caress $
- *
- *	Copyright (c) 1991-2015 by P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis and F. Wobbe
- *	See LICENSE.TXT file for copying and redistribution conditions.
- *
- *	This program is free software; you can redistribute it and/or modify
- *	it under the terms of the GNU Lesser General Public License as published by
- *	the Free Software Foundation; version 3 or any later version.
- *
- *	This program is distributed in the hope that it will be useful,
- *	but WITHOUT ANY WARRANTY; without even the implied warranty of
- *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *	GNU Lesser General Public License for more details.
- *
- *	Contact info: gmt.soest.hawaii.edu
- *--------------------------------------------------------------------*/
-/*
- * gmt_constants.h contains definitions of constants used throught GMT.
- *
- * Author:	Paul Wessel
- * Date:	01-OCT-2009
- * Version:	5 API
- */
-
-#ifndef _GMT_CONSTANTS_H
-#define _GMT_CONSTANTS_H
-
-/*=====================================================================================
- *	GMT API CONSTANTS DEFINITIONS
- *===================================================================================*/
-
-#include "gmt_error_codes.h"			/* All API error codes are defined here */
-#include "gmt_define.h"			/* All constant values are defined here */
-
-/*--------------------------------------------------------------------
- *			GMT CONSTANTS MACRO DEFINITIONS
- *--------------------------------------------------------------------*/
-
-#ifndef TWO_PI
-#define TWO_PI        6.28318530717958647692
-#endif
-#ifndef M_PI
-#define M_PI          3.14159265358979323846
-#endif
-#ifndef M_PI_2
-#define M_PI_2          1.57079632679489661923
-#endif
-#ifndef M_PI_4
-#define M_PI_4          0.78539816339744830962
-#endif
-#ifndef M_E
-#define	M_E		2.7182818284590452354
-#endif
-#ifndef M_SQRT2
-#define	M_SQRT2		1.41421356237309504880
-#endif
-#ifndef M_LN2_INV
-#define	M_LN2_INV	(1.0 / 0.69314718055994530942)
-#endif
-#ifndef M_EULER
-#define M_EULER		0.577215664901532860606512	/* Euler's constant (gamma) */
-#endif
-
-#define GMT_CONV8_LIMIT	1.0e-8		/* Fairly tight convergence limit or "close to zero" limit */
-#define GMT_CONV6_LIMIT 1.0e-6		/* 1 ppm */
-#define GMT_CONV4_LIMIT	1.0e-4		/* Less tight convergence limit or "close to zero" limit */
-
-/* Various allocation-length parameters */
-enum GMT_enum_length {
-	GMT_TINY_CHUNK  = 8U,
-	GMT_SMALL_CHUNK = 64U,
-	GMT_CHUNK       = 2048U,
-	GMT_BIG_CHUNK   = 65536U,
-	GMT_LEN16	= 16U,		/* All strings used to format date/clock output must be this length */
-	GMT_LEN32  = 32U,          /* Small length of texts */
-	GMT_LEN64  = 64U,          /* Intermediate length of texts */
-	GMT_LEN128 = 128U,         /* Double of 64 */
-	GMT_LEN256 = 256U,         /* Max size of some text items */
-	GMT_MAX_COLUMNS = 4096U,        /* Limit on number of columns in data tables (not grids) */
-	GMT_BUFSIZ      = 4096U,        /* Size of char record for i/o */
-	GMT_MIN_MEMINC  = 1U,        /* E.g., 16 kb of 8-byte doubles */
-	GMT_MAX_MEMINC  = 67108864U};   /* E.g., 512 Mb of 8-byte doubles */
-
-/* The four plot length units [m just used internally] */
-enum GMT_enum_unit {
-	GMT_CM = 0,
-	GMT_INCH,
-	GMT_M,
-	GMT_PT};
-
-/* Handling of swap/no swap in i/o */
-enum GMT_swap_direction {
-	k_swap_none = 0,
-	k_swap_in,
-	k_swap_out};
-
-#define GMT_DIM_UNITS	"cip"		/* Plot dimensions in cm, inch, or point */
-#define GMT_LEN_UNITS2	"efkMnu"	/* Distances in meter, foot, survey foot, km, Mile, nautical mile */
-#define GMT_LEN_UNITS	"dmsefkMnu"	/* Distances in arc-{degree,minute,second} or meter, foot, km, Mile, nautical mile, survey foot */
-#define GMT_DIM_UNITS_DISPLAY	"c|i|p"			/* Same, used to display as options */
-#define GMT_LEN_UNITS_DISPLAY	"d|m|s|e|f|k|M|n|u"	/* Same, used to display as options */
-#define GMT_LEN_UNITS2_DISPLAY	"e|f|k|M|n|u"		/* Same, used to display as options */
-#define GMT_DEG2SEC_F	3600.0
-#define GMT_DEG2SEC_I	3600
-#define GMT_SEC2DEG	(1.0 / GMT_DEG2SEC_F)
-#define GMT_DEG2MIN_F	60.0
-#define GMT_DEG2MIN_I	60
-#define GMT_MIN2DEG	(1.0 / GMT_DEG2MIN_F)
-#define GMT_MIN2SEC_F	60.0
-#define GMT_MIN2SEC_I	60
-#define GMT_SEC2MIN	(1.0 / GMT_MIN2SEC_F)
-#define GMT_DAY2HR_F	24.0
-#define GMT_DAY2HR_I	24
-#define GMT_HR2DAY	(1.0 / GMT_DAY2HR_F)
-#define GMT_DAY2MIN_F	1440.0
-#define GMT_DAY2MIN_I	1440
-#define GMT_MIN2DAY	(1.0 / GMT_DAY2MIN_F)
-#define GMT_DAY2SEC_F	86400.0
-#define GMT_DAY2SEC_I	86400
-#define GMT_SEC2DAY	(1.0 / GMT_DAY2SEC_F)
-#define GMT_HR2SEC_F	3600.0
-#define GMT_HR2SEC_I	3600
-#define GMT_SEC2HR	(1.0 / GMT_HR2SEC_F)
-#define GMT_HR2MIN_F	60.0
-#define GMT_HR2MIN_I	60
-#define GMT_MIN2HR	(1.0 / GMT_HR2MIN_F)
-
-#define GMT_YR2SEC_F	(365.2425 * 86400.0)
-#define GMT_MON2SEC_F	(365.2425 * 86400.0 / 12.0)
-
-#define GMT_DEC_SIZE	0.54	/* Size of a decimal number compared to point size */
-#define GMT_PER_SIZE	0.30	/* Size of a decimal point compared to point size */
-
-#define GMT_PEN_LEN	128
-#define GMT_PENWIDTH	0.25	/* Default pen width in points */
-
-/* Various options for FFT calculations [Default is 0] */
-enum FFT_implementations {
-	k_fft_auto = 0,    /* Automatically select best FFT algorithm */
-	k_fft_accelerate,  /* Select Accelerate Framework vDSP FFT [OS X only] */
-	k_fft_fftw,        /* Select FFTW */
-	k_fft_kiss,        /* Select Kiss FFT (always available) */
-	k_fft_brenner,     /* Select Brenner FFT (Legacy*/
-	k_n_fft_algorithms /* Number of FFT implementations available in GMT */
-};
-
-/* Various algorithms for triangulations */
-enum GMT_enum_tri {
-	GMT_TRIANGLE_WATSON = 0, /* Select Watson's algorithm */
-	GMT_TRIANGLE_SHEWCHUK};  /* Select Shewchuk's algorithm */
-
-/* Various 1-D interpolation modes */
-enum GMT_enum_spline {
-	GMT_SPLINE_LINEAR = 0, /* Linear spline */
-	GMT_SPLINE_AKIMA,      /* Akima spline */
-	GMT_SPLINE_CUBIC,      /* Cubic spline */
-	GMT_SPLINE_NONE};      /* No spline set */
-
-enum GMT_enum_extrap {
-	GMT_EXTRAPOLATE_NONE = 0,   /* No extrapolation; set to NaN outside bounds */
-	GMT_EXTRAPOLATE_SPLINE,     /* Let spline extrapolate beyond bounds */
-	GMT_EXTRAPOLATE_CONSTANT};  /* Set extrapolation beyond bound to specifiec constant */
-
-/* Timer reporting modes */
-enum GMT_enum_timer {
-	GMT_NO_TIMER = 0,	/* No timer reported */
-	GMT_ABS_TIMER,		/* Report absolute time */
-	GMT_ELAPSED_TIMER};	/* Report elapsed time since start of session */
-
-/* Various line/grid/image interpolation modes */
-enum GMT_enum_track {
-	GMT_TRACK_FILL = 0,	/* Normal fix_up_path behavior: Keep all (x,y) points but add intermediate if gap > cutoff */
-	GMT_TRACK_FILL_M,	/* Fill in, but navigate via meridians (y), then parallels (x) */
-	GMT_TRACK_FILL_P,	/* Fill in, but navigate via parallels (x), then meridians (y) */
-	GMT_TRACK_SAMPLE_FIX,	/* Resample the track at equidistant points; old points may be lost. Use given spacing */
-	GMT_TRACK_SAMPLE_ADJ};	/* Resample the track at equidistant points; old points may be lost. Adjust spacing to fit length of track exactly */
-
-enum GMT_enum_bcr {
-	BCR_NEARNEIGHBOR = 0, /* Nearest neighbor algorithm */
-	BCR_BILINEAR,         /* Bilinear spline */
-	BCR_BSPLINE,          /* B-spline */
-	BCR_BICUBIC};         /* Bicubic spline */
-
-/* Various grid/image boundary conditions */
-enum GMT_enum_bc {
-	GMT_BC_IS_NOTSET = 0, /* BC not yet set */
-	GMT_BC_IS_NATURAL,    /* Use natural BC */
-	GMT_BC_IS_PERIODIC,   /* Use periodic BC */
-	GMT_BC_IS_GEO,        /* Geographic BC condition */
-	GMT_BC_IS_DATA};      /* Fill in BC with actual data */
-
-enum GMT_enum_radius {	/* Various "average" radii for an ellipsoid with axes a,a,b */
-	GMT_RADIUS_MEAN = 0,	/* Mean radius IUGG R_1 = (2*a+b)/3 = a (1 - f/3) */
-	GMT_RADIUS_AUTHALIC,	/* Authalic radius 4*pi*r^2 = surface area of ellipsoid, R_2 = sqrt (0.5a^2 + 0.5b^2 (tanh^-1 e)/e) */
-	GMT_RADIUS_VOLUMETRIC,	/* Volumetric radius 3/4*pi*r^3 = volume of ellipsoid, R_3 = (a*a*b)^(1/3) */
-	GMT_RADIUS_MERIDIONAL,	/* Meridional radius, M_r = [(a^3/2 + b^3/2)/2]^2/3 */
-	GMT_RADIUS_QUADRATIC};	/* Quadratic radius, Q_r = 1/2 sqrt (3a^2 + b^2) */
-
-enum GMT_enum_latswap {GMT_LATSWAP_NONE = -1,	/* Deactivate latswapping */
-	GMT_LATSWAP_G2A = 0,	/* input = geodetic;   output = authalic   */
-	GMT_LATSWAP_A2G,	/* input = authalic;   output = geodetic   */
-	GMT_LATSWAP_G2C,	/* input = geodetic;   output = conformal  */
-	GMT_LATSWAP_C2G,	/* input = conformal;  output = geodetic   */
-	GMT_LATSWAP_G2M,	/* input = geodetic;   output = meridional */
-	GMT_LATSWAP_M2G,	/* input = meridional; output = geodetic   */
-	GMT_LATSWAP_G2O,	/* input = geodetic;   output = geocentric */
-	GMT_LATSWAP_O2G,	/* input = geocentric; output = geodetic   */
-	GMT_LATSWAP_G2P,	/* input = geodetic;   output = parametric */
-	GMT_LATSWAP_P2G,	/* input = parametric; output = geodetic   */
-	GMT_LATSWAP_O2P,	/* input = geocentric; output = parametric */
-	GMT_LATSWAP_P2O,	/* input = parametric; output = geocentric */
-	GMT_LATSWAP_N};		/* number of defined swaps  */
-
-/* Help us with big and little endianness */
-#ifdef WORDS_BIGENDIAN
-#define GMT_BIGENDIAN	true
-#define GMT_ENDIAN		'B'
-#else
-#define GMT_BIGENDIAN	false
-#define GMT_ENDIAN		'L'
-#endif
-
-#endif  /* _GMT_CONSTANTS_H */
diff --git a/src/gmt/gmt_contour.h b/src/gmt/gmt_contour.h
deleted file mode 100644
index 784cbc4..0000000
--- a/src/gmt/gmt_contour.h
+++ /dev/null
@@ -1,158 +0,0 @@
-/*--------------------------------------------------------------------
- *	$Id: gmt_contour.h 2242 2015-05-16 05:21:28Z caress $
- *
- *	Copyright (c) 1991-2015 by P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis and F. Wobbe
- *	See LICENSE.TXT file for copying and redistribution conditions.
- *
- *	This program is free software; you can redistribute it and/or modify
- *	it under the terms of the GNU Lesser General Public License as published by
- *	the Free Software Foundation; version 3 or any later version.
- *
- *	This program is distributed in the hope that it will be useful,
- *	but WITHOUT ANY WARRANTY; without even the implied warranty of
- *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *	GNU Lesser General Public License for more details.
- *
- *	Contact info: gmt.soest.hawaii.edu
- *--------------------------------------------------------------------*/
-/* gmt_contour.h - structures and variables needed for contour labels.
-
-   Author:	Paul Wessel
-   Date:	1 JAN 2010
-   Version:	5 API
-
-   This include file defines structures and functions used.
-*/
-
-#ifndef _GMT_CONTOUR_H
-#define _GMT_CONTOUR_H
-
-/* Various settings for contour label placements at crossing lines */
-enum GMT_enum_contline {
-	GMT_CONTOUR_NONE = 0,	/* No contour/line crossing  */
-	GMT_CONTOUR_XLINE,	/* Contour labels where crossing straight lines (via key points) */
-	GMT_CONTOUR_XCURVE};	/* Contour labels where crossing arbitrary lines (via file) */
-
-/* Various settings for quoted line/contour label types */
-enum GMT_enum_label {
-	GMT_LABEL_IS_NONE = 0,	/* No contour/line crossing  */
-	GMT_LABEL_IS_CONSTANT,	/* Label is constant, given by +l<label> */
-	GMT_LABEL_IS_HEADER,	/* Label is taken from header, given by +Lh */
-	GMT_LABEL_IS_PDIST,	/* Label is computed from plot distances, via +Ld */
-	GMT_LABEL_IS_MDIST,	/* Label is computed from map distances, via +LD */
-	GMT_LABEL_IS_FFILE,	/* Label is taken from 3rd column in given file, via +Lf */
-	GMT_LABEL_IS_XFILE,	/* Label is taken from segment header in crossing file, via +Lx */
-	GMT_LABEL_IS_SEG,	/* Label is computed from segment number, via +Ln */
-	GMT_LABEL_IS_FSEG};	/* Label is computed from file and segment number, via +LN */
-
-struct GMT_XOVER {		/* Structure with info on all track cross-over */
-	double *x;		/* x or Longitude */
-	double *y;		/* y or Latitude */
-	double *xnode[2];	/* Decimal Node index at cross-over along track 1 and 2 */
-};
-
-struct GMT_XSEGMENT {
-	uint64_t start;		/* y-array index for minimum y endpoint */
-	uint64_t stop;		/* y-array index for maximum y endpoint */
-};
-
-struct GMT_LABEL {	/* Contains information on contour/lineation labels */
-	double x, y;		/* Point where label goes */
-	double angle;		/* Angle of text unless curved text */
-	double line_angle;	/* Angle of line at label unless curved text */
-	double dist;
-	double rgb[4];		/* Font rgb */
-	uint64_t node;		/* Node of label on the line */
-	int end;		/* If N is used then -1 is start, +1 is end label */
-	char *label;
-};
-
-struct GMT_CONTOUR_LINE {
-	uint64_t n;			/* Length of the contour */
-	unsigned int n_labels;		/* Number of labels; if 0 we just have a line segment */
-	bool annot;			/* true if we want labels */
-	double z;			/* Datum of this contour (z-value) */
-	double rgb[4];			/* Box rgb */
-	double *x, *y;			/* Coordinates of the contour */
-	struct GMT_PEN pen;		/* Pen for drawing contour */
-	struct GMT_LABEL *L;		/* Pointer to array of structures with labels */
-	char *name;			/* Contour name */
-};
-
-struct GMT_CONTOUR {
-	/* Control section */
-	double label_isolation;		/* Only have one label inside a circle of this radius */
-	double label_dist_spacing;	/* Min distance between labels */
-	double label_dist_frac;		/* Fraction of Min distance between labels offset for closed labels [0.25] */
-	double d_scale;			/* Scale to yield correct units */
-	double L_d_scale;		/* Scale to yield correct units for label content only*/
-	double min_radius;		/* Do not place labels if the radius of curvature drops below this value [0] */
-	double min_dist;		/* Do not place labels closer than this value [0] */
-	double slop;			/* slop distance in being close to points */
-	double *f_xy[2];		/* Array for fixed points */
-	double label_angle;		/* For fixed-angle labels only */
-	double clearance[2];		/* Spacing between text and textbox */
-	double nudge[2];		/* Shift between calculated and desired text placement */
-	double rgb[4];			/* Opaque box fill */
-	uint64_t current_seg_no;	/* Number (0->) of current segment in current data file */
-	unsigned int current_file_no;	/* Number (0->) of current input data file */
-	unsigned int line_type;	/* Kind of line: contour (1) or line (0) */
-	unsigned int dist_kind;	/* What kind of distance [0 = xy, 1 = map ] */
-	unsigned int dist_unit;	/* Units for labelled distances along tracks [cip] */
-	unsigned int proj_type;	/* type of scaling */
-	unsigned int L_proj_type;	/* type of scaling for label content only */
-	unsigned int half_width;	/* Number of points to use in smoothing the angle [10/2] */
-	unsigned int n_cont;		/* Number of labels per segment */
-	enum GMT_enum_contline crossing;	/* 1 for crossing simple lines, 2 for file with crossing lines */
-	enum GMT_enum_label label_type;	/* 0-7; see above for enums */
-	unsigned int nx;		/* Number of crossovers at any time */
-	unsigned int f_n;			/* Number of such points */
-	unsigned int clearance_flag;	/* 1 if spacing given in % of labelfont size, 0 otherwise */
-	unsigned int nudge_flag;	/* 0 if off, 1 if nudging relative to x/y axis, 2 if following local line coordinate system */
-	unsigned int box;		/* Textbox bits [1 = outline, 2 = rect box shape, 4 = rounded rect shape] */
-	unsigned int n_label;		/* Length of list */
-	unsigned int just;		/* Label justification */
-	unsigned int end_just[2];	/* Justification for end of lines */
-	unsigned int angle_type;	/* 0 = contour-parallel, 1 = contour-normal, 2 = fixed angle */
-	unsigned int n_segments;		/* The number of segments */
-	unsigned int save_labels;	/* 1 if we wish to save label locations to a text file, 2 if we wish to include label angles [1 = no angles] */
-	int number_placement;	/* How the n_cont labels are distributed [-1/0/+1]*/
-	int hill_label;		/* -1/+1 = make label readable when looking down/up gradient, 0 = no special treatment  */
-	bool annot;			/* true if we want labels */
-	bool isolate;		/* true if we have a limit on how close labels may appear (see below) */
-	bool spacing;		/* true if we have spacing constraints to apply */
-	bool number;			/* true if we have constraints on the number of labels to apply */
-	bool do_interpolate;		/* true if we must resample the crossing lines */
-	bool fixed;			/* true if we chose fixed positions */
-	bool fillbox;			/* true for filling the textbox, false for none */
-	bool must_clip;			/* true for transparent textbox, false for opaque */
-	bool curved_text;		/* true for text to follow curved lines */
-	bool no_gap;		/* Clip contour or not depends on label placement */
-	bool data_col;		/* true if there is data in the zz arrays passed, false if they are NULL */
-	bool debug;			/* true of we want to draw helper lines/points */
-	bool delay;			/* true of we want to delay the actual annotation plotting until later */
-	size_t n_alloc;			/* How many allocated so far */
-	char file[GMT_BUFSIZ];		/* File with crossing lines, if specified */
-	char option[GMT_BUFSIZ];	/* Copy of the option string */
-	char label[GMT_BUFSIZ];		/* Fixed label */
-	char label_file[GMT_BUFSIZ];	/* Output files for text dump of label locations */
-	char unit[GMT_LEN64];	/* Unit for labels */
-	char prefix[GMT_LEN64];	/* prefix for labels */
-	char line_name[16];		/* Name of line: contour or line */
-	char flag;			/* Char for the option key */
-	char **f_label;			/* Array for fixed labels */
-	struct GMT_FONT font_label;	/* Which font */
-	struct GMT_DATATABLE *xp;		/* Table with list of structures with crossing-line coordinates */
-	struct GMT_XSEGMENT *ylist_XP;	/* Sorted y-segments for crossing-lines */
-	struct GMT_XSEGMENT *ylist;	/* y-indices sorted in increasing order */
-	struct GMT_XOVER XC;		/* Structure with resulting crossovers */
-	struct GMT_PEN pen;		/* Pen for drawing textbox outline */
-	struct GMT_PEN line_pen;	/* Pen for drawing the contour line */
-	struct GMT_LABEL **L;		/* Pointers to sorted list of labels */
-	FILE *fp;			/* File pointer for writing labels and positions to text file */
-	/* Contour line section */
-	
-	struct GMT_CONTOUR_LINE **segment;	/* Array of segments */
-};
-
-#endif /* _GMT_CONTOUR_H */
diff --git a/src/gmt/gmt_core_module.h b/src/gmt/gmt_core_module.h
deleted file mode 100644
index 21f801e..0000000
--- a/src/gmt/gmt_core_module.h
+++ /dev/null
@@ -1,114 +0,0 @@
-/* $Id: gmt_core_module.h 2242 2015-05-16 05:21:28Z caress $
- *
- * Copyright (c) 2012-2015
- * by P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis, and F. Wobbe
- * See LICENSE.TXT file for copying and redistribution conditions.
- */
-
-/* gmt_core_module.h declares the prototypes for core module functions
- * and the array that contains core GMT module parameters such as name
- * and purpose strings.
- * DO NOT edit this file directly! Instead edit 
- * and regenerate this file with gmt_make_module_src.sh core. */
-
-#pragma once
-#ifndef _GMT_CORE_MODULE_H
-#define _GMT_CORE_MODULE_H
-
-#ifdef __cplusplus /* Basic C++ support */
-extern "C" {
-#endif
-
-/* Declaration modifiers for DLL support (MSC et al) */
-#include "declspec.h"
-
-/* Prototypes of all modules in the GMT core library */
-EXTERN_MSC int GMT_blockmean (void *API, int mode, void *args);
-EXTERN_MSC int GMT_blockmedian (void *API, int mode, void *args);
-EXTERN_MSC int GMT_blockmode (void *API, int mode, void *args);
-EXTERN_MSC int GMT_filter1d (void *API, int mode, void *args);
-EXTERN_MSC int GMT_fitcircle (void *API, int mode, void *args);
-EXTERN_MSC int GMT_gmt2kml (void *API, int mode, void *args);
-EXTERN_MSC int GMT_gmtconnect (void *API, int mode, void *args);
-EXTERN_MSC int GMT_gmtconvert (void *API, int mode, void *args);
-EXTERN_MSC int GMT_gmtdefaults (void *API, int mode, void *args);
-EXTERN_MSC int GMT_gmtget (void *API, int mode, void *args);
-EXTERN_MSC int GMT_gmtinfo (void *API, int mode, void *args);
-EXTERN_MSC int GMT_gmtmath (void *API, int mode, void *args);
-EXTERN_MSC int GMT_gmtselect (void *API, int mode, void *args);
-EXTERN_MSC int GMT_gmtset (void *API, int mode, void *args);
-EXTERN_MSC int GMT_gmtsimplify (void *API, int mode, void *args);
-EXTERN_MSC int GMT_gmtspatial (void *API, int mode, void *args);
-EXTERN_MSC int GMT_gmtvector (void *API, int mode, void *args);
-EXTERN_MSC int GMT_gmtwhich (void *API, int mode, void *args);
-EXTERN_MSC int GMT_grd2cpt (void *API, int mode, void *args);
-EXTERN_MSC int GMT_grd2rgb (void *API, int mode, void *args);
-EXTERN_MSC int GMT_grd2xyz (void *API, int mode, void *args);
-EXTERN_MSC int GMT_grdblend (void *API, int mode, void *args);
-EXTERN_MSC int GMT_grdclip (void *API, int mode, void *args);
-EXTERN_MSC int GMT_grdcontour (void *API, int mode, void *args);
-EXTERN_MSC int GMT_grdcut (void *API, int mode, void *args);
-EXTERN_MSC int GMT_grdedit (void *API, int mode, void *args);
-EXTERN_MSC int GMT_grdfft (void *API, int mode, void *args);
-EXTERN_MSC int GMT_grdfilter (void *API, int mode, void *args);
-EXTERN_MSC int GMT_grdgradient (void *API, int mode, void *args);
-EXTERN_MSC int GMT_grdhisteq (void *API, int mode, void *args);
-EXTERN_MSC int GMT_grdimage (void *API, int mode, void *args);
-EXTERN_MSC int GMT_grdinfo (void *API, int mode, void *args);
-EXTERN_MSC int GMT_grdlandmask (void *API, int mode, void *args);
-EXTERN_MSC int GMT_grdmask (void *API, int mode, void *args);
-EXTERN_MSC int GMT_grdmath (void *API, int mode, void *args);
-EXTERN_MSC int GMT_grdpaste (void *API, int mode, void *args);
-EXTERN_MSC int GMT_grdproject (void *API, int mode, void *args);
-EXTERN_MSC int GMT_grdraster (void *API, int mode, void *args);
-EXTERN_MSC int GMT_grdreformat (void *API, int mode, void *args);
-EXTERN_MSC int GMT_grdsample (void *API, int mode, void *args);
-EXTERN_MSC int GMT_grdtrack (void *API, int mode, void *args);
-EXTERN_MSC int GMT_grdtrend (void *API, int mode, void *args);
-EXTERN_MSC int GMT_grdvector (void *API, int mode, void *args);
-EXTERN_MSC int GMT_grdview (void *API, int mode, void *args);
-EXTERN_MSC int GMT_grdvolume (void *API, int mode, void *args);
-EXTERN_MSC int GMT_greenspline (void *API, int mode, void *args);
-EXTERN_MSC int GMT_kml2gmt (void *API, int mode, void *args);
-EXTERN_MSC int GMT_makecpt (void *API, int mode, void *args);
-EXTERN_MSC int GMT_mapproject (void *API, int mode, void *args);
-EXTERN_MSC int GMT_nearneighbor (void *API, int mode, void *args);
-EXTERN_MSC int GMT_project (void *API, int mode, void *args);
-EXTERN_MSC int GMT_ps2raster (void *API, int mode, void *args);
-EXTERN_MSC int GMT_psbasemap (void *API, int mode, void *args);
-EXTERN_MSC int GMT_psclip (void *API, int mode, void *args);
-EXTERN_MSC int GMT_pscoast (void *API, int mode, void *args);
-EXTERN_MSC int GMT_pscontour (void *API, int mode, void *args);
-EXTERN_MSC int GMT_pshistogram (void *API, int mode, void *args);
-EXTERN_MSC int GMT_psimage (void *API, int mode, void *args);
-EXTERN_MSC int GMT_pslegend (void *API, int mode, void *args);
-EXTERN_MSC int GMT_psmask (void *API, int mode, void *args);
-EXTERN_MSC int GMT_psrose (void *API, int mode, void *args);
-EXTERN_MSC int GMT_psscale (void *API, int mode, void *args);
-EXTERN_MSC int GMT_pstext (void *API, int mode, void *args);
-EXTERN_MSC int GMT_pswiggle (void *API, int mode, void *args);
-EXTERN_MSC int GMT_psxyz (void *API, int mode, void *args);
-EXTERN_MSC int GMT_psxy (void *API, int mode, void *args);
-EXTERN_MSC int GMT_read (void *API, int mode, void *args);
-EXTERN_MSC int GMT_sample1d (void *API, int mode, void *args);
-EXTERN_MSC int GMT_spectrum1d (void *API, int mode, void *args);
-EXTERN_MSC int GMT_sph2grd (void *API, int mode, void *args);
-EXTERN_MSC int GMT_sphdistance (void *API, int mode, void *args);
-EXTERN_MSC int GMT_sphinterpolate (void *API, int mode, void *args);
-EXTERN_MSC int GMT_sphtriangulate (void *API, int mode, void *args);
-EXTERN_MSC int GMT_splitxyz (void *API, int mode, void *args);
-EXTERN_MSC int GMT_surface (void *API, int mode, void *args);
-EXTERN_MSC int GMT_trend1d (void *API, int mode, void *args);
-EXTERN_MSC int GMT_trend2d (void *API, int mode, void *args);
-EXTERN_MSC int GMT_triangulate (void *API, int mode, void *args);
-EXTERN_MSC int GMT_write (void *API, int mode, void *args);
-EXTERN_MSC int GMT_xyz2grd (void *API, int mode, void *args);
-
-/* Pretty print all modules in the GMT core library and their purposes */
-EXTERN_MSC void gmt_core_module_show_all (void *API);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* !_GMT_CORE_MODULE_H */
diff --git a/src/gmt/gmt_crossing.h b/src/gmt/gmt_crossing.h
deleted file mode 100644
index 0a42a68..0000000
--- a/src/gmt/gmt_crossing.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/*--------------------------------------------------------------------
- *	$Id: gmt_crossing.h 13846 2014-12-28 21:46:54Z pwessel $
- *
- *	Copyright (c) 1991-2015 by P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis and F. Wobbe
- *	See LICENSE.TXT file for copying and redistribution conditions.
- *
- *	This program is free software; you can redistribute it and/or modify
- *	it under the terms of the GNU Lesser General Public License as published by
- *	the Free Software Foundation; version 3 or any later version.
- *
- *	This program is distributed in the hope that it will be useful,
- *	but WITHOUT ANY WARRANTY; without even the implied warranty of
- *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *	GNU Lesser General Public License for more details.
- *
- *	Contact info: gmt.soest.hawaii.edu
- *--------------------------------------------------------------------*/
-/*
- * gmt_crossing.h contains definition of the structure for map crossings.
- *
- * Author:	Paul Wessel
- * Date:	01-OCT-2009
- * Version:	5 API
- */
-
-#ifndef _GMT_CROSSING_H
-#define _GMT_CROSSING_H
-
-/*--------------------------------------------------------------------
- *			GMT XINGS STRUCTURE DEFINITION
- *--------------------------------------------------------------------*/
-
-struct GMT_XINGS {
-        double xx[2], yy[2];    /* Cartesian coordinates of intersection with map boundary */
-        double angle[2];        /* Angles of intersection */
-        unsigned int sides[2];	/* Side id of intersection */
-        unsigned int nx;	/* Number of intersections (1 or 2) */
-};
-
-#endif  /* _GMT_CROSSING_H */
diff --git a/src/gmt/gmt_customio.h b/src/gmt/gmt_customio.h
deleted file mode 100644
index 3464fa8..0000000
--- a/src/gmt/gmt_customio.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/*--------------------------------------------------------------------
- *	$Id: gmt_customio.h 13846 2014-12-28 21:46:54Z pwessel $
- *
- *	Copyright (c) 1991-2015 by P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis and F. Wobbe
- *	See LICENSE.TXT file for copying and redistribution conditions.
- *
- *	This program is free software; you can redistribute it and/or modify
- *	it under the terms of the GNU Lesser General Public License as published by
- *	the Free Software Foundation; version 3 or any later version.
- *
- *	This program is distributed in the hope that it will be useful,
- *	but WITHOUT ANY WARRANTY; without even the implied warranty of
- *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *	GNU Lesser General Public License for more details.
- *
- *	Contact info: gmt.soest.hawaii.edu
- *--------------------------------------------------------------------*/
- 
-/*
- * Include file for gmt_customio functions.
- *
- * Author:	Paul Wessel
- * Date:	1-JAN-2010
- * Version:	5 API
- *
- */
-
-#ifndef GMT_CUSTOMIO_H
-#define GMT_CUSTOMIO_H
-
-/* Definition for Sun rasterfiles [THESE MUST REMAIN int32_t]  */
-struct rasterfile {
-	int32_t magic;     /* magic number */
-	int32_t width;     /* width (pixels) of image */
-	int32_t height;    /* height (pixels) of image */
-	int32_t depth;     /* depth (1, 8, or 24 bits) of pixel */
-	int32_t length;    /* length (bytes) of image */
-	int32_t type;      /* type of file; see RT_* below */
-	int32_t maptype;   /* type of colormap; see RMT_* below */
-	int32_t maplength; /* length (bytes) of following map */
-	/* color map follows for maplength bytes, followed by image */
-};
-
-#define	RAS_MAGIC	0x59a66a95	/* Magic number for Sun rasterfile */
-#define EPS_MAGIC	0x25215053	/* Magic number for EPS file */
-#define RT_OLD		0		/* Old-style, unencoded Sun rasterfile */
-#define RT_STANDARD	1		/* Standard, unencoded Sun rasterfile */
-#define RT_BYTE_ENCODED	2		/* Run-length-encoded Sun rasterfile */
-#define RT_FORMAT_RGB	3		/* [X]RGB instead of [X]BGR Sun rasterfile */
-#define RMT_NONE	0		/* maplength is expected to be 0 */
-#define RMT_EQUAL_RGB	1		/* red[maplength/3], green[], blue[] follow */
-
-EXTERN_MSC char **GMT_grdformats_sorted (struct GMT_CTRL *Ctrl);
-
-#endif /* GMT_CUSTOMIO_H */
diff --git a/src/gmt/gmt_dcw.h b/src/gmt/gmt_dcw.h
deleted file mode 100644
index 6da86f4..0000000
--- a/src/gmt/gmt_dcw.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/*--------------------------------------------------------------------
- *	$Id: gmt_dcw.h 13846 2014-12-28 21:46:54Z pwessel $
- *
- *	Copyright (c) 1991-2015 by P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis and F. Wobbe
- *	See LICENSE.TXT file for copying and redistribution conditions.
- *
- *	This program is free software; you can redistribute it and/or modify
- *	it under the terms of the GNU Lesser General Public License as published by
- *	the Free Software Foundation; version 3 or any later version.
- *
- *	This program is distributed in the hope that it will be useful,
- *	but WITHOUT ANY WARRANTY; without even the implied warranty of
- *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *	GNU Lesser General Public License for more details.
- *
- *	Contact info: gmt.soest.hawaii.edu
- *--------------------------------------------------------------------*/
-/*
- * gmt_dwc.h contains definitions for using the DCW in GMT.
- * DCW - The Digital Chart of the World
- *
- * Author:	Paul Wessel
- * Date:	10-MAR-2013
- * Version:	5 API
- */
-
-#ifndef _GMT_DCW_H
-#define _GMT_DCW_H
-
-#define DCW_OPT "-F<code1,code2,...>[+l|L][+g<fill>][+p<pen>][+r|R[<incs>]]"
-
-enum GMT_DCW_modes {
-	GMT_DCW_REGION	= 1,
-	GMT_DCW_PLOT	= 2,
-	GMT_DCW_DUMP	= 4,
-	GMT_DCW_EXTRACT	= 8
-};
-
-struct GMT_DCW_SELECT {	/* -F<DWC-options> */
-	bool region;		/* Determine region from polygons instead of -R */
-	bool adjust;		/* Round/adjust the region from polygons using the incs */
-	bool extend;		/* Extend region rather than quantize it */
-	char *codes;		/* Comma separated list of codes with modifiers */
-	unsigned int mode;	/* 0 = get -R, 1 = paint, 2 = dump */
-	double inc[4];		/* Increments for rounded region */
-	struct GMT_PEN pen;	/* Pen for outline [no outline] */
-	struct GMT_FILL fill;	/* Fill for polygons */
-};
-
-EXTERN_MSC unsigned int GMT_DCW_list (struct GMT_CTRL *GMT, unsigned list_mode);
-EXTERN_MSC unsigned int GMT_DCW_parse (struct GMT_CTRL *GMT, char option, char *args, struct GMT_DCW_SELECT *F);
-EXTERN_MSC void GMT_DCW_option (struct GMTAPI_CTRL *API, char option, unsigned int plot);
-EXTERN_MSC struct GMT_DATASET * GMT_DCW_operation (struct GMT_CTRL *GMT, struct GMT_DCW_SELECT *F, double wesn[], unsigned int mode);
-
-#endif /* _GMT_DCW_H */
diff --git a/src/gmt/gmt_defaults.h b/src/gmt/gmt_defaults.h
deleted file mode 100644
index 09ca3e1..0000000
--- a/src/gmt/gmt_defaults.h
+++ /dev/null
@@ -1,170 +0,0 @@
-/*--------------------------------------------------------------------
- *	$Id: gmt_defaults.h 2242 2015-05-16 05:21:28Z caress $
- *
- *	Copyright (c) 1991-2015 by P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis and F. Wobbe
- *	See LICENSE.TXT file for copying and redistribution conditions.
- *
- *	This program is free software; you can redistribute it and/or modify
- *	it under the terms of the GNU Lesser General Public License as published by
- *	the Free Software Foundation; version 3 or any later version.
- *
- *	This program is distributed in the hope that it will be useful,
- *	but WITHOUT ANY WARRANTY; without even the implied warranty of
- *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *	GNU Lesser General Public License for more details.
- *
- *	Contact info: gmt.soest.hawaii.edu
- *--------------------------------------------------------------------*/
-/*
- * gmt_defaults.h contains definition of the structure with default settings.
- *
- * Author:	Paul Wessel
- * Date:	01-OCT-2009
- * Version:	5 API
- */
-
-#ifndef _GMT_DEFAULTS_H
-#define _GMT_DEFAULTS_H
-
-/*--------------------------------------------------------------------
- *			GMT DEFAULTS STRUCTURE DEFINITION
- *--------------------------------------------------------------------*/
-
-struct ELLIPSOID {	/* Information about a particular ellipsoid */
-	/* Table taken from Snyder "Map projection - a working manual", p 12 Table 1 */
-	char name[GMT_LEN64];
-	int date;
-	double eq_radius;
-	double flattening;
-};
-
-struct DATUM {	/* Information about a particular datum */
-	char name[GMT_LEN64];	/* Datum name */
-	char ellipsoid[GMT_LEN64];	/* Ellipsoid GMT ID name */
-	char region[GMT_LEN256];	/* Region of use */
-	double xyz[3];		/* Coordinate shifts in meter for x, y, and z */
-};
-
-struct gmt_encoding {
-	char name[GMT_LEN64];
-	int code[5]; /* Codes for symbols we print. */
-};
-
-struct GMT_DEFAULTS {	/* Holds all variables directly controlled by GMT Default parameters */
-	/* COLOR group [sorted by type to optimize storage] */
-	unsigned int color_model;		/* 1 = read RGB, 2 = use RGB, 4 = read HSV, 8 = use HSV, 16 = read CMYK, 32 = use CMYK [1+2]
-									 * Add 128 to disallow output of color names */
-	double color_patch[3][4];		/* Color of background, foreground, nan [black,white,127.5] */
-	double color_hsv_min_s;			/* For smallest or most negative intensity [1.0] */
-	double color_hsv_max_s;			/* For largest or most positive intensity [0.1] */
-	double color_hsv_min_v;			/* For smallest or most negative intensity [0.3] */
-	double color_hsv_max_v;			/* For largest or most positive intensity [1.0] */
-	/* DIR group */
-	/* FONT group */
-	struct GMT_FONT font_annot[2];		/* Font for primary and secondary annotations [14p|16p,Helvetica,black] */
-	struct GMT_FONT font_label;		/* Font for labels [24p,Helvetica,black] */
-	struct GMT_FONT font_logo;		/* Font for GMT logo [8p,Helvetica,black] */
-	struct GMT_FONT font_title;		/* Font for headers [36p,Helvetica,black] */
-	/* FORMAT group */
-	char format_clock_in[GMT_LEN64];	/* How to decode an incoming clock string [hh:mm:ss] */
-	char format_clock_out[GMT_LEN64];	/* Controls how clocks are written on output [hh:mm:ss] */
-	char format_clock_map[GMT_LEN64];	/* Controls how clocks are plotted on maps [hh:mm:ss] */
-	char format_date_in[GMT_LEN64];	/* How to decode an incoming date string [yyyy-mm-dd] */
-	char format_date_out[GMT_LEN64];	/* Controls how dates are written on output [yyyy-mm-dd] */
-	char format_date_map[GMT_LEN64];	/* Controls how dates are plotted on maps [yyyy-mm-dd] */
-	char format_geo_out[GMT_LEN64];	/* Controls how degrees are written on output [000 = dd.xxxx] */
-	char format_geo_map[GMT_LEN64];	/* Controls how degrees are plotted on maps [020 = dd:mm:ss as in old DEGREE_FORMAT = 0] */
-	char format_float_out[GMT_LEN64];	/* Default double output format [%g] */
-	char format_float_map[GMT_LEN64];	/* Default double plot format [%g] */
-	char format_time[2][GMT_LEN64];	/* Controls annotation format for Months/Weeks/Weekdays for primary and secondary axes */
-	char format_time_stamp[GMT_LEN256];	/* Specify the format for writing time stamps (see strftime) */
-	/* GMT group */
-	unsigned int compatibility; /* Choose between 4 (GMT4) and up to latest version (5 for now) */
-	unsigned int interpolant; /* Choose between 0 (Linear), 1 (Akima), or 2 (Cubic spline) */
-	unsigned int triangulate; /* 0 for Watson [Default], 1 for Shewchuk (if configured) */
-	unsigned int verbose;     /* Level of verbosity 0-4 [1] */
-	unsigned int fft;         /* Any of FFT_implementations: k_fft_auto, k_fft_accelerate, k_fft_fftw3, k_fft_kiss, k_fft_brenner */
-#ifdef HAVE_FFTW3F
-	unsigned int fftw_plan;   /* Any of FFTW_planner_flags: FFTW_ESTIMATE, FFTW_MEASURE, FFTW_PATIENT, FFTW_EXHAUSTIVE */
-#ifdef HAVE_FFTW3F_THREADS
-	bool fftwf_threads;   /* Any of FFTW_planner_flags: FFTW_ESTIMATE, FFTW_MEASURE, FFTW_PATIENT, FFTW_EXHAUSTIVE */
-#endif
-#endif
-	unsigned int history;     /* mode to pass information via history file gmt.history (k_history_off, k_history_read, k_history_write) */
-	double extrapolate_val[2];/* Choose between [0] = 0, 1D extrapolated vals are NaN, = 1 -> extrapolate, = 2 -> set to const stored in [1] */
-	/* IO group */
-	uint64_t n_bin_header_cols;		/* Minimum number of columns in a binary file for which the all cols == NaN means segment header [2] */
-	unsigned int io_n_header_items;		/* Number of header records expected when -h is used [1]; else 0 */
-	unsigned int io_nan_mode;		/* -s: 1 means skip NaN (x,y) records on output, 2 = inverse (only output nan-records; -sr), 0 reports all records */
-	size_t io_nc4_chunksize[2]; /* NetCDF chunk size (lat,lon) on output [0] */
-	unsigned int io_nc4_deflation_level;	/* NetCDF deflation level on output [0] */
-	bool io_gridfile_shorthand;		/* Use shorthand suffix notation for embedded grid file formats [false] */
-	bool io_header[2];			/* Input & Output data has header records [false, false] */
-	bool io_nan_records;			/* Determines what NaNs in input records should mean (beyond skipping the record) */
-	bool io_lonlat_toggle[2];		/* true means read/write I/O as lat/lon instead of lon/lat [false,false] */
-	bool io_blankline[2];		/* true means blank lines should be treated as segment breaks [false,false] */
-	bool io_nanline[2];			/* true means lines with all NaNs should be treated as segment breaks [false,false] */
-	char io_col_separator[8];		/* Separator between output ascii data columns [tab] */
-	char io_gridfile_format[GMT_LEN64];	/* Default grid file format */
-	char io_seg_marker[2];			/* Character used to recognize and write segment headers [>,>] */
-	/* MAP group */
-	double map_annot_offset[2];		/* Distance between primary or secondary annotation and tickmarks [5p/5p] */
-	double map_annot_min_angle;		/* If angle between map boundary and annotation is less, no annotation is drawn [20] */
-	double map_annot_min_spacing;		/* If an annotation is closer that this to an older annotation, the annotation is skipped [0.0] */
-	double map_frame_width;			/* Thickness of fancy map frame [5p] */
-	double map_grid_cross_size[2];		/* Size of primary & secondary gridcrosses.  0 means draw continuous gridlines */
-	double map_label_offset;		/* Distance between lowermost annotation and top of label [8p] */
-	double map_line_step;			/* Maximum straight linesegment length for arcuate lines [0.75p] */
-	double map_logo_pos[2];			/* Where to plot timestamp relative to origin [BL/-54p/-54p] */
-	double map_origin[2];			/* x- and y-origin of plot, i.e. where lower left corner plots on paper [1i/1i] */
-	double map_polar_cap[2];		/* Latitude of polar cap and delta_lon for gridline spacing [85/90] */
-	double map_scale_height;		/* Height of map scale drawn on a map [0.075] */
-	double map_tick_length[4];			/* Length of primary and secondary major and minor tickmarks [5p/2.5p/15p/3.75p] */
-	double map_title_offset;		/* Distance between lowermost annotation (or label) and base of plot title [14p] */
-	double map_vector_shape;		/* 0.0 = straight vectorhead, 1.0 = arrowshape, with continuous range in between */
-	unsigned int map_annot_oblique;	/* Controls annotations and tick angles etc. [0] */
-	unsigned int map_logo_justify;		/* Justification of the GMT timestamp box [1 (BL)] */
-	unsigned int map_frame_type;		/* Fancy (0), plain (1), or graph (2) [0] */
-	bool map_logo;			/* Plot time and map projection on map [false] */
-	struct GMT_PEN map_default_pen;		/* Default pen for most pens [0.25p] */
-	struct GMT_PEN map_frame_pen;		/* Pen attributes for map boundary [1.25p] */
-	struct GMT_PEN map_grid_pen[2];		/* Pen attributes for primary and secondary gridlines [default,black/thinner,black] */
-	struct GMT_PEN map_tick_pen[2];		/* Pen attributes for primary and secondary tickmarks [thinner,black] */
-	char map_frame_axes[6];			/* Which axes to draw and annotate ["WESNZ"]  */
-	char map_annot_ortho[6];		/* Which axes have orthogonal annotations in linear projections ["we"] */
-	enum GMT_enum_symbol { gmt_none = -1, gmt_ring, gmt_degree, gmt_colon, gmt_squote, gmt_dquote, gmt_lastsym } map_degree_symbol;
-	/* PROJ group */
-	double proj_scale_factor;		/* Central mapscale factor, typically 0.9996-1 (or -1 for default action) */
-	unsigned int proj_ellipsoid;		/* Which ellipsoid to use [0 = GRS 80] */
-	unsigned int proj_length_unit;	/* Choose 0 (cm), 1 (inch), 2 (m) or 3 (point) [1] */
-	enum GMT_enum_radius proj_mean_radius;	/* Choose 0 (mean), 1 (authalic), 2 (volumetric), 3 (meridional) or 4 (quadratic) [0] */
-	enum GMT_enum_latswap proj_aux_latitude;	/* Choose GMT_LATSWAP_NONE, GMT_LATSWAP_G2A, GMT_LATSWAP_G2C, GMT_LATSWAP_G2M, GMT_LATSWAP_G2O, GMT_LATSWAP_G2P [GMT_LATSWAP_NONE] */
-	struct DATUM proj_datum[GMT_N_DATUMS];	/* Datum parameters */
-	struct ELLIPSOID ref_ellipsoid[GMT_N_ELLIPSOIDS];	/* Ellipsoid parameters */
-	/* PS group [These are arguments to pass to PSL_beginsession and PSL_setdefaults] */
-	/* [All other internal PSL settings are set directly when parsing PSL settings ] */
-	double ps_page_size[2];			/* Width and height of paper to plot on in points [Letter or A4] */
-	double ps_page_rgb[4];			/* Default paper color [white] */
-	double ps_magnify[2];			/* Width and height of paper to plot on in points [Letter or A4] */
-	double ps_transparency;			/* Later transparency [0] */
-	unsigned int ps_color_mode;		/* Postscript encoding of color [PSL_RGB | PSL_CMYK | PSL_HSV | PSL_GRAY] */
-	unsigned int ps_copies;		/* How man copies of each plot [>=1] [GMT4 COMPATIBILITY ONLY] */
-	int ps_media;			/* Default paper media [25(Letter)]; negative if custom size */
-	bool ps_orientation;			/* Orientation of page [false = Landscape, true = Portrait] */
-	bool ps_comments;			/* true if we write comments in the PS file */
-	char ps_transpmode[16];			/* Transparency mode for PDF only */
-	struct gmt_encoding ps_encoding;
-	/* TIME group */
-	enum GMT_enum_timer timer_mode;	/* Choose GMT_NO_TIMER, GMT_ABS_TIMER, GMT_ELAPSED_TIMER [GMT_NO_TIMER] */
-	double time_interval_fraction;		/* How much of a partial interval is needed in order to annotate it */
-	bool time_is_interval;		/* Does a time given as a month (or year or day) mean the middle of the interval? */
-	bool time_leap_seconds;		/* Do we need to worry about leap seconds? */
-	unsigned int time_week_start;		/* Which day (Sun = 0, Sat = 7) is start of week */
-	unsigned int time_Y2K_offset_year;	/* Cutoff for making 4-digit years from 2-digit years (1900 vs 2000) */
-	struct GMT_TIME_SYSTEM time_system;	/* All the information about the selected time system */
-	char time_language[GMT_LEN64];	/* Language file for time support */
-	/* Related parameters */
-	char given_unit[GMT_N_KEYS];		/* Unit given or implied for each setting */
-};
-
-#endif  /* _GMT_DEFAULTS_H */
diff --git a/src/gmt/gmt_define.h b/src/gmt/gmt_define.h
deleted file mode 100644
index f99fcb8..0000000
--- a/src/gmt/gmt_define.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/*--------------------------------------------------------------------
- *	$Id: gmt_define.h 13846 2014-12-28 21:46:54Z pwessel $
- *
- *	Copyright (c) 1991-2015 by P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis and F. Wobbe
- *	See LICENSE.TXT file for copying and redistribution conditions.
- *
- *	This program is free software; you can redistribute it and/or modify
- *	it under the terms of the GNU Lesser General Public License as published by
- *	the Free Software Foundation; version 3 or any later version.
- *
- *	This program is distributed in the hope that it will be useful,
- *	but WITHOUT ANY WARRANTY; without even the implied warranty of
- *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *	GNU Lesser General Public License for more details.
- *
- *	Contact info: gmt.soest.hawaii.edu
- *--------------------------------------------------------------------*/
-
-#ifndef _GMT_DEFINE_H
-#define _GMT_DEFINE_H
-
-enum GMT_enum_api {
-	GMT_USAGE	= 0,	/* Want to report full program usage message */
-	GMT_SYNOPSIS	= 1,	/* Just want the synopsis of usage */
-	GMT_STR16	= 16	/* Bytes needed to hold the @GMTAPI at -###### resource names */
-};
-
-/* These data primitive identifiers are as follows: */
-enum GMT_enum_type {
-	GMT_CHAR = 0,  /* int8_t, 1-byte signed integer type */
-	GMT_UCHAR,     /* uint8_t, 1-byte unsigned integer type */
-	GMT_SHORT,     /* int16_t, 2-byte signed integer type */
-	GMT_USHORT,    /* uint16_t, 2-byte unsigned integer type */
-	GMT_INT,       /* int32_t, 4-byte signed integer type */
-	GMT_UINT,      /* uint32_t, 4-byte unsigned integer type */
-	GMT_LONG,      /* int64_t, 8-byte signed integer type */
-	GMT_ULONG,     /* uint64_t, 8-byte unsigned integer type */
-	GMT_FLOAT,     /* 4-byte data float type */
-	GMT_DOUBLE,    /* 8-byte data float type */
-	GMT_TEXT,      /* Arbitrarily long text string [OGR/GMT use only] */
-	GMT_DATETIME,  /* string with date/time info [OGR/GMT use only] */
-	GMT_N_TYPES};  /* The number of supported data types above */
-
-
-#endif /* _GMT_DEFINE_H */
diff --git a/src/gmt/gmt_dev.h b/src/gmt/gmt_dev.h
deleted file mode 100644
index 093f786..0000000
--- a/src/gmt/gmt_dev.h
+++ /dev/null
@@ -1,146 +0,0 @@
-/*--------------------------------------------------------------------
- *	$Id: gmt_dev.h 2244 2015-05-27 05:32:38Z caress $
- *
- *	Copyright (c) 1991-2015 by P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis and F. Wobbe
- *	See LICENSE.TXT file for copying and redistribution conditions.
- *
- *	This program is free software; you can redistribute it and/or modify
- *	it under the terms of the GNU Lesser General Public License as published by
- *	the Free Software Foundation; version 3 or any later version.
- *
- *	This program is distributed in the hope that it will be useful,
- *	but WITHOUT ANY WARRANTY; without even the implied warranty of
- *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *	GNU Lesser General Public License for more details.
- *
- *	Contact info: gmt.soest.hawaii.edu
- *--------------------------------------------------------------------*/
-/*
- * gmt_dev.h is the main include file for the main development of gmt.
- * It includes the API (gmt.h) and contains lower-level definitions
- * for several of the structures and parameters used by all libraries.
- * It also includes all of the other include files that are needed.
- *
- * Author:	Paul Wessel
- * Date:	01-AUG-2011
- * Version:	5 API
- */
-
-/* Note on data type:  GMT will generally use double precision for
- * all floating point values except for grids which are held in single
- * precision floats.  All integer values are standard int (presumably
- * 32-bit) except for quantities that may be very large, such as
- * counters of data records, which will be declared as uint64_t, and
- * variables that holds allocated number of bytes and similar, which
- * will be declared as size_t.  Occasionally, arrays of integer values
- * will be stored in smaller memory containers such as short int of
- * unsigned/signed char when the program logic places limits on their
- * possible ranges (e.g., true/false variables).
- */
-
-#pragma once
-#ifndef _GMT_DEV_H
-#define _GMT_DEV_H
-
-#ifdef __cplusplus	/* Basic C++ support */
-extern "C" {
-#endif
-
-/* Note: GMT functions will sometimes have arguments that are unused by design, i.e., to ensure that
- * a family of functions have the same number and type of arguments so that pointers to these functions
- * can be passed, even though in some cases not all arguments are used.  These will result in compiler
- * warnings [-Wunused-variable]. To suppress those (and only those), we can define GMT_UNUSED as this:
- */
-
-#define GMT_UNUSED(x) (void)(x)
-
-/* and then call GMT_UNUSED() on all such variables at the beginning of a routine. For example:
- * bool func (int x) { GMT_UNUSED(x); return(true); }
- * This should work for all compilers, GCC and others.
- * Just grep for GMT_UNUSED to see where these situations occur.
- */
-
-/* CMake definitions: This must be first! */
-//#include "gmt_config.h"
-
-/* Declaration modifiers for DLL support (MSC et al) */
-//#include "declspec.h"
-
-/* Declaration for PSL */
-#include "pslib.h"
-
-/*--------------------------------------------------------------------
- *      SYSTEM HEADER FILES
- *--------------------------------------------------------------------*/
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-#include <float.h>
-#include <math.h>
-#include <limits.h>
-
-#include <time.h>
-
-#include "common_math.h"     /* Shared math functions */
-#include "gmt.h"             /* All GMT high-level API */
-#include "gmt_private.h"     /* API declaration needed by libraries */
-
-struct GMT_CTRL; /* forward declaration of GMT_CTRL */
-
-//#include "gmt_notposix.h"       /* Non-POSIX extensions */
-
-#include "gmt_constants.h"      /* All basic constant definitions */
-#include "gmt_macros.h"         /* All basic macros definitions */
-#include "gmt_dimensions.h"     /* Constant definitions created by configure */
-#include "gmt_time.h"           /* Declarations of structures for dealing with time */
-#include "gmt_texture.h"        /* Declarations of structures for dealing with pen, fill, etc. */
-#include "gmt_defaults.h"       /* Declarations of structure for GMT default settings */
-#include "gmt_ps.h"             /* Declarations of structure for GMT PostScript settings */
-#include "gmt_hash.h"           /* Declarations of structure for GMT hashing */
-#include "gmt_crossing.h"       /* Declarations of structure for GMT map crossings */
-
-#ifdef HAVE_GDAL
-#	include "gmt_gdalread.h"      /* GDAL support */
-#endif
-
-#include "gmt_common.h"         /* For holding the GMT common option settings */
-#include "gmt_fft.h"            /* Structures and enums used by programs needing FFTs */
-#include "gmt_nan.h"            /* Machine-dependent macros for making and testing NaNs */
-#include "gmt_error.h"          /* Only contains error codes */
-#include "gmt_synopsis.h"       /* Only contains macros for synopsis lines */
-#include "gmt_version.h"        /* Only contains the current GMT version number */
-#include "gmt_core_module.h" 	/* Core module modes and properties */
-#include "gmt_supplements_module.h" 	/* Suppl module modes and properties */
-#include "gmt_project.h"        /* Define GMT->current.proj and GMT->current.map.frame structures */
-#include "gmt_grd.h"            /* Define grd file header structure */
-#include "gmt_grdio.h"          /* Defines function pointers for grd i/o operations */
-#include "gmt_io.h"             /* Defines structures and macros for table i/o */
-#include "gmt_colors.h"         /* Defines color/shading global structure */
-#include "gmt_shore.h"          /* Defines structures used when reading shore database */
-#include "gmt_dcw.h"            /* Defines structure and functions used when using DCW polygons */
-#include "gmt_calclock.h"       /* Calendar/time functions */
-#include "gmt_symbol.h"         /* Custom symbol functions */
-#include "gmt_contour.h"        /* Contour label structure and functions */
-#include "gmt_map.h"            /* extern functions defined in gmt_map.c */
-#include "gmt_plot.h"           /* extern functions defined in gmt_plot.c */
-#include "gmt_memory.h"         /* extern functions defined in gmt_memory.c */
-#include "gmt_support.h"        /* extern functions defined in gmt_support.c */
-#include "gmt_types.h"          /* GMT type declarations */
-
-//#ifdef _OPENMP                  /* Using open MP parallelization */
-//#include "omp.h"
-//#endif
-
-#include "gmt_prototypes.h"     /* All GMT low-level API */
-#include "gmt_init.h"           /* extern functions defined in gmt_init.c */
-#include "gmt_stat.h"           /* extern functions defined in gmt_stat.c */
-#include "common_string.h"      /* All code shared between GMT and PSL */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif  /* !_GMT_DEV_H */
diff --git a/src/gmt/gmt_dimensions.h b/src/gmt/gmt_dimensions.h
deleted file mode 100644
index 6a11535..0000000
--- a/src/gmt/gmt_dimensions.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * $Id: gmt_dimensions.h.in 13846 2014-12-28 21:46:54Z pwessel $
- *
- *  Copyright (c) 1991-2015 by P. Wessel, W. H. F. Smith, R. Scharroo,
- *  F. Wobbe, and J. Luis
- *
- * See LICENSE.TXT file for copying and redistribution conditions.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; version 3 or any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Lesser General Public License for more details.
- *
- * Contact info: gmt.soest.hawaii.edu
- */
-
-#define GMT_N_COLOR_NAMES 663 /* Lines in gmt_colornames.h */
-#define GMT_N_DATUMS      222 /* Lines in gmt_datums.h */
-#define GMT_N_ELLIPSOIDS  75 /* Lines in gmt_ellipsoids.h */
-#define GMT_N_KEYS        199 /* Lines in gmt_keywords.h */
-#define GMT_N_MEDIA       31 /* Lines in gmt_media_name.h */
-#define GMT_N_PEN_NAMES   12 /* Lines in gmt_pennames.h */
-#define GMT_N_UNIQUE      69 /* Lines in gmt_unique.h */
-
-/* vim: set ft=c: */
diff --git a/src/gmt/gmt_error.h b/src/gmt/gmt_error.h
deleted file mode 100644
index bfb9655..0000000
--- a/src/gmt/gmt_error.h
+++ /dev/null
@@ -1,139 +0,0 @@
-/*--------------------------------------------------------------------
- *	$Id: gmt_error.h 13846 2014-12-28 21:46:54Z pwessel $
- *
- *	Copyright (c) 1991-2015 by P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis and F. Wobbe
- *	See LICENSE.TXT file for copying and redistribution conditions.
- *
- *	This program is free software; you can redistribute it and/or modify
- *	it under the terms of the GNU Lesser General Public License as published by
- *	the Free Software Foundation; version 3 or any later version.
- *
- *	This program is distributed in the hope that it will be useful,
- *	but WITHOUT ANY WARRANTY; without even the implied warranty of
- *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *	GNU Lesser General Public License for more details.
- *
- *	Contact info: gmt.soest.hawaii.edu
- *--------------------------------------------------------------------*/
-
-/*
- * Include file for GMT error codes
- *
- * Author:	Paul Wessel
- * Date:	1-JAN-2010
- * Version:	5 API
- */
-
-#ifndef GMT_ERROR_H
-#define GMT_ERROR_H
-
-/* Grid i/o error codes */
-
-/* external array with error descriptions */
-EXTERN_MSC const char* g_error_string[];
-
-enum Gmt_error_code {
-	GMT_NOERROR_UNUSED=0,	/* The real GMT_NOERROR is declared in gmt_resources.h and is part of API */
-	GMT_GRDIO_NONUNIQUE_FORMAT,
-	GMT_GRDIO_UNKNOWN_FORMAT,
-	GMT_GRDIO_UNKNOWN_TYPE,
-	GMT_GRDIO_UNKNOWN_ID,
-	GMT_GRDIO_PIPE_CODECHECK,
-	GMT_GRDIO_DOMAIN_VIOLATION,
-	GMT_GRDIO_OPEN_FAILED,
-	GMT_GRDIO_CREATE_FAILED,
-	GMT_GRDIO_READ_FAILED,
-	GMT_GRDIO_WRITE_FAILED,
-	GMT_GRDIO_STAT_FAILED,
-	GMT_GRDIO_SEEK_FAILED,
-	GMT_GRDIO_FILE_NOT_FOUND,
-	GMT_GRDIO_BAD_VAL,
-	GMT_GRDIO_BAD_XINC,
-	GMT_GRDIO_BAD_XRANGE,
-	GMT_GRDIO_BAD_YINC,
-	GMT_GRDIO_BAD_YRANGE,
-	GMT_GRDIO_BAD_IMG_LAT,
-	GMT_GRDIO_NO_2DVAR,
-	GMT_GRDIO_NO_VAR,
-	GMT_GRDIO_BAD_DIM,
-	GMT_GRDIO_NC_NO_PIPE,
-	GMT_GRDIO_NOT_RAS,
-	GMT_GRDIO_NOT_8BIT_RAS,
-	GMT_GRDIO_NOT_SURFER,
-	GMT_GRDIO_SURF7_UNSUPPORTED,
-	GMT_GRDIO_GRD98_XINC,
-	GMT_GRDIO_GRD98_YINC,
-	GMT_GRDIO_GRD98_BADMAGIC,
-	GMT_GRDIO_GRD98_BADLENGTH,
-	GMT_GRDIO_ESRI_NONSQUARE,
-	GMT_GRDIO_RI_OLDBAD,
-	GMT_GRDIO_RI_NEWBAD,
-	GMT_GRDIO_RI_NOREPEAT,
-	GMT_IO_BAD_PLOT_DEGREE_FORMAT,
-	GMT_CHEBYSHEV_NEG_ORDER,
-	GMT_CHEBYSHEV_BAD_DOMAIN,
-	GMT_MAP_EXCEEDS_360,
-	GMT_MAP_BAD_ELEVATION_MIN,
-	GMT_MAP_BAD_ELEVATION_MAX,
-	GMT_MAP_BAD_LAT_MIN,
-	GMT_MAP_BAD_LAT_MAX,
-	GMT_MAP_NO_REGION,
-	GMT_MAP_NO_PROJECTION,
-	GMT_MAP_BAD_DIST_FLAG,
-	GMT_MAP_BAD_MEASURE_UNIT
-};
-
-/* Definition for an error trap */
-#ifdef DEBUG
-#define GMT_err_trap(func_call) if ((err = (func_call)) != GMT_NOERROR) {GMT_Report(GMT->parent,GMT_MSG_NORMAL,"GMT_err_trap: %d\n", err);return(err);}
-#else
-#define GMT_err_trap(func_call) if ((err = (func_call)) != GMT_NOERROR) return(err)
-#endif
-
-EXTERN_MSC const char * GMT_strerror (int err);
-
-#define GMT_is_verbose(C,level) (C->current.setting.verbose >= level)
-
-/* Check condition and report error if true */
-#define GMT_check_condition(C,condition,...) ((condition) ? 1+GMT_Report(C->parent,GMT_MSG_NORMAL,__VA_ARGS__) : 0)
-
-/* Set __func__ identifier */
-#ifndef HAVE___FUNC__
-#	ifdef HAVE___FUNCTION__
-#		define __func__ __FUNCTION__
-#	else
-#		define __func__ "<unknown>"
-#	endif
-#endif
-
-/* Concatenate __FILE__ and __LINE__ as string */
-#define STRINGIFY(x) #x
-#define TOSTRING(x) STRINGIFY(x)
-#define __SOURCE_LINE __FILE__ ":" TOSTRING(__LINE__)
-static inline char* __source_line_func (const char* src_line, const char* func) {
-	/* This function is not thread-safe */
-	static char str[256];
-	const char *c = src_line;
-	size_t len;
-  *str = '\0';
-	while ((c = strpbrk (c, "/\\"))) /* get basename of src_line */
-		src_line = ++c;
-	strncat (str, src_line, 255);
-	len = strlen (src_line);
-	strncat (str, "(", 255 - 1 - len);
-	strncat (str, func, 255 - 2 - len);
-	strcat (str, ")");
-	return str;
-}
-#define __SOURCE_LINE_FUNC __source_line_func (__FILE__ ":" TOSTRING(__LINE__), __func__)
-
-/* Convenience functions to GMT_err_func */
-#ifdef DEBUG
-#	define GMT_err_pass(C,err,file) GMT_err_func(C,err,false,file,__SOURCE_LINE_FUNC)
-#	define GMT_err_fail(C,err,file) GMT_err_func(C,err,true,file,__SOURCE_LINE_FUNC)
-#else
-#	define GMT_err_pass(C,err,file) GMT_err_func(C,err,false,file,__func__)
-#	define GMT_err_fail(C,err,file) GMT_err_func(C,err,true,file,__func__)
-#endif
-
-#endif /* GMT_ERROR_H */
diff --git a/src/gmt/gmt_error_codes.h b/src/gmt/gmt_error_codes.h
deleted file mode 100644
index f2a8b64..0000000
--- a/src/gmt/gmt_error_codes.h
+++ /dev/null
@@ -1,107 +0,0 @@
-/*--------------------------------------------------------------------
- *	$Id: gmt_error_codes.h 13846 2014-12-28 21:46:54Z pwessel $
- *
- *	Copyright (c) 1991-2015 by P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis and F. Wobbe
- *	See LICENSE.TXT file for copying and redistribution conditions.
- *
- *	This program is free software; you can redistribute it and/or modify
- *	it under the terms of the GNU Lesser General Public License as published by
- *	the Free Software Foundation; version 3 or any later version.
- *
- *	This program is distributed in the hope that it will be useful,
- *	but WITHOUT ANY WARRANTY; without even the implied warranty of
- *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *	GNU Lesser General Public License for more details.
- *
- *	Contact info: gmt.soest.hawaii.edu
- *--------------------------------------------------------------------*/
-
-/*
- * Include file for GMT API error codes
- *
- * Author:	Paul Wessel
- * Date:	22-JUN-2012
- * Version:	5 API
- */
-
-#ifndef GMT_ERROR_CODES_H
-#define GMT_ERROR_CODES_H
-
-#include "declspec.h"
-/* external array with error descriptions */
-EXTERN_MSC const char* g_api_error_string[];
-
-enum Gmt_api_error_code {
-	GMT_OK = 0,
-	GMT_WRONG_MATRIX_SHAPE,
-	GMT_ACCESS_NOT_ENABLED,
-	GMT_ARGV_LIST_NULL,
-	GMT_ARG_IS_NULL,
-	GMT_COUNTER_IS_NEGATIVE,
-	GMT_BAD_GEOMETRY,
-	GMT_BAD_PERMISSION,
-	GMT_CPT_READ_ERROR,
-	GMT_DATA_READ_ERROR,
-	GMT_DATA_WRITE_ERROR,
-	GMT_DIM_TOO_LARGE,
-	GMT_DIM_TOO_SMALL,
-	GMT_ERROR_ON_FCLOSE,
-	GMT_ERROR_ON_FDOPEN,
-	GMT_ERROR_ON_FOPEN,
-	GMT_FILE_NOT_FOUND,
-	GMT_GRID_BC_ERROR,
-	GMT_GRID_READ_ERROR,
-	GMT_GRID_WRITE_ERROR,
-	GMT_ID_TOO_LARGE,
-	GMT_IMAGE_BC_ERROR,
-	GMT_IMAGE_READ_ERROR,
-	GMT_MEMORY_ERROR,
-	GMT_FREE_EXTERNAL_NOT_ALLOWED,
-	GMT_FREE_WRONG_LEVEL,
-	GMT_NOT_A_SESSION,
-	GMT_NOT_A_VALID_ARG,
-	GMT_NOT_A_VALID_DIRECTION,
-	GMT_NOT_A_VALID_FAMILY,
-	GMT_NOT_A_VALID_ID,
-	GMT_NOT_A_VALID_IO_ACCESS,
-	GMT_NOT_A_VALID_IO_MODE,
-	GMT_NOT_A_VALID_IO_SESSION,
-	GMT_NOT_A_VALID_METHOD,
-	GMT_NOT_A_VALID_MODE,
-	GMT_NOT_A_VALID_MODULE,
-	GMT_NOT_A_VALID_TYPE,
-	GMT_NOT_INPUT_OBJECT,
-	GMT_NOT_OUTPUT_OBJECT,
-	GMT_NO_GRDHEADER,
-	GMT_NO_INPUT,
-	GMT_NO_OUTPUT,
-	GMT_NO_PARAMETERS,
-	GMT_NO_RESOURCES,
-	GMT_N_COLS_NOT_SET,
-	GMT_N_COLS_VARY,
-	GMT_N_ROWS_NOT_SET,
-	GMT_OBJECT_NOT_FOUND,
-	GMT_OGR_ONE_TABLE_ONLY,
-	GMT_ONLY_ONE_ALLOWED,
-	GMT_OPTION_EXIST,
-	GMT_OPTION_HISTORY_ERROR,
-	GMT_OPTION_IS_NULL,
-	GMT_OPTION_LIST_NULL,
-	GMT_OPTION_NOT_FOUND,
-	GMT_OPTION_SORT_ERROR,
-	GMT_OUTPUT_NOT_SET,
-	GMT_PADDING_NOT_ALLOWED,
-	GMT_PARSE_ERROR,
-	GMT_PROG_NOT_FOUND,
-	GMT_PTR_IS_NULL,
-	GMT_PTR_NOT_NULL,
-	GMT_PTR_NOT_UNIQUE,
-	GMT_READ_ONCE,
-	GMT_RUNTIME_ERROR,
-	GMT_SIZE_IS_ZERO,
-	GMT_STREAM_NOT_ALLOWED,
-	GMT_SUBSET_NOT_ALLOWED,
-	GMT_VALUE_NOT_SET,
-	GMT_WRITTEN_ONCE
-};
-#endif /* GMT_ERROR_CODES_H */
diff --git a/src/gmt/gmt_fft.h b/src/gmt/gmt_fft.h
deleted file mode 100644
index f57bdb1..0000000
--- a/src/gmt/gmt_fft.h
+++ /dev/null
@@ -1,102 +0,0 @@
-/*--------------------------------------------------------------------
- *	$Id: gmt_fft.h 13846 2014-12-28 21:46:54Z pwessel $
- *
- *	Copyright (c) 1991-2015 by P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis and F. Wobbe
- *	See LICENSE.TXT file for copying and redistribution conditions.
- *
- *	This program is free software; you can redistribute it and/or modify
- *	it under the terms of the GNU Lesser General Public License as published by
- *	the Free Software Foundation; version 3 or any later version.
- *
- *	This program is distributed in the hope that it will be useful,
- *	but WITHOUT ANY WARRANTY; without even the implied warranty of
- *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *	GNU Lesser General Public License for more details.
- *
- *	Contact info: gmt.soest.hawaii.edu
- *--------------------------------------------------------------------*/
-/*
- *  Structures in support of FFT use.
- *
- * Author:	P. Wessel, derived from W.H.F. Smith implementation
- * Date:	12-FEB-2013
- * Version:	5 API
- *
- */
-
-#ifndef GMT_FFT_H
-#define GMT_FFT_H
-#ifdef __APPLE__ /* Accelerate framework */
-#include <Accelerate/Accelerate.h>
-#endif
-
-enum GMT_FFT_EXTEND {
-	GMT_FFT_EXTEND_POINT_SYMMETRY = 0,
-	GMT_FFT_EXTEND_MIRROR_SYMMETRY,
-	GMT_FFT_EXTEND_NONE,
-	GMT_FFT_EXTEND_NOT_SET};
-	
-enum GMT_FFT_TREND {
-	GMT_FFT_REMOVE_NOT_SET = -1,
-	GMT_FFT_REMOVE_NOTHING = 0,
-	GMT_FFT_REMOVE_MEAN,
-	GMT_FFT_REMOVE_MID,
-	GMT_FFT_REMOVE_TREND};
-	
-enum GMT_FFT_KCHOICE {
-	GMT_FFT_K_IS_KX = 0,
-	GMT_FFT_K_IS_KY,
-	GMT_FFT_K_IS_KR,
-	};
-	
-enum GMT_FFT_DIMSET {
-	GMT_FFT_EXTEND = 0,
-	GMT_FFT_FORCE,
-	GMT_FFT_SET,
-	GMT_FFT_LIST,
-	GMT_FFT_QUERY};
-
-struct GMT_FFT_WAVENUMBER {	/* Holds parameters needed to calculate kx, ky, kr */
-	int nx2, ny2;
-	unsigned int dim;	/* FFT dimension as setup by Init */
-	double delta_kx, delta_ky;
-	double (*k_ptr) (uint64_t k, struct GMT_FFT_WAVENUMBER *K);	/* pointer to function returning either kx, ky, or kr */
-	double coeff[3];		/* Detrending coefficients returned, if used */
-	struct GMT_FFT_INFO *info;	/* Pointer back to GMT_FFT_INFO */
-};
-
-struct GMT_FFT_INFO {
-	bool set;			/* true if we parsed options; false we must take default settings */
-	bool save[2];			/* save[GMT_IN] means save the input grid just before calling the FFT */
-					/* save[GMT_OUT] means save the complex output grid just after calling the FFT */
-	bool polar;			/* true if we are to save the complex output grid in polar form */
-	char suffix[GMT_LEN64];		/* Suffix used to form output names if save[GMT_IN] is true [tapered] */
-	unsigned int nx;		/* Desired hard FFT nx dimensionl or 0 if free to adjust */
-	unsigned int ny;		/* Desired hard FFT ny dimensionl or 0 if free to adjust */
-	unsigned int taper_mode;	/* One of the GMT_FFT_EXTEND for extension/mirroring */
-	unsigned int info_mode;		/* One of the GMT_FFT_INFO for setting nx/ny or inquire */
-	int trend_mode;			/* One of the GMT_FFT_TREND for handling detrending */
-	double taper_width;		/* Amount of tapering in percent */
-	struct GMT_FFT_WAVENUMBER *K;	/* Pointer to wavenumber structure */
-};
-
-struct GMT_FFT_SUGGESTION {
-	unsigned int nx;
-	unsigned int ny;
-	size_t worksize;	/* # single-complex elements needed in work array  */
-	size_t totalbytes;	/* (8*(nx*ny + worksize))  */
-	double run_time;
-	double rms_rel_err;
-}; /* [0] holds fastest, [1] most accurate, [2] least storage  */
-
-
-struct GMT_FFT_HIDDEN {	/* Items needed by various FFT packages */
-	unsigned int n_1d, n_2d;	/* Bill Gates says: error C2016: C requires that a struct or union has at least one member */
-#ifdef __APPLE__ /* Accelerate framework */
-	FFTSetup setup_1d, setup_2d;
-	DSPSplitComplex dsp_split_complex_1d;
-	DSPSplitComplex dsp_split_complex_2d;
-#endif
-};
-
-#endif
diff --git a/src/gmt/gmt_gdalread.h b/src/gmt/gmt_gdalread.h
deleted file mode 100644
index 1a39848..0000000
--- a/src/gmt/gmt_gdalread.h
+++ /dev/null
@@ -1,177 +0,0 @@
-/*--------------------------------------------------------------------
- *	$Id: gmt_gdalread.h 2242 2015-05-16 05:21:28Z caress $
- *
- *	Copyright (c) 1991-2015 by P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis and F. Wobbe
- *	See LICENSE.TXT file for copying and redistribution conditions.
- *
- *	This program is free software; you can redistribute it and/or modify
- *	it under the terms of the GNU Lesser General Public License as published by
- *	the Free Software Foundation; version 3 or any later version.
- *
- *	This program is distributed in the hope that it will be useful,
- *	but WITHOUT ANY WARRANTY; without even the implied warranty of
- *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *	GNU Lesser General Public License for more details.
- *
- *	Contact info: gmt.soest.hawaii.edu
- *--------------------------------------------------------------------*/
-
-#include <gdal.h>
-#include <ogr_srs_api.h>
-#include <cpl_string.h>
-#include <cpl_conv.h>
-
-/* Structure to control which options are transmited to GMT_gdalwrite */
-struct GDALWRITE_CTRL {
-	char *driver;		/* The GDAL diver name */
-	char *type;			/* Data type */
-	char *command;		/* command line */
-	char *title;
-	char *remark;
-	int  geog;
-	int  nx, ny;		/* Number of columns & rows of the region to be saved */
-	int  nXSizeFull;	/* Total number of columns of the data array including padding */
-	int  n_bands;
-	int  pad[4];
-	int  flipud;
-	int  registration;		/* Registration type. 0 -> grid registration; 1 -> pixel reg */
-	double	ULx, ULy;		/* x_min & y_max */
-	double	x_inc, y_inc;	/* Grid/Image increments */
-	double	nan_value; /* unlike the nan_value in struct GMT_GRID_HEADER this one is of type double */
-	void	*data;
-	struct GW_C {	/* Color map */
-		int active;
-		int n_colors;
-		float *cpt;
-	} C;
-	struct GW_P {			/* Proj4 string */
-		int	active;
-		char	*ProjectionRefPROJ4;
-	} P;
-};
-
-/* Structure to control which options are transmited to GMT_gdalread */
-struct GDALREAD_CTRL {
-	struct GD_B {	/* Band selection */
-		int active;
-		char *bands;
-	} B;
-	struct GD_I {	/* Interleaving by pixel (only for char data) */
-		int active;
-	} I;
-	struct GD_L {	/* Left-Right flip */
-		int active;
-	} L;
-	struct GD_M {	/* Metadata only */
-		int active;
-	} M;
-	struct GD_N {	/* For floats, replace this value by NaN */
-		float nan_value;
-	} N;
-	struct GD_P {	/* Preview mode */
-		int active;
-		char *jump;
-	} P;
-	struct GD_p {	/* Pad array in output */
-		int active;
-		int pad;
-	} p;
-	struct GD_W {	/* Convert proj4 string into WKT */
-		int active;
-	} W;
-	struct GD_R {	/* Sub-region in referenced coords */
-		int active;
-		char *region;
-	} R;
-	struct GD_Z {	/* Tell to store data in a complex array */
-		int active;
-		int complex_mode; /* 1|2 if complex array is to hold real (1) and imaginary (2) parts (0 = read as real only) */
-	} Z;
-	struct GD_cp {	/* Send in a pointer with allocated chars */
-		int active;
-		unsigned char *grd;
-	} c_ptr;
-	struct GD_fp {	/* Send in a pointer with allocated floats */
-		int active;
-		float *grd;
-	} f_ptr;
-	struct GD_r {	/* Sub-region in row/column coords */
-		int active;
-		char *region;
-	} r;
-	struct GD_reg {	/* Registration type. Used only when sending a sub-region request. Than we need to know this */
-		double x_inc, y_inc;	/* Grid increments */
-		int val;	/* 0 [default] means grid registration, 1 -> pixel registration */
-	} registration;
-	struct GD_hdr {	/* Some fields of the header structure */
-		int active;
-		unsigned int mx, my;
-		char side[1];		/* If array is going to pasted (grdpaste), tell in what side 'lrtb' */
-		int offset;
-	} mini_hdr;
-};
-
-/* Structure to hold metadata info in a per bands basis read */
-struct GDAL_BAND_FNAMES {
-	char		*DataType;
-	int	XSize;
-	int	YSize;
-	double		nodata;
-	double		MinMax[2];
-	double		ScaleOffset[2];
-};
-
-/* Structure with the output data transmited by GMT_gdalread */
-struct GD_CTRL {
-	/* active is true if the option has been activated */
-	struct UInt8 {			/* Declare byte pointer */
-		int active;
-		unsigned char *data;
-	} UInt8;
-	struct UInt16 {			/* Declare short int pointers */
-		int active;
-		unsigned short int *data;
-	} UInt16;
-	struct Int16 {			/* Declare unsigned short int pointers */
-		int active;
-		short int *data;
-	} Int16;
-	struct UInt32 {			/* Declare unsigned int pointers */
-		int active;
-		int *data;
-	} UInt32;
-	struct Int32 {			/* Declare int pointers */
-		int active;
-		int *data;
-	} Int32;
-	struct Float {			/* Declare float pointers */
-		int active;
-		float *data;
-	} Float;
-	struct Double {			/* Declare double pointers */
-		int active;
-		double *data;
-	} Double;
-
-	double	hdr[9];
-	double	GeoTransform[6];
-	double	nodata;
-	char	*ProjectionRefPROJ4;
-	char	*ProjectionRefWKT;
-	const char	*DriverShortName;
-	const char	*DriverLongName;
-	const char	*ColorInterp;
-	int	*ColorMap;
-	int	RasterXsize;
-	int	RasterYsize;
-	int	RasterCount;	/* Total number of bands in file */
-	int	nActualBands;	/* Number of bands that were actually sent back */
-	struct Corners {
-		double LL[2], UL[2], UR[2], LR[2];
-	} Corners;
-	struct GEOGCorners {
-		double LL[2], UL[2], UR[2], LR[2];
-	} GEOGCorners;
-
-	struct GDAL_BAND_FNAMES *band_field_names;
-};
diff --git a/src/gmt/gmt_grd.h b/src/gmt/gmt_grd.h
deleted file mode 100644
index a2dfeac..0000000
--- a/src/gmt/gmt_grd.h
+++ /dev/null
@@ -1,193 +0,0 @@
-/*--------------------------------------------------------------------
- *	$Id: gmt_grd.h 13846 2014-12-28 21:46:54Z pwessel $
- *
- *	Copyright (c) 1991-2015 by P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis and F. Wobbe
- *	See LICENSE.TXT file for copying and redistribution conditions.
- *
- *	This program is free software; you can redistribute it and/or modify
- *	it under the terms of the GNU Lesser General Public License as published by
- *	the Free Software Foundation; version 3 or any later version.
- *
- *	This program is distributed in the hope that it will be useful,
- *	but WITHOUT ANY WARRANTY; without even the implied warranty of
- *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *	GNU Lesser General Public License for more details.
- *
- *	Contact info: gmt.soest.hawaii.edu
- *--------------------------------------------------------------------*/
-/*
- * grd.h contains the definition for a GMT-SYSTEM Version >= 2 grd file
- *
- * grd is stored in rows going from west (xmin) to east (xmax)
- * first row in file has yvalue = north (ymax).  
- * This is SCANLINE orientation.
- *
- * Author:	Paul Wessel
- * Date:	1-JAN-2010
- * Version:	5 API
- */
-
-#ifndef _GMT_GRID_H
-#define _GMT_GRID_H
-
-/* netcdf convention */
-#define GMT_NC_CONVENTION "COARDS, CF-1.5"
-
-enum GMT_enum_grdtype {
-	/* Special cases of geographic grids with periodicity */
-	GMT_GRID_CARTESIAN=0,			/* Cartesian data, no periodicity involved */
-	GMT_GRID_GEOGRAPHIC_LESS360,		/* x is longitude, but range is < 360 degrees */
-	GMT_GRID_GEOGRAPHIC_EXACT360_NOREPEAT,	/* x is longitude, range is 360 degrees, no repeat node */
-	GMT_GRID_GEOGRAPHIC_EXACT360_REPEAT,	/* x is longitude, range is 360 degrees, gridline registered and repeat node at 360*/
-	GMT_GRID_GEOGRAPHIC_MORE360		/* x is longitude, and range exceeds 360 degrees */
-};
-
-enum GMT_enum_grdlayout {	/* Grid layout for complex grids */
-	GMT_GRID_IS_SERIAL = 0,		/* Grid is RRRRRR...[IIIIII...] */
-	GMT_GRID_IS_INTERLEAVED = 1};	/* Grid is RIRIRIRI... - required layout for FFT */
-
-/*
- * GMT's internal representation of grids is north-up, i.e., the index of the
- * least dimension (aka y or lat) increases to the south. NetCDF files are
- * usually written bottom-up, i.e., the index of the least dimension increases
- * from south to north (k_nc_start_south):
- *
- * k_nc_start_north:  k_nc_start_south:
- *
- * y ^ 0 1 2            -------> x
- *   | 3 4 5            | 0 1 2
- *   | 6 7 8            | 3 4 5
- *   -------> x       y V 6 7 8
- */
-
-enum Netcdf_row_order {
-	/* Order of rows in z variable */
-	k_nc_start_north = -1, /* The least dimension (i.e., lat or y) decreases */
-	k_nc_start_south = 1   /* The least dimension (i.e., lat or y) increases */
-};
-
-enum Netcdf_chunksize {
-	k_netcdf_io_classic = 0, /* netCDF classic format */
-	k_netcdf_io_chunked_auto /* netCDF 4 auto-determined optimal chunk size */
-};
-
-/* The array wesn in the header has a name that indicates the order (west, east, south, north).
- * However, to avoid using confusing indices 0-5 we define very brief constants
- * XLO, XHI, YLO, YHI, ZLO, ZHI that should be used instead: */
-enum GMT_enum_wesnIDs {
-	XLO = 0, /* Index for west or xmin value */
-	XHI,     /* Index for east or xmax value */
-	YLO,     /* Index for south or ymin value */
-	YHI,     /* Index for north or ymax value */
-	ZLO,     /* Index for zmin value */
-	ZHI      /* Index for zmax value */
-};
-
-/* These macros should be used to convert between (column,row) and (x,y).  It will eliminate
- * one source of typos and errors, and since macros are done at compilation time there is no
- * overhead.  Note: gmt_x_to_col does not need nx but we included it for symmetry reasons.
- * gmt_y_to_row must first compute j', the number of rows in the increasing y-direction (to
- * match the sense of truncation used for x) then we revert to row number increasing down
- * by flipping: j = ny - 1 - j'.
- * Note that input col, row _may_ be negative, hence we do the cast to (int) here. */
-
-#define gmt_x_to_col(x,x0,dx,off,nx) (irint((((x) - (x0)) / (dx)) - (off)))
-#define gmt_y_to_row(y,y0,dy,off,ny) ((ny) - 1 - irint(((((y) - (y0)) / (dy)) - (off))))
-#define GMT_col_to_x(C,col,x0,x1,dx,off,nx) (((int)(col) == (int)((nx)-1)) ? (x1) - (off) * (dx) : (x0) + ((col) + (off)) * (dx))
-#define GMT_row_to_y(C,row,y0,y1,dy,off,ny) (((int)(row) == (int)((ny)-1)) ? (y0) + (off) * (dy) : (y1) - ((row) + (off)) * (dy))
-
-/* The follow macros simplify using the 4 above macros when all info is in the struct header h. */
-
-#define GMT_grd_col_to_x(C,col,h) GMT_col_to_x(C,col,h->wesn[XLO],h->wesn[XHI],h->inc[GMT_X],h->xy_off,h->nx)
-#define GMT_grd_row_to_y(C,row,h) GMT_row_to_y(C,row,h->wesn[YLO],h->wesn[YHI],h->inc[GMT_Y],h->xy_off,h->ny)
-#define GMT_grd_x_to_col(C,x,h) gmt_x_to_col(x,h->wesn[XLO],h->inc[GMT_X],h->xy_off,h->nx)
-#define GMT_grd_y_to_row(C,y,h) gmt_y_to_row(y,h->wesn[YLO],h->inc[GMT_Y],h->xy_off,h->ny)
-
-/* These macros calculate the number of nodes in x or y for the increment dx, dy */
-
-#define GMT_get_n(C,min,max,inc,off) (urint ((((max) - (min)) / (inc)) + 1 - (off)) )
-#define GMT_get_inc(C,min,max,n,off) (((max) - (min)) / ((n) + (off) - 1))
-
-/* The follow macros simplify using the 2 above macros when all info is in the struct header */
-
-#define GMT_grd_get_nx(C,h) (GMT_get_n(C,h->wesn[XLO],h->wesn[XHI],h->inc[GMT_X],h->registration))
-#define GMT_grd_get_ny(C,h) (GMT_get_n(C,h->wesn[YLO],h->wesn[YHI],h->inc[GMT_Y],h->registration))
-
-/* The follow macros gets the full length or rows and columns when padding is considered (i.e., mx and my) */
-
-#define gmt_grd_get_nxpad(h,pad) ((h->nx) + pad[XLO] + pad[XHI])
-#define gmt_grd_get_nypad(h,pad) ((h->ny) + pad[YLO] + pad[YHI])
-
-/* 64-bit-safe macros to return the number of points in the grid given its dimensions */
-
-#define GMT_get_nm(C,nx,ny) (((uint64_t)(nx)) * ((uint64_t)(ny)))
-#define gmt_grd_get_nm(h) (((uint64_t)(h->nx)) * ((uint64_t)(h->ny)))
-
-/* GMT_grd_setpad copies the given pad into the header */
-
-#define GMT_grd_setpad(C,h,newpad) memcpy ((h)->pad, newpad, 4*sizeof(unsigned int))
-
-/* gmt_grd_get_size computes grid size including the padding, and doubles it if complex values */
-
-#define gmt_grd_get_size(h) ((((h->complex_mode & GMT_GRID_IS_COMPLEX_MASK) > 0) + 1ULL) * h->mx * h->my)
-
-/* Calculate 1-D index a[ij] corresponding to 2-D array a[row][col], with 64-bit precision.
- * Use GMT_IJP when array is padded by BC rows/cols, else use GMT_IJ0.  In all cases
- * we pass the interior row,col as padding is added by the macro. Note that row,col may
- * be negative as we seek to address nodes within the padding itself.  Hence calculations
- * use int64_t for signed integers, but cast final index to uint64_t.  Finally, there is
- * GMT_IJPGI which is GMT_IJP for when there are more than 1 band (it uses h->n_bands). */
-
-/* IJP macro using h and the pad info */
-#define GMT_IJP(h,row,col) ((uint64_t)(((int64_t)(row)+(int64_t)h->pad[YHI])*((int64_t)h->mx)+(int64_t)(col)+(int64_t)h->pad[XLO]))
-/* IJ0 macro using h but ignores the pad info */
-#define GMT_IJ0(h,row,col) ((uint64_t)(((int64_t)(row))*((int64_t)h->nx)+(int64_t)(col)))
-/* IJ macro using h but treats the entire grid with pad as no-pad grid, i.e. using mx as width */
-#define GMT_IJ(h,row,col) ((uint64_t)(((int64_t)(row))*((int64_t)h->mx)+(int64_t)(col)))
-/* IJPGI macro using h and the pad info that works for either grids (n_bands = 1) or images (n_bands = 1,3,4) */
-#define GMT_IJPGI(h,row,col) ((uint64_t)(((int64_t)(row)+(int64_t)h->pad[YHI])*((int64_t)h->mx*(int64_t)h->n_bands)+(int64_t)(col)+(int64_t)h->pad[XLO]*(int64_t)h->n_bands))
-
-/* Obtain row and col from index */
-#define GMT_col(h,ij) (((ij) % h->mx) - h->pad[XLO])
-#define GMT_row(h,ij) (((ij) / h->mx) - h->pad[YHI])
-
-/* To set up a standard double for-loop over rows and columns to visit all nodes in a padded array by computing the node index, use GMT_grd_loop */
-/* Note: All arguments must be actual variables and not expressions.
- * Note: that input col, row _may_ be signed, hence we do the cast to (int) here. */
-
-#define GMT_row_loop(C,G,row) for (row = 0; (int)row < (int)G->header->ny; row++)
-#define GMT_col_loop(C,G,row,col,ij) for (col = 0, ij = GMT_IJP (G->header, row, 0); (int)col < (int)G->header->nx; col++, ij++)
-#define GMT_grd_loop(C,G,row,col,ij) GMT_row_loop(C,G,row) GMT_col_loop(C,G,row,col,ij)
-/* Just a loop over columns */
-#define GMT_col_loop2(C,G,col) for (col = 0; (int)col < (int)G->header->nx; col++)
-/* Loop over all nodes including the pad */
-#define GMT_row_padloop(C,G,row,ij) for (row = 0, ij = 0; (int)row < (int)G->header->my; row++)
-#define GMT_col_padloop(C,G,col,ij) for (col = 0; (int)col < (int)G->header->mx; col++, ij++)
-#define GMT_grd_padloop(C,G,row,col,ij) GMT_row_padloop(C,G,row,ij) GMT_col_padloop(C,G,col,ij)
-/* Just a loop over columns */
-#define GMT_col_padloop2(C,G,col) for (col = 0; (int)col < (int)G->header->mx; col++)
-
-/* The usage could be:
-	GMT_grd_loop (GMT, Grid, row, col, node) fprintf (stderr, "Value at row = %d and col = %d is %g\n", row, col, Grid->data[node]);
-*/
-/* The GMT_y_is_outside macro returns true if y is outside the given domain.
- * For GMT_x_is_outside, see the function in gmt_support.c since we must also deal with longitude periodicity.
- */
-
-/* GMT_is_subset is true if wesn is set and wesn cuts through the grid region */
-#define GMT_is_subset(C,h,R) (R[XHI] > R[XLO] && R[YHI] > R[YLO] && (R[XLO] > h->wesn[XLO] || R[XHI] < h->wesn[XHI] || R[YLO] > h->wesn[YLO] || R[YHI] < h->wesn[YHI]))
-/* GMT_grd_same_region is true if two grids have the exact same regions */
-#define GMT_grd_same_region(C,G1,G2) (G1->header->wesn[XLO] == G2->header->wesn[XLO] && G1->header->wesn[XHI] == G2->header->wesn[XHI] && G1->header->wesn[YLO] == G2->header->wesn[YLO] && G1->header->wesn[YHI] == G2->header->wesn[YHI])
-/* GMT_grd_same_inc is true if two grids have the exact same grid increments */
-#define GMT_grd_same_inc(C,G1,G2) (G1->header->inc[GMT_X] == G2->header->inc[GMT_X] && G1->header->inc[GMT_Y] == G2->header->inc[GMT_Y])
-/* GMT_grd_same_dim is true if two grids have the exact same dimensions and registrations */
-#define GMT_grd_same_shape(C,G1,G2) (G1->header->nx == G2->header->nx && G1->header->ny == G2->header->ny && G1->header->registration == G2->header->registration)
-/* GMT_y_is_outside is true if y is outside the given range */
-#define GMT_y_is_outside(C,y,bottom,top) ((GMT_is_dnan(y) || (y) < bottom || (y) > top) ? true : false)
-/* GMT_grd_is_global is true for a geographic grid with exactly 360-degree range (with or without repeating column) */
-#define GMT_grd_is_global(C,h) (h->grdtype == GMT_GRID_GEOGRAPHIC_EXACT360_NOREPEAT || h->grdtype == GMT_GRID_GEOGRAPHIC_EXACT360_REPEAT)
-
-/* GMT_grd_duplicate_column is true for geographical global grid where first and last data columns are identical */
-#define GMT_grd_duplicate_column(C,h,way) (C->current.io.col_type[way][GMT_X] == GMT_IS_LON && GMT_360_RANGE (h->wesn[XHI], h->wesn[XLO]) && h->registration == GMT_GRID_NODE_REG)
-
-#endif /* _GMT_GRID_H */
diff --git a/src/gmt/gmt_grdio.h b/src/gmt/gmt_grdio.h
deleted file mode 100644
index 1f3d7e1..0000000
--- a/src/gmt/gmt_grdio.h
+++ /dev/null
@@ -1,157 +0,0 @@
-/*--------------------------------------------------------------------
- *	$Id: gmt_grdio.h 13846 2014-12-28 21:46:54Z pwessel $
- *
- *	Copyright (c) 1991-2015 by P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis and F. Wobbe
- *	See LICENSE.TXT file for copying and redistribution conditions.
- *
- *	This program is free software; you can redistribute it and/or modify
- *	it under the terms of the GNU Lesser General Public License as published by
- *	the Free Software Foundation; version 3 or any later version.
- *
- *	This program is distributed in the hope that it will be useful,
- *	but WITHOUT ANY WARRANTY; without even the implied warranty of
- *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *	GNU Lesser General Public License for more details.
- *
- *	Contact info: gmt.soest.hawaii.edu
- *--------------------------------------------------------------------*/
-
-/*
- * Include file for grd i/o
- *
- * Author:	Paul Wessel
- * Date:	1-JAN-2010
- * Version:	5 API
- */
-
-#ifndef GMT_GRDIO_H
-#define GMT_GRDIO_H
-
-/* Constants for *.img grids */
-
-#define GMT_IMG_MINLON		0.0
-#define GMT_IMG_MAXLON		360.0
-#define GMT_IMG_MINLAT_72	-72.0059773539
-#define GMT_IMG_MAXLAT_72	+72.0059773539
-#define GMT_IMG_MINLAT_80	-80.7380086280
-#define GMT_IMG_MAXLAT_80	+80.7380086280
-#define GMT_IMG_MINLAT_85	-85.0511287798
-#define GMT_IMG_MAXLAT_85	+85.0511287798
-
-enum GMT_enum_img {
-	GMT_IMG_NLON_1M    = 21600U, /* At 1 min resolution */
-	GMT_IMG_NLON_2M    = 10800U, /* At 2 min resolution */
-	GMT_IMG_NLAT_1M_72 = 12672U, /* At 1 min resolution */
-	GMT_IMG_NLAT_2M_72 = 6336U,  /* At 2 min resolution */
-	GMT_IMG_NLAT_1M_80 = 17280U, /* At 1 min resolution */
-	GMT_IMG_NLAT_2M_80 = 8640U,  /* At 2 min resolution */
-	GMT_IMG_NLAT_1M_85 = 21600U, /* At 1 min resolution */
-	GMT_IMG_NLAT_2M_85 = 10800U, /* At 2 min resolution */
-	GMT_IMG_ITEMSIZE   = 2U      /* Size of 2 byte short ints */
-};
-
-/* Special grid format IDs */
-
-enum Gmt_grid_id {
-	/* DO NOT change the order because id values have grown historically.
-	 * Append newly introduced id's at the end. */
-	k_grd_unknown_fmt = 0, /* if grid format cannot be auto-detected */
-	GMT_GRID_IS_BF,         /* GMT native, C-binary format (32-bit float) */
-	GMT_GRID_IS_BS,         /* GMT native, C-binary format (16-bit integer) */
-	GMT_GRID_IS_RB,         /* SUN rasterfile format (8-bit standard) */
-	GMT_GRID_IS_BB,         /* GMT native, C-binary format (8-bit integer) */
-	GMT_GRID_IS_BM,         /* GMT native, C-binary format (bit-mask) */
-	GMT_GRID_IS_SF,         /* Golden Software Surfer format 6 (32-bit float) */
-	GMT_GRID_IS_CB,         /* GMT netCDF format (8-bit integer) */
-	GMT_GRID_IS_CS,         /* GMT netCDF format (16-bit integer) */
-	GMT_GRID_IS_CI,         /* GMT netCDF format (32-bit integer) */
-	GMT_GRID_IS_CF,         /* GMT netCDF format (32-bit float) */
-	GMT_GRID_IS_CD,         /* GMT netCDF format (64-bit float) */
-	GMT_GRID_IS_RF,         /* GEODAS grid format GRD98 (NGDC) */
-	GMT_GRID_IS_BI,         /* GMT native, C-binary format (32-bit integer) */
-	GMT_GRID_IS_BD,         /* GMT native, C-binary format (64-bit float) */
-	GMT_GRID_IS_NB,         /* GMT netCDF format (8-bit integer) */
-	GMT_GRID_IS_NS,         /* GMT netCDF format (16-bit integer) */
-	GMT_GRID_IS_NI,         /* GMT netCDF format (32-bit integer) */
-	GMT_GRID_IS_NF,         /* GMT netCDF format (32-bit float) */
-	GMT_GRID_IS_ND,         /* GMT netCDF format (64-bit float) */
-	GMT_GRID_IS_SD,         /* Golden Software Surfer format 7 (64-bit float, read-only) */
-	GMT_GRID_IS_AF,         /* Atlantic Geoscience Center format AGC (32-bit float) */
-	GMT_GRID_IS_GD,         /* Import through GDAL */
-	GMT_GRID_IS_EI,         /* ESRI Arc/Info ASCII Grid Interchange format (ASCII integer) */
-	GMT_GRID_IS_EF          /* ESRI Arc/Info ASCII Grid Interchange format (ASCII float, write-only) */
-};
-#define GMT_N_GRD_FORMATS 25 /* Number of formats above plus 1 */
-
-#define GMT_GRID_IS_GOLDEN7	GMT_GRID_IS_SD
-#define GMT_GRID_IS_GDAL	GMT_GRID_IS_GD
-
-#include "gmt_customio.h"
-
-struct GMT_GRID_INFO {	/* Holds any -R -I -F settings passed indirectly via -R<grdfile> */
-	struct GMT_GRID_HEADER grd;	/* Header of grid file passed via -R */
-	bool active;		/* true if initialized via -R */
-};
-
-struct GMT_GRID_ROWBYROW {	/* Holds book-keeping information needed for row-by-row actions */
-	size_t size;		/* Bytes per item [4 for float, 1 for byte, etc] */
-	size_t n_byte;		/* Number of bytes for row */
-	unsigned int row;	/* Current row */
-	bool open;		/* true if we have already opened the file */
-	bool check;		/* true if we must replace NaNs with another representation on i/o */
-	bool auto_advance;	/* true if we want to read file sequentially */
-
-	int fid;		/* NetCDF file number [netcdf files only] */
-	size_t edge[2];		/* Dimension arrays [netcdf files only] */
-	size_t start[2];	/* Position arrays [netcdf files only] */
-
-	FILE *fp;		/* File pointer [for native files] */
-
-	void *v_row;		/* Void Row pointer for any data format */
-};
-
-#ifdef __APPLE__ /* Accelerate framework */
-#include <Accelerate/Accelerate.h>
-#undef I /* because otherwise we are in trouble with, e.g., struct GMT_IMAGE *I */
-#endif
-
-static inline void scale_and_offset_f (float *data, size_t length, float scale, float offset) {
-	/* Routine that scales and offsets the data in a vector
-	 *  data:   Single-precision real input vector
-	 *  length: The number of elements to process
-	 * This function uses the vDSP portion of the Accelerate framework if possible */
-#ifndef __APPLE__
-	size_t n;
-#endif
-	if (scale == 1.0) /* offset only */
-#ifdef __APPLE__ /* Accelerate framework */
-		vDSP_vsadd (data, 1, &offset, data, 1, length);
-#else
-		for (n = 0; n < length; ++n)
-			data[n] += offset;
-#endif
-	else if (offset == 0.0) /* scale only */
-#ifdef __APPLE__ /* Accelerate framework */
-		vDSP_vsmul (data, 1, &scale, data, 1, length);
-#else
-		for (n = 0; n < length; ++n)
-			data[n] *= scale;
-#endif
-	else /* scale + offset */
-#ifdef __APPLE__ /* Accelerate framework */
-		vDSP_vsmsa (data, 1, &scale, &offset, data, 1, length);
-#else
-		for (n = 0; n < length; ++n)
-			data[n] = data[n] * scale + offset;
-#endif
-}
-
-EXTERN_MSC int GMT_grd_format_decoder (struct GMT_CTRL *GMT, const char *code, unsigned int *type_id);
-EXTERN_MSC int GMT_grd_get_format (struct GMT_CTRL *GMT, char *file, struct GMT_GRID_HEADER *header, bool magic);
-EXTERN_MSC int GMT_grd_prep_io (struct GMT_CTRL *GMT, struct GMT_GRID_HEADER *header, double wesn[], unsigned int *width, unsigned int *height, int *first_col, int *last_col, int *first_row, int *last_row, unsigned int **index);
-EXTERN_MSC int GMT_update_grd_info (struct GMT_CTRL *GMT, char *file, struct GMT_GRID_HEADER *header);
-EXTERN_MSC void GMT_scale_and_offset_f (struct GMT_CTRL *GMT, float *data, size_t length, double scale, double offset);
-EXTERN_MSC int gmt_grd_layout (struct GMT_CTRL *GMT, struct GMT_GRID_HEADER *h, float *grid, unsigned int complex_mode, unsigned int direction);
-EXTERN_MSC void GMT_grd_mux_demux (struct GMT_CTRL *GMT, struct GMT_GRID_HEADER *h, float *data, unsigned int mode);
-
-#endif /* GMT_GRDIO_H */
diff --git a/src/gmt/gmt_hash.h b/src/gmt/gmt_hash.h
deleted file mode 100644
index fe5db97..0000000
--- a/src/gmt/gmt_hash.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/*--------------------------------------------------------------------
- *	$Id: gmt_hash.h 13846 2014-12-28 21:46:54Z pwessel $
- *
- *	Copyright (c) 1991-2015 by P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis and F. Wobbe
- *	See LICENSE.TXT file for copying and redistribution conditions.
- *
- *	This program is free software; you can redistribute it and/or modify
- *	it under the terms of the GNU Lesser General Public License as published by
- *	the Free Software Foundation; version 3 or any later version.
- *
- *	This program is distributed in the hope that it will be useful,
- *	but WITHOUT ANY WARRANTY; without even the implied warranty of
- *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *	GNU Lesser General Public License for more details.
- *
- *	Contact info: gmt.soest.hawaii.edu
- *--------------------------------------------------------------------*/
-/*
- * gmt_hash.h contains definition of the structure used for hashing.
- *
- * Author:	Paul Wessel
- * Date:	01-OCT-2009
- * Version:	5 API
- */
-
-#ifndef _GMT_HASH_H
-#define _GMT_HASH_H
-
-/*--------------------------------------------------------------------
- *			GMT HASH STRUCTURE DEFINITION
- *--------------------------------------------------------------------*/
-
-/* To avoid lots of dynamic memory allocation for the hash lookup tables we
- * use a statically allocated structure.  By determining that the max number
- * of identical hash numbers across all the keywords is 16, we simply allocate
- * space for 16 entries for each structure.  Should later additions to GMT's
- * default parameters, colornames, etc increase this value we will be warned
- * and can change the entry GMT_HASH_MAXDEPTH below accordingly.
- */
-#define GMT_HASH_MAXDEPTH	16
-
-struct GMT_HASH {	/* Used to relate text keywords to array indices */
-	unsigned int id[GMT_HASH_MAXDEPTH];	/* Indices of corresponding keyword with identical hash value */
-	unsigned int n_id;			/* Number of hash entries for this item */
-	char *key[GMT_HASH_MAXDEPTH];		/* Name of these entries */
-};
-
-#endif  /* _GMT_HASH_H */
diff --git a/src/gmt/gmt_init.h b/src/gmt/gmt_init.h
deleted file mode 100644
index f02f0a2..0000000
--- a/src/gmt/gmt_init.h
+++ /dev/null
@@ -1,118 +0,0 @@
-/*--------------------------------------------------------------------
- *	$Id: gmt_init.h 2242 2015-05-16 05:21:28Z caress $
- *
- *	Copyright (c) 1991-2015 by P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis and F. Wobbe
- *	See LICENSE.TXT file for copying and redistribution conditions.
- *
- *	This program is free software; you can redistribute it and/or modify
- *	it under the terms of the GNU Lesser General Public License as published by
- *	the Free Software Foundation; version 3 or any later version.
- *
- *	This program is distributed in the hope that it will be useful,
- *	but WITHOUT ANY WARRANTY; without even the implied warranty of
- *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *	GNU Lesser General Public License for more details.
- *
- *	Contact info: gmt.soest.hawaii.edu
- *--------------------------------------------------------------------*/
-/*
- * Include file for gmt_init.c
- *
- * Author:	Paul Wessel
- * Date:	1-JAN-2010
- * Version:	5 API
- */
-
-#ifndef GMT_INIT_H
-#define GMT_INIT_H
-
-#ifdef HAVE_FFTW3F
-/* FFTW_planner_flags: FFTW_ESTIMATE, FFTW_MEASURE, FFTW_PATIENT, FFTW_EXHAUSTIVE */
-#	include <fftw3.h>
-#endif
-
-/* Macro to do conversion to inches with PROJ_LENGTH_UNIT as default */
-
-#define GMT_to_inch(GMT,value) GMT_convert_units (GMT, value, GMT->current.setting.proj_length_unit, GMT_INCH)
-#define GMT_to_points(GMT,value) GMT_convert_units (GMT, value, GMT->current.setting.proj_length_unit, GMT_PT)
-
-/* Extern functions */
-
-EXTERN_MSC int GMT_get_V (char arg);
-EXTERN_MSC bool GMT_check_filearg (struct GMT_CTRL *GMT, char option, char *file, unsigned int direction, unsigned int family);
-EXTERN_MSC int GMT_parse_dash_option (struct GMT_CTRL *GMT, char *text);
-EXTERN_MSC struct GMT_CTRL * GMT_begin (struct GMTAPI_CTRL *API, char *session, unsigned int pad);
-EXTERN_MSC void GMT_end (struct GMT_CTRL *GMT);
-EXTERN_MSC struct GMT_CTRL * GMT_begin_module (struct GMTAPI_CTRL *API, const char *lib_name, const char *mod_name, struct GMT_CTRL **Ccopy);
-EXTERN_MSC void GMT_end_module (struct GMT_CTRL *GMT, struct GMT_CTRL *Ccopy);
-EXTERN_MSC int GMT_Complete_Options (struct GMT_CTRL *GMT, struct GMT_OPTION *options);
-EXTERN_MSC int GMT_init_time_system_structure (struct GMT_CTRL *GMT, struct GMT_TIME_SYSTEM *time_system);
-EXTERN_MSC int GMT_init_scales (struct GMT_CTRL *GMT, unsigned int unit, double *fwd_scale, double *inv_scale, double *inch_to_unit, double *unit_to_inch, char *unit_name);
-EXTERN_MSC int GMT_set_measure_unit (struct GMT_CTRL *GMT, char unit);
-EXTERN_MSC char * GMT_putfill (struct GMT_CTRL *GMT, struct GMT_FILL *F);
-EXTERN_MSC char * GMT_putcolor (struct GMT_CTRL *GMT, double *rgb);
-EXTERN_MSC char * GMT_putrgb (struct GMT_CTRL *GMT, double *rgb);
-EXTERN_MSC char * GMT_putcmyk (struct GMT_CTRL *GMT, double *cmyk);
-EXTERN_MSC char * GMT_puthsv (struct GMT_CTRL *GMT, double *hsv);
-EXTERN_MSC double GMT_convert_units (struct GMT_CTRL *GMT, char *value, unsigned int from_default, unsigned int target_unit);
-EXTERN_MSC enum GMT_enum_units GMT_get_unit_number (struct GMT_CTRL *GMT, char unit);
-EXTERN_MSC unsigned int GMT_check_scalingopt (struct GMT_CTRL *GMT, char option, char unit, char *unit_name);
-EXTERN_MSC int GMT_parse_common_options (struct GMT_CTRL *GMT, char *list, char option, char *item);
-EXTERN_MSC int GMT_default_error (struct GMT_CTRL *GMT, char option);
-EXTERN_MSC bool GMT_get_time_system (struct GMT_CTRL *GMT, char *name, struct GMT_TIME_SYSTEM *time_system);
-EXTERN_MSC int GMT_hash_lookup (struct GMT_CTRL *GMT, char *key, struct GMT_HASH *hashnode, unsigned int n, unsigned int n_hash);
-EXTERN_MSC void GMT_syntax (struct GMT_CTRL *GMT, char option);
-EXTERN_MSC void GMT_cont_syntax (struct GMT_CTRL *GMT, unsigned int indent, unsigned int kind);
-EXTERN_MSC void GMT_mapscale_syntax (struct GMT_CTRL *GMT, char option, char *string);
-EXTERN_MSC void GMT_maprose_syntax (struct GMT_CTRL *GMT, char option, char *string);
-EXTERN_MSC void GMT_mapinsert_syntax (struct GMT_CTRL *GMT, char option, char *string);
-EXTERN_MSC void GMT_fill_syntax (struct GMT_CTRL *GMT, char option, char *string);
-EXTERN_MSC void GMT_pen_syntax (struct GMT_CTRL *GMT, char option, char *string);
-EXTERN_MSC void GMT_rgb_syntax (struct GMT_CTRL *GMT, char option, char *string);
-EXTERN_MSC void GMT_inc_syntax (struct GMT_CTRL *GMT, char option, bool error);
-EXTERN_MSC void GMT_label_syntax (struct GMT_CTRL *GMT, unsigned int indent, unsigned int kind);
-EXTERN_MSC void GMT_dist_syntax (struct GMT_CTRL *GMT, char option, char *string);
-EXTERN_MSC void GMT_vector_syntax (struct GMT_CTRL *GMT, unsigned int mode);
-EXTERN_MSC void GMT_img_syntax (struct GMT_CTRL *GMT);
-EXTERN_MSC void GMT_fft_syntax (struct GMT_CTRL *GMT, char option, char *string);
-EXTERN_MSC void GMT_explain_options (struct GMT_CTRL *GMT, char *options);
-EXTERN_MSC void GMT_getdefaults (struct GMT_CTRL *GMT, char *this_file);
-EXTERN_MSC void GMT_putdefaults (struct GMT_CTRL *GMT, char *this_file);
-EXTERN_MSC int GMT_hash_init (struct GMT_CTRL *GMT, struct GMT_HASH *hashnode , char **keys, unsigned int n_hash, unsigned int n_keys);
-EXTERN_MSC int GMT_getdefpath (struct GMT_CTRL *GMT, char get, char **path);
-EXTERN_MSC void GMT_extract_label (struct GMT_CTRL *GMT, char *line, char *label, struct GMT_OGR_SEG *G);
-EXTERN_MSC void GMT_check_lattice (struct GMT_CTRL *GMT, double *inc, unsigned int *registration, bool *active);
-EXTERN_MSC int GMT_check_binary_io (struct GMT_CTRL *GMT, uint64_t n_req);
-EXTERN_MSC char * GMT_putparameter (struct GMT_CTRL *GMT, char *keyword);
-EXTERN_MSC void GMT_set_pad (struct GMT_CTRL *GMT, unsigned int npad);
-EXTERN_MSC int GMT_get_ellipsoid (struct GMT_CTRL *GMT, char *name);
-EXTERN_MSC int GMT_init_vector_param (struct GMT_CTRL *GMT, struct GMT_SYMBOL *S, bool set, bool outline, struct GMT_PEN *pen, bool do_fill, struct GMT_FILL *fill);
-EXTERN_MSC int GMT_parse_vector (struct GMT_CTRL *GMT, char symbol, char *text, struct GMT_SYMBOL *S);
-EXTERN_MSC bool GMT_check_region (struct GMT_CTRL *GMT, double wesn[]);
-EXTERN_MSC int GMT_pickdefaults (struct GMT_CTRL *GMT, bool lines, struct GMT_OPTION *options);
-EXTERN_MSC unsigned int GMT_setdefaults (struct GMT_CTRL *GMT, struct GMT_OPTION *options);
-EXTERN_MSC int GMT_geo_C_format (struct GMT_CTRL *GMT);
-EXTERN_MSC int GMT_loaddefaults (struct GMT_CTRL *GMT, char *file);
-EXTERN_MSC int GMT_parse_symbol_option (struct GMT_CTRL *GMT, char *text, struct GMT_SYMBOL *p, unsigned int mode, bool cmd);
-EXTERN_MSC int GMT_message (struct GMT_CTRL *GMT, char *format, ...);
-EXTERN_MSC int GMT_report_func (struct GMT_CTRL *GMT, unsigned int level, const char *source_line, const char *format, ...);
-EXTERN_MSC int GMT_rectR_to_geoR (struct GMT_CTRL *GMT, char unit, double rect[], double out_wesn[], bool get_R);
-
-#ifdef WIN32
-EXTERN_MSC void GMT_setmode (struct GMT_CTRL *GMT, int direction);
-#endif
-
-/* Inline functions */
-
-#if 0
-/* Wrapper around GMT_begin_module for internally registered GMT modules */
-static inline struct GMT_CTRL* GMT_begin_gmt_module (struct GMTAPI_CTRL *api_ctrl, const char *lib, const char *module, struct GMT_CTRL **gmt_ctrl_copy)
-{
-	/* Init module with NULL-name */
-	struct GMT_CTRL *gmt_ctrl = GMT_begin_module (api_ctrl, lib, module, gmt_ctrl_copy);
-	/* Return GMT_CTRL */
-	return gmt_ctrl;
-}
-#endif
-
-#endif /* GMT_INIT_H */
diff --git a/src/gmt/gmt_internals.h b/src/gmt/gmt_internals.h
deleted file mode 100644
index 080ea15..0000000
--- a/src/gmt/gmt_internals.h
+++ /dev/null
@@ -1,282 +0,0 @@
-/*--------------------------------------------------------------------
- *	$Id: gmt_internals.h 2242 2015-05-16 05:21:28Z caress $
- *
- *	Copyright (c) 1991-2015 by P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis and F. Wobbe
- *	See LICENSE.TXT file for copying and redistribution conditions.
- *
- *	This program is free software; you can redistribute it and/or modify
- *	it under the terms of the GNU Lesser General Public License as published by
- *	the Free Software Foundation; version 3 or any later version.
- *
- *	This program is distributed in the hope that it will be useful,
- *	but WITHOUT ANY WARRANTY; without even the implied warranty of
- *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *	GNU Lesser General Public License for more details.
- *
- *	Contact info: gmt.soest.hawaii.edu
- *--------------------------------------------------------------------*/
-/* gmt_internals.h  --  All lower-level functions needed within library.
-
-   Authors:	P. Wessel, W. H. F. Smith, R. Scharroo, and J. Luis
-   Date:	1-OCT-2009
-   Version:	5 API
-
-*/
-
-#ifndef _GMT_INTERNALS_H
-#define _GMT_INTERNALS_H
-
-enum GMT_enum_cplx {GMT_RE = 0, GMT_IM = 1};	/* Real and imaginary indices */
-
-EXTERN_MSC void GMT_set_dataset_minmax (struct GMT_CTRL *GMT, struct GMT_DATASET *D);
-
-EXTERN_MSC struct GMT_PALETTE * GMT_duplicate_palette (struct GMT_CTRL *GMT, struct GMT_PALETTE *P_from, unsigned int mode);
-EXTERN_MSC unsigned int GMT_unit_lookup (struct GMT_CTRL *GMT, int c, unsigned int unit);
-EXTERN_MSC void GMT_get_annot_label (struct GMT_CTRL *GMT, double val, char *label, bool do_minutes, bool do_seconds, unsigned int lonlat, bool worldmap);
-EXTERN_MSC unsigned int GMT_coordinate_array (struct GMT_CTRL *GMT, double min, double max, struct GMT_PLOT_AXIS_ITEM *T, double **array, char ***labels);
-EXTERN_MSC unsigned int GMT_linear_array (struct GMT_CTRL *GMT, double min, double max, double delta, double phase, double **array);
-EXTERN_MSC unsigned int GMT_pow_array (struct GMT_CTRL *GMT, double min, double max, double delta, unsigned int x_or_y_or_z, double **array);
-EXTERN_MSC int GMT_prepare_label (struct GMT_CTRL *GMT, double angle, unsigned int side, double x, double y, unsigned int type, double *line_angle, double *text_angle, unsigned int *justify);
-EXTERN_MSC unsigned int GMT_time_array (struct GMT_CTRL *GMT, double min, double max, struct GMT_PLOT_AXIS_ITEM *T, double **array);
-EXTERN_MSC void GMT_get_lon_minmax (struct GMT_CTRL *GMT, double *lon, uint64_t n, double *min, double *max);
-EXTERN_MSC struct GMT_OGR * GMT_duplicate_ogr (struct GMT_CTRL *GMT, struct GMT_OGR *G);
-EXTERN_MSC void GMT_free_ogr (struct GMT_CTRL *GMT, struct GMT_OGR **G, unsigned int mode);
-EXTERN_MSC int gmt_ogr_get_geometry (char *item);
-EXTERN_MSC int gmt_ogr_get_type (char *item);
-EXTERN_MSC void gmt_plot_C_format (struct GMT_CTRL *GMT);
-EXTERN_MSC void gmt_clock_C_format (struct GMT_CTRL *GMT, char *form, struct GMT_CLOCK_IO *S, unsigned int mode);
-EXTERN_MSC void gmt_date_C_format (struct GMT_CTRL *GMT, char *form, struct GMT_DATE_IO *S, unsigned int mode);
-EXTERN_MSC void * GMT_ascii_textinput (struct GMT_CTRL *GMT, FILE *fp, uint64_t *ncol, int *status);
-EXTERN_MSC double GMT_get_map_interval (struct GMT_CTRL *GMT, struct GMT_PLOT_AXIS_ITEM *T);
-EXTERN_MSC unsigned int GMT_log_array (struct GMT_CTRL *GMT, double min, double max, double delta, double **array);
-EXTERN_MSC int GMT_nc_get_att_text (struct GMT_CTRL *GMT, int ncid, int varid, char *name, char *text, size_t textlen);
-EXTERN_MSC int GMT_akima (struct GMT_CTRL *GMT, double *x, double *y, uint64_t nx, double *c);
-EXTERN_MSC int GMT_cspline (struct GMT_CTRL *GMT, double *x, double *y, uint64_t n, double *c);
-EXTERN_MSC bool GMT_annot_pos (struct GMT_CTRL *GMT, double min, double max, struct GMT_PLOT_AXIS_ITEM *T, double coord[], double *pos);
-EXTERN_MSC int GMT_comp_int_asc (const void *p_1, const void *p_2);
-EXTERN_MSC float GMT_decode (struct GMT_CTRL *GMT, void *vptr, uint64_t k, unsigned int type);
-EXTERN_MSC void GMT_encode (struct GMT_CTRL *GMT, void *vptr, uint64_t k, float z, unsigned int type);
-EXTERN_MSC int GMT_flip_justify (struct GMT_CTRL *GMT, unsigned int justify);
-EXTERN_MSC struct GMT_CUSTOM_SYMBOL * GMT_get_custom_symbol (struct GMT_CTRL *GMT, char *name);
-EXTERN_MSC void GMT_free_custom_symbols (struct GMT_CTRL *GMT);
-EXTERN_MSC bool GMT_geo_to_dms (double val, int n_items, double fact, int *d, int *m,  int *s,  int *ix);
-EXTERN_MSC double GMT_get_annot_offset (struct GMT_CTRL *GMT, bool *flip, unsigned int level);
-EXTERN_MSC int GMT_get_coordinate_label (struct GMT_CTRL *GMT, char *string, struct GMT_PLOT_CALCLOCK *P, char *format, struct GMT_PLOT_AXIS_ITEM *T, double coord);
-EXTERN_MSC void GMT_get_time_label (struct GMT_CTRL *GMT, char *string, struct GMT_PLOT_CALCLOCK *P, struct GMT_PLOT_AXIS_ITEM *T, double t);
-EXTERN_MSC int GMT_getrgb_index (struct GMT_CTRL *GMT, double *rgb);
-EXTERN_MSC char * GMT_getuserpath (struct GMT_CTRL *GMT, const char *stem, char *path);	/* Look for user file */
-EXTERN_MSC size_t GMT_grd_data_size (struct GMT_CTRL *GMT, unsigned int format, float *nan_value);
-EXTERN_MSC void GMT_init_ellipsoid (struct GMT_CTRL *GMT);
-EXTERN_MSC void GMT_io_init (struct GMT_CTRL *GMT);			/* Initialize pointers */
-EXTERN_MSC uint64_t GMT_latpath (struct GMT_CTRL *GMT, double lat, double lon1, double lon2, double **x, double **y);
-EXTERN_MSC uint64_t GMT_lonpath (struct GMT_CTRL *GMT, double lon, double lat1, double lat2, double **x, double **y);
-EXTERN_MSC uint64_t GMT_map_path (struct GMT_CTRL *GMT, double lon1, double lat1, double lon2, double lat2, double **x, double **y);
-EXTERN_MSC double GMT_left_boundary (struct GMT_CTRL *GMT, double y);
-EXTERN_MSC double GMT_right_boundary (struct GMT_CTRL *GMT, double y);
-EXTERN_MSC unsigned int GMT_map_latcross (struct GMT_CTRL *GMT, double lat, double west, double east, struct GMT_XINGS **xings);
-EXTERN_MSC unsigned int GMT_map_loncross (struct GMT_CTRL *GMT, double lon, double south, double north, struct GMT_XINGS **xings);
-EXTERN_MSC void GMT_rotate2D (struct GMT_CTRL *GMT, double x[], double y[], uint64_t n, double x0, double y0, double angle, double xp[], double yp[]);
-EXTERN_MSC void GMT_set_bin_io (struct GMT_CTRL *GMT);
-EXTERN_MSC uint64_t * GMT_split_line (struct GMT_CTRL *GMT, double **xx, double **yy, uint64_t *nn, bool add_crossings);
-EXTERN_MSC int GMT_verify_time_step (struct GMT_CTRL *GMT, int step, char unit);	/* Check that time step and unit for time axis are OK  */
-EXTERN_MSC double GMT_xx_to_x (struct GMT_CTRL *GMT, double xx);
-EXTERN_MSC double GMT_yy_to_y (struct GMT_CTRL *GMT, double yy);
-EXTERN_MSC double GMT_zz_to_z (struct GMT_CTRL *GMT, double zz);
-EXTERN_MSC int GMT_y2_to_y4_yearfix (struct GMT_CTRL *GMT, unsigned int y2);	/* Convert a 2-digit year to a 4-digit year */
-EXTERN_MSC bool GMT_g_ymd_is_bad (int y, int m, int d);	/* Check range of month and day for Gregorian YMD calendar values  */
-EXTERN_MSC bool GMT_iso_ywd_is_bad (int y, int w, int d);	/* Check range of week and day for ISO W calendar.  */
-EXTERN_MSC int GMT_genper_map_clip_path (struct GMT_CTRL *GMT, uint64_t np, double *work_x, double *work_y);
-EXTERN_MSC double GMT_half_map_width (struct GMT_CTRL *GMT, double y);
-EXTERN_MSC void GMT_moment_interval (struct GMT_CTRL *GMT, struct GMT_MOMENT_INTERVAL *p, double dt_in, bool init); /* step a time axis by time units */
-EXTERN_MSC int64_t GMT_rd_from_iywd (struct GMT_CTRL *GMT, int iy, int iw, int id);
-EXTERN_MSC void GMT_scale_eqrad (struct GMT_CTRL *GMT);
-EXTERN_MSC void GMT_enforce_rgb_triplets (struct GMT_CTRL *GMT, char *text, unsigned int size);
-EXTERN_MSC struct GMT_TEXTSET * GMT_create_textset (struct GMT_CTRL *GMT, uint64_t n_tables, uint64_t n_segments, uint64_t n_rows, bool alloc_only);
-EXTERN_MSC struct GMT_PALETTE * GMT_create_palette (struct GMT_CTRL *GMT, uint64_t n_colors);
-EXTERN_MSC struct GMT_TEXTTABLE * GMT_read_texttable (struct GMT_CTRL *GMT, void *source, unsigned int source_type);
-EXTERN_MSC int GMT_write_textset (struct GMT_CTRL *GMT, void *dest, unsigned int dest_type, struct GMT_TEXTSET *D, int table);
-EXTERN_MSC struct GMT_TEXTSET * GMT_alloc_textset (struct GMT_CTRL *GMT, struct GMT_TEXTSET *Din, unsigned int mode);
-EXTERN_MSC bool GMT_init_complex (struct GMT_GRID_HEADER *h, unsigned int complex_mode, uint64_t *imag_offset);
-EXTERN_MSC struct GMT_MATRIX * GMT_duplicate_matrix (struct GMT_CTRL *GMT, struct GMT_MATRIX *M_in, bool duplicate_data);
-EXTERN_MSC struct GMT_VECTOR * GMT_duplicate_vector (struct GMT_CTRL *GMT, struct GMT_VECTOR *V_in, bool duplicate_data);
-EXTERN_MSC void gmt_init_rot_matrix (double R[3][3], double E[]);
-EXTERN_MSC void gmt_load_rot_matrix (double w, double R[3][3], double E[]);
-EXTERN_MSC void gmt_matrix_vect_mult (double a[3][3], double b[3], double c[3]);
-EXTERN_MSC void gmt_geo_polygon (struct GMT_CTRL *GMT, double *lon, double *lat, uint64_t n);
-EXTERN_MSC int GMT_io_banner (struct GMT_CTRL *GMT, unsigned int direction);
-
-EXTERN_MSC int GMT_gmonth_length (int year, int month);
-EXTERN_MSC void GMT_gcal_from_dt (struct GMT_CTRL *GMT, double t, struct GMT_gcal *cal);	/* Break internal time into calendar and clock struct info  */
-EXTERN_MSC int GMT_great_circle_intersection (struct GMT_CTRL *GMT, double A[], double B[], double C[], double X[], double *CX_dist);
-EXTERN_MSC double GMT_great_circle_dist_degree (struct GMT_CTRL *GMT, double lon1, double lat1, double lon2, double lat2);
-EXTERN_MSC void GMT_get_point_from_r_az (struct GMT_CTRL *GMT, double lon0, double lat0, double r, double azim, double *lon1, double *lat1);
-EXTERN_MSC int gmt_parse_b_option (struct GMT_CTRL *GMT, char *text);
-EXTERN_MSC bool GMT_check_url_name (char *fname);
-EXTERN_MSC int64_t GMT_splitinteger (double value, int epsilon, double *doublepart);
-EXTERN_MSC bool GMT_is_gleap (int gyear);
-EXTERN_MSC void GMT_str_tolower (char *string);
-EXTERN_MSC void GMT_str_toupper (char *string);
-EXTERN_MSC char *GMT_file_unitscale (char *name);
-EXTERN_MSC void gmt_set_oblique_pole_and_origin (struct GMT_CTRL *GMT, double plon, double plat, double olon, double olat);
-
-/* Functions declared in gmt_proj.c */
-
-EXTERN_MSC void GMT_vpolar (struct GMT_CTRL *GMT, double lon0);
-EXTERN_MSC void GMT_vmerc (struct GMT_CTRL *GMT, double lon0, double slat);
-EXTERN_MSC void GMT_vcyleq (struct GMT_CTRL *GMT, double lon0, double slat);
-EXTERN_MSC void GMT_vcyleqdist (struct GMT_CTRL *GMT, double lon0, double slat);
-EXTERN_MSC void GMT_vcylstereo (struct GMT_CTRL *GMT, double lon0, double slat);
-EXTERN_MSC void GMT_vmiller (struct GMT_CTRL *GMT, double lon0);
-EXTERN_MSC void GMT_vstereo (struct GMT_CTRL *GMT, double lon0, double lat0, double horizon);
-EXTERN_MSC void GMT_vlamb (struct GMT_CTRL *GMT, double lon0, double lat0, double pha, double phb);
-EXTERN_MSC void GMT_vtm (struct GMT_CTRL *GMT, double lon0, double lat0);
-EXTERN_MSC void GMT_vlambeq (struct GMT_CTRL *GMT, double lon0, double lat0, double horizon);
-EXTERN_MSC void GMT_vortho (struct GMT_CTRL *GMT, double lon0, double lat0, double horizon);
-EXTERN_MSC void GMT_vgenper (struct GMT_CTRL *GMT, double lon0, double lat0, double altitude, double azimuth, double tilt, double rotation, double width, double height);
-EXTERN_MSC void GMT_vgnomonic (struct GMT_CTRL *GMT, double lon0, double lat0, double horizon);
-EXTERN_MSC void GMT_vazeqdist (struct GMT_CTRL *GMT, double lon0, double lat0, double horizon);
-EXTERN_MSC void GMT_vmollweide (struct GMT_CTRL *GMT, double lon0, double scale);
-EXTERN_MSC void GMT_vhammer (struct GMT_CTRL *GMT, double lon0, double scale);
-EXTERN_MSC void GMT_vwinkel (struct GMT_CTRL *GMT, double lon0, double scale);
-EXTERN_MSC void GMT_veckert4 (struct GMT_CTRL *GMT, double lon0);
-EXTERN_MSC void GMT_veckert6 (struct GMT_CTRL *GMT, double lon0);
-EXTERN_MSC void GMT_vrobinson (struct GMT_CTRL *GMT, double lon0);
-EXTERN_MSC void GMT_vsinusoidal (struct GMT_CTRL *GMT, double lon0);
-EXTERN_MSC void GMT_vcassini (struct GMT_CTRL *GMT, double lon0, double lat0);
-EXTERN_MSC void GMT_valbers (struct GMT_CTRL *GMT, double lon0, double lat0, double ph1, double ph2);
-EXTERN_MSC void GMT_valbers_sph (struct GMT_CTRL *GMT, double lon0, double lat0, double ph1, double ph2);
-EXTERN_MSC void GMT_veconic (struct GMT_CTRL *GMT, double lon0, double lat0, double ph1, double ph2);
-EXTERN_MSC void GMT_vpolyconic (struct GMT_CTRL *GMT, double lon0, double lat0);
-EXTERN_MSC void GMT_vgrinten (struct GMT_CTRL *GMT, double lon0, double scale);
-EXTERN_MSC void GMT_polar (struct GMT_CTRL *GMT, double x, double y, double *x_i, double *y_i);		/* Convert x/y (being theta,r) to x,y	*/
-EXTERN_MSC void GMT_ipolar (struct GMT_CTRL *GMT, double *x, double *y, double x_i, double y_i);		/* Convert (theta,r) to x,y	*/
-EXTERN_MSC void GMT_translin (struct GMT_CTRL *GMT, double forw, double *inv);				/* Forward linear	*/
-EXTERN_MSC void GMT_translind (struct GMT_CTRL *GMT, double forw, double *inv);				/* Forward linear, but using 0-360 degrees	*/
-EXTERN_MSC void GMT_itranslin (struct GMT_CTRL *GMT, double *forw, double inv);				/* Inverse linear	*/
-EXTERN_MSC void GMT_itranslind (struct GMT_CTRL *GMT, double *forw, double inv);				/* Inverse linear, but using 0-360 degrees	*/
-EXTERN_MSC void GMT_translog10 (struct GMT_CTRL *GMT, double forw, double *inv);				/* Forward log10	*/
-EXTERN_MSC void GMT_itranslog10 (struct GMT_CTRL *GMT, double *forw, double inv);				/* Inverse log10	*/
-EXTERN_MSC void GMT_transpowx (struct GMT_CTRL *GMT, double x, double *x_in);				/* Forward pow x	*/
-EXTERN_MSC void GMT_itranspowx (struct GMT_CTRL *GMT, double *x, double x_in);				/* Inverse pow x	*/
-EXTERN_MSC void GMT_transpowy (struct GMT_CTRL *GMT, double y, double *y_in);				/* Forward pow y 	*/
-EXTERN_MSC void GMT_itranspowy (struct GMT_CTRL *GMT, double *y, double y_in);				/* Inverse pow y 	*/
-EXTERN_MSC void GMT_transpowz (struct GMT_CTRL *GMT, double z, double *z_in);				/* Forward pow z 	*/
-EXTERN_MSC void GMT_itranspowz (struct GMT_CTRL *GMT, double *z, double z_in);				/* Inverse pow z 	*/
-EXTERN_MSC void GMT_albers (struct GMT_CTRL *GMT, double lon, double lat, double *x, double *y);		/* Convert lon/lat to x/y (Albers)	*/
-EXTERN_MSC void GMT_ialbers (struct GMT_CTRL *GMT, double *lon, double *lat, double x, double y);		/* Convert x/y (Albers) to lon/lat	*/
-EXTERN_MSC void GMT_econic (struct GMT_CTRL *GMT, double lon, double lat, double *x, double *y);		/* Convert lon/lat to x/y (Equidistant Conic)	*/
-EXTERN_MSC void GMT_ieconic (struct GMT_CTRL *GMT, double *lon, double *lat, double x, double y);		/* Convert x/y (Equidistant Conic) to lon/lat	*/
-EXTERN_MSC void GMT_polyconic (struct GMT_CTRL *GMT, double lon, double lat, double *x, double *y);	/* Convert lon/lat to x/y (Polyconic)	*/
-EXTERN_MSC void GMT_ipolyconic (struct GMT_CTRL *GMT, double *lon, double *lat, double x, double y);	/* Convert x/y (Polyconic) to lon/lat	*/
-EXTERN_MSC void GMT_albers_sph (struct GMT_CTRL *GMT, double lon, double lat, double *x, double *y);	/* Convert lon/lat to x/y (Albers Spherical)	*/
-EXTERN_MSC void GMT_ialbers_sph (struct GMT_CTRL *GMT, double *lon, double *lat, double x, double y);	/* Convert x/y (Albers Spherical) to lon/lat	*/
-EXTERN_MSC void GMT_azeqdist (struct GMT_CTRL *GMT, double lon, double lat, double *x, double *y);	/* Convert lon/lat to x/y (Azimuthal equal-distance)*/
-EXTERN_MSC void GMT_iazeqdist (struct GMT_CTRL *GMT, double *lon, double *lat, double x, double y);	/* Convert x/y (Azimuthal equal-distance) to lon/lat*/
-EXTERN_MSC void GMT_cassini (struct GMT_CTRL *GMT, double lon, double lat, double *x, double *y);		/* Convert lon/lat to x/y (Cassini)	*/
-EXTERN_MSC void GMT_icassini (struct GMT_CTRL *GMT, double *lon, double *lat, double x, double y);	/* Convert x/y (Cassini) to lon/lat	*/
-EXTERN_MSC void GMT_cassini_sph (struct GMT_CTRL *GMT, double lon, double lat, double *x, double *y);	/* Convert lon/lat to x/y (Cassini Spherical)	*/
-EXTERN_MSC void GMT_icassini_sph (struct GMT_CTRL *GMT, double *lon, double *lat, double x, double y);	/* Convert x/y (Cassini Spherical) to lon/lat	*/
-EXTERN_MSC void GMT_hammer (struct GMT_CTRL *GMT, double lon, double lat, double *x, double *y);		/* Convert lon/lat to x/y (Hammer-Aitoff)	*/
-EXTERN_MSC void GMT_ihammer (struct GMT_CTRL *GMT, double *lon, double *lat, double x, double y);		/* Convert x/y (Hammer-Aitoff) to lon/lat	*/
-EXTERN_MSC void GMT_grinten (struct GMT_CTRL *GMT, double lon, double lat, double *x, double *y);		/* Convert lon/lat to x/y (van der Grinten)	*/
-EXTERN_MSC void GMT_igrinten (struct GMT_CTRL *GMT, double *lon, double *lat, double x, double y);	/* Convert x/y (van der Grinten) to lon/lat	*/
-EXTERN_MSC void GMT_merc_sph (struct GMT_CTRL *GMT, double lon, double lat, double *x, double *y);	/* Convert lon/lat to x/y (Mercator Spherical)	*/
-EXTERN_MSC void GMT_imerc_sph (struct GMT_CTRL *GMT, double *lon, double *lat, double x, double y);	/* Convert x/y (Mercator Spherical) to lon/lat	*/
-EXTERN_MSC void GMT_plrs (struct GMT_CTRL *GMT, double lon, double lat, double *x, double *y);		/* Convert lon/lat to x/y (Polar)		*/
-EXTERN_MSC void GMT_iplrs (struct GMT_CTRL *GMT, double *lon, double *lat, double x, double y);		/* Convert x/y (Polar) to lon/lat		*/
-EXTERN_MSC void GMT_plrs_sph (struct GMT_CTRL *GMT, double lon, double lat, double *x, double *y);	/* Convert lon/lat to x/y (Polar Spherical)	*/
-EXTERN_MSC void GMT_iplrs_sph (struct GMT_CTRL *GMT, double *lon, double *lat, double x, double y);	/* Convert x/y (Polar Spherical) to lon/lat	*/
-EXTERN_MSC void GMT_lamb (struct GMT_CTRL *GMT, double lon, double lat, double *x, double *y);		/* Convert lon/lat to x/y (Lambert)	*/
-EXTERN_MSC void GMT_ilamb (struct GMT_CTRL *GMT, double *lon, double *lat, double x, double y);		/* Convert x/y (Lambert) to lon/lat 	*/
-EXTERN_MSC void GMT_lamb_sph (struct GMT_CTRL *GMT, double lon, double lat, double *x, double *y);	/* Convert lon/lat to x/y (Lambert Spherical)	*/
-EXTERN_MSC void GMT_ilamb_sph (struct GMT_CTRL *GMT, double *lon, double *lat, double x, double y);	/* Convert x/y (Lambert Spherical) to lon/lat 	*/
-EXTERN_MSC void GMT_oblmrc (struct GMT_CTRL *GMT, double lon, double lat, double *x, double *y);		/* Convert lon/lat to x/y (Oblique Mercator)	*/
-EXTERN_MSC void GMT_ioblmrc (struct GMT_CTRL *GMT, double *lon, double *lat, double x, double y);		/* Convert x/y (Oblique Mercator) to lon/lat 	*/
-EXTERN_MSC void GMT_genper (struct GMT_CTRL *GMT, double lon, double lat, double *x, double *y);		/* Convert lon/lat to x/y (ORTHO)  */
-EXTERN_MSC void GMT_igenper (struct GMT_CTRL *GMT, double *lon, double *lat, double x, double y);		/* Convert x/y (ORTHO) to lon/lat  */
-EXTERN_MSC void GMT_ortho (struct GMT_CTRL *GMT, double lon, double lat, double *x, double *y);		/* Convert lon/lat to x/y (GMT_ORTHO)	*/
-EXTERN_MSC void GMT_iortho (struct GMT_CTRL *GMT, double *lon, double *lat, double x, double y);		/* Convert x/y (GMT_ORTHO) to lon/lat 	*/
-EXTERN_MSC void GMT_gnomonic (struct GMT_CTRL *GMT, double lon, double lat, double *x, double *y);	/* Convert lon/lat to x/y (GMT_GNOMONIC)	*/
-EXTERN_MSC void GMT_ignomonic (struct GMT_CTRL *GMT, double *lon, double *lat, double x, double y);	/* Convert x/y (GMT_GNOMONIC) to lon/lat 	*/
-EXTERN_MSC void GMT_sinusoidal (struct GMT_CTRL *GMT, double lon, double lat, double *x, double *y);	/* Convert lon/lat to x/y (GMT_SINUSOIDAL)	*/
-EXTERN_MSC void GMT_isinusoidal (struct GMT_CTRL *GMT, double *lon, double *lat, double x, double y);	/* Convert x/y (GMT_SINUSOIDAL) to lon/lat 	*/
-EXTERN_MSC void GMT_tm (struct GMT_CTRL *GMT, double lon, double lat, double *x, double *y);		/* Convert lon/lat to x/y (TM)	*/
-EXTERN_MSC void GMT_itm (struct GMT_CTRL *GMT, double *lon, double *lat, double x, double y);		/* Convert x/y (TM) to lon/lat 	*/
-EXTERN_MSC void GMT_tm_sph (struct GMT_CTRL *GMT, double lon, double lat, double *x, double *y);		/* Convert lon/lat to x/y (GMT_TM Spherical)	*/
-EXTERN_MSC void GMT_itm_sph (struct GMT_CTRL *GMT, double *lon, double *lat, double x, double y);		/* Convert x/y (GMT_TM Spherical) to lon/lat 	*/
-EXTERN_MSC void GMT_utm (struct GMT_CTRL *GMT, double lon, double lat, double *x, double *y);		/* Convert lon/lat to x/y (UTM)	*/
-EXTERN_MSC void GMT_iutm (struct GMT_CTRL *GMT, double *lon, double *lat, double x, double y);		/* Convert x/y (UTM) to lon/lat 	*/
-EXTERN_MSC void GMT_utm_sph (struct GMT_CTRL *GMT, double lon, double lat, double *x, double *y);		/* Convert lon/lat to x/y (UTM Spherical)	*/
-EXTERN_MSC void GMT_iutm_sph (struct GMT_CTRL *GMT, double *lon, double *lat, double x, double y);	/* Convert x/y (UTM Spherical) to lon/lat 	*/
-EXTERN_MSC void GMT_winkel (struct GMT_CTRL *GMT, double lon, double lat, double *x, double *y);		/* Convert lon/lat to x/y (Winkel)	*/
-EXTERN_MSC void GMT_iwinkel (struct GMT_CTRL *GMT, double *lon, double *lat, double x, double y);		/* Convert x/y (Winkel) to lon/lat	*/
-EXTERN_MSC void GMT_eckert4 (struct GMT_CTRL *GMT, double lon, double lat, double *x, double *y);		/* Convert lon/lat to x/y (Eckert IV)	*/
-EXTERN_MSC void GMT_ieckert4 (struct GMT_CTRL *GMT, double *lon, double *lat, double x, double y);	/* Convert x/y (Eckert IV) to lon/lat	*/
-EXTERN_MSC void GMT_eckert6 (struct GMT_CTRL *GMT, double lon, double lat, double *x, double *y);		/* Convert lon/lat to x/y (Eckert VI)	*/
-EXTERN_MSC void GMT_ieckert6 (struct GMT_CTRL *GMT, double *lon, double *lat, double x, double y);	/* Convert x/y (Eckert VI) to lon/lat	*/
-EXTERN_MSC void GMT_robinson (struct GMT_CTRL *GMT, double lon, double lat, double *x, double *y);	/* Convert lon/lat to x/y (Robinson)	*/
-EXTERN_MSC void GMT_irobinson (struct GMT_CTRL *GMT, double *lon, double *lat, double x, double y);	/* Convert x/y (Robinson) to lon/lat	*/
-EXTERN_MSC void GMT_stereo1 (struct GMT_CTRL *GMT, double lon, double lat, double *x, double *y);		/* Convert lon/lat to x/y (Stereographic)	*/
-EXTERN_MSC void GMT_stereo2 (struct GMT_CTRL *GMT, double lon, double lat, double *x, double *y);		/* Convert lon/lat to x/y (Stereographic, equatorial view)*/
-EXTERN_MSC void GMT_istereo (struct GMT_CTRL *GMT, double *lon, double *lat, double x, double y);		/* Convert x/y (Stereographic) to lon/lat 	*/
-EXTERN_MSC void GMT_stereo1_sph (struct GMT_CTRL *GMT, double lon, double lat, double *x, double *y);	/* Convert lon/lat to x/y (Stereographic Spherical)*/
-EXTERN_MSC void GMT_stereo2_sph (struct GMT_CTRL *GMT, double lon, double lat, double *x, double *y);	/* Convert lon/lat to x/y (Stereographic Spherical, equatorial view)	*/
-EXTERN_MSC void GMT_istereo_sph (struct GMT_CTRL *GMT, double *lon, double *lat, double x, double y);	/* Convert x/y (Stereographic Spherical) to lon/lat 	*/
-EXTERN_MSC void GMT_lambeq (struct GMT_CTRL *GMT, double lon, double lat, double *x, double *y);		/* Convert lon/lat to x/y (Lambert Azimuthal Equal-Area)*/
-EXTERN_MSC void GMT_ilambeq (struct GMT_CTRL *GMT, double *lon, double *lat, double x, double y);		/* Convert x/y (Lambert Azimuthal Equal-Area) to lon/lat*/
-EXTERN_MSC void GMT_mollweide (struct GMT_CTRL *GMT, double lon, double lat, double *x, double *y);	/* Convert lon/lat to x/y (Mollweide Equal-Area)	*/
-EXTERN_MSC void GMT_imollweide (struct GMT_CTRL *GMT, double *lon, double *lat, double x, double y);	/* Convert x/y (Mollweide Equal-Area) to lon/lat 	*/
-EXTERN_MSC void GMT_cyleq (struct GMT_CTRL *GMT, double lon, double lat, double *x, double *y);		/* Convert lon/lat to x/y (Cylindrical Equal-Area)	*/
-EXTERN_MSC void GMT_icyleq (struct GMT_CTRL *GMT, double *lon, double *lat, double x, double y);		/* Convert x/y (Cylindrical Equal-Area) to lon/lat 	*/
-EXTERN_MSC void GMT_cyleqdist (struct GMT_CTRL *GMT, double lon, double lat, double *x, double *y);	/* Convert lon/lat to x/y (Cylindrical Equidistant)	*/
-EXTERN_MSC void GMT_icyleqdist (struct GMT_CTRL *GMT, double *lon, double *lat, double x, double y);	/* Convert x/y (Cylindrical Equidistant) to lon/lat 	*/
-EXTERN_MSC void GMT_miller (struct GMT_CTRL *GMT, double lon, double lat, double *x, double *y);		/* Convert lon/lat to x/y (Miller Cylindrical)	*/
-EXTERN_MSC void GMT_imiller (struct GMT_CTRL *GMT, double *lon, double *lat, double x, double y);		/* Convert x/y (Miller Cylindrical) to lon/lat 	*/
-EXTERN_MSC void GMT_cylstereo (struct GMT_CTRL *GMT, double lon, double lat, double *x, double *y);	/* Convert lon/lat to x/y (Cylindrical Stereographic)	*/
-EXTERN_MSC void GMT_icylstereo (struct GMT_CTRL *GMT, double *lon, double *lat, double x, double y);	/* Convert x/y (Cylindrical Stereographic) to lon/lat 	*/
-EXTERN_MSC void GMT_obl (struct GMT_CTRL *GMT, double lon, double lat, double *olon, double *olat);	/* Convert lon/loat to oblique lon/lat		*/
-EXTERN_MSC void GMT_iobl (struct GMT_CTRL *GMT, double *lon, double *lat, double olon, double olat);	/* Convert oblique lon/lat to regular lon/lat	*/
-EXTERN_MSC double GMT_left_winkel (struct GMT_CTRL *GMT, double y);	/* For Winkel maps	*/
-EXTERN_MSC double GMT_right_winkel (struct GMT_CTRL *GMT, double y);	/* For Winkel maps	*/
-EXTERN_MSC double GMT_left_eckert4 (struct GMT_CTRL *GMT, double y);	/* For Eckert IV maps	*/
-EXTERN_MSC double GMT_right_eckert4 (struct GMT_CTRL *GMT, double y);	/* For Eckert IV maps	*/
-EXTERN_MSC double GMT_left_eckert6 (struct GMT_CTRL *GMT, double y);	/* For Eckert VI maps	*/
-EXTERN_MSC double GMT_right_eckert6 (struct GMT_CTRL *GMT, double y);	/* For Eckert VI maps	*/
-EXTERN_MSC double GMT_left_robinson (struct GMT_CTRL *GMT, double y);	/* For Robinson maps	*/
-EXTERN_MSC double GMT_right_robinson (struct GMT_CTRL *GMT, double y);	/* For Robinson maps	*/
-EXTERN_MSC double GMT_left_sinusoidal (struct GMT_CTRL *GMT, double y);	/* For sinusoidal maps	*/
-EXTERN_MSC double GMT_right_sinusoidal (struct GMT_CTRL *GMT, double y);	/* For sinusoidal maps	*/
-EXTERN_MSC double GMT_left_polyconic (struct GMT_CTRL *GMT, double y);	/* For polyconic maps	*/
-EXTERN_MSC double GMT_right_polyconic (struct GMT_CTRL *GMT, double y);	/* For polyconic maps	*/
-EXTERN_MSC double GMT_cartesian_dist (struct GMT_CTRL *GMT, double x0, double y0, double x1, double y1);
-EXTERN_MSC double GMT_cartesian_dist_proj (struct GMT_CTRL *GMT, double lon1, double lat1, double lon2, double lat2);
-
-/* Complex math from gmt_stat.c */
-EXTERN_MSC void gmt_Cmul (double A[], double B[], double C[]);
-EXTERN_MSC void gmt_Cdiv (double A[], double B[], double C[]);
-EXTERN_MSC void gmt_Ccot (double Z[], double cotZ[]);
-EXTERN_MSC double Cabs (double A[]);
-
-/* From gmt_api.c */
-/* Sub function needed by GMT_end to free memory used in modules and at end of session */
-
-EXTERN_MSC void GMT_Garbage_Collection (struct GMTAPI_CTRL *API, int level);
-EXTERN_MSC char * GMT_create_header_item (struct GMTAPI_CTRL *API, unsigned int mode, void *arg);
-
-/* For supplements */
-EXTERN_MSC int backwards_SQ_parsing (struct GMT_CTRL *GMT, char option, char *item);
-EXTERN_MSC int gmt_comp_double_asc (const void *p_1, const void *p_2);
-
-EXTERN_MSC void gmt_set_double_ptr (double **ptr, double *array);
-EXTERN_MSC void gmt_set_char_ptr (char **ptr, char *array);
-EXTERN_MSC void GMT_free_dataset_ptr (struct GMT_CTRL *GMT, struct GMT_DATASET *data);
-EXTERN_MSC void GMT_free_textset_ptr (struct GMT_CTRL *GMT, struct GMT_TEXTSET *data);
-EXTERN_MSC void GMT_free_cpt_ptr (struct GMT_CTRL *GMT, struct GMT_PALETTE *P);
-EXTERN_MSC unsigned int GMT_free_grid_ptr (struct GMT_CTRL *GMT, struct GMT_GRID *G, bool free_grid);
-EXTERN_MSC unsigned int GMT_free_matrix_ptr (struct GMT_CTRL *GMT, struct GMT_MATRIX *M, bool free_matrix);
-EXTERN_MSC unsigned int GMT_free_vector_ptr (struct GMT_CTRL *GMT, struct GMT_VECTOR *V, bool free_vector);
-#ifdef HAVE_GDAL
-EXTERN_MSC void GMT_free_image_ptr (struct GMT_CTRL *GMT, struct GMT_IMAGE *I, bool free_image);
-EXTERN_MSC struct GMT_IMAGE *GMT_duplicate_image (struct GMT_CTRL *GMT, struct GMT_IMAGE *I, unsigned int mode);
-#endif
-#endif /* _GMT_INTERNALS_H */
diff --git a/src/gmt/gmt_io.h b/src/gmt/gmt_io.h
deleted file mode 100644
index c4d530b..0000000
--- a/src/gmt/gmt_io.h
+++ /dev/null
@@ -1,350 +0,0 @@
-/*--------------------------------------------------------------------
- *	$Id: gmt_io.h 2242 2015-05-16 05:21:28Z caress $
- *
- *	Copyright (c) 1991-2015 by P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis and F. Wobbe
- *	See LICENSE.TXT file for copying and redistribution conditions.
- *
- *	This program is free software; you can redistribute it and/or modify
- *	it under the terms of the GNU Lesser General Public License as published by
- *	the Free Software Foundation; version 3 or any later version.
- *
- *	This program is distributed in the hope that it will be useful,
- *	but WITHOUT ANY WARRANTY; without even the implied warranty of
- *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *	GNU Lesser General Public License for more details.
- *
- *	Contact info: gmt.soest.hawaii.edu
- *--------------------------------------------------------------------*/
-/*
- * Table input/output in GMT can be either ascii or binary (where supported)
- * and ASCII tables may consist of single or multiple segments.  When the
- * latter is the case usually there is a -M option to signal this case.
- * The structure GMT_IO holds parameters that are used during the reading
- * and processing of ascii tables.
- *
- * Author:	Paul Wessel
- * Date:	15-NOV-2009
- * Version:	5 API
- *
- */
-
-#ifndef _GMT_IO_H
-#define _GMT_IO_H
-
-#ifdef HAVE_SETLOCALE
-#	include <locale.h>
-#endif
-
-static inline const char* __gmt_token_separators (void) {
-	static const char separators[] = ",; \t";
-#ifdef HAVE_SETLOCALE
-	struct lconv *lc = localeconv();
-	if ( (strcmp (lc->decimal_point, ",") == 0) )
-		return separators + 1; /* Omit comma */
-#endif
-	return separators;
-}
-#define GMT_TOKEN_SEPARATORS __gmt_token_separators() /* Data columns may be separated by any of these characters */
-
-/* Must add M, m, E, Z, and/or S to the common option processing list */
-#define GMT_OPT(opt) opt
-
-/* Three different i/o status: unused, actively using, or used */
-enum GMT_enum_status {
-	GMT_IS_UNUSED = 0,	/* We have not yet read from/written to this resource */
-	GMT_IS_USING,		/* Means we have started reading from/writing to this file */
-	GMT_IS_USED};		/* Means we are done reading from/writing to this file */
-
-/* THere are three GMT/OGR status values */
-enum GMT_ogr_status {
-	GMT_OGR_UNKNOWN = -1,	/* We have not parsed enough records to know yet */
-	GMT_OGR_FALSE,		/* This is NOT a GMT/OGR file */
-	GMT_OGR_TRUE};		/* This is a GMT/OGR file */
-
-#define GMT_polygon_is_hole(S) (S->pol_mode == GMT_IS_HOLE || (S->ogr && S->ogr->pol_mode == GMT_IS_HOLE))
-
-/* Specific feature geometries as obtained from OGR */
-/* Note: As far as registering or reading data, GMT only needs to know if data type is POINT, LINE, or POLY */
-
-enum GMT_enum_ogr {
-	GMT_IS_LINESTRING = 2,
-	GMT_IS_POLYGON,
-	GMT_IS_MULTIPOINT,
-	GMT_IS_MULTILINESTRING,
-	GMT_IS_MULTIPOLYGON};
-
-/* Codes for aspatial assocation with segment header options: */
-
-enum GMT_enum_segopt {
-	GMT_IS_D = -1,	/* -D */
-	GMT_IS_G = -2,			/* -G */
-	GMT_IS_I = -3,			/* -I */
-	GMT_IS_L = -4,			/* -L */
-	GMT_IS_T = -5,			/* -T */
-	GMT_IS_W = -6,			/* -W */
-	GMT_IS_Z = -7};			/* -Z */
-
-/* Macros to simplify check for return status */
-#define GMT_REC_IS_TABLE_HEADER(C)	(C->current.io.status & GMT_IO_TABLE_HEADER)
-#define GMT_REC_IS_SEGMENT_HEADER(C)	(C->current.io.status & GMT_IO_SEGMENT_HEADER)
-#define GMT_REC_IS_ANY_HEADER(C)	(C->current.io.status & GMT_IO_ANY_HEADER)
-#define GMT_REC_IS_ERROR(C)		(C->current.io.status & GMT_IO_MISMATCH)
-#define GMT_REC_IS_EOF(C)		(C->current.io.status & GMT_IO_EOF)
-#define GMT_REC_IS_NAN(C)		(C->current.io.status & GMT_IO_NAN)
-#define GMT_REC_IS_GAP(C)		(C->current.io.status & GMT_IO_GAP)
-#define GMT_REC_IS_NEW_SEGMENT(C)	(C->current.io.status & GMT_IO_NEW_SEGMENT)
-#define GMT_REC_IS_LINE_BREAK(C)	(C->current.io.status & GMT_IO_LINE_BREAK)
-#define GMT_REC_IS_FILE_BREAK(C)	(C->current.io.status & GMT_IO_NEXT_FILE)
-#define GMT_REC_IS_DATA(C)		(C->current.io.status == 0 || C->current.io.status == GMT_IO_NAN)
-
-/* Get current setting for in/out columns */
-
-/* Determine if current binary table has header */
-#define GMT_binary_header(GMT,dir) (GMT->common.b.active[dir] && GMT->current.setting.io_header[dir] && GMT->current.setting.io_n_header_items)
-
-/* Types of possible column entries in a file: */
-
-enum GMT_col_enum {
-	GMT_IS_NAN   =   0,	/* Returned by GMT_scanf routines when read fails */
-	GMT_IS_FLOAT		=   1,	/* Generic (double) data type, no special format */
-	GMT_IS_LAT		=   2,
-	GMT_IS_LON		=   4,
-	GMT_IS_GEO		=   6,	/* data type is either Lat or Lon */
-	GMT_IS_RELTIME		=   8,	/* For I/O of data in user units */
-	GMT_IS_ABSTIME		=  16,	/* For I/O of data in calendar+clock units */
-	GMT_IS_RATIME		=  24,	/* To see if time is either Relative or Absolute */
-	GMT_IS_ARGTIME		=  32,	/* To invoke GMT_scanf_argtime()  */
-	GMT_IS_DIMENSION	=  64,	/* A float with [optional] unit suffix, e.g., 7.5c, 0.4i; convert to inch  */
-	GMT_IS_GEOANGLE		= 128,	/* An angle to be converted via map projection to angle on map  */
-	GMT_IS_STRING		= 256,	/* An text argument [internally used, not via -f]  */
-	GMT_IS_UNKNOWN		= 512};	/* Input type is not knowable without -f */
-
-/* Various ways to report longitudes */
-
-enum GMT_lon_enum {
-	GMT_IS_GIVEN_RANGE 			= 0,	/* Report lon as is */
-	GMT_IS_0_TO_P360_RANGE			= 1,	/* Report 0 <= lon <= 360 */
-	GMT_IS_0_TO_P360			= 2,	/* Report 0 <= lon < 360 */
-	GMT_IS_M360_TO_0_RANGE			= 3,	/* Report -360 <= lon <= 0 */
-	GMT_IS_M360_TO_0			= 4,	/* Report -360 < lon <= 0 */
-	GMT_IS_M180_TO_P180_RANGE		= 5,	/* Report -180 <= lon <= +180 */
-	GMT_IS_M180_TO_P180			= 6,	/* Report -180 <= lon < +180 */
-	GMT_IS_M180_TO_P270_RANGE		= 7};	/* Report -180 <= lon < +270 [GSHHG only] */
-
-/* How to handle NaNs in records */
-
-enum GMT_io_nan_enum {
-	GMT_IO_NAN_OK = 0,	/* NaNs are fine; just ouput the record as is */
-	GMT_IO_NAN_SKIP,	/* -s[cols]	: Skip records with z == NaN in selected cols [z-col only] */
-	GMT_IO_NAN_KEEP,	/* -sr		: Skip records with z != NaN */
-	GMT_IO_NAN_ONE};	/* -sa		: Skip records with at least one NaN */
-
-/* Use POSIX functions ftello() and fseeko(), which represent the
- * position using the off_t type: */
-#ifdef HAVE_FSEEKO
-#	define fseek fseeko
-#endif
-
-#ifdef HAVE_FTELLO
-#	define ftell ftello
-#endif
-
-/* Windows 64-bit file access */
-//#if defined HAVE__FSEEKI64 && defined HAVE__FTELLI64
-//#	define fseek _fseeki64
-//#	define ftell _ftelli64
-//#	ifndef SIZEOF_OFF_T
-//		typedef __int64 off_t;
-//#	else
-//#		define off_t __int64
-//#	endif /* SIZEOF_OFF_T */
-//#elif !defined SIZEOF_OFF_T /* HAVE__FSEEKI64 && HAVE__FTELLI64 */
-//	typedef long off_t;
-//#endif /* HAVE__FSEEKI64 && HAVE__FTELLI64 */
-
-#define GMT_fdopen(handle, mode) fdopen(handle, mode)
-#define GMT_fgetc(stream) fgetc(stream)
-#define GMT_ungetc(c, stream) ungetc(c, stream)
-#define GMT_fputs(line,fp) fputs(line,fp)
-#define GMT_fread(ptr,size,nmemb,stream) fread(ptr,size,nmemb,stream)
-#define GMT_fwrite(ptr,size,nmemb,stream) fwrite(ptr,size,nmemb,stream)
-#define GMT_rewind(stream) rewind(stream)
-
-/* Low-level structures used internally */
-
-struct GMT_QUAD {	/* Counting parameters needed to determine proper longitude min/max range */
-	uint64_t quad[4];		/* Keeps track if a longitude fell in these quadrants */
-	unsigned int range[2];	/* The format for reporting longitude */
-	double min[2], max[2];		/* Min/max values in either -180/180 or 0/360 counting */
-};
-
-struct GMT_CLOCK_IO {
-	bool skip;			/* Only true if a format string was pass as NULL */
-	double f_sec_to_int;		/* Scale to convert 0.xxx seconds to integer xxx (used for formatting) */
-	int order[3];		/* The relative order of hour, mn, sec in input clock string (-ve if unused) */
-	unsigned int n_sec_decimals;	/* Number of digits in decimal seconds (0 for whole seconds) */
-	bool compact;		/* true if we do not want leading zeros in items (e.g., 03) */
-	bool twelve_hr_clock;	/* true if we are doing am/pm on output */
-	char ampm_suffix[2][8];		/* Holds the strings to append am or pm */
-	char format[GMT_LEN64];	/* Actual C format used to output clock */
-	char delimiter[2][2];		/* Delimiter strings in clock, e.g. ":" */
-};
-
-struct GMT_DATE_IO {
-	bool skip;			/* Only true if a format string was pass as NULL */
-	bool watch;			/* Only true if input format has month last and is monthname */
-	int item_order[4];		/* The sequence year, month, day, day-of-year in input calendar string (-ve if unused) */
-	int item_pos[4];		/* Which position year, month, day, day-of-year has in calendar string (-ve if unused) */
-	bool Y2K_year;		/* true if we have 2-digit years */
-	bool truncated_cal_is_ok;	/* true if we have YMD or YJ order so smallest unit is to the right */
-	bool iso_calendar;		/* true if we do ISO week calendar */
-	bool day_of_year;		/* true if we do day-of-year rather than month/day */
-	bool mw_text;		/* true if we must plot the month name or Week rather than a numeral */
-	bool compact;		/* true if we do not want leading zeros in items (e.g., 03) */
-	char format[GMT_LEN64];	/* Actual C format used to input/output date */
-	char delimiter[2][2];		/* Delimiter strings in date, e.g. "-" */
-};
-
-struct GMT_GEO_IO {			/* For geographic output and plotting */
-	double f_sec_to_int;		/* Scale to convert 0.xxx seconds to integer xxx (used for formatting) */
-	unsigned int n_sec_decimals;	/* Number of digits in decimal seconds (0 for whole seconds) */
-	unsigned int range;		/* 0 for 0/360, 1 for -360/0, 2 for -180/+180 */
-	unsigned int wesn;		/* 1 if we want sign encoded with suffix W, E, S, N, 2 if also want space before letter */
-	int order[3];			/* The relative order of degree, minute, seconds in form (-ve if unused) */
-	bool decimal;			/* true if we want to use the D_FORMAT for decimal degrees only */
-	bool no_sign;			/* true if we want absolute values (plot only) */
-	char x_format[GMT_LEN64];	/* Actual C format used to plot/output longitude */
-	char y_format[GMT_LEN64];	/* Actual C format used to plot/output latitude */
-	char delimiter[2][2];		/* Delimiter strings in date, e.g. "-" */
-};
-
-struct GMT_COL_INFO {	/* Used by -i and input parsing */
-	unsigned int col;	/* The column number in the order requested via -i */
-	unsigned int order;	/* The initial order (0,1,...) but this will be sorted on col */
-	unsigned int convert;	/* 2 if we must convert the data by log10, 1 if scale, offset */
-	double scale;		/* Multiplier for raw in value */
-	double offset;		/* Offset applied after multiplier */ 
-};
-
-struct GMT_COL_TYPE {	/* Used by -b for binary formatting */
-	unsigned int type;	/* Data type e.g., GMT_FLOAT */
-	off_t skip;		/* Rather than read/write an item, jump |skip| bytes before (-ve) or after (+ve) read/write */
-	int (*io) (struct GMT_CTRL *, FILE *, uint64_t, double *);	/* Pointer to the correct read or write function given type/swab */
-};
-
-struct GMT_IO {				/* Used to process input data records */
-	void * (*input) (struct GMT_CTRL *, FILE *, uint64_t *, int *);	/* Pointer to function reading ascii or binary tables */
-	int (*output) (struct GMT_CTRL *, FILE *, uint64_t, double *);	/* Pointer to function writing ascii or binary tables */
-	int (*read_item) (struct GMT_CTRL *, FILE *, uint64_t, double *);		/* Pointer to function reading 1-col z tables in grd2xyz */
-	int (*write_item) (struct GMT_CTRL *, FILE *, uint64_t, double *);		/* Pointer to function writing 1-col z tables in xyz2grd */
-	bool (*ogr_parser) (struct GMT_CTRL *, char *);				/* Set to handle either header or data OGR records */
-
-	unsigned int pad[4];		/* pad[0] = west, pad[1] = east, pad[2] = south, pad[3] = north */
-	unsigned int inc_code[2];
-	double curr_rec[GMT_MAX_COLUMNS];	/* The most recently processed data record */
-	double prev_rec[GMT_MAX_COLUMNS];	/* The previous data record */
-	struct GMT_GRID_INFO grd_info;
-
-	bool multi_segments[2];	/* true if current Ascii input/output file has multiple segments */
-	bool skip_bad_records;	/* true if records where x and/or y are NaN or Inf */
-	bool give_report;		/* true if functions should report how many bad records were skipped */
-	bool skip_duplicates;	/* true if we should ignore duplicate x,y records */
-	bool read_mixed;		/* true if we are reading ascii x y [z] [variable numbers of text] */
-	bool need_previous;		/* true if when parsing a record we need access to previous record values (e.g., for gap or duplicate checking) */
-	bool warn_geo_as_cartesion;	/* true if we should warn if we read a record with geographic data while the expected format has not been set (i.e., no -J or -fg) */
-
-	uint64_t seg_no;		/* Number of current multi-segment in entire data set */
-	uint64_t seg_in_tbl_no;		/* Number of current multi-segment in current table */
-	uint64_t n_clean_rec;		/* Number of clean records read (not including skipped records or comments or blanks) */
-	uint64_t n_bad_records;		/* Number of bad records encountered during i/o */
-	unsigned int tbl_no;		/* Number of current table in entire data set */
-	unsigned int io_nan_ncols;	/* Number of columns to consider for -s option */
-	enum GMT_ogr_status ogr;	/* Tells us if current input source has OGR/GMT metadata (GMT_OGR_TRUE) or not (GMT_OGR_FALSE) or not set (GMT_OGR_UNKNOWN) */
-	unsigned int status;		/* 0	All is ok
-					   1	Current record is segment header
-					   2	Mismatch between actual and expected fields
-					   4	EOF
-					   8	NaNs encountered in first 2/3 cols */
-	uint64_t rec_no;		/* Number of current records (counts headers etc) in entire data set */
-	uint64_t rec_in_tbl_no;		/* Number of current record (counts headers etc) in current table */
-	uint64_t pt_no;			/* Number of current valid points in a row  */
-	uint64_t curr_pos[2][3];	/* Keep track of current input/output table, segment, and row (for rec-by-rec action) */
-	char r_mode[4];			/* Current file opening mode for reading (r or rb) */
-	char w_mode[4];			/* Current file opening mode for writing (w or wb) */
-	char a_mode[4];			/* Current file append mode for writing (a+ or ab+) */
-	char current_record[GMT_BUFSIZ];	/* Current ascii record */
-	char segment_header[GMT_BUFSIZ];	/* Current ascii segment header */
-	char current_filename[2][GMT_BUFSIZ];	/* Current filenames (or <stdin>/<stdout>) */
-	char *o_format[GMT_MAX_COLUMNS];	/* Custom output ascii format to overrule format_float_out */
-	int ncid;			/* NetCDF file ID (when opening netCDF file) */
-	int nvars;			/* Number of requested variablesin netCDF file */
-	uint64_t ncols;			/* Number of total columns in netCDF file */
-	size_t t_index[GMT_MAX_COLUMNS][5];		/* Indices for cross-sections (netCDF only) */
-	size_t count[GMT_MAX_COLUMNS][5];		/* Count used for cross-sections (netCDF only) */
-	size_t ndim;			/* Length of the column dimension */
-	size_t nrec;			/* Record count */
-	struct GMT_DATE_IO date_input;	/* Has all info on how to decode input dates */
-	struct GMT_DATE_IO date_output;	/* Has all info on how to write output dates */
-	struct GMT_CLOCK_IO clock_input;	/* Has all info on how to decode input clocks */
-	struct GMT_CLOCK_IO clock_output;	/* Has all info on how to write output clocks */
-	struct GMT_GEO_IO geo;		/* Has all the info on how to write geographic coordinates */
-	bool skip_if_NaN[GMT_MAX_COLUMNS];	/* true if column j cannot be NaN and we must skip the record */
-	bool col_skip[GMT_MAX_COLUMNS];	/* true of input column is to be ignored [Default reads all columns, but see -i] */
-	unsigned int col_type[2][GMT_MAX_COLUMNS];	/* Type of column on input and output: Time, geographic, etc, see GMT_IS_<TYPE> */
-	unsigned int io_nan_col[GMT_MAX_COLUMNS];	/* Array of columns to consider for -s option ir true */
-	struct GMT_COL_INFO col[2][GMT_MAX_COLUMNS];	/* Order of columns on input and output unless 0,1,2,3,... */
-	struct GMT_COL_TYPE fmt[2][GMT_MAX_COLUMNS];	/* Formatting information for binary data */
-	struct GMT_OGR *OGR;		/* Pointer to GMT/OGR info used during reading */
-	/* The remainder are just pointers to memory allocated elsewhere */
-	int *varid;			/* Array of variable IDs (netCDF only) */
-	double *scale_factor;		/* Array of scale factors (netCDF only) */
-	double *add_offset;		/* Array of offsets (netCDF only) */
-	double *missing_value;		/* Array of missing values (netCDF only) */
-};
-
-struct GMT_Z_IO {		/* Used when processing z(x,y) table input when (x,y) is implicit */
-	bool swab;		/* true if we must swap byte-order */
-	bool binary;		/* true if we are reading/writing binary data */
-	bool input;		/* true if we are reading, false if we are writing */
-	int x_step;	/* +1 if logical x values increase to right, else -1 */
-	int y_step;	/* +1 if logical y values increase upwards, else -1 */
-	unsigned int x_missing;	/* 1 if a periodic (right) column is implicit (i.e., not stored) */
-	unsigned int y_missing;	/* 1 if a periodic (top) row is implicit (i.e., not stored) */
-	unsigned int format;	/* Either GMT_IS_COL_FORMAT or GMT_IS_ROW_FORMAT */
-	unsigned int x_period;	/* length of a row in the input data ( <= nx, see x_missing) */
-	unsigned int y_period;	/* length of a col in the input data ( <= ny, see y_missing) */
-	unsigned int start_col;	/* First logical column in file */
-	unsigned int start_row;	/* First logical row in file */
-	unsigned int gmt_i;		/* Current column number in the GMT registered grid */
-	unsigned int gmt_j;		/* Current row number in the GMT registered grid */
-	uint64_t n_expected;	/* Number of data element expected to be read */
-	off_t skip;		/* Number of bytes to skip before reading data */
-	uint64_t (*get_gmt_ij) (struct GMT_Z_IO *, struct GMT_GRID *, uint64_t);	/* Pointer to function that converts running number to GMT ij */
-};
-
-struct GMT_PARSE_Z_IO {	/* -Z[<flags>] */
-	bool active;		/* true if selected */
-	bool not_grid;		/* false if binary data file is a grid so organization matters */
-	bool repeat[2];		/* true if periodic in x|y and repeating row/col is missing */
-	enum GMT_swap_direction swab;	/* k_swap_none = no byte swapping, k_swap_inswaps input, k_swap_out swaps output, combine to swap both */
-	off_t skip;		/* Initial bytes to skip before reading */
-	char type;		/* Data type flag A|a|c|u|h|H|i|I|l|L|f|d */
-	char format[2];		/* 2-char code describing row/col organization for grids */
-};
-
-struct GMT_PLOT_CALCLOCK {
-	struct GMT_DATE_IO date;
-	struct GMT_CLOCK_IO clock;
-	struct GMT_GEO_IO geo;
-};
-
-/* Byteswap widths used with gmt_byteswap_file */
-typedef enum {
-	Int16len = 2,
-	Int32len = 4,
-	Int64len = 8
-} SwapWidth;
-
-/* For the GMT_GRID container, see gmt_grdio.h */
-
-#endif /* _GMT_IO_H */
diff --git a/src/gmt/gmt_macros.h b/src/gmt/gmt_macros.h
deleted file mode 100644
index 2191dbf..0000000
--- a/src/gmt/gmt_macros.h
+++ /dev/null
@@ -1,109 +0,0 @@
-/*--------------------------------------------------------------------
- *	$Id: gmt_macros.h 13846 2014-12-28 21:46:54Z pwessel $
- *
- *	Copyright (c) 1991-2015 by P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis and F. Wobbe
- *	See LICENSE.TXT file for copying and redistribution conditions.
- *
- *	This program is free software; you can redistribute it and/or modify
- *	it under the terms of the GNU Lesser General Public License as published by
- *	the Free Software Foundation; version 3 or any later version.
- *
- *	This program is distributed in the hope that it will be useful,
- *	but WITHOUT ANY WARRANTY; without even the implied warranty of
- *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *	GNU Lesser General Public License for more details.
- *
- *	Contact info: gmt.soest.hawaii.edu
- *--------------------------------------------------------------------*/
-/*
- * gmt_macros.h contains definitions of macros used throught GMT.
- *
- * Author:	Paul Wessel
- * Date:	01-OCT-2009
- * Version:	5 API
- */
-
-#ifndef _GMT_MACROS_H
-#define _GMT_MACROS_H
-
-/*--------------------------------------------------------------------
- *			GMT MACROS DEFINITIONS
- *--------------------------------------------------------------------*/
-
-#define GMT_compat_check(C,version) (C->current.setting.compatibility <= version)	/* true if this section should be processed with backwards compatibility to given version */
-
-#ifndef MIN
-#define MIN(x, y) (((x) < (y)) ? (x) : (y))	/* min and max value macros */
-#endif
-#ifndef MAX
-#define MAX(x, y) (((x) > (y)) ? (x) : (y))
-#endif
-#ifndef MOD			/* Knuth-style modulo function (remainder after floored division) */
-#define MOD(x, y) (x - y * floor((double)(x)/(double)(y)))
-#endif
-
-/* Checking of h,m,s */
-
-#define GMT_hms_is_bad(h,m,s) ((h) < 0 || (h) > 23 || (m) < 0 || (m) > 59 || (s) < 0.0 || (s) >= 61.0)
-
-/* Safe math macros that check arguments */
-
-#define d_log10(C,x) ((x) <= 0.0 ? C->session.d_NaN : log10 (x))
-#define d_log10f(C,x) ((x) <= 0.0f ? C->session.f_NaN : log10f (x))
-#define d_log101p(C,x) ((x) <= -1.0 ? C->session.d_NaN : log10 (1.0+(x)))
-#define d_log101pf(C,x) ((x) <= -1.0f ? C->session.f_NaN : log10f (1.0f+(x)))
-#define d_sqrt(x) ((x) < 0.0 ? 0.0 : sqrt (x))
-#define d_acos(x) (fabs(x) >= 1.0 ? ((x) < 0.0 ? M_PI : 0.0) : acos(x))
-#define d_acosf(x) (fabsf(x) >= 1.0 ? ((x) < 0.0f ? (float)M_PI : 0.0f) : acosf(x))
-#define d_asin(x) (fabs(x) >= 1.0 ? copysign (M_PI_2, x) : asin(x))
-#define d_asinf(x) (fabsf(x) >= 1.0 ? copysignf ((float)M_PI_2, x) : asinf(x))
-#define d_atan2(y,x) ((x) == 0.0 && (y) == 0.0 ? 0.0 : atan2(y, x))
-#define d_atan2f(y,x) ((x) == 0.0f && (y) == 0.0f ? 0.0f : atan2f(y, x))
-#define d_log(C,x) ((x) <= 0.0 ? C->session.d_NaN : log (x))
-#define d_log2(C,x) ((x) <= 0.0f ? C->session.f_NaN : logf (x))
-#define d_logf(C,x) ((x) <= 0.0f ? C->session.f_NaN : logf (x))
-#define d_log1p(C,x) ((x) <= -1.0 ? C->session.d_NaN : log1p (x))
-#define d_log1pf(C,x) ((x) <= -1.0f ? C->session.f_NaN : log1pf (x))
-
-/* Macros for degree-based trig */
-
-#define sind(x) sin((x) * D2R)
-#define sindf(x) sinf((x) * D2R)
-#define cosd(x) cos((x) * D2R)
-#define cosdf(x) cosf((x) * D2R)
-#define tand(x) tan((x) * D2R)
-#define tandf(x) tanf((x) * D2R)
-#define sincosd(x,s,c) sincos((x) * D2R,s,c)
-#define asind(x) (asin(x) * R2D)
-#define acosd(x) (acos(x) * R2D)
-#define atand(x) (atan(x) * R2D)
-#define atan2d(y,x) (atan2(y,x) * R2D)
-#define atan2df(y,x) (atan2f(y,x) * R2D)
-
-/* Safe versions of the degree-based trig */
-
-#define d_acosd(x) (fabs(x) >= 1.0 ? ((x) < 0.0 ? 180.0 : 0.0) : acosd(x))
-#define d_asind(x) (fabs(x) >= 1.0 ? copysign (90.0, (x)) : asind(x))
-#define d_atan2d(y,x) ((x) == 0.0 && (y) == 0.0 ? 0.0 : atan2d(y,x))
-
-/* Macros for swapping misc data types */
-
-#define bool_swap(x, y) {bool bool_tmp; bool_tmp = x, x = y, y = bool_tmp;}
-#define uint64_swap(x, y) {uint64_t uint64_t_tmp; uint64_t_tmp = x, x = y, y = uint64_t_tmp;}
-#define int_swap(x, y) {int int_tmp; int_tmp = x, x = y, y = int_tmp;}
-#define uint_swap(x, y) {unsigned int uint_tmp; uint_tmp = x, x = y, y = uint_tmp;}
-#define double_swap(x, y) {double double_tmp; double_tmp = x, x = y, y = double_tmp;}
-#define float_swap(x, y) {float float_tmp; float_tmp = x, x = y, y = float_tmp;}
-
-/* Macro to ensure proper value and sign of a change in longitude from lon1 to lon2 */
-#define GMT_set_delta_lon(lon1,lon2,delta) {delta = lon2 - lon1; if (fabs (delta) > 180.0) delta = copysign (360.0 - fabs (delta), -delta);}
-
-/* Macro to simplify call to memcpy when duplicating values and memset when zeroing out */
-#define GMT_memcpy(to,from,n,type) memcpy(to, from, (n)*sizeof(type))
-#define GMT_memset(array,n,type) memset(array, 0, (n)*sizeof(type))
-/* Macro to set all items in an array to the given value */
-#define GMT_setnval(array,n,value) {uint64_t k; for (k = 0; k < (uint64_t)n; k++) array[k] = value;}
-/* Macro to simplify assignment of one 3-vector to another */
-#define GMT_cpy3v(to,from) memcpy(to, from, 3*sizeof(double))
-
-#endif  /* _GMT_MACROS_H */
diff --git a/src/gmt/gmt_map.h b/src/gmt/gmt_map.h
deleted file mode 100644
index 8c93106..0000000
--- a/src/gmt/gmt_map.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/*--------------------------------------------------------------------
- *	$Id: gmt_map.h 13846 2014-12-28 21:46:54Z pwessel $
- *
- *	Copyright (c) 1991-2015 by P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis and F. Wobbe
- *	See LICENSE.TXT file for copying and redistribution conditions.
- *
- *	This program is free software; you can redistribute it and/or modify
- *	it under the terms of the GNU Lesser General Public License as published by
- *	the Free Software Foundation; version 3 or any later version.
- *
- *	This program is distributed in the hope that it will be useful,
- *	but WITHOUT ANY WARRANTY; without even the implied warranty of
- *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *	GNU Lesser General Public License for more details.
- *
- *	Contact info: gmt.soest.hawaii.edu
- *--------------------------------------------------------------------*/
-/*
- * gmt_map.h contains definitions of macros used in GMT.
- *
- * Author:	Paul Wessel
- * Date:	01-OCT-2009
- * Version:	5 API
- */
-
-#ifndef _GMT_MAP_H
-#define _GMT_MAP_H
-
-#define METERS_IN_A_FOOT		0.3048			/* 2.54 * 12 / 100 */
-#define METERS_IN_A_SURVEY_FOOT		(1200.0/3937.0)		/* ~0.3048006096 m */
-#define METERS_IN_A_KM			1000.0
-#define METERS_IN_A_MILE		1609.433	/* meters in statute mile */
-#define METERS_IN_A_NAUTICAL_MILE	1852.0
-#define GMT_MAP_DIST_UNIT		'e'		/* Default distance is the meter */
-
-enum GMT_enum_coord {GMT_GEOGRAPHIC = 0,	/* Means coordinates are lon,lat : compute spherical distances */
-	GMT_CARTESIAN,	/* Means coordinates are Cartesian x,y : compute Cartesian distances */
-	GMT_GEO2CART,	/* Means coordinates are lon,lat but must be mapped to (x,y) : compute Cartesian distances */
-	GMT_CART2GEO};	/* Means coordinates are lon,lat but must be mapped to (x,y) : compute Cartesian distances */
-
-enum GMT_enum_dist {GMT_MAP_DIST = 0,	/* Distance in the map */
-	GMT_CONT_DIST,		/* Distance along a contour or line in dist units */
-	GMT_LABEL_DIST};	/* Distance along a contour or line in dist label units */
-
-enum GMT_enum_path {GMT_RESAMPLE_PATH = 0,	/* Default: Resample geographic paths based in a max gap allowed (path_step) */
-	GMT_LEAVE_PATH};	/* Options like -A can turn of this resampling, where available */
-
-enum GMT_enum_cdist {GMT_CARTESIAN_DIST	 = 0,	/* Cartesian 2-D x,y data, r = hypot */
-	GMT_CARTESIAN_DIST2,		/* Cartesian 2-D x,y data, return r^2 to avoid hypot */
-	GMT_CARTESIAN_DIST_PROJ,	/* Project lon,lat to Cartesian 2-D x,y data, then get distance */
-	GMT_CARTESIAN_DIST_PROJ2,	/* Same as --"-- but return r^2 to avoid hypot */
-	GMT_CARTESIAN_DIST_PROJ_INV};	/* Project Cartesian 2-D x,y data to lon,lat, then get distance */
-enum GMT_enum_mdist {GMT_FLATEARTH = 1,	/* Compute Flat Earth distances */
-	GMT_GREATCIRCLE,	/* Compute great circle distances */
-	GMT_GEODESIC,		/* Compute geodesic distances */
-	GMT_LOXODROME};		/* Compute loxodrome distances (otherwise same as great circle machinery) */
-enum GMT_enum_sph {GMT_DIST_M = 10,	/* 2-D lon, lat data, convert distance to meter */
-	GMT_DIST_DEG = 20,	/* 2-D lon, lat data, convert distance to spherical degree */
-	GMT_DIST_COS = 30};	/* 2-D lon, lat data, convert distance to cos of spherical degree */
-
-struct GMT_DIST {	/* Holds info for a particular distance calculation */
-	bool init;	/* true if we have initialized settings for this type via GMT_init_distaz */
-	bool arc;	/* true if distances are in deg/min/sec or arc; otherwise they are e|f|k|M|n or Cartesian */
-	double (*func) (struct GMT_CTRL *, double, double, double, double);	/* pointer to function returning distance between two points points */
-	double scale;	/* Scale to convert function output to desired unit */
-};
-
-#endif /* _GMT_MAP_H */
diff --git a/src/gmt/gmt_media_name.h b/src/gmt/gmt_media_name.h
deleted file mode 100644
index be3dee5..0000000
--- a/src/gmt/gmt_media_name.h
+++ /dev/null
@@ -1,31 +0,0 @@
-"a0",
-"a1",
-"a2",
-"a3",
-"a4",
-"a5",
-"a6",
-"a7",
-"a8",
-"a9",
-"a10",
-"b0",
-"b1",
-"b2",
-"b3",
-"b4",
-"b5",
-"archa",
-"archb",
-"archc",
-"archd",
-"arche",
-"flsa",
-"halfletter",
-"statement",
-"note",
-"letter",
-"legal",
-"11x17",
-"tabloid",
-"ledger"
diff --git a/src/gmt/gmt_media_size.h b/src/gmt/gmt_media_size.h
deleted file mode 100644
index 6a959ad..0000000
--- a/src/gmt/gmt_media_size.h
+++ /dev/null
@@ -1,31 +0,0 @@
-{2380.0, 3368.0},
-{1684.0, 2380.0},
-{1190.0, 1684.0},
-{842.0, 1190.0},
-{595.0, 842.0},
-{421.0, 595.0},
-{297.0, 421.0},
-{210.0, 297.0},
-{148.0, 210.0},
-{105.0, 148.0},
-{74.0, 105.0},
-{2836.0, 4008.0},
-{2004.0, 2836.0},
-{1418.0, 2004.0},
-{1002.0, 1418.0},
-{709.0, 1002.0},
-{501.0, 709.0},
-{648.0, 864.0},
-{864.0, 1296.0},
-{1296.0, 1728.0},
-{1728.0, 2592.0},
-{2592.0, 3456.0},
-{612.0, 936.0},
-{396.0, 612.0},
-{396.0, 612.0},
-{540.0, 720.0},
-{612.0, 792.0},
-{612.0, 1008.0},
-{792.0, 1224.0},
-{792.0, 1224.0},
-{1224.0, 792.0}
diff --git a/src/gmt/gmt_memory.h b/src/gmt/gmt_memory.h
deleted file mode 100644
index a0302af..0000000
--- a/src/gmt/gmt_memory.h
+++ /dev/null
@@ -1,92 +0,0 @@
-/*--------------------------------------------------------------------
- *	$Id$
- *
- *	Copyright (c) 1991-2015 by P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis and F. Wobbe
- *	See LICENSE.TXT file for copying and redistribution conditions.
- *
- *	This program is free software; you can redistribute it and/or modify
- *	it under the terms of the GNU Lesser General Public License as published by
- *	the Free Software Foundation; version 3 or any later version.
- *
- *	This program is distributed in the hope that it will be useful,
- *	but WITHOUT ANY WARRANTY; without even the implied warranty of
- *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *	GNU Lesser General Public License for more details.
- *
- *	Contact info: gmt.soest.hawaii.edu
- *--------------------------------------------------------------------*/
-
-#ifndef _GMT_MEMORY_H
-#define _GMT_MEMORY_H
-
-enum GMT_enum_mem_alloc {	/* Initial memory for 2 double columns is 32 Mb */
-	GMT_INITIAL_MEM_COL_ALLOC	= 2U,
-	GMT_INITIAL_MEM_ROW_ALLOC	= 2097152U	/* 2^21 */	
-};
-
-/* Macros to reallocate memory for groups of 2, 3 or 4 arrays at a time of the same size/type */
-#if defined (DEBUG) || defined (MEMDEBUG)
-#define GMT_malloc(C,a,n,n_alloc,type) GMT_malloc_func(C,a,n,n_alloc,sizeof(type),__SOURCE_LINE_FUNC)
-#else
-#define GMT_malloc(C,a,n,n_alloc,type) GMT_malloc_func(C,a,n,n_alloc,sizeof(type),__func__)
-#endif
-/* The __kp = n_alloc below is needed since NULL may be passed. __k is used to ensure only the final GMT_malloc call changes n_alloc (unless it is NULL) */
-#define GMT_malloc2(C,a,b,n,n_alloc,type) { size_t __k, *__kp = n_alloc; __k = (__kp) ? *__kp : 0U; a = GMT_malloc(C,a,n,&__k,type); b = GMT_malloc(C,b,n,n_alloc,type); }
-#define GMT_malloc3(C,a,b,c,n,n_alloc,type) { size_t __k, *__kp = n_alloc; __k = (__kp) ? *__kp : 0U; a = GMT_malloc(C,a,n,&__k,type); __k = (__kp) ? *__kp : 0U; b = GMT_malloc(C,b,n,&__k,type); c = GMT_malloc(C,c,n,n_alloc,type); }
-#define GMT_malloc4(C,a,b,c,d,n,n_alloc,type) { size_t __k, *__kp = n_alloc; __k = (__kp) ? *__kp : 0U; a = GMT_malloc(C,a,n,&__k,type); __k = (__kp) ? *__kp : 0U; b = GMT_malloc(C,b,n,&__k,type); __k = (__kp) ? *__kp : 0U; c = GMT_malloc(C,c,n,&__k,type); d = GMT_malloc(C,d,n,n_alloc,type); }
-
-/* Convenience macro for GMT_memory_func */
-#if defined (DEBUG) || defined (MEMDEBUG)
-#define GMT_memory(C,ptr,n,type) GMT_memory_func(C,ptr,n,sizeof(type),false,__SOURCE_LINE_FUNC)
-#define GMT_memory_aligned(C,ptr,n,type) GMT_memory_func(C,ptr,n,sizeof(type),true,__SOURCE_LINE_FUNC)
-#else
-#define GMT_memory(C,ptr,n,type) GMT_memory_func(C,ptr,n,sizeof(type),false,__func__)
-#define GMT_memory_aligned(C,ptr,n,type) GMT_memory_func(C,ptr,n,sizeof(type),true,__func__)
-#endif
-
-/* Convenience macro for GMT_free_func */
-#if defined (DEBUG) || defined (MEMDEBUG)
-#define GMT_free(C,ptr) (GMT_free_func(C,ptr,false,__SOURCE_LINE_FUNC),(ptr)=NULL)
-#define GMT_free_aligned(C,ptr) (GMT_free_func(C,ptr,true,__SOURCE_LINE_FUNC),(ptr)=NULL)
-#else
-#define GMT_free(C,ptr) (GMT_free_func(C,ptr,false,__func__),(ptr)=NULL)
-#define GMT_free_aligned(C,ptr) (GMT_free_func(C,ptr,true,__func__),(ptr)=NULL)
-#endif
-
-#ifdef MEMDEBUG
-
-struct MEMORY_ITEM {
-	size_t size;	/* Size of memory allocated */
-	void *ptr;	/* Memory pointer */
-	char *name;	/* Source filename and line or function name */
-	size_t ID;	/* Unique ID for this allocation */
-	struct MEMORY_ITEM *l, *r;
-};
-
-struct MEMORY_TRACKER {
-	bool active;	/* Normally true but can be changed to focus on just some allocations */
-	bool search;	/* Normally true but can be changed to skip searching when we know we add a new item */
-	bool do_log;	/* true if we wish to write detailed alloc/free log */
-	uint64_t n_ptr;		/* Number of unique pointers to allocated memory */
-	uint64_t n_allocated;	/* Number of items allocated by GMT_memory */
-	uint64_t n_reallocated;	/* Number of items reallocated by GMT_memory */
-	uint64_t n_freed;	/* Number of items freed by GMT_free */
-	uint64_t n_ID;		/* Running number assigned to new allocations */
-	uint64_t find;		/* If > 0 then we look for this ID to be allocated */
-	size_t current;		/* Memory allocated at current time */
-	size_t maximum;		/* Highest memory count during execution */
-	size_t largest;		/* Highest memory allocation to a single variable */
-	size_t n_alloc;		/* Allocated size of memory pointer array */
-	struct MEMORY_ITEM *root; /* Pointer to splay tree */
-	FILE *fp;	/* For logging if GMT_TRACK_MEMORY is 2 */
-};
-
-/* Items needed if -DMEMDEBUG is in effect */
-EXTERN_MSC int GMT_memtrack_init (struct GMT_CTRL *GMT);
-EXTERN_MSC void GMT_memtrack_report (struct GMT_CTRL *GMT);
-EXTERN_MSC void GMT_memtrack_on (struct GMT_CTRL *GMT);
-EXTERN_MSC void GMT_memtrack_off (struct GMT_CTRL *GMT);
-
-#endif
-
-#endif /* _GMT_MEMORY_H */
diff --git a/src/gmt/gmt_mgg_header2.h b/src/gmt/gmt_mgg_header2.h
deleted file mode 100644
index 24ce219..0000000
--- a/src/gmt/gmt_mgg_header2.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*	$Id: gmt_mgg_header2.h 12822 2014-01-31 23:39:56Z remko $
- *
- *	Code donated by David Divens, NOAA/NGDC
- *	Distributed under the GNU Public License (see LICENSE.TXT for details)
- */
-#ifndef _H_MGG_HEADER_2
-#define _H_MGG_HEADER_2
-
-enum GMT_enum_grd98 {GRD98_MAGIC_NUM = 1000000000,
-	GRD98_VERSION		= 1,
-	GRD98_NAN_VALUE		= 999999,
-	GRD98_DEFAULT_PREC	= 10,
-	GRD98_N_UNUSED		= 10};
-
-typedef struct {
-	int	version;		/* 1,000,000,001 Magic_Num + Version */
-	int	length;			/* 128 bytes */
-	int     dataType;       /* 1=data, 2=density, 3=radius, -1=template */
-	int	latDeg;
-	int	latMin;
-	int	latSec;
-	int	latSpacing;
-	int	latNumCells;
-	int	lonDeg;
-	int	lonMin;
-	int	lonSec;
-	int	lonSpacing;
-	int	lonNumCells;
-	int	minValue;		/* Whole meters */
-	int	maxValue;		/* Whole meters */
-	int	gridRadius;		/* -1 for grid radius not performed */
-	int	precision;     	 /* 1 = whole meters, 10 = tenths of meters */
-	int	nanValue;
-	int     numType;        /* bytesize, pos=int, neg=float */
-	int     waterDatum;     /* Vertical datum 0 = Mean Sea Level, 1 = local */
-	int	dataLimit;		/* 2-byte, 4-byte -1 = float */
-	int	cellRegistration;	/* 1 for pixel (cell centered), 0 for gridline */
-	int    unused[GRD98_N_UNUSED];	/* Unused 4byte ints */
-} MGG_GRID_HEADER_2;
-
-#endif
diff --git a/src/gmt/gmt_nan.h b/src/gmt/gmt_nan.h
deleted file mode 100644
index 262090d..0000000
--- a/src/gmt/gmt_nan.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/*--------------------------------------------------------------------
- *	$Id: gmt_nan.h 13846 2014-12-28 21:46:54Z pwessel $
- *
- *	Copyright (c) 1991-2015 by P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis and F. Wobbe
- *	See LICENSE.TXT file for copying and redistribution conditions.
- *
- *	This program is free software; you can redistribute it and/or modify
- *	it under the terms of the GNU Lesser General Public License as published by
- *	the Free Software Foundation; version 3 or any later version.
- *
- *	This program is distributed in the hope that it will be useful,
- *	but WITHOUT ANY WARRANTY; without even the implied warranty of
- *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *	GNU Lesser General Public License for more details.
- *
- *	Contact info: gmt.soest.hawaii.edu
- *--------------------------------------------------------------------*/
-/*
- * Machine-dependent macros for generation and testing of NaNs.
- *
- * These routines use the IEEE definition of Silent NaNs to set NaNs and
- * use the avialable isnan* routines to test NaNs whenever available.
- *
- * Notes:
- *    If your system has no IEEE support, add -DNO_IEEE to CFLAGS
- *    We will then use the max double/float values to signify NaNs.
- *
- * Author:	Remko Scharroo
- * Date:	1-JAN-2010
- * Ver:		5 API
- */
-
-#ifndef _GMT_NAN_H
-#define _GMT_NAN_H
-
-//#include "gmt_notposix.h"
-
-#ifdef NO_IEEE
-#	define GMT_make_fnan(x) (x = FLT_MAX)
-#	define GMT_make_dnan(x) (x = DBL_MAX)
-#	define GMT_is_fnan(x) ((x) == FLT_MAX)
-#	define GMT_is_dnan(x) ((x) == DBL_MAX)
-#else
-#	define GMT_make_fnan(x) (x = (float) NAN)
-#	define GMT_make_dnan(x) (x = NAN)
-#	define GMT_is_fnan isnan
-#	define GMT_is_dnan isnan
-#endif
-
-#endif /* _GMT_NAN_H */
diff --git a/src/gmt/gmt_notposix.h b/src/gmt/gmt_notposix.h
deleted file mode 100644
index b30c801..0000000
--- a/src/gmt/gmt_notposix.h
+++ /dev/null
@@ -1,570 +0,0 @@
-/*--------------------------------------------------------------------
- * $Id: gmt_notposix.h 13846 2014-12-28 21:46:54Z pwessel $
- *
- * Copyright (c) 1991-2015 by P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis, and F. Wobbe
- * See LICENSE.TXT file for copying and redistribution conditions.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; version 3 or any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Lesser General Public License for more details.
- *
- * Contact info: gmt.soest.hawaii.edu
- *--------------------------------------------------------------------
- *
- * This include file contains ifdefs that tell us if this system has
- * some of the several functions that are not part of POSIX but are
- * often distributed anyway as part of ANSI C.  The set of defines
- * below is automatically assigned by CMake and determines if the
- * required functions are present or not.  These macros are then used
- * to choose between a function prototype (if found), an alternative
- * GMT function, or simply a macro.  The purpose is to take advantage
- * of the built-in functions if they exist and provide alternative
- * definitions otherwise.
- */
-
-#ifndef _GMT_NOTPOSIX_H
-#define _GMT_NOTPOSIX_H
-
-/* HAVE_<func> is undefined or defined as 1 depending on
- * whether or not <func> is available on this system.
- * The definitions are stored in gmt_config.h */
-#include "gmt_config.h"
-
-/* Declaration modifiers for DLL support (MSC et al) */
-#include "declspec.h"
-
-/*
- * Include POSIX headers
- */
-
-#include <stdlib.h>
-
-#ifdef HAVE_ASSERT_H_
-#	include <assert.h>
-#else
-#	define assert(e) ((void)0)
-#endif
-
-#ifdef HAVE_BASENAME
-#	include <libgen.h>
-#else
-#	define basename GMT_basename
-#endif
-
-#ifdef HAVE_CTYPE_H_
-#	include <ctype.h>
-#endif
-
-#ifdef HAVE_STDBOOL_H_
-#	include <stdbool.h>
-#else
-#	include "compat/stdbool.h"
-#endif
-
-#ifdef HAVE_SYS_TYPES_H_
-#	include <sys/types.h>
-#endif
-
-#ifndef SIZEOF_MODE_T
-  /* MSC does not define mode_t */
-	typedef unsigned int mode_t;
-#endif
-
-#ifdef HAVE_FCNTL_H_
-#	include <fcntl.h>
-#endif
-
-#ifdef HAVE_SYS_STAT_H_
-#	include <sys/stat.h>
-#endif
-
-#ifdef HAVE_STDDEF_H_
-#	include <stddef.h>
-#endif
-
-#ifdef HAVE_UNISTD_H_
-#	include <unistd.h>
-#endif
-
-#ifdef HAVE_STDINT_H_          /* VS 2010 has stdint.h */
-#	include <stdint.h>
-#else
-#	include "compat/stdint.h"    /* msinttypes for VC++ */
-#endif /* HAVE_STDINT_H_ */
-
-#ifdef HAVE_INTTYPES_H_
-#	include <inttypes.h>         /* Exact-width integer types */
-#else
-#	include "compat/inttypes.h"  /* msinttypes for VC++ */
-#endif /* HAVE_INTTYPES_H_ */
-
-/* Size prefixes for printf/scanf for size_t and ptrdiff_t */
-#ifdef _MSC_VER
-#	define PRIxS "Ix"  /* printf size_t */
-#	define PRIuS "Iu"  /* printf size_t */
-#	define PRIdS "Id"  /* printf ptrdiff_t */
-#	define SCNuS "u"   /* scanf  size_t (__int32 even on 64-bit platforms) */
-#	define SCNdS "d"   /* scanf  ptrdiff_t (__int32 even on 64-bit platforms) */
-#else
-#	define PRIxS "zx"  /* printf size_t */
-#	define PRIuS "zu"  /* printf size_t */
-#	define PRIdS "zd"  /* printf ptrdiff_t */
-#	define SCNuS PRIuS /* scanf  size_t */
-#	define SCNdS PRIdS /* scanf  ptrdiff_t */
-#endif
-
-/*
- * Windows headers
- */
-
-#ifdef HAVE_DIRECT_H_
-#	include <direct.h>
-#endif
-
-#ifdef HAVE_IO_H_
-#	include <io.h>
-#endif
-
-#ifdef HAVE_PROCESS_H_
-#	include <process.h>
-#endif
-
-/*
- * Math headers
- */
-
-#include <math.h>
-#include <float.h>
-
-#if defined (HAVE_IEEEFP_H_) && defined(__ultrix__) && defined(__mips)
-/* Needed to get isnan[fd] macros */
-#	include <ieeefp.h>
-#endif
-
-#ifdef HAVE_FLOATINGPOINT_H_
-#	include <floatingpoint.h>
-#endif
-
-/*
- * Make sure Cygwin does not use Windows related tweaks
- */
-
-#ifdef __CYGWIN__
-#	undef _WIN32
-#	undef WIN32
-#endif
-
-/*
- * Windows tweaks
- */
-
-#if defined _WIN32
-
-#	ifndef WIN32
-#		define WIN32
-#	endif
-
-	/* Reduce the size of the Win32 header files and speed up compilation. */
-#	define WIN32_LEAN_AND_MEAN
-
-#	define PATH_SEPARATOR ';' /* Win uses ; while Unix uses : */
-
-#	define SET_IO_MODE   /* Need to force binary i/o upon request */
-
-#	if defined(USE_VLD) && defined(DEBUG)
-#		include <vld.h>
-#	endif
-
-#	ifdef _MSC_VER
-		/* Suppress Visual Studio deprecation warnings */
-#		pragma warning( disable : 4996 )
-		/* Issue warning 4244 (conversion of int64_t to int32_t) only once */
-/*#		pragma warning( once : 4244 4267 ) */
-#	 	if (_MSC_VER <= 1600)
-			/* Older Visual Studio do not understand C99 restrict keyword */
-#			define restrict
-# 		endif
-
-		/* isspace, isalpha, ...: avoid assert (only happens with debug CRT) 
-		   if passed a parameter that isn't EOF or in the range of 0 through 0xFF. */
-#		ifdef _DEBUG
-#			define isspace(c) (c > 0 && c < 0xFF && isspace(c))
-#			define isalpha(c) (c > 0 && c < 0xFF && isalpha(c))
-#		endif /* _DEBUG */
-
-#	endif /* defined _MSC_VER */
-
-#endif /* defined _WIN32 */
-
-#ifndef PATH_SEPARATOR
-#	define PATH_SEPARATOR ':' /* Win uses ; while Unix uses : */
-#endif
-
-/* Misc. ANSI-C math functions used by grdmath and gmtmath.
- * These functions are available on many platforms and we
- * seek to use them.  If not available then we compile in
- * replacements from gmt_notposix.c */
-
-#ifndef HAVE_ABS
-#	define abs(x) (int)labs(x)
-#endif
-#ifndef HAVE_ACOSF
-#	define acosf(x) (float)acos((double)(x))
-#endif
-#ifndef HAVE_ACOSH
-#	define acosh(x) log((x) + (d_sqrt((x) + 1.0)) * (d_sqrt((x) - 1.0)))
-#endif
-#ifndef HAVE_ACOSHF
-#	define acoshf(x) (float)acosh((double)(x))
-#endif
-#ifndef HAVE_ASINF
-#	define asinf(x) (float)asin((double)(x))
-#endif
-#ifndef HAVE_ASINH
-#	define asinh(x) log((x) + (hypot((x), 1.0)))
-#endif
-#ifndef HAVE_ASINHF
-#	define asinhf(x) (float)asinh((double)(x))
-#endif
-#ifndef HAVE_ATANF
-#	define atanf(x) (float)atan((double)(x))
-#endif
-#ifndef HAVE_ATAN2F
-#	define atan2f(y,x) (float)atan2((double)(y),(double)(x))
-#endif
-#ifndef HAVE_ATANH
-	EXTERN_MSC double atanh(double x);
-#endif
-#ifndef HAVE_ATANHF
-#	define atanhf(x) (float)atanh((double)(x))
-#endif
-
-#if defined HAVE__COPYSIGN && !defined HAVE_COPYSIGN
-#	define copysign _copysign
-#elif !defined HAVE_COPYSIGN
-#	define copysign(x,y) ((y) < 0.0 ? -fabs(x) : fabs(x))
-#endif
-#ifndef HAVE_COPYSIGNF
-#	define copysignf(x,y) (float)copysign((double)(x),(double)(y))
-#endif
-
-#ifndef HAVE_CEILF
-#	define ceilf(x) (float)ceil((double)(x))
-#endif
-#ifndef HAVE_COSF
-#	define cosf(x) (float)cos((double)(x))
-#endif
-#ifndef HAVE_COSHF
-#	define coshf(x) (float)cosh((double)(x))
-#endif
-#ifndef HAVE_ERF
-	EXTERN_MSC double erf(double x);
-#endif
-#ifndef HAVE_ERFF
-#	define erff(x) (float)erf((double)(x))
-#endif
-#ifndef HAVE_ERFC
-	EXTERN_MSC double erfc(double x);
-#endif
-#ifndef HAVE_ERFCF
-#	define erfcf(x) (float)erfc((double)(x))
-#endif
-#ifndef HAVE_EXPF
-#	define expf(x) (float)exp((double)(x))
-#endif
-#ifndef HAVE_FLOORF
-#	define floorf(x) (float)floor((double)(x))
-#endif
-#ifndef HAVE_FMODF
-#	define fmodf(x,y) (float)fmod((double)(x),(double)(y))
-#endif
-#ifndef HAVE_HYPOT
-	EXTERN_MSC double hypot(double x, double y);
-#endif
-#ifndef HAVE_HYPOTF
-#	define hypotf(x,y) (float)hypot((double)(x),(double)(y))
-#endif
-#ifndef HAVE_LOGF
-#	define logf(x) (float)log((double)(x))
-#endif
-#ifndef HAVE_LOG2F
-#	define log2f(x) (float)log2((double)(x))
-#endif
-#ifndef HAVE_LOG10F
-#	define log10f(x) (float)log10((double)(x))
-#endif
-#ifndef HAVE_LOG1PF
-#	define log1pf(x) (float)log1p((double)(x))
-#endif
-#ifndef HAVE_LRINT
-#	define lrint(x) (long)rint(x)
-#endif
-#ifndef HAVE_LRINTF
-#	define lrintf(x) lrint((double)(x))
-#endif
-#ifndef HAVE_LLRINT
-#	define llrint(x) (long long)rint(x)
-#endif
-#ifndef HAVE_LLRINTF
-#	define llrintf(x) llrint((double)(x))
-#endif
-#ifndef HAVE_RINTF
-#	define rintf(x) (float)rint((double)(x))
-#endif
-#ifndef HAVE_POWF
-#	define powf(x) (float)pow((double)(x))
-#endif
-#ifndef HAVE_SINF
-#	define sinf(x) (float)sin((double)(x))
-#endif
-
-/* Handle IEEE NaNs */
-
-#ifndef NAN
-#	ifdef _MSC_VER
-#		include <ymath.h>
-#		define NAN _Nan._Double
-#	else /* _MSC_VER */
-		static const double _NAN = (HUGE_VAL-HUGE_VAL);
-#		define NAN _NAN
-#	endif /* _MSC_VER */
-#endif /* !NAN */
-
-#ifndef HAVE_ISNAN
-#	if defined HAVE__ISNAN /* only WIN32 */
-#		define isnan _isnan
-#	elif defined HAVE_ISNAND && defined HAVE_ISNANF
-#		define isnan \
-			( sizeof (x) == sizeof(double) ? isnand((double)(x)) \
-			: sizeof (x) == sizeof(float) ? isnanf((float)(x)) \
-			: (x != x) )
-#	else /* defined HAVE__ISNAN */
-#		define isnan (x != x)
-#	endif
-#endif /* !HAVE_ISNAN */
-
-/* End IEEE NaNs */
-
-/* floating-point classes */
-
-#ifndef isinf
-#	ifdef HAVE__FPCLASS
-		/* only WIN32 */
-		static __inline int isinf (double x) {
-			int fpc = _fpclass (x);
-			return fpc == _FPCLASS_PINF || fpc == _FPCLASS_NINF;
-		}
-#	else
-#		define isinf(x) \
-			( sizeof (x) == sizeof (float)  ? __inline_isinf_f (x) \
-			: sizeof (x) == sizeof (double) ? __inline_isinf_d (x) \
-			:                                 __inline_isinf (x))
-		static inline int __inline_isinf_f (float x) {
-			return !isnan (x) && isnan (x - x);
-		}
-		static inline int __inline_isinf_d (double x) {
-			return !isnan (x) && isnan (x - x);
-		}
-		static inline int __inline_isinf   (long double x) {
-			return !isnan (x) && isnan (x - x);
-		}
-#	endif /* HAVE__FPCLASS */
-#endif /* !isinf */
-
-#ifndef isfinite
-#	ifdef HAVE__FINITE /* only WIN32 */
-#		define isfinite _finite
-#	else
-#		define isfinite(x) (!isinf(x) && !isnan(x))
-#	endif
-#endif
-
-#ifndef isnormal
-#	ifdef HAVE__FPCLASS
-		/* only WIN32 */
-		static __inline int isnormal (double x) {
-			int fpc = _fpclass (x);
-			return fpc == _FPCLASS_PN || fpc == _FPCLASS_NN;
-		}
-#	else
-#		define isnormal(x) \
-			( sizeof (x) == sizeof (float)  ? __inline_isnormal_f (x) \
-			: sizeof (x) == sizeof (double) ? __inline_isnormal_d (x) \
-			:                                 __inline_isnormal (x))
-		static inline int __inline_isnormal_f ( float x ) {
-			float abs_x = fabsf(x);
-			if ( x != x )
-				return 0;
-			return abs_x < HUGE_VALF && abs_x >= FLT_MIN;
-		}
-		static inline int __inline_isnormal_d ( double x ) {
-			double abs_x = fabs(x);
-			if ( x != x )
-				return 0;
-			return abs_x < HUGE_VAL && abs_x >= DBL_MIN;
-		}
-		static inline int __inline_isnormal ( long double x ) {
-			long double abs_x = fabsl(x);
-			if ( x != x )
-				return 0;
-			return abs_x < HUGE_VALL && abs_x >= LDBL_MIN;
-		}
-#	endif /* HAVE__FPCLASS */
-#endif /* !isnormal */
-
-/* End floating-point classes */
-
-#ifndef HAVE_J0
-	EXTERN_MSC double j0(double x);
-#endif
-
-#ifndef HAVE_J1
-	EXTERN_MSC double j1(double x);
-#endif
-
-#ifndef HAVE_JN
-	EXTERN_MSC double jn(int n, double x);
-#endif
-
-#ifndef HAVE_LOG1P
-	EXTERN_MSC double log1p(double x);
-#endif
-
-#ifndef HAVE_LOG2
-#	define log2(x) (log10(x)/0.30102999566398114250631579125183634459972381591796875)
-#endif
-
-#ifndef HAVE_RINT
-	/* #define rint(x) (floor((x)+0.5f)) does not work reliable.
-	 * We use s_rint.c from sun instead. */
-	EXTERN_MSC double rint(double x);
-#endif
-
-#ifndef HAVE_SINCOS
-	EXTERN_MSC void sincos (double x, double *s, double *c);
-#endif
-
-#ifndef HAVE_Y0
-	EXTERN_MSC double y0(double x);
-#endif
-
-#ifndef HAVE_Y1
-	EXTERN_MSC double y1(double x);
-#endif
-
-#ifndef HAVE_YN
-	EXTERN_MSC double yn(int n, double x);
-#endif
-
-/*
- * System specific
- */
-
-/* GMT normally gets these macros from unistd.h */
-#ifndef HAVE_UNISTD_H_
-#	define R_OK 4
-#	define W_OK 2
-#	ifdef WIN32
-#		define X_OK R_OK /* X_OK == 1 crashes on Windows */
-#	else
-#		define X_OK 1
-#	endif
-#	define F_OK 0
-#endif /* !HAVE_UNISTD_H_ */
-
-/* access is usually in unistd.h; we use a macro here
- * since the same function under WIN32 is prefixed with _
- * and defined in io.h */
-#if defined HAVE__ACCESS && !defined HAVE_ACCESS
-#	define access _access
-#endif
-
-/* fileno is usually in stdio.h; we use a macro here
- * since the same function under WIN32 is prefixed with _
- * and defined in stdio.h */
-#if defined HAVE__FILENO && !defined HAVE_FILENO
-#	define fileno _fileno
-#endif
-
-/* getcwd is usually in unistd.h; we use a macro here
- * since the same function under WIN32 is prefixed with _
- * and defined in direct.h */
-#ifdef HAVE__GETCWD
-#	define getcwd _getcwd
-#endif
-
-/* getpid is usually in unistd.h; we use a macro here
- * since the same function under WIN32 is prefixed with _
- * and defined in process.h */
-#if defined HAVE__GETPID && !defined HAVE_GETPID
-#	define getpid _getpid
-#endif
-
-/* MSVC implementation of popen and pclose */
-#if defined HAVE__PCLOSE && !defined HAVE_PCLOSE
-#	define pclose _pclose
-#endif
-#if defined HAVE__POPEN && !defined HAVE_POPEN
-#	define popen _popen
-#endif
-
-#if defined HAVE__SETMODE && !defined HAVE_SETMODE
-#	define setmode _setmode
-#endif
-
-#if defined HAVE__SNPRINTF_ && !defined HAVE_SNPRINTF_
-#	define snprintf _snprintf
-#elif !defined HAVE_SNPRINTF_
-#	define snprintf(s, n, format , ...) sprintf(s, format , ##__VA_ARGS__)
-#endif
-
-#if defined HAVE__VSNPRINTF_ && !defined HAVE_VSNPRINTF_
-#	define vsnprintf _vsnprintf
-#elif !defined HAVE_VSNPRINTF_
-#	define vsnprintf(s, n, format, arg) vsprintf(s, format, arg)
-#endif
-
-#ifdef HAVE__STATI64
-#	define stat _stati64
-#elif defined HAVE__STAT
-#	define stat _stat
-#endif
-
-#if defined(HAVE_STRICMP) && !defined(HAVE_STRCASECMP)
-#	define strcasecmp stricmp
-#endif
-#if defined(HAVE_STRNICMP) && !defined(HAVE_STRNCASECMP)
-#	define strncasecmp strnicmp
-#endif
-
-#ifndef DECLARED_STRDUP
-	EXTERN_MSC char *strdup(const char *s);
-#endif
-
-#ifndef HAVE_STRTOD
-	EXTERN_MSC double strtod(const char *nptr, char **endptr);
-#endif
-
-#ifndef HAVE_STRTOF_
-	static inline float strtof(const char *nptr, char **endptr) {
-		return (float)strtod(nptr, endptr);
-	}
-#endif
-
-#if defined HAVE_STRTOK_S && !defined HAVE_STRTOK_R
-#	define strtok_r strtok_s
-#elif !defined HAVE_STRTOK_R
-/* define custom function */
-#endif
-
-/* If GLIBC compatible qsort_r is not available */
-#ifndef HAVE_QSORT_R_GLIBC
-#	include "compat/qsort.h"
-#endif
-
-#endif /* _GMT_NOTPOSIX_H */
diff --git a/src/gmt/gmt_option.h b/src/gmt/gmt_option.h
deleted file mode 100644
index 18d1504..0000000
--- a/src/gmt/gmt_option.h
+++ /dev/null
@@ -1,87 +0,0 @@
-/*--------------------------------------------------------------------
- *	$Id: gmt_option.h 2242 2015-05-16 05:21:28Z caress $
- *
- *	Copyright (c) 2012-2015 by P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis and F. Wobbe
- *	See LICENSE.TXT file for copying and redistribution conditions.
- *
- *	This program is free software; you can redistribute it and/or modify
- *	it under the terms of the GNU Lesser General Public License as published by
- *	the Free Software Foundation; version 3 or any later version.
- *
- *	This program is distributed in the hope that it will be useful,
- *	but WITHOUT ANY WARRANTY; without even the implied warranty of
- *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *	GNU Lesser General Public License for more details.
- *
- *	Contact info: gmt.soest.hawaii.edu
- *--------------------------------------------------------------------*/
-/*
- * gmt_option.h contains the definitions for the GMT_OPTION structure
- * option-related named constants, and macros for synopsis writing.
- *
- * Author:	Paul Wessel
- * Date:	17-MAY-2013
- * Version:	5 API
- */
-
-#ifndef _GMT_OPTION_H
-#define _GMT_OPTION_H
-
-/*============================================================ */
-/*=============== GMT_OPTION Public Declaration ============== */
-/*============================================================ */
-
-/* Macros for the common GMT options used in a program's usage synopsis */
-
-#define GMT_B_OPT	"-B<args>"
-#define GMT_I_OPT	"-I<xinc>[<unit>][=|+][/<yinc>[<unit>][=|+]]"
-#define GMT_J_OPT	"-J<args>"
-#define GMT_R2_OPT	"-R[<unit>]<xmin>/<xmax>/<ymin>/<ymax>[r]"
-#define GMT_R3_OPT	"-R[<unit>]<xmin>/<xmax>/<ymin>/<ymax>[/<zmin>/<zmax>][r]"
-#define GMT_U_OPT	"-U[<just>/<dx>/<dy>/][c|<label>]"
-#define GMT_V_OPT	"-V[<level>]"
-#define GMT_X_OPT	"-X[a|c|r]<xshift>[<unit>]"
-#define GMT_Y_OPT	"-Y[a|c|r]<yshift>[<unit>]"
-#define GMT_a_OPT	"-a<col>=<name>[,...]"
-#define GMT_b_OPT	"-b[i|o][<ncol>][t][w][+L|B]"
-#define GMT_c_OPT	"-c<ncopies>"
-#define GMT_f_OPT	"-f[i|o]<info>"
-#define GMT_g_OPT	"-g[a]x|y|d|X|Y|D|[<col>]z[-|+]<gap>[<unit>]"
-#define GMT_h_OPT	"-h[i|o][<nrecs>][+c][+d][+r<remark>][+t<title>]"
-#define GMT_i_OPT	"-i<cols>[l][s<scale>][o<offset>][,...]"
-#define GMT_n_OPT	"-n[b|c|l|n][+a][+b<BC>][+c][+t<threshold>]"
-#define GMT_o_OPT	"-o<cols>[,...]"
-#define GMT_p_OPT	"-p[x|y|z]<azim>/<elev>[/<zlevel>][+w<lon0>/<lat0>[/<z0>][+v<x0>/<y0>]"
-#define GMT_r_OPT	"-r"
-#define GMT_s_OPT	"-s[<cols>][a|r]"
-#define GMT_t_OPT	"-t<transp>"
-#define GMT_colon_OPT	"-:[i|o]"
-
-/* Macro for tools that need to specify FFT information (prepend option flag, e.g., -N and put GMT_FFT_OPT inside [] ) */
-
-#define GMT_FFT_OPT "[f|q|s|<nx>/<ny>][+a|d|l][+e|m|n][+t<width>][+w<suffix>][+z[p]]"
-
-/* Macros for printing a tic/toc elapsed time message*/
-
-#define GMT_tic(C) {if (C->current.setting.verbose >= GMT_MSG_TICTOC) GMT_Message(C->parent,GMT_TIME_RESET,"");}
-#define GMT_toc(C,...) {if (C->current.setting.verbose >= GMT_MSG_TICTOC) GMT_Message(C->parent,GMT_TIME_ELAPSED, \
-		"(%s) | %s\n", C->init.module_name, __VA_ARGS__);}
-
-/* These are the 5 named option codes */
-enum GMT_enum_opt {
-	GMT_OPT_USAGE =     '?',	/* Command-line option for full usage */
-	GMT_OPT_SYNOPSIS =  '^',	/* Command-line option for synopsis */
-	GMT_OPT_PARAMETER = '-',	/* Command-line option for GMT defaults parameter */
-	GMT_OPT_INFILE =    '<',	/* Command-line option for input file */
-	GMT_OPT_OUTFILE =   '>'};	/* Command-line option for output file */
-
-/* This struct is used to pass program options in/out of GMT modules */
-
-struct GMT_OPTION {              /* Structure for a single GMT command option */
-	char option;                 /* 1-char command line -<option> (e.g. D in -D) identifying the option (* if file) */
-	char *arg;                   /* If not NULL, contains the argument for this option */
-	struct GMT_OPTION *next;     /* Pointer to next option in a linked list */
-	struct GMT_OPTION *previous; /* Pointer to previous option in a linked list */
-};
-
-#endif /* _GMT_OPTION_H */
diff --git a/src/gmt/gmt_pennames.h b/src/gmt/gmt_pennames.h
deleted file mode 100644
index ef2704c..0000000
--- a/src/gmt/gmt_pennames.h
+++ /dev/null
@@ -1,12 +0,0 @@
-{"faint",	0.00},
-{"default",	0.25},
-{"thinnest",	0.25},
-{"thinner",	0.50},
-{"thin",	0.75},
-{"thick",	1.00},
-{"thicker",	1.50},
-{"thickest",	2.00},
-{"fat",		3.00},
-{"fatter",	6.00},
-{"fattest",	10.0},
-{"obese",	18.0}
diff --git a/src/gmt/gmt_plot.h b/src/gmt/gmt_plot.h
deleted file mode 100644
index aeef012..0000000
--- a/src/gmt/gmt_plot.h
+++ /dev/null
@@ -1,188 +0,0 @@
-/*--------------------------------------------------------------------
- *	$Id: gmt_plot.h 2242 2015-05-16 05:21:28Z caress $
- *
- *	Copyright (c) 1991-2015 by P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis and F. Wobbe
- *	See LICENSE.TXT file for copying and redistribution conditions.
- *
- *	This program is free software; you can redistribute it and/or modify
- *	it under the terms of the GNU Lesser General Public License as published by
- *	the Free Software Foundation; version 3 or any later version.
- *
- *	This program is distributed in the hope that it will be useful,
- *	but WITHOUT ANY WARRANTY; without even the implied warranty of
- *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *	GNU Lesser General Public License for more details.
- *
- *	Contact info: gmt.soest.hawaii.edu
- *--------------------------------------------------------------------*/
-
-#ifndef _GMT_PLOT_H
-#define _GMT_PLOT_H
-
-/* Identifier for GMT_plane_perspective. The others come from GMT_io.h */
-
-#define GMT_ZW	3
-
-/* GMT symbol identifiers. Mostly the same as PSL_<symbol> but with
-   extensions for custom symbols, psxy and psxyz */
-
-#define GMT_SYMBOL_STAR		((int)'a')
-#define GMT_SYMBOL_BARX		((int)'B')
-#define GMT_SYMBOL_BARY		((int)'b')
-#define GMT_SYMBOL_CIRCLE	((int)'c')
-#define GMT_SYMBOL_DIAMOND	((int)'d')
-#define GMT_SYMBOL_ELLIPSE	((int)'e')
-#define GMT_SYMBOL_FRONT	((int)'f')
-#define GMT_SYMBOL_OCTAGON	((int)'g')
-#define GMT_SYMBOL_HEXAGON	((int)'h')
-#define GMT_SYMBOL_INVTRIANGLE	((int)'i')
-#define GMT_SYMBOL_ROTRECT	((int)'j')
-#define GMT_SYMBOL_CUSTOM	((int)'k')
-#define GMT_SYMBOL_TEXT		((int)'l')
-#define GMT_SYMBOL_MARC		((int)'m')
-#define GMT_SYMBOL_PENTAGON	((int)'n')
-#define GMT_SYMBOL_COLUMN	((int)'o')
-#define GMT_SYMBOL_DOT		((int)'p')
-#define GMT_SYMBOL_QUOTED_LINE	((int)'q')
-#define GMT_SYMBOL_RECT		((int)'r')
-#define GMT_SYMBOL_RNDRECT	((int)'R')
-#define GMT_SYMBOL_SQUARE	((int)'s')
-#define GMT_SYMBOL_TRIANGLE	((int)'t')
-#define GMT_SYMBOL_CUBE		((int)'u')
-#define GMT_SYMBOL_VECTOR	((int)'v')
-#define GMT_SYMBOL_WEDGE	((int)'w')
-#define GMT_SYMBOL_CROSS	((int)'x')
-#define GMT_SYMBOL_YDASH	((int)'y')
-#define GMT_SYMBOL_ZDASH	((int)'z')
-#define GMT_SYMBOL_PLUS		((int)'+')
-#define GMT_SYMBOL_XDASH	((int)'-')
-
-#define GMT_SYMBOL_MOVE		((int)'M')
-#define GMT_SYMBOL_DRAW		((int)'D')
-#define GMT_SYMBOL_STROKE	((int)'S')
-#define GMT_SYMBOL_ARC		((int)'A')
-#define GMT_SYMBOL_ROTATE	((int)'R')
-#define GMT_SYMBOL_VARROTATE	((int)'V')
-#define GMT_SYMBOL_AZIMROTATE	((int)'Z')
-#define GMT_SYMBOL_TEXTURE	((int)'T')
-#define GMT_SYMBOL_GEOVECTOR	((int)'=')
-#define GMT_SYMBOL_VARTEXT	((int)'L')
-
-#define GMT_SYMBOL_LINE		0
-#define GMT_SYMBOL_NONE		((int)' ')
-#define GMT_SYMBOL_NOT_SET	((int)'*')
-
-#define GMT_DOT_SIZE 0.005	/* Size of a "dot" on a GMT PS map [in inches] */
-
-/* FRONT symbols */
-
-enum GMT_enum_front {GMT_FRONT_FAULT = 0,
-	GMT_FRONT_TRIANGLE,
-	GMT_FRONT_SLIP,
-	GMT_FRONT_CIRCLE,
-	GMT_FRONT_BOX};
-
-/* Direction of FRONT symbols: */
-
-enum GMT_enum_frontdir {GMT_FRONT_RIGHT = -1,
-	GMT_FRONT_CENTERED,
-	GMT_FRONT_LEFT};
-
-struct GMT_FRONTLINE {		/* A sub-symbol for symbols along a front */
-	double f_gap;		/* Gap between front symbols in inches */
-	double f_len;		/* Length of front symbols in inches */
-	double f_off;		/* Offset of first symbol from start of front in inches */
-	int f_sense;	/* Draw symbols to left (+1), centered (0), or right (-1) of line */
-	int f_symbol;	/* Which symbol to draw along the front line */
-};
-
-/* Note: If changes are made to GMT_enum_vecattr you must also change pslib.h: PSL_enum_vecattr */
-
-enum GMT_enum_vecattr {GMT_VEC_BEGIN = 1,	/* Place vector head at beginning of vector. Add GMT_VEC_BEGIN_L for left only, GMT_VEC_BEGIN_R for right only */
-	GMT_VEC_END		= 2,		/* Place vector head at end of vector.  Add GMT_VEC_END_L for left only, and GMT_VEC_END_R for right only */
-	GMT_VEC_HEADS		= 3,		/* Mask for either head end */
-	GMT_VEC_BEGIN_L		= 4,		/* Left-half head at beginning */
-	GMT_VEC_BEGIN_R		= 8,		/* Right-half head at beginning */
-	GMT_VEC_END_L		= 16,		/* Left-half head at end */
-	GMT_VEC_END_R		= 32,		/* Right-half head at end */
-	GMT_VEC_JUST_B		= 0,		/* Align vector beginning at (x,y) */
-	GMT_VEC_JUST_C		= 64,		/* Align vector center at (x,y) */
-	GMT_VEC_JUST_E		= 128,		/* Align vector end at (x,y) */
-	GMT_VEC_JUST_S		= 256,		/* Align vector center at (x,y) */
-	GMT_VEC_ANGLES		= 512,		/* Got start/stop angles instead of az, length */
-	GMT_VEC_POLE		= 1024,		/* Got pole of small/great circle */
-	GMT_VEC_OUTLINE		= 2048,		/* Draw vector head outline using default pen */
-	GMT_VEC_OUTLINE2	= 4096,		/* Draw vector head outline using supplied v_pen */
-	GMT_VEC_FILL		= 8192,		/* Fill vector head using default fill */
-	GMT_VEC_FILL2		= 16384,	/* Fill vector head using supplied v_fill) */
-	GMT_VEC_MARC90		= 32768,	/* Matharc only: if angles subtend 90, draw straight angle symbol */
-	GMT_VEC_SCALE		= 65536};	/* Not needed in pslib: If not set we determine the required inch-to-degree scale */
-
-/* Make sure the next three macros are in sync with any changes to GMT_enum_vecattr above! */
-
-#define GMT_vec_justify(status) ((status>>6)&3)			/* Return justification as 0-3 */
-#define GMT_vec_head(status) ((status)&3)			/* Return head selection as 0-3 */
-#define GMT_vec_side(status,head) (((status>>(2+2*head))&3) ? 2*((status>>(2+2*head))&3)-3 : 0)	/* Return side selection for this head as 0,-1,+1 */
-
-#define GMT_vec_outline(status) ((status&GMT_VEC_OUTLINE) || (status&GMT_VEC_OUTLINE2))	/* Return true if outline is currently selected */
-#define GMT_vec_fill(status) ((status&GMT_VEC_FILL) || (status&GMT_VEC_FILL2))		/* Return true if fill is currently selected */
-
-struct GMT_VECT_ATTR {
-	/* Container for common attributes for plot attributes of vectors */
-	unsigned int status;	/* Bit flags for vector information (see GMT_enum_vecattr above) */
-	bool parsed_v4;		/* true if we parsed old-style <vectorwidth/headlength/headwidth> attribute */
-	float v_angle;		/* Head angle */
-	float v_norm;		/* shrink when lengths are smaller than this */
-	float v_stem;		/* Min length in % of visible vector when head is large [10%] */
-	float v_width;		/* Width of vector stem in inches */
-	float h_length;		/* Length of vector head in inches */
-	float h_width;		/* Width of vector head in inches */
-	float pole[2];		/* Longitude and latitude of geovector pole */
-	float scale;		/* Converts inches to spherical degrees */
-	struct GMT_PEN pen;	/* Pen for outline of head */
-	struct GMT_FILL fill;	/* Fill for head [USED IN PSROSE] */
-};
-
-#define GMT_MAX_SYMBOL_COLS	6	/* Maximum number of columns required for the most complicated symbol input */
-
-struct GMT_SYMBOL {
-	/* Voodoo: If next line is not the first member in this struct, psxy -Sl<size>/Text will have corrupt 'Text'
-		   in non-debug binaries compiled with VS2010 */
-	char string[GMT_LEN256];	/* Character code to plot (could be octal) */
-
-	int symbol;	/* Symbol id */
-	unsigned int n_required;	/* Number of additional columns necessary to decode chosen symbol */
-	unsigned int justify;	/* Justification of text item for -Sl symbol [PSL_MC = centered] */
-	unsigned int u;		/* Measure unit id (0 = cm, 1 = inch, 2 = m, 3 = point */
-	bool u_set;		/* true if u was set */
-	double size_x;		/* Current symbol size in x */
-	double size_y;		/* Current symbol size in y */
-	double given_size_x;	/* Symbol size read from file or command line */
-	double given_size_y;	/* Symbol size read from file or command line */
-	bool read_size_cmd;	/* true when -S indicated we must read symbol sizes from file */
-	bool read_symbol_cmd;	/* true when -S indicated we must read symbol type from file */
-	bool read_size;	/* true when we must read symbol size from file for the current record */
-	bool shade3D;	/* true when we should simulate shading of 3D symbols cube and column */
-	bool fq_parse;	/* true -Sf or -Sq were given with no args on command line and must be parsed via segment headers */
-	struct GMT_FONT font;	/* Font to use for the -Sl symbol */
-	unsigned int convert_angles;	/* If 2, convert azimuth to angle on map, 1 special case for -JX, 0 plain case */
-	unsigned int n_nondim;	/* Number of columns that has angles or km (and not dimensions with units) */
-	unsigned int nondim_col[GMT_MAX_SYMBOL_COLS];	/* Which columns has angles or km for this symbol */
-
-	/* These apply to bar|column symbols */
-
-	double base;		/* From what level to draw the bar|column */
-	bool user_unit[2];	/* If true then we must project the base via R -J to get base values, otherwise they are in c|i|p units */
-	unsigned int base_set;	/* 1 if user provided a custom base, 2 if we should read it from last column [otherwise 0: default to bottom axis] */
-
-	/* These apply to vectors */
-
-	struct GMT_VECT_ATTR v;	/* All attributes for vector shapes etc. [see struct above] */
-
-	struct GMT_FRONTLINE f;	/* parameters needed for a front */
-	struct GMT_CUSTOM_SYMBOL *custom;	/* pointer to a custom symbol */
-
-	struct GMT_CONTOUR G;	/* For quoted lines */
-};
-
-#endif /* _GMT_PLOT_H */
diff --git a/src/gmt/gmt_private.h b/src/gmt/gmt_private.h
deleted file mode 100644
index f1eb311..0000000
--- a/src/gmt/gmt_private.h
+++ /dev/null
@@ -1,165 +0,0 @@
-/*--------------------------------------------------------------------
- *	$Id: gmt_private.h 2242 2015-05-16 05:21:28Z caress $
- *
- *	Copyright (c) 1991-2015 by P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis and F. Wobbe
- *	See LICENSE.TXT file for copying and redistribution conditions.
- *
- *	This program is free software; you can redistribute it and/or modify
- *	it under the terms of the GNU Lesser General Public License as published by
- *	the Free Software Foundation; version 3 or any later version.
- *
- *	This program is distributed in the hope that it will be useful,
- *	but WITHOUT ANY WARRANTY; without even the implied warranty of
- *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *	GNU Lesser General Public License for more details.
- *
- *	Contact info: gmt.soest.hawaii.edu
- *--------------------------------------------------------------------*/
-
-/*
- * THese are the private parts of the GMTAPI_CTRL which we will not expose
- * to the API users; they are only accessible by GMT developers.
- *
- * Author: 	Paul Wessel
- * Date:	06-FEB-2013
- * Version:	5 API
- */
-
-#ifndef _GMTAPI_PRIVATE_H
-#define _GMTAPI_PRIVATE_H
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdint.h>
-
-/*
- * Visual C++ only implements C90, which has no bool type. C99 added support
- * for bool via the <stdbool.h> header, but Visual C++ does not support this.
- */
-#ifndef __bool_true_false_are_defined
-#	if defined _MSC_VER
-#		define bool _Bool
-#		define true 1
-#		define false 0
-#		define __bool_true_false_are_defined 1
-#	else
-#		include <stdbool.h>
-#	endif /* _MSC_VER */
-#endif /* !__bool_true_false_are_defined */
-
-#ifdef __cplusplus /* Basic C++ support */
-extern "C" {
-#endif
-
-enum GMT_enum_apidim {
-	GMTAPI_N_GRID_ARGS	= 4,	/* Minimum size of information array used to specify grid parameters */
-	GMTAPI_N_ARRAY_ARGS	= 8	/* Minimum size of information array used to specify array parameters */
-};
-
-/* Index parameters used to access the information arrays [PW: Is this still relevant?] */
-
-#if 0
-enum GMT_enum_pars {GMTAPI_TYPE = 0,	/* ipar[0] = data type (GMTAPI_{BYTE|SHORT|FLOAT|INT|DOUBLE}) */
-	GMTAPI_NDIM,		/* ipar[1] = dimensionality of data (1, 2, or 3) (GMT grids = 2 yet stored internally as 1D) */
-	GMTAPI_NROW,		/* ipar[2] = number_of_rows (or length of 1-D array) */
-	GMTAPI_NCOL,		/* ipar[3] = number_of_columns (1 for 1-D array) */
-	GMTAPI_KIND,		/* ipar[4] = arrangment of rows/col (0 = rows (C), 1 = columns (Fortran)) */
-	GMTAPI_DIML,		/* ipar[5] = length of dimension for row (C) or column (Fortran) */
-	GMTAPI_FREE,		/* ipar[6] = 1 to free array after use (IN) or before filling with output (OUT), 0 to leave alone */
-	GMTAPI_NODE};		/* ipar[7] = 1 for pixel registration, 0 for node */
-#endif
-
-
-/*=====================================================================================
- *	GMT API STRUCTURE DEFINITIONS
- *===================================================================================*/
-
-struct GMT_CTRL; /* forward declaration of GMT_CTRL */
-
-struct GMTAPI_DATA_OBJECT {
-	/* Information for each input or output data entity, including information
-	 * needed while reading/writing from a table (file or array) */
-	uint64_t n_rows;			/* Number or rows in this array [GMT_DATASET and GMT_TEXTSET to/from MATRIX/VETOR only] */
-	uint64_t n_columns;			/* Number of columns to process in this dataset [GMT_DATASET only] */
-	uint64_t n_expected_fields;		/* Number of expected columns for this dataset [GMT_DATASET only] */
-	size_t n_alloc;				/* Number of items allocated so far if writing to memory */
-	unsigned int ID;			/* Unique identifier which is >= 0 */
-	unsigned int alloc_level;		/* Nested module level when object was allocated */
-	unsigned int status;			/* 0 when first registered, 1 after reading/writing has started, 2 when finished */
-	bool selected;				/* true if requested by current module, false otherwise */
-	bool close_file;			/* true if we opened source as a file and thus need to close it when done */
-	bool region;				/* true if wesn was passed, false otherwise */
-	bool no_longer_owner;			/* true if the data pointed to by the object was passed on to another object */
-	bool messenger;				/* true for output objects passed from the outside to receive data from GMT. If true we destroy data pointer before writing */
-	enum GMT_enum_alloc alloc_mode;		/* GMT_ALLOCATED_{BY_GMT|EXTERNALLY} */
-	enum GMT_io_enum direction;		/* GMT_IN or GMT_OUT */
-	enum GMT_enum_family family;		/* One of GMT_IS_{DATASET|TEXTSET|CPT|IMAGE|GRID|MATRIX|VECTOR|COORD} */
-	enum GMT_enum_family actual_family;	/* May be GMT_IS_MATRIX|VECTOR when one of the others are created via those */
-	unsigned method;		/* One of GMT_IS_{FILE,STREAM,FDESC,DUPLICATE,REFERENCE} or sum with enum GMT_enum_via (GMT_VIA_{NONE,VECTOR,MATRIX,OUTPUT}); using unsigned type because sum exceeds enum GMT_enum_method */
-	enum GMT_enum_geometry geometry;	/* One of GMT_IS_{POINT|LINE|POLY|PLP|SURFACE|NONE} */
-	double wesn[GMTAPI_N_GRID_ARGS];	/* Grid domain limits */
-	void *resource;				/* Points to registered filename, memory location, etc., where data can be obtained from with GMT_Get_Data. */
-	void *data;				/* Points to GMT object that was read from a resource */
-	FILE *fp;				/* Pointer to source/destination stream [For rec-by-rec procession, NULL if memory location] */
-	char *filename;				/* Filename, stream, of file handle (otherwise NULL) */
-	void * (*import) (struct GMT_CTRL *, FILE *, uint64_t *, int *);	/* Pointer to input function (for DATASET/TEXTSET only) */
-#ifdef DEBUG
-	struct GMT_GRID *G;
-	struct GMT_DATASET *D;
-	struct GMT_TEXTSET *T;
-	struct GMT_PALETTE *C;
-	struct GMT_MATRIX *M;
-	struct GMT_VECTOR *V;
-#endif
-#ifdef HAVE_GDAL
-	struct GMT_IMAGE *I;
-#endif
-};
-
-struct GMTAPI_CTRL {
-	/* Master controller which holds all GMT API related information at run-time for a single session.
-	 * Users can run several GMT sessions concurrently; each session requires its own structure.
-	 * Use GMTAPI_Create_Session to initialize a new session and GMTAPI_Destroy_Session to end it. */
-
-	uint64_t current_rec[2];		/* Current record number >= 0 in the combined virtual dataset (in and out) */
-	unsigned int n_objects;			/* Number of currently active input and output data objects */
-	unsigned int unique_ID;			/* Used to create unique IDs for duration of session */
-	unsigned int session_ID;		/* ID of this session */
-	unsigned int unique_var_ID;		/* Used to create unique object IDs (grid,dataset, etc) for duration of session */
-	unsigned int current_item[2];		/* Array number of current dataset being processed (in and out)*/
-	unsigned int pad;			/* Session default for number of rows/cols padding for grids [2] */
-	unsigned int mode;			/* 1 if called via external API (Matlab, Python) [0] */
-	unsigned int leave_grid_scaled;		/* 1 if we dont want to unpack a grid after we packed it for writing [0] */
-	unsigned int verbose;			/* Used until GMT is set up */
-	bool registered[2];			/* true if at least one source/destination has been registered (in and out) */
-	bool io_enabled[2];			/* true if access has been allowed (in and out) */
-	size_t n_objects_alloc;			/* Allocation counter for data objects */
-	int error;				/* Error code from latest API call [GMT_OK] */
-	int last_error;				/* Error code from previous API call [GMT_OK] */
-	int shelf;				/* Place to pass hidden values within API */
-	unsigned int io_mode[2];		/* 1 if access as set, 0 if record-by-record */
-	struct GMT_CTRL *GMT;			/* Key structure with low-level GMT internal parameters */
-	struct GMTAPI_DATA_OBJECT **object;	/* List of registered data objects */
-	char *session_tag;			/* Name tag for this session (or NULL) */
-	bool internal;				/* true if session was initiated by gmt.c */
-	bool deep_debug;			/* temporary for debugging */
-	int (*print_func) (FILE *, const char *);	/* Pointer to fprintf function (may be reset by external APIs like MEX) */
-	unsigned int do_not_exit;		/* 0 by default, mieaning it is OK to call exit  (may be reset by external APIs like MEX to call return instead) */
-	struct Gmt_libinfo *lib;		/* List of shared libs to consider */
-	unsigned int n_shared_libs;		/* How many in lib */
-};
-
-#ifdef DEBUG
-EXTERN_MSC void GMT_list_API (struct GMTAPI_CTRL *ptr, char *txt);
-#endif
-EXTERN_MSC int GMTAPI_report_error	(void *C, int error);
-
-/* Macro to test if filename is a special name indicating memory location */
-
-#define GMT_File_Is_Memory(file) (file && !strncmp (file, "@GMTAPI at -", 9U))
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _GMTAPI_PRIVATE_H */
diff --git a/src/gmt/gmt_project.h b/src/gmt/gmt_project.h
deleted file mode 100644
index 47b5bf1..0000000
--- a/src/gmt/gmt_project.h
+++ /dev/null
@@ -1,482 +0,0 @@
-/*--------------------------------------------------------------------
- *	$Id: gmt_project.h 2242 2015-05-16 05:21:28Z caress $
- *
- *	Copyright (c) 1991-2015 by P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis and F. Wobbe
- *	See LICENSE.TXT file for copying and redistribution conditions.
- *
- *	This program is free software; you can redistribute it and/or modify
- *	it under the terms of the GNU Lesser General Public License as published by
- *	the Free Software Foundation; version 3 or any later version.
- *
- *	This program is distributed in the hope that it will be useful,
- *	but WITHOUT ANY WARRANTY; without even the implied warranty of
- *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *	GNU Lesser General Public License for more details.
- *
- *	Contact info: gmt.soest.hawaii.edu
- *--------------------------------------------------------------------*/
-/*
- * Include file for programs that use the map-projections functions.  Note
- * that most programs will include this by including gmt_dev.h
- *
- * Author:	Paul Wessel
- * Date:	1-JAN-2010
- * Version:	5 API
- *
- */
-#ifndef _GMT_PROJECT_H
-#define _GMT_PROJECT_H
-
-#define HALF_DBL_MAX (DBL_MAX/2.0)
-
-/* GMT_180 is used to see if a value really is exceeding it (beyond roundoff) */
-#define GMT_180	(180.0 + GMT_CONV8_LIMIT)
-/* GMT_WIND_LON will remove central meridian value and adjust so lon fits between -180/+180 */
-#define GMT_WIND_LON(C,lon) {lon -= C->current.proj.central_meridian; while (lon < -GMT_180) lon += 360.0; while (lon > +GMT_180) lon -= 360.0;}
-
-/* Some shorthand notation for GMT specific cases */
-
-#define GMT_latg_to_latc(C,lat) GMT_lat_swap_quick (C, lat, C->current.proj.GMT_lat_swap_vals.c[GMT_LATSWAP_G2C])
-#define GMT_latg_to_lata(C,lat) GMT_lat_swap_quick (C, lat, C->current.proj.GMT_lat_swap_vals.c[GMT_LATSWAP_G2A])
-#define GMT_latc_to_latg(C,lat) GMT_lat_swap_quick (C, lat, C->current.proj.GMT_lat_swap_vals.c[GMT_LATSWAP_C2G])
-#define GMT_lata_to_latg(C,lat) GMT_lat_swap_quick (C, lat, C->current.proj.GMT_lat_swap_vals.c[GMT_LATSWAP_A2G])
-
-/* Macros returns true if the two coordinates are lon/lat; way should be GMT_IN or GMT_OUT */
-#define GMT_x_is_lon(C,way) (C->current.io.col_type[way][GMT_X] == GMT_IS_LON)
-#define GMT_y_is_lat(C,way) (C->current.io.col_type[way][GMT_Y] == GMT_IS_LAT)
-#define GMT_is_geographic(C,way) (GMT_x_is_lon(C,way) && GMT_y_is_lat(C,way))
-#define GMT_axis_is_geo(C,axis) (C->current.io.col_type[GMT_IN][axis] & GMT_IS_GEO)
-
-#define GMT_N_PROJECTIONS	29	/* Total number of projections in GMT */
-
-/* These numbers should remain flexible. Do not use them in any programming. Use only their symbolic names.
-   However, all the first items in each section (i.e. GMT_LINEAR, GMT_MERCATOR,...) should remain the first.
-*/
-#define GMT_NO_PROJ		-1	/* Projection not specified (initial value) */
-
-/* Linear projections tagged 0-99 */
-#define GMT_IS_LINEAR(C) (C->current.proj.projection / 100 == 0)
-enum GMT_enum_annot {GMT_LINEAR = 0,
-	GMT_LOG10,	/* These numbers are only used for GMT->current.proj.xyz_projection[3], */
-	GMT_POW,	/* while GMT->current.proj.projection = 0 */
-	GMT_TIME,
-	GMT_ANNOT_CPT,
-	GMT_CUSTOM};
-
-#define GMT_ZAXIS		50
-
-/* Cylindrical projections tagged 100-199 */
-#define GMT_IS_CYLINDRICAL(C) (C->current.proj.projection / 100 == 1)
-enum GMT_enum_cyl {GMT_MERCATOR = 100,
-	GMT_CYL_EQ,
-	GMT_CYL_EQDIST,
-	GMT_CYL_STEREO,
-	GMT_MILLER,
-	GMT_TM,
-	GMT_UTM,
-	GMT_CASSINI,
-	GMT_OBLIQUE_MERC = 150,
-	GMT_OBLIQUE_MERC_POLE};
-
-/* Conic projections tagged 200-299 */
-#define GMT_IS_CONICAL(C) (C->current.proj.projection / 100 == 2)
-enum GMT_enum_conic {GMT_ALBERS = 200,
-	GMT_ECONIC,
-	GMT_POLYCONIC,
-	GMT_LAMBERT = 250};
-
-/* Azimuthal projections tagged 300-399 */
-#define GMT_IS_AZIMUTHAL(C) (C->current.proj.projection / 100 == 3)
-#define GMT_IS_PERSPECTIVE(C) (C->current.proj.projection == GMT_ORTHO || C->current.proj.projection == GMT_GENPER)
-enum GMT_enum_azim {GMT_STEREO = 300,
-	GMT_LAMB_AZ_EQ,
-	GMT_ORTHO,
-	GMT_AZ_EQDIST,
-	GMT_GNOMONIC,
-	GMT_GENPER,
-	GMT_POLAR = 350};
-
-/* Misc projections tagged 400-499 */
-#define GMT_IS_MISC(C) (C->current.proj.projection / 100 == 4)
-enum GMT_enum_misc {GMT_MOLLWEIDE = 400,
-	GMT_HAMMER,
-	GMT_SINUSOIDAL,
-	GMT_VANGRINTEN,
-	GMT_ROBINSON,
-	GMT_ECKERT4,
-	GMT_ECKERT6,
-	GMT_WINKEL};
-
-/* The various GMT measurement units */
-enum GMT_enum_units {GMT_IS_METER = 0,
-	GMT_IS_KM,
-	GMT_IS_MILE,
-	GMT_IS_NAUTICAL_MILE,
-	GMT_IS_INCH,
-	GMT_IS_CM,
-	GMT_IS_PT,
-	GMT_IS_FOOT,
-	GMT_IS_SURVEY_FOOT,
-	GMT_N_UNITS,
-	GMT_IS_NOUNIT = -1};
-
-/* GMT_IS_RECT_GRATICULE means parallels and meridians are orthogonal, but does not imply linear spacing */
-#define GMT_IS_RECT_GRATICULE(C) (C->current.proj.projection <= GMT_MILLER)
-
-/* GMT_IS_NONLINEAR_GRATICULE means parallels and meridians are not orthogonal or have nonlinear spacing */
-#define GMT_IS_NONLINEAR_GRATICULE(C)	(!(C->current.proj.projection == GMT_CYL_EQDIST || C->current.proj.projection == GMT_LINEAR) || \
-	C->current.proj.xyz_projection[GMT_X] == GMT_LOG10 || C->current.proj.xyz_projection[GMT_X] == GMT_POW || \
-	C->current.proj.xyz_projection[GMT_Y] == GMT_LOG10 || C->current.proj.xyz_projection[GMT_Y] == GMT_POW)
-
-#define GMT_POLE_IS_POINT(C) (C->current.proj.projection >= GMT_LAMBERT && C->current.proj.projection <= GMT_VANGRINTEN)
-
-#define GMT_IS_SPHERICAL(C) (C->current.setting.ref_ellipsoid[C->current.setting.proj_ellipsoid].flattening < 1.0e-10)
-#define GMT_IS_FLATEARTH(C) (!strcmp (C->current.setting.ref_ellipsoid[C->current.setting.proj_ellipsoid].name, "FlatEarth"))
-
-#define GMT_is_grdmapproject(C) (!strncmp (C->init.module_name, "grdproject", 10U) || !strncmp (C->init.module_name, "mapproject", 10U))
-
-/* Return 0 for Flat Earth, 1 for Great-circles, 2 for geodesics, and 3 for loxodromes */
-#define GMT_sph_mode(C) (GMT_IS_FLATEARTH (C) ? GMT_FLATEARTH : (GMT_IS_SPHERICAL (C) ? GMT_GREATCIRCLE : (C->current.map.loxodrome ? GMT_LOXODROME : GMT_GEODESIC)))
-
-#define GMT_360_RANGE(w,e) (doubleAlmostEqual (fabs((e) - (w)), 360.0))
-#define GMT_180_RANGE(s,n) (doubleAlmostEqual (fabs((n) - (s)), 180.0))
-#define GMT_IS_POLE(y) (doubleAlmostEqual (fabs(y), 90.0))
-#define GMT_IS_ZERO(x) (fabs (x) < GMT_CONV8_LIMIT)
-
-#ifndef D2R
-#define D2R (M_PI / 180.0)
-#endif
-#ifndef R2D
-#define R2D (180.0 / M_PI)
-#endif
-
-/* UTM offsets */
-
-#define GMT_FALSE_EASTING    500000.0
-#define GMT_FALSE_NORTHING 10000000.0
-
-/* Number of proj4 look-ups */
-
-#define GMT_N_PROJ4 31
-
-/* Number of nodes in Robinson interpolation */
-
-#define GMT_N_ROBINSON	19
-
-struct GMT_LATSWAP_CONSTS {
-	double  c[GMT_LATSWAP_N][4];	/* Coefficients in 4-term series  */
-	double	ra;			/* Authalic   radius (sphere for equal-area)  */
-	double	rm;			/* Meridional radius (sphere for N-S distance)  */
-	bool spherical;		/* True if no conversions need to be done.  */
-};
-
-struct GMT_THREE_D {
-	double view_azimuth, view_elevation;
-	double cos_az, sin_az, cos_el, sin_el;
-	double corner_x[4], corner_y[4];
-	double xmin, xmax, ymin, ymax;
-	double world_x, world_y, world_z;	/* Users coordinates of fixed point */
-	double view_x, view_y;			/* Desired projected 2-D coordinates of fixed point */
-	double x_off, y_off;			/* Offsets to the final projected coordinates */
-	double sign[4];		/* Used to determine direction of tickmarks etc */
-	double level;		/* Indicates the last level of the perspective plane (if any) */
-	unsigned int view_plane;	/* Determines on which plane needs to be projected */
-	int plane;		/* Indicates which last plane was plotted in perspective (-1 = none) */
-	unsigned int quadrant;	/* quadrant we're looking from */
-	unsigned int z_axis;	/* Which z-axis to draw. */
-	unsigned int face[3];	/* Tells if this facet has normal in pos direction */
-	bool draw[4];	/* axes to draw */
-	bool fixed;		/* true if we want a given point to be fixed in the projection [for animations] */
-	bool world_given;	/* true if a fixed world point was given in -E ..+glon/lat/z */
-	bool view_given;	/* true if a fixed projected point was given in -E ..+cx0/y0 */
-};
-
-struct GMT_DATUM {	/* Main parameter for a particular datum */
-	double a, b, f, e_squared, ep_squared;
-	double xyz[3];
-	int ellipsoid_id;	/* Ellipsoid GMT ID number (or -1) */
-};
-
-struct GMT_DATUM_CONV {
-	bool h_given;	/* true if we have incoming height data [h = 0] */
-	double da;		/* Major semi-axis in meters */
-	double df;		/* Flattening */
-	double e_squared;	/* Eccentricity squared (e^2 = 2*f - f*f) */
-	double one_minus_f;	/* 1 - f */
-	double dxyz[3];		/* Ellipsoids offset in meter from Earth's center of mass for x,y, and z */
-	struct GMT_DATUM from, to;	/* The old and new datums */
-};
-
-struct GMT_PROJ4 {	/* Used to assign proj4 projections from GMT projections */
-	char *name;
-	unsigned int id;
-};
-
-struct GMT_PROJ {
-
-	struct GMT_THREE_D z_project;
-	struct GMT_DATUM_CONV datum;	/* For datum conversions */
-	struct GMT_PROJ4 *proj4;	/* A read-only resource we allocate once and pass pointer around */
-	void (*fwd) (struct GMT_CTRL *, double, double, double *, double *);/* Pointers to the selected forward mapping function */
-	void (*inv) (struct GMT_CTRL *, double *, double *, double, double);/* Pointers to the selected inverse mapping function */
-	void (*fwd_x) (struct GMT_CTRL *, double, double *);	/* Pointers to the selected linear x forward function */
-	void (*fwd_y) (struct GMT_CTRL *, double, double *);	/* Pointers to the selected linear y forward function */
-	void (*fwd_z) (struct GMT_CTRL *, double, double *);	/* Pointers to the selected linear z forward function */
-	void (*inv_x) (struct GMT_CTRL *, double *, double);	/* Pointers to the selected linear x inverse function */
-	void (*inv_y) (struct GMT_CTRL *, double *, double);	/* Pointers to the selected linear y inverse function */
-	void (*inv_z) (struct GMT_CTRL *, double *, double);	/* Pointers to the selected linear z inverse function */
-
-	double pars[10];		/* Raw unprocessed map-projection parameters as passed on command line */
-	double z_pars[2];		/* Raw unprocessed z-projection parameters as passed on command line */
-
-	/* Common projection parameters */
-
-	int projection;		/* Gives the id number for the projection used (-1 if not set) */
-
-	bool units_pr_degree;	/* true if scale is given as inch (or cm)/degree.  false for 1:xxxxx */
-	bool north_pole;		/* true if projection is on northern hemisphere, false on southern */
-	bool edge[4];		/* true if the edge is a map boundary */
-	bool three_D;		/* Parameters for 3-D projections */
-	bool JZ_set;		/* true if -Jz|Z was set */
-	bool GMT_convert_latitudes;	/* true if using spherical code with authalic/conformal latitudes */
-	bool inv_coordinates;	/* true if -fp[unit] was given and we must first recover lon,lat during reading */
-	unsigned int n_antipoles;	/* Number of antipole coordinates so far [used for -JE only] */
-	struct GMT_LATSWAP_CONSTS GMT_lat_swap_vals;
-
-	enum GMT_enum_units inv_coord_unit;		/* Index to scale that converts input map coordinates to meter before inverting for lon,lat */
-	char unit_name[GMT_N_UNITS][GMT_LEN16];	/* Names of the various distance units */
-	double m_per_unit[GMT_N_UNITS];	/* Meters in various units.  Use to scale units to meters */
-	double origin[3];		/* Projected values of the logical origin for the projection (x, y, z) */
-	double rect[4], zmin, zmax;	/* Extreme projected values */
-	double rect_m[4];		/* Extreme projected original meter values */
-	double scale[3];		/* Scaling for meters to map-distance (typically inch) conversion (x, y, z) */
-	double i_scale[3];		/* Inverse Scaling for meters to map-distance (typically inch) conversion (x, y, z) */
-	double z_level;			/* Level at which to draw basemap [0] */
-	double unit;			/* Gives meters pr plot unit (0.01 or 0.0254) */
-	double central_meridian;	/* Central meridian for projection [NaN] */
-	double lon0, lat0;		/* Projection center [NaN/NaN if not specified in -J] */
-	double pole;			/* +90 pr -90, depending on which pole */
-	double mean_radius;		/* Mean radius given the PROJ_* settings */
-	double EQ_RAD, i_EQ_RAD;	/* Current ellipsoid parameters */
-	double ECC, ECC2, ECC4, ECC6;	/* Powers of eccentricity */
-	double M_PR_DEG, KM_PR_DEG;	/* Current spherical approximations to convert degrees to dist */
-	double DIST_M_PR_DEG;		/* Current spherical approximations to convert degrees to m even if -J was not set */
-	double DIST_KM_PR_DEG;		/* Current spherical approximations to convert degrees to km even if -J was not set */
-	double half_ECC, i_half_ECC;	/* 0.5 * ECC and 0.5 / ECC */
-	double one_m_ECC2, i_one_m_ECC2; /* 1.0 - ECC2 and inverse */
-	unsigned int gave_map_width;	/* nonzero if map width (1), height (2), max dim (3) or min dim (4) is given instead of scale.  0 for 1:xxxxx */
-
-	uint64_t n_geodesic_calls;	/* Number of calls for geodesics in this session */
-	uint64_t n_geodesic_approx;	/* Number of calls for geodesics in this session that exceeded iteration limit */
-
-	double f_horizon, rho_max;	/* Azimuthal horizon (deg) and in plot coordinates */
-
-	/* Linear plot parameters */
-
-	unsigned int xyz_projection[3];	/* For linear projection, 0 = linear, 1 = log10, 2 = pow */
-	bool xyz_pos[3];		/* true if x,y,z-axis increases in normal positive direction */
-	bool compute_scale[3];	/* true if axes lengths were set rather than scales */
-	double xyz_pow[3];		/* For GMT_POW projection */
-	double xyz_ipow[3];
-
-	/* Center of radii for all conic projections */
-
-	double c_x0, c_y0;
-
-	/* Lambert conformal conic parameters. */
-
-	double l_N, l_i_N, l_Nr, l_i_Nr;
-	double l_F, l_rF, l_i_rF;
-	double l_rho0;
-
-	/* Oblique Mercator Projection (Spherical version )*/
-
-	double o_sin_pole_lat, o_cos_pole_lat;	/* Pole of rotation */
-	double o_pole_lon, o_pole_lat;	/* In degrees */
-	double o_beta;			/* lon' = beta for central_meridian (degrees) */
-	double o_FP[3], o_FC[3], o_IP[3], o_IC[3];
-
-	/* TM and UTM Projections */
-
-	double t_lat0;
-	double t_e2, t_M0;
-	double t_c1, t_c2, t_c3, t_c4;
-	double t_i1, t_i2, t_i3, t_i4, t_i5;
-	double t_r, t_ir;		/* Short for GMT->current.proj.EQ_RAD * GMT->current.setting.proj_scale_factor and its inverse */
-	int utm_hemisphere;	/* -1 for S, +1 for N, 0 if to be set by -R */
-	unsigned int utm_zonex;	/* The longitude component 1-60 */
-	char utm_zoney;			/* The latitude component A-Z */
-
-	/* Lambert Azimuthal Equal-Area Projection */
-
-	double sinp;
-	double cosp;
-	double Dx, Dy, iDx, iDy;	/* Fudge factors for projections w/authalic lats */
-
-	/* Stereographic Projection */
-
-	double s_c, s_ic;
-	double r;		/* Radius of projected sphere in plot units (inch or cm) */
-	bool polar;		/* True if projection pole coincides with S or N pole */
-
-	/* Mollweide, Hammer-Aitoff and Winkel Projection */
-
-	double w_x, w_y, w_iy, w_r;
-
-	/* Winkel Tripel Projection */
-
-	double r_cosphi1;	/* = cos (50.467) */
-
-	/* Robinson Projection */
-
-	double n_cx, n_cy;	/* = = 0.8487R, 1.3523R */
-	double n_i_cy;
-	double n_phi[GMT_N_ROBINSON], n_X[GMT_N_ROBINSON], n_Y[GMT_N_ROBINSON];
-	double n_x_coeff[3*GMT_N_ROBINSON], n_y_coeff[3*GMT_N_ROBINSON], n_iy_coeff[3*GMT_N_ROBINSON];
-
-	/* Eckert IV Projection */
-
-	double k4_x, k4_y, k4_ix, k4_iy;
-
-	/* Eckert VI Projection */
-
-	double k6_r, k6_ir;
-
-	/* Cassini Projection */
-
-	double c_M0, c_c1, c_c2, c_c3, c_c4;
-	double c_i1, c_i2, c_i3, c_i4, c_i5, c_p;
-
-	/* All Cylindrical Projections */
-
-	double j_x, j_y, j_ix, j_iy;
-
-	/* Albers Equal-area conic parameters. */
-
-	double a_n, a_i_n;
-	double a_C, a_n2ir2, a_test, a_Cin;
-	double a_rho0;
-
-	/* Equidistant conic parameters. */
-
-	double d_n, d_i_n;
-	double d_G, d_rho0;
-
-	/* Van der Grinten parameters. */
-
-	double v_r, v_ir;
-
-        /* General Perspective parameters */
-        double g_H, g_R;
-        double g_P, g_P_inverse;
-        double g_lon0;
-        double g_sphi1, g_cphi1;
-        double g_phig, g_sphig, g_cphig;
-        double g_sdphi, g_cdphi;
-        double g_B, g_D, g_L, g_G, g_J;
-        double g_BLH, g_DG, g_BJ, g_DHJ, g_LH2, g_HJ;
-        double g_sin_tilt, g_cos_tilt;
-        double g_azimuth, g_sin_azimuth, g_cos_azimuth;
-        double g_sin_twist, g_cos_twist;
-        double g_width;
-        double g_yoffset;
-        double g_rmax;
-        double g_max_yt;
-        double g_xmin, g_xmax;
-        double g_ymin, g_ymax;
-
-        unsigned int g_debug;
-        int g_box, g_outside, g_longlat_set, g_sphere, g_radius, g_auto_twist;
-	bool windowed;
-	
-	/* Polar (cylindrical) projection */
-
-	double p_base_angle;
-	bool got_azimuths, got_elevations, z_down;
-
-};
-
-enum GMT_enum_frame {GMT_IS_PLAIN = 0,	/* Plain baseframe */
-	GMT_IS_INSIDE	= 1,	/* Plain frame ticks/annotations on the inside of boundary */
-	GMT_IS_GRAPH	= 2,	/* Plain fram with arrow extensions on axes */
-	GMT_IS_FANCY	= 4,	/* Fancy baseframe */
-	GMT_IS_ROUNDED	= 12};	/* Fancy baseframe, rounded */
-
-/* Define the 6 axis items that each axis can have (some are mutually exclusive: only one ANNOT/INTV for upper and lower) */
-
-enum GMT_enum_tick {GMT_ANNOT_UPPER = 0,	/* Tick annotations closest to the axis */
-	GMT_ANNOT_LOWER,	/* Tick annotations farthest from the axis*/
-	GMT_TICK_UPPER,		/* Frame tick marks closest to the axis */
-	GMT_TICK_LOWER,		/* Frame tick marks closest to the axis */
-	GMT_GRID_UPPER,		/* Gridline spacing */
-	GMT_GRID_LOWER};	/* Gridline spacing */
-
-/* Some convenient macros for axis routines */
-
-#define GMT_uneven_interval(unit) ((unit == 'o' || unit == 'O' || unit == 'k' || unit == 'K' || unit == 'R' || unit == 'r' || unit == 'D' || unit == 'd') ? true : false)	/* true for uneven units */
-
-/* The array side in GMT_PLOT_FRAME follows the order south, east, north, west (CCW loop) + z.
- * Ro avoid using confusing indices 0-4 we define very brief constants S_SIDE, E_SIDE, N_SIDE
- * W_SIDE and Z_SIDE that should be used instead. */
-
-#ifndef S_SIDE
-#define S_SIDE 0
-#endif
-#ifndef E_SIDE
-#define E_SIDE 1
-#endif
-#ifndef N_SIDE
-#define N_SIDE 2
-#endif
-#ifndef W_SIDE
-#define W_SIDE 3
-#endif
-#ifndef Z_SIDE
-#define Z_SIDE 4
-#endif
-
-struct GMT_PLOT_AXIS_ITEM {		/* Information for one type of tick/annotation */
-	double interval;		/* Distance between ticks in user units */
-	unsigned int parent;		/* Id of axis this item belongs to (0,1,2) */
-	bool active;			/* true if we want to use this item */
-	bool generated;			/* true if this is an auto-generated interval */
-	bool special;			/* true if custom interval annotations */
-	unsigned int flavor;		/* Index into month/day name abbreviation array (0-2) */
-	bool upper_case;		/* true if we want upper case text (used with flavor) */
-	char type;			/* One of a, A, i, I, f, F, g, G */
-	char unit;			/* User's interval unit (y, M, u, d, h, m, c) */
-};
-
-struct GMT_PLOT_AXIS {		/* Information for one time axis */
-	unsigned int id;		/* 0 (x), 1(y), or 2(z) */
-	unsigned int type;		/* GMT_LINEAR, GMT_LOG10, GMT_POW, GMT_TIME */
-	unsigned int special;		/* 0, GMT_CUSTOM, GMT_CPT */
-	struct GMT_PLOT_AXIS_ITEM item[6];	/* see above defines for which is which */
-	double phase;			/* Phase offset for strides: (knot-phase)%interval = 0  */
-	char label[GMT_LEN256];	/* Label of the axis */
-	char unit[GMT_LEN64];	/* Axis unit appended to annotations */
-	char prefix[GMT_LEN64];	/* Axis prefix starting all annotations */
-	char *file_custom;		/* File with custom annotations */
-};
-
-struct GMT_PLOT_FRAME {		/* Various parameters for plotting of time axis boundaries */
-	struct GMT_PLOT_AXIS axis[3];	/* One each for x, y, and z */
-	char header[GMT_LEN256];	/* Plot title */
-	struct GMT_FILL fill;		/* Fill for the basemap inside, if paint == true */
-	bool plotted_header;		/* true if header has been plotted */
-	bool init;			/* true if -B was used at all */
-	bool set;			/* true if -B was used to set any increments */
-	bool draw;			/* true if -B<int> was used, even -B0, as sign to draw axes */
-	bool paint;			/* true if -B +g<fill> was used */
-	bool draw_box;			/* true is a 3-D Z-box is desired */
-	bool check_side;		/* true if lon and lat annotations should be on x and y axis only */
-	bool primary;			/* true if current axis is primary, false if secondary */
-	bool slash;			/* true if slashes were used in the -B argument */
-	bool obl_grid;			/* true if +o was given to draw oblique gridlines */
-	unsigned int set_frame[2];	/* 1 if a -B<WESNframe> setting was given */
-	unsigned int horizontal;	/* 1 is S/N annotations should be parallel to axes, 2 if forced */
-	unsigned int side[5];		/* Which sides (0-3 in plane; 4 = z) to plot. 2 is annot/draw, 1 is draw, 0 is not */
-	unsigned int z_axis[4];		/* Which axes to use for the 3-D z-axis [auto] */
-};
-
-#endif /* _GMT_PROJECT_H */
diff --git a/src/gmt/gmt_prototypes.h b/src/gmt/gmt_prototypes.h
deleted file mode 100644
index d8a6878..0000000
--- a/src/gmt/gmt_prototypes.h
+++ /dev/null
@@ -1,448 +0,0 @@
-/*--------------------------------------------------------------------
- *	$Id: gmt_prototypes.h 2242 2015-05-16 05:21:28Z caress $
- *
- *	Copyright (c) 1991-2015 by P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis and F. Wobbe
- *	See LICENSE.TXT file for copying and redistribution conditions.
- *
- *	This program is free software; you can redistribute it and/or modify
- *	it under the terms of the GNU Lesser General Public License as published by
- *	the Free Software Foundation; version 3 or any later version.
- *
- *	This program is distributed in the hope that it will be useful,
- *	but WITHOUT ANY WARRANTY; without even the implied warranty of
- *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *	GNU Lesser General Public License for more details.
- *
- *	Contact info: gmt.soest.hawaii.edu
- *--------------------------------------------------------------------*/
-/* gmt_prototypes.h  --  All low-level GMT API function prototypes.
-
-   Authors:	P. Wessel, W. H. F. Smith, R. Scharroo, and J. Luis
-   Date:	1-OCT-2009
-   Version:	5 API
-
-*/
-
-#ifndef _GMT_PROTOTYPES_H
-#define _GMT_PROTOTYPES_H
-
-#ifdef DEBUG
-EXTERN_MSC void grd_dump (struct GMT_GRID_HEADER *header, float *grid, bool is_complex, char *txt);
-#endif
-
-/* Temporary redef of strdup to allow check of memory leaks due to usage of strdup */
-#ifdef FISH_STRDUP_LEAKS
-EXTERN_MSC char *GMT_strdup (struct GMT_CTRL *GMT, const char *s);
-#endif
-
-/* gmt_bcr.c: */
-EXTERN_MSC double GMT_get_bcr_z (struct GMT_CTRL *GMT, struct GMT_GRID *G, double xx, double yy);		/* Compute z(x,y) from bcr structure and grid */
-EXTERN_MSC int GMT_get_bcr_img (struct GMT_CTRL *GMT, struct GMT_IMAGE *G, double xx, double yy, unsigned char *z);		/* Compute z(x,y) from bcr structure and image */
-
-/* gmt_customio.c: */
-
-#ifdef HAVE_GDAL
-/* Format # 22 */
-EXTERN_MSC int GMT_gdalread (struct GMT_CTRL *GMT, char *gdal_filename, struct GDALREAD_CTRL *prhs, struct GD_CTRL *Ctrl);
-EXTERN_MSC int GMT_gdalwrite (struct GMT_CTRL *GMT, char *filename, struct GDALWRITE_CTRL *prhs);
-#endif
-
-/* gmt_fft.c: */
-
-EXTERN_MSC void GMT_fft_initialization (struct GMT_CTRL *GMT);
-EXTERN_MSC void GMT_fft_cleanup (struct GMT_CTRL *GMT);
-EXTERN_MSC void GMT_fft_set_k (struct GMT_CTRL *GMT, unsigned int mode, struct GMT_FFT_WAVENUMBER *K);
-EXTERN_MSC int GMT_fft_set_wave (struct GMT_CTRL *GMT, unsigned int mode, struct GMT_FFT_WAVENUMBER *K);
-EXTERN_MSC double GMT_fft_get_wave (uint64_t k, struct GMT_FFT_WAVENUMBER *K);
-EXTERN_MSC double GMT_fft_any_wave (uint64_t k, unsigned int mode, struct GMT_FFT_WAVENUMBER *K);
-EXTERN_MSC void GMT_suggest_fft_dim (struct GMT_CTRL *GMT, unsigned int nx, unsigned int ny, struct GMT_FFT_SUGGESTION *fft_sug, bool do_print);
-
-/* gmt_grdio.c: */
-
-EXTERN_MSC void GMT_grd_detrend (struct GMT_CTRL *GMT, struct GMT_GRID *Grid, unsigned int mode, double *a);
-EXTERN_MSC void GMT_grd_minmax (struct GMT_CTRL *GMT, struct GMT_GRID *Grid, double xyz[2][3]);
-EXTERN_MSC struct GMT_GRID * GMT_create_grid (struct GMT_CTRL *GMT);
-EXTERN_MSC struct GMT_GRID * GMT_duplicate_grid (struct GMT_CTRL *GMT, struct GMT_GRID *G, unsigned int mode);
-EXTERN_MSC struct GMT_GRID_HEADER * GMT_duplicate_gridheader (struct GMT_CTRL *GMT, struct GMT_GRID_HEADER *h);
-EXTERN_MSC void GMT_grd_init (struct GMT_CTRL *GMT, struct GMT_GRID_HEADER *header, struct GMT_OPTION *options, bool update);
-EXTERN_MSC void GMT_decode_grd_h_info (struct GMT_CTRL *GMT, char *input, struct GMT_GRID_HEADER *h);
-EXTERN_MSC void GMT_free_grid (struct GMT_CTRL *GMT, struct GMT_GRID **G, bool free_grid);
-EXTERN_MSC void GMT_set_grdinc (struct GMT_CTRL *GMT, struct GMT_GRID_HEADER *h);
-EXTERN_MSC void GMT_set_grddim (struct GMT_CTRL *GMT, struct GMT_GRID_HEADER *h);
-EXTERN_MSC void GMT_grd_pad_on (struct GMT_CTRL *GMT, struct GMT_GRID *G, unsigned int *pad);
-EXTERN_MSC void GMT_grd_pad_off (struct GMT_CTRL *GMT, struct GMT_GRID *G);
-EXTERN_MSC void GMT_grd_pad_zero (struct GMT_CTRL *GMT, struct GMT_GRID *G);
-EXTERN_MSC void GMT_grd_zminmax (struct GMT_CTRL *GMT, struct GMT_GRID_HEADER *h, float *z);
-EXTERN_MSC int GMT_read_grd_info (struct GMT_CTRL *GMT, char *file, struct GMT_GRID_HEADER *header);
-EXTERN_MSC int GMT_write_grd_info (struct GMT_CTRL *GMT, char *file, struct GMT_GRID_HEADER *header);
-EXTERN_MSC int GMT_read_grd (struct GMT_CTRL *GMT, char *file, struct GMT_GRID_HEADER *header, float *grid, double *wesn, unsigned int *pad, int complex_mode);
-EXTERN_MSC int GMT_write_grd (struct GMT_CTRL *GMT, char *file, struct GMT_GRID_HEADER *header, float *grid, double *wesn, unsigned int *pad, int complex_mode);
-EXTERN_MSC int GMT_adjust_loose_wesn (struct GMT_CTRL *GMT, double wesn[], struct GMT_GRID_HEADER *header);
-EXTERN_MSC int GMT_grd_setregion (struct GMT_CTRL *GMT, struct GMT_GRID_HEADER *h, double *wesn, unsigned int interpolant);
-EXTERN_MSC int GMT_grd_RI_verify (struct GMT_CTRL *GMT, struct GMT_GRID_HEADER *h, unsigned int mode);
-EXTERN_MSC int GMT_read_img (struct GMT_CTRL *GMT, char *imgfile, struct GMT_GRID *G, double *wesn, double scale, unsigned int mode, double lat, bool init);
-EXTERN_MSC int GMT_conv_intext2dbl (struct GMT_CTRL *GMT, char *record, unsigned int ncols);
-EXTERN_MSC bool GMT_grd_pad_status (struct GMT_CTRL *GMT, struct GMT_GRID_HEADER *header, unsigned int *pad);
-EXTERN_MSC int GMT_set_outgrid (struct GMT_CTRL *GMT, char *file, struct GMT_GRID *G, struct GMT_GRID **Out);
-EXTERN_MSC int GMT_change_grdreg (struct GMT_CTRL *GMT, struct GMT_GRID_HEADER *h, unsigned int registration);
-EXTERN_MSC void GMT_grd_shift (struct GMT_CTRL *GMT, struct GMT_GRID *Grid, double shift);
-EXTERN_MSC void GMT_grd_set_ij_inc (struct GMT_CTRL *GMT, unsigned int nx, int *ij_inc);
-EXTERN_MSC double * GMT_grd_coord (struct GMT_CTRL *GMT, struct GMT_GRID_HEADER *h, int dir);
-#ifdef HAVE_GDAL
-EXTERN_MSC int GMT_read_image (struct GMT_CTRL *GMT, char *file, struct GMT_IMAGE *I, double *wesn,
-			unsigned int *pad, unsigned int complex_mode);		/* Function to read true images via GDAL */
-int GMT_read_image_info (struct GMT_CTRL *GMT, char *file, struct GMT_IMAGE *I);
-#endif
-
-#ifdef _PSLIB_H
-/* gmt_plot.c prototypes only included if pslib has been included */
-
-EXTERN_MSC char * GMT_export2proj4 (struct GMT_CTRL *GMT);
-EXTERN_MSC void GMT_textpath_init (struct GMT_CTRL *GMT, struct GMT_PEN *BP, double Brgb[]);
-EXTERN_MSC void GMT_draw_map_rose (struct GMT_CTRL *GMT, struct GMT_MAP_ROSE *mr);
-EXTERN_MSC int GMT_draw_map_scale (struct GMT_CTRL *GMT, struct GMT_MAP_SCALE *ms);
-EXTERN_MSC void GMT_draw_map_insert (struct GMT_CTRL *GMT, struct GMT_MAP_INSERT *B);
-EXTERN_MSC void GMT_geo_line (struct GMT_CTRL *GMT, double *lon, double *lat, uint64_t n);
-EXTERN_MSC void GMT_geo_polygons (struct GMT_CTRL *GMT, struct GMT_DATASEGMENT *S);
-EXTERN_MSC void GMT_geo_ellipse (struct GMT_CTRL *GMT, double lon, double lat, double major, double minor, double azimuth);
-EXTERN_MSC void GMT_geo_rectangle (struct GMT_CTRL *GMT, double lon, double lat, double width, double height, double azimuth);
-EXTERN_MSC unsigned int GMT_geo_vector (struct GMT_CTRL *GMT, double lon0, double lat0, double azimuth, double length, struct GMT_PEN *pen, struct GMT_SYMBOL *S);
-EXTERN_MSC void GMT_draw_front (struct GMT_CTRL *GMT, double x[], double y[], uint64_t n, struct GMT_FRONTLINE *f);
-EXTERN_MSC void GMT_map_basemap (struct GMT_CTRL *GMT);
-EXTERN_MSC void GMT_map_clip_off (struct GMT_CTRL *GMT);
-EXTERN_MSC void GMT_map_clip_on (struct GMT_CTRL *GMT, double rgb[], unsigned int flag);
-EXTERN_MSC void GMT_plot_line (struct GMT_CTRL *GMT, double *x, double *y, unsigned int *pen, uint64_t n);
-EXTERN_MSC void GMT_setpen (struct GMT_CTRL *GMT, struct GMT_PEN *pen);
-EXTERN_MSC void GMT_setfill (struct GMT_CTRL *GMT, struct GMT_FILL *fill, int outline);
-EXTERN_MSC void GMT_vertical_axis (struct GMT_CTRL *GMT, unsigned int mode);
-EXTERN_MSC void GMT_xy_axis (struct GMT_CTRL *GMT, double x0, double y0, double length, double val0, double val1, struct GMT_PLOT_AXIS *A, bool below, bool annotate);
-EXTERN_MSC int GMT_draw_custom_symbol (struct GMT_CTRL *GMT, double x0, double y0, double size[], struct GMT_CUSTOM_SYMBOL *symbol, struct GMT_PEN *pen, struct GMT_FILL *fill, unsigned int outline);
-EXTERN_MSC void GMT_contlabel_plot (struct GMT_CTRL *GMT, struct GMT_CONTOUR *G);
-EXTERN_MSC void GMT_plane_perspective (struct GMT_CTRL *GMT, int plane, double level);
-EXTERN_MSC void GMT_plotcanvas (struct GMT_CTRL *GMT);
-EXTERN_MSC void GMT_write_label_record (struct GMT_CTRL *GMT, FILE *fp, double x, double y, double angle, char *label, bool save_angle);
-EXTERN_MSC int GMT_contlabel_save_begin (struct GMT_CTRL *GMT, struct GMT_CONTOUR *G);
-EXTERN_MSC int GMT_contlabel_save_end (struct GMT_CTRL *GMT, struct GMT_CONTOUR *G);
-EXTERN_MSC unsigned int GMT_setfont (struct GMT_CTRL *GMT, struct GMT_FONT *F);
-EXTERN_MSC void GMT_plotend (struct GMT_CTRL *GMT);
-EXTERN_MSC struct PSL_CTRL * GMT_plotinit (struct GMT_CTRL *GMT, struct GMT_OPTION *options);
-#endif
-
-/* gmt_io.c: */
-
-EXTERN_MSC bool GMT_is_a_blank_line (char *line);	/* Checks if line is a blank line or comment */
-EXTERN_MSC void GMT_eliminate_lon_jumps (struct GMT_CTRL *GMT, double *lon, uint64_t n_rows);
-EXTERN_MSC void GMT_set_geographic (struct GMT_CTRL *GMT, unsigned int dir);
-EXTERN_MSC void GMT_set_cartesian (struct GMT_CTRL *GMT, unsigned int dir);
-EXTERN_MSC void GMT_set_xycolnames (struct GMT_CTRL *GMT, char *string);
-EXTERN_MSC p_to_io_func GMT_get_io_ptr (struct GMT_CTRL *GMT, int direction, enum GMT_swap_direction swap, char type);
-EXTERN_MSC bool GMT_is_ascii_record (struct GMT_CTRL *GMT);
-EXTERN_MSC void GMT_set_segmentheader (struct GMT_CTRL *GMT, int direction, bool true_false);
-EXTERN_MSC void GMT_set_tableheader (struct GMT_CTRL *GMT, int direction, bool true_false);
-EXTERN_MSC void GMT_io_binary_header (struct GMT_CTRL *GMT, FILE *fp, unsigned int dir);
-EXTERN_MSC void * GMT_z_input (struct GMT_CTRL *GMT, FILE *fp, uint64_t *n, int *status);
-EXTERN_MSC int GMT_z_output (struct GMT_CTRL *GMT, FILE *fp, uint64_t n, double *data);
-EXTERN_MSC int GMT_get_io_type (struct GMT_CTRL *GMT, char type);
-EXTERN_MSC struct GMT_QUAD * GMT_quad_init (struct GMT_CTRL *GMT, uint64_t n_items);
-EXTERN_MSC void GMT_quad_reset (struct GMT_CTRL *GMT, struct GMT_QUAD *Q, uint64_t n_items);
-EXTERN_MSC void GMT_quad_add (struct GMT_CTRL *GMT, struct GMT_QUAD *Q, double x);
-EXTERN_MSC unsigned int GMT_quad_finalize (struct GMT_CTRL *GMT, struct GMT_QUAD *Q);
-EXTERN_MSC char * GMT_fgets (struct GMT_CTRL *GMT, char *str, int size, FILE *stream);
-EXTERN_MSC int GMT_fclose (struct GMT_CTRL *GMT, FILE *stream);
-EXTERN_MSC int GMT_access (struct GMT_CTRL *GMT, const char *filename, int mode);		/* access wrapper */
-EXTERN_MSC FILE * GMT_fopen (struct GMT_CTRL *GMT, const char *filename, const char *mode);
-EXTERN_MSC char * GMT_getdatapath (struct GMT_CTRL *GMT, const char *stem, char *path, int mode);	/* Look for data file */
-EXTERN_MSC char * GMT_getsharepath (struct GMT_CTRL *GMT, const char *subdir, const char *stem, const char *suffix, char *path, int mode);	/* Look for shared file */
-EXTERN_MSC void GMT_write_tableheader (struct GMT_CTRL *GMT, FILE *fp, char *txt);
-EXTERN_MSC void GMT_write_segmentheader (struct GMT_CTRL *GMT, FILE *fp, uint64_t n_cols);		/* Write segment header back out */
-EXTERN_MSC void GMT_write_textrecord (struct GMT_CTRL *GMT, FILE *fp, char *txt);
-EXTERN_MSC void GMT_ascii_format_col (struct GMT_CTRL *GMT, char *text, double x, unsigned int direction, uint64_t col);
-EXTERN_MSC void GMT_lon_range_adjust (unsigned int range, double *lon);		/* Adjust the longitude given the desired range */
-EXTERN_MSC void GMT_add_to_record (struct GMT_CTRL *GMT, char *record, double val, uint64_t col, unsigned int sep);
-EXTERN_MSC int GMT_scanf (struct GMT_CTRL *GMT, char *p, unsigned int expectation, double *val);	/* Convert strings to double, handling special formats [Data records only ] */
-EXTERN_MSC int GMT_scanf_arg (struct GMT_CTRL *GMT, char *p, unsigned int expectation, double *val);	/* Convert strings to double, handling special formats [ command line only ] */
-EXTERN_MSC int GMT_ascii_output_col (struct GMT_CTRL *GMT, FILE *fp, double x, uint64_t col);
-EXTERN_MSC bool GMT_not_numeric (struct GMT_CTRL *GMT, char *text);				/* Rules out _some_ text as possible numerics */
-EXTERN_MSC bool GMT_parse_segment_item (struct GMT_CTRL *GMT, char *in_string, char *pattern, char *out_string);
-EXTERN_MSC int GMT_set_cols (struct GMT_CTRL *GMT, unsigned int direction, uint64_t expected);
-EXTERN_MSC uint64_t GMT_get_cols (struct GMT_CTRL *GMT, unsigned int direction);
-EXTERN_MSC struct GMT_DATASET * GMT_create_dataset (struct GMT_CTRL *GMT, uint64_t n_tables, uint64_t n_segments, uint64_t n_rows, uint64_t n_columns, unsigned int geometry, bool alloc_only);
-EXTERN_MSC struct GMT_DATATABLE * GMT_create_table (struct GMT_CTRL *GMT, uint64_t n_segments, uint64_t n_rows, uint64_t n_columns, bool alloc_only);
-EXTERN_MSC void GMT_free_textset (struct GMT_CTRL *GMT, struct GMT_TEXTSET **data);
-EXTERN_MSC struct GMT_TEXTSET * GMT_duplicate_textset (struct GMT_CTRL *GMT, struct GMT_TEXTSET *Din, unsigned int mode);
-EXTERN_MSC void GMT_adjust_dataset (struct GMT_CTRL *GMT, struct GMT_DATASET *D, uint64_t n_columns);
-EXTERN_MSC struct GMT_DATASET * GMT_alloc_dataset (struct GMT_CTRL *GMT, struct GMT_DATASET *Din, uint64_t n_rows, uint64_t n_columns, unsigned int mode);
-EXTERN_MSC struct GMT_DATASET * GMT_duplicate_dataset (struct GMT_CTRL *GMT, struct GMT_DATASET *Din, unsigned int mode, unsigned int *geometry);
-EXTERN_MSC struct GMT_DATATABLE * GMT_read_table (struct GMT_CTRL *GMT, void *source, unsigned int source_type, bool greenwich, unsigned int *geometry, bool use_GMT_io);
-EXTERN_MSC int GMT_write_dataset (struct GMT_CTRL *GMT, void *dest, unsigned int dest_type, struct GMT_DATASET *D, bool use_GMT_io, int table);
-EXTERN_MSC int GMT_write_table (struct GMT_CTRL *GMT, void *dest, unsigned int dest_type, struct GMT_DATATABLE *T, bool use_GMT_io, unsigned int io_mode);
-EXTERN_MSC int GMT_alloc_segment (struct GMT_CTRL *GMT, struct GMT_DATASEGMENT *S, uint64_t n_rows, uint64_t n_columns, bool first);
-EXTERN_MSC void GMT_free_segment (struct GMT_CTRL *GMT, struct GMT_DATASEGMENT **segment, enum GMT_enum_alloc alloc_mode);
-EXTERN_MSC void GMT_free_table (struct GMT_CTRL *GMT, struct GMT_DATATABLE *table, enum GMT_enum_alloc alloc_mode);
-EXTERN_MSC void GMT_free_dataset (struct GMT_CTRL *GMT, struct GMT_DATASET **data);
-EXTERN_MSC void GMT_free_palette (struct GMT_CTRL *GMT, struct GMT_PALETTE **P);
-#ifdef HAVE_GDAL
-EXTERN_MSC struct GMT_IMAGE * GMT_create_image (struct GMT_CTRL *GMT);
-EXTERN_MSC void GMT_free_image (struct GMT_CTRL *GMT, struct GMT_IMAGE **I, bool free_image);
-#endif
-EXTERN_MSC struct GMT_MATRIX * GMT_create_matrix (struct GMT_CTRL *GMT, uint64_t n_layers);
-EXTERN_MSC void GMT_free_matrix (struct GMT_CTRL *GMT, struct GMT_MATRIX **M, bool free_matrix);
-EXTERN_MSC struct GMT_VECTOR * GMT_create_vector (struct GMT_CTRL *GMT, uint64_t n_columns);
-EXTERN_MSC void GMT_free_vector (struct GMT_CTRL *GMT, struct GMT_VECTOR **V, bool free_vector);
-EXTERN_MSC int GMT_load_aspatial_string (struct GMT_CTRL *GMT, struct GMT_OGR *G, uint64_t col, char out[GMT_BUFSIZ]);
-EXTERN_MSC double GMT_get_aspatial_value (struct GMT_CTRL *GMT, uint64_t col, struct GMT_DATASEGMENT *S);
-EXTERN_MSC void GMT_set_seg_minmax (struct GMT_CTRL *GMT, struct GMT_DATASEGMENT *S);
-EXTERN_MSC void GMT_set_seg_polar (struct GMT_CTRL *GMT, struct GMT_DATASEGMENT *S);
-EXTERN_MSC void GMT_skip_xy_duplicates (struct GMT_CTRL *GMT, bool mode);
-EXTERN_MSC void GMT_duplicate_ogr_seg (struct GMT_CTRL *GMT, struct GMT_DATASEGMENT *S_to, struct GMT_DATASEGMENT *S_from);
-EXTERN_MSC struct GMT_DATASEGMENT * GMT_duplicate_segment (struct GMT_CTRL *GMT, struct GMT_DATASEGMENT *Sin);
-EXTERN_MSC void GMT_write_ogr_header (FILE *fp, struct GMT_OGR *G);
-EXTERN_MSC int GMT_append_ogr_item (struct GMT_CTRL *GMT, char *name, unsigned int type, struct GMT_OGR *S);
-EXTERN_MSC char * GMT_trim_segheader (struct GMT_CTRL *GMT, char *line);
-EXTERN_MSC int GMT_alloc_univector (struct GMT_CTRL *GMT, union GMT_UNIVECTOR *u, unsigned int type, uint64_t n_rows);
-EXTERN_MSC bool gmt_byteswap_file (struct GMT_CTRL *GMT,
-		FILE *outfp, FILE *infp, const SwapWidth nbytes,
-		const uint64_t offset, const uint64_t length);
-EXTERN_MSC int GMT_parse_segment_header (struct GMT_CTRL *GMT, char *header, struct GMT_PALETTE *P, bool *use_fill, struct GMT_FILL *fill, struct GMT_FILL def_fill, bool *use_pen, struct GMT_PEN *pen, struct GMT_PEN def_pen, unsigned int def_outline, struct GMT_OGR_SEG *G);
-EXTERN_MSC int GMT_parse_z_io (struct GMT_CTRL *GMT, char *txt, struct GMT_PARSE_Z_IO *z);
-EXTERN_MSC int GMT_init_z_io (struct GMT_CTRL *GMT, char format[], bool repeat[], enum GMT_swap_direction swab, off_t skip, char type, struct GMT_Z_IO *r);
-EXTERN_MSC int GMT_set_z_io (struct GMT_CTRL *GMT, struct GMT_Z_IO *r, struct GMT_GRID *G);
-EXTERN_MSC void GMT_check_z_io (struct GMT_CTRL *GMT, struct GMT_Z_IO *r, struct GMT_GRID *G);
-EXTERN_MSC void GMT_init_io_columns (struct GMT_CTRL *GMT, unsigned int dir);
-EXTERN_MSC void GMT_write_newheaders (struct GMT_CTRL *GMT, FILE *fp, uint64_t n_columns);
-EXTERN_MSC char **GMT_get_dir_list (struct GMT_CTRL *GMT, char *path, char *ext);
-EXTERN_MSC void GMT_free_dir_list (struct GMT_CTRL *GMT, char ***list);
-EXTERN_MSC void GMT_assign_segment (struct GMT_CTRL *GMT, struct GMT_DATASEGMENT *S, uint64_t n_rows, uint64_t n_columns);
-EXTERN_MSC double *GMT_assign_vector (struct GMT_CTRL *GMT, uint64_t n_rows, uint64_t col);
-EXTERN_MSC bool GMT_input_is_bin (struct GMT_CTRL *GMT, const char *filename);
-
-/* gmt_memory.c: */
-
-EXTERN_MSC void GMT_prep_tmp_arrays (struct GMT_CTRL *GMT, size_t row, size_t n_cols);
-EXTERN_MSC void GMT_free_tmp_arrays (struct GMT_CTRL *GMT);
-EXTERN_MSC void GMT_set_meminc (struct GMT_CTRL *GMT, size_t increment);
-EXTERN_MSC void GMT_reset_meminc (struct GMT_CTRL *GMT);
-EXTERN_MSC void * GMT_memory_func (struct GMT_CTRL *GMT, void *prev_addr, size_t nelem, size_t size, bool align, const char *where);
-EXTERN_MSC void GMT_free_func (struct GMT_CTRL *GMT, void *addr, bool align, const char *where);
-
-/* gmt_support.c: */
-
-EXTERN_MSC void GMT_flip_angle_d (struct GMT_CTRL *GMT, double *angle);
-EXTERN_MSC void GMT_flip_angle_f (struct GMT_CTRL *GMT, float *angle);
-EXTERN_MSC struct GMT_DATATABLE *GMT_make_profile (struct GMT_CTRL *GMT, char option, char *args, bool resample, bool project, bool get_distances, double step, enum GMT_enum_track mode, double xyz[2][3]);
-EXTERN_MSC unsigned int GMT_split_line_at_dateline (struct GMT_CTRL *GMT, struct GMT_DATASEGMENT *S, struct GMT_DATASEGMENT ***Lout);
-EXTERN_MSC unsigned int GMT_split_poly_at_dateline (struct GMT_CTRL *GMT, struct GMT_DATASEGMENT *S, struct GMT_DATASEGMENT ***Lout);
-EXTERN_MSC bool GMT_x_is_outside (struct GMT_CTRL *GMT, double *x, double left, double right);
-EXTERN_MSC void GMT_set_xy_domain (struct GMT_CTRL *GMT, double wesn_extended[], struct GMT_GRID_HEADER *h);
-EXTERN_MSC int GMT_BC_init (struct GMT_CTRL *GMT, struct GMT_GRID_HEADER *h);
-EXTERN_MSC int GMT_grd_BC_set (struct GMT_CTRL *GMT, struct GMT_GRID *G, unsigned int direction);
-EXTERN_MSC void GMT_inplace_transpose (float *A, unsigned int n_rows, unsigned int n_cols);
-EXTERN_MSC struct GMT_PALETTE * GMT_truncate_cpt (struct GMT_CTRL *GMT, struct GMT_PALETTE *P, double z_low, double z_high);
-EXTERN_MSC void GMT_free_int_selection (struct GMT_CTRL *GMT, struct GMT_INT_SELECTION **S);
-EXTERN_MSC struct GMT_INT_SELECTION * GMT_set_int_selection (struct GMT_CTRL *GMT, char *item);
-EXTERN_MSC bool GMT_get_int_selection (struct GMT_CTRL *GMT, struct GMT_INT_SELECTION *S, uint64_t this);
-EXTERN_MSC void GMT_free_text_selection (struct GMT_CTRL *GMT, struct GMT_TEXT_SELECTION **S);
-EXTERN_MSC bool GMT_get_text_selection (struct GMT_CTRL *GMT, struct GMT_TEXT_SELECTION *S, struct GMT_DATASEGMENT *T, bool last_match);
-EXTERN_MSC struct GMT_TEXT_SELECTION * GMT_set_text_selection (struct GMT_CTRL *GMT, char *arg);
-
-#ifdef HAVE_GDAL
-EXTERN_MSC int GMT_image_BC_set (struct GMT_CTRL *GMT, struct GMT_IMAGE *I);
-#endif
-EXTERN_MSC bool GMT_y_out_of_bounds (struct GMT_CTRL *GMT, int *j, struct GMT_GRID_HEADER *h, bool *wrap_180);
-EXTERN_MSC bool GMT_x_out_of_bounds (struct GMT_CTRL *GMT, int *i, struct GMT_GRID_HEADER *h, bool wrap_180);
-EXTERN_MSC bool GMT_row_col_out_of_bounds (struct GMT_CTRL *GMT, double *in, struct GMT_GRID_HEADER *h, unsigned int *row, unsigned int *col);
-EXTERN_MSC int GMT_list_cpt (struct GMT_CTRL *GMT, char option);
-EXTERN_MSC struct GMT_PALETTE * GMT_sample_cpt (struct GMT_CTRL *GMT, struct GMT_PALETTE *Pin, double z[], int nz, bool continuous, bool reverse, bool log_mode, bool no_inter);
-EXTERN_MSC int GMT_write_cpt (struct GMT_CTRL *GMT, void *dest, unsigned int dest_type, unsigned int cpt_flags, struct GMT_PALETTE *P);
-EXTERN_MSC void GMT_cpt_transparency (struct GMT_CTRL *GMT, struct GMT_PALETTE *P, double transparency, unsigned int mode);
-EXTERN_MSC void GMT_copy_palette (struct GMT_CTRL *GMT, struct GMT_PALETTE *P_to, struct GMT_PALETTE *P_from);
-EXTERN_MSC int GMT_contlabel_info (struct GMT_CTRL *GMT, char flag, char *txt, struct GMT_CONTOUR *G);
-EXTERN_MSC void GMT_contlabel_init (struct GMT_CTRL *GMT, struct GMT_CONTOUR *G, unsigned int mode);
-EXTERN_MSC int GMT_contlabel_specs (struct GMT_CTRL *GMT, char *txt, struct GMT_CONTOUR *G);
-EXTERN_MSC int GMT_contlabel_prep (struct GMT_CTRL *GMT, struct GMT_CONTOUR *G, double xyz[2][3]);
-EXTERN_MSC void GMT_contlabel_free (struct GMT_CTRL *GMT, struct GMT_CONTOUR *G);
-EXTERN_MSC void GMT_hold_contour (struct GMT_CTRL *GMT, double **xx, double **yy, uint64_t nn, double zval, char *label, char ctype, double cangle, bool closed, struct GMT_CONTOUR *G);
-EXTERN_MSC void GMT_x_free (struct GMT_CTRL *GMT, struct GMT_XOVER *X);
-EXTERN_MSC int GMT_init_track (struct GMT_CTRL *GMT, double y[], uint64_t n, struct GMT_XSEGMENT **S);
-EXTERN_MSC uint64_t GMT_crossover (struct GMT_CTRL *GMT, double xa[], double ya[], uint64_t sa[], struct GMT_XSEGMENT A[], uint64_t na, double xb[], double yb[], uint64_t sb[], struct GMT_XSEGMENT B[], uint64_t nb, bool internal, bool geo, struct GMT_XOVER *X);
-EXTERN_MSC void * GMT_malloc_func (struct GMT_CTRL *GMT, void *ptr, size_t n, size_t *n_alloc, size_t element_size, const char *where);
-EXTERN_MSC char * GMT_make_filename (struct GMT_CTRL *GMT, char *template, unsigned int fmt[], double z, bool closed, unsigned int count[]);
-EXTERN_MSC void GMT_str_setcase (struct GMT_CTRL *GMT, char *value, int mode);
-EXTERN_MSC char * GMT_putusername (struct GMT_CTRL *GMT);
-EXTERN_MSC unsigned int * GMT_prep_nodesearch (struct GMT_CTRL *GMT, struct GMT_GRID *G, double radius, unsigned int mode, unsigned int *d_row, unsigned int *actual_max_d_col);
-EXTERN_MSC int GMT_detrend (struct GMT_CTRL *GMT, double *x, double *y, uint64_t n, double increment, double *intercept, double *slope, int mode);
-EXTERN_MSC struct GMT_PALETTE * GMT_Get_CPT (struct GMT_CTRL *GMT, char *file, enum GMT_enum_cpt mode, double zmin, double zmax);
-EXTERN_MSC unsigned int GMT_gcd_euclid (unsigned int a, unsigned int b);
-EXTERN_MSC unsigned int GMT_optimal_dim_for_surface (struct GMT_CTRL *GMT, unsigned int factors[], unsigned int nx, unsigned int ny, struct GMT_SURFACE_SUGGESTION **S);
-EXTERN_MSC int GMT_best_dim_choice (struct GMT_CTRL *GMT, unsigned int mode, unsigned int in_dim[], unsigned int out_dim[]);
-EXTERN_MSC void GMT_sprintf_float (char *string, char *format, double x);
-
-/* gmt_calclock.c: */
-
-EXTERN_MSC double GMT_rdc2dt (struct GMT_CTRL *GMT, int64_t rd, double secs);
-EXTERN_MSC void GMT_dt2rdc (struct GMT_CTRL *GMT, double t, int64_t *rd, double *s);
-EXTERN_MSC int64_t GMT_rd_from_gymd (struct GMT_CTRL *GMT, int gy, int gm, int gd);
-EXTERN_MSC void GMT_format_calendar (struct GMT_CTRL *GMT, char *date, char *clock, struct GMT_DATE_IO *D, struct GMT_CLOCK_IO *W, bool upper, unsigned int kind, double dt);
-EXTERN_MSC void GMT_gcal_from_rd (struct GMT_CTRL *GMT, int64_t rd, struct GMT_gcal *gcal);
-
-/* gmt_map.c: */
-
-EXTERN_MSC bool GMT_cart_outside (struct GMT_CTRL *GMT, double x, double y);
-EXTERN_MSC void GMT_auto_frame_interval (struct GMT_CTRL *GMT, unsigned int axis, unsigned int item);
-EXTERN_MSC double GMT_az_backaz (struct GMT_CTRL *GMT, double lonE, double latE, double lonS, double latS, bool baz);
-EXTERN_MSC double GMT_distance (struct GMT_CTRL *GMT, double lonS, double latS, double lonE, double latE);
-EXTERN_MSC double GMT_azim_to_angle (struct GMT_CTRL *GMT, double lon, double lat, double c, double azim);
-EXTERN_MSC uint64_t GMT_clip_to_map (struct GMT_CTRL *GMT, double *lon, double *lat, uint64_t np, double **x, double **y);
-EXTERN_MSC uint64_t GMT_compact_line (struct GMT_CTRL *GMT, double *x, double *y, uint64_t n, int pen_flag, int *pen);
-EXTERN_MSC uint64_t GMT_geo_to_xy_line (struct GMT_CTRL *GMT, double *lon, double *lat, uint64_t n);
-EXTERN_MSC uint64_t GMT_graticule_path (struct GMT_CTRL *GMT, double **x, double **y, int dir, bool check, double w, double e, double s, double n);
-EXTERN_MSC int GMT_grd_project (struct GMT_CTRL *GMT, struct GMT_GRID *I, struct GMT_GRID *O, bool inverse);
-EXTERN_MSC int GMT_img_project (struct GMT_CTRL *GMT, struct GMT_IMAGE *I, struct GMT_IMAGE *O, bool inverse);
-EXTERN_MSC uint64_t GMT_map_clip_path (struct GMT_CTRL *GMT, double **x, double **y, bool *donut);
-EXTERN_MSC bool GMT_map_outside (struct GMT_CTRL *GMT, double lon, double lat);
-EXTERN_MSC bool GMT_geo_to_xy (struct GMT_CTRL *GMT, double lon, double lat, double *x, double *y);
-EXTERN_MSC void GMT_geoz_to_xy (struct GMT_CTRL *GMT, double x, double y, double z, double *x_out, double *y_out);
-EXTERN_MSC int GMT_project_init (struct GMT_CTRL *GMT, struct GMT_GRID_HEADER *header, double *inc, unsigned int nx, unsigned int ny, unsigned int dpi, unsigned int offset);
-EXTERN_MSC int GMT_map_setup (struct GMT_CTRL *GMT, double wesn[]);
-EXTERN_MSC double GMT_x_to_xx (struct GMT_CTRL *GMT, double x);
-EXTERN_MSC double GMT_y_to_yy (struct GMT_CTRL *GMT, double y);
-EXTERN_MSC double GMT_z_to_zz (struct GMT_CTRL *GMT, double z);
-EXTERN_MSC void GMT_xy_to_geo (struct GMT_CTRL *GMT, double *lon, double *lat, double x, double y);
-EXTERN_MSC void GMT_xyz_to_xy (struct GMT_CTRL *GMT, double x, double y, double z, double *x_out, double *y_out);
-EXTERN_MSC void GMT_xyz_to_xy_n (struct GMT_CTRL *GMT, double *x, double *y, double z, uint64_t n);
-EXTERN_MSC double * GMT_dist_array (struct GMT_CTRL *GMT, double x[], double y[], uint64_t n, bool cumulative);
-EXTERN_MSC double * GMT_dist_array_2 (struct GMT_CTRL *GMT, double x[], double y[], uint64_t n, double scale, int dist_flag);
-EXTERN_MSC uint64_t GMT_map_truncate (struct GMT_CTRL *GMT, double *x, double *y, uint64_t n, uint64_t start, int side);
-EXTERN_MSC unsigned int GMT_init_distaz (struct GMT_CTRL *GMT, char c, unsigned int mode, unsigned int type);
-EXTERN_MSC bool GMT_near_lines (struct GMT_CTRL *GMT, double lon, double lat, struct GMT_DATATABLE *T, unsigned int return_mindist, double *dist_min, double *x_near, double *y_near);
-EXTERN_MSC bool GMT_near_a_line (struct GMT_CTRL *GMT, double lon, double lat, uint64_t seg, struct GMT_DATASEGMENT *S, unsigned int return_mindist, double *dist_min, double *x_near, double *y_near);
-EXTERN_MSC bool GMT_near_a_point (struct GMT_CTRL *GMT, double x, double y, struct GMT_DATATABLE *T, double dist);
-EXTERN_MSC double GMT_great_circle_dist_meter (struct GMT_CTRL *GMT, double x0, double y0, double x1, double y1);
-EXTERN_MSC double GMT_lat_swap_quick (struct GMT_CTRL *GMT, double lat, double c[]);
-EXTERN_MSC double GMT_lat_swap (struct GMT_CTRL *GMT, double lat, unsigned int itype);
-EXTERN_MSC double GMT_mindist_to_point (struct GMT_CTRL *GMT, double lon, double lat, struct GMT_DATATABLE *T, uint64_t *id);
-EXTERN_MSC bool GMT_UTMzone_to_wesn (struct GMT_CTRL *GMT, unsigned int zone_x, char zone_y, int hemi, double wesn[]);
-EXTERN_MSC void GMT_ECEF_forward (struct GMT_CTRL *GMT, double in[], double out[]);
-EXTERN_MSC void GMT_ECEF_inverse (struct GMT_CTRL *GMT, double in[], double out[]);
-EXTERN_MSC void GMT_ECEF_init (struct GMT_CTRL *GMT, struct GMT_DATUM *D);
-EXTERN_MSC void GMT_datum_init (struct GMT_CTRL *GMT, struct GMT_DATUM *from, struct GMT_DATUM *to, bool heights);
-EXTERN_MSC int GMT_set_datum (struct GMT_CTRL *GMT, char *text, struct GMT_DATUM *D);
-EXTERN_MSC void GMT_conv_datum (struct GMT_CTRL *GMT, double in[], double out[]);
-EXTERN_MSC uint64_t GMT_wesn_clip (struct GMT_CTRL *GMT, double *lon, double *lat, uint64_t n_orig, double **x, double **y, uint64_t *total_nx);
-EXTERN_MSC void GMT_set_spherical (struct GMT_CTRL *GMT, bool notify);
-
-/* gmt_shore.c: */
-
-EXTERN_MSC int GMT_set_levels (struct GMT_CTRL *GMT, char *info, struct GMT_SHORE_SELECT *I);
-EXTERN_MSC int GMT_get_shore_bin (struct GMT_CTRL *GMT, unsigned int b, struct GMT_SHORE *c);
-EXTERN_MSC int GMT_get_br_bin (struct GMT_CTRL *GMT, unsigned int b, struct GMT_BR *c, unsigned int *level, unsigned int n_levels);
-EXTERN_MSC void GMT_free_shore_polygons (struct GMT_CTRL *GMT, struct GMT_GSHHS_POL *p, unsigned int n);
-EXTERN_MSC void GMT_free_shore (struct GMT_CTRL *GMT, struct GMT_SHORE *c);
-EXTERN_MSC void GMT_free_br (struct GMT_CTRL *GMT, struct GMT_BR *c);
-EXTERN_MSC void GMT_shore_cleanup (struct GMT_CTRL *GMT, struct GMT_SHORE *c);
-EXTERN_MSC void GMT_br_cleanup (struct GMT_CTRL *GMT, struct GMT_BR *c);
-EXTERN_MSC int GMT_init_shore (struct GMT_CTRL *GMT, char res, struct GMT_SHORE *c, double wesn[], struct GMT_SHORE_SELECT *I);
-EXTERN_MSC int GMT_init_br (struct GMT_CTRL *GMT, char which, char res, struct GMT_BR *c, double wesn[]);
-EXTERN_MSC int GMT_assemble_shore (struct GMT_CTRL *GMT, struct GMT_SHORE *c, int dir, bool assemble, double west, double east, struct GMT_GSHHS_POL **pol);
-EXTERN_MSC int GMT_assemble_br (struct GMT_CTRL *GMT, struct GMT_BR *c, bool shift, double edge, struct GMT_GSHHS_POL **pol);
-EXTERN_MSC int GMT_prep_shore_polygons (struct GMT_CTRL *GMT, struct GMT_GSHHS_POL **p, unsigned int np, bool sample, double step, int anti_bin);
-EXTERN_MSC int GMT_set_resolution (struct GMT_CTRL *GMT, char *res, char opt);
-EXTERN_MSC char GMT_shore_adjust_res (struct GMT_CTRL *GMT, char res);
-
-/* gmt_vector.c: */
-
-EXTERN_MSC int GMT_chol_dcmp (struct GMT_CTRL *GMT, double *a, double *d, double *cond, int nr, int n);
-EXTERN_MSC void GMT_chol_recover (struct GMT_CTRL *GMT, double *a, double *d, int nr, int n, int nerr, bool donly);
-EXTERN_MSC void GMT_chol_solv (struct GMT_CTRL *GMT, double *a, double *x, double *y, int nr, int n);
-EXTERN_MSC void GMT_set_tbl_minmax (struct GMT_CTRL *GMT, struct GMT_DATATABLE *T);
-EXTERN_MSC void GMT_matrix_vect_mult (struct GMT_CTRL *GMT, unsigned int dim, double a[3][3], double b[3], double c[3]);
-EXTERN_MSC void GMT_make_rot_matrix (struct GMT_CTRL *GMT, double lonp, double latp, double w, double R[3][3]);
-EXTERN_MSC void GMT_make_rot_matrix2 (struct GMT_CTRL *GMT, double E[3], double w, double R[3][3]);
-
-/* gmt_support.c: */
-
-EXTERN_MSC void GMT_sort_array (struct GMT_CTRL *GMT, void *base, uint64_t n, unsigned int type);
-EXTERN_MSC bool GMT_polygon_is_open (struct GMT_CTRL *GMT, double x[], double y[], uint64_t n);
-EXTERN_MSC double GMT_polygon_area (struct GMT_CTRL *GMT, double x[], double y[], uint64_t n);
-EXTERN_MSC int GMT_polygon_centroid (struct GMT_CTRL *GMT, double *x, double *y, uint64_t n, double *Cx, double *Cy);
-EXTERN_MSC int GMT_get_distance (struct GMT_CTRL *GMT, char *line, double *dist, char *unit);
-EXTERN_MSC uint64_t GMT_contours (struct GMT_CTRL *GMT, struct GMT_GRID *Grid, unsigned int smooth_factor, unsigned int int_scheme, int orient, unsigned int *edge, bool *first, double **x, double **y);
-EXTERN_MSC int GMT_get_format (struct GMT_CTRL *GMT, double interval, char *unit, char *prefix, char *format);
-EXTERN_MSC int GMT_get_index (struct GMT_CTRL *GMT, struct GMT_PALETTE *P, double value);
-EXTERN_MSC int GMT_get_rgb_from_z (struct GMT_CTRL *GMT, struct GMT_PALETTE *P, double value, double *rgb);
-EXTERN_MSC int GMT_get_fill_from_z (struct GMT_CTRL *GMT, struct GMT_PALETTE *P, double value, struct GMT_FILL *fill);
-EXTERN_MSC bool GMT_getfill (struct GMT_CTRL *GMT, char *line, struct GMT_FILL *fill);
-EXTERN_MSC bool GMT_getinc (struct GMT_CTRL *GMT, char *line, double inc[]);
-EXTERN_MSC int GMT_getincn (struct GMT_CTRL *GMT, char *line, double inc[], unsigned int n);
-EXTERN_MSC int GMT_getfont (struct GMT_CTRL *GMT, char *line, struct GMT_FONT *F);
-EXTERN_MSC bool GMT_getpen (struct GMT_CTRL *GMT, char *line, struct GMT_PEN *pen);
-EXTERN_MSC void GMT_savepen (struct GMT_CTRL *GMT, struct GMT_PEN *pen);
-EXTERN_MSC bool GMT_getrgb (struct GMT_CTRL *GMT, char *line, double *rgb);
-EXTERN_MSC int GMT_getrose (struct GMT_CTRL *GMT, char option, char *text, struct GMT_MAP_ROSE *mr);
-EXTERN_MSC int GMT_getscale (struct GMT_CTRL *GMT, char option, char *text, struct GMT_MAP_SCALE *ms);
-EXTERN_MSC int GMT_getinsert (struct GMT_CTRL *GMT, char option, char *text, struct GMT_MAP_INSERT *B);
-EXTERN_MSC char * GMT_putfont (struct GMT_CTRL *GMT, struct GMT_FONT F);
-EXTERN_MSC char * GMT_putpen (struct GMT_CTRL *GMT, struct GMT_PEN pen);
-EXTERN_MSC unsigned int GMT_inonout (struct GMT_CTRL *GMT, double x, double y, const struct GMT_DATASEGMENT *S);
-EXTERN_MSC unsigned int GMT_inonout_sphpol (struct GMT_CTRL *GMT, double plon, double plat, const struct GMT_DATASEGMENT *P);
-EXTERN_MSC int GMT_intpol (struct GMT_CTRL *GMT, double *x, double *y, uint64_t n, uint64_t m, double *u, double *v, int mode);
-EXTERN_MSC int GMT_just_decode (struct GMT_CTRL *GMT, char *key, unsigned int def);
-EXTERN_MSC unsigned int GMT_minmaxinc_verify (struct GMT_CTRL *GMT, double min, double max, double inc, double slop);
-EXTERN_MSC unsigned int GMT_get_arc (struct GMT_CTRL *GMT, double x0, double y0, double r, double dir1, double dir2, double **x, double **y);
-EXTERN_MSC unsigned int GMT_non_zero_winding (struct GMT_CTRL *GMT, double xp, double yp, double *x, double *y, uint64_t n_path);
-EXTERN_MSC unsigned int GMT_getmodopt (struct GMT_CTRL *GMT, const char *string, const char *sep, unsigned int *pos, char *token);
-EXTERN_MSC unsigned int GMT_verify_expectations (struct GMT_CTRL *GMT, unsigned int wanted, unsigned int got, char *item);
-EXTERN_MSC void GMT_RI_prepare (struct GMT_CTRL *GMT, struct GMT_GRID_HEADER *h);
-EXTERN_MSC struct GMT_DATASEGMENT * GMT_prepare_contour (struct GMT_CTRL *GMT, double *x, double *y, uint64_t n, double z);
-EXTERN_MSC void GMT_get_plot_array (struct GMT_CTRL *GMT);
-EXTERN_MSC void GMT_illuminate (struct GMT_CTRL *GMT, double intensity, double *rgb);
-EXTERN_MSC void GMT_init_fill (struct GMT_CTRL *GMT, struct GMT_FILL *fill, double r, double g, double b);
-EXTERN_MSC void GMT_init_pen (struct GMT_CTRL *GMT, struct GMT_PEN *pen, double width);
-EXTERN_MSC int GMT_colorname2index (struct GMT_CTRL *GMT, char *name);
-EXTERN_MSC void GMT_list_custom_symbols (struct GMT_CTRL *GMT);
-EXTERN_MSC struct GMT_PALETTE * GMT_read_cpt (struct GMT_CTRL *GMT, void *source, unsigned int source_type, unsigned int cpt_flags);
-EXTERN_MSC void GMT_smart_justify (struct GMT_CTRL *GMT, int just, double angle, double dx, double dy, double *x_shift, double *y_shift, unsigned int mode);
-EXTERN_MSC struct GMT_DATASET * GMT_resample_data (struct GMT_CTRL *GMT, struct GMT_DATASET *Din, double along_ds, unsigned int mode, unsigned int ex_cols, enum GMT_enum_track smode);
-EXTERN_MSC struct GMT_DATASET * GMT_crosstracks (struct GMT_CTRL *GMT, struct GMT_DATASET *Din, double cross_length, double across_ds, uint64_t n_cols, bool alternate);
-EXTERN_MSC uint64_t GMT_resample_path (struct GMT_CTRL *GMT, double **x, double **y, uint64_t n_in, double step_out, enum GMT_enum_track mode);
-EXTERN_MSC bool GMT_crossing_dateline (struct GMT_CTRL *GMT, struct GMT_DATASEGMENT *S);
-EXTERN_MSC int GMT_err_func (struct GMT_CTRL *GMT, int err, bool fail, char *file, const char *where);
-EXTERN_MSC int64_t GMT_delaunay (struct GMT_CTRL *GMT, double *x_in, double *y_in, uint64_t n, int **link);
-EXTERN_MSC void GMT_delaunay_free (struct GMT_CTRL *GMT, int **link);
-EXTERN_MSC unsigned int GMT_get_prime_factors (struct GMT_CTRL *GMT, uint64_t n, unsigned int *f);
-EXTERN_MSC int64_t GMT_voronoi (struct GMT_CTRL *GMT, double *x_in, double *y_in, uint64_t n, double *we, double **x_out, double **y_out);
-
-/* gmt_regexp.c */
-
-EXTERN_MSC int gmt_regexp_match (struct GMT_CTRL *GMT, const char *subject, const char *pattern, bool caseless);
-
-/* gmt_vector.c: */
-
-EXTERN_MSC void GMT_cart_to_geo (struct GMT_CTRL *GMT, double *lat, double *lon, double *a, bool degrees);
-EXTERN_MSC void GMT_geo_to_cart (struct GMT_CTRL *GMT, double lat, double lon, double *a, bool degrees);
-EXTERN_MSC void GMT_add3v (struct GMT_CTRL *GMT, double *a, double *b, double *c);
-EXTERN_MSC void GMT_sub3v (struct GMT_CTRL *GMT, double *a, double *b, double *c);
-EXTERN_MSC double GMT_dot3v (struct GMT_CTRL *GMT, double *a, double *b);
-EXTERN_MSC double GMT_dot2v (struct GMT_CTRL *GMT, double *a, double *b);
-EXTERN_MSC double GMT_mag3v (struct GMT_CTRL *GMT, double *a);
-EXTERN_MSC void GMT_cross3v (struct GMT_CTRL *GMT, double *a, double *b, double *c);
-EXTERN_MSC void GMT_normalize3v (struct GMT_CTRL *GMT, double *a);
-EXTERN_MSC void GMT_normalize2v (struct GMT_CTRL *GMT, double *a);
-EXTERN_MSC uint64_t GMT_fix_up_path (struct GMT_CTRL *GMT, double **a_lon, double **a_lat, uint64_t n, double step, unsigned int mode);
-EXTERN_MSC int GMT_jacobi (struct GMT_CTRL *GMT, double *a, unsigned int n, unsigned int m, double *d, double *v, double *b, double *z, unsigned int *nrots);
-EXTERN_MSC int GMT_gauss (struct GMT_CTRL *GMT, double *a, double *vec, unsigned int n, unsigned int nstore, bool itriag);
-EXTERN_MSC int GMT_gaussjordan (struct GMT_CTRL *GMT, double *a, unsigned int n, unsigned int ndim, double *b, unsigned int m, unsigned int mdim);
-EXTERN_MSC int GMT_svdcmp (struct GMT_CTRL *GMT, double *a, unsigned int m, unsigned int n, double *w, double *v);
-EXTERN_MSC int GMT_solve_svd (struct GMT_CTRL *GMT, double *u, unsigned int m, unsigned int n, double *v, double *w, double *b, unsigned int k, double *x, double *cutoff, unsigned int mode);
-EXTERN_MSC void GMT_polar_to_cart (struct GMT_CTRL *GMT, double r, double theta, double *a, bool degrees);
-EXTERN_MSC void GMT_cart_to_polar (struct GMT_CTRL *GMT, double *r, double *theta, double *a, bool degrees);
-
-/* From gmt_parse.c */
-/* This macro is called via each modules Return macro so API and options are set */
-#define GMT_Free_Options(mode) {if (mode >= 0 && GMT_Destroy_Options (API, &options) != GMT_OK) exit (EXIT_FAILURE);}
-
-/* From gmt_api.c */
-EXTERN_MSC struct GMTAPI_CTRL * GMT_get_API_ptr (struct GMTAPI_CTRL *ptr);
-EXTERN_MSC void GMT_show_name_and_purpose (void *API, const char *name, const char *component, const char *purpose);
-
-#endif /* _GMT_PROTOTYPES_H */
diff --git a/src/gmt/gmt_ps.h b/src/gmt/gmt_ps.h
deleted file mode 100644
index 32fd73c..0000000
--- a/src/gmt/gmt_ps.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/*--------------------------------------------------------------------
- *	$Id: gmt_ps.h 13846 2014-12-28 21:46:54Z pwessel $
- *
- *	Copyright (c) 1991-2015 by P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis and F. Wobbe
- *	See LICENSE.TXT file for copying and redistribution conditions.
- *
- *	This program is free software; you can redistribute it and/or modify
- *	it under the terms of the GNU Lesser General Public License as published by
- *	the Free Software Foundation; version 3 or any later version.
- *
- *	This program is distributed in the hope that it will be useful,
- *	but WITHOUT ANY WARRANTY; without even the implied warranty of
- *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *	GNU Lesser General Public License for more details.
- *
- *	Contact info: gmt.soest.hawaii.edu
- *--------------------------------------------------------------------*/
-/*
- * gmt_ps.h contains definition of the structure with PostScript settings.
- *
- * Author:	Paul Wessel
- * Date:	01-OCT-2009
- * Version:	5 API
- */
-
-#ifndef _GMT_PS_H
-#define _GMT_PS_H
-
-/*--------------------------------------------------------------------
- *			GMT PS STRUCTURE DEFINITION
- *--------------------------------------------------------------------*/
-
-/* Several parameters control the running of PSL.  Some are found among
- * the GMT default settings (e.g., PS_PAGE_COLOR) and these values are
- * parsed by the default machinery and stored in the corresponding
- * GMT->setting.ps_* parameters, e.g., PS_PAGE_COLOR is parsed and stored
- * as GMT->setting.ps_page_color.  All of these are used as arguments to
- * PSL_beginsession, PSL_set_defaults, and PSL_beginplot which sets teh
- * internal PSL variables.
- * A few of these parameters can also be modified via the GMT command
- * line options: -P -U -X -Y -c.  These options simply change the values as
- * currently stored in the corresponding GMT_->setting.ps_*.  Note that
- * -U has a default position and justification and thus controlled by the
- * MAP_LOGO_* parameters GMT->setting.ps_map_logo_* while the actual label is
- * kept in the structure below as given by -U.
- * Finally, there are a few PSL variables that are not initialized via
- * PSL_beginsession, PSL_set_defaults, or PSL_plotbegin, such as the
- * transparency or line_cap settings.  These are all GMT default settings
- * that are parsed directly into the PSL internal variables.
- */
-
-struct GMT_PS {	/* PSL settings affected by GMT options -X -Y -U and clipping */
-	/* A structure pointer is passed to GMT_plotinit which calls ps_plotinit */
-	int nclip;				/* +1 if clipping will extend beyond current process, -1 if we terminate clipping */
-	int clip_level;		/* Sum total clip level, should be zero at end of command sequence */
-	int layer;		/* Layer number starting at 1 and incremented for each GMT layer added */
-	char map_logo_label[GMT_BUFSIZ];		/* Label added to GMT time stamp generated by -U */
-	char origin[2];				/* Defines the origin of the map offset ('r', 'a', 'c', or 'f') */
-};
-
-#endif  /* _GMT_PS_H */
diff --git a/src/gmt/gmt_resources.h b/src/gmt/gmt_resources.h
deleted file mode 100644
index 3126469..0000000
--- a/src/gmt/gmt_resources.h
+++ /dev/null
@@ -1,678 +0,0 @@
-/*--------------------------------------------------------------------
- *	$Id: gmt_resources.h 2242 2015-05-16 05:21:28Z caress $
- *
- *	Copyright (c) 2012-2015 by P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis and F. Wobbe
- *	See LICENSE.TXT file for copying and redistribution conditions.
- *
- *	This program is free software; you can redistribute it and/or modify
- *	it under the terms of the GNU Lesser General Public License as published by
- *	the Free Software Foundation; version 3 or any later version.
- *
- *	This program is distributed in the hope that it will be useful,
- *	but WITHOUT ANY WARRANTY; without even the implied warranty of
- *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *	GNU Lesser General Public License for more details.
- *
- *	Contact info: gmt.soest.hawaii.edu
- *--------------------------------------------------------------------*/
-/*
- * gmt_resources.h contains the definitions for the GMT 5 resources
- * GMT_GRID, GMT_DATASET, GMT_TEXTSET, GMT_PALETTE, and GMT_IMAGE,
- * the auxilliary resources GMT_VECTOR and GMT_MATRIX, as well as
- * all named constants.
- *
- * Author:	Paul Wessel
- * Date:	20-FEB-2013
- * Version:	5 API
- */
-
-#ifndef _GMT_RESOURCES_H
-#define _GMT_RESOURCES_H
-
-/*============================================================ */
-/*=============== Constants Public Declaration =============== */
-/*============================================================ */
-
-/* Here are structure definitions and constants (enums) needed by the
- * public GMT API. Note: As this is C, some structures will contain
- * members we do not disclose in the API documentation but of course
- * the variables are accessible just like the "public" ones.
- */
-
-/* These are the 5 methods for i/o; used as arguments in the API that expects a "method" */
-
-enum GMT_enum_method {
-	GMT_IS_FILE = 0,	/* Entity is a filename */
-	GMT_IS_STREAM,		/* Entity is an open stream */
-	GMT_IS_FDESC,		/* Entity is an open file descriptor */
-	GMT_IS_DUPLICATE,	/* Entity is a memory location that should be duplicated */
-	GMT_IS_REFERENCE};	/* Entity is a memory location and we just pass the ref (no copying) */
-
-/* A Grid can come from a GMT grid OR User Matrix, and Data can come from DATASET or via Vectors|Matrix, and Text from TEXTSET or Matrix */
-
-enum GMT_enum_via {
-	GMT_VIA_NONE = 0,	/* No via anything */
-	GMT_VIA_VECTOR = 100,	/* Data passed via user matrix */
-	GMT_VIA_MATRIX = 200,	/* Data passed via user vectors */
-	GMT_VIA_OUTPUT = 2048};	/* For GMT_Create_Data mode to set dir = output */
-
-/* These are the 5 families of data types, + a coordinate array + 2 help containers for vector and matrix */
-enum GMT_enum_family {
-	GMT_IS_DATASET = 0,	/* Entity is data table */
-	GMT_IS_TEXTSET,		/* Entity is a Text table */
-	GMT_IS_GRID,		/* Entity is a GMT grid */
-	GMT_IS_CPT,		/* Entity is a CPT table */
-	GMT_IS_IMAGE,		/* Entity is a 1- or 3-layer unsigned char image */
-	GMT_IS_VECTOR,		/* Entity is set of user vectors */
-	GMT_IS_MATRIX,		/* Entity is user matrix */
-	GMT_IS_COORD};		/* Entity is a double coordinate array */
-
-/* These are modes for handling comments */
-enum GMT_enum_comment {
-	GMT_COMMENT_IS_TEXT	= 0,	/* Comment is a text string */
-	GMT_COMMENT_IS_OPTION	= 1U,	/* Comment is a linked list of GMT_OPTION structures */
-	GMT_COMMENT_IS_COMMAND	= 2U,	/* Comment replaces header->command */
-	GMT_COMMENT_IS_REMARK	= 4U,	/* Comment replaces header->remark */
-	GMT_COMMENT_IS_TITLE	= 8U,	/* Comment replaces header->title */
-	GMT_COMMENT_IS_NAME_X	= 16U,	/* Comment replaces header->x_units [grids only] */
-	GMT_COMMENT_IS_NAME_Y	= 32U,	/* Comment replaces header->y_units [grids only] */
-	GMT_COMMENT_IS_NAME_Z	= 64U,	/* Comment replaces header->z_units [grids only] */
-	GMT_COMMENT_IS_COLNAMES	= 128U,	/* Comment replaces header->colnames [tables only] */
-	GMT_COMMENT_IS_RESET	= 256U};	/* Wipe existing header first [append] */
-
-enum GMT_api_err_enum {
-	GMT_NOTSET  = -1,	/* When something is not set */
-	GMT_NOERROR = 0};	/* Return code when all is well */
-
-enum GMT_module_enum {
-	GMT_MODULE_EXIST	= -3,	/* mode for GMT_Call_Module to return 0 if it exists */
-	GMT_MODULE_PURPOSE	= -2,	/* mode for GMT_Call_Module to print purpose of module, or all modules */
-	GMT_MODULE_OPT		= -1,	/* Gave linked list of option structures to GMT_Call_Module */
-	GMT_MODULE_CMD		=  0};	/* Gave an array of text strings (argv[]) to GMT_Call_Module */
-
-/* Array indices for input/output/stderr variables */
-
-enum GMT_io_enum {
-	GMT_IN = 0,	/* stdin */
-	GMT_OUT,	/* stdout */
-	GMT_ERR};	/* stderr */
-
-/* There are 3 named columns */
-enum GMT_enum_dimensions {
-	GMT_X = 0,	/* x or lon is in 0th column */
-	GMT_Y,		/* y or lat is in 1st column */
-	GMT_Z};		/* z is in 2nd column */
-
-enum GMT_enum_freg {
-	GMT_ADD_FILES_IF_NONE = 1,	/* Tell GMT_Init_IO we conditionally want to register all input files in the option list if nothing else is registered */
-	GMT_ADD_FILES_ALWAYS = 2,	/* Tell GMT_Init_IO to always register all input files in the option list */
-	GMT_ADD_STDIO_IF_NONE = 4,	/* Tell GMT_Init_IO we conditionally want to register std(in|out) if nothing else has been registered */
-	GMT_ADD_STDIO_ALWAYS = 8,	/* Tell GMT_Init_IO to always register std(in|out) */
-	GMT_ADD_EXISTING = 16,		/* Tell GMT_Init_IO to only use already registered resources */
-	GMT_ADD_DEFAULT = 6};		/* Tell GMT_Init_IO to register files, and if none are found then std(in|out), but only if nothing was registered before this call */
-
-enum GMT_enum_ioset {
-	GMT_IO_DONE = 0,		/* Tell GMT_End_IO we are done but nothing special is to be done. */
-	GMT_IO_ASCII = 512,		/* Force ASCII mode for reading (ignoring current io settings). */
-	GMT_IO_RESET = 32768,		/* Tell GMT_End_IO that accessed resources should be made read/write-able again. */
-	GMT_IO_UNREG = 16384};		/* Tell GMT_End_IO to unregister all accessed resources. */
-
-enum GMT_enum_read {
-	GMT_READ_DOUBLE = 0,		/* Read ASCII data record and return double array */
-	GMT_READ_NORMAL = 0,		/* Normal read mode [Default] */
-	GMT_READ_TEXT = 1,		/* Read ASCII data record and return text string */
-	GMT_READ_MIXED = 2,		/* Read ASCII data record and return double array but tolerate conversion errors */
-	GMT_FILE_BREAK = 4};		/* Add to mode to indicate we want to know when each file end is reached [continuous] */
-
-enum GMT_enum_write {
-	GMT_WRITE_DOUBLE = 0,		/* Write double array to output */
-	GMT_WRITE_TEXT,			/* Write ASCII current record to output */
-	GMT_WRITE_SEGMENT_HEADER,	/* Write segment header record to output */
-	GMT_WRITE_TABLE_HEADER,		/* Write current record as table header to output */
-	GMT_WRITE_TABLE_START,		/* Write common header block to output (optional title + command line) */
-	GMT_WRITE_NOLF = 16};		/* Do not write LF at end of ascii record, and not increment output rec number */
-
-enum GMT_enum_header {
-	GMT_HEADER_OFF = 0,		/* Disable header blocks out as default */
-	GMT_HEADER_ON};			/* Enable header blocks out as default */
-
-enum GMT_enum_dest {
-	GMT_WRITE_SET = 0,		/* Write all output tables and all their segments to one destination [Default] */
-	GMT_WRITE_OGR,			/* Output OGR/GMT format [Requires proper -a setting] */
-	GMT_WRITE_TABLE,		/* Write each output table and all their segments to separate destinations */
-	GMT_WRITE_SEGMENT,		/* Write all output tables' segments to separate destinations */
-	GMT_WRITE_TABLE_SEGMENT};	/* Same as 2 but if no filenames we use both tbl and seg with format */
-
-enum GMT_enum_alloc {
-	GMT_ALLOCATED_EXTERNALLY = 0,	/* Allocated outside of GMT: We cannot reallocate or free this memory */
-	GMT_ALLOCATED_BY_GMT = 1};	/* Allocated by GMT: We may reallocate as needed and free when no longer needed */
-
-enum GMT_enum_duplicate {
-	GMT_DUPLICATE_NONE = 0,		/* Duplicate data set structure but no allocate&copy of data records|grid|image */
-	GMT_DUPLICATE_ALLOC,		/* Duplicate data set structure and allocate space for data records|grid|image, but no copy */
-	GMT_DUPLICATE_DATA};		/* Duplicate data set structure, allocate space for data records|grid|image, and copy */
-
-enum GMT_enum_shape {
-	GMT_ALLOC_NORMAL = 0,		/* Normal allocation of new dataset based on shape of input dataset */
-	GMT_ALLOC_VERTICAL = 4,		/* Allocate a single table for data set to hold all input tables by vertical concatenation */
-	GMT_ALLOC_HORIZONTAL = 8};	/* Alocate a single table for data set to hold all input tables by horizontal (paste) concatenations */
-
-enum GMT_enum_out {
-	GMT_WRITE_NORMAL = 0,		/* Write header and contents of this entity (table or segment) */
-	GMT_WRITE_HEADER,		/* Only write header and not the contents of this entity (table or segment) */
-	GMT_WRITE_SKIP};		/* Entirely skip this entity on output (table or segment) */
-
-/* Various directions and modes to call the FFT */
-enum GMT_FFT_mode {
-	GMT_FFT_FWD     = 0U,		/* forward Fourier transform */
-	GMT_FFT_INV     = 1U,		/* inverse Fourier transform */
-	GMT_FFT_REAL    = 0U,		/* real-input FT (currently unsupported) */
-	GMT_FFT_COMPLEX = 1U};		/* complex-input Fourier transform */
-
-/* Various modes to select time in GMT_Message */
-enum GMT_time_mode {
-	GMT_TIME_NONE    = 0U,		/* Do not report time */
-	GMT_TIME_CLOCK   = 1U,		/* Report absolute time formatted via FORMAT_TIME_STAMP */
-	GMT_TIME_ELAPSED = 2U,		/* Report elapsed time since last time mark reset */
-	GMT_TIME_RESET   = 4U};		/* Reset time mark */
-
-/* Verbosity levels */
-enum GMT_enum_verbose {GMT_MSG_QUIET = 0,  /* No messages whatsoever */
-	GMT_MSG_NORMAL,                        /* Default output, e.g., warnings and errors only */
-	GMT_MSG_TICTOC,                        /* To print a tic-toc elapsed time message */
-	GMT_MSG_COMPAT,                        /* Compatibility warnings */
-	GMT_MSG_VERBOSE,                       /* Verbose level */
-	GMT_MSG_LONG_VERBOSE,                  /* Longer verbose */
-	GMT_MSG_DEBUG};                        /* Debug messages for developers mostly */
-
-/*============================================================ */
-/*===============+ GMT_GRID Public Declaration =============== */
-/*============================================================ */
-
-enum GMT_enum_reg {	/* Public constants for grid registration */
-	GMT_GRID_NODE_REG	= 0U,
-	GMT_GRID_PIXEL_REG	= 1U,
-	GMT_GRID_DEFAULT_REG	= 1024U};	/* Means select whatever is implied via -r */
-
-enum GMT_enum_gridindex {
-        GMT_XLO = 0U,	/* Index for west or xmin value */
-        GMT_XHI,	/* Index for east or xmax value */
-        GMT_YLO,	/* Index for south or ymin value */
-        GMT_YHI,	/* Index for north or ymax value */
-        GMT_ZLO,	/* Index for zmin value */
-        GMT_ZHI		/* Index for zmax value */
-};
-
-enum GMT_enum_dimindex {
-        GMT_TBL = 0U,	/* Index for number of tables in dimension array */
-        GMT_SEG,	/* Index for number of segments in dimension array */
-        GMT_ROW,	/* Index for number of rows in dimension array */
-        GMT_COL		/* Index for number of columns in dimension array [DATASET only] */
-};
-
-enum GMT_enum_gridio {
-	GMT_GRID_IS_REAL		= 0U,	/* Read|write a normal real-valued grid */
-	GMT_GRID_ALL			= 0U,	/* Read|write both grid header and the entire grid (no subset) */
-	GMT_GRID_HEADER_ONLY		= 1U,	/* Just read|write the grid header */
-	GMT_GRID_DATA_ONLY		= 2U,	/* Read|write the grid array given w/e/s/n set in the header */
-	GMT_GRID_IS_COMPLEX_REAL	= 4U,	/* Read|write the real component to/from a complex grid */
-	GMT_GRID_IS_COMPLEX_IMAG	= 8U,	/* Read|write the imaginary component to/from a complex grid */
-	GMT_GRID_IS_COMPLEX_MASK	= 12U,	/* To mask out the real|imag flags */
-	GMT_GRID_NO_HEADER		= 16U,	/* Write a native grid without the leading grid header */
-	GMT_GRID_ROW_BY_ROW		= 32U,	/* Read|write the grid array one row at the time sequentially */
-	GMT_GRID_ROW_BY_ROW_MANUAL	= 64U};	/* Read|write the grid array one row at the time in any order */
-
-/* These lengths (except GMT_GRID_VARNAME_LEN80) must NOT be changed as they are part of grd definition */
-enum GMT_enum_grdlen {
-	GMT_GRID_UNIT_LEN80     = 80U,
-	GMT_GRID_TITLE_LEN80    = 80U,
-	GMT_GRID_VARNAME_LEN80  = 80U,
-	GMT_GRID_COMMAND_LEN320 = 320U,
-	GMT_GRID_REMARK_LEN160  = 160U,
-	GMT_GRID_NAME_LEN256	= 256U,
-	GMT_GRID_HEADER_SIZE    = 892U};
-
-/* Note: GMT_GRID_HEADER_SIZE is 4 less than sizeof (struct GMT_GRID_HEADER) on
- * some 64 bit systems due to alignment.  Since the GMT_GRID_HEADER was designed
- * during the 32-bit era its sizeof is 892.  For backwards compatibility we
- * continue to enforce this header size by writing the structure components
- * separately. */
-
-struct GMT_GRID_HEADER {
-	/* Variables we document for the API:
-	 * == Do not change the type of the following three items.
-	 * == They are copied verbatim to the native grid header and must be 4-byte unsigned ints. */
-	uint32_t nx;                     /* Number of columns */
-	uint32_t ny;                     /* Number of rows */
-	uint32_t registration;           /* GMT_GRID_NODE_REG (0) for node grids, GMT_GRID_PIXEL_REG (1) for pixel grids */
-
-	/* -- Here is the possible location for data structure padding:
-	 *    A double is 8-byte aligned on Windows. */
-
-	/* == The types of the following 12 elements must not be changed.
-	 * == They are also copied verbatim to the native grid header. */
-	double wesn[4];                   /* Min/max x and y coordinates */
-	double z_min;                     /* Minimum z value */
-	double z_max;                     /* Maximum z value */
-	double inc[2];                    /* x and y increment */
-	double z_scale_factor;            /* grd values must be multiplied by this */
-	double z_add_offset;              /* After scaling, add this */
-	char x_units[GMT_GRID_UNIT_LEN80];     /* units in x-direction */
-	char y_units[GMT_GRID_UNIT_LEN80];     /* units in y-direction */
-	char z_units[GMT_GRID_UNIT_LEN80];     /* grid value units */
-	char title[GMT_GRID_TITLE_LEN80];      /* name of data set */
-	char command[GMT_GRID_COMMAND_LEN320]; /* name of generating command */
-	char remark[GMT_GRID_REMARK_LEN160];   /* comments re this data set */
-	/* == End of "untouchable" header. */
-
-	/* ---- Variables "hidden" from the API ----
-	 * This section is flexible.  It is not copied to any grid header
-	 * or stored in any file.  It is considered private */
-	unsigned int type;               /* Grid format */
-	unsigned int bits;               /* Bits per data value (e.g., 32 for ints/floats; 8 for bytes) */
-	unsigned int complex_mode;       /* 0 = normal, GMT_GRID_IS_COMPLEX_REAL = real part of complex grid, GMT_GRID_IS_COMPLEX_IMAG = imag part of complex grid */
-	unsigned int mx, my;             /* Actual dimensions of the grid in memory, allowing for the padding */
-	size_t nm;                       /* Number of data items in this grid (nx * ny) [padding is excluded] */
-	size_t size;                     /* Actual number of items (not bytes) required to hold this grid (= mx * my) */
-	size_t n_alloc;                  /* Bytes allcoated for this grid */
-	unsigned int trendmode;          /* Holds status for detrending of grids.  0 if not detrended, 1 if mean, 2 if mid-value, and 3 if LS plane removed */
-	unsigned int arrangement;        /* Holds status for complex grid as how the read/imag is placed in the grid (interleaved, R only, etc.) */
-	unsigned int n_bands;            /* Number of bands [1]. Used with IMAGE containers and macros to get ij index from row,col, band */
-	unsigned int pad[4];             /* Padding on west, east, south, north sides [2,2,2,2] */
-	unsigned int BC[4];              /* Boundary condition applied on each side via pad [0 = not set, 1 = natural, 2 = periodic, 3 = data] */
-	unsigned int grdtype;            /* 0 for Cartesian, > 0 for geographic and depends on 360 periodicity [see GMT_enum_grdtype above] */
-	char name[GMT_GRID_NAME_LEN256]; /* Actual name of the file after any ?<varname> and =<stuff> has been removed */
-	char varname[GMT_GRID_VARNAME_LEN80];/* NetCDF: variable name */
-	const char  *ProjRefPROJ4;       /* To store a referencing system string in PROJ.4 format */
-	const char  *ProjRefWKT;         /* To store a referencing system string in WKT format */
-	int row_order;                   /* NetCDF: k_nc_start_south if S->N, k_nc_start_north if N->S */
-	int z_id;                        /* NetCDF: id of z field */
-	int ncid;                        /* NetCDF: file ID */
-	int xy_dim[2];                   /* NetCDF: dimension order of x and y; normally {1, 0} */
-	size_t t_index[3];               /* NetCDF: index of higher coordinates */
-	size_t data_offset;              /* NetCDF: distance from the beginning of the in-memory grid */
-	unsigned int stride;             /* NetCDF: distance between two rows in the in-memory grid */
-	float nan_value;                 /* Missing value as stored in grid file */
-	double xy_off;                   /* 0.0 (registration == GMT_GRID_NODE_REG) or 0.5 ( == GMT_GRID_PIXEL_REG) */
-	double r_inc[2];                 /* Reciprocal incs, i.e. 1/inc */
-	char flags[4];                   /* Flags used for ESRI grids */
-	char *pocket;                    /* GDAL: A working variable handy to transmit info between funcs e.g. +b<band_info> to gdalread */
-	double bcr_threshold;            /* sum of cardinals must >= threshold in bilinear; else NaN */
-	unsigned int bcr_interpolant;    /* Interpolation function used (0, 1, 2, 3) */
-	unsigned int bcr_n;              /* Width of the interpolation function */
-	unsigned int nxp;                /* if X periodic, nxp > 0 is the period in pixels  */
-	unsigned int nyp;                /* if Y periodic, nxp > 0 is the period in pixels  */
-	unsigned int no_BC;              /* If true we skip BC stuff entirely */
-	unsigned int gn;                 /* true if top    edge will be set as N pole  */
-	unsigned int gs;                 /* true if bottom edge will be set as S pole  */
-	unsigned int is_netcdf4;         /* true if netCDF-4/HDF5 format */
-	size_t z_chunksize[2];           /* chunk size (lat,lon) */
-	unsigned int z_shuffle;          /* if shuffle filter is turned on */
-	unsigned int z_deflate_level;    /* if deflate filter is in use */
-	unsigned int z_scale_autoadust;  /* if z_scale_factor should be auto-detected */
-	unsigned int z_offset_autoadust; /* if z_add_offset should be auto-detected */
-					 /* xy_*[] is separate settings for GMT_IN and GMT_OUT */
-	unsigned int xy_adjust[2];	 /* 1 if +u<unit> was parsed and scale set, 3 if xy has been adjusted, 0 otherwise */
-	unsigned int xy_mode[2];	 /* 1 if +U<unit> was parsed, 0 otherwise */
-	unsigned int xy_unit[2];	 /* Unit enum specified via +u<unit> */
-	double xy_unit_to_meter[2];	 /* Scale, given xy_unit, to convert xy from <unit> to meters */
-};
-
-/* grd is stored in rows going from west (xmin) to east (xmax)
- * first row in file has yvalue = north (ymax).  
- * This is SCANLINE orientation.*/
-
-/*-----------------------------------------------------------------------------------------
- *	Notes on registration:
-
-	Assume x_min = y_min = 0 and x_max = y_max = 10 and x_inc = y_inc = 1.
-	For a normal node grid we have:
-		(1) nx = (x_max - x_min) / x_inc + 1 = 11
-		    ny = (y_max - y_min) / y_inc + 1 = 11
-		(2) node # 0 is at (x,y) = (x_min, y_max) = (0,10) and represents the surface
-		    value in a box with dimensions (1,1) centered on the node.
-	For a pixel grid we have:
-		(1) nx = (x_max - x_min) / x_inc = 10
-		    ny = (y_max - y_min) / y_inc = 10
-		(2) node # 0 is at (x,y) = (x_min + 0.5*x_inc, y_max - 0.5*y_inc) = (0.5, 9.5)
-		    and represents the surface value in a box with dimensions (1,1)
-		    centered on the node.
--------------------------------------------------------------------------------------------*/
-
-struct GMT_GRID {	/* To hold a GMT float grid and its header in one container */
-	struct GMT_GRID_HEADER *header;	/* Pointer to full GMT header for the grid */
-	float *data;			/* Pointer to the float grid */
-/* ---- Variables "hidden" from the API ---- */
-	unsigned int id;		/* The internal number of the grid */
-	unsigned int alloc_level;	/* The level it was allocated at */
-	enum GMT_enum_alloc alloc_mode;	/* Allocation mode [GMT_ALLOCATED_BY_GMT] */
-	void *extra;			/* Row-by-row machinery information [NULL] */
-};
-
-/*============================================================ */
-/*============== GMT_DATASET Public Declaration ============== */
-/*============================================================ */
-
-/* GIS geometries, with GMT_IS_NONE as 16 for no such thing */
-enum GMT_enum_geometry {
-	GMT_IS_POINT	= 1U,
-	GMT_IS_LINE	= 2U,
-	GMT_IS_POLY	= 4U,
-	GMT_IS_PLP	= 7U,	/* Could be any one of POINT, LINE, POLY */
-	GMT_IS_SURFACE	= 8U,
-	GMT_IS_NONE	= 16U};	/* Non-geographical items like CPT and text */
-
-/* These are two polygon modes */
-enum GMT_enum_pol {
-	GMT_IS_PERIMETER = 0,
-	GMT_IS_HOLE = 1U};
-
-/* Return codes for GMT_ascii_input: */
-
-enum GMT_enum_ascii_input_return {	/* Bit flag related to record i/o */
-	GMT_IO_DATA_RECORD 	=  0,		/* Read a data record and had no issues */
-	GMT_IO_TABLE_HEADER 	=  1U,		/* Read a table header */
-	GMT_IO_SEGMENT_HEADER	=  2U,		/* Read a segment header */
-	GMT_IO_ANY_HEADER	=  3U,		/* Read either table or segment header */
-	GMT_IO_MISMATCH		=  4U,		/* Read incorrect number of columns */
-	GMT_IO_EOF		=  8U,		/* Read end-of-file */
-	GMT_IO_NAN		= 16U,		/* Read a NaN record */
-	GMT_IO_NEW_SEGMENT	= 18U,		/* Read either segment header or NaN-record */
-	GMT_IO_GAP		= 32U,		/* Determined a gap should occur before this record */
-	GMT_IO_LINE_BREAK	= 58U,		/* Segment break caused by seg header, gap, nan, or EOF */
-	GMT_IO_NEXT_FILE	= 64U};		/* Like EOF except for an individual file (with more files to follow) */
-
-/* Here are the GMT data types used for tables */
-
-struct GMT_OGR {	/* Struct with all things GMT/OGR for a table */
-	/* The first parameters are usually set once per data set and do not change */
-	unsigned int geometry;		/* @G: The geometry of this data set, if known [0 otherwise] */
-	unsigned int n_aspatial;	/* @T: The number of aspatial fields */
-	char *region;			/* @R: The region textstring [NULL if not set] */
-	char *proj[4];			/* @J: The 1-4 projection strings [NULL if not set] */
-	unsigned int *type;		/* @T: The data types of the aspatial fields [NULL if not set]  */
-	char **name;			/* @N The names of the aspatial fields [NULL if not set]  */
-	/* The following are for OGR data only. It is filled during parsing (current segment) but is then copied to the segment header so it can be accessed later */
-	enum GMT_enum_pol pol_mode;	/* @P: Either GMT_IS_PERIMETER or GMT_IS_HOLE (for polygons only) */
-	char **tvalue;			/* @D: The text values of the current aspatial fields */
-	double *dvalue;			/* @D: Same but converted to double (assumed possible) */
-};
-
-struct GMT_OGR_SEG {	/* Struct with GMT/OGR aspatial data for a segment */
-	enum GMT_enum_pol pol_mode;	/* @P: Either GMT_IS_PERIMETER or GMT_IS_HOLE (for polygons only) */
-	unsigned int n_aspatial;	/* @T: The number of aspatial fields */
-	char **tvalue;			/* @D: The values of the current aspatial fields (uses GMT_OGR's n_aspatial as length) */
-	double *dvalue;			/* @D: Same but converted to double (assumed possible) */
-};
-
-struct GMT_DATASEGMENT {		/* For holding segment lines in memory */
-	/* Variables we document for the API: */
-	uint64_t n_rows;		/* Number of points in this segment */
-	uint64_t n_columns;		/* Number of fields in each record (>= 2) */
-	double *min;			/* Minimum coordinate for each column */
-	double *max;			/* Maximum coordinate for each column */
-	double **coord;			/* Coordinates x,y, and possibly other columns */
-	char *label;			/* Label string (if applicable) */
-	char *header;			/* Segment header (if applicable) */
-/* ---- Variables "hidden" from the API ---- */
-	enum GMT_enum_out mode;		/* 0 = output segment, 1 = output header only, 2 = skip segment */
-	enum GMT_enum_pol pol_mode;	/* Either GMT_IS_PERIMETER  [-Pp] or GMT_IS_HOLE [-Ph] (for polygons only) */
-	uint64_t id;			/* The internal number of the segment */
-	size_t n_alloc;			/* The current allocation length of each coord */
-	unsigned int range;		/* Longitude reporting scheme, e.g. GMT_IS_GIVEN_RANGE [0] */
-	int pole;			/* Spherical polygons only: If it encloses the S (-1) or N (+1) pole, or none (0) */
-	double dist;			/* Distance from a point to this feature */
-	double lat_limit;		/* For polar caps: the latitude of the point closest to the pole */
-	struct GMT_OGR_SEG *ogr;	/* NULL unless OGR/GMT metadata exist for this segment */
-	struct GMT_DATASEGMENT *next;	/* NULL unless polygon and has holes and pointing to next hole */
-	char *file[2];			/* Name of file or source [0 = in, 1 = out] */
-};
-
-struct GMT_DATATABLE {	/* To hold an array of line segment structures and header information in one container */
-	/* Variables we document for the API: */
-	unsigned int n_headers;	/* Number of file header records (0 if no header) */
-	uint64_t n_columns;	/* Number of columns (fields) in each record */
-	uint64_t n_segments;	/* Number of segments in the array */
-	uint64_t n_records;	/* Total number of data records across all segments */
-	double *min;			/* Minimum coordinate for each column */
-	double *max;			/* Maximum coordinate for each column */
-	char **header;			/* Array with all file header records, if any) */
-	struct GMT_DATASEGMENT **segment;	/* Pointer to array of segments */
-/* ---- Variables "hidden" from the API ---- */
-	uint64_t id;			/* The internal number of the table */
-	size_t n_alloc;			/* The current allocation length of segments */
-	enum GMT_enum_out mode;		/* 0 = output table, 1 = output header only, 2 = skip table */
-	struct GMT_OGR *ogr;		/* Pointer to struct with all things GMT/OGR (if MULTI-geometry and not MULTIPOINT) */
-	char *file[2];			/* Name of file or source [0 = in, 1 = out] */
-};
-
-/* The main GMT Data Containers used in the API: */
-
-struct GMT_DATASET {	/* Single container for an array of GMT tables (files) */
-	/* Variables we document for the API: */
-	uint64_t n_tables;		/* The total number of tables (files) contained */
-	uint64_t n_columns;		/* The number of data columns */
-	uint64_t n_segments;		/* The total number of segments across all tables */
-	uint64_t n_records;		/* The total number of data records across all tables */
-	double *min;			/* Minimum coordinate for each column */
-	double *max;			/* Maximum coordinate for each column */
-	struct GMT_DATATABLE **table;	/* Pointer to array of tables */
-/* ---- Variables "hidden" from the API ---- */
-	uint64_t id;			/* The internal number of the data set */
-	size_t n_alloc;			/* The current allocation length of tables */
-	uint64_t dim[4];		/* Only used by GMT_Duplicate_Data to override dimensions */
-	unsigned int geometry;		/* The geometry of this dataset */
-	unsigned int alloc_level;	/* The level it was allocated at */
-	enum GMT_enum_dest io_mode;	/* -1 means write OGR format (requires proper -a),
-					 * 0 means write everything to one destination [Default],
-					 * 1 means use table->file[GMT_OUT] to write separate table,
-					 * 2 means use segment->file[GMT_OUT] to write separate segments.
-					 * 3 is same as 2 but with no filenames we create filenames from tbl and seg numbers */
-	enum GMT_enum_alloc alloc_mode;	/* Allocation mode [GMT_ALLOCATED_BY_GMT] */
-	char *file[2];			/* Name of file or source [0 = in, 1 = out] */
-};
-
-/*============================================================ */
-/*============== GMT_TEXTSET Public Declaration ============== */
-/*============================================================ */
-
-struct GMT_TEXTSEGMENT {		/* For holding segment text records in memory */
-	/* Variables we document for the API: */
-	uint64_t n_rows;		/* Number of rows in this segment */
-	char **record;			/* Array of text records */
-	char *label;			/* Label string (if applicable) */
-	char *header;			/* Segment header (if applicable) */
-/* ---- Variables "hidden" from the API ---- */
-	uint64_t id;			/* The internal number of the table */
-	enum GMT_enum_out mode;		/* 0 = output segment, 1 = output header only, 2 = skip segment */
-	size_t n_alloc;			/* Number of rows allocated for this segment */
-	char *file[2];			/* Name of file or source [0 = in, 1 = out] */
-	char **tvalue;			/* The values of the OGR/GMT aspatial fields */	
-};
-
-struct GMT_TEXTTABLE {	/* To hold an array of text segment structures and header information in one container */
-	/* Variables we document for the API: */
-	unsigned int n_headers;		/* Number of file header records (0 if no header) */
-	uint64_t n_segments;		/* Number of segments in the array */
-	uint64_t n_records;		/* Total number of data records across all segments */
-	char **header;			/* Array with all file header records, if any) */
-	struct GMT_TEXTSEGMENT **segment;	/* Pointer to array of segments */
-/* ---- Variables "hidden" from the API ---- */
-	uint64_t id;			/* The internal number of the table */
-	size_t n_alloc;			/* The current allocation length of segments */
-	enum GMT_enum_out mode;		/* 0 = output table, 1 = output header only, 2 = skip table */
-	char *file[2];			/* Name of file or source [0 = in, 1 = out] */
-};
-
-struct GMT_TEXTSET {	/* Single container for an array of GMT text tables (files) */
-	/* Variables we document for the API: */
-	uint64_t n_tables;		/* The total number of tables (files) contained */
-	uint64_t n_segments;		/* The total number of segments across all tables */
-	uint64_t n_records;		/* The total number of data records across all tables */
-	struct GMT_TEXTTABLE **table;	/* Pointer to array of tables */
-/* ---- Variables "hidden" from the API ---- */
-	uint64_t id;			/* The internal number of the data set */
-	size_t n_alloc;			/* The current allocation length of tables */
-	unsigned int geometry;		/* The geometry of this dataset */
-	unsigned int alloc_level;	/* The level it was allocated at */
-	enum GMT_enum_dest io_mode;	/* -1 means write OGR format (requires proper -a),
-					 * 0 means write everything to one destination [Default],
-					 * 1 means use table->file[GMT_OUT] to write separate table,
-					 * 2 means use segment->file[GMT_OUT] to write separate segments.
-					 * 3 is same as 2 but with no filenames we create filenames from tbl and seg numbers */
-	enum GMT_enum_alloc alloc_mode;	/* Allocation mode [GMT_ALLOCATED_BY_GMT] */
-	char *file[2];			/* Name of file or source [0 = in, 1 = out] */
-};
-
-/*============================================================ */
-/*============== GMT_PALETTE Public Declaration ============== */
-/*============================================================ */
-
-enum GMT_enum_color {GMT_RGB	= 0,
-	GMT_CMYK		= 1,
-	GMT_HSV			= 2,
-	GMT_COLORINT		= 4,
-	GMT_NO_COLORNAMES	= 8};
-
-enum GMT_enum_bfn {GMT_BGD, GMT_FGD, GMT_NAN};
-
-enum GMT_enum_cpt {GMT_CPT_REQUIRED, GMT_CPT_OPTIONAL};
-
-enum GMT_enum_cptflags {GMT_CPT_NO_BNF = 1, GMT_CPT_EXTEND_BNF = 2};
-
-/* Here is the definition of the GMT_PALETTE structure that is used in programs
- * that deals with coloring of items as a function of z-lookup.  Note that rgb
- * arrays have 4 items as the 4th value could be a non-zero transparency (when supported).
- */
- 
-struct GMT_LUT {
-	double z_low, z_high, i_dz;
-	double rgb_low[4], rgb_high[4], rgb_diff[4];
-	double hsv_low[4], hsv_high[4], hsv_diff[4];
-	unsigned int annot;	/* 1 for Lower, 2 for Upper, 3 for Both */
-	unsigned int skip;	/* true means skip this slice */
-	struct GMT_FILL *fill;	/* For patterns instead of color */
-	char *label;		/* For non-number labels */
-};
-
-struct GMT_BFN_COLOR {		/* For back-, fore-, and nan-colors */
-	double rgb[4];		/* Red, green, blue, and alpha */
-	double hsv[4];		/* Hue, saturation, value, alpha */
-	unsigned int skip;	/* true means skip this slice */
-	struct GMT_FILL *fill;	/* For patterns instead of color */
-};
-
-struct GMT_PALETTE {		/* Holds all pen, color, and fill-related parameters */
-	/* Variables we document for the API: */
-	unsigned int n_headers;		/* Number of CPT file header records (0 if no header) */
-	unsigned int n_colors;		/* Number of colors in CPT lookup table */
-	unsigned int cpt_flags;		/* Flags controling use of BFN colors */
-	struct GMT_LUT *range;		/* CPT lookup table read by GMT_read_cpt */
-	struct GMT_BFN_COLOR patch[3];	/* Structures with back/fore/nan colors */
-	char **header;			/* Array with all CPT file header records, if any) */		/* Content not counted by sizeof (struct) */
-/* ---- Variables "hidden" from the API ---- */
-	uint64_t id;			/* The internal number of the data set */
-	enum GMT_enum_alloc alloc_mode;	/* Allocation mode [GMT_ALLOCATED_BY_GMT] */
-	unsigned int alloc_level;	/* The level it was allocated at */
-	unsigned int model;		/* RGB, HSV, CMYK */
-	unsigned int is_gray;		/* true if only grayshades are needed */
-	unsigned int is_bw;		/* true if only black and white are needed */
-	unsigned int is_continuous;	/* true if continuous color tables have been given */
-	unsigned int has_pattern;	/* true if cpt file contains any patterns */
-	unsigned int skip;		/* true if current z-slice is to be skipped */
-	unsigned int categorical;	/* true if CPT applies to categorical data */
-	unsigned int z_adjust[2];	/* 1 if +u<unit> was parsed and scale set, 3 if z has been adjusted, 0 otherwise */
-	unsigned int z_mode[2];	 	/* 1 if +U<unit> was parsed, 0 otherwise */
-	unsigned int z_unit[2];	 	/* Unit enum specified via +u<unit> */
-	double z_unit_to_meter[2];	/* Scale, given z_unit, to convert z from <unit> to meters */
-};
-
-/*============================================================ */
-/*=============== GMT_IMAGE Public Declaration =============== */
-/*============================================================ */
-
-/* The GMT_IMAGE container is used to pass user images in from the GDAL bridge */
-
-struct GMT_IMAGE {	/* Single container for a user image of data */
-	/* Variables we document for the API: */
-	enum GMT_enum_type type;	/* Data type, e.g. GMT_FLOAT */
-	int *ColorMap;			/* Array with color lookup values */
-	struct GMT_GRID_HEADER *header;	/* Pointer to full GMT header for the image */
-	unsigned char *data;		/* Pointer to actual image */
-/* ---- Variables "hidden" from the API ---- */
-	uint64_t id;			/* The internal number of the data set */
-	unsigned int alloc_level;	/* The level it was allocated at */
-	enum GMT_enum_alloc alloc_mode;	/* Allocation mode [GMT_ALLOCATED_BY_GMT] */
-	const char *ColorInterp;
-};
-
-/*============================================================ */
-/*============= GMT_UNIVECTOR Public Declaration ============= */
-/*============================================================ */
-
-/* This union is used to hold any type of array */
-union GMT_UNIVECTOR {
-	/* Universal vector or any data type can be held here */
-	uint8_t  *uc1; /* Unsigned 1-byte int */
-	int8_t   *sc1; /* Signed 1-byte int */
-	uint16_t *ui2; /* Unsigned 2-byte int */
-	int16_t  *si2; /* Signed 2-byte int */
-	uint32_t *ui4; /* Unsigned 4-byte int */
-	int32_t  *si4; /* Signed 4-byte int */
-	uint64_t *ui8; /* Unsigned 8-byte int */
-	int64_t  *si8; /* Signed 8-byte int */
-	float    *f4;  /* 4-byte float */
-	double   *f8;  /* 8-byte float */
-};
-
-/*============================================================ */
-/*=============== GMT_VECTOR Public Declaration ============== */
-/*============================================================ */
-
-struct GMT_VECTOR {	/* Single container for user vector(s) of data */
-	/* Variables we document for the API: */
-	uint64_t n_columns;		/* Number of vectors */
-	uint64_t n_rows;		/* Number of rows in each vector */
-	enum GMT_enum_reg registration;	/* 0 for gridline and 1 for pixel registration  */
-	enum GMT_enum_type *type;	/* Array of data types (type of each uni-vector, e.g. GMT_FLOAT */
-	union GMT_UNIVECTOR *data;	/* Array of uni-vectors */
-	double range[2];		/* Contains tmin/tmax (or 0/0 if not equidistant) */
-	char command[GMT_GRID_COMMAND_LEN320]; /* name of generating command */
-	char remark[GMT_GRID_REMARK_LEN160];   /* comments re this data set */
-/* ---- Variables "hidden" from the API ---- */
-	uint64_t id;			/* The internal number of the data set */
-	unsigned int alloc_level;	/* The level it was allocated at */
-	enum GMT_enum_alloc alloc_mode;	/* Allocation mode [GMT_ALLOCATED_BY_GMT] */
-};
-
-/*============================================================ */
-/*=============== GMT_MATRIX Public Declaration ============== */
-/*============================================================ */
-
-enum GMT_enum_fmt {
-	GMT_IS_ROW_FORMAT	= 0,	/* 2-D grid is C-style with rows: as index increase we move across rows */
-	GMT_IS_COL_FORMAT	= 1};	/* 2-D grid is Fortran-style with columns: as index increase we move down columns  */
-
-/* These containers are used to pass user vectors and matrices in/out of GMT */
-
-struct GMT_MATRIX {	/* Single container for a user matrix of data */
-	/* Variables we document for the API: */
-	uint64_t n_rows;		/* Number of rows in this matrix */
-	uint64_t n_columns;		/* Number of columns in this matrix */
-	uint64_t n_layers;		/* Number of layers in a 3-D matrix [1] */
-	enum GMT_enum_fmt shape;	/* 0 = C (rows) and 1 = Fortran (cols) */
-	enum GMT_enum_reg registration;	/* 0 for gridline and 1 for pixel registration  */
-	size_t dim;			/* Allocated length of longest C or Fortran dim */
-	size_t size;			/* Byte length of data */
-	enum GMT_enum_type type;	/* Data type, e.g. GMT_FLOAT */
-	double range[6];		/* Contains xmin/xmax/ymin/ymax[/zmin/zmax] */
-	union GMT_UNIVECTOR data;	/* Union with pointer to actual matrix of the chosen type */
-	char command[GMT_GRID_COMMAND_LEN320]; /* name of generating command */
-	char remark[GMT_GRID_REMARK_LEN160];   /* comments re this data set */
-/* ---- Variables "hidden" from the API ---- */
-	uint64_t id;			/* The internal number of the data set */
-	unsigned int alloc_level;	/* The level it was allocated at */
-	enum GMT_enum_alloc alloc_mode;	/* Allocation mode [GMT_ALLOCATED_BY_GMT] */
-};
-
-#endif /* _GMT_RESOURCES_H */
diff --git a/src/gmt/gmt_sharedlibs.h b/src/gmt/gmt_sharedlibs.h
deleted file mode 100644
index 5de82cf..0000000
--- a/src/gmt/gmt_sharedlibs.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/* $Id: gmt_sharedlibs.h 2242 2015-05-16 05:21:28Z caress $
- *
- *	Copyright (c) 2012-2015 by P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis and F. Wobbe
- * by P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis, and F. Wobbe
- * See LICENSE.TXT file for copying and redistribution conditions.
- */
-
-/* gmt_module.h declares structures needed by the various modules libraries. */
-
-#pragma once
-#ifndef _GMT_MODULE_H
-#define _GMT_MODULE_H
-
-#ifdef __cplusplus /* Basic C++ support */
-extern "C" {
-#endif
-
-#ifdef _WIN32
-#include <windows.h>
-#else
-#include <dlfcn.h>
-#endif
-
-/* Info for each GMT shared library. This array is filled out when parsing GMT_CUSTOM_LIBS at end of GMT_Create_Session */
-
-struct Gmt_libinfo {
-	char *name;	/* Library tag name [without leading "lib" and extension], e.g. "gmt", "gmtsuppl" */
-	char *path;	/* Full path to library as given in GMT_CUSTOM_LIBS */
-	bool skip;	/* true if we tried to open it and it was not available the first time */
-	void *handle;	/* Handle to the shared library, returned by dlopen or dlopen_special */
-};
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* !_GMT_MODULE_H */
diff --git a/src/gmt/gmt_shore.h b/src/gmt/gmt_shore.h
deleted file mode 100644
index 442a773..0000000
--- a/src/gmt/gmt_shore.h
+++ /dev/null
@@ -1,240 +0,0 @@
-/*--------------------------------------------------------------------
- *	$Id: gmt_shore.h 13846 2014-12-28 21:46:54Z pwessel $
- *
- *	Copyright (c) 1991-2015 by P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis and F. Wobbe
- *	See LICENSE.TXT file for copying and redistribution conditions.
- *
- *	This program is free software; you can redistribute it and/or modify
- *	it under the terms of the GNU Lesser General Public License as published by
- *	the Free Software Foundation; version 3 or any later version.
- *
- *	This program is distributed in the hope that it will be useful,
- *	but WITHOUT ANY WARRANTY; without even the implied warranty of
- *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *	GNU Lesser General Public License for more details.
- *
- *	Contact info: gmt.soest.hawaii.edu
- *--------------------------------------------------------------------*/
-/*
- * Include file for gmt_shore.c
- *
- * Author:	Paul Wessel
- * Date:	1-JAN-2010
- * Version:	5 API
- */
-
-#ifndef _GMT_SHORE_H
-#define _GMT_SHORE_H
-
-/* Declaration modifier for netcdf DLL support
- * annoying: why can't netcdf.h do this on its own? */
-#if defined WIN32 && ! defined NETCDF_STATIC
-#define DLL_NETCDF
-#endif
-
-#include "netcdf.h"
-
-enum GMT_enum_gshhs {GSHHS_MAX_DELTA = 65535,	/* Largest value to store in a unsigned short, used as largest dx or dy in bin  */
-	GSHHS_MAX_LEVEL			= 4,	/* Highest hierarchical level of coastlines */
-	GSHHS_N_BLEVELS			= 3,	/* Number of levels for borders */
-	GSHHS_N_RLEVELS			= 11,	/* Number of levels for rivers */
-	GSHHS_RIVER_INTERMITTENT	= 5,	/* Id for intermittent rivers */
-	GSHHS_RIVER_CANALS		= 8,	/* Id for river canals */
-	GSHHS_NO_RIVERLAKES		= 1,	/* Flag value */
-	GSHHS_NO_LAKES			= 2,	/* Flag value */
-	GSHHS_OCEAN_LEVEL		= 0,	/* Level assigned to nodes in the ocean */
-	GSHHS_LAND_LEVEL		= 1,	/* Level assigned to nodes on land */
-	GSHHS_ANTARCTICA_LIMBO		= 7,	/* Level assigned to nodes between ice and grounding lines */
-	GSHHS_ANTARCTICA_ICE_SRC	= 2,	/* Source ID for Antarctica ice line */
-	GSHHS_ANTARCTICA_GROUND_SRC	= 3,	/* Source ID for Antarctica grounding line */
-	GSHHS_ANTARCTICA_GROUND		= 0,	/* Use Antarctica igrounding line as coastline [Default] */
-	GSHHS_ANTARCTICA_ICE		= 1,	/* Use Antarctica ice boundary as coastline */
-	GSHHS_ANTARCTICA_SKIP		= 2,	/* Skip Antarctica coastline */
-	GSHHS_ANTARCTICA_LIMIT		= -60};	/* Data below 60S is Antarctica */
-
-struct GMT_SHORE_SELECT {	/* Information on levels and min area to use */
-	int low;	/* Lowest hierarchical level to use [0] */
-	int high;	/* Highest hierarchical level to use [4] */
-	int flag;	/* 1 = no riverlakes from level 2; 2 = only riverlakes from level 2 */
-	int fraction;	/* If not 0, the microfraction limit on a polygons area vs the full resolution version */
-	int antarctica_mode;	/* If 1, we skip all data south of 60S, i.e. the Antarctica continent and islands */
-	double area;	/* Area of smallest geographical feature to include [0] */
-};
-
-struct GMT_GSHHS_pol {	/* Information pertaining to each GSHHS polygon */
-	int *parent;		/* Array with ids of the parent polygon for each GSHHS polygon (-1 for all level 1 polygons) */
-	double *area;		/* Array with areas in km^2 of the GSHHS polygons */
-	int *area_fraction;	/* Array with micro-fraction fractions of area relative to full res area  */
-};
-
-struct GMT_SHORE {	/* Struct used by pscoast and others */
-
-	/* Global variables that remain fixed for all bins */
-	
-	int nb;		/* Number of bins to use */
-	int *bins;		/* Array with the nb bin numbers to use */
-	int min_level;	/* Lowest level to include [0] */
-	int max_level;	/* Highest level to include [4] */
-	int flag;		/* If riverlakes or lakes are to be excluded */
-	int has_source;		/* 1 if this GSHHG file contains feature source (0 for older files) */
-	int fraction;	/* If not 0, the microfraction limit on a polygons area vs the full resolution version */
-	double min_area;	/* Smallest feature to include in km^2 */
-	double scale;		/* Multiplier to convert dx, dy back to dlon, dlat in degrees */
-	
-	/* Variables associated with the current bin */
-	
-	int ns;			/* Number of segments to use in current bin */
-	unsigned char node_level[4];
-	struct GMT_SHORE_SEGMENT *seg;	/* Array of these segments */
-	struct GSHHS_SIDE *side[4];	/* Has position & id for each side exit/entry */
-	int nside[4];		/* Number of entries per side, including corner */
-	int n_entries;
-	int leftmost_bin;		/* true if current bin is at left edge of map */
-	int skip_feature;		/* true if GSHHS version > 2.0 and +r or +l is in use */
-	int ant_mode;			/* Antarctica mode [0-2] */
-	double bsize;			/* Size of square bins in degrees */
-	double lon_sw;			/* Longitude of SW corner */
-	double lat_sw;			/* Latitude of SW corner */
-	double lon_corner[4];		/* Longitudes of 4 corners (depends on direction) */
-	double lat_corner[4];		/* Latitudes of 4 corners (depends on direction) */
-
-	/* Data variables associated with shoreline database */
-	
-	int bin_size;		/* Size of square bins in minutes */
-	int bin_nx;		/* Number of bins in 360 degrees of longitude */
-	int bin_ny;		/* Number of bins in 180 degrees of latitude */
-	int n_poly;		/* Number of polygons present in the data set */
-	int n_bin;		/* Number of bins present in the data set */
-	int n_seg;		/* Number of segments present in the data set */
-	int n_pt;		/* Number of points present in the data set */
-	int n_nodes;		/* Number of grid nodes present in the data set */
-	
-	int *GSHHS_node;	/* Array with ids of the polygon that enclose each node */
-	int *bin_firstseg;	/* Array with ids of first segment per bin */
-	short int *bin_info;	/* Array with levels of all 4 nodes per bin */
-	short int *bin_nseg;	/* Array with number of segments per bin */
-	
-	int *GSHHS_parent;		/* Array with ids of the parent polygon for each GSHHS polygon (-1 for all level 1 polygons) */
-	double *GSHHS_area;		/* Array with areas in km^2 of the GSHHS polygons */
-	int *GSHHS_area_fraction;	/* Array with micro-fraction fractions of area relative to full res area  */
-
-	char units[80];		/* Units of lon/lat */
-	char title[80];		/* Title of data set */
-	char source[80];	/* Source of data set */
-	char version[8];	/* Version of data set */
-
-	/* netCDF ID variables */
-	
-	int cdfid;		/* netCDF File id for coastbin file */
-	
-	int bin_size_id;	/* Id for variable bin_size */
-	int bin_nx_id;		/* Id for variable bin_nx */
-	int bin_ny_id;		/* Id for variable bin_ny */
-	int n_poly_id;		/* Id for variable n_bin */
-	int n_bin_id;		/* Id for variable n_bin */
-	int n_seg_id;		/* Id for variable n_seg */
-	int n_pt_id;		/* Id for variable n_pt */
-	int n_node_id;		/* Id for variable n_nodes */
-	int bin_firstseg_id;	/* Id for variable bin_firstseg */
-	int bin_info_id;	/* Id for variable bin_info */
-	int bin_nseg_id;	/* Id for variable bin_nseg */
-	
-	int seg_info_id;	/* Id for variable seg_info */
-	int seg_start_id;	/* Id for variable seg_start */
-	int seg_GSHHS_ID_id;	/* Id for variable seg_GSHHS_ID */
-	
-	int GSHHS_parent_id;	/* Id for variable GSHHS_parent */
-	int GSHHS_area_id;	/* Id for variable GSHHS_area */
-	int GSHHS_areafrac_id;	/* Id for variable GSHHS_area_fraction */
-	int GSHHS_node_id;	/* Id for variable GSHHS_node_id */
-	
-	int pt_dx_id;		/* Id for variable pt_dx */
-	int pt_dy_id;		/* Id for variable pt_dy */
-};
-
-struct GMT_SHORE_SEGMENT {
-	unsigned char level;	/* Level of polygon segment (1 i ocean/land, 2 = land/lake, 3 = lake/island, etc) */
-	unsigned char entry;	/* Side (0-3) the segment starts on, or 4 for closed segments */
-	unsigned char exit;	/* Side (0-3) the segment ends on, or 4 for closed segments */
-	unsigned char fid;	/* Fill id (same as level expect for riverlakes which is 5) */
-	unsigned short n;	/* Number of points in segment */
-	short int *dx;		/* Array of scaled longitudes relative to SW corner */
-	short int *dy;		/* Array of scaled latitudes relative to SW corner */
-};
-
-struct GSHHS_SIDE {
-	unsigned short pos;	/* Position along side in 0-65535 range */
-	short int id;		/* Local segment id */
-};
-
-struct GMT_BR {	/* Structure for Borders and Rivers */
-
-	/* Global variables that remain fixed for all bins */
-	
-	int nb;		/* Number of bins to use */
-	int *bins;		/* Array with the nb bin numbers to use */
-	double scale;		/* Multiplier to convert dx, dy back to dlon, dlat in degrees */
-	
-	/* Variables associated with the current bin */
-	
-	int ns;		/* Number of segments to use in current bin */
-	struct GMT_BR_SEGMENT *seg;	/* Array of these segments */
-	double lon_sw;		/* Longitude of SW corner */
-	double lat_sw;		/* Latitude of SW corner */
-	double bsize;		/* Size of square bins in degrees */
-
-	/* Data variables associated with shoreline database */
-	
-	int bin_size;	/* Size of square bins in minutes */
-	int bin_nx;	/* Number of bins in 360 degrees of longitude */
-	int bin_ny;	/* Number of bins in 180 degrees of latitude */
-	int n_bin;		/* Number of bins present in the data set */
-	int n_seg;		/* Number of segments present in the data set */
-	int n_pt;		/* Number of points present in the data set */
-	
-	int *bin_firstseg;	/* Array with ids of first segment per bin */
-	short int *bin_nseg;	/* Array with number of segments per bin */
-	
-	char units[80];		/* Units of lon/lat */
-	char title[80];		/* Title of data set */
-	char source[80];	/* Source of data set */
-	char version[8];	/* Version of data set */
-
-	/* netCDF ID variables */
-	
-	int cdfid;		/* File id for coastbin file */
-	
-	int bin_size_id;	/* Id for variable bin_size */
-	int bin_nx_id;		/* Id for variable bin_nx */
-	int bin_ny_id;		/* Id for variable bin_ny */
-	int n_bin_id;		/* Id for variable n_bin */
-	int n_seg_id;		/* Id for variable n_seg */
-	int n_pt_id;		/* Id for variable n_pt */
-	int bin_firstseg_id;	/* Id for variable bin_firstseg */
-	int bin_nseg_id;	/* Id for variable bin_nseg */
-	
-	int seg_n_id;		/* Id for variable seg_n */
-	int seg_level_id;	/* Id for variable seg_level */
-	int seg_start_id;	/* Id for variable seg_start */
-	
-	int pt_dx_id;		/* Id for variable pt_dx */
-	int pt_dy_id;		/* Id for variable pt_dy */
-};
-
-struct GMT_BR_SEGMENT {
-	unsigned short n;	/* Number of points in segment */
-	unsigned short level;	/* Hierarchical level of segment */
-	short int *dx;		/* Array of scaled longitudes relative to SW corner */
-	short int *dy;		/* Array of scaled latitudes relative to SW corner */
-};
-
-struct GMT_GSHHS_POL {
-	int n;
-	int interior;	/* true if polygon is inside bin */
-	int level;
-	int fid;		/* Fill id; same as level but 5 if riverlake */
-	double *lon;
-	double *lat;
-};
-
-#endif /* _GMT_SHORE_H */
diff --git a/src/gmt/gmt_sph.h b/src/gmt/gmt_sph.h
deleted file mode 100644
index 866ca4b..0000000
--- a/src/gmt/gmt_sph.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/*--------------------------------------------------------------------
- *	$Id: gmt_sph.h 13846 2014-12-28 21:46:54Z pwessel $
- *
- *	Copyright (c) 2008-2015 by P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis and F. Wobbe
- *	See LICENSE.TXT file for copying and redistribution conditions.
- *
- *	This program is free software; you can redistribute it and/or modify
- *	it under the terms of the GNU Lesser General Public License as published by
- *	the Free Software Foundation; version 3 or any later version.
- *
- *	This program is distributed in the hope that it will be useful,
- *	but WITHOUT ANY WARRANTY; without even the implied warranty of
- *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *	GNU Lesser General Public License for more details.
- *
- *	Contact info: gmt.soest.hawaii.edu
- *--------------------------------------------------------------------*/
-/* Include file for sph supplement */
-
-#define DELAUNAY	0
-#define VORONOI		1
-#define INTERPOLATE	2
-
-#define TRI_NROW	6	/* Don't request arc indices from STRIPACK  */
-
-/* PW note: We largely use int64_t since it is too hard to determine which variables
- * in the Fortran-translated code could make unsigned. */
-
-struct STRIPACK_DELAUNAY {	/* Information about Delaunay triangulation */
-	uint64_t n;	/* Number of Delaunay triangles */
-	int64_t *tri;		/* Delaunay triplet node numbers and more */
-};
-
-struct STRIPACK_VORONOI {	/* Information about Voronoi polygons */
-	double *lon, *lat;		/* Voronoi polygon vertices */
-	uint64_t n;		/* Number of boundary nodes for Voronoi */
-	int64_t *lend, *listc, *lptr;	/* Voronoi vertex lists and pointers */
-	int64_t *list;			/* Additional list from trmesh */		
-};
-
-struct STRIPACK_INTERPOLATE {	/* Information about triangles */
-	int64_t *lend, *list, *lptr;	/* lists and pointers */
-};
-
-struct STRIPACK {
-	unsigned int mode;	/* VORONOI, DELAUNAY, or INTERPOLATE */
-	struct STRIPACK_DELAUNAY D;
-	struct STRIPACK_VORONOI V;
-	struct STRIPACK_INTERPOLATE I;
-};
-
-struct STRPACK_ARC {
-	uint64_t begin, end;
-};
-
-EXTERN_MSC int stripack_lists (struct GMT_CTRL *GMT, uint64_t n, double *x, double *y, double *z, struct STRIPACK *T);
-EXTERN_MSC double stripack_areas (double *V1, double *V2, double *V3);
-EXTERN_MSC void cart_to_geo (struct GMT_CTRL *GMT, uint64_t n, double *x, double *y, double *z, double *lon, double *lat);
-EXTERN_MSC int compare_arc (const void *p1, const void *p2);
-EXTERN_MSC int ssrfpack_grid (struct GMT_CTRL *GMT, double *x, double *y, double *z, double *w, uint64_t n, unsigned int mode, double *par, bool vartens, struct GMT_GRID_HEADER *h, double *f);
diff --git a/src/gmt/gmt_stat.h b/src/gmt/gmt_stat.h
deleted file mode 100644
index 7f42a43..0000000
--- a/src/gmt/gmt_stat.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/*--------------------------------------------------------------------
- *	$Id: gmt_stat.h 13846 2014-12-28 21:46:54Z pwessel $
- *
- *	Copyright (c) 1991-2015 by P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis and F. Wobbe
- *	See LICENSE.TXT file for copying and redistribution conditions.
- *
- *	This program is free software; you can redistribute it and/or modify
- *	it under the terms of the GNU Lesser General Public License as published by
- *	the Free Software Foundation; version 3 or any later version.
- *
- *	This program is distributed in the hope that it will be useful,
- *	but WITHOUT ANY WARRANTY; without even the implied warranty of
- *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *	GNU Lesser General Public License for more details.
- *
- *	Contact info: gmt.soest.hawaii.edu
- *--------------------------------------------------------------------*/
-
-#ifndef _GMT_STAT_H
-#define _GMT_STAT_H
-
-/* for weighted mean/mode */
-struct OBSERVATION {
-	float value;
-	float weight;
-};
-
-EXTERN_MSC double GMT_bei (struct GMT_CTRL *GMT, double x);
-EXTERN_MSC double GMT_ber (struct GMT_CTRL *GMT, double x);
-EXTERN_MSC double GMT_kei (struct GMT_CTRL *GMT, double x);
-EXTERN_MSC double GMT_ker (struct GMT_CTRL *GMT, double x);
-EXTERN_MSC double GMT_plm (struct GMT_CTRL *GMT, int l, int m, double x);
-EXTERN_MSC double GMT_plm_bar (struct GMT_CTRL *GMT, int l, int m, double x, bool ortho);
-EXTERN_MSC void GMT_plm_bar_all (struct GMT_CTRL *GMT, int lmax, double x, bool ortho, double *plm);
-EXTERN_MSC double GMT_factorial (struct GMT_CTRL *GMT, int n);
-EXTERN_MSC double GMT_i0 (struct GMT_CTRL *GMT, double x);
-EXTERN_MSC double GMT_i1 (struct GMT_CTRL *GMT, double x);
-EXTERN_MSC double GMT_in (struct GMT_CTRL *GMT, unsigned int n, double x);
-EXTERN_MSC double GMT_k0 (struct GMT_CTRL *GMT, double x);
-EXTERN_MSC double GMT_k1 (struct GMT_CTRL *GMT, double x);
-EXTERN_MSC double GMT_kn (struct GMT_CTRL *GMT, unsigned int n, double x);
-EXTERN_MSC double GMT_dilog (struct GMT_CTRL *GMT, double x);
-EXTERN_MSC double GMT_sinc (struct GMT_CTRL *GMT, double x);
-EXTERN_MSC double GMT_erfinv (struct GMT_CTRL *GMT, double x);
-EXTERN_MSC double GMT_rand (struct GMT_CTRL *GMT);
-EXTERN_MSC double GMT_nrand (struct GMT_CTRL *GMT);
-EXTERN_MSC double GMT_lrand (struct GMT_CTRL *GMT);
-EXTERN_MSC int GMT_chebyshev (struct GMT_CTRL *GMT, double x, int n, double *t);
-EXTERN_MSC double GMT_corrcoeff (struct GMT_CTRL *GMT, double *x, double *y, uint64_t n, unsigned int mode);
-EXTERN_MSC double GMT_corrcoeff_f (struct GMT_CTRL *GMT, float *x, float *y, uint64_t n, unsigned int mode);
-EXTERN_MSC double GMT_Fcrit (struct GMT_CTRL *GMT, double alpha, double nu1, double nu2);
-EXTERN_MSC double GMT_chi2crit (struct GMT_CTRL *GMT, double alpha, double nu);
-EXTERN_MSC double GMT_extreme (struct GMT_CTRL *GMT, double *x, uint64_t n, double x_default, int kind, int way);
-EXTERN_MSC double GMT_tcrit (struct GMT_CTRL *GMT, double alpha, double nu);
-EXTERN_MSC double GMT_zcrit (struct GMT_CTRL *GMT, double alpha);
-EXTERN_MSC double GMT_zdist (struct GMT_CTRL *GMT, double x);
-EXTERN_MSC int GMT_f_q (struct GMT_CTRL *GMT, double chisq1, uint64_t nu1, double chisq2, uint64_t nu2, double *prob);
-EXTERN_MSC int GMT_median (struct GMT_CTRL *GMT, double *x, uint64_t n, double xmin, double xmax, double m_initial, double *med);
-EXTERN_MSC int GMT_mode (struct GMT_CTRL *GMT, double *x, uint64_t n, uint64_t j, bool sort, unsigned int mode_selection, unsigned int *n_multiples, double *mode_est);
-EXTERN_MSC int GMT_mode_f (struct GMT_CTRL *GMT, float *x, uint64_t n, uint64_t j, bool sort, unsigned int mode_selection, unsigned int *n_multiples, double *mode_est);
-EXTERN_MSC double GMT_mean_and_std (struct GMT_CTRL *GMT, double *x, uint64_t n, double *std);
-
-EXTERN_MSC double GMT_median_weighted (struct GMT_CTRL *GMT, struct OBSERVATION *data, uint64_t n, double quantile);
-EXTERN_MSC double GMT_mode_weighted (struct GMT_CTRL *GMT, struct OBSERVATION *data, uint64_t n);
-
-EXTERN_MSC int GMT_sig_f (struct GMT_CTRL *GMT, double chi1, uint64_t n1, double chi2, uint64_t n2, double level, double *prob);
-EXTERN_MSC int GMT_student_t_a (struct GMT_CTRL *GMT, double t, uint64_t n, double *prob);
-EXTERN_MSC void GMT_chi2 (struct GMT_CTRL *GMT, double chi2, double nu, double *prob);
-EXTERN_MSC void GMT_cumpoisson (struct GMT_CTRL *GMT, double k, double mu, double *prob);
-EXTERN_MSC void GMT_getmad (struct GMT_CTRL *GMT, double *x, uint64_t n, double location, double *scale);
-EXTERN_MSC void GMT_getmad_f (struct GMT_CTRL *GMT, float *x, uint64_t n, double location, double *scale);
-EXTERN_MSC double GMT_psi (struct GMT_CTRL *GMT, double z[], double p[]);
-EXTERN_MSC void GMT_PvQv (struct GMT_CTRL *GMT, double x, double v_ri[], double pq[], unsigned int *iter);
-EXTERN_MSC double GMT_quantile (struct GMT_CTRL *GMT, double *x, double q, uint64_t n);
-EXTERN_MSC double GMT_quantile_f (struct GMT_CTRL *GMT, float *x, double q, uint64_t n);
-
-#endif /* _GMT_STAT_H */
diff --git a/src/gmt/gmt_supplements_module.h b/src/gmt/gmt_supplements_module.h
deleted file mode 100644
index 78fe8ea..0000000
--- a/src/gmt/gmt_supplements_module.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/* $Id: gmt_supplements_module.h 2242 2015-05-16 05:21:28Z caress $
- *
- *	Copyright (c) 2012-2015 by P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis and F. Wobbe
- * See LICENSE.TXT file for copying and redistribution conditions.
- */
-
-/* gmt_supplements_module.h declares the prototypes for supplements module functions
- * and the array that contains supplements GMT module parameters such as name
- * and purpose strings.
- * DO NOT edit this file directly! Instead edit 
- * and regenerate this file with gmt_make_module_src.sh supplements. */
-
-#pragma once
-#ifndef _GMT_SUPPLEMENTS_MODULE_H
-#define _GMT_SUPPLEMENTS_MODULE_H
-
-#ifdef __cplusplus /* Basic C++ support */
-extern "C" {
-#endif
-
-/* Declaration modifiers for DLL support (MSC et al) */
-#include "declspec.h"
-
-/* Prototypes of all modules in the GMT supplements library */
-EXTERN_MSC int GMT_gshhg (void *API, int mode, void *args);
-EXTERN_MSC int GMT_img2grd (void *API, int mode, void *args);
-EXTERN_MSC int GMT_pscoupe (void *API, int mode, void *args);
-EXTERN_MSC int GMT_psmeca (void *API, int mode, void *args);
-EXTERN_MSC int GMT_pspolar (void *API, int mode, void *args);
-EXTERN_MSC int GMT_psvelo (void *API, int mode, void *args);
-EXTERN_MSC int GMT_mgd77convert (void *API, int mode, void *args);
-EXTERN_MSC int GMT_mgd77info (void *API, int mode, void *args);
-EXTERN_MSC int GMT_mgd77list (void *API, int mode, void *args);
-EXTERN_MSC int GMT_mgd77magref (void *API, int mode, void *args);
-EXTERN_MSC int GMT_mgd77manage (void *API, int mode, void *args);
-EXTERN_MSC int GMT_mgd77path (void *API, int mode, void *args);
-EXTERN_MSC int GMT_mgd77sniffer (void *API, int mode, void *args);
-EXTERN_MSC int GMT_mgd77track (void *API, int mode, void *args);
-EXTERN_MSC int GMT_dimfilter (void *API, int mode, void *args);
-EXTERN_MSC int GMT_gmtgravmag3d (void *API, int mode, void *args);
-EXTERN_MSC int GMT_gravfft (void *API, int mode, void *args);
-EXTERN_MSC int GMT_grdgravmag3d (void *API, int mode, void *args);
-EXTERN_MSC int GMT_grdredpol (void *API, int mode, void *args);
-EXTERN_MSC int GMT_grdseamount (void *API, int mode, void *args);
-EXTERN_MSC int GMT_pssegyz (void *API, int mode, void *args);
-EXTERN_MSC int GMT_pssegy (void *API, int mode, void *args);
-EXTERN_MSC int GMT_segy2grd (void *API, int mode, void *args);
-EXTERN_MSC int GMT_backtracker (void *API, int mode, void *args);
-EXTERN_MSC int GMT_grdpmodeler (void *API, int mode, void *args);
-EXTERN_MSC int GMT_grdrotater (void *API, int mode, void *args);
-EXTERN_MSC int GMT_grdspotter (void *API, int mode, void *args);
-EXTERN_MSC int GMT_hotspotter (void *API, int mode, void *args);
-EXTERN_MSC int GMT_originator (void *API, int mode, void *args);
-EXTERN_MSC int GMT_rotconverter (void *API, int mode, void *args);
-EXTERN_MSC int GMT_x2sys_binlist (void *API, int mode, void *args);
-EXTERN_MSC int GMT_x2sys_cross (void *API, int mode, void *args);
-EXTERN_MSC int GMT_x2sys_datalist (void *API, int mode, void *args);
-EXTERN_MSC int GMT_x2sys_get (void *API, int mode, void *args);
-EXTERN_MSC int GMT_x2sys_init (void *API, int mode, void *args);
-EXTERN_MSC int GMT_x2sys_list (void *API, int mode, void *args);
-EXTERN_MSC int GMT_x2sys_merge (void *API, int mode, void *args);
-EXTERN_MSC int GMT_x2sys_put (void *API, int mode, void *args);
-EXTERN_MSC int GMT_x2sys_report (void *API, int mode, void *args);
-EXTERN_MSC int GMT_x2sys_solve (void *API, int mode, void *args);
-
-/* Pretty print all modules in the GMT supplements library and their purposes */
-EXTERN_MSC void gmt_supplements_module_show_all (void *API);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* !_GMT_SUPPLEMENTS_MODULE_H */
diff --git a/src/gmt/gmt_support.h b/src/gmt/gmt_support.h
deleted file mode 100644
index 74ea1a2..0000000
--- a/src/gmt/gmt_support.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/*--------------------------------------------------------------------
- *	$Id: gmt_support.h 13846 2014-12-28 21:46:54Z pwessel $
- *
- *	Copyright (c) 1991-2015 by P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis and F. Wobbe
- *	See LICENSE.TXT file for copying and redistribution conditions.
- *
- *	This program is free software; you can redistribute it and/or modify
- *	it under the terms of the GNU Lesser General Public License as published by
- *	the Free Software Foundation; version 3 or any later version.
- *
- *	This program is distributed in the hope that it will be useful,
- *	but WITHOUT ANY WARRANTY; without even the implied warranty of
- *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *	GNU Lesser General Public License for more details.
- *
- *	Contact info: gmt.soest.hawaii.edu
- *--------------------------------------------------------------------*/
-
-#ifndef _GMT_SUPPORT_H
-#define _GMT_SUPPORT_H
-
-/* Return codes from GMT_inonout */
-enum GMT_enum_inside {
-	GMT_OUTSIDE = 0,
-	GMT_ONEDGE,
-	GMT_INSIDE};
-
-/* Here are definition of MATH_MACRO and some functions used by grdmath and gmtmath */
-struct MATH_MACRO {
-	unsigned int n_arg;	/* How many commands this macro represents */
-	char *name;	/* The macro name */
-	char **arg;	/* List of those commands */
-};
-
-/* Definition of structure use for finding optimal nx.ny for surface */
-struct GMT_SURFACE_SUGGESTION {	/* Used to find top ten list of faster grid dimensions  */
-	unsigned int nx;
-	unsigned int ny;
-	double factor;	/* Speed up by a factor of factor  */
-};
-
-/* Definition of structure used for holding information of integer items to be selected */
-struct GMT_INT_SELECTION {	/* Used to hold array with items (0-n) that have been selected */
-	uint64_t *item;		/* Array with item numbers given (0 is first), sorted into ascending order */
-	uint64_t n;		/* Number of items */
-	uint64_t current;	/* Current item in item array */
-	bool invert;		/* Instead select the items NOT listed in item[] */
-};
-
-/* Definition of structure used for holding information of text items to be selected */
-struct GMT_TEXT_SELECTION {	/* Used to hold array with items (0-n) that have been selected */
-	char **pattern;		/* Array with text items given, sorted into lexical order */
-	int ogr_item;		/* Used if ogr_match is true */
-	uint64_t n;		/* Number of items */
-	bool invert;		/* Instead select the items NOT listed in item[] */
-	bool *regexp;		/* Item is a regex expression */
-	bool *caseless;		/* Treat as caseless */
-	bool ogr_match;		/* Compare pattern to an OGR item */
-};
-
-#endif /* _GMT_SUPPORT_H */
diff --git a/src/gmt/gmt_symbol.h b/src/gmt/gmt_symbol.h
deleted file mode 100644
index 972421f..0000000
--- a/src/gmt/gmt_symbol.h
+++ /dev/null
@@ -1,113 +0,0 @@
-/*--------------------------------------------------------------------
- *	$Id: gmt_symbol.h 2242 2015-05-16 05:21:28Z caress $
- *
- *	Copyright (c) 1991-2015 by P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis and F. Wobbe
- *	See LICENSE.TXT file for copying and redistribution conditions.
- *
- *	This program is free software; you can redistribute it and/or modify
- *	it under the terms of the GNU Lesser General Public License as published by
- *	the Free Software Foundation; version 3 or any later version.
- *
- *	This program is distributed in the hope that it will be useful,
- *	but WITHOUT ANY WARRANTY; without even the implied warranty of
- *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *	GNU Lesser General Public License for more details.
- *
- *	Contact info: gmt.soest.hawaii.edu
- *--------------------------------------------------------------------*/
- 
-/*
- * Miscellaneous definitions and structures related to:
- * 1. Compass symbols used by pscbasemap and pscoast
- * 2. Custom symbols used by psxy and psxyz.
- * 3. Definitions for vector attributes
- *
- * Author: Paul Wessel
- * Date:	1-JAN-2010
- * Version:	5 API
- */
-
-#ifndef _GMT_SYMBOLS_H
-#define _GMT_SYMBOLS_H
-
-/* VECTOR attributes are used by psxy, psxyz, psrose, grdvector */
-#define VECTOR_LINE_WIDTH	2.0	/* Default vector attributes in points */
-#define VECTOR_HEAD_WIDTH	7.0
-#define VECTOR_HEAD_LENGTH	9.0
-
-struct GMT_CUSTOM_SYMBOL_ITEM {
-	double x, y, p[3], const_val[2];
-	int action, operator, var;
-	unsigned int conditional;
-	unsigned int justify;	/* For macro code l text justification [PSL_MC] */
-	bool negate;
-	struct GMT_FILL *fill;
-	struct GMT_PEN *pen;
-	struct GMT_CUSTOM_SYMBOL_ITEM *next;
-	struct GMT_FONT font;	/* Font to use for the l macro */
-	char *string;
-};
-
-struct GMT_CUSTOM_SYMBOL {
-	char name[GMT_LEN64];	/* Name of this symbol (i.e., just the <name> in [<dir>/]<name>.def) */
-	char *PS_macro;		/* Contains all the PS commands if PS is true */
-	unsigned int n_required;	/* Number of additional columns necessary to decode chosen symbol */
-	unsigned int start;	/* Column number of first additional column [2-4 depending on -C and psxy vs psxyz] */
-	bool PS;		/* true if a PSL symbol */
-	bool text;		/* true if symbol places text and hence need fonts to be set properly */
-	unsigned int *type;	/* Array with type of each parameter [0 = dimensionless, 1 = dimension, 2 = geographic angle (convert via projection)] */
-	struct GMT_CUSTOM_SYMBOL_ITEM *first;
-};
-
-struct GMT_MAP_INSERT {	/* Used to plot a map insert box in psbasemap */
-	/* -D[unit]xmin/xmax/ymin/ymax|width[/height][+c<clon>/<clat>][+p<pen>][+g<fill>] */
-	bool center;		/* Gave center of insert */
-	bool plot;		/* true if we want to draw the insert */
-	bool boxdraw;		/* true if we want to plot a rectangle to indicate the insert */
-	bool boxfill;		/* true if we want to paint/fill the insert */
-	bool oblique;		/* true if we want got <w/s/e/n>r instead of <w/e/s/n> */
-	char unit;		/* Unit of projected coordinates or 0 for geographic */
-	double x0, y0;		/* Center of insert, if given */
-	double wesn[4];		/* Geographic or projected boundaries */
-	double dim[2];		/* Width & height of box */
-	struct GMT_FILL fill;	/* Fill for insert */
-	struct GMT_PEN pen;	/* Pen for insert */
-};
-
-struct GMT_MAP_SCALE {	/* Used to plot a map scale in psbasemap and pscoast */
-	double lon, lat;	/* Location of top/mid point of scale on the map in lon/lat space */
-	double x0, y0;		/* Location of top/mid point of scale on the map in inches x/y */
-	double scale_lon;	/* Point where scale should apply */
-	double scale_lat;	/* Point where scale should apply */
-	double length;		/* How long the scale is in measure units */
-	bool boxdraw;	/* true if we want to plot a rectangle behind the scale */
-	bool boxfill;	/* true if we want to paint/fill a rectangle behind the scale */
-	bool plot;		/* true if we want to draw the scale */
-	bool fancy;		/* true for a fancy map scale */
-	bool gave_xy;	/* true if x0, y0 was given in cartesian map coordinates and not lon/lat */
-	bool unit;		/* true if we should append distance unit to all annotations along the scale */
-	bool do_label;	/* true if we should plot a label for the scale */
-	char measure;		/* The unit, i.e., m (miles), n (nautical miles), or k (kilometers) */
-	char justify;		/* Placement of label: t(op), b(ottom), l(eft), r(ight) */
-	char label[GMT_LEN64];	/* Alternative user-specified label */
-	struct GMT_FILL fill;	/* Fill to use for background rectangle */
-	struct GMT_PEN pen;	/* Pen to use for background rectangle */
-};
-
-struct GMT_MAP_ROSE {	/* Used to plot a map direction "rose" in psbasemap and pscoast */
-	double lon, lat;	/* Location of center point of rose on the map in lon/lat space */
-	double x0, y0;		/* Location of center point of scale on the map in inches x/y */
-	double size;		/* Diameter of the rose in measure units */
-	double declination;	/* Magnetic declination if needed */
-	double a_int[2];	/* Annotation interval for geographic and magnetic directions */
-	double f_int[2];	/* Tick (large) interval for geographic and magnetic directions */
-	double g_int[2];	/* Tick (small) interval for geographic and magnetic directions */
-	bool plot;		/* true if we want to draw the rose */
-	bool gave_xy;	/* true if x0, y0 was given in cartesian map coordinates and not lon/lat */
-	unsigned int type;	/* 0 for plain directional rose, 1 for a fancy directional map rose, 2 for magnetic rose */
-	unsigned int kind;	/* 0 : 90 degrees, 1 : 45 degrees, 2 : 22.5 degrees between points */
-	char label[4][GMT_LEN64];	/* User-changable labels for W, E, S, N point */
-	char dlabel[GMT_LEN256];	/* Magnetic declination label */
-};
-
-#endif	/* _GMT_SYMBOLS_H */
diff --git a/src/gmt/gmt_synopsis.h b/src/gmt/gmt_synopsis.h
deleted file mode 100644
index 7afb99c..0000000
--- a/src/gmt/gmt_synopsis.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/*--------------------------------------------------------------------
- *	$Id: gmt_synopsis.h 2242 2015-05-16 05:21:28Z caress $
- *
- *	Copyright (c) 1991-2015 by P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis and F. Wobbe
- *	See LICENSE.TXT file for copying and redistribution conditions.
- *
- *	This program is free software; you can redistribute it and/or modify
- *	it under the terms of the GNU Lesser General Public License as published by
- *	the Free Software Foundation; version 3 or any later version.
- *
- *	This program is distributed in the hope that it will be useful,
- *	but WITHOUT ANY WARRANTY; without even the implied warranty of
- *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *	GNU Lesser General Public License for more details.
- *
- *	Contact info: gmt.soest.hawaii.edu
- *--------------------------------------------------------------------*/
-/*
- * Contains macros for presenting variations of GMT common options in program
- * synopsis - yielding consistent presentation from all programs.
- * See gmt_option.h for the GMT common options part of the API.
- *
- * Author:	Paul Wessel
- * Date:	1-JAN-2010
- * Version:	5 API
- *
- */
-
-#ifndef GMT_SYNOPSIS_H
-#define GMT_SYNOPSIS_H
-
-#define GMT_inc_OPT	"<xinc>[<unit>][=|+][/<yinc>[<unit>][=|+]]"
-#define GMT_Id_OPT	"-I<xinc>[m|s][/<yinc>[m|s]]"
-#define GMT_Jx_OPT	"-Jx|X<args>"
-#define GMT_Jz_OPT	"-Jz|Z<args>"
-#define GMT_Rgeo_OPT	"-R<west>/<east>/<south>/<north>[r]"
-#define GMT_Rgeoz_OPT	"-R<west>/<east>/<south>/<north>[/<zmin>/<zmax>][r]"
-#define GMT_Rx_OPT	"-R[<unit>]<xmin>/<xmax>/<ymin>/<ymax>[r]"
-
-/* Use b, f, h, when applies to both i and o, else use only the bi, bo, fi, fo variants */
-
-#define GMT_bi_OPT	"-bi[<ncol>][t][w][+L|B]"
-#define GMT_bo_OPT	"-bo[<ncol>][t][w][+L|B]"
-#define GMT_fi_OPT	"-f<info>"
-#define GMT_fo_OPT	"-f<info>"
-#define GMT_ho_OPT	"-ho[<nrecs>][+c][+d][+r<remark>][+t<title>]"
-
-/* For options needing a length or radius */
-
-#define GMT_DIST_OPT	"[-|+]<dist>[<unit>]"
-#define GMT_RADIUS_OPT	"[-|+]<radius>[<unit>]"
-
-/* Options for map rose, scale and insert, used in pscoast and psbasemap */
-
-#define GMT_TROSE	"[f|m][x]<lon0>/<lat0>/<diameter>[/<info>][:w,e,s,n:][+<gint>[/<mint>]]"
-#define GMT_SCALE	"[f][x]<lon0>/<lat0>[/<slon>]/<slat>/<length>[e|f|M|n|k|u][+l<label>][+j<just>][+p<pen>][+g<fill>][+u]"
-#define GMT_INSERT	"[<u>]<xmin>/<xmax>/<ymin>/<ymax>[r]|<width>[/<height>][+c<lon>/<lat>][+p<pen>][+g<fill>]"
-
-/* Argument to *contour programs */
-
-#define GMT_CONTG	"-G[d|f|n|l|L|x|X]<args>"
-#define GMT_CONTT	"-T[+|-][<gap>[c|i|p]/<length>[c|i|p]][:[<labels>]]"
-
-/* Options for coastline extraction  */
-#ifdef NEW_GSHHG
-#define GMT_A_OPT       "-A<min_area>[/<min_level>/<max_level>][+ag|i|s][+r|l][+p<percent>]"
-#else
-#define GMT_A_OPT       "-A<min_area>[/<min_level>/<max_level>][+as][+r|l][+p<percent>]"
-#endif
-
-/* Used in tools that sets grdheader information via a -D option */
-
-#define GMT_GRDEDIT	"-D<xname>/<yname>/<zname>/<scale>/<offset>/<invalid>/<title>/<remark>"
-
-#endif /* GMT_SYNOPSIS_H */
diff --git a/src/gmt/gmt_texture.h b/src/gmt/gmt_texture.h
deleted file mode 100644
index 505a83d..0000000
--- a/src/gmt/gmt_texture.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/*--------------------------------------------------------------------
- *	$Id: gmt_texture.h 13846 2014-12-28 21:46:54Z pwessel $
- *
- *	Copyright (c) 1991-2015 by P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis and F. Wobbe
- *	See LICENSE.TXT file for copying and redistribution conditions.
- *
- *	This program is free software; you can redistribute it and/or modify
- *	it under the terms of the GNU Lesser General Public License as published by
- *	the Free Software Foundation; version 3 or any later version.
- *
- *	This program is distributed in the hope that it will be useful,
- *	but WITHOUT ANY WARRANTY; without even the implied warranty of
- *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *	GNU Lesser General Public License for more details.
- *
- *	Contact info: gmt.soest.hawaii.edu
- *--------------------------------------------------------------------*/
-/*
- * gmt_texture.h contains definitions of structures for pens, fills, and fonts.
- *
- * Author:	Paul Wessel
- * Date:	01-OCT-2009
- * Version:	5 API
- */
-
-#ifndef _GMT_TEXTURE_H
-#define _GMT_TEXTURE_H
-
-/*--------------------------------------------------------------------
- *			GMT TEXTURE STRUCTURE DEFINITIONS
- *--------------------------------------------------------------------*/
-
-struct GMT_PEN {	/* Holds pen attributes */
-	double width;			/* In points */
-	double offset;			/* In points */
-	double rgb[4];			/* RGB color of pen + Transparency 0-1 [0 = opaque] */
-	char style[GMT_PEN_LEN];	/* Uses points as unit internally */
-};
-
-struct GMT_FILL {	/* Holds fill attributes */
-	double rgb[4];			/* Chosen color if no pattern + Transparency 0-1 [0 = opaque] */
-	double f_rgb[4], b_rgb[4];	/* Colors applied to unset and set bits in 1-bit image */
-	bool use_pattern;		/* true if pattern rather than rgb is set */
-	int pattern_no;		/* Number of predefined pattern, or -1 if not set */
-	unsigned int dpi;		/* Desired dpi of image building-block */
-	char pattern[GMT_BUFSIZ];		/* Full filename of user-define raster */
-};
-
-struct GMT_FONT {	/* Holds font attributes */
-	double size;			/* Font size in points */
-	unsigned int id;		/* Font ID number from predefined list */
-	unsigned int form;		/* Combination of binary 1 = fill, 2 = outline, 4 = pattern fill [1] */
-	struct GMT_FILL fill;		/* Font fill [black] */
-	struct GMT_PEN pen;		/* Font outline pen [none] */
-};
-
-struct GMT_FONTSPEC {	/* Holds information for each predefined font */
-	double height;			/* Height of letter "A" for unit fontsize */
-	char *name;			/* Name of the font */
-};
-
-struct GMT_MEDIA {	/* Holds information about paper sizes in points */
-	double width;		/* Width in points */
-	double height;		/* Height in points */
-};
-
-#endif  /* _GMT_TEXTURE_H */
diff --git a/src/gmt/gmt_time.h b/src/gmt/gmt_time.h
deleted file mode 100644
index d004c62..0000000
--- a/src/gmt/gmt_time.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/*--------------------------------------------------------------------
- *	$Id: gmt_time.h 13846 2014-12-28 21:46:54Z pwessel $
- *
- *	Copyright (c) 1991-2015 by P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis and F. Wobbe
- *	See LICENSE.TXT file for copying and redistribution conditions.
- *
- *	This program is free software; you can redistribute it and/or modify
- *	it under the terms of the GNU Lesser General Public License as published by
- *	the Free Software Foundation; version 3 or any later version.
- *
- *	This program is distributed in the hope that it will be useful,
- *	but WITHOUT ANY WARRANTY; without even the implied warranty of
- *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *	GNU Lesser General Public License for more details.
- *
- *	Contact info: gmt.soest.hawaii.edu
- *--------------------------------------------------------------------*/
-/*
- * gmt_time.h contains definitions of structures dealing with time.
- *
- * Author:	Paul Wessel
- * Date:	01-OCT-2009
- * Version:	5 API
- */
-
-#ifndef _GMT_TIME_H
-#define _GMT_TIME_H
-
-/*--------------------------------------------------------------------
- *			GMT TIME STRUCTURES
- *--------------------------------------------------------------------*/
-
-struct GMT_TIME_SYSTEM {
-	double epoch_t0;		/* Rata_die fraction (in days since epoch, 0 <= t0 < 1) */
-	double scale;			/* Converts user units to seconds */
-	double i_scale;			/* Converts seconds to user units (= 1.0/scale) */
-	int64_t rata_die;		/* Rata die number of epoch */
-	char epoch[GMT_LEN64];	/* User-defined epoch for time */
-	char unit;			/* User-defined time unit */
-};
-
-struct GMT_TIME_LANGUAGE {		/* Language-specific text strings for calendars */
-	char month_name[4][12][GMT_LEN16];	/* Full, short, 1-char, and short (upper case) month names */
-	char day_name[3][7][GMT_LEN16];	/* Full, short, and 1-char weekday names */
-	char week_name[3][GMT_LEN16];	/* Full, short, and 1-char versions of the word Week */
-};
-
-#endif  /* _GMT_TIME_H */
diff --git a/src/gmt/gmt_types.h b/src/gmt/gmt_types.h
deleted file mode 100644
index 55ee509..0000000
--- a/src/gmt/gmt_types.h
+++ /dev/null
@@ -1,216 +0,0 @@
-/*--------------------------------------------------------------------
- *	$Id: gmt_types.h 2242 2015-05-16 05:21:28Z caress $
- *
- *	Copyright (c) 1991-2015 by P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis and F. Wobbe
- *	See LICENSE.TXT file for copying and redistribution conditions.
- *
- *	This program is free software; you can redistribute it and/or modify
- *	it under the terms of the GNU Lesser General Public License as published by
- *	the Free Software Foundation; version 3 or any later version.
- *
- *	This program is distributed in the hope that it will be useful,
- *	but WITHOUT ANY WARRANTY; without even the implied warranty of
- *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *	GNU Lesser General Public License for more details.
- *
- *	Contact info: gmt.soest.hawaii.edu
- *--------------------------------------------------------------------*/
-/*
- * gmt_types.h contains definitions of special types used by GMT.
- *
- * Author:	Paul Wessel
- * Date:	01-OCT-2009
- * Version:	5 API
- */
-
-#ifndef _GMT_TYPES_H
-#define _GMT_TYPES_H
-//#ifdef HAVE_STDBOOL_H_
-#	include <stdbool.h>
-//#else
-//#	include "compat/stdbool.h"
-//#endif
-#include <stdint.h>
-
-/*--------------------------------------------------------------------
- * GMT TYPE DEFINITIONS
- *--------------------------------------------------------------------*/
-
-struct GMT_MAP {		/* Holds all map-related parameters */
-	struct GMT_PLOT_FRAME frame;		/* Everything about the frame parameters */
-	int this_x_status;			/* Tells us what quadrant old and new points are in (-4/4) */
-	int this_y_status;
-	int prev_x_status;
-	int prev_y_status;
-	int corner;			/* Tells us which corner 1-4 or -1 if not a corner */
-	bool coastline;			/* true if we are currently plotting the coastline data in pscoast */
-	bool on_border_is_outside;		/* true if a point exactly on the map border shoud be considered outside the map */
-	bool is_world;			/* true if map has 360 degrees of longitude range */
-	bool is_world_tm;			/* true if GMT_TM map is global? */
-	bool lon_wrap;			/* true when longitude wrapping over 360 degrees is allowed */
-	bool z_periodic;			/* true if grid values are 0-360 degrees (phases etc) */
-	bool loxodrome;				/* true if we are computing loxodrome distances */
-	unsigned int meridian_straight;		/* 1 if meridians plot as straight lines, 2 for special case */
-	unsigned int parallel_straight;		/* 1 if parallels plot as straight lines, 2 for special case */
-	unsigned int n_lon_nodes;		/* Somewhat arbitrary # of nodes for lines in longitude (may be reset in gmt_map.c) */
-	unsigned int n_lat_nodes;		/* Somewhat arbitrary # of nodes for lines in latitude (may be reset in gmt_map.c) */
-	unsigned int path_mode;		/* 0 if we should call GMT_fix_up_path to resample across gaps > path_step, 1 to leave alone */
-	double width;				/* Full width in inches of this world map */
-	double height;				/* Full height in inches of this world map */
-	double half_width;			/* Half width in inches of this world map */
-	double half_height;			/* Half height of this world map */
-	double dlon;				/* Steps taken in longitude along gridlines (gets reset in gmt_init.c) */
-	double dlat;				/* Steps taken in latitude along gridlines (gets reset in gmt_init.c) */
-	double path_step;			/* Sampling interval if resampling of paths should be done */
-	bool (*outside) (struct GMT_CTRL *, double, double);	/* Pointer to function checking if a lon/lat point is outside map */
-	bool (*overlap) (struct GMT_CTRL *, double, double, double, double);	/* Pointer to function checking for overlap between 2 regions */
-	bool (*will_it_wrap) (struct GMT_CTRL *, double *, double *, uint64_t, uint64_t *);	/* true if consecutive points indicate wrap */
-	int (*jump) (struct GMT_CTRL *, double, double, double, double);	/* true if we jump in x or y */
-	unsigned int (*crossing) (struct GMT_CTRL *, double, double, double, double, double *, double *, double *, double *, unsigned int *);	/* Pointer to functions returning crossover point at boundary */
-	uint64_t (*clip) (struct GMT_CTRL *, double *, double *, uint64_t, double **, double **, uint64_t *);	/* Pointer to functions that clip a polygon to fit inside map */
-	double (*left_edge) (struct GMT_CTRL *, double);	/* Pointers to functions that return left edge of map */
-	double (*right_edge) (struct GMT_CTRL *, double);	/* Pointers to functions that return right edge of map */
-	struct GMT_DIST dist[3];		/* struct with pointers to functions/scales returning distance between two points points */
-	bool (*near_lines_func) (struct GMT_CTRL *, double, double, struct GMT_DATATABLE *, unsigned int, double *, double *, double *);	/* Pointer to function returning distance to nearest line among a set of lines */
-	bool (*near_a_line_func) (struct GMT_CTRL *, double, double, uint64_t, struct GMT_DATASEGMENT *, unsigned int, double *, double *, double *);	/* Pointer to function returning distance to line */
-	bool (*near_point_func) (struct GMT_CTRL *, double, double, struct GMT_DATATABLE *, double);	/* Pointer to function returning distance to nearest point */	
-	unsigned int (*wrap_around_check) (struct GMT_CTRL *, double *, double, double, double, double, double *, double *, unsigned int *);	/* Does x or y wrap checks */
-	double (*azimuth_func) (struct GMT_CTRL *, double, double, double, double, bool);	/* Pointer to function returning azimuth between two points points */
-	void (*get_crossings) (struct GMT_CTRL *, double *, double *, double, double, double, double);	/* Returns map crossings in x or y */
-};
-
-struct GMT_TIME_CONV {		/* Holds all time-related parameters */
-	struct GMT_TRUNCATE_TIME truncate;
-	struct GMT_Y2K_FIX Y2K_fix;		/* Used to convert 2-digit years to 4-digit years */
-	struct GMT_TIME_LANGUAGE language;	/* For time axis */
-	time_t tic;				/* Last system time marker */
-	int64_t today_rata_die;			/* The rata die of current day at start of program */
-};
-
-struct GMT_INIT { /* Holds misc run-time parameters */
-	unsigned int n_custom_symbols;
-	const char *module_name;      /* Name of current module or NULL if not set */
-	const char *module_lib;       /* Name of current shared library or NULL if not set */
-	/* The rest of the struct contains pointers that may point to memory not included by this struct */
-	char *runtime_bindir;         /* Directory that contains the main exe at run-time */
-	char *runtime_libdir;         /* Directory that contains the main shared lib at run-time */
-	char *history[GMT_N_UNIQUE];  /* The internal gmt.history information */
-	struct GMT_CUSTOM_SYMBOL **custom_symbol; /* For custom symbol plotting in psxy[z]. */
-};
-
-struct GMT_PLOT {		/* Holds all plotting-related parameters */
-	uint64_t n;			/* Number of such points */
-	size_t n_alloc;			/* Size of allocated plot arrays */
-	bool r_theta_annot;		/* true for special r-theta map annotation (see GMT_get_annot_label) */
-	unsigned int mode_3D;		/* Determines if we draw fore and/or back 3-D box lines [Default is both] */
-	unsigned int *pen;		/* Pen (PSL_MOVE = up, PSL_DRAW = down) for these points */
-	struct GMT_PLOT_CALCLOCK calclock;
-	/* The rest of the struct contains pointers that may point to memory not included by this struct */
-	double *x;			/* Holds the x/y (inches) of a line to be plotted */
-	double *y;
-	char format[3][2][GMT_LEN256];	/* Keeps the 6 formats for dd:mm:ss plot output */
-};
-
-struct GMT_CURRENT {
-	/* These are internal parameters that need to be passed around between
-	 * many GMT functions.  These values may change by user interaction. */
-	struct GMT_DEFAULTS setting;	/* Holds all GMT defaults parameters */
-	struct GMT_IO io;		/* Holds all i/o-related parameters */
-	struct GMT_PROJ proj;		/* Holds all projection-related parameters */
-	struct GMT_MAP map;		/* Holds all projection-related parameters */
-	struct GMT_PLOT plot;		/* Holds all plotting-related parameters */
-	struct GMT_TIME_CONV time;	/* Holds all time-related parameters */
-	struct GMT_PS ps;		/* Hold parameters related to PS setup */
-	struct GMT_OPTION *options;	/* Pointer to current program's options */
-	struct GMT_FFT_HIDDEN fft;	/* Structure with info that must survive between FFT calls */
-};
-
-struct GMT_INTERNAL {
-	/* These are internal parameters that need to be passed around between
-	 * many GMT functions.  These may change during execution but are not
-	 * modified directly by user interaction. */
-	unsigned int func_level;	/* Keeps track of what level in a nested GMT_func calling GMT_func etc we are.  0 is top function */
-	size_t mem_cols;		/* Current number of allocated columns for temp memory */
-	size_t mem_rows;		/* Current number of allocated rows for temp memory */
-	double **mem_coord;		/* Columns of temp memory */
-#ifdef MEMDEBUG
-	struct MEMORY_TRACKER *mem_keeper;
-#endif
-};
-
-struct GMT_SHORTHAND {	/* Holds information for each grid extension shorthand read from the user's .gmtio file */
-	char *suffix; /* suffix of file */
-	char *format; /* format: ff/scale/offset/invalid */
-};
-
-struct GMT_SESSION {
-	/* These are parameters that is set once at the start of a GMT session and
-	 * are essentially read-only constants for the duration of the session */
-	FILE *std[3];			/* Pointers for standard input, output, and error */
-	void * (*input_ascii) (struct GMT_CTRL *, FILE *, uint64_t *, int *);	/* Pointer to function reading ascii tables only */
-	int (*output_ascii) (struct GMT_CTRL *, FILE *, uint64_t, double *);	/* Pointer to function writing ascii tables only */
-	unsigned int n_fonts;		/* Total number of fonts returned by GMT_init_fonts */
-	unsigned int n_user_media;	/* Total number of user media returned by gmt_load_user_media */
-	size_t min_meminc;		/* with -DMEMDEBUG, sets min/max memory increments */
-	size_t max_meminc;
-	float f_NaN;			/* Holds the IEEE NaN for floats */
-	double d_NaN;			/* Holds the IEEE NaN for doubles */
-	double no_rgb[4];		/* To hold {-1, -1, -1, 0} when needed */
-	double u2u[4][4];		/* u2u is the 4x4 conversion matrix for cm, inch, m, pt */
-	char unit_name[4][8];		/* Full name of the 4 units cm, inch, m, pt */
-	struct GMT_HASH rgb_hashnode[GMT_N_COLOR_NAMES];/* Used to translate colornames to r/g/b */
-	bool rgb_hashnode_init;		/* true once the rgb_hashnode array has been loaded; false otherwise */
-	unsigned int n_shorthands;			/* Length of arrray with shorthand information */
-	char *grdformat[GMT_N_GRD_FORMATS];	/* Type and description of grid format */
-	int (*readinfo[GMT_N_GRD_FORMATS]) (struct GMT_CTRL *, struct GMT_GRID_HEADER *);	/* Pointers to grid read header functions */
-	int (*updateinfo[GMT_N_GRD_FORMATS]) (struct GMT_CTRL *, struct GMT_GRID_HEADER *);	/* Pointers to grid update header functions */
-	int (*writeinfo[GMT_N_GRD_FORMATS]) (struct GMT_CTRL *, struct GMT_GRID_HEADER *);	/* Pointers to grid write header functions */
-	int (*readgrd[GMT_N_GRD_FORMATS]) (struct GMT_CTRL *, struct GMT_GRID_HEADER *, float *, double *, unsigned int *, unsigned int);	/* Pointers to grid read functions */
-	int (*writegrd[GMT_N_GRD_FORMATS]) (struct GMT_CTRL *, struct GMT_GRID_HEADER *, float *, double *, unsigned int *, unsigned int);	/* Pointers to grid read functions */
-	int (*fft1d[k_n_fft_algorithms]) (struct GMT_CTRL *, float *, unsigned int, int, unsigned int);	/* Pointers to available 1-D FFT functions (or NULL if not configured) */
-	int (*fft2d[k_n_fft_algorithms]) (struct GMT_CTRL *, float *, unsigned int, unsigned int, int, unsigned int);	/* Pointers to available 2-D FFT functions (or NULL if not configured) */
-	/* This part contains pointers that may point to additional memory outside this struct */
-	char *DCWDIR;			/* Path to the DCW directory */
-	char *GSHHGDIR;			/* Path to the GSHHG directory */
-	char *SHAREDIR;			/* Path to the GMT share directory */
-	char *HOMEDIR;			/* Path to the user's home directory */
-	char *USERDIR;			/* Path to the user's GMT settings directory */
-	char *DATADIR;			/* Path to one or more directories with data sets */
-	char *TMPDIR;			/* Path to the directory directory for isolation mode */
-	char *CUSTOM_LIBS;		/* Names of one or more comma-separated GMT-compatible shared libraries */
-	char **user_media_name;		/* Length of array with custom media dimensions */
-	struct GMT_FONTSPEC *font;		/* Array with font names and height specification */
-	struct GMT_MEDIA *user_media;		/* Array with custom media dimensions */
-	struct GMT_SHORTHAND *shorthand;	/* Array with info about shorthand file extension magic */
-};
-
-struct GMT_CTRL {
-	/* Master structure for a GMT invokation.  All internal settings for GMT is accessed here */
-	struct GMT_SESSION session;	/* Structure with all values that do not change throughout a session */
-	struct GMT_INIT init;		/* Structure with all values that do not change in a GMT_func call */
-	struct GMT_COMMON common;	/* Structure with all the common GMT command settings (-R -J ..) */
-	struct GMT_CURRENT current;	/* Structure with all the GMT items that can change during execution, such as defaults settings (pens, colors, fonts.. ) */
-	struct GMT_INTERNAL hidden;	/* Internal global variables that are not to be changed directly by users */
-	struct PSL_CTRL *PSL;		/* Pointer to the PSL structure [or NULL] */
-	struct GMTAPI_CTRL *parent;	/* Owner of this structure [or NULL]; gives access to the API from functions being passed *GMT only */
-};
-
-/* p_to_io_func is used as a pointer to functions such as GMT_read_d in assignments
- * and is used to declare GMT_get_io_ptr in gmt_io.c and gmt_prototypes.h */
-typedef int (*p_to_io_func) (struct GMT_CTRL *, FILE *, uint64_t, double *);
-
-/* Exit or return:  For some environments (e.g., Matlab) we do not
-   wish to call the system "Exit" as it brings down Matlab as well.  In those cases
-   we instead call return and let Matlab client deal with any follow-up.  This
-   decision is set in GMT_Create_Session via its flags.  While exit always returns
-   an integer code, the return functions may have to return other types, hence we
-   let GMT_exit possibly call exit, else it does nothing.  Thus, calls to GMT_exit
-   must be followed by return <type> so that we return where we said we would. */
-
-/* If GMT is not set or no_not_exit is false then we call system exit, else we move along */
-static inline void GMT_exit (struct GMT_CTRL *GMT, int code) {
-	if (GMT == NULL || GMT->parent == NULL || GMT->parent->do_not_exit == false)
-		exit (code);
-}
-
-#endif  /* _GMT_TYPES_H */
diff --git a/src/gmt/gmt_unique.h b/src/gmt/gmt_unique.h
deleted file mode 100644
index b1aa0b3..0000000
--- a/src/gmt/gmt_unique.h
+++ /dev/null
@@ -1,69 +0,0 @@
-"B",
-"J",
-"JA",
-"Ja",
-"JB",
-"Jb",
-"JC",
-"Jc",
-"JD",
-"Jd",
-"JE",
-"Je",
-"JF",
-"Jf",
-"JG",
-"Jg",
-"JH",
-"Jh",
-"JI",
-"Ji",
-"JJ",
-"Jj",
-"JK",
-"Jk",
-"JL",
-"Jl",
-"JM",
-"Jm",
-"JN",
-"Jn",
-"JO",
-"Jo",
-"JP",
-"Jp",
-"JQ",
-"Jq",
-"JR",
-"Jr",
-"JS",
-"Js",
-"JT",
-"Jt",
-"JU",
-"Ju",
-"JV",
-"Jv",
-"JW",
-"Jw",
-"JX",
-"Jx",
-"JY",
-"Jy",
-"JZ",
-"Jz",
-"R",
-"X",
-"Y",
-"a",
-"b",
-"c",
-"f",
-"g",
-"h",
-"i",
-"n",
-"o",
-"p",
-"s",
-"t"
diff --git a/src/gmt/gmt_version.h b/src/gmt/gmt_version.h
deleted file mode 100644
index 35e33da..0000000
--- a/src/gmt/gmt_version.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * $Id: gmt_version.h 2242 2015-05-16 05:21:28Z caress $
- *
- *  Copyright (c) 1991-2015 by P. Wessel, W. H. F. Smith, R. Scharroo,
- *  F. Wobbe, and J. Luis
- *
- * See LICENSE.TXT file for copying and redistribution conditions.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; version 3 or any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Lesser General Public License for more details.
- *
- * Contact info: gmt.soest.hawaii.edu
- */
-
-#pragma once
-#ifndef GMT_VERSION_H_
-#define GMT_VERSION_H_
-
-/* for manpages only */
-#define MANDATE "15 May 2015"
-
-#define GMT_MAJOR_VERSION 5
-#define GMT_MINOR_VERSION 1
-#define GMT_RELEASE_VERSION 2
-#define GMT_VERSION_YEAR 2015
-
-#define GMT_SOURCE_CODE_CONTROL_VERSION_STRING "14256"
-#ifdef GMT_SOURCE_CODE_CONTROL_VERSION_STRING
-#	define GMT_STRING "5.1.2 (r14256)"
-#else /* if HAVE_SVN_VERSION or if unversioned */
-#	define GMT_STRING "5.1.2"
-#endif
-
-#ifdef __x86_64__
-#	define GMT_VER_64 " [64-bit]"
-#else
-#	define GMT_VER_64 ""
-#endif
-
-#ifdef _OPENMP /* Open MP Parallelization is on */
-#	define GMT_MP " [MP]"
-#else
-#	define GMT_MP ""
-#endif
-
-#ifndef GMT_MANPAGE
-#	define GMT_VERSION GMT_version()
-	static inline char *GMT_version () {
-		/* final string returned by GMT_version() */
-		static char version[] = GMT_STRING GMT_VER_64 GMT_MP;
-		return version;
-	}
-#endif /* !GMT_MANPAGE */
-
-#endif /* !GMT_VERSION_H_ */
-
-/* vim: set ft=c: */
diff --git a/src/gmt/mbcontour.c b/src/gmt/mbcontour.c
deleted file mode 100644
index 4800f54..0000000
--- a/src/gmt/mbcontour.c
+++ /dev/null
@@ -1,1532 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbcontour.c	5/30/93
- *    $Id: mbcontour.c 2247 2015-05-29 21:28:28Z caress $
- *
- *    Copyright (c) 1993-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * MBCONTOUR is a GMT compatible utility which creates a color postscript
- * image of swath bathymetry or backscatter data.  The image
- * may be shaded relief as well.  Complete maps are made by using
- * MBCONTOUR in conjunction with the usual GMT programs.  The modes
- * of operation are:
- *   Mode 1:  Bathymetry
- *   Mode 2:  Bathymetry shaded by illumination
- *   Mode 3:  Bathymetry shaded by amplitude
- *   Mode 4:  amplitude
- *   Mode 5:  sidescan
- *   Mode 6:  Bathymetry shaded by amplitude using cpt gray data
- *
- * Author:	D. W. Caress
- * Date:	May 30, 1993 (original standalone program for GMT3 and GMT4)
- *                           (also originally served to drive Calcomp style pen 
- *                              plotters in real time)
- * Date:	January 27, 2015 (recast as GMT5 module, code supporting pen
- *                                  plotters removed)
- *
- */
-
-#define THIS_MODULE_NAME	"mbcontour"
-#define THIS_MODULE_LIB		"mbgmt"
-#define THIS_MODULE_PURPOSE	"Plot swath bathymetry, amplitude, or backscatter"
-#define THIS_MODULE_KEYS	""
-
-/* GMT5 header file */
-#include "gmt_dev.h"
-
-#define GMT_PROG_OPTIONS "->BJKOPRUVXY" GMT_OPT("S")
-
-/* MBIO include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_define.h"
-#include "mb_aux.h"
-
-EXTERN_MSC int GMT_mbcontour(void *API, int mode, void *args);
-
-/* Control structure for mbcontour */
-struct MBCONTOUR_CTRL {
-
-	struct mbcontour_A {	/* -A<cont_int>/<col_int>/<tick_int>/<label_int>/<tick_len>/<label_hgt>/<label_spacing> */
-		bool active;
-		double cont_int;
-		double col_int;
-		double tick_int;
-		double label_int;
-		double tick_len;
-		double label_hgt;
-		double label_spacing;
- 	} A;
-	struct mbcontour_b {	/* -b<year>/<month>/<day>/<hour>/<minute>/<second> */
-		bool active;
-		int time_i[7];
-	} b;
-	struct mbcontour_C {	/* -C<contourfile> */
-		bool active;
-		char *contourfile;
-	} C;
-	struct mbcontour_D {	/* -D<time_tick_int>/<time_annot_int>/<date_annot_int>/<time_tick_len> */
-		bool active;
-		double time_tick_int;
-		double time_annot_int;
-		double date_annot_int;
-		double time_tick_len;
-	} D;
-	struct mbcontour_e {	/* -e<year>/<month>/<day>/<hour>/<minute>/<second> */
-		bool active;
-		int time_i[7];
-	} e;
-	struct mbcontour_F {	/* -F<format> */
-		bool active;
-		int format;
-	} F;
-	struct mbcontour_G {	/* -G<name_hgt>/<name_perp> */
-		bool active;
-		double name_hgt;
-		int name_perp;
-	} G;
-	struct mbcontour_I {	/* -I<inputfile> */
-		bool active;
-		char *inputfile;
-	} I;
-	struct mbcontour_L {	/* -L<lonflip> */
-		bool active;
-		int lonflip;
-	} L;
-	struct mbcontour_M {	/* -M<pingnumber_tick_int>/<pingnumber_annot_int>/<pingnumber_tick_len> */
-		bool active;
-		double pingnumber_tick_int;
-		double pingnumber_annot_int;
-		double pingnumber_tick_len;
-	} M;
-	struct mbcontour_N {	/* -N<nplot> */
-		bool active;
-		int nplot;
-	} N;
-	struct mbcontour_p {	/* -p<pings> */
-		bool active;
-		int pings;
-	} p;
-	struct mbcontour_Q {	/* -Q */
-		bool active;
-	} Q;
-	struct mbcontour_S {	/* -S<speedmin> */
-		bool active;
-		double speedmin;
-	} S;
-	struct mbcontour_T {	/* -T<timegap> */
-		bool active;
-		double timegap;
-	} T;
-	struct mbcontour_W {	/* -W */
-		bool active;
-	} W;
-	struct mbcontour_Z {	/* -Z<algorithm> */
-		bool active;
-		int contour_algorithm;
-	} Z;
-};
-
-/*--------------------------------------------------------------------*/
-/* Global variables */
-        
-/* GMT and PSlib control */
-struct PSL_CTRL *PSL = NULL;	/* General PSL interal parameters */
-struct GMT_CTRL *GMT = NULL;	/* General GMT interal parameters */
-
-/* pen variables */
-int	ncolor;
-int	nlevel;
-double	*level = NULL;
-int	*red = NULL;
-int	*green = NULL;
-int	*blue = NULL;
-int	*label = NULL;
-int	*tick = NULL;
-
-/* inch to map scale */
-double	inchtolon;
-
-/* line plotting variables */
-#define MBCONTOUR_PLOT_ALLOC_INC        1024
-#define MBCONTOUR_PLOT_MOVE 	3
-#define MBCONTOUR_PLOT_DRAW 	2
-#define MBCONTOUR_PLOT_STROKE   -2
-#define MBCONTOUR_PLOT_OR 	-3
-int     ncontour_plot = 0;
-int     ncontour_plot_alloc = 0;
-double  *contour_x = NULL;
-double  *contour_y = NULL;
-
-void *New_mbcontour_Ctrl (struct GMT_CTRL *GMT);
-void Free_mbcontour_Ctrl (struct GMT_CTRL *GMT, struct MBCONTOUR_CTRL *Ctrl);
-int GMT_mbcontour_usage (struct GMTAPI_CTRL *API, int level);
-int GMT_mbcontour_parse (struct GMT_CTRL *GMT, struct MBCONTOUR_CTRL *Ctrl, struct GMT_OPTION *options);
-
-int mbcontour_ping_copy(int verbose, int one, int two, struct swath *swath, int *error);
-void mbcontour_plot(double x, double y, int ipen);
-void mbcontour_setline(int linewidth);
-void mbcontour_newpen(int ipen);
-void mbcontour_justify_string(double height, char *string, double *s);
-void mbcontour_plot_string(double x, double y, double hgt, double angle, char *label);
-
-static char svn_id[] = "$Id: mbcontour.c 2247 2015-05-29 21:28:28Z caress $";
-
-/*--------------------------------------------------------------------*/
-
-void *New_mbcontour_Ctrl (struct GMT_CTRL *GMT) {	/* Allocate and initialize a new control structure */
-	struct MBCONTOUR_CTRL *Ctrl;
-        int     status;
-        int     verbose = 0;
-        double  dummybounds[4];
-        int     dummyformat;
-        int     dummypings;
-
-	Ctrl = GMT_memory (GMT, NULL, 1, struct MBCONTOUR_CTRL);
-
-	/* Initialize values whose defaults are not 0/false/NULL */
-
-	/* get current mb default values */
-	status = mb_defaults(verbose, &dummyformat, &dummypings, &Ctrl->L.lonflip, dummybounds,
-	                     Ctrl->b.time_i, Ctrl->e.time_i, &Ctrl->S.speedmin, &Ctrl->T.timegap);
-
-	Ctrl->A.active = MB_NO;
-	Ctrl->A.cont_int = 25.;
-	Ctrl->A.col_int = 100.;
-	Ctrl->A.tick_int = 100.;
-	Ctrl->A.label_int = 100.;
-	Ctrl->A.tick_len = 0.05;
-	Ctrl->A.label_hgt = 0.1;
-	Ctrl->A.label_spacing = 0.0;
-	Ctrl->b.active = MB_NO;
-	Ctrl->C.active = MB_NO;
-	Ctrl->C.contourfile = NULL;
-	Ctrl->D.active = MB_NO;
-	Ctrl->D.time_tick_int = 0.25;
-	Ctrl->D.time_annot_int = 1.0;
-	Ctrl->D.date_annot_int = 4.0;
-	Ctrl->D.time_tick_len = 0.1;
-	Ctrl->e.active = MB_NO;
-	Ctrl->F.active = MB_NO;
-	Ctrl->F.format = 0;
-	Ctrl->G.active = MB_NO;
-	Ctrl->G.name_hgt = 0.1;
-	Ctrl->G.name_perp = MB_NO;
-	Ctrl->I.active = MB_NO;
-	Ctrl->I.inputfile = NULL;
-	Ctrl->L.active = MB_NO;
-	Ctrl->M.active = MB_NO;
-	Ctrl->M.pingnumber_tick_int = 50;
-	Ctrl->M.pingnumber_annot_int = 100;
-	Ctrl->M.pingnumber_tick_len = 0.1;
-	Ctrl->N.active = MB_NO;
-	Ctrl->N.nplot = 0;
-	Ctrl->Q.active = MB_NO;
-	Ctrl->S.active = MB_NO;
-	Ctrl->T.active = MB_NO;
-	Ctrl->W.active = MB_NO;
-	Ctrl->Z.active = MB_NO;
-	Ctrl->Z.contour_algorithm = MB_CONTOUR_OLD;
-
-	return (Ctrl);
-}
-
-void Free_mbcontour_Ctrl (struct GMT_CTRL *GMT, struct MBCONTOUR_CTRL *Ctrl) {	/* Deallocate control structure */
-	if (!Ctrl) return;
-	if (Ctrl->C.contourfile) free (Ctrl->C.contourfile);
-	if (Ctrl->I.inputfile) free (Ctrl->I.inputfile);
-	GMT_free (GMT, Ctrl);
-}
-
-int GMT_mbcontour_usage (struct GMTAPI_CTRL *API, int level)
-{
-//	char help_message[] =  "mbcontour is a GMT compatible utility which creates a color postscript \nimage of swath bathymetry or backscatter data.  The image \nmay be shaded relief as well.  Complete maps are made by using \nMBCONTOUR in conjunction with the usual GMT programs.";
-//	char usage_message[] = "mbcontour -Ccptfile -Jparameters -Rwest/east/south/north \n\t[-Afactor -Btickinfo -byr/mon/day/hour/min/sec \n\t-ccopies -Dmode/ampscale/ampmin/ampmax \n\t-Eyr/mon/day/hour/min/sec -fformat \n\t-Fred/green/blue -Gmagnitude/azimuth -Idatalist \n\t-K -Ncptfile -O -P -ppings -Qdpi -Ttimegap -U -W -Xx-shift -Yy-shift \n\t-Zmode[F] -V -H]";
-
-	GMT_show_name_and_purpose (API, THIS_MODULE_LIB, THIS_MODULE_NAME, THIS_MODULE_PURPOSE);
-	if (level == GMT_MODULE_PURPOSE) return (GMT_NOERROR);
-	GMT_Message (API, GMT_TIME_NONE, "usage: mbcontour -I<inputfile> %s [%s]\n", GMT_J_OPT, GMT_B_OPT);
-	GMT_Message (API, GMT_TIME_NONE, "\t[-A<factor>/<mode>/<depth>]\n");
-	GMT_Message (API, GMT_TIME_NONE, "\t[-b<year>/<month>/<day>/<hour>/<minute>/<second>]\n");
-	GMT_Message (API, GMT_TIME_NONE, "\t[-C<cptfile>] [-D<mode>/<ampscale>/<ampmin>/<ampmax>] [-Ei|<dpi>]\n");
-	GMT_Message (API, GMT_TIME_NONE, "\t[-e<year>/<month>/<day>/<hour>/<minute>/<second>]\n");
-	GMT_Message (API, GMT_TIME_NONE, "\t[-F<format>] [-G<magnitude>/<azimuth | median>]\n");
-	GMT_Message (API, GMT_TIME_NONE, "\t[-I<inputfile>] [-L<lonflip>] [-N<cptfile>]\n");
-	GMT_Message (API, GMT_TIME_NONE, "\t[-S<speed>] [-T<timegap>] [-W] [-Z<mode>]\n");
-	GMT_Message (API, GMT_TIME_NONE, "\t[%s] [-T] [%s] [%s]\n", GMT_Rgeo_OPT, GMT_U_OPT, GMT_V_OPT);
-	GMT_Message (API, GMT_TIME_NONE, "\t[%s] [%s] [%s] [%s]\n\t[%s]\n\t[%s] [%s]\n\n", 
-	                                  GMT_X_OPT, GMT_Y_OPT, GMT_c_OPT, GMT_f_OPT, GMT_n_OPT, GMT_p_OPT, GMT_t_OPT);
-
-	if (level == GMT_SYNOPSIS) return (EXIT_FAILURE);
-
-	GMT_Message (API, GMT_TIME_NONE, "\t<inputfile> is an MB-System datalist referencing the swath data to be plotted.\n");
-	GMT_Option (API, "J-");
-	GMT_Message (API, GMT_TIME_NONE, "\n\tOPTIONS:\n");
-	GMT_Option (API, "B-");
-	GMT_Message (API, GMT_TIME_NONE, "\t-C Contour file. Defines contour levels, style, and colors.\n");
-	GMT_Message (API, GMT_TIME_NONE, "\t   to automatically assign 16 continuous colors over the data range [rainbow].\n");
-	GMT_Message (API, GMT_TIME_NONE, "\t-E Set dpi for the projected output Postscript image\n");
-	GMT_Message (API, GMT_TIME_NONE, "\t   if -Jx or -Jm is not selected.\n");
-	GMT_Message (API, GMT_TIME_NONE, "\t   Give i to do the interpolation in PostScript at device resolution.\n");
-	GMT_rgb_syntax (API->GMT, 'G', "Set transparency color for images that otherwise would result in 1-bit images.\n\t  ");
-	GMT_Option (API, "K");
-	GMT_Option (API, "O,P");
-	GMT_Message (API, GMT_TIME_NONE, "\t-p<pings> Sets the ping averaging of the input data [Default = 1, i.e. no ping average].\n");
-	GMT_Option (API, "R");
-	GMT_Option (API, "U,V,X,c,.");
-
-	return (EXIT_FAILURE);
-}
-
-int GMT_mbcontour_parse (struct GMT_CTRL *GMT, struct MBCONTOUR_CTRL *Ctrl, struct GMT_OPTION *options)
-{
-	/* This parses the options provided to mbcontour and sets parameters in Ctrl.
-	 * Note Ctrl has already been initialized and non-zero default values set.
-	 * Any GMT common options will override values set previously by other commands.
-	 * It also replaces any file names specified as input or output with the data ID
-	 * returned when registering these sources/destinations with the API.
-	 */
-
-	unsigned int n_errors = 0, n_files = 0;
-	int    n;
-	struct GMT_OPTION *opt = NULL;
-	struct GMTAPI_CTRL *API = GMT->parent;
-
-	for (opt = options; opt; opt = opt->next) {	/* Process all the options given */
-
-		switch (opt->option) {
-			case '<':	/* Input file (only one or three is accepted) */
-				Ctrl->I.active = true;
-#if GMT_MINOR_VERSION == 1 && GMT_RELEASE_VERSION < 2
-				if (GMT_check_filearg (GMT, '<', opt->arg, GMT_IN)) {
-#else
-				if (GMT_check_filearg (GMT, '<', opt->arg, GMT_IN, GMT_IS_DATASET)) {
-#endif
-					Ctrl->I.inputfile = strdup (opt->arg);
-					n_files = 1;
-				}
-				else {
-					GMT_Report (API, GMT_MSG_NORMAL, "Syntax error: only one input file is allowed.\n");
-					n_errors++;
-				}
-				break;
-
-			/* Processes program-specific parameters */
-
-			case 'A':	/* contour controls */
-				n = sscanf(opt->arg, "%lf/%lf/%lf/%lf/%lf/%lf/%lf",
-				           &(Ctrl->A.cont_int), &(Ctrl->A.col_int), &(Ctrl->A.tick_int),
-				           &(Ctrl->A.label_int), &(Ctrl->A.tick_len), &(Ctrl->A.label_hgt),
-				           &(Ctrl->A.label_spacing));
-				if (n > 0)
-					Ctrl->A.active = true;
-				else {
-					GMT_Report (API, GMT_MSG_NORMAL, "Syntax error -A option: \n");
-					n_errors++;
-				}
- 				break;
-			case 'b':	/* btime_i */
-				n = sscanf(opt->arg, "%d/%d/%d/%d/%d/%d",
-				           &(Ctrl->b.time_i[0]), &(Ctrl->b.time_i[1]), &(Ctrl->b.time_i[2]),
-				           &(Ctrl->b.time_i[3]), &(Ctrl->b.time_i[4]), &(Ctrl->b.time_i[5]));
-				Ctrl->b.time_i[6] = 0;
-				if (n == 6)
-					Ctrl->b.active = true;
-				else {
-					GMT_Report (API, GMT_MSG_NORMAL, "Syntax error -b option: \n");
-					n_errors++;
-				}
-				break;
-			case 'C':	/* contour file */
-				Ctrl->C.active = true;
-				if (Ctrl->C.contourfile) free (Ctrl->C.contourfile);
-				Ctrl->C.contourfile = strdup (opt->arg);
-				break;
-			case 'D':	/* track annotation */
-				n = sscanf(opt->arg, "%lf/%lf/%lf/%lf",
-				           &(Ctrl->D.time_tick_int), &(Ctrl->D.time_annot_int),
-				           &(Ctrl->D.date_annot_int), &(Ctrl->D.time_tick_len));
-				if (n > 0)
-					Ctrl->D.active = true;
-				else {
-					GMT_Report (API, GMT_MSG_NORMAL, "Syntax error -D option: \n");
-					n_errors++;
-				}
- 				break;
-			case 'e':	/* etime_i */
-				n = sscanf(opt->arg, "%d/%d/%d/%d/%d/%d",
-				           &(Ctrl->e.time_i[0]), &(Ctrl->e.time_i[1]), &(Ctrl->e.time_i[2]),
-				           &(Ctrl->e.time_i[3]), &(Ctrl->e.time_i[4]), &(Ctrl->e.time_i[5]));
-				Ctrl->e.time_i[6] = 0;
-				if (n == 6)
-					Ctrl->e.active = true;
-				else {
-					GMT_Report (API, GMT_MSG_NORMAL, "Syntax error -e option: \n");
-					n_errors++;
-				}
-				break;
-			case 'f':	/* format */
-			case 'F':	/* format */
-				n = sscanf(opt->arg, "%d", &(Ctrl->F.format));
-				if (n == 1)
-					Ctrl->F.active = true;
-				else {
-					GMT_Report (API, GMT_MSG_NORMAL, "Syntax error -F option: \n");
-					n_errors++;
-				}
-				break;
-			case 'G':	/* file annotation */
-				n = sscanf(opt->arg, "%lf/%d", &(Ctrl->G.name_hgt), &(Ctrl->G.name_perp));
-				if (n == 2)
-					Ctrl->G.active = true;
-				else if (n == 1) {
-					Ctrl->G.active = true;
-					Ctrl->G.name_perp = false;
-				}
-				else {
-					GMT_Report (API, GMT_MSG_NORMAL, "Syntax error -G option: \n");
-					n_errors++;
-				}
-				break;
-
-			case 'I':	/* -I<inputfile> */
-				Ctrl->I.active = true;
-				if (!GMT_access (GMT, opt->arg, R_OK)) {	/* Got a file */
-					Ctrl->I.inputfile = strdup (opt->arg);
-					n_files = 1;
-				}
-				else {
-					GMT_Report (API, GMT_MSG_NORMAL, "Syntax error -I: Requires a valid file\n");
-					n_errors++;
-				}
-				break;
-			case 'L':	/* -L<lonflip> */
-				n = sscanf(opt->arg, "%d", &(Ctrl->L.lonflip));
-				if (n == 1)
-					Ctrl->L.active = true;
-				else {
-					GMT_Report (API, GMT_MSG_NORMAL, "Syntax error -L option: \n");
-					n_errors++;
-				}
-				break;
-			case 'M':	/* ping number annotation */
-				n = sscanf(opt->arg, "%lf/%lf/%lf",
-				           &(Ctrl->M.pingnumber_tick_int), &(Ctrl->M.pingnumber_annot_int),
-				           &(Ctrl->M.pingnumber_tick_len));
-				if (n > 0)
-					Ctrl->M.active = true;
-				else {
-					GMT_Report (API, GMT_MSG_NORMAL, "Syntax error -M option: \n");
-					n_errors++;
-				}
- 				break;
-			case 'N':	/* nplot */
-				n = sscanf(opt->arg, "%d", &(Ctrl->N.nplot));
-				if (n > 0)
-					Ctrl->N.active = true;
-				else {
-					GMT_Report (API, GMT_MSG_NORMAL, "Syntax error -N option: \n");
-					n_errors++;
-				}
- 				break;
-			case 'p':	/* Sets the ping averaging */
-				Ctrl->p.active = true;
-				Ctrl->p.pings = atoi(opt->arg);
-				if (Ctrl->p.pings < 0) {
-					GMT_Report (API, GMT_MSG_NORMAL, "Error -p option: Don't invent, number of pings must be >= 0\n");
-					Ctrl->p.pings = 1;
-				}
- 				break;
-			case 'Q':	/* plot triangles */
-				Ctrl->Q.active = true;
- 				break;
-			case 'S':	/* -S<speed> */
-				n = sscanf(opt->arg, "%lf", &(Ctrl->S.speedmin));
-				if (n == 1)
-					Ctrl->S.active = true;
-				else {
-					GMT_Report (API, GMT_MSG_NORMAL, "Syntax error -S option: \n");
-					n_errors++;
-				}
-				break;
-			case 'T':	/* -T<timegap> */
-				n = sscanf(opt->arg, "%lf", &(Ctrl->T.timegap));
-				if (n == 1)
-					Ctrl->T.active = true;
-				else {
-					GMT_Report (API, GMT_MSG_NORMAL, "Syntax error -T option: \n");
-					n_errors++;
-				}
-				break;
-			case 'W':	/* -W */
-				Ctrl->W.active = true;
-				break;
-			case 'Z':	/* contour algorithm */
-				n = sscanf(opt->arg, "%d", &(Ctrl->Z.contour_algorithm));
-				if (n == 1)
-					Ctrl->Z.active = true;
-				else {
-					GMT_Report (API, GMT_MSG_NORMAL, "Syntax error -Z option: \n");
-					n_errors++;
-				}
-				break;
-			default:	/* Report bad options */
-				n_errors += GMT_default_error (GMT, opt->option);
-				break;
-		}
-	}
-
-	n_errors += GMT_check_condition (GMT, !GMT->common.R.active, "Syntax error: Must specify -R option\n");
-	n_errors += GMT_check_condition (GMT, !GMT->common.J.active,
-	                                 "Syntax error: Must specify a map projection with the -J option\n");
-	n_errors += GMT_check_condition (GMT, n_files != 1, "Syntax error: Must specify one input file(s)\n");
-	n_errors += GMT_check_condition (GMT, Ctrl->I.active && !Ctrl->I.inputfile, 
-	                                 "Syntax error -I option: Must specify input file\n");
-
-	return (n_errors ? GMT_PARSE_ERROR : GMT_OK);
-}
-
-#define bailout(code) {GMT_Free_Options (mode); return (code);}
-#define Return(code) {Free_mbcontour_Ctrl (GMT, Ctrl); GMT_end_module (GMT, GMT_cpy); bailout (code);}
-
-int GMT_mbcontour (void *V_API, int mode, void *args)
-{
-
-	char program_name[] = "mbcontour";
-
-	struct GMT_PALETTE *CPTcolor = NULL;
-	struct GMT_CTRL *GMT_cpy = NULL;	/* General GMT interal parameters */
-	struct GMT_OPTION *options = NULL;
-	struct GMTAPI_CTRL *API = GMT_get_API_ptr (V_API);	/* Cast from void to GMTAPI_CTRL pointer */
-	struct MBCONTOUR_CTRL *Ctrl = NULL;
-
-	/* MBIO status variables */
-	int	status = MB_SUCCESS;
-	int	verbose = 0;
-	int	error = MB_ERROR_NO_ERROR;
-	char	*message = NULL;
-
-	/* MBIO read control parameters */
-	mb_path	read_file;
-	int     read_datalist = MB_NO;
-	int	read_data = MB_NO;
-	void	*datalist;
-	int	look_processed = MB_DATALIST_LOOK_UNSET;
-	double	file_weight;
-	FILE	*fp;
-	int	format;
-	int	pings;
-	int	lonflip;
-	int	lonflip_set = MB_NO;
-	double	bounds[4];
-	int	btime_i[7];
-	int	etime_i[7];
-	double	btime_d;
-	double	etime_d;
-	double	speedmin;
-	double	timegap;
-	mb_path	file;
-	int	file_in_bounds = MB_NO;
-	int	beams_bath;
-	int	beams_amp;
-	int	pixels_ss;
-	void	*mbio_ptr = NULL;
-
-	/* mbio read values */
-	struct swath *swath_plot = NULL;
-	struct ping *pingcur = NULL;
-	int	kind;
-	int	pings_read;
-	int	time_i[7];
-	double	time_d;
-	double	navlon;
-	double	navlat;
-	double	speed;
-	double	heading;
-	double	distance;
-	double	altitude;
-	double	sonardepth;
-	char	*beamflag = NULL;
-	double	*bath = NULL;
-	double	*bathlon = NULL;
-	double	*bathlat = NULL;
-	double	*amp = NULL;
-	double	*ss = NULL;
-	double	*sslon = NULL;
-	double	*sslat = NULL;
-	mb_path	comment;
-	int	pingnumber;
-
-	/* plot control variables */
-	int	contour_algorithm = MB_CONTOUR_OLD;
-	char	contourfile[MB_PATH_MAXLINE];
-	int	plot;
-	int	done;
-	int	flush;
-	int	save_new;
-	int	*npings = NULL;
-	int	nping_read;
-	int	nplot = 0;
-	int	plot_contours = MB_NO;
-	int	plot_triangles = MB_NO;
-	int	set_contours = MB_NO;
-	double	cont_int;
-	double	col_int;
-	double	tick_int;
-	double	label_int;
-	double	tick_len;
-	double	label_hgt;
-	double	label_spacing;
-	double	tick_len_map;
-	double	label_hgt_map;
-	double	label_spacing_map;
-	int 	plot_name = MB_NO;
-	int	plotted_name = MB_NO;
-	int	plot_track = MB_NO;
-	double	time_tick_int;
-	double	time_annot_int;
-	double	date_annot_int;
-	double	time_tick_len;
-	double	time_tick_len_map;
-	double	name_hgt;
-	double	name_hgt_map;
-	int	name_perp = MB_NO;
-	int	bathy_in_feet = MB_NO;
-	int	plot_pingnumber = MB_NO;
-	int	pingnumber_tick_int = 50;
-	int	pingnumber_annot_int = 100;
-	double	pingnumber_tick_len = 0.1;
-	double	pingnumber_tick_len_map;
-
-	/* other variables */
-	mb_path	line;
-	mb_path	labelstr, tickstr;
-	int	count;
-	int	setcolors;
-	double	navlon_old;
-	double	navlat_old;
-	double  clipx[4], clipy[4];
-	int	i;
-
-	/*----------------------- Standard module initialization and parsing ----------------------*/
-
-	if (API == NULL) return (GMT_NOT_A_SESSION);
-	if (mode == GMT_MODULE_PURPOSE) return (GMT_mbcontour_usage (API, GMT_MODULE_PURPOSE));	/* Return the purpose of program */
-	options = GMT_Create_Options (API, mode, args);	if (API->error) return (API->error);	/* Set or get option list */
-
-	if (!options || options->option == GMT_OPT_USAGE) bailout (GMT_mbcontour_usage (API, GMT_USAGE));	/* Return the usage message */
-	if (options->option == GMT_OPT_SYNOPSIS) bailout (GMT_mbcontour_usage (API, GMT_SYNOPSIS));	/* Return the synopsis */
-
-	/* Parse the command-line arguments */
-
-	GMT = GMT_begin_module (API, THIS_MODULE_LIB, THIS_MODULE_NAME, &GMT_cpy); /* Save current state */
-	if (GMT_Parse_Common (API, GMT_PROG_OPTIONS, options)) {
-		fprintf(stderr,"Error from GMT_Parse_common():%d\n",API->error);
-		Return (API->error);
-	}
-               
-	Ctrl = (struct MBCONTOUR_CTRL *) New_mbcontour_Ctrl (GMT);	/* Allocate and initialize a new control structure */
-	if ((error = GMT_mbcontour_parse (GMT, Ctrl, options))) {
-		fprintf(stderr,"Error from GMT_mbcontour_parse():%d\n",error);
-		Return (error);
-	}
-
-	/*-------------------------------- Variable initialization --------------------------------*/
-
-	/* get current mb default values */
-	status = mb_defaults(verbose,&format,&pings,&lonflip,bounds,
-		btime_i,etime_i,&speedmin,&timegap);
-
-	if (Ctrl->p.active) pings = Ctrl->p.pings;		/* If pings were set by user, prefer it */
-
-	/* set default input to datalist.mb-1 */
-	strcpy (read_file, "datalist.mb-1");
-                        
-        /* set modes */
-        if (Ctrl->A.active)
-            {
-            plot_contours = MB_YES;
-            cont_int = Ctrl->A.cont_int;
-            col_int = Ctrl->A.col_int;
-            tick_int = Ctrl->A.tick_int;
-            label_int = Ctrl->A.label_int;
-            tick_len = Ctrl->A.tick_len;
-            label_hgt = Ctrl->A.label_hgt;
-            label_spacing = Ctrl->A.label_spacing;
-            }
-        if (Ctrl->b.active)
-            {
-            for (i=0;i<7;i++)
-                btime_i[i] = Ctrl->b.time_i[i];
-            }
-        if (Ctrl->C.active)
-            {
-            plot_contours = MB_YES;
-            set_contours = MB_YES;
-            strcpy(contourfile, Ctrl->C.contourfile);
-            }
-        if (Ctrl->D.active)
-            {
-            plot_track = MB_YES;
-            time_tick_int = Ctrl->D.time_tick_int;
-            time_annot_int = Ctrl->D.time_annot_int;
-            date_annot_int = Ctrl->D.date_annot_int;
-            time_tick_len = Ctrl->D.time_tick_len;
-            }
-        if (Ctrl->e.active)
-            {
-            for (i=0;i<7;i++)
-                etime_i[i] = Ctrl->e.time_i[i];
-            }
-        if (Ctrl->F.active)
-            format = Ctrl->F.format;
-        if (Ctrl->G.active)
-            {
-            plot_name = MB_YES;
-            name_hgt = Ctrl->G.name_hgt;
-            name_perp = Ctrl->G.name_perp;
-            }
-        if (Ctrl->I.active)
-            {
-            strcpy(read_file, Ctrl->I.inputfile);
-            }
-        if (Ctrl->L.active)
-            {
-            lonflip_set = MB_YES;
-            lonflip = Ctrl->L.lonflip;
-            }
-        if (Ctrl->M.active)
-            {
-            plot_pingnumber = MB_YES;
-            pingnumber_tick_int  = (int)Ctrl->M.pingnumber_tick_int;
-            pingnumber_annot_int = (int)Ctrl->M.pingnumber_annot_int;
-            pingnumber_tick_len  = Ctrl->M.pingnumber_tick_len;
-            }
-        if (Ctrl->N.active)
-                nplot = Ctrl->N.nplot;
-        if (Ctrl->Q.active)
-                plot_triangles = MB_YES;
-        if (Ctrl->S.active)
-                speedmin = Ctrl->S.speedmin;
-        if (Ctrl->T.active)
-                timegap = Ctrl->T.timegap;
-        if (Ctrl->W.active)
-                bathy_in_feet = MB_YES;
-        if (Ctrl->Z.active)
-                contour_algorithm = Ctrl->Z.contour_algorithm;
-        
-        /* set verbosity */
-        verbose = GMT->common.V.active;
-
-	/* set number of pings to be plotted if not set */
-	if (nplot == 0 && contour_algorithm == MB_CONTOUR_TRIANGLES)
-		nplot = 5;
-	else if (nplot == 0)
-		nplot = 50;
-
-	/* if nothing set to be plotted, plot contours and track */
-	if (plot_contours == MB_NO && plot_triangles == MB_NO
-		&& plot_track == MB_NO && plot_pingnumber == MB_NO)
-		{
-		plot_contours = MB_YES;
-		plot_track = MB_YES;
-		}
-	if (plot_name == MB_YES && plot_track == MB_NO
-		&& plot_pingnumber == MB_NO)
-		{
-		plot_track = MB_YES;
-		}
-	if (plot_track == MB_NO
-		&& plot_pingnumber == MB_YES)
-		{
-		plot_track = MB_YES;
-		time_tick_int = 10000000.0;
-		time_annot_int = 10000000.0;
-		date_annot_int = 10000000.0;
-		}
-
-	/* print starting message */
-	if (verbose == 1)
-		{
-		fprintf(stderr,"\nProgram %s\n",program_name);
-		fprintf(stderr,"Version %s\n",svn_id);
-		fprintf(stderr,"MB-system Version %s\n",MB_VERSION);
-		}
-
-	/*---------------------------- This is the mbcontour main code ----------------------------*/
-
-	/* read contours from file */
-	if (set_contours == MB_YES)
-		{
-		/* open contour file */
-		if ((fp = fopen(contourfile,"r")) == NULL)
-			{
-			error = MB_ERROR_OPEN_FAIL;
-			fprintf(stderr,"\nUnable to open contour file: %s\n",
-				contourfile);
-			fprintf(stderr,"\nProgram <%s> Terminated\n",
-				program_name);
-			exit(error);
-			}
-
-		/* count lines in file */
-		nlevel = 0;
-		while (fgets(line,MB_PATH_MAXLINE,fp) != NULL)
-			nlevel++;
-		fclose(fp);
-
-		/* set number of colors equal to levels */
-		ncolor = nlevel;
-
-		/* allocate memory */
-		status = mb_mallocd(verbose, __FILE__, __LINE__, nlevel*sizeof(double), (void **)&level,&error);
-		status = mb_mallocd(verbose, __FILE__, __LINE__, nlevel*sizeof(int), (void **)&label,&error);
-		status = mb_mallocd(verbose, __FILE__, __LINE__, nlevel*sizeof(int), (void **)&tick,&error);
-		status = mb_mallocd(verbose, __FILE__, __LINE__, ncolor*sizeof(int), (void **)&red,&error);
-		status = mb_mallocd(verbose, __FILE__, __LINE__, ncolor*sizeof(int), (void **)&green,&error);
-		status = mb_mallocd(verbose, __FILE__, __LINE__, ncolor*sizeof(int), (void **)&blue,&error);
-
-		/* reopen contour file */
-		if ((fp = fopen(contourfile,"r")) == NULL)
-			{
-			error = MB_ERROR_OPEN_FAIL;
-			fprintf(stderr,"\nUnable to open contour file: %s\n",
-				contourfile);
-			fprintf(stderr,"\nProgram <%s> Terminated\n",
-				program_name);
-			exit(error);
-			}
-
-		/* read contour levels from file */
-		nlevel = 0;
-		while (fgets(line,MB_PATH_MAXLINE,fp) != NULL)
-			{
-			count = sscanf(line,"%lf %s %s %d %d %d",
-				&level[nlevel],labelstr,tickstr,
-				&red[nlevel],&green[nlevel],&blue[nlevel]);
-			setcolors = MB_YES;
-			if (count >= 2 && labelstr[0] == 'a')
-				label[nlevel] = 1;
-			else if (count >= 2 && labelstr[0] == 'n')
-				label[nlevel] = 0;
-			else
-				{
-				label[nlevel] = 0;
-				setcolors = MB_NO;
-				}
-			if (count >= 3 && tickstr[0] == 't')
-				tick[nlevel] = 1;
-			else if (count >= 3 && tickstr[0] == 'n')
-				tick[nlevel] = 0;
-			else
-				{
-				tick[nlevel] = 0;
-				setcolors = MB_NO;
-				}
-			if (count < 6 || setcolors == MB_NO)
-				{
-				red[nlevel] = 0;
-				green[nlevel] = 0;
-				blue[nlevel] = 0;
-				}
-			if (count > 0) nlevel++;
-			}
-		fclose(fp);
-		}
-
-	/* else set default colors and use contour intervals */
-	else
-		{
-		/* set defaults */
-		nlevel = 0;
-		ncolor = 4;
-
-		/* allocate memory */
-		status = mb_mallocd(verbose, __FILE__, __LINE__, ncolor*sizeof(int), (void **)&red,&error);
-		status = mb_mallocd(verbose, __FILE__, __LINE__, ncolor*sizeof(int), (void **)&green,&error);
-		status = mb_mallocd(verbose, __FILE__, __LINE__, ncolor*sizeof(int), (void **)&blue,&error);
-
-		/* set colors */
-		red[0] =   0; green[0] =   0; blue[0] =   0; /* black */
-		red[1] = 255; green[1] =   0; blue[1] =   0; /* red */
-		red[2] =   0; green[2] = 200; blue[2] =   0; /* green */
-		red[3] =   0; green[3] =   0; blue[3] = 255; /* blue */
-		}
-
-	/* set colors */
-	mb_set_colors(ncolor,red,green,blue);
-
-        /* set bounds for data reading larger than map borders */
-	bounds[0] = GMT->common.R.wesn[0]
-		- 0.25*(GMT->common.R.wesn[1] - GMT->common.R.wesn[0]);
-	bounds[1] = GMT->common.R.wesn[1]
-		+ 0.25*(GMT->common.R.wesn[1] - GMT->common.R.wesn[0]);
-	bounds[2] = GMT->common.R.wesn[2]
-		- 0.25*(GMT->common.R.wesn[3] - GMT->common.R.wesn[2]);
-	bounds[3] = GMT->common.R.wesn[3]
-		+ 0.25*(GMT->common.R.wesn[3] - GMT->common.R.wesn[2]);
-
-//	/* get scaling from degrees to km */
-//	mb_coor_scale(verbose, 0.5*(bounds[2] + bounds[3]), &mtodeglon, &mtodeglat);
-
-	/* set lonflip if possible */
-	if (lonflip_set == MB_NO)
-		{
-		if (bounds[0] < -180.0)
-			lonflip = -1;
-		else if (bounds[1] > 180.0)
-			lonflip = 1;
-		else if (lonflip == -1 && bounds[1] > 0.0)
-			lonflip = 0;
-		else if (lonflip == 1 && bounds[0] < 0.0)
-			lonflip = 0;
-		}
-
-	/* Start the postscript plot */
-	GMT_err_fail (GMT, GMT_map_setup (GMT, GMT->common.R.wesn), "");
-	PSL = GMT_plotinit (GMT, options);
-	GMT_plane_perspective (GMT, GMT->current.proj.z_project.view_plane, GMT->current.proj.z_level);
-	GMT_plotcanvas (GMT);	/* Fill canvas if requested */
-	GMT_map_clip_on (GMT, GMT->session.no_rgb, 3);
-                
-        /* Set particulars of output image for the postscript plot */
-	GMT_geo_to_xy(GMT, GMT->common.R.wesn[0], GMT->common.R.wesn[2], &clipx[0], &clipy[0]);
-	GMT_geo_to_xy(GMT, GMT->common.R.wesn[1], GMT->common.R.wesn[2], &clipx[1], &clipy[1]);
-	GMT_geo_to_xy(GMT, GMT->common.R.wesn[1], GMT->common.R.wesn[3], &clipx[2], &clipy[2]);
-	GMT_geo_to_xy(GMT, GMT->common.R.wesn[0], GMT->common.R.wesn[3], &clipx[3], &clipy[3]);
-//	x_inch = clipx[1] - clipx[0];
-//	y_inch = clipy[2] - clipy[1];
-//	x0 = GMT->common.R.wesn[0];
-//	y0 = GMT->common.R.wesn[2];
-        inchtolon = (GMT->common.R.wesn[1] - GMT->common.R.wesn[0]) / (clipx[1] - clipx[0]);
-        
-	/* scale label and tick sizes */
-	label_hgt_map = inchtolon * label_hgt;
-	label_spacing_map = inchtolon * label_spacing;
-	tick_len_map = inchtolon * tick_len;
-	time_tick_len_map = inchtolon * time_tick_len;
-	name_hgt_map = inchtolon * name_hgt;
-	pingnumber_tick_len_map = inchtolon * pingnumber_tick_len;
-
-	/* get format if required */
-	if (format == 0)
-		mb_get_format(verbose, read_file, NULL, &format, &error);
-
-	/* determine whether to read one file or a list of files */
-	if (format < 0)
-		read_datalist = MB_YES;
-
-	/* open file list */
-	nping_read = 0;
-	if (read_datalist == MB_YES)
-	    {
-	    if ((status = mb_datalist_open(verbose,&datalist,
-					    read_file,look_processed,&error)) != MB_SUCCESS)
-		{
-		error = MB_ERROR_OPEN_FAIL;
-		fprintf(stderr,"\nUnable to open data list file: %s\n",
-			read_file);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-	    if ((status = mb_datalist_read(verbose,datalist,
-			    file,&format,&file_weight,&error))
-			    == MB_SUCCESS)
-		read_data = MB_YES;
-	    else
-		read_data = MB_NO;
-	    }
-	else
-	    {
-	    strcpy(file,read_file);
-	    read_data = MB_YES;
-	    }
-
-	/* loop over files in file list */
-	if (verbose == 1)
-		fprintf(stderr,"\n");
-	while (read_data == MB_YES)
-	    {
-	    /* check for mbinfo file - get file bounds if possible */
-	    status = mb_check_info(verbose, file, lonflip, bounds,
-			    &file_in_bounds, &error);
-	    if (status == MB_FAILURE)
-		    {
-		    file_in_bounds = MB_YES;
-		    status = MB_SUCCESS;
-		    error = MB_ERROR_NO_ERROR;
-		    }
-
-	    /* read if data may be in bounds */
-	    if (file_in_bounds == MB_YES)
-		{
-		/* check for "fast bathymetry" or "fbt" file */
-		if (plot_contours == MB_YES)
-		    {
-		    mb_get_fbt(verbose, file, &format, &error);
-		    }
-
-		/* else check for "fast nav" or "fnv" file */
-		else if (plot_track == MB_YES || plot_pingnumber == MB_YES)
-		    {
-		    mb_get_fnv(verbose, file, &format, &error);
-		    }
-
-		/* call mb_read_init() */
-		if ((status = mb_read_init(
-		    verbose,file,format,pings,lonflip,bounds,
-		    btime_i,etime_i,speedmin,timegap,
-		    &mbio_ptr,&btime_d,&etime_d,
-		    &beams_bath,&beams_amp,&pixels_ss,&error)) != MB_SUCCESS)
-		    {
-		    mb_error(verbose,error,&message);
-		    fprintf(stderr,"\nMBIO Error returned from function <mb_read_init>:\n%s\n",message);
-		    fprintf(stderr,"\nMultibeam File <%s> not initialized for reading\n",file);
-		    fprintf(stderr,"\nProgram <%s> Terminated\n",
-			    program_name);
-		    exit(error);
-		    }
-
-		/* allocate memory for data arrays */
-		if (error == MB_ERROR_NO_ERROR)
-		    status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						    sizeof(char), (void **)&beamflag, &error);
-		if (error == MB_ERROR_NO_ERROR)
-		    status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						    sizeof(double), (void **)&bath, &error);
-		if (error == MB_ERROR_NO_ERROR)
-		    status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_AMPLITUDE,
-						    sizeof(double), (void **)&amp, &error);
-		if (error == MB_ERROR_NO_ERROR)
-		    status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						    sizeof(double), (void **)&bathlon, &error);
-		if (error == MB_ERROR_NO_ERROR)
-		    status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						    sizeof(double), (void **)&bathlat, &error);
-		if (error == MB_ERROR_NO_ERROR)
-		    status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_SIDESCAN,
-						    sizeof(double), (void **)&ss, &error);
-		if (error == MB_ERROR_NO_ERROR)
-		    status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_SIDESCAN,
-						    sizeof(double), (void **)&sslon, &error);
-		if (error == MB_ERROR_NO_ERROR)
-		    status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_SIDESCAN,
-						    sizeof(double), (void **)&sslat, &error);
-
-		/* if error initializing memory then quit */
-		if (error != MB_ERROR_NO_ERROR)
-		    {
-		    mb_error(verbose,error,&message);
-		    fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",message);
-		    fprintf(stderr,"\nProgram <%s> Terminated\n",
-			    program_name);
-		    exit(error);
-		    }
-
-		/* initialize contour controls */
-		status = mb_contour_init(verbose,&swath_plot,nplot,beams_bath,
-				    contour_algorithm,
-				    plot_contours,plot_triangles,
-				    plot_track,plot_name,plot_pingnumber,
-				    cont_int,col_int,tick_int,label_int,
-				    tick_len_map,label_hgt_map,label_spacing_map,
-				    ncolor,nlevel,level,label,tick,
-				    time_tick_int,time_annot_int,
-				    date_annot_int,time_tick_len_map,name_hgt_map,
-				    pingnumber_tick_int,pingnumber_annot_int,
-				    pingnumber_tick_len_map,
-                                    &mbcontour_plot,
-                                    &mbcontour_newpen,
-                                    &mbcontour_setline,
-                                    &mbcontour_justify_string,
-                                    &mbcontour_plot_string,
-				    &error);
-		swath_plot->beams_bath = beams_bath;
-
-		/* if error initializing memory then quit */
-		if (error != MB_ERROR_NO_ERROR)
-		    {
-		    mb_error(verbose,error,&message);
-		    fprintf(stderr,"\nMBIO Error allocating contour control structure:\n%s\n",message);
-		    fprintf(stderr,"\nProgram <%s> Terminated\n",
-			    program_name);
-		    exit(error);
-		    }
-
-		/* print message */
-		if (verbose >= 2)
-		    fprintf(stderr,"\n");
-		if (verbose >= 1)
-		    fprintf(stderr,"processing data in %s...\n",file);
-
-		/* loop over reading */
-		npings = &swath_plot->npings;
-		*npings = 0;
-		done = MB_NO;
-		plotted_name = MB_NO;
-		while (done == MB_NO)
-		    {
-		    /* read the next ping */
-		    status = mb_read(verbose,mbio_ptr,&kind,
-			    &pings_read,time_i,&time_d,
-			    &navlon,&navlat,
-			    &speed,&heading,
-			    &distance,&altitude,&sonardepth,
-			    &beams_bath,&beams_amp,&pixels_ss,
-			    beamflag,bath,amp,bathlon,bathlat,
-			    ss,sslon,sslat,
-			    comment,&error);
-
-		    /* get pingnumber */
-		    if (status == MB_SUCCESS)
-		    	{
-		    	status = mb_pingnumber(verbose,mbio_ptr,&pingnumber,&error);
-			}
-
-		    /* copy data to swath_plot */
-		    if (status == MB_SUCCESS || error == MB_ERROR_TIME_GAP)
-		    	{
-		        pingcur = &swath_plot->pings[*npings];
-
-			/* make sure enough memory is allocated */
-			if (pingcur->beams_bath_alloc < beams_bath)
-				{
-				status = mb_reallocd(verbose, __FILE__, __LINE__, beams_bath*sizeof(char),
-						(void **)&(pingcur->beamflag),&error);
-				status = mb_reallocd(verbose, __FILE__, __LINE__, beams_bath*sizeof(double),
-						(void **)&(pingcur->bath),&error);
-				status = mb_reallocd(verbose, __FILE__, __LINE__, beams_bath*sizeof(double),
-						(void **)&(pingcur->bathlon),&error);
-				status = mb_reallocd(verbose, __FILE__, __LINE__, beams_bath*sizeof(double),
-						(void **)&(pingcur->bathlat),&error);
-                                status = mb_reallocd(verbose,__FILE__,__LINE__,beams_bath*sizeof(int),
-                                                (void **)&(pingcur->bflag[0]),&error);
-                                status = mb_reallocd(verbose,__FILE__,__LINE__,beams_bath*sizeof(int),
-                                                (void **)&(pingcur->bflag[1]),&error);
-				pingcur->beams_bath_alloc = beams_bath;
-				}
-
-			/* insert the data */
-			for (i=0;i<7;i++)
-				pingcur->time_i[i] = time_i[i];
-			pingcur->time_d = time_d;
-			pingcur->navlon = navlon;
-			pingcur->navlat = navlat;
-			pingcur->heading = heading;
-			pingcur->beams_bath = beams_bath;
-			pingcur->pingnumber = pingnumber;
-			for (i=0;i<beams_bath;i++)
-				{
-				pingcur->beamflag[i] = beamflag[i];
-				pingcur->bath[i] = bath[i];
-				pingcur->bathlon[i] = bathlon[i];
-				pingcur->bathlat[i] = bathlat[i];
-                                pingcur->bflag[0][i] = 0;
-                                pingcur->bflag[1][i] = 0;
-				}
-			}
-
-		    /* null out any unused beams for formats with
-			variable numbers of beams */
-		    for (i=beams_bath;i<swath_plot->beams_bath;i++)
-			    beamflag[i] = MB_FLAG_NULL;
-
-		    /* print debug statements */
-		    if (verbose >= 2)
-			    {
-			    fprintf(stderr,"\ndbg2  Ping read in program <%s>\n",
-				    program_name);
-			    fprintf(stderr,"dbg2       kind:           %d\n",
-				    kind);
-			    fprintf(stderr,"dbg2       npings:         %d\n",
-				    *npings);
-			    fprintf(stderr,"dbg2       time:           %4d %2d %2d %2d %2d %2d %6.6d\n",
-				    time_i[0],time_i[1],time_i[2],
-				    time_i[3],time_i[4],time_i[5],time_i[6]);
-			    fprintf(stderr,"dbg2       navigation:     %f  %f\n",
-				    navlon, navlat);
-			    fprintf(stderr,"dbg2       beams_bath:     %d\n",
-				    beams_bath);
-			    fprintf(stderr,"dbg2       beams_amp:      %d\n",
-					    beams_amp);
-			    fprintf(stderr,"dbg2       pixels_ss:      %d\n",
-					    pixels_ss);
-			    fprintf(stderr,"dbg2       error:          %d\n",
-				    error);
-			    fprintf(stderr,"dbg2       status:         %d\n",
-				    status);
-			    }
-
-		    /* scale bathymetry if necessary */
-		    if (error == MB_ERROR_NO_ERROR
-			    && bathy_in_feet == MB_YES)
-			    {
-			    for (i=0;i<beams_bath;i++)
-				    {
-				    bath[i] = 3.2808399 * bath[i];
-				    }
-			    }
-
-		    /* update bookkeeping */
-		    if (error == MB_ERROR_NO_ERROR)
-			    {
-                            nping_read += pings_read;
-                            (*npings)++;
-                            navlon_old = navlon;
-                            navlat_old = navlat;
-			    }
-
-		    /* decide whether to plot, whether to
-			    save the new ping, and if done */
-		    plot = MB_NO;
-		    flush = MB_NO;
-		    if (*npings >= nplot)
-			    plot = MB_YES;
-		    if (*npings > 0
-			    && (error > MB_ERROR_NO_ERROR
-			    || error == MB_ERROR_TIME_GAP
-			    || error == MB_ERROR_OUT_BOUNDS
-			    || error == MB_ERROR_OUT_TIME
-			    || error == MB_ERROR_SPEED_TOO_SMALL))
-			    {
-			    plot = MB_YES;
-			    flush = MB_YES;
-			    }
-		    save_new = MB_NO;
-		    if (error == MB_ERROR_TIME_GAP)
-			    save_new = MB_YES;
-		    if (error > MB_ERROR_NO_ERROR)
-			    done = MB_YES;
-
-		    /* if enough pings read in, plot them */
-		    if (plot == MB_YES)
-			    {
-
-			    /* print debug statements */
-			    if (verbose >= 2)
-				    {
-				    fprintf(stderr,"\ndbg2  Plotting %d pings in program <%s>\n",
-					    *npings,program_name);
-				    for (i=0;i<*npings;i++)
-					    {
-					    pingcur = &swath_plot->pings[i];
-					    fprintf(stderr,"dbg2       %4d  %4d %2d %2d %2d %2d %2d %6.6d\n",
-						    i,pingcur->time_i[0],
-						    pingcur->time_i[1],
-						    pingcur->time_i[2],
-						    pingcur->time_i[3],
-						    pingcur->time_i[4],
-						    pingcur->time_i[5],
-						    pingcur->time_i[6]);
-					    }
-				    }
-
-			    /* plot data */
-			    if (plot_contours == MB_YES
-				    || plot_triangles == MB_YES)
-				    mb_contour(verbose,swath_plot,&error);
-
-			    /* plot nav track */
-			    if (plot_track == MB_YES)
-				    mb_track(verbose,swath_plot,&error);
-
-			    /* annotate pingnumber */
-			    if (plot_pingnumber == MB_YES)
-			    	    {
-				    mb_trackpingnumber(verbose,swath_plot,&error);
-				    }
-
-			    if (plot_name == MB_YES && plotted_name == MB_NO)
-			    	    {
-				    mb_trackname(verbose,name_perp,swath_plot,file,&error);
-				    plotted_name = MB_YES;
-				    }
-
-			    /* reorganize data */
-			    if (flush == MB_YES && save_new == MB_YES)
-				    {
-				    status = mbcontour_ping_copy(verbose,0,*npings,
-					    swath_plot,&error);
-				    *npings = 1;
-				    }
-			    else if (flush == MB_YES)
-				    {
-				    *npings = 0;
-				    }
-			    else if (*npings > 1)
-				    {
-				    status = mbcontour_ping_copy(verbose,0,*npings-1,
-						    swath_plot,&error);
-				    *npings = 1;
-				    }
-			    }
-		    }
-		status = mb_close(verbose,&mbio_ptr,&error);
-
-		/* deallocate memory for data arrays */
-		status = mb_contour_deall(verbose,swath_plot,&error);
-		} /* end if file in bounds */
-
-	    /* figure out whether and what to read next */
-	    if (read_datalist == MB_YES)
-                {
-		if ((status = mb_datalist_read(verbose,datalist,
-			    file,&format,&file_weight,&error))
-			    == MB_SUCCESS)
-                        read_data = MB_YES;
-                else
-                        read_data = MB_NO;
-                }
-	    else
-                {
-                read_data = MB_NO;
-                }
-
-	    /* end loop over files in list */
-	    }
-	if (read_datalist == MB_YES)
-		mb_datalist_close(verbose,&datalist,&error);
-
-	GMT_map_clip_off (GMT);
-
-	GMT_map_basemap (GMT);
-	GMT_plane_perspective (GMT, -1, 0.0);
-	GMT_plotend (GMT);
-
-	/* deallocate memory for data arrays */
-	mb_freed(verbose,__FILE__, __LINE__, (void **)&level,&error);
-	mb_freed(verbose,__FILE__, __LINE__, (void **)&label,&error);
-	mb_freed(verbose,__FILE__, __LINE__, (void **)&tick,&error);
-	mb_freed(verbose,__FILE__, __LINE__, (void **)&red,&error);
-	mb_freed(verbose,__FILE__, __LINE__, (void **)&green,&error);
-	mb_freed(verbose,__FILE__, __LINE__, (void **)&blue,&error);
-
-	/* print ending info */
-	if (verbose >= 1)
-		fprintf(stderr,"\n%d pings read and plotted\n",
-			nping_read);
-
-	/* check memory */
-	if (verbose >= 2)
-		status = mb_memory_list(verbose,&error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  Program <%s> completed\n",
-			program_name);
-		fprintf(stderr,"dbg2  Ending status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	if (!Ctrl->C.active && GMT_Destroy_Data (API, &CPTcolor) != GMT_OK)
-                {
-		Return (API->error);
-                }
-	Return (EXIT_SUCCESS);
-}
-
-/*--------------------------------------------------------------------------*/
-int mbcontour_ping_copy(int verbose, int one, int two, struct swath *swath, int *error)
-{
-	char	*function_name = "mbcontour_ping_copy";
-	int	status = MB_SUCCESS;
-
-	struct ping	*ping1;
-	struct ping	*ping2;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBCONTOUR function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       one:        %d\n",one);
-		fprintf(stderr,"dbg2       two:        %d\n",two);
-		fprintf(stderr,"dbg2       swath:      %lu\n",(size_t)swath);
-		fprintf(stderr,"dbg2       pings:      %d\n",swath->npings);
-                fprintf(stderr,"dbg2       time_i[two]:%4d  %4d %2d %2d %2d %2d %2d %6.6d\n",
-                                                two,swath->pings[two].time_i[0],
-                                                swath->pings[two].time_i[1],
-                                                swath->pings[two].time_i[2],
-                                                swath->pings[two].time_i[3],
-                                                swath->pings[two].time_i[4],
-                                                swath->pings[two].time_i[5],
-                                                swath->pings[two].time_i[6]);
-		}
-
-	/* get ping structures */
-	ping1 = &swath->pings[one];
-	ping2 = &swath->pings[two];
-
-	/* make sure enough memory is allocated */
-        if (ping1->beams_bath_alloc < ping2->beams_bath)
-                {
-                status = mb_reallocd(verbose, __FILE__, __LINE__, ping2->beams_bath*sizeof(char),
-                                (void **)&(ping1->beamflag),error);
-                status = mb_reallocd(verbose, __FILE__, __LINE__, ping2->beams_bath*sizeof(double),
-                                (void **)&(ping1->bath),error);
-                status = mb_reallocd(verbose, __FILE__, __LINE__, ping2->beams_bath*sizeof(double),
-                                (void **)&(ping1->bathlon),error);
-                status = mb_reallocd(verbose, __FILE__, __LINE__, ping2->beams_bath*sizeof(double),
-                                (void **)&(ping1->bathlat),error);
-                status = mb_reallocd(verbose, __FILE__, __LINE__, ping2->beams_bath*sizeof(int),
-                                (void **)&(ping1->bflag[0]),error);
-                status = mb_reallocd(verbose, __FILE__, __LINE__, ping2->beams_bath*sizeof(int),
-                                (void **)&(ping1->bflag[1]),error);
-                ping1->beams_bath_alloc = ping2->beams_bath;
-                }
-
-	/* copy things */
-	for (i=0;i<7;i++)
-		ping1->time_i[i] = ping2->time_i[i];
-	ping1->time_d = ping2->time_d;
-	ping1->navlon = ping2->navlon;
-	ping1->navlat = ping2->navlat;
-	ping1->heading = ping2->heading;
-        ping1->pingnumber = ping2->pingnumber;
-        ping1->beams_bath = ping2->beams_bath;
-	for (i=0;i<ping2->beams_bath;i++)
-		{
-		ping1->beamflag[i] = ping2->beamflag[i];
-		ping1->bath[i] = ping2->bath[i];
-		ping1->bathlon[i] = ping2->bathlon[i];
-		ping1->bathlat[i] = ping2->bathlat[i];
-                ping1->bflag[0][i] = ping2->bflag[1][i];
-		}
-
-	/* assume success */
-	*error = MB_ERROR_NO_ERROR;
-	status = MB_SUCCESS;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBCONTOUR function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------------*/
-void mb_set_colors(int ncolor, int *red, int *green, int *blue)
-{
-	return;
-}
-/*--------------------------------------------------------------------------*/
-void mbcontour_plot(double x, double y, int ipen)
-{
-	double	xx, yy;
-
-        /* make sure contour arrays are large enough */
-	if (ncontour_plot >= ncontour_plot_alloc)
-	    {
-	    ncontour_plot_alloc += MBCONTOUR_PLOT_ALLOC_INC;
-	    contour_x = (double *) realloc(contour_x,
-			sizeof(double) * (ncontour_plot_alloc));
-	    contour_y = (double *) realloc(contour_y,
-			sizeof(double) * (ncontour_plot_alloc));
-	    if (contour_x == NULL)
-		ncontour_plot_alloc = 0;
-	    }
-            
-        /* convert to map units */
-        GMT_geo_to_xy(GMT, x, y, &xx, &yy);
-        
-        /* if command is move then start new contour */
-        if (ipen == MBCONTOUR_PLOT_MOVE)
-            {
-            ncontour_plot = 0;
-            contour_x[ncontour_plot] = xx;
-            contour_y[ncontour_plot] = yy;
-            ncontour_plot++;
-            }
-            
-        /* else if command is to draw then add the point to the list */
-        else if (ipen == MBCONTOUR_PLOT_DRAW)
-            {
-            contour_x[ncontour_plot] = xx;
-            contour_y[ncontour_plot] = yy;
-            ncontour_plot++;
-            }
-            
-        /* else if command is to areokw then add the point to the list
-            and call PSL_plotline() */
-        else if (ipen == MBCONTOUR_PLOT_STROKE)
-            {
-            contour_x[ncontour_plot] = xx;
-            contour_y[ncontour_plot] = yy;
-            ncontour_plot++;
-
-            PSL_plotline(PSL, contour_x, contour_y, ncontour_plot, PSL_MOVE + PSL_STROKE);
-            
-            ncontour_plot = 0;
-            }
-
-	return;
-}
-/*--------------------------------------------------------------------------*/
-void mbcontour_setline(int linewidth)
-{
-        //PSL_setlinewidth(PSL, (double)linewidth);
-        return;
-}
-/*--------------------------------------------------------------------------*/
-void mbcontour_newpen(int ipen)
-{
-	double rgb[4];
-	rgb[3] = 0;		/* To not fall into the transparency case of pslib.c/psl_putcolor()  */
-        
-	if (ipen > -1 && ipen < ncolor)
-		{
-		rgb[0] = ((double)red[ipen]) / 255.0;
-		rgb[1] = ((double)green[ipen]) / 255.0;
-		rgb[2] = ((double)blue[ipen]) / 255.0;
-                PSL_setcolor(PSL, rgb, PSL_IS_STROKE);
-		}
-	return;
-}
-/*--------------------------------------------------------------------------*/
-void mbcontour_justify_string(double height, char *string, double *s)
-{
-	int	len;
-
-	len = strlen(string);
-	s[0] = 0.0;
-	s[1] = 0.185*height*len;
-	s[2] = 0.37*len*height;
-	s[3] = 0.37*len*height;
-
-	return;
-}
-/*--------------------------------------------------------------------------*/
-void mbcontour_plot_string(double x, double y, double hgt, double angle, char *label)
-{
-	double	fontsize;
-	double	xx, yy;
-        int     justify = 5;
-        int     mode = 0;
-
-	fontsize = 72.0 * hgt / inchtolon;
-	GMT_geo_to_xy(GMT, x, y, &xx, &yy);
-        PSL_plottext (PSL, xx, yy, fontsize, label, angle, justify, mode);
-	return;
-}
-/*--------------------------------------------------------------------------*/
diff --git a/src/gmt/mbgrdtiff.c b/src/gmt/mbgrdtiff.c
deleted file mode 100644
index 6085419..0000000
--- a/src/gmt/mbgrdtiff.c
+++ /dev/null
@@ -1,1548 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbgrdtiff.c	5/30/93
- *    $Id: mbgrdtiff.c 2247 2015-05-29 21:28:28Z caress $
- *
- *    Copyright (c) 1999-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- *    mbgrdtiff generates a TIFF image from a GMT grid. The
- *    image generation is similar to that of the GMT program
- *    grdimage. In particular, the color map is applied from
- *    a GMT CPT file, and shading overlay grids may be applied.
- *    The output TIFF file contains information allowing
- *    the ArcView and ArcInfo GIS packages to import the image
- *    as a geographically located coverage. The image is 8 bits
- *    per pixel if the color map is a grayscale, and 24 bits
- *    per pixel otherwise.
- */
-/*--------------------------------------------------------------------*/
-/*
- * The geotiff file variant produced by mbgrdtiff
- * has the structure given below. The image width in
- * pixels is denoted as nx and the image height as ny.
- * The images may be grayscale (1 byte per pixel) or
- * color (3 rgb bytes per pixel).
- *
- *    Byte  Size  Value      Meaning
- *    -----------------------------------------------------------------
- *
- *           ------- Header --------
- *
- *      0    2     'MM'      Big-endian byte order used in this file
- *      2    2      42       Tiff identifier
- *      4    4      8        Byte offset of image file directory (IFD)
- *
- *           ------- IFD -----------
- *
- *      8    2      18       Number of entries in IFD
- *
- *     10    2      254      Tag:   NewSubfileType
- *     12    2      4        Type:  long (4 byte unsigned int)
- *     14    4      1        Count: one value
- *     18    4      0        Value: basic image, nothing fancy
- *
- *     22    2      256      Tag:   ImageWidth
- *     24    2      4        Type:  long (4 byte unsigned int)
- *     26    4      1        Count: one value
- *     30    4      nx       Value: image width in pixels
- *
- *     34    2      257      Tag:   ImageLength
- *     36    2      4        Type:  long (4 byte unsigned int)
- *     38    4      1        Count: one value
- *     42    4      ny       Value: image length (height) in pixels
- *
- *     46    2      258      Tag:   BitsPerSample
- *     48    2      3        Type:  short (2 byte unsigned int)
- *                           Color case:
- *     50    4      3          Count: one value for each of r,g,b (8,8,8)
- *     54    4      256        Value: offset to three BitsPerSample values
- *                           Grayscale case:
- *     50    4      1          Count: one value for grayscale
- *     54    4      8          Value: one byte per sample
- *
- *     58    2      259      Tag:   Compression
- *     60    2      3        Type:  short (2 byte unsigned int)
- *     62    4      1        Count: one value
- *     66    4      1        Value: no compression
- *
- *     70    2      262      Tag:   PhotometricInterpretation
- *     72    2      3        Type:  short (2 byte unsigned int)
- *     74    4      1        Count: one value
- *     78    4      2        Value: RGB image
- *
- *     82    2      273      Tag:   StripOffsets
- *     84    2      4        Type:  long (4 byte unsigned int)
- *     86    4      1        Count: entire image is one strip
- *     90    4      512      Value: offset to image data
- *
- *     94    2      277      Tag:   SamplesPerPixel
- *     96    2      3        Type:  short (2 byte unsigned int)
- *     98    4      1        Count: one value
- *    102    4      3        Value: 3 samples per pixel for RGB
- *
- *    106    2      278      Tag:   RowsPerStrip
- *    108    2      4        Type:  long (4 byte unsigned int)
- *    110    4      1        Count: one value
- *    114    4      ny       Value: ImageLength value (all rows in image)
- *
- *    118    2      279      Tag:   StripByteCounts
- *    120    2      4        Type:  long (4 byte unsigned int)
- *    122    4      1        Count: one value
- *                           Color case:
- *    126    4      3*nx*ny    Value: 3 * ImageWidth * ImageLength
- *                           Grayscale case:
- *    126    4      nx*ny      Value: ImageWidth * ImageLength
- *
- *    130    2      282      Tag:   XResolution
- *    132    2      5        Type:  rational (2 ints: numerator, denominator)
- *    134    4      1        Count: one value
- *    138    4      264      Value: offset to fraction representing dpi
- *
- *    142    2      283      Tag:   YResolution
- *    144    2      4        Type:  rational (2 ints: numerator, denominator)
- *    146    4      1        Count: one value
- *    150    4      272      Value: offset to fraction representing dpi
- *
- *    154    2      296      Tag:   ResolutionUnit
- *    156    2      3        Type:  short (2 byte unsigned int)
- *    158    4      1        Count: one value
- *    162    4      2        Value: Inches
- *
- *    166    2      33550    Tag:   ModelPixelScaleTag
- *    168    2      12       Type:  double (IEEE double precision)
- *    170    4      3        Count: 3 for scalex,scaley,scalez where scalez=0
- *    174    4      280      Value: offset to values
- *
- *    178    2      33922    Tag:   ModelTiepointTag
- *    180    2      12       Type:  double (IEEE double precision)
- *    182    4      6        Count: 6 for i,j,k,x,y,z where k=z=0
- *    186    4      304      Value: offset to values
- *
- *    190    2      34735    Tag:   GeoKeyDirectoryTag
- *    192    2      3        Type:  short (2 byte unsigned int)
- *    194    4      20       Count: 20
- *    198    4      352      Value: offset to values
- *
- *    190    2      34736    Tag:   GeoDoubleParamsTag
- *    192    2      3        Type:  double (IEEE double precision)
- *    194    4      ndouble  Count: ndouble
- *    198    4      400      Value: offset to values
- *
- *    190    2      34737    Tag:   GeoAsciiParamsTag
- *    192    2      2        Type:  ASCII
- *    194    4      nascii   Count: nascii
- *    198    4      448      Value: offset to values
- *
- *           ------- Values --------
- *
- *    256    2      8        BitsPerSample R (Color case only)
- *    258    2      8        BitsPerSample G (Color case only)
- *    260    2      8        BitsPerSample B (Color case only)
- *
- *    264    4      nx       XResolution numerator (ImageWidth)
- *    268    4      4        XResolution denominator (4 inches)
- *
- *    272    4      nx       YResolution numerator (ImageWidth)
- *    276    4      4        YResolution denominator (4 inches)
- *
- *    280    8      scalex   ModelPixelScaleTag scalex
- *    288    8      scaley   ModelPixelScaleTag scaley
- *    296    8      scalez   ModelPixelScaleTag scalez
- *
- *    ------- If GTModelTypeGeoKey = ModelTypeGeographic then:
- *        304    8      0        ModelTiePointTag i
- *        312    8      0        ModelTiePointTag j
- *        320    8      0        ModelTiePointTag k
- *        328    8      minlon   ModelTiePointTag minimum longitude
- *        336    8      maxlat   ModelTiePointTag minimum latitude
- *        344    8      0        ModelTiePointTag minimum z
- *
- *    ------- Else if GTModelTypeGeoKey = ModelTypeProjected then:
- *        304    8      0        ModelTiePointTag i
- *        312    8      0        ModelTiePointTag j
- *        320    8      0        ModelTiePointTag k
- *        328    8      minX     ModelTiePointTag minimum easting
- *        336    8      maxY     ModelTiePointTag minimum northing
- *        344    8      0        ModelTiePointTag minimum z
- *
- *    352    2      1        GeoKeyDirectoryTag KeyDirectoryVersion
- *    354    2      0        GeoKeyDirectoryTag KeyRevision
- *    356    2      2        GeoKeyDirectoryTag MinorRevision
- *    358    2      4        GeoKeyDirectoryTag NumberOfKeys
- *
- *    360    2      1024     GeoKeyDirectoryTag KeyId: GTModelTypeGeoKey
- *    362    2      0        GeoKeyDirectoryTag TiffTagLocation
- *    364    2      1        GeoKeyDirectoryTag Count
- *    366    2      1        GeoKeyDirectoryTag ModelType Value (ModelTypeProjected=1, ModelTypeGeographic=2)
- *
- *    368    2      1025     GeoKeyDirectoryTag KeyId: GTRasterTypeGeoKey
- *    370    2      0        GeoKeyDirectoryTag TiffTagLocation
- *    372    2      1        GeoKeyDirectoryTag Count
- *    374    2      2        GeoKeyDirectoryTag RasterType Value (RasterPixelIsArea=1, RasterPixelIsPoint=2)
- *
- *    368    2      1026     GeoKeyDirectoryTag KeyId: GTCitationGeoKey
- *    370    2      34737    GeoKeyDirectoryTag TiffTagLocation
- *    372    2      nascii   GeoKeyDirectoryTag Count
- *    374    2      0        GeoKeyDirectoryTag Value_Offset
- *
- *    ------- If GTModelTypeGeoKey = ModelTypeGeographic then:
- *        376    2      2048     GeoKeyDirectoryTag KeyId: GeographicTypeGeoKey
- *        378    2      0        GeoKeyDirectoryTag TiffTagLocation
- *        380    2      1        GeoKeyDirectoryTag Count
- *        382    2      4030     GeoKeyDirectoryTag GeographicType Value (GCSE_WGS84=4030)
- *
- *    ------- Else if GTModelTypeGeoKey = ModelTypeProjected then:
- *        376    2      3072     GeoKeyDirectoryTag KeyId: ProjectedCSTypeGeoKey
- *        378    2      0        GeoKeyDirectoryTag TiffTagLocation
- *        380    2      1        GeoKeyDirectoryTag Count
- *        382    2      32660    GeoKeyDirectoryTag ProjectedCSType Value (PCS_WGS84_UTM_zone_60N=32660)
- *
- *    400    8      ndouble  GeoDoubleParamsTag
- *
- *    448    8      nascii   GeoAsciiParamsTag
- *
- *           ------- Image ---------
- *
- *    512    3*nx*ny         Image in RGB bytes
- *
- *
- */
-/*--------------------------------------------------------------------*/
-
-/* MBIO include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_define.h"
-
-/* TIFF 6.0 and geoTIFF tag array */
-#define TIFF_HEADER_SIZE 1024
-#define IMAGE_OFFSET TIFF_HEADER_SIZE
-#define TIFF_COMMENT_MAXLINE 64
-#define NUMBER_TAGS 18
-#define NewSubfileType             254
-#define ImageWidth                 256
-#define ImageLength                257
-#define BitsPerSample              258
-#define Compression                259
-#define PhotometricInterpretation  262
-#define StripOffsets               273
-#define SamplesPerPixel            277
-#define RowsPerStrip               278
-#define StripByteCounts            279
-#define XResolution                282
-#define YResolution                283
-#define ResolutionUnit             296
-#define ModelPixelScaleTag       33550
-#define ModelTiepointTag         33922
-#define GeoKeyDirectoryTag       34735
-#define GeoDoubleParamsTag       34736
-#define GeoAsciiParamsTag        34737
-#define GTModelTypeGeoKey         1024
-#define GTRasterTypeGeoKey        1025
-#define GTCitationGeoKey          1026
-#define GeographicTypeGeoKey      2048
-#define ProjectedCSTypeGeoKey     3072
-
-#define RasterPixelIsArea	     1
-#define RasterPixelIsPoint	     2
-#define ModelTypeProjected	     1
-#define ModelTypeGeographic	     2
-#define GCS_WGS_84		  4326
-
-unsigned short   tiff_tag[] =
-                      { NewSubfileType,
-			ImageWidth,
-			ImageLength,
-			BitsPerSample,
-			Compression,
-			PhotometricInterpretation,
-			StripOffsets,
-			SamplesPerPixel,
-			RowsPerStrip,
-			StripByteCounts,
-			XResolution,
-			YResolution,
-			ResolutionUnit,
-		        ModelPixelScaleTag,
-		        ModelTiepointTag,
-			GeoKeyDirectoryTag,
-			GeoDoubleParamsTag,
-			GeoAsciiParamsTag
-		      };
-unsigned short   tiff_type[] =
-                      {   4,      /* NewSubfileType */
-			  4,      /* ImageWidth */
-			  4,      /* ImageLength */
-			  3,      /* BitsPerSample */
-			  3,      /* Compression */
-			  3,      /* PhotometricInterpretation */
-			  4,      /* StripOffsets */
-			  3,      /* SamplesPerPixel */
-			  4,      /* RowsPerStrip */
-			  4,      /* StripByteCounts */
-			  5,      /* XResolution */
-			  5,      /* YResolution */
-			  3,      /* ResolutionUnit */
-			 12,      /* ModelPixelScaleTag */
-			 12,      /* ModelTiepointTag */
-			  3,      /* GeoKeyDirectoryTag */
-			 12,      /* GeoDoubleParamsTag */
-			  2       /* GeoAsciiParamsTag */
-		      };
-int              tiff_offset[] =
-                      {   0,      /* NewSubfileType */
-			  0,      /* ImageWidth */
-			  0,      /* ImageLength */
-			256,      /* BitsPerSample */
-			  0,      /* Compression */
-			  0,      /* PhotometricInterpretation */
-			  0,      /* StripOffsets */
-			  0,      /* SamplesPerPixel */
-			  0,      /* RowsPerStrip */
-			  0,      /* StripByteCounts */
-			264,      /* XResolution */
-			272,      /* YResolution */
-			  0,      /* ResolutionUnit */
-			280,      /* ModelPixelScaleTag */
-			304,      /* ModelTiepointTag */
-			352,      /* GeoKeyDirectoryTag */
-			400,      /* GeoDoubleParamsTag */
-			448       /* GeoAsciiParamsTag */
-		      };
-                      
-/*--------------------------------------------------------------------*/
-
-#define THIS_MODULE_NAME	"mbgrdtiff"
-#define THIS_MODULE_LIB		"mbgmt"
-#define THIS_MODULE_PURPOSE	"Project grids or images and plot them on maps"
-#define THIS_MODULE_KEYS	""
-
-#include "gmt_dev.h"
-
-EXTERN_MSC int GMT_mbgrdtiff(void *API, int mode, void *args);
-
-#define GMT_PROG_OPTIONS "->JRVn" GMT_OPT("S")
-
-/* Control structure for mbgrdtiff */
-struct MBGRDTIFF_CTRL {
-	struct A {	/* -A to write a GDAL file */
-		bool active;
-		char *file;
-		char *driver;
-	} A;
-	struct C {	/* -C<cptfile> */
-		bool active;
-		char *file;
-	} C;
-	struct D {	/* -D to read GDAL file */
-		bool active;
-		bool mode;	/* Use info of -R option to reference image */
-	} D;
-	struct E {	/* -Ei|<dpi> */
-		bool active;
-		bool device_dpi;
-		unsigned int dpi;
-	} E;
-	struct G {	/* -G[f|b]<rgb> */
-		bool active;
-		double f_rgb[4];
-		double b_rgb[4];
-	} G;
-	struct I {	/* -I<inputfile>> */
-		bool active;
-		bool do_rgb;
-		char *file[3];
-	} I;
-	struct Intensity {	/* -I<intensfile>|<value> */
-		bool active;
-		bool constant;
-		double value;
-		char *file;
-	} Intensity;
-	struct M {	/* -M */
-		bool active;
-	} M;
-	struct N {	/* -N */
-		bool active;
-	} N;
-	struct mbO {	/* -O */
-		bool active;
-		char *file;
-	} O;
-	struct Q {	/* -Q */
-		bool active;
-	} Q;
-};
-
-
-void *New_mbgrdtiff_Ctrl (struct GMT_CTRL *GMT);
-void Free_mbgrdtiff_Ctrl (struct GMT_CTRL *GMT, struct MBGRDTIFF_CTRL *Ctrl);
-int GMT_mbgrdtiff_usage (struct GMTAPI_CTRL *API, int level);
-int GMT_mbgrdtiff_parse (struct GMT_CTRL *GMT, struct MBGRDTIFF_CTRL *Ctrl, struct GMT_OPTION *options);
-void GMT_mbgrdtiff_set_proj_limits (struct GMT_CTRL *GMT, struct GMT_GRID_HEADER *r, struct GMT_GRID_HEADER *g, bool projected);
-
-/*--------------------------------------------------------------------*/
-
-void *New_mbgrdtiff_Ctrl (struct GMT_CTRL *GMT) {	/* Allocate and initialize a new control structure */
-	struct MBGRDTIFF_CTRL *Ctrl;
-
-	Ctrl = GMT_memory (GMT, NULL, 1, struct MBGRDTIFF_CTRL);
-
-	/* Initialize values whose defaults are not 0/false/NULL */
-
-	Ctrl->G.b_rgb[0] = Ctrl->G.b_rgb[1] = Ctrl->G.b_rgb[2] = 1.0;
-
-	return (Ctrl);
-}
-/*--------------------------------------------------------------------*/
-
-void Free_mbgrdtiff_Ctrl (struct GMT_CTRL *GMT, struct MBGRDTIFF_CTRL *Ctrl) {	/* Deallocate control structure */
-	int k;
-	if (!Ctrl) return;
-	for (k = 0; k < 3; k++) if (Ctrl->I.file[k]) free (Ctrl->I.file[k]);	
-	if (Ctrl->C.file) free (Ctrl->C.file);
-	if (Ctrl->Intensity.file) free (Ctrl->Intensity.file);
-	GMT_free (GMT, Ctrl);
-}
-/*--------------------------------------------------------------------*/
-
-int GMT_mbgrdtiff_usage (struct GMTAPI_CTRL *API, int level)
-{
-	GMT_show_name_and_purpose (API, THIS_MODULE_LIB, THIS_MODULE_NAME, THIS_MODULE_PURPOSE);
-	if (level == GMT_MODULE_PURPOSE) return (GMT_NOERROR);
-	GMT_Message (API, GMT_TIME_NONE, "usage: mbgrdtiff <grd_z>|<grd_r> <grd_g> <grd_b> %s [%s] [-C<cpt>] [-Ei[|<dpi>]]\n", GMT_J_OPT, GMT_B_OPT);
-	GMT_Message (API, GMT_TIME_NONE, "\t[-G[f|b]<rgb>] [-I<intensgrid>|<value>] [-K] [-M] [-N] [-O] [-P] [-Q]\n");
-	GMT_Message (API, GMT_TIME_NONE, "\t[%s] [-T] [%s] [%s]\n", GMT_Rgeo_OPT, GMT_U_OPT, GMT_V_OPT);
-	GMT_Message (API, GMT_TIME_NONE, "\t[%s] [%s] [%s] [%s]\n\t[%s]\n\t[%s] [%s]\n\n", 
-			GMT_X_OPT, GMT_Y_OPT, GMT_c_OPT, GMT_f_OPT, GMT_n_OPT, GMT_p_OPT, GMT_t_OPT);
-
-	if (level == GMT_SYNOPSIS) return (EXIT_FAILURE);
-
-	GMT_Message (API, GMT_TIME_NONE, "\t<grd_z> is data set to be plotted.  Its z-values are in user units and will be\n");
-	GMT_Message (API, GMT_TIME_NONE, "\t  converted to rgb colors via the cpt file.  Alternatively, give three separate\n");
-	GMT_Message (API, GMT_TIME_NONE, "\t  grid files that contain the red, green, and blue components in the 0-255 range.\n");
-	GMT_Option (API, "J-");
-	GMT_Message (API, GMT_TIME_NONE, "\n\tOPTIONS:\n");
-	GMT_Option (API, "B-");
-	GMT_Message (API, GMT_TIME_NONE, "\t-C Color palette file to convert z to rgb.  Optionally, instead give name of a master cpt\n");
-	GMT_Message (API, GMT_TIME_NONE, "\t   to automatically assign 16 continuous colors over the data range [rainbow].\n");
-	GMT_Message (API, GMT_TIME_NONE, "\t-E Set dpi for the projected grid which must be constructed [100]\n");
-	GMT_Message (API, GMT_TIME_NONE, "\t   if -Jx or -Jm is not selected [Default gives same size as input grid].\n");
-	GMT_Message (API, GMT_TIME_NONE, "\t   Give i to do the interpolation in PostScript at device resolution.\n");
-	GMT_rgb_syntax (API->GMT, 'G', "Set transparency color for images that otherwise would result in 1-bit images.\n\t  ");
-	GMT_Message (API, GMT_TIME_NONE, "\t-I Use illumination. Append name of intensity grid file.\n");
-	GMT_Message (API, GMT_TIME_NONE, "\t   For a constant intensity, just give the value instead.\n");
-	GMT_Option (API, "K");
-	GMT_Message (API, GMT_TIME_NONE, "\t-M Force monochrome image.\n");
-	GMT_Message (API, GMT_TIME_NONE, "\t-N Do not clip image at the map boundary.\n");
-	GMT_Option (API, "O,P");
-	GMT_Message (API, GMT_TIME_NONE, "\t-Q Use PS Level 3 colormasking to make nodes with z = NaN transparent.\n");
-	GMT_Option (API, "R");
-	GMT_Option (API, "U,V,X,c,n,t,.");
-
-	return (EXIT_FAILURE);
-}
-/*--------------------------------------------------------------------*/
-
-int GMT_mbgrdtiff_parse (struct GMT_CTRL *GMT, struct MBGRDTIFF_CTRL *Ctrl, struct GMT_OPTION *options)
-{
-	/* This parses the options provided to mbgrdtiff and sets parameters in Ctrl.
-	 * Note Ctrl has already been initialized and non-zero default values set.
-	 * Any GMT common options will override values set previously by other commands.
-	 * It also replaces any file names specified as input or output with the data ID
-	 * returned when registering these sources/destinations with the API.
-	 */
-
-	unsigned int n_errors = 0, n_files = 0;
-	struct GMT_OPTION *opt = NULL;
-	struct GMTAPI_CTRL *API = GMT->parent;
-
-	for (opt = options; opt; opt = opt->next) {	/* Process all the options given */
-
-		switch (opt->option) {
-			case '<':	/* Input file (only one or three is accepted) */
-				Ctrl->I.active = true;
-				if (n_files >= 3) break;
-#if GMT_MINOR_VERSION == 1 && GMT_RELEASE_VERSION < 2
-				if (GMT_check_filearg (GMT, '<', opt->arg, GMT_IN))
-#else
-				if (GMT_check_filearg (GMT, '<', opt->arg, GMT_IN, GMT_IS_DATASET))
-#endif
-					Ctrl->I.file[n_files++] = strdup (opt->arg);
-				else
-					n_errors++;
-				break;
-
-			/* Processes program-specific parameters */
-
-			case 'C':	/* CPT file */
-				Ctrl->C.active = true;
-				if (Ctrl->C.file) free (Ctrl->C.file);
-				Ctrl->C.file = strdup (opt->arg);
-				break;
-			case 'E':	/* Sets dpi */
-				Ctrl->E.active = true;
-				if (opt->arg[0] == 'i')	/* Interpolate image to device resolution */
-					Ctrl->E.device_dpi = true;
-				else if (opt->arg[0] == '\0')	
-					Ctrl->E.dpi = 100;	/* Default grid dpi */
-				else
-					Ctrl->E.dpi = atoi (opt->arg);
-				break;
-			case 'G':	/* 1-bit fore or background color for transparent masks */
-				Ctrl->G.active = true;
-				switch (opt->arg[0]) {
-					case 'F':
-					case 'f':
-						if (GMT_getrgb (GMT, &opt->arg[1], Ctrl->G.f_rgb)) {
-							GMT_rgb_syntax (GMT, 'G', " ");
-							n_errors++;
-						}
-						else
-							Ctrl->G.b_rgb[0] = -1;
-						break;
-					case 'B':
-					case 'b':
-						if (GMT_getrgb (GMT, &opt->arg[1], Ctrl->G.b_rgb)) {
-							GMT_rgb_syntax (GMT, 'G', " ");
-							n_errors++;
-						}
-						else
-							Ctrl->G.f_rgb[0] = -1;
-						break;
-					default:	/* Same as -Gf */
-						if (GMT_getrgb (GMT, opt->arg, Ctrl->G.f_rgb)) {
-							GMT_rgb_syntax (GMT, 'G', " ");
-							n_errors++;
-						}
-						else
-							Ctrl->G.b_rgb[0] = -1;
-						break;
-				}
-				break;
-			case 'I':	/* Input file (only one or three is accepted) */
-				/* if no grid file specified yet then first -Ifile sets
-				 * the primary grid file, and second -Ifile will be the
-				 * intensity file */
-				if (n_files == 0) {
-					Ctrl->I.active = true;
-					Ctrl->I.file[n_files++] = strdup (opt->arg);
-				}
-				else {
-					Ctrl->Intensity.active = true;
-					if (!GMT_access (GMT, opt->arg, R_OK))	/* Got a file */
-						Ctrl->Intensity.file = strdup (opt->arg);
-					else if (opt->arg[0] && !GMT_not_numeric (GMT, opt->arg)) {	/* Looks like a constant value */
-						Ctrl->Intensity.value = atof (opt->arg);
-						Ctrl->Intensity.constant = true;
-					}
-					else {
-						GMT_Report (API, GMT_MSG_NORMAL, "Syntax error -I: Requires a valid grid file or a constant\n");
-						n_errors++;
-					}
-				}
-				break;
-			case 'M':	/* Monochrome image */
-				Ctrl->M.active = true;
-				break;
-			case 'N':	/* Do not clip at map boundary */
-				Ctrl->N.active = true;
-				break;
-			case 'O':	/* Output file */
-				Ctrl->O.active = true;
-				Ctrl->O.file = strdup (opt->arg);
-				break;
-			case 'Q':	/* PS3 colormasking */
-				Ctrl->Q.active = true;
-				break;
-
-			default:	/* Report bad options */
-				n_errors += GMT_default_error (GMT, opt->option);
-				break;
-		}
-	}
-
-	if (n_files == 3) Ctrl->I.do_rgb = true;
-//	n_errors += GMT_check_condition (GMT, !GMT->common.J.active, 
-//					"Syntax error: Must specify a map projection with the -J option\n");
-	n_errors += GMT_check_condition (GMT, !Ctrl->C.file && !Ctrl->I.do_rgb, 
-					"Syntax error: Must specify color palette table\n");
-	n_errors += GMT_check_condition (GMT, !(n_files == 1 || n_files == 3), 
-					"Syntax error: Must specify one (or three) input file(s)\n");
-	n_errors += GMT_check_condition (GMT, Ctrl->Intensity.active && !Ctrl->Intensity.constant && !Ctrl->Intensity.file, 
-					"Syntax error -I option: Must specify intensity file or value\n");
-	n_errors += GMT_check_condition (GMT, Ctrl->E.active && !Ctrl->E.device_dpi && Ctrl->E.dpi <= 0, 
-					"Syntax error -E option: dpi must be positive\n");
-	n_errors += GMT_check_condition (GMT, Ctrl->G.f_rgb[0] < 0 && Ctrl->G.b_rgb[0] < 0, 
-					"Syntax error -G option: Only one of fore/back-ground can be transparent for 1-bit images\n");
-	n_errors += GMT_check_condition (GMT, Ctrl->M.active && Ctrl->Q.active,
-					"Syntax error -Q option:  Cannot use -M when doing colormasking\n");
-	n_errors += GMT_check_condition (GMT, !Ctrl->O.active || !Ctrl->O.file,
-					"Syntax error -O option: Must specify the output file name.\n");
-
-	return (n_errors ? GMT_PARSE_ERROR : GMT_OK);
-}
-/*--------------------------------------------------------------------*/
-
-void GMT_mbgrdtiff_set_proj_limits (struct GMT_CTRL *GMT, struct GMT_GRID_HEADER *r, struct GMT_GRID_HEADER *g, bool projected)
-{
-	/* Sets the projected extent of the grid given the map projection
-	 * The extreme x/y coordinates are returned in r, and dx/dy, and
-	 * nx/ny are set accordingly.  Not that some of these may change
-	 * if GMT_project_init is called at a later stage */
-
-	unsigned int i, k;
-	bool all_lats = false, all_lons = false;
-	double x, y;
-
-	r->nx = g->nx;	r->ny = g->ny;
-	r->registration = g->registration;
-	r->n_bands = g->n_bands;
-
-	/* By default, use entire plot region */
-
-	GMT_memcpy (r->wesn, GMT->current.proj.rect, 4, double);
-	
-	if (GMT->current.proj.projection == GMT_GENPER && GMT->current.proj.g_width != 0.0) return;
-
-	if (GMT_is_geographic (GMT, GMT_IN)) {
-		all_lats = GMT_180_RANGE (g->wesn[YHI], g->wesn[YLO]);
-		all_lons = GMT_grd_is_global (GMT, g);
-		if (all_lons && all_lats) return;	/* Whole globe */
-	}
-	
-	/* Must search for extent along perimeter */
-
-	r->wesn[XLO] = r->wesn[YLO] = +DBL_MAX;
-	r->wesn[XHI] = r->wesn[YHI] = -DBL_MAX;
-	k = (g->registration == GMT_GRID_NODE_REG) ? 1 : 0;
-	
-	for (i = 0; i < g->nx - k; i++) {	/* South and north sides */
-		GMT_geo_to_xy (GMT, g->wesn[XLO] + i * g->inc[GMT_X], g->wesn[YLO], &x, &y);
-		r->wesn[XLO] = MIN (r->wesn[XLO], x), r->wesn[XHI] = MAX (r->wesn[XHI], x);
-		r->wesn[YLO] = MIN (r->wesn[YLO], y), r->wesn[YHI] = MAX (r->wesn[YHI], y);
-		GMT_geo_to_xy (GMT, g->wesn[XHI] - i * g->inc[GMT_X], g->wesn[YHI], &x, &y);
-		r->wesn[XLO] = MIN (r->wesn[XLO], x), r->wesn[XHI] = MAX (r->wesn[XHI], x);
-		r->wesn[YLO] = MIN (r->wesn[YLO], y), r->wesn[YHI] = MAX (r->wesn[YHI], y);
-	}
-	for (i = 0; i < g->ny - k; i++) {	/* East and west sides */
-		GMT_geo_to_xy (GMT, g->wesn[XLO], g->wesn[YHI] - i * g->inc[GMT_Y], &x, &y);
-		r->wesn[XLO] = MIN (r->wesn[XLO], x), r->wesn[XHI] = MAX (r->wesn[XHI], x);
-		r->wesn[YLO] = MIN (r->wesn[YLO], y), r->wesn[YHI] = MAX (r->wesn[YHI], y);
-		GMT_geo_to_xy (GMT, g->wesn[XHI], g->wesn[YLO] + i * g->inc[GMT_Y], &x, &y);
-		r->wesn[XLO] = MIN (r->wesn[XLO], x), r->wesn[XHI] = MAX (r->wesn[XHI], x);
-		r->wesn[YLO] = MIN (r->wesn[YLO], y), r->wesn[YHI] = MAX (r->wesn[YHI], y);
-	}
-	if (projected) {
-		if (all_lons) {	/* Full 360, use min/max for x */
-			r->wesn[XLO] = GMT->current.proj.rect[XLO];	r->wesn[XHI] = GMT->current.proj.rect[XHI];
-		}
-		if (all_lats) {	/* Full -90/+90, use min/max for y */
-			r->wesn[YLO] = GMT->current.proj.rect[YLO];	r->wesn[YHI] = GMT->current.proj.rect[YHI];
-		}
-	}
-}
-/*--------------------------------------------------------------------*/
-
-#define bailout(code) {GMT_Free_Options (mode); return (code);}
-#define Return(code) {Free_mbgrdtiff_Ctrl (GMT, Ctrl); GMT_end_module (GMT, GMT_cpy); bailout (code);}
-
-int GMT_mbgrdtiff (void *V_API, int mode, void *args)
-{
-	char program_name[] = "mbgrdtiff";
-
-	/* TIFF arrays */
-        mb_path world_file;
-	size_t image_size = 0;
-	int	modeltype;
-	int	projectionid;
-        mb_path projectionname;
-	char    tiff_header[TIFF_HEADER_SIZE];
-	void    *tiff_image = NULL;
-	char	tiff_comment[TIFF_COMMENT_MAXLINE];
-	char	NorS;
-        FILE    *tfp;
-	int	nscan;
-	int	utmzone;
-        int     keyindex;
-        
-        short   value_short;
-        int     value_int;
-	double  value_double;
-        size_t  write_size;
-        int     i;
-        
-	bool done, need_to_project, normal_x, normal_y, resampled = false, gray_only = false;
-	bool nothing_inside = false, use_intensity_grid;
-	unsigned int k, nx = 0, ny = 0, grid_registration = GMT_GRID_NODE_REG, n_grids;
-	unsigned int colormask_offset = 0, try, row, actual_row, col;
-	uint64_t node_RGBA = 0;		/* uint64_t for the RGB(A) image array. */
-	uint64_t node, kk, nm, byte;
-	int index = 0, ks, error = 0;
-	int nx8, shift, b_or_w, nx_pixels, k8;
-	
-	unsigned char *bitimage_1 = NULL, *bitimage_8 = NULL, *bitimage_24 = NULL, *rgb_used = NULL, i_rgb[3];
-
-	double dx, dy, x_side, y_side, x0 = 0.0, y0 = 0.0, rgb[4] = {0.0, 0.0, 0.0, 0.0};
-	double *NaN_rgb = NULL, red[4] = {1.0, 0.0, 0.0, 0.0}, wesn[4];
-
-	struct GMT_GRID *Grid_orig[3] = {NULL, NULL, NULL}, *Grid_proj[3] = {NULL, NULL, NULL};
-	struct GMT_GRID *Intens_orig = NULL, *Intens_proj = NULL;
-	struct GMT_PALETTE *P = NULL;
-	struct MBGRDTIFF_CTRL *Ctrl = NULL;
-	struct GMT_CTRL *GMT = NULL, *GMT_cpy = NULL;	/* General GMT interal parameters */
-	struct GMT_OPTION *options = NULL;
-	struct PSL_CTRL *PSL = NULL;	/* General PSL interal parameters */
-	struct GMT_GRID_HEADER *header_work = NULL;	/* Pointer to a GMT header for the image or grid */
-	struct GMTAPI_CTRL *API = GMT_get_API_ptr (V_API);	/* Cast from void to GMTAPI_CTRL pointer */
-
-
-	/*----------------------- Standard module initialization and parsing ----------------------*/
-
-	if (API == NULL) return (GMT_NOT_A_SESSION);
-	if (mode == GMT_MODULE_PURPOSE) return (GMT_mbgrdtiff_usage (API, GMT_MODULE_PURPOSE));	/* Return the purpose of program */
-	options = GMT_Create_Options (API, mode, args);
-        if (API->error) return (API->error);	/* Set or get option list */
-
-	if (!options || options->option == GMT_OPT_USAGE) bailout (GMT_mbgrdtiff_usage (API, GMT_USAGE));	/* Return the usage message */
-	if (options->option == GMT_OPT_SYNOPSIS) bailout (GMT_mbgrdtiff_usage (API, GMT_SYNOPSIS));	/* Return the synopsis */
-
-	/* Parse the command-line arguments */
-
-	GMT = GMT_begin_module (API, THIS_MODULE_LIB, THIS_MODULE_NAME, &GMT_cpy); /* Save current state */
-	if (GMT_Parse_Common (API, GMT_PROG_OPTIONS, options)) Return (API->error);
-	Ctrl = New_mbgrdtiff_Ctrl (GMT);	/* Allocate and initialize a new control structure */
-	if ((error = GMT_mbgrdtiff_parse (GMT, Ctrl, options))) Return (error);
-
-	/*---------------------------- This is the mbgrdtiff main code ----------------------------*/
-
-	n_grids = (Ctrl->I.do_rgb) ? 3 : 1;
-	use_intensity_grid = (Ctrl->Intensity.active && !Ctrl->Intensity.constant);	/* We want to use the intensity grid */
-
-	/* Read the illumination grid header right away so we can use its region to set that of an image (if requested) */
-	if (use_intensity_grid) {	/* Illumination grid wanted */
-
-		GMT_Report (API, GMT_MSG_VERBOSE, "Allocates memory and read intensity file\n");
-
-		if ((Intens_orig = GMT_Read_Data (API, GMT_IS_GRID, GMT_IS_FILE, GMT_IS_SURFACE, GMT_GRID_HEADER_ONLY, NULL, Ctrl->Intensity.file, NULL)) == NULL) {	/* Get header only */
-			Return (API->error);
-		}
-	}
-
-	GMT_Report (API, GMT_MSG_VERBOSE, "Allocates memory and read data file\n");
-
-	if (!Ctrl->D.active) {
-		for (k = 0; k < n_grids; k++) {
-			if ((Grid_orig[k] = GMT_Read_Data (API, GMT_IS_GRID, GMT_IS_FILE, GMT_IS_SURFACE, GMT_GRID_HEADER_ONLY, NULL, Ctrl->I.file[k], NULL)) == NULL) {	/* Get header only */
-				Return (API->error);
-			}
-		}
-		if (!Ctrl->C.active) Ctrl->C.active = true;	/* Use default CPT stuff */
-	}
-
-	if (n_grids) header_work = Grid_orig[0]->header;	/* OK, we are in GRID mode and this was not set further above. Do it now */
-
-	if (n_grids && Ctrl->I.do_rgb) {	/* Must ensure all three grids are coregistered */
-		if (!GMT_grd_same_region (GMT, Grid_orig[0], Grid_orig[1])) error++;
-		if (!GMT_grd_same_region (GMT, Grid_orig[0], Grid_orig[2])) error++;
-		if (!(Grid_orig[0]->header->inc[GMT_X] == Grid_orig[1]->header->inc[GMT_X] && Grid_orig[0]->header->inc[GMT_X] == 
-			Grid_orig[2]->header->inc[GMT_X])) error++;
-		if (!(Grid_orig[0]->header->nx == Grid_orig[1]->header->nx && Grid_orig[0]->header->nx == Grid_orig[2]->header->nx)) error++;
-		if (!(Grid_orig[0]->header->ny == Grid_orig[1]->header->ny && Grid_orig[0]->header->ny == Grid_orig[2]->header->ny)) error++;
-		if (!(Grid_orig[0]->header->registration == Grid_orig[1]->header->registration && Grid_orig[0]->header->registration == 
-			Grid_orig[2]->header->registration)) error++;
-		if (error) {
-			GMT_Report (API, GMT_MSG_NORMAL, "The r, g, and b grids are not congruent\n");
-			Return (EXIT_FAILURE);
-		}
-	}
-
-	/* Determine what wesn to pass to map_setup */
-
-	if (!GMT->common.R.active && n_grids) GMT_memcpy (GMT->common.R.wesn, Grid_orig[0]->header->wesn, 4, double);
-
-	GMT_err_fail (GMT, GMT_map_setup (GMT, GMT->common.R.wesn), "");
-	
-	/* Determine if grid is to be projected */
-
-	need_to_project = (GMT_IS_NONLINEAR_GRATICULE (GMT) || Ctrl->E.dpi > 0);
-	if (need_to_project) GMT_Report (API, GMT_MSG_DEBUG, "Projected grid is non-orthogonal, nonlinear, or dpi was changed\n");
-	
-	/* Determine the wesn to be used to read the grid file; or bail if file is outside -R */
-
-	if (!GMT_grd_setregion (GMT, header_work, wesn, need_to_project * GMT->common.n.interpolant))
-		nothing_inside = true;
-	else if (use_intensity_grid && !GMT_grd_setregion (GMT, Intens_orig->header, wesn, need_to_project * GMT->common.n.interpolant))
-		nothing_inside = true;
-
-	if (nothing_inside) {
-		/* No grid to plot; just do empty map and bail */
-		PSL = GMT_plotinit (GMT, options);
-		GMT_plane_perspective (GMT, GMT->current.proj.z_project.view_plane, GMT->current.proj.z_level);
-		GMT_plotcanvas (GMT);	/* Fill canvas if requested */
-		GMT_map_basemap (GMT);
-		GMT_plane_perspective (GMT, -1, 0.0);
-		GMT_plotend (GMT);
-		Return (EXIT_SUCCESS);
-	}
-
-	if (n_grids) {
-		nx = GMT_get_n (GMT, wesn[XLO], wesn[XHI], Grid_orig[0]->header->inc[GMT_X], Grid_orig[0]->header->registration);
-		ny = GMT_get_n (GMT, wesn[YLO], wesn[YHI], Grid_orig[0]->header->inc[GMT_Y], Grid_orig[0]->header->registration);
-	}
-
-//	if (!Ctrl->A.active) {	/* Otherwise we are not writting any postscript */
-//		PSL = GMT_plotinit (GMT, options);
-//		GMT_plane_perspective (GMT, GMT->current.proj.z_project.view_plane, GMT->current.proj.z_level);
-//		GMT_plotcanvas (GMT);	/* Fill canvas if requested */
-//		if (!Ctrl->N.active) GMT_map_clip_on (GMT, GMT->session.no_rgb, 3);
-//	}
-
-	/* Read data */
-
-	for (k = 0; k < n_grids; k++) {
-		if (GMT_Read_Data (API, GMT_IS_GRID, GMT_IS_FILE, GMT_IS_SURFACE, GMT_GRID_DATA_ONLY, wesn, Ctrl->I.file[k], Grid_orig[k]) == NULL) {	/* Get grid data */
-			Return (API->error);
-		}
-	}
-	
-	/* If given, get intensity file or compute intensities */
-
-	if (use_intensity_grid) {	/* Illumination wanted */
-
-		GMT_Report (API, GMT_MSG_VERBOSE, "Allocates memory and read intensity file\n");
-
-		/* Remember, the illumination header was already read at the top */
-		if (GMT_Read_Data (API, GMT_IS_GRID, GMT_IS_FILE, GMT_IS_SURFACE, GMT_GRID_DATA_ONLY, wesn, Ctrl->Intensity.file, Intens_orig) == NULL) {
-			Return (API->error);	/* Get grid data */
-		}
-		if (n_grids && (Intens_orig->header->nx != Grid_orig[0]->header->nx || Intens_orig->header->ny != Grid_orig[0]->header->ny)) {
-			GMT_Report (API, GMT_MSG_NORMAL, "Intensity file has improper dimensions!\n");
-			Return (EXIT_FAILURE);
-		}
-
-
-	}
-
-	if (need_to_project) {	/* Need to resample the grd file */
-		int nx_proj = 0, ny_proj = 0;
-		double inc[2] = {0.0, 0.0};
-		GMT_Report (API, GMT_MSG_VERBOSE, "project grid files\n");
-
-		if (Ctrl->E.dpi == 0) {	/* Use input # of nodes as # of projected nodes */
-			nx_proj = nx;
-			ny_proj = ny;
-		}
-		for (k = 0; k < n_grids; k++) {
-			if (!Grid_proj[k] && (Grid_proj[k] = GMT_Duplicate_Data (API, GMT_IS_GRID, GMT_DUPLICATE_NONE, Grid_orig[k])) == NULL) Return (API->error);	/* Just to get a header we can change */
-					
-			GMT_mbgrdtiff_set_proj_limits (GMT, Grid_proj[k]->header, Grid_orig[k]->header, need_to_project);
-			if (grid_registration == GMT_GRID_NODE_REG)		/* Force pixel if dpi is set */
-				grid_registration = (Ctrl->E.dpi > 0) ? GMT_GRID_PIXEL_REG : Grid_orig[k]->header->registration;
-			GMT_err_fail (GMT, GMT_project_init (GMT, Grid_proj[k]->header, inc, nx_proj, ny_proj, Ctrl->E.dpi, grid_registration), Ctrl->I.file[k]);
-			GMT_set_grddim (GMT, Grid_proj[k]->header);
-			if (GMT_Create_Data (API, GMT_IS_GRID, GMT_IS_SURFACE, GMT_GRID_DATA_ONLY, NULL, NULL, NULL, 0, 0, Grid_proj[k]) == NULL) Return (API->error);
-			GMT_grd_project (GMT, Grid_orig[k], Grid_proj[k], false);
-			if (GMT_Destroy_Data (API, &Grid_orig[k]) != GMT_OK) {
-				Return (API->error);
-			}
-		}
-		if (use_intensity_grid) {
-			if ((Intens_proj = GMT_Duplicate_Data (API, GMT_IS_GRID, GMT_DUPLICATE_NONE, Intens_orig)) == NULL) Return (API->error);	/* Just to get a header we can change */
-			if (n_grids)
-				GMT_memcpy (Intens_proj->header->wesn, Grid_proj[0]->header->wesn, 4, double);
-			if (Ctrl->E.dpi == 0) {	/* Use input # of nodes as # of projected nodes */
-				nx_proj = Intens_orig->header->nx;
-				ny_proj = Intens_orig->header->ny;
-			}
-			GMT_err_fail (GMT, GMT_project_init (GMT, Intens_proj->header, inc, nx_proj, ny_proj, Ctrl->E.dpi, grid_registration), Ctrl->Intensity.file);
-			GMT_set_grddim (GMT, Intens_proj->header);
-			if (GMT_Create_Data (API, GMT_IS_GRID, GMT_IS_SURFACE, GMT_GRID_DATA_ONLY, NULL, NULL, NULL, 0, 0, Intens_proj) == NULL) Return (API->error);
-			GMT_grd_project (GMT, Intens_orig, Intens_proj, false);
-			if (GMT_Destroy_Data (API, &Intens_orig) != GMT_OK) {
-				Return (API->error);
-			}
-		}
-		resampled = true;
-	}
-	else {	/* Simply set Grid_proj[i]/Intens_proj to point to Grid_orig[i]/Intens_orig */
-		struct GMT_GRID_HEADER tmp_header;
-		for (k = 0; k < n_grids; k++) {	/* Must get a copy so we can change one without affecting the other */
-			GMT_memcpy (&tmp_header, Grid_orig[k]->header, 1, struct GMT_GRID_HEADER);
-			Grid_proj[k] = Grid_orig[k];
-			//GMT_mbgrdtiff_set_proj_limits (GMT, Grid_proj[k]->header, &tmp_header, need_to_project);
-		}
-		if (use_intensity_grid) Intens_proj = Intens_orig;
-		if (n_grids)
-			grid_registration = Grid_orig[0]->header->registration;
-	}
-
-	if (n_grids) {
-		Grid_proj[0]->header->n_bands = 1;
-		header_work = Grid_proj[0]->header;	/* Later when need to refer to the header, use this copy */
-	}
-
-	nm = header_work->nm;
-	nx = header_work->nx;
-	ny = header_work->ny;
-
-	/* Get/calculate a color palette file */
-	if (!Ctrl->I.do_rgb) {
-		if (Ctrl->C.active) {		/* Read palette file */
-			if ((P = GMT_Get_CPT (GMT, Ctrl->C.file, GMT_CPT_OPTIONAL, header_work->z_min, header_work->z_max)) == NULL) {
-				Return (API->error);
-			}
-			gray_only = (P && P->is_gray);
-		}
-	}
-
-
-	if (P && P->has_pattern) GMT_Report (API, GMT_MSG_VERBOSE, "Warning: Patterns in cpt file only apply to -T\n");
-	GMT_Report (API, GMT_MSG_VERBOSE, "Evaluate pixel colors\n");
-
-	NaN_rgb = (P) ? P->patch[GMT_NAN].rgb : GMT->current.setting.color_patch[GMT_NAN];
-	if (Ctrl->Q.active) {
-		if (gray_only) {
-			GMT_Report (API, GMT_MSG_VERBOSE, "Your image is grayscale only but -Q requires 24-bit; image will be converted to 24-bit.\n");
-			gray_only = false;
-			NaN_rgb = red;	/* Arbitrarily pick red as the NaN color since image is gray only */
-			GMT_memcpy (P->patch[GMT_NAN].rgb, red, 4, double);
-		}
-		rgb_used = GMT_memory (GMT, NULL, 256*256*256, unsigned char);
-	}
-	if (Ctrl->M.active || gray_only) {
-                image_size = nm;
-		bitimage_8 = GMT_memory (GMT, NULL, image_size, unsigned char);
-                tiff_image = bitimage_8;
-	}
-	else {
-		if (Ctrl->Q.active) colormask_offset = 3;
-                image_size = 3 * nm + colormask_offset;
-		bitimage_24 = GMT_memory (GMT, NULL, image_size, unsigned char);
-		if (P && Ctrl->Q.active) {
-			for (k = 0; k < 3; k++) bitimage_24[k] = GMT_u255 (P->patch[GMT_NAN].rgb[k]);
-		}
-                tiff_image = bitimage_24;
-	}
-	normal_x = !(GMT->current.proj.projection == GMT_LINEAR && !GMT->current.proj.xyz_pos[0] && !resampled);
-	normal_y = !(GMT->current.proj.projection == GMT_LINEAR && !GMT->current.proj.xyz_pos[1] && !resampled);
-        normal_x = true;
-        normal_y = true;
-	for (try = 0, done = false; !done && try < 2; try++) {	/* Evaluate colors at least once, or twice if -Q and we need to select another NaN color */
-		for (row = 0, byte = colormask_offset; row < ny; row++) {
-			actual_row = (normal_y) ? row : ny - row - 1;
-			kk = GMT_IJPGI (header_work, actual_row, 0);
-			if (Ctrl->D.active && row == 0) node_RGBA = kk;		/* First time per row equals 'node', after grows alone */
-			for (col = 0; col < nx; col++) {	/* Compute rgb for each pixel */
-				node = kk + (normal_x ? col : nx - col - 1);
-				if (Ctrl->I.do_rgb) {
-					for (k = 0; k < 3; k++) {
-						if (GMT_is_fnan (Grid_proj[k]->data[node])) {	/* If one is NaN they are all assumed to be NaN */
-							k = 3;	/* To exit the k-loop */
-							GMT_rgb_copy (rgb, NaN_rgb);
-							index = GMT_NAN - 3;	/* Ensures no illumination done later */
-						}
-						else {				/* Set color, let index = 0 so illuminate test will work */
-							rgb[k] = GMT_is255 (Grid_proj[k]->data[node]);
-							if (rgb[k] < 0.0) rgb[k] = 0.0; else if (rgb[k] > 1.0) rgb[k] = 1.0;	/* Clip */
-							index = 0;
-						}
-					}
-				}
-				else
-					index = GMT_get_rgb_from_z (GMT, P, Grid_proj[0]->data[node], rgb);
-
-				if (Ctrl->I.active && index != GMT_NAN - 3) {
-					if (!n_grids) {		/* Here we are illuminating an image. Must recompute "node" with the GMT_IJP macro */
-						node = GMT_IJP (Intens_proj->header, actual_row, 0) + (normal_x ? col : nx - col - 1);
-					}
-					if (use_intensity_grid)
-						GMT_illuminate (GMT, Intens_proj->data[node], rgb);
-					else
-						GMT_illuminate (GMT, Ctrl->Intensity.value, rgb);
-				}
-				
-				if (P && gray_only)		/* Color table only has grays, pick r */
-					bitimage_8[byte++] = GMT_u255 (rgb[0]);
-				else if (Ctrl->M.active)	/* Convert rgb to gray using the GMT_YIQ transformation */
-					bitimage_8[byte++] = GMT_u255 (GMT_YIQ (rgb));
-				else {
-					for (k = 0; k < 3; k++) bitimage_24[byte++] = i_rgb[k] = GMT_u255 (rgb[k]);
-					if (Ctrl->Q.active && index != GMT_NAN - 3) /* Keep track of all r/g/b combinations used except for NaN */
-						rgb_used[(i_rgb[0]*256 + i_rgb[1])*256+i_rgb[2]] = true;
-				}
-			}
-
-			if (!n_grids) node_RGBA += header_work->n_bands * (header_work->pad[XLO] + header_work->pad[XHI]);
-		}
-
-		if (P && Ctrl->Q.active) {	/* Check that we found an unused r/g/b value so colormasking will work OK */
-			index = (GMT_u255(P->patch[GMT_NAN].rgb[0])*256 + GMT_u255(P->patch[GMT_NAN].rgb[1]))*256 + GMT_u255(P->patch[GMT_NAN].rgb[2]);
-			if (rgb_used[index]) {	/* This r/g/b already appears in the image as a non-NaN color; we must find a replacement NaN color */
-				for (index = 0, ks = -1; ks == -1 && index < 256*256*256; index++) if (!rgb_used[index]) ks = index;
-				if (ks == -1) {
-					GMT_Report (API, GMT_MSG_NORMAL, "Warning: Colormasking will fail as there is no unused color that can represent transparency\n");
-					done = true;
-				}
-				else {	/* Pick the first unused color (i.e., k) and let it play the role of the NaN color for transparency */
-					bitimage_24[0] = (unsigned char)(ks >> 16);
-					bitimage_24[1] = (unsigned char)((ks >> 8) & 255);
-					bitimage_24[2] = (unsigned char)(ks & 255);
-					GMT_Report (API, GMT_MSG_VERBOSE, "Warning: transparency color reset from %s to color %d/%d/%d\n", 
-						GMT_putrgb (GMT, P->patch[GMT_NAN].rgb), (int)bitimage_24[0], (int)bitimage_24[1], (int)bitimage_24[2]);
-					for (k = 0; k < 3; k++) P->patch[GMT_NAN].rgb[k] = GMT_is255 (bitimage_24[k]);	/* Set new NaN color */
-				}	
-			}
-		}
-		else
-			done = true;
-	}
-	if (Ctrl->Q.active) GMT_free (GMT, rgb_used);
-	
-	for (k = 1; k < n_grids; k++) {	/* Not done with Grid_proj[0] yet, hence we start loop at k = 1 */
-		if (need_to_project && GMT_Destroy_Data (API, &Grid_proj[k]) != GMT_OK) {
-			GMT_Report (API, GMT_MSG_NORMAL, "Failed to free Grid_proj[k]\n");
-		}
-	}
-	if (use_intensity_grid) {
-		if (need_to_project || !n_grids) {
-			if (GMT_Destroy_Data (API, &Intens_proj) != GMT_OK) {
-				GMT_Report (API, GMT_MSG_NORMAL, "Failed to free Intens_proj\n");
-			}
-		}
-	}
-	
-	/* Get actual size of each pixel */
-	dx = GMT_get_inc (GMT, header_work->wesn[XLO], header_work->wesn[XHI], header_work->nx, header_work->registration);
-	dy = GMT_get_inc (GMT, header_work->wesn[YLO], header_work->wesn[YHI], header_work->ny, header_work->registration);
-
-	/* Set lower left position of image on map */
-
-	x0 = header_work->wesn[XLO];	y0 = header_work->wesn[YLO];
-	if (grid_registration == GMT_GRID_NODE_REG) {	/* Grid registration, move 1/2 pixel down/left */
-		x0 -= 0.5 * dx;
-		y0 -= 0.5 * dy;
-	}
-
-	x_side = dx * header_work->nx;
-	y_side = dy * header_work->ny;
-
-	if (P && gray_only) 
-		for (kk = 0, P->is_bw = true; P->is_bw && kk < nm; kk++) 
-			if (!(bitimage_8[kk] == 0 || bitimage_8[kk] == 255)) P->is_bw = false;
-
-	if (P && P->is_bw) {	/* Can get away with 1 bit image */
-
-		GMT_Report (API, GMT_MSG_VERBOSE, "Creating 1-bit B/W image\n");
-
-		nx8 = irint (ceil (nx / 8.0));	/* Image width must equal a multiple of 8 bits */
-		nx_pixels = nx8 * 8;
-                image_size = nx8 * ny;
-		bitimage_1 = GMT_memory (GMT, NULL, image_size, unsigned char);
-                tiff_image = bitimage_1;
-
-		for (row = k = k8 = 0; row < ny; row++) {
-			shift = 0; byte = 0;
-			for (col = 0; col < nx; col++, k++) {
-				b_or_w = (bitimage_8[k] == 255);
-				byte |= b_or_w;
-				shift++;
-				if (shift == 8) {	/* Time to dump out byte */
-					bitimage_1[k8++] = (unsigned char) byte;
-					byte = shift = 0;
-				}
-				else
-					byte <<= 1;	/* Move the bits we have so far 1 step to the left */
-			}
-			if (shift) {	/* Set the remaining bits in this bit to white */
-				byte |= 1;
-				shift++;
-				while (shift < 8) {
-					byte <<= 1;
-					byte |= 1;
-					shift++;
-				}
-				bitimage_1[k8++] = (unsigned char) byte;
-			}
-		}
-
-		x_side = nx_pixels * dx;
-		//PSL_plotbitimage (PSL, x0, y0, x_side, y_side, PSL_BL, bit, nx_pixels, ny, Ctrl->G.f_rgb, Ctrl->G.b_rgb);
-	}
-	else if ((P && gray_only) || Ctrl->M.active) {
-			GMT_Report (API, GMT_MSG_VERBOSE, "Creating 8-bit grayshade image\n");
-			//PSL_plotcolorimage (PSL, x0, y0, x_side, y_side, PSL_BL, bitimage_8, nx, ny, (Ctrl->E.device_dpi ? -8 : 8));
-	}
-	else {
-		GMT_Report (API, GMT_MSG_VERBOSE, "Creating 24-bit color image\n");
-		//PSL_plotcolorimage (PSL, x0, y0, x_side, y_side, PSL_BL, bitimage_24, (Ctrl->Q.active ? -1 : 1) * 
-		//    nx, ny, (Ctrl->E.device_dpi ? -24 : 24));
-	}
-
-	/*------------------------- Write out the GeoTiff and world files -------------------------*/
-        
-	/* try to get projection from the grd file remark */
-	if (strncmp(&(header_work->remark[2]), "Projection: ", 12) == 0)
-		{
-		if ((nscan = sscanf(&(header_work->remark[2]), "Projection: UTM%d%c", &utmzone, &NorS)) == 2)
-			{
-			if (NorS == 'N')
-				{
-				projectionid = 32600 + utmzone;
-				}
-			else if (NorS == 'S')
-				{
-				projectionid = 32700 + utmzone;
-				}
-				modeltype = ModelTypeProjected;
-			sprintf(projectionname, "UTM%2.2d%c", utmzone, NorS);
-			}
-		else if ((nscan = sscanf(&(header_work->remark[2]), "Projection: epsg%d", &projectionid)) == 1)
-			{
-			sprintf(projectionname, "epsg%d", projectionid);
-			modeltype = ModelTypeProjected;
-			}
-		else if (strncmp(&(header_work->remark[2]), "Projection: SeismicProfile", 26) == 0)
-			{
-			sprintf(projectionname, "SeismicProfile");
-			modeltype = ModelTypeProjected;
-			}
-		else
-			{
-			strcpy(projectionname, "Geographic WGS84");
-			modeltype = ModelTypeGeographic;
-			projectionid = GCS_WGS_84;
-			}
-		}
-	else
-		{
-		strcpy(projectionname, "Geographic WGS84");
-		modeltype = ModelTypeGeographic;
-		projectionid = GCS_WGS_84;
-		}
-                
-        /* Google Earth Pro requires GeoTiffs longitude to be in -180 to +180 domain
-         * make sure geographic images have the origin in the right domain unless
-         * that does not make sense so that most images will work with Google Earth Pro */
-        if (modeltype == ModelTypeGeographic && header_work->wesn[XLO] > 180.0 && header_work->wesn[XHI] > 180.0)
-            {
-            header_work->wesn[XLO] -= 360.0;
-            header_work->wesn[XHI] -= 360.0;
-            }
-        if (modeltype == ModelTypeGeographic && header_work->wesn[XLO] < -180.0 && header_work->wesn[XHI] < -180.0)
-            {
-            header_work->wesn[XLO] += 360.0;
-            header_work->wesn[XHI] += 360.0;
-            }
-
-	/* set the TIFF comment */
-	sprintf(tiff_comment, "Image generated by %s|", program_name);
-
-	/* set the TIFF header */
-	memset(tiff_header,0,TIFF_HEADER_SIZE);
-        index = 0;
-	tiff_header[0] = 'M';
-	tiff_header[1] = 'M';
-	index += 2;
-	value_short = 42;
-	mb_put_binary_short(MB_NO, value_short, &tiff_header[index]);
-	index += 2;
-	value_int = 8;
-	mb_put_binary_int(MB_NO, value_int, &tiff_header[index]);
-	index += 4;
-
-	/* number of entries in IFD */
-	value_short = NUMBER_TAGS;
-	mb_put_binary_short(MB_NO, value_short, &tiff_header[index]);
-	index += 2;
-
-	/* loop over all tags */
-	for (i=0;i<NUMBER_TAGS;i++)
-	  {
-	    mb_put_binary_short(MB_NO, tiff_tag[i], &tiff_header[index]);
-	    index += 2;
-	    mb_put_binary_short(MB_NO, tiff_type[i], &tiff_header[index]);
-	    index += 2;
-
-	    switch (tiff_tag[i])
-	      {
-	      case NewSubfileType:
-		value_int = 1;
-		mb_put_binary_int(MB_NO, value_int, &tiff_header[index]);
-		index += 4;
-		value_int = 0;
-	        mb_put_binary_int(MB_NO, value_int, &tiff_header[index]);
-		index += 4;
-		break;
-	      case ImageWidth:
-		value_int = 1;
-		mb_put_binary_int(MB_NO, value_int, &tiff_header[index]);
-		index += 4;
-		value_int = nx;
-	        mb_put_binary_int(MB_NO, value_int, &tiff_header[index]);
-		index += 4;
-		break;
-	      case ImageLength:
-		value_int = 1;
-		mb_put_binary_int(MB_NO, value_int, &tiff_header[index]);
-		index += 4;
-		value_int = ny;
-	        mb_put_binary_int(MB_NO, value_int, &tiff_header[index]);
-		index += 4;
-		break;
-	      case BitsPerSample:
-		if ((P && gray_only))
-		  {
-		    value_int = 1;
-		    mb_put_binary_int(MB_NO, value_int, &tiff_header[index]);
-		    index += 4;
-		    value_short = 8;
-		    mb_put_binary_short(MB_NO, value_short, &tiff_header[index]);
-		    index += 4;
-		  }
-		else
-		  {
-		    value_int = 3;
-		    mb_put_binary_int(MB_NO, value_int, &tiff_header[index]);
-		    index += 4;
-		    value_int = tiff_offset[i];
-		    mb_put_binary_int(MB_NO, value_int, &tiff_header[index]);
-		    index += 4;
-		    value_short = 8;
-		    mb_put_binary_short(MB_NO, value_short, &tiff_header[tiff_offset[i]]);
-		    mb_put_binary_short(MB_NO, value_short, &tiff_header[tiff_offset[i]+2]);
-		    mb_put_binary_short(MB_NO, value_short, &tiff_header[tiff_offset[i]+4]);
-		  }
-		break;
-	      case Compression:
-		value_int = 1;
-		mb_put_binary_int(MB_NO, value_int, &tiff_header[index]);
-		index += 4;
-		value_short = 1;
-	        mb_put_binary_short(MB_NO, value_short, &tiff_header[index]);
-		index += 4;
-		break;
-	      case PhotometricInterpretation:
-		value_int = 1;
-		mb_put_binary_int(MB_NO, value_int, &tiff_header[index]);
-		index += 4;
-		if ((P && gray_only))
-		  {
-		  value_short = 1;
-		  }
-		else
-		  {
-		  value_short = 2;
-		  }
-	        mb_put_binary_short(MB_NO, value_short, &tiff_header[index]);
-		index += 4;
-		break;
-	      case StripOffsets:
-		value_int = 1;
-		mb_put_binary_int(MB_NO, value_int, &tiff_header[index]);
-		index += 4;
-		value_int = IMAGE_OFFSET;
-	        mb_put_binary_int(MB_NO, value_int, &tiff_header[index]);
-		index += 4;
-		break;
-	      case SamplesPerPixel:
-		value_int = 1;
-		mb_put_binary_int(MB_NO, value_int, &tiff_header[index]);
-		index += 4;
-		if ((P && gray_only))
-		  value_short = 1;
-		else
-		  value_short = 3;
-	        mb_put_binary_short(MB_NO, value_short, &tiff_header[index]);
-		index += 4;
-		break;
-	      case RowsPerStrip:
-		value_int = 1;
-		mb_put_binary_int(MB_NO, value_int, &tiff_header[index]);
-		index += 4;
-		value_int = ny;
-	        mb_put_binary_int(MB_NO, value_int, &tiff_header[index]);
-		index += 4;
-		break;
-	      case StripByteCounts:
-		value_int = 1;
-		mb_put_binary_int(MB_NO, value_int, &tiff_header[index]);
-		index += 4;
-		if ((P && gray_only))
-		  value_int = nx * ny;
-		else
-		  value_int = 3 * nx * ny;
-	        mb_put_binary_int(MB_NO, value_int, &tiff_header[index]);
-		index += 4;
-		break;
-	      case XResolution:
-		value_int = 1;
-		mb_put_binary_int(MB_NO, value_int, &tiff_header[index]);
-		index += 4;
-		value_int = tiff_offset[i];
-	        mb_put_binary_int(MB_NO, value_int, &tiff_header[index]);
-		index += 4;
-		value_int = MAX(nx, ny);
-		mb_put_binary_int(MB_NO, value_int, &tiff_header[tiff_offset[i]]);
-		value_int = 4;
-		mb_put_binary_int(MB_NO, value_int, &tiff_header[tiff_offset[i]+4]);
-		break;
-	      case YResolution:
-		value_int = 1;
-		mb_put_binary_int(MB_NO, value_int, &tiff_header[index]);
-		index += 4;
-		value_int = tiff_offset[i];
-	        mb_put_binary_int(MB_NO, value_int, &tiff_header[index]);
-		index += 4;
-		value_int = MAX(nx, ny);
-		mb_put_binary_int(MB_NO, value_int, &tiff_header[tiff_offset[i]]);
-		value_int = 4;
-		mb_put_binary_int(MB_NO, value_int, &tiff_header[tiff_offset[i]+4]);
-		break;
-	      case ResolutionUnit:
-		value_int = 1;
-		mb_put_binary_int(MB_NO, value_int, &tiff_header[index]);
-		index += 4;
-		value_short = 2;
-	        mb_put_binary_short(MB_NO, value_short, &tiff_header[index]);
-		index += 4;
-		break;
-	      case ModelPixelScaleTag:
-		value_int = 3;
-		mb_put_binary_int(MB_NO, value_int, &tiff_header[index]);
-		index += 4;
-		value_int = tiff_offset[i];
-	        mb_put_binary_int(MB_NO, value_int, &tiff_header[index]);
-		index += 4;
-		value_double = header_work->inc[0];
-		mb_put_binary_double(MB_NO, value_double, &tiff_header[tiff_offset[i]]);
-		value_double = header_work->inc[1];
-		mb_put_binary_double(MB_NO, value_double, &tiff_header[tiff_offset[i]+8]);
-		value_double = 0.0;
-		mb_put_binary_double(MB_NO, value_double, &tiff_header[tiff_offset[i]+16]);
-		break;
-	      case ModelTiepointTag:
-		value_int = 6;
-		mb_put_binary_int(MB_NO, value_int, &tiff_header[index]);
-		index += 4;
-		value_int = tiff_offset[i];
-	        mb_put_binary_int(MB_NO, value_int, &tiff_header[index]);
-		index += 4;
-		value_double = 0;
-		mb_put_binary_double(MB_NO, value_double, &tiff_header[tiff_offset[i]]);
-		value_double = 0;
-		mb_put_binary_double(MB_NO, value_double, &tiff_header[tiff_offset[i] + 1 * 8]);
-		value_double = 0;
-		mb_put_binary_double(MB_NO, value_double, &tiff_header[tiff_offset[i] + 2 * 8]);
-                value_double = header_work->wesn[XLO] - 0.5 * header_work->inc[0];
-		mb_put_binary_double(MB_NO, value_double, &tiff_header[tiff_offset[i] + 3 * 8]);
-		value_double = header_work->wesn[YHI] + 0.5 * header_work->inc[1];
-		mb_put_binary_double(MB_NO, value_double, &tiff_header[tiff_offset[i] + 4 * 8]);
-                
-		value_double = 0.0;
-		mb_put_binary_double(MB_NO, value_double, &tiff_header[tiff_offset[i] + 5 * 8]);
-		break;
-	      case GeoKeyDirectoryTag:
-		value_int = 20;
-		mb_put_binary_int(MB_NO, value_int, &tiff_header[index]);
-		index += 4;
-		value_int = tiff_offset[i];
-	        mb_put_binary_int(MB_NO, value_int, &tiff_header[index]);
-		index += 4;
-
-		/* index to geotiff geokey directory */
-		keyindex = tiff_offset[i];
-
-		/* geokey directory header
-			(KeyDirectoryVersion, KeyRevision, MinorRevision, NumberOfKeys) */
-		value_short = 1;
-		mb_put_binary_short(MB_NO, value_short, &tiff_header[keyindex]);
-		keyindex += 2;
-		value_short = 0;
-		mb_put_binary_short(MB_NO, value_short, &tiff_header[keyindex]);
-		keyindex += 2;
-		value_short = 2;
-		mb_put_binary_short(MB_NO, value_short, &tiff_header[keyindex]);
-		keyindex += 2;
-		value_short = 4;
-		mb_put_binary_short(MB_NO, value_short, &tiff_header[keyindex]);
-		keyindex += 2;
-
-		/* GTModelTypeGeoKey */
-		value_short = GTModelTypeGeoKey;
-		mb_put_binary_short(MB_NO, value_short, &tiff_header[keyindex]);
-		keyindex += 2;
-		value_short = 0;
-		mb_put_binary_short(MB_NO, value_short, &tiff_header[keyindex]);
-		keyindex += 2;
-		value_short = 1;
-		mb_put_binary_short(MB_NO, value_short, &tiff_header[keyindex]);
-		keyindex += 2;
-		value_short = modeltype;
-		mb_put_binary_short(MB_NO, value_short, &tiff_header[keyindex]);
-		keyindex += 2;
-
-		/* GTRasterTypeGeoKey */
-		value_short = GTRasterTypeGeoKey;
-		mb_put_binary_short(MB_NO, value_short, &tiff_header[keyindex]);
-		keyindex += 2;
-		value_short = 0;
-		mb_put_binary_short(MB_NO, value_short, &tiff_header[keyindex]);
-		keyindex += 2;
-		value_short = 1;
-		mb_put_binary_short(MB_NO, value_short, &tiff_header[keyindex]);
-		keyindex += 2;
-		value_short = RasterPixelIsPoint;
-		mb_put_binary_short(MB_NO, value_short, &tiff_header[keyindex]);
-		keyindex += 2;
-
-		/* GTCitationGeoKey */
-		value_short = GTCitationGeoKey;
-		mb_put_binary_short(MB_NO, value_short, &tiff_header[keyindex]);
-		keyindex += 2;
-		value_short = GeoAsciiParamsTag;
-		mb_put_binary_short(MB_NO, value_short, &tiff_header[keyindex]);
-		keyindex += 2;
-		value_short = strlen(tiff_comment);
-		mb_put_binary_short(MB_NO, value_short, &tiff_header[keyindex]);
-		keyindex += 2;
-		value_short = 0;
-		mb_put_binary_short(MB_NO, value_short, &tiff_header[keyindex]);
-		keyindex += 2;
-
-		if (modeltype == ModelTypeGeographic)
-			{
-			/* GeographicTypeGeoKey */
-			value_short = GeographicTypeGeoKey;
-			mb_put_binary_short(MB_NO, value_short, &tiff_header[keyindex]);
-			keyindex += 2;
-			value_short = 0;
-			mb_put_binary_short(MB_NO, value_short, &tiff_header[keyindex]);
-			keyindex += 2;
-			value_short = 1;
-			mb_put_binary_short(MB_NO, value_short, &tiff_header[keyindex]);
-			keyindex += 2;
-			value_short = projectionid;
-			mb_put_binary_short(MB_NO, value_short, &tiff_header[keyindex]);
-			keyindex += 2;
-			}
-
-		else if (modeltype == ModelTypeProjected)
-			{
-			/* ProjectedCSTypeGeoKey */
-			value_short = ProjectedCSTypeGeoKey;
-			mb_put_binary_short(MB_NO, value_short, &tiff_header[keyindex]);
-			keyindex += 2;
-			value_short = 0;
-			mb_put_binary_short(MB_NO, value_short, &tiff_header[keyindex]);
-			keyindex += 2;
-			value_short = 1;
-			mb_put_binary_short(MB_NO, value_short, &tiff_header[keyindex]);
-			keyindex += 2;
-			value_short = projectionid;
-			mb_put_binary_short(MB_NO, value_short, &tiff_header[keyindex]);
-			keyindex += 2;
-			}
-		break;
-	      case GeoDoubleParamsTag:
-		value_int = 1;
-		mb_put_binary_int(MB_NO, value_int, &tiff_header[index]);
-		index += 4;
-		value_int = tiff_offset[i];
-	        mb_put_binary_int(MB_NO, value_int, &tiff_header[index]);
-		index += 4;
-		break;
-	      case GeoAsciiParamsTag:
-		value_int = strlen(tiff_comment);
-		mb_put_binary_int(MB_NO, value_int, &tiff_header[index]);
-		index += 4;
-		value_int = tiff_offset[i];
-	        mb_put_binary_int(MB_NO, value_int, &tiff_header[index]);
-		index += 4;
-
-		/* put in the string */
-		strncpy(&tiff_header[tiff_offset[i]], tiff_comment, 64);
-		break;
-	      }
-	  }
-
-	/* open TIFF file */
-	if ((tfp = fopen(Ctrl->O.file,"w")) == NULL) {
-                API->error++;
-                return(API->error);
-	}
-
-	/* set the TIFF comment */
-	sprintf(tiff_comment, "Image generated by %s|", program_name);
-
-	/* write the header */
-	if ((write_size = fwrite(tiff_header,1,TIFF_HEADER_SIZE,tfp)) != TIFF_HEADER_SIZE) {
-                API->error++;
-                return(API->error);
-	}
-
-	/* write the image */
-	if ((write_size = fwrite(tiff_image,1,image_size,tfp)) != image_size) {
-                API->error++;
-                return(API->error);
-	}
-
-	/* close the tiff file */
-	fclose(tfp);
-
-	/* open world file */
-        strcpy(world_file, Ctrl->O.file);
-        world_file[strlen(Ctrl->O.file)-4] = '\0';
-        strcat(world_file,".tfw");
-        if ((tfp = fopen(world_file,"w")) == NULL) {
-                API->error++;
-                return(API->error);
-        }
-
-        /* write out world file contents */
-        fprintf(tfp, "%f\r\n0.0\r\n0.0\r\n%f\r\n%f\r\n%f\r\n",
-                dx, -dy,
-                header_work->wesn[XLO] - 0.5 * dx,
-                header_work->wesn[YHI] + 0.5 * dy);
-
-        /* close the world file */
-        fclose(tfp);
-fprintf(stderr,"3 Grid header:\n\tnx:%d ny:%d registration:%d\n\tWESN: %f %f %f %f\n\tinc: %f %f\n",
-Grid_orig[0]->header->nx,Grid_orig[0]->header->ny,Grid_orig[0]->header->registration,
-Grid_orig[0]->header->wesn[XLO],Grid_orig[0]->header->wesn[XHI],Grid_orig[0]->header->wesn[YLO],Grid_orig[0]->header->wesn[YHI],
-Grid_orig[0]->header->inc[0],Grid_orig[0]->header->inc[1]);
-fprintf(stderr,"3 Work header:\n\tnx:%d ny:%d registration:%d\n\tWESN: %f %f %f %f\n\tinc: %f %f\n",
-header_work->nx,header_work->ny,header_work->registration,
-header_work->wesn[XLO],header_work->wesn[XHI],header_work->wesn[YLO],header_work->wesn[YHI],
-header_work->inc[0],header_work->inc[1]);
-
-//	if (!Ctrl->A.active) {
-//		if (!Ctrl->N.active) GMT_map_clip_off (GMT);
-//
-//		GMT_map_basemap (GMT);
-//		GMT_plane_perspective (GMT, -1, 0.0);
-//		GMT_plotend (GMT);
-//	}
-
-	/* Free bitimage arrays. GMT_free will not complain if they have not been used (NULL) */
-        if (P && P->is_bw) GMT_free (GMT, bitimage_1);
-        if (bitimage_8) GMT_free (GMT, bitimage_8);
-	if (bitimage_24) GMT_free (GMT, bitimage_24);
-
-	if (need_to_project && n_grids && GMT_Destroy_Data (API, &Grid_proj[0]) != GMT_OK) {
-		GMT_Report (API, GMT_MSG_NORMAL, "Failed to free Grid_proj[0]\n");
-	}
-
-	if (!Ctrl->C.active && GMT_Destroy_Data (API, &P) != GMT_OK) {
-		Return (API->error);
-	}
-	Return (EXIT_SUCCESS);
-}
diff --git a/src/gmt/mbswath.c b/src/gmt/mbswath.c
deleted file mode 100644
index 59a337d..0000000
--- a/src/gmt/mbswath.c
+++ /dev/null
@@ -1,2729 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbswath.c	5/30/93
- *    $Id: mbswath.c 2247 2015-05-29 21:28:28Z caress $
- *
- *    Copyright (c) 1993-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * MBSWATH is a GMT compatible utility which creates a color postscript
- * image of swath bathymetry or backscatter data.  The image
- * may be shaded relief as well.  Complete maps are made by using
- * MBSWATH in conjunction with the usual GMT programs.  The modes
- * of operation are:
- *   Mode 1:  Bathymetry
- *   Mode 2:  Bathymetry shaded by illumination
- *   Mode 3:  Bathymetry shaded by amplitude
- *   Mode 4:  amplitude
- *   Mode 5:  sidescan
- *   Mode 6:  Bathymetry shaded by amplitude using cpt gray data
- *
- * Author:	D. W. Caress
- * Date:	May 30, 1993 (original standalone program for GMT3 and GMT4)
- * Date:	January 27, 2015 (recast as GMT5 module)
- *
- */
-
-#define THIS_MODULE_NAME	"mbswath"
-#define THIS_MODULE_LIB		"mbgmt"
-#define THIS_MODULE_PURPOSE	"Plot swath bathymetry, amplitude, or backscatter"
-#define THIS_MODULE_KEYS	""
-
-/* GMT5 header file */
-#include "gmt_dev.h"
-
-EXTERN_MSC int GMT_mbswath(void *API, int mode, void *args);
-
-#define GMT_PROG_OPTIONS "->BJKOPRUVXY" GMT_OPT("S")
-
-/* MBIO include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_define.h"
-#include "mb_io.h"
-
-/* MBSWATH MODE DEFINES */
-#define	MBSWATH_BATH		1
-#define	MBSWATH_BATH_RELIEF	2
-#define	MBSWATH_BATH_AMP	3
-#define	MBSWATH_AMP		4
-#define	MBSWATH_SS		5
-#define	MBSWATH_BATH_AMP_FILTER	6
-#define	MBSWATH_AMP_FILTER	7
-#define	MBSWATH_SS_FILTER	8
-#define MBSWATH_FOOTPRINT_REAL	1
-#define MBSWATH_FOOTPRINT_FAKE	2
-#define MBSWATH_FOOTPRINT_POINT	3
-#define MBSWATH_FILTER_NONE	0
-#define MBSWATH_FILTER_AMP	1
-#define MBSWATH_FILTER_SIDESCAN	2
-
-/* image type defines */
-#define	MBSWATH_IMAGE_VECTOR	1
-#define	MBSWATH_IMAGE_8		2
-#define	MBSWATH_IMAGE_24	3
-
-/* How B/W TV's convert RGB to Gray */
-#define YIQ(rgb) (0.299 * rgb[0] + 0.587 * rgb[1] + 0.114 * rgb[2])
-
-/* global structure definitions */
-#define MAXPINGS 50
-struct footprint
-	{
-	double	x[4];
-	double	y[4];
-	};
-struct ping
-	{
-	int	pings;
-	int	kind;
-	int	time_i[7];
-	double	time_d;
-	double	navlon;
-	double	navlat;
-	double	speed;
-	double	heading;
-	double	distance;
-	double	altitude;
-	double	sonardepth;
-	int	beams_bath;
-	int	beams_amp;
-	int	pixels_ss;
-	char	*beamflag;
-	double	*bath;
-	double	*bathlon;
-	double	*bathlat;
-	double	*amp;
-	double	*ss;
-	double	*sslon;
-	double	*sslat;
-	char	comment[256];
-	double	lonaft;
-	double	lataft;
-	double	lonfor;
-	double	latfor;
-	int	*bathflag;
-	struct footprint *bathfoot;
-	int	*ssflag;
-	struct footprint *ssfoot;
-	double	*bathshade;
-	};
-struct swath
-	{
-	int	npings;
-	int	beams_bath;
-	int	beams_amp;
-	int	pixels_ss;
-	struct ping data[MAXPINGS];
-	};
-
-/* Control structure for mbswath */
-struct MBSWATH_CTRL {
-
-        /* mbswath variables */
-	double  bounds[4];
-	int     image_type;
-	double  mtodeglon;
-	double  mtodeglat;
-	double  clipx[4];
-	double  clipy[4];
-	double  x_inc;
-	double  y_inc;
-	double  x_side;
-	double  y_side;
-	double  x0;
-	double  y0;
-	double  x_inch;
-	double  y_inch;
-	int     nx;
-	int     ny;
-	int     nm;
-	int     nm2;
-	unsigned char *bitimage;
-	int     format;
-	double	beamwidth_xtrack;
-	double	beamwidth_ltrack;
-	double  footprint_factor;
-	double	btime_d;
-	double	etime_d;
-	int     read_datalist;
-	int	read_data;
-	void	*datalist;
-	double	file_weight;
-        mb_path file;
-	int	filtermode;
-	int	beams_bath_max;
-	int	beams_amp_max;
-	int	pixels_ss_max;
-	void	*mbio_ptr;
-	struct swath *swath_plot;
-
-	struct mbswath_A {	/* -A<factor>/<mode>/<depth> */
-		bool active;
-		double factor;
-		int mode;
-		double depth;
-	} A;
-	struct mbswath_b {	/* -b<year>/<month>/<day>/<hour>/<minute>/<second> */
-		bool active;
-		int time_i[7];
-	} b;
-	struct mbswath_C {	/* -C<cptfile> */
-		bool active;
-		char *cptfile;
-	} C;
-	struct mbswath_D {	/* -D<mode>/<ampscale>/<ampmin>/<ampmax> */
-		bool active;
-		unsigned int mode;
-		double ampscale;
-		double ampmin;
-		double ampmax;
-	} D;
-	struct mbswath_E {	/* -Ei|<dpi> */
-		bool active;
-		bool device_dpi;
-		unsigned int dpi;
-	} E;
-	struct mbswath_e {	/* -e<year>/<month>/<day>/<hour>/<minute>/<second> */
-		bool active;
-		int time_i[7];
-	} e;
-	struct mbswath_F {	/* -F<format> */
-		bool active;
-		int format;
-	} F;
-	struct mbswath_G {	/* -G<magnitude>/<azimuth | median> */
-		bool active;
-		double magnitude;
-		double azimuth;
-	} G;
-	struct mbswath_I {	/* -I<inputfile> */
-		bool active;
-		char *inputfile;
-	} I;
-	struct mbswath_L {	/* -L<lonflip> */
-		bool active;
-		int lonflip;
-	} L;
-	struct mbswath_N {	/* -N<cptfile> */
-		bool active;
-		char *cptfile;
-	} N;
-	struct mswath_p {	/* -p<pings> */
-		bool active;
-		int pings;
-	} p;
-	struct mbswath_S {	/* -S<speed> */
-		bool active;
-		double speed;
-	} S;
-	struct mbswath_T {	/* -T<timegap> */
-		bool active;
-		double timegap;
-	} T;
-	struct mbswath_W {	/* -W */
-		bool active;
-	} W;
-	struct mbswath_Z {	/* -Z<mode> */
-		bool active;
-		int mode;
-		int filter;
-		int usefiltered;
-	} Z;
-};
-
-void *New_mbswath_Ctrl (struct GMT_CTRL *GMT);
-void Free_mbswath_Ctrl (struct GMT_CTRL *GMT, struct MBSWATH_CTRL *Ctrl);
-int GMT_mbswath_usage (struct GMTAPI_CTRL *API, int level);
-int GMT_mbswath_parse (struct GMT_CTRL *GMT, struct MBSWATH_CTRL *Ctrl, struct GMT_OPTION *options);
-
-int mbswath_get_footprints(int verbose, struct MBSWATH_CTRL *Ctrl, int *error);
-int mbswath_get_shading(int verbose, struct MBSWATH_CTRL *Ctrl,
-                        struct GMT_CTRL *GMT, struct GMT_PALETTE *CPT, int *error);
-int mbswath_plot_data_footprint(int verbose, struct MBSWATH_CTRL *Ctrl,
-                        struct GMT_CTRL *GMT, struct GMT_PALETTE *CPT, struct PSL_CTRL *PSL,
-                        int first, int nplot, int *error);
-int mbswath_plot_data_point(int verbose, struct MBSWATH_CTRL *Ctrl,
-                        struct GMT_CTRL *GMT, struct GMT_PALETTE *CPT, struct PSL_CTRL *PSL,
-                        int first, int nplot, int *error);
-int mbswath_plot_box(int verbose, struct MBSWATH_CTRL *Ctrl,
-                        struct GMT_CTRL *GMT, struct PSL_CTRL *PSL,
-                        double *x, double *y, double *rgb, int *error);
-int mbswath_plot_point(int verbose, struct MBSWATH_CTRL *Ctrl, struct GMT_CTRL *GMT, struct PSL_CTRL *PSL,
-                        double x, double y, double *rgb, int *error);
-int mbswath_ping_copy(int verbose, int one, int two, struct swath *swath, int *error);
-
-void *New_mbswath_Ctrl (struct GMT_CTRL *GMT) {	/* Allocate and initialize a new control structure */
-	struct MBSWATH_CTRL *Ctrl;
-	int     status;
-	int     verbose = 0;
-	double  dummybounds[4];
-	int     dummyformat;
-	int     dummypings;
-	int     i;
-
-	Ctrl = GMT_memory (GMT, NULL, 1, struct MBSWATH_CTRL);
-
-	/* Initialize values whose defaults are not 0/false/NULL */
-
-	/* get current mb default values */
-	status = mb_defaults(verbose, &dummyformat, &dummypings, &Ctrl->L.lonflip, dummybounds,
-		Ctrl->b.time_i, Ctrl->e.time_i, &Ctrl->S.speed, &Ctrl->T.timegap);
-
-	Ctrl->A.factor = 1.0;
-	Ctrl->A.mode = MBSWATH_FOOTPRINT_REAL;
-	Ctrl->A.depth = 0.0;
-	Ctrl->C.cptfile = NULL;
-	Ctrl->D.mode = 1;
-	Ctrl->D.ampscale = 1.0;
-	Ctrl->D.ampmin = 0.0;
-	Ctrl->D.ampmax = 1.0;
-	Ctrl->E.device_dpi = 0;
-	Ctrl->E.dpi = 100;
-	Ctrl->F.format = 0;
-	Ctrl->G.magnitude = 1.0;
-	Ctrl->G.azimuth = 270.0;
-	Ctrl->I.inputfile = NULL;
-	Ctrl->N.cptfile = NULL;
-	Ctrl->p.pings = 1;
-	Ctrl->S.speed = 0.0;
-	Ctrl->T.timegap = 1.0;
-	Ctrl->Z.mode = MBSWATH_BATH;
-	Ctrl->Z.filter = 0;
-	Ctrl->Z.usefiltered = MB_NO;
-        
-        /* mbswath variables */
-        for (i=0;i<4;i++)
-                {
-                Ctrl->bounds[i] = 0.0;
-                Ctrl->clipx[i] = 0.0;
-                Ctrl->clipy[i] = 0.0;
-                }
-	Ctrl->image_type = MBSWATH_IMAGE_24;
-	Ctrl->mtodeglon = 0.0;
-	Ctrl->mtodeglat = 0.0;
-	Ctrl->x_inch = 0.0;
-	Ctrl->y_inch = 0.0;
-	Ctrl->x_inc = 0.0;
-	Ctrl->y_inc = 0.0;
-	Ctrl->x_side = 0.0;
-	Ctrl->y_side = 0.0;
-	Ctrl->x0 = 0.0;
-	Ctrl->y0 = 0.0;
-	Ctrl->nx = 0;
-	Ctrl->ny = 0;
-	Ctrl->nm = 0;
-	Ctrl->bitimage = NULL;
-	Ctrl->format = 0;
-	Ctrl->beamwidth_xtrack = 0.0;
-	Ctrl->beamwidth_ltrack = 0.0;
-	Ctrl->btime_d = 0.0;
-	Ctrl->etime_d = 0.0;
-	Ctrl->read_datalist = MB_NO;
-	Ctrl->read_data = 0;
-	Ctrl->datalist = NULL;
-	Ctrl->file_weight = 0.0;
-	Ctrl->file[0] = '\0';
-	Ctrl->filtermode = MBSWATH_FILTER_NONE;
-	Ctrl->beams_bath_max = 0;
-	Ctrl->beams_amp_max = 0;
-	Ctrl->pixels_ss_max = 0;
-	Ctrl->mbio_ptr = NULL;
-	Ctrl->swath_plot = NULL;
-
-	return (Ctrl);
-}
-
-void Free_mbswath_Ctrl (struct GMT_CTRL *GMT, struct MBSWATH_CTRL *Ctrl) {	/* Deallocate control structure */
-	if (!Ctrl) return;
-	if (Ctrl->C.cptfile) free (Ctrl->C.cptfile);
-	if (Ctrl->I.inputfile) free (Ctrl->I.inputfile);
-	if (Ctrl->N.cptfile) free (Ctrl->N.cptfile);
-	GMT_free (GMT, Ctrl);
-}
-
-int GMT_mbswath_usage (struct GMTAPI_CTRL *API, int level)
-{
-	GMT_show_name_and_purpose (API, THIS_MODULE_LIB, THIS_MODULE_NAME, THIS_MODULE_PURPOSE);
-	if (level == GMT_MODULE_PURPOSE) return (GMT_NOERROR);
-	GMT_Message (API, GMT_TIME_NONE, "usage: mbswath -I<inputfile> %s [%s]\n", GMT_J_OPT, GMT_B_OPT);
-	GMT_Message (API, GMT_TIME_NONE, "\t[-A<factor>/<mode>/<depth>]\n");
-	GMT_Message (API, GMT_TIME_NONE, "\t[-b<year>/<month>/<day>/<hour>/<minute>/<second>]\n");
-	GMT_Message (API, GMT_TIME_NONE, "\t[-C<cptfile>] [-D<mode>/<ampscale>/<ampmin>/<ampmax>] [-Ei|<dpi>]\n");
-	GMT_Message (API, GMT_TIME_NONE, "\t[-e<year>/<month>/<day>/<hour>/<minute>/<second>]\n");
-	GMT_Message (API, GMT_TIME_NONE, "\t[-F<format>] [-G<magnitude>/<azimuth | median>]\n");
-	GMT_Message (API, GMT_TIME_NONE, "\t[-I<inputfile>] [-L<lonflip>] [-N<cptfile>]\n");
-	GMT_Message (API, GMT_TIME_NONE, "\t[-S<speed>] [-T<timegap>] [-W] [-Z<mode>]\n");
-	GMT_Message (API, GMT_TIME_NONE, "\t[%s] [-T] [%s] [%s]\n", GMT_Rgeo_OPT, GMT_U_OPT, GMT_V_OPT);
-	GMT_Message (API, GMT_TIME_NONE, "\t[%s] [%s] [%s] [%s]\n\t[%s]\n\t[%s] [%s]\n\n", 
-	                                  GMT_X_OPT, GMT_Y_OPT, GMT_c_OPT, GMT_f_OPT, GMT_n_OPT, GMT_p_OPT, GMT_t_OPT);
-
-	if (level == GMT_SYNOPSIS) return (EXIT_FAILURE);
-
-	GMT_Message (API, GMT_TIME_NONE, "\t<inputfile> is an MB-System datalist referencing the swath data to be plotted.\n");
-	GMT_Option (API, "J-");
-	GMT_Message (API, GMT_TIME_NONE, "\n\tOPTIONS:\n");
-	GMT_Option (API, "B-");
-	GMT_Message (API, GMT_TIME_NONE, "\t-C Color palette file to convert z to rgb.  Optionally, instead give name of a master cpt\n");
-	GMT_Message (API, GMT_TIME_NONE, "\t   to automatically assign 16 continuous colors over the data range [rainbow].\n");
-	GMT_Message (API, GMT_TIME_NONE, "\t-E Set dpi for the projected output Postscript image\n");
-	GMT_Message (API, GMT_TIME_NONE, "\t   if -Jx or -Jm is not selected.\n");
-	GMT_Message (API, GMT_TIME_NONE, "\t   Give i to do the interpolation in PostScript at device resolution.\n");
-	GMT_rgb_syntax (API->GMT, 'G', "Set transparency color for images that otherwise would result in 1-bit images.\n\t  ");
-	GMT_Option (API, "K");
-	GMT_Option (API, "O,P");
-	GMT_Message (API, GMT_TIME_NONE, "\t-p<pings> Sets the ping averaging of the input data [Default = 1, i.e. no ping average].\n");
-	GMT_Option (API, "R");
-	GMT_Option (API, "U,V,X,c,.");
-
-	return (EXIT_FAILURE);
-}
-
-int GMT_mbswath_parse (struct GMT_CTRL *GMT, struct MBSWATH_CTRL *Ctrl, struct GMT_OPTION *options)
-{
-	/* This parses the options provided to mbswath and sets parameters in Ctrl.
-	 * Note Ctrl has already been initialized and non-zero default values set.
-	 * Any GMT common options will override values set previously by other commands.
-	 * It also replaces any file names specified as input or output with the data ID
-	 * returned when registering these sources/destinations with the API.
-	 */
-
-	unsigned int n_errors = 0, n_files = 0;
-	struct GMT_OPTION *opt = NULL;
-	struct GMTAPI_CTRL *API = GMT->parent;
-        int     n;
-
-	for (opt = options; opt; opt = opt->next) {	/* Process all the options given */
-
-		switch (opt->option) {
-			case '<':	/* Input file (only one or three is accepted) */
-				Ctrl->I.active = true;
-#if GMT_MINOR_VERSION == 1 && GMT_RELEASE_VERSION < 2
- 				if (GMT_check_filearg (GMT, '<', opt->arg, GMT_IN)) {
-#else
-				if (GMT_check_filearg (GMT, '<', opt->arg, GMT_IN, GMT_IS_DATASET)) {
-#endif
-					Ctrl->I.inputfile = strdup (opt->arg);
-					n_files = 1;
-				}
-				else {
-					GMT_Report (API, GMT_MSG_NORMAL, "Syntax error: only one input file is allowed.\n");
-					n_errors++;
-				}
-				break;
-
-			/* Processes program-specific parameters */
-
-			case 'A':	/* footprint controls */
-				n = sscanf(opt->arg, "%lf/%d/%lf", &(Ctrl->A.factor), &(Ctrl->A.mode), &(Ctrl->A.depth));
-				if (n > 0)
-					Ctrl->A.active = true;
-				else {
-					GMT_Report (API, GMT_MSG_NORMAL, "Syntax error -A option: \n");
-					n_errors++;
-				}
- 				break;
-			case 'b':	/* btime_i */
-				n = sscanf(opt->arg, "%d/%d/%d/%d/%d/%d",
-				           &(Ctrl->b.time_i[0]), &(Ctrl->b.time_i[1]), &(Ctrl->b.time_i[2]),
-				           &(Ctrl->b.time_i[3]), &(Ctrl->b.time_i[4]), &(Ctrl->b.time_i[5]));
-				Ctrl->b.time_i[6] = 0;
-				if (n == 6)
-					Ctrl->b.active = true;
-				else {
-					GMT_Report (API, GMT_MSG_NORMAL, "Syntax error -b option: \n");
-					n_errors++;
-				}
-				break;
-			case 'C':	/* CPT file */
-				Ctrl->C.active = true;
-				if (Ctrl->C.cptfile) free (Ctrl->C.cptfile);
-				Ctrl->C.cptfile = strdup (opt->arg);
-				break;
-			case 'D':	/* amplitude scaling */
-				n = sscanf(opt->arg, "%d/%lf/%lf/%lf",
-				           &(Ctrl->D.mode), &(Ctrl->D.ampscale),
-				           &(Ctrl->D.ampmin), &(Ctrl->D.ampmax));
-				if (n > 0)
-					Ctrl->D.active = true;
-				else {
-					GMT_Report (API, GMT_MSG_NORMAL, "Syntax error -D option: \n");
-					n_errors++;
-				}
- 				break;
-			case 'E':	/* dpi */
-				if (strcmp(opt->arg, "i") == 0) {
-					Ctrl->E.device_dpi = true;
-					Ctrl->E.active = true;
-				}
-				else {
-					n = sscanf(opt->arg, "%d", &(Ctrl->E.dpi));
-					if (n == 1)
-						Ctrl->E.active = true;
-					else {
-						GMT_Report (API, GMT_MSG_NORMAL, "Syntax error -E option: \n");
-						n_errors++;
-					}
-				}
-				break;
-			case 'e':	/* etime_i */
-				n = sscanf(opt->arg, "%d/%d/%d/%d/%d/%d",
-				           &(Ctrl->e.time_i[0]), &(Ctrl->e.time_i[1]), &(Ctrl->e.time_i[2]),
-				           &(Ctrl->e.time_i[3]), &(Ctrl->e.time_i[4]), &(Ctrl->e.time_i[5]));
-				Ctrl->e.time_i[6] = 0;
-				if (n == 6)
-					Ctrl->e.active = true;
-				else {
-					GMT_Report (API, GMT_MSG_NORMAL, "Syntax error -e option: \n");
-					n_errors++;
-				}
-				break;
-			case 'f':	/* format */
-			case 'F':	/* format */
-				n = sscanf(opt->arg, "%d", &(Ctrl->F.format));
-				if (n == 1)
-					Ctrl->F.active = true;
-				else {
-					GMT_Report (API, GMT_MSG_NORMAL, "Syntax error -F option: \n");
-					n_errors++;
-				}
-				break;
-			case 'G':	/* -G<magnitude>/<azimuth | median> */
-				n = sscanf(opt->arg, "%lf/%lf", &(Ctrl->G.magnitude), &(Ctrl->G.azimuth));
-				if (n >= 1)
-					Ctrl->G.active = true;
-				else {
-					GMT_Report (API, GMT_MSG_NORMAL, "Syntax error -G option: \n");
-					n_errors++;
-				}
-				break;
-			case 'I':	/* -I<inputfile> */
-				Ctrl->I.active = true;
-				if (!GMT_access (GMT, opt->arg, R_OK)) {	/* Got a file */
-					Ctrl->I.inputfile = strdup (opt->arg);
-					n_files = 1;
-				}
-				else {
-					GMT_Report (API, GMT_MSG_NORMAL, "Syntax error -I: Requires a valid file\n");
-					n_errors++;
-				}
-				break;
-			case 'L':	/* -L<lonflip> */
-				n = sscanf(opt->arg, "%d", &(Ctrl->L.lonflip));
-				if (n == 1)
-					Ctrl->L.active = true;
-				else {
-					GMT_Report (API, GMT_MSG_NORMAL, "Syntax error -L option: \n");
-					n_errors++;
-				}
-				break;
-			case 'N':	/* -N<cptfile> */
-				Ctrl->N.active = true;
-				if (Ctrl->N.cptfile) free (Ctrl->N.cptfile);
-				Ctrl->N.cptfile = strdup (opt->arg);
-				break;
-			case 'p':	/* Sets the ping averaging */
-				Ctrl->p.active = true;
-				Ctrl->p.pings = atoi(opt->arg);
-				if (Ctrl->p.pings < 0) {
-					GMT_Report (API, GMT_MSG_NORMAL, "Error -p option: Don't invent, number of pings must be >= 0\n");
-					Ctrl->p.pings = 1;
-				}
- 				break;
-			case 'S':	/* -S<speed> */
-				n = sscanf(opt->arg, "%lf", &(Ctrl->S.speed));
-				if (n == 1)
-					Ctrl->S.active = true;
-				else {
-					GMT_Report (API, GMT_MSG_NORMAL, "Syntax error -S option: \n");
-					n_errors++;
-				}
-				break;
-			case 'T':	/* -T<timegap> */
-				n = sscanf(opt->arg, "%lf", &(Ctrl->T.timegap));
-				if (n == 1)
-					Ctrl->T.active = true;
-				else {
-					GMT_Report (API, GMT_MSG_NORMAL, "Syntax error -T option: \n");
-					n_errors++;
-				}
-				break;
-			case 'W':	/* -W */
-				Ctrl->W.active = true;
-				break;
-			case 'Z':	/* -Z<mode> */
-				n = sscanf(opt->arg, "%d", &(Ctrl->Z.mode));
-				if (n == 1) {
-					Ctrl->Z.active = true;
-					if (opt->arg[1] == 'f' || opt->arg[1] == 'F')
-							Ctrl->Z.usefiltered = MB_YES;
-					else
-						Ctrl->Z.usefiltered = MB_NO;
-				}
-				else {
-					GMT_Report (API, GMT_MSG_NORMAL, "Syntax error -Z option: \n");
-					n_errors++;
-				}
-				break;
-			default:	/* Report bad options */
-				n_errors += GMT_default_error (GMT, opt->option);
-				break;
-		}
-	}
-
-	n_errors += GMT_check_condition (GMT, !GMT->common.J.active, 
-					"Syntax error: Must specify a map projection with the -J option\n");
-	n_errors += GMT_check_condition (GMT, n_files != 1, 
-					"Syntax error: Must specify one input file(s)\n");
-	n_errors += GMT_check_condition (GMT, Ctrl->I.active && !Ctrl->I.inputfile, 
-					"Syntax error -I option: Must specify input file\n");
-	n_errors += GMT_check_condition (GMT, Ctrl->E.active && !Ctrl->E.device_dpi && Ctrl->E.dpi <= 0, 
-					"Syntax error -E option: dpi must be positive\n");
-
-	return (n_errors ? GMT_PARSE_ERROR : GMT_OK);
-}
-
-#define bailout(code) {GMT_Free_Options (mode); return (code);}
-#define Return(code) {Free_mbswath_Ctrl (GMT, Ctrl); GMT_end_module (GMT, GMT_cpy); bailout (code);}
-
-int GMT_mbswath (void *V_API, int mode, void *args)
-{
-//	bool done, need_to_project, normal_x, normal_y, resampled = false, gray_only = false;
-//	bool nothing_inside = false, use_intensity_grid;
-//	unsigned int k, nx = 0, ny = 0, grid_registration = GMT_GRID_NODE_REG, n_grids;
-//	unsigned int colormask_offset = 0, try, row, actual_row, col;
-//	uint64_t node_RGBA = 0;		/* uint64_t for the RGB(A) image array. */
-//	uint64_t node, kk, nm, byte;
-//	int index = 0, ks, error = 0;
-	
-//	unsigned char *bitimage_8 = NULL, *bitimage_24 = NULL, *rgb_used = NULL, i_rgb[3];
-
-//	double dx, dy, x_side, y_side, x0 = 0.0, y0 = 0.0, rgb[4] = {0.0, 0.0, 0.0, 0.0};
-//	double *NaN_rgb = NULL, red[4] = {1.0, 0.0, 0.0, 0.0}, wesn[4];
-
-//	struct GMT_GRID *Grid_orig[3] = {NULL, NULL, NULL}, *Grid_proj[3] = {NULL, NULL, NULL};
-//	struct GMT_GRID *Intens_orig = NULL, *Intens_proj = NULL;
-//	struct GMT_PALETTE *P = NULL;
-//	struct MBSWATH_CTRL *Ctrl = NULL;
-//	struct GMT_CTRL *GMT = NULL, *GMT_cpy = NULL;	/* General GMT interal parameters */
-//	struct GMT_OPTION *options = NULL;
-//	struct PSL_CTRL *PSL = NULL;	/* General PSL interal parameters */
-//	struct GMT_GRID_HEADER *header_work = NULL;	/* Pointer to a GMT header for the image or grid */
-//	struct GMTAPI_CTRL *API = GMT_get_API_ptr (V_API);	/* Cast from void to GMTAPI_CTRL pointer */
-
-	char program_name[] = "mbswath";
-//	char help_message[] =  "mbswath is a GMT compatible utility which creates a color postscript \nimage of swath bathymetry or backscatter data.  The image \nmay be shaded relief as well.  Complete maps are made by using \nMBSWATH in conjunction with the usual GMT programs.";
-//	char usage_message[] = "mbswath -Ccptfile -Jparameters -Rwest/east/south/north \n\t[-Afactor -Btickinfo -byr/mon/day/hour/min/sec \n\t-ccopies -Dmode/ampscale/ampmin/ampmax \n\t-Eyr/mon/day/hour/min/sec -fformat \n\t-Fred/green/blue -Gmagnitude/azimuth -Idatalist \n\t-K -Ncptfile -O -P -ppings -Qdpi -Ttimegap -U -W -Xx-shift -Yy-shift \n\t-Zmode[F] -V -H]";
-
-	struct GMT_PALETTE *CPTcolor = NULL;
-	struct GMT_PALETTE *CPTshade = NULL;
-	struct GMT_CTRL *GMT = NULL, *GMT_cpy = NULL;	/* General GMT interal parameters */
-	struct GMT_OPTION *options = NULL;
-	struct PSL_CTRL *PSL = NULL;	/* General PSL interal parameters */
-	struct GMTAPI_CTRL *API = GMT_get_API_ptr (V_API);	/* Cast from void to GMTAPI_CTRL pointer */
-	struct MBSWATH_CTRL *Ctrl = NULL;
-
-	/* MBIO status variables */
-	int	status = MB_SUCCESS;
-	int	verbose = 0;
-	int	error = MB_ERROR_NO_ERROR;
-	char	*message = NULL;
-
-	mb_path file;
-	int     format;
-	int     file_in_bounds;
-	int     read_data;
-	struct ping *pingcur;
-	double  amplog;
-	int     *npings;
-	int     nping_read = 0;
-	int     start, done, first, nplot;
-	int     plot;
-	int     flush;
-	int     save_new;
-	int     i;
-	int     pings;
-
-	/*----------------------- Standard module initialization and parsing ----------------------*/
-
-	if (API == NULL) return (GMT_NOT_A_SESSION);
-	if (mode == GMT_MODULE_PURPOSE) return (GMT_mbswath_usage (API, GMT_MODULE_PURPOSE));	/* Return the purpose of program */
-	options = GMT_Create_Options (API, mode, args);	if (API->error) return (API->error);	/* Set or get option list */
-
-	if (!options || options->option == GMT_OPT_USAGE) bailout (GMT_mbswath_usage (API, GMT_USAGE));	/* Return the usage message */
-	if (options->option == GMT_OPT_SYNOPSIS) bailout (GMT_mbswath_usage (API, GMT_SYNOPSIS));	/* Return the synopsis */
-
-	/* Parse the command-line arguments */
-
-	GMT = GMT_begin_module (API, THIS_MODULE_LIB, THIS_MODULE_NAME, &GMT_cpy); /* Save current state */
-	if (GMT_Parse_Common (API, GMT_PROG_OPTIONS, options))
-                Return (API->error);
-	Ctrl = (struct MBSWATH_CTRL *) New_mbswath_Ctrl (GMT);	/* Allocate and initialize a new control structure */
-	if ((error = GMT_mbswath_parse (GMT, Ctrl, options)))
-                Return (error);
-
-	/*---------------------------- This is the mbswath main code ----------------------------*/
-
-	pings = Ctrl->p.pings;		/* If pings were set by user, prefer it */
-	/* set verbosity */
-
-	verbose = GMT->common.V.active;
-
-        /* set bounds for data reading larger than map borders */
-	Ctrl->bounds[0] = GMT->common.R.wesn[0]
-		- 0.25*(GMT->common.R.wesn[1] - GMT->common.R.wesn[0]);
-	Ctrl->bounds[1] = GMT->common.R.wesn[1]
-		+ 0.25*(GMT->common.R.wesn[1] - GMT->common.R.wesn[0]);
-	Ctrl->bounds[2] = GMT->common.R.wesn[2]
-		- 0.25*(GMT->common.R.wesn[3] - GMT->common.R.wesn[2]);
-	Ctrl->bounds[3] = GMT->common.R.wesn[3]
-		+ 0.25*(GMT->common.R.wesn[3] - GMT->common.R.wesn[2]);
-
-	/* get scaling from degrees to km */
-	mb_coor_scale(verbose, 0.5*(Ctrl->bounds[2] + Ctrl->bounds[3]), &Ctrl->mtodeglon, &Ctrl->mtodeglat);
-
-	/* set lonflip if needed */
-	if (!Ctrl->L.active)
-		{
-		if (Ctrl->bounds[0] < -180.0)
-			Ctrl->L.lonflip = -1;
-		else if (Ctrl->bounds[1] > 180.0)
-			Ctrl->L.lonflip = 1;
-		else if (Ctrl->L.lonflip == -1 && Ctrl->bounds[1] > 0.0)
-			Ctrl->L.lonflip = 0;
-		else if (Ctrl->L.lonflip == 1 && Ctrl->bounds[0] < 0.0)
-			Ctrl->L.lonflip = 0;
-		}
-
-	/* Start the postscript plot */
-	GMT_err_fail (GMT, GMT_map_setup (GMT, GMT->common.R.wesn), "");
-	PSL = GMT_plotinit (GMT, options);
-	GMT_plane_perspective (GMT, GMT->current.proj.z_project.view_plane, GMT->current.proj.z_level);
-	GMT_plotcanvas (GMT);	/* Fill canvas if requested */
-	GMT_map_clip_on (GMT, GMT->session.no_rgb, 3);
-
-	/* Read the color palette file */
-	if (Ctrl->C.active)
-                {   /* Read palette file */
-		if ((CPTcolor = GMT_Get_CPT (GMT, Ctrl->C.cptfile, GMT_CPT_REQUIRED, 0.0, 0.0)) == NULL)
-                        {
-			Return (API->error);
-			}
-                if (CPTcolor && CPTcolor->is_gray && Ctrl->image_type == MBSWATH_IMAGE_24)
-                        Ctrl->image_type = MBSWATH_IMAGE_8;
-        	}
-
-	/* Read the color palette file for amplitude shading if requested */
-	if (Ctrl->N.active)
-                {   /* Read palette file */
-		if ((CPTshade = GMT_Get_CPT (GMT, Ctrl->N.cptfile, GMT_CPT_REQUIRED, 0.0, 0.0)) == NULL)
-                        {
-			Return (API->error);
-			}
-        	}
-                
-        /* Set particulars of output image for the postscript plot */
-	GMT_geo_to_xy(GMT, GMT->common.R.wesn[0], GMT->common.R.wesn[2], &Ctrl->clipx[0], &Ctrl->clipy[0]);
-	GMT_geo_to_xy(GMT, GMT->common.R.wesn[1], GMT->common.R.wesn[2], &Ctrl->clipx[1], &Ctrl->clipy[1]);
-	GMT_geo_to_xy(GMT, GMT->common.R.wesn[1], GMT->common.R.wesn[3], &Ctrl->clipx[2], &Ctrl->clipy[2]);
-	GMT_geo_to_xy(GMT, GMT->common.R.wesn[0], GMT->common.R.wesn[3], &Ctrl->clipx[3], &Ctrl->clipy[3]);
-	Ctrl->x_inch = Ctrl->clipx[1] - Ctrl->clipx[0];
-	Ctrl->y_inch = Ctrl->clipy[2] - Ctrl->clipy[1];
-	Ctrl->x0 = Ctrl->clipx[0];
-	Ctrl->y0 = Ctrl->clipy[0];
-	Ctrl->nx = (int)(Ctrl->x_inch * Ctrl->E.dpi);
-	Ctrl->ny = (int)(Ctrl->y_inch * Ctrl->E.dpi);
-	Ctrl->x_inc = (GMT->common.R.wesn[1] - GMT->common.R.wesn[0]) / (Ctrl->nx - 1);
-	Ctrl->y_inc = (GMT->common.R.wesn[3] - GMT->common.R.wesn[2]) / (Ctrl->ny - 1);
-	Ctrl->x_side = Ctrl->x_inc * Ctrl->nx;
-	Ctrl->y_side = Ctrl->y_inc * Ctrl->ny;
-	Ctrl->nm = Ctrl->nx * Ctrl->ny;
-	Ctrl->nm2 = 2 * Ctrl->nm;
-
-        /* allocate and initialize the output image */
-	if (Ctrl->image_type == MBSWATH_IMAGE_8) {
-                Ctrl->bitimage = GMT_memory (GMT, NULL, Ctrl->nm, unsigned char);
-                memset(Ctrl->bitimage, 255, Ctrl->nm);
-	}
-	else if (Ctrl->image_type == MBSWATH_IMAGE_24) {
-                Ctrl->bitimage = GMT_memory (GMT, NULL, 3 * Ctrl->nm, unsigned char);
-                memset(Ctrl->bitimage, 255, 3 * Ctrl->nm);
-	}
-                
-	/* get format if required */
-	if (Ctrl->F.format == 0)
-		mb_get_format(verbose, Ctrl->I.inputfile, NULL, &Ctrl->F.format, &error);
-
-	/* turn on looking for filtered amp or sidescan if needed */
-	if (Ctrl->Z.usefiltered == MB_YES)
-		{
-		if (Ctrl->Z.mode == MBSWATH_BATH_AMP)
-			Ctrl->filtermode = MBSWATH_FILTER_AMP;
-		else if (Ctrl->Z.mode == MBSWATH_AMP)
-			Ctrl->filtermode = MBSWATH_FILTER_AMP;
-		else if (Ctrl->Z.mode == MBSWATH_SS)
-			Ctrl->filtermode = MBSWATH_FILTER_SIDESCAN;
-		}
-
-	/* determine whether to read one file or a list of files */
-	if (Ctrl->F.format < 0)
-		Ctrl->read_datalist = MB_YES;
-
-	/* open file list */
-	if (Ctrl->read_datalist == MB_YES)
-	    {
-	    if ((status = mb_datalist_open(verbose, &Ctrl->datalist,
-					    Ctrl->I.inputfile, MB_DATALIST_LOOK_UNSET, &error)) != MB_SUCCESS)
-		{
-		error = MB_ERROR_OPEN_FAIL;
-		fprintf(stderr,"\nUnable to open data list file: %s\n", Ctrl->I.inputfile);
-		fprintf(stderr,"\nProgram <%s> Terminated\n", program_name);
-		exit(error);
-		}
-	    if ((status = mb_datalist_read(verbose, Ctrl->datalist,
-			     file, &format, &Ctrl->file_weight, &error))
-			    == MB_SUCCESS)
-		read_data = MB_YES;
-	    else
-		read_data = MB_NO;
-	    }
-	else
-	    {
-	    strcpy(file, Ctrl->I.inputfile);
-	    read_data = MB_YES;
-	    }
-
-	/* loop over files in file list */
-	if (verbose == 1)
-		fprintf(stderr,"\n");
-	while (read_data == MB_YES)
-	    {
-	    /* check for mbinfo file - get file bounds if possible */
-	    status = mb_check_info(verbose, file, Ctrl->L.lonflip, Ctrl->bounds,
-			    &file_in_bounds, &error);
-	    if (status == MB_FAILURE)
-		    {
-		    file_in_bounds = MB_YES;
-		    status = MB_SUCCESS;
-		    error = MB_ERROR_NO_ERROR;
-		    }
-
-	    /* read if data may be in bounds */
-	    if (file_in_bounds == MB_YES)
-		{
-		/* check for "fast bathymetry" or "fbt" file */
-		if (Ctrl->Z.mode == MBSWATH_BATH
-		    || Ctrl->Z.mode == MBSWATH_BATH_RELIEF)
-		    {
-		    mb_get_fbt(verbose, file, &format, &error);
-		    }
-
-		/* check for filtered amplitude or sidescan file */
-		if (Ctrl->filtermode == MBSWATH_FILTER_AMP)
-		    {
-		    if ((status = mb_get_ffa(verbose, file, &format, &error)) != MB_SUCCESS)
-			{
-			mb_error(verbose,error,&message);
-			fprintf(stderr,"\nMBIO Error returned from function <mb_get_ffa>:\n%s\n",message);
-			fprintf(stderr,"Requested filtered amplitude file missing\n");
-			fprintf(stderr,"\nMultibeam File <%s> not initialized for reading\n",file);
-			fprintf(stderr,"\nProgram <%s> Terminated\n",
-				program_name);
-			exit(error);
-			}
-		    }
-		else if (Ctrl->filtermode == MBSWATH_FILTER_SIDESCAN)
-		    {
-		    if ((status = mb_get_ffs(verbose, file, &format, &error)) != MB_SUCCESS)
-			{
-			mb_error(verbose,error,&message);
-			fprintf(stderr,"\nMBIO Error returned from function <mb_get_ffs>:\n%s\n",message);
-			fprintf(stderr,"Requested filtered sidescan file missing\n");
-			fprintf(stderr,"\nMultibeam File <%s> not initialized for reading\n",file);
-			fprintf(stderr,"\nProgram <%s> Terminated\n",
-				program_name);
-			exit(error);
-			}
-		    }
-
-		/* call mb_read_init() */
-		if ((status = mb_read_init(verbose, file, format, pings, Ctrl->L.lonflip, Ctrl->bounds,
-                                            Ctrl->b.time_i, Ctrl->e.time_i, Ctrl->S.speed, Ctrl->T.timegap,
-                                            &Ctrl->mbio_ptr, &Ctrl->btime_d, &Ctrl->etime_d,
-                                            &Ctrl->beams_bath_max, &Ctrl->beams_amp_max, &Ctrl->pixels_ss_max, &error)) != MB_SUCCESS)
-		    {
-		    mb_error(verbose,error,&message);
-		    fprintf(stderr,"\nMBIO Error returned from function <mb_read_init>:\n%s\n",message);
-		    fprintf(stderr,"\nMultibeam File <%s> not initialized for reading\n",file);
-		    fprintf(stderr,"\nProgram <%s> Terminated\n",
-			    program_name);
-		    exit(error);
-		    }
-
-		/* get fore-aft beam_width */
-		status = mb_format_beamwidth(verbose, &format,
-				&Ctrl->beamwidth_xtrack, &Ctrl->beamwidth_ltrack,
-				&error);
-		if (Ctrl->beamwidth_ltrack <= 0.0)
-			Ctrl->beamwidth_ltrack = 2.0;
-		if (Ctrl->A.mode == MBSWATH_FOOTPRINT_REAL)
-                        Ctrl->footprint_factor = Ctrl->A.factor * Ctrl->beamwidth_ltrack;
-		else
-                        Ctrl->footprint_factor = Ctrl->A.factor;
-
-		/* allocate memory for data arrays */
-		status = mb_mallocd(verbose, __FILE__, __LINE__, sizeof(struct swath),
-				(void **)&Ctrl->swath_plot, &error);
-		npings = &Ctrl->swath_plot->npings;
-		Ctrl->swath_plot->beams_bath = Ctrl->beams_bath_max;
-		Ctrl->swath_plot->beams_amp = Ctrl->beams_amp_max;
-		Ctrl->swath_plot->pixels_ss = Ctrl->pixels_ss_max;
-		for (i=0;i<MAXPINGS;i++)
-		    {
-		    pingcur = &(Ctrl->swath_plot->data[i]);
-		    pingcur->beamflag = NULL;
-		    pingcur->bath = NULL;
-		    pingcur->amp = NULL;
-		    pingcur->bathlon = NULL;
-		    pingcur->bathlat = NULL;
-		    pingcur->ss = NULL;
-		    pingcur->sslon = NULL;
-		    pingcur->sslat = NULL;
-		    pingcur->bathflag = NULL;
-		    pingcur->bathfoot = NULL;
-		    pingcur->ssflag = NULL;
-		    pingcur->ssfoot = NULL;
-		    pingcur->bathshade = NULL;
-		    if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(verbose, Ctrl->mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							    sizeof(char), (void **)&(pingcur->beamflag), &error);
-		    if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(verbose, Ctrl->mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							    sizeof(double), (void **)&(pingcur->bath), &error);
-		    if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(verbose, Ctrl->mbio_ptr, MB_MEM_TYPE_AMPLITUDE,
-							    sizeof(double), (void **)&(pingcur->amp), &error);
-		    if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(verbose, Ctrl->mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							    sizeof(double), (void **)&(pingcur->bathlon), &error);
-		    if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(verbose, Ctrl->mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							    sizeof(double), (void **)&(pingcur->bathlat), &error);
-		    if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(verbose, Ctrl->mbio_ptr, MB_MEM_TYPE_SIDESCAN,
-							    sizeof(double), (void **)&(pingcur->ss), &error);
-		    if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(verbose, Ctrl->mbio_ptr, MB_MEM_TYPE_SIDESCAN,
-							    sizeof(double), (void **)&(pingcur->sslon), &error);
-		    if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(verbose, Ctrl->mbio_ptr, MB_MEM_TYPE_SIDESCAN,
-							    sizeof(double), (void **)&(pingcur->sslat), &error);
-		    if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(verbose, Ctrl->mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							    sizeof(int), (void **)&(pingcur->bathflag), &error);
-		    if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(verbose, Ctrl->mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							    sizeof(struct footprint), (void **)&(pingcur->bathfoot), &error);
-		    if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(verbose, Ctrl->mbio_ptr, MB_MEM_TYPE_SIDESCAN,
-							    sizeof(int), (void **)&(pingcur->ssflag), &error);
-		    if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(verbose, Ctrl->mbio_ptr, MB_MEM_TYPE_SIDESCAN,
-							    sizeof(struct footprint), (void **)&(pingcur->ssfoot), &error);
-		    if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(verbose, Ctrl->mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							    sizeof(double), (void **)&(pingcur->bathshade), &error);
-		    }
-
-		/* if error initializing memory then quit */
-		if (error != MB_ERROR_NO_ERROR)
-		    {
-		    mb_error(verbose,error,&message);
-		    fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",message);
-		    fprintf(stderr,"\nProgram <%s> Terminated\n",
-			    program_name);
-		    exit(error);
-		    }
-
-		/* print message */
-		if (verbose >= 2)
-		    fprintf(stderr,"\n");
-		if (verbose >= 1)
-		    fprintf(stderr,"processing data in %s...\n",file);
-
-		/* loop over reading */
-		*npings = 0;
-		start = MB_YES;
-		done = MB_NO;
-		while (done == MB_NO)
-		    {
-		    pingcur = &Ctrl->swath_plot->data[*npings];
-		    status = mb_read(verbose,Ctrl->mbio_ptr,&(pingcur->kind),
-			    &(pingcur->pings),pingcur->time_i,&(pingcur->time_d),
-			    &(pingcur->navlon),&(pingcur->navlat),
-			    &(pingcur->speed),&(pingcur->heading),
-			    &(pingcur->distance),&(pingcur->altitude),
-			    &(pingcur->sonardepth),
-			    &(pingcur->beams_bath),
-			    &(pingcur->beams_amp),
-			    &(pingcur->pixels_ss),
-			    pingcur->beamflag,pingcur->bath,pingcur->amp,
-			    pingcur->bathlon,pingcur->bathlat,
-			    pingcur->ss,pingcur->sslon,pingcur->sslat,
-			    pingcur->comment,&error);
-
-		    /* print debug statements */
-		    if (verbose >= 2)
-			    {
-			    fprintf(stderr,"\ndbg2  Ping read in program <%s>\n", program_name);
-			    fprintf(stderr,"dbg2       kind:           %d\n", pingcur->kind);
-			    fprintf(stderr,"dbg2       beams_bath:     %d\n", pingcur->beams_bath);
-			    fprintf(stderr,"dbg2       beams_amp:      %d\n", pingcur->beams_amp);
-			    fprintf(stderr,"dbg2       pixels_ss:      %d\n", pingcur->pixels_ss);
-			    fprintf(stderr,"dbg2       error:          %d\n", error);
-			    fprintf(stderr,"dbg2       status:         %d\n", status);
-			    for (i=0;i<pingcur->beams_bath;i++)
-				    {
-				    fprintf(stderr, "bath[%4d]:  %3d  %f  %f  %f\n",
-					    i, pingcur->beamflag[i], pingcur->bath[i], pingcur->bathlon[i], pingcur->bathlat[i]);
-				    }
-			    for (i=0;i<pingcur->beams_amp;i++)
-				    {
-				    fprintf(stderr, "amp[%4d]:  %f  %f  %f\n",
-					    i, pingcur->amp[i], pingcur->bathlon[i], pingcur->bathlat[i]);
-				    }
-			    for (i=0;i<pingcur->pixels_ss;i++)
-				    {
-				    fprintf(stderr, "ss[%4d]:  %f  %f  %f\n",
-					    i, pingcur->ss[i], pingcur->sslon[i], pingcur->sslat[i]);
-				    }
-			    }
-
-		    /* ignore time gaps */
-		    if (error == MB_ERROR_TIME_GAP)
-		    	    {
-			    error = MB_ERROR_NO_ERROR;
-			    status = MB_SUCCESS;
-			    }
-
-		    /* update bookkeeping */
-		    if (error == MB_ERROR_NO_ERROR)
-			    {
-			    nping_read += pingcur->pings;
-			    (*npings)++;
-			    }
-
-		    /* scale amplitudes if necessary */
-		    if (error == MB_ERROR_NO_ERROR
-			    && (mode == MBSWATH_BATH_AMP
-			    || mode == MBSWATH_AMP)
-			    && Ctrl->D.mode > 0)
-			    {
-			    for (i=0;i<pingcur->beams_amp;i++)
-				    {
-				    if (mb_beam_ok(pingcur->beamflag[i]) && Ctrl->D.mode == 1)
-					{
-					pingcur->amp[i] = Ctrl->D.ampscale * (pingcur->amp[i] - Ctrl->D.ampmin)
-					     / (Ctrl->D.ampmax - Ctrl->D.ampmin);
-					}
-				    else if (mb_beam_ok(pingcur->beamflag[i]) && Ctrl->D.mode == 2)
-					{
-					pingcur->amp[i] = MIN(pingcur->amp[i],Ctrl->D.ampmax);
-					pingcur->amp[i] = MAX(pingcur->amp[i],Ctrl->D.ampmin);
-					pingcur->amp[i] = Ctrl->D.ampscale * (pingcur->amp[i] - Ctrl->D.ampmin)
-                                                            / (Ctrl->D.ampmax - Ctrl->D.ampmin);
-					}
-				    else if (mb_beam_ok(pingcur->beamflag[i]) && Ctrl->D.mode == 3)
-					{
-					amplog = 20.0 * log10(pingcur->amp[i]);
-					pingcur->amp[i] = Ctrl->D.ampscale * (amplog - Ctrl->D.ampmin)
-					     / (Ctrl->D.ampmax - Ctrl->D.ampmin);
-					}
-				    else if (mb_beam_ok(pingcur->beamflag[i]) && Ctrl->D.mode == 4)
-					{
-					amplog = 20.0 * log10(pingcur->amp[i]);
-					amplog = MIN(amplog,Ctrl->D.ampmax);
-					amplog = MAX(amplog,Ctrl->D.ampmin);
-					pingcur->amp[i] = Ctrl->D.ampscale * (amplog - Ctrl->D.ampmin)
-					        / (Ctrl->D.ampmax - Ctrl->D.ampmin);
-					}
-				    }
-			    }
-
-		    /* scale bathymetry from meters to feet if necessary */
-		    if (error == MB_ERROR_NO_ERROR
-			    && Ctrl->W.active == true)
-			    {
-			    for (i=0;i<pingcur->beams_bath;i++)
-				    {
-				    pingcur->bath[i] = 3.2808399 * pingcur->bath[i];
-				    }
-			    }
-
-		    /* scale sidescan if necessary */
-		    if (error == MB_ERROR_NO_ERROR
-			    && mode == MBSWATH_SS
-			    && Ctrl->D.mode > 0)
-			    {
-			    for (i=0;i<pingcur->pixels_ss;i++)
-				    {
-				    if (pingcur->ss[i] > MB_SIDESCAN_NULL && Ctrl->D.mode == 1)
-					{
-					pingcur->ss[i] = Ctrl->D.ampscale * (pingcur->ss[i] - Ctrl->D.ampmin)
-					     / (Ctrl->D.ampmax - Ctrl->D.ampmin);
-					}
-				    else if (pingcur->ss[i] > MB_SIDESCAN_NULL && Ctrl->D.mode == 2)
-					{
-					pingcur->ss[i] = MIN(pingcur->ss[i],Ctrl->D.ampmax);
-					pingcur->ss[i] = MAX(pingcur->ss[i],Ctrl->D.ampmin);
-					pingcur->ss[i] = Ctrl->D.ampscale * (pingcur->ss[i] - Ctrl->D.ampmin)
-					     / (Ctrl->D.ampmax - Ctrl->D.ampmin);
-					}
-				    else if (pingcur->ss[i] > MB_SIDESCAN_NULL && Ctrl->D.mode == 3)
-					{
-					amplog = 20.0 * log10(pingcur->ss[i]);
-					pingcur->ss[i] = Ctrl->D.ampscale * (amplog - Ctrl->D.ampmin)
-					     / (Ctrl->D.ampmax - Ctrl->D.ampmin);
-					}
-				    else if (pingcur->ss[i] > MB_SIDESCAN_NULL && Ctrl->D.mode == 4)
-					{
-					amplog = 20.0 * log10(pingcur->ss[i]);
-					amplog = MIN(amplog,Ctrl->D.ampmax);
-					amplog = MAX(amplog,Ctrl->D.ampmin);
-					pingcur->ss[i] = Ctrl->D.ampscale * (amplog - Ctrl->D.ampmin)
-					        / (Ctrl->D.ampmax - Ctrl->D.ampmin);
-					}
-				    }
-			    }
-
-		    /* decide whether to plot, whether to
-			    save the new ping, and if done */
-		    plot = MB_NO;
-		    flush = MB_NO;
-		    if (*npings >= MAXPINGS)
-			    plot = MB_YES;
-		    if (*npings > 0
-			    && (error > MB_ERROR_NO_ERROR
-			    || error == MB_ERROR_TIME_GAP
-			    || error == MB_ERROR_OUT_BOUNDS
-			    || error == MB_ERROR_OUT_TIME
-			    || error == MB_ERROR_SPEED_TOO_SMALL))
-			    {
-			    plot = MB_YES;
-			    flush = MB_YES;
-			    }
-		    save_new = MB_NO;
-		    if (error == MB_ERROR_TIME_GAP)
-			    save_new = MB_YES;
-		    if (error > MB_ERROR_NO_ERROR)
-			    done = MB_YES;
-
-		    /* if enough pings read in, plot them */
-		    if (plot == MB_YES)
-			    {
-			    /* get footprint locations */
-			    if (Ctrl->A.mode != MBSWATH_FOOTPRINT_POINT)
-			    status = mbswath_get_footprints(verbose, Ctrl, &error);
-
-			    /* get shading */
-			    if (Ctrl->Z.mode == MBSWATH_BATH_RELIEF
-				    || Ctrl->Z.mode == MBSWATH_BATH_AMP)
-				    status = mbswath_get_shading(verbose, Ctrl, GMT, CPTshade, &error);
-
-			    /* plot data */
-			    if (start == MB_YES)
-				    {
-				    first = 0;
-				    start = MB_NO;
-				    }
-			    else
-				    first = 1;
-			    if (done == MB_YES)
-				    nplot = *npings - first;
-			    else
-				    nplot = *npings - first - 1;
-
-			    if (Ctrl->A.mode == MBSWATH_FOOTPRINT_POINT)
-				    status = mbswath_plot_data_point(verbose, Ctrl, GMT, CPTcolor, PSL,
-                                                                first, nplot, &error);
-			    else
-				    status = mbswath_plot_data_footprint(verbose, Ctrl, GMT, CPTcolor, PSL,
-                                                                first, nplot, &error);
-
-
-			    /* reorganize data */
-			    if (flush == MB_YES && save_new == MB_YES)
-				    {
-				    status = mbswath_ping_copy(verbose,0, *npings, Ctrl->swath_plot, &error);
-				    *npings = 1;
-				    start = MB_YES;
-				    }
-			    else if (flush == MB_YES)
-				    {
-				    *npings = 0;
-				    start = MB_YES;
-				    }
-			    else if (*npings > 1)
-				    {
-				    for (i=0;i<2;i++)
-					    status = mbswath_ping_copy(verbose,i, *npings-2+i, Ctrl->swath_plot, &error);
-				    *npings = 2;
-				    }
-			    }
-		    }
-		status = mb_close(verbose,&Ctrl->mbio_ptr,&error);
-
-		/* deallocate memory for data arrays */
-		mb_freed(verbose,__FILE__, __LINE__, (void **)&Ctrl->swath_plot, &error);
-		} /* end if file in bounds */
-
-	    /* figure out whether and what to read next */
-	    if (Ctrl->read_datalist == MB_YES)
-                {
-		if ((status = mb_datalist_read(verbose, Ctrl->datalist, file, &format, &Ctrl->file_weight, &error))
-			    == MB_SUCCESS)
-                        read_data = MB_YES;
-                else
-                        read_data = MB_NO;
-                }
-	    else
-                {
-                read_data = MB_NO;
-                }
-
-	    /* end loop over files in list */
-	    }
-	if (Ctrl->read_datalist == MB_YES)
-		mb_datalist_close(verbose, &Ctrl->datalist, &error);
-
-	/* Generate grayscale 8-bit image */
-        if (Ctrl->image_type == MBSWATH_IMAGE_8)
-                {
-		GMT_Report (API, GMT_MSG_VERBOSE, "Creating 8-bit grayshade image\n");
-		PSL_plotcolorimage (PSL, Ctrl->x0, Ctrl->y0, Ctrl->x_inch, Ctrl->y_inch, PSL_BL, Ctrl->bitimage, Ctrl->nx, Ctrl->ny, (Ctrl->E.device_dpi ? -8 : 8));
-                }
-                
-        /* Generate full color 24-bit image */
-	else if (Ctrl->image_type == MBSWATH_IMAGE_24)
-                {
-		GMT_Report (API, GMT_MSG_VERBOSE, "Creating 24-bit color image\n");
-		PSL_plotcolorimage (PSL, Ctrl->x0, Ctrl->y0, Ctrl->x_inch, Ctrl->y_inch, PSL_BL, Ctrl->bitimage, Ctrl->nx, Ctrl->ny, (Ctrl->E.device_dpi ? -24 : 24));
-                }
-
-	GMT_map_clip_off (GMT);
-
-	GMT_map_basemap (GMT);
-	GMT_plane_perspective (GMT, -1, 0.0);
-	GMT_plotend (GMT);
-
-	/* Free bitimage arrays. GMT_free will not complain if they have not been used (NULL) */
-	if (Ctrl->bitimage) GMT_free (GMT, Ctrl->bitimage);
-
-	if (!Ctrl->C.active && GMT_Destroy_Data (API, &CPTcolor) != GMT_OK)
-                {
-		Return (API->error);
-                }
-	if (!Ctrl->N.active && GMT_Destroy_Data (API, &CPTshade) != GMT_OK)
-                {
-		Return (API->error);
-                }
-	Return (EXIT_SUCCESS);
-}
-/*--------------------------------------------------------------------*/
-int mbswath_get_footprints(int verbose, struct MBSWATH_CTRL *Ctrl, int *error)
-{
-	char	*function_name = "mbswath_get_footprints";
-	int	status = MB_SUCCESS;
-        struct swath *swath;
-        struct ping *pingcur;
-	struct footprint *print;
-	int	dobath, doss;
-	double	headingx, headingy;
-	double	dx, dy, r, dlon1, dlon2, dlat1, dlat2, tt, x, y;
-	double	ddlonx, ddlaty, rfactor;
-	static double	dddepth = 0.0;
-	int	setprint;
-        struct mb_io_struct *mb_io_ptr;
-	int	i, j, k;
-                
-        /* get swath */
-        swath = Ctrl->swath_plot;
-        mb_io_ptr = (struct mb_io_struct *) Ctrl->mbio_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBSWATH function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:                  %d\n",verbose);
-		fprintf(stderr,"dbg2       Ctrl->A.mode:             %d\n", Ctrl->A.mode);
-		fprintf(stderr,"dbg2       Ctrl->A.factor:           %f\n", Ctrl->A.factor);
-		fprintf(stderr,"dbg2       Ctrl->A.depth:            %f\n",Ctrl->A.depth);
-		fprintf(stderr,"dbg2       Ctrl->footprint_factor:   %f\n",Ctrl->footprint_factor);
-		fprintf(stderr,"dbg2       Ctrl->swath_plot:         %p\n",Ctrl->swath_plot);
-		fprintf(stderr,"dbg2       Ctrl->mtodeglon:          %f\n",Ctrl->mtodeglon);
-		fprintf(stderr,"dbg2       Ctrl->mtodeglat:          %f\n",Ctrl->mtodeglat);
-		fprintf(stderr,"dbg2       pings:                    %d\n",swath->npings);
-		}
-
-	/* set mode of operation */
-	if (Ctrl->Z.mode != MBSWATH_SS
-                && Ctrl->Z.mode != MBSWATH_SS_FILTER)
-		{
-		dobath = MB_YES;
-		doss = MB_NO;
-		}
-	else
-		{
-		dobath = MB_NO;
-		doss = MB_YES;
-		}
-
-	/* set all footprint flags to zero */
-	for (i=0;i<swath->npings;i++)
-		{
-		pingcur = &swath->data[i];
-		for (j=0;j<pingcur->beams_bath;j++)
-			pingcur->bathflag[j] = MB_NO;
-		for (j=0;j<pingcur->pixels_ss;j++)
-			pingcur->ssflag[j] = MB_NO;
-		}
-
-	/* get fore-aft components of beam footprints */
-	if (swath->npings > 1 && Ctrl->A.mode == MBSWATH_FOOTPRINT_FAKE)
-	  {
-	  for (i=0;i<swath->npings;i++)
-		{
-		/* initialize */
-		pingcur = &swath->data[i];
-		pingcur->lonaft = 0.0;
-		pingcur->lataft = 0.0;
-		pingcur->lonfor = 0.0;
-		pingcur->latfor = 0.0;
-
-		/* get aft looking */
-		if (i > 0)
-			{
-			headingx = sin(pingcur->heading*DTR);
-			headingy = cos(pingcur->heading*DTR);
-			dx = (swath->data[i-1].navlon - pingcur->navlon)
-				/Ctrl->mtodeglon;
-			dy = (swath->data[i-1].navlat - pingcur->navlat)
-				/Ctrl->mtodeglat;
-			r = sqrt(dx*dx + dy*dy);
-			pingcur->lonaft = Ctrl->footprint_factor * r * headingx * Ctrl->mtodeglon;
-			pingcur->lataft = Ctrl->footprint_factor * r * headingy * Ctrl->mtodeglat;
-			}
-
-		/* get forward looking */
-		if (i < swath->npings - 1)
-			{
-			headingx = sin(pingcur->heading*DTR);
-			headingy = cos(pingcur->heading*DTR);
-			dx = (swath->data[i+1].navlon - pingcur->navlon)
-				/Ctrl->mtodeglon;
-			dy = (swath->data[i+1].navlat - pingcur->navlat)
-				/Ctrl->mtodeglat;
-			r = sqrt(dx*dx + dy*dy);
-			pingcur->lonfor = Ctrl->footprint_factor * r * headingx * Ctrl->mtodeglon;
-			pingcur->latfor = Ctrl->footprint_factor * r * headingy * Ctrl->mtodeglat;
-			}
-
-		/* take care of first ping */
-		if (i == 0)
-			{
-			pingcur->lonaft = -pingcur->lonfor;
-			pingcur->lataft = -pingcur->latfor;
-			}
-
-		/* take care of last ping */
-		if (i == swath->npings - 1)
-			{
-			pingcur->lonfor = -pingcur->lonaft;
-			pingcur->latfor = -pingcur->lataft;
-			}
-		}
-	  }
-
-	/* take care of just one ping with nonzero center beam */
-	else if (swath->npings == 1 && Ctrl->A.mode == MBSWATH_FOOTPRINT_FAKE
-		&& mb_beam_ok(swath->data[0].beamflag[pingcur->beams_bath/2])
-		&& Ctrl->A.depth <= 0.0)
-	  {
-	  pingcur = &swath->data[0];
-	  headingx = sin(pingcur->heading*DTR);
-	  headingy = cos(pingcur->heading*DTR);
-	  tt = pingcur->bath[pingcur->beams_bath/2]/750.0; /* in s */
-	  r = tt * pingcur->speed * 0.55555556; /* in m */
-	  pingcur->lonaft = -Ctrl->footprint_factor * r * headingx * Ctrl->mtodeglon;
-	  pingcur->lataft = -Ctrl->footprint_factor * r * headingy * Ctrl->mtodeglat;
-	  pingcur->lonfor = Ctrl->footprint_factor * r * headingx * Ctrl->mtodeglon;
-	  pingcur->latfor = Ctrl->footprint_factor * r * headingy * Ctrl->mtodeglat;
-	  }
-
-	/* else get rfactor if using fore-aft beam width */
-	else if (Ctrl->A.mode == MBSWATH_FOOTPRINT_REAL)
-	  {
-	  rfactor = 0.5*sin(DTR*Ctrl->footprint_factor);
-	  }
-
-	/* loop over the inner beams and get
-		the obvious footprint boundaries */
-	for (i=0;i<swath->npings;i++)
-		{
-		pingcur = &swath->data[i];
-
-		/* get heading if using fore-aft beam width */
-		if (Ctrl->A.mode == MBSWATH_FOOTPRINT_REAL)
-			{
-			headingx = sin(pingcur->heading*DTR);
-			headingy = cos(pingcur->heading*DTR);
-			}
-
-		/* do bathymetry */
-		if (dobath == MB_YES)
-		  for (j=1;j<pingcur->beams_bath-1;j++)
-		    if (mb_beam_ok(pingcur->beamflag[j]))
-			{
-			x = pingcur->bathlon[j];
-			y = pingcur->bathlat[j];
-			setprint = MB_NO;
-			if (mb_beam_ok(pingcur->beamflag[j-1])
-				&& mb_beam_ok(pingcur->beamflag[j+1]))
-				{
-				setprint = MB_YES;
-				dlon1 = pingcur->bathlon[j-1]
-					- pingcur->bathlon[j];
-				dlat1 = pingcur->bathlat[j-1]
-					- pingcur->bathlat[j];
-				dlon2 = pingcur->bathlon[j+1]
-					- pingcur->bathlon[j];
-				dlat2 = pingcur->bathlat[j+1]
-					- pingcur->bathlat[j];
-				}
-			else if (mb_beam_ok(pingcur->beamflag[j-1]))
-				{
-				setprint = MB_YES;
-				dlon1 = pingcur->bathlon[j-1]
-					- pingcur->bathlon[j];
-				dlat1 = pingcur->bathlat[j-1]
-					- pingcur->bathlat[j];
-				dlon2 = -dlon1;
-				dlat2 = -dlat1;
-				}
-			else if (mb_beam_ok(pingcur->beamflag[j+1]))
-				{
-				setprint = MB_YES;
-				dlon2 = pingcur->bathlon[j+1]
-					- pingcur->bathlon[j];
-				dlat2 = pingcur->bathlat[j+1]
-					- pingcur->bathlat[j];
-				dlon1 = -dlon2;
-				dlat1 = -dlat2;
-				}
-
-			/* do it using fore-aft beam width */
-			if (setprint == MB_YES
-				&& Ctrl->A.mode == MBSWATH_FOOTPRINT_REAL)
-				{
-				print = &pingcur->bathfoot[j];
-				pingcur->bathflag[j] = MB_YES;
-				ddlonx = (pingcur->bathlon[j]
-					- pingcur->navlon)/Ctrl->mtodeglon;
-				ddlaty = (pingcur->bathlat[j]
-					- pingcur->navlat)/Ctrl->mtodeglat;
-				if (Ctrl->A.depth > 0.0)
-					dddepth = Ctrl->A.depth;
-				else if (pingcur->altitude > 0.0)
-					dddepth = pingcur->altitude;
-				else
-					dddepth = pingcur->bath[j];
-				r = rfactor*sqrt(ddlonx*ddlonx
-					+ ddlaty*ddlaty
-					+ dddepth*dddepth);
-				pingcur->lonaft = -r * headingx * Ctrl->mtodeglon;
-				pingcur->lataft = -r * headingy * Ctrl->mtodeglat;
-				pingcur->lonfor = r * headingx * Ctrl->mtodeglon;
-				pingcur->latfor = r * headingy * Ctrl->mtodeglat;
-				print->x[0] = x + dlon1 + pingcur->lonaft;
-				print->y[0] = y + dlat1 + pingcur->lataft;
-				print->x[1] = x + dlon2 + pingcur->lonaft;
-				print->y[1] = y + dlat2 + pingcur->lataft;
-				print->x[2] = x + dlon2 + pingcur->lonfor;
-				print->y[2] = y + dlat2 + pingcur->latfor;
-				print->x[3] = x + dlon1 + pingcur->lonfor;
-				print->y[3] = y + dlat1 + pingcur->latfor;
-				}
-
-			/* do it using ping nav separation */
-			else if (setprint == MB_YES)
-				{
-				print = &pingcur->bathfoot[j];
-				pingcur->bathflag[j] = MB_YES;
-				print->x[0] = x + dlon1 + pingcur->lonaft;
-				print->y[0] = y + dlat1 + pingcur->lataft;
-				print->x[1] = x + dlon2 + pingcur->lonaft;
-				print->y[1] = y + dlat2 + pingcur->lataft;
-				print->x[2] = x + dlon2 + pingcur->lonfor;
-				print->y[2] = y + dlat2 + pingcur->latfor;
-				print->x[3] = x + dlon1 + pingcur->lonfor;
-				print->y[3] = y + dlat1 + pingcur->latfor;
-				}
-			}
-
-		/* do sidescan */
-		if (doss == MB_YES)
-		  for (j=1;j<pingcur->pixels_ss-1;j++)
-		    if (pingcur->ss[j] > MB_SIDESCAN_NULL)
-			{
-			x = pingcur->sslon[j];
-			y = pingcur->sslat[j];
-			setprint = MB_NO;
-			if (pingcur->ss[j-1] > MB_SIDESCAN_NULL
-				&& pingcur->ss[j+1] > MB_SIDESCAN_NULL)
-				{
-				setprint = MB_YES;
-				dlon1 = pingcur->sslon[j-1]
-					- pingcur->sslon[j];
-				dlat1 = pingcur->sslat[j-1]
-					- pingcur->sslat[j];
-				dlon2 = pingcur->sslon[j+1]
-					- pingcur->sslon[j];
-				dlat2 = pingcur->sslat[j+1]
-					- pingcur->sslat[j];
-				}
-			else if (pingcur->ss[j-1] > MB_SIDESCAN_NULL)
-				{
-				setprint = MB_YES;
-				dlon1 = pingcur->sslon[j-1]
-					- pingcur->sslon[j];
-				dlat1 = pingcur->sslat[j-1]
-					- pingcur->sslat[j];
-				dlon2 = -dlon1;
-				dlat2 = -dlat1;
-				}
-			else if (pingcur->ss[j+1] > MB_SIDESCAN_NULL)
-				{
-				setprint = MB_YES;
-				dlon2 = pingcur->sslon[j+1]
-					- pingcur->sslon[j];
-				dlat2 = pingcur->sslat[j+1]
-					- pingcur->sslat[j];
-				dlon1 = -dlon2;
-				dlat1 = -dlat2;
-				}
-
-			/* do it using fore-aft beam width */
-			if (setprint == MB_YES
-				&& Ctrl->A.mode == MBSWATH_FOOTPRINT_REAL)
-				{
-				print = &pingcur->ssfoot[j];
-				pingcur->ssflag[j] = MB_YES;
-				ddlonx = (pingcur->sslon[j]
-					- pingcur->navlon)/Ctrl->mtodeglon;
-				ddlaty = (pingcur->sslat[j]
-					- pingcur->navlat)/Ctrl->mtodeglat;
-				if (Ctrl->A.depth > 0.0)
-					dddepth = Ctrl->A.depth;
-				else if (pingcur->altitude > 0.0)
-					dddepth = pingcur->altitude;
-				else if (pingcur->beams_bath > 0
-					&& mb_beam_ok(pingcur->beamflag[pingcur->beams_bath/2]))
-					dddepth = pingcur->bath[pingcur->beams_bath/2];
-				r = rfactor*sqrt(ddlonx*ddlonx
-					+ ddlaty*ddlaty + dddepth*dddepth);
-				pingcur->lonaft = -r * headingx * Ctrl->mtodeglon;
-				pingcur->lataft = -r * headingy * Ctrl->mtodeglat;
-				pingcur->lonfor = r * headingx * Ctrl->mtodeglon;
-				pingcur->latfor = r * headingy * Ctrl->mtodeglat;
-				print->x[0] = x + dlon1 + pingcur->lonaft;
-				print->y[0] = y + dlat1 + pingcur->lataft;
-				print->x[1] = x + dlon2 + pingcur->lonaft;
-				print->y[1] = y + dlat2 + pingcur->lataft;
-				print->x[2] = x + dlon2 + pingcur->lonfor;
-				print->y[2] = y + dlat2 + pingcur->latfor;
-				print->x[3] = x + dlon1 + pingcur->lonfor;
-				print->y[3] = y + dlat1 + pingcur->latfor;
-				}
-
-			/* do it using ping nav separation */
-			else if (setprint == MB_YES)
-				{
-				print = &pingcur->ssfoot[j];
-				pingcur->ssflag[j] = MB_YES;
-				print->x[0] = x + dlon1 + pingcur->lonaft;
-				print->y[0] = y + dlat1 + pingcur->lataft;
-				print->x[1] = x + dlon2 + pingcur->lonaft;
-				print->y[1] = y + dlat2 + pingcur->lataft;
-				print->x[2] = x + dlon2 + pingcur->lonfor;
-				print->y[2] = y + dlat2 + pingcur->latfor;
-				print->x[3] = x + dlon1 + pingcur->lonfor;
-				print->y[3] = y + dlat1 + pingcur->latfor;
-				}
-			}
-		}
-
-	/* loop over the outer beams and get
-		the obvious footprint boundaries */
-	for (i=0;i<swath->npings;i++)
-		{
-		pingcur = &swath->data[i];
-
-		/* get heading if using fore-aft beam width */
-		if (Ctrl->A.mode == MBSWATH_FOOTPRINT_REAL)
-			{
-			headingx = sin(pingcur->heading*DTR);
-			headingy = cos(pingcur->heading*DTR);
-			}
-
-		/* do bathymetry with more than 2 soundings */
-		if (dobath == MB_YES && pingcur->beams_bath > 2)
-		  {
-		  j = 0;
-		  if (mb_beam_ok(pingcur->beamflag[j])
-			&& mb_beam_ok(pingcur->beamflag[j+1]))
-			{
-			x = pingcur->bathlon[j];
-			y = pingcur->bathlat[j];
-			dlon2 = pingcur->bathlon[j+1]
-				- pingcur->bathlon[j];
-			dlat2 = pingcur->bathlat[j+1]
-				- pingcur->bathlat[j];
-			dlon1 = -dlon2;
-			dlat1 = -dlat2;
-			print = &pingcur->bathfoot[j];
-			pingcur->bathflag[j] = MB_YES;
-
-			/* using fore-aft beam width */
-			if (Ctrl->A.mode == MBSWATH_FOOTPRINT_REAL)
-				{
-				ddlonx = (pingcur->bathlon[j]
-					- pingcur->navlon)/Ctrl->mtodeglon;
-				ddlaty = (pingcur->bathlat[j]
-					- pingcur->navlat)/Ctrl->mtodeglat;
-				if (Ctrl->A.depth > 0.0)
-					dddepth = Ctrl->A.depth;
-				else if (pingcur->altitude > 0.0)
-					dddepth = pingcur->altitude;
-				else
-					dddepth = pingcur->bath[j];
-				r = rfactor*sqrt(ddlonx*ddlonx
-					+ ddlaty*ddlaty
-					+ dddepth*dddepth);
-				pingcur->lonaft = -r * headingx * Ctrl->mtodeglon;
-				pingcur->lataft = -r * headingy * Ctrl->mtodeglat;
-				pingcur->lonfor = r * headingx * Ctrl->mtodeglon;
-				pingcur->latfor = r * headingy * Ctrl->mtodeglat;
-				}
-
-			print->x[0] = x + dlon1 + pingcur->lonaft;
-			print->y[0] = y + dlat1 + pingcur->lataft;
-			print->x[1] = x + dlon2 + pingcur->lonaft;
-			print->y[1] = y + dlat2 + pingcur->lataft;
-			print->x[2] = x + dlon2 + pingcur->lonfor;
-			print->y[2] = y + dlat2 + pingcur->latfor;
-			print->x[3] = x + dlon1 + pingcur->lonfor;
-			print->y[3] = y + dlat1 + pingcur->latfor;
-			}
-		  j = pingcur->beams_bath-1;
-		  if (mb_beam_ok(pingcur->beamflag[j])
-			&& mb_beam_ok(pingcur->beamflag[j-1]))
-			{
-			x = pingcur->bathlon[j];
-			y = pingcur->bathlat[j];
-			dlon1 = pingcur->bathlon[j-1]
-				- pingcur->bathlon[j];
-			dlat1 = pingcur->bathlat[j-1]
-				- pingcur->bathlat[j];
-			dlon2 = -dlon1;
-			dlat2 = -dlat1;
-			print = &pingcur->bathfoot[j];
-			pingcur->bathflag[j] = MB_YES;
-
-			/* using fore-aft beam width */
-			if (Ctrl->A.mode == MBSWATH_FOOTPRINT_REAL)
-				{
-				ddlonx = (pingcur->bathlon[j]
-					- pingcur->navlon)/Ctrl->mtodeglon;
-				ddlaty = (pingcur->bathlat[j]
-					- pingcur->navlat)/Ctrl->mtodeglat;
-				if (Ctrl->A.depth > 0.0)
-					dddepth = Ctrl->A.depth;
-				else if (pingcur->altitude > 0.0)
-					dddepth = pingcur->altitude;
-				else
-					dddepth = pingcur->bath[j];
-				r = rfactor*sqrt(ddlonx*ddlonx
-					+ ddlaty*ddlaty
-					+ dddepth*dddepth);
-				pingcur->lonaft = -r * headingx * Ctrl->mtodeglon;
-				pingcur->lataft = -r * headingy * Ctrl->mtodeglat;
-				pingcur->lonfor = r * headingx * Ctrl->mtodeglon;
-				pingcur->latfor = r * headingy * Ctrl->mtodeglat;
-				}
-
-			print->x[0] = x + dlon1 + pingcur->lonaft;
-			print->y[0] = y + dlat1 + pingcur->lataft;
-			print->x[1] = x + dlon2 + pingcur->lonaft;
-			print->y[1] = y + dlat2 + pingcur->lataft;
-			print->x[2] = x + dlon2 + pingcur->lonfor;
-			print->y[2] = y + dlat2 + pingcur->latfor;
-			print->x[3] = x + dlon1 + pingcur->lonfor;
-			print->y[3] = y + dlat1 + pingcur->latfor;
-			}
-		  }
-
-		/* do bathymetry with 1 sounding */
-		if (dobath == MB_YES && Ctrl->A.mode == MBSWATH_FOOTPRINT_REAL && pingcur->beams_bath == 1)
-		  {
-		  if (mb_beam_ok(pingcur->beamflag[0]))
-			{
-			print = &pingcur->bathfoot[0];
-			pingcur->bathflag[0] = MB_YES;
-			ddlonx = (pingcur->bathlon[0]
-				- pingcur->navlon)/Ctrl->mtodeglon;
-			ddlaty = (pingcur->bathlat[0]
-				- pingcur->navlat)/Ctrl->mtodeglat;
-			if (Ctrl->A.depth > 0.0)
-				dddepth = Ctrl->A.depth;
-			else if (pingcur->altitude > 0.0)
-				dddepth = pingcur->altitude;
-			else
-				dddepth = pingcur->bath[0];
-			r = rfactor*sqrt(ddlonx*ddlonx
-				+ ddlaty*ddlaty
-				+ dddepth*dddepth);
-
-			dlon2 = -r * headingy * Ctrl->mtodeglon;
-			dlat2 = -r * headingx * Ctrl->mtodeglat;
-			dlon1 = r * headingy * Ctrl->mtodeglon;
-			dlat1 = r * headingx * Ctrl->mtodeglat;
-			pingcur->lonaft = -r * headingx * Ctrl->mtodeglon;
-			pingcur->lataft = -r * headingy * Ctrl->mtodeglat;
-			pingcur->lonfor = r * headingx * Ctrl->mtodeglon;
-			pingcur->latfor = r * headingy * Ctrl->mtodeglat;
-			print->x[0] = pingcur->bathlon[0] + dlon1 + pingcur->lonaft;
-			print->y[0] = pingcur->bathlat[0] + dlat1 + pingcur->lataft;
-			print->x[1] = pingcur->bathlon[0] + dlon2 + pingcur->lonaft;
-			print->y[1] = pingcur->bathlat[0] + dlat2 + pingcur->lataft;
-			print->x[2] = pingcur->bathlon[0] + dlon2 + pingcur->lonfor;
-			print->y[2] = pingcur->bathlat[0] + dlat2 + pingcur->latfor;
-			print->x[3] = pingcur->bathlon[0] + dlon1 + pingcur->lonfor;
-			print->y[3] = pingcur->bathlat[0] + dlat1 + pingcur->latfor;
-			}
-		  }
-
-		/* do sidescan */
-		if (doss == MB_YES && pingcur->pixels_ss > 2)
-		  {
-		  j = 0;
-		  if (pingcur->ss[j] > MB_SIDESCAN_NULL && pingcur->ss[j+1] > MB_SIDESCAN_NULL)
-			{
-			x = pingcur->sslon[j];
-			y = pingcur->sslat[j];
-			dlon2 = pingcur->sslon[j+1]
-				- pingcur->sslon[j];
-			dlat2 = pingcur->sslat[j+1]
-				- pingcur->sslat[j];
-			dlon1 = -dlon2;
-			dlat1 = -dlat2;
-			print = &pingcur->ssfoot[j];
-			pingcur->ssflag[j] = MB_YES;
-
-			/* using fore-aft beam width */
-			if (Ctrl->A.mode == MBSWATH_FOOTPRINT_REAL)
-				{
-				ddlonx = (pingcur->sslon[j]
-					- pingcur->navlon)/Ctrl->mtodeglon;
-				ddlaty = (pingcur->sslat[j]
-					- pingcur->navlat)/Ctrl->mtodeglat;
-				if (Ctrl->A.depth > 0.0)
-					dddepth = Ctrl->A.depth;
-				else if (pingcur->altitude > 0.0)
-					dddepth = pingcur->altitude;
-				else if (pingcur->beams_bath > 0
-					&& mb_beam_ok(pingcur->beamflag[pingcur->beams_bath/2]))
-					dddepth = pingcur->bath[pingcur->beams_bath/2];
-				r = rfactor*sqrt(ddlonx*ddlonx
-					+ ddlaty*ddlaty + dddepth*dddepth);
-				pingcur->lonaft = -r * headingx * Ctrl->mtodeglon;
-				pingcur->lataft = -r * headingy * Ctrl->mtodeglat;
-				pingcur->lonfor = r * headingx * Ctrl->mtodeglon;
-				pingcur->latfor = r * headingy * Ctrl->mtodeglat;
-				}
-
-			print->x[0] = x + dlon1 + pingcur->lonaft;
-			print->y[0] = y + dlat1 + pingcur->lataft;
-			print->x[1] = x + dlon2 + pingcur->lonaft;
-			print->y[1] = y + dlat2 + pingcur->lataft;
-			print->x[2] = x + dlon2 + pingcur->lonfor;
-			print->y[2] = y + dlat2 + pingcur->latfor;
-			print->x[3] = x + dlon1 + pingcur->lonfor;
-			print->y[3] = y + dlat1 + pingcur->latfor;
-			}
-
-		  j = pingcur->pixels_ss-1;
-		  if (pingcur->ss[j] > MB_SIDESCAN_NULL && pingcur->ss[j-1] > MB_SIDESCAN_NULL)
-			{
-			x = pingcur->sslon[j];
-			y = pingcur->sslat[j];
-			dlon1 = pingcur->sslon[j-1]
-				- pingcur->sslon[j];
-			dlat1 = pingcur->sslat[j-1]
-				- pingcur->sslat[j];
-			dlon2 = -dlon1;
-			dlat2 = -dlat1;
-			print = &pingcur->ssfoot[j];
-			pingcur->ssflag[j] = MB_YES;
-
-			/* using fore-aft beam width */
-			if (Ctrl->A.mode == MBSWATH_FOOTPRINT_REAL)
-				{
-				ddlonx = (pingcur->sslon[j]
-					- pingcur->navlon)/Ctrl->mtodeglon;
-				ddlaty = (pingcur->sslat[j]
-					- pingcur->navlat)/Ctrl->mtodeglat;
-				if (Ctrl->A.depth > 0.0)
-					dddepth = Ctrl->A.depth;
-				else if (pingcur->altitude > 0.0)
-					dddepth = pingcur->altitude;
-				else if (pingcur->beams_bath > 0
-					&& mb_beam_ok(pingcur->beamflag[pingcur->beams_bath/2]))
-					dddepth = pingcur->bath[pingcur->beams_bath/2];
-				r = rfactor*sqrt(ddlonx*ddlonx
-					+ ddlaty*ddlaty + dddepth*dddepth);
-				pingcur->lonaft = -r * headingx * Ctrl->mtodeglon;
-				pingcur->lataft = -r * headingy * Ctrl->mtodeglat;
-				pingcur->lonfor = r * headingx * Ctrl->mtodeglon;
-				pingcur->latfor = r * headingy * Ctrl->mtodeglat;
-				}
-
-			print->x[0] = x + dlon1 + pingcur->lonaft;
-			print->y[0] = y + dlat1 + pingcur->lataft;
-			print->x[1] = x + dlon2 + pingcur->lonaft;
-			print->y[1] = y + dlat2 + pingcur->lataft;
-			print->x[2] = x + dlon2 + pingcur->lonfor;
-			print->y[2] = y + dlat2 + pingcur->latfor;
-			print->x[3] = x + dlon1 + pingcur->lonfor;
-			print->y[3] = y + dlat1 + pingcur->latfor;
-			}
-		  }
-		}
-
-	/* print debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  Beam footprints found in function <%s>\n",
-			function_name);
-		fprintf(stderr,"dbg2       npings:         %d\n", swath->npings);
-		fprintf(stderr,"dbg2       error:          %d\n", *error);
-		fprintf(stderr,"dbg2       status:         %d\n", status);
-		for (i=0;i<swath->npings;i++)
-			{
-			fprintf(stderr,"dbg2\ndbg2       ping:           %d\n",i);
-			pingcur = &swath->data[i];
-			if (dobath == MB_YES)
-			  for (j=0;j<pingcur->beams_bath;j++)
-				{
-				print = &pingcur->bathfoot[j];
-				fprintf(stderr,"dbg2       %d  %d %g %g   ",
-					j,pingcur->bathflag[j],
-					pingcur->bathlon[j],
-					pingcur->bathlat[j]);
-				for (k=0;k<4;k++)
-					fprintf(stderr,"  %g %g",
-						print->x[k],
-						print->y[k]);
-				fprintf(stderr,"\n");
-				}
-			if (doss == MB_YES)
-			  for (j=0;j<pingcur->pixels_ss;j++)
-				{
-				print = &pingcur->ssfoot[j];
-				fprintf(stderr,"dbg2       %d  %d %g %g   ",
-					j,pingcur->ssflag[j],
-					pingcur->sslon[j],
-					pingcur->sslat[j]);
-				for (k=0;k<4;k++)
-					fprintf(stderr,"  %g %g",
-						print->x[k],
-						print->y[k]);
-				fprintf(stderr,"\n");
-				}
-			}
-		}
-
-	/* assume success */
-	*error = MB_ERROR_NO_ERROR;
-	status = MB_SUCCESS;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBSWATH function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbswath_get_shading(int verbose, struct MBSWATH_CTRL *Ctrl, struct GMT_CTRL *GMT,
-                struct GMT_PALETTE *CPT, int *error)
-{
-	char	*function_name = "mbswath_get_shading";
-	int	status = MB_SUCCESS;
-        struct swath *swath;
-	struct ping *ping0;
-	struct ping *ping1;
-	struct ping *ping2;
-	int	drvcount;
-	double	dx, dy, dd;
-	double	dst2;
-	double	drvx, drvy;
-	double	sinx,cosy;
-	double	median;
-	double	graylevel;
-        double  rgb[4];
-        int     cpt_index;
-	int	i, j;
-                
-        /* get swath */
-        swath = Ctrl->swath_plot;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBSWATH function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:            %d\n",verbose);
-		fprintf(stderr,"dbg2       Ctrl:               %p\n",Ctrl);
-		fprintf(stderr,"dbg2       Ctrl->Z.mode:       %d\n",Ctrl->Z.mode);
-              if (Ctrl->Z.mode == MBSWATH_BATH_RELIEF)
-                        {
-                        fprintf(stderr,"dbg2       Ctrl->G.magnitude:  %f shaded relief magnitude\n",Ctrl->G.magnitude);
-                        fprintf(stderr,"dbg2       Ctrl->G.azimuth:    %f shaded relief azimuth\n",Ctrl->G.azimuth);
-                        }
-                else if (Ctrl->Z.mode == MBSWATH_BATH_AMP)
-                        {
-                        fprintf(stderr,"dbg2       Ctrl->G.magnitude:  %f amplitude shading magnitude\n",Ctrl->G.magnitude);
-                        fprintf(stderr,"dbg2       Ctrl->G.azimuth:    %f amplitude shading center\n",Ctrl->G.azimuth);
-                        fprintf(stderr,"dbg2       Ctrl->N.active:     %d\n",Ctrl->N.active);
-                        if (Ctrl->N.active)
-                                fprintf(stderr,"dbg2       Ctrl->N.cptfile:    %s\n",Ctrl->N.cptfile);
-                        }
-		fprintf(stderr,"dbg2       GMT:                %p\n",GMT);
-		fprintf(stderr,"dbg2       CPT:                %p\n",CPT);
-		fprintf(stderr,"dbg2       swath:              %p\n",swath);
-		fprintf(stderr,"dbg2       pings:              %d\n",swath->npings);
-		fprintf(stderr,"dbg2       Ctrl->mtodeglon:          %f\n",Ctrl->mtodeglon);
-		fprintf(stderr,"dbg2       Ctrl->mtodeglat:          %f\n",Ctrl->mtodeglat);
-		}
-
-	/* get shading from directional bathymetric gradient */
-	if (Ctrl->Z.mode == MBSWATH_BATH_RELIEF)
-	  {
-	  /* get directional factors */
-	  sinx = sin(DTR * Ctrl->G.azimuth);
-	  cosy = cos(DTR * Ctrl->G.azimuth);
-
-	  /* loop over the pings and beams */
-	  for (i=0;i<swath->npings;i++)
-	    {
-	    if (i > 0) ping0 = &swath->data[i-1];
-	    ping1 = &swath->data[i];
-	    if (i < swath->npings - 1) ping2 = &swath->data[i+1];
-	    for (j=0;j<ping1->beams_bath;j++)
-	      if (mb_beam_ok(ping1->beamflag[j]))
-		{
-		/* do across track components */
-		drvcount = 0;
-		dx = 0.0;
-		dy = 0.0;
-		dd = 0.0;
-		drvx = 0.0;
-		drvy = 0.0;
-		if (j > 0 && j < ping1->beams_bath - 1
-			&& mb_beam_ok(ping1->beamflag[j-1])
-			&& mb_beam_ok(ping1->beamflag[j+1]))
-			{
-			dx = (ping1->bathlon[j+1] - ping1->bathlon[j-1])
-				 / Ctrl->mtodeglon;
-			dy = (ping1->bathlat[j+1] - ping1->bathlat[j-1])
-				 / Ctrl->mtodeglat;
-			dd = ping1->bath[j+1] - ping1->bath[j-1];
-			}
-		else if (j < ping1->beams_bath - 1
-			&& mb_beam_ok(ping1->beamflag[j])
-			&& mb_beam_ok(ping1->beamflag[j+1]))
-			{
-			dx = (ping1->bathlon[j+1] - ping1->bathlon[j])
-				 / Ctrl->mtodeglon;
-			dy = (ping1->bathlat[j+1] - ping1->bathlat[j])
-				 / Ctrl->mtodeglat;
-			dd = ping1->bath[j+1] - ping1->bath[j];
-			}
-		else if (j > 0
-			&& mb_beam_ok(ping1->beamflag[j-1])
-			&& mb_beam_ok(ping1->beamflag[j]))
-			{
-			dx = (ping1->bathlon[j] - ping1->bathlon[j-1])
-				 / Ctrl->mtodeglon;
-			dy = (ping1->bathlat[j] - ping1->bathlat[j-1])
-				 / Ctrl->mtodeglat;
-			dd = ping1->bath[j] - ping1->bath[j-1];
-			}
-		dst2 = dx * dx + dy * dy;
-		if (dst2 > 0.0)
-			{
-			drvx = dd * dx / dst2;
-			drvy = dd * dy / dst2;
-			drvcount++;
-			}
-
-		/* do along track components */
-		dx = 0.0;
-		dy = 0.0;
-		dd = 0.0;
-		if (i > 0 && i < swath->npings - 1
-			&& mb_beam_ok(ping0->beamflag[j])
-			&& mb_beam_ok(ping2->beamflag[j]))
-			{
-			dx = (ping2->bathlon[j] - ping0->bathlon[j])
-				 / Ctrl->mtodeglon;
-			dy = (ping2->bathlat[j] - ping0->bathlat[j])
-				 / Ctrl->mtodeglat;
-			dd = ping2->bath[j] - ping0->bath[j];
-			}
-		else if (i < swath->npings - 1
-			&& mb_beam_ok(ping1->beamflag[j])
-			&& mb_beam_ok(ping2->beamflag[j]))
-			{
-			dx = (ping2->bathlon[j] - ping1->bathlon[j])
-				 / Ctrl->mtodeglon;
-			dy = (ping2->bathlat[j] - ping1->bathlat[j])
-				 / Ctrl->mtodeglat;
-			dd = ping2->bath[j] - ping1->bath[j];
-			}
-		else if (i > 0
-			&& mb_beam_ok(ping0->beamflag[j])
-			&& mb_beam_ok(ping1->beamflag[j]))
-			{
-			dx = (ping1->bathlon[j] - ping0->bathlon[j])
-				 / Ctrl->mtodeglon;
-			dy = (ping1->bathlat[j] - ping0->bathlat[j])
-				 / Ctrl->mtodeglat;
-			dd = ping1->bath[j] - ping0->bath[j];
-			}
-		dst2 = dx * dx + dy * dy;
-		if (dst2 > 0.0)
-			{
-			drvx = drvx + dd * dx / dst2;
-			drvy = drvy + dd * dy / dst2;
-			drvcount++;
-			}
-
-		/* calculate directional derivative */
-		if (drvcount == 2)
-			ping1->bathshade[j] = Ctrl->G.magnitude * (drvx*sinx + drvy*cosy);
-		else
-			ping1->bathshade[j] = 0.0;
-		}
-	    }
-	  }
-
-	/* get shading from amplitude data using cpt file */
-	else if (Ctrl->Z.mode == MBSWATH_BATH_AMP && Ctrl->N.active)
-	  {
-	  /* loop over the pings and beams */
-	  for (i=0;i<swath->npings;i++)
-	    {
-	    if (i > 0) ping0 = &swath->data[i-1];
-	    ping1 = &swath->data[i];
-	    if (i < swath->npings - 1) ping2 = &swath->data[i+1];
-	    for (j=0;j<ping1->beams_bath;j++)
-	      if (mb_beam_ok(ping1->beamflag[j]))
-		{
-		/* calculate shading */
-		if (mb_beam_ok(ping1->beamflag[j]))
-			{
-                        /* get shading value from cpt */
-                        cpt_index = GMT_get_rgb_from_z(GMT, CPT, ping1->amp[j], rgb);
-                        graylevel = (rgb[0] + rgb[1] + rgb[2]) / 3.0;
-			ping1->bathshade[j] = Ctrl->G.magnitude * (graylevel - Ctrl->G.azimuth) / 128.;
-			}
-		else
-			ping1->bathshade[j] = 0.0;
-		}
-	    }
-	  }
-
-	/* get shading from amplitude data */
-	else if (Ctrl->Z.mode == MBSWATH_BATH_AMP)
-	  {
-	  /* get median value from value entered as azimuth */
-	  median = Ctrl->G.azimuth;
-
-	  /* loop over the pings and beams */
-	  for (i=0;i<swath->npings;i++)
-	    {
-	    if (i > 0) ping0 = &swath->data[i-1];
-	    ping1 = &swath->data[i];
-	    if (i < swath->npings - 1) ping2 = &swath->data[i+1];
-	    for (j=0;j<ping1->beams_bath;j++)
-	      if (mb_beam_ok(ping1->beamflag[j]))
-		{
-		/* calculate shading */
-		if (mb_beam_ok(ping1->beamflag[j]))
-			ping1->bathshade[j] = Ctrl->G.magnitude * (ping1->amp[j] - Ctrl->G.azimuth);
-		else
-			ping1->bathshade[j] = 0.0;
-		}
-	    }
-	  }
-
-	/* print debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  Shading values in function <%s>\n",
-			function_name);
-		fprintf(stderr,"dbg2       npings:         %d\n",
-			swath->npings);
-		fprintf(stderr,"dbg2       error:          %d\n",
-			*error);
-		fprintf(stderr,"dbg2       status:         %d\n",
-			status);
-		for (i=0;i<swath->npings;i++)
-			{
-			fprintf(stderr,"dbg2\ndbg2       ping:           %d\n",i);
-			ping1 = &swath->data[i];
-			for (j=0;j<ping1->beams_bath;j++)
-				{
-				fprintf(stderr,"dbg2       %d  %d  %g  %g\n",
-					j,ping1->bathflag[j],
-					ping1->bath[j],
-					ping1->bathshade[j]);
-				}
-			}
-		}
-
-	/* assume success */
-	*error = MB_ERROR_NO_ERROR;
-	status = MB_SUCCESS;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBSWATH function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbswath_plot_data_footprint(int verbose, struct MBSWATH_CTRL *Ctrl, struct GMT_CTRL *GMT,
-                        struct GMT_PALETTE *CPT, struct PSL_CTRL *PSL, 
-                        int first, int nplot, int *error)
-{
-	char	*function_name = "mbswath_plot_data_footprint";
-	int	status = MB_SUCCESS;
-        struct swath *swath;
-	struct ping *pingcur;
-	struct footprint *print;
-	double	*x, *y;
-	double	xx[4], yy[4];
-	double 	rgb[4];
-        int     cpt_index;
-	int	i, j, k;
-                
-        /* get swath */
-        swath = Ctrl->swath_plot;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBSWATH function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       Ctrl:               %p\n",Ctrl);
-		fprintf(stderr,"dbg2       Ctrl->Z.mode:       %d\n",Ctrl->Z.mode);
-		fprintf(stderr,"dbg2       Ctrl->C.cptfile:    %s\n",Ctrl->C.cptfile);
-              if (Ctrl->Z.mode == MBSWATH_BATH_RELIEF)
-                        {
-                        fprintf(stderr,"dbg2       Ctrl->G.magnitude:  %f shaded relief magnitude\n",Ctrl->G.magnitude);
-                        fprintf(stderr,"dbg2       Ctrl->G.azimuth:    %f shaded relief azimuth\n",Ctrl->G.azimuth);
-                        }
-                else if (Ctrl->Z.mode == MBSWATH_BATH_AMP)
-                        {
-                        fprintf(stderr,"dbg2       Ctrl->G.magnitude:  %f amplitude shading magnitude\n",Ctrl->G.magnitude);
-                        fprintf(stderr,"dbg2       Ctrl->G.azimuth:    %f amplitude shading center\n",Ctrl->G.azimuth);
-                        fprintf(stderr,"dbg2       Ctrl->N.active:     %d\n",Ctrl->N.active);
-                        if (Ctrl->N.active)
-                                fprintf(stderr,"dbg2       Ctrl->N.cptfile:    %s\n",Ctrl->N.cptfile);
-                        }
-		fprintf(stderr,"dbg2       GMT:                %p\n",GMT);
-		fprintf(stderr,"dbg2       CPT:                %p\n",CPT);
-		fprintf(stderr,"dbg2       PSL:                %p\n",PSL);
-		fprintf(stderr,"dbg2       swath:      %p\n",swath);
-		fprintf(stderr,"dbg2       pings:      %d\n",swath->npings);
-		fprintf(stderr,"dbg2       first:      %d\n",first);
-		fprintf(stderr,"dbg2       nplot:      %d\n",nplot);
-		}
-
-	if (Ctrl->Z.mode == MBSWATH_BATH
-		|| Ctrl->Z.mode == MBSWATH_BATH_RELIEF
-		|| Ctrl->Z.mode == MBSWATH_BATH_AMP)
-		{
-		/* loop over all pings and beams and plot the good ones */
-		for (i=first;i<first+nplot;i++)
-			{
-			pingcur = &swath->data[i];
-			for (j=0;j<pingcur->beams_bath;j++)
-			  if (pingcur->bathflag[j] == MB_YES)
-				{
-				print = &pingcur->bathfoot[j];
-				x = &(print->x[0]);
-				y = &(print->y[0]);
-				for (k=0;k<4;k++)
-					GMT_geo_to_xy(GMT, x[k], y[k], &xx[k], &yy[k]);
-                                cpt_index = GMT_get_rgb_from_z(GMT, CPT, pingcur->bath[j], rgb);
-				if (Ctrl->Z.mode == MBSWATH_BATH_RELIEF
-					|| Ctrl->Z.mode == MBSWATH_BATH_AMP)
-                                        {
-//fprintf(stderr,"Illuminate: shade:%f rgb: %f %f %f ",pingcur->bathshade[j], rgb[0],rgb[1],rgb[2]);
-					GMT_illuminate(GMT, pingcur->bathshade[j], rgb);
-//fprintf(stderr,"    %f %f %f\n",rgb[0],rgb[1],rgb[2]);
-                                        }
-/*fprintf(stderr,"Calling mbswath_plot_box ping:%d of %d   beam:%d of %d\n",
-i,nplot,j,pingcur->beams_bath);*/
-				status = mbswath_plot_box(verbose, Ctrl, GMT, PSL, xx, yy, rgb, error);
-				}
-			}
-		}
-	else if (Ctrl->Z.mode == MBSWATH_AMP)
-		{
-		/* loop over all pings and beams and plot the good ones */
-		for (i=first;i<first+nplot;i++)
-			{
-			pingcur = &swath->data[i];
-			for (j=0;j<pingcur->beams_amp;j++)
-			  if (pingcur->bathflag[j] == MB_YES)
-				{
-				print = &pingcur->bathfoot[j];
-				x = &(print->x[0]);
-				y = &(print->y[0]);
-				for (k=0;k<4;k++)
-					GMT_geo_to_xy(GMT, x[k], y[k], &xx[k], &yy[k]);
-                                cpt_index = GMT_get_rgb_from_z(GMT, CPT, pingcur->amp[j], rgb);
-				status = mbswath_plot_box(verbose, Ctrl, GMT, PSL, xx, yy, rgb, error);
-				}
-			}
-		}
-	else if (Ctrl->Z.mode == MBSWATH_SS)
-		{
-		/* loop over all pings and beams and plot the good ones */
-		for (i=first;i<first+nplot;i++)
-			{
-			pingcur = &swath->data[i];
-			for (j=0;j<pingcur->pixels_ss;j++)
-			  if (pingcur->ssflag[j] == MB_YES)
-				{
-				print = &pingcur->ssfoot[j];
-				x = &(print->x[0]);
-				y = &(print->y[0]);
-				for (k=0;k<4;k++)
-					GMT_geo_to_xy(GMT, x[k], y[k], &xx[k], &yy[k]);
-                                cpt_index = GMT_get_rgb_from_z(GMT, CPT, pingcur->ss[j], rgb);
-				status = mbswath_plot_box(verbose, Ctrl, GMT, PSL, xx, yy, rgb, error);
-				}
-			}
-		}
-
-	/* assume success */
-	*error = MB_ERROR_NO_ERROR;
-	status = MB_SUCCESS;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBSWATH function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbswath_plot_data_point(int verbose, struct MBSWATH_CTRL *Ctrl, struct GMT_CTRL *GMT,
-		struct GMT_PALETTE *CPT, struct PSL_CTRL *PSL,
-                int first, int nplot, int *error)
-{
-	char	*function_name = "mbswath_plot_data_point";
-	int	status = MB_SUCCESS;
-        struct swath *swath;
-	struct ping	*pingcur;
-	double	xx, yy;
-	double	rgb[4];
-        int     cpt_index;
-	int	i, j;
-                
-        /* get swath */
-        swath = Ctrl->swath_plot;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBSWATH function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       Ctrl:               %p\n",Ctrl);
-		fprintf(stderr,"dbg2       Ctrl->Z.mode:       %d\n",Ctrl->Z.mode);
-              if (Ctrl->Z.mode == MBSWATH_BATH_RELIEF)
-                        {
-                        fprintf(stderr,"dbg2       Ctrl->G.magnitude:  %f shaded relief magnitude\n",Ctrl->G.magnitude);
-                        fprintf(stderr,"dbg2       Ctrl->G.azimuth:    %f shaded relief azimuth\n",Ctrl->G.azimuth);
-                        }
-                else if (Ctrl->Z.mode == MBSWATH_BATH_AMP)
-                        {
-                        fprintf(stderr,"dbg2       Ctrl->G.magnitude:  %f amplitude shading magnitude\n",Ctrl->G.magnitude);
-                        fprintf(stderr,"dbg2       Ctrl->G.azimuth:    %f amplitude shading center\n",Ctrl->G.azimuth);
-                        fprintf(stderr,"dbg2       Ctrl->N.active:     %d\n",Ctrl->N.active);
-                        if (Ctrl->N.active)
-                                fprintf(stderr,"dbg2       Ctrl->N.cptfile:    %s\n",Ctrl->N.cptfile);
-                        }
-		fprintf(stderr,"dbg2       GMT:                %p\n",GMT);
-		fprintf(stderr,"dbg2       CPT:                %p\n",CPT);
-		fprintf(stderr,"dbg2       PSL:                %p\n",PSL);
-		fprintf(stderr,"dbg2       swath:      %p\n",swath);
-		fprintf(stderr,"dbg2       pings:      %d\n",swath->npings);
-		fprintf(stderr,"dbg2       first:      %d\n",first);
-		fprintf(stderr,"dbg2       nplot:      %d\n",nplot);
-		}
-
-	if (Ctrl->Z.mode == MBSWATH_BATH
-		|| Ctrl->Z.mode == MBSWATH_BATH_RELIEF
-		|| Ctrl->Z.mode == MBSWATH_BATH_AMP)
-		{
-		/* loop over all pings and beams and plot the good ones */
-		for (i=first;i<first+nplot;i++)
-			{
-			pingcur = &swath->data[i];
-			for (j=0;j<pingcur->beams_bath;j++)
-			  if (mb_beam_ok(pingcur->beamflag[j]))
-				{
-				GMT_geo_to_xy(GMT, pingcur->bathlon[j], pingcur->bathlat[j],
-					&xx, &yy);
-                                cpt_index = GMT_get_rgb_from_z(GMT, CPT, pingcur->bath[j], rgb);
-				if (Ctrl->Z.mode == MBSWATH_BATH_RELIEF
-					|| Ctrl->Z.mode == MBSWATH_BATH_AMP)
-					GMT_illuminate(GMT, pingcur->bathshade[j], rgb);
-				status = mbswath_plot_point(verbose, Ctrl, GMT, PSL, xx, yy, rgb, error);
-				}
-			}
-		}
-	else if (Ctrl->Z.mode == MBSWATH_AMP)
-		{
-		/* loop over all pings and beams and plot the good ones */
-		for (i=first;i<first+nplot;i++)
-			{
-			pingcur = &swath->data[i];
-			for (j=0;j<pingcur->beams_amp;j++)
-			  if (mb_beam_ok(pingcur->beamflag[j]))
-				{
-				GMT_geo_to_xy(GMT, pingcur->bathlon[j], pingcur->bathlat[j],
-					&xx, &yy);
-				cpt_index = GMT_get_rgb_from_z(GMT, CPT, pingcur->amp[j], rgb);
-				status = mbswath_plot_point(verbose, Ctrl, GMT, PSL, xx, yy, rgb, error);
-				}
-			}
-		}
-	else if (Ctrl->Z.mode == MBSWATH_SS)
-		{
-		/* loop over all pings and beams and plot the good ones */
-		for (i=first;i<first+nplot;i++)
-			{
-			pingcur = &swath->data[i];
-			for (j=0;j<pingcur->pixels_ss;j++)
-			  if (pingcur->ss[j] > MB_SIDESCAN_NULL)
-				{
-				GMT_geo_to_xy(GMT, pingcur->sslon[j], pingcur->sslat[j],
-					&xx, &yy);
-				cpt_index = GMT_get_rgb_from_z(GMT, CPT, pingcur->ss[j], rgb);
-				status = mbswath_plot_point(verbose, Ctrl, GMT, PSL, xx, yy, rgb, error);
-				}
-			}
-		}
-
-	/* assume success */
-	*error = MB_ERROR_NO_ERROR;
-	status = MB_SUCCESS;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBSWATH function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbswath_plot_box(int verbose, struct MBSWATH_CTRL *Ctrl,
-                        struct GMT_CTRL *GMT, struct PSL_CTRL *PSL,
-                        double *x, double *y, double *rgb, int *error)
-{
-	char	*function_name = "mbswath_plot_box";
-	int	status = MB_SUCCESS;
-	int	ix[5], iy[5];
-	int	ixmin, ixmax, iymin, iymax;
-	int	ixx, iyy;
-	int	ixx1, ixx2;
-	double	dx, dy;
-	int	ncross, xcross[10];
-	int	i, j, k;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBSWATH function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:            %d\n",verbose);
-		fprintf(stderr,"dbg2       GMT:                %p\n",GMT);
-		fprintf(stderr,"dbg2       x[0]:               %f\n",x[0]);
-		fprintf(stderr,"dbg2       y[0]:               %f\n",y[0]);
-		fprintf(stderr,"dbg2       x[1]:               %f\n",x[1]);
-		fprintf(stderr,"dbg2       y[1]:               %f\n",y[1]);
-		fprintf(stderr,"dbg2       x[2]:               %f\n",x[2]);
-		fprintf(stderr,"dbg2       y[2]:               %f\n",y[2]);
-		fprintf(stderr,"dbg2       x[3]:               %f\n",x[3]);
-		fprintf(stderr,"dbg2       y[3]:               %f\n",y[3]);
-		fprintf(stderr,"dbg2       rgb[0]:             %f\n",rgb[0]);
-		fprintf(stderr,"dbg2       rgb[1]:             %f\n",rgb[1]);
-		fprintf(stderr,"dbg2       rgb[2]:             %f\n",rgb[2]);
-		fprintf(stderr,"dbg2       rgb[3]:             %f\n",rgb[3]);
-		}
-
-	/* if simple case just plot polygon */
-	if (Ctrl->image_type == MBSWATH_IMAGE_VECTOR)
-		{
-                PSL_setcolor(PSL, rgb, PSL_IS_FILL);
-		PSL_plotpolygon(PSL, x, y, 4);
-		}
-
-	/* if image plot then rasterize the box */
-	else if (Ctrl->image_type == MBSWATH_IMAGE_8 || Ctrl->image_type == MBSWATH_IMAGE_24)
-		{
-		/* get bounds of box in pixels */
-		for (i=0;i<4;i++)
-			{
-			ix[i] = (int)(Ctrl->nx * x[i] / Ctrl->x_inch);
-			iy[i] = (int)(Ctrl->ny * y[i] / Ctrl->y_inch);
-			}
-		ix[4] = ix[0];
-		iy[4] = iy[0];
-
-		/* get min max values of bounding corners in pixels */
-		ixmin = ix[0];
-		ixmax = ix[0];
-		iymin = iy[0];
-		iymax = iy[0];
-		for (i=1;i<4;i++)
-			{
-			if (ix[i] < ixmin)
-				ixmin = ix[i];
-			if (ix[i] > ixmax)
-				ixmax = ix[i];
-			if (iy[i] < iymin)
-				iymin = iy[i];
-			if (iy[i] > iymax)
-				iymax = iy[i];
-			}
-		if (ixmin < 0) ixmin = 0;
-		if (ixmax > Ctrl->nx-1) ixmax = Ctrl->nx - 1;
-		if (iymin < 1) iymin = 1;
-		if (iymax > Ctrl->ny-1) iymax = Ctrl->ny - 1;
-
-		/* loop over all y values */
-		for (iyy=iymin;iyy<=iymax;iyy++)
-		  {
-		  /* find crossings */
-		  ncross = 0;
-		  for (i=0;i<4;i++)
-		    {
-		    if ((iy[i] <= iyy && iy[i+1] >= iyy)
-		      || (iy[i] >= iyy && iy[i+1] <= iyy))
-		      {
-		      if (iy[i] == iy[i+1])
-		        {
-		        xcross[ncross] = ix[i];
-		        ncross++;
-		        xcross[ncross] = ix[i+1];
-		        ncross++;
-		        }
-		      else
-		        {
-		        dy = iy[i+1] - iy[i];
-		        dx = ix[i+1] - ix[i];
-		        xcross[ncross] = (int) ((iyy - iy[i]) * dx / dy + ix[i]);
-		        ncross++;
-		        }
-		      }
-		    }
-
-		  /* plot lines between crossings */
-		  for (j=0;j<ncross-1;j++)
-		    {
-		    if (xcross[j] < xcross[j+1])
-		      {
-		      ixx1 = xcross[j];
-		      ixx2 = xcross[j+1];
-		      }
-		    else
-		      {
-		      ixx1 = xcross[j+1];
-		      ixx2 = xcross[j];
-		      }
-		    if ((ixx1 < ixmin && ixx2 < ixmin)
-		      || (ixx1 > ixmax && ixx2 > ixmax))
-		      ixx2 = ixx1 - 1; /* disable plotting */
-		    else
-		      {
-		      if (ixx1 < ixmin) ixx1 = ixmin;
-		      if (ixx2 > ixmax) ixx2 = ixmax;
-		      }
-		    for (ixx=ixx1;ixx<=ixx2;ixx++)
-		      {
-/*			fprintf(stderr,"plot %d %d\n",ixx,iyy);*/
-		      if (Ctrl->image_type == MBSWATH_IMAGE_8)
-			{
-			k = Ctrl->nx * (Ctrl->ny - iyy) + ixx;
-			Ctrl->bitimage[k] = (unsigned char) (255 * YIQ(rgb));
-//fprintf(stderr,"k:%d rgb: %f %f %f   bitimage: %u\n",
-//k,rgb[0],rgb[1],rgb[2],Ctrl->bitimage[k]);                        
-			}
-		      else
-			{
-			k = 3 * (Ctrl->nx * (Ctrl->ny - iyy) + ixx);
-			Ctrl->bitimage[k] = (unsigned char) (255 * rgb[0]);
-			Ctrl->bitimage[k+1] = (unsigned char) (255 * rgb[1]);
-			Ctrl->bitimage[k+2] = (unsigned char) (255 * rgb[2]);
-//fprintf(stderr,"k:%d rgb: %f %f %f   bitimage: %u %u %u\n",
-//k,rgb[0],rgb[1],rgb[2],Ctrl->bitimage[k],Ctrl->bitimage[k+1],Ctrl->bitimage[k+2]);
-			}
-		      }
-		    }
-		  }
-		}
-
-	/* assume success */
-	*error = MB_ERROR_NO_ERROR;
-	status = MB_SUCCESS;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBSWATH function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbswath_plot_point(int verbose, struct MBSWATH_CTRL *Ctrl, struct GMT_CTRL *GMT, struct PSL_CTRL *PSL,
-                        double x, double y, double *rgb, int *error)
-{
-	char	*function_name = "mbswath_plot_point";
-	int	status = MB_SUCCESS;
-        double  size = 0.005;
-	int	ix, iy;
-	int	k;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBSWATH function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:            %d\n",verbose);
-		fprintf(stderr,"dbg2       GMT:                %p\n",GMT);
-		fprintf(stderr,"dbg2       x:                  %f\n",x);
-		fprintf(stderr,"dbg2       y:                  %f\n",y);
-		fprintf(stderr,"dbg2       rgb[0]:             %f\n",rgb[0]);
-		fprintf(stderr,"dbg2       rgb[1]:             %f\n",rgb[1]);
-		fprintf(stderr,"dbg2       rgb[2]:             %f\n",rgb[2]);
-		fprintf(stderr,"dbg2       rgb[3]:             %f\n",rgb[3]);
-		}
-
-	/* if simple case just plot point (well, a very small cross actually) */
-	if (Ctrl->image_type == MBSWATH_IMAGE_VECTOR)
-		{
-                PSL_setcolor(PSL, rgb, PSL_IS_STROKE);
-                PSL_plotsymbol(PSL, x, y, &size, PSL_CROSS);
-		}
-
-	/* if image plot then plot pixel */
-	else
-		{
-		/* get pixel */
-		ix = (int)(Ctrl->nx * x / Ctrl->x_inch);
-		iy = (int)(Ctrl->ny * y / Ctrl->y_inch);
-
-		/* plot pixel */
-		if (Ctrl->image_type == MBSWATH_IMAGE_8)
-			{
-			k = Ctrl->nx * (Ctrl->ny - iy) + ix;
-			Ctrl->bitimage[k] = (unsigned char ) YIQ(rgb);
-			}
-		else
-			{
-			k = 3 * (Ctrl->nx * (Ctrl->ny - iy) + ix);
-			Ctrl->bitimage[k] = (unsigned char) (255 * rgb[0]);
-			Ctrl->bitimage[k+1] = (unsigned char) (255 * rgb[1]);
-			Ctrl->bitimage[k+2] = (unsigned char) (255 * rgb[2]);
-			}
-		  }
-
-	/* assume success */
-	*error = MB_ERROR_NO_ERROR;
-	status = MB_SUCCESS;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBSWATH function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbswath_ping_copy(int verbose, int one, int two, struct swath *swath, int *error)
-{
-	char	*function_name = "mbswath_ping_copy";
-	int	status = MB_SUCCESS;
-
-	struct ping	*ping1;
-	struct ping	*ping2;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBSWATH function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       one:        %d\n",one);
-		fprintf(stderr,"dbg2       two:        %d\n",two);
-		fprintf(stderr,"dbg2       swath:      %p\n",swath);
-		fprintf(stderr,"dbg2       pings:      %d\n",swath->npings);
-		}
-
-	/* copy things */
-	ping1 = &swath->data[one];
-	ping2 = &swath->data[two];
-	ping1->pings = ping2->pings;
-	ping1->kind = ping2->kind;
-	for (i=0;i<7;i++)
-		ping1->time_i[i] = ping2->time_i[i];
-	ping1->time_d = ping2->time_d;
-	ping1->navlon = ping2->navlon;
-	ping1->navlat = ping2->navlat;
-	ping1->speed = ping2->speed;
-	ping1->heading = ping2->heading;
-	ping1->distance = ping2->distance;
-	ping1->altitude = ping2->altitude;
-	ping1->sonardepth = ping2->sonardepth;
-	strcpy(ping1->comment,ping2->comment);
-	ping1->beams_bath = ping2->beams_bath;
-	ping1->beams_amp = ping2->beams_amp;
-	ping1->pixels_ss = ping2->pixels_ss;
-	for (i=0;i<ping1->beams_bath;i++)
-		{
-		ping1->beamflag[i] = ping2->beamflag[i];
-		ping1->bath[i] = ping2->bath[i];
-		ping1->bathlon[i] = ping2->bathlon[i];
-		ping1->bathlat[i] = ping2->bathlat[i];
-		ping1->bathflag[i] = ping2->bathflag[i];
-		for (j=0;j<4;j++)
-			{
-			ping1->bathfoot[i].x[j] = ping2->bathfoot[i].x[j];
-			ping1->bathfoot[i].y[j] = ping2->bathfoot[i].y[j];
-			}
-		}
-	for (i=0;i<ping1->beams_amp;i++)
-		{
-		ping1->amp[i] = ping2->amp[i];
-		}
-	for (i=0;i<ping1->pixels_ss;i++)
-		{
-		ping1->ss[i] = ping2->ss[i];
-		ping1->sslon[i] = ping2->sslon[i];
-		ping1->sslat[i] = ping2->sslat[i];
-		ping1->ssflag[i] = ping2->ssflag[i];
-		for (j=0;j<4;j++)
-			{
-			ping1->ssfoot[i].x[j] = ping2->ssfoot[i].x[j];
-			ping1->ssfoot[i].y[j] = ping2->ssfoot[i].y[j];
-			}
-		}
-
-	/* assume success */
-	*error = MB_ERROR_NO_ERROR;
-	status = MB_SUCCESS;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBSWATH function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/gmt/pslib.h b/src/gmt/pslib.h
deleted file mode 100644
index 0eea732..0000000
--- a/src/gmt/pslib.h
+++ /dev/null
@@ -1,405 +0,0 @@
-/*--------------------------------------------------------------------
- *	$Id: pslib.h 2242 2015-05-16 05:21:28Z caress $
- *
- *	Copyright (c) 2009-2015 by P. Wessel and R. Scharroo
- *
- *	This program is free software; you can redistribute it and/or modify
- *	it under the terms of the GNU Lesser General Public License as published by
- *	the Free Software Foundation; version 3 or any later version.
- *
- *	This program is distributed in the hope that it will be useful,
- *	but WITHOUT ANY WARRANTY; without even the implied warranty of
- *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *	GNU Lesser General Public License for more details.
- *
- *--------------------------------------------------------------------*/
-/*
- * This include file must be included by all programs using pslib.a
- *
- * Authors:	Paul Wessel, Dept. of Geology and Geophysics, SOEST, U Hawaii
- *			   pwessel at hawaii.edu
- *		Remko Scharroo, Altimetrics
- *			   remko at altimetrics.com
- * Version:	5.0 [64-bit enabled API edition]
- * Date:	15-OCT-2009
- */
-
-#ifndef _PSLIB_H
-#define _PSLIB_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* CMake definitions: This must be first! */
-//#include "gmt_config.h"
-
-/* Declaration modifiers for DLL support (MSC et al) */
-#include "declspec.h"
-
-#include <stdio.h>
-
-/* Number of PostScript points in one inch */
-
-#define PSL_POINTS_PER_INCH	72.0
-#define PSL_DOTS_PER_INCH	1200.0	/* Effective dots per inch resolution */
-#define PSL_ALL_CLIP		INT_MAX	/* Terminates all clipping */
-
-/* PSL codes for geometric symbols as expected by PSL_plotsymbol */
-
-#define PSL_STAR		((int)'a')
-#define PSL_CIRCLE		((int)'c')
-#define PSL_DIAMOND		((int)'d')
-#define PSL_ELLIPSE		((int)'e')
-#define PSL_HEXAGON		((int)'h')
-#define PSL_OCTAGON		((int)'g')
-#define PSL_INVTRIANGLE		((int)'i')
-#define PSL_ROTRECT		((int)'j')
-#define PSL_MARC		((int)'m')
-#define PSL_PENTAGON		((int)'n')
-#define PSL_DOT			((int)'p')
-#define PSL_RECT		((int)'r')
-#define PSL_RNDRECT		((int)'R')
-#define PSL_SQUARE		((int)'s')
-#define PSL_TRIANGLE		((int)'t')
-#define PSL_VECTOR		((int)'v')
-#define PSL_WEDGE		((int)'w')
-#define PSL_CROSS		((int)'x')
-#define PSL_YDASH		((int)'y')
-#define PSL_PLUS		((int)'+')
-#define PSL_XDASH		((int)'-')
-
-/* PSL codes for vector attributes - mirroring similar codes and macros in GMT */
-
-/* Note: If changes are made to PSL_enum_vecattr you must also change gmt_plot.h: GMT_enum_vecattr */
-
-enum PSL_enum_vecattr {PSL_VEC_BEGIN = 1,	/* Place vector head at beginning of vector. Add PSL_VEC_BEGIN_L for left only, PSL_VEC_BEGIN_R for right only */
-	PSL_VEC_END		= 2,		/* Place vector head at end of vector.  Add PSL_VEC_END_L for left only, and PSL_VEC_END_R for right only */
-	PSL_VEC_HEADS		= 3,		/* Mask for either head end */
-	PSL_VEC_BEGIN_L		= 4,		/* Left-half head at beginning */
-	PSL_VEC_BEGIN_R		= 8,		/* Right-half head at beginning */
-	PSL_VEC_END_L		= 16,		/* Left-half head at end */
-	PSL_VEC_END_R		= 32,		/* Right-half head at end */
-	PSL_VEC_JUST_B		= 0,		/* Align vector beginning at (x,y) */
-	PSL_VEC_JUST_C		= 64,		/* Align vector center at (x,y) */
-	PSL_VEC_JUST_E		= 128,		/* Align vector end at (x,y) */
-	PSL_VEC_JUST_S		= 256,		/* Align vector center at (x,y) */
-	PSL_VEC_ANGLES		= 512,		/* Got start/stop angles instead of az, length */
-	PSL_VEC_POLE		= 1024,		/* Got pole of small/great circle */
-	PSL_VEC_OUTLINE		= 2048,		/* Draw vector head outline using default pen */
-	PSL_VEC_OUTLINE2	= 4096,		/* Draw vector head outline using supplied v_pen */
-	PSL_VEC_FILL		= 8192,		/* Fill vector head using default fill */
-	PSL_VEC_FILL2		= 16384,	/* Fill vector head using supplied v_fill) */
-	PSL_VEC_MARC90		= 32768};	/* Matharc only: if angles subtend 90, draw straight angle symbol */
-	
-#define PSL_vec_justify(status) ((status>>6)&3)			/* Return justification as 0-3 */
-#define PSL_vec_head(status) ((status)&3)			/* Return head selection as 0-3 */
-#define PSL_vec_side(status,head) (((status>>(2+2*head))&3) ? 2*((status>>(2+2*head))&3)-3 : 0)	/* Return side selection for this head as 0,-1,+1 */
-
-/* PSL codes for arguments of PSL_beginplot and other routines */
-
-enum PSL_enum_const {PSL_CM	= 0,
-	PSL_INCH		= 1,
-	PSL_METER		= 2,
-	PSL_PT			= 3,
-	PSL_FINALIZE		= 1,
-	PSL_OVERLAY		= 1,
-	PSL_INIT		= 0,
-	PSL_LANDSCAPE		= 0,
-	PSL_PORTRAIT		= 1,
-	PSL_ASCII85		= 0,
-	PSL_HEX			= 1,
-	PSL_NONE		= 0,
-	PSL_RLE			= 1,
-	PSL_LZW			= 2,
-	PSL_DEFLATE		= 3,
-	PSL_NO			= 0,
-	PSL_YES			= 1,
-	PSL_FWD			= 0,
-	PSL_INV			= 1,
-	PSL_OUTLINE		= 1,
-	PSL_MAX_EPS_FONTS	= 6,
-	PSL_MAX_DIMS		= 8,		/* Max number of dim arguments to PSL_plot_symbol */
-	PSL_N_PATTERNS		= 91,		/* Current number of predefined patterns + 1, # 91 is user-supplied */
-	PSL_BUFSIZ		= 4096U};	/* To match GMT_BUFSIZ and be consistent across all platforms */
-
-/* PSL codes for pen movements (used by PSL_plotpoint, PSL_plotline, PSL_plotarc) */
-
-enum PSL_enum_move {PSL_DRAW	= 0,
-	PSL_MOVE		= 1,
-	PSL_STROKE		= 2,
-	PSL_REL			= 4,
-	PSL_CLOSE		= 8};
-
-/* PSL codes for text and paragraph justification */
-
-enum PSL_enum_just {PSL_BL	= 1,
-	PSL_BC			= 2,
-	PSL_BR			= 3,
-	PSL_ML			= 5,
-	PSL_MC			= 6,
-	PSL_MR			= 7,
-	PSL_TL			= 9,
-	PSL_TC			= 10,
-	PSL_TR			= 11,
-	PSL_JUST		= 4};
-
-/* PSL code for rectangle shapes */
-
-enum PSL_enum_rect {PSL_RECT_STRAIGHT	= 0,
-	PSL_RECT_ROUNDED,
-	PSL_RECT_CONVEX,
-	PSL_RECT_CONCAVE};
-
-/* PSL codes for line settings */
-
-enum PSL_enum_line {PSL_BUTT_CAP	= 0,
-	PSL_ROUND_CAP			= 1,
-	PSL_SQUARE_CAP			= 2,
-	PSL_MITER_JOIN			= 0,
-	PSL_ROUND_JOIN			= 1,
-	PSL_BEVEL_JOIN			= 2,
-	PSL_MITER_DEFAULT		= 35};
-
-/* PSL codes for text clipping (PSL_plottextline) */
-
-enum PSL_enum_txt {PSL_TXT_INIT	= 1,
-	PSL_TXT_SHOW		= 2,
-	PSL_TXT_CLIP_ON		= 4,
-	PSL_TXT_DRAW		= 8,
-	PSL_TXT_CLIP_OFF	= 16,
-	PSL_TXT_ROUND		= 32,
-	PSL_TXT_CURVED		= 64,
-	PSL_TXT_FILLBOX		= 128,
-	PSL_TXT_DRAWBOX		= 256};
-
-/* Verbosity levels */
-
-enum PSL_enum_verbose {PSL_MSG_QUIET = 0,	/* No messages whatsoever */
-	PSL_MSG_FATAL,		/* Fatal errors */
-	PSL_MSG_TICTOC,		/* To print a tic-toc elapsed time message */
-	PSL_MSG_COMPAT,		/* Compatibility warnings */
-	PSL_MSG_NORMAL,		/* Warnings level -V */
-	PSL_MSG_VERBOSE,	/* Longer verbose, -Vl in some programs */
-	PSL_MSG_DEBUG};		/* Debug messages for developers mostly */
-
-/* Color spaces */
-
-enum PSL_enum_color {PSL_RGB = 0,
-	PSL_CMYK,
-	PSL_HSV,
-	PSL_GRAY};
-
-/* Color types */
-
-enum PSL_enum_fill {PSL_IS_STROKE = 0,
-	PSL_IS_FILL,
-	PSL_IS_FONT};
-
-/* PSL error codes */
-
-enum PSL_enum_err {PSL_BAD_VALUE = -99,	/* Bad value */
-	PSL_BAD_JUST,		/* Bad text or paragraph justification */
-	PSL_READ_FAILURE,	/* Less than 3 points */
-	PSL_NO_POLYGON,		/* Less than 3 points */
-	PSL_BAD_TEXT,		/* Text is too long */
-	PSL_BAD_WIDTH,		/* Negative line width */
-	PSL_NO_PATH,		/* Less than 2 points given as path */
-	PSL_BAD_SYMBOL,		/* Unknown symbol type */
-	PSL_BAD_SIZE,		/* Size is negative */
-	PSL_BAD_RANGE,		/* Range defined by min/max exceeds limit */
-	PSL_BAD_FLAG,		/* A flag is outside required range */
-	PSL_NO_SESSION,		/* No active session */
-	PSL_NO_ERROR = 0};	/* No errors, all is OK */
-
-/*--------------------------------------------------------------------
- *			PSL PARAMETERS DEFINITIONS
- *--------------------------------------------------------------------*/
-
-struct PSL_CTRL {
-	struct INIT {	/* Parameters set by user via PSL_beginplot() */
-		FILE *err;			/* Error stream (NULL means stderr)		*/
-		char *encoding;			/* The encoding name. e.g. ISO-8859-1		*/
-		char *session;			/* The session name (NULL)			*/
-		int unit;			/* 0 = cm, 1 = inch, 2 = meter			*/
-		int copies;		/* Number of copies for this plot		*/
-		double page_rgb[4];		/* RGB color for background paper [white]	*/
-		double page_size[2];		/* Width and height of paper used in points	*/
-		double magnify[2];		/* Global scale values [1/1]			*/
-	} init;
-	struct CURRENT {	/* Variables and settings that changes via PSL_* calls */
-		char string[PSL_BUFSIZ];	/* Last text string plotted			*/
-		char style[512];		/* Current setdash pattern			*/
-		char bw_format[8];		/* Format used for grayshade value		*/
-		char rgb_format[64];		/* Same, for RGB color triplets			*/
-		char hsv_format[64];		/* Same, for HSV color triplets	(HSB in PS)	*/
-		char cmyk_format[64];		/* Same, for CMYK color quadruples		*/
-		char transparency_mode[16];	/* PDF transparency mode			*/
-		double linewidth;		/* Current pen thickness			*/
-		double rgb[3][4];		/* Current stroke, fill, and fs fill rgb	*/
-		double offset;			/* Current setdash offset			*/
-		double fontsize;		/* Current font size				*/
-		double subsupsize;		/* Fractional size of super/sub-scripts		*/
-		double scapssize;		/* Fractional size of small caps		*/
-		double sub_down;		/* Fractional fontsize shift down for subscript */
-		double sup_up[2];		/* Fractional fontsize shift up for superscript */
-						/* [0] is for lower-case, [1] is for uppercase  */
-		int nclip;			/* Clip depth 					*/
-		int font_no;		/* Current font number				*/
-		int outline;		/* Current outline				*/
-	} current;
-	struct INTERNAL {	/* Variables used internally only */
-		char *SHAREDIR;			/* Pointer to path of directory with pslib subdirectory */
-		char *USERDIR;			/* Pointer to path of directory with user definitions (~/.gmt) */
-		char *user_image[PSL_N_PATTERNS];	/* Name of user patterns		*/
-		char origin[2];			/* 'r', 'a', 'f', 'c' depending on reference for new origin x and y coordinate */
-		double offset[2];		/* Origin offset [1/1]				*/
-		double p_width;			/* Paper width in points, set in PSL_beginplot();	*/
-		double p_height;		/* Paper height in points, set in PSL_beginplot();	*/
-		double dpu;			/* PS dots per unit.  Must be set through PSL_beginplot();		*/
-		double dpp;			/* PS dots per point.  Must be set through PSL_beginplot();		*/
-		double x2ix;			/* Scales user x to PS dots			*/
-		double y2iy;			/* Scales user y to PS dots			*/
-		double p2u;			/* Scales dimensions in points (e.g., fonts, linewidths) to user units (e.g. inch)		*/
-		double axis_limit[4];		/* The current xmin, xmax, ymin, ymax settings for axes */
-		double axis_pos[2];		/* Lower left placement for axes		*/
-		double axis_dim[2];		/* Lengths of axes 				*/
-		int verbose;		/* Verbosity level (0-4): see PSL_MSG_*	*/
-		int comments;		/* true for writing comments to output, false strips all comments */
-		int overlay;		/* true if overlay (-O)				*/
-		int landscape;		/* true = Landscape, false = Portrait		*/
-		int text_init;		/* true after PSL_text.ps has been loaded	*/
-		int image_format;		/* 0 writes images in ascii, 2 uses binary	*/
-		int N_FONTS;		/* Total no of fonts;  To add more, modify the file CUSTOM_font_info.d */
-		int compress;		/* Compresses images with (1) RLE or (2) LZW (3) DEFLATE or (0) None */
-		int deflate_level; /* Compression level for DEFLATE (1-9, default 0) */
-		int color_mode;		/* 0 = rgb, 1 = cmyk, 2 = hsv (only 1-2 for images)	*/
-		int line_cap;		/* 0, 1, or 2 for butt, round, or square [butt]	*/
-		int line_join;		/* 0, 1, or 2 for miter, arc, or bevel [miter]	*/
-		int miter_limit;		/* Acute angle threshold 0-180; 0 means PS default [0] */
-		int ix, iy;		/* Absolute coordinates of last point		*/
-		int n_userimages;		/* Number of specified custom patterns		*/
-		int x0, y0;		/* x,y PS offsets				*/
-		FILE *fp;			/* PS output file pointer. NULL = stdout	*/
-		struct PSL_FONT {
-			double height;		/* Height of A for unit fontsize */
-			char *name;		/* Name of this font */
-			int encoded;	/* true if we never should reencode this font (e.g. symbols) */
-						/* This is also changed to true after we do reencode a font */
-		} *font;	/* Pointer to array of font structures 		*/
-		struct PSL_PATTERN {
-			int nx, ny;
-			int status, depth, dpi;
-			double f_rgb[4], b_rgb[4];
-		} pattern[PSL_N_PATTERNS*2];
-	} internal;
-};
-
-struct imageinfo {
-	int magic;		/* magic number */
-	int width;		/* width (pixels) of image */
-	int height;		/* height (pixels) of image */
-	int depth;		/* depth (1, 8, or 24 bits) of pixel; 0 for EPS */
-	int length;		/* length (bytes) of image */
-	int type;		/* type of file; see RT_* below */
-	int maptype;	/* type of colormap; see RMT_* below */
-	int maplength;	/* length (bytes) of following map */
-	int xorigin;	/* x-coordinate of origin (EPS only) */
-	int yorigin;	/* y-coordinate of origin (EPS only) */
-	/* color map follows for maplength bytes, followed by image */
-};
-
-#define	RAS_MAGIC	0x59a66a95	/* Magic number for Sun rasterfile */
-#define EPS_MAGIC	0x25215053	/* Magic number for EPS file */
-#define RT_OLD		0		/* Old-style, unencoded Sun rasterfile */
-#define RT_STANDARD	1		/* Standard, unencoded Sun rasterfile */
-#define RT_BYTE_ENCODED	2		/* Run-length-encoded Sun rasterfile */
-#define RT_FORMAT_RGB	3		/* [X]RGB instead of [X]BGR Sun rasterfile */
-#define RT_EPS		4		/* Encapsulated PostScript format */
-#define RMT_NONE	0		/* maplength is expected to be 0 */
-#define RMT_EQUAL_RGB	1		/* red[maplength/3], green[], blue[] follow */
-
-/* Public functions */
-
-EXTERN_MSC struct PSL_CTRL *New_PSL_Ctrl (char *session);
-EXTERN_MSC int PSL_beginaxes (struct PSL_CTRL *PSL, double llx, double lly, double width, double height, double x0, double y0, double x1, double y1);
-EXTERN_MSC int PSL_beginclipping (struct PSL_CTRL *PSL, double *x, double *y, int n, double rgb[], int flag);
-EXTERN_MSC int PSL_beginlayer (struct PSL_CTRL *PSL, int layer);
-EXTERN_MSC int PSL_beginplot (struct PSL_CTRL *PSL, FILE *fp, int orientation, int overlay, int color_mode, char origin[], double offset[], double page_size[], char *title, int font_no[]);
-EXTERN_MSC int PSL_beginsession (struct PSL_CTRL *PSL, unsigned int search, char *sharedir, char *userdir);
-EXTERN_MSC int PSL_endaxes (struct PSL_CTRL *PSL);
-EXTERN_MSC int PSL_endclipping (struct PSL_CTRL *PSL, int mode);
-EXTERN_MSC int PSL_endlayer (struct PSL_CTRL *PSL);
-EXTERN_MSC int PSL_endplot (struct PSL_CTRL *PSL, int lastpage);
-EXTERN_MSC int PSL_endsession (struct PSL_CTRL *PSL);
-EXTERN_MSC int PSL_plotarc (struct PSL_CTRL *PSL, double x, double y, double radius, double az1, double az2, int type);
-EXTERN_MSC int PSL_plotaxis (struct PSL_CTRL *PSL, double annotation_int, char *label, double annotfontsize, int side);
-EXTERN_MSC int PSL_plotbitimage (struct PSL_CTRL *PSL, double x, double y, double xsize, double ysize, int justify, unsigned char *buffer, int nx, int ny, double f_rgb[], double b_rgb[]);
-EXTERN_MSC int PSL_plotcolorimage (struct PSL_CTRL *PSL, double x, double y, double xsize, double ysize, int justify, unsigned char *buffer, int nx, int ny, int nbits);
-EXTERN_MSC int PSL_plotepsimage (struct PSL_CTRL *PSL, double x, double y, double xsize, double ysize, int justify, unsigned char *buffer, int size, int nx, int ny, int ox, int oy);
-EXTERN_MSC int PSL_plotline (struct PSL_CTRL *PSL, double *x, double *y, int n, int type);
-EXTERN_MSC int PSL_plotparagraph (struct PSL_CTRL *PSL, double x, double y, double fontsize, char *paragraph, double angle, int justify);
-EXTERN_MSC int PSL_plotparagraphbox (struct PSL_CTRL *PSL, double x, double y, double fontsize, char *paragraph, double angle, int justify, double offset[], int mode);
-EXTERN_MSC int PSL_plotpoint (struct PSL_CTRL *PSL, double x, double y, int pen);
-EXTERN_MSC int PSL_plotbox (struct PSL_CTRL *PSL, double x0, double y0, double x1, double y1);
-EXTERN_MSC int PSL_plotpolygon (struct PSL_CTRL *PSL, double *x, double *y, int n);
-EXTERN_MSC int PSL_plotsegment (struct PSL_CTRL *PSL, double x0, double y0, double x1, double y1);
-EXTERN_MSC int PSL_plotsymbol (struct PSL_CTRL *PSL, double x, double y, double param[], int symbol);
-EXTERN_MSC int PSL_plottext (struct PSL_CTRL *PSL, double x, double y, double fontsize, char *text, double angle, int justify, int mode);
-EXTERN_MSC int PSL_plottextbox (struct PSL_CTRL *PSL, double x, double y, double fontsize, char *text, double angle, int justify, double offset[], int mode);
-EXTERN_MSC int PSL_plottextline (struct PSL_CTRL *PSL, double x[], double y[], int np[], int n_segments, void *arg1, void *arg2, char *label[], double angle[], int nlabel_per_seg[], double fontsize, int justify, double offset[], int mode);
-EXTERN_MSC int PSL_loadimage (struct PSL_CTRL *PSL, char *file, struct imageinfo *header, unsigned char **image);
-EXTERN_MSC int PSL_setcolor (struct PSL_CTRL *PSL, double rgb[], int mode);
-EXTERN_MSC int PSL_setdefaults (struct PSL_CTRL *PSL, double xyscales[], double page_rgb[], char *encoding);
-EXTERN_MSC int PSL_setdash (struct PSL_CTRL *PSL, char *pattern, double offset);
-EXTERN_MSC int PSL_setfill (struct PSL_CTRL *PSL, double rgb[], int outline);
-EXTERN_MSC int PSL_setfont (struct PSL_CTRL *PSL, int font_no);
-EXTERN_MSC int PSL_setfontdims (struct PSL_CTRL *PSL, double supsub, double scaps, double sup_lc, double sup_uc, double sdown);
-EXTERN_MSC int PSL_setformat (struct PSL_CTRL *PSL, int n_decimals);
-EXTERN_MSC int PSL_setlinecap (struct PSL_CTRL *PSL, int cap);
-EXTERN_MSC int PSL_setlinejoin (struct PSL_CTRL *PSL, int join);
-EXTERN_MSC int PSL_setlinewidth (struct PSL_CTRL *PSL, double linewidth);
-EXTERN_MSC int PSL_setmiterlimit (struct PSL_CTRL *PSL, int limit);
-EXTERN_MSC int PSL_setorigin (struct PSL_CTRL *PSL, double x, double y, double angle, int mode);
-EXTERN_MSC int PSL_setparagraph (struct PSL_CTRL *PSL, double line_space, double par_width, int par_just);
-EXTERN_MSC int PSL_setpattern (struct PSL_CTRL *PSL, int image_no, char *imagefile, int image_dpi, double f_rgb[], double b_rgb[]);
-EXTERN_MSC int PSL_settransparencymode (struct PSL_CTRL *PSL, const char *mode);
-EXTERN_MSC int PSL_definteger (struct PSL_CTRL *PSL, const char *param, int value);
-EXTERN_MSC int PSL_defpen (struct PSL_CTRL *PSL, const char *param, double width, char *style, double offset, double rgb[]);
-EXTERN_MSC int PSL_defpoints (struct PSL_CTRL *PSL, const char *param, double fontsize);
-EXTERN_MSC int PSL_defcolor (struct PSL_CTRL *PSL, const char *param, double rgb[]);
-EXTERN_MSC int PSL_deftextdim (struct PSL_CTRL *PSL, const char *dim, double fontsize, char *text);
-EXTERN_MSC int PSL_defunits (struct PSL_CTRL *PSL, const char *param, double value);
-EXTERN_MSC unsigned char *psl_gray_encode (struct PSL_CTRL *PSL, int *nbytes, unsigned char *input);
-EXTERN_MSC char * PSL_makepen (struct PSL_CTRL *PSL, double linewidth, double rgb[], char *pattern, double offset);
-
-/* Other deep level routines that are useful */
-EXTERN_MSC int psl_ix (struct PSL_CTRL *PSL, double value);
-EXTERN_MSC int psl_iy (struct PSL_CTRL *PSL, double value);
-EXTERN_MSC int psl_iz (struct PSL_CTRL *PSL, double value);
-EXTERN_MSC int psl_ip (struct PSL_CTRL *PSL, double value);
-EXTERN_MSC void psl_set_txt_array (struct PSL_CTRL *PSL, const char *param, char *array[], int n);
-EXTERN_MSC int psl_encodefont (struct PSL_CTRL *PSL, int font_no);
-EXTERN_MSC void psl_set_int_array (struct PSL_CTRL *PSL, const char *param, int *array, int n);
-EXTERN_MSC char *psl_putcolor (struct PSL_CTRL *PSL, double rgb[]);
-
-/* Used indirectly by macro PSL_free and FORTRAN wrapper PSL_free_ . */
-EXTERN_MSC int PSL_free_nonmacro (void *addr);
-
-/* Definition for printing a message. When DEBUG is on, also print source file and line number.
- * Use this for various progress statements, debugging to see certain variables, and even fatal
- * error messages. */
-/* For FORTRAN there is PSL_command_ that only accepts one text argument */
-EXTERN_MSC int PSL_command (struct PSL_CTRL *C, const char *format, ...);
-EXTERN_MSC int PSL_comment (struct PSL_CTRL *C, const char *format, ...);
-EXTERN_MSC int PSL_initerr (struct PSL_CTRL *C, const char *format, ...);
-EXTERN_MSC int PSL_message (struct PSL_CTRL *C, int level, const char *format, ...);
-EXTERN_MSC FILE *PSL_fopen (char *file, char *mode);
-
-#define PSL_free(ptr) (PSL_free_nonmacro(ptr),(ptr)=NULL) /* Cleanly set the freed pointer to NULL */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _PSLIB_H */
diff --git a/src/gsf/LGPL_2-1.pdf b/src/gsf/LGPL_2-1.pdf
deleted file mode 100644
index b128807..0000000
Binary files a/src/gsf/LGPL_2-1.pdf and /dev/null differ
diff --git a/src/gsf/Makefile.am b/src/gsf/Makefile.am
deleted file mode 100644
index 82302c9..0000000
--- a/src/gsf/Makefile.am
+++ /dev/null
@@ -1,10 +0,0 @@
-AM_CPPFLAGS = -I${top_srcdir}/src/mbio -DUSE_DEFAULT_FILE_FUNCTIONS
-
-include_HEADERS = gsf.h
-
-lib_LTLIBRARIES = libmbgsf.la
-
-libmbgsf_la_LDFLAGS = -no-undefined -version-info 0:0:0
-
-libmbgsf_la_SOURCES = \
-dump_gsf.c  gsf.c  gsf_dec.c  gsf_enc.c  gsf_indx.c gsf_info.c
diff --git a/src/gsf/Makefile.in b/src/gsf/Makefile.in
deleted file mode 100644
index c326083..0000000
--- a/src/gsf/Makefile.in
+++ /dev/null
@@ -1,703 +0,0 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
-
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-
-
-VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
-am__make_running_with_option = \
-  case $${target_option-} in \
-      ?) ;; \
-      *) echo "am__make_running_with_option: internal error: invalid" \
-              "target option '$${target_option-}' specified" >&2; \
-         exit 1;; \
-  esac; \
-  has_opt=no; \
-  sane_makeflags=$$MAKEFLAGS; \
-  if $(am__is_gnu_make); then \
-    sane_makeflags=$$MFLAGS; \
-  else \
-    case $$MAKEFLAGS in \
-      *\\[\ \	]*) \
-        bs=\\; \
-        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
-          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
-    esac; \
-  fi; \
-  skip_next=no; \
-  strip_trailopt () \
-  { \
-    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
-  }; \
-  for flg in $$sane_makeflags; do \
-    test $$skip_next = yes && { skip_next=no; continue; }; \
-    case $$flg in \
-      *=*|--*) continue;; \
-        -*I) strip_trailopt 'I'; skip_next=yes;; \
-      -*I?*) strip_trailopt 'I';; \
-        -*O) strip_trailopt 'O'; skip_next=yes;; \
-      -*O?*) strip_trailopt 'O';; \
-        -*l) strip_trailopt 'l'; skip_next=yes;; \
-      -*l?*) strip_trailopt 'l';; \
-      -[dEDm]) skip_next=yes;; \
-      -[JT]) skip_next=yes;; \
-    esac; \
-    case $$flg in \
-      *$$target_option*) has_opt=yes; break;; \
-    esac; \
-  done; \
-  test $$has_opt = yes
-am__make_dryrun = (target_option=n; $(am__make_running_with_option))
-am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-subdir = src/gsf
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/depcomp $(include_HEADERS)
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
-	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
-	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
-	$(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-	$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/src/mbio/mb_config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
-am__vpath_adj = case $$p in \
-    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
-    *) f=$$p;; \
-  esac;
-am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
-am__install_max = 40
-am__nobase_strip_setup = \
-  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
-am__nobase_strip = \
-  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
-am__nobase_list = $(am__nobase_strip_setup); \
-  for p in $$list; do echo "$$p $$p"; done | \
-  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
-  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
-    if (++n[$$2] == $(am__install_max)) \
-      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
-    END { for (dir in files) print dir, files[dir] }'
-am__base_list = \
-  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
-  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
-am__uninstall_files_from_dir = { \
-  test -z "$$files" \
-    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
-    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
-         $(am__cd) "$$dir" && rm -f $$files; }; \
-  }
-am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includedir)"
-LTLIBRARIES = $(lib_LTLIBRARIES)
-libmbgsf_la_LIBADD =
-am_libmbgsf_la_OBJECTS = dump_gsf.lo gsf.lo gsf_dec.lo gsf_enc.lo \
-	gsf_indx.lo gsf_info.lo
-libmbgsf_la_OBJECTS = $(am_libmbgsf_la_OBJECTS)
-AM_V_lt = $(am__v_lt_ at AM_V@)
-am__v_lt_ = $(am__v_lt_ at AM_DEFAULT_V@)
-am__v_lt_0 = --silent
-am__v_lt_1 = 
-libmbgsf_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
-	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
-	$(libmbgsf_la_LDFLAGS) $(LDFLAGS) -o $@
-AM_V_P = $(am__v_P_ at AM_V@)
-am__v_P_ = $(am__v_P_ at AM_DEFAULT_V@)
-am__v_P_0 = false
-am__v_P_1 = :
-AM_V_GEN = $(am__v_GEN_ at AM_V@)
-am__v_GEN_ = $(am__v_GEN_ at AM_DEFAULT_V@)
-am__v_GEN_0 = @echo "  GEN     " $@;
-am__v_GEN_1 = 
-AM_V_at = $(am__v_at_ at AM_V@)
-am__v_at_ = $(am__v_at_ at AM_DEFAULT_V@)
-am__v_at_0 = @
-am__v_at_1 = 
-DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)/src/mbio
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
-am__mv = mv -f
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
-	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
-	$(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
-	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
-	$(AM_CFLAGS) $(CFLAGS)
-AM_V_CC = $(am__v_CC_ at AM_V@)
-am__v_CC_ = $(am__v_CC_ at AM_DEFAULT_V@)
-am__v_CC_0 = @echo "  CC      " $@;
-am__v_CC_1 = 
-CCLD = $(CC)
-LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
-	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
-	$(AM_LDFLAGS) $(LDFLAGS) -o $@
-AM_V_CCLD = $(am__v_CCLD_ at AM_V@)
-am__v_CCLD_ = $(am__v_CCLD_ at AM_DEFAULT_V@)
-am__v_CCLD_0 = @echo "  CCLD    " $@;
-am__v_CCLD_1 = 
-SOURCES = $(libmbgsf_la_SOURCES)
-DIST_SOURCES = $(libmbgsf_la_SOURCES)
-am__can_run_installinfo = \
-  case $$AM_UPDATE_INFO_DIR in \
-    n|no|NO) false;; \
-    *) (install-info --version) >/dev/null 2>&1;; \
-  esac
-HEADERS = $(include_HEADERS)
-am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
-# Read a list of newline-separated strings from the standard input,
-# and print each of them once, without duplicates.  Input order is
-# *not* preserved.
-am__uniquify_input = $(AWK) '\
-  BEGIN { nonempty = 0; } \
-  { items[$$0] = 1; nonempty = 1; } \
-  END { if (nonempty) { for (i in items) print i; }; } \
-'
-# Make sure the list of sources is unique.  This is necessary because,
-# e.g., the same source file might be shared among _SOURCES variables
-# for different programs/libraries.
-am__define_uniq_tagged_files = \
-  list='$(am__tagged_files)'; \
-  unique=`for i in $$list; do \
-    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-  done | $(am__uniquify_input)`
-ETAGS = etags
-CTAGS = ctags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-CC = @CC@
-CCAS = @CCAS@
-CCASDEPMODE = @CCASDEPMODE@
-CCASFLAGS = @CCASFLAGS@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DLLTOOL = @DLLTOOL@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GREP = @GREP@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBM = @LIBM@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIBTOOL_DEPS = @LIBTOOL_DEPS@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LTLIBOBJS = @LTLIBOBJS@
-LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
-MAINT = @MAINT@
-MAKEINFO = @MAKEINFO@
-MANIFEST_TOOL = @MANIFEST_TOOL@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-OTPS_DIR = @OTPS_DIR@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_URL = @PACKAGE_URL@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PKG_CONFIG = @PKG_CONFIG@
-PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
-PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-VERSION = @VERSION@
-XDR_LIB = @XDR_LIB@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_AR = @ac_ct_AR@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-fftw_app = @fftw_app@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libGLU_CFLAGS = @libGLU_CFLAGS@
-libGLU_LIBS = @libGLU_LIBS@
-libXm_CFLAGS = @libXm_CFLAGS@
-libXm_LIBS = @libXm_LIBS@
-libdir = @libdir@
-libexecdir = @libexecdir@
-libfftw3_CFLAGS = @libfftw3_CFLAGS@
-libfftw3_LIBS = @libfftw3_LIBS@
-libfftw_CPPFLAGS = @libfftw_CPPFLAGS@
-libfftw_LIBS = @libfftw_LIBS@
-libgmt_CFLAGS = @libgmt_CFLAGS@
-libgmt_CPPFLAGS = @libgmt_CPPFLAGS@
-libgmt_LIBS = @libgmt_LIBS@
-libmotif_CPPFLAGS = @libmotif_CPPFLAGS@
-libmotif_LIBS = @libmotif_LIBS@
-libnetcdf_CFLAGS = @libnetcdf_CFLAGS@
-libnetcdf_CPPFLAGS = @libnetcdf_CPPFLAGS@
-libnetcdf_LIBS = @libnetcdf_LIBS@
-libopengl_CPPFLAGS = @libopengl_CPPFLAGS@
-libopengl_LIBS = @libopengl_LIBS@
-libproj_CFLAGS = @libproj_CFLAGS@
-libproj_CPPFLAGS = @libproj_CPPFLAGS@
-libproj_LIBS = @libproj_LIBS@
-libpsl_CFLAGS = @libpsl_CFLAGS@
-libpsl_LIBS = @libpsl_LIBS@
-localedir = @localedir@
-localstatedir = @localstatedir@
-mandir = @mandir@
-mbsystemdatadir = @mbsystemdatadir@
-mbsystemhtmldir = @mbsystemhtmldir@
-mbsystempsdir = @mbsystempsdir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-AM_CPPFLAGS = -I${top_srcdir}/src/mbio -DUSE_DEFAULT_FILE_FUNCTIONS
-include_HEADERS = gsf.h
-lib_LTLIBRARIES = libmbgsf.la
-libmbgsf_la_LDFLAGS = -no-undefined -version-info 0:0:0
-libmbgsf_la_SOURCES = \
-dump_gsf.c  gsf.c  gsf_dec.c  gsf_enc.c  gsf_indx.c gsf_info.c
-
-all: all-am
-
-.SUFFIXES:
-.SUFFIXES: .c .lo .o .obj
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
-	@for dep in $?; do \
-	  case '$(am__configure_deps)' in \
-	    *$$dep*) \
-	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-	        && { if test -f $@; then exit 0; else break; fi; }; \
-	      exit 1;; \
-	  esac; \
-	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/gsf/Makefile'; \
-	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --gnu src/gsf/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	@case '$?' in \
-	  *config.status*) \
-	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-	esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-
-install-libLTLIBRARIES: $(lib_LTLIBRARIES)
-	@$(NORMAL_INSTALL)
-	@list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
-	list2=; for p in $$list; do \
-	  if test -f $$p; then \
-	    list2="$$list2 $$p"; \
-	  else :; fi; \
-	done; \
-	test -z "$$list2" || { \
-	  echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \
-	  $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \
-	}
-
-uninstall-libLTLIBRARIES:
-	@$(NORMAL_UNINSTALL)
-	@list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
-	for p in $$list; do \
-	  $(am__strip_dir) \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \
-	done
-
-clean-libLTLIBRARIES:
-	-test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
-	@list='$(lib_LTLIBRARIES)'; \
-	locs=`for p in $$list; do echo $$p; done | \
-	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
-	      sort -u`; \
-	test -z "$$locs" || { \
-	  echo rm -f $${locs}; \
-	  rm -f $${locs}; \
-	}
-
-libmbgsf.la: $(libmbgsf_la_OBJECTS) $(libmbgsf_la_DEPENDENCIES) $(EXTRA_libmbgsf_la_DEPENDENCIES) 
-	$(AM_V_CCLD)$(libmbgsf_la_LINK) -rpath $(libdir) $(libmbgsf_la_OBJECTS) $(libmbgsf_la_LIBADD) $(LIBS)
-
-mostlyclean-compile:
-	-rm -f *.$(OBJEXT)
-
-distclean-compile:
-	-rm -f *.tab.c
-
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/dump_gsf.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gsf.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gsf_dec.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gsf_enc.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gsf_indx.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gsf_info.Plo at am__quote@
-
-.c.o:
- at am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(COMPILE) -c -o $@ $<
-
-.c.obj:
- at am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
- at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-
-.c.lo:
- at am__fastdepCC_TRUE@	$(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(LTCOMPILE) -c -o $@ $<
-
-mostlyclean-libtool:
-	-rm -f *.lo
-
-clean-libtool:
-	-rm -rf .libs _libs
-install-includeHEADERS: $(include_HEADERS)
-	@$(NORMAL_INSTALL)
-	@list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \
-	if test -n "$$list"; then \
-	  echo " $(MKDIR_P) '$(DESTDIR)$(includedir)'"; \
-	  $(MKDIR_P) "$(DESTDIR)$(includedir)" || exit 1; \
-	fi; \
-	for p in $$list; do \
-	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
-	  echo "$$d$$p"; \
-	done | $(am__base_list) | \
-	while read files; do \
-	  echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includedir)'"; \
-	  $(INSTALL_HEADER) $$files "$(DESTDIR)$(includedir)" || exit $$?; \
-	done
-
-uninstall-includeHEADERS:
-	@$(NORMAL_UNINSTALL)
-	@list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \
-	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
-	dir='$(DESTDIR)$(includedir)'; $(am__uninstall_files_from_dir)
-
-ID: $(am__tagged_files)
-	$(am__define_uniq_tagged_files); mkid -fID $$unique
-tags: tags-am
-TAGS: tags
-
-tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
-	set x; \
-	here=`pwd`; \
-	$(am__define_uniq_tagged_files); \
-	shift; \
-	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
-	  test -n "$$unique" || unique=$$empty_fix; \
-	  if test $$# -gt 0; then \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      "$$@" $$unique; \
-	  else \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      $$unique; \
-	  fi; \
-	fi
-ctags: ctags-am
-
-CTAGS: ctags
-ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
-	$(am__define_uniq_tagged_files); \
-	test -z "$(CTAGS_ARGS)$$unique" \
-	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$unique
-
-GTAGS:
-	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && $(am__cd) $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) "$$here"
-cscopelist: cscopelist-am
-
-cscopelist-am: $(am__tagged_files)
-	list='$(am__tagged_files)'; \
-	case "$(srcdir)" in \
-	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
-	  *) sdir=$(subdir)/$(srcdir) ;; \
-	esac; \
-	for i in $$list; do \
-	  if test -f "$$i"; then \
-	    echo "$(subdir)/$$i"; \
-	  else \
-	    echo "$$sdir/$$i"; \
-	  fi; \
-	done >> $(top_builddir)/cscope.files
-
-distclean-tags:
-	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	list='$(DISTFILES)'; \
-	  dist_files=`for file in $$list; do echo $$file; done | \
-	  sed -e "s|^$$srcdirstrip/||;t" \
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
-	case $$dist_files in \
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
-			   sort -u` ;; \
-	esac; \
-	for file in $$dist_files; do \
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  if test -d $$d/$$file; then \
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
-	    if test -d "$(distdir)/$$file"; then \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
-	  else \
-	    test -f "$(distdir)/$$file" \
-	    || cp -p $$d/$$file "$(distdir)/$$file" \
-	    || exit 1; \
-	  fi; \
-	done
-check-am: all-am
-check: check-am
-all-am: Makefile $(LTLIBRARIES) $(HEADERS)
-installdirs:
-	for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includedir)"; do \
-	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
-	done
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
-	if test -z '$(STRIP)'; then \
-	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	      install; \
-	else \
-	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
-	fi
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
-	@echo "This command is intended for maintainers to use"
-	@echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \
-	mostlyclean-am
-
-distclean: distclean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
-	distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am: install-includeHEADERS
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am: install-libLTLIBRARIES
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic \
-	mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am: uninstall-includeHEADERS uninstall-libLTLIBRARIES
-
-.MAKE: install-am install-strip
-
-.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
-	clean-libLTLIBRARIES clean-libtool cscopelist-am ctags \
-	ctags-am distclean distclean-compile distclean-generic \
-	distclean-libtool distclean-tags distdir dvi dvi-am html \
-	html-am info info-am install install-am install-data \
-	install-data-am install-dvi install-dvi-am install-exec \
-	install-exec-am install-html install-html-am \
-	install-includeHEADERS install-info install-info-am \
-	install-libLTLIBRARIES install-man install-pdf install-pdf-am \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-compile \
-	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-	tags tags-am uninstall uninstall-am uninstall-includeHEADERS \
-	uninstall-libLTLIBRARIES
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/gsf/dump_gsf.c b/src/gsf/dump_gsf.c
deleted file mode 100644
index c49b255..0000000
--- a/src/gsf/dump_gsf.c
+++ /dev/null
@@ -1,489 +0,0 @@
-/********************************************************************
- *
- * Module Name : DUMP_GSF
- *
- * Author/Date : J. S. Byrne / 12 May 1994
- *
- * Description : This file contains the source code for the dump_gsf
- *                test program.  This program was written during the
- *                development of the gsf library as a test program.  It
- *                can be used to view the contents of a gsf swath bathymetry
- *                ping record in text form.
- *
- * Restrictions/Limitations :
- *
- * Change Descriptions :
- * who  when      what
- * ---  ----      ----
- *
- *
- * Classification : Unclassified
- *
- * References : DoDBL Generic Sensor Format Sept. 30, 1993
- *
- * Copyright (C) Science Applications International Corp.
- ********************************************************************/
-
-/* Get required standard c include files */
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-
-/* Get specific includes */
-#include "gsf.h"
-
-/* global external data required by this module */
-extern int gsfError;
-
-/* static global data for this module */
-static gsfRecords gsfRec;
-static gsfDataID id;
-static int shortOutput;
-static int pingTimeOutput;
-
-/* function prototypes for this module */
-static void     printMBPing(int rec_number);
-
-/********************************************************************
- *
- * Function Name : main
- *
- * Description : This is the main function of the dump_gsf program.
- *    This function receive the file name to open as a command line
- *    argument, opens the file, and then reads each record from the
- *    file one at a time.  Ping records are dumped in text form to the
- *    stdout device.
- *
- * Inputs :
- *    argc = an integer argument counter
- *    argv = a pointer to an array of character string command line arguments
- *
- * Returns : This function (program) returns a zero if succesful, or a non
- *  zero value if unsuccesful to the invokation environment.
- *
- * Error Conditions :
- *
- ********************************************************************/
-
-int
-main(int argc, char *argv[])
-{
-    char            gsfFileName[128];
-    char            str[64];
-    char           *ptr;
-    int             gsfHandle;
-    int             bytes;
-    int             num_header = 0;
-    int             num_svp = 0;
-    int             num_pparam = 0;
-    int             num_sparam = 0;
-    int             num_comment = 0;
-    int             num_ping = 0;
-    int             num_history = 0;
-    int             num_nav_error = 0;
-    int             num_ping_sum = 0;
-    int             record_number = 0;
-    int             i;
-    int             val;
-    struct tm      *t;
-    struct tm       st;
-    time_t          StartTime=0;
-
-    /* check the command line arguments */
-    if (argc < 3)
-    {
-        fprintf(stderr, "Useage: %s [-s] -f <gsf filename> [-pt] [-t mm/dd/yy hh:mm:ss]\n", argv[0]);
-        fprintf(stderr, "-s: short output a page at a time\n");
-        fprintf(stderr, "-f: for specifying the input file\n");
-        fprintf(stderr, "-pt: short output showing only ping times, all pings printed to stdout\n");
-        fprintf(stderr, "-t: for specifying start time\n");
-        exit(0);
-    }
-
-    for (i=1; i<argc; i++)
-    {
-        if ((strcmp(argv[i], "-f") == 0) && (i+1 <=argc))
-        {
-            sscanf(argv[i+1], "%s", gsfFileName);
-            break;
-        }
-    }
-
-    for (i=1; i<argc; i++)
-    {
-        if ((strcmp(argv[i], "-s") == 0) && (i+1 <= argc))
-        {
-            shortOutput = 1;
-            break;
-        }
-    }
-
-    for (i=1; i<argc; i++)
-    {
-        if ((strcmp(argv[i], "-pt") == 0) && (i+1 <= argc))
-        {
-            pingTimeOutput = 1;
-            shortOutput = 1;
-            break;
-        }
-    }
-
-    for (i=1; i<argc; i++)
-    {
-        if ((strcmp(argv[i], "-t") == 0) && (i+1 <= argc))
-        {
-            /* Don't want to use snptime since this code is distributed */
-            memset(&st, 0, sizeof(st));
-            sscanf(argv[i+1], "%d/%d/%d %d:%d:%d",
-                   &st.tm_mon, &st.tm_mday, &st.tm_year, &st.tm_hour, &st.tm_min, &st.tm_sec);
-            if (st.tm_year < 69 ) st.tm_year += 100;     /* Y2K mapping */
-            st.tm_mon -= 1;
-            putenv("TZ=GMT");
-            tzset();
-            StartTime = mktime(&st);
-        }
-    }
-
-    /* Try to open the specified file */
-    if (gsfOpen(gsfFileName, GSF_READONLY_INDEX, &gsfHandle))
-    {
-        gsfPrintError(stderr);
-        exit(1);
-    }
-
-    /* Reset the file pointer to the begining of the file */
-    if (gsfSeek(gsfHandle, GSF_REWIND))
-    {
-        gsfPrintError(stderr);
-        exit(1);
-    }
-
-    /* force the timezone to gmt */
-    putenv("TZ=GMT");
-    tzset();
-
-    for (;;)
-    {
-        /* we want the next record, no matter what it is */
-        bytes = gsfRead(gsfHandle, GSF_NEXT_RECORD, &id, &gsfRec, NULL, 0);
-        if (bytes < 0)
-        {
-            if (gsfError == GSF_READ_TO_END_OF_FILE)
-            {
-                fprintf(stderr,"Finished processing input file: %s\n", gsfFileName);
-                exit(0);
-            }
-            else
-            {
-                gsfPrintError(stderr);
-            }
-        }
-        else if (bytes == 0)
-        {
-            fprintf(stderr, "Read to end of file: %s\n", gsfFileName);
-            exit(0);
-        }
-
-        /* Window on time if we received a start time */
-        if (gsfRec.mb_ping.ping_time.tv_sec < StartTime)
-        {
-            continue;
-        }
-
-        record_number++;
-        if (((record_number % 20) == 0) && (!pingTimeOutput))
-        {
-            fprintf(stdout, "Press return to continue, q to quit\n");
-            val = fgetc (stdin);
-            if (val == 'q')
-            {
-                return(0);
-            }
-        }
-        switch (id.recordID)
-        {
-            case (GSF_RECORD_HEADER):
-                num_header++;
-                fprintf(stdout, "%05d - gsf header - %s\n", record_number, gsfRec.header.version);
-                break;
-
-            case (GSF_RECORD_SWATH_BATHYMETRY_PING):
-                num_ping++;
-                if (shortOutput)
-                {
-                    t = gmtime(&gsfRec.mb_ping.ping_time.tv_sec);
-                    ptr = str + strftime(str, sizeof(str), " %Y/%j %H:%M:%S", t);
-                    ptr += sprintf(ptr,".%03d", (int)(gsfRec.mb_ping.ping_time.tv_nsec/1e6));
-                    ptr += sprintf(ptr,"%+11.6f %+11.6f", gsfRec.mb_ping.latitude, gsfRec.mb_ping.longitude);
-                    fprintf(stdout, "%05d - Ping at: %s\n", record_number, str);
-                }
-                else
-                {
-                    printMBPing(record_number);
-                }
-                if (pingTimeOutput) 
-                {
-                    continue;
-                }
-                break;
-
-            case (GSF_RECORD_SOUND_VELOCITY_PROFILE):
-                num_svp++;
-                t = gmtime(&gsfRec.svp.application_time.tv_sec);
-                ptr = str + strftime(str, sizeof(str), " %Y/%j %H:%M:%S", t);
-                ptr += sprintf(ptr,".%02d", (int)(gsfRec.svp.application_time.tv_nsec/1e7));
-                fprintf(stdout, "%05d - gsf SVP at: %s\n", record_number, str);
-                break;
-
-            case (GSF_RECORD_PROCESSING_PARAMETERS):
-                num_pparam++;
-                t = gmtime(&gsfRec.process_parameters.param_time.tv_sec);
-                ptr = str + strftime(str, sizeof(str), " %Y/%j %H:%M:%S", t);
-                ptr += sprintf(ptr,".%02d", (int)(gsfRec.process_parameters.param_time.tv_nsec/1e7));
-                fprintf(stdout, "%05d - gsf Processing Parameters at: %s\n", record_number, str);
-                break;
-
-            case (GSF_RECORD_SENSOR_PARAMETERS):
-                num_sparam++;
-                t = gmtime(&gsfRec.sensor_parameters.param_time.tv_sec);
-                ptr = str + strftime(str, sizeof(str), " %Y/%j %H:%M:%S", t);
-                ptr += sprintf(ptr,".%02d", (int)(gsfRec.sensor_parameters.param_time.tv_nsec/1e7));
-                fprintf(stdout, "%05d - gsf Sensor Parameters at: %s\n", record_number, str);
-                break;
-
-            case (GSF_RECORD_COMMENT):
-                num_comment++;
-                t = gmtime(&gsfRec.comment.comment_time.tv_sec);
-                ptr = str + strftime(str, sizeof(str), " %Y/%j %H:%M:%S", t);
-                ptr += sprintf(ptr,".%02d", (int)(gsfRec.comment.comment_time.tv_nsec/1e7));
-                fprintf(stdout, "%05d - gsf Comment at: %s\n", record_number, str);
-                break;
-
-            case (GSF_RECORD_HISTORY):
-                num_history++;
-                t = gmtime(&gsfRec.history.history_time.tv_sec);
-                ptr = str + strftime(str, sizeof(str), " %Y/%j %H:%M:%S", t);
-                ptr += sprintf(ptr,".%02d", (int)(gsfRec.history.history_time.tv_nsec/1e7));
-                fprintf(stdout, "%05d - gsf History at: %s\n", record_number, str);
-                break;
-
-            case (GSF_RECORD_NAVIGATION_ERROR):
-                num_nav_error++;
-                t = gmtime(&gsfRec.nav_error.nav_error_time.tv_sec);
-                ptr = str + strftime(str, sizeof(str), " %Y/%j %H:%M:%S", t);
-                ptr += sprintf(ptr,".%02d", (int)(gsfRec.nav_error.nav_error_time.tv_nsec/1e7));
-                fprintf(stdout, "%05d - gsf Navigation Error - %s\n", record_number, str);
-                break;
-
-            case (GSF_RECORD_SWATH_BATHY_SUMMARY):
-                num_ping_sum++;
-                fprintf(stdout, "%05d - gsf Ping Summary \n", record_number);
-                break;
-
-            default:
-                break;
-        }
-    }
-    return (0);
-}
-
-/********************************************************************
- *
- * Function Name : printMBPing
- *
- * Description : This function prints the contents of a swath bathymetry
- *  ping structure to the stdout device.
- *
- * Inputs : rec_number = the file record number for this ping.
- *
- * Returns : none
- *
- * Error Conditions : none
- *
- ********************************************************************/
-static void
-printMBPing(int rec_number)
-{
-
-    char            str[512];
-    char           *ptr;
-    int             i, j;
-    int             ret;
-    int             line;
-    struct tm      *t;
-    unsigned long   max_intensity_sample;
-
-    fprintf(stdout, "%05d GSF MB Ping:\n", rec_number);
-    t = gmtime(&gsfRec.mb_ping.ping_time.tv_sec);
-    ptr = str + strftime(str, sizeof(str), " %Y/%j %H:%M:%S", t);
-    ptr += sprintf(ptr,".%02d", (int)(gsfRec.mb_ping.ping_time.tv_nsec/1e7));
-    ptr += sprintf(ptr,"%+11.6f %+11.6f", gsfRec.mb_ping.latitude, gsfRec.mb_ping.longitude);
-    fprintf(stdout, "                  %s\n", str);
-    fprintf(stdout, "          heading: %06.2f course: %06.2f speed: %05.2f\n",
-        gsfRec.mb_ping.heading,
-        gsfRec.mb_ping.course,
-        gsfRec.mb_ping.speed);
-    fprintf(stdout, "           sensor: %d beams: %d center: %d r: %+06.2f p: %+06.2f h: %+06.2f\n",
-        gsfRec.mb_ping.sensor_id,
-        gsfRec.mb_ping.number_beams,
-        gsfRec.mb_ping.center_beam,
-        gsfRec.mb_ping.roll,
-        gsfRec.mb_ping.pitch,
-        gsfRec.mb_ping.heave);
-
-    /* build a header for the arrays */
-    sprintf(str, "   Beam");
-    if (gsfRec.mb_ping.depth != NULL)
-    {
-        sprintf(str, "%s   Depth", str);
-    }
-    if (gsfRec.mb_ping.across_track != NULL)
-    {
-        sprintf(str, "%s  XTrack", str);
-    }
-    if (gsfRec.mb_ping.along_track != NULL)
-    {
-        sprintf(str, "%s  ATrack", str);
-    }
-    if (gsfRec.mb_ping.travel_time != NULL)
-    {
-        sprintf(str, "%s   TTime", str);
-    }
-    if (gsfRec.mb_ping.beam_angle != NULL)
-    {
-        sprintf(str, "%s   Angle", str);
-    }
-    if (gsfRec.mb_ping.beam_angle_forward != NULL)
-    {
-        sprintf(str, "%s Ang Fwd", str);
-    }
-    if (gsfRec.mb_ping.mc_amplitude != NULL)
-    {
-        sprintf(str, "%s Cal Amp", str);
-    }
-    if (gsfRec.mb_ping.mr_amplitude != NULL)
-    {
-        sprintf(str, "%s Rel Amp", str);
-    }
-    if (gsfRec.mb_ping.echo_width != NULL)
-    {
-        sprintf(str, "%s   Width", str);
-    }
-    if (gsfRec.mb_ping.quality_factor != NULL)
-    {
-        sprintf(str, "%s  Qualit", str);
-    
-    }
-    if (gsfRec.mb_ping.receive_heave != NULL)
-    {
-        sprintf(str, "%s   Heave", str);
-    }
-    if (gsfRec.mb_ping.brb_inten != NULL)
-    {
-        sprintf(str, "%s Samples", str);  /* number of intensity samples in the beam */
-        sprintf(str, "%s BotSmpl", str);  /* index to the bottom detect sample */
-        sprintf(str, "%s MaxInt.", str);  /* max intensity value for the beam */
-    }
-    if (gsfRec.mb_ping.quality_flags != NULL)
-    {
-        sprintf(str, "%s Q Flags", str);
-    
-    }
-    if (gsfRec.mb_ping.beam_flags != NULL)
-    {
-        sprintf(str, "%s B Flags", str);
-    
-    }
-    fprintf(stdout, "%s\n", str);
-
-    for (i = 0, line = 0; i < gsfRec.mb_ping.number_beams; i++, line++)
-    {
-        sprintf(str, "    %03d", i + 1);
-        if (gsfRec.mb_ping.depth != NULL)
-        {
-            if (gsfRec.mb_ping.depth[i] < 100.0)
-            {
-                sprintf(str, "%s %07.2f", str, gsfRec.mb_ping.depth[i]);
-            }
-            else
-            {
-                sprintf(str, "%s %07.1f", str, gsfRec.mb_ping.depth[i]);
-            }
-        }
-        if (gsfRec.mb_ping.across_track != NULL)
-        {
-            sprintf(str, "%s %+07.1f", str, gsfRec.mb_ping.across_track[i]);
-        }
-        if (gsfRec.mb_ping.along_track != NULL)
-        {
-            sprintf(str, "%s %+07.1f", str, gsfRec.mb_ping.along_track[i]);
-        }
-        if (gsfRec.mb_ping.travel_time != NULL)
-        {
-            sprintf(str, "%s %07.5f", str, gsfRec.mb_ping.travel_time[i]);
-        }
-        if (gsfRec.mb_ping.beam_angle != NULL)
-        {
-            sprintf(str, "%s %07.1f", str, gsfRec.mb_ping.beam_angle[i]);
-        }
-        if (gsfRec.mb_ping.beam_angle_forward != NULL)
-        {
-            sprintf(str, "%s %07.1f", str, gsfRec.mb_ping.beam_angle_forward[i]);
-        }
-        if (gsfRec.mb_ping.mc_amplitude != NULL)
-        {
-            sprintf(str, "%s %07.1f", str, gsfRec.mb_ping.mc_amplitude[i]);
-        }
-        if (gsfRec.mb_ping.mr_amplitude != NULL)
-        {
-            sprintf(str, "%s %07.1f", str, gsfRec.mb_ping.mr_amplitude[i]);
-        }
-        if (gsfRec.mb_ping.echo_width != NULL)
-        {
-            sprintf(str, "%s %07.1f", str, gsfRec.mb_ping.echo_width[i]);
-        }
-        if (gsfRec.mb_ping.quality_factor != NULL)
-        {
-            sprintf(str, "%s %07.1f", str, gsfRec.mb_ping.quality_factor[i]);
-        }
-        if (gsfRec.mb_ping.receive_heave != NULL)
-        {
-            sprintf(str, "%s %0.7f", str, gsfRec.mb_ping.receive_heave[i]);
-        }
-        if (gsfRec.mb_ping.brb_inten != NULL)
-        {
-            sprintf(str, "%s %7d", str, gsfRec.mb_ping.brb_inten->time_series[i].sample_count);
-            sprintf(str, "%s %7d", str, gsfRec.mb_ping.brb_inten->time_series[i].detect_sample);
-            max_intensity_sample = 0;
-            for (j = 0; j < gsfRec.mb_ping.brb_inten->time_series[i].sample_count; j++)
-            {
-                if (gsfRec.mb_ping.brb_inten->time_series[i].samples[j] > max_intensity_sample)
-                {
-                    max_intensity_sample = gsfRec.mb_ping.brb_inten->time_series[i].samples[j];
-                }
-            }
-            sprintf(str, "%s %07lX", str, max_intensity_sample);
-        }
-        if (gsfRec.mb_ping.quality_flags != NULL)
-        {
-            sprintf(str, "%s %0.7d", str, gsfRec.mb_ping.quality_flags[i]);
-        }
-        if (gsfRec.mb_ping.beam_flags != NULL)
-        {
-            sprintf(str, "%s %0.7d", str, gsfRec.mb_ping.beam_flags[i]);
-        }
-        fprintf(stdout, "%s\n", str);
-        if (line > 20)
-        {
-            line = 0;
-            fprintf(stdout,"Press return to continue, q to quit\n");
-            ret = fgetc(stdin);
-            if (ret == 'q')
-            {
-                exit(0);
-            }
-        }
-    }
-
-    return;
-}
diff --git a/src/gsf/gsf.c b/src/gsf/gsf.c
deleted file mode 100644
index ca8ac99..0000000
--- a/src/gsf/gsf.c
+++ /dev/null
@@ -1,9450 +0,0 @@
-/********************************************************************
- *
- * Module Name : GSF
- *
- * Author/Date : J. S. Byrne / 3 May 1994
- *
- * Description : This source file contains the gsf library entry point
- *  functions for accessesing multibeam sonar data in a generic byte stream
- *  format.  Each record in these binary files contains an ID and a size,
- *  and these two values are used to read and decode the rest of the data
- *  record.  Data records are read/written one at a time, in a sequential
- *  manner.  Refer to the DoDBL Generic Sensor format design documentation
- *  for a more detailed verbal description of the data format.
- *
- * Restrictions/Limitations :
- * 1) This library assumes the host computer uses the ASCII character set.
- * 2) This library assumes that the type short is 16 bits, and that the type
- *    int is 32 bits.
- *
- * Change Descriptions :
- * who  when      what
- * ---  ----      ----
- * jsb  10-25-94  Added gsfOpenBuffered function call, and call to setvbuf
- *                in gsfOpen to deal with high data rate multibeam data.
- * jsb  08-14-95  Direct and sequential access now work through common
- *                gsfRead and gsfWrite API. All pointers to dynamically
- *                allocated memory are now maintained by the library.
- *                Call this version "GSF-v01.01".
- * jsb  11/01/95  Completed modifications to indexing to support increase in
- *                gsf file size after initial index file creation.  The size
- *                of the file is now stored in the index file header. Index
- *                files without the expected header are recreated on the first
- *                open. This is still version GSF-v01.01. Also added a unique
- *                sensor specific subrecord for Simrad em1000.
- * jsb  12/22/95  Added gsfGetMBParams, gsfPutMBParams, gsfIsStarboardPing,
- *                and gsfGetSwathBathyBeamWidths. Also added GSF_APPEND as
- *                a file access mode, and modifed GSF_CREATE access mode so
- *                that files can be updated (read and written). This is gsf
- *                library version GSF-v01.02.
- * fd   04/15/96  Corrected the internals of gsfIsStarboardPing
- * hem  08/20/96  Added support for single beam pings; added gsfStringError;
- *                fixed 4 byte boundary padding.  This is gsf library
- *                version GSF-v1.03.
- * jsb  10/04/96  Changed fopen argument from "wb" to "a+b" for the GSF_APPEND
- *                access mode.  Also added logic to set file pointer to top prior
- *                to trying to read the gsf header record in gsfOpen/gsfOpenBuffered
- *                when the file access mode is GSF_APPEND.  Replaced use of
- *                numOpenFiles with *handle as argument to gsfRead and gsfWrite
- *                within gsfOpen and gsfOpenBuffered.  This repairs problems which
- *                can occur when a single application is accessing multiple files.
- * jsb  04/18/97  Added gsf version dependancy on approach to padding records out
- *                to four byte boundary. This is required in order to support the
- *                update access modes for versions prior to 1.03.  Replaced use of
- *                fgetpos, fsetpos with ftell, fseek.  This was done so that we can
- *                compair the previous_record field of the file table with addresses
- *                from an index file. Modified gsfStringError so that there is a single
- *                return statement, this was done to eliminate "statement not reached"
- *                compile warnings.
- * bac  10/27/97  Added a case in gsfGetSwathBathyBeamWidths for the Sea Beam 2112/36.
- * dwc 1/9/98     Added a case in gsfGetSwathBathyBeamWidths for the Elac Bottomchart MkII.
- * bac  03/15/98  Added an array subrecord for signal to noise ratio.
- * bac  03/15/98  Added an array subrecord for beam angle forward.
- * jsb  09/28/98  Added support for new navigation error record. Modified gsfPrintError
- *                 to use gsfStringError.
- * wkm  04/01/99  Added case for CmpSass (Compressed SASS) data to set beam widths to 1.0.
- * jsb  04/02/99  Added support for EM3000 series sonar systems.
- * jsb  07/20/99  Completed work on GSF version 1.08.  Added new functions gsfGetSwathBathyArrayMinMax,
- *                and gsfLoadDepthScaleFactorAutoOffset in support of signed depth.
- *                This release addresses the following CRs: GSF-99-002, GSF-99-006, GSF-99-007,
- *                GSF-99-008, GSF-99-009, GSF-99-010, GSF-99-011, GSF-99-012,
- * jsb  04/05/00  Updated so that an application can work with up to GSF_MAX_OPEN_FILES at
- *                a time.  Prior to these updates an application could only open (GSF_MAX_OPEN_FILES-1)
- *                files at a time. Also updated gsfOpen and gsfOpenBuffered to return the correct
- *                error code if a failure occures reading the file header.
- * bac 07-18-01   Made modifications for use with C++ code.  The typedef for each sensor
- *                specific structure has been modified to have a different name than the
- *                element of the SensorSpecific union.  Also removed the useage of C++
- *                reserved words "class" and "operator".  These modifications will potentially
- *                require some changes to application code. Added support for the Reson 8100 series of sonars.
- * bac 10-12-01   Added a new attitude record definition.  The attitude record provides a method for
- *                logging full time-series attitude measurements in the GSF file, instead of attitude
- *                samples only at ping time.  Each attitude record contains arrays of attitude
- *                measurements for time, roll, pitch, heave and heading.  The number of measurements
- *                is user-definable, but because of the way in which measurement times are stored, a
- *                single attitude record should never contain more than sixty seconds worth of
- *                data.
- * bac 11-09-01   Added motion sensor offsets to the gsfMBOffsets structure.  Added support for these
- *                new offsets in the gsfPutMBParams and gsfGetMBParams functions, so these offsets are
- *                encoded in the process_parameters record.
- * jsb 01-21-02   If the fread doesn't complete, rewind the file to the beginning of the current
- *                record, set gsfError to END_OF_FILE, and return -1.  Removed variables that were
- *                not used, fixed return code and gsfError for default case block in gsfGetBeamWidths,
- *                and update strncpy in gsfSetParam and gsfCopyRecords to ensure that the terminating
- *                NULL is copied to the target pointer.
- * bac 06-19-03   Added support for bathymetric receive beam time series intensity data (i.e., Simrad
- *                "Seabed image" and Reson "snippets").  Inlcluded RWL updates of 12-19-02 for adding
- *                sensor-specific singlebeam information to the MB sensor specific subrecords.
- * bac 12-28-04   Added support for EM3000D, EM3002, and EM3002D in gsfGetSwathBathyBeamWidths.  Updated
- *                gsfLoadDepthScaleFactorAutoOffset to vary the offset interval based on precision.
- *                Updated gsfFree to free and set to NULL the quality_flags, vertical_error, horizontal_error,
- *                and brb_inten arrays.  Added vertical_error and horizontal_error processing to gsfCopyRecords.
- * bac 06-28-06   Updated gsfIsStarboardPing to work with EM3000D and EM3002D.  Updated gsfCopyRecords
- *                to copy the hv_nav_error record.  Added  for EM121A data received via Kongsberg SIS.
- *                Replaced references to long types with int types, for compilation on 64-bit architectures.
- * jsb 11-06-07   Updates to utilize the subrecord size in termining the field size for the array subrecords
- *                that support more than one field size.  Also replaced use of strstr with strcmp in gsfGetMBParams
- *                to resolve potential problem where one keyword name may be fully contained in another.
- * DHG 2008/12/18 Add "PLATFORM_TYPE" to Processing Parameters for AUV vs Surface Ship discrimination.
- * mab 02-01-09   Updates to support Reson 7125. Added new subrecord IDs and subrecord definitions for Kongsberg
- *                sonar systems where TWTT and angle are populated from raw range and beam angle datagram. Added
- *                new subrecord definition for EM2000.  Bug fixes in gsfOpen and gsfPercent.
- * clb 05-17-11   Added depth sensor and receiver array offsets to the gsfGetMBParams() and gsfPutMBParams()
- * clb 10-04-11   Added check in gsfUnpackStream() for a partial record at the end of the file
- * clb 10-17-11   Handle all the error processing in gsfOpen() and gsfOpenBuffered() consistently
- * clb 11-09-aa   Added validity checks in gsfPutMBParams(); initialize param structure in gsfGetMBParams();
- *                added gsfInitializeMBParams(); validate handles in functions that use them
- *
- *
- * Classification : Unclassified
- *
- * References : DoDBL Generic Sensor Format Sept. 30, 1993
- *
- *
- * copyright 2014 Leidos, Inc.
- * There is no charge to use the library, and it may be accessed at:
- * https://www.leidos.com/maritime/gsf.
- * This library may be redistributed and/or modified under the terms of
- * the GNU Lesser General Public License version 2.1, as published by the
- * Free Software Foundation.  A copy of the LGPL 2.1 license is included with
- * the GSF distribution and is avaialbe at: http://opensource.org/licenses/LGPL-2.1.
- *
- * Leidos, Inc. configuration manages GSF, and provides GSF releases. Users are
- * strongly encouraged to communicate change requests and change proposals to Leidos, Inc.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE.
- *
- ********************************************************************/
-
-/* standard c library includes */
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <limits.h>
-#include <errno.h>
-#include <math.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-
-/* rely on the network type definitions of (u_short, and u_int) */
-#if !defined WIN32 && !defined WIN64
-#include <netinet/in.h>
-#else
-#include <winsock.h>
-#endif
-
-/* gsf library interface description */
-#include "gsf.h"
-
-/* get the prototypes for the gsf encode and gsf decode functions */
-#include "gsf_ft.h"
-#include "gsf_enc.h"
-#include "gsf_dec.h"
-#include "gsf_indx.h"
-
-/* Macros required for this module */
-#ifndef USE_DEFAULT_FILE_FUNCTIONS
-
-#undef fseek
-#undef ftell
-#if (defined _WIN32) && (defined _MSC_VER)
-#define fseek(x, y, z) _fseeki64((x), (y), (z))
-#define ftell(x)   _ftelli64((x))
-#else  // Linux, MingW, MacOS
-#undef fopen
-#define fopen(x, y)  fopen64((x), (y))
-#define fseek(x, y, z) fseeko64((x), (y), (z))
-#define ftell(x)   ftello64((x))
-#endif
-
-#endif
-
-#define GSF_FILL_SIZE 8                   /* gsf packaging with no checksum */
-#define GSF_FILL_SIZE_CHECKSUM 12         /* gsf packaging with checksum */
-#define GSF_STREAM_BUF_SIZE 8192          /* gsf default stream buffer size */
-#define GSF_UNKNOWN_PARAM_TEXT "UNKNWN"   /* Flag value for unknown parameter value */
-
-#define GSF_MAX_PARAM    999999          /* used in gsfPutMBParams() to prevent bad values */
-#define GSF_MIN_PARAM   -999999
-
-/* JSB 07/15/99 Added these macros to support new gsfGetSwathBathyArrayMinMax function */
-#define GSF_U_CHAR_MIN            (0.0)
-#define GSF_U_CHAR_MAX          (255.0)
-#define GSF_S_CHAR_MIN         (-128.0)
-#define GSF_S_CHAR_MAX         (+127.0)
-#define GSF_U_SHORT_MIN           (0.0)
-#define GSF_U_SHORT_MAX       (65535.0)
-#define GSF_S_SHORT_MIN      (-32768.0)
-#define GSF_S_SHORT_MAX       (32767.0)
-#define GSF_U_INT_MIN             (0.0)
-#define GSF_U_INT_MAX    (4294967295.0)
-#define GSF_S_INT_MIN   (-2147483648.0)
-#define GSF_S_INT_MAX    (2147483647.0)
-
-/* Static Global data for this module */
-static unsigned char streamBuff[GSF_MAX_RECORD_SIZE];
-static int      numOpenFiles;
-static GSF_FILE_TABLE gsfFileTable[GSF_MAX_OPEN_FILES];
-
-/* Global external data defined in this module */
-int             gsfError;       /* used to report most recent error */
-
-/* Static functions used, but not exported from this source file */
-static gsfuLong gsfChecksum(unsigned char *buff, unsigned int num_bytes);
-static int      gsfSeekRecord(int handle, gsfDataID *id);
-static int      gsfUnpackStream (int handle, int desiredRecord, gsfDataID *dataID, gsfRecords *rptr, unsigned char *buf, int max_size);
-static int      gsfSetParam(int handle, int index, char *val, gsfRecords *rec);
-static int      gsfNumberParams(char *param);
-
-
-/********************************************************************
- *
- * Function Name : gsfStat
- *
- * Description : This function attempts to stat a GSF file.
- *               Supports 64 bit file size.
- *
- * Inputs :
- *  filename = a fully qualified path to the gsf file
- *  sz       = pointer to an 8 byte long long for return
- *             of the GSF file size from the stat64 system call.
- *
- * Returns :
- *  This funciton returns zero if successful, or -1 if an error occured.
- *
- * Error Conditions :
- *     GSF_FOPEN_ERROR
- *     GSF_UNRECOGNIZED_FILE
- *
- ********************************************************************/
-int
-gsfStat (const char *filename, long long *sz)
-{
-    int rc;
-
-    gsfError = 0;
-
-    if (sz == NULL)
-    {
-        gsfError = GSF_FOPEN_ERROR;
-        return -1;
-    }
-
-#ifdef USE_DEFAULT_FILE_FUNCTIONS
-    struct stat stbuf;
-    rc = stat(filename, &stbuf);
-#else
-#if defined(__WINDOWS__) || defined(__MINGW32__)
-    struct _stati64    stbuf;
-    rc = _stati64(filename, &stbuf);
-#else
-    struct stat64      stbuf;
-    rc = stat64(filename, &stbuf);
-#endif
-#endif
-
-    if (!rc)
-    {
-        *sz = stbuf.st_size;
-    }
-    else
-    {
-        gsfError = GSF_UNRECOGNIZED_FILE;
-    }
-
-    return rc;
-}
-
-
-/********************************************************************
- *
- * Function Name : gsfOpen
- *
- * Description : This function attempts to open a gsf data file.  If the
- *  file exits and is opened readonly or update the gsf header is read
- *  to confirm that this is a gsf data file.  If the file is opened create,
- *  the GSF header containing the version number of the software library is
- *  written into the header.  This function passes an integer handle back to
- *  the calling application.  The handle is used for all further access to the
- *  file. gsfOpen explicitly sets stream bufferring to the value specified
- *  by GSF_STREAM_BUF_SIZE.  The internal file table is searched for an
- *  available entry whose name matches that specified in the argument list, if
- *  no match is found, then the first available entry is used.  Up to
- *  GSF_MAX_OPEN_FILES files may be open by an application at a time.
- *
- * Inputs :
- *  filename = a fully qualified path to the gsf file to open
- *  mode may have the following values:
- *     GSF_READONLY = open an existing file for read only access
- *     GSF_UPDATE   = open an existing file for reading an writing
- *     GSF_CREATE   = create a new gsf file
- *     GSF_READONLY_INDEX = open an existing file for read only access with index
- *     GSF_UPDATE_INDEX   = open an existing file for reading an writing with index
- *  handle = a pointer to an integer to be assigned a handle which will be
- *     reference for all future file access.
- *
- * Returns :
- *  This funciton returns zero if successful, or -1 if an error occured.
- *
- * Error Conditions :
- *     GSF_BAD_ACCESS_MODE
- *     GSF_TOO_MANY_OPEN_FILES
- *     GSF_FOPEN_ERROR
- *     GSF_SETVBUF_ERROR
- *     GSF_UNRECOGNIZED_FILE
- *
- ********************************************************************/
-int
-gsfOpen(const char *filename, const int mode, int *handle)
-{
-  char           *access_mode;
-  int             fileTableIndex;
-  int             length;
-  int             headerSize;
-  int             ret;
-  gsfDataID       id;
-  long long       stsize;
-  FILE           *fp;
-
-  /* Clear the gsfError value each time a new file is opened */
-  gsfError = 0;
-  /* Make sure we don't inadvertently send a valid handle back */
-  *handle = 0;
-
-  /* get the desired file access mode */
-  switch (mode)
-  {
-    case GSF_CREATE:
-      access_mode = "w+b";
-      break;
-
-    case GSF_READONLY:
-      access_mode = "rb";
-      break;
-
-    case GSF_UPDATE:
-      access_mode = "r+b";
-      break;
-
-    case GSF_READONLY_INDEX:
-      access_mode = "rb";
-      break;
-
-    case GSF_UPDATE_INDEX:
-      access_mode = "r+b";
-      break;
-
-    case GSF_APPEND:
-      access_mode = "a+b";
-      break;
-
-    default:
-      gsfError = GSF_BAD_ACCESS_MODE;
-      return(-1);
-  }
-
-  /* check the number of files currently openned */
-  if (numOpenFiles >= GSF_MAX_OPEN_FILES)
-  {
-    gsfError = GSF_TOO_MANY_OPEN_FILES;
-    return(-1);
-  }
-
-  /* Try to open this file */
-  if ((fp = fopen(filename, access_mode)) == (FILE *) NULL)
-  {
-    gsfError = GSF_FOPEN_ERROR;
-    return(-1);
-  }
-
-    /* The file was successfully opened, load the gsf file table structure by
-  * searching the gsf file table for the caller's filename.  This is done
-  * so that the same file table slot may be re-used.  Applications which
-  * want their file closed frequently, such as real-time data collection
-  * programs may do this to assure data integrity, and it makes sense
-  * to resuse the file table slot they occupied from a previous call to
-  * gsfOpen, so that the ping scale factors don't have to be reset except
-  * when a new file is created.
-    */
-  numOpenFiles++;
-  length = strlen (filename);
-  if (length >= sizeof(gsfFileTable[0].file_name))
-  {
-    length = sizeof(gsfFileTable[0].file_name) - 1;
-  }
-  for (fileTableIndex=0; fileTableIndex<GSF_MAX_OPEN_FILES; fileTableIndex++)
-  {
-    if ((memcmp(gsfFileTable[fileTableIndex].file_name, filename, length) == 0) &&
-         (gsfFileTable[fileTableIndex].occupied == 0))
-    {
-      break;
-    }
-  }
-
-  /* If no filename match was found then use the first available slot */
-  if (fileTableIndex == GSF_MAX_OPEN_FILES)
-  {
-    for (fileTableIndex=0; fileTableIndex<GSF_MAX_OPEN_FILES; fileTableIndex++)
-    {
-      if (gsfFileTable[fileTableIndex].occupied == 0)
-      {
-        strncpy (gsfFileTable[fileTableIndex].file_name, filename, sizeof(gsfFileTable[fileTableIndex].file_name));
-                /* This is the first open for this file, so clear the
-        * pointers to dynamic memory.
-                */
-        gsfFree (&gsfFileTable[fileTableIndex].rec);
-        break;
-      }
-    }
-  }
-
-  gsfFileTable[fileTableIndex].fp = fp;
-  gsfFileTable[fileTableIndex].buf_size = GSF_STREAM_BUF_SIZE;
-  gsfFileTable[fileTableIndex].occupied = 1;
-  *handle = fileTableIndex + 1;
-
-  /* Set the desired buffer size */
-  if (setvbuf(fp, NULL, _IOFBF, GSF_STREAM_BUF_SIZE))
-  {
-    gsfError = GSF_SETVBUF_ERROR;
-    gsfClose ((int) *handle);
-    *handle = 0;
-    return(-1);
-  }
-
-  /* Use stat to get the size of this file. File size is used by gsfPercent */
-  if (gsfStat (filename, &stsize))
-  {
-    gsfError = GSF_READ_ERROR;
-    gsfClose ((int) *handle);
-    *handle = 0;
-    return(-1);
-  }
-  gsfFileTable[fileTableIndex].file_size = stsize;
-
-    /* If this file was just created, (ie it has a size of 0 bytes) then
-  * write the gsf file header record. Also, set a flag to indicate
-  * that the ping scale factors need to be written with the next swath
-  * bathymetry ping record.
-    */
-  if (stsize == 0)
-  {
-    gsfFileTable[fileTableIndex].scales_read = 1;
-
-    /* write the gsf file header to the file */
-    id.checksumFlag = 0;
-    id.reserved = 0;
-    id.recordID = GSF_RECORD_HEADER;
-    strncpy(gsfFileTable[fileTableIndex].rec.header.version, GSF_VERSION, GSF_VERSION_SIZE-1);
-    gsfFileTable[fileTableIndex].rec.header.version[GSF_VERSION_SIZE] = 0;
-    gsfFileTable[fileTableIndex].bufferedBytes += gsfWrite(*handle, &id, &gsfFileTable[fileTableIndex].rec);
-
-        /* Flush this record to disk so that the file size will be non-zero
-    * on the next call to gsfOpen.
-        */
-    if (fflush (gsfFileTable[fileTableIndex].fp))
-    {
-      gsfError = GSF_FLUSH_ERROR;
-      gsfClose ((int) *handle);
-      *handle = 0;
-      return(-1);
-    }
-  }
-  else
-  {
-        /* Read the GSF header, if the access mode is append, we need to
-    * seek back to the top of the file.
-        */
-    if (mode == GSF_APPEND)
-    {
-      if (fseek(gsfFileTable[fileTableIndex].fp, 0, SEEK_SET))
-      {
-        gsfError = GSF_FILE_SEEK_ERROR;
-        gsfClose ((int) *handle);
-        *handle = 0;
-        return(-1);
-      }
-    }
-    /* Read the GSF header */
-    headerSize = gsfRead(*handle, GSF_NEXT_RECORD, &id, &gsfFileTable[fileTableIndex].rec, NULL, 0);
-    /* JSB 04/05/00 Updated to return correct error code */
-    if (headerSize < 0)
-    {
-      gsfError = GSF_HEADER_RECORD_DECODE_FAILED;
-      gsfClose (*handle);
-      *handle = 0;
-      return(-1);
-    }
-    /* JSB end of updates from 04/055/00 */
-    if (!strstr(gsfFileTable[fileTableIndex].rec.header.version, "GSF-"))
-    {
-      gsfError = GSF_UNRECOGNIZED_FILE;
-      gsfClose (*handle);
-      *handle = 0;
-      return(-1);
-    }
-    /* If the mode is append seek back to the end of the file */
-    if (mode == GSF_APPEND)
-    {
-      if (fseek(gsfFileTable[fileTableIndex].fp, 0, SEEK_END))
-      {
-        gsfError = GSF_FILE_SEEK_ERROR;
-        gsfClose ((int) *handle);
-        *handle = 0;
-        return(-1);
-      }
-    }
-  }
-
-  /* jsb 04/16/97 Save the GSF version ID into the file table */
-  ret = sscanf (gsfFileTable[fileTableIndex].rec.header.version, "GSF-v%d.%d",
-                &gsfFileTable[fileTableIndex].major_version_number,
-                &gsfFileTable[fileTableIndex].minor_version_number);
-  if (ret != 2)
-  {
-    gsfError = GSF_UNRECOGNIZED_FILE;
-    gsfClose ((int) *handle);
-    *handle = 0;
-    return(-1);
-  }
-
-    /*  Set the update flag if needed. This is used to force a call to fflush
-  *  between read an write operations, on files opened for update.
-    */
-  if ((mode == GSF_UPDATE) ||
-       (mode == GSF_UPDATE_INDEX) ||
-       (mode == GSF_CREATE))
-  {
-    gsfFileTable[fileTableIndex].update_flag = 1;
-  }
-  else
-  {
-    gsfFileTable[fileTableIndex].update_flag = 0;
-  }
-
-  /* Set the index flag and open the index file if needed. */
-  if ((mode == GSF_READONLY_INDEX) || (mode == GSF_UPDATE_INDEX))
-  {
-    gsfFileTable[fileTableIndex].direct_access = 1;
-    if (gsfOpenIndex (filename, *handle, &gsfFileTable[fileTableIndex]) == -1)
-    {
-      gsfFileTable[fileTableIndex].direct_access = 0;
-      gsfError = GSF_INDEX_FILE_OPEN_ERROR;
-      gsfClose ((int) *handle);
-      *handle = 0;
-      return(-1);
-    }
-
-        /* Move the file pointer back to the first record past the gsf file header. This
-    * is required since we will have read the entire to create the index.
-        */
-    if (fseek(gsfFileTable[fileTableIndex].fp, headerSize, SEEK_SET))
-    {
-      gsfError = GSF_FILE_SEEK_ERROR;
-      gsfClose ((int) *handle);
-      *handle = 0;
-      return(-1);
-    }
-  }
-  else
-  {
-    gsfFileTable[fileTableIndex].direct_access = 0;
-  }
-
-  /* Save the file acess mode */
-  switch (mode)
-  {
-    case GSF_CREATE:
-      gsfFileTable[fileTableIndex].access_mode = GSF_CREATE;
-      break;
-
-    case GSF_READONLY:
-      gsfFileTable[fileTableIndex].access_mode = GSF_READONLY;
-      break;
-
-    case GSF_UPDATE:
-      gsfFileTable[fileTableIndex].access_mode = GSF_UPDATE;
-      break;
-
-    case GSF_READONLY_INDEX:
-      gsfFileTable[fileTableIndex].access_mode = GSF_READONLY_INDEX;
-      break;
-
-    case GSF_UPDATE_INDEX:
-      gsfFileTable[fileTableIndex].access_mode = GSF_UPDATE_INDEX;
-      break;
-
-    case GSF_APPEND:
-      gsfFileTable[fileTableIndex].access_mode = GSF_APPEND;
-      break;
-
-    default:
-      gsfError = GSF_BAD_ACCESS_MODE;
-      gsfClose ((int) *handle);
-      *handle = 0;
-      return(-1);
-  }
-
-  return (0);
-}
-
-/********************************************************************
- *
- * Function Name : gsfOpenBuffered
- *
- * Description : This function attempts to open a gsf data file.  If the
- *  file exits and is opened readonly or update the gsf header is read
- *  to confirm that this is a gsf data file.  If the file is opened create,
- *  the GSF header containing the version number of the software library is
- *  written into the header.  This function passes an integer handle back to
- *  the calling application.  The handle is used for all further access to the
- *  file. gsfOpenBufferd explicitly sets stream bufferring to the value
- *  specified by the buf_size argument. The internal file table is searched
- *  for an available entry whose name matches that specified in the argument
- *  list, if no match is found, then the first available entry is used.  Up
- *  to GSF_MAX_OPEN_FILES files may be open by an application at a time.
- *  gsfOpenBuffered performs identical processing to gsfOpen, except here,
- *  the caller is allowed to explicitly set the standard system library level
- *  I/O buffer size.
- *
- * Inputs :
- *  filename = a fully qualified path to the gsf file to open
- *  mode may have the following values:
- *     GSF_READONLY = open an existing file for read only access
- *     GSF_UPDATE   = open an existing file for reading an writing
- *     GSF_CREATE   = create a new gsf file
- *     GSF_READONLY_INDEX = open an existing file for read only access with index
- *     GSF_UPDATE_INDEX   = open an existing file for reading an writing with index
- *  handle = a pointer to an integer to be assigned a handle which will be
- *     reference for all future file access.
- *  buf_size = an integer buffer size in bytes.
- *
- * Returns :
- *  This funciton returns zero if successful, or -1 if an error occured.
- *
- * Error Conditions :
- *     GSF_BAD_ACCESS_MODE
- *     GSF_TOO_MANY_OPEN_FILES
- *     GSF_FOPEN_ERROR
- *     GSF_SETVBUF_ERROR
- *     GSF_UNRECOGNIZED_FILE
- *
- ********************************************************************/
-int
-gsfOpenBuffered(const char *filename, const int mode, int *handle, int buf_size)
-{
-    char           *access_mode;
-    int             fileTableIndex;
-    int             length;
-    int             headerSize;
-    int             ret;
-    long long       stsize;
-    gsfDataID       id;
-    FILE           *fp;
-
-    /* Clear the gsfError value each time a new file is opened */
-    gsfError = 0;
-    /* Make sure we don't inadvertently send a valid handle back */
-    *handle = 0;
-
-    /* get the desired file access mode */
-    switch (mode)
-    {
-        case GSF_CREATE:
-            access_mode = "w+b";
-            break;
-
-        case GSF_READONLY:
-            access_mode = "rb";
-            break;
-
-        case GSF_UPDATE:
-            access_mode = "r+b";
-            break;
-
-        case GSF_READONLY_INDEX:
-            access_mode = "rb";
-            break;
-
-        case GSF_UPDATE_INDEX:
-            access_mode = "r+b";
-            break;
-
-        case GSF_APPEND:
-            access_mode = "a+b";
-            break;
-
-        default:
-            gsfError = GSF_BAD_ACCESS_MODE;
-            return (-1);
-    }
-
-    /* check the number of files currently openned */
-    if (numOpenFiles >= GSF_MAX_OPEN_FILES)
-    {
-        gsfError = GSF_TOO_MANY_OPEN_FILES;
-        return (-1);
-    }
-
-    /* Try to open this file */
-    if ((fp = fopen(filename, access_mode)) == (FILE *) NULL)
-    {
-        gsfError = GSF_FOPEN_ERROR;
-        return (-1);
-    }
-
-    /* The file was successfully opened, load the gsf file table structure by
-     * searching the gsf file table for the caller's filename.  This is done
-     * so that the same file table slot may be re-used.  Applications which
-     * want their file closed frequently, such as real-time data collection
-     * programs may do this to assure data integrity, and it makes sense
-     * to resuse the file table slot they occupied from a previous call to
-     * gsfOpen, so that the ping scale factors don't have to be reset except
-     * when a new file is created.
-     */
-    numOpenFiles++;
-    length = strlen (filename);
-    if (length >= sizeof(gsfFileTable[0].file_name))
-    {
-        length = sizeof(gsfFileTable[0].file_name) - 1;
-    }
-    for (fileTableIndex=0; fileTableIndex<GSF_MAX_OPEN_FILES; fileTableIndex++)
-    {
-        if ((memcmp(gsfFileTable[fileTableIndex].file_name, filename, length) == 0) &&
-            (gsfFileTable[fileTableIndex].occupied == 0))
-        {
-            break;
-        }
-    }
-
-    /* If no filename match was found then use the first available slot */
-    if (fileTableIndex == GSF_MAX_OPEN_FILES)
-    {
-        for (fileTableIndex=0; fileTableIndex<GSF_MAX_OPEN_FILES; fileTableIndex++)
-        {
-            if (gsfFileTable[fileTableIndex].occupied == 0)
-            {
-                strncpy (gsfFileTable[fileTableIndex].file_name, filename, sizeof(gsfFileTable[fileTableIndex].file_name));
-                /* This is the first open for this file, so clear the
-                 * pointers to dynamic memory.
-                 */
-                gsfFree (&gsfFileTable[fileTableIndex].rec);
-                break;
-            }
-        }
-    }
-
-    gsfFileTable[fileTableIndex].fp = fp;
-    gsfFileTable[fileTableIndex].buf_size = buf_size;
-    gsfFileTable[fileTableIndex].occupied = 1;
-    *handle = fileTableIndex + 1;
-
-    /* Set the desired buffer size */
-    if (setvbuf(fp, NULL, _IOFBF, buf_size))
-    {
-        gsfClose ((int) *handle);
-        gsfError = GSF_SETVBUF_ERROR;
-        *handle = 0;
-        return (-1);
-    }
-
-    /* Use stat to get the size of this file. File size is used by gsfPercent */
-    if (gsfStat (filename, &stsize))
-    {
-        gsfError = GSF_READ_ERROR;
-        gsfClose (*handle);
-        *handle = 0;
-        return(-1);
-    }
-    gsfFileTable[fileTableIndex].file_size = stsize;
-
-    /* If this file was just created, (ie it has a size of 0 bytes) then
-     * write the gsf file header record. Also, set a flag to indicate
-     * that the ping scale factors need to be written with the next swath
-     * bathymetry ping record.
-     */
-    if (stsize == 0)
-    {
-        gsfFileTable[fileTableIndex].scales_read = 1;
-
-        /* write the gsf file header to the file */
-        id.checksumFlag = 0;
-        id.reserved = 0;
-        id.recordID = GSF_RECORD_HEADER;
-        strncpy(gsfFileTable[fileTableIndex].rec.header.version, GSF_VERSION, GSF_VERSION_SIZE-1);
-        gsfFileTable[fileTableIndex].rec.header.version[GSF_VERSION_SIZE] = 0;
-        gsfFileTable[fileTableIndex].bufferedBytes += gsfWrite(*handle, &id, &gsfFileTable[fileTableIndex].rec);
-
-        /* Flush this record to disk so that the file size will be non-zero
-         * on the next call to gsfOpen.
-         */
-        if (fflush (gsfFileTable[fileTableIndex].fp))
-        {
-            gsfError = GSF_FLUSH_ERROR;
-            gsfClose (*handle);
-            *handle = 0;
-            return(-1);
-        }
-    }
-    else
-    {
-        /* Read the GSF header, if the access mode is append, we need to
-         * seek back to the top of the file.
-         */
-        if (mode == GSF_APPEND)
-        {
-            if (fseek(gsfFileTable[fileTableIndex].fp, 0, SEEK_SET))
-            {
-                gsfError = GSF_FILE_SEEK_ERROR;
-                gsfClose (*handle);
-                *handle = 0;
-                return (-1);
-            }
-        }
-        /* Read the GSF header */
-        headerSize = gsfRead(*handle, GSF_NEXT_RECORD, &id, &gsfFileTable[fileTableIndex].rec, NULL, 0);
-        /* JSB 04/05/00 Updated to return correct error code */
-        if (headerSize < 0)
-        {
-            gsfError = GSF_HEADER_RECORD_DECODE_FAILED;
-            gsfClose (*handle);
-            *handle = 0;
-            return (-1);
-        }
-        /* JSB end of updates from 04/055/00 */
-        if (!strstr(gsfFileTable[fileTableIndex].rec.header.version, "GSF-"))
-        {
-            gsfError = GSF_UNRECOGNIZED_FILE;
-            gsfClose (*handle);
-            *handle = 0;
-            return (-1);
-        }
-        /* If the mode is append seek back to the end of the file */
-        if (mode == GSF_APPEND)
-        {
-            if (fseek(gsfFileTable[fileTableIndex].fp, 0, SEEK_END))
-            {
-                gsfError = GSF_FILE_SEEK_ERROR;
-                gsfClose (*handle);
-                *handle = 0;
-                return (-1);
-            }
-        }
-    }
-
-    /* jsb 04/16/97 Save the GSF version ID into the file table */
-    ret = sscanf (gsfFileTable[fileTableIndex].rec.header.version, "GSF-v%d.%d",
-        &gsfFileTable[fileTableIndex].major_version_number,
-        &gsfFileTable[fileTableIndex].minor_version_number);
-    if (ret != 2)
-    {
-        gsfError = GSF_UNRECOGNIZED_FILE;
-        gsfClose (*handle);
-        *handle = 0;
-        return (-1);
-    }
-
-    /*  Set the update flag if needed. This is used to force a call to fflush
-     *  between read an write operations, on files opened for update.
-     */
-    if ((mode == GSF_UPDATE) ||
-        (mode == GSF_UPDATE_INDEX) ||
-        (mode == GSF_CREATE))
-    {
-        gsfFileTable[fileTableIndex].update_flag = 1;
-    }
-    else
-    {
-        gsfFileTable[fileTableIndex].update_flag = 0;
-    }
-
-    /* Set the index flag and open the index file if needed. */
-    if ((mode == GSF_READONLY_INDEX) || (mode == GSF_UPDATE_INDEX))
-    {
-        gsfFileTable[fileTableIndex].direct_access = 1;
-        if (gsfOpenIndex (filename, *handle, &gsfFileTable[fileTableIndex]) == -1)
-        {
-            gsfFileTable[fileTableIndex].direct_access = 0;
-            gsfError = GSF_INDEX_FILE_OPEN_ERROR;
-            gsfClose (*handle);
-            *handle = 0;
-            return (-1);
-        }
-
-        /* Move the file pointer back to the first record past the gsf file header. This
-         * is required since we will have read the entire to create the index.
-         */
-        if (fseek(gsfFileTable[fileTableIndex].fp, headerSize, SEEK_SET))
-        {
-            gsfError = GSF_FILE_SEEK_ERROR;
-            gsfClose (*handle);
-            *handle = 0;
-            return (-1);
-        }
-    }
-    else
-    {
-        gsfFileTable[fileTableIndex].direct_access = 0;
-    }
-
-    /* Save the file acess mode */
-    switch (mode)
-    {
-        case GSF_CREATE:
-            gsfFileTable[fileTableIndex].access_mode = GSF_CREATE;
-            break;
-
-        case GSF_READONLY:
-            gsfFileTable[fileTableIndex].access_mode = GSF_READONLY;
-            break;
-
-        case GSF_UPDATE:
-            gsfFileTable[fileTableIndex].access_mode = GSF_UPDATE;
-            break;
-
-        case GSF_READONLY_INDEX:
-            gsfFileTable[fileTableIndex].access_mode = GSF_READONLY_INDEX;
-            break;
-
-        case GSF_UPDATE_INDEX:
-            gsfFileTable[fileTableIndex].access_mode = GSF_UPDATE_INDEX;
-            break;
-
-        case GSF_APPEND:
-            gsfFileTable[fileTableIndex].access_mode = GSF_APPEND;
-            break;
-
-        default:
-            gsfError = GSF_BAD_ACCESS_MODE;
-            gsfClose (*handle);
-            *handle = 0;
-            return (-1);
-    }
-
-    return (0);
-}
-
-/********************************************************************
- *
- * Function Name : gsfClose
- *
- * Description : This function closes a gsf file previously openned
- *  using gsfOpen.
- *
- * Inputs :
- *  handle = the handle of the gsf file to be closed.
- *
- * Returns :
- *  This function returns zero if successful, or -1 if an error occured.
- *
- * Error Conditions :
- *    GSF_BAD_FILE_HANDLE
- *    GSF_FILE_CLOSE_ERROR
- *
- ********************************************************************/
-
-int
-gsfClose(const int handle)
-{
-    /* JSB 04/05/00 replaced ">=" with ">" */
-    if ((handle < 1) || (handle > GSF_MAX_OPEN_FILES))
-    {
-        gsfError = GSF_BAD_FILE_HANDLE;
-        return (-1);
-    }
-
-    if (gsfFileTable[handle -1].direct_access)
-    {
-        gsfCloseIndex (&gsfFileTable[handle - 1]);
-    }
-
-    if (fclose(gsfFileTable[handle - 1].fp))
-    {
-        gsfError = GSF_FILE_CLOSE_ERROR;
-        return (-1);
-    }
-
-    numOpenFiles--;
-
-    /* jsb 05/14/97 Clear the contents of the gsfFileTable fields. We don't
-     * want to clear the filename, this allows a performance improvement for
-     * programs which use append to log gsf files. (ie: data acquisition)
-     */
-    gsfFileTable[handle-1].major_version_number = 0;
-    gsfFileTable[handle-1].minor_version_number = 0;
-    gsfFileTable[handle-1].file_size = 0;
-    gsfFileTable[handle-1].previous_record = 0;
-    gsfFileTable[handle-1].buf_size = 0;
-    gsfFileTable[handle-1].bufferedBytes = 0;
-    gsfFileTable[handle-1].occupied = 0;
-    gsfFileTable[handle-1].update_flag = 0;
-    gsfFileTable[handle-1].direct_access = 0;
-    gsfFileTable[handle-1].read_write_flag = 0;
-    gsfFileTable[handle-1].scales_read = 0;
-    gsfFileTable[handle-1].access_mode = 0;
-
-    /* clear the contents of the index data table */
-    if (gsfFileTable[handle-1].index_data.scale_factor_addr)
-    {
-        free(gsfFileTable[handle-1].index_data.scale_factor_addr);
-    }
-    memset (&gsfFileTable[handle-1].index_data, 0, sizeof(gsfFileTable[handle-1].index_data));
-
-    /* Clear the necessary fields of the gsfRecords data structure */
-    memset(&gsfFileTable[handle-1].rec.header, 0, sizeof(gsfHeader));
-
-    return (0);
-}
-
-/********************************************************************
- *
- * Function Name : gsfSeek
- *
- * Description : This function may be used to move the file pointer
- *  for a previously openned gsf file.
- *
- * Inputs :
- *  handle = the integer handle returned from gsf Open
- *  option = the desired action for moving the file pointer, where:
- *    GSF_REWIND, move pointer to first record in the file.
- *    GSF_END_OF_FILE, move pointer to the end of the file.
- *    GSF_PREVIOUS_RECORD, backup to the beginning of the record just
- *     written or just read.
- *
- * Returns :
- *  This function returns zero if successful, or -1 if an error occured.
- *
- * Error Conditions :
- *    GSF_BAD_FILE_HANDLE
- *    GSF_FILE_SEEK_ERROR
- *    GSF_BAD_SEEK_OPTION
- *
- ********************************************************************/
-
-int
-gsfSeek(int handle, int option)
-{
-    /* JSB 04/05/00 replaced ">=" with ">" */
-    if ((handle < 1) || (handle > GSF_MAX_OPEN_FILES))
-    {
-        gsfError = GSF_BAD_FILE_HANDLE;
-        return (-1);
-    }
-
-    switch (option)
-    {
-        case GSF_REWIND:
-            /* If the last operation was a write then we need to fflush */
-            if (gsfFileTable[handle - 1].read_write_flag == LAST_OP_WRITE)
-            {
-                if (fflush (gsfFileTable[handle - 1].fp))
-                {
-                    gsfError = GSF_FLUSH_ERROR;
-                    return(-1);
-                }
-            }
-            gsfFileTable[handle - 1].read_write_flag = LAST_OP_FLUSH;
-
-            if (fseek(gsfFileTable[handle - 1].fp, 0, SEEK_SET))
-            {
-                gsfError = GSF_FILE_SEEK_ERROR;
-                return (-1);
-            }
-            break;
-
-        case GSF_END_OF_FILE:
-            /* If the last operation was a write then we need to fflush */
-            if (gsfFileTable[handle - 1].read_write_flag == LAST_OP_WRITE)
-            {
-                if (fflush (gsfFileTable[handle - 1].fp))
-                {
-                    gsfError = GSF_FLUSH_ERROR;
-                    return(-1);
-                }
-            }
-            gsfFileTable[handle - 1].read_write_flag = LAST_OP_FLUSH;
-
-            if (fseek(gsfFileTable[handle - 1].fp, 0, SEEK_END))
-            {
-                gsfError = GSF_FILE_SEEK_ERROR;
-                return (-1);
-            }
-            break;
-
-        case GSF_PREVIOUS_RECORD:
-            if (fseek(gsfFileTable[handle - 1].fp, gsfFileTable[handle - 1].previous_record, SEEK_SET))
-            {
-                gsfError = GSF_FILE_SEEK_ERROR;
-                return (-1);
-            }
-            break;
-
-        default:
-            gsfError = GSF_BAD_SEEK_OPTION;
-            return (-1);
-    }
-
-    return (0);
-}
-
-/********************************************************************
- *
- * Function Name : gsfRead
- *
- * Description : gsfRead supports both direct and sequential access. If the
- *  file is opened for sequential access, this function reads the desired
- *  record from the gsf data file specified by handle.  The "desiredRecord"
- *  argument may be set to GSF_NEXT_RECORD to read the next record in the
- *  data file, or "desiredRecord" record may be set to specify the record
- *  of interest, in which case the file will be read, skipping past
- *  intermediary records until the desired record is found.  When the desired
- *  record is found, it is read and then decoded from external to internal
- *  form. If the optional checksum is found with the data it will be verified.
- *  All of the fields of the gsfDataID structure, with the exception of the
- *  record_number field will be loaded with the values contained in the GSF
- *  record byte stream.  The record_number field will be undefined.  The
- *  stream and max_size arguments are normally set to NULL, unless the
- *  calling application is interested in a copy of the GSF byte stream.
- *
- *  If the file is opened for direct access, then the combination of the
- *  recordID and the record_number fields of the dataID structure are used
- *  to uniquely identify the record of interest.  The address for this record
- *  is retrieved from the index file, which was created on a previous call
- *  to gsfOpen or gsfOpenBuffered.  If the record of interest is a ping record
- *  for which we need to retrieve new scale factors, then the ping record
- *  containing the scale factors needed is read first, and then the ping
- *  record of interest is read.  Direct access applications should set the
- *  desiredRecord argument equal to the recordID field in the gsfDataID
- *  structure.
- *
- * Inputs :
- *    handle = the handle to the file as provided by gsfOpen
- *    desiredRecord = the desired record or GSF_NEXT_RECORD
- *    dataID = a pointer to a gsfDataID structure to be populated for the
- *             input record.
- *    rptr = a pointer to a gsfRecords structure to be populated with the
- *           data from the input record in internal form.
- *    buf = an optional pointer to caller memory to be populated with a copy
- *          of the gsf byte stream for this record.
- *    max_size = an optional maximum size to copy into buf
- *
- * Returns :
- *  This function returns the number of bytes read if successful,
- *  or -1 if an error occured.
- *
- * Error Conditions :
- *    GSF_BAD_FILE_HANDLE
- *    GSF_FILE_SEEK_ERROR
- *    GSF_FLUSH_ERROR
- *    GSF_READ_TO_END_OF_FILE
- *    GSF_READ_ERROR
- *    GSF_RECORD_SIZE_ERROR
- *    GSF_INSUFFICIENT_SIZE
- *    GSF_CHECKSUM_FAILURE
- *    GSF_UNRECOGNIZED_RECORD_ID
- *    GSF_HEADER_RECORD_DECODE_FAILED
- *    GSF_SVP_RECORD_DECODE_FAILED
- *    GSF_PROCESS_PARAM_RECORD_DECODE_FAILED
- *    GSF_SENSOR_PARAM_RECORD_DECODE_FAILED
- *    GSF_COMMENT_RECORD_DECODE_FAILED
- *    GSF_HISTORY_RECORD_DECODE_FAILED
- *    GSF_NAV_ERROR_RECORD_DECODE_FAILED
- ********************************************************************/
-
-int
-gsfRead(int handle, int desiredRecord, gsfDataID *dataID, gsfRecords *rptr, unsigned char *buf, int max_size)
-{
-    int             ret;
-    gsfDataID       tmpID;
-
-    /* Clear gsfError before each read */
-    gsfError = 0;
-
-    /* JSB 04/05/00 replaced ">=" with ">" */
-    if ((handle < 1) || (handle > GSF_MAX_OPEN_FILES))
-    {
-        gsfError = GSF_BAD_FILE_HANDLE;
-        return (-1);
-    }
-
-    /* If this file is opened for direct access, then move the file pointer
-     * to the record which the caller wants to read. Note that there is no
-     * file re-positioning to be done if the caller wants the next record.
-     */
-    if ((gsfFileTable[handle - 1].direct_access) &&
-        (desiredRecord != GSF_NEXT_RECORD))
-    {
-        memset(&tmpID, 0, sizeof(tmpID));
-        tmpID.recordID = desiredRecord;
-        tmpID.record_number = dataID->record_number;
-
-        ret = gsfSeekRecord(handle, &tmpID);
-        if (ret < 0)
-        {
-            /* gsfError is set in gsfSeekRecord */
-            return (-1);
-        }
-    }
-
-    ret = gsfUnpackStream (handle, desiredRecord, dataID, rptr, buf, max_size);
-
-    gsfFileTable[handle - 1].last_record_type = dataID->recordID;
-
-    return (ret);
-}
-
-/********************************************************************
- *
- * Function Name : gsfUnpackStream
- *
- * Description : gsfUnpackStream is a static function (not available to
- *   application programs) which is used by gsfRead to read and decode
- *   gsf records. It performs the bulk of the processing required to read
- *   a gsf record.  This processing exists as a function seperate from
- *   gsfRead since it is required both by gsfRead and by gsfSeekRecord.
- *   gsfUnpackStream is used by gsfSeekRecord to read a ping record with
- *   scale factors, which is required to support direct access.
- *
- * Inputs :
- *    handle = the handle to the file as provided by gsfOpen
- *    desiredRecord = the desired record or GSF_NEXT_RECORD
- *    dataID = a pointer to a gsfDataID structure to be populated for the
- *             input record.
- *    rptr = a pointer to a gsfRecords structure to be populated with the
- *           data from the input record in internal form.
- *    buf = an optional pointer to caller memory to be populated with a copy
- *          of the gsf byte stream for this record.
- *    max_size = an optional maximum size to copy into buf
- *
- * Returns :
- *  This function returns the number of bytes read if successful,
- *  or -1 if an error occured.
- *
- * Returns :
- *
- * Error Conditions :
- *    GSF_FILE_SEEK_ERROR
- *    GSF_FLUSH_ERROR
- *    GSF_READ_TO_END_OF_FILE
- *    GSF_RECORD_SIZE_ERROR
- *    GSF_INSUFFICIENT_SIZE
- *    GSF_CHECKSUM_FAILURE
- *    GSF_HEADER_RECORD_DECODE_FAILED
- *    GSF_SVP_RECORD_DECODE_FAILED
- *    GSF_PROCESS_PARAM_RECORD_DECODE_FAILED
- *    GSF_SENSOR_PARAM_RECORD_DECODE_FAILED
- *    GSF_COMMENT_RECORD_DECODE_FAILED
- *    GSF_HISTORY_RECORD_DECODE_FAILED
- *    GSF_NAV_ERROR_RECORD_DECODE_FAILED
- *
- ********************************************************************/
-
-static int
-gsfUnpackStream (int handle, int desiredRecord, gsfDataID *dataID, gsfRecords *rptr, unsigned char *buf, int max_size)
-{
-    int             readNext = 1;
-    int             ret;
-    long long       readStat;
-    gsfuLong        tmpBuff[2];
-    gsfuLong        dataSize;
-    gsfuLong        readSize;
-    gsfuLong        did;
-    gsfDataID       thisID;
-    gsfuLong        temp;
-    unsigned char  *dptr = streamBuff;
-    gsfuLong        ckSum;
-
-    if ((handle < 1) || (handle > GSF_MAX_OPEN_FILES))
-    {
-        gsfError = GSF_BAD_FILE_HANDLE;
-        return (-1);
-    }
-
-    /* This loop will read one record at a time until the record type
-     * desired by the caller is found.
-     */
-    while (readNext)
-    {
-        /* Get the current record pointer */
-        if ((gsfFileTable[handle - 1].previous_record = ftell(gsfFileTable[handle - 1].fp)) == -1)
-        {
-            gsfError = GSF_FILE_SEEK_ERROR;
-            return (-1);
-        }
-
-        /* If the file is open for update and the last operation was a write,
-         * flush the buffer.
-         */
-        if ((gsfFileTable[handle - 1].update_flag) &&
-            (gsfFileTable[handle - 1].read_write_flag == LAST_OP_WRITE))
-        {
-            if (fflush (gsfFileTable[handle - 1].fp))
-            {
-                gsfError = GSF_FLUSH_ERROR;
-                return(-1);
-            }
-        }
-        gsfFileTable[handle - 1].read_write_flag = LAST_OP_READ;
-
-        /* read the data size, and gsf ID fields */
-        readStat = fread((void *) tmpBuff, GSF_LONG_SIZE, (size_t) 2, gsfFileTable[handle - 1].fp);
-        if (readStat != 2)
-        {
-            if (feof(gsfFileTable[handle - 1].fp))
-            {
-                /* wkm 10-19-01: if error reading file and we're at the end of the file,
-                 *               reset file pointer
-                 */
-                fseek (gsfFileTable[handle - 1].fp,
-                       gsfFileTable[handle - 1].previous_record,
-                       SEEK_SET);
-                /* if anything was read, that's a different error code than nothing read */
-                if (readStat == 0)
-                    gsfError = GSF_READ_TO_END_OF_FILE;
-                else
-                    gsfError = GSF_PARTIAL_RECORD_AT_END_OF_FILE;
-                return (-1);
-            }
-            gsfError = GSF_READ_ERROR;
-            return (-1);
-        }
-
-        /* convert from gsf to host byte order, gsf byte order = network byte order */
-        dataSize = (gsfuLong) ntohl(tmpBuff[0]);
-        readSize = dataSize;
-        did = (gsfuLong) ntohl(tmpBuff[1]);
-
-        /* convert the did value into a gsfDataID struct
-         * First the check sum value
-         *
-         * 1098 7654 3210 9876 5432 1098 7654 3210
-         * 1000 0000 0000 0000 0000 0000 0000 0000
-         *    8  0    0    0    0    0    0    0
-         */
-        thisID.checksumFlag = (did & 0x80000000);
-
-        /* Now the reserved field
-         * 1098 7654 3210 9876 5432 1098 7654 3210
-         * 0111 1111 1100 0000 0000 0000 0000 0000
-         *    7  F    C    0    0    0    0    0
-         */
-        temp = did & 0x7FC00000;
-        thisID.reserved = (temp >> 22);
-
-        /* Now the combination of registry number and data type number
-         * 1098 7654 3210 9876 5432 1098 7654 3210
-         * 0000 0000 0011 1111 1111 1111 1111 1111
-         *    0  0    3    F    F    F    F    F
-         */
-        temp = did;
-        thisID.recordID = (temp & 0x003FFFFF);
-
-        /* if there is a checksum read it, we'll read four additional bytes */
-        if (thisID.checksumFlag)
-        {
-            readSize = dataSize + 4;
-            /* jsb 01-30-95
-             * dptr += 4;
-             */
-            dptr = streamBuff + 4;
-        }
-        else
-        {
-            dptr = streamBuff;
-        }
-
-/*         fprintf(stderr, "readize = %d  desi = %d\n", readSize, thisID.recordID); */
-
-
-       /* Make sure that we have a big enough buffer to fit this record,
-         *  then read it out.
-         */
-        if ((readSize <= 8) || (readSize > GSF_MAX_RECORD_SIZE))
-        {
-
-            /* wkm, may have an incomplete record here */
-            gsfError = GSF_RECORD_SIZE_ERROR;
-            return (-1);
-        }
-
-
-        /* No point in reading the "size" bytes for data if the ID is not recognized */
-        switch (thisID.recordID)
-        {
-            case (GSF_RECORD_HEADER):
-            case (GSF_RECORD_SWATH_BATHY_SUMMARY):
-            case (GSF_RECORD_SWATH_BATHYMETRY_PING):
-            case (GSF_RECORD_SOUND_VELOCITY_PROFILE):
-            case (GSF_RECORD_PROCESSING_PARAMETERS):
-            case (GSF_RECORD_SENSOR_PARAMETERS):
-            case (GSF_RECORD_COMMENT):
-            case (GSF_RECORD_HISTORY):
-            case (GSF_RECORD_NAVIGATION_ERROR):
-            case (GSF_RECORD_SINGLE_BEAM_PING):
-            case (GSF_RECORD_HV_NAVIGATION_ERROR):
-            case (GSF_RECORD_ATTITUDE):
-                break;
-
-            default:
-                gsfError = GSF_UNRECOGNIZED_RECORD_ID;
-                return (-1);
-        }
-
-        /* If the caller passed GSF_NEXT_RECORD, as the desiredRecord, they
-         * want the next record
-         */
-        if ((desiredRecord == GSF_NEXT_RECORD) || (thisID.recordID == desiredRecord))
-        {
-            readNext = 0;
-            /* Set the caller's ID structure with those items we've read */
-            dataID->checksumFlag = thisID.checksumFlag;
-            dataID->reserved = thisID.reserved;
-            dataID->recordID = thisID.recordID;
-
-            readStat = fread(streamBuff, (size_t) 1, readSize, gsfFileTable[handle - 1].fp);
-            if (readStat != readSize)
-            {
-                if (feof(gsfFileTable[handle - 1].fp))
-                {
-
-                    /* wkm 10-19-01: if error reading file and we're at the end of the file,
-                     *               reset file pointer
-                     */
-                    fseek (gsfFileTable[handle - 1].fp,
-                          gsfFileTable[handle - 1].previous_record,
-                          SEEK_SET);
-                    /* if anything was read, that's a different error code than nothing read */
-                    if (readStat == 0)
-                        gsfError = GSF_READ_TO_END_OF_FILE;
-                    else
-                        gsfError = GSF_PARTIAL_RECORD_AT_END_OF_FILE;
-                    return (-1);
-                }
-                gsfError = GSF_READ_ERROR;
-                return (-1);
-            }
-        }
-
-        /* This record is not the requested record, advance the file pointer */
-        else if (thisID.recordID != desiredRecord)
-        {
-            readStat = fseek(gsfFileTable[handle - 1].fp, readSize, SEEK_CUR);
-            if (readStat)
-            {
-                gsfError = GSF_FILE_SEEK_ERROR;
-                return (-1);
-            }
-        }
-    }
-
-    /*
-    * If the caller's buffer isn't null, move this data into their buffer.
-    *  Don't move the 4 byte checksum into the buffer.
-    */
-    if ((buf) && (dataSize <= max_size))
-    {
-        memcpy(buf, dptr, dataSize);
-    }
-    else if ((buf) && (dataSize > max_size))
-    {
-        gsfError = GSF_INSUFFICIENT_SIZE;
-        return (-1);
-    }
-
-    /* We have the record of interest, verify the checksum if required */
-    if (thisID.checksumFlag)
-    {
-        memcpy(&tmpBuff[0], streamBuff, GSF_LONG_SIZE);
-        ckSum = (gsfuLong) ntohl(tmpBuff[0]);
-        if (ckSum != (gsfChecksum(dptr, dataSize)))
-        {
-            gsfError = GSF_CHECKSUM_FAILURE;
-            return (-1);
-        }
-    }
-
-
-    /* Invoke the appropriate function for unpacking this record into a
-    * standard gsf structure.
-    */
-    switch (thisID.recordID)
-    {
-        case (GSF_RECORD_HEADER):
-            ret = gsfDecodeHeader(&rptr->header, dptr);
-            if (ret < 0)
-            {
-                gsfError = GSF_HEADER_RECORD_DECODE_FAILED;
-                return (-1);
-            }
-            break;
-
-        case (GSF_RECORD_SWATH_BATHY_SUMMARY):
-            ret = gsfDecodeSwathBathySummary(&rptr->summary, dptr);
-            if (ret < 0)
-            {
-                gsfError = GSF_SUMMARY_RECORD_DECODE_FAILED;
-                return (-1);
-            }
-            break;
-
-        case (GSF_RECORD_SWATH_BATHYMETRY_PING):
-            ret = gsfDecodeSwathBathymetryPing(&rptr->mb_ping, dptr, &gsfFileTable[handle - 1], handle, dataSize);
-            if (ret < 0)
-            {
-                /* gsfError is set within gsfDecodeSwathBathymetryPing */
-                return (-1);
-            }
-            break;
-
-        case (GSF_RECORD_SOUND_VELOCITY_PROFILE):
-            ret = gsfDecodeSoundVelocityProfile(&rptr->svp, &gsfFileTable[handle - 1], dptr);
-            if (ret < 0)
-            {
-                gsfError = GSF_SVP_RECORD_DECODE_FAILED;
-                return (-1);
-            }
-            break;
-
-        case (GSF_RECORD_PROCESSING_PARAMETERS):
-            ret = gsfDecodeProcessingParameters(&rptr->process_parameters, &gsfFileTable[handle - 1], dptr);
-            if (ret < 0)
-            {
-                gsfError = GSF_PROCESS_PARAM_RECORD_DECODE_FAILED;
-                return (-1);
-            }
-            break;
-
-        case (GSF_RECORD_SENSOR_PARAMETERS):
-            ret = gsfDecodeSensorParameters(&rptr->sensor_parameters, &gsfFileTable[handle - 1], dptr);
-            if (ret < 0)
-            {
-                gsfError = GSF_SENSOR_PARAM_RECORD_DECODE_FAILED;
-                return (-1);
-            }
-            break;
-
-        case (GSF_RECORD_COMMENT):
-            ret = gsfDecodeComment(&rptr->comment, &gsfFileTable[handle - 1], dptr);
-            if (ret < 0)
-            {
-                gsfError = GSF_COMMENT_RECORD_DECODE_FAILED;
-                return (-1);
-            }
-            break;
-
-        case (GSF_RECORD_HISTORY):
-            ret = gsfDecodeHistory(&rptr->history, &gsfFileTable[handle - 1], dptr);
-            if (ret < 0)
-            {
-                gsfError = GSF_HISTORY_RECORD_DECODE_FAILED;
-                return (-1);
-            }
-            break;
-
-        case (GSF_RECORD_NAVIGATION_ERROR):
-            ret = gsfDecodeNavigationError(&rptr->nav_error, dptr);
-            if (ret < 0)
-            {
-                gsfError = GSF_NAV_ERROR_RECORD_DECODE_FAILED;
-                return (-1);
-            }
-            break;
-
-        case (GSF_RECORD_SINGLE_BEAM_PING):
-            ret = gsfDecodeSinglebeam(&rptr->sb_ping, dptr, &gsfFileTable[handle - 1], handle, dataSize);
-            if (ret < 0)
-            {
-                /* gsfError is set within gsfDecodeSinglebeam */
-                return (-1);
-            }
-            break;
-
-        case (GSF_RECORD_HV_NAVIGATION_ERROR):
-            ret = gsfDecodeHVNavigationError(&rptr->hv_nav_error, &gsfFileTable[handle - 1], dptr);
-            if (ret < 0)
-            {
-                gsfError = GSF_HV_NAV_ERROR_RECORD_DECODE_FAILED;
-                return (-1);
-            }
-            break;
-
-        case (GSF_RECORD_ATTITUDE):
-            ret = gsfDecodeAttitude(&rptr->attitude, &gsfFileTable[handle - 1], dptr);
-            if (ret < 0)
-            {
-                gsfError = GSF_ATTITUDE_RECORD_DECODE_FAILED;
-                return (-1);
-            }
-            break;
-
-
-        default:
-            gsfError = GSF_UNRECOGNIZED_RECORD_ID;
-            return (-1);
-    }
-
-    return (readSize + GSF_FILL_SIZE);
-}
-
-/********************************************************************
- *
- * Function Name : gsfSeekRecord
- *
- * Description : This function moves the current gsf file position to the
- *    begining of the nth record of a specific type.  The record number and
- *    type of interest are specified by id.record_number and id.recordID.
- *    The byte offset into the file for the record of interest is retreaved
- *    from the index file created by a previous call to gsfOpen with one of
- *    the supported direct access modes specified.  This function is
- *    maintained as static to the library since the functions gsfRead
- *    and gsfWrite may be called directly to access a specific record.
- *
- * Inputs :
- *  handle = the handle for this file as returned by gsfOpen
- *  id = a pointer to a gsfDataID containing the record id information for
- *       the record of interest.
- *
- * Returns :
- *  This function returns zero if successful, or -1 if an error occured.
- *
- * Error Conditions :
- *  GSF_BAD_FILE_HANDLE
- *  GSF_UNRECOGNIZED_RECORD_ID
- *  GSF_INVALID_RECORD_NUMBER
- *  GSF_RECORD_TYPE_NOT_AVAILABLE
- *  GSF_FILE_SEEK_ERROR
- *  GSF_INDEX_FILE_READ_ERROR
- *
- *******************************************************************/
-
-static int
-gsfSeekRecord(int handle, gsfDataID *id)
-{
-    int             ret;
-    int             offset;
-    int             i;
-    int             scale_index;
-    long long       addr;
-    gsfRecords      scalesRecord;
-    INDEX_REC       index_rec;
-
-    /* Clear gsfError before each seek */
-    gsfError = 0;
-
-    /* JSB 04/05/00 replaced ">=" with ">" */
-    if ((handle < 1) || (handle > GSF_MAX_OPEN_FILES))
-    {
-        gsfError = GSF_BAD_FILE_HANDLE;
-        return (-1);
-    }
-
-    /* Make sure we have a valid recordID */
-    if ((id->recordID < 1) || (id->recordID >= NUM_REC_TYPES))
-    {
-        gsfError = GSF_UNRECOGNIZED_RECORD_ID;
-        return (-1);
-    }
-
-    /* Make sure we have a valid record_number */
-    if ((id->record_number < -1) ||
-        (id->record_number == 0) ||
-        (id->record_number > gsfFileTable[handle - 1].index_data.number_of_records[id->recordID]))
-    {
-        gsfError = GSF_INVALID_RECORD_NUMBER;
-        return (-1);
-    }
-
-    /* Check the record_types to see if the requested type is available */
-    if (gsfFileTable[handle - 1].index_data.record_type[id->recordID] == -1)
-    {
-        /* The record type is not available. */
-        gsfError = GSF_RECORD_TYPE_NOT_AVAILABLE;
-        return (-1);
-    }
-
-    /* If the record number requested is -1, use the last record of
-     * this type. Note that the record number counts from one.
-     */
-    if (id->record_number == -1)
-    {
-        offset = gsfFileTable[handle - 1].index_data.number_of_records[id->recordID] - 1;
-    }
-    else
-    {
-        offset = id->record_number - 1;
-    }
-
-    /* Compute the record address within the index file and read
-     * the index record.
-     */
-    addr = gsfFileTable[handle - 1].index_data.start_addr[id->recordID] +
-        (long long)(offset * sizeof(INDEX_REC));
-    if (fseek(gsfFileTable[handle - 1].index_data.fp, addr, 0))
-    {
-        gsfError = GSF_FILE_SEEK_ERROR;
-        return (-1);
-    }
-    ret = fread(&index_rec, sizeof(INDEX_REC), 1, gsfFileTable[handle - 1].index_data.fp);
-    if (ret != 1)
-    {
-        gsfError = GSF_INDEX_FILE_READ_ERROR;
-        return(-1);
-    }
-    if (gsfFileTable[handle - 1].index_data.swap)
-    {
-        SwapLongLong((long long *) &index_rec.addr, 1);
-    }
-
-    /* If the record type is GSF_RECORD_SWATH_BATHYMETRY_PING then we
-     * need to ensure that we have the ping record scale factors which
-     * apply to the ping record of interest.  The scale factor subrecord
-     * of the ping record will only be present in the file when the scale
-     * factors change.
-     */
-    if (id->recordID == GSF_RECORD_SWATH_BATHYMETRY_PING)
-    {
-        /* Clear the scale index */
-        scale_index = -1;
-        for (i = 1; i < gsfFileTable[handle - 1].index_data.number_of_records[0]; i++)
-        {
-            /* When the address of the record containing scale factors is
-             * greater than the address of the record of interest, get the
-             * address of the record containing scale factors which is one
-             * prior to this one.
-             */
-            if (gsfFileTable[handle - 1].index_data.scale_factor_addr[i].addr >
-                index_rec.addr)
-            {
-                scale_index = i - 1;
-                break;
-            }
-        }
-
-        /* If we didn't find a record containing scale factors with an address
-         * greater than the address of the record of interest, then use the
-         * last record in the file with scale factors.  Note that this
-         * condition is true if the file only contains one set of scale
-         * factors.
-         */
-        if (scale_index == -1)
-        {
-            scale_index = gsfFileTable[handle - 1].index_data.number_of_records[0] - 1;
-        }
-
-        /* We only need to go read the ping record with scale factors if we
-         * need to use a different set of scale factors than we did last time.
-         */
-        if (scale_index != gsfFileTable[handle - 1].index_data.last_scale_factor_index)
-        {
-            addr = gsfFileTable[handle - 1].index_data.scale_factor_addr[scale_index].addr;
-            if (fseek(gsfFileTable[handle - 1].fp, addr, 0))
-            {
-                gsfError = GSF_FILE_SEEK_ERROR;
-                return (-1);
-            }
-
-            memset(&scalesRecord, 0, sizeof(scalesRecord));
-            ret = gsfUnpackStream (handle, GSF_NEXT_RECORD, id, &scalesRecord, NULL, 0);
-            if (ret < 0)
-            {
-                /* gsfError will have been set in gsfUnpackStream */
-                return(-1);
-            }
-            memcpy(&gsfFileTable[handle - 1].rec, &scalesRecord, sizeof(gsfFileTable[handle - 1].rec));
-
-            /* We now have the scale factors we need, save this index for
-             * the comparison next time.
-             */
-            gsfFileTable[handle - 1].index_data.last_scale_factor_index = scale_index;
-        }
-    }
-
-    /* Seek to this offset in the gsf file */
-    if (fseek(gsfFileTable[handle - 1].fp, index_rec.addr, SEEK_SET))
-    {
-        gsfError = GSF_FILE_SEEK_ERROR;
-        return (-1);
-    }
-
-    return (0);
-}
-
-/********************************************************************
- *
- * Function Name : gsfWrite
- *
- * Description : gsfWrite encodes the data from internal to external form,
- *  and then writes the requested record into the file specified by handle,
- *  where handle is the value retured by gsfOpen.  The record is written to
- *  the current file pointer for handle.  An optional checksum may be computed
- *  and encoded with the data.
- *
- *  If the file is opened for sequential access (GSF_CREATE, or GSF_UPDATE)
- *  then the recordID field of the gsfDataID structure is used to specify
- *  the record to be written.  The record is written at the current location
- *  in the file.
- *
- *  If the file is opened for direct access (GSF_UPDATE_INDEX), then the
- *  combination of the recordID and the record_number fields of the gsfDataID
- *  structure are used to uniquely identify the record to be written.  The
- *  address of the record of interest is read from the index file and the file
- *  pointer is moved to this offset before the record is encoded and written
- *  to disk.
- *
- * Inputs :
- *  handle = the handle for this file as returned by gsfOpen
- *  id = a pointer to a gsfDataID containing the record id information for
- *       the record to write.
- *  rptr = a pointer to a gsfRecords structure from which to get the internal
- *         form of the record to be written to the file.
- *
- * Returns :
- *  This function returns the number of bytes written if successful, or
- *  -1 if an error occured.
- *
- * Error Conditions :
- *    GSF_BAD_FILE_HANDLE
- *    GSF_UNRECOGNIZED_RECORD_ID
- *    GSF_FILE_SEEK_ERROR
- *    GSF_WRITE_ERROR
- *    GSF_HEADER_RECORD_ENCODE_FAILED
- *    GSF_SVP_RECORD_ENCODE_FAILED
- *    GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED
- *    GSF_SENSOR_PARAM_RECORD_ENCODE_FAILED
- *    GSF_COMMENT_RECORD_ENCODE_FAILED
- *    GSF_HISTORY_RECORD_ENCODE_FAILED
- *    GSF_NAV_ERROR_RECORD_ENCODE_FAILED
- *    GSF_FLUSH_ERROR
- *    GSF_SINGLE_BEAM_ENCODE_FAILED
- *
- ********************************************************************/
-
-int
-gsfWrite(int handle, gsfDataID *id, gsfRecords *rptr)
-{
-    unsigned char  *ucptr;
-    gsfuLong        tmpBuff[3] =
-    {0, 0, 0};
-    gsfuLong        gsfBuff[3];
-    gsfuLong        temp;
-    gsfuLong        dataSize;
-    size_t          writeStat;
-    int             i;
-    int             pad;
-    long long       ret;
-
-    /* Clear gsfError before each write */
-    gsfError = 0;
-
-    /* JSB 04/05/00 replaced ">=" with ">" */
-    if ((handle < 1) || (handle > GSF_MAX_OPEN_FILES))
-    {
-        gsfError = GSF_BAD_FILE_HANDLE;
-        return (-1);
-    }
-
-    /* See if we need to make room for the optional checksum */
-    if (id->checksumFlag)
-    {
-        /* four byte size, four byte id, and four byte checksum */
-        ucptr = streamBuff + GSF_FILL_SIZE_CHECKSUM;
-    }
-    else
-    {
-        /* four byte size and four byte id */
-        ucptr = streamBuff + GSF_FILL_SIZE;
-    }
-
-    /* Invoke the appropriate function for packing this record into a
-    * byte stream.
-    */
-    switch (id->recordID)
-    {
-        case (GSF_RECORD_HEADER):
-            ret = gsfEncodeHeader(ucptr, &rptr->header);
-            if (ret < 0)
-            {
-                gsfError = GSF_HEADER_RECORD_ENCODE_FAILED;
-                return (-1);
-            }
-            break;
-
-        case (GSF_RECORD_SWATH_BATHY_SUMMARY):
-            ret = gsfEncodeSwathBathySummary(ucptr, &rptr->summary);
-            if (ret < 0)
-            {
-                gsfError = GSF_SUMMARY_RECORD_ENCODE_FAILED;
-                return (-1);
-            }
-            break;
-
-        case (GSF_RECORD_SWATH_BATHYMETRY_PING):
-            ret = gsfEncodeSwathBathymetryPing(ucptr, &rptr->mb_ping, &gsfFileTable[handle - 1], handle);
-            if (ret < 0)
-            {
-                /* gsfError is set within gsfEncodeSwathBathymetryPing */
-                return (-1);
-            }
-            break;
-
-        case (GSF_RECORD_SOUND_VELOCITY_PROFILE):
-            ret = gsfEncodeSoundVelocityProfile(ucptr, &rptr->svp);
-            if (ret < 0)
-            {
-                gsfError = GSF_SVP_RECORD_ENCODE_FAILED;
-                return (-1);
-            }
-            break;
-
-        case (GSF_RECORD_PROCESSING_PARAMETERS):
-            ret = gsfEncodeProcessingParameters(ucptr, &rptr->process_parameters);
-            if (ret < 0)
-            {
-                gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-                return (-1);
-            }
-            break;
-
-        case (GSF_RECORD_SENSOR_PARAMETERS):
-            ret = gsfEncodeSensorParameters(ucptr, &rptr->sensor_parameters);
-            if (ret < 0)
-            {
-                gsfError = GSF_SENSOR_PARAM_RECORD_ENCODE_FAILED;
-                return (-1);
-            }
-            break;
-
-        case (GSF_RECORD_COMMENT):
-            ret = gsfEncodeComment(ucptr, &rptr->comment);
-            if (ret < 0)
-            {
-                gsfError = GSF_COMMENT_RECORD_ENCODE_FAILED;
-                return (-1);
-            }
-            break;
-
-        case (GSF_RECORD_HISTORY):
-            ret = gsfEncodeHistory(ucptr, &rptr->history);
-            if (ret < 0)
-            {
-                gsfError = GSF_HISTORY_RECORD_ENCODE_FAILED;
-                return (-1);
-            }
-            break;
-
-        case (GSF_RECORD_NAVIGATION_ERROR):
-            ret = gsfEncodeNavigationError(ucptr, &rptr->nav_error);
-            if (ret < 0)
-            {
-                gsfError = GSF_NAV_ERROR_RECORD_ENCODE_FAILED;
-                return (-1);
-            }
-            break;
-
-        case (GSF_RECORD_SINGLE_BEAM_PING):
-            ret = gsfEncodeSinglebeam(ucptr, &rptr->sb_ping);
-            if (ret < 0)
-            {
-                gsfError = GSF_SINGLE_BEAM_ENCODE_FAILED;
-                return (-1);
-            }
-            break;
-
-        /* jsb 09/29/98 Added support for new navigation errors record */
-        case (GSF_RECORD_HV_NAVIGATION_ERROR):
-            ret = gsfEncodeHVNavigationError(ucptr, &rptr->hv_nav_error);
-            if (ret < 0)
-            {
-                gsfError = GSF_HV_NAV_ERROR_RECORD_ENCODE_FAILED;
-                return (-1);
-            }
-            break;
-
-        case (GSF_RECORD_ATTITUDE):
-            ret = gsfEncodeAttitude(ucptr, &rptr->attitude);
-            if (ret < 0)
-            {
-                gsfError = GSF_ATTITUDE_RECORD_ENCODE_FAILED;
-                return (-1);
-            }
-            break;
-
-        default:
-            gsfError = GSF_UNRECOGNIZED_RECORD_ID;
-            return (-1);
-    }
-
-    /* GSF specification requires all records to be a whole multiple of 4 bytes */
-    dataSize = (gsfuLong) ret;
-    pad = dataSize % 4;
-    if (pad)
-    {
-        /* jsb 04/18/97 A bug was fixed here in version 1.03, if this file was
-         * created with a version of gsf prior to 1.03 we need to support it the
-         * old way.
-         */
-        if ((gsfFileTable[handle - 1].major_version_number == 1) &&
-            (gsfFileTable[handle - 1].minor_version_number <= 2))
-        {
-            memset(ucptr + dataSize, 0, pad);
-            dataSize += pad;
-        }
-        else
-        {
-            memset(ucptr + dataSize, 0, (4 - pad));
-            dataSize += (4 - pad);
-        }
-    }
-
-    /* load the data identifier for this gsf record, first the checksum flag */
-    if (id->checksumFlag)
-    {
-        /* set the checksum bit */
-        tmpBuff[1] |= 0x80000000;
-
-        /* compute the checksum */
-        tmpBuff[2] = gsfChecksum(ucptr, dataSize);
-    }
-
-    /* now the reserved field */
-    temp = (gsfuLong) id->reserved;
-    tmpBuff[1] |= (temp << 22);
-
-    /* now the recordID, goes in bits 00-21 */
-    tmpBuff[1] |= (gsfuLong) id->recordID;
-
-    /* load the size of the data for this gsf record */
-    tmpBuff[0] = dataSize;
-
-    /* Now load the gsf packaging words into gsf byte order */
-    for (i = 0; i < 3; i++)
-    {
-        gsfBuff[i] = htonl(tmpBuff[i]);
-    }
-
-    /* Set the buffer pointer back to the first byte */
-    ucptr = streamBuff;
-
-    /* Add the gsf packaging words to the gsf stream */
-    if (id->checksumFlag)
-    {
-        memcpy(ucptr, gsfBuff, GSF_FILL_SIZE_CHECKSUM);
-        dataSize += GSF_FILL_SIZE_CHECKSUM;
-    }
-    else
-    {
-        memcpy(ucptr, gsfBuff, GSF_FILL_SIZE);
-        dataSize += GSF_FILL_SIZE;
-    }
-
-    /* Save the current record pointer */
-    if ((gsfFileTable[handle - 1].previous_record = ftell(gsfFileTable[handle - 1].fp)) == -1)
-    {
-        gsfError = GSF_FILE_SEEK_ERROR;
-        return (-1);
-    }
-
-    /*  If the file is open for update and the last operation was a read,
-     *  flush the buffer.
-     */
-    if ((gsfFileTable[handle - 1].update_flag) &&
-        (gsfFileTable[handle - 1].read_write_flag == LAST_OP_READ))
-    {
-        if (fflush (gsfFileTable[handle - 1].fp))
-        {
-            gsfError = GSF_FLUSH_ERROR;
-            return(-1);
-        }
-        gsfFileTable[handle - 1].bufferedBytes = 0;
-    }
-    gsfFileTable[handle - 1].read_write_flag = LAST_OP_WRITE;
-
-    /* Check to see if this record will fit into the current buffer, if not
-     * force a flush of the stream before writting. This is done to ensure
-     * that an output file will always contain whole gsf records.
-     */
-    gsfFileTable[handle-1].bufferedBytes += dataSize;
-    if (gsfFileTable[handle-1].bufferedBytes >= gsfFileTable[handle-1].buf_size)
-    {
-        if (fflush(gsfFileTable[handle-1].fp))
-        {
-            gsfError = GSF_FLUSH_ERROR;
-            return(-1);
-        }
-        gsfFileTable[handle-1].bufferedBytes = 0;
-    }
-
-    /* If this file is opened for direct access, then move the file pointer
-     * to the record which the caller wants to write.
-     */
-    if (gsfFileTable[handle - 1].direct_access)
-    {
-        ret = gsfSeekRecord(handle, id);
-        if (ret < 0)
-        {
-            /* gsfError is set in gsfSeekRecord */
-            return (-1);
-        }
-    }
-
-    /* Now write the data to the disk */
-    writeStat = fwrite(ucptr, (size_t) 1, (size_t) dataSize, gsfFileTable[handle - 1].fp);
-    if (writeStat != dataSize)
-    {
-        gsfError = GSF_WRITE_ERROR;
-        return (-1);
-    }
-
-    gsfFileTable[handle - 1].last_record_type = id->recordID;
-
-    /* return the number of bytes written */
-    return (dataSize);
-}
-
-/********************************************************************
- *
- * Function Name : gsfLoadScaleFactors
- *
- * Description : gsfLoadScaleFactors should be used to load the swath
- *  bathymetry ping record scale factor structure.  This function assures
- *  that the multiplier and offset fields of the scale factor structure
- *  have a precision equal to that which will be stored in the gsf data file.
- *  This function should be called once for each beam array data type
- *  contained in your data.
- *
- * Inputs :
- *  sf = a pointer to the gsfScaleFactors structure to be loaded
- *  subrecordID = the subrecord id for the beam array data
- *  c_flag = the compression flag for the beam array
- *  precision = the presision to which the beam array data are to be stored
- *              (a value of 0.1 would indicate decimeter precision for depth)
- *  offset = the "DC" offset to scale the data by.
- *
- * Returns :
- *  This function returns zero if successful, or -1 if an error occured.
- *
- * Error Conditions :
- *    GSF_TOO_MANY_ARRAY_SUBRECORDS
- *
- ********************************************************************/
-
-int
-gsfLoadScaleFactor(gsfScaleFactors *sf, unsigned int subrecordID, char c_flag, double precision, int offset)
-{
-    unsigned int    itemp;
-    double          mult;
-
-    /* If we're adding a new subrecord, bump counter and check bounds */
-    if (sf->scaleTable[subrecordID - 1].multiplier == 0.0)
-    {
-        if ((sf->numArraySubrecords + 1) > GSF_MAX_PING_ARRAY_SUBRECORDS)
-        {
-            sf->numArraySubrecords--;
-            gsfError = GSF_TOO_MANY_ARRAY_SUBRECORDS;
-            return (-1);
-        }
-
-        /* Compute the multiplier as one over the requested precision */
-        mult = 1.0 / precision;
-
-        /* In order to assure the same multiplier is used throughout, truncate
-         *  to an integer.  This is the value which is stored with the data.
-         *  The multiplier value is encoded on the byte stream as an integer value
-         *  (i.e. it is not scaled) so the smallest supportable precision is 1.
-         */
-        itemp = (int) (mult + 0.001);
-
-        /* QC test on the integer value as this is the number that will get encoded on the GSF byte stream */
-        if ((itemp < MIN_GSF_SF_MULT_VALUE) || (itemp > MAX_GSF_SF_MULT_VALUE))
-        {
-            gsfError = GSF_CANNOT_REPRESENT_PRECISION;
-            return (-1);
-        }
-
-        /* New scale factor has passed QC tests, it is now safe to bump the counter */
-        sf->numArraySubrecords++;
-    }
-    else
-    {
-        /* Compute the multiplier as one over the requested precision */
-        mult = 1.0 / precision;
-
-        /* In order to assure the same multiplier is used throughout, truncate
-         *  to an integer.  This is the value which is stored with the data.
-         *  The multiplier value is encoded on the byte stream as an integer value
-         *  (i.e. it is not scaled) so the smallest supportable precision is 1.
-         */
-        itemp = (int) (mult + 0.001);
-
-        /* QC test on the integer value as this is the number that will get encoded on the GSF byte stream */
-        if ((itemp < MIN_GSF_SF_MULT_VALUE) || (itemp > MAX_GSF_SF_MULT_VALUE))
-        {
-            gsfError = GSF_CANNOT_REPRESENT_PRECISION;
-            return (-1);
-        }
-    }
-
-    /* The multiplier to be applied to the data is converted back to a
-     *  double here, for floating point performance.
-     */
-    sf->scaleTable[subrecordID - 1].compressionFlag = c_flag;
-    sf->scaleTable[subrecordID - 1].multiplier = ((double) itemp);
-    sf->scaleTable[subrecordID - 1].offset = (double) offset;
-
-    return (0);
-}
-
-/********************************************************************
- *
- * Function Name : gsfGetScaleFactors
- *
- * Description : gsfGetScaleFactors may be used to obtain the multiplier
- *  and DC offset values by which each swath bathymetry ping array subrecord
- *  is be scaled. gsfGetScalesFactors must be called once for each array
- *  subrecord of interest.  At leat one swath bathymetry ping record
- *  must have been read from, or written to the file specified by handle.
- *
- * Inputs :
- *  handle = the integer value set by a call to gsfOpen.
- *  subrecordID = an integer value containing the subrecord id of the requested scale factors
- *  c_flag = the address of an unsigned character to contain the the compression flag
- *  multiplier = the address of a double to contain the scaling multiplier
- *  offset = the address of a double to contain the scaling DC offset.
- *
- * Returns :
- *  This function returns zero if successful, or -1 if an error occurred.
- *
- * Error Conditions :
- *    GSF_TOO_MANY_ARRAY_SUBRECORDS
- *    GSF_ILLEGAL_SCALE_FACTOR_MULTIPLIER
- *
- ********************************************************************/
-
-int
-gsfGetScaleFactor(int handle, unsigned int subrecordID, unsigned char *c_flag, double *multiplier, double *offset)
-{
-
-    if ((subrecordID < 1) || (subrecordID > GSF_MAX_PING_ARRAY_SUBRECORDS))
-    {
-        gsfError = GSF_TOO_MANY_ARRAY_SUBRECORDS;
-        return(-1);
-    }
-
-    /* JSB 04/05/00 replaced ">=" with ">" */
-    if ((handle < 1) || (handle > GSF_MAX_OPEN_FILES))
-    {
-        gsfError = GSF_BAD_FILE_HANDLE;
-        return (-1);
-    }
-
-    /* Make sure the multiplier is not zero */
-    if (gsfFileTable[handle-1].rec.mb_ping.scaleFactors.scaleTable[subrecordID-1].multiplier == 0.0)
-    {
-        gsfError = GSF_ILLEGAL_SCALE_FACTOR_MULTIPLIER;
-        return (-1);
-    }
-
-    /* Set the compression flag */
-    *c_flag = gsfFileTable[handle-1].rec.mb_ping.scaleFactors.scaleTable[subrecordID-1].compressionFlag;
-
-    /* Set the multiplier */
-    *multiplier = gsfFileTable[handle-1].rec.mb_ping.scaleFactors.scaleTable[subrecordID-1].multiplier;
-
-    /* Set the offset */
-    *offset = gsfFileTable[handle-1].rec.mb_ping.scaleFactors.scaleTable[subrecordID-1].offset;
-
-    return (0);
-}
-
-/********************************************************************
- *
- * Function Name : gsfFree
- *
- * Description : This function frees all dynamically allocated memory
- *    from a gsfRecords data structure, and it then clears all the
- *    data elements in the structure.
- *
- * Inputs :
- *    gsfRecords *rec = a pointer to ta gsfRecords data structure
- *
- * Returns : none
- *
- * Error Conditions : none
- *
- ********************************************************************/
-
-void
-gsfFree (gsfRecords *rec)
-{
-    int i;
-
-    /* Free the array subrecords in ping data structure */
-    if (rec->mb_ping.depth != (double *) NULL)
-    {
-        free (rec->mb_ping.depth);
-        rec->mb_ping.depth = (double *) NULL;
-    }
-
-    if (rec->mb_ping.nominal_depth != (double *) NULL)
-    {
-        free (rec->mb_ping.nominal_depth);
-        rec->mb_ping.nominal_depth = (double *) NULL;
-    }
-
-    if (rec->mb_ping.across_track != (double *) NULL)
-    {
-        free (rec->mb_ping.across_track);
-        rec->mb_ping.across_track = (double *) NULL;
-    }
-
-    if (rec->mb_ping.along_track != (double *) NULL)
-    {
-        free (rec->mb_ping.along_track);
-        rec->mb_ping.along_track = (double *) NULL;
-    }
-
-    if (rec->mb_ping.travel_time != (double *) NULL)
-    {
-        free (rec->mb_ping.travel_time);
-        rec->mb_ping.travel_time = (double *) NULL;
-    }
-
-    if (rec->mb_ping.beam_angle != (double *) NULL)
-    {
-        free (rec->mb_ping.beam_angle);
-        rec->mb_ping.beam_angle = (double *) NULL;
-    }
-
-    if (rec->mb_ping.mc_amplitude != (double *) NULL)
-    {
-        free (rec->mb_ping.mc_amplitude);
-        rec->mb_ping.mc_amplitude = (double *) NULL;
-    }
-
-    if (rec->mb_ping.mr_amplitude != (double *) NULL)
-    {
-        free (rec->mb_ping.mr_amplitude);
-        rec->mb_ping.mr_amplitude = (double *) NULL;
-    }
-
-    if (rec->mb_ping.echo_width != (double *) NULL)
-    {
-        free (rec->mb_ping.echo_width);
-        rec->mb_ping.echo_width = (double *) NULL;
-    }
-
-    if (rec->mb_ping.quality_factor != (double *) NULL)
-    {
-        free (rec->mb_ping.quality_factor);
-        rec->mb_ping.quality_factor = (double *) NULL;
-    }
-
-    if (rec->mb_ping.receive_heave != (double *) NULL)
-    {
-        free (rec->mb_ping.receive_heave);
-        rec->mb_ping.receive_heave = (double *) NULL;
-    }
-
-    if (rec->mb_ping.depth_error != (double *) NULL)
-    {
-        free (rec->mb_ping.depth_error);
-        rec->mb_ping.depth_error = (double *) NULL;
-    }
-
-    if (rec->mb_ping.across_track_error != (double *) NULL)
-    {
-        free (rec->mb_ping.across_track_error);
-        rec->mb_ping.across_track_error = (double *) NULL;
-    }
-
-    if (rec->mb_ping.along_track_error != (double *) NULL)
-    {
-        free (rec->mb_ping.along_track_error);
-        rec->mb_ping.along_track_error = (double *) NULL;
-    }
-
-    if (rec->mb_ping.quality_flags != (unsigned char *) NULL)
-    {
-        free (rec->mb_ping.quality_flags);
-        rec->mb_ping.quality_flags = (unsigned char *) NULL;
-    }
-
-    if (rec->mb_ping.beam_flags != (unsigned char *) NULL)
-    {
-        free (rec->mb_ping.beam_flags);
-        rec->mb_ping.beam_flags = (unsigned char *) NULL;
-    }
-
-    if (rec->mb_ping.signal_to_noise != (double *) NULL)
-    {
-        free (rec->mb_ping.signal_to_noise);
-        rec->mb_ping.signal_to_noise = (double *) NULL;
-    }
-
-    if (rec->mb_ping.beam_angle_forward != (double *) NULL)
-    {
-        free (rec->mb_ping.beam_angle_forward);
-        rec->mb_ping.beam_angle_forward = (double *) NULL;
-    }
-
-    if (rec->mb_ping.vertical_error != (double *) NULL)
-    {
-        free (rec->mb_ping.vertical_error);
-        rec->mb_ping.vertical_error = (double *) NULL;
-    }
-
-    if (rec->mb_ping.horizontal_error != (double *) NULL)
-    {
-        free (rec->mb_ping.horizontal_error);
-        rec->mb_ping.horizontal_error = (double *) NULL;
-    }
-
-    if (rec->mb_ping.sector_number != (unsigned short *) NULL)
-    {
-        free (rec->mb_ping.sector_number);
-        rec->mb_ping.sector_number = (unsigned short *) NULL;
-    }
-
-    if (rec->mb_ping.detection_info != (unsigned short *) NULL)
-    {
-        free (rec->mb_ping.detection_info);
-        rec->mb_ping.detection_info = (unsigned short *) NULL;
-    }
-
-    if (rec->mb_ping.incident_beam_adj != (double *) NULL)
-    {
-        free (rec->mb_ping.incident_beam_adj);
-        rec->mb_ping.incident_beam_adj = (double *) NULL;
-    }
-
-    if (rec->mb_ping.system_cleaning != (unsigned short *) NULL)
-    {
-        free (rec->mb_ping.system_cleaning);
-        rec->mb_ping.system_cleaning = (unsigned short *) NULL;
-    }
-
-    if (rec->mb_ping.doppler_corr != (double *) NULL)
-    {
-        free (rec->mb_ping.doppler_corr);
-        rec->mb_ping.doppler_corr = (double *) NULL;
-    }
-
-    /* we have an array of number_beams gsfIntensitySeries structures */
-    if (rec->mb_ping.brb_inten != (gsfBRBIntensity *) NULL)
-    {
-        if (rec->mb_ping.brb_inten->time_series != (gsfTimeSeriesIntensity *) NULL)
-        {
-            for (i = 0; i < rec->mb_ping.number_beams; i++)
-            {
-                if (rec->mb_ping.brb_inten->time_series[i].samples != (unsigned int *) NULL)
-                {
-                    free (rec->mb_ping.brb_inten->time_series[i].samples);
-                    rec->mb_ping.brb_inten->time_series[i].samples = NULL;
-                }
-            }
-            free (rec->mb_ping.brb_inten->time_series);
-            rec->mb_ping.brb_inten->time_series = NULL;
-        }
-        free (rec->mb_ping.brb_inten);
-        rec->mb_ping.brb_inten = (gsfBRBIntensity *) NULL;
-    }
-
-    /* Free the dynamically allocated memory from the svp record */
-    if (rec->svp.depth != (double *) NULL)
-    {
-        free (rec->svp.depth);
-        rec->svp.depth = (double *) NULL;
-    }
-
-    if (rec->svp.sound_speed != (double *) NULL)
-    {
-        free (rec->svp.sound_speed);
-        rec->svp.sound_speed = (double *) NULL;
-    }
-
-    /* Free the dynamically allocated memory from the processing parameters */
-    for (i=0; i<rec->process_parameters.number_parameters; i++)
-    {
-        if (rec->process_parameters.param[i] != (char *) NULL)
-        {
-            free (rec->process_parameters.param[i]);
-            rec->process_parameters.param[i] = (char *) NULL;
-        }
-    }
-    rec->process_parameters.number_parameters = 0;
-
-    /* Free the dynamically allocated memory from the sensor parameters */
-    for (i=0; i<rec->sensor_parameters.number_parameters; i++)
-    {
-        if (rec->sensor_parameters.param[i] != (char *) NULL)
-        {
-            free (rec->sensor_parameters.param[i]);
-            rec->sensor_parameters.param[i] = (char *) NULL;
-        }
-    }
-    rec->sensor_parameters.number_parameters = 0;
-
-    /* Free the dynamically allocated memory from the comment record */
-    if (rec->comment.comment != (char *) NULL)
-    {
-        free (rec->comment.comment);
-        rec->comment.comment = (char *) NULL;
-    }
-
-    /* Free the dynamically allocated memory from the history record */
-    if (rec->history.command_line != (char *) NULL)
-    {
-        free (rec->history.command_line);
-        rec->history.command_line = (char *) NULL;
-    }
-
-    if (rec->history.comment != (char *) NULL)
-    {
-        free (rec->history.comment);
-        rec->history.comment = (char *) NULL;
-    }
-
-    /* Free the dynamically allocated memory from the attitude record */
-    if (rec->attitude.attitude_time != (struct timespec *) NULL)
-    {
-        free (rec->attitude.attitude_time);
-        rec->attitude.attitude_time = (struct timespec *) NULL;
-    }
-
-    if (rec->attitude.pitch != (double *) NULL)
-    {
-        free (rec->attitude.pitch);
-        rec->attitude.pitch = (double *) NULL;
-    }
-
-    if (rec->attitude.roll != (double *) NULL)
-    {
-        free (rec->attitude.roll);
-        rec->attitude.roll = (double *) NULL;
-    }
-
-    if (rec->attitude.heave != (double *) NULL)
-    {
-        free (rec->attitude.heave);
-        rec->attitude.heave = (double *) NULL;
-    }
-
-    if (rec->attitude.heading != (double *) NULL)
-    {
-        free (rec->attitude.heading);
-        rec->attitude.heading = (double *) NULL;
-    }
-
-    /* Now clear all the data from the gsf Records structure */
-    memset (rec, 0, sizeof(gsfRecords));
-
-    return;
-}
-
-/********************************************************************
- *
- * Function Name : gsfPrintError
- *
- * Description : This function is used to print a short message describing
- *  the most recent error encountered.  This function need only be called if
- *  a -1 is returned from one of the gsf functions.
- *
- * Inputs :
- *  fp = a pointer to a FILE to which to write the message.
- *
- * Returns : none
- *
- * Error Conditions : none
- *
- ********************************************************************/
-
-void
-gsfPrintError(FILE * fp)
-{
-
-    fprintf(fp, "%s\n", gsfStringError());
-
-    return;
-}
-
-/********************************************************************
- *
- * Function Name : gsfError
- *
- * Description : This function is used to return the
- *  most recent error encountered.
- *  This function need only be called if
- *  a -1 is returned from one of the gsf functions.
- *
- * Inputs : none
- *
- * Returns : constant integer value representing the most recent error
- *
- * Error Conditions : none
- *
- ********************************************************************/
-
-int gsfIntError(void)
-{
-    return gsfError;
-}
-
-/********************************************************************
- *
- * Function Name : gsfStringError
- *
- * Description : This function is used to return a string with
- *  a short message describing the most recent error encountered.
- *  This function need only be called if
- *  a -1 is returned from one of the gsf functions.
- *
- * Inputs :
- *  error_string = a pointer to a character string.
- *
- * Returns : none
- *
- * Error Conditions : none
- *
- ********************************************************************/
-
-const char *
-gsfStringError(void)
-{
-    const char             *ptr;
-
-    switch (gsfError)
-    {
-        case GSF_FOPEN_ERROR:
-            ptr = "GSF Unable to open requested file";
-            break;
-
-        case GSF_UNRECOGNIZED_FILE:
-            ptr = "GSF Error unrecognized file";
-            break;
-
-        case GSF_BAD_ACCESS_MODE:
-            ptr = "GSF Error illegal access mode";
-            break;
-
-        case GSF_READ_ERROR:
-            ptr = "GSF Error reading input data";
-            break;
-
-        case GSF_WRITE_ERROR:
-            ptr = "GSF Error writing output data";
-            break;
-
-        case GSF_INSUFFICIENT_SIZE:
-            ptr = "GSF Error insufficient size specified";
-            break;
-
-        case GSF_RECORD_SIZE_ERROR:
-            ptr = "GSF Error record size is out of bounds";
-            break;
-
-        case GSF_CHECKSUM_FAILURE:
-            ptr = "GSF Error data checksum failure";
-            break;
-
-        case GSF_FILE_CLOSE_ERROR:
-            ptr = "GSF Error closing gsf file";
-            break;
-
-        case GSF_TOO_MANY_ARRAY_SUBRECORDS:
-            ptr = "GSF Error too many array subrecords";
-            break;
-
-        case GSF_TOO_MANY_OPEN_FILES:
-            ptr = "GSF Error too many open files";
-            break;
-
-        case GSF_MEMORY_ALLOCATION_FAILED:
-            ptr = "GSF Error memory allocation failure";
-            break;
-
-        case GSF_STREAM_DECODE_FAILURE:
-            ptr = "GSF Error stream decode failure";
-            break;
-
-        case GSF_UNRECOGNIZED_RECORD_ID:
-            ptr = "GSF Error unrecognized record id";
-            break;
-
-        case GSF_BAD_SEEK_OPTION:
-            ptr = "GSF Error unrecognized file seek option";
-            break;
-
-        case GSF_FILE_SEEK_ERROR:
-            ptr = "GSF Error file seek failed";
-            break;
-
-        case GSF_UNRECOGNIZED_SENSOR_ID:
-            ptr = "GSF Error unrecognized sensor specific subrecord id";
-            break;
-
-        case GSF_UNRECOGNIZED_DATA_RECORD:
-            ptr = "GSF Error unrecognized data record id";
-            break;
-
-        case GSF_UNRECOGNIZED_ARRAY_SUBRECORD_ID:
-            ptr = "GSF Error unrecognized array subrecord id";
-            break;
-
-        case GSF_UNRECOGNIZED_SUBRECORD_ID:
-            ptr = "GSF Error unrecognized subrecord id";
-            break;
-
-        case GSF_ILLEGAL_SCALE_FACTOR_MULTIPLIER:
-            ptr = "GSF Error illegal scale factor multiplier specified";
-            break;
-
-        case GSF_CANNOT_REPRESENT_PRECISION:
-            ptr = "GSF Error illegal scale factor multiplier specified";
-            break;
-
-        case GSF_BAD_FILE_HANDLE:
-            ptr = "GSF Error bad file handle";
-            break;
-
-        case GSF_HEADER_RECORD_DECODE_FAILED:
-            ptr = "GSF Error decoding header record";
-            break;
-
-        case GSF_MB_PING_RECORD_DECODE_FAILED:
-            ptr = "GSF Error decoding multibeam ping record";
-            break;
-
-        case GSF_SVP_RECORD_DECODE_FAILED:
-            ptr = "GSF Error decoding SVP record";
-            break;
-
-        case GSF_PROCESS_PARAM_RECORD_DECODE_FAILED:
-            ptr = "GSF Error decoding processing parameters record";
-            break;
-
-        case GSF_SENSOR_PARAM_RECORD_DECODE_FAILED:
-            ptr = "GSF Error decoding sensor parameters record";
-            break;
-
-        case GSF_COMMENT_RECORD_DECODE_FAILED:
-            ptr = "GSF Error decoding comment record";
-            break;
-
-        case GSF_HISTORY_RECORD_DECODE_FAILED:
-            ptr = "GSF Error decoding history record";
-            break;
-
-        case GSF_NAV_ERROR_RECORD_DECODE_FAILED:
-            ptr = "GSF Error decoding latitude/longitude navigation error record";
-            break;
-
-        case GSF_ATTITUDE_RECORD_DECODE_FAILED:
-            ptr = "GSF Error decoding attitude record";
-            break;
-
-        /* jsb 10/11/98; These macro names are too long to be unique, when compiled under HP-UX 10.20
-         *  This needs to be scheduled for resolution in a future release.
-        case (GSF_HEADER_RECORD_ENCODE_FAILED):
-            ptr = "GSF Error encoding header recrod";
-            break;
-
-        case GSF_MB_PING_RECORD_ENCODE_FAILED:
-            ptr = "GSF Error encoding multibeam ping record";
-            break;
-
-         case GSF_SVP_RECORD_ENCODE_FAILED:
-            ptr = "GSF Error encoding SVP record";
-            break;
-
-         case GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED:
-            ptr = "GSF Error encoding processing parameters record";
-            break;
-
-         case GSF_SENSOR_PARAM_RECORD_ENCODE_FAILED:
-            ptr = "GSF Error encoding sensor parameters record";
-            break;
-
-         case GSF_COMMENT_RECORD_ENCODE_FAILED:
-            ptr = "GSF Error encoding comment record";
-            break;
-
-         case GSF_HISTORY_RECORD_ENCODE_FAILED:
-            ptr = "GSF Error encoding history record";
-            break;
-
-         case GSF_NAV_ERROR_RECORD_ENCODE_FAILED:
-            ptr = "GSF Error encoding latitude/longitude navigation error record";
-            break;
-*/
-         case GSF_SETVBUF_ERROR:
-            ptr = "GSF Error setting internal file buffering";
-            break;
-
-         case GSF_FLUSH_ERROR:
-            ptr = "GSF Error flushing data buffer(s)";
-            break;
-
-         case GSF_FILE_TELL_ERROR:
-            ptr = "GSF Error file tell failed";
-            break;
-
-        case GSF_INDEX_FILE_OPEN_ERROR:
-            ptr = "GSF Error open of index file failed";
-            break;
-
-        case GSF_CORRUPT_INDEX_FILE_ERROR:
-            ptr = "GSF Error index file is corrupted, delete index file";
-            break;
-
-        case GSF_SCALE_INDEX_CALLOC_ERROR:
-            ptr = "GSF Error calloc of scale factor index memory failed";
-            break;
-
-        case GSF_RECORD_TYPE_NOT_AVAILABLE:
-            ptr = "GSF Error requested indexed record type not in gsf file";
-            break;
-
-        case GSF_SUMMARY_RECORD_DECODE_FAILED:
-            ptr = "GSF Error decoding summary record";
-            break;
-
-        case GSF_SUMMARY_RECORD_ENCODE_FAILED:
-            ptr = "GSF Error encoding summary record";
-            break;
-
-        case GSF_INVALID_NUM_BEAMS:
-            ptr = "GSF Error invalid number of beams";
-            break;
-
-        case GSF_INVALID_RECORD_NUMBER:
-            ptr = "GSF Error invalid record number";
-            break;
-
-        case GSF_INDEX_FILE_READ_ERROR:
-            ptr = "GSF Error index file read error";
-            break;
-
-        case GSF_PARAM_SIZE_FIXED:
-            ptr = "GSF Error unable to update existing file with increased record size";
-            break;
-
-        case GSF_HV_NAV_ERROR_RECORD_ENCODE_FAILED:
-            ptr = "GSF Error encoding horizontal/vertical navigation error record";
-            break;
-
-        case GSF_HV_NAV_ERROR_RECORD_DECODE_FAILED:
-            ptr = "GSF Error decoding horizontal/vertical navigation error record";
-            break;
-
-        case GSF_SINGLE_BEAM_ENCODE_FAILED:
-            ptr = "GSF Error single beam encode failure";
-            break;
-
-        case GSF_READ_TO_END_OF_FILE:
-            ptr = "GSF End of File Encountered";
-            break;
-
-        case GSF_OPEN_TEMP_FILE_FAILED:
-            ptr = "GSF Failed to open temporary file for index creation";
-            break;
-
-        case GSF_PARTIAL_RECORD_AT_END_OF_FILE:
-            ptr = "GSF corrupt/partial record at the end of the file";
-            break;
-
-        case GSF_QUALITY_FLAGS_DECODE_ERROR:
-            ptr = "GSF error decoding quality flags record";
-            break;
-
-        default:
-            ptr = "GSF unknown error";
-            break;
-    }
-
-    return (ptr);
-}
-
-/********************************************************************
- *
- * Function Name : gsfIndexTime
- *
- * Description : This function returns the time (Posix.4) associated with
- *  a specified record number and type.  It also returns the record number
- *  that was read.
- *
- * Inputs :
- *  handle = gsf file handle assigned by gsfOpen or gsfOpenBuffered
- *  record_type = record type to be retrieved
- *  record_number = record number to be retrieved (-1 will get the time
- *                  and record number of the last record of this type)
- *  sec = Posix.4 seconds
- *  nsec = Posix.4 nanoseconds
- *
- * Returns :
- *  This function returns the record number if successful, or -1 if an
- *  error occured.
- *
- * Error Conditions :
- *    GSF_RECORD_TYPE_NOT_AVAILABLE
- *
- ********************************************************************/
-
-int
-gsfIndexTime(int handle, int record_type, int record_number, time_t * sec, long *nsec)
-{
-    long long       addr;
-    int             offset;
-    INDEX_REC       index_rec;
-
-    if ((handle < 1) || (handle > GSF_MAX_OPEN_FILES))
-    {
-        gsfError = GSF_BAD_FILE_HANDLE;
-        return (-1);
-    }
-
-    /* Check the record_types to see if the requested type is available */
-    if (gsfFileTable[handle - 1].index_data.record_type[record_type] == -1)
-    {
-        gsfError = GSF_RECORD_TYPE_NOT_AVAILABLE;
-        return (-1);
-    }
-
-    /*  If the record number requested is -1, use the last record of
-     *  this type.
-     */
-    if (record_number == -1)
-    {
-        offset = gsfFileTable[handle - 1].index_data.number_of_records[record_type] - 1;
-    }
-    else
-    {
-        offset = record_number - 1;
-    }
-
-    /*  Compute the record address within the index file and read the
-     *  index record.
-     */
-    addr = gsfFileTable[handle - 1].index_data.start_addr[record_type] +
-        (offset * sizeof(INDEX_REC));
-    if (fseek(gsfFileTable[handle - 1].index_data.fp, addr, 0))
-    {
-        gsfError = GSF_FILE_SEEK_ERROR;
-        return (-1);
-    }
-    if (fread(&index_rec, sizeof(INDEX_REC), 1, gsfFileTable[handle - 1].index_data.fp) != 1)
-    {
-        gsfError = GSF_INDEX_FILE_READ_ERROR;
-        return (-1);
-    }
-    if (gsfFileTable[handle - 1].index_data.swap)
-    {
-        SwapLong((unsigned int *) &index_rec, 2);
-        SwapLongLong((long long *) &(index_rec.addr), 1);
-    }
-
-    /*  Store the time and return the record number.    */
-    *sec = index_rec.sec;
-    *nsec = index_rec.nsec;
-
-    return (offset+1);
-}
-
-/********************************************************************
- *
- * Function Name : gsfCheckSum
- *
- * Description :  This function computes and returns the modulo-32 form
- *                 byte-wise sum of the num_bytes starting at buff.
- *
- * Inputs :
- *  buff = a pointer to an unsigned char buffer containing the data
- *  num_bytes = a integer containing the number of bytes of data
- *
- * Returns : a gsfuLong (u_int) data type containing the computed checksum.
- *
- * Error Conditions :
- *
- ********************************************************************/
-
-static          gsfuLong
-gsfChecksum(unsigned char *buff, unsigned int num_bytes)
-{
-    unsigned char  *ptr;
-    gsfuLong        checkSum = 0;
-
-    /*
-    * Compute the checksum as the modulo-32 sum of all bytes
-    * between the checksum value and the end of the record.
-    */
-    for (ptr = buff; ptr < buff + num_bytes; ptr++)
-    {
-        checkSum += *ptr;
-    }
-    return checkSum;
-}
-
-/********************************************************************
- *
- * Function Name : gsfPercent
- *
- * Description : This function returns an integer value representing
- *  the location of the file pointer as a percentage of the total file
- *  size.  It may be used to obtain an indication of how far along a
- *  program is in reading a gsf data file.  The file size is obtained
- *  when the file is opened.
- *
- * Inputs :
- *  handle = gsf file handle assigned by gsfOpen or gsfOpenBuffered
- *
- * Returns :
- *  This function returns the current file position as a percentage of
- *  the file size, or -1 if an error occurred. gsfError will be set to
- *  indicate the error.
- *
- * Error Conditions :
- *  GSF_BAD_FILE_HANDLE
- *  GSF_FILE_TELL_ERROR
- *
- ********************************************************************/
-
-int
-gsfPercent (int handle)
-{
-    int             percent;
-    long long       addr, rc;
-
-    /* Clear gsfError each time down */
-    gsfError = 0;
-
-    /* JSB 04/05/00 replaced ">=" with ">" */
-    if ((handle < 1) || (handle > GSF_MAX_OPEN_FILES))
-    {
-        gsfError = GSF_BAD_FILE_HANDLE;
-        return (-1);
-    }
-
-    /* the file is no longer open */
-    if (!gsfFileTable[handle - 1].occupied)
-    {
-        gsfError = GSF_BAD_FILE_HANDLE;
-        return (-1);
-    }
-
-    /* Retreive the current file position */
-    rc = ftell (gsfFileTable[handle - 1].fp);
-    if (rc == -1)
-    {
-        gsfError = GSF_FILE_TELL_ERROR;
-        return (-1);
-    }
-    addr = rc;
-
-    percent = 0;
-    if (gsfFileTable[handle - 1].file_size > 0)
-    {
-        percent = 100.0 * (double)addr / (double)gsfFileTable[handle - 1].file_size;
-    }
-    return(percent);
-}
-
-/********************************************************************
- *
- * Function Name : gsfGetNumberRecods
- *
- * Description : This function will return the number of records of a
- *  given type to the caller. The number of records is retreived from
- *  the index file, so the file must have been opened for direct
- *  access (GSF_READONLY_INDEX, or GSF_UPDATE_INDEX).
- *
- * Inputs :
- *    handle = the handle to the file as provided by gsfOpen
- *    desiredRecord = the desired record or GSF_NEXT_RECORD
- *
- * Returns :
- *  This function returns the number of records of type desiredRecord
- *  contained in the GSF file designated by handle, or -1 if an error
- *  occured.
- *
- * Error Conditions :
- *  GSF_BAD_FILE_HANDLE
- *  GSF_BAD_ACCESS_MODE
- *
- ********************************************************************/
-
-int
-gsfGetNumberRecords (int handle, int desiredRecord)
-{
-    /* Clear gsfError each time down */
-    gsfError = 0;
-
-    /* JSB 04/05/00 replaced ">=" with ">" */
-    if ((handle < 1) || (handle > GSF_MAX_OPEN_FILES))
-    {
-        gsfError = GSF_BAD_FILE_HANDLE;
-        return (-1);
-    }
-
-    if ((desiredRecord < 0) || (desiredRecord > NUM_REC_TYPES))
-    {
-        gsfError = GSF_UNRECOGNIZED_RECORD_ID;
-        return (-1);
-    }
-
-    if (gsfFileTable[handle - 1].direct_access == 0)
-    {
-        gsfError = GSF_BAD_ACCESS_MODE;
-        return(-1);
-    }
-
-    return (gsfFileTable[handle - 1].index_data.number_of_records[desiredRecord]);
-}
-
-/********************************************************************
- *
- * Function Name : gsfCopyRecords
- *
- * Description : This function will copy all of the data contained in the
- *  source gsfRecords data structure to the target gsfRecords data
- *  structure. The target MUST be memset to zero before the first call to
- *  gsfCopyRecords.  This function allocates dynmanic memory which is NOT
- *  maintained by the library.  It is up to the calling application to
- *  release the memory allocated.  This may be done by maintaining the
- *  target data structure as static data, or by using gsfFree to release
- *  the memory.
- *
- * Inputs :
- *  target = a pointer to a gsfRecords data structure allocated by the
- *      calling application, into which the source data is to be copied.
- *  source = a pointer to a gsfRecords data structure allocated by the
- *      calling application, from which data is to be copied.
- *
- * Returns : This function returns zero if successful, or -1 if an error
- *  occurs.
- *
- * Error Conditions :
- *  GSF_MEMORY_ALLOCATION_FAILED
- *
- ********************************************************************/
-
-int
-gsfCopyRecords (gsfRecords *target, const gsfRecords *source)
-{
-    int             i;
-
-    gsfError = 0;
-
-    /* Copy the gsf header over to the  target */
-    memcpy(&target->header, &source->header, sizeof(target->header));
-
-    /* Copy the ping summary record over to the target */
-    memcpy(&target->summary, &source->summary, sizeof(target->summary));
-
-    /* Decide which arrays we need to allocate memory for */
-    if (source->mb_ping.depth != (double *) NULL)
-    {
-        if (target->mb_ping.depth == (double *) NULL)
-        {
-            target->mb_ping.depth = (double *) calloc (sizeof(double), source->mb_ping.number_beams);
-            if (target->mb_ping.depth == (double *) NULL)
-            {
-                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                return(-1);
-            }
-        }
-        else if (target->mb_ping.number_beams < source->mb_ping.number_beams)
-        {
-            target->mb_ping.depth = (double *) realloc (target->mb_ping.depth, sizeof(double) * source->mb_ping.number_beams);
-            if (target->mb_ping.depth == (double *) NULL)
-            {
-                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                return(-1);
-            }
-        }
-        memcpy (target->mb_ping.depth, source->mb_ping.depth, sizeof(double) * source->mb_ping.number_beams);
-    }
-
-    /* Decide which arrays we need to allocate memory for */
-    if (source->mb_ping.nominal_depth != (double *) NULL)
-    {
-        if (target->mb_ping.nominal_depth == (double *) NULL)
-        {
-            target->mb_ping.nominal_depth = (double *) calloc (sizeof(double), source->mb_ping.number_beams);
-            if (target->mb_ping.nominal_depth == (double *) NULL)
-            {
-                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                return(-1);
-            }
-        }
-        else if (target->mb_ping.number_beams < source->mb_ping.number_beams)
-        {
-            target->mb_ping.nominal_depth = (double *) realloc (target->mb_ping.nominal_depth, sizeof(double) * source->mb_ping.number_beams);
-            if (target->mb_ping.nominal_depth == (double *) NULL)
-            {
-                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                return(-1);
-            }
-        }
-        memcpy (target->mb_ping.nominal_depth, source->mb_ping.nominal_depth, sizeof(double) * source->mb_ping.number_beams);
-    }
-
-    if (source->mb_ping.across_track != (double *) NULL)
-    {
-        if (target->mb_ping.across_track == (double *) NULL)
-        {
-            target->mb_ping.across_track = (double *) calloc (sizeof(double), source->mb_ping.number_beams);
-            if (target->mb_ping.across_track == (double *) NULL)
-            {
-                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                return(-1);
-            }
-        }
-        else if (target->mb_ping.number_beams < source->mb_ping.number_beams)
-        {
-            target->mb_ping.across_track = (double *) realloc (target->mb_ping.across_track, sizeof(double) * source->mb_ping.number_beams);
-            if (target->mb_ping.across_track == (double *) NULL)
-            {
-                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                return(-1);
-            }
-        }
-        memcpy (target->mb_ping.across_track, source->mb_ping.across_track, sizeof(double) * source->mb_ping.number_beams);
-    }
-
-    if (source->mb_ping.along_track != (double *) NULL)
-    {
-        if (target->mb_ping.along_track == (double *) NULL)
-        {
-            target->mb_ping.along_track = (double *) calloc (sizeof(double), source->mb_ping.number_beams);
-            if (target->mb_ping.along_track == (double *) NULL)
-            {
-                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                return(-1);
-            }
-        }
-        else if (target->mb_ping.number_beams < source->mb_ping.number_beams)
-        {
-            target->mb_ping.along_track = (double *) realloc (target->mb_ping.along_track, sizeof(double) * source->mb_ping.number_beams);
-            if (target->mb_ping.along_track == (double *) NULL)
-            {
-                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                return(-1);
-            }
-        }
-        memcpy (target->mb_ping.along_track, source->mb_ping.along_track, sizeof(double) * source->mb_ping.number_beams);
-    }
-
-    if (source->mb_ping.travel_time != (double *) NULL)
-    {
-        if (target->mb_ping.travel_time == (double *) NULL)
-        {
-            target->mb_ping.travel_time = (double *) calloc (sizeof(double), source->mb_ping.number_beams);
-            if (target->mb_ping.travel_time == (double *) NULL)
-            {
-                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                return(-1);
-            }
-        }
-        else if (target->mb_ping.number_beams < source->mb_ping.number_beams)
-        {
-            target->mb_ping.travel_time = (double *) realloc (target->mb_ping.travel_time, sizeof(double) * source->mb_ping.number_beams);
-            if (target->mb_ping.travel_time == (double *) NULL)
-            {
-                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                return(-1);
-            }
-        }
-        memcpy (target->mb_ping.travel_time, source->mb_ping.travel_time, sizeof(double) * source->mb_ping.number_beams);
-    }
-
-    if (source->mb_ping.beam_angle != (double *) NULL)
-    {
-        if (target->mb_ping.beam_angle == (double *) NULL)
-        {
-            target->mb_ping.beam_angle = (double *) calloc (sizeof(double), source->mb_ping.number_beams);
-            if (target->mb_ping.beam_angle == (double *) NULL)
-            {
-                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                return(-1);
-            }
-        }
-        else if (target->mb_ping.number_beams < source->mb_ping.number_beams)
-        {
-            target->mb_ping.beam_angle = (double *) realloc (target->mb_ping.beam_angle, sizeof(double) * source->mb_ping.number_beams);
-            if (target->mb_ping.beam_angle == (double *) NULL)
-            {
-                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                return(-1);
-            }
-        }
-        memcpy (target->mb_ping.beam_angle, source->mb_ping.beam_angle, sizeof(double) * source->mb_ping.number_beams);
-    }
-
-    if (source->mb_ping.mc_amplitude != (double *) NULL)
-    {
-        if (target->mb_ping.mc_amplitude == (double *) NULL)
-        {
-            target->mb_ping.mc_amplitude = (double *) calloc (sizeof(double), source->mb_ping.number_beams);
-            if (target->mb_ping.mc_amplitude == (double *) NULL)
-            {
-                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                return(-1);
-            }
-        }
-        else if (target->mb_ping.number_beams < source->mb_ping.number_beams)
-        {
-            target->mb_ping.mc_amplitude = (double *) realloc (target->mb_ping.mc_amplitude, sizeof(double) * source->mb_ping.number_beams);
-            if (target->mb_ping.mc_amplitude == (double *) NULL)
-            {
-                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                return(-1);
-            }
-        }
-        memcpy (target->mb_ping.mc_amplitude, source->mb_ping.mc_amplitude, sizeof(double) * source->mb_ping.number_beams);
-    }
-
-    if (source->mb_ping.mr_amplitude != (double *) NULL)
-    {
-        if (target->mb_ping.mr_amplitude == (double *) NULL)
-        {
-            target->mb_ping.mr_amplitude = (double *) calloc (sizeof(double), source->mb_ping.number_beams);
-            if (target->mb_ping.mr_amplitude == (double *) NULL)
-            {
-                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                return(-1);
-            }
-        }
-        else if (target->mb_ping.number_beams < source->mb_ping.number_beams)
-        {
-            target->mb_ping.mr_amplitude = (double *) realloc (target->mb_ping.mr_amplitude, sizeof(double) * source->mb_ping.number_beams);
-            if (target->mb_ping.mr_amplitude == (double *) NULL)
-            {
-                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                return(-1);
-            }
-        }
-        memcpy (target->mb_ping.mr_amplitude, source->mb_ping.mr_amplitude, sizeof(double) * source->mb_ping.number_beams);
-    }
-
-    if (source->mb_ping.echo_width != (double *) NULL)
-    {
-        if (target->mb_ping.echo_width == (double *) NULL)
-        {
-            target->mb_ping.echo_width = (double *) calloc (sizeof(double), source->mb_ping.number_beams);
-            if (target->mb_ping.echo_width == (double *) NULL)
-            {
-                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                return(-1);
-            }
-        }
-        else if (target->mb_ping.number_beams < source->mb_ping.number_beams)
-        {
-            target->mb_ping.echo_width = (double *) realloc (target->mb_ping.echo_width, sizeof(double) * source->mb_ping.number_beams);
-            if (target->mb_ping.echo_width == (double *) NULL)
-            {
-                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                return(-1);
-            }
-        }
-        memcpy (target->mb_ping.echo_width, source->mb_ping.echo_width, sizeof(double) * source->mb_ping.number_beams);
-    }
-
-    if (source->mb_ping.quality_factor != (double *) NULL)
-    {
-        if (target->mb_ping.quality_factor == (double *) NULL)
-        {
-            target->mb_ping.quality_factor = (double *) calloc (sizeof(double), source->mb_ping.number_beams);
-            if (target->mb_ping.quality_factor == (double *) NULL)
-            {
-                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                return(-1);
-            }
-        }
-        else if (target->mb_ping.number_beams < source->mb_ping.number_beams)
-        {
-            target->mb_ping.quality_factor = (double *) realloc (target->mb_ping.quality_factor, sizeof(double) * source->mb_ping.number_beams);
-            if (target->mb_ping.quality_factor == (double *) NULL)
-            {
-                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                return(-1);
-            }
-        }
-        memcpy (target->mb_ping.quality_factor, source->mb_ping.quality_factor, sizeof(double) * source->mb_ping.number_beams);
-    }
-
-    if (source->mb_ping.receive_heave != (double *) NULL)
-    {
-        if (target->mb_ping.receive_heave == (double *) NULL)
-        {
-            target->mb_ping.receive_heave = (double *) calloc (sizeof(double), source->mb_ping.number_beams);
-            if (target->mb_ping.receive_heave == (double *) NULL)
-            {
-                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                return(-1);
-            }
-        }
-        else if (target->mb_ping.number_beams < source->mb_ping.number_beams)
-        {
-            target->mb_ping.receive_heave = (double *) realloc (target->mb_ping.receive_heave, sizeof(double) * source->mb_ping.number_beams);
-            if (target->mb_ping.receive_heave == (double *) NULL)
-            {
-                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                return(-1);
-            }
-        }
-        memcpy (target->mb_ping.receive_heave, source->mb_ping.receive_heave, sizeof(double) * source->mb_ping.number_beams);
-    }
-
-    if (source->mb_ping.depth_error != (double *) NULL)
-    {
-        if (target->mb_ping.depth_error == (double *) NULL)
-        {
-            target->mb_ping.depth_error = (double *) calloc (sizeof(double), source->mb_ping.number_beams);
-            if (target->mb_ping.depth_error == (double *) NULL)
-            {
-                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                return(-1);
-            }
-        }
-        else if (target->mb_ping.number_beams < source->mb_ping.number_beams)
-        {
-            target->mb_ping.depth_error = (double *) realloc (target->mb_ping.depth_error, sizeof(double) * source->mb_ping.number_beams);
-            if (target->mb_ping.depth_error == (double *) NULL)
-            {
-                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                return(-1);
-            }
-        }
-        memcpy (target->mb_ping.depth_error, source->mb_ping.depth_error, sizeof(double) * source->mb_ping.number_beams);
-    }
-
-    if (source->mb_ping.across_track_error != (double *) NULL)
-    {
-        if (target->mb_ping.across_track_error == (double *) NULL)
-        {
-            target->mb_ping.across_track_error = (double *) calloc (sizeof(double), source->mb_ping.number_beams);
-            if (target->mb_ping.across_track_error == (double *) NULL)
-            {
-                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                return(-1);
-            }
-        }
-        else if (target->mb_ping.number_beams < source->mb_ping.number_beams)
-        {
-            target->mb_ping.across_track_error = (double *) realloc (target->mb_ping.across_track_error, sizeof(double) * source->mb_ping.number_beams);
-            if (target->mb_ping.across_track_error == (double *) NULL)
-            {
-                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                return(-1);
-            }
-        }
-        memcpy (target->mb_ping.across_track_error, source->mb_ping.across_track_error, sizeof(double) * source->mb_ping.number_beams);
-    }
-
-    if (source->mb_ping.along_track_error != (double *) NULL)
-    {
-        if (target->mb_ping.along_track_error == (double *) NULL)
-        {
-            target->mb_ping.along_track_error = (double *) calloc (sizeof(double), source->mb_ping.number_beams);
-            if (target->mb_ping.along_track_error == (double *) NULL)
-            {
-                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                return(-1);
-            }
-        }
-        else if (target->mb_ping.number_beams < source->mb_ping.number_beams)
-        {
-            target->mb_ping.along_track_error = (double *) realloc (target->mb_ping.along_track_error, sizeof(double) * source->mb_ping.number_beams);
-            if (target->mb_ping.along_track_error == (double *) NULL)
-            {
-                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                return(-1);
-            }
-        }
-        memcpy (target->mb_ping.along_track_error, source->mb_ping.along_track_error, sizeof(double) * source->mb_ping.number_beams);
-    }
-
-    if (source->mb_ping.quality_flags != (unsigned char *) NULL)
-    {
-        if (target->mb_ping.quality_flags == (unsigned char *) NULL)
-        {
-            target->mb_ping.quality_flags = (unsigned char *) calloc (sizeof(unsigned char), source->mb_ping.number_beams);
-            if (target->mb_ping.quality_flags == (unsigned char *) NULL)
-            {
-                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                return(-1);
-            }
-        }
-        else if (target->mb_ping.number_beams < source->mb_ping.number_beams)
-        {
-            target->mb_ping.quality_flags = (unsigned char *) realloc (target->mb_ping.quality_flags, sizeof(unsigned char) * source->mb_ping.number_beams);
-            if (target->mb_ping.quality_flags == (unsigned char *) NULL)
-            {
-                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                return(-1);
-            }
-        }
-        memcpy (target->mb_ping.quality_flags, source->mb_ping.quality_flags, sizeof(unsigned char) * source->mb_ping.number_beams);
-    }
-
-    if (source->mb_ping.beam_flags != (unsigned char *) NULL)
-    {
-        if (target->mb_ping.beam_flags == (unsigned char *) NULL)
-        {
-            target->mb_ping.beam_flags = (unsigned char *) calloc (sizeof(unsigned char), source->mb_ping.number_beams);
-            if (target->mb_ping.beam_flags == (unsigned char *) NULL)
-            {
-                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                return(-1);
-            }
-        }
-        else if (target->mb_ping.number_beams < source->mb_ping.number_beams)
-        {
-            target->mb_ping.beam_flags = (unsigned char *) realloc (target->mb_ping.beam_flags, sizeof(unsigned char) * source->mb_ping.number_beams);
-            if (target->mb_ping.beam_flags == (unsigned char *) NULL)
-            {
-                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                return(-1);
-            }
-        }
-        memcpy (target->mb_ping.beam_flags, source->mb_ping.beam_flags, sizeof(unsigned char) * source->mb_ping.number_beams);
-    }
-
-    if (source->mb_ping.signal_to_noise != (double *) NULL)
-    {
-        if (target->mb_ping.signal_to_noise == (double *) NULL)
-        {
-            target->mb_ping.signal_to_noise = (double *) calloc (sizeof(double), source->mb_ping.number_beams);
-            if (target->mb_ping.signal_to_noise == (double *) NULL)
-            {
-                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                return(-1);
-            }
-        }
-        else if (target->mb_ping.number_beams < source->mb_ping.number_beams)
-        {
-            target->mb_ping.signal_to_noise = (double *) realloc (target->mb_ping.signal_to_noise, sizeof(double) * source->mb_ping.number_beams);
-            if (target->mb_ping.signal_to_noise == (double *) NULL)
-            {
-                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                return(-1);
-            }
-        }
-        memcpy (target->mb_ping.signal_to_noise, source->mb_ping.signal_to_noise, sizeof(double) * source->mb_ping.number_beams);
-    }
-
-    if (source->mb_ping.beam_angle_forward != (double *) NULL)
-    {
-        if (target->mb_ping.beam_angle_forward == (double *) NULL)
-        {
-            target->mb_ping.beam_angle_forward = (double *) calloc (sizeof(double), source->mb_ping.number_beams);
-            if (target->mb_ping.beam_angle_forward == (double *) NULL)
-            {
-                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                return(-1);
-            }
-        }
-        else if (target->mb_ping.number_beams < source->mb_ping.number_beams)
-        {
-            target->mb_ping.beam_angle_forward = (double *) realloc (target->mb_ping.beam_angle_forward, sizeof(double) * source->mb_ping.number_beams);
-            if (target->mb_ping.beam_angle_forward == (double *) NULL)
-            {
-                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                return(-1);
-            }
-        }
-        memcpy (target->mb_ping.beam_angle_forward, source->mb_ping.beam_angle_forward, sizeof(double) * source->mb_ping.number_beams);
-    }
-
-    if (source->mb_ping.vertical_error != (double *) NULL)
-    {
-        if (target->mb_ping.vertical_error == (double *) NULL)
-        {
-            target->mb_ping.vertical_error = (double *) calloc (sizeof(double), source->mb_ping.number_beams);
-            if (target->mb_ping.vertical_error == (double *) NULL)
-            {
-                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                return(-1);
-            }
-        }
-        else if (target->mb_ping.number_beams < source->mb_ping.number_beams)
-        {
-            target->mb_ping.vertical_error = (double *) realloc (target->mb_ping.vertical_error, sizeof(double) * source->mb_ping.number_beams);
-            if (target->mb_ping.vertical_error == (double *) NULL)
-            {
-                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                return(-1);
-            }
-        }
-        memcpy (target->mb_ping.vertical_error, source->mb_ping.vertical_error, sizeof(double) * source->mb_ping.number_beams);
-    }
-
-    if (source->mb_ping.horizontal_error != (double *) NULL)
-    {
-        if (target->mb_ping.horizontal_error == (double *) NULL)
-        {
-            target->mb_ping.horizontal_error = (double *) calloc (sizeof(double), source->mb_ping.number_beams);
-            if (target->mb_ping.horizontal_error == (double *) NULL)
-            {
-                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                return(-1);
-            }
-        }
-        else if (target->mb_ping.number_beams < source->mb_ping.number_beams)
-        {
-            target->mb_ping.horizontal_error = (double *) realloc (target->mb_ping.horizontal_error, sizeof(double) * source->mb_ping.number_beams);
-            if (target->mb_ping.horizontal_error == (double *) NULL)
-            {
-                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                return(-1);
-            }
-        }
-        memcpy (target->mb_ping.horizontal_error, source->mb_ping.horizontal_error, sizeof(double) * source->mb_ping.number_beams);
-    }
-
-    if (source->mb_ping.sector_number != (unsigned short *) NULL)
-    {
-        if (target->mb_ping.sector_number == (unsigned short *) NULL)
-        {
-            target->mb_ping.sector_number = (unsigned short *) calloc (sizeof(unsigned short), source->mb_ping.number_beams);
-            if (target->mb_ping.sector_number == (unsigned short *) NULL)
-            {
-                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                return(-1);
-            }
-        }
-        else if (target->mb_ping.number_beams < source->mb_ping.number_beams)
-        {
-            target->mb_ping.sector_number = (unsigned short *) realloc (target->mb_ping.sector_number, sizeof(unsigned short) * source->mb_ping.number_beams);
-            if (target->mb_ping.sector_number == (unsigned short *) NULL)
-            {
-                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                return(-1);
-            }
-        }
-        memcpy (target->mb_ping.sector_number, source->mb_ping.sector_number, sizeof(unsigned short) * source->mb_ping.number_beams);
-    }
-
-    if (source->mb_ping.detection_info != (unsigned short *) NULL)
-    {
-        if (target->mb_ping.detection_info == (unsigned short *) NULL)
-        {
-            target->mb_ping.detection_info = (unsigned short *) calloc (sizeof(unsigned short), source->mb_ping.number_beams);
-            if (target->mb_ping.detection_info == (unsigned short *) NULL)
-            {
-                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                return(-1);
-            }
-        }
-        else if (target->mb_ping.number_beams < source->mb_ping.number_beams)
-        {
-            target->mb_ping.detection_info = (unsigned short *) realloc (target->mb_ping.detection_info, sizeof(unsigned short) * source->mb_ping.number_beams);
-            if (target->mb_ping.detection_info == (unsigned short *) NULL)
-            {
-                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                return(-1);
-            }
-        }
-        memcpy (target->mb_ping.detection_info, source->mb_ping.detection_info, sizeof(unsigned short) * source->mb_ping.number_beams);
-    }
-
-    if (source->mb_ping.incident_beam_adj != (double *) NULL)
-    {
-        if (target->mb_ping.incident_beam_adj == (double *) NULL)
-        {
-            target->mb_ping.incident_beam_adj = (double *) calloc (sizeof(double), source->mb_ping.number_beams);
-            if (target->mb_ping.incident_beam_adj == (double *) NULL)
-            {
-                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                return(-1);
-            }
-        }
-        else if (target->mb_ping.number_beams < source->mb_ping.number_beams)
-        {
-            target->mb_ping.incident_beam_adj = (double *) realloc (target->mb_ping.incident_beam_adj, sizeof(double) * source->mb_ping.number_beams);
-            if (target->mb_ping.incident_beam_adj == (double *) NULL)
-            {
-                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                return(-1);
-            }
-        }
-        memcpy (target->mb_ping.incident_beam_adj, source->mb_ping.incident_beam_adj, sizeof(double) * source->mb_ping.number_beams);
-    }
-
-    if (source->mb_ping.system_cleaning != (unsigned short *) NULL)
-    {
-        if (target->mb_ping.system_cleaning == (unsigned short *) NULL)
-        {
-            target->mb_ping.system_cleaning = (unsigned short *) calloc (sizeof(unsigned short), source->mb_ping.number_beams);
-            if (target->mb_ping.system_cleaning == (unsigned short *) NULL)
-            {
-                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                return(-1);
-            }
-        }
-        else if (target->mb_ping.number_beams < source->mb_ping.number_beams)
-        {
-            target->mb_ping.system_cleaning = (unsigned short *) realloc (target->mb_ping.system_cleaning, sizeof(unsigned short) * source->mb_ping.number_beams);
-            if (target->mb_ping.system_cleaning == (unsigned short *) NULL)
-            {
-                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                return(-1);
-            }
-        }
-        memcpy (target->mb_ping.system_cleaning, source->mb_ping.system_cleaning, sizeof(unsigned short) * source->mb_ping.number_beams);
-    }
-
-    if (source->mb_ping.doppler_corr != (double *) NULL)
-    {
-        if (target->mb_ping.doppler_corr == (double *) NULL)
-        {
-            target->mb_ping.doppler_corr = (double *) calloc (sizeof(double), source->mb_ping.number_beams);
-            if (target->mb_ping.doppler_corr == (double *) NULL)
-            {
-                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                return(-1);
-            }
-        }
-        else if (target->mb_ping.number_beams < source->mb_ping.number_beams)
-        {
-            target->mb_ping.doppler_corr = (double *) realloc (target->mb_ping.doppler_corr, sizeof(double) * source->mb_ping.number_beams);
-            if (target->mb_ping.doppler_corr == (double *) NULL)
-            {
-                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                return(-1);
-            }
-        }
-        memcpy (target->mb_ping.doppler_corr, source->mb_ping.doppler_corr, sizeof(double) * source->mb_ping.number_beams);
-    }
-
-    if (source->mb_ping.brb_inten != (gsfBRBIntensity *) NULL)
-    {
-        if (target->mb_ping.brb_inten == (gsfBRBIntensity *) NULL)
-        {
-            target->mb_ping.brb_inten = (gsfBRBIntensity *) calloc (sizeof(gsfBRBIntensity), 1);
-            if (target->mb_ping.brb_inten == (gsfBRBIntensity *) NULL)
-            {
-                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                return(-1);
-            }
-        }
-
-        target->mb_ping.brb_inten->bits_per_sample     = source->mb_ping.brb_inten->bits_per_sample;
-        target->mb_ping.brb_inten->applied_corrections = source->mb_ping.brb_inten->applied_corrections;
-        target->mb_ping.brb_inten->sensor_imagery      = source->mb_ping.brb_inten->sensor_imagery;
-        memcpy (&target->mb_ping.brb_inten->spare, &source->mb_ping.brb_inten->spare, 16);
-
-        if (source->mb_ping.brb_inten->time_series != (gsfTimeSeriesIntensity *) NULL)
-        {
-            if (target->mb_ping.brb_inten->time_series == (gsfTimeSeriesIntensity *) NULL)
-            {
-                target->mb_ping.brb_inten->time_series = (gsfTimeSeriesIntensity *) calloc (sizeof(gsfTimeSeriesIntensity), source->mb_ping.number_beams);
-                if (target->mb_ping.brb_inten->time_series == (gsfTimeSeriesIntensity *) NULL)
-                {
-                    gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                    return(-1);
-                }
-            }
-            else if (target->mb_ping.number_beams < source->mb_ping.number_beams)
-            {
-                target->mb_ping.brb_inten->time_series = (gsfTimeSeriesIntensity *) realloc (target->mb_ping.brb_inten->time_series, sizeof(gsfTimeSeriesIntensity) * source->mb_ping.number_beams);
-                if (target->mb_ping.brb_inten->time_series == (gsfTimeSeriesIntensity *) NULL)
-                {
-                    gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                    return(-1);
-                }
-            }
-
-            for (i = 0; i < source->mb_ping.number_beams; i++)
-            {
-                if (source->mb_ping.brb_inten->time_series[i].samples != (unsigned int *) NULL)
-                {
-                    if (target->mb_ping.brb_inten->time_series[i].samples == (unsigned int *) NULL)
-                    {
-                        target->mb_ping.brb_inten->time_series[i].samples = (unsigned int *) calloc (sizeof(unsigned int), source->mb_ping.brb_inten->time_series[i].sample_count);
-                        if (target->mb_ping.brb_inten->time_series[i].samples == (unsigned int *) NULL)
-                        {
-                            gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                            return(-1);
-                        }
-                    }
-                    else if (target->mb_ping.brb_inten->time_series[i].sample_count < source->mb_ping.brb_inten->time_series[i].sample_count)
-                    {
-                        target->mb_ping.brb_inten->time_series[i].samples = (unsigned int *) realloc (target->mb_ping.brb_inten->time_series[i].samples, sizeof(unsigned int) * source->mb_ping.brb_inten->time_series[i].sample_count);
-                        if (target->mb_ping.brb_inten->time_series[i].samples == (unsigned int *) NULL)
-                        {
-                            gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                            return(-1);
-                        }
-                    }
-                    memcpy (target->mb_ping.brb_inten->time_series[i].samples, source->mb_ping.brb_inten->time_series[i].samples, sizeof(unsigned int) * source->mb_ping.brb_inten->time_series[i].sample_count);
-                    target->mb_ping.brb_inten->time_series[i].sample_count = source->mb_ping.brb_inten->time_series[i].sample_count;
-                    target->mb_ping.brb_inten->time_series[i].detect_sample = source->mb_ping.brb_inten->time_series[i].detect_sample;
-                }
-            }
-        }
-    }
-
-    /* Copy the swath bathymetry ping record over to the target by moving
-     * the data over one item at a time so we don't overwrite the arrays.
-     */
-    target->mb_ping.ping_time           = source->mb_ping.ping_time;
-    target->mb_ping.latitude            = source->mb_ping.latitude;
-    target->mb_ping.longitude           = source->mb_ping.longitude;
-    target->mb_ping.number_beams        = source->mb_ping.number_beams;
-    target->mb_ping.center_beam         = source->mb_ping.center_beam;
-    target->mb_ping.ping_flags          = source->mb_ping.ping_flags;
-    target->mb_ping.reserved            = source->mb_ping.reserved;
-    target->mb_ping.tide_corrector      = source->mb_ping.tide_corrector;
-    target->mb_ping.gps_tide_corrector  = source->mb_ping.gps_tide_corrector;
-    target->mb_ping.depth_corrector     = source->mb_ping.depth_corrector;
-    target->mb_ping.heading             = source->mb_ping.heading;
-    target->mb_ping.pitch               = source->mb_ping.pitch;
-    target->mb_ping.roll                = source->mb_ping.roll;
-    target->mb_ping.heave               = source->mb_ping.heave;
-    target->mb_ping.course              = source->mb_ping.course;
-    target->mb_ping.speed               = source->mb_ping.speed;
-    target->mb_ping.height              = source->mb_ping.height;
-    target->mb_ping.sep                 = source->mb_ping.sep;
-    target->mb_ping.scaleFactors        = source->mb_ping.scaleFactors;
-    target->mb_ping.sensor_id           = source->mb_ping.sensor_id;
-    target->mb_ping.sensor_data         = source->mb_ping.sensor_data;
-
-    /* Now hande the sound velocity profile dynamic memory */
-    if (target->svp.depth == (double *) NULL)
-    {
-        target->svp.depth = (double *) calloc (sizeof(double), source->svp.number_points);
-        if (target->svp.depth == (double *) NULL)
-        {
-            gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-            return(-1);
-        }
-        memcpy (target->svp.depth, source->svp.depth, sizeof(double) * source->svp.number_points);
-    }
-    else if (target->svp.number_points < source->svp.number_points)
-    {
-        target->svp.depth = (double *) realloc (target->svp.depth, sizeof(double) * source->svp.number_points);
-        if (target->svp.depth == (double *) NULL)
-        {
-            gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-            return(-1);
-        }
-        memcpy (target->svp.depth, source->svp.depth, sizeof(double) * source->svp.number_points);
-    }
-
-    if (target->svp.sound_speed == (double *) NULL)
-    {
-        target->svp.sound_speed = (double *) calloc (sizeof(double), source->svp.number_points);
-        if (target->svp.sound_speed == (double *) NULL)
-        {
-            gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-            return(-1);
-        }
-        memcpy (target->svp.sound_speed, source->svp.sound_speed, sizeof(double) * source->svp.number_points);
-    }
-    else if (target->svp.number_points < source->svp.number_points)
-    {
-        target->svp.sound_speed = (double *) realloc (target->svp.sound_speed, sizeof(double) * source->svp.number_points);
-        if (target->svp.sound_speed == (double *) NULL)
-        {
-            gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-            return(-1);
-        }
-        memcpy (target->svp.sound_speed, source->svp.sound_speed, sizeof(double) * source->svp.number_points);
-    }
-
-    /* Copy the sound velocity profile record from the source to the target */
-    target->svp.observation_time = source->svp.observation_time;
-    target->svp.application_time = source->svp.application_time;
-    target->svp.latitude         = source->svp.latitude;
-    target->svp.longitude        = source->svp.longitude;
-    target->svp.number_points    = source->svp.number_points;
-
-    /* Copy the processing parameters from the source to the target */
-    target->process_parameters.param_time        = source->process_parameters.param_time;
-    target->process_parameters.number_parameters = source->process_parameters.number_parameters;
-    for (i=0; i<source->process_parameters.number_parameters; i++)
-    {
-        if (target->process_parameters.param[i] == (char *) NULL)
-        {
-            target->process_parameters.param[i] = (char *) calloc (sizeof(char), source->process_parameters.param_size[i] + 1);
-            if (target->process_parameters.param[i] == (char *) NULL)
-            {
-                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                return(-1);
-            }
-            strncpy (target->process_parameters.param[i], source->process_parameters.param[i], source->process_parameters.param_size[i] + 1);
-            target->process_parameters.param_size[i] = source->process_parameters.param_size[i];
-        }
-        else if (target->process_parameters.param_size[i] < source->process_parameters.param_size[i])
-        {
-            target->process_parameters.param[i] = (char *) realloc (target->process_parameters.param[i], source->process_parameters.param_size[i] + 1);
-            if (target->process_parameters.param[i] == (char *) NULL)
-            {
-                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                return(-1);
-            }
-            strncpy (target->process_parameters.param[i], source->process_parameters.param[i], source->process_parameters.param_size[i] + 1);
-            target->process_parameters.param_size[i] = source->process_parameters.param_size[i];
-        }
-    }
-
-    /* Copy the sensor parameters from the source to the target */
-    target->sensor_parameters.param_time        = source->sensor_parameters.param_time;
-    target->sensor_parameters.number_parameters = source->sensor_parameters.number_parameters;
-    for (i=0; i<source->sensor_parameters.number_parameters; i++)
-    {
-        if (target->sensor_parameters.param[i] == (char *) NULL)
-        {
-            target->sensor_parameters.param[i] = (char *) calloc (sizeof(char), source->sensor_parameters.param_size[i] + 1);
-            if (target->sensor_parameters.param[i] == (char *) NULL)
-            {
-                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                return(-1);
-            }
-            strncpy (target->sensor_parameters.param[i], source->sensor_parameters.param[i], source->sensor_parameters.param_size[i] + 1);
-            target->sensor_parameters.param_size[i] = source->sensor_parameters.param_size[i];
-        }
-        else if (target->sensor_parameters.param_size[i] < source->sensor_parameters.param_size[i])
-        {
-            target->sensor_parameters.param[i] = (char *) realloc (target->sensor_parameters.param[i], source->sensor_parameters.param_size[i] + 1);
-            if (target->sensor_parameters.param[i] == (char *) NULL)
-            {
-                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                return(-1);
-            }
-            strncpy (target->sensor_parameters.param[i], source->sensor_parameters.param[i], source->sensor_parameters.param_size[i] + 1);
-            target->sensor_parameters.param_size[i] = source->sensor_parameters.param_size[i];
-        }
-    }
-
-    /* Copy the comment from the source to the target */
-    target->comment.comment_time = source->comment.comment_time;
-    target->comment.comment_length = source->comment.comment_length;
-    if (source->comment.comment_length > 0)
-    {
-        if (target->comment.comment == (char *) NULL)
-        {
-            target->comment.comment = (char *) calloc (sizeof(char), source->comment.comment_length + 1);
-            if (target->comment.comment == (char *) NULL)
-            {
-                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                return(-1);
-            }
-            strncpy (target->comment.comment, source->comment.comment, source->comment.comment_length + 1);
-            target->comment.comment_length = source->comment.comment_length;
-        }
-        else if (target->comment.comment_length < source->comment.comment_length)
-        {
-            target->comment.comment = (char *) realloc (target->comment.comment, source->comment.comment_length + 1);
-            if (target->comment.comment == (char *) NULL)
-            {
-                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                return(-1);
-            }
-            strncpy (target->comment.comment, source->comment.comment, source->comment.comment_length + 1);
-            target->comment.comment_length = source->comment.comment_length;
-        }
-    }
-
-    /* Copy the history record from the source to the target */
-    target->history.history_time = source->history.history_time;
-    strncpy(target->history.host_name, source->history.host_name, GSF_HOST_NAME_LENGTH);
-    strncpy(target->history.operator_name, source->history.operator_name, GSF_OPERATOR_LENGTH);
-
-    if (target->history.command_line != (char *) NULL)
-    {
-        free(target->history.command_line);
-    }
-    if (source->history.command_line != (char *) NULL)
-    {
-        target->history.command_line = (char *) calloc (sizeof(char), strlen(source->history.command_line) + 1);
-        if (target->history.command_line == (char *) NULL)
-        {
-            gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-            return(-1);
-        }
-        strncpy(target->history.command_line, source->history.command_line, strlen (source->history.command_line) + 1);
-    }
-
-    if (target->history.comment != (char *) NULL)
-    {
-        free(target->history.comment);
-    }
-    if (source->history.comment != (char *) NULL)
-    {
-        target->history.comment = (char *) calloc (sizeof(char), strlen(source->history.comment) + 1);
-        if (target->history.comment == (char *) NULL)
-        {
-            gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-            return(-1);
-        }
-        strncpy(target->history.comment, source->history.comment, strlen (source->history.comment) + 1);
-    }
-
-    /* Copy the navigation error record from the source to the target */
-    target->nav_error = source->nav_error;
-
-    /* Copy the HV navigation error record from the source to the target */
-    target->hv_nav_error = source->hv_nav_error;
-
-    /* Now hande the attitude record dynamic memory */
-    if (target->attitude.attitude_time == (struct timespec *) NULL)
-    {
-        target->attitude.attitude_time = (struct timespec *) calloc (sizeof(struct timespec), source->attitude.num_measurements);
-        if (target->attitude.attitude_time == (struct timespec *) NULL)
-        {
-            gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-            return(-1);
-        }
-        memcpy (target->attitude.attitude_time, source->attitude.attitude_time, sizeof(struct timespec) * source->attitude.num_measurements);
-    }
-    else if (target->attitude.num_measurements < source->attitude.num_measurements)
-    {
-        target->attitude.attitude_time = (struct timespec *) realloc (target->attitude.attitude_time, sizeof(struct timespec) * source->attitude.num_measurements);
-        if (target->attitude.attitude_time == (struct timespec *) NULL)
-        {
-            gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-            return(-1);
-        }
-        memcpy (target->attitude.attitude_time, source->attitude.attitude_time, sizeof(struct timespec) * source->attitude.num_measurements);
-    }
-
-    if (target->attitude.roll == (double *) NULL)
-    {
-        target->attitude.roll = (double *) calloc (sizeof(double), source->attitude.num_measurements);
-        if (target->attitude.roll == (double *) NULL)
-        {
-            gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-            return(-1);
-        }
-        memcpy (target->attitude.roll, source->attitude.roll, sizeof(double) * source->attitude.num_measurements);
-    }
-    else if (target->attitude.num_measurements < source->attitude.num_measurements)
-    {
-        target->attitude.roll = (double *) realloc (target->attitude.roll, sizeof(double) * source->attitude.num_measurements);
-        if (target->attitude.roll == (double *) NULL)
-        {
-            gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-            return(-1);
-        }
-        memcpy (target->attitude.roll, source->attitude.roll, sizeof(double) * source->attitude.num_measurements);
-    }
-
-    if (target->attitude.pitch == (double *) NULL)
-    {
-        target->attitude.pitch = (double *) calloc (sizeof(double), source->attitude.num_measurements);
-        if (target->attitude.pitch == (double *) NULL)
-        {
-            gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-            return(-1);
-        }
-        memcpy (target->attitude.pitch, source->attitude.pitch, sizeof(double) * source->attitude.num_measurements);
-    }
-    else if (target->attitude.num_measurements < source->attitude.num_measurements)
-    {
-        target->attitude.pitch = (double *) realloc (target->attitude.pitch, sizeof(double) * source->attitude.num_measurements);
-        if (target->attitude.pitch == (double *) NULL)
-        {
-            gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-            return(-1);
-        }
-        memcpy (target->attitude.pitch, source->attitude.pitch, sizeof(double) * source->attitude.num_measurements);
-    }
-
-    if (target->attitude.heave == (double *) NULL)
-    {
-        target->attitude.heave = (double *) calloc (sizeof(double), source->attitude.num_measurements);
-        if (target->attitude.heave == (double *) NULL)
-        {
-            gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-            return(-1);
-        }
-        memcpy (target->attitude.heave, source->attitude.heave, sizeof(double) * source->attitude.num_measurements);
-    }
-    else if (target->attitude.num_measurements < source->attitude.num_measurements)
-    {
-        target->attitude.heave = (double *) realloc (target->attitude.heave, sizeof(double) * source->attitude.num_measurements);
-        if (target->attitude.heave == (double *) NULL)
-        {
-            gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-            return(-1);
-        }
-        memcpy (target->attitude.heave, source->attitude.heave, sizeof(double) * source->attitude.num_measurements);
-    }
-
-    if (target->attitude.heading == (double *) NULL)
-    {
-        target->attitude.heading = (double *) calloc (sizeof(double), source->attitude.num_measurements);
-        if (target->attitude.heading == (double *) NULL)
-        {
-            gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-            return(-1);
-        }
-        memcpy (target->attitude.heading, source->attitude.heading, sizeof(double) * source->attitude.num_measurements);
-    }
-    else if (target->attitude.num_measurements < source->attitude.num_measurements)
-    {
-        target->attitude.heading = (double *) realloc (target->attitude.heading, sizeof(double) * source->attitude.num_measurements);
-        if (target->attitude.heading == (double *) NULL)
-        {
-            gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-            return(-1);
-        }
-        memcpy (target->attitude.heading, source->attitude.heading, sizeof(double) * source->attitude.num_measurements);
-    }
-
-    /* Copy the sound velocity profile record from the source to the target */
-    target->attitude.num_measurements    = source->attitude.num_measurements;
-
-    return(0);
-}
-
-/********************************************************************
- *
- * Function Name : gsfSetParam
- *
- * Description : This function allocates memory for the keyword=value
- *     style parameter and copies the parameter into the allocated space.
- *
- * Inputs :
- *     handle = an integer value containing the file handle, set by gsfOpen
- *     index  = an integer value specifing the index into the processing
- *         parameters array into which the value is to be written.
- *     val = a pointer to the character string containing the parameter.
- *     rec = a pointer to the gsfRecords data structure into which the
- *         parameter is written
- *
- * Returns : This function returns zero if successful, or -1 if an error
- *  occurs.
- *
- * Error Conditions :
- *     GSF_MEMORY_ALLOCATION_FAILED
- *     GSF_PARAM_SIZE_FIXED
- *
- ********************************************************************/
-
-static int
-gsfSetParam(int handle, int index, char *val, gsfRecords *rec)
-{
-    int             len;
-    char           *ptr;
-
-    if ((handle < 1) || (handle > GSF_MAX_OPEN_FILES))
-    {
-        gsfError = GSF_BAD_FILE_HANDLE;
-        return (-1);
-    }
-
-    len = strlen (val);
-    ptr = gsfFileTable[handle-1].rec.process_parameters.param[index];
-    if (ptr == (char *) NULL)
-    {
-        ptr = (char *) calloc (len+1, sizeof(char));
-        if (ptr == (char *) NULL)
-        {
-            gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-            return (-1);
-        }
-    }
-    /* If memory has already been allocated, make sure we have enough space */
-    else if (gsfFileTable[handle-1].rec.process_parameters.param_size[index] < len)
-    {
-        /* If the output file is open update, we cannot write a parameter
-         * bigger in size than the one that exists on the disk now.
-         */
-        if ((gsfFileTable[handle-1].access_mode == GSF_UPDATE) ||
-            (gsfFileTable[handle-1].access_mode == GSF_UPDATE_INDEX))
-        {
-            gsfError = GSF_PARAM_SIZE_FIXED;
-            return(-1);
-        }
-        ptr = (char *) realloc((void *) ptr, len + 1);
-        if (ptr == (char *) NULL)
-        {
-            gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-            return (-1);
-        }
-    }
-    gsfFileTable[handle-1].rec.process_parameters.param[index] = ptr;
-    gsfFileTable[handle-1].rec.process_parameters.param_size[index] = len;
-    rec->process_parameters.param[index] = ptr;
-    rec->process_parameters.param_size[index] = len;
-    strncpy(rec->process_parameters.param[index], val, len+1);
-
-    return(0);
-}
-
-/********************************************************************
- *
- * Function Name : gsfPutMBParams
- *
- * Description : This function moves swath bathymetry sonar processing
- *    parameters from internal form to "KEYWORD=VALUE" form.  The internal
- *    form parameters are read from an MB_PARAMETERS data structure maintained
- *    by the caller.  The "KEYWORD=VALUE" form parameters are written into the
- *    processing_parameters structure of the gsfRecords data structure
- *    maitained by the caller. Parameters for up to two pairs of
- *    transmit/receive arrays are supported, for systems such as Reson SeaBat
- *    9002.
- *
- * Inputs :
- *     p = a pointer to the gsfMBParams data structure which contains
- *         the parameters in internal form.
- *     rec = a pointer to the gsfRecords data structure into which the
- *         parameters are to be written in the "KEYWORK=VALUE" form.
- *     handle = the integer handle to the file set by gsfOpen.
- *     numArrays = the integer value specifying the number of pairs of
- *         arrays which need to have separate parameters tracked.
- *
- * Returns : This function returns zero if successful, or -1 if an error
- *  occurs.
- *
- * Error Conditions :
- *     GSF_MEMORY_ALLOCATION_FAILED
- *     GSF_PARAM_SIZE_FIXED
- *
- ********************************************************************/
-int
-gsfPutMBParams(const gsfMBParams *p, gsfRecords *rec, int handle, int numArrays)
-{
-    char            temp[256];
-    char            temp2[64];
-    int             ret;
-    int             number_parameters = 0, num_tx = 0, num_rx = 0;
-
-    if ((handle < 1) || (handle > GSF_MAX_OPEN_FILES))
-    {
-        gsfError = GSF_BAD_FILE_HANDLE;
-        return (-1);
-    }
-
-    /* If the file is open update, we do not want to allow a write with
-     * a larger number of parameters than currently exist.
-     */
-    if ((gsfFileTable[handle-1].access_mode == GSF_UPDATE) ||
-        (gsfFileTable[handle-1].access_mode == GSF_UPDATE_INDEX))
-    {
-        if ((gsfFileTable[handle-1].rec.process_parameters.number_parameters > 0) &&
-            (gsfFileTable[handle-1].rec.process_parameters.number_parameters < GSF_NUMBER_PROCESSING_PARAMS))
-        {
-            gsfError = GSF_PARAM_SIZE_FIXED;
-            return(-1);
-        }
-    }
-
-    /* Load the text descriptor for the start of time epoch */
-    sprintf(temp, "REFERENCE TIME=1970/001 00:00:00");
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return(-1);
-    }
-
-    if ((p->number_of_transmitters < 1) || (p->number_of_transmitters > GSF_MAX_OFFSETS))
-        num_tx = numArrays;
-    else
-        num_tx = p->number_of_transmitters;
-
-    if ((p->number_of_receivers < 1) || (p->number_of_receivers > GSF_MAX_OFFSETS))
-        num_rx = numArrays;
-    else
-        num_rx = p->number_of_receivers;
-
-    /* DHG 2008/12/18 Add "PLATFORM_TYPE" Processing Parameter */
-
-    if (p->vessel_type == GSF_PLATFORM_TYPE_AUV)
-    {
-        sprintf (temp, "PLATFORM_TYPE=AUV");
-    }
-    else if (p->vessel_type == GSF_PLATFORM_TYPE_SURFACE_SHIP)
-    {
-        sprintf (temp, "PLATFORM_TYPE=SURFACE_SHIP");
-    }
-    else if (p->vessel_type == GSF_PLATFORM_TYPE_ROTV)
-    {
-        sprintf (temp, "PLATFORM_TYPE=ROTV");
-    }
-    ret = gsfSetParam (handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return (-1);
-    }
-
-    if (p->full_raw_data == GSF_TRUE)
-    {
-        sprintf (temp, "FULL_RAW_DATA=TRUE ");
-    }
-    else
-    {
-        sprintf (temp, "FULL_RAW_DATA=FALSE");
-    }
-    ret = gsfSetParam (handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return (-1);
-    }
-
-    /* This parameter indicates whether the depth data has been roll compensated */
-    if (p->roll_compensated == GSF_COMPENSATED)
-    {
-        sprintf(temp, "ROLL_COMPENSATED=YES");
-    }
-    else
-    {
-        sprintf(temp, "ROLL_COMPENSATED=NO ");
-    }
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return(-1);
-    }
-
-    /* This parameter indicates whether the depth data has been pitch compensated */
-    if (p->pitch_compensated == GSF_COMPENSATED)
-    {
-        sprintf(temp, "PITCH_COMPENSATED=YES");
-    }
-    else
-    {
-        sprintf(temp, "PITCH_COMPENSATED=NO ");
-    }
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return(-1);
-    }
-
-    /* This parameter indicates whether the depth has been heave compensated */
-    if (p->heave_compensated == GSF_COMPENSATED)
-    {
-        sprintf(temp, "HEAVE_COMPENSATED=YES");
-    }
-    else
-    {
-        sprintf(temp, "HEAVE_COMPENSATED=NO ");
-    }
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return(-1);
-    }
-
-    /* This parameter indicates whether the depth has been tide compensated */
-    if (p->tide_compensated == GSF_COMPENSATED)
-    {
-        sprintf(temp, "TIDE_COMPENSATED=YES");
-    }
-    else
-    {
-        sprintf(temp, "TIDE_COMPENSATED=NO ");
-    }
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return(-1);
-    }
-
-    /* This parameter indicates the number of receivers.
-     */
-    if ((num_rx >= 1) && (num_rx <= 2))
-    {
-        sprintf(temp, "NUMBER_OF_RECEIVERS=%d", num_rx);
-    }
-    else
-    {
-        sprintf(temp, "NUMBER_OF_RECEIVERS=%s", GSF_UNKNOWN_PARAM_TEXT);
-    }
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return(-1);
-    }
-
-    /* This parameter indicates the number of transmitters.
-     */
-    if ((num_tx >= 1) && (num_tx <= 2))
-    {
-        sprintf(temp, "NUMBER_OF_TRANSMITTERS=%d", num_tx);
-    }
-    else
-    {
-        sprintf(temp, "NUMBER_OF_TRANSMITTERS=%s", GSF_UNKNOWN_PARAM_TEXT);
-    }
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return(-1);
-    }
-
-    /* If the depth field of the swath bathy ping data structure is true depth,
-     * meaning depth is computed by indegrating travel time through the sound
-     * speed profile, then this parameter is set as DEPTH_CALCULATION=CORRECTED.
-     * If the depth field of the swath bathymetry ping data structure is
-     * relative to 1500 meters per second, then this parameter is set as
-     * DEPTH_CALCULATION=DEPTHS_RE_1500_MS.
-     */
-    if (p->depth_calculation == GSF_TRUE_DEPTHS)
-    {
-        sprintf(temp, "DEPTH_CALCULATION=CORRECTED");
-    }
-    else if (p->depth_calculation == GSF_DEPTHS_RE_1500_MS)
-    {
-        sprintf(temp, "DEPTH_CALCULATION=RELATIVE_TO_1500_MS");
-    }
-    else
-    {
-        sprintf(temp, "DEPTH_CALCULATION=UNKNOWN");
-    }
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return(-1);
-    }
-
-    /* This parameter indicates whether the angle travel time pairs
-     * have been corrected for ray tracing.
-     */
-    if (p->ray_tracing == GSF_COMPENSATED)
-    {
-        sprintf(temp, "RAY_TRACING=YES");
-    }
-    else
-    {
-        sprintf(temp, "RAY_TRACING=NO");
-    }
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return(-1);
-    }
-
-    /* This parameter indicates whether the motion sensor bias - measured from the
-     *  patch test has been added to the attitude (roll, pitch, heading) data.
-     */
-    if (p->msb_applied_to_attitude == GSF_TRUE)
-    {
-        sprintf(temp, "MSB_APPLIED_TO_ATTITUDE=YES");
-    }
-    else
-    {
-        sprintf(temp, "MSB_APPLIED_TO_ATTITUDE=NO");
-    }
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return(-1);
-    }
-
-    /* This parameter indicates whether the heave data has been subtracted from
-     *  the GPS tide corrector value.
-     */
-    if (p->heave_removed_from_gps_tc == GSF_TRUE)
-    {
-        sprintf(temp, "HEAVE_REMOVED_FROM_GPS_TC=YES");
-    }
-    else
-    {
-        sprintf(temp, "HEAVE_REMOVED_FROM_GPS_TC=NO");
-    }
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return(-1);
-    }
-
-    /* This parameter indicates the offset from UTC of the original data.
-     */
-    if ((p->utc_offset >= -12) && (p->utc_offset <= 12))
-    {
-        sprintf(temp, "UTC_OFFSET=%d", p->utc_offset);
-    }
-    else
-    {
-        sprintf(temp, "UTC_OFFSET=%s", GSF_UNKNOWN_PARAM_TEXT);
-    }
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return(-1);
-    }
-
-    /* This parameter indicates the roll reference type.
-     */
-    if (p->roll_reference == GSF_HORIZONTAL_PITCH_AXIS)
-    {
-        sprintf(temp, "ROLL_REFERENCE=HORIZONTAL_PITCH_AXIS");
-    }
-    else if (p->roll_reference == GSF_ROTATED_PITCH_AXIS)
-    {
-        sprintf(temp, "ROLL_REFERENCE=ROTATED_PITCH_AXIS");
-    }
-    else
-    {
-        sprintf(temp, "ROLL_REFERENCE=%s", GSF_UNKNOWN_PARAM_TEXT);
-    }
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret) {
-        return(-1);
-    }
-
-    /* The DRAFT_TO_APPLY parameter is a place holder for a new draft
-     * value which is known, but not yet applied.
-     */
-    if (num_tx == 1)
-    {
-        if (p->to_apply.draft[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp, "DRAFT_TO_APPLY=%s",
-                GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->to_apply.draft[0] > GSF_MIN_PARAM) && (p->to_apply.draft[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp, "DRAFT_TO_APPLY=%+06.2f",
-                p->to_apply.draft[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-    }
-    else if (num_tx == 2)
-    {
-        if (p->to_apply.draft[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp, "DRAFT_TO_APPLY=%s,",
-                GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->to_apply.draft[0] > GSF_MIN_PARAM) && (p->to_apply.draft[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp, "DRAFT_TO_APPLY=%+06.2f,",
-                p->to_apply.draft[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-
-        if (p->to_apply.draft[1] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf (temp2, "%s", GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->to_apply.draft[1] > GSF_MIN_PARAM) && (p->to_apply.draft[1] < GSF_MAX_PARAM))
-        {
-            sprintf (temp2, "%+06.2f", p->to_apply.draft[1]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat (temp, temp2);
-    }
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return(-1);
-    }
-
-    /* The PITCH_BIAS_TO_APPLY parameter is place holder for a pitch bias
-     * value which is known but not yet applied.
-     */
-    if (num_tx == 1)
-    {
-        if (p->to_apply.pitch_bias[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp, "PITCH_TO_APPLY=%s",
-                GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->to_apply.pitch_bias[0] > GSF_MIN_PARAM) && (p->to_apply.pitch_bias[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp, "PITCH_TO_APPLY=%+06.2f",
-                p->to_apply.pitch_bias[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-    }
-    else if (num_tx == 2)
-    {
-        if (p->to_apply.pitch_bias[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp, "PITCH_TO_APPLY=%s,",
-                GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->to_apply.pitch_bias[0] > GSF_MIN_PARAM) && (p->to_apply.pitch_bias[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp, "PITCH_TO_APPLY=%+06.2f,",
-                p->to_apply.pitch_bias[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        if (p->to_apply.pitch_bias[1] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf (temp2, "%s", GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->to_apply.pitch_bias[1] > GSF_MIN_PARAM) && (p->to_apply.pitch_bias[1] < GSF_MAX_PARAM))
-        {
-            sprintf (temp2, "%+06.2f", p->to_apply.pitch_bias[1]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat (temp, temp2);
-    }
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return(-1);
-    }
-
-    /* The ROLL_BIAS_TO_APPLY parameter is place holder for a roll bias value
-     * which is known, but not yet applied.
-     */
-    if (num_tx == 1)
-    {
-        if (p->to_apply.roll_bias[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp, "ROLL_TO_APPLY=%s",
-                GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->to_apply.roll_bias[0] > GSF_MIN_PARAM) && (p->to_apply.roll_bias[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp, "ROLL_TO_APPLY=%+06.2f",
-                p->to_apply.roll_bias[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-    }
-    else if (num_tx == 2)
-    {
-        if (p->to_apply.roll_bias[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp, "ROLL_TO_APPLY=%s,",
-                GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->to_apply.roll_bias[0] > GSF_MIN_PARAM) && (p->to_apply.roll_bias[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp, "ROLL_TO_APPLY=%+06.2f,",
-                p->to_apply.roll_bias[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        if (p->to_apply.roll_bias[1] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf (temp2, "%s", GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->to_apply.roll_bias[1] > GSF_MIN_PARAM) && (p->to_apply.roll_bias[1] < GSF_MAX_PARAM))
-        {
-            sprintf (temp2, "%+06.2f", p->to_apply.roll_bias[1]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat (temp, temp2);
-    }
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return(-1);
-    }
-
-    /* The GYRO_BIAS_TO_APPLY parameter is place holder for a gyro bias value
-     * which is known, but not yet applied.
-     */
-    if (num_tx == 1)
-    {
-        if (p->to_apply.gyro_bias[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp, "GYRO_TO_APPLY=%s",
-                GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->to_apply.gyro_bias[0] > GSF_MIN_PARAM) && (p->to_apply.gyro_bias[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp, "GYRO_TO_APPLY=%+06.2f",
-                p->to_apply.gyro_bias[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-    }
-    else if (num_tx == 2)
-    {
-        if (p->to_apply.gyro_bias[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp, "GYRO_TO_APPLY=%s,",
-                GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->to_apply.gyro_bias[0] > GSF_MIN_PARAM) && (p->to_apply.gyro_bias[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp, "GYRO_TO_APPLY=%+06.2f,",
-                p->to_apply.gyro_bias[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        if (p->to_apply.gyro_bias[1] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf (temp2, "%s", GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->to_apply.gyro_bias[1] > GSF_MIN_PARAM) && (p->to_apply.gyro_bias[1] < GSF_MAX_PARAM))
-        {
-            sprintf (temp2, "%+06.2f", p->to_apply.gyro_bias[1]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat (temp, temp2);
-    }
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return(-1);
-    }
-
-    /* The POSITION_OFFSET_TO_APPLY parameter is place holder for a position
-     *  offset which is known, but not yet applied.
-     */
-    memset(temp, 0, sizeof(temp));
-    sprintf(temp, "POSITION_OFFSET_TO_APPLY=");
-    if (p->to_apply.position_x_offset == GSF_UNKNOWN_PARAM_VALUE)
-    {
-        sprintf(temp2, "%s,",
-            GSF_UNKNOWN_PARAM_TEXT);
-    }
-    else if ((p->to_apply.position_x_offset > GSF_MIN_PARAM) && (p->to_apply.position_x_offset < GSF_MAX_PARAM))
-    {
-        sprintf(temp2, "%+06.2f,",
-            p->to_apply.position_x_offset);
-    }
-    else
-    {
-        gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-        return (-1);
-    }
-    strcat(temp, temp2);
-    if (p->to_apply.position_y_offset == GSF_UNKNOWN_PARAM_VALUE)
-    {
-        sprintf(temp2, "%s,", GSF_UNKNOWN_PARAM_TEXT);
-    }
-    else if ((p->to_apply.position_y_offset > GSF_MIN_PARAM) && (p->to_apply.position_y_offset < GSF_MAX_PARAM))
-    {
-        sprintf(temp2, "%+06.2f,",
-            p->to_apply.position_y_offset);
-    }
-    else
-    {
-        gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-        return (-1);
-    }
-    strcat(temp, temp2);
-    if (p->to_apply.position_z_offset == GSF_UNKNOWN_PARAM_VALUE)
-    {
-        sprintf(temp2, "%s", GSF_UNKNOWN_PARAM_TEXT);
-    }
-    else if ((p->to_apply.position_z_offset > GSF_MIN_PARAM) && (p->to_apply.position_z_offset < GSF_MAX_PARAM))
-    {
-        sprintf(temp2, "%+06.2f",
-            p->to_apply.position_z_offset);
-    }
-    else
-    {
-        gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-        return (-1);
-    }
-
-    strcat(temp, temp2);
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return(-1);
-    }
-
-    /* The ANTENNA_OFFSET_TO_APPLY parameter is place holder for a antenna
-     *  offset which is known, but not yet applied.
-     */
-    memset(temp, 0, sizeof(temp));
-    sprintf(temp, "ANTENNA_OFFSET_TO_APPLY=");
-    if (p->to_apply.antenna_x_offset == GSF_UNKNOWN_PARAM_VALUE)
-    {
-        sprintf(temp2, "%s,",
-            GSF_UNKNOWN_PARAM_TEXT);
-    }
-    else if ((p->to_apply.antenna_x_offset > GSF_MIN_PARAM) && (p->to_apply.antenna_x_offset < GSF_MAX_PARAM))
-    {
-        sprintf(temp2, "%+06.2f,",
-            p->to_apply.antenna_x_offset);
-    }
-    else
-    {
-        gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-        return (-1);
-    }
-    strcat(temp, temp2);
-    if (p->to_apply.antenna_y_offset == GSF_UNKNOWN_PARAM_VALUE)
-    {
-        sprintf(temp2, "%s,", GSF_UNKNOWN_PARAM_TEXT);
-    }
-    else if ((p->to_apply.antenna_y_offset > GSF_MIN_PARAM) && (p->to_apply.antenna_y_offset < GSF_MAX_PARAM))
-    {
-        sprintf(temp2, "%+06.2f,",
-            p->to_apply.antenna_y_offset);
-    }
-    else
-    {
-        gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-        return (-1);
-    }
-    strcat(temp, temp2);
-    if (p->to_apply.antenna_z_offset == GSF_UNKNOWN_PARAM_VALUE)
-    {
-        sprintf(temp2, "%s", GSF_UNKNOWN_PARAM_TEXT);
-    }
-    else if ((p->to_apply.antenna_z_offset > GSF_MIN_PARAM) && (p->to_apply.antenna_z_offset < GSF_MAX_PARAM))
-    {
-        sprintf(temp2, "%+06.2f",
-            p->to_apply.antenna_z_offset);
-    }
-    else
-    {
-        gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-        return (-1);
-    }
-    strcat(temp, temp2);
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return(-1);
-    }
-
-    /* The TRANSDUCER_OFFSET_TO_APPLY parameter is place holder for a
-     * transducer position offset which is known, but not yet applied.
-     */
-    memset(temp, 0, sizeof(temp));
-    sprintf(temp, "TRANSDUCER_OFFSET_TO_APPLY=");
-    if (num_tx == 1)
-    {
-        if (p->to_apply.transducer_x_offset[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp2, "%s,",
-                GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->to_apply.transducer_x_offset[0] > GSF_MIN_PARAM) && (p->to_apply.transducer_x_offset[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp2, "%+06.2f,",
-                p->to_apply.transducer_x_offset[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat(temp, temp2);
-        if (p->to_apply.transducer_y_offset[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp2, "%s,",
-                GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->to_apply.transducer_y_offset[0] > GSF_MIN_PARAM) && (p->to_apply.transducer_y_offset[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp2, "%+06.2f,",
-                p->to_apply.transducer_y_offset[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat(temp, temp2);
-        if (p->to_apply.transducer_z_offset[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp2, "%s", GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->to_apply.transducer_z_offset[0] > GSF_MIN_PARAM) && (p->to_apply.transducer_z_offset[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp2, "%+06.2f",
-                p->to_apply.transducer_z_offset[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat(temp, temp2);
-    }
-    else if (num_tx == 2)
-    {
-        if (p->to_apply.transducer_x_offset[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp2, "%s,",
-                GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->to_apply.transducer_x_offset[0] > GSF_MIN_PARAM) && (p->to_apply.transducer_x_offset[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp2, "%+06.2f,",
-                p->to_apply.transducer_x_offset[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat(temp, temp2);
-        if (p->to_apply.transducer_y_offset[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp2, "%s,",
-                GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->to_apply.transducer_y_offset[0] > GSF_MIN_PARAM) && (p->to_apply.transducer_y_offset[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp2, "%+06.2f,",
-                p->to_apply.transducer_y_offset[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat(temp, temp2);
-        if (p->to_apply.transducer_z_offset[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp2, "%s,",
-                GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->to_apply.transducer_z_offset[0] > GSF_MIN_PARAM) && (p->to_apply.transducer_z_offset[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp2, "%+06.2f,",
-                p->to_apply.transducer_z_offset[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat(temp, temp2);
-        if (p->to_apply.transducer_x_offset[1] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp2, "%s,",
-                GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->to_apply.transducer_x_offset[1] > GSF_MIN_PARAM) && (p->to_apply.transducer_x_offset[1] < GSF_MAX_PARAM))
-        {
-            sprintf(temp2, "%+06.2f,",
-                p->to_apply.transducer_x_offset[1]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat(temp, temp2);
-        if (p->to_apply.transducer_y_offset[1] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp2, "%s,",
-                GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->to_apply.transducer_y_offset[1] > GSF_MIN_PARAM) && (p->to_apply.transducer_y_offset[1] < GSF_MAX_PARAM))
-        {
-            sprintf(temp2, "%+06.2f,",
-                p->to_apply.transducer_y_offset[1]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat(temp, temp2);
-        if (p->to_apply.transducer_z_offset[1] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp2, "%s",
-                GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->to_apply.transducer_z_offset[1] > GSF_MIN_PARAM) && (p->to_apply.transducer_z_offset[1] < GSF_MAX_PARAM))
-        {
-            sprintf(temp2, "%+06.2f",
-                p->to_apply.transducer_z_offset[1]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat(temp, temp2);
-    }
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return(-1);
-    }
-
-    /* The TRANSDUCER_PITCH_OFFSET_TO_APPLY parameter is a place holder for a transducer pitch angle
-     *  installation offset which is known, but not yet applied.
-     */
-    if (num_tx == 1)
-    {
-        if (p->to_apply.transducer_pitch_offset[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp, "TRANSDUCER_PITCH_OFFSET_TO_APPLY=%s",
-                GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->to_apply.transducer_pitch_offset[0] > GSF_MIN_PARAM) && (p->to_apply.transducer_pitch_offset[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp, "TRANSDUCER_PITCH_OFFSET_TO_APPLY=%+06.2f",
-                p->to_apply.transducer_pitch_offset[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-    }
-    else if (num_tx == 2)
-    {
-        if (p->to_apply.transducer_pitch_offset[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp, "TRANSDUCER_PITCH_OFFSET_TO_APPLY=%s,", GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->to_apply.transducer_pitch_offset[0] > GSF_MIN_PARAM) && (p->to_apply.transducer_pitch_offset[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp, "TRANSDUCER_PITCH_OFFSET_TO_APPLY=%+06.2f,",
-                p->to_apply.transducer_pitch_offset[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        if (p->to_apply.transducer_pitch_offset[1] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf (temp2, "%s", GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->to_apply.transducer_pitch_offset[1] > GSF_MIN_PARAM) && (p->to_apply.transducer_pitch_offset[1] < GSF_MAX_PARAM))
-        {
-            sprintf (temp2, "%+06.2f", p->to_apply.transducer_pitch_offset[1]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat (temp, temp2);
-    }
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return(-1);
-    }
-
-    /* The TRANSDUCER_ROLL_OFFSET_TO_APPLY parameter is a place holder for a transducer roll angle
-     *  installation offset which is known, but not yet applied.
-     */
-    if (num_tx == 1)
-    {
-        if (p->to_apply.transducer_roll_offset[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp, "TRANSDUCER_ROLL_OFFSET_TO_APPLY=%s",
-                GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->to_apply.transducer_roll_offset[0] > GSF_MIN_PARAM) && (p->to_apply.transducer_roll_offset[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp, "TRANSDUCER_ROLL_OFFSET_TO_APPLY=%+06.2f",
-                p->to_apply.transducer_roll_offset[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-    }
-    else if (num_tx == 2)
-    {
-        if (p->to_apply.transducer_roll_offset[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp, "TRANSDUCER_ROLL_OFFSET_TO_APPLY=%s,", GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->to_apply.transducer_roll_offset[0] > GSF_MIN_PARAM) && (p->to_apply.transducer_roll_offset[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp, "TRANSDUCER_ROLL_OFFSET_TO_APPLY=%+06.2f,",
-                p->to_apply.transducer_roll_offset[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        if (p->to_apply.transducer_roll_offset[1] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf (temp2, "%s", GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->to_apply.transducer_roll_offset[1] > GSF_MIN_PARAM) && (p->to_apply.transducer_roll_offset[1] < GSF_MAX_PARAM))
-        {
-            sprintf (temp2, "%+06.2f", p->to_apply.transducer_roll_offset[1]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat (temp, temp2);
-    }
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return(-1);
-    }
-
-    /* The TRANSDUCER_HEADING_OFFSET_TO_APPLY parameter is a place holder for a transducer heading angle
-     *  installation offset which is known, but not yet applied.
-     */
-    if (num_tx == 1)
-    {
-        if (p->to_apply.transducer_heading_offset[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp, "TRANSDUCER_HEADING_OFFSET_TO_APPLY=%s",
-                GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->to_apply.transducer_heading_offset[0] > GSF_MIN_PARAM) && (p->to_apply.transducer_heading_offset[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp, "TRANSDUCER_HEADING_OFFSET_TO_APPLY=%+06.2f",
-                p->to_apply.transducer_heading_offset[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-    }
-    else if (num_tx == 2)
-    {
-        if (p->to_apply.transducer_heading_offset[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp, "TRANSDUCER_HEADING_OFFSET_TO_APPLY=%s,",
-                GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->to_apply.transducer_heading_offset[0] > GSF_MIN_PARAM) && (p->to_apply.transducer_heading_offset[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp, "TRANSDUCER_HEADING_OFFSET_TO_APPLY=%+06.2f,",
-                p->to_apply.transducer_heading_offset[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        if (p->to_apply.transducer_heading_offset[1] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf (temp2, "%s", GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->to_apply.transducer_heading_offset[1] > GSF_MIN_PARAM) && (p->to_apply.transducer_heading_offset[1] < GSF_MAX_PARAM))
-        {
-            sprintf (temp2, "%+06.2f", p->to_apply.transducer_heading_offset[1]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat (temp, temp2);
-    }
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return(-1);
-    }
-
-    /* The MRU_PITCH_TO_APPLY parameter is place holder for a motion
-     * sensor pitch bias value which is known but not yet applied.
-     */
-    memset(temp, 0, sizeof(temp));
-    if (p->to_apply.mru_pitch_bias == GSF_UNKNOWN_PARAM_VALUE)
-    {
-        sprintf(temp, "MRU_PITCH_TO_APPLY=%s",
-            GSF_UNKNOWN_PARAM_TEXT);
-    }
-    else if ((p->to_apply.mru_pitch_bias > GSF_MIN_PARAM) && (p->to_apply.mru_pitch_bias < GSF_MAX_PARAM))
-    {
-        sprintf(temp, "MRU_PITCH_TO_APPLY=%+06.2f",
-            p->to_apply.mru_pitch_bias);
-    }
-    else
-    {
-        gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-        return (-1);
-    }
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return(-1);
-    }
-
-    /* The MRU_ROLL_TO_APPLY parameter is place holder for a motion
-     * sensor roll bias value which is known but not yet applied.
-     */
-    memset(temp, 0, sizeof(temp));
-    if (p->to_apply.mru_roll_bias == GSF_UNKNOWN_PARAM_VALUE)
-    {
-        sprintf(temp, "MRU_ROLL_TO_APPLY=%s",
-            GSF_UNKNOWN_PARAM_TEXT);
-    }
-    else if ((p->to_apply.mru_roll_bias > GSF_MIN_PARAM) && (p->to_apply.mru_roll_bias < GSF_MAX_PARAM))
-    {
-        sprintf(temp, "MRU_ROLL_TO_APPLY=%+06.2f",
-            p->to_apply.mru_roll_bias);
-    }
-    else
-    {
-        gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-        return (-1);
-    }
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return(-1);
-    }
-
-    /* The MRU_HEADING_TO_APPLY parameter is place holder for a motion
-     * sensor heading bias value which is known but not yet applied.
-     */
-    memset(temp, 0, sizeof(temp));
-    if (p->to_apply.mru_heading_bias == GSF_UNKNOWN_PARAM_VALUE)
-    {
-        sprintf(temp, "MRU_HEADING_TO_APPLY=%s",
-            GSF_UNKNOWN_PARAM_TEXT);
-    }
-    else if ((p->to_apply.mru_heading_bias > GSF_MIN_PARAM) && (p->to_apply.mru_heading_bias < GSF_MAX_PARAM))
-    {
-        sprintf(temp, "MRU_HEADING_TO_APPLY=%+06.2f",
-            p->to_apply.mru_heading_bias);
-    }
-    else
-    {
-        gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-        return (-1);
-    }
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return(-1);
-    }
-
-    /* The MRU_OFFSET_TO_APPLY parameter is place holder for a mru
-     *  offset which is known, but not yet applied.
-     */
-    memset(temp, 0, sizeof(temp));
-    sprintf(temp, "MRU_OFFSET_TO_APPLY=");
-    if (p->to_apply.mru_x_offset == GSF_UNKNOWN_PARAM_VALUE)
-    {
-        sprintf(temp2, "%s,",
-            GSF_UNKNOWN_PARAM_TEXT);
-    }
-    else if ((p->to_apply.mru_x_offset > GSF_MIN_PARAM) && (p->to_apply.mru_x_offset < GSF_MAX_PARAM))
-    {
-        sprintf(temp2, "%+06.2f,",
-            p->to_apply.mru_x_offset);
-    }
-    else
-    {
-        gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-        return (-1);
-    }
-    strcat(temp, temp2);
-    if (p->to_apply.mru_y_offset == GSF_UNKNOWN_PARAM_VALUE)
-    {
-        sprintf(temp2, "%s,", GSF_UNKNOWN_PARAM_TEXT);
-    }
-    else if ((p->to_apply.mru_y_offset > GSF_MIN_PARAM) && (p->to_apply.mru_y_offset < GSF_MAX_PARAM))
-    {
-        sprintf(temp2, "%+06.2f,",
-            p->to_apply.mru_y_offset);
-    }
-    else
-    {
-        gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-        return (-1);
-    }
-    strcat(temp, temp2);
-    if (p->to_apply.mru_z_offset == GSF_UNKNOWN_PARAM_VALUE)
-    {
-        sprintf(temp2, "%s", GSF_UNKNOWN_PARAM_TEXT);
-    }
-    else if ((p->to_apply.mru_z_offset > GSF_MIN_PARAM) && (p->to_apply.mru_z_offset < GSF_MAX_PARAM))
-    {
-        sprintf(temp2, "%+06.2f",
-            p->to_apply.mru_z_offset);
-    }
-    else
-    {
-        gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-        return (-1);
-    }
-    strcat(temp, temp2);
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return(-1);
-    }
-
-    /* The CENTER_OF_ROTATION_OFFSET_TO_APPLY parameter is place holder for a mru
-     *  offset which is known, but not yet applied.
-     */
-    memset(temp, 0, sizeof(temp));
-    sprintf(temp, "CENTER_OF_ROTATION_OFFSET_TO_APPLY=");
-    if (p->to_apply.center_of_rotation_x_offset == GSF_UNKNOWN_PARAM_VALUE)
-    {
-        sprintf(temp2, "%s,",
-            GSF_UNKNOWN_PARAM_TEXT);
-    }
-    else if ((p->to_apply.center_of_rotation_x_offset > GSF_MIN_PARAM) && (p->to_apply.center_of_rotation_x_offset < GSF_MAX_PARAM))
-    {
-        sprintf(temp2, "%+06.2f,",
-            p->to_apply.center_of_rotation_x_offset);
-    }
-    else
-    {
-        gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-        return (-1);
-    }
-    strcat(temp, temp2);
-    if (p->to_apply.center_of_rotation_y_offset == GSF_UNKNOWN_PARAM_VALUE)
-    {
-        sprintf(temp2, "%s,", GSF_UNKNOWN_PARAM_TEXT);
-    }
-    else if ((p->to_apply.center_of_rotation_y_offset > GSF_MIN_PARAM) && (p->to_apply.center_of_rotation_y_offset < GSF_MAX_PARAM))
-    {
-        sprintf(temp2, "%+06.2f,",
-            p->to_apply.center_of_rotation_y_offset);
-    }
-    else
-    {
-        gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-        return (-1);
-    }
-    strcat(temp, temp2);
-    if (p->to_apply.center_of_rotation_z_offset == GSF_UNKNOWN_PARAM_VALUE)
-    {
-        sprintf(temp2, "%s", GSF_UNKNOWN_PARAM_TEXT);
-    }
-    else if ((p->to_apply.center_of_rotation_z_offset > GSF_MIN_PARAM) && (p->to_apply.center_of_rotation_z_offset < GSF_MAX_PARAM))
-    {
-        sprintf(temp2, "%+06.2f",
-            p->to_apply.center_of_rotation_z_offset);
-    }
-    else
-    {
-        gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-        return (-1);
-    }
-    strcat(temp, temp2);
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return(-1);
-    }
-
-    /* The POSITION_LATENCY_TO_APPLY parameter is a place holder for a navigation
-     * sensor latency value which is known but not yet applied.
-     */
-    memset(temp, 0, sizeof(temp));
-    if (p->to_apply.position_latency == GSF_UNKNOWN_PARAM_VALUE)
-    {
-        sprintf(temp, "POSITION_LATENCY_TO_APPLY=%s",
-            GSF_UNKNOWN_PARAM_TEXT);
-    }
-    else if ((p->to_apply.position_latency > GSF_MIN_PARAM) && (p->to_apply.position_latency < GSF_MAX_PARAM))
-    {
-        sprintf(temp, "POSITION_LATENCY_TO_APPLY=%+06.3f",
-            p->to_apply.position_latency);
-    }
-    else
-    {
-        gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-        return (-1);
-    }
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return(-1);
-    }
-
-    /* The ATTITUDE_LATENCY_TO_APPLY parameter is a place holder for an attitude
-     * sensor latency value which is known but not yet applied.
-     */
-    memset(temp, 0, sizeof(temp));
-    if (p->to_apply.attitude_latency == GSF_UNKNOWN_PARAM_VALUE)
-    {
-        sprintf(temp, "ATTITUDE_LATENCY_TO_APPLY=%s",
-            GSF_UNKNOWN_PARAM_TEXT);
-    }
-    else if ((p->to_apply.attitude_latency > GSF_MIN_PARAM) && (p->to_apply.attitude_latency < GSF_MAX_PARAM))
-    {
-        sprintf(temp, "ATTITUDE_LATENCY_TO_APPLY=%+06.3f",
-            p->to_apply.attitude_latency);
-    }
-    else
-    {
-        gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-        return (-1);
-    }
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return(-1);
-    }
-
-    /* The DEPTH_SENSOR_LATENCY_TO_APPLY parameter is a place holder for a depth
-     *  sensor latency value which is known but not yet applied.
-     */
-    memset(temp, 0, sizeof(temp));
-    if (p->to_apply.depth_sensor_latency == GSF_UNKNOWN_PARAM_VALUE)
-    {
-        sprintf(temp, "DEPTH_SENSOR_LATENCY_TO_APPLY=%s",
-            GSF_UNKNOWN_PARAM_TEXT);
-    }
-    else if ((p->to_apply.depth_sensor_latency > GSF_MIN_PARAM) && (p->to_apply.depth_sensor_latency < GSF_MAX_PARAM))
-    {
-        sprintf(temp, "DEPTH_SENSOR_LATENCY_TO_APPLY=%+06.3f",
-            p->to_apply.depth_sensor_latency);
-    }
-    else
-    {
-        gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-        return (-1);
-    }
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return(-1);
-    }
-
-    /* The DEPTH_SENSOR_OFFSET_TO_APPLY parameter is place holder for a depth
-     *  sensor offset which is known, but not yet applied.
-     */
-    if (p->to_apply.depth_sensor_x_offset == GSF_UNKNOWN_PARAM_VALUE)
-    {
-        sprintf(temp, "DEPTH_SENSOR_OFFSET_TO_APPLY=%s,", GSF_UNKNOWN_PARAM_TEXT);
-    }
-    else if ((p->to_apply.depth_sensor_x_offset > GSF_MIN_PARAM) && (p->to_apply.depth_sensor_x_offset < GSF_MAX_PARAM))
-    {
-        sprintf(temp, "DEPTH_SENSOR_OFFSET_TO_APPLY=%+06.2f,",
-                p->to_apply.depth_sensor_x_offset);
-    }
-    else
-    {
-        gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-        return (-1);
-    }
-    if (p->to_apply.depth_sensor_y_offset == GSF_UNKNOWN_PARAM_VALUE)
-    {
-        sprintf(temp2, "%s,", GSF_UNKNOWN_PARAM_TEXT);
-    }
-    else if ((p->to_apply.depth_sensor_y_offset > GSF_MIN_PARAM) && (p->to_apply.depth_sensor_y_offset < GSF_MAX_PARAM))
-    {
-        sprintf(temp2, "%+06.2f,",
-            p->to_apply.depth_sensor_y_offset);
-    }
-    else
-    {
-        gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-        return (-1);
-    }
-    strcat (temp, temp2);
-    if (p->to_apply.depth_sensor_z_offset == GSF_UNKNOWN_PARAM_VALUE)
-    {
-        sprintf(temp2, "%s", GSF_UNKNOWN_PARAM_TEXT);
-    }
-    else if ((p->to_apply.depth_sensor_z_offset > GSF_MIN_PARAM) && (p->to_apply.depth_sensor_z_offset < GSF_MAX_PARAM))
-    {
-        sprintf(temp2, "%+06.2f", p->to_apply.depth_sensor_z_offset);
-    }
-    else
-    {
-        gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-        return (-1);
-    }
-    strcat (temp, temp2);
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return(-1);
-    }
-
-    /* The RX_TRANSDUCER_OFFSET_TO_APPLY parameter is place holder for a
-     * receiver position offset which is known, but not yet applied.
-     */
-    sprintf (temp, "RX_TRANSDUCER_OFFSET_TO_APPLY=");
-    if (num_rx == 1)
-    {
-        if (p->to_apply.rx_transducer_x_offset[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp2, "%s,", GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->to_apply.rx_transducer_x_offset[0] > GSF_MIN_PARAM) && (p->to_apply.rx_transducer_x_offset[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp2, "%+06.2f,", p->to_apply.rx_transducer_x_offset[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat (temp, temp2);
-        if (p->to_apply.rx_transducer_y_offset[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp2, "%s,", GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->to_apply.rx_transducer_y_offset[0] > GSF_MIN_PARAM) && (p->to_apply.rx_transducer_y_offset[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp2, "%+06.2f,", p->to_apply.rx_transducer_y_offset[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat (temp, temp2);
-        if (p->to_apply.rx_transducer_z_offset[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp2, "%s", GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->to_apply.rx_transducer_z_offset[0] > GSF_MIN_PARAM) && (p->to_apply.rx_transducer_z_offset[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp2, "%+06.2f", p->to_apply.rx_transducer_z_offset[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat (temp, temp2);
-    }
-    else if (num_rx == 2)
-    {
-        if (p->to_apply.rx_transducer_x_offset[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp2, "%s,", GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->to_apply.rx_transducer_x_offset[0] > GSF_MIN_PARAM) && (p->to_apply.rx_transducer_x_offset[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp2, "%+06.2f,", p->to_apply.rx_transducer_x_offset[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat (temp, temp2);
-        if (p->to_apply.rx_transducer_y_offset[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp2, "%s,", GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->to_apply.rx_transducer_y_offset[0] > GSF_MIN_PARAM) && (p->to_apply.rx_transducer_y_offset[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp2, "%+06.2f,", p->to_apply.rx_transducer_y_offset[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat (temp, temp2);
-        if (p->to_apply.rx_transducer_z_offset[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp2, "%s,", GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->to_apply.rx_transducer_z_offset[0] > GSF_MIN_PARAM) && (p->to_apply.rx_transducer_z_offset[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp2, "%+06.2f,", p->to_apply.rx_transducer_z_offset[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat (temp, temp2);
-        if (p->to_apply.rx_transducer_x_offset[1] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp2, "%s,", GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->to_apply.rx_transducer_x_offset[1] > GSF_MIN_PARAM) && (p->to_apply.rx_transducer_x_offset[1] < GSF_MAX_PARAM))
-        {
-            sprintf(temp2, "%+06.2f,", p->to_apply.rx_transducer_x_offset[1]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat (temp, temp2);
-        if (p->to_apply.rx_transducer_y_offset[1] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp2, "%s,", GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->to_apply.rx_transducer_y_offset[1] > GSF_MIN_PARAM) && (p->to_apply.rx_transducer_y_offset[1] < GSF_MAX_PARAM))
-        {
-            sprintf(temp2, "%+06.2f,", p->to_apply.rx_transducer_y_offset[1]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat (temp, temp2);
-        if (p->to_apply.rx_transducer_z_offset[1] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp2, "%s", GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->to_apply.rx_transducer_z_offset[1] > GSF_MIN_PARAM) && (p->to_apply.rx_transducer_z_offset[1] < GSF_MAX_PARAM))
-        {
-            sprintf(temp2, "%+06.2f", p->to_apply.rx_transducer_z_offset[1]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat (temp, temp2);
-    }
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return(-1);
-    }
-
-    /* The RX_TRANSDUCER_PITCH_TO_APPLY parameter is place holder for a
-     * receiver pitch offset which is known, but not yet applied.
-     */
-    sprintf (temp, "RX_TRANSDUCER_PITCH_OFFSET_TO_APPLY=");
-    if (num_rx == 1)
-    {
-        if (p->to_apply.rx_transducer_pitch_offset[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp2, "%s", GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->to_apply.rx_transducer_pitch_offset[0] > GSF_MIN_PARAM) && (p->to_apply.rx_transducer_pitch_offset[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp2, "%+06.2f", p->to_apply.rx_transducer_pitch_offset[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat (temp, temp2);
-    }
-    else if (num_rx == 2)
-    {
-        if (p->to_apply.rx_transducer_pitch_offset[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp2, "%s,", GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->to_apply.rx_transducer_pitch_offset[0] > GSF_MIN_PARAM) && (p->to_apply.rx_transducer_pitch_offset[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp2, "%+06.2f,", p->to_apply.rx_transducer_pitch_offset[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat (temp, temp2);
-        if (p->to_apply.rx_transducer_pitch_offset[1] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp2, "%s", GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->to_apply.rx_transducer_pitch_offset[1] > GSF_MIN_PARAM) && (p->to_apply.rx_transducer_pitch_offset[1] < GSF_MAX_PARAM))
-        {
-            sprintf(temp2, "%+06.2f", p->to_apply.rx_transducer_pitch_offset[1]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat (temp, temp2);
-    }
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return(-1);
-    }
-
-    /* The RX_TRANSDUCER_ROLL_TO_APPLY parameter is place holder for a
-     * receiver roll offset which is known, but not yet applied.
-     */
-    sprintf (temp, "RX_TRANSDUCER_ROLL_OFFSET_TO_APPLY=");
-    if (num_rx == 1)
-    {
-        if (p->to_apply.rx_transducer_roll_offset[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp2, "%s", GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->to_apply.rx_transducer_roll_offset[0] > GSF_MIN_PARAM) && (p->to_apply.rx_transducer_roll_offset[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp2, "%+06.2f", p->to_apply.rx_transducer_roll_offset[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat (temp, temp2);
-    }
-    else if (num_rx == 2)
-    {
-        if (p->to_apply.rx_transducer_roll_offset[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp2, "%s,", GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->to_apply.rx_transducer_roll_offset[0] > GSF_MIN_PARAM) && (p->to_apply.rx_transducer_roll_offset[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp2, "%+06.2f,", p->to_apply.rx_transducer_roll_offset[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat (temp, temp2);
-        if (p->to_apply.rx_transducer_roll_offset[1] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp2, "%s", GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->to_apply.rx_transducer_roll_offset[1] > GSF_MIN_PARAM) && (p->to_apply.rx_transducer_roll_offset[1] < GSF_MAX_PARAM))
-        {
-            sprintf(temp2, "%+06.2f", p->to_apply.rx_transducer_roll_offset[1]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat (temp, temp2);
-    }
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return(-1);
-    }
-
-    /* The RX_TRANSDUCER_HEADING_TO_APPLY parameter is place holder for a
-     * receiver heading offset which is known, but not yet applied.
-     */
-    sprintf (temp, "RX_TRANSDUCER_HEADING_OFFSET_TO_APPLY=");
-    if (num_rx == 1)
-    {
-        if (p->to_apply.rx_transducer_heading_offset[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp2, "%s", GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->to_apply.rx_transducer_heading_offset[0] > GSF_MIN_PARAM) && (p->to_apply.rx_transducer_heading_offset[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp2, "%+06.2f", p->to_apply.rx_transducer_heading_offset[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat (temp, temp2);
-    }
-    else if (num_rx == 2)
-    {
-        if (p->to_apply.rx_transducer_heading_offset[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp2, "%s,", GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->to_apply.rx_transducer_heading_offset[0] > GSF_MIN_PARAM) && (p->to_apply.rx_transducer_heading_offset[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp2, "%+06.2f,", p->to_apply.rx_transducer_heading_offset[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat (temp, temp2);
-        if (p->to_apply.rx_transducer_heading_offset[1] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp2, "%s", GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->to_apply.rx_transducer_heading_offset[1] > GSF_MIN_PARAM) && (p->to_apply.rx_transducer_heading_offset[1] < GSF_MAX_PARAM))
-        {
-            sprintf(temp2, "%+06.2f", p->to_apply.rx_transducer_heading_offset[1]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat (temp, temp2);
-    }
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return(-1);
-    }
-
-    /***** end of "to apply" parameters, on to "applied" ****/
-
-    /* The APPLIED_DRAFT parameter defines the transducer draft value
-     * previously applied to the depths.
-     */
-    if (num_tx == 1)
-    {
-        if (p->applied.draft[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp, "APPLIED_DRAFT=%s",
-                GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->applied.draft[0] > GSF_MIN_PARAM) && (p->applied.draft[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp, "APPLIED_DRAFT=%+06.2f",
-                p->applied.draft[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-    }
-    else if (num_tx == 2)
-    {
-        if (p->applied.draft[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp, "APPLIED_DRAFT=%s,", GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->applied.draft[0] > GSF_MIN_PARAM) && (p->applied.draft[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp, "APPLIED_DRAFT=%+06.2f,", p->applied.draft[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        if (p->applied.draft[1] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf (temp2, "%s", GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->applied.draft[1] > GSF_MIN_PARAM) && (p->applied.draft[1] < GSF_MAX_PARAM))
-        {
-            sprintf (temp2, "%+06.2f", p->applied.draft[1]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat (temp, temp2);
-    }
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return(-1);
-    }
-
-    /* The APPLIED_PITCH_BIAS parameter defines the pitch bias previously
-     * applied.
-     */
-    if (num_tx == 1)
-    {
-        if (p->applied.pitch_bias[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp, "APPLIED_PITCH_BIAS=%s",
-                GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->applied.pitch_bias[0] > GSF_MIN_PARAM) && (p->applied.pitch_bias[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp, "APPLIED_PITCH_BIAS=%+06.2f",
-                p->applied.pitch_bias[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-    }
-    else if (num_tx == 2)
-    {
-        if (p->applied.pitch_bias[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp, "APPLIED_PITCH_BIAS=%s,", GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->applied.pitch_bias[0] > GSF_MIN_PARAM) && (p->applied.pitch_bias[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp, "APPLIED_PITCH_BIAS=%+06.2f,", p->applied.pitch_bias[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        if (p->applied.pitch_bias[1] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf (temp2, "%s", GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->applied.pitch_bias[1] > GSF_MIN_PARAM) && (p->applied.pitch_bias[1] < GSF_MAX_PARAM))
-        {
-            sprintf (temp2, "%+06.2f", p->applied.pitch_bias[1]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat (temp, temp2);
-    }
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return(-1);
-    }
-
-    /* The APPLIED_ROLL_BIAS parameter defines the roll bias previously
-     * applied to the data.
-     */
-    if (num_tx == 1)
-    {
-        if (p->applied.roll_bias[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp, "APPLIED_ROLL_BIAS=%s",
-                GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->applied.roll_bias[0] > GSF_MIN_PARAM) && (p->applied.roll_bias[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp, "APPLIED_ROLL_BIAS=%+06.2f",
-                p->applied.roll_bias[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-    }
-    else if (num_tx == 2)
-    {
-        if (p->applied.roll_bias[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp, "APPLIED_ROLL_BIAS=%s,", GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->applied.roll_bias[0] > GSF_MIN_PARAM) && (p->applied.roll_bias[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp, "APPLIED_ROLL_BIAS=%+06.2f,", p->applied.roll_bias[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        if (p->applied.roll_bias[1] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf (temp2, "%s", GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->applied.roll_bias[1] > GSF_MIN_PARAM) && (p->applied.roll_bias[1] < GSF_MAX_PARAM))
-        {
-            sprintf (temp2, "%+06.2f", p->applied.roll_bias[1]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat (temp, temp2);
-    }
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return(-1);
-    }
-
-    /* The APPLIED_GYRO_BIAS parameter defines the gyro bias previously
-     * applied to the data.
-     */
-    if (num_tx == 1)
-    {
-        if (p->applied.gyro_bias[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp, "APPLIED_GYRO_BIAS=%s",
-                GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->applied.gyro_bias[0] > GSF_MIN_PARAM) && (p->applied.gyro_bias[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp, "APPLIED_GYRO_BIAS=%+06.2f",
-                p->applied.gyro_bias[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-    }
-    else if (num_tx == 2)
-    {
-        if (p->applied.gyro_bias[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp, "APPLIED_GYRO_BIAS=%s,", GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->applied.gyro_bias[0] > GSF_MIN_PARAM) && (p->applied.gyro_bias[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp, "APPLIED_GYRO_BIAS=%+06.2f,", p->applied.gyro_bias[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        if (p->applied.gyro_bias[1] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf (temp2, "%s", GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->applied.gyro_bias[1] > GSF_MIN_PARAM) && (p->applied.gyro_bias[1] < GSF_MAX_PARAM))
-        {
-            sprintf (temp2, "%+06.2f", p->applied.gyro_bias[1]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat (temp, temp2);
-    }
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return(-1);
-    }
-
-    /* The APPLIED_POSITION_OFFSET parameter defines the x,y,z position in
-     * ship coordinates to which the lat lons are relative.
-     */
-    memset(temp, 0, sizeof(temp));
-    sprintf(temp, "APPLIED_POSITION_OFFSET=");
-    if (p->applied.position_x_offset == GSF_UNKNOWN_PARAM_VALUE)
-    {
-        sprintf(temp2, "%s,",
-            GSF_UNKNOWN_PARAM_TEXT);
-    }
-    else if ((p->applied.position_x_offset > GSF_MIN_PARAM) && (p->applied.position_x_offset < GSF_MAX_PARAM))
-    {
-        sprintf(temp2, "%+06.2f,",
-            p->applied.position_x_offset);
-    }
-    else
-    {
-        gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-        return (-1);
-    }
-    strcat(temp, temp2);
-    if (p->applied.position_y_offset == GSF_UNKNOWN_PARAM_VALUE)
-    {
-        sprintf(temp2, "%s,",
-            GSF_UNKNOWN_PARAM_TEXT);
-    }
-    else if ((p->applied.position_y_offset > GSF_MIN_PARAM) && (p->applied.position_y_offset < GSF_MAX_PARAM))
-    {
-        sprintf(temp2, "%+06.2f,",
-            p->applied.position_y_offset);
-    }
-    else
-    {
-        gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-        return (-1);
-    }
-    strcat(temp, temp2);
-    if (p->applied.position_z_offset == GSF_UNKNOWN_PARAM_VALUE)
-    {
-        sprintf(temp2, "%s",
-            GSF_UNKNOWN_PARAM_TEXT);
-    }
-    else if ((p->applied.position_z_offset > GSF_MIN_PARAM) && (p->applied.position_z_offset < GSF_MAX_PARAM))
-    {
-        sprintf(temp2, "%+06.2f",
-            p->applied.position_z_offset);
-    }
-    else
-    {
-        gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-        return (-1);
-    }
-    strcat(temp, temp2);
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return(-1);
-    }
-
-    /* The APPLIED_ANTENNA_OFFSET parameter defines the x,y,z position of the antenna
-     * in ship coordinates to which the lat lons are relative.
-     */
-    memset(temp, 0, sizeof(temp));
-    sprintf(temp, "APPLIED_ANTENNA_OFFSET=");
-    if (p->applied.antenna_x_offset == GSF_UNKNOWN_PARAM_VALUE)
-    {
-        sprintf(temp2, "%s,",
-            GSF_UNKNOWN_PARAM_TEXT);
-    }
-    else if ((p->applied.antenna_x_offset > GSF_MIN_PARAM) && (p->applied.antenna_x_offset < GSF_MAX_PARAM))
-    {
-        sprintf(temp2, "%+06.2f,",
-            p->applied.antenna_x_offset);
-    }
-    else
-    {
-        gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-        return (-1);
-    }
-    strcat(temp, temp2);
-    if (p->applied.antenna_y_offset == GSF_UNKNOWN_PARAM_VALUE)
-    {
-        sprintf(temp2, "%s,",
-            GSF_UNKNOWN_PARAM_TEXT);
-    }
-    else if ((p->applied.antenna_y_offset > GSF_MIN_PARAM) && (p->applied.antenna_y_offset < GSF_MAX_PARAM))
-    {
-        sprintf(temp2, "%+06.2f,",
-            p->applied.antenna_y_offset);
-    }
-    else
-    {
-        gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-        return (-1);
-    }
-    strcat(temp, temp2);
-    if (p->applied.antenna_z_offset == GSF_UNKNOWN_PARAM_VALUE)
-    {
-        sprintf(temp2, "%s",
-            GSF_UNKNOWN_PARAM_TEXT);
-    }
-    else if ((p->applied.antenna_z_offset > GSF_MIN_PARAM) && (p->applied.antenna_z_offset < GSF_MAX_PARAM))
-    {
-        sprintf(temp2, "%+06.2f",
-            p->applied.antenna_z_offset);
-    }
-    else
-    {
-        gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-        return (-1);
-    }
-    strcat(temp, temp2);
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return(-1);
-    }
-
-    /* The APPLIED_TRANSDUCER_OFFSET parameter defines the x,y,z offsets
-     * in ship coordinates to which have been applied to refer the x,y,z
-     * beam values to the ship reference point.
-     */
-    memset(temp, 0, sizeof(temp));
-    sprintf(temp, "APPLIED_TRANSDUCER_OFFSET=");
-    if (num_tx == 1)
-    {
-        if (p->applied.transducer_x_offset[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp2, "%s,",
-                GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->applied.transducer_x_offset[0] > GSF_MIN_PARAM) && (p->applied.transducer_x_offset[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp2, "%+06.2f,",
-                p->applied.transducer_x_offset[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat(temp, temp2);
-        if (p->applied.transducer_y_offset[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp2, "%s,",
-                GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->applied.transducer_y_offset[0] > GSF_MIN_PARAM) && (p->applied.transducer_y_offset[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp2, "%+06.2f,",
-                p->applied.transducer_y_offset[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat(temp, temp2);
-        if (p->applied.transducer_z_offset[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp2, "%s",
-                GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->applied.transducer_z_offset[0] > GSF_MIN_PARAM) && (p->applied.transducer_z_offset[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp2, "%+06.2f",
-                p->applied.transducer_z_offset[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat(temp, temp2);
-    }
-    else if (num_tx == 2)
-    {
-        if (p->applied.transducer_x_offset[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp2, "%s,",
-                GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->applied.transducer_x_offset[0] > GSF_MIN_PARAM) && (p->applied.transducer_x_offset[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp2, "%+06.2f,",
-                p->applied.transducer_x_offset[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat(temp, temp2);
-        if (p->applied.transducer_y_offset[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp2, "%s,",
-                GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->applied.transducer_y_offset[0] > GSF_MIN_PARAM) && (p->applied.transducer_y_offset[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp2, "%+06.2f,",
-                p->applied.transducer_y_offset[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat(temp, temp2);
-        if (p->applied.transducer_z_offset[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp2, "%s,",
-                GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->applied.transducer_z_offset[0] > GSF_MIN_PARAM) && (p->applied.transducer_z_offset[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp2, "%+06.2f,",
-                p->applied.transducer_z_offset[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat(temp, temp2);
-        if (p->applied.transducer_x_offset[1] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp2, "%s,",
-                GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->applied.transducer_x_offset[1] > GSF_MIN_PARAM) && (p->applied.transducer_x_offset[1] < GSF_MAX_PARAM))
-        {
-            sprintf(temp2, "%+06.2f,",
-                p->applied.transducer_x_offset[1]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat(temp, temp2);
-        if (p->applied.transducer_y_offset[1] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp2, "%s,",
-                GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->applied.transducer_y_offset[1] > GSF_MIN_PARAM) && (p->applied.transducer_y_offset[1] < GSF_MAX_PARAM))
-        {
-            sprintf(temp2, "%+06.2f,",
-                p->applied.transducer_y_offset[1]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat(temp, temp2);
-        if (p->applied.transducer_z_offset[1] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp2, "%s",
-                GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->applied.transducer_z_offset[1] > GSF_MIN_PARAM) && (p->applied.transducer_z_offset[1] < GSF_MAX_PARAM))
-        {
-            sprintf(temp2, "%+06.2f",
-                p->applied.transducer_z_offset[1]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat(temp, temp2);
-    }
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return(-1);
-    }
-
-    /* The APPLIED_TRANSDUCER_PITCH_OFFSET parameter defines the transducer pitch installation angle
-     *   previously applied to the data.
-     */
-    if (num_tx == 1)
-    {
-        if (p->applied.transducer_pitch_offset[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp, "APPLIED_TRANSDUCER_PITCH_OFFSET=%s",
-                GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->applied.transducer_pitch_offset[0] > GSF_MIN_PARAM) && (p->applied.transducer_pitch_offset[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp, "APPLIED_TRANSDUCER_PITCH_OFFSET=%+06.2f",
-                p->applied.transducer_pitch_offset[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-    }
-    else if (num_tx == 2)
-    {
-        if (p->applied.transducer_pitch_offset[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp, "APPLIED_TRANSDUCER_PITCH_OFFSET=%s,",
-                GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->applied.transducer_pitch_offset[0] > GSF_MIN_PARAM) && (p->applied.transducer_pitch_offset[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp, "APPLIED_TRANSDUCER_PITCH_OFFSET=%+06.2f,",
-                p->applied.transducer_pitch_offset[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        if (p->applied.transducer_pitch_offset[1] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf (temp2, "%s", GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->applied.transducer_pitch_offset[1] > GSF_MIN_PARAM) && (p->applied.transducer_pitch_offset[1] < GSF_MAX_PARAM))
-        {
-            sprintf (temp2, "%+06.2f", p->applied.transducer_pitch_offset[1]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat (temp, temp2);
-    }
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return(-1);
-    }
-
-    /* The APPLIED_TRANSDUCER_ROLL_OFFSET parameter defines the transducer roll installation angle
-     *   previously applied to the data.
-     */
-    if (num_tx == 1)
-    {
-        if (p->applied.transducer_roll_offset[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp, "APPLIED_TRANSDUCER_ROLL_OFFSET=%s",
-                GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->applied.transducer_roll_offset[0] > GSF_MIN_PARAM) && (p->applied.transducer_roll_offset[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp, "APPLIED_TRANSDUCER_ROLL_OFFSET=%+06.2f",
-                p->applied.transducer_roll_offset[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-    }
-    else if (num_tx == 2)
-    {
-        if (p->applied.transducer_roll_offset[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp, "APPLIED_TRANSDUCER_ROLL_OFFSET=%s,",
-                GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->applied.transducer_roll_offset[0] > GSF_MIN_PARAM) && (p->applied.transducer_roll_offset[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp, "APPLIED_TRANSDUCER_ROLL_OFFSET=%+06.2f,",
-                p->applied.transducer_roll_offset[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        if (p->applied.transducer_roll_offset[1] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf (temp2, "%s", GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->applied.transducer_roll_offset[1] > GSF_MIN_PARAM) && (p->applied.transducer_roll_offset[1] < GSF_MAX_PARAM))
-        {
-            sprintf (temp2, "%+06.2f", p->applied.transducer_roll_offset[1]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat (temp, temp2);
-    }
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return(-1);
-    }
-
-    /* The APPLIED_TRANSDUCER_HEADING_OFFSET parameter defines the transducer heading installation angle
-     *   previously applied to the data.
-     */
-    if (num_tx == 1)
-    {
-        if (p->applied.transducer_heading_offset[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp, "APPLIED_TRANSDUCER_HEADING_OFFSET=%s",
-                GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->applied.transducer_heading_offset[0] > GSF_MIN_PARAM) && (p->applied.transducer_heading_offset[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp, "APPLIED_TRANSDUCER_HEADING_OFFSET=%+06.2f",
-                p->applied.transducer_heading_offset[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-    }
-    else if (num_tx == 2)
-    {
-        if (p->applied.transducer_heading_offset[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp, "APPLIED_TRANSDUCER_HEADING_OFFSET=%s,",
-                GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->applied.transducer_heading_offset[0] > GSF_MIN_PARAM) && (p->applied.transducer_heading_offset[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp, "APPLIED_TRANSDUCER_HEADING_OFFSET=%+06.2f,",
-                p->applied.transducer_heading_offset[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        if (p->applied.transducer_heading_offset[1] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf (temp2, "%s", GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->applied.transducer_heading_offset[1] > GSF_MIN_PARAM) && (p->applied.transducer_heading_offset[1] < GSF_MAX_PARAM))
-        {
-            sprintf (temp2, "%+06.2f", p->applied.transducer_heading_offset[1]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat (temp, temp2);
-    }
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return(-1);
-    }
-
-    /* The APPLIED_MRU_ROLL parameter defines the roll bias previously
-     * applied to the data.
-     */
-    memset(temp, 0, sizeof(temp));
-    if (p->applied.mru_roll_bias == GSF_UNKNOWN_PARAM_VALUE)
-    {
-        sprintf(temp, "APPLIED_MRU_ROLL=%s",
-            GSF_UNKNOWN_PARAM_TEXT);
-    }
-    else if ((p->applied.mru_roll_bias > GSF_MIN_PARAM) && (p->applied.mru_roll_bias < GSF_MAX_PARAM))
-    {
-        sprintf(temp, "APPLIED_MRU_ROLL=%+06.2f",
-            p->applied.mru_roll_bias);
-    }
-    else
-    {
-        gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-        return (-1);
-    }
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return(-1);
-    }
-
-    /* The APPLIED_MRU_PITCH parameter defines the pitch bias previously
-     * applied to the data.
-     */
-    memset(temp, 0, sizeof(temp));
-    if (p->applied.mru_pitch_bias == GSF_UNKNOWN_PARAM_VALUE)
-    {
-        sprintf(temp, "APPLIED_MRU_PITCH=%s",
-            GSF_UNKNOWN_PARAM_TEXT);
-    }
-    else if ((p->applied.mru_pitch_bias > GSF_MIN_PARAM) && (p->applied.mru_pitch_bias < GSF_MAX_PARAM))
-    {
-        sprintf(temp, "APPLIED_MRU_PITCH=%+06.2f",
-            p->applied.mru_pitch_bias);
-    }
-    else
-    {
-        gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-        return (-1);
-    }
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return(-1);
-    }
-
-    /* The APPLIED_MRU_HEADING parameter defines the heading bias previously
-     * applied to the data.
-     */
-    memset(temp, 0, sizeof(temp));
-    if (p->applied.mru_heading_bias == GSF_UNKNOWN_PARAM_VALUE)
-    {
-        sprintf(temp, "APPLIED_MRU_HEADING=%s",
-            GSF_UNKNOWN_PARAM_TEXT);
-    }
-    else if ((p->applied.mru_heading_bias > GSF_MIN_PARAM) && (p->applied.mru_heading_bias < GSF_MAX_PARAM))
-    {
-        sprintf(temp, "APPLIED_MRU_HEADING=%+06.2f",
-            p->applied.mru_heading_bias);
-    }
-    else
-    {
-        gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-        return (-1);
-    }
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return(-1);
-    }
-
-    /* The APPLIED_MRU_OFFSET parameter defines the x,y,z offsets
-     * in ship coordinates to which have been used to calculate a heave
-     * difference between the motion sensor and the ship reference point.
-     */
-    memset(temp, 0, sizeof(temp));
-    sprintf(temp, "APPLIED_MRU_OFFSET=");
-    if (p->applied.mru_x_offset == GSF_UNKNOWN_PARAM_VALUE)
-    {
-        sprintf(temp2, "%s,",
-            GSF_UNKNOWN_PARAM_TEXT);
-    }
-    else if ((p->applied.mru_x_offset > GSF_MIN_PARAM) && (p->applied.mru_x_offset < GSF_MAX_PARAM))
-    {
-        sprintf(temp2, "%+06.2f,",
-            p->applied.mru_x_offset);
-    }
-    else
-    {
-        gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-        return (-1);
-    }
-    strcat(temp, temp2);
-    if (p->applied.mru_y_offset == GSF_UNKNOWN_PARAM_VALUE)
-    {
-        sprintf(temp2, "%s,", GSF_UNKNOWN_PARAM_TEXT);
-    }
-    else if ((p->applied.mru_y_offset > GSF_MIN_PARAM) && (p->applied.mru_y_offset < GSF_MAX_PARAM))
-    {
-        sprintf(temp2, "%+06.2f,",
-            p->applied.mru_y_offset);
-    }
-    else
-    {
-        gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-        return (-1);
-    }
-    strcat(temp, temp2);
-    if (p->applied.mru_z_offset == GSF_UNKNOWN_PARAM_VALUE)
-    {
-        sprintf(temp2, "%s", GSF_UNKNOWN_PARAM_TEXT);
-    }
-    else if ((p->applied.mru_z_offset > GSF_MIN_PARAM) && (p->applied.mru_z_offset < GSF_MAX_PARAM))
-    {
-        sprintf(temp2, "%+06.2f",
-            p->applied.mru_z_offset);
-    }
-    else
-    {
-        gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-        return (-1);
-    }
-    strcat(temp, temp2);
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return(-1);
-    }
-
-    /* The APPLIED_CENTER_OF_ROTATION_OFFSET parameter defines the x,y,z offsets
-     * in ship coordinates to which have been used to calculate a heave
-     * difference between the motion sensor and the ship reference point.
-     */
-    memset(temp, 0, sizeof(temp));
-    sprintf(temp, "APPLIED_CENTER_OF_ROTATION_OFFSET=");
-    if (p->applied.center_of_rotation_x_offset == GSF_UNKNOWN_PARAM_VALUE)
-    {
-        sprintf(temp2, "%s,",
-            GSF_UNKNOWN_PARAM_TEXT);
-    }
-    else if ((p->applied.center_of_rotation_x_offset > GSF_MIN_PARAM) && (p->applied.center_of_rotation_x_offset < GSF_MAX_PARAM))
-    {
-        sprintf(temp2, "%+06.2f,",
-            p->applied.center_of_rotation_x_offset);
-    }
-    else
-    {
-        gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-        return (-1);
-    }
-    strcat(temp, temp2);
-    if (p->applied.center_of_rotation_y_offset == GSF_UNKNOWN_PARAM_VALUE)
-    {
-        sprintf(temp2, "%s,", GSF_UNKNOWN_PARAM_TEXT);
-    }
-    else if ((p->applied.center_of_rotation_y_offset > GSF_MIN_PARAM) && (p->applied.center_of_rotation_y_offset < GSF_MAX_PARAM))
-    {
-        sprintf(temp2, "%+06.2f,",
-            p->applied.center_of_rotation_y_offset);
-    }
-    else
-    {
-        gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-        return (-1);
-    }
-    strcat(temp, temp2);
-    if (p->applied.center_of_rotation_z_offset == GSF_UNKNOWN_PARAM_VALUE)
-    {
-        sprintf(temp2, "%s", GSF_UNKNOWN_PARAM_TEXT);
-    }
-    else if ((p->applied.center_of_rotation_z_offset > GSF_MIN_PARAM) && (p->applied.center_of_rotation_z_offset < GSF_MAX_PARAM))
-    {
-        sprintf(temp2, "%+06.2f",
-            p->applied.center_of_rotation_z_offset);
-    }
-    else
-    {
-        gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-        return (-1);
-    }
-    strcat(temp, temp2);
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return(-1);
-    }
-
-    /* The APPLIED_POSITION_LATENCY parameter defines the navigation
-     * sensor latency value which has already been applied.
-     */
-    memset(temp, 0, sizeof(temp));
-    if (p->applied.position_latency == GSF_UNKNOWN_PARAM_VALUE)
-    {
-        sprintf(temp, "APPLIED_POSITION_LATENCY=%s",
-            GSF_UNKNOWN_PARAM_TEXT);
-    }
-    else if ((p->applied.position_latency > GSF_MIN_PARAM) && (p->applied.position_latency < GSF_MAX_PARAM))
-    {
-        sprintf(temp, "APPLIED_POSITION_LATENCY=%+06.3f",
-            p->applied.position_latency);
-    }
-    else
-    {
-        gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-        return (-1);
-    }
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return(-1);
-    }
-
-    /* The APPLIED_ATTITUDE_LATENCY parameter defines the attitude
-     * sensor latency value which has already been applied.
-     */
-    memset(temp, 0, sizeof(temp));
-    if (p->applied.attitude_latency == GSF_UNKNOWN_PARAM_VALUE)
-    {
-        sprintf(temp, "APPLIED_ATTITUDE_LATENCY=%s",
-            GSF_UNKNOWN_PARAM_TEXT);
-    }
-    else if ((p->applied.attitude_latency > GSF_MIN_PARAM) && (p->applied.attitude_latency < GSF_MAX_PARAM))
-    {
-        sprintf(temp, "APPLIED_ATTITUDE_LATENCY=%+06.3f",
-            p->applied.attitude_latency);
-    }
-    else
-    {
-        gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-        return (-1);
-    }
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return(-1);
-    }
-
-    /* The APPLIED_DEPTH_SENSOR_LATENCY parameter defines the depth
-     *  sensor latency value which has already been applied.
-     */
-    memset(temp, 0, sizeof(temp));
-    if (p->applied.depth_sensor_latency == GSF_UNKNOWN_PARAM_VALUE)
-    {
-        sprintf(temp, "APPLIED_DEPTH_SENSOR_LATENCY=%s",
-            GSF_UNKNOWN_PARAM_TEXT);
-    }
-    else if ((p->applied.depth_sensor_latency > GSF_MIN_PARAM) && (p->applied.depth_sensor_latency < GSF_MAX_PARAM))
-    {
-        sprintf(temp, "APPLIED_DEPTH_SENSOR_LATENCY=%+06.3f",
-            p->applied.depth_sensor_latency);
-    }
-    else
-    {
-        gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-        return (-1);
-    }
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return(-1);
-    }
-
-    /* The APPLIED_DEPTH_SENSOR_OFFSET parameter defines the x,y,z position
-     * offsets that have been applied
-     */
-    sprintf(temp, "APPLIED_DEPTH_SENSOR_OFFSET=");
-    if (p->applied.depth_sensor_x_offset == GSF_UNKNOWN_PARAM_VALUE)
-    {
-        sprintf (temp2, "%s,", GSF_UNKNOWN_PARAM_TEXT);
-    }
-    else if ((p->applied.depth_sensor_x_offset > GSF_MIN_PARAM) && (p->applied.depth_sensor_x_offset < GSF_MAX_PARAM))
-    {
-        sprintf (temp2, "%+06.2f,", p->applied.depth_sensor_x_offset);
-    }
-    else
-    {
-        gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-        return (-1);
-    }
-    strcat (temp, temp2);
-    if (p->applied.depth_sensor_y_offset == GSF_UNKNOWN_PARAM_VALUE)
-    {
-        sprintf (temp2, "%s,", GSF_UNKNOWN_PARAM_TEXT);
-    }
-    else if ((p->applied.depth_sensor_y_offset > GSF_MIN_PARAM) && (p->applied.depth_sensor_y_offset < GSF_MAX_PARAM))
-    {
-        sprintf (temp2, "%+06.2f,", p->applied.depth_sensor_y_offset);
-    }
-    else
-    {
-        gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-        return (-1);
-    }
-    strcat(temp, temp2);
-    if (p->applied.depth_sensor_z_offset == GSF_UNKNOWN_PARAM_VALUE)
-    {
-        sprintf(temp2, "%s", GSF_UNKNOWN_PARAM_TEXT);
-    }
-    else if ((p->applied.depth_sensor_z_offset > GSF_MIN_PARAM) && (p->applied.depth_sensor_z_offset < GSF_MAX_PARAM))
-    {
-        sprintf(temp2, "%+06.2f", p->applied.depth_sensor_z_offset);
-    }
-    else
-    {
-        gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-        return (-1);
-    }
-    strcat(temp, temp2);
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return(-1);
-    }
-
-    /* The APPLIED_RX_TRANSDUCER_OFFSET parameter is the x, y, z position
-     * offsets of the receiver array that have been applied
-     */
-    sprintf (temp, "APPLIED_RX_TRANSDUCER_OFFSET=");
-    if (num_rx == 1)
-    {
-        if (p->applied.rx_transducer_x_offset[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp2, "%s,", GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->applied.rx_transducer_x_offset[0] > GSF_MIN_PARAM) && (p->applied.rx_transducer_x_offset[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp2, "%+06.2f,", p->applied.rx_transducer_x_offset[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat (temp, temp2);
-        if (p->applied.rx_transducer_y_offset[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp2, "%s,", GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->applied.rx_transducer_y_offset[0] > GSF_MIN_PARAM) && (p->applied.rx_transducer_y_offset[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp2, "%+06.2f,", p->applied.rx_transducer_y_offset[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat (temp, temp2);
-        if (p->applied.rx_transducer_z_offset[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp2, "%s", GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->applied.rx_transducer_z_offset[0] > GSF_MIN_PARAM) && (p->applied.rx_transducer_z_offset[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp2, "%+06.2f", p->applied.rx_transducer_z_offset[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat (temp, temp2);
-    }
-    else if (num_rx == 2)
-    {
-        if (p->applied.rx_transducer_x_offset[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp2, "%s,", GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->applied.rx_transducer_x_offset[0] > GSF_MIN_PARAM) && (p->applied.rx_transducer_x_offset[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp2, "%+06.2f,", p->applied.rx_transducer_x_offset[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat (temp, temp2);
-        if (p->applied.rx_transducer_y_offset[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp2, "%s,", GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->applied.rx_transducer_y_offset[0] > GSF_MIN_PARAM) && (p->applied.rx_transducer_y_offset[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp2, "%+06.2f,", p->applied.rx_transducer_y_offset[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat (temp, temp2);
-        if (p->applied.rx_transducer_z_offset[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp2, "%s,", GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->applied.rx_transducer_z_offset[0] > GSF_MIN_PARAM) && (p->applied.rx_transducer_z_offset[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp2, "%+06.2f,", p->applied.rx_transducer_z_offset[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat (temp, temp2);
-        if (p->applied.rx_transducer_x_offset[1] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp2, "%s,", GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->applied.rx_transducer_x_offset[1] > GSF_MIN_PARAM) && (p->applied.rx_transducer_x_offset[1] < GSF_MAX_PARAM))
-        {
-            sprintf(temp2, "%+06.2f,", p->applied.rx_transducer_x_offset[1]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat (temp, temp2);
-        if (p->applied.rx_transducer_y_offset[1] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp2, "%s,", GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->applied.rx_transducer_y_offset[1] > GSF_MIN_PARAM) && (p->applied.rx_transducer_y_offset[1] < GSF_MAX_PARAM))
-        {
-            sprintf(temp2, "%+06.2f,", p->applied.rx_transducer_y_offset[1]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat (temp, temp2);
-        if (p->applied.rx_transducer_z_offset[1] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp2, "%s", GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->applied.rx_transducer_z_offset[1] > GSF_MIN_PARAM) && (p->applied.rx_transducer_z_offset[1] < GSF_MAX_PARAM))
-        {
-            sprintf(temp2, "%+06.2f", p->applied.rx_transducer_z_offset[1]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat (temp, temp2);
-    }
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return(-1);
-    }
-
-    /* The APPLIED_RX_TRANSDUCER_PITCH parameter is the receiver pitch offset that has been applied.
-     */
-    sprintf (temp, "APPLIED_RX_TRANSDUCER_PITCH_OFFSET=");
-    if (num_rx == 1)
-    {
-        if (p->applied.rx_transducer_pitch_offset[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp2, "%s", GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->applied.rx_transducer_pitch_offset[0] > GSF_MIN_PARAM) && (p->applied.rx_transducer_pitch_offset[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp2, "%+06.2f", p->applied.rx_transducer_pitch_offset[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat (temp, temp2);
-    }
-    else if (num_rx == 2)
-    {
-        if (p->applied.rx_transducer_pitch_offset[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp2, "%s,", GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->applied.rx_transducer_pitch_offset[0] > GSF_MIN_PARAM) && (p->applied.rx_transducer_pitch_offset[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp2, "%+06.2f,", p->applied.rx_transducer_pitch_offset[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat (temp, temp2);
-        if (p->applied.rx_transducer_pitch_offset[1] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp2, "%s", GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->applied.rx_transducer_pitch_offset[1] > GSF_MIN_PARAM) && (p->applied.rx_transducer_pitch_offset[1] < GSF_MAX_PARAM))
-        {
-            sprintf(temp2, "%+06.2f", p->applied.rx_transducer_pitch_offset[1]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat (temp, temp2);
-    }
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return(-1);
-    }
-
-    /* The APPLIED_RX_TRANSDUCER_ROLL parameter is the receiver roll offset that has been applied.
-     */
-    sprintf (temp, "APPLIED_RX_TRANSDUCER_ROLL_OFFSET=");
-    if (num_rx == 1)
-    {
-        if (p->applied.rx_transducer_roll_offset[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp2, "%s", GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->applied.rx_transducer_roll_offset[0] > GSF_MIN_PARAM) && (p->applied.rx_transducer_roll_offset[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp2, "%+06.2f", p->applied.rx_transducer_roll_offset[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat (temp, temp2);
-    }
-    else if (num_rx == 2)
-    {
-        if (p->applied.rx_transducer_roll_offset[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp2, "%s,", GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->applied.rx_transducer_roll_offset[0] > GSF_MIN_PARAM) && (p->applied.rx_transducer_roll_offset[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp2, "%+06.2f,", p->applied.rx_transducer_roll_offset[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat (temp, temp2);
-        if (p->applied.rx_transducer_roll_offset[1] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp2, "%s", GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->applied.rx_transducer_roll_offset[1] > GSF_MIN_PARAM) && (p->applied.rx_transducer_roll_offset[1] < GSF_MAX_PARAM))
-        {
-            sprintf(temp2, "%+06.2f", p->applied.rx_transducer_roll_offset[1]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat (temp, temp2);
-    }
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return(-1);
-    }
-
-    /* The APPLIED_RX_TRANSDUCER_HEADING_TO_APPLY parameter is the receiver heading offset that has been applied.
-     */
-    sprintf (temp, "APPLIED_RX_TRANSDUCER_HEADING_OFFSET=");
-    if (num_rx == 1)
-    {
-        if (p->applied.rx_transducer_heading_offset[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp2, "%s", GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->applied.rx_transducer_heading_offset[0] > GSF_MIN_PARAM) && (p->applied.rx_transducer_heading_offset[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp2, "%+06.2f", p->applied.rx_transducer_heading_offset[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat (temp, temp2);
-    }
-    else if (num_rx == 2)
-    {
-        if (p->applied.rx_transducer_heading_offset[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp2, "%s,", GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->applied.rx_transducer_heading_offset[0] > GSF_MIN_PARAM) && (p->applied.rx_transducer_heading_offset[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp2, "%+06.2f,", p->applied.rx_transducer_heading_offset[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat (temp, temp2);
-        if (p->applied.rx_transducer_heading_offset[1] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp2, "%s", GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->applied.rx_transducer_heading_offset[1] > GSF_MIN_PARAM) && (p->applied.rx_transducer_heading_offset[1] < GSF_MAX_PARAM))
-        {
-            sprintf(temp2, "%+06.2f", p->applied.rx_transducer_heading_offset[1]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat (temp, temp2);
-    }
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return(-1);
-    }
-
-    /******* end of the applied parameters *******/
-
-    /* The horizontal datum parameter defines the elipsoid to which the
-     * latitude longitude values are referenced.
-     */
-    switch (p->horizontal_datum)
-    {
-        case (GSF_H_DATUM_WGE):
-            sprintf(temp, "GEOID=WGS-84");
-            break;
-
-        default:
-            sprintf(temp, "GEOID=UNKNWN");
-            break;
-
-    }
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return(-1);
-    }
-
-    /* The TIDAL_DATUM paremeter defines the reference datum for tide
-     * corrections. See gsf.h for definitions.
-     */
-    switch (p->vertical_datum)
-    {
-        case (GSF_V_DATUM_MLLW):
-            sprintf(temp, "TIDAL_DATUM=MLLW   ");
-            break;
-
-        case (GSF_V_DATUM_MLW):
-            sprintf(temp, "TIDAL_DATUM=MLW    ");
-            break;
-
-        case (GSF_V_DATUM_ALAT):
-             sprintf(temp, "TIDAL_DATUM=ALAT  ");
-             break;
-
-        case (GSF_V_DATUM_ESLW):
-             sprintf(temp, "TIDAL_DATUM=ESLW  ");
-             break;
-
-        case (GSF_V_DATUM_ISLW):
-             sprintf(temp, "TIDAL_DATUM=ISLW  ");
-             break;
-
-        case (GSF_V_DATUM_LAT):
-             sprintf(temp, "TIDAL_DATUM=LAT   ");
-             break;
-
-        case (GSF_V_DATUM_LLW):
-             sprintf(temp, "TIDAL_DATUM=LLW   ");
-             break;
-
-        case (GSF_V_DATUM_LNLW):
-             sprintf(temp, "TIDAL_DATUM=LNLW  ");
-             break;
-
-        case (GSF_V_DATUM_LWD):
-             sprintf(temp, "TIDAL_DATUM=LWD   ");
-             break;
-
-        case (GSF_V_DATUM_MLHW):
-             sprintf(temp, "TIDAL_DATUM=MLHW  ");
-             break;
-
-        case (GSF_V_DATUM_MLLWS):
-             sprintf(temp, "TIDAL_DATUM=MLLWS ");
-             break;
-
-        case (GSF_V_DATUM_MLWN):
-             sprintf(temp, "TIDAL_DATUM=MLWN  ");
-             break;
-
-        case (GSF_V_DATUM_MSL):
-             sprintf(temp, "TIDAL_DATUM=MSL   ");
-             break;
-
-        default:
-            sprintf(temp, "TIDAL_DATUM=UNKNOWN");
-            break;
-    }
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return(-1);
-    }
-
-    rec->process_parameters.number_parameters = number_parameters;
-
-    return(0);
-}
-
-/********************************************************************
- *
- * Function Name : gsfGetMBParams
- *
- * Description : This function moves swath bathymetry sonar processing
- *    parameters from external, form to internal form.  The external
- *    "KEYWORD=VALUE" format parameters are read from a processing_params
- *    structure of a gsfRecords data structure maintained by the caller.
- *    The internal form parameters are written into a gsfMBParams data
- *    structure maintained by the caller. Parameters for up to two pairs of
- *    transmit/receive arrays are supported, for systems such as Reson SeaBat
- *    9002.  Any parameter not described in a "KEYWORD=VALUE" format will
- *    be set to "GSF_UNKNOWN_PARAM_VALUE".
- *
- * Inputs :
- *     rec = a pointer to the gsfRecords data structure from which the
- *         parameters in "KEYWORK=VALUE" form are to be read.
- *     p = a pointer to the gsfMBParams data structure which will be populated.
- *     numArrays = the integer value specifying the number of pairs of
- *         arrays which need to have seperate parameters tracked.
- *
- * Returns : This function returns zero if successful, or -1 if an error
- *  occurs.
- *
- * Error Conditions :
- *  none.
- *
- ********************************************************************/
-int
-gsfGetMBParams(const gsfRecords *rec, gsfMBParams *p, int *numArrays)
-{
-    int i;
-    char str[64];
-    int num_tx = 0, num_rx = 0;
-
-    gsfInitializeMBParams (p);   /* set everything to "unknown" */
-    /* Set this value to zero in case we can't determine it */
-    *numArrays = 0;
-
-    for (i=0; i<rec->process_parameters.number_parameters; i++)
-    {
-        if (strncmp(rec->process_parameters.param[i], "REFERENCE TIME", strlen("REFERENCE TIME")) == 0)
-        {
-            memset(p->start_of_epoch, 0, sizeof(p->start_of_epoch));
-            strncpy(p->start_of_epoch, rec->process_parameters.param[i], sizeof(p->start_of_epoch));
-        }
-
-        /* DHG 2008/12/18 Add "PLATFORM_TYPE" */
-
-        else if (strncmp (rec->process_parameters.param[i], "PLATFORM_TYPE", strlen ("PLATFORM_TYPE")) == 0)
-        {
-            if (strstr(rec->process_parameters.param[i], "AUV"))
-            {
-                p->vessel_type = GSF_PLATFORM_TYPE_AUV;
-            }
-            if (strstr(rec->process_parameters.param[i], "SURFACE_SHIP"))
-            {
-                p->vessel_type = GSF_PLATFORM_TYPE_SURFACE_SHIP;
-            }
-            if (strstr(rec->process_parameters.param[i], "ROTV"))
-            {
-                p->vessel_type = GSF_PLATFORM_TYPE_ROTV;
-            }
-        }
-
-        else if (strncmp (rec->process_parameters.param[i], "FULL_RAW_DATA", strlen ("FULL_RAW_DATA")) == 0)
-        {
-            if (strstr(rec->process_parameters.param[i], "TRUE"))
-            {
-                p->full_raw_data = GSF_TRUE;
-            }
-            else
-            {
-                p->full_raw_data = GSF_FALSE;
-            }
-        }
-
-        else if (strncmp(rec->process_parameters.param[i], "ROLL_COMPENSATED", strlen("ROLL_COMPENSATED")) == 0)
-        {
-            if (strstr(rec->process_parameters.param[i], "YES"))
-            {
-                p->roll_compensated = GSF_COMPENSATED;
-            }
-            else
-            {
-                p->roll_compensated = GSF_UNCOMPENSATED;
-            }
-        }
-        else if (strncmp(rec->process_parameters.param[i], "PITCH_COMPENSATED", strlen("PITCH_COMPENSATED")) == 0)
-        {
-            if (strstr(rec->process_parameters.param[i], "YES"))
-            {
-                p->pitch_compensated = GSF_COMPENSATED;
-            }
-            else
-            {
-                p->pitch_compensated = GSF_UNCOMPENSATED;
-            }
-        }
-        else if (strncmp(rec->process_parameters.param[i], "HEAVE_COMPENSATED", strlen("HEAVE_COMPENSATED")) == 0)
-        {
-            if (strstr(rec->process_parameters.param[i], "YES"))
-            {
-                p->heave_compensated = GSF_COMPENSATED;
-            }
-            else
-            {
-                p->heave_compensated = GSF_UNCOMPENSATED;
-            }
-        }
-        else if (strncmp(rec->process_parameters.param[i], "TIDE_COMPENSATED", strlen("TIDE_COMPENSATED")) == 0)
-        {
-            if (strstr(rec->process_parameters.param[i], "YES"))
-            {
-                p->tide_compensated = GSF_COMPENSATED;
-            }
-            else
-            {
-                p->tide_compensated = GSF_UNCOMPENSATED;
-            }
-        }
-        else if (strncmp(rec->process_parameters.param[i], "NUMBER_OF_TRANSMITTERS", strlen("NUMBER_OF_TRANSMITTERS")) == 0)
-        {
-            sscanf (rec->process_parameters.param[i], "NUMBER_OF_TRANSMITTERS=%s", str);
-            if ((atoi(str) >= 1) && (atoi(str) <= GSF_MAX_OFFSETS))
-            {
-                p->number_of_transmitters = atoi(str);
-                num_tx = p->number_of_transmitters;
-            }
-            else
-            {
-                p->number_of_transmitters = GSF_UNKNOWN_PARAM_INT;
-            }
-        }
-        else if (strncmp(rec->process_parameters.param[i], "NUMBER_OF_RECEIVERS", strlen("NUMBER_OF_RECEIVERS")) == 0)
-        {
-            sscanf (rec->process_parameters.param[i], "NUMBER_OF_RECEIVERS=%s", str);
-            if ((atoi(str) >= 1) && (atoi(str) <= GSF_MAX_OFFSETS))
-            {
-                p->number_of_receivers = atoi(str);
-                num_rx = p->number_of_receivers;
-            }
-            else
-            {
-                p->number_of_receivers = GSF_UNKNOWN_PARAM_INT;
-            }
-        }
-        else if (strncmp(rec->process_parameters.param[i], "DEPTH_CALCULATION", strlen("DEPTH_CALCULATION")) == 0)
-        {
-            sscanf (rec->process_parameters.param[i], "DEPTH_CALCULATION=%s", str);
-            if (strcmp(str, "CORRECTED") == 0)
-            {
-                p->depth_calculation = GSF_TRUE_DEPTHS;
-            }
-            else if (strcmp(str, "CALCULATED_RE_1500_MS") == 0)
-            {
-                p->depth_calculation = GSF_DEPTHS_RE_1500_MS;
-            }
-            else
-            {
-                p->depth_calculation = GSF_DEPTH_CALC_UNKNOWN;
-            }
-        }
-
-        /* This parameter indicates whether the angle travel time
-         * pairs have been corrected for ray tracing.
-         */
-        else if (strncmp(rec->process_parameters.param[i], "RAY_TRACING", strlen("RAY_TRACING")) == 0)
-        {
-            sscanf (rec->process_parameters.param[i], "RAY_TRACING=%s", str);
-            if (strcmp(str, "YES") == 0)
-            {
-                p->ray_tracing = GSF_COMPENSATED;
-            }
-            else
-            {
-                p->ray_tracing = GSF_UNCOMPENSATED;
-            }
-        }
-
-        else if (strncmp(rec->process_parameters.param[i], "MSB_APPLIED_TO_ATTITUDE", strlen("MSB_APPLIED_TO_ATTITUDE")) == 0)
-        {
-            sscanf (rec->process_parameters.param[i], "MSB_APPLIED_TO_ATTITUDE=%s", str);
-            if (strcmp(str, "YES") == 0)
-            {
-                p->msb_applied_to_attitude = GSF_TRUE;
-            }
-            else
-            {
-                p->msb_applied_to_attitude = GSF_FALSE;
-            }
-        }
-
-        else if (strncmp(rec->process_parameters.param[i], "HEAVE_REMOVED_FROM_GPS_TC", strlen("HEAVE_REMOVED_FROM_GPS_TC")) == 0)
-        {
-            sscanf (rec->process_parameters.param[i], "HEAVE_REMOVED_FROM_GPS_TC=%s", str);
-            if (strcmp(str, "YES") == 0)
-            {
-                p->heave_removed_from_gps_tc = GSF_TRUE;
-            }
-            else
-            {
-                p->heave_removed_from_gps_tc = GSF_FALSE;
-            }
-        }
-
-        else if (strncmp(rec->process_parameters.param[i], "UTC_OFFSET", strlen("UTC_OFFSET")) == 0)
-        {
-            sscanf (rec->process_parameters.param[i], "UTC_OFFSET=%s", str);
-            if ((abs(atoi(str)) >= 0) && (abs(atoi(str)) <= 12))
-            {
-                p->utc_offset = atoi(str);
-            }
-            else
-            {
-                p->utc_offset = GSF_UNKNOWN_PARAM_INT;
-            }
-        }
-
-        else if (strncmp(rec->process_parameters.param[i], "ROLL_REFERENCE", strlen("ROLL_REFERENCE")) == 0)
-        {
-            sscanf (rec->process_parameters.param[i], "ROLL_REFERENCE=%s", str);
-            if (strcmp(str, "HORIZONTAL_PITCH_AXIS") == 0)
-            {
-                p->roll_reference = GSF_HORIZONTAL_PITCH_AXIS;
-            }
-            else if (strcmp(str, "ROTATED_PITCH_AXIS") == 0)
-            {
-                p->roll_reference = GSF_ROTATED_PITCH_AXIS;
-            }
-            else
-            {
-                p->roll_reference = GSF_UNKNOWN_PARAM_INT;
-            }
-        }
-
-
-        else if (strncmp(rec->process_parameters.param[i], "DRAFT_TO_APPLY", strlen("DRAFT_TO_APPLY")) == 0)
-        {
-            p->to_apply.draft[0] = GSF_UNKNOWN_PARAM_VALUE;
-            p->to_apply.draft[1] = GSF_UNKNOWN_PARAM_VALUE;
-            if (!strstr(rec->process_parameters.param[i], GSF_UNKNOWN_PARAM_TEXT))
-            {
-                sscanf (rec->process_parameters.param[i], "DRAFT_TO_APPLY=%lf,%lf",
-                    &p->to_apply.draft[0],
-                    &p->to_apply.draft[1]);
-            }
-            /* Get the number of array pairs from each sonar alignment parameter */
-            *numArrays = gsfNumberParams(rec->process_parameters.param[i]);
-            if (!num_tx)
-                num_tx = *numArrays;
-        }
-        else if (strncmp(rec->process_parameters.param[i], "PITCH_TO_APPLY", strlen("PITCH_TO_APPLY")) == 0)
-        {
-            p->to_apply.pitch_bias[0] = GSF_UNKNOWN_PARAM_VALUE;
-            p->to_apply.pitch_bias[1] = GSF_UNKNOWN_PARAM_VALUE;
-            if (!strstr(rec->process_parameters.param[i], GSF_UNKNOWN_PARAM_TEXT))
-            {
-                sscanf (rec->process_parameters.param[i], "PITCH_TO_APPLY=%lf,%lf",
-                    &p->to_apply.pitch_bias[0],
-                    &p->to_apply.pitch_bias[1]);
-            }
-            /* Get the number of array pairs from each sonar alignment parameter */
-            *numArrays = gsfNumberParams(rec->process_parameters.param[i]);
-            if (!num_tx)
-                num_tx = *numArrays;
-        }
-        else if (strncmp(rec->process_parameters.param[i], "ROLL_TO_APPLY", strlen("ROLL_TO_APPLY")) == 0)
-        {
-            p->to_apply.roll_bias[0] = GSF_UNKNOWN_PARAM_VALUE;
-            p->to_apply.roll_bias[1] = GSF_UNKNOWN_PARAM_VALUE;
-            if (!strstr(rec->process_parameters.param[i], GSF_UNKNOWN_PARAM_TEXT))
-            {
-                sscanf (rec->process_parameters.param[i], "ROLL_TO_APPLY=%lf,%lf",
-                    &p->to_apply.roll_bias[0],
-                    &p->to_apply.roll_bias[1]);
-            }
-            /* Get the number of array pairs from each sonar alignment parameter */
-            *numArrays = gsfNumberParams(rec->process_parameters.param[i]);
-            if (!num_tx)
-                num_tx = *numArrays;
-        }
-        else if (strncmp(rec->process_parameters.param[i], "GYRO_TO_APPLY", strlen("GYRO_TO_APPLY")) == 0)
-        {
-            p->to_apply.gyro_bias[0] = GSF_UNKNOWN_PARAM_VALUE;
-            p->to_apply.gyro_bias[1] = GSF_UNKNOWN_PARAM_VALUE;
-            if (!strstr(rec->process_parameters.param[i], GSF_UNKNOWN_PARAM_TEXT))
-            {
-                sscanf (rec->process_parameters.param[i], "GYRO_TO_APPLY=%lf,%lf",
-                    &p->to_apply.gyro_bias[0],
-                    &p->to_apply.gyro_bias[1]);
-            }
-            /* Get the number of array pairs from each sonar alignment parameter */
-            *numArrays = gsfNumberParams(rec->process_parameters.param[i]);
-            if (!num_tx)
-                num_tx = *numArrays;
-        }
-        /* The POSITION_OFFSET_TO_APPLY parameter is place holder for a known,
-         * but presently uncorrected position reference offset. The string
-         * contains an x,y,z triplet which defines the location on the
-         * vessel to which the latitude and longitude are relative.
-         */
-        else if (strncmp(rec->process_parameters.param[i], "POSITION_OFFSET_TO_APPLY", strlen("POSITION_OFFSET_TO_APPLY")) == 0)
-        {
-            p->to_apply.position_x_offset = GSF_UNKNOWN_PARAM_VALUE;
-            p->to_apply.position_y_offset = GSF_UNKNOWN_PARAM_VALUE;
-            p->to_apply.position_z_offset = GSF_UNKNOWN_PARAM_VALUE;
-            if (!strstr(rec->process_parameters.param[i], GSF_UNKNOWN_PARAM_TEXT))
-            {
-                sscanf (rec->process_parameters.param[i], "POSITION_OFFSET_TO_APPLY=%lf,%lf,%lf",
-                    &p->to_apply.position_x_offset,
-                    &p->to_apply.position_y_offset,
-                    &p->to_apply.position_z_offset);
-            }
-        }
-        else if (strncmp(rec->process_parameters.param[i], "TRANSDUCER_OFFSET_TO_APPLY", strlen("TRANSDUCER_OFFSET_TO_APPLY")) == 0)
-        {
-            p->to_apply.transducer_x_offset[0] = GSF_UNKNOWN_PARAM_VALUE;
-            p->to_apply.transducer_y_offset[0] = GSF_UNKNOWN_PARAM_VALUE;
-            p->to_apply.transducer_z_offset[0] = GSF_UNKNOWN_PARAM_VALUE;
-            p->to_apply.transducer_x_offset[1] = GSF_UNKNOWN_PARAM_VALUE;
-            p->to_apply.transducer_y_offset[1] = GSF_UNKNOWN_PARAM_VALUE;
-            p->to_apply.transducer_z_offset[1] = GSF_UNKNOWN_PARAM_VALUE;
-            if (!strstr(rec->process_parameters.param[i], GSF_UNKNOWN_PARAM_TEXT))
-            {
-                sscanf (rec->process_parameters.param[i], "TRANSDUCER_OFFSET_TO_APPLY=%lf,%lf,%lf,%lf,%lf,%lf",
-                    &p->to_apply.transducer_x_offset[0],
-                    &p->to_apply.transducer_y_offset[0],
-                    &p->to_apply.transducer_z_offset[0],
-                    &p->to_apply.transducer_x_offset[1],
-                    &p->to_apply.transducer_y_offset[1],
-                    &p->to_apply.transducer_z_offset[1]);
-            }
-        }
-        else if (strncmp(rec->process_parameters.param[i], "TRANSDUCER_PITCH_OFFSET_TO_APPLY", strlen("TRANSDUCER_PITCH_OFFSET_TO_APPLY")) == 0)
-        {
-            p->to_apply.transducer_pitch_offset[0] = GSF_UNKNOWN_PARAM_VALUE;
-            p->to_apply.transducer_pitch_offset[1] = GSF_UNKNOWN_PARAM_VALUE;
-            if (!strstr(rec->process_parameters.param[i], GSF_UNKNOWN_PARAM_TEXT))
-            {
-                sscanf (rec->process_parameters.param[i], "TRANSDUCER_PITCH_OFFSET_TO_APPLY=%lf,%lf",
-                    &p->to_apply.transducer_pitch_offset[0],
-                    &p->to_apply.transducer_pitch_offset[1]);
-            }
-            /* Get the number of array pairs from each sonar alignment parameter */
-            *numArrays = gsfNumberParams(rec->process_parameters.param[i]);
-            if (!num_tx)
-                num_tx = *numArrays;
-        }
-        else if (strncmp(rec->process_parameters.param[i], "TRANSDUCER_ROLL_OFFSET_TO_APPLY", strlen("TRANSDUCER_ROLL_OFFSET_TO_APPLY")) == 0)
-        {
-            p->to_apply.transducer_roll_offset[0] = GSF_UNKNOWN_PARAM_VALUE;
-            p->to_apply.transducer_roll_offset[1] = GSF_UNKNOWN_PARAM_VALUE;
-            if (!strstr(rec->process_parameters.param[i], GSF_UNKNOWN_PARAM_TEXT))
-            {
-                sscanf (rec->process_parameters.param[i], "TRANSDUCER_ROLL_OFFSET_TO_APPLY=%lf,%lf",
-                    &p->to_apply.transducer_roll_offset[0],
-                    &p->to_apply.transducer_roll_offset[1]);
-            }
-            /* Get the number of array pairs from each sonar alignment parameter */
-            *numArrays = gsfNumberParams(rec->process_parameters.param[i]);
-            if (!num_tx)
-                num_tx = *numArrays;
-        }
-        else if (strncmp(rec->process_parameters.param[i], "TRANSDUCER_HEADING_OFFSET_TO_APPLY", strlen("TRANSDUCER_HEADING_OFFSET_TO_APPLY")) == 0)
-        {
-            p->to_apply.transducer_heading_offset[0] = GSF_UNKNOWN_PARAM_VALUE;
-            p->to_apply.transducer_heading_offset[1] = GSF_UNKNOWN_PARAM_VALUE;
-            if (!strstr(rec->process_parameters.param[i], GSF_UNKNOWN_PARAM_TEXT))
-            {
-                sscanf (rec->process_parameters.param[i], "TRANSDUCER_HEADING_OFFSET_TO_APPLY=%lf,%lf",
-                    &p->to_apply.transducer_heading_offset[0],
-                    &p->to_apply.transducer_heading_offset[1]);
-            }
-            /* Get the number of array pairs from each sonar alignment parameter */
-            *numArrays = gsfNumberParams(rec->process_parameters.param[i]);
-            if (!num_tx)
-                num_tx = *numArrays;
-        }
-        else if (strncmp(rec->process_parameters.param[i], "MRU_PITCH_TO_APPLY", strlen("MRU_PITCH_TO_APPLY")) == 0)
-        {
-            p->to_apply.mru_pitch_bias = GSF_UNKNOWN_PARAM_VALUE;
-            if (!strstr(rec->process_parameters.param[i], GSF_UNKNOWN_PARAM_TEXT))
-            {
-                sscanf (rec->process_parameters.param[i], "MRU_PITCH_TO_APPLY=%lf",
-                    &p->to_apply.mru_pitch_bias);
-            }
-        }
-        else if (strncmp(rec->process_parameters.param[i], "MRU_ROLL_TO_APPLY", strlen("MRU_ROLL_TO_APPLY")) == 0)
-        {
-            p->to_apply.mru_roll_bias = GSF_UNKNOWN_PARAM_VALUE;
-            if (!strstr(rec->process_parameters.param[i], GSF_UNKNOWN_PARAM_TEXT))
-            {
-                sscanf (rec->process_parameters.param[i], "MRU_ROLL_TO_APPLY=%lf",
-                    &p->to_apply.mru_roll_bias);
-            }
-        }
-        else if (strncmp(rec->process_parameters.param[i], "MRU_HEADING_TO_APPLY", strlen("MRU_HEADING_TO_APPLY")) == 0)
-        {
-            p->to_apply.mru_heading_bias = GSF_UNKNOWN_PARAM_VALUE;
-            if (!strstr(rec->process_parameters.param[i], GSF_UNKNOWN_PARAM_TEXT))
-            {
-                sscanf (rec->process_parameters.param[i], "MRU_HEADING_TO_APPLY=%lf",
-                    &p->to_apply.mru_heading_bias);
-            }
-        }
-        else if (strncmp(rec->process_parameters.param[i], "MRU_OFFSET_TO_APPLY", strlen("MRU_OFFSET_TO_APPLY")) == 0)
-        {
-            p->to_apply.mru_x_offset = GSF_UNKNOWN_PARAM_VALUE;
-            p->to_apply.mru_y_offset = GSF_UNKNOWN_PARAM_VALUE;
-            p->to_apply.mru_z_offset = GSF_UNKNOWN_PARAM_VALUE;
-            if (!strstr(rec->process_parameters.param[i], GSF_UNKNOWN_PARAM_TEXT))
-            {
-                sscanf (rec->process_parameters.param[i], "MRU_OFFSET_TO_APPLY=%lf,%lf,%lf",
-                    &p->to_apply.mru_x_offset,
-                    &p->to_apply.mru_y_offset,
-                    &p->to_apply.mru_z_offset);
-            }
-        }
-        else if (strncmp(rec->process_parameters.param[i], "ANTENNA_OFFSET_TO_APPLY", strlen("ANTENNA_OFFSET_TO_APPLY")) == 0)
-        {
-            p->to_apply.antenna_x_offset = GSF_UNKNOWN_PARAM_VALUE;
-            p->to_apply.antenna_y_offset = GSF_UNKNOWN_PARAM_VALUE;
-            p->to_apply.antenna_z_offset = GSF_UNKNOWN_PARAM_VALUE;
-            if (!strstr(rec->process_parameters.param[i], GSF_UNKNOWN_PARAM_TEXT))
-            {
-                sscanf (rec->process_parameters.param[i], "ANTENNA_OFFSET_TO_APPLY=%lf,%lf,%lf",
-                    &p->to_apply.antenna_x_offset,
-                    &p->to_apply.antenna_y_offset,
-                    &p->to_apply.antenna_z_offset);
-            }
-        }
-        else if (strncmp(rec->process_parameters.param[i], "CENTER_OF_ROTATION_OFFSET_TO_APPLY", strlen("CENTER_OF_ROTATION_OFFSET_TO_APPLY")) == 0)
-        {
-            p->to_apply.center_of_rotation_x_offset = GSF_UNKNOWN_PARAM_VALUE;
-            p->to_apply.center_of_rotation_y_offset = GSF_UNKNOWN_PARAM_VALUE;
-            p->to_apply.center_of_rotation_z_offset = GSF_UNKNOWN_PARAM_VALUE;
-            if (!strstr(rec->process_parameters.param[i], GSF_UNKNOWN_PARAM_TEXT))
-            {
-                sscanf (rec->process_parameters.param[i], "CENTER_OF_ROTATION_OFFSET_TO_APPLY=%lf,%lf,%lf",
-                    &p->to_apply.center_of_rotation_x_offset,
-                    &p->to_apply.center_of_rotation_y_offset,
-                    &p->to_apply.center_of_rotation_z_offset);
-            }
-        }
-        else if (strncmp(rec->process_parameters.param[i], "POSITION_LATENCY_TO_APPLY", strlen("POSITION_LATENCY_TO_APPLY")) == 0)
-        {
-            p->to_apply.position_latency = GSF_UNKNOWN_PARAM_VALUE;
-            if (!strstr(rec->process_parameters.param[i], GSF_UNKNOWN_PARAM_TEXT))
-            {
-                sscanf (rec->process_parameters.param[i], "POSITION_LATENCY_TO_APPLY=%lf",
-                    &p->to_apply.position_latency);
-            }
-        }
-        else if (strncmp(rec->process_parameters.param[i], "ATTITUDE_LATENCY_TO_APPLY", strlen("ATTITUDE_LATENCY_TO_APPLY")) == 0)
-        {
-            p->to_apply.attitude_latency = GSF_UNKNOWN_PARAM_VALUE;
-            if (!strstr(rec->process_parameters.param[i], GSF_UNKNOWN_PARAM_TEXT))
-            {
-                sscanf (rec->process_parameters.param[i], "ATTITUDE_LATENCY_TO_APPLY=%lf",
-                    &p->to_apply.attitude_latency);
-            }
-        }
-        else if (strncmp(rec->process_parameters.param[i], "DEPTH_SENSOR_LATENCY_TO_APPLY", strlen("DEPTH_SENSOR_LATENCY_TO_APPLY")) == 0)
-        {
-            p->to_apply.depth_sensor_latency = GSF_UNKNOWN_PARAM_VALUE;
-            if (!strstr(rec->process_parameters.param[i], GSF_UNKNOWN_PARAM_TEXT))
-            {
-                sscanf (rec->process_parameters.param[i], "DEPTH_SENSOR_LATENCY_TO_APPLY=%lf",
-                    &p->to_apply.depth_sensor_latency);
-            }
-        }
-        else if (strncmp(rec->process_parameters.param[i], "DEPTH_SENSOR_OFFSET_TO_APPLY", strlen("DEPTH_SENSOR_OFFSET_TO_APPLY")) == 0)
-        {
-            p->to_apply.depth_sensor_x_offset = GSF_UNKNOWN_PARAM_VALUE;
-            p->to_apply.depth_sensor_y_offset = GSF_UNKNOWN_PARAM_VALUE;
-            p->to_apply.depth_sensor_z_offset = GSF_UNKNOWN_PARAM_VALUE;
-            if (!strstr(rec->process_parameters.param[i], GSF_UNKNOWN_PARAM_TEXT))
-            {
-                sscanf (rec->process_parameters.param[i], "DEPTH_SENSOR_OFFSET_TO_APPLY=%lf,%lf,%lf",
-                    &p->to_apply.depth_sensor_x_offset,
-                    &p->to_apply.depth_sensor_y_offset,
-                    &p->to_apply.depth_sensor_z_offset);
-            }
-        }
-        else if (strncmp(rec->process_parameters.param[i], "RX_TRANSDUCER_OFFSET_TO_APPLY", strlen("RX_TRANSDUCER_OFFSET_TO_APPLY")) == 0)
-        {
-            p->to_apply.rx_transducer_x_offset[0] = GSF_UNKNOWN_PARAM_VALUE;
-            p->to_apply.rx_transducer_y_offset[0] = GSF_UNKNOWN_PARAM_VALUE;
-            p->to_apply.rx_transducer_z_offset[0] = GSF_UNKNOWN_PARAM_VALUE;
-            p->to_apply.rx_transducer_x_offset[1] = GSF_UNKNOWN_PARAM_VALUE;
-            p->to_apply.rx_transducer_y_offset[1] = GSF_UNKNOWN_PARAM_VALUE;
-            p->to_apply.rx_transducer_z_offset[1] = GSF_UNKNOWN_PARAM_VALUE;
-            if (!strstr(rec->process_parameters.param[i], GSF_UNKNOWN_PARAM_TEXT))
-            {
-                sscanf (rec->process_parameters.param[i], "RX_TRANSDUCER_OFFSET_TO_APPLY=%lf,%lf,%lf,%lf,%lf,%lf",
-                    &p->to_apply.rx_transducer_x_offset[0],
-                    &p->to_apply.rx_transducer_y_offset[0],
-                    &p->to_apply.rx_transducer_z_offset[0],
-                    &p->to_apply.rx_transducer_x_offset[1],
-                    &p->to_apply.rx_transducer_y_offset[1],
-                    &p->to_apply.rx_transducer_z_offset[1]);
-            }
-        }
-        else if (strncmp(rec->process_parameters.param[i], "RX_TRANSDUCER_PITCH_OFFSET_TO_APPLY", strlen("RX_TRANSDUCER_PITCH_OFFSET_TO_APPLY")) == 0)
-        {
-            p->to_apply.rx_transducer_pitch_offset[0] = GSF_UNKNOWN_PARAM_VALUE;
-            p->to_apply.rx_transducer_pitch_offset[1] = GSF_UNKNOWN_PARAM_VALUE;
-            if (!strstr(rec->process_parameters.param[i], GSF_UNKNOWN_PARAM_TEXT))
-            {
-                sscanf (rec->process_parameters.param[i], "RX_TRANSDUCER_PITCH_OFFSET_TO_APPLY=%lf,%lf",
-                    &p->to_apply.rx_transducer_pitch_offset[0],
-                    &p->to_apply.rx_transducer_pitch_offset[1]);
-            }
-            if (!num_rx)
-                num_rx = gsfNumberParams(rec->process_parameters.param[i]);
-        }
-        else if (strncmp(rec->process_parameters.param[i], "RX_TRANSDUCER_ROLL_OFFSET_TO_APPLY", strlen("RX_TRANSDUCER_ROLL_OFFSET_TO_APPLY")) == 0)
-        {
-            p->to_apply.rx_transducer_roll_offset[0] = GSF_UNKNOWN_PARAM_VALUE;
-            p->to_apply.rx_transducer_roll_offset[1] = GSF_UNKNOWN_PARAM_VALUE;
-            if (!strstr(rec->process_parameters.param[i], GSF_UNKNOWN_PARAM_TEXT))
-            {
-                sscanf (rec->process_parameters.param[i], "RX_TRANSDUCER_ROLL_OFFSET_TO_APPLY=%lf,%lf",
-                    &p->to_apply.rx_transducer_roll_offset[0],
-                    &p->to_apply.rx_transducer_roll_offset[1]);
-            }
-            if (!num_rx)
-                num_rx = gsfNumberParams(rec->process_parameters.param[i]);
-        }
-        else if (strncmp(rec->process_parameters.param[i], "RX_TRANSDUCER_HEADING_OFFSET_TO_APPLY", strlen("RX_TRANSDUCER_HEADING_OFFSET_TO_APPLY")) == 0)
-        {
-            p->to_apply.rx_transducer_heading_offset[0] = GSF_UNKNOWN_PARAM_VALUE;
-            p->to_apply.rx_transducer_heading_offset[1] = GSF_UNKNOWN_PARAM_VALUE;
-            if (!strstr(rec->process_parameters.param[i], GSF_UNKNOWN_PARAM_TEXT))
-            {
-                sscanf (rec->process_parameters.param[i], "RX_TRANSDUCER_HEADING_OFFSET_TO_APPLY=%lf,%lf",
-                    &p->to_apply.rx_transducer_heading_offset[0],
-                    &p->to_apply.rx_transducer_heading_offset[1]);
-            }
-            if (!num_rx)
-                num_rx = gsfNumberParams(rec->process_parameters.param[i]);
-        }  /** end of "to apply" values */
-        else if (strncmp(rec->process_parameters.param[i], "APPLIED_DRAFT", strlen("APPLIED_DRAFT")) == 0)
-        {
-            p->applied.draft[0] = GSF_UNKNOWN_PARAM_VALUE;
-            p->applied.draft[1] = GSF_UNKNOWN_PARAM_VALUE;
-            if (!strstr(rec->process_parameters.param[i], GSF_UNKNOWN_PARAM_TEXT))
-            {
-                sscanf (rec->process_parameters.param[i], "APPLIED_DRAFT=%lf,%lf",
-                    &p->applied.draft[0],
-                    &p->applied.draft[1]);
-            }
-            /* Get the number of array pairs from each sonar alignment parameter */
-            *numArrays = gsfNumberParams(rec->process_parameters.param[i]);
-            if (!num_tx)
-                num_tx = *numArrays;
-        }
-        else if (strncmp(rec->process_parameters.param[i], "APPLIED_PITCH_BIAS", strlen("APPLIED_PITCH_BIAS")) == 0)
-        {
-            p->applied.pitch_bias[0] = GSF_UNKNOWN_PARAM_VALUE;
-            p->applied.pitch_bias[1] = GSF_UNKNOWN_PARAM_VALUE;
-            if (!strstr(rec->process_parameters.param[i], GSF_UNKNOWN_PARAM_TEXT))
-            {
-                sscanf (rec->process_parameters.param[i], "APPLIED_PITCH_BIAS=%lf,%lf",
-                    &p->applied.pitch_bias[0],
-                    &p->applied.pitch_bias[1]);
-            }
-            /* Get the number of array pairs from each sonar alignment parameter */
-            *numArrays = gsfNumberParams(rec->process_parameters.param[i]);
-            if (!num_tx)
-                num_tx = *numArrays;
-        }
-        else if (strncmp(rec->process_parameters.param[i], "APPLIED_ROLL_BIAS", strlen("APPLIED_ROLL_BIAS")) == 0)
-        {
-            p->applied.roll_bias[0] = GSF_UNKNOWN_PARAM_VALUE;
-            p->applied.roll_bias[1] = GSF_UNKNOWN_PARAM_VALUE;
-            if (!strstr(rec->process_parameters.param[i], GSF_UNKNOWN_PARAM_TEXT))
-            {
-                sscanf (rec->process_parameters.param[i], "APPLIED_ROLL_BIAS=%lf,%lf",
-                    &p->applied.roll_bias[0],
-                    &p->applied.roll_bias[1]);
-            }
-            /* Get the number of array pairs from each sonar alignment parameter */
-            *numArrays = gsfNumberParams(rec->process_parameters.param[i]);
-            if (!num_tx)
-                num_tx = *numArrays;
-        }
-        else if (strncmp(rec->process_parameters.param[i], "APPLIED_GYRO_BIAS", strlen("APPLIED_GYRO_BIAS")) == 0)
-        {
-            p->applied.gyro_bias[0] = GSF_UNKNOWN_PARAM_VALUE;
-            p->applied.gyro_bias[1] = GSF_UNKNOWN_PARAM_VALUE;
-            if (!strstr(rec->process_parameters.param[i], GSF_UNKNOWN_PARAM_TEXT))
-            {
-                sscanf (rec->process_parameters.param[i], "APPLIED_GYRO_BIAS=%lf,%lf",
-                    &p->applied.gyro_bias[0],
-                    &p->applied.gyro_bias[1]);
-            }
-            /* Get the number of array pairs from each sonar alignment parameter */
-            *numArrays = gsfNumberParams(rec->process_parameters.param[i]);
-            if (!num_tx)
-                num_tx = *numArrays;
-        }
-        /* The APPLIED_POSITION_OFFSET parameter defines the x,y,z position in
-         * ship coordinates to which the lat lons are relative.
-         */
-         else if (strncmp(rec->process_parameters.param[i], "APPLIED_POSITION_OFFSET", strlen("APPLIED_POSITION_OFFSET")) == 0)
-         {
-            p->applied.position_x_offset = GSF_UNKNOWN_PARAM_VALUE;
-            p->applied.position_y_offset = GSF_UNKNOWN_PARAM_VALUE;
-            p->applied.position_z_offset = GSF_UNKNOWN_PARAM_VALUE;
-            if (!strstr(rec->process_parameters.param[i], GSF_UNKNOWN_PARAM_TEXT))
-            {
-                sscanf (rec->process_parameters.param[i], "APPLIED_POSITION_OFFSET=%lf,%lf,%lf",
-                    &p->applied.position_x_offset,
-                    &p->applied.position_y_offset,
-                    &p->applied.position_z_offset);
-            }
-         }
-        else if (strncmp(rec->process_parameters.param[i], "APPLIED_ANTENNA_OFFSET", strlen("APPLIED_ANTENNA_OFFSET")) == 0)
-        {
-           p->applied.antenna_x_offset = GSF_UNKNOWN_PARAM_VALUE;
-           p->applied.antenna_y_offset = GSF_UNKNOWN_PARAM_VALUE;
-           p->applied.antenna_z_offset = GSF_UNKNOWN_PARAM_VALUE;
-           if (!strstr(rec->process_parameters.param[i], GSF_UNKNOWN_PARAM_TEXT))
-           {
-               sscanf (rec->process_parameters.param[i], "APPLIED_ANTENNA_OFFSET=%lf,%lf,%lf",
-                   &p->applied.antenna_x_offset,
-                   &p->applied.antenna_y_offset,
-                   &p->applied.antenna_z_offset);
-           }
-        }
-        /* The APPLIED_TRANSDUCER_OFFSET parameter defines the x,y,z offsets
-         * in ship coordinates to which have been applied to refer the x,y,z
-         * beam values to the ship reference point.
-         */
-        else if (strncmp(rec->process_parameters.param[i], "APPLIED_TRANSDUCER_OFFSET", strlen("APPLIED_TRANSDUCER_OFFSET")) == 0)
-        {
-            p->applied.transducer_x_offset[0] = GSF_UNKNOWN_PARAM_VALUE;
-            p->applied.transducer_y_offset[0] = GSF_UNKNOWN_PARAM_VALUE;
-            p->applied.transducer_z_offset[0] = GSF_UNKNOWN_PARAM_VALUE;
-            p->applied.transducer_x_offset[1] = GSF_UNKNOWN_PARAM_VALUE;
-            p->applied.transducer_y_offset[1] = GSF_UNKNOWN_PARAM_VALUE;
-            p->applied.transducer_z_offset[1] = GSF_UNKNOWN_PARAM_VALUE;
-            if (!strstr(rec->process_parameters.param[i], GSF_UNKNOWN_PARAM_TEXT))
-            {
-                sscanf (rec->process_parameters.param[i], "APPLIED_TRANSDUCER_OFFSET=%lf,%lf,%lf,%lf,%lf,%lf",
-                    &p->applied.transducer_x_offset[0],
-                    &p->applied.transducer_y_offset[0],
-                    &p->applied.transducer_z_offset[0],
-                    &p->applied.transducer_x_offset[1],
-                    &p->applied.transducer_y_offset[1],
-                    &p->applied.transducer_z_offset[1]);
-            }
-        }
-        else if (strncmp(rec->process_parameters.param[i], "APPLIED_TRANSDUCER_PITCH_OFFSET", strlen("APPLIED_TRANSDUCER_PITCH_OFFSET")) == 0)
-        {
-            p->applied.transducer_pitch_offset[0] = GSF_UNKNOWN_PARAM_VALUE;
-            p->applied.transducer_pitch_offset[1] = GSF_UNKNOWN_PARAM_VALUE;
-            if (!strstr(rec->process_parameters.param[i], GSF_UNKNOWN_PARAM_TEXT))
-            {
-                sscanf (rec->process_parameters.param[i], "APPLIED_TRANSDUCER_PITCH_OFFSET=%lf,%lf",
-                    &p->applied.transducer_pitch_offset[0],
-                    &p->applied.transducer_pitch_offset[1]);
-            }
-            /* Get the number of array pairs from each sonar alignment parameter */
-            *numArrays = gsfNumberParams(rec->process_parameters.param[i]);
-            if (!num_tx)
-                num_tx = *numArrays;
-        }
-        else if (strncmp(rec->process_parameters.param[i], "APPLIED_TRANSDUCER_ROLL_OFFSET", strlen("APPLIED_TRANSDUCER_ROLL_OFFSET")) == 0)
-        {
-            p->applied.transducer_roll_offset[0] = GSF_UNKNOWN_PARAM_VALUE;
-            p->applied.transducer_roll_offset[1] = GSF_UNKNOWN_PARAM_VALUE;
-            if (!strstr(rec->process_parameters.param[i], GSF_UNKNOWN_PARAM_TEXT))
-            {
-                sscanf (rec->process_parameters.param[i], "APPLIED_TRANSDUCER_ROLL_OFFSET=%lf,%lf",
-                    &p->applied.transducer_roll_offset[0],
-                    &p->applied.transducer_roll_offset[1]);
-            }
-            /* Get the number of array pairs from each sonar alignment parameter */
-            *numArrays = gsfNumberParams(rec->process_parameters.param[i]);
-            if (!num_tx)
-                num_tx = *numArrays;
-        }
-        else if (strncmp(rec->process_parameters.param[i], "APPLIED_TRANSDUCER_HEADING_OFFSET", strlen("APPLIED_TRANSDUCER_HEADING_OFFSET")) == 0)
-        {
-            p->applied.transducer_heading_offset[0] = GSF_UNKNOWN_PARAM_VALUE;
-            p->applied.transducer_heading_offset[1] = GSF_UNKNOWN_PARAM_VALUE;
-            if (!strstr(rec->process_parameters.param[i], GSF_UNKNOWN_PARAM_TEXT))
-            {
-                sscanf (rec->process_parameters.param[i], "APPLIED_TRANSDUCER_HEADING_OFFSET=%lf,%lf",
-                    &p->applied.transducer_heading_offset[0],
-                    &p->applied.transducer_heading_offset[1]);
-            }
-            /* Get the number of array pairs from each sonar alignment parameter */
-            *numArrays = gsfNumberParams(rec->process_parameters.param[i]);
-            if (!num_tx)
-                num_tx = *numArrays;
-        }
-        else if (strncmp(rec->process_parameters.param[i], "APPLIED_MRU_PITCH", strlen("APPLIED_MRU_PITCH")) == 0)
-        {
-            p->applied.mru_pitch_bias = GSF_UNKNOWN_PARAM_VALUE;
-            if (!strstr(rec->process_parameters.param[i], GSF_UNKNOWN_PARAM_TEXT))
-            {
-                sscanf (rec->process_parameters.param[i], "APPLIED_MRU_PITCH=%lf",
-                    &p->applied.mru_pitch_bias);
-            }
-        }
-        else if (strncmp(rec->process_parameters.param[i], "APPLIED_MRU_ROLL", strlen("APPLIED_MRU_ROLL")) == 0)
-        {
-            p->applied.mru_roll_bias = GSF_UNKNOWN_PARAM_VALUE;
-            if (!strstr(rec->process_parameters.param[i], GSF_UNKNOWN_PARAM_TEXT))
-            {
-                sscanf (rec->process_parameters.param[i], "APPLIED_MRU_ROLL=%lf",
-                    &p->applied.mru_roll_bias);
-            }
-        }
-        else if (strncmp(rec->process_parameters.param[i], "APPLIED_MRU_HEADING", strlen("APPLIED_MRU_HEADING")) == 0)
-        {
-            p->applied.mru_heading_bias = GSF_UNKNOWN_PARAM_VALUE;
-            if (!strstr(rec->process_parameters.param[i], GSF_UNKNOWN_PARAM_TEXT))
-            {
-                sscanf (rec->process_parameters.param[i], "APPLIED_MRU_HEADING=%lf",
-                    &p->applied.mru_heading_bias);
-            }
-        }
-        else if (strncmp(rec->process_parameters.param[i], "APPLIED_MRU_OFFSET", strlen("APPLIED_MRU_OFFSET")) == 0)
-        {
-            p->applied.mru_x_offset = GSF_UNKNOWN_PARAM_VALUE;
-            p->applied.mru_y_offset = GSF_UNKNOWN_PARAM_VALUE;
-            p->applied.mru_z_offset = GSF_UNKNOWN_PARAM_VALUE;
-            if (!strstr(rec->process_parameters.param[i], GSF_UNKNOWN_PARAM_TEXT))
-            {
-                sscanf (rec->process_parameters.param[i], "APPLIED_MRU_OFFSET=%lf,%lf,%lf",
-                    &p->applied.mru_x_offset,
-                    &p->applied.mru_y_offset,
-                    &p->applied.mru_z_offset);
-            }
-        }
-        else if (strncmp(rec->process_parameters.param[i], "APPLIED_CENTER_OF_ROTATION_OFFSET", strlen("APPLIED_CENTER_OF_ROTATION_OFFSET")) == 0)
-        {
-            p->applied.center_of_rotation_x_offset = GSF_UNKNOWN_PARAM_VALUE;
-            p->applied.center_of_rotation_y_offset = GSF_UNKNOWN_PARAM_VALUE;
-            p->applied.center_of_rotation_z_offset = GSF_UNKNOWN_PARAM_VALUE;
-            if (!strstr(rec->process_parameters.param[i], GSF_UNKNOWN_PARAM_TEXT))
-            {
-                sscanf (rec->process_parameters.param[i], "APPLIED_CENTER_OF_ROTATION_OFFSET=%lf,%lf,%lf",
-                    &p->applied.center_of_rotation_x_offset,
-                    &p->applied.center_of_rotation_y_offset,
-                    &p->applied.center_of_rotation_z_offset);
-            }
-        }
-        else if (strncmp(rec->process_parameters.param[i], "APPLIED_POSITION_LATENCY", strlen("APPLIED_POSITION_LATENCY")) == 0)
-        {
-            p->applied.position_latency = GSF_UNKNOWN_PARAM_VALUE;
-            if (!strstr(rec->process_parameters.param[i], GSF_UNKNOWN_PARAM_TEXT))
-            {
-                sscanf (rec->process_parameters.param[i], "APPLIED_POSITION_LATENCY=%lf",
-                    &p->applied.position_latency);
-            }
-        }
-        else if (strncmp(rec->process_parameters.param[i], "APPLIED_ATTITUDE_LATENCY", strlen("APPLIED_ATTITUDE_LATENCY")) == 0)
-        {
-            p->applied.attitude_latency = GSF_UNKNOWN_PARAM_VALUE;
-            if (!strstr(rec->process_parameters.param[i], GSF_UNKNOWN_PARAM_TEXT))
-            {
-                sscanf (rec->process_parameters.param[i], "APPLIED_ATTITUDE_LATENCY=%lf",
-                    &p->applied.attitude_latency);
-            }
-        }
-        else if (strncmp(rec->process_parameters.param[i], "APPLIED_DEPTH_SENSOR_LATENCY", strlen("APPLIED_DEPTH_SENSOR_LATENCY")) == 0)
-        {
-            p->applied.depth_sensor_latency = GSF_UNKNOWN_PARAM_VALUE;
-            if (!strstr(rec->process_parameters.param[i], GSF_UNKNOWN_PARAM_TEXT))
-            {
-                sscanf (rec->process_parameters.param[i], "APPLIED_DEPTH_SENSOR_LATENCY=%lf",
-                    &p->applied.depth_sensor_latency);
-            }
-        }
-        else if (strncmp(rec->process_parameters.param[i], "APPLIED_DEPTH_SENSOR_OFFSET", strlen("APPLIED_DEPTH_SENSOR_OFFSET")) == 0)
-        {
-            p->applied.depth_sensor_x_offset = GSF_UNKNOWN_PARAM_VALUE;
-            p->applied.depth_sensor_y_offset = GSF_UNKNOWN_PARAM_VALUE;
-            p->applied.depth_sensor_z_offset = GSF_UNKNOWN_PARAM_VALUE;
-            if (!strstr(rec->process_parameters.param[i], GSF_UNKNOWN_PARAM_TEXT))
-            {
-                sscanf (rec->process_parameters.param[i], "APPLIED_DEPTH_SENSOR_OFFSET=%lf,%lf,%lf",
-                    &p->applied.depth_sensor_x_offset,
-                    &p->applied.depth_sensor_y_offset,
-                    &p->applied.depth_sensor_z_offset);
-            }
-        }
-        else if (strncmp(rec->process_parameters.param[i], "APPLIED_RX_TRANSDUCER_OFFSET", strlen("APPLIED_RX_TRANSDUCER_OFFSET")) == 0)
-        {
-            p->applied.rx_transducer_x_offset[0] = GSF_UNKNOWN_PARAM_VALUE;
-            p->applied.rx_transducer_y_offset[0] = GSF_UNKNOWN_PARAM_VALUE;
-            p->applied.rx_transducer_z_offset[0] = GSF_UNKNOWN_PARAM_VALUE;
-            p->applied.rx_transducer_x_offset[1] = GSF_UNKNOWN_PARAM_VALUE;
-            p->applied.rx_transducer_y_offset[1] = GSF_UNKNOWN_PARAM_VALUE;
-            p->applied.rx_transducer_z_offset[1] = GSF_UNKNOWN_PARAM_VALUE;
-            if (!strstr(rec->process_parameters.param[i], GSF_UNKNOWN_PARAM_TEXT))
-            {
-                sscanf (rec->process_parameters.param[i], "APPLIED_RX_TRANSDUCER_OFFSET=%lf,%lf,%lf,%lf,%lf,%lf",
-                    &p->applied.rx_transducer_x_offset[0],
-                    &p->applied.rx_transducer_y_offset[0],
-                    &p->applied.rx_transducer_z_offset[0],
-                    &p->applied.rx_transducer_x_offset[1],
-                    &p->applied.rx_transducer_y_offset[1],
-                    &p->applied.rx_transducer_z_offset[1]);
-            }
-        }
-        else if (strncmp(rec->process_parameters.param[i], "APPLIED_RX_TRANSDUCER_PITCH_OFFSET", strlen("APPLIED_RX_TRANSDUCER_PITCH_OFFSET")) == 0)
-        {
-            p->applied.rx_transducer_pitch_offset[0] = GSF_UNKNOWN_PARAM_VALUE;
-            p->applied.rx_transducer_pitch_offset[1] = GSF_UNKNOWN_PARAM_VALUE;
-            if (!strstr(rec->process_parameters.param[i], GSF_UNKNOWN_PARAM_TEXT))
-            {
-                sscanf (rec->process_parameters.param[i], "APPLIED_RX_TRANSDUCER_PITCH_OFFSET=%lf,%lf",
-                    &p->applied.rx_transducer_pitch_offset[0],
-                    &p->applied.rx_transducer_pitch_offset[1]);
-            }
-        }
-        else if (strncmp(rec->process_parameters.param[i], "APPLIED_RX_TRANSDUCER_ROLL_OFFSET", strlen("APPLIED_RX_TRANSDUCER_ROLL_OFFSET")) == 0)
-        {
-            p->applied.rx_transducer_roll_offset[0] = GSF_UNKNOWN_PARAM_VALUE;
-            p->applied.rx_transducer_roll_offset[1] = GSF_UNKNOWN_PARAM_VALUE;
-            if (!strstr(rec->process_parameters.param[i], GSF_UNKNOWN_PARAM_TEXT))
-            {
-                sscanf (rec->process_parameters.param[i], "APPLIED_RX_TRANSDUCER_ROLL_OFFSET=%lf,%lf",
-                    &p->applied.rx_transducer_roll_offset[0],
-                    &p->applied.rx_transducer_roll_offset[1]);
-            }
-        }
-        else if (strncmp(rec->process_parameters.param[i], "APPLIED_RX_TRANSDUCER_HEADING_OFFSET", strlen("APPLIED_RX_TRANSDUCER_HEADING_OFFSET")) == 0)
-        {
-            p->applied.rx_transducer_heading_offset[0] = GSF_UNKNOWN_PARAM_VALUE;
-            p->applied.rx_transducer_heading_offset[1] = GSF_UNKNOWN_PARAM_VALUE;
-            if (!strstr(rec->process_parameters.param[i], GSF_UNKNOWN_PARAM_TEXT))
-            {
-                sscanf (rec->process_parameters.param[i], "APPLIED_RX_TRANSDUCER_HEADING_OFFSET=%lf,%lf",
-                    &p->applied.rx_transducer_heading_offset[0],
-                    &p->applied.rx_transducer_heading_offset[1]);
-            }
-        }   /** end of "applied" parameters **/
-
-        /* The horizontal datum parameter defines the elipsoid to which
-         * the latitude and longitude values are referenced.
-         */
-        else if (strncmp(rec->process_parameters.param[i], "GEOID", strlen("GEOID")) == 0)
-        {
-            sscanf (rec->process_parameters.param[i], "GEOID=%s", str);
-            if (strstr(str, "WGS-84"))
-            {
-                p->horizontal_datum = GSF_H_DATUM_WGE;
-            }
-            else
-            {
-                p->horizontal_datum = GSF_H_DATUM_UND;
-            }
-        }
-
-        /* The TIDAL_DATUM paremeter defines the reference datum for tide
-         * corrections
-         */
-        else if (strncmp(rec->process_parameters.param[i], "TIDAL_DATUM", strlen("TIDAL_DATUM")) == 0)
-        {
-            sscanf (rec->process_parameters.param[i], "TIDAL_DATUM=%s",
-                str);
-
-            if (strcmp(str, "MLLW") == 0)
-            {
-                p->vertical_datum = GSF_V_DATUM_MLLW;
-            }
-            else if (strcmp(str, "MLW") == 0)
-            {
-                p->vertical_datum = GSF_V_DATUM_MLW;
-            }
-            else if (strcmp(str, "ALAT") == 0)
-            {
-                p->vertical_datum = GSF_V_DATUM_ALAT;
-            }
-            else if (strcmp(str, "ESLW") == 0)
-            {
-                p->vertical_datum = GSF_V_DATUM_ESLW;
-            }
-            else if (strcmp(str, "ISLW") == 0)
-            {
-                p->vertical_datum = GSF_V_DATUM_ISLW;
-            }
-            else if (strcmp(str, "LAT") == 0)
-            {
-                p->vertical_datum = GSF_V_DATUM_LAT;
-            }
-            else if (strcmp(str, "LLW") == 0)
-            {
-                p->vertical_datum = GSF_V_DATUM_LLW;
-            }
-            else if (strcmp(str, "LNLW") == 0)
-            {
-                p->vertical_datum = GSF_V_DATUM_LNLW;
-            }
-            else if (strcmp(str, "LWD") == 0)
-            {
-                p->vertical_datum = GSF_V_DATUM_LWD;
-            }
-            else if (strcmp(str, "MLHW") == 0)
-            {
-                p->vertical_datum = GSF_V_DATUM_MLHW;
-            }
-            else if (strcmp(str, "MLLWS") == 0)
-            {
-                p->vertical_datum = GSF_V_DATUM_MLLWS;
-            }
-            else if (strcmp(str, "MLWN") == 0)
-            {
-                p->vertical_datum = GSF_V_DATUM_MLWN;
-            }
-            else if (strcmp(str, "MSL") == 0)
-            {
-                p->vertical_datum = GSF_V_DATUM_MSL;
-            }
-            else
-            {
-                p->vertical_datum = GSF_V_DATUM_UNKNOWN;
-            }
-        }
-    }  // for
-    p->number_of_transmitters = num_tx;
-    p->number_of_receivers = num_rx;
-
-    return(0);
-}
-
-/********************************************************************
- *
- * Function Name : numberParams
- *
- * Description : This function parses a KEYWORD=VALUE style parameter
- *   and returns the number of comma delimited values which follow the
- *   equal sign.
- *
- * Inputs :
- *    param = a pointer to a character string containing a KEYWORD=VALUE
- *    style parameter.
- *
- * Returns : This function returns the number of comma delimited values
- *    which follow the equal sign.
- *
- * Error Conditions : none
- *
- ********************************************************************/
-
-static int
-gsfNumberParams(char *param)
-{
-    int number;
-    char *p;
-    char tmp[128];
-
-    strncpy (tmp, param, sizeof(tmp));
-    p = strtok (tmp, ",");
-
-    if (p == NULL)
-    {
-        return (0);
-    }
-    else
-    {
-        number = 1;
-    }
-
-    while ((p = strtok(NULL, ",")) != (char *) NULL)
-    {
-        number++;
-    }
-
-    return (number);
-}
-
-/********************************************************************
- *
- * Function Name : gsfGetSwathBathyBeamWidths
- *
- * Description : This function returns to the caller the fore-aft and
- *    the port-starboard beam widths in degrees for a swath bathymetry
- *    multibeam sonar, given a gsfRecords data structure which contains
- *    a populated gsfSwathBathyPing structure.
- *
- * Inputs :
- *     data = The address of a gsfRecords data structure maintained by the
- *         caller which contains a populated gsfSwathBathyPing substructure.
- *     fore_aft = The address of a double allocated by the caller which will
- *         be loaded with the sonar's fore/aft beam width in degrees.
- *     athwartship = The address of a double allocated by the caller which will
- *         be loaded with the sonar's athwartship beam width in degrees.
- *
- * Returns : This function returns zero if successful, or -1 if an error
- *     occured.
- *
- * Error Conditions : unrecognized sonar id or mode.
- *
- ********************************************************************/
-int
-gsfGetSwathBathyBeamWidths(const gsfRecords *data, double *fore_aft, double *athwartship)
-{
-    int             ret=0;   /* Assume that we will be successful. */
-
-    /* Switch on the type of sonar this data came from */
-    switch (data->mb_ping.sensor_id)
-    {
-        case GSF_SWATH_BATHY_SUBRECORD_SEABEAM_SPECIFIC:
-            *fore_aft = 2.666666666667;
-            *athwartship = 2.666666666667;
-            break;
-
-        case GSF_SWATH_BATHY_SUBRECORD_EM12_SPECIFIC:
-            *fore_aft = 1.7;
-            *athwartship = 4.4;
-            break;
-
-        case GSF_SWATH_BATHY_SUBRECORD_EM100_SPECIFIC:
-            switch (data->mb_ping.sensor_data.gsfEM100Specific.mode)
-            {
-                case(1):  /* wide */
-                   *athwartship = 2.5;
-                   break;
-
-                case(2):  /* ulta-wide */
-                   *athwartship = 5.5;
-                   break;
-
-                case(3):  /* narrow */
-                   *athwartship = 2.0;
-                   break;
-
-                default:  /* Unrecognized sonar mode */
-                   *athwartship = 0.0;
-                   ret = -1;
-                   break;
-            }
-            *fore_aft = 3.0;
-            break;
-
-        case GSF_SWATH_BATHY_SUBRECORD_EM950_SPECIFIC:
-        case GSF_SWATH_BATHY_SUBRECORD_EM1000_SPECIFIC:
-            *fore_aft = 3.3;
-            *athwartship = 3.3;
-            break;
-
-        case GSF_SWATH_BATHY_SUBRECORD_EM121A_SPECIFIC:
-            *fore_aft = data->mb_ping.sensor_data.gsfEM121ASpecific.beam_width;
-            *athwartship = data->mb_ping.sensor_data.gsfEM121ASpecific.beam_width;
-            break;
-
-        case GSF_SWATH_BATHY_SUBRECORD_EM121_SPECIFIC:
-            *fore_aft = data->mb_ping.sensor_data.gsfEM121Specific.beam_width;
-            *athwartship = data->mb_ping.sensor_data.gsfEM121Specific.beam_width;
-            break;
-
-#if 1
-/* 04-01-99 wkm/dbj: obsolete */
-        case GSF_SWATH_BATHY_SUBRECORD_SASS_SPECIFIC:
-            ret = -1;
-            break;
-#endif
-
-        case GSF_SWATH_BATHY_SUBRECORD_SEAMAP_SPECIFIC:
-            ret = -1;
-            break;
-
-        case GSF_SWATH_BATHY_SUBRECORD_SEABAT_SPECIFIC:
-            if (data->mb_ping.sensor_data.gsfSeaBatSpecific.mode & GSF_SEABAT_WIDE_MODE)
-            {
-                *fore_aft = 10.0;
-            }
-            else
-            {
-                /* Set the F/A beam width to 2.4 here, but also set the return code to
-                 * indicate failure.  This sonar supports multiple beam widths, and
-                 * this information is NOT provided in the data stream from the sonar.
-                 */
-                *fore_aft = 1.5;
-                ret = -1;
-            }
-            if (data->mb_ping.sensor_data.gsfSeaBatSpecific.mode & GSF_SEABAT_9003)
-            {
-                *athwartship = 3.0;
-            }
-            else
-            {
-                *athwartship = 1.5;
-            }
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_SEABAT_II_SPECIFIC):
-            *fore_aft = data->mb_ping.sensor_data.gsfSeaBatIISpecific.fore_aft_bw;
-            *athwartship = data->mb_ping.sensor_data.gsfSeaBatIISpecific.athwart_bw;
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_SEABAT_8101_SPECIFIC):
-            *fore_aft = data->mb_ping.sensor_data.gsfSeaBat8101Specific.fore_aft_bw;
-            *athwartship = data->mb_ping.sensor_data.gsfSeaBat8101Specific.athwart_bw;
-            break;
-
-
-        case (GSF_SWATH_BATHY_SUBRECORD_SEABEAM_2112_SPECIFIC):
-            *fore_aft = 2.0;
-            *athwartship = 2.0;
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_ELAC_MKII_SPECIFIC):
-            *fore_aft = 2.0;
-            *athwartship = 2.0;
-            break;
-
-        case GSF_SWATH_BATHY_SUBRECORD_CMP_SASS_SPECIFIC:
-            *fore_aft    = 1.0;
-            *athwartship = 1.0;
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_EM300_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_EM1002_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_EM2000_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_EM3000_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_EM120_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_EM3002_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_EM3000D_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_EM3002D_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_EM121A_SIS_SPECIFIC):
-            *fore_aft = 1.5;
-            *athwartship = 1.5;
-            if (data->mb_ping.sensor_data.gsfEM3Specific.run_time[0].transmit_beam_width != 0.0)
-            {
-                *fore_aft = data->mb_ping.sensor_data.gsfEM3Specific.run_time[0].transmit_beam_width;
-            }
-            if (data->mb_ping.sensor_data.gsfEM3Specific.run_time[0].receive_beam_width != 0.0)
-            {
-                *athwartship = data->mb_ping.sensor_data.gsfEM3Specific.run_time[0].receive_beam_width;
-            }
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_EM300_RAW_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_EM1002_RAW_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_EM2000_RAW_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_EM3000_RAW_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_EM120_RAW_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_EM3002_RAW_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_EM3000D_RAW_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_EM3002D_RAW_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_EM121A_SIS_RAW_SPECIFIC):
-            *fore_aft = 1.5;
-            *athwartship = 1.5;
-            if (data->mb_ping.sensor_data.gsfEM3RawSpecific.run_time.tx_beam_width != 0.0)
-            {
-                *fore_aft = data->mb_ping.sensor_data.gsfEM3RawSpecific.run_time.tx_beam_width;
-            }
-            if (data->mb_ping.sensor_data.gsfEM3RawSpecific.run_time.rx_beam_width != 0.0)
-            {
-                *athwartship = data->mb_ping.sensor_data.gsfEM3RawSpecific.run_time.rx_beam_width;
-            }
-            break;
-
-
-        case (GSF_SWATH_BATHY_SUBRECORD_EM122_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_EM302_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_EM710_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_EM2040_SPECIFIC):
-            *fore_aft = 1.0;
-            *athwartship = 1.0;
-            if (data->mb_ping.sensor_data.gsfEM4Specific.run_time.tx_beam_width != 0.0)
-            {
-                *fore_aft = data->mb_ping.sensor_data.gsfEM4Specific.run_time.tx_beam_width;
-            }
-            if (data->mb_ping.sensor_data.gsfEM4Specific.run_time.rx_beam_width != 0.0)
-            {
-                *athwartship = data->mb_ping.sensor_data.gsfEM4Specific.run_time.rx_beam_width;
-            }
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_RESON_8101_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_RESON_8111_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_RESON_8124_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_RESON_8125_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_RESON_8150_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_RESON_8160_SPECIFIC):
-            *fore_aft = data->mb_ping.sensor_data.gsfReson8100Specific.fore_aft_bw;
-            *athwartship = data->mb_ping.sensor_data.gsfReson8100Specific.athwart_bw;
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_RESON_7125_SPECIFIC):
-            *fore_aft = data->mb_ping.sensor_data.gsfReson7100Specific.projector_beam_wdth_vert;
-            *athwartship = data->mb_ping.sensor_data.gsfReson7100Specific.receive_beam_width;
-            break;
-
-        case GSF_SWATH_BATHY_SUBRECORD_GEOSWATH_PLUS_SPECIFIC:
-            switch (data->mb_ping.sensor_data.gsfGeoSwathPlusSpecific.model_number)
-            {
-                case 100:
-                    *fore_aft = 0.9;
-                    *athwartship = GSF_BEAM_WIDTH_UNKNOWN;
-                    break;
-
-                case 250:
-                    *fore_aft = 0.5;
-                    *athwartship = GSF_BEAM_WIDTH_UNKNOWN;
-                    break;
-
-                case 500:
-                    *fore_aft = 0.5;
-                    *athwartship = GSF_BEAM_WIDTH_UNKNOWN;
-                    break;
-
-                default:
-                    *fore_aft = GSF_BEAM_WIDTH_UNKNOWN;
-                    *athwartship = GSF_BEAM_WIDTH_UNKNOWN;
-                    break;
-            }
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_KLEIN_5410_BSS_SPECIFIC):
-            *fore_aft = GSF_BEAM_WIDTH_UNKNOWN;
-            *athwartship = GSF_BEAM_WIDTH_UNKNOWN;
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_DELTA_T_SPECIFIC):
-            *fore_aft = 3.0;
-            *athwartship = 3.0;
-            if (data->mb_ping.sensor_data.gsfDeltaTSpecific.fore_aft_beamwidth != 0.0)
-            {
-                *fore_aft = data->mb_ping.sensor_data.gsfDeltaTSpecific.fore_aft_beamwidth;
-            }
-            if (data->mb_ping.sensor_data.gsfDeltaTSpecific.athwartships_beamwidth != 0.0)
-            {
-                *athwartship = data->mb_ping.sensor_data.gsfDeltaTSpecific.athwartships_beamwidth;
-            }
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_R2SONIC_2020_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_R2SONIC_2022_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_R2SONIC_2024_SPECIFIC):
-            *fore_aft = data->mb_ping.sensor_data.gsfR2SonicSpecific.tx_beamwidth_vert;
-            *athwartship = data->mb_ping.sensor_data.gsfR2SonicSpecific.tx_beamwidth_horiz;
-            break;
-
-        default:
-            *fore_aft = GSF_BEAM_WIDTH_UNKNOWN;
-            *athwartship = GSF_BEAM_WIDTH_UNKNOWN;
-            gsfError = GSF_UNRECOGNIZED_SENSOR_ID;
-            ret = -1;
-            break;
-    }
-    return(ret);
-}
-
-/********************************************************************
- *
- * Function Name : gsfIsStarboardPing
- *
- * Description : This function uses the sonar specific data union
- *     of a gsfSwathBathymetry ping structure to determine if the ping
- *     is from the starboard arrays of a multibeam installation with
- *     dual transmit receive sonar arrays.
- *
- * Inputs :
- *     data = The address of a gsfRecords data structure maintained by the
- *         caller which contains a populated gsfSwathBathyPing substructure.
- *
- * Returns : This function returns non-zero if the ping contained in the
- *     passed data represents a starboard looking ping from a dual headed
- *     sonar installation.  Otherwise, zero is returned.
- *
- * Error Conditions : none
- *
- ********************************************************************/
-int
-gsfIsStarboardPing(const gsfRecords *data)
-{
-    int ret = 0;
-
-
-    /* Switch on the type of sonar this data came from */
-    switch (data->mb_ping.sensor_id)
-    {
-
-        case GSF_SWATH_BATHY_SUBRECORD_GEOSWATH_PLUS_SPECIFIC:
-            return data->mb_ping.sensor_data.gsfGeoSwathPlusSpecific.side;
-            break;
-        case GSF_SWATH_BATHY_SUBRECORD_KLEIN_5410_BSS_SPECIFIC:
-            return data->mb_ping.sensor_data.gsfKlein5410BssSpecific.side;
-            break;
-        case GSF_SWATH_BATHY_SUBRECORD_SEABAT_SPECIFIC:
-/* zzz_ */
-/*          if (data->mb_ping.sensor_data.gsfSeaBatSpecific.mode &   */
-/*               (GSF_SEABAT_9002 | GSF_SEABAT_STBD_HEAD))           */
-        if ( data->mb_ping.sensor_data.gsfSeaBatSpecific.mode  &  GSF_SEABAT_STBD_HEAD )
-/* zzz_ */
-        {
-           ret = 1;
-        }
-        break;
-
-        case GSF_SWATH_BATHY_SUBRECORD_ELAC_MKII_SPECIFIC:
-        if ( data->mb_ping.sensor_data.gsfElacMkIISpecific.mode  &  GSF_MKII_STBD_HEAD )
-        {
-           ret = 1;
-        }
-        break;
-
-        case GSF_SWATH_BATHY_SUBRECORD_EM3000D_SPECIFIC:
-        case GSF_SWATH_BATHY_SUBRECORD_EM3002D_SPECIFIC:
-        case GSF_SWATH_BATHY_SUBRECORD_EM3000D_RAW_SPECIFIC:
-        case GSF_SWATH_BATHY_SUBRECORD_EM3002D_RAW_SPECIFIC:
-        case GSF_SWATH_BATHY_SUBRECORD_EM2040_SPECIFIC:
-            /* it is assumed that the center_beam is set to the vertical beam. */
-            if (data->mb_ping.center_beam < data->mb_ping.number_beams / 2)
-            {
-                /* most of the beams are to starboard of vertical */
-                ret = 1;
-            }
-            else
-            {
-                /* most of the beams are to port of vertical */
-                ret = 0;
-            }
-        break;
-        default:
-            ret = 0;
-            break;
-    }
-
-    return(ret);
-}
-
-/********************************************************************
- *
- * Function Name : gsfLoadDepthScaleFactorAutoOffset
- *
- * Description : gsfLoadDepthScaleFactorAutoOffset may be used to load
- *  the scale factors for the depth subrecords of the swath bathymetry ping
- *  record scale factor structure. The approach uses the tide and depth
- *  correction fields to help establish the offset component of the scale
- *  factor such that negative depth values may be supported.  Negative
- *  depth values may be encountered when surveying above the tidal datum.
- *  In addition, this function may be used for systems mounted on subsea
- *  platforms where high depth precision may be supported even in deep
- *  water.
- *
- * Inputs :
- *  ping = A pointer to the gsfSwathBathyPing which contains the depht
- *      and tide correction values, and the scale factors data structure.
- *  subrecordID = the subrecord id for the beam array data.  This must be
- *      either GSF_SWATH_BATHY_SUBRECORD_DEPTH_ARRAY, or
- *      GSF_SWATH_BATHY_SUBRECORD_NOMINAL_DEPTH_ARRAY
- *  reset = An integer value which will cause the internal logic to be
- *      refreshed when the value is non-zero.  The first call to this function
- *      should use a non-zero reset, from then on, this value may be passed
- *      as zero.
- *  min_depth = A double value which should be set to the minimum depth value
- *      contained in the depth array specified by subrecordID.  This argument
- *      exists for completeness, but is currently not used.
- *  max_depth = A double value which should be set to the maximum depth value
- *      contained in the depth array specified by subrecordID.  When a depth
- *      threshold is exceeded, the offset used to support "signed depth" is
- *      no longer required and will no longer be used.  This approach is
- *      necessary to avoid an integer overflow when the array data are scaled.
- *  last_corrector = The address of a double value stored as permanent memory.
- *      Successive calls to this function must pass the same address for this
- *      argument.  This function will take care of setting the value at this
- *      address, but the caller is responsible for ensuring that the same
- *      permanent memory address is used for each call to this function.
- *  c_flag = The compression flag for the beam array
- *  precision = The presision to which the beam array data are to be stored
- *      (a value of 0.1 would indicate decimeter precision for depth)
- *
- * Returns :
- *  This function returns zero if successful, or -1 if an error occured.
- *
- * Error Conditions :
- *    GSF_TOO_MANY_ARRAY_SUBRECORDS
- *
- ********************************************************************/
-int
-gsfLoadDepthScaleFactorAutoOffset(gsfSwathBathyPing *ping, unsigned int subrecordID, int reset, double min_depth, double max_depth, double *last_corrector, char c_flag, double precision)
-{
-    double          offset;
-    double          fraction;
-    double          layer;
-    double          next_layer;
-    double          corrector;
-    double          layer_interval = 100.0;
-    double          max_depth_threshold = 400.0;
-    double          max_depth_hysteresis = 30.0;
-    double          increasing_threshold;
-    double          decreasing_threshold;
-    int             dc_offset;
-    int             percent;
-    int             ret_code = 0;
-
-    if (precision < 0.01)
-    {
-        layer_interval = 10.0;
-    }
-
-    /* Test for valid subrecordID, we only supported automated establishement of the DC offset for the depth subrecords */
-    if ((subrecordID != GSF_SWATH_BATHY_SUBRECORD_DEPTH_ARRAY) && (subrecordID != GSF_SWATH_BATHY_SUBRECORD_NOMINAL_DEPTH_ARRAY))
-    {
-        gsfError = GSF_UNRECOGNIZED_ARRAY_SUBRECORD_ID;
-        return(-1);
-    }
-
-    /* Get the current offset scaling factor from the ping data structure */
-    offset    = ping->scaleFactors.scaleTable[subrecordID - 1].offset;
-
-    /* Break the total correction value into integer and fractional components based on the layering interval */
-    corrector = ping->depth_corrector + ping->tide_corrector;
-    fraction = modf (corrector / layer_interval, &layer);
-    layer = layer * layer_interval;
-
-    /* Handle the startup and/or reset situation */
-    if (reset)
-    {
-        if (layer < layer_interval)
-        {
-            offset = -1.0 * (layer - layer_interval);
-        }
-        else
-        {
-            offset = -1.0 * layer;
-        }
-        *last_corrector = 0.0;
-    }
-
-    /* Set the corrector layer trip thresholds based on the sign of the current layer */
-    if (fraction < 0.0)
-    {
-        percent = (int) (fraction * layer_interval);
-        increasing_threshold = -70.0;
-        decreasing_threshold = -90.0;
-        next_layer = layer - layer_interval;
-    }
-    else
-    {
-        percent = (int) (fraction * layer_interval);
-        increasing_threshold = 30.0;
-        decreasing_threshold = 10.0;
-        next_layer = layer;
-    }
-
-    /* The transition from one corrector layer to the next occurs if the
-     * total corrector is increasing and passes through one threshold, or
-     * if the total corrector is decreasing and passed through another
-     * threshold.
-     */
-    if (*last_corrector < corrector)
-    {
-        /* If the depth is greater than 400 meters then there is no need to
-         *  use a positive DC offset for signed depth.  This check is necessary
-         *  to avoid a potential integer overflow that may exist for sonar
-         *  systems which do not decrease the precision as the depth increases.
-         */
-        if ((fabs(corrector) < layer_interval) && (max_depth > (max_depth_threshold - max_depth_hysteresis)))
-        {
-            if (max_depth > (max_depth_threshold + max_depth_hysteresis))
-            {
-                offset = 0.0;
-            }
-        }
-
-        /* If corrector is increasing, change offset to next deeper
-         * depth layer when we pass through the threshold.
-         */
-        else if (percent > increasing_threshold)
-        {
-            offset = -1.0 * next_layer;
-        }
-    }
-    else
-    {
-        /* If the depth is greater than 400 meters then there is no need to
-         *  use a positive DC offset for signed depth.  This check is necessary
-         *  to avoid a potential integer overflow that may exist for sonar
-         *  systems which do not decrease the precision as the depth increases.
-         */
-        if ((fabs(corrector) < layer_interval) && (max_depth > (max_depth_threshold - max_depth_hysteresis)))
-        {
-            if (max_depth > (max_depth_threshold + max_depth_hysteresis))
-            {
-                offset = 0.0;
-            }
-        }
-
-        /* If corrector is decreasing, change offset to next shallower
-         *  depth layer when we pass through the threshold.
-         */
-        else if (percent < decreasing_threshold)
-        {
-            offset = -1.0 * (next_layer - layer_interval);
-        }
-    }
-
-    /* the maximum possible tidal height is just under 11 meters, so a maximum
-     *  offset of 20 is sufficient for surveying above the tidal datum.
-     *  bac, 09-12-04
-     */
-    if (offset > 20)
-    {
-        offset = 20;
-    }
-
-    /* Round to the nearest whole integer */
-    if (offset < 0.0)
-    {
-        dc_offset = (int) (offset - 0.5);
-    }
-    else
-    {
-        dc_offset = (int) (offset + 0.5);
-    }
-
-    /* Call the load scale factors function to set the computed DC offset and
-     *  the c_flag and precision arguments.
-     */
-    if (gsfLoadScaleFactor(&ping->scaleFactors, subrecordID, c_flag, precision, dc_offset) != 0)
-    {
-        return (-1);
-    }
-
-    if (corrector != *last_corrector)
-    {
-        *last_corrector = corrector;
-    }
-
-    return (ret_code);
-}
-
-/********************************************************************
- *
- * Function Name : gsfGetSwathBathyArrayMinMax
- *
- * Description : This function may be used to obtain the minimum and maximum
- *  supportable values for each of the swath bathymetry arrays.  The minimum
- *  and maximum values are determined based on the scale factors and the array
- *  type.
- *
- * Inputs :
- *  ping = A pointer to the gsfSwathBathyPing which contains the depht
- *      and tide correction values, and the scale factors data structure.
- *  subrecordID = The subrecord id for the beam array data.  This must be
- *      either GSF_SWATH_BATHY_SUBRECORD_DEPTH_ARRAY, or
- *      GSF_SWATH_BATHY_SUBRECORD_NOMINAL_DEPTH_ARRAY
- *  min_value = The address of a double value allocated by the caller into
- *      which will be placed the minimum value which may be represented for
- *      this array type.
- *  max_value = The address of a double value allocated by the caller into
- *      which will be placed the maximum value which may be represented for
- *      this array type.
- *
- * Returns :
- *  This function returns zero if successful, or -1 if an error occured.
- *
- * Error Conditions :
- *    GSF_UNRECOGNIZED_ARRAY_SUBRECORD_ID
- *    GSF_ILLEGAL_SCALE_FACTOR_MULTIPLIER
- *
- ********************************************************************/
-int
-gsfGetSwathBathyArrayMinMax(const gsfSwathBathyPing *ping, unsigned int subrecordID, double *min_value, double *max_value)
-{
-    double          minimum;
-    double          maximum;
-    double          multiplier;
-    double          offset;
-    int             ret_code = 0;
-
-    /* Make sure that we received a valid subrecordID */
-    if ((subrecordID < 1) || (subrecordID > GSF_MAX_PING_ARRAY_SUBRECORDS))
-    {
-        gsfError = GSF_UNRECOGNIZED_ARRAY_SUBRECORD_ID;
-        return(-1);
-    }
-
-    /* Make sure scale factors have been established for this array */
-    if (ping->scaleFactors.scaleTable[subrecordID - 1].multiplier == 0.0)
-    {
-        gsfError = GSF_ILLEGAL_SCALE_FACTOR_MULTIPLIER;
-        return (-1);
-    }
-
-    multiplier = ping->scaleFactors.scaleTable[subrecordID - 1].multiplier;
-    offset     = ping->scaleFactors.scaleTable[subrecordID - 1].offset;
-    switch (subrecordID)
-    {
-        case (GSF_SWATH_BATHY_SUBRECORD_DEPTH_ARRAY):
-            switch (ping->scaleFactors.scaleTable[subrecordID - 1].compressionFlag & 0xf0)
-            {
-                case GSF_FIELD_SIZE_ONE:
-                    minimum = GSF_U_CHAR_MIN;
-                    maximum = GSF_U_CHAR_MAX;
-                    break;
-                default:
-                case GSF_FIELD_SIZE_DEFAULT:
-                case GSF_FIELD_SIZE_TWO:
-                    minimum = GSF_U_SHORT_MIN;
-                    maximum = GSF_U_SHORT_MAX;
-                    break;
-                case GSF_FIELD_SIZE_FOUR:
-                    minimum = GSF_U_INT_MIN;
-                    maximum = GSF_U_INT_MAX;
-                    break;
-            }
-        case (GSF_SWATH_BATHY_SUBRECORD_NOMINAL_DEPTH_ARRAY):
-            switch (ping->scaleFactors.scaleTable[subrecordID - 1].compressionFlag & 0xf0)
-            {
-                case GSF_FIELD_SIZE_ONE:
-                    minimum = GSF_U_CHAR_MIN;
-                    maximum = GSF_U_CHAR_MAX;
-                    break;
-                default:
-                case GSF_FIELD_SIZE_DEFAULT:
-                case GSF_FIELD_SIZE_TWO:
-                    minimum = GSF_U_SHORT_MIN;
-                    maximum = GSF_U_SHORT_MAX;
-                    break;
-                case GSF_FIELD_SIZE_FOUR:
-                    minimum = GSF_U_INT_MIN;
-                    maximum = GSF_U_INT_MAX;
-                    break;
-            }
-        case (GSF_SWATH_BATHY_SUBRECORD_ACROSS_TRACK_ARRAY):
-            switch (ping->scaleFactors.scaleTable[subrecordID - 1].compressionFlag & 0xf0)
-            {
-                case GSF_FIELD_SIZE_ONE:
-                    minimum = GSF_S_CHAR_MIN;
-                    maximum = GSF_S_CHAR_MAX;
-                    break;
-                default:
-                case GSF_FIELD_SIZE_DEFAULT:
-                case GSF_FIELD_SIZE_TWO:
-                    minimum = GSF_S_SHORT_MIN;
-                    maximum = GSF_S_SHORT_MAX;
-                    break;
-                case GSF_FIELD_SIZE_FOUR:
-                    minimum = GSF_S_INT_MIN;
-                    maximum = GSF_S_INT_MAX;
-                    break;
-            }
-        case (GSF_SWATH_BATHY_SUBRECORD_ALONG_TRACK_ARRAY):
-            switch (ping->scaleFactors.scaleTable[subrecordID - 1].compressionFlag & 0xf0)
-            {
-                case GSF_FIELD_SIZE_ONE:
-                    minimum = GSF_S_CHAR_MIN;
-                    maximum = GSF_S_CHAR_MAX;
-                    break;
-                default:
-                case GSF_FIELD_SIZE_DEFAULT:
-                case GSF_FIELD_SIZE_TWO:
-                    minimum = GSF_S_SHORT_MIN;
-                    maximum = GSF_S_SHORT_MAX;
-                    break;
-                case GSF_FIELD_SIZE_FOUR:
-                    minimum = GSF_S_INT_MIN;
-                    maximum = GSF_S_INT_MAX;
-                    break;
-            }
-        case (GSF_SWATH_BATHY_SUBRECORD_TRAVEL_TIME_ARRAY):
-            switch (ping->scaleFactors.scaleTable[subrecordID - 1].compressionFlag & 0xf0)
-            {
-                case GSF_FIELD_SIZE_ONE:
-                    minimum = GSF_U_CHAR_MIN;
-                    maximum = GSF_U_CHAR_MAX;
-                    break;
-                default:
-                case GSF_FIELD_SIZE_DEFAULT:
-                case GSF_FIELD_SIZE_TWO:
-                    minimum = GSF_U_SHORT_MIN;
-                    maximum = GSF_U_SHORT_MAX;
-                    break;
-                case GSF_FIELD_SIZE_FOUR:
-                    minimum = GSF_U_INT_MIN;
-                    maximum = GSF_U_INT_MAX;
-                    break;
-            }
-        case (GSF_SWATH_BATHY_SUBRECORD_BEAM_ANGLE_ARRAY):
-            minimum = GSF_S_SHORT_MIN;
-            maximum = GSF_S_SHORT_MAX;
-            break;
-        case (GSF_SWATH_BATHY_SUBRECORD_MEAN_CAL_AMPLITUDE_ARRAY):
-            switch (ping->scaleFactors.scaleTable[subrecordID - 1].compressionFlag & 0xf0)
-            {
-                case GSF_FIELD_SIZE_DEFAULT:
-                case GSF_FIELD_SIZE_ONE:
-                    minimum = GSF_S_CHAR_MIN;
-                    maximum = GSF_S_CHAR_MAX;
-                    break;
-                case GSF_FIELD_SIZE_TWO:
-                    minimum = GSF_S_SHORT_MIN;
-                    maximum = GSF_S_SHORT_MAX;
-                    break;
-            }
-        case (GSF_SWATH_BATHY_SUBRECORD_MEAN_REL_AMPLITUDE_ARRAY):
-            switch (ping->scaleFactors.scaleTable[subrecordID - 1].compressionFlag & 0xf0)
-            {
-                case GSF_FIELD_SIZE_DEFAULT:
-                case GSF_FIELD_SIZE_ONE:
-                    minimum = GSF_U_CHAR_MIN;
-                    maximum = GSF_U_CHAR_MAX;
-                    break;
-                case GSF_FIELD_SIZE_TWO:
-                    minimum = GSF_U_SHORT_MIN;
-                    maximum = GSF_U_SHORT_MAX;
-                    break;
-            }
-        case (GSF_SWATH_BATHY_SUBRECORD_ECHO_WIDTH_ARRAY):
-            switch (ping->scaleFactors.scaleTable[subrecordID - 1].compressionFlag & 0xf0)
-            {
-                case GSF_FIELD_SIZE_DEFAULT:
-                case GSF_FIELD_SIZE_ONE:
-                    minimum = GSF_U_CHAR_MIN;
-                    maximum = GSF_U_CHAR_MAX;
-                    break;
-                case GSF_FIELD_SIZE_TWO:
-                    minimum = GSF_U_SHORT_MIN;
-                    maximum = GSF_U_SHORT_MAX;
-                    break;
-            }
-        case (GSF_SWATH_BATHY_SUBRECORD_QUALITY_FACTOR_ARRAY):
-            minimum = GSF_U_CHAR_MIN;
-            maximum = GSF_U_CHAR_MAX;
-            break;
-        case (GSF_SWATH_BATHY_SUBRECORD_RECEIVE_HEAVE_ARRAY):
-            minimum = GSF_S_CHAR_MIN;
-            maximum = GSF_S_CHAR_MAX;
-            break;
-        case (GSF_SWATH_BATHY_SUBRECORD_DEPTH_ERROR_ARRAY):
-            minimum = GSF_U_SHORT_MIN;
-            maximum = GSF_U_SHORT_MAX;
-            break;
-        case (GSF_SWATH_BATHY_SUBRECORD_ACROSS_TRACK_ERROR_ARRAY):
-            minimum = GSF_U_SHORT_MIN;
-            maximum = GSF_U_SHORT_MAX;
-            break;
-        case (GSF_SWATH_BATHY_SUBRECORD_ALONG_TRACK_ERROR_ARRAY):
-            minimum = GSF_U_SHORT_MIN;
-            maximum = GSF_U_SHORT_MAX;
-            break;
-        case (GSF_SWATH_BATHY_SUBRECORD_QUALITY_FLAGS_ARRAY):
-            minimum = GSF_U_CHAR_MIN;
-            maximum = GSF_U_CHAR_MAX;
-            break;
-        case (GSF_SWATH_BATHY_SUBRECORD_BEAM_FLAGS_ARRAY):
-            minimum = GSF_U_CHAR_MIN;
-            maximum = GSF_U_CHAR_MAX;
-            break;
-        case (GSF_SWATH_BATHY_SUBRECORD_SIGNAL_TO_NOISE_ARRAY):
-            minimum = GSF_U_CHAR_MIN;
-            maximum = GSF_U_CHAR_MAX;
-            break;
-        case (GSF_SWATH_BATHY_SUBRECORD_BEAM_ANGLE_FORWARD_ARRAY):
-            minimum = GSF_U_SHORT_MIN;
-            maximum = GSF_U_SHORT_MAX;
-            break;
-        case (GSF_SWATH_BATHY_SUBRECORD_VERTICAL_ERROR_ARRAY):
-            minimum = GSF_U_SHORT_MIN;
-            maximum = GSF_U_SHORT_MAX;
-            break;
-        case (GSF_SWATH_BATHY_SUBRECORD_HORIZONTAL_ERROR_ARRAY):
-            minimum = GSF_U_SHORT_MIN;
-            maximum = GSF_U_SHORT_MAX;
-            break;
-        case (GSF_SWATH_BATHY_SUBRECORD_SECTOR_NUMBER_ARRAY):
-            minimum = GSF_U_CHAR_MIN;
-            maximum = GSF_U_CHAR_MAX;
-            break;
-        case (GSF_SWATH_BATHY_SUBRECORD_DETECTION_INFO_ARRAY):
-            minimum = GSF_U_CHAR_MIN;
-            maximum = GSF_U_CHAR_MAX;
-            break;
-        case (GSF_SWATH_BATHY_SUBRECORD_INCIDENT_BEAM_ADJ_ARRAY):
-            minimum = GSF_S_CHAR_MIN;
-            maximum = GSF_S_CHAR_MAX;
-            break;
-        case (GSF_SWATH_BATHY_SUBRECORD_SYSTEM_CLEANING_ARRAY):
-            minimum = GSF_U_CHAR_MIN;
-            maximum = GSF_U_CHAR_MAX;
-            break;
-        case (GSF_SWATH_BATHY_SUBRECORD_DOPPLER_CORRECTION_ARRAY):
-            minimum = GSF_S_CHAR_MIN;
-            maximum = GSF_S_CHAR_MAX;
-            break;
-        default:
-            gsfError = GSF_UNRECOGNIZED_ARRAY_SUBRECORD_ID;
-            ret_code = -1;
-            break;
-    }
-
-    if (ret_code == 0)
-    {
-        *min_value = ((minimum / multiplier) - offset);
-        *max_value = ((maximum / multiplier) - offset);
-    }
-
-    return (ret_code);
-}
-
-/********************************************************************
- *
- * Function Name : gsfGetSonarTextName
- *
- * Description : This function provides a textual name for the sonar
- *  given a populated ping structure.
- *
- * Inputs :
- *  ping = A pointer to a populated gsfSwathBathyPing structure.
- *
- * Returns :
- *  This function returns a pointer to a character string containing
- *   the name of the sonar.
- *
- * Error Conditions :
- *    GSF_UNRECOGNIZED_ARRAY_SUBRECORD_ID
- *
- ********************************************************************/
-const char *gsfGetSonarTextName(const gsfSwathBathyPing *ping)
-{
-    const char             *ptr;
-
-    switch (ping->sensor_id)
-    {
-        case (GSF_SWATH_BATHY_SUBRECORD_SEABEAM_SPECIFIC):
-            ptr = "SeaBeam";
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_EM12_SPECIFIC):
-            ptr = "Simrad EM12";
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_EM100_SPECIFIC):
-            ptr = "Simrad EM100";
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_EM950_SPECIFIC):
-            ptr = "Simrad EM950";
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_EM1000_SPECIFIC):
-            ptr = "Simrad EM1000";
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_EM121A_SPECIFIC):
-            ptr = "Simrad EM121A";
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_SASS_SPECIFIC):
-            ptr = "SASS";
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_SEAMAP_SPECIFIC):
-            ptr = "SeaMap";
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_SB_AMP_SPECIFIC):
-            ptr = "Sea Beam (w/amp)";
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_SEABAT_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_SEABAT_II_SPECIFIC):
-            if (ping->sensor_data.gsfSeaBatIISpecific.mode & GSF_SEABAT_9002)
-            {
-                ptr = " Reson SeaBat 9002";
-            }
-            else if (ping->sensor_data.gsfSeaBatIISpecific.mode & GSF_SEABAT_9003)
-            {
-                ptr = "Reson SeaBat 9003";
-            }
-            else
-            {
-                ptr = "Reson SeaBat 9001";
-            }
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_SEABAT_8101_SPECIFIC):
-            ptr = "Reson SeaBat 8101";
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_SEABEAM_2112_SPECIFIC):
-            ptr = "Sea Beam 2112/36";
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_ELAC_MKII_SPECIFIC):
-            ptr = "ELAC MKII";
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_EM120_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_EM120_RAW_SPECIFIC):
-            ptr = "Kongsberg EM120";
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_EM300_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_EM300_RAW_SPECIFIC):
-            ptr = "Kongsberg EM300";
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_EM1002_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_EM1002_RAW_SPECIFIC):
-            ptr = "Kongsberg EM1002";
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_EM2000_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_EM2000_RAW_SPECIFIC):
-            ptr = "Kongsberg EM2000";
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_EM3000_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_EM3000_RAW_SPECIFIC):
-            ptr = "Kongsberg EM3000";
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_EM3000D_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_EM3000D_RAW_SPECIFIC):
-            ptr = "Kongsberg EM3000D";
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_EM3002_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_EM3002_RAW_SPECIFIC):
-            ptr = "Kongsberg EM3002";
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_EM3002D_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_EM3002D_RAW_SPECIFIC):
-            ptr = "Kongsberg EM3002D";
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_EM121A_SIS_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_EM121A_SIS_RAW_SPECIFIC):
-            ptr = "Kongsberg EM121A (SIS)";
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_RESON_7125_SPECIFIC):
-            ptr = "Reson SeaBat 7125";
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_RESON_8101_SPECIFIC):
-            ptr = "Reson SeaBat 8101";
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_RESON_8111_SPECIFIC):
-            ptr = "Reson SeaBat 8111";
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_RESON_8124_SPECIFIC):
-            ptr = "Reson SeaBat 8124";
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_RESON_8125_SPECIFIC):
-            ptr = "Reson SeaBat 8125";
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_RESON_8150_SPECIFIC):
-            ptr = "Reson SeaBat 8150";
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_RESON_8160_SPECIFIC):
-            ptr = "Reson SeaBat 8160";
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_EM122_SPECIFIC):
-            ptr = "Kongsberg EM122";
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_EM302_SPECIFIC):
-            ptr = "Kongsberg EM302";
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_EM710_SPECIFIC):
-            ptr = "Kongsberg EM710";
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_KLEIN_5410_BSS_SPECIFIC):
-            ptr = "Klein 5410";
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_GEOSWATH_PLUS_SPECIFIC):
-            ptr = "GeoAcoustics GeoSwath+";
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_EM2040_SPECIFIC):
-            ptr = "Kongsberg EM2040";
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_DELTA_T_SPECIFIC):
-            ptr = "Imagenex Delta T";
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_R2SONIC_2020_SPECIFIC):
-            ptr = "R2Sonic 2020";
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_R2SONIC_2022_SPECIFIC):
-            ptr = "R2Sonic 2022";
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_R2SONIC_2024_SPECIFIC):
-            ptr = "R2Sonic 2024";
-            break;
-
-        default:
-            ptr = "Unknown";
-            break;
-    }
-
-    return (ptr);
-}
-
-/********************************************************************
- *
- * Function Name : gsfIsNewSurveyLine
- *
- * Description : This function provides an approach for calling applications
- *  to determine if the last ping read from a GSF file is from the same survey
- *  transect line, or if the last ping is from a newly started survey line. The
- *  implementation looks for a change in platform heading to determine that the
- *  last ping read is from a new survey line. External to this function, calling
- *  applications can decide on their own if the first ping read from a newly opened
- *  GSF file should be considered to be from a new survey transect line or not.
- *  This function assumes that the GSF file is read in chronological order from
- *  the beginning of the file, file access can be either direct or sequential
- *
- * Inputs :
- *  handle         = The handle to the file as provided by gsfOpen
- *  rec            = A pointer to a gsfRecords structure containing the data from the most
- *                    recent call to gsfRead
- *  azimuth_change = The trigger value specifying the change in platform heading that
- *                    must be exceeded for a new survey transect line to be determined
- *  last_heading   = A pointer to a double allocated by the caller and into which this
- *                    function will place the heading value for each detected line. The
- *                    value must be allocated as permanent memory that persists through
- *                    all calls to this function. Startup or reset events can be handled
- *                    by the caller by placing a negative value in this memory location.
- *
- * Returns :
- *  This function returns 1 if this ping is considered to be the first ping of a new
- *   survey transect line, otherwise, 0 is returned.
- *
- * Error Conditions :
- *  none
- *
- ********************************************************************/
-int
-gsfIsNewSurveyLine(int handle, const gsfRecords *rec, double azimuth_change, double *last_heading)
-{
-    double diff;
-    int    new_line;
-
-    new_line = 0;
-
-    if ((handle < 1) || (handle > GSF_MAX_OPEN_FILES))
-    {
-        gsfError = GSF_BAD_FILE_HANDLE;
-        return (-1);
-    }
-    if (gsfFileTable[handle-1].last_record_type == GSF_RECORD_SWATH_BATHYMETRY_PING)
-    {
-        /* A negative value for last heading is the start/reset trigger. */
-        if (*last_heading < 0.0)
-        {
-            new_line = 1;
-            *last_heading = rec->mb_ping.heading;
-        }
-        else
-        {
-            diff = fabs (rec->mb_ping.heading - *last_heading);
-            if ((diff > azimuth_change) && (diff < 350.0))
-            {
-                new_line = 1;
-                *last_heading = rec->mb_ping.heading;
-            }
-        }
-    }
-
-    return(new_line);
-}
-
-/********************************************************************
- *
- * Function Name : gsfInitializeMBParams
- *
- * Description : This function provides a way to initialize all the
- *    sonar processing parameters to "unknown"
- *
- * Inputs :
- *    p = a pointer to the gsfMBParams data structure that needs initializing
- *
- * Returns :
- *    None
- *
- * Error Conditions :
- *    None
- *
- ********************************************************************/
-void
-gsfInitializeMBParams (gsfMBParams *p)
-{
-    int i;
-
-    memset(p->start_of_epoch, 0, sizeof(p->start_of_epoch));
-    p->horizontal_datum = GSF_UNKNOWN_PARAM_VALUE;
-    p->vertical_datum = GSF_UNKNOWN_PARAM_VALUE;
-    p->roll_compensated = GSF_UNKNOWN_PARAM_VALUE;
-    p->pitch_compensated = GSF_UNKNOWN_PARAM_VALUE;
-    p->heave_compensated = GSF_UNKNOWN_PARAM_VALUE;
-    p->tide_compensated = GSF_UNKNOWN_PARAM_VALUE;
-    p->ray_tracing = GSF_UNKNOWN_PARAM_VALUE;
-    p->depth_calculation = GSF_UNKNOWN_PARAM_VALUE;
-    p->vessel_type = GSF_UNKNOWN_PARAM_VALUE;
-    p->full_raw_data = GSF_UNKNOWN_PARAM_VALUE;
-    p->msb_applied_to_attitude = GSF_UNKNOWN_PARAM_VALUE;
-    p->heave_removed_from_gps_tc = GSF_UNKNOWN_PARAM_VALUE;
-    p->utc_offset = GSF_UNKNOWN_PARAM_INT;
-    p->roll_reference = GSF_UNKNOWN_PARAM_INT;
-    p->number_of_transmitters = GSF_UNKNOWN_PARAM_INT;
-    p->number_of_receivers = GSF_UNKNOWN_PARAM_INT;
-
-    /* initialize the "to apply" fields */
-    p->to_apply.position_x_offset = GSF_UNKNOWN_PARAM_VALUE;
-    p->to_apply.position_y_offset = GSF_UNKNOWN_PARAM_VALUE;
-    p->to_apply.position_z_offset = GSF_UNKNOWN_PARAM_VALUE;
-    p->to_apply.antenna_x_offset = GSF_UNKNOWN_PARAM_VALUE;
-    p->to_apply.antenna_y_offset = GSF_UNKNOWN_PARAM_VALUE;
-    p->to_apply.antenna_z_offset = GSF_UNKNOWN_PARAM_VALUE;
-    p->to_apply.mru_pitch_bias = GSF_UNKNOWN_PARAM_VALUE;
-    p->to_apply.mru_roll_bias = GSF_UNKNOWN_PARAM_VALUE;
-    p->to_apply.mru_heading_bias = GSF_UNKNOWN_PARAM_VALUE;
-    p->to_apply.mru_x_offset = GSF_UNKNOWN_PARAM_VALUE;
-    p->to_apply.mru_y_offset = GSF_UNKNOWN_PARAM_VALUE;
-    p->to_apply.mru_z_offset = GSF_UNKNOWN_PARAM_VALUE;
-    p->to_apply.center_of_rotation_x_offset = GSF_UNKNOWN_PARAM_VALUE;
-    p->to_apply.center_of_rotation_y_offset = GSF_UNKNOWN_PARAM_VALUE;
-    p->to_apply.center_of_rotation_z_offset = GSF_UNKNOWN_PARAM_VALUE;
-    p->to_apply.position_latency = GSF_UNKNOWN_PARAM_VALUE;
-    p->to_apply.attitude_latency = GSF_UNKNOWN_PARAM_VALUE;
-    p->to_apply.depth_sensor_latency = GSF_UNKNOWN_PARAM_VALUE;
-    p->to_apply.depth_sensor_x_offset = GSF_UNKNOWN_PARAM_VALUE;
-    p->to_apply.depth_sensor_y_offset = GSF_UNKNOWN_PARAM_VALUE;
-    p->to_apply.depth_sensor_z_offset = GSF_UNKNOWN_PARAM_VALUE;
-    for (i = 0; i < GSF_MAX_OFFSETS; i++)
-    {
-        p->to_apply.draft[i] = GSF_UNKNOWN_PARAM_VALUE;
-        p->to_apply.pitch_bias[i] = GSF_UNKNOWN_PARAM_VALUE;
-        p->to_apply.roll_bias[i] = GSF_UNKNOWN_PARAM_VALUE;
-        p->to_apply.gyro_bias[i] = GSF_UNKNOWN_PARAM_VALUE;
-        p->to_apply.transducer_x_offset[i] = GSF_UNKNOWN_PARAM_VALUE;
-        p->to_apply.transducer_y_offset[i] = GSF_UNKNOWN_PARAM_VALUE;
-        p->to_apply.transducer_z_offset[i] = GSF_UNKNOWN_PARAM_VALUE;
-        p->to_apply.transducer_pitch_offset[i] = GSF_UNKNOWN_PARAM_VALUE;
-        p->to_apply.transducer_roll_offset[i] = GSF_UNKNOWN_PARAM_VALUE;
-        p->to_apply.transducer_heading_offset[i] = GSF_UNKNOWN_PARAM_VALUE;
-        p->to_apply.rx_transducer_x_offset[i] = GSF_UNKNOWN_PARAM_VALUE;
-        p->to_apply.rx_transducer_y_offset[i] = GSF_UNKNOWN_PARAM_VALUE;
-        p->to_apply.rx_transducer_z_offset[i] = GSF_UNKNOWN_PARAM_VALUE;
-        p->to_apply.rx_transducer_pitch_offset[i] = GSF_UNKNOWN_PARAM_VALUE;
-        p->to_apply.rx_transducer_roll_offset[i] = GSF_UNKNOWN_PARAM_VALUE;
-        p->to_apply.rx_transducer_heading_offset[i] = GSF_UNKNOWN_PARAM_VALUE;
-    }
-
-    /* initialize the "applied" fields */
-    p->applied.position_x_offset = GSF_UNKNOWN_PARAM_VALUE;
-    p->applied.position_y_offset = GSF_UNKNOWN_PARAM_VALUE;
-    p->applied.position_z_offset = GSF_UNKNOWN_PARAM_VALUE;
-    p->applied.antenna_x_offset = GSF_UNKNOWN_PARAM_VALUE;
-    p->applied.antenna_y_offset = GSF_UNKNOWN_PARAM_VALUE;
-    p->applied.antenna_z_offset = GSF_UNKNOWN_PARAM_VALUE;
-    p->applied.mru_pitch_bias = GSF_UNKNOWN_PARAM_VALUE;
-    p->applied.mru_roll_bias = GSF_UNKNOWN_PARAM_VALUE;
-    p->applied.mru_heading_bias = GSF_UNKNOWN_PARAM_VALUE;
-    p->applied.mru_x_offset = GSF_UNKNOWN_PARAM_VALUE;
-    p->applied.mru_y_offset = GSF_UNKNOWN_PARAM_VALUE;
-    p->applied.mru_z_offset = GSF_UNKNOWN_PARAM_VALUE;
-    p->applied.center_of_rotation_x_offset = GSF_UNKNOWN_PARAM_VALUE;
-    p->applied.center_of_rotation_y_offset = GSF_UNKNOWN_PARAM_VALUE;
-    p->applied.center_of_rotation_z_offset = GSF_UNKNOWN_PARAM_VALUE;
-    p->applied.position_latency = GSF_UNKNOWN_PARAM_VALUE;
-    p->applied.attitude_latency = GSF_UNKNOWN_PARAM_VALUE;
-    p->applied.depth_sensor_latency = GSF_UNKNOWN_PARAM_VALUE;
-    p->applied.depth_sensor_x_offset = GSF_UNKNOWN_PARAM_VALUE;
-    p->applied.depth_sensor_y_offset = GSF_UNKNOWN_PARAM_VALUE;
-    p->applied.depth_sensor_z_offset = GSF_UNKNOWN_PARAM_VALUE;
-    for (i = 0; i < GSF_MAX_OFFSETS; i++)
-    {
-        p->applied.draft[i] = GSF_UNKNOWN_PARAM_VALUE;
-        p->applied.pitch_bias[i] = GSF_UNKNOWN_PARAM_VALUE;
-        p->applied.roll_bias[i] = GSF_UNKNOWN_PARAM_VALUE;
-        p->applied.gyro_bias[i] = GSF_UNKNOWN_PARAM_VALUE;
-        p->applied.transducer_x_offset[i] = GSF_UNKNOWN_PARAM_VALUE;
-        p->applied.transducer_y_offset[i] = GSF_UNKNOWN_PARAM_VALUE;
-        p->applied.transducer_z_offset[i] = GSF_UNKNOWN_PARAM_VALUE;
-        p->applied.transducer_pitch_offset[i] = GSF_UNKNOWN_PARAM_VALUE;
-        p->applied.transducer_roll_offset[i] = GSF_UNKNOWN_PARAM_VALUE;
-        p->applied.transducer_heading_offset[i] = GSF_UNKNOWN_PARAM_VALUE;
-        p->applied.rx_transducer_x_offset[i] = GSF_UNKNOWN_PARAM_VALUE;
-        p->applied.rx_transducer_y_offset[i] = GSF_UNKNOWN_PARAM_VALUE;
-        p->applied.rx_transducer_z_offset[i] = GSF_UNKNOWN_PARAM_VALUE;
-        p->applied.rx_transducer_pitch_offset[i] = GSF_UNKNOWN_PARAM_VALUE;
-        p->applied.rx_transducer_roll_offset[i] = GSF_UNKNOWN_PARAM_VALUE;
-        p->applied.rx_transducer_heading_offset[i] = GSF_UNKNOWN_PARAM_VALUE;
-    }
-}
-
diff --git a/src/gsf/gsf.c.orig b/src/gsf/gsf.c.orig
deleted file mode 100644
index 79c5df7..0000000
--- a/src/gsf/gsf.c.orig
+++ /dev/null
@@ -1,9450 +0,0 @@
-/********************************************************************
- *
- * Module Name : GSF
- *
- * Author/Date : J. S. Byrne / 3 May 1994
- *
- * Description : This source file contains the gsf library entry point
- *  functions for accessesing multibeam sonar data in a generic byte stream
- *  format.  Each record in these binary files contains an ID and a size,
- *  and these two values are used to read and decode the rest of the data
- *  record.  Data records are read/written one at a time, in a sequential
- *  manner.  Refer to the DoDBL Generic Sensor format design documentation
- *  for a more detailed verbal description of the data format.
- *
- * Restrictions/Limitations :
- * 1) This library assumes the host computer uses the ASCII character set.
- * 2) This library assumes that the type short is 16 bits, and that the type
- *    int is 32 bits.
- *
- * Change Descriptions :
- * who  when      what
- * ---  ----      ----
- * jsb  10-25-94  Added gsfOpenBuffered function call, and call to setvbuf
- *                in gsfOpen to deal with high data rate multibeam data.
- * jsb  08-14-95  Direct and sequential access now work through common
- *                gsfRead and gsfWrite API. All pointers to dynamically
- *                allocated memory are now maintained by the library.
- *                Call this version "GSF-v01.01".
- * jsb  11/01/95  Completed modifications to indexing to support increase in
- *                gsf file size after initial index file creation.  The size
- *                of the file is now stored in the index file header. Index
- *                files without the expected header are recreated on the first
- *                open. This is still version GSF-v01.01. Also added a unique
- *                sensor specific subrecord for Simrad em1000.
- * jsb  12/22/95  Added gsfGetMBParams, gsfPutMBParams, gsfIsStarboardPing,
- *                and gsfGetSwathBathyBeamWidths. Also added GSF_APPEND as
- *                a file access mode, and modifed GSF_CREATE access mode so
- *                that files can be updated (read and written). This is gsf
- *                library version GSF-v01.02.
- * fd   04/15/96  Corrected the internals of gsfIsStarboardPing
- * hem  08/20/96  Added support for single beam pings; added gsfStringError;
- *                fixed 4 byte boundary padding.  This is gsf library
- *                version GSF-v1.03.
- * jsb  10/04/96  Changed fopen argument from "wb" to "a+b" for the GSF_APPEND
- *                access mode.  Also added logic to set file pointer to top prior
- *                to trying to read the gsf header record in gsfOpen/gsfOpenBuffered
- *                when the file access mode is GSF_APPEND.  Replaced use of
- *                numOpenFiles with *handle as argument to gsfRead and gsfWrite
- *                within gsfOpen and gsfOpenBuffered.  This repairs problems which
- *                can occur when a single application is accessing multiple files.
- * jsb  04/18/97  Added gsf version dependancy on approach to padding records out
- *                to four byte boundary. This is required in order to support the
- *                update access modes for versions prior to 1.03.  Replaced use of
- *                fgetpos, fsetpos with ftell, fseek.  This was done so that we can
- *                compair the previous_record field of the file table with addresses
- *                from an index file. Modified gsfStringError so that there is a single
- *                return statement, this was done to eliminate "statement not reached"
- *                compile warnings.
- * bac  10/27/97  Added a case in gsfGetSwathBathyBeamWidths for the Sea Beam 2112/36.
- * dwc 1/9/98     Added a case in gsfGetSwathBathyBeamWidths for the Elac Bottomchart MkII.
- * bac  03/15/98  Added an array subrecord for signal to noise ratio.
- * bac  03/15/98  Added an array subrecord for beam angle forward.
- * jsb  09/28/98  Added support for new navigation error record. Modified gsfPrintError
- *                 to use gsfStringError.
- * wkm  04/01/99  Added case for CmpSass (Compressed SASS) data to set beam widths to 1.0.
- * jsb  04/02/99  Added support for EM3000 series sonar systems.
- * jsb  07/20/99  Completed work on GSF version 1.08.  Added new functions gsfGetSwathBathyArrayMinMax,
- *                and gsfLoadDepthScaleFactorAutoOffset in support of signed depth.
- *                This release addresses the following CRs: GSF-99-002, GSF-99-006, GSF-99-007,
- *                GSF-99-008, GSF-99-009, GSF-99-010, GSF-99-011, GSF-99-012,
- * jsb  04/05/00  Updated so that an application can work with up to GSF_MAX_OPEN_FILES at
- *                a time.  Prior to these updates an application could only open (GSF_MAX_OPEN_FILES-1)
- *                files at a time. Also updated gsfOpen and gsfOpenBuffered to return the correct
- *                error code if a failure occures reading the file header.
- * bac 07-18-01   Made modifications for use with C++ code.  The typedef for each sensor
- *                specific structure has been modified to have a different name than the
- *                element of the SensorSpecific union.  Also removed the useage of C++
- *                reserved words "class" and "operator".  These modifications will potentially
- *                require some changes to application code. Added support for the Reson 8100 series of sonars.
- * bac 10-12-01   Added a new attitude record definition.  The attitude record provides a method for
- *                logging full time-series attitude measurements in the GSF file, instead of attitude
- *                samples only at ping time.  Each attitude record contains arrays of attitude
- *                measurements for time, roll, pitch, heave and heading.  The number of measurements
- *                is user-definable, but because of the way in which measurement times are stored, a
- *                single attitude record should never contain more than sixty seconds worth of
- *                data.
- * bac 11-09-01   Added motion sensor offsets to the gsfMBOffsets structure.  Added support for these
- *                new offsets in the gsfPutMBParams and gsfGetMBParams functions, so these offsets are
- *                encoded in the process_parameters record.
- * jsb 01-21-02   If the fread doesn't complete, rewind the file to the beginning of the current
- *                record, set gsfError to END_OF_FILE, and return -1.  Removed variables that were
- *                not used, fixed return code and gsfError for default case block in gsfGetBeamWidths,
- *                and update strncpy in gsfSetParam and gsfCopyRecords to ensure that the terminating
- *                NULL is copied to the target pointer.
- * bac 06-19-03   Added support for bathymetric receive beam time series intensity data (i.e., Simrad
- *                "Seabed image" and Reson "snippets").  Inlcluded RWL updates of 12-19-02 for adding
- *                sensor-specific singlebeam information to the MB sensor specific subrecords.
- * bac 12-28-04   Added support for EM3000D, EM3002, and EM3002D in gsfGetSwathBathyBeamWidths.  Updated
- *                gsfLoadDepthScaleFactorAutoOffset to vary the offset interval based on precision.
- *                Updated gsfFree to free and set to NULL the quality_flags, vertical_error, horizontal_error,
- *                and brb_inten arrays.  Added vertical_error and horizontal_error processing to gsfCopyRecords.
- * bac 06-28-06   Updated gsfIsStarboardPing to work with EM3000D and EM3002D.  Updated gsfCopyRecords
- *                to copy the hv_nav_error record.  Added  for EM121A data received via Kongsberg SIS.
- *                Replaced references to long types with int types, for compilation on 64-bit architectures.
- * jsb 11-06-07   Updates to utilize the subrecord size in termining the field size for the array subrecords
- *                that support more than one field size.  Also replaced use of strstr with strcmp in gsfGetMBParams
- *                to resolve potential problem where one keyword name may be fully contained in another.
- * DHG 2008/12/18 Add "PLATFORM_TYPE" to Processing Parameters for AUV vs Surface Ship discrimination.
- * mab 02-01-09   Updates to support Reson 7125. Added new subrecord IDs and subrecord definitions for Kongsberg
- *                sonar systems where TWTT and angle are populated from raw range and beam angle datagram. Added
- *                new subrecord definition for EM2000.  Bug fixes in gsfOpen and gsfPercent.
- * clb 05-17-11   Added depth sensor and receiver array offsets to the gsfGetMBParams() and gsfPutMBParams()
- * clb 10-04-11   Added check in gsfUnpackStream() for a partial record at the end of the file
- * clb 10-17-11   Handle all the error processing in gsfOpen() and gsfOpenBuffered() consistently
- * clb 11-09-aa   Added validity checks in gsfPutMBParams(); initialize param structure in gsfGetMBParams();
- *                added gsfInitializeMBParams(); validate handles in functions that use them
- *
- *
- * Classification : Unclassified
- *
- * References : DoDBL Generic Sensor Format Sept. 30, 1993
- *
- *
- * copyright 2014 Leidos, Inc.
- * There is no charge to use the library, and it may be accessed at:
- * https://www.leidos.com/maritime/gsf.
- * This library may be redistributed and/or modified under the terms of
- * the GNU Lesser General Public License version 2.1, as published by the
- * Free Software Foundation.  A copy of the LGPL 2.1 license is included with
- * the GSF distribution and is avaialbe at: http://opensource.org/licenses/LGPL-2.1.
- *
- * Leidos, Inc. configuration manages GSF, and provides GSF releases. Users are
- * strongly encouraged to communicate change requests and change proposals to Leidos, Inc.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE.
- *
- ********************************************************************/
-
-/* standard c library includes */
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <limits.h>
-#include <errno.h>
-#include <math.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-
-/* rely on the network type definitions of (u_short, and u_int) */
-#if !defined WIN32 && !defined WIN64
-#include <netinet/in.h>
-#else
-#include <winsock.h>
-#endif
-
-/* gsf library interface description */
-#include "gsf.h"
-
-/* get the prototypes for the gsf encode and gsf decode functions */
-#include "gsf_ft.h"
-#include "gsf_enc.h"
-#include "gsf_dec.h"
-#include "gsf_indx.h"
-
-/* Macros required for this module */
-#ifndef USE_DEFAULT_FILE_FUNCTIONS
-
-#undef fseek
-#undef ftell
-#if (defined _WIN32) && (defined _MSC_VER)
-#define fseek(x, y, z) _fseeki64((x), (y), (z))
-#define ftell(x)   _ftelli64((x))
-#else  // Linux, MingW, MacOS
-#undef fopen
-#define fopen(x, y)  fopen64((x), (y))
-#define fseek(x, y, z) fseeko64((x), (y), (z))
-#define ftell(x)   ftello64((x))
-#endif
-
-#endif
-
-#define GSF_FILL_SIZE 8                   /* gsf packaging with no checksum */
-#define GSF_FILL_SIZE_CHECKSUM 12         /* gsf packaging with checksum */
-#define GSF_STREAM_BUF_SIZE 8192          /* gsf default stream buffer size */
-#define GSF_UNKNOWN_PARAM_TEXT "UNKNWN"   /* Flag value for unknown parameter value */
-
-#define GSF_MAX_PARAM    999999          /* used in gsfPutMBParams() to prevent bad values */
-#define GSF_MIN_PARAM   -999999
-
-/* JSB 07/15/99 Added these macros to support new gsfGetSwathBathyArrayMinMax function */
-#define GSF_U_CHAR_MIN            (0.0)
-#define GSF_U_CHAR_MAX          (255.0)
-#define GSF_S_CHAR_MIN         (-128.0)
-#define GSF_S_CHAR_MAX         (+127.0)
-#define GSF_U_SHORT_MIN           (0.0)
-#define GSF_U_SHORT_MAX       (65535.0)
-#define GSF_S_SHORT_MIN      (-32768.0)
-#define GSF_S_SHORT_MAX       (32767.0)
-#define GSF_U_INT_MIN             (0.0)
-#define GSF_U_INT_MAX    (4294967295.0)
-#define GSF_S_INT_MIN   (-2147483648.0)
-#define GSF_S_INT_MAX    (2147483647.0)
-
-/* Static Global data for this module */
-static unsigned char streamBuff[GSF_MAX_RECORD_SIZE];
-static int      numOpenFiles;
-static GSF_FILE_TABLE gsfFileTable[GSF_MAX_OPEN_FILES];
-
-/* Global external data defined in this module */
-int             gsfError;       /* used to report most recent error */
-
-/* Static functions used, but not exported from this source file */
-static gsfuLong gsfChecksum(unsigned char *buff, unsigned int num_bytes);
-static int      gsfSeekRecord(int handle, gsfDataID *id);
-static int      gsfUnpackStream (int handle, int desiredRecord, gsfDataID *dataID, gsfRecords *rptr, unsigned char *buf, int max_size);
-static int      gsfSetParam(int handle, int index, char *val, gsfRecords *rec);
-static int      gsfNumberParams(char *param);
-
-
-/********************************************************************
- *
- * Function Name : gsfStat
- *
- * Description : This function attempts to stat a GSF file.
- *               Supports 64 bit file size.
- *
- * Inputs :
- *  filename = a fully qualified path to the gsf file
- *  sz       = pointer to an 8 byte long long for return
- *             of the GSF file size from the stat64 system call.
- *
- * Returns :
- *  This funciton returns zero if successful, or -1 if an error occured.
- *
- * Error Conditions :
- *     GSF_FOPEN_ERROR
- *     GSF_UNRECOGNIZED_FILE
- *
- ********************************************************************/
-int
-gsfStat (const char *filename, long long *sz)
-{
-    int rc;
-
-    gsfError = 0;
-
-    if (sz == NULL)
-    {
-        gsfError = GSF_FOPEN_ERROR;
-        return -1;
-    }
-
-#ifdef USE_DEFAULT_FILE_FUNCTIONS
-    struct stat stbuf;
-    rc = stat(filename, &stbuf);
-#else
-#ifdef (defined __WINDOWS__) || (defined __MINGW32__)
-    struct _stati64    stbuf;
-    rc = _stati64(filename, &stbuf);
-#else
-    struct stat64      stbuf;
-    rc = stat64(filename, &stbuf);
-#endif
-#endif
-
-    if (!rc)
-    {
-        *sz = stbuf.st_size;
-    }
-    else
-    {
-        gsfError = GSF_UNRECOGNIZED_FILE;
-    }
-
-    return rc;
-}
-
-
-/********************************************************************
- *
- * Function Name : gsfOpen
- *
- * Description : This function attempts to open a gsf data file.  If the
- *  file exits and is opened readonly or update the gsf header is read
- *  to confirm that this is a gsf data file.  If the file is opened create,
- *  the GSF header containing the version number of the software library is
- *  written into the header.  This function passes an integer handle back to
- *  the calling application.  The handle is used for all further access to the
- *  file. gsfOpen explicitly sets stream bufferring to the value specified
- *  by GSF_STREAM_BUF_SIZE.  The internal file table is searched for an
- *  available entry whose name matches that specified in the argument list, if
- *  no match is found, then the first available entry is used.  Up to
- *  GSF_MAX_OPEN_FILES files may be open by an application at a time.
- *
- * Inputs :
- *  filename = a fully qualified path to the gsf file to open
- *  mode may have the following values:
- *     GSF_READONLY = open an existing file for read only access
- *     GSF_UPDATE   = open an existing file for reading an writing
- *     GSF_CREATE   = create a new gsf file
- *     GSF_READONLY_INDEX = open an existing file for read only access with index
- *     GSF_UPDATE_INDEX   = open an existing file for reading an writing with index
- *  handle = a pointer to an integer to be assigned a handle which will be
- *     reference for all future file access.
- *
- * Returns :
- *  This funciton returns zero if successful, or -1 if an error occured.
- *
- * Error Conditions :
- *     GSF_BAD_ACCESS_MODE
- *     GSF_TOO_MANY_OPEN_FILES
- *     GSF_FOPEN_ERROR
- *     GSF_SETVBUF_ERROR
- *     GSF_UNRECOGNIZED_FILE
- *
- ********************************************************************/
-int
-gsfOpen(const char *filename, const int mode, int *handle)
-{
-  char           *access_mode;
-  int             fileTableIndex;
-  int             length;
-  int             headerSize;
-  int             ret;
-  gsfDataID       id;
-  long long       stsize;
-  FILE           *fp;
-
-  /* Clear the gsfError value each time a new file is opened */
-  gsfError = 0;
-  /* Make sure we don't inadvertently send a valid handle back */
-  *handle = 0;
-
-  /* get the desired file access mode */
-  switch (mode)
-  {
-    case GSF_CREATE:
-      access_mode = "w+b";
-      break;
-
-    case GSF_READONLY:
-      access_mode = "rb";
-      break;
-
-    case GSF_UPDATE:
-      access_mode = "r+b";
-      break;
-
-    case GSF_READONLY_INDEX:
-      access_mode = "rb";
-      break;
-
-    case GSF_UPDATE_INDEX:
-      access_mode = "r+b";
-      break;
-
-    case GSF_APPEND:
-      access_mode = "a+b";
-      break;
-
-    default:
-      gsfError = GSF_BAD_ACCESS_MODE;
-      return(-1);
-  }
-
-  /* check the number of files currently openned */
-  if (numOpenFiles >= GSF_MAX_OPEN_FILES)
-  {
-    gsfError = GSF_TOO_MANY_OPEN_FILES;
-    return(-1);
-  }
-
-  /* Try to open this file */
-  if ((fp = fopen(filename, access_mode)) == (FILE *) NULL)
-  {
-    gsfError = GSF_FOPEN_ERROR;
-    return(-1);
-  }
-
-    /* The file was successfully opened, load the gsf file table structure by
-  * searching the gsf file table for the caller's filename.  This is done
-  * so that the same file table slot may be re-used.  Applications which
-  * want their file closed frequently, such as real-time data collection
-  * programs may do this to assure data integrity, and it makes sense
-  * to resuse the file table slot they occupied from a previous call to
-  * gsfOpen, so that the ping scale factors don't have to be reset except
-  * when a new file is created.
-    */
-  numOpenFiles++;
-  length = strlen (filename);
-  if (length >= sizeof(gsfFileTable[0].file_name))
-  {
-    length = sizeof(gsfFileTable[0].file_name) - 1;
-  }
-  for (fileTableIndex=0; fileTableIndex<GSF_MAX_OPEN_FILES; fileTableIndex++)
-  {
-    if ((memcmp(gsfFileTable[fileTableIndex].file_name, filename, length) == 0) &&
-         (gsfFileTable[fileTableIndex].occupied == 0))
-    {
-      break;
-    }
-  }
-
-  /* If no filename match was found then use the first available slot */
-  if (fileTableIndex == GSF_MAX_OPEN_FILES)
-  {
-    for (fileTableIndex=0; fileTableIndex<GSF_MAX_OPEN_FILES; fileTableIndex++)
-    {
-      if (gsfFileTable[fileTableIndex].occupied == 0)
-      {
-        strncpy (gsfFileTable[fileTableIndex].file_name, filename, sizeof(gsfFileTable[fileTableIndex].file_name));
-                /* This is the first open for this file, so clear the
-        * pointers to dynamic memory.
-                */
-        gsfFree (&gsfFileTable[fileTableIndex].rec);
-        break;
-      }
-    }
-  }
-
-  gsfFileTable[fileTableIndex].fp = fp;
-  gsfFileTable[fileTableIndex].buf_size = GSF_STREAM_BUF_SIZE;
-  gsfFileTable[fileTableIndex].occupied = 1;
-  *handle = fileTableIndex + 1;
-
-  /* Set the desired buffer size */
-  if (setvbuf(fp, NULL, _IOFBF, GSF_STREAM_BUF_SIZE))
-  {
-    gsfError = GSF_SETVBUF_ERROR;
-    gsfClose ((int) *handle);
-    *handle = 0;
-    return(-1);
-  }
-
-  /* Use stat to get the size of this file. File size is used by gsfPercent */
-  if (gsfStat (filename, &stsize))
-  {
-    gsfError = GSF_READ_ERROR;
-    gsfClose ((int) *handle);
-    *handle = 0;
-    return(-1);
-  }
-  gsfFileTable[fileTableIndex].file_size = stsize;
-
-    /* If this file was just created, (ie it has a size of 0 bytes) then
-  * write the gsf file header record. Also, set a flag to indicate
-  * that the ping scale factors need to be written with the next swath
-  * bathymetry ping record.
-    */
-  if (stsize == 0)
-  {
-    gsfFileTable[fileTableIndex].scales_read = 1;
-
-    /* write the gsf file header to the file */
-    id.checksumFlag = 0;
-    id.reserved = 0;
-    id.recordID = GSF_RECORD_HEADER;
-    strncpy(gsfFileTable[fileTableIndex].rec.header.version, GSF_VERSION, GSF_VERSION_SIZE-1);
-    gsfFileTable[fileTableIndex].rec.header.version[GSF_VERSION_SIZE] = 0;
-    gsfFileTable[fileTableIndex].bufferedBytes += gsfWrite(*handle, &id, &gsfFileTable[fileTableIndex].rec);
-
-        /* Flush this record to disk so that the file size will be non-zero
-    * on the next call to gsfOpen.
-        */
-    if (fflush (gsfFileTable[fileTableIndex].fp))
-    {
-      gsfError = GSF_FLUSH_ERROR;
-      gsfClose ((int) *handle);
-      *handle = 0;
-      return(-1);
-    }
-  }
-  else
-  {
-        /* Read the GSF header, if the access mode is append, we need to
-    * seek back to the top of the file.
-        */
-    if (mode == GSF_APPEND)
-    {
-      if (fseek(gsfFileTable[fileTableIndex].fp, 0, SEEK_SET))
-      {
-        gsfError = GSF_FILE_SEEK_ERROR;
-        gsfClose ((int) *handle);
-        *handle = 0;
-        return(-1);
-      }
-    }
-    /* Read the GSF header */
-    headerSize = gsfRead(*handle, GSF_NEXT_RECORD, &id, &gsfFileTable[fileTableIndex].rec, NULL, 0);
-    /* JSB 04/05/00 Updated to return correct error code */
-    if (headerSize < 0)
-    {
-      gsfError = GSF_HEADER_RECORD_DECODE_FAILED;
-      gsfClose (*handle);
-      *handle = 0;
-      return(-1);
-    }
-    /* JSB end of updates from 04/055/00 */
-    if (!strstr(gsfFileTable[fileTableIndex].rec.header.version, "GSF-"))
-    {
-      gsfError = GSF_UNRECOGNIZED_FILE;
-      gsfClose (*handle);
-      *handle = 0;
-      return(-1);
-    }
-    /* If the mode is append seek back to the end of the file */
-    if (mode == GSF_APPEND)
-    {
-      if (fseek(gsfFileTable[fileTableIndex].fp, 0, SEEK_END))
-      {
-        gsfError = GSF_FILE_SEEK_ERROR;
-        gsfClose ((int) *handle);
-        *handle = 0;
-        return(-1);
-      }
-    }
-  }
-
-  /* jsb 04/16/97 Save the GSF version ID into the file table */
-  ret = sscanf (gsfFileTable[fileTableIndex].rec.header.version, "GSF-v%d.%d",
-                &gsfFileTable[fileTableIndex].major_version_number,
-                &gsfFileTable[fileTableIndex].minor_version_number);
-  if (ret != 2)
-  {
-    gsfError = GSF_UNRECOGNIZED_FILE;
-    gsfClose ((int) *handle);
-    *handle = 0;
-    return(-1);
-  }
-
-    /*  Set the update flag if needed. This is used to force a call to fflush
-  *  between read an write operations, on files opened for update.
-    */
-  if ((mode == GSF_UPDATE) ||
-       (mode == GSF_UPDATE_INDEX) ||
-       (mode == GSF_CREATE))
-  {
-    gsfFileTable[fileTableIndex].update_flag = 1;
-  }
-  else
-  {
-    gsfFileTable[fileTableIndex].update_flag = 0;
-  }
-
-  /* Set the index flag and open the index file if needed. */
-  if ((mode == GSF_READONLY_INDEX) || (mode == GSF_UPDATE_INDEX))
-  {
-    gsfFileTable[fileTableIndex].direct_access = 1;
-    if (gsfOpenIndex (filename, *handle, &gsfFileTable[fileTableIndex]) == -1)
-    {
-      gsfFileTable[fileTableIndex].direct_access = 0;
-      gsfError = GSF_INDEX_FILE_OPEN_ERROR;
-      gsfClose ((int) *handle);
-      *handle = 0;
-      return(-1);
-    }
-
-        /* Move the file pointer back to the first record past the gsf file header. This
-    * is required since we will have read the entire to create the index.
-        */
-    if (fseek(gsfFileTable[fileTableIndex].fp, headerSize, SEEK_SET))
-    {
-      gsfError = GSF_FILE_SEEK_ERROR;
-      gsfClose ((int) *handle);
-      *handle = 0;
-      return(-1);
-    }
-  }
-  else
-  {
-    gsfFileTable[fileTableIndex].direct_access = 0;
-  }
-
-  /* Save the file acess mode */
-  switch (mode)
-  {
-    case GSF_CREATE:
-      gsfFileTable[fileTableIndex].access_mode = GSF_CREATE;
-      break;
-
-    case GSF_READONLY:
-      gsfFileTable[fileTableIndex].access_mode = GSF_READONLY;
-      break;
-
-    case GSF_UPDATE:
-      gsfFileTable[fileTableIndex].access_mode = GSF_UPDATE;
-      break;
-
-    case GSF_READONLY_INDEX:
-      gsfFileTable[fileTableIndex].access_mode = GSF_READONLY_INDEX;
-      break;
-
-    case GSF_UPDATE_INDEX:
-      gsfFileTable[fileTableIndex].access_mode = GSF_UPDATE_INDEX;
-      break;
-
-    case GSF_APPEND:
-      gsfFileTable[fileTableIndex].access_mode = GSF_APPEND;
-      break;
-
-    default:
-      gsfError = GSF_BAD_ACCESS_MODE;
-      gsfClose ((int) *handle);
-      *handle = 0;
-      return(-1);
-  }
-
-  return (0);
-}
-
-/********************************************************************
- *
- * Function Name : gsfOpenBuffered
- *
- * Description : This function attempts to open a gsf data file.  If the
- *  file exits and is opened readonly or update the gsf header is read
- *  to confirm that this is a gsf data file.  If the file is opened create,
- *  the GSF header containing the version number of the software library is
- *  written into the header.  This function passes an integer handle back to
- *  the calling application.  The handle is used for all further access to the
- *  file. gsfOpenBufferd explicitly sets stream bufferring to the value
- *  specified by the buf_size argument. The internal file table is searched
- *  for an available entry whose name matches that specified in the argument
- *  list, if no match is found, then the first available entry is used.  Up
- *  to GSF_MAX_OPEN_FILES files may be open by an application at a time.
- *  gsfOpenBuffered performs identical processing to gsfOpen, except here,
- *  the caller is allowed to explicitly set the standard system library level
- *  I/O buffer size.
- *
- * Inputs :
- *  filename = a fully qualified path to the gsf file to open
- *  mode may have the following values:
- *     GSF_READONLY = open an existing file for read only access
- *     GSF_UPDATE   = open an existing file for reading an writing
- *     GSF_CREATE   = create a new gsf file
- *     GSF_READONLY_INDEX = open an existing file for read only access with index
- *     GSF_UPDATE_INDEX   = open an existing file for reading an writing with index
- *  handle = a pointer to an integer to be assigned a handle which will be
- *     reference for all future file access.
- *  buf_size = an integer buffer size in bytes.
- *
- * Returns :
- *  This funciton returns zero if successful, or -1 if an error occured.
- *
- * Error Conditions :
- *     GSF_BAD_ACCESS_MODE
- *     GSF_TOO_MANY_OPEN_FILES
- *     GSF_FOPEN_ERROR
- *     GSF_SETVBUF_ERROR
- *     GSF_UNRECOGNIZED_FILE
- *
- ********************************************************************/
-int
-gsfOpenBuffered(const char *filename, const int mode, int *handle, int buf_size)
-{
-    char           *access_mode;
-    int             fileTableIndex;
-    int             length;
-    int             headerSize;
-    int             ret;
-    long long       stsize;
-    gsfDataID       id;
-    FILE           *fp;
-
-    /* Clear the gsfError value each time a new file is opened */
-    gsfError = 0;
-    /* Make sure we don't inadvertently send a valid handle back */
-    *handle = 0;
-
-    /* get the desired file access mode */
-    switch (mode)
-    {
-        case GSF_CREATE:
-            access_mode = "w+b";
-            break;
-
-        case GSF_READONLY:
-            access_mode = "rb";
-            break;
-
-        case GSF_UPDATE:
-            access_mode = "r+b";
-            break;
-
-        case GSF_READONLY_INDEX:
-            access_mode = "rb";
-            break;
-
-        case GSF_UPDATE_INDEX:
-            access_mode = "r+b";
-            break;
-
-        case GSF_APPEND:
-            access_mode = "a+b";
-            break;
-
-        default:
-            gsfError = GSF_BAD_ACCESS_MODE;
-            return (-1);
-    }
-
-    /* check the number of files currently openned */
-    if (numOpenFiles >= GSF_MAX_OPEN_FILES)
-    {
-        gsfError = GSF_TOO_MANY_OPEN_FILES;
-        return (-1);
-    }
-
-    /* Try to open this file */
-    if ((fp = fopen(filename, access_mode)) == (FILE *) NULL)
-    {
-        gsfError = GSF_FOPEN_ERROR;
-        return (-1);
-    }
-
-    /* The file was successfully opened, load the gsf file table structure by
-     * searching the gsf file table for the caller's filename.  This is done
-     * so that the same file table slot may be re-used.  Applications which
-     * want their file closed frequently, such as real-time data collection
-     * programs may do this to assure data integrity, and it makes sense
-     * to resuse the file table slot they occupied from a previous call to
-     * gsfOpen, so that the ping scale factors don't have to be reset except
-     * when a new file is created.
-     */
-    numOpenFiles++;
-    length = strlen (filename);
-    if (length >= sizeof(gsfFileTable[0].file_name))
-    {
-        length = sizeof(gsfFileTable[0].file_name) - 1;
-    }
-    for (fileTableIndex=0; fileTableIndex<GSF_MAX_OPEN_FILES; fileTableIndex++)
-    {
-        if ((memcmp(gsfFileTable[fileTableIndex].file_name, filename, length) == 0) &&
-            (gsfFileTable[fileTableIndex].occupied == 0))
-        {
-            break;
-        }
-    }
-
-    /* If no filename match was found then use the first available slot */
-    if (fileTableIndex == GSF_MAX_OPEN_FILES)
-    {
-        for (fileTableIndex=0; fileTableIndex<GSF_MAX_OPEN_FILES; fileTableIndex++)
-        {
-            if (gsfFileTable[fileTableIndex].occupied == 0)
-            {
-                strncpy (gsfFileTable[fileTableIndex].file_name, filename, sizeof(gsfFileTable[fileTableIndex].file_name));
-                /* This is the first open for this file, so clear the
-                 * pointers to dynamic memory.
-                 */
-                gsfFree (&gsfFileTable[fileTableIndex].rec);
-                break;
-            }
-        }
-    }
-
-    gsfFileTable[fileTableIndex].fp = fp;
-    gsfFileTable[fileTableIndex].buf_size = buf_size;
-    gsfFileTable[fileTableIndex].occupied = 1;
-    *handle = fileTableIndex + 1;
-
-    /* Set the desired buffer size */
-    if (setvbuf(fp, NULL, _IOFBF, buf_size))
-    {
-        gsfClose ((int) *handle);
-        gsfError = GSF_SETVBUF_ERROR;
-        *handle = 0;
-        return (-1);
-    }
-
-    /* Use stat to get the size of this file. File size is used by gsfPercent */
-    if (gsfStat (filename, &stsize))
-    {
-        gsfError = GSF_READ_ERROR;
-        gsfClose (*handle);
-        *handle = 0;
-        return(-1);
-    }
-    gsfFileTable[fileTableIndex].file_size = stsize;
-
-    /* If this file was just created, (ie it has a size of 0 bytes) then
-     * write the gsf file header record. Also, set a flag to indicate
-     * that the ping scale factors need to be written with the next swath
-     * bathymetry ping record.
-     */
-    if (stsize == 0)
-    {
-        gsfFileTable[fileTableIndex].scales_read = 1;
-
-        /* write the gsf file header to the file */
-        id.checksumFlag = 0;
-        id.reserved = 0;
-        id.recordID = GSF_RECORD_HEADER;
-        strncpy(gsfFileTable[fileTableIndex].rec.header.version, GSF_VERSION, GSF_VERSION_SIZE-1);
-        gsfFileTable[fileTableIndex].rec.header.version[GSF_VERSION_SIZE] = 0;
-        gsfFileTable[fileTableIndex].bufferedBytes += gsfWrite(*handle, &id, &gsfFileTable[fileTableIndex].rec);
-
-        /* Flush this record to disk so that the file size will be non-zero
-         * on the next call to gsfOpen.
-         */
-        if (fflush (gsfFileTable[fileTableIndex].fp))
-        {
-            gsfError = GSF_FLUSH_ERROR;
-            gsfClose (*handle);
-            *handle = 0;
-            return(-1);
-        }
-    }
-    else
-    {
-        /* Read the GSF header, if the access mode is append, we need to
-         * seek back to the top of the file.
-         */
-        if (mode == GSF_APPEND)
-        {
-            if (fseek(gsfFileTable[fileTableIndex].fp, 0, SEEK_SET))
-            {
-                gsfError = GSF_FILE_SEEK_ERROR;
-                gsfClose (*handle);
-                *handle = 0;
-                return (-1);
-            }
-        }
-        /* Read the GSF header */
-        headerSize = gsfRead(*handle, GSF_NEXT_RECORD, &id, &gsfFileTable[fileTableIndex].rec, NULL, 0);
-        /* JSB 04/05/00 Updated to return correct error code */
-        if (headerSize < 0)
-        {
-            gsfError = GSF_HEADER_RECORD_DECODE_FAILED;
-            gsfClose (*handle);
-            *handle = 0;
-            return (-1);
-        }
-        /* JSB end of updates from 04/055/00 */
-        if (!strstr(gsfFileTable[fileTableIndex].rec.header.version, "GSF-"))
-        {
-            gsfError = GSF_UNRECOGNIZED_FILE;
-            gsfClose (*handle);
-            *handle = 0;
-            return (-1);
-        }
-        /* If the mode is append seek back to the end of the file */
-        if (mode == GSF_APPEND)
-        {
-            if (fseek(gsfFileTable[fileTableIndex].fp, 0, SEEK_END))
-            {
-                gsfError = GSF_FILE_SEEK_ERROR;
-                gsfClose (*handle);
-                *handle = 0;
-                return (-1);
-            }
-        }
-    }
-
-    /* jsb 04/16/97 Save the GSF version ID into the file table */
-    ret = sscanf (gsfFileTable[fileTableIndex].rec.header.version, "GSF-v%d.%d",
-        &gsfFileTable[fileTableIndex].major_version_number,
-        &gsfFileTable[fileTableIndex].minor_version_number);
-    if (ret != 2)
-    {
-        gsfError = GSF_UNRECOGNIZED_FILE;
-        gsfClose (*handle);
-        *handle = 0;
-        return (-1);
-    }
-
-    /*  Set the update flag if needed. This is used to force a call to fflush
-     *  between read an write operations, on files opened for update.
-     */
-    if ((mode == GSF_UPDATE) ||
-        (mode == GSF_UPDATE_INDEX) ||
-        (mode == GSF_CREATE))
-    {
-        gsfFileTable[fileTableIndex].update_flag = 1;
-    }
-    else
-    {
-        gsfFileTable[fileTableIndex].update_flag = 0;
-    }
-
-    /* Set the index flag and open the index file if needed. */
-    if ((mode == GSF_READONLY_INDEX) || (mode == GSF_UPDATE_INDEX))
-    {
-        gsfFileTable[fileTableIndex].direct_access = 1;
-        if (gsfOpenIndex (filename, *handle, &gsfFileTable[fileTableIndex]) == -1)
-        {
-            gsfFileTable[fileTableIndex].direct_access = 0;
-            gsfError = GSF_INDEX_FILE_OPEN_ERROR;
-            gsfClose (*handle);
-            *handle = 0;
-            return (-1);
-        }
-
-        /* Move the file pointer back to the first record past the gsf file header. This
-         * is required since we will have read the entire to create the index.
-         */
-        if (fseek(gsfFileTable[fileTableIndex].fp, headerSize, SEEK_SET))
-        {
-            gsfError = GSF_FILE_SEEK_ERROR;
-            gsfClose (*handle);
-            *handle = 0;
-            return (-1);
-        }
-    }
-    else
-    {
-        gsfFileTable[fileTableIndex].direct_access = 0;
-    }
-
-    /* Save the file acess mode */
-    switch (mode)
-    {
-        case GSF_CREATE:
-            gsfFileTable[fileTableIndex].access_mode = GSF_CREATE;
-            break;
-
-        case GSF_READONLY:
-            gsfFileTable[fileTableIndex].access_mode = GSF_READONLY;
-            break;
-
-        case GSF_UPDATE:
-            gsfFileTable[fileTableIndex].access_mode = GSF_UPDATE;
-            break;
-
-        case GSF_READONLY_INDEX:
-            gsfFileTable[fileTableIndex].access_mode = GSF_READONLY_INDEX;
-            break;
-
-        case GSF_UPDATE_INDEX:
-            gsfFileTable[fileTableIndex].access_mode = GSF_UPDATE_INDEX;
-            break;
-
-        case GSF_APPEND:
-            gsfFileTable[fileTableIndex].access_mode = GSF_APPEND;
-            break;
-
-        default:
-            gsfError = GSF_BAD_ACCESS_MODE;
-            gsfClose (*handle);
-            *handle = 0;
-            return (-1);
-    }
-
-    return (0);
-}
-
-/********************************************************************
- *
- * Function Name : gsfClose
- *
- * Description : This function closes a gsf file previously openned
- *  using gsfOpen.
- *
- * Inputs :
- *  handle = the handle of the gsf file to be closed.
- *
- * Returns :
- *  This function returns zero if successful, or -1 if an error occured.
- *
- * Error Conditions :
- *    GSF_BAD_FILE_HANDLE
- *    GSF_FILE_CLOSE_ERROR
- *
- ********************************************************************/
-
-int
-gsfClose(const int handle)
-{
-    /* JSB 04/05/00 replaced ">=" with ">" */
-    if ((handle < 1) || (handle > GSF_MAX_OPEN_FILES))
-    {
-        gsfError = GSF_BAD_FILE_HANDLE;
-        return (-1);
-    }
-
-    if (gsfFileTable[handle -1].direct_access)
-    {
-        gsfCloseIndex (&gsfFileTable[handle - 1]);
-    }
-
-    if (fclose(gsfFileTable[handle - 1].fp))
-    {
-        gsfError = GSF_FILE_CLOSE_ERROR;
-        return (-1);
-    }
-
-    numOpenFiles--;
-
-    /* jsb 05/14/97 Clear the contents of the gsfFileTable fields. We don't
-     * want to clear the filename, this allows a performance improvement for
-     * programs which use append to log gsf files. (ie: data acquisition)
-     */
-    gsfFileTable[handle-1].major_version_number = 0;
-    gsfFileTable[handle-1].minor_version_number = 0;
-    gsfFileTable[handle-1].file_size = 0;
-    gsfFileTable[handle-1].previous_record = 0;
-    gsfFileTable[handle-1].buf_size = 0;
-    gsfFileTable[handle-1].bufferedBytes = 0;
-    gsfFileTable[handle-1].occupied = 0;
-    gsfFileTable[handle-1].update_flag = 0;
-    gsfFileTable[handle-1].direct_access = 0;
-    gsfFileTable[handle-1].read_write_flag = 0;
-    gsfFileTable[handle-1].scales_read = 0;
-    gsfFileTable[handle-1].access_mode = 0;
-
-    /* clear the contents of the index data table */
-    if (gsfFileTable[handle-1].index_data.scale_factor_addr)
-    {
-        free(gsfFileTable[handle-1].index_data.scale_factor_addr);
-    }
-    memset (&gsfFileTable[handle-1].index_data, 0, sizeof(gsfFileTable[handle-1].index_data));
-
-    /* Clear the necessary fields of the gsfRecords data structure */
-    memset(&gsfFileTable[handle-1].rec.header, 0, sizeof(gsfHeader));
-
-    return (0);
-}
-
-/********************************************************************
- *
- * Function Name : gsfSeek
- *
- * Description : This function may be used to move the file pointer
- *  for a previously openned gsf file.
- *
- * Inputs :
- *  handle = the integer handle returned from gsf Open
- *  option = the desired action for moving the file pointer, where:
- *    GSF_REWIND, move pointer to first record in the file.
- *    GSF_END_OF_FILE, move pointer to the end of the file.
- *    GSF_PREVIOUS_RECORD, backup to the beginning of the record just
- *     written or just read.
- *
- * Returns :
- *  This function returns zero if successful, or -1 if an error occured.
- *
- * Error Conditions :
- *    GSF_BAD_FILE_HANDLE
- *    GSF_FILE_SEEK_ERROR
- *    GSF_BAD_SEEK_OPTION
- *
- ********************************************************************/
-
-int
-gsfSeek(int handle, int option)
-{
-    /* JSB 04/05/00 replaced ">=" with ">" */
-    if ((handle < 1) || (handle > GSF_MAX_OPEN_FILES))
-    {
-        gsfError = GSF_BAD_FILE_HANDLE;
-        return (-1);
-    }
-
-    switch (option)
-    {
-        case GSF_REWIND:
-            /* If the last operation was a write then we need to fflush */
-            if (gsfFileTable[handle - 1].read_write_flag == LAST_OP_WRITE)
-            {
-                if (fflush (gsfFileTable[handle - 1].fp))
-                {
-                    gsfError = GSF_FLUSH_ERROR;
-                    return(-1);
-                }
-            }
-            gsfFileTable[handle - 1].read_write_flag = LAST_OP_FLUSH;
-
-            if (fseek(gsfFileTable[handle - 1].fp, 0, SEEK_SET))
-            {
-                gsfError = GSF_FILE_SEEK_ERROR;
-                return (-1);
-            }
-            break;
-
-        case GSF_END_OF_FILE:
-            /* If the last operation was a write then we need to fflush */
-            if (gsfFileTable[handle - 1].read_write_flag == LAST_OP_WRITE)
-            {
-                if (fflush (gsfFileTable[handle - 1].fp))
-                {
-                    gsfError = GSF_FLUSH_ERROR;
-                    return(-1);
-                }
-            }
-            gsfFileTable[handle - 1].read_write_flag = LAST_OP_FLUSH;
-
-            if (fseek(gsfFileTable[handle - 1].fp, 0, SEEK_END))
-            {
-                gsfError = GSF_FILE_SEEK_ERROR;
-                return (-1);
-            }
-            break;
-
-        case GSF_PREVIOUS_RECORD:
-            if (fseek(gsfFileTable[handle - 1].fp, gsfFileTable[handle - 1].previous_record, SEEK_SET))
-            {
-                gsfError = GSF_FILE_SEEK_ERROR;
-                return (-1);
-            }
-            break;
-
-        default:
-            gsfError = GSF_BAD_SEEK_OPTION;
-            return (-1);
-    }
-
-    return (0);
-}
-
-/********************************************************************
- *
- * Function Name : gsfRead
- *
- * Description : gsfRead supports both direct and sequential access. If the
- *  file is opened for sequential access, this function reads the desired
- *  record from the gsf data file specified by handle.  The "desiredRecord"
- *  argument may be set to GSF_NEXT_RECORD to read the next record in the
- *  data file, or "desiredRecord" record may be set to specify the record
- *  of interest, in which case the file will be read, skipping past
- *  intermediary records until the desired record is found.  When the desired
- *  record is found, it is read and then decoded from external to internal
- *  form. If the optional checksum is found with the data it will be verified.
- *  All of the fields of the gsfDataID structure, with the exception of the
- *  record_number field will be loaded with the values contained in the GSF
- *  record byte stream.  The record_number field will be undefined.  The
- *  stream and max_size arguments are normally set to NULL, unless the
- *  calling application is interested in a copy of the GSF byte stream.
- *
- *  If the file is opened for direct access, then the combination of the
- *  recordID and the record_number fields of the dataID structure are used
- *  to uniquely identify the record of interest.  The address for this record
- *  is retrieved from the index file, which was created on a previous call
- *  to gsfOpen or gsfOpenBuffered.  If the record of interest is a ping record
- *  for which we need to retrieve new scale factors, then the ping record
- *  containing the scale factors needed is read first, and then the ping
- *  record of interest is read.  Direct access applications should set the
- *  desiredRecord argument equal to the recordID field in the gsfDataID
- *  structure.
- *
- * Inputs :
- *    handle = the handle to the file as provided by gsfOpen
- *    desiredRecord = the desired record or GSF_NEXT_RECORD
- *    dataID = a pointer to a gsfDataID structure to be populated for the
- *             input record.
- *    rptr = a pointer to a gsfRecords structure to be populated with the
- *           data from the input record in internal form.
- *    buf = an optional pointer to caller memory to be populated with a copy
- *          of the gsf byte stream for this record.
- *    max_size = an optional maximum size to copy into buf
- *
- * Returns :
- *  This function returns the number of bytes read if successful,
- *  or -1 if an error occured.
- *
- * Error Conditions :
- *    GSF_BAD_FILE_HANDLE
- *    GSF_FILE_SEEK_ERROR
- *    GSF_FLUSH_ERROR
- *    GSF_READ_TO_END_OF_FILE
- *    GSF_READ_ERROR
- *    GSF_RECORD_SIZE_ERROR
- *    GSF_INSUFFICIENT_SIZE
- *    GSF_CHECKSUM_FAILURE
- *    GSF_UNRECOGNIZED_RECORD_ID
- *    GSF_HEADER_RECORD_DECODE_FAILED
- *    GSF_SVP_RECORD_DECODE_FAILED
- *    GSF_PROCESS_PARAM_RECORD_DECODE_FAILED
- *    GSF_SENSOR_PARAM_RECORD_DECODE_FAILED
- *    GSF_COMMENT_RECORD_DECODE_FAILED
- *    GSF_HISTORY_RECORD_DECODE_FAILED
- *    GSF_NAV_ERROR_RECORD_DECODE_FAILED
- ********************************************************************/
-
-int
-gsfRead(int handle, int desiredRecord, gsfDataID *dataID, gsfRecords *rptr, unsigned char *buf, int max_size)
-{
-    int             ret;
-    gsfDataID       tmpID;
-
-    /* Clear gsfError before each read */
-    gsfError = 0;
-
-    /* JSB 04/05/00 replaced ">=" with ">" */
-    if ((handle < 1) || (handle > GSF_MAX_OPEN_FILES))
-    {
-        gsfError = GSF_BAD_FILE_HANDLE;
-        return (-1);
-    }
-
-    /* If this file is opened for direct access, then move the file pointer
-     * to the record which the caller wants to read. Note that there is no
-     * file re-positioning to be done if the caller wants the next record.
-     */
-    if ((gsfFileTable[handle - 1].direct_access) &&
-        (desiredRecord != GSF_NEXT_RECORD))
-    {
-        memset(&tmpID, 0, sizeof(tmpID));
-        tmpID.recordID = desiredRecord;
-        tmpID.record_number = dataID->record_number;
-
-        ret = gsfSeekRecord(handle, &tmpID);
-        if (ret < 0)
-        {
-            /* gsfError is set in gsfSeekRecord */
-            return (-1);
-        }
-    }
-
-    ret = gsfUnpackStream (handle, desiredRecord, dataID, rptr, buf, max_size);
-
-    gsfFileTable[handle - 1].last_record_type = dataID->recordID;
-
-    return (ret);
-}
-
-/********************************************************************
- *
- * Function Name : gsfUnpackStream
- *
- * Description : gsfUnpackStream is a static function (not available to
- *   application programs) which is used by gsfRead to read and decode
- *   gsf records. It performs the bulk of the processing required to read
- *   a gsf record.  This processing exists as a function seperate from
- *   gsfRead since it is required both by gsfRead and by gsfSeekRecord.
- *   gsfUnpackStream is used by gsfSeekRecord to read a ping record with
- *   scale factors, which is required to support direct access.
- *
- * Inputs :
- *    handle = the handle to the file as provided by gsfOpen
- *    desiredRecord = the desired record or GSF_NEXT_RECORD
- *    dataID = a pointer to a gsfDataID structure to be populated for the
- *             input record.
- *    rptr = a pointer to a gsfRecords structure to be populated with the
- *           data from the input record in internal form.
- *    buf = an optional pointer to caller memory to be populated with a copy
- *          of the gsf byte stream for this record.
- *    max_size = an optional maximum size to copy into buf
- *
- * Returns :
- *  This function returns the number of bytes read if successful,
- *  or -1 if an error occured.
- *
- * Returns :
- *
- * Error Conditions :
- *    GSF_FILE_SEEK_ERROR
- *    GSF_FLUSH_ERROR
- *    GSF_READ_TO_END_OF_FILE
- *    GSF_RECORD_SIZE_ERROR
- *    GSF_INSUFFICIENT_SIZE
- *    GSF_CHECKSUM_FAILURE
- *    GSF_HEADER_RECORD_DECODE_FAILED
- *    GSF_SVP_RECORD_DECODE_FAILED
- *    GSF_PROCESS_PARAM_RECORD_DECODE_FAILED
- *    GSF_SENSOR_PARAM_RECORD_DECODE_FAILED
- *    GSF_COMMENT_RECORD_DECODE_FAILED
- *    GSF_HISTORY_RECORD_DECODE_FAILED
- *    GSF_NAV_ERROR_RECORD_DECODE_FAILED
- *
- ********************************************************************/
-
-static int
-gsfUnpackStream (int handle, int desiredRecord, gsfDataID *dataID, gsfRecords *rptr, unsigned char *buf, int max_size)
-{
-    int             readNext = 1;
-    int             ret;
-    long long       readStat;
-    gsfuLong        tmpBuff[2];
-    gsfuLong        dataSize;
-    gsfuLong        readSize;
-    gsfuLong        did;
-    gsfDataID       thisID;
-    gsfuLong        temp;
-    unsigned char  *dptr = streamBuff;
-    gsfuLong        ckSum;
-
-    if ((handle < 1) || (handle > GSF_MAX_OPEN_FILES))
-    {
-        gsfError = GSF_BAD_FILE_HANDLE;
-        return (-1);
-    }
-
-    /* This loop will read one record at a time until the record type
-     * desired by the caller is found.
-     */
-    while (readNext)
-    {
-        /* Get the current record pointer */
-        if ((gsfFileTable[handle - 1].previous_record = ftell(gsfFileTable[handle - 1].fp)) == -1)
-        {
-            gsfError = GSF_FILE_SEEK_ERROR;
-            return (-1);
-        }
-
-        /* If the file is open for update and the last operation was a write,
-         * flush the buffer.
-         */
-        if ((gsfFileTable[handle - 1].update_flag) &&
-            (gsfFileTable[handle - 1].read_write_flag == LAST_OP_WRITE))
-        {
-            if (fflush (gsfFileTable[handle - 1].fp))
-            {
-                gsfError = GSF_FLUSH_ERROR;
-                return(-1);
-            }
-        }
-        gsfFileTable[handle - 1].read_write_flag = LAST_OP_READ;
-
-        /* read the data size, and gsf ID fields */
-        readStat = fread((void *) tmpBuff, GSF_LONG_SIZE, (size_t) 2, gsfFileTable[handle - 1].fp);
-        if (readStat != 2)
-        {
-            if (feof(gsfFileTable[handle - 1].fp))
-            {
-                /* wkm 10-19-01: if error reading file and we're at the end of the file,
-                 *               reset file pointer
-                 */
-                fseek (gsfFileTable[handle - 1].fp,
-                       gsfFileTable[handle - 1].previous_record,
-                       SEEK_SET);
-                /* if anything was read, that's a different error code than nothing read */
-                if (readStat == 0)
-                    gsfError = GSF_READ_TO_END_OF_FILE;
-                else
-                    gsfError = GSF_PARTIAL_RECORD_AT_END_OF_FILE;
-                return (-1);
-            }
-            gsfError = GSF_READ_ERROR;
-            return (-1);
-        }
-
-        /* convert from gsf to host byte order, gsf byte order = network byte order */
-        dataSize = (gsfuLong) ntohl(tmpBuff[0]);
-        readSize = dataSize;
-        did = (gsfuLong) ntohl(tmpBuff[1]);
-
-        /* convert the did value into a gsfDataID struct
-         * First the check sum value
-         *
-         * 1098 7654 3210 9876 5432 1098 7654 3210
-         * 1000 0000 0000 0000 0000 0000 0000 0000
-         *    8  0    0    0    0    0    0    0
-         */
-        thisID.checksumFlag = (did & 0x80000000);
-
-        /* Now the reserved field
-         * 1098 7654 3210 9876 5432 1098 7654 3210
-         * 0111 1111 1100 0000 0000 0000 0000 0000
-         *    7  F    C    0    0    0    0    0
-         */
-        temp = did & 0x7FC00000;
-        thisID.reserved = (temp >> 22);
-
-        /* Now the combination of registry number and data type number
-         * 1098 7654 3210 9876 5432 1098 7654 3210
-         * 0000 0000 0011 1111 1111 1111 1111 1111
-         *    0  0    3    F    F    F    F    F
-         */
-        temp = did;
-        thisID.recordID = (temp & 0x003FFFFF);
-
-        /* if there is a checksum read it, we'll read four additional bytes */
-        if (thisID.checksumFlag)
-        {
-            readSize = dataSize + 4;
-            /* jsb 01-30-95
-             * dptr += 4;
-             */
-            dptr = streamBuff + 4;
-        }
-        else
-        {
-            dptr = streamBuff;
-        }
-
-/*         fprintf(stderr, "readize = %d  desi = %d\n", readSize, thisID.recordID); */
-
-
-       /* Make sure that we have a big enough buffer to fit this record,
-         *  then read it out.
-         */
-        if ((readSize <= 8) || (readSize > GSF_MAX_RECORD_SIZE))
-        {
-
-            /* wkm, may have an incomplete record here */
-            gsfError = GSF_RECORD_SIZE_ERROR;
-            return (-1);
-        }
-
-
-        /* No point in reading the "size" bytes for data if the ID is not recognized */
-        switch (thisID.recordID)
-        {
-            case (GSF_RECORD_HEADER):
-            case (GSF_RECORD_SWATH_BATHY_SUMMARY):
-            case (GSF_RECORD_SWATH_BATHYMETRY_PING):
-            case (GSF_RECORD_SOUND_VELOCITY_PROFILE):
-            case (GSF_RECORD_PROCESSING_PARAMETERS):
-            case (GSF_RECORD_SENSOR_PARAMETERS):
-            case (GSF_RECORD_COMMENT):
-            case (GSF_RECORD_HISTORY):
-            case (GSF_RECORD_NAVIGATION_ERROR):
-            case (GSF_RECORD_SINGLE_BEAM_PING):
-            case (GSF_RECORD_HV_NAVIGATION_ERROR):
-            case (GSF_RECORD_ATTITUDE):
-                break;
-
-            default:
-                gsfError = GSF_UNRECOGNIZED_RECORD_ID;
-                return (-1);
-        }
-
-        /* If the caller passed GSF_NEXT_RECORD, as the desiredRecord, they
-         * want the next record
-         */
-        if ((desiredRecord == GSF_NEXT_RECORD) || (thisID.recordID == desiredRecord))
-        {
-            readNext = 0;
-            /* Set the caller's ID structure with those items we've read */
-            dataID->checksumFlag = thisID.checksumFlag;
-            dataID->reserved = thisID.reserved;
-            dataID->recordID = thisID.recordID;
-
-            readStat = fread(streamBuff, (size_t) 1, readSize, gsfFileTable[handle - 1].fp);
-            if (readStat != readSize)
-            {
-                if (feof(gsfFileTable[handle - 1].fp))
-                {
-
-                    /* wkm 10-19-01: if error reading file and we're at the end of the file,
-                     *               reset file pointer
-                     */
-                    fseek (gsfFileTable[handle - 1].fp,
-                          gsfFileTable[handle - 1].previous_record,
-                          SEEK_SET);
-                    /* if anything was read, that's a different error code than nothing read */
-                    if (readStat == 0)
-                        gsfError = GSF_READ_TO_END_OF_FILE;
-                    else
-                        gsfError = GSF_PARTIAL_RECORD_AT_END_OF_FILE;
-                    return (-1);
-                }
-                gsfError = GSF_READ_ERROR;
-                return (-1);
-            }
-        }
-
-        /* This record is not the requested record, advance the file pointer */
-        else if (thisID.recordID != desiredRecord)
-        {
-            readStat = fseek(gsfFileTable[handle - 1].fp, readSize, SEEK_CUR);
-            if (readStat)
-            {
-                gsfError = GSF_FILE_SEEK_ERROR;
-                return (-1);
-            }
-        }
-    }
-
-    /*
-    * If the caller's buffer isn't null, move this data into their buffer.
-    *  Don't move the 4 byte checksum into the buffer.
-    */
-    if ((buf) && (dataSize <= max_size))
-    {
-        memcpy(buf, dptr, dataSize);
-    }
-    else if ((buf) && (dataSize > max_size))
-    {
-        gsfError = GSF_INSUFFICIENT_SIZE;
-        return (-1);
-    }
-
-    /* We have the record of interest, verify the checksum if required */
-    if (thisID.checksumFlag)
-    {
-        memcpy(&tmpBuff[0], streamBuff, GSF_LONG_SIZE);
-        ckSum = (gsfuLong) ntohl(tmpBuff[0]);
-        if (ckSum != (gsfChecksum(dptr, dataSize)))
-        {
-            gsfError = GSF_CHECKSUM_FAILURE;
-            return (-1);
-        }
-    }
-
-
-    /* Invoke the appropriate function for unpacking this record into a
-    * standard gsf structure.
-    */
-    switch (thisID.recordID)
-    {
-        case (GSF_RECORD_HEADER):
-            ret = gsfDecodeHeader(&rptr->header, dptr);
-            if (ret < 0)
-            {
-                gsfError = GSF_HEADER_RECORD_DECODE_FAILED;
-                return (-1);
-            }
-            break;
-
-        case (GSF_RECORD_SWATH_BATHY_SUMMARY):
-            ret = gsfDecodeSwathBathySummary(&rptr->summary, dptr);
-            if (ret < 0)
-            {
-                gsfError = GSF_SUMMARY_RECORD_DECODE_FAILED;
-                return (-1);
-            }
-            break;
-
-        case (GSF_RECORD_SWATH_BATHYMETRY_PING):
-            ret = gsfDecodeSwathBathymetryPing(&rptr->mb_ping, dptr, &gsfFileTable[handle - 1], handle, dataSize);
-            if (ret < 0)
-            {
-                /* gsfError is set within gsfDecodeSwathBathymetryPing */
-                return (-1);
-            }
-            break;
-
-        case (GSF_RECORD_SOUND_VELOCITY_PROFILE):
-            ret = gsfDecodeSoundVelocityProfile(&rptr->svp, &gsfFileTable[handle - 1], dptr);
-            if (ret < 0)
-            {
-                gsfError = GSF_SVP_RECORD_DECODE_FAILED;
-                return (-1);
-            }
-            break;
-
-        case (GSF_RECORD_PROCESSING_PARAMETERS):
-            ret = gsfDecodeProcessingParameters(&rptr->process_parameters, &gsfFileTable[handle - 1], dptr);
-            if (ret < 0)
-            {
-                gsfError = GSF_PROCESS_PARAM_RECORD_DECODE_FAILED;
-                return (-1);
-            }
-            break;
-
-        case (GSF_RECORD_SENSOR_PARAMETERS):
-            ret = gsfDecodeSensorParameters(&rptr->sensor_parameters, &gsfFileTable[handle - 1], dptr);
-            if (ret < 0)
-            {
-                gsfError = GSF_SENSOR_PARAM_RECORD_DECODE_FAILED;
-                return (-1);
-            }
-            break;
-
-        case (GSF_RECORD_COMMENT):
-            ret = gsfDecodeComment(&rptr->comment, &gsfFileTable[handle - 1], dptr);
-            if (ret < 0)
-            {
-                gsfError = GSF_COMMENT_RECORD_DECODE_FAILED;
-                return (-1);
-            }
-            break;
-
-        case (GSF_RECORD_HISTORY):
-            ret = gsfDecodeHistory(&rptr->history, &gsfFileTable[handle - 1], dptr);
-            if (ret < 0)
-            {
-                gsfError = GSF_HISTORY_RECORD_DECODE_FAILED;
-                return (-1);
-            }
-            break;
-
-        case (GSF_RECORD_NAVIGATION_ERROR):
-            ret = gsfDecodeNavigationError(&rptr->nav_error, dptr);
-            if (ret < 0)
-            {
-                gsfError = GSF_NAV_ERROR_RECORD_DECODE_FAILED;
-                return (-1);
-            }
-            break;
-
-        case (GSF_RECORD_SINGLE_BEAM_PING):
-            ret = gsfDecodeSinglebeam(&rptr->sb_ping, dptr, &gsfFileTable[handle - 1], handle, dataSize);
-            if (ret < 0)
-            {
-                /* gsfError is set within gsfDecodeSinglebeam */
-                return (-1);
-            }
-            break;
-
-        case (GSF_RECORD_HV_NAVIGATION_ERROR):
-            ret = gsfDecodeHVNavigationError(&rptr->hv_nav_error, &gsfFileTable[handle - 1], dptr);
-            if (ret < 0)
-            {
-                gsfError = GSF_HV_NAV_ERROR_RECORD_DECODE_FAILED;
-                return (-1);
-            }
-            break;
-
-        case (GSF_RECORD_ATTITUDE):
-            ret = gsfDecodeAttitude(&rptr->attitude, &gsfFileTable[handle - 1], dptr);
-            if (ret < 0)
-            {
-                gsfError = GSF_ATTITUDE_RECORD_DECODE_FAILED;
-                return (-1);
-            }
-            break;
-
-
-        default:
-            gsfError = GSF_UNRECOGNIZED_RECORD_ID;
-            return (-1);
-    }
-
-    return (readSize + GSF_FILL_SIZE);
-}
-
-/********************************************************************
- *
- * Function Name : gsfSeekRecord
- *
- * Description : This function moves the current gsf file position to the
- *    begining of the nth record of a specific type.  The record number and
- *    type of interest are specified by id.record_number and id.recordID.
- *    The byte offset into the file for the record of interest is retreaved
- *    from the index file created by a previous call to gsfOpen with one of
- *    the supported direct access modes specified.  This function is
- *    maintained as static to the library since the functions gsfRead
- *    and gsfWrite may be called directly to access a specific record.
- *
- * Inputs :
- *  handle = the handle for this file as returned by gsfOpen
- *  id = a pointer to a gsfDataID containing the record id information for
- *       the record of interest.
- *
- * Returns :
- *  This function returns zero if successful, or -1 if an error occured.
- *
- * Error Conditions :
- *  GSF_BAD_FILE_HANDLE
- *  GSF_UNRECOGNIZED_RECORD_ID
- *  GSF_INVALID_RECORD_NUMBER
- *  GSF_RECORD_TYPE_NOT_AVAILABLE
- *  GSF_FILE_SEEK_ERROR
- *  GSF_INDEX_FILE_READ_ERROR
- *
- *******************************************************************/
-
-static int
-gsfSeekRecord(int handle, gsfDataID *id)
-{
-    int             ret;
-    int             offset;
-    int             i;
-    int             scale_index;
-    long long       addr;
-    gsfRecords      scalesRecord;
-    INDEX_REC       index_rec;
-
-    /* Clear gsfError before each seek */
-    gsfError = 0;
-
-    /* JSB 04/05/00 replaced ">=" with ">" */
-    if ((handle < 1) || (handle > GSF_MAX_OPEN_FILES))
-    {
-        gsfError = GSF_BAD_FILE_HANDLE;
-        return (-1);
-    }
-
-    /* Make sure we have a valid recordID */
-    if ((id->recordID < 1) || (id->recordID >= NUM_REC_TYPES))
-    {
-        gsfError = GSF_UNRECOGNIZED_RECORD_ID;
-        return (-1);
-    }
-
-    /* Make sure we have a valid record_number */
-    if ((id->record_number < -1) ||
-        (id->record_number == 0) ||
-        (id->record_number > gsfFileTable[handle - 1].index_data.number_of_records[id->recordID]))
-    {
-        gsfError = GSF_INVALID_RECORD_NUMBER;
-        return (-1);
-    }
-
-    /* Check the record_types to see if the requested type is available */
-    if (gsfFileTable[handle - 1].index_data.record_type[id->recordID] == -1)
-    {
-        /* The record type is not available. */
-        gsfError = GSF_RECORD_TYPE_NOT_AVAILABLE;
-        return (-1);
-    }
-
-    /* If the record number requested is -1, use the last record of
-     * this type. Note that the record number counts from one.
-     */
-    if (id->record_number == -1)
-    {
-        offset = gsfFileTable[handle - 1].index_data.number_of_records[id->recordID] - 1;
-    }
-    else
-    {
-        offset = id->record_number - 1;
-    }
-
-    /* Compute the record address within the index file and read
-     * the index record.
-     */
-    addr = gsfFileTable[handle - 1].index_data.start_addr[id->recordID] +
-        (long long)(offset * sizeof(INDEX_REC));
-    if (fseek(gsfFileTable[handle - 1].index_data.fp, addr, 0))
-    {
-        gsfError = GSF_FILE_SEEK_ERROR;
-        return (-1);
-    }
-    ret = fread(&index_rec, sizeof(INDEX_REC), 1, gsfFileTable[handle - 1].index_data.fp);
-    if (ret != 1)
-    {
-        gsfError = GSF_INDEX_FILE_READ_ERROR;
-        return(-1);
-    }
-    if (gsfFileTable[handle - 1].index_data.swap)
-    {
-        SwapLongLong((long long *) &index_rec.addr, 1);
-    }
-
-    /* If the record type is GSF_RECORD_SWATH_BATHYMETRY_PING then we
-     * need to ensure that we have the ping record scale factors which
-     * apply to the ping record of interest.  The scale factor subrecord
-     * of the ping record will only be present in the file when the scale
-     * factors change.
-     */
-    if (id->recordID == GSF_RECORD_SWATH_BATHYMETRY_PING)
-    {
-        /* Clear the scale index */
-        scale_index = -1;
-        for (i = 1; i < gsfFileTable[handle - 1].index_data.number_of_records[0]; i++)
-        {
-            /* When the address of the record containing scale factors is
-             * greater than the address of the record of interest, get the
-             * address of the record containing scale factors which is one
-             * prior to this one.
-             */
-            if (gsfFileTable[handle - 1].index_data.scale_factor_addr[i].addr >
-                index_rec.addr)
-            {
-                scale_index = i - 1;
-                break;
-            }
-        }
-
-        /* If we didn't find a record containing scale factors with an address
-         * greater than the address of the record of interest, then use the
-         * last record in the file with scale factors.  Note that this
-         * condition is true if the file only contains one set of scale
-         * factors.
-         */
-        if (scale_index == -1)
-        {
-            scale_index = gsfFileTable[handle - 1].index_data.number_of_records[0] - 1;
-        }
-
-        /* We only need to go read the ping record with scale factors if we
-         * need to use a different set of scale factors than we did last time.
-         */
-        if (scale_index != gsfFileTable[handle - 1].index_data.last_scale_factor_index)
-        {
-            addr = gsfFileTable[handle - 1].index_data.scale_factor_addr[scale_index].addr;
-            if (fseek(gsfFileTable[handle - 1].fp, addr, 0))
-            {
-                gsfError = GSF_FILE_SEEK_ERROR;
-                return (-1);
-            }
-
-            memset(&scalesRecord, 0, sizeof(scalesRecord));
-            ret = gsfUnpackStream (handle, GSF_NEXT_RECORD, id, &scalesRecord, NULL, 0);
-            if (ret < 0)
-            {
-                /* gsfError will have been set in gsfUnpackStream */
-                return(-1);
-            }
-            memcpy(&gsfFileTable[handle - 1].rec, &scalesRecord, sizeof(gsfFileTable[handle - 1].rec));
-
-            /* We now have the scale factors we need, save this index for
-             * the comparison next time.
-             */
-            gsfFileTable[handle - 1].index_data.last_scale_factor_index = scale_index;
-        }
-    }
-
-    /* Seek to this offset in the gsf file */
-    if (fseek(gsfFileTable[handle - 1].fp, index_rec.addr, SEEK_SET))
-    {
-        gsfError = GSF_FILE_SEEK_ERROR;
-        return (-1);
-    }
-
-    return (0);
-}
-
-/********************************************************************
- *
- * Function Name : gsfWrite
- *
- * Description : gsfWrite encodes the data from internal to external form,
- *  and then writes the requested record into the file specified by handle,
- *  where handle is the value retured by gsfOpen.  The record is written to
- *  the current file pointer for handle.  An optional checksum may be computed
- *  and encoded with the data.
- *
- *  If the file is opened for sequential access (GSF_CREATE, or GSF_UPDATE)
- *  then the recordID field of the gsfDataID structure is used to specify
- *  the record to be written.  The record is written at the current location
- *  in the file.
- *
- *  If the file is opened for direct access (GSF_UPDATE_INDEX), then the
- *  combination of the recordID and the record_number fields of the gsfDataID
- *  structure are used to uniquely identify the record to be written.  The
- *  address of the record of interest is read from the index file and the file
- *  pointer is moved to this offset before the record is encoded and written
- *  to disk.
- *
- * Inputs :
- *  handle = the handle for this file as returned by gsfOpen
- *  id = a pointer to a gsfDataID containing the record id information for
- *       the record to write.
- *  rptr = a pointer to a gsfRecords structure from which to get the internal
- *         form of the record to be written to the file.
- *
- * Returns :
- *  This function returns the number of bytes written if successful, or
- *  -1 if an error occured.
- *
- * Error Conditions :
- *    GSF_BAD_FILE_HANDLE
- *    GSF_UNRECOGNIZED_RECORD_ID
- *    GSF_FILE_SEEK_ERROR
- *    GSF_WRITE_ERROR
- *    GSF_HEADER_RECORD_ENCODE_FAILED
- *    GSF_SVP_RECORD_ENCODE_FAILED
- *    GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED
- *    GSF_SENSOR_PARAM_RECORD_ENCODE_FAILED
- *    GSF_COMMENT_RECORD_ENCODE_FAILED
- *    GSF_HISTORY_RECORD_ENCODE_FAILED
- *    GSF_NAV_ERROR_RECORD_ENCODE_FAILED
- *    GSF_FLUSH_ERROR
- *    GSF_SINGLE_BEAM_ENCODE_FAILED
- *
- ********************************************************************/
-
-int
-gsfWrite(int handle, gsfDataID *id, gsfRecords *rptr)
-{
-    unsigned char  *ucptr;
-    gsfuLong        tmpBuff[3] =
-    {0, 0, 0};
-    gsfuLong        gsfBuff[3];
-    gsfuLong        temp;
-    gsfuLong        dataSize;
-    size_t          writeStat;
-    int             i;
-    int             pad;
-    long long       ret;
-
-    /* Clear gsfError before each write */
-    gsfError = 0;
-
-    /* JSB 04/05/00 replaced ">=" with ">" */
-    if ((handle < 1) || (handle > GSF_MAX_OPEN_FILES))
-    {
-        gsfError = GSF_BAD_FILE_HANDLE;
-        return (-1);
-    }
-
-    /* See if we need to make room for the optional checksum */
-    if (id->checksumFlag)
-    {
-        /* four byte size, four byte id, and four byte checksum */
-        ucptr = streamBuff + GSF_FILL_SIZE_CHECKSUM;
-    }
-    else
-    {
-        /* four byte size and four byte id */
-        ucptr = streamBuff + GSF_FILL_SIZE;
-    }
-
-    /* Invoke the appropriate function for packing this record into a
-    * byte stream.
-    */
-    switch (id->recordID)
-    {
-        case (GSF_RECORD_HEADER):
-            ret = gsfEncodeHeader(ucptr, &rptr->header);
-            if (ret < 0)
-            {
-                gsfError = GSF_HEADER_RECORD_ENCODE_FAILED;
-                return (-1);
-            }
-            break;
-
-        case (GSF_RECORD_SWATH_BATHY_SUMMARY):
-            ret = gsfEncodeSwathBathySummary(ucptr, &rptr->summary);
-            if (ret < 0)
-            {
-                gsfError = GSF_SUMMARY_RECORD_ENCODE_FAILED;
-                return (-1);
-            }
-            break;
-
-        case (GSF_RECORD_SWATH_BATHYMETRY_PING):
-            ret = gsfEncodeSwathBathymetryPing(ucptr, &rptr->mb_ping, &gsfFileTable[handle - 1], handle);
-            if (ret < 0)
-            {
-                /* gsfError is set within gsfEncodeSwathBathymetryPing */
-                return (-1);
-            }
-            break;
-
-        case (GSF_RECORD_SOUND_VELOCITY_PROFILE):
-            ret = gsfEncodeSoundVelocityProfile(ucptr, &rptr->svp);
-            if (ret < 0)
-            {
-                gsfError = GSF_SVP_RECORD_ENCODE_FAILED;
-                return (-1);
-            }
-            break;
-
-        case (GSF_RECORD_PROCESSING_PARAMETERS):
-            ret = gsfEncodeProcessingParameters(ucptr, &rptr->process_parameters);
-            if (ret < 0)
-            {
-                gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-                return (-1);
-            }
-            break;
-
-        case (GSF_RECORD_SENSOR_PARAMETERS):
-            ret = gsfEncodeSensorParameters(ucptr, &rptr->sensor_parameters);
-            if (ret < 0)
-            {
-                gsfError = GSF_SENSOR_PARAM_RECORD_ENCODE_FAILED;
-                return (-1);
-            }
-            break;
-
-        case (GSF_RECORD_COMMENT):
-            ret = gsfEncodeComment(ucptr, &rptr->comment);
-            if (ret < 0)
-            {
-                gsfError = GSF_COMMENT_RECORD_ENCODE_FAILED;
-                return (-1);
-            }
-            break;
-
-        case (GSF_RECORD_HISTORY):
-            ret = gsfEncodeHistory(ucptr, &rptr->history);
-            if (ret < 0)
-            {
-                gsfError = GSF_HISTORY_RECORD_ENCODE_FAILED;
-                return (-1);
-            }
-            break;
-
-        case (GSF_RECORD_NAVIGATION_ERROR):
-            ret = gsfEncodeNavigationError(ucptr, &rptr->nav_error);
-            if (ret < 0)
-            {
-                gsfError = GSF_NAV_ERROR_RECORD_ENCODE_FAILED;
-                return (-1);
-            }
-            break;
-
-        case (GSF_RECORD_SINGLE_BEAM_PING):
-            ret = gsfEncodeSinglebeam(ucptr, &rptr->sb_ping);
-            if (ret < 0)
-            {
-                gsfError = GSF_SINGLE_BEAM_ENCODE_FAILED;
-                return (-1);
-            }
-            break;
-
-        /* jsb 09/29/98 Added support for new navigation errors record */
-        case (GSF_RECORD_HV_NAVIGATION_ERROR):
-            ret = gsfEncodeHVNavigationError(ucptr, &rptr->hv_nav_error);
-            if (ret < 0)
-            {
-                gsfError = GSF_HV_NAV_ERROR_RECORD_ENCODE_FAILED;
-                return (-1);
-            }
-            break;
-
-        case (GSF_RECORD_ATTITUDE):
-            ret = gsfEncodeAttitude(ucptr, &rptr->attitude);
-            if (ret < 0)
-            {
-                gsfError = GSF_ATTITUDE_RECORD_ENCODE_FAILED;
-                return (-1);
-            }
-            break;
-
-        default:
-            gsfError = GSF_UNRECOGNIZED_RECORD_ID;
-            return (-1);
-    }
-
-    /* GSF specification requires all records to be a whole multiple of 4 bytes */
-    dataSize = (gsfuLong) ret;
-    pad = dataSize % 4;
-    if (pad)
-    {
-        /* jsb 04/18/97 A bug was fixed here in version 1.03, if this file was
-         * created with a version of gsf prior to 1.03 we need to support it the
-         * old way.
-         */
-        if ((gsfFileTable[handle - 1].major_version_number == 1) &&
-            (gsfFileTable[handle - 1].minor_version_number <= 2))
-        {
-            memset(ucptr + dataSize, 0, pad);
-            dataSize += pad;
-        }
-        else
-        {
-            memset(ucptr + dataSize, 0, (4 - pad));
-            dataSize += (4 - pad);
-        }
-    }
-
-    /* load the data identifier for this gsf record, first the checksum flag */
-    if (id->checksumFlag)
-    {
-        /* set the checksum bit */
-        tmpBuff[1] |= 0x80000000;
-
-        /* compute the checksum */
-        tmpBuff[2] = gsfChecksum(ucptr, dataSize);
-    }
-
-    /* now the reserved field */
-    temp = (gsfuLong) id->reserved;
-    tmpBuff[1] |= (temp << 22);
-
-    /* now the recordID, goes in bits 00-21 */
-    tmpBuff[1] |= (gsfuLong) id->recordID;
-
-    /* load the size of the data for this gsf record */
-    tmpBuff[0] = dataSize;
-
-    /* Now load the gsf packaging words into gsf byte order */
-    for (i = 0; i < 3; i++)
-    {
-        gsfBuff[i] = htonl(tmpBuff[i]);
-    }
-
-    /* Set the buffer pointer back to the first byte */
-    ucptr = streamBuff;
-
-    /* Add the gsf packaging words to the gsf stream */
-    if (id->checksumFlag)
-    {
-        memcpy(ucptr, gsfBuff, GSF_FILL_SIZE_CHECKSUM);
-        dataSize += GSF_FILL_SIZE_CHECKSUM;
-    }
-    else
-    {
-        memcpy(ucptr, gsfBuff, GSF_FILL_SIZE);
-        dataSize += GSF_FILL_SIZE;
-    }
-
-    /* Save the current record pointer */
-    if ((gsfFileTable[handle - 1].previous_record = ftell(gsfFileTable[handle - 1].fp)) == -1)
-    {
-        gsfError = GSF_FILE_SEEK_ERROR;
-        return (-1);
-    }
-
-    /*  If the file is open for update and the last operation was a read,
-     *  flush the buffer.
-     */
-    if ((gsfFileTable[handle - 1].update_flag) &&
-        (gsfFileTable[handle - 1].read_write_flag == LAST_OP_READ))
-    {
-        if (fflush (gsfFileTable[handle - 1].fp))
-        {
-            gsfError = GSF_FLUSH_ERROR;
-            return(-1);
-        }
-        gsfFileTable[handle - 1].bufferedBytes = 0;
-    }
-    gsfFileTable[handle - 1].read_write_flag = LAST_OP_WRITE;
-
-    /* Check to see if this record will fit into the current buffer, if not
-     * force a flush of the stream before writting. This is done to ensure
-     * that an output file will always contain whole gsf records.
-     */
-    gsfFileTable[handle-1].bufferedBytes += dataSize;
-    if (gsfFileTable[handle-1].bufferedBytes >= gsfFileTable[handle-1].buf_size)
-    {
-        if (fflush(gsfFileTable[handle-1].fp))
-        {
-            gsfError = GSF_FLUSH_ERROR;
-            return(-1);
-        }
-        gsfFileTable[handle-1].bufferedBytes = 0;
-    }
-
-    /* If this file is opened for direct access, then move the file pointer
-     * to the record which the caller wants to write.
-     */
-    if (gsfFileTable[handle - 1].direct_access)
-    {
-        ret = gsfSeekRecord(handle, id);
-        if (ret < 0)
-        {
-            /* gsfError is set in gsfSeekRecord */
-            return (-1);
-        }
-    }
-
-    /* Now write the data to the disk */
-    writeStat = fwrite(ucptr, (size_t) 1, (size_t) dataSize, gsfFileTable[handle - 1].fp);
-    if (writeStat != dataSize)
-    {
-        gsfError = GSF_WRITE_ERROR;
-        return (-1);
-    }
-
-    gsfFileTable[handle - 1].last_record_type = id->recordID;
-
-    /* return the number of bytes written */
-    return (dataSize);
-}
-
-/********************************************************************
- *
- * Function Name : gsfLoadScaleFactors
- *
- * Description : gsfLoadScaleFactors should be used to load the swath
- *  bathymetry ping record scale factor structure.  This function assures
- *  that the multiplier and offset fields of the scale factor structure
- *  have a precision equal to that which will be stored in the gsf data file.
- *  This function should be called once for each beam array data type
- *  contained in your data.
- *
- * Inputs :
- *  sf = a pointer to the gsfScaleFactors structure to be loaded
- *  subrecordID = the subrecord id for the beam array data
- *  c_flag = the compression flag for the beam array
- *  precision = the presision to which the beam array data are to be stored
- *              (a value of 0.1 would indicate decimeter precision for depth)
- *  offset = the "DC" offset to scale the data by.
- *
- * Returns :
- *  This function returns zero if successful, or -1 if an error occured.
- *
- * Error Conditions :
- *    GSF_TOO_MANY_ARRAY_SUBRECORDS
- *
- ********************************************************************/
-
-int
-gsfLoadScaleFactor(gsfScaleFactors *sf, unsigned int subrecordID, char c_flag, double precision, int offset)
-{
-    unsigned int    itemp;
-    double          mult;
-
-    /* If we're adding a new subrecord, bump counter and check bounds */
-    if (sf->scaleTable[subrecordID - 1].multiplier == 0.0)
-    {
-        if ((sf->numArraySubrecords + 1) > GSF_MAX_PING_ARRAY_SUBRECORDS)
-        {
-            sf->numArraySubrecords--;
-            gsfError = GSF_TOO_MANY_ARRAY_SUBRECORDS;
-            return (-1);
-        }
-
-        /* Compute the multiplier as one over the requested precision */
-        mult = 1.0 / precision;
-
-        /* In order to assure the same multiplier is used throughout, truncate
-         *  to an integer.  This is the value which is stored with the data.
-         *  The multiplier value is encoded on the byte stream as an integer value
-         *  (i.e. it is not scaled) so the smallest supportable precision is 1.
-         */
-        itemp = (int) (mult + 0.001);
-
-        /* QC test on the integer value as this is the number that will get encoded on the GSF byte stream */
-        if ((itemp < MIN_GSF_SF_MULT_VALUE) || (itemp > MAX_GSF_SF_MULT_VALUE))
-        {
-            gsfError = GSF_CANNOT_REPRESENT_PRECISION;
-            return (-1);
-        }
-
-        /* New scale factor has passed QC tests, it is now safe to bump the counter */
-        sf->numArraySubrecords++;
-    }
-    else
-    {
-        /* Compute the multiplier as one over the requested precision */
-        mult = 1.0 / precision;
-
-        /* In order to assure the same multiplier is used throughout, truncate
-         *  to an integer.  This is the value which is stored with the data.
-         *  The multiplier value is encoded on the byte stream as an integer value
-         *  (i.e. it is not scaled) so the smallest supportable precision is 1.
-         */
-        itemp = (int) (mult + 0.001);
-
-        /* QC test on the integer value as this is the number that will get encoded on the GSF byte stream */
-        if ((itemp < MIN_GSF_SF_MULT_VALUE) || (itemp > MAX_GSF_SF_MULT_VALUE))
-        {
-            gsfError = GSF_CANNOT_REPRESENT_PRECISION;
-            return (-1);
-        }
-    }
-
-    /* The multiplier to be applied to the data is converted back to a
-     *  double here, for floating point performance.
-     */
-    sf->scaleTable[subrecordID - 1].compressionFlag = c_flag;
-    sf->scaleTable[subrecordID - 1].multiplier = ((double) itemp);
-    sf->scaleTable[subrecordID - 1].offset = (double) offset;
-
-    return (0);
-}
-
-/********************************************************************
- *
- * Function Name : gsfGetScaleFactors
- *
- * Description : gsfGetScaleFactors may be used to obtain the multiplier
- *  and DC offset values by which each swath bathymetry ping array subrecord
- *  is be scaled. gsfGetScalesFactors must be called once for each array
- *  subrecord of interest.  At leat one swath bathymetry ping record
- *  must have been read from, or written to the file specified by handle.
- *
- * Inputs :
- *  handle = the integer value set by a call to gsfOpen.
- *  subrecordID = an integer value containing the subrecord id of the requested scale factors
- *  c_flag = the address of an unsigned character to contain the the compression flag
- *  multiplier = the address of a double to contain the scaling multiplier
- *  offset = the address of a double to contain the scaling DC offset.
- *
- * Returns :
- *  This function returns zero if successful, or -1 if an error occurred.
- *
- * Error Conditions :
- *    GSF_TOO_MANY_ARRAY_SUBRECORDS
- *    GSF_ILLEGAL_SCALE_FACTOR_MULTIPLIER
- *
- ********************************************************************/
-
-int
-gsfGetScaleFactor(int handle, unsigned int subrecordID, unsigned char *c_flag, double *multiplier, double *offset)
-{
-
-    if ((subrecordID < 1) || (subrecordID > GSF_MAX_PING_ARRAY_SUBRECORDS))
-    {
-        gsfError = GSF_TOO_MANY_ARRAY_SUBRECORDS;
-        return(-1);
-    }
-
-    /* JSB 04/05/00 replaced ">=" with ">" */
-    if ((handle < 1) || (handle > GSF_MAX_OPEN_FILES))
-    {
-        gsfError = GSF_BAD_FILE_HANDLE;
-        return (-1);
-    }
-
-    /* Make sure the multiplier is not zero */
-    if (gsfFileTable[handle-1].rec.mb_ping.scaleFactors.scaleTable[subrecordID-1].multiplier == 0.0)
-    {
-        gsfError = GSF_ILLEGAL_SCALE_FACTOR_MULTIPLIER;
-        return (-1);
-    }
-
-    /* Set the compression flag */
-    *c_flag = gsfFileTable[handle-1].rec.mb_ping.scaleFactors.scaleTable[subrecordID-1].compressionFlag;
-
-    /* Set the multiplier */
-    *multiplier = gsfFileTable[handle-1].rec.mb_ping.scaleFactors.scaleTable[subrecordID-1].multiplier;
-
-    /* Set the offset */
-    *offset = gsfFileTable[handle-1].rec.mb_ping.scaleFactors.scaleTable[subrecordID-1].offset;
-
-    return (0);
-}
-
-/********************************************************************
- *
- * Function Name : gsfFree
- *
- * Description : This function frees all dynamically allocated memory
- *    from a gsfRecords data structure, and it then clears all the
- *    data elements in the structure.
- *
- * Inputs :
- *    gsfRecords *rec = a pointer to ta gsfRecords data structure
- *
- * Returns : none
- *
- * Error Conditions : none
- *
- ********************************************************************/
-
-void
-gsfFree (gsfRecords *rec)
-{
-    int i;
-
-    /* Free the array subrecords in ping data structure */
-    if (rec->mb_ping.depth != (double *) NULL)
-    {
-        free (rec->mb_ping.depth);
-        rec->mb_ping.depth = (double *) NULL;
-    }
-
-    if (rec->mb_ping.nominal_depth != (double *) NULL)
-    {
-        free (rec->mb_ping.nominal_depth);
-        rec->mb_ping.nominal_depth = (double *) NULL;
-    }
-
-    if (rec->mb_ping.across_track != (double *) NULL)
-    {
-        free (rec->mb_ping.across_track);
-        rec->mb_ping.across_track = (double *) NULL;
-    }
-
-    if (rec->mb_ping.along_track != (double *) NULL)
-    {
-        free (rec->mb_ping.along_track);
-        rec->mb_ping.along_track = (double *) NULL;
-    }
-
-    if (rec->mb_ping.travel_time != (double *) NULL)
-    {
-        free (rec->mb_ping.travel_time);
-        rec->mb_ping.travel_time = (double *) NULL;
-    }
-
-    if (rec->mb_ping.beam_angle != (double *) NULL)
-    {
-        free (rec->mb_ping.beam_angle);
-        rec->mb_ping.beam_angle = (double *) NULL;
-    }
-
-    if (rec->mb_ping.mc_amplitude != (double *) NULL)
-    {
-        free (rec->mb_ping.mc_amplitude);
-        rec->mb_ping.mc_amplitude = (double *) NULL;
-    }
-
-    if (rec->mb_ping.mr_amplitude != (double *) NULL)
-    {
-        free (rec->mb_ping.mr_amplitude);
-        rec->mb_ping.mr_amplitude = (double *) NULL;
-    }
-
-    if (rec->mb_ping.echo_width != (double *) NULL)
-    {
-        free (rec->mb_ping.echo_width);
-        rec->mb_ping.echo_width = (double *) NULL;
-    }
-
-    if (rec->mb_ping.quality_factor != (double *) NULL)
-    {
-        free (rec->mb_ping.quality_factor);
-        rec->mb_ping.quality_factor = (double *) NULL;
-    }
-
-    if (rec->mb_ping.receive_heave != (double *) NULL)
-    {
-        free (rec->mb_ping.receive_heave);
-        rec->mb_ping.receive_heave = (double *) NULL;
-    }
-
-    if (rec->mb_ping.depth_error != (double *) NULL)
-    {
-        free (rec->mb_ping.depth_error);
-        rec->mb_ping.depth_error = (double *) NULL;
-    }
-
-    if (rec->mb_ping.across_track_error != (double *) NULL)
-    {
-        free (rec->mb_ping.across_track_error);
-        rec->mb_ping.across_track_error = (double *) NULL;
-    }
-
-    if (rec->mb_ping.along_track_error != (double *) NULL)
-    {
-        free (rec->mb_ping.along_track_error);
-        rec->mb_ping.along_track_error = (double *) NULL;
-    }
-
-    if (rec->mb_ping.quality_flags != (unsigned char *) NULL)
-    {
-        free (rec->mb_ping.quality_flags);
-        rec->mb_ping.quality_flags = (unsigned char *) NULL;
-    }
-
-    if (rec->mb_ping.beam_flags != (unsigned char *) NULL)
-    {
-        free (rec->mb_ping.beam_flags);
-        rec->mb_ping.beam_flags = (unsigned char *) NULL;
-    }
-
-    if (rec->mb_ping.signal_to_noise != (double *) NULL)
-    {
-        free (rec->mb_ping.signal_to_noise);
-        rec->mb_ping.signal_to_noise = (double *) NULL;
-    }
-
-    if (rec->mb_ping.beam_angle_forward != (double *) NULL)
-    {
-        free (rec->mb_ping.beam_angle_forward);
-        rec->mb_ping.beam_angle_forward = (double *) NULL;
-    }
-
-    if (rec->mb_ping.vertical_error != (double *) NULL)
-    {
-        free (rec->mb_ping.vertical_error);
-        rec->mb_ping.vertical_error = (double *) NULL;
-    }
-
-    if (rec->mb_ping.horizontal_error != (double *) NULL)
-    {
-        free (rec->mb_ping.horizontal_error);
-        rec->mb_ping.horizontal_error = (double *) NULL;
-    }
-
-    if (rec->mb_ping.sector_number != (unsigned short *) NULL)
-    {
-        free (rec->mb_ping.sector_number);
-        rec->mb_ping.sector_number = (unsigned short *) NULL;
-    }
-
-    if (rec->mb_ping.detection_info != (unsigned short *) NULL)
-    {
-        free (rec->mb_ping.detection_info);
-        rec->mb_ping.detection_info = (unsigned short *) NULL;
-    }
-
-    if (rec->mb_ping.incident_beam_adj != (double *) NULL)
-    {
-        free (rec->mb_ping.incident_beam_adj);
-        rec->mb_ping.incident_beam_adj = (double *) NULL;
-    }
-
-    if (rec->mb_ping.system_cleaning != (unsigned short *) NULL)
-    {
-        free (rec->mb_ping.system_cleaning);
-        rec->mb_ping.system_cleaning = (unsigned short *) NULL;
-    }
-
-    if (rec->mb_ping.doppler_corr != (double *) NULL)
-    {
-        free (rec->mb_ping.doppler_corr);
-        rec->mb_ping.doppler_corr = (double *) NULL;
-    }
-
-    /* we have an array of number_beams gsfIntensitySeries structures */
-    if (rec->mb_ping.brb_inten != (gsfBRBIntensity *) NULL)
-    {
-        if (rec->mb_ping.brb_inten->time_series != (gsfTimeSeriesIntensity *) NULL)
-        {
-            for (i = 0; i < rec->mb_ping.number_beams; i++)
-            {
-                if (rec->mb_ping.brb_inten->time_series[i].samples != (unsigned int *) NULL)
-                {
-                    free (rec->mb_ping.brb_inten->time_series[i].samples);
-                    rec->mb_ping.brb_inten->time_series[i].samples = NULL;
-                }
-            }
-            free (rec->mb_ping.brb_inten->time_series);
-            rec->mb_ping.brb_inten->time_series = NULL;
-        }
-        free (rec->mb_ping.brb_inten);
-        rec->mb_ping.brb_inten = (gsfBRBIntensity *) NULL;
-    }
-
-    /* Free the dynamically allocated memory from the svp record */
-    if (rec->svp.depth != (double *) NULL)
-    {
-        free (rec->svp.depth);
-        rec->svp.depth = (double *) NULL;
-    }
-
-    if (rec->svp.sound_speed != (double *) NULL)
-    {
-        free (rec->svp.sound_speed);
-        rec->svp.sound_speed = (double *) NULL;
-    }
-
-    /* Free the dynamically allocated memory from the processing parameters */
-    for (i=0; i<rec->process_parameters.number_parameters; i++)
-    {
-        if (rec->process_parameters.param[i] != (char *) NULL)
-        {
-            free (rec->process_parameters.param[i]);
-            rec->process_parameters.param[i] = (char *) NULL;
-        }
-    }
-    rec->process_parameters.number_parameters = 0;
-
-    /* Free the dynamically allocated memory from the sensor parameters */
-    for (i=0; i<rec->sensor_parameters.number_parameters; i++)
-    {
-        if (rec->sensor_parameters.param[i] != (char *) NULL)
-        {
-            free (rec->sensor_parameters.param[i]);
-            rec->sensor_parameters.param[i] = (char *) NULL;
-        }
-    }
-    rec->sensor_parameters.number_parameters = 0;
-
-    /* Free the dynamically allocated memory from the comment record */
-    if (rec->comment.comment != (char *) NULL)
-    {
-        free (rec->comment.comment);
-        rec->comment.comment = (char *) NULL;
-    }
-
-    /* Free the dynamically allocated memory from the history record */
-    if (rec->history.command_line != (char *) NULL)
-    {
-        free (rec->history.command_line);
-        rec->history.command_line = (char *) NULL;
-    }
-
-    if (rec->history.comment != (char *) NULL)
-    {
-        free (rec->history.comment);
-        rec->history.comment = (char *) NULL;
-    }
-
-    /* Free the dynamically allocated memory from the attitude record */
-    if (rec->attitude.attitude_time != (struct timespec *) NULL)
-    {
-        free (rec->attitude.attitude_time);
-        rec->attitude.attitude_time = (struct timespec *) NULL;
-    }
-
-    if (rec->attitude.pitch != (double *) NULL)
-    {
-        free (rec->attitude.pitch);
-        rec->attitude.pitch = (double *) NULL;
-    }
-
-    if (rec->attitude.roll != (double *) NULL)
-    {
-        free (rec->attitude.roll);
-        rec->attitude.roll = (double *) NULL;
-    }
-
-    if (rec->attitude.heave != (double *) NULL)
-    {
-        free (rec->attitude.heave);
-        rec->attitude.heave = (double *) NULL;
-    }
-
-    if (rec->attitude.heading != (double *) NULL)
-    {
-        free (rec->attitude.heading);
-        rec->attitude.heading = (double *) NULL;
-    }
-
-    /* Now clear all the data from the gsf Records structure */
-    memset (rec, 0, sizeof(gsfRecords));
-
-    return;
-}
-
-/********************************************************************
- *
- * Function Name : gsfPrintError
- *
- * Description : This function is used to print a short message describing
- *  the most recent error encountered.  This function need only be called if
- *  a -1 is returned from one of the gsf functions.
- *
- * Inputs :
- *  fp = a pointer to a FILE to which to write the message.
- *
- * Returns : none
- *
- * Error Conditions : none
- *
- ********************************************************************/
-
-void
-gsfPrintError(FILE * fp)
-{
-
-    fprintf(fp, "%s\n", gsfStringError());
-
-    return;
-}
-
-/********************************************************************
- *
- * Function Name : gsfError
- *
- * Description : This function is used to return the
- *  most recent error encountered.
- *  This function need only be called if
- *  a -1 is returned from one of the gsf functions.
- *
- * Inputs : none
- *
- * Returns : constant integer value representing the most recent error
- *
- * Error Conditions : none
- *
- ********************************************************************/
-
-int gsfIntError(void)
-{
-    return gsfError;
-}
-
-/********************************************************************
- *
- * Function Name : gsfStringError
- *
- * Description : This function is used to return a string with
- *  a short message describing the most recent error encountered.
- *  This function need only be called if
- *  a -1 is returned from one of the gsf functions.
- *
- * Inputs :
- *  error_string = a pointer to a character string.
- *
- * Returns : none
- *
- * Error Conditions : none
- *
- ********************************************************************/
-
-const char *
-gsfStringError(void)
-{
-    const char             *ptr;
-
-    switch (gsfError)
-    {
-        case GSF_FOPEN_ERROR:
-            ptr = "GSF Unable to open requested file";
-            break;
-
-        case GSF_UNRECOGNIZED_FILE:
-            ptr = "GSF Error unrecognized file";
-            break;
-
-        case GSF_BAD_ACCESS_MODE:
-            ptr = "GSF Error illegal access mode";
-            break;
-
-        case GSF_READ_ERROR:
-            ptr = "GSF Error reading input data";
-            break;
-
-        case GSF_WRITE_ERROR:
-            ptr = "GSF Error writing output data";
-            break;
-
-        case GSF_INSUFFICIENT_SIZE:
-            ptr = "GSF Error insufficient size specified";
-            break;
-
-        case GSF_RECORD_SIZE_ERROR:
-            ptr = "GSF Error record size is out of bounds";
-            break;
-
-        case GSF_CHECKSUM_FAILURE:
-            ptr = "GSF Error data checksum failure";
-            break;
-
-        case GSF_FILE_CLOSE_ERROR:
-            ptr = "GSF Error closing gsf file";
-            break;
-
-        case GSF_TOO_MANY_ARRAY_SUBRECORDS:
-            ptr = "GSF Error too many array subrecords";
-            break;
-
-        case GSF_TOO_MANY_OPEN_FILES:
-            ptr = "GSF Error too many open files";
-            break;
-
-        case GSF_MEMORY_ALLOCATION_FAILED:
-            ptr = "GSF Error memory allocation failure";
-            break;
-
-        case GSF_STREAM_DECODE_FAILURE:
-            ptr = "GSF Error stream decode failure";
-            break;
-
-        case GSF_UNRECOGNIZED_RECORD_ID:
-            ptr = "GSF Error unrecognized record id";
-            break;
-
-        case GSF_BAD_SEEK_OPTION:
-            ptr = "GSF Error unrecognized file seek option";
-            break;
-
-        case GSF_FILE_SEEK_ERROR:
-            ptr = "GSF Error file seek failed";
-            break;
-
-        case GSF_UNRECOGNIZED_SENSOR_ID:
-            ptr = "GSF Error unrecognized sensor specific subrecord id";
-            break;
-
-        case GSF_UNRECOGNIZED_DATA_RECORD:
-            ptr = "GSF Error unrecognized data record id";
-            break;
-
-        case GSF_UNRECOGNIZED_ARRAY_SUBRECORD_ID:
-            ptr = "GSF Error unrecognized array subrecord id";
-            break;
-
-        case GSF_UNRECOGNIZED_SUBRECORD_ID:
-            ptr = "GSF Error unrecognized subrecord id";
-            break;
-
-        case GSF_ILLEGAL_SCALE_FACTOR_MULTIPLIER:
-            ptr = "GSF Error illegal scale factor multiplier specified";
-            break;
-
-        case GSF_CANNOT_REPRESENT_PRECISION:
-            ptr = "GSF Error illegal scale factor multiplier specified";
-            break;
-
-        case GSF_BAD_FILE_HANDLE:
-            ptr = "GSF Error bad file handle";
-            break;
-
-        case GSF_HEADER_RECORD_DECODE_FAILED:
-            ptr = "GSF Error decoding header record";
-            break;
-
-        case GSF_MB_PING_RECORD_DECODE_FAILED:
-            ptr = "GSF Error decoding multibeam ping record";
-            break;
-
-        case GSF_SVP_RECORD_DECODE_FAILED:
-            ptr = "GSF Error decoding SVP record";
-            break;
-
-        case GSF_PROCESS_PARAM_RECORD_DECODE_FAILED:
-            ptr = "GSF Error decoding processing parameters record";
-            break;
-
-        case GSF_SENSOR_PARAM_RECORD_DECODE_FAILED:
-            ptr = "GSF Error decoding sensor parameters record";
-            break;
-
-        case GSF_COMMENT_RECORD_DECODE_FAILED:
-            ptr = "GSF Error decoding comment record";
-            break;
-
-        case GSF_HISTORY_RECORD_DECODE_FAILED:
-            ptr = "GSF Error decoding history record";
-            break;
-
-        case GSF_NAV_ERROR_RECORD_DECODE_FAILED:
-            ptr = "GSF Error decoding latitude/longitude navigation error record";
-            break;
-
-        case GSF_ATTITUDE_RECORD_DECODE_FAILED:
-            ptr = "GSF Error decoding attitude record";
-            break;
-
-        /* jsb 10/11/98; These macro names are too long to be unique, when compiled under HP-UX 10.20
-         *  This needs to be scheduled for resolution in a future release.
-        case (GSF_HEADER_RECORD_ENCODE_FAILED):
-            ptr = "GSF Error encoding header recrod";
-            break;
-
-        case GSF_MB_PING_RECORD_ENCODE_FAILED:
-            ptr = "GSF Error encoding multibeam ping record";
-            break;
-
-         case GSF_SVP_RECORD_ENCODE_FAILED:
-            ptr = "GSF Error encoding SVP record";
-            break;
-
-         case GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED:
-            ptr = "GSF Error encoding processing parameters record";
-            break;
-
-         case GSF_SENSOR_PARAM_RECORD_ENCODE_FAILED:
-            ptr = "GSF Error encoding sensor parameters record";
-            break;
-
-         case GSF_COMMENT_RECORD_ENCODE_FAILED:
-            ptr = "GSF Error encoding comment record";
-            break;
-
-         case GSF_HISTORY_RECORD_ENCODE_FAILED:
-            ptr = "GSF Error encoding history record";
-            break;
-
-         case GSF_NAV_ERROR_RECORD_ENCODE_FAILED:
-            ptr = "GSF Error encoding latitude/longitude navigation error record";
-            break;
-*/
-         case GSF_SETVBUF_ERROR:
-            ptr = "GSF Error setting internal file buffering";
-            break;
-
-         case GSF_FLUSH_ERROR:
-            ptr = "GSF Error flushing data buffer(s)";
-            break;
-
-         case GSF_FILE_TELL_ERROR:
-            ptr = "GSF Error file tell failed";
-            break;
-
-        case GSF_INDEX_FILE_OPEN_ERROR:
-            ptr = "GSF Error open of index file failed";
-            break;
-
-        case GSF_CORRUPT_INDEX_FILE_ERROR:
-            ptr = "GSF Error index file is corrupted, delete index file";
-            break;
-
-        case GSF_SCALE_INDEX_CALLOC_ERROR:
-            ptr = "GSF Error calloc of scale factor index memory failed";
-            break;
-
-        case GSF_RECORD_TYPE_NOT_AVAILABLE:
-            ptr = "GSF Error requested indexed record type not in gsf file";
-            break;
-
-        case GSF_SUMMARY_RECORD_DECODE_FAILED:
-            ptr = "GSF Error decoding summary record";
-            break;
-
-        case GSF_SUMMARY_RECORD_ENCODE_FAILED:
-            ptr = "GSF Error encoding summary record";
-            break;
-
-        case GSF_INVALID_NUM_BEAMS:
-            ptr = "GSF Error invalid number of beams";
-            break;
-
-        case GSF_INVALID_RECORD_NUMBER:
-            ptr = "GSF Error invalid record number";
-            break;
-
-        case GSF_INDEX_FILE_READ_ERROR:
-            ptr = "GSF Error index file read error";
-            break;
-
-        case GSF_PARAM_SIZE_FIXED:
-            ptr = "GSF Error unable to update existing file with increased record size";
-            break;
-
-        case GSF_HV_NAV_ERROR_RECORD_ENCODE_FAILED:
-            ptr = "GSF Error encoding horizontal/vertical navigation error record";
-            break;
-
-        case GSF_HV_NAV_ERROR_RECORD_DECODE_FAILED:
-            ptr = "GSF Error decoding horizontal/vertical navigation error record";
-            break;
-
-        case GSF_SINGLE_BEAM_ENCODE_FAILED:
-            ptr = "GSF Error single beam encode failure";
-            break;
-
-        case GSF_READ_TO_END_OF_FILE:
-            ptr = "GSF End of File Encountered";
-            break;
-
-        case GSF_OPEN_TEMP_FILE_FAILED:
-            ptr = "GSF Failed to open temporary file for index creation";
-            break;
-
-        case GSF_PARTIAL_RECORD_AT_END_OF_FILE:
-            ptr = "GSF corrupt/partial record at the end of the file";
-            break;
-
-        case GSF_QUALITY_FLAGS_DECODE_ERROR:
-            ptr = "GSF error decoding quality flags record";
-            break;
-
-        default:
-            ptr = "GSF unknown error";
-            break;
-    }
-
-    return (ptr);
-}
-
-/********************************************************************
- *
- * Function Name : gsfIndexTime
- *
- * Description : This function returns the time (Posix.4) associated with
- *  a specified record number and type.  It also returns the record number
- *  that was read.
- *
- * Inputs :
- *  handle = gsf file handle assigned by gsfOpen or gsfOpenBuffered
- *  record_type = record type to be retrieved
- *  record_number = record number to be retrieved (-1 will get the time
- *                  and record number of the last record of this type)
- *  sec = Posix.4 seconds
- *  nsec = Posix.4 nanoseconds
- *
- * Returns :
- *  This function returns the record number if successful, or -1 if an
- *  error occured.
- *
- * Error Conditions :
- *    GSF_RECORD_TYPE_NOT_AVAILABLE
- *
- ********************************************************************/
-
-int
-gsfIndexTime(int handle, int record_type, int record_number, time_t * sec, long *nsec)
-{
-    long long       addr;
-    int             offset;
-    INDEX_REC       index_rec;
-
-    if ((handle < 1) || (handle > GSF_MAX_OPEN_FILES))
-    {
-        gsfError = GSF_BAD_FILE_HANDLE;
-        return (-1);
-    }
-
-    /* Check the record_types to see if the requested type is available */
-    if (gsfFileTable[handle - 1].index_data.record_type[record_type] == -1)
-    {
-        gsfError = GSF_RECORD_TYPE_NOT_AVAILABLE;
-        return (-1);
-    }
-
-    /*  If the record number requested is -1, use the last record of
-     *  this type.
-     */
-    if (record_number == -1)
-    {
-        offset = gsfFileTable[handle - 1].index_data.number_of_records[record_type] - 1;
-    }
-    else
-    {
-        offset = record_number - 1;
-    }
-
-    /*  Compute the record address within the index file and read the
-     *  index record.
-     */
-    addr = gsfFileTable[handle - 1].index_data.start_addr[record_type] +
-        (offset * sizeof(INDEX_REC));
-    if (fseek(gsfFileTable[handle - 1].index_data.fp, addr, 0))
-    {
-        gsfError = GSF_FILE_SEEK_ERROR;
-        return (-1);
-    }
-    if (fread(&index_rec, sizeof(INDEX_REC), 1, gsfFileTable[handle - 1].index_data.fp) != 1)
-    {
-        gsfError = GSF_INDEX_FILE_READ_ERROR;
-        return (-1);
-    }
-    if (gsfFileTable[handle - 1].index_data.swap)
-    {
-        SwapLong((unsigned int *) &index_rec, 2);
-        SwapLongLong((long long *) &(index_rec.addr), 1);
-    }
-
-    /*  Store the time and return the record number.    */
-    *sec = index_rec.sec;
-    *nsec = index_rec.nsec;
-
-    return (offset+1);
-}
-
-/********************************************************************
- *
- * Function Name : gsfCheckSum
- *
- * Description :  This function computes and returns the modulo-32 form
- *                 byte-wise sum of the num_bytes starting at buff.
- *
- * Inputs :
- *  buff = a pointer to an unsigned char buffer containing the data
- *  num_bytes = a integer containing the number of bytes of data
- *
- * Returns : a gsfuLong (u_int) data type containing the computed checksum.
- *
- * Error Conditions :
- *
- ********************************************************************/
-
-static          gsfuLong
-gsfChecksum(unsigned char *buff, unsigned int num_bytes)
-{
-    unsigned char  *ptr;
-    gsfuLong        checkSum = 0;
-
-    /*
-    * Compute the checksum as the modulo-32 sum of all bytes
-    * between the checksum value and the end of the record.
-    */
-    for (ptr = buff; ptr < buff + num_bytes; ptr++)
-    {
-        checkSum += *ptr;
-    }
-    return checkSum;
-}
-
-/********************************************************************
- *
- * Function Name : gsfPercent
- *
- * Description : This function returns an integer value representing
- *  the location of the file pointer as a percentage of the total file
- *  size.  It may be used to obtain an indication of how far along a
- *  program is in reading a gsf data file.  The file size is obtained
- *  when the file is opened.
- *
- * Inputs :
- *  handle = gsf file handle assigned by gsfOpen or gsfOpenBuffered
- *
- * Returns :
- *  This function returns the current file position as a percentage of
- *  the file size, or -1 if an error occurred. gsfError will be set to
- *  indicate the error.
- *
- * Error Conditions :
- *  GSF_BAD_FILE_HANDLE
- *  GSF_FILE_TELL_ERROR
- *
- ********************************************************************/
-
-int
-gsfPercent (int handle)
-{
-    int             percent;
-    long long       addr, rc;
-
-    /* Clear gsfError each time down */
-    gsfError = 0;
-
-    /* JSB 04/05/00 replaced ">=" with ">" */
-    if ((handle < 1) || (handle > GSF_MAX_OPEN_FILES))
-    {
-        gsfError = GSF_BAD_FILE_HANDLE;
-        return (-1);
-    }
-
-    /* the file is no longer open */
-    if (!gsfFileTable[handle - 1].occupied)
-    {
-        gsfError = GSF_BAD_FILE_HANDLE;
-        return (-1);
-    }
-
-    /* Retreive the current file position */
-    rc = ftell (gsfFileTable[handle - 1].fp);
-    if (rc == -1)
-    {
-        gsfError = GSF_FILE_TELL_ERROR;
-        return (-1);
-    }
-    addr = rc;
-
-    percent = 0;
-    if (gsfFileTable[handle - 1].file_size > 0)
-    {
-        percent = 100.0 * (double)addr / (double)gsfFileTable[handle - 1].file_size;
-    }
-    return(percent);
-}
-
-/********************************************************************
- *
- * Function Name : gsfGetNumberRecods
- *
- * Description : This function will return the number of records of a
- *  given type to the caller. The number of records is retreived from
- *  the index file, so the file must have been opened for direct
- *  access (GSF_READONLY_INDEX, or GSF_UPDATE_INDEX).
- *
- * Inputs :
- *    handle = the handle to the file as provided by gsfOpen
- *    desiredRecord = the desired record or GSF_NEXT_RECORD
- *
- * Returns :
- *  This function returns the number of records of type desiredRecord
- *  contained in the GSF file designated by handle, or -1 if an error
- *  occured.
- *
- * Error Conditions :
- *  GSF_BAD_FILE_HANDLE
- *  GSF_BAD_ACCESS_MODE
- *
- ********************************************************************/
-
-int
-gsfGetNumberRecords (int handle, int desiredRecord)
-{
-    /* Clear gsfError each time down */
-    gsfError = 0;
-
-    /* JSB 04/05/00 replaced ">=" with ">" */
-    if ((handle < 1) || (handle > GSF_MAX_OPEN_FILES))
-    {
-        gsfError = GSF_BAD_FILE_HANDLE;
-        return (-1);
-    }
-
-    if ((desiredRecord < 0) || (desiredRecord > NUM_REC_TYPES))
-    {
-        gsfError = GSF_UNRECOGNIZED_RECORD_ID;
-        return (-1);
-    }
-
-    if (gsfFileTable[handle - 1].direct_access == 0)
-    {
-        gsfError = GSF_BAD_ACCESS_MODE;
-        return(-1);
-    }
-
-    return (gsfFileTable[handle - 1].index_data.number_of_records[desiredRecord]);
-}
-
-/********************************************************************
- *
- * Function Name : gsfCopyRecords
- *
- * Description : This function will copy all of the data contained in the
- *  source gsfRecords data structure to the target gsfRecords data
- *  structure. The target MUST be memset to zero before the first call to
- *  gsfCopyRecords.  This function allocates dynmanic memory which is NOT
- *  maintained by the library.  It is up to the calling application to
- *  release the memory allocated.  This may be done by maintaining the
- *  target data structure as static data, or by using gsfFree to release
- *  the memory.
- *
- * Inputs :
- *  target = a pointer to a gsfRecords data structure allocated by the
- *      calling application, into which the source data is to be copied.
- *  source = a pointer to a gsfRecords data structure allocated by the
- *      calling application, from which data is to be copied.
- *
- * Returns : This function returns zero if successful, or -1 if an error
- *  occurs.
- *
- * Error Conditions :
- *  GSF_MEMORY_ALLOCATION_FAILED
- *
- ********************************************************************/
-
-int
-gsfCopyRecords (gsfRecords *target, const gsfRecords *source)
-{
-    int             i;
-
-    gsfError = 0;
-
-    /* Copy the gsf header over to the  target */
-    memcpy(&target->header, &source->header, sizeof(target->header));
-
-    /* Copy the ping summary record over to the target */
-    memcpy(&target->summary, &source->summary, sizeof(target->summary));
-
-    /* Decide which arrays we need to allocate memory for */
-    if (source->mb_ping.depth != (double *) NULL)
-    {
-        if (target->mb_ping.depth == (double *) NULL)
-        {
-            target->mb_ping.depth = (double *) calloc (sizeof(double), source->mb_ping.number_beams);
-            if (target->mb_ping.depth == (double *) NULL)
-            {
-                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                return(-1);
-            }
-        }
-        else if (target->mb_ping.number_beams < source->mb_ping.number_beams)
-        {
-            target->mb_ping.depth = (double *) realloc (target->mb_ping.depth, sizeof(double) * source->mb_ping.number_beams);
-            if (target->mb_ping.depth == (double *) NULL)
-            {
-                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                return(-1);
-            }
-        }
-        memcpy (target->mb_ping.depth, source->mb_ping.depth, sizeof(double) * source->mb_ping.number_beams);
-    }
-
-    /* Decide which arrays we need to allocate memory for */
-    if (source->mb_ping.nominal_depth != (double *) NULL)
-    {
-        if (target->mb_ping.nominal_depth == (double *) NULL)
-        {
-            target->mb_ping.nominal_depth = (double *) calloc (sizeof(double), source->mb_ping.number_beams);
-            if (target->mb_ping.nominal_depth == (double *) NULL)
-            {
-                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                return(-1);
-            }
-        }
-        else if (target->mb_ping.number_beams < source->mb_ping.number_beams)
-        {
-            target->mb_ping.nominal_depth = (double *) realloc (target->mb_ping.nominal_depth, sizeof(double) * source->mb_ping.number_beams);
-            if (target->mb_ping.nominal_depth == (double *) NULL)
-            {
-                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                return(-1);
-            }
-        }
-        memcpy (target->mb_ping.nominal_depth, source->mb_ping.nominal_depth, sizeof(double) * source->mb_ping.number_beams);
-    }
-
-    if (source->mb_ping.across_track != (double *) NULL)
-    {
-        if (target->mb_ping.across_track == (double *) NULL)
-        {
-            target->mb_ping.across_track = (double *) calloc (sizeof(double), source->mb_ping.number_beams);
-            if (target->mb_ping.across_track == (double *) NULL)
-            {
-                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                return(-1);
-            }
-        }
-        else if (target->mb_ping.number_beams < source->mb_ping.number_beams)
-        {
-            target->mb_ping.across_track = (double *) realloc (target->mb_ping.across_track, sizeof(double) * source->mb_ping.number_beams);
-            if (target->mb_ping.across_track == (double *) NULL)
-            {
-                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                return(-1);
-            }
-        }
-        memcpy (target->mb_ping.across_track, source->mb_ping.across_track, sizeof(double) * source->mb_ping.number_beams);
-    }
-
-    if (source->mb_ping.along_track != (double *) NULL)
-    {
-        if (target->mb_ping.along_track == (double *) NULL)
-        {
-            target->mb_ping.along_track = (double *) calloc (sizeof(double), source->mb_ping.number_beams);
-            if (target->mb_ping.along_track == (double *) NULL)
-            {
-                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                return(-1);
-            }
-        }
-        else if (target->mb_ping.number_beams < source->mb_ping.number_beams)
-        {
-            target->mb_ping.along_track = (double *) realloc (target->mb_ping.along_track, sizeof(double) * source->mb_ping.number_beams);
-            if (target->mb_ping.along_track == (double *) NULL)
-            {
-                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                return(-1);
-            }
-        }
-        memcpy (target->mb_ping.along_track, source->mb_ping.along_track, sizeof(double) * source->mb_ping.number_beams);
-    }
-
-    if (source->mb_ping.travel_time != (double *) NULL)
-    {
-        if (target->mb_ping.travel_time == (double *) NULL)
-        {
-            target->mb_ping.travel_time = (double *) calloc (sizeof(double), source->mb_ping.number_beams);
-            if (target->mb_ping.travel_time == (double *) NULL)
-            {
-                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                return(-1);
-            }
-        }
-        else if (target->mb_ping.number_beams < source->mb_ping.number_beams)
-        {
-            target->mb_ping.travel_time = (double *) realloc (target->mb_ping.travel_time, sizeof(double) * source->mb_ping.number_beams);
-            if (target->mb_ping.travel_time == (double *) NULL)
-            {
-                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                return(-1);
-            }
-        }
-        memcpy (target->mb_ping.travel_time, source->mb_ping.travel_time, sizeof(double) * source->mb_ping.number_beams);
-    }
-
-    if (source->mb_ping.beam_angle != (double *) NULL)
-    {
-        if (target->mb_ping.beam_angle == (double *) NULL)
-        {
-            target->mb_ping.beam_angle = (double *) calloc (sizeof(double), source->mb_ping.number_beams);
-            if (target->mb_ping.beam_angle == (double *) NULL)
-            {
-                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                return(-1);
-            }
-        }
-        else if (target->mb_ping.number_beams < source->mb_ping.number_beams)
-        {
-            target->mb_ping.beam_angle = (double *) realloc (target->mb_ping.beam_angle, sizeof(double) * source->mb_ping.number_beams);
-            if (target->mb_ping.beam_angle == (double *) NULL)
-            {
-                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                return(-1);
-            }
-        }
-        memcpy (target->mb_ping.beam_angle, source->mb_ping.beam_angle, sizeof(double) * source->mb_ping.number_beams);
-    }
-
-    if (source->mb_ping.mc_amplitude != (double *) NULL)
-    {
-        if (target->mb_ping.mc_amplitude == (double *) NULL)
-        {
-            target->mb_ping.mc_amplitude = (double *) calloc (sizeof(double), source->mb_ping.number_beams);
-            if (target->mb_ping.mc_amplitude == (double *) NULL)
-            {
-                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                return(-1);
-            }
-        }
-        else if (target->mb_ping.number_beams < source->mb_ping.number_beams)
-        {
-            target->mb_ping.mc_amplitude = (double *) realloc (target->mb_ping.mc_amplitude, sizeof(double) * source->mb_ping.number_beams);
-            if (target->mb_ping.mc_amplitude == (double *) NULL)
-            {
-                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                return(-1);
-            }
-        }
-        memcpy (target->mb_ping.mc_amplitude, source->mb_ping.mc_amplitude, sizeof(double) * source->mb_ping.number_beams);
-    }
-
-    if (source->mb_ping.mr_amplitude != (double *) NULL)
-    {
-        if (target->mb_ping.mr_amplitude == (double *) NULL)
-        {
-            target->mb_ping.mr_amplitude = (double *) calloc (sizeof(double), source->mb_ping.number_beams);
-            if (target->mb_ping.mr_amplitude == (double *) NULL)
-            {
-                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                return(-1);
-            }
-        }
-        else if (target->mb_ping.number_beams < source->mb_ping.number_beams)
-        {
-            target->mb_ping.mr_amplitude = (double *) realloc (target->mb_ping.mr_amplitude, sizeof(double) * source->mb_ping.number_beams);
-            if (target->mb_ping.mr_amplitude == (double *) NULL)
-            {
-                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                return(-1);
-            }
-        }
-        memcpy (target->mb_ping.mr_amplitude, source->mb_ping.mr_amplitude, sizeof(double) * source->mb_ping.number_beams);
-    }
-
-    if (source->mb_ping.echo_width != (double *) NULL)
-    {
-        if (target->mb_ping.echo_width == (double *) NULL)
-        {
-            target->mb_ping.echo_width = (double *) calloc (sizeof(double), source->mb_ping.number_beams);
-            if (target->mb_ping.echo_width == (double *) NULL)
-            {
-                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                return(-1);
-            }
-        }
-        else if (target->mb_ping.number_beams < source->mb_ping.number_beams)
-        {
-            target->mb_ping.echo_width = (double *) realloc (target->mb_ping.echo_width, sizeof(double) * source->mb_ping.number_beams);
-            if (target->mb_ping.echo_width == (double *) NULL)
-            {
-                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                return(-1);
-            }
-        }
-        memcpy (target->mb_ping.echo_width, source->mb_ping.echo_width, sizeof(double) * source->mb_ping.number_beams);
-    }
-
-    if (source->mb_ping.quality_factor != (double *) NULL)
-    {
-        if (target->mb_ping.quality_factor == (double *) NULL)
-        {
-            target->mb_ping.quality_factor = (double *) calloc (sizeof(double), source->mb_ping.number_beams);
-            if (target->mb_ping.quality_factor == (double *) NULL)
-            {
-                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                return(-1);
-            }
-        }
-        else if (target->mb_ping.number_beams < source->mb_ping.number_beams)
-        {
-            target->mb_ping.quality_factor = (double *) realloc (target->mb_ping.quality_factor, sizeof(double) * source->mb_ping.number_beams);
-            if (target->mb_ping.quality_factor == (double *) NULL)
-            {
-                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                return(-1);
-            }
-        }
-        memcpy (target->mb_ping.quality_factor, source->mb_ping.quality_factor, sizeof(double) * source->mb_ping.number_beams);
-    }
-
-    if (source->mb_ping.receive_heave != (double *) NULL)
-    {
-        if (target->mb_ping.receive_heave == (double *) NULL)
-        {
-            target->mb_ping.receive_heave = (double *) calloc (sizeof(double), source->mb_ping.number_beams);
-            if (target->mb_ping.receive_heave == (double *) NULL)
-            {
-                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                return(-1);
-            }
-        }
-        else if (target->mb_ping.number_beams < source->mb_ping.number_beams)
-        {
-            target->mb_ping.receive_heave = (double *) realloc (target->mb_ping.receive_heave, sizeof(double) * source->mb_ping.number_beams);
-            if (target->mb_ping.receive_heave == (double *) NULL)
-            {
-                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                return(-1);
-            }
-        }
-        memcpy (target->mb_ping.receive_heave, source->mb_ping.receive_heave, sizeof(double) * source->mb_ping.number_beams);
-    }
-
-    if (source->mb_ping.depth_error != (double *) NULL)
-    {
-        if (target->mb_ping.depth_error == (double *) NULL)
-        {
-            target->mb_ping.depth_error = (double *) calloc (sizeof(double), source->mb_ping.number_beams);
-            if (target->mb_ping.depth_error == (double *) NULL)
-            {
-                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                return(-1);
-            }
-        }
-        else if (target->mb_ping.number_beams < source->mb_ping.number_beams)
-        {
-            target->mb_ping.depth_error = (double *) realloc (target->mb_ping.depth_error, sizeof(double) * source->mb_ping.number_beams);
-            if (target->mb_ping.depth_error == (double *) NULL)
-            {
-                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                return(-1);
-            }
-        }
-        memcpy (target->mb_ping.depth_error, source->mb_ping.depth_error, sizeof(double) * source->mb_ping.number_beams);
-    }
-
-    if (source->mb_ping.across_track_error != (double *) NULL)
-    {
-        if (target->mb_ping.across_track_error == (double *) NULL)
-        {
-            target->mb_ping.across_track_error = (double *) calloc (sizeof(double), source->mb_ping.number_beams);
-            if (target->mb_ping.across_track_error == (double *) NULL)
-            {
-                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                return(-1);
-            }
-        }
-        else if (target->mb_ping.number_beams < source->mb_ping.number_beams)
-        {
-            target->mb_ping.across_track_error = (double *) realloc (target->mb_ping.across_track_error, sizeof(double) * source->mb_ping.number_beams);
-            if (target->mb_ping.across_track_error == (double *) NULL)
-            {
-                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                return(-1);
-            }
-        }
-        memcpy (target->mb_ping.across_track_error, source->mb_ping.across_track_error, sizeof(double) * source->mb_ping.number_beams);
-    }
-
-    if (source->mb_ping.along_track_error != (double *) NULL)
-    {
-        if (target->mb_ping.along_track_error == (double *) NULL)
-        {
-            target->mb_ping.along_track_error = (double *) calloc (sizeof(double), source->mb_ping.number_beams);
-            if (target->mb_ping.along_track_error == (double *) NULL)
-            {
-                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                return(-1);
-            }
-        }
-        else if (target->mb_ping.number_beams < source->mb_ping.number_beams)
-        {
-            target->mb_ping.along_track_error = (double *) realloc (target->mb_ping.along_track_error, sizeof(double) * source->mb_ping.number_beams);
-            if (target->mb_ping.along_track_error == (double *) NULL)
-            {
-                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                return(-1);
-            }
-        }
-        memcpy (target->mb_ping.along_track_error, source->mb_ping.along_track_error, sizeof(double) * source->mb_ping.number_beams);
-    }
-
-    if (source->mb_ping.quality_flags != (unsigned char *) NULL)
-    {
-        if (target->mb_ping.quality_flags == (unsigned char *) NULL)
-        {
-            target->mb_ping.quality_flags = (unsigned char *) calloc (sizeof(unsigned char), source->mb_ping.number_beams);
-            if (target->mb_ping.quality_flags == (unsigned char *) NULL)
-            {
-                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                return(-1);
-            }
-        }
-        else if (target->mb_ping.number_beams < source->mb_ping.number_beams)
-        {
-            target->mb_ping.quality_flags = (unsigned char *) realloc (target->mb_ping.quality_flags, sizeof(unsigned char) * source->mb_ping.number_beams);
-            if (target->mb_ping.quality_flags == (unsigned char *) NULL)
-            {
-                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                return(-1);
-            }
-        }
-        memcpy (target->mb_ping.quality_flags, source->mb_ping.quality_flags, sizeof(unsigned char) * source->mb_ping.number_beams);
-    }
-
-    if (source->mb_ping.beam_flags != (unsigned char *) NULL)
-    {
-        if (target->mb_ping.beam_flags == (unsigned char *) NULL)
-        {
-            target->mb_ping.beam_flags = (unsigned char *) calloc (sizeof(unsigned char), source->mb_ping.number_beams);
-            if (target->mb_ping.beam_flags == (unsigned char *) NULL)
-            {
-                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                return(-1);
-            }
-        }
-        else if (target->mb_ping.number_beams < source->mb_ping.number_beams)
-        {
-            target->mb_ping.beam_flags = (unsigned char *) realloc (target->mb_ping.beam_flags, sizeof(unsigned char) * source->mb_ping.number_beams);
-            if (target->mb_ping.beam_flags == (unsigned char *) NULL)
-            {
-                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                return(-1);
-            }
-        }
-        memcpy (target->mb_ping.beam_flags, source->mb_ping.beam_flags, sizeof(unsigned char) * source->mb_ping.number_beams);
-    }
-
-    if (source->mb_ping.signal_to_noise != (double *) NULL)
-    {
-        if (target->mb_ping.signal_to_noise == (double *) NULL)
-        {
-            target->mb_ping.signal_to_noise = (double *) calloc (sizeof(double), source->mb_ping.number_beams);
-            if (target->mb_ping.signal_to_noise == (double *) NULL)
-            {
-                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                return(-1);
-            }
-        }
-        else if (target->mb_ping.number_beams < source->mb_ping.number_beams)
-        {
-            target->mb_ping.signal_to_noise = (double *) realloc (target->mb_ping.signal_to_noise, sizeof(double) * source->mb_ping.number_beams);
-            if (target->mb_ping.signal_to_noise == (double *) NULL)
-            {
-                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                return(-1);
-            }
-        }
-        memcpy (target->mb_ping.signal_to_noise, source->mb_ping.signal_to_noise, sizeof(double) * source->mb_ping.number_beams);
-    }
-
-    if (source->mb_ping.beam_angle_forward != (double *) NULL)
-    {
-        if (target->mb_ping.beam_angle_forward == (double *) NULL)
-        {
-            target->mb_ping.beam_angle_forward = (double *) calloc (sizeof(double), source->mb_ping.number_beams);
-            if (target->mb_ping.beam_angle_forward == (double *) NULL)
-            {
-                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                return(-1);
-            }
-        }
-        else if (target->mb_ping.number_beams < source->mb_ping.number_beams)
-        {
-            target->mb_ping.beam_angle_forward = (double *) realloc (target->mb_ping.beam_angle_forward, sizeof(double) * source->mb_ping.number_beams);
-            if (target->mb_ping.beam_angle_forward == (double *) NULL)
-            {
-                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                return(-1);
-            }
-        }
-        memcpy (target->mb_ping.beam_angle_forward, source->mb_ping.beam_angle_forward, sizeof(double) * source->mb_ping.number_beams);
-    }
-
-    if (source->mb_ping.vertical_error != (double *) NULL)
-    {
-        if (target->mb_ping.vertical_error == (double *) NULL)
-        {
-            target->mb_ping.vertical_error = (double *) calloc (sizeof(double), source->mb_ping.number_beams);
-            if (target->mb_ping.vertical_error == (double *) NULL)
-            {
-                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                return(-1);
-            }
-        }
-        else if (target->mb_ping.number_beams < source->mb_ping.number_beams)
-        {
-            target->mb_ping.vertical_error = (double *) realloc (target->mb_ping.vertical_error, sizeof(double) * source->mb_ping.number_beams);
-            if (target->mb_ping.vertical_error == (double *) NULL)
-            {
-                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                return(-1);
-            }
-        }
-        memcpy (target->mb_ping.vertical_error, source->mb_ping.vertical_error, sizeof(double) * source->mb_ping.number_beams);
-    }
-
-    if (source->mb_ping.horizontal_error != (double *) NULL)
-    {
-        if (target->mb_ping.horizontal_error == (double *) NULL)
-        {
-            target->mb_ping.horizontal_error = (double *) calloc (sizeof(double), source->mb_ping.number_beams);
-            if (target->mb_ping.horizontal_error == (double *) NULL)
-            {
-                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                return(-1);
-            }
-        }
-        else if (target->mb_ping.number_beams < source->mb_ping.number_beams)
-        {
-            target->mb_ping.horizontal_error = (double *) realloc (target->mb_ping.horizontal_error, sizeof(double) * source->mb_ping.number_beams);
-            if (target->mb_ping.horizontal_error == (double *) NULL)
-            {
-                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                return(-1);
-            }
-        }
-        memcpy (target->mb_ping.horizontal_error, source->mb_ping.horizontal_error, sizeof(double) * source->mb_ping.number_beams);
-    }
-
-    if (source->mb_ping.sector_number != (unsigned short *) NULL)
-    {
-        if (target->mb_ping.sector_number == (unsigned short *) NULL)
-        {
-            target->mb_ping.sector_number = (unsigned short *) calloc (sizeof(unsigned short), source->mb_ping.number_beams);
-            if (target->mb_ping.sector_number == (unsigned short *) NULL)
-            {
-                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                return(-1);
-            }
-        }
-        else if (target->mb_ping.number_beams < source->mb_ping.number_beams)
-        {
-            target->mb_ping.sector_number = (unsigned short *) realloc (target->mb_ping.sector_number, sizeof(unsigned short) * source->mb_ping.number_beams);
-            if (target->mb_ping.sector_number == (unsigned short *) NULL)
-            {
-                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                return(-1);
-            }
-        }
-        memcpy (target->mb_ping.sector_number, source->mb_ping.sector_number, sizeof(unsigned short) * source->mb_ping.number_beams);
-    }
-
-    if (source->mb_ping.detection_info != (unsigned short *) NULL)
-    {
-        if (target->mb_ping.detection_info == (unsigned short *) NULL)
-        {
-            target->mb_ping.detection_info = (unsigned short *) calloc (sizeof(unsigned short), source->mb_ping.number_beams);
-            if (target->mb_ping.detection_info == (unsigned short *) NULL)
-            {
-                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                return(-1);
-            }
-        }
-        else if (target->mb_ping.number_beams < source->mb_ping.number_beams)
-        {
-            target->mb_ping.detection_info = (unsigned short *) realloc (target->mb_ping.detection_info, sizeof(unsigned short) * source->mb_ping.number_beams);
-            if (target->mb_ping.detection_info == (unsigned short *) NULL)
-            {
-                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                return(-1);
-            }
-        }
-        memcpy (target->mb_ping.detection_info, source->mb_ping.detection_info, sizeof(unsigned short) * source->mb_ping.number_beams);
-    }
-
-    if (source->mb_ping.incident_beam_adj != (double *) NULL)
-    {
-        if (target->mb_ping.incident_beam_adj == (double *) NULL)
-        {
-            target->mb_ping.incident_beam_adj = (double *) calloc (sizeof(double), source->mb_ping.number_beams);
-            if (target->mb_ping.incident_beam_adj == (double *) NULL)
-            {
-                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                return(-1);
-            }
-        }
-        else if (target->mb_ping.number_beams < source->mb_ping.number_beams)
-        {
-            target->mb_ping.incident_beam_adj = (double *) realloc (target->mb_ping.incident_beam_adj, sizeof(double) * source->mb_ping.number_beams);
-            if (target->mb_ping.incident_beam_adj == (double *) NULL)
-            {
-                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                return(-1);
-            }
-        }
-        memcpy (target->mb_ping.incident_beam_adj, source->mb_ping.incident_beam_adj, sizeof(double) * source->mb_ping.number_beams);
-    }
-
-    if (source->mb_ping.system_cleaning != (unsigned short *) NULL)
-    {
-        if (target->mb_ping.system_cleaning == (unsigned short *) NULL)
-        {
-            target->mb_ping.system_cleaning = (unsigned short *) calloc (sizeof(unsigned short), source->mb_ping.number_beams);
-            if (target->mb_ping.system_cleaning == (unsigned short *) NULL)
-            {
-                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                return(-1);
-            }
-        }
-        else if (target->mb_ping.number_beams < source->mb_ping.number_beams)
-        {
-            target->mb_ping.system_cleaning = (unsigned short *) realloc (target->mb_ping.system_cleaning, sizeof(unsigned short) * source->mb_ping.number_beams);
-            if (target->mb_ping.system_cleaning == (unsigned short *) NULL)
-            {
-                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                return(-1);
-            }
-        }
-        memcpy (target->mb_ping.system_cleaning, source->mb_ping.system_cleaning, sizeof(unsigned short) * source->mb_ping.number_beams);
-    }
-
-    if (source->mb_ping.doppler_corr != (double *) NULL)
-    {
-        if (target->mb_ping.doppler_corr == (double *) NULL)
-        {
-            target->mb_ping.doppler_corr = (double *) calloc (sizeof(double), source->mb_ping.number_beams);
-            if (target->mb_ping.doppler_corr == (double *) NULL)
-            {
-                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                return(-1);
-            }
-        }
-        else if (target->mb_ping.number_beams < source->mb_ping.number_beams)
-        {
-            target->mb_ping.doppler_corr = (double *) realloc (target->mb_ping.doppler_corr, sizeof(double) * source->mb_ping.number_beams);
-            if (target->mb_ping.doppler_corr == (double *) NULL)
-            {
-                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                return(-1);
-            }
-        }
-        memcpy (target->mb_ping.doppler_corr, source->mb_ping.doppler_corr, sizeof(double) * source->mb_ping.number_beams);
-    }
-
-    if (source->mb_ping.brb_inten != (gsfBRBIntensity *) NULL)
-    {
-        if (target->mb_ping.brb_inten == (gsfBRBIntensity *) NULL)
-        {
-            target->mb_ping.brb_inten = (gsfBRBIntensity *) calloc (sizeof(gsfBRBIntensity), 1);
-            if (target->mb_ping.brb_inten == (gsfBRBIntensity *) NULL)
-            {
-                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                return(-1);
-            }
-        }
-
-        target->mb_ping.brb_inten->bits_per_sample     = source->mb_ping.brb_inten->bits_per_sample;
-        target->mb_ping.brb_inten->applied_corrections = source->mb_ping.brb_inten->applied_corrections;
-        target->mb_ping.brb_inten->sensor_imagery      = source->mb_ping.brb_inten->sensor_imagery;
-        memcpy (&target->mb_ping.brb_inten->spare, &source->mb_ping.brb_inten->spare, 16);
-
-        if (source->mb_ping.brb_inten->time_series != (gsfTimeSeriesIntensity *) NULL)
-        {
-            if (target->mb_ping.brb_inten->time_series == (gsfTimeSeriesIntensity *) NULL)
-            {
-                target->mb_ping.brb_inten->time_series = (gsfTimeSeriesIntensity *) calloc (sizeof(gsfTimeSeriesIntensity), source->mb_ping.number_beams);
-                if (target->mb_ping.brb_inten->time_series == (gsfTimeSeriesIntensity *) NULL)
-                {
-                    gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                    return(-1);
-                }
-            }
-            else if (target->mb_ping.number_beams < source->mb_ping.number_beams)
-            {
-                target->mb_ping.brb_inten->time_series = (gsfTimeSeriesIntensity *) realloc (target->mb_ping.brb_inten->time_series, sizeof(gsfTimeSeriesIntensity) * source->mb_ping.number_beams);
-                if (target->mb_ping.brb_inten->time_series == (gsfTimeSeriesIntensity *) NULL)
-                {
-                    gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                    return(-1);
-                }
-            }
-
-            for (i = 0; i < source->mb_ping.number_beams; i++)
-            {
-                if (source->mb_ping.brb_inten->time_series[i].samples != (unsigned int *) NULL)
-                {
-                    if (target->mb_ping.brb_inten->time_series[i].samples == (unsigned int *) NULL)
-                    {
-                        target->mb_ping.brb_inten->time_series[i].samples = (unsigned int *) calloc (sizeof(unsigned int), source->mb_ping.brb_inten->time_series[i].sample_count);
-                        if (target->mb_ping.brb_inten->time_series[i].samples == (unsigned int *) NULL)
-                        {
-                            gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                            return(-1);
-                        }
-                    }
-                    else if (target->mb_ping.brb_inten->time_series[i].sample_count < source->mb_ping.brb_inten->time_series[i].sample_count)
-                    {
-                        target->mb_ping.brb_inten->time_series[i].samples = (unsigned int *) realloc (target->mb_ping.brb_inten->time_series[i].samples, sizeof(unsigned int) * source->mb_ping.brb_inten->time_series[i].sample_count);
-                        if (target->mb_ping.brb_inten->time_series[i].samples == (unsigned int *) NULL)
-                        {
-                            gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                            return(-1);
-                        }
-                    }
-                    memcpy (target->mb_ping.brb_inten->time_series[i].samples, source->mb_ping.brb_inten->time_series[i].samples, sizeof(unsigned int) * source->mb_ping.brb_inten->time_series[i].sample_count);
-                    target->mb_ping.brb_inten->time_series[i].sample_count = source->mb_ping.brb_inten->time_series[i].sample_count;
-                    target->mb_ping.brb_inten->time_series[i].detect_sample = source->mb_ping.brb_inten->time_series[i].detect_sample;
-                }
-            }
-        }
-    }
-
-    /* Copy the swath bathymetry ping record over to the target by moving
-     * the data over one item at a time so we don't overwrite the arrays.
-     */
-    target->mb_ping.ping_time           = source->mb_ping.ping_time;
-    target->mb_ping.latitude            = source->mb_ping.latitude;
-    target->mb_ping.longitude           = source->mb_ping.longitude;
-    target->mb_ping.number_beams        = source->mb_ping.number_beams;
-    target->mb_ping.center_beam         = source->mb_ping.center_beam;
-    target->mb_ping.ping_flags          = source->mb_ping.ping_flags;
-    target->mb_ping.reserved            = source->mb_ping.reserved;
-    target->mb_ping.tide_corrector      = source->mb_ping.tide_corrector;
-    target->mb_ping.gps_tide_corrector  = source->mb_ping.gps_tide_corrector;
-    target->mb_ping.depth_corrector     = source->mb_ping.depth_corrector;
-    target->mb_ping.heading             = source->mb_ping.heading;
-    target->mb_ping.pitch               = source->mb_ping.pitch;
-    target->mb_ping.roll                = source->mb_ping.roll;
-    target->mb_ping.heave               = source->mb_ping.heave;
-    target->mb_ping.course              = source->mb_ping.course;
-    target->mb_ping.speed               = source->mb_ping.speed;
-    target->mb_ping.height              = source->mb_ping.height;
-    target->mb_ping.sep                 = source->mb_ping.sep;
-    target->mb_ping.scaleFactors        = source->mb_ping.scaleFactors;
-    target->mb_ping.sensor_id           = source->mb_ping.sensor_id;
-    target->mb_ping.sensor_data         = source->mb_ping.sensor_data;
-
-    /* Now hande the sound velocity profile dynamic memory */
-    if (target->svp.depth == (double *) NULL)
-    {
-        target->svp.depth = (double *) calloc (sizeof(double), source->svp.number_points);
-        if (target->svp.depth == (double *) NULL)
-        {
-            gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-            return(-1);
-        }
-        memcpy (target->svp.depth, source->svp.depth, sizeof(double) * source->svp.number_points);
-    }
-    else if (target->svp.number_points < source->svp.number_points)
-    {
-        target->svp.depth = (double *) realloc (target->svp.depth, sizeof(double) * source->svp.number_points);
-        if (target->svp.depth == (double *) NULL)
-        {
-            gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-            return(-1);
-        }
-        memcpy (target->svp.depth, source->svp.depth, sizeof(double) * source->svp.number_points);
-    }
-
-    if (target->svp.sound_speed == (double *) NULL)
-    {
-        target->svp.sound_speed = (double *) calloc (sizeof(double), source->svp.number_points);
-        if (target->svp.sound_speed == (double *) NULL)
-        {
-            gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-            return(-1);
-        }
-        memcpy (target->svp.sound_speed, source->svp.sound_speed, sizeof(double) * source->svp.number_points);
-    }
-    else if (target->svp.number_points < source->svp.number_points)
-    {
-        target->svp.sound_speed = (double *) realloc (target->svp.sound_speed, sizeof(double) * source->svp.number_points);
-        if (target->svp.sound_speed == (double *) NULL)
-        {
-            gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-            return(-1);
-        }
-        memcpy (target->svp.sound_speed, source->svp.sound_speed, sizeof(double) * source->svp.number_points);
-    }
-
-    /* Copy the sound velocity profile record from the source to the target */
-    target->svp.observation_time = source->svp.observation_time;
-    target->svp.application_time = source->svp.application_time;
-    target->svp.latitude         = source->svp.latitude;
-    target->svp.longitude        = source->svp.longitude;
-    target->svp.number_points    = source->svp.number_points;
-
-    /* Copy the processing parameters from the source to the target */
-    target->process_parameters.param_time        = source->process_parameters.param_time;
-    target->process_parameters.number_parameters = source->process_parameters.number_parameters;
-    for (i=0; i<source->process_parameters.number_parameters; i++)
-    {
-        if (target->process_parameters.param[i] == (char *) NULL)
-        {
-            target->process_parameters.param[i] = (char *) calloc (sizeof(char), source->process_parameters.param_size[i] + 1);
-            if (target->process_parameters.param[i] == (char *) NULL)
-            {
-                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                return(-1);
-            }
-            strncpy (target->process_parameters.param[i], source->process_parameters.param[i], source->process_parameters.param_size[i] + 1);
-            target->process_parameters.param_size[i] = source->process_parameters.param_size[i];
-        }
-        else if (target->process_parameters.param_size[i] < source->process_parameters.param_size[i])
-        {
-            target->process_parameters.param[i] = (char *) realloc (target->process_parameters.param[i], source->process_parameters.param_size[i] + 1);
-            if (target->process_parameters.param[i] == (char *) NULL)
-            {
-                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                return(-1);
-            }
-            strncpy (target->process_parameters.param[i], source->process_parameters.param[i], source->process_parameters.param_size[i] + 1);
-            target->process_parameters.param_size[i] = source->process_parameters.param_size[i];
-        }
-    }
-
-    /* Copy the sensor parameters from the source to the target */
-    target->sensor_parameters.param_time        = source->sensor_parameters.param_time;
-    target->sensor_parameters.number_parameters = source->sensor_parameters.number_parameters;
-    for (i=0; i<source->sensor_parameters.number_parameters; i++)
-    {
-        if (target->sensor_parameters.param[i] == (char *) NULL)
-        {
-            target->sensor_parameters.param[i] = (char *) calloc (sizeof(char), source->sensor_parameters.param_size[i] + 1);
-            if (target->sensor_parameters.param[i] == (char *) NULL)
-            {
-                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                return(-1);
-            }
-            strncpy (target->sensor_parameters.param[i], source->sensor_parameters.param[i], source->sensor_parameters.param_size[i] + 1);
-            target->sensor_parameters.param_size[i] = source->sensor_parameters.param_size[i];
-        }
-        else if (target->sensor_parameters.param_size[i] < source->sensor_parameters.param_size[i])
-        {
-            target->sensor_parameters.param[i] = (char *) realloc (target->sensor_parameters.param[i], source->sensor_parameters.param_size[i] + 1);
-            if (target->sensor_parameters.param[i] == (char *) NULL)
-            {
-                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                return(-1);
-            }
-            strncpy (target->sensor_parameters.param[i], source->sensor_parameters.param[i], source->sensor_parameters.param_size[i] + 1);
-            target->sensor_parameters.param_size[i] = source->sensor_parameters.param_size[i];
-        }
-    }
-
-    /* Copy the comment from the source to the target */
-    target->comment.comment_time = source->comment.comment_time;
-    target->comment.comment_length = source->comment.comment_length;
-    if (source->comment.comment_length > 0)
-    {
-        if (target->comment.comment == (char *) NULL)
-        {
-            target->comment.comment = (char *) calloc (sizeof(char), source->comment.comment_length + 1);
-            if (target->comment.comment == (char *) NULL)
-            {
-                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                return(-1);
-            }
-            strncpy (target->comment.comment, source->comment.comment, source->comment.comment_length + 1);
-            target->comment.comment_length = source->comment.comment_length;
-        }
-        else if (target->comment.comment_length < source->comment.comment_length)
-        {
-            target->comment.comment = (char *) realloc (target->comment.comment, source->comment.comment_length + 1);
-            if (target->comment.comment == (char *) NULL)
-            {
-                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                return(-1);
-            }
-            strncpy (target->comment.comment, source->comment.comment, source->comment.comment_length + 1);
-            target->comment.comment_length = source->comment.comment_length;
-        }
-    }
-
-    /* Copy the history record from the source to the target */
-    target->history.history_time = source->history.history_time;
-    strncpy(target->history.host_name, source->history.host_name, GSF_HOST_NAME_LENGTH);
-    strncpy(target->history.operator_name, source->history.operator_name, GSF_OPERATOR_LENGTH);
-
-    if (target->history.command_line != (char *) NULL)
-    {
-        free(target->history.command_line);
-    }
-    if (source->history.command_line != (char *) NULL)
-    {
-        target->history.command_line = (char *) calloc (sizeof(char), strlen(source->history.command_line) + 1);
-        if (target->history.command_line == (char *) NULL)
-        {
-            gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-            return(-1);
-        }
-        strncpy(target->history.command_line, source->history.command_line, strlen (source->history.command_line) + 1);
-    }
-
-    if (target->history.comment != (char *) NULL)
-    {
-        free(target->history.comment);
-    }
-    if (source->history.comment != (char *) NULL)
-    {
-        target->history.comment = (char *) calloc (sizeof(char), strlen(source->history.comment) + 1);
-        if (target->history.comment == (char *) NULL)
-        {
-            gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-            return(-1);
-        }
-        strncpy(target->history.comment, source->history.comment, strlen (source->history.comment) + 1);
-    }
-
-    /* Copy the navigation error record from the source to the target */
-    target->nav_error = source->nav_error;
-
-    /* Copy the HV navigation error record from the source to the target */
-    target->hv_nav_error = source->hv_nav_error;
-
-    /* Now hande the attitude record dynamic memory */
-    if (target->attitude.attitude_time == (struct timespec *) NULL)
-    {
-        target->attitude.attitude_time = (struct timespec *) calloc (sizeof(struct timespec), source->attitude.num_measurements);
-        if (target->attitude.attitude_time == (struct timespec *) NULL)
-        {
-            gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-            return(-1);
-        }
-        memcpy (target->attitude.attitude_time, source->attitude.attitude_time, sizeof(struct timespec) * source->attitude.num_measurements);
-    }
-    else if (target->attitude.num_measurements < source->attitude.num_measurements)
-    {
-        target->attitude.attitude_time = (struct timespec *) realloc (target->attitude.attitude_time, sizeof(struct timespec) * source->attitude.num_measurements);
-        if (target->attitude.attitude_time == (struct timespec *) NULL)
-        {
-            gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-            return(-1);
-        }
-        memcpy (target->attitude.attitude_time, source->attitude.attitude_time, sizeof(struct timespec) * source->attitude.num_measurements);
-    }
-
-    if (target->attitude.roll == (double *) NULL)
-    {
-        target->attitude.roll = (double *) calloc (sizeof(double), source->attitude.num_measurements);
-        if (target->attitude.roll == (double *) NULL)
-        {
-            gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-            return(-1);
-        }
-        memcpy (target->attitude.roll, source->attitude.roll, sizeof(double) * source->attitude.num_measurements);
-    }
-    else if (target->attitude.num_measurements < source->attitude.num_measurements)
-    {
-        target->attitude.roll = (double *) realloc (target->attitude.roll, sizeof(double) * source->attitude.num_measurements);
-        if (target->attitude.roll == (double *) NULL)
-        {
-            gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-            return(-1);
-        }
-        memcpy (target->attitude.roll, source->attitude.roll, sizeof(double) * source->attitude.num_measurements);
-    }
-
-    if (target->attitude.pitch == (double *) NULL)
-    {
-        target->attitude.pitch = (double *) calloc (sizeof(double), source->attitude.num_measurements);
-        if (target->attitude.pitch == (double *) NULL)
-        {
-            gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-            return(-1);
-        }
-        memcpy (target->attitude.pitch, source->attitude.pitch, sizeof(double) * source->attitude.num_measurements);
-    }
-    else if (target->attitude.num_measurements < source->attitude.num_measurements)
-    {
-        target->attitude.pitch = (double *) realloc (target->attitude.pitch, sizeof(double) * source->attitude.num_measurements);
-        if (target->attitude.pitch == (double *) NULL)
-        {
-            gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-            return(-1);
-        }
-        memcpy (target->attitude.pitch, source->attitude.pitch, sizeof(double) * source->attitude.num_measurements);
-    }
-
-    if (target->attitude.heave == (double *) NULL)
-    {
-        target->attitude.heave = (double *) calloc (sizeof(double), source->attitude.num_measurements);
-        if (target->attitude.heave == (double *) NULL)
-        {
-            gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-            return(-1);
-        }
-        memcpy (target->attitude.heave, source->attitude.heave, sizeof(double) * source->attitude.num_measurements);
-    }
-    else if (target->attitude.num_measurements < source->attitude.num_measurements)
-    {
-        target->attitude.heave = (double *) realloc (target->attitude.heave, sizeof(double) * source->attitude.num_measurements);
-        if (target->attitude.heave == (double *) NULL)
-        {
-            gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-            return(-1);
-        }
-        memcpy (target->attitude.heave, source->attitude.heave, sizeof(double) * source->attitude.num_measurements);
-    }
-
-    if (target->attitude.heading == (double *) NULL)
-    {
-        target->attitude.heading = (double *) calloc (sizeof(double), source->attitude.num_measurements);
-        if (target->attitude.heading == (double *) NULL)
-        {
-            gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-            return(-1);
-        }
-        memcpy (target->attitude.heading, source->attitude.heading, sizeof(double) * source->attitude.num_measurements);
-    }
-    else if (target->attitude.num_measurements < source->attitude.num_measurements)
-    {
-        target->attitude.heading = (double *) realloc (target->attitude.heading, sizeof(double) * source->attitude.num_measurements);
-        if (target->attitude.heading == (double *) NULL)
-        {
-            gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-            return(-1);
-        }
-        memcpy (target->attitude.heading, source->attitude.heading, sizeof(double) * source->attitude.num_measurements);
-    }
-
-    /* Copy the sound velocity profile record from the source to the target */
-    target->attitude.num_measurements    = source->attitude.num_measurements;
-
-    return(0);
-}
-
-/********************************************************************
- *
- * Function Name : gsfSetParam
- *
- * Description : This function allocates memory for the keyword=value
- *     style parameter and copies the parameter into the allocated space.
- *
- * Inputs :
- *     handle = an integer value containing the file handle, set by gsfOpen
- *     index  = an integer value specifing the index into the processing
- *         parameters array into which the value is to be written.
- *     val = a pointer to the character string containing the parameter.
- *     rec = a pointer to the gsfRecords data structure into which the
- *         parameter is written
- *
- * Returns : This function returns zero if successful, or -1 if an error
- *  occurs.
- *
- * Error Conditions :
- *     GSF_MEMORY_ALLOCATION_FAILED
- *     GSF_PARAM_SIZE_FIXED
- *
- ********************************************************************/
-
-static int
-gsfSetParam(int handle, int index, char *val, gsfRecords *rec)
-{
-    int             len;
-    char           *ptr;
-
-    if ((handle < 1) || (handle > GSF_MAX_OPEN_FILES))
-    {
-        gsfError = GSF_BAD_FILE_HANDLE;
-        return (-1);
-    }
-
-    len = strlen (val);
-    ptr = gsfFileTable[handle-1].rec.process_parameters.param[index];
-    if (ptr == (char *) NULL)
-    {
-        ptr = (char *) calloc (len+1, sizeof(char));
-        if (ptr == (char *) NULL)
-        {
-            gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-            return (-1);
-        }
-    }
-    /* If memory has already been allocated, make sure we have enough space */
-    else if (gsfFileTable[handle-1].rec.process_parameters.param_size[index] < len)
-    {
-        /* If the output file is open update, we cannot write a parameter
-         * bigger in size than the one that exists on the disk now.
-         */
-        if ((gsfFileTable[handle-1].access_mode == GSF_UPDATE) ||
-            (gsfFileTable[handle-1].access_mode == GSF_UPDATE_INDEX))
-        {
-            gsfError = GSF_PARAM_SIZE_FIXED;
-            return(-1);
-        }
-        ptr = (char *) realloc((void *) ptr, len + 1);
-        if (ptr == (char *) NULL)
-        {
-            gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-            return (-1);
-        }
-    }
-    gsfFileTable[handle-1].rec.process_parameters.param[index] = ptr;
-    gsfFileTable[handle-1].rec.process_parameters.param_size[index] = len;
-    rec->process_parameters.param[index] = ptr;
-    rec->process_parameters.param_size[index] = len;
-    strncpy(rec->process_parameters.param[index], val, len+1);
-
-    return(0);
-}
-
-/********************************************************************
- *
- * Function Name : gsfPutMBParams
- *
- * Description : This function moves swath bathymetry sonar processing
- *    parameters from internal form to "KEYWORD=VALUE" form.  The internal
- *    form parameters are read from an MB_PARAMETERS data structure maintained
- *    by the caller.  The "KEYWORD=VALUE" form parameters are written into the
- *    processing_parameters structure of the gsfRecords data structure
- *    maitained by the caller. Parameters for up to two pairs of
- *    transmit/receive arrays are supported, for systems such as Reson SeaBat
- *    9002.
- *
- * Inputs :
- *     p = a pointer to the gsfMBParams data structure which contains
- *         the parameters in internal form.
- *     rec = a pointer to the gsfRecords data structure into which the
- *         parameters are to be written in the "KEYWORK=VALUE" form.
- *     handle = the integer handle to the file set by gsfOpen.
- *     numArrays = the integer value specifying the number of pairs of
- *         arrays which need to have separate parameters tracked.
- *
- * Returns : This function returns zero if successful, or -1 if an error
- *  occurs.
- *
- * Error Conditions :
- *     GSF_MEMORY_ALLOCATION_FAILED
- *     GSF_PARAM_SIZE_FIXED
- *
- ********************************************************************/
-int
-gsfPutMBParams(const gsfMBParams *p, gsfRecords *rec, int handle, int numArrays)
-{
-    char            temp[256];
-    char            temp2[64];
-    int             ret;
-    int             number_parameters = 0, num_tx = 0, num_rx = 0;
-
-    if ((handle < 1) || (handle > GSF_MAX_OPEN_FILES))
-    {
-        gsfError = GSF_BAD_FILE_HANDLE;
-        return (-1);
-    }
-
-    /* If the file is open update, we do not want to allow a write with
-     * a larger number of parameters than currently exist.
-     */
-    if ((gsfFileTable[handle-1].access_mode == GSF_UPDATE) ||
-        (gsfFileTable[handle-1].access_mode == GSF_UPDATE_INDEX))
-    {
-        if ((gsfFileTable[handle-1].rec.process_parameters.number_parameters > 0) &&
-            (gsfFileTable[handle-1].rec.process_parameters.number_parameters < GSF_NUMBER_PROCESSING_PARAMS))
-        {
-            gsfError = GSF_PARAM_SIZE_FIXED;
-            return(-1);
-        }
-    }
-
-    /* Load the text descriptor for the start of time epoch */
-    sprintf(temp, "REFERENCE TIME=1970/001 00:00:00");
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return(-1);
-    }
-
-    if ((p->number_of_transmitters < 1) || (p->number_of_transmitters > GSF_MAX_OFFSETS))
-        num_tx = numArrays;
-    else
-        num_tx = p->number_of_transmitters;
-
-    if ((p->number_of_receivers < 1) || (p->number_of_receivers > GSF_MAX_OFFSETS))
-        num_rx = numArrays;
-    else
-        num_rx = p->number_of_receivers;
-
-    /* DHG 2008/12/18 Add "PLATFORM_TYPE" Processing Parameter */
-
-    if (p->vessel_type == GSF_PLATFORM_TYPE_AUV)
-    {
-        sprintf (temp, "PLATFORM_TYPE=AUV");
-    }
-    else if (p->vessel_type == GSF_PLATFORM_TYPE_SURFACE_SHIP)
-    {
-        sprintf (temp, "PLATFORM_TYPE=SURFACE_SHIP");
-    }
-    else if (p->vessel_type == GSF_PLATFORM_TYPE_ROTV)
-    {
-        sprintf (temp, "PLATFORM_TYPE=ROTV");
-    }
-    ret = gsfSetParam (handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return (-1);
-    }
-
-    if (p->full_raw_data == GSF_TRUE)
-    {
-        sprintf (temp, "FULL_RAW_DATA=TRUE ");
-    }
-    else
-    {
-        sprintf (temp, "FULL_RAW_DATA=FALSE");
-    }
-    ret = gsfSetParam (handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return (-1);
-    }
-
-    /* This parameter indicates whether the depth data has been roll compensated */
-    if (p->roll_compensated == GSF_COMPENSATED)
-    {
-        sprintf(temp, "ROLL_COMPENSATED=YES");
-    }
-    else
-    {
-        sprintf(temp, "ROLL_COMPENSATED=NO ");
-    }
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return(-1);
-    }
-
-    /* This parameter indicates whether the depth data has been pitch compensated */
-    if (p->pitch_compensated == GSF_COMPENSATED)
-    {
-        sprintf(temp, "PITCH_COMPENSATED=YES");
-    }
-    else
-    {
-        sprintf(temp, "PITCH_COMPENSATED=NO ");
-    }
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return(-1);
-    }
-
-    /* This parameter indicates whether the depth has been heave compensated */
-    if (p->heave_compensated == GSF_COMPENSATED)
-    {
-        sprintf(temp, "HEAVE_COMPENSATED=YES");
-    }
-    else
-    {
-        sprintf(temp, "HEAVE_COMPENSATED=NO ");
-    }
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return(-1);
-    }
-
-    /* This parameter indicates whether the depth has been tide compensated */
-    if (p->tide_compensated == GSF_COMPENSATED)
-    {
-        sprintf(temp, "TIDE_COMPENSATED=YES");
-    }
-    else
-    {
-        sprintf(temp, "TIDE_COMPENSATED=NO ");
-    }
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return(-1);
-    }
-
-    /* This parameter indicates the number of receivers.
-     */
-    if ((num_rx >= 1) && (num_rx <= 2))
-    {
-        sprintf(temp, "NUMBER_OF_RECEIVERS=%d", num_rx);
-    }
-    else
-    {
-        sprintf(temp, "NUMBER_OF_RECEIVERS=%s", GSF_UNKNOWN_PARAM_TEXT);
-    }
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return(-1);
-    }
-
-    /* This parameter indicates the number of transmitters.
-     */
-    if ((num_tx >= 1) && (num_tx <= 2))
-    {
-        sprintf(temp, "NUMBER_OF_TRANSMITTERS=%d", num_tx);
-    }
-    else
-    {
-        sprintf(temp, "NUMBER_OF_TRANSMITTERS=%s", GSF_UNKNOWN_PARAM_TEXT);
-    }
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return(-1);
-    }
-
-    /* If the depth field of the swath bathy ping data structure is true depth,
-     * meaning depth is computed by indegrating travel time through the sound
-     * speed profile, then this parameter is set as DEPTH_CALCULATION=CORRECTED.
-     * If the depth field of the swath bathymetry ping data structure is
-     * relative to 1500 meters per second, then this parameter is set as
-     * DEPTH_CALCULATION=DEPTHS_RE_1500_MS.
-     */
-    if (p->depth_calculation == GSF_TRUE_DEPTHS)
-    {
-        sprintf(temp, "DEPTH_CALCULATION=CORRECTED");
-    }
-    else if (p->depth_calculation == GSF_DEPTHS_RE_1500_MS)
-    {
-        sprintf(temp, "DEPTH_CALCULATION=RELATIVE_TO_1500_MS");
-    }
-    else
-    {
-        sprintf(temp, "DEPTH_CALCULATION=UNKNOWN");
-    }
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return(-1);
-    }
-
-    /* This parameter indicates whether the angle travel time pairs
-     * have been corrected for ray tracing.
-     */
-    if (p->ray_tracing == GSF_COMPENSATED)
-    {
-        sprintf(temp, "RAY_TRACING=YES");
-    }
-    else
-    {
-        sprintf(temp, "RAY_TRACING=NO");
-    }
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return(-1);
-    }
-
-    /* This parameter indicates whether the motion sensor bias - measured from the
-     *  patch test has been added to the attitude (roll, pitch, heading) data.
-     */
-    if (p->msb_applied_to_attitude == GSF_TRUE)
-    {
-        sprintf(temp, "MSB_APPLIED_TO_ATTITUDE=YES");
-    }
-    else
-    {
-        sprintf(temp, "MSB_APPLIED_TO_ATTITUDE=NO");
-    }
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return(-1);
-    }
-
-    /* This parameter indicates whether the heave data has been subtracted from
-     *  the GPS tide corrector value.
-     */
-    if (p->heave_removed_from_gps_tc == GSF_TRUE)
-    {
-        sprintf(temp, "HEAVE_REMOVED_FROM_GPS_TC=YES");
-    }
-    else
-    {
-        sprintf(temp, "HEAVE_REMOVED_FROM_GPS_TC=NO");
-    }
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return(-1);
-    }
-
-    /* This parameter indicates the offset from UTC of the original data.
-     */
-    if ((p->utc_offset >= -12) && (p->utc_offset <= 12))
-    {
-        sprintf(temp, "UTC_OFFSET=%d", p->utc_offset);
-    }
-    else
-    {
-        sprintf(temp, "UTC_OFFSET=%s", GSF_UNKNOWN_PARAM_TEXT);
-    }
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return(-1);
-    }
-
-    /* This parameter indicates the roll reference type.
-     */
-    if (p->roll_reference == GSF_HORIZONTAL_PITCH_AXIS)
-    {
-        sprintf(temp, "ROLL_REFERENCE=HORIZONTAL_PITCH_AXIS");
-    }
-    else if (p->roll_reference == GSF_ROTATED_PITCH_AXIS)
-    {
-        sprintf(temp, "ROLL_REFERENCE=ROTATED_PITCH_AXIS");
-    }
-    else
-    {
-        sprintf(temp, "ROLL_REFERENCE=%s", GSF_UNKNOWN_PARAM_TEXT);
-    }
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret) {
-        return(-1);
-    }
-
-    /* The DRAFT_TO_APPLY parameter is a place holder for a new draft
-     * value which is known, but not yet applied.
-     */
-    if (num_tx == 1)
-    {
-        if (p->to_apply.draft[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp, "DRAFT_TO_APPLY=%s",
-                GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->to_apply.draft[0] > GSF_MIN_PARAM) && (p->to_apply.draft[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp, "DRAFT_TO_APPLY=%+06.2f",
-                p->to_apply.draft[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-    }
-    else if (num_tx == 2)
-    {
-        if (p->to_apply.draft[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp, "DRAFT_TO_APPLY=%s,",
-                GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->to_apply.draft[0] > GSF_MIN_PARAM) && (p->to_apply.draft[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp, "DRAFT_TO_APPLY=%+06.2f,",
-                p->to_apply.draft[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-
-        if (p->to_apply.draft[1] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf (temp2, "%s", GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->to_apply.draft[1] > GSF_MIN_PARAM) && (p->to_apply.draft[1] < GSF_MAX_PARAM))
-        {
-            sprintf (temp2, "%+06.2f", p->to_apply.draft[1]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat (temp, temp2);
-    }
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return(-1);
-    }
-
-    /* The PITCH_BIAS_TO_APPLY parameter is place holder for a pitch bias
-     * value which is known but not yet applied.
-     */
-    if (num_tx == 1)
-    {
-        if (p->to_apply.pitch_bias[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp, "PITCH_TO_APPLY=%s",
-                GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->to_apply.pitch_bias[0] > GSF_MIN_PARAM) && (p->to_apply.pitch_bias[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp, "PITCH_TO_APPLY=%+06.2f",
-                p->to_apply.pitch_bias[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-    }
-    else if (num_tx == 2)
-    {
-        if (p->to_apply.pitch_bias[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp, "PITCH_TO_APPLY=%s,",
-                GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->to_apply.pitch_bias[0] > GSF_MIN_PARAM) && (p->to_apply.pitch_bias[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp, "PITCH_TO_APPLY=%+06.2f,",
-                p->to_apply.pitch_bias[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        if (p->to_apply.pitch_bias[1] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf (temp2, "%s", GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->to_apply.pitch_bias[1] > GSF_MIN_PARAM) && (p->to_apply.pitch_bias[1] < GSF_MAX_PARAM))
-        {
-            sprintf (temp2, "%+06.2f", p->to_apply.pitch_bias[1]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat (temp, temp2);
-    }
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return(-1);
-    }
-
-    /* The ROLL_BIAS_TO_APPLY parameter is place holder for a roll bias value
-     * which is known, but not yet applied.
-     */
-    if (num_tx == 1)
-    {
-        if (p->to_apply.roll_bias[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp, "ROLL_TO_APPLY=%s",
-                GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->to_apply.roll_bias[0] > GSF_MIN_PARAM) && (p->to_apply.roll_bias[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp, "ROLL_TO_APPLY=%+06.2f",
-                p->to_apply.roll_bias[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-    }
-    else if (num_tx == 2)
-    {
-        if (p->to_apply.roll_bias[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp, "ROLL_TO_APPLY=%s,",
-                GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->to_apply.roll_bias[0] > GSF_MIN_PARAM) && (p->to_apply.roll_bias[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp, "ROLL_TO_APPLY=%+06.2f,",
-                p->to_apply.roll_bias[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        if (p->to_apply.roll_bias[1] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf (temp2, "%s", GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->to_apply.roll_bias[1] > GSF_MIN_PARAM) && (p->to_apply.roll_bias[1] < GSF_MAX_PARAM))
-        {
-            sprintf (temp2, "%+06.2f", p->to_apply.roll_bias[1]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat (temp, temp2);
-    }
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return(-1);
-    }
-
-    /* The GYRO_BIAS_TO_APPLY parameter is place holder for a gyro bias value
-     * which is known, but not yet applied.
-     */
-    if (num_tx == 1)
-    {
-        if (p->to_apply.gyro_bias[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp, "GYRO_TO_APPLY=%s",
-                GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->to_apply.gyro_bias[0] > GSF_MIN_PARAM) && (p->to_apply.gyro_bias[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp, "GYRO_TO_APPLY=%+06.2f",
-                p->to_apply.gyro_bias[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-    }
-    else if (num_tx == 2)
-    {
-        if (p->to_apply.gyro_bias[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp, "GYRO_TO_APPLY=%s,",
-                GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->to_apply.gyro_bias[0] > GSF_MIN_PARAM) && (p->to_apply.gyro_bias[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp, "GYRO_TO_APPLY=%+06.2f,",
-                p->to_apply.gyro_bias[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        if (p->to_apply.gyro_bias[1] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf (temp2, "%s", GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->to_apply.gyro_bias[1] > GSF_MIN_PARAM) && (p->to_apply.gyro_bias[1] < GSF_MAX_PARAM))
-        {
-            sprintf (temp2, "%+06.2f", p->to_apply.gyro_bias[1]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat (temp, temp2);
-    }
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return(-1);
-    }
-
-    /* The POSITION_OFFSET_TO_APPLY parameter is place holder for a position
-     *  offset which is known, but not yet applied.
-     */
-    memset(temp, 0, sizeof(temp));
-    sprintf(temp, "POSITION_OFFSET_TO_APPLY=");
-    if (p->to_apply.position_x_offset == GSF_UNKNOWN_PARAM_VALUE)
-    {
-        sprintf(temp2, "%s,",
-            GSF_UNKNOWN_PARAM_TEXT);
-    }
-    else if ((p->to_apply.position_x_offset > GSF_MIN_PARAM) && (p->to_apply.position_x_offset < GSF_MAX_PARAM))
-    {
-        sprintf(temp2, "%+06.2f,",
-            p->to_apply.position_x_offset);
-    }
-    else
-    {
-        gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-        return (-1);
-    }
-    strcat(temp, temp2);
-    if (p->to_apply.position_y_offset == GSF_UNKNOWN_PARAM_VALUE)
-    {
-        sprintf(temp2, "%s,", GSF_UNKNOWN_PARAM_TEXT);
-    }
-    else if ((p->to_apply.position_y_offset > GSF_MIN_PARAM) && (p->to_apply.position_y_offset < GSF_MAX_PARAM))
-    {
-        sprintf(temp2, "%+06.2f,",
-            p->to_apply.position_y_offset);
-    }
-    else
-    {
-        gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-        return (-1);
-    }
-    strcat(temp, temp2);
-    if (p->to_apply.position_z_offset == GSF_UNKNOWN_PARAM_VALUE)
-    {
-        sprintf(temp2, "%s", GSF_UNKNOWN_PARAM_TEXT);
-    }
-    else if ((p->to_apply.position_z_offset > GSF_MIN_PARAM) && (p->to_apply.position_z_offset < GSF_MAX_PARAM))
-    {
-        sprintf(temp2, "%+06.2f",
-            p->to_apply.position_z_offset);
-    }
-    else
-    {
-        gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-        return (-1);
-    }
-
-    strcat(temp, temp2);
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return(-1);
-    }
-
-    /* The ANTENNA_OFFSET_TO_APPLY parameter is place holder for a antenna
-     *  offset which is known, but not yet applied.
-     */
-    memset(temp, 0, sizeof(temp));
-    sprintf(temp, "ANTENNA_OFFSET_TO_APPLY=");
-    if (p->to_apply.antenna_x_offset == GSF_UNKNOWN_PARAM_VALUE)
-    {
-        sprintf(temp2, "%s,",
-            GSF_UNKNOWN_PARAM_TEXT);
-    }
-    else if ((p->to_apply.antenna_x_offset > GSF_MIN_PARAM) && (p->to_apply.antenna_x_offset < GSF_MAX_PARAM))
-    {
-        sprintf(temp2, "%+06.2f,",
-            p->to_apply.antenna_x_offset);
-    }
-    else
-    {
-        gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-        return (-1);
-    }
-    strcat(temp, temp2);
-    if (p->to_apply.antenna_y_offset == GSF_UNKNOWN_PARAM_VALUE)
-    {
-        sprintf(temp2, "%s,", GSF_UNKNOWN_PARAM_TEXT);
-    }
-    else if ((p->to_apply.antenna_y_offset > GSF_MIN_PARAM) && (p->to_apply.antenna_y_offset < GSF_MAX_PARAM))
-    {
-        sprintf(temp2, "%+06.2f,",
-            p->to_apply.antenna_y_offset);
-    }
-    else
-    {
-        gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-        return (-1);
-    }
-    strcat(temp, temp2);
-    if (p->to_apply.antenna_z_offset == GSF_UNKNOWN_PARAM_VALUE)
-    {
-        sprintf(temp2, "%s", GSF_UNKNOWN_PARAM_TEXT);
-    }
-    else if ((p->to_apply.antenna_z_offset > GSF_MIN_PARAM) && (p->to_apply.antenna_z_offset < GSF_MAX_PARAM))
-    {
-        sprintf(temp2, "%+06.2f",
-            p->to_apply.antenna_z_offset);
-    }
-    else
-    {
-        gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-        return (-1);
-    }
-    strcat(temp, temp2);
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return(-1);
-    }
-
-    /* The TRANSDUCER_OFFSET_TO_APPLY parameter is place holder for a
-     * transducer position offset which is known, but not yet applied.
-     */
-    memset(temp, 0, sizeof(temp));
-    sprintf(temp, "TRANSDUCER_OFFSET_TO_APPLY=");
-    if (num_tx == 1)
-    {
-        if (p->to_apply.transducer_x_offset[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp2, "%s,",
-                GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->to_apply.transducer_x_offset[0] > GSF_MIN_PARAM) && (p->to_apply.transducer_x_offset[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp2, "%+06.2f,",
-                p->to_apply.transducer_x_offset[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat(temp, temp2);
-        if (p->to_apply.transducer_y_offset[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp2, "%s,",
-                GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->to_apply.transducer_y_offset[0] > GSF_MIN_PARAM) && (p->to_apply.transducer_y_offset[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp2, "%+06.2f,",
-                p->to_apply.transducer_y_offset[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat(temp, temp2);
-        if (p->to_apply.transducer_z_offset[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp2, "%s", GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->to_apply.transducer_z_offset[0] > GSF_MIN_PARAM) && (p->to_apply.transducer_z_offset[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp2, "%+06.2f",
-                p->to_apply.transducer_z_offset[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat(temp, temp2);
-    }
-    else if (num_tx == 2)
-    {
-        if (p->to_apply.transducer_x_offset[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp2, "%s,",
-                GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->to_apply.transducer_x_offset[0] > GSF_MIN_PARAM) && (p->to_apply.transducer_x_offset[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp2, "%+06.2f,",
-                p->to_apply.transducer_x_offset[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat(temp, temp2);
-        if (p->to_apply.transducer_y_offset[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp2, "%s,",
-                GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->to_apply.transducer_y_offset[0] > GSF_MIN_PARAM) && (p->to_apply.transducer_y_offset[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp2, "%+06.2f,",
-                p->to_apply.transducer_y_offset[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat(temp, temp2);
-        if (p->to_apply.transducer_z_offset[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp2, "%s,",
-                GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->to_apply.transducer_z_offset[0] > GSF_MIN_PARAM) && (p->to_apply.transducer_z_offset[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp2, "%+06.2f,",
-                p->to_apply.transducer_z_offset[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat(temp, temp2);
-        if (p->to_apply.transducer_x_offset[1] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp2, "%s,",
-                GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->to_apply.transducer_x_offset[1] > GSF_MIN_PARAM) && (p->to_apply.transducer_x_offset[1] < GSF_MAX_PARAM))
-        {
-            sprintf(temp2, "%+06.2f,",
-                p->to_apply.transducer_x_offset[1]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat(temp, temp2);
-        if (p->to_apply.transducer_y_offset[1] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp2, "%s,",
-                GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->to_apply.transducer_y_offset[1] > GSF_MIN_PARAM) && (p->to_apply.transducer_y_offset[1] < GSF_MAX_PARAM))
-        {
-            sprintf(temp2, "%+06.2f,",
-                p->to_apply.transducer_y_offset[1]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat(temp, temp2);
-        if (p->to_apply.transducer_z_offset[1] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp2, "%s",
-                GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->to_apply.transducer_z_offset[1] > GSF_MIN_PARAM) && (p->to_apply.transducer_z_offset[1] < GSF_MAX_PARAM))
-        {
-            sprintf(temp2, "%+06.2f",
-                p->to_apply.transducer_z_offset[1]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat(temp, temp2);
-    }
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return(-1);
-    }
-
-    /* The TRANSDUCER_PITCH_OFFSET_TO_APPLY parameter is a place holder for a transducer pitch angle
-     *  installation offset which is known, but not yet applied.
-     */
-    if (num_tx == 1)
-    {
-        if (p->to_apply.transducer_pitch_offset[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp, "TRANSDUCER_PITCH_OFFSET_TO_APPLY=%s",
-                GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->to_apply.transducer_pitch_offset[0] > GSF_MIN_PARAM) && (p->to_apply.transducer_pitch_offset[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp, "TRANSDUCER_PITCH_OFFSET_TO_APPLY=%+06.2f",
-                p->to_apply.transducer_pitch_offset[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-    }
-    else if (num_tx == 2)
-    {
-        if (p->to_apply.transducer_pitch_offset[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp, "TRANSDUCER_PITCH_OFFSET_TO_APPLY=%s,", GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->to_apply.transducer_pitch_offset[0] > GSF_MIN_PARAM) && (p->to_apply.transducer_pitch_offset[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp, "TRANSDUCER_PITCH_OFFSET_TO_APPLY=%+06.2f,",
-                p->to_apply.transducer_pitch_offset[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        if (p->to_apply.transducer_pitch_offset[1] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf (temp2, "%s", GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->to_apply.transducer_pitch_offset[1] > GSF_MIN_PARAM) && (p->to_apply.transducer_pitch_offset[1] < GSF_MAX_PARAM))
-        {
-            sprintf (temp2, "%+06.2f", p->to_apply.transducer_pitch_offset[1]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat (temp, temp2);
-    }
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return(-1);
-    }
-
-    /* The TRANSDUCER_ROLL_OFFSET_TO_APPLY parameter is a place holder for a transducer roll angle
-     *  installation offset which is known, but not yet applied.
-     */
-    if (num_tx == 1)
-    {
-        if (p->to_apply.transducer_roll_offset[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp, "TRANSDUCER_ROLL_OFFSET_TO_APPLY=%s",
-                GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->to_apply.transducer_roll_offset[0] > GSF_MIN_PARAM) && (p->to_apply.transducer_roll_offset[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp, "TRANSDUCER_ROLL_OFFSET_TO_APPLY=%+06.2f",
-                p->to_apply.transducer_roll_offset[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-    }
-    else if (num_tx == 2)
-    {
-        if (p->to_apply.transducer_roll_offset[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp, "TRANSDUCER_ROLL_OFFSET_TO_APPLY=%s,", GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->to_apply.transducer_roll_offset[0] > GSF_MIN_PARAM) && (p->to_apply.transducer_roll_offset[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp, "TRANSDUCER_ROLL_OFFSET_TO_APPLY=%+06.2f,",
-                p->to_apply.transducer_roll_offset[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        if (p->to_apply.transducer_roll_offset[1] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf (temp2, "%s", GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->to_apply.transducer_roll_offset[1] > GSF_MIN_PARAM) && (p->to_apply.transducer_roll_offset[1] < GSF_MAX_PARAM))
-        {
-            sprintf (temp2, "%+06.2f", p->to_apply.transducer_roll_offset[1]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat (temp, temp2);
-    }
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return(-1);
-    }
-
-    /* The TRANSDUCER_HEADING_OFFSET_TO_APPLY parameter is a place holder for a transducer heading angle
-     *  installation offset which is known, but not yet applied.
-     */
-    if (num_tx == 1)
-    {
-        if (p->to_apply.transducer_heading_offset[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp, "TRANSDUCER_HEADING_OFFSET_TO_APPLY=%s",
-                GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->to_apply.transducer_heading_offset[0] > GSF_MIN_PARAM) && (p->to_apply.transducer_heading_offset[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp, "TRANSDUCER_HEADING_OFFSET_TO_APPLY=%+06.2f",
-                p->to_apply.transducer_heading_offset[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-    }
-    else if (num_tx == 2)
-    {
-        if (p->to_apply.transducer_heading_offset[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp, "TRANSDUCER_HEADING_OFFSET_TO_APPLY=%s,",
-                GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->to_apply.transducer_heading_offset[0] > GSF_MIN_PARAM) && (p->to_apply.transducer_heading_offset[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp, "TRANSDUCER_HEADING_OFFSET_TO_APPLY=%+06.2f,",
-                p->to_apply.transducer_heading_offset[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        if (p->to_apply.transducer_heading_offset[1] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf (temp2, "%s", GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->to_apply.transducer_heading_offset[1] > GSF_MIN_PARAM) && (p->to_apply.transducer_heading_offset[1] < GSF_MAX_PARAM))
-        {
-            sprintf (temp2, "%+06.2f", p->to_apply.transducer_heading_offset[1]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat (temp, temp2);
-    }
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return(-1);
-    }
-
-    /* The MRU_PITCH_TO_APPLY parameter is place holder for a motion
-     * sensor pitch bias value which is known but not yet applied.
-     */
-    memset(temp, 0, sizeof(temp));
-    if (p->to_apply.mru_pitch_bias == GSF_UNKNOWN_PARAM_VALUE)
-    {
-        sprintf(temp, "MRU_PITCH_TO_APPLY=%s",
-            GSF_UNKNOWN_PARAM_TEXT);
-    }
-    else if ((p->to_apply.mru_pitch_bias > GSF_MIN_PARAM) && (p->to_apply.mru_pitch_bias < GSF_MAX_PARAM))
-    {
-        sprintf(temp, "MRU_PITCH_TO_APPLY=%+06.2f",
-            p->to_apply.mru_pitch_bias);
-    }
-    else
-    {
-        gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-        return (-1);
-    }
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return(-1);
-    }
-
-    /* The MRU_ROLL_TO_APPLY parameter is place holder for a motion
-     * sensor roll bias value which is known but not yet applied.
-     */
-    memset(temp, 0, sizeof(temp));
-    if (p->to_apply.mru_roll_bias == GSF_UNKNOWN_PARAM_VALUE)
-    {
-        sprintf(temp, "MRU_ROLL_TO_APPLY=%s",
-            GSF_UNKNOWN_PARAM_TEXT);
-    }
-    else if ((p->to_apply.mru_roll_bias > GSF_MIN_PARAM) && (p->to_apply.mru_roll_bias < GSF_MAX_PARAM))
-    {
-        sprintf(temp, "MRU_ROLL_TO_APPLY=%+06.2f",
-            p->to_apply.mru_roll_bias);
-    }
-    else
-    {
-        gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-        return (-1);
-    }
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return(-1);
-    }
-
-    /* The MRU_HEADING_TO_APPLY parameter is place holder for a motion
-     * sensor heading bias value which is known but not yet applied.
-     */
-    memset(temp, 0, sizeof(temp));
-    if (p->to_apply.mru_heading_bias == GSF_UNKNOWN_PARAM_VALUE)
-    {
-        sprintf(temp, "MRU_HEADING_TO_APPLY=%s",
-            GSF_UNKNOWN_PARAM_TEXT);
-    }
-    else if ((p->to_apply.mru_heading_bias > GSF_MIN_PARAM) && (p->to_apply.mru_heading_bias < GSF_MAX_PARAM))
-    {
-        sprintf(temp, "MRU_HEADING_TO_APPLY=%+06.2f",
-            p->to_apply.mru_heading_bias);
-    }
-    else
-    {
-        gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-        return (-1);
-    }
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return(-1);
-    }
-
-    /* The MRU_OFFSET_TO_APPLY parameter is place holder for a mru
-     *  offset which is known, but not yet applied.
-     */
-    memset(temp, 0, sizeof(temp));
-    sprintf(temp, "MRU_OFFSET_TO_APPLY=");
-    if (p->to_apply.mru_x_offset == GSF_UNKNOWN_PARAM_VALUE)
-    {
-        sprintf(temp2, "%s,",
-            GSF_UNKNOWN_PARAM_TEXT);
-    }
-    else if ((p->to_apply.mru_x_offset > GSF_MIN_PARAM) && (p->to_apply.mru_x_offset < GSF_MAX_PARAM))
-    {
-        sprintf(temp2, "%+06.2f,",
-            p->to_apply.mru_x_offset);
-    }
-    else
-    {
-        gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-        return (-1);
-    }
-    strcat(temp, temp2);
-    if (p->to_apply.mru_y_offset == GSF_UNKNOWN_PARAM_VALUE)
-    {
-        sprintf(temp2, "%s,", GSF_UNKNOWN_PARAM_TEXT);
-    }
-    else if ((p->to_apply.mru_y_offset > GSF_MIN_PARAM) && (p->to_apply.mru_y_offset < GSF_MAX_PARAM))
-    {
-        sprintf(temp2, "%+06.2f,",
-            p->to_apply.mru_y_offset);
-    }
-    else
-    {
-        gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-        return (-1);
-    }
-    strcat(temp, temp2);
-    if (p->to_apply.mru_z_offset == GSF_UNKNOWN_PARAM_VALUE)
-    {
-        sprintf(temp2, "%s", GSF_UNKNOWN_PARAM_TEXT);
-    }
-    else if ((p->to_apply.mru_z_offset > GSF_MIN_PARAM) && (p->to_apply.mru_z_offset < GSF_MAX_PARAM))
-    {
-        sprintf(temp2, "%+06.2f",
-            p->to_apply.mru_z_offset);
-    }
-    else
-    {
-        gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-        return (-1);
-    }
-    strcat(temp, temp2);
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return(-1);
-    }
-
-    /* The CENTER_OF_ROTATION_OFFSET_TO_APPLY parameter is place holder for a mru
-     *  offset which is known, but not yet applied.
-     */
-    memset(temp, 0, sizeof(temp));
-    sprintf(temp, "CENTER_OF_ROTATION_OFFSET_TO_APPLY=");
-    if (p->to_apply.center_of_rotation_x_offset == GSF_UNKNOWN_PARAM_VALUE)
-    {
-        sprintf(temp2, "%s,",
-            GSF_UNKNOWN_PARAM_TEXT);
-    }
-    else if ((p->to_apply.center_of_rotation_x_offset > GSF_MIN_PARAM) && (p->to_apply.center_of_rotation_x_offset < GSF_MAX_PARAM))
-    {
-        sprintf(temp2, "%+06.2f,",
-            p->to_apply.center_of_rotation_x_offset);
-    }
-    else
-    {
-        gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-        return (-1);
-    }
-    strcat(temp, temp2);
-    if (p->to_apply.center_of_rotation_y_offset == GSF_UNKNOWN_PARAM_VALUE)
-    {
-        sprintf(temp2, "%s,", GSF_UNKNOWN_PARAM_TEXT);
-    }
-    else if ((p->to_apply.center_of_rotation_y_offset > GSF_MIN_PARAM) && (p->to_apply.center_of_rotation_y_offset < GSF_MAX_PARAM))
-    {
-        sprintf(temp2, "%+06.2f,",
-            p->to_apply.center_of_rotation_y_offset);
-    }
-    else
-    {
-        gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-        return (-1);
-    }
-    strcat(temp, temp2);
-    if (p->to_apply.center_of_rotation_z_offset == GSF_UNKNOWN_PARAM_VALUE)
-    {
-        sprintf(temp2, "%s", GSF_UNKNOWN_PARAM_TEXT);
-    }
-    else if ((p->to_apply.center_of_rotation_z_offset > GSF_MIN_PARAM) && (p->to_apply.center_of_rotation_z_offset < GSF_MAX_PARAM))
-    {
-        sprintf(temp2, "%+06.2f",
-            p->to_apply.center_of_rotation_z_offset);
-    }
-    else
-    {
-        gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-        return (-1);
-    }
-    strcat(temp, temp2);
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return(-1);
-    }
-
-    /* The POSITION_LATENCY_TO_APPLY parameter is a place holder for a navigation
-     * sensor latency value which is known but not yet applied.
-     */
-    memset(temp, 0, sizeof(temp));
-    if (p->to_apply.position_latency == GSF_UNKNOWN_PARAM_VALUE)
-    {
-        sprintf(temp, "POSITION_LATENCY_TO_APPLY=%s",
-            GSF_UNKNOWN_PARAM_TEXT);
-    }
-    else if ((p->to_apply.position_latency > GSF_MIN_PARAM) && (p->to_apply.position_latency < GSF_MAX_PARAM))
-    {
-        sprintf(temp, "POSITION_LATENCY_TO_APPLY=%+06.3f",
-            p->to_apply.position_latency);
-    }
-    else
-    {
-        gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-        return (-1);
-    }
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return(-1);
-    }
-
-    /* The ATTITUDE_LATENCY_TO_APPLY parameter is a place holder for an attitude
-     * sensor latency value which is known but not yet applied.
-     */
-    memset(temp, 0, sizeof(temp));
-    if (p->to_apply.attitude_latency == GSF_UNKNOWN_PARAM_VALUE)
-    {
-        sprintf(temp, "ATTITUDE_LATENCY_TO_APPLY=%s",
-            GSF_UNKNOWN_PARAM_TEXT);
-    }
-    else if ((p->to_apply.attitude_latency > GSF_MIN_PARAM) && (p->to_apply.attitude_latency < GSF_MAX_PARAM))
-    {
-        sprintf(temp, "ATTITUDE_LATENCY_TO_APPLY=%+06.3f",
-            p->to_apply.attitude_latency);
-    }
-    else
-    {
-        gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-        return (-1);
-    }
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return(-1);
-    }
-
-    /* The DEPTH_SENSOR_LATENCY_TO_APPLY parameter is a place holder for a depth
-     *  sensor latency value which is known but not yet applied.
-     */
-    memset(temp, 0, sizeof(temp));
-    if (p->to_apply.depth_sensor_latency == GSF_UNKNOWN_PARAM_VALUE)
-    {
-        sprintf(temp, "DEPTH_SENSOR_LATENCY_TO_APPLY=%s",
-            GSF_UNKNOWN_PARAM_TEXT);
-    }
-    else if ((p->to_apply.depth_sensor_latency > GSF_MIN_PARAM) && (p->to_apply.depth_sensor_latency < GSF_MAX_PARAM))
-    {
-        sprintf(temp, "DEPTH_SENSOR_LATENCY_TO_APPLY=%+06.3f",
-            p->to_apply.depth_sensor_latency);
-    }
-    else
-    {
-        gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-        return (-1);
-    }
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return(-1);
-    }
-
-    /* The DEPTH_SENSOR_OFFSET_TO_APPLY parameter is place holder for a depth
-     *  sensor offset which is known, but not yet applied.
-     */
-    if (p->to_apply.depth_sensor_x_offset == GSF_UNKNOWN_PARAM_VALUE)
-    {
-        sprintf(temp, "DEPTH_SENSOR_OFFSET_TO_APPLY=%s,", GSF_UNKNOWN_PARAM_TEXT);
-    }
-    else if ((p->to_apply.depth_sensor_x_offset > GSF_MIN_PARAM) && (p->to_apply.depth_sensor_x_offset < GSF_MAX_PARAM))
-    {
-        sprintf(temp, "DEPTH_SENSOR_OFFSET_TO_APPLY=%+06.2f,",
-                p->to_apply.depth_sensor_x_offset);
-    }
-    else
-    {
-        gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-        return (-1);
-    }
-    if (p->to_apply.depth_sensor_y_offset == GSF_UNKNOWN_PARAM_VALUE)
-    {
-        sprintf(temp2, "%s,", GSF_UNKNOWN_PARAM_TEXT);
-    }
-    else if ((p->to_apply.depth_sensor_y_offset > GSF_MIN_PARAM) && (p->to_apply.depth_sensor_y_offset < GSF_MAX_PARAM))
-    {
-        sprintf(temp2, "%+06.2f,",
-            p->to_apply.depth_sensor_y_offset);
-    }
-    else
-    {
-        gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-        return (-1);
-    }
-    strcat (temp, temp2);
-    if (p->to_apply.depth_sensor_z_offset == GSF_UNKNOWN_PARAM_VALUE)
-    {
-        sprintf(temp2, "%s", GSF_UNKNOWN_PARAM_TEXT);
-    }
-    else if ((p->to_apply.depth_sensor_z_offset > GSF_MIN_PARAM) && (p->to_apply.depth_sensor_z_offset < GSF_MAX_PARAM))
-    {
-        sprintf(temp2, "%+06.2f", p->to_apply.depth_sensor_z_offset);
-    }
-    else
-    {
-        gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-        return (-1);
-    }
-    strcat (temp, temp2);
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return(-1);
-    }
-
-    /* The RX_TRANSDUCER_OFFSET_TO_APPLY parameter is place holder for a
-     * receiver position offset which is known, but not yet applied.
-     */
-    sprintf (temp, "RX_TRANSDUCER_OFFSET_TO_APPLY=");
-    if (num_rx == 1)
-    {
-        if (p->to_apply.rx_transducer_x_offset[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp2, "%s,", GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->to_apply.rx_transducer_x_offset[0] > GSF_MIN_PARAM) && (p->to_apply.rx_transducer_x_offset[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp2, "%+06.2f,", p->to_apply.rx_transducer_x_offset[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat (temp, temp2);
-        if (p->to_apply.rx_transducer_y_offset[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp2, "%s,", GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->to_apply.rx_transducer_y_offset[0] > GSF_MIN_PARAM) && (p->to_apply.rx_transducer_y_offset[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp2, "%+06.2f,", p->to_apply.rx_transducer_y_offset[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat (temp, temp2);
-        if (p->to_apply.rx_transducer_z_offset[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp2, "%s", GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->to_apply.rx_transducer_z_offset[0] > GSF_MIN_PARAM) && (p->to_apply.rx_transducer_z_offset[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp2, "%+06.2f", p->to_apply.rx_transducer_z_offset[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat (temp, temp2);
-    }
-    else if (num_rx == 2)
-    {
-        if (p->to_apply.rx_transducer_x_offset[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp2, "%s,", GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->to_apply.rx_transducer_x_offset[0] > GSF_MIN_PARAM) && (p->to_apply.rx_transducer_x_offset[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp2, "%+06.2f,", p->to_apply.rx_transducer_x_offset[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat (temp, temp2);
-        if (p->to_apply.rx_transducer_y_offset[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp2, "%s,", GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->to_apply.rx_transducer_y_offset[0] > GSF_MIN_PARAM) && (p->to_apply.rx_transducer_y_offset[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp2, "%+06.2f,", p->to_apply.rx_transducer_y_offset[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat (temp, temp2);
-        if (p->to_apply.rx_transducer_z_offset[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp2, "%s,", GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->to_apply.rx_transducer_z_offset[0] > GSF_MIN_PARAM) && (p->to_apply.rx_transducer_z_offset[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp2, "%+06.2f,", p->to_apply.rx_transducer_z_offset[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat (temp, temp2);
-        if (p->to_apply.rx_transducer_x_offset[1] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp2, "%s,", GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->to_apply.rx_transducer_x_offset[1] > GSF_MIN_PARAM) && (p->to_apply.rx_transducer_x_offset[1] < GSF_MAX_PARAM))
-        {
-            sprintf(temp2, "%+06.2f,", p->to_apply.rx_transducer_x_offset[1]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat (temp, temp2);
-        if (p->to_apply.rx_transducer_y_offset[1] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp2, "%s,", GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->to_apply.rx_transducer_y_offset[1] > GSF_MIN_PARAM) && (p->to_apply.rx_transducer_y_offset[1] < GSF_MAX_PARAM))
-        {
-            sprintf(temp2, "%+06.2f,", p->to_apply.rx_transducer_y_offset[1]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat (temp, temp2);
-        if (p->to_apply.rx_transducer_z_offset[1] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp2, "%s", GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->to_apply.rx_transducer_z_offset[1] > GSF_MIN_PARAM) && (p->to_apply.rx_transducer_z_offset[1] < GSF_MAX_PARAM))
-        {
-            sprintf(temp2, "%+06.2f", p->to_apply.rx_transducer_z_offset[1]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat (temp, temp2);
-    }
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return(-1);
-    }
-
-    /* The RX_TRANSDUCER_PITCH_TO_APPLY parameter is place holder for a
-     * receiver pitch offset which is known, but not yet applied.
-     */
-    sprintf (temp, "RX_TRANSDUCER_PITCH_OFFSET_TO_APPLY=");
-    if (num_rx == 1)
-    {
-        if (p->to_apply.rx_transducer_pitch_offset[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp2, "%s", GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->to_apply.rx_transducer_pitch_offset[0] > GSF_MIN_PARAM) && (p->to_apply.rx_transducer_pitch_offset[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp2, "%+06.2f", p->to_apply.rx_transducer_pitch_offset[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat (temp, temp2);
-    }
-    else if (num_rx == 2)
-    {
-        if (p->to_apply.rx_transducer_pitch_offset[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp2, "%s,", GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->to_apply.rx_transducer_pitch_offset[0] > GSF_MIN_PARAM) && (p->to_apply.rx_transducer_pitch_offset[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp2, "%+06.2f,", p->to_apply.rx_transducer_pitch_offset[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat (temp, temp2);
-        if (p->to_apply.rx_transducer_pitch_offset[1] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp2, "%s", GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->to_apply.rx_transducer_pitch_offset[1] > GSF_MIN_PARAM) && (p->to_apply.rx_transducer_pitch_offset[1] < GSF_MAX_PARAM))
-        {
-            sprintf(temp2, "%+06.2f", p->to_apply.rx_transducer_pitch_offset[1]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat (temp, temp2);
-    }
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return(-1);
-    }
-
-    /* The RX_TRANSDUCER_ROLL_TO_APPLY parameter is place holder for a
-     * receiver roll offset which is known, but not yet applied.
-     */
-    sprintf (temp, "RX_TRANSDUCER_ROLL_OFFSET_TO_APPLY=");
-    if (num_rx == 1)
-    {
-        if (p->to_apply.rx_transducer_roll_offset[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp2, "%s", GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->to_apply.rx_transducer_roll_offset[0] > GSF_MIN_PARAM) && (p->to_apply.rx_transducer_roll_offset[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp2, "%+06.2f", p->to_apply.rx_transducer_roll_offset[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat (temp, temp2);
-    }
-    else if (num_rx == 2)
-    {
-        if (p->to_apply.rx_transducer_roll_offset[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp2, "%s,", GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->to_apply.rx_transducer_roll_offset[0] > GSF_MIN_PARAM) && (p->to_apply.rx_transducer_roll_offset[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp2, "%+06.2f,", p->to_apply.rx_transducer_roll_offset[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat (temp, temp2);
-        if (p->to_apply.rx_transducer_roll_offset[1] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp2, "%s", GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->to_apply.rx_transducer_roll_offset[1] > GSF_MIN_PARAM) && (p->to_apply.rx_transducer_roll_offset[1] < GSF_MAX_PARAM))
-        {
-            sprintf(temp2, "%+06.2f", p->to_apply.rx_transducer_roll_offset[1]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat (temp, temp2);
-    }
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return(-1);
-    }
-
-    /* The RX_TRANSDUCER_HEADING_TO_APPLY parameter is place holder for a
-     * receiver heading offset which is known, but not yet applied.
-     */
-    sprintf (temp, "RX_TRANSDUCER_HEADING_OFFSET_TO_APPLY=");
-    if (num_rx == 1)
-    {
-        if (p->to_apply.rx_transducer_heading_offset[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp2, "%s", GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->to_apply.rx_transducer_heading_offset[0] > GSF_MIN_PARAM) && (p->to_apply.rx_transducer_heading_offset[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp2, "%+06.2f", p->to_apply.rx_transducer_heading_offset[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat (temp, temp2);
-    }
-    else if (num_rx == 2)
-    {
-        if (p->to_apply.rx_transducer_heading_offset[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp2, "%s,", GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->to_apply.rx_transducer_heading_offset[0] > GSF_MIN_PARAM) && (p->to_apply.rx_transducer_heading_offset[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp2, "%+06.2f,", p->to_apply.rx_transducer_heading_offset[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat (temp, temp2);
-        if (p->to_apply.rx_transducer_heading_offset[1] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp2, "%s", GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->to_apply.rx_transducer_heading_offset[1] > GSF_MIN_PARAM) && (p->to_apply.rx_transducer_heading_offset[1] < GSF_MAX_PARAM))
-        {
-            sprintf(temp2, "%+06.2f", p->to_apply.rx_transducer_heading_offset[1]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat (temp, temp2);
-    }
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return(-1);
-    }
-
-    /***** end of "to apply" parameters, on to "applied" ****/
-
-    /* The APPLIED_DRAFT parameter defines the transducer draft value
-     * previously applied to the depths.
-     */
-    if (num_tx == 1)
-    {
-        if (p->applied.draft[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp, "APPLIED_DRAFT=%s",
-                GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->applied.draft[0] > GSF_MIN_PARAM) && (p->applied.draft[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp, "APPLIED_DRAFT=%+06.2f",
-                p->applied.draft[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-    }
-    else if (num_tx == 2)
-    {
-        if (p->applied.draft[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp, "APPLIED_DRAFT=%s,", GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->applied.draft[0] > GSF_MIN_PARAM) && (p->applied.draft[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp, "APPLIED_DRAFT=%+06.2f,", p->applied.draft[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        if (p->applied.draft[1] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf (temp2, "%s", GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->applied.draft[1] > GSF_MIN_PARAM) && (p->applied.draft[1] < GSF_MAX_PARAM))
-        {
-            sprintf (temp2, "%+06.2f", p->applied.draft[1]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat (temp, temp2);
-    }
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return(-1);
-    }
-
-    /* The APPLIED_PITCH_BIAS parameter defines the pitch bias previously
-     * applied.
-     */
-    if (num_tx == 1)
-    {
-        if (p->applied.pitch_bias[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp, "APPLIED_PITCH_BIAS=%s",
-                GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->applied.pitch_bias[0] > GSF_MIN_PARAM) && (p->applied.pitch_bias[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp, "APPLIED_PITCH_BIAS=%+06.2f",
-                p->applied.pitch_bias[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-    }
-    else if (num_tx == 2)
-    {
-        if (p->applied.pitch_bias[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp, "APPLIED_PITCH_BIAS=%s,", GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->applied.pitch_bias[0] > GSF_MIN_PARAM) && (p->applied.pitch_bias[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp, "APPLIED_PITCH_BIAS=%+06.2f,", p->applied.pitch_bias[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        if (p->applied.pitch_bias[1] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf (temp2, "%s", GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->applied.pitch_bias[1] > GSF_MIN_PARAM) && (p->applied.pitch_bias[1] < GSF_MAX_PARAM))
-        {
-            sprintf (temp2, "%+06.2f", p->applied.pitch_bias[1]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat (temp, temp2);
-    }
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return(-1);
-    }
-
-    /* The APPLIED_ROLL_BIAS parameter defines the roll bias previously
-     * applied to the data.
-     */
-    if (num_tx == 1)
-    {
-        if (p->applied.roll_bias[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp, "APPLIED_ROLL_BIAS=%s",
-                GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->applied.roll_bias[0] > GSF_MIN_PARAM) && (p->applied.roll_bias[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp, "APPLIED_ROLL_BIAS=%+06.2f",
-                p->applied.roll_bias[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-    }
-    else if (num_tx == 2)
-    {
-        if (p->applied.roll_bias[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp, "APPLIED_ROLL_BIAS=%s,", GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->applied.roll_bias[0] > GSF_MIN_PARAM) && (p->applied.roll_bias[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp, "APPLIED_ROLL_BIAS=%+06.2f,", p->applied.roll_bias[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        if (p->applied.roll_bias[1] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf (temp2, "%s", GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->applied.roll_bias[1] > GSF_MIN_PARAM) && (p->applied.roll_bias[1] < GSF_MAX_PARAM))
-        {
-            sprintf (temp2, "%+06.2f", p->applied.roll_bias[1]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat (temp, temp2);
-    }
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return(-1);
-    }
-
-    /* The APPLIED_GYRO_BIAS parameter defines the gyro bias previously
-     * applied to the data.
-     */
-    if (num_tx == 1)
-    {
-        if (p->applied.gyro_bias[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp, "APPLIED_GYRO_BIAS=%s",
-                GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->applied.gyro_bias[0] > GSF_MIN_PARAM) && (p->applied.gyro_bias[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp, "APPLIED_GYRO_BIAS=%+06.2f",
-                p->applied.gyro_bias[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-    }
-    else if (num_tx == 2)
-    {
-        if (p->applied.gyro_bias[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp, "APPLIED_GYRO_BIAS=%s,", GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->applied.gyro_bias[0] > GSF_MIN_PARAM) && (p->applied.gyro_bias[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp, "APPLIED_GYRO_BIAS=%+06.2f,", p->applied.gyro_bias[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        if (p->applied.gyro_bias[1] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf (temp2, "%s", GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->applied.gyro_bias[1] > GSF_MIN_PARAM) && (p->applied.gyro_bias[1] < GSF_MAX_PARAM))
-        {
-            sprintf (temp2, "%+06.2f", p->applied.gyro_bias[1]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat (temp, temp2);
-    }
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return(-1);
-    }
-
-    /* The APPLIED_POSITION_OFFSET parameter defines the x,y,z position in
-     * ship coordinates to which the lat lons are relative.
-     */
-    memset(temp, 0, sizeof(temp));
-    sprintf(temp, "APPLIED_POSITION_OFFSET=");
-    if (p->applied.position_x_offset == GSF_UNKNOWN_PARAM_VALUE)
-    {
-        sprintf(temp2, "%s,",
-            GSF_UNKNOWN_PARAM_TEXT);
-    }
-    else if ((p->applied.position_x_offset > GSF_MIN_PARAM) && (p->applied.position_x_offset < GSF_MAX_PARAM))
-    {
-        sprintf(temp2, "%+06.2f,",
-            p->applied.position_x_offset);
-    }
-    else
-    {
-        gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-        return (-1);
-    }
-    strcat(temp, temp2);
-    if (p->applied.position_y_offset == GSF_UNKNOWN_PARAM_VALUE)
-    {
-        sprintf(temp2, "%s,",
-            GSF_UNKNOWN_PARAM_TEXT);
-    }
-    else if ((p->applied.position_y_offset > GSF_MIN_PARAM) && (p->applied.position_y_offset < GSF_MAX_PARAM))
-    {
-        sprintf(temp2, "%+06.2f,",
-            p->applied.position_y_offset);
-    }
-    else
-    {
-        gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-        return (-1);
-    }
-    strcat(temp, temp2);
-    if (p->applied.position_z_offset == GSF_UNKNOWN_PARAM_VALUE)
-    {
-        sprintf(temp2, "%s",
-            GSF_UNKNOWN_PARAM_TEXT);
-    }
-    else if ((p->applied.position_z_offset > GSF_MIN_PARAM) && (p->applied.position_z_offset < GSF_MAX_PARAM))
-    {
-        sprintf(temp2, "%+06.2f",
-            p->applied.position_z_offset);
-    }
-    else
-    {
-        gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-        return (-1);
-    }
-    strcat(temp, temp2);
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return(-1);
-    }
-
-    /* The APPLIED_ANTENNA_OFFSET parameter defines the x,y,z position of the antenna
-     * in ship coordinates to which the lat lons are relative.
-     */
-    memset(temp, 0, sizeof(temp));
-    sprintf(temp, "APPLIED_ANTENNA_OFFSET=");
-    if (p->applied.antenna_x_offset == GSF_UNKNOWN_PARAM_VALUE)
-    {
-        sprintf(temp2, "%s,",
-            GSF_UNKNOWN_PARAM_TEXT);
-    }
-    else if ((p->applied.antenna_x_offset > GSF_MIN_PARAM) && (p->applied.antenna_x_offset < GSF_MAX_PARAM))
-    {
-        sprintf(temp2, "%+06.2f,",
-            p->applied.antenna_x_offset);
-    }
-    else
-    {
-        gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-        return (-1);
-    }
-    strcat(temp, temp2);
-    if (p->applied.antenna_y_offset == GSF_UNKNOWN_PARAM_VALUE)
-    {
-        sprintf(temp2, "%s,",
-            GSF_UNKNOWN_PARAM_TEXT);
-    }
-    else if ((p->applied.antenna_y_offset > GSF_MIN_PARAM) && (p->applied.antenna_y_offset < GSF_MAX_PARAM))
-    {
-        sprintf(temp2, "%+06.2f,",
-            p->applied.antenna_y_offset);
-    }
-    else
-    {
-        gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-        return (-1);
-    }
-    strcat(temp, temp2);
-    if (p->applied.antenna_z_offset == GSF_UNKNOWN_PARAM_VALUE)
-    {
-        sprintf(temp2, "%s",
-            GSF_UNKNOWN_PARAM_TEXT);
-    }
-    else if ((p->applied.antenna_z_offset > GSF_MIN_PARAM) && (p->applied.antenna_z_offset < GSF_MAX_PARAM))
-    {
-        sprintf(temp2, "%+06.2f",
-            p->applied.antenna_z_offset);
-    }
-    else
-    {
-        gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-        return (-1);
-    }
-    strcat(temp, temp2);
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return(-1);
-    }
-
-    /* The APPLIED_TRANSDUCER_OFFSET parameter defines the x,y,z offsets
-     * in ship coordinates to which have been applied to refer the x,y,z
-     * beam values to the ship reference point.
-     */
-    memset(temp, 0, sizeof(temp));
-    sprintf(temp, "APPLIED_TRANSDUCER_OFFSET=");
-    if (num_tx == 1)
-    {
-        if (p->applied.transducer_x_offset[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp2, "%s,",
-                GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->applied.transducer_x_offset[0] > GSF_MIN_PARAM) && (p->applied.transducer_x_offset[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp2, "%+06.2f,",
-                p->applied.transducer_x_offset[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat(temp, temp2);
-        if (p->applied.transducer_y_offset[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp2, "%s,",
-                GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->applied.transducer_y_offset[0] > GSF_MIN_PARAM) && (p->applied.transducer_y_offset[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp2, "%+06.2f,",
-                p->applied.transducer_y_offset[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat(temp, temp2);
-        if (p->applied.transducer_z_offset[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp2, "%s",
-                GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->applied.transducer_z_offset[0] > GSF_MIN_PARAM) && (p->applied.transducer_z_offset[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp2, "%+06.2f",
-                p->applied.transducer_z_offset[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat(temp, temp2);
-    }
-    else if (num_tx == 2)
-    {
-        if (p->applied.transducer_x_offset[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp2, "%s,",
-                GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->applied.transducer_x_offset[0] > GSF_MIN_PARAM) && (p->applied.transducer_x_offset[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp2, "%+06.2f,",
-                p->applied.transducer_x_offset[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat(temp, temp2);
-        if (p->applied.transducer_y_offset[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp2, "%s,",
-                GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->applied.transducer_y_offset[0] > GSF_MIN_PARAM) && (p->applied.transducer_y_offset[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp2, "%+06.2f,",
-                p->applied.transducer_y_offset[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat(temp, temp2);
-        if (p->applied.transducer_z_offset[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp2, "%s,",
-                GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->applied.transducer_z_offset[0] > GSF_MIN_PARAM) && (p->applied.transducer_z_offset[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp2, "%+06.2f,",
-                p->applied.transducer_z_offset[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat(temp, temp2);
-        if (p->applied.transducer_x_offset[1] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp2, "%s,",
-                GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->applied.transducer_x_offset[1] > GSF_MIN_PARAM) && (p->applied.transducer_x_offset[1] < GSF_MAX_PARAM))
-        {
-            sprintf(temp2, "%+06.2f,",
-                p->applied.transducer_x_offset[1]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat(temp, temp2);
-        if (p->applied.transducer_y_offset[1] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp2, "%s,",
-                GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->applied.transducer_y_offset[1] > GSF_MIN_PARAM) && (p->applied.transducer_y_offset[1] < GSF_MAX_PARAM))
-        {
-            sprintf(temp2, "%+06.2f,",
-                p->applied.transducer_y_offset[1]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat(temp, temp2);
-        if (p->applied.transducer_z_offset[1] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp2, "%s",
-                GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->applied.transducer_z_offset[1] > GSF_MIN_PARAM) && (p->applied.transducer_z_offset[1] < GSF_MAX_PARAM))
-        {
-            sprintf(temp2, "%+06.2f",
-                p->applied.transducer_z_offset[1]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat(temp, temp2);
-    }
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return(-1);
-    }
-
-    /* The APPLIED_TRANSDUCER_PITCH_OFFSET parameter defines the transducer pitch installation angle
-     *   previously applied to the data.
-     */
-    if (num_tx == 1)
-    {
-        if (p->applied.transducer_pitch_offset[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp, "APPLIED_TRANSDUCER_PITCH_OFFSET=%s",
-                GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->applied.transducer_pitch_offset[0] > GSF_MIN_PARAM) && (p->applied.transducer_pitch_offset[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp, "APPLIED_TRANSDUCER_PITCH_OFFSET=%+06.2f",
-                p->applied.transducer_pitch_offset[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-    }
-    else if (num_tx == 2)
-    {
-        if (p->applied.transducer_pitch_offset[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp, "APPLIED_TRANSDUCER_PITCH_OFFSET=%s,",
-                GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->applied.transducer_pitch_offset[0] > GSF_MIN_PARAM) && (p->applied.transducer_pitch_offset[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp, "APPLIED_TRANSDUCER_PITCH_OFFSET=%+06.2f,",
-                p->applied.transducer_pitch_offset[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        if (p->applied.transducer_pitch_offset[1] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf (temp2, "%s", GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->applied.transducer_pitch_offset[1] > GSF_MIN_PARAM) && (p->applied.transducer_pitch_offset[1] < GSF_MAX_PARAM))
-        {
-            sprintf (temp2, "%+06.2f", p->applied.transducer_pitch_offset[1]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat (temp, temp2);
-    }
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return(-1);
-    }
-
-    /* The APPLIED_TRANSDUCER_ROLL_OFFSET parameter defines the transducer roll installation angle
-     *   previously applied to the data.
-     */
-    if (num_tx == 1)
-    {
-        if (p->applied.transducer_roll_offset[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp, "APPLIED_TRANSDUCER_ROLL_OFFSET=%s",
-                GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->applied.transducer_roll_offset[0] > GSF_MIN_PARAM) && (p->applied.transducer_roll_offset[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp, "APPLIED_TRANSDUCER_ROLL_OFFSET=%+06.2f",
-                p->applied.transducer_roll_offset[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-    }
-    else if (num_tx == 2)
-    {
-        if (p->applied.transducer_roll_offset[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp, "APPLIED_TRANSDUCER_ROLL_OFFSET=%s,",
-                GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->applied.transducer_roll_offset[0] > GSF_MIN_PARAM) && (p->applied.transducer_roll_offset[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp, "APPLIED_TRANSDUCER_ROLL_OFFSET=%+06.2f,",
-                p->applied.transducer_roll_offset[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        if (p->applied.transducer_roll_offset[1] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf (temp2, "%s", GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->applied.transducer_roll_offset[1] > GSF_MIN_PARAM) && (p->applied.transducer_roll_offset[1] < GSF_MAX_PARAM))
-        {
-            sprintf (temp2, "%+06.2f", p->applied.transducer_roll_offset[1]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat (temp, temp2);
-    }
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return(-1);
-    }
-
-    /* The APPLIED_TRANSDUCER_HEADING_OFFSET parameter defines the transducer heading installation angle
-     *   previously applied to the data.
-     */
-    if (num_tx == 1)
-    {
-        if (p->applied.transducer_heading_offset[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp, "APPLIED_TRANSDUCER_HEADING_OFFSET=%s",
-                GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->applied.transducer_heading_offset[0] > GSF_MIN_PARAM) && (p->applied.transducer_heading_offset[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp, "APPLIED_TRANSDUCER_HEADING_OFFSET=%+06.2f",
-                p->applied.transducer_heading_offset[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-    }
-    else if (num_tx == 2)
-    {
-        if (p->applied.transducer_heading_offset[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp, "APPLIED_TRANSDUCER_HEADING_OFFSET=%s,",
-                GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->applied.transducer_heading_offset[0] > GSF_MIN_PARAM) && (p->applied.transducer_heading_offset[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp, "APPLIED_TRANSDUCER_HEADING_OFFSET=%+06.2f,",
-                p->applied.transducer_heading_offset[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        if (p->applied.transducer_heading_offset[1] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf (temp2, "%s", GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->applied.transducer_heading_offset[1] > GSF_MIN_PARAM) && (p->applied.transducer_heading_offset[1] < GSF_MAX_PARAM))
-        {
-            sprintf (temp2, "%+06.2f", p->applied.transducer_heading_offset[1]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat (temp, temp2);
-    }
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return(-1);
-    }
-
-    /* The APPLIED_MRU_ROLL parameter defines the roll bias previously
-     * applied to the data.
-     */
-    memset(temp, 0, sizeof(temp));
-    if (p->applied.mru_roll_bias == GSF_UNKNOWN_PARAM_VALUE)
-    {
-        sprintf(temp, "APPLIED_MRU_ROLL=%s",
-            GSF_UNKNOWN_PARAM_TEXT);
-    }
-    else if ((p->applied.mru_roll_bias > GSF_MIN_PARAM) && (p->applied.mru_roll_bias < GSF_MAX_PARAM))
-    {
-        sprintf(temp, "APPLIED_MRU_ROLL=%+06.2f",
-            p->applied.mru_roll_bias);
-    }
-    else
-    {
-        gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-        return (-1);
-    }
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return(-1);
-    }
-
-    /* The APPLIED_MRU_PITCH parameter defines the pitch bias previously
-     * applied to the data.
-     */
-    memset(temp, 0, sizeof(temp));
-    if (p->applied.mru_pitch_bias == GSF_UNKNOWN_PARAM_VALUE)
-    {
-        sprintf(temp, "APPLIED_MRU_PITCH=%s",
-            GSF_UNKNOWN_PARAM_TEXT);
-    }
-    else if ((p->applied.mru_pitch_bias > GSF_MIN_PARAM) && (p->applied.mru_pitch_bias < GSF_MAX_PARAM))
-    {
-        sprintf(temp, "APPLIED_MRU_PITCH=%+06.2f",
-            p->applied.mru_pitch_bias);
-    }
-    else
-    {
-        gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-        return (-1);
-    }
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return(-1);
-    }
-
-    /* The APPLIED_MRU_HEADING parameter defines the heading bias previously
-     * applied to the data.
-     */
-    memset(temp, 0, sizeof(temp));
-    if (p->applied.mru_heading_bias == GSF_UNKNOWN_PARAM_VALUE)
-    {
-        sprintf(temp, "APPLIED_MRU_HEADING=%s",
-            GSF_UNKNOWN_PARAM_TEXT);
-    }
-    else if ((p->applied.mru_heading_bias > GSF_MIN_PARAM) && (p->applied.mru_heading_bias < GSF_MAX_PARAM))
-    {
-        sprintf(temp, "APPLIED_MRU_HEADING=%+06.2f",
-            p->applied.mru_heading_bias);
-    }
-    else
-    {
-        gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-        return (-1);
-    }
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return(-1);
-    }
-
-    /* The APPLIED_MRU_OFFSET parameter defines the x,y,z offsets
-     * in ship coordinates to which have been used to calculate a heave
-     * difference between the motion sensor and the ship reference point.
-     */
-    memset(temp, 0, sizeof(temp));
-    sprintf(temp, "APPLIED_MRU_OFFSET=");
-    if (p->applied.mru_x_offset == GSF_UNKNOWN_PARAM_VALUE)
-    {
-        sprintf(temp2, "%s,",
-            GSF_UNKNOWN_PARAM_TEXT);
-    }
-    else if ((p->applied.mru_x_offset > GSF_MIN_PARAM) && (p->applied.mru_x_offset < GSF_MAX_PARAM))
-    {
-        sprintf(temp2, "%+06.2f,",
-            p->applied.mru_x_offset);
-    }
-    else
-    {
-        gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-        return (-1);
-    }
-    strcat(temp, temp2);
-    if (p->applied.mru_y_offset == GSF_UNKNOWN_PARAM_VALUE)
-    {
-        sprintf(temp2, "%s,", GSF_UNKNOWN_PARAM_TEXT);
-    }
-    else if ((p->applied.mru_y_offset > GSF_MIN_PARAM) && (p->applied.mru_y_offset < GSF_MAX_PARAM))
-    {
-        sprintf(temp2, "%+06.2f,",
-            p->applied.mru_y_offset);
-    }
-    else
-    {
-        gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-        return (-1);
-    }
-    strcat(temp, temp2);
-    if (p->applied.mru_z_offset == GSF_UNKNOWN_PARAM_VALUE)
-    {
-        sprintf(temp2, "%s", GSF_UNKNOWN_PARAM_TEXT);
-    }
-    else if ((p->applied.mru_z_offset > GSF_MIN_PARAM) && (p->applied.mru_z_offset < GSF_MAX_PARAM))
-    {
-        sprintf(temp2, "%+06.2f",
-            p->applied.mru_z_offset);
-    }
-    else
-    {
-        gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-        return (-1);
-    }
-    strcat(temp, temp2);
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return(-1);
-    }
-
-    /* The APPLIED_CENTER_OF_ROTATION_OFFSET parameter defines the x,y,z offsets
-     * in ship coordinates to which have been used to calculate a heave
-     * difference between the motion sensor and the ship reference point.
-     */
-    memset(temp, 0, sizeof(temp));
-    sprintf(temp, "APPLIED_CENTER_OF_ROTATION_OFFSET=");
-    if (p->applied.center_of_rotation_x_offset == GSF_UNKNOWN_PARAM_VALUE)
-    {
-        sprintf(temp2, "%s,",
-            GSF_UNKNOWN_PARAM_TEXT);
-    }
-    else if ((p->applied.center_of_rotation_x_offset > GSF_MIN_PARAM) && (p->applied.center_of_rotation_x_offset < GSF_MAX_PARAM))
-    {
-        sprintf(temp2, "%+06.2f,",
-            p->applied.center_of_rotation_x_offset);
-    }
-    else
-    {
-        gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-        return (-1);
-    }
-    strcat(temp, temp2);
-    if (p->applied.center_of_rotation_y_offset == GSF_UNKNOWN_PARAM_VALUE)
-    {
-        sprintf(temp2, "%s,", GSF_UNKNOWN_PARAM_TEXT);
-    }
-    else if ((p->applied.center_of_rotation_y_offset > GSF_MIN_PARAM) && (p->applied.center_of_rotation_y_offset < GSF_MAX_PARAM))
-    {
-        sprintf(temp2, "%+06.2f,",
-            p->applied.center_of_rotation_y_offset);
-    }
-    else
-    {
-        gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-        return (-1);
-    }
-    strcat(temp, temp2);
-    if (p->applied.center_of_rotation_z_offset == GSF_UNKNOWN_PARAM_VALUE)
-    {
-        sprintf(temp2, "%s", GSF_UNKNOWN_PARAM_TEXT);
-    }
-    else if ((p->applied.center_of_rotation_z_offset > GSF_MIN_PARAM) && (p->applied.center_of_rotation_z_offset < GSF_MAX_PARAM))
-    {
-        sprintf(temp2, "%+06.2f",
-            p->applied.center_of_rotation_z_offset);
-    }
-    else
-    {
-        gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-        return (-1);
-    }
-    strcat(temp, temp2);
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return(-1);
-    }
-
-    /* The APPLIED_POSITION_LATENCY parameter defines the navigation
-     * sensor latency value which has already been applied.
-     */
-    memset(temp, 0, sizeof(temp));
-    if (p->applied.position_latency == GSF_UNKNOWN_PARAM_VALUE)
-    {
-        sprintf(temp, "APPLIED_POSITION_LATENCY=%s",
-            GSF_UNKNOWN_PARAM_TEXT);
-    }
-    else if ((p->applied.position_latency > GSF_MIN_PARAM) && (p->applied.position_latency < GSF_MAX_PARAM))
-    {
-        sprintf(temp, "APPLIED_POSITION_LATENCY=%+06.3f",
-            p->applied.position_latency);
-    }
-    else
-    {
-        gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-        return (-1);
-    }
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return(-1);
-    }
-
-    /* The APPLIED_ATTITUDE_LATENCY parameter defines the attitude
-     * sensor latency value which has already been applied.
-     */
-    memset(temp, 0, sizeof(temp));
-    if (p->applied.attitude_latency == GSF_UNKNOWN_PARAM_VALUE)
-    {
-        sprintf(temp, "APPLIED_ATTITUDE_LATENCY=%s",
-            GSF_UNKNOWN_PARAM_TEXT);
-    }
-    else if ((p->applied.attitude_latency > GSF_MIN_PARAM) && (p->applied.attitude_latency < GSF_MAX_PARAM))
-    {
-        sprintf(temp, "APPLIED_ATTITUDE_LATENCY=%+06.3f",
-            p->applied.attitude_latency);
-    }
-    else
-    {
-        gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-        return (-1);
-    }
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return(-1);
-    }
-
-    /* The APPLIED_DEPTH_SENSOR_LATENCY parameter defines the depth
-     *  sensor latency value which has already been applied.
-     */
-    memset(temp, 0, sizeof(temp));
-    if (p->applied.depth_sensor_latency == GSF_UNKNOWN_PARAM_VALUE)
-    {
-        sprintf(temp, "APPLIED_DEPTH_SENSOR_LATENCY=%s",
-            GSF_UNKNOWN_PARAM_TEXT);
-    }
-    else if ((p->applied.depth_sensor_latency > GSF_MIN_PARAM) && (p->applied.depth_sensor_latency < GSF_MAX_PARAM))
-    {
-        sprintf(temp, "APPLIED_DEPTH_SENSOR_LATENCY=%+06.3f",
-            p->applied.depth_sensor_latency);
-    }
-    else
-    {
-        gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-        return (-1);
-    }
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return(-1);
-    }
-
-    /* The APPLIED_DEPTH_SENSOR_OFFSET parameter defines the x,y,z position
-     * offsets that have been applied
-     */
-    sprintf(temp, "APPLIED_DEPTH_SENSOR_OFFSET=");
-    if (p->applied.depth_sensor_x_offset == GSF_UNKNOWN_PARAM_VALUE)
-    {
-        sprintf (temp2, "%s,", GSF_UNKNOWN_PARAM_TEXT);
-    }
-    else if ((p->applied.depth_sensor_x_offset > GSF_MIN_PARAM) && (p->applied.depth_sensor_x_offset < GSF_MAX_PARAM))
-    {
-        sprintf (temp2, "%+06.2f,", p->applied.depth_sensor_x_offset);
-    }
-    else
-    {
-        gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-        return (-1);
-    }
-    strcat (temp, temp2);
-    if (p->applied.depth_sensor_y_offset == GSF_UNKNOWN_PARAM_VALUE)
-    {
-        sprintf (temp2, "%s,", GSF_UNKNOWN_PARAM_TEXT);
-    }
-    else if ((p->applied.depth_sensor_y_offset > GSF_MIN_PARAM) && (p->applied.depth_sensor_y_offset < GSF_MAX_PARAM))
-    {
-        sprintf (temp2, "%+06.2f,", p->applied.depth_sensor_y_offset);
-    }
-    else
-    {
-        gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-        return (-1);
-    }
-    strcat(temp, temp2);
-    if (p->applied.depth_sensor_z_offset == GSF_UNKNOWN_PARAM_VALUE)
-    {
-        sprintf(temp2, "%s", GSF_UNKNOWN_PARAM_TEXT);
-    }
-    else if ((p->applied.depth_sensor_z_offset > GSF_MIN_PARAM) && (p->applied.depth_sensor_z_offset < GSF_MAX_PARAM))
-    {
-        sprintf(temp2, "%+06.2f", p->applied.depth_sensor_z_offset);
-    }
-    else
-    {
-        gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-        return (-1);
-    }
-    strcat(temp, temp2);
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return(-1);
-    }
-
-    /* The APPLIED_RX_TRANSDUCER_OFFSET parameter is the x, y, z position
-     * offsets of the receiver array that have been applied
-     */
-    sprintf (temp, "APPLIED_RX_TRANSDUCER_OFFSET=");
-    if (num_rx == 1)
-    {
-        if (p->applied.rx_transducer_x_offset[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp2, "%s,", GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->applied.rx_transducer_x_offset[0] > GSF_MIN_PARAM) && (p->applied.rx_transducer_x_offset[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp2, "%+06.2f,", p->applied.rx_transducer_x_offset[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat (temp, temp2);
-        if (p->applied.rx_transducer_y_offset[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp2, "%s,", GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->applied.rx_transducer_y_offset[0] > GSF_MIN_PARAM) && (p->applied.rx_transducer_y_offset[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp2, "%+06.2f,", p->applied.rx_transducer_y_offset[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat (temp, temp2);
-        if (p->applied.rx_transducer_z_offset[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp2, "%s", GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->applied.rx_transducer_z_offset[0] > GSF_MIN_PARAM) && (p->applied.rx_transducer_z_offset[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp2, "%+06.2f", p->applied.rx_transducer_z_offset[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat (temp, temp2);
-    }
-    else if (num_rx == 2)
-    {
-        if (p->applied.rx_transducer_x_offset[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp2, "%s,", GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->applied.rx_transducer_x_offset[0] > GSF_MIN_PARAM) && (p->applied.rx_transducer_x_offset[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp2, "%+06.2f,", p->applied.rx_transducer_x_offset[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat (temp, temp2);
-        if (p->applied.rx_transducer_y_offset[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp2, "%s,", GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->applied.rx_transducer_y_offset[0] > GSF_MIN_PARAM) && (p->applied.rx_transducer_y_offset[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp2, "%+06.2f,", p->applied.rx_transducer_y_offset[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat (temp, temp2);
-        if (p->applied.rx_transducer_z_offset[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp2, "%s,", GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->applied.rx_transducer_z_offset[0] > GSF_MIN_PARAM) && (p->applied.rx_transducer_z_offset[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp2, "%+06.2f,", p->applied.rx_transducer_z_offset[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat (temp, temp2);
-        if (p->applied.rx_transducer_x_offset[1] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp2, "%s,", GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->applied.rx_transducer_x_offset[1] > GSF_MIN_PARAM) && (p->applied.rx_transducer_x_offset[1] < GSF_MAX_PARAM))
-        {
-            sprintf(temp2, "%+06.2f,", p->applied.rx_transducer_x_offset[1]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat (temp, temp2);
-        if (p->applied.rx_transducer_y_offset[1] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp2, "%s,", GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->applied.rx_transducer_y_offset[1] > GSF_MIN_PARAM) && (p->applied.rx_transducer_y_offset[1] < GSF_MAX_PARAM))
-        {
-            sprintf(temp2, "%+06.2f,", p->applied.rx_transducer_y_offset[1]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat (temp, temp2);
-        if (p->applied.rx_transducer_z_offset[1] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp2, "%s", GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->applied.rx_transducer_z_offset[1] > GSF_MIN_PARAM) && (p->applied.rx_transducer_z_offset[1] < GSF_MAX_PARAM))
-        {
-            sprintf(temp2, "%+06.2f", p->applied.rx_transducer_z_offset[1]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat (temp, temp2);
-    }
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return(-1);
-    }
-
-    /* The APPLIED_RX_TRANSDUCER_PITCH parameter is the receiver pitch offset that has been applied.
-     */
-    sprintf (temp, "APPLIED_RX_TRANSDUCER_PITCH_OFFSET=");
-    if (num_rx == 1)
-    {
-        if (p->applied.rx_transducer_pitch_offset[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp2, "%s", GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->applied.rx_transducer_pitch_offset[0] > GSF_MIN_PARAM) && (p->applied.rx_transducer_pitch_offset[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp2, "%+06.2f", p->applied.rx_transducer_pitch_offset[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat (temp, temp2);
-    }
-    else if (num_rx == 2)
-    {
-        if (p->applied.rx_transducer_pitch_offset[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp2, "%s,", GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->applied.rx_transducer_pitch_offset[0] > GSF_MIN_PARAM) && (p->applied.rx_transducer_pitch_offset[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp2, "%+06.2f,", p->applied.rx_transducer_pitch_offset[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat (temp, temp2);
-        if (p->applied.rx_transducer_pitch_offset[1] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp2, "%s", GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->applied.rx_transducer_pitch_offset[1] > GSF_MIN_PARAM) && (p->applied.rx_transducer_pitch_offset[1] < GSF_MAX_PARAM))
-        {
-            sprintf(temp2, "%+06.2f", p->applied.rx_transducer_pitch_offset[1]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat (temp, temp2);
-    }
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return(-1);
-    }
-
-    /* The APPLIED_RX_TRANSDUCER_ROLL parameter is the receiver roll offset that has been applied.
-     */
-    sprintf (temp, "APPLIED_RX_TRANSDUCER_ROLL_OFFSET=");
-    if (num_rx == 1)
-    {
-        if (p->applied.rx_transducer_roll_offset[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp2, "%s", GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->applied.rx_transducer_roll_offset[0] > GSF_MIN_PARAM) && (p->applied.rx_transducer_roll_offset[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp2, "%+06.2f", p->applied.rx_transducer_roll_offset[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat (temp, temp2);
-    }
-    else if (num_rx == 2)
-    {
-        if (p->applied.rx_transducer_roll_offset[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp2, "%s,", GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->applied.rx_transducer_roll_offset[0] > GSF_MIN_PARAM) && (p->applied.rx_transducer_roll_offset[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp2, "%+06.2f,", p->applied.rx_transducer_roll_offset[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat (temp, temp2);
-        if (p->applied.rx_transducer_roll_offset[1] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp2, "%s", GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->applied.rx_transducer_roll_offset[1] > GSF_MIN_PARAM) && (p->applied.rx_transducer_roll_offset[1] < GSF_MAX_PARAM))
-        {
-            sprintf(temp2, "%+06.2f", p->applied.rx_transducer_roll_offset[1]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat (temp, temp2);
-    }
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return(-1);
-    }
-
-    /* The APPLIED_RX_TRANSDUCER_HEADING_TO_APPLY parameter is the receiver heading offset that has been applied.
-     */
-    sprintf (temp, "APPLIED_RX_TRANSDUCER_HEADING_OFFSET=");
-    if (num_rx == 1)
-    {
-        if (p->applied.rx_transducer_heading_offset[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp2, "%s", GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->applied.rx_transducer_heading_offset[0] > GSF_MIN_PARAM) && (p->applied.rx_transducer_heading_offset[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp2, "%+06.2f", p->applied.rx_transducer_heading_offset[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat (temp, temp2);
-    }
-    else if (num_rx == 2)
-    {
-        if (p->applied.rx_transducer_heading_offset[0] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp2, "%s,", GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->applied.rx_transducer_heading_offset[0] > GSF_MIN_PARAM) && (p->applied.rx_transducer_heading_offset[0] < GSF_MAX_PARAM))
-        {
-            sprintf(temp2, "%+06.2f,", p->applied.rx_transducer_heading_offset[0]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat (temp, temp2);
-        if (p->applied.rx_transducer_heading_offset[1] == GSF_UNKNOWN_PARAM_VALUE)
-        {
-            sprintf(temp2, "%s", GSF_UNKNOWN_PARAM_TEXT);
-        }
-        else if ((p->applied.rx_transducer_heading_offset[1] > GSF_MIN_PARAM) && (p->applied.rx_transducer_heading_offset[1] < GSF_MAX_PARAM))
-        {
-            sprintf(temp2, "%+06.2f", p->applied.rx_transducer_heading_offset[1]);
-        }
-        else
-        {
-            gsfError = GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED;
-            return (-1);
-        }
-        strcat (temp, temp2);
-    }
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return(-1);
-    }
-
-    /******* end of the applied parameters *******/
-
-    /* The horizontal datum parameter defines the elipsoid to which the
-     * latitude longitude values are referenced.
-     */
-    switch (p->horizontal_datum)
-    {
-        case (GSF_H_DATUM_WGE):
-            sprintf(temp, "GEOID=WGS-84");
-            break;
-
-        default:
-            sprintf(temp, "GEOID=UNKNWN");
-            break;
-
-    }
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return(-1);
-    }
-
-    /* The TIDAL_DATUM paremeter defines the reference datum for tide
-     * corrections. See gsf.h for definitions.
-     */
-    switch (p->vertical_datum)
-    {
-        case (GSF_V_DATUM_MLLW):
-            sprintf(temp, "TIDAL_DATUM=MLLW   ");
-            break;
-
-        case (GSF_V_DATUM_MLW):
-            sprintf(temp, "TIDAL_DATUM=MLW    ");
-            break;
-
-        case (GSF_V_DATUM_ALAT):
-             sprintf(temp, "TIDAL_DATUM=ALAT  ");
-             break;
-
-        case (GSF_V_DATUM_ESLW):
-             sprintf(temp, "TIDAL_DATUM=ESLW  ");
-             break;
-
-        case (GSF_V_DATUM_ISLW):
-             sprintf(temp, "TIDAL_DATUM=ISLW  ");
-             break;
-
-        case (GSF_V_DATUM_LAT):
-             sprintf(temp, "TIDAL_DATUM=LAT   ");
-             break;
-
-        case (GSF_V_DATUM_LLW):
-             sprintf(temp, "TIDAL_DATUM=LLW   ");
-             break;
-
-        case (GSF_V_DATUM_LNLW):
-             sprintf(temp, "TIDAL_DATUM=LNLW  ");
-             break;
-
-        case (GSF_V_DATUM_LWD):
-             sprintf(temp, "TIDAL_DATUM=LWD   ");
-             break;
-
-        case (GSF_V_DATUM_MLHW):
-             sprintf(temp, "TIDAL_DATUM=MLHW  ");
-             break;
-
-        case (GSF_V_DATUM_MLLWS):
-             sprintf(temp, "TIDAL_DATUM=MLLWS ");
-             break;
-
-        case (GSF_V_DATUM_MLWN):
-             sprintf(temp, "TIDAL_DATUM=MLWN  ");
-             break;
-
-        case (GSF_V_DATUM_MSL):
-             sprintf(temp, "TIDAL_DATUM=MSL   ");
-             break;
-
-        default:
-            sprintf(temp, "TIDAL_DATUM=UNKNOWN");
-            break;
-    }
-    ret = gsfSetParam(handle, number_parameters++, temp, rec);
-    if (ret)
-    {
-        return(-1);
-    }
-
-    rec->process_parameters.number_parameters = number_parameters;
-
-    return(0);
-}
-
-/********************************************************************
- *
- * Function Name : gsfGetMBParams
- *
- * Description : This function moves swath bathymetry sonar processing
- *    parameters from external, form to internal form.  The external
- *    "KEYWORD=VALUE" format parameters are read from a processing_params
- *    structure of a gsfRecords data structure maintained by the caller.
- *    The internal form parameters are written into a gsfMBParams data
- *    structure maintained by the caller. Parameters for up to two pairs of
- *    transmit/receive arrays are supported, for systems such as Reson SeaBat
- *    9002.  Any parameter not described in a "KEYWORD=VALUE" format will
- *    be set to "GSF_UNKNOWN_PARAM_VALUE".
- *
- * Inputs :
- *     rec = a pointer to the gsfRecords data structure from which the
- *         parameters in "KEYWORK=VALUE" form are to be read.
- *     p = a pointer to the gsfMBParams data structure which will be populated.
- *     numArrays = the integer value specifying the number of pairs of
- *         arrays which need to have seperate parameters tracked.
- *
- * Returns : This function returns zero if successful, or -1 if an error
- *  occurs.
- *
- * Error Conditions :
- *  none.
- *
- ********************************************************************/
-int
-gsfGetMBParams(const gsfRecords *rec, gsfMBParams *p, int *numArrays)
-{
-    int i;
-    char str[64];
-    int num_tx = 0, num_rx = 0;
-
-    gsfInitializeMBParams (p);   /* set everything to "unknown" */
-    /* Set this value to zero in case we can't determine it */
-    *numArrays = 0;
-
-    for (i=0; i<rec->process_parameters.number_parameters; i++)
-    {
-        if (strncmp(rec->process_parameters.param[i], "REFERENCE TIME", strlen("REFERENCE TIME")) == 0)
-        {
-            memset(p->start_of_epoch, 0, sizeof(p->start_of_epoch));
-            strncpy(p->start_of_epoch, rec->process_parameters.param[i], sizeof(p->start_of_epoch));
-        }
-
-        /* DHG 2008/12/18 Add "PLATFORM_TYPE" */
-
-        else if (strncmp (rec->process_parameters.param[i], "PLATFORM_TYPE", strlen ("PLATFORM_TYPE")) == 0)
-        {
-            if (strstr(rec->process_parameters.param[i], "AUV"))
-            {
-                p->vessel_type = GSF_PLATFORM_TYPE_AUV;
-            }
-            if (strstr(rec->process_parameters.param[i], "SURFACE_SHIP"))
-            {
-                p->vessel_type = GSF_PLATFORM_TYPE_SURFACE_SHIP;
-            }
-            if (strstr(rec->process_parameters.param[i], "ROTV"))
-            {
-                p->vessel_type = GSF_PLATFORM_TYPE_ROTV;
-            }
-        }
-
-        else if (strncmp (rec->process_parameters.param[i], "FULL_RAW_DATA", strlen ("FULL_RAW_DATA")) == 0)
-        {
-            if (strstr(rec->process_parameters.param[i], "TRUE"))
-            {
-                p->full_raw_data = GSF_TRUE;
-            }
-            else
-            {
-                p->full_raw_data = GSF_FALSE;
-            }
-        }
-
-        else if (strncmp(rec->process_parameters.param[i], "ROLL_COMPENSATED", strlen("ROLL_COMPENSATED")) == 0)
-        {
-            if (strstr(rec->process_parameters.param[i], "YES"))
-            {
-                p->roll_compensated = GSF_COMPENSATED;
-            }
-            else
-            {
-                p->roll_compensated = GSF_UNCOMPENSATED;
-            }
-        }
-        else if (strncmp(rec->process_parameters.param[i], "PITCH_COMPENSATED", strlen("PITCH_COMPENSATED")) == 0)
-        {
-            if (strstr(rec->process_parameters.param[i], "YES"))
-            {
-                p->pitch_compensated = GSF_COMPENSATED;
-            }
-            else
-            {
-                p->pitch_compensated = GSF_UNCOMPENSATED;
-            }
-        }
-        else if (strncmp(rec->process_parameters.param[i], "HEAVE_COMPENSATED", strlen("HEAVE_COMPENSATED")) == 0)
-        {
-            if (strstr(rec->process_parameters.param[i], "YES"))
-            {
-                p->heave_compensated = GSF_COMPENSATED;
-            }
-            else
-            {
-                p->heave_compensated = GSF_UNCOMPENSATED;
-            }
-        }
-        else if (strncmp(rec->process_parameters.param[i], "TIDE_COMPENSATED", strlen("TIDE_COMPENSATED")) == 0)
-        {
-            if (strstr(rec->process_parameters.param[i], "YES"))
-            {
-                p->tide_compensated = GSF_COMPENSATED;
-            }
-            else
-            {
-                p->tide_compensated = GSF_UNCOMPENSATED;
-            }
-        }
-        else if (strncmp(rec->process_parameters.param[i], "NUMBER_OF_TRANSMITTERS", strlen("NUMBER_OF_TRANSMITTERS")) == 0)
-        {
-            sscanf (rec->process_parameters.param[i], "NUMBER_OF_TRANSMITTERS=%s", str);
-            if ((atoi(str) >= 1) && (atoi(str) <= GSF_MAX_OFFSETS))
-            {
-                p->number_of_transmitters = atoi(str);
-                num_tx = p->number_of_transmitters;
-            }
-            else
-            {
-                p->number_of_transmitters = GSF_UNKNOWN_PARAM_INT;
-            }
-        }
-        else if (strncmp(rec->process_parameters.param[i], "NUMBER_OF_RECEIVERS", strlen("NUMBER_OF_RECEIVERS")) == 0)
-        {
-            sscanf (rec->process_parameters.param[i], "NUMBER_OF_RECEIVERS=%s", str);
-            if ((atoi(str) >= 1) && (atoi(str) <= GSF_MAX_OFFSETS))
-            {
-                p->number_of_receivers = atoi(str);
-                num_rx = p->number_of_receivers;
-            }
-            else
-            {
-                p->number_of_receivers = GSF_UNKNOWN_PARAM_INT;
-            }
-        }
-        else if (strncmp(rec->process_parameters.param[i], "DEPTH_CALCULATION", strlen("DEPTH_CALCULATION")) == 0)
-        {
-            sscanf (rec->process_parameters.param[i], "DEPTH_CALCULATION=%s", str);
-            if (strcmp(str, "CORRECTED") == 0)
-            {
-                p->depth_calculation = GSF_TRUE_DEPTHS;
-            }
-            else if (strcmp(str, "CALCULATED_RE_1500_MS") == 0)
-            {
-                p->depth_calculation = GSF_DEPTHS_RE_1500_MS;
-            }
-            else
-            {
-                p->depth_calculation = GSF_DEPTH_CALC_UNKNOWN;
-            }
-        }
-
-        /* This parameter indicates whether the angle travel time
-         * pairs have been corrected for ray tracing.
-         */
-        else if (strncmp(rec->process_parameters.param[i], "RAY_TRACING", strlen("RAY_TRACING")) == 0)
-        {
-            sscanf (rec->process_parameters.param[i], "RAY_TRACING=%s", str);
-            if (strcmp(str, "YES") == 0)
-            {
-                p->ray_tracing = GSF_COMPENSATED;
-            }
-            else
-            {
-                p->ray_tracing = GSF_UNCOMPENSATED;
-            }
-        }
-
-        else if (strncmp(rec->process_parameters.param[i], "MSB_APPLIED_TO_ATTITUDE", strlen("MSB_APPLIED_TO_ATTITUDE")) == 0)
-        {
-            sscanf (rec->process_parameters.param[i], "MSB_APPLIED_TO_ATTITUDE=%s", str);
-            if (strcmp(str, "YES") == 0)
-            {
-                p->msb_applied_to_attitude = GSF_TRUE;
-            }
-            else
-            {
-                p->msb_applied_to_attitude = GSF_FALSE;
-            }
-        }
-
-        else if (strncmp(rec->process_parameters.param[i], "HEAVE_REMOVED_FROM_GPS_TC", strlen("HEAVE_REMOVED_FROM_GPS_TC")) == 0)
-        {
-            sscanf (rec->process_parameters.param[i], "HEAVE_REMOVED_FROM_GPS_TC=%s", str);
-            if (strcmp(str, "YES") == 0)
-            {
-                p->heave_removed_from_gps_tc = GSF_TRUE;
-            }
-            else
-            {
-                p->heave_removed_from_gps_tc = GSF_FALSE;
-            }
-        }
-
-        else if (strncmp(rec->process_parameters.param[i], "UTC_OFFSET", strlen("UTC_OFFSET")) == 0)
-        {
-            sscanf (rec->process_parameters.param[i], "UTC_OFFSET=%s", str);
-            if ((abs(atoi(str)) >= 0) && (abs(atoi(str)) <= 12))
-            {
-                p->utc_offset = atoi(str);
-            }
-            else
-            {
-                p->utc_offset = GSF_UNKNOWN_PARAM_INT;
-            }
-        }
-
-        else if (strncmp(rec->process_parameters.param[i], "ROLL_REFERENCE", strlen("ROLL_REFERENCE")) == 0)
-        {
-            sscanf (rec->process_parameters.param[i], "ROLL_REFERENCE=%s", str);
-            if (strcmp(str, "HORIZONTAL_PITCH_AXIS") == 0)
-            {
-                p->roll_reference = GSF_HORIZONTAL_PITCH_AXIS;
-            }
-            else if (strcmp(str, "ROTATED_PITCH_AXIS") == 0)
-            {
-                p->roll_reference = GSF_ROTATED_PITCH_AXIS;
-            }
-            else
-            {
-                p->roll_reference = GSF_UNKNOWN_PARAM_INT;
-            }
-        }
-
-
-        else if (strncmp(rec->process_parameters.param[i], "DRAFT_TO_APPLY", strlen("DRAFT_TO_APPLY")) == 0)
-        {
-            p->to_apply.draft[0] = GSF_UNKNOWN_PARAM_VALUE;
-            p->to_apply.draft[1] = GSF_UNKNOWN_PARAM_VALUE;
-            if (!strstr(rec->process_parameters.param[i], GSF_UNKNOWN_PARAM_TEXT))
-            {
-                sscanf (rec->process_parameters.param[i], "DRAFT_TO_APPLY=%lf,%lf",
-                    &p->to_apply.draft[0],
-                    &p->to_apply.draft[1]);
-            }
-            /* Get the number of array pairs from each sonar alignment parameter */
-            *numArrays = gsfNumberParams(rec->process_parameters.param[i]);
-            if (!num_tx)
-                num_tx = *numArrays;
-        }
-        else if (strncmp(rec->process_parameters.param[i], "PITCH_TO_APPLY", strlen("PITCH_TO_APPLY")) == 0)
-        {
-            p->to_apply.pitch_bias[0] = GSF_UNKNOWN_PARAM_VALUE;
-            p->to_apply.pitch_bias[1] = GSF_UNKNOWN_PARAM_VALUE;
-            if (!strstr(rec->process_parameters.param[i], GSF_UNKNOWN_PARAM_TEXT))
-            {
-                sscanf (rec->process_parameters.param[i], "PITCH_TO_APPLY=%lf,%lf",
-                    &p->to_apply.pitch_bias[0],
-                    &p->to_apply.pitch_bias[1]);
-            }
-            /* Get the number of array pairs from each sonar alignment parameter */
-            *numArrays = gsfNumberParams(rec->process_parameters.param[i]);
-            if (!num_tx)
-                num_tx = *numArrays;
-        }
-        else if (strncmp(rec->process_parameters.param[i], "ROLL_TO_APPLY", strlen("ROLL_TO_APPLY")) == 0)
-        {
-            p->to_apply.roll_bias[0] = GSF_UNKNOWN_PARAM_VALUE;
-            p->to_apply.roll_bias[1] = GSF_UNKNOWN_PARAM_VALUE;
-            if (!strstr(rec->process_parameters.param[i], GSF_UNKNOWN_PARAM_TEXT))
-            {
-                sscanf (rec->process_parameters.param[i], "ROLL_TO_APPLY=%lf,%lf",
-                    &p->to_apply.roll_bias[0],
-                    &p->to_apply.roll_bias[1]);
-            }
-            /* Get the number of array pairs from each sonar alignment parameter */
-            *numArrays = gsfNumberParams(rec->process_parameters.param[i]);
-            if (!num_tx)
-                num_tx = *numArrays;
-        }
-        else if (strncmp(rec->process_parameters.param[i], "GYRO_TO_APPLY", strlen("GYRO_TO_APPLY")) == 0)
-        {
-            p->to_apply.gyro_bias[0] = GSF_UNKNOWN_PARAM_VALUE;
-            p->to_apply.gyro_bias[1] = GSF_UNKNOWN_PARAM_VALUE;
-            if (!strstr(rec->process_parameters.param[i], GSF_UNKNOWN_PARAM_TEXT))
-            {
-                sscanf (rec->process_parameters.param[i], "GYRO_TO_APPLY=%lf,%lf",
-                    &p->to_apply.gyro_bias[0],
-                    &p->to_apply.gyro_bias[1]);
-            }
-            /* Get the number of array pairs from each sonar alignment parameter */
-            *numArrays = gsfNumberParams(rec->process_parameters.param[i]);
-            if (!num_tx)
-                num_tx = *numArrays;
-        }
-        /* The POSITION_OFFSET_TO_APPLY parameter is place holder for a known,
-         * but presently uncorrected position reference offset. The string
-         * contains an x,y,z triplet which defines the location on the
-         * vessel to which the latitude and longitude are relative.
-         */
-        else if (strncmp(rec->process_parameters.param[i], "POSITION_OFFSET_TO_APPLY", strlen("POSITION_OFFSET_TO_APPLY")) == 0)
-        {
-            p->to_apply.position_x_offset = GSF_UNKNOWN_PARAM_VALUE;
-            p->to_apply.position_y_offset = GSF_UNKNOWN_PARAM_VALUE;
-            p->to_apply.position_z_offset = GSF_UNKNOWN_PARAM_VALUE;
-            if (!strstr(rec->process_parameters.param[i], GSF_UNKNOWN_PARAM_TEXT))
-            {
-                sscanf (rec->process_parameters.param[i], "POSITION_OFFSET_TO_APPLY=%lf,%lf,%lf",
-                    &p->to_apply.position_x_offset,
-                    &p->to_apply.position_y_offset,
-                    &p->to_apply.position_z_offset);
-            }
-        }
-        else if (strncmp(rec->process_parameters.param[i], "TRANSDUCER_OFFSET_TO_APPLY", strlen("TRANSDUCER_OFFSET_TO_APPLY")) == 0)
-        {
-            p->to_apply.transducer_x_offset[0] = GSF_UNKNOWN_PARAM_VALUE;
-            p->to_apply.transducer_y_offset[0] = GSF_UNKNOWN_PARAM_VALUE;
-            p->to_apply.transducer_z_offset[0] = GSF_UNKNOWN_PARAM_VALUE;
-            p->to_apply.transducer_x_offset[1] = GSF_UNKNOWN_PARAM_VALUE;
-            p->to_apply.transducer_y_offset[1] = GSF_UNKNOWN_PARAM_VALUE;
-            p->to_apply.transducer_z_offset[1] = GSF_UNKNOWN_PARAM_VALUE;
-            if (!strstr(rec->process_parameters.param[i], GSF_UNKNOWN_PARAM_TEXT))
-            {
-                sscanf (rec->process_parameters.param[i], "TRANSDUCER_OFFSET_TO_APPLY=%lf,%lf,%lf,%lf,%lf,%lf",
-                    &p->to_apply.transducer_x_offset[0],
-                    &p->to_apply.transducer_y_offset[0],
-                    &p->to_apply.transducer_z_offset[0],
-                    &p->to_apply.transducer_x_offset[1],
-                    &p->to_apply.transducer_y_offset[1],
-                    &p->to_apply.transducer_z_offset[1]);
-            }
-        }
-        else if (strncmp(rec->process_parameters.param[i], "TRANSDUCER_PITCH_OFFSET_TO_APPLY", strlen("TRANSDUCER_PITCH_OFFSET_TO_APPLY")) == 0)
-        {
-            p->to_apply.transducer_pitch_offset[0] = GSF_UNKNOWN_PARAM_VALUE;
-            p->to_apply.transducer_pitch_offset[1] = GSF_UNKNOWN_PARAM_VALUE;
-            if (!strstr(rec->process_parameters.param[i], GSF_UNKNOWN_PARAM_TEXT))
-            {
-                sscanf (rec->process_parameters.param[i], "TRANSDUCER_PITCH_OFFSET_TO_APPLY=%lf,%lf",
-                    &p->to_apply.transducer_pitch_offset[0],
-                    &p->to_apply.transducer_pitch_offset[1]);
-            }
-            /* Get the number of array pairs from each sonar alignment parameter */
-            *numArrays = gsfNumberParams(rec->process_parameters.param[i]);
-            if (!num_tx)
-                num_tx = *numArrays;
-        }
-        else if (strncmp(rec->process_parameters.param[i], "TRANSDUCER_ROLL_OFFSET_TO_APPLY", strlen("TRANSDUCER_ROLL_OFFSET_TO_APPLY")) == 0)
-        {
-            p->to_apply.transducer_roll_offset[0] = GSF_UNKNOWN_PARAM_VALUE;
-            p->to_apply.transducer_roll_offset[1] = GSF_UNKNOWN_PARAM_VALUE;
-            if (!strstr(rec->process_parameters.param[i], GSF_UNKNOWN_PARAM_TEXT))
-            {
-                sscanf (rec->process_parameters.param[i], "TRANSDUCER_ROLL_OFFSET_TO_APPLY=%lf,%lf",
-                    &p->to_apply.transducer_roll_offset[0],
-                    &p->to_apply.transducer_roll_offset[1]);
-            }
-            /* Get the number of array pairs from each sonar alignment parameter */
-            *numArrays = gsfNumberParams(rec->process_parameters.param[i]);
-            if (!num_tx)
-                num_tx = *numArrays;
-        }
-        else if (strncmp(rec->process_parameters.param[i], "TRANSDUCER_HEADING_OFFSET_TO_APPLY", strlen("TRANSDUCER_HEADING_OFFSET_TO_APPLY")) == 0)
-        {
-            p->to_apply.transducer_heading_offset[0] = GSF_UNKNOWN_PARAM_VALUE;
-            p->to_apply.transducer_heading_offset[1] = GSF_UNKNOWN_PARAM_VALUE;
-            if (!strstr(rec->process_parameters.param[i], GSF_UNKNOWN_PARAM_TEXT))
-            {
-                sscanf (rec->process_parameters.param[i], "TRANSDUCER_HEADING_OFFSET_TO_APPLY=%lf,%lf",
-                    &p->to_apply.transducer_heading_offset[0],
-                    &p->to_apply.transducer_heading_offset[1]);
-            }
-            /* Get the number of array pairs from each sonar alignment parameter */
-            *numArrays = gsfNumberParams(rec->process_parameters.param[i]);
-            if (!num_tx)
-                num_tx = *numArrays;
-        }
-        else if (strncmp(rec->process_parameters.param[i], "MRU_PITCH_TO_APPLY", strlen("MRU_PITCH_TO_APPLY")) == 0)
-        {
-            p->to_apply.mru_pitch_bias = GSF_UNKNOWN_PARAM_VALUE;
-            if (!strstr(rec->process_parameters.param[i], GSF_UNKNOWN_PARAM_TEXT))
-            {
-                sscanf (rec->process_parameters.param[i], "MRU_PITCH_TO_APPLY=%lf",
-                    &p->to_apply.mru_pitch_bias);
-            }
-        }
-        else if (strncmp(rec->process_parameters.param[i], "MRU_ROLL_TO_APPLY", strlen("MRU_ROLL_TO_APPLY")) == 0)
-        {
-            p->to_apply.mru_roll_bias = GSF_UNKNOWN_PARAM_VALUE;
-            if (!strstr(rec->process_parameters.param[i], GSF_UNKNOWN_PARAM_TEXT))
-            {
-                sscanf (rec->process_parameters.param[i], "MRU_ROLL_TO_APPLY=%lf",
-                    &p->to_apply.mru_roll_bias);
-            }
-        }
-        else if (strncmp(rec->process_parameters.param[i], "MRU_HEADING_TO_APPLY", strlen("MRU_HEADING_TO_APPLY")) == 0)
-        {
-            p->to_apply.mru_heading_bias = GSF_UNKNOWN_PARAM_VALUE;
-            if (!strstr(rec->process_parameters.param[i], GSF_UNKNOWN_PARAM_TEXT))
-            {
-                sscanf (rec->process_parameters.param[i], "MRU_HEADING_TO_APPLY=%lf",
-                    &p->to_apply.mru_heading_bias);
-            }
-        }
-        else if (strncmp(rec->process_parameters.param[i], "MRU_OFFSET_TO_APPLY", strlen("MRU_OFFSET_TO_APPLY")) == 0)
-        {
-            p->to_apply.mru_x_offset = GSF_UNKNOWN_PARAM_VALUE;
-            p->to_apply.mru_y_offset = GSF_UNKNOWN_PARAM_VALUE;
-            p->to_apply.mru_z_offset = GSF_UNKNOWN_PARAM_VALUE;
-            if (!strstr(rec->process_parameters.param[i], GSF_UNKNOWN_PARAM_TEXT))
-            {
-                sscanf (rec->process_parameters.param[i], "MRU_OFFSET_TO_APPLY=%lf,%lf,%lf",
-                    &p->to_apply.mru_x_offset,
-                    &p->to_apply.mru_y_offset,
-                    &p->to_apply.mru_z_offset);
-            }
-        }
-        else if (strncmp(rec->process_parameters.param[i], "ANTENNA_OFFSET_TO_APPLY", strlen("ANTENNA_OFFSET_TO_APPLY")) == 0)
-        {
-            p->to_apply.antenna_x_offset = GSF_UNKNOWN_PARAM_VALUE;
-            p->to_apply.antenna_y_offset = GSF_UNKNOWN_PARAM_VALUE;
-            p->to_apply.antenna_z_offset = GSF_UNKNOWN_PARAM_VALUE;
-            if (!strstr(rec->process_parameters.param[i], GSF_UNKNOWN_PARAM_TEXT))
-            {
-                sscanf (rec->process_parameters.param[i], "ANTENNA_OFFSET_TO_APPLY=%lf,%lf,%lf",
-                    &p->to_apply.antenna_x_offset,
-                    &p->to_apply.antenna_y_offset,
-                    &p->to_apply.antenna_z_offset);
-            }
-        }
-        else if (strncmp(rec->process_parameters.param[i], "CENTER_OF_ROTATION_OFFSET_TO_APPLY", strlen("CENTER_OF_ROTATION_OFFSET_TO_APPLY")) == 0)
-        {
-            p->to_apply.center_of_rotation_x_offset = GSF_UNKNOWN_PARAM_VALUE;
-            p->to_apply.center_of_rotation_y_offset = GSF_UNKNOWN_PARAM_VALUE;
-            p->to_apply.center_of_rotation_z_offset = GSF_UNKNOWN_PARAM_VALUE;
-            if (!strstr(rec->process_parameters.param[i], GSF_UNKNOWN_PARAM_TEXT))
-            {
-                sscanf (rec->process_parameters.param[i], "CENTER_OF_ROTATION_OFFSET_TO_APPLY=%lf,%lf,%lf",
-                    &p->to_apply.center_of_rotation_x_offset,
-                    &p->to_apply.center_of_rotation_y_offset,
-                    &p->to_apply.center_of_rotation_z_offset);
-            }
-        }
-        else if (strncmp(rec->process_parameters.param[i], "POSITION_LATENCY_TO_APPLY", strlen("POSITION_LATENCY_TO_APPLY")) == 0)
-        {
-            p->to_apply.position_latency = GSF_UNKNOWN_PARAM_VALUE;
-            if (!strstr(rec->process_parameters.param[i], GSF_UNKNOWN_PARAM_TEXT))
-            {
-                sscanf (rec->process_parameters.param[i], "POSITION_LATENCY_TO_APPLY=%lf",
-                    &p->to_apply.position_latency);
-            }
-        }
-        else if (strncmp(rec->process_parameters.param[i], "ATTITUDE_LATENCY_TO_APPLY", strlen("ATTITUDE_LATENCY_TO_APPLY")) == 0)
-        {
-            p->to_apply.attitude_latency = GSF_UNKNOWN_PARAM_VALUE;
-            if (!strstr(rec->process_parameters.param[i], GSF_UNKNOWN_PARAM_TEXT))
-            {
-                sscanf (rec->process_parameters.param[i], "ATTITUDE_LATENCY_TO_APPLY=%lf",
-                    &p->to_apply.attitude_latency);
-            }
-        }
-        else if (strncmp(rec->process_parameters.param[i], "DEPTH_SENSOR_LATENCY_TO_APPLY", strlen("DEPTH_SENSOR_LATENCY_TO_APPLY")) == 0)
-        {
-            p->to_apply.depth_sensor_latency = GSF_UNKNOWN_PARAM_VALUE;
-            if (!strstr(rec->process_parameters.param[i], GSF_UNKNOWN_PARAM_TEXT))
-            {
-                sscanf (rec->process_parameters.param[i], "DEPTH_SENSOR_LATENCY_TO_APPLY=%lf",
-                    &p->to_apply.depth_sensor_latency);
-            }
-        }
-        else if (strncmp(rec->process_parameters.param[i], "DEPTH_SENSOR_OFFSET_TO_APPLY", strlen("DEPTH_SENSOR_OFFSET_TO_APPLY")) == 0)
-        {
-            p->to_apply.depth_sensor_x_offset = GSF_UNKNOWN_PARAM_VALUE;
-            p->to_apply.depth_sensor_y_offset = GSF_UNKNOWN_PARAM_VALUE;
-            p->to_apply.depth_sensor_z_offset = GSF_UNKNOWN_PARAM_VALUE;
-            if (!strstr(rec->process_parameters.param[i], GSF_UNKNOWN_PARAM_TEXT))
-            {
-                sscanf (rec->process_parameters.param[i], "DEPTH_SENSOR_OFFSET_TO_APPLY=%lf,%lf,%lf",
-                    &p->to_apply.depth_sensor_x_offset,
-                    &p->to_apply.depth_sensor_y_offset,
-                    &p->to_apply.depth_sensor_z_offset);
-            }
-        }
-        else if (strncmp(rec->process_parameters.param[i], "RX_TRANSDUCER_OFFSET_TO_APPLY", strlen("RX_TRANSDUCER_OFFSET_TO_APPLY")) == 0)
-        {
-            p->to_apply.rx_transducer_x_offset[0] = GSF_UNKNOWN_PARAM_VALUE;
-            p->to_apply.rx_transducer_y_offset[0] = GSF_UNKNOWN_PARAM_VALUE;
-            p->to_apply.rx_transducer_z_offset[0] = GSF_UNKNOWN_PARAM_VALUE;
-            p->to_apply.rx_transducer_x_offset[1] = GSF_UNKNOWN_PARAM_VALUE;
-            p->to_apply.rx_transducer_y_offset[1] = GSF_UNKNOWN_PARAM_VALUE;
-            p->to_apply.rx_transducer_z_offset[1] = GSF_UNKNOWN_PARAM_VALUE;
-            if (!strstr(rec->process_parameters.param[i], GSF_UNKNOWN_PARAM_TEXT))
-            {
-                sscanf (rec->process_parameters.param[i], "RX_TRANSDUCER_OFFSET_TO_APPLY=%lf,%lf,%lf,%lf,%lf,%lf",
-                    &p->to_apply.rx_transducer_x_offset[0],
-                    &p->to_apply.rx_transducer_y_offset[0],
-                    &p->to_apply.rx_transducer_z_offset[0],
-                    &p->to_apply.rx_transducer_x_offset[1],
-                    &p->to_apply.rx_transducer_y_offset[1],
-                    &p->to_apply.rx_transducer_z_offset[1]);
-            }
-        }
-        else if (strncmp(rec->process_parameters.param[i], "RX_TRANSDUCER_PITCH_OFFSET_TO_APPLY", strlen("RX_TRANSDUCER_PITCH_OFFSET_TO_APPLY")) == 0)
-        {
-            p->to_apply.rx_transducer_pitch_offset[0] = GSF_UNKNOWN_PARAM_VALUE;
-            p->to_apply.rx_transducer_pitch_offset[1] = GSF_UNKNOWN_PARAM_VALUE;
-            if (!strstr(rec->process_parameters.param[i], GSF_UNKNOWN_PARAM_TEXT))
-            {
-                sscanf (rec->process_parameters.param[i], "RX_TRANSDUCER_PITCH_OFFSET_TO_APPLY=%lf,%lf",
-                    &p->to_apply.rx_transducer_pitch_offset[0],
-                    &p->to_apply.rx_transducer_pitch_offset[1]);
-            }
-            if (!num_rx)
-                num_rx = gsfNumberParams(rec->process_parameters.param[i]);
-        }
-        else if (strncmp(rec->process_parameters.param[i], "RX_TRANSDUCER_ROLL_OFFSET_TO_APPLY", strlen("RX_TRANSDUCER_ROLL_OFFSET_TO_APPLY")) == 0)
-        {
-            p->to_apply.rx_transducer_roll_offset[0] = GSF_UNKNOWN_PARAM_VALUE;
-            p->to_apply.rx_transducer_roll_offset[1] = GSF_UNKNOWN_PARAM_VALUE;
-            if (!strstr(rec->process_parameters.param[i], GSF_UNKNOWN_PARAM_TEXT))
-            {
-                sscanf (rec->process_parameters.param[i], "RX_TRANSDUCER_ROLL_OFFSET_TO_APPLY=%lf,%lf",
-                    &p->to_apply.rx_transducer_roll_offset[0],
-                    &p->to_apply.rx_transducer_roll_offset[1]);
-            }
-            if (!num_rx)
-                num_rx = gsfNumberParams(rec->process_parameters.param[i]);
-        }
-        else if (strncmp(rec->process_parameters.param[i], "RX_TRANSDUCER_HEADING_OFFSET_TO_APPLY", strlen("RX_TRANSDUCER_HEADING_OFFSET_TO_APPLY")) == 0)
-        {
-            p->to_apply.rx_transducer_heading_offset[0] = GSF_UNKNOWN_PARAM_VALUE;
-            p->to_apply.rx_transducer_heading_offset[1] = GSF_UNKNOWN_PARAM_VALUE;
-            if (!strstr(rec->process_parameters.param[i], GSF_UNKNOWN_PARAM_TEXT))
-            {
-                sscanf (rec->process_parameters.param[i], "RX_TRANSDUCER_HEADING_OFFSET_TO_APPLY=%lf,%lf",
-                    &p->to_apply.rx_transducer_heading_offset[0],
-                    &p->to_apply.rx_transducer_heading_offset[1]);
-            }
-            if (!num_rx)
-                num_rx = gsfNumberParams(rec->process_parameters.param[i]);
-        }  /** end of "to apply" values */
-        else if (strncmp(rec->process_parameters.param[i], "APPLIED_DRAFT", strlen("APPLIED_DRAFT")) == 0)
-        {
-            p->applied.draft[0] = GSF_UNKNOWN_PARAM_VALUE;
-            p->applied.draft[1] = GSF_UNKNOWN_PARAM_VALUE;
-            if (!strstr(rec->process_parameters.param[i], GSF_UNKNOWN_PARAM_TEXT))
-            {
-                sscanf (rec->process_parameters.param[i], "APPLIED_DRAFT=%lf,%lf",
-                    &p->applied.draft[0],
-                    &p->applied.draft[1]);
-            }
-            /* Get the number of array pairs from each sonar alignment parameter */
-            *numArrays = gsfNumberParams(rec->process_parameters.param[i]);
-            if (!num_tx)
-                num_tx = *numArrays;
-        }
-        else if (strncmp(rec->process_parameters.param[i], "APPLIED_PITCH_BIAS", strlen("APPLIED_PITCH_BIAS")) == 0)
-        {
-            p->applied.pitch_bias[0] = GSF_UNKNOWN_PARAM_VALUE;
-            p->applied.pitch_bias[1] = GSF_UNKNOWN_PARAM_VALUE;
-            if (!strstr(rec->process_parameters.param[i], GSF_UNKNOWN_PARAM_TEXT))
-            {
-                sscanf (rec->process_parameters.param[i], "APPLIED_PITCH_BIAS=%lf,%lf",
-                    &p->applied.pitch_bias[0],
-                    &p->applied.pitch_bias[1]);
-            }
-            /* Get the number of array pairs from each sonar alignment parameter */
-            *numArrays = gsfNumberParams(rec->process_parameters.param[i]);
-            if (!num_tx)
-                num_tx = *numArrays;
-        }
-        else if (strncmp(rec->process_parameters.param[i], "APPLIED_ROLL_BIAS", strlen("APPLIED_ROLL_BIAS")) == 0)
-        {
-            p->applied.roll_bias[0] = GSF_UNKNOWN_PARAM_VALUE;
-            p->applied.roll_bias[1] = GSF_UNKNOWN_PARAM_VALUE;
-            if (!strstr(rec->process_parameters.param[i], GSF_UNKNOWN_PARAM_TEXT))
-            {
-                sscanf (rec->process_parameters.param[i], "APPLIED_ROLL_BIAS=%lf,%lf",
-                    &p->applied.roll_bias[0],
-                    &p->applied.roll_bias[1]);
-            }
-            /* Get the number of array pairs from each sonar alignment parameter */
-            *numArrays = gsfNumberParams(rec->process_parameters.param[i]);
-            if (!num_tx)
-                num_tx = *numArrays;
-        }
-        else if (strncmp(rec->process_parameters.param[i], "APPLIED_GYRO_BIAS", strlen("APPLIED_GYRO_BIAS")) == 0)
-        {
-            p->applied.gyro_bias[0] = GSF_UNKNOWN_PARAM_VALUE;
-            p->applied.gyro_bias[1] = GSF_UNKNOWN_PARAM_VALUE;
-            if (!strstr(rec->process_parameters.param[i], GSF_UNKNOWN_PARAM_TEXT))
-            {
-                sscanf (rec->process_parameters.param[i], "APPLIED_GYRO_BIAS=%lf,%lf",
-                    &p->applied.gyro_bias[0],
-                    &p->applied.gyro_bias[1]);
-            }
-            /* Get the number of array pairs from each sonar alignment parameter */
-            *numArrays = gsfNumberParams(rec->process_parameters.param[i]);
-            if (!num_tx)
-                num_tx = *numArrays;
-        }
-        /* The APPLIED_POSITION_OFFSET parameter defines the x,y,z position in
-         * ship coordinates to which the lat lons are relative.
-         */
-         else if (strncmp(rec->process_parameters.param[i], "APPLIED_POSITION_OFFSET", strlen("APPLIED_POSITION_OFFSET")) == 0)
-         {
-            p->applied.position_x_offset = GSF_UNKNOWN_PARAM_VALUE;
-            p->applied.position_y_offset = GSF_UNKNOWN_PARAM_VALUE;
-            p->applied.position_z_offset = GSF_UNKNOWN_PARAM_VALUE;
-            if (!strstr(rec->process_parameters.param[i], GSF_UNKNOWN_PARAM_TEXT))
-            {
-                sscanf (rec->process_parameters.param[i], "APPLIED_POSITION_OFFSET=%lf,%lf,%lf",
-                    &p->applied.position_x_offset,
-                    &p->applied.position_y_offset,
-                    &p->applied.position_z_offset);
-            }
-         }
-        else if (strncmp(rec->process_parameters.param[i], "APPLIED_ANTENNA_OFFSET", strlen("APPLIED_ANTENNA_OFFSET")) == 0)
-        {
-           p->applied.antenna_x_offset = GSF_UNKNOWN_PARAM_VALUE;
-           p->applied.antenna_y_offset = GSF_UNKNOWN_PARAM_VALUE;
-           p->applied.antenna_z_offset = GSF_UNKNOWN_PARAM_VALUE;
-           if (!strstr(rec->process_parameters.param[i], GSF_UNKNOWN_PARAM_TEXT))
-           {
-               sscanf (rec->process_parameters.param[i], "APPLIED_ANTENNA_OFFSET=%lf,%lf,%lf",
-                   &p->applied.antenna_x_offset,
-                   &p->applied.antenna_y_offset,
-                   &p->applied.antenna_z_offset);
-           }
-        }
-        /* The APPLIED_TRANSDUCER_OFFSET parameter defines the x,y,z offsets
-         * in ship coordinates to which have been applied to refer the x,y,z
-         * beam values to the ship reference point.
-         */
-        else if (strncmp(rec->process_parameters.param[i], "APPLIED_TRANSDUCER_OFFSET", strlen("APPLIED_TRANSDUCER_OFFSET")) == 0)
-        {
-            p->applied.transducer_x_offset[0] = GSF_UNKNOWN_PARAM_VALUE;
-            p->applied.transducer_y_offset[0] = GSF_UNKNOWN_PARAM_VALUE;
-            p->applied.transducer_z_offset[0] = GSF_UNKNOWN_PARAM_VALUE;
-            p->applied.transducer_x_offset[1] = GSF_UNKNOWN_PARAM_VALUE;
-            p->applied.transducer_y_offset[1] = GSF_UNKNOWN_PARAM_VALUE;
-            p->applied.transducer_z_offset[1] = GSF_UNKNOWN_PARAM_VALUE;
-            if (!strstr(rec->process_parameters.param[i], GSF_UNKNOWN_PARAM_TEXT))
-            {
-                sscanf (rec->process_parameters.param[i], "APPLIED_TRANSDUCER_OFFSET=%lf,%lf,%lf,%lf,%lf,%lf",
-                    &p->applied.transducer_x_offset[0],
-                    &p->applied.transducer_y_offset[0],
-                    &p->applied.transducer_z_offset[0],
-                    &p->applied.transducer_x_offset[1],
-                    &p->applied.transducer_y_offset[1],
-                    &p->applied.transducer_z_offset[1]);
-            }
-        }
-        else if (strncmp(rec->process_parameters.param[i], "APPLIED_TRANSDUCER_PITCH_OFFSET", strlen("APPLIED_TRANSDUCER_PITCH_OFFSET")) == 0)
-        {
-            p->applied.transducer_pitch_offset[0] = GSF_UNKNOWN_PARAM_VALUE;
-            p->applied.transducer_pitch_offset[1] = GSF_UNKNOWN_PARAM_VALUE;
-            if (!strstr(rec->process_parameters.param[i], GSF_UNKNOWN_PARAM_TEXT))
-            {
-                sscanf (rec->process_parameters.param[i], "APPLIED_TRANSDUCER_PITCH_OFFSET=%lf,%lf",
-                    &p->applied.transducer_pitch_offset[0],
-                    &p->applied.transducer_pitch_offset[1]);
-            }
-            /* Get the number of array pairs from each sonar alignment parameter */
-            *numArrays = gsfNumberParams(rec->process_parameters.param[i]);
-            if (!num_tx)
-                num_tx = *numArrays;
-        }
-        else if (strncmp(rec->process_parameters.param[i], "APPLIED_TRANSDUCER_ROLL_OFFSET", strlen("APPLIED_TRANSDUCER_ROLL_OFFSET")) == 0)
-        {
-            p->applied.transducer_roll_offset[0] = GSF_UNKNOWN_PARAM_VALUE;
-            p->applied.transducer_roll_offset[1] = GSF_UNKNOWN_PARAM_VALUE;
-            if (!strstr(rec->process_parameters.param[i], GSF_UNKNOWN_PARAM_TEXT))
-            {
-                sscanf (rec->process_parameters.param[i], "APPLIED_TRANSDUCER_ROLL_OFFSET=%lf,%lf",
-                    &p->applied.transducer_roll_offset[0],
-                    &p->applied.transducer_roll_offset[1]);
-            }
-            /* Get the number of array pairs from each sonar alignment parameter */
-            *numArrays = gsfNumberParams(rec->process_parameters.param[i]);
-            if (!num_tx)
-                num_tx = *numArrays;
-        }
-        else if (strncmp(rec->process_parameters.param[i], "APPLIED_TRANSDUCER_HEADING_OFFSET", strlen("APPLIED_TRANSDUCER_HEADING_OFFSET")) == 0)
-        {
-            p->applied.transducer_heading_offset[0] = GSF_UNKNOWN_PARAM_VALUE;
-            p->applied.transducer_heading_offset[1] = GSF_UNKNOWN_PARAM_VALUE;
-            if (!strstr(rec->process_parameters.param[i], GSF_UNKNOWN_PARAM_TEXT))
-            {
-                sscanf (rec->process_parameters.param[i], "APPLIED_TRANSDUCER_HEADING_OFFSET=%lf,%lf",
-                    &p->applied.transducer_heading_offset[0],
-                    &p->applied.transducer_heading_offset[1]);
-            }
-            /* Get the number of array pairs from each sonar alignment parameter */
-            *numArrays = gsfNumberParams(rec->process_parameters.param[i]);
-            if (!num_tx)
-                num_tx = *numArrays;
-        }
-        else if (strncmp(rec->process_parameters.param[i], "APPLIED_MRU_PITCH", strlen("APPLIED_MRU_PITCH")) == 0)
-        {
-            p->applied.mru_pitch_bias = GSF_UNKNOWN_PARAM_VALUE;
-            if (!strstr(rec->process_parameters.param[i], GSF_UNKNOWN_PARAM_TEXT))
-            {
-                sscanf (rec->process_parameters.param[i], "APPLIED_MRU_PITCH=%lf",
-                    &p->applied.mru_pitch_bias);
-            }
-        }
-        else if (strncmp(rec->process_parameters.param[i], "APPLIED_MRU_ROLL", strlen("APPLIED_MRU_ROLL")) == 0)
-        {
-            p->applied.mru_roll_bias = GSF_UNKNOWN_PARAM_VALUE;
-            if (!strstr(rec->process_parameters.param[i], GSF_UNKNOWN_PARAM_TEXT))
-            {
-                sscanf (rec->process_parameters.param[i], "APPLIED_MRU_ROLL=%lf",
-                    &p->applied.mru_roll_bias);
-            }
-        }
-        else if (strncmp(rec->process_parameters.param[i], "APPLIED_MRU_HEADING", strlen("APPLIED_MRU_HEADING")) == 0)
-        {
-            p->applied.mru_heading_bias = GSF_UNKNOWN_PARAM_VALUE;
-            if (!strstr(rec->process_parameters.param[i], GSF_UNKNOWN_PARAM_TEXT))
-            {
-                sscanf (rec->process_parameters.param[i], "APPLIED_MRU_HEADING=%lf",
-                    &p->applied.mru_heading_bias);
-            }
-        }
-        else if (strncmp(rec->process_parameters.param[i], "APPLIED_MRU_OFFSET", strlen("APPLIED_MRU_OFFSET")) == 0)
-        {
-            p->applied.mru_x_offset = GSF_UNKNOWN_PARAM_VALUE;
-            p->applied.mru_y_offset = GSF_UNKNOWN_PARAM_VALUE;
-            p->applied.mru_z_offset = GSF_UNKNOWN_PARAM_VALUE;
-            if (!strstr(rec->process_parameters.param[i], GSF_UNKNOWN_PARAM_TEXT))
-            {
-                sscanf (rec->process_parameters.param[i], "APPLIED_MRU_OFFSET=%lf,%lf,%lf",
-                    &p->applied.mru_x_offset,
-                    &p->applied.mru_y_offset,
-                    &p->applied.mru_z_offset);
-            }
-        }
-        else if (strncmp(rec->process_parameters.param[i], "APPLIED_CENTER_OF_ROTATION_OFFSET", strlen("APPLIED_CENTER_OF_ROTATION_OFFSET")) == 0)
-        {
-            p->applied.center_of_rotation_x_offset = GSF_UNKNOWN_PARAM_VALUE;
-            p->applied.center_of_rotation_y_offset = GSF_UNKNOWN_PARAM_VALUE;
-            p->applied.center_of_rotation_z_offset = GSF_UNKNOWN_PARAM_VALUE;
-            if (!strstr(rec->process_parameters.param[i], GSF_UNKNOWN_PARAM_TEXT))
-            {
-                sscanf (rec->process_parameters.param[i], "APPLIED_CENTER_OF_ROTATION_OFFSET=%lf,%lf,%lf",
-                    &p->applied.center_of_rotation_x_offset,
-                    &p->applied.center_of_rotation_y_offset,
-                    &p->applied.center_of_rotation_z_offset);
-            }
-        }
-        else if (strncmp(rec->process_parameters.param[i], "APPLIED_POSITION_LATENCY", strlen("APPLIED_POSITION_LATENCY")) == 0)
-        {
-            p->applied.position_latency = GSF_UNKNOWN_PARAM_VALUE;
-            if (!strstr(rec->process_parameters.param[i], GSF_UNKNOWN_PARAM_TEXT))
-            {
-                sscanf (rec->process_parameters.param[i], "APPLIED_POSITION_LATENCY=%lf",
-                    &p->applied.position_latency);
-            }
-        }
-        else if (strncmp(rec->process_parameters.param[i], "APPLIED_ATTITUDE_LATENCY", strlen("APPLIED_ATTITUDE_LATENCY")) == 0)
-        {
-            p->applied.attitude_latency = GSF_UNKNOWN_PARAM_VALUE;
-            if (!strstr(rec->process_parameters.param[i], GSF_UNKNOWN_PARAM_TEXT))
-            {
-                sscanf (rec->process_parameters.param[i], "APPLIED_ATTITUDE_LATENCY=%lf",
-                    &p->applied.attitude_latency);
-            }
-        }
-        else if (strncmp(rec->process_parameters.param[i], "APPLIED_DEPTH_SENSOR_LATENCY", strlen("APPLIED_DEPTH_SENSOR_LATENCY")) == 0)
-        {
-            p->applied.depth_sensor_latency = GSF_UNKNOWN_PARAM_VALUE;
-            if (!strstr(rec->process_parameters.param[i], GSF_UNKNOWN_PARAM_TEXT))
-            {
-                sscanf (rec->process_parameters.param[i], "APPLIED_DEPTH_SENSOR_LATENCY=%lf",
-                    &p->applied.depth_sensor_latency);
-            }
-        }
-        else if (strncmp(rec->process_parameters.param[i], "APPLIED_DEPTH_SENSOR_OFFSET", strlen("APPLIED_DEPTH_SENSOR_OFFSET")) == 0)
-        {
-            p->applied.depth_sensor_x_offset = GSF_UNKNOWN_PARAM_VALUE;
-            p->applied.depth_sensor_y_offset = GSF_UNKNOWN_PARAM_VALUE;
-            p->applied.depth_sensor_z_offset = GSF_UNKNOWN_PARAM_VALUE;
-            if (!strstr(rec->process_parameters.param[i], GSF_UNKNOWN_PARAM_TEXT))
-            {
-                sscanf (rec->process_parameters.param[i], "APPLIED_DEPTH_SENSOR_OFFSET=%lf,%lf,%lf",
-                    &p->applied.depth_sensor_x_offset,
-                    &p->applied.depth_sensor_y_offset,
-                    &p->applied.depth_sensor_z_offset);
-            }
-        }
-        else if (strncmp(rec->process_parameters.param[i], "APPLIED_RX_TRANSDUCER_OFFSET", strlen("APPLIED_RX_TRANSDUCER_OFFSET")) == 0)
-        {
-            p->applied.rx_transducer_x_offset[0] = GSF_UNKNOWN_PARAM_VALUE;
-            p->applied.rx_transducer_y_offset[0] = GSF_UNKNOWN_PARAM_VALUE;
-            p->applied.rx_transducer_z_offset[0] = GSF_UNKNOWN_PARAM_VALUE;
-            p->applied.rx_transducer_x_offset[1] = GSF_UNKNOWN_PARAM_VALUE;
-            p->applied.rx_transducer_y_offset[1] = GSF_UNKNOWN_PARAM_VALUE;
-            p->applied.rx_transducer_z_offset[1] = GSF_UNKNOWN_PARAM_VALUE;
-            if (!strstr(rec->process_parameters.param[i], GSF_UNKNOWN_PARAM_TEXT))
-            {
-                sscanf (rec->process_parameters.param[i], "APPLIED_RX_TRANSDUCER_OFFSET=%lf,%lf,%lf,%lf,%lf,%lf",
-                    &p->applied.rx_transducer_x_offset[0],
-                    &p->applied.rx_transducer_y_offset[0],
-                    &p->applied.rx_transducer_z_offset[0],
-                    &p->applied.rx_transducer_x_offset[1],
-                    &p->applied.rx_transducer_y_offset[1],
-                    &p->applied.rx_transducer_z_offset[1]);
-            }
-        }
-        else if (strncmp(rec->process_parameters.param[i], "APPLIED_RX_TRANSDUCER_PITCH_OFFSET", strlen("APPLIED_RX_TRANSDUCER_PITCH_OFFSET")) == 0)
-        {
-            p->applied.rx_transducer_pitch_offset[0] = GSF_UNKNOWN_PARAM_VALUE;
-            p->applied.rx_transducer_pitch_offset[1] = GSF_UNKNOWN_PARAM_VALUE;
-            if (!strstr(rec->process_parameters.param[i], GSF_UNKNOWN_PARAM_TEXT))
-            {
-                sscanf (rec->process_parameters.param[i], "APPLIED_RX_TRANSDUCER_PITCH_OFFSET=%lf,%lf",
-                    &p->applied.rx_transducer_pitch_offset[0],
-                    &p->applied.rx_transducer_pitch_offset[1]);
-            }
-        }
-        else if (strncmp(rec->process_parameters.param[i], "APPLIED_RX_TRANSDUCER_ROLL_OFFSET", strlen("APPLIED_RX_TRANSDUCER_ROLL_OFFSET")) == 0)
-        {
-            p->applied.rx_transducer_roll_offset[0] = GSF_UNKNOWN_PARAM_VALUE;
-            p->applied.rx_transducer_roll_offset[1] = GSF_UNKNOWN_PARAM_VALUE;
-            if (!strstr(rec->process_parameters.param[i], GSF_UNKNOWN_PARAM_TEXT))
-            {
-                sscanf (rec->process_parameters.param[i], "APPLIED_RX_TRANSDUCER_ROLL_OFFSET=%lf,%lf",
-                    &p->applied.rx_transducer_roll_offset[0],
-                    &p->applied.rx_transducer_roll_offset[1]);
-            }
-        }
-        else if (strncmp(rec->process_parameters.param[i], "APPLIED_RX_TRANSDUCER_HEADING_OFFSET", strlen("APPLIED_RX_TRANSDUCER_HEADING_OFFSET")) == 0)
-        {
-            p->applied.rx_transducer_heading_offset[0] = GSF_UNKNOWN_PARAM_VALUE;
-            p->applied.rx_transducer_heading_offset[1] = GSF_UNKNOWN_PARAM_VALUE;
-            if (!strstr(rec->process_parameters.param[i], GSF_UNKNOWN_PARAM_TEXT))
-            {
-                sscanf (rec->process_parameters.param[i], "APPLIED_RX_TRANSDUCER_HEADING_OFFSET=%lf,%lf",
-                    &p->applied.rx_transducer_heading_offset[0],
-                    &p->applied.rx_transducer_heading_offset[1]);
-            }
-        }   /** end of "applied" parameters **/
-
-        /* The horizontal datum parameter defines the elipsoid to which
-         * the latitude and longitude values are referenced.
-         */
-        else if (strncmp(rec->process_parameters.param[i], "GEOID", strlen("GEOID")) == 0)
-        {
-            sscanf (rec->process_parameters.param[i], "GEOID=%s", str);
-            if (strstr(str, "WGS-84"))
-            {
-                p->horizontal_datum = GSF_H_DATUM_WGE;
-            }
-            else
-            {
-                p->horizontal_datum = GSF_H_DATUM_UND;
-            }
-        }
-
-        /* The TIDAL_DATUM paremeter defines the reference datum for tide
-         * corrections
-         */
-        else if (strncmp(rec->process_parameters.param[i], "TIDAL_DATUM", strlen("TIDAL_DATUM")) == 0)
-        {
-            sscanf (rec->process_parameters.param[i], "TIDAL_DATUM=%s",
-                str);
-
-            if (strcmp(str, "MLLW") == 0)
-            {
-                p->vertical_datum = GSF_V_DATUM_MLLW;
-            }
-            else if (strcmp(str, "MLW") == 0)
-            {
-                p->vertical_datum = GSF_V_DATUM_MLW;
-            }
-            else if (strcmp(str, "ALAT") == 0)
-            {
-                p->vertical_datum = GSF_V_DATUM_ALAT;
-            }
-            else if (strcmp(str, "ESLW") == 0)
-            {
-                p->vertical_datum = GSF_V_DATUM_ESLW;
-            }
-            else if (strcmp(str, "ISLW") == 0)
-            {
-                p->vertical_datum = GSF_V_DATUM_ISLW;
-            }
-            else if (strcmp(str, "LAT") == 0)
-            {
-                p->vertical_datum = GSF_V_DATUM_LAT;
-            }
-            else if (strcmp(str, "LLW") == 0)
-            {
-                p->vertical_datum = GSF_V_DATUM_LLW;
-            }
-            else if (strcmp(str, "LNLW") == 0)
-            {
-                p->vertical_datum = GSF_V_DATUM_LNLW;
-            }
-            else if (strcmp(str, "LWD") == 0)
-            {
-                p->vertical_datum = GSF_V_DATUM_LWD;
-            }
-            else if (strcmp(str, "MLHW") == 0)
-            {
-                p->vertical_datum = GSF_V_DATUM_MLHW;
-            }
-            else if (strcmp(str, "MLLWS") == 0)
-            {
-                p->vertical_datum = GSF_V_DATUM_MLLWS;
-            }
-            else if (strcmp(str, "MLWN") == 0)
-            {
-                p->vertical_datum = GSF_V_DATUM_MLWN;
-            }
-            else if (strcmp(str, "MSL") == 0)
-            {
-                p->vertical_datum = GSF_V_DATUM_MSL;
-            }
-            else
-            {
-                p->vertical_datum = GSF_V_DATUM_UNKNOWN;
-            }
-        }
-    }  // for
-    p->number_of_transmitters = num_tx;
-    p->number_of_receivers = num_rx;
-
-    return(0);
-}
-
-/********************************************************************
- *
- * Function Name : numberParams
- *
- * Description : This function parses a KEYWORD=VALUE style parameter
- *   and returns the number of comma delimited values which follow the
- *   equal sign.
- *
- * Inputs :
- *    param = a pointer to a character string containing a KEYWORD=VALUE
- *    style parameter.
- *
- * Returns : This function returns the number of comma delimited values
- *    which follow the equal sign.
- *
- * Error Conditions : none
- *
- ********************************************************************/
-
-static int
-gsfNumberParams(char *param)
-{
-    int number;
-    char *p;
-    char tmp[128];
-
-    strncpy (tmp, param, sizeof(tmp));
-    p = strtok (tmp, ",");
-
-    if (p == NULL)
-    {
-        return (0);
-    }
-    else
-    {
-        number = 1;
-    }
-
-    while ((p = strtok(NULL, ",")) != (char *) NULL)
-    {
-        number++;
-    }
-
-    return (number);
-}
-
-/********************************************************************
- *
- * Function Name : gsfGetSwathBathyBeamWidths
- *
- * Description : This function returns to the caller the fore-aft and
- *    the port-starboard beam widths in degrees for a swath bathymetry
- *    multibeam sonar, given a gsfRecords data structure which contains
- *    a populated gsfSwathBathyPing structure.
- *
- * Inputs :
- *     data = The address of a gsfRecords data structure maintained by the
- *         caller which contains a populated gsfSwathBathyPing substructure.
- *     fore_aft = The address of a double allocated by the caller which will
- *         be loaded with the sonar's fore/aft beam width in degrees.
- *     athwartship = The address of a double allocated by the caller which will
- *         be loaded with the sonar's athwartship beam width in degrees.
- *
- * Returns : This function returns zero if successful, or -1 if an error
- *     occured.
- *
- * Error Conditions : unrecognized sonar id or mode.
- *
- ********************************************************************/
-int
-gsfGetSwathBathyBeamWidths(const gsfRecords *data, double *fore_aft, double *athwartship)
-{
-    int             ret=0;   /* Assume that we will be successful. */
-
-    /* Switch on the type of sonar this data came from */
-    switch (data->mb_ping.sensor_id)
-    {
-        case GSF_SWATH_BATHY_SUBRECORD_SEABEAM_SPECIFIC:
-            *fore_aft = 2.666666666667;
-            *athwartship = 2.666666666667;
-            break;
-
-        case GSF_SWATH_BATHY_SUBRECORD_EM12_SPECIFIC:
-            *fore_aft = 1.7;
-            *athwartship = 4.4;
-            break;
-
-        case GSF_SWATH_BATHY_SUBRECORD_EM100_SPECIFIC:
-            switch (data->mb_ping.sensor_data.gsfEM100Specific.mode)
-            {
-                case(1):  /* wide */
-                   *athwartship = 2.5;
-                   break;
-
-                case(2):  /* ulta-wide */
-                   *athwartship = 5.5;
-                   break;
-
-                case(3):  /* narrow */
-                   *athwartship = 2.0;
-                   break;
-
-                default:  /* Unrecognized sonar mode */
-                   *athwartship = 0.0;
-                   ret = -1;
-                   break;
-            }
-            *fore_aft = 3.0;
-            break;
-
-        case GSF_SWATH_BATHY_SUBRECORD_EM950_SPECIFIC:
-        case GSF_SWATH_BATHY_SUBRECORD_EM1000_SPECIFIC:
-            *fore_aft = 3.3;
-            *athwartship = 3.3;
-            break;
-
-        case GSF_SWATH_BATHY_SUBRECORD_EM121A_SPECIFIC:
-            *fore_aft = data->mb_ping.sensor_data.gsfEM121ASpecific.beam_width;
-            *athwartship = data->mb_ping.sensor_data.gsfEM121ASpecific.beam_width;
-            break;
-
-        case GSF_SWATH_BATHY_SUBRECORD_EM121_SPECIFIC:
-            *fore_aft = data->mb_ping.sensor_data.gsfEM121Specific.beam_width;
-            *athwartship = data->mb_ping.sensor_data.gsfEM121Specific.beam_width;
-            break;
-
-#if 1
-/* 04-01-99 wkm/dbj: obsolete */
-        case GSF_SWATH_BATHY_SUBRECORD_SASS_SPECIFIC:
-            ret = -1;
-            break;
-#endif
-
-        case GSF_SWATH_BATHY_SUBRECORD_SEAMAP_SPECIFIC:
-            ret = -1;
-            break;
-
-        case GSF_SWATH_BATHY_SUBRECORD_SEABAT_SPECIFIC:
-            if (data->mb_ping.sensor_data.gsfSeaBatSpecific.mode & GSF_SEABAT_WIDE_MODE)
-            {
-                *fore_aft = 10.0;
-            }
-            else
-            {
-                /* Set the F/A beam width to 2.4 here, but also set the return code to
-                 * indicate failure.  This sonar supports multiple beam widths, and
-                 * this information is NOT provided in the data stream from the sonar.
-                 */
-                *fore_aft = 1.5;
-                ret = -1;
-            }
-            if (data->mb_ping.sensor_data.gsfSeaBatSpecific.mode & GSF_SEABAT_9003)
-            {
-                *athwartship = 3.0;
-            }
-            else
-            {
-                *athwartship = 1.5;
-            }
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_SEABAT_II_SPECIFIC):
-            *fore_aft = data->mb_ping.sensor_data.gsfSeaBatIISpecific.fore_aft_bw;
-            *athwartship = data->mb_ping.sensor_data.gsfSeaBatIISpecific.athwart_bw;
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_SEABAT_8101_SPECIFIC):
-            *fore_aft = data->mb_ping.sensor_data.gsfSeaBat8101Specific.fore_aft_bw;
-            *athwartship = data->mb_ping.sensor_data.gsfSeaBat8101Specific.athwart_bw;
-            break;
-
-
-        case (GSF_SWATH_BATHY_SUBRECORD_SEABEAM_2112_SPECIFIC):
-            *fore_aft = 2.0;
-            *athwartship = 2.0;
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_ELAC_MKII_SPECIFIC):
-            *fore_aft = 2.0;
-            *athwartship = 2.0;
-            break;
-
-        case GSF_SWATH_BATHY_SUBRECORD_CMP_SASS_SPECIFIC:
-            *fore_aft    = 1.0;
-            *athwartship = 1.0;
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_EM300_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_EM1002_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_EM2000_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_EM3000_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_EM120_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_EM3002_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_EM3000D_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_EM3002D_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_EM121A_SIS_SPECIFIC):
-            *fore_aft = 1.5;
-            *athwartship = 1.5;
-            if (data->mb_ping.sensor_data.gsfEM3Specific.run_time[0].transmit_beam_width != 0.0)
-            {
-                *fore_aft = data->mb_ping.sensor_data.gsfEM3Specific.run_time[0].transmit_beam_width;
-            }
-            if (data->mb_ping.sensor_data.gsfEM3Specific.run_time[0].receive_beam_width != 0.0)
-            {
-                *athwartship = data->mb_ping.sensor_data.gsfEM3Specific.run_time[0].receive_beam_width;
-            }
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_EM300_RAW_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_EM1002_RAW_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_EM2000_RAW_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_EM3000_RAW_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_EM120_RAW_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_EM3002_RAW_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_EM3000D_RAW_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_EM3002D_RAW_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_EM121A_SIS_RAW_SPECIFIC):
-            *fore_aft = 1.5;
-            *athwartship = 1.5;
-            if (data->mb_ping.sensor_data.gsfEM3RawSpecific.run_time.tx_beam_width != 0.0)
-            {
-                *fore_aft = data->mb_ping.sensor_data.gsfEM3RawSpecific.run_time.tx_beam_width;
-            }
-            if (data->mb_ping.sensor_data.gsfEM3RawSpecific.run_time.rx_beam_width != 0.0)
-            {
-                *athwartship = data->mb_ping.sensor_data.gsfEM3RawSpecific.run_time.rx_beam_width;
-            }
-            break;
-
-
-        case (GSF_SWATH_BATHY_SUBRECORD_EM122_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_EM302_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_EM710_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_EM2040_SPECIFIC):
-            *fore_aft = 1.0;
-            *athwartship = 1.0;
-            if (data->mb_ping.sensor_data.gsfEM4Specific.run_time.tx_beam_width != 0.0)
-            {
-                *fore_aft = data->mb_ping.sensor_data.gsfEM4Specific.run_time.tx_beam_width;
-            }
-            if (data->mb_ping.sensor_data.gsfEM4Specific.run_time.rx_beam_width != 0.0)
-            {
-                *athwartship = data->mb_ping.sensor_data.gsfEM4Specific.run_time.rx_beam_width;
-            }
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_RESON_8101_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_RESON_8111_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_RESON_8124_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_RESON_8125_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_RESON_8150_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_RESON_8160_SPECIFIC):
-            *fore_aft = data->mb_ping.sensor_data.gsfReson8100Specific.fore_aft_bw;
-            *athwartship = data->mb_ping.sensor_data.gsfReson8100Specific.athwart_bw;
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_RESON_7125_SPECIFIC):
-            *fore_aft = data->mb_ping.sensor_data.gsfReson7100Specific.projector_beam_wdth_vert;
-            *athwartship = data->mb_ping.sensor_data.gsfReson7100Specific.receive_beam_width;
-            break;
-
-        case GSF_SWATH_BATHY_SUBRECORD_GEOSWATH_PLUS_SPECIFIC:
-            switch (data->mb_ping.sensor_data.gsfGeoSwathPlusSpecific.model_number)
-            {
-                case 100:
-                    *fore_aft = 0.9;
-                    *athwartship = GSF_BEAM_WIDTH_UNKNOWN;
-                    break;
-
-                case 250:
-                    *fore_aft = 0.5;
-                    *athwartship = GSF_BEAM_WIDTH_UNKNOWN;
-                    break;
-
-                case 500:
-                    *fore_aft = 0.5;
-                    *athwartship = GSF_BEAM_WIDTH_UNKNOWN;
-                    break;
-
-                default:
-                    *fore_aft = GSF_BEAM_WIDTH_UNKNOWN;
-                    *athwartship = GSF_BEAM_WIDTH_UNKNOWN;
-                    break;
-            }
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_KLEIN_5410_BSS_SPECIFIC):
-            *fore_aft = GSF_BEAM_WIDTH_UNKNOWN;
-            *athwartship = GSF_BEAM_WIDTH_UNKNOWN;
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_DELTA_T_SPECIFIC):
-            *fore_aft = 3.0;
-            *athwartship = 3.0;
-            if (data->mb_ping.sensor_data.gsfDeltaTSpecific.fore_aft_beamwidth != 0.0)
-            {
-                *fore_aft = data->mb_ping.sensor_data.gsfDeltaTSpecific.fore_aft_beamwidth;
-            }
-            if (data->mb_ping.sensor_data.gsfDeltaTSpecific.athwartships_beamwidth != 0.0)
-            {
-                *athwartship = data->mb_ping.sensor_data.gsfDeltaTSpecific.athwartships_beamwidth;
-            }
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_R2SONIC_2020_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_R2SONIC_2022_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_R2SONIC_2024_SPECIFIC):
-            *fore_aft = data->mb_ping.sensor_data.gsfR2SonicSpecific.tx_beamwidth_vert;
-            *athwartship = data->mb_ping.sensor_data.gsfR2SonicSpecific.tx_beamwidth_horiz;
-            break;
-
-        default:
-            *fore_aft = GSF_BEAM_WIDTH_UNKNOWN;
-            *athwartship = GSF_BEAM_WIDTH_UNKNOWN;
-            gsfError = GSF_UNRECOGNIZED_SENSOR_ID;
-            ret = -1;
-            break;
-    }
-    return(ret);
-}
-
-/********************************************************************
- *
- * Function Name : gsfIsStarboardPing
- *
- * Description : This function uses the sonar specific data union
- *     of a gsfSwathBathymetry ping structure to determine if the ping
- *     is from the starboard arrays of a multibeam installation with
- *     dual transmit receive sonar arrays.
- *
- * Inputs :
- *     data = The address of a gsfRecords data structure maintained by the
- *         caller which contains a populated gsfSwathBathyPing substructure.
- *
- * Returns : This function returns non-zero if the ping contained in the
- *     passed data represents a starboard looking ping from a dual headed
- *     sonar installation.  Otherwise, zero is returned.
- *
- * Error Conditions : none
- *
- ********************************************************************/
-int
-gsfIsStarboardPing(const gsfRecords *data)
-{
-    int ret = 0;
-
-
-    /* Switch on the type of sonar this data came from */
-    switch (data->mb_ping.sensor_id)
-    {
-
-        case GSF_SWATH_BATHY_SUBRECORD_GEOSWATH_PLUS_SPECIFIC:
-            return data->mb_ping.sensor_data.gsfGeoSwathPlusSpecific.side;
-            break;
-        case GSF_SWATH_BATHY_SUBRECORD_KLEIN_5410_BSS_SPECIFIC:
-            return data->mb_ping.sensor_data.gsfKlein5410BssSpecific.side;
-            break;
-        case GSF_SWATH_BATHY_SUBRECORD_SEABAT_SPECIFIC:
-/* zzz_ */
-/*          if (data->mb_ping.sensor_data.gsfSeaBatSpecific.mode &   */
-/*               (GSF_SEABAT_9002 | GSF_SEABAT_STBD_HEAD))           */
-        if ( data->mb_ping.sensor_data.gsfSeaBatSpecific.mode  &  GSF_SEABAT_STBD_HEAD )
-/* zzz_ */
-        {
-           ret = 1;
-        }
-        break;
-
-        case GSF_SWATH_BATHY_SUBRECORD_ELAC_MKII_SPECIFIC:
-        if ( data->mb_ping.sensor_data.gsfElacMkIISpecific.mode  &  GSF_MKII_STBD_HEAD )
-        {
-           ret = 1;
-        }
-        break;
-
-        case GSF_SWATH_BATHY_SUBRECORD_EM3000D_SPECIFIC:
-        case GSF_SWATH_BATHY_SUBRECORD_EM3002D_SPECIFIC:
-        case GSF_SWATH_BATHY_SUBRECORD_EM3000D_RAW_SPECIFIC:
-        case GSF_SWATH_BATHY_SUBRECORD_EM3002D_RAW_SPECIFIC:
-        case GSF_SWATH_BATHY_SUBRECORD_EM2040_SPECIFIC:
-            /* it is assumed that the center_beam is set to the vertical beam. */
-            if (data->mb_ping.center_beam < data->mb_ping.number_beams / 2)
-            {
-                /* most of the beams are to starboard of vertical */
-                ret = 1;
-            }
-            else
-            {
-                /* most of the beams are to port of vertical */
-                ret = 0;
-            }
-        break;
-        default:
-            ret = 0;
-            break;
-    }
-
-    return(ret);
-}
-
-/********************************************************************
- *
- * Function Name : gsfLoadDepthScaleFactorAutoOffset
- *
- * Description : gsfLoadDepthScaleFactorAutoOffset may be used to load
- *  the scale factors for the depth subrecords of the swath bathymetry ping
- *  record scale factor structure. The approach uses the tide and depth
- *  correction fields to help establish the offset component of the scale
- *  factor such that negative depth values may be supported.  Negative
- *  depth values may be encountered when surveying above the tidal datum.
- *  In addition, this function may be used for systems mounted on subsea
- *  platforms where high depth precision may be supported even in deep
- *  water.
- *
- * Inputs :
- *  ping = A pointer to the gsfSwathBathyPing which contains the depht
- *      and tide correction values, and the scale factors data structure.
- *  subrecordID = the subrecord id for the beam array data.  This must be
- *      either GSF_SWATH_BATHY_SUBRECORD_DEPTH_ARRAY, or
- *      GSF_SWATH_BATHY_SUBRECORD_NOMINAL_DEPTH_ARRAY
- *  reset = An integer value which will cause the internal logic to be
- *      refreshed when the value is non-zero.  The first call to this function
- *      should use a non-zero reset, from then on, this value may be passed
- *      as zero.
- *  min_depth = A double value which should be set to the minimum depth value
- *      contained in the depth array specified by subrecordID.  This argument
- *      exists for completeness, but is currently not used.
- *  max_depth = A double value which should be set to the maximum depth value
- *      contained in the depth array specified by subrecordID.  When a depth
- *      threshold is exceeded, the offset used to support "signed depth" is
- *      no longer required and will no longer be used.  This approach is
- *      necessary to avoid an integer overflow when the array data are scaled.
- *  last_corrector = The address of a double value stored as permanent memory.
- *      Successive calls to this function must pass the same address for this
- *      argument.  This function will take care of setting the value at this
- *      address, but the caller is responsible for ensuring that the same
- *      permanent memory address is used for each call to this function.
- *  c_flag = The compression flag for the beam array
- *  precision = The presision to which the beam array data are to be stored
- *      (a value of 0.1 would indicate decimeter precision for depth)
- *
- * Returns :
- *  This function returns zero if successful, or -1 if an error occured.
- *
- * Error Conditions :
- *    GSF_TOO_MANY_ARRAY_SUBRECORDS
- *
- ********************************************************************/
-int
-gsfLoadDepthScaleFactorAutoOffset(gsfSwathBathyPing *ping, unsigned int subrecordID, int reset, double min_depth, double max_depth, double *last_corrector, char c_flag, double precision)
-{
-    double          offset;
-    double          fraction;
-    double          layer;
-    double          next_layer;
-    double          corrector;
-    double          layer_interval = 100.0;
-    double          max_depth_threshold = 400.0;
-    double          max_depth_hysteresis = 30.0;
-    double          increasing_threshold;
-    double          decreasing_threshold;
-    int             dc_offset;
-    int             percent;
-    int             ret_code = 0;
-
-    if (precision < 0.01)
-    {
-        layer_interval = 10.0;
-    }
-
-    /* Test for valid subrecordID, we only supported automated establishement of the DC offset for the depth subrecords */
-    if ((subrecordID != GSF_SWATH_BATHY_SUBRECORD_DEPTH_ARRAY) && (subrecordID != GSF_SWATH_BATHY_SUBRECORD_NOMINAL_DEPTH_ARRAY))
-    {
-        gsfError = GSF_UNRECOGNIZED_ARRAY_SUBRECORD_ID;
-        return(-1);
-    }
-
-    /* Get the current offset scaling factor from the ping data structure */
-    offset    = ping->scaleFactors.scaleTable[subrecordID - 1].offset;
-
-    /* Break the total correction value into integer and fractional components based on the layering interval */
-    corrector = ping->depth_corrector + ping->tide_corrector;
-    fraction = modf (corrector / layer_interval, &layer);
-    layer = layer * layer_interval;
-
-    /* Handle the startup and/or reset situation */
-    if (reset)
-    {
-        if (layer < layer_interval)
-        {
-            offset = -1.0 * (layer - layer_interval);
-        }
-        else
-        {
-            offset = -1.0 * layer;
-        }
-        *last_corrector = 0.0;
-    }
-
-    /* Set the corrector layer trip thresholds based on the sign of the current layer */
-    if (fraction < 0.0)
-    {
-        percent = (int) (fraction * layer_interval);
-        increasing_threshold = -70.0;
-        decreasing_threshold = -90.0;
-        next_layer = layer - layer_interval;
-    }
-    else
-    {
-        percent = (int) (fraction * layer_interval);
-        increasing_threshold = 30.0;
-        decreasing_threshold = 10.0;
-        next_layer = layer;
-    }
-
-    /* The transition from one corrector layer to the next occurs if the
-     * total corrector is increasing and passes through one threshold, or
-     * if the total corrector is decreasing and passed through another
-     * threshold.
-     */
-    if (*last_corrector < corrector)
-    {
-        /* If the depth is greater than 400 meters then there is no need to
-         *  use a positive DC offset for signed depth.  This check is necessary
-         *  to avoid a potential integer overflow that may exist for sonar
-         *  systems which do not decrease the precision as the depth increases.
-         */
-        if ((fabs(corrector) < layer_interval) && (max_depth > (max_depth_threshold - max_depth_hysteresis)))
-        {
-            if (max_depth > (max_depth_threshold + max_depth_hysteresis))
-            {
-                offset = 0.0;
-            }
-        }
-
-        /* If corrector is increasing, change offset to next deeper
-         * depth layer when we pass through the threshold.
-         */
-        else if (percent > increasing_threshold)
-        {
-            offset = -1.0 * next_layer;
-        }
-    }
-    else
-    {
-        /* If the depth is greater than 400 meters then there is no need to
-         *  use a positive DC offset for signed depth.  This check is necessary
-         *  to avoid a potential integer overflow that may exist for sonar
-         *  systems which do not decrease the precision as the depth increases.
-         */
-        if ((fabs(corrector) < layer_interval) && (max_depth > (max_depth_threshold - max_depth_hysteresis)))
-        {
-            if (max_depth > (max_depth_threshold + max_depth_hysteresis))
-            {
-                offset = 0.0;
-            }
-        }
-
-        /* If corrector is decreasing, change offset to next shallower
-         *  depth layer when we pass through the threshold.
-         */
-        else if (percent < decreasing_threshold)
-        {
-            offset = -1.0 * (next_layer - layer_interval);
-        }
-    }
-
-    /* the maximum possible tidal height is just under 11 meters, so a maximum
-     *  offset of 20 is sufficient for surveying above the tidal datum.
-     *  bac, 09-12-04
-     */
-    if (offset > 20)
-    {
-        offset = 20;
-    }
-
-    /* Round to the nearest whole integer */
-    if (offset < 0.0)
-    {
-        dc_offset = (int) (offset - 0.5);
-    }
-    else
-    {
-        dc_offset = (int) (offset + 0.5);
-    }
-
-    /* Call the load scale factors function to set the computed DC offset and
-     *  the c_flag and precision arguments.
-     */
-    if (gsfLoadScaleFactor(&ping->scaleFactors, subrecordID, c_flag, precision, dc_offset) != 0)
-    {
-        return (-1);
-    }
-
-    if (corrector != *last_corrector)
-    {
-        *last_corrector = corrector;
-    }
-
-    return (ret_code);
-}
-
-/********************************************************************
- *
- * Function Name : gsfGetSwathBathyArrayMinMax
- *
- * Description : This function may be used to obtain the minimum and maximum
- *  supportable values for each of the swath bathymetry arrays.  The minimum
- *  and maximum values are determined based on the scale factors and the array
- *  type.
- *
- * Inputs :
- *  ping = A pointer to the gsfSwathBathyPing which contains the depht
- *      and tide correction values, and the scale factors data structure.
- *  subrecordID = The subrecord id for the beam array data.  This must be
- *      either GSF_SWATH_BATHY_SUBRECORD_DEPTH_ARRAY, or
- *      GSF_SWATH_BATHY_SUBRECORD_NOMINAL_DEPTH_ARRAY
- *  min_value = The address of a double value allocated by the caller into
- *      which will be placed the minimum value which may be represented for
- *      this array type.
- *  max_value = The address of a double value allocated by the caller into
- *      which will be placed the maximum value which may be represented for
- *      this array type.
- *
- * Returns :
- *  This function returns zero if successful, or -1 if an error occured.
- *
- * Error Conditions :
- *    GSF_UNRECOGNIZED_ARRAY_SUBRECORD_ID
- *    GSF_ILLEGAL_SCALE_FACTOR_MULTIPLIER
- *
- ********************************************************************/
-int
-gsfGetSwathBathyArrayMinMax(const gsfSwathBathyPing *ping, unsigned int subrecordID, double *min_value, double *max_value)
-{
-    double          minimum;
-    double          maximum;
-    double          multiplier;
-    double          offset;
-    int             ret_code = 0;
-
-    /* Make sure that we received a valid subrecordID */
-    if ((subrecordID < 1) || (subrecordID > GSF_MAX_PING_ARRAY_SUBRECORDS))
-    {
-        gsfError = GSF_UNRECOGNIZED_ARRAY_SUBRECORD_ID;
-        return(-1);
-    }
-
-    /* Make sure scale factors have been established for this array */
-    if (ping->scaleFactors.scaleTable[subrecordID - 1].multiplier == 0.0)
-    {
-        gsfError = GSF_ILLEGAL_SCALE_FACTOR_MULTIPLIER;
-        return (-1);
-    }
-
-    multiplier = ping->scaleFactors.scaleTable[subrecordID - 1].multiplier;
-    offset     = ping->scaleFactors.scaleTable[subrecordID - 1].offset;
-    switch (subrecordID)
-    {
-        case (GSF_SWATH_BATHY_SUBRECORD_DEPTH_ARRAY):
-            switch (ping->scaleFactors.scaleTable[subrecordID - 1].compressionFlag & 0xf0)
-            {
-                case GSF_FIELD_SIZE_ONE:
-                    minimum = GSF_U_CHAR_MIN;
-                    maximum = GSF_U_CHAR_MAX;
-                    break;
-                default:
-                case GSF_FIELD_SIZE_DEFAULT:
-                case GSF_FIELD_SIZE_TWO:
-                    minimum = GSF_U_SHORT_MIN;
-                    maximum = GSF_U_SHORT_MAX;
-                    break;
-                case GSF_FIELD_SIZE_FOUR:
-                    minimum = GSF_U_INT_MIN;
-                    maximum = GSF_U_INT_MAX;
-                    break;
-            }
-        case (GSF_SWATH_BATHY_SUBRECORD_NOMINAL_DEPTH_ARRAY):
-            switch (ping->scaleFactors.scaleTable[subrecordID - 1].compressionFlag & 0xf0)
-            {
-                case GSF_FIELD_SIZE_ONE:
-                    minimum = GSF_U_CHAR_MIN;
-                    maximum = GSF_U_CHAR_MAX;
-                    break;
-                default:
-                case GSF_FIELD_SIZE_DEFAULT:
-                case GSF_FIELD_SIZE_TWO:
-                    minimum = GSF_U_SHORT_MIN;
-                    maximum = GSF_U_SHORT_MAX;
-                    break;
-                case GSF_FIELD_SIZE_FOUR:
-                    minimum = GSF_U_INT_MIN;
-                    maximum = GSF_U_INT_MAX;
-                    break;
-            }
-        case (GSF_SWATH_BATHY_SUBRECORD_ACROSS_TRACK_ARRAY):
-            switch (ping->scaleFactors.scaleTable[subrecordID - 1].compressionFlag & 0xf0)
-            {
-                case GSF_FIELD_SIZE_ONE:
-                    minimum = GSF_S_CHAR_MIN;
-                    maximum = GSF_S_CHAR_MAX;
-                    break;
-                default:
-                case GSF_FIELD_SIZE_DEFAULT:
-                case GSF_FIELD_SIZE_TWO:
-                    minimum = GSF_S_SHORT_MIN;
-                    maximum = GSF_S_SHORT_MAX;
-                    break;
-                case GSF_FIELD_SIZE_FOUR:
-                    minimum = GSF_S_INT_MIN;
-                    maximum = GSF_S_INT_MAX;
-                    break;
-            }
-        case (GSF_SWATH_BATHY_SUBRECORD_ALONG_TRACK_ARRAY):
-            switch (ping->scaleFactors.scaleTable[subrecordID - 1].compressionFlag & 0xf0)
-            {
-                case GSF_FIELD_SIZE_ONE:
-                    minimum = GSF_S_CHAR_MIN;
-                    maximum = GSF_S_CHAR_MAX;
-                    break;
-                default:
-                case GSF_FIELD_SIZE_DEFAULT:
-                case GSF_FIELD_SIZE_TWO:
-                    minimum = GSF_S_SHORT_MIN;
-                    maximum = GSF_S_SHORT_MAX;
-                    break;
-                case GSF_FIELD_SIZE_FOUR:
-                    minimum = GSF_S_INT_MIN;
-                    maximum = GSF_S_INT_MAX;
-                    break;
-            }
-        case (GSF_SWATH_BATHY_SUBRECORD_TRAVEL_TIME_ARRAY):
-            switch (ping->scaleFactors.scaleTable[subrecordID - 1].compressionFlag & 0xf0)
-            {
-                case GSF_FIELD_SIZE_ONE:
-                    minimum = GSF_U_CHAR_MIN;
-                    maximum = GSF_U_CHAR_MAX;
-                    break;
-                default:
-                case GSF_FIELD_SIZE_DEFAULT:
-                case GSF_FIELD_SIZE_TWO:
-                    minimum = GSF_U_SHORT_MIN;
-                    maximum = GSF_U_SHORT_MAX;
-                    break;
-                case GSF_FIELD_SIZE_FOUR:
-                    minimum = GSF_U_INT_MIN;
-                    maximum = GSF_U_INT_MAX;
-                    break;
-            }
-        case (GSF_SWATH_BATHY_SUBRECORD_BEAM_ANGLE_ARRAY):
-            minimum = GSF_S_SHORT_MIN;
-            maximum = GSF_S_SHORT_MAX;
-            break;
-        case (GSF_SWATH_BATHY_SUBRECORD_MEAN_CAL_AMPLITUDE_ARRAY):
-            switch (ping->scaleFactors.scaleTable[subrecordID - 1].compressionFlag & 0xf0)
-            {
-                case GSF_FIELD_SIZE_DEFAULT:
-                case GSF_FIELD_SIZE_ONE:
-                    minimum = GSF_S_CHAR_MIN;
-                    maximum = GSF_S_CHAR_MAX;
-                    break;
-                case GSF_FIELD_SIZE_TWO:
-                    minimum = GSF_S_SHORT_MIN;
-                    maximum = GSF_S_SHORT_MAX;
-                    break;
-            }
-        case (GSF_SWATH_BATHY_SUBRECORD_MEAN_REL_AMPLITUDE_ARRAY):
-            switch (ping->scaleFactors.scaleTable[subrecordID - 1].compressionFlag & 0xf0)
-            {
-                case GSF_FIELD_SIZE_DEFAULT:
-                case GSF_FIELD_SIZE_ONE:
-                    minimum = GSF_U_CHAR_MIN;
-                    maximum = GSF_U_CHAR_MAX;
-                    break;
-                case GSF_FIELD_SIZE_TWO:
-                    minimum = GSF_U_SHORT_MIN;
-                    maximum = GSF_U_SHORT_MAX;
-                    break;
-            }
-        case (GSF_SWATH_BATHY_SUBRECORD_ECHO_WIDTH_ARRAY):
-            switch (ping->scaleFactors.scaleTable[subrecordID - 1].compressionFlag & 0xf0)
-            {
-                case GSF_FIELD_SIZE_DEFAULT:
-                case GSF_FIELD_SIZE_ONE:
-                    minimum = GSF_U_CHAR_MIN;
-                    maximum = GSF_U_CHAR_MAX;
-                    break;
-                case GSF_FIELD_SIZE_TWO:
-                    minimum = GSF_U_SHORT_MIN;
-                    maximum = GSF_U_SHORT_MAX;
-                    break;
-            }
-        case (GSF_SWATH_BATHY_SUBRECORD_QUALITY_FACTOR_ARRAY):
-            minimum = GSF_U_CHAR_MIN;
-            maximum = GSF_U_CHAR_MAX;
-            break;
-        case (GSF_SWATH_BATHY_SUBRECORD_RECEIVE_HEAVE_ARRAY):
-            minimum = GSF_S_CHAR_MIN;
-            maximum = GSF_S_CHAR_MAX;
-            break;
-        case (GSF_SWATH_BATHY_SUBRECORD_DEPTH_ERROR_ARRAY):
-            minimum = GSF_U_SHORT_MIN;
-            maximum = GSF_U_SHORT_MAX;
-            break;
-        case (GSF_SWATH_BATHY_SUBRECORD_ACROSS_TRACK_ERROR_ARRAY):
-            minimum = GSF_U_SHORT_MIN;
-            maximum = GSF_U_SHORT_MAX;
-            break;
-        case (GSF_SWATH_BATHY_SUBRECORD_ALONG_TRACK_ERROR_ARRAY):
-            minimum = GSF_U_SHORT_MIN;
-            maximum = GSF_U_SHORT_MAX;
-            break;
-        case (GSF_SWATH_BATHY_SUBRECORD_QUALITY_FLAGS_ARRAY):
-            minimum = GSF_U_CHAR_MIN;
-            maximum = GSF_U_CHAR_MAX;
-            break;
-        case (GSF_SWATH_BATHY_SUBRECORD_BEAM_FLAGS_ARRAY):
-            minimum = GSF_U_CHAR_MIN;
-            maximum = GSF_U_CHAR_MAX;
-            break;
-        case (GSF_SWATH_BATHY_SUBRECORD_SIGNAL_TO_NOISE_ARRAY):
-            minimum = GSF_U_CHAR_MIN;
-            maximum = GSF_U_CHAR_MAX;
-            break;
-        case (GSF_SWATH_BATHY_SUBRECORD_BEAM_ANGLE_FORWARD_ARRAY):
-            minimum = GSF_U_SHORT_MIN;
-            maximum = GSF_U_SHORT_MAX;
-            break;
-        case (GSF_SWATH_BATHY_SUBRECORD_VERTICAL_ERROR_ARRAY):
-            minimum = GSF_U_SHORT_MIN;
-            maximum = GSF_U_SHORT_MAX;
-            break;
-        case (GSF_SWATH_BATHY_SUBRECORD_HORIZONTAL_ERROR_ARRAY):
-            minimum = GSF_U_SHORT_MIN;
-            maximum = GSF_U_SHORT_MAX;
-            break;
-        case (GSF_SWATH_BATHY_SUBRECORD_SECTOR_NUMBER_ARRAY):
-            minimum = GSF_U_CHAR_MIN;
-            maximum = GSF_U_CHAR_MAX;
-            break;
-        case (GSF_SWATH_BATHY_SUBRECORD_DETECTION_INFO_ARRAY):
-            minimum = GSF_U_CHAR_MIN;
-            maximum = GSF_U_CHAR_MAX;
-            break;
-        case (GSF_SWATH_BATHY_SUBRECORD_INCIDENT_BEAM_ADJ_ARRAY):
-            minimum = GSF_S_CHAR_MIN;
-            maximum = GSF_S_CHAR_MAX;
-            break;
-        case (GSF_SWATH_BATHY_SUBRECORD_SYSTEM_CLEANING_ARRAY):
-            minimum = GSF_U_CHAR_MIN;
-            maximum = GSF_U_CHAR_MAX;
-            break;
-        case (GSF_SWATH_BATHY_SUBRECORD_DOPPLER_CORRECTION_ARRAY):
-            minimum = GSF_S_CHAR_MIN;
-            maximum = GSF_S_CHAR_MAX;
-            break;
-        default:
-            gsfError = GSF_UNRECOGNIZED_ARRAY_SUBRECORD_ID;
-            ret_code = -1;
-            break;
-    }
-
-    if (ret_code == 0)
-    {
-        *min_value = ((minimum / multiplier) - offset);
-        *max_value = ((maximum / multiplier) - offset);
-    }
-
-    return (ret_code);
-}
-
-/********************************************************************
- *
- * Function Name : gsfGetSonarTextName
- *
- * Description : This function provides a textual name for the sonar
- *  given a populated ping structure.
- *
- * Inputs :
- *  ping = A pointer to a populated gsfSwathBathyPing structure.
- *
- * Returns :
- *  This function returns a pointer to a character string containing
- *   the name of the sonar.
- *
- * Error Conditions :
- *    GSF_UNRECOGNIZED_ARRAY_SUBRECORD_ID
- *
- ********************************************************************/
-const char *gsfGetSonarTextName(const gsfSwathBathyPing *ping)
-{
-    const char             *ptr;
-
-    switch (ping->sensor_id)
-    {
-        case (GSF_SWATH_BATHY_SUBRECORD_SEABEAM_SPECIFIC):
-            ptr = "SeaBeam";
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_EM12_SPECIFIC):
-            ptr = "Simrad EM12";
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_EM100_SPECIFIC):
-            ptr = "Simrad EM100";
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_EM950_SPECIFIC):
-            ptr = "Simrad EM950";
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_EM1000_SPECIFIC):
-            ptr = "Simrad EM1000";
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_EM121A_SPECIFIC):
-            ptr = "Simrad EM121A";
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_SASS_SPECIFIC):
-            ptr = "SASS";
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_SEAMAP_SPECIFIC):
-            ptr = "SeaMap";
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_SB_AMP_SPECIFIC):
-            ptr = "Sea Beam (w/amp)";
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_SEABAT_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_SEABAT_II_SPECIFIC):
-            if (ping->sensor_data.gsfSeaBatIISpecific.mode & GSF_SEABAT_9002)
-            {
-                ptr = " Reson SeaBat 9002";
-            }
-            else if (ping->sensor_data.gsfSeaBatIISpecific.mode & GSF_SEABAT_9003)
-            {
-                ptr = "Reson SeaBat 9003";
-            }
-            else
-            {
-                ptr = "Reson SeaBat 9001";
-            }
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_SEABAT_8101_SPECIFIC):
-            ptr = "Reson SeaBat 8101";
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_SEABEAM_2112_SPECIFIC):
-            ptr = "Sea Beam 2112/36";
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_ELAC_MKII_SPECIFIC):
-            ptr = "ELAC MKII";
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_EM120_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_EM120_RAW_SPECIFIC):
-            ptr = "Kongsberg EM120";
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_EM300_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_EM300_RAW_SPECIFIC):
-            ptr = "Kongsberg EM300";
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_EM1002_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_EM1002_RAW_SPECIFIC):
-            ptr = "Kongsberg EM1002";
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_EM2000_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_EM2000_RAW_SPECIFIC):
-            ptr = "Kongsberg EM2000";
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_EM3000_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_EM3000_RAW_SPECIFIC):
-            ptr = "Kongsberg EM3000";
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_EM3000D_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_EM3000D_RAW_SPECIFIC):
-            ptr = "Kongsberg EM3000D";
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_EM3002_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_EM3002_RAW_SPECIFIC):
-            ptr = "Kongsberg EM3002";
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_EM3002D_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_EM3002D_RAW_SPECIFIC):
-            ptr = "Kongsberg EM3002D";
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_EM121A_SIS_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_EM121A_SIS_RAW_SPECIFIC):
-            ptr = "Kongsberg EM121A (SIS)";
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_RESON_7125_SPECIFIC):
-            ptr = "Reson SeaBat 7125";
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_RESON_8101_SPECIFIC):
-            ptr = "Reson SeaBat 8101";
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_RESON_8111_SPECIFIC):
-            ptr = "Reson SeaBat 8111";
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_RESON_8124_SPECIFIC):
-            ptr = "Reson SeaBat 8124";
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_RESON_8125_SPECIFIC):
-            ptr = "Reson SeaBat 8125";
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_RESON_8150_SPECIFIC):
-            ptr = "Reson SeaBat 8150";
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_RESON_8160_SPECIFIC):
-            ptr = "Reson SeaBat 8160";
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_EM122_SPECIFIC):
-            ptr = "Kongsberg EM122";
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_EM302_SPECIFIC):
-            ptr = "Kongsberg EM302";
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_EM710_SPECIFIC):
-            ptr = "Kongsberg EM710";
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_KLEIN_5410_BSS_SPECIFIC):
-            ptr = "Klein 5410";
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_GEOSWATH_PLUS_SPECIFIC):
-            ptr = "GeoAcoustics GeoSwath+";
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_EM2040_SPECIFIC):
-            ptr = "Kongsberg EM2040";
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_DELTA_T_SPECIFIC):
-            ptr = "Imagenex Delta T";
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_R2SONIC_2020_SPECIFIC):
-            ptr = "R2Sonic 2020";
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_R2SONIC_2022_SPECIFIC):
-            ptr = "R2Sonic 2022";
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_R2SONIC_2024_SPECIFIC):
-            ptr = "R2Sonic 2024";
-            break;
-
-        default:
-            ptr = "Unknown";
-            break;
-    }
-
-    return (ptr);
-}
-
-/********************************************************************
- *
- * Function Name : gsfIsNewSurveyLine
- *
- * Description : This function provides an approach for calling applications
- *  to determine if the last ping read from a GSF file is from the same survey
- *  transect line, or if the last ping is from a newly started survey line. The
- *  implementation looks for a change in platform heading to determine that the
- *  last ping read is from a new survey line. External to this function, calling
- *  applications can decide on their own if the first ping read from a newly opened
- *  GSF file should be considered to be from a new survey transect line or not.
- *  This function assumes that the GSF file is read in chronological order from
- *  the beginning of the file, file access can be either direct or sequential
- *
- * Inputs :
- *  handle         = The handle to the file as provided by gsfOpen
- *  rec            = A pointer to a gsfRecords structure containing the data from the most
- *                    recent call to gsfRead
- *  azimuth_change = The trigger value specifying the change in platform heading that
- *                    must be exceeded for a new survey transect line to be determined
- *  last_heading   = A pointer to a double allocated by the caller and into which this
- *                    function will place the heading value for each detected line. The
- *                    value must be allocated as permanent memory that persists through
- *                    all calls to this function. Startup or reset events can be handled
- *                    by the caller by placing a negative value in this memory location.
- *
- * Returns :
- *  This function returns 1 if this ping is considered to be the first ping of a new
- *   survey transect line, otherwise, 0 is returned.
- *
- * Error Conditions :
- *  none
- *
- ********************************************************************/
-int
-gsfIsNewSurveyLine(int handle, const gsfRecords *rec, double azimuth_change, double *last_heading)
-{
-    double diff;
-    int    new_line;
-
-    new_line = 0;
-
-    if ((handle < 1) || (handle > GSF_MAX_OPEN_FILES))
-    {
-        gsfError = GSF_BAD_FILE_HANDLE;
-        return (-1);
-    }
-    if (gsfFileTable[handle-1].last_record_type == GSF_RECORD_SWATH_BATHYMETRY_PING)
-    {
-        /* A negative value for last heading is the start/reset trigger. */
-        if (*last_heading < 0.0)
-        {
-            new_line = 1;
-            *last_heading = rec->mb_ping.heading;
-        }
-        else
-        {
-            diff = fabs (rec->mb_ping.heading - *last_heading);
-            if ((diff > azimuth_change) && (diff < 350.0))
-            {
-                new_line = 1;
-                *last_heading = rec->mb_ping.heading;
-            }
-        }
-    }
-
-    return(new_line);
-}
-
-/********************************************************************
- *
- * Function Name : gsfInitializeMBParams
- *
- * Description : This function provides a way to initialize all the
- *    sonar processing parameters to "unknown"
- *
- * Inputs :
- *    p = a pointer to the gsfMBParams data structure that needs initializing
- *
- * Returns :
- *    None
- *
- * Error Conditions :
- *    None
- *
- ********************************************************************/
-void
-gsfInitializeMBParams (gsfMBParams *p)
-{
-    int i;
-
-    memset(p->start_of_epoch, 0, sizeof(p->start_of_epoch));
-    p->horizontal_datum = GSF_UNKNOWN_PARAM_VALUE;
-    p->vertical_datum = GSF_UNKNOWN_PARAM_VALUE;
-    p->roll_compensated = GSF_UNKNOWN_PARAM_VALUE;
-    p->pitch_compensated = GSF_UNKNOWN_PARAM_VALUE;
-    p->heave_compensated = GSF_UNKNOWN_PARAM_VALUE;
-    p->tide_compensated = GSF_UNKNOWN_PARAM_VALUE;
-    p->ray_tracing = GSF_UNKNOWN_PARAM_VALUE;
-    p->depth_calculation = GSF_UNKNOWN_PARAM_VALUE;
-    p->vessel_type = GSF_UNKNOWN_PARAM_VALUE;
-    p->full_raw_data = GSF_UNKNOWN_PARAM_VALUE;
-    p->msb_applied_to_attitude = GSF_UNKNOWN_PARAM_VALUE;
-    p->heave_removed_from_gps_tc = GSF_UNKNOWN_PARAM_VALUE;
-    p->utc_offset = GSF_UNKNOWN_PARAM_INT;
-    p->roll_reference = GSF_UNKNOWN_PARAM_INT;
-    p->number_of_transmitters = GSF_UNKNOWN_PARAM_INT;
-    p->number_of_receivers = GSF_UNKNOWN_PARAM_INT;
-
-    /* initialize the "to apply" fields */
-    p->to_apply.position_x_offset = GSF_UNKNOWN_PARAM_VALUE;
-    p->to_apply.position_y_offset = GSF_UNKNOWN_PARAM_VALUE;
-    p->to_apply.position_z_offset = GSF_UNKNOWN_PARAM_VALUE;
-    p->to_apply.antenna_x_offset = GSF_UNKNOWN_PARAM_VALUE;
-    p->to_apply.antenna_y_offset = GSF_UNKNOWN_PARAM_VALUE;
-    p->to_apply.antenna_z_offset = GSF_UNKNOWN_PARAM_VALUE;
-    p->to_apply.mru_pitch_bias = GSF_UNKNOWN_PARAM_VALUE;
-    p->to_apply.mru_roll_bias = GSF_UNKNOWN_PARAM_VALUE;
-    p->to_apply.mru_heading_bias = GSF_UNKNOWN_PARAM_VALUE;
-    p->to_apply.mru_x_offset = GSF_UNKNOWN_PARAM_VALUE;
-    p->to_apply.mru_y_offset = GSF_UNKNOWN_PARAM_VALUE;
-    p->to_apply.mru_z_offset = GSF_UNKNOWN_PARAM_VALUE;
-    p->to_apply.center_of_rotation_x_offset = GSF_UNKNOWN_PARAM_VALUE;
-    p->to_apply.center_of_rotation_y_offset = GSF_UNKNOWN_PARAM_VALUE;
-    p->to_apply.center_of_rotation_z_offset = GSF_UNKNOWN_PARAM_VALUE;
-    p->to_apply.position_latency = GSF_UNKNOWN_PARAM_VALUE;
-    p->to_apply.attitude_latency = GSF_UNKNOWN_PARAM_VALUE;
-    p->to_apply.depth_sensor_latency = GSF_UNKNOWN_PARAM_VALUE;
-    p->to_apply.depth_sensor_x_offset = GSF_UNKNOWN_PARAM_VALUE;
-    p->to_apply.depth_sensor_y_offset = GSF_UNKNOWN_PARAM_VALUE;
-    p->to_apply.depth_sensor_z_offset = GSF_UNKNOWN_PARAM_VALUE;
-    for (i = 0; i < GSF_MAX_OFFSETS; i++)
-    {
-        p->to_apply.draft[i] = GSF_UNKNOWN_PARAM_VALUE;
-        p->to_apply.pitch_bias[i] = GSF_UNKNOWN_PARAM_VALUE;
-        p->to_apply.roll_bias[i] = GSF_UNKNOWN_PARAM_VALUE;
-        p->to_apply.gyro_bias[i] = GSF_UNKNOWN_PARAM_VALUE;
-        p->to_apply.transducer_x_offset[i] = GSF_UNKNOWN_PARAM_VALUE;
-        p->to_apply.transducer_y_offset[i] = GSF_UNKNOWN_PARAM_VALUE;
-        p->to_apply.transducer_z_offset[i] = GSF_UNKNOWN_PARAM_VALUE;
-        p->to_apply.transducer_pitch_offset[i] = GSF_UNKNOWN_PARAM_VALUE;
-        p->to_apply.transducer_roll_offset[i] = GSF_UNKNOWN_PARAM_VALUE;
-        p->to_apply.transducer_heading_offset[i] = GSF_UNKNOWN_PARAM_VALUE;
-        p->to_apply.rx_transducer_x_offset[i] = GSF_UNKNOWN_PARAM_VALUE;
-        p->to_apply.rx_transducer_y_offset[i] = GSF_UNKNOWN_PARAM_VALUE;
-        p->to_apply.rx_transducer_z_offset[i] = GSF_UNKNOWN_PARAM_VALUE;
-        p->to_apply.rx_transducer_pitch_offset[i] = GSF_UNKNOWN_PARAM_VALUE;
-        p->to_apply.rx_transducer_roll_offset[i] = GSF_UNKNOWN_PARAM_VALUE;
-        p->to_apply.rx_transducer_heading_offset[i] = GSF_UNKNOWN_PARAM_VALUE;
-    }
-
-    /* initialize the "applied" fields */
-    p->applied.position_x_offset = GSF_UNKNOWN_PARAM_VALUE;
-    p->applied.position_y_offset = GSF_UNKNOWN_PARAM_VALUE;
-    p->applied.position_z_offset = GSF_UNKNOWN_PARAM_VALUE;
-    p->applied.antenna_x_offset = GSF_UNKNOWN_PARAM_VALUE;
-    p->applied.antenna_y_offset = GSF_UNKNOWN_PARAM_VALUE;
-    p->applied.antenna_z_offset = GSF_UNKNOWN_PARAM_VALUE;
-    p->applied.mru_pitch_bias = GSF_UNKNOWN_PARAM_VALUE;
-    p->applied.mru_roll_bias = GSF_UNKNOWN_PARAM_VALUE;
-    p->applied.mru_heading_bias = GSF_UNKNOWN_PARAM_VALUE;
-    p->applied.mru_x_offset = GSF_UNKNOWN_PARAM_VALUE;
-    p->applied.mru_y_offset = GSF_UNKNOWN_PARAM_VALUE;
-    p->applied.mru_z_offset = GSF_UNKNOWN_PARAM_VALUE;
-    p->applied.center_of_rotation_x_offset = GSF_UNKNOWN_PARAM_VALUE;
-    p->applied.center_of_rotation_y_offset = GSF_UNKNOWN_PARAM_VALUE;
-    p->applied.center_of_rotation_z_offset = GSF_UNKNOWN_PARAM_VALUE;
-    p->applied.position_latency = GSF_UNKNOWN_PARAM_VALUE;
-    p->applied.attitude_latency = GSF_UNKNOWN_PARAM_VALUE;
-    p->applied.depth_sensor_latency = GSF_UNKNOWN_PARAM_VALUE;
-    p->applied.depth_sensor_x_offset = GSF_UNKNOWN_PARAM_VALUE;
-    p->applied.depth_sensor_y_offset = GSF_UNKNOWN_PARAM_VALUE;
-    p->applied.depth_sensor_z_offset = GSF_UNKNOWN_PARAM_VALUE;
-    for (i = 0; i < GSF_MAX_OFFSETS; i++)
-    {
-        p->applied.draft[i] = GSF_UNKNOWN_PARAM_VALUE;
-        p->applied.pitch_bias[i] = GSF_UNKNOWN_PARAM_VALUE;
-        p->applied.roll_bias[i] = GSF_UNKNOWN_PARAM_VALUE;
-        p->applied.gyro_bias[i] = GSF_UNKNOWN_PARAM_VALUE;
-        p->applied.transducer_x_offset[i] = GSF_UNKNOWN_PARAM_VALUE;
-        p->applied.transducer_y_offset[i] = GSF_UNKNOWN_PARAM_VALUE;
-        p->applied.transducer_z_offset[i] = GSF_UNKNOWN_PARAM_VALUE;
-        p->applied.transducer_pitch_offset[i] = GSF_UNKNOWN_PARAM_VALUE;
-        p->applied.transducer_roll_offset[i] = GSF_UNKNOWN_PARAM_VALUE;
-        p->applied.transducer_heading_offset[i] = GSF_UNKNOWN_PARAM_VALUE;
-        p->applied.rx_transducer_x_offset[i] = GSF_UNKNOWN_PARAM_VALUE;
-        p->applied.rx_transducer_y_offset[i] = GSF_UNKNOWN_PARAM_VALUE;
-        p->applied.rx_transducer_z_offset[i] = GSF_UNKNOWN_PARAM_VALUE;
-        p->applied.rx_transducer_pitch_offset[i] = GSF_UNKNOWN_PARAM_VALUE;
-        p->applied.rx_transducer_roll_offset[i] = GSF_UNKNOWN_PARAM_VALUE;
-        p->applied.rx_transducer_heading_offset[i] = GSF_UNKNOWN_PARAM_VALUE;
-    }
-}
-
diff --git a/src/gsf/gsf.c.rej b/src/gsf/gsf.c.rej
deleted file mode 100644
index 0296cee..0000000
--- a/src/gsf/gsf.c.rej
+++ /dev/null
@@ -1,17 +0,0 @@
-***************
-*** 256,262 ****
-      struct stat stbuf;
-      rc = stat(filename, &stbuf);
-  #else
-- #ifdef (defined __WINDOWS__) || (defined __MINGW32__)
-      struct _stati64    stbuf;
-      rc = _stati64(filename, &stbuf);
-  #else
---- 256,262 ----
-      struct stat stbuf;
-      rc = stat(filename, &stbuf);
-  #else
-+ #if defined(__WINDOWS__) || defined(__MINGW32__)
-      struct _stati64    stbuf;
-      rc = _stati64(filename, &stbuf);
-  #else
diff --git a/src/gsf/gsf.h b/src/gsf/gsf.h
deleted file mode 100644
index 6a5566f..0000000
--- a/src/gsf/gsf.h
+++ /dev/null
@@ -1,2926 +0,0 @@
-/********************************************************************
- *
- * Module Name : GSF.H
- *
- * Author/Date : J. S. Byrne / Jan 25,  1994
- *
- * Description : This is the header file for the GSF ToolKit
- *
- * Restrictions/Limitations :
- * 1) This library assumes the host computer uses the ASCII character set.
- * 2) This library assumes that the type short is 16 bits, and that the type
- *    int is 32 bits.
- *
- * Change Descriptions :
- * who when      what
- * --- ----      ----
- * jsb 10/17/94  Added support for Reson Seabat data
- * jsb 01/29/95  Added support for em121a nominal depth array
- * jsb 08/14/95  Scale factors and pointers to dynamically allocated memory
- *               now maintained by the library, not the caller.  Consolidated
- *               APIs for sequential and direct access, now both use gsfRead
- *               and gsfWrite. This is version GSF-v01.01.
- * jsb 11/01/95  Completed modifications to indexing to support increase in
- *               gsf file size after initial index file creation.  The size
- *               of the file is now stored in the index file header. Index
- *               files without the expected header are recreated on the first
- *               open. This is still version GSF-v01.01. Also added a unique
- *               sensor specific subrecord for Simrad EM1000.
- * jsb 12/22/95  Added gsfGetMBParams, gsfPutMBParams, gsfIsStarboardPing,
- *               and gsfGetSwathBathyBeamWidths. Also added GSF_APPEND as
- *               a file access mode, and modifed GSF_CREATE access mode so
- *               that files can be updated (read and written). This is gsf
- *               library version GSF-v01.02.
- * hem 08/20/96  Added gsfSingleBeamPing Record structure; added Type III
- *               Seabeam, Echotrac, Bathy200, MGD77, BDB, & NOS HDB subrecord
- *               IDs & subrecords; added gsfStringError.  This is gsf library
- *               version GSF-v1.03.
- * jsb 09/27/96  Added support for SeaBeam with amplitude data.
- * jsb 03/24/97  Added gsfSeaBatIISpecific data structure to replace
- *               the gsfSeaBatSpecific data structure, for the Reson 900x
- *               series sonar systems.  Also added gsfSeaBat8101Specific
- *               data structure for the Reson 8101 series sonar system.
- *               Increased the macro GSF_MAX_RECORD_SIZE from 4k to 32k.
- *               This is GSF library version GSF-v1.04.
- * bac 10/27/97  Added a sensor specific subrecord for the SeaBeam 2112/36.
- * dwc 1/9/98    Added a sensor specific subrecord for the Elac Bottomchart MkII.
- * jsb 9/28/98   Added new navigation error record definition. gsfHVNavigationError.
- *               This record is intended to replace the gsfNavigationError record.
- *               This change addresses CRs: GSF-98-001, and GSF-98-002. Also added
- *               new ping array subrecords: horizontal_error, and vertical_error. This
- *               change address CR: GSF-98-003. These new subrecords are intended to
- *               replace the depth_errror, along_track_error and across_track_error
- *               subrecords. In a future release, new file support for these three
- *               error subrecords will be dropped. This is library version GSF-v1.07.
- * jsb 12/19/98  Added support for em3000. Also increased number of entries available
- *               for processing and sensor parameter records. This is library version
- *               GSF-v1.08.
- * wkm 4/1/99    Added CMP_SASS subrecord for Compressed SASS (BOSDAT) data.  This
- *               subrecord should be used in place of the SASS subrecord (TypeIII).
- *               The original has been left in tactc so as to not break existing code.
- * jsb 07/20/99  Completed work on GSF version 1.08.  Added new functions gsfGetSwathBathyArrayMinMax,
- *               and gsfLoadDepthScaleFactorAutoOffset in support of signed depth.
- *               This release addresses the following CRs: GSF-99-002, GSF-99-006, GSF-99-007,
- *               GSF-99-008, GSF-99-009, GSF-99-010, GSF-99-011, GSF-99-012,
- * wkm 7/30/99   Updated SASS specific data subrecord to include 'lntens' and renamed
- *               surface_velocity to 'lfreq'.  These are the original SASS data filed
- *               names and were requested by NAVO to remane in tact.  Added commet block
- *               to document mapping of SASS data fields to GSF.
- * bac 12-22-99  Applications built with GCC that use GSF.DLL require any global data to be explicitly
- *               defined as imported from a DLL.  When this is the case, gsfError gets redefined
- *               as *__imp_gsfError.  gsfError is unchanged for other compilers or static linking with GCC.
- *               Programs built with the GCC and using gsf.dll must define gsf_USE_DLL
- *               (-Dgsf_USE_DLL) when building. This is version GSF_1.10
- * bac 10-24-00  Updated gsfEM3RunTime structure to include data fields from updated
- *               EM series runtime parameter datagram.  Also added an additional check
- *               for the LINUX define of timespec.
- * bac 07-18-01  Added a sensor specific subrecord for the Reson 8100 series of sonars.  Also
- *               made modifications for use with C++ code.  The typedef for each sensor specific
- *               structure has been modfied to have a different name than the element of the SensorSpecific
- *               union.  Also removed the useage of C++ reserved words "class" and "operator".  These
- *               modifications will potentially require some changes to application code.
- * bac 10-12-01  Added a new attitude record definition.  The attitude record provides a method for
- *               logging full time-series attitude measurements in the GSF file, instead of attitude
- *               samples only at ping time.  Each attitude record contains arrays of attitude
- *               measurements for time, roll, pitch, heave and heading.  The number of measurements
- *               is user-definable, but because of the way in which measurement times are stored, a
- *               single attitude record should never contain more than sixty seconds worth of
- *               data.
- * bac 11-09-01  Added motion sensor offsets to the gsfMBOffsets structure.  Added support for these
- *               new offsets in the gsfPutMBParams and gsfGetMBParams functions, so these offsets are
- *               encoded in the process_parameters record.
- * jsb 01-16-02  Added support for Simrad EM120.
- * bac 06-19-03  Added support for bathymetric receive beam time series intensity data (i.e., Simrad
- *               "Seabed image" and Reson "snippets").  Inlcluded RWL updates of 12-19-02 for adding
- *               sensor-specific singlebeam information to the MB sensor specific subrecords.
- * bac 12-28-04  Added support for Reson Navisound, EM3000D, EM3002, and EM3002D.  Renumbered
- *               singlebeam subrecord IDs to be less than 256, as previous version did not save
- *               these sensors IDs correctly.  Added beam spacing to Reson 8100 sensor-specific
- *               subrecord.  Added definitions for RTG position types in gsfHVNavigationError record.
- * bac 06-28-06  Added sensor ID for EM121A data received via Kongsberg SIS, mapped to existing
- *               EM3 series sensor specific data structure.  Added __APPLE__ macro definition to
- *               support compile switch steering around definition of struct timespec on MAC OSX.
- *               Changed structure elements of type long to int, for compilation on 64-bit architectures.
- * dhg 09-27-06  Added sensor ID for gsfGeoSwathPlusSpecific data received via GeoSwath interferometric
- *               250 Khz sonar.
- * dhg 10-04-06  Added more sensor specific fields for the GeoSwathPlus interferometric sonar.
- * jsb 07-24-07  GSFv2.07 includes some additional parameters in the imagery sensor specific structure
- *                to support calculating back to the exact original intensity values received from the
- *                sonar.
- * bsl 11-05-07  Added sensor ID and structure for gsfGeoSwathPlusSpecific data received via Klein 5410
- *                bathymetric sidescan sonar.  Also added an imagery sensor specific structure.
- * jsb 11-06-07  Updates to utilize the subrecord size in termining the field size for the array subrecords
- *                that support more than one field size.  Also replaced use of strstr with strcmp in gsfGetMBParams
- *                to resolve potential problem where one keyword name may be fully contained in another.
- * DHG 2008/12/18 Add "VESSEL_TYPE" to Processing Parameters for AUV vs Surface Ship discrimination.
- * mab 02-01-09  Updates to support Reson 7125. Added new subrecord IDs and subrecord definitions for Kongsberg
- *                sonar systems where TWTT and angle are populated from raw range and beam angle datagram. Added
- *                new subrecord definition for EM2000.  Bug fixes in gsfOpen and gsfPercent.
- * mab 06-11-09  Moved GSF_MAX_RECORD_SIZE from 256KB to 512KB to accomodate Reson7125 imagery.
- * jsb 01-14-10  Added new function prototypes to return various status information about the opened GSF file.
- * clb 04-21-11  Changed version from 03.02 to 03.03
- * clb 05-11-11  Changed the value of GSF_NULL_DEPTH_CORRECTOR (STR 19142)
- * clb 05-11-11  Added depth sensor and receiver array offsets to gsfMBOffsets structure
- * clb 05-27-11  Added __MINGW64__ references
- * clb 06-21-11  Added t_gsfEM12Specific structure
- * clb 09-20-11  Added R2Sonic support
- * clb 10-04-11  Added GSF_PARTIAL_RECORD_AT_END_OF_FILE error code
- * clb 11-09-11  Added gsfInitializeMBParams() prototype
- * clb 11-10-11  Changed value of GSF_NULL_DEPTH_CORRECTOR back to 99.99 for backwards compatibility
- * clb 09-13-11  Added check for HAVE_STRUCT_TIMESPEC when defining timespec; updated version to 03.05
- * jhp 02-10-14  Added GSF_SWATH_BATHY_SUBRECORD_SONAR_VERT_UNCERT_ARRAY
- * jhp 03-31-14  Added support for R2Sonic 2020.
- *
- * Classification : Unclassified
- *
- * References : DoDBL Generic Sensor Format Sept. 30, 1993
- *
- * copyright 2014 Leidos, Inc.
- * There is no charge to use the library, and it may be accessed at: https://www.leidos.com/maritime/gsf
- * This library may be redistributed and/or modified under the terms of the GNU Lesser General Public License
- * version 2.1, as published by the Free Software Foundation.  A copy of the LGPL 2.1 license is included
- * with the GSF distribution and is avaialbe at: http://opensource.org/licenses/LGPL-2.1.
- *
- * Leidos, Inc. configuration manages GSF, and provides GSF releases. Users are strongly encouraged to
- * communicate change requests and change proposals to Leidos, Inc.
- *
- * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- ********************************************************************/
-
-#ifndef  __GSF_H__
-#define __GSF_H__
-
-/* Get the required standard C library includes */
-#include <stdio.h>
-#include <time.h>
-
-/* Get the required system include files */
-#include <float.h>
-#ifdef __OS2__
-#include <types.h>
-#include <utils.h>
-/* specify OS/2 Optlink linkage in the function prototype */
-#ifndef OPTLK
-#define OPTLK _Optlink
-#endif
-#else
-#include <sys/types.h>
-#define OPTLK
-#endif
-
-#ifdef WIN32
-#	define R_OK 04
-#	define W_OK 02
-#	define X_OK 01
-#	define F_OK 00
-#	ifndef __WINDOWS__              /* I, Joaquim Luis, understand nothing of this mess on the ways to detect if we are on Windows */
-#		define __WINDOWS__
-#	endif
-#	ifndef _WIN32
-#		define _WIN32
-#	endif
-#endif
-
-#ifdef __cplusplus
-extern          "C"
-{
-#endif
-
-/* Define this version of the GSF library (MAXIMUM 11 characters) */
-#define GSF_VERSION       "GSF-v03.06"
-
-/* Define largest ever expected record size */
-#define GSF_MAX_RECORD_SIZE    524288
-
-/* Define the maximum number of files which may be open at once */
-#define GSF_MAX_OPEN_FILES     4
-
-/* Define the GSF data file access flags */
-#define GSF_CREATE             1
-#define GSF_READONLY           2
-#define GSF_UPDATE             3
-#define GSF_READONLY_INDEX     4
-#define GSF_UPDATE_INDEX       5
-#define GSF_APPEND             6
-
-/* Define options for sequential access gsf file pointer manipulation */
-#define GSF_REWIND             1
-#define GSF_END_OF_FILE        2
-#define GSF_PREVIOUS_RECORD    3
-
-/* Typedefs for GSF short and long integers */
-typedef unsigned short gsfuShort;      /* an unsigned 16 bit integer */
-typedef unsigned int   gsfuLong;       /* an unsigned 32 bit integer */
-typedef short          gsfsShort;      /* a signed 16 bit integer */
-typedef int            gsfsLong;       /* a signed 32 bit integer */
-
-#define GSF_SHORT_SIZE 2
-#define GSF_LONG_SIZE  4
-
-/* redefine gsfError for MINGW applications using gsf.dll, harmless for other compilers */
-#if defined (__MINGW32__) || defined (__MINGW64__)
-  #if __GNUC__ < 3
-     #ifdef gsf_USE_DLL
-      #define gsfError *__imp_gsfError
-     #endif
-  #endif
-#endif
-
-/* Define the gsf Data Identifier structure */
-typedef struct t_gsfDataID
-{
-    int             checksumFlag;       /* boolean */
-    int             reserved;           /* up to 9 bits */
-    unsigned int    recordID;           /* bits 00-11 => data type number */
-                                        /* bits 12-22 => registry number */
-    int             record_number;      /* specifies the nth occurance of */
-                                        /* record type specified by recordID */
-                                        /* relavent only for direct access */
-                                        /* the record_number counts from 1 */
-}
-gsfDataID;
-
-/* Specify a key to allow reading the next record, no matter what it is */
-#define GSF_NEXT_RECORD 0
-
-/* Specify the GSF record data type numbers, for registry number zero */
-#define GSF_RECORD_HEADER                                   1u
-#define GSF_RECORD_SWATH_BATHYMETRY_PING                    2u
-#define GSF_RECORD_SOUND_VELOCITY_PROFILE                   3u
-#define GSF_RECORD_PROCESSING_PARAMETERS                    4u
-#define GSF_RECORD_SENSOR_PARAMETERS                        5u
-#define GSF_RECORD_COMMENT                                  6u
-#define GSF_RECORD_HISTORY                                  7u
-#define GSF_RECORD_NAVIGATION_ERROR                         8u /* 10/19/98 This record is obsolete */
-#define GSF_RECORD_SWATH_BATHY_SUMMARY                      9u
-#define GSF_RECORD_SINGLE_BEAM_PING                         10u
-#define GSF_RECORD_HV_NAVIGATION_ERROR                      11u /* This record replaces GSF_RECORD_NAVIGATION_ERROR */
-#define GSF_RECORD_ATTITUDE                                 12u
-
-/* Number of currently defined record data types (including 0 which is used
- *  in the indexing for ping records which contain scale factor subrecords).
- */
-#define             NUM_REC_TYPES  13
-
-/* Put a ceiling on the maximum number of swath bathymetry ping array
- * subrecords allowed in a gsf file.  This define dimensions the scale
- * factors structure.
- */
-#define GSF_MAX_PING_ARRAY_SUBRECORDS 27
-
-/* Specify the GSF swath bathymetry ping subrecord identifiers. The beam
- *  data definitions specify the index into the scale factor table, and
- *  define the subrecord id put down on the disk with the subrecord.
- */
-#define GSF_SWATH_BATHY_SUBRECORD_DEPTH_ARRAY                  1u
-#define GSF_SWATH_BATHY_SUBRECORD_ACROSS_TRACK_ARRAY           2u
-#define GSF_SWATH_BATHY_SUBRECORD_ALONG_TRACK_ARRAY            3u
-#define GSF_SWATH_BATHY_SUBRECORD_TRAVEL_TIME_ARRAY            4u
-#define GSF_SWATH_BATHY_SUBRECORD_BEAM_ANGLE_ARRAY             5u
-#define GSF_SWATH_BATHY_SUBRECORD_MEAN_CAL_AMPLITUDE_ARRAY     6u
-#define GSF_SWATH_BATHY_SUBRECORD_MEAN_REL_AMPLITUDE_ARRAY     7u
-#define GSF_SWATH_BATHY_SUBRECORD_ECHO_WIDTH_ARRAY             8u
-#define GSF_SWATH_BATHY_SUBRECORD_QUALITY_FACTOR_ARRAY         9u
-#define GSF_SWATH_BATHY_SUBRECORD_RECEIVE_HEAVE_ARRAY          10u
-#define GSF_SWATH_BATHY_SUBRECORD_DEPTH_ERROR_ARRAY            11u /* 10/19/98 jsb This ping array subrecord is obsolete */
-#define GSF_SWATH_BATHY_SUBRECORD_ACROSS_TRACK_ERROR_ARRAY     12u /* 10/19/98 jsb This ping array subrecord is obsolete */
-#define GSF_SWATH_BATHY_SUBRECORD_ALONG_TRACK_ERROR_ARRAY      13u /* 10/19/98 jsb This ping array subrecord is obsolete */
-#define GSF_SWATH_BATHY_SUBRECORD_NOMINAL_DEPTH_ARRAY          14u
-#define GSF_SWATH_BATHY_SUBRECORD_QUALITY_FLAGS_ARRAY          15u
-#define GSF_SWATH_BATHY_SUBRECORD_BEAM_FLAGS_ARRAY             16u
-#define GSF_SWATH_BATHY_SUBRECORD_SIGNAL_TO_NOISE_ARRAY        17u
-#define GSF_SWATH_BATHY_SUBRECORD_BEAM_ANGLE_FORWARD_ARRAY     18u
-#define GSF_SWATH_BATHY_SUBRECORD_VERTICAL_ERROR_ARRAY         19u /* This record replaces DEPTH_ERROR_ARRAY */
-#define GSF_SWATH_BATHY_SUBRECORD_HORIZONTAL_ERROR_ARRAY       20u /* This record replaces ACROSS_TRACK_ERROR_ARRAY and ALONG_TRACK_ERROR_ARRAY */
-#define GSF_SWATH_BATHY_SUBRECORD_INTENSITY_SERIES_ARRAY       21u
-#define GSF_SWATH_BATHY_SUBRECORD_SECTOR_NUMBER_ARRAY          22u
-#define GSF_SWATH_BATHY_SUBRECORD_DETECTION_INFO_ARRAY         23u
-#define GSF_SWATH_BATHY_SUBRECORD_INCIDENT_BEAM_ADJ_ARRAY      24u
-#define GSF_SWATH_BATHY_SUBRECORD_SYSTEM_CLEANING_ARRAY        25u
-#define GSF_SWATH_BATHY_SUBRECORD_DOPPLER_CORRECTION_ARRAY     26u
-#define GSF_SWATH_BATHY_SUBRECORD_SONAR_VERT_UNCERT_ARRAY      27u
-
-/* Define the additional swath bathymetry subrecords, to which the scale
- * factors do not apply.
- */
-#define GSF_SWATH_BATHY_SUBRECORD_UNKNOWN                     0u
-#define GSF_SWATH_BATHY_SUBRECORD_SCALE_FACTORS             100u
-#define GSF_SWATH_BATHY_SUBRECORD_SEABEAM_SPECIFIC          102u
-#define GSF_SWATH_BATHY_SUBRECORD_EM12_SPECIFIC             103u
-#define GSF_SWATH_BATHY_SUBRECORD_EM100_SPECIFIC            104u
-#define GSF_SWATH_BATHY_SUBRECORD_EM950_SPECIFIC            105u
-#define GSF_SWATH_BATHY_SUBRECORD_EM121A_SPECIFIC           106u
-#define GSF_SWATH_BATHY_SUBRECORD_EM121_SPECIFIC            107u
-#define GSF_SWATH_BATHY_SUBRECORD_SASS_SPECIFIC             108u /* 03-30-99 wkm/dbj Typeiii SASS ping array subrecord is obsolete */
-#define GSF_SWATH_BATHY_SUBRECORD_SEAMAP_SPECIFIC           109u
-#define GSF_SWATH_BATHY_SUBRECORD_SEABAT_SPECIFIC           110u
-#define GSF_SWATH_BATHY_SUBRECORD_EM1000_SPECIFIC           111u
-#define GSF_SWATH_BATHY_SUBRECORD_TYPEIII_SEABEAM_SPECIFIC  112u  /* 03-30-99 wkm/dbj Typeiii Seabeam ping array subrecord is obsolete */
-#define GSF_SWATH_BATHY_SUBRECORD_SB_AMP_SPECIFIC           113u
-#define GSF_SWATH_BATHY_SUBRECORD_SEABAT_II_SPECIFIC        114u
-#define GSF_SWATH_BATHY_SUBRECORD_SEABAT_8101_SPECIFIC      115u
-#define GSF_SWATH_BATHY_SUBRECORD_SEABEAM_2112_SPECIFIC     116u
-#define GSF_SWATH_BATHY_SUBRECORD_ELAC_MKII_SPECIFIC        117u
-#define GSF_SWATH_BATHY_SUBRECORD_EM3000_SPECIFIC           118u
-#define GSF_SWATH_BATHY_SUBRECORD_EM1002_SPECIFIC           119u
-#define GSF_SWATH_BATHY_SUBRECORD_EM300_SPECIFIC            120u
-#define GSF_SWATH_BATHY_SUBRECORD_CMP_SASS_SPECIFIC         121u
-#define GSF_SWATH_BATHY_SUBRECORD_RESON_8101_SPECIFIC       122u
-#define GSF_SWATH_BATHY_SUBRECORD_RESON_8111_SPECIFIC       123u
-#define GSF_SWATH_BATHY_SUBRECORD_RESON_8124_SPECIFIC       124u
-#define GSF_SWATH_BATHY_SUBRECORD_RESON_8125_SPECIFIC       125u
-#define GSF_SWATH_BATHY_SUBRECORD_RESON_8150_SPECIFIC       126u
-#define GSF_SWATH_BATHY_SUBRECORD_RESON_8160_SPECIFIC       127u
-#define GSF_SWATH_BATHY_SUBRECORD_EM120_SPECIFIC            128u
-#define GSF_SWATH_BATHY_SUBRECORD_EM3002_SPECIFIC           129u
-#define GSF_SWATH_BATHY_SUBRECORD_EM3000D_SPECIFIC          130u
-#define GSF_SWATH_BATHY_SUBRECORD_EM3002D_SPECIFIC          131u
-#define GSF_SWATH_BATHY_SUBRECORD_EM121A_SIS_SPECIFIC       132u
-#define GSF_SWATH_BATHY_SUBRECORD_EM710_SPECIFIC            133u
-#define GSF_SWATH_BATHY_SUBRECORD_EM302_SPECIFIC            134u
-#define GSF_SWATH_BATHY_SUBRECORD_EM122_SPECIFIC            135u
-#define GSF_SWATH_BATHY_SUBRECORD_GEOSWATH_PLUS_SPECIFIC    136u /* 2006-09-27: dhg: GeoAcoustics GeoSwath+ */
-#define GSF_SWATH_BATHY_SUBRECORD_KLEIN_5410_BSS_SPECIFIC   137u
-#define GSF_SWATH_BATHY_SUBRECORD_RESON_7125_SPECIFIC       138u /* 2008-07-17: mab: Reson7p series sonars */
-#define GSF_SWATH_BATHY_SUBRECORD_EM2000_SPECIFIC           139u
-#define GSF_SWATH_BATHY_SUBRECORD_EM300_RAW_SPECIFIC        140u /* 2009-02-10: mab: EM3 sonars with raw range and beam angles */
-#define GSF_SWATH_BATHY_SUBRECORD_EM1002_RAW_SPECIFIC       141u
-#define GSF_SWATH_BATHY_SUBRECORD_EM2000_RAW_SPECIFIC       142u
-#define GSF_SWATH_BATHY_SUBRECORD_EM3000_RAW_SPECIFIC       143u
-#define GSF_SWATH_BATHY_SUBRECORD_EM120_RAW_SPECIFIC        144u
-#define GSF_SWATH_BATHY_SUBRECORD_EM3002_RAW_SPECIFIC       145u
-#define GSF_SWATH_BATHY_SUBRECORD_EM3000D_RAW_SPECIFIC      146u
-#define GSF_SWATH_BATHY_SUBRECORD_EM3002D_RAW_SPECIFIC      147u
-#define GSF_SWATH_BATHY_SUBRECORD_EM121A_SIS_RAW_SPECIFIC   148u
-#define GSF_SWATH_BATHY_SUBRECORD_EM2040_SPECIFIC           149u
-#define GSF_SWATH_BATHY_SUBRECORD_DELTA_T_SPECIFIC          150u
-#define GSF_SWATH_BATHY_SUBRECORD_R2SONIC_2022_SPECIFIC     151u
-#define GSF_SWATH_BATHY_SUBRECORD_R2SONIC_2024_SPECIFIC     152u
-#define GSF_SWATH_BATHY_SUBRECORD_R2SONIC_2020_SPECIFIC     153u
-
-#define GSF_SINGLE_BEAM_SUBRECORD_UNKNOWN                     0u
-#define GSF_SINGLE_BEAM_SUBRECORD_ECHOTRAC_SPECIFIC         201u
-#define GSF_SINGLE_BEAM_SUBRECORD_BATHY2000_SPECIFIC        202u
-#define GSF_SINGLE_BEAM_SUBRECORD_MGD77_SPECIFIC            203u
-#define GSF_SINGLE_BEAM_SUBRECORD_BDB_SPECIFIC              204u
-#define GSF_SINGLE_BEAM_SUBRECORD_NOSHDB_SPECIFIC           205u
-#define GSF_SWATH_BATHY_SB_SUBRECORD_ECHOTRAC_SPECIFIC      206u
-#define GSF_SWATH_BATHY_SB_SUBRECORD_BATHY2000_SPECIFIC     207u
-#define GSF_SWATH_BATHY_SB_SUBRECORD_MGD77_SPECIFIC         208u
-#define GSF_SWATH_BATHY_SB_SUBRECORD_BDB_SPECIFIC           209u
-#define GSF_SWATH_BATHY_SB_SUBRECORD_NOSHDB_SPECIFIC        210u
-#define GSF_SWATH_BATHY_SB_SUBRECORD_PDD_SPECIFIC           211u
-#define GSF_SWATH_BATHY_SB_SUBRECORD_NAVISOUND_SPECIFIC     212u
-
-/* Define null values to be used for missing data */
-#define GSF_NULL_LATITUDE               91.0
-#define GSF_NULL_LONGITUDE             181.0
-#define GSF_NULL_HEADING               361.0
-#define GSF_NULL_COURSE                361.0
-#define GSF_NULL_SPEED                  99.0
-#define GSF_NULL_PITCH                  99.0
-#define GSF_NULL_ROLL                   99.0
-#define GSF_NULL_HEAVE                  99.0
-#define GSF_NULL_DRAFT                   0.0
-#define GSF_NULL_DEPTH_CORRECTOR        99.99
-#define GSF_NULL_TIDE_CORRECTOR         99.99
-#define GSF_NULL_SOUND_SPEED_CORRECTION 99.99
-#define GSF_NULL_HORIZONTAL_ERROR       -1.00
-#define GSF_NULL_VERTICAL_ERROR         -1.00
-#define GSF_NULL_HEIGHT               9999.99
-#define GSF_NULL_SEP                  9999.99
-#define GSF_NULL_SEP_UNCERTAINTY         0.0
-
-/* Define null values for the swath bathymetry ping array types. Note that
- * these zero values do not necessarily indicate a non-valid value.  The
- * beam flags array should be used to determine data validity.
- */
-#define GSF_NULL_DEPTH                 0.0
-#define GSF_NULL_ACROSS_TRACK          0.0
-#define GSF_NULL_ALONG_TRACK           0.0
-#define GSF_NULL_TRAVEL_TIME           0.0
-#define GSF_NULL_BEAM_ANGLE            0.0
-#define GSF_NULL_MC_AMPLITUDE          0.0
-#define GSF_NULL_MR_AMPLITUDE          0.0
-#define GSF_NULL_ECHO_WIDTH            0.0
-#define GSF_NULL_QUALITY_FACTOR        0.0
-#define GSF_NULL_RECEIVE_HEAVE         0.0
-#define GSF_NULL_DEPTH_ERROR           0.0
-#define GSF_NULL_ACROSS_TRACK_ERROR    0.0
-#define GSF_NULL_ALONG_TRACK_ERROR     0.0
-#define GSF_NULL_NAV_POS_ERROR         0.0
-
-/* Define macros used to indicate that a certain parameter is not known */
-#define GSF_BEAM_WIDTH_UNKNOWN        -1.0
-
-/* define Posix.4 proposed structure for internal storage of time */
-/* timespec is defined in __MINGW64__ but it appears that they don't set a macro for it.  JCD  */
-#if (!defined (_STRUCT_TIMESPEC_) && !defined (_TIMESPEC_T) && !defined (_STRUCT_TIMESPEC) && !defined (_SYS_TIMESPEC_H) && !defined (__timespec_defined) && !defined (__MINGW64__) && !defined (HAVE_STRUCT_TIMESPEC) && !defined _TIMESPEC_DEFINED)
-#define HAVE_STRUCT_TIMESPEC
-#define _STRUCT_TIMESPEC_
-#define _TIMESPEC_T
-#define _STRUCT_TIMESPEC
-#define _SYS_TIMESPEC_H
-#define __timespec_defined
-#define _TIMESPEC_DEFINED
-/* MAC OSX is a different bird, and while doesn't have the structures defined */
-/* above, does have the timespec structure defined. __APPLE__ will be set when  */
-/* compiled with Apple's gcc on OSX and other third party compilers, so we use it to */
-/* insure the definition below does not conflict. */
- #ifndef __APPLE__
-
-    struct timespec
-    {
-        time_t          tv_sec;
-        long            tv_nsec;
-    };
- #endif
-#endif
-
-/* Define a structure for the gsf header record */
-#define GSF_VERSION_SIZE 12
-typedef struct t_gsfHeader
-{
-    char            version[GSF_VERSION_SIZE];
-}
-gsfHeader;
-
-/* Define the data structure for the swath bathymety summary record */
-typedef struct t_gsfSwathBathySummary
-{
-    struct timespec start_time;
-    struct timespec end_time;
-    double          min_latitude;
-    double          min_longitude;
-    double          max_latitude;
-    double          max_longitude;
-    double          min_depth;
-    double          max_depth;
-}
-gsfSwathBathySummary;
-
-
-/* Define the typeIII specific data structure */
-typedef struct t_gsfTypeIIISpecific               /* 03-30-99 wkm/dbj: Obsolete replaced with t_gsfTypeCmpSassSpecific */
-{
-    unsigned short  leftmost_beam;  /* 0 - leftmost possible beam */
-    unsigned short  rightmost_beam;
-    unsigned short  total_beams;
-    unsigned short  nav_mode;
-    unsigned short  ping_number;
-    unsigned short  mission_number;
-}
-t_gsfTypeIIISpecific;
-
-
-/* Define the CMP (Compressed) SASS specific data structure (from sass.h) */
-typedef struct t_gsfCmpSassSpecific
-{
-    /************************************************************************************
-     *
-     *   Mapping from Compressed SASS (BOSDAT) to GSF record
-     *
-     *    from          to                   comment
-     *    ===============================================================================
-     *
-     *    lntens        ping.heave           mapped only when year is post 1991 or
-     *                                       user has elected to force mapping.
-     *    lfreq         not-mapped
-     *    ldraft        comment              APPLIED_DRAFT comment record
-     *    svp.svel      svp.sound_velocity   at <= 1000 ... FATHOMS
-     *                                       at <= 2500 ... METERS
-     *                                       otherwise  ... FEET
-     *    svp.deptl     svp.depth            (see sound_velocity)
-     *    lmishn        comment              MISSION_NUMBER comment record
-     *    luyr          ping_time            GSF time record from 1960 to 1970 base
-     *    pitchl        ping.pitch
-     *    rolll         ping.roll
-     *    lbear         ping.heading         SASS specific (not Seabeam)
-     *    pinhd         ping.heading         Seabeam specific (not SASS)
-     *    depth         ping.nominal_depth   FATHOMS_TO_METERS_NOMINAL
-     *    pslatl        ping.across_track    YARDS_TO_METERS_EXACT
-     *    bltime        ping.travel_time
-     *    ampl          ping.mr_amplitude
-     *    <ftaf file>   ping.beam_flags      HMPS_FLAGS
-     *    alpos         ping.along_track     SASS specific YARDS_TO_METERS_EXACT
-     *
-     ************************************************************************************/
-
-    double lfreq;  /* sea-surface sound velocity in feet/sec from bosdat(lfreq) */
-    double lntens; /* post 1992 heave, before 1992 unclear what field contained. */
-}
-t_gsfCmpSassSpecific;
-
-/* Define the 16 Beam SeaBeam specific data structure */
-typedef struct t_gsfSeabeamSpecific
-{
-    unsigned short  EclipseTime; /* In 10ths of seconds */
-}
-t_gsfSeaBeamSpecific;
-
-typedef struct t_gsfSBAmpSpecific
-{
-    unsigned char   hour;
-    unsigned char   minute;
-    unsigned char   second;
-    unsigned char   hundredths;
-    unsigned int    block_number;
-    short           avg_gate_depth;
-}
-t_gsfSBAmpSpecific;
-
-/* Define the Seamap specific data structure */
-typedef struct t_gsfSeamapSpecific
-{
-    double          portTransmitter[2];
-    double          stbdTransmitter[2];
-    double          portGain;
-    double          stbdGain;
-    double          portPulseLength;
-    double          stbdPulseLength;
-    double          pressureDepth;
-    double          altitude;
-    double          temperature;
-}
-t_gsfSeamapSpecific;
-
-/* Define the EM950/EM1000 specific data structure */
-typedef struct t_gsfEM950Specific
-{
-    int             ping_number;
-    int             mode;
-    int             ping_quality;
-    double          ship_pitch;
-    double          transducer_pitch;
-    double          surface_velocity;
-}
-t_gsfEM950Specific;
-
-/* Define the EM100 specific data structure */
-typedef struct t_gsfEM100Specific
-{
-    double          ship_pitch;
-    double          transducer_pitch;
-    int             mode;
-    int             power;
-    int             attenuation;
-    int             tvg;
-    int             pulse_length;
-    int             counter;
-}
-t_gsfEM100Specific;
-
-/* Define the EM121A specific data structure */
-typedef struct t_gsfEM121ASpecific
-{
-    int             ping_number;
-    int             mode;
-    int             valid_beams;
-    int             pulse_length;
-    int             beam_width;
-    int             tx_power;
-    int             tx_status;
-    int             rx_status;
-    double          surface_velocity;
-}
-t_gsfEM121ASpecific;
-
-/* Define the Reson SeaBat specific data structure */
-typedef struct t_gsfSeaBatSpecific
-{
-    int             ping_number;
-    double          surface_velocity;
-    int             mode;
-    int             sonar_range;
-    int             transmit_power;
-    int             receive_gain;
-}
-t_gsfSeaBatSpecific;
-
-/* The gsfSeaBatIISpecific data structure is intended to replace the
- * gsfSeaBatSpecific data structure as of GSF_1.04.
- */
-typedef struct t_gsfSeaBatIISpecific
-{
-    int             ping_number;            /* 1 - 32767 */
-    double          surface_velocity;       /* meters/second */
-    int             mode;                   /* bit mapped, see macros below */
-    int             sonar_range;            /* meters */
-    int             transmit_power;
-    int             receive_gain;
-    double          fore_aft_bw;            /* fore/aft beam width in degrees */
-    double          athwart_bw;             /* athwartships beam width in degrees */
-    char            spare[4];               /* Four bytes of spare space, for future use */
-}
-t_gsfSeaBatIISpecific;
-
-/* Macro definitions for the SeaBatSpecific and SeaBatIISpecific mode field */
-#define GSF_SEABAT_WIDE_MODE         0x01   /* if set 10 deg fore-aft */
-#define GSF_SEABAT_9002              0x02   /* if set two sonar heads */
-#define GSF_SEABAT_STBD_HEAD         0x04   /* if set starboard ping (seabat head 2) */
-#define GSF_SEABAT_9003              0x08   /* if set 9003 series sonar (40 beams) */
-
-/* Define the Reson SeaBat specific data structure */
-typedef struct t_gsfSeaBat8101Specific
-{
-    int             ping_number;            /* 1 - 65535 */
-    double          surface_velocity;       /* meters/second */
-    int             mode;                   /* bit mapped, see macros below */
-    int             range;                  /* meters */
-    int             power;                  /* 0-8 + status bits */
-    int             gain;                   /* 1-45 + status bits */
-    int             pulse_width;            /* in microseconds */
-    int             tvg_spreading;          /* tvg spreading coefficient * 4 */
-    int             tvg_absorption;         /* tvg absorption coefficient */
-    double          fore_aft_bw;            /* fore/aft beam width in degrees */
-    double          athwart_bw;             /* athwartships beam width in degrees */
-    double          range_filt_min;         /* range filter, minimum value, meters (future use) */
-    double          range_filt_max;         /* range filter, maximum value, meters (future use) */
-    double          depth_filt_min;         /* depth filter, minimum value, meters (future use) */
-    double          depth_filt_max;         /* depth filter, maximum value, meters (future use) */
-    int             projector;              /* projector type (future use) */
-    char            spare[4];               /* Four bytes of spare space, for future use */
-}
-t_gsfSeaBat8101Specific;
-
-/* Macro definitions for the SeaBat8101Specific and SeaBat8101Specific mode field */
-#define GSF_8101_WIDE_MODE         0x01   /* set if transmit on receiver */
-#define GSF_8101_TWO_HEADS         0x02   /* set if two sonar heads */
-#define GSF_8101_STBD_HEAD         0x04   /* set if starboard ping (seabat head 2) */
-#define GSF_8101_AMPLITUDE         0x08   /* set if beam amplitude is available (RITHETA packet) */
-
-/* Define the Reson SeaBat specific data structure */
-typedef struct t_gsfReson7100Specific
-{
-    unsigned int       protocol_version;                       /* Obtained from the Data Record Frame (DRF) */
-    unsigned int       device_id;                              /* i.e. 7101, 7111, 7125, etc. Obtained from the DRF */
-    unsigned char      reserved_1[16];                         /* Placeholder for growth of fields from DRF */
-    unsigned int       major_serial_number;                    /* high order 4 bytes of sonar serial number, from record 7000 */
-    unsigned int       minor_serial_number;                    /* low order 4 bytes of sonar serial number, from record 7000 */
-    unsigned int       ping_number;                            /* sequential number, unique for each ping, wraps at boundary */
-    unsigned int       multi_ping_seq;                         /* 0 if not in multi-ping mode, otherwise number of pings in a multi-ping sequence */
-    double             frequency;                              /* Sonar operating frequency in Hz. From record 7000 */
-    double             sample_rate;                            /* Sonar system sampling rate in Hz. From record 7000 */
-    double             receiver_bandwdth;                      /* Sonar system signal bandwidth in Hz. From record 7000 */
-    double             tx_pulse_width;                         /* Transmit pulse length in seconds. From record 7000 */
-    unsigned int       tx_pulse_type_id;                       /* 0=CW, 1=Linear chirp, from record 7000 */
-    unsigned int       tx_pulse_envlp_id;                      /* 0=Tapered rectangular, 1=Tukey, from record 7000 */
-    unsigned int       tx_pulse_envlp_param;                   /* four byte field containing envelope parameter, no definition or units available, from record 7000 */
-    unsigned int       tx_pulse_reserved;                      /* four byte field reserved for future growth, from record 7000 */
-    double             max_ping_rate;                          /* Maximum ping rate in pings per second, from record 7000 */
-    double             ping_period;                            /* seconds since last ping, from record 7000 */
-    double             range;                                  /* Sonar range selection in meters, from record 7000 */
-    double             power;                                  /* Power selection in dB re 1 microPa, from record 7000 */
-    double             gain;                                   /* Gain selection in dB, from record 7000 */
-    unsigned int       control_flags;                          /*   0-3: Auto range method
-                                                                    4-7: Auto bottom detect filter method
-                                                                      8: Bottom detect range filter
-                                                                      9: Bottom detect depth filter
-                                                                  10-14: Auto receiver gain method
-                                                                  15-31: Reserved */
-    unsigned int       projector_id;                           /* projector selection, from record 7000 */
-    double             projector_steer_angl_vert;              /* degrees, from record 7000 */
-    double             projector_steer_angl_horz;              /* degrees, from record 7000 */
-    double             projector_beam_wdth_vert;               /* degrees, from record 7000 */
-    double             projector_beam_wdth_horz;               /* degrees, from record 7000 */
-    double             projector_beam_focal_pt;                /* meters, from record 7000 */
-    unsigned int       projector_beam_weighting_window_type;   /* 0-Rectangular, 1-Chebychhev, from record 7000 */
-    unsigned int       projector_beam_weighting_window_param;  /* four byte projector weighting parameter, no definition or units available, from record 7000 */
-    unsigned int       transmit_flags;                         /* 0-3: Pitch stabilization method
-                                                                  4-6: Yaw stabilization method
-                                                                  8-31: Reserved */
-    unsigned int       hydrophone_id;                          /* hydrophone selection, from record 7000 */
-    unsigned int       receiving_beam_weighting_window_type;   /* 0-Chebychev, 1-Kaiser, from record 7000 */
-    unsigned int       receiving_beam_weighting_window_param;  /* four byte receiver weighting parameter, no definition or units available, from record 7000 */
-    unsigned int       receive_flags;                          /*  0-3: Roll stabilization method
-                                                                   4-7: Dynamic focusing method
-                                                                   8-11: Doppler compensation method
-                                                                  12-15: Match filtering method
-                                                                  16-19: TVG method
-                                                                  20-23: Multi-Ping Mode
-                                                                  24-31: Reserved */
-    double             receive_beam_width;                     /* angle in degrees, from record 7000 */
-    double             range_filt_min;                         /* range filter, minimum value, meters, from record 7000 */
-    double             range_filt_max;                         /* range filter, maximum value, meters, from record 7000 */
-    double             depth_filt_min;                         /* depth filter, minimum value, meters, from record 7000 */
-    double             depth_filt_max;                         /* depth filter, maximum value, meters, from record 7000 */
-    double             absorption;                             /* absorption in dB/km, from record 7000 */
-    double             sound_velocity;                         /* sound speed in m/s at transducer, from record 7006 */
-    double             spreading;                              /* spreading loss in dB from record 7000 */
-    char               reserved_2[16];                         /* spare space, for future use */
-    unsigned char      sv_source;                              /* (0: measured, 1: manual), from record 7006 */
-    unsigned char      layer_comp_flag;                        /* (0: off, 1: on), from record 7006 */
-    char               reserved_3[8];                          /* spare space, for future use */
-}
-t_gsfReson7100Specific;
-
-#define GSF_7100_PITCH_STAB             0x0001 /* set if pitch stabilized */
-#define GSF_7100_ROLL_STAB              0x0001 /* set if roll stabilized */
-
-/* Define the SeaBeam 2112/36 specific data structure */
-typedef struct t_gsfSeaBeam2112Specific
-{
-    int             mode;                       /* bit mapped, see macros below */
-    double          surface_velocity;           /* meters/second */
-    char            ssv_source;                 /* (V)elocimiter, (M)anual, (T)emperature,
-                                                   (E)xternal, or (U)nknown */
-    int             ping_gain;                  /* dB */
-    int             pulse_width;                /* in milliseconds */
-    int             transmitter_attenuation;    /* dB */
-    int             number_algorithms;          /* algorithms per beam (1-4) */
-    char            algorithm_order[5];         /* null terminated string, each char will be either
-                                                   a space, W(MT), or B(DI). if number_algorithms
-                                                   equals one, this will be four spaces */
-    char            spare[2];                   /* Two bytes of spare space, for future use */
-}
-t_gsfSeaBeam2112Specific;
-
-/* Macro definitions for the SeaBeam2112Specific mode field */
-#define GSF_2112_SVP_CORRECTION   0x01    /* set if true depth, true position corrections are used */
-#define GSF_2112_LOW_FREQUENCY    0x02    /* set if using 12kHz frequecy - 36kHz if not set */
-#define GSF_2112_AUTO_DEPTH_GATE  0x04    /* set if depth gate mode is automatic - manual if not set */
-
-/* SeaBeam 2112 specific macro definitions for the quality factor array */
-#define GSF_2112_POOR_QUALITY     0x01    /* set if the beam was flagged by the SeaBeam as poor quality */
-#define GSF_2112_DATA_SOURCE_WMT  0x10    /* set if the data source is WMT - source is BDI if not set */
-
-/* Define the Elac MkII specific data structure */
-typedef struct t_gsfElacMkIISpecific
-{
-    int             mode;                       /* bit mapped, see macros below */
-    int             ping_num;
-    int             sound_vel;                  /* 0.1 m/s */
-    int             pulse_length;               /* 0.01 ms */
-    int             receiver_gain_stbd;         /* db */
-    int             receiver_gain_port;         /* db */
-    int             reserved;
-}
-t_gsfElacMkIISpecific;
-
-/* Macro definitions for the ElacMkIISpecific mode field */
-#define GSF_MKII_LOW_FREQUENCY    0x01    /* set if using 12kHz frequecy - 36kHz if not set */
-#define GSF_MKII_SOURCE_MODE      0x02    /* set if RDT transmit used, otherwise omni */
-#define GSF_MKII_SOURCE_POWER     0x04    /* set if transmit high power - low power if not set */
-#define GSF_MKII_STBD_HEAD        0x08    /* set if starboard ping */
-
-/* Define a data structure to hold the Simrad EM3000 series run time parameters. */
-typedef struct t_gsfEM3RunTime
-{
-    int             model_number;               /* from the run-time parameter datagram */
-    struct timespec dg_time;                    /* from the run-time parameter datagram */
-    int             ping_number;                /* sequential counter 0 - 65535 */
-    int             serial_number;              /* The sonar head serial number */
-    int             system_status;              /* normally = 0 */
-    int             mode;                       /* 0=nearfield, 1=normal, 2=target, 3=deep, 4=very deep */
-    int             filter_id;
-    double          min_depth;                  /* meters */
-    double          max_depth;                  /* meters */
-    double          absorption;                 /* dB/km */
-    double          pulse_length;               /* micro seconds */
-    double          transmit_beam_width;        /* degrees */
-    int             power_reduction;            /* dB */
-    double          receive_beam_width;         /* degrees */
-    int             receive_bandwidth;          /* Hz */
-    int             receive_gain;               /* dB */
-    int             cross_over_angle;           /* degrees */
-    int             ssv_source;                 /* 0=sensor, 1=manual, 2=profile */
-    int             swath_width;                /* total swath width in meters */
-    int             beam_spacing;               /* 0=beamwidth, 1=equiangle, 2=equidistant, 3=intermediate */
-    int             coverage_sector;            /* total coverage in degrees */
-    int             stabilization;
-    int             port_swath_width;           /* maximum port swath width in meters */
-    int             stbd_swath_width;           /* maximum starboard swath width in meters */
-    int             port_coverage_sector;       /* maximum port coverage in degrees */
-    int             stbd_coverage_sector;       /* maximum starboard coverage in degrees */
-    int             hilo_freq_absorp_ratio;
-    int             spare1;                     /* four spare bytes */
-}
-gsfEM3RunTime;
-
-/* Define the Simrad EM3000 series specific data structure */
-typedef struct t_gsfEM3Specific
-{
-    /* The first nine values are updated with each depth datagram */
-    int             model_number;               /* ie: 3000, ... */
-    int             ping_number;                /* 0 - 65535 */
-    int             serial_number;              /* 100 - 65535 */
-    double          surface_velocity;           /* in m/s */
-    double          transducer_depth;           /* transmit transducer depth in meters */
-    int             valid_beams;                /* number of valid beams for this ping */
-    int             sample_rate;                /* in Hz */
-    double          depth_difference;           /* in meters between sonar heads in em3000d configuration */
-    int             offset_multiplier;          /* transducer depth offset multiplier */
-    /* The gsfEM3RunTime data structure is updated with each run-time parameter datagram */
-    gsfEM3RunTime   run_time[2];                /* A two element array is needed to support em3000d */
-}
-t_gsfEM3Specific;
-
-/* Define the Reson 8100 specific data structure */
-typedef struct t_gsfReson8100Specific
-{
-    int             latency;                /* time from ping to output (milliseconds) */
-    int             ping_number;            /* 4 byte ping number */
-    int             sonar_id;               /* least significant 4 bytes of ethernet address */
-    int             sonar_model;            /*  */
-    int             frequency;              /* KHz */
-    double          surface_velocity;       /* meters/second */
-    int             sample_rate;            /* A/D samples per second */
-    int             ping_rate;              /* pings per second * 1000 */
-    int             mode;                   /* bit mapped, see macros below */
-    int             range;                  /* meters */
-    int             power;                  /* 0-8 + status bits */
-    int             gain;                   /* 1-45 + status bits */
-    int             pulse_width;            /* in microseconds */
-    int             tvg_spreading;          /* tvg spreading coefficient * 4 */
-    int             tvg_absorption;         /* tvg absorption coefficient */
-    double          fore_aft_bw;            /* fore/aft beam width in degrees */
-    double          athwart_bw;             /* athwartships beam width in degrees */
-    int             projector_type;         /* projector type */
-    int             projector_angle;        /* projector pitch steering angle (degrees * 100) */
-    double          range_filt_min;         /* range filter, minimum value, meters */
-    double          range_filt_max;         /* range filter, maximum value, meters */
-    double          depth_filt_min;         /* depth filter, minimum value, meters */
-    double          depth_filt_max;         /* depth filter, maximum value, meters */
-    int             filters_active;         /* bit 0 - range filter, bit 1 - depth filter */
-    int             temperature;            /* temperature at sonar head (deg C * 10) */
-    double          beam_spacing;           /* across track receive beam angular spacing */
-    char            spare[2];               /* Two remaining bytes of spare space, for future use */
-}
-t_gsfReson8100Specific;
-
-/* Macro definitions for the SeaBat8100Specific mode field */
-#define GSF_8100_WIDE_MODE              0x01 /* set if transmit on receiver */
-#define GSF_8100_TWO_HEADS              0x02 /* set if two sonar heads */
-#define GSF_8100_STBD_HEAD              0x04 /* set if starboard ping (seabat head 2) */
-#define GSF_8100_AMPLITUDE              0x08 /* set if beam amplitude is available (RITHETA packet) */
-#define GSF_8100_PITCH_STAB             0x10 /* set if pitch stabilized */
-#define GSF_8100_ROLL_STAB              0x20 /* set if roll stabilized */
-
-/* Define the Echotrac Single-Beam sensor specific data structure. */
-
-#define GSF_SB_MPP_SOURCE_UNKNOWN       0x00 /* Unknown MPP source */
-#define GSF_SB_MPP_SOURCE_GPS_3S        0x01 /* GPS 3S */
-#define GSF_SB_MPP_SOURCE_GPS_TASMAN    0x02 /* GPS Tasman */
-#define GSF_SB_MPP_SOURCE_DGPS_TRIMBLE  0x03 /* DGPS Trimble */
-#define GSF_SB_MPP_SOURCE_DGPS_TASMAN   0x04 /* DGPS Tasman */
-#define GSF_SB_MPP_SOURCE_DGPS_MAG      0x05 /* DGPS MagMPPox */
-#define GSF_SB_MPP_SOURCE_RANGE_MFIX    0x06 /* Range/Azimauth - Microfix */
-#define GSF_SB_MPP_SOURCE_RANGE_TRIS    0x07 /* Range/Azimauth - Trisponder */
-#define GSF_SB_MPP_SOURCE_RANGE_OTHER   0x08 /* Range/Azimauth - Other */
-
-typedef struct t_gsfSBEchotracSpecific
-{
-    int             navigation_error;
-    unsigned short  mpp_source;     /* Flag To determine mpp source - See above */
-    unsigned short  tide_source;    /* in GSF Version 2.02+ this is in ping flags */
-    double          dynamic_draft;  /* speed induced draft im meters */
-    char            spare[4];       /* four bytes of reserved space */
-
-}
-t_gsfSBEchotracSpecific;
-
-/* Define the MGD77 Single-Beam sensor specific data structure. */
-typedef struct t_gsfSBMGD77Specific
-{
-    unsigned short  time_zone_corr;
-    unsigned short  position_type_code;
-    unsigned short  correction_code;
-    unsigned short  bathy_type_code;
-    unsigned short  quality_code;
-    double          travel_time;
-    char            spare[4];                  /* four bytes of reserved space */
-}
-t_gsfSBMGD77Specific;
-
-/* Define the BDB sensor specific data structure */
-typedef struct t_gsfSBBDBSpecific
-{
-    int   doc_no;         /* Document number (5 digits) */
-    char  eval;           /* Evaluation (1-best, 4-worst) */
-    char  classification; /* Classification ((U)nclass, (C)onfidential,
-                                             (S)ecret, (P)roprietary/Unclass,
-                                             (Q)Proprietary/Class) */
-    char  track_adj_flag; /* Track Adjustment Flag (Y,N) */
-    char  source_flag;    /* Source Flag ((S)urvey, (R)andom, (O)cean Survey) */
-    char  pt_or_track_ln; /* Discrete Point (D) or Track Line (T) Flag */
-    char  datum_flag;     /* Datum Flag ((W)GS84, (D)atumless) */
-    char  spare[4];       /* four bytes of reserved space */
-}
-t_gsfSBBDBSpecific;
-
-/* Define the NOS HDB sensor specific data structure */
-typedef struct t_gsfSBNOSHDBSpecific
-{
-    unsigned short  type_code;    /*  Depth type code  */
-    unsigned short  carto_code;   /*  Cartographic code  */
-    char            spare[4];     /* four bytes of reserved space */
-}
-t_gsfSBNOSHDBSpecific;
-
-/* Define the Navisound sensor specific data structure */
-typedef struct t_gsfSBNavisoundSpecific
-{
-    double          pulse_length;    /*  pulse length in cm  */
-    char            spare[8];     /* eight bytes of reserved space */
-}
-t_gsfSBNavisoundSpecific;
-
-/* Macro definitions for EM4 series sector data details */
-#define  GSF_MAX_EM4_SECTORS     9
-#define  GSF_MAX_EM3_SECTORS     20
-
-/* Define sub-structure for the transmit sectors */
-#define  GSF_EM_WAVEFORM_CW      0
-#define  GSF_EM_WAVEFORM_FM_UP   1
-#define  GSF_EM_WAVEFORM_FM_DOWN 2
-
-typedef struct t_gsfEM4TxSector
-{
-    double          tilt_angle;                     /* transmitter tilt angle in degrees */
-    double          focus_range;                    /* focusing range, 0.0 for no focusing */
-    double          signal_length;                  /* transmit signal duration in seconds */
-    double          transmit_delay;                 /* Sector transmit delay from first transmission in seconds */
-    double          center_frequency;               /* center frequency in Hz */
-    double          mean_absorption;                /* mean absorption coefficient in 0.01 dB/kilometer */
-    int             waveform_id;                    /* signal waveform ID 0=CW; 1=FM upsweep; 2=FM downsweep */
-    int             sector_number;                  /* transmit sector number */
-    double          signal_bandwidth;               /* signal bandwidth in Hz */
-    unsigned char   spare[16];                      /* spare space */
-}
-t_gsfEM4TxSector;
-
-typedef struct t_gsfEM3RawTxSector
-{
-    double          tilt_angle;                     /* transmitter tilt angle in degrees */
-    double          focus_range;                    /* focusing range, 0.0 for no focusing */
-    double          signal_length;                  /* transmit signal duration in seconds */
-    double          transmit_delay;                 /* Sector transmit delay from first transmission in seconds */
-    double          center_frequency;               /* center frequency in Hz */
-    int             waveform_id;                    /* signal waveform ID 0=CW; 1=FM upsweep; 2=FM downsweep */
-    int             sector_number;                  /* transmit sector number */
-    double          signal_bandwidth;               /* signal bandwidth in Hz */
-    unsigned char   spare[16];                      /* spare space */
-}
-t_gsfEM3RawTxSector;
-
-/* The following macro definitions are to aid in interpretation of the sonar mode field */
-#define GSF_EM_MODE_VERY_SHALLOW 0x00               /* Bits 2,1,0 cleared means very shallow mode */
-#define GSF_EM_MODE_SHALLOW      0x01               /* Bit zero set means shallow mode */
-#define GSF_EM_MODE_MEDIUM       0x02               /* Bit one set means medium mode */
-#define GSF_EM_MODE_DEEP         0x03               /* Bits one and zero set means deep mode */
-#define GSF_EM_MODE_VERY_DEEP    0x04               /* Bit two set means very deep mode */
-#define GSF_EM_MODE_EXTRA_DEEP   0x05               /* Bits two and one set means extra deep mode */
-#define GSF_EM_MODE_MASK         0x07               /* Mask off bits 2,1,0 to determine just the mode */
-                                                    /* Exact definition of bits 5,4,3 not clear from document rev J. */
-#define GSF_EM_MODE_DS_OFF       0xC0               /* bits 7 and 6 cleared means dual swath off */
-#define GSF_EM_MODE_DS_FIXED     0x40               /* bit 6 set means dual swath in fixed mode */
-#define GSF_EM_MODE_DS_DYNAMIC   0x80               /* bit 7 set means dual swath in dynamic mode */
-
-/* Define a data structure to hold the Simrad EM series run time parameters per datagram document rev I. */
-typedef struct t_gsfEMRunTime
-{
-    int              model_number;                  /* from the run-time parameter datagram */
-    struct timespec  dg_time;                       /* from the run-time parameter datagram */
-    int              ping_counter;                  /* sequential counter 0 - 65535 */
-    int              serial_number;                 /* The primary sonar head serial number */
-    unsigned char    operator_station_status;       /* Bit mask of status information for operator station */
-    unsigned char    processing_unit_status;        /* Bit mask of status information for sonar processor unit */
-    unsigned char    bsp_status;                    /* Bit mask of status information for BSP status */
-    unsigned char    head_transceiver_status;       /* Bit mask of status information for sonar head or sonar transceiver */
-    unsigned char    mode;                          /* Bit mask of sonar operating information, see mode bit mask definitions */
-    unsigned char    filter_id;                     /* one byte tit mask for various sonar processing filter settings */
-    double           min_depth;                     /* meters */
-    double           max_depth;                     /* meters */
-    double           absorption;                    /* dB/km */
-    double           tx_pulse_length;               /* in micro seconds */
-    double           tx_beam_width;                 /* degrees */
-    double           tx_power_re_max;               /* The transmit power referenced to maximum power in dB */
-    double           rx_beam_width;                 /* degrees */
-    double           rx_bandwidth;                  /* Hz */
-    double           rx_fixed_gain;                 /* dB */
-    double           tvg_cross_over_angle;          /* degrees */
-    unsigned char    ssv_source;                    /* one byte bit mask defining SSSV source -> 0=sensor, 1=manual, 2=profile */
-    int              max_port_swath_width;          /* total swath width to port side in meters */
-    unsigned char    beam_spacing;                  /* one byte bit mask -> 0=beamwidth, 1=equiangle, 2=equidistant, 3=intermediate */
-    int              max_port_coverage;             /* coverage to port side in degrees */
-    unsigned char    stabilization;                 /* one byte bit mask defining yaw and pitch stabilization mode */
-    int              max_stbd_coverage;             /* coverage to starboard side in degrees */
-    int              max_stbd_swath_width;          /* total swath width to starboard side in meters */
-    double           durotong_speed;                /* Sound speed in Durotong (SSD). Field only valid for the EM 1002 */
-    double           hi_low_absorption_ratio;       /* HiLo frequency absorption coefficient ratio, field valid only for EM3 sonars */
-    double           tx_along_tilt;                 /* Transmit fan along track tilt angle in degrees, field valid only for EM4 sonars */
-    unsigned char    filter_id_2;                   /* two lowest order bits define the penetration filter setting: off, weak, medium, or strong */
-    unsigned char    spare[16];                     /* 16 spare bytes */
-}
-t_gsfEMRunTime;
-
-/* Macro definitions for bits of pu_status field */
-#define GSF_EM_VALID_1_PPS      0x0001              /* If set, then 1 PPS timing is valid */
-#define GSF_EM_VALID_POSITION   0x0002              /* If set, then position input is valid */
-#define GSF_EM_VALID_ATTITUDE   0x0004              /* If set, then attitude input is valid */
-#define GSF_EM_VALID_CLOCK      0x0008              /* If set, then clock status is valid */
-#define GSF_EM_VALID_HEADING    0x0010              /* If set, then heading status is valid */
-#define GSF_EM_PU_ACTIVE        0x0020              /* If set, then PU is active (i.e. pinging) */
-
-/* Define a data structure to hold the Simrad EM series PU status values per datagram document rev I. */
-typedef struct t_gsfEMPUStatus
-{
-    double           pu_cpu_load;                   /* Percent CPU load in the processor unit */
-    unsigned short   sensor_status;                 /* Bit mask containing status of sensor inputs */
-    int              achieved_port_coverage;        /* Achieved coverage to port in degrees */
-    int              achieved_stbd_coverage;        /* Achieved coverage to starboard in degrees */
-    double           yaw_stabilization;             /* in degrees */
-    unsigned char    spare[16];
-}
-t_gsfEMPUStatus;
-
-/* Define sensor specific data structures for the Kongsberg 710/302/122 */
-typedef struct t_gsfEM4Specific
-{
-    /* values from the XYZ datagram and raw range datagram */
-    int              model_number;                  /* 122, or 302, or 710, or ... */
-    int              ping_counter;                  /* Sequential ping counter, 1 through 65535 */
-    int              serial_number;                 /* System unique serial number, 100 - ? */
-    double           surface_velocity;              /* Measured sound speed near the surface in m/s */
-    double           transducer_depth;              /* The transmit transducer depth in meters re water level at ping time */
-    int              valid_detections;              /* number of beams with a valid bottom detection for this ping */
-    double           sampling_frequency;            /* The system digitizing rate in Hz */
-    unsigned int     doppler_corr_scale;            /* Scale factor value to be applied to Doppler correction field prior to applying corrections */
-    double           vehicle_depth;                 /* From 0x66 datagram, non-zero when sonar head is mounted on a sub-sea platform */
-    unsigned char    spare_1[16];
-    int              transmit_sectors;              /* The number of transmit sectors for this ping */
-    t_gsfEM4TxSector sector[GSF_MAX_EM4_SECTORS];   /* Array of structures with transmit sector information */
-    unsigned char    spare_2[16];
-
-    /* Values from the run-time parameters datagram */
-    t_gsfEMRunTime   run_time;
-
-    /* Values from the PU status datagram */
-    t_gsfEMPUStatus  pu_status;
-}
-t_gsfEM4Specific;
-
-/* Define sensor specific data structures for the Kongsberg 3000, etc which use raw range and beam angle */
-typedef struct t_gsfEM3RawSpecific
-{
-    /* values from the XYZ datagram and raw range datagram */
-    int              model_number;                  /* ie 3000 ... */
-    int              ping_counter;                  /* Sequential ping counter, 0 through 65535 */
-    int              serial_number;                 /* System unique serial number, 100 - ? */
-    double           surface_velocity;              /* Measured sound speed near the surface in m/s */
-    double           transducer_depth;              /* The transmit transducer depth in meters re water level at ping time */
-    int              valid_detections;              /* number of beams with a valid bottom detection for this ping */
-    double           sampling_frequency;            /* The system digitizing rate in Hz */
-    double           vehicle_depth;                 /* vechicle depth in 0.01 m */
-    double           depth_difference;              /* in meters between sonar heads in em3000d configuration */
-    int              offset_multiplier;             /* transducer depth offset multiplier */
-    unsigned char    spare_1[16];
-    int              transmit_sectors;              /* The number of transmit sectors for this ping */
-    t_gsfEM3RawTxSector sector[GSF_MAX_EM3_SECTORS];   /* Array of structures with transmit sector information */
-    unsigned char    spare_2[16];
-
-    /* Values from the run-time parameters datagram */
-    t_gsfEMRunTime   run_time;
-
-    /* Values from the PU status datagram */
-    t_gsfEMPUStatus  pu_status;
-}
-t_gsfEM3RawSpecific;
-
-/*DHG 2006/09/27 Added support for GeoSwath interferometric 250 Khz sonar */
-/* Define the GeoSwath sensor specific data structure */
-typedef struct t_gsfGeoSwathPlusSpecific
-{
-    int             data_source;             /* 0 = CBF, 1 = RDF */
-    int             side;                    /* 0 = port, 1 = stbd */
-    int             model_number;            /* ie: 100, 250, 500, ... */
-    double          frequency;               /* Hz */
-    int             echosounder_type;        /* ? */
-    long            ping_number;             /* 0 - 4,294,967,295 */
-    int             num_nav_samples;         /* number of navigation samples in this ping */
-    int             num_attitude_samples;    /* number of attitude samples in this ping */
-    int             num_heading_samples;     /* number of heading samples in this ping */
-    int             num_miniSVS_samples;     /* number of miniSVS samples in this ping */
-    int             num_echosounder_samples; /* number of echosounder samples in ping */
-    int             num_raa_samples;         /* number of RAA (Range/Angle/Amplitude) samples in ping */
-    double          mean_sv;                 /* meters per second */
-    double          surface_velocity;        /* in m/s */
-    int             valid_beams;             /* number of valid beams for this ping */
-    double          sample_rate;             /* Hz */
-    double          pulse_length;            /* micro seconds */
-    int             ping_length;             /* meters */
-    int             transmit_power;          /* ? */
-    int             sidescan_gain_channel;   /* RDF documentation = 0 - 3  */
-    int             stabilization;           /* 0 or 1 */
-    int             gps_quality;             /* ? */
-    double          range_uncertainty;       /* meters */
-    double          angle_uncertainty;       /* degrees */
-    char            spare[32];               /* 32 bytes of reserved space */
-}
-t_gsfGeoSwathPlusSpecific;
-
-#define PORT_PING 0
-#define STBD_PING 1
-
-#define GSF_GEOSWATH_PLUS_PORT_PING PORT_PING
-#define GSF_GEOSWATH_PLUS_STBD_PING STBD_PING
-
-/* Define the Klein 5410 Bathy Sidescan sensor specific data structure */
-typedef struct t_gsfKlein5410BssSpecific
-{
-    int             data_source;             /* 0 = SDF */
-    int             side;                    /* 0 = port, 1 = stbd */
-    int             model_number;            /* ie: 5410 */
-    double          acoustic_frequency;      /* system frequency in Hz */
-    double          sampling_frequency;      /* sampling frequency in Hz */
-    unsigned int    ping_number;             /* 0 - 4,294,967,295 */
-    unsigned int    num_samples;             /* total number of samples in this ping */
-    unsigned int    num_raa_samples;         /* number of valid range, angle, amplitude samples in ping */
-    unsigned int    error_flags;             /* error flags for this ping */
-    unsigned int    range;                   /* sonar range setting */
-    double          fish_depth;              /* reading from the towfish pressure sensor in Volts */
-    double          fish_altitude;           /* towfish altitude in m */
-    double          sound_speed;             /* speed of sound at the transducer face in m/sec */
-    int             tx_waveform;             /* transmit pulse: 0 = 132 microsec CW; 1 = 132 microsec FM; */
-                                             /* 2 = 176 microsec CW; 3 = 176 microsec FM */
-    int             altimeter;               /* altimeter status: 0 = passive, 1 = active */
-    unsigned int    raw_data_config;         /* raw data configuration */
-    char            spare[32];               /* 32 bytes of reserved space */
-}
-t_gsfKlein5410BssSpecific;
-
-/* Define the Imagenex Delta T sensor specific data structure */
-typedef struct t_gsfDeltaTSpecific
-{
-    char            decode_file_type[4];     /* contains the decoded files extension. */
-    char            version;                 /* contains the minor version number of the delta t */
-    int             ping_byte_size;          /* size in bytes of this ping (256 + ((((byte 117[1 or 0])*2) + 2) * number of beams)) */
-    struct timespec interrogation_time;      /* The sonar interrogation time */
-    int             samples_per_beam;        /* number of samples per beam */
-    double          sector_size;             /* size of the sector in degrees */
-    double          start_angle;             /* the angle that beam 0 starts at in degrees. */
-    double          angle_increment;         /* the number of degrees the angle increments per beam */
-    int             acoustic_range;          /* acoustic range in meters */
-    int             acoustic_frequency;      /* acoustic frequency in kHz */
-    double          sound_velocity;          /* the velocity of sound at the transducer face in m/s */
-    double          range_resolution;        /* range resolution in centimeters (documentation says mm but all example data is in cm) */
-    double          profile_tilt_angle;      /* the mounting offset */
-    double          repetition_rate;         /* time between pings in milliseconds */
-    unsigned long   ping_number;             /* the current ping number of this ping.  */
-    unsigned char   intensity_flag;          /* this tells whether the GSF will have intensity data (1=true) */
-    double          ping_latency;            /* time from sonar ping interrogation to actual ping in seconds */
-    double          data_latency;            /* time from sonar ping interrogation to 83P UDP datagram in seconds */
-    unsigned char   sample_rate_flag;        /* sampling rate 0 = (1 in 500); 1 = (1 in 5000) */
-    unsigned char   option_flags;            /* this flag states whether the data is roll corrected or raybend corrected (1 = roll, 2 = raybend, 3 = both) */
-    int             num_pings_avg;           /* number of pings averaged 1 - 25 */
-    double          center_ping_time_offset; /* the time difference in seconds between the center ping interrogation and the current ping interrogation */
-    unsigned char   user_defined_byte;       /* contains a user defined byte */
-    double          altitude;                /* the height of the fish above the ocean floor.  */
-    char            external_sensor_flags;   /* this flag is a bit mask where (1 = external heading, 2 = external roll, 4 = external pitch, 8 = external heave) */
-    double          pulse_length;            /* acoustic pulse length in seconds */
-    double          fore_aft_beamwidth;      /* Effective f/a beam width in degrees */
-    double          athwartships_beamwidth;  /* Effective athwartships beam width in degrees */
-    unsigned char   spare[32];               /* room to grow */
-}
-t_gsfDeltaTSpecific;
-
-/* Define sensor specific data structures for the EM12 */
-typedef struct t_gsfEM12Specific
-{
-    int              ping_number;          /* 0 to 65535 */
-    int              resolution;           /* 1 = high, 2 = low */
-    int              ping_quality;         /* 21 to 81; number of beams with accepted bottom detections */
-    double           sound_velocity;       /* m/s */
-    int              mode;                 /* 1 to 8; shallow, deep, type of beam spacing */
-    unsigned char    spare[32];            /* room to grow */
-} t_gsfEM12Specific;
-
-/* Define the R2Sonic sensor specific data structure */
-typedef struct t_gsfR2SonicSpecific
-{
-    unsigned char   model_number[12];   /* Model number, e.g. "2024".  Unused chars are nulls */
-    unsigned char   serial_number[12];  /* Serial number, e.g. "100017".  Unused chars are nulls */
-    struct timespec dg_time;            /* Ping time, re 00:00:00, Jan 1, 1970 ("Unix time") */
-    unsigned int    ping_number;        /* Sequential ping counter relative to power up or reboot */
-    double          ping_period;        /* Time interval between two most recent pings, seconds */
-    double          sound_speed;        /* Sound speed at transducer face, m/s */
-    double          frequency;          /* Sonar center frequency (Hz) */
-    double          tx_power;           /* TX source level, dB re 1uPa at 1 meter */
-    double          tx_pulse_width;     /* pulse width, seconds */
-    double          tx_beamwidth_vert;  /* fore-aft beamwidth, degrees */
-    double          tx_beamwidth_horiz; /* athwartship beamwidth, degrees */
-    double          tx_steering_vert;   /* fore-aft beam steering angle, degrees */
-    double          tx_steering_horiz;  /* athwartship beam steering angle, degrees */
-    unsigned int    tx_misc_info;       /* reserved for future use */
-    double          rx_bandwidth;       /* receiver bandwidth, Hz */
-    double          rx_sample_rate;     /* receiver sample rate, Hz */
-    double          rx_range;           /* receiver range setting, seconds in docs but I think it's meters  */
-    double          rx_gain;            /* receiver gain setting, 2dB increments between steps */
-    double          rx_spreading;       /* TVG spreading law coefficient, e.g. 20log10(range) */
-    double          rx_absorption;      /* TVG absorption coefficient, dB/km */
-    double          rx_mount_tilt;      /* degrees */
-    unsigned int    rx_misc_info;       /* reserved for future use */
-    unsigned short  reserved;           /* reserved for future use */
-    unsigned short  num_beams;          /* number of beams in this ping */
-
-    /* These fields are from the BTH0 packet only */
-    double          A0_more_info[6];     /* Additional fields associated with equi-angular mode; first element of array is roll  */
-    double          A2_more_info[6];     /* Additional fields associated with equi-distant mode; first element of array is roll */
-    double          G0_depth_gate_min;   /* global minimum gate in seconds (twtt) */
-    double          G0_depth_gate_max;   /* global maximum gate in seconds (twtt) */
-    double          G0_depth_gate_slope; /* slope of depth gate, degrees */
-    unsigned char   spare[32];           /* saved for future expansion */
-}
-t_gsfR2SonicSpecific;
-
-/* Define a union of the known sensor specific ping subrecords */
-typedef union t_gsfSensorSpecific
-{
-    t_gsfSeaBeamSpecific      gsfSeaBeamSpecific;
-    t_gsfEM100Specific        gsfEM100Specific;
-    t_gsfEM121ASpecific       gsfEM121ASpecific;
-    t_gsfEM121ASpecific       gsfEM121Specific;
-    t_gsfSeaBatSpecific       gsfSeaBatSpecific;
-    t_gsfEM950Specific        gsfEM950Specific;
-    t_gsfEM950Specific        gsfEM1000Specific;
-    t_gsfSeamapSpecific       gsfSeamapSpecific;
-
-    #if 1
-    /* 03-30-99 wkm/dbj: Obsolete replaced with gsfCmpSassSpecific */
-    t_gsfTypeIIISpecific      gsfTypeIIISeaBeamSpecific;
-    t_gsfTypeIIISpecific      gsfSASSSpecific;
-    #endif
-
-    t_gsfCmpSassSpecific      gsfCmpSassSpecific;
-
-    t_gsfSBAmpSpecific        gsfSBAmpSpecific;
-    t_gsfSeaBatIISpecific     gsfSeaBatIISpecific;
-    t_gsfSeaBat8101Specific   gsfSeaBat8101Specific;
-    t_gsfSeaBeam2112Specific  gsfSeaBeam2112Specific;
-    t_gsfElacMkIISpecific     gsfElacMkIISpecific;
-    t_gsfEM3Specific          gsfEM3Specific;          /* used for EM120, EM300, EM1002, EM3000, EM3002, and EM121A_SIS */
-    t_gsfEM3RawSpecific       gsfEM3RawSpecific;       /* used for EM120, EM300, EM1002, EM3000, EM3002, and EM121A_SIS with raw range and beam angle */
-    t_gsfReson8100Specific    gsfReson8100Specific;
-    t_gsfReson7100Specific    gsfReson7100Specific;
-    t_gsfEM4Specific          gsfEM4Specific;          /* used for EM710, EM302, EM122, and EM2040 */
-    t_gsfGeoSwathPlusSpecific gsfGeoSwathPlusSpecific; /* DHG 2006/09/27 Use for GeoSwath+ interferometer */
-    t_gsfKlein5410BssSpecific gsfKlein5410BssSpecific; /* Use for Klein 5410 Bathy Sidescan. */
-    t_gsfDeltaTSpecific       gsfDeltaTSpecific;
-    t_gsfEM12Specific         gsfEM12Specific;
-    t_gsfR2SonicSpecific      gsfR2SonicSpecific;
-
-        /* Single beam sensors added */
-    t_gsfSBEchotracSpecific   gsfSBEchotracSpecific;
-    t_gsfSBEchotracSpecific   gsfSBBathy2000Specific;
-    t_gsfSBMGD77Specific      gsfSBMGD77Specific;
-    t_gsfSBBDBSpecific        gsfSBBDBSpecific;
-    t_gsfSBNOSHDBSpecific     gsfSBNOSHDBSpecific;
-    t_gsfSBEchotracSpecific   gsfSBPDDSpecific;
-    t_gsfSBNavisoundSpecific  gsfSBNavisoundSpecific;
-} gsfSensorSpecific;
-
-/* Define the Echotrac Single-Beam sensor specific data structure. */
-typedef struct t_gsfEchotracSpecific
-{
-    int             navigation_error;
-    unsigned short  mpp_source; /* Flag To determine if nav was mpp */
-    unsigned short  tide_source;
-}
-t_gsfEchotracSpecific;
-
-/* Define the MGD77 Single-Beam sensor specific data structure. */
-typedef struct t_gsfMGD77Specific
-{
-    unsigned short  time_zone_corr;
-    unsigned short  position_type_code;
-    unsigned short  correction_code;
-    unsigned short  bathy_type_code;
-    unsigned short  quality_code;
-    double travel_time;
-}
-t_gsfMGD77Specific;
-
-/* Define the BDB sensor specific data structure */
-typedef struct t_gsfBDBSpecific
-{
-    int   doc_no;         /* Document number (5 digits) */
-    char  eval;           /* Evaluation (1-best, 4-worst) */
-    char  classification; /* Classification ((U)nclass, (C)onfidential,
-                                             (S)ecret, (P)roprietary/Unclass,
-                                             (Q)Proprietary/Class) */
-    char  track_adj_flag; /* Track Adjustment Flag (Y,N) */
-    char  source_flag;    /* Source Flag ((S)urvey, (R)andom, (O)cean Survey) */
-    char  pt_or_track_ln; /* Discrete Point (D) or Track Line (T) Flag */
-    char  datum_flag;     /* Datum Flag ((W)GS84, (D)atumless) */
-}
-t_gsfBDBSpecific;
-
-/* Define the NOS HDB sensor specific data structure */
-typedef struct t_gsfNOSHDBSpecific
-{
-   unsigned short  type_code;    /*  Depth type code  */
-   unsigned short  carto_code;   /*  Cartographic code  */
-}
-t_gsfNOSHDBSpecific;
-
-/* Define a union of the known sensor specific
- * single beam ping subrecords
- */
-typedef union t_gsfSBSensorSpecific
-{
-    t_gsfEchotracSpecific    gsfEchotracSpecific;
-    t_gsfEchotracSpecific    gsfBathy2000Specific;
-    t_gsfMGD77Specific       gsfMGD77Specific;
-    t_gsfBDBSpecific         gsfBDBSpecific;
-    t_gsfNOSHDBSpecific      gsfNOSHDBSpecific;
-} gsfSBSensorSpecific;
-
-/* Define the bit flags for the "ping_flags" field of the swath bathymetry
- *  ping record.
- * GSF_IGNORE_PING may be set to indicate to an application to ignore this ping
- * GSF_PING_USER_FLAGS 01-15 may be set/read by application specific software
- */
-#define GSF_IGNORE_PING       0x0001u
-#define GSF_PING_USER_FLAG_01 0x0002u
-#define GSF_PING_USER_FLAG_02 0x0004u
-#define GSF_PING_USER_FLAG_03 0x0008u
-#define GSF_PING_USER_FLAG_04 0x0010u
-#define GSF_PING_USER_FLAG_05 0x0020u
-#define GSF_PING_USER_FLAG_06 0x0040u
-#define GSF_PING_USER_FLAG_07 0x0080u
-#define GSF_PING_USER_FLAG_08 0x0100u
-#define GSF_PING_USER_FLAG_09 0x0200u
-#define GSF_PING_USER_FLAG_10 0x0400u
-#define GSF_PING_USER_FLAG_11 0x0800u
-#define GSF_PING_USER_FLAG_12 0x1000u
-#define GSF_PING_USER_FLAG_13 0x2000u
-#define GSF_PING_USER_FLAG_14 0x4000u
-#define GSF_PING_USER_FLAG_15 0x8000u
-
-/* Define a set of macros to set, clear, and test the state of the
- *  ping status flags.
- *  Where:
- *     ping_flags: The ping flags field of the gsfSwathBathyPing structure.
- *     usflag:     The definition of the flag to test, set, or clear.
- */
-#define gsfTestPingStatus(ping_flags, usflag)    (((ping_flags) & (usflag)) ? 1 : 0)
-#define gsfSetPingStatus(ping_flags, usflag)      ((ping_flags) |= (usflag))
-#define gsfClearPingStatus(ping_flags, usflag)    ((ping_flags) &= (~(usflag)))
-
-/* Define the GSF bit flags flags for the beam status array.
- * The GSF_IGNORE_BEAM flag may be set to indicate that this beam should
- *  not be used by any processing/display software.  The flags
- *  GSF_BEAM_USER_FLAG_01-07 may be set/read by application specific software
- */
-#define GSF_IGNORE_BEAM       0x01u
-#define GSF_BEAM_USER_FLAG_01 0x02u
-#define GSF_BEAM_USER_FLAG_02 0x04u
-#define GSF_BEAM_USER_FLAG_03 0x08u
-#define GSF_BEAM_USER_FLAG_04 0x10u
-#define GSF_BEAM_USER_FLAG_05 0x20u
-#define GSF_BEAM_USER_FLAG_06 0x40u
-#define GSF_BEAM_USER_FLAG_07 0x80u
-
-/* Define the internal form of the array subrecord scale factor information,
- * which is used to scale the swath bathymetry ping record to/from
- * internal/external form. The subrecord id is specified by the index into
- * the scaleTable array.
- */
-typedef struct t_gsfScaleInfo
-{
-    unsigned char   compressionFlag;    /* Specifies bytes of storage in high order nibble and type of compression in low order nibble */
-    double          multiplier;         /* the scale factor (millionths)for the array */
-    double          offset;             /* dc offset to scale data by */
-} gsfScaleInfo;
-typedef struct t_gsfScaleFactors
-{
-    int             numArraySubrecords; /* the number of scaling factors we actually have */
-    gsfScaleInfo    scaleTable[GSF_MAX_PING_ARRAY_SUBRECORDS];
-} gsfScaleFactors;
-
-/* Macro definitions for populating the compression flag (c_flag) argument passed through the
- * gsfLoadScaleFactors(), gsfGetScaleFactor, and gsfLoadDepthScaleFactorAutoOffset() APIs
- */
-
-/* The high order 4 bits are used to define the field size for this array */
-#define GSF_FIELD_SIZE_DEFAULT  0x00  /* Default values for field size are used used for all beam arrays */
-#define GSF_FIELD_SIZE_ONE      0x10  /* value saved as a one byte value after applying scale and offset */
-#define GSF_FIELD_SIZE_TWO      0x20  /* value saved as a two byte value after applying scale and offset */
-#define GSF_FIELD_SIZE_FOUR     0x40  /* value saved as a four byte value after applying scale and offset */
-
-/* The low order 4 bits are used to define the compression approach */
-#define GSF_DISABLE_COMPRESSION 0x00  /* no compression to be applied to the beam array data. */
-                                      /* no compression supported in this version, but may be added in a future release */
-
-
-typedef struct t_gsfEM3ImagerySpecific
-{
-    unsigned short range_norm;          /* range to normal incidence used to correct sample amplitudes (in samples) */
-    unsigned short start_tvg_ramp;      /* start range sample of TVG ramp if not enough dynamic range (0 else) */
-    unsigned short stop_tvg_ramp;       /* stop range sample of TVG ramp if not enough dynamic range (0 else) */
-    char           bsn;                 /* normal incidence BS in dB */
-    char           bso;                 /* oblique BS in dB */
-    double         mean_absorption;     /* mean absorption coeffiecient in dB/km, resolution of 0.01 dB/km) */
-    short          offset;              /* Value that has been added to all imagery samples to convert to a positive value */
-    short          scale;               /* Manufacturer's specified scale value for each sample. This value is 2 for data from EM3000/EM3002/EM1002/EM300/EM120 */
-    unsigned char  spare[4];            /* spare sensor specific subrecord space, reserved for future expansion */
-} t_gsfEM3ImagerySpecific;
-
-typedef struct t_gsfReson7100ImagerySpecific
-{
-    unsigned short size;
-    unsigned char  spare[64];            /* spare sensor specific subrecord space, reserved for future expansion */
-} t_gsfReson7100ImagerySpecific;
-
-typedef struct t_gsfReson8100ImagerySpecific
-{
-    unsigned char  spare[8];            /* spare sensor specific subrecord space, reserved for future expansion */
-} t_gsfReson8100ImagerySpecific;
-
-typedef struct t_gsfEM4ImagerySpecific
-{
-    double         sampling_frequency;  /* The system digitizing rate in Hz, value retrieved from the imagery datagram */
-    double         mean_absorption;     /* mean absorption coefficient in dB/km, from 0x53 datagram, 0 if data is from 0x59  */
-    double         tx_pulse_length;     /* transmit pulse length in microseconds from imagery datagram 0x53, or 0x59 */
-    int            range_norm;          /* range to normal incidence used to correct sample amplitudes (in samples) */
-    int            start_tvg_ramp;      /* start range (in samples) of TVG ramp if not enough dynamic range 0 means not used */
-    int            stop_tvg_ramp;       /* stop range (in samples) of TVG ramp if not enough dynamic range 0 means not used */
-    double         bsn;                 /* normal incidence BS in dB */
-    double         bso;                 /* oblique incidence BS in dB */
-    double         tx_beam_width;       /* transmit beam width in degrees from imagery datagram */
-    double         tvg_cross_over;      /* The TVG law crossover angle in degrees */
-    short          offset;              /* Value that has been added to all imagery samples to convert to a positive value */
-    short          scale;               /* Manufacturer's specified scale value for each sample. This value is 10 for data from EM710/EM302/EM122 */
-    unsigned char  spare[20];           /* spare sensor specific subrecord space, reserved for future expansion */
-} t_gsfEM4ImagerySpecific;
-
-typedef struct t_gsfKlein5410BssImagerySpecific
-{
-    unsigned int   res_mode;            /* Descriptor for resolution mode: 0 = normal; 1 = high */
-    unsigned int   tvg_page;            /* TVG page number */
-    unsigned int   beam_id[5];          /* array of identifiers for five sidescan beam magnitude time series, starting with beam id 1 as the forward-most */
-    unsigned char  spare[4];            /* spare sensor specific subrecord space, reserved for future expansion */
-} t_gsfKlein5410BssImagerySpecific;
-
-/* Define the R2Sonic sensor imagery data structure.  Very similar to gsfR2SonicSpecific structure */
-typedef struct t_gsfR2SonicImagerySpecific
-{
-    unsigned char   model_number[12];   /* Model number, e.g. "2024".  Unused chars are nulls */
-    unsigned char   serial_number[12];  /* Serial number, e.g. "100017".  Unused chars are nulls */
-    struct timespec dg_time;            /* Ping time, re 00:00:00, Jan 1, 1970 ("Unix time") */
-    unsigned int    ping_number;        /* Sequential ping counter relative to power up or reboot */
-    double          ping_period;        /* Time interval between two most recent pings, seconds */
-    double          sound_speed;        /* Sound speed at transducer face, m/s */
-    double          frequency;          /* Sonar center frequency (Hz) */
-    double          tx_power;           /* TX source level, dB re 1uPa at 1 meter */
-    double          tx_pulse_width;     /* pulse width, seconds */
-    double          tx_beamwidth_vert;  /* fore-aft beamwidth, degrees */
-    double          tx_beamwidth_horiz; /* athwartship beamwidth, degreess */
-    double          tx_steering_vert;   /* fore-aft beam steering angle, degrees */
-    double          tx_steering_horiz;  /* athwartship beam steering angle, degrees */
-    unsigned int    tx_misc_info;       /* reserved for future use */
-    double          rx_bandwidth;       /* receiver bandwidth, Hz */
-    double          rx_sample_rate;     /* receiver sample rate, Hz */
-    double          rx_range;           /* receiver range setting, seconds in docs but I think it's meters  */
-    double          rx_gain;            /* receiver gain setting, 2dB increments between steps */
-    double          rx_spreading;       /* TVG spreading law coefficient, e.g. 20log10(range) */
-    double          rx_absorption;      /* TVG absorption coefficient, dB/km */
-    double          rx_mount_tilt;      /* degrees */
-    unsigned int    rx_misc_info;       /* reserved for future use */
-    unsigned short  reserved;           /* reserved for future use */
-    unsigned short  num_beams;          /* number of beams in this ping */
-    double          more_info[6];       /* reserved for future use, from SNI0 datagram */
-    unsigned char   spare[32];          /* saved for future expansion */
-}
-t_gsfR2SonicImagerySpecific;
-
-typedef union t_gsfSensorImagery
-{
-    t_gsfEM3ImagerySpecific          gsfEM3ImagerySpecific;          /* used for EM120, EM300, EM1002, EM3000 */
-    t_gsfReson7100ImagerySpecific    gsfReson7100ImagerySpecific;    /* For Reson 71P "snippet" imagery */
-    t_gsfReson8100ImagerySpecific    gsfReson8100ImagerySpecific;    /* For Reson 81P "snippet" imagery */
-    t_gsfEM4ImagerySpecific          gsfEM4ImagerySpecific;          /* used for EM122, EM302, EM710 */
-    t_gsfKlein5410BssImagerySpecific gsfKlein5410BssImagerySpecific; /* used for Klein 5410 Bathy Sidescan */
-    t_gsfR2SonicImagerySpecific      gsfR2SonicImagerySpecific;      /* used for R2Sonic */
-} gsfSensorImagery;
-
-typedef struct gsfTimeSeriesIntensity
-{
-    unsigned short sample_count;       /* number of amplitude samples per beam */
-    unsigned short detect_sample;      /* index of bottom detection sample for the beam */
-    unsigned char  spare[8];           /* for future use */
-    unsigned int  *samples;            /* Array of per-beam time series intensity samples  */
-} gsfTimeSeriesIntensity;
-
-#define GSF_INTENSITY_LINEAR     0x01u
-#define GSF_INTENSITY_CALIBRATED 0x02u
-#define GSF_INTENSITY_POWER      0x04u
-#define GSF_INTENSITY_GAIN       0x08u
-
-typedef struct t_gsfBRBIntensity
-{
-    unsigned char           bits_per_sample;       /* bits per intensity sample */
-    unsigned int            applied_corrections;   /* flags to describe corrections applied to intensity values */
-    unsigned char           spare[16];             /* spare header space */
-    gsfSensorImagery        sensor_imagery;        /* sensor specific per-ping imagery information */
-    gsfTimeSeriesIntensity *time_series;           /* array of per-beam time series intensity values */
-} gsfBRBIntensity;
-
-/* Define the data structure for a ping from a swath bathymetric system */
-typedef struct t_gsfSwathBathyPing
-{
-    struct timespec    ping_time;          /* seconds and nanoseconds */
-    double             latitude;           /* in degrees, positive going north */
-    double             longitude;          /* in degrees, positive going east */
-    double             height;             /* height above ellipsoid, positive value defines a point above ellipsoid */
-    double             sep;                /* distance from ellipsoid to vertical datum, positive value indicates datum above ellipsoid */
-    short              number_beams;       /* in this ping */
-    short              center_beam;        /* offset into array (0 = portmost outer) */
-    unsigned short     ping_flags;         /* flags to mark status of this ping */
-    short              reserved;           /* for future use */
-    double             tide_corrector;     /* in meters */
-    double             gps_tide_corrector; /* in meters */
-    double             depth_corrector;    /* in meters */
-    double             heading;            /* in degrees */
-    double             pitch;              /* in degrees */
-    double             roll;               /* in degrees */
-    double             heave;              /* in meters    */
-    double             course;             /* in degrees */
-    double             speed;              /* in knots */
-    gsfScaleFactors    scaleFactors;       /* The array scale factors for this data */
-    double            *depth;              /* depth array (meters) */
-    double            *nominal_depth;      /* Array of depth relative to 1500 m/s */
-    double            *across_track;       /* across track array (meters) */
-    double            *along_track;        /* along track array (meters) */
-    double            *travel_time;        /* roundtrip travel time array (seconds) */
-    double            *beam_angle;         /* beam angle array (degrees from vertical) */
-    double            *mc_amplitude;       /* mean, calibrated beam amplitude array (dB re 1V/micro pascal at 1 meter) */
-    double            *mr_amplitude;       /* mean, relative beam amplitude array (dB re 1V/micro pascal at 1 meter) */
-    double            *echo_width;         /* echo width array (seconds) */
-    double            *quality_factor;     /* quality factor array (dimensionless) */
-    double            *receive_heave;      /* Array of heave data (meters) */
-    double            *depth_error;        /* Array of estimated vertical error (meters) */
-    double            *across_track_error; /* Array of estimated across track error (meters) */
-    double            *along_track_error;  /* Array of estimated along track error (meters) */
-    unsigned char     *quality_flags;      /* Two bit beam detection flags provided by Reson sonar */
-    unsigned char     *beam_flags;         /* Array of beam status flags */
-    double            *signal_to_noise;    /* signal to noise ratio (dB) */
-    double            *beam_angle_forward; /* beam angle forward array (degrees counterclockwise from stbd.) */
-    double            *vertical_error;     /* Array of estimated vertical error (meters, at 95% confidence) */
-    double            *horizontal_error;   /* Array of estimated horizontal error (meters, at 95% confidence) */
-    unsigned short    *sector_number;      /* Array of values that specify the transit sector for this beam */
-    unsigned short    *detection_info;     /* Array of values that specify the method of bottom detection */
-    double            *incident_beam_adj;  /* Array of values that specify incident beam angle adjustment from beam_angle */
-    unsigned short    *system_cleaning;    /* Array of values that specify data cleaning information from the sensor system */
-    double            *doppler_corr;       /* Array of values used to correct the travel times for Doppler when transmission is FM */
-    double            *sonar_vert_uncert;  /* vertical uncertainty provided by the sonar */
-    int                sensor_id;          /* a definition which specifies the sensor */
-    gsfSensorSpecific  sensor_data;        /* union of known sensor specific data */
-    gsfBRBIntensity   *brb_inten;          /* Structure containing bathymetric receive beam time series intensities */
-}
-gsfSwathBathyPing;
-
-/* Define a single beam record structure. */
-typedef struct t_gsfSingleBeamPing
-{
-    struct timespec ping_time;          /* Time the sounding was made */
-    double          latitude;           /* latitude (degrees) of sounding */
-    double          longitude;          /* longitude (degrees) of sounding */
-    double          tide_corrector;     /* in meters */
-    double          depth_corrector;    /* in meters draft corrector for sensor */
-    double          heading;            /* in degrees */
-    double          pitch;              /* in meters */
-    double          roll;               /* in meters */
-    double          heave;              /* in meters */
-    double          depth;              /* in meters */
-    double          sound_speed_correction;  /* in meters */
-    unsigned short  positioning_system_type;
-    int             sensor_id;
-    gsfSBSensorSpecific sensor_data;
-}
-gsfSingleBeamPing;
-
-/* Define the sound velocity profile structure */
-typedef struct t_gsfSVP
-{
-    struct timespec observation_time;   /* time the SVP measurement was made            */
-    struct timespec application_time;   /* time the SVP was used by the sonar           */
-    double          latitude;           /* latitude (degrees) of SVP measurement        */
-    double          longitude;          /* longitude (degrees) of SVP measurement       */
-    int             number_points;      /* number of data points in the profile         */
-    double         *depth;              /* array of profile depth values in meters      */
-    double         *sound_speed;        /* array of profile sound velocity values in m/s*/
-}
-gsfSVP;
-
-/* Define the internal record structure for processing parameters */
-#define GSF_MAX_PROCESSING_PARAMETERS 128
-typedef struct t_gsfProcessingParameters
-{
-    struct timespec param_time;
-    int             number_parameters;
-    short           param_size[GSF_MAX_PROCESSING_PARAMETERS];  /* array of sizes of param text */
-    char           *param[GSF_MAX_PROCESSING_PARAMETERS];       /* array of parameters: "param_name=param_value" */
-}
-gsfProcessingParameters;
-
-/* Define the sensor parameters record structure */
-#define GSF_MAX_SENSOR_PARAMETERS 128
-typedef struct t_gsfSensorParameters
-{
-    struct timespec param_time;
-    int             number_parameters;
-    short           param_size[GSF_MAX_SENSOR_PARAMETERS];      /* array of sizes of param text */
-    char           *param[GSF_MAX_SENSOR_PARAMETERS];   /* array of parameters: "param_name=param_value" */
-}
-gsfSensorParameters;
-
-/* Define the comment record structure */
-typedef struct t_gsfComment
-{
-    struct timespec comment_time;
-    int             comment_length;
-    char           *comment;
-}
-gsfComment;
-
-/* Define the history record */
-#define GSF_OPERATOR_LENGTH  64
-#define GSF_HOST_NAME_LENGTH 64
-typedef struct t_gsfHistory
-{
-    struct timespec history_time;
-    char            host_name[GSF_HOST_NAME_LENGTH + 1];
-    char            operator_name[GSF_OPERATOR_LENGTH + 1];
-    char           *command_line;
-    char           *comment;
-}
-gsfHistory;
-
-/* Define the navigation error record
- * jsb As of GSF v1.07, this record is replaced by gsfHVNavigationError.
- * All newly created files should be written using gsfHVNavigationError,
- * instead of gsfNavigationError.
- */
-typedef struct t_gsfNavigationError
-{
-    struct timespec nav_error_time;
-    int             record_id;          /* Containing nav with these errors */
-    double          latitude_error;     /* 90% CE in meters */
-    double          longitude_error;    /* 90% CE in meters */
-}
-gsfNavigationError;
-
-/* jsb As of GSF v1.07, This new navigation error record replaces gsfNavigationError.
- *  The definition of gsfNavigationError will remain in the specification for several
- *  release of GSF for backwards compatability. (The HV stands for Horizontal and Vertical)
- */
-typedef struct t_gsfHVNavigationError
-{
-    struct timespec nav_error_time;
-    int             record_id;                 /* Containing nav with these errors */
-    double          horizontal_error;          /* RMS error in meters */
-    double          vertical_error;            /* RMS error in meters */
-    double          SEP_uncertainty;           /* RMS uncertainty of SEP in meters. Set to 0.0 if not applicable */
-    char            spare[2];                  /* Two bytes of reserved space */
-    char           *position_type;             /* A character string code which specifies the type of positioning system */
-}
-gsfHVNavigationError;
-
-/* Define a set of macros which may to used to set the position_type field */
-#define GSF_POS_TYPE_UNKN "UNKN"               /* Unknown positioning system type */
-#define GSF_POS_TYPE_GPSU "GPSU"               /* GPS Position, unknown positioning service */
-#define GSF_POS_TYPE_PPSD "PPSD"               /* Precise positioning service - differential */
-#define GSF_POS_TYPE_PPSK "PPSK"               /* Precise positioning service - kinematic */
-#define GSF_POS_TYPE_PPSS "PPSS"               /* Precise positioning service - standalone */
-#define GSF_POS_TYPE_PPSG "PPSG"               /* Precise positioning service - gypsy */
-#define GSF_POS_TYPE_SPSD "SPSD"               /* Standard positioning service - differential */
-#define GSF_POS_TYPE_SPSK "SPSK"               /* Standard positioning service - kinematic */
-#define GSF_POS_TYPE_SPSS "SPSS"               /* Standard positioning service - standalone */
-#define GSF_POS_TYPE_SPSG "SPSG"               /* Standard positioning service - gypsy */
-#define GSF_POS_TYPE_GPPP "GPPP"               /* Post Processing - Precise Point Positioning */
-#define GPS_POS_TYPE_GPPK "GPPK"               /* Post Processing - Post Processed Kinematic */
-
-#define GSF_POS_TYPE_INUA "INUA"   /* Inertial measurements only, unaided */
-#define GSF_POS_TYPE_INVA "INVA"   /* Inertial measurements with absolute velocity aiding */
-#define GSF_POS_TYPE_INWA "INWA"   /* Inertial measurements with water-relative velocity aiding */
-#define GSF_POS_TYPE_LBLN "LBLN"   /* One or more long-baseline acoustic navigation lines of position */
-#define GSF_POS_TYPE_USBL "USBL"   /* ultra-short baseline acoustic navigation */
-
-#define GSF_POS_TYPE_PIUA "PIUA"   /* Post-processed inertial measurements only, unaided */
-#define GSF_POS_TYPE_PIVA "PIVA"   /* Post-processed Inertial measurements with absolute velocity aiding */
-#define GSF_POS_TYPE_PIWA "PIWA"   /* Post-processed Inertial measurements with water-relative velocity aiding */
-#define GSF_POS_TYPE_PLBL "PLBL"   /* Post-processed One or more long-baseline acoustic navigation lines of position */
-#define GSF_POS_TYPE_PSBL "PSBL"   /* Post-processed ultra-short baseline acoustic navigation */
-
-/* Define the data structure for a ping from a swath bathymetric system */
-typedef struct t_gsfAttitude
-{
-    short            num_measurements;      /* number of attitude measurements in this record */
-    struct timespec *attitude_time;         /* seconds and nanoseconds */
-    double          *pitch;                 /* in degrees */
-    double          *roll;                  /* in degrees */
-    double          *heave;                 /* in meters */
-    double          *heading;               /* in degrees */
-}
-gsfAttitude;
-
-/* Define a structure to encapsulate the known gsf records, this
- * simplifies the number of arguments to gsfRead, and gsfWrite.
- */
-typedef struct t_gsfRecords
-{
-    gsfHeader               header;
-    gsfSwathBathySummary    summary;
-    gsfSwathBathyPing       mb_ping;
-    gsfSingleBeamPing       sb_ping;
-    gsfSVP                  svp;
-    gsfProcessingParameters process_parameters;
-    gsfSensorParameters     sensor_parameters;
-    gsfComment              comment;
-    gsfHistory              history;
-    gsfNavigationError      nav_error;
-    gsfHVNavigationError    hv_nav_error;
-    gsfAttitude             attitude;
-} gsfRecords;
-
-/* Define a data structure to hold offsets needed to correct multibeam
- * bathymetric data. Currently gsf supports tracking of up to two pairs
- * of each of the relavent offsets.  This is required for systems such as
- * HydroChart II and Reson 9002 which have two pairs of transmit/receive
- * arrays per installation.
- */
-#define GSF_MAX_OFFSETS                2
-#define GSF_COMPENSATED                1
-#define GSF_UNCOMPENSATED              0
-#define GSF_TRUE_DEPTHS                1
-#define GSF_DEPTHS_RE_1500_MS          2
-#define GSF_DEPTH_CALC_UNKNOWN         3
-#define GSF_UNKNOWN_PARAM_VALUE  DBL_MIN        /* defined in <float.h> */
-#define GSF_UNKNOWN_PARAM_INT        -99
-#define GSF_TRUE                       1
-#define GSF_FALSE                      0
-#define GSF_NUMBER_PROCESSING_PARAMS  49
-
-/* Macro definitions for type of platform */
-#define GSF_PLATFORM_TYPE_SURFACE_SHIP  0              /*DHG 2008/12/22 Add for AUV vs Surface Ship discrimination */
-#define GSF_PLATFORM_TYPE_AUV           1              /*DHG 2008/12/22 Add for AUV vs Surface Ship discrimination */
-#define GSF_PLATFORM_TYPE_ROTV          2
-
-typedef struct t_gsfMBOffsets
-{
-    double           draft[GSF_MAX_OFFSETS];                     /* meters */
-    double           pitch_bias[GSF_MAX_OFFSETS];                /* pitch bias in degrees, results from patch test */
-    double           roll_bias[GSF_MAX_OFFSETS];                 /* roll bias in degrees, results from patch test */
-    double           gyro_bias[GSF_MAX_OFFSETS];                 /* gyro bias in degrees, results from patch test */
-    double           position_x_offset;                          /* meters */
-    double           position_y_offset;                          /* meters */
-    double           position_z_offset;                          /* meters */
-    double           antenna_x_offset;                           /* meters */
-    double           antenna_y_offset;                           /* meters */
-    double           antenna_z_offset;                           /* meters */
-    double           transducer_x_offset[GSF_MAX_OFFSETS];       /* sonar X installation offset in meters, from ship alignment survey */
-    double           transducer_y_offset[GSF_MAX_OFFSETS];       /* sonar Y installation offset in meters, from ship alignment survey */
-    double           transducer_z_offset[GSF_MAX_OFFSETS];       /* sonar Z installation offset in meters, from ship alignment survey */
-    double           transducer_pitch_offset[GSF_MAX_OFFSETS];   /* sonar pitch installation angle in degrees, from ship alignment survey */
-    double           transducer_roll_offset[GSF_MAX_OFFSETS];    /* sonar roll installation angle in degrees, from ship alignment survey */
-    double           transducer_heading_offset[GSF_MAX_OFFSETS]; /* sonar heading installation  angle in degrees, from ship alignment survey */
-    double           mru_pitch_bias;                             /* MRU installation pitch angle in degrees, from ship alignment survey */
-    double           mru_roll_bias;                              /* MRU installation roll angle in degrees, from ship alignment survey */
-    double           mru_heading_bias;                           /* MRU installation heading angle in degrees, from ship alignment survey */
-    double           mru_x_offset;                               /* MRU X installation offset in meters, from ship alignment survey */
-    double           mru_y_offset;                               /* MRU Y installation offset in meters, from ship alignment survey meters */
-    double           mru_z_offset;                               /* MUR Z installation offset in meters, from ship alignment survey meters */
-    double           center_of_rotation_x_offset;                /* meters */
-    double           center_of_rotation_y_offset;                /* meters */
-    double           center_of_rotation_z_offset;                /* meters */
-    double           position_latency;                           /* seconds */
-    double           attitude_latency;                           /* seconds */
-    double           depth_sensor_latency;                       /* seconds */
-    double           depth_sensor_x_offset;                      /* for subsurface vehicles; distance of pressure sensor from MRP in meters */
-    double           depth_sensor_y_offset;                      /* for subsurface vehicles; distance of pressure sensor from MRP in meters */
-    double           depth_sensor_z_offset;                      /* for subsurface vehicles; distance of pressure sensor from MRP in meters */
-    double           rx_transducer_x_offset[GSF_MAX_OFFSETS];      /* If the receive array is in a different location than   */
-    double           rx_transducer_y_offset[GSF_MAX_OFFSETS];      /* the transmit array these "rx" offsets will be used for */
-    double           rx_transducer_z_offset[GSF_MAX_OFFSETS];      /* the receive array and the transducer offsets defined   */
-    double           rx_transducer_pitch_offset[GSF_MAX_OFFSETS];  /* above will be used for the transmit array              */
-    double           rx_transducer_roll_offset[GSF_MAX_OFFSETS];
-    double           rx_transducer_heading_offset[GSF_MAX_OFFSETS];
-} gsfMBOffsets;
-
-/* Macro definitions for roll_reference type */
-#define GSF_HORIZONTAL_PITCH_AXIS          1
-#define GSF_ROTATED_PITCH_AXIS             2
-
-
-/* Define a data structure to hold multibeam sonar processing parameters */
-typedef struct t_gsfMBParams
-{
-    /* These parameters define reference points */
-    char start_of_epoch[64];
-    int horizontal_datum;
-    int vertical_datum;
-
-    int utc_offset;                 /* = The offset in hours from UTC to the local time when the GSF file was created */
-
-    /* these parameters define the installed hardware */
-    int number_of_transmitters;      /* = The number of transmitters installed */
-    int number_of_receivers;         /* = The number of receivers installed */
-
-    /* These parameters specify what corrections have been applied to the data */
-    int roll_reference;             /* = flag to indicate whether roll is horizontal pitch axis or rotated pitch axis */
-    int roll_compensated;           /* = GSF_COMPENSATED if the depth data has been corrected for roll */
-    int pitch_compensated;          /* = GSF_COMPENSATED if the depth data has been corrected for pitch */
-    int heave_compensated;          /* = GSF_COMPENSATED if the depth data has been corrected for heave */
-    int tide_compensated;           /* = GSF_COMPENSATED if the depth data has been corrected for tide */
-    int ray_tracing;                /* = GSF_COMPENSATED if the travel time/angle pairs are compensated for ray tracing */
-    int depth_calculation;          /* = GSF_TRUE_DEPTHS, or GSF_DEPTHS_RE_1500_MS, applicable to the depth field */
-    int vessel_type;                /* DHG 2008/12/18 Add "VESSEL_TYPE" to Processing Parameters */
-    int full_raw_data;              /* = GSF_TRUE if this GSF file has sufficient information to support full recalculation of X,Y,Z from raw measurements, otherwise = GSF_FALSE */
-    int msb_applied_to_attitude;    /* = GSF_TRUE if the motion sensor bias values (from patch test) have been added to the attitude values in the ping record and attitude record */
-    int heave_removed_from_gps_tc;  /* = GSF_TRUE if the heave has been removed from the gps_tide_corrector */
-
-    /* These parameters specify known offsets which have NOT been corrected.
-     * If each of these values are zero, then all known offsets have been
-     * corrected for.
-     */
-    gsfMBOffsets to_apply;
-
-    /* These parameters specify offsets which have already been corrected. */
-    gsfMBOffsets applied;
-} gsfMBParams;
-
-/* Macro definitions for approved horizontal datums. Note that as of
- * 12/20/95 only WGS-84 is supported by GSF.
- */
-#define GSF_H_DATUM_ADI   1   /* Adinan */
-#define GSF_H_DATUM_ARF   2   /* Arc 1950 */
-#define GSF_H_DATUM_ARS   3   /* Arc 1960 */
-#define GSF_H_DATUM_AUA   4   /* Australian Geodetic */
-#define GSF_H_DATUM_BAT   5   /* Djakarta (Batavia) */
-#define GSF_H_DATUM_BID   6   /* Bissau Base Northwest End Pillar, Portugese Guinea */
-#define GSF_H_DATUM_BUR   7   /* Bukit Rimpah */
-#define GSF_H_DATUM_CAI   8   /* Campo Inchauspe */
-#define GSF_H_DATUM_CAM   9   /* Camacupa Base SW End */
-#define GSF_H_DATUM_CAP  10   /* Cape, South Africa */
-#define GSF_H_DATUM_CAA  11   /* Campo Area Astro */
-#define GSF_H_DATUM_CHO  12   /* Chatham Island Astro */
-#define GSF_H_DATUM_CHU  13   /* Chua Astro */
-#define GSF_H_DATUM_COA  14   /* Corrego Alegre */
-#define GSF_H_DATUM_ENB  15   /* European 79 */
-#define GSF_H_DATUM_EUR  16   /* European */
-#define GSF_H_DATUM_GDA  17   /* German */
-#define GSF_H_DATUM_GEO  18   /* Geodetic Datum 1949 */
-#define GSF_H_DATUM_GHA  19   /* Ghana */
-#define GSF_H_DATUM_GSB  20   /* G. Segara */
-#define GSF_H_DATUM_GSF  21   /* G. Serindung */
-#define GSF_H_DATUM_GUA  22   /* Guam 1963 */
-#define GSF_H_DATUM_HEN  23   /* Herat North */
-#define GSF_H_DATUM_HER  24   /* Hermannskogel */
-#define GSF_H_DATUM_HJO  25   /* Hjorsey 1955 */
-#define GSF_H_DATUM_HTN  26   /* Hu-Tu-Shan */
-#define GSF_H_DATUM_IDA  27   /* Italian */
-#define GSF_H_DATUM_IND  28   /* Indian */
-#define GSF_H_DATUM_IRE  29   /* Ireland 1965 */
-#define GSF_H_DATUM_KEA  30   /* Kertau */
-#define GSF_H_DATUM_LIB  31   /* Liberia 1964 (Robertsfield Astro) */
-#define GSF_H_DATUM_LOC  32   /* Local Astro */
-#define GSF_H_DATUM_LUZ  33   /* Luzon */
-#define GSF_H_DATUM_MER  34   /* Merchich */
-#define GSF_H_DATUM_MET  35   /* Mercury */
-#define GSF_H_DATUM_MOL  36   /* Montjong Lowe */
-#define GSF_H_DATUM_NAN  37   /* Nanking 1960 */
-#define GSF_H_DATUM_NAR  38   /* North American 1983 */
-#define GSF_H_DATUM_NAS  39   /* North American 1927 */
-#define GSF_H_DATUM_NIG  40   /* Nigeria */
-#define GSF_H_DATUM_OGB  41   /* Ordnance Survey of Great Britain 1936 */
-#define GSF_H_DATUM_OHA  42   /* Old Hawaiian */
-#define GSF_H_DATUM_OSI  43   /* Ordnance Survey of Ireland */
-#define GSF_H_DATUM_PLN  44   /* Pico de las Nieves, Gran Canaria, Canary Islands */
-#define GSF_H_DATUM_PRP  45   /* Provisional South American 1956 */
-#define GSF_H_DATUM_QUO  46   /* Qornoq */
-#define GSF_H_DATUM_SIB  47   /* Sierra leone 1960 */
-#define GSF_H_DATUM_TAN  48   /* Tananarive Obsv 1925 */
-#define GSF_H_DATUM_TIL  49   /* Timbalai */
-#define GSF_H_DATUM_TOK  50   /* Tokyo */
-#define GSF_H_DATUM_UND  51   /* Undetermined */
-#define GSF_H_DATUM_VOI  52   /* Voirol */
-#define GSF_H_DATUM_WGA  53   /* World Geodetic System 1960 */
-#define GSF_H_DATUM_WGB  54   /* World Geodetic System 1966 */
-#define GSF_H_DATUM_WGC  55   /* World Geodetic System 1972 */
-#define GSF_H_DATUM_WGD  56   /* World Geodetic System 1980 */
-#define GSF_H_DATUM_WGE  57   /* World Geodetic System 1984 */
-#define GSF_H_DATUM_WGS  58   /* World Geodetic System (year unknown) */
-#define GSF_H_DATUM_XXX  59   /* Multiple datums */
-#define GSF_H_DATUM_YAC  60   /* Yacare */
-
-/* Macro definitions for supported vertical datums */
-#define GSF_V_DATUM_UNKNOWN  1  /* Unknown vertical datum */
-#define GSF_V_DATUM_MLLW     2  /* Mean lower low water */
-#define GSF_V_DATUM_MLW      3  /* Mean low water */
-#define GSF_V_DATUM_ALAT     4  /* Aprox Lowest Astronomical Tide */
-#define GSF_V_DATUM_ESLW     5  /* Equatorial Springs Low Water */
-#define GSF_V_DATUM_ISLW     6  /* Indian Springs Low Water */
-#define GSF_V_DATUM_LAT      7  /* Lowest Astronomical Tide */
-#define GSF_V_DATUM_LLW      8  /* Lowest Low Water */
-#define GSF_V_DATUM_LNLW     9  /* Lowest Normal Low Water */
-#define GSF_V_DATUM_LWD     10  /* Low Water Datum */
-#define GSF_V_DATUM_MLHW    11  /* Mean Lower High Water */
-#define GSF_V_DATUM_MLLWS   12  /* Mean Lower Low Water Springs */
-#define GSF_V_DATUM_MLWN    13  /* Mean Low Water Neap */
-#define GSF_V_DATUM_MSL     14  /* Mean Sea Level */
-
-/* Define the error codes which gsfError may be set to */
-#define GSF_NORMAL                                 0
-#define GSF_FOPEN_ERROR                           -1
-#define GSF_UNRECOGNIZED_FILE                     -2
-#define GSF_BAD_ACCESS_MODE                       -3
-#define GSF_READ_ERROR                            -4
-#define GSF_WRITE_ERROR                           -5
-#define GSF_INSUFFICIENT_SIZE                     -6
-#define GSF_RECORD_SIZE_ERROR                     -7
-#define GSF_CHECKSUM_FAILURE                      -8
-#define GSF_FILE_CLOSE_ERROR                      -9
-#define GSF_TOO_MANY_ARRAY_SUBRECORDS            -10
-#define GSF_TOO_MANY_OPEN_FILES                  -11
-#define GSF_MEMORY_ALLOCATION_FAILED             -12
-#define GSF_UNRECOGNIZED_RECORD_ID               -13
-#define GSF_STREAM_DECODE_FAILURE                -14
-#define GSF_BAD_SEEK_OPTION                      -15
-#define GSF_FILE_SEEK_ERROR                      -16
-#define GSF_UNRECOGNIZED_SENSOR_ID               -17
-#define GSF_UNRECOGNIZED_DATA_RECORD             -18
-#define GSF_UNRECOGNIZED_ARRAY_SUBRECORD_ID      -19
-#define GSF_UNRECOGNIZED_SUBRECORD_ID            -20
-#define GSF_ILLEGAL_SCALE_FACTOR_MULTIPLIER      -21
-#define GSF_CANNOT_REPRESENT_PRECISION           -22
-#define GSF_READ_TO_END_OF_FILE                  -23
-#define GSF_BAD_FILE_HANDLE                      -24
-#define GSF_HEADER_RECORD_DECODE_FAILED          -25
-#define GSF_MB_PING_RECORD_DECODE_FAILED         -26
-#define GSF_SVP_RECORD_DECODE_FAILED             -27
-#define GSF_PROCESS_PARAM_RECORD_DECODE_FAILED   -28
-#define GSF_SENSOR_PARAM_RECORD_DECODE_FAILED    -29
-#define GSF_COMMENT_RECORD_DECODE_FAILED         -30
-#define GSF_HISTORY_RECORD_DECODE_FAILED         -31
-#define GSF_NAV_ERROR_RECORD_DECODE_FAILED       -32
-#define GSF_HEADER_RECORD_ENCODE_FAILED          -25
-#define GSF_MB_PING_RECORD_ENCODE_FAILED         -26
-#define GSF_SVP_RECORD_ENCODE_FAILED             -27
-#define GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED   -28
-#define GSF_SENSOR_PARAM_RECORD_ENCODE_FAILED    -29
-#define GSF_COMMENT_RECORD_ENCODE_FAILED         -30
-#define GSF_HISTORY_RECORD_ENCODE_FAILED         -31
-#define GSF_NAV_ERROR_RECORD_ENCODE_FAILED       -32
-#define GSF_SETVBUF_ERROR                        -33
-#define GSF_FLUSH_ERROR                          -34
-#define GSF_FILE_TELL_ERROR                      -35
-#define GSF_INDEX_FILE_OPEN_ERROR                -36
-#define GSF_CORRUPT_INDEX_FILE_ERROR             -37
-#define GSF_SCALE_INDEX_CALLOC_ERROR             -38
-#define GSF_RECORD_TYPE_NOT_AVAILABLE            -39
-#define GSF_SUMMARY_RECORD_DECODE_FAILED         -40
-#define GSF_SUMMARY_RECORD_ENCODE_FAILED         -41
-#define GSF_INVALID_NUM_BEAMS                    -42
-#define GSF_INVALID_RECORD_NUMBER                -43
-#define GSF_INDEX_FILE_READ_ERROR                -44
-#define GSF_PARAM_SIZE_FIXED                     -45
-#define GSF_SINGLE_BEAM_ENCODE_FAILED            -46
-#define GSF_HV_NAV_ERROR_RECORD_ENCODE_FAILED    -47
-#define GSF_HV_NAV_ERROR_RECORD_DECODE_FAILED    -48
-#define GSF_ATTITUDE_RECORD_ENCODE_FAILED        -49
-#define GSF_ATTITUDE_RECORD_DECODE_FAILED        -50
-#define GSF_OPEN_TEMP_FILE_FAILED                -51
-#define GSF_PARTIAL_RECORD_AT_END_OF_FILE        -52
-#define GSF_QUALITY_FLAGS_DECODE_ERROR           -53
-
-typedef struct t_gsf_gp{
-    double lon;            /* degrees */
-    double lat;            /* degrees */
-    double z;              /* meters */
-} GSF_POSITION;
-
-/*
-    note: the coordinate system is:
-    +x forward, +y starboard, + z down, +hdg cw from north
-*/
-
-typedef struct t_gsf_pos_offsets{
-    double x;              /* meters */
-    double y;              /* meters */
-    double z;              /* meters */
-} GSF_POSITION_OFFSETS;
-
-/* Global external data defined in this module */
-
-/* The following are the function protoytpes for all functions intended
- * to be exported by the library.
-
-    Fugro modification - Mitch Ames - 2012-02-15
-    The original exported functions did not use const pointers everywhere that they could or should.
-    I've added const where appropriate.
- */
-
-int OPTLK       gsfOpen(const char *filename, const int mode, int *handle);
-/*
- * Description : This function attempts to open a gsf data file.  If the
- *  file exits and is opened readonly or update the gsf header is read
- *  to confirm that this is a gsf data file.  If the file is opened create,
- *  the GSF header containing the version number of the software library is
- *  written into the header.  This function passes an integer handle back to
- *  the calling application.  The handle is used for all further access to the
- *  file. gsfOpen explicitly sets stream bufferring to the value specified
- *  by GSF_STREAM_BUF_SIZE.  The internal file table is searched for an
- *  available entry whose name matches that specified in the argument list, if
- *  no match is found, then the first available entry is used.  Up to
- *  GSF_MAX_OPEN_FILES files may be open by an application at a time.
- *
- * Inputs :
- *  filename = a fully qualified path to the gsf file to open
- *  mode may have the following values:
- *     GSF_READONLY = open an existing file for read only access
- *     GSF_UPDATE   = open an existing file for reading an writing
- *     GSF_CREATE   = create a new gsf file
- *     GSF_READONLY_INDEX = open an existing file for read only access with index
- *     GSF_UPDATE_INDEX   = open an existing file for reading an writing with index
- *  handle = a pointer to an integer to be assigned a handle which will be
- *     reference for all future file access.
- *
- * Returns :
- *  This funciton returns zero if successful, or -1 if an error occured.
- *
- * Error Conditions :
- *     GSF_BAD_ACCESS_MODE
- *     GSF_TOO_MANY_OPEN_FILES
- *     GSF_FOPEN_ERROR
- *     GSF_SETVBUF_ERROR
- *     GSF_UNRECOGNIZED_FILE
- */
-
-int OPTLK       gsfOpenBuffered(const char *filename, const int mode, int *handle, int buf_size);
-/*
- * Description : This function attempts to open a gsf data file.  If the
- *  file exits and is opened readonly or update the gsf header is read
- *  to confirm that this is a gsf data file.  If the file is opened create,
- *  the GSF header containing the version number of the software library is
- *  written into the header.  This function passes an integer handle back to
- *  the calling application.  The handle is used for all further access to the
- *  file. gsfOpenBufferd explicitly sets stream bufferring to the value
- *  specified by the buf_size argument. The internal file table is searched
- *  for an available entry whose name matches that specified in the argument
- *  list, if no match is found, then the first available entry is used.  Up
- *  to GSF_MAX_OPEN_FILES files may be open by an application at a time.
- *  gsfOpenBuffered performs identical processing to gsfOpen, except here,
- *  the caller is allowed to explicitly set the standard system library level
- *  I/O buffer size.
- *
- * Inputs :
- *  filename = a fully qualified path to the gsf file to open
- *  mode may have the following values:
- *     GSF_READONLY = open an existing file for read only access
- *     GSF_UPDATE   = open an existing file for reading an writing
- *     GSF_CREATE   = create a new gsf file
- *     GSF_READONLY_INDEX = open an existing file for read only access with index
- *     GSF_UPDATE_INDEX   = open an existing file for reading an writing with index
- *  handle = a pointer to an integer to be assigned a handle which will be
- *     reference for all future file access.
- *  buf_size = an integer buffer size in bytes.
- *
- * Returns :
- *  This funciton returns zero if successful, or -1 if an error occured.
- *
- * Error Conditions :
- *     GSF_BAD_ACCESS_MODE
- *     GSF_TOO_MANY_OPEN_FILES
- *     GSF_FOPEN_ERROR
- *     GSF_SETVBUF_ERROR
- *     GSF_UNRECOGNIZED_FILE
- */
-
-int OPTLK       gsfClose(const int handle);
-/*
- * Description : This function closes a gsf file previously openned
- *  using gsfOpen.
- *
- * Inputs :
- *  handle = the handle of the gsf file to be closed.
- *
- * Returns :
- *  This function returns zero if successful, or -1 if an error occured.
- *
- * Error Conditions :
- *    GSF_BAD_FILE_HANDLE
- *    GSF_FILE_CLOSE_ERROR
- */
-
-int OPTLK       gsfSeek(int handle, int option);
-/*
- * Description : This function may be used to move the file pointer
- *  for a previously openned gsf file.
- *
- * Inputs :
- *  handle = the integer handle returned from gsf Open
- *  option = the desired action for moving the file pointer, where:
- *    GSF_REWIND, move pointer to first record in the file.
- *    GSF_END_OF_FILE, move pointer to the end of the file.
- *    GSF_PREVIOUS_RECORD, backup to the beginning of the record just
- *     written or just read.
- *
- * Returns :
- *  This function returns zero if successful, or -1 if an error occured.
- *
- * Error Conditions :
- *    GSF_BAD_FILE_HANDLE
- *    GSF_FILE_SEEK_ERROR
- *    GSF_BAD_SEEK_OPTION
- */
-
-int OPTLK       gsfRead(int handle, int desiredRecord, gsfDataID * dataID, gsfRecords * rec, unsigned char *stream, int max_size);
-/* Description : gsfRead supports both direct and sequential access. If the
- *  file is opened for sequential access, this function reads the desired
- *  record from the gsf data file specified by handle.  The "desiredRecord"
- *  argument may be set to GSF_NEXT_RECORD to read the next record in the
- *  data file, or "desiredRecord" record may be set to the id of the record
- *  of interest, in which case the file will be read, skipping past
- *  intermediary records until the desired record is found.  When the desired
- *  record is found, it is read and then decoded from external to internal
- *  form. If the optional checksum is found with the data it will be verified.
- *  All of the fields of the gsfDataID structure, with the exception of the
- *  record_number field will be loaded with the values contained in the GSF
- *  record byte stream.  The record_number field will be undefined.  The
- *  stream and max_size arguments are normally set to NULL, unless the
- *  calling application is interested in a copy of the GSF byte stream.
- *
- *  If the file is opened for direct access, then the combination of the
- *  recordID and the record_number fields of the dataID structure are used
- *  to uniquely identify the record of interest.  The address for this record
- *  is retrieved from the index file, which was created on a previous call
- *  to gsfOpen or gsfOpenBuffered.  If the record of interest is a ping record
- *  for which we need to retrieve new scale factors, then the ping record
- *  containing the scale factors needed is read first, and then the ping
- *  record of interest is read.  Direct access applications should set the
- *  desiredRecord argument equal to the recordID field in the gsfDataID
- *  structure.
- *
- * Inputs :
- *    handle = the handle to the file as provided by gsfOpen
- *    desiredRecord = the desired record or GSF_NEXT_RECORD
- *    dataID = a pointer to a gsfDataID structure to be populated for the
- *             input record.
- *    rptr = a pointer to a gsfRecords structure to be populated with the
- *           data from the input record in internal form.
- *    stream = an optional pointer to caller memory to be populated with a copy
- *          of the gsf byte stream for this record.
- *    max_size = an optional maximum size to copy into buf
- *
- * Returns :
- *  This function returns the number of bytes read if successful,
- *  or -1 if an error occured.
- *
- * Error Conditions :
- *    GSF_BAD_FILE_HANDLE
- *    GSF_FILE_SEEK_ERROR
- *    GSF_FLUSH_ERROR
- *    GSF_READ_TO_END_OF_FILE
- *    GSF_READ_ERROR
- *    GSF_RECORD_SIZE_ERROR
- *    GSF_INSUFFICIENT_SIZE
- *    GSF_CHECKSUM_FAILURE
- *    GSF_UNRECOGNIZED_RECORD_ID
- *    GSF_HEADER_RECORD_DECODE_FAILED
- *    GSF_SVP_RECORD_DECODE_FAILED
- *    GSF_PROCESS_PARAM_RECORD_DECODE_FAILED
- *    GSF_SENSOR_PARAM_RECORD_DECODE_FAILED
- *    GSF_COMMENT_RECORD_DECODE_FAILED
- *    GSF_HISTORY_RECORD_DECODE_FAILED
- *    GSF_NAV_ERROR_RECORD_DECODE_FAILED
- */
-
-int OPTLK       gsfWrite(int handle, gsfDataID * id, gsfRecords * record);
-/* Description : gsfWrite encodes the data from internal to external form,
- *  and then writes the requested record into the file specified by handle,
- *  where handle is the value retured by gsfOpen.  The record is written to
- *  the current file pointer for handle.  An optional checksum may be computed
- *  and encoded with the data.
- *
- *  If the file is opened for sequential access (GSF_CREATE, or GSF_UPDATE)
- *  then the recordID field of the gsfDataID structure is used to specify
- *  the record to be written.  The record is written at the current location
- *  in the file.
- *
- *  If the file is opened for direct access (GSF_UPDATE_INDEX), then the
- *  combination of the recordID and the record_number fields of the gsfDataID
- *  structure are used to uniquely identify the record to be written.  The
- *  address of the record of interest is read from the index file and the file
- *  pointer is moved to this offset before the record is encoded and written
- *  to disk.
- *
- * Inputs :
- *  handle = the handle for this file as returned by gsfOpen
- *  id = a pointer to a gsfDataID containing the record id information for
- *       the record to write.
- *  rptr = a pointer to a gsfRecords structure from which to get the internal
- *         form of the record to be written to the file.
- *
- * Returns :
- *  This function returns the number of bytes written if successful, or
- *  -1 if an error occured.
- *
- * Error Conditions :
- *    GSF_BAD_FILE_HANDLE
- *    GSF_UNRECOGNIZED_RECORD_ID
- *    GSF_FILE_SEEK_ERROR
- *    GSF_WRITE_ERROR
- *    GSF_HEADER_RECORD_ENCODE_FAILED
- *    GSF_SVP_RECORD_ENCODE_FAILED
- *    GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED
- *    GSF_SENSOR_PARAM_RECORD_ENCODE_FAILED
- *    GSF_COMMENT_RECORD_ENCODE_FAILED
- *    GSF_HISTORY_RECORD_ENCODE_FAILED
- *    GSF_NAV_ERROR_RECORD_ENCODE_FAILED
- *    GSF_FLUSH_ERROR
- *    GSF_SINGLE_BEAM_ENCODE_FAILED
- */
-
-int OPTLK       gsfLoadScaleFactor(gsfScaleFactors *sf, unsigned int subrecordID, char c_flag, double precision, int offset);
-/*
- * Description : gsfLoadScaleFactors should be used to load the swath
- *  bathymetry ping record scale factor structure.  This function assures
- *  that the multiplier and offset fields of the scale factor structure
- *  have a precision equal to that which will be stored in the gsf data file.
- *  This function should be called once for each beam array data type
- *  contained in your data.
- *
- * Inputs :
- *  sf = a pointer to the gsfScaleFactors structure to be loaded
- *  subrecordID = the subrecord id for the beam array data
- *  c_flag = the compression flag for the beam array
- *  precision = the presision to which the beam array data are to be stored
- *              (a value of 0.1 would indicate decimeter precision for depth)
- *  offset = the "DC" offset to scale the data by.
- *
- * Returns :
- *  This function returns zero if successful, or -1 if an error occured.
- *
- * Error Conditions :
- *    GSF_TOO_MANY_ARRAY_SUBRECORDS
- */
-
-int OPTLK gsfGetScaleFactor(int handle, unsigned int subrecordID, unsigned char *c_flag, double *multiplier, double *offset);
-/*
- * Description : gsfGetScaleFactor may be used to obtain the multiplier
- *  and DC offset values by which each swath bathymetry ping array subrecord
- *  is be scaled. gsfGetScalesFactor must be called once for each array
- *  subrecord of interest.  At leat one swath bathymetry ping record
- *  must have been read from, or written to the file specified by handle.
- *
- * Inputs :
- *  handle = the integer value set by a call to gsfOpen.
- *  subrecordID = an integer value containing the subrecord id of the requested scale factors
- *  c_flag = the address of an unsigned character to contain the the compression flag
- *  multiplier = the address of a double to contain the scaling multiplier
- *  offset = the address of a double to contain the scaling DC offset.
- *
- * Returns :
- *  This function returns zero if successful, or -1 if an error occured.
- *
- * Error Conditions :
- *    GSF_TOO_MANY_ARRAY_SUBRECORDS
- *    GSF_ILLEGAL_SCALE_FACTOR_MULTIPLIER
- */
-
-void OPTLK      gsfFree(gsfRecords *rec);
-/*
- * Description : This function frees all dynamically allocated memory
- *    from a gsfRecords data structure, and it then clears all the
- *    data elements in the structure.
- *
- * Inputs :
- *    gsfRecords *rec = a pointer to ta gsfRecords data structure
- *
- * Returns : none
- *
- * Error Conditions : none
- */
-
-void OPTLK      gsfPrintError(FILE * fp);
-/* Description : This function is used to print a short message describing
- *  the most recent error encountered.  This function need only be called if
- *  a -1 is returned from one of the gsf functions.
- *
- * Inputs :
- *  fp = a pointer to a FILE to which to write the message.
- *
- * Returns : none
- *
- * Error Conditions : none
- */
-
-int gsfIntError(void);
-/* Description : This function is used to return the most recent
- *  error encountered.  This function need only be called if
- *  a -1 is returned from one of the gsf functions.
- *
- * Inputs : none
- *
- * Returns : constant integer value representing the most recent error
- *
- * Error Conditions : none
- */
-
-const char *gsfStringError(void);
-/* Description : This function is used to return a short message describing
- *  the most recent error encountered.  This function need only be called if
- *  a -1 is returned from one of the gsf functions.
- *
- * Inputs : none
- *
- * Returns : none
- *
- * Error Conditions : none
- */
-
-int OPTLK       gsfIndexTime(int, int, int, time_t *, long *);
-/* Description : This function returns the time (Posix.4) associated with
- *  a specified record number and type.  It also returns the record number
- *  that was read.
- *
- * Inputs :
- *  handle = gsf file handle assigned by gsfOpen or gsfOpenBuffered
- *  record_type = record type to be retrieved
- *  record_number = record number to be retrieved (-1 will get the time
- *                  and record number of the last record of this type)
- *  sec = Posix.4 seconds
- *  nsec = Posix.4 nanoseconds
- *
- * Returns :
- *  This function returns the record number if successful, or -1 if an
- *  error occured.
- *
- * Error Conditions :
- *    GSF_RECORD_TYPE_NOT_AVAILABLE
- */
-
-int OPTLK       gsfPercent (int handle);
-/* Description : This function returns an integer value representing
- *  the location of the file pointer as a percentage of the total file
- *  size.  It may be used to obtain an indication of how far along a
- *  program is in reading a gsf data file.  The file size is obtained
- *  when the file is opened.
- *
- * Inputs :
- *  handle = gsf file handle assigned by gsfOpen or gsfOpenBuffered
- *
- * Returns :
- *  This function returns the current file position as a percentage of
- *  the file size, or -1 if an error occurred. gsfError will be set to
- *  indicate the error.
- *
- * Error Conditions :
- *  GSF_BAD_FILE_HANDLE
- *  GSF_FILE_TELL_ERROR
- */
-
-int OPTLK       gsfGetNumberRecords (int handle, int desiredRecord);
-/* Description : This function will return the number of records of a
- *  given type to the caller. The number of records is retreived from
- *  the index file, so the file must have been opened for direct
- *  access (GSF_READONLY_INDEX, or GSF_UPDATE_INDEX).
- *
- * Inputs :
- *    handle = the handle to the file as provided by gsfOpen
- *    desiredRecord = the desired record or GSF_NEXT_RECORD
- *
- * Returns :
- *  This function returns the number of records of type desiredRecord
- *  contained in the GSF file designated by handle, or -1 if an error
- *  occured.
- *
- * Error Conditions :
- *  GSF_BAD_FILE_HANDLE
- *  GSF_BAD_ACCESS_MODE
- */
-
-int OPTLK       gsfCopyRecords (gsfRecords *target, const gsfRecords *source);
-/* Description : This function will copy all of the data contained in the
- *  source gsfRecords data structure to the target gsfRecords data
- *  structure. The target MUST be memset to zero before the first call to
- *  gsfCopyRecords.  This function allocates dynmanic memory which is NOT
- *  maintained by the library.  It is up to the calling application to
- *  release the memory allocated.  This may be done by maintaining the
- *  target data structure as static data, or by using gsfFree to release
- *  the memory.
- *
- * Inputs :
- *  target = a pointer to a gsfRecords data structure allocated by the
- *      calling application, into which the source data is to be copied.
- *  source = a pointer to a gsfRecords data structure allocated by the
- *      calling application, from which data is to be copied.
- *
- * Returns : This function returns zero if successful, or -1 if an error
- *  occurs.
- *
- * Error Conditions :
- *  GSF_MEMORY_ALLOCATION_FAILED
- */
-
-int OPTLK       gsfPutMBParams(const gsfMBParams *p, gsfRecords *rec, int handle, int numArrays);
-/* Description : This function moves swath bathymetry sonar processing
- *    parameters from internal form to "KEYWORD=VALUE" form.  The internal
- *    form parameters are read from an MB_PARAMETERS data structure maintained
- *    by the caller.  The "KEYWORD=VALUE" form parameters are written into the
- *    processing_parameters structure of the gsfRecords data structure
- *    maitained by the caller. Parameters for up to two transmitters and two receivers
- *    are supported.  If the user sets the number_of_transmitters and number_of_receivers
- *    elements in the gsfMBParams data structure in addition to the numArrays command line
- *    argument, the numArrays value will be ignored.  If number_of_transmitters and
- *    number_of_receivers are equal to 0, then numArrays will be used to populate both
- *    these values in the GSF processing parameters record.
- *
- * Inputs :
- *     p = a pointer to the gsfMBParams data structure which contains
- *         the parameters in internal form.
- *     rec = a pointer to the gsfRecords data structure into which the
- *         parameters are to be written in the "KEYWORK=VALUE" form.
- *     handle = the integer handle to the file set by gsfOpen.
- *     numArrays = the integer value specifying the number of pairs of
- *         arrays which need to have seperate parameters tracked.
- *
- * Returns : This function returns zero if successful, or -1 if an error
- *  occurs.
- *
- * Error Conditions :
- *     GSF_MEMORY_ALLOCATION_FAILED
- *     GSF_PARAM_SIZE_FIXED
- */
-
-int OPTLK       gsfGetMBParams(const gsfRecords *rec, gsfMBParams *p, int *numArrays);
-/* Description : This function moves swath bathymetry sonar processing
- *    parameters from external, form to internal form.  The external
- *    "KEYWORD=VALUE" format parameters are read from a processing_params
- *    structure of a gsfRecords data structure maintained by the caller.
- *    The internal form parameters are written into a gsfMBParams data
- *    structure maintained by the caller. Parameters for up to two transmitters
- *    and two receivers are supported.  The number_of_transmitters and
- *    number_of_receivers elements of the gsfMBParams data structure are set by
- *    determining the number of fields in the parameters for the transmitter(s)
- *    and receiver(s), respectively.  The numArrays argument is set from the
- *    number of fields for the transmitter(s). Any parameter not described in a
- *    "KEYWORD=VALUE" format will be set to "GSF_UNKNOWN_PARAM_VALUE".
- *
- * Inputs :
- *     rec = a pointer to the gsfRecords data structure from which the
- *         parameters in "KEYWORK=VALUE" form are to be read.
- *     p = a pointer to the gsfMBParams data structure which will be populated.
- *     numArrays = the integer value specifying the number of pairs of
- *         arrays which need to have seperate parameters tracked.
- *
- * Returns : This function returns zero if successful, or -1 if an error
- *  occurs.
- *
- * Error Conditions :
- *  none.
- */
-
-int OPTLK       gsfGetSwathBathyBeamWidths(const gsfRecords *data, double *fore_aft, double *athwartship);
-/* Description : This function returns to the caller the fore-aft and
- *    the port-starboard beam widths in degrees for a swath bathymetry
- *    multibeam sonar, given a gsfRecords data structure which contains
- *    a populated gsfSwathBathyPing structure.
- *
- * Inputs :
- *     data = The address of a gsfRecords data structure maintained by the
- *         caller which contains a populated gsfSwathBathyPing substructure.
- *     fore_aft = The address of a double allocated by the caller which will
- *         be loaded with the sonar's fore/aft beam width in degrees. A value of
- *         GSF_BEAM_WIDTH_UNKNOWN is used when the beam width is not known.
- *     athwartship = The address of a double allocated by the caller which will
- *         be loaded with the sonar's athwartship beam width in degrees.  A
- *         value of GSF_BEAM_WIDTH_UNKNOWN is used when the beam width is not known.
- *
- * Returns : This function returns zero if successful, or -1 if an error
- *     occured.
- *
- * Error Conditions : unrecognized sonar id or mode.
- */
-
-int OPTLK gsfIsStarboardPing(const gsfRecords *data);
-/* Description : This function uses the sonar specific data union
- *     of a gsfSwathBathymetry ping structure to determine if the ping
- *     is from the starboard arrays of a multibeam installation with
- *     dual transmit receive sonar arrays.
- *
- * Inputs :
- *     data = The address of a gsfRecords data structure maintained by the
- *         caller which contains a populated gsfSwathBathyPing substructure.
- *
- * Returns : This function returns non-zero if the ping contained in the
- *     passed data represents a starboard looking ping from a dual headed
- *     sonar installation. Otherwise, zero is returned.
- *
- * Error Conditions : unrecognized sonar id or mode.
- */
-
-int OPTLK gsfLoadDepthScaleFactorAutoOffset(gsfSwathBathyPing *ping, unsigned int subrecordID, int reset, double min_depth, double max_depth, double *last_corrector, char c_flag, double precision);
-/* Description : gsfLoadDepthScaleFactorAutoOffset should be used to load
- *  the scale factors for the depth subrecords of the swath bathymetry ping
- *  record scale factor structure. The approach uses the tide and depth
- *  correction fields to help establish the offset component of the scale
- *  factor such that negative depth values may be supported.  Negative
- *  depth values may be encountered when surveying above the tidal datum.
- *  In addition, systems mounted on subsea platforms may support their
- *  native precision even in deep water.
- *
- * Inputs :
- *  ping = A pointer to the gsfSwathBathyPing which contains the depht
- *      and tide correction values, and the scale factors data structure.
- *  subrecordID = the subrecord id for the beam array data.  This must be
- *      either GSF_SWATH_BATHY_SUBRECORD_DEPTH_ARRAY, or
- *      GSF_SWATH_BATHY_SUBRECORD_NOMINAL_DEPTH_ARRAY
- *  c_flag = The compression flag for the beam array
- *  precision = The presision to which the beam array data are to be stored
- *      (a value of 0.1 would indicate decimeter precision for depth)
- *  reset = An integer value which will cause the internal logic to be
- *      refreshed when the value is non-zero.  The first call to this function
- *      should use a non-zero reset, from then on, this value may be passed
- *      as zero.
- *  last_corrector = The address of a double value stored as permanent memory.
- *      Successive calls to this function must pass the same address for this
- *      argument.
- *
- * Returns :
- *  This function returns zero if successful, or -1 if an error occured.
- *
- * Error Conditions :
- *    GSF_TOO_MANY_ARRAY_SUBRECORDS
- *
- */
-
-int OPTLK gsfGetSwathBathyArrayMinMax(const gsfSwathBathyPing *ping, unsigned int subrecordID, double *min_value, double *max_value);
-/* Description : This function may be used to obtain the minimum and maximum
- *  supportable values for each of the swath bathymetry arrays.  The minimum
- *  and maximum values are determined based on the scale factors and the array
- *  type.
- *
- * Inputs :
- *  ping = A pointer to the gsfSwathBathyPing which contains the depht
- *      and tide correction values, and the scale factors data structure.
- *  subrecordID = The subrecord id for the beam array data.  This must be
- *      either GSF_SWATH_BATHY_SUBRECORD_DEPTH_ARRAY, or
- *      GSF_SWATH_BATHY_SUBRECORD_NOMINAL_DEPTH_ARRAY
- *  min_value = The address of a double value allocated by the caller into
- *      which will be placed the minimum value which may be represented for
- *      this array type.
- *  max_value = The address of a double value allocated by the caller into
- *      which will be placed the maximum value which may be represented for
- *      this array type.
- *
- * Returns :
- *  This function returns zero if successful, or -1 if an error occured.
- *
- * Error Conditions :
- *    GSF_UNRECOGNIZED_ARRAY_SUBRECORD_ID
- *    GSF_ILLEGAL_SCALE_FACTOR_MULTIPLIER
- */
-
-const char *gsfGetSonarTextName(const gsfSwathBathyPing *ping);
-/* Description : This function is used to return the text of the sonar name.
- *
- * Inputs : The GSF ping
- *
- * Returns : A text string of the sensors name, or "Unknown" if the sensor id is not found
- *
- * Error Conditions : none
- */
-
-int gsfFileSupportsRecalculateXYZ(int handle, int *status);
-/* Description :
- *  This function reads the GSF file referenced by handle and determines
- *  if the file contains sufficient information to support a full recalculation
- *  of the platform relative XYZ values from raw measurements. This function
- *  rewinds the file to the first record and reads through the file looking for
- *  the information required to support a recalculation. On success, the file
- *  pointer is reset to the beginning of the file before the function returns.
- *
- * Inputs :
- *  handle = the integer handle returned from gsfOpen()
- *  status = A pointer to an integer allocated by caller into which the
- *            function result is placed. *status is assigned a value of 1
- *            if this file provides sufficient information to support full
- *            recalculation of the platform relative XYZ values, otherwise
- *            *status is assigned a value of 0.
- *
- * Returns :
- *  This function returns zero if successful, or -1 if an error occurred.
- *
- * Error Conditions : none
- *  GSF_BAD_FILE_HANDLE
- *  GSF_FILE_SEEK_ERROR
- *  GSF_FLUSH_ERROR
- *  GSF_READ_TO_END_OF_FILE
- *  GSF_READ_ERROR
- *  GSF_RECORD_SIZE_ERROR
- *  GSF_INSUFFICIENT_SIZE
- *  GSF_CHECKSUM_FAILURE
- *  GSF_UNRECOGNIZED_RECORD_ID
- *  GSF_HEADER_RECORD_DECODE_FAILED
- *  GSF_SVP_RECORD_DECODE_FAILED
- *  GSF_PROCESS_PARAM_RECORD_DECODE_FAILED
- *  GSF_SENSOR_PARAM_RECORD_DECODE_FAILED
- *  GSF_COMMENT_RECORD_DECODE_FAILED
- *  GSF_HISTORY_RECORD_DECODE_FAILED
- *  GSF_NAV_ERROR_RECORD_DECODE_FAILED
- */
-
-int gsfFileSupportsRecalculateTPU(int handle, int *status);
-/* Description :
- *  This function reads the GSF file referenced by handle and determines
- *  if the file contains sufficient information to support a recalculation
- *  of the total propagated uncertainty (TPU) estimates. This function
- *  rewinds the file to the first record and reads through the file looking for
- *  the information required to support TPU estimation. On success, the file
- *  pointer is reset to the beginning of the file before the function returns.
- *
- * Inputs :
- *  handle = the integer handle returned from gsfOpen()
- *  status = A pointer to an integer allocated by caller into which the
- *           function result is placed. *status is assigned a value of 1
- *           if this file provides sufficient information to support TPU
- *           estimation, otherwise *status is assigned a value of 0.
- *
- * Returns :
- *  This function returns zero if successful, or -1 if an error occurred.
- *
- * Error Conditions :
- *  GSF_BAD_FILE_HANDLE
- *  GSF_FILE_SEEK_ERROR
- *  GSF_FLUSH_ERROR
- *  GSF_READ_TO_END_OF_FILE
- *  GSF_READ_ERROR
- *  GSF_RECORD_SIZE_ERROR
- *  GSF_INSUFFICIENT_SIZE
- *  GSF_CHECKSUM_FAILURE
- *  GSF_UNRECOGNIZED_RECORD_ID
- *  GSF_HEADER_RECORD_DECODE_FAILED
- *  GSF_SVP_RECORD_DECODE_FAILED
- *  GSF_PROCESS_PARAM_RECORD_DECODE_FAILED
- *  GSF_SENSOR_PARAM_RECORD_DECODE_FAILED
- *  GSF_COMMENT_RECORD_DECODE_FAILED
- *  GSF_HISTORY_RECORD_DECODE_FAILED
- *  GSF_NAV_ERROR_RECORD_DECODE_FAILED
- */
-
-int gsfFileSupportsRecalculateNominalDepth(int handle, int *status);
-/* Description :
- *  This function reads the GSF file referenced by handle and determines
- *  if the file contains sufficient information to support a recalculation
- *  of the nominal depth array. This function rewinds the file to the first
- *  record and reads through the file looking for the information required
- *  to support calculation of the nominal depth values. On success, the file
- *  pointer is reset to the beginning of the file before the function returns.
- *
- * Inputs :
- *  handle = the integer handle returned from gsfOpen()
- *  status = A pointer to an integer allocated by caller into which the
- *           function result is placed. *status is assigned a value of 1
- *           if this file provides sufficient information to support
- *           nominal depth calculation, otherwise *status is assigned
- *           a value of 0.
- *
- * Returns :
- *  This function returns zero if successful, or -1 if an error occurred.
- *
- * Error Conditions :
- *  GSF_BAD_FILE_HANDLE
- *  GSF_FILE_SEEK_ERROR
- *  GSF_FLUSH_ERROR
- *  GSF_READ_TO_END_OF_FILE
- *  GSF_READ_ERROR
- *  GSF_RECORD_SIZE_ERROR
- *  GSF_INSUFFICIENT_SIZE
- *  GSF_CHECKSUM_FAILURE
- *  GSF_UNRECOGNIZED_RECORD_ID
- *  GSF_HEADER_RECORD_DECODE_FAILED
- *  GSF_SVP_RECORD_DECODE_FAILED
- *  GSF_PROCESS_PARAM_RECORD_DECODE_FAILED
- *  GSF_SENSOR_PARAM_RECORD_DECODE_FAILED
- *  GSF_COMMENT_RECORD_DECODE_FAILED
- *  GSF_HISTORY_RECORD_DECODE_FAILED
- *  GSF_NAV_ERROR_RECORD_DECODE_FAILED
- */
-
-int gsfFileContainsMBAmplitude(int handle, int *status);
-/* Function Name : gsfFileContainsMBAmplitude
- *
- * Description :
- *  This function reads the GSF file referenced by handle and determines
- *  if the file contains the average per receive beam amplitude data.
- *  This function rewinds the file to the first record and reads through
- *  the file up to and including the first ping record. If amplitude data
- *  are contained in the first ping record it is assumed that amplitude
- *  data are contained with all ping records in this file. On success,
- *  the file pointer is reset to the beginning of the file before the
- *  function returns.
- *
- * Inputs :
- *  handle = the integer handle returned from gsfOpen()
- *  status = A pointer to an integer allocated by caller into which the
- *           function result is placed. *status is assigned a value of 1
- *           if this file contains the per receive beam amplitude data,
- *           otherwise *status is assigned a value of 0.
- *
- * Returns :
- *  This function returns zero if successful, or -1 if an error occurred.
- *
- * Error Conditions :
- *  GSF_BAD_FILE_HANDLE
- *  GSF_FILE_SEEK_ERROR
- *  GSF_FLUSH_ERROR
- *  GSF_READ_TO_END_OF_FILE
- *  GSF_READ_ERROR
- *  GSF_RECORD_SIZE_ERROR
- *  GSF_INSUFFICIENT_SIZE
- *  GSF_CHECKSUM_FAILURE
- *  GSF_UNRECOGNIZED_RECORD_ID
- *  GSF_HEADER_RECORD_DECODE_FAILED
- *  GSF_SVP_RECORD_DECODE_FAILED
- *  GSF_PROCESS_PARAM_RECORD_DECODE_FAILED
- *  GSF_SENSOR_PARAM_RECORD_DECODE_FAILED
- *  GSF_COMMENT_RECORD_DECODE_FAILED
- *  GSF_HISTORY_RECORD_DECODE_FAILED
- *  GSF_NAV_ERROR_RECORD_DECODE_FAILED
- */
-
-int gsfFileContainsMBImagery(int handle, int *status);
-/* Function Name : gsfFileContainsMBImagery
- *
- * Description :
- *  This function reads the GSF file referenced by handle and determines
- *  if the file contains the per receive beam imagery time series data.
- *  This function rewinds the file to the first record and reads through
- *  the file up to and including the first ping record. If MB imagery data
- *  are contained in the first ping record it is assumed that MB imagery
- *  data are contained with all ping records in this file. On success,
- *  the file pointer is reset to the beginning of the file before the
- *  function returns.
- *
- * Inputs :
- *  handle = the integer handle returned from gsfOpen()
- *  status = A pointer to an integer allocated by caller into which the
- *           function result is placed. *status is assigned a value of 1
- *           if this file contains the per receive beam imagery time
- *           series data, otherwise *status is assigned a value of 0.
- *
- * Returns :
- *  This function returns zero if successful, or -1 if an error occurred.
- *
- * Error Conditions :
- *  GSF_BAD_FILE_HANDLE
- *  GSF_FILE_SEEK_ERROR
- *  GSF_FLUSH_ERROR
- *  GSF_READ_TO_END_OF_FILE
- *  GSF_READ_ERROR
- *  GSF_RECORD_SIZE_ERROR
- *  GSF_INSUFFICIENT_SIZE
- *  GSF_CHECKSUM_FAILURE
- *  GSF_UNRECOGNIZED_RECORD_ID
- *  GSF_HEADER_RECORD_DECODE_FAILED
- *  GSF_SVP_RECORD_DECODE_FAILED
- *  GSF_PROCESS_PARAM_RECORD_DECODE_FAILED
- *  GSF_SENSOR_PARAM_RECORD_DECODE_FAILED
- *  GSF_COMMENT_RECORD_DECODE_FAILED
- *  GSF_HISTORY_RECORD_DECODE_FAILED
- *  GSF_NAV_ERROR_RECORD_DECODE_FAILED
- */
-
-int gsfIsNewSurveyLine(int handle, const gsfRecords *rec, double azimuth_change, double *last_heading);
-/* Function Name : gsfIsNewSurveyLine
- *
- * Description : This function provides an approach for calling applications
- *  to determine if the last ping read from a GSF file is from the same survey
- *  transect line, or if the last ping is from a newly started survey line. The
- *  implementation looks for a change in platform heading to determine that the
- *  last ping read is from a new survey line. External to this function, calling
- *  applications can decide on their own if the first ping read from a newly opened
- *  GSF file should be considered to be from a new survey transect line or not.
- *  This function assumes that the GSF file is read in chronological order from
- *  the beginning of the file, file access can be either direct or sequential
- *
- * Inputs :
- *  handle         = The handle to the file as provided by gsfOpen
- *  rec            = A pointer to a gsfRecords structure containing the data from the most
- *                    recent call to gsfRead
- *  azimuth_change = The trigger value specifying the change in platform heading that
- *                    must be exceeded for a new survey transect line to be determined
- *  last_heading   = A pointer to a double allocated by the caller and into which this
- *                    function will place the heading value for each detected line. The
- *                    value must be allocated as permanent memory that persists through
- *                    all calls to this function. Startup or reset events can be handled
- *                    by the caller by placing a negative value in this memory location.
- *
- * Returns :
- *  This function returns 1 if this ping is considered to be the first ping of a new
- *   survey transect line, otherwise, 0 is returned.
- *
- * Error Conditions :
- *  none
- */
-
-void gsfInitializeMBParams (gsfMBParams *p);
-/********************************************************************
- *
- * Function Name : gsfInitializeMBParams
- *
- * Description : This function provides a way to initialize all the
- *    sonar processing parameters to "unknown"
- *
- * Inputs :
- *    p = a pointer to the gsfMBParams data structure that needs initializing
- *
- * Returns :
- *    None
- *
- * Error Conditions :
- *    None
- *
- ********************************************************************/
-
-
-int gsfStat (const char *filename, long long *sz);
-/********************************************************************
- *
- * Function Name : gsfStat
- *
- * Description : This function attempts to stat a GSF file.
- *               Supports 64 bit file size.
- *
- * Inputs :
- *  filename = a fully qualified path to the gsf file
- *  sz       = pointer to an 8 byte long long for return
- *             of the GSF file size from the stat64 system call.
- *
- * Returns :
- *  This funciton returns zero if successful, or -1 if an error occured.
- *
- * Error Conditions :
- *     GSF_FOPEN_ERROR
- *     GSF_UNRECOGNIZED_FILE
- *
- ********************************************************************/
-
-int gsfSetDefaultScaleFactor(gsfSwathBathyPing *mb_ping);
-/********************************************************************
- *
- * Function Name : gsfSetDefaultScaleFactor
- *
- * Description : This function is used to estimate and set scale
- *               factors for a ping record
- *
- * Inputs :
- *    mb_ping - a pointer to a ping record.  The scale factors
- *              will be set in this record.
- *
- * Returns : This function returns 0.
- *
- * Error Conditions : none
- *
- ********************************************************************/
-
-/********************************************************************
- *
- * Function Name : gsfGetPositionDestination
- *
- * Description : compute a new position from an existing one.
- *
- * Inputs : ref pos, offsets from ref (+x forward, +y starboard, + z down), ref heading (+hdg cw from north), maximum distance step.
- *
- * Returns : new position
- *
- * Error Conditions :
- *
- ********************************************************************/
-
-GSF_POSITION *gsfGetPositionDestination(GSF_POSITION gp, GSF_POSITION_OFFSETS offsets, double hdg, double dist_step);
-
-/********************************************************************
- *
- * Function Name : gsfGetPositionOffsets
- *
- * Description : compute offsets between two positions.
- *
- * Inputs : ref pos, new pos, ref heading (+hdg cw from north), maximum distance_step.
- *
- * Returns : offsets from ref (+x forward, +y starboard, + z down)
- *
- * Error Conditions :
- *
- ********************************************************************/
-
-GSF_POSITION_OFFSETS *gsfGetPositionOffsets(GSF_POSITION gp_from, GSF_POSITION gp_to, double hdg, double dist_step);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __GSF_H__ */
diff --git a/src/gsf/gsf.h.orig b/src/gsf/gsf.h.orig
deleted file mode 100644
index 0628ccf..0000000
--- a/src/gsf/gsf.h.orig
+++ /dev/null
@@ -1,2895 +0,0 @@
-/********************************************************************
- *
- * Module Name : GSF.H
- *
- * Author/Date : J. S. Byrne / Jan 25,  1994
- *
- * Description : This is the header file for the GSF ToolKit
- *
- * Restrictions/Limitations :
- * 1) This library assumes the host computer uses the ASCII character set.
- * 2) This library assumes that the type short is 16 bits, and that the type
- *    int is 32 bits.
- *
- * Change Descriptions :
- * who when      what
- * --- ----      ----
- * jsb 10/17/94  Added support for Reson Seabat data
- * jsb 01/29/95  Added support for em121a nominal depth array
- * jsb 08/14/95  Scale factors and pointers to dynamically allocated memory
- *               now maintained by the library, not the caller.  Consolidated
- *               APIs for sequential and direct access, now both use gsfRead
- *               and gsfWrite. This is version GSF-v01.01.
- * jsb 11/01/95  Completed modifications to indexing to support increase in
- *               gsf file size after initial index file creation.  The size
- *               of the file is now stored in the index file header. Index
- *               files without the expected header are recreated on the first
- *               open. This is still version GSF-v01.01. Also added a unique
- *               sensor specific subrecord for Simrad EM1000.
- * jsb 12/22/95  Added gsfGetMBParams, gsfPutMBParams, gsfIsStarboardPing,
- *               and gsfGetSwathBathyBeamWidths. Also added GSF_APPEND as
- *               a file access mode, and modifed GSF_CREATE access mode so
- *               that files can be updated (read and written). This is gsf
- *               library version GSF-v01.02.
- * hem 08/20/96  Added gsfSingleBeamPing Record structure; added Type III
- *               Seabeam, Echotrac, Bathy200, MGD77, BDB, & NOS HDB subrecord
- *               IDs & subrecords; added gsfStringError.  This is gsf library
- *               version GSF-v1.03.
- * jsb 09/27/96  Added support for SeaBeam with amplitude data.
- * jsb 03/24/97  Added gsfSeaBatIISpecific data structure to replace
- *               the gsfSeaBatSpecific data structure, for the Reson 900x
- *               series sonar systems.  Also added gsfSeaBat8101Specific
- *               data structure for the Reson 8101 series sonar system.
- *               Increased the macro GSF_MAX_RECORD_SIZE from 4k to 32k.
- *               This is GSF library version GSF-v1.04.
- * bac 10/27/97  Added a sensor specific subrecord for the SeaBeam 2112/36.
- * dwc 1/9/98    Added a sensor specific subrecord for the Elac Bottomchart MkII.
- * jsb 9/28/98   Added new navigation error record definition. gsfHVNavigationError.
- *               This record is intended to replace the gsfNavigationError record.
- *               This change addresses CRs: GSF-98-001, and GSF-98-002. Also added
- *               new ping array subrecords: horizontal_error, and vertical_error. This
- *               change address CR: GSF-98-003. These new subrecords are intended to
- *               replace the depth_errror, along_track_error and across_track_error
- *               subrecords. In a future release, new file support for these three
- *               error subrecords will be dropped. This is library version GSF-v1.07.
- * jsb 12/19/98  Added support for em3000. Also increased number of entries available
- *               for processing and sensor parameter records. This is library version
- *               GSF-v1.08.
- * wkm 4/1/99    Added CMP_SASS subrecord for Compressed SASS (BOSDAT) data.  This
- *               subrecord should be used in place of the SASS subrecord (TypeIII).
- *               The original has been left in tactc so as to not break existing code.
- * jsb 07/20/99  Completed work on GSF version 1.08.  Added new functions gsfGetSwathBathyArrayMinMax,
- *               and gsfLoadDepthScaleFactorAutoOffset in support of signed depth.
- *               This release addresses the following CRs: GSF-99-002, GSF-99-006, GSF-99-007,
- *               GSF-99-008, GSF-99-009, GSF-99-010, GSF-99-011, GSF-99-012,
- * wkm 7/30/99   Updated SASS specific data subrecord to include 'lntens' and renamed
- *               surface_velocity to 'lfreq'.  These are the original SASS data filed
- *               names and were requested by NAVO to remane in tact.  Added commet block
- *               to document mapping of SASS data fields to GSF.
- * bac 12-22-99  Applications built with GCC that use GSF.DLL require any global data to be explicitly
- *               defined as imported from a DLL.  When this is the case, gsfError gets redefined
- *               as *__imp_gsfError.  gsfError is unchanged for other compilers or static linking with GCC.
- *               Programs built with the GCC and using gsf.dll must define gsf_USE_DLL
- *               (-Dgsf_USE_DLL) when building. This is version GSF_1.10
- * bac 10-24-00  Updated gsfEM3RunTime structure to include data fields from updated
- *               EM series runtime parameter datagram.  Also added an additional check
- *               for the LINUX define of timespec.
- * bac 07-18-01  Added a sensor specific subrecord for the Reson 8100 series of sonars.  Also
- *               made modifications for use with C++ code.  The typedef for each sensor specific
- *               structure has been modfied to have a different name than the element of the SensorSpecific
- *               union.  Also removed the useage of C++ reserved words "class" and "operator".  These
- *               modifications will potentially require some changes to application code.
- * bac 10-12-01  Added a new attitude record definition.  The attitude record provides a method for
- *               logging full time-series attitude measurements in the GSF file, instead of attitude
- *               samples only at ping time.  Each attitude record contains arrays of attitude
- *               measurements for time, roll, pitch, heave and heading.  The number of measurements
- *               is user-definable, but because of the way in which measurement times are stored, a
- *               single attitude record should never contain more than sixty seconds worth of
- *               data.
- * bac 11-09-01  Added motion sensor offsets to the gsfMBOffsets structure.  Added support for these
- *               new offsets in the gsfPutMBParams and gsfGetMBParams functions, so these offsets are
- *               encoded in the process_parameters record.
- * jsb 01-16-02  Added support for Simrad EM120.
- * bac 06-19-03  Added support for bathymetric receive beam time series intensity data (i.e., Simrad
- *               "Seabed image" and Reson "snippets").  Inlcluded RWL updates of 12-19-02 for adding
- *               sensor-specific singlebeam information to the MB sensor specific subrecords.
- * bac 12-28-04  Added support for Reson Navisound, EM3000D, EM3002, and EM3002D.  Renumbered
- *               singlebeam subrecord IDs to be less than 256, as previous version did not save
- *               these sensors IDs correctly.  Added beam spacing to Reson 8100 sensor-specific
- *               subrecord.  Added definitions for RTG position types in gsfHVNavigationError record.
- * bac 06-28-06  Added sensor ID for EM121A data received via Kongsberg SIS, mapped to existing
- *               EM3 series sensor specific data structure.  Added __APPLE__ macro definition to
- *               support compile switch steering around definition of struct timespec on MAC OSX.
- *               Changed structure elements of type long to int, for compilation on 64-bit architectures.
- * dhg 09-27-06  Added sensor ID for gsfGeoSwathPlusSpecific data received via GeoSwath interferometric
- *               250 Khz sonar.
- * dhg 10-04-06  Added more sensor specific fields for the GeoSwathPlus interferometric sonar.
- * jsb 07-24-07  GSFv2.07 includes some additional parameters in the imagery sensor specific structure
- *                to support calculating back to the exact original intensity values received from the
- *                sonar.
- * bsl 11-05-07  Added sensor ID and structure for gsfGeoSwathPlusSpecific data received via Klein 5410
- *                bathymetric sidescan sonar.  Also added an imagery sensor specific structure.
- * jsb 11-06-07  Updates to utilize the subrecord size in termining the field size for the array subrecords
- *                that support more than one field size.  Also replaced use of strstr with strcmp in gsfGetMBParams
- *                to resolve potential problem where one keyword name may be fully contained in another.
- * DHG 2008/12/18 Add "VESSEL_TYPE" to Processing Parameters for AUV vs Surface Ship discrimination.
- * mab 02-01-09  Updates to support Reson 7125. Added new subrecord IDs and subrecord definitions for Kongsberg
- *                sonar systems where TWTT and angle are populated from raw range and beam angle datagram. Added
- *                new subrecord definition for EM2000.  Bug fixes in gsfOpen and gsfPercent.
- * mab 06-11-09  Moved GSF_MAX_RECORD_SIZE from 256KB to 512KB to accomodate Reson7125 imagery.
- * jsb 01-14-10  Added new function prototypes to return various status information about the opened GSF file.
- * clb 04-21-11  Changed version from 03.02 to 03.03
- * clb 05-11-11  Changed the value of GSF_NULL_DEPTH_CORRECTOR (STR 19142)
- * clb 05-11-11  Added depth sensor and receiver array offsets to gsfMBOffsets structure
- * clb 05-27-11  Added __MINGW64__ references
- * clb 06-21-11  Added t_gsfEM12Specific structure
- * clb 09-20-11  Added R2Sonic support
- * clb 10-04-11  Added GSF_PARTIAL_RECORD_AT_END_OF_FILE error code
- * clb 11-09-11  Added gsfInitializeMBParams() prototype
- * clb 11-10-11  Changed value of GSF_NULL_DEPTH_CORRECTOR back to 99.99 for backwards compatibility
- * clb 09-13-11  Added check for HAVE_STRUCT_TIMESPEC when defining timespec; updated version to 03.05
- * jhp 02-10-14  Added GSF_SWATH_BATHY_SUBRECORD_SONAR_VERT_UNCERT_ARRAY
- * jhp 03-31-14  Added support for R2Sonic 2020.
- *
- * Classification : Unclassified
- *
- * References : DoDBL Generic Sensor Format Sept. 30, 1993
- *
- * copyright 2014 Leidos, Inc.
- * There is no charge to use the library, and it may be accessed at: https://www.leidos.com/maritime/gsf
- * This library may be redistributed and/or modified under the terms of the GNU Lesser General Public License
- * version 2.1, as published by the Free Software Foundation.  A copy of the LGPL 2.1 license is included
- * with the GSF distribution and is avaialbe at: http://opensource.org/licenses/LGPL-2.1.
- *
- * Leidos, Inc. configuration manages GSF, and provides GSF releases. Users are strongly encouraged to
- * communicate change requests and change proposals to Leidos, Inc.
- *
- * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- ********************************************************************/
-
-#ifndef  __GSF_H__
-#define __GSF_H__
-
-/* Get the required standard C library includes */
-#include <stdio.h>
-#include <time.h>
-
-/* Get the required system include files */
-#include <float.h>
-#ifdef __OS2__
-#include <types.h>
-#include <utils.h>
-/* specify OS/2 Optlink linkage in the function prototype */
-#ifndef OPTLK
-#define OPTLK _Optlink
-#endif
-#else
-#include <sys/types.h>
-#define OPTLK
-#endif
-
-#ifdef __cplusplus
-extern          "C"
-{
-#endif
-
-/* Define this version of the GSF library (MAXIMUM 11 characters) */
-#define GSF_VERSION       "GSF-v03.06"
-
-/* Define largest ever expected record size */
-#define GSF_MAX_RECORD_SIZE    524288
-
-/* Define the maximum number of files which may be open at once */
-#define GSF_MAX_OPEN_FILES     4
-
-/* Define the GSF data file access flags */
-#define GSF_CREATE             1
-#define GSF_READONLY           2
-#define GSF_UPDATE             3
-#define GSF_READONLY_INDEX     4
-#define GSF_UPDATE_INDEX       5
-#define GSF_APPEND             6
-
-/* Define options for sequential access gsf file pointer manipulation */
-#define GSF_REWIND             1
-#define GSF_END_OF_FILE        2
-#define GSF_PREVIOUS_RECORD    3
-
-/* Typedefs for GSF short and long integers */
-typedef unsigned short gsfuShort;      /* an unsigned 16 bit integer */
-typedef unsigned int   gsfuLong;       /* an unsigned 32 bit integer */
-typedef short          gsfsShort;      /* a signed 16 bit integer */
-typedef int            gsfsLong;       /* a signed 32 bit integer */
-
-#define GSF_SHORT_SIZE 2
-#define GSF_LONG_SIZE  4
-
-/* redefine gsfError for MINGW applications using gsf.dll, harmless for other compilers */
-#if defined (__MINGW32__) || defined (__MINGW64__)
-  #if __GNUC__ < 3
-     #ifdef gsf_USE_DLL
-      #define gsfError *__imp_gsfError
-     #endif
-  #endif
-#endif
-
-/* Define the gsf Data Identifier structure */
-typedef struct t_gsfDataID
-{
-    int             checksumFlag;       /* boolean */
-    int             reserved;           /* up to 9 bits */
-    unsigned int    recordID;           /* bits 00-11 => data type number */
-                                        /* bits 12-22 => registry number */
-    int             record_number;      /* specifies the nth occurance of */
-                                        /* record type specified by recordID */
-                                        /* relavent only for direct access */
-                                        /* the record_number counts from 1 */
-}
-gsfDataID;
-
-/* Specify a key to allow reading the next record, no matter what it is */
-#define GSF_NEXT_RECORD 0
-
-/* Specify the GSF record data type numbers, for registry number zero */
-#define GSF_RECORD_HEADER                                   1u
-#define GSF_RECORD_SWATH_BATHYMETRY_PING                    2u
-#define GSF_RECORD_SOUND_VELOCITY_PROFILE                   3u
-#define GSF_RECORD_PROCESSING_PARAMETERS                    4u
-#define GSF_RECORD_SENSOR_PARAMETERS                        5u
-#define GSF_RECORD_COMMENT                                  6u
-#define GSF_RECORD_HISTORY                                  7u
-#define GSF_RECORD_NAVIGATION_ERROR                         8u /* 10/19/98 This record is obsolete */
-#define GSF_RECORD_SWATH_BATHY_SUMMARY                      9u
-#define GSF_RECORD_SINGLE_BEAM_PING                         10u
-#define GSF_RECORD_HV_NAVIGATION_ERROR                      11u /* This record replaces GSF_RECORD_NAVIGATION_ERROR */
-#define GSF_RECORD_ATTITUDE                                 12u
-
-/* Number of currently defined record data types (including 0 which is used
- *  in the indexing for ping records which contain scale factor subrecords).
- */
-#define             NUM_REC_TYPES  13
-
-/* Put a ceiling on the maximum number of swath bathymetry ping array
- * subrecords allowed in a gsf file.  This define dimensions the scale
- * factors structure.
- */
-#define GSF_MAX_PING_ARRAY_SUBRECORDS 27
-
-/* Specify the GSF swath bathymetry ping subrecord identifiers. The beam
- *  data definitions specify the index into the scale factor table, and
- *  define the subrecord id put down on the disk with the subrecord.
- */
-#define GSF_SWATH_BATHY_SUBRECORD_DEPTH_ARRAY                  1u
-#define GSF_SWATH_BATHY_SUBRECORD_ACROSS_TRACK_ARRAY           2u
-#define GSF_SWATH_BATHY_SUBRECORD_ALONG_TRACK_ARRAY            3u
-#define GSF_SWATH_BATHY_SUBRECORD_TRAVEL_TIME_ARRAY            4u
-#define GSF_SWATH_BATHY_SUBRECORD_BEAM_ANGLE_ARRAY             5u
-#define GSF_SWATH_BATHY_SUBRECORD_MEAN_CAL_AMPLITUDE_ARRAY     6u
-#define GSF_SWATH_BATHY_SUBRECORD_MEAN_REL_AMPLITUDE_ARRAY     7u
-#define GSF_SWATH_BATHY_SUBRECORD_ECHO_WIDTH_ARRAY             8u
-#define GSF_SWATH_BATHY_SUBRECORD_QUALITY_FACTOR_ARRAY         9u
-#define GSF_SWATH_BATHY_SUBRECORD_RECEIVE_HEAVE_ARRAY          10u
-#define GSF_SWATH_BATHY_SUBRECORD_DEPTH_ERROR_ARRAY            11u /* 10/19/98 jsb This ping array subrecord is obsolete */
-#define GSF_SWATH_BATHY_SUBRECORD_ACROSS_TRACK_ERROR_ARRAY     12u /* 10/19/98 jsb This ping array subrecord is obsolete */
-#define GSF_SWATH_BATHY_SUBRECORD_ALONG_TRACK_ERROR_ARRAY      13u /* 10/19/98 jsb This ping array subrecord is obsolete */
-#define GSF_SWATH_BATHY_SUBRECORD_NOMINAL_DEPTH_ARRAY          14u
-#define GSF_SWATH_BATHY_SUBRECORD_QUALITY_FLAGS_ARRAY          15u
-#define GSF_SWATH_BATHY_SUBRECORD_BEAM_FLAGS_ARRAY             16u
-#define GSF_SWATH_BATHY_SUBRECORD_SIGNAL_TO_NOISE_ARRAY        17u
-#define GSF_SWATH_BATHY_SUBRECORD_BEAM_ANGLE_FORWARD_ARRAY     18u
-#define GSF_SWATH_BATHY_SUBRECORD_VERTICAL_ERROR_ARRAY         19u /* This record replaces DEPTH_ERROR_ARRAY */
-#define GSF_SWATH_BATHY_SUBRECORD_HORIZONTAL_ERROR_ARRAY       20u /* This record replaces ACROSS_TRACK_ERROR_ARRAY and ALONG_TRACK_ERROR_ARRAY */
-#define GSF_SWATH_BATHY_SUBRECORD_INTENSITY_SERIES_ARRAY       21u
-#define GSF_SWATH_BATHY_SUBRECORD_SECTOR_NUMBER_ARRAY          22u
-#define GSF_SWATH_BATHY_SUBRECORD_DETECTION_INFO_ARRAY         23u
-#define GSF_SWATH_BATHY_SUBRECORD_INCIDENT_BEAM_ADJ_ARRAY      24u
-#define GSF_SWATH_BATHY_SUBRECORD_SYSTEM_CLEANING_ARRAY        25u
-#define GSF_SWATH_BATHY_SUBRECORD_DOPPLER_CORRECTION_ARRAY     26u
-#define GSF_SWATH_BATHY_SUBRECORD_SONAR_VERT_UNCERT_ARRAY      27u
-
-/* Define the additional swath bathymetry subrecords, to which the scale
- * factors do not apply.
- */
-#define GSF_SWATH_BATHY_SUBRECORD_UNKNOWN                     0u
-#define GSF_SWATH_BATHY_SUBRECORD_SCALE_FACTORS             100u
-#define GSF_SWATH_BATHY_SUBRECORD_SEABEAM_SPECIFIC          102u
-#define GSF_SWATH_BATHY_SUBRECORD_EM12_SPECIFIC             103u
-#define GSF_SWATH_BATHY_SUBRECORD_EM100_SPECIFIC            104u
-#define GSF_SWATH_BATHY_SUBRECORD_EM950_SPECIFIC            105u
-#define GSF_SWATH_BATHY_SUBRECORD_EM121A_SPECIFIC           106u
-#define GSF_SWATH_BATHY_SUBRECORD_EM121_SPECIFIC            107u
-#define GSF_SWATH_BATHY_SUBRECORD_SASS_SPECIFIC             108u /* 03-30-99 wkm/dbj Typeiii SASS ping array subrecord is obsolete */
-#define GSF_SWATH_BATHY_SUBRECORD_SEAMAP_SPECIFIC           109u
-#define GSF_SWATH_BATHY_SUBRECORD_SEABAT_SPECIFIC           110u
-#define GSF_SWATH_BATHY_SUBRECORD_EM1000_SPECIFIC           111u
-#define GSF_SWATH_BATHY_SUBRECORD_TYPEIII_SEABEAM_SPECIFIC  112u  /* 03-30-99 wkm/dbj Typeiii Seabeam ping array subrecord is obsolete */
-#define GSF_SWATH_BATHY_SUBRECORD_SB_AMP_SPECIFIC           113u
-#define GSF_SWATH_BATHY_SUBRECORD_SEABAT_II_SPECIFIC        114u
-#define GSF_SWATH_BATHY_SUBRECORD_SEABAT_8101_SPECIFIC      115u
-#define GSF_SWATH_BATHY_SUBRECORD_SEABEAM_2112_SPECIFIC     116u
-#define GSF_SWATH_BATHY_SUBRECORD_ELAC_MKII_SPECIFIC        117u
-#define GSF_SWATH_BATHY_SUBRECORD_EM3000_SPECIFIC           118u
-#define GSF_SWATH_BATHY_SUBRECORD_EM1002_SPECIFIC           119u
-#define GSF_SWATH_BATHY_SUBRECORD_EM300_SPECIFIC            120u
-#define GSF_SWATH_BATHY_SUBRECORD_CMP_SASS_SPECIFIC         121u
-#define GSF_SWATH_BATHY_SUBRECORD_RESON_8101_SPECIFIC       122u
-#define GSF_SWATH_BATHY_SUBRECORD_RESON_8111_SPECIFIC       123u
-#define GSF_SWATH_BATHY_SUBRECORD_RESON_8124_SPECIFIC       124u
-#define GSF_SWATH_BATHY_SUBRECORD_RESON_8125_SPECIFIC       125u
-#define GSF_SWATH_BATHY_SUBRECORD_RESON_8150_SPECIFIC       126u
-#define GSF_SWATH_BATHY_SUBRECORD_RESON_8160_SPECIFIC       127u
-#define GSF_SWATH_BATHY_SUBRECORD_EM120_SPECIFIC            128u
-#define GSF_SWATH_BATHY_SUBRECORD_EM3002_SPECIFIC           129u
-#define GSF_SWATH_BATHY_SUBRECORD_EM3000D_SPECIFIC          130u
-#define GSF_SWATH_BATHY_SUBRECORD_EM3002D_SPECIFIC          131u
-#define GSF_SWATH_BATHY_SUBRECORD_EM121A_SIS_SPECIFIC       132u
-#define GSF_SWATH_BATHY_SUBRECORD_EM710_SPECIFIC            133u
-#define GSF_SWATH_BATHY_SUBRECORD_EM302_SPECIFIC            134u
-#define GSF_SWATH_BATHY_SUBRECORD_EM122_SPECIFIC            135u
-#define GSF_SWATH_BATHY_SUBRECORD_GEOSWATH_PLUS_SPECIFIC    136u /* 2006-09-27: dhg: GeoAcoustics GeoSwath+ */
-#define GSF_SWATH_BATHY_SUBRECORD_KLEIN_5410_BSS_SPECIFIC   137u
-#define GSF_SWATH_BATHY_SUBRECORD_RESON_7125_SPECIFIC       138u /* 2008-07-17: mab: Reson7p series sonars */
-#define GSF_SWATH_BATHY_SUBRECORD_EM2000_SPECIFIC           139u
-#define GSF_SWATH_BATHY_SUBRECORD_EM300_RAW_SPECIFIC        140u /* 2009-02-10: mab: EM3 sonars with raw range and beam angles */
-#define GSF_SWATH_BATHY_SUBRECORD_EM1002_RAW_SPECIFIC       141u
-#define GSF_SWATH_BATHY_SUBRECORD_EM2000_RAW_SPECIFIC       142u
-#define GSF_SWATH_BATHY_SUBRECORD_EM3000_RAW_SPECIFIC       143u
-#define GSF_SWATH_BATHY_SUBRECORD_EM120_RAW_SPECIFIC        144u
-#define GSF_SWATH_BATHY_SUBRECORD_EM3002_RAW_SPECIFIC       145u
-#define GSF_SWATH_BATHY_SUBRECORD_EM3000D_RAW_SPECIFIC      146u
-#define GSF_SWATH_BATHY_SUBRECORD_EM3002D_RAW_SPECIFIC      147u
-#define GSF_SWATH_BATHY_SUBRECORD_EM121A_SIS_RAW_SPECIFIC   148u
-#define GSF_SWATH_BATHY_SUBRECORD_EM2040_SPECIFIC           149u
-#define GSF_SWATH_BATHY_SUBRECORD_DELTA_T_SPECIFIC          150u
-#define GSF_SWATH_BATHY_SUBRECORD_R2SONIC_2022_SPECIFIC     151u
-#define GSF_SWATH_BATHY_SUBRECORD_R2SONIC_2024_SPECIFIC     152u
-#define GSF_SWATH_BATHY_SUBRECORD_R2SONIC_2020_SPECIFIC     153u
-
-#define GSF_SINGLE_BEAM_SUBRECORD_UNKNOWN                     0u
-#define GSF_SINGLE_BEAM_SUBRECORD_ECHOTRAC_SPECIFIC         201u
-#define GSF_SINGLE_BEAM_SUBRECORD_BATHY2000_SPECIFIC        202u
-#define GSF_SINGLE_BEAM_SUBRECORD_MGD77_SPECIFIC            203u
-#define GSF_SINGLE_BEAM_SUBRECORD_BDB_SPECIFIC              204u
-#define GSF_SINGLE_BEAM_SUBRECORD_NOSHDB_SPECIFIC           205u
-#define GSF_SWATH_BATHY_SB_SUBRECORD_ECHOTRAC_SPECIFIC      206u
-#define GSF_SWATH_BATHY_SB_SUBRECORD_BATHY2000_SPECIFIC     207u
-#define GSF_SWATH_BATHY_SB_SUBRECORD_MGD77_SPECIFIC         208u
-#define GSF_SWATH_BATHY_SB_SUBRECORD_BDB_SPECIFIC           209u
-#define GSF_SWATH_BATHY_SB_SUBRECORD_NOSHDB_SPECIFIC        210u
-#define GSF_SWATH_BATHY_SB_SUBRECORD_PDD_SPECIFIC           211u
-#define GSF_SWATH_BATHY_SB_SUBRECORD_NAVISOUND_SPECIFIC     212u
-
-/* Define null values to be used for missing data */
-#define GSF_NULL_LATITUDE               91.0
-#define GSF_NULL_LONGITUDE             181.0
-#define GSF_NULL_HEADING               361.0
-#define GSF_NULL_COURSE                361.0
-#define GSF_NULL_SPEED                  99.0
-#define GSF_NULL_PITCH                  99.0
-#define GSF_NULL_ROLL                   99.0
-#define GSF_NULL_HEAVE                  99.0
-#define GSF_NULL_DRAFT                   0.0
-#define GSF_NULL_DEPTH_CORRECTOR        99.99
-#define GSF_NULL_TIDE_CORRECTOR         99.99
-#define GSF_NULL_SOUND_SPEED_CORRECTION 99.99
-#define GSF_NULL_HORIZONTAL_ERROR       -1.00
-#define GSF_NULL_VERTICAL_ERROR         -1.00
-#define GSF_NULL_HEIGHT               9999.99
-#define GSF_NULL_SEP                  9999.99
-#define GSF_NULL_SEP_UNCERTAINTY         0.0
-
-/* Define null values for the swath bathymetry ping array types. Note that
- * these zero values do not necessarily indicate a non-valid value.  The
- * beam flags array should be used to determine data validity.
- */
-#define GSF_NULL_DEPTH                 0.0
-#define GSF_NULL_ACROSS_TRACK          0.0
-#define GSF_NULL_ALONG_TRACK           0.0
-#define GSF_NULL_TRAVEL_TIME           0.0
-#define GSF_NULL_BEAM_ANGLE            0.0
-#define GSF_NULL_MC_AMPLITUDE          0.0
-#define GSF_NULL_MR_AMPLITUDE          0.0
-#define GSF_NULL_ECHO_WIDTH            0.0
-#define GSF_NULL_QUALITY_FACTOR        0.0
-#define GSF_NULL_RECEIVE_HEAVE         0.0
-#define GSF_NULL_DEPTH_ERROR           0.0
-#define GSF_NULL_ACROSS_TRACK_ERROR    0.0
-#define GSF_NULL_ALONG_TRACK_ERROR     0.0
-#define GSF_NULL_NAV_POS_ERROR         0.0
-
-/* Define macros used to indicate that a certain parameter is not known */
-#define GSF_BEAM_WIDTH_UNKNOWN        -1.0
-
-/* define Posix.4 proposed structure for internal storage of time */
-/* timespec is defined in __MINGW64__ but it appears that they don't set a macro for it.  JCD  */
-#if (!defined (_STRUCT_TIMESPEC_) && !defined (_TIMESPEC_T) && !defined (_STRUCT_TIMESPEC) && !defined (_SYS_TIMESPEC_H) && !defined (__timespec_defined) && !defined (__MINGW64__) && !defined (HAVE_STRUCT_TIMESPEC) && !defined _TIMESPEC_DEFINED)
-#define HAVE_STRUCT_TIMESPEC
-#define _STRUCT_TIMESPEC_
-#define _TIMESPEC_T
-#define _STRUCT_TIMESPEC
-#define _SYS_TIMESPEC_H
-#define __timespec_defined
-#define _TIMESPEC_DEFINED
-/* MAC OSX is a different bird, and while doesn't have the structures defined */
-/* above, does have the timespec structure defined. __APPLE__ will be set when  */
-/* compiled with Apple's gcc on OSX and other third party compilers, so we use it to */
-/* insure the definition below does not conflict. */
- #ifndef __APPLE__
-
-    struct timespec
-    {
-        time_t          tv_sec;
-        long            tv_nsec;
-    };
- #endif
-#endif
-
-/* Define a structure for the gsf header record */
-#define GSF_VERSION_SIZE 12
-typedef struct t_gsfHeader
-{
-    char            version[GSF_VERSION_SIZE];
-}
-gsfHeader;
-
-/* Define the data structure for the swath bathymety summary record */
-typedef struct t_gsfSwathBathySummary
-{
-    struct timespec start_time;
-    struct timespec end_time;
-    double          min_latitude;
-    double          min_longitude;
-    double          max_latitude;
-    double          max_longitude;
-    double          min_depth;
-    double          max_depth;
-}
-gsfSwathBathySummary;
-
-
-/* Define the typeIII specific data structure */
-typedef struct t_gsfTypeIIISpecific               /* 03-30-99 wkm/dbj: Obsolete replaced with t_gsfTypeCmpSassSpecific */
-{
-    unsigned short  leftmost_beam;  /* 0 - leftmost possible beam */
-    unsigned short  rightmost_beam;
-    unsigned short  total_beams;
-    unsigned short  nav_mode;
-    unsigned short  ping_number;
-    unsigned short  mission_number;
-}
-t_gsfTypeIIISpecific;
-
-
-/* Define the CMP (Compressed) SASS specific data structure (from sass.h) */
-typedef struct t_gsfCmpSassSpecific
-{
-    /************************************************************************************
-     *
-     *   Mapping from Compressed SASS (BOSDAT) to GSF record
-     *
-     *    from          to                   comment
-     *    ===============================================================================
-     *
-     *    lntens        ping.heave           mapped only when year is post 1991 or
-     *                                       user has elected to force mapping.
-     *    lfreq         not-mapped
-     *    ldraft        comment              APPLIED_DRAFT comment record
-     *    svp.svel      svp.sound_velocity   at <= 1000 ... FATHOMS
-     *                                       at <= 2500 ... METERS
-     *                                       otherwise  ... FEET
-     *    svp.deptl     svp.depth            (see sound_velocity)
-     *    lmishn        comment              MISSION_NUMBER comment record
-     *    luyr          ping_time            GSF time record from 1960 to 1970 base
-     *    pitchl        ping.pitch
-     *    rolll         ping.roll
-     *    lbear         ping.heading         SASS specific (not Seabeam)
-     *    pinhd         ping.heading         Seabeam specific (not SASS)
-     *    depth         ping.nominal_depth   FATHOMS_TO_METERS_NOMINAL
-     *    pslatl        ping.across_track    YARDS_TO_METERS_EXACT
-     *    bltime        ping.travel_time
-     *    ampl          ping.mr_amplitude
-     *    <ftaf file>   ping.beam_flags      HMPS_FLAGS
-     *    alpos         ping.along_track     SASS specific YARDS_TO_METERS_EXACT
-     *
-     ************************************************************************************/
-
-    double lfreq;  /* sea-surface sound velocity in feet/sec from bosdat(lfreq) */
-    double lntens; /* post 1992 heave, before 1992 unclear what field contained. */
-}
-t_gsfCmpSassSpecific;
-
-/* Define the 16 Beam SeaBeam specific data structure */
-typedef struct t_gsfSeabeamSpecific
-{
-    unsigned short  EclipseTime; /* In 10ths of seconds */
-}
-t_gsfSeaBeamSpecific;
-
-typedef struct t_gsfSBAmpSpecific
-{
-    unsigned char   hour;
-    unsigned char   minute;
-    unsigned char   second;
-    unsigned char   hundredths;
-    unsigned int    block_number;
-    short           avg_gate_depth;
-}
-t_gsfSBAmpSpecific;
-
-/* Define the Seamap specific data structure */
-typedef struct t_gsfSeamapSpecific
-{
-    double          portTransmitter[2];
-    double          stbdTransmitter[2];
-    double          portGain;
-    double          stbdGain;
-    double          portPulseLength;
-    double          stbdPulseLength;
-    double          pressureDepth;
-    double          altitude;
-    double          temperature;
-}
-t_gsfSeamapSpecific;
-
-/* Define the EM950/EM1000 specific data structure */
-typedef struct t_gsfEM950Specific
-{
-    int             ping_number;
-    int             mode;
-    int             ping_quality;
-    double          ship_pitch;
-    double          transducer_pitch;
-    double          surface_velocity;
-}
-t_gsfEM950Specific;
-
-/* Define the EM100 specific data structure */
-typedef struct t_gsfEM100Specific
-{
-    double          ship_pitch;
-    double          transducer_pitch;
-    int             mode;
-    int             power;
-    int             attenuation;
-    int             tvg;
-    int             pulse_length;
-    int             counter;
-}
-t_gsfEM100Specific;
-
-/* Define the EM121A specific data structure */
-typedef struct t_gsfEM121ASpecific
-{
-    int             ping_number;
-    int             mode;
-    int             valid_beams;
-    int             pulse_length;
-    int             beam_width;
-    int             tx_power;
-    int             tx_status;
-    int             rx_status;
-    double          surface_velocity;
-}
-t_gsfEM121ASpecific;
-
-/* Define the Reson SeaBat specific data structure */
-typedef struct t_gsfSeaBatSpecific
-{
-    int             ping_number;
-    double          surface_velocity;
-    int             mode;
-    int             sonar_range;
-    int             transmit_power;
-    int             receive_gain;
-}
-t_gsfSeaBatSpecific;
-
-/* The gsfSeaBatIISpecific data structure is intended to replace the
- * gsfSeaBatSpecific data structure as of GSF_1.04.
- */
-typedef struct t_gsfSeaBatIISpecific
-{
-    int             ping_number;            /* 1 - 32767 */
-    double          surface_velocity;       /* meters/second */
-    int             mode;                   /* bit mapped, see macros below */
-    int             sonar_range;            /* meters */
-    int             transmit_power;
-    int             receive_gain;
-    double          fore_aft_bw;            /* fore/aft beam width in degrees */
-    double          athwart_bw;             /* athwartships beam width in degrees */
-    char            spare[4];               /* Four bytes of spare space, for future use */
-}
-t_gsfSeaBatIISpecific;
-
-/* Macro definitions for the SeaBatSpecific and SeaBatIISpecific mode field */
-#define GSF_SEABAT_WIDE_MODE         0x01   /* if set 10 deg fore-aft */
-#define GSF_SEABAT_9002              0x02   /* if set two sonar heads */
-#define GSF_SEABAT_STBD_HEAD         0x04   /* if set starboard ping (seabat head 2) */
-#define GSF_SEABAT_9003              0x08   /* if set 9003 series sonar (40 beams) */
-
-/* Define the Reson SeaBat specific data structure */
-typedef struct t_gsfSeaBat8101Specific
-{
-    int             ping_number;            /* 1 - 65535 */
-    double          surface_velocity;       /* meters/second */
-    int             mode;                   /* bit mapped, see macros below */
-    int             range;                  /* meters */
-    int             power;                  /* 0-8 + status bits */
-    int             gain;                   /* 1-45 + status bits */
-    int             pulse_width;            /* in microseconds */
-    int             tvg_spreading;          /* tvg spreading coefficient * 4 */
-    int             tvg_absorption;         /* tvg absorption coefficient */
-    double          fore_aft_bw;            /* fore/aft beam width in degrees */
-    double          athwart_bw;             /* athwartships beam width in degrees */
-    double          range_filt_min;         /* range filter, minimum value, meters (future use) */
-    double          range_filt_max;         /* range filter, maximum value, meters (future use) */
-    double          depth_filt_min;         /* depth filter, minimum value, meters (future use) */
-    double          depth_filt_max;         /* depth filter, maximum value, meters (future use) */
-    int             projector;              /* projector type (future use) */
-    char            spare[4];               /* Four bytes of spare space, for future use */
-}
-t_gsfSeaBat8101Specific;
-
-/* Macro definitions for the SeaBat8101Specific and SeaBat8101Specific mode field */
-#define GSF_8101_WIDE_MODE         0x01   /* set if transmit on receiver */
-#define GSF_8101_TWO_HEADS         0x02   /* set if two sonar heads */
-#define GSF_8101_STBD_HEAD         0x04   /* set if starboard ping (seabat head 2) */
-#define GSF_8101_AMPLITUDE         0x08   /* set if beam amplitude is available (RITHETA packet) */
-
-/* Define the Reson SeaBat specific data structure */
-typedef struct t_gsfReson7100Specific
-{
-    unsigned int       protocol_version;                       /* Obtained from the Data Record Frame (DRF) */
-    unsigned int       device_id;                              /* i.e. 7101, 7111, 7125, etc. Obtained from the DRF */
-    unsigned char      reserved_1[16];                         /* Placeholder for growth of fields from DRF */
-    unsigned int       major_serial_number;                    /* high order 4 bytes of sonar serial number, from record 7000 */
-    unsigned int       minor_serial_number;                    /* low order 4 bytes of sonar serial number, from record 7000 */
-    unsigned int       ping_number;                            /* sequential number, unique for each ping, wraps at boundary */
-    unsigned int       multi_ping_seq;                         /* 0 if not in multi-ping mode, otherwise number of pings in a multi-ping sequence */
-    double             frequency;                              /* Sonar operating frequency in Hz. From record 7000 */
-    double             sample_rate;                            /* Sonar system sampling rate in Hz. From record 7000 */
-    double             receiver_bandwdth;                      /* Sonar system signal bandwidth in Hz. From record 7000 */
-    double             tx_pulse_width;                         /* Transmit pulse length in seconds. From record 7000 */
-    unsigned int       tx_pulse_type_id;                       /* 0=CW, 1=Linear chirp, from record 7000 */
-    unsigned int       tx_pulse_envlp_id;                      /* 0=Tapered rectangular, 1=Tukey, from record 7000 */
-    unsigned int       tx_pulse_envlp_param;                   /* four byte field containing envelope parameter, no definition or units available, from record 7000 */
-    unsigned int       tx_pulse_reserved;                      /* four byte field reserved for future growth, from record 7000 */
-    double             max_ping_rate;                          /* Maximum ping rate in pings per second, from record 7000 */
-    double             ping_period;                            /* seconds since last ping, from record 7000 */
-    double             range;                                  /* Sonar range selection in meters, from record 7000 */
-    double             power;                                  /* Power selection in dB re 1 microPa, from record 7000 */
-    double             gain;                                   /* Gain selection in dB, from record 7000 */
-    unsigned int       control_flags;                          /*   0-3: Auto range method
-                                                                    4-7: Auto bottom detect filter method
-                                                                      8: Bottom detect range filter
-                                                                      9: Bottom detect depth filter
-                                                                  10-14: Auto receiver gain method
-                                                                  15-31: Reserved */
-    unsigned int       projector_id;                           /* projector selection, from record 7000 */
-    double             projector_steer_angl_vert;              /* degrees, from record 7000 */
-    double             projector_steer_angl_horz;              /* degrees, from record 7000 */
-    double             projector_beam_wdth_vert;               /* degrees, from record 7000 */
-    double             projector_beam_wdth_horz;               /* degrees, from record 7000 */
-    double             projector_beam_focal_pt;                /* meters, from record 7000 */
-    unsigned int       projector_beam_weighting_window_type;   /* 0-Rectangular, 1-Chebychhev, from record 7000 */
-    unsigned int       projector_beam_weighting_window_param;  /* four byte projector weighting parameter, no definition or units available, from record 7000 */
-    unsigned int       transmit_flags;                         /* 0-3: Pitch stabilization method
-                                                                  4-6: Yaw stabilization method
-                                                                  8-31: Reserved */
-    unsigned int       hydrophone_id;                          /* hydrophone selection, from record 7000 */
-    unsigned int       receiving_beam_weighting_window_type;   /* 0-Chebychev, 1-Kaiser, from record 7000 */
-    unsigned int       receiving_beam_weighting_window_param;  /* four byte receiver weighting parameter, no definition or units available, from record 7000 */
-    unsigned int       receive_flags;                          /*  0-3: Roll stabilization method
-                                                                   4-7: Dynamic focusing method
-                                                                   8-11: Doppler compensation method
-                                                                  12-15: Match filtering method
-                                                                  16-19: TVG method
-                                                                  20-23: Multi-Ping Mode
-                                                                  24-31: Reserved */
-    double             receive_beam_width;                     /* angle in degrees, from record 7000 */
-    double             range_filt_min;                         /* range filter, minimum value, meters, from record 7000 */
-    double             range_filt_max;                         /* range filter, maximum value, meters, from record 7000 */
-    double             depth_filt_min;                         /* depth filter, minimum value, meters, from record 7000 */
-    double             depth_filt_max;                         /* depth filter, maximum value, meters, from record 7000 */
-    double             absorption;                             /* absorption in dB/km, from record 7000 */
-    double             sound_velocity;                         /* sound speed in m/s at transducer, from record 7006 */
-    double             spreading;                              /* spreading loss in dB from record 7000 */
-    char               reserved_2[16];                         /* spare space, for future use */
-    unsigned char      sv_source;                              /* (0: measured, 1: manual), from record 7006 */
-    unsigned char      layer_comp_flag;                        /* (0: off, 1: on), from record 7006 */
-    char               reserved_3[8];                          /* spare space, for future use */
-}
-t_gsfReson7100Specific;
-
-#define GSF_7100_PITCH_STAB             0x0001 /* set if pitch stabilized */
-#define GSF_7100_ROLL_STAB              0x0001 /* set if roll stabilized */
-
-/* Define the SeaBeam 2112/36 specific data structure */
-typedef struct t_gsfSeaBeam2112Specific
-{
-    int             mode;                       /* bit mapped, see macros below */
-    double          surface_velocity;           /* meters/second */
-    char            ssv_source;                 /* (V)elocimiter, (M)anual, (T)emperature,
-                                                   (E)xternal, or (U)nknown */
-    int             ping_gain;                  /* dB */
-    int             pulse_width;                /* in milliseconds */
-    int             transmitter_attenuation;    /* dB */
-    int             number_algorithms;          /* algorithms per beam (1-4) */
-    char            algorithm_order[5];         /* null terminated string, each char will be either
-                                                   a space, W(MT), or B(DI). if number_algorithms
-                                                   equals one, this will be four spaces */
-    char            spare[2];                   /* Two bytes of spare space, for future use */
-}
-t_gsfSeaBeam2112Specific;
-
-/* Macro definitions for the SeaBeam2112Specific mode field */
-#define GSF_2112_SVP_CORRECTION   0x01    /* set if true depth, true position corrections are used */
-#define GSF_2112_LOW_FREQUENCY    0x02    /* set if using 12kHz frequecy - 36kHz if not set */
-#define GSF_2112_AUTO_DEPTH_GATE  0x04    /* set if depth gate mode is automatic - manual if not set */
-
-/* SeaBeam 2112 specific macro definitions for the quality factor array */
-#define GSF_2112_POOR_QUALITY     0x01    /* set if the beam was flagged by the SeaBeam as poor quality */
-#define GSF_2112_DATA_SOURCE_WMT  0x10    /* set if the data source is WMT - source is BDI if not set */
-
-/* Define the Elac MkII specific data structure */
-typedef struct t_gsfElacMkIISpecific
-{
-    int             mode;                       /* bit mapped, see macros below */
-    int             ping_num;
-    int             sound_vel;                  /* 0.1 m/s */
-    int             pulse_length;               /* 0.01 ms */
-    int             receiver_gain_stbd;         /* db */
-    int             receiver_gain_port;         /* db */
-    int             reserved;
-}
-t_gsfElacMkIISpecific;
-
-/* Macro definitions for the ElacMkIISpecific mode field */
-#define GSF_MKII_LOW_FREQUENCY    0x01    /* set if using 12kHz frequecy - 36kHz if not set */
-#define GSF_MKII_SOURCE_MODE      0x02    /* set if RDT transmit used, otherwise omni */
-#define GSF_MKII_SOURCE_POWER     0x04    /* set if transmit high power - low power if not set */
-#define GSF_MKII_STBD_HEAD        0x08    /* set if starboard ping */
-
-/* Define a data structure to hold the Simrad EM3000 series run time parameters. */
-typedef struct t_gsfEM3RunTime
-{
-    int             model_number;               /* from the run-time parameter datagram */
-    struct timespec dg_time;                    /* from the run-time parameter datagram */
-    int             ping_number;                /* sequential counter 0 - 65535 */
-    int             serial_number;              /* The sonar head serial number */
-    int             system_status;              /* normally = 0 */
-    int             mode;                       /* 0=nearfield, 1=normal, 2=target, 3=deep, 4=very deep */
-    int             filter_id;
-    double          min_depth;                  /* meters */
-    double          max_depth;                  /* meters */
-    double          absorption;                 /* dB/km */
-    double          pulse_length;               /* micro seconds */
-    double          transmit_beam_width;        /* degrees */
-    int             power_reduction;            /* dB */
-    double          receive_beam_width;         /* degrees */
-    int             receive_bandwidth;          /* Hz */
-    int             receive_gain;               /* dB */
-    int             cross_over_angle;           /* degrees */
-    int             ssv_source;                 /* 0=sensor, 1=manual, 2=profile */
-    int             swath_width;                /* total swath width in meters */
-    int             beam_spacing;               /* 0=beamwidth, 1=equiangle, 2=equidistant, 3=intermediate */
-    int             coverage_sector;            /* total coverage in degrees */
-    int             stabilization;
-    int             port_swath_width;           /* maximum port swath width in meters */
-    int             stbd_swath_width;           /* maximum starboard swath width in meters */
-    int             port_coverage_sector;       /* maximum port coverage in degrees */
-    int             stbd_coverage_sector;       /* maximum starboard coverage in degrees */
-    int             hilo_freq_absorp_ratio;
-    int             spare1;                     /* four spare bytes */
-}
-gsfEM3RunTime;
-
-/* Define the Simrad EM3000 series specific data structure */
-typedef struct t_gsfEM3Specific
-{
-    /* The first nine values are updated with each depth datagram */
-    int             model_number;               /* ie: 3000, ... */
-    int             ping_number;                /* 0 - 65535 */
-    int             serial_number;              /* 100 - 65535 */
-    double          surface_velocity;           /* in m/s */
-    double          transducer_depth;           /* transmit transducer depth in meters */
-    int             valid_beams;                /* number of valid beams for this ping */
-    int             sample_rate;                /* in Hz */
-    double          depth_difference;           /* in meters between sonar heads in em3000d configuration */
-    int             offset_multiplier;          /* transducer depth offset multiplier */
-    /* The gsfEM3RunTime data structure is updated with each run-time parameter datagram */
-    gsfEM3RunTime   run_time[2];                /* A two element array is needed to support em3000d */
-}
-t_gsfEM3Specific;
-
-/* Define the Reson 8100 specific data structure */
-typedef struct t_gsfReson8100Specific
-{
-    int             latency;                /* time from ping to output (milliseconds) */
-    int             ping_number;            /* 4 byte ping number */
-    int             sonar_id;               /* least significant 4 bytes of ethernet address */
-    int             sonar_model;            /*  */
-    int             frequency;              /* KHz */
-    double          surface_velocity;       /* meters/second */
-    int             sample_rate;            /* A/D samples per second */
-    int             ping_rate;              /* pings per second * 1000 */
-    int             mode;                   /* bit mapped, see macros below */
-    int             range;                  /* meters */
-    int             power;                  /* 0-8 + status bits */
-    int             gain;                   /* 1-45 + status bits */
-    int             pulse_width;            /* in microseconds */
-    int             tvg_spreading;          /* tvg spreading coefficient * 4 */
-    int             tvg_absorption;         /* tvg absorption coefficient */
-    double          fore_aft_bw;            /* fore/aft beam width in degrees */
-    double          athwart_bw;             /* athwartships beam width in degrees */
-    int             projector_type;         /* projector type */
-    int             projector_angle;        /* projector pitch steering angle (degrees * 100) */
-    double          range_filt_min;         /* range filter, minimum value, meters */
-    double          range_filt_max;         /* range filter, maximum value, meters */
-    double          depth_filt_min;         /* depth filter, minimum value, meters */
-    double          depth_filt_max;         /* depth filter, maximum value, meters */
-    int             filters_active;         /* bit 0 - range filter, bit 1 - depth filter */
-    int             temperature;            /* temperature at sonar head (deg C * 10) */
-    double          beam_spacing;           /* across track receive beam angular spacing */
-    char            spare[2];               /* Two remaining bytes of spare space, for future use */
-}
-t_gsfReson8100Specific;
-
-/* Macro definitions for the SeaBat8100Specific mode field */
-#define GSF_8100_WIDE_MODE              0x01 /* set if transmit on receiver */
-#define GSF_8100_TWO_HEADS              0x02 /* set if two sonar heads */
-#define GSF_8100_STBD_HEAD              0x04 /* set if starboard ping (seabat head 2) */
-#define GSF_8100_AMPLITUDE              0x08 /* set if beam amplitude is available (RITHETA packet) */
-#define GSF_8100_PITCH_STAB             0x10 /* set if pitch stabilized */
-#define GSF_8100_ROLL_STAB              0x20 /* set if roll stabilized */
-
-/* Define the Echotrac Single-Beam sensor specific data structure. */
-
-#define GSF_SB_MPP_SOURCE_UNKNOWN       0x00 /* Unknown MPP source */
-#define GSF_SB_MPP_SOURCE_GPS_3S        0x01 /* GPS 3S */
-#define GSF_SB_MPP_SOURCE_GPS_TASMAN    0x02 /* GPS Tasman */
-#define GSF_SB_MPP_SOURCE_DGPS_TRIMBLE  0x03 /* DGPS Trimble */
-#define GSF_SB_MPP_SOURCE_DGPS_TASMAN   0x04 /* DGPS Tasman */
-#define GSF_SB_MPP_SOURCE_DGPS_MAG      0x05 /* DGPS MagMPPox */
-#define GSF_SB_MPP_SOURCE_RANGE_MFIX    0x06 /* Range/Azimauth - Microfix */
-#define GSF_SB_MPP_SOURCE_RANGE_TRIS    0x07 /* Range/Azimauth - Trisponder */
-#define GSF_SB_MPP_SOURCE_RANGE_OTHER   0x08 /* Range/Azimauth - Other */
-
-typedef struct t_gsfSBEchotracSpecific
-{
-    int             navigation_error;
-    unsigned short  mpp_source;     /* Flag To determine mpp source - See above */
-    unsigned short  tide_source;    /* in GSF Version 2.02+ this is in ping flags */
-    double          dynamic_draft;  /* speed induced draft im meters */
-    char            spare[4];       /* four bytes of reserved space */
-
-}
-t_gsfSBEchotracSpecific;
-
-/* Define the MGD77 Single-Beam sensor specific data structure. */
-typedef struct t_gsfSBMGD77Specific
-{
-    unsigned short  time_zone_corr;
-    unsigned short  position_type_code;
-    unsigned short  correction_code;
-    unsigned short  bathy_type_code;
-    unsigned short  quality_code;
-    double          travel_time;
-    char            spare[4];                  /* four bytes of reserved space */
-}
-t_gsfSBMGD77Specific;
-
-/* Define the BDB sensor specific data structure */
-typedef struct t_gsfSBBDBSpecific
-{
-    int   doc_no;         /* Document number (5 digits) */
-    char  eval;           /* Evaluation (1-best, 4-worst) */
-    char  classification; /* Classification ((U)nclass, (C)onfidential,
-                                             (S)ecret, (P)roprietary/Unclass,
-                                             (Q)Proprietary/Class) */
-    char  track_adj_flag; /* Track Adjustment Flag (Y,N) */
-    char  source_flag;    /* Source Flag ((S)urvey, (R)andom, (O)cean Survey) */
-    char  pt_or_track_ln; /* Discrete Point (D) or Track Line (T) Flag */
-    char  datum_flag;     /* Datum Flag ((W)GS84, (D)atumless) */
-    char  spare[4];       /* four bytes of reserved space */
-}
-t_gsfSBBDBSpecific;
-
-/* Define the NOS HDB sensor specific data structure */
-typedef struct t_gsfSBNOSHDBSpecific
-{
-    unsigned short  type_code;    /*  Depth type code  */
-    unsigned short  carto_code;   /*  Cartographic code  */
-    char            spare[4];     /* four bytes of reserved space */
-}
-t_gsfSBNOSHDBSpecific;
-
-/* Define the Navisound sensor specific data structure */
-typedef struct t_gsfSBNavisoundSpecific
-{
-    double          pulse_length;    /*  pulse length in cm  */
-    char            spare[8];     /* eight bytes of reserved space */
-}
-t_gsfSBNavisoundSpecific;
-
-/* Macro definitions for EM4 series sector data details */
-#define  GSF_MAX_EM4_SECTORS     9
-#define  GSF_MAX_EM3_SECTORS     20
-
-/* Define sub-structure for the transmit sectors */
-#define  GSF_EM_WAVEFORM_CW      0
-#define  GSF_EM_WAVEFORM_FM_UP   1
-#define  GSF_EM_WAVEFORM_FM_DOWN 2
-
-typedef struct t_gsfEM4TxSector
-{
-    double          tilt_angle;                     /* transmitter tilt angle in degrees */
-    double          focus_range;                    /* focusing range, 0.0 for no focusing */
-    double          signal_length;                  /* transmit signal duration in seconds */
-    double          transmit_delay;                 /* Sector transmit delay from first transmission in seconds */
-    double          center_frequency;               /* center frequency in Hz */
-    double          mean_absorption;                /* mean absorption coefficient in 0.01 dB/kilometer */
-    int             waveform_id;                    /* signal waveform ID 0=CW; 1=FM upsweep; 2=FM downsweep */
-    int             sector_number;                  /* transmit sector number */
-    double          signal_bandwidth;               /* signal bandwidth in Hz */
-    unsigned char   spare[16];                      /* spare space */
-}
-t_gsfEM4TxSector;
-
-typedef struct t_gsfEM3RawTxSector
-{
-    double          tilt_angle;                     /* transmitter tilt angle in degrees */
-    double          focus_range;                    /* focusing range, 0.0 for no focusing */
-    double          signal_length;                  /* transmit signal duration in seconds */
-    double          transmit_delay;                 /* Sector transmit delay from first transmission in seconds */
-    double          center_frequency;               /* center frequency in Hz */
-    int             waveform_id;                    /* signal waveform ID 0=CW; 1=FM upsweep; 2=FM downsweep */
-    int             sector_number;                  /* transmit sector number */
-    double          signal_bandwidth;               /* signal bandwidth in Hz */
-    unsigned char   spare[16];                      /* spare space */
-}
-t_gsfEM3RawTxSector;
-
-/* The following macro definitions are to aid in interpretation of the sonar mode field */
-#define GSF_EM_MODE_VERY_SHALLOW 0x00               /* Bits 2,1,0 cleared means very shallow mode */
-#define GSF_EM_MODE_SHALLOW      0x01               /* Bit zero set means shallow mode */
-#define GSF_EM_MODE_MEDIUM       0x02               /* Bit one set means medium mode */
-#define GSF_EM_MODE_DEEP         0x03               /* Bits one and zero set means deep mode */
-#define GSF_EM_MODE_VERY_DEEP    0x04               /* Bit two set means very deep mode */
-#define GSF_EM_MODE_EXTRA_DEEP   0x05               /* Bits two and one set means extra deep mode */
-#define GSF_EM_MODE_MASK         0x07               /* Mask off bits 2,1,0 to determine just the mode */
-                                                    /* Exact definition of bits 5,4,3 not clear from document rev J. */
-#define GSF_EM_MODE_DS_OFF       0xC0               /* bits 7 and 6 cleared means dual swath off */
-#define GSF_EM_MODE_DS_FIXED     0x40               /* bit 6 set means dual swath in fixed mode */
-#define GSF_EM_MODE_DS_DYNAMIC   0x80               /* bit 7 set means dual swath in dynamic mode */
-
-/* Define a data structure to hold the Simrad EM series run time parameters per datagram document rev I. */
-typedef struct t_gsfEMRunTime
-{
-    int              model_number;                  /* from the run-time parameter datagram */
-    struct timespec  dg_time;                       /* from the run-time parameter datagram */
-    int              ping_counter;                  /* sequential counter 0 - 65535 */
-    int              serial_number;                 /* The primary sonar head serial number */
-    unsigned char    operator_station_status;       /* Bit mask of status information for operator station */
-    unsigned char    processing_unit_status;        /* Bit mask of status information for sonar processor unit */
-    unsigned char    bsp_status;                    /* Bit mask of status information for BSP status */
-    unsigned char    head_transceiver_status;       /* Bit mask of status information for sonar head or sonar transceiver */
-    unsigned char    mode;                          /* Bit mask of sonar operating information, see mode bit mask definitions */
-    unsigned char    filter_id;                     /* one byte tit mask for various sonar processing filter settings */
-    double           min_depth;                     /* meters */
-    double           max_depth;                     /* meters */
-    double           absorption;                    /* dB/km */
-    double           tx_pulse_length;               /* in micro seconds */
-    double           tx_beam_width;                 /* degrees */
-    double           tx_power_re_max;               /* The transmit power referenced to maximum power in dB */
-    double           rx_beam_width;                 /* degrees */
-    double           rx_bandwidth;                  /* Hz */
-    double           rx_fixed_gain;                 /* dB */
-    double           tvg_cross_over_angle;          /* degrees */
-    unsigned char    ssv_source;                    /* one byte bit mask defining SSSV source -> 0=sensor, 1=manual, 2=profile */
-    int              max_port_swath_width;          /* total swath width to port side in meters */
-    unsigned char    beam_spacing;                  /* one byte bit mask -> 0=beamwidth, 1=equiangle, 2=equidistant, 3=intermediate */
-    int              max_port_coverage;             /* coverage to port side in degrees */
-    unsigned char    stabilization;                 /* one byte bit mask defining yaw and pitch stabilization mode */
-    int              max_stbd_coverage;             /* coverage to starboard side in degrees */
-    int              max_stbd_swath_width;          /* total swath width to starboard side in meters */
-    double           durotong_speed;                /* Sound speed in Durotong (SSD). Field only valid for the EM 1002 */
-    double           hi_low_absorption_ratio;       /* HiLo frequency absorption coefficient ratio, field valid only for EM3 sonars */
-    double           tx_along_tilt;                 /* Transmit fan along track tilt angle in degrees, field valid only for EM4 sonars */
-    unsigned char    filter_id_2;                   /* two lowest order bits define the penetration filter setting: off, weak, medium, or strong */
-    unsigned char    spare[16];                     /* 16 spare bytes */
-}
-t_gsfEMRunTime;
-
-/* Macro definitions for bits of pu_status field */
-#define GSF_EM_VALID_1_PPS      0x0001              /* If set, then 1 PPS timing is valid */
-#define GSF_EM_VALID_POSITION   0x0002              /* If set, then position input is valid */
-#define GSF_EM_VALID_ATTITUDE   0x0004              /* If set, then attitude input is valid */
-#define GSF_EM_VALID_CLOCK      0x0008              /* If set, then clock status is valid */
-#define GSF_EM_VALID_HEADING    0x0010              /* If set, then heading status is valid */
-#define GSF_EM_PU_ACTIVE        0x0020              /* If set, then PU is active (i.e. pinging) */
-
-/* Define a data structure to hold the Simrad EM series PU status values per datagram document rev I. */
-typedef struct t_gsfEMPUStatus
-{
-    double           pu_cpu_load;                   /* Percent CPU load in the processor unit */
-    unsigned short   sensor_status;                 /* Bit mask containing status of sensor inputs */
-    int              achieved_port_coverage;        /* Achieved coverage to port in degrees */
-    int              achieved_stbd_coverage;        /* Achieved coverage to starboard in degrees */
-    double           yaw_stabilization;             /* in degrees */
-    unsigned char    spare[16];
-}
-t_gsfEMPUStatus;
-
-/* Define sensor specific data structures for the Kongsberg 710/302/122 */
-typedef struct t_gsfEM4Specific
-{
-    /* values from the XYZ datagram and raw range datagram */
-    int              model_number;                  /* 122, or 302, or 710, or ... */
-    int              ping_counter;                  /* Sequential ping counter, 1 through 65535 */
-    int              serial_number;                 /* System unique serial number, 100 - ? */
-    double           surface_velocity;              /* Measured sound speed near the surface in m/s */
-    double           transducer_depth;              /* The transmit transducer depth in meters re water level at ping time */
-    int              valid_detections;              /* number of beams with a valid bottom detection for this ping */
-    double           sampling_frequency;            /* The system digitizing rate in Hz */
-    unsigned int     doppler_corr_scale;            /* Scale factor value to be applied to Doppler correction field prior to applying corrections */
-    double           vehicle_depth;                 /* From 0x66 datagram, non-zero when sonar head is mounted on a sub-sea platform */
-    unsigned char    spare_1[16];
-    int              transmit_sectors;              /* The number of transmit sectors for this ping */
-    t_gsfEM4TxSector sector[GSF_MAX_EM4_SECTORS];   /* Array of structures with transmit sector information */
-    unsigned char    spare_2[16];
-
-    /* Values from the run-time parameters datagram */
-    t_gsfEMRunTime   run_time;
-
-    /* Values from the PU status datagram */
-    t_gsfEMPUStatus  pu_status;
-}
-t_gsfEM4Specific;
-
-/* Define sensor specific data structures for the Kongsberg 3000, etc which use raw range and beam angle */
-typedef struct t_gsfEM3RawSpecific
-{
-    /* values from the XYZ datagram and raw range datagram */
-    int              model_number;                  /* ie 3000 ... */
-    int              ping_counter;                  /* Sequential ping counter, 0 through 65535 */
-    int              serial_number;                 /* System unique serial number, 100 - ? */
-    double           surface_velocity;              /* Measured sound speed near the surface in m/s */
-    double           transducer_depth;              /* The transmit transducer depth in meters re water level at ping time */
-    int              valid_detections;              /* number of beams with a valid bottom detection for this ping */
-    double           sampling_frequency;            /* The system digitizing rate in Hz */
-    double           vehicle_depth;                 /* vechicle depth in 0.01 m */
-    double           depth_difference;              /* in meters between sonar heads in em3000d configuration */
-    int              offset_multiplier;             /* transducer depth offset multiplier */
-    unsigned char    spare_1[16];
-    int              transmit_sectors;              /* The number of transmit sectors for this ping */
-    t_gsfEM3RawTxSector sector[GSF_MAX_EM3_SECTORS];   /* Array of structures with transmit sector information */
-    unsigned char    spare_2[16];
-
-    /* Values from the run-time parameters datagram */
-    t_gsfEMRunTime   run_time;
-
-    /* Values from the PU status datagram */
-    t_gsfEMPUStatus  pu_status;
-}
-t_gsfEM3RawSpecific;
-
-/*DHG 2006/09/27 Added support for GeoSwath interferometric 250 Khz sonar */
-/* Define the GeoSwath sensor specific data structure */
-typedef struct t_gsfGeoSwathPlusSpecific
-{
-    int             data_source;             /* 0 = CBF, 1 = RDF */
-    int             side;                    /* 0 = port, 1 = stbd */
-    int             model_number;            /* ie: 100, 250, 500, ... */
-    double          frequency;               /* Hz */
-    int             echosounder_type;        /* ? */
-    long            ping_number;             /* 0 - 4,294,967,295 */
-    int             num_nav_samples;         /* number of navigation samples in this ping */
-    int             num_attitude_samples;    /* number of attitude samples in this ping */
-    int             num_heading_samples;     /* number of heading samples in this ping */
-    int             num_miniSVS_samples;     /* number of miniSVS samples in this ping */
-    int             num_echosounder_samples; /* number of echosounder samples in ping */
-    int             num_raa_samples;         /* number of RAA (Range/Angle/Amplitude) samples in ping */
-    double          mean_sv;                 /* meters per second */
-    double          surface_velocity;        /* in m/s */
-    int             valid_beams;             /* number of valid beams for this ping */
-    double          sample_rate;             /* Hz */
-    double          pulse_length;            /* micro seconds */
-    int             ping_length;             /* meters */
-    int             transmit_power;          /* ? */
-    int             sidescan_gain_channel;   /* RDF documentation = 0 - 3  */
-    int             stabilization;           /* 0 or 1 */
-    int             gps_quality;             /* ? */
-    double          range_uncertainty;       /* meters */
-    double          angle_uncertainty;       /* degrees */
-    char            spare[32];               /* 32 bytes of reserved space */
-}
-t_gsfGeoSwathPlusSpecific;
-
-#define PORT_PING 0
-#define STBD_PING 1
-
-#define GSF_GEOSWATH_PLUS_PORT_PING PORT_PING
-#define GSF_GEOSWATH_PLUS_STBD_PING STBD_PING
-
-/* Define the Klein 5410 Bathy Sidescan sensor specific data structure */
-typedef struct t_gsfKlein5410BssSpecific
-{
-    int             data_source;             /* 0 = SDF */
-    int             side;                    /* 0 = port, 1 = stbd */
-    int             model_number;            /* ie: 5410 */
-    double          acoustic_frequency;      /* system frequency in Hz */
-    double          sampling_frequency;      /* sampling frequency in Hz */
-    unsigned int    ping_number;             /* 0 - 4,294,967,295 */
-    unsigned int    num_samples;             /* total number of samples in this ping */
-    unsigned int    num_raa_samples;         /* number of valid range, angle, amplitude samples in ping */
-    unsigned int    error_flags;             /* error flags for this ping */
-    unsigned int    range;                   /* sonar range setting */
-    double          fish_depth;              /* reading from the towfish pressure sensor in Volts */
-    double          fish_altitude;           /* towfish altitude in m */
-    double          sound_speed;             /* speed of sound at the transducer face in m/sec */
-    int             tx_waveform;             /* transmit pulse: 0 = 132 microsec CW; 1 = 132 microsec FM; */
-                                             /* 2 = 176 microsec CW; 3 = 176 microsec FM */
-    int             altimeter;               /* altimeter status: 0 = passive, 1 = active */
-    unsigned int    raw_data_config;         /* raw data configuration */
-    char            spare[32];               /* 32 bytes of reserved space */
-}
-t_gsfKlein5410BssSpecific;
-
-/* Define the Imagenex Delta T sensor specific data structure */
-typedef struct t_gsfDeltaTSpecific
-{
-    char            decode_file_type[4];     /* contains the decoded files extension. */
-    char            version;                 /* contains the minor version number of the delta t */
-    int             ping_byte_size;          /* size in bytes of this ping (256 + ((((byte 117[1 or 0])*2) + 2) * number of beams)) */
-    struct timespec interrogation_time;      /* The sonar interrogation time */
-    int             samples_per_beam;        /* number of samples per beam */
-    double          sector_size;             /* size of the sector in degrees */
-    double          start_angle;             /* the angle that beam 0 starts at in degrees. */
-    double          angle_increment;         /* the number of degrees the angle increments per beam */
-    int             acoustic_range;          /* acoustic range in meters */
-    int             acoustic_frequency;      /* acoustic frequency in kHz */
-    double          sound_velocity;          /* the velocity of sound at the transducer face in m/s */
-    double          range_resolution;        /* range resolution in centimeters (documentation says mm but all example data is in cm) */
-    double          profile_tilt_angle;      /* the mounting offset */
-    double          repetition_rate;         /* time between pings in milliseconds */
-    unsigned long   ping_number;             /* the current ping number of this ping.  */
-    unsigned char   intensity_flag;          /* this tells whether the GSF will have intensity data (1=true) */
-    double          ping_latency;            /* time from sonar ping interrogation to actual ping in seconds */
-    double          data_latency;            /* time from sonar ping interrogation to 83P UDP datagram in seconds */
-    unsigned char   sample_rate_flag;        /* sampling rate 0 = (1 in 500); 1 = (1 in 5000) */
-    unsigned char   option_flags;            /* this flag states whether the data is roll corrected or raybend corrected (1 = roll, 2 = raybend, 3 = both) */
-    int             num_pings_avg;           /* number of pings averaged 1 - 25 */
-    double          center_ping_time_offset; /* the time difference in seconds between the center ping interrogation and the current ping interrogation */
-    unsigned char   user_defined_byte;       /* contains a user defined byte */
-    double          altitude;                /* the height of the fish above the ocean floor.  */
-    char            external_sensor_flags;   /* this flag is a bit mask where (1 = external heading, 2 = external roll, 4 = external pitch, 8 = external heave) */
-    double          pulse_length;            /* acoustic pulse length in seconds */
-    double          fore_aft_beamwidth;      /* Effective f/a beam width in degrees */
-    double          athwartships_beamwidth;  /* Effective athwartships beam width in degrees */
-    unsigned char   spare[32];               /* room to grow */
-}
-t_gsfDeltaTSpecific;
-
-/* Define sensor specific data structures for the EM12 */
-typedef struct t_gsfEM12Specific
-{
-    int              ping_number;          /* 0 to 65535 */
-    int              resolution;           /* 1 = high, 2 = low */
-    int              ping_quality;         /* 21 to 81; number of beams with accepted bottom detections */
-    double           sound_velocity;       /* m/s */
-    int              mode;                 /* 1 to 8; shallow, deep, type of beam spacing */
-    unsigned char    spare[32];            /* room to grow */
-} t_gsfEM12Specific;
-
-/* Define the R2Sonic sensor specific data structure */
-typedef struct t_gsfR2SonicSpecific
-{
-    unsigned char   model_number[12];   /* Model number, e.g. "2024".  Unused chars are nulls */
-    unsigned char   serial_number[12];  /* Serial number, e.g. "100017".  Unused chars are nulls */
-    struct timespec dg_time;            /* Ping time, re 00:00:00, Jan 1, 1970 ("Unix time") */
-    unsigned int    ping_number;        /* Sequential ping counter relative to power up or reboot */
-    double          ping_period;        /* Time interval between two most recent pings, seconds */
-    double          sound_speed;        /* Sound speed at transducer face, m/s */
-    double          frequency;          /* Sonar center frequency (Hz) */
-    double          tx_power;           /* TX source level, dB re 1uPa at 1 meter */
-    double          tx_pulse_width;     /* pulse width, seconds */
-    double          tx_beamwidth_vert;  /* fore-aft beamwidth, degrees */
-    double          tx_beamwidth_horiz; /* athwartship beamwidth, degrees */
-    double          tx_steering_vert;   /* fore-aft beam steering angle, degrees */
-    double          tx_steering_horiz;  /* athwartship beam steering angle, degrees */
-    unsigned int    tx_misc_info;       /* reserved for future use */
-    double          rx_bandwidth;       /* receiver bandwidth, Hz */
-    double          rx_sample_rate;     /* receiver sample rate, Hz */
-    double          rx_range;           /* receiver range setting, seconds in docs but I think it's meters  */
-    double          rx_gain;            /* receiver gain setting, 2dB increments between steps */
-    double          rx_spreading;       /* TVG spreading law coefficient, e.g. 20log10(range) */
-    double          rx_absorption;      /* TVG absorption coefficient, dB/km */
-    double          rx_mount_tilt;      /* degrees */
-    unsigned int    rx_misc_info;       /* reserved for future use */
-    unsigned short  reserved;           /* reserved for future use */
-    unsigned short  num_beams;          /* number of beams in this ping */
-
-    /* These fields are from the BTH0 packet only */
-    double          A0_more_info[6];     /* Additional fields associated with equi-angular mode; first element of array is roll  */
-    double          A2_more_info[6];     /* Additional fields associated with equi-distant mode; first element of array is roll */
-    double          G0_depth_gate_min;   /* global minimum gate in seconds (twtt) */
-    double          G0_depth_gate_max;   /* global maximum gate in seconds (twtt) */
-    double          G0_depth_gate_slope; /* slope of depth gate, degrees */
-    unsigned char   spare[32];           /* saved for future expansion */
-}
-t_gsfR2SonicSpecific;
-
-/* Define a union of the known sensor specific ping subrecords */
-typedef union t_gsfSensorSpecific
-{
-    t_gsfSeaBeamSpecific      gsfSeaBeamSpecific;
-    t_gsfEM100Specific        gsfEM100Specific;
-    t_gsfEM121ASpecific       gsfEM121ASpecific;
-    t_gsfEM121ASpecific       gsfEM121Specific;
-    t_gsfSeaBatSpecific       gsfSeaBatSpecific;
-    t_gsfEM950Specific        gsfEM950Specific;
-    t_gsfEM950Specific        gsfEM1000Specific;
-    t_gsfSeamapSpecific       gsfSeamapSpecific;
-
-    #if 1
-    /* 03-30-99 wkm/dbj: Obsolete replaced with gsfCmpSassSpecific */
-    t_gsfTypeIIISpecific      gsfTypeIIISeaBeamSpecific;
-    t_gsfTypeIIISpecific      gsfSASSSpecific;
-    #endif
-
-    t_gsfCmpSassSpecific      gsfCmpSassSpecific;
-
-    t_gsfSBAmpSpecific        gsfSBAmpSpecific;
-    t_gsfSeaBatIISpecific     gsfSeaBatIISpecific;
-    t_gsfSeaBat8101Specific   gsfSeaBat8101Specific;
-    t_gsfSeaBeam2112Specific  gsfSeaBeam2112Specific;
-    t_gsfElacMkIISpecific     gsfElacMkIISpecific;
-    t_gsfEM3Specific          gsfEM3Specific;          /* used for EM120, EM300, EM1002, EM3000, EM3002, and EM121A_SIS */
-    t_gsfEM3RawSpecific       gsfEM3RawSpecific;       /* used for EM120, EM300, EM1002, EM3000, EM3002, and EM121A_SIS with raw range and beam angle */
-    t_gsfReson8100Specific    gsfReson8100Specific;
-    t_gsfReson7100Specific    gsfReson7100Specific;
-    t_gsfEM4Specific          gsfEM4Specific;          /* used for EM710, EM302, EM122, and EM2040 */
-    t_gsfGeoSwathPlusSpecific gsfGeoSwathPlusSpecific; /* DHG 2006/09/27 Use for GeoSwath+ interferometer */
-    t_gsfKlein5410BssSpecific gsfKlein5410BssSpecific; /* Use for Klein 5410 Bathy Sidescan. */
-    t_gsfDeltaTSpecific       gsfDeltaTSpecific;
-    t_gsfEM12Specific         gsfEM12Specific;
-    t_gsfR2SonicSpecific      gsfR2SonicSpecific;
-
-        /* Single beam sensors added */
-    t_gsfSBEchotracSpecific   gsfSBEchotracSpecific;
-    t_gsfSBEchotracSpecific   gsfSBBathy2000Specific;
-    t_gsfSBMGD77Specific      gsfSBMGD77Specific;
-    t_gsfSBBDBSpecific        gsfSBBDBSpecific;
-    t_gsfSBNOSHDBSpecific     gsfSBNOSHDBSpecific;
-    t_gsfSBEchotracSpecific   gsfSBPDDSpecific;
-    t_gsfSBNavisoundSpecific  gsfSBNavisoundSpecific;
-} gsfSensorSpecific;
-
-/* Define the Echotrac Single-Beam sensor specific data structure. */
-typedef struct t_gsfEchotracSpecific
-{
-    int             navigation_error;
-    unsigned short  mpp_source; /* Flag To determine if nav was mpp */
-    unsigned short  tide_source;
-}
-t_gsfEchotracSpecific;
-
-/* Define the MGD77 Single-Beam sensor specific data structure. */
-typedef struct t_gsfMGD77Specific
-{
-    unsigned short  time_zone_corr;
-    unsigned short  position_type_code;
-    unsigned short  correction_code;
-    unsigned short  bathy_type_code;
-    unsigned short  quality_code;
-    double travel_time;
-}
-t_gsfMGD77Specific;
-
-/* Define the BDB sensor specific data structure */
-typedef struct t_gsfBDBSpecific
-{
-    int   doc_no;         /* Document number (5 digits) */
-    char  eval;           /* Evaluation (1-best, 4-worst) */
-    char  classification; /* Classification ((U)nclass, (C)onfidential,
-                                             (S)ecret, (P)roprietary/Unclass,
-                                             (Q)Proprietary/Class) */
-    char  track_adj_flag; /* Track Adjustment Flag (Y,N) */
-    char  source_flag;    /* Source Flag ((S)urvey, (R)andom, (O)cean Survey) */
-    char  pt_or_track_ln; /* Discrete Point (D) or Track Line (T) Flag */
-    char  datum_flag;     /* Datum Flag ((W)GS84, (D)atumless) */
-}
-t_gsfBDBSpecific;
-
-/* Define the NOS HDB sensor specific data structure */
-typedef struct t_gsfNOSHDBSpecific
-{
-   unsigned short  type_code;    /*  Depth type code  */
-   unsigned short  carto_code;   /*  Cartographic code  */
-}
-t_gsfNOSHDBSpecific;
-
-/* Define a union of the known sensor specific
- * single beam ping subrecords
- */
-typedef union t_gsfSBSensorSpecific
-{
-    t_gsfEchotracSpecific    gsfEchotracSpecific;
-    t_gsfEchotracSpecific    gsfBathy2000Specific;
-    t_gsfMGD77Specific       gsfMGD77Specific;
-    t_gsfBDBSpecific         gsfBDBSpecific;
-    t_gsfNOSHDBSpecific      gsfNOSHDBSpecific;
-} gsfSBSensorSpecific;
-
-/* Define the bit flags for the "ping_flags" field of the swath bathymetry
- *  ping record.
- * GSF_IGNORE_PING may be set to indicate to an application to ignore this ping
- * GSF_PING_USER_FLAGS 01-15 may be set/read by application specific software
- */
-#define GSF_IGNORE_PING       0x0001u
-#define GSF_PING_USER_FLAG_01 0x0002u
-#define GSF_PING_USER_FLAG_02 0x0004u
-#define GSF_PING_USER_FLAG_03 0x0008u
-#define GSF_PING_USER_FLAG_04 0x0010u
-#define GSF_PING_USER_FLAG_05 0x0020u
-#define GSF_PING_USER_FLAG_06 0x0040u
-#define GSF_PING_USER_FLAG_07 0x0080u
-#define GSF_PING_USER_FLAG_08 0x0100u
-#define GSF_PING_USER_FLAG_09 0x0200u
-#define GSF_PING_USER_FLAG_10 0x0400u
-#define GSF_PING_USER_FLAG_11 0x0800u
-#define GSF_PING_USER_FLAG_12 0x1000u
-#define GSF_PING_USER_FLAG_13 0x2000u
-#define GSF_PING_USER_FLAG_14 0x4000u
-#define GSF_PING_USER_FLAG_15 0x8000u
-
-/* Define a set of macros to set, clear, and test the state of the
- *  ping status flags.
- *  Where:
- *     ping_flags: The ping flags field of the gsfSwathBathyPing structure.
- *     usflag:     The definition of the flag to test, set, or clear.
- */
-#define gsfTestPingStatus(ping_flags, usflag)    (((ping_flags) & (usflag)) ? 1 : 0)
-#define gsfSetPingStatus(ping_flags, usflag)      ((ping_flags) |= (usflag))
-#define gsfClearPingStatus(ping_flags, usflag)    ((ping_flags) &= (~(usflag)))
-
-/* Define the GSF bit flags flags for the beam status array.
- * The GSF_IGNORE_BEAM flag may be set to indicate that this beam should
- *  not be used by any processing/display software.  The flags
- *  GSF_BEAM_USER_FLAG_01-07 may be set/read by application specific software
- */
-#define GSF_IGNORE_BEAM       0x01u
-#define GSF_BEAM_USER_FLAG_01 0x02u
-#define GSF_BEAM_USER_FLAG_02 0x04u
-#define GSF_BEAM_USER_FLAG_03 0x08u
-#define GSF_BEAM_USER_FLAG_04 0x10u
-#define GSF_BEAM_USER_FLAG_05 0x20u
-#define GSF_BEAM_USER_FLAG_06 0x40u
-#define GSF_BEAM_USER_FLAG_07 0x80u
-
-/* Define the internal form of the array subrecord scale factor information,
- * which is used to scale the swath bathymetry ping record to/from
- * internal/external form. The subrecord id is specified by the index into
- * the scaleTable array.
- */
-typedef struct t_gsfScaleInfo
-{
-    unsigned char   compressionFlag;    /* Specifies bytes of storage in high order nibble and type of compression in low order nibble */
-    double          multiplier;         /* the scale factor (millionths)for the array */
-    double          offset;             /* dc offset to scale data by */
-} gsfScaleInfo;
-typedef struct t_gsfScaleFactors
-{
-    int             numArraySubrecords; /* the number of scaling factors we actually have */
-    gsfScaleInfo    scaleTable[GSF_MAX_PING_ARRAY_SUBRECORDS];
-} gsfScaleFactors;
-
-/* Macro definitions for populating the compression flag (c_flag) argument passed through the
- * gsfLoadScaleFactors(), gsfGetScaleFactor, and gsfLoadDepthScaleFactorAutoOffset() APIs
- */
-
-/* The high order 4 bits are used to define the field size for this array */
-#define GSF_FIELD_SIZE_DEFAULT  0x00  /* Default values for field size are used used for all beam arrays */
-#define GSF_FIELD_SIZE_ONE      0x10  /* value saved as a one byte value after applying scale and offset */
-#define GSF_FIELD_SIZE_TWO      0x20  /* value saved as a two byte value after applying scale and offset */
-#define GSF_FIELD_SIZE_FOUR     0x40  /* value saved as a four byte value after applying scale and offset */
-
-/* The low order 4 bits are used to define the compression approach */
-#define GSF_DISABLE_COMPRESSION 0x00  /* no compression to be applied to the beam array data. */
-                                      /* no compression supported in this version, but may be added in a future release */
-
-
-typedef struct t_gsfEM3ImagerySpecific
-{
-    unsigned short range_norm;          /* range to normal incidence used to correct sample amplitudes (in samples) */
-    unsigned short start_tvg_ramp;      /* start range sample of TVG ramp if not enough dynamic range (0 else) */
-    unsigned short stop_tvg_ramp;       /* stop range sample of TVG ramp if not enough dynamic range (0 else) */
-    char           bsn;                 /* normal incidence BS in dB */
-    char           bso;                 /* oblique BS in dB */
-    double         mean_absorption;     /* mean absorption coeffiecient in dB/km, resolution of 0.01 dB/km) */
-    short          offset;              /* Value that has been added to all imagery samples to convert to a positive value */
-    short          scale;               /* Manufacturer's specified scale value for each sample. This value is 2 for data from EM3000/EM3002/EM1002/EM300/EM120 */
-    unsigned char  spare[4];            /* spare sensor specific subrecord space, reserved for future expansion */
-} t_gsfEM3ImagerySpecific;
-
-typedef struct t_gsfReson7100ImagerySpecific
-{
-    unsigned short size;
-    unsigned char  spare[64];            /* spare sensor specific subrecord space, reserved for future expansion */
-} t_gsfReson7100ImagerySpecific;
-
-typedef struct t_gsfReson8100ImagerySpecific
-{
-    unsigned char  spare[8];            /* spare sensor specific subrecord space, reserved for future expansion */
-} t_gsfReson8100ImagerySpecific;
-
-typedef struct t_gsfEM4ImagerySpecific
-{
-    double         sampling_frequency;  /* The system digitizing rate in Hz, value retrieved from the imagery datagram */
-    double         mean_absorption;     /* mean absorption coefficient in dB/km, from 0x53 datagram, 0 if data is from 0x59  */
-    double         tx_pulse_length;     /* transmit pulse length in microseconds from imagery datagram 0x53, or 0x59 */
-    int            range_norm;          /* range to normal incidence used to correct sample amplitudes (in samples) */
-    int            start_tvg_ramp;      /* start range (in samples) of TVG ramp if not enough dynamic range 0 means not used */
-    int            stop_tvg_ramp;       /* stop range (in samples) of TVG ramp if not enough dynamic range 0 means not used */
-    double         bsn;                 /* normal incidence BS in dB */
-    double         bso;                 /* oblique incidence BS in dB */
-    double         tx_beam_width;       /* transmit beam width in degrees from imagery datagram */
-    double         tvg_cross_over;      /* The TVG law crossover angle in degrees */
-    short          offset;              /* Value that has been added to all imagery samples to convert to a positive value */
-    short          scale;               /* Manufacturer's specified scale value for each sample. This value is 10 for data from EM710/EM302/EM122 */
-    unsigned char  spare[20];           /* spare sensor specific subrecord space, reserved for future expansion */
-} t_gsfEM4ImagerySpecific;
-
-typedef struct t_gsfKlein5410BssImagerySpecific
-{
-    unsigned int   res_mode;            /* Descriptor for resolution mode: 0 = normal; 1 = high */
-    unsigned int   tvg_page;            /* TVG page number */
-    unsigned int   beam_id[5];          /* array of identifiers for five sidescan beam magnitude time series, starting with beam id 1 as the forward-most */
-    unsigned char  spare[4];            /* spare sensor specific subrecord space, reserved for future expansion */
-} t_gsfKlein5410BssImagerySpecific;
-
-/* Define the R2Sonic sensor imagery data structure.  Very similar to gsfR2SonicSpecific structure */
-typedef struct t_gsfR2SonicImagerySpecific
-{
-    unsigned char   model_number[12];   /* Model number, e.g. "2024".  Unused chars are nulls */
-    unsigned char   serial_number[12];  /* Serial number, e.g. "100017".  Unused chars are nulls */
-    struct timespec dg_time;            /* Ping time, re 00:00:00, Jan 1, 1970 ("Unix time") */
-    unsigned int    ping_number;        /* Sequential ping counter relative to power up or reboot */
-    double          ping_period;        /* Time interval between two most recent pings, seconds */
-    double          sound_speed;        /* Sound speed at transducer face, m/s */
-    double          frequency;          /* Sonar center frequency (Hz) */
-    double          tx_power;           /* TX source level, dB re 1uPa at 1 meter */
-    double          tx_pulse_width;     /* pulse width, seconds */
-    double          tx_beamwidth_vert;  /* fore-aft beamwidth, degrees */
-    double          tx_beamwidth_horiz; /* athwartship beamwidth, degreess */
-    double          tx_steering_vert;   /* fore-aft beam steering angle, degrees */
-    double          tx_steering_horiz;  /* athwartship beam steering angle, degrees */
-    unsigned int    tx_misc_info;       /* reserved for future use */
-    double          rx_bandwidth;       /* receiver bandwidth, Hz */
-    double          rx_sample_rate;     /* receiver sample rate, Hz */
-    double          rx_range;           /* receiver range setting, seconds in docs but I think it's meters  */
-    double          rx_gain;            /* receiver gain setting, 2dB increments between steps */
-    double          rx_spreading;       /* TVG spreading law coefficient, e.g. 20log10(range) */
-    double          rx_absorption;      /* TVG absorption coefficient, dB/km */
-    double          rx_mount_tilt;      /* degrees */
-    unsigned int    rx_misc_info;       /* reserved for future use */
-    unsigned short  reserved;           /* reserved for future use */
-    unsigned short  num_beams;          /* number of beams in this ping */
-    double          more_info[6];       /* reserved for future use, from SNI0 datagram */
-    unsigned char   spare[32];          /* saved for future expansion */
-}
-t_gsfR2SonicImagerySpecific;
-
-typedef union t_gsfSensorImagery
-{
-    t_gsfEM3ImagerySpecific          gsfEM3ImagerySpecific;          /* used for EM120, EM300, EM1002, EM3000 */
-    t_gsfReson7100ImagerySpecific    gsfReson7100ImagerySpecific;    /* For Reson 71P "snippet" imagery */
-    t_gsfReson8100ImagerySpecific    gsfReson8100ImagerySpecific;    /* For Reson 81P "snippet" imagery */
-    t_gsfEM4ImagerySpecific          gsfEM4ImagerySpecific;          /* used for EM122, EM302, EM710 */
-    t_gsfKlein5410BssImagerySpecific gsfKlein5410BssImagerySpecific; /* used for Klein 5410 Bathy Sidescan */
-    t_gsfR2SonicImagerySpecific      gsfR2SonicImagerySpecific;      /* used for R2Sonic */
-} gsfSensorImagery;
-
-typedef struct gsfTimeSeriesIntensity
-{
-    unsigned short sample_count;       /* number of amplitude samples per beam */
-    unsigned short detect_sample;      /* index of bottom detection sample for the beam */
-    unsigned char  spare[8];           /* for future use */
-    unsigned int  *samples;            /* Array of per-beam time series intensity samples  */
-} gsfTimeSeriesIntensity;
-
-#define GSF_INTENSITY_LINEAR     0x01u
-#define GSF_INTENSITY_CALIBRATED 0x02u
-#define GSF_INTENSITY_POWER      0x04u
-#define GSF_INTENSITY_GAIN       0x08u
-
-typedef struct t_gsfBRBIntensity
-{
-    unsigned char           bits_per_sample;       /* bits per intensity sample */
-    unsigned int            applied_corrections;   /* flags to describe corrections applied to intensity values */
-    unsigned char           spare[16];             /* spare header space */
-    gsfSensorImagery        sensor_imagery;        /* sensor specific per-ping imagery information */
-    gsfTimeSeriesIntensity *time_series;           /* array of per-beam time series intensity values */
-} gsfBRBIntensity;
-
-/* Define the data structure for a ping from a swath bathymetric system */
-typedef struct t_gsfSwathBathyPing
-{
-    struct timespec    ping_time;          /* seconds and nanoseconds */
-    double             latitude;           /* in degrees, positive going north */
-    double             longitude;          /* in degrees, positive going east */
-    double             height;             /* height above ellipsoid, positive value defines a point above ellipsoid */
-    double             sep;                /* distance from ellipsoid to vertical datum, positive value indicates datum above ellipsoid */
-    short              number_beams;       /* in this ping */
-    short              center_beam;        /* offset into array (0 = portmost outer) */
-    unsigned short     ping_flags;         /* flags to mark status of this ping */
-    short              reserved;           /* for future use */
-    double             tide_corrector;     /* in meters */
-    double             gps_tide_corrector; /* in meters */
-    double             depth_corrector;    /* in meters */
-    double             heading;            /* in degrees */
-    double             pitch;              /* in degrees */
-    double             roll;               /* in degrees */
-    double             heave;              /* in meters    */
-    double             course;             /* in degrees */
-    double             speed;              /* in knots */
-    gsfScaleFactors    scaleFactors;       /* The array scale factors for this data */
-    double            *depth;              /* depth array (meters) */
-    double            *nominal_depth;      /* Array of depth relative to 1500 m/s */
-    double            *across_track;       /* across track array (meters) */
-    double            *along_track;        /* along track array (meters) */
-    double            *travel_time;        /* roundtrip travel time array (seconds) */
-    double            *beam_angle;         /* beam angle array (degrees from vertical) */
-    double            *mc_amplitude;       /* mean, calibrated beam amplitude array (dB re 1V/micro pascal at 1 meter) */
-    double            *mr_amplitude;       /* mean, relative beam amplitude array (dB re 1V/micro pascal at 1 meter) */
-    double            *echo_width;         /* echo width array (seconds) */
-    double            *quality_factor;     /* quality factor array (dimensionless) */
-    double            *receive_heave;      /* Array of heave data (meters) */
-    double            *depth_error;        /* Array of estimated vertical error (meters) */
-    double            *across_track_error; /* Array of estimated across track error (meters) */
-    double            *along_track_error;  /* Array of estimated along track error (meters) */
-    unsigned char     *quality_flags;      /* Two bit beam detection flags provided by Reson sonar */
-    unsigned char     *beam_flags;         /* Array of beam status flags */
-    double            *signal_to_noise;    /* signal to noise ratio (dB) */
-    double            *beam_angle_forward; /* beam angle forward array (degrees counterclockwise from stbd.) */
-    double            *vertical_error;     /* Array of estimated vertical error (meters, at 95% confidence) */
-    double            *horizontal_error;   /* Array of estimated horizontal error (meters, at 95% confidence) */
-    unsigned short    *sector_number;      /* Array of values that specify the transit sector for this beam */
-    unsigned short    *detection_info;     /* Array of values that specify the method of bottom detection */
-    double            *incident_beam_adj;  /* Array of values that specify incident beam angle adjustment from beam_angle */
-    unsigned short    *system_cleaning;    /* Array of values that specify data cleaning information from the sensor system */
-    double            *doppler_corr;       /* Array of values used to correct the travel times for Doppler when transmission is FM */
-    double            *sonar_vert_uncert;  /* vertical uncertainty provided by the sonar */
-    int                sensor_id;          /* a definition which specifies the sensor */
-    gsfSensorSpecific  sensor_data;        /* union of known sensor specific data */
-    gsfBRBIntensity   *brb_inten;          /* Structure containing bathymetric receive beam time series intensities */
-}
-gsfSwathBathyPing;
-
-/* Define a single beam record structure. */
-typedef struct t_gsfSingleBeamPing
-{
-    struct timespec ping_time;          /* Time the sounding was made */
-    double          latitude;           /* latitude (degrees) of sounding */
-    double          longitude;          /* longitude (degrees) of sounding */
-    double          tide_corrector;     /* in meters */
-    double          depth_corrector;    /* in meters draft corrector for sensor */
-    double          heading;            /* in degrees */
-    double          pitch;              /* in meters */
-    double          roll;               /* in meters */
-    double          heave;              /* in meters */
-    double          depth;              /* in meters */
-    double          sound_speed_correction;  /* in meters */
-    unsigned short  positioning_system_type;
-    int             sensor_id;
-    gsfSBSensorSpecific sensor_data;
-}
-gsfSingleBeamPing;
-
-/* Define the sound velocity profile structure */
-typedef struct t_gsfSVP
-{
-    struct timespec observation_time;   /* time the SVP measurement was made            */
-    struct timespec application_time;   /* time the SVP was used by the sonar           */
-    double          latitude;           /* latitude (degrees) of SVP measurement        */
-    double          longitude;          /* longitude (degrees) of SVP measurement       */
-    int             number_points;      /* number of data points in the profile         */
-    double         *depth;              /* array of profile depth values in meters      */
-    double         *sound_speed;        /* array of profile sound velocity values in m/s*/
-}
-gsfSVP;
-
-/* Define the internal record structure for processing parameters */
-#define GSF_MAX_PROCESSING_PARAMETERS 128
-typedef struct t_gsfProcessingParameters
-{
-    struct timespec param_time;
-    int             number_parameters;
-    short           param_size[GSF_MAX_PROCESSING_PARAMETERS];  /* array of sizes of param text */
-    char           *param[GSF_MAX_PROCESSING_PARAMETERS];       /* array of parameters: "param_name=param_value" */
-}
-gsfProcessingParameters;
-
-/* Define the sensor parameters record structure */
-#define GSF_MAX_SENSOR_PARAMETERS 128
-typedef struct t_gsfSensorParameters
-{
-    struct timespec param_time;
-    int             number_parameters;
-    short           param_size[GSF_MAX_SENSOR_PARAMETERS];      /* array of sizes of param text */
-    char           *param[GSF_MAX_SENSOR_PARAMETERS];   /* array of parameters: "param_name=param_value" */
-}
-gsfSensorParameters;
-
-/* Define the comment record structure */
-typedef struct t_gsfComment
-{
-    struct timespec comment_time;
-    int             comment_length;
-    char           *comment;
-}
-gsfComment;
-
-/* Define the history record */
-#define GSF_OPERATOR_LENGTH  64
-#define GSF_HOST_NAME_LENGTH 64
-typedef struct t_gsfHistory
-{
-    struct timespec history_time;
-    char            host_name[GSF_HOST_NAME_LENGTH + 1];
-    char            operator_name[GSF_OPERATOR_LENGTH + 1];
-    char           *command_line;
-    char           *comment;
-}
-gsfHistory;
-
-/* Define the navigation error record
- * jsb As of GSF v1.07, this record is replaced by gsfHVNavigationError.
- * All newly created files should be written using gsfHVNavigationError,
- * instead of gsfNavigationError.
- */
-typedef struct t_gsfNavigationError
-{
-    struct timespec nav_error_time;
-    int             record_id;          /* Containing nav with these errors */
-    double          latitude_error;     /* 90% CE in meters */
-    double          longitude_error;    /* 90% CE in meters */
-}
-gsfNavigationError;
-
-/* jsb As of GSF v1.07, This new navigation error record replaces gsfNavigationError.
- *  The definition of gsfNavigationError will remain in the specification for several
- *  release of GSF for backwards compatability. (The HV stands for Horizontal and Vertical)
- */
-typedef struct t_gsfHVNavigationError
-{
-    struct timespec nav_error_time;
-    int             record_id;                 /* Containing nav with these errors */
-    double          horizontal_error;          /* RMS error in meters */
-    double          vertical_error;            /* RMS error in meters */
-    double          SEP_uncertainty;           /* RMS uncertainty of SEP in meters. Set to 0.0 if not applicable */
-    char            spare[2];                  /* Two bytes of reserved space */
-    char           *position_type;             /* A character string code which specifies the type of positioning system */
-}
-gsfHVNavigationError;
-
-/* Define a set of macros which may to used to set the position_type field */
-#define GSF_POS_TYPE_UNKN "UNKN"               /* Unknown positioning system type */
-#define GSF_POS_TYPE_GPSU "GPSU"               /* GPS Position, unknown positioning service */
-#define GSF_POS_TYPE_PPSD "PPSD"               /* Precise positioning service - differential */
-#define GSF_POS_TYPE_PPSK "PPSK"               /* Precise positioning service - kinematic */
-#define GSF_POS_TYPE_PPSS "PPSS"               /* Precise positioning service - standalone */
-#define GSF_POS_TYPE_PPSG "PPSG"               /* Precise positioning service - gypsy */
-#define GSF_POS_TYPE_SPSD "SPSD"               /* Standard positioning service - differential */
-#define GSF_POS_TYPE_SPSK "SPSK"               /* Standard positioning service - kinematic */
-#define GSF_POS_TYPE_SPSS "SPSS"               /* Standard positioning service - standalone */
-#define GSF_POS_TYPE_SPSG "SPSG"               /* Standard positioning service - gypsy */
-#define GSF_POS_TYPE_GPPP "GPPP"               /* Post Processing - Precise Point Positioning */
-#define GPS_POS_TYPE_GPPK "GPPK"               /* Post Processing - Post Processed Kinematic */
-
-#define GSF_POS_TYPE_INUA "INUA"   /* Inertial measurements only, unaided */
-#define GSF_POS_TYPE_INVA "INVA"   /* Inertial measurements with absolute velocity aiding */
-#define GSF_POS_TYPE_INWA "INWA"   /* Inertial measurements with water-relative velocity aiding */
-#define GSF_POS_TYPE_LBLN "LBLN"   /* One or more long-baseline acoustic navigation lines of position */
-#define GSF_POS_TYPE_USBL "USBL"   /* ultra-short baseline acoustic navigation */
-
-#define GSF_POS_TYPE_PIUA "PIUA"   /* Post-processed inertial measurements only, unaided */
-#define GSF_POS_TYPE_PIVA "PIVA"   /* Post-processed Inertial measurements with absolute velocity aiding */
-#define GSF_POS_TYPE_PIWA "PIWA"   /* Post-processed Inertial measurements with water-relative velocity aiding */
-#define GSF_POS_TYPE_PLBL "PLBL"   /* Post-processed One or more long-baseline acoustic navigation lines of position */
-#define GSF_POS_TYPE_PSBL "PSBL"   /* Post-processed ultra-short baseline acoustic navigation */
-
-/* Define the data structure for a ping from a swath bathymetric system */
-typedef struct t_gsfAttitude
-{
-    short            num_measurements;      /* number of attitude measurements in this record */
-    struct timespec *attitude_time;         /* seconds and nanoseconds */
-    double          *pitch;                 /* in degrees */
-    double          *roll;                  /* in degrees */
-    double          *heave;                 /* in meters */
-    double          *heading;               /* in degrees */
-}
-gsfAttitude;
-
-/* Define a structure to encapsulate the known gsf records, this
- * simplifies the number of arguments to gsfRead, and gsfWrite.
- */
-typedef struct t_gsfRecords
-{
-    gsfHeader               header;
-    gsfSwathBathySummary    summary;
-    gsfSwathBathyPing       mb_ping;
-    gsfSingleBeamPing       sb_ping;
-    gsfSVP                  svp;
-    gsfProcessingParameters process_parameters;
-    gsfSensorParameters     sensor_parameters;
-    gsfComment              comment;
-    gsfHistory              history;
-    gsfNavigationError      nav_error;
-    gsfHVNavigationError    hv_nav_error;
-    gsfAttitude             attitude;
-} gsfRecords;
-
-/* Define a data structure to hold offsets needed to correct multibeam
- * bathymetric data. Currently gsf supports tracking of up to two pairs
- * of each of the relavent offsets.  This is required for systems such as
- * HydroChart II and Reson 9002 which have two pairs of transmit/receive
- * arrays per installation.
- */
-#define GSF_MAX_OFFSETS                2
-#define GSF_COMPENSATED                1
-#define GSF_UNCOMPENSATED              0
-#define GSF_TRUE_DEPTHS                1
-#define GSF_DEPTHS_RE_1500_MS          2
-#define GSF_DEPTH_CALC_UNKNOWN         3
-#define GSF_UNKNOWN_PARAM_VALUE  DBL_MIN        /* defined in <float.h> */
-#define GSF_UNKNOWN_PARAM_INT        -99
-#define GSF_TRUE                       1
-#define GSF_FALSE                      0
-#define GSF_NUMBER_PROCESSING_PARAMS  49
-
-/* Macro definitions for type of platform */
-#define GSF_PLATFORM_TYPE_SURFACE_SHIP  0              /*DHG 2008/12/22 Add for AUV vs Surface Ship discrimination */
-#define GSF_PLATFORM_TYPE_AUV           1              /*DHG 2008/12/22 Add for AUV vs Surface Ship discrimination */
-#define GSF_PLATFORM_TYPE_ROTV          2
-
-typedef struct t_gsfMBOffsets
-{
-    double           draft[GSF_MAX_OFFSETS];                     /* meters */
-    double           pitch_bias[GSF_MAX_OFFSETS];                /* pitch bias in degrees, results from patch test */
-    double           roll_bias[GSF_MAX_OFFSETS];                 /* roll bias in degrees, results from patch test */
-    double           gyro_bias[GSF_MAX_OFFSETS];                 /* gyro bias in degrees, results from patch test */
-    double           position_x_offset;                          /* meters */
-    double           position_y_offset;                          /* meters */
-    double           position_z_offset;                          /* meters */
-    double           antenna_x_offset;                           /* meters */
-    double           antenna_y_offset;                           /* meters */
-    double           antenna_z_offset;                           /* meters */
-    double           transducer_x_offset[GSF_MAX_OFFSETS];       /* sonar X installation offset in meters, from ship alignment survey */
-    double           transducer_y_offset[GSF_MAX_OFFSETS];       /* sonar Y installation offset in meters, from ship alignment survey */
-    double           transducer_z_offset[GSF_MAX_OFFSETS];       /* sonar Z installation offset in meters, from ship alignment survey */
-    double           transducer_pitch_offset[GSF_MAX_OFFSETS];   /* sonar pitch installation angle in degrees, from ship alignment survey */
-    double           transducer_roll_offset[GSF_MAX_OFFSETS];    /* sonar roll installation angle in degrees, from ship alignment survey */
-    double           transducer_heading_offset[GSF_MAX_OFFSETS]; /* sonar heading installation  angle in degrees, from ship alignment survey */
-    double           mru_pitch_bias;                             /* MRU installation pitch angle in degrees, from ship alignment survey */
-    double           mru_roll_bias;                              /* MRU installation roll angle in degrees, from ship alignment survey */
-    double           mru_heading_bias;                           /* MRU installation heading angle in degrees, from ship alignment survey */
-    double           mru_x_offset;                               /* MRU X installation offset in meters, from ship alignment survey */
-    double           mru_y_offset;                               /* MRU Y installation offset in meters, from ship alignment survey meters */
-    double           mru_z_offset;                               /* MUR Z installation offset in meters, from ship alignment survey meters */
-    double           center_of_rotation_x_offset;                /* meters */
-    double           center_of_rotation_y_offset;                /* meters */
-    double           center_of_rotation_z_offset;                /* meters */
-    double           position_latency;                           /* seconds */
-    double           attitude_latency;                           /* seconds */
-    double           depth_sensor_latency;                       /* seconds */
-    double           depth_sensor_x_offset;                      /* for subsurface vehicles; distance of pressure sensor from MRP in meters */
-    double           depth_sensor_y_offset;                      /* for subsurface vehicles; distance of pressure sensor from MRP in meters */
-    double           depth_sensor_z_offset;                      /* for subsurface vehicles; distance of pressure sensor from MRP in meters */
-    double           rx_transducer_x_offset[GSF_MAX_OFFSETS];      /* If the receive array is in a different location than   */
-    double           rx_transducer_y_offset[GSF_MAX_OFFSETS];      /* the transmit array these "rx" offsets will be used for */
-    double           rx_transducer_z_offset[GSF_MAX_OFFSETS];      /* the receive array and the transducer offsets defined   */
-    double           rx_transducer_pitch_offset[GSF_MAX_OFFSETS];  /* above will be used for the transmit array              */
-    double           rx_transducer_roll_offset[GSF_MAX_OFFSETS];
-    double           rx_transducer_heading_offset[GSF_MAX_OFFSETS];
-} gsfMBOffsets;
-
-/* Macro definitions for roll_reference type */
-#define GSF_HORIZONTAL_PITCH_AXIS          1
-#define GSF_ROTATED_PITCH_AXIS             2
-
-
-/* Define a data structure to hold multibeam sonar processing parameters */
-typedef struct t_gsfMBParams
-{
-    /* These parameters define reference points */
-    char start_of_epoch[64];
-    int horizontal_datum;
-    int vertical_datum;
-
-    int utc_offset;                 /* = The offset in hours from UTC to the local time when the GSF file was created */
-
-    /* these parameters define the installed hardware */
-    int number_of_transmitters;      /* = The number of transmitters installed */
-    int number_of_receivers;         /* = The number of receivers installed */
-
-    /* These parameters specify what corrections have been applied to the data */
-    int roll_reference;             /* = flag to indicate whether roll is horizontal pitch axis or rotated pitch axis */
-    int roll_compensated;           /* = GSF_COMPENSATED if the depth data has been corrected for roll */
-    int pitch_compensated;          /* = GSF_COMPENSATED if the depth data has been corrected for pitch */
-    int heave_compensated;          /* = GSF_COMPENSATED if the depth data has been corrected for heave */
-    int tide_compensated;           /* = GSF_COMPENSATED if the depth data has been corrected for tide */
-    int ray_tracing;                /* = GSF_COMPENSATED if the travel time/angle pairs are compensated for ray tracing */
-    int depth_calculation;          /* = GSF_TRUE_DEPTHS, or GSF_DEPTHS_RE_1500_MS, applicable to the depth field */
-    int vessel_type;                /* DHG 2008/12/18 Add "VESSEL_TYPE" to Processing Parameters */
-    int full_raw_data;              /* = GSF_TRUE if this GSF file has sufficient information to support full recalculation of X,Y,Z from raw measurements, otherwise = GSF_FALSE */
-    int msb_applied_to_attitude;    /* = GSF_TRUE if the motion sensor bias values (from patch test) have been added to the attitude values in the ping record and attitude record */
-    int heave_removed_from_gps_tc;  /* = GSF_TRUE if the heave has been removed from the gps_tide_corrector */
-
-    /* These parameters specify known offsets which have NOT been corrected.
-     * If each of these values are zero, then all known offsets have been
-     * corrected for.
-     */
-    gsfMBOffsets to_apply;
-
-    /* These parameters specify offsets which have already been corrected. */
-    gsfMBOffsets applied;
-} gsfMBParams;
-
-/* Macro definitions for approved horizontal datums. Note that as of
- * 12/20/95 only WGS-84 is supported by GSF.
- */
-#define GSF_H_DATUM_ADI   1   /* Adinan */
-#define GSF_H_DATUM_ARF   2   /* Arc 1950 */
-#define GSF_H_DATUM_ARS   3   /* Arc 1960 */
-#define GSF_H_DATUM_AUA   4   /* Australian Geodetic */
-#define GSF_H_DATUM_BAT   5   /* Djakarta (Batavia) */
-#define GSF_H_DATUM_BID   6   /* Bissau Base Northwest End Pillar, Portugese Guinea */
-#define GSF_H_DATUM_BUR   7   /* Bukit Rimpah */
-#define GSF_H_DATUM_CAI   8   /* Campo Inchauspe */
-#define GSF_H_DATUM_CAM   9   /* Camacupa Base SW End */
-#define GSF_H_DATUM_CAP  10   /* Cape, South Africa */
-#define GSF_H_DATUM_CAA  11   /* Campo Area Astro */
-#define GSF_H_DATUM_CHO  12   /* Chatham Island Astro */
-#define GSF_H_DATUM_CHU  13   /* Chua Astro */
-#define GSF_H_DATUM_COA  14   /* Corrego Alegre */
-#define GSF_H_DATUM_ENB  15   /* European 79 */
-#define GSF_H_DATUM_EUR  16   /* European */
-#define GSF_H_DATUM_GDA  17   /* German */
-#define GSF_H_DATUM_GEO  18   /* Geodetic Datum 1949 */
-#define GSF_H_DATUM_GHA  19   /* Ghana */
-#define GSF_H_DATUM_GSB  20   /* G. Segara */
-#define GSF_H_DATUM_GSF  21   /* G. Serindung */
-#define GSF_H_DATUM_GUA  22   /* Guam 1963 */
-#define GSF_H_DATUM_HEN  23   /* Herat North */
-#define GSF_H_DATUM_HER  24   /* Hermannskogel */
-#define GSF_H_DATUM_HJO  25   /* Hjorsey 1955 */
-#define GSF_H_DATUM_HTN  26   /* Hu-Tu-Shan */
-#define GSF_H_DATUM_IDA  27   /* Italian */
-#define GSF_H_DATUM_IND  28   /* Indian */
-#define GSF_H_DATUM_IRE  29   /* Ireland 1965 */
-#define GSF_H_DATUM_KEA  30   /* Kertau */
-#define GSF_H_DATUM_LIB  31   /* Liberia 1964 (Robertsfield Astro) */
-#define GSF_H_DATUM_LOC  32   /* Local Astro */
-#define GSF_H_DATUM_LUZ  33   /* Luzon */
-#define GSF_H_DATUM_MER  34   /* Merchich */
-#define GSF_H_DATUM_MET  35   /* Mercury */
-#define GSF_H_DATUM_MOL  36   /* Montjong Lowe */
-#define GSF_H_DATUM_NAN  37   /* Nanking 1960 */
-#define GSF_H_DATUM_NAR  38   /* North American 1983 */
-#define GSF_H_DATUM_NAS  39   /* North American 1927 */
-#define GSF_H_DATUM_NIG  40   /* Nigeria */
-#define GSF_H_DATUM_OGB  41   /* Ordnance Survey of Great Britain 1936 */
-#define GSF_H_DATUM_OHA  42   /* Old Hawaiian */
-#define GSF_H_DATUM_OSI  43   /* Ordnance Survey of Ireland */
-#define GSF_H_DATUM_PLN  44   /* Pico de las Nieves, Gran Canaria, Canary Islands */
-#define GSF_H_DATUM_PRP  45   /* Provisional South American 1956 */
-#define GSF_H_DATUM_QUO  46   /* Qornoq */
-#define GSF_H_DATUM_SIB  47   /* Sierra leone 1960 */
-#define GSF_H_DATUM_TAN  48   /* Tananarive Obsv 1925 */
-#define GSF_H_DATUM_TIL  49   /* Timbalai */
-#define GSF_H_DATUM_TOK  50   /* Tokyo */
-#define GSF_H_DATUM_UND  51   /* Undetermined */
-#define GSF_H_DATUM_VOI  52   /* Voirol */
-#define GSF_H_DATUM_WGA  53   /* World Geodetic System 1960 */
-#define GSF_H_DATUM_WGB  54   /* World Geodetic System 1966 */
-#define GSF_H_DATUM_WGC  55   /* World Geodetic System 1972 */
-#define GSF_H_DATUM_WGD  56   /* World Geodetic System 1980 */
-#define GSF_H_DATUM_WGE  57   /* World Geodetic System 1984 */
-#define GSF_H_DATUM_WGS  58   /* World Geodetic System (year unknown) */
-#define GSF_H_DATUM_XXX  59   /* Multiple datums */
-#define GSF_H_DATUM_YAC  60   /* Yacare */
-
-/* Macro definitions for supported vertical datums */
-#define GSF_V_DATUM_UNKNOWN  1  /* Unknown vertical datum */
-#define GSF_V_DATUM_MLLW     2  /* Mean lower low water */
-#define GSF_V_DATUM_MLW      3  /* Mean low water */
-#define GSF_V_DATUM_ALAT     4  /* Aprox Lowest Astronomical Tide */
-#define GSF_V_DATUM_ESLW     5  /* Equatorial Springs Low Water */
-#define GSF_V_DATUM_ISLW     6  /* Indian Springs Low Water */
-#define GSF_V_DATUM_LAT      7  /* Lowest Astronomical Tide */
-#define GSF_V_DATUM_LLW      8  /* Lowest Low Water */
-#define GSF_V_DATUM_LNLW     9  /* Lowest Normal Low Water */
-#define GSF_V_DATUM_LWD     10  /* Low Water Datum */
-#define GSF_V_DATUM_MLHW    11  /* Mean Lower High Water */
-#define GSF_V_DATUM_MLLWS   12  /* Mean Lower Low Water Springs */
-#define GSF_V_DATUM_MLWN    13  /* Mean Low Water Neap */
-#define GSF_V_DATUM_MSL     14  /* Mean Sea Level */
-
-/* Define the error codes which gsfError may be set to */
-#define GSF_NORMAL                                 0
-#define GSF_FOPEN_ERROR                           -1
-#define GSF_UNRECOGNIZED_FILE                     -2
-#define GSF_BAD_ACCESS_MODE                       -3
-#define GSF_READ_ERROR                            -4
-#define GSF_WRITE_ERROR                           -5
-#define GSF_INSUFFICIENT_SIZE                     -6
-#define GSF_RECORD_SIZE_ERROR                     -7
-#define GSF_CHECKSUM_FAILURE                      -8
-#define GSF_FILE_CLOSE_ERROR                      -9
-#define GSF_TOO_MANY_ARRAY_SUBRECORDS            -10
-#define GSF_TOO_MANY_OPEN_FILES                  -11
-#define GSF_MEMORY_ALLOCATION_FAILED             -12
-#define GSF_UNRECOGNIZED_RECORD_ID               -13
-#define GSF_STREAM_DECODE_FAILURE                -14
-#define GSF_BAD_SEEK_OPTION                      -15
-#define GSF_FILE_SEEK_ERROR                      -16
-#define GSF_UNRECOGNIZED_SENSOR_ID               -17
-#define GSF_UNRECOGNIZED_DATA_RECORD             -18
-#define GSF_UNRECOGNIZED_ARRAY_SUBRECORD_ID      -19
-#define GSF_UNRECOGNIZED_SUBRECORD_ID            -20
-#define GSF_ILLEGAL_SCALE_FACTOR_MULTIPLIER      -21
-#define GSF_CANNOT_REPRESENT_PRECISION           -22
-#define GSF_READ_TO_END_OF_FILE                  -23
-#define GSF_BAD_FILE_HANDLE                      -24
-#define GSF_HEADER_RECORD_DECODE_FAILED          -25
-#define GSF_MB_PING_RECORD_DECODE_FAILED         -26
-#define GSF_SVP_RECORD_DECODE_FAILED             -27
-#define GSF_PROCESS_PARAM_RECORD_DECODE_FAILED   -28
-#define GSF_SENSOR_PARAM_RECORD_DECODE_FAILED    -29
-#define GSF_COMMENT_RECORD_DECODE_FAILED         -30
-#define GSF_HISTORY_RECORD_DECODE_FAILED         -31
-#define GSF_NAV_ERROR_RECORD_DECODE_FAILED       -32
-#define GSF_HEADER_RECORD_ENCODE_FAILED          -25
-#define GSF_MB_PING_RECORD_ENCODE_FAILED         -26
-#define GSF_SVP_RECORD_ENCODE_FAILED             -27
-#define GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED   -28
-#define GSF_SENSOR_PARAM_RECORD_ENCODE_FAILED    -29
-#define GSF_COMMENT_RECORD_ENCODE_FAILED         -30
-#define GSF_HISTORY_RECORD_ENCODE_FAILED         -31
-#define GSF_NAV_ERROR_RECORD_ENCODE_FAILED       -32
-#define GSF_SETVBUF_ERROR                        -33
-#define GSF_FLUSH_ERROR                          -34
-#define GSF_FILE_TELL_ERROR                      -35
-#define GSF_INDEX_FILE_OPEN_ERROR                -36
-#define GSF_CORRUPT_INDEX_FILE_ERROR             -37
-#define GSF_SCALE_INDEX_CALLOC_ERROR             -38
-#define GSF_RECORD_TYPE_NOT_AVAILABLE            -39
-#define GSF_SUMMARY_RECORD_DECODE_FAILED         -40
-#define GSF_SUMMARY_RECORD_ENCODE_FAILED         -41
-#define GSF_INVALID_NUM_BEAMS                    -42
-#define GSF_INVALID_RECORD_NUMBER                -43
-#define GSF_INDEX_FILE_READ_ERROR                -44
-#define GSF_PARAM_SIZE_FIXED                     -45
-#define GSF_SINGLE_BEAM_ENCODE_FAILED            -46
-#define GSF_HV_NAV_ERROR_RECORD_ENCODE_FAILED    -47
-#define GSF_HV_NAV_ERROR_RECORD_DECODE_FAILED    -48
-#define GSF_ATTITUDE_RECORD_ENCODE_FAILED        -49
-#define GSF_ATTITUDE_RECORD_DECODE_FAILED        -50
-#define GSF_OPEN_TEMP_FILE_FAILED                -51
-#define GSF_PARTIAL_RECORD_AT_END_OF_FILE        -52
-#define GSF_QUALITY_FLAGS_DECODE_ERROR           -53
-
-typedef struct t_gsf_gp{
-    double lon;            /* degrees */
-    double lat;            /* degrees */
-    double z;              /* meters */
-} GSF_POSITION;
-
-/*
-    note: the coordinate system is:
-    +x forward, +y starboard, + z down, +hdg cw from north
-*/
-
-typedef struct t_gsf_pos_offsets{
-    double x;              /* meters */
-    double y;              /* meters */
-    double z;              /* meters */
-} GSF_POSITION_OFFSETS;
-
-/* Global external data defined in this module */
-
-/* The following are the function protoytpes for all functions intended
- * to be exported by the library.
-
-    Fugro modification - Mitch Ames - 2012-02-15
-    The original exported functions did not use const pointers everywhere that they could or should.
-    I've added const where appropriate.
- */
-
-int OPTLK       gsfOpen(const char *filename, const int mode, int *handle);
-/*
- * Description : This function attempts to open a gsf data file.  If the
- *  file exits and is opened readonly or update the gsf header is read
- *  to confirm that this is a gsf data file.  If the file is opened create,
- *  the GSF header containing the version number of the software library is
- *  written into the header.  This function passes an integer handle back to
- *  the calling application.  The handle is used for all further access to the
- *  file. gsfOpen explicitly sets stream bufferring to the value specified
- *  by GSF_STREAM_BUF_SIZE.  The internal file table is searched for an
- *  available entry whose name matches that specified in the argument list, if
- *  no match is found, then the first available entry is used.  Up to
- *  GSF_MAX_OPEN_FILES files may be open by an application at a time.
- *
- * Inputs :
- *  filename = a fully qualified path to the gsf file to open
- *  mode may have the following values:
- *     GSF_READONLY = open an existing file for read only access
- *     GSF_UPDATE   = open an existing file for reading an writing
- *     GSF_CREATE   = create a new gsf file
- *     GSF_READONLY_INDEX = open an existing file for read only access with index
- *     GSF_UPDATE_INDEX   = open an existing file for reading an writing with index
- *  handle = a pointer to an integer to be assigned a handle which will be
- *     reference for all future file access.
- *
- * Returns :
- *  This funciton returns zero if successful, or -1 if an error occured.
- *
- * Error Conditions :
- *     GSF_BAD_ACCESS_MODE
- *     GSF_TOO_MANY_OPEN_FILES
- *     GSF_FOPEN_ERROR
- *     GSF_SETVBUF_ERROR
- *     GSF_UNRECOGNIZED_FILE
- */
-
-int OPTLK       gsfOpenBuffered(const char *filename, const int mode, int *handle, int buf_size);
-/*
- * Description : This function attempts to open a gsf data file.  If the
- *  file exits and is opened readonly or update the gsf header is read
- *  to confirm that this is a gsf data file.  If the file is opened create,
- *  the GSF header containing the version number of the software library is
- *  written into the header.  This function passes an integer handle back to
- *  the calling application.  The handle is used for all further access to the
- *  file. gsfOpenBufferd explicitly sets stream bufferring to the value
- *  specified by the buf_size argument. The internal file table is searched
- *  for an available entry whose name matches that specified in the argument
- *  list, if no match is found, then the first available entry is used.  Up
- *  to GSF_MAX_OPEN_FILES files may be open by an application at a time.
- *  gsfOpenBuffered performs identical processing to gsfOpen, except here,
- *  the caller is allowed to explicitly set the standard system library level
- *  I/O buffer size.
- *
- * Inputs :
- *  filename = a fully qualified path to the gsf file to open
- *  mode may have the following values:
- *     GSF_READONLY = open an existing file for read only access
- *     GSF_UPDATE   = open an existing file for reading an writing
- *     GSF_CREATE   = create a new gsf file
- *     GSF_READONLY_INDEX = open an existing file for read only access with index
- *     GSF_UPDATE_INDEX   = open an existing file for reading an writing with index
- *  handle = a pointer to an integer to be assigned a handle which will be
- *     reference for all future file access.
- *  buf_size = an integer buffer size in bytes.
- *
- * Returns :
- *  This funciton returns zero if successful, or -1 if an error occured.
- *
- * Error Conditions :
- *     GSF_BAD_ACCESS_MODE
- *     GSF_TOO_MANY_OPEN_FILES
- *     GSF_FOPEN_ERROR
- *     GSF_SETVBUF_ERROR
- *     GSF_UNRECOGNIZED_FILE
- */
-
-int OPTLK       gsfClose(const int handle);
-/*
- * Description : This function closes a gsf file previously openned
- *  using gsfOpen.
- *
- * Inputs :
- *  handle = the handle of the gsf file to be closed.
- *
- * Returns :
- *  This function returns zero if successful, or -1 if an error occured.
- *
- * Error Conditions :
- *    GSF_BAD_FILE_HANDLE
- *    GSF_FILE_CLOSE_ERROR
- */
-
-int OPTLK       gsfSeek(int handle, int option);
-/*
- * Description : This function may be used to move the file pointer
- *  for a previously openned gsf file.
- *
- * Inputs :
- *  handle = the integer handle returned from gsf Open
- *  option = the desired action for moving the file pointer, where:
- *    GSF_REWIND, move pointer to first record in the file.
- *    GSF_END_OF_FILE, move pointer to the end of the file.
- *    GSF_PREVIOUS_RECORD, backup to the beginning of the record just
- *     written or just read.
- *
- * Returns :
- *  This function returns zero if successful, or -1 if an error occured.
- *
- * Error Conditions :
- *    GSF_BAD_FILE_HANDLE
- *    GSF_FILE_SEEK_ERROR
- *    GSF_BAD_SEEK_OPTION
- */
-
-int OPTLK       gsfRead(int handle, int desiredRecord, gsfDataID * dataID, gsfRecords * rec, unsigned char *stream, int max_size);
-/* Description : gsfRead supports both direct and sequential access. If the
- *  file is opened for sequential access, this function reads the desired
- *  record from the gsf data file specified by handle.  The "desiredRecord"
- *  argument may be set to GSF_NEXT_RECORD to read the next record in the
- *  data file, or "desiredRecord" record may be set to the id of the record
- *  of interest, in which case the file will be read, skipping past
- *  intermediary records until the desired record is found.  When the desired
- *  record is found, it is read and then decoded from external to internal
- *  form. If the optional checksum is found with the data it will be verified.
- *  All of the fields of the gsfDataID structure, with the exception of the
- *  record_number field will be loaded with the values contained in the GSF
- *  record byte stream.  The record_number field will be undefined.  The
- *  stream and max_size arguments are normally set to NULL, unless the
- *  calling application is interested in a copy of the GSF byte stream.
- *
- *  If the file is opened for direct access, then the combination of the
- *  recordID and the record_number fields of the dataID structure are used
- *  to uniquely identify the record of interest.  The address for this record
- *  is retrieved from the index file, which was created on a previous call
- *  to gsfOpen or gsfOpenBuffered.  If the record of interest is a ping record
- *  for which we need to retrieve new scale factors, then the ping record
- *  containing the scale factors needed is read first, and then the ping
- *  record of interest is read.  Direct access applications should set the
- *  desiredRecord argument equal to the recordID field in the gsfDataID
- *  structure.
- *
- * Inputs :
- *    handle = the handle to the file as provided by gsfOpen
- *    desiredRecord = the desired record or GSF_NEXT_RECORD
- *    dataID = a pointer to a gsfDataID structure to be populated for the
- *             input record.
- *    rptr = a pointer to a gsfRecords structure to be populated with the
- *           data from the input record in internal form.
- *    stream = an optional pointer to caller memory to be populated with a copy
- *          of the gsf byte stream for this record.
- *    max_size = an optional maximum size to copy into buf
- *
- * Returns :
- *  This function returns the number of bytes read if successful,
- *  or -1 if an error occured.
- *
- * Error Conditions :
- *    GSF_BAD_FILE_HANDLE
- *    GSF_FILE_SEEK_ERROR
- *    GSF_FLUSH_ERROR
- *    GSF_READ_TO_END_OF_FILE
- *    GSF_READ_ERROR
- *    GSF_RECORD_SIZE_ERROR
- *    GSF_INSUFFICIENT_SIZE
- *    GSF_CHECKSUM_FAILURE
- *    GSF_UNRECOGNIZED_RECORD_ID
- *    GSF_HEADER_RECORD_DECODE_FAILED
- *    GSF_SVP_RECORD_DECODE_FAILED
- *    GSF_PROCESS_PARAM_RECORD_DECODE_FAILED
- *    GSF_SENSOR_PARAM_RECORD_DECODE_FAILED
- *    GSF_COMMENT_RECORD_DECODE_FAILED
- *    GSF_HISTORY_RECORD_DECODE_FAILED
- *    GSF_NAV_ERROR_RECORD_DECODE_FAILED
- */
-
-int OPTLK       gsfWrite(int handle, gsfDataID * id, gsfRecords * record);
-/* Description : gsfWrite encodes the data from internal to external form,
- *  and then writes the requested record into the file specified by handle,
- *  where handle is the value retured by gsfOpen.  The record is written to
- *  the current file pointer for handle.  An optional checksum may be computed
- *  and encoded with the data.
- *
- *  If the file is opened for sequential access (GSF_CREATE, or GSF_UPDATE)
- *  then the recordID field of the gsfDataID structure is used to specify
- *  the record to be written.  The record is written at the current location
- *  in the file.
- *
- *  If the file is opened for direct access (GSF_UPDATE_INDEX), then the
- *  combination of the recordID and the record_number fields of the gsfDataID
- *  structure are used to uniquely identify the record to be written.  The
- *  address of the record of interest is read from the index file and the file
- *  pointer is moved to this offset before the record is encoded and written
- *  to disk.
- *
- * Inputs :
- *  handle = the handle for this file as returned by gsfOpen
- *  id = a pointer to a gsfDataID containing the record id information for
- *       the record to write.
- *  rptr = a pointer to a gsfRecords structure from which to get the internal
- *         form of the record to be written to the file.
- *
- * Returns :
- *  This function returns the number of bytes written if successful, or
- *  -1 if an error occured.
- *
- * Error Conditions :
- *    GSF_BAD_FILE_HANDLE
- *    GSF_UNRECOGNIZED_RECORD_ID
- *    GSF_FILE_SEEK_ERROR
- *    GSF_WRITE_ERROR
- *    GSF_HEADER_RECORD_ENCODE_FAILED
- *    GSF_SVP_RECORD_ENCODE_FAILED
- *    GSF_PROCESS_PARAM_RECORD_ENCODE_FAILED
- *    GSF_SENSOR_PARAM_RECORD_ENCODE_FAILED
- *    GSF_COMMENT_RECORD_ENCODE_FAILED
- *    GSF_HISTORY_RECORD_ENCODE_FAILED
- *    GSF_NAV_ERROR_RECORD_ENCODE_FAILED
- *    GSF_FLUSH_ERROR
- *    GSF_SINGLE_BEAM_ENCODE_FAILED
- */
-
-int OPTLK       gsfLoadScaleFactor(gsfScaleFactors *sf, unsigned int subrecordID, char c_flag, double precision, int offset);
-/*
- * Description : gsfLoadScaleFactors should be used to load the swath
- *  bathymetry ping record scale factor structure.  This function assures
- *  that the multiplier and offset fields of the scale factor structure
- *  have a precision equal to that which will be stored in the gsf data file.
- *  This function should be called once for each beam array data type
- *  contained in your data.
- *
- * Inputs :
- *  sf = a pointer to the gsfScaleFactors structure to be loaded
- *  subrecordID = the subrecord id for the beam array data
- *  c_flag = the compression flag for the beam array
- *  precision = the presision to which the beam array data are to be stored
- *              (a value of 0.1 would indicate decimeter precision for depth)
- *  offset = the "DC" offset to scale the data by.
- *
- * Returns :
- *  This function returns zero if successful, or -1 if an error occured.
- *
- * Error Conditions :
- *    GSF_TOO_MANY_ARRAY_SUBRECORDS
- */
-
-int OPTLK gsfGetScaleFactor(int handle, unsigned int subrecordID, unsigned char *c_flag, double *multiplier, double *offset);
-/*
- * Description : gsfGetScaleFactor may be used to obtain the multiplier
- *  and DC offset values by which each swath bathymetry ping array subrecord
- *  is be scaled. gsfGetScalesFactor must be called once for each array
- *  subrecord of interest.  At leat one swath bathymetry ping record
- *  must have been read from, or written to the file specified by handle.
- *
- * Inputs :
- *  handle = the integer value set by a call to gsfOpen.
- *  subrecordID = an integer value containing the subrecord id of the requested scale factors
- *  c_flag = the address of an unsigned character to contain the the compression flag
- *  multiplier = the address of a double to contain the scaling multiplier
- *  offset = the address of a double to contain the scaling DC offset.
- *
- * Returns :
- *  This function returns zero if successful, or -1 if an error occured.
- *
- * Error Conditions :
- *    GSF_TOO_MANY_ARRAY_SUBRECORDS
- *    GSF_ILLEGAL_SCALE_FACTOR_MULTIPLIER
- */
-
-void OPTLK      gsfFree(gsfRecords *rec);
-/*
- * Description : This function frees all dynamically allocated memory
- *    from a gsfRecords data structure, and it then clears all the
- *    data elements in the structure.
- *
- * Inputs :
- *    gsfRecords *rec = a pointer to ta gsfRecords data structure
- *
- * Returns : none
- *
- * Error Conditions : none
- */
-
-void OPTLK      gsfPrintError(FILE * fp);
-/* Description : This function is used to print a short message describing
- *  the most recent error encountered.  This function need only be called if
- *  a -1 is returned from one of the gsf functions.
- *
- * Inputs :
- *  fp = a pointer to a FILE to which to write the message.
- *
- * Returns : none
- *
- * Error Conditions : none
- */
-
-int gsfIntError(void);
-/* Description : This function is used to return the most recent
- *  error encountered.  This function need only be called if
- *  a -1 is returned from one of the gsf functions.
- *
- * Inputs : none
- *
- * Returns : constant integer value representing the most recent error
- *
- * Error Conditions : none
- */
-
-const char *gsfStringError(void);
-/* Description : This function is used to return a short message describing
- *  the most recent error encountered.  This function need only be called if
- *  a -1 is returned from one of the gsf functions.
- *
- * Inputs : none
- *
- * Returns : none
- *
- * Error Conditions : none
- */
-
-int OPTLK       gsfIndexTime(int, int, int, time_t *, long *);
-/* Description : This function returns the time (Posix.4) associated with
- *  a specified record number and type.  It also returns the record number
- *  that was read.
- *
- * Inputs :
- *  handle = gsf file handle assigned by gsfOpen or gsfOpenBuffered
- *  record_type = record type to be retrieved
- *  record_number = record number to be retrieved (-1 will get the time
- *                  and record number of the last record of this type)
- *  sec = Posix.4 seconds
- *  nsec = Posix.4 nanoseconds
- *
- * Returns :
- *  This function returns the record number if successful, or -1 if an
- *  error occured.
- *
- * Error Conditions :
- *    GSF_RECORD_TYPE_NOT_AVAILABLE
- */
-
-int OPTLK       gsfPercent (int handle);
-/* Description : This function returns an integer value representing
- *  the location of the file pointer as a percentage of the total file
- *  size.  It may be used to obtain an indication of how far along a
- *  program is in reading a gsf data file.  The file size is obtained
- *  when the file is opened.
- *
- * Inputs :
- *  handle = gsf file handle assigned by gsfOpen or gsfOpenBuffered
- *
- * Returns :
- *  This function returns the current file position as a percentage of
- *  the file size, or -1 if an error occurred. gsfError will be set to
- *  indicate the error.
- *
- * Error Conditions :
- *  GSF_BAD_FILE_HANDLE
- *  GSF_FILE_TELL_ERROR
- */
-
-int OPTLK       gsfGetNumberRecords (int handle, int desiredRecord);
-/* Description : This function will return the number of records of a
- *  given type to the caller. The number of records is retreived from
- *  the index file, so the file must have been opened for direct
- *  access (GSF_READONLY_INDEX, or GSF_UPDATE_INDEX).
- *
- * Inputs :
- *    handle = the handle to the file as provided by gsfOpen
- *    desiredRecord = the desired record or GSF_NEXT_RECORD
- *
- * Returns :
- *  This function returns the number of records of type desiredRecord
- *  contained in the GSF file designated by handle, or -1 if an error
- *  occured.
- *
- * Error Conditions :
- *  GSF_BAD_FILE_HANDLE
- *  GSF_BAD_ACCESS_MODE
- */
-
-int OPTLK       gsfCopyRecords (gsfRecords *target, const gsfRecords *source);
-/* Description : This function will copy all of the data contained in the
- *  source gsfRecords data structure to the target gsfRecords data
- *  structure. The target MUST be memset to zero before the first call to
- *  gsfCopyRecords.  This function allocates dynmanic memory which is NOT
- *  maintained by the library.  It is up to the calling application to
- *  release the memory allocated.  This may be done by maintaining the
- *  target data structure as static data, or by using gsfFree to release
- *  the memory.
- *
- * Inputs :
- *  target = a pointer to a gsfRecords data structure allocated by the
- *      calling application, into which the source data is to be copied.
- *  source = a pointer to a gsfRecords data structure allocated by the
- *      calling application, from which data is to be copied.
- *
- * Returns : This function returns zero if successful, or -1 if an error
- *  occurs.
- *
- * Error Conditions :
- *  GSF_MEMORY_ALLOCATION_FAILED
- */
-
-int OPTLK       gsfPutMBParams(const gsfMBParams *p, gsfRecords *rec, int handle, int numArrays);
-/* Description : This function moves swath bathymetry sonar processing
- *    parameters from internal form to "KEYWORD=VALUE" form.  The internal
- *    form parameters are read from an MB_PARAMETERS data structure maintained
- *    by the caller.  The "KEYWORD=VALUE" form parameters are written into the
- *    processing_parameters structure of the gsfRecords data structure
- *    maitained by the caller. Parameters for up to two transmitters and two receivers
- *    are supported.  If the user sets the number_of_transmitters and number_of_receivers
- *    elements in the gsfMBParams data structure in addition to the numArrays command line
- *    argument, the numArrays value will be ignored.  If number_of_transmitters and
- *    number_of_receivers are equal to 0, then numArrays will be used to populate both
- *    these values in the GSF processing parameters record.
- *
- * Inputs :
- *     p = a pointer to the gsfMBParams data structure which contains
- *         the parameters in internal form.
- *     rec = a pointer to the gsfRecords data structure into which the
- *         parameters are to be written in the "KEYWORK=VALUE" form.
- *     handle = the integer handle to the file set by gsfOpen.
- *     numArrays = the integer value specifying the number of pairs of
- *         arrays which need to have seperate parameters tracked.
- *
- * Returns : This function returns zero if successful, or -1 if an error
- *  occurs.
- *
- * Error Conditions :
- *     GSF_MEMORY_ALLOCATION_FAILED
- *     GSF_PARAM_SIZE_FIXED
- */
-
-int OPTLK       gsfGetMBParams(const gsfRecords *rec, gsfMBParams *p, int *numArrays);
-/* Description : This function moves swath bathymetry sonar processing
- *    parameters from external, form to internal form.  The external
- *    "KEYWORD=VALUE" format parameters are read from a processing_params
- *    structure of a gsfRecords data structure maintained by the caller.
- *    The internal form parameters are written into a gsfMBParams data
- *    structure maintained by the caller. Parameters for up to two transmitters
- *    and two receivers are supported.  The number_of_transmitters and
- *    number_of_receivers elements of the gsfMBParams data structure are set by
- *    determining the number of fields in the parameters for the transmitter(s)
- *    and receiver(s), respectively.  The numArrays argument is set from the
- *    number of fields for the transmitter(s). Any parameter not described in a
- *    "KEYWORD=VALUE" format will be set to "GSF_UNKNOWN_PARAM_VALUE".
- *
- * Inputs :
- *     rec = a pointer to the gsfRecords data structure from which the
- *         parameters in "KEYWORK=VALUE" form are to be read.
- *     p = a pointer to the gsfMBParams data structure which will be populated.
- *     numArrays = the integer value specifying the number of pairs of
- *         arrays which need to have seperate parameters tracked.
- *
- * Returns : This function returns zero if successful, or -1 if an error
- *  occurs.
- *
- * Error Conditions :
- *  none.
- */
-
-int OPTLK       gsfGetSwathBathyBeamWidths(const gsfRecords *data, double *fore_aft, double *athwartship);
-/* Description : This function returns to the caller the fore-aft and
- *    the port-starboard beam widths in degrees for a swath bathymetry
- *    multibeam sonar, given a gsfRecords data structure which contains
- *    a populated gsfSwathBathyPing structure.
- *
- * Inputs :
- *     data = The address of a gsfRecords data structure maintained by the
- *         caller which contains a populated gsfSwathBathyPing substructure.
- *     fore_aft = The address of a double allocated by the caller which will
- *         be loaded with the sonar's fore/aft beam width in degrees. A value of
- *         GSF_BEAM_WIDTH_UNKNOWN is used when the beam width is not known.
- *     athwartship = The address of a double allocated by the caller which will
- *         be loaded with the sonar's athwartship beam width in degrees.  A
- *         value of GSF_BEAM_WIDTH_UNKNOWN is used when the beam width is not known.
- *
- * Returns : This function returns zero if successful, or -1 if an error
- *     occured.
- *
- * Error Conditions : unrecognized sonar id or mode.
- */
-
-int OPTLK gsfIsStarboardPing(const gsfRecords *data);
-/* Description : This function uses the sonar specific data union
- *     of a gsfSwathBathymetry ping structure to determine if the ping
- *     is from the starboard arrays of a multibeam installation with
- *     dual transmit receive sonar arrays.
- *
- * Inputs :
- *     data = The address of a gsfRecords data structure maintained by the
- *         caller which contains a populated gsfSwathBathyPing substructure.
- *
- * Returns : This function returns non-zero if the ping contained in the
- *     passed data represents a starboard looking ping from a dual headed
- *     sonar installation. Otherwise, zero is returned.
- *
- * Error Conditions : unrecognized sonar id or mode.
- */
-
-int OPTLK gsfLoadDepthScaleFactorAutoOffset(gsfSwathBathyPing *ping, unsigned int subrecordID, int reset, double min_depth, double max_depth, double *last_corrector, char c_flag, double precision);
-/* Description : gsfLoadDepthScaleFactorAutoOffset should be used to load
- *  the scale factors for the depth subrecords of the swath bathymetry ping
- *  record scale factor structure. The approach uses the tide and depth
- *  correction fields to help establish the offset component of the scale
- *  factor such that negative depth values may be supported.  Negative
- *  depth values may be encountered when surveying above the tidal datum.
- *  In addition, systems mounted on subsea platforms may support their
- *  native precision even in deep water.
- *
- * Inputs :
- *  ping = A pointer to the gsfSwathBathyPing which contains the depht
- *      and tide correction values, and the scale factors data structure.
- *  subrecordID = the subrecord id for the beam array data.  This must be
- *      either GSF_SWATH_BATHY_SUBRECORD_DEPTH_ARRAY, or
- *      GSF_SWATH_BATHY_SUBRECORD_NOMINAL_DEPTH_ARRAY
- *  c_flag = The compression flag for the beam array
- *  precision = The presision to which the beam array data are to be stored
- *      (a value of 0.1 would indicate decimeter precision for depth)
- *  reset = An integer value which will cause the internal logic to be
- *      refreshed when the value is non-zero.  The first call to this function
- *      should use a non-zero reset, from then on, this value may be passed
- *      as zero.
- *  last_corrector = The address of a double value stored as permanent memory.
- *      Successive calls to this function must pass the same address for this
- *      argument.
- *
- * Returns :
- *  This function returns zero if successful, or -1 if an error occured.
- *
- * Error Conditions :
- *    GSF_TOO_MANY_ARRAY_SUBRECORDS
- *
- */
-
-int OPTLK gsfGetSwathBathyArrayMinMax(const gsfSwathBathyPing *ping, unsigned int subrecordID, double *min_value, double *max_value);
-/* Description : This function may be used to obtain the minimum and maximum
- *  supportable values for each of the swath bathymetry arrays.  The minimum
- *  and maximum values are determined based on the scale factors and the array
- *  type.
- *
- * Inputs :
- *  ping = A pointer to the gsfSwathBathyPing which contains the depht
- *      and tide correction values, and the scale factors data structure.
- *  subrecordID = The subrecord id for the beam array data.  This must be
- *      either GSF_SWATH_BATHY_SUBRECORD_DEPTH_ARRAY, or
- *      GSF_SWATH_BATHY_SUBRECORD_NOMINAL_DEPTH_ARRAY
- *  min_value = The address of a double value allocated by the caller into
- *      which will be placed the minimum value which may be represented for
- *      this array type.
- *  max_value = The address of a double value allocated by the caller into
- *      which will be placed the maximum value which may be represented for
- *      this array type.
- *
- * Returns :
- *  This function returns zero if successful, or -1 if an error occured.
- *
- * Error Conditions :
- *    GSF_UNRECOGNIZED_ARRAY_SUBRECORD_ID
- *    GSF_ILLEGAL_SCALE_FACTOR_MULTIPLIER
- */
-
-const char *gsfGetSonarTextName(const gsfSwathBathyPing *ping);
-/* Description : This function is used to return the text of the sonar name.
- *
- * Inputs : The GSF ping
- *
- * Returns : A text string of the sensors name, or "Unknown" if the sensor id is not found
- *
- * Error Conditions : none
- */
-
-int gsfFileSupportsRecalculateXYZ(int handle, int *status);
-/* Description :
- *  This function reads the GSF file referenced by handle and determines
- *  if the file contains sufficient information to support a full recalculation
- *  of the platform relative XYZ values from raw measurements. This function
- *  rewinds the file to the first record and reads through the file looking for
- *  the information required to support a recalculation. On success, the file
- *  pointer is reset to the beginning of the file before the function returns.
- *
- * Inputs :
- *  handle = the integer handle returned from gsfOpen()
- *  status = A pointer to an integer allocated by caller into which the
- *            function result is placed. *status is assigned a value of 1
- *            if this file provides sufficient information to support full
- *            recalculation of the platform relative XYZ values, otherwise
- *            *status is assigned a value of 0.
- *
- * Returns :
- *  This function returns zero if successful, or -1 if an error occurred.
- *
- * Error Conditions : none
- *  GSF_BAD_FILE_HANDLE
- *  GSF_FILE_SEEK_ERROR
- *  GSF_FLUSH_ERROR
- *  GSF_READ_TO_END_OF_FILE
- *  GSF_READ_ERROR
- *  GSF_RECORD_SIZE_ERROR
- *  GSF_INSUFFICIENT_SIZE
- *  GSF_CHECKSUM_FAILURE
- *  GSF_UNRECOGNIZED_RECORD_ID
- *  GSF_HEADER_RECORD_DECODE_FAILED
- *  GSF_SVP_RECORD_DECODE_FAILED
- *  GSF_PROCESS_PARAM_RECORD_DECODE_FAILED
- *  GSF_SENSOR_PARAM_RECORD_DECODE_FAILED
- *  GSF_COMMENT_RECORD_DECODE_FAILED
- *  GSF_HISTORY_RECORD_DECODE_FAILED
- *  GSF_NAV_ERROR_RECORD_DECODE_FAILED
- */
-
-int gsfFileSupportsRecalculateTPU(int handle, int *status);
-/* Description :
- *  This function reads the GSF file referenced by handle and determines
- *  if the file contains sufficient information to support a recalculation
- *  of the total propagated uncertainty (TPU) estimates. This function
- *  rewinds the file to the first record and reads through the file looking for
- *  the information required to support TPU estimation. On success, the file
- *  pointer is reset to the beginning of the file before the function returns.
- *
- * Inputs :
- *  handle = the integer handle returned from gsfOpen()
- *  status = A pointer to an integer allocated by caller into which the
- *           function result is placed. *status is assigned a value of 1
- *           if this file provides sufficient information to support TPU
- *           estimation, otherwise *status is assigned a value of 0.
- *
- * Returns :
- *  This function returns zero if successful, or -1 if an error occurred.
- *
- * Error Conditions :
- *  GSF_BAD_FILE_HANDLE
- *  GSF_FILE_SEEK_ERROR
- *  GSF_FLUSH_ERROR
- *  GSF_READ_TO_END_OF_FILE
- *  GSF_READ_ERROR
- *  GSF_RECORD_SIZE_ERROR
- *  GSF_INSUFFICIENT_SIZE
- *  GSF_CHECKSUM_FAILURE
- *  GSF_UNRECOGNIZED_RECORD_ID
- *  GSF_HEADER_RECORD_DECODE_FAILED
- *  GSF_SVP_RECORD_DECODE_FAILED
- *  GSF_PROCESS_PARAM_RECORD_DECODE_FAILED
- *  GSF_SENSOR_PARAM_RECORD_DECODE_FAILED
- *  GSF_COMMENT_RECORD_DECODE_FAILED
- *  GSF_HISTORY_RECORD_DECODE_FAILED
- *  GSF_NAV_ERROR_RECORD_DECODE_FAILED
- */
-
-int gsfFileSupportsRecalculateNominalDepth(int handle, int *status);
-/* Description :
- *  This function reads the GSF file referenced by handle and determines
- *  if the file contains sufficient information to support a recalculation
- *  of the nominal depth array. This function rewinds the file to the first
- *  record and reads through the file looking for the information required
- *  to support calculation of the nominal depth values. On success, the file
- *  pointer is reset to the beginning of the file before the function returns.
- *
- * Inputs :
- *  handle = the integer handle returned from gsfOpen()
- *  status = A pointer to an integer allocated by caller into which the
- *           function result is placed. *status is assigned a value of 1
- *           if this file provides sufficient information to support
- *           nominal depth calculation, otherwise *status is assigned
- *           a value of 0.
- *
- * Returns :
- *  This function returns zero if successful, or -1 if an error occurred.
- *
- * Error Conditions :
- *  GSF_BAD_FILE_HANDLE
- *  GSF_FILE_SEEK_ERROR
- *  GSF_FLUSH_ERROR
- *  GSF_READ_TO_END_OF_FILE
- *  GSF_READ_ERROR
- *  GSF_RECORD_SIZE_ERROR
- *  GSF_INSUFFICIENT_SIZE
- *  GSF_CHECKSUM_FAILURE
- *  GSF_UNRECOGNIZED_RECORD_ID
- *  GSF_HEADER_RECORD_DECODE_FAILED
- *  GSF_SVP_RECORD_DECODE_FAILED
- *  GSF_PROCESS_PARAM_RECORD_DECODE_FAILED
- *  GSF_SENSOR_PARAM_RECORD_DECODE_FAILED
- *  GSF_COMMENT_RECORD_DECODE_FAILED
- *  GSF_HISTORY_RECORD_DECODE_FAILED
- *  GSF_NAV_ERROR_RECORD_DECODE_FAILED
- */
-
-int gsfFileContainsMBAmplitude(int handle, int *status);
-/* Function Name : gsfFileContainsMBAmplitude
- *
- * Description :
- *  This function reads the GSF file referenced by handle and determines
- *  if the file contains the average per receive beam amplitude data.
- *  This function rewinds the file to the first record and reads through
- *  the file up to and including the first ping record. If amplitude data
- *  are contained in the first ping record it is assumed that amplitude
- *  data are contained with all ping records in this file. On success,
- *  the file pointer is reset to the beginning of the file before the
- *  function returns.
- *
- * Inputs :
- *  handle = the integer handle returned from gsfOpen()
- *  status = A pointer to an integer allocated by caller into which the
- *           function result is placed. *status is assigned a value of 1
- *           if this file contains the per receive beam amplitude data,
- *           otherwise *status is assigned a value of 0.
- *
- * Returns :
- *  This function returns zero if successful, or -1 if an error occurred.
- *
- * Error Conditions :
- *  GSF_BAD_FILE_HANDLE
- *  GSF_FILE_SEEK_ERROR
- *  GSF_FLUSH_ERROR
- *  GSF_READ_TO_END_OF_FILE
- *  GSF_READ_ERROR
- *  GSF_RECORD_SIZE_ERROR
- *  GSF_INSUFFICIENT_SIZE
- *  GSF_CHECKSUM_FAILURE
- *  GSF_UNRECOGNIZED_RECORD_ID
- *  GSF_HEADER_RECORD_DECODE_FAILED
- *  GSF_SVP_RECORD_DECODE_FAILED
- *  GSF_PROCESS_PARAM_RECORD_DECODE_FAILED
- *  GSF_SENSOR_PARAM_RECORD_DECODE_FAILED
- *  GSF_COMMENT_RECORD_DECODE_FAILED
- *  GSF_HISTORY_RECORD_DECODE_FAILED
- *  GSF_NAV_ERROR_RECORD_DECODE_FAILED
- */
-
-int gsfFileContainsMBImagery(int handle, int *status);
-/* Function Name : gsfFileContainsMBImagery
- *
- * Description :
- *  This function reads the GSF file referenced by handle and determines
- *  if the file contains the per receive beam imagery time series data.
- *  This function rewinds the file to the first record and reads through
- *  the file up to and including the first ping record. If MB imagery data
- *  are contained in the first ping record it is assumed that MB imagery
- *  data are contained with all ping records in this file. On success,
- *  the file pointer is reset to the beginning of the file before the
- *  function returns.
- *
- * Inputs :
- *  handle = the integer handle returned from gsfOpen()
- *  status = A pointer to an integer allocated by caller into which the
- *           function result is placed. *status is assigned a value of 1
- *           if this file contains the per receive beam imagery time
- *           series data, otherwise *status is assigned a value of 0.
- *
- * Returns :
- *  This function returns zero if successful, or -1 if an error occurred.
- *
- * Error Conditions :
- *  GSF_BAD_FILE_HANDLE
- *  GSF_FILE_SEEK_ERROR
- *  GSF_FLUSH_ERROR
- *  GSF_READ_TO_END_OF_FILE
- *  GSF_READ_ERROR
- *  GSF_RECORD_SIZE_ERROR
- *  GSF_INSUFFICIENT_SIZE
- *  GSF_CHECKSUM_FAILURE
- *  GSF_UNRECOGNIZED_RECORD_ID
- *  GSF_HEADER_RECORD_DECODE_FAILED
- *  GSF_SVP_RECORD_DECODE_FAILED
- *  GSF_PROCESS_PARAM_RECORD_DECODE_FAILED
- *  GSF_SENSOR_PARAM_RECORD_DECODE_FAILED
- *  GSF_COMMENT_RECORD_DECODE_FAILED
- *  GSF_HISTORY_RECORD_DECODE_FAILED
- *  GSF_NAV_ERROR_RECORD_DECODE_FAILED
- */
-
-int gsfIsNewSurveyLine(int handle, const gsfRecords *rec, double azimuth_change, double *last_heading);
-/* Function Name : gsfIsNewSurveyLine
- *
- * Description : This function provides an approach for calling applications
- *  to determine if the last ping read from a GSF file is from the same survey
- *  transect line, or if the last ping is from a newly started survey line. The
- *  implementation looks for a change in platform heading to determine that the
- *  last ping read is from a new survey line. External to this function, calling
- *  applications can decide on their own if the first ping read from a newly opened
- *  GSF file should be considered to be from a new survey transect line or not.
- *  This function assumes that the GSF file is read in chronological order from
- *  the beginning of the file, file access can be either direct or sequential
- *
- * Inputs :
- *  handle         = The handle to the file as provided by gsfOpen
- *  rec            = A pointer to a gsfRecords structure containing the data from the most
- *                    recent call to gsfRead
- *  azimuth_change = The trigger value specifying the change in platform heading that
- *                    must be exceeded for a new survey transect line to be determined
- *  last_heading   = A pointer to a double allocated by the caller and into which this
- *                    function will place the heading value for each detected line. The
- *                    value must be allocated as permanent memory that persists through
- *                    all calls to this function. Startup or reset events can be handled
- *                    by the caller by placing a negative value in this memory location.
- *
- * Returns :
- *  This function returns 1 if this ping is considered to be the first ping of a new
- *   survey transect line, otherwise, 0 is returned.
- *
- * Error Conditions :
- *  none
- */
-
-void gsfInitializeMBParams (gsfMBParams *p);
-/********************************************************************
- *
- * Function Name : gsfInitializeMBParams
- *
- * Description : This function provides a way to initialize all the
- *    sonar processing parameters to "unknown"
- *
- * Inputs :
- *    p = a pointer to the gsfMBParams data structure that needs initializing
- *
- * Returns :
- *    None
- *
- * Error Conditions :
- *    None
- *
- ********************************************************************/
-
-
-int gsfStat (const char *filename, long long *sz);
-/********************************************************************
- *
- * Function Name : gsfStat
- *
- * Description : This function attempts to stat a GSF file.
- *               Supports 64 bit file size.
- *
- * Inputs :
- *  filename = a fully qualified path to the gsf file
- *  sz       = pointer to an 8 byte long long for return
- *             of the GSF file size from the stat64 system call.
- *
- * Returns :
- *  This funciton returns zero if successful, or -1 if an error occured.
- *
- * Error Conditions :
- *     GSF_FOPEN_ERROR
- *     GSF_UNRECOGNIZED_FILE
- *
- ********************************************************************/
-
-/********************************************************************
- *
- * Function Name : gsfGetPositionDestination
- *
- * Description : compute a new position from an existing one.
- *
- * Inputs : ref pos, offsets from ref (+x forward, +y starboard, + z down), ref heading (+hdg cw from north), maximum distance step.
- *
- * Returns : new position
- *
- * Error Conditions :
- *
- ********************************************************************/
-
-GSF_POSITION *gsfGetPositionDestination(GSF_POSITION gp, GSF_POSITION_OFFSETS offsets, double hdg, double dist_step);
-
-/********************************************************************
- *
- * Function Name : gsfGetPositionOffsets
- *
- * Description : compute offsets between two positions.
- *
- * Inputs : ref pos, new pos, ref heading (+hdg cw from north), maximum distance_step.
- *
- * Returns : offsets from ref (+x forward, +y starboard, + z down)
- *
- * Error Conditions :
- *
- ********************************************************************/
-
-GSF_POSITION_OFFSETS *gsfGetPositionOffsets(GSF_POSITION gp_from, GSF_POSITION gp_to, double hdg, double dist_step);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __GSF_H__ */
diff --git a/src/gsf/gsf.h.rej b/src/gsf/gsf.h.rej
deleted file mode 100644
index 98bcc43..0000000
--- a/src/gsf/gsf.h.rej
+++ /dev/null
@@ -1,65 +0,0 @@
-***************
-*** 169,174 ****
-  #define OPTLK
-  #endif
-  
-  #ifdef __cplusplus
-  extern          "C"
-  {
---- 169,187 ----
-  #define OPTLK
-  #endif
-  
-+ #ifdef WIN32
-+ #	define R_OK 04
-+ #	define W_OK 02
-+ #	define X_OK 01
-+ #	define F_OK 00
-+ #	ifndef __WINDOWS__			/* I, JL, understand nothing of this mess on the ways to detect if we are on Windows */
-+ #		define __WINDOWS__
-+ #	endif
-+ #	ifndef _WIN32
-+ #		define _WIN32
-+ #	endif
-+ #endif
-+ 
-  #ifdef __cplusplus
-  extern          "C"
-  {
-***************
-*** 2856,2863 ****
-   *
-   ********************************************************************/
-  
-  /********************************************************************
-   *
-   * Function Name : gsfGetPositionDestination
-   *
-   * Description : compute a new position from an existing one.
---- 2869,2894 ----
-   *
-   ********************************************************************/
-  
-+ int gsfSetDefaultScaleFactor(gsfSwathBathyPing *mb_ping);
-  /********************************************************************
-   *
-+  * Function Name : gsfSetDefaultScaleFactor
-+  *
-+  * Description : This function is used to estimate and set scale
-+  *               factors for a ping record
-+  *
-+  * Inputs :
-+  *    mb_ping - a pointer to a ping record.  The scale factors
-+  *              will be set in this record.
-+  *
-+  * Returns : This function returns 0.
-+  *
-+  * Error Conditions : none
-+  *
-+  ********************************************************************/
-+ 
-+ /********************************************************************
-+  *
-   * Function Name : gsfGetPositionDestination
-   *
-   * Description : compute a new position from an existing one.
diff --git a/src/gsf/gsf_dec.c b/src/gsf/gsf_dec.c
deleted file mode 100644
index d112928..0000000
--- a/src/gsf/gsf_dec.c
+++ /dev/null
@@ -1,7891 +0,0 @@
-/********************************************************************
- *
- * Module Name : GSF_DEC.C
- *
- * Author/Date : J. S. Byrne / 3 May 1994
- *
- * Description :
- *  This source file contains the gsf functions for dencoding a gsf byte
- *   stream given host data structures containing the data in engineering
- *   units.  Refer to gsf.h for a definition of the structures describing
- *   the internal form of the data.
- *
- * Restrictions/Limitations :
- * 1) This library assumes the host computer uses the ASCII character set.
- * 2) This library assumes that the data types u_short and u_int are defined
- *    on the host machine, where a u_short is a 16 bit unsigned integer, and
- *    a u_int is a 32 bit unsigned integer.
- * 3) This library assumes that the type short is 16 bits, and that
- *    the type int is 32 bits.
- *
- *
- * Change Descriptions :
- * who          when      what
- * ---          ----      ----
- * jsb          10-17-94  Added support for Reson SeaBat data
- * jsb          03-10-95  Modified the ping record structure to contain
- *                        dynamic depth corrector and tide corrector.
- * jsb          09-21-95  Modified so that the scale factor offset is
- *                        subtracted on decode.
- * jsb          11-13-95  Added unique subrecord id for EM1000
- * jsb          03-04-96  Fixed memset bug in DecodeSVP
- * hem          08-20-96  Added gsfDecodeSinglebeam, DecodeSASSSpecific,
- *                        DecodeTypeIIISeaBeamSpecific, DecodeEchotracSpecific,
- *                        DecodeMGD77Specific, DecodeBDBSpecific,
- *                        DecodeNOSHDBSpecific; fixed decoding of SVP latitudes
- *                        and longitudes to use signed values; added skipping
- *                        of unknown subrecords; added code to extract
- *                        sensor id's even if the subrecord has 0 length.
- * jsb          09-27-96  Added support for SeaBeam with amplitude data
- * jsb          03/24/97  Added gsfSeaBatIISpecific data structure to replace
- *                        the gsfSeaBatSpecific data structure, for the Reson 900x
- *                        series sonar systems.  Also added gsfSeaBat8101Specific
- *                        data structure for the Reson 8101 series sonar system.
- * bac          10/27/97  Added DecodeSeaBeam2112Specific to support the Sea Beam
- *                        2112/36 sonar.
- * dwc          1/9/98    Added DecodeElacMkIISpecific to support the Elac
- *                        Bottomchart MkII sonar.
- * jsb          09/28/98  Added gsfDecodeHVNavigationError. This addresses CRs:
- *                        98-001 and 98-002. In responce to NAVO CR: 98-003, added
- *                        support for horizontal_error ping array subrecord.
- * jsb          12/29/98  Added support for Simrad em3000 series sonar systems.
- * wkm          3-30-99   Added DecodeCmpSassSpecific to deal with Compressed SASS data.
- * wkm          8-02-99   Updated DecodeCmpSassSpecific to include lntens (heave) with Compressed SASS data.
- * bac          10-24-00  Updated DecodeEM3Specific to include data fields from updated
- *                        EM series runtime parameter datagram.
- * bac          07-18-01  Added support for the Reson 8100 series of sonars.  Also removed the useage
- *                        of C++ reserved words "class" and "operator".
- * bac          10-12-01  Added a new attitude record definition.  The attitude record provides
- *                        a method for logging full time-series attitude measurements in the GSF
- *                        file, instead of attitude samples only at ping time.  Each attitude
- *                        record contains arrays of attitude measurements for time, roll, pitch,
- *                        heave and heading.  The number of measurements is user-definable, but
- *                        because of the way in which measurement times are stored, a single
- *                        attitude record should never contain more than sixty seconds worth of
- *                        data.
- * jsb          01-16-02  Added support for Simrad EM120, and removed defitions for unused variables.
- * bac          06-19-03  Added support for bathymetric receive beam time series intensity data (i.e., Simrad
- *                        "Seabed image" and Reson "snippets").  Inlcluded RWL updates of 12-19-02 for adding
- *                        sensor-specific singlebeam information to the MB sensor specific subrecords.
- * bac          12-28-04  Added support for Navisound singlebeam, EM3000D, EM3002, and EM3002D.  Fixed
- *                        decoding of 1-byte BRB intensity values.  Corrected the decode of Reson
- *                        projector angle.  Added beam_spacing to the gsfReson8100Specific subrecord.
- *                        Updated gsfDecodeSensorParameters and gsfDecodeProcessingParameters to save
- *                        number_parameters correctly in the GSF_FILE_TABLE structure.
- * bac          06-28-06  Added support for EM121A data received via Kongsberg SIS, mapped to existing
- *                        EM3 series sensor specific data structure. Changed all casts to type long to
- *                        casts to type int, for compilation on 64-bit architectures.
- * dhg          10-24-06  Added support for GeoSwathPlus interferometric sonar
- * dhg          11-01-06  Corrected "model_number" and "frequency" for "GeoSwathPlusSpecific" record
- * mab          02-01-09  Updates to support Reson 7125. Added new subrecord IDs and subrecord definitions for Kongsberg
- *                        sonar systems where TWTT and angle are populated from raw range and beam angle datagram. Added
- *                        new subrecord definition for EM2000.  Bug fixes in gsfOpen and gsfPercent.
- * clb          02-25-11  Changed the DecodeBRBIntensity function when bits_per_sample is 12
- * clb          04-06-11  Changes made for DeltaT
- * clb          05-13-11  when decoding a ping, reject it if number of beams <= 0
- * clb          06-21-11  implemented DecodeEM12Specific() function
- * clb          09-20-11  added support for R2Sonic
- * jcd          02-17-12  fixed DecodeQualityFlagsArray to work with num_beams not evenly divisible by 4
- *
- * Classification : Unclassified
- *
- * References : DoDBL Generic Sensor Format Sept. 30, 1993
- *
- *
- * copyright 2014 Leidos, Inc.
- * There is no charge to use the library, and it may be accessed at:
- * https://www.leidos.com/maritime/gsf.
- * This library may be redistributed and/or modified under the terms of
- * the GNU Lesser General Public License version 2.1, as published by the
- * Free Software Foundation.  A copy of the LGPL 2.1 license is included with
- * the GSF distribution and is avaialbe at: http://opensource.org/licenses/LGPL-2.1.
- *
- * Leidos, Inc. configuration manages GSF, and provides GSF releases. Users are
- * strongly encouraged to communicate change requests and change proposals to Leidos, Inc.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE.
- *
- ********************************************************************/
-
-/* standard c library includes */
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-
-/* rely on the network type definitions of (u_short, and u_int) */
-#include <sys/types.h>
-#if !defined WIN32 && !defined WIN64
-#include <netinet/in.h>
-#else
-#include <winsock.h>
-#endif
-
-/* gsf library interface description */
-#include "gsf.h"
-#include "gsf_enc.h"
-#include "gsf_dec.h"
-
-/* Macro definitions for this file */
-#define RESON_MASK1 192
-#define RESON_MASK2  48
-#define RESON_MASK3  12
-#define RESON_MASK4   3
-
-/* Global static data for this module */
-/* Arrays have last number beams stored at [fileHandle][index=record ID-1] */
-static short    arraySize[GSF_MAX_OPEN_FILES][GSF_MAX_PING_ARRAY_SUBRECORDS];
-
-/* Arrays have last number samples per beam stored at [fileHandle][index=record ID-1] */
-static short   *samplesArraySize[GSF_MAX_OPEN_FILES];
-
-/* Global external data defined in this module */
-extern int      gsfError;                               /* defined in gsf.c */
-
-/* Function prototypes for this file */
-static int      DecodeScaleFactors(gsfScaleFactors *sf, unsigned char *ptr);
-static int      DecodeTwoByteArray(double **array, unsigned char *ptr, int num_beams, gsfScaleFactors * sf, int id, int handle);
-static int      DecodeSignedTwoByteArray(double **array, char *ptr, int num_beams, gsfScaleFactors * sf, int id, int handle);
-static int      DecodeFourByteArray(double **array, unsigned char *sptr, int num_beams, gsfScaleFactors * sf, int id, int handle);
-static int      DecodeSignedFourByteArray(double **array, char *sptr, int num_beams, gsfScaleFactors * sf, int id, int handle);
-static int      DecodeByteArray(double **array, unsigned char *ptr, int num_beams, gsfScaleFactors * sf, int id, int handle);
-static int      DecodeSignedByteArray(double **array, char *ptr, int num_beams, gsfScaleFactors * sf, int id, int handle);
-static int      DecodeFromByteToUnsignedShortArray(unsigned short **array, unsigned char *sptr, int num_beams, gsfScaleFactors * sf, int id, int handle);
-static int      DecodeBeamFlagsArray(unsigned char **array, unsigned char *ptr, int num_beams, int handle);
-static int      DecodeQualityFlagsArray(unsigned char **array, unsigned char *ptr, int num_beams, int sr_size, int handle);
-static int      DecodeBRBIntensity(gsfBRBIntensity ** idata, unsigned char *ptr, int num_beams, int sensor_id, int handle);
-static int      DecodeSeabeamSpecific(gsfSensorSpecific * sdata, unsigned char *sptr);
-static int      DecodeEM12Specific(gsfSensorSpecific * sdata, unsigned char *sptr);
-static int      DecodeEM100Specific(gsfSensorSpecific * sdata, unsigned char *sptr);
-static int      DecodeEM950Specific(gsfSensorSpecific * sdata, unsigned char *sptr);
-static int      DecodeEM1000Specific(gsfSensorSpecific * sdata, unsigned char *sptr);
-static int      DecodeEM121ASpecific(gsfSensorSpecific * sdata, unsigned char *sptr);
-static int      DecodeEM121Specific(gsfSensorSpecific * sdata, unsigned char *sptr);
-
-#if 1
-/* 3-30-99 wkm: obsolete */
-static int      DecodeTypeIIISeaBeamSpecific(gsfSensorSpecific * sdata, unsigned char *sptr);
-static int      DecodeSASSSpecific(gsfSensorSpecific * sdata, unsigned char *sptr);
-#endif
-
-static int      DecodeCmpSassSpecific(gsfSensorSpecific * sdata, unsigned char *sptr);
-
-static int      DecodeSeaMapSpecific(gsfSensorSpecific * sdata, unsigned char *sptr, GSF_FILE_TABLE *ft);
-static int      DecodeSeaBatSpecific(gsfSensorSpecific * sdata, unsigned char *sptr);
-static int      DecodeEchotracSpecific(gsfSBSensorSpecific * sdata, unsigned char *sptr);
-static int      DecodeMGD77Specific(gsfSBSensorSpecific * sdata, unsigned char *sptr);
-static int      DecodeBDBSpecific(gsfSBSensorSpecific * sdata, unsigned char *sptr);
-static int      DecodeNOSHDBSpecific(gsfSBSensorSpecific * sdata, unsigned char *sptr);
-static int      DecodeSBAmpSpecific(gsfSensorSpecific * sdata, unsigned char *sptr);
-static int      DecodeSeaBatIISpecific(gsfSensorSpecific * sdata, unsigned char *sptr);
-static int      DecodeSeaBat8101Specific(gsfSensorSpecific * sdata, unsigned char *sptr);
-static int      DecodeSeaBeam2112Specific(gsfSensorSpecific * sdata, unsigned char *sptr);
-static int      DecodeElacMkIISpecific(gsfSensorSpecific * sdata, unsigned char *sptr);
-static int      DecodeEM3Specific(gsfSensorSpecific *sdata, unsigned char *sptr, GSF_FILE_TABLE *ft);
-static int      DecodeEM3RawSpecific(gsfSensorSpecific *sdata, unsigned char *sptr, GSF_FILE_TABLE *ft);
-static int      DecodeReson8100Specific(gsfSensorSpecific * sdata, unsigned char *sptr);
-static int      DecodeReson7100Specific(gsfSensorSpecific * sdata, unsigned char *sptr);
-static int      DecodeSBEchotracSpecific(t_gsfSBEchotracSpecific * sdata, unsigned char *sptr);
-static int      DecodeSBMGD77Specific(t_gsfSBMGD77Specific * sdata, unsigned char *sptr);
-static int      DecodeSBBDBSpecific(t_gsfSBBDBSpecific * sdata, unsigned char *sptr);
-static int      DecodeSBNOSHDBSpecific(t_gsfSBNOSHDBSpecific * sdata, unsigned char *sptr);
-static int      DecodeSBNavisoundSpecific(t_gsfSBNavisoundSpecific * sdata, unsigned char *sptr);
-static int      DecodeEM4Specific(gsfSensorSpecific *sdata, unsigned char *sptr, GSF_FILE_TABLE *ft);
-static int      DecodeGeoSwathPlusSpecific(gsfSensorSpecific *sdata, unsigned char *sptr);
-static int      DecodeEM3ImagerySpecific(gsfSensorImagery *sdata, unsigned char *sptr);
-static int      DecodeEM4ImagerySpecific(gsfSensorImagery *sdata, unsigned char *sptr);
-static int      DecodeReson7100ImagerySpecific(gsfSensorImagery *sdata, unsigned char *sptr);
-static int      DecodeKlein5410BssSpecific(gsfSensorSpecific *sdata, unsigned char *sptr);
-static int      DecodeDeltaTSpecific(gsfSensorSpecific *sdata, unsigned char *sptr);
-static int      DecodeR2SonicSpecific(gsfSensorSpecific *sdata, unsigned char *sptr);
-static int      DecodeR2SonicImagerySpecific(gsfSensorImagery *sdata, unsigned char *sptr);
-
-/********************************************************************
- *
- * Function Name : gsfDecodeHeader
- *
- * Description :
- *  This function decodes a gsf header data record from external to internal
- *  form.
- *
- * Inputs :
- *  header = a pointer to a gsfHeader structure to be populated
- *  sptr = a pointer to the gsf byte stream containing the header record.
- *
- * Returns :
- *  This function returns the number of bytes decoded if successful, or
- *  -1 if an error occured.
- *
- * Error Conditions :
- *    none
- *
- ********************************************************************/
-int
-gsfDecodeHeader(gsfHeader * header, unsigned char *sptr)
-{
-    memset(header->version, 0, sizeof(gsfHeader));
-    memcpy(header->version, sptr, sizeof(header->version));
-
-    return ((int) strlen(header->version));
-}
-
-/********************************************************************
- *
- * Function Name : gsfDecodeSwathBathySummary
- *
- * Description :
- *  This function decodes a gsf swath bathymetry summary data record from
- *   external to internal form.
- *
- * Inputs :
- *  header = a pointer to a gsfSwathBathySummary structure to be populated
- *  sptr = a pointer to the gsf byte stream containing the header record.
- *
- * Returns :
- *  This function returns the number of bytes decoded if successful, or
- *  -1 if an error occured.
- *
- * Error Conditions :
- *    none
- *
- ********************************************************************/
-int
-gsfDecodeSwathBathySummary(gsfSwathBathySummary *sum, unsigned char *sptr)
-{
-    gsfuLong        ltemp;
-    unsigned char  *p = sptr;
-    gsfsLong        signed_int;
-
-    /* First 8 bytes contain the time of the first ping in this file */
-    memcpy(&ltemp, p, 4);
-    sum->start_time.tv_sec = ntohl(ltemp);
-    p += 4;
-
-    memcpy(&ltemp, p, 4);
-    sum->start_time.tv_nsec = ntohl(ltemp);
-    p += 4;
-
-    /* Next 8 bytes contain the time of the last ping in this file */
-    memcpy(&ltemp, p, 4);
-    sum->end_time.tv_sec = ntohl(ltemp);
-    p += 4;
-
-    memcpy(&ltemp, p, 4);
-    sum->end_time.tv_nsec = ntohl(ltemp);
-    p += 4;
-
-    /* Next four byte integer contains the minimum latitude */
-    memcpy(&ltemp, p, 4);
-    signed_int = (signed) ntohl(ltemp);
-    sum->min_latitude = ((double) signed_int) / 1.0e7;
-    p += 4;
-
-    /* Next four byte integer contains the minimum longitude */
-    memcpy(&ltemp, p, 4);
-    signed_int = (signed) ntohl(ltemp);
-    sum->min_longitude = ((double) signed_int) / 1.0e7;
-    p += 4;
-
-    /* Next four byte integer contains the maximum latitude */
-    memcpy(&ltemp, p, 4);
-    signed_int = (signed) ntohl(ltemp);
-    sum->max_latitude = ((double) signed_int) / 1.0e7;
-    p += 4;
-
-    /* Next four byte integer contains the maximum longitude */
-    memcpy(&ltemp, p, 4);
-    signed_int = (signed) ntohl(ltemp);
-    sum->max_longitude = ((double) signed_int) / 1.0e7;
-    p += 4;
-
-    /* Next four bytes contains the minimum depth */
-    memcpy(&signed_int, p, 4);
-    sum->min_depth = (signed int)ntohl(signed_int) / 100.0;
-    p += 4;
-
-    /* Next four bytes contains the maximum depth */
-    memcpy(&signed_int, p, 4);
-    sum->max_depth = ntohl(signed_int) / 100.0;
-    p += 4;
-
-    return (p - sptr);
-}
-
-/********************************************************************
- *
- * Function Name : DecodeEchotracSpecific
- *
- * Description :
- *  This function decodes the Bathy2000 and Echotrac sensor specific
- *  data.
- *
- * Inputs :
- *    sdata = a pointer to the union of sensor specific data to be loaded
- *    sptr = a pointer to an unsigned char buffer containing the byte stream
- *           to read.
- *
- * Returns : This function returns the number of bytes decoded.
- *
- * Error Conditions : none
- *
- ********************************************************************/
-
-static int
-DecodeEchotracSpecific(gsfSBSensorSpecific * sdata, unsigned char *sptr)
-{
-    unsigned char  *p = sptr;
-    gsfuShort       stemp;
-
-    /* First two byte integer contains the navigation error */
-    memcpy(&stemp, p, 2);
-    sdata->gsfEchotracSpecific.navigation_error = (int) ntohs(stemp);
-    p += 2;
-
-    /* Next byte contains the most probable position source navigation */
-    sdata->gsfEchotracSpecific.mpp_source = (int) *p;
-    p += 1;
-
-    /* Next byte contains the tide source */
-    sdata->gsfEchotracSpecific.tide_source = (int) *p;
-    p += 1;
-
-    return (p - sptr);
-}
-
-/********************************************************************
- *
- * Function Name : DecodeMGD77Specific
- *
- * Description :
- *  This function decodes the MGD77 fields.  The MGD77 is essentially
- *  survey trackline data, and actual survey data can be retrieved
- *  from the source.
- *
- * Inputs :
- *    sdata = a pointer to the union of sensor specific data to be loaded
- *    sptr = a pointer to an unsigned char buffer containing the byte stream
- *           to read.
- *
- * Returns : This function returns the number of bytes decoded.
- *
- * Error Conditions : none
- *
- ********************************************************************/
-
-static int
-DecodeMGD77Specific(gsfSBSensorSpecific * sdata, unsigned char *sptr)
-{
-    unsigned char  *p = sptr;
-    gsfuLong        ltemp;
-    gsfuShort       stemp;
-
-    /* First two byte integer contains the time zone correction */
-    memcpy(&stemp, p, 2);
-    sdata->gsfMGD77Specific.time_zone_corr = (int) ntohs(stemp);
-    p += 2;
-
-    /* The next two byte integer contains how the navigation was obtained */
-    memcpy(&stemp, p, 2);
-    sdata->gsfMGD77Specific.position_type_code = (int) ntohs(stemp);
-    p += 2;
-
-    /* The next two byte integer contains how the sound velocity
-       correction was made */
-    memcpy(&stemp, p, 2);
-    sdata->gsfMGD77Specific.correction_code = (int) ntohs(stemp);
-    p += 2;
-
-    /* The next two byte integer contains how the bathymetry was obtained */
-    memcpy(&stemp, p, 2);
-    sdata->gsfMGD77Specific.bathy_type_code = (int) ntohs(stemp);
-    p += 2;
-
-    /* The next two byte integer contains the quality code for nav */
-    memcpy(&stemp, p, 2);
-    sdata->gsfMGD77Specific.quality_code = (int) ntohs(stemp);
-    p += 2;
-
-    /* The next four byte integer contains the two way travel time */
-    memcpy(&ltemp, p, 4);
-    sdata->gsfMGD77Specific.travel_time = (double) (ntohl(ltemp)) / 10000.0;
-    p += 4;
-
-    return (p - sptr);
-}
-
-/********************************************************************
- *
- * Function Name : DecodeBDBSpecific
- *
- * Description :
- *  This function decodes the BDB fields.  The BDB is essentially
- *  survey trackline data.
- *
- * Inputs :
- *    sdata = a pointer to the union of sensor specific data to be loaded
- *    sptr = a pointer to an unsigned char buffer containing the byte stream
- *           to read.
- *
- * Returns : This function returns the number of bytes decoded.
- *
- * Error Conditions : none
- *
- ********************************************************************/
-
-static int
-DecodeBDBSpecific(gsfSBSensorSpecific * sdata, unsigned char *sptr)
-{
-    unsigned char  *p = sptr;
-    gsfuLong        ltemp;
-
-    /* The next four byte integer contains the two way travel time */
-    memcpy(&ltemp, p, 4);
-    sdata->gsfBDBSpecific.doc_no = (int) (ntohl(ltemp));
-    p += 4;
-
-    /* Next byte contains the evaluation flag */
-    sdata->gsfBDBSpecific.eval = (char) *p;
-    p += 1;
-
-    /* Next byte contains the classification flag */
-    sdata->gsfBDBSpecific.classification = (char) *p;
-    p += 1;
-
-    /* Next byte contains the track adjustment flag */
-    sdata->gsfBDBSpecific.track_adj_flag = (char) *p;
-    p += 1;
-
-    /* Next byte contains the source flag */
-    sdata->gsfBDBSpecific.source_flag = (char) *p;
-    p += 1;
-
-    /* Next byte contains the discrete point or track line flag */
-    sdata->gsfBDBSpecific.pt_or_track_ln = (char) *p;
-    p += 1;
-
-    /* Next byte contains the datum flag */
-    sdata->gsfBDBSpecific.datum_flag = (char) *p;
-    p += 1;
-
-    return (p - sptr);
-}
-
-/********************************************************************
- *
- * Function Name : DecodeNOSHDBSpecific
- *
- * Description :
- *  This function decodes the NOSHDB fields.  The NOSHDB is essentially
- *  survey trackline data.
- *
- * Inputs :
- *    sdata = a pointer to the union of sensor specific data to be loaded
- *    sptr = a pointer to an unsigned char buffer containing the byte stream
- *           to read.
- *
- * Returns : This function returns the number of bytes decoded.
- *
- * Error Conditions : none
- *
- ********************************************************************/
-
-static int
-DecodeNOSHDBSpecific(gsfSBSensorSpecific * sdata, unsigned char *sptr)
-{
-    unsigned char  *p = sptr;
-    gsfuShort       stemp;
-
-    /* First two byte integer contains the depth type code */
-    memcpy(&stemp, p, 2);
-    sdata->gsfNOSHDBSpecific.type_code = (int) ntohs(stemp);
-    p += 2;
-
-    /* The next two byte integer contains the cartographic code */
-    memcpy(&stemp, p, 2);
-    sdata->gsfNOSHDBSpecific.carto_code = (int) ntohs(stemp);
-    p += 2;
-
-    return (p - sptr);
-}
-
-/********************************************************************
- *
- * Function Name : gsfDecodeSinglebeam
- *
- * Description : This function decodes a gsf single beam ping record
- *  from external byte stream form to internal form.
- *
- * Inputs :
- *   ping = a pointer to the single beam ping structure to be populated
- *   sptr = a pointer to the gsf byte stream contain the ping record
- *   ft = a pointer to the GSF_FILE_TABLE entry for the data file being decoded
- *   handle = the handle to the gsf data file (used to track number beams)
- *   record_size = the number of bytes which ping byte stream occupies.
- *
- * Returns :
- *  This function returns the number of bytes decoded if successful, or
- *  -1 if an error occured.
- *
- * Error Conditions :
- *    GSF_UNRECOGNIZED_SENSOR_ID
- *
- ********************************************************************/
-int
-gsfDecodeSinglebeam(gsfSingleBeamPing * ping, unsigned char *sptr, GSF_FILE_TABLE *ft, int handle, int record_size)
-{
-    gsfuLong        ltemp;
-    int             subrecord_size;
-    int             subrecord_id;
-    gsfsShort       signed_short;
-    gsfsLong        signed_int;
-    gsfuShort       stemp;
-    int             bytes;
-    unsigned char  *p = sptr;
-
-    /* First 8 bytes contain the time */
-    memcpy(&ltemp, p, 4);
-    ping->ping_time.tv_sec = ntohl(ltemp);
-    p += 4;
-
-    memcpy(&ltemp, p, 4);
-    ping->ping_time.tv_nsec = ntohl(ltemp);
-    p += 4;
-
-    /* Next four byte integer contains the longitude */
-    memcpy(&ltemp, p, 4);
-    signed_int = (signed) ntohl(ltemp);
-    ping->longitude = ((double) signed_int) / 1.0e7;
-    p += 4;
-
-    /* Next four byte integer contains the latitude */
-    memcpy(&ltemp, p, 4);
-    signed_int = (signed) ntohl(ltemp);
-    ping->latitude = ((double) signed_int) / 1.0e7;
-    p += 4;
-
-    /* Next two byte integer contains the tide corrector for this ping. */
-    memcpy(&stemp, p, 2);
-    signed_short = (signed) ntohs(stemp);
-    ping->tide_corrector = ((double) signed_short) / 100.0;
-    p += 2;
-
-    /* Next four byte integer contains the depth corrector. */
-    memcpy(&ltemp, p, 4);
-    signed_int = (signed) ntohl(ltemp);
-    ping->depth_corrector = ((double) signed_int) / 100.0;
-    p += 4;
-
-    /* Next two byte integer contains the ship heading */
-    memcpy(&stemp, p, 2);
-    ping->heading = ((double) ntohs(stemp)) / 100.0;
-    p += 2;
-
-    /* Next two byte integer contains the pitch */
-    memcpy(&stemp, p, 2);
-    signed_short = (signed) ntohs(stemp);
-    ping->pitch = ((double) signed_short) / 100.0;
-    p += 2;
-
-    /* Next two byte integer contains the roll */
-    memcpy(&stemp, p, 2);
-    signed_short = (signed) ntohs(stemp);
-    ping->roll = ((double) signed_short) / 100.0;
-    p += 2;
-
-    /* Next two byte integer contains the heave */
-    memcpy(&stemp, p, 2);
-    signed_short = (signed) ntohs(stemp);
-    ping->heave = ((double) signed_short) / 100.0;
-    p += 2;
-
-    /* Next four byte integer contains the depth */
-    memcpy(&ltemp, p, 4);
-    signed_int = (signed) ntohl(ltemp);
-    ping->depth = ((double) signed_int) / 100.0;
-    p += 4;
-
-    /* Next two byte integer contains the sound speed correction */
-    memcpy(&stemp, p, 2);
-    signed_short = (signed) ntohs(stemp);
-    ping->sound_speed_correction = ((double) signed_short) / 100.0;
-    p += 2;
-
-    /* Next byte contains the positioning system type */
-    memcpy(&stemp, p, 2);
-    ping->positioning_system_type = (unsigned) ntohs(stemp);
-    p += 2;
-
-    /* Determine which subrecord we have, and then decode it.
-     * (Size may have been padded out to a four byte boundary.) */
-    bytes = p - sptr;
-    while ((record_size - bytes) > 4)
-    {
-        /* First four byte integer in subrecord contains the subrecord
-        *  size and subrecord identifier.
-        */
-        memcpy(&ltemp, p, 4);
-        p += 4;
-        ltemp = ntohl(ltemp);
-        subrecord_id = (ltemp & 0xFF000000) >> 24;
-        subrecord_size = ltemp & 0x00FFFFFF;
-
-       switch (subrecord_id)
-       {
-          case (GSF_SINGLE_BEAM_SUBRECORD_ECHOTRAC_SPECIFIC):
-             p += DecodeEchotracSpecific(&ping->sensor_data, p);
-             ping->sensor_id = GSF_SINGLE_BEAM_SUBRECORD_ECHOTRAC_SPECIFIC;
-          break;
-
-          case (GSF_SINGLE_BEAM_SUBRECORD_BATHY2000_SPECIFIC):
-             p += DecodeEchotracSpecific(&ping->sensor_data, p);
-             ping->sensor_id = GSF_SINGLE_BEAM_SUBRECORD_BATHY2000_SPECIFIC;
-
-          break;
-
-          case (GSF_SINGLE_BEAM_SUBRECORD_MGD77_SPECIFIC):
-             p += DecodeMGD77Specific (&ping->sensor_data, p);
-             ping->sensor_id = GSF_SINGLE_BEAM_SUBRECORD_MGD77_SPECIFIC;
-          break;
-
-          case (GSF_SINGLE_BEAM_SUBRECORD_BDB_SPECIFIC):
-             p += DecodeBDBSpecific (&ping->sensor_data, p);
-             ping->sensor_id = GSF_SINGLE_BEAM_SUBRECORD_BDB_SPECIFIC;
-          break;
-
-          case (GSF_SINGLE_BEAM_SUBRECORD_NOSHDB_SPECIFIC):
-             p += DecodeNOSHDBSpecific (&ping->sensor_data, p);
-             ping->sensor_id = GSF_SINGLE_BEAM_SUBRECORD_NOSHDB_SPECIFIC;
-          break;
-
-          case (GSF_SWATH_BATHY_SUBRECORD_UNKNOWN):
-            ping->sensor_id =  GSF_SWATH_BATHY_SUBRECORD_UNKNOWN;
-          break;
-
-          default:
-            gsfError = GSF_UNRECOGNIZED_SUBRECORD_ID;
-            if ((((p - sptr) + subrecord_size) == record_size) ||
-                ((record_size - ((p - sptr) + subrecord_size)) > 0))
-              p+=subrecord_size;
-            else
-              return (-1);
-            break;
-       }
-       bytes = p - sptr;
-    }
-
-    /*  Extract subrecord id if the subrecord size is 0 */
-    if (((record_size - bytes) == 4) && (ping->sensor_id != subrecord_id))
-    {
-        /* First four byte integer in subrecord contains the subrecord
-        *  size and subrecord identifier.
-        */
-        memcpy(&ltemp, p, 4);
-        p += 4;
-        ltemp = ntohl(ltemp);
-        subrecord_id = (ltemp & 0xFF000000) >> 24;
-        subrecord_size = ltemp & 0x00FFFFFF;
-
-        ping->sensor_id = subrecord_id;
-    }
-
-    /* Return the number of byte written into the buffer */
-    return (p - sptr);
-}
-
-/********************************************************************
- *
- * Function Name : gsfDecodeSwathBathymetryPing
- *
- * Description :
- *  This function decodes a gsf swath bathymetry ping record from external
- *  to internal form.
- *
- * Inputs :
- *   ping = a pointer to the swath bathymetry ping structure to be populated
- *   sptr = a pointer to the gsf byte stream contain the ping record
- *   ft = a pointer to the GSF_FILE_TABLE entry for the data file being decoded
- *   handle = the handle to the gsf data file (used to track number beams)
- *   record_size = the number of bytes which ping byte stream occupies.
- *
- * Returns :
- *  This function returns the number of bytes decoded if successful, or
- *  -1 if an error occured.
- *
- * Error Conditions :
- *   GSF_UNRECOGNIZED_SUBRECORD_ID
- *
- ********************************************************************/
-int
-gsfDecodeSwathBathymetryPing(gsfSwathBathyPing *ping, unsigned char *sptr, GSF_FILE_TABLE *ft, int handle, int record_size)
-{
-    gsfuLong        ltemp;
-    int             subrecord_size;
-    int             subrecord_id;
-    gsfsShort       signed_short;
-    gsfsLong        signed_int;
-    gsfuShort       stemp;
-    int             ret;
-    int             bytes;
-    int             i;
-    unsigned char  *p = sptr;
-
-    /* First 8 bytes contain the time */
-    memcpy(&ltemp, p, 4);
-    ping->ping_time.tv_sec = ntohl(ltemp);
-    p += 4;
-
-    memcpy(&ltemp, p, 4);
-    ping->ping_time.tv_nsec = ntohl(ltemp);
-    p += 4;
-
-    /* Next four byte integer contains the longitude */
-    memcpy(&ltemp, p, 4);
-    signed_int = (signed) ntohl(ltemp);
-    ping->longitude = ((double) signed_int) / 1.0e7;
-    p += 4;
-
-    /* Next four byte integer contains the latitude */
-    memcpy(&ltemp, p, 4);
-    signed_int = (signed) ntohl(ltemp);
-    ping->latitude = ((double) signed_int) / 1.0e7;
-    p += 4;
-
-    /* Next two byte integer contains the number of beams */
-    memcpy(&stemp, p, 2);
-    ping->number_beams = ntohs(stemp);
-    p += 2;
-    if (ping->number_beams <= 0)
-    {
-        gsfError = GSF_INVALID_NUM_BEAMS;
-        return(-1);
-    }
-
-    /* Next two byte integer contains the center beam number, portmost
-    *  outer beam is beam number 0.
-    */
-    memcpy(&stemp, p, 2);
-    ping->center_beam = ntohs(stemp);
-    p += 2;
-
-    /* Next two byte integer contains the ping flags field */
-    memcpy(&stemp, p, 2);
-    ping->ping_flags = ntohs(stemp);
-    p += 2;
-
-    /* Next two byte integer is a reserved field */
-    memcpy(&stemp, p, 2);
-    ping->reserved = ntohs(stemp);
-    p += 2;
-
-    /* Next two byte integer contains the tide corrector for this ping */
-    memcpy(&stemp, p, 2);
-    signed_short = (signed) ntohs(stemp);
-    ping->tide_corrector = ((double) signed_short) / 100.0;
-    p += 2;
-
-    /* Next four byte integer contains the depth corrector for this ping */
-    memcpy(&ltemp, p, 4);
-    signed_int = (signed) ntohl(ltemp);
-    ping->depth_corrector = ((double) signed_int) / 100.0;
-    p += 4;
-
-    /* Next two byte integer contains the ship heading */
-    memcpy(&stemp, p, 2);
-    ping->heading = ((double) ntohs(stemp)) / 100.0;
-    p += 2;
-
-    /* Next two byte integer contains the pitch */
-    memcpy(&stemp, p, 2);
-    signed_short = (signed) ntohs(stemp);
-    ping->pitch = ((double) signed_short) / 100.0;
-    p += 2;
-
-    /* Next two byte integer contains the roll */
-    memcpy(&stemp, p, 2);
-    signed_short = (signed) ntohs(stemp);
-    ping->roll = ((double) signed_short) / 100.0;
-    p += 2;
-
-    /* Next two byte integer contains the heave */
-    memcpy(&stemp, p, 2);
-    signed_short = (signed) ntohs(stemp);
-    ping->heave = ((double) signed_short) / 100.0;
-    p += 2;
-
-    /* Next two byte integer contains the course */
-    memcpy(&stemp, p, 2);
-    ping->course = ((double) ntohs(stemp)) / 100.0;
-    p += 2;
-
-    /* Next two byte integer contains the speed */
-    memcpy(&stemp, p, 2);
-    ping->speed = ((double) ntohs(stemp)) / 100.0;
-    p += 2;
-
-    if (ft->major_version_number > 2)
-    {
-        /* Next four byte integer contains the height */
-        memcpy(&ltemp, p, 4);
-        signed_int = (signed) ntohl(ltemp);
-        ping->height = ((double) signed_int) / 1000.0;
-        p += 4;
-
-        /* Next four byte integer contains the SEP */
-        memcpy(&ltemp, p, 4);
-        signed_int = (signed) ntohl(ltemp);
-        ping->sep = ((double) signed_int) / 1000.0;
-        p += 4;
-
-        /* Next four byte integer contains the tide corrector for this ping. */
-        memcpy(&ltemp, p, 4);
-        signed_int = (signed) ntohl(ltemp);
-        ping->gps_tide_corrector = ((double) signed_int) / 1000.0;
-        p += 4;
-
-        /* Next two bytes are spare space */
-        p += 2;
-    }
-    else
-    {
-        ping->height = GSF_NULL_HEIGHT;
-        ping->sep = GSF_NULL_SEP;
-        ping->gps_tide_corrector = GSF_NULL_TIDE_CORRECTOR;
-    }
-
-    /* Set the caller's array pointers to NULL to guarrantee that non
-     * NULL pointers define the array data for this file.
-     */
-    ping->depth = (double *) NULL;
-    ping->nominal_depth = (double *) NULL;
-    ping->across_track = (double *) NULL;
-    ping->along_track = (double *) NULL;
-    ping->travel_time = (double *) NULL;
-    ping->beam_angle = (double *) NULL;
-    ping->mc_amplitude = (double *) NULL;
-    ping->mr_amplitude = (double *) NULL;
-    ping->echo_width = (double *) NULL;
-    ping->quality_factor = (double *) NULL;
-    ping->receive_heave = (double *) NULL;
-    ping->depth_error = (double *) NULL;
-    ping->across_track_error = (double *) NULL;
-    ping->along_track_error = (double *) NULL;
-    ping->quality_flags = (unsigned char *) NULL;
-    ping->beam_flags = (unsigned char *) NULL;
-    ping->signal_to_noise = (double *) NULL;
-    ping->beam_angle_forward = (double *) NULL;
-    ping->vertical_error = (double *) NULL;
-    ping->horizontal_error = (double *) NULL;
-    ping->sector_number = (unsigned short *) NULL;
-    ping->detection_info = (unsigned short *) NULL;
-    ping->incident_beam_adj = (double *) NULL;
-    ping->system_cleaning = (unsigned short *) NULL;
-    ping->doppler_corr = (double *) NULL;
-    ping->sonar_vert_uncert = (double *) NULL;
-    ping->brb_inten = (gsfBRBIntensity *) NULL;
-
-    /* Clear the flag which indicates that we've read scale factors */
-    ft->scales_read = 0;
-
-    /* Load the caller's structure with the last scale factors for this
-     * file.  If this is the first ping of a file we can expect it to
-     * have scale factors.
-     */
-    memcpy (&ping->scaleFactors, &ft->rec.mb_ping.scaleFactors, sizeof(gsfScaleFactors));
-
-    /* Determine which subrecord(s) we have, and then decode them, until we've
-    *  read through the entire ping record. (Size may have been padded out to
-    *  a four byte boundary.)
-    */
-    bytes = p - sptr;
-    while ((record_size - bytes) > 4)
-    {
-        int bytes_per_value;
-        int field_size;
-        int next_id;
-        int next_size;
-        int sr_size;
-        int count;
-
-        /* First four byte integer in subrecord contains the subrecord
-        *  size and subrecord identifier.
-        */
-        memcpy(&ltemp, p, 4);
-        p += 4;
-        ltemp = ntohl(ltemp);
-        subrecord_id = (ltemp & 0xFF000000) >> 24;
-        subrecord_size = ltemp & 0x00FFFFFF;
-
-        bytes_per_value = subrecord_size / (int) ping->number_beams;
-        switch (bytes_per_value)
-        {
-            case 1:
-                field_size = GSF_FIELD_SIZE_ONE;
-                break;
-            case 2:
-                field_size = GSF_FIELD_SIZE_TWO;
-                break;
-            case 4:
-                field_size = GSF_FIELD_SIZE_FOUR;
-                break;
-            default:
-                field_size = (ft->rec.mb_ping.scaleFactors.scaleTable[subrecord_id - 1].compressionFlag & 0xF0);
-                break;
-        }
-
-        /* Verification check on the next sub record id and size */
-        sr_size = subrecord_size;
-        count = 0;
-        while (((record_size - bytes - sr_size) > 4) && (count <= 3))
-        {
-
-            int test_sizes[3] = {1, 2, 4};
-            int test_fs;
-
-            memcpy(&ltemp, (p + sr_size), 4);
-            ltemp = ntohl(ltemp);
-            next_id = (ltemp & 0xFF000000) >> 24;
-            next_size = ltemp & 0x00FFFFFF;
-
-            /* The test on valid IDs is limited to array sub records as these are effected by the field_size, whereas
-             *  the sensor specific subrecords are not dependent on the field size parameter.
-             */
-            if ( (next_id > 0) && (next_id <= GSF_MAX_PING_ARRAY_SUBRECORDS) &&
-                ((next_size == ping->number_beams) || (next_size == 2 * ping->number_beams) || (next_size == 4 * ping->number_beams)))
-            {
-                bytes_per_value = sr_size / (int) ping->number_beams;
-                switch (bytes_per_value)
-                {
-                    case 1:
-                        field_size = GSF_FIELD_SIZE_ONE;
-                        break;
-                    case 2:
-                        field_size = GSF_FIELD_SIZE_TWO;
-                        break;
-                    case 4:
-                        field_size = GSF_FIELD_SIZE_FOUR;
-                        break;
-                    default:
-                        field_size = (ft->rec.mb_ping.scaleFactors.scaleTable[subrecord_id - 1].compressionFlag & 0xF0);
-                        break;
-                }
-                break;
-            }
-
-            test_fs = test_sizes[count];
-            count += 1;
-            sr_size = (int) ping->number_beams * test_fs;
-        }
-
-        /* Clear the high order 4 bits of the compression flag field, then set these bits to specify the field size we have just decoded.
-         *  The field size is determined above just for the beam-array subcords. (I.E. not for the scale factor or sensor specific subrecords.)
-         */
-        if ((subrecord_id > 0) && (subrecord_id <= GSF_MAX_PING_ARRAY_SUBRECORDS))
-        {
-            ft->rec.mb_ping.scaleFactors.scaleTable[subrecord_id - 1].compressionFlag &= 0x0F;
-            ft->rec.mb_ping.scaleFactors.scaleTable[subrecord_id - 1].compressionFlag |= field_size;
-            ping->scaleFactors.scaleTable[subrecord_id - 1].compressionFlag = ft->rec.mb_ping.scaleFactors.scaleTable[subrecord_id - 1].compressionFlag;
-        }
-
-        switch (subrecord_id)
-        {
-            case (GSF_SWATH_BATHY_SUBRECORD_UNKNOWN):
-                ping->sensor_id = GSF_SWATH_BATHY_SUBRECORD_UNKNOWN;
-                break;
-
-            case (GSF_SWATH_BATHY_SUBRECORD_SCALE_FACTORS):
-                ret = DecodeScaleFactors(&ft->rec.mb_ping.scaleFactors, p);
-                if (ret < 0)
-                {
-                    return (-1);
-                }
-                ft->scales_read = 1;
-
-                /* Load the caller's structure with these scale factors */
-                memcpy (&ping->scaleFactors, &ft->rec.mb_ping.scaleFactors, sizeof(gsfScaleFactors));
-                p += ret;
-
-                /* jsb 05/14/97  Set the gsfFileTable reference of the last scale factors read to point
-                 * to this ping.  This is required for consistent tracking of scale factors.  This is
-                 * necessary for programs, such as exammb, which do mixed access (direct and sequential).
-                 * The outermost if block is necessary to protect from accessing the dynamically allocated
-                 * scale_factor_addr array prior to allocation. This memory is allocated after we have
-                 * completed the creation of the index file.
-                 */
-                if (ft->index_data.scale_factor_addr)
-                {
-                    for (i = 0; i < ft->index_data.number_of_records[0]; i++)
-                    {
-                        /* Search for the address of the ping record containing scale factors which matches
-                         * the start address of this ping record.
-                         */
-                        if (ft->previous_record == ft->index_data.scale_factor_addr[i].addr)
-                        {
-                            ft->index_data.last_scale_factor_index = i;
-                            break;
-                        }
-                    }
-                }
-                break;
-
-            case (GSF_SWATH_BATHY_SUBRECORD_DEPTH_ARRAY):
-                switch (field_size)
-                {
-                    default:
-                    case GSF_FIELD_SIZE_DEFAULT:
-                    case GSF_FIELD_SIZE_TWO:
-                        ret = DecodeTwoByteArray(&ft->rec.mb_ping.depth, p, ping->number_beams, &ft->rec.mb_ping.scaleFactors, GSF_SWATH_BATHY_SUBRECORD_DEPTH_ARRAY, handle);
-                        break;
-
-                    case GSF_FIELD_SIZE_FOUR:
-                        ret = DecodeFourByteArray(&ft->rec.mb_ping.depth, p, ping->number_beams, &ft->rec.mb_ping.scaleFactors, GSF_SWATH_BATHY_SUBRECORD_DEPTH_ARRAY, handle);
-                        break;
-                }
-                if (ret < 0)
-                {
-                    return (-1);
-                }
-                ping->depth = ft->rec.mb_ping.depth;
-                p += ret;
-                break;
-
-            case (GSF_SWATH_BATHY_SUBRECORD_NOMINAL_DEPTH_ARRAY):
-                switch (field_size)
-                {
-                    default:
-                    case GSF_FIELD_SIZE_DEFAULT:
-                    case GSF_FIELD_SIZE_TWO:
-                        ret = DecodeTwoByteArray(&ft->rec.mb_ping.nominal_depth, p, ping->number_beams, &ft->rec.mb_ping.scaleFactors, GSF_SWATH_BATHY_SUBRECORD_NOMINAL_DEPTH_ARRAY, handle);
-                        break;
-
-                    case GSF_FIELD_SIZE_FOUR:
-                        ret = DecodeFourByteArray(&ft->rec.mb_ping.nominal_depth, p, ping->number_beams, &ft->rec.mb_ping.scaleFactors, GSF_SWATH_BATHY_SUBRECORD_NOMINAL_DEPTH_ARRAY, handle);
-                        break;
-                }
-                if (ret < 0)
-                {
-                    return (-1);
-                }
-                ping->nominal_depth = ft->rec.mb_ping.nominal_depth;
-                p += ret;
-                break;
-
-            case (GSF_SWATH_BATHY_SUBRECORD_ACROSS_TRACK_ARRAY):
-                switch (field_size)
-                {
-                    default:
-                    case GSF_FIELD_SIZE_DEFAULT:
-                    case GSF_FIELD_SIZE_TWO:
-                        ret = DecodeSignedTwoByteArray(&ft->rec.mb_ping.across_track, (char *)p, ping->number_beams, &ft->rec.mb_ping.scaleFactors, GSF_SWATH_BATHY_SUBRECORD_ACROSS_TRACK_ARRAY, handle);
-                        break;
-
-                    case GSF_FIELD_SIZE_FOUR:
-                        ret = DecodeSignedFourByteArray(&ft->rec.mb_ping.across_track, (char *)p, ping->number_beams, &ft->rec.mb_ping.scaleFactors, GSF_SWATH_BATHY_SUBRECORD_ACROSS_TRACK_ARRAY, handle);
-                        break;
-                }
-                if (ret < 0)
-                {
-                    return (-1);
-                }
-                ping->across_track = ft->rec.mb_ping.across_track;
-                p += ret;
-                break;
-
-            case (GSF_SWATH_BATHY_SUBRECORD_ALONG_TRACK_ARRAY):
-                switch (field_size)
-                {
-                    default:
-                    case GSF_FIELD_SIZE_DEFAULT:
-                    case GSF_FIELD_SIZE_TWO:
-                        ret = DecodeSignedTwoByteArray(&ft->rec.mb_ping.along_track, (char *)p, ping->number_beams, &ft->rec.mb_ping.scaleFactors, GSF_SWATH_BATHY_SUBRECORD_ALONG_TRACK_ARRAY, handle);
-                        break;
-
-                    case GSF_FIELD_SIZE_FOUR:
-                        ret = DecodeSignedFourByteArray(&ft->rec.mb_ping.along_track, (char *)p, ping->number_beams, &ft->rec.mb_ping.scaleFactors, GSF_SWATH_BATHY_SUBRECORD_ALONG_TRACK_ARRAY, handle);
-                        break;
-                }
-                if (ret < 0)
-                {
-                    return (-1);
-                }
-                ping->along_track = ft->rec.mb_ping.along_track;
-                p += ret;
-                break;
-
-            case (GSF_SWATH_BATHY_SUBRECORD_TRAVEL_TIME_ARRAY):
-                switch (field_size)
-                {
-                    default:
-                    case GSF_FIELD_SIZE_DEFAULT:
-                    case GSF_FIELD_SIZE_TWO:
-                        ret = DecodeTwoByteArray(&ft->rec.mb_ping.travel_time, p, ping->number_beams, &ft->rec.mb_ping.scaleFactors, GSF_SWATH_BATHY_SUBRECORD_TRAVEL_TIME_ARRAY, handle);
-                        break;
-
-                    case GSF_FIELD_SIZE_FOUR:
-                        ret = DecodeFourByteArray(&ft->rec.mb_ping.travel_time, p, ping->number_beams, &ft->rec.mb_ping.scaleFactors, GSF_SWATH_BATHY_SUBRECORD_TRAVEL_TIME_ARRAY, handle);
-                        break;
-                }
-                if (ret < 0)
-                {
-                    return (-1);
-                }
-                ping->travel_time = ft->rec.mb_ping.travel_time;
-                p += ret;
-                break;
-
-            case (GSF_SWATH_BATHY_SUBRECORD_BEAM_ANGLE_ARRAY):
-                ret = DecodeSignedTwoByteArray(&ft->rec.mb_ping.beam_angle, (char *)p, ping->number_beams,
-                    &ft->rec.mb_ping.scaleFactors, GSF_SWATH_BATHY_SUBRECORD_BEAM_ANGLE_ARRAY, handle);
-                if (ret < 0)
-                {
-                    return (-1);
-                }
-                ping->beam_angle = ft->rec.mb_ping.beam_angle;
-                p += ret;
-                break;
-
-            case (GSF_SWATH_BATHY_SUBRECORD_MEAN_CAL_AMPLITUDE_ARRAY):
-                switch (field_size)
-                {
-                    default:
-                    case GSF_FIELD_SIZE_DEFAULT:
-                    case GSF_FIELD_SIZE_ONE:
-                        ret = DecodeSignedByteArray(&ft->rec.mb_ping.mc_amplitude, (char *)p, ping->number_beams, &ft->rec.mb_ping.scaleFactors, GSF_SWATH_BATHY_SUBRECORD_MEAN_CAL_AMPLITUDE_ARRAY, handle);
-                        break;
-
-                    case GSF_FIELD_SIZE_TWO:
-                        ret = DecodeSignedTwoByteArray(&ft->rec.mb_ping.mc_amplitude, (char *)p, ping->number_beams, &ft->rec.mb_ping.scaleFactors, GSF_SWATH_BATHY_SUBRECORD_MEAN_CAL_AMPLITUDE_ARRAY, handle);
-                        break;
-                }
-                if (ret < 0)
-                {
-                    return (-1);
-                }
-                ping->mc_amplitude = ft->rec.mb_ping.mc_amplitude;
-                p += ret;
-                break;
-
-            case (GSF_SWATH_BATHY_SUBRECORD_MEAN_REL_AMPLITUDE_ARRAY):
-                switch (field_size)
-                {
-                    default:
-                    case GSF_FIELD_SIZE_DEFAULT:
-                    case GSF_FIELD_SIZE_ONE:
-                        ret = DecodeByteArray(&ft->rec.mb_ping.mr_amplitude, p, ping->number_beams, &ft->rec.mb_ping.scaleFactors, GSF_SWATH_BATHY_SUBRECORD_MEAN_REL_AMPLITUDE_ARRAY, handle);
-                        break;
-
-                    case GSF_FIELD_SIZE_TWO:
-                        ret = DecodeTwoByteArray(&ft->rec.mb_ping.mr_amplitude, p, ping->number_beams, &ft->rec.mb_ping.scaleFactors, GSF_SWATH_BATHY_SUBRECORD_MEAN_REL_AMPLITUDE_ARRAY, handle);
-                        break;
-                }
-                if (ret < 0)
-                {
-                    return (-1);
-                }
-                ping->mr_amplitude = ft->rec.mb_ping.mr_amplitude;
-                p += ret;
-                break;
-
-            case (GSF_SWATH_BATHY_SUBRECORD_ECHO_WIDTH_ARRAY):
-                switch (field_size)
-                {
-                    default:
-                    case GSF_FIELD_SIZE_DEFAULT:
-                    case GSF_FIELD_SIZE_ONE:
-                        ret = DecodeByteArray(&ft->rec.mb_ping.echo_width, p, ping->number_beams, &ft->rec.mb_ping.scaleFactors, GSF_SWATH_BATHY_SUBRECORD_ECHO_WIDTH_ARRAY, handle);
-                        break;
-
-                    case GSF_FIELD_SIZE_TWO:
-                        ret = DecodeTwoByteArray(&ft->rec.mb_ping.echo_width, p, ping->number_beams, &ft->rec.mb_ping.scaleFactors, GSF_SWATH_BATHY_SUBRECORD_ECHO_WIDTH_ARRAY, handle);
-                        break;
-                }
-                if (ret < 0)
-                {
-                    return (-1);
-                }
-                ping->echo_width = ft->rec.mb_ping.echo_width;
-                p += ret;
-                break;
-
-            case (GSF_SWATH_BATHY_SUBRECORD_QUALITY_FACTOR_ARRAY):
-                ret = DecodeByteArray(&ft->rec.mb_ping.quality_factor, p, ping->number_beams,
-                    &ft->rec.mb_ping.scaleFactors, GSF_SWATH_BATHY_SUBRECORD_QUALITY_FACTOR_ARRAY, handle);
-                if (ret < 0)
-                {
-                    return (-1);
-                }
-                ping->quality_factor = ft->rec.mb_ping.quality_factor;
-                p += ret;
-                break;
-
-            case (GSF_SWATH_BATHY_SUBRECORD_RECEIVE_HEAVE_ARRAY):
-                ret = DecodeSignedByteArray(&ft->rec.mb_ping.receive_heave, (char *)p, ping->number_beams,
-                    &ft->rec.mb_ping.scaleFactors, GSF_SWATH_BATHY_SUBRECORD_RECEIVE_HEAVE_ARRAY, handle);
-                if (ret < 0)
-                {
-                    return (-1);
-                }
-                ping->receive_heave = ft->rec.mb_ping.receive_heave;
-                p += ret;
-                break;
-
-            case (GSF_SWATH_BATHY_SUBRECORD_DEPTH_ERROR_ARRAY):
-                ret = DecodeTwoByteArray(&ft->rec.mb_ping.depth_error, p, ping->number_beams,
-                    &ft->rec.mb_ping.scaleFactors, GSF_SWATH_BATHY_SUBRECORD_DEPTH_ERROR_ARRAY, handle);
-                if (ret < 0)
-                {
-                    return (-1);
-                }
-                ping->depth_error = ft->rec.mb_ping.depth_error;
-                p += ret;
-                break;
-
-            case (GSF_SWATH_BATHY_SUBRECORD_ACROSS_TRACK_ERROR_ARRAY):
-                ret = DecodeTwoByteArray(&ft->rec.mb_ping.across_track_error, p, ping->number_beams,
-                    &ft->rec.mb_ping.scaleFactors, GSF_SWATH_BATHY_SUBRECORD_ACROSS_TRACK_ERROR_ARRAY, handle);
-                if (ret < 0)
-                {
-                    return (-1);
-                }
-                ping->across_track_error = ft->rec.mb_ping.across_track_error;
-                p += ret;
-                break;
-
-            case (GSF_SWATH_BATHY_SUBRECORD_ALONG_TRACK_ERROR_ARRAY):
-                ret = DecodeTwoByteArray(&ft->rec.mb_ping.along_track_error, p, ping->number_beams,
-                    &ft->rec.mb_ping.scaleFactors, GSF_SWATH_BATHY_SUBRECORD_ALONG_TRACK_ERROR_ARRAY, handle);
-                if (ret < 0)
-                {
-                    return (-1);
-                }
-                ping->along_track_error =  ft->rec.mb_ping.along_track_error;
-                p += ret;
-                break;
-
-            case (GSF_SWATH_BATHY_SUBRECORD_BEAM_FLAGS_ARRAY):
-                ret = DecodeBeamFlagsArray(&ft->rec.mb_ping.beam_flags, p, ping->number_beams, handle);
-                if (ret < 0)
-                {
-                    return (-1);
-                }
-                ping->beam_flags = ft->rec.mb_ping.beam_flags;
-                p += ret;
-                break;
-
-            case (GSF_SWATH_BATHY_SUBRECORD_QUALITY_FLAGS_ARRAY):
-                // if the update flag is TRUE and the quality flags array
-                // is not fully encoded, return an error.
-                if (ft->update_flag)
-                {
-                    if (ping->number_beams > subrecord_size*4)
-                    {
-                        gsfError = GSF_QUALITY_FLAGS_DECODE_ERROR;
-                        return -1;
-                    }
-                }
-                ret = DecodeQualityFlagsArray(&ft->rec.mb_ping.quality_flags, p, ping->number_beams, subrecord_size, handle);
-                if (ret < 0)
-                {
-                    return (-1);
-                }
-                ping->quality_flags = ft->rec.mb_ping.quality_flags;
-                p += ret;
-                break;
-
-            case (GSF_SWATH_BATHY_SUBRECORD_SIGNAL_TO_NOISE_ARRAY):
-                ret = DecodeSignedByteArray(&ft->rec.mb_ping.signal_to_noise, (char *)p, ping->number_beams,
-                    &ft->rec.mb_ping.scaleFactors, GSF_SWATH_BATHY_SUBRECORD_SIGNAL_TO_NOISE_ARRAY, handle);
-                if (ret < 0)
-                {
-                    return (-1);
-                }
-                ping->signal_to_noise = ft->rec.mb_ping.signal_to_noise;
-                p += ret;
-                break;
-
-            case (GSF_SWATH_BATHY_SUBRECORD_BEAM_ANGLE_FORWARD_ARRAY):
-                ret = DecodeTwoByteArray(&ft->rec.mb_ping.beam_angle_forward, p, ping->number_beams,
-                    &ft->rec.mb_ping.scaleFactors, GSF_SWATH_BATHY_SUBRECORD_BEAM_ANGLE_FORWARD_ARRAY, handle);
-                if (ret < 0)
-                {
-                    return (-1);
-                }
-                ping->beam_angle_forward = ft->rec.mb_ping.beam_angle_forward;
-                p += ret;
-                break;
-
-            /* 09/28/98 jsb - added vertical error subrecord */
-            case (GSF_SWATH_BATHY_SUBRECORD_VERTICAL_ERROR_ARRAY):
-                ret = DecodeTwoByteArray(&ft->rec.mb_ping.vertical_error, p, ping->number_beams,
-                    &ft->rec.mb_ping.scaleFactors, GSF_SWATH_BATHY_SUBRECORD_VERTICAL_ERROR_ARRAY, handle);
-                if (ret < 0)
-                {
-                    return (-1);
-                }
-                ping->vertical_error =  ft->rec.mb_ping.vertical_error;
-                p += ret;
-                break;
-
-            /* 09/28/98 jsb - added horizontal error subrecord */
-            case (GSF_SWATH_BATHY_SUBRECORD_HORIZONTAL_ERROR_ARRAY):
-                ret = DecodeTwoByteArray(&ft->rec.mb_ping.horizontal_error, p, ping->number_beams,
-                    &ft->rec.mb_ping.scaleFactors, GSF_SWATH_BATHY_SUBRECORD_HORIZONTAL_ERROR_ARRAY, handle);
-                if (ret < 0)
-                {
-                    return (-1);
-                }
-                ping->horizontal_error =  ft->rec.mb_ping.horizontal_error;
-                p += ret;
-                break;
-
-            case (GSF_SWATH_BATHY_SUBRECORD_SECTOR_NUMBER_ARRAY):
-
-                ret = DecodeFromByteToUnsignedShortArray(&ft->rec.mb_ping.sector_number, p, ping->number_beams,
-                    &ft->rec.mb_ping.scaleFactors, GSF_SWATH_BATHY_SUBRECORD_SECTOR_NUMBER_ARRAY, handle);
-                if (ret < 0)
-                {
-                    return (-1);
-                }
-                ping->sector_number =  ft->rec.mb_ping.sector_number;
-                p += ret;
-                break;
-
-             case (GSF_SWATH_BATHY_SUBRECORD_DETECTION_INFO_ARRAY):
-                 ret = DecodeFromByteToUnsignedShortArray(&ft->rec.mb_ping.detection_info, p, ping->number_beams,
-                     &ft->rec.mb_ping.scaleFactors, GSF_SWATH_BATHY_SUBRECORD_DETECTION_INFO_ARRAY, handle);
-                 if (ret < 0)
-                 {
-                     return (-1);
-                 }
-                 ping->detection_info =  ft->rec.mb_ping.detection_info;
-                 p += ret;
-                 break;
-
-           case (GSF_SWATH_BATHY_SUBRECORD_INCIDENT_BEAM_ADJ_ARRAY):
-             ret = DecodeSignedByteArray(&ft->rec.mb_ping.incident_beam_adj, (char *) p, ping->number_beams,
-                   &ft->rec.mb_ping.scaleFactors, GSF_SWATH_BATHY_SUBRECORD_INCIDENT_BEAM_ADJ_ARRAY, handle);
-               if (ret < 0)
-               {
-                   return (-1);
-               }
-               ping->incident_beam_adj =  ft->rec.mb_ping.incident_beam_adj;
-               p += ret;
-               break;
-
-           case (GSF_SWATH_BATHY_SUBRECORD_SYSTEM_CLEANING_ARRAY):
-               ret = DecodeFromByteToUnsignedShortArray(&ft->rec.mb_ping.system_cleaning, p, ping->number_beams,
-                   &ft->rec.mb_ping.scaleFactors, GSF_SWATH_BATHY_SUBRECORD_SYSTEM_CLEANING_ARRAY, handle);
-               if (ret < 0)
-               {
-                   return (-1);
-               }
-               ping->system_cleaning =  ft->rec.mb_ping.system_cleaning;
-               p += ret;
-               break;
-
-           case (GSF_SWATH_BATHY_SUBRECORD_DOPPLER_CORRECTION_ARRAY):
-             ret = DecodeSignedByteArray(&ft->rec.mb_ping.doppler_corr, (char *) p, ping->number_beams,
-                   &ft->rec.mb_ping.scaleFactors, GSF_SWATH_BATHY_SUBRECORD_DOPPLER_CORRECTION_ARRAY, handle);
-               if (ret < 0)
-               {
-                   return (-1);
-               }
-               ping->doppler_corr = ft->rec.mb_ping.doppler_corr;
-               p += ret;
-               break;
-
-            /* 02/25/14 jhp - added sonar_vert_uncertainty subrecord */
-           case (GSF_SWATH_BATHY_SUBRECORD_SONAR_VERT_UNCERT_ARRAY):
-             ret = DecodeTwoByteArray(&ft->rec.mb_ping.sonar_vert_uncert, (unsigned char *) p, ping->number_beams,
-                   &ft->rec.mb_ping.scaleFactors, GSF_SWATH_BATHY_SUBRECORD_SONAR_VERT_UNCERT_ARRAY, handle);
-               if (ret < 0)
-               {
-                   return (-1);
-               }
-               ping->sonar_vert_uncert = ft->rec.mb_ping.sonar_vert_uncert;
-               p += ret;
-               break;
-
-            case (GSF_SWATH_BATHY_SUBRECORD_SEABEAM_SPECIFIC):
-                p += DecodeSeabeamSpecific(&ping->sensor_data, p);
-                ping->sensor_id = GSF_SWATH_BATHY_SUBRECORD_SEABEAM_SPECIFIC;
-                break;
-
-            case (GSF_SWATH_BATHY_SUBRECORD_EM12_SPECIFIC):
-                p += DecodeEM12Specific(&ping->sensor_data, p);
-                ping->sensor_id = GSF_SWATH_BATHY_SUBRECORD_EM12_SPECIFIC;
-                break;
-
-            case (GSF_SWATH_BATHY_SUBRECORD_EM100_SPECIFIC):
-                p += DecodeEM100Specific(&ping->sensor_data, p);
-                ping->sensor_id = GSF_SWATH_BATHY_SUBRECORD_EM100_SPECIFIC;
-                break;
-
-            case (GSF_SWATH_BATHY_SUBRECORD_EM950_SPECIFIC):
-                p += DecodeEM950Specific(&ping->sensor_data, p);
-                ping->sensor_id = GSF_SWATH_BATHY_SUBRECORD_EM950_SPECIFIC;
-                break;
-
-            case (GSF_SWATH_BATHY_SUBRECORD_EM121A_SPECIFIC):
-                p += DecodeEM121ASpecific(&ping->sensor_data, p);
-                ping->sensor_id = GSF_SWATH_BATHY_SUBRECORD_EM121A_SPECIFIC;
-                break;
-
-            case (GSF_SWATH_BATHY_SUBRECORD_EM121_SPECIFIC):
-                p += DecodeEM121Specific(&ping->sensor_data, p);
-                ping->sensor_id = GSF_SWATH_BATHY_SUBRECORD_EM121_SPECIFIC;
-                break;
-
-            case (GSF_SWATH_BATHY_SUBRECORD_SASS_SPECIFIC):
-                p += DecodeSASSSpecific(&ping->sensor_data, p);
-                ping->sensor_id = GSF_SWATH_BATHY_SUBRECORD_SASS_SPECIFIC;
-                break;
-
-            case (GSF_SWATH_BATHY_SUBRECORD_SEAMAP_SPECIFIC):
-                p += DecodeSeaMapSpecific(&ping->sensor_data, p, ft);
-                ping->sensor_id = GSF_SWATH_BATHY_SUBRECORD_SEAMAP_SPECIFIC;
-                break;
-
-            case (GSF_SWATH_BATHY_SUBRECORD_SEABAT_SPECIFIC):
-                p += DecodeSeaBatSpecific(&ping->sensor_data, p);
-                ping->sensor_id = GSF_SWATH_BATHY_SUBRECORD_SEABAT_SPECIFIC;
-                break;
-
-            case (GSF_SWATH_BATHY_SUBRECORD_EM1000_SPECIFIC):
-                p += DecodeEM1000Specific(&ping->sensor_data, p);
-                ping->sensor_id = GSF_SWATH_BATHY_SUBRECORD_EM1000_SPECIFIC;
-                break;
-
-                #if 1
-                /* 3-30-99 wkm: obsolete */
-            case (GSF_SWATH_BATHY_SUBRECORD_TYPEIII_SEABEAM_SPECIFIC):
-                p += DecodeTypeIIISeaBeamSpecific(&ping->sensor_data, p);
-                ping->sensor_id =
-                  GSF_SWATH_BATHY_SUBRECORD_TYPEIII_SEABEAM_SPECIFIC;
-                break;
-                #endif
-
-            case (GSF_SWATH_BATHY_SUBRECORD_SB_AMP_SPECIFIC):
-                p += DecodeSBAmpSpecific(&ping->sensor_data, p);
-                ping->sensor_id = GSF_SWATH_BATHY_SUBRECORD_SB_AMP_SPECIFIC;
-                break;
-
-            case (GSF_SWATH_BATHY_SUBRECORD_SEABAT_II_SPECIFIC):
-                p += DecodeSeaBatIISpecific(&ping->sensor_data, p);
-                ping->sensor_id = GSF_SWATH_BATHY_SUBRECORD_SEABAT_II_SPECIFIC;
-                break;
-
-            case (GSF_SWATH_BATHY_SUBRECORD_SEABAT_8101_SPECIFIC):
-                p += DecodeSeaBat8101Specific(&ping->sensor_data, p);
-                ping->sensor_id = GSF_SWATH_BATHY_SUBRECORD_SEABAT_8101_SPECIFIC;
-                break;
-
-            case (GSF_SWATH_BATHY_SUBRECORD_SEABEAM_2112_SPECIFIC):
-                p += DecodeSeaBeam2112Specific(&ping->sensor_data, p);
-                ping->sensor_id = GSF_SWATH_BATHY_SUBRECORD_SEABEAM_2112_SPECIFIC;
-                break;
-
-            case (GSF_SWATH_BATHY_SUBRECORD_ELAC_MKII_SPECIFIC):
-                p += DecodeElacMkIISpecific(&ping->sensor_data, p);
-                ping->sensor_id = GSF_SWATH_BATHY_SUBRECORD_ELAC_MKII_SPECIFIC;
-                break;
-
-            case (GSF_SWATH_BATHY_SUBRECORD_CMP_SASS_SPECIFIC):
-                p += DecodeCmpSassSpecific(&ping->sensor_data, p);
-                ping->sensor_id = GSF_SWATH_BATHY_SUBRECORD_CMP_SASS_SPECIFIC;
-                break;
-
-            case (GSF_SWATH_BATHY_SUBRECORD_EM2000_SPECIFIC):
-                p += DecodeEM3Specific(&ping->sensor_data, p, ft);
-                ping->sensor_id = GSF_SWATH_BATHY_SUBRECORD_EM2000_SPECIFIC;
-                break;
-
-            case (GSF_SWATH_BATHY_SUBRECORD_EM3000_SPECIFIC):
-                p += DecodeEM3Specific(&ping->sensor_data, p, ft);
-                ping->sensor_id = GSF_SWATH_BATHY_SUBRECORD_EM3000_SPECIFIC;
-                break;
-
-            case (GSF_SWATH_BATHY_SUBRECORD_EM1002_SPECIFIC):
-                p += DecodeEM3Specific(&ping->sensor_data, p, ft);
-                ping->sensor_id = GSF_SWATH_BATHY_SUBRECORD_EM1002_SPECIFIC;
-                break;
-
-             case (GSF_SWATH_BATHY_SUBRECORD_EM300_SPECIFIC):
-                p += DecodeEM3Specific(&ping->sensor_data, p, ft);
-                ping->sensor_id = GSF_SWATH_BATHY_SUBRECORD_EM300_SPECIFIC;
-                break;
-
-             case (GSF_SWATH_BATHY_SUBRECORD_EM120_SPECIFIC):
-                p += DecodeEM3Specific(&ping->sensor_data, p, ft);
-                ping->sensor_id = GSF_SWATH_BATHY_SUBRECORD_EM120_SPECIFIC;
-                break;
-
-            case (GSF_SWATH_BATHY_SUBRECORD_EM3002_SPECIFIC):
-                p += DecodeEM3Specific(&ping->sensor_data, p, ft);
-                ping->sensor_id = GSF_SWATH_BATHY_SUBRECORD_EM3002_SPECIFIC;
-                break;
-
-            case (GSF_SWATH_BATHY_SUBRECORD_EM3000D_SPECIFIC):
-                p += DecodeEM3Specific(&ping->sensor_data, p, ft);
-                ping->sensor_id = GSF_SWATH_BATHY_SUBRECORD_EM3000D_SPECIFIC;
-                break;
-
-            case (GSF_SWATH_BATHY_SUBRECORD_EM3002D_SPECIFIC):
-                p += DecodeEM3Specific(&ping->sensor_data, p, ft);
-                ping->sensor_id = GSF_SWATH_BATHY_SUBRECORD_EM3002D_SPECIFIC;
-                break;
-
-            case (GSF_SWATH_BATHY_SUBRECORD_EM121A_SIS_SPECIFIC):
-                p += DecodeEM3Specific(&ping->sensor_data, p, ft);
-                ping->sensor_id = GSF_SWATH_BATHY_SUBRECORD_EM121A_SIS_SPECIFIC;
-                break;
-
-            case (GSF_SWATH_BATHY_SUBRECORD_EM2000_RAW_SPECIFIC):
-            case (GSF_SWATH_BATHY_SUBRECORD_EM3000_RAW_SPECIFIC):
-            case (GSF_SWATH_BATHY_SUBRECORD_EM1002_RAW_SPECIFIC):
-            case (GSF_SWATH_BATHY_SUBRECORD_EM300_RAW_SPECIFIC):
-            case (GSF_SWATH_BATHY_SUBRECORD_EM120_RAW_SPECIFIC):
-            case (GSF_SWATH_BATHY_SUBRECORD_EM3002_RAW_SPECIFIC):
-            case (GSF_SWATH_BATHY_SUBRECORD_EM3000D_RAW_SPECIFIC):
-            case (GSF_SWATH_BATHY_SUBRECORD_EM3002D_RAW_SPECIFIC):
-            case (GSF_SWATH_BATHY_SUBRECORD_EM121A_SIS_RAW_SPECIFIC):
-                p += DecodeEM3RawSpecific(&ping->sensor_data, p, ft);
-                ping->sensor_id = subrecord_id;
-                break;
-
-
-            case (GSF_SWATH_BATHY_SUBRECORD_RESON_8101_SPECIFIC):
-            case (GSF_SWATH_BATHY_SUBRECORD_RESON_8111_SPECIFIC):
-            case (GSF_SWATH_BATHY_SUBRECORD_RESON_8124_SPECIFIC):
-            case (GSF_SWATH_BATHY_SUBRECORD_RESON_8125_SPECIFIC):
-            case (GSF_SWATH_BATHY_SUBRECORD_RESON_8150_SPECIFIC):
-            case (GSF_SWATH_BATHY_SUBRECORD_RESON_8160_SPECIFIC):
-                p += DecodeReson8100Specific(&ping->sensor_data, p);
-                ping->sensor_id = subrecord_id;
-                break;
-
-            case (GSF_SWATH_BATHY_SUBRECORD_RESON_7125_SPECIFIC):
-                p += DecodeReson7100Specific(&ping->sensor_data, p);
-                ping->sensor_id = subrecord_id;
-                break;
-
-            case (GSF_SWATH_BATHY_SUBRECORD_EM710_SPECIFIC):
-            case (GSF_SWATH_BATHY_SUBRECORD_EM302_SPECIFIC):
-            case (GSF_SWATH_BATHY_SUBRECORD_EM122_SPECIFIC):
-            case (GSF_SWATH_BATHY_SUBRECORD_EM2040_SPECIFIC):
-                p += DecodeEM4Specific(&ping->sensor_data, p, ft);
-                ping->sensor_id = subrecord_id;
-                break;
-
-            case (GSF_SWATH_BATHY_SUBRECORD_GEOSWATH_PLUS_SPECIFIC):
-                p += DecodeGeoSwathPlusSpecific(&ping->sensor_data, p);
-                ping->sensor_id = GSF_SWATH_BATHY_SUBRECORD_GEOSWATH_PLUS_SPECIFIC;
-                break;
-
-            case (GSF_SWATH_BATHY_SUBRECORD_KLEIN_5410_BSS_SPECIFIC):
-                p += DecodeKlein5410BssSpecific(&ping->sensor_data, p);
-                ping->sensor_id = GSF_SWATH_BATHY_SUBRECORD_KLEIN_5410_BSS_SPECIFIC;
-                break;
-
-            case (GSF_SWATH_BATHY_SUBRECORD_DELTA_T_SPECIFIC):
-                p += DecodeDeltaTSpecific(&ping->sensor_data, p);
-                ping->sensor_id = GSF_SWATH_BATHY_SUBRECORD_DELTA_T_SPECIFIC;
-                break;
-
-            case (GSF_SWATH_BATHY_SUBRECORD_R2SONIC_2020_SPECIFIC):
-            case (GSF_SWATH_BATHY_SUBRECORD_R2SONIC_2022_SPECIFIC):
-            case (GSF_SWATH_BATHY_SUBRECORD_R2SONIC_2024_SPECIFIC):
-                p += DecodeR2SonicSpecific(&ping->sensor_data, p);
-                ping->sensor_id = subrecord_id;
-                break;
-
-            /* 12/20/2002 RWL added SB types, made Echotrac version dependent */
-
-            case (GSF_SWATH_BATHY_SB_SUBRECORD_ECHOTRAC_SPECIFIC):
-                p += DecodeSBEchotracSpecific(&ping->sensor_data.gsfSBEchotracSpecific, p);
-                ping->sensor_id = GSF_SWATH_BATHY_SB_SUBRECORD_ECHOTRAC_SPECIFIC;
-                break;
-
-            case (GSF_SWATH_BATHY_SB_SUBRECORD_BATHY2000_SPECIFIC):
-                p += DecodeSBEchotracSpecific(&ping->sensor_data.gsfSBEchotracSpecific, p);
-                ping->sensor_id = GSF_SWATH_BATHY_SB_SUBRECORD_BATHY2000_SPECIFIC;
-
-                break;
-
-            case (GSF_SWATH_BATHY_SB_SUBRECORD_MGD77_SPECIFIC):
-                p += DecodeSBMGD77Specific (&ping->sensor_data.gsfSBMGD77Specific, p);
-                ping->sensor_id = GSF_SWATH_BATHY_SB_SUBRECORD_MGD77_SPECIFIC;
-                break;
-
-            case (GSF_SWATH_BATHY_SB_SUBRECORD_BDB_SPECIFIC):
-                p += DecodeSBBDBSpecific (&ping->sensor_data.gsfSBBDBSpecific, p);
-                ping->sensor_id = GSF_SWATH_BATHY_SB_SUBRECORD_BDB_SPECIFIC;
-                break;
-
-            case (GSF_SWATH_BATHY_SB_SUBRECORD_NOSHDB_SPECIFIC):
-                p += DecodeSBNOSHDBSpecific (&ping->sensor_data.gsfSBNOSHDBSpecific, p);
-                ping->sensor_id = GSF_SWATH_BATHY_SB_SUBRECORD_NOSHDB_SPECIFIC;
-                break;
-
-            case (GSF_SWATH_BATHY_SB_SUBRECORD_PDD_SPECIFIC):
-                p += DecodeSBEchotracSpecific(&ping->sensor_data.gsfSBPDDSpecific, p);
-                ping->sensor_id = GSF_SWATH_BATHY_SB_SUBRECORD_PDD_SPECIFIC;
-                break;
-
-            case (GSF_SWATH_BATHY_SB_SUBRECORD_NAVISOUND_SPECIFIC):
-                p += DecodeSBNavisoundSpecific (&ping->sensor_data.gsfSBNavisoundSpecific, p);
-                ping->sensor_id = GSF_SWATH_BATHY_SB_SUBRECORD_NAVISOUND_SPECIFIC;
-                break;
-
-            case (GSF_SWATH_BATHY_SUBRECORD_INTENSITY_SERIES_ARRAY):
-                ret = DecodeBRBIntensity(&ft->rec.mb_ping.brb_inten, p, ping->number_beams, ping->sensor_id, handle);
-                if (ret < 0)
-                {
-                    return (-1);
-                }
-                p += ret;
-                ping->brb_inten = ft->rec.mb_ping.brb_inten;
-                break;
-
-            default:
-                gsfError = GSF_UNRECOGNIZED_SUBRECORD_ID;
-                if ((((p - sptr) + subrecord_size) == record_size) ||
-                    ((record_size - ((p - sptr) + subrecord_size)) > 0))
-                    p+=subrecord_size;
-                else
-                    return (-1);
-                break;
-        }
-        bytes = p - sptr;
-    }
-
-    /*  Extract subrecord id if the subrecord size is 0 */
-    if (((record_size - bytes) == 4) && (ping->sensor_id != subrecord_id))
-    {
-        /* First four byte integer in subrecord contains the subrecord
-        *  size and subrecord identifier.
-        */
-        memcpy(&ltemp, p, 4);
-        p += 4;
-        ltemp = ntohl(ltemp);
-        subrecord_id = (ltemp & 0xFF000000) >> 24;
-        subrecord_size = ltemp & 0x00FFFFFF;
-
-        ping->sensor_id = subrecord_id;
-    }
-
-    /* Return the number of byte written into the buffer */
-    return (p - sptr);
-}
-
-/********************************************************************
- *
- * Function Name : DecodeScaleFactors
- *
- * Description :
- *  This function decodes the ping scale factor subrecord from external byte
- *  stream form to internal form.
- *
- * Inputs :
- *    ping = a pointer to the gsf swath bathymetry ping structure into which
- *           the scale factors will be loaded.
- *    sptr = a pointer to an unsigned char containing the byte stream to read
- *
- * Returns :
- *  This function returns the number of bytes decoded if successful, or
- *  -1 if an error occured.
- *
- * Error Conditions :
- *    GSF_TOO_MANY_ARRAY_SUBRECORDS
- *    GSF_UNRECOGNIZED_ARRAY_SUBRECORD_ID
- *
- ********************************************************************/
-
-static int
-DecodeScaleFactors(gsfScaleFactors *sf, unsigned char *sptr)
-{
-    unsigned char  *p = sptr;
-    unsigned char   compressionFlag;
-    gsfuLong        ltemp;
-    int             i;
-    unsigned int    subrecordID;
-    int             numArraySubrecords;
-    int             stemp;
-    unsigned int    itemp;
-    double          multiplier;
-    double          offset;
-
-    /* First four byte integer contains the number of scale factors */
-    memcpy(&ltemp, p, 4);
-    numArraySubrecords = ntohl(ltemp);
-    p += 4;
-    if ((numArraySubrecords < 1) || (numArraySubrecords > GSF_MAX_PING_ARRAY_SUBRECORDS))
-    {
-        gsfError = GSF_TOO_MANY_ARRAY_SUBRECORDS;
-        return (-1);
-    }
-    sf->numArraySubrecords = numArraySubrecords;
-
-    /* Loop to decode each scale factor */
-    for (i = 0; i < sf->numArraySubrecords; i++)
-    {
-        /* First four byte integer has the scaled array subrecord id in the
-         *  first byte, the compression flags in the second byte, and the
-         *  two lower order bytes are reserved.
-         */
-        memcpy(&ltemp, p, 4);
-        p += 4;
-        ltemp = ntohl(ltemp);
-        subrecordID = (ltemp & 0xFF000000) >> 24;
-        if ((subrecordID < 1) || (subrecordID > GSF_MAX_PING_ARRAY_SUBRECORDS))
-        {
-            gsfError = GSF_UNRECOGNIZED_ARRAY_SUBRECORD_ID;
-            return (-1);
-        }
-        compressionFlag = (ltemp & 0x00FF0000) >> 16;
-
-        /* decode the scale factor multiplier */
-        memcpy(&ltemp, p, 4);
-        p += 4;
-        ltemp = ntohl(ltemp);
-        multiplier = ((double) ltemp);
-
-        /* decode the scale factor offset */
-        memcpy(&ltemp, p, 4);
-        p += 4;
-        stemp = (signed) ntohl (ltemp);
-        offset = (double) stemp;
-
-        itemp = (int) (multiplier + 0.001);
-        if ((itemp < MIN_GSF_SF_MULT_VALUE) || (itemp > MAX_GSF_SF_MULT_VALUE))
-        {
-            gsfError = GSF_CANNOT_REPRESENT_PRECISION;
-            return (-1);
-        }
-
-        sf->scaleTable[subrecordID - 1].compressionFlag = compressionFlag;
-        sf->scaleTable[subrecordID - 1].multiplier      = multiplier;
-        sf->scaleTable[subrecordID - 1].offset          = offset;
-    }
-
-    return (p - sptr);
-}
-
-/********************************************************************
- *
- * Function Name : DecodeTwoByteArray
- *
- * Description :
- *  This function decodes a two byte array of beam data from external byte
- *   stream form to internal engineering units form.  This function allocates
- *   the memory for the array if it does not exist.  This function also
- *   reallocates the memory for the array when the number of beams changes.
- *
- * Inputs :
- *    array = the address of a pointer to a double where the array of data
- *            will be stored
- *    sptr = a pointer to the unsigned char buffer containing the byte stream
- *           to read from.
- *    num_beams = an integer containing the number of beams which is used to
- *                dimension the array
- *    sf = a pointer to the scale factors structure containing the data scaling
- *         information
- *    id = the integer id for the subrecord, which is used as the index into
- *         the scale factors structure.
- *    handle = the integer handle for the data file being read, which is used
- *             to store the current number of beams
- *
- * Returns :
- *  This function returns the number of bytes decoded if successful, or
- *  -1 if an error occured.
- *
- * Error Conditions :
- *    GSF_ILLEGAL_SCALE_FACTOR_MULTIPLIER
- *    GSF_INVALID_NUM_BEAMS
- *    GSF_MEMORY_ALLOCATION_FAILED
- *
- ********************************************************************/
-
-static int
-DecodeTwoByteArray(double **array, unsigned char *sptr, int num_beams,
-    gsfScaleFactors * sf, int id, int handle)
-{
-    double         *dptr;
-    unsigned char  *ptr = sptr;
-    gsfuShort       stemp;
-    unsigned short  temp;
-    int             i;
-
-    /* make sure we have a scale factor multiplier */
-    if (sf->scaleTable[id - 1].multiplier < 1.0e-6)
-    {
-        gsfError = GSF_ILLEGAL_SCALE_FACTOR_MULTIPLIER;
-        return (-1);
-    }
-
-    if (num_beams <= 0)
-    {
-        gsfError = GSF_INVALID_NUM_BEAMS;
-        return(-1);
-    }
-
-    /* Allocate memory for the array if none has been allocated yet */
-    if (*array == (double *) NULL)
-    {
-        *array = (double *) calloc(num_beams, sizeof(double));
-
-        if (*array == (double *) NULL)
-        {
-            gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-            return (-1);
-        }
-        arraySize[handle - 1][id - 1] = num_beams;
-    }
-
-    /* Make sure the memory allocated for the array is sufficient, some
-    *  systems have a dynamic number of beams depending on depth
-    */
-    if (num_beams > arraySize[handle - 1][id - 1])
-    {
-        *array = (double *) realloc((void *) *array, num_beams * sizeof(double));
-
-        if (*array == (double *) NULL)
-        {
-            gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-            return (-1);
-        }
-        memset(*array, 0, num_beams * sizeof(double));
-
-        arraySize[handle - 1][id - 1] = num_beams;
-    }
-
-    dptr = *array;
-
-    /* loop for the number of beams, loading each value from the byte stream
-    *  into internal form
-    */
-    for (i = 0; i < num_beams; i++)
-    {
-        memcpy(&stemp, ptr, 2);
-        temp = (unsigned short) ntohs(stemp);
-        *dptr = (((double) temp) /
-            sf->scaleTable[id - 1].multiplier) -
-            sf->scaleTable[id - 1].offset;
-        ptr += 2;
-        dptr++;
-    }
-
-    return (ptr - sptr);
-}
-
-/********************************************************************
- *
- * Function Name : DecodeSignedTwoByteArray
- *
- * Description :
- *  This function decodes a two byte array of beam data from external byte
- *   stream form to internal engineering units form.  This function allocates
- *   the memory for the array if it does not exist.  This function also
- *   reallocates the memory for the array when the number of beams changes.
- *
- * Inputs :
- *    array = the address of a pointer to a double where the array of data
- *            will be stored
- *    sptr = a pointer the char buffer containing the byte stream
- *           to read from.
- *    num_beams = an integer containing the number of beams which is used to
- *                dimension the array
- *    sf = a pointer to the scale factors structure containing the data scaling
- *         information
- *    id = the integer id for the subrecord, which is used as the index into
- *         the scale factors structure.
- *    handle = the integer handle for the data file being read, which is used
- *             to store the current number of beams
- *
- * Returns :
- *  This function returns the number of bytes decoded if successful, or
- *  -1 if an error occured.
- *
- * Error Conditions :
- *    GSF_ILLEGAL_SCALE_FACTOR_MULTIPLIER
- *    GSF_INVALID_NUM_BEAMS
- *    GSF_MEMORY_ALLOCATION_FAILED
- *
- ********************************************************************/
-
-static int
-DecodeSignedTwoByteArray(double **array, char *sptr, int num_beams,
-    gsfScaleFactors * sf, int id, int handle)
-{
-    double         *dptr;
-    char           *ptr = sptr;
-    gsfuShort       stemp;
-    gsfsShort       signed_temp;
-    int             i;
-
-    /* make sure we have a scale factor multiplier */
-    if (sf->scaleTable[id - 1].multiplier < 1.0e-6)
-    {
-        gsfError = GSF_ILLEGAL_SCALE_FACTOR_MULTIPLIER;
-        return (-1);
-    }
-
-    if (num_beams <= 0)
-    {
-        gsfError = GSF_INVALID_NUM_BEAMS;
-        return(-1);
-    }
-
-    /* Allocate memory for the array if none has been allocated yet */
-    if (*array == (double *) NULL)
-    {
-        *array = (double *) calloc(num_beams, sizeof(double));
-
-        if (*array == (double *) NULL)
-        {
-            gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-            return (-1);
-        }
-        arraySize[handle - 1][id - 1] = num_beams;
-    }
-
-    /* Make sure the memory allocated for the array is sufficient, some
-    *  systems have a dynamic number of beams depending on depth
-    */
-    if (num_beams > arraySize[handle - 1][id - 1])
-    {
-        *array = (double *) realloc((void *) *array, num_beams * sizeof(double));
-
-        if (*array == (double *) NULL)
-        {
-            gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-            return (-1);
-        }
-        memset(*array, 0, num_beams * sizeof(double));
-
-        arraySize[handle - 1][id - 1] = num_beams;
-    }
-
-    dptr = *array;
-
-    /* loop for the number of beams, loading each value from the byte stream
-    *  into internal form
-    */
-    for (i = 0; i < num_beams; i++)
-    {
-        memcpy(&stemp, ptr, 2);
-        signed_temp = (gsfsShort) ntohs(stemp);
-        *dptr = (((double) signed_temp) /
-            sf->scaleTable[id - 1].multiplier) -
-            sf->scaleTable[id - 1].offset;
-        ptr += 2;
-        dptr++;
-    }
-    return (ptr - sptr);
-}
-
-/********************************************************************
- *
- * Function Name : DecodeFourByteArray
- *
- * Description :
- *  This function decodes a four byte array of beam data from external byte
- *   stream form to internal engineering units form.  This function allocates
- *   the memory for the array if it does not exist.  This function also
- *   reallocates the memory for the array when the number of beams changes.
- *
- * Inputs :
- *    array = the address of a pointer to a double where the array of data
- *            will be stored
- *    sptr = a pointer to the unsigned char buffer containing the byte stream
- *           to read from.
- *    num_beams = an integer containing the number of beams which is used to
- *                dimension the array
- *    sf = a pointer to the scale factors structure containing the data scaling
- *         information
- *    id = the integer id for the subrecord, which is used as the index into
- *         the scale factors structure.
- *    handle = the integer handle for the data file being read, which is used
- *             to store the current number of beams
- *
- * Returns :
- *  This function returns the number of bytes decoded if successful, or
- *  -1 if an error occured.
- *
- * Error Conditions :
- *    GSF_ILLEGAL_SCALE_FACTOR_MULTIPLIER
- *    GSF_INVALID_NUM_BEAMS
- *    GSF_MEMORY_ALLOCATION_FAILED
- *
- ********************************************************************/
-
-static int
-DecodeFourByteArray(double **array, unsigned char *sptr, int num_beams,
-    gsfScaleFactors * sf, int id, int handle)
-{
-    double         *dptr;
-    unsigned char  *ptr = sptr;
-    gsfuLong        ltemp;
-    gsfuLong        temp;
-    int             i;
-
-    /* make sure we have a scale factor multiplier */
-    if (sf->scaleTable[id - 1].multiplier < 1.0e-6)
-    {
-        gsfError = GSF_ILLEGAL_SCALE_FACTOR_MULTIPLIER;
-        return (-1);
-    }
-
-    if (num_beams <= 0)
-    {
-        gsfError = GSF_INVALID_NUM_BEAMS;
-        return(-1);
-    }
-
-    /* Allocate memory for the array if none has been allocated yet */
-    if (*array == (double *) NULL)
-    {
-        *array = (double *) calloc(num_beams, sizeof(double));
-
-        if (*array == (double *) NULL)
-        {
-            gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-            return (-1);
-        }
-        arraySize[handle - 1][id - 1] = num_beams;
-    }
-
-    /* Make sure the memory allocated for the array is sufficient, some
-    *  systems have a dynamic number of beams depending on depth
-    */
-    if (num_beams > arraySize[handle - 1][id - 1])
-    {
-        *array = (double *) realloc((void *) *array, num_beams * sizeof(double));
-
-        if (*array == (double *) NULL)
-        {
-            gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-            return (-1);
-        }
-        memset(*array, 0, num_beams * sizeof(double));
-
-        arraySize[handle - 1][id - 1] = num_beams;
-    }
-
-    dptr = *array;
-
-    /* loop for the number of beams, loading each value from the byte stream
-    *  into internal form
-    */
-    for (i = 0; i < num_beams; i++)
-    {
-        memcpy(&ltemp, ptr, 4);
-        temp = (gsfuLong) ntohl(ltemp);
-        *dptr = (((double) temp) /
-            sf->scaleTable[id - 1].multiplier) -
-            sf->scaleTable[id - 1].offset;
-        ptr += 4;
-        dptr++;
-    }
-
-    return (ptr - sptr);
-}
-
-/********************************************************************
- *
- * Function Name : DecodeSignedFourByteArray
- *
- * Description :
- *  This function decodes a two byte array of beam data from external byte
- *   stream form to internal engineering units form.  This function allocates
- *   the memory for the array if it does not exist.  This function also
- *   reallocates the memory for the array when the number of beams changes.
- *
- * Inputs :
- *    array = the address of a pointer to a double where the array of data
- *            will be stored
- *    sptr = a pointer the char buffer containing the byte stream
- *           to read from.
- *    num_beams = an integer containing the number of beams which is used to
- *                dimension the array
- *    sf = a pointer to the scale factors structure containing the data scaling
- *         information
- *    id = the integer id for the subrecord, which is used as the index into
- *         the scale factors structure.
- *    handle = the integer handle for the data file being read, which is used
- *             to store the current number of beams
- *
- * Returns :
- *  This function returns the number of bytes decoded if successful, or
- *  -1 if an error occured.
- *
- * Error Conditions :
- *    GSF_ILLEGAL_SCALE_FACTOR_MULTIPLIER
- *    GSF_INVALID_NUM_BEAMS
- *    GSF_MEMORY_ALLOCATION_FAILED
- *
- ********************************************************************/
-
-static int
-DecodeSignedFourByteArray(double **array, char *sptr, int num_beams,
-    gsfScaleFactors * sf, int id, int handle)
-{
-    double         *dptr;
-    char           *ptr = sptr;
-    gsfuLong        ltemp;
-    gsfsLong        signed_temp;
-    int             i;
-
-    /* make sure we have a scale factor multiplier */
-    if (sf->scaleTable[id - 1].multiplier < 1.0e-6)
-    {
-        gsfError = GSF_ILLEGAL_SCALE_FACTOR_MULTIPLIER;
-        return (-1);
-    }
-
-    if (num_beams <= 0)
-    {
-        gsfError = GSF_INVALID_NUM_BEAMS;
-        return(-1);
-    }
-
-    /* Allocate memory for the array if none has been allocated yet */
-    if (*array == (double *) NULL)
-    {
-        *array = (double *) calloc(num_beams, sizeof(double));
-
-        if (*array == (double *) NULL)
-        {
-            gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-            return (-1);
-        }
-        arraySize[handle - 1][id - 1] = num_beams;
-    }
-
-    /* Make sure the memory allocated for the array is sufficient, some
-    *  systems have a dynamic number of beams depending on depth
-    */
-    if (num_beams > arraySize[handle - 1][id - 1])
-    {
-        *array = (double *) realloc((void *) *array, num_beams * sizeof(double));
-
-        if (*array == (double *) NULL)
-        {
-            gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-            return (-1);
-        }
-        memset(*array, 0, num_beams * sizeof(double));
-
-        arraySize[handle - 1][id - 1] = num_beams;
-    }
-
-    dptr = *array;
-
-    /* loop for the number of beams, loading each value from the byte stream
-    *  into internal form
-    */
-    for (i = 0; i < num_beams; i++)
-    {
-        memcpy(&ltemp, ptr, 4);
-        signed_temp = (gsfsLong) ntohl(ltemp);
-        *dptr = (((double) signed_temp) /
-            sf->scaleTable[id - 1].multiplier) -
-            sf->scaleTable[id - 1].offset;
-        ptr += 4;
-        dptr++;
-    }
-    return (ptr - sptr);
-}
-
-/********************************************************************
- *
- * Function Name : DecodeByteArray
- *
- * Description :
- *  This function decodes a byte array of beam data from external byte
- *   stream form to internal engineering units form.  This function allocates
- *   the memory for the array if it does not exist.  This function also
- *   reallocates the memory for the array when the number of beams changes.
- *
- * Inputs :
- *    array = the address of a pointer to a double where the array of data
- *            will be stored
- *    sptr = a pointer the unsigned char buffer containing the byte stream
- *           to read from.
- *    num_beams = an integer containing the number of beams which is used to
- *                dimension the array
- *    sf = a pointer to the scale factors structure containing the data scaling
- *         information
- *    id = the integer id for the subrecord, which is used as the index into
- *         the scale factors structure.
- *    handle = the integer handle for the data file being read, which is used
- *             to store the current number of beams
- *
- * Returns :
- *  This function returns the number of bytes decoded if successful, or
- *  -1 if an error occured.
- *
- * Error Conditions :
- *    GSF_ILLEGAL_SCALE_FACTOR_MULTIPLIER
- *    GSF_INVALID_NUM_BEAMS
- *    GSF_MEMORY_ALLOCATION_FAILED
- *
- ********************************************************************/
-
-static int
-DecodeByteArray(double **array, unsigned char *sptr, int num_beams,
-    gsfScaleFactors * sf, int id, int handle)
-{
-    double         *dptr;
-    unsigned char  *ptr = sptr;
-    unsigned char   ctemp;
-    int             i;
-
-    /* make sure we have a scale factor multiplier */
-    if (sf->scaleTable[id - 1].multiplier < 1.0e-6)
-    {
-        gsfError = GSF_ILLEGAL_SCALE_FACTOR_MULTIPLIER;
-        return(-1);
-    }
-
-    if (num_beams <= 0)
-    {
-        gsfError = GSF_INVALID_NUM_BEAMS;
-        return(-1);
-    }
-
-    /* Allocate memory for the array if none has been allocated yet */
-    if (*array == (double *) NULL)
-    {
-        *array = (double *) calloc(num_beams, sizeof(double));
-
-        if (*array == (double *) NULL)
-        {
-            gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-            return (-1);
-        }
-        arraySize[handle - 1][id - 1] = num_beams;
-    }
-
-    /* Make sure there memory allocated for the array is sufficient, some
-    *  system have a different number of beams depending on depth
-    */
-    if (num_beams > arraySize[handle - 1][id - 1])
-    {
-        *array = (double *) realloc((void *) *array, num_beams * sizeof(double));
-
-        if (*array == (double *) NULL)
-        {
-            gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-            return (-1);
-        }
-        memset(*array, 0, num_beams * sizeof(double));
-
-        arraySize[handle - 1][id - 1] = num_beams;
-    }
-
-    dptr = *array;
-
-    /* loop for the number of beams, loading each value from the byte stream
-     *  into internal form
-     */
-    for (i = 0; i < num_beams; i++)
-    {
-        ctemp = *ptr;
-        *dptr = (((double) ctemp) /
-            sf->scaleTable[id - 1].multiplier) -
-            sf->scaleTable[id - 1].offset;
-        ptr++;
-        dptr++;
-    }
-    return (ptr - sptr);
-}
-
-/********************************************************************
- *
- * Function Name : DecodeFromByteToUnsignedShortArray
- *
- * Description :
- *  This function decodes an unsigned short integer array of beam data
- *   from external byte stream form to internal engineering units form.
- *   This function allocates the memory for the array if it does not exist.
- *   This function also reallocates the memory for the array when the number
- *   of beams changes. Note that this function decodes a one byte value from
- *   the stream for each element of the (unsigned short) array.  The encoded
- *   (after scaling) dynamic range supported for this array is 0 - 255.
- *
- * Inputs :
- *    array = the address of a pointer to an unsigned short where the array of data
- *            will be stored
- *    sptr = a pointer the char buffer containing the byte stream
- *           to read from.
- *    num_beams = an integer containing the number of beams which is used to
- *                dimension the array
- *    sf = a pointer to the scale factors structure containing the data scaling
- *         information
- *    id = the integer id for the subrecord, which is used as the index into
- *         the scale factors structure.
- *    handle = the integer handle for the data file being read, which is used
- *             to store the current number of beams
- *
- * Returns :
- *  This function returns the number of bytes decoded if successful, or
- *  -1 if an error occured.
- *
- * Error Conditions :
- *    GSF_ILLEGAL_SCALE_FACTOR_MULTIPLIER
- *    GSF_INVALID_NUM_BEAMS
- *    GSF_MEMORY_ALLOCATION_FAILED
- *
- ********************************************************************/
-static int
-DecodeFromByteToUnsignedShortArray(unsigned short **array, unsigned char *sptr, int num_beams,
-    gsfScaleFactors * sf, int id, int handle)
-{
-    unsigned short *dptr;
-    unsigned char  *ptr = sptr;
-    unsigned char   ctemp;
-    int             i;
-
-    /* make sure we have a scale factor multiplier */
-    if (sf->scaleTable[id - 1].multiplier < 1.0e-6)
-    {
-        gsfError = GSF_ILLEGAL_SCALE_FACTOR_MULTIPLIER;
-        return (-1);
-    }
-
-    if (num_beams <= 0)
-    {
-        gsfError = GSF_INVALID_NUM_BEAMS;
-        return(-1);
-    }
-
-    /* Allocate memory for the array if none has been allocated yet */
-    if (*array == (unsigned short *) NULL)
-    {
-        *array = (unsigned short *) calloc(num_beams, sizeof(unsigned short));
-
-        if (*array == (unsigned short *) NULL)
-        {
-            gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-            return (-1);
-        }
-        arraySize[handle - 1][id - 1] = num_beams;
-    }
-
-    /* Make sure there memory allocated for the array is sufficient, some
-    *  system have a different number of beams depending on depth
-    */
-    if (num_beams > arraySize[handle - 1][id - 1])
-    {
-        *array = (unsigned short *) realloc((void *) *array, num_beams * sizeof(unsigned short));
-
-        if (*array == (unsigned short *) NULL)
-        {
-            gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-            return (-1);
-        }
-        memset(*array, 0, num_beams * sizeof(unsigned short));
-
-        arraySize[handle - 1][id - 1] = num_beams;
-    }
-
-    dptr = *array;
-
-    /* loop for the number of beams, loading each value from the byte stream
-    *  into internal form
-    */
-    for (i = 0; i < num_beams; i++)
-    {
-        ctemp = *ptr;
-        *dptr = (((unsigned short) ctemp) /
-            sf->scaleTable[id - 1].multiplier) -
-            sf->scaleTable[id - 1].offset;
-        ptr++;
-        dptr++;
-    }
-    return (ptr - sptr);
-}
-
-/********************************************************************
- *
- * Function Name : DecodeSignedByteArray
- *
- * Description :
- *  This function decodes a byte array of beam data from external byte
- *   stream form to internal engineering units form.  This function allocates
- *   the memory for the array if it does not exist.  This function also
- *   reallocates the memory for the array when the number of beams changes.
- *
- * Inputs :
- *    array = the address of a pointer to a double where the array of data
- *            will be stored
- *    sptr = a pointer the char buffer containing the byte stream
- *           to read from.
- *    num_beams = an integer containing the number of beams which is used to
- *                dimension the array
- *    sf = a pointer to the scale factors structure containing the data scaling
- *         information
- *    id = the integer id for the subrecord, which is used as the index into
- *         the scale factors structure.
- *    handle = the integer handle for the data file being read, which is used
- *             to store the current number of beams
- *
- * Returns :
- *  This function returns the number of bytes decoded if successful, or
- *  -1 if an error occured.
- *
- * Error Conditions :
- *    GSF_ILLEGAL_SCALE_FACTOR_MULTIPLIER
- *    GSF_INVALID_NUM_BEAMS
- *    GSF_MEMORY_ALLOCATION_FAILED
- *
- ********************************************************************/
-static int
-DecodeSignedByteArray(double **array, char *sptr, int num_beams,
-    gsfScaleFactors * sf, int id, int handle)
-{
-    double         *dptr;
-    signed char    *ptr = (signed char *) sptr;
-    signed char     ctemp;
-    int             i;
-
-    /* make sure we have a scale factor multiplier */
-    if (sf->scaleTable[id - 1].multiplier < 1.0e-6)
-    {
-        gsfError = GSF_ILLEGAL_SCALE_FACTOR_MULTIPLIER;
-        return (-1);
-    }
-
-    if (num_beams <= 0)
-    {
-        gsfError = GSF_INVALID_NUM_BEAMS;
-        return(-1);
-    }
-
-    /* Allocate memory for the array if none has been allocated yet */
-    if (*array == (double *) NULL)
-    {
-        *array = (double *) calloc(num_beams, sizeof(double));
-
-        if (*array == (double *) NULL)
-        {
-            gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-            return (-1);
-        }
-        arraySize[handle - 1][id - 1] = num_beams;
-    }
-
-    /* Make sure there memory allocated for the array is sufficient, some
-    *  system have a different number of beams depending on depth
-    */
-    if (num_beams > arraySize[handle - 1][id - 1])
-    {
-        *array = (double *) realloc((void *) *array, num_beams * sizeof(double));
-
-        if (*array == (double *) NULL)
-        {
-            gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-            return (-1);
-        }
-        memset(*array, 0, num_beams * sizeof(double));
-
-        arraySize[handle - 1][id - 1] = num_beams;
-    }
-
-    dptr = *array;
-
-    /* loop for the number of beams, loading each value from the byte stream
-    *  into internal form
-    */
-    for (i = 0; i < num_beams; i++)
-    {
-        ctemp = *ptr;
-        *dptr = (((double) ctemp) /
-            sf->scaleTable[id - 1].multiplier) -
-            sf->scaleTable[id - 1].offset;
-        ptr++;
-        dptr++;
-    }
-    return (ptr - (signed char *) sptr);
-}
-
-/********************************************************************
- *
- * Function Name : DecodeBeamFlagsArray
- *
- * Description :
- *  This function is used to decode the ping flags array from gsf byte stream
- *  form into internal forma.
- *
- * Inputs :
- *    array = the address of a pointer to an unsigned char to be loaded with
- *            the array of beam data
- *    sptr = a pointer to an unsigned char containing the byte stream to read
- *    num_beams = an integer containing the number of beams
- *    handle = an integer containing the handle for this file, used to record
- *             the number of beams for memory reallocation purposes.
- *
- * Returns :
- *  This function returns the number of bytes decoded if successful, or
- *  -1 if an error occured.
- *
- * Error Conditions :
- *    GSF_INVALID_NUM_BEAMS
- *    GSF_MEMORY_ALLOCATION_FAILED
- *
- ********************************************************************/
-
-static int
-DecodeBeamFlagsArray(unsigned char **array, unsigned char *sptr, int num_beams, int handle)
-{
-    unsigned char  *ptr = sptr;
-    unsigned char  *aptr;
-    int             i;
-    int             id = GSF_SWATH_BATHY_SUBRECORD_BEAM_FLAGS_ARRAY;
-
-    if (num_beams <= 0)
-    {
-        gsfError = GSF_INVALID_NUM_BEAMS;
-        return(-1);
-    }
-
-    /* Allocate memory for the array if none has been allocated yet */
-    if (*array == (unsigned char *) NULL)
-    {
-        *array = (unsigned char *) calloc(num_beams, sizeof(unsigned char));
-
-        if (*array == (unsigned char *) NULL)
-        {
-            gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-            return (-1);
-        }
-        arraySize[handle - 1][id - 1] = num_beams;
-    }
-
-    /* Make sure there memory allocated for the array is sufficient, some
-    *  system have a different number of beams depending on depth
-    */
-    if (num_beams > arraySize[handle - 1][id - 1])
-    {
-        *array = (unsigned char *) realloc((void *) *array, num_beams * sizeof(unsigned char));
-
-        if (*array == (unsigned char *) NULL)
-        {
-            gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-            return (-1);
-        }
-        memset(*array, 0, num_beams * sizeof(unsigned char));
-
-        arraySize[handle - 1][id - 1] = num_beams;
-    }
-
-    /* loop for the number of beams, loading each value from the byte stream
-    *  into internal form
-    */
-    aptr = *array;
-    for (i = 0; i < num_beams; i++)
-    {
-        *aptr = *ptr;
-        ptr++;
-        aptr++;
-    }
-    return (ptr - sptr);
-}
-
-/********************************************************************
- *
- * Function Name : DecodeQualityFlagsArray
- *
- * Description :
- *  This function is used to decode the two bit beam detection quality flags
- *  provided by Reson sonar systems.
- *
- * Inputs :
- *    array = the address of a pointer to an unsigned char to be loaded with
- *            the array of beam data
- *    sptr = a pointer to an unsigned char containing the byte stream to read
- *    num_beams = an integer containing the number of beams
- *    sr_size = size of the quality flags record
- *    handle = an integer containing the handle for this file, used to record
- *             the number of beams for memory reallocation purposes.
- *
- * Returns :
- *  This function returns the number of bytes decoded if successful, or
- *  -1 if an error occured.
- *
- * Error Conditions :
- *    GSF_INVALID_NUM_BEAMS
- *    GSF_MEMORY_ALLOCATION_FAILED
- *
- ********************************************************************/
-static int
-DecodeQualityFlagsArray(unsigned char **array, unsigned char *sptr, int num_beams, int sr_size, int handle)
-{
-    unsigned char  *ptr = sptr;
-    unsigned char  *aptr;
-    int             i;
-    int             j;
-    int             shift;
-    unsigned char   mask[4];
-    int             id = GSF_SWATH_BATHY_SUBRECORD_QUALITY_FLAGS_ARRAY;
-    int             count;
-
-    if (num_beams <= 0)
-    {
-        gsfError = GSF_INVALID_NUM_BEAMS;
-        return(-1);
-    }
-
-    /* Allocate memory for the array if none has been allocated yet */
-    if (*array == (unsigned char *) NULL)
-    {
-        *array = (unsigned char *) calloc(num_beams, sizeof(unsigned char));
-
-        if (*array == (unsigned char *) NULL)
-        {
-            gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-            return (-1);
-        }
-        arraySize[handle - 1][id - 1] = num_beams;
-    }
-
-    /* Make sure there memory allocated for the array is sufficient, some
-    *  system have a different number of beams depending on depth
-    */
-    if (num_beams > arraySize[handle - 1][id - 1])
-    {
-        *array = (unsigned char *) realloc((void *) *array, num_beams * sizeof(unsigned char));
-
-        if (*array == (unsigned char *) NULL)
-        {
-            gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-            return (-1);
-        }
-        memset(*array, 0, num_beams * sizeof(unsigned char));
-
-        arraySize[handle - 1][id - 1] = num_beams;
-    }
-
-    /* Unpack the array values */
-    shift = 6;
-    aptr = *array;
-    j = 0;
-    mask[0] = 192;   /* bits 7 and 6 */
-    mask[1] =  48;   /* bits 5 and 4 */
-    mask[2] =  12;   /* bits 3 and 2 */
-    mask[3] =   3;   /* bits 1 and 0 */
-
-    if ((sr_size * 4) < num_beams)
-        count = sr_size * 4; // not all the beams were encoded, only read the encoded beams
-    else
-        count = num_beams; // all beams encoded
-
-    for (i = 0; i < count; i++)
-    {
-        *aptr = (*ptr & mask[j]) >> shift;
-        aptr++;
-
-        if (shift == 0)
-        {
-            ptr++;
-            shift = 6;
-            j = 0;
-        }
-        else
-        {
-            j++;
-            shift -= 2;
-        }
-    }
-
-    /*  If j doesn't get reset to 0 then we have a number of beams that is not evenly divisible by 4.  This causes all
-        sorts of problems because the sensor_id will get set to the wrong number when it returns to gsfDecodeSwathBathymetryPing.
-        The problem is that we actually decoded part of another byte but we didn't increment the ptr.  */
-
-    if (j) ptr++;
-
-    return (ptr - sptr);
-}
-
-/********************************************************************
- *
- * Function Name : DecodeSeabeamSpecific
- *
- * Description : This function decodes the SeaBeam specific ping subrecord
- *  from external byte stream form into internal form.
- *
- * Inputs :
- *    sdata = a pointer to the union of sensor specific data to be loaded
- *    sptr = a pointer to an unsigned char buffer containing the byte stream
- *           to read.
- *
- * Returns : This function returns the number of bytes enocoded.
- *
- * Error Conditions : none
- *
- ********************************************************************/
-
-static int
-DecodeSeabeamSpecific(gsfSensorSpecific * sdata, unsigned char *sptr)
-{
-    gsfuShort       stemp;
-
-    memcpy(&stemp, sptr, 2);
-    sdata->gsfSeaBeamSpecific.EclipseTime = (unsigned short) ntohs(stemp);
-
-    return (2);
-}
-
-/********************************************************************
- *
- * Function Name : DecodeEM12Specific
- *
- * Description : Decodes the EM12 sensor specific data
- *
- * Inputs :
- *    sdata = a pointer to the union of sensor specific data to be loaded
- *    sptr = a pointer to an unsigned char buffer containing the byte stream
- *           to read.
- *
- * Returns : This function returns the number of bytes enocoded.
- *
- * Error Conditions : none
- *
- ********************************************************************/
-static int
-DecodeEM12Specific (gsfSensorSpecific * sdata, unsigned char *sptr)
-{
-    unsigned char  *p = sptr;
-    gsfuShort       stemp;
-
-    /* First two byte integer contains the ping number */
-    memcpy(&stemp, p, 2);
-    sdata->gsfEM12Specific.ping_number = (int) ntohs(stemp);
-    p += 2;
-
-    /* Next byte contains the resolution */
-    sdata->gsfEM12Specific.resolution = (int) *p;
-    p += 1;
-
-    /* Next byte contains the ping quality factor */
-    sdata->gsfEM12Specific.ping_quality = (int) *p;
-    p += 1;
-
-    /* Next two byte integer contains the sea surface sound speed * 10 */
-    memcpy(&stemp, p, 2);
-    sdata->gsfEM12Specific.sound_velocity = ((double) ntohs(stemp)) / 10.0;
-    p += 2;
-
-    /* Next byte is operational mode */
-    sdata->gsfEM12Specific.mode = (int) *p;
-    p += 1;
-
-    /* The next 32 bytes are spare space for future use */
-    memset (&sdata->gsfEM12Specific.spare, 0, 32);
-    p += 32;
-
-    return (p - sptr);
-}
-
-/********************************************************************
- *
- * Function Name : DecodeEm100Specific
- *
- * Description : This function decodes the simrad em100 specific ping subrecord
- *    from external byte stream form into internal form.
- *
- * Inputs :
- *    sdata = a pointer to the union of sensor specific data to be loaded
- *    sptr = a pointer to an unsigned char buffer containing the byte stream
- *           to read.
- *
- * Returns : This function returns the number of bytes enocoded.
- *
- * Error Conditions : none
- *
- ********************************************************************/
-
-static int
-DecodeEM100Specific(gsfSensorSpecific * sdata, unsigned char *sptr)
-{
-    unsigned char  *p = sptr;
-    gsfsShort       signed_short;
-    gsfuShort       stemp;
-
-    /* First two byte integer contains the ship pitch */
-    memcpy(&stemp, p, 2);
-    signed_short = (signed) ntohs(stemp);
-    sdata->gsfEM100Specific.ship_pitch = ((double) signed_short) / 100.0;
-    p += 2;
-
-    /* Next two byte integer contains the transducer pitch */
-    memcpy(&stemp, p, 2);
-    signed_short = (signed) ntohs(stemp);
-    sdata->gsfEM100Specific.transducer_pitch = ((double) signed_short) / 100.0;
-    p += 2;
-
-    /* Next byte contains the sonar mode (from the em100 amplitude datagram) */
-    sdata->gsfEM100Specific.mode = (int) *p;
-    p += 1;
-
-    /* Next byte contains the power (from the em100 amplitude datagram) */
-    sdata->gsfEM100Specific.power = (int) *p;
-    p += 1;
-
-    /* Next byte contains the attenuation (from the em100 amplitude datagram) */
-    sdata->gsfEM100Specific.attenuation = (int) *p;
-    p += 1;
-
-    /* Next byte contains the tvg (from the em100 amplitude datagram) */
-    sdata->gsfEM100Specific.tvg = (int) *p;
-    p += 1;
-
-    /* Next byte contains the pulse length from the em100 amplitude datagram) */
-    sdata->gsfEM100Specific.pulse_length = (int) *p;
-    p += 1;
-
-    /* Next two byte integer contains the counter from the em100
-    * amplitude datagram
-    */
-    memcpy(&stemp, p, 2);
-    p += 2;
-    sdata->gsfEM100Specific.counter = (int) ntohs(stemp);
-
-    return (p - sptr);
-}
-
-/********************************************************************
- *
- * Function Name : DecodeEm950Specific
- *
- * Description :
- *
- * Inputs :
- *    sdata = a pointer to the union of sensor specific data to be loaded
- *    sptr = a pointer to an unsigned char buffer containing the byte stream
- *           to read.
- *
- * Returns : This function returns the number of bytes enocoded.
- *
- * Error Conditions : none
- *
- ********************************************************************/
-
-static int
-DecodeEM950Specific(gsfSensorSpecific * sdata, unsigned char *sptr)
-{
-    unsigned char  *p = sptr;
-    gsfuShort       stemp;
-    gsfsShort       signed_short;
-
-    /* First two byte integer contains the ping number */
-    memcpy(&stemp, p, 2);
-    sdata->gsfEM950Specific.ping_number = (int) ntohs(stemp);
-    p += 2;
-
-    /* Next byte contains the sonar mode of operation */
-    sdata->gsfEM950Specific.mode = (int) *p;
-    p += 1;
-
-    /* Next byte contains the ping quality factor*/
-    sdata->gsfEM950Specific.ping_quality = (char) *p;
-    p += 1;
-
-    /* Next two byte integer contains the transducer pitch */
-    memcpy(&stemp, p, 2);
-    signed_short = (signed) ntohs(stemp);
-    p += 2;
-    sdata->gsfEM950Specific.ship_pitch = ((double) signed_short) / 100.0;
-
-    /* Next two byte integer contains the transducer pitch */
-    memcpy(&stemp, p, 2);
-    signed_short = (signed) ntohs(stemp);
-    p += 2;
-    sdata->gsfEM950Specific.transducer_pitch = ((double) signed_short) / 100.0;
-
-    /* Next two byte integer contains the sea surface sound speed * 10 */
-    memcpy(&stemp, p, 2);
-    sdata->gsfEM950Specific.surface_velocity = ((double) ntohs(stemp)) / 10.0;
-    p += 2;
-
-    return (p - sptr);
-}
-
-/********************************************************************
- *
- * Function Name : DecodeEm1000Specific
- *
- * Description :
- *
- * Inputs :
- *    sdata = a pointer to the union of sensor specific data to be loaded
- *    sptr = a pointer to an unsigned char buffer containing the byte stream
- *           to read.
- *
- * Returns : This function returns the number of bytes enocoded.
- *
- * Error Conditions : none
- *
- ********************************************************************/
-
-static int
-DecodeEM1000Specific(gsfSensorSpecific * sdata, unsigned char *sptr)
-{
-    unsigned char  *p = sptr;
-    gsfuShort       stemp;
-    gsfsShort       signed_short;
-
-    /* First two byte integer contains the ping number */
-    memcpy(&stemp, p, 2);
-    sdata->gsfEM1000Specific.ping_number = (int) ntohs(stemp);
-    p += 2;
-
-    /* Next byte contains the sonar mode of operation */
-    sdata->gsfEM1000Specific.mode = (int) *p;
-    p += 1;
-
-    /* Next byte contains the ping quality factor*/
-    sdata->gsfEM1000Specific.ping_quality = (char) *p;
-    p += 1;
-
-    /* Next two byte integer contains the transducer pitch */
-    memcpy(&stemp, p, 2);
-    signed_short = (signed) ntohs(stemp);
-    p += 2;
-    sdata->gsfEM1000Specific.ship_pitch = ((double) signed_short) / 100.0;
-
-    /* Next two byte integer contains the transducer pitch */
-    memcpy(&stemp, p, 2);
-    signed_short = (signed) ntohs(stemp);
-    p += 2;
-    sdata->gsfEM1000Specific.transducer_pitch = ((double) signed_short) / 100.0;
-
-    /* Next two byte integer contains the sea surface sound speed * 10 */
-    memcpy(&stemp, p, 2);
-    sdata->gsfEM1000Specific.surface_velocity = ((double) ntohs(stemp)) / 10.0;
-    p += 2;
-
-    return (p - sptr);
-}
-
-/********************************************************************
- *
- * Function Name : DecodeEm121ASpecific
- *
- * Description : This function decodes the simrad em121a specific ping
- *    subrecord from external byte stream form into internal form.
- *
- * Inputs :
- *    sdata = a pointer to the union of sensor specific data to be loaded
- *    sptr = a pointer to an unsigned char buffer containing the byte stream
- *           to read.
- *
- * Returns : This function returns the number of bytes decoded.
- *
- * Error Conditions : none
- *
- ********************************************************************/
-
-static int
-DecodeEM121ASpecific(gsfSensorSpecific *sdata, unsigned char *sptr)
-{
-    unsigned char  *p = sptr;
-    gsfuShort       stemp;
-
-    /* First two byte integer contains the ping number */
-    memcpy(&stemp, p, 2);
-    sdata->gsfEM121ASpecific.ping_number = (int) ntohs(stemp);
-    p += 2;
-
-    /* Next byte contains the sonar mode of operation */
-    sdata->gsfEM121ASpecific.mode = (int) *p;
-    p += 1;
-
-    /* Next byte contains the number of valid beams */
-    sdata->gsfEM121ASpecific.valid_beams = (int) *p;
-    p += 1;
-
-    /* Next byte contains the transmit pulse length */
-    sdata->gsfEM121ASpecific.pulse_length = (int) *p;
-    p += 1;
-
-    /* Next byte contains the sonar beam width */
-    sdata->gsfEM121ASpecific.beam_width = (int) *p;
-    p += 1;
-
-    /* Next byte contains the transmit power level */
-    sdata->gsfEM121ASpecific.tx_power = (int) *p;
-    p += 1;
-
-    /* Next byte contains the number of transmit channels NOT working */
-    sdata->gsfEM121ASpecific.tx_status = (int) *p;
-    p += 1;
-
-    /* Next byte contains the number of receive channels NOT working */
-    sdata->gsfEM121ASpecific.rx_status = (int) *p;
-    p += 1;
-
-    /* Next two byte integer contains the sea surface sound speed * 10 */
-    memcpy(&stemp, p, 2);
-    sdata->gsfEM121ASpecific.surface_velocity = ((double) ntohs(stemp)) / 10.0;
-    p += 2;
-
-    return (p - sptr);
-}
-
-/********************************************************************
- *
- * Function Name : DecodeEm121Specific
- *
- * Description : This function decodes the simrad em121 specific ping
- *    subrecord from external byte stream form into internal form.
- *
- * Inputs :
- *    sdata = a pointer to the union of sensor specific data to be loaded
- *    sptr = a pointer to an unsigned char buffer containing the byte stream
- *           to read.
- *
- * Returns : This function returns the number of bytes decoded.
- *
- * Error Conditions : none
- *
- ********************************************************************/
-
-static int
-DecodeEM121Specific(gsfSensorSpecific *sdata, unsigned char *sptr)
-{
-    unsigned char  *p = sptr;
-    gsfuShort       stemp;
-
-    /* First two byte integer contains the ping number */
-    memcpy(&stemp, p, 2);
-    sdata->gsfEM121Specific.ping_number = (int) ntohs(stemp);
-    p += 2;
-
-    /* Next byte contains the sonar mode of operation */
-    sdata->gsfEM121Specific.mode = (int) *p;
-    p += 1;
-
-    /* Next byte contains the number of valid beams */
-    sdata->gsfEM121Specific.valid_beams = (int) *p;
-    p += 1;
-
-    /* Next byte contains the transmit pulse length */
-    sdata->gsfEM121Specific.pulse_length = (int) *p;
-    p += 1;
-
-    /* Next byte contains the sonar beam width */
-    sdata->gsfEM121Specific.beam_width = (int) *p;
-    p += 1;
-
-    /* Next byte contains the transmit power level */
-    sdata->gsfEM121Specific.tx_power = (int) *p;
-    p += 1;
-
-    /* Next byte contains the number of transmit channels NOT working */
-    sdata->gsfEM121Specific.tx_status = (int) *p;
-    p += 1;
-
-    /* Next byte contains the number of receive channels NOT working */
-    sdata->gsfEM121Specific.rx_status = (int) *p;
-    p += 1;
-
-    /* Next two byte integer contains the sea surface sound speed * 10 */
-    memcpy(&stemp, p, 2);
-    sdata->gsfEM121Specific.surface_velocity = ((double) ntohs(stemp)) / 10.0;
-    p += 2;
-
-    return (p - sptr);
-}
-
-/********************************************************************
- *
- * Function Name : DecodeCmpSassSpecific
- *
- * Description : This function decodes the Compressed SASS specific ping
- *    subrecord from external byte stream form into internal form.
- *
- * Inputs :
- *    sdata = a pointer to the union of sensor specific data to be loaded
- *    sptr = a pointer to an unsigned char buffer containing the byte stream
- *           to read.
- *
- * Returns : This function returns the number of bytes enocoded.
- *
- * Error Conditions : none
- *
- ********************************************************************/
-
-static int
-DecodeCmpSassSpecific(gsfSensorSpecific * sdata, unsigned char *sptr)
-{
-    unsigned char  *p = sptr;
-    gsfuShort       stemp;
-
-    memcpy(&stemp, p, 2);
-    sdata->gsfCmpSassSpecific.lfreq = ((double) ntohs(stemp)) / 10.0;
-    p += 2;
-
-    memcpy(&stemp, p, 2);
-    sdata->gsfCmpSassSpecific.lntens = ((double) ntohs(stemp)) / 10.0;
-    p += 2;
-
-    return (p - sptr);
-}
-
-
-#if 1
-/* 3-30-99: obsolete */
-/********************************************************************
- *
- * Function Name : DecodeSassSpecific
- *
- * Description : This function decodes the Typeiii SASS specific ping
- *    subrecord from external byte stream form into internal form.
- *
- * Inputs :
- *    sdata = a pointer to the union of sensor specific data to be loaded
- *    sptr = a pointer to an unsigned char buffer containing the byte stream
- *           to read.
- *
- * Returns : This function returns the number of bytes enocoded.
- *
- * Error Conditions : none
- *
- ********************************************************************/
-
-static int
-DecodeSASSSpecific(gsfSensorSpecific * sdata, unsigned char *sptr)
-{
-    unsigned char  *p = sptr;
-    gsfuShort       stemp;
-
-    /* First two byte integer contains the leftmost beam */
-    memcpy(&stemp, p, 2);
-    sdata->gsfSASSSpecific.leftmost_beam = (int) ntohs(stemp);
-    p += 2;
-
-    /* Next two byte integer contains the rightmost beam */
-    memcpy(&stemp, p, 2);
-    sdata->gsfSASSSpecific.rightmost_beam = (int) ntohs(stemp);
-    p += 2;
-
-    /* Next two byte integer contains the total number of beams */
-    memcpy(&stemp, p, 2);
-    sdata->gsfSASSSpecific.total_beams = (int) ntohs(stemp);
-    p += 2;
-
-    /* Next two byte integer contains the navigation mode */
-    memcpy(&stemp, p, 2);
-    sdata->gsfSASSSpecific.nav_mode = (int) ntohs(stemp);
-    p += 2;
-
-    /* Next two byte integer contains the ping number */
-    memcpy(&stemp, p, 2);
-    sdata->gsfSASSSpecific.ping_number = (int) ntohs(stemp);
-    p += 2;
-
-    /* Next two byte integer contains the mission number */
-    memcpy(&stemp, p, 2);
-    sdata->gsfSASSSpecific.mission_number = (int) ntohs(stemp);
-    p += 2;
-
-    return (p - sptr);
-}
-
-/********************************************************************
- *
- * Function Name : DecodeTypeIIISeaBeamSpecific
- *
- * Description : not implimented yet
- *
- * Inputs :
- *    sdata = a pointer to the union of sensor specific data to be loaded
- *    sptr = a pointer to an unsigned char buffer containing the byte stream
- *           to read.
- *
- * Returns : This function returns the number of bytes enocoded.
- *
- * Error Conditions : none
- *
- ********************************************************************/
-
-static int
-DecodeTypeIIISeaBeamSpecific(gsfSensorSpecific * sdata, unsigned char *sptr)
-{
-    unsigned char  *p = sptr;
-    gsfuShort       stemp;
-
-    /* First two byte integer contains the leftmost beam */
-    memcpy(&stemp, p, 2);
-    sdata->gsfTypeIIISeaBeamSpecific.leftmost_beam = (int) ntohs(stemp);
-    p += 2;
-
-    /* Next two byte integer contains the rightmost beam */
-    memcpy(&stemp, p, 2);
-    sdata->gsfTypeIIISeaBeamSpecific.rightmost_beam = (int) ntohs(stemp);
-    p += 2;
-
-    /* Next two byte integer contains the total number of beams */
-    memcpy(&stemp, p, 2);
-    sdata->gsfTypeIIISeaBeamSpecific.total_beams = (int) ntohs(stemp);
-    p += 2;
-
-    /* Next two byte integer contains the navigation mode */
-    memcpy(&stemp, p, 2);
-    sdata->gsfTypeIIISeaBeamSpecific.nav_mode = (int) ntohs(stemp);
-    p += 2;
-
-    /* Next two byte integer contains the ping number */
-    memcpy(&stemp, p, 2);
-    sdata->gsfTypeIIISeaBeamSpecific.ping_number = (int) ntohs(stemp);
-    p += 2;
-
-    /* Next two byte integer contains the mission number */
-    memcpy(&stemp, p, 2);
-    sdata->gsfTypeIIISeaBeamSpecific.mission_number = (int) ntohs(stemp);
-    p += 2;
-
-    return (p - sptr);
-}
-#endif
-
-/********************************************************************
- *
- * Function Name : DecodeSeaMapSpecific
- *
- * Description : not implimented yet
- *
- * Inputs :
- *    sdata = a pointer to the union of sensor specific data to be loaded
- *    sptr = a pointer to an unsigned char buffer containing the byte stream
- *           to read.
- *
- * Returns : This function returns the number of bytes enocoded.
- *
- * Error Conditions : none
- *
- ********************************************************************/
-
-static int
-DecodeSeaMapSpecific(gsfSensorSpecific * sdata, unsigned char *sptr, GSF_FILE_TABLE *ft)
-{
-    unsigned char  *p = sptr;
-    gsfuShort       stemp;
-
-    memcpy(&stemp, p, 2);
-    sdata->gsfSeamapSpecific.portTransmitter[0] = ((double) ntohs(stemp)) / 10.0;
-    p += 2;
-
-    memcpy(&stemp, p, 2);
-    sdata->gsfSeamapSpecific.portTransmitter[1] = ((double) ntohs(stemp)) / 10.0;
-    p += 2;
-
-    memcpy(&stemp, p, 2);
-    sdata->gsfSeamapSpecific.stbdTransmitter[0] = ((double) ntohs(stemp)) / 10.0;
-    p += 2;
-
-    memcpy(&stemp, p, 2);
-    sdata->gsfSeamapSpecific.stbdTransmitter[1] = ((double) ntohs(stemp)) / 10.0;
-    p += 2;
-
-    memcpy(&stemp, p, 2);
-    sdata->gsfSeamapSpecific.portGain = ((double) ntohs(stemp)) / 10.0;
-    p += 2;
-
-    memcpy(&stemp, p, 2);
-    sdata->gsfSeamapSpecific.stbdGain = ((double) ntohs(stemp)) / 10.0;
-    p += 2;
-
-    memcpy(&stemp, p, 2);
-    sdata->gsfSeamapSpecific.portPulseLength = ((double) ntohs(stemp)) / 10.0;
-    p += 2;
-
-    memcpy(&stemp, p, 2);
-    sdata->gsfSeamapSpecific.stbdPulseLength = ((double) ntohs(stemp)) / 10.0;
-    p += 2;
-
-    memcpy(&stemp, p, 2);
-    sdata->gsfSeamapSpecific.pressureDepth = ((double) ntohs(stemp)) / 10.0;
-    /* JSB 11/08/2007; looks like the pointer increment for this field in the encode processing has been missing
-     *  since this code block was first written in GSFv1.03
-     */
-    if ((ft->major_version_number > 2) || ((ft->major_version_number == 2) && (ft->minor_version_number > 7)))
-    {
-        p += 2;
-    }
-
-    memcpy(&stemp, p, 2);
-    sdata->gsfSeamapSpecific.altitude = ((double) ntohs(stemp)) / 10.0;
-    p += 2;
-
-    memcpy(&stemp, p, 2);
-    sdata->gsfSeamapSpecific.temperature = ((double) ntohs(stemp)) / 10.0;
-    p += 2;
-
-
-    return (p - sptr);
-}
-
-/********************************************************************
- *
- * Function Name : DecodeSeaBatSpecific
- *
- * Description : This function decodes the sensor specific subrecord for
- *    Reson SeaBat data.
- *
- * Inputs :
- *    sdata = a pointer to the union of sensor specific data to be loaded
- *    sptr = a pointer to an unsigned char buffer containing the byte stream
- *           to read.
- *
- * Returns : This function returns the number of bytes enocoded.
- *
- * Error Conditions : none
- *
- ********************************************************************/
-
-static int
-DecodeSeaBatSpecific(gsfSensorSpecific * sdata, unsigned char *sptr)
-{
-    unsigned char  *p = sptr;
-    gsfuShort       stemp;
-
-    /* First two byte integer contains the ping number */
-    memcpy(&stemp, p, 2);
-    sdata->gsfSeaBatSpecific.ping_number = (int) ntohs(stemp);
-    p += 2;
-
-    /* Next two byte integer contains the sea surface sound speed * 10 */
-    memcpy(&stemp, p, 2);
-    sdata->gsfSeaBatSpecific.surface_velocity = ((double) ntohs(stemp)) / 10.0;
-    p += 2;
-
-    /* Next byte contains the sonar mode of operation */
-    sdata->gsfSeaBatSpecific.mode = (int) *p;
-    p += 1;
-
-    /* Next byte contains the sonar range for this ping */
-    sdata->gsfSeaBatSpecific.sonar_range = (int) *p;
-    p += 1;
-
-    /* Next byte contains the sonar transmit power for this ping */
-    sdata->gsfSeaBatSpecific.transmit_power = (int) *p;
-    p += 1;
-
-    /* Next byte contains the sonar receive gain for this ping */
-    sdata->gsfSeaBatSpecific.receive_gain = (int) *p;
-    p += 1;
-
-    return (p - sptr);
-}
-
-/********************************************************************
- *
- * Function Name : DecodeSBAmpSpecific
- *
- * Description : This function decodes the sensor specific subrecord for
- *    Sea Beam with amplitude data.
- *
- * Inputs :
- *    sdata = a pointer to the union of sensor specific data to be loaded
- *    sptr = a pointer to an unsigned char buffer containing the byte stream
- *           to read.
- *
- * Returns : This function returns the number of bytes enocoded.
- *
- * Error Conditions : none
- *
- ********************************************************************/
-
-static int
-DecodeSBAmpSpecific(gsfSensorSpecific * sdata, unsigned char *sptr)
-{
-    unsigned char  *p = sptr;
-    gsfuShort       stemp;
-    gsfuLong        ltemp;
-
-    /* First byte contains the hour from the Eclipse */
-    sdata->gsfSBAmpSpecific.hour = (int) *p;
-    p += 1;
-
-    /* Next byte contains the minutes from the Eclipse */
-    sdata->gsfSBAmpSpecific.minute = (int) *p;
-    p += 1;
-
-    /* Next byte contains the seconds from the Eclipse */
-    sdata->gsfSBAmpSpecific.second = (int) *p;
-    p += 1;
-
-    /* Next byte contains the hundredths of seconds from the Eclipse */
-    sdata->gsfSBAmpSpecific.hundredths = (int) *p;
-    p += 1;
-
-    /* Next four byte integer contains the block number */
-    memcpy(&ltemp, p, 4);
-    sdata->gsfSBAmpSpecific.block_number = (int) ntohl(ltemp);
-    p += 4;
-
-    /* Next two byte integer contains the average gate depth */
-    memcpy(&stemp, p, 2);
-    sdata->gsfSBAmpSpecific.avg_gate_depth = (int) ntohs(stemp);
-    p += 2;
-
-    return (p - sptr);
-}
-
-/********************************************************************
- *
- * Function Name : DecodeSeaBatIISpecific
- *
- * Description : This function decodes the Reson SeaBat II sensor specific
- *    information from the GSF byte stream.
- *
- * Inputs :
- *    sdata = a pointer to the union of sensor specific data to be loaded
- *    sptr = a pointer to an unsigned char buffer containing the byte stream
- *           to read.
- *
- * Returns : This function returns the number of bytes enocoded.
- *
- * Error Conditions : none
- *
- ********************************************************************/
-
-static int
-DecodeSeaBatIISpecific(gsfSensorSpecific * sdata, unsigned char *sptr)
-{
-    unsigned char  *p = sptr;
-    gsfuShort       stemp;
-
-    /* First two byte integer contains the ping number */
-    memcpy(&stemp, p, 2);
-    sdata->gsfSeaBatIISpecific.ping_number = (int) ntohs(stemp);
-    p += 2;
-
-    /* Next two byte integer contains the sea surface sound speed * 10 */
-    memcpy(&stemp, p, 2);
-    sdata->gsfSeaBatIISpecific.surface_velocity = ((double) ntohs(stemp)) / 10.0;
-    p += 2;
-
-    /* Next two byte integer contains the sonar mode of operation */
-    memcpy(&stemp, p, 2);
-    sdata->gsfSeaBatIISpecific.mode = (int) ntohs(stemp);
-    p += 2;
-
-    /* Next two byte integer contains the range setting */
-    memcpy(&stemp, p, 2);
-    sdata->gsfSeaBatIISpecific.sonar_range = (int) ntohs(stemp);
-    p += 2;
-
-    /* Next two byte integer contains the power setting */
-    memcpy(&stemp, p, 2);
-    sdata->gsfSeaBatIISpecific.transmit_power = (int) ntohs(stemp);
-    p += 2;
-
-    /* Next two byte integer contains the gain setting */
-    memcpy(&stemp, p, 2);
-    sdata->gsfSeaBatIISpecific.receive_gain = (int) ntohs(stemp);
-    p += 2;
-
-    /* Next byte contains the fore/aft beamwidth */
-    sdata->gsfSeaBatIISpecific.fore_aft_bw = ((double) *p) / 10.0;
-    p += 1;
-
-    /* Next byte contains the athwartships beamwidth */
-    sdata->gsfSeaBatIISpecific.athwart_bw = ((double) *p) / 10.0;
-    p += 1;
-
-    /* Next four bytes are reserved for future growth */
-    sdata->gsfSeaBatIISpecific.spare[0] = (char) *p;
-    p += 1;
-    sdata->gsfSeaBatIISpecific.spare[1] = (char) *p;
-    p += 1;
-    sdata->gsfSeaBatIISpecific.spare[2] = (char) *p;
-    p += 1;
-    sdata->gsfSeaBatIISpecific.spare[3] = (char) *p;
-    p += 1;
-
-    return (p - sptr);
-}
-
-/********************************************************************
- *
- * Function Name : DecodeSeaBat8101Specific
- *
- * Description : This function decodes the Reson SeaBat 8101 sensor specific
- *    information from the GSF byte stream.
- *
- * Inputs :
- *    sdata = a pointer to the union of sensor specific data to be loaded
- *    sptr = a pointer to an unsigned char buffer containing the byte stream
- *           to read.
- *
- * Returns : This function returns the number of bytes enocoded.
- *
- * Error Conditions : none
- *
- ********************************************************************/
-
-static int
-DecodeSeaBat8101Specific(gsfSensorSpecific * sdata, unsigned char *sptr)
-{
-    unsigned char  *p = sptr;
-    gsfuShort       stemp;
-
-    /* First two byte integer contains the ping number */
-    memcpy(&stemp, p, 2);
-    sdata->gsfSeaBat8101Specific.ping_number = (int) ntohs(stemp);
-    p += 2;
-
-    /* Next two byte integer contains the sea surface sound speed * 10 */
-    memcpy(&stemp, p, 2);
-    sdata->gsfSeaBat8101Specific.surface_velocity = ((double) ntohs(stemp)) / 10.0;
-    p += 2;
-
-    /* Next two byte integer contains the sonar mode of operation */
-    memcpy(&stemp, p, 2);
-    sdata->gsfSeaBat8101Specific.mode = (int) ntohs(stemp);
-    p += 2;
-
-    /* Next two byte integer contains the range setting */
-    memcpy(&stemp, p, 2);
-    sdata->gsfSeaBat8101Specific.range = (int) ntohs(stemp);
-    p += 2;
-
-    /* Next two byte integer contains the power setting */
-    memcpy(&stemp, p, 2);
-    sdata->gsfSeaBat8101Specific.power = (int) ntohs(stemp);
-    p += 2;
-
-    /* Next two byte integer contains the gain setting */
-    memcpy(&stemp, p, 2);
-    sdata->gsfSeaBat8101Specific.gain = (int) ntohs(stemp);
-    p += 2;
-
-    /* Next two byte integer contains the transmit pulse width */
-    memcpy(&stemp, p, 2);
-    sdata->gsfSeaBat8101Specific.pulse_width = (int) ntohs(stemp);
-    p += 2;
-
-    /* Next byte contains the tvg spreading coefficient */
-    sdata->gsfSeaBat8101Specific.tvg_spreading = (int) *p;
-    p += 1;
-
-    /* Next byte contains the tvg absorption coefficient */
-    sdata->gsfSeaBat8101Specific.tvg_absorption = (int) *p;
-    p += 1;
-
-    /* Next byte contains the fore/aft beamwidth */
-    sdata->gsfSeaBat8101Specific.fore_aft_bw = ((double) *p) / 10.0;
-    p += 1;
-
-    /* Next byte contains the athwartships beamwidth */
-    sdata->gsfSeaBat8101Specific.athwart_bw = ((double) *p) / 10.0;
-    p += 1;
-
-    /* Next two byte integer is reserved for future storage of the range
-     * filter minimum value.
-     */
-    memcpy(&stemp, p, 2);
-    sdata->gsfSeaBat8101Specific.range_filt_min = (int) ntohs(stemp);
-    p += 2;
-
-    /* Next two byte integer is reserved for future storage of the range
-     * filter maximum value.
-     */
-    memcpy(&stemp, p, 2);
-    sdata->gsfSeaBat8101Specific.range_filt_max = (int) ntohs(stemp);
-    p += 2;
-
-    /* Next two byte integer is reserved for future storage of the depth
-     * filter minimum value.
-     */
-    memcpy(&stemp, p, 2);
-    sdata->gsfSeaBat8101Specific.depth_filt_min = (int) ntohs(stemp);
-    p += 2;
-
-    /* Next two byte integer is reserved for future storage of the depth
-     * filter maximum value.
-     */
-    memcpy(&stemp, p, 2);
-    sdata->gsfSeaBat8101Specific.depth_filt_max = (int) ntohs(stemp);
-    p += 2;
-
-    /* Next byte is reserved for future storage of the projector type */
-    sdata->gsfSeaBat8101Specific.projector = (int) *p;
-    p += 1;
-
-    /* Next four bytes are reserved for future growth */
-    sdata->gsfSeaBat8101Specific.spare[0] = (char) *p;
-    p += 1;
-    sdata->gsfSeaBat8101Specific.spare[1] = (char) *p;
-    p += 1;
-    sdata->gsfSeaBat8101Specific.spare[2] = (char) *p;
-    p += 1;
-    sdata->gsfSeaBat8101Specific.spare[3] = (char) *p;
-    p += 1;
-
-    return (p - sptr);
-}
-
-/********************************************************************
- *
- * Function Name : DecodeSeaBeam2112Specific
- *
- * Description : This function decodes the Sea Beam 2112/36 sensor specific
- *    information from the GSF byte stream.
- *
- * Inputs :
- *    sdata = a pointer to the union of sensor specific data to be loaded
- *    sptr = a pointer to an unsigned char buffer containing the byte stream
- *           to read.
- *
- * Returns : This function returns the number of bytes enocoded.
- *
- * Error Conditions : none
- *
- ********************************************************************/
-
-static int
-DecodeSeaBeam2112Specific(gsfSensorSpecific * sdata, unsigned char *sptr)
-{
-    unsigned char  *p = sptr;
-    gsfuShort       stemp;
-
-    /* First byte contains the sonar mode of operation */
-    sdata->gsfSeaBeam2112Specific.mode = (int) *p;
-    p += 1;
-
-    /* Next two byte integer contains the sea surface sound speed * 100 - 130000 */
-    memcpy(&stemp, p, 2);
-    sdata->gsfSeaBeam2112Specific.surface_velocity = (((double) ntohs(stemp)) + 130000) / 100.0;
-    p += 2;
-
-    /* Next byte contains the SSV source */
-    sdata->gsfSeaBeam2112Specific.ssv_source = (int) *p;
-    p += 1;
-
-    /* Next byte contains the ping gain */
-    sdata->gsfSeaBeam2112Specific.ping_gain = (int) *p;
-    p += 1;
-
-    /* Next byte contains the ping pulse width */
-    sdata->gsfSeaBeam2112Specific.pulse_width = (int) *p;
-    p += 1;
-
-    /* Next byte contains the transmitter attenuation */
-    sdata->gsfSeaBeam2112Specific.transmitter_attenuation = (int) *p;
-    p += 1;
-
-    /* Next byte contains the number of algorithms */
-    sdata->gsfSeaBeam2112Specific.number_algorithms = (int) *p;
-    p += 1;
-
-    /* Next 4 bytes contain the algorithm order */
-    memset (sdata->gsfSeaBeam2112Specific.algorithm_order, 0, 5);
-    memcpy (sdata->gsfSeaBeam2112Specific.algorithm_order, p, 4);
-    p += 4;
-
-    /* Next four bytes are reserved for future growth */
-    sdata->gsfSeaBeam2112Specific.spare[0] = (char) *p;
-    p += 1;
-    sdata->gsfSeaBeam2112Specific.spare[1] = (char) *p;
-    p += 1;
-
-    return (p - sptr);
-}
-
-
-/********************************************************************
- *
- * Function Name : DecodeElacMkIISpecific
- *
- * Description : This function decodes the Elac Bottomchart MkII sensor specific
- *    information from the GSF byte stream.
- *
- * Inputs :
- *    sdata = a pointer to the union of sensor specific data to be loaded
- *    sptr = a pointer to an unsigned char buffer containing the byte stream
- *           to read.
- *
- * Returns : This function returns the number of bytes enocoded.
- *
- * Error Conditions : none
- *
- ********************************************************************/
-
-static int
-DecodeElacMkIISpecific(gsfSensorSpecific * sdata, unsigned char *sptr)
-{
-    unsigned char   *p = sptr;
-    gsfuShort       stemp;
-
-    /* First byte contains the sonar mode of operation */
-    sdata->gsfElacMkIISpecific.mode = (int) *p;
-    p += 1;
-
-    /* Next two byte integer contains the ping counter */
-    memcpy(&stemp, p, 2);
-    sdata->gsfElacMkIISpecific.ping_num = (int) ntohs(stemp);
-    p += 2;
-
-    /* Next two byte integer contains the surface sound velocity in m/s */
-    memcpy(&stemp, p, 2);
-    sdata->gsfElacMkIISpecific.sound_vel = (int) ntohs(stemp);
-    p += 2;
-
-    /* Next two byte integer contains the pulse length in 0.01 ms */
-    memcpy(&stemp, p, 2);
-    sdata->gsfElacMkIISpecific.pulse_length = (int) ntohs(stemp);
-    p += 2;
-
-    /* Next byte contains the starboard receiver gain in dB */
-    sdata->gsfElacMkIISpecific.receiver_gain_stbd = (int) *p;
-    p += 1;
-
-    /* Next byte contains the port receiver gain in dB */
-    sdata->gsfElacMkIISpecific.receiver_gain_port = (int) *p;
-    p += 1;
-
-    /* Next two byte integer is reserved for future use */
-    memcpy(&stemp, p, 2);
-    sdata->gsfElacMkIISpecific.reserved = (int) ntohs(stemp);
-    p += 2;
-
-    return (p - sptr);
-}
-
-/********************************************************************
- *
- * Function Name : DecodeEM3Specific
- *
- * Description : This function decodes the Simrad EM3000 series sensor
- *    specific information from the GSF byte stream.
- *
- * Inputs :
- *    sdata = a pointer to the union of sensor specific data to be loaded
- *    sptr = a pointer to an unsigned char buffer containing the byte stream
- *           to read.
- *
- * Returns : This function returns the number of bytes enocoded.
- *
- * Error Conditions : none
- *
- ********************************************************************/
-
-static int
-DecodeEM3Specific(gsfSensorSpecific *sdata, unsigned char *sptr, GSF_FILE_TABLE *ft)
-{
-    unsigned char   *p = sptr;
-    gsfuShort       stemp;
-    gsfsShort       signed_short;
-    gsfuLong        ltemp;
-    int             run_time_id;
-
-    /* The next two bytes contain the model number */
-    memcpy(&stemp, p, 2);
-    sdata->gsfEM3Specific.model_number = (int) ntohs(stemp);
-    p += 2;
-
-    /* The next two bytes contain the ping number */
-    memcpy(&stemp, p, 2);
-    sdata->gsfEM3Specific.ping_number = (int) ntohs(stemp);
-    p += 2;
-
-    /* The next two bytes contain the system 1 or 2 serial number */
-    memcpy(&stemp, p, 2);
-    sdata->gsfEM3Specific.serial_number = (int) ntohs(stemp);
-    p += 2;
-
-    /* The next two bytes contain the surface velocity */
-    memcpy(&stemp, p, 2);
-    sdata->gsfEM3Specific.surface_velocity = ((double) ntohs(stemp)) / 10.0;
-    p += 2;
-
-    /* The next two bytes contain the transmit depth */
-    memcpy(&stemp, p, 2);
-    sdata->gsfEM3Specific.transducer_depth = ((double) ntohs(stemp)) / 100.0;
-    p += 2;
-
-    /* The next two bytes contain the maximum number of beams */
-    memcpy(&stemp, p, 2);
-    sdata->gsfEM3Specific.valid_beams = (int) ntohs(stemp);
-    p += 2;
-
-    /* The next two bytes contain the sample rate */
-    memcpy(&stemp, p, 2);
-    sdata->gsfEM3Specific.sample_rate = (int) ntohs(stemp);
-    p += 2;
-
-    /* The next two bytes contain the depth difference between sonar heads in an em3000D configuration */
-    memcpy(&stemp, p, 2);
-    signed_short = (signed) ntohs(stemp);
-    sdata->gsfEM3Specific.depth_difference = ((double) signed_short) / 100.0;
-    p += 2;
-
-    /* Next byte contains the transducer depth offset multiplier */
-    sdata->gsfEM3Specific.offset_multiplier = (signed int) *p;
-    p += 1;
-
-    /* The next four byte value specifies the existance of the run-time data strucutre */
-    memcpy(&ltemp, p, 4);
-    run_time_id = ntohl(ltemp);
-    p += 4;
-
-    /* If the first bit is set then this subrecord contains a new set of run-time parameters,
-     *  otherwise the run-time parameters have not changed.
-     */
-    if (run_time_id & 0x00000001)
-    {
-        /* The next two byte value contains the model number from the run-time parameters datagram */
-        memcpy(&stemp, p, 2);
-        sdata->gsfEM3Specific.run_time[0].model_number = (int) ntohs(stemp);
-        p += 2;
-
-        /* The next 8 bytes contain the time-tag for the run-time parameters datagram. */
-        memcpy(&ltemp, p, 4);
-        sdata->gsfEM3Specific.run_time[0].dg_time.tv_sec = ntohl(ltemp);
-        p += 4;
-
-        memcpy(&ltemp, p, 4);
-        sdata->gsfEM3Specific.run_time[0].dg_time.tv_nsec = ntohl(ltemp);
-        p += 4;
-
-        /* The next two byte value contains the sequential ping number */
-        memcpy(&stemp, p, 2);
-        sdata->gsfEM3Specific.run_time[0].ping_number = (int) ntohs(stemp);
-        p += 2;
-
-        /* The next two byte value contains the sonar head serial number */
-        memcpy(&stemp, p, 2);
-        sdata->gsfEM3Specific.run_time[0].serial_number = (int) ntohs(stemp);
-        p += 2;
-
-        /* The next four byte value contains the system status */
-        memcpy(&ltemp, p, 4);
-        sdata->gsfEM3Specific.run_time[0].system_status = (int) ntohl(ltemp);
-        p += 4;
-
-        /* The next one byte value contains the mode identifier */
-        sdata->gsfEM3Specific.run_time[0].mode = (int) *p;
-        p += 1;
-
-        /* The next one byte value contains the filter identifier */
-        sdata->gsfEM3Specific.run_time[0].filter_id = (int) *p;
-        p += 1;
-
-        /* The next two byte value contains the minimum depth */
-        memcpy(&stemp, p, 2);
-        sdata->gsfEM3Specific.run_time[0].min_depth = (double) ntohs(stemp);
-        p += 2;
-
-        /* The next two byte value contains the maximum depth */
-        memcpy(&stemp, p, 2);
-        sdata->gsfEM3Specific.run_time[0].max_depth = (double) ntohs(stemp);
-        p += 2;
-
-        /* The next two byte value contains the absorption coefficient */
-        memcpy(&stemp, p, 2);
-        sdata->gsfEM3Specific.run_time[0].absorption = ((double) ntohs(stemp)) / 100.0;
-        p += 2;
-
-        /* The next two byte value contains the transmit pulse length */
-        memcpy(&stemp, p, 2);
-        sdata->gsfEM3Specific.run_time[0].pulse_length = (double) ntohs(stemp);
-        p += 2;
-
-        /* The next two byte value contains the transmit beam width */
-        memcpy(&stemp, p, 2);
-        sdata->gsfEM3Specific.run_time[0].transmit_beam_width = ((double) ntohs(stemp)) / 10.0;
-        p += 2;
-
-        /* The next one byte value contains the transmit power reduction */
-        sdata->gsfEM3Specific.run_time[0].power_reduction = (int) *p;
-        p += 1;
-
-        /* The next one byte value contains the receive beam width */
-        sdata->gsfEM3Specific.run_time[0].receive_beam_width = ((double) *p) / 10.0;
-        p += 1;
-
-        /* The next one byte value contains the receive band width. This value is provided
-         *  by the sonar with a precision of 50 Hz.
-         */
-        sdata->gsfEM3Specific.run_time[0].receive_bandwidth = ((int) (*p)) * 50;
-        p += 1;
-
-        /* The next one byte value contains the receive gain */
-        sdata->gsfEM3Specific.run_time[0].receive_gain = (int) *p;
-        p += 1;
-
-        /* The next one byte value contains the TVG law cross-over angle */
-        sdata->gsfEM3Specific.run_time[0].cross_over_angle = (int) *p;
-        p += 1;
-
-        /* The next one byte value contains the source of the surface sound speed value */
-        sdata->gsfEM3Specific.run_time[0].ssv_source = (int) *p;
-        p += 1;
-
-        /* The next two byte value contains the maximum port swath width */
-        memcpy(&stemp, p, 2);
-        sdata->gsfEM3Specific.run_time[0].port_swath_width = (int) ntohs(stemp);
-        p += 2;
-
-        /* The next one byte value contains the beam spacing value */
-        sdata->gsfEM3Specific.run_time[0].beam_spacing = (int) *p;
-        p += 1;
-
-        /* The next one byte value contains the port coverage sector */
-        sdata->gsfEM3Specific.run_time[0].port_coverage_sector = (int) *p;
-        p += 1;
-
-        /* The next one byte value contains the yaw and pitch stabilization mode */
-        sdata->gsfEM3Specific.run_time[0].stabilization = (int) *p;
-        p += 1;
-
-        /* The next one byte value contains the starboard coverage sector */
-        sdata->gsfEM3Specific.run_time[0].stbd_coverage_sector = (int) *p;
-        p += 1;
-
-        /* The next two byte value contains the maximum starboard swath width */
-        memcpy(&stemp, p, 2);
-        sdata->gsfEM3Specific.run_time[0].stbd_swath_width = (int) ntohs(stemp);
-        p += 2;
-
-        /* The next one byte value contains the HiLo frequency absorption coefficient ratio */
-        sdata->gsfEM3Specific.run_time[0].hilo_freq_absorp_ratio = (int) *p;
-        p += 1;
-
-        /* The next four bytes are reserved for future use */
-        sdata->gsfEM3Specific.run_time[0].spare1 = 0;
-        p += 4;
-
-        /* check to see if the starboard swath width is populated, and set the total, port, and starboard
-         * swath widths accordingly. bac, 10-18-00
-         */
-        if (sdata->gsfEM3Specific.run_time[0].stbd_swath_width)
-        {
-            sdata->gsfEM3Specific.run_time[0].swath_width = sdata->gsfEM3Specific.run_time[0].port_swath_width +
-                                                            sdata->gsfEM3Specific.run_time[0].stbd_swath_width;
-        }
-        else
-        {
-            sdata->gsfEM3Specific.run_time[0].swath_width = sdata->gsfEM3Specific.run_time[0].port_swath_width;
-            sdata->gsfEM3Specific.run_time[0].port_swath_width = sdata->gsfEM3Specific.run_time[0].swath_width / 2;
-            sdata->gsfEM3Specific.run_time[0].stbd_swath_width = sdata->gsfEM3Specific.run_time[0].swath_width / 2;
-        }
-
-        /* check to see if the starboard coverage sector is populated, and set the total, port, and starboard
-         * coverage sectors accordingly. bac, 10-18-00
-         */
-        if (sdata->gsfEM3Specific.run_time[0].stbd_coverage_sector)
-        {
-            sdata->gsfEM3Specific.run_time[0].coverage_sector = sdata->gsfEM3Specific.run_time[0].port_coverage_sector +
-                                                                sdata->gsfEM3Specific.run_time[0].stbd_coverage_sector;
-        }
-        else
-        {
-            sdata->gsfEM3Specific.run_time[0].coverage_sector = sdata->gsfEM3Specific.run_time[0].port_coverage_sector;
-            sdata->gsfEM3Specific.run_time[0].port_coverage_sector = sdata->gsfEM3Specific.run_time[0].coverage_sector / 2;
-            sdata->gsfEM3Specific.run_time[0].stbd_coverage_sector = sdata->gsfEM3Specific.run_time[0].coverage_sector / 2;
-        }
-
-        /* Since the run-time parameters only exist on the byte stream when they change, we need
-         *  to save these to the file table so the'll be available to the caller for each ping.
-         *
-         * memcpy (&ft->rec.mb_ping.sensor_data.gsfEM3Specific.run_time[0], &sdata->gsfEM3Specific.run_time[0], sizeof(gsfEM3RunTime));
-         */
-
-        /* If the second bit is set then this subrecord contains a second set of new run-time
-         *  for an em3000d series sonar system.
-         */
-        if (run_time_id & 0x00000002)
-        {
-            /* The next two byte value contains the model number from the run-time parameters datagram */
-            memcpy(&stemp, p, 2);
-            sdata->gsfEM3Specific.run_time[1].model_number = (int) ntohs(stemp);
-            p += 2;
-
-            /* The next 8 bytes contain the time-tag for the run-time parameters datagram. */
-            memcpy(&ltemp, p, 4);
-            sdata->gsfEM3Specific.run_time[1].dg_time.tv_sec = ntohl(ltemp);
-            p += 4;
-
-            memcpy(&ltemp, p, 4);
-            sdata->gsfEM3Specific.run_time[1].dg_time.tv_nsec = ntohl(ltemp);
-            p += 4;
-
-            /* The next two byte value contains the sequential ping number */
-            memcpy(&stemp, p, 2);
-            sdata->gsfEM3Specific.run_time[1].ping_number = (int) ntohs(stemp);
-            p += 2;
-
-            /* The next two byte value contains the sonar head serial number */
-            memcpy(&stemp, p, 2);
-            sdata->gsfEM3Specific.run_time[1].serial_number = (int) ntohs(stemp);
-            p += 2;
-
-            /* The next four byte value contains the system status */
-            memcpy(&ltemp, p, 4);
-            sdata->gsfEM3Specific.run_time[1].system_status = (int) ntohl(ltemp);
-            p += 4;
-
-            /* The next one byte value contains the mode identifier */
-            sdata->gsfEM3Specific.run_time[1].mode = (int) *p;
-            p += 1;
-
-            /* The next one byte value contains the filter identifier */
-            sdata->gsfEM3Specific.run_time[1].filter_id = (int) *p;
-            p += 1;
-
-            /* The next two byte value contains the minimum depth */
-            memcpy(&stemp, p, 2);
-            sdata->gsfEM3Specific.run_time[1].min_depth = (double) ntohs(stemp);
-            p += 2;
-
-            /* The next two byte value contains the maximum depth */
-            memcpy(&stemp, p, 2);
-            sdata->gsfEM3Specific.run_time[1].max_depth = (double) ntohs(stemp);
-            p += 2;
-
-            /* The next two byte value contains the absorption coefficient */
-            memcpy(&stemp, p, 2);
-            sdata->gsfEM3Specific.run_time[1].absorption = ((double) ntohs(stemp)) / 100.0;
-            p += 2;
-
-            /* The next two byte value contains the transmit pulse length */
-            memcpy(&stemp, p, 2);
-            sdata->gsfEM3Specific.run_time[1].pulse_length = (double) ntohs(stemp);
-            p += 2;
-
-            /* The next two byte value contains the transmit beam width */
-            memcpy(&stemp, p, 2);
-            sdata->gsfEM3Specific.run_time[1].transmit_beam_width = ((double) ntohs(stemp)) / 10.0;
-            p += 2;
-
-            /* The next one byte value contains the transmit power reduction */
-            sdata->gsfEM3Specific.run_time[1].power_reduction = (int) *p;
-            p += 1;
-
-            /* The next one byte value contains the receive beam width */
-            sdata->gsfEM3Specific.run_time[1].receive_beam_width = ((double) *p) / 10.0;
-            p += 1;
-
-            /* The next one byte value contains the receive band width. This value is provided
-             *  by the sonar with a precision of 50 Hz.
-             */
-            sdata->gsfEM3Specific.run_time[1].receive_bandwidth = ((int) (*p)) * 50;
-            p += 1;
-
-            /* The next one byte value contains the receive gain */
-            sdata->gsfEM3Specific.run_time[1].receive_gain = (int) *p;
-            p += 1;
-
-            /* The next one byte value contains the TVG law cross-over angle */
-            sdata->gsfEM3Specific.run_time[1].cross_over_angle = (int) *p;
-            p += 1;
-
-            /* The next one byte value contains the source of the surface sound speed value */
-            sdata->gsfEM3Specific.run_time[1].ssv_source = (int) *p;
-            p += 1;
-
-            /* The next two byte value contains the maximum port swath width */
-            memcpy(&stemp, p, 2);
-            sdata->gsfEM3Specific.run_time[1].port_swath_width = (int) ntohs(stemp);
-            p += 2;
-
-            /* The next one byte value contains the beam spacing value */
-            sdata->gsfEM3Specific.run_time[1].beam_spacing = (int) *p;
-            p += 1;
-
-            /* The next one byte value contains the port coverage sector */
-            sdata->gsfEM3Specific.run_time[1].port_coverage_sector = (int) *p;
-            p += 1;
-
-            /* The next one byte value contains the yaw and pitch stabilization mode */
-            sdata->gsfEM3Specific.run_time[1].stabilization = (int) *p;
-            p += 1;
-
-            /* The next one byte value contains the starboard coverage sector */
-            sdata->gsfEM3Specific.run_time[1].stbd_coverage_sector = (int) *p;
-            p += 1;
-
-            /* The next two byte value contains the maximum starboard swath width */
-            memcpy(&stemp, p, 2);
-            sdata->gsfEM3Specific.run_time[1].stbd_swath_width = (int) ntohs(stemp);
-            p += 2;
-
-            /* The next one byte value contains the HiLo frequency absorption coefficient ratio */
-            sdata->gsfEM3Specific.run_time[1].hilo_freq_absorp_ratio = (int) *p;
-
-            /* The next eight bytes are reserved for future use */
-            sdata->gsfEM3Specific.run_time[1].spare1 = 0;
-            p += 4;
-
-            /* check to see if the starboard swath width is populated, and set the total, port, and starboard
-             * swath widths accordingly. bac, 10-18-00
-             */
-            if (sdata->gsfEM3Specific.run_time[1].stbd_swath_width)
-            {
-                sdata->gsfEM3Specific.run_time[1].swath_width = sdata->gsfEM3Specific.run_time[1].port_swath_width +
-                                                                sdata->gsfEM3Specific.run_time[1].stbd_swath_width;
-            }
-            else
-            {
-                sdata->gsfEM3Specific.run_time[1].swath_width = sdata->gsfEM3Specific.run_time[1].port_swath_width;
-                sdata->gsfEM3Specific.run_time[1].port_swath_width = sdata->gsfEM3Specific.run_time[1].swath_width / 2;
-                sdata->gsfEM3Specific.run_time[1].stbd_swath_width = sdata->gsfEM3Specific.run_time[1].swath_width / 2;
-            }
-
-            /* check to see if the starboard coverage sector is populated, and set the total, port, and starboard
-             * coverage sectors accordingly. bac, 10-18-00
-             */
-            if (sdata->gsfEM3Specific.run_time[1].stbd_coverage_sector)
-            {
-                sdata->gsfEM3Specific.run_time[1].coverage_sector = sdata->gsfEM3Specific.run_time[1].port_coverage_sector +
-                                                                    sdata->gsfEM3Specific.run_time[1].stbd_coverage_sector;
-            }
-            else
-            {
-                sdata->gsfEM3Specific.run_time[1].coverage_sector = sdata->gsfEM3Specific.run_time[1].port_coverage_sector;
-                sdata->gsfEM3Specific.run_time[1].port_coverage_sector = sdata->gsfEM3Specific.run_time[1].coverage_sector / 2;
-                sdata->gsfEM3Specific.run_time[1].stbd_coverage_sector = sdata->gsfEM3Specific.run_time[1].coverage_sector / 2;
-            }
-
-            /* Since the run-time parameters only exist on the byte stream when they change, we need
-             *  to save these to the file table so the'll be available to the caller for each ping.
-             *
-             * memcpy (&ft->rec.mb_ping.sensor_data.gsfEM3Specific.run_time[1], &sdata->gsfEM3Specific.run_time[1], sizeof(gsfEM3RunTime));
-             */
-        }
-    }
-
-    /* jsb 3/31/99 Commented this code block out.  No need to do this until we encode this subrecord only when
-     *   the values have changed. Refer to comments in gsfEncodeEM3Specific.
-     *
-     * else
-     * {
-     *     memcpy (&sdata->gsfEM3Specific.run_time[0], &ft->rec.mb_ping.sensor_data.gsfEM3Specific.run_time[0], sizeof(gsfEM3RunTime));
-     *     memcpy (&sdata->gsfEM3Specific.run_time[1], &ft->rec.mb_ping.sensor_data.gsfEM3Specific.run_time[1], sizeof(gsfEM3RunTime));
-     * }
-     */
-    return (p - sptr);
-}
-
-/********************************************************************
- *
- * Function Name : DecodeEM3RawSpecific
- *
- * Description : This function decodes the Simrad EM3000 series sensor
- *    using raw range and beam anlge specific information from
- *    the GSF byte stream.
- *
- * Inputs :
- *    sdata = a pointer to the union of sensor specific data to be loaded
- *    sptr = a pointer to an unsigned char buffer containing the byte stream
- *           to read.
- *
- * Returns : This function returns the number of bytes enocoded.
- *
- * Error Conditions : none
- *
- ********************************************************************/
-static int
-DecodeEM3RawSpecific(gsfSensorSpecific *sdata, unsigned char *sptr, GSF_FILE_TABLE *ft)
-{
-    unsigned char   *p = sptr;
-    char            ctemp;
-    gsfsShort       sstemp;
-    gsfuShort       stemp;
-    gsfuLong        ltemp;
-    gsfsLong        sltemp;
-    int             i;
-
-    /* The next two bytes contain the model number */
-    memcpy(&stemp, p, 2);
-    sdata->gsfEM3RawSpecific.model_number = (int) ntohs(stemp);
-    p += 2;
-
-    /* The next two bytes contain the ping counter */
-    memcpy(&stemp, p, 2);
-    sdata->gsfEM3RawSpecific.ping_counter = (int) ntohs(stemp);
-    p += 2;
-
-    /* The next two bytes contain the serial number */
-    memcpy(&stemp, p, 2);
-    sdata->gsfEM3RawSpecific.serial_number = (int) ntohs(stemp);
-    p += 2;
-
-    /* The next two bytes contain the surface velocity */
-    memcpy(&stemp, p, 2);
-    sdata->gsfEM3RawSpecific.surface_velocity = ((double) ntohs(stemp)) / 10.0;
-    p += 2;
-
-    /* The next four bytes contain the transmit transducer depth */
-    memcpy(&ltemp, p, 4);
-    sltemp = (gsfsLong) ntohl(ltemp);
-    sdata->gsfEM3RawSpecific.transducer_depth = ((double) sltemp) / 20000.0;
-    p += 4;
-
-    /* The next two bytes contain the number of valid detections for this ping */
-    memcpy(&stemp, p, 2);
-    sdata->gsfEM3RawSpecific.valid_detections = (int) ntohs(stemp);
-    p += 2;
-
-    /* The next four bytes contain the integer portion of the sampling frequency in Hz */
-    memcpy(&ltemp, p, 4);
-    sdata->gsfEM3RawSpecific.sampling_frequency = (double) ntohl(ltemp);
-    p += 4;
-
-    /* The next four bytes contain the fractional portion of the sampling frequency in Hz */
-    memcpy(&ltemp, p, 4);
-    sdata->gsfEM3RawSpecific.sampling_frequency += ((double) ntohl(ltemp)) / 4.0e9;
-    p += 4;
-
-    /* Next four bytes contains the "ROV depth" */
-    memcpy(&ltemp, p, 4);
-    sltemp = (gsfsLong) ntohl(ltemp);
-    sdata->gsfEM3RawSpecific.vehicle_depth = ((double) sltemp) / 1000.0;
-    p += 4;
-
-    /* The next two bytes contain the depth difference between sonar heads in an em3000D configuration */
-    memcpy(&stemp, p, 2);
-    sstemp = (signed) ntohs(stemp);
-    sdata->gsfEM3RawSpecific.depth_difference = ((double) sstemp) / 100.0;
-    p += 2;
-
-    /* Next byte contains the transducer depth offset multiplier */
-    ctemp = (char) *p;
-    sdata->gsfEM3RawSpecific.offset_multiplier = (int) ctemp;
-    p += 1;
-
-      /* The next 16 bytes are spare space for future use */
-    memset (&sdata->gsfEM3RawSpecific.spare_1, 0, (size_t) 16);
-    p += 16;
-
-    /* The next two byte contains the number of transmit sectors */
-    memcpy(&stemp, p, 2);
-    sdata->gsfEM3RawSpecific.transmit_sectors = (int) ntohs(stemp);
-    p += 2;
-
-    for (i = 0; i < sdata->gsfEM3RawSpecific.transmit_sectors; i++)
-    {
-        /* Next two bytes contains the tilt angle */
-        memcpy(&stemp, p, 2);
-        sstemp = (gsfsShort) ntohs(stemp);
-        sdata->gsfEM3RawSpecific.sector[i].tilt_angle = ((double) sstemp) / 100.0;
-        p += 2;
-
-        /* Next two bytes contains the focus range */
-        memcpy(&stemp, p, 2);
-        sdata->gsfEM3RawSpecific.sector[i].focus_range = ((double) ntohs(stemp)) / 10.0;
-        p += 2;
-
-        /* Next four bytes contains the signal length */
-        memcpy(&ltemp, p, 4);
-        sdata->gsfEM3RawSpecific.sector[i].signal_length = ((double) ntohl(ltemp)) / 1.0e6;
-        p += 4;
-
-        /* Next four bytes contains the transmit delay */
-        memcpy(&ltemp, p, 4);
-        sdata->gsfEM3RawSpecific.sector[i].transmit_delay = ((double) ntohl(ltemp)) / 1.0e6;
-        p += 4;
-
-        /* Next four bytes contains the center frequency */
-        memcpy(&ltemp, p, 4);
-        sdata->gsfEM3RawSpecific.sector[i].center_frequency = ((double) ntohl(ltemp)) / 1.0e3;
-        p += 4;
-
-        /* Next byte contains the signal wave form identifier */
-        sdata->gsfEM3RawSpecific.sector[i].waveform_id = (int) *p;
-        p += 1;
-
-        /* Next byte contains the transmit sector number */
-        sdata->gsfEM3RawSpecific.sector[i].sector_number = (int) *p;
-        p += 1;
-
-        /* Next four bytes contains the signal bandwidth */
-        memcpy(&ltemp, p, 4);
-        sdata->gsfEM3RawSpecific.sector[i].signal_bandwidth = ((double) ntohl(ltemp)) / 1.0e3;
-        p += 4;
-
-        /* The next 16 bytes are spare space for future use */
-        memset (&sdata->gsfEM3RawSpecific.sector[i].spare, 0, (size_t) 16);
-        p += 16;
-    }
-
-    /* The next 16 bytes are spare space for future use */
-    memset (&sdata->gsfEM3RawSpecific.spare_2, 0, (size_t) 16);
-    p += 16;
-
-    /* The next two byte value contains the model number from the run-time parameters datagram */
-    memcpy(&stemp, p, 2);
-    sdata->gsfEM3RawSpecific.run_time.model_number = (int) ntohs(stemp);
-    p += 2;
-
-    /* The next 8 bytes contain the time-tag for the run-time parameters datagram. */
-    memcpy(&ltemp, p, 4);
-    sdata->gsfEM3RawSpecific.run_time.dg_time.tv_sec = ntohl(ltemp);
-    p += 4;
-
-    memcpy(&ltemp, p, 4);
-    sdata->gsfEM3RawSpecific.run_time.dg_time.tv_nsec = ntohl(ltemp);
-    p += 4;
-
-    /* The next two byte value contains the sequential ping number */
-    memcpy(&stemp, p, 2);
-    sdata->gsfEM3RawSpecific.run_time.ping_counter = (int) ntohs(stemp);
-    p += 2;
-
-    /* The next two byte value contains the sonar head serial number */
-    memcpy(&stemp, p, 2);
-    sdata->gsfEM3RawSpecific.run_time.serial_number = (int) ntohs(stemp);
-    p += 2;
-
-    /* Next byte contains the operator station status */
-    sdata->gsfEM3RawSpecific.run_time.operator_station_status = (unsigned char) *p;
-    p += 1;
-
-    /* Next byte contains the processing unit status */
-    sdata->gsfEM3RawSpecific.run_time.processing_unit_status = (unsigned char) *p;
-    p += 1;
-
-    /* Next byte contains the BSP status */
-    sdata->gsfEM3RawSpecific.run_time.bsp_status = (unsigned char) *p;
-    p += 1;
-
-    /* Next byte contains the sonar head or transceiver status */
-    sdata->gsfEM3RawSpecific.run_time.head_transceiver_status = (unsigned char) *p;
-    p += 1;
-
-    /* The next one byte value contains the mode identifier */
-    sdata->gsfEM3RawSpecific.run_time.mode = (unsigned char) *p;
-    p += 1;
-
-    /* The next one byte value contains the filter identifier */
-    sdata->gsfEM3RawSpecific.run_time.filter_id = (unsigned char) *p;
-    p += 1;
-
-    /* The next two byte value contains the minimum depth */
-    memcpy(&stemp, p, 2);
-    sdata->gsfEM3RawSpecific.run_time.min_depth = (double) ntohs(stemp);
-    p += 2;
-
-    /* The next two byte value contains the maximum depth */
-    memcpy(&stemp, p, 2);
-    sdata->gsfEM3RawSpecific.run_time.max_depth = (double) ntohs(stemp);
-    p += 2;
-
-    /* The next two byte value contains the absorption coefficient */
-    memcpy(&stemp, p, 2);
-    sdata->gsfEM3RawSpecific.run_time.absorption = ((double) ntohs(stemp)) / 100.0;
-    p += 2;
-
-    /* The next two byte value contains the transmit pulse length in microseconds */
-    memcpy(&stemp, p, 2);
-    sdata->gsfEM3RawSpecific.run_time.tx_pulse_length = (double) ntohs(stemp);
-    p += 2;
-
-    /* The next two byte value contains the transmit beam width */
-    memcpy(&stemp, p, 2);
-    sdata->gsfEM3RawSpecific.run_time.tx_beam_width = ((double) ntohs(stemp)) / 10.0;
-    p += 2;
-
-    /* The next one byte value contains the transmit power reduction */
-    ctemp = (char) *p;
-    sdata->gsfEM3RawSpecific.run_time.tx_power_re_max = (double) ctemp;
-    p += 1;
-
-    /* The next one byte value contains the receive beam width */
-    sdata->gsfEM3RawSpecific.run_time.rx_beam_width = ((double) *p) / 10.0;
-    p += 1;
-
-    /* The next one byte value contains the receive band width. This value is provided
-     *  by the sonar with a precision of 50 Hz.
-     */
-    sdata->gsfEM3RawSpecific.run_time.rx_bandwidth = ((double) (*p)) * 50.0;
-    p += 1;
-
-    /* The next one byte value contains the receive gain */
-    sdata->gsfEM3RawSpecific.run_time.rx_fixed_gain = (double) *p;
-    p += 1;
-
-    /* The next one byte value contains the TVG law cross-over angle */
-    sdata->gsfEM3RawSpecific.run_time.tvg_cross_over_angle = (double) *p;
-    p += 1;
-
-    /* The next one byte value contains the source of the surface sound speed value */
-    sdata->gsfEM3RawSpecific.run_time.ssv_source = (unsigned char) *p;
-    p += 1;
-
-    /* The next two byte value contains the maximum port swath width in meters */
-    memcpy(&sstemp, p, 2);
-    sdata->gsfEM3RawSpecific.run_time.max_port_swath_width = (int) ntohs(sstemp);
-    p += 2;
-
-    /* The next one byte value contains a bit mask defining the beam spacing */
-    sdata->gsfEM3RawSpecific.run_time.beam_spacing = (unsigned char) *p;
-    p += 1;
-
-    /* The next one byte value contains the port coverage in degrees */
-    sdata->gsfEM3RawSpecific.run_time.max_port_coverage = (int) *p;
-    p += 1;
-
-    /* The next one byte value contains a bit mask defining the yaw and pitch stabilization mode */
-    sdata->gsfEM3RawSpecific.run_time.stabilization = (unsigned char) *p;
-    p += 1;
-
-    /* The next one byte value contains the starboard coverage in degrees */
-    sdata->gsfEM3RawSpecific.run_time.max_stbd_coverage = (int) *p;
-    p += 1;
-
-    /* The next two byte value contains the maximum starboard swath width in meters */
-    memcpy(&stemp, p, 2);
-    sdata->gsfEM3RawSpecific.run_time.max_stbd_swath_width = (int) ntohs(stemp);
-    p += 2;
-
-    /* The contents of the next two byte value depends on the sonar model number */
-    sdata->gsfEM3RawSpecific.run_time.durotong_speed = 0.0;
-    sdata->gsfEM3RawSpecific.run_time.tx_along_tilt  = 0.0;
-    switch (sdata->gsfEM3RawSpecific.run_time.model_number)
-    {
-        case 1002:
-            /* The next two byte value contains the Durotong speed. This field is valid only for the EM1002 */
-            memcpy(&stemp, p, 2);
-            sdata->gsfEM3RawSpecific.run_time.durotong_speed = ((double) ntohs(stemp)) / 10.0;
-
-            p += 2;
-            break;
-
-        case 300:
-        case 120:
-        case 3000:
-        case 3020:
-            /* The next two byte value contains the transmit along track tilt in degrees.
-             * JSB: As of 3/1/09, still don't have final datagram documentation from KM
-             * to know whether the tx_along_tilt field is EM4 specific or if it will be supported
-             * on EM3 systems.
-             */
-            memcpy(&stemp, p, 2);
-            sstemp = (gsfsShort) ntohs(stemp);
-            sdata->gsfEM3RawSpecific.run_time.tx_along_tilt = ((double) sstemp) / 100.0;
-            p += 2;
-            break;
-
-        default:
-            /* Then next two byte value is spare */
-            p += 2;
-            break;
-    }
-
-    /* The contents of the next one byte value depends on the sonar model number */
-    switch (sdata->gsfEM3RawSpecific.run_time.model_number)
-    {
-        default:
-            /* The next one byte value contains the HiLo frequency absorption coefficient ratio
-             * JSB: As of 3/1/09, still don't have final datagram documentation from KM
-             * to know whether the filter ID 2 field is EM4 specific or if it will be supported
-             * on EM3 systems.
-             */
-            sdata->gsfEM3RawSpecific.run_time.hi_low_absorption_ratio = (double) *p;
-            p += 1;
-            break;
-    }
-
-    /* The next 16 bytes of space on the byte stream are spare space for future use.
-     *  spare field is data structure is smaller than 16 bytes during time frame while durotong speed and hi_lo_absorption_ratio remain in the structure.
-     *  This is done simply to allow the structure size to stay fixed.  When durotong speed and hi_lo_absorption_ratio are removed, size of spare array
-     *  will be increased from 9 bytes to 16 bytes.
-     */
-    memset (&sdata->gsfEM3RawSpecific.run_time.spare, 0, (size_t) sizeof(sdata->gsfEM3RawSpecific.run_time.spare));
-    p += 16;
-
-    /* Decode the PU status fields */
-
-    /* The next one byte value contains the processor unit CPU load */
-    sdata->gsfEM3RawSpecific.pu_status.pu_cpu_load = (double) *p;
-    p += 1;
-
-    /* The next two byte value contains a bit mask with the status of the PU sensor inputs */
-    memcpy(&stemp, p, 2);
-    sdata->gsfEM3RawSpecific.pu_status.sensor_status = ((unsigned short) ntohs(stemp));
-    p += 2;
-
-    /* The next one byte value contains the achieved port coverage in degrees */
-    ctemp = (char) *p;
-    sdata->gsfEM3RawSpecific.pu_status.achieved_port_coverage = (int) ctemp;
-    p += 1;
-
-    /* The next one byte value contains the achieved starboard coverage in degrees */
-    ctemp = (char) *p;
-    sdata->gsfEM3RawSpecific.pu_status.achieved_stbd_coverage = (int) ctemp;
-    p += 1;
-
-    /* The next two bytes contain the amount of yaw stabilization */
-    memcpy(&stemp, p, 2);
-    sstemp = (gsfsShort) ntohs (stemp);
-    sdata->gsfEM3RawSpecific.pu_status.yaw_stabilization = ((double) sstemp) / 100.0;
-    p += 2;
-
-    /* The next 16 bytes are spare space for future use */
-    memset (&sdata->gsfEM3RawSpecific.pu_status.spare, 0, (size_t) 16);
-    p += 16;
-
-    return (p - sptr);
-}
-
-
-/********************************************************************
- *
- * Function Name : DecodeEM4Specific
- *
- * Description : This function decodes the Simrad EM4 series sonar system
- *    (EM710, EM302, EM122, and EM2040) sensor specific information from
- *    the GSF byte stream.
- *
- * Inputs :
- *    sdata = a pointer to the union of sensor specific data to be loaded
- *    sptr = a pointer to an unsigned char buffer containing the byte stream
- *           to read.
- *
- * Returns : This function returns the number of bytes enocoded.
- *
- * Error Conditions : none
- *
- ********************************************************************/
-
-static int
-DecodeEM4Specific(gsfSensorSpecific *sdata, unsigned char *sptr, GSF_FILE_TABLE *ft)
-{
-    unsigned char   *p = sptr;
-    char            ctemp;
-    gsfsShort       sstemp;
-    gsfuShort       stemp;
-    gsfuLong        ltemp;
-    gsfsLong        sltemp;
-    int             i;
-
-    /* The next two bytes contain the model number */
-    memcpy(&stemp, p, 2);
-    sdata->gsfEM4Specific.model_number = (int) ntohs(stemp);
-    p += 2;
-
-    /* The next two bytes contain the ping counter */
-    memcpy(&stemp, p, 2);
-    sdata->gsfEM4Specific.ping_counter = (int) ntohs(stemp);
-    p += 2;
-
-    /* The next two bytes contain the serial number */
-    memcpy(&stemp, p, 2);
-    sdata->gsfEM4Specific.serial_number = (int) ntohs(stemp);
-    p += 2;
-
-    /* The next two bytes contain the surface velocity */
-    memcpy(&stemp, p, 2);
-    sdata->gsfEM4Specific.surface_velocity = ((double) ntohs(stemp)) / 10.0;
-    p += 2;
-
-    /* The next four bytes contain the transmit transducer depth */
-    memcpy(&ltemp, p, 4);
-    sltemp = (gsfsLong) ntohl(ltemp);
-    sdata->gsfEM4Specific.transducer_depth = ((double) sltemp) / 20000.0;
-    p += 4;
-
-    /* The next two bytes contain the number of valid detections for this ping */
-    memcpy(&stemp, p, 2);
-    sdata->gsfEM4Specific.valid_detections = (int) ntohs(stemp);
-    p += 2;
-
-    /* The next four bytes contain the integer portion of the sampling frequency in Hz */
-    memcpy(&ltemp, p, 4);
-    sdata->gsfEM4Specific.sampling_frequency = (double) ntohl(ltemp);
-    p += 4;
-
-    /* The next four bytes contain the fractional portion of the sampling frequency in Hz */
-    memcpy(&ltemp, p, 4);
-    sdata->gsfEM4Specific.sampling_frequency += ((double) ntohl(ltemp)) / 4.0e9;
-    p += 4;
-
-    /* Next four bytes contains the scale factor value for the FM Doppler frequency correction */
-    memcpy(&ltemp, p, 4);
-    sdata->gsfEM4Specific.doppler_corr_scale = (double) ntohl(ltemp);
-    p += 4;
-
-    /* Next four bytes contains the "ROV depth" from the 0x66 datagram */
-    memcpy(&ltemp, p, 4);
-    sltemp = (gsfsLong) ntohl(ltemp);
-    sdata->gsfEM4Specific.vehicle_depth = ((double) sltemp) / 1000.0;
-    p += 4;
-
-    /* The next 16 bytes are spare space for future use */
-    memset (&sdata->gsfEM4Specific.spare_1, 0, (size_t) 16);
-    p += 16;
-
-    /* The next two byte contains the number of transmit sectors */
-    memcpy(&stemp, p, 2);
-    sdata->gsfEM4Specific.transmit_sectors = (int) ntohs(stemp);
-    p += 2;
-
-    for (i = 0; i < sdata->gsfEM4Specific.transmit_sectors; i++)
-    {
-        /* Next two bytes contains the tilt angle */
-        memcpy(&stemp, p, 2);
-        sstemp = (gsfsShort) ntohs(stemp);
-        sdata->gsfEM4Specific.sector[i].tilt_angle = ((double) sstemp) / 100.0;
-        p += 2;
-
-        /* Next two bytes contains the focus range */
-        memcpy(&stemp, p, 2);
-        sdata->gsfEM4Specific.sector[i].focus_range = ((double) ntohs(stemp)) / 10.0;
-        p += 2;
-
-        /* Next four bytes contains the signal length */
-        memcpy(&ltemp, p, 4);
-        sdata->gsfEM4Specific.sector[i].signal_length = ((double) ntohl(ltemp)) / 1.0e6;
-        p += 4;
-
-        /* Next four bytes contains the transmit delay */
-        memcpy(&ltemp, p, 4);
-        sdata->gsfEM4Specific.sector[i].transmit_delay = ((double) ntohl(ltemp)) / 1.0e6;
-        p += 4;
-
-        /* Next four bytes contains the center frequency */
-        memcpy(&ltemp, p, 4);
-        sdata->gsfEM4Specific.sector[i].center_frequency = ((double) ntohl(ltemp)) / 1.0e3;
-        p += 4;
-
-        /* Next two bytes contains the mean absorption */
-        memcpy(&stemp, p, 2);
-        sdata->gsfEM4Specific.sector[i].mean_absorption = ((double) ntohs(stemp)) / 100.0;
-        p += 2;
-
-        /* Next byte contains the signal wave form identifier */
-        sdata->gsfEM4Specific.sector[i].waveform_id = (int) *p;
-        p += 1;
-
-        /* Next byte contains the transmit sector number */
-        sdata->gsfEM4Specific.sector[i].sector_number = (int) *p;
-        p += 1;
-
-        /* Next four bytes contains the signal bandwidth */
-        memcpy(&ltemp, p, 4);
-        sdata->gsfEM4Specific.sector[i].signal_bandwidth = ((double) ntohl(ltemp)) / 1.0e3;
-        p += 4;
-
-        /* The next 16 bytes are spare space for future use */
-        memset (&sdata->gsfEM4Specific.sector[i].spare, 0, (size_t) 16);
-        p += 16;
-    }
-
-    /* The next 16 bytes are spare space for future use */
-    memset (&sdata->gsfEM4Specific.spare_2, 0, (size_t) 16);
-    p += 16;
-
-    /* The next two byte value contains the model number from the run-time parameters datagram */
-    memcpy(&stemp, p, 2);
-    sdata->gsfEM4Specific.run_time.model_number = (int) ntohs(stemp);
-    p += 2;
-
-    /* The next 8 bytes contain the time-tag for the run-time parameters datagram. */
-    memcpy(&ltemp, p, 4);
-    sdata->gsfEM4Specific.run_time.dg_time.tv_sec = ntohl(ltemp);
-    p += 4;
-
-    memcpy(&ltemp, p, 4);
-    sdata->gsfEM4Specific.run_time.dg_time.tv_nsec = ntohl(ltemp);
-    p += 4;
-
-    /* The next two byte value contains the sequential ping number */
-    memcpy(&stemp, p, 2);
-    sdata->gsfEM4Specific.run_time.ping_counter = (int) ntohs(stemp);
-    p += 2;
-
-    /* The next two byte value contains the sonar head serial number */
-    memcpy(&stemp, p, 2);
-    sdata->gsfEM4Specific.run_time.serial_number = (int) ntohs(stemp);
-    p += 2;
-
-    /* Next byte contains the operator station status */
-    sdata->gsfEM4Specific.run_time.operator_station_status = (unsigned char) *p;
-    p += 1;
-
-    /* Next byte contains the processing unit status */
-    sdata->gsfEM4Specific.run_time.processing_unit_status = (unsigned char) *p;
-    p += 1;
-
-    /* Next byte contains the BSP status */
-    sdata->gsfEM4Specific.run_time.bsp_status = (unsigned char) *p;
-    p += 1;
-
-    /* Next byte contains the sonar head or transceiver status */
-    sdata->gsfEM4Specific.run_time.head_transceiver_status = (unsigned char) *p;
-    p += 1;
-
-    /* The next one byte value contains the mode identifier */
-    sdata->gsfEM4Specific.run_time.mode = (unsigned char) *p;
-    p += 1;
-
-    /* The next one byte value contains the filter identifier */
-    sdata->gsfEM4Specific.run_time.filter_id = (unsigned char) *p;
-    p += 1;
-
-    /* The next two byte value contains the minimum depth */
-    memcpy(&stemp, p, 2);
-    sdata->gsfEM4Specific.run_time.min_depth = (double) ntohs(stemp);
-    p += 2;
-
-    /* The next two byte value contains the maximum depth */
-    memcpy(&stemp, p, 2);
-    sdata->gsfEM4Specific.run_time.max_depth = (double) ntohs(stemp);
-    p += 2;
-
-    /* The next two byte value contains the absorption coefficient */
-    memcpy(&stemp, p, 2);
-    sdata->gsfEM4Specific.run_time.absorption = ((double) ntohs(stemp)) / 100.0;
-    p += 2;
-
-    /* The next two byte value contains the transmit pulse length in microseconds */
-    memcpy(&stemp, p, 2);
-    sdata->gsfEM4Specific.run_time.tx_pulse_length = (double) ntohs(stemp);
-    p += 2;
-
-    /* The next two byte value contains the transmit beam width */
-    memcpy(&stemp, p, 2);
-    sdata->gsfEM4Specific.run_time.tx_beam_width = ((double) ntohs(stemp)) / 10.0;
-    p += 2;
-
-    /* The next one byte value contains the transmit power reduction */
-    ctemp = (char) *p;
-    sdata->gsfEM4Specific.run_time.tx_power_re_max = (double) ctemp;
-    p += 1;
-
-    /* The next one byte value contains the receive beam width */
-    sdata->gsfEM4Specific.run_time.rx_beam_width = ((double) *p) / 10.0;
-    p += 1;
-
-    /* The next one byte value contains the receive band width. This value is provided
-     *  by the sonar with a precision of 50 Hz.
-     */
-    sdata->gsfEM4Specific.run_time.rx_bandwidth = ((double) (*p)) * 50.0;
-    p += 1;
-
-    /* The next one byte value contains the receive gain */
-    sdata->gsfEM4Specific.run_time.rx_fixed_gain = (double) *p;
-    p += 1;
-
-    /* The next one byte value contains the TVG law cross-over angle */
-    sdata->gsfEM4Specific.run_time.tvg_cross_over_angle = (double) *p;
-    p += 1;
-
-    /* The next one byte value contains the source of the surface sound speed value */
-    sdata->gsfEM4Specific.run_time.ssv_source = (unsigned char) *p;
-    p += 1;
-
-    /* The next two byte value contains the maximum port swath width in meters */
-    memcpy(&sstemp, p, 2);
-    sdata->gsfEM4Specific.run_time.max_port_swath_width = (int) ntohs(sstemp);
-    p += 2;
-
-    /* The next one byte value contains a bit mask defining the beam spacing */
-    sdata->gsfEM4Specific.run_time.beam_spacing = (unsigned char) *p;
-    p += 1;
-
-    /* The next one byte value contains the port coverage in degrees */
-    sdata->gsfEM4Specific.run_time.max_port_coverage = (int) *p;
-    p += 1;
-
-    /* The next one byte value contains a bit mask defining the yaw and pitch stabilization mode */
-    sdata->gsfEM4Specific.run_time.stabilization = (unsigned char) *p;
-    p += 1;
-
-    /* The next one byte value contains the starboard coverage in degrees */
-    sdata->gsfEM4Specific.run_time.max_stbd_coverage = (int) *p;
-    p += 1;
-
-    /* The next two byte value contains the maximum starboard swath width in meters */
-    memcpy(&stemp, p, 2);
-    sdata->gsfEM4Specific.run_time.max_stbd_swath_width = (int) ntohs(stemp);
-    p += 2;
-
-    /* The next two byte value contains the transmit along track tilt in degrees */
-    memcpy(&stemp, p, 2);
-    sstemp = (gsfsShort) ntohs(stemp);
-    sdata->gsfEM4Specific.run_time.tx_along_tilt = ((double) sstemp) / 100.0;
-    p += 2;
-
-    /* The next one byte value contains the filter ID 2, with the value for the penetration filter */
-    sdata->gsfEM4Specific.run_time.filter_id_2 = (unsigned char) *p;
-    p += 1;
-
-    /* The next 16 bytes of space on the byte stream are spare space for future use. */
-    memset (&sdata->gsfEM4Specific.run_time.spare, 0, (size_t) sizeof(sdata->gsfEM4Specific.run_time.spare));
-    p += 16;
-
-    /* Decode the PU status fields */
-
-    /* The next one byte value contains the processor unit CPU load */
-    sdata->gsfEM4Specific.pu_status.pu_cpu_load = (double) *p;
-    p += 1;
-
-    /* The next two byte value contains a bit mask with the status of the PU sensor inputs */
-    memcpy(&stemp, p, 2);
-    sdata->gsfEM4Specific.pu_status.sensor_status = ((unsigned short) ntohs(stemp));
-    p += 2;
-
-    /* The next one byte value contains the achieved port coverage in degrees */
-    ctemp = (char) *p;
-    sdata->gsfEM4Specific.pu_status.achieved_port_coverage = (int) ctemp;
-    p += 1;
-
-    /* The next one byte value contains the achieved starboard coverage in degrees */
-    ctemp = (char) *p;
-    sdata->gsfEM4Specific.pu_status.achieved_stbd_coverage = (int) ctemp;
-    p += 1;
-
-    /* The next two bytes contain the amount of yaw stabilization */
-    memcpy(&stemp, p, 2);
-    sstemp = (gsfsShort) ntohs (stemp);
-    sdata->gsfEM4Specific.pu_status.yaw_stabilization = ((double) sstemp) / 100.0;
-    p += 2;
-
-    /* The next 16 bytes are spare space for future use */
-    memset (&sdata->gsfEM4Specific.pu_status.spare, 0, (size_t) 16);
-    p += 16;
-
-    return (p - sptr);
-}
-
-/********************************************************************
- *
- * Function Name : DecodeGeoSwathPlusSpecific
- *
- * Description : This function decodes the GeoSwath GS+ series sonar system
- *    sensor specific information from the GSF byte stream.
- *
- * Inputs :
- *    sdata = a pointer to the union of sensor specific data to be loaded
- *    sptr = a pointer to an unsigned char buffer containing the byte stream
- *           to read.
- *
- * Returns : This function returns the number of bytes enocoded.
- *
- * Error Conditions : none
- *
- ********************************************************************/
-
-static int
-DecodeGeoSwathPlusSpecific(gsfSensorSpecific *sdata, unsigned char *sptr)
-{
-    unsigned char  *p = sptr;
-    gsfuShort       stemp;
-    gsfuLong        ltemp;
-    double          dtemp;
-
-    /* First 2 bytes contain the data source (0 = CBF, 1 = RDF) */
-    memcpy(&stemp, p, 2);
-    sdata->gsfGeoSwathPlusSpecific.data_source = (int) ntohs(stemp);
-    p += 2;
-
-    /* Next 2 bytes contain the ping side (0 port, 1 = stbd)  */
-    memcpy(&stemp, p, 2);
-    sdata->gsfGeoSwathPlusSpecific.side = (int) ntohs(stemp);
-    p += 2;
-
-    /* Next 2 bytes is the sonar model number */
-    memcpy(&stemp, p, 2);
-    sdata->gsfGeoSwathPlusSpecific.model_number = (int) ntohs(stemp);
-    p += 2;
-
-    /* Next 2 bytes is the frequency, in units of Hertz */
-    memcpy(&stemp, p, 2);
-    dtemp = (double) ntohs(stemp);
-    sdata->gsfGeoSwathPlusSpecific.frequency = dtemp * 10.0;
-    p += 2;
-
-    /* Next 2 bytes is the echosounder_type */
-    memcpy(&stemp, p, 2);
-    sdata->gsfGeoSwathPlusSpecific.echosounder_type = (int) ntohs(stemp);
-    p += 2;
-
-    /* Next four byte integer contains the ping number */
-    memcpy(&ltemp, p, 4);
-    sdata->gsfGeoSwathPlusSpecific.ping_number = (long) ntohl(ltemp);
-    p += 4;
-
-    /* Next 2 bytes is the num_nav_samples */
-    memcpy(&stemp, p, 2);
-    sdata->gsfGeoSwathPlusSpecific.num_nav_samples  = (int) ntohs(stemp);
-    p += 2;
-
-    /* Next 2 bytes is the num_attitude_samples */
-    memcpy(&stemp, p, 2);
-    sdata->gsfGeoSwathPlusSpecific.num_attitude_samples  = (int) ntohs(stemp);
-    p += 2;
-
-    /* Next 2 bytes is the num_heading_samples */
-    memcpy(&stemp, p, 2);
-    sdata->gsfGeoSwathPlusSpecific.num_heading_samples  = (int) ntohs(stemp);
-    p += 2;
-
-    /* Next 2 bytes is the side indicator num_miniSVS_samples */
-    memcpy(&stemp, p, 2);
-    sdata->gsfGeoSwathPlusSpecific.num_miniSVS_samples  = (int) ntohs(stemp);
-    p += 2;
-
-    /* Next 2 bytes is the num_echosunder_samples */
-    memcpy(&stemp, p, 2);
-    sdata->gsfGeoSwathPlusSpecific.num_echosounder_samples  = (int) ntohs(stemp);
-    p += 2;
-
-    /* Next 2 bytes is the num_raa_samples */
-    memcpy(&stemp, p, 2);
-    sdata->gsfGeoSwathPlusSpecific.num_raa_samples  = (int) ntohs(stemp);
-    p += 2;
-
-    /* Next 2 bytes is the mean_sv */
-    memcpy(&stemp, p, 2);
-    dtemp = (double) ntohs(stemp);
-    sdata->gsfGeoSwathPlusSpecific.mean_sv = dtemp / 20.0;
-    p += 2;
-
-    /* Next 2 bytes is the surface_velocity */
-    memcpy(&stemp, p, 2);
-    dtemp = (double) ntohs(stemp);
-    sdata->gsfGeoSwathPlusSpecific.surface_velocity = dtemp / 20.0;
-    p += 2;
-
-    /* Next 2 bytes is the  valid_beams */
-    memcpy(&stemp, p, 2);
-    sdata->gsfGeoSwathPlusSpecific.valid_beams  = (int) ntohs(stemp);
-    p += 2;
-
-    /* Next 2 bytes is the sample_rate */
-    memcpy(&stemp, p, 2);
-    dtemp = (double) ntohs(stemp);
-    sdata->gsfGeoSwathPlusSpecific.sample_rate = dtemp * 10.0;
-    p += 2;
-
-    /* Next 2 bytes is the pulse_length */
-    memcpy(&stemp, p, 2);
-    sdata->gsfGeoSwathPlusSpecific.pulse_length = (double) ntohs(stemp);
-    p += 2;
-
-    /* Next 2 bytes is the ping_length */
-    memcpy(&stemp, p, 2);
-    sdata->gsfGeoSwathPlusSpecific.ping_length = (int) ntohs(stemp);
-    p += 2;
-
-    /* Next 2 bytes is the transmit_power */
-    memcpy(&stemp, p, 2);
-    sdata->gsfGeoSwathPlusSpecific.transmit_power = (int) ntohs(stemp);
-    p += 2;
-
-    /* Next 2 bytes is the sidescan_gain_channel */
-    memcpy(&stemp, p, 2);
-    sdata->gsfGeoSwathPlusSpecific.sidescan_gain_channel = (int) ntohs(stemp);
-    p += 2;
-
-    /* Next 2 bytes is the stabilization */
-    memcpy(&stemp, p, 2);
-    sdata->gsfGeoSwathPlusSpecific.stabilization = (int) ntohs(stemp);
-    p += 2;
-
-    /* Next 2 bytes is the gps_quality */
-    memcpy(&stemp, p, 2);
-    sdata->gsfGeoSwathPlusSpecific.gps_quality = (int) ntohs(stemp);
-    p += 2;
-
-    /* Next 2 bytes is the range uncertainty scaled to millimetres */
-    memcpy(&stemp, p, 2);
-    dtemp = (double) ntohs(stemp);
-    sdata->gsfGeoSwathPlusSpecific.range_uncertainty = dtemp / 1000.0;
-    p += 2;
-
-    /* Next 2 bytes is the angle uncertainty */
-    memcpy(&stemp, p, 2);
-    dtemp = (double) ntohs(stemp);
-    sdata->gsfGeoSwathPlusSpecific.angle_uncertainty = dtemp / 100.0;
-    p += 2;
-
-    /* Next 32 bytes are spare, but preserved for now */
-    memcpy (sdata->gsfGeoSwathPlusSpecific.spare, p, sizeof (char) * 32);
-    p += 32;
-
-    return(p - sptr);
-}
-
-/********************************************************************
- *
- * Function Name : DecodeKlein5410BssSpecific
- *
- * Description : This function decodes the Klein 5410 Bathy sidescan series
- *    sonar system sensor specific information from the GSF byte stream.
- *
- * Inputs :
- *    sdata = a pointer to the union of sensor specific data to be loaded
- *    sptr = a pointer to an unsigned char buffer containing the byte stream
- *           to read.
- *
- * Returns : This function returns the number of bytes enocoded.
- *
- * Error Conditions : none
- *
- ********************************************************************/
-
-static int
-DecodeKlein5410BssSpecific(gsfSensorSpecific *sdata, unsigned char *sptr)
-{
-    unsigned char  *p = sptr;
-    gsfuShort       stemp;
-    gsfuLong        ltemp;
-
-    /* First 2 bytes contain the data source (0 = SDF) */
-    memcpy(&stemp, p, 2);
-    sdata->gsfKlein5410BssSpecific.data_source = (int) ntohs(stemp);
-    p += 2;
-
-    /* Next 2 bytes contain the ping side (0 port, 1 = stbd)  */
-    memcpy(&stemp, p, 2);
-    sdata->gsfKlein5410BssSpecific.side = (int) ntohs(stemp);
-    p += 2;
-
-    /* Next 2 bytes contain the sonar model number */
-    memcpy(&stemp, p, 2);
-    sdata->gsfKlein5410BssSpecific.model_number = (int) ntohs(stemp);
-    p += 2;
-
-    /* Next four bytes contain the system frequency */
-    memcpy(&ltemp, p, 4);
-    sdata->gsfKlein5410BssSpecific.acoustic_frequency = (double) (ntohl(ltemp)) / 1000.0;
-    p += 4;
-
-    /* Next four bytes contain the sampling frequency */
-    memcpy(&ltemp, p, 4);
-    sdata->gsfKlein5410BssSpecific.sampling_frequency = (double) (ntohl(ltemp)) / 1000.0;
-    p += 4;
-
-    /* Next four bytes contain the ping number */
-    memcpy(&ltemp, p, 4);
-    sdata->gsfKlein5410BssSpecific.ping_number = (unsigned int) (ntohl(ltemp));
-    p += 4;
-
-    /* Next four bytes contain the total number of samples in the ping */
-    memcpy(&ltemp, p, 4);
-    sdata->gsfKlein5410BssSpecific.num_samples = (unsigned int) ntohl(ltemp);
-    p += 4;
-
-    /* Next four bytes contain the number of valid range, angle, amplitude
-    samples in the ping */
-    memcpy(&ltemp, p, 4);
-    sdata->gsfKlein5410BssSpecific.num_raa_samples = (unsigned int) ntohl(ltemp);
-    p += 4;
-
-    /* Next four bytes contain the error flags */
-    memcpy(&ltemp, p, 4);
-    sdata->gsfKlein5410BssSpecific.error_flags = (unsigned int) ntohl(ltemp);
-    p += 4;
-
-    /* Next four bytes contain the range */
-    memcpy(&ltemp, p, 4);
-    sdata->gsfKlein5410BssSpecific.range = (unsigned int) ntohl(ltemp);
-    p += 4;
-
-    /* Next four bytes contain the reading from the towfish pressure sensor in Volts */
-    memcpy(&ltemp, p, 4);
-    sdata->gsfKlein5410BssSpecific.fish_depth = (double) (ntohl(ltemp)) / 1000.0;
-    p += 4;
-
-    /* Next four bytes contain the towfish altitude in m */
-    memcpy(&ltemp, p, 4);
-    sdata->gsfKlein5410BssSpecific.fish_altitude = (double) (ntohl(ltemp)) / 1000.0;
-    p += 4;
-
-    /* Next four bytes contain the speed of sound at the transducer face in m/sec */
-    memcpy(&ltemp, p, 4);
-    sdata->gsfKlein5410BssSpecific.sound_speed = (double) (ntohl(ltemp)) / 1000.0;
-    p += 4;
-
-    /* Next 2 bytes contain the transmit pulse  */
-    memcpy(&stemp, p, 2);
-    sdata->gsfKlein5410BssSpecific.tx_waveform = (int) ntohs(stemp);
-    p += 2;
-
-    /* Next 2 bytes contain the altimeter status: 0 = passive, 1 = active  */
-    memcpy(&stemp, p, 2);
-    sdata->gsfKlein5410BssSpecific.altimeter = (int) ntohs(stemp);
-    p += 2;
-
-    /* Next four bytes contain the raw data configuration */
-    memcpy(&ltemp, p, 4);
-    sdata->gsfKlein5410BssSpecific.raw_data_config = (unsigned int) (ntohl(ltemp));
-    p += 4;
-
-    /* Next 32 bytes are spare, but reserved for the future */
-    memcpy (sdata->gsfKlein5410BssSpecific.spare, p, sizeof (char) * 32);
-    p += 32;
-
-    return(p - sptr);
-}
-
-/********************************************************************
- *
- * Function Name : DecodeReson8100Specific
- *
- * Description : This function decodes the Reson SeaBat 8101 sensor specific
- *    information from the GSF byte stream.
- *
- * Inputs :
- *    sdata = a pointer to the union of sensor specific data to be loaded
- *    sptr = a pointer to an unsigned char buffer containing the byte stream
- *           to read.
- *
- * Returns : This function returns the number of bytes enocoded.
- *
- * Error Conditions : none
- *
- ********************************************************************/
-
-static int
-DecodeReson8100Specific(gsfSensorSpecific * sdata, unsigned char *sptr)
-{
-    unsigned char  *p = sptr;
-    gsfuShort       stemp;
-    gsfuLong        ltemp;
-
-    /* First two byte integer contains the sonar latency */
-    memcpy(&stemp, p, 2);
-    sdata->gsfReson8100Specific.latency = (int) ntohs(stemp);
-    p += 2;
-
-    /* Next four byte integer contains the ping number */
-    memcpy(&ltemp, p, 4);
-    sdata->gsfReson8100Specific.ping_number = (int) ntohl(ltemp);
-    p += 4;
-
-    /* Next four byte integer contains the sonar id */
-    memcpy(&ltemp, p, 4);
-    sdata->gsfReson8100Specific.sonar_id = (int) ntohl(ltemp);
-    p += 4;
-
-    /* Next two byte integer contains the sonar model */
-    memcpy(&stemp, p, 2);
-    sdata->gsfReson8100Specific.sonar_model = (int) ntohs(stemp);
-    p += 2;
-
-    /* Next two byte integer contains the sonar frequency */
-    memcpy(&stemp, p, 2);
-    sdata->gsfReson8100Specific.frequency = (int) ntohs(stemp);
-    p += 2;
-
-    /* Next two byte integer contains the sea surface sound speed * 10 */
-    memcpy(&stemp, p, 2);
-    sdata->gsfReson8100Specific.surface_velocity = ((double) ntohs(stemp)) / 10.0;
-    p += 2;
-
-    /* Next two byte integer contains the sample rate */
-    memcpy(&stemp, p, 2);
-    sdata->gsfReson8100Specific.sample_rate = (int) ntohs(stemp);
-    p += 2;
-
-    /* Next two byte integer contains the ping rate */
-    memcpy(&stemp, p, 2);
-    sdata->gsfReson8100Specific.ping_rate = (int) ntohs(stemp);
-    p += 2;
-
-    /* Next two byte integer contains the sonar mode of operation */
-    memcpy(&stemp, p, 2);
-    sdata->gsfReson8100Specific.mode = (int) ntohs(stemp);
-    p += 2;
-
-    /* Next two byte integer contains the range setting */
-    memcpy(&stemp, p, 2);
-    sdata->gsfReson8100Specific.range = (int) ntohs(stemp);
-    p += 2;
-
-    /* Next two byte integer contains the power setting */
-    memcpy(&stemp, p, 2);
-    sdata->gsfReson8100Specific.power = (int) ntohs(stemp);
-    p += 2;
-
-    /* Next two byte integer contains the gain setting */
-    memcpy(&stemp, p, 2);
-    sdata->gsfReson8100Specific.gain = (int) ntohs(stemp);
-    p += 2;
-
-    /* Next two byte integer contains the transmit pulse width */
-    memcpy(&stemp, p, 2);
-    sdata->gsfReson8100Specific.pulse_width = (int) ntohs(stemp);
-    p += 2;
-
-    /* Next byte contains the tvg spreading coefficient */
-    sdata->gsfReson8100Specific.tvg_spreading = (int) *p;
-    p += 1;
-
-    /* Next byte contains the tvg absorption coefficient */
-    sdata->gsfReson8100Specific.tvg_absorption = (int) *p;
-    p += 1;
-
-    /* Next byte contains the fore/aft beamwidth */
-    sdata->gsfReson8100Specific.fore_aft_bw = ((double) *p) / 10.0;
-    p += 1;
-
-    /* Next byte contains the athwartships beamwidth */
-    sdata->gsfReson8100Specific.athwart_bw = ((double) *p) / 10.0;
-    p += 1;
-
-    /* Next byte contains the projector type */
-    sdata->gsfReson8100Specific.projector_type = (int) *p;
-    p += 1;
-
-    /* Next two byte integer contains the projector angle, in deg * 100 */
-    memcpy(&stemp, p, 2);
-    sdata->gsfReson8100Specific.projector_angle = (gsfsShort) ntohs(stemp);
-    p += 2;
-
-    /* Next two byte integer contains the range filter minimum value */
-    memcpy(&stemp, p, 2);
-    sdata->gsfReson8100Specific.range_filt_min = (int) ntohs(stemp);
-    p += 2;
-
-    /* Next two byte integer contains the range filter maximum value */
-    memcpy(&stemp, p, 2);
-    sdata->gsfReson8100Specific.range_filt_max = (int) ntohs(stemp);
-    p += 2;
-
-    /* Next two byte integer contains the depth filter minimum value */
-    memcpy(&stemp, p, 2);
-    sdata->gsfReson8100Specific.depth_filt_min = (int) ntohs(stemp);
-    p += 2;
-
-    /* Next two byte integer contains the depth filter maximum value */
-    memcpy(&stemp, p, 2);
-    sdata->gsfReson8100Specific.depth_filt_max = (int) ntohs(stemp);
-    p += 2;
-
-    /* Next byte contains the filters active flags*/
-    sdata->gsfReson8100Specific.filters_active = (int) *p;
-    p += 1;
-
-    /* Next two byte integer contains the temperature at the sonar head */
-    memcpy(&stemp, p, 2);
-    sdata->gsfReson8100Specific.temperature = (int) ntohs(stemp);
-    p += 2;
-
-    /* Next two byte integer contains the across track angular beam spacing * 10000 */
-    memcpy(&stemp, p, 2);
-    sdata->gsfReson8100Specific.beam_spacing = ((double) ntohs(stemp)) / 10000.0;
-    p += 2;
-
-    /* Next two bytes are reserved for future growth */
-    sdata->gsfReson8100Specific.spare[0] = (char) *p;
-    p += 1;
-    sdata->gsfReson8100Specific.spare[1] = (char) *p;
-    p += 1;
-
-    return (p - sptr);
-}
-
-
-
-/********************************************************************
- *
- * Function Name : DecodeReson7100Specific
- *
- * Description : This function decodes the Reson SeaBat 7100 sensor specific
- *    information from the GSF byte stream.
- *
- * Inputs :
- *    sdata = a pointer to the union of sensor specific data to be loaded
- *    sptr = a pointer to an unsigned char buffer containing the byte stream
- *           to read.
- *
- * Returns : This function returns the number of bytes enocoded.
- *
- * Error Conditions : none
- *
- ********************************************************************/
-
-static int
-DecodeReson7100Specific(gsfSensorSpecific * sdata, unsigned char *sptr)
-{
-    unsigned char  *p = sptr;
-    gsfuShort       stemp;
-    gsfuLong        ltemp;
-    gsfsLong        sltemp;
-    gsfsShort       signed_temp;
-
-    /* First two bytes contains the data format definition version number */
-    memcpy(&stemp, p, 2);
-    sdata->gsfReson7100Specific.protocol_version = (unsigned int) ntohs(stemp);
-    p += 2;
-
-    /* The next four bytes contains the sonar device ID */
-    memcpy(&ltemp, p, 4);
-    sdata->gsfReson7100Specific.device_id = (unsigned int) ntohl(ltemp);
-    p += 4;
-
-    /* The next 16 bytes are spare space for future growth */
-    memset(&sdata->gsfReson7100Specific.reserved_1[0], 0, 16);
-    p += 16;
-
-    /* The next four byte integer contains the high order four bytes of the sonar serial number */
-    memcpy(&ltemp, p, 4);
-    sdata->gsfReson7100Specific.major_serial_number = (unsigned int) ntohl(ltemp);
-    p += 4;
-
-    /* The next four byte integer contains the low order four bytes of the sonar serial number */
-    memcpy(&ltemp, p, 4);
-    sdata->gsfReson7100Specific.minor_serial_number = (unsigned int) ntohl(ltemp);
-    p += 4;
-
-    /* Next four byte integer contains the ping number */
-    memcpy(&ltemp, p, 4);
-    sdata->gsfReson7100Specific.ping_number = (unsigned int) ntohl(ltemp);
-    p += 4;
-
-    /* Next two byte integer contains the multi-ping sequence */
-    memcpy(&stemp, p, 2);
-    sdata->gsfReson7100Specific.multi_ping_seq = (unsigned int) ntohs(stemp);
-    p += 2;
-
-    /* Next four byte integer contains the sonar frequency */
-    memcpy(&ltemp, p, 4);
-    sdata->gsfReson7100Specific.frequency = ((double) ntohl(ltemp)) / 1.0e3;
-    p += 4;
-
-    /* Next four byte integer contains the sample rate */
-    memcpy(&ltemp, p, 4);
-    sdata->gsfReson7100Specific.sample_rate = ((double) ntohl(ltemp)) / 1.0e4;
-    p += 4;
-
-    /* Next four byte integer contains the receiver bandwidth, in Hz */
-    memcpy(&ltemp, p, 4);
-    sdata->gsfReson7100Specific.receiver_bandwdth = ((double) ntohl(ltemp)) / 1.0e4;
-    p += 4;
-
-    /* Next four byte integer contains the pulse width, in seconds scaled by 10,000,000.0 */
-    memcpy(&ltemp, p, 4);
-    sdata->gsfReson7100Specific.tx_pulse_width = ((double) ntohl(ltemp)) / 1.0e7;
-    p += 4;
-
-    /* Next four byte integer contains the pulse type id */
-    memcpy(&ltemp, p, 4);
-    sdata->gsfReson7100Specific.tx_pulse_type_id = (unsigned int) ntohl(ltemp);
-    p += 4;
-
-    /* Next four byte integer contains the pulse envelope id */
-    memcpy(&ltemp, p, 4);
-    sdata->gsfReson7100Specific.tx_pulse_envlp_id = (unsigned int) ntohl(ltemp);
-    p += 4;
-
-    /* Next four byte integer contains the pulse envelope parameter */
-    memcpy(&ltemp, p, 4);
-    sdata->gsfReson7100Specific.tx_pulse_envlp_param = (unsigned int) ntohl(ltemp);
-    p += 4;
-
-    /* Next four byte integer contains additional pulse information */
-    memcpy(&ltemp, p, 4);
-    sdata->gsfReson7100Specific.tx_pulse_reserved = (unsigned int) ntohl(stemp);
-    p += 4;
-
-    /* Next four byte integer contains the ping rate */
-    memcpy(&ltemp, p, 4);
-    sdata->gsfReson7100Specific.max_ping_rate = ((double) ntohl(ltemp)) / 1.0e6;
-    p += 4;
-
-    /* Next four byte integer contains the ping period */
-    memcpy(&ltemp, p, 4);
-    sdata->gsfReson7100Specific.ping_period = ((double) ntohl(ltemp)) / 1.0e6;
-    p += 4;
-
-    /* Next four byte integer contains the range setting */
-    memcpy(&ltemp, p, 4);
-    sdata->gsfReson7100Specific.range = ((double) ntohl(ltemp)) / 1.0e2;
-    p += 4;
-
-    /* Next four byte integer contains the power setting */
-    memcpy(&ltemp, p, 4);
-    sdata->gsfReson7100Specific.power = ((double) ntohl(ltemp)) / 1.0e2;
-    p += 4;
-
-    /* Next four byte integer contains the gain setting */
-    memcpy(&ltemp, p, 4);
-    signed_temp = (gsfsLong) ntohl(ltemp);
-    sdata->gsfReson7100Specific.gain = ((double) signed_temp) / 1.0e2;
-    p += 4;
-
-    /* Next four byte integer contains the control flags */
-    memcpy(&ltemp, p, 4);
-    sdata->gsfReson7100Specific.control_flags = (unsigned int) ntohl(ltemp);
-    p += 4;
-
-    /* Next four byte value contains the projector type */
-    memcpy(&ltemp, p, 4);
-    sdata->gsfReson7100Specific.projector_id = (unsigned int) ntohl(ltemp);
-    p += 4;
-
-    /* Next four byte integer contains the projector angle, in deg * 100 */
-    memcpy(&sltemp, p, 4);
-    sdata->gsfReson7100Specific.projector_steer_angl_vert = ((double) ntohl(sltemp)) / 1.0e3;
-    p += 4;
-
-    /* Next four byte integer contains the projector angle, in deg * 100 */
-    memcpy(&sltemp, p, 4);
-    sdata->gsfReson7100Specific.projector_steer_angl_horz = ((double) ntohl(sltemp)) / 1.0e3;
-    p += 4;
-
-    /* Next two byte value contains the fore/aft beamwidth */
-    memcpy(&stemp, p, 2);
-    sdata->gsfReson7100Specific.projector_beam_wdth_vert = ((double) ntohs(stemp)) / 1.0e2;
-    p += 2;
-
-    /* Next byte contains the athwartships beamwidth */
-    memcpy(&stemp, p, 2);
-    sdata->gsfReson7100Specific.projector_beam_wdth_horz = ((double) ntohs(stemp)) / 1.0e2;
-    p += 2;
-
-    /* Next two byte integer contains the projector beam focal point */
-    memcpy(&ltemp, p, 4);
-    sdata->gsfReson7100Specific.projector_beam_focal_pt = ((double) ntohl(ltemp)) / 1.0e2;
-    p += 4;
-
-    /* Next byte contains the projector beam weighting window type */
-    memcpy(&ltemp, p, 4);
-    sdata->gsfReson7100Specific.projector_beam_weighting_window_type = (unsigned int) ntohl(ltemp);
-    p += 4;
-
-    /* Next two byte integer contains the projector beam weighting window parameter */
-    memcpy(&ltemp, p, 4);
-    sdata->gsfReson7100Specific.projector_beam_weighting_window_param = (unsigned int) ntohl(ltemp);
-    p += 4;
-
-    /* Next two byte integer contains the transmit flags */
-    memcpy(&ltemp, p, 4);
-    sdata->gsfReson7100Specific.transmit_flags = (unsigned int) ntohl(ltemp);
-    p += 4;
-
-    /* Next four byte value contains the hydrophone type */
-    memcpy(&ltemp, p, 4);
-    sdata->gsfReson7100Specific.hydrophone_id = (unsigned int) ntohl(ltemp);
-    p += 4;
-
-    /* Next four byte value contains the receive beam weighting window type */
-    memcpy(&ltemp, p, 4);
-    sdata->gsfReson7100Specific.receiving_beam_weighting_window_type = (unsigned int) ntohl(ltemp);
-    p += 4;
-
-    /* Next four byte integer contains the receive beam weighting window param */
-    memcpy(&ltemp, p, 4);
-    sdata->gsfReson7100Specific.receiving_beam_weighting_window_param = (unsigned int) ntohl(ltemp);
-    p += 4;
-
-    /* Next four byte integer contains the receive flags */
-    memcpy(&ltemp, p, 4);
-    sdata->gsfReson7100Specific.receive_flags = ntohl(ltemp);
-    p += 4;
-
-    /* The next two byte value contains the receive beam width */
-    memcpy(&stemp, p, 2);
-    sdata->gsfReson7100Specific.receive_beam_width = ((double) ntohs(stemp)) / 1.0e2;
-    p += 2;
-
-    /* Next two byte value contains the range filter minimum value */
-    memcpy(&stemp, p, 2);
-    sdata->gsfReson7100Specific.range_filt_min = ((double) ntohs(stemp)) / 1.0e1;
-    p += 2;
-
-    /* Next one byte value contains the range filter maximum value */
-    memcpy(&stemp, p, 2);
-    sdata->gsfReson7100Specific.range_filt_max = ((double) ntohs(stemp)) / 1.0e1;
-    p += 2;
-
-    /* Next one byte value contains the depth filter minimum value */
-    memcpy(&stemp, p, 2);
-    sdata->gsfReson7100Specific.depth_filt_min = ((double) ntohs(stemp)) / 1.0e1;
-    p += 2;
-
-    /* Next two byte integer contains the depth filter maximum value */
-    memcpy(&stemp, p, 2);
-    sdata->gsfReson7100Specific.depth_filt_max = ((double) ntohs(stemp)) / 1.0e1;
-    p += 2;
-
-    /* Next four byte value contains the absorption  */
-    memcpy(&ltemp, p, 4);
-    sdata->gsfReson7100Specific.absorption = ((double) ntohl(ltemp)) / 1.0e3;
-    p += 4;
-
-    /* Next two byte integer contains the sound velocity * 10 */
-    memcpy(&stemp, p, 2);
-    sdata->gsfReson7100Specific.sound_velocity = ((double) ntohs(stemp)) / 1.0e1;
-    p += 2;
-
-    /* Next four byte value contains the spreading loss */
-    memcpy(&ltemp, p, 4);
-    sdata->gsfReson7100Specific.spreading = ((double) ntohl(ltemp)) / 1.0e3;
-    p += 4;
-
-    /* The next 16 bytes are spare space for future growth */
-    memset(&sdata->gsfReson7100Specific.reserved_2[0], 0, 16);
-    p += 16;
-
-    /* The next byte contains the sv source */
-    sdata->gsfReson7100Specific.sv_source = *p;
-    p += 1;
-
-    /* The next byte contains the layer compensation flag */
-    sdata->gsfReson7100Specific.layer_comp_flag = *p;
-    p += 1;
-
-    /* The next 8 bytes are spare space for future growth */
-    memset(&sdata->gsfReson7100Specific.reserved_3[0], 0, 8);
-    p += 8;
-
-    return (p - sptr);
-}
-
-/********************************************************************
- *
- * Function Name : DecodeDeltaTSpecific
- *
- * Description : This function decodes the Imagenex Delta T sensor specific
- *    information from the GSF byte stream.
- *
- * Inputs :
- *    sdata = a pointer to the union of sensor specific data to be loaded
- *    sptr = a pointer to an unsigned char buffer containing the byte stream
- *           to read.
- *
- * Returns : This function returns the number of bytes encoded.
- *
- * Error Conditions : none
- *
- ********************************************************************/
-
-static int
-DecodeDeltaTSpecific(gsfSensorSpecific * sdata, unsigned char *sptr)
-{
-    unsigned char  *p = sptr;
-    gsfuShort       stemp;
-    gsfuLong        ltemp;
-
-    /* Next 4 bytes contain the decode file type */
-    memset (sdata->gsfDeltaTSpecific.decode_file_type, 0, 4);
-    memcpy (sdata->gsfDeltaTSpecific.decode_file_type, p, 4);
-    p += 4;
-
-    /* The next byte contains the version field */
-    sdata->gsfDeltaTSpecific.version = *p;
-    p += 1;
-
-    /* Next two byte integer contains the ping byte size */
-    memcpy(&stemp, p, 2);
-    sdata->gsfDeltaTSpecific.ping_byte_size = ntohs(stemp);
-    p += 2;
-
-    /* The next 8 bytes contain the time-tag for the ping interrogation time */
-    memcpy(&ltemp, p, 4);
-    sdata->gsfDeltaTSpecific.interrogation_time.tv_sec = ntohl(ltemp);
-    p += 4;
-    memcpy(&ltemp, p, 4);
-    sdata->gsfDeltaTSpecific.interrogation_time.tv_nsec = ntohl(ltemp);
-    p += 4;
-
-    /* Next two byte integer contains the samples per beam */
-    memcpy(&stemp, p, 2);
-    sdata->gsfDeltaTSpecific.samples_per_beam = ntohs(stemp);
-    p += 2;
-
-    /* Next two byte integer contains the sector size */
-    memcpy(&stemp, p, 2);
-    sdata->gsfDeltaTSpecific.sector_size = (double) ntohs(stemp);
-    p += 2;
-
-    /* Next two byte integer contains the start angle */
-    memcpy(&stemp, p, 2);
-    sdata->gsfDeltaTSpecific.start_angle = (((double) ntohs(stemp)) / 100.0) - 180.0;
-    p += 2;
-
-    /* Next two byte integer contains the start angle */
-    memcpy(&stemp, p, 2);
-    sdata->gsfDeltaTSpecific.angle_increment = (((double) ntohs(stemp)) / 100.0);
-    p += 2;
-
-    /* Next two byte integer contains the acoustic range */
-    memcpy(&stemp, p, 2);
-    sdata->gsfDeltaTSpecific.acoustic_range = (double) ntohs(stemp);
-    p += 2;
-
-    /* Next two byte integer contains the acoustic range */
-    memcpy(&stemp, p, 2);
-    sdata->gsfDeltaTSpecific.acoustic_frequency = (double) ntohs(stemp);
-    p += 2;
-
-    /* Next two byte integer contains the acoustic range */
-    memcpy(&stemp, p, 2);
-    sdata->gsfDeltaTSpecific.sound_velocity = (((double) ntohs(stemp)) / 10.0);
-    p += 2;
-
-    /* Next two byte integer contains the range resolution */
-    memcpy(&stemp, p, 2);
-    sdata->gsfDeltaTSpecific.range_resolution = (double) ntohs(stemp);
-    p += 2;
-
-    /* Next two byte integer contains the profile tilt angle */
-    memcpy(&stemp, p, 2);
-    sdata->gsfDeltaTSpecific.profile_tilt_angle = ((double) ntohs(stemp)) - 180.0;
-    p += 2;
-
-    /* Next two byte integer contains the repetition rate */
-    memcpy(&stemp, p, 2);
-    sdata->gsfDeltaTSpecific.repetition_rate = (double) ntohs(stemp);
-    p += 2;
-
-    /* Next four byte integer contains the ping number */
-    memcpy(&ltemp, p, 4);
-    sdata->gsfDeltaTSpecific.ping_number = ntohl(ltemp);
-    p += 4;
-
-    /* The next byte contains the version field */
-    sdata->gsfDeltaTSpecific.intensity_flag = *p;
-    p += 1;
-
-    /* Next two byte integer contains the ping latency field */
-    memcpy(&stemp, p, 2);
-    sdata->gsfDeltaTSpecific.ping_latency = (((double) ntohs(stemp)) / 10000.0);
-    p += 2;
-
-    /* Next two byte integer contains the data latency field */
-    memcpy(&stemp, p, 2);
-    sdata->gsfDeltaTSpecific.data_latency = (((double) ntohs(stemp)) / 10000.0);
-    p += 2;
-
-    /* The next byte contains the sample_rate flag */
-    sdata->gsfDeltaTSpecific.sample_rate_flag = *p;
-    p += 1;
-
-    /* The next byte contains the option flags */
-    sdata->gsfDeltaTSpecific.option_flags = *p;
-    p += 1;
-
-    /* The next byte contains the number of pings averaged */
-    sdata->gsfDeltaTSpecific.num_pings_avg = *p;
-    p += 1;
-
-    /* Next two byte integer contains the center ping time offset field */
-    memcpy(&stemp, p, 2);
-    sdata->gsfDeltaTSpecific.center_ping_time_offset = (((double) ntohs(stemp)) / 10000.0);
-    p += 2;
-
-    /* The next byte contains the user defined byte */
-    sdata->gsfDeltaTSpecific.user_defined_byte = *p;
-    p += 1;
-
-    /* Next four byte integer contains the altitude number */
-    memcpy(&ltemp, p, 4);
-    sdata->gsfDeltaTSpecific.altitude = ((double) ntohl(ltemp)) / 100.0;
-    p += 4;
-
-    /* The next byte contains the external sensor flags field */
-    sdata->gsfDeltaTSpecific.external_sensor_flags = *p;
-    p += 1;
-
-    /* Next four byte integer contains the pulse length field */
-    memcpy(&ltemp, p, 4);
-    sdata->gsfDeltaTSpecific.pulse_length = (((double) ntohl(ltemp)) / 1.0e6);
-    p += 4;
-
-    /* Next byte contains the fore aft beamwidth field */
-    sdata->gsfDeltaTSpecific.fore_aft_beamwidth = ((double) *p) / 10.0;
-    p += 1;
-
-    /* Next byte contains the athwartships beamwidth field */
-    sdata->gsfDeltaTSpecific.athwartships_beamwidth = ((double) *p) / 10.0;
-    p += 1;
-
-    /* The next 32 bytes are spare space for future growth */
-    memset(&sdata->gsfDeltaTSpecific.spare[0], 0, 32);
-    p += 32;
-
-    return (p - sptr);
-}
-
-/********************************************************************
- *
- * Function Name : DecodeR2SonicSpecific
- *
- * Description : This function decodes the R2Sonic sensor specific
- *    information from the GSF byte stream.
- *
- * Inputs :
- *    sdata = a pointer to the union of sensor specific data to be loaded
- *    sptr = a pointer to an unsigned char buffer containing the byte stream
- *           to read.
- *
- * Returns : This function returns the number of bytes encoded.
- *
- * Error Conditions : none
- *
- ********************************************************************/
-static int
-DecodeR2SonicSpecific(gsfSensorSpecific * sdata, unsigned char *sptr)
-{
-    int i;
-    unsigned char  *p = sptr;
-    gsfuShort       stemp;
-    gsfuLong        ltemp;
-    gsfsLong        sltemp;
-
-
-    /* The next 12 bytes contains the model number */
-    memset (sdata->gsfR2SonicSpecific.model_number, 0, 12);
-    memcpy (sdata->gsfR2SonicSpecific.model_number, p, 12);
-    p += 12;
-
-    /* The next 12 bytes contains the serial number */
-    memset (sdata->gsfR2SonicSpecific.serial_number, 0, 12);
-    memcpy (sdata->gsfR2SonicSpecific.serial_number, p, 12);
-    p += 12;
-
-    /* Next four byte integer contains the time in seconds */
-    memcpy(&ltemp, p, 4);
-    sdata->gsfR2SonicSpecific.dg_time.tv_sec = ntohl(ltemp);
-    p += 4;
-
-    /* Next four byte integer contains the fractional time in nanoseconds */
-    memcpy(&ltemp, p, 4);
-    sdata->gsfR2SonicSpecific.dg_time.tv_nsec = ntohl(ltemp);
-    p += 4;
-
-    /* Next four byte integer contains the ping number */
-    memcpy(&ltemp, p, 4);
-    sdata->gsfR2SonicSpecific.ping_number = ntohl(ltemp);
-    p += 4;
-
-    /* The next four bytes contains the ping period * 1,000,000 */
-    memcpy(&ltemp, p, 4);
-    sdata->gsfR2SonicSpecific.ping_period = ((double) ntohl(ltemp)) / 1.0e6;
-    p += 4;
-
-    /* The next four bytes contains the sound speed * 100 */
-    memcpy(&ltemp, p, 4);
-    sdata->gsfR2SonicSpecific.sound_speed = ((double) ntohl(ltemp)) / 1.0e2;
-    p += 4;
-
-    /* The next four bytes contains the frequency * 1000 */
-    memcpy(&ltemp, p, 4);
-    sdata->gsfR2SonicSpecific.frequency = ((double) ntohl(ltemp)) / 1.0e3;
-    p += 4;
-
-    /* The next four bytes contains the transmit source level * 100 */
-    memcpy(&ltemp, p, 4);
-    sdata->gsfR2SonicSpecific.tx_power = ((double) ntohl(ltemp)) / 1.0e2;
-    p += 4;
-
-    /* The next four bytes contains the transmit pulse width * 10,000,000.0*/
-    memcpy(&ltemp, p, 4);
-    sdata->gsfR2SonicSpecific.tx_pulse_width = ((double) ntohl(ltemp)) / 1.0e7;
-    p += 4;
-
-    /* The next four bytes contains the transmit beamwidth in the vertical * 1,000,000 */
-    memcpy(&ltemp, p, 4);
-    sdata->gsfR2SonicSpecific.tx_beamwidth_vert = ((double) ntohl(ltemp)) / 1.0e6;
-    p += 4;
-
-    /* The next four bytes contains the transmit beamwidth in the horizontal * 1,000,000*/
-    memcpy(&ltemp, p, 4);
-    sdata->gsfR2SonicSpecific.tx_beamwidth_horiz = ((double) ntohl(ltemp)) / 1.0e6;
-    p += 4;
-
-    /* The next four bytes contains the transmit steering in the vertical  * 1,000,000*/
-    memcpy(&ltemp, p, 4);
-    sltemp = (gsfsLong) ntohl (ltemp);
-    sdata->gsfR2SonicSpecific.tx_steering_vert = ((double) sltemp) / 1.0e6;
-    p += 4;
-
-    /* The next four bytes contains the transmit steering in the horizontal  * 1,000,000*/
-    memcpy(&ltemp, p, 4);
-    sltemp = (gsfsLong) ntohl (ltemp);
-    sdata->gsfR2SonicSpecific.tx_steering_horiz = ((double) sltemp) / 1.0e6;
-    p += 4;
-
-    /* The next four bytes contains misc. transmit info */
-    memcpy(&ltemp, p, 4);
-    sdata->gsfR2SonicSpecific.tx_misc_info = ntohl(ltemp);
-    p += 4;
-
-    /* The next four bytes contains the receiver bandwidth * 10,000 */
-    memcpy(&ltemp, p, 4);
-    sdata->gsfR2SonicSpecific.rx_bandwidth = ((double) ntohl(ltemp)) / 1.0e4;
-    p += 4;
-
-    /* The next four bytes contains the receiver sample rate * 1000 */
-    memcpy(&ltemp, p, 4);
-    sdata->gsfR2SonicSpecific.rx_sample_rate = ((double) ntohl(ltemp)) / 1.0e3;
-    p += 4;
-
-    /* The next four bytes contains the receiver range * 100,000 */
-    memcpy(&ltemp, p, 4);
-    sdata->gsfR2SonicSpecific.rx_range = ((double) ntohl(ltemp)) / 1.0e5;
-    p += 4;
-
-    /* The next four bytes contains the receiver gain * 100 */
-    memcpy(&ltemp, p, 4);
-    sdata->gsfR2SonicSpecific.rx_gain = ((double) ntohl(ltemp)) / 1.0e2;
-    p += 4;
-
-    /* The next four bytes contains the receiver spreading law coefficient * 1000 */
-    memcpy(&ltemp, p, 4);
-    sdata->gsfR2SonicSpecific.rx_spreading = ((double) ntohl(ltemp)) / 1.0e3;
-    p += 4;
-
-    /* The next four bytes contains the receiver absorption coefficient * 1000 */
-    memcpy(&ltemp, p, 4);
-    sdata->gsfR2SonicSpecific.rx_absorption = ((double) ntohl(ltemp)) / 1.0e3;
-    p += 4;
-
-    /* The next four bytes contains the receiver mount tilt angle * 1,000,000 */
-    memcpy(&ltemp, p, 4);
-    sltemp = (gsfsLong) ntohl (ltemp);
-    sdata->gsfR2SonicSpecific.rx_mount_tilt = ((double) sltemp) / 1.0e6;
-    p += 4;
-
-    /* The next four bytes contains misc. receiver info */
-    memcpy(&ltemp, p, 4);
-    sdata->gsfR2SonicSpecific.rx_misc_info = ntohl(ltemp);
-    p += 4;
-
-    /* The next two bytes are reserved */
-    memcpy(&stemp, p, 2);
-    sdata->gsfR2SonicSpecific.reserved = ntohs(stemp);
-    p += 2;
-
-    /* The next two bytes are for the number of beams */
-    memcpy(&stemp, p, 2);
-    sdata->gsfR2SonicSpecific.num_beams = ntohs(stemp);
-    p += 2;
-
-    /* The next set of 6x4 (24) bytes contains reserved fields from the A0 subgroup of the BTH0 */
-    for (i=0; i<6; i++)
-    {
-        memcpy(&ltemp, p, 4);
-        sltemp = (gsfsLong) ntohl (ltemp);
-        sdata->gsfR2SonicSpecific.A0_more_info[i] = ((double) sltemp) / 1.0e6;
-        p += 4;
-    }
-
-    /* The next set of 6x4 (24) bytes contains reserved fields from the A2 subgroup of the BTH0 */
-    for (i=0; i<6; i++)
-    {
-        memcpy(&ltemp, p, 4);
-        sltemp = (gsfsLong) ntohl (ltemp);
-        sdata->gsfR2SonicSpecific.A2_more_info[i] = ((double) sltemp) / 1.0e6;
-        p += 4;
-    }
-
-    /* The next four bytes contains minimum depth gate from the G0 subgroup of BTH0  */
-    memcpy(&ltemp, p, 4);
-    sdata->gsfR2SonicSpecific.G0_depth_gate_min = ((double) ntohl(ltemp)) / 1.0e6;
-    p += 4;
-
-    /* The next four bytes contains maximum depth gate from the G0 subgroup of BTH0  */
-    memcpy(&ltemp, p, 4);
-    sdata->gsfR2SonicSpecific.G0_depth_gate_max = ((double) ntohl(ltemp)) / 1.0e6;
-    p += 4;
-
-    /* The next four bytes contains depth gate slope from the G0 subgroup of BTH0  */
-    memcpy(&ltemp, p, 4);
-    sltemp = (gsfsLong) ntohl (ltemp);
-    sdata->gsfR2SonicSpecific.G0_depth_gate_slope = ((double) sltemp) / 1.0e6;
-    p += 4;
-
-    /* The next 32 bytes are spare space for future growth */
-    memset(&sdata->gsfR2SonicSpecific.spare[0], 0, 32);
-    p += 32;
-
-    return (p - sptr);
-}  /* end DecodeR2SonicSpecific() */
-
-/********************************************************************
- *
- * Function Name : DecodeSBEchotracSpecific
- *
- * Description :
- *  This function decodes the Bathy2000 and Echotrac sensor specific
- *  data.
- *
- * Inputs :
- *    sdata = a pointer to the union of sensor specific data to be loaded
- *    sptr = a pointer to an unsigned char buffer containing the byte stream
- *           to read.
- *    major_version - GSF major version of the file being read.
- *    minor_version - GSF minor version of the file being read.
- *
- * Returns : This function returns the number of bytes decoded.
- *
- * Error Conditions : none
- *
- * History: 12/20/2002 - RWL modified for structure change in version 2.02
- *
- ********************************************************************/
-
-static int
-DecodeSBEchotracSpecific(t_gsfSBEchotracSpecific * sdata, unsigned char *sptr)
-{
-    unsigned char  *p = sptr;
-    gsfuShort       stemp;
-    gsfsShort       signed_short;
-
-    /* First two byte integer contains the navigation error */
-    memcpy(&stemp, p, 2);
-    sdata->navigation_error = (int) ntohs(stemp);
-    p += 2;
-
-    /* Next byte contains the most probable position source navigation */
-    sdata->mpp_source = (int) *p;
-    p += 1;
-
-    /* Next byte contains the tide source */
-    sdata->tide_source = (int) *p;
-    p += 1;
-
-    /* Next two byte integer contains the dynamic_draft */
-    memcpy(&stemp, p, 2);
-    signed_short = (signed) ntohs(stemp);
-    sdata->dynamic_draft = ((double) signed_short) / 100.0;
-    p += 2;
-
-    /* decode the spare bytes */
-    memcpy(sdata->spare, p, 4);
-    p += 4;
-
-    return (p - sptr);
-}
-
-
-/********************************************************************
- *
- * Function Name : DecodeSBMGD77Specific
- *
- * Description :
- *  This function decodes the MGD77 fields.  The MGD77 is essentially
- *  survey trackline data, and actual survey data can be retrieved
- *  from the source.
- *
- * Inputs :
- *    sdata = a pointer to the union of sensor specific data to be loaded
- *    sptr = a pointer to an unsigned char buffer containing the byte stream
- *           to read.
- *
- * Returns : This function returns the number of bytes decoded.
- *
- * Error Conditions : none
- *
- ********************************************************************/
-
-static int
-DecodeSBMGD77Specific(t_gsfSBMGD77Specific * sdata, unsigned char *sptr)
-{
-    unsigned char  *p = sptr;
-    gsfuLong        ltemp;
-    gsfuShort       stemp;
-
-    /* First two byte integer contains the time zone correction */
-    memcpy(&stemp, p, 2);
-    sdata->time_zone_corr = (int) ntohs(stemp);
-    p += 2;
-
-    /* The next two byte integer contains how the navigation was obtained */
-    memcpy(&stemp, p, 2);
-    sdata->position_type_code = (int) ntohs(stemp);
-    p += 2;
-
-    /* The next two byte integer contains how the sound velocity
-       correction was made */
-    memcpy(&stemp, p, 2);
-    sdata->correction_code = (int) ntohs(stemp);
-    p += 2;
-
-    /* The next two byte integer contains how the bathymetry was obtained */
-    memcpy(&stemp, p, 2);
-    sdata->bathy_type_code = (int) ntohs(stemp);
-    p += 2;
-
-    /* The next two byte integer contains the quality code for nav */
-    memcpy(&stemp, p, 2);
-    sdata->quality_code = (int) ntohs(stemp);
-    p += 2;
-
-    /* The next four byte integer contains the two way travel time */
-    memcpy(&ltemp, p, 4);
-    sdata->travel_time = (double) (ntohl(ltemp)) / 10000.0;
-    p += 4;
-
-    /* decode the spare bytes */
-    memcpy(sdata->spare, p, 4);
-    p += 4;
-
-    return (p - sptr);
-}
-
-/********************************************************************
- *
- * Function Name : DecodeSBBDBSpecific
- *
- * Description :
- *  This function decodes the BDB fields.  The BDB is essentially
- *  survey trackline data.
- *
- * Inputs :
- *    sdata = a pointer to the union of sensor specific data to be loaded
- *    sptr = a pointer to an unsigned char buffer containing the byte stream
- *           to read.
- *
- * Returns : This function returns the number of bytes decoded.
- *
- * Error Conditions : none
- *
- ********************************************************************/
-
-static int
-DecodeSBBDBSpecific(t_gsfSBBDBSpecific * sdata, unsigned char *sptr)
-{
-    unsigned char  *p = sptr;
-    gsfuLong        ltemp;
-
-    /* The next four byte integer contains the two way travel time */
-    memcpy(&ltemp, p, 4);
-    sdata->doc_no = (int) (ntohl(ltemp));
-    p += 4;
-
-    /* Next byte contains the evaluation flag */
-    sdata->eval = (char) *p;
-    p += 1;
-
-    /* Next byte contains the classification flag */
-    sdata->classification = (char) *p;
-    p += 1;
-
-    /* Next byte contains the track adjustment flag */
-    sdata->track_adj_flag = (char) *p;
-    p += 1;
-
-    /* Next byte contains the source flag */
-    sdata->source_flag = (char) *p;
-    p += 1;
-
-    /* Next byte contains the discrete point or track line flag */
-    sdata->pt_or_track_ln = (char) *p;
-    p += 1;
-
-    /* Next byte contains the datum flag */
-    sdata->datum_flag = (char) *p;
-    p += 1;
-
-    /* decode the spare bytes */
-    memcpy(sdata->spare, p, 4);
-    p += 4;
-
-    return (p - sptr);
-}
-
-/********************************************************************
- *
- * Function Name : DecodeSBNOSHDBSpecific
- *
- * Description :
- *  This function decodes the NOSHDB fields.  The NOSHDB is essentially
- *  survey trackline data.
- *
- * Inputs :
- *    sdata = a pointer to the union of sensor specific data to be loaded
- *    sptr = a pointer to an unsigned char buffer containing the byte stream
- *           to read.
- *
- * Returns : This function returns the number of bytes decoded.
- *
- * Error Conditions : none
- *
- ********************************************************************/
-
-static int
-DecodeSBNOSHDBSpecific(t_gsfSBNOSHDBSpecific * sdata, unsigned char *sptr)
-{
-    unsigned char  *p = sptr;
-    gsfuShort       stemp;
-
-    /* First two byte integer contains the depth type code */
-    memcpy(&stemp, p, 2);
-    sdata->type_code = (int) ntohs(stemp);
-    p += 2;
-
-    /* The next two byte integer contains the cartographic code */
-    memcpy(&stemp, p, 2);
-    sdata->carto_code = (int) ntohs(stemp);
-    p += 2;
-
-    /* decode the spare bytes */
-    memcpy(sdata->spare, p, 4);
-    p += 4;
-
-    return (p - sptr);
-}
-
-/********************************************************************
- *
- * Function Name : DecodeSBNavisoundSpecific
- *
- * Description :
- *  This function decodes the Navisound fields.
- *
- * Inputs :
- *    sdata = a pointer to the union of sensor specific data to be loaded
- *    sptr = a pointer to an unsigned char buffer containing the byte stream
- *           to read.
- *
- * Returns : This function returns the number of bytes decoded.
- *
- * Error Conditions : none
- *
- ********************************************************************/
-
-static int
-DecodeSBNavisoundSpecific(t_gsfSBNavisoundSpecific * sdata, unsigned char *sptr)
-{
-    unsigned char  *p = sptr;
-    gsfuShort       stemp;
-
-    /* First two byte integer contains the pulse length */
-    memcpy(&stemp, p, 2);
-    sdata->pulse_length = ((double) ntohs(stemp)) / 100.0;
-    p += 2;
-
-    /* decode the spare bytes */
-    memcpy(sdata->spare, p, 8);
-    p += 8;
-
-    return (p - sptr);
-}
-
-/********************************************************************
- *
- * Function Name : DecodeEM3ImagerySpecific
- *
- * Description : This function decodes the Simrad EM3000 series sensor
- *    specific imagery information from the GSF byte stream.
- *
- * Inputs :
- *    sdata = a pointer to the union of sensor specific imagery data
-              to be loaded
- *    sptr = a pointer to an unsigned char buffer containing the byte stream
- *           to read.
- *
- * Returns : This function returns the number of bytes enocoded.
- *
- * Error Conditions : none
- *
- ********************************************************************/
-
-static int
-DecodeEM3ImagerySpecific(gsfSensorImagery *sdata, unsigned char *sptr)
-{
-    unsigned char   *p = sptr;
-    gsfsShort       sstemp;
-    gsfuShort       stemp;
-
-    /* Next two bytes contain the range to normal incidence to correct amplitudes */
-    memcpy(&stemp, p, 2);
-    sdata->gsfEM3ImagerySpecific.range_norm = (int) ntohs(stemp);
-    p += 2;
-
-    /* Next two bytes contain the start range sample of TVG ramp */
-    memcpy(&stemp, p, 2);
-    sdata->gsfEM3ImagerySpecific.start_tvg_ramp = (int) ntohs(stemp);
-    p += 2;
-
-    /* Next two bytes contain the stop range sample of TVG ramp */
-    memcpy(&stemp, p, 2);
-    sdata->gsfEM3ImagerySpecific.stop_tvg_ramp = (int) ntohs(stemp);
-    p += 2;
-
-    /* Next byte contains the normal incidence BS in dB */
-    sdata->gsfEM3ImagerySpecific.bsn = ((int) *p);
-    p += 1;
-
-    /* Next byte contains the oblique BS in dB */
-    sdata->gsfEM3ImagerySpecific.bso = ((int) *p);
-    p += 1;
-
-    /* The next two byte value contains the absorption coefficient */
-    memcpy(&stemp, p, 2);
-    sdata->gsfEM3ImagerySpecific.mean_absorption = ((double) ntohs(stemp)) / 100.0;
-    p += 2;
-
-    /* Next two bytes contain the imagery offset value used to positive bias the imagery values. This value has been added to all imagery samples
-     *  as the Kongsberg imagery datagram is decoded into GSF.
-     */
-    memcpy(&sstemp, p, 2);
-    sdata->gsfEM3ImagerySpecific.offset = (gsfsShort) ntohs(sstemp);
-    p += 2;
-
-    /* Next two bytes contain the imagery scale value as specified by the manufacturer.  This value is 2 for the EM3000/EM3002/EM1002/EM300/EM120.
-     *  The following formula can be used to convert from the GSF positive biased value to dB:
-     *  dB_value = (GSF_I_value - offset) / scale
-     */
-    memcpy(&sstemp, p, 2);
-    sdata->gsfEM3ImagerySpecific.scale = (gsfsShort) ntohs(sstemp);
-    p += 2;
-
-    /* decode the spare header bytes */
-    memcpy(sdata->gsfEM3ImagerySpecific.spare, p, 4);
-    p += 4;
-
-    return (p - sptr);
-}
-
-/********************************************************************
- *
- * Function Name : DecodeEM4ImagerySpecific
- *
- * Description : This function decodes the Simrad EM3000 series sensor
- *    specific imagery information from the GSF byte stream.
- *
- * Inputs :
- *    sdata = a pointer to the union of sensor specific imagery data
-              to be loaded
- *    sptr = a pointer to an unsigned char buffer containing the byte stream
- *           to read.
- *
- * Returns : This function returns the number of bytes encoded.
- *
- * Error Conditions : none
- *
- ********************************************************************/
-
-static int
-DecodeEM4ImagerySpecific(gsfSensorImagery *sdata, unsigned char *sptr)
-{
-    unsigned char   *p = sptr;
-    gsfuShort       stemp;
-    gsfsShort       sstemp;
-    gsfuLong        ltemp;
-
-    /* The next four bytes contain the integer portion of the sampling frequency in Hz */
-    memcpy(&ltemp, p, 4);
-    sdata->gsfEM4ImagerySpecific.sampling_frequency = (double) ntohl(ltemp);
-    p += 4;
-
-    /* The next four bytes contain the fractional portion of the sampling frequency in Hz */
-    memcpy(&ltemp, p, 4);
-    sdata->gsfEM4ImagerySpecific.sampling_frequency += ((double) ntohl(ltemp)) / 4.0e9;
-    p += 4;
-
-    /* Next two bytes contain the mean absorption coefficient in dB/KM. */
-    memcpy(&stemp, p, 2);
-    sdata->gsfEM4ImagerySpecific.mean_absorption = ((double) ntohs(stemp)) / 100.0;
-    p += 2;
-
-    /* Next two bytes contain the transmit pulse length in microseconds */
-    memcpy(&stemp, p, 2);
-    sdata->gsfEM4ImagerySpecific.tx_pulse_length = ((double) ntohs(stemp));
-    p += 2;
-
-    /* Next two bytes contain the range to normal incidence (in samples) used to correct amplitudes */
-    memcpy(&stemp, p, 2);
-    sdata->gsfEM4ImagerySpecific.range_norm = (gsfuShort) ntohs(stemp);
-    p += 2;
-
-    /* Next two bytes contain the start range sample of TVG ramp */
-    memcpy(&stemp, p, 2);
-    sdata->gsfEM4ImagerySpecific.start_tvg_ramp = (gsfuShort) ntohs(stemp);
-    p += 2;
-
-    /* Next two bytes contain the stop range sample of TVG ramp */
-    memcpy(&stemp, p, 2);
-    sdata->gsfEM4ImagerySpecific.stop_tvg_ramp = (gsfuShort) ntohs(stemp);
-    p += 2;
-
-    /* Next byte contains the normal incidence BS in dB */
-    memcpy(&stemp, p, 2);
-    sstemp = (gsfsShort) ntohs(stemp);
-    sdata->gsfEM4ImagerySpecific.bsn = ((double) sstemp) / 10.0;
-    p += 2;
-
-    /* Next byte contains the oblique BS in dB */
-    memcpy(&stemp, p, 2);
-    sstemp = (gsfsShort) ntohs(stemp);
-    sdata->gsfEM4ImagerySpecific.bso = ((double) sstemp) / 10.0;
-    p += 2;
-
-    /* Next two bytes contain the transmit beam width in degrees */
-    memcpy(&stemp, p, 2);
-    sdata->gsfEM4ImagerySpecific.tx_beam_width = ((double) ntohs(stemp)) / 10.0;
-    p += 2;
-
-    /* Next two bytes contain the TVG cross over angle in degrees */
-    memcpy(&stemp, p, 2);
-    sdata->gsfEM4ImagerySpecific.tvg_cross_over = ((double) ntohs(stemp)) / 10.0;
-    p += 2;
-
-    /* Next two bytes contain the imagery offset value used to positive bias the imagery values. This value has been added to all imagery samples
-     *  as the Kongsberg imagery datagram is decoded into GSF.
-     */
-    memcpy(&sstemp, p, 2);
-    sdata->gsfEM4ImagerySpecific.offset = (gsfsShort) ntohs(sstemp);
-    p += 2;
-
-    /* Next two bytes contain the imagery scale value as specified by the manufacturer.  This value is 10 for the EM710/EM302/EM122/EM2040.
-     *  The following formula can be used to convert from the GSF positive biased value to dB:
-     *  dB_value = (GSF_I_value - offset) / scale
-     */
-    memcpy(&sstemp, p, 2);
-    sdata->gsfEM4ImagerySpecific.scale = (gsfsShort) ntohs(sstemp);
-    p += 2;
-
-    /* decode the spare header bytes */
-    memcpy(sdata->gsfEM4ImagerySpecific.spare, p, 20);
-    p += 20;
-
-    return (p - sptr);
-}
-
-/********************************************************************
- *
- * Function Name : DecodeKlein5410BssImagerySpecific
- *
- * Description : This function decodes the Klein 5410 Bathy Sidescan sensor
- *    specific imagery information from the GSF byte stream.
- *
- * Inputs :
- *    sdata = a pointer to the union of sensor specific imagery data
-              to be loaded
- *    sptr = a pointer to an unsigned char buffer containing the byte stream
- *           to read.
- *
- * Returns : This function returns the number of bytes encoded.
- *
- * Error Conditions : none
- *
- ********************************************************************/
-
-static int
-DecodeKlein5410BssImagerySpecific(gsfSensorImagery *sdata, unsigned char *sptr)
-{
-    int i;
-    unsigned char   *p = sptr;
-    gsfuShort       stemp;
-
-    /* First two bytes contain the descriptor for resolution mode. */
-    memcpy(&stemp, p, 2);
-    sdata->gsfKlein5410BssImagerySpecific.res_mode = ((unsigned int) ntohs(stemp));
-    p += 2;
-
-    /* Next two bytes contain the TVG page */
-    memcpy(&stemp, p, 2);
-    sdata->gsfKlein5410BssImagerySpecific.tvg_page = ((unsigned int) ntohs(stemp));
-    p += 2;
-
-    /* Next 10 bytes contain an array of beam identifiers */
-    for (i = 0; i < 5; i++)
-    {
-        memcpy(&stemp, p, 2);
-        sdata->gsfKlein5410BssImagerySpecific.beam_id[i] = ((unsigned int) ntohs(stemp));
-        p += 2;
-    }
-
-    /* Decode the spare header bytes */
-    memcpy(sdata->gsfKlein5410BssImagerySpecific.spare, p, 4);
-    p += 4;
-
-    return (p - sptr);
-}
-
-/********************************************************************
- *
- * Function Name : DecodeReson7100ImagerySpecific
- *
- * Description : This function decodes the Reson 7100 series sensor
- *    specific imagery information from the GSF byte stream.
- *
- * Inputs :
- *    sdata = a pointer to the union of sensor specific imagery data
-              to be loaded
- *    sptr = a pointer to an unsigned char buffer containing the byte stream
- *           to read.
- *
- * Returns : This function returns the number of bytes enocoded.
- *
- * Error Conditions : none
- *
- ********************************************************************/
-
-static int
-DecodeReson7100ImagerySpecific(gsfSensorImagery *sdata, unsigned char *sptr)
-{
-    unsigned char   *p = sptr;
-    gsfuShort       stemp;
-
-    /* Next two bytes contain the size of the sensor specific record */
-    memcpy(&stemp, p, 2);
-    sdata->gsfReson7100ImagerySpecific.size = ((double) ntohs(stemp));
-    p += 2;
-
-    /* decode the spare header bytes */
-    memcpy(sdata->gsfReson7100ImagerySpecific.spare, p, 64);
-    p += 64;
-
-    return (p - sptr);
-}
-
-
-/********************************************************************
- *
- * Function Name : DecodeReson8100Specific
- *
- * Description : This function decodes the Reson 8100 series sensor
- *    specific imagery information from the GSF byte stream.
- *
- * Inputs :
- *    sdata = a pointer to the union of sensor specific imagery data
-              to be loaded
- *    sptr = a pointer to an unsigned char buffer containing the byte stream
- *           to read.
- *
- * Returns : This function returns the number of bytes enocoded.
- *
- * Error Conditions : none
- *
- ********************************************************************/
-
-static int
-DecodeReson8100ImagerySpecific(gsfSensorImagery *sdata, unsigned char *sptr)
-{
-    unsigned char   *p = sptr;
-
-    /* decode the spare header bytes */
-    memcpy(sdata->gsfReson8100ImagerySpecific.spare, p, 8);
-    p += 8;
-
-    return (p - sptr);
-}
-
-/********************************************************************
- *
- * Function Name : DecodeR2SonicImagerySpecific
- *
- * Description : This function decodes the R2Sonic sensor specific
- *    imagery information from the GSF byte stream.
- *
- * Inputs :
- *    sdata = a pointer to the union of sensor specific imagery data to be loaded
- *    sptr = a pointer to an unsigned char buffer containing the byte stream
- *           to read.
- *
- * Returns : This function returns the number of bytes encoded.
- *
- * Error Conditions : none
- *
- ********************************************************************/
-static int
-DecodeR2SonicImagerySpecific(gsfSensorImagery * sdata, unsigned char *sptr)
-{
-    int i;
-    unsigned char  *p = sptr;
-    gsfuShort       stemp;
-    gsfuLong        ltemp;
-    gsfsLong        sltemp;
-
-
-    /* The next 12 bytes contains the model number */
-    memset (sdata->gsfR2SonicImagerySpecific.model_number, 0, 12);
-    memcpy (sdata->gsfR2SonicImagerySpecific.model_number, p, 12);
-    p += 12;
-
-    /* The next 12 bytes contains the serial number */
-    memset (sdata->gsfR2SonicImagerySpecific.serial_number, 0, 12);
-    memcpy (sdata->gsfR2SonicImagerySpecific.serial_number, p, 12);
-    p += 12;
-
-    /* Next four byte integer contains the time in seconds */
-    memcpy(&ltemp, p, 4);
-    sdata->gsfR2SonicImagerySpecific.dg_time.tv_sec = ntohl(ltemp);
-    p += 4;
-
-    /* Next four byte integer contains the fractional time in nanoseconds */
-    memcpy(&ltemp, p, 4);
-    sdata->gsfR2SonicImagerySpecific.dg_time.tv_nsec = ntohl(ltemp);
-    p += 4;
-
-    /* Next four byte integer contains the ping number */
-    memcpy(&ltemp, p, 4);
-    sdata->gsfR2SonicImagerySpecific.ping_number = ntohl(ltemp);
-    p += 4;
-
-    /* The next four bytes contains the ping period * 1,000,000 */
-    memcpy(&ltemp, p, 4);
-    sdata->gsfR2SonicImagerySpecific.ping_period = ((double) ntohl(ltemp)) / 1.0e6;
-    p += 4;
-
-    /* The next four bytes contains the sound speed * 100 */
-    memcpy(&ltemp, p, 4);
-    sdata->gsfR2SonicImagerySpecific.sound_speed = ((double) ntohl(ltemp)) / 1.0e2;
-    p += 4;
-
-    /* The next four bytes contains the frequency * 1000 */
-    memcpy(&ltemp, p, 4);
-    sdata->gsfR2SonicImagerySpecific.frequency = ((double) ntohl(ltemp)) / 1.0e3;
-    p += 4;
-
-    /* The next four bytes contains the transmit source level * 100 */
-    memcpy(&ltemp, p, 4);
-    sdata->gsfR2SonicImagerySpecific.tx_power = ((double) ntohl(ltemp)) / 1.0e2;
-    p += 4;
-
-    /* The next four bytes contains the transmit pulse width * 10,000,000.0*/
-    memcpy(&ltemp, p, 4);
-    sdata->gsfR2SonicImagerySpecific.tx_pulse_width = ((double) ntohl(ltemp)) / 1.0e7;
-    p += 4;
-
-    /* The next four bytes contains the transmit beamwidth in the vertical * 1,000,000 */
-    memcpy(&ltemp, p, 4);
-    sdata->gsfR2SonicImagerySpecific.tx_beamwidth_vert = ((double) ntohl(ltemp)) / 1.0e6;
-    p += 4;
-
-    /* The next four bytes contains the transmit beamwidth in the horizontal * 1,000,000*/
-    memcpy(&ltemp, p, 4);
-    sdata->gsfR2SonicImagerySpecific.tx_beamwidth_horiz = ((double) ntohl(ltemp)) / 1.0e6;
-    p += 4;
-
-    /* The next four bytes contains the transmit steering in the vertical  * 1,000,000*/
-    memcpy(&ltemp, p, 4);
-    sltemp = (gsfsLong) ntohl (ltemp);
-    sdata->gsfR2SonicImagerySpecific.tx_steering_vert = ((double) sltemp) / 1.0e6;
-    p += 4;
-
-    /* The next four bytes contains the transmit steering in the horizontal  * 1,000,000*/
-    memcpy(&ltemp, p, 4);
-    sltemp = (gsfsLong) ntohl (ltemp);
-    sdata->gsfR2SonicImagerySpecific.tx_steering_horiz = ((double) sltemp) / 1.0e6;
-    p += 4;
-
-    /* The next four bytes contains misc. transmit info */
-    memcpy(&ltemp, p, 4);
-    sdata->gsfR2SonicImagerySpecific.tx_misc_info = ntohl(ltemp);
-    p += 4;
-
-    /* The next four bytes contains the receiver bandwidth * 10,000 */
-    memcpy(&ltemp, p, 4);
-    sdata->gsfR2SonicImagerySpecific.rx_bandwidth = ((double) ntohl(ltemp)) / 1.0e4;
-    p += 4;
-
-    /* The next four bytes contains the receiver sample rate * 1000 */
-    memcpy(&ltemp, p, 4);
-    sdata->gsfR2SonicImagerySpecific.rx_sample_rate = ((double) ntohl(ltemp)) / 1.0e3;
-    p += 4;
-
-    /* The next four bytes contains the receiver range * 100,000 */
-    memcpy(&ltemp, p, 4);
-    sdata->gsfR2SonicImagerySpecific.rx_range = ((double) ntohl(ltemp)) / 1.0e5;
-    p += 4;
-
-    /* The next four bytes contains the receiver gain * 100 */
-    memcpy(&ltemp, p, 4);
-    sdata->gsfR2SonicImagerySpecific.rx_gain = ((double) ntohl(ltemp)) / 1.0e2;
-    p += 4;
-
-    /* The next four bytes contains the receiver spreading law coefficient * 1000 */
-    memcpy(&ltemp, p, 4);
-    sdata->gsfR2SonicImagerySpecific.rx_spreading = ((double) ntohl(ltemp)) / 1.0e3;
-    p += 4;
-
-    /* The next four bytes contains the receiver absorption coefficient * 1000 */
-    memcpy(&ltemp, p, 4);
-    sdata->gsfR2SonicImagerySpecific.rx_absorption = ((double) ntohl(ltemp)) / 1.0e3;
-    p += 4;
-
-    /* The next four bytes contains the receiver mount tilt angle * 1,000,000 */
-    memcpy(&ltemp, p, 4);
-    sltemp = (gsfsLong) ntohl (ltemp);
-    sdata->gsfR2SonicImagerySpecific.rx_mount_tilt = ((double) sltemp) / 1.0e6;
-    p += 4;
-
-    /* The next four bytes contains misc. receiver info */
-    memcpy(&ltemp, p, 4);
-    sdata->gsfR2SonicImagerySpecific.rx_misc_info = ntohl(ltemp);
-    p += 4;
-
-    /* The next two bytes are reserved */
-    memcpy(&stemp, p, 2);
-    sdata->gsfR2SonicImagerySpecific.reserved = ntohs(stemp);
-    p += 2;
-
-    /* The next two bytes are for the number of beams */
-    memcpy(&stemp, p, 2);
-    sdata->gsfR2SonicImagerySpecific.num_beams = ntohs(stemp);
-    p += 2;
-
-    /* The next set of 6x4 (24) bytes contains "more_info" from the SNI0 datagram */
-    for (i=0; i<6; i++)
-    {
-        memcpy(&ltemp, p, 4);
-        sltemp = (gsfsLong) ntohl (ltemp);
-        sdata->gsfR2SonicImagerySpecific.more_info[i] = ((double) sltemp) / 1.0e6;
-        p += 4;
-    }
-
-    /* The next 32 bytes are spare space for future growth */
-    memset(&sdata->gsfR2SonicImagerySpecific.spare[0], 0, 32);
-    p += 32;
-
-    return (p - sptr);
-}  /* end DecodeR2SonicImagerySpecific() */
-
-/********************************************************************
- *
- * Function Name : DecodeBRBIntensity
- *
- * Description : This function decodes the Bathymetric Receive Beam
- *    time series intensity information from the GSF byte stream.
- *
- * Inputs :
- *    idata = a pointer to the gsfBRBIntensity structure to be loaded with
- *            imagery data
- *    sptr = a pointer to an unsigned char buffer containing the byte stream
- *           to read.
- *    num_beams = an integer containing the number of beams which is used to
- *                dimension the array of gsfTimeSeries intensity structures
- *    sensor_id = the integer id for the sensor specific subrecord, which
- *                to decode the sensor specific imagery information
- *    handle = the integer handle for the data file being read, which is used
- *             to store the current number of beams
- *
- * Returns : This function returns the number of bytes enocoded.
- *
- * Error Conditions : none
- *
- ********************************************************************/
-
-static int
-DecodeBRBIntensity(gsfBRBIntensity ** idata, unsigned char *sptr, int num_beams, int sensor_id, int handle)
-{
-    unsigned char  *ptr = sptr;
-    gsfuShort       stemp;
-    gsfuLong        ltemp;
-    int             i, j;
-    int             id = GSF_SWATH_BATHY_SUBRECORD_INTENSITY_SERIES_ARRAY;
-    int             sensor_size;
-    int             bytes_per_sample;
-    unsigned char   bytes_to_unpack[4];
-
-    /* Allocate memory for the structure if none has been allocated yet */
-    if (*idata == (gsfBRBIntensity *) NULL)
-    {
-        *idata = (gsfBRBIntensity *) calloc(1, sizeof(gsfBRBIntensity));
-
-        if (*idata == (gsfBRBIntensity *) NULL)
-        {
-            gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-            return (-1);
-        }
-    }
-
-    /* Allocate memory for the array if none has been allocated yet */
-    if ((*idata)->time_series == (gsfTimeSeriesIntensity *) NULL)
-    {
-        if (num_beams <= 0)
-        {
-            gsfError = GSF_INVALID_NUM_BEAMS;
-            return(-1);
-        }
-
-        (*idata)->time_series = (gsfTimeSeriesIntensity *) calloc(num_beams, sizeof(gsfTimeSeriesIntensity));
-
-        if ((*idata)->time_series == (gsfTimeSeriesIntensity *) NULL)
-        {
-            gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-            return (-1);
-        }
-        arraySize[handle - 1][id - 1] = num_beams;
-
-        /* allocate memory for array of sample counts */
-        samplesArraySize[handle - 1] = calloc (num_beams, sizeof (short));
-    }
-
-    /* Make sure there memory allocated for the array is sufficient, some
-    *  system have a different number of beams depending on depth
-    */
-    if (num_beams > arraySize[handle - 1][id - 1])
-    {
-        (*idata)->time_series = (gsfTimeSeriesIntensity *) realloc((void *) (*idata)->time_series, num_beams * sizeof(gsfTimeSeriesIntensity));
-
-        if ((*idata)->time_series == (gsfTimeSeriesIntensity *) NULL)
-        {
-            gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-            return (-1);
-        }
-        memset((*idata)->time_series, 0, num_beams * sizeof(gsfTimeSeriesIntensity));
-
-        arraySize[handle - 1][id - 1] = num_beams;
-
-        /* re-allocate memory for array of sample counts */
-        samplesArraySize[handle - 1] = realloc ((void *) samplesArraySize[handle - 1], num_beams * sizeof (short));
-        memset (samplesArraySize[handle - 1], 0, num_beams * sizeof (short));
-    }
-
-    /* decode the bits per sample */
-    (*idata)->bits_per_sample = *ptr;
-    ptr += 1;
-
-    /* decode the sample applied corrections description */
-    memcpy(&ltemp, ptr, 4);
-    (*idata)->applied_corrections = (unsigned int) ntohl(ltemp);
-    ptr += 4;
-
-    /* decode the spare header bytes */
-    memcpy((*idata)->spare, ptr, 16);
-    ptr += 16;
-
-    /* read the sensor specific imagery info */
-    switch (sensor_id)
-    {
-        case (GSF_SWATH_BATHY_SUBRECORD_EM2000_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_EM3000_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_EM1002_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_EM300_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_EM120_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_EM3002_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_EM3000D_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_EM3002D_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_EM121A_SIS_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_EM2000_RAW_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_EM3000_RAW_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_EM1002_RAW_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_EM300_RAW_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_EM120_RAW_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_EM3002_RAW_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_EM3000D_RAW_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_EM3002D_RAW_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_EM121A_SIS_RAW_SPECIFIC):
-            sensor_size = DecodeEM3ImagerySpecific(&(*idata)->sensor_imagery, ptr);
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_RESON_7125_SPECIFIC):
-            sensor_size = DecodeReson7100ImagerySpecific(&(*idata)->sensor_imagery, ptr);
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_RESON_8101_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_RESON_8111_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_RESON_8124_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_RESON_8125_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_RESON_8150_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_RESON_8160_SPECIFIC):
-            sensor_size = DecodeReson8100ImagerySpecific(&(*idata)->sensor_imagery, ptr);
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_EM122_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_EM302_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_EM710_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_EM2040_SPECIFIC):
-            sensor_size = DecodeEM4ImagerySpecific(&(*idata)->sensor_imagery, ptr);
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_KLEIN_5410_BSS_SPECIFIC):
-            sensor_size = DecodeKlein5410BssImagerySpecific(&(*idata)->sensor_imagery, ptr);
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_R2SONIC_2020_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_R2SONIC_2022_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_R2SONIC_2024_SPECIFIC):
-            sensor_size = DecodeR2SonicImagerySpecific(&(*idata)->sensor_imagery, ptr);
-            break;
-
-        default:
-            sensor_size = 0;
-            break;
-    }
-    ptr += sensor_size;
-
-    bytes_per_sample = (*idata)->bits_per_sample / 8;
-    /* loop for the number of beams, allocating memory for the array of samples, and
-    * loading each sample value from the byte stream into internal form
-    */
-    for (i = 0; i < num_beams; i++)
-    {
-
-        /* First two byte integer contains the number of samples for this beam */
-        memcpy(&stemp, ptr, 2);
-        (*idata)->time_series[i].sample_count = (unsigned short) ntohs(stemp);
-        ptr += 2;
-
-        /* Next two byte integer contains the index to the bottom detect sample for this beam */
-        memcpy(&stemp, ptr, 2);
-        (*idata)->time_series[i].detect_sample = (unsigned short) ntohs(stemp);
-        ptr += 2;
-
-        memcpy((*idata)->time_series[i].spare, ptr, 8);
-        ptr += 8;
-
-        /* Allocate memory for the array of samples if none has been allocated yet. */
-        if ((*idata)->time_series[i].samples == (unsigned int *) NULL)
-        {
-            (*idata)->time_series[i].samples = (unsigned int *) calloc((*idata)->time_series[i].sample_count, sizeof(unsigned int));
-
-            if ((*idata)->time_series[i].samples == (unsigned int *) NULL)
-            {
-                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                return (-1);
-            }
-
-            samplesArraySize[handle - 1][i] = (*idata)->time_series[i].sample_count;
-        }
-
-        if ((*idata)->time_series[i].sample_count > samplesArraySize[handle - 1][i])
-        {
-            (*idata)->time_series[i].samples = (unsigned int *) realloc((void *) (*idata)->time_series[i].samples, (*idata)->time_series[i].sample_count * sizeof(unsigned int));
-
-            if ((*idata)->time_series[i].samples == (unsigned int *) NULL)
-            {
-                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                return (-1);
-            }
-
-            memset ((*idata)->time_series[i].samples, 0, (*idata)->time_series[i].sample_count * sizeof(unsigned int));
-
-            samplesArraySize[handle - 1][i] = (*idata)->time_series[i].sample_count;
-        }
-
-        if ((*idata)->bits_per_sample == 12)
-        {
-            for (j = 0; j < (*idata)->time_series[i].sample_count; j+=2)
-            {
-                /* unpack 3 bytes into 2 samples */
-
-                /* unpack the first sample */
-                memset (bytes_to_unpack, 0, 4);
-
-                /* Put the upper bits of ptr[0] into the lower bits of bytes_to_unpack[2] */
-                bytes_to_unpack[2] = ptr[0] >> 4;
-
-                /* Grab the lower bits of ptr[0] and save them in the upper bits of */
-                /* bytes_to_unpack[3] */
-                bytes_to_unpack[3] = (ptr[0] & 0x0f) << 4;
-
-                /* Grab the upper bits of ptr[1] and save them in the lower bits of */
-                /* bytes_to_unpack[3] */
-                bytes_to_unpack[3] |= (ptr[1] & 0xf0) >> 4;
-                memcpy (&ltemp, bytes_to_unpack, 4);
-                (*idata)->time_series[i].samples[j] = (unsigned int) ntohl(ltemp);
-
-                if (j+1 < (*idata)->time_series[i].sample_count)
-                {
-                    /* unpack the second sample */
-                    memset (bytes_to_unpack, 0, 4);
-                    /* Save the lower bits of ptr[1] in bytes_to_unpack[2] and */
-                    /* save ptr[2] in bytes_to_unpack[3] */
-                    bytes_to_unpack[2] = ptr[1] & 0x0f;
-                    bytes_to_unpack[3] = ptr[2];
-                    memcpy (&ltemp, bytes_to_unpack, 4);
-                    (*idata)->time_series[i].samples[j+1] = (unsigned int) ntohl(ltemp);
-                }
-                ptr += 3;
-            }
-        }
-        else
-        {
-            for (j = 0; j < (*idata)->time_series[i].sample_count; j++)
-            {
-                if (bytes_per_sample == 1)
-                {
-                    (*idata)->time_series[i].samples[j] = (unsigned int) *ptr;
-                    ptr++;
-                }
-                else if (bytes_per_sample == 2)
-                {
-                    memcpy(&stemp, ptr, 2);
-                    (*idata)->time_series[i].samples[j] = (unsigned int) ntohs(stemp);
-                    ptr += 2;
-                }
-                else if (bytes_per_sample == 4)
-                {
-                    memcpy(&ltemp, ptr, 4);
-                    (*idata)->time_series[i].samples[j] = (unsigned int) ntohl(ltemp);
-                    ptr += 4;
-                }
-                else
-                {
-                    memcpy(&(*idata)->time_series[i].samples[j], ptr, bytes_per_sample);
-                    ptr+=bytes_per_sample;
-                }
-            }
-        }
-    }
-    return (ptr - sptr);
-}
-
-/********************************************************************
- *
- * Function Name : gsfDecodeSoundVelocityProfile
- *
- * Description : This function decodes a gsf sound velocity profile record
- *  from external byte stream form into internal form.  Memory for the
- *  depth/sound speed arrays is allocated (or reallocted) each time this
- *  record is encountered since the number of points in the profile can
- *  change.
- *
- * Inputs :
- *    svp = a pointer to the gsfSVP structure to load
- *    ft = a pointer to the GSF_FILE_TABLE entry for the data file being decoded
- *    sptr = a pointer to the unsigned char buffer to read from
- *
- * Returns :
- *  This function returns the number of bytes decoded if successful, or
- *  -1 if an error occured.
- *
- * Error Conditions :
- *    GSF_MEMORY_ALLOCATION_FAILED
- *
- ********************************************************************/
-int
-gsfDecodeSoundVelocityProfile(gsfSVP *svp, GSF_FILE_TABLE *ft, unsigned char *sptr)
-{
-    unsigned char  *p = sptr;
-    gsfuLong        ltemp;
-    gsfsLong        signed_int;
-    int             i;
-
-    /* First four byte integer contains the observation time seconds */
-    memcpy(&ltemp, p, 4);
-    p += 4;
-    svp->observation_time.tv_sec = ntohl(ltemp);
-
-    /* Next four byte integer contains the observation time nanoseconds */
-    memcpy(&ltemp, p, 4);
-    p += 4;
-    svp->observation_time.tv_nsec = ntohl(ltemp);
-
-    /* Next four byte integer contains the seconds portion of the time the
-    *  new profile was put into use by the sonar system
-    */
-    memcpy(&ltemp, p, 4);
-    p += 4;
-    svp->application_time.tv_sec = ntohl(ltemp);
-
-    /* Next four byte integer contains the application time nanoseconds */
-    memcpy(&ltemp, p, 4);
-    p += 4;
-    svp->application_time.tv_nsec = ntohl(ltemp);
-
-    /* Next four byte integer contains the longitude of profile observation */
-    memcpy(&ltemp, p, 4);
-    signed_int = (signed) ntohl(ltemp);
-    svp->longitude = ((double) signed_int) / 1.0e7;
-    p += 4;
-
-    /* Next four byte integer contains the latitude of profile observation */
-    memcpy(&ltemp, p, 4);
-    signed_int = (signed) ntohl(ltemp);
-    svp->latitude = ((double) signed_int) / 1.0e7;
-    p += 4;
-
-    /* Next four byte integer contains the number of points in the profile */
-    memcpy(&ltemp, p, 4);
-    p += 4;
-    svp->number_points = ntohl(ltemp);
-
-    /* NULL out caller's memory pointers in case memory allocation fails */
-    svp->depth = (double *) NULL;
-    svp->sound_speed = (double *) NULL;
-
-    /* make sure we have memory for the depth/speed pairs */
-    if (ft->rec.svp.depth == (double *) NULL)
-    {
-        ft->rec.svp.depth = (double *) calloc(svp->number_points, sizeof(double));
-
-        if (ft->rec.svp.depth == (double *) NULL)
-        {
-            gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-            return (-1);
-        }
-    }
-
-    /* Re-allocate the dynamic memory if the number of points in the profile
-     * is greater this time than it was last time.
-     */
-    else if (ft->rec.svp.number_points < svp->number_points)
-    {
-        ft->rec.svp.depth = (double *) realloc(ft->rec.svp.depth, svp->number_points * sizeof(double));
-
-        if (ft->rec.svp.depth == (double *) NULL)
-        {
-            gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-            return (-1);
-        }
-        memset(ft->rec.svp.depth, 0, svp->number_points * sizeof(double));
-    }
-    /* Set the caller's pointer to this dynamic memory */
-    svp->depth = ft->rec.svp.depth;
-
-    if (ft->rec.svp.sound_speed == (double *) NULL)
-    {
-        ft->rec.svp.sound_speed = (double *) calloc(svp->number_points, sizeof(double));
-
-        if (ft->rec.svp.sound_speed == (double *) NULL)
-        {
-            gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-            return (-1);
-        }
-    }
-
-    /* Re-allocate the dynamic memory if the number of points in the profile
-     * is greater this time than it was last time.
-     */
-    else if (ft->rec.svp.number_points < svp->number_points)
-    {
-        ft->rec.svp.sound_speed = (double *) realloc(ft->rec.svp.sound_speed, svp->number_points * sizeof(double));
-
-        if (ft->rec.svp.sound_speed == (double *) NULL)
-        {
-            gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-            return (-1);
-        }
-        memset(ft->rec.svp.sound_speed, 0, svp->number_points * sizeof(double));
-    }
-    /* Set the caller's pointer to this dynamic memory */
-    svp->sound_speed = ft->rec.svp.sound_speed;
-
-    /* Save the number of points in this profile in the library's file table */
-    ft->rec.svp.number_points = svp->number_points;
-
-    /* Now loop to decode the depth/sound speed pairs */
-    for (i = 0; i < svp->number_points; i++)
-    {
-        memcpy(&ltemp, p, 4);
-        p += 4;
-        svp->depth[i] = ((double) ntohl(ltemp)) / 100.0;
-
-        memcpy(&ltemp, p, 4);
-        p += 4;
-        svp->sound_speed[i] = ((double) ntohl(ltemp)) / 100.0;
-    }
-
-    return (p - sptr);
-}
-
-/********************************************************************
- *
- * Function Name : gsfDecodeProcessingParameters
- *
- * Description : This function decodes a processing parameters record
- *  from external gsf byte stream form into internal form.
- *
- * Inputs :
- *   param = a pointer to the gsfProcessingParamters structure to populate
- *   ft = a pointer to the GSF_FILE_TABLE entry for the data file being decoded
- *   sptr = a pointer to the unsigned char buffer to read from
- *
- * Returns : This function returns the number of bytes decoded if succesful,
- *  or -1 on error.
- *
- * Error Conditions :
- *    GSF_MEMORY_ALLOCATION_FAILED
- *
- ********************************************************************/
-int
-gsfDecodeProcessingParameters(gsfProcessingParameters *param, GSF_FILE_TABLE *ft, unsigned char *sptr)
-{
-    unsigned char  *p = sptr;
-    gsfuLong        ltemp;
-    gsfuShort       stemp;
-    int             i;
-
-    /* First four byte integer contains the seconds portion of the time
-    *  application of the new parameters.
-    */
-    memcpy(&ltemp, p, 4);
-    p += 4;
-    param->param_time.tv_sec = ntohl(ltemp);
-
-    /* Next four byte integer contains the application time nanoseconds */
-    memcpy(&ltemp, p, 4);
-    p += 4;
-    param->param_time.tv_nsec = ntohl(ltemp);
-
-    /* Next two byte integer contains the number of parameters in this record */
-    memcpy(&stemp, p, 2);
-    p += 2;
-    param->number_parameters = (int) ntohs(stemp);
-
-    if (ft->rec.process_parameters.number_parameters < param->number_parameters)
-    {
-        ft->rec.process_parameters.number_parameters = param->number_parameters;
-    }
-
-    /* Now loop to decode these parameters */
-    for (i = 0; (i < param->number_parameters) && (i < GSF_MAX_PROCESSING_PARAMETERS); i++)
-    {
-        /* two byte integer contains the size of the parameter */
-        memcpy(&stemp, p, 2);
-        p += 2;
-        param->param_size[i] = (short) ntohs(stemp);
-
-        /* NULL caller's pointer in case memory allocation fails */
-        param->param[i] = (char *) NULL;
-
-        /* Make sure we have memory to hold the parameter */
-        if (ft->rec.process_parameters.param[i] == (char *) NULL)
-        {
-            ft->rec.process_parameters.param[i] = (char *) calloc(param->param_size[i] + 1, sizeof(char));
-
-            if (ft->rec.process_parameters.param[i] == (char *) NULL)
-            {
-                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                return (-1);
-            }
-        }
-        else if (ft->rec.process_parameters.param_size[i] < param->param_size[i])
-        {
-            ft->rec.process_parameters.param[i] = (char *) realloc((void *) ft->rec.process_parameters.param[i], param->param_size[i] + 1);
-            if (ft->rec.process_parameters.param[i] == (char *) NULL)
-            {
-                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                return (-1);
-            }
-        }
-        memcpy(ft->rec.process_parameters.param[i], p, param->param_size[i]);
-        param->param[i] = ft->rec.process_parameters.param[i];
-        ft->rec.process_parameters.param_size[i] = param->param_size[i];
-
-        /* make sure the text is null terminated */
-        param->param[i][param->param_size[i]] = '\0';
-        p += param->param_size[i];
-    }
-    return (p - sptr);
-}
-
-/********************************************************************
- *
- * Function Name : gsfDecodeSensorParameters
- *
- * Description : This function decodes a gsf sensor parameters record
- *  from external byte stream form into internal form.
- *
- * Inputs :
- *    param = a pointer to a gsfSensorParameters structure to be populated
- *    ft = a pointer to the GSF_FILE_TABLE entry for the data file being decoded
- *    sptr = a pointer to an unsigned char buffer to read from.
- *
- * Returns : This function returns the number of bytes decoded if successful,
- *  or -1 on error.
- *
- * Error Conditions :
- *    GSF_MEMORY_ALLOCATION_FAILED
- *
- ********************************************************************/
-int
-gsfDecodeSensorParameters(gsfSensorParameters *param, GSF_FILE_TABLE *ft, unsigned char *sptr)
-{
-    unsigned char  *p = sptr;
-    gsfuLong        ltemp;
-    gsfuShort       stemp;
-    int             i;
-
-    /* First four byte integer contains the seconds portion of the time
-    *  application of the new parameters.
-    */
-    memcpy(&ltemp, p, 4);
-    p += 4;
-    param->param_time.tv_sec = ntohl(ltemp);
-
-    /* Next four byte integer contains the application time nanoseconds */
-    memcpy(&ltemp, p, 4);
-    p += 4;
-    param->param_time.tv_nsec = ntohl(ltemp);
-
-    /* Next two byte integer contains the number of parameters in this record */
-    memcpy(&stemp, p, 2);
-    p += 2;
-    param->number_parameters = (int) ntohs(stemp);
-
-    if (ft->rec.sensor_parameters.number_parameters < param->number_parameters)
-    {
-        ft->rec.sensor_parameters.number_parameters = param->number_parameters;
-    }
-
-    /* Now loop to decode these parameters */
-    for (i = 0; (i < param->number_parameters) && (i < GSF_MAX_SENSOR_PARAMETERS); i++)
-    {
-        /* two byte integer contains the size of the parameter */
-        memcpy(&stemp, p, 2);
-        p += 2;
-        param->param_size[i] = (short) ntohs(stemp);
-
-        /* NULL caller's pointer in case memory allocation fails */
-        param->param[i] = (char *) NULL;
-
-        /* Make sure we have memory to hold the parameter */
-        if (ft->rec.sensor_parameters.param[i] == (char *) NULL)
-        {
-            ft->rec.sensor_parameters.param[i] = (char *) calloc(param->param_size[i] + 1, sizeof(char));
-            if (ft->rec.sensor_parameters.param[i] == (char *) NULL)
-            {
-                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                return (-1);
-            }
-        }
-        else if (ft->rec.sensor_parameters.param_size[i] < param->param_size[i])
-        {
-            ft->rec.sensor_parameters.param[i] = (char *) realloc((void *) ft->rec.sensor_parameters.param[i], param->param_size[i] + 1);
-            if (ft->rec.sensor_parameters.param[i] == (char *) NULL)
-            {
-                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                return (-1);
-            }
-        }
-        memcpy(ft->rec.sensor_parameters.param[i], p, param->param_size[i]);
-        param->param[i] = ft->rec.sensor_parameters.param[i];
-        ft->rec.sensor_parameters.param_size[i] = param->param_size[i];
-
-        /* Make sure the text is null terminated */
-        param->param[i][param->param_size[i]] = '\0';
-        p += param->param_size[i];
-    }
-    return (p - sptr);
-}
-
-/********************************************************************
- *
- * Function Name : gsfDecodeComment
- *
- * Description :  This function is used to decode a gsf comment record
- *  from external byte stream from to internal form.
- *
- * Inputs :
- *    comment = a pointer to the gsfComment structure to be loaded
- *    ft = a pointer to the GSF_FILE_TABLE entry for the data file being decoded
- *    sptr = a pointer to the unsigned char buffer to read from
- *
- * Returns :
- *  This function returns the number of bytes decoded if successful, or
- *  -1 if an error occured.
- *
- * Error Conditions :
- *    GSF_MEMORY_ALLOCATION_FAILED
- *
- ********************************************************************/
-int
-gsfDecodeComment(gsfComment *comment, GSF_FILE_TABLE *ft, unsigned char *sptr)
-{
-    unsigned char  *p = sptr;
-    gsfuLong        ltemp;
-
-    /* First four byte integer contains the seconds portion of the time
-    *  the operator comment was made.
-    */
-    memcpy(&ltemp, p, 4);
-    p += 4;
-    comment->comment_time.tv_sec = ntohl(ltemp);
-
-    /* Next four byte integer contains the nanoseconds portion of the
-    * comment time
-    */
-    memcpy(&ltemp, p, 4);
-    p += 4;
-    comment->comment_time.tv_nsec = ntohl(ltemp);
-
-    /* Next four byte integer contains the length of the comment */
-    memcpy(&ltemp, p, 4);
-    p += 4;
-    comment->comment_length = ntohl(ltemp);
-
-    /* NULL out caller's pointer to dynamic memory in case allocation fails */
-    comment->comment = (char *) NULL;
-
-    /* Make sure we have memory to hold the parameter */
-    if (ft->rec.comment.comment == (char *) NULL)
-    {
-        ft->rec.comment.comment = (char *) calloc(comment->comment_length + 1, sizeof(char));
-        if (ft->rec.comment.comment == (char *) NULL)
-        {
-            gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-            return (-1);
-        }
-    }
-    else if (ft->rec.comment.comment_length < comment->comment_length)
-    {
-        ft->rec.comment.comment = (char *) realloc((void *) ft->rec.comment.comment, comment->comment_length + 1);
-        if (ft->rec.comment.comment == (char *) NULL)
-        {
-            gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-            return (-1);
-        }
-    }
-
-    memcpy(ft->rec.comment.comment, p, comment->comment_length);
-    comment->comment = ft->rec.comment.comment;
-    ft->rec.comment.comment_length = comment->comment_length;
-    comment->comment[comment->comment_length] = '\0';
-    p += comment->comment_length;
-
-    return (p - sptr);
-}
-
-/********************************************************************
- *
- * Function Name : gsfDecodeHistory
- *
- * Description : This function is used to decode a gsf history record
- *  from external byte stream form to internal form.
- *
- * Inputs :
- *    history = a pointer to the gsf history structure to load
- *    ft = a pointer to the GSF_FILE_TABLE entry for the data file being decoded
- *    sptr = a pointer to an unsigned char buffer to read from
- *
- * Returns :
- *  This function returns the number of bytes decoded if successful, or
- *  -1 if an error occured.
- *
- * Error Conditions :
- *    GSF_MEMORY_ALLOCATION_FAILED
- *
- ********************************************************************/
-
-int
-gsfDecodeHistory(gsfHistory * history, GSF_FILE_TABLE *ft, unsigned char *sptr)
-{
-    unsigned char  *p = sptr;
-    int             len;
-    gsfuLong        ltemp;
-    gsfuShort       stemp;
-
-    /* First four byte integer contains the seconds portion of the time
-    *  the history record was added to the data.
-    */
-    memcpy(&ltemp, p, 4);
-    p += 4;
-    history->history_time.tv_sec = ntohl(ltemp);
-
-    /* Next four byte integer contains the nanoseconds portion of the
-    * history time.
-    */
-    memcpy(&ltemp, p, 4);
-    p += 4;
-    history->history_time.tv_nsec = ntohl(ltemp);
-
-    /* two byte integer contains the size of the text to follow */
-    memcpy(&stemp, p, 2);
-    p += 2;
-    len = (short) ntohs(stemp);
-
-    /* Next len bytes contains the host name */
-    if (len < GSF_HOST_NAME_LENGTH)
-    {
-        memcpy(history->host_name, p, len);
-        history->host_name[len] = '\0';
-        p += len;
-    }
-    else
-    {
-        gsfError = GSF_HISTORY_RECORD_DECODE_FAILED;
-        return(-1);
-    }
-
-    /* two byte integer contains the size of the text to follow */
-    memcpy(&stemp, p, 2);
-    p += 2;
-    len = (short) ntohs(stemp);
-
-    /* Next len bytes contains the host name */
-    if (len < GSF_OPERATOR_LENGTH)
-    {
-        memcpy(history->operator_name, p, len);
-        history->operator_name[len] = '\0';
-        p += len;
-    }
-    else
-    {
-        gsfError = GSF_HISTORY_RECORD_DECODE_FAILED;
-        return(-1);
-    }
-
-    /* Next two byte integer contains the size of the command line used
-    *  to invoke the program which processed this data.
-    */
-    memcpy(&stemp, p, 2);
-    p += 2;
-    len = ntohs(stemp);
-
-    /* NULL out the caller's pointer in case memory allocation fails */
-    history->command_line = (char *) NULL;
-
-    /* Re-allocate the memory for the command line each time down */
-    if (ft->rec.history.command_line != (char *) NULL)
-    {
-        free (ft->rec.history.command_line);
-    }
-    ft->rec.history.command_line = (char *) calloc(len + 1, sizeof(char));
-    if (ft->rec.history.command_line == (char *) NULL)
-    {
-        gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-        return (-1);
-    }
-
-    /* Next "len" bytes contain the command line used to process the data */
-    memcpy(ft->rec.history.command_line, p, len);
-    history->command_line = ft->rec.history.command_line;
-    history->command_line[len] = '\0';
-    p += len;
-
-    /* Next two byte integer contains the size of the comment for this history
-    *  record
-    */
-    memcpy(&stemp, p, 2);
-    p += 2;
-    len = ntohs(stemp);
-
-    /* NULL out the caller's memory in case the allocation fails */
-    history->comment = (char *) NULL;
-
-    /* Re-allocate the memory for the comment line each time down */
-    if (ft->rec.history.comment != (char *) NULL)
-    {
-        free(ft->rec.history.comment);
-    }
-    ft->rec.history.comment = (char *) calloc(len + 1, sizeof(char));
-
-    if (ft->rec.history.comment == (char *) NULL)
-    {
-        gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-        return (-1);
-    }
-
-    /* Next "len" bytes contain the comment for this history record */
-    memcpy(ft->rec.history.comment, p, len);
-    history->comment = ft->rec.history.comment;
-    history->comment[len] = '\0';
-    p += len;
-
-    return (p - sptr);
-}
-
-/********************************************************************
- *
- * Function Name : gsfDecodeNavigationError
- *
- * Description : This function decodes a gsf byte stream containing a
- *  navigation error record into internal form.
- *
- * Inputs :
- *   nav_error = a pointer to the gsfNavigationError structure to be loaded
- *   sptr = a pointer to the unsigned char buffer to read from
- *
- * Returns :
- *  This function returns the number of bytes decoded.
- *
- * Error Conditions : none
- *
- ********************************************************************/
-
-int
-gsfDecodeNavigationError(gsfNavigationError * nav_error, unsigned char *sptr)
-{
-    unsigned char  *p = sptr;
-    gsfuLong        ltemp;
-    gsfsLong        signed_int;
-
-    /* First four byte integer contains the seconds portion of the time
-    *  of navigation error.
-    */
-    memcpy(&ltemp, p, 4);
-    p += 4;
-    nav_error->nav_error_time.tv_sec = ntohl(ltemp);
-
-    /* Next four byte integer contains the nanoseconds portion of the
-    * history time.
-    */
-    memcpy(&ltemp, p, 4);
-    p += 4;
-    nav_error->nav_error_time.tv_nsec = ntohl(ltemp);
-
-    /* Next four byte integer contains the record id for the record
-    *  containing a position with this error. (registry and type number)
-    */
-    memcpy(&ltemp, p, 4);
-    p += 4;
-    nav_error->record_id = ntohl(ltemp);
-
-    /* Next four byte integer contains the longitude error estimate */
-    memcpy(&ltemp, p, 4);
-    p += 4;
-    signed_int = (signed) ntohl(ltemp);
-    nav_error->longitude_error = ((double) signed_int) / 10.0;
-
-    /* Next four byte integer contains the latitude error estimate */
-    memcpy(&ltemp, p, 4);
-    p += 4;
-    signed_int = (signed) ntohl(ltemp);
-    nav_error->latitude_error = ((double) signed_int) / 10.0;
-
-    return (p - sptr);
-}
-
-/********************************************************************
- *
- * Function Name : gsfDecodeHVNavigationError
- *
- * Description : This function decodes a gsf byte stream containing
- *  the new horizontal and vertical navigation error record.
- *
- * Inputs :
- *   hv_nav_error = a pointer to the gsfHVNavigationError structure to be loaded
- *   sptr = a pointer to the unsigned char buffer to read from
- *
- * Returns :
- *  This function returns the number of bytes decoded.
- *
- * Error Conditions : none
- *
- ********************************************************************/
-
-int
-gsfDecodeHVNavigationError(gsfHVNavigationError *hv_nav_error, GSF_FILE_TABLE *ft, unsigned char *sptr)
-{
-    int             length;
-    unsigned char  *p = sptr;
-    gsfsShort       stemp;
-    gsfuShort       utemp;
-    gsfuLong        ltemp;
-    gsfsLong        signed_int;
-
-    /* First four byte integer contains the seconds portion of the time
-    *  of navigation error.
-    */
-    memcpy(&ltemp, p, 4);
-    p += 4;
-    hv_nav_error->nav_error_time.tv_sec = ntohl(ltemp);
-
-    /* Next four byte integer contains the nanoseconds portion of the
-    * history time.
-    */
-    memcpy(&ltemp, p, 4);
-    p += 4;
-    hv_nav_error->nav_error_time.tv_nsec = ntohl(ltemp);
-
-    /* Next four byte integer contains the record id for the record
-    *  containing a position with this error. (registry and type number)
-    */
-    memcpy(&ltemp, p, 4);
-    p += 4;
-    hv_nav_error->record_id = ntohl(ltemp);
-
-    /* Next four byte integer contains the horizontal error estimate */
-    memcpy(&ltemp, p, 4);
-    p += 4;
-    signed_int = (signed) ntohl(ltemp);
-    hv_nav_error->horizontal_error = ((double) signed_int) / 1000.0;
-
-    /* Next four byte integer contains the vertical error estimate */
-    memcpy(&ltemp, p, 4);
-    p += 4;
-    signed_int = (signed) ntohl(ltemp);
-    hv_nav_error->vertical_error = ((double) signed_int) / 1000.0;
-
-    /* Next two byte integer contains the SEP uncertainty */
-    memcpy(&utemp, p, 2);
-    p += 2;
-    hv_nav_error->SEP_uncertainty = ((double) ntohs(utemp)) / 100.0;
-
-    /* The next three bytes are reserved for future use */
-    hv_nav_error->spare[0] = (char) *p;
-    p += 1;
-    hv_nav_error->spare[1] = (char) *p;
-    p += 1;
-
-    /* The next two byte integer contains the length of the positioning type string */
-    memcpy(&stemp, p, 2);
-    p += 2;
-    length = ntohs(stemp);
-
-    /* NULL out the caller's memory in case the allocation fails */
-    hv_nav_error->position_type = (char *) NULL;
-
-    /* Re-allocate the memory for the comment line each time down */
-    if (ft->rec.hv_nav_error.position_type != (char *) NULL)
-    {
-        free(ft->rec.hv_nav_error.position_type);
-    }
-    ft->rec.hv_nav_error.position_type = (char *) calloc(length + 1, sizeof(char));
-
-    if (ft->rec.hv_nav_error.position_type == (char *) NULL)
-    {
-        gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-        return (-1);
-    }
-
-    /* Next "len" bytes contain the positioning system type */
-    memcpy(ft->rec.hv_nav_error.position_type, p, length);
-    hv_nav_error->position_type = ft->rec.hv_nav_error.position_type;
-    hv_nav_error->position_type[length] = '\0';
-    p += length;
-
-    return (p - sptr);
-}
-
-static void LocalAddTimes (struct timespec *base_time, double delta_time, struct timespec *sum_time)
-{
-    double fraction = 0.0;
-    double tmp      = 0.0;
-
-    /* checks for bounds too large, negative before addition */
-    sum_time->tv_sec = base_time->tv_sec + (int)(delta_time);
-    fraction         = delta_time - (int)delta_time;
-    tmp              = (((double)base_time->tv_nsec)/1.0e9)
-                       + fraction;
-
-    if      (tmp >= 1.0) {
-        sum_time->tv_sec += 1;
-        fraction         -= 1.0;
-    }
-    else if (tmp < 0.0) {
-        sum_time->tv_sec -= 1;
-        fraction         += 1.0;
-    }
-
-    sum_time->tv_nsec = base_time->tv_nsec + fraction*1.0e9;
-}
-
-/********************************************************************
- *
- * Function Name : gsfDecodeAttitude
-
- * Description : This function decodes a gsf attitude record
- *  from external byte stream form into internal form.  Memory for the
- *  pitch/roll/heave arrays is allocated (or reallocted) each time this
- *  record is encountered since the number of points in the profile can
- *  change.
- *
- * Inputs :
- *    attitude = a pointer to the gsfAtttiude structure to load
- *    ft = a pointer to the GSF_FILE_TABLE entry for the data file being decoded
- *    sptr = a pointer to the unsigned char buffer to read from
- *
- * Returns :
- *  This function returns the number of bytes decoded if successful, or
- *  -1 if an error occured.
- *
- * Error Conditions :
- *    GSF_MEMORY_ALLOCATION_FAILED
- *
- ********************************************************************/
-int
-gsfDecodeAttitude(gsfAttitude *attitude, GSF_FILE_TABLE *ft, unsigned char *sptr)
-{
-    unsigned char  *p = sptr;
-    gsfuLong        ltemp;
-    gsfuShort       stemp;
-    gsfsShort       signed_short;
-    int             i;
-    struct timespec basetime;
-    double          time_offset;
-
-    /* First four byte integer contains the observation time seconds */
-    memcpy(&ltemp, p, 4);
-    p += 4;
-    basetime.tv_sec = ntohl(ltemp);
-
-    /* Next four byte integer contains the observation time nanoseconds */
-    memcpy(&ltemp, p, 4);
-    p += 4;
-    basetime.tv_nsec = ntohl(ltemp);
-
-    /* Next two byte integer contains the number of measurements in the record */
-    memcpy(&stemp, p, 2);
-    p += 2;
-    attitude->num_measurements = ntohs(stemp);
-
-    /* NULL out caller's memory pointers in case memory allocation fails */
-    attitude->attitude_time = (struct timespec *) NULL;
-    attitude->pitch = (double *) NULL;
-    attitude->roll = (double *) NULL;
-    attitude->heave = (double *) NULL;
-    attitude->heading = (double *) NULL;
-
-    /* make sure we have memory for the attitude measurements */
-    if (ft->rec.attitude.attitude_time == (struct timespec *) NULL)
-    {
-        ft->rec.attitude.attitude_time = (struct timespec *) calloc(attitude->num_measurements, sizeof(struct timespec));
-
-        if (ft->rec.attitude.attitude_time == (struct timespec *) NULL)
-        {
-            gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-            return (-1);
-        }
-    }
-    /* Re-allocate the dynamic memory if the number of measurements in the record
-     * is greater this time than it was last time.
-     */
-    else if (ft->rec.attitude.num_measurements < attitude->num_measurements)
-    {
-        ft->rec.attitude.attitude_time = (struct timespec *) realloc(ft->rec.attitude.attitude_time, attitude->num_measurements * sizeof(struct timespec));
-
-        if (ft->rec.attitude.attitude_time == (struct timespec *) NULL)
-        {
-            gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-            return (-1);
-        }
-        memset(ft->rec.attitude.attitude_time, 0, attitude->num_measurements * sizeof(struct timespec));
-    }
-    /* Set the caller's pointer to this dynamic memory */
-    attitude->attitude_time = ft->rec.attitude.attitude_time;
-
-    /* make sure we have memory for the attitude measurements */
-    if (ft->rec.attitude.pitch == (double *) NULL)
-    {
-        ft->rec.attitude.pitch = (double *) calloc(attitude->num_measurements, sizeof(double));
-
-        if (ft->rec.attitude.pitch == (double *) NULL)
-        {
-            gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-            return (-1);
-        }
-    }
-    /* Re-allocate the dynamic memory if the number of measurements in the record
-     * is greater this time than it was last time.
-     */
-    else if (ft->rec.attitude.num_measurements < attitude->num_measurements)
-    {
-        ft->rec.attitude.pitch = (double *) realloc(ft->rec.attitude.pitch, attitude->num_measurements * sizeof(double));
-
-        if (ft->rec.attitude.pitch == (double *) NULL)
-        {
-            gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-            return (-1);
-        }
-        memset(ft->rec.attitude.pitch, 0, attitude->num_measurements * sizeof(double));
-    }
-    /* Set the caller's pointer to this dynamic memory */
-    attitude->pitch = ft->rec.attitude.pitch;
-
-    /* make sure we have memory for the attitude measurements */
-    if (ft->rec.attitude.roll == (double *) NULL)
-    {
-        ft->rec.attitude.roll = (double *) calloc(attitude->num_measurements, sizeof(double));
-
-        if (ft->rec.attitude.roll == (double *) NULL)
-        {
-            gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-            return (-1);
-        }
-    }
-    /* Re-allocate the dynamic memory if the number of measurements in the record
-     * is greater this time than it was last time.
-     */
-    else if (ft->rec.attitude.num_measurements < attitude->num_measurements)
-    {
-        ft->rec.attitude.roll = (double *) realloc(ft->rec.attitude.roll, attitude->num_measurements * sizeof(double));
-
-        if (ft->rec.attitude.roll == (double *) NULL)
-        {
-            gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-            return (-1);
-        }
-        memset(ft->rec.attitude.roll, 0, attitude->num_measurements * sizeof(double));
-    }
-    /* Set the caller's pointer to this dynamic memory */
-    attitude->roll = ft->rec.attitude.roll;
-
-    /* make sure we have memory for the attitude measurements */
-    if (ft->rec.attitude.heave == (double *) NULL)
-    {
-        ft->rec.attitude.heave = (double *) calloc(attitude->num_measurements, sizeof(double));
-
-        if (ft->rec.attitude.heave == (double *) NULL)
-        {
-            gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-            return (-1);
-        }
-    }
-    /* Re-allocate the dynamic memory if the number of measurements in the record
-     * is greater this time than it was last time.
-     */
-    else if (ft->rec.attitude.num_measurements < attitude->num_measurements)
-    {
-        ft->rec.attitude.heave = (double *) realloc(ft->rec.attitude.heave, attitude->num_measurements * sizeof(double));
-
-        if (ft->rec.attitude.heave == (double *) NULL)
-        {
-            gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-            return (-1);
-        }
-        memset(ft->rec.attitude.heave, 0, attitude->num_measurements * sizeof(double));
-    }
-    /* Set the caller's pointer to this dynamic memory */
-    attitude->heave = ft->rec.attitude.heave;
-
-    /* make sure we have memory for the attitude measurements */
-    if (ft->rec.attitude.heading == (double *) NULL)
-    {
-        ft->rec.attitude.heading = (double *) calloc(attitude->num_measurements, sizeof(double));
-
-        if (ft->rec.attitude.heading == (double *) NULL)
-        {
-            gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-            return (-1);
-        }
-    }
-    /* Re-allocate the dynamic memory if the number of measurements in the record
-     * is greater this time than it was last time.
-     */
-    else if (ft->rec.attitude.num_measurements < attitude->num_measurements)
-    {
-        ft->rec.attitude.heading = (double *) realloc(ft->rec.attitude.heading, attitude->num_measurements * sizeof(double));
-
-        if (ft->rec.attitude.heading == (double *) NULL)
-        {
-            gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-            return (-1);
-        }
-        memset(ft->rec.attitude.heading, 0, attitude->num_measurements * sizeof(double));
-    }
-    /* Set the caller's pointer to this dynamic memory */
-    attitude->heading = ft->rec.attitude.heading;
-
-    /* Save the number of points in this profile in the library's file table */
-    ft->rec.attitude.num_measurements = attitude->num_measurements;
-
-    /* Now loop to decode the attitude measurements */
-    for (i = 0; i < attitude->num_measurements; i++)
-    {
-        /* Next two byte integer contains the time offset */
-        memcpy(&stemp, p, 2);
-        time_offset = ((double) ntohs (stemp)) / 1000.0;
-        p += 2;
-
-        LocalAddTimes (&basetime, time_offset, &attitude->attitude_time[i]);
-
-        /* Next two byte integer contains the pitch */
-        memcpy(&stemp, p, 2);
-        signed_short = (signed) ntohs(stemp);
-        attitude->pitch[i] = ((double) signed_short) / 100.0;
-        p += 2;
-
-        /* Next two byte integer contains the roll */
-        memcpy(&stemp, p, 2);
-        signed_short = (signed) ntohs(stemp);
-        attitude->roll[i] = ((double) signed_short) / 100.0;
-        p += 2;
-
-        /* Next two byte integer contains the heave */
-        memcpy(&stemp, p, 2);
-        signed_short = (signed) ntohs(stemp);
-        attitude->heave[i] = ((double) signed_short) / 100.0;
-        p += 2;
-
-        /* Next two byte integer contains the heading */
-        memcpy(&stemp, p, 2);
-        attitude->heading[i] = ((double) ntohs(stemp)) / 100.0;
-        p += 2;
-    }
-
-    return (p - sptr);
-}
diff --git a/src/gsf/gsf_dec.h b/src/gsf/gsf_dec.h
deleted file mode 100644
index d557483..0000000
--- a/src/gsf/gsf_dec.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/********************************************************************
- *
- * Module Name : GSF_DEC
- *
- * Author/Date : J. S. Byrne / 26 May 1994
- *
- * Description :
- *
- * Restrictions/Limitations :
- *
- * Change Descriptions :
- * who  when      what
- * ---  ----      ----
- * hem  08/20/96  Added gsfDecodeSinglebeam.
- * jsb  09/28/98  Added gsfDecodeHVNavigationError.
- *
- * Classification : Unclassified
- *
- * References :
- *
- *
- * copyright 2014 Leidos, Inc.
- * There is no charge to use the library, and it may be accessed at:
- * https://www.leidos.com/maritime/gsf.
- * This library may be redistributed and/or modified under the terms of
- * the GNU Lesser General Public License version 2.1, as published by the
- * Free Software Foundation.  A copy of the LGPL 2.1 license is included with
- * the GSF distribution and is avaialbe at: http://opensource.org/licenses/LGPL-2.1.
- *
- * Leidos, Inc. configuration manages GSF, and provides GSF releases. Users are
- * strongly encouraged to communicate change requests and change proposals to Leidos, Inc.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE.
- *
- ********************************************************************/
-
-#ifndef _GSF_DEC_H_
-   #define _GSF_DEC_H_
-
-   #include "gsf.h"
-   #include "gsf_ft.h"
-
-   int OPTLK gsfDecodeHeader(gsfHeader *header, unsigned char *sptr);
-   int OPTLK gsfDecodeSwathBathySummary(gsfSwathBathySummary *summ, unsigned char *sptr);
-   int OPTLK gsfDecodeSwathBathymetryPing(gsfSwathBathyPing *ping, unsigned char *sptr, GSF_FILE_TABLE *ft, int handle, int record_size);
-   int OPTLK gsfDecodeSoundVelocityProfile(gsfSVP *svp, GSF_FILE_TABLE *ft, unsigned char *sptr);
-   int OPTLK gsfDecodeProcessingParameters(gsfProcessingParameters *param, GSF_FILE_TABLE *ft, unsigned char *sptr);
-   int OPTLK gsfDecodeSensorParameters(gsfSensorParameters *param, GSF_FILE_TABLE *ft, unsigned char *sptr);
-   int OPTLK gsfDecodeComment(gsfComment *comment, GSF_FILE_TABLE *ft, unsigned char *sptr);
-   int OPTLK gsfDecodeHistory(gsfHistory *history, GSF_FILE_TABLE *ft, unsigned char *sptr);
-   int OPTLK gsfDecodeNavigationError(gsfNavigationError *nav_error, unsigned char *sptr);
-   int OPTLK gsfDecodeHVNavigationError(gsfHVNavigationError *hv_nav_error, GSF_FILE_TABLE *ft, unsigned char *sptr);
-   int OPTLK gsfDecodeSinglebeam(gsfSingleBeamPing * ping, unsigned char *sptr, GSF_FILE_TABLE *ft, int handle, int record_size);
-   int OPTLK gsfDecodeAttitude(gsfAttitude *attitude, GSF_FILE_TABLE *ft, unsigned char *sptr);
-
-#endif
diff --git a/src/gsf/gsf_enc.c b/src/gsf/gsf_enc.c
deleted file mode 100644
index acdb690..0000000
--- a/src/gsf/gsf_enc.c
+++ /dev/null
@@ -1,8454 +0,0 @@
-/********************************************************************
- *
- * Module Name : GSF_ENC.C
- *
- * Author/Date : J. S. Byrne / 3 May 1994
- *
- * Description :
- *  This source file contains the gsf functions for encoding a gsf byte
- *   stream from host data structures.
- *
- * Restrictions/Limitations :
- * 1) This library assumes the host computer uses the ASCII character set.
- * 2) This library assumes that the data types u_short and u_int are defined
- *    on the host machine, where a u_short is a 16 bit unsigned integer, and
- *    a u_int is a 32 bit unsigned integer.
- * 3) This library assumes that the type short is 16 bits, and that
- *    the type int is 32 bits.
- *
- *
- * Change Descriptions :
- * who          when      what
- * ---          ----      ----
- * jsb          10-17-94  Added support for Reson SeaBat data
- * jsb          03-10-95  Modified ping record to store dynamic depth
- *                        corrector and tide corrector.
- * jsb          11-13-95  Added Unique id for EM1000
- * jsb          12-22-95  Added nearest scaled integer rounding on latitude
- *                        longitude, roll, pitch, and heave.
- * hem          08-20-96  Added gsfEncodeSinglebeam; added EncodeSASSSpecific,
- *                        EncodeTypeIIISeaBeamSpecific, EncodeSeaMapSpecific,
- *                        EncodeEchotracSpecific, EncodeMGD77Specific,
- *                        EncodeBDBSpecific, & EncodeNOSHDBSpecific; changed
- *                        gsfEncodeComment so that it uses the length of the
- *                        comment specified in the record rather than using
- *                        strlen to find the length of the comment (to allow
- *                        nulls in the comment);
- * jsb          09-27-96  Added support for SeaBeam with amplitude data
- * jsb          03-24-97  Added support for gsfSeaBatIISpecific as a replacement
- *                        of gsfSeaBatSpecific for the Reson 900x series sonars.
- *                        Added gsfSeaBat8101Specific for the Reson 8101 series
- *                        sonar.
- * hem          07-23-97  Added code to gsfEncodeSwathBathySummary,
- *                        gsfEncodeSinglebeam, and
- *                        gsfEncodeSoundVelocityProfile to handle rounding
- *                        latitudes, longitudes, depths, etc. properly before
- *                        storage in the GSF file.
- * bac          10-27-97  Added EncodeSeaBeam2112Specific to support the Sea
- *                        Beam 2112/36 sonar.
- * dwc          1-9-98    Added EncodeElacMkIISpecific to support the Elac
- *                        Bottomchart MkII sonar.
- * jsb          09/28/98  Added gsfEncodeHVNavigationError. This change made
- *                        in responce to CRs: GSF-98-001, and GSF-98-002. Also
- *                        added support for horizontal error ping array subrecord
- *                        in responce to CR: GSF-98-003. Removed the computation of
- *                        error_sum from gsfEncodeSwathBathymetryPing, now the library
- *                        will write horizontal and vertical depth estimates for each
- *                        ping if the array pointers are non-null.
- * jsb          12/29/98  Added support for Simrad em3000 series sonar systems.
- * wkm          3-30-99   Added EncodeCmpSassSpecific to deal with CMP SASS data.
- * wkm          8-02-99   Updated EncodeCmpSassSpecific to include lntens (heave) with CMP SASS data.
- * bac          10-24-00  Updated EncodeEM3Specific to include data fields from updated
- *                        EM series runtime parameter datagram.
- * bac          07-18-01  Added support for the Reson 8100 series of sonars.  Also removed the useage
- *                        of C++ reserved words "class" and "operator".
- * bac          10-12-01  Added a new attitude record definition.  The attitude record provides
- *                        a method for logging full time-series attitude measurements in the GSF
- *                        file, instead of attitude samples only at ping time.  Each attitude
- *                        record contains arrays of attitude measurements for time, roll, pitch,
- *                        heave and heading.  The number of measurements is user-definable, but
- *                        because of the way in which measurement times are stored, a single
- *                        attitude record should never contain more than sixty seconds worth of
- *                        data.
- * jsb          01-19-02  Added support for Simrad EM120, and removed references to unsued variables.
- * bac          06-19-03  Added support for bathymetric receive beam time series intensity data (i.e., Simrad
- *                        "Seabed image" and Reson "snippets").  Inlcluded RWL updates of 12-19-02 for adding
- *                        sensor-specific singlebeam information to the MB sensor specific subrecords.
- * bac          12-28-04  Added support for Navisound singlebeam, EM3000D, EM3002, and EM3002D.  Fixed
- *                        encoding of 1-byte BRB intensity values.  Corrected the encode/decode of Reson
- *                        projector angle.  Added beam_spacing to the gsfReson8100Specific subrecord.
- * bac          06-28-06  Added support for EM121A data received via Kongsberg SIS, mapped to existing
- *                        EM3 series sensor specific data structure. Replaced references to long types
- *                        with int types, for compilation on 64-bit architectures.
- * dhg          10-24-06  Added support for GeoSwathPlus interferometric sonar
- * dhg          10-31-06  Added support for GeoSwathPlus "range_error" and "angle_error"
- * dhg          11-01-06  Corrected "model_number" and "frequency" for "GeoSwathPlusSpecific" record
- * mab          02-01-09  Updates to support Reson 7125. Added new subrecord IDs and subrecord definitions for Kongsberg
- *                        sonar systems where TWTT and angle are populated from raw range and beam angle datagram. Added
- *                        new subrecord definition for EM2000.  Bug fixes in gsfOpen and gsfPercent.
- * clb          02-25-11  Changed the EncodeBRBIntensity() function when bits_per_sample is 12
- * clb          04-06-11  Changes made for DeltaT
- * clb          04-13-11  When encoding a ping, reject it if the number of beams <= 0
- * clb          06-21-11  Added em12 to list of available sensors
- * clb          09-20-11  Added support for R2Sonic
- * jcd          02-17-12  fixed EncodeQualityFlagsArray to work with num_beams not evenly divisible by 4
- *
- * Classification : Unclassified
- *
- * References : DoDBL Generic Sensor Format Sept. 30, 1993
- *
- * copyright 2014 Leidos, Inc.
- * There is no charge to use the library, and it may be accessed at:
- * https://www.leidos.com/maritime/gsf.
- * This library may be redistributed and/or modified under the terms of
- * the GNU Lesser General Public License version 2.1, as published by the
- * Free Software Foundation.  A copy of the LGPL 2.1 license is included with
- * the GSF distribution and is avaialbe at: http://opensource.org/licenses/LGPL-2.1.
- *
- * Leidos, Inc. configuration manages GSF, and provides GSF releases. Users are
- * strongly encouraged to communicate change requests and change proposals to Leidos, Inc.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE.
- *
- ********************************************************************/
-
-/* standard c library includes */
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-
-/* rely on the network type definitions of (u_short, and u_int) */
-#include <sys/types.h>
-#if !defined WIN32  && !defined WIN64
-#include <netinet/in.h>
-#else
-#include <winsock.h>
-#endif
-
-/* gsf library interface description */
-#include "gsf.h"
-#include "gsf_enc.h"
-
-/* Global external data defined in this module */
-extern int      gsfError;                               /* defined in gsf.c */
-
-/* Function prototypes for this file */
-static int      EncodeScaleFactors(unsigned char *sptr, gsfScaleFactors *sf);
-static int      EncodeTwoByteArray(unsigned char *sptr, double *array, int num_beams, gsfScaleFactors * sf, int id);
-static int      EncodeSignedTwoByteArray(unsigned char *sptr, double *array, int num_beams, gsfScaleFactors * sf, int id);
-static int      EncodeByteArray(unsigned char *sptr, double *array, int num_beams, gsfScaleFactors * sf, int id);
-static int      EncodeFourByteArray(unsigned char *sptr, double *array, int num_beams, gsfScaleFactors *sf, int id);
-static int      EncodeSignedFourByteArray(unsigned char *sptr, double *array, int num_beams, gsfScaleFactors *sf, int id);
-static int      EncodeSignedByteArray(unsigned char *sptr, double *array, int num_beams, gsfScaleFactors * sf, int id);
-static int      EncodeBeamFlagsArray(unsigned char *sptr, unsigned char *array, int num_beams);
-static int      EncodeQualityFlagsArray(unsigned char *sptr, unsigned char *array, int num_beams);
-static int      EncodeFromUnsignedShortToByteArray(unsigned char *sptr, unsigned short *array, int num_beams, gsfScaleFactors *sf, int id);
-static int      EncodeBRBIntensity(unsigned char *sptr, gsfBRBIntensity * idata, int num_beams, int sensor_id, int bytes_used);
-static int      EncodeSeabeamSpecific(unsigned char *sptr, gsfSensorSpecific * sdata);
-static int      EncodeEM12Specific(unsigned char *sptr, gsfSensorSpecific * sdata);
-static int      EncodeEM100Specific(unsigned char *sptr, gsfSensorSpecific * sdata);
-static int      EncodeEM950Specific(unsigned char *sptr, gsfSensorSpecific * sdata);
-static int      EncodeEM1000Specific(unsigned char *sptr, gsfSensorSpecific * sdata);
-static int      EncodeEM121ASpecific(unsigned char *sptr, gsfSensorSpecific * sdata);
-static int      EncodeEM121Specific(unsigned char *sptr, gsfSensorSpecific * sdata);
-static int      EncodeEM3ImagerySpecific(unsigned char *sptr, gsfSensorImagery *sdata);
-static int      EncodeEM4ImagerySpecific(unsigned char *sptr, gsfSensorImagery *sdata);
-static int      EncodeReson7100ImagerySpecific(unsigned char *sptr, gsfSensorImagery *sdata);
-static int      EncodeR2SonicImagerySpecific(unsigned char *sptr, gsfSensorImagery *sdata);
-
-#if 1
-/* 3-30-99 wkm: obsolete */
-static int      EncodeTypeIIISeaBeamSpecific(unsigned char *sptr, gsfSensorSpecific * sdata);
-static int      EncodeSASSSpecific(unsigned char *sptr, gsfSensorSpecific * sdata);
-#endif
-
-static int      EncodeCmpSassSpecific(unsigned char *sptr, gsfSensorSpecific * sdata);
-
-static int      EncodeSeaMapSpecific(unsigned char *sptr, gsfSensorSpecific * sdata, GSF_FILE_TABLE *ft);
-static int      EncodeSeaBatSpecific(unsigned char *sptr, gsfSensorSpecific * sdata);
-static int      EncodeEchotracSpecific(unsigned char *sptr, gsfSBSensorSpecific * sdata);
-static int      EncodeMGD77Specific(unsigned char *sptr, gsfSBSensorSpecific * sdata);
-static int      EncodeBDBSpecific(unsigned char *sptr, gsfSBSensorSpecific * sdata);
-static int      EncodeNOSHDBSpecific(unsigned char *sptr, gsfSBSensorSpecific * sdata);
-static int      EncodeSBAmpSpecific(unsigned char *sptr, gsfSensorSpecific * sdata);
-static int      EncodeSeaBatIISpecific(unsigned char *sptr, gsfSensorSpecific * sdata);
-static int      EncodeSeaBat8101Specific(unsigned char *sptr, gsfSensorSpecific * sdata);
-static int      EncodeSeaBeam2112Specific(unsigned char *sptr, gsfSensorSpecific * sdata);
-static int      EncodeElacMkIISpecific(unsigned char *sptr, gsfSensorSpecific * sdata);
-static int      EncodeEM3Specific(unsigned char *sptr, gsfSensorSpecific * sdata, GSF_FILE_TABLE *ft);
-static int      EncodeEM3RawSpecific(unsigned char *sptr, gsfSensorSpecific * sdata, GSF_FILE_TABLE *ft);
-static int      EncodeReson7100Specific(unsigned char *sptr, gsfSensorSpecific * sdata);
-static int      EncodeReson8100Specific(unsigned char *sptr, gsfSensorSpecific * sdata);
-static int      EncodeSBEchotracSpecific(unsigned char *sptr, t_gsfSBEchotracSpecific * sdata);
-static int      EncodeSBMGD77Specific(unsigned char *sptr, t_gsfSBMGD77Specific * sdata);
-static int      EncodeSBBDBSpecific(unsigned char *sptr, t_gsfSBBDBSpecific * sdata);
-static int      EncodeSBNOSHDBSpecific(unsigned char *sptr, t_gsfSBNOSHDBSpecific * sdata);
-static int      EncodeSBNavisoundSpecific(unsigned char *sptr, t_gsfSBNavisoundSpecific * sdata);
-static int      EncodeEM4Specific(unsigned char *sptr, gsfSensorSpecific * sdata, GSF_FILE_TABLE *ft);
-static int      EncodeGeoSwathPlusSpecific(unsigned char *sptr, gsfSensorSpecific * sdata);
-static int      EncodeKlein5410BssSpecific(unsigned char *sptr, gsfSensorSpecific * sdata);
-static int      EncodeDeltaTSpecific(unsigned char *sptr, gsfSensorSpecific * sdata);
-static int      EncodeR2SonicSpecific(unsigned char *sptr, gsfSensorSpecific * sdata);
-
-/********************************************************************
- *
- * Function Name : gsfEncodeHeader
- *
- * Description : This function encodes a gsf header into external byte stream
- *  form from the passed gsfHeader structure.
- *
- * Inputs :
- *    sptr = a pointer to the unsigned char buffer to write into.
- *    header = a pointer to the gsfHeader structure to read from.
- *
- * Returns : This function returns the number of bytes encoded.
- *
- * Error Conditions : none
- *
- ********************************************************************/
-
-int
-gsfEncodeHeader(unsigned char *sptr, gsfHeader * header)
-{
-    unsigned char  *p = sptr;
-
-    memset(header->version, 0, sizeof(header->version));
-    strncpy(header->version, GSF_VERSION, sizeof(header->version)-1);
-    header->version[sizeof(header->version)-1] = 0;
-    memcpy(p, header->version, sizeof(gsfHeader));
-    p += sizeof(gsfHeader);
-
-    return (p - sptr);
-}
-
-/********************************************************************
- *
- * Function Name : gsfEncodeSwathBathySummary
- *
- * Description : This function encodes a gsf swath bathymetry summary record
- *  into external byte stream form from the passed gsfHeader structure.
- *
- * Inputs :
- *    sptr = a pointer to the unsigned char buffer to write into.
- *    header = a pointer to the gsfHeader structure to read from.
- *
- * Returns : This function returns the number of bytes encoded.
- *
- * Error Conditions : none
- *
- ********************************************************************/
-
-int
-gsfEncodeSwathBathySummary(unsigned char *sptr, gsfSwathBathySummary *sum)
-{
-    gsfuLong        ltemp;
-    gsfsLong        signed_long;
-    double          dtemp;
-    unsigned char  *p = sptr;
-
-    /* First 8 bytes contain the time of the first ping in the file */
-    ltemp = htonl(sum->start_time.tv_sec);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    ltemp = htonl(sum->start_time.tv_nsec);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* Next 8 bytes contain the time of the last ping in the file */
-    ltemp = htonl(sum->end_time.tv_sec);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    ltemp = htonl(sum->end_time.tv_nsec);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* Next four byte integer contains the minimum latitude. Round the scaled
-     * quantity to the nearest whole integer.
-     */
-    dtemp = sum->min_latitude * 1.0e7;
-    if (dtemp < 0.0)
-    {
-        dtemp -= 0.501;
-    }
-    else
-    {
-        dtemp += 0.501;
-    }
-    ltemp = htonl((gsfsLong) dtemp);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* Next four byte integer contains the minimum longitude. Round the scaled
-     * quantity to the nearest whole integer.
-     */
-    dtemp = sum->min_longitude * 1.0e7;
-    if (dtemp < 0.0)
-    {
-        dtemp -= 0.501;
-    }
-    else
-    {
-        dtemp += 0.501;
-    }
-    ltemp = htonl((gsfsLong) dtemp);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* Next four byte integer contains the maximum latitude. Round the scaled
-     * quantity to the nearest whole integer.
-     */
-    dtemp = sum->max_latitude * 1.0e7;
-    if (dtemp < 0.0)
-    {
-        dtemp -= 0.501;
-    }
-    else
-    {
-        dtemp += 0.501;
-    }
-    ltemp = htonl((gsfsLong) dtemp);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* Next four byte integer contains the maximum longitude. Round the scaled
-     * quantity to the nearest whole integer.
-     */
-    dtemp = sum->max_longitude * 1.0e7;
-    if (dtemp < 0.0)
-    {
-        dtemp -= 0.501;
-    }
-    else
-    {
-        dtemp += 0.501;
-    }
-    ltemp = htonl((gsfsLong) dtemp);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* Next four byte integer contains the minimum depth. Round the scaled
-     * quantity to the nearest whole integer.
-     */
-    dtemp = sum->min_depth * 100.0;
-    if (dtemp < 0.0)
-    {
-        dtemp -= 0.501;
-    }
-    else
-    {
-        dtemp += 0.501;
-    }
-    signed_long = htonl((gsfsLong) dtemp);
-    memcpy(p, &signed_long, 4);
-    p += 4;
-
-    /* Next four byte integer contains the maximum depth. Round the scaled
-     * quantity to the nearest whole integer.
-     */
-    dtemp = sum->max_depth * 100.0;
-    if (dtemp < 0.0)
-    {
-        dtemp -= 0.501;
-    }
-    else
-    {
-        dtemp += 0.501;
-    }
-    signed_long = htonl((gsfsLong) dtemp);
-    memcpy(p, &signed_long, 4);
-    p += 4;
-
-    return (p - sptr);
-}
-
-/********************************************************************
- *
- * Function Name : EncodeEchotracSpecific
- *
- * Description : This function encodes the Bathy 2000 and echotrac
- *  sensor specific data from the HSPS source files.
- *
- * Inputs :
- *    sptr = a pointer to an unsigned char buffer to write into
- *    sdata = a pointer to a union of sensor specific data
- *
- * Returns : This function returns the number of bytes encoded.
- *
- * Error Conditions : none
- *
- ********************************************************************/
-
-static int
-EncodeEchotracSpecific(unsigned char *sptr, gsfSBSensorSpecific * sdata)
-{
-    unsigned char  *p = sptr;
-    gsfuShort       stemp;
-
-    /* First two byte integer contains the navigation error */
-    stemp = htons((gsfuShort) (sdata->gsfEchotracSpecific.navigation_error));
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next byte contains the most probable position source navigation */
-    *p = (unsigned char) sdata->gsfEchotracSpecific.mpp_source;
-    p += 1;
-
-    /* Next byte contains the tide source */
-    *p = (unsigned char) sdata->gsfEchotracSpecific.tide_source;
-    p += 1;
-
-    return (p - sptr);
-}
-
-/********************************************************************
- *
- * Function Name : EncodeMGD77Specific
- *
- * Description : This function encodes the MGD77 fields
- * into an MGD77 record. The MGD77 Singlebeam is essentially
- * survey trackline data, and actual survey data can be retrieved
- * from the source.
- *
- * Inputs :
- *    sptr = a pointer to an unsigned char buffer to write into
- *    sdata = a pointer to a union of sensor specific data
- *
- * Returns : This function returns the number of bytes encoded.
- *
- * Error Conditions : none
- *
- ********************************************************************/
-
-static int
-EncodeMGD77Specific(unsigned char *sptr, gsfSBSensorSpecific * sdata)
-{
-    unsigned char  *p = sptr;
-    gsfuLong        ltemp;
-    gsfuShort       stemp;
-    double          dtemp;
-
-    /* First two byte integer contains the time zone correction */
-    stemp = htons((gsfuShort) (sdata->gsfMGD77Specific.time_zone_corr));
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* The Next two byte integer contains how the navigation was obtained */
-    stemp = htons((gsfuShort) (sdata->gsfMGD77Specific.position_type_code));
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* The Next two byte integer contains on how the sound velocity
-       correction was made */
-    stemp = htons((gsfuShort) (sdata->gsfMGD77Specific.correction_code));
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* The Next two byte integer contains how the bathymetry was obtained */
-    stemp = htons((gsfuShort) (sdata->gsfMGD77Specific.bathy_type_code));
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* The Next two byte integer contains the quality code for Nav */
-    stemp = htons((gsfuShort) (sdata->gsfMGD77Specific.quality_code));
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next four byte integer contains the the two way travel time */
-    dtemp = sdata->gsfMGD77Specific.travel_time * 10000;
-    if (dtemp < 0.0)
-    {
-        dtemp -= 0.501;
-    }
-    else
-    {
-        dtemp += 0.501;
-    }
-    ltemp = htonl((gsfuLong) dtemp);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    return (p - sptr);
-}
-
-/********************************************************************
- *
- * Function Name : EncodeBDBSpecific
- *
- * Description : This function encodes the BDB fields
- * into a BDB record.
- *
- * Inputs :
- *    sptr = a pointer to an unsigned char buffer to write into
- *    sdata = a pointer to a union of sensor specific data
- *
- * Returns : This function returns the number of bytes encoded.
- *
- * Error Conditions : none
- *
- ********************************************************************/
-
-static int
-EncodeBDBSpecific(unsigned char *sptr, gsfSBSensorSpecific * sdata)
-{
-    unsigned char  *p = sptr;
-    gsfuLong        ltemp;
-
-    /* Next four byte integer contains the the document number */
-    ltemp = htonl((gsfuLong) (sdata->gsfBDBSpecific.doc_no));
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* Next byte contains the evaluation flag */
-    *p = (unsigned char) sdata->gsfBDBSpecific.eval;
-    p += 1;
-
-    /* Next byte contains the classification flag */
-    *p = (unsigned char) sdata->gsfBDBSpecific.classification;
-    p += 1;
-
-    /* Next byte contains the track adjustment flag */
-    *p = (unsigned char) sdata->gsfBDBSpecific.track_adj_flag;
-    p += 1;
-
-    /* Next byte contains the source flag */
-    *p = (unsigned char) sdata->gsfBDBSpecific.source_flag;
-    p += 1;
-
-    /* Next byte contains the discrete point or track line flag */
-    *p = (unsigned char) sdata->gsfBDBSpecific.pt_or_track_ln;
-    p += 1;
-
-    /* Next byte contains the datum flag */
-    *p = (unsigned char) sdata->gsfBDBSpecific.datum_flag;
-    p += 1;
-
-    return (p - sptr);
-}
-
-/********************************************************************
- *
- * Function Name : EncodeNOSHDBSpecific
- *
- * Description : This function encodes the NOSHDB fields into a
- *               NOSHDB record.
- *
- * Inputs :
- *    sptr = a pointer to an unsigned char buffer to write into
- *    sdata = a pointer to a union of sensor specific data
- *
- * Returns : This function returns the number of bytes encoded.
- *
- * Error Conditions : none
- *
- ********************************************************************/
-
-static int
-EncodeNOSHDBSpecific(unsigned char *sptr, gsfSBSensorSpecific * sdata)
-{
-    unsigned char  *p = sptr;
-    gsfuShort       stemp;
-
-    /* First two byte integer contains the depth type code */
-    stemp = htons((gsfuShort) (sdata->gsfNOSHDBSpecific.type_code));
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* The Next two byte integer contains the cartographic code */
-    stemp = htons((gsfuShort) (sdata->gsfNOSHDBSpecific.carto_code));
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    return (p - sptr);
-}
-
-/********************************************************************
- *
- * Function Name : gsfEncodeSinglebeam
- *
- * Description : This function encodes a gsf single beam ping record
- *  in external byte stream form from a gsfSwathBathyPing structure.
- *
- * Inputs :
- *    sptr = a pointer to the unsigned char buffer to write into
- *    ping = a pointer to the gsfSwathBathPing record to read from
- *    handle = an integer handle to the gsf data file, used to track the
- *             number of beams.
- *    ft = a pointer to the gsfFileTable, where the scale factors are
- *         maintained.
- *
- * Returns :
- *  This function returns the number of bytes encoded if successful, or
- *  -1 if an error occured.
- *
- * Error Conditions :
- *    GSF_UNRECOGNIZED_SENSOR_ID
- *
- ********************************************************************/
-int
-gsfEncodeSinglebeam(unsigned char *sptr, gsfSingleBeamPing * ping)
-{
-    gsfuLong        ltemp;
-    gsfuShort       stemp;
-    int             sensor_size = 0;
-    double          dtemp;
-    unsigned char  *p = sptr;
-    unsigned char  *temp_ptr;
-
-    /* First 8 bytes contain the time */
-    ltemp = htonl(ping->ping_time.tv_sec);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    ltemp = htonl(ping->ping_time.tv_nsec);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* Next four byte integer contains the longitude. Round the scaled
-     * quantity to the nearest whole integer.
-     */
-    dtemp = ping->longitude * 1.0e7;
-    if (dtemp < 0.0)
-    {
-        dtemp -= 0.501;
-    }
-    else
-    {
-        dtemp += 0.501;
-    }
-    ltemp = htonl((gsfsLong) dtemp);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* Next four byte integer contains the latitude. Round the scaled
-     * quantity to the nearest whole integer.
-     */
-    dtemp = ping->latitude * 1.0e7;
-    if (dtemp < 0.0)
-    {
-        dtemp -= 0.501;
-    }
-    else
-    {
-        dtemp += 0.501;
-    }
-    ltemp = htonl((gsfsLong) dtemp);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* Next two byte integer contains the tide corrector for this ping.
-     * Round this to the nearest whole centimeter.
-     */
-    dtemp = ping->tide_corrector * 100.0;
-    if (dtemp < 0.0)
-    {
-        dtemp -= 0.501;
-    }
-    else
-    {
-        dtemp += 0.501;
-    }
-    stemp = htons((gsfsShort) dtemp);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next four byte integer contains the depth corrector.
-     * Round this to the nearest whole centimeter.
-     */
-    dtemp = ping->depth_corrector * 100.0;
-    if (dtemp < 0.0)
-    {
-        dtemp -= 0.501;
-    }
-    else
-    {
-        dtemp += 0.501;
-    }
-    ltemp = htonl((gsfsLong) dtemp);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* Next two byte integer contains the ship heading, round this value to the
-     * nearest one hundredth of a degree.
-     */
-    stemp = htons((gsfuShort) ((ping->heading * 100.0) + 0.501));
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next two byte integer contains the pitch. Round the scaled
-     * quantity to the nearest whole integer.
-     */
-    dtemp = ping->pitch * 100.0;
-    if (dtemp < 0.0)
-    {
-        dtemp -= 0.501;
-    }
-    else
-    {
-        dtemp += 0.501;
-    }
-    stemp = htons((gsfsShort) dtemp);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next two byte integer contains the roll. Round the scaled
-     * quantity to the nearest whole integer.
-     */
-    dtemp = ping->roll * 100.0;
-    if (dtemp < 0.0)
-    {
-        dtemp -= 0.501;
-    }
-    else
-    {
-        dtemp += 0.501;
-    }
-    stemp = htons((gsfsShort) dtemp);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next two byte integer contains the heave. Round the scaled
-     * quantity to the nearest whole integer.
-     */
-    dtemp = ping->heave * 100.0;
-    if (dtemp < 0.0)
-    {
-        dtemp -= 0.501;
-    }
-    else
-    {
-        dtemp += 0.501;
-    }
-    stemp = htons((gsfsShort) dtemp);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next four byte integer contains the depth. Round the scaled
-     * quantity to the nearest whole integer.
-     */
-    dtemp = ping->depth * 100.0;
-    if (dtemp < 0.0)
-    {
-        dtemp -= 0.501;
-    }
-    else
-    {
-        dtemp += 0.501;
-    }
-    ltemp = htonl((gsfsLong) dtemp);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* Next two byte integer contains the sound speed correction.
-     * Round the scaled quantity to the nearest whole integer.
-     */
-    dtemp = ping->sound_speed_correction * 100.0;
-    if (dtemp < 0.0)
-    {
-        dtemp -= 0.501;
-    }
-    else
-    {
-        dtemp += 0.501;
-    }
-    stemp = htons((gsfsShort) dtemp);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next byte contains the positioning system type */
-    stemp = htons((gsfuShort) (ping->positioning_system_type));
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-
-    /* Next possible subrecord is the sensor specific subrecord. Save the
-    *  current pointer, and leave room for the four byte subrecord identifier.
-    */
-    temp_ptr = p;
-    p += 4;
-
-    switch (ping->sensor_id)
-    {
-        case (GSF_SINGLE_BEAM_SUBRECORD_ECHOTRAC_SPECIFIC):
-            sensor_size = EncodeEchotracSpecific(p, &ping->sensor_data);
-            break;
-
-        case (GSF_SINGLE_BEAM_SUBRECORD_BATHY2000_SPECIFIC):
-            sensor_size = EncodeEchotracSpecific(p, &ping->sensor_data);
-            break;
-
-        case (GSF_SINGLE_BEAM_SUBRECORD_MGD77_SPECIFIC):
-            sensor_size = EncodeMGD77Specific(p, &ping->sensor_data);
-            break;
-
-        case (GSF_SINGLE_BEAM_SUBRECORD_BDB_SPECIFIC):
-            sensor_size = EncodeBDBSpecific(p, &ping->sensor_data);
-            break;
-
-        case (GSF_SINGLE_BEAM_SUBRECORD_NOSHDB_SPECIFIC):
-            sensor_size = EncodeNOSHDBSpecific(p, &ping->sensor_data);
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_UNKNOWN):
-            sensor_size = 0;
-            break;
-
-          default:
-            gsfError = GSF_UNRECOGNIZED_SENSOR_ID;
-            return (-1);
-    }
-
-    /*  Identifier has sensor specific id in first byte, and size in the
-    *  remaining three bytes
-    */
-    ltemp = ping->sensor_id << 24;
-    ltemp |= (gsfuLong) sensor_size;
-    ltemp = htonl(ltemp);
-    memcpy(temp_ptr, &ltemp, 4);
-    p += sensor_size;
-
-    /* Return the number of byte written into the buffer */
-
-    return (p - sptr);
-}
-
-/********************************************************************
- *
- * Function Name : gsfEncodeSwathBathymetryPing
- *
- * Description : This function encodes a gsf swath bathymetry ping record
- *  in external byte stream form from a gsfSwathBathyPing structure.
- *
- * Inputs :
- *    sptr = a pointer to the unsigned char buffer to write into
- *    ping = a pointer to the gsfSwathBathPing record to read from
- *    handle = an integer handle to the gsf data file, used to track the
- *             number of beams.
- *    ft = a pointer to the gsfFileTable, where the scale factors are
- *         maintained.
- *
- * Returns :
- *  This function returns the number of bytes encoded if successful, or
- *  -1 if an error occured.
- *
- * Error Conditions :
- *    GSF_UNRECOGNIZED_SENSOR_ID
- *
- ********************************************************************/
-int
-gsfEncodeSwathBathymetryPing(unsigned char *sptr, gsfSwathBathyPing * ping, GSF_FILE_TABLE *ft, int handle)
-{
-    gsfuLong        ltemp;
-    gsfuShort       stemp;
-    int             sensor_size = 0;
-    int             ret;
-    double          dtemp;
-    unsigned char  *p = sptr;
-    unsigned char  *temp_ptr;
-
-    /* First 8 bytes contain the time */
-    ltemp = htonl(ping->ping_time.tv_sec);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    ltemp = htonl(ping->ping_time.tv_nsec);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* Next four byte integer contains the longitude. Round the scaled
-     * quantity to the nearest whole integer.
-     */
-    dtemp = ping->longitude * 1.0e7;
-    if (dtemp < 0.0)
-    {
-        dtemp -= 0.501;
-    }
-    else
-    {
-        dtemp += 0.501;
-    }
-    ltemp = htonl((gsfsLong) dtemp);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* Next four byte integer contains the latitude. Round the scaled
-     * quantity to the nearest whole integer.
-     */
-    dtemp = ping->latitude * 1.0e7;
-    if (dtemp < 0.0)
-    {
-        dtemp -= 0.501;
-    }
-    else
-    {
-        dtemp += 0.501;
-    }
-    ltemp = htonl((gsfsLong) dtemp);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* Next two byte integer contains the number of beams */
-    if (ping->number_beams <= 0)
-    {
-        gsfError = GSF_INVALID_NUM_BEAMS;
-        return(-1);
-    }
-    stemp = htons(ping->number_beams);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next two byte integer contains the center beam number, portmost
-    *  outer beam is beam number 1.
-    */
-    stemp = htons(ping->center_beam);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next two byte integer contains the ping flags field */
-    stemp = htons(ping->ping_flags);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next two byte integer is a reserved field */
-    stemp = htons(ping->reserved);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next two byte integer contains the tide corrector for this ping.
-     * Round this to the nearest whole centimeter.
-     */
-    dtemp = ping->tide_corrector * 100.0;
-    if (dtemp < 0.0)
-    {
-        dtemp -= 0.501;
-    }
-    else
-    {
-        dtemp += 0.501;
-    }
-    stemp = htons((gsfsShort) dtemp);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next four byte integer contains the depth corrector.
-     * Round this to the nearest whole centimeter.
-     */
-    dtemp = ping->depth_corrector * 100.0;
-    if (dtemp < 0.0)
-    {
-        dtemp -= 0.501;
-    }
-    else
-    {
-        dtemp += 0.501;
-    }
-    ltemp = htonl((gsfsLong) dtemp);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* Next two byte integer contains the ship heading, round this value to the
-     * nearest one hundredth of a degree. (Heading is always a positive value)
-     */
-    stemp = htons((gsfuShort) ((ping->heading * 100.0) + 0.501));
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next two byte integer contains the pitch. Round the scaled quantity
-     * to the nearest whole integer.
-     */
-    dtemp = ping->pitch * 100.0;
-    if (dtemp < 0.0)
-    {
-        dtemp -= 0.501;
-    }
-    else
-    {
-        dtemp += 0.501;
-    }
-    stemp = htons((gsfsShort) dtemp);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next two byte integer contains the roll. Round the scaled quantity
-     * to the nearest whole integer.
-     */
-    dtemp = ping->roll * 100.0;
-    if (dtemp < 0.0)
-    {
-        dtemp -= 0.501;
-    }
-    else
-    {
-        dtemp += 0.501;
-    }
-    stemp = htons((gsfsShort) dtemp);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next two byte integer contains the heave. Round the scaled quantity
-     * to the nearest whole integer.
-     */
-    dtemp = ping->heave * 100.0;
-    if (dtemp < 0.0)
-    {
-        dtemp -= 0.501;
-    }
-    else
-    {
-        dtemp += 0.501;
-    }
-    stemp = htons((gsfsShort) dtemp);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next two byte integer contains the course, round this value to the
-     * nearest one hundredth of a degree. (Course is always a positive value)
-     */
-    stemp = htons((gsfuShort) ((ping->course * 100.0) + 0.501));
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next two byte integer contains the speed. Round the scaled quantity
-     * to the nearest integer. (Speed is always a positive quantity)
-     */
-    stemp = htons((gsfuShort) ((ping->speed * 100.0) + 0.501));
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    if (ft->major_version_number > 2)
-    {
-        /* Next four byte integer contains the height. Round the scaled quantity
-         * to the nearest whole integer.
-         */
-        dtemp = ping->height * 1000.0;
-        if (dtemp < 0.0)
-        {
-            dtemp -= 0.501;
-        }
-        else
-        {
-            dtemp += 0.501;
-        }
-        ltemp = htonl((gsfsLong) dtemp);
-        memcpy(p, &ltemp, 4);
-        p += 4;
-
-        /* Next four byte integer contains the SEP. Round the scaled quantity
-         * to the nearest whole integer.
-         */
-        dtemp = ping->sep * 1000.0;
-        if (dtemp < 0.0)
-        {
-            dtemp -= 0.501;
-        }
-        else
-        {
-            dtemp += 0.501;
-        }
-        ltemp = htonl((gsfsLong) dtemp);
-        memcpy(p, &ltemp, 4);
-        p += 4;
-
-        /* Next four byte integer contains the GPS tide corrector for this ping.
-         * Round this to the nearest whole millimeter.
-         */
-        dtemp = ping->gps_tide_corrector * 1000.0;
-        if (dtemp < 0.0)
-        {
-            dtemp -= 0.501;
-        }
-        else
-        {
-            dtemp += 0.501;
-        }
-        ltemp = htonl((gsfsLong) dtemp);
-        memcpy(p, &ltemp, 4);
-        p += 4;
-
-        /* Next two bytes are spare space */
-        memset (p, 0, (size_t) 2);
-        p += 2;
-    }
-
-    /* The first possible subrecord is the scale factors.  The scale factor
-     * record is encoded for writing to the file once at the beginning of the
-     * file, and again whenever the scale factors change.
-     */
-    if ((memcmp(&ft->rec.mb_ping.scaleFactors, &ping->scaleFactors, sizeof(gsfScaleFactors))) ||
-        (ft->scales_read))
-    {
-        memcpy(&ft->rec.mb_ping.scaleFactors, &ping->scaleFactors, sizeof(gsfScaleFactors));
-        ret = EncodeScaleFactors(p, &ping->scaleFactors);
-        if (ret <= 0)
-        {
-            return(-1);
-        }
-        p += ret;
-        /* scales_read is set in gsfOpen if the file is opened create to ensure that scale factors
-         * are written with the first ping of each file. Clear scales_read here.
-         */
-        ft->scales_read = 0;
-    }
-
-    /* Next possible subrecord is the depth array.  For this array to be
-     * encoded there must be data, and a scale factor.
-     */
-    if (ping->depth != (double *) NULL)
-    {
-        switch (ft->rec.mb_ping.scaleFactors.scaleTable[GSF_SWATH_BATHY_SUBRECORD_DEPTH_ARRAY - 1].compressionFlag & 0xF0)
-        {
-            default:
-            case GSF_FIELD_SIZE_DEFAULT:
-            case GSF_FIELD_SIZE_TWO:
-                ret = EncodeTwoByteArray(p, ping->depth, ping->number_beams, &ping->scaleFactors, GSF_SWATH_BATHY_SUBRECORD_DEPTH_ARRAY);
-                break;
-
-            case GSF_FIELD_SIZE_FOUR:
-                ret = EncodeFourByteArray(p, ping->depth, ping->number_beams, &ping->scaleFactors, GSF_SWATH_BATHY_SUBRECORD_DEPTH_ARRAY);
-                break;
-        }
-        if (ret <= 0)
-        {
-            return (-1);
-        }
-        p += ret;
-    }
-
-    /* Next possible subrecord is the nominal depth array.  For this array
-     * to be encoded there must be data, and a scale factor.
-     */
-    if (ping->nominal_depth != (double *) NULL)
-    {
-        switch (ft->rec.mb_ping.scaleFactors.scaleTable[GSF_SWATH_BATHY_SUBRECORD_NOMINAL_DEPTH_ARRAY - 1].compressionFlag & 0xF0)
-        {
-            default:
-            case GSF_FIELD_SIZE_DEFAULT:
-            case GSF_FIELD_SIZE_TWO:
-                ret = EncodeTwoByteArray(p, ping->nominal_depth, ping->number_beams, &ping->scaleFactors, GSF_SWATH_BATHY_SUBRECORD_NOMINAL_DEPTH_ARRAY);
-                break;
-
-            case GSF_FIELD_SIZE_FOUR:
-                ret = EncodeFourByteArray(p, ping->nominal_depth, ping->number_beams, &ping->scaleFactors, GSF_SWATH_BATHY_SUBRECORD_NOMINAL_DEPTH_ARRAY);
-                break;
-        }
-        if (ret <= 0)
-        {
-            return (-1);
-        }
-        p += ret;
-    }
-
-    /* Next possible subrecord is the across track distance array.  For this
-    * array to be encoded there must be data, and a scale factor.
-    */
-    if (ping->across_track != (double *) NULL)
-    {
-        switch (ft->rec.mb_ping.scaleFactors.scaleTable[GSF_SWATH_BATHY_SUBRECORD_ACROSS_TRACK_ARRAY - 1].compressionFlag & 0xF0)
-        {
-            default:
-            case GSF_FIELD_SIZE_DEFAULT:
-            case GSF_FIELD_SIZE_TWO:
-                ret = EncodeSignedTwoByteArray(p, ping->across_track, ping->number_beams, &ping->scaleFactors, GSF_SWATH_BATHY_SUBRECORD_ACROSS_TRACK_ARRAY);
-                break;
-
-            case GSF_FIELD_SIZE_FOUR:
-                ret = EncodeSignedFourByteArray(p, ping->across_track, ping->number_beams, &ping->scaleFactors, GSF_SWATH_BATHY_SUBRECORD_ACROSS_TRACK_ARRAY);
-                break;
-        }
-        if (ret <= 0)
-        {
-            return (-1);
-        }
-        p += ret;
-    }
-
-    /* Next possible subrecord is the along track distance array.  For this
-    * array to be encoded there must be data, and a scale factor.
-    */
-    if (ping->along_track != (double *) NULL)
-    {
-        switch (ft->rec.mb_ping.scaleFactors.scaleTable[GSF_SWATH_BATHY_SUBRECORD_ALONG_TRACK_ARRAY - 1].compressionFlag & 0xF0)
-        {
-            default:
-            case GSF_FIELD_SIZE_DEFAULT:
-            case GSF_FIELD_SIZE_TWO:
-                ret = EncodeSignedTwoByteArray(p, ping->along_track, ping->number_beams, &ping->scaleFactors, GSF_SWATH_BATHY_SUBRECORD_ALONG_TRACK_ARRAY);
-                break;
-
-            case GSF_FIELD_SIZE_FOUR:
-                ret = EncodeSignedFourByteArray(p, ping->along_track, ping->number_beams, &ping->scaleFactors, GSF_SWATH_BATHY_SUBRECORD_ALONG_TRACK_ARRAY);
-                break;
-        }
-        if (ret <= 0)
-        {
-            return (-1);
-        }
-        p += ret;
-    }
-
-    /* Next possible subrecord is the travel time array.  For this
-    * array to be encoded there must be data, and a scale factor.
-    */
-    if (ping->travel_time != (double *) NULL)
-    {
-        switch (ft->rec.mb_ping.scaleFactors.scaleTable[GSF_SWATH_BATHY_SUBRECORD_TRAVEL_TIME_ARRAY - 1].compressionFlag & 0xF0)
-        {
-            default:
-            case GSF_FIELD_SIZE_DEFAULT:
-            case GSF_FIELD_SIZE_TWO:
-                ret = EncodeTwoByteArray(p, ping->travel_time, ping->number_beams, &ping->scaleFactors, GSF_SWATH_BATHY_SUBRECORD_TRAVEL_TIME_ARRAY);
-                break;
-
-            case GSF_FIELD_SIZE_FOUR:
-                ret = EncodeFourByteArray(p, ping->travel_time, ping->number_beams, &ping->scaleFactors, GSF_SWATH_BATHY_SUBRECORD_TRAVEL_TIME_ARRAY);
-                break;
-        }
-        if (ret <= 0)
-        {
-            return (-1);
-        }
-        p += ret;
-    }
-
-    /* Next possible subrecord is the beam angle array. For this
-    * array to be encoded there must be data, and a scale factor.
-    */
-    if (ping->beam_angle != (double *) NULL)
-    {
-        ret = EncodeSignedTwoByteArray(p, ping->beam_angle, ping->number_beams,
-            &ping->scaleFactors, GSF_SWATH_BATHY_SUBRECORD_BEAM_ANGLE_ARRAY);
-        if (ret <= 0)
-        {
-            return (-1);
-        }
-        p += ret;
-    }
-
-    /* Next possible subrecord is the mean, calibrated amplitude array. For
-    * this array to be encoded there must be data, and a scale factor.
-    */
-    if (ping->mc_amplitude != (double *) NULL)
-    {
-        switch (ft->rec.mb_ping.scaleFactors.scaleTable[GSF_SWATH_BATHY_SUBRECORD_MEAN_CAL_AMPLITUDE_ARRAY - 1].compressionFlag & 0xF0)
-        {
-            default:
-            case GSF_FIELD_SIZE_DEFAULT:
-            case GSF_FIELD_SIZE_ONE:
-                ret = EncodeSignedByteArray(p, ping->mc_amplitude, ping->number_beams, &ping->scaleFactors, GSF_SWATH_BATHY_SUBRECORD_MEAN_CAL_AMPLITUDE_ARRAY);
-                break;
-
-            case GSF_FIELD_SIZE_TWO:
-                ret = EncodeSignedTwoByteArray(p, ping->mc_amplitude, ping->number_beams, &ping->scaleFactors, GSF_SWATH_BATHY_SUBRECORD_MEAN_CAL_AMPLITUDE_ARRAY);
-                break;
-        }
-        if (ret <= 0)
-        {
-            return (-1);
-        }
-        p += ret;
-    }
-
-    /* Next possible subrecord is the mean, relative amplitude array.  For
-    * this array to be encoded there must be data, and a scale factor.
-    */
-    if (ping->mr_amplitude != (double *) NULL)
-    {
-        switch (ft->rec.mb_ping.scaleFactors.scaleTable[GSF_SWATH_BATHY_SUBRECORD_MEAN_REL_AMPLITUDE_ARRAY - 1].compressionFlag & 0xF0)
-        {
-            default:
-            case GSF_FIELD_SIZE_DEFAULT:
-            case GSF_FIELD_SIZE_ONE:
-                ret = EncodeByteArray(p, ping->mr_amplitude, ping->number_beams, &ping->scaleFactors, GSF_SWATH_BATHY_SUBRECORD_MEAN_REL_AMPLITUDE_ARRAY);
-                break;
-
-            case GSF_FIELD_SIZE_TWO:
-                ret = EncodeTwoByteArray(p, ping->mr_amplitude, ping->number_beams, &ping->scaleFactors, GSF_SWATH_BATHY_SUBRECORD_MEAN_REL_AMPLITUDE_ARRAY);
-                break;
-        }
-
-        if (ret <= 0)
-        {
-            return (-1);
-        }
-        p += ret;
-    }
-
-    /* Next possible subrecord is the echo width array. For this
-    * array to be encoded there must be data, and a scale factor.
-    */
-    if (ping->echo_width != (double *) NULL)
-    {
-        switch (ft->rec.mb_ping.scaleFactors.scaleTable[GSF_SWATH_BATHY_SUBRECORD_ECHO_WIDTH_ARRAY - 1].compressionFlag & 0xF0)
-        {
-            default:
-            case GSF_FIELD_SIZE_DEFAULT:
-            case GSF_FIELD_SIZE_ONE:
-                ret = EncodeByteArray(p, ping->echo_width, ping->number_beams, &ping->scaleFactors, GSF_SWATH_BATHY_SUBRECORD_ECHO_WIDTH_ARRAY);
-                break;
-
-            case GSF_FIELD_SIZE_TWO:
-                ret = EncodeTwoByteArray(p, ping->echo_width, ping->number_beams, &ping->scaleFactors, GSF_SWATH_BATHY_SUBRECORD_ECHO_WIDTH_ARRAY);
-                break;
-        }
-
-        if (ret <= 0)
-        {
-            return (-1);
-        }
-        p += ret;
-    }
-
-    /* Next possible subrecord is the quality factor array.  For this
-    * array to be encoded there must be data, and a scale factor.
-    */
-    if (ping->quality_factor != (double *) NULL)
-    {
-        ret = EncodeByteArray(p, ping->quality_factor, ping->number_beams,
-            &ping->scaleFactors, GSF_SWATH_BATHY_SUBRECORD_QUALITY_FACTOR_ARRAY);
-        if (ret <= 0)
-        {
-            return (-1);
-        }
-        p += ret;
-    }
-
-    /* Next possible subrecord is the array of ship heave at beam reception
-    * time. For this array to be encoded there must be data, and a scale factor.
-    */
-    if (ping->receive_heave != (double *) NULL)
-    {
-        ret = EncodeSignedByteArray(p, ping->receive_heave, ping->number_beams,
-            &ping->scaleFactors, GSF_SWATH_BATHY_SUBRECORD_RECEIVE_HEAVE_ARRAY);
-        if (ret <= 0)
-        {
-            return (-1);
-        }
-        p += ret;
-    }
-
-    /* Next possible subrecord is the array of estimated depth errors.
-    * For this array to be encoded there must be data, and a scale factor.
-    * jsb 10/19/98 This subrecord is obsolete, it is replaced with vertical_error.
-    */
-    if (ping->depth_error != (double *) NULL)
-    {
-        ret = EncodeTwoByteArray(p, ping->depth_error, ping->number_beams,
-            &ping->scaleFactors, GSF_SWATH_BATHY_SUBRECORD_DEPTH_ERROR_ARRAY);
-        if (ret <= 0)
-        {
-            return (-1);
-        }
-        p += ret;
-    }
-
-    /* Next possible subrecord is the array of estimated across track errors.
-    * For this array to be encoded there must be data, and a scale factor.
-    * jsb 10/19/98 This subrecord is obsolete, it is replaced with horizontal_error.
-    */
-    if (ping->across_track_error != (double *) NULL)
-    {
-        ret = EncodeTwoByteArray(p, ping->across_track_error, ping->number_beams,
-            &ping->scaleFactors, GSF_SWATH_BATHY_SUBRECORD_ACROSS_TRACK_ERROR_ARRAY);
-        if (ret <= 0)
-        {
-            return (-1);
-        }
-        p += ret;
-    }
-
-    /* Next possible subrecord is the array of estimated along track errors.
-    * For this array to be encoded there must be data, and a scale factor.
-    * jsb 10/19/98 This subrecord is obsolete, it is replaced with horizontal_error.
-    */
-    if (ping->along_track_error != (double *) NULL)
-    {
-        ret = EncodeTwoByteArray(p, ping->along_track_error, ping->number_beams,
-            &ping->scaleFactors, GSF_SWATH_BATHY_SUBRECORD_ALONG_TRACK_ERROR_ARRAY);
-        if (ret <= 0)
-        {
-            return (-1);
-        }
-        p += ret;
-    }
-
-    /* Next possible subrecord is the array of beam status flags */
-    if (ping->beam_flags != (unsigned char *) NULL)
-    {
-        ret = EncodeBeamFlagsArray(p, ping->beam_flags, ping->number_beams);
-        if (ret <= 0)
-        {
-            return (-1);
-        }
-        p += ret;
-    }
-
-    /* Next possible subrecord is the beam quality flags provided by the
-     * Reson SeaBat system.  There are two bits per beam.
-     */
-    if (ping->quality_flags != (unsigned char *) NULL)
-    {
-        ret = EncodeQualityFlagsArray(p, ping->quality_flags, ping->number_beams);
-        if (ret <= 0)
-        {
-            return (-1);
-        }
-        p += ret;
-    }
-
-    /* Next possible subrecord is the array of signal to noise ratios.
-    * For this array to be encoded there must be new data, and a scale factor.
-    */
-    if (ping->signal_to_noise != (double *) NULL)
-    {
-        ret = EncodeByteArray(p, ping->signal_to_noise, ping->number_beams,
-            &ping->scaleFactors, GSF_SWATH_BATHY_SUBRECORD_SIGNAL_TO_NOISE_ARRAY);
-        if (ret <= 0)
-        {
-            return (-1);
-        }
-        p += ret;
-    }
-
-    /* Next possible subrecord is the beam angle forward array. For this
-    * array to be encoded there must be data, and a scale factor.
-    */
-    if (ping->beam_angle_forward != (double *) NULL)
-    {
-        ret = EncodeTwoByteArray(p, ping->beam_angle_forward, ping->number_beams,
-            &ping->scaleFactors, GSF_SWATH_BATHY_SUBRECORD_BEAM_ANGLE_FORWARD_ARRAY);
-        if (ret <= 0)
-        {
-            return (-1);
-        }
-        p += ret;
-    }
-
-    /* Next possible subrecord is the array of estimated vertical errors.
-    * For this array to be encoded there must be data, and a scale factor.
-    */
-    if (ping->vertical_error != (double *) NULL)
-    {
-        ret = EncodeTwoByteArray(p, ping->vertical_error, ping->number_beams,
-            &ping->scaleFactors, GSF_SWATH_BATHY_SUBRECORD_VERTICAL_ERROR_ARRAY);
-        if (ret <= 0)
-        {
-            return (-1);
-        }
-        p += ret;
-    }
-
-
-    /* Next possible subrecord is the array of estimated horizontal errors.
-    * For this array to be encoded there must be data, and a scale factor.
-    */
-    if (ping->horizontal_error != (double *) NULL)
-    {
-        ret = EncodeTwoByteArray(p, ping->horizontal_error, ping->number_beams,
-            &ping->scaleFactors, GSF_SWATH_BATHY_SUBRECORD_HORIZONTAL_ERROR_ARRAY);
-        if (ret <= 0)
-        {
-            return (-1);
-        }
-        p += ret;
-    }
-
-    /* Next possible subrecord is the array of transmit sector numbers. */
-    if (ping->sector_number != (unsigned short *) NULL)
-    {
-        /* By default this array is coded as a one byte value */
-        ret = EncodeFromUnsignedShortToByteArray(p, ping->sector_number, ping->number_beams,
-            &ping->scaleFactors, GSF_SWATH_BATHY_SUBRECORD_SECTOR_NUMBER_ARRAY);
-        if (ret <= 0)
-        {
-            return (-1);
-        }
-        p += ret;
-    }
-
-    /* Next possible subrecord is the array of beam detection information values. */
-    if (ping->detection_info != (unsigned short *) NULL)
-    {
-        /* By default this array is coded as a one byte value */
-        ret = EncodeFromUnsignedShortToByteArray(p, ping->detection_info, ping->number_beams,
-            &ping->scaleFactors, GSF_SWATH_BATHY_SUBRECORD_DETECTION_INFO_ARRAY);
-        if (ret <= 0)
-        {
-            return (-1);
-        }
-        p += ret;
-    }
-
-    /* Next possible subrecord is the array of beam detection information values. */
-    if (ping->incident_beam_adj != (double *) NULL)
-    {
-        ret = EncodeSignedByteArray(p, ping->incident_beam_adj, ping->number_beams,
-            &ping->scaleFactors, GSF_SWATH_BATHY_SUBRECORD_INCIDENT_BEAM_ADJ_ARRAY);
-        if (ret <= 0)
-        {
-            return (-1);
-        }
-        p += ret;
-    }
-
-    /* Next possible subrecord is the array of data cleaning information received from the system. */
-    if (ping->system_cleaning != (unsigned short *) NULL)
-    {
-        /* By default this array is coded as a one byte value */
-        ret = EncodeFromUnsignedShortToByteArray(p, ping->system_cleaning, ping->number_beams,
-            &ping->scaleFactors, GSF_SWATH_BATHY_SUBRECORD_SYSTEM_CLEANING_ARRAY);
-        if (ret <= 0)
-        {
-            return (-1);
-        }
-        p += ret;
-    }
-
-    /* The next possible subrecord is the array of correction values used to correct the travel time array for Doppler for FM signals */
-    if (ping->doppler_corr != (double *) NULL)
-    {
-        ret = EncodeSignedByteArray(p, ping->doppler_corr, ping->number_beams,
-            &ping->scaleFactors, GSF_SWATH_BATHY_SUBRECORD_DOPPLER_CORRECTION_ARRAY);
-        if (ret <= 0)
-        {
-            return (-1);
-        }
-        p += ret;
-    }
-
-    /* The next possible subrecord is the array of vertical uncertainties provided by the sonar */
-    if (ping->sonar_vert_uncert != (double *) NULL)
-    {
-        ret = EncodeTwoByteArray(p, ping->sonar_vert_uncert, ping->number_beams,
-            &ping->scaleFactors, GSF_SWATH_BATHY_SUBRECORD_SONAR_VERT_UNCERT_ARRAY);
-        if (ret <= 0)
-        {
-            return (-1);
-        }
-        p += ret;
-    }
-
-    /* Next possible subrecord is the sensor specific subrecord. Save the
-    *  current pointer, and leave room for the four byte subrecord identifier.
-    */
-    temp_ptr = p;
-    p += 4;
-
-    switch (ping->sensor_id)
-    {
-        case (GSF_SWATH_BATHY_SUBRECORD_UNKNOWN):
-            sensor_size = 0;
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_SEABEAM_SPECIFIC):
-            sensor_size = EncodeSeabeamSpecific(p, &ping->sensor_data);
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_EM100_SPECIFIC):
-            sensor_size = EncodeEM100Specific(p, &ping->sensor_data);
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_EM12_SPECIFIC):
-            sensor_size = EncodeEM12Specific(p, &ping->sensor_data);
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_EM950_SPECIFIC):
-            sensor_size = EncodeEM950Specific(p, &ping->sensor_data);
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_EM121A_SPECIFIC):
-            sensor_size = EncodeEM121ASpecific(p, &ping->sensor_data);
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_EM121_SPECIFIC):
-            sensor_size = EncodeEM121Specific(p, &ping->sensor_data);
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_SASS_SPECIFIC):
-            sensor_size = EncodeSASSSpecific(p, &ping->sensor_data);
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_SEAMAP_SPECIFIC):
-            sensor_size = EncodeSeaMapSpecific(p, &ping->sensor_data, ft);
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_SEABAT_SPECIFIC):
-            sensor_size = EncodeSeaBatSpecific(p, &ping->sensor_data);
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_EM1000_SPECIFIC):
-            sensor_size = EncodeEM1000Specific(p, &ping->sensor_data);
-            break;
-
-            #if 1
-            /* 3-30-99 wkm: obsolete */
-        case (GSF_SWATH_BATHY_SUBRECORD_TYPEIII_SEABEAM_SPECIFIC):
-            sensor_size = EncodeTypeIIISeaBeamSpecific(p, &ping->sensor_data);
-            break;
-            #endif
-
-        case (GSF_SWATH_BATHY_SUBRECORD_SB_AMP_SPECIFIC):
-            sensor_size = EncodeSBAmpSpecific(p, &ping->sensor_data);
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_SEABAT_II_SPECIFIC):
-            sensor_size = EncodeSeaBatIISpecific(p, &ping->sensor_data);
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_SEABAT_8101_SPECIFIC):
-            sensor_size = EncodeSeaBat8101Specific(p, &ping->sensor_data);
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_SEABEAM_2112_SPECIFIC):
-            sensor_size = EncodeSeaBeam2112Specific(p, &ping->sensor_data);
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_ELAC_MKII_SPECIFIC):
-            sensor_size = EncodeElacMkIISpecific(p, &ping->sensor_data);
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_CMP_SASS_SPECIFIC):
-            sensor_size = EncodeCmpSassSpecific(p, &ping->sensor_data);
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_EM2000_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_EM3000_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_EM1002_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_EM300_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_EM120_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_EM3002_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_EM3000D_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_EM3002D_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_EM121A_SIS_SPECIFIC):
-            sensor_size = EncodeEM3Specific(p, &ping->sensor_data, ft);
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_EM2000_RAW_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_EM3000_RAW_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_EM1002_RAW_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_EM300_RAW_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_EM120_RAW_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_EM3002_RAW_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_EM3000D_RAW_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_EM3002D_RAW_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_EM121A_SIS_RAW_SPECIFIC):
-            sensor_size = EncodeEM3RawSpecific(p, &ping->sensor_data, ft);
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_RESON_8101_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_RESON_8111_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_RESON_8124_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_RESON_8125_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_RESON_8150_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_RESON_8160_SPECIFIC):
-            sensor_size = EncodeReson8100Specific(p, &ping->sensor_data);
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_RESON_7125_SPECIFIC):
-            sensor_size = EncodeReson7100Specific(p, &ping->sensor_data);
-            break;
-
-        case (GSF_SWATH_BATHY_SB_SUBRECORD_ECHOTRAC_SPECIFIC):
-            sensor_size = EncodeSBEchotracSpecific(p, &ping->sensor_data.gsfSBEchotracSpecific);
-            break;
-
-        case (GSF_SWATH_BATHY_SB_SUBRECORD_BATHY2000_SPECIFIC):
-            sensor_size = EncodeSBEchotracSpecific(p, &ping->sensor_data.gsfSBEchotracSpecific);
-            break;
-
-        case (GSF_SWATH_BATHY_SB_SUBRECORD_MGD77_SPECIFIC):
-            sensor_size = EncodeSBMGD77Specific(p, &ping->sensor_data.gsfSBMGD77Specific);
-            break;
-
-        case (GSF_SWATH_BATHY_SB_SUBRECORD_BDB_SPECIFIC):
-            sensor_size = EncodeSBBDBSpecific(p, &ping->sensor_data.gsfSBBDBSpecific);
-            break;
-
-        case (GSF_SWATH_BATHY_SB_SUBRECORD_NOSHDB_SPECIFIC):
-            sensor_size = EncodeSBNOSHDBSpecific(p, &ping->sensor_data.gsfSBNOSHDBSpecific);
-            break;
-
-        case (GSF_SWATH_BATHY_SB_SUBRECORD_PDD_SPECIFIC):
-            sensor_size = EncodeSBEchotracSpecific(p, &ping->sensor_data.gsfSBPDDSpecific);
-            break;
-
-        case (GSF_SWATH_BATHY_SB_SUBRECORD_NAVISOUND_SPECIFIC):
-            sensor_size = EncodeSBNavisoundSpecific(p, &ping->sensor_data.gsfSBNavisoundSpecific);
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_EM710_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_EM302_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_EM122_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_EM2040_SPECIFIC):
-            sensor_size = EncodeEM4Specific(p, &ping->sensor_data, ft);
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_GEOSWATH_PLUS_SPECIFIC):
-            sensor_size = EncodeGeoSwathPlusSpecific(p, &ping->sensor_data);
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_KLEIN_5410_BSS_SPECIFIC):
-            sensor_size = EncodeKlein5410BssSpecific(p, &ping->sensor_data);
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_DELTA_T_SPECIFIC):
-            sensor_size = EncodeDeltaTSpecific(p, &ping->sensor_data);
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_R2SONIC_2020_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_R2SONIC_2022_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_R2SONIC_2024_SPECIFIC):
-            sensor_size = EncodeR2SonicSpecific(p, &ping->sensor_data);
-            break;
-
-        default:
-            gsfError = GSF_UNRECOGNIZED_SENSOR_ID;
-            return (-1);
-    }
-
-   /*  Identifier has sensor specific id in first byte, and size in the
-    *  remaining three bytes
-    */
-    ltemp = ping->sensor_id << 24;
-    ltemp |= (gsfuLong) sensor_size;
-    ltemp = htonl(ltemp);
-    memcpy(temp_ptr, &ltemp, 4);
-    p += sensor_size;
-
-    /* Next possible subrecord is the array of intensity series */
-    if (ping->brb_inten != (gsfBRBIntensity *) NULL)
-    {
-        ret = EncodeBRBIntensity(p, ping->brb_inten, ping->number_beams, ping->sensor_id, p-sptr-12);  /* 12 = GSF_FILL_SIZE_CHECKSUM */
-        if (ret <= 0)
-        {
-            return (-1);
-        }
-        p += ret;
-    }
-
-    /* Return the number of byte written into the buffer */
-
-    return (p - sptr);
-}
-
-/********************************************************************
- *
- * Function Name : EncodeScaleFacors
- *
- * Description : This function encodes the ping scale factor subrecord
- *  from internal form into external byte stream stream form.
- *
- * Inputs :
- *    sptr = a pointer to the unsigned char buffer to write into
- *    handle = the integer handle for the file being written to.
- *
- * Returns :
- *  This function returns the number of bytes encoded.
- *
- * Error Conditions :
- *  GSF_ILLEGAL_SCALE_FACTOR_MULTIPLIER
- ********************************************************************/
-
-static int
-EncodeScaleFactors(unsigned char *sptr, gsfScaleFactors *sf)
-{
-    unsigned char  *p = sptr;
-    gsfuLong        ltemp, subID;
-    double          dtemp;
-    unsigned int    subrecordID;
-    int             sf_counter;
-    unsigned int    itemp;
-
-    /* First byte contains the subrecord identifier */
-    ltemp = GSF_SWATH_BATHY_SUBRECORD_SCALE_FACTORS << 24;
-
-    /* Next four bytes contain the size of the subrecord, need to
-    * compute this value:
-    *  4 byte number of scale factors
-    * 12 bytes per number of scale factors
-    */
-    ltemp |= 4 + (12 * sf->numArraySubrecords);
-    subID = htonl(ltemp);
-    memcpy(p, &subID, 4);
-    p += 4;
-
-    /* Next four byte integer contains the number of scale factors */
-    ltemp = htonl((gsfuShort) (sf->numArraySubrecords));
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* Loop to encode each scale factor which has been defined.
-    * The loop counter i indexes through the known subrecord ids
-    */
-    sf_counter = 0;
-    for (subrecordID = 1; subrecordID <= GSF_MAX_PING_ARRAY_SUBRECORDS; subrecordID++)
-    {
-        itemp = (int) (sf->scaleTable[subrecordID - 1].multiplier + 0.001);
-        if ((itemp >= MIN_GSF_SF_MULT_VALUE) && (itemp <= MAX_GSF_SF_MULT_VALUE))
-        {
-            /* First four byte integer has the id in the first byte, the
-             *  compression flags in the second byte, and the two lower
-             *  order bytes are reserved
-             */
-            ltemp = ((gsfuLong) subrecordID) << 24;     /* ID = loop counter */
-            ltemp |= (((gsfuLong) (sf->scaleTable[subrecordID - 1].compressionFlag)) << 16);
-
-            ltemp = htonl(ltemp);
-
-            memcpy(p, &ltemp, 4);
-            p += 4;
-
-            /* encode the scale factor multiplier */
-            dtemp = sf->scaleTable[subrecordID - 1].multiplier;
-            ltemp = htonl((gsfsLong) dtemp);
-            memcpy(p, &ltemp, 4);
-            p += 4;
-
-            /* encode the scale factor offset */
-            ltemp = htonl((gsfsLong) (sf->scaleTable[subrecordID - 1].offset));
-            memcpy(p, &ltemp, 4);
-            p += 4;
-
-            sf_counter++;
-        }
-    }
-
-    /* Make sure that we encoded the expected number of array subrecords. If not return an error condition */
-    if (sf_counter != sf->numArraySubrecords)
-    {
-        gsfError = GSF_ILLEGAL_SCALE_FACTOR_MULTIPLIER;
-        return (-1);
-    }
-
-    return (p - sptr);
-}
-
-/********************************************************************
- *
- * Function Name : EncodeTwoByteArray
- *
- * Description : This function encodes a two byte beam array subrecord
- *  from internal form to external byte stream form.
- *
- * Inputs :
- *    sptr = a pointer to the unsigned char buffer to write to
- *    array = a pointer to the array of doubles from which to read
- *    num_beams = the integer number of beams (number of doubles in the array)
- *    sf = a pointer to the gsf scale factors used to scale the data
- *    id = the array subrecord id
- *
- * Returns :
- *  This function returns the number of bytes encoded if successful, or
- *  -1 if an error occured.
- *
- * Error Conditions :
- *    GSF_ILLEGAL_SCALE_FACTOR_MULTIPLIER
- *    GSF_INVALID_NUM_BEAMS
- *
- ********************************************************************/
-
-static int
-EncodeTwoByteArray(unsigned char *sptr, double *array, int num_beams,
-    gsfScaleFactors *sf, int id)
-{
-    unsigned char  *ptr = sptr;
-    gsfuLong        ltemp;
-    gsfuShort       stemp1;
-    gsfuShort       stemp2;
-    double         *dptr;
-    double          dtemp;
-    int             i;
-
-
-    /* Make sure we have a multiplier for this array */
-    if (sf->scaleTable[id - 1].multiplier < 1.0e-6)
-    {
-        gsfError = GSF_ILLEGAL_SCALE_FACTOR_MULTIPLIER;
-        return (-1);
-    }
-
-    if (num_beams <= 0)
-    {
-        gsfError = GSF_INVALID_NUM_BEAMS;
-        return(-1);
-    }
-
-    /* subrecord identifier has array id in first byte, and size in the
-    *  remaining three bytes
-    */
-    ltemp = id << 24;
-    ltemp |= num_beams * 2;
-    ltemp = htonl(ltemp);
-    memcpy(ptr, &ltemp, 4);
-    ptr += 4;
-
-    dptr = array;
-    for (i = 0; i < num_beams; i++)
-    {
-        dtemp = ((*dptr) + sf->scaleTable[id - 1].offset) *
-            sf->scaleTable[id - 1].multiplier;
-
-        /* Make sure we round to the nearest whole integer */
-        if (dtemp >= 0.0)
-        {
-            dtemp += 0.501;
-        }
-        else
-        {
-            dtemp -= 0.501;
-        }
-        stemp1 = (gsfuShort) dtemp;
-        stemp2 = htons(stemp1);
-        memcpy(ptr, &stemp2, 2);
-        ptr += 2;
-        dptr++;
-    }
-    return (ptr - sptr);
-}
-
-/********************************************************************
- *
- * Function Name : EncodeSignedTwoByteArray
- *
- * Description : This function encodes a two byte beam array subrecord
- *  from internal form to external byte stream form.
- *
- * Inputs :
- *    sptr = a pointer to the unsigned char buffer to write to
- *    array = a pointer to the array of doubles from which to read
- *    num_beams = the integer number of beams (number of doubles in the array)
- *    sf = a pointer to the gsf scale factors used to scale the data
- *    id = the array subrecord id
- *
- * Returns :
- *  This function returns the number of bytes encoded if successful, or
- *  -1 if an error occured.
- *
- * Error Conditions :
- *    GSF_ILLEGAL_SCALE_FACTOR_MULTIPLIER
- *    GSF_INVALID_NUM_BEAMS
- *
- ********************************************************************/
-
-static int
-EncodeSignedTwoByteArray(unsigned char *sptr, double *array, int num_beams,
-    gsfScaleFactors *sf, int id)
-{
-    unsigned char  *ptr = sptr;
-    gsfuLong        ltemp;
-    gsfsShort       stemp1;
-    gsfsShort       stemp2;
-    double         *dptr;
-    double          dtemp;
-    int             i;
-
-
-    /* Make sure we have a multiplier for this array */
-    if (sf->scaleTable[id - 1].multiplier < 1.0e-6)
-    {
-        gsfError = GSF_ILLEGAL_SCALE_FACTOR_MULTIPLIER;
-        return (-1);
-    }
-
-    if (num_beams <= 0)
-    {
-        gsfError = GSF_INVALID_NUM_BEAMS;
-        return(-1);
-    }
-
-    /* subrecord identifier has array id in first byte, and size in the
-    *  remaining three bytes
-    */
-    ltemp = id << 24;
-    ltemp |= num_beams * 2;
-    ltemp = htonl(ltemp);
-    memcpy(ptr, &ltemp, 4);
-    ptr += 4;
-
-    dptr = array;
-    for (i = 0; i < num_beams; i++)
-    {
-        dtemp = ((*dptr) + sf->scaleTable[id - 1].offset) *
-            sf->scaleTable[id - 1].multiplier;
-
-        /* Make sure we round to the nearest whole integer */
-        if (dtemp >= 0.0)
-        {
-            dtemp += 0.501;
-        }
-        else
-        {
-            dtemp -= 0.501;
-        }
-        stemp1 = (gsfsShort) dtemp;
-        stemp2 = htons(stemp1);
-        memcpy(ptr, &stemp2, 2);
-        ptr += 2;
-        dptr++;
-    }
-    return (ptr - sptr);
-}
-
-/********************************************************************
- *
- * Function Name : EncodeFourByteArray
- *
- * Description : This function encodes a four byte beam array subrecord
- *  from internal form to external byte stream form.
- *
- * Inputs :
- *    sptr = a pointer to the unsigned char buffer to write to
- *    array = a pointer to the array of doubles from which to read
- *    num_beams = the integer number of beams (number of doubles in the array)
- *    sf = a pointer to the gsf scale factors used to scale the data
- *    id = the array subrecord id
- *
- * Returns :
- *  This function returns the number of bytes encoded if successful, or
- *  -1 if an error occured.
- *
- * Error Conditions :
- *    GSF_ILLEGAL_SCALE_FACTOR_MULTIPLIER
- *    GSF_INVALID_NUM_BEAMS
- *
- ********************************************************************/
-
-static int
-EncodeFourByteArray(unsigned char *sptr, double *array, int num_beams,
-    gsfScaleFactors *sf, int id)
-{
-    unsigned char  *ptr = sptr;
-    gsfuLong        ltemp;
-    gsfuLong        ltemp1;
-    gsfuLong        ltemp2;
-    double         *dptr;
-    double          dtemp;
-    int             i;
-
-
-    /* Make sure we have a multiplier for this array */
-    if (sf->scaleTable[id - 1].multiplier < 1.0e-6)
-    {
-        gsfError = GSF_ILLEGAL_SCALE_FACTOR_MULTIPLIER;
-        return (-1);
-    }
-
-    if (num_beams <= 0)
-    {
-        gsfError = GSF_INVALID_NUM_BEAMS;
-        return(-1);
-    }
-
-    /* subrecord identifier has array id in first byte, and size in the
-    *  remaining three bytes
-    */
-    ltemp = id << 24;
-    ltemp |= num_beams * 4;
-    ltemp = htonl(ltemp);
-    memcpy(ptr, &ltemp, 4);
-    ptr += 4;
-
-    dptr = array;
-    for (i = 0; i < num_beams; i++)
-    {
-        dtemp = ((*dptr) + sf->scaleTable[id - 1].offset) * sf->scaleTable[id - 1].multiplier;
-
-        /* Make sure we round to the nearest whole integer */
-        if (dtemp >= 0.0)
-        {
-            dtemp += 0.501;
-        }
-        else
-        {
-            dtemp -= 0.501;
-        }
-        ltemp1 = (gsfuLong) dtemp;
-        ltemp2 = htonl(ltemp1);
-        memcpy(ptr, &ltemp2, 4);
-        ptr += 4;
-        dptr++;
-    }
-    return (ptr - sptr);
-}
-
-/********************************************************************
- *
- * Function Name : EncodeSignedFourByteArray
- *
- * Description : This function encodes a two byte beam array subrecord
- *  from internal form to external byte stream form.
- *
- * Inputs :
- *    sptr = a pointer to the unsigned char buffer to write to
- *    array = a pointer to the array of doubles from which to read
- *    num_beams = the integer number of beams (number of doubles in the array)
- *    sf = a pointer to the gsf scale factors used to scale the data
- *    id = the array subrecord id
- *
- * Returns :
- *  This function returns the number of bytes encoded if successful, or
- *  -1 if an error occured.
- *
- * Error Conditions :
- *    GSF_ILLEGAL_SCALE_FACTOR_MULTIPLIER
- *    GSF_INVALID_NUM_BEAMS
- *
- ********************************************************************/
-
-static int
-EncodeSignedFourByteArray(unsigned char *sptr, double *array, int num_beams,
-    gsfScaleFactors *sf, int id)
-{
-    unsigned char  *ptr = sptr;
-    gsfuLong        ltemp;
-    gsfsLong        stemp1;
-    gsfsLong        stemp2;
-    double         *dptr;
-    double          dtemp;
-    int             i;
-
-
-    /* Make sure we have a multiplier for this array */
-    if (sf->scaleTable[id - 1].multiplier < 1.0e-6)
-    {
-        gsfError = GSF_ILLEGAL_SCALE_FACTOR_MULTIPLIER;
-        return (-1);
-    }
-
-    if (num_beams <= 0)
-    {
-        gsfError = GSF_INVALID_NUM_BEAMS;
-        return(-1);
-    }
-
-    /* subrecord identifier has array id in first byte, and size in the
-    *  remaining three bytes
-    */
-    ltemp = id << 24;
-    ltemp |= num_beams * 4;
-    ltemp = htonl(ltemp);
-    memcpy(ptr, &ltemp, 4);
-    ptr += 4;
-
-    dptr = array;
-    for (i = 0; i < num_beams; i++)
-    {
-        dtemp = ((*dptr) + sf->scaleTable[id - 1].offset) *
-            sf->scaleTable[id - 1].multiplier;
-
-        /* Make sure we round to the nearest whole integer */
-        if (dtemp >= 0.0)
-        {
-            dtemp += 0.501;
-        }
-        else
-        {
-            dtemp -= 0.501;
-        }
-        stemp1 = (gsfsLong) dtemp;
-        stemp2 = htonl(stemp1);
-        memcpy(ptr, &stemp2, 4);
-        ptr += 4;
-        dptr++;
-    }
-    return (ptr - sptr);
-}
-
-/********************************************************************
- *
- * Function Name : EncodeByteArray
- *
- * Description : This function encodes a byte beam array subrecord
- *  from internal form to external byte stream form.
- *
- * Inputs :
- *    sptr = a pointer to the unsigned char buffer to write to
- *    array = a pointer to the array of doubles from which to read
- *    num_beams = the integer number of beams (number of doubles in the array)
- *    sf = a pointer to the gsf scale factors used to scale the data
- *    id = the array subrecord id
- *
- * Returns :
- *  This function returns the number of bytes encoded if successful, or
- *  -1 if an error occured.
- *
- * Error Conditions :
- *    GSF_ILLEGAL_SCALE_FACTOR_MULTIPLIER
- *    GSF_INVALID_NUM_BEAMS
- *
- ********************************************************************/
-
-static int
-EncodeByteArray(unsigned char *sptr, double *array, int num_beams,
-    gsfScaleFactors * sf, int id)
-{
-    unsigned char  *ptr = sptr;
-    unsigned char   ctemp;
-    gsfuLong        ltemp;
-    double         *dptr;
-    double          dtemp;
-    int             i;
-
-
-    /* Make sure we have a multiplier for this array */
-    if (sf->scaleTable[id - 1].multiplier < 1.0e-6)
-    {
-        gsfError = GSF_ILLEGAL_SCALE_FACTOR_MULTIPLIER;
-        return (-1);
-    }
-
-    if (num_beams <= 0)
-    {
-        gsfError = GSF_INVALID_NUM_BEAMS;
-        return(-1);
-    }
-
-    /* subrecord identifier has array id in first byte, and size in the
-    *  remaining three bytes
-    */
-    ltemp = id << 24;
-    ltemp |= num_beams;
-    ltemp = htonl(ltemp);
-    memcpy(ptr, &ltemp, 4);
-    ptr += 4;
-
-    dptr = array;
-    for (i = 0; i < num_beams; i++)
-    {
-        dtemp = ((*dptr) + sf->scaleTable[id - 1].offset) *
-            sf->scaleTable[id - 1].multiplier;
-
-        /* Make sure we round to the nearest whole integer */
-        if (dtemp >= 0.0)
-        {
-            dtemp += 0.501;
-        }
-        else
-        {
-            dtemp -= 0.501;
-        }
-
-        ctemp = (unsigned char) dtemp;
-        memcpy(ptr, &ctemp, 1);
-        ptr++;
-        dptr++;
-    }
-    return (ptr - sptr);
-}
-
-/********************************************************************
- *
- * Function Name : EncodeSignedByteArray
- *
- * Description : This function encodes a byte beam array subrecord
- *  from internal form to external byte stream form.
- *
- * Inputs :
- *    sptr = a pointer to the unsigned char buffer to write to
- *    array = a pointer to the array of doubles from which to read
- *    num_beams = the integer number of beams (number of doubles in the array)
- *    sf = a pointer to the gsf scale factors used to scale the data
- *    id = the array subrecord id
- *
- * Returns :
- *  This function returns the number of bytes encoded if successful, or
- *  -1 if an error occured.
- *
- * Error Conditions :
- *    GSF_ILLEGAL_SCALE_FACTOR_MULTIPLIER
- *    GSF_INVALID_NUM_BEAMS
- *
- ********************************************************************/
-
-static int
-EncodeSignedByteArray (unsigned char *sptr, double *array, int num_beams, gsfScaleFactors * sf, int id)
-{
-    unsigned char  *ptr = sptr;
-    char   ctemp;
-    gsfuLong        ltemp;
-    double         *dptr;
-    double          dtemp;
-    int             i;
-
-
-    /* Make sure we have a multiplier for this array */
-    if (sf->scaleTable[id - 1].multiplier < 1.0e-6)
-    {
-        gsfError = GSF_ILLEGAL_SCALE_FACTOR_MULTIPLIER;
-        return (-1);
-    }
-
-    if (num_beams <= 0)
-    {
-        gsfError = GSF_INVALID_NUM_BEAMS;
-        return(-1);
-    }
-
-    /* subrecord identifier has array id in first byte, and size in the
-    *  remaining three bytes
-    */
-
-    ltemp = id << 24;
-    ltemp |= num_beams;
-    ltemp = htonl(ltemp);
-    memcpy(ptr, &ltemp, 4);
-    ptr += 4;
-
-    dptr = array;
-    for (i = 0; i < num_beams; i++)
-    {
-        dtemp = ((*dptr) + sf->scaleTable[id - 1].offset) * sf->scaleTable[id - 1].multiplier;
-
-        ctemp = (char) dtemp;
-        memcpy(ptr, &ctemp, 1);
-        ptr++;
-        dptr++;
-    }
-    return (ptr - sptr);
-}
-
-/********************************************************************
- *
- * Function Name : EncodeFromUnsignedShortToByteArray
- *
- * Description : This function encodes data from an unsigned short integer
- *  beam array into a subrecord packed as one byte values on the byte stream.
- *  Note that this function deliberately packs the unsigned short value
- *  from each element of the array into a single byte on the stream.
- *  Thus, the encoded dynamic range is 0 - 255.
- *
- * Inputs :
- *    sptr = a pointer to the unsigned char buffer to write to
- *    array = a pointer to the array of ints from which to read
- *    num_beams = the integer number of beams (number of doubles in the array)
- *    sf = a pointer to the gsf scale factors used to scale the data
- *    id = the array subrecord id
- *
- * Returns :
- *  This function returns the number of bytes encoded if successful, or
- *  -1 if an error occured.
- *
- * Error Conditions :
- *    GSF_ILLEGAL_SCALE_FACTOR_MULTIPLIER
- *    GSF_INVALID_NUM_BEAMS
- *
- ********************************************************************/
-
-static int
-EncodeFromUnsignedShortToByteArray(unsigned char *sptr, unsigned short *array, int num_beams, gsfScaleFactors *sf, int id)
-{
-    unsigned char  *ptr = sptr;
-    gsfuLong        ltemp;
-    unsigned short *dptr;
-    unsigned char   dtemp;
-    int             i;
-
-    /* Make sure we have a multiplier for this array */
-    if (sf->scaleTable[id - 1].multiplier < 1.0e-6)
-    {
-        gsfError = GSF_ILLEGAL_SCALE_FACTOR_MULTIPLIER;
-        return (-1);
-    }
-
-    if (num_beams <= 0)
-    {
-        gsfError = GSF_INVALID_NUM_BEAMS;
-        return(-1);
-    }
-
-    /* subrecord identifier has array id in first byte, and size in the
-     *  remaining three bytes
-     */
-    ltemp = id << 24;
-    ltemp |= num_beams;
-    ltemp = htonl(ltemp);
-    memcpy(ptr, &ltemp, 4);
-    ptr += 4;
-
-    dptr = array;
-    for (i = 0; i < num_beams; i++)
-    {
-        dtemp = ((*dptr) + sf->scaleTable[id - 1].offset) * sf->scaleTable[id - 1].multiplier;
-        *ptr = dtemp;
-        ptr++;
-        dptr++;
-    }
-    return (ptr - sptr);
-}
-
-/********************************************************************
- *
- * Function Name : EncodeBeamFlagsArray
- *
- * Description : This function encodes the array of beam flags from internal
- *  form to external byte stream form.
- *
- * Inputs :
- *    sptr = a pointer to the unsigned char buffer to write to
- *    array = a pointer to the unsigned char buffer to read from
- *    num_beams = an integer containing the number of beams (elements in array)
- *
- * Returns : This function returns the number of bytes encoded.
- *
- * Error Conditions :
- *     GSF_INVALID_NUM_BEAMS
- *
- ********************************************************************/
-
-static int
-EncodeBeamFlagsArray(unsigned char *sptr, unsigned char *array, int num_beams)
-{
-    unsigned char  *ptr = sptr;
-    gsfuLong        ltemp;
-    int             i;
-
-    if (num_beams <= 0)
-    {
-        gsfError = GSF_INVALID_NUM_BEAMS;
-        return(-1);
-    }
-
-    /* subrecord identifier has array id in first byte, and size in the
-    *  remaining three bytes
-    */
-    ltemp = GSF_SWATH_BATHY_SUBRECORD_BEAM_FLAGS_ARRAY << 24;
-    ltemp |= num_beams;
-    ltemp = htonl(ltemp);
-    memcpy(ptr, &ltemp, 4);
-    ptr += 4;
-
-    for (i = 0; i < num_beams; i++)
-    {
-        *ptr = array[i];
-        ptr++;
-    }
-
-    return (ptr - sptr);
-}
-
-/********************************************************************
- *
- * Function Name : EncodeQualityFlagsArray
- *
- * Description : This function encodes the array of beam detection
- *  quality flags for Reson SeaBat data from internal form to external
- *  byte stream form. This field only has two bits so it packed as two
- *  bits per beam.
- *
- * Inputs :
- *    sptr = a pointer to the unsigned char buffer to write to
- *    array = a pointer to the unsigned char buffer to read from
- *    num_beams = an integer containing the number of beams (elements in array)
- *
- * Returns : This function returns the number of bytes encoded.
- *
- * Error Conditions :
- *     GSF_INVALID_NUM_BEAMS
- *
- ********************************************************************/
-
-static int
-EncodeQualityFlagsArray(unsigned char *sptr, unsigned char *array, int num_beams)
-{
-    unsigned char  *ptr = sptr;
-    gsfuLong        ltemp;
-    int             i;
-    int             shift;
-
-    if (num_beams <= 0)
-    {
-        gsfError = GSF_INVALID_NUM_BEAMS;
-        return(-1);
-    }
-
-    /* Leave four bytes free for the subrecord id and size */
-    ptr += 4;
-
-    /* Pack the array values */
-    shift = 6;
-    *ptr = 0;
-    for (i = 0; i < num_beams; i++)
-    {
-        *ptr |= array[i] << shift;
-
-        if (shift == 0)
-        {
-            ptr++;
-            *ptr = 0;
-            shift = 6;
-        }
-        else
-        {
-            shift -= 2;
-        }
-    }
-
-
-    /*  If shift doesn't get reset to 6 then we have a number of beams that is not evenly divisible by 4.  The problem is that
-        we actually encoded part of another byte but we didn't increment the ptr.  */
-
-    if (shift != 6) ptr++;
-
-
-    /* subrecord identifier has array id in first byte, and size in the
-    *  remaining three bytes
-    */
-    ltemp = GSF_SWATH_BATHY_SUBRECORD_QUALITY_FLAGS_ARRAY << 24;
-    ltemp |= (ptr - sptr - 4);
-    ltemp = htonl(ltemp);
-    memcpy(sptr, &ltemp, 4);
-
-    return (ptr - sptr);
-}
-
-/********************************************************************
- *
- * Function Name : EncodeSeabeamSpecific
- *
- * Description : This function encodes the sensor specific data from
- *  a SeaBeam system into external byte stream form.
- *
- * Inputs :
- *    sptr = a pointer to an unsigned char to write into
- *    sdata = a pointer to a union of gsf sensor specific data
- *
- * Returns : This function returns the number of bytes encoded.
- *
- * Error Conditions : none
- *
- ********************************************************************/
-
-static int
-EncodeSeabeamSpecific(unsigned char *sptr, gsfSensorSpecific * sdata)
-{
-    gsfuShort       stemp;
-
-    stemp = htons((gsfuShort) sdata->gsfSeaBeamSpecific.EclipseTime);
-    memcpy(sptr, &stemp, 2);
-
-    return (2);
-}
-
-/********************************************************************
- *
- * Function Name : EncodeEM12Specific
- *
- * Description : Encodes the EM12 sensor specific data
- *
- * Inputs :
- *    sptr = a pointer to an unsigned char buffer to write into
- *    sdata = a pointer to a union of sensor specific data
- *
- * Returns : This function returns the number of bytes encoded.
- *
- * Error Conditions : none
- *
- ********************************************************************/
-static int
-EncodeEM12Specific(unsigned char *sptr, gsfSensorSpecific * sdata)
-{
-    unsigned char  *p = sptr;
-    gsfuShort       stemp;
-    double          dtemp;
-
-    /* First two byte integer contains the ping number */
-    stemp = htons((gsfuShort) (sdata->gsfEM12Specific.ping_number));
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next byte contains the resolution */
-    *p = (int) sdata->gsfEM12Specific.resolution;
-    p += 1;
-
-    /* Next byte contains the ping quality factor*/
-    *p = (int) sdata->gsfEM12Specific.ping_quality;
-    p += 1;
-
-    /* Next two byte integer contains the sound velocity * 10 */
-    dtemp = (sdata->gsfEM12Specific.sound_velocity * 10.0) + 0.501;
-    stemp = htons((gsfuShort) dtemp);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next byte contains the operational mode */
-    *p = (int) sdata->gsfEM12Specific.mode;
-    p += 1;
-
-    /* The next 32 bytes are spare space for future growth */
-    memset(p, 0, 32);
-    p += 32;
-
-    return (p - sptr);}
-
-/********************************************************************
- *
- * Function Name : EncodeEm100Specific
- *
- * Description : This function encodes the EM100 sensor specific information
- *  into external byte stream form.
- *
- * Inputs :
- *    sptr = a pointer to an unsigned char buffer to write into
- *    sdata = a pointer to a union of sensor specific data
- *
- * Returns : This function returns the number of bytes encoded.
- *
- * Error Conditions : none
- *
- ********************************************************************/
-
-static int
-EncodeEM100Specific(unsigned char *sptr, gsfSensorSpecific * sdata)
-{
-    unsigned char  *p = sptr;
-    gsfsShort       signed_short;
-    gsfuShort       stemp;
-    double dtemp;
-
-    /* First two byte integer contains the ship pitch */
-    dtemp = sdata->gsfEM100Specific.ship_pitch * 100.0;
-    if (dtemp < 0.0)
-    {
-        dtemp -= 0.501;
-    }
-    else
-    {
-        dtemp += 0.501;
-    }
-    signed_short = htons((gsfsShort) dtemp);
-    memcpy(p, &signed_short, 2);
-    p += 2;
-
-    /* Next two byte integer contains the transducer pitch */
-    dtemp = sdata->gsfEM100Specific.transducer_pitch * 100.0;
-    if (dtemp < 0.0)
-    {
-        dtemp -= 0.501;
-    }
-    else
-    {
-        dtemp += 0.501;
-    }
-    signed_short = htons((gsfsShort) dtemp);
-    memcpy(p, &signed_short, 2);
-    p += 2;
-
-    /* Next byte contains the sonar mode (from the em100 amplitude datagram) */
-    *p = sdata->gsfEM100Specific.mode;
-    p += 1;
-
-    /* Next byte contains the power (from the em100 amplitude datagram) */
-    *p = (char) sdata->gsfEM100Specific.power;
-    p += 1;
-
-    /* Next byte contains the attenuation (from the em100 amplitude datagram) */
-    *p = (char) sdata->gsfEM100Specific.attenuation;
-    p += 1;
-
-    /* Next byte contains the tvg (from the em100 amplitude datagram) */
-    *p = (char) sdata->gsfEM100Specific.tvg;
-    p += 1;
-
-    /* Next byte contains the pulse length from the em100 amplitude datagram) */
-    *p = (char) sdata->gsfEM100Specific.pulse_length;
-    p += 1;
-
-    /* Next two byte integer contains the counter from the em100
-    * amplitude datagram
-    */
-    stemp = htons((gsfuShort) (sdata->gsfEM100Specific.counter));
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    return (p - sptr);
-}
-
-/********************************************************************
- *
- * Function Name : EncodeEm950Specific
- *
- * Description :  This function encodes the EM950 sensor specific information
- *  into external byte stream form.
- *
- * Inputs :
- *    sptr = a pointer to an unsigned char buffer to write into
- *    sdata = a pointer to a union of sensor specific data
- *
- * Returns : This function returns the number of bytes encoded.
- *
- * Error Conditions : none
- *
- ********************************************************************/
-
-static int
-EncodeEM950Specific(unsigned char *sptr, gsfSensorSpecific * sdata)
-{
-    unsigned char  *p = sptr;
-    gsfuShort       stemp;
-    gsfsShort       signed_short;
-    double          dtemp;
-
-    /* First two byte integer contains the ping number */
-    stemp = htons((gsfuShort) (sdata->gsfEM950Specific.ping_number));
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next byte contains the sonar mode of operation */
-    *p = (unsigned char) sdata->gsfEM950Specific.mode;
-    p += 1;
-
-    /* Next byte contains the ping quality factor*/
-    *p = (unsigned char) sdata->gsfEM950Specific.ping_quality;
-    p += 1;
-
-    /* Next two byte integer contains the transducer pitch */
-    dtemp = sdata->gsfEM950Specific.ship_pitch * 100.0;
-    if (dtemp < 0.0)
-    {
-        dtemp -= 0.501;
-    }
-    else
-    {
-        dtemp += 0.501;
-    }
-    signed_short = htons((gsfsShort) dtemp);
-    memcpy(p, &signed_short, 2);
-    p += 2;
-
-    /* Next two byte integer contains the transducer pitch */
-    dtemp = sdata->gsfEM950Specific.transducer_pitch * 100.0;
-    if (dtemp < 0.0)
-    {
-        dtemp -= 0.501;
-    }
-    else
-    {
-        dtemp += 0.501;
-    }
-    signed_short = htons((gsfsShort) dtemp);
-    memcpy(p, &signed_short, 2);
-    p += 2;
-
-    /* Next two byte integer contains the sea surface sound speed * 10
-     */
-    dtemp = (sdata->gsfEM950Specific.surface_velocity * 10.0);
-    if (dtemp < 0.0)
-    {
-        dtemp -= 0.501;
-    }
-    else
-    {
-        dtemp += 0.501;
-    }
-    stemp = htons((gsfuShort) dtemp);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    return (p - sptr);
-}
-
-/********************************************************************
- *
- * Function Name : EncodeEm1000Specific
- *
- * Description :  This function encodes the EM1000 sensor specific information
- *  into external byte stream form.
- *
- * Inputs :
- *    sptr = a pointer to an unsigned char buffer to write into
- *    sdata = a pointer to a union of sensor specific data
- *
- * Returns : This function returns the number of bytes encoded.
- *
- * Error Conditions : none
- *
- ********************************************************************/
-
-static int
-EncodeEM1000Specific(unsigned char *sptr, gsfSensorSpecific * sdata)
-{
-    unsigned char  *p = sptr;
-    gsfuShort       stemp;
-    gsfsShort       signed_short;
-    double          dtemp;
-
-    /* First two byte integer contains the ping number */
-    stemp = htons((gsfuShort) (sdata->gsfEM1000Specific.ping_number));
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next byte contains the sonar mode of operation */
-    *p = (unsigned char) sdata->gsfEM1000Specific.mode;
-    p += 1;
-
-    /* Next byte contains the ping quality factor*/
-    *p = (unsigned char) sdata->gsfEM1000Specific.ping_quality;
-    p += 1;
-
-    /* Next two byte integer contains the transducer pitch */
-    dtemp = sdata->gsfEM1000Specific.ship_pitch * 100.0;
-    if (dtemp < 0.0)
-    {
-        dtemp -= 0.501;
-    }
-    else
-    {
-        dtemp += 0.501;
-    }
-    signed_short = htons((gsfsShort) dtemp);
-    memcpy(p, &signed_short, 2);
-    p += 2;
-
-    /* Next two byte integer contains the transducer pitch */
-    dtemp = sdata->gsfEM1000Specific.transducer_pitch * 100.0;
-    if (dtemp < 0.0)
-    {
-        dtemp -= 0.501;
-    }
-    else
-    {
-        dtemp += 0.501;
-    }
-    signed_short = htons((gsfsShort) dtemp);
-    memcpy(p, &signed_short, 2);
-    p += 2;
-
-    /* Next two byte integer contains the sea surface sound speed * 10 */
-    dtemp = (sdata->gsfEM1000Specific.surface_velocity * 10.0);
-    if (dtemp < 0.0)
-    {
-        dtemp -= 0.501;
-    }
-    else
-    {
-        dtemp += 0.501;
-    }
-    stemp = htons((gsfuShort) dtemp);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    return (p - sptr);
-}
-
-/********************************************************************
- *
- * Function Name : EncodeEm121ASpecific
- *
- * Description : This function encodes the EM121A sensor specific
- *  information into external byte stream form.
- *
- * Inputs :
- *    sptr = a pointer to an unsigned char buffer to write into
- *    sdata = a pointer to a union of sensor specific data
- *
- * Returns : This function returns the number of bytes encoded.
- *
- * Error Conditions : none
- *
- ********************************************************************/
-
-static int
-EncodeEM121ASpecific(unsigned char *sptr, gsfSensorSpecific *sdata)
-{
-    unsigned char  *p = sptr;
-    gsfuShort       stemp;
-    double          dtemp;
-
-    /* First two byte integer contains the ping number */
-    stemp = htons((gsfuShort) (sdata->gsfEM121ASpecific.ping_number));
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next byte contains the sonar mode of operation */
-    *p = (unsigned char) sdata->gsfEM121ASpecific.mode;
-    p += 1;
-
-    /* Next byte contains the number of valid beams */
-    *p = (unsigned char) sdata->gsfEM121ASpecific.valid_beams;
-    p += 1;
-
-    /* Next byte contains the transmit pulse length */
-    *p = (unsigned char) sdata->gsfEM121ASpecific.pulse_length;
-    p += 1;
-
-    /* Next byte contains the sonar beam width */
-    *p = (unsigned char) sdata->gsfEM121ASpecific.beam_width;
-    p += 1;
-
-    /* Next byte contains the transmit power level */
-    *p = (unsigned char) sdata->gsfEM121ASpecific.tx_power;
-    p += 1;
-
-    /* Next byte contains the number of transmit channels NOT working */
-    *p = (unsigned char) sdata->gsfEM121ASpecific.tx_status;
-    p += 1;
-
-    /* Next byte contains the number of receive channels NOT working */
-    *p = (unsigned char) sdata->gsfEM121ASpecific.rx_status;
-    p += 1;
-
-    /* Next two byte integer contains the sea surface sound speed * 10
-     */
-    dtemp = (sdata->gsfEM121ASpecific.surface_velocity * 10.0);
-    if (dtemp < 0.0)
-    {
-        dtemp -= 0.501;
-    }
-    else
-    {
-        dtemp += 0.501;
-    }
-    stemp = htons((gsfuShort) dtemp);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    return (p - sptr);
-}
-
-/********************************************************************
- *
- * Function Name : EncodeEm121Specific
- *
- * Description : This function encodes the EM121 sensor specific
- *  information into external byte stream form.
- *
- * Inputs :
- *    sptr = a pointer to an unsigned char buffer to write into
- *    sdata = a pointer to a union of sensor specific data
- *
- * Returns : This function returns the number of bytes encoded.
- *
- * Error Conditions : none
- *
- ********************************************************************/
-
-static int
-EncodeEM121Specific(unsigned char *sptr, gsfSensorSpecific *sdata)
-{
-    unsigned char  *p = sptr;
-    gsfuShort       stemp;
-    double          dtemp;
-
-    /* First two byte integer contains the ping number */
-    stemp = htons((gsfuShort) (sdata->gsfEM121Specific.ping_number));
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next byte contains the sonar mode of operation */
-    *p = (unsigned char) sdata->gsfEM121Specific.mode;
-    p += 1;
-
-    /* Next byte contains the number of valid beams */
-    *p = (unsigned char) sdata->gsfEM121Specific.valid_beams;
-    p += 1;
-
-    /* Next byte contains the transmit pulse length */
-    *p = (unsigned char) sdata->gsfEM121Specific.pulse_length;
-    p += 1;
-
-    /* Next byte contains the sonar beam width */
-    *p = (unsigned char) sdata->gsfEM121Specific.beam_width;
-    p += 1;
-
-    /* Next byte contains the transmit power level */
-    *p = (unsigned char) sdata->gsfEM121Specific.tx_power;
-    p += 1;
-
-    /* Next byte contains the number of transmit channels NOT working */
-    *p = (unsigned char) sdata->gsfEM121Specific.tx_status;
-    p += 1;
-
-    /* Next byte contains the number of receive channels NOT working */
-    *p = (unsigned char) sdata->gsfEM121Specific.rx_status;
-    p += 1;
-
-    /* Next two byte integer contains the sea surface sound speed * 10
-     */
-    dtemp = (sdata->gsfEM121Specific.surface_velocity * 10.0);
-    if (dtemp < 0.0)
-    {
-        dtemp -= 0.501;
-    }
-    else
-    {
-        dtemp += 0.501;
-    }
-    stemp = htons((gsfuShort) dtemp);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    return (p - sptr);
-}
-
-/********************************************************************
- *
- * Function Name : EncodeCmpSassSpecific
- *
- * Description : This function encodes the Compressed SASS
- *               specific data record to external byte stream format.
- *
- * Inputs :
- *    sptr = a pointer to an unsigned char buffer to write into
- *    sdata = a pointer to a union of sensor specific data
- *
- * Returns : This function returns the number of bytes encoded.
- *
- * Error Conditions : none
- *
- ********************************************************************/
-
-static int
-EncodeCmpSassSpecific(unsigned char *sptr, gsfSensorSpecific * sdata)
-{
-    unsigned char  *p = sptr;
-    gsfuShort       stemp;
-    double      dtemp;
-
-    dtemp = (sdata->gsfCmpSassSpecific.lfreq * 10.0);
-    if (dtemp < 0.0)
-    {
-        dtemp -= 0.501;
-    }
-    else
-    {
-        dtemp += 0.501;
-    }
-    stemp = htons((gsfuShort) dtemp);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    dtemp = (sdata->gsfCmpSassSpecific.lntens * 10.0);
-    if (dtemp < 0.0)
-    {
-        dtemp -= 0.501;
-    }
-    else
-    {
-        dtemp += 0.501;
-    }
-    stemp = htons((gsfuShort) dtemp);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    return (p - sptr);
-}
-
-#if 1
-/* 3-30-99 wkm: obsolete */
-/********************************************************************
- *
- * Function Name : EncodeSASSSpecific
- *
- * Description : This function encodes the Typeiii SASS
- *               specific data record to external byte stream format.
- *
- * Inputs :
- *    sptr = a pointer to an unsigned char buffer to write into
- *    sdata = a pointer to a union of sensor specific data
- *
- * Returns : This function returns the number of bytes encoded.
- *
- * Error Conditions : none
- *
- ********************************************************************/
-
-static int
-EncodeSASSSpecific(unsigned char *sptr, gsfSensorSpecific * sdata)
-{
-    unsigned char  *p = sptr;
-    gsfuShort       stemp;
-
-    /* First two byte integer contains the leftmost beam */
-    stemp = htons((gsfuShort) (sdata->gsfSASSSpecific.leftmost_beam));
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next two byte integer contains the rightmost beam */
-    stemp = htons((gsfuShort) (sdata->gsfSASSSpecific.rightmost_beam));
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next two byte integer contains the total number of beams */
-    stemp = htons((gsfuShort) (sdata->gsfSASSSpecific.total_beams));
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next two byte integer contains the navigation mode */
-    stemp = htons((gsfuShort) (sdata->gsfSASSSpecific.nav_mode));
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next two byte integer contains the ping number */
-    stemp = htons((gsfuShort) (sdata->gsfSASSSpecific.ping_number));
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next two byte integer contains the mission number */
-    stemp = htons((gsfuShort) (sdata->gsfSASSSpecific.mission_number));
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    return (p - sptr);
-}
-
-/********************************************************************
- *
- * Function Name : EncodeTypeIIISeaBeamSpecific
- *
- * Description : This function encodes the Type III Seabeam specific
- *               data record to external byte stream format.
- *
- * Inputs :
- *    sptr = a pointer to an unsigned char buffer to write into
- *    sdata = a pointer to a union of sensor specific data
- *
- * Returns : This function returns the number of bytes encoded.
- *
- * Error Conditions : none
- *
- ********************************************************************/
-
-static int
-EncodeTypeIIISeaBeamSpecific(unsigned char *sptr, gsfSensorSpecific * sdata)
-{
-    unsigned char  *p = sptr;
-    gsfuShort       stemp;
-
-    /* First two byte integer contains the leftmost beam */
-    stemp = htons((gsfuShort) (sdata->gsfTypeIIISeaBeamSpecific.leftmost_beam));
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next two byte integer contains the rightmost beam */
-    stemp = htons((gsfuShort)(sdata->gsfTypeIIISeaBeamSpecific.rightmost_beam));
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next two byte integer contains the total number of beams */
-    stemp = htons((gsfuShort)(sdata->gsfTypeIIISeaBeamSpecific.total_beams));
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next two byte integer contains the navigation mode */
-    stemp = htons((gsfuShort)(sdata->gsfTypeIIISeaBeamSpecific.nav_mode));
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next two byte integer contains the ping number */
-    stemp = htons((gsfuShort)(sdata->gsfTypeIIISeaBeamSpecific.ping_number));
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next two byte integer contains the mission number */
-    stemp = htons((gsfuShort)(sdata->gsfTypeIIISeaBeamSpecific.mission_number));
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    return (p - sptr);
-}
-#endif
-
-
-/********************************************************************
- *
- * Function Name : EncodeSeaMapSpecific
- *
- * Description : not implimented yet
- *
- * Inputs :
- *    sptr = a pointer to an unsigned char buffer to write into
- *    sdata = a pointer to a union of sensor specific data
- *
- * Returns : This function returns the number of bytes encoded.
- *
- * Error Conditions : none
- *
- ********************************************************************/
-
-static int
-EncodeSeaMapSpecific(unsigned char *sptr, gsfSensorSpecific * sdata, GSF_FILE_TABLE *ft)
-{
-    unsigned char  *p = sptr;
-    gsfuShort       stemp;
-    double          dtemp;
-
-    dtemp = (sdata->gsfSeamapSpecific.portTransmitter[0] * 10.0);
-    if (dtemp < 0.0)
-    {
-        dtemp -= 0.501;
-    }
-    else
-    {
-        dtemp += 0.501;
-    }
-    stemp = htons((gsfuShort) dtemp);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    dtemp = (sdata->gsfSeamapSpecific.portTransmitter[1] * 10.0);
-    if (dtemp < 0.0)
-    {
-        dtemp -= 0.501;
-    }
-    else
-    {
-        dtemp += 0.501;
-    }
-    stemp = htons((gsfuShort) dtemp);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    dtemp = (sdata->gsfSeamapSpecific.stbdTransmitter[0] * 10.0);
-    if (dtemp < 0.0)
-    {
-        dtemp -= 0.501;
-    }
-    else
-    {
-        dtemp += 0.501;
-    }
-    stemp = htons((gsfuShort) dtemp);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    dtemp = (sdata->gsfSeamapSpecific.stbdTransmitter[1] * 10.0);
-    if (dtemp < 0.0)
-    {
-        dtemp -= 0.501;
-    }
-    else
-    {
-        dtemp += 0.501;
-    }
-    stemp = htons((gsfuShort) dtemp);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    dtemp = (sdata->gsfSeamapSpecific.portGain * 10.0);
-    if (dtemp < 0.0)
-    {
-        dtemp -= 0.501;
-    }
-    else
-    {
-        dtemp += 0.501;
-    }
-    stemp = htons((gsfuShort) dtemp);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    dtemp = (sdata->gsfSeamapSpecific.stbdGain * 10.0);
-    if (dtemp < 0.0)
-    {
-        dtemp -= 0.501;
-    }
-    else
-    {
-        dtemp += 0.501;
-    }
-    stemp = htons((gsfuShort) dtemp);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    dtemp = (sdata->gsfSeamapSpecific.portPulseLength * 10.0);
-    if (dtemp < 0.0)
-    {
-        dtemp -= 0.501;
-    }
-    else
-    {
-        dtemp += 0.501;
-    }
-    stemp = htons((gsfuShort) dtemp);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    dtemp = (sdata->gsfSeamapSpecific.stbdPulseLength * 10.0);
-    if (dtemp < 0.0)
-    {
-        dtemp -= 0.501;
-    }
-    else
-    {
-        dtemp += 0.501;
-    }
-    stemp = htons((gsfuShort) dtemp);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    dtemp = (sdata->gsfSeamapSpecific.pressureDepth * 10.0);
-    if (dtemp < 0.0)
-    {
-        dtemp -= 0.501;
-    }
-    else
-    {
-        dtemp += 0.501;
-    }
-    stemp = htons((gsfuShort) dtemp);
-    memcpy(p, &stemp, 2);
-    /* JSB 11/08/2007; looks like the pointer increment for this field in the encode processing has been missing
-     *  since this code block was first written in GSFv1.03
-     */
-    if ((ft->major_version_number > 2) || ((ft->major_version_number == 2) && (ft->minor_version_number > 7)))
-    {
-        p += 2;
-    }
-
-    dtemp = (sdata->gsfSeamapSpecific.altitude * 10.0);
-    if (dtemp < 0.0)
-    {
-        dtemp -= 0.501;
-    }
-    else
-    {
-        dtemp += 0.501;
-    }
-    stemp = htons((gsfuShort) dtemp);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    dtemp = (sdata->gsfSeamapSpecific.temperature * 10.0);
-    if (dtemp < 0.0)
-    {
-        dtemp -= 0.501;
-    }
-    else
-    {
-        dtemp += 0.501;
-    }
-    stemp = htons((gsfuShort) dtemp);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    return (p - sptr);
-}
-
-/********************************************************************
- *
- * Function Name : EncodeSeaBatSpecific
- *
- * Description : This function encodes the Reson SeaBat sensor specific
- *  information into external byte stream form.
- *
- * Inputs :
- *    sptr = a pointer to an unsigned char buffer to write into
- *    sdata = a pointer to a union of sensor specific data
- *
- * Returns : This function returns the number of bytes encoded.
- *
- * Error Conditions : none
- *
- ********************************************************************/
-
-static int
-EncodeSeaBatSpecific(unsigned char *sptr, gsfSensorSpecific *sdata)
-{
-    unsigned char  *p = sptr;
-    gsfuShort       stemp;
-    double          dtemp;
-
-    /* First two byte integer contains the ping number */
-    stemp = htons((gsfuShort) sdata->gsfSeaBatSpecific.ping_number);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next two byte integer contains the sea surface sound speed * 10 */
-    dtemp = sdata->gsfSeaBatSpecific.surface_velocity * 10.0;
-    if (dtemp < 0.0)
-    {
-        dtemp -= 0.501;
-    }
-    else
-    {
-        dtemp += 0.501;
-    }
-    stemp = htons((gsfuShort) dtemp);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next byte contains the sonar mode of operation */
-    *p = (unsigned char) sdata->gsfSeaBatSpecific.mode;
-    p += 1;
-
-    /* Next byte contains the sonar mode setting for this ping */
-    *p = (unsigned char) sdata->gsfSeaBatSpecific.sonar_range;
-    p += 1;
-
-    /* Next byte contains the sonar transmit power for this ping */
-    *p = (unsigned char) sdata->gsfSeaBatSpecific.transmit_power;
-    p += 1;
-
-    /* Next byte contains the sonar receive gain for this setting */
-    *p = (unsigned char) sdata->gsfSeaBatSpecific.receive_gain;
-    p += 1;
-
-    return (p - sptr);
-}
-
-/********************************************************************
- *
- * Function Name : EncodeSBAmpSpecific
- *
- * Description : This function encodes the Sea Beam with amplitude
- *  sensor specific information into external byte stream form.
- *
- * Inputs :
- *    sptr = a pointer to an unsigned char buffer to write into
- *    sdata = a pointer to a union of sensor specific data
- *
- * Returns : This function returns the number of bytes encoded.
- *
- * Error Conditions : none
- *
- ********************************************************************/
-
-static int
-EncodeSBAmpSpecific(unsigned char *sptr, gsfSensorSpecific *sdata)
-{
-    unsigned char  *p = sptr;
-    gsfuLong        ltemp;
-    gsfuShort       stemp;
-
-    /* First byte contains the hour from the Eclipse */
-    *p = (unsigned char) sdata->gsfSBAmpSpecific.hour;
-    p += 1;
-
-    /* Next byte contains the minute from the Eclipse */
-    *p = (unsigned char) sdata->gsfSBAmpSpecific.minute;
-    p += 1;
-
-    /* Next byte contains the second from the Eclipse */
-    *p = (unsigned char) sdata->gsfSBAmpSpecific.second;
-    p += 1;
-
-    /* Next byte the hundredths of seconds from the Eclipse */
-    *p = (unsigned char) sdata->gsfSBAmpSpecific.hundredths;
-    p += 1;
-
-    /* Next four byte integer contains the block number */
-    ltemp = htonl((gsfuLong) sdata->gsfSBAmpSpecific.block_number);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* Next two byte integer contains the average gate depth */
-    stemp = htons((gsfuShort) sdata->gsfSBAmpSpecific.avg_gate_depth);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    return (p - sptr);
-}
-
-/********************************************************************
- *
- * Function Name : EncodeSeaBatIISpecific
- *
- * Description : This function encodes the Reson SeaBat II sensor specific
- *  information into external byte stream form.  The SeaBat II sensor
- *  specific data structure was defined to replace the gsfSeaBatSpecific
- *  data structure as of GSF version 1.04
- *
- * Inputs :
- *    sptr = a pointer to an unsigned char buffer to write into
- *    sdata = a pointer to a union of sensor specific data
- *
- * Returns : This function returns the number of bytes encoded.
- *
- * Error Conditions : none
- *
- ********************************************************************/
-
-static int
-EncodeSeaBatIISpecific(unsigned char *sptr, gsfSensorSpecific *sdata)
-{
-    unsigned char  *p = sptr;
-    gsfuShort       stemp;
-    double          dtemp;
-
-    /* First two byte integer contains the ping number */
-    stemp = htons((gsfuShort) sdata->gsfSeaBatIISpecific.ping_number);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next two byte integer contains the sea surface sound speed * 10 */
-    dtemp = sdata->gsfSeaBatIISpecific.surface_velocity * 10.0;
-    if (dtemp < 0.0)
-    {
-        dtemp -= 0.501;
-    }
-    else
-    {
-        dtemp += 0.501;
-    }
-    stemp = htons((gsfuShort) dtemp);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next two byte integer contains the sonar mode of operation */
-    stemp = htons((gsfuShort) sdata->gsfSeaBatIISpecific.mode);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next two byte integer contains the sonar range setting */
-    stemp = htons((gsfuShort) sdata->gsfSeaBatIISpecific.sonar_range);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next two byte integer contains the power setting */
-    stemp = htons((gsfuShort) sdata->gsfSeaBatIISpecific.transmit_power);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next two byte integer contains the gain setting */
-    stemp = htons((gsfuShort) sdata->gsfSeaBatIISpecific.receive_gain);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next byte contains the fore/aft beam width */
-    *p = (unsigned char) ((sdata->gsfSeaBatIISpecific.fore_aft_bw * 10.0) + 0.5);
-    p += 1;
-
-    /* Next byte contains the athwartships beam width */
-    *p = (unsigned char) ((sdata->gsfSeaBatIISpecific.athwart_bw * 10.0) + 0.5);
-    p += 1;
-
-    /* Next four bytes are reserved as spare space. */
-    *p = (unsigned char) (sdata->gsfSeaBatIISpecific.spare[0]);
-    p += 1;
-    *p = (unsigned char) (sdata->gsfSeaBatIISpecific.spare[1]);
-    p += 1;
-    *p = (unsigned char) (sdata->gsfSeaBatIISpecific.spare[2]);
-    p += 1;
-    *p = (unsigned char) (sdata->gsfSeaBatIISpecific.spare[3]);
-    p += 1;
-
-    return (p - sptr);
-}
-
-/********************************************************************
- *
- * Function Name : EncodeSeaBat8101Specific
- *
- * Description : This function encodes the Reson SeaBat 8101 sensor specific
- *  information into external byte stream form.
- *
- * Inputs :
- *    sptr = a pointer to an unsigned char buffer to write into
- *    sdata = a pointer to a union of sensor specific data
- *
- * Returns : This function returns the number of bytes encoded.
- *
- * Error Conditions : none
- *
- ********************************************************************/
-
-static int
-EncodeSeaBat8101Specific(unsigned char *sptr, gsfSensorSpecific *sdata)
-{
-    unsigned char  *p = sptr;
-    gsfuShort       stemp;
-    double          dtemp;
-
-    /* First two byte integer contains the ping number */
-    stemp = htons((gsfuShort) sdata->gsfSeaBat8101Specific.ping_number);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next two byte integer contains the sea surface sound speed * 10 */
-    dtemp = sdata->gsfSeaBat8101Specific.surface_velocity * 10.0;
-    if (dtemp < 0.0)
-    {
-        dtemp -= 0.501;
-    }
-    else
-    {
-        dtemp += 0.501;
-    }
-    stemp = htons((gsfuShort) dtemp);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next two byte integer contains the sonar mode of operation */
-    stemp = htons((gsfuShort) sdata->gsfSeaBat8101Specific.mode);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next two byte integer contains the sonar range setting */
-    stemp = htons((gsfuShort) sdata->gsfSeaBat8101Specific.range);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next two byte integer contains the power setting */
-    stemp = htons((gsfuShort) sdata->gsfSeaBat8101Specific.power);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next two byte integer contains the gain setting */
-    stemp = htons((gsfuShort) sdata->gsfSeaBat8101Specific.gain);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next two byte integer contains the pulse width, in microseconds */
-    stemp = htons((gsfuShort) sdata->gsfSeaBat8101Specific.pulse_width);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next byte contains the tvg spreading coefficient * 4 */
-    *p = (unsigned char) (sdata->gsfSeaBat8101Specific.tvg_spreading);
-    p += 1;
-
-    /* Next byte contains the tvg absorption coefficient */
-    *p = (unsigned char) (sdata->gsfSeaBat8101Specific.tvg_absorption);
-    p += 1;
-
-    /* Next byte contains the fore/aft beam width */
-    *p = (unsigned char) ((sdata->gsfSeaBat8101Specific.fore_aft_bw * 10.0) + 0.5);
-    p += 1;
-
-    /* Next byte contains the athwartships beam width */
-    *p = (unsigned char) ((sdata->gsfSeaBat8101Specific.athwart_bw * 10.0) + 0.5);
-    p += 1;
-
-    /* Next two byte integer is reserved for future use, to store the range filter min */
-    stemp = htons((gsfuShort) sdata->gsfSeaBat8101Specific.range_filt_min);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next two byte integer is reserved for future use, to store the range filter max */
-    stemp = htons((gsfuShort) sdata->gsfSeaBat8101Specific.range_filt_max);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next two byte integer is reserved for future use, to store the depth filter min */
-    stemp = htons((gsfuShort) sdata->gsfSeaBat8101Specific.depth_filt_min);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next two byte integer is reserved for future use, to store the depth filter max */
-    stemp = htons((gsfuShort) sdata->gsfSeaBat8101Specific.depth_filt_max);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next byte is reserved for future use, to store the projector type */
-    *p = (unsigned char) (sdata->gsfSeaBat8101Specific.projector);
-    p += 1;
-
-    /* Next four bytes are reserved as spare space. */
-    *p = (unsigned char) (sdata->gsfSeaBat8101Specific.spare[0]);
-    p += 1;
-    *p = (unsigned char) (sdata->gsfSeaBat8101Specific.spare[1]);
-    p += 1;
-    *p = (unsigned char) (sdata->gsfSeaBat8101Specific.spare[2]);
-    p += 1;
-    *p = (unsigned char) (sdata->gsfSeaBat8101Specific.spare[3]);
-    p += 1;
-
-    return (p - sptr);
-}
-
-/********************************************************************
- *
- * Function Name : EncodeSeaBeam2112Specific
- *
- * Description : This function encodes the Sea Beam 2112/36 sensor specific
- *  information into external byte stream form.
- *
- * Inputs :
- *    sptr = a pointer to an unsigned char buffer to write into
- *    sdata = a pointer to a union of sensor specific data
- *
- * Returns : This function returns the number of bytes encoded.
- *
- * Error Conditions : none
- *
- ********************************************************************/
-
-static int
-EncodeSeaBeam2112Specific(unsigned char *sptr, gsfSensorSpecific *sdata)
-{
-    unsigned char  *p = sptr;
-    gsfuShort       stemp;
-    double          dtemp;
-
-    /* First byte contains the sonar mode of operation */
-    *p = (unsigned char) (sdata->gsfSeaBeam2112Specific.mode);
-    p += 1;
-
-    /* Next two byte integer contains the surface sound velocity * 100 - 130000 */
-    dtemp = (sdata->gsfSeaBeam2112Specific.surface_velocity * 100.0) - 130000;
-    if (dtemp < 0.0)
-    {
-        dtemp -= 0.501;
-    }
-    else
-    {
-        dtemp += 0.501;
-    }
-    stemp = htons((gsfuShort) dtemp);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next byte contains the SSV source */
-    *p = (unsigned char) (sdata->gsfSeaBeam2112Specific.ssv_source);
-    p += 1;
-
-    /* Next byte contains the ping gain */
-    *p = (unsigned char) (sdata->gsfSeaBeam2112Specific.ping_gain);
-    p += 1;
-
-    /* Next byte contains the ping pulse width */
-    *p = (unsigned char) (sdata->gsfSeaBeam2112Specific.pulse_width);
-    p += 1;
-
-    /* Next byte contains the transmitter attenuation */
-    *p = (unsigned char) (sdata->gsfSeaBeam2112Specific.transmitter_attenuation);
-    p += 1;
-
-    /* Next byte contains the number of algorithms */
-    *p = (unsigned char) (sdata->gsfSeaBeam2112Specific.number_algorithms);
-    p += 1;
-
-    /* Next 4 bytes contain the algorithm order */
-    memcpy (p, (unsigned char *) (sdata->gsfSeaBeam2112Specific.algorithm_order), 4);
-    p += 4;
-
-    /* Next two bytes are reserved as spare space. */
-    *p = (unsigned char) (sdata->gsfSeaBeam2112Specific.spare[0]);
-    p += 1;
-    *p = (unsigned char) (sdata->gsfSeaBeam2112Specific.spare[1]);
-    p += 1;
-
-    return (p - sptr);
-}
-
-/********************************************************************
- *
- * Function Name : EncodeElacMkIISpecific
- *
- * Description : This function encodes the Elac Bottomchart MkII sensor specific
- *  information into external byte stream form.
- *
- * Inputs :
- *    sptr = a pointer to an unsigned char buffer to write into
- *    sdata = a pointer to a union of sensor specific data
- *
- * Returns : This function returns the number of bytes encoded.
- *
- * Error Conditions : none
- *
- ********************************************************************/
-
-static int
-EncodeElacMkIISpecific(unsigned char *sptr, gsfSensorSpecific *sdata)
-{
-    unsigned char  *p = sptr;
-    gsfuShort       stemp;
-
-    /* First byte contains the sonar mode of operation */
-    *p = (unsigned char) (sdata->gsfElacMkIISpecific.mode);
-    p += 1;
-
-    /* Next two byte integer contains the ping counter */
-    stemp = htons((gsfuShort) sdata->gsfElacMkIISpecific.ping_num);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next two byte integer contains the surface sound velocity in m/s */
-    stemp = htons((gsfuShort) sdata->gsfElacMkIISpecific.sound_vel);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next two byte integer contains the pulse length in 0.01 ms */
-    stemp = htons((gsfuShort) sdata->gsfElacMkIISpecific.pulse_length);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next byte contains the starboard receiver gain in dB */
-    *p = (unsigned char) (sdata->gsfElacMkIISpecific.receiver_gain_stbd);
-    p += 1;
-
-    /* Next byte contains the port receiver gain in dB */
-    *p = (unsigned char) (sdata->gsfElacMkIISpecific.receiver_gain_port);
-    p += 1;
-
-    /* Next two byte integer is reserved for future use */
-    stemp = htons((gsfuShort) sdata->gsfElacMkIISpecific.reserved);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    return (p - sptr);
-}
-
-/********************************************************************
- *
- * Function Name : EncodeEM3Specific
- *
- * Description : This function encodes the Simrad EM3000 series sensor
- *  specific information into external byte stream form.
- *
- * Inputs :
- *    sptr = a pointer to an unsigned char buffer to write into
- *    sdata = a pointer to a union of sensor specific data.
- *    ft = a pointer to the gsf file table, this is used to determine
- *        is the run-time parameters should be written with this record.
- *
- * Returns : This function returns the number of bytes encoded.
- *
- * Error Conditions : none
- *
- ********************************************************************/
-
-static int
-EncodeEM3Specific(unsigned char *sptr, gsfSensorSpecific *sdata, GSF_FILE_TABLE *ft)
-{
-    unsigned char  *p = sptr;
-    gsfuShort       stemp;
-    gsfuLong        ltemp;
-    double          dtemp;
-    int             run_time_id;
-
-    /* Next two bytes contain the EM model number */
-    stemp = htons((gsfuShort) sdata->gsfEM3Specific.model_number);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next two bytes contain the ping number */
-    stemp = htons((gsfuShort) sdata->gsfEM3Specific.ping_number);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next two bytes contain the system 1 or 2 serial number */
-    stemp = htons((gsfuShort) sdata->gsfEM3Specific.serial_number);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next two bytes contain the sourface sound speed */
-    dtemp = sdata->gsfEM3Specific.surface_velocity * 10.0;
-    if (dtemp < 0.0)
-    {
-        dtemp -= 0.501;
-    }
-    else
-    {
-        dtemp += 0.501;
-    }
-    stemp = htons((gsfuShort) dtemp);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next two bytes contain the transmit depth */
-    dtemp = sdata->gsfEM3Specific.transducer_depth * 100.0;
-    if (dtemp < 0.0)
-    {
-        dtemp -= 0.501;
-    }
-    else
-    {
-        dtemp += 0.501;
-    }
-    stemp = htons((gsfuShort) dtemp);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next two bytes contain the maximum number of beams possible */
-    stemp = htons((gsfuShort) sdata->gsfEM3Specific.valid_beams);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next two bytes contain the sample rate */
-    stemp = htons((gsfuShort) sdata->gsfEM3Specific.sample_rate);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next two bytes contain the depth difference between sonar heads in the EM3000D */
-    dtemp = sdata->gsfEM3Specific.depth_difference * 100.0;
-    if (dtemp < 0.0)
-    {
-        dtemp -= 0.501;
-    }
-    else
-    {
-        dtemp += 0.501;
-    }
-    stemp = htons((gsfuShort) dtemp);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next byte contains the transducer depth offset multiplier */
-    *p = (unsigned char) (sdata->gsfEM3Specific.offset_multiplier);
-    p += 1;
-
-    /* Encode and write the run-time paremeters if any of them have changed. */
-    run_time_id = 1;
-
-    /* JSB 3/31/99 Commented out the following code block.  For now we will encode all of the
-     *  run-time parameter fields in the sensor specific sub-record for each ping, whether the
-     *  values have been updated or not.  In a future release, we plan to support encoding this
-     *  portion of the subrecord only when the values have been updated.  This can be done by
-     *  using the model in place for the scale factors record.  We will need to support a
-     *  "scales_read" flag for write after read access, and direct access back to the ping record
-     *  with the updated run-time params prior to a direct access read.
-     *
-     * run_time_id = 0;
-     * if (memcmp(&sdata->gsfEM3Specific.run_time[0], &ft->rec.mb_ping.sensor_data.gsfEM3Specific.run_time[0], sizeof(gsfEM3RunTime)))
-     * {
-     *     memcpy (&ft->rec.mb_ping.sensor_data.gsfEM3Specific.run_time[0], &sdata->gsfEM3Specific.run_time[0], sizeof(gsfEM3RunTime));
-     *     run_time_id |= 0x00000001;
-     * }
-     *
-     * If this is an em 3000 series dual head installation, then we'll need to save both sets of run time parameters when either set
-     *  has been updated.
-     *
-     * if ((sdata->gsfEM3Specific.model_number == 3002) ||
-     *    (sdata->gsfEM3Specific.model_number == 3003) ||
-     *    (sdata->gsfEM3Specific.model_number == 3004) ||
-     *    (sdata->gsfEM3Specific.model_number == 3005) ||
-     *    (sdata->gsfEM3Specific.model_number == 3006) ||
-     *    (sdata->gsfEM3Specific.model_number == 3007) ||
-     *    (sdata->gsfEM3Specific.model_number == 3008))
-     * {
-     *     if ((memcmp(&sdata->gsfEM3Specific.run_time[0], &ft->rec.mb_ping.sensor_data.gsfEM3Specific.run_time[0], sizeof(gsfEM3RunTime))) ||
-     *         (memcmp(&sdata->gsfEM3Specific.run_time[1], &ft->rec.mb_ping.sensor_data.gsfEM3Specific.run_time[1], sizeof(gsfEM3RunTime))))
-     *     {
-     *         memcpy (&ft->rec.mb_ping.sensor_data.gsfEM3Specific.run_time[0], &sdata->gsfEM3Specific.run_time[0], sizeof(gsfEM3RunTime));
-     *         memcpy (&ft->rec.mb_ping.sensor_data.gsfEM3Specific.run_time[1], &sdata->gsfEM3Specific.run_time[1], sizeof(gsfEM3RunTime));
-     *         run_time_id |= 0x00000001;
-     *         run_time_id |= 0x00000002;
-     *     }
-     * }
-     */
-
-    /* The next four byte value specifies the existance of the run-time data strucutre */
-    ltemp = htonl(run_time_id);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* If the first bit is set then this subrecord contains a new set of run-time parameters,
-     *  for a single head system otherwise the run-time parameters have not changed.
-     */
-    if (run_time_id & 0x00000001)
-    {
-        /* The next two byte value contains the em model number */
-        stemp = htons(sdata->gsfEM3Specific.run_time[0].model_number);
-        memcpy(p, &stemp, 2);
-        p += 2;
-
-        /* First 8 bytes contain the time */
-        ltemp = htonl(sdata->gsfEM3Specific.run_time[0].dg_time.tv_sec);
-        memcpy(p, &ltemp, 4);
-        p += 4;
-
-        ltemp = htonl(sdata->gsfEM3Specific.run_time[0].dg_time.tv_nsec);
-        memcpy(p, &ltemp, 4);
-        p += 4;
-
-        /* The next two byte value contains the sequential ping number */
-        stemp = htons(sdata->gsfEM3Specific.run_time[0].ping_number);
-        memcpy(p, &stemp, 2);
-        p += 2;
-
-        /* The next two byte value contains the sonar head serial number */
-        stemp = htons(sdata->gsfEM3Specific.run_time[0].serial_number);
-        memcpy(p, &stemp, 2);
-        p += 2;
-
-        /* The next four byte value contains the system status */
-        ltemp = htonl(sdata->gsfEM3Specific.run_time[0].system_status);
-        memcpy(p, &ltemp, 4);
-        p += 4;
-
-        /* The next one byte value contains the mode identifier */
-        *p = (unsigned char) sdata->gsfEM3Specific.run_time[0].mode;
-        p += 1;
-
-        /* The next one byte value contains the filter identifier */
-        *p = (unsigned char) sdata->gsfEM3Specific.run_time[0].filter_id;
-        p += 1;
-
-        /* The next two byte value contains the minimum depth */
-        dtemp = sdata->gsfEM3Specific.run_time[0].min_depth;
-        stemp = htons((gsfuShort) dtemp);
-        memcpy(p, &stemp, 2);
-        p += 2;
-
-        /* The next two byte value contains the maximum depth */
-        dtemp = sdata->gsfEM3Specific.run_time[0].max_depth;
-        stemp = htons((gsfuShort) dtemp);
-        memcpy(p, &stemp, 2);
-        p += 2;
-
-        /* The next two byte value contains the absorption coefficient */
-        dtemp = sdata->gsfEM3Specific.run_time[0].absorption * 100.0;
-        if (dtemp < 0.0)
-        {
-            dtemp -= 0.501;
-        }
-        else
-        {
-            dtemp += 0.501;
-        }
-        stemp = htons((gsfuShort) dtemp);
-        memcpy(p, &stemp, 2);
-        p += 2;
-
-        /* The next two byte value contains the transmit pulse length */
-        dtemp = sdata->gsfEM3Specific.run_time[0].pulse_length;
-        stemp = htons((gsfuShort) dtemp);
-        memcpy(p, &stemp, 2);
-        p += 2;
-
-        /* The next two byte value contains the transmit beam width */
-        dtemp = sdata->gsfEM3Specific.run_time[0].transmit_beam_width * 10.0;
-        if (dtemp < 0.0)
-        {
-            dtemp -= 0.501;
-        }
-        else
-        {
-            dtemp += 0.501;
-        }
-        stemp = htons((gsfuShort) dtemp);
-        memcpy(p, &stemp, 2);
-        p += 2;
-
-        /* The next one byte value contains the transmit power reduction */
-        *p = (unsigned char) sdata->gsfEM3Specific.run_time[0].power_reduction;
-        p += 1;
-
-        /* The next one byte value contains the receive beam width */
-        *p = (unsigned char) (sdata->gsfEM3Specific.run_time[0].receive_beam_width * 10.0 + 0.501);
-        p += 1;
-
-        /* The next one byte value contains the receive band width in Hz. This value is
-         *  provided by the sonar with a precision of 50 hz.
-         */
-        *p = sdata->gsfEM3Specific.run_time[0].receive_bandwidth / 50 + 0.501;
-        p += 1;
-
-        /* The next one byte value contains the receive gain */
-        *p = sdata->gsfEM3Specific.run_time[0].receive_gain;
-        p += 1;
-
-        /* The next one byte value contains the TVG law cross-over angle */
-        *p = sdata->gsfEM3Specific.run_time[0].cross_over_angle;
-        p += 1;
-
-        /* The next one byte value contains the source of the surface sound speed value */
-        *p = sdata->gsfEM3Specific.run_time[0].ssv_source;
-        p += 1;
-
-        /* The next two byte value contains the maximum port swath width */
-        stemp = htons(sdata->gsfEM3Specific.run_time[0].port_swath_width);
-        memcpy(p, &stemp, 2);
-        p += 2;
-
-        /* The next one byte value contains the beam spacing value */
-        *p = (unsigned char) sdata->gsfEM3Specific.run_time[0].beam_spacing;
-        p += 1;
-
-        /* The next one byte value contains the port coverage sector */
-        *p = (unsigned char) sdata->gsfEM3Specific.run_time[0].port_coverage_sector;
-        p += 1;
-
-        /* The next one byte value contains the yaw and pitch stabilization mode */
-        *p = (unsigned char) sdata->gsfEM3Specific.run_time[0].stabilization;
-        p += 1;
-
-        /* The next one byte value contains the starboard coverage sector */
-        *p = (unsigned char) sdata->gsfEM3Specific.run_time[0].stbd_coverage_sector;
-        p += 1;
-
-        /* The next two byte value contains the maximum starboard swath width */
-        stemp = htons(sdata->gsfEM3Specific.run_time[0].stbd_swath_width);
-        memcpy(p, &stemp, 2);
-        p += 2;
-
-        /* The next one byte value contains the HiLo frequency absorption coefficient ratio */
-        *p = (unsigned char) sdata->gsfEM3Specific.run_time[0].hilo_freq_absorp_ratio;
-        p += 1;
-
-        /* The next four bytes are reserved for future use */
-        memset(p, 0, 4);
-        p += 4;
-
-        /* If the second bit is set then this subrecord contains a second set of new run-time
-         *  for an em3000d series sonar system.
-         */
-        if (run_time_id & 0x00000002)
-        {
-            /* The next two byte value contains the em model number */
-            stemp = htons(sdata->gsfEM3Specific.run_time[1].model_number);
-            memcpy(p, &stemp, 2);
-            p += 2;
-
-            /* First 8 bytes contain the time */
-            ltemp = htonl(sdata->gsfEM3Specific.run_time[1].dg_time.tv_sec);
-            memcpy(p, &ltemp, 4);
-            p += 4;
-
-            ltemp = htonl(sdata->gsfEM3Specific.run_time[1].dg_time.tv_nsec);
-            memcpy(p, &ltemp, 4);
-            p += 4;
-
-            /* The next two byte value contains the sequential ping number */
-            stemp = htons(sdata->gsfEM3Specific.run_time[1].ping_number);
-            memcpy(p, &stemp, 2);
-            p += 2;
-
-            /* The next two byte value contains the sonar head serial number */
-            stemp = htons(sdata->gsfEM3Specific.run_time[1].serial_number);
-            memcpy(p, &stemp, 2);
-            p += 2;
-
-            /* The next four byte value contains the system status */
-            ltemp = htonl(sdata->gsfEM3Specific.run_time[1].system_status);
-            memcpy(p, &ltemp, 4);
-            p += 4;
-
-            /* The next one byte value contains the mode identifier */
-            *p = (unsigned char) sdata->gsfEM3Specific.run_time[1].mode;
-            p += 1;
-
-            /* The next one byte value contains the filter identifier */
-            *p = (unsigned char) sdata->gsfEM3Specific.run_time[1].filter_id;
-            p += 1;
-
-            /* The next two byte value contains the minimum depth */
-            dtemp = sdata->gsfEM3Specific.run_time[1].min_depth;
-            stemp = htons((gsfuShort) dtemp);
-            memcpy(p, &stemp, 2);
-            p += 2;
-
-            /* The next two byte value contains the maximum depth */
-            dtemp = sdata->gsfEM3Specific.run_time[1].max_depth;
-            stemp = htons((gsfuShort) dtemp);
-            memcpy(p, &stemp, 2);
-            p += 2;
-
-            /* The next two byte value contains the absorption coefficient */
-            dtemp = sdata->gsfEM3Specific.run_time[1].absorption * 100.0;
-            if (dtemp < 0.0)
-            {
-                dtemp -= 0.501;
-            }
-            else
-            {
-                dtemp += 0.501;
-            }
-            stemp = htons((gsfuShort) dtemp);
-            memcpy(p, &stemp, 2);
-            p += 2;
-
-            /* The next two byte value contains the transmit pulse length */
-            dtemp = sdata->gsfEM3Specific.run_time[1].pulse_length;
-            stemp = htons((gsfuShort) dtemp);
-            memcpy(p, &stemp, 2);
-            p += 2;
-
-            /* The next two byte value contains the transmit beam width */
-            dtemp = sdata->gsfEM3Specific.run_time[1].transmit_beam_width * 10.0;
-            if (dtemp < 0.0)
-            {
-                dtemp -= 0.501;
-            }
-            else
-            {
-                dtemp += 0.501;
-            }
-            stemp = htons((gsfuShort) dtemp);
-            memcpy(p, &stemp, 2);
-            p += 2;
-
-            /* The next one byte value contains the transmit power reduction */
-            *p = (unsigned char) sdata->gsfEM3Specific.run_time[1].power_reduction;
-            p += 1;
-
-            /* The next one byte value contains the receive beam width */
-            *p = (unsigned char) (sdata->gsfEM3Specific.run_time[1].receive_beam_width * 10.0 + 0.501);
-            p += 1;
-
-            /* The next one byte value contains the receive band width in Hz. This value is
-             *  provided by the sonar with a precision of 50 hz.
-             */
-            *p = sdata->gsfEM3Specific.run_time[1].receive_bandwidth / 50 + 0.501;
-            p += 1;
-
-            /* The next one byte value contains the receive gain */
-            *p = sdata->gsfEM3Specific.run_time[1].receive_gain;
-            p += 1;
-
-            /* The next one byte value contains the TVG law cross-over angle */
-            *p = sdata->gsfEM3Specific.run_time[1].cross_over_angle;
-            p += 1;
-
-            /* The next one byte value contains the source of the surface sound speed value */
-            *p = sdata->gsfEM3Specific.run_time[1].ssv_source;
-            p += 1;
-
-            /* The next two byte value contains the maximum port swath width */
-            stemp = htons(sdata->gsfEM3Specific.run_time[1].port_swath_width);
-            memcpy(p, &stemp, 2);
-            p += 2;
-
-            /* The next one byte value contains the beam spacing value */
-            *p = (unsigned char) sdata->gsfEM3Specific.run_time[1].beam_spacing;
-            p += 1;
-
-            /* The next one byte value contains the port coverage sector */
-            *p = (unsigned char) sdata->gsfEM3Specific.run_time[1].port_coverage_sector;
-            p += 1;
-
-            /* The next one byte value contains the yaw and pitch stabilization mode */
-            *p = (unsigned char) sdata->gsfEM3Specific.run_time[1].stabilization;
-            p += 1;
-
-            /* The next one byte value contains the starboard coverage sector */
-            *p = (unsigned char) sdata->gsfEM3Specific.run_time[1].stbd_coverage_sector;
-            p += 1;
-
-            /* The next two byte value contains the maximum starboard swath width */
-            stemp = htons(sdata->gsfEM3Specific.run_time[1].stbd_swath_width);
-            memcpy(p, &stemp, 2);
-            p += 2;
-
-            /* The next one byte value contains the HiLo frequency absorption coefficient ratio */
-            *p = (unsigned char) sdata->gsfEM3Specific.run_time[1].hilo_freq_absorp_ratio;
-            p += 1;
-
-            /* The next four bytes are reserved for future use */
-            memset(p, 0, 4);
-            p += 4;
-         }
-    }
-
-    return (p - sptr);
-}
-
-/********************************************************************
- *
- * Function Name : EncodeEM3RawSpecific
- *
- * Description : This function encodes the Kongsberg EM710/EM302/EM122/EM2040
- *  sensor specific information into external byte stream form.
- *
- * Inputs :
- *    sptr = a pointer to an unsigned char buffer to write into
- *    sdata = a pointer to a union of sensor specific data.
- *    ft = a pointer to the gsf file table, this is used to determine
- *        is the run-time parameters should be written with this record.
- *
- * Returns : This function returns the number of bytes encoded.
- *
- * Error Conditions : none
- *
- ********************************************************************/
-
-static int
-EncodeEM3RawSpecific(unsigned char *sptr, gsfSensorSpecific *sdata, GSF_FILE_TABLE *ft)
-{
-    unsigned char  *p = sptr;
-    gsfuShort       stemp;
-    gsfsShort       sstemp;
-    gsfuLong        ltemp;
-    double          dtemp;
-    int             i;
-
-
-    /* The next two bytes contain the model number */
-    stemp = htons (sdata->gsfEM3RawSpecific.model_number);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* The next two bytes contain the ping counter */
-    stemp = htons (sdata->gsfEM3RawSpecific.ping_counter);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* The next two bytes contain the serial number */
-    stemp = htons (sdata->gsfEM3RawSpecific.serial_number);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* The next two bytes contain the surface velocity */
-    dtemp = sdata->gsfEM3RawSpecific.surface_velocity * 10.0;
-    if (dtemp < 0.0)
-    {
-        dtemp -= 0.501;
-    }
-    else
-    {
-        dtemp += 0.501;
-    }
-    stemp = htons((gsfuShort) dtemp);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* The next four bytes contain the transmit transducer depth */
-    dtemp = sdata->gsfEM3RawSpecific.transducer_depth * 20000.0;
-    if (dtemp < 0.0)
-    {
-        dtemp -= 0.501;
-    }
-    else
-    {
-        dtemp += 0.501;
-    }
-    ltemp = htonl((gsfuLong) dtemp);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* The next two bytes contain the number of valid detections for this ping */
-    stemp = htons (sdata->gsfEM3RawSpecific.valid_detections);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* The next four bytes contains the integer portion of the sampling frequency in Hz */
-    ltemp = htonl((gsfuLong) sdata->gsfEM3RawSpecific.sampling_frequency);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* The next four bytes contain the fractional portion of the sampling frequency in Hz scaled by 4.0e9 */
-    dtemp = sdata->gsfEM3RawSpecific.sampling_frequency - ((gsfuLong) sdata->gsfEM3RawSpecific.sampling_frequency);
-    dtemp *= 4.0e9;
-    if (dtemp < 0.0)
-    {
-        dtemp -= 0.501;
-    }
-    else
-    {
-        dtemp += 0.501;
-    }
-    ltemp = htonl((gsfuLong) dtemp);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* Next four bytes contains the "ROV depth" */
-    dtemp = sdata->gsfEM3RawSpecific.vehicle_depth * 1000.0;
-    if (dtemp < 0.0)
-    {
-        dtemp -= 0.501;
-    }
-    else
-    {
-        dtemp += 0.501;
-    }
-    ltemp = htonl((gsfuLong) dtemp);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* Next two bytes contain the depth difference between sonar heads in the EM3000D */
-    dtemp = sdata->gsfEM3RawSpecific.depth_difference * 100.0;
-    if (dtemp < 0.0)
-    {
-        dtemp -= 0.501;
-    }
-    else
-    {
-        dtemp += 0.501;
-    }
-    stemp = htons((gsfuShort) dtemp);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next byte contains the transducer depth offset multiplier */
-    *p = (unsigned char) (sdata->gsfEM3RawSpecific.offset_multiplier);
-    p += 1;
-
-
-    /* The next 16 bytes are spare space for future use */
-    memset (p, 0, (size_t) 16);
-    p += 16;
-
-    /* The next two bytes contains the number of transmit sectors */
-    stemp = htons (sdata->gsfEM3RawSpecific.transmit_sectors);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Now loop over the transmit sectors to encode the sector specific information */
-    for (i = 0; i < sdata->gsfEM3RawSpecific.transmit_sectors; i++)
-    {
-        /* Next two bytes contains the tilt angle */
-        dtemp = sdata->gsfEM3RawSpecific.sector[i].tilt_angle * 100.0;
-        if (dtemp < 0.0)
-        {
-            dtemp -= 0.501;
-        }
-        else
-        {
-            dtemp += 0.501;
-        }
-        sstemp = htons((gsfsShort) dtemp);
-        memcpy(p, &sstemp, 2);
-        p += 2;
-
-        /* Next two bytes contains the focus range */
-        dtemp = sdata->gsfEM3RawSpecific.sector[i].focus_range * 10.0;
-        if (dtemp < 0.0)
-        {
-            dtemp -= 0.501;
-        }
-        else
-        {
-            dtemp += 0.501;
-        }
-        stemp = htons((gsfuShort) dtemp);
-        memcpy(p, &stemp, 2);
-        p += 2;
-
-        /* Next four bytes contains the signal length */
-        dtemp = sdata->gsfEM3RawSpecific.sector[i].signal_length * 1.0e6;
-        if (dtemp < 0.0)
-        {
-            dtemp -= 0.501;
-        }
-        else
-        {
-            dtemp += 0.501;
-        }
-        ltemp = htonl((gsfuLong) dtemp);
-        memcpy(p, &ltemp, 4);
-        p += 4;
-
-        /* Next four bytes contains the transmit delay */
-        dtemp = sdata->gsfEM3RawSpecific.sector[i].transmit_delay * 1.0e6;
-        if (dtemp < 0.0)
-        {
-            dtemp -= 0.501;
-        }
-        else
-        {
-            dtemp += 0.501;
-        }
-        ltemp = htonl((gsfuLong) dtemp);
-        memcpy(p, &ltemp, 4);
-        p += 4;
-
-        /* Next four bytes contains the center frequency */
-        dtemp = sdata->gsfEM3RawSpecific.sector[i].center_frequency * 1.0e3;
-        if (dtemp < 0.0)
-        {
-            dtemp -= 0.501;
-        }
-        else
-        {
-            dtemp += 0.501;
-        }
-        ltemp = htonl((gsfuLong) dtemp);
-        memcpy(p, &ltemp, 4);
-        p += 4;
-
-        /* Next byte contains the signal wave form identifier */
-        *p = (unsigned char) sdata->gsfEM3RawSpecific.sector[i].waveform_id;
-        p += 1;
-
-        /* Next byte contains the transmit sector number */
-        *p = sdata->gsfEM3RawSpecific.sector[i].sector_number;
-        p += 1;
-
-        /* Next four bytes contains the signal bandwidth */
-        dtemp = sdata->gsfEM3RawSpecific.sector[i].signal_bandwidth * 1.0e3;
-        if (dtemp < 0.0)
-        {
-            dtemp -= 0.501;
-        }
-        else
-        {
-            dtemp += 0.501;
-        }
-        ltemp = htonl((gsfuLong) dtemp);
-        memcpy(p, &ltemp, 4);
-        p += 4;
-
-        /* The next 16 bytes are spare space for future use */
-        memset (p, 0, (size_t) 16);
-        p += 16;
-    }
-
-    /* The next 16 bytes are spare space for future use */
-    memset (p, 0, (size_t) 16);
-    p += 16;
-
-
-    /* Encode and write the run-time parameters.
-     *
-     * The next two byte value contains the em model number
-     */
-    stemp = htons(sdata->gsfEM3RawSpecific.run_time.model_number);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* First 8 bytes contain the time */
-    ltemp = htonl(sdata->gsfEM3RawSpecific.run_time.dg_time.tv_sec);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    ltemp = htonl(sdata->gsfEM3RawSpecific.run_time.dg_time.tv_nsec);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* The next two byte value contains the sequential ping number */
-    stemp = htons(sdata->gsfEM3RawSpecific.run_time.ping_counter);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* The next two byte value contains the sonar head serial number */
-    stemp = htons(sdata->gsfEM3RawSpecific.run_time.serial_number);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next byte contains the operator station status */
-    *p = sdata->gsfEM3RawSpecific.run_time.operator_station_status;
-    p += 1;
-
-    /* Next byte contains the processing unit status */
-    *p = sdata->gsfEM3RawSpecific.run_time.processing_unit_status;
-    p += 1;
-
-    /* Next byte contains the BSP status */
-    *p = sdata->gsfEM3RawSpecific.run_time.bsp_status;
-    p += 1;
-
-    /* Next byte contains the sonar head or transceiver status */
-    *p = sdata->gsfEM3RawSpecific.run_time.head_transceiver_status;
-    p += 1;
-
-    /* The next one byte value contains the mode identifier */
-    *p = (unsigned char) sdata->gsfEM3RawSpecific.run_time.mode;
-    p += 1;
-
-    /* The next one byte value contains the filter identifier */
-    *p = (unsigned char) sdata->gsfEM3RawSpecific.run_time.filter_id;
-    p += 1;
-
-    /* The next two byte value contains the minimum depth */
-    dtemp = sdata->gsfEM3RawSpecific.run_time.min_depth;
-    stemp = htons((gsfuShort) dtemp);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* The next two byte value contains the maximum depth */
-    dtemp = sdata->gsfEM3RawSpecific.run_time.max_depth;
-    stemp = htons((gsfuShort) dtemp);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* The next two byte value contains the absorption coefficient */
-    dtemp = sdata->gsfEM3RawSpecific.run_time.absorption * 100.0;
-    if (dtemp < 0.0)
-    {
-        dtemp -= 0.501;
-    }
-    else
-    {
-        dtemp += 0.501;
-    }
-    stemp = htons((gsfuShort) dtemp);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* The next two byte value contains the transmit pulse length in micro seconds */
-    dtemp = sdata->gsfEM3RawSpecific.run_time.tx_pulse_length;
-    stemp = htons((gsfuShort) dtemp);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* The next two byte value contains the transmit beam width */
-    dtemp = sdata->gsfEM3RawSpecific.run_time.tx_beam_width * 10.0;
-    if (dtemp < 0.0)
-    {
-        dtemp -= 0.501;
-    }
-    else
-    {
-        dtemp += 0.501;
-    }
-    stemp = htons((gsfuShort) dtemp);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* The next one byte value contains the transmit power reduction */
-    *p = (unsigned char) sdata->gsfEM3RawSpecific.run_time.tx_power_re_max;
-    p += 1;
-
-    /* The next one byte value contains the receive beam width */
-    *p = (unsigned char) ((sdata->gsfEM3RawSpecific.run_time.rx_beam_width * 10.0) + 0.501);
-    p += 1;
-
-    /* The next one byte value contains the receive band width in Hz. This value is
-     *  provided by the sonar with a precision of 50 hz.
-     */
-    *p = (unsigned char) ((sdata->gsfEM3RawSpecific.run_time.rx_bandwidth / 50) + 0.501);
-    p += 1;
-
-    /* The next one byte value contains the receive gain */
-    *p = (unsigned char) sdata->gsfEM3RawSpecific.run_time.rx_fixed_gain;
-    p += 1;
-
-    /* The next one byte value contains the TVG law cross-over angle */
-    *p = (unsigned char) sdata->gsfEM3RawSpecific.run_time.tvg_cross_over_angle;
-    p += 1;
-
-    /* The next one byte value contains the source of the surface sound speed value */
-    *p = (unsigned char) sdata->gsfEM3RawSpecific.run_time.ssv_source;
-    p += 1;
-
-    /* The next two byte value contains the maximum port swath width */
-    stemp = htons(sdata->gsfEM3RawSpecific.run_time.max_port_swath_width);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* The next one byte value contains the beam spacing value */
-    *p = (unsigned char) sdata->gsfEM3RawSpecific.run_time.beam_spacing;
-    p += 1;
-
-    /* The next one byte value contains the port coverage in degrees */
-    *p = (unsigned char) sdata->gsfEM3RawSpecific.run_time.max_port_coverage;
-    p += 1;
-
-    /* The next one byte value contains the yaw and pitch stabilization mode */
-    *p = (unsigned char) sdata->gsfEM3RawSpecific.run_time.stabilization;
-    p += 1;
-
-    /* The next one byte value contains the starboard coverage in degrees */
-    *p = (unsigned char) sdata->gsfEM3RawSpecific.run_time.max_stbd_coverage;
-    p += 1;
-
-    /* The next two byte value contains the maximum starboard swath width */
-    stemp = htons(sdata->gsfEM3RawSpecific.run_time.max_stbd_swath_width);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* The contents of the next two byte value depends on the sonar model number */
-    switch (sdata->gsfEM3RawSpecific.run_time.model_number)
-    {
-        case 1002:
-            /* The next two byte value contains the Durotong speed. This field is valid only for the EM1002 */
-            dtemp = sdata->gsfEM3RawSpecific.run_time.durotong_speed * 10.0;
-            if (dtemp < 0.0)
-            {
-                dtemp -= 0.501;
-            }
-            else
-            {
-                dtemp += 0.501;
-            }
-            stemp = htons((gsfuShort) dtemp);
-            memcpy(p, &stemp, 2);
-            p += 2;
-            break;
-
-        case 300:
-        case 120:
-        case 3000:
-        case 3020:
-            /* The next two byte value contains the transmit along track tilt in degrees.
-             * JSB: As of 3/1/09, still don't have final datagram documentation from KM
-             * to know whether the tx_along_tilt field is EM4 specific or if it will be supported
-             * on EM3 systems.
-             */
-            dtemp = sdata->gsfEM3RawSpecific.run_time.tx_along_tilt * 100.0;
-            if (dtemp < 0.0)
-            {
-                dtemp -= 0.501;
-            }
-            else
-            {
-                dtemp += 0.501;
-            }
-            sstemp = htons((gsfsShort) dtemp);
-            memcpy(p, &sstemp, 2);
-            p += 2;
-            break;
-
-        default:
-            /* Then next two byte value is spare */
-            p += 2;
-            break;
-    }
-
-    /* The contents of the next one byte value depends on the sonar model number */
-    switch (sdata->gsfEM3RawSpecific.run_time.model_number)
-    {
-        default:
-            /* The next one byte value contains the HiLo frequency absorption coefficient ratio
-             * JSB: As of 3/1/09, still don't have final datagram documentation from KM
-             * to know whether the filter ID 2 field is EM4 specific or if it will be supported
-             * on EM3 systems.
-             */
-            *p = (unsigned char) sdata->gsfEM3RawSpecific.run_time.hi_low_absorption_ratio;
-            p += 1;
-            break;
-    }
-
-    /* The next 16 bytes of space on the byte stream are spare space for future use. */
-    memset (p, 0, (size_t) 16);
-    p += 16;
-
-    /* Encode and write the PU status fields. */
-
-    /* The next one byte value contains the processor unit CPU load */
-    *p = (unsigned char) sdata->gsfEM3RawSpecific.pu_status.pu_cpu_load;
-    p += 1;
-
-    /* The next two bytes contain a bit mask detailing valid/invalid status of sensor inputs */
-    stemp = htons(sdata->gsfEM3RawSpecific.pu_status.sensor_status);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* The next one byte value contains the achieved port coverage */
-    *p = (unsigned char) sdata->gsfEM3RawSpecific.pu_status.achieved_port_coverage;
-    p += 1;
-
-    /* The next one byte value contains the achieved starboard coverage */
-    *p = (unsigned char) sdata->gsfEM3RawSpecific.pu_status.achieved_stbd_coverage;
-    p += 1;
-
-    /* The next two bytes contain the yaw stabilization */
-    dtemp = sdata->gsfEM3RawSpecific.pu_status.yaw_stabilization * 100.0;
-    if (dtemp < 0.0)
-    {
-        dtemp -= 0.501;
-    }
-    else
-    {
-        dtemp += 0.501;
-    }
-    sstemp = htons((gsfsShort) dtemp);
-    memcpy(p, &sstemp, 2);
-    p += 2;
-
-    /* The next 16 bytes are reserved for future use */
-    memset (p, 0, (size_t) 16);
-    p += 16;
-
-    return (p - sptr);
-}
-
-
-
-/********************************************************************
- *
- * Function Name : EncodeEM4Specific
- *
- * Description : This function encodes the Kongsberg EM710/EM302/EM122/EM2040
- *  sensor specific information into external byte stream form.
- *
- * Inputs :
- *    sptr = a pointer to an unsigned char buffer to write into
- *    sdata = a pointer to a union of sensor specific data.
- *    ft = a pointer to the gsf file table, this is used to determine
- *        is the run-time parameters should be written with this record.
- *
- * Returns : This function returns the number of bytes encoded.
- *
- * Error Conditions : none
- *
- ********************************************************************/
-
-static int
-EncodeEM4Specific(unsigned char *sptr, gsfSensorSpecific *sdata, GSF_FILE_TABLE *ft)
-{
-    unsigned char  *p = sptr;
-    gsfuShort       stemp;
-    gsfsShort       sstemp;
-    gsfuLong        ltemp;
-    double          dtemp;
-    int             i;
-
-    /* The next two bytes contain the model number */
-    stemp = htons (sdata->gsfEM4Specific.model_number);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* The next two bytes contain the ping counter */
-    stemp = htons (sdata->gsfEM4Specific.ping_counter);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* The next two bytes contain the serial number */
-    stemp = htons (sdata->gsfEM4Specific.serial_number);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* The next two bytes contain the surface velocity */
-    dtemp = sdata->gsfEM4Specific.surface_velocity * 10.0;
-    if (dtemp < 0.0)
-    {
-        dtemp -= 0.501;
-    }
-    else
-    {
-        dtemp += 0.501;
-    }
-    stemp = htons((gsfuShort) dtemp);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* The next four bytes contain the transmit transducer depth */
-    dtemp = sdata->gsfEM4Specific.transducer_depth * 20000.0;
-    if (dtemp < 0.0)
-    {
-        dtemp -= 0.501;
-    }
-    else
-    {
-        dtemp += 0.501;
-    }
-    ltemp = htonl((gsfuLong) dtemp);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* The next two bytes contain the number of valid detections for this ping */
-    stemp = htons (sdata->gsfEM4Specific.valid_detections);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* The next four bytes contains the integer portion of the sampling frequency in Hz */
-    ltemp = htonl((gsfuLong) sdata->gsfEM4Specific.sampling_frequency);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* The next four bytes contain the fractional portion of the sampling frequency in Hz scaled by 4.0e9 */
-    dtemp = sdata->gsfEM4Specific.sampling_frequency - ((gsfuLong) sdata->gsfEM4Specific.sampling_frequency);
-    dtemp *= 4.0e9;
-    if (dtemp < 0.0)
-    {
-        dtemp -= 0.501;
-    }
-    else
-    {
-        dtemp += 0.501;
-    }
-    ltemp = htonl((gsfuLong) dtemp);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* Next four bytes contains the scale factor value for the FM Doppler frequency correction */
-    ltemp = htonl((gsfuLong) sdata->gsfEM4Specific.doppler_corr_scale);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* Next four bytes contains the "ROV depth" from the 0x66 datagram */
-    dtemp = sdata->gsfEM4Specific.vehicle_depth * 1000.0;
-    if (dtemp < 0.0)
-    {
-        dtemp -= 0.501;
-    }
-    else
-    {
-        dtemp += 0.501;
-    }
-    ltemp = htonl((gsfuLong) dtemp);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* The next 16 bytes are spare space for future use */
-    memset (p, 0, (size_t) 16);
-    p += 16;
-
-    /* The next two bytes contains the number of transmit sectors */
-    stemp = htons (sdata->gsfEM4Specific.transmit_sectors);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Now loop over the transmit sectors to encode the sector specific information */
-    for (i = 0; i < sdata->gsfEM4Specific.transmit_sectors; i++)
-    {
-        /* Next two bytes contains the tilt angle */
-        dtemp = sdata->gsfEM4Specific.sector[i].tilt_angle * 100.0;
-        if (dtemp < 0.0)
-        {
-            dtemp -= 0.501;
-        }
-        else
-        {
-            dtemp += 0.501;
-        }
-        sstemp = htons((gsfsShort) dtemp);
-        memcpy(p, &sstemp, 2);
-        p += 2;
-
-        /* Next two bytes contains the focus range */
-        dtemp = sdata->gsfEM4Specific.sector[i].focus_range * 10.0;
-        if (dtemp < 0.0)
-        {
-            dtemp -= 0.501;
-        }
-        else
-        {
-            dtemp += 0.501;
-        }
-        stemp = htons((gsfuShort) dtemp);
-        memcpy(p, &stemp, 2);
-        p += 2;
-
-        /* Next four bytes contains the signal length */
-        dtemp = sdata->gsfEM4Specific.sector[i].signal_length * 1.0e6;
-        if (dtemp < 0.0)
-        {
-            dtemp -= 0.501;
-        }
-        else
-        {
-            dtemp += 0.501;
-        }
-        ltemp = htonl((gsfuLong) dtemp);
-        memcpy(p, &ltemp, 4);
-        p += 4;
-
-        /* Next four bytes contains the transmit delay */
-        dtemp = sdata->gsfEM4Specific.sector[i].transmit_delay * 1.0e6;
-        if (dtemp < 0.0)
-        {
-            dtemp -= 0.501;
-        }
-        else
-        {
-            dtemp += 0.501;
-        }
-        ltemp = htonl((gsfuLong) dtemp);
-        memcpy(p, &ltemp, 4);
-        p += 4;
-
-        /* Next four bytes contains the center frequency */
-        dtemp = sdata->gsfEM4Specific.sector[i].center_frequency * 1.0e3;
-        if (dtemp < 0.0)
-        {
-            dtemp -= 0.501;
-        }
-        else
-        {
-            dtemp += 0.501;
-        }
-        ltemp = htonl((gsfuLong) dtemp);
-        memcpy(p, &ltemp, 4);
-        p += 4;
-
-        /* Next two bytes contains the mean absorption */
-        dtemp = sdata->gsfEM4Specific.sector[i].mean_absorption * 100.0;
-        if (dtemp < 0.0)
-        {
-            dtemp -= 0.501;
-        }
-        else
-        {
-            dtemp += 0.501;
-        }
-        stemp = htons((gsfuShort) dtemp);
-        memcpy(p, &stemp, 2);
-        p += 2;
-
-        /* Next byte contains the signal wave form identifier */
-        *p = (unsigned char) sdata->gsfEM4Specific.sector[i].waveform_id;
-        p += 1;
-
-        /* Next byte contains the transmit sector number */
-        *p = sdata->gsfEM4Specific.sector[i].sector_number;
-        p += 1;
-
-        /* Next four bytes contains the signal bandwidth */
-        dtemp = sdata->gsfEM4Specific.sector[i].signal_bandwidth * 1.0e3;
-        if (dtemp < 0.0)
-        {
-            dtemp -= 0.501;
-        }
-        else
-        {
-            dtemp += 0.501;
-        }
-        ltemp = htonl((gsfuLong) dtemp);
-        memcpy(p, &ltemp, 4);
-        p += 4;
-
-        /* The next 16 bytes are spare space for future use */
-        memset (p, 0, (size_t) 16);
-        p += 16;
-    }
-
-    /* The next 16 bytes are spare space for future use */
-    memset (p, 0, (size_t) 16);
-    p += 16;
-
-    /* Encode and write the run-time parameters.
-     *
-     * The next two byte value contains the em model number
-     */
-    stemp = htons(sdata->gsfEM4Specific.run_time.model_number);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* First 8 bytes contain the time */
-    ltemp = htonl(sdata->gsfEM4Specific.run_time.dg_time.tv_sec);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    ltemp = htonl(sdata->gsfEM4Specific.run_time.dg_time.tv_nsec);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* The next two byte value contains the sequential ping number */
-    stemp = htons(sdata->gsfEM4Specific.run_time.ping_counter);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* The next two byte value contains the sonar head serial number */
-    stemp = htons(sdata->gsfEM4Specific.run_time.serial_number);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next byte contains the operator station status */
-    *p = sdata->gsfEM4Specific.run_time.operator_station_status;
-    p += 1;
-
-    /* Next byte contains the processing unit status */
-    *p = sdata->gsfEM4Specific.run_time.processing_unit_status;
-    p += 1;
-
-    /* Next byte contains the BSP status */
-    *p = sdata->gsfEM4Specific.run_time.bsp_status;
-    p += 1;
-
-    /* Next byte contains the sonar head or transceiver status */
-    *p = sdata->gsfEM4Specific.run_time.head_transceiver_status;
-    p += 1;
-
-    /* The next one byte value contains the mode identifier */
-    *p = (unsigned char) sdata->gsfEM4Specific.run_time.mode;
-    p += 1;
-
-    /* The next one byte value contains the filter identifier */
-    *p = (unsigned char) sdata->gsfEM4Specific.run_time.filter_id;
-    p += 1;
-
-    /* The next two byte value contains the minimum depth */
-    dtemp = sdata->gsfEM4Specific.run_time.min_depth;
-    stemp = htons((gsfuShort) dtemp);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* The next two byte value contains the maximum depth */
-    dtemp = sdata->gsfEM4Specific.run_time.max_depth;
-    stemp = htons((gsfuShort) dtemp);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* The next two byte value contains the absorption coefficient */
-    dtemp = sdata->gsfEM4Specific.run_time.absorption * 100.0;
-    if (dtemp < 0.0)
-    {
-        dtemp -= 0.501;
-    }
-    else
-    {
-        dtemp += 0.501;
-    }
-    stemp = htons((gsfuShort) dtemp);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* The next two byte value contains the transmit pulse length in micro seconds */
-    dtemp = sdata->gsfEM4Specific.run_time.tx_pulse_length;
-    stemp = htons((gsfuShort) dtemp);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* The next two byte value contains the transmit beam width */
-    dtemp = sdata->gsfEM4Specific.run_time.tx_beam_width * 10.0;
-    if (dtemp < 0.0)
-    {
-        dtemp -= 0.501;
-    }
-    else
-    {
-        dtemp += 0.501;
-    }
-    stemp = htons((gsfuShort) dtemp);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* The next one byte value contains the transmit power reduction */
-    *p = (unsigned char) sdata->gsfEM4Specific.run_time.tx_power_re_max;
-    p += 1;
-
-    /* The next one byte value contains the receive beam width */
-    *p = (unsigned char) ((sdata->gsfEM4Specific.run_time.rx_beam_width * 10.0) + 0.501);
-    p += 1;
-
-    /* The next one byte value contains the receive band width in Hz. This value is
-     *  provided by the sonar with a precision of 50 hz.
-     */
-    *p = (unsigned char) ((sdata->gsfEM4Specific.run_time.rx_bandwidth / 50) + 0.501);
-    p += 1;
-
-    /* The next one byte value contains the receive gain */
-    *p = (unsigned char) sdata->gsfEM4Specific.run_time.rx_fixed_gain;
-    p += 1;
-
-    /* The next one byte value contains the TVG law cross-over angle */
-    *p = (unsigned char) sdata->gsfEM4Specific.run_time.tvg_cross_over_angle;
-    p += 1;
-
-    /* The next one byte value contains the source of the surface sound speed value */
-    *p = (unsigned char) sdata->gsfEM4Specific.run_time.ssv_source;
-    p += 1;
-
-    /* The next two byte value contains the maximum port swath width */
-    stemp = htons(sdata->gsfEM4Specific.run_time.max_port_swath_width);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* The next one byte value contains the beam spacing value */
-    *p = (unsigned char) sdata->gsfEM4Specific.run_time.beam_spacing;
-    p += 1;
-
-    /* The next one byte value contains the port coverage in degrees */
-    *p = (unsigned char) sdata->gsfEM4Specific.run_time.max_port_coverage;
-    p += 1;
-
-    /* The next one byte value contains the yaw and pitch stabilization mode */
-    *p = (unsigned char) sdata->gsfEM4Specific.run_time.stabilization;
-    p += 1;
-
-    /* The next one byte value contains the starboard coverage in degrees */
-    *p = (unsigned char) sdata->gsfEM4Specific.run_time.max_stbd_coverage;
-    p += 1;
-
-    /* The next two byte value contains the maximum starboard swath width */
-    stemp = htons(sdata->gsfEM4Specific.run_time.max_stbd_swath_width);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* The next two byte value contains the transmit along track tilt in degrees */
-    dtemp = sdata->gsfEM4Specific.run_time.tx_along_tilt * 100.0;
-    if (dtemp < 0.0)
-    {
-        dtemp -= 0.501;
-    }
-    else
-    {
-        dtemp += 0.501;
-    }
-    sstemp = htons((gsfsShort) dtemp);
-    memcpy(p, &sstemp, 2);
-    p += 2;
-
-    /* The next one byte value contains the filter ID 2, with the value for the penetration filter */
-    *p = (unsigned char) sdata->gsfEM4Specific.run_time.filter_id_2;
-    p += 1;
-
-    /* The next 16 bytes of space on the byte stream are spare space for future use. */
-    memset (p, 0, (size_t) 16);
-    p += 16;
-
-    /* Encode and write the PU status fields. */
-
-    /* The next one byte value contains the processor unit CPU load */
-    *p = (unsigned char) sdata->gsfEM4Specific.pu_status.pu_cpu_load;
-    p += 1;
-
-    /* The next two bytes contain a bit mask detailing valid/invalid status of sensor inputs */
-    stemp = htons(sdata->gsfEM4Specific.pu_status.sensor_status);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* The next one byte value contains the achieved port coverage */
-    *p = (unsigned char) sdata->gsfEM4Specific.pu_status.achieved_port_coverage;
-    p += 1;
-
-    /* The next one byte value contains the achieved starboard coverage */
-    *p = (unsigned char) sdata->gsfEM4Specific.pu_status.achieved_stbd_coverage;
-    p += 1;
-
-    /* The next two bytes contain the yaw stabilization */
-    dtemp = sdata->gsfEM4Specific.pu_status.yaw_stabilization * 100.0;
-    if (dtemp < 0.0)
-    {
-        dtemp -= 0.501;
-    }
-    else
-    {
-        dtemp += 0.501;
-    }
-    sstemp = htons((gsfsShort) dtemp);
-    memcpy(p, &sstemp, 2);
-    p += 2;
-
-    /* The next 16 bytes are reserved for future use */
-    memset (p, 0, (size_t) 16);
-    p += 16;
-
-    return (p - sptr);
-}
-
-/********************************************************************
- *
- * Function Name : EncodeGeoSwathPlusSpecific
- *
- * Description : This function encodes the GeoAcoustic GS+
- *  sensor specific information into external byte stream form.
- *
- * Inputs :
- *    sptr = a pointer to an unsigned char buffer to write into
- *    sdata = a pointer to a union of sensor specific data.
- *
- * Returns : This function returns the number of bytes encoded.
- *
- * Error Conditions : none
- *
- ********************************************************************/
-
-static int
-EncodeGeoSwathPlusSpecific(unsigned char *sptr, gsfSensorSpecific *sdata)
-{
-    unsigned char  *p = sptr;
-    gsfuShort       stemp;
-    gsfuLong        ltemp;
-    double          dtemp;
-
-    /* First 2 bytes contain the data source (0 = CBF, 1 = RDF) */
-    stemp = htons((gsfuShort) sdata->gsfGeoSwathPlusSpecific.data_source);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next 2 bytes contain the ping side (0 port, 1 = stbd)  */
-    stemp = htons((gsfuShort) sdata->gsfGeoSwathPlusSpecific.side);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next 2 bytes contain the model number  */
-    stemp = htons(sdata->gsfGeoSwathPlusSpecific.model_number);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next 2 bytes contain the frequency (Hz) */
-    dtemp = (sdata->gsfGeoSwathPlusSpecific.frequency / 10.0) + 0.501;
-    stemp = htons((gsfuShort) dtemp);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next 2 bytes contain the echosounder type */
-    stemp = htons((gsfuShort) sdata->gsfGeoSwathPlusSpecific.echosounder_type);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next 4 bytes contain the ping number */
-    ltemp = htonl(sdata->gsfGeoSwathPlusSpecific.ping_number);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* Next 2 bytes contain the num_nav_samples */
-    stemp = htons((gsfuShort) sdata->gsfGeoSwathPlusSpecific.num_nav_samples);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next 2 bytes contain the num_attitude_samples */
-    stemp = htons((gsfuShort) sdata->gsfGeoSwathPlusSpecific.num_attitude_samples);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next 2 bytes contain the num_heading_samples */
-    stemp = htons((gsfuShort) sdata->gsfGeoSwathPlusSpecific.num_heading_samples);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next 2 bytes contain the num_miniSVS_samples */
-    stemp = htons((gsfuShort) sdata->gsfGeoSwathPlusSpecific.num_miniSVS_samples);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next 2 bytes contain the num_echosounder_samples */
-    stemp = htons((gsfuShort) sdata->gsfGeoSwathPlusSpecific.num_echosounder_samples);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next 2 bytes contain the num_raa_samples (range-angle-amplitude) */
-    stemp = htons((gsfuShort) sdata->gsfGeoSwathPlusSpecific.num_raa_samples);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next 2 bytes contain the mean SV (m/s) */
-    dtemp = (sdata->gsfGeoSwathPlusSpecific.mean_sv * 20.0) + 0.501;
-    stemp = htons((gsfuShort) dtemp);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next 2 bytes contain the surface velocity (m/s)  */
-    dtemp = (sdata->gsfGeoSwathPlusSpecific.surface_velocity * 20.0) + 0.501;
-    stemp = htons((gsfuShort) dtemp);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next 2 bytes contain the number of valid beams  */
-    stemp = htons((gsfuShort) sdata->gsfGeoSwathPlusSpecific.valid_beams);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next 2 bytes contain the sample rate (Hz) */
-    dtemp = (sdata->gsfGeoSwathPlusSpecific.sample_rate / 10.0) + 0.501;
-    stemp = htons((gsfuShort) dtemp);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next 2 bytes contain the pulse length (usec) */
-    dtemp = sdata->gsfGeoSwathPlusSpecific.pulse_length;
-    stemp = htons((gsfuShort) dtemp);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next 2 bytes contain the ping length (m) */
-    stemp = htons((gsfuShort) sdata->gsfGeoSwathPlusSpecific.ping_length);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next 2 bytes contain the transmit power (dB) */
-    stemp = htons((gsfuShort) sdata->gsfGeoSwathPlusSpecific.transmit_power);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next 2 bytes contain the sidescan gain channel (0 - 3) */
-    stemp = htons((gsfuShort) sdata->gsfGeoSwathPlusSpecific.sidescan_gain_channel);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next 2 bytes contain the stabilization flag (0 or 1) */
-    stemp = htons((gsfuShort) sdata->gsfGeoSwathPlusSpecific.stabilization);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next 2 bytes contain the GPS quality */
-    stemp = htons((gsfuShort) sdata->gsfGeoSwathPlusSpecific.gps_quality);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next 2 bytes contain the range uncertainty. */
-    dtemp = (sdata->gsfGeoSwathPlusSpecific.range_uncertainty * 1000.0) + 0.501;
-    stemp = htons((gsfuShort) dtemp);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next 2 bytes contain the angle uncertainty. */
-    dtemp = (sdata->gsfGeoSwathPlusSpecific.angle_uncertainty * 100.0) + 0.501;
-    stemp = htons((gsfuShort) dtemp);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next 32 bytes are spare, but are preserved for the future */
-    memcpy (p, &sdata->gsfGeoSwathPlusSpecific.spare, sizeof (unsigned char) * 32);
-    p += 32;
-
-    return (p - sptr);
-}
-
-/********************************************************************
- *
- * Function Name : EncodeKlein5410BssSpecific
- *
- * Description : This function encodes the Klein 5410 Bathy Sidescan
- *  sensor specific information into external byte stream form.
- *
- * Inputs :
- *    sptr = a pointer to an unsigned char buffer to write into
- *    sdata = a pointer to a union of sensor specific data.
- *
- * Returns : This function returns the number of bytes encoded.
- *
- * Error Conditions : none
- *
- ********************************************************************/
-
-static int
-EncodeKlein5410BssSpecific(unsigned char *sptr, gsfSensorSpecific *sdata)
-{
-    unsigned char  *p = sptr;
-    gsfuShort       stemp;
-    gsfuLong        ltemp;
-    double          dtemp;
-
-    /* First 2 bytes contain the data source (0 = SDF) */
-    stemp = htons((gsfuShort) sdata->gsfKlein5410BssSpecific.data_source);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next 2 bytes contain the ping side (0 port, 1 = stbd)  */
-    stemp = htons((gsfuShort) sdata->gsfKlein5410BssSpecific.side);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next 2 bytes contain the sonar model number  */
-    stemp = htons((gsfuShort) sdata->gsfKlein5410BssSpecific.model_number);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next four bytes contain the system frequency */
-    dtemp = sdata->gsfKlein5410BssSpecific.acoustic_frequency * 1.0e03;
-    if (dtemp < 0.0)
-    {
-        dtemp -= 0.501;
-    }
-    else
-    {
-        dtemp += 0.501;
-    }
-    ltemp = htonl((gsfuLong) dtemp);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* Next four bytes contain the sampling frequency */
-    dtemp = sdata->gsfKlein5410BssSpecific.sampling_frequency * 1.0e03;
-    if (dtemp < 0.0)
-    {
-        dtemp -= 0.501;
-    }
-    else
-    {
-        dtemp += 0.501;
-    }
-    ltemp = htonl((gsfuLong) dtemp);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* Next four bytes contain the ping number */
-    ltemp = htonl((gsfuLong) sdata->gsfKlein5410BssSpecific.ping_number);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* Next four bytes contain the total number of samples in the ping */
-    ltemp = htonl((gsfuLong) sdata->gsfKlein5410BssSpecific.num_samples);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* Next four bytes contain the number of valid range, angle, amplitude
-    samples in the ping */
-    ltemp = htonl((gsfuLong) sdata->gsfKlein5410BssSpecific.num_raa_samples);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* Next four bytes contain the error flags */
-    ltemp = htonl((gsfuLong) sdata->gsfKlein5410BssSpecific.error_flags);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* Next four bytes contain the range */
-    ltemp = htonl((gsfuLong) sdata->gsfKlein5410BssSpecific.range);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* Next four bytes contain the reading from the towfish pressure sensor in Volts */
-    dtemp = sdata->gsfKlein5410BssSpecific.fish_depth * 1.0e03;
-    if (dtemp < 0.0)
-    {
-        dtemp -= 0.501;
-    }
-    else
-    {
-        dtemp += 0.501;
-    }
-    ltemp = htonl((gsfuLong) dtemp);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* Next four bytes contain the towfish altitude in m */
-    dtemp = sdata->gsfKlein5410BssSpecific.fish_altitude * 1.0e03;
-    if (dtemp < 0.0)
-    {
-        dtemp -= 0.501;
-    }
-    else
-    {
-        dtemp += 0.501;
-    }
-    ltemp = htonl((gsfuLong) dtemp);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* Next four bytes contain the speed of sound at the transducer face in m/sec */
-    dtemp = sdata->gsfKlein5410BssSpecific.sound_speed * 1.0e03;
-    if (dtemp < 0.0)
-    {
-        dtemp -= 0.501;
-    }
-    else
-    {
-        dtemp += 0.501;
-    }
-    ltemp = htonl((gsfuLong) dtemp);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* Next 2 bytes contain the transmit pulse  */
-    stemp = htons((gsfuShort) sdata->gsfKlein5410BssSpecific.tx_waveform);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next 2 bytes contain the altimeter status: 0 = passive, 1 = active  */
-    stemp = htons((gsfuShort) sdata->gsfKlein5410BssSpecific.altimeter);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next four bytes contain the raw data configuration */
-    ltemp = htonl((gsfuLong) sdata->gsfKlein5410BssSpecific.raw_data_config);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* Next 32 bytes are spare, but are reserved for the future */
-    memcpy (p, &sdata->gsfKlein5410BssSpecific.spare, sizeof (unsigned char) * 32);
-    p += 32;
-
-    return (p - sptr);
-}
-
-/********************************************************************
- *
- * Function Name : EncodeReson8100Specific
- *
- * Description : This function encodes the Reson 8100 sensor specific
- *  information into external byte stream form.
- *
- * Inputs :
- *    sptr = a pointer to an unsigned char buffer to write into
- *    sdata = a pointer to a union of sensor specific data
- *
- * Returns : This function returns the number of bytes encoded.
- *
- * Error Conditions : none
- *
- ********************************************************************/
-
-static int
-EncodeReson8100Specific(unsigned char *sptr, gsfSensorSpecific *sdata)
-{
-    unsigned char  *p = sptr;
-    gsfuShort       stemp;
-    gsfuLong        ltemp;
-    double          dtemp;
-
-    /* First two byte integer contains the sonar latency */
-    stemp = htons((gsfuShort) sdata->gsfReson8100Specific.latency);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next four byte integer contains the ping number */
-    ltemp = htonl((gsfuLong) sdata->gsfReson8100Specific.ping_number);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* Next four byte integer contains the sonar id */
-    ltemp = htonl((gsfuLong) sdata->gsfReson8100Specific.sonar_id);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* Next two byte integer contains the sonar model */
-    stemp = htons((gsfuShort) sdata->gsfReson8100Specific.sonar_model);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next two byte integer contains the sonar frequency */
-    stemp = htons((gsfuShort) sdata->gsfReson8100Specific.frequency);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next two byte integer contains the sea surface sound speed * 10 */
-    dtemp = sdata->gsfReson8100Specific.surface_velocity * 10.0;
-    if (dtemp < 0.0)
-    {
-        dtemp -= 0.501;
-    }
-    else
-    {
-        dtemp += 0.501;
-    }
-    stemp = htons((gsfuShort) dtemp);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next two byte integer contains the sample rate */
-    stemp = htons((gsfuShort) sdata->gsfReson8100Specific.sample_rate);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next two byte integer contains the ping rate */
-    stemp = htons((gsfuShort) sdata->gsfReson8100Specific.ping_rate);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next two byte integer contains the sonar mode of operation */
-    stemp = htons((gsfuShort) sdata->gsfReson8100Specific.mode);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next two byte integer contains the sonar range setting */
-    stemp = htons((gsfuShort) sdata->gsfReson8100Specific.range);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next two byte integer contains the power setting */
-    stemp = htons((gsfuShort) sdata->gsfReson8100Specific.power);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next two byte integer contains the gain setting */
-    stemp = htons((gsfuShort) sdata->gsfReson8100Specific.gain);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next two byte integer contains the pulse width, in microseconds */
-    stemp = htons((gsfuShort) sdata->gsfReson8100Specific.pulse_width);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next byte contains the tvg spreading coefficient * 4 */
-    *p = (unsigned char) (sdata->gsfReson8100Specific.tvg_spreading);
-    p += 1;
-
-    /* Next byte contains the tvg absorption coefficient */
-    *p = (unsigned char) (sdata->gsfReson8100Specific.tvg_absorption);
-    p += 1;
-
-    /* Next byte contains the fore/aft beam width */
-    *p = (unsigned char) ((sdata->gsfReson8100Specific.fore_aft_bw * 10.0) + 0.501);
-    p += 1;
-
-    /* Next byte contains the athwartships beam width */
-    *p = (unsigned char) ((sdata->gsfReson8100Specific.athwart_bw * 10.0) + 0.501);
-    p += 1;
-
-    /* Next byte contains the projector type */
-    *p = (unsigned char) (sdata->gsfReson8100Specific.projector_type);
-    p += 1;
-
-    /* Next two byte integer contains the projector angle, in deg * 100 */
-    stemp = htons((gsfuShort) sdata->gsfReson8100Specific.projector_angle);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next two byte integer contains the range filter min */
-    stemp = htons((gsfuShort) sdata->gsfReson8100Specific.range_filt_min);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next two byte integer contains the range filter max */
-    stemp = htons((gsfuShort) sdata->gsfReson8100Specific.range_filt_max);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next two byte integer contains the depth filter min */
-    stemp = htons((gsfuShort) sdata->gsfReson8100Specific.depth_filt_min);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next two byte integer contains the depth filter max */
-    stemp = htons((gsfuShort) sdata->gsfReson8100Specific.depth_filt_max);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next byte contains the filters active flags */
-    *p = (unsigned char) (sdata->gsfReson8100Specific.filters_active);
-    p += 1;
-
-    /* Next two byte integer contains the temperature at the sonar head */
-    stemp = htons((gsfuShort) sdata->gsfReson8100Specific.temperature);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next two byte integer contains the across track angular beam spacing * 10000 */
-    dtemp = sdata->gsfReson8100Specific.beam_spacing * 10000.0;
-    if (dtemp < 0.0)
-    {
-        dtemp -= 0.501;
-    }
-    else
-    {
-        dtemp += 0.501;
-    }
-    stemp = htons((gsfuShort) dtemp);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next two bytes are reserved as spare space. */
-    *p = (unsigned char) (sdata->gsfReson8100Specific.spare[0]);
-    p += 1;
-    *p = (unsigned char) (sdata->gsfReson8100Specific.spare[1]);
-    p += 1;
-
-    return (p - sptr);
-}
-
-static int
-EncodeReson7100Specific(unsigned char *sptr, gsfSensorSpecific *sdata)
-{
-    unsigned char  *p = sptr;
-    gsfuShort       stemp;
-    gsfuLong        ltemp;
-    double          dtemp;
-
-    /* First two bytes contains the data format definition version number */
-    stemp = htons((gsfuShort) sdata->gsfReson7100Specific.protocol_version);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* The next four bytes contains the sonar device ID */
-    ltemp = htonl((gsfuLong) sdata->gsfReson7100Specific.device_id);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* The next 16 bytes are spare space for future growth */
-    memset(p, 0, 16);
-    p += 16;
-
-    /* The next four byte integer contains the high order four bytes of the sonar serial number */
-    ltemp = htonl((gsfuLong) sdata->gsfReson7100Specific.major_serial_number);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* The next four byte integer contains the low order four bytes of the sonar id */
-    ltemp = htonl((gsfuLong) sdata->gsfReson7100Specific.minor_serial_number);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* Next four byte integer contains the ping number */
-    ltemp = htonl((gsfuLong) sdata->gsfReson7100Specific.ping_number);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* Next two byte integer contains the multi_ping_sequence */
-    stemp = htons((gsfuShort) sdata->gsfReson7100Specific.multi_ping_seq);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next four byte integer contains the sonar frequency in Hz * 1,000.0 */
-    dtemp = (sdata->gsfReson7100Specific.frequency * 1.0e3) + 0.501;
-    ltemp = htonl((gsfuLong) dtemp);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* Next four byte integer contains the sample rate in Hz * 10,000.0 */
-    dtemp = (sdata->gsfReson7100Specific.sample_rate * 1.0e4) + 0.501;
-    ltemp = htonl((gsfuLong) dtemp);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* Next four byte integer contains the receiver bandwidth, in Hz * 10,000.0 */
-    dtemp = (sdata->gsfReson7100Specific.receiver_bandwdth * 1.0e4) + 0.501;
-    ltemp = htonl((gsfuLong) dtemp);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* Next four byte integer contains the pulse length, in seconds * 10,000,000.0 */
-    dtemp = (sdata->gsfReson7100Specific.tx_pulse_width * 1.0e7) + 0.501;
-    ltemp = htonl((gsfuLong) dtemp);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* Next four byte integer contains the pulse type id */
-    ltemp = htonl((gsfuLong) sdata->gsfReson7100Specific.tx_pulse_type_id);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* Next four byte integer contains the pulse envelope id */
-    ltemp = htonl((gsfuShort) sdata->gsfReson7100Specific.tx_pulse_envlp_id);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* Next four byte integer contains the pulse envelope parameter */
-    ltemp = htonl((gsfuLong) sdata->gsfReson7100Specific.tx_pulse_envlp_param);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* Next four byte integer contains additional pulse information */
-    ltemp = htonl((gsfuLong) sdata->gsfReson7100Specific.tx_pulse_reserved);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* Next four byte integer contains the maximum ping rate in pings/second * 1,000,000.0 */
-    dtemp = (sdata->gsfReson7100Specific.max_ping_rate * 1.0e6) + 0.501;
-    ltemp = htonl((gsfuLong) dtemp);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* Next four byte integer contains the ping period in seconds since last ping * 1,000,000.0 */
-    dtemp = (sdata->gsfReson7100Specific.ping_period * 1.0e6) + 0.501;
-    ltemp = htonl((gsfuLong) dtemp);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* Next four byte integer contains the sonar range setting in meters * 100.0 */
-    dtemp = (sdata->gsfReson7100Specific.range * 1.0e2) + 0.501;
-    ltemp = htonl((gsfuLong) dtemp);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* Next four byte integer contains the power setting * 100.0 */
-    dtemp = (sdata->gsfReson7100Specific.power * 1.0e2);
-    if (dtemp < 0.0)
-    {
-        dtemp = dtemp - 0.501;
-    }
-    else
-    {
-        dtemp = dtemp + 0.501;
-    }
-    ltemp = htonl((gsfuLong) dtemp);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* Next four byte integer contains the gain setting * 100.0 */
-    dtemp = (sdata->gsfReson7100Specific.gain * 1.0e2);
-    if (dtemp < 0.0)
-    {
-        dtemp = dtemp - 0.501;
-    }
-    else
-    {
-        dtemp = dtemp + 0.501;
-    }
-    ltemp = htonl((gsfuLong) dtemp);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* Next four byte integer contains the control flags */
-    ltemp = htonl((gsfuLong) sdata->gsfReson7100Specific.control_flags);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* Next four byte integer contains the projector type */
-    ltemp = htonl((gsfuLong) sdata->gsfReson7100Specific.projector_id);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* Next four byte integer contains the projector steering angle, in deg * 1000.0 */
-    dtemp = (sdata->gsfReson7100Specific.projector_steer_angl_vert * 1.0e3);
-    if (dtemp < 0.0)
-    {
-        dtemp = dtemp - 0.501;
-    }
-    else
-    {
-        dtemp = dtemp + 0.501;
-    }
-    ltemp = htonl((gsfuLong) dtemp);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* Next four byte integer contains the projector steering angle, in deg * 1000.0 */
-    dtemp = (sdata->gsfReson7100Specific.projector_steer_angl_horz * 1.0e3);
-    if (dtemp < 0.0)
-    {
-        dtemp = dtemp - 0.501;
-    }
-    else
-    {
-        dtemp = dtemp + 0.501;
-    }
-    ltemp = htonl((gsfuLong) dtemp);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* Next two byte integer contains the fore/aft beam width in degrees * 100.0 */
-    dtemp = (sdata->gsfReson7100Specific.projector_beam_wdth_vert * 1.0e2) + 0.501;
-    stemp = htons((gsfuShort) dtemp);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next two byte integer contains the athwartships beam width in degrees * 100.0 */
-    dtemp = (sdata->gsfReson7100Specific.projector_beam_wdth_horz * 1.0e2) + 0.501;
-    stemp = htons((gsfuShort) dtemp);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next four byte integer contains the projector beam focal point in meters * 100.0 */
-    dtemp = (sdata->gsfReson7100Specific.projector_beam_focal_pt * 1.0e2) + 0.501;
-    ltemp = htonl((gsfuLong) dtemp);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* Next four byte integer contains the projector beam weighting window type */
-    ltemp = htonl ((gsfuLong) sdata->gsfReson7100Specific.projector_beam_weighting_window_type);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* Next four byte integer contains the projector beam weighting window parameter */
-    ltemp = htonl((gsfuLong) sdata->gsfReson7100Specific.projector_beam_weighting_window_param);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* Next four byte integer contains the transmit flags */
-    ltemp = htonl((gsfuLong) sdata->gsfReson7100Specific.transmit_flags);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* Next four byte integer contains the hydrophone type */
-    ltemp = htonl((gsfuLong) sdata->gsfReson7100Specific.hydrophone_id);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* Next four byte integer contains the receive beam weighting window type */
-    ltemp = htonl((gsfuLong) sdata->gsfReson7100Specific.receiving_beam_weighting_window_type);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* Next four byte integer contains the receive beam weighting window param */
-    ltemp = htonl((gsfuLong) sdata->gsfReson7100Specific.receiving_beam_weighting_window_param);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* Next four byte integer contains the receive flags */
-    ltemp = htonl((gsfuLong) sdata->gsfReson7100Specific.receive_flags);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* Next two byte value contains the receive beam width in degrees * 100.0 */
-    dtemp = (sdata->gsfReson7100Specific.receive_beam_width * 1.0e2) + 0.501;
-    stemp = htons((gsfuShort) dtemp);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next two byte value contains the range filter min in meters * 10 */
-    dtemp = (sdata->gsfReson7100Specific.range_filt_min * 1.0e1) + 0.501;
-    stemp = htons((gsfuShort) dtemp);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next two byte value contains the range filter max in meters * 10 */
-    dtemp = (sdata->gsfReson7100Specific.range_filt_max * 1.0e1) + 0.501;
-    stemp = htons((gsfuShort) dtemp);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next two byte value contains the depth filter min in meters * 10 */
-    dtemp = (sdata->gsfReson7100Specific.depth_filt_min * 1.0e1) + 0.501;
-    stemp = htons((gsfuShort) dtemp);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next two byte value contains the depth filter max in meters * 10 */
-    dtemp = (sdata->gsfReson7100Specific.depth_filt_max * 1.0e1) + 0.501;
-    stemp = htons((gsfuShort) dtemp);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next four byte value contains the absorption in dB/kilometer * 1,000.0 */
-    dtemp = (sdata->gsfReson7100Specific.absorption * 1.0e3) + 0.501;
-    ltemp = htonl((gsfuLong) dtemp);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* Next two byte integer contains the sound velocity * 10 */
-    dtemp = (sdata->gsfReson7100Specific.sound_velocity * 1.0e1) + 0.501;
-    stemp = htons((gsfuShort) dtemp);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next four byte integer contains the spreading loss in dB * 1,000.0 */
-    dtemp = (sdata->gsfReson7100Specific.spreading * 1.0e3) + 0.501;
-    ltemp = htonl((gsfuLong) dtemp);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* The next 16 bytes are spare space for future growth */
-    memset(p, 0, 16);
-    p += 16;
-
-    /* The next byte contains the sv source */
-    *p = sdata->gsfReson7100Specific.sv_source;
-    p += 1;
-
-    /* The next byte contains the layer compensation flag */
-    *p = sdata->gsfReson7100Specific.layer_comp_flag;
-    p += 1;
-
-    /* The next 8 bytes are spare space for future growth */
-    memset(p, 0, 8);
-    p += 8;
-
-    return (p - sptr);
-}
-
-/********************************************************************
- *
- * Function Name : EncodeDeltaTSpecific
- *
- * Description : This function encodes the Imagenex Delta T
- *  sensor specific information into external byte stream form.
- *
- * Inputs :
- *    sptr = a pointer to an unsigned char buffer to write into
- *    sdata = a pointer to a union of sensor specific data.
- *
- * Returns : This function returns the number of bytes encoded.
- *
- * Error Conditions : none
- *
- ********************************************************************/
-
-static int
-EncodeDeltaTSpecific(unsigned char *sptr, gsfSensorSpecific *sdata)
-{
-    unsigned char  *p = sptr;
-    gsfuShort       stemp;
-    gsfuLong        ltemp;
-    double          dtemp;
-
-    /* The next four bytes contains the file extension */
-    memcpy (p, (unsigned char *) (sdata->gsfDeltaTSpecific.decode_file_type), 4);
-    p += 4;
-
-    /* The next byte contains the version number */
-    *p = (unsigned char) sdata->gsfDeltaTSpecific.version;
-    p += 1;
-
-    /* The next two bytes contains the ping byte size field */
-    stemp = htons((gsfuShort) sdata->gsfDeltaTSpecific.ping_byte_size);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next 8 bytes contains the original sonar interrogation time */
-    ltemp = htonl(sdata->gsfDeltaTSpecific.interrogation_time.tv_sec);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-    ltemp = htonl(sdata->gsfDeltaTSpecific.interrogation_time.tv_nsec);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* The next two bytes contains the samples per beam field */
-    stemp = htons((gsfuShort) sdata->gsfDeltaTSpecific.samples_per_beam);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* The next two bytes contains the sector size field */
-    stemp = htons((gsfuShort) sdata->gsfDeltaTSpecific.sector_size);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* The next two bytes contains the start angle field. */
-    dtemp = ((sdata->gsfDeltaTSpecific.start_angle + 180.0) * 100.0) + 0.501;
-    stemp = htons((gsfuShort) dtemp);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* The next two bytes contains the angle increment field. */
-    dtemp = ((sdata->gsfDeltaTSpecific.angle_increment) * 100.0) + 0.501;
-    stemp = htons((gsfuShort) dtemp);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* The next two bytes contains the acoustic range field */
-    stemp = htons((gsfuShort) sdata->gsfDeltaTSpecific.acoustic_range);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* The next two bytes contains the acoustic frequency field */
-    stemp = htons((gsfuShort) sdata->gsfDeltaTSpecific.acoustic_frequency);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* The next two bytes contains the sound speed field. */
-    dtemp = ((sdata->gsfDeltaTSpecific.sound_velocity) * 10.0) + 0.501;
-    stemp = htons((gsfuShort) dtemp);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* The next two bytes contains the range resolution field. */
-    stemp = htons((gsfuShort) sdata->gsfDeltaTSpecific.range_resolution);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* The next two bytes contains the profile tilt field. */
-    dtemp = ((sdata->gsfDeltaTSpecific.profile_tilt_angle) + 180.0) + 0.501;
-    stemp = htons((gsfuShort) dtemp);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* The next two bytes contains the repetition rate field. */
-    stemp = htons((gsfuShort) sdata->gsfDeltaTSpecific.repetition_rate);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* The next four bytes contains the ping number field */
-    ltemp = htonl((gsfuLong) sdata->gsfDeltaTSpecific.ping_number);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* The next byte contains the intensity flag field. */
-    *p = (unsigned char) sdata->gsfDeltaTSpecific.intensity_flag;
-    p += 1;
-
-    /* The next two bytes contains the ping latency field. */
-    dtemp = ((sdata->gsfDeltaTSpecific.ping_latency) * 10000.0) + 0.501;
-    stemp = htons((gsfuShort) dtemp);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* The next two bytes contains the data latency field. */
-    dtemp = ((sdata->gsfDeltaTSpecific.data_latency) * 10000.0) + 0.501;
-    stemp = htons((gsfuShort) dtemp);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* The next byte contains the sample rate flag field. */
-    *p = (unsigned char) sdata->gsfDeltaTSpecific.sample_rate_flag;
-    p += 1;
-
-    /* The next byte contains the option flags field. */
-    *p = (unsigned char) sdata->gsfDeltaTSpecific.option_flags;
-    p += 1;
-
-    /* The next byte contains the number of pings averaged field. */
-    *p = (unsigned char) sdata->gsfDeltaTSpecific.num_pings_avg;
-    p += 1;
-
-    /* The next two bytes contains the center ping time offset field. */
-    dtemp = ((sdata->gsfDeltaTSpecific.center_ping_time_offset) * 10000.0) + 0.501;
-    stemp = htons((gsfuShort) dtemp);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* The next byte contains the user defined byte field. */
-    *p = (unsigned char) sdata->gsfDeltaTSpecific.user_defined_byte;
-    p += 1;
-
-    /* Next four byte integer contains the altitude field.*/
-    dtemp = ((sdata->gsfDeltaTSpecific.altitude) * 100.0) + 0.501;
-    ltemp = htonl((gsfuLong) dtemp);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* The next byte contains the external sensor flags field. */
-    *p = (unsigned char) sdata->gsfDeltaTSpecific.external_sensor_flags;
-    p += 1;
-
-    /* Next four byte integer contains the pulse length field.*/
-    dtemp = (sdata->gsfDeltaTSpecific.pulse_length * 1.0e6) + 0.501;
-    ltemp = htonl((gsfuLong) dtemp);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* The next byte contains the fore aft beamwidth field. */
-    dtemp = (sdata->gsfDeltaTSpecific.fore_aft_beamwidth * 10.0) + 0.501;
-    *p = (unsigned char) dtemp;
-    p += 1;
-
-    /* The next byte contains the athwartships beamwidth field. */
-    dtemp = (sdata->gsfDeltaTSpecific.athwartships_beamwidth * 10.0) + 0.501;
-    *p = (unsigned char) dtemp;
-    p += 1;
-
-    /* The next 32 bytes are spare space for future growth */
-    memset(p, 0, 32);
-    p += 32;
-
-    return (p - sptr);
-}
-
-/********************************************************************
- *
- * Function Name : EncodeR2SonicSpecific
- *
- * Description : This function encodes the R2Sonic 2020/2022/2024
- *  sensor specific information into external byte stream form.
- *
- * Inputs :
- *    sptr = a pointer to an unsigned char buffer to write into
- *    sdata = a pointer to a union of sensor specific data.
- *
- * Returns : This function returns the number of bytes encoded.
- *
- * Error Conditions : none
- *
- ********************************************************************/
-static int
-EncodeR2SonicSpecific(unsigned char *sptr, gsfSensorSpecific *sdata)
-{
-    int i;
-    unsigned char  *p = sptr;
-    gsfuShort       stemp;
-    gsfuLong        ltemp;
-    double          dtemp;
-
-    /* The next 12 bytes contains the model number */
-    memcpy (p, (unsigned char *) (sdata->gsfR2SonicSpecific.model_number), 12);
-    p += 12;
-
-    /* The next 12 bytes contains the serial number */
-    memcpy (p, (unsigned char *) (sdata->gsfR2SonicSpecific.serial_number), 12);
-    p += 12;
-
-    /* The next four bytes contains the time in seconds */
-    ltemp = htonl((gsfuLong) sdata->gsfR2SonicSpecific.dg_time.tv_sec);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* The next four bytes contains the fractional portion of the time in nanoseconds */
-    ltemp = htonl((gsfuLong) sdata->gsfR2SonicSpecific.dg_time.tv_nsec);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* The next four bytes contains the ping number */
-    ltemp = htonl((gsfuLong) sdata->gsfR2SonicSpecific.ping_number);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* The next four bytes contains the ping period * 1,000,000 */
-    dtemp = (sdata->gsfR2SonicSpecific.ping_period * 1.0e6) + 0.501;
-    ltemp = htonl((gsfuLong) dtemp);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* The next four bytes contains the sound speed * 100 */
-    dtemp = (sdata->gsfR2SonicSpecific.sound_speed * 1.0e2) + 0.501;
-    ltemp = htonl((gsfuLong) dtemp);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* The next four bytes contains the frequency * 1000 */
-    dtemp = (sdata->gsfR2SonicSpecific.frequency * 1.0e3) + 0.501;
-    ltemp = htonl((gsfuLong) dtemp);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* The next four bytes contains the transmit source level * 100 */
-    dtemp = (sdata->gsfR2SonicSpecific.tx_power * 1.0e2) + 0.501;
-    ltemp = htonl((gsfuLong) dtemp);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* The next four bytes contains the transmit pulse width * 10,000,000.0*/
-    dtemp = (sdata->gsfR2SonicSpecific.tx_pulse_width * 1.0e7) + 0.501;
-    ltemp = htonl((gsfuLong) dtemp);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* The next four bytes contains the transmit beamwidth in the vertical * 1,000,000 */
-    dtemp = (sdata->gsfR2SonicSpecific.tx_beamwidth_vert * 1.0e6) + 0.501;
-    ltemp = htonl((gsfuLong) dtemp);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* The next four bytes contains the transmit beamwidth in the horizontal * 1,000,000*/
-    dtemp = (sdata->gsfR2SonicSpecific.tx_beamwidth_horiz * 1.0e6) + 0.501;
-    ltemp = htonl((gsfuLong) dtemp);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* The next four bytes contains the transmit steering in the vertical  * 1,000,000*/
-    dtemp = sdata->gsfR2SonicSpecific.tx_steering_vert * 1.0e6;
-    if (dtemp < 0.0)
-        dtemp -= 0.501;
-    else
-        dtemp += 0.501;
-    ltemp = htonl((gsfuLong) dtemp);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* The next four bytes contains the transmit steering in the horizontal  * 1,000,000*/
-    dtemp = sdata->gsfR2SonicSpecific.tx_steering_horiz * 1.0e6;
-    if (dtemp < 0.0)
-        dtemp -= 0.501;
-    else
-        dtemp += 0.501;
-    ltemp = htonl((gsfuLong) dtemp);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* The next four bytes contains misc. transmit info */
-    ltemp = htonl((gsfuLong) sdata->gsfR2SonicSpecific.tx_misc_info);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* The next four bytes contains the receiver bandwidth * 10,000 */
-    dtemp = (sdata->gsfR2SonicSpecific.rx_bandwidth * 1.0e4) + 0.501;
-    ltemp = htonl((gsfuLong) dtemp);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* The next four bytes contains the receiver sample rate * 1000 */
-    dtemp = (sdata->gsfR2SonicSpecific.rx_sample_rate * 1.0e3) + 0.501;
-    ltemp = htonl((gsfuLong) dtemp);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* The next four bytes contains the receiver range * 100,000 */
-    dtemp = (sdata->gsfR2SonicSpecific.rx_range * 1.0e5) + 0.501;
-    ltemp = htonl((gsfuLong) dtemp);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* The next four bytes contains the receiver gain * 100 */
-    dtemp = (sdata->gsfR2SonicSpecific.rx_gain * 1.0e2) + 0.501;
-    ltemp = htonl((gsfuLong) dtemp);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* The next four bytes contains the receiver spreading law coefficient * 1000 */
-    dtemp = (sdata->gsfR2SonicSpecific.rx_spreading * 1.0e3) + 0.501;
-    ltemp = htonl((gsfuLong) dtemp);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* The next four bytes contains the receiver absorption coefficient * 1000 */
-    dtemp = (sdata->gsfR2SonicSpecific.rx_absorption * 1.0e3) + 0.501;
-    ltemp = htonl((gsfuLong) dtemp);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* The next four bytes contains the receiver mount tilt angle * 1,000,000 */
-    dtemp = sdata->gsfR2SonicSpecific.rx_mount_tilt * 1.0e6;
-    if (dtemp < 0.0)
-        dtemp -= 0.501;
-    else
-        dtemp += 0.501;
-    ltemp = htonl((gsfuLong) dtemp);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* The next four bytes contains misc. receiver info */
-    ltemp = htonl((gsfuLong) sdata->gsfR2SonicSpecific.rx_misc_info);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* The next two bytes are reserved */
-    stemp = htons((gsfuShort) sdata->gsfR2SonicSpecific.reserved);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* The next two bytes are for the number of beams */
-    stemp = htons((gsfuShort) sdata->gsfR2SonicSpecific.num_beams);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* The next set of 6x4 (24) bytes contains reserved fields from the A0 subgroup of the BTH0 */
-    for (i=0; i<6; i++)
-    {
-        dtemp = sdata->gsfR2SonicSpecific.A0_more_info[i] * 1.0e6;
-        if (dtemp < 0.0)
-            dtemp -= 0.501;
-        else
-            dtemp += 0.501;
-        ltemp = htonl((gsfuLong) dtemp);
-        memcpy(p, &ltemp, 4);
-        p += 4;
-    }
-
-    /* The next set of 6x4 (24) bytes contains reserved fields from the A2 subgroup of BTH0 */
-    for (i=0; i<6; i++)
-    {
-        dtemp = sdata->gsfR2SonicSpecific.A2_more_info[i] * 1.0e6;
-        if (dtemp < 0.0)
-            dtemp -= 0.501;
-        else
-            dtemp += 0.501;
-        ltemp = htonl((gsfuLong) dtemp);
-        memcpy(p, &ltemp, 4);
-        p += 4;
-    }
-
-    /* The next four bytes contain minimum depth gate from the G0 subgroup of BTH0 */
-    dtemp = (sdata->gsfR2SonicSpecific.G0_depth_gate_min * 1.0e6) + 0.501;
-    ltemp = htonl((gsfuLong) dtemp);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* The next four bytes contain maximum depth gate from the G0 subgroup of BTH0 */
-    dtemp = (sdata->gsfR2SonicSpecific.G0_depth_gate_max * 1.0e6) + 0.501;
-    ltemp = htonl((gsfuLong) dtemp);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* The next four bytes contain the depth gate slope from the G0 subgroup of BTH0 */
-    dtemp = sdata->gsfR2SonicSpecific.G0_depth_gate_slope * 1.0e6;
-    if (dtemp < 0.0)
-        dtemp -= 0.501;
-    else
-        dtemp += 0.501;
-    ltemp = htonl((gsfuLong) dtemp);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* write the spare bytes */
-    memcpy(p, sdata->gsfR2SonicSpecific.spare, 32);
-    p += 32;
-
-    return (p - sptr);
-} /* end EncodeR2SonicSpecific() */
-
-/********************************************************************
- *
- * Function Name : EncodeSBEchotracSpecific
- *
- * Description : This function encodes the Bathy 2000 and echotrac
- *  sensor specific data from the HSPS source files.
- *
- * Inputs :
- *    sptr = a pointer to an unsigned char buffer to write into
- *    sdata = a pointer to a union of sensor specific data
- *    major_version = the major version of GSF used to create the file.
- *    minor_version = the minor version of GSF used to create the file.
- *
- * Returns : This function returns the number of bytes encoded.
- *
- * Error Conditions : none
- *
- ********************************************************************/
-
-static int
-EncodeSBEchotracSpecific(unsigned char *sptr, t_gsfSBEchotracSpecific * sdata)
-{
-    unsigned char  *p = sptr;
-    gsfuShort       stemp;
-    double          dtemp;
-
-    /* First two byte integer contains the navigation error */
-    stemp = htons((gsfuShort) (sdata->navigation_error));
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-        /* Next byte contains the most probable position source navigation */
-    *p = (unsigned char) sdata->mpp_source;
-    p += 1;
-
-    /* Next byte contains the tide source */
-    *p = (unsigned char) sdata->tide_source;
-    p += 1;
-
-    /* Next two byte integer contains the dynamic draft. Round the scaled
-     * quantity to the nearest whole integer.
-     */
-    dtemp = sdata->dynamic_draft * 100.0;
-    if (dtemp < 0.0)
-    {
-            dtemp -= 0.501;
-    }
-    else
-    {
-            dtemp += 0.501;
-    }
-    stemp = htons((gsfsShort) dtemp);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* write the spare bytes */
-    memcpy(p, sdata->spare, 4);
-    p += 4;
-
-    return (p - sptr);
-}
-
-/********************************************************************
- *
- * Function Name : EncodeSBMGD77Specific
- *
- * Description : This function encodes the MGD77 fields
- * into an MGD77 record. The MGD77 Singlebeam is essentially
- * survey trackline data, and actual survey data can be retrieved
- * from the source.
- *
- * Inputs :
- *    sptr = a pointer to an unsigned char buffer to write into
- *    sdata = a pointer to a union of sensor specific data
- *
- * Returns : This function returns the number of bytes encoded.
- *
- * Error Conditions : none
- *
- ********************************************************************/
-
-static int
-EncodeSBMGD77Specific(unsigned char *sptr, t_gsfSBMGD77Specific * sdata)
-{
-    unsigned char  *p = sptr;
-    gsfuLong        ltemp;
-    gsfuShort       stemp;
-    double          dtemp;
-
-    /* First two byte integer contains the time zone correction */
-    stemp = htons((gsfuShort) (sdata->time_zone_corr));
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* The Next two byte integer contains how the navigation was obtained */
-    stemp = htons((gsfuShort) (sdata->position_type_code));
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* The Next two byte integer contains on how the sound velocity
-       correction was made */
-    stemp = htons((gsfuShort) (sdata->correction_code));
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* The Next two byte integer contains how the bathymetry was obtained */
-    stemp = htons((gsfuShort) (sdata->bathy_type_code));
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* The Next two byte integer contains the quality code for Nav */
-    stemp = htons((gsfuShort) (sdata->quality_code));
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next four byte integer contains the the two way travel time */
-    dtemp = sdata->travel_time * 10000;
-    if (dtemp < 0.0)
-    {
-        dtemp -= 0.501;
-    }
-    else
-    {
-        dtemp += 0.501;
-    }
-    ltemp = htonl((gsfuLong) dtemp);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* write the spare bytes */
-    memcpy(p, sdata->spare, 4);
-    p += 4;
-
-    return (p - sptr);
-}
-
-/********************************************************************
- *
- * Function Name : EncodeSBBDBSpecific
- *
- * Description : This function encodes the BDB fields
- * into a BDB record.
- *
- * Inputs :
- *    sptr = a pointer to an unsigned char buffer to write into
- *    sdata = a pointer to a union of sensor specific data
- *
- * Returns : This function returns the number of bytes encoded.
- *
- * Error Conditions : none
- *
- ********************************************************************/
-
-static int
-EncodeSBBDBSpecific(unsigned char *sptr, t_gsfSBBDBSpecific * sdata)
-{
-    unsigned char  *p = sptr;
-    gsfuLong        ltemp;
-
-    /* Next four byte integer contains the the document number */
-    ltemp = htonl((gsfuLong) (sdata->doc_no));
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* Next byte contains the evaluation flag */
-    *p = (unsigned char) sdata->eval;
-    p += 1;
-
-    /* Next byte contains the classification flag */
-    *p = (unsigned char) sdata->classification;
-    p += 1;
-
-    /* Next byte contains the track adjustment flag */
-    *p = (unsigned char) sdata->track_adj_flag;
-    p += 1;
-
-    /* Next byte contains the source flag */
-    *p = (unsigned char) sdata->source_flag;
-    p += 1;
-
-    /* Next byte contains the discrete point or track line flag */
-    *p = (unsigned char) sdata->pt_or_track_ln;
-    p += 1;
-
-    /* Next byte contains the datum flag */
-    *p = (unsigned char) sdata->datum_flag;
-    p += 1;
-
-    /* write the spare bytes */
-    memcpy(p, sdata->spare, 4);
-    p += 4;
-
-    return (p - sptr);
-}
-
-/********************************************************************
- *
- * Function Name : EncodeSBNOSHDBSpecific
- *
- * Description : This function encodes the NOSHDB fields into a
- *               NOSHDB record.
- *
- * Inputs :
- *    sptr = a pointer to an unsigned char buffer to write into
- *    sdata = a pointer to a union of sensor specific data
- *
- * Returns : This function returns the number of bytes encoded.
- *
- * Error Conditions : none
- *
- ********************************************************************/
-
-static int
-EncodeSBNOSHDBSpecific(unsigned char *sptr, t_gsfSBNOSHDBSpecific * sdata)
-{
-    unsigned char  *p = sptr;
-    gsfuShort       stemp;
-
-    /* First two byte integer contains the depth type code */
-    stemp = htons((gsfuShort) (sdata->type_code));
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* The Next two byte integer contains the cartographic code */
-    stemp = htons((gsfuShort) (sdata->carto_code));
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* write the spare bytes */
-    memcpy(p, sdata->spare, 4);
-    p += 4;
-
-    return (p - sptr);
-}
-
-/********************************************************************
- *
- * Function Name : EncodeSBNavisoundSpecific
- *
- * Description : This function encodes the Navisound
- *  sensor specific data
- *
- * Inputs :
- *    sptr = a pointer to an unsigned char buffer to write into
- *    sdata = a pointer to a union of sensor specific data
- *    major_version = the major version of GSF used to create the file.
- *    minor_version = the minor version of GSF used to create the file.
- *
- * Returns : This function returns the number of bytes encoded.
- *
- * Error Conditions : none
- *
- ********************************************************************/
-
-static int
-EncodeSBNavisoundSpecific(unsigned char *sptr, t_gsfSBNavisoundSpecific * sdata)
-{
-    unsigned char  *p = sptr;
-    gsfuShort       stemp;
-    double          dtemp;
-
-    /* First two byte value contains the pulse length */
-    dtemp = sdata->pulse_length * 100.0;
-    if (dtemp < 0.0)
-    {
-        dtemp -= 0.501;
-    }
-    else
-    {
-        dtemp += 0.501;
-    }
-    stemp = htons((gsfuShort) dtemp);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* write the spare bytes */
-    memcpy(p, sdata->spare, 8);
-    p += 8;
-
-    return (p - sptr);
-}
-
-/********************************************************************
- *
- * Function Name : EncodeEM3ImagerySpecific
- *
- * Description : This function encodes the Simrad EM3000 series sensor
- *  specific imagery information into external byte stream form.
- *
- * Inputs :
- *    sptr = a pointer to an unsigned char buffer to write into
- *    sdata = a pointer to a union of sensor specific imagery data.
- *
- * Returns : This function returns the number of bytes encoded.
- *
- * Error Conditions : none
- *
- ********************************************************************/
-
-static int
-EncodeEM3ImagerySpecific(unsigned char *sptr, gsfSensorImagery *sdata)
-{
-    unsigned char  *p = sptr;
-    gsfuShort       stemp;
-    gsfsShort       sstemp;
-    double          dtemp;
-
-    /* Next two bytes contain the range to normal incidence to correct amplitudes */
-    stemp = htons((gsfuShort) sdata->gsfEM3ImagerySpecific.range_norm);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next two bytes contain the start range sample of TVG ramp */
-    stemp = htons((gsfuShort) sdata->gsfEM3ImagerySpecific.start_tvg_ramp);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next two bytes contain the stop range sample of TVG ramp */
-    stemp = htons((gsfuShort) sdata->gsfEM3ImagerySpecific.stop_tvg_ramp);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next byte contains the normal incidence BS in dB */
-    *p = (unsigned char) (sdata->gsfEM3ImagerySpecific.bsn);
-    p += 1;
-
-    /* Next byte contains the oblique BS in dB */
-    *p = (unsigned char) (sdata->gsfEM3ImagerySpecific.bso);
-    p += 1;
-
-    /* The next two byte value contains the mean absorption coefficient */
-    dtemp = sdata->gsfEM3ImagerySpecific.mean_absorption * 100.0;
-    if (dtemp < 0.0)
-    {
-        dtemp -= 0.501;
-    }
-    else
-    {
-        dtemp += 0.501;
-    }
-    stemp = htons((gsfuShort) dtemp);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next two bytes contain the imagery offset value used to positive bias the imagery values. This value has been added to all imagery samples
-     *  as the Kongsberg imagery datagram is decoded into GSF.
-     */
-    sstemp = htons((gsfsShort) sdata->gsfEM3ImagerySpecific.offset);
-    memcpy(p, &sstemp, 2);
-    p += 2;
-
-    /* Next two bytes contain the imagery scale value as specified by the manufacturer.  This value is 2 for the EM3000/EM3002/EM1002/EM300/EM120.
-     *  The following formula can be used to convert from the GSF positive biased value to dB:
-     *  dB_value = (GSF_I_value - offset) / scale
-     */
-    sstemp = htons((gsfsShort) sdata->gsfEM3ImagerySpecific.scale);
-    memcpy(p, &sstemp, 2);
-    p += 2;
-
-    /* write the spare bytes */
-    memcpy(p, sdata->gsfEM3ImagerySpecific.spare, 4);
-    p += 4;
-
-    return (p - sptr);
-}
-
-/********************************************************************
- *
- * Function Name : EncodeEM4ImagerySpecific
- *
- * Description : This function encodes the Simrad EM4 series sensor
- *  specific imagery information into external byte stream form.
- *
- * Inputs :
- *    sptr = a pointer to an unsigned char buffer to write into
- *    sdata = a pointer to a union of sensor specific imagery data.
- *
- * Returns : This function returns the number of bytes encoded.
- *
- * Error Conditions : none
- *
- ********************************************************************/
-
-static int
-EncodeEM4ImagerySpecific(unsigned char *sptr, gsfSensorImagery *sdata)
-{
-    unsigned char  *p = sptr;
-    gsfuShort       stemp;
-    gsfsShort       sstemp;
-    gsfuLong        ltemp;
-    double          dtemp;
-
-    /* The next four bytes contains the integer portion of the sampling frequency in Hz */
-    ltemp = htonl((gsfuLong) sdata->gsfEM4ImagerySpecific.sampling_frequency);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* The next four bytes contain the fractional portion of the sampling frequency in Hz scaled by 4.0e9 */
-    dtemp = sdata->gsfEM4ImagerySpecific.sampling_frequency - ((gsfuLong) sdata->gsfEM4ImagerySpecific.sampling_frequency);
-    dtemp *= 4.0e9;
-    if (dtemp < 0.0)
-    {
-        dtemp -= 0.501;
-    }
-    else
-    {
-        dtemp += 0.501;
-    }
-    ltemp = htonl((gsfuLong) dtemp);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* Next two bytes contain the mean absorption coefficient in dB/KM. */
-    dtemp = sdata->gsfEM4ImagerySpecific.mean_absorption * 100.0;
-    if (dtemp < 0.0)
-    {
-        dtemp -= 0.501;
-    }
-    else
-    {
-        dtemp += 0.501;
-    }
-    stemp = htons((gsfuShort) dtemp);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next two bytes contain the transmit pulse length in microseconds. */
-    dtemp = sdata->gsfEM4ImagerySpecific.tx_pulse_length;
-    if (dtemp < 0.0)
-    {
-        dtemp -= 0.501;
-    }
-    else
-    {
-        dtemp += 0.501;
-    }
-    stemp = htons((gsfuShort) dtemp);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next two bytes contain the range to normal incidence to correct amplitudes */
-    stemp = htons((gsfuShort) sdata->gsfEM4ImagerySpecific.range_norm);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next two bytes contain the start range sample of TVG ramp */
-    stemp = htons((gsfuShort) sdata->gsfEM4ImagerySpecific.start_tvg_ramp);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next two bytes contain the stop range sample of TVG ramp */
-    stemp = htons((gsfuShort) sdata->gsfEM4ImagerySpecific.stop_tvg_ramp);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next two bytes contain the normal incidence BS in dB */
-    dtemp = sdata->gsfEM4ImagerySpecific.bsn * 10.0;
-    if (dtemp < 0.0)
-    {
-        dtemp -= 0.501;
-    }
-    else
-    {
-        dtemp += 0.501;
-    }
-    sstemp = htons((gsfsShort) dtemp);
-    memcpy(p, &sstemp, 2);
-    p += 2;
-
-    /* Next two bytes contain the oblique incidence BS in dB */
-    dtemp = sdata->gsfEM4ImagerySpecific.bso * 10.0;
-    if (dtemp < 0.0)
-    {
-        dtemp -= 0.501;
-    }
-    else
-    {
-        dtemp += 0.501;
-    }
-    sstemp = htons((gsfsShort) dtemp);
-    memcpy(p, &sstemp, 2);
-    p += 2;
-
-    /* The next two byte value contains the transmit beam width value in degrees */
-    dtemp = sdata->gsfEM4ImagerySpecific.tx_beam_width * 10.0;
-    if (dtemp < 0.0)
-    {
-        dtemp -= 0.501;
-    }
-    else
-    {
-        dtemp += 0.501;
-    }
-    stemp = htons((gsfuShort) dtemp);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* The next two byte value contains the TVG cross over anlge in degrees */
-    dtemp = sdata->gsfEM4ImagerySpecific.tvg_cross_over * 10.0;
-    if (dtemp < 0.0)
-    {
-        dtemp -= 0.501;
-    }
-    else
-    {
-        dtemp += 0.501;
-    }
-    stemp = htons((gsfuShort) dtemp);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next two bytes contain the imagery offset value used to positive bias the imagery values. This value has been added to all imagery samples
-     *  as the Kongsberg imagery datagram is decoded into GSF.
-     */
-    sstemp = htons((gsfsShort) sdata->gsfEM4ImagerySpecific.offset);
-    memcpy(p, &sstemp, 2);
-    p += 2;
-
-    /* Next two bytes contain the imagery scale value as specified by the manufacturer.  This value is 10 for the EM710/EM302/EM122/EM2040.
-     *  The following formula can be used to convert from the GSF positive biased value to dB:
-     *  dB_value = (GSF_I_value - offset) / scale
-     */
-    sstemp = htons((gsfsShort) sdata->gsfEM4ImagerySpecific.scale);
-    memcpy(p, &sstemp, 2);
-    p += 2;
-
-    /* write the spare bytes */
-    memcpy(p, sdata->gsfEM4ImagerySpecific.spare, 20);
-    p += 20;
-
-    return (p - sptr);
-}
-
-/********************************************************************
- *
- * Function Name : EncodeKlein5410BssSpecific
- *
- * Description : This function encodes the Simrad EM4 series sensor
- *  specific imagery information into external byte stream form.
- *
- * Inputs :
- *    sptr = a pointer to an unsigned char buffer to write into
- *    sdata = a pointer to a union of sensor specific imagery data.
- *
- * Returns : This function returns the number of bytes encoded.
- *
- * Error Conditions : none
- *
- ********************************************************************/
-
-static int
-EncodeKlein5410BssImagerySpecific(unsigned char *sptr, gsfSensorImagery *sdata)
-{
-    int i;
-    unsigned char  *p = sptr;
-    gsfuShort       stemp;
-
-    /* First two bytes contain the descriptor for resolution mode. */
-    stemp = htons((gsfuShort) sdata->gsfKlein5410BssImagerySpecific.res_mode);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next two bytes contain the TVG page. */
-    stemp = htons((gsfuShort) sdata->gsfKlein5410BssImagerySpecific.tvg_page);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next 10 bytes contain an array of beam identifiers */
-    for (i = 0; i < 5; i++)
-    {
-        stemp = htons((gsfuShort) sdata->gsfKlein5410BssImagerySpecific.beam_id[i]);
-        memcpy(p, &stemp, 2);
-        p += 2;
-    }
-
-    /* write the spare bytes */
-    memcpy(p, sdata->gsfReson8100ImagerySpecific.spare, 4);
-    p += 4;
-
-    return (p - sptr);
-}
-
-/********************************************************************
- *
- * Function Name : EncodeReson7100ImagerySpecific
- *
- * Description : This function encodes the Reson 7100 series sensor
- *  specific imagery information into external byte stream form.
- *
- * Inputs :
- *    sptr = a pointer to an unsigned char buffer to write into
- *    sdata = a pointer to a union of sensor specific imagery data.
- *
- * Returns : This function returns the number of bytes encoded.
- *
- * Error Conditions : none
- *
- ********************************************************************/
-
-static int
-EncodeReson7100ImagerySpecific(unsigned char *sptr, gsfSensorImagery *sdata)
-{
-    unsigned char  *p = sptr;
-    gsfuShort       stemp;
-
-    stemp = htons ((gsfuShort) sdata->gsfReson7100ImagerySpecific.size);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* write the spare bytes */
-    memcpy(p, sdata->gsfReson7100ImagerySpecific.spare, 64);
-    p += 64;
-
-    return (p - sptr);
-}
-
-/********************************************************************
- *
- * Function Name : EncodeReson8100ImagerySpecific
- *
- * Description : This function encodes the Reson 8100 series sensor
- *  specific imagery information into external byte stream form.
- *
- * Inputs :
- *    sptr = a pointer to an unsigned char buffer to write into
- *    sdata = a pointer to a union of sensor specific imagery data.
- *
- * Returns : This function returns the number of bytes encoded.
- *
- * Error Conditions : none
- *
- ********************************************************************/
-
-static int
-EncodeReson8100ImagerySpecific(unsigned char *sptr, gsfSensorImagery *sdata)
-{
-    unsigned char  *p = sptr;
-
-    /* write the spare bytes */
-    memcpy(p, sdata->gsfReson8100ImagerySpecific.spare, 8);
-    p += 8;
-
-    return (p - sptr);
-}
-
-/********************************************************************
- *
- * Function Name : EncodeR2SonicImagerySpecific
- *
- * Description : This function encodes the R2Sonic 2020/2022/2024
- *  sensor specific imagery information into external byte stream form.
- *
- * Inputs :
- *    sptr = a pointer to an unsigned char buffer to write into
- *    sdata = a pointer to a union of sensor specific data.
- *
- * Returns : This function returns the number of bytes encoded.
- *
- * Error Conditions : none
- *
- ********************************************************************/
-static int
-EncodeR2SonicImagerySpecific(unsigned char *sptr, gsfSensorImagery *sdata)
-{
-    int i;
-    unsigned char  *p = sptr;
-    gsfuShort       stemp;
-    gsfuLong        ltemp;
-    double          dtemp;
-
-    /* The next 12 bytes contains the model number */
-    memcpy (p, (unsigned char *) (sdata->gsfR2SonicImagerySpecific.model_number), 12);
-    p += 12;
-
-    /* The next 12 bytes contains the serial number */
-    memcpy (p, (unsigned char *) (sdata->gsfR2SonicImagerySpecific.serial_number), 12);
-    p += 12;
-
-    /* The next four bytes contains the time in seconds */
-    ltemp = htonl((gsfuLong) sdata->gsfR2SonicImagerySpecific.dg_time.tv_sec);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* The next four bytes contains the fractional portion of the time in nanoseconds */
-    ltemp = htonl((gsfuLong) sdata->gsfR2SonicImagerySpecific.dg_time.tv_nsec);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* The next four bytes contains the ping number */
-    ltemp = htonl((gsfuLong) sdata->gsfR2SonicImagerySpecific.ping_number);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* The next four bytes contains the ping period * 1,000,000 */
-    dtemp = (sdata->gsfR2SonicImagerySpecific.ping_period * 1.0e6) + 0.501;
-    ltemp = htonl((gsfuLong) dtemp);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* The next four bytes contains the sound speed * 100 */
-    dtemp = (sdata->gsfR2SonicImagerySpecific.sound_speed * 1.0e2) + 0.501;
-    ltemp = htonl((gsfuLong) dtemp);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* The next four bytes contains the frequency * 1000 */
-    dtemp = (sdata->gsfR2SonicImagerySpecific.frequency * 1.0e3) + 0.501;
-    ltemp = htonl((gsfuLong) dtemp);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* The next four bytes contains the transmit source level * 100 */
-    dtemp = (sdata->gsfR2SonicImagerySpecific.tx_power * 1.0e2) + 0.501;
-    ltemp = htonl((gsfuLong) dtemp);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* The next four bytes contains the transmit pulse width * 10,000,000.0*/
-    dtemp = (sdata->gsfR2SonicImagerySpecific.tx_pulse_width * 1.0e7) + 0.501;
-    ltemp = htonl((gsfuLong) dtemp);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* The next four bytes contains the transmit beamwidth in the vertical * 1,000,000 */
-    dtemp = (sdata->gsfR2SonicImagerySpecific.tx_beamwidth_vert * 1.0e6) + 0.501;
-    ltemp = htonl((gsfuLong) dtemp);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* The next four bytes contains the transmit beamwidth in the horizontal * 1,000,000*/
-    dtemp = (sdata->gsfR2SonicImagerySpecific.tx_beamwidth_horiz * 1.0e6) + 0.501;
-    ltemp = htonl((gsfuLong) dtemp);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* The next four bytes contains the transmit steering in the vertical  * 1,000,000*/
-    dtemp = sdata->gsfR2SonicImagerySpecific.tx_steering_vert * 1.0e6;
-    if (dtemp < 0.0)
-        dtemp -= 0.501;
-    else
-        dtemp += 0.501;
-    ltemp = htonl((gsfuLong) dtemp);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* The next four bytes contains the transmit steering in the horizontal  * 1,000,000*/
-    dtemp = sdata->gsfR2SonicImagerySpecific.tx_steering_horiz * 1.0e6;
-    if (dtemp < 0.0)
-        dtemp -= 0.501;
-    else
-        dtemp += 0.501;
-    ltemp = htonl((gsfuLong) dtemp);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* The next four bytes contains misc. transmit info */
-    ltemp = htonl((gsfuLong) sdata->gsfR2SonicImagerySpecific.tx_misc_info);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* The next four bytes contains the receiver bandwidth * 10,000 */
-    dtemp = (sdata->gsfR2SonicImagerySpecific.rx_bandwidth * 1.0e4) + 0.501;
-    ltemp = htonl((gsfuLong) dtemp);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* The next four bytes contains the receiver sample rate * 1000 */
-    dtemp = (sdata->gsfR2SonicImagerySpecific.rx_sample_rate * 1.0e3) + 0.501;
-    ltemp = htonl((gsfuLong) dtemp);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* The next four bytes contains the receiver range * 100,000 */
-    dtemp = (sdata->gsfR2SonicImagerySpecific.rx_range * 1.0e5) + 0.501;
-    ltemp = htonl((gsfuLong) dtemp);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* The next four bytes contains the receiver gain * 100 */
-    dtemp = (sdata->gsfR2SonicImagerySpecific.rx_gain * 1.0e2) + 0.501;
-    ltemp = htonl((gsfuLong) dtemp);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* The next four bytes contains the receiver spreading law coefficient * 1000 */
-    dtemp = (sdata->gsfR2SonicImagerySpecific.rx_spreading * 1.0e3) + 0.501;
-    ltemp = htonl((gsfuLong) dtemp);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* The next four bytes contains the receiver absorption coefficient * 1000 */
-    dtemp = (sdata->gsfR2SonicImagerySpecific.rx_absorption * 1.0e3) + 0.501;
-    ltemp = htonl((gsfuLong) dtemp);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* The next four bytes contains the receiver mount tilt angle * 1,000,000 */
-    dtemp = sdata->gsfR2SonicImagerySpecific.rx_mount_tilt * 1.0e6;
-    if (dtemp < 0.0)
-        dtemp -= 0.501;
-    else
-        dtemp += 0.501;
-    ltemp = htonl((gsfuLong) dtemp);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* The next four bytes contains misc. receiver info */
-    ltemp = htonl((gsfuLong) sdata->gsfR2SonicImagerySpecific.rx_misc_info);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* The next two bytes are reserved */
-    stemp = htons((gsfuShort) sdata->gsfR2SonicImagerySpecific.reserved);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* The next two bytes are for the number of beams */
-    stemp = htons((gsfuShort) sdata->gsfR2SonicImagerySpecific.num_beams);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* The next set of 6x4 (24) bytes contains "more_info" from the SNI0 datagram */
-    for (i=0; i<6; i++)
-    {
-        dtemp = sdata->gsfR2SonicImagerySpecific.more_info[i] * 1.0e6;
-        if (dtemp < 0.0)
-            dtemp -= 0.501;
-        else
-            dtemp += 0.501;
-        ltemp = htonl((gsfuLong) dtemp);
-        memcpy(p, &ltemp, 4);
-        p += 4;
-    }
-
-    /* write the spare bytes */
-    memcpy(p, sdata->gsfR2SonicImagerySpecific.spare, 32);
-    p += 32;
-
-    return (p - sptr);
-} /* end EncodeR2SonicImagerySpecific() */
-/********************************************************************
- *
- * Function Name : EncodeBRBIntensity
- *
- * Description : This function encodes the Bathymetric Receive Beam
- *  time series intensity information into external byte stream form.
- *
- * Inputs :
- *    sptr = a pointer to an unsigned char buffer to write into
- *    idata = a pointer to the gsfBRBIntensity structure containg
- *            imagery data
- *    num_beams = the integer number of beams (number of
- *                gsfTimeSeriesIntensity structures in the array)
- *    sensor_id = the sensor specific subrecord id
- *
- * Returns : This function returns the number of bytes encoded.
- *
- * Error Conditions : none
- *
- ********************************************************************/
-
-static int
-EncodeBRBIntensity(unsigned char *sptr, gsfBRBIntensity *idata, int num_beams, int sensor_id, int bytes_used)
-{
-    unsigned char  *ptr = sptr;
-    unsigned char  *temp_ptr;
-    gsfuLong        ltemp;
-    gsfuShort       stemp;
-    int             i, j;
-    int             size;
-    int             sensor_size;
-    int             bytes_per_sample;
-    unsigned char   bytes_to_pack[4];
-
-    /* check to make sure the bits per sample value is supported */
-    if ((idata->bits_per_sample != 8) &&
-        (idata->bits_per_sample != 12) &&
-        (idata->bits_per_sample != 16) &&
-        (idata->bits_per_sample != 32))
-    {
-        /* unsupported number of bits per sample, return an error */
-        gsfError = GSF_MB_PING_RECORD_ENCODE_FAILED;
-        return -1;
-    }
-
-    /* Save the current pointer, and leave room for the four byte subrecord identifier. */
-    temp_ptr = ptr;
-    ptr += 4;
-
-    /* write the bits per sample */
-    *ptr = idata->bits_per_sample;
-    ptr += 1;
-
-    /* write the sample applied corrections description */
-    ltemp = htonl(idata->applied_corrections);
-    memcpy(ptr, &ltemp, 4);
-    ptr += 4;
-
-    /* write the spare header bytes */
-    memcpy(ptr, idata->spare, 16);
-    ptr += 16;
-
-    /* write the sensor specifiuc imagery info */
-    switch (sensor_id)
-    {
-        case (GSF_SWATH_BATHY_SUBRECORD_EM2000_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_EM3000_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_EM1002_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_EM300_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_EM120_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_EM3002_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_EM3000D_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_EM3002D_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_EM121A_SIS_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_EM2000_RAW_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_EM3000_RAW_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_EM1002_RAW_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_EM300_RAW_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_EM120_RAW_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_EM3002_RAW_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_EM3000D_RAW_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_EM3002D_RAW_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_EM121A_SIS_RAW_SPECIFIC):
-            sensor_size = EncodeEM3ImagerySpecific(ptr, &idata->sensor_imagery);
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_RESON_7125_SPECIFIC):
-            sensor_size = EncodeReson7100ImagerySpecific(ptr, &idata->sensor_imagery);
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_RESON_8101_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_RESON_8111_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_RESON_8124_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_RESON_8125_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_RESON_8150_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_RESON_8160_SPECIFIC):
-            sensor_size = EncodeReson8100ImagerySpecific(ptr, &idata->sensor_imagery);
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_EM122_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_EM302_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_EM710_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_EM2040_SPECIFIC):
-            sensor_size = EncodeEM4ImagerySpecific(ptr, &idata->sensor_imagery);
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_KLEIN_5410_BSS_SPECIFIC):
-            sensor_size = EncodeKlein5410BssImagerySpecific(ptr, &idata->sensor_imagery);
-            break;
-
-        case (GSF_SWATH_BATHY_SUBRECORD_R2SONIC_2020_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_R2SONIC_2022_SPECIFIC):
-        case (GSF_SWATH_BATHY_SUBRECORD_R2SONIC_2024_SPECIFIC):
-            sensor_size = EncodeR2SonicImagerySpecific(ptr, &idata->sensor_imagery);
-            break;
-
-        default:
-            sensor_size = 0;
-            break;
-    }
-    ptr += sensor_size;
-
-    bytes_per_sample = idata->bits_per_sample / 8;
-    for (i = 0; i < num_beams; i++)
-    {
-
-        /* check to see if the GSF_MAX_RECORD_SIZE will get exceeded */
-        if (12 + idata->time_series[i].sample_count * idata->bits_per_sample / 8  + bytes_used + ptr - sptr > GSF_MAX_RECORD_SIZE)
-        {
-            /* the GSF_MAX_RECORD_SIZE would be exceeded. return an error */
-            gsfError = GSF_RECORD_SIZE_ERROR;
-            return -1;
-        }
-
-        stemp = htons ((gsfuShort) idata->time_series[i].sample_count);
-        memcpy(ptr, &stemp, 2);
-        ptr += 2;
-
-        stemp = htons ((gsfuShort) idata->time_series[i].detect_sample);
-        memcpy(ptr, &stemp, 2);
-        ptr += 2;
-
-        memset(ptr, 0, 8);
-        ptr += 8;
-
-        if (idata->bits_per_sample == 12)
-        {
-            for (j = 0; j < idata->time_series[i].sample_count; j+=2)
-            {
-                /* pack 2 samples into 3 bytes */
-
-                /* pack the first sample */
-                ltemp = htonl ((gsfuLong) idata->time_series[i].samples[j]);
-                memcpy (bytes_to_pack, &ltemp, 4);
-
-                /* Although bytes_to_pack is 4 bytes, we know that bytes 0 and 1 are zero. */
-                /* We want to save the lower bits of byte 2 in the upper bits of ptr[0] (we */
-                /* know the upper bits of byte 2 are zero) */
-                ptr[0] = bytes_to_pack[2] << 4;
-
-                /* We sant to save the upper bits of bytes_to_pack[3] in the lower bits of */
-                /* ptr[0].  The lower bits of bytes_to_pack[3] need to be saved in the upper */
-                /* bits of ptr[1] */
-                ptr[0] |= (bytes_to_pack[3] & 0xf0) >> 4;
-                ptr[1] = bytes_to_pack[3] << 4;
-                if (j+1 < idata->time_series[i].sample_count)
-                {
-                    /* pack the second sample */
-                    ltemp = htonl ((gsfuLong) idata->time_series[i].samples[j+1]);
-                    memcpy (bytes_to_pack, &ltemp, 4);
-                    /* We know the upper bits of bytes_to_pack[2] are 0, so save the lower */
-                    /* bits in the lower bits of ptr[1].  Then save bytes_to_pack[3] in ptr[2] */
-                    ptr[1] |= (bytes_to_pack[2] & 0x0f);
-                    ptr[2] = bytes_to_pack[3];
-                }
-                else
-                {
-                    ptr[2] = 0;
-                }
-                ptr += 3;
-            }
-        }
-        else
-        {
-            for (j=0; j < idata->time_series[i].sample_count; j++)
-            {
-                if (bytes_per_sample == 1)
-                {
-                    *ptr = (unsigned char) idata->time_series[i].samples[j];
-                    ptr++;;
-                }
-                else if (bytes_per_sample == 2)
-                {
-                    stemp = htons ((gsfuShort) idata->time_series[i].samples[j]);
-                    memcpy(ptr, &stemp, 2);
-                    ptr += 2;
-                }
-                else if (bytes_per_sample == 4)
-                {
-                    ltemp = htonl ((gsfuLong) idata->time_series[i].samples[j]);
-                    memcpy(ptr, &ltemp, 4);
-                    ptr += 4;
-                }
-                else
-                {
-                    memcpy (ptr, &idata->time_series[i].samples[j], bytes_per_sample);
-                    ptr += bytes_per_sample;
-                }
-            }
-        }
-    }
-
-    /* subrecord identifier has array id in first byte, and size in the
-    *  remaining three bytes
-    */
-    size = ptr - sptr;
-    ltemp = GSF_SWATH_BATHY_SUBRECORD_INTENSITY_SERIES_ARRAY << 24;
-    ltemp |= size;
-    ltemp = htonl(ltemp);
-    memcpy(temp_ptr, &ltemp, 4);
-
-    return (ptr - sptr);
-}
-
-/********************************************************************
- *
- * Function Name : gsfEncodeSoundVelocityProfile
- *
- * Description : This function encodes a gsf sound velocity profile record
- *  from internal form to external byte stream form.
- *
- * Inputs :
- *    sptr = a pointer to an unsigned char buffer to be written to
- *    svp = a pointer to the gsfSVP structure to read from
- *
- * Returns : This function returns the number of bytes encoded.
- *
- * Error Conditions : none
- *
- ********************************************************************/
-
-int
-gsfEncodeSoundVelocityProfile(unsigned char *sptr, gsfSVP * svp)
-{
-    unsigned char  *p = sptr;
-    double          dtemp;
-    gsfuLong        ltemp;
-    gsfsLong        signed_int;
-    int             i;
-
-    /* First four byte integer contains the observation time seconds */
-    ltemp = htonl(svp->observation_time.tv_sec);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* Next four byte integer contains the observation time nanoseconds */
-    ltemp = htonl(svp->observation_time.tv_nsec);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* Next four byte integer contains the seconds portion of the time the
-    *  new profile was put into use by the sonar system
-    */
-    ltemp = htonl(svp->application_time.tv_sec);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* Next four byte integer contains the application time nanoseconds */
-    ltemp = htonl(svp->application_time.tv_nsec);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* Next four byte integer contains the longitude of profile observation.
-     * Round the scaled quantity to the nearest whole integer.
-     */
-    dtemp = svp->longitude * 1.0e7;
-    if (dtemp < 0.0)
-    {
-        dtemp -= 0.501;
-    }
-    else
-    {
-        dtemp += 0.501;
-    }
-    signed_int = htonl((gsfsLong) dtemp);
-    memcpy(p, &signed_int, 4);
-    p += 4;
-
-    /* Next four byte integer contains the latitude. Round the scaled
-     * quantity to the nearest whole integer.
-     */
-    dtemp = svp->latitude * 1.0e7;
-    if (dtemp < 0.0)
-    {
-        dtemp -= 0.501;
-    }
-    else
-    {
-        dtemp += 0.501;
-    }
-    signed_int = htonl((gsfsLong) dtemp);
-    memcpy(p, &signed_int, 4);
-    p += 4;
-
-    /* Next four byte integer contains the number of points in the profile */
-    ltemp = htonl((gsfuLong) (svp->number_points));
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* Now loop to encode the depth/sound speed pairs
-    * Scale both the depth and sound speed by 100
-    */
-    for (i = 0; i < svp->number_points; i++)
-    {
-        /* Next four byte integer contains the depth. Round the scaled
-         * quantity to the nearest whole integer.
-         */
-        dtemp = svp->depth[i] * 100.0;
-        if (dtemp < 0.0)
-        {
-            dtemp -= 0.501;
-        }
-        else
-        {
-            dtemp += 0.501;
-        }
-        ltemp = htonl((gsfuLong) dtemp);
-        memcpy(p, &ltemp, 4);
-        p += 4;
-
-        /* Next four byte integer contains the sound_speed. Round the scaled
-         * quantity to the nearest whole integer.
-         */
-        dtemp = svp->sound_speed[i] * 100.0;
-        if (dtemp < 0.0)
-        {
-            dtemp -= 0.501;
-        }
-        else
-        {
-            dtemp += 0.501;
-        }
-        ltemp = htonl((gsfuLong) dtemp);
-        memcpy(p, &ltemp, 4);
-        p += 4;
-    }
-
-    return (p - sptr);
-}
-
-/********************************************************************
- *
- * Function Name : gsfEncodeProcessingParameters
- *
- * Description : This function encodes into external gsf byte stream form
- *  a record of processing parameters.
- *
- * Inputs :
- *    sptr = a pointer to an unsigned char buffer to write to
- *    param = a pointer to the gsfProcessingParameters structure to read from
- *
- * Returns : This function returns the number of bytes encoded
- *
- * Error Conditions : none
- *
- ********************************************************************/
-
-int
-gsfEncodeProcessingParameters(unsigned char *sptr, gsfProcessingParameters * param)
-{
-    unsigned char  *p = sptr;
-    gsfuLong        ltemp;
-    gsfuShort       stemp;
-    short           len;
-    int             i;
-
-    /* First four byte integer contains the seconds portion of the time
-    *  application of the new parameters.
-    */
-    ltemp = htonl(param->param_time.tv_sec);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* Next four byte integer contains the application time nanoseconds */
-    ltemp = htonl(param->param_time.tv_nsec);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* Next two byte integer contains the number of parameters in this record */
-    stemp = htons(param->number_parameters);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Now loop to encode these parameters */
-    for (i = 0; i < param->number_parameters; i++)
-    {
-        /* next is the size of the parameter name as a two byte integer */
-        len = strlen(param->param[i]) + 1;       /* add one to carry null */
-        if (len != param->param_size[i])
-        {
-            param->param_size[i] = len;
-        }
-        stemp = htons(param->param_size[i]);
-        memcpy(p, &stemp, 2);
-        p += 2;
-        memcpy(p, param->param[i], param->param_size[i]);
-        p += param->param_size[i];
-    }
-    return (p - sptr);
-}
-
-/********************************************************************
- *
- * Function Name : gsfEncodeSensorParameters
- *
- * Description : This function encodes into external gsf byte stream form
- *  a record of sonar parameters.
- *
- * Inputs :
- *    sptr = a pointer to an unsigned char buffer to write to
- *    param = a pointer to a gsfSensorParameters structure to read from
- *
- * Returns : This function returns the number of bytes encoded
- *
- * Error Conditions : none
- *
- ********************************************************************/
-
-int
-gsfEncodeSensorParameters(unsigned char *sptr, gsfSensorParameters * param)
-{
-    unsigned char  *p = sptr;
-    gsfuLong        ltemp;
-    gsfuShort       stemp;
-    short           len;
-    int             i;
-
-    /* First four byte integer contains the seconds portion of the time
-    *  application of the new parameters.
-    */
-    ltemp = htonl(param->param_time.tv_sec);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* Next four byte integer contains the application time nanoseconds */
-    ltemp = htonl(param->param_time.tv_nsec);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* Next two byte integer contains the number of parameters in this record */
-    stemp = htons(param->number_parameters);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Now loop to encode these parameters */
-    for (i = 0; i < param->number_parameters; i++)
-    {
-        /* next is the size of the parameter name as a two byte integer */
-        len = strlen(param->param[i]) + 1;     /* add one to carry null */
-        if (len != param->param_size[i])
-        {
-            param->param_size[i] = len;
-        }
-        stemp = htons(param->param_size[i]);
-        memcpy(p, &stemp, 2);
-        p += 2;
-        memcpy(p, param->param[i], param->param_size[i]);
-        p += param->param_size[i];
-    }
-    return (p - sptr);
-}
-
-/********************************************************************
- *
- * Function Name : gsfEncodeComment
- *
- * Description : This function is used to encode a gsfComment record
- *  from internal to external byte stream form.
- *
- * Inputs :
- *    sptr = a pointer to an unsigned char buffer to be written to
- *    comment = a pointer to the gsfComment structure to read from
- *
- * Returns : This function returns the number of bytes encoded.
- *
- * Error Conditions : none
- *
- ********************************************************************/
-
-int
-gsfEncodeComment(unsigned char *sptr, gsfComment * comment)
-{
-    unsigned char  *p = sptr;
-    gsfuLong        ltemp;
-
-    /* First four byte integer contains the seconds portion of the time
-    *  the operator comment was made.
-    */
-    ltemp = htonl(comment->comment_time.tv_sec);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* Next four byte integer contains the nanoseconds portion of the
-    * comment time
-    */
-    ltemp = htonl(comment->comment_time.tv_nsec);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* Next four byte integer contains the length of the comment */
-    ltemp = htonl(comment->comment_length);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* Next "length" bytes contain the operator comment */
-    memcpy(p, comment->comment, comment->comment_length);
-    p += comment->comment_length;
-
-    return (p - sptr);
-}
-
-/********************************************************************
- *
- * Function Name : gsfEncodeHistory
- *
- * Description : This function encodes a gsf history record from internal
- *  to external byte stream form.
- *
- * Inputs :
- *    sptr = a pointer to an unsigned char buffer to write to
- *    history = a pointer to a gsfHistory structure to read from
- *
- * Returns : This function returns the number of bytes encoded.
- *
- * Error Conditions : none
- *
- ********************************************************************/
-
-int
-gsfEncodeHistory(unsigned char *sptr, gsfHistory * history)
-{
-    unsigned char  *p = sptr;
-    int             len;
-    gsfuLong        ltemp;
-    gsfuShort       stemp;
-
-    /* First four byte integer contains the seconds portion of the time
-    *  the history record was added to the data.
-    */
-    ltemp = htonl(history->history_time.tv_sec);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* Next four byte integer contains the nanoseconds portion of the
-    * history time.
-    */
-    ltemp = htonl(history->history_time.tv_nsec);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* Next 2 bytes contains the size of the machines host name */
-    len = strlen(history->host_name) + 1;
-    stemp = htons(len);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next "len" bytes contains the host name of the machine used to process the data */
-    memcpy(p, history->host_name, len);
-    p += len;
-
-    /* Next two byte integer contains the size of the of operator field  */
-    len = strlen(history->operator_name) + 1;
-    stemp = htons(len);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next "len" bytes contains the name of the operator who processed this data */
-    memcpy(p, history->operator_name, len);
-    p += len;
-
-    /* Next two byte integer contains the size of the command line field */
-    if (history->command_line == (char *) NULL)
-    {
-        history->command_line = "";
-    }
-    len = strlen(history->command_line) + 1;
-    stemp = htons(len);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next "len" bytes contains the command line used to run the processing program */
-    memcpy(p, history->command_line, len);
-    p += len;
-
-    /* Next two byte integer contains the size of the history record comment */
-    if (history->comment == (char *) NULL)
-    {
-        history->comment = "";
-    }
-    len = strlen(history->comment);
-    stemp = htons(len);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* Next "len" bytes contains the comment for this history record */
-    memcpy(p, history->comment, len);
-    p += len;
-
-    return (p - sptr);
-}
-
-/********************************************************************
- *
- * Function Name : gsfEncodeNavigationError
- *
- * Description : This function encodes a navigation error record from
- *  internal to external byte stream form.
- *
- * Inputs :
- *    sptr = a pointer to an unsigned char buffer to write to
- *    nav_error = a pointer to a gsfNavigationError structure to read from
- *
- * Returns : This function returns the number of bytes encoded.
- *
- * Error Conditions : none
- *
- ********************************************************************/
-
-int
-gsfEncodeNavigationError(unsigned char *sptr, gsfNavigationError * nav_error)
-{
-    unsigned char  *p = sptr;
-    gsfuLong        ltemp;
-
-    /* First four byte integer contains the seconds portion of the time
-    *  of navigation error.
-    */
-    ltemp = htonl(nav_error->nav_error_time.tv_sec);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* Next four byte integer contains the nanoseconds portion of the
-    * history time.
-    */
-    ltemp = htonl(nav_error->nav_error_time.tv_nsec);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* Next four byte integer contains the record id for the record
-    *  containing a position with this error. (registry and type number)
-    */
-    ltemp = htonl(nav_error->record_id);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* Next four byte integer contains the longitude error estimate */
-    ltemp = htonl((gsfuLong) (nav_error->longitude_error * 10.0 + 0.501));
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* Next four byte integer contains the latitude error estimate */
-    ltemp = htonl((gsfuLong) (nav_error->latitude_error * 10.0 + 0.501));
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    return (p - sptr);
-}
-
-/********************************************************************
- *
- * Function Name : gsfEncodeHVNavigationError
- *
- * Description : This function encodes the new horizontal and vertical
- *  navigation error record.
- *
- * Inputs :
- *    sptr = a pointer to an unsigned char buffer to write to
- *    nav_error = a pointer to a gsfHVNavigationError structure to read from
- *
- * Returns : This function returns the number of bytes encoded.
- *
- * Error Conditions : none
- *
- ********************************************************************/
-
-int
-gsfEncodeHVNavigationError(unsigned char *sptr, gsfHVNavigationError *hv_nav_error)
-{
-    double          dtemp;
-    unsigned char  *p = sptr;
-    int             length;
-    gsfsLong        ltemp;
-    gsfsShort       stemp;
-    gsfuShort       utemp;
-
-    /* First four byte integer contains the seconds portion of the time
-    *  of navigation error.
-    */
-    ltemp = htonl(hv_nav_error->nav_error_time.tv_sec);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* The next four byte integer contains the nanoseconds portion of the
-    * history time.
-    */
-    ltemp = htonl(hv_nav_error->nav_error_time.tv_nsec);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* The next four byte integer contains the record id for the record
-    *  containing a position with this error. (registry and type number)
-    */
-    ltemp = htonl(hv_nav_error->record_id);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* The next four byte integer contains the horizontal error estimate */
-    dtemp = (hv_nav_error->horizontal_error * 1000.0);
-    if (dtemp < 0.0)
-    {
-        dtemp -= 0.501;
-    }
-    else
-    {
-        dtemp += 0.501;
-    }
-    ltemp = htonl((gsfsLong) dtemp);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* The next four byte integer contains the vertical error estimate */
-    dtemp = (hv_nav_error->vertical_error * 1000.0);
-    if (dtemp < 0.0)
-    {
-        dtemp -= 0.5;
-    }
-    else
-    {
-        dtemp += 0.5;
-    }
-    ltemp = htonl((gsfsLong) dtemp);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* The next two bytes contains the SEP uncertainty estimate.
-     * This value is always >= 0.0, so rounding is a simple addition
-     */
-    dtemp = (hv_nav_error->SEP_uncertainty * 100.0);
-    dtemp += 0.501;
-    utemp = htons((gsfuShort) dtemp);
-    memcpy(p, &utemp, 2);
-    p += 2;
-
-    /* The next two bytes are reserved for future use */
-    *p = (unsigned char) (hv_nav_error->spare[0]);
-    p += 1;
-    *p = (unsigned char) (hv_nav_error->spare[1]);
-    p += 1;
-
-    /* The next two byte integer contains the length of the positioning system type string */
-    if (hv_nav_error->position_type == (char *) NULL)
-    {
-        length = 0;
-    }
-    else
-    {
-        length = strlen(hv_nav_error->position_type);
-    }
-    stemp = htons(length);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    /* The next length bytes contains the positioning system type string. */
-    if (hv_nav_error->position_type == (char *) NULL)
-    {
-        /* Put a null chacter down only if there is no string to record */
-        *p = '\0';
-        p += 1;
-    }
-    else
-    {
-        memcpy(p, hv_nav_error->position_type, length);
-        p += length;
-    }
-
-    return (p - sptr);
-}
-
-static void LocalSubtractTimes (struct timespec *base_time, struct timespec *subtrahend, double *difference)
-{
-    double fraction = 0.0;
-    double seconds  = 0.0;
-
-    seconds  = difftime(base_time->tv_sec, subtrahend->tv_sec);
-    fraction = ((double)(base_time->tv_nsec - subtrahend->tv_nsec))/1.0e9;
-
-    *difference = seconds + fraction;
-}
-
-/********************************************************************
- *
- * Function Name : gsfEncodeAttitude
- *
- * Description : This function encodes a gsf attitude record from internal
- *  to external byte stream form.
- *
- * Inputs :
- *    sptr = a pointer to an unsigned char buffer to write to
- *    attitude = a pointer to a gsfAttitude structure to read from
- *
- * Returns : This function returns the number of bytes encoded.
- *
- * Error Conditions : none
- *
- ********************************************************************/
-
-int
-gsfEncodeAttitude(unsigned char *sptr, gsfAttitude * attitude)
-{
-    unsigned char  *p = sptr;
-    gsfuLong        ltemp;
-    gsfuShort       stemp;
-    double          dtemp;
-    int             i;
-    struct timespec basetime;
-    double          time_offset;
-
-    /* write the full time for the first time in the record, and save subsequent times
-     *  as an offset from this basetime
-     */
-    basetime = attitude->attitude_time[0];
-
-    /* First four byte integer contains the seconds portion of the base
-     *  time for the attitude record
-     */
-    ltemp = htonl(basetime.tv_sec);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* Next four byte integer contains the nanoseconds portion of the
-    * attitude base time.
-    */
-    ltemp = htonl(basetime.tv_nsec);
-    memcpy(p, &ltemp, 4);
-    p += 4;
-
-    /* Next two byte integer contains the number of measurements */
-    stemp = htons(attitude->num_measurements);
-    memcpy(p, &stemp, 2);
-    p += 2;
-
-    for (i = 0; i < attitude->num_measurements; i++)
-    {
-        /* Next two byte integer contains the time offset from basetime for this
-         * measurement. Round the scaled quantity to the nearest whole integer.
-         */
-        LocalSubtractTimes (&attitude->attitude_time[i], &basetime, &time_offset);
-        stemp = htons((gsfuShort) (time_offset * 1000.0 + 0.501));
-        memcpy(p, &stemp, 2);
-        p += 2;
-
-        /* Next two byte integer contains the pitch. Round the scaled quantity
-         * to the nearest whole integer.
-         */
-        dtemp = attitude->pitch[i] * 100.0;
-        if (dtemp < 0.0)
-        {
-            dtemp -= 0.501;
-        }
-        else
-        {
-            dtemp += 0.501;
-        }
-        stemp = htons((gsfsShort) dtemp);
-        memcpy(p, &stemp, 2);
-        p += 2;
-
-        /* Next two byte integer contains the roll. Round the scaled quantity
-         * to the nearest whole integer.
-         */
-        dtemp = attitude->roll[i] * 100.0;
-        if (dtemp < 0.0)
-        {
-            dtemp -= 0.501;
-        }
-        else
-        {
-            dtemp += 0.501;
-        }
-        stemp = htons((gsfsShort) dtemp);
-        memcpy(p, &stemp, 2);
-        p += 2;
-
-        /* Next two byte integer contains the heave. Round the scaled quantity
-         * to the nearest whole integer.
-         */
-        dtemp = attitude->heave[i] * 100.0;
-        if (dtemp < 0.0)
-        {
-            dtemp -= 0.501;
-        }
-        else
-        {
-            dtemp += 0.501;
-        }
-        stemp = htons((gsfsShort) dtemp);
-        memcpy(p, &stemp, 2);
-        p += 2;
-
-        /* Next two byte integer contains the heading. Round the scaled quantity
-         * to the nearest whole integer.
-         */
-        dtemp = attitude->heading[i] * 100.0;
-        if (dtemp < 0.0)
-        {
-            dtemp -= 0.501;
-        }
-        else
-        {
-            dtemp += 0.501;
-        }
-        stemp = htons((gsfuShort) dtemp);
-        memcpy(p, &stemp, 2);
-        p += 2;
-    }
-
-    return (p - sptr);
-}
-
-/********************************************************************
- *
- * Function Name : gsfSetDefaultScaleFactor
- *
- * Description : This function is used to estimate and set scale
- *               factors for a ping record
- *
- * Inputs :
- *    mb_ping - a pointer to a ping record.  The scale factors
- *              will be set in this record.
- *
- * Returns : This function returns 0.
- *
- * Error Conditions : none
- *
- ********************************************************************/
-int gsfSetDefaultScaleFactor(gsfSwathBathyPing *mb_ping)
-{
-    const double GSF_DEPTH_ASSUMED_HIGHEST_PRECISION = 100;
-    const double GSF_ACROSS_TRACK_ASSUMED_HIGHEST_PRECISION = 100;
-    const double GSF_ALONG_TRACK_ASSUMED_HIGHEST_PRECISION = 100;
-    const double GSF_TRAVEL_TIME_ASSUMED_HIGHEST_PRECISION = 10e6;
-    const double GSF_BEAM_ANGLE_ASSUMED_HIGHEST_PRECISION = 100;
-    const double GSF_MEAN_CAL_AMPLITUDE_ASSUMED_HIGHEST_PRECISION = 10;
-    const double GSF_MEAN_REL_AMPLITUDE_ASSUMED_HIGHEST_PRECISION = 100;
-    const double GSF_ECHO_WIDTH_ASSUMED_HIGHEST_PRECISION = 10e5;
-    const double GSF_QUALITY_FACTOR_ASSUMED_HIGHEST_PRECISION = 100;
-    const double GSF_RECEIVE_HEAVE_ASSUMED_HIGHEST_PRECISION = 100;
-    const double GSF_DEPTH_ERROR_ASSUMED_HIGHEST_PRECISION = 100;
-    const double GSF_ACROSS_TRACK_ERROR_ASSUMED_HIGHEST_PRECISION = 100;
-    const double GSF_ALONG_TRACK_ERROR_ASSUMED_HIGHEST_PRECISION = 100;
-    const double GSF_NOMINAL_DEPTH_ASSUMED_HIGHEST_PRECISION = 100;
-    const double GSF_QUALITY_FLAGS_ASSUMED_HIGHEST_PRECISION = 100;
-    const double GSF_BEAM_FLAGS_ASSUMED_HIGHEST_PRECISION = 100;
-    const double GSF_SIGNAL_TO_NOISE_ASSUMED_HIGHEST_PRECISION = 100;
-    const double GSF_BEAM_ANGLE_FORWARD_ASSUMED_HIGHEST_PRECISION = 100;
-    const double GSF_VERTICAL_ERROR_ASSUMED_HIGHEST_PRECISION = 200;
-    const double GSF_HORIZONTAL_ERROR_ASSUMED_HIGHEST_PRECISION = 200;
-    const double GSF_SECTOR_NUMBER_ASSUMED_HIGHEST_PRECISION = 100;
-    const double GSF_DETECTION_INFO_ASSUMED_HIGHEST_PRECISION = 100;
-    const double GSF_INCIDENT_BEAM_ADJ_ASSUMED_HIGHEST_PRECISION = 100;
-    const double GSF_SYSTEM_CLEANING_ASSUMED_HIGHEST_PRECISION = 100;
-    const double GSF_DOPPLER_CORRECTION_ASSUMED_HIGHEST_PRECISION = 100;
-    const double GSF_SONAR_VERT_UNCERT_ASSUMED_HIGHEST_PRECISION = 100;
-
-    int             i, j; /* iterators */
-    double          *dptr; /* pointer to ping array */
-    unsigned short  *usptr; /* pointer to ping array */
-    unsigned char   *ucptr; /* pointer to ping array */
-    int             id; /* type of ping array subrecord */
-    double          max, min; /* min and max value of each ping array */
-    double          max_scale_factor, min_scale_factor; /* min and max allowable size of values in ping array */
-    double          highest_precision; /* starting value for multiplier */
-
-    for (i = 1; i <= GSF_MAX_PING_ARRAY_SUBRECORDS; i++)
-    {
-        dptr = NULL;
-        usptr = NULL;
-
-        switch (i)
-        {
-            case GSF_SWATH_BATHY_SUBRECORD_DEPTH_ARRAY:
-                dptr = mb_ping->depth;
-                highest_precision = GSF_DEPTH_ASSUMED_HIGHEST_PRECISION;
-                id = GSF_SWATH_BATHY_SUBRECORD_DEPTH_ARRAY;
-                max_scale_factor = USHRT_MAX;
-                min_scale_factor = 0;
-                break;
-            case GSF_SWATH_BATHY_SUBRECORD_ACROSS_TRACK_ARRAY:
-                dptr = mb_ping->across_track;
-                highest_precision = GSF_ACROSS_TRACK_ASSUMED_HIGHEST_PRECISION;
-                id = GSF_SWATH_BATHY_SUBRECORD_ACROSS_TRACK_ARRAY;
-                max_scale_factor = SHRT_MAX;
-                min_scale_factor = SHRT_MIN;
-                break;
-            case GSF_SWATH_BATHY_SUBRECORD_ALONG_TRACK_ARRAY:
-                dptr = mb_ping->along_track;
-                highest_precision = GSF_ALONG_TRACK_ASSUMED_HIGHEST_PRECISION;
-                id = GSF_SWATH_BATHY_SUBRECORD_ALONG_TRACK_ARRAY;
-                max_scale_factor = SHRT_MAX;
-                min_scale_factor = SHRT_MIN;
-                break;
-            case GSF_SWATH_BATHY_SUBRECORD_TRAVEL_TIME_ARRAY:
-                dptr = mb_ping->travel_time;
-                highest_precision = GSF_TRAVEL_TIME_ASSUMED_HIGHEST_PRECISION;
-                id = GSF_SWATH_BATHY_SUBRECORD_TRAVEL_TIME_ARRAY;
-                max_scale_factor = USHRT_MAX;
-                min_scale_factor = 0;
-                break;
-            case GSF_SWATH_BATHY_SUBRECORD_BEAM_ANGLE_ARRAY:
-                dptr = mb_ping->beam_angle;
-                highest_precision = GSF_BEAM_ANGLE_ASSUMED_HIGHEST_PRECISION;
-                id = GSF_SWATH_BATHY_SUBRECORD_BEAM_ANGLE_ARRAY;
-                max_scale_factor = SHRT_MAX;
-                min_scale_factor = SHRT_MIN;
-                break;
-            case GSF_SWATH_BATHY_SUBRECORD_MEAN_CAL_AMPLITUDE_ARRAY:
-                dptr = mb_ping->mc_amplitude;
-                highest_precision = GSF_MEAN_CAL_AMPLITUDE_ASSUMED_HIGHEST_PRECISION;
-                id = GSF_SWATH_BATHY_SUBRECORD_MEAN_CAL_AMPLITUDE_ARRAY;
-                max_scale_factor = SCHAR_MAX;
-                min_scale_factor = SCHAR_MIN;
-                break;
-            case GSF_SWATH_BATHY_SUBRECORD_MEAN_REL_AMPLITUDE_ARRAY:
-                dptr = mb_ping->mr_amplitude;
-                highest_precision = GSF_MEAN_REL_AMPLITUDE_ASSUMED_HIGHEST_PRECISION;
-                id = GSF_SWATH_BATHY_SUBRECORD_MEAN_REL_AMPLITUDE_ARRAY;
-                max_scale_factor = UCHAR_MAX;
-                min_scale_factor = 0;
-                break;
-            case GSF_SWATH_BATHY_SUBRECORD_ECHO_WIDTH_ARRAY:
-                dptr = mb_ping->echo_width;
-                highest_precision = GSF_ECHO_WIDTH_ASSUMED_HIGHEST_PRECISION;
-                id = GSF_SWATH_BATHY_SUBRECORD_ECHO_WIDTH_ARRAY;
-                max_scale_factor = UCHAR_MAX;
-                min_scale_factor = 0;
-                break;
-            case GSF_SWATH_BATHY_SUBRECORD_QUALITY_FACTOR_ARRAY:
-                dptr = mb_ping->quality_factor;
-                highest_precision = GSF_QUALITY_FACTOR_ASSUMED_HIGHEST_PRECISION;
-                id = GSF_SWATH_BATHY_SUBRECORD_QUALITY_FACTOR_ARRAY;
-                max_scale_factor = UCHAR_MAX;
-                min_scale_factor = 0;
-                break;
-            case GSF_SWATH_BATHY_SUBRECORD_RECEIVE_HEAVE_ARRAY:
-                dptr = mb_ping->receive_heave;
-                highest_precision = GSF_RECEIVE_HEAVE_ASSUMED_HIGHEST_PRECISION;
-                id = GSF_SWATH_BATHY_SUBRECORD_RECEIVE_HEAVE_ARRAY;
-                max_scale_factor = UCHAR_MAX;
-                min_scale_factor = 0;
-                break;
-            case GSF_SWATH_BATHY_SUBRECORD_DEPTH_ERROR_ARRAY:
-                dptr = mb_ping->depth_error;
-                highest_precision = GSF_DEPTH_ERROR_ASSUMED_HIGHEST_PRECISION;
-                id = GSF_SWATH_BATHY_SUBRECORD_DEPTH_ERROR_ARRAY;
-                max_scale_factor = USHRT_MAX;
-                min_scale_factor = 0;
-                break;
-            case GSF_SWATH_BATHY_SUBRECORD_ACROSS_TRACK_ERROR_ARRAY:
-                dptr = mb_ping->across_track_error;
-                highest_precision = GSF_ACROSS_TRACK_ERROR_ASSUMED_HIGHEST_PRECISION;
-                id = GSF_SWATH_BATHY_SUBRECORD_ACROSS_TRACK_ERROR_ARRAY;
-                max_scale_factor = USHRT_MAX;
-                min_scale_factor = 0;
-                break;
-            case GSF_SWATH_BATHY_SUBRECORD_ALONG_TRACK_ERROR_ARRAY:
-                dptr = mb_ping->along_track_error;
-                highest_precision = GSF_ALONG_TRACK_ERROR_ASSUMED_HIGHEST_PRECISION;
-                id = GSF_SWATH_BATHY_SUBRECORD_ALONG_TRACK_ERROR_ARRAY;
-                max_scale_factor = USHRT_MAX;
-                min_scale_factor = 0;
-                break;
-            case GSF_SWATH_BATHY_SUBRECORD_NOMINAL_DEPTH_ARRAY:
-                dptr = mb_ping->nominal_depth;
-                highest_precision = GSF_NOMINAL_DEPTH_ASSUMED_HIGHEST_PRECISION;
-                id = GSF_SWATH_BATHY_SUBRECORD_NOMINAL_DEPTH_ARRAY;
-                max_scale_factor = USHRT_MAX;
-                min_scale_factor = 0;
-                break;
-            case GSF_SWATH_BATHY_SUBRECORD_QUALITY_FLAGS_ARRAY:
-                ucptr = mb_ping->quality_flags;
-                highest_precision = GSF_QUALITY_FLAGS_ASSUMED_HIGHEST_PRECISION;
-                id = GSF_SWATH_BATHY_SUBRECORD_QUALITY_FLAGS_ARRAY;
-                max_scale_factor = UCHAR_MAX;
-                min_scale_factor = 0;
-                break;
-            case GSF_SWATH_BATHY_SUBRECORD_BEAM_FLAGS_ARRAY:
-                ucptr = mb_ping->beam_flags;
-                highest_precision = GSF_BEAM_FLAGS_ASSUMED_HIGHEST_PRECISION;
-                id = GSF_SWATH_BATHY_SUBRECORD_BEAM_FLAGS_ARRAY;
-                max_scale_factor = UCHAR_MAX;
-                min_scale_factor = 0;
-                break;
-            case GSF_SWATH_BATHY_SUBRECORD_SIGNAL_TO_NOISE_ARRAY:
-                dptr = mb_ping->signal_to_noise;
-                highest_precision = GSF_SIGNAL_TO_NOISE_ASSUMED_HIGHEST_PRECISION;
-                id = GSF_SWATH_BATHY_SUBRECORD_SIGNAL_TO_NOISE_ARRAY;
-                max_scale_factor = UCHAR_MAX;
-                min_scale_factor = 0;
-                break;
-            case GSF_SWATH_BATHY_SUBRECORD_BEAM_ANGLE_FORWARD_ARRAY:
-                dptr = mb_ping->beam_angle_forward;
-                highest_precision = GSF_BEAM_ANGLE_FORWARD_ASSUMED_HIGHEST_PRECISION;
-                id = GSF_SWATH_BATHY_SUBRECORD_BEAM_ANGLE_FORWARD_ARRAY;
-                max_scale_factor = USHRT_MAX;
-                min_scale_factor = 0;
-                break;
-            case GSF_SWATH_BATHY_SUBRECORD_VERTICAL_ERROR_ARRAY:
-                dptr = mb_ping->vertical_error;
-                highest_precision = GSF_VERTICAL_ERROR_ASSUMED_HIGHEST_PRECISION;
-                id = GSF_SWATH_BATHY_SUBRECORD_VERTICAL_ERROR_ARRAY;
-                max_scale_factor = USHRT_MAX;
-                min_scale_factor = 0;
-                break;
-            case GSF_SWATH_BATHY_SUBRECORD_HORIZONTAL_ERROR_ARRAY:
-                dptr = mb_ping->horizontal_error;
-                highest_precision = GSF_HORIZONTAL_ERROR_ASSUMED_HIGHEST_PRECISION;
-                id = GSF_SWATH_BATHY_SUBRECORD_HORIZONTAL_ERROR_ARRAY;
-                max_scale_factor = USHRT_MAX;
-                min_scale_factor = 0;
-                break;
-            case GSF_SWATH_BATHY_SUBRECORD_SECTOR_NUMBER_ARRAY:
-                usptr = mb_ping->sector_number;
-                highest_precision = GSF_SECTOR_NUMBER_ASSUMED_HIGHEST_PRECISION;
-                id = GSF_SWATH_BATHY_SUBRECORD_SECTOR_NUMBER_ARRAY;
-                max_scale_factor = UCHAR_MAX;
-                min_scale_factor = 0;
-                break;
-            case GSF_SWATH_BATHY_SUBRECORD_DETECTION_INFO_ARRAY:
-                usptr = mb_ping->detection_info;
-                highest_precision = GSF_DETECTION_INFO_ASSUMED_HIGHEST_PRECISION;
-                id = GSF_SWATH_BATHY_SUBRECORD_DETECTION_INFO_ARRAY;
-                max_scale_factor = UCHAR_MAX;
-                min_scale_factor = 0;
-                break;
-            case GSF_SWATH_BATHY_SUBRECORD_INCIDENT_BEAM_ADJ_ARRAY:
-                dptr = mb_ping->incident_beam_adj;
-                highest_precision = GSF_INCIDENT_BEAM_ADJ_ASSUMED_HIGHEST_PRECISION;
-                id = GSF_SWATH_BATHY_SUBRECORD_INCIDENT_BEAM_ADJ_ARRAY;
-                max_scale_factor = SCHAR_MAX;
-                min_scale_factor = SCHAR_MIN;
-                break;
-            case GSF_SWATH_BATHY_SUBRECORD_SYSTEM_CLEANING_ARRAY:
-                usptr = mb_ping->system_cleaning;
-                highest_precision = GSF_SYSTEM_CLEANING_ASSUMED_HIGHEST_PRECISION;
-                id = GSF_SWATH_BATHY_SUBRECORD_SYSTEM_CLEANING_ARRAY;
-                max_scale_factor = UCHAR_MAX;
-                min_scale_factor = 0;
-                break;
-            case GSF_SWATH_BATHY_SUBRECORD_DOPPLER_CORRECTION_ARRAY:
-                dptr = mb_ping->doppler_corr;
-                highest_precision = GSF_DOPPLER_CORRECTION_ASSUMED_HIGHEST_PRECISION;
-                id = GSF_SWATH_BATHY_SUBRECORD_DOPPLER_CORRECTION_ARRAY;
-                max_scale_factor = SCHAR_MAX;
-                min_scale_factor = SCHAR_MIN;
-                break;
-            case GSF_SWATH_BATHY_SUBRECORD_SONAR_VERT_UNCERT_ARRAY:
-                dptr = mb_ping->sonar_vert_uncert;
-                highest_precision = GSF_SONAR_VERT_UNCERT_ASSUMED_HIGHEST_PRECISION;
-                id = GSF_SWATH_BATHY_SUBRECORD_SONAR_VERT_UNCERT_ARRAY;
-                max_scale_factor = USHRT_MAX;
-                min_scale_factor = 0;
-                break;
-
-        }
-
-        if (dptr != NULL || usptr != NULL)
-        {
-            max = DBL_MIN;
-            min = DBL_MAX;
-
-            if (dptr != NULL)
-            {
-                for (j = 0; j < mb_ping->number_beams; j++)
-                {
-                    if (dptr[j] > max)
-                        max = dptr[j];
-                    if (dptr[j] < min)
-                        min = dptr[j];
-                }
-            }
-            else if (usptr != NULL)
-            {
-                for (j = 0; j < mb_ping->number_beams; j++)
-                {
-                    if (usptr[j] > max)
-                        max = (double) usptr[j];
-                    if (usptr[j] < min)
-                        min = (double) usptr[j];
-                }
-            }
-            else if (ucptr != NULL)
-            {
-                for (j = 0; j < mb_ping->number_beams; j++)
-                {
-                    if (ucptr[j] > max)
-                        max = (double) ucptr[j];
-                    if (ucptr[j] < min)
-                        min = (double) ucptr[j];
-                }
-            }
-
-            mb_ping->scaleFactors.scaleTable[id - 1].offset = 0;
-            mb_ping->scaleFactors.scaleTable[id - 1].multiplier = highest_precision;
-            /* Clear the high order 4 bits of the compression flag field */
-            mb_ping->scaleFactors.scaleTable[id - 1].compressionFlag &= 0x0F;
-            /* set these bits to specify the default field size */
-            mb_ping->scaleFactors.scaleTable[id - 1].compressionFlag |= GSF_FIELD_SIZE_DEFAULT;
-
-            /* apply the multiplier and offset to the maximum value, if
-             * the new value is greater then the max scale factor multiplier
-             * size, decrease the multiplier by 2 until this condition is no
-             * longer violated. */
-            while (((( max + mb_ping->scaleFactors.scaleTable[id - 1].offset) * mb_ping->scaleFactors.scaleTable[id - 1].multiplier) > max_scale_factor)
-                    || ((( min + mb_ping->scaleFactors.scaleTable[id - 1].offset) * mb_ping->scaleFactors.scaleTable[id - 1].multiplier) < min_scale_factor ))
-            {
-                mb_ping->scaleFactors.scaleTable[id - 1].multiplier = (int) ( mb_ping->scaleFactors.scaleTable[id - 1].multiplier / 2.0 );
-            }
-
-
-            if (mb_ping->scaleFactors.scaleTable[id - 1].multiplier < 1.0)
-            {
-                mb_ping->scaleFactors.scaleTable[id - 1].multiplier = 1.0;
-            }
-        }
-
-    }
-
-    return 0;
-}
-
diff --git a/src/gsf/gsf_enc.h b/src/gsf/gsf_enc.h
deleted file mode 100644
index 2c339c9..0000000
--- a/src/gsf/gsf_enc.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/********************************************************************
- *
- * Module Name : GSF_ENC
- *
- * Author/Date : J. S. Byrne / 26 May 1994
- *
- * Description :
- *
- * Restrictions/Limitations :
- *
- * Change Descriptions :
- * who  when      what
- * ---  ----      ----
- * hem  08/20/96  Added gsfEncodeSinglebeam.
- * jsb  09/28/98  Added gsfEncodeHVNavigationError.
- *
- * Classification : Unclassified
- *
- * References :
- *
- *
- * copyright 2014 Leidos, Inc.
- * There is no charge to use the library, and it may be accessed at:
- * https://www.leidos.com/maritime/gsf.
- * This library may be redistributed and/or modified under the terms of
- * the GNU Lesser General Public License version 2.1, as published by the
- * Free Software Foundation.  A copy of the LGPL 2.1 license is included with
- * the GSF distribution and is avaialbe at: http://opensource.org/licenses/LGPL-2.1.
- *
- * Leidos, Inc. configuration manages GSF, and provides GSF releases. Users are
- * strongly encouraged to communicate change requests and change proposals to Leidos, Inc.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE.
- *
- ********************************************************************/
-#ifndef _GSF_ENC_H_
-   #define _GSF_ENC_H_
-
-   #include "gsf.h"
-   #include "gsf_ft.h"
-
-   int OPTLK gsfEncodeHeader(unsigned char *sptr, gsfHeader *header);
-   int OPTLK gsfEncodeSwathBathySummary(unsigned char *sptr, gsfSwathBathySummary *sum);
-   int OPTLK gsfEncodeSwathBathymetryPing(unsigned char *sptr, gsfSwathBathyPing *ping, GSF_FILE_TABLE *ft, int handle);
-   int OPTLK gsfEncodeSoundVelocityProfile(unsigned char *sptr, gsfSVP *svp);
-   int OPTLK gsfEncodeProcessingParameters(unsigned char *sptr, gsfProcessingParameters *pparam);
-   int OPTLK gsfEncodeSensorParameters(unsigned char *sptr, gsfSensorParameters *sparam);
-   int OPTLK gsfEncodeComment(unsigned char *sptr, gsfComment *comment);
-   int OPTLK gsfEncodeHistory(unsigned char *sptr, gsfHistory *history);
-   int OPTLK gsfEncodeNavigationError(unsigned char *sptr, gsfNavigationError *nav_error);
-   int OPTLK gsfEncodeHVNavigationError(unsigned char *sptr, gsfHVNavigationError *hv_nav_error);
-   int OPTLK gsfEncodeSinglebeam (unsigned char *sptr, gsfSingleBeamPing * ping);
-   int OPTLK gsfEncodeAttitude(unsigned char *sptr, gsfAttitude * attitude);
-   int OPTLK gsfSetDefaultScaleFactor(gsfSwathBathyPing *mb_ping);
-
-#endif
diff --git a/src/gsf/gsf_ft.h b/src/gsf/gsf_ft.h
deleted file mode 100644
index bceec06..0000000
--- a/src/gsf/gsf_ft.h
+++ /dev/null
@@ -1,114 +0,0 @@
-/********************************************************************
- *
- * Module Name : GSF_FT
- *
- * Author/Date : J. S. Byrne / 25 Aug 1995
- *
- * Description : This header file contains the data structure definitions
- *    for the library's internal file table.  These definitions are only
- *    needed by the library, and are not intended to be access by any
- *    calling applications.
- *
- *
- * Restrictions/Limitations :
- *
- * Change Descriptions :
- * who  when      what
- * ---  ----      ----
- * jsb  04-16-97  Added integer fields to GSF_FILE_TABLE for major and
- *                 minor version numbers. Changed type of previous_record
- *                 field from fpos_t to long. This was done so we can
- *                 compair file position contained in previous record with
- *                 file position information stored in the index file.
- * bac 06-28-06   Changed structure elements of type long to int, for
- *                 compilation on 64-bit architectures.
- *
- * Classification : Unclassified
- *
- * References :
- *
- *
- * copyright 2014 Leidos, Inc.
- * There is no charge to use the library, and it may be accessed at:
- * https://www.leidos.com/maritime/gsf.
- * This library may be redistributed and/or modified under the terms of
- * the GNU Lesser General Public License version 2.1, as published by the
- * Free Software Foundation.  A copy of the LGPL 2.1 license is included with
- * the GSF distribution and is avaialbe at: http://opensource.org/licenses/LGPL-2.1.
- *
- * Leidos, Inc. configuration manages GSF, and provides GSF releases. Users are
- * strongly encouraged to communicate change requests and change proposals to Leidos, Inc.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE.
- *
- ********************************************************************/
-
-#ifndef __GSF_FT_H__
-#define __GSF_FT_H__
-
-#include <limits.h>
-
-/* Define the size of buffer of ping addresses kept for direct access */
-#define PING_ADDR_BUF_SIZE 1024
-
-/* Macro definitions for the state of the read_write_flag */
-#define LAST_OP_FLUSH          0
-#define LAST_OP_READ           1
-#define LAST_OP_WRITE          2
-
-/* Macro definitions for the limits of the scale factor multipler */
-#define MIN_GSF_SF_MULT_VALUE  1
-#define MAX_GSF_SF_MULT_VALUE  ULONG_MAX
-
-/* Typedef structure to hold the record index information */
-typedef struct
-{
-    int             sec;                              /* seconds from the epoch       */
-    int             nsec;                             /* nanoseconds of the second    */
-    long long       addr;                             /* address in the gsf file      */
-}
-INDEX_REC;
-
-/* Typedef structure to hold index file information for direct access */
-typedef struct t_index_data
-{
-    FILE           *fp;                               /* file pointer for the index   */
-    int             swap;                             /* byte swap flag               */
-    int             number_of_types;                  /* number of record types       */
-    int             record_type[NUM_REC_TYPES];       /* record types                 */
-    long long       start_addr[NUM_REC_TYPES];        /* start address of record type */
-    int             number_of_records[NUM_REC_TYPES]; /* number of record type recs   */
-    INDEX_REC      *scale_factor_addr;                /* scale factor index array     */
-    int             last_scale_factor_index;          /* last scale index             */
-}
-INDEX_DATA;
-
-/* Define a data structure to maintain a table of information for each
- * GSF file opened.
- */
-typedef struct t_gsfFileTable
-{
-    FILE           *fp;                            /* File descriptor */
-    char            file_name[1024];               /* The file's name */
-    int             major_version_number;          /* The gsf library version ID which created this file */
-    int             minor_version_number;          /* The gsf library version ID which created this file */
-    long long       file_size;                     /* The file's size when gsfOpen is called */
-    long long       previous_record;               /* File offset to previous record */
-    int             buf_size;                      /* Standard library buffer size */
-    int             bufferedBytes;                 /* How many bytes we've transfered */
-    int             occupied;                      /* Is this table slot being used */
-    int             update_flag;                   /* Is the file open for update */
-    int             direct_access;                 /* Is the file open for direct acess */
-    int             read_write_flag;               /* State variable for last I/O operation (1=read, 2=write) */
-    int             scales_read;                   /* Set when scale factors are read in with ping record */
-    int             access_mode;                   /* How was the file opened */
-    int             last_record_type;              /* Record type of the last record we successfully read (or wrote) */
-    INDEX_DATA      index_data;                    /* Index information used for direct file access */
-    gsfRecords      rec;                           /* Our copy of pointers to dynamic memory and scale factors */
-}
-GSF_FILE_TABLE;
-
-#endif   /* define __GSF_FT_H__ */
-
diff --git a/src/gsf/gsf_geo.c b/src/gsf/gsf_geo.c
deleted file mode 100644
index 5010a7c..0000000
--- a/src/gsf/gsf_geo.c
+++ /dev/null
@@ -1,269 +0,0 @@
-/********************************************************************
- *
- * File Name : gsf_geo.c
- *
- * Author/Date : R.K.Wells / 26 Feb 2014
- *
- * Description : Some hopefully useful functions to compute auxiliary
- *               information about points on a ship.
- *
- * Restrictions/Limitations :
- *
- * Change Descriptions :
- *
- * Classification : Unclassified
- *
- * References :
- *
- * copyright 2014 Leidos, Inc.
- * There is no charge to use the library, and it may be accessed at:
- * https://www.leidos.com/maritime/gsf.
- * This library may be redistributed and/or modified under the terms of
- * the GNU Lesser General Public License version 2.1, as published by the
- * Free Software Foundation.  A copy of the LGPL 2.1 license is included with
- * the GSF distribution and is avaialbe at: http://opensource.org/licenses/LGPL-2.1.
- *
- * Leidos, Inc. configuration manages GSF, and provides GSF releases. Users are
- * strongly encouraged to communicate change requests and change proposals to Leidos, Inc.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE.
- ********************************************************************/
-
-#include <math.h>
-
-/* rely on the network type definitions of (u_short, and u_int) */
-#include <sys/types.h>
-#if !defined WIN32 && !defined WIN64
-#include <netinet/in.h>
-#else
-#include <winsock.h>
-#endif
-
-#include <math.h>
-
-/* gsf library interface description */
-#include "gsf.h"
-
-/* Global external data defined in this module */
-extern int      gsfError;                               /* defined in gsf.c */
-
-#define SQR(x) ((x)*(x))
-#define Everest_1830        0
-#define Bessel_1841         1
-#define Clarke_1866         2
-#define Clarke_1880         3
-#define International_1909  4
-#define Australian_National 5
-#define Airy                6
-#define Fischer_1960        7
-#define WGS_1966            8
-#define Fischer_1968        9
-#define WGS_1972           10
-#define WGS_1984           11
-
-#ifndef PI
-#define PI 3.14159265358979323846
-#endif
-
-#ifndef DTOR
-#define DTOR(f) ((f)*PI/180.0)
-#endif
-
-#ifndef RTOD
-#define RTOD(f) ((f)*180.0/PI)
-#endif
-
-#ifndef DEG_TO_METERS
-#define DEG_TO_METERS   (1852.0 * 60.0)
-#endif
-
-typedef struct {
-    double a0;
-    double b0;
-    char *name;
-} GSF_GP_INFO, *pGSF_GP_INFO;
-
-static GSF_GP_INFO gp_info[] = {
-    {6377276.345, 6356075.413, "Everest 1830"},
-    {6377397.155, 6356078.963, "Bessel 1841"},
-    {6378206.400, 6356583.800, "Clarke 1866"},
-    {6378249.145, 6356514.869, "Clarke 1880"},
-    {6378388.000, 6356911.946, "International 1909"},
-    {6378160.000, 6356774.719, "Australian National"},
-    {6377563.396, 6356256.910, "Airy"},
-    {6378166.000, 6356774.283, "Fischer 1960"},
-    {6378145.000, 6356759.769, "WGS 1966"},
-    {6378150.000, 6356768.337, "Fischer 1968"},
-    {6378135.000, 6356750.520, "WGS 1972"},
-    {6378137.000, 6356752.314, "WGS 1984"},
-};
-
-static double a0 (int k)
-{
-    return gp_info[k].a0;
-}
-
-static double b0 (int k)
-{
-    return gp_info[k].b0;
-}
-
-static void metric (double phi, int k, double *gx, double *gy)
-{
-        double beta;
-
-        beta = atan (b0 (k) * tan (phi) / a0 (k));
-        *gx = a0 (k) * cos (beta);
-        *gy = a0 (k) * SQR (b0 (k) / a0 (k)) * pow (fabs (cos (beta) / cos (phi)), 3.0);
-}
-
-/********************************************************************
- *
- * Function Name : gsfGetPositionDestination
- *
- * Description : compute a new position from an existing one.
- *
- * Inputs : ref pos, offsets from ref (+x forward, +y starboard, + z down), ref heading (+hdg cw from north), maximum distance step.
- *
- * latitude, longitude (in GSF_POSITION), and heading are in degrees.  Distances and offsests are in meters.
- *
- * Returns : new position
- *
- * Error Conditions :
- *
- ********************************************************************/
-
-GSF_POSITION *gsfGetPositionDestination(GSF_POSITION gp, GSF_POSITION_OFFSETS offsets, double hdg, double dist_step)
-{
-    static GSF_POSITION     new_gp;
-    double                  gx, gy;
-    double                  dp, dl;
-    double                  dx, dy, dz;
-    double                  ilat, ilon, iz;
-    int                     n, iter;
-
-    gp.lat   = DTOR(gp.lat);
-    gp.lon   = DTOR(gp.lon);
-    hdg      = DTOR(hdg);
-
-    if (fabs(offsets.x) > fabs(offsets.y))
-        iter = (int)floor(fabs(offsets.x) / dist_step);
-    else
-        iter = (int)floor(fabs(offsets.y) / dist_step);
-    if (iter <= 0)
-        iter = 1;
-
-    dx = offsets.x / (double)iter;
-    dy = offsets.y / (double)iter;
-    dz = offsets.z / (double)iter;
-    ilat = gp.lat;
-    ilon = gp.lon;
-    iz   = gp.z;
-    for (n = 0; n < iter; n++) {
-        metric(ilat, WGS_1984, &gx, &gy);
-        dl = (dy * cos(hdg) + dx * sin(hdg)) / gx;
-        dp = (dx * cos(hdg) - dy * sin(hdg)) / gy;
-        ilon += dl;
-        ilat += dp;
-        iz   += dz;
-    }
-    new_gp.lon = RTOD(ilon);
-    new_gp.lat = RTOD(ilat);
-    new_gp.z   = iz;
-
-    return &new_gp;
-}
-
-
-/********************************************************************
- *
- * Function Name : gsfGetPositionOffsets
- *
- * Description : compute offsets between two positions.
- *
- * Inputs : ref pos, new pos, ref heading (+hdg cw from north), maximum distance_step.
- *
- * latitude, longitude (in GSF_POSITION), and heading are in degrees.  Distances and offsests are in meters.
- *
- * Returns : offsets from ref (+x forward, +y starboard, + z down)
- *
- * Error Conditions :
- *
- ********************************************************************/
-
-GSF_POSITION_OFFSETS *gsfGetPositionOffsets(GSF_POSITION gp_from, GSF_POSITION gp_to, double hdg, double dist_step)
-{
-    static GSF_POSITION_OFFSETS   offsets;
-    double                  gx, gy;
-    double                  dx, dy, dz;
-    double                  dlat, dlon, doz;
-    double                  ilat;
-    double                  ix, iy, iz;
-    int                     n, iter;
-    double                  lat_diff, lon_diff;
-
-    //  need to determine number of iterations from the dist_step.
-
-    gp_from.lat = DTOR(gp_from.lat);
-    gp_from.lon = DTOR(gp_from.lon);
-    gp_to.lat   = DTOR(gp_to.lat);
-    gp_to.lon   = DTOR(gp_to.lon);
-    hdg         = DTOR(hdg);
-
-    if (gp_to.lat > gp_from.lat)
-        lat_diff = fabs(gp_to.lat - gp_from.lat);
-    else
-        lat_diff = fabs(gp_from.lat - gp_to.lat);
-    lat_diff = RTOD(lat_diff) * DEG_TO_METERS;
-
-    if (gp_to.lon > gp_from.lon)
-        lon_diff = fabs(gp_to.lon - gp_from.lon);
-    else
-        lon_diff = fabs(gp_from.lon - gp_to.lon);
-
-    if (lon_diff > PI)
-        lon_diff = (2.0 * PI) - lon_diff;
-    lon_diff = RTOD(lon_diff) * DEG_TO_METERS * cos(gp_to.lat);
-
-
-    if (lon_diff > lat_diff)
-        iter = (int)ceil(lon_diff / dist_step);
-    else
-        iter = (int)ceil(lat_diff / dist_step);
-
-    //  need to handle crossing the dateline.
-    dlon = gp_to.lon - gp_from.lon;
-    if (dlon > PI)
-        dlon = ((2.0 * PI) - dlon) / (double)iter;
-    else if (dlon < -PI)
-        dlon = -(dlon + (2.0 * PI)) / (double)iter;
-    else
-        dlon = dlon / (double)iter;
-
-    dlat = (gp_to.lat - gp_from.lat) / (double)iter;
-    doz  = (gp_to.z   - gp_from.z)   / (double)iter;
-
-    ilat = gp_from.lat;
-    iz   = gp_from.z;
-    ix = iy = 0.0;
-    for (n = 0; n < iter; n++) {
-        metric(ilat, WGS_1984, &gx, &gy);
-        dx = -gx * dlon;
-        dy = -gy * dlat;
-        dz = -doz;
-
-        ix += dy * cos(hdg) + dx * sin(hdg);
-        iy += dx * cos(hdg) - dy * sin(hdg);
-        iz += dz;
-
-        ilat += dlat;
-    }
-    offsets.x = ix;
-    offsets.y = iy;
-    offsets.z = iz;
-
-    return &offsets;
-}
-
diff --git a/src/gsf/gsf_indx.c b/src/gsf/gsf_indx.c
deleted file mode 100644
index ab280aa..0000000
--- a/src/gsf/gsf_indx.c
+++ /dev/null
@@ -1,2194 +0,0 @@
-/********************************************************************
- *
- * Module Name : GSF_INDX.C
- *
- * Author/Date : J. C. Depner / 19 Jan 1995
- *
- * Description : This source file contains the file indexing functions
- *  for the GSF library.
- *
- * Restrictions/Limitations :
- * 1) This library assumes the host computer uses the ASCII character set.
- * 2) This library assumes that the data types u_short and u_int are defined
- *    on the host machine, where a u_short is a 16 bit unsigned integer, and
- *    a u_int is a 32 bit unsigned integer.
- * 3) This library assumes that the type short is 16 bits, and that
- *    the type int is 32 bits.
- * 4) This library assumes that the Posix compliant functions getpid() and
- *    unlink() are supported and that either the environment variable
- *    GSFTMPDIR is defined (as a valid directory) or the /tmp directory is
- *    available.
- *
- * Change Descriptions :
- * who  when      what
- * ---  ----      ----
- * jsb  08/25/95  Consolidated the gsfReadIndex and gsfWriteIndex functions
- *                into gsfRead and gsfWrite.
- * jsb  11/01/95  Completed modifications to indexing to support increase in
- *                gsf file size after initial index file creation.  The size
- *                of the file is now stored in the index file header. Index
- *                files without the expected header are recreated on the first
- *                open.
- * hem  08/20/96  Added #ifdef for percent complete "spinner"; added code to
- *                index single beam pings & summary records.  Changed building
- *                of temporary index files to first try and use the environment
- *                variable GSFTMPDIR & if it is not defined, then use /tmp for
- *                temporary index files used in building an index file.
- *                Removed output of error message from gsfCreateIndex when and
- *                unknown record ID was encountered.
- * hem  10/08/96  Fixed problem with building index files.  The incrementing of
- *                the number of record types was incrementing the wrong pointer
- *                for summary & single beam ping records.  Also added #ifdef to
- *                the end of gsfCreateIndex to stop the blank lines from being
- *                displayed if DISPLAY_SPINNER is not set.
- * jsb  03/29/97  Fixed bug in indexing the swath bathymetry summary record.
- *                Fix made to both Create and Append functions. Indexing the
- *                summary record was added release 1.03.
- * jsb  10/07/98  Added direct access support for new navigation errors record.
- *                 This change made in support of CRs: 98-001, and 98-002.
- * jsb  04/05/00  Updated for consistent use of swap field to ensure that index
- *                 files are portable between big and little endian machines.
- * bac  10-12-01  Added a new attitude record definition.  The attitude record
- *                 provides a method for logging full time-series attitude
- *                 measurements in the GSF file, instead of attitude samples
- *                 only at ping time.  Each attitude record contains arrays of
- *                 attitude measurements for time, roll, pitch, heave and heading.
- *                 The number of measurements is user-definable, but because of
- *                 the way in which measurement times are stored, a single attitude
- *                 record should never contain more than sixty seconds worth of
- *                 data.
- * jsb  01/15/02  Update for Windows.
- * bac  06/28/06  Added J.Depner updates to support a progress callback when
- *                 writing to the index file, as an alternative to the
- *                 DISPLAY_SPINNER printouts.  Replaced references to long types
- *                 with int types, for compilation on 64-bit architectures.
- * clb  05/27/11   added reference to __MINGW64__
- *
- *
- * Classification : Unclassified
- *
- * References : DoDBL Generic Sensor Format Sept. 30, 1993
- *
- *
- * copyright 2014 Leidos, Inc.
- * There is no charge to use the library, and it may be accessed at:
- * https://www.leidos.com/maritime/gsf.
- * This library may be redistributed and/or modified under the terms of
- * the GNU Lesser General Public License version 2.1, as published by the
- * Free Software Foundation.  A copy of the LGPL 2.1 license is included with
- * the GSF distribution and is avaialbe at: http://opensource.org/licenses/LGPL-2.1.
- *
- * Leidos, Inc. configuration manages GSF, and provides GSF releases. Users are
- * strongly encouraged to communicate change requests and change proposals to Leidos, Inc.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE.
- *
- ********************************************************************/
-
-/* Standard c library includes.    */
-#include <stdio.h>
-#include <errno.h>
-#include <stdlib.h>
-#include <string.h>
-#if defined(OS2) || defined(WIN32) || defined(WIN64)
-    #include <process.h>
-    #if defined (__MINGW32__) || defined (__MINGW64__)
-        #include <unistd.h>
-    #endif
-    #if defined (__BORLANDC__)
-        #define _getpid getpid
-    #endif
-#else
-    #include <unistd.h>
-#endif
-
-/* gsf library interface description.  */
-#include "gsf.h"
-#include "gsf_indx.h"
-#include "gsf_ft.h"
-
-#ifndef USE_DEFAULT_FILE_FUNCTIONS
-
-#undef fseek
-#undef ftell
-#if (defined _WIN32) && (defined _MSC_VER)
-#define fseek(x, y, z) _fseeki64((x), (y), (z))
-#define ftell(x)   _ftelli64((x))
-#else  // Linux, MingW, MacOS
-#undef fopen
-#define fopen(x, y)  fopen64((x), (y))
-#define fseek(x, y, z) fseeko64((x), (y), (z))
-#define ftell(x)   ftello64((x))
-#endif
-
-#endif
-
-/*  Error flag defined in gsf.c */
-extern int      gsfError;
-
-/* Prototypes for local functions */
-static FILE *open_temp_file(int);
-static void close_temp_file(int, FILE *);
-static int gsfCreateIndexFile(const char *ndx_file, int handle, GSF_FILE_TABLE *ft);
-static int gsfAppendIndexFile(const char *ndx_file, int handle, GSF_FILE_TABLE *ft);
-static void temp_file_name(int type, char *d_name, char *f_name);
-
-
-
-
-/* JCD: Variables and functions for the index progress callback */
-
-static  GSF_PROGRESS_CALLBACK  gsf_progress_callback = NULL;
-/********************************************************************
- *
- * Function Name : gsf_register_progress_callback
- *
- * Description : This function registers a callback function, defined
- *                by the user, to be called to report the progress
- *                of the index file creation.  If no progress
- *                callback is registered, status is printed to stdout
- *                if the DISPLAY_SPINNER macro is defined.
- *
- * Inputs :
- *  progressCB = Name of progress callback function to call when
- *               creating the GSF index file.  The progress callback
- *               will accept two integer arguments, and this function
- *               will be called whenever the percent complete changes.
- *               The first argument will be one of the following three
- *               values, to represent the state of the progress:
- *                  1 = Reading GSF file
- *                  2 = Creating new index file
- *                  3 = Appending to existing index file
- *               The second argument contains the percent complete
- *               of the current state.
- *
- * Returns :
- *  None
- *
- * Error Conditions :
- *  None
- *
- ********************************************************************/
-void gsf_register_progress_callback (GSF_PROGRESS_CALLBACK progressCB)
-{
-    gsf_progress_callback = progressCB;
-}
-
-
-
-/********************************************************************
- *
- * Function Name : gsfOpenIndex
- *
- * Description : This function attempts to open an index file associated
- *  with a gsf file.  If the file exists it is opened and the header
- *  information is read into memory.  If it does not exist it is created.
- *  Creating the index file is a two pass process.  First, all of the gsf
- *  file is read and the index records are written to a number of small
- *  index files.  Then the small index files are read and written to the
- *  final index file.  The index file header format is as follows :
- *
- *      Type      Description
- *      ----      -----------
- *      char[16]  Text header containing "INDEX-GSF-"<"version">
- *      int       The size of the gsf file when the index file was created.
- *      int       Endian indicator (0x00010203 or 0x03020100 depending
- *                upon sex of machine, if 0x03020100 then the index
- *                data must be byte swapped).
- *      int       Number of different record types in the index file.
- *      int[4]    16 bytes of reserved space
- *
- *
- *      int       Record ID of first record type.
- *      int       Address within the index file of the beginning of
- *                the index for the first record type.
- *      int       Number of index records for the first record type.
- *      .
- *      .
- *      .
- *      .
- *      int       Record ID of last record type.
- *      int       Address within the index file of the beginning of
- *                the index for the last record type.
- *      int       Number of index records for the last record type.
- *
- *
- *  Following the header is the index data.  The format for each index record
- *  is :
- *
- *      time_t    Posix.4 proposed time seconds.
- *      int       Posix.4 proposed time nanoseconds.
- *      int       Address of the associated record within the gsf file for the
- *                specified record type.
- *      .
- *      .
- *      .
- *      .
- *
- *
- *  After the index file is opened (or created) the index records for those
- *  ping records containing a scale factor subrecord are read into memory to
- *  reduce I/O when reading the ping records.
- *
- *
- * Inputs :
- *  filename = a fully qualified path to the gsf file
- *  handle = gsf file handle assigned by gsfOpen or gsfOpenBuffered
- *  ft = a pointer to the GSF_FILE_TABLE entry for the file specified by
- *     handle.
- *
- * Returns :
- *  This function returns zero if successful, or -1 if an error occured.
- *
- * Error Conditions : ??????????
- *
- ********************************************************************/
-
-int
-gsfOpenIndex(const char *filename, int handle, GSF_FILE_TABLE *ft)
-{
-    int              ret;
-    int              i;
-    int              j;
-    int              maj_indx_num = 0, min_indx_num = 0;
-    int              l_temp;
-    long long        u_temp;
-    char             ndx_file[1024];
-    GSF_INDEX_HEADER index_header;
-
-    /*  Clear the contents of the index_header structure */
-    memset (&index_header, 0, sizeof(index_header));
-
-    /*  Clear the last scale factor index.  This is used to decide whether
-     *  we need to read a new scale factor record when we read a
-     *  GSF_RECORD_SWATH_BATHYMETRY_PING record.
-     */
-    ft->index_data.last_scale_factor_index = -1;
-
-    /* Clear the index header information in the index_data structure. */
-    ft->index_data.number_of_types = 0;
-    for (i = 0; i < NUM_REC_TYPES; i++)
-    {
-        ft->index_data.record_type[i] = -1;
-        ft->index_data.number_of_records[i] = 0;
-        ft->index_data.start_addr[i] = 0;
-    }
-
-    /* Create the GSF index file name (assuming an extension of .n##) */
-    strcpy(ndx_file, filename);
-    ndx_file[strlen(ndx_file) - 3] = 'n';
-
-    /* Try to open the index file for read. */
-    if ((strcmp(filename, ndx_file) == 0) && (access(ndx_file, F_OK) == 0)) {
-        gsfError = GSF_INDEX_FILE_OPEN_ERROR;
-        return (-1);
-    }
-
-    if ((ft->index_data.fp = fopen(ndx_file, "rb")) == NULL)
-    {
-        ret = gsfCreateIndexFile(ndx_file, handle, ft);
-        if (ret)
-        {
-            return(-1);
-        }
-        return(0);
-    }
-
-    /* The index file exists. Read the version field, if we don't
-     * find the expected text then assume this is an old index file
-     * (pre-version 01.01) and that we need to create a new index file.
-     */
-    fread(index_header.version, GSF_INDEX_VERSION_SIZE, 1, ft->index_data.fp);
-    if ((index_header.version[0] == 0) ||
-        (strncmp(index_header.version, "INDEX-GSF-", strlen("INDEX-GSF-"))))
-    {
-        fclose (ft->index_data.fp);
-        ret = gsfCreateIndexFile(ndx_file, handle, ft);
-        if (ret)
-        {
-            return(-1);
-        }
-        return(0);
-    }
-
-    ret = sscanf (index_header.version, "INDEX-GSF-v%d.%d", &maj_indx_num, &min_indx_num);
-    if (ret != 2)
-    {
-        gsfError = GSF_UNRECOGNIZED_FILE;
-        return(-1);
-    }
-
-    /* Next four bytes contain the size of the GSF file when the index file was created */
-    if (maj_indx_num > 1)
-    {
-        fread(&u_temp, 8, 1, ft->index_data.fp);
-        if (ft->index_data.swap)
-        {
-            SwapLongLong((long long *) &u_temp, 1);
-        }
-        index_header.gsfFileSize =  (long long) u_temp;
-    }
-    else
-    {
-        /* The index file exists. Read the version field, if we don't
-         * find the expected text then assume this is an old index file
-         * (pre-version 02.0) and that we need to create a new index file.
-         */
-        fclose (ft->index_data.fp);
-        ret = gsfCreateIndexFile(ndx_file, handle, ft);
-        if (ret)
-        {
-            return(-1);
-        }
-        return(0);
-    }
-
-    /* The next four bytes contain the endian indicator.  Read this to determine whether
-     * to swap incoming data. If the endian indicator is not kosher, error out.
-     */
-    fread(&index_header.endian, 4, 1, ft->index_data.fp);
-    if (index_header.endian == 0x00010203)
-    {
-        ft->index_data.swap = 0;
-    }
-    else if (index_header.endian == 0x03020100)
-    {
-        ft->index_data.swap = 1;
-    }
-    else
-    {
-        gsfError = GSF_CORRUPT_INDEX_FILE_ERROR;
-        return (-1);
-    }
-
-    /* If the expected header is found then compair the current gsf file
-     * size to the size that existed when the index was file was created,
-     * and append to the index file if necessary.
-     */
-    if (index_header.gsfFileSize < ft->file_size)
-    {
-        ret = gsfAppendIndexFile(ndx_file, handle, ft);
-        if (ret)
-        {
-            return(-1);
-        }
-        return(0);
-    }
-    if (index_header.gsfFileSize > ft->file_size)
-    {
-        /* if the indexed file size is greater than the current gsf file
-         *  size, then the file has gotten smaller and the index file is
-         *  invalid.  delete it and create it again.  bac, 05-06-03
-         */
-         remove (ndx_file);
-         ret = gsfCreateIndexFile(ndx_file, handle, ft);
-         if (ret)
-         {
-             return(-1);
-         }
-         return(0);
-    }
-
-    /* If we get here, then the index file that exists is ready to use. */
-
-
-    /* Read the number of record types in the index file. */
-    fread(&index_header.number_record_types, 4, 1, ft->index_data.fp);
-    if (ft->index_data.swap)
-    {
-        SwapLong((unsigned int *) &index_header.number_record_types, 1);
-    }
-    ft->index_data.number_of_types = index_header.number_record_types;
-
-    /* Make sure we found a valid number_of_types */
-    if ((ft->index_data.number_of_types < 1) ||
-        (ft->index_data.number_of_types > NUM_REC_TYPES))
-    {
-        gsfError = GSF_CORRUPT_INDEX_FILE_ERROR;
-        return (-1);
-    }
-
-    /* Read the four four byte reserved fields */
-    fread(&index_header.spare1, 4, 1, ft->index_data.fp);
-    fread(&index_header.spare2, 4, 1, ft->index_data.fp);
-    fread(&index_header.spare3, 4, 1, ft->index_data.fp);
-    fread(&index_header.spare4, 4, 1, ft->index_data.fp);
-
-    /*  For each record type, read the record type, start address and
-     *  number of records.
-     */
-    for (i = 0; i < ft->index_data.number_of_types; i++)
-    {
-        fread(&j, 4, 1, ft->index_data.fp);
-        if (ft->index_data.swap)
-        {
-            SwapLong((unsigned int *) &j, 1);
-        }
-
-        /*  This is not really necessary but it makes things easier to code.
-         *  Put the record type into the record_type[record_type] member of
-         *  the index_data structure.
-         */
-        ft->index_data.record_type[j] = j;
-
-        if (maj_indx_num > 1)
-        {
-            fread(&u_temp, 8, 1, ft->index_data.fp);
-            if (ft->index_data.swap)
-                SwapLongLong((long long *) &u_temp, 1);
-            ft->index_data.start_addr[j] = (long long) u_temp;
-        }
-        else
-        {
-            fread(&l_temp, 4, 1, ft->index_data.fp);
-            if (ft->index_data.swap)
-                SwapLong((unsigned int *) &l_temp, 1);
-            ft->index_data.start_addr[j] = (long long) l_temp;
-        }
-
-        fread(&ft->index_data.number_of_records[j], 4, 1,
-              ft->index_data.fp);
-
-        if (ft->index_data.swap) {
-            SwapLong((unsigned int *) &ft->index_data.number_of_records[j], 1);
-        }
-    }
-
-    /* Read the scale factor addresses into memory. */
-    if (ft->index_data.record_type[0] != -1)
-    {
-        ft->index_data.scale_factor_addr =
-            (INDEX_REC *) calloc(ft->index_data.number_of_records[0],
-            sizeof(INDEX_REC));
-
-        /*  Couldn't calloc the memory for the scale factor addresses.  */
-
-        if (ft->index_data.scale_factor_addr == NULL)
-        {
-            gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-            return (-1);
-        }
-
-        fseek(ft->index_data.fp, ft->index_data.start_addr[0], 0);
-        for (i = 0; i < ft->index_data.number_of_records[0]; i++)
-        {
-            fread(&ft->index_data.scale_factor_addr[i], sizeof(INDEX_REC), 1,
-                ft->index_data.fp);
-            if (ft->index_data.swap)
-            {
-                SwapLong((unsigned int *) &ft->index_data.scale_factor_addr[i].sec, 1);
-                SwapLong((unsigned int *) &ft->index_data.scale_factor_addr[i].nsec, 1);
-                SwapLongLong((long long *) &ft->index_data.scale_factor_addr[i].addr, 1);
-            }
-        }
-    }
-
-    return (0);
-}
-
-/********************************************************************
- *
- * Function Name : gsfCreateIndexFile
- *
- * Description : This function is called to create a new gsf index file.
- *
- * Inputs :
- *  filename = a fully qualified path to the gsf file
- *  handle = gsf file handle assigned by gsfOpen or gsfOpenBuffered
- *  ft = a pointer to the GSF_FILE_TABLE entry for the file specified by
- *     handle.
- *
- * Returns :
- *  This function returns zero if successful, or -1 if an error occured.
- *
- * Error Conditions :
- *
- ********************************************************************/
-
-static int
-gsfCreateIndexFile(const char *ndx_file, int handle, GSF_FILE_TABLE *ft)
-{
-    int              i;
-    int              j;
-    int              err;
-    int              percent;
-    int              id;
-    int              old_percent;
-    int              total_recs;
-    int              count;
-    int              endian = 0x00010203;
-    long long        eof;
-    long long        current;
-    FILE            *temp[NUM_REC_TYPES];
-    gsfDataID        data_id;
-    gsfRecords       records;
-    INDEX_REC        index_rec;
-    GSF_INDEX_HEADER index_header;
-
-    /* Make sure we can open a new file for write before we start to build
-     * the index file.  If the open is successful, close and remove the file,
-     * we'll create it again as soon as we need it.
-     */
-    if ((ft->index_data.fp = fopen(ndx_file, "wb+")) == NULL)
-    {
-        gsfError = GSF_INDEX_FILE_OPEN_ERROR;
-        return (-1);
-    }
-    fclose (ft->index_data.fp);
-    remove (ndx_file);
-
-    /* Clear the array of temporary file descriptors */
-    for (i=0; i<NUM_REC_TYPES; i++)
-    {
-        temp[i] = (FILE *) NULL;
-    }
-
-    /* Initialize the contents of the index file header */
-    memset (&index_header, 0, sizeof(index_header));
-    strncpy(index_header.version, GSF_INDEX_VERSION, GSF_INDEX_VERSION_SIZE);
-    index_header.endian = endian;
-    index_header.gsfFileSize = ft->file_size;
-
-    /*  Get the address of the end of file so we can compute percentage
-     *  processed for creating the index file.
-     */
-    eof = ft->file_size;
-    percent = 0;
-    old_percent = -1;
-    current = 0;
-
-    /*  Read each gsf record and write the time and address to the
-     *  temp index files.
-     */
-    do
-    {
-        long long rc;
-        /*  Save the current address within the gsf file.   */
-
-        if ((rc = ftell(ft->fp)) == -1 )
-        {
-            gsfError = GSF_FILE_TELL_ERROR;
-            return (-1);
-        }
-        index_rec.addr = rc;
-
-        /*  Read the gsf record and check for end of file.  */
-
-        if ((err = gsfRead(handle, GSF_NEXT_RECORD, &data_id, &records,
-                    NULL, 0)) != -1)
-        {
-
-            /*  Switch based on the record type that was just read.  */
-
-            id = data_id.recordID;
-            switch (id)
-            {
-                    /*  Don't index the header or the summary.  */
-
-                case GSF_RECORD_HEADER:
-                    break;
-
-                case GSF_RECORD_SWATH_BATHY_SUMMARY:
-
-                    /*  If this is the first record of this type open the
-                        temp file and increment the number of types.    */
-
-                    if (temp[id] == NULL)
-                    {
-                        temp[id] = open_temp_file(id);
-                        if (temp[id] == (FILE *) NULL)
-                        {
-                            gsfError = GSF_OPEN_TEMP_FILE_FAILED;
-                            return (-1);
-                        }
-                        index_header.number_record_types++;
-                    }
-
-                    /*  Load the index record structure and write to the
-                        temp file.      */
-
-                    index_rec.sec = records.summary.start_time.tv_sec;
-                    index_rec.nsec = records.summary.end_time.tv_nsec;
-                    fwrite(&index_rec, sizeof(INDEX_REC), 1, temp[id]);
-                    ft->index_data.number_of_records[id]++;
-
-                    break;
-
-                case GSF_RECORD_SWATH_BATHYMETRY_PING:
-
-                    /*  If this ping record actually contained scale
-                        factor information in the file, make entries to
-                        two indexes; the standard ping index and the
-                        index for pings with scale factor subrecords.   */
-
-                    if (ft->scales_read)
-                    {
-                        /*  If this is the first record of this type
-                            open the temp file and increment the
-                            number of types.    */
-
-                        if (temp[0] == NULL)
-                        {
-                            temp[0] = open_temp_file(0);
-                            if (temp[0] == NULL)
-                            {
-                                gsfError = GSF_OPEN_TEMP_FILE_FAILED;
-                                return(-1);
-                            }
-                            index_header.number_record_types++;
-                        }
-
-                        /*  Load the index record structure and write to the
-                            temp file.  */
-
-                        index_rec.sec = records.mb_ping.ping_time.tv_sec;
-                        index_rec.nsec = records.mb_ping.ping_time.tv_nsec;
-                        fwrite(&index_rec, sizeof(INDEX_REC), 1, temp[0]);
-                        ft->index_data.number_of_records[0]++;
-                    }
-
-                    /*  If this is the first record of this type open the
-                        temp file and increment the number of types.    */
-
-                    if (temp[id] == NULL)
-                    {
-                        temp[id] = open_temp_file(id);
-                        if (temp[id] == (FILE *) NULL)
-                        {
-                            gsfError = GSF_OPEN_TEMP_FILE_FAILED;
-                            return (-1);
-                        }
-                        index_header.number_record_types++;
-                    }
-
-                    /*  Load the index record structure and write to the
-                        temp file.  */
-
-                    index_rec.sec = records.mb_ping.ping_time.tv_sec;
-                    index_rec.nsec = records.mb_ping.ping_time.tv_nsec;
-                    fwrite(&index_rec, sizeof(INDEX_REC), 1, temp[id]);
-                    ft->index_data.number_of_records[id]++;
-
-                    break;
-
-                case GSF_RECORD_SOUND_VELOCITY_PROFILE:
-
-                    /*  If this is the first record of this type open the
-                        temp file and increment the number of types.    */
-
-                    if (temp[id] == NULL)
-                    {
-                        temp[id] = open_temp_file(id);
-                        if (temp[id] == (FILE *) NULL)
-                        {
-                            gsfError = GSF_OPEN_TEMP_FILE_FAILED;
-                            return (-1);
-                        }
-                        index_header.number_record_types++;
-                    }
-
-                    /*  Load the index record structure and write to the
-                        temp file.  */
-
-                    index_rec.sec = records.svp.application_time.tv_sec;
-                    index_rec.nsec = records.svp.application_time.tv_nsec;
-                    fwrite(&index_rec, sizeof(INDEX_REC), 1, temp[id]);
-                    ft->index_data.number_of_records[id]++;
-
-                    break;
-
-                case GSF_RECORD_PROCESSING_PARAMETERS:
-
-                    /*  If this is the first record of this type open the
-                        temp file and increment the number of types.    */
-
-                    if (temp[id] == NULL)
-                    {
-                        temp[id] = open_temp_file(id);
-                        if (temp[id] == (FILE *) NULL)
-                        {
-                            gsfError = GSF_OPEN_TEMP_FILE_FAILED;
-                            return (-1);
-                        }
-                        index_header.number_record_types++;
-                    }
-
-                    /*  Load the index record structure and write to the
-                        temp file.  */
-
-                    index_rec.sec = records.process_parameters.param_time.tv_sec;
-                    index_rec.nsec =
-                        records.process_parameters.param_time.tv_nsec;
-                    fwrite(&index_rec, sizeof(INDEX_REC), 1, temp[id]);
-                    ft->index_data.number_of_records[id]++;
-
-                    break;
-
-                case GSF_RECORD_SENSOR_PARAMETERS:
-
-                    /*  If this is the first record of this type open the
-                        temp file and increment the number of types.    */
-
-                    if (temp[id] == NULL)
-                    {
-                        temp[id] = open_temp_file(id);
-                        if (temp[id] == (FILE *) NULL)
-                        {
-                            gsfError = GSF_OPEN_TEMP_FILE_FAILED;
-                            return (-1);
-                        }
-                        index_header.number_record_types++;
-                    }
-
-                    /*  Load the index record structure and write to the
-                        temp file.  */
-
-                    index_rec.sec = records.sensor_parameters.param_time.tv_sec;
-                    index_rec.nsec =
-                        records.sensor_parameters.param_time.tv_nsec;
-                    fwrite(&index_rec, sizeof(INDEX_REC), 1, temp[id]);
-                    ft->index_data.number_of_records[id]++;
-
-                    break;
-
-                case GSF_RECORD_COMMENT:
-
-                    /*  If this is the first record of this type open the
-                        temp file and increment the number of types.    */
-
-                    if (temp[id] == NULL)
-                    {
-                        temp[id] = open_temp_file(id);
-                        if (temp[id] == (FILE *) NULL)
-                        {
-                            gsfError = GSF_OPEN_TEMP_FILE_FAILED;
-                            return (-1);
-                        }
-                        index_header.number_record_types++;
-                    }
-
-                    /*  Load the index record structure and write to the
-                        temp file.  */
-
-                    index_rec.sec = records.comment.comment_time.tv_sec;
-                    index_rec.nsec = records.comment.comment_time.tv_nsec;
-                    fwrite(&index_rec, sizeof(INDEX_REC), 1, temp[id]);
-                    ft->index_data.number_of_records[id]++;
-
-                    break;
-
-                case GSF_RECORD_HISTORY:
-
-                    /*  If this is the first record of this type open the
-                        temp file and increment the number of types.    */
-
-                    if (temp[id] == NULL)
-                    {
-                        temp[id] = open_temp_file(id);
-                        if (temp[id] == (FILE *) NULL)
-                        {
-                            gsfError = GSF_OPEN_TEMP_FILE_FAILED;
-                            return (-1);
-                        }
-                        index_header.number_record_types++;
-                    }
-
-                    /*  Load the index record structure and write to the
-                        temp file.  */
-
-                    index_rec.sec = records.history.history_time.tv_sec;
-                    index_rec.nsec = records.history.history_time.tv_nsec;
-                    fwrite(&index_rec, sizeof(INDEX_REC), 1, temp[id]);
-                    ft->index_data.number_of_records[id]++;
-
-                    break;
-
-                case GSF_RECORD_NAVIGATION_ERROR:
-
-                    /*  If this is the first record of this type open the
-                        temp file and increment the number of types.    */
-
-                    if (temp[id] == NULL)
-                    {
-                        temp[id] = open_temp_file(id);
-                        if (temp[id] == (FILE *) NULL)
-                        {
-                            gsfError = GSF_OPEN_TEMP_FILE_FAILED;
-                            return (-1);
-                        }
-                        index_header.number_record_types++;
-                    }
-
-                    /*  Load the index record structure and write to the
-                        temp file.  */
-
-                    index_rec.sec = records.nav_error.nav_error_time.tv_sec;
-                    index_rec.nsec = records.nav_error.nav_error_time.tv_nsec;
-                    fwrite(&index_rec, sizeof(INDEX_REC), 1, temp[id]);
-                    ft->index_data.number_of_records[id]++;
-
-                    break;
-
-                case GSF_RECORD_SINGLE_BEAM_PING:
-
-                    /*  If this is the first record of this type open the
-                        temp file and increment the number of types.    */
-
-                    if (temp[id] == NULL)
-                    {
-                        temp[id] = open_temp_file(id);
-                        if (temp[id] == (FILE *) NULL)
-                        {
-                            gsfError = GSF_OPEN_TEMP_FILE_FAILED;
-                            return (-1);
-                        }
-                        index_header.number_record_types++;
-                    }
-
-                    /*  Load the index record structure and write to the
-                        temp file.      */
-
-                    index_rec.sec = records.sb_ping.ping_time.tv_sec;
-                    index_rec.nsec = records.sb_ping.ping_time.tv_nsec;
-                    fwrite(&index_rec, sizeof(INDEX_REC), 1, temp[id]);
-                    ft->index_data.number_of_records[id]++;
-
-                    break;
-
-                /* jsb 10/07/98 Added direct access support for new navigation errors record */
-                case GSF_RECORD_HV_NAVIGATION_ERROR:
-
-                    /*  If this is the first record of this type open the
-                        temp file and increment the number of types.    */
-
-                    if (temp[id] == NULL)
-                    {
-                        temp[id] = open_temp_file(id);
-                        if (temp[id] == (FILE *) NULL)
-                        {
-                            gsfError = GSF_OPEN_TEMP_FILE_FAILED;
-                            return (-1);
-                        }
-                        index_header.number_record_types++;
-                    }
-
-                    /*  Load the index record structure and write to the
-                        temp file.  */
-
-                    index_rec.sec = records.hv_nav_error.nav_error_time.tv_sec;
-                    index_rec.nsec = records.hv_nav_error.nav_error_time.tv_nsec;
-                    fwrite(&index_rec, sizeof(INDEX_REC), 1, temp[id]);
-                    ft->index_data.number_of_records[id]++;
-
-                    break;
-
-                case GSF_RECORD_ATTITUDE:
-
-                    /*  If this is the first record of this type open the
-                        temp file and increment the number of types.    */
-
-                    if (temp[id] == NULL)
-                    {
-                        temp[id] = open_temp_file(id);
-                        if (temp[id] == (FILE *) NULL)
-                        {
-                            gsfError = GSF_OPEN_TEMP_FILE_FAILED;
-                            return (-1);
-                        }
-                        index_header.number_record_types++;
-                    }
-
-                    /*  Load the index record structure and write to the
-                        temp file.  */
-
-                    index_rec.sec = records.attitude.attitude_time[0].tv_sec;
-                    index_rec.nsec = records.attitude.attitude_time[0].tv_nsec;
-                    fwrite(&index_rec, sizeof(INDEX_REC), 1, temp[id]);
-                    ft->index_data.number_of_records[id]++;
-
-                    break;
-
-
-                default:
-
-                    break;
-            }
-
-            /*  Print the percent spinner to stdout.    */
-            if ((current = ftell(ft->fp)) == -1 )
-            {
-                gsfError = GSF_FILE_TELL_ERROR;
-                return (-1);
-            }
-            percent = ((double) current  / (double) eof) * 100.0;
-
-            if (old_percent != percent)
-            {
-                /*  JCD: now calls a callback if it is registered.  */
-
-                if (gsf_progress_callback)
-                  {
-                    (*gsf_progress_callback) (1, percent);
-                  }
-#ifdef DISPLAY_SPINNER
-                else
-                  {
-                    printf("Reading GSF file - %03d%% complete\r", percent);
-                    fflush(stdout);
-                  }
-#endif
-                old_percent = percent;
-            }
-        }
-        else
-        {
-            if (gsfError != GSF_READ_TO_END_OF_FILE && gsfError != GSF_PARTIAL_RECORD_AT_END_OF_FILE)
-            {
-                return(-1);
-            }
-        }
-    }
-    while (err != -1);
-
-    /* Create the index file */
-    if ((ft->index_data.fp = fopen(ndx_file, "wb+")) == NULL)
-    {
-        gsfError = GSF_INDEX_FILE_OPEN_ERROR;
-        return (-1);
-    }
-
-    /* Write the index file header. Note that index data is written in navive
-     * machine byte order.  There are 16 bytes of space reserved in the header
-     * for future information.
-     */
-    fwrite(index_header.version, GSF_INDEX_VERSION_SIZE, 1, ft->index_data.fp);
-    fwrite(&index_header.gsfFileSize, 8, 1, ft->index_data.fp);
-    fwrite(&index_header.endian, 4, 1, ft->index_data.fp);
-    fwrite(&index_header.number_record_types, 4, 1, ft->index_data.fp);
-    fwrite(&index_header.spare1, 4, 1, ft->index_data.fp);
-    fwrite(&index_header.spare2, 4, 1, ft->index_data.fp);
-    fwrite(&index_header.spare3, 4, 1, ft->index_data.fp);
-    fwrite(&index_header.spare4, 4, 1, ft->index_data.fp);
-
-    /* Set the library's table entry for the number of record types for this file */
-    ft->index_data.number_of_types = index_header.number_record_types;
-
-    /*  Clear the space for the information (write dummy info for the
-     *  record type, number_of_records, and start address).
-     */
-    for (i = 0, j = 0; i < ft->index_data.number_of_types; i++)
-    {
-        INDEX_REC rec;
-        memset (&rec, 0, sizeof(INDEX_REC));
-        fwrite(&rec, 1, sizeof(INDEX_REC), ft->index_data.fp);
-    }
-
-    /*  Reset the counters. */
-    count = 0;
-    percent = 0;
-    old_percent = -1;
-    total_recs = 0;
-    for (i = 0; i < NUM_REC_TYPES; i++)
-    {
-        total_recs += ft->index_data.number_of_records[i];
-    }
-
-    /*  Read the temp files and build the final index file.   */
-    j = 0;
-    for (i = 0; i < NUM_REC_TYPES; i++)
-    {
-        /*  If the temp file pointer is non-NULL then this record type was
-            encountered.    */
-
-        if (temp[i] != NULL)
-        {
-
-            /*  Rewind the temp file and set the start address and record
-             *  type.
-             */
-            fseek(temp[i], 0, 0);
-            ft->index_data.start_addr[i] = ftell(ft->index_data.fp);
-            ft->index_data.record_type[i] = i;
-
-            /*  Read through the temp file and write to the final file. */
-            while (fread(&index_rec, sizeof(INDEX_REC), 1, temp[i]) == 1)
-            {
-                fwrite(&index_rec, sizeof(INDEX_REC), 1,
-                    ft->index_data.fp);
-
-                count++;
-
-                /*  Print the percent spinner to stdout.  */
-                percent = ((float) (count) / (float) total_recs) * 100.0;
-                if (old_percent != percent)
-                {
-                    /*  JCD: now calls a callback if it is registered.  */
-
-                    if (gsf_progress_callback)
-                      {
-                        (*gsf_progress_callback) (2, percent);
-                      }
-#ifdef DISPLAY_SPINNER
-                    else
-                      {
-                        printf("Writing index file - %03d%% complete\r", percent);
-                        fflush(stdout);
-                      }
-#endif
-                    old_percent = percent;
-                }
-            }
-
-            /*  Move to the beginning of the final file and write the
-             *  pertinent information for this record type.  The offset
-             *  is computed as follows :
-             *  j is the counter for the record types stored in the
-             *  index file, times 16 (size of the header info for each
-             *  record type), plus 48 bytes for the format version
-             *  id, gsf file size, endian indicator, total number of record
-             *  types, and reserved space.
-             */
-            fseek(ft->index_data.fp, (j * 16) + 48, 0);
-            fwrite(&ft->index_data.record_type[i], 4, 1,
-                ft->index_data.fp);
-            fwrite(&ft->index_data.start_addr[i], 8, 1,
-                ft->index_data.fp);
-            fwrite(&ft->index_data.number_of_records[i], 4, 1,
-                ft->index_data.fp);
-
-            /* Advance to the end of the index file */
-            fseek(ft->index_data.fp, 0, SEEK_END);
-
-            /*  Get rid of the temp files.  */
-
-            close_temp_file(i, temp[i]);
-
-            j++;
-        }
-    }
-
-    /* Read the scale factor addresses into memory. */
-    if (ft->index_data.record_type[0] != -1)
-    {
-        ft->index_data.scale_factor_addr =
-            (INDEX_REC *) calloc(ft->index_data.number_of_records[0],
-            sizeof(INDEX_REC));
-
-        /*  Couldn't calloc the memory for the scale factor addresses.  */
-
-        if (ft->index_data.scale_factor_addr == NULL)
-        {
-            gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-            return (-1);
-        }
-
-        fseek(ft->index_data.fp, ft->index_data.start_addr[0], 0);
-        for (i = 0; i < ft->index_data.number_of_records[0]; i++)
-        {
-            fread(&ft->index_data.scale_factor_addr[i], sizeof(INDEX_REC), 1,
-                ft->index_data.fp);
-        }
-    }
-
-    /*  Set the byte swap indicator off.  No need to swap on a
-     *  machine of the same sex.
-     */
-    ft->index_data.swap = 0;
-
-#ifdef DISPLAY_SPINNER
-    if (!gsf_progress_callback) printf("                                            \r");
-#endif
-    return (0);
-}
-
-/********************************************************************
- *
- * Function Name : gsfAppendIndexFile
- *
- * Description : This function is called to add addition index records
- *   to an existing index file
- *
- * Inputs :
- *  filename = a fully qualified path to the gsf file
- *  handle = gsf file handle assigned by gsfOpen or gsfOpenBuffered
- *  ft = a pointer to the GSF_FILE_TABLE entry for the file specified by
- *     handle.
- *
- * Returns :
- *  This function returns zero if successful, or -1 if an error occured.
- *
- * Error Conditions :
- *
- ********************************************************************/
-
-static int
-gsfAppendIndexFile(const char *ndx_file, int handle, GSF_FILE_TABLE *ft)
-{
-    int              i;
-    int              j;
-    int              err;
-    int              id;
-    int              last_record_type;
-    int              last_record_number;
-    int              percent;
-    int              old_percent;
-    long long        last_index=0;
-    long long        eof;
-    long long        current;
-    int              endian = 0x00010203;
-    int              l_temp;
-    long long        u_temp;
-    FILE            *temp[NUM_REC_TYPES];
-    gsfDataID        data_id;
-    gsfRecords       records;
-    INDEX_REC        index_rec;
-    GSF_INDEX_HEADER index_header;
-    long long        save_pos;
-
-    /* Clear the index header data structure */
-    memset (&index_header, 0, sizeof(index_header));
-
-    /* Clear the array of temporary file descriptors */
-    for (i=0; i<NUM_REC_TYPES; i++)
-    {
-        temp[i] = (FILE *) NULL;
-    }
-
-
-    /* Read the number of record types in the index file. */
-    fread(&index_header.number_record_types, 4, 1, ft->index_data.fp);
-    if (ft->index_data.swap)
-    {
-        SwapLong((unsigned int *) &index_header.number_record_types, 1);
-    }
-    ft->index_data.number_of_types = index_header.number_record_types;
-
-    /* Make sure we found a valid number_of_types */
-    if ((ft->index_data.number_of_types < 1) ||
-        (ft->index_data.number_of_types > NUM_REC_TYPES))
-    {
-        gsfError = GSF_CORRUPT_INDEX_FILE_ERROR;
-        return (-1);
-    }
-
-    /* Read the four four byte reserved fields */
-    fread(&index_header.spare1, 4, 1, ft->index_data.fp);
-    fread(&index_header.spare2, 4, 1, ft->index_data.fp);
-    fread(&index_header.spare3, 4, 1, ft->index_data.fp);
-    fread(&index_header.spare4, 4, 1, ft->index_data.fp);
-
-    /*  For each record type, read the record type, start address and
-     *  number of records.
-     */
-    for (i = 0; i < ft->index_data.number_of_types; i++)
-    {
-        fread(&j, 4, 1, ft->index_data.fp);
-        if (ft->index_data.swap)
-        {
-            SwapLong((unsigned int *) &j, 1);
-        }
-
-        /*  This is not really necessary but it makes things easier to code.
-         *  Put the record type into the record_type[record_type] member of
-         *  the index_data structure.
-         */
-        ft->index_data.record_type[j] = j;
-
-        fread(&ft->index_data.start_addr[j], 8, 1,
-            ft->index_data.fp);
-        fread(&ft->index_data.number_of_records[j], 4, 1,
-            ft->index_data.fp);
-
-        if (ft->index_data.swap)
-        {
-            SwapLongLong((long long *) &ft->index_data.start_addr[j], 1);
-            SwapLong((unsigned int *) &ft->index_data.number_of_records[j], 1);
-        }
-    }
-
-    /* Read the index file, and create temporary files with index data for
-     * each record type.
-     */
-    for (i=0; i<NUM_REC_TYPES; i++)
-    {
-        if (ft->index_data.number_of_records[i] > 0)
-        {
-            /* Move the index file's pointer to the first record for this type */
-            fseek(ft->index_data.fp, ft->index_data.start_addr[i], 0);
-
-            for(j=0; j<ft->index_data.number_of_records[i]; j++)
-            {
-                /* Read the index record from the disk */
-                fread(&index_rec, sizeof(INDEX_REC), 1, ft->index_data.fp);
-                if (ft->index_data.swap)
-                {
-                    SwapLong((unsigned int *) &index_rec.sec,  1);
-                    SwapLong((unsigned int *) &index_rec.nsec, 1);
-                    SwapLongLong((long long *) &index_rec.addr, 1);
-                }
-                if (temp[i] == NULL)
-                {
-                    temp[i] = open_temp_file(i);
-                    if (temp[i] == NULL)
-                    {
-                        gsfError = GSF_OPEN_TEMP_FILE_FAILED;
-                        return(-1);
-                    }
-                }
-                fwrite(&index_rec, sizeof(INDEX_REC), 1, temp[i]);
-
-                /* Save the address of the last record indexed */
-                if (index_rec.addr > last_index)
-                {
-                    last_record_type = i;
-                    last_record_number = j+1;
-                    last_index = index_rec.addr;
-                }
-            }
-        }
-    }
-
-    /* Read the currently indexed scale factor addresses into memory. */
-    if (ft->index_data.record_type[0] != -1)
-    {
-        ft->index_data.scale_factor_addr =
-            (INDEX_REC *) calloc(ft->index_data.number_of_records[0],
-            sizeof(INDEX_REC));
-
-        /*  Couldn't calloc the memory for the scale factor addresses.  */
-
-        if (ft->index_data.scale_factor_addr == NULL)
-        {
-            gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-            return (-1);
-        }
-
-        fseek(ft->index_data.fp, ft->index_data.start_addr[0], 0);
-        for (i = 0; i < ft->index_data.number_of_records[0]; i++)
-        {
-            fread(&ft->index_data.scale_factor_addr[i], sizeof(INDEX_REC), 1,
-                ft->index_data.fp);
-            if (ft->index_data.swap)
-            {
-                SwapLong((unsigned int *) &ft->index_data.scale_factor_addr[i].sec, 1);
-                SwapLong((unsigned int *) &ft->index_data.scale_factor_addr[i].nsec, 1);
-                SwapLongLong((long long *) &ft->index_data.scale_factor_addr[i].addr, 1);
-            }
-        }
-    }
-
-    /* If any ping records have been indexed read the last one. This is
-     * required to ensure we have the most recent scale factors loaded.
-     */
-
-    if (ft->index_data.number_of_records[GSF_RECORD_SWATH_BATHYMETRY_PING])
-    {
-        data_id.recordID = GSF_RECORD_SWATH_BATHYMETRY_PING;
-        data_id.record_number = -1;
-        err = gsfRead(handle, data_id.recordID, &data_id, &records, NULL, 0);
-        if (err < 0)
-        {
-            /*  Get rid of the temp files.  */
-            for (i = 0; i < NUM_REC_TYPES; i++)
-            {
-                /*  If the temp file pointer is non-NULL then this record type was
-                 *  encountered.
-                 */
-                if (temp[i] != NULL)
-                {
-
-                    close_temp_file(i, temp[i]);
-                }
-            }
-            /* gsfError will have been set in gsfRead */
-            return(-1);
-        }
-    }
-    gsfSeek(handle, GSF_PREVIOUS_RECORD);
-    save_pos = ftell(ft->fp);
-
-    /* If the last indexed record is not the ping record we just loaded, then
-     * go load the last indexed record so that the gsf file pointer is one
-     * record beyond the last record we have an index for.
-     */
-
-    if (last_record_type != GSF_RECORD_SWATH_BATHYMETRY_PING)
-    {
-        data_id.recordID = last_record_type;
-        data_id.record_number = last_record_number;
-        err = gsfRead(handle, data_id.recordID, &data_id, &records, NULL, 0);
-        if (err < 0)
-        {
-            /*  Get rid of the temp files.  */
-            for (i = 0; i < NUM_REC_TYPES; i++)
-            {
-                /*  If the temp file pointer is non-NULL then this record type was
-                 *  encountered.
-                 */
-                if (temp[i] != NULL)
-                {
-
-                    close_temp_file(i, temp[i]);
-                }
-            }
-            /* gsfError will have been set in gsfRead */
-            return(-1);
-        }
-    }
-    fseek(ft->fp, save_pos, SEEK_SET);
-
-    /*  Get the address of the end of file so we can compute percentage
-     *  processed for creating the index file.
-     */
-    eof = ft->file_size;
-    percent = 0;
-    old_percent = -1;
-    current = 0;
-
-    /*  Read each gsf record and write the time and address to the
-     *  temp index files.
-     */
-    do
-    {
-        long long rc;
-
-        /*  Save the current address within the gsf file.   */
-
-        if ((rc = ftell(ft->fp)) == -1 )
-        {
-            /*  Get rid of the temp files.  */
-            for (i = 0; i < NUM_REC_TYPES; i++)
-            {
-                /*  If the temp file pointer is non-NULL then this record type was
-                 *  encountered.
-                 */
-                if (temp[i] != NULL)
-                {
-
-                    close_temp_file(i, temp[i]);
-                }
-            }
-            gsfError = GSF_FILE_TELL_ERROR;
-            return (-1);
-        }
-
-        index_rec.addr = rc;
-
-        /*  Read the gsf record and check for end of file.  */
-
-        if ((err = gsfRead(handle, GSF_NEXT_RECORD, &data_id, &records,
-                           NULL, 0)) != -1)
-        {
-
-            /*  Switch based on the record type that was just read.  */
-
-            id = data_id.recordID;
-            switch (id)
-            {
-                    /*  Don't index the header or the summary.  */
-
-                case GSF_RECORD_HEADER:
-                    break;
-
-                case GSF_RECORD_SWATH_BATHY_SUMMARY:
-
-                    /*  If this is the first record of this type open the
-                        temp file and increment the number of types.    */
-
-                    if (temp[id] == NULL)
-                    {
-                        temp[id] = open_temp_file(id);
-                        if (temp[id] == (FILE *) NULL)
-                        {
-                            gsfError = GSF_OPEN_TEMP_FILE_FAILED;
-                            return (-1);
-                        }
-                        index_header.number_record_types++;
-                    }
-
-                    /*  Load the index record structure and write to the
-                        temp file.      */
-
-                    index_rec.sec = records.summary.start_time.tv_sec;
-                    index_rec.nsec = records.summary.end_time.tv_nsec;
-                    fwrite(&index_rec, sizeof(INDEX_REC), 1, temp[id]);
-                    ft->index_data.number_of_records[id]++;
-
-                    break;
-
-                case GSF_RECORD_SWATH_BATHYMETRY_PING:
-
-                    /*  If this ping record actually contained scale
-                        factor information in the file, make entries to
-                        two indexes; the standard ping index and the
-                        index for pings with scale factor subrecords.   */
-
-                    if (ft->scales_read)
-                    {
-                        /*  If this is the first record of this type
-                            open the temp file and increment the
-                            number of types.    */
-
-                        if (temp[0] == NULL)
-                        {
-                            temp[0] = open_temp_file(0);
-                            if (temp[0] == NULL)
-                            {
-                                return(-1);
-                            }
-                            index_header.number_record_types++;
-                        }
-
-                        /*  Load the index record structure and write to the
-                            temp file.  */
-
-                        index_rec.sec = records.mb_ping.ping_time.tv_sec;
-                        index_rec.nsec = records.mb_ping.ping_time.tv_nsec;
-                        fwrite(&index_rec, sizeof(INDEX_REC), 1, temp[0]);
-                        ft->index_data.number_of_records[0]++;
-
-                        if (ft->index_data.record_type[0] != -1)
-                        {
-                            if (ft->index_data.scale_factor_addr == (INDEX_REC *) NULL)
-                            {
-                                ft->index_data.scale_factor_addr =
-                                    (INDEX_REC *) calloc(ft->index_data.number_of_records[0],
-                                    sizeof(INDEX_REC));
-                            }
-                            else
-                            {
-                                ft->index_data.scale_factor_addr =
-                                    (INDEX_REC *) realloc(ft->index_data.scale_factor_addr,
-                                    ft->index_data.number_of_records[0] * sizeof(INDEX_REC));
-                            }
-
-                            /*  Couldn't calloc the memory for the scale factor addresses.  */
-
-                            if (ft->index_data.scale_factor_addr == NULL)
-                            {
-                                gsfError = GSF_MEMORY_ALLOCATION_FAILED;
-                                return (-1);
-                            }
-                        }
-                    }
-
-                    /*  If this is the first record of this type open the
-                        temp file and increment the number of types.    */
-
-                    if (temp[id] == NULL)
-                    {
-                        temp[id] = open_temp_file(id);
-                        if (temp[id] == (FILE *) NULL)
-                        {
-                            gsfError = GSF_OPEN_TEMP_FILE_FAILED;
-                            return (-1);
-                        }
-                        index_header.number_record_types++;
-                    }
-
-                    /*  Load the index record structure and write to the
-                        temp file.  */
-
-                    index_rec.sec = records.mb_ping.ping_time.tv_sec;
-                    index_rec.nsec = records.mb_ping.ping_time.tv_nsec;
-                    fwrite(&index_rec, sizeof(INDEX_REC), 1, temp[id]);
-                    ft->index_data.number_of_records[id]++;
-                    break;
-
-                case GSF_RECORD_SOUND_VELOCITY_PROFILE:
-
-                    /*  If this is the first record of this type open the
-                        temp file and increment the number of types.    */
-
-                    if (temp[id] == NULL)
-                    {
-                        temp[id] = open_temp_file(id);
-                        if (temp[id] == (FILE *) NULL)
-                        {
-                            gsfError = GSF_OPEN_TEMP_FILE_FAILED;
-                            return (-1);
-                        }
-                        index_header.number_record_types++;
-                    }
-
-                    /*  Load the index record structure and write to the
-                        temp file.  */
-
-                    index_rec.sec = records.svp.application_time.tv_sec;
-                    index_rec.nsec = records.svp.application_time.tv_nsec;
-                    fwrite(&index_rec, sizeof(INDEX_REC), 1, temp[id]);
-                    ft->index_data.number_of_records[id]++;
-
-                    break;
-
-                case GSF_RECORD_PROCESSING_PARAMETERS:
-
-                    /*  If this is the first record of this type open the
-                        temp file and increment the number of types.    */
-
-                    if (temp[id] == NULL)
-                    {
-                        temp[id] = open_temp_file(id);
-                        if (temp[id] == (FILE *) NULL)
-                        {
-                            gsfError = GSF_OPEN_TEMP_FILE_FAILED;
-                            return (-1);
-                        }
-                        index_header.number_record_types++;
-                    }
-
-                    /*  Load the index record structure and write to the
-                        temp file.  */
-
-                    index_rec.sec = records.process_parameters.param_time.tv_sec;
-                    index_rec.nsec =
-                        records.process_parameters.param_time.tv_nsec;
-                    fwrite(&index_rec, sizeof(INDEX_REC), 1, temp[id]);
-                    ft->index_data.number_of_records[id]++;
-
-                    break;
-
-                case GSF_RECORD_SENSOR_PARAMETERS:
-
-                    /*  If this is the first record of this type open the
-                        temp file and increment the number of types.    */
-
-                    if (temp[id] == NULL)
-                    {
-                        temp[id] = open_temp_file(id);
-                        if (temp[id] == (FILE *) NULL)
-                        {
-                            gsfError = GSF_OPEN_TEMP_FILE_FAILED;
-                            return (-1);
-                        }
-                        index_header.number_record_types++;
-                    }
-
-                    /*  Load the index record structure and write to the
-                        temp file.  */
-
-                    index_rec.sec = records.sensor_parameters.param_time.tv_sec;
-                    index_rec.nsec =
-                        records.sensor_parameters.param_time.tv_nsec;
-                    fwrite(&index_rec, sizeof(INDEX_REC), 1, temp[id]);
-                    ft->index_data.number_of_records[id]++;
-
-                    break;
-
-                case GSF_RECORD_COMMENT:
-
-                    /*  If this is the first record of this type open the
-                        temp file and increment the number of types.    */
-
-                    if (temp[id] == NULL)
-                    {
-                        temp[id] = open_temp_file(id);
-                        if (temp[id] == (FILE *) NULL)
-                        {
-                            gsfError = GSF_OPEN_TEMP_FILE_FAILED;
-                            return (-1);
-                        }
-                        index_header.number_record_types++;
-                    }
-
-                    /*  Load the index record structure and write to the
-                        temp file.  */
-
-                    index_rec.sec = records.comment.comment_time.tv_sec;
-                    index_rec.nsec = records.comment.comment_time.tv_nsec;
-                    fwrite(&index_rec, sizeof(INDEX_REC), 1, temp[id]);
-                    ft->index_data.number_of_records[id]++;
-
-                    break;
-
-                case GSF_RECORD_HISTORY:
-
-                    /*  If this is the first record of this type open the
-                        temp file and increment the number of types.    */
-
-                    if (temp[id] == NULL)
-                    {
-                        temp[id] = open_temp_file(id);
-                        if (temp[id] == (FILE *) NULL)
-                        {
-                            gsfError = GSF_OPEN_TEMP_FILE_FAILED;
-                            return (-1);
-                        }
-                        index_header.number_record_types++;
-                    }
-
-                    /*  Load the index record structure and write to the
-                        temp file.  */
-
-                    index_rec.sec = records.history.history_time.tv_sec;
-                    index_rec.nsec = records.history.history_time.tv_nsec;
-                    fwrite(&index_rec, sizeof(INDEX_REC), 1, temp[id]);
-                    ft->index_data.number_of_records[id]++;
-
-                    break;
-
-                case GSF_RECORD_NAVIGATION_ERROR:
-
-                    /*  If this is the first record of this type open the
-                        temp file and increment the number of types.    */
-
-                    if (temp[id] == NULL)
-                    {
-                        temp[id] = open_temp_file(id);
-                        if (temp[id] == (FILE *) NULL)
-                        {
-                            gsfError = GSF_OPEN_TEMP_FILE_FAILED;
-                            return (-1);
-                        }
-                        index_header.number_record_types++;
-                    }
-
-                    /*  Load the index record structure and write to the
-                        temp file.  */
-
-                    index_rec.sec = records.nav_error.nav_error_time.tv_sec;
-                    index_rec.nsec = records.nav_error.nav_error_time.tv_nsec;
-                    fwrite(&index_rec, sizeof(INDEX_REC), 1, temp[id]);
-                    ft->index_data.number_of_records[id]++;
-
-                    break;
-
-                /* jsb 10/07/98 Added direct access support for new navigation errors record */
-                case GSF_RECORD_HV_NAVIGATION_ERROR:
-
-                    /*  If this is the first record of this type open the
-                        temp file and increment the number of types.    */
-
-                    if (temp[id] == NULL)
-                    {
-                        temp[id] = open_temp_file(id);
-                        if (temp[id] == (FILE *) NULL)
-                        {
-                            gsfError = GSF_OPEN_TEMP_FILE_FAILED;
-                            return (-1);
-                        }
-                        index_header.number_record_types++;
-                    }
-
-                    /*  Load the index record structure and write to the
-                        temp file.  */
-
-                    index_rec.sec = records.hv_nav_error.nav_error_time.tv_sec;
-                    index_rec.nsec = records.hv_nav_error.nav_error_time.tv_nsec;
-                    fwrite(&index_rec, sizeof(INDEX_REC), 1, temp[id]);
-                    ft->index_data.number_of_records[id]++;
-
-                    break;
-
-                case GSF_RECORD_ATTITUDE:
-
-                    /*  If this is the first record of this type open the
-                        temp file and increment the number of types.    */
-
-                    if (temp[id] == NULL)
-                    {
-                        temp[id] = open_temp_file(id);
-                        if (temp[id] == (FILE *) NULL)
-                        {
-                            gsfError = GSF_OPEN_TEMP_FILE_FAILED;
-                            return (-1);
-                        }
-                        index_header.number_record_types++;
-                    }
-
-                    /*  Load the index record structure and write to the
-                        temp file.  */
-
-                    index_rec.sec = records.attitude.attitude_time[0].tv_sec;
-                    index_rec.nsec = records.attitude.attitude_time[0].tv_nsec;
-                    fwrite(&index_rec, sizeof(INDEX_REC), 1, temp[id]);
-                    ft->index_data.number_of_records[id]++;
-
-                    break;
-
-                default:
-
-                    fprintf(stderr, "Unknown record ID %d\n", id);
-                    break;
-            }
-
-            /*  Print the percent spinner to stdout.  */
-            if ((current = ftell(ft->fp)) == -1 )
-            {
-                gsfError = GSF_FILE_TELL_ERROR;
-
-                /*  Get rid of the temp files.  */
-                for (i = 0; i < NUM_REC_TYPES; i++)
-                {
-                    /*  If the temp file pointer is non-NULL then this record type was
-                     *  encountered.
-                     */
-                    if (temp[i] != NULL)
-                    {
-
-                        close_temp_file(i, temp[i]);
-                    }
-                }
-                return (-1);
-            }
-            percent = ((double) current  / (double) eof) * 100.0;
-            if (old_percent != percent)
-              {
-                /*  JCD: now calls a callback if it is registered.  */
-
-                if (gsf_progress_callback)
-                  {
-                    (*gsf_progress_callback) (3, percent);
-                  }
-#ifdef DISPLAY_SPINNER
-                else
-                  {
-                    printf("Writing index file - %03d%% complete\r", percent);
-                    fflush(stdout);
-                  }
-#endif
-                old_percent = percent;
-              }
-        }
-        else
-        {
-            if (gsfError != GSF_READ_TO_END_OF_FILE && gsfError != GSF_PARTIAL_RECORD_AT_END_OF_FILE)
-            {
-                /*  Get rid of the temp files.  */
-                for (i = 0; i < NUM_REC_TYPES; i++)
-                {
-                    /*  If the temp file pointer is non-NULL then this record type was
-                     *  encountered.
-                     */
-                    if (temp[i] != NULL)
-                    {
-
-                        close_temp_file(i, temp[i]);
-                    }
-                }
-                return(-1);
-            }
-        }
-    }
-    while (err != -1);
-
-    /* We currently have the index file opened read-only, close the file and open it
-     * for reading and writing.
-     */
-    fclose (ft->index_data.fp);
-
-    if ((ft->index_data.fp = fopen(ndx_file, "rb+")) == NULL)
-    {
-        gsfError = GSF_INDEX_FILE_OPEN_ERROR;
-        /*  Get rid of the temp files.  */
-        for (i = 0; i < NUM_REC_TYPES; i++)
-        {
-            /*  If the temp file pointer is non-NULL then this record type was
-             *  encountered.
-             */
-            if (temp[i] != NULL)
-            {
-
-                close_temp_file(i, temp[i]);
-            }
-        }
-        return(-1);
-    }
-
-    /* Write the index file header information. NOTE that the data are
-     * in native machine byte order.  There are 16 bytes of
-     * space reserved in the header for future information.
-     */
-    strncpy(index_header.version, GSF_INDEX_VERSION, GSF_INDEX_VERSION_SIZE);
-    fwrite(index_header.version, GSF_INDEX_VERSION_SIZE, 1, ft->index_data.fp);
-
-    index_header.gsfFileSize = ft->file_size;
-    u_temp = ft->file_size;
-    if (ft->index_data.swap)
-    {
-        SwapLongLong((long long *) &u_temp, 1);
-    }
-    fwrite(&u_temp, 8, 1, ft->index_data.fp);
-
-    index_header.endian = endian;
-    l_temp = endian;
-    if (ft->index_data.swap)
-    {
-        SwapLong((unsigned int *) &l_temp, 1);
-    }
-    fwrite(&l_temp, 4, 1, ft->index_data.fp);
-
-    l_temp = index_header.number_record_types;
-    if (ft->index_data.swap)
-    {
-        SwapLong((unsigned int *) &l_temp, 1);
-    }
-    fwrite(&l_temp, 4, 1, ft->index_data.fp);
-
-    fwrite(&index_header.spare1, 4, 1, ft->index_data.fp);
-    fwrite(&index_header.spare2, 4, 1, ft->index_data.fp);
-    fwrite(&index_header.spare3, 4, 1, ft->index_data.fp);
-    fwrite(&index_header.spare4, 4, 1, ft->index_data.fp);
-
-    /* Set the library's table entry for the number of record types for this file */
-    ft->index_data.number_of_types = index_header.number_record_types;
-
-    /*  Clear the space for the information (write dummy info for the
-     *  record type, number_of_records, and start address).
-     */
-    for (i = 0, j = 0; i < ft->index_data.number_of_types; i++)
-    {
-        fwrite(&j, 4, 1, ft->index_data.fp);
-        fwrite(&j, 4, 1, ft->index_data.fp);
-        fwrite(&j, 8, 1, ft->index_data.fp);
-    }
-
-    /*  Read the temp files and build the final index file.   */
-    j = 0;
-    for (i = 0; i < NUM_REC_TYPES; i++)
-    {
-        /*  If the temp file pointer is non-NULL then this record type was
-         *  encountered.
-         */
-        if (temp[i] != NULL)
-        {
-
-            /*  Rewind the temp file and set the start address and record
-             *  type.
-             */
-            fseek(temp[i], 0, 0);
-            ft->index_data.start_addr[i] = ftell(ft->index_data.fp);
-            ft->index_data.record_type[i] = i;
-
-            /*  Read through the temp file and write to the final file. */
-            while (fread(&index_rec, sizeof(INDEX_REC), 1, temp[i]) == 1)
-            {
-                if (ft->index_data.swap)
-                {
-                    SwapLong((unsigned int *) &index_rec, 2);
-                    SwapLongLong((long long *) &index_rec.addr, 1);
-                }
-                fwrite(&index_rec, sizeof(INDEX_REC), 1, ft->index_data.fp);
-            }
-
-            /*  Move to the beginning of the final file and write the
-             *  pertinent information for this record type.  The offset
-             *  is computed as follows :
-             *  j is the counter for the record types stored in the
-             *  index file, times 16 (size of the header info for each
-             *  record type), plus 48 bytes for the format version
-             *  id, gsf file size, endian indicator, total number of record
-             *  types, and reserved space.
-             */
-            fseek(ft->index_data.fp, (j * 16) + 48, 0);
-
-            l_temp = ft->index_data.record_type[i];
-            if (ft->index_data.swap)
-            {
-                SwapLong((unsigned int *) &l_temp, 1);
-            }
-            fwrite(&l_temp, 4, 1, ft->index_data.fp);
-
-            u_temp = ft->index_data.start_addr[i];
-            if (ft->index_data.swap)
-            {
-                SwapLongLong((long long *) &u_temp, 1);
-            }
-            fwrite(&u_temp, 8, 1, ft->index_data.fp);
-
-            l_temp = ft->index_data.number_of_records[i];
-            if (ft->index_data.swap)
-            {
-                SwapLong((unsigned int *) &l_temp, 1);
-            }
-            fwrite(&l_temp, 4, 1, ft->index_data.fp);
-
-            /* Advance to the end of the index file */
-            fseek(ft->index_data.fp, 0, SEEK_END);
-
-            /*  Get rid of the temp files.  */
-
-            close_temp_file(i, temp[i]);
-
-            j++;
-        }
-    }
-    /*  Set the byte swap indicator off.  No need to swap on a
-     *  machine of the same sex.
-     *
-     * jsb - 04/05/2000 - Don't modify the swap field, when we append an
-     *  index file, we'll preserve the original sex.
-     *
-     *  ft->index_data.swap = 0;
-     */
-
-#ifdef DISPLAY_SPINNER
-    if (!gsf_progress_callback) printf("                                            \r");
-#endif
-
-    return(0);
-}
-
-/********************************************************************
- *
- * Function Name : temp_file_name
- *
- * Description : This function provides a temporary file name to hold the
- *  temp indexes.  The index file name is constructed from the process ID,
- *  the record type, and .ndx.
- *
- * Inputs :
- *  type = record type
- *
- * Returns :
- *  This function returns the file pointer for the temp file.
- *
- * Error Conditions :
- *
- ********************************************************************/
-
-static void
-temp_file_name(int type, char *d_name, char *f_name)
-{
-
-#if defined(OS2) || defined(WIN32) || defined(WIN64)
-
-    if ( (getenv ("TEMP") == NULL) && (getenv ("GSFTMPDIR") == NULL) )
-        strcpy (d_name, ".\\");
-    else if (getenv ("GSFTMPDIR") != NULL)
-        strcpy (d_name, getenv ("GSFTMPDIR"));
-    else
-        strcpy (d_name, getenv ("TEMP"));
-
-    sprintf(f_name, "%s\\%05d%02d.ndx", d_name, _getpid(), type);
-
-#else
-
-    if ( (getenv ("TEMP") == NULL) && (getenv ("GSFTMPDIR") == NULL) )
-        strcpy (d_name, "/tmp");
-    else if (getenv ("GSFTMPDIR") != NULL)
-        strcpy (d_name, getenv ("GSFTMPDIR"));
-    else
-        strcpy (d_name, getenv ("TEMP"));
-
-    sprintf(f_name, "%s/%05d%02d.ndx", d_name, getpid(), type);
-
-#endif
-
-    return;
-}
-
-/********************************************************************
- *
- * Function Name : open_temp_file
- *
- * Description : This function creates a temporary file to hold the
- *  temp indexes.  The index file name is /tmp/ concatenated with the
- *  process ID, the record type, and .ndx.
- *
- * Inputs :
- *  type = record type
- *
- * Returns :
- *  This function returns the file pointer for the temp file.
- *
- * Error Conditons : ??????????
- *
- ********************************************************************/
-
-static FILE           *
-open_temp_file(int type)
-{
-    char            file[1024];
-    char            dir[1024];
-    FILE           *fp;
-
-    memset (&dir, 0, sizeof (dir));
-    memset (&file, 0, sizeof(file));
-
-    temp_file_name(type, dir, file);
-
-    if ((fp = fopen(file, "wb+")) == NULL)
-    {
-        perror(file);
-        return((FILE *) NULL);
-    }
-
-    return (fp);
-}
-
-
-/********************************************************************
- *
- * Function Name : close_temp_file
- *
- * Description : This function closes and deletes a temporary index file.
- *
- * Inputs :
- *  type = record type
- *  fp = temp file pointer
- *
- * Returns :
- *  nada
- *
- * Error Conditons : ??????????
- *
- ********************************************************************/
-
-static void
-close_temp_file(int type, FILE * fp)
-{
-    char            file[1024];
-    char            dir[1024];
-
-    fclose(fp);
-    memset (&dir, 0, sizeof(dir));
-    memset (&file, 0, sizeof(file));
-
-    temp_file_name(type, dir, file);
-
-    unlink(file);
-
-    return;
-}
-
-/********************************************************************
- *
- * Function Name : gsfCloseIndex
- *
- * Description : This function closes the index file associated with
- *  the gsf file handle passed.
- *
- * Inputs :
- *  handle = gsf file handle assigned by gsfOpen or gsfOpenBuffered
- *
- * Returns :
- *  This function returns zero if successfull, or -1
- *
- * Error Conditions :
- *
- ********************************************************************/
-
-int
-gsfCloseIndex(GSF_FILE_TABLE *ft)
-{
-    if (fclose(ft->index_data.fp))
-    {
-        gsfError = GSF_FILE_CLOSE_ERROR;
-        return (-1);
-    }
-
-    /* Free the memory allocated for the scale factor addresses. */
-    if (ft->index_data.scale_factor_addr != (INDEX_REC *) NULL)
-    {
-        free(ft->index_data.scale_factor_addr);
-        ft->index_data.scale_factor_addr = (INDEX_REC *) NULL;
-    }
-
-    return(0);
-}
-
-/******************************************************************************\
-*                                                                              *
-*   Programmer(s):      David B. Johanson                                      *
-*                                                                              *
-*   Date Written:       February, 1994                                         *
-*                                                                              *
-*   Module Name:        SwapLong                                               *
-*                                                                              *
-*   Module Security                                                            *
-*   Classification:     Unclassified                                           *
-*                                                                              *
-*   Data Security                                                              *
-*   Classification:     Unknown                                                *
-*                                                                              *
-*   Purpose:            This function swaps four-byte words.                   *
-*                                                                              *
-*   Inputs:             The base address of the bytes to be swapped and        *
-*                       the number of words to swap.                           *
-*                                                                              *
-*   Outputs:            The swapped bytes (by reference)                       *
-*                                                                              *
-*   Calling Routines:   main                                                   *
-*                                                                              *
-*   Routines Called:    None                                                   *
-*                                                                              *
-*   Glossary:           intvalue        - the word to be byte-swapped          *
-*                       bytevalue       - bytes within the word                *
-*                       data            - union of intvalue, bytevalue         *
-*                       swap_address    - address of word to be swapped        *
-*                       byte0           - temporary storage                    *
-*                       byte1           - temporary storage                    *
-*                       i               - counter, # of words swapped          *
-*                                                                              *
-*   Method:             Load short value with the next word to be swapped      *
-*                       swap the bytes, repeat till done.                      *
-*                                                                              *
-*   History:            dbj, 2/94: Modified from function written by D. Avery. *
-*                       dbj, 6/94: Renamed from SwapBytes to SwapLong.  Added  *
-*                                 use of typedefs plus other minor mods.       *
-*                                                                              *
-\******************************************************************************/
-
-void
-SwapLong(unsigned int *base_address, int count)
-{
-    union
-    {
-        unsigned int    intvalue;       /* the word to swap                    */
-        unsigned char   bytevalue[4];   /* bytes within the word               */
-    }
-    data;
-
-    unsigned char   byte0,      /* temporary storage                   */
-                    byte1;      /* temporary storage                   */
-    int             i;          /* counter for number of words swapped */
-
-    for (i = 0; i < count; i++)
-    {
-        /* Swap the bytes.                                                      */
-
-        data.intvalue = *(base_address + i);
-        byte0 = data.bytevalue[0];
-        byte1 = data.bytevalue[1];
-        data.bytevalue[0] = data.bytevalue[3];
-        data.bytevalue[1] = data.bytevalue[2];
-        data.bytevalue[2] = byte1;
-        data.bytevalue[3] = byte0;
-        *(base_address + i) = data.intvalue;
-    }
-    return;
-}
-
-void
-SwapLongLong(long long *base_address, int count)
-{
-    union
-    {
-        long long       longvalue;       /* the long long to swap                    */
-        unsigned char   bytevalue[8];   /* bytes within the long long               */
-    }
-    data;
-
-    unsigned char   byte0;      /* temporary storage                   */
-    int             i, j;       /* counter for number of long longs swapped */
-
-    for (i = 0; i < count; i++)
-    {
-        /* Swap the bytes.                                                      */
-
-        data.longvalue = *(base_address + i);
-
-        for (j=0; j < 4; j++)
-        {
-            byte0 = data.bytevalue[7-j];
-            data.bytevalue[8-j] = data.bytevalue[j];
-            data.bytevalue[j] = byte0;
-        }
-        *(base_address + i) = data.longvalue;
-    }
-    return;
-}
-
diff --git a/src/gsf/gsf_indx.h b/src/gsf/gsf_indx.h
deleted file mode 100644
index cc9599c..0000000
--- a/src/gsf/gsf_indx.h
+++ /dev/null
@@ -1,120 +0,0 @@
-/********************************************************************
- *
- * Module Name : GSF_INDX
- *
- * Author/Date : J. S. Byrne / 23 Aug 1995
- *
- * Description : This header file contains function prototypes and
- *    definitions required for direct access to gsf files.  This header
- *    file is internal to the library, and none of these functions are
- *    intended to be exported from the library.
- *
- * Restrictions/Limitations :
- *
- * Change Descriptions :
- * who  when      what
- * ---  ----      ----
- * jsb  11/01/95  Start with index file version INDEX-GSF-v01.00
- * bac  06/28/06  Added J.Depner updates to support a progress callback
- *                 when writing to the index file, as an alternative to
- *                 the DISPLAY_SPINNER printouts.  Changed function
- *                 arguments and structure elements of type long to
- *                 int, for compilation on 64-bit architectures.
- *
- * Classification : Unclassified
- *
- * References : DoDBL Generic Sensor Format Sept. 30, 1993
- *
- *
- * copyright 2014 Leidos, Inc.
- * There is no charge to use the library, and it may be accessed at:
- * https://www.leidos.com/maritime/gsf.
- * This library may be redistributed and/or modified under the terms of
- * the GNU Lesser General Public License version 2.1, as published by the
- * Free Software Foundation.  A copy of the LGPL 2.1 license is included with
- * the GSF distribution and is avaialbe at: http://opensource.org/licenses/LGPL-2.1.
- *
- * Leidos, Inc. configuration manages GSF, and provides GSF releases. Users are
- * strongly encouraged to communicate change requests and change proposals to Leidos, Inc.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE.
- *
- ********************************************************************/
-
-#ifndef __GSF_INDX__
-    #define __GSF_INDX__
-
-#ifdef  __cplusplus
-extern "C" {
-#endif
-
-
-    /* This header has the GSF File Table structure definition */
-    #include "gsf_ft.h"
-
-    /* Define a macro to hold a version tag for gsf index file. Note that
-     * the macro definition for the version size defines the number of bytes
-     * read/written for the version, so this should NOT be changed.
-     */
-    #define GSF_INDEX_VERSION       "INDEX-GSF-v02.00"
-    #define GSF_INDEX_VERSION_SIZE  16
-
-    /* Typedef a structure to hold the index file header information */
-    typedef struct t_gsfIndexHeader
-    {
-        char        version[GSF_INDEX_VERSION_SIZE+1];
-        long long   gsfFileSize;
-        int         endian;
-        int         number_record_types;
-        int         spare1;
-        int         spare2;
-        int         spare3;
-        int         spare4;
-    } GSF_INDEX_HEADER;
-
-
-    /* JCD: Typedef for index progress callback */
-    typedef void (*GSF_PROGRESS_CALLBACK) (int state, int percent);
-
-
-    /* Prototypes for this module */
-    int OPTLK       gsfOpenIndex(const char *filename, int handle, GSF_FILE_TABLE *ft);
-    int OPTLK       gsfCloseIndex(GSF_FILE_TABLE *ft);
-    void OPTLK      SwapLong(unsigned int *base, int count);
-    void OPTLK      SwapLongLong(long long *base_address, int count);
-
-    void OPTLK      gsf_register_progress_callback (GSF_PROGRESS_CALLBACK progressCB);
-    /*
-     * Description : The gsf_register_progress_callback function registers a callback
-     *                function, defined by the user, to be called to report the progress
-     *                of the index file creation.  If no progress callback is registered,
-     *                status is printed to stdout if the DISPLAY_SPINNER macro is defined
-     *                during compilation of the GSF library.
-     *
-     * Inputs :
-     *    GSF_PROGRESS_CALLBACK progressCB = Name of progress callback function to call
-     *                                       when creating the GSF index file.  The
-     *                                       progress callback will accept two integer
-     *                                       arguments, and this function will be called
-     *                                       whenever the percent complete changes.
-     *                                       The first argument will be one of the
-     *                                       following three values, to represent the
-     *                                       state of the progress:
-     *                                       1 = Reading GSF file
-     *                                       2 = Creating new index file
-     *                                       3 = Appending to existing index file
-     *                                       The second argument contains the percent
-     *                                       complete of the current state.
-     *
-     * Returns : none
-     *
-     * Error Conditions : none
-     */
-
-#ifdef  __cplusplus
-}
-#endif
-
-#endif /* __GSF_INDX__ */
diff --git a/src/gsf/gsf_info.c b/src/gsf/gsf_info.c
deleted file mode 100644
index fcb4133..0000000
--- a/src/gsf/gsf_info.c
+++ /dev/null
@@ -1,783 +0,0 @@
-/********************************************************************
- *
- * Module Name : gsf_info.c
- *
- * Author/Date : J. S. Byrne / December 2009
- *
- * Description :
- *  This source file contains GSF informational functions that provide
- *   general information or status of contents of the current file.
- *
- * Restrictions/Limitations :
- * 1) This library assumes the host computer uses the ASCII character set.
- * 2) This library assumes that the data types u_short and u_int are defined
- *    on the host machine, where a u_short is a 16 bit unsigned integer, and
- *    a u_int is a 32 bit unsigned integer.
- * 3) This library assumes that the type short is 16 bits, and that
- *    the type int is 32 bits.
- *
- *
- * Change Descriptions :
- * who          when      what
- * ---          ----      ----
- * jsb          12-29-09  New
- *
- * Classification : Unclassified
- *
- * References : DoDBL Generic Sensor Format Sept. 30, 1993
- *
- * copyright 2014 Leidos, Inc.
- * There is no charge to use the library, and it may be accessed at:
- * https://www.leidos.com/maritime/gsf.
- * This library may be redistributed and/or modified under the terms of
- * the GNU Lesser General Public License version 2.1, as published by the
- * Free Software Foundation.  A copy of the LGPL 2.1 license is included with
- * the GSF distribution and is avaialbe at: http://opensource.org/licenses/LGPL-2.1.
- *
- * Leidos, Inc. configuration manages GSF, and provides GSF releases. Users are
- * strongly encouraged to communicate change requests and change proposals to Leidos, Inc.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE.
- *
- ********************************************************************/
-
-/* standard c library includes */
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-
-/* rely on the network type definitions of (u_short, and u_int) */
-#include <sys/types.h>
-#if !defined WIN32 && !defined WIN64
-#include <netinet/in.h>
-#else
-#include <winsock.h>
-#endif
-
-/* gsf library interface description */
-#include "gsf.h"
-
-/* Global external data defined in this module */
-extern int      gsfError;                               /* defined in gsf.c */
-
-/* Function prototypes for this file */
-
-/********************************************************************
- *
- * Function Name : gsfFileSupportsRecalculateXYZ
- *
- * Description :
- *  This function reads the GSF file referenced by handle and determines
- *  if the file contains sufficient information to support a full recalculation
- *  of the platform relative XYZ values from raw measurements. This function
- *  rewinds the file to the first record and reads through the file looking for
- *  the information required to support a recalculation. On success, the file
- *  pointer is reset to the beginning of the file before the function returns.
- *
- * Inputs :
- *  handle = the integer handle returned from gsfOpen()
- *  status = A pointer to an integer allocated by caller into which the
- *            function result is placed. *status is assigned a value of 1
- *            if this file provides sufficient information to support full
- *            recalculation of the platform relative XYZ values, otherwise
- *            *status is assigned a value of 0.
- *
- * Returns :
- *  This function returns zero if successful, or -1 if an error occurred.
- *
- * Error Conditions :
- *  GSF_BAD_FILE_HANDLE
- *  GSF_FILE_SEEK_ERROR
- *  GSF_FLUSH_ERROR
- *  GSF_READ_TO_END_OF_FILE
- *  GSF_READ_ERROR
- *  GSF_RECORD_SIZE_ERROR
- *  GSF_INSUFFICIENT_SIZE
- *  GSF_CHECKSUM_FAILURE
- *  GSF_UNRECOGNIZED_RECORD_ID
- *  GSF_HEADER_RECORD_DECODE_FAILED
- *  GSF_SVP_RECORD_DECODE_FAILED
- *  GSF_PROCESS_PARAM_RECORD_DECODE_FAILED
- *  GSF_SENSOR_PARAM_RECORD_DECODE_FAILED
- *  GSF_COMMENT_RECORD_DECODE_FAILED
- *  GSF_HISTORY_RECORD_DECODE_FAILED
- *  GSF_NAV_ERROR_RECORD_DECODE_FAILED
- *
- ********************************************************************/
-int
-gsfFileSupportsRecalculateXYZ(int handle, int *status)
-{
-    int             ret;
-    int             i;
-    int             rec_size;
-    int             att_rec;
-    int             svp_rec;
-    int             param_rec;
-    int             ping_rec;
-    gsfDataID       id;
-    gsfRecords      rec;
-
-    memset (&id, 0, sizeof(id));
-    memset (&rec, 0, sizeof(rec));
-    att_rec = 0;
-    svp_rec = 0;
-    param_rec = 0;
-    ping_rec = 0;
-
-    *status = 0;
-
-    /* Rewind the file so that the pointer is at the first record. */
-    ret = gsfSeek(handle, GSF_REWIND);
-    if (ret)
-    {
-        gsfError = GSF_FILE_SEEK_ERROR;
-        return (-1);
-    }
-
-    for (i = 0; i < 100; i++)
-    {
-        rec_size = gsfRead(handle, GSF_NEXT_RECORD, &id, &rec, NULL, 0);
-        if (rec_size < 0)
-        {
-            if (gsfError == GSF_READ_TO_END_OF_FILE)
-            {
-                ret = gsfSeek(handle, GSF_REWIND);
-                if (ret)
-                {
-                    gsfError = GSF_FILE_SEEK_ERROR;
-                    return (-1);
-                }
-                return(0);
-            }
-            else
-            {
-                /* gsfError should already be set to indicate the type of failure that occurred */
-                return (-1);
-            }
-        }
-
-        switch (id.recordID)
-        {
-            default:
-            case (GSF_RECORD_NAVIGATION_ERROR):
-            case (GSF_RECORD_SWATH_BATHY_SUMMARY):
-            case (GSF_RECORD_HISTORY):
-            case (GSF_RECORD_SENSOR_PARAMETERS):
-            case (GSF_RECORD_COMMENT):
-            case (GSF_RECORD_HEADER):
-                break;
-
-            case (GSF_RECORD_SWATH_BATHYMETRY_PING):
-                if ((rec.mb_ping.travel_time) && (rec.mb_ping.beam_angle))
-                {
-                    switch (rec.mb_ping.sensor_id)
-                    {
-                        default:
-                            break;
-
-                        case GSF_SWATH_BATHY_SUBRECORD_RESON_8101_SPECIFIC:
-                        case GSF_SWATH_BATHY_SUBRECORD_RESON_8111_SPECIFIC:
-                        case GSF_SWATH_BATHY_SUBRECORD_RESON_8124_SPECIFIC:
-                        case GSF_SWATH_BATHY_SUBRECORD_RESON_8125_SPECIFIC:
-                        case GSF_SWATH_BATHY_SUBRECORD_RESON_8150_SPECIFIC:
-                        case GSF_SWATH_BATHY_SUBRECORD_RESON_8160_SPECIFIC:
-                        case GSF_SWATH_BATHY_SUBRECORD_RESON_7125_SPECIFIC:
-                        case GSF_SWATH_BATHY_SUBRECORD_EM300_RAW_SPECIFIC:
-                        case GSF_SWATH_BATHY_SUBRECORD_EM1002_RAW_SPECIFIC:
-                        case GSF_SWATH_BATHY_SUBRECORD_EM2000_RAW_SPECIFIC:
-                        case GSF_SWATH_BATHY_SUBRECORD_EM3000_RAW_SPECIFIC:
-                        case GSF_SWATH_BATHY_SUBRECORD_EM120_RAW_SPECIFIC:
-                        case GSF_SWATH_BATHY_SUBRECORD_EM3002_RAW_SPECIFIC:
-                        case GSF_SWATH_BATHY_SUBRECORD_EM3000D_RAW_SPECIFIC:
-                        case GSF_SWATH_BATHY_SUBRECORD_EM3002D_RAW_SPECIFIC:
-                            ping_rec++;
-                            break;
-
-                        case GSF_SWATH_BATHY_SUBRECORD_EM710_SPECIFIC:
-                        case GSF_SWATH_BATHY_SUBRECORD_EM302_SPECIFIC:
-                        case GSF_SWATH_BATHY_SUBRECORD_EM122_SPECIFIC:
-                            if (rec.mb_ping.sector_number)
-                            {
-                                ping_rec++;
-                            }
-                            break;
-                    }
-                }
-                break;
-
-            case (GSF_RECORD_SOUND_VELOCITY_PROFILE):
-                if (rec.svp.number_points > 1)
-                {
-                    svp_rec++;
-                }
-                break;
-
-            case (GSF_RECORD_PROCESSING_PARAMETERS):
-                if (rec.process_parameters.number_parameters > 1)
-                {
-                    param_rec++;
-                }
-                break;
-
-            case (GSF_RECORD_ATTITUDE):
-                if (rec.attitude.num_measurements > 1)
-                {
-                    att_rec++;
-                }
-                break;
-        }
-
-        if (ping_rec && svp_rec && param_rec && att_rec)
-        {
-            *status = 1;
-            break;
-        }
-    }
-
-    /* reset the file pointer to where it was when function was called */
-    /* Rewind the file so that the pointer is at the first record. */
-    ret = gsfSeek(handle, GSF_REWIND);
-    if (ret)
-    {
-        gsfError = GSF_FILE_SEEK_ERROR;
-        return (-1);
-    }
-
-    return (0);
-}
-
-/********************************************************************
- *
- * Function Name : gsfFileSupportsRecalculateTPU
- *
- * Description :
- *  This function reads the GSF file referenced by handle and determines
- *  if the file contains sufficient information to support a recalculation
- *  of the total propagated uncertainty (TPU) estimates. This function
- *  rewinds the file to the first record and reads through the file looking for
- *  the information required to support TPU estimation. On success, the file
- *  pointer is reset to the beginning of the file before the function returns.
- *
- * Inputs :
- *  handle = the integer handle returned from gsfOpen()
- *  status = A pointer to an integer allocated by caller into which the
- *           function result is placed. *status is assigned a value of 1
- *           if this file provides sufficient information to support TPU
- *           estimation, otherwise *status is assigned a value of 0.
- *
- * Returns :
- *  This function returns zero if successful, or -1 if an error occurred.
- *
- * Error Conditions :
- *  GSF_BAD_FILE_HANDLE
- *  GSF_FILE_SEEK_ERROR
- *  GSF_FLUSH_ERROR
- *  GSF_READ_TO_END_OF_FILE
- *  GSF_READ_ERROR
- *  GSF_RECORD_SIZE_ERROR
- *  GSF_INSUFFICIENT_SIZE
- *  GSF_CHECKSUM_FAILURE
- *  GSF_UNRECOGNIZED_RECORD_ID
- *  GSF_HEADER_RECORD_DECODE_FAILED
- *  GSF_SVP_RECORD_DECODE_FAILED
- *  GSF_PROCESS_PARAM_RECORD_DECODE_FAILED
- *  GSF_SENSOR_PARAM_RECORD_DECODE_FAILED
- *  GSF_COMMENT_RECORD_DECODE_FAILED
- *  GSF_HISTORY_RECORD_DECODE_FAILED
- *  GSF_NAV_ERROR_RECORD_DECODE_FAILED
- *
- ********************************************************************/
-int
-gsfFileSupportsRecalculateTPU(int handle, int *status)
-{
-    int             ret;
-    int             i;
-    int             rec_size;
-    int             svp_rec;
-    int             param_rec;
-    int             ping_rec;
-    gsfDataID       id;
-    gsfRecords      rec;
-
-    memset (&id, 0, sizeof(id));
-    memset (&rec, 0, sizeof(rec));
-    svp_rec = 0;
-    param_rec = 0;
-    ping_rec = 0;
-
-    *status = 0;
-
-    /* Rewind the file so that the pointer is at the first record. */
-    ret = gsfSeek(handle, GSF_REWIND);
-    if (ret)
-    {
-        gsfError = GSF_FILE_SEEK_ERROR;
-        return (-1);
-    }
-
-    for (i = 0; i < 100; i++)
-    {
-        rec_size = gsfRead(handle, GSF_NEXT_RECORD, &id, &rec, NULL, 0);
-        if (rec_size < 0)
-        {
-            if (gsfError == GSF_READ_TO_END_OF_FILE)
-            {
-                ret = gsfSeek(handle, GSF_REWIND);
-                if (ret)
-                {
-                    gsfError = GSF_FILE_SEEK_ERROR;
-                    return (-1);
-                }
-                return(0);
-            }
-            else
-            {
-                /* gsfError should already be set to indicate the type of failure that occurred */
-                return (-1);
-            }
-        }
-
-        switch (id.recordID)
-        {
-            default:
-            case (GSF_RECORD_NAVIGATION_ERROR):
-            case (GSF_RECORD_SWATH_BATHY_SUMMARY):
-            case (GSF_RECORD_HISTORY):
-            case (GSF_RECORD_SENSOR_PARAMETERS):
-            case (GSF_RECORD_COMMENT):
-            case (GSF_RECORD_HEADER):
-                break;
-
-            case (GSF_RECORD_SWATH_BATHYMETRY_PING):
-                if ((rec.mb_ping.depth) && (rec.mb_ping.across_track))
-                {
-                    switch (rec.mb_ping.sensor_id)
-                    {
-                        case GSF_SWATH_BATHY_SUBRECORD_EM710_SPECIFIC:
-                        case GSF_SWATH_BATHY_SUBRECORD_EM302_SPECIFIC:
-                        case GSF_SWATH_BATHY_SUBRECORD_EM122_SPECIFIC:
-                            if ((rec.mb_ping.sector_number) && (rec.mb_ping.sensor_data.gsfEM4Specific.sector[0].signal_length > 0))
-                            {
-                                ping_rec++;
-                            }
-                            break;
-
-                        default:
-                            ping_rec++;
-                            break;
-                    }
-                }
-                break;
-
-            case (GSF_RECORD_SOUND_VELOCITY_PROFILE):
-                if (rec.svp.number_points > 1)
-                {
-                    svp_rec++;
-                }
-                break;
-
-            case (GSF_RECORD_PROCESSING_PARAMETERS):
-                if (rec.process_parameters.number_parameters > 1)
-                {
-                    param_rec++;
-                }
-                break;
-        }
-
-        if (ping_rec && svp_rec && param_rec)
-        {
-            *status = 1;
-            break;
-        }
-    }
-
-    /* reset the file pointer to where it was when function was called */
-    /* Rewind the file so that the pointer is at the first record. */
-    ret = gsfSeek(handle, GSF_REWIND);
-    if (ret)
-    {
-        gsfError = GSF_FILE_SEEK_ERROR;
-        return (-1);
-    }
-
-    return (0);
-}
-
-/********************************************************************
- *
- * Function Name : gsfFileSupportsRecalculateNominalDepth
- *
- * Description :
- *  This function reads the GSF file referenced by handle and determines
- *  if the file contains sufficient information to support a recalculation
- *  of the nominal depth array. This function rewinds the file to the first
- *  record and reads through the file looking for the information required
- *  to support calculation of the nominal depth values. On success, the file
- *  pointer is reset to the beginning of the file before the function returns.
- *
- * Inputs :
- *  handle = the integer handle returned from gsfOpen()
- *  status = A pointer to an integer allocated by caller into which the
- *           function result is placed. *status is assigned a value of 1
- *           if this file provides sufficient information to support
- *           nominal depth calculation, otherwise *status is assigned
- *           a value of 0.
- *
- * Returns :
- *  This function returns zero if successful, or -1 if an error occurred.
- *
- * Error Conditions :
- *  GSF_BAD_FILE_HANDLE
- *  GSF_FILE_SEEK_ERROR
- *  GSF_FLUSH_ERROR
- *  GSF_READ_TO_END_OF_FILE
- *  GSF_READ_ERROR
- *  GSF_RECORD_SIZE_ERROR
- *  GSF_INSUFFICIENT_SIZE
- *  GSF_CHECKSUM_FAILURE
- *  GSF_UNRECOGNIZED_RECORD_ID
- *  GSF_HEADER_RECORD_DECODE_FAILED
- *  GSF_SVP_RECORD_DECODE_FAILED
- *  GSF_PROCESS_PARAM_RECORD_DECODE_FAILED
- *  GSF_SENSOR_PARAM_RECORD_DECODE_FAILED
- *  GSF_COMMENT_RECORD_DECODE_FAILED
- *  GSF_HISTORY_RECORD_DECODE_FAILED
- *  GSF_NAV_ERROR_RECORD_DECODE_FAILED
- *
- ********************************************************************/
-int
-gsfFileSupportsRecalculateNominalDepth(int handle, int *status)
-{
-    int             ret;
-    int             i;
-    int             rec_size;
-    int             svp_rec;
-    int             param_rec;
-    int             ping_rec;
-    gsfDataID       id;
-    gsfRecords      rec;
-
-    memset (&id, 0, sizeof(id));
-    memset (&rec, 0, sizeof(rec));
-    svp_rec = 0;
-    param_rec = 0;
-    ping_rec = 0;
-
-    *status = 0;
-
-    /* Rewind the file so that the pointer is at the first record. */
-    ret = gsfSeek(handle, GSF_REWIND);
-    if (ret)
-    {
-        gsfError = GSF_FILE_SEEK_ERROR;
-        return (-1);
-    }
-
-    for (i = 0; i < 100; i++)
-    {
-        rec_size = gsfRead(handle, GSF_NEXT_RECORD, &id, &rec, NULL, 0);
-        if (rec_size < 0)
-        {
-            if (gsfError == GSF_READ_TO_END_OF_FILE)
-            {
-                ret = gsfSeek(handle, GSF_REWIND);
-                if (ret)
-                {
-                    gsfError = GSF_FILE_SEEK_ERROR;
-                    return (-1);
-                }
-                return(0);
-            }
-            else
-            {
-                /* gsfError should already be set to indicate the type of failure that occurred */
-                return (-1);
-            }
-        }
-
-        switch (id.recordID)
-        {
-            default:
-            case (GSF_RECORD_NAVIGATION_ERROR):
-            case (GSF_RECORD_SWATH_BATHY_SUMMARY):
-            case (GSF_RECORD_HISTORY):
-            case (GSF_RECORD_SENSOR_PARAMETERS):
-            case (GSF_RECORD_COMMENT):
-            case (GSF_RECORD_HEADER):
-                break;
-
-            case (GSF_RECORD_SWATH_BATHYMETRY_PING):
-                if ((rec.mb_ping.depth))
-                {
-                     ping_rec++;
-                }
-                break;
-
-            case (GSF_RECORD_SOUND_VELOCITY_PROFILE):
-                if (rec.svp.number_points > 1)
-                {
-                    svp_rec++;
-                }
-                break;
-
-            case (GSF_RECORD_PROCESSING_PARAMETERS):
-                if (rec.process_parameters.number_parameters > 1)
-                {
-                    param_rec++;
-                }
-                break;
-        }
-
-        if (ping_rec && svp_rec && param_rec)
-        {
-            *status = 1;
-            break;
-        }
-    }
-
-    /* reset the file pointer to where it was when function was called */
-    /* Rewind the file so that the pointer is at the first record. */
-    ret = gsfSeek(handle, GSF_REWIND);
-    if (ret)
-    {
-        gsfError = GSF_FILE_SEEK_ERROR;
-        return (-1);
-    }
-
-    return (0);
-}
-
-/********************************************************************
- *
- * Function Name : gsfFileContainsMBAmplitude
- *
- * Description :
- *  This function reads the GSF file referenced by handle and determines
- *  if the file contains the average per receive beam amplitude data.
- *  This function rewinds the file to the first record and reads through
- *  the file up to and including the first ping record. If amplitude data
- *  are contained in the first ping record it is assumed that amplitude
- *  data are contained with all ping records in this file. On success,
- *  the file pointer is reset to the beginning of the file before the
- *  function returns.
- *
- * Inputs :
- *  handle = the integer handle returned from gsfOpen()
- *  status = A pointer to an integer allocated by caller into which the
- *           function result is placed. *status is assigned a value of 1
- *           if this file contains the per receive beam amplitude data,
- *           otherwise *status is assigned a value of 0.
- *
- * Returns :
- *  This function returns zero if successful, or -1 if an error occurred.
- *
- * Error Conditions :
- *  GSF_BAD_FILE_HANDLE
- *  GSF_FILE_SEEK_ERROR
- *  GSF_FLUSH_ERROR
- *  GSF_READ_TO_END_OF_FILE
- *  GSF_READ_ERROR
- *  GSF_RECORD_SIZE_ERROR
- *  GSF_INSUFFICIENT_SIZE
- *  GSF_CHECKSUM_FAILURE
- *  GSF_UNRECOGNIZED_RECORD_ID
- *  GSF_HEADER_RECORD_DECODE_FAILED
- *  GSF_SVP_RECORD_DECODE_FAILED
- *  GSF_PROCESS_PARAM_RECORD_DECODE_FAILED
- *  GSF_SENSOR_PARAM_RECORD_DECODE_FAILED
- *  GSF_COMMENT_RECORD_DECODE_FAILED
- *  GSF_HISTORY_RECORD_DECODE_FAILED
- *  GSF_NAV_ERROR_RECORD_DECODE_FAILED
- *
- ********************************************************************/
-int
-gsfFileContainsMBAmplitude(int handle, int *status)
-{
-    int             ret;
-    int             i;
-    int             rec_size;
-    int             mb_ping;
-    gsfDataID       id;
-    gsfRecords      rec;
-
-    memset (&id, 0, sizeof(id));
-    memset (&rec, 0, sizeof(rec));
-    mb_ping = 0;
-    *status = 0;
-
-    /* Rewind the file so that the pointer is at the first record. */
-    ret = gsfSeek(handle, GSF_REWIND);
-    if (ret)
-    {
-        gsfError = GSF_FILE_SEEK_ERROR;
-        return (-1);
-    }
-
-    for (i = 0; i < 100; i++)
-    {
-        rec_size = gsfRead(handle, GSF_NEXT_RECORD, &id, &rec, NULL, 0);
-        if (rec_size < 0)
-        {
-            if (gsfError == GSF_READ_TO_END_OF_FILE)
-            {
-                ret = gsfSeek(handle, GSF_REWIND);
-                if (ret)
-                {
-                    gsfError = GSF_FILE_SEEK_ERROR;
-                    return (-1);
-                }
-                return(0);
-            }
-            else
-            {
-                /* gsfError should already be set to indicate the type of failure that occurred */
-                return (-1);
-            }
-        }
-
-        switch (id.recordID)
-        {
-            case (GSF_RECORD_SWATH_BATHYMETRY_PING):
-                if ((rec.mb_ping.mc_amplitude) || (rec.mb_ping.mr_amplitude))
-                {
-                    *status = 1;
-                }
-                mb_ping = 1;
-                break;
-        }
-        if (mb_ping == 1)
-        {
-            break;
-        }
-    }
-
-    /* reset the file pointer to where it was when function was called */
-    /* Rewind the file so that the pointer is at the first record. */
-    ret = gsfSeek(handle, GSF_REWIND);
-    if (ret)
-    {
-        gsfError = GSF_FILE_SEEK_ERROR;
-        return (-1);
-    }
-
-    return (0);
-}
-
-/********************************************************************
- *
- * Function Name : gsfFileContainsMBImagery
- *
- * Description :
- *  This function reads the GSF file referenced by handle and determines
- *  if the file contains the per receive beam imagery time series data.
- *  This function rewinds the file to the first record and reads through
- *  the file up to and including the first ping record. If MB imagery data
- *  are contained in the first ping record it is assumed that MB imagery
- *  data are contained with all ping records in this file. On success,
- *  the file pointer is reset to the beginning of the file before the
- *  function returns.
- *
- * Inputs :
- *  handle = the integer handle returned from gsfOpen()
- *  status = A pointer to an integer allocated by caller into which the
- *           function result is placed. *status is assigned a value of 1
- *           if this file contains the per receive beam imagery time
- *           series data, otherwise *status is assigned a value of 0.
- *
- * Returns :
- *  This function returns zero if successful, or -1 if an error occurred.
- *
- * Error Conditions :
- *  GSF_BAD_FILE_HANDLE
- *  GSF_FILE_SEEK_ERROR
- *  GSF_FLUSH_ERROR
- *  GSF_READ_TO_END_OF_FILE
- *  GSF_READ_ERROR
- *  GSF_RECORD_SIZE_ERROR
- *  GSF_INSUFFICIENT_SIZE
- *  GSF_CHECKSUM_FAILURE
- *  GSF_UNRECOGNIZED_RECORD_ID
- *  GSF_HEADER_RECORD_DECODE_FAILED
- *  GSF_SVP_RECORD_DECODE_FAILED
- *  GSF_PROCESS_PARAM_RECORD_DECODE_FAILED
- *  GSF_SENSOR_PARAM_RECORD_DECODE_FAILED
- *  GSF_COMMENT_RECORD_DECODE_FAILED
- *  GSF_HISTORY_RECORD_DECODE_FAILED
- *  GSF_NAV_ERROR_RECORD_DECODE_FAILED
- *
- ********************************************************************/
-int
-gsfFileContainsMBImagery(int handle, int *status)
-{
-    int             ret;
-    int             i;
-    int             rec_size;
-    int             mb_ping;
-    gsfDataID       id;
-    gsfRecords      rec;
-
-    memset (&id, 0, sizeof(id));
-    memset (&rec, 0, sizeof(rec));
-    mb_ping = 0;
-    *status = 0;
-
-    /* Rewind the file so that the pointer is at the first record. */
-    ret = gsfSeek(handle, GSF_REWIND);
-    if (ret)
-    {
-        gsfError = GSF_FILE_SEEK_ERROR;
-        return (-1);
-    }
-
-    for (i = 0; i < 100; i++)
-    {
-        rec_size = gsfRead(handle, GSF_NEXT_RECORD, &id, &rec, NULL, 0);
-        if (rec_size < 0)
-        {
-            if (gsfError == GSF_READ_TO_END_OF_FILE)
-            {
-                ret = gsfSeek(handle, GSF_REWIND);
-                if (ret)
-                {
-                    gsfError = GSF_FILE_SEEK_ERROR;
-                    return (-1);
-                }
-                return(0);
-            }
-            else
-            {
-                /* gsfError should already be set to indicate the type of failure that occurred */
-                return (-1);
-            }
-        }
-
-        switch (id.recordID)
-        {
-            case (GSF_RECORD_SWATH_BATHYMETRY_PING):
-                if ((rec.mb_ping.brb_inten) && (rec.mb_ping.brb_inten->time_series))
-                {
-                    *status = 1;
-                }
-                mb_ping = 1;
-                break;
-        }
-        if (mb_ping == 1)
-        {
-            break;
-        }
-    }
-
-    /* reset the file pointer to where it was when function was called */
-    /* Rewind the file so that the pointer is at the first record. */
-    ret = gsfSeek(handle, GSF_REWIND);
-    if (ret)
-    {
-        gsfError = GSF_FILE_SEEK_ERROR;
-        return (-1);
-    }
-
-    return (0);
-}
-
diff --git a/src/gsf/gsf_lib.pdf b/src/gsf/gsf_lib.pdf
deleted file mode 100644
index ca7f06a..0000000
Binary files a/src/gsf/gsf_lib.pdf and /dev/null differ
diff --git a/src/gsf/gsf_spec.pdf b/src/gsf/gsf_spec.pdf
deleted file mode 100644
index 28dd224..0000000
Binary files a/src/gsf/gsf_spec.pdf and /dev/null differ
diff --git a/src/html/ChangeLog.txt b/src/html/ChangeLog.txt
deleted file mode 100644
index 9cf06c8..0000000
--- a/src/html/ChangeLog.txt
+++ /dev/null
@@ -1,3746 +0,0 @@
--------------------------------------------------------------------------------
-MB-SYSTEM CHANGELOG FILE:
--------------------------------------------------------------------------------
-Version: $Id: ChangeLog.txt 2252 2015-07-01 19:35:37Z caress $
--------------------------------------------------------------------------------
-
-This file lists changes to the source code of the MB-System open
-source software package for the processing and display of swath sonar data.
-This file is located at the top of the MB-System source code distribution
-directory structure.
-
--------------------------------------------------------------------------------
-MB-SYSTEM VERSION 5 RELEASE DATES:
--------------------------------------------------------------------------------
-Here "*" denotes source distribution release made available for ftp download.
-Releases without an "*" are discrete revisions available from the source code
-archive at http://svn.ilab.ldeo.columbia.edu/listing.php?repname=MB-System.
-
-* Version 5.5.2252       July 1, 2015
-* Version 5.5.2251       June 30, 2015
-  Version 5.5.2250       June 29, 2015
-  Version 5.5.2249       June 26, 2015
-* Version 5.5.2248       May 31, 2015
-  Version 5.5.2247       May 29, 2015
-* Version 5.5.2246       May 27, 2015
-* Version 5.5.2243       May 22, 2015
-* Version 5.5.2242       May 16, 2015
-  Version 5.5.2241       May 12, 2015
-  Version 5.5.2240       May 8, 2015
-  Version 5.5.2239       May 6, 2015
-  Version 5.5.2238       April 14, 2015
-  Version 5.5.2237       March 23, 2015
-  Version 5.5.2234       March 5, 2015
-* Version 5.5.2233       February 23, 2015
-  Version 5.5.2232       February 21, 2015
-  Version 5.5.2231       February 20, 2015
-  Version 5.5.2230       February 18, 2015
-  Version 5.5.2229       February 14, 2015
-  Version 5.5.2228       February 6, 2015
-* Version 5.4.2220       January 22, 2015 (Last GMT4-compatible archive revision, released February 27, 2015)
-  Version 5.4.2219       December 11, 2014
-  Version 5.4.2218       December 4, 2014
-  Version 5.4.2217       December 1, 2014
-* Version 5.4.2213       November 13, 2014
-  Version 5.4.2210       November 10, 2014
-* Version 5.4.2209       November 4, 2014
-* Version 5.4.2208       October 29, 2014
-  Version 5.4.2204       September 5, 2014
-* Version 5.4.2202       August 25, 2014
-  Version 5.4.2201       August 20, 2014
-* Version 5.4.2200       July 24, 2014
-* Version 5.4.2199       July 19, 2014
-  Version 5.4.2196       July 14, 2014
-  Version 5.4.2195       July 9, 2014
-  Version 5.4.2194       July 8, 2014
-* Version 5.4.2191       June 4, 2014
-* Version 5.4.2188       May 31, 2014
-  Version 5.4.2187       May 28, 2014
-  Version 5.4.2186       May 26, 2014
-  Version 5.4.2185       May 11, 2014
-* Version 5.4.2183       April 16, 2014
-  Version 5.4.2182       April 8, 2014
-  Version 5.4.2181       April 4, 2014
-* Version 5.4.2176       March 18, 2014
-* Version 5.4.2168       February 19, 2014
-* Version 5.4.2163       January 31, 2014
-  Version 5.4.2162       January 24, 2014
-* Version 5.4.2159       January 18, 2014
-  Version 5.4.2158       January 18, 2014
-* Version 5.4.2157       October 14, 2013
-  Version 5.4.2155       October 13, 2013
-  Version 5.4.2154       September 26, 2013
-  Version 5.4.2153       September 22, 2013
-* Version 5.4.2152       September 16, 2013
-  Version 5.4.2151       September 12, 2013
-  Version 5.4.2149       September 2, 2013
-  Version 5.4.2148       August 28, 2013
-  Version 5.4.2147       August 27, 2013
-  Version 5.4.2144       August 26, 2013
-  Version 5.4.2143       August 24, 2013
-  Version 5.4.2141       August 24, 2013
-  Version 5.4.2139       August 19, 2013
-  Version 5.4.2138       August 18, 2013
-  Version 5.4.2137       August 9, 2013
-  Version 5.4.2136       August 8, 2013
-* Version 5.4.2135       August 7, 2013
-  Version 5.4.2133       July 29, 2013
-  Version 5.4.2132       July 26, 2013
-  Version 5.4.2130       July 20, 2013
-  Version 5.4.2129       July 8, 2013
-  Version 5.4.2128       June 18, 2013
-  Version 5.4.2123       June 10, 2013
-  Version 5.4.2082       May 24, 2013
-  Version 5.3.2053       April 4, 2013
-  Version 5.3.2051       March 20, 2013
-  Version 5.3.2042       March 12, 2013
-* Version 5.3.2017       March 3, 2013
-* Version 5.3.2013       January 29, 2013
-* Version 5.3.2012       January 25, 2013
-* Version 5.3.2011       January 17, 2013
-  Version 5.3.2010       January 14, 2013
-* Version 5.3.2009       January 10, 2013
-* Version 5.3.2008       January 6, 2013
-  Version 5.3.2007       January 5, 2013
-  Version 5.3.2006       January 4, 2013
-  Version 5.3.2005       December 31, 2012
-  Version 5.3.2004       December 12, 2012
-  Version 5.3.2000       Navember 14, 2012
-  Version 5.3.1999       Navember 13, 2012
-  Version 5.3.1998       Navember 6, 2012
-  Version 5.3.1994       October 27, 2012
-  Version 5.3.1988       September 29, 2012
-  Version 5.3.1986       September 12, 2012
-* Version 5.3.1982       August 15, 2012
-  Version 5.3.1981       August 2, 2012
-* Version 5.3.1980       July 13, 2012
-* Version 5.3.1955       May 16, 2012
-  Version 5.3.1941       March 6, 2012
-* Version 5.3.1917       January 10, 2012
-* Version 5.3.1912       November 19, 2011
-* Version 5.3.1909       November 16, 2011
-* Version 5.3.1907       November 9, 2011
-* Version 5.3.1906       September 28, 2011
-* Version 5.2.1880       December 30, 2010
-  Version 5.1.3beta1875  November 23, 2010
-  Version 5.1.3beta1874  November 7, 2010
-  Version 5.1.3beta1862  June 7, 2010
-  Version 5.1.3beta1858  May 18, 2010
-  Version 5.1.3beta1855  May 4, 2010
-  Version 5.1.3beta1851  April 14, 2010
-  Version 5.1.3beta1844  March 30, 2010
-  Version 5.1.3beta1843  March 29, 2010
-  Version 5.1.3beta1829  February 5, 2010
-* Version 5.1.2          December 31, 2009
-  Version 5.1.2beta15    December 30, 2009
-  Version 5.1.2beta14    December 28, 2009
-  Version 5.1.2beta13    December 28, 2009
-  Version 5.1.2beta12    December 26, 2009
-  Version 5.1.2beta11    Ausust 26, 2009
-  Version 5.1.2beta10    Ausust 12, 2009
-  Version 5.1.2beta09    Ausust 7, 2009
-  Version 5.1.2beta08    Ausust 5, 2009
-  Version 5.1.2beta06    July 2, 2009
-  Version 5.1.2beta05    June 14, 2009
-  Version 5.1.2beta02    March 13, 2009
-  Version 5.1.2beta01    March 9, 2009
-* Version 5.1.1          December 31, 2008
-  Version 5.1.1beta26    November 18, 2008
-  Version 5.1.1beta25    September 28, 2008
-  Version 5.1.1beta23    September 19, 2008
-  Version 5.1.1beta21    July 20, 2008
-  Version 5.1.1beta20    July 10, 2008
-  Version 5.1.1beta19    June 6, 2008
-  Version 5.1.1beta18    May 16, 2008
-  Version 5.1.1beta17    March 21, 2008
-  Version 5.1.1beta16    March 14, 2008
-  Version 5.1.1beta15    February 8, 2008
-  Version 5.1.1beta14    January 15, 2008
-  Version 5.1.1beta13    November 16, 2007
-  Version 5.1.1beta12    November 2, 2007
-  Version 5.1.1beta11    October 17, 2007
-  Version 5.1.1beta10    October 8, 2007
-  Version 5.1.1beta5     July 5, 2007
-* Version 5.1.0          November 26, 2006
-  Version 5.1.0beta4     October 5, 2006
-  Version 5.1.0beta3     September 11, 2006
-  Version 5.1.0beta2     August 9, 2006
-  Version 5.1.0beta      July 5, 2006
-* Version 5.0.9          February 20, 2006
-* Version 5.0.8          February 8, 2006
-  Version 5.0.8beta5     February 3, 2006
-  Version 5.0.8beta4     February 1, 2006
-  Version 5.0.8beta3     February 1, 2006
-  Version 5.0.8beta2     January 27, 2006
-  Version 5.0.8beta      January 24, 2006
-* Version 5.0.7          April 7, 2005
-* Version 5.0.6          February 19, 2005
-* Version 5.0.5          October 6, 2004
-* Version 5.0.4          May 22, 2004
-* Version 5.0.3          February 27, 2004
-* Version 5.0.2          December 24, 2003
-* Version 5.0.1          December 12, 2003
-* Version 5.0.0          December 5, 2003
-  Version 5.0.beta31     April 29, 2003
-  Version 5.0.beta30     April 25, 2003
-  Version 5.0.beta29     March 10, 2003
-  Version 5.0.beta28     January 14, 2003
-  Version 5.0.beta27     November 13, 2002
-  Version 5.0.beta26     November 3, 2002
-  Version 5.0.beta25     October 15, 2002
-  Version 5.0.beta24     October 4, 2002
-  Version 5.0.beta23     September 20, 2002
-  Version 5.0.beta22     August 30, 2002
-  Version 5.0.beta21     July 25, 2002
-  Version 5.0.beta20     July 20, 2002
-  Version 5.0.beta18     May 31, 2002
-  Version 5.0.beta17     May 1, 2002
-  Version 5.0.beta16     April 5, 2002
-  Version 5.0.beta15     March 26, 2002
-  Version 5.0.beta14     February 25, 2002
-  Version 5.0.beta13     February 22, 2002
-  Version 5.0.beta12     January 2, 2002
-  Version 5.0.beta11     December 20, 2001
-  Version 5.0.beta10     November 20, 2001
-  Version 5.0.beta09     November 6, 2001
-  Version 5.0.beta08     October 19, 2001
-  Version 5.0.beta07     August 10, 2001
-  Version 5.0.beta06     July 30, 2001
-  Version 5.0.beta05     July 23, 2001
-  Version 5.0.beta04     July 20, 2001
-  Version 5.0.beta03     July 19, 2001
-  Version 5.0.beta02     June 30, 2001
-  Version 5.0.beta01     June 8, 2001
-  Version 5.0.beta00     April 6, 2001
-
--------------------------------------------------------------------------------
-MB-SYSTEM VERSION 5.5 RELEASE NOTES:
--------------------------------------------------------------------------------
-
------> 5.5.2252 (July 1, 2015)
-
-Mbedit, mbnavedit, mbnavadjust, mbvelocitytool: Fix X11 font initialization
-problem created in the 2251 commit.
-
------> 5.5.2251 (June 30, 2015)
-
-Mblist, mbnavlist, mbctdlist: Changed time outputs so that decimal second
-values will be formatted according to the locale (e.g. decimal delineation by
-commas in Europe).
-
-Mbedit, mbnavedit, mbnavadjust, mbvelocitytool, mbgrdviz, mbeditviz: Set up
-preprocessor defines to allow fonts to be defined using the CFLAGS
-environment variable.
-
------> 5.5.2250 (June 29, 2015)
-
-Mbedit, mbnavedit, mbvelocitytool, mbgrdviz, mbeditviz: Removed call to X11
-function XtSetLanguageProc() in all graphical tools. This call apparently
-causes the program locale to be reset according system defaults, even if the
-program implicitly begins in the standard C locale. If the system locale uses
-"," rather than "." as the decimal point marker (e.g. a normal European locale),
-then a GMT 5 initialization will probably fail on reading fonts, at least on
-many if not all Linux distributions. Thanks to Giancarlo Troni for figuring this
-one out.
-
-General: Added mbio/mb_platform.c to the archive. This source file includes the
-functions to read, write, and use platform, sensor, and sensor offset definitions.
-At this time the mb_platform_*() functions are only used in mb7kpreprocess, but
-they will soon be used in mbprocess and all the preprocess programs.
-
-Mbprocess: changed application of tide corrections so that these corrections are
-applied to the platform depth values rather than the bathymetry values. The result
-is the same, but now the navigation (or trajectory) of the processed files is
-corrected in addition to the bathymetry.
-
------> 5.5.2249 (June 26, 2015)
-
-Format 121 (MBF_GSFGENMB): Kluge added to the GSF format i/o module to handle
-beam angles incorrectly constructed so that angles from vertical are negative
-for port side beams when all aziumuthal angles are uniformaly zero (=starboard).
-
-General: Added platform, sensor, and sensor offset definitions to mb_io.h for
-use in flexibly defining a platform consisting of many sensors with relative
-positional and angular offsets. Also added functions to read and write
-platform files using these definitions. Have not completed the function to perform
-lever arm calculations using this platform definition. Initially these functions
-will be used in mb7kpreprocess, but ultimately these will be used generally
-in MB-System.
-
-Mb7kpreprocess: initial implementation using the new platform file and structure
-definitions.
-
------> 5.5.2248 (May 31, 2015)
-
-Mbgrdviz and mbview: Fixed casts between int and pointer that seem to be
-responsible for mbgrdviz crashes.
-
------> 5.5.2247 (May 29, 2015)
-
-General: Cleaned up missing function prototypes through much of the codebase
-(excepting externally written libraries gsf, sapi, bsio) in an effort to fix
-crashes of mbgrdviz and other programs.
-
------> 5.5.2246 (May 27, 2015)
-
-Mbswath, mbcontour, mbgrdtiff: Updated GMT5 header files in src/gmt to enable
-building on Ubuntu Linux, CentOs Linux, and CygWin while maintaining
-compatibility with GMT 5.1.2.
-
-Mbedit, mbnavedit, mbvelocitytool, mbgrdviz, mbeditviz: Incomplete tweaks to
-font handling to enable use of fonts other than Helvetica, Times, and Courier.
-
------> 5.5.2243 (May 22, 2015)
-
-Rewrote the configure.ac file to fix logic flaws in the configure script.
-
------> 5.5.2242 (May 16, 2015)
-
-Mbswath, mbcontour, mbgrdtiff: Updated files in src/gmt for compatibility with
-GMT 5.1.2.
-
------> 5.5.2241 (May 12, 2015)
-
-Format 59 (MBF_EM710MBA): Fixed flag causing erroneous warning that beam flags
-are not supported for this format (beam flags are supported).
-
-Many source files: further changes to precompiler directives suggested by Joaquim Luis
-in order to enable building under Windows.
-
------> 5.5.2240 (May 8, 2015)
-
-Format 241 (MBF_WASSPENL): Fixed recognition of *.nwsf suffix.
-
-Mbclean: fixed bug in beam position calculation identified by Joaquim Luis.
-
------> 5.5.2239 (May 6, 2015)
-
-Format 241 (MBF_WASSPENL): Now supports WASSP multibeam data conforming to
-the WASSP ICD 2.4. MB-System is storing beam flags in unused bytes in the
-existing CORBATHY data records (specifically the "empty" field in the
-CORBATHY beam data specified in ICD 2.4).
-
-Many source files: changes to precompiler directives suggested by Joaquim Luis
-in order to enable building under Windows.
-
-Mbnavadjust: Modified the inversion to separate the vertical and lateral
-covariance so that lateral offsets do not bleed into the vertical offset
-model.
-
-Mb7kpreprocess: Fixed bug that treated null soundings as good for datasets
-without detection records.
-
-Mbdumpesf: Added capability to output in the edit save file format in addition
-to ASCII text, and to ignore specified types of edit events (e.g. copy an esf
-file while removing all beam null events).
-
-Build system: Fixed bug that caused configure to fail if netCDF has a pkg-config
-installation while GMT5 is in a specified but nonstandard location.
-
------> 5.5.2238 (April 15, 2015)
-
-Mbnavadjust: Recast and improved the inversion. Added a "perturbation" model
-display which does not include the average offsets between the individual surveys
-in projects involving multiple surveys.
-
-Mbcontour, mbswath, mbgrdtiff: Included fixes suggested by Joaquim Luis for
-compatibility with the next GMT5 release.
-
-Mbclean: Removed -M3 and -M4 options that previously caused the program to null
-(or zero) rather than flag bad soundings. This is an obsolete feature that only
-made sense prior to existence of mbprocess.
-
-Mbbackangle: Fixed mbm_grdplot call to no longer use an obsolete option.
-
------> 5.5.2237 (March 23, 2015)
-
-Mbnavadjust, mbnavedit: Removed references to GMT and netCDF in the Makefile.am
-file in both source directories.
-
------> 5.5.2236 (March 23, 2015)
-
-Mbnavadjust, mbnavadjustmerge: Added a new type of constraint referred to as a
-global tie. Each data section can have one of its navigation points tied to
-the fixed global frame of reference with a specified x, y, z offset (or just x
-and y, or just z) and x, y, and z uncertainties in the offset values. These
-global ties are set using mbnavadjustmerge. The relevant mbnavadjustmerge
-commands are:
-    --set-global-tie=file:section[:snav]/xoffset/yoffset/zoffset[/xsigma/ysigma/zsigma]
-    --set-global-tie-xyz=file:section[:snav]
-    --set-global-tie-xyonly=file:section[:snav]
-    --set-global-tie-zonly=file:section[:snav]
-
-Mbnavadjustmerge: Added ability to unset (delete) global ties and crossing ties.
-The relevant mbnavadjustmerge commands are:
-    --unset-global-tie=file:section
-    --unset-tie=file1:section1/file2:section2
-
-Mbnavadjust, mbnavadjustmerge: Explicitly added references to libgmt and libpsl in
-the src/mbnavadjust/Makefile.am file so that the mbnavadjust and mbnavadjustmerge
-executables are linked to those libraries. This is to solve a mysterious dependency
-of mbnavadjust on libgmt on CentOs6 - the program was failing due inability to find
-libgmt.so.5 even though the code does not reference any GMT or GMT5 function or header
-file. Presumably this change will go away when the mystery is solved.
-
-Mbsslayout: fixed automatically generated plottin script.
-
-Mbm_route2mission: Added multibeam maximum range value.
-
------> 5.5.2234 (March 5, 2015)
-
-Plot macros (mbm_grdplot, mbm_grd3dplot, mbm_grdtiff, mbm_histplot, mbm_plot,
-mbm_xyplot): Now generate plotting scripts that will not attempt to display the
-plot on the screen if invoked with a "-N" command line argument.
-
-Format 64 (MBF_MR1PRVR2): Added include of <sys/time.h> in mbbs_defines.h to
-facilitate building under cygwin.
-
-Multi-macros (mbm_multiprocess, mbm_multicopy, mbm_multidatalist): Changed to
-use datalist.mb-1 as default input and to use 4 as the default number of CPUs.
-
-Mbedit: Added fast scroll through a file if the forward or back mouse buttons
-are held down more than 2 seconds.
-
-Mbextractsegy, mbsslayout: Changed output section/line plotting script so that
-it will not attempt to display the plot on the screen if invoked with a "-N"
-command line argument.
-
-Mbprocess: Reduced informational output when not in verbose mode to make the
-output from use of mbm_multiprocess cleaner.
-
------> 5.5.2233 (February 23, 2015)
-
-Release 5.5.2233
-
-Mbm_grdplot, mbm_grdtiff: Generated plot scripts now set foregound and background
-colors based on the -D option.
-
-Mbmroute2mission: Now allows the maximum planned climb rate of the AUV to be
-specified with the -U option
-
------> 5.5.2232 (February 21, 2015)
-
-Mbm_plot, mbm_grdplot, mbm_grd3dplot, mbhistplot: Changed handling of gmt defaults
-so that any local gmt.conf file is deleted before any gmtset calls are made, and
-the resulting gmt.conf file is deleted before the plot script ends.
-
-Mbswath: fixed calculation of beam or pixel footprints in mode requesting real
-footprint plotting.
-
------> 5.5.2231 (February 20, 2015)
-
-Mb7kpreprocess: Switched beam angle calculation to the mb_beaudoin() function
-already used by mbkongsbergpreprocess (contributed by Jonathan Beaudoin).
-
-Mbm_bpr: Made compatible with GMT5.
-
------> 5.5.2230 (February 18, 2015)
-
-Mbgrdtiff: Fixed ordering of rows and columns in the output image.
-
-Mbm_route2mission: Added output of a mission alititude profile plot.
-
-Mbauvloglist: Added capability of binary output.
-
-Mb7kpreprocess: Fixed so that bathymetry calculation uses roll merged at
-the bottom detect time for all of the possible combinations of Reson 7k
-data record types.
-
-Mbpreprocess: Fixed to exclude zero longitude or lattitude values from the
-tables used for interpolation onto ping times.
-
-Mbrolltimelag: Fixed automatically generated roll-slope correlation plot.
-
------> 5.5.2229 (February 14, 2015)
-
-Format 121 (MBF_GSFGENMB): The i/o module will now allocate and initialize arrays
-of beamflags and alongtrack distance when those are not included in the input file.
-
-Mbfilter: removed failing check for existance of sidescan data.
-
-Mbsegygrid: flipped grid convention for compatibility with GMT5.
-
-Mbm_plot, mbm_grdplot, mbm_grd3dplot, mbm_histplot: further changes for compatibility
-with GMT5.
-
-Mbm_route2mission: Compatibility with GMT5.
-
-Mbcontour, mbswath: More changes for compatibility with GMT5.
-
------> 5.5.2228 (February 6, 2015)
-
-Install_makefiles: the old install_makefiles build system no longer 
-functions and has been removed.
-
-Mbgrid: When using the two-step weighted footprint slope algorithm, mbgrid
-only reads files on the second pass through the input datalist that contained
-useful data in the first pass.
-
-Major changes made to integrate MB-System with GMT5:
-  The code will no longer compile or work with GMT4.5.
-  Changes include:
-    -updating functions in libmbaux  that read and write GMT grids
-    -deletion of src/mbaux/mb_pslibface.c
-    -changes to all programs that read or write GMT grids,
-    -the former programs mbcontour, mbswath, and mbgrdtiff are now GMT5
-      modules built as part of a shared library.
-    -changes to all of the plot macros (e.g. mbm_grdplot) that make use of GMT
-
-Format 88 (MBF_RESON7KR): Update Reson 7k i/o module to handle TVG records.
-
--------------------------------------------------------------------------------
-MB-SYSTEM VERSION 5.4 RELEASE NOTES:
--------------------------------------------------------------------------------
-
------> 5.4.2219 (December 11, 2014)
-
-Mbnavadjust: Fixed fixed memory management issue related to fbt files.
-
-Mb7kpreprocess: Moved toward correct handling of sensor offsets.
-
-Mbpreprocess: Moved toward correct handling of sensor offsets.
-
------> 5.4.2218 (December 4, 2014)
-
-Mbinfo: Fixed JSON format output to file (previously missed final closing bracket).
-
-
------> 5.4.2217 (December 1, 2014)
-
-Mbclean: Implemented additional flagging tests contributed by Suzanne O'Hara,
-including speed range (-Pspeed_min/speed_max), ping navigation bounds
-(-Rwest/east/south/north), and zero longitude and latitude values (-Z).
-Also, a minimum depth at nadir test embedded by Dana Yoerger for all data
-(circa 2010) has been recast into a minimum range test option (-Krange_min). 
-
-Format 71 (MBF_MBLDEOIH) and fbt files: fixed a problem with the i/o module
-as updated in 5.4.2216.
-
------> 5.4.2216 (November 30, 2014)
-
-Format 251 (MBF_PHOTGRAM): We have added a new data format and associated data
-system supporting photogrammetric topography calculated from stereo pair
-photographs. This format includes navigation and attitude data. Each 2D group
-of bathymetry values is derived with a single stereo pair. A file consists of a
-sequence of stereo pair bathymetry, each set of which has a timestamp, navigation
-and attitude as well as bathymetry values. The format 251 files are generated
-from stereo pairs (and navigation and attitude data) by a set of tools that
-are not currently in MB-System, but which will be added to MB-System in the
-future. 
-
-Mbeditviz and Mbgrdviz: Now allow selection of a single navigation point.
-
-Mbeditviz and mbgrid: Now handle point topography data (e.g. xyz soundings, lidar
-soundings, photogrammetry topography) differently than multibeam soundings even
-when the footprint algorithm is specified. Point data are now treated as such,
-and no longer are associated with nonsensical beam footprints.
-
-Format 71 (MBF_MBLDEOIH) and fbt files: We have defined a new data record header (version 5)
-that represents the number of bathymetry beams, amplitude beams, and sidescan
-pixels as four-byte int values rather than two-byte short values. This supports
-data constructs that have more than 32768 bathymetry values, as can be the case
-for dense photogrammetry data derived from stereo-pair photography. The i/o module
-only uses the version 5 header when there are more than 32768 bathymetry values
-in the associated sonar ping, lidar scan, or photographic stereo pair. Otherwise,
-the previously existing version 4 header is used. Consequently, for all previously
-supported data types there will be no change to the MBF_MBLDEOIH format or to
-fbt files.
-
-General: MB-System now defines several types of bathymetry data:
-      MB_TOPOGRAPHY_TYPE_UNKNOWN		0
-      MB_TOPOGRAPHY_TYPE_ECHOSOUNDER	        1
-      MB_TOPOGRAPHY_TYPE_MULTIBEAM		2
-      MB_TOPOGRAPHY_TYPE_SIDESCAN		3
-      MB_TOPOGRAPHY_TYPE_INTERFEROMETRIC	4
-      MB_TOPOGRAPHY_TYPE_LIDAR      	        5
-      MB_TOPOGRAPHY_TYPE_CAMERA     	        6
-      MB_TOPOGRAPHY_TYPE_GRID     	        7
-      MB_TOPOGRAPHY_TYPE_POINT       	        8
-The immediate utility of differentiating between data types is to
-allow gridding algorithms to handle data appropriately. As discussed
-above, the footprint gridding algorithms are now only applied by
-mbgrid or mbeditviz to multibeam bathymetry. Other differences in
-data processing will be added in the future.
-
-General: The sort function and related comparison function declarations
-in MB-System have been corrected to be consistent with qsort() from stdlib.
-
------> 5.4.2213 (November 13, 2014)
-
-Mbkongsbergpreprocess: Added -E option to allow specification of offsets between
-the depth sensor and the sonar. This is relevant only to submerged platforms
-such as AUVs or ROVs. Also added -P option to enable filtering of pressure
-depth data.
-
-Format 59 (MBF_EM710MBA): Set the navigation and attitude source records to be
-survey data so that mbnavedit and mbnavlist work by default with values from the 
-survey records rather than asynchronous raw sensor data. The navigation and attitude
-sources for format 58 (MBF_EM710RAW) remain the asynchronous records.
-
-Mbnavedit: Strictly define the font definitions for pushbutton widgets
-(some X11 environments are making bad choices when given latitude).
-
------> 5.4.2210 (November 10, 2014)
-
-Mbkongsbergpreprocess: Changed handling of water column records. The default
-behavior is now to not write water column records to the output format 59 files.
-Users can specify -W1 to have the water column records written in the output files.
-
-Format 41 (MBF_SB2100RW): Bug fix for Seabeam format 41 so the code handles
-records without the maximum number of beams. Contributed by Bob Covill.
-
-Mbprocess: Added ability to apply static bathymetry corrections defined according
-to beam angle in addition to corrections according to beam number. Contributed
-by Bob Covill.
-
-Mbvelocitytool: When loading a swath file, mbvelocitytool will now also read in
-and apply an associated *.esf (edit save file) if it exists. This prevents
-soundings that have been identified as bad from biasing the calculations.
-Contributed by Bob Covill.
-
-Mbm_grdcut: Fix to the manual page. Contributed by Jenny Paduan.
-
------> 5.4.2209 (November 4, 2014)
-
-MBnavadjustmerge:  Completed the manual page for this new program that allows
-one to merge and manipulate MBnavadjust projects.
-
-Formats 58 (MBF_EM710RAW) and 59 (MBF_EM710MBA): Recast the i/o architecture to
-handle the full variablity of multibeam data in these formats.
-
------> 5.4.2208 (October 29, 2014)
-
-Mbkongsbergpreprocess:  Fixed calculation of beam
-takeoff angles for raytracing from the raw range and angle data records by
-including code made available by Jonathan Beaudoin. Recalculation of
-bathymetry in current generation Kongsberg multibeam data appears to work
-now.
-
-Formats 58 (MBF_EM710RAW) and 59 (MBF_EM710MBA): Support Mesotech M3
-multibeam data recorded in *.all files.
-
-Formats 58 (MBF_EM710RAW) and 59 (MBF_EM710MBA): Fixed calculation of beam
-takeoff angles for raytracing from the raw range and angle data records by
-including code made available by Jonathan Beaudoin. Recalculation of
-bathymetry in current generation Kongsberg multibeam data appears to work
-now.
-
------> 5.4.2204 (September 5, 2014)
-
-Mb7kpreprocess:  Changed handling of roll, pitch, and heave compensation
-to deal with deep water Reson 7150 data.
-
-Format 88 (MBF_RESON7KR): Changed handling of roll, pitch, and heave compensation
-to deal with deep water Reson 7150 data.
-
-Mbdefaults: Added control of default color and shading settings for mbgrdviz and
-mbeditviz.
-
-Format 231 (MBF_3DDEPTHP): Fixed the mbsys_3datdepthlidar_insert_nav() function
-to apply changes to all pulses.
-
-Mbgrdviz and Mbeditviz: Default color and shading settings now can be set using
-mbdefaults.
-
------> 5.4.2202 (August 25, 2014)
-
-Format 88 (MBF_RESON7KR): Enlarged the maximum number of beams to 1024 in order
-to handle 7150 data with >800 beams.
-
-Format 21 (MBF_HSATLRAW): Augmented to trim trailing blank space at the end of
-lines before parsing - this allows reading Hydrosweep DS data in the form
-held by NIO.
-
------> 5.4.2201 (August 20, 2014)
-
-Mbm_grdplot: Added two "sealevel" color palletes that use Haxby colors for
-negative values (e.g. topography below sea level) and either greens or browns
-for positive values (e.g. topography above sea level). The Sealevel 2 pallette
-was contributed by Jenny Paduan.
-
-Mbeditviz: Changed default illumination parameters to magnitude=1.0 and
-elevation=5.0.
-
-Mbgrdviz: Changed default illumination parameters to magnitude=1.0 and
-elevation=5.0.
-
-Mbnavadjust: Added views for 10% coverage crossings.
-
-Mb7kpreprocess: Added kluge function to "tweak" the beam angles as if the speed of
-sound used for beamforming had been wrong.
-
------> 5.4.2200 (July 24, 2014)
-
-Format 121 (MBF_GSFGENMB): Fixed bug in which null sensor depth and altitude
-values are handled incorrectly.
-
------> 5.4.2199 (July 20, 2014)
-
-Format 121 (MBF_GSFGENMB): Modified GSF 3.06 source files gsf.c gsf_indx.c to
-disable recasting of fundamental file io functions (fopen(), fseek(), ftell(),
-stat()) when the compile flag -DUSE_DEFAULT_FILE_FUNCTIONS is defined. This
-allows MB-System builds to just use the normal file functions without changing
-the build behavior of the code in other contexts. The issue is that Leidos is
-supporting 64-bit file i/o in binaries for 32-bit architectures. The consequence
-of this change in MB-System is that MB-System will not support GSF files that
-are 2 GB or larger when built on or for 32-bit systems.
-
-mbpreprocess: Fixed bug in merging of asynchronous attitude data. This program
-is not ready for general use.
-
------> 5.4.2196 (July 14, 2014)
-
-mbotps: Added -P option to specify the location of the OTPS package.
-
-mbsslayout: Made to work (again) with Reson 7k data with embedded Edgetech
-sidescan and subbottom data.
-
-mb7kpreprocess: Made to work (again) with Reson 7k data with embedded Edgetech
-sidescan and subbottom data.
-
-mbextractsegy: Made to work (again) with Reson 7k data with embedded Edgetech
-sidescan and subbottom data.
-
------> 5.4.2195 (July 9, 2014)
-
-Format 88 (MBF_RESON7KR): Fixed bug in mbsys_reson7k_extract_altitude().
-
-Format 132 (MBF_EDGJSTAR): Added mbsys_jstar_insert_altitude() to support
-mbpreprocess and mbsslayout. Fixed handling of heading on extract and insert.
-
-mbm_route2mission: Removed confusing juxtaposition of estimated AUV mission time
-with actual AUV mission termination time in the output AUV mission script.
-
-mbpreprocess: Added ability to merge altitude data. Tested successfully with
-raw Edgetech sidescan data collected without embedded navigation, attitude,
-or anything really.
-
-mbsslayout: A new program to lay out raw sidescan onto the seafloor, most
-often on a 3D seafloor topographic model. Achieved functionality, at least 
-for use with Edgetech sidescan data in Jstar format.
-
------> 5.4.2194 (July 8, 2014)
-
-Format 121 (MBF_GSFGENMB): Updated source files in src/gsf/ to GSF release 3.06.
-
-Format 121 (MBF_GSFGENMB): Fixed scaling of array values in GSF files to allow
-depth and distance resolutions better than 1 cm.
-
-Formats 58 (MBF_EM710RAW) and 59 (MBF_EM710MBA) to support EM2040D data, in which
-dual sonars ping simulatneously.
-
------> 5.4.2191 (June 4, 2014)
-
-Install_makefiles: Fixed old build system so that it successfully compiles and
-links the new, unfinished program mbsslayout.
-
------> 5.4.2189 (June 4, 2014)
-
-Format 121 (MBF_GSFGENMB): Fixed bug that caused programs reading GSF data to hang
-when the GSF file ends with a partial or corrupted data record.
-
-MBeditviz: Added capability to set the color of selected soundings (e.g. soundings
-associated with a particular file or particular section of trackline).
-
-Format 88 (MBF_RESON7KR): Added support for pitch stabilization.
-
-MB7kpreprocess: Added support for pitch stabilization in Reson 7k data.
-
------> 5.4.2188 (May 31, 2014)
-
-Format 121 (MBF_GSFGENMB): Fixed bug that caused crashes when the GSF file
-contains a zero length comment.
-
-Format 64 (MBF_MR1PRVR2): Fixed bug that caused crashes when copying data from
-MR1 file to an fbt file when comments are longer than supported in fbt files.
-
-MBnavadjust: Fixed bug that reset the selected survey while doing autopicks.
-
------> 5.4.2187 (May 28, 2014)
-
-Format 201 (MBF_HYSWEEP1): Added code to ignore bad RMB records found in some
-NOAA HSX data.
-
-Format 88 (MBF_RESON7KR): Support for calibrated snippet records (contributed
-by David Finlayson).
-
-MB7kpreprocess: Support for calibrated snippet records (contributed
-by David Finlayson).
-
-MBnavadjustmerge: Fixed to handle projects not in the current working directory.
-
------> 5.4.2186 (May 26, 2014)
-
-MBeditviz: Fixed interactive application of pitch bias and heading bias changes.
-
-MBnavadjustmerge: New program to merge two existing MBnavadjust projects.
-
------> 5.4.2185 (May 17, 2014)
-
-MBrolltimelag: Now checks for case when all beams are flagged.
-
-MBlist: Added beamflag values to those that can be printed ('F' or 'f').
-
-Bathymetry editing: Fixed bug that prevented successful flagging of some beams
-when files include simultaneous pings with different numbers of beams.
-
-GSF library: Updated to new release 03.05. This release is licensed using LGPL 2.1.
-
------> 5.4.2185 (May 11, 2014)
-
-Several programs: Fixed formating error in printing system time_tm.tv_sec values.
-
-MBsvpselect: Fixed sscanf format warning.
-
-MBcopy: Fixed array dimensioning bug that occasionally caused buffer overflows.
-
-MBnavadjust: Moved some declarations from mbnavadjust_prog.c to mbnavadjust.h in
-preparation for breaking project i/o out into a separate source file to be shared
-with the new program mbnavadjustmerge.
-
-MBsslayout: Added shell of program under development to read sidescan in raw time
-series form, lay the sidescan out regularly sampled on a specified topography
-model, and output the sidescan to format 71 (MBF_MBLDEOIH) files.
-
-HSDS formats (MBF_HSATLRAW, MBF_HSLDEDMB, MBF_HSURIVAX, MBF_HSURICEN): Fixed bug
-in handling of system gain arrays (16 rather than 59 values).
-
-MBsegygrid: Attempted to incorporate actual nonvertical geometry into the
-subbottom sections - not satisfactory yet.
-
-MBrolltimelag: Fixed bug regarding the default roll source. The program will
-now work with roll values derived from survey records by default.
-
-Format 88 (MBF_RESON7KR): Cleaned up some debug print statements.
-
-MBinsreprocess: Incomplete new MB6 program to reprocess INS data of various sorts
-to improve on realtime Kalman filtered navigation and attitude data.
-
-MBsslayout: Incomplete new MB6 program to perform layout of time series sidescan
-onto a 3D topography model. This will replace mb7k2ss and extend the functionality
-to conventional sidescan data in several data formats.
-
-Mbm_route2mission: Fixed output AUV mission script to have "\r\n" line ends on
-all lines.
-
-Format 222 (MBF_SWPLSSXP): Revised implementation of SEA SwathPlus SXP data format
-(format id 222) contributed by David Finlayson.
-
-Format 121 (MBF_GSFGENMB): Changed the source for the internally supplied GSF
-library to be the new 3.05 release. This includes for the first time a proper
-open source license (LGPL 2.1).
-
------> 5.4.2184 (April 22, 2014)
-
-
-src/bsio/Makefile.in: Added to archive (previously mistakenly left out).
-
------> 5.4.2183 (April 16, 2014)
-
-Many programs: Fixed handling of system time character string provided by
-function ctime() to prevent occasional overflows.
-
-Format 222 (MBF_SWPLSSXP): Revised implementation of SEA SwathPlus SXP data format
-(format id 222) contributed by David Finlayson.
-
-MBswplspreprocess: Preprocess program for SEA SwathPlus SXP data format
-(format id 222) contributed by David Finlayson. This was formerly known as
-mbsxppreprocess.
-
------> 5.4.2182 (April 8, 2014)
-
-Format 231 (MBF_3DDEPTHP): Added new raw Lidar record to be used by 3DatDepth.
-
-Format 201 (): Corrected bug in handling of navigation in projected coordinate
-systems.
-
-mbio/mb_navint.c and mbio/mb_define.h: Added a new function mb_navint_prjinterp()
-that interpolates navigation and speed from internal runnings lists assuming the
-navigation is in eastings and northings rather than longitude and latitude.
-
------> 5.4.2181 (April 4, 2014)
-
-Release 5.4.2181
-
-htmlsrc/mbsystem_home.html & htmlsrc/mbsystem_faq.html: Actually committed
-pictures of Christian Ferreira and Krystle Anderson to the archive
-
------> 5.4.2180 (April 2, 2014)
-
-htmlsrc/mbsystem_home.html & htmlsrc/mbsystem_faq.html: Updated references
-to the MB-System team in the html documentation to include Christian Ferreira
-and Krystle Anderson.
-
-htmlsrc/mbsystem_how_to_get.html: Updated installation instructions
-in the html documentation.
-
-MB7kpreprocess: recoded the application of time domain filtering of pressure
-depth data to be much more efficient.
-
-Format 132 (MBF_EDGJSTAR): Supported obsolete sidescan records with 80 byte
-traceheaders.
-
-MBextractsegy: Now works with Edgetech Jstar files.
-
-MBauvloglist: reset default printing of timestamp values.
-
-Mbset: modified so that when mbset is used to turn off a mode that implies
-use of an external file, the associated filename is also erased. For example
-    mbset -PSVPMODE:0
-will now also erase (null) the filename set by -PSVPFILE.
-
-Mbm_grd3dplot, mbm_grdplot, mbm_histplot, mbm_plot, mbm_xyplot: added support
-for the evince postscript viewer.
-
-Format 172 (MBF_HIR2RNAV) and format 173 (MBF_MGD77TXT): fixed segmentation
-faults while handling comment records.
-
-MBlist: The 'N' output option will now use actual ping numbers if those are
-available (instead of ping count in the file).
-
-MBroutetime: Now exits with error message if no start line or end line waypoints
-are read from the input route file.
-
------> 5.4.2176 (March 18, 2014)
-
-Release 5.4.2176
-
------> 5.4.2175 (March 18, 2014)
-
-Configure.ac: Removed reference to src/mbsvptool (src/mbsvptool/mbsvptool.c
-was moved to src/utilities/mbsvpselect.c for 5.4.2173).
-
-MBnavadjust: The program generates route files of crossings and ties that
-can be viewed in mbgrdviz. The coloring of the crossings and ties when
-displayed in mbgrdviz has changed. The route files generated are:
-    True Crossings (unfixed)
-    >50% Crossings (unfixed)
-    >25% && <50% Crossings (unfixed)
-    <25% Crossings (unfixed)
-    Ties (unfixed)
-    Ties (fixed)
-For the crossing files, individual crossings are colored as:
-    Unset - Red
-    Skipped - Yellow
-    Set - Green
-For the tie files, individual ties are colored as:
-    Ties (unfixed) - Blue-Green
-    Ties (fixed) - Purple
-
-All source files: Updated copyright notices to 2014.
-
------> 5.4.2173 (March 17, 2014)
-
-MBsvpselect: Added program contributed by Ammar Aljuhne and Christian Ferreira
-of MARUM (University of Bremen). This program chooses and implements the best
-available sound speed model for each swath file in a survey. The user  provides
-a  list of the available sound speed models and specifies the criteria used for
-model selection. The program uses mbset to turn on bathymetry recalculation by
-raytracing through the sound speed model selected for each swath file.
-
-MBsvplist: The SVP files output by mbsvplist now include a header line that
-is recognized by mbsvpselect. This header line includes the time stamp and
-position associated with the SVP record's location in the swath file.
-
-MBpreprocess: Added an incomplete manual page for this incomplete MB-System 6
-program.
-
------> 5.4.2172 (March 14, 2014)
-
-MBmosaic: Added option to apply priorities based on the platform heading.
-
-Format 64 (MBF_MR1PRVR2): Hawaii Mapping Research Group (HMRG) data format
-updated to use the current library and thereby support post-2005 data.
-Removed old HMRG mr1pr library from mbsystem/src and added current bsio
-library.
-
-MBgrdviz: Modified handling of routes so that if a route header contains a line
-like:
-      ## ROUTEEDITMODE:0
-then the route cannot be changed in MBgrdviz.
-
-MBnavadjust: Changed so that when a project is output, mbnavadjust writes out
-five different route files in which each tie point or crossing is a two point route
-consisting of the connected snav points
-- route files of ties (fixed and unfixed separate) represent each tie as a
-two point route consisting of the connected snav points
-- route files of crossings (<25%, >= 25% && < 50%, >= 50%, true crossings)
-represent each crossing as a two point route consisting of the central
-snav points for each of the two sections.
-
-Mbvelocitytool: made all filename and command strings type mb_path, which is
-a 1024 byte char array.
-
-Format 173 (MBF_MGD77TXT): Added format to read and write MGD77 format
-underway geophysical data files with "\r\n" characters at the ends of the
-data records.
-
-Format 174 (MBF_MGD77TAB): Added format to read and write MGD77T format
-underway geophysical data files with tab delimiters and "\r\n" characters
-at the ends of the data records.
-
------> 5.4.2168 (February 19, 2014)
-
-Mbinfo: Fixed bug in variance calculation (memory overwrites of the relevant arrays).
-
------> 5.4.2165 (February 18, 2014)
-
-Format 241 (MBF_WASSPENL): Made format suffix ".000" recognizable as format 241.
-
-
------> 5.4.2164 (February 15, 2014)
-
-Format 241 (MBF_WASSPENL): added new format for WASSP multibeam sonar.
-
-Format 151 (MBF_OMGHDCSJ): applied patch supplied by Bob Covill.
-
-Mbrolltimelag: fixed so that the program works with data formats for which the
-roll source is the survey records.
-
-Mbauvloglist: added capability to merge navigation from external files.
-
------> 5.4.2163 (January 31, 2014)
-
-Format 71 (MBF_MBLDEOIH): fixed a recently introduced error in scaling of
-bathymetry values. This error impacts the fbt files, and consequently will
-mess up bathymetry gridding and plotting. It's important to update installations
-to 5.4.2163.
-
-MBextractsegy: Fixed so correct navigation is inserted in both the source and
-group position fields in the segy traceheader.
-
------> 5.4.2162 (January 24, 2014)
-
-Format 88 (MBF_RESON7KR): fixed crash when generating sidescan from pings with no valid beams.
-
-Format 201 (MBF_HYSWEEP1): fixed crash when generating sidescan from pings with no valid beams.
-
-Build system: Altered so the configure script works with standard options.
-
------> 5.4.2161 (January 21, 2014)
-
-MBedit: fixed use of beamflag setting macros that were messed up yesterday.
-
------> 5.4.2160 (January 20, 2014)
-
-General: fixed many compiler warnings.
-
-General: implemented changes suggested by Joaquim Luis in order to enable
-building MB-System on Windows systems.
-
------> 5.4.2159 (January 18, 2014)
-
-Release 5.4.2159.
-
------> 5.4.2158 (January 18, 2014)
-
-Many changes, including:
-  - Support for new format of lidar data
-  - Fixes to support swath data with sub-cm lateral resolution
-  - Fix so that mbnavadjust works when built with shared libraries.
-    - this involved changes to the contouring code in the mbaux library.
-  - Augmentation of the AUV mission planning capability
-  - Improvement to mbm_grdplot output for maps of small areas
-  - Fixes to the configure build system
-    - now allows MB-System to be built using an externally installed
-      libproj or the proj library bundled with MB-System
-    - using --disable-gsf now works properly to build without any use of
-      or entanglement with libgsf.
-        
------> 5.4.2157 (October 14, 2013)
-
-Mbm_makesvp: New macro to extract sound speed and depth data from a datalist of
-swath files, and generate a sound velocity profile model from averages of the
-sound speed values in regular depth ranges. This macro uses mbctdlist to extract
-the sound speed values embedded in swath data files is intended for use with
-mapping data from submerged platforms (e.g. ROVs and AUVs) carrying CTD or
-sound speed sensors. 
-
------> 5.4.2155 (October 13, 2013)
-
-MBvelocitytool: Fixed problems with bad calculations after loading more than
-one swath data.
-
-MBgrdtiff, mbm_grdtiff: Added capability to output a *.tfw "world" file parallel
-to the GeoTiff image. Some software does not recognize the coordinate system
-information embedded in the GeoTiff file.
-
-MBsegygrid: Added capability for simple time domain low-pass filtering.
-
-MBrphsbias: Added incomplete new program that will, when complete, use a brute
-force multidimensional search obtain optimized estimates for bias parameters
-from a specified dataset. There is no documentation yet as the program currently
-does nothing but compile and read data.
-
------> 5.4.2154 (September 26, 2013)
-
-MBkongsbergpreprocess, MB7kpreprocess, MBhysweeppreprocess, mbprocess:
-Fixed errors in navigation interpolation introduced in 5.4.2152.
-
-Format 84 (MBF_XTFR8101): Fixed initialization of the storage data structure.
-
-Committed from CCGS Sir Wilfrid Laurier at 116d 04.4876' W, 68d 57.30' N.
-
------> 5.4.2153 (September 22, 2013)
-
-Format 201 (Hysweep HSX): fixed sign error in handling of pitch values.
-
------> 5.4.2152 (September 16, 2013)
-
-Formats 58 (Kongsberg raw), 59 (Kongsberg extended), 88 (Reson 7k):
-Fixed problem with interpolation of heading for Kongsberg and Reson data.
-Eliminated possibility of negative headings being inserted into the storage
-data structure.
-
-Format 222: Inserted initial implementation of SEA SwathPlus sxp data format
-(format id 222) contributed by David Finlayson with minor changes. This format
-support is still developmental.
-
-Build system: Applied patch contributed by Frank Delahoyde with additional fixes
-to configure.ac and the src/*/Makefile.am files.
-
------> 5.4.2151 (September 12, 2013)
-
-Many *.c files: hundreds of small changes to eliminate compiler warning messages
-on various types of systems.
-
-Build system: Changes to configure.ac, autogen.sh, and src/*/Makefile.am files
-based on suggestions from Frank Delahoyde of SIO and Kurt Schwehr of Google.
-
------> 5.4.2149 (September 2, 2013)
-
-Src directories src/mbio and src/utilities: Fixed a number of debug print
-statements that treated pointer values as %ul rather than %p.
-
------> 5.4.2148 (August 28, 2013)
-
-Buildsystem: More tweaking of configure.ac file, including making the comments
-output more sensible.
-
------> 5.4.2147 (August 27, 2013)
-
-Buildsystem: More tweaking of configure.in file trying to get MB-System to build
-on Ubuntu 12.04.02LTS. Moved configure.in to configure.ac to conform to current
-autoconf file naming conventions.
-
------> 5.4.2144 (August 26, 2013)
-
-Buildsystem: Added src/mbgrdviz/Makefile.in and src/mbeditviz/Makefile.in to the
-subversion source archive.
-
-Format 201 (Hysweep HSX): Changed mbr_rt_hysweep1() in mbr_hysweep1.c so that
-survey records without navigation and/or attitude data do not have an error
-set. This means that data missing nav and/or attitude will still be
-processable.
-
-Format 121 (GSF): Now recognizes and appropriately treats null values for
-position, attitude, speed, and sonar depth.
-
------> 5.4.2143 (August 24, 2013)
-
-MBsxppreprocess: Added nonfunctional stub for program mbsxppreprocess to be
-developed by David Finlayson.
-
------> 5.4.2141 (August 24, 2013)
-
-Build system, MBgrdviz, MBeditviz, MBview: Moved source files for MBgrdviz
-and MBeditviz from src/mbview to src/mbgrdviz and src/mbeditviz, respectively.
-This move separates the application source files for MBgrdviz and MBeditviz
-from the source files of the mbview library.
-
------> 5.4.2139 (August 19, 2013)
-
-Build system: Further modification to the src/mbview/Makefile.am file.
-
------> 5.4.2138 (August 18, 2013)
-
-Build system: Further modifications to the Makefile.am files.
-
-MBopts: Now allows users to specify the tide model used by OTPS. Also now works
-with all three variants of the OTPS package.
-
-MBareaclean: Fixed memory allocations problems.
-
-MBgrdviz: Added capability to launch mbnavedit and mbvelocitytool on selected
-swath data (contributed by Christian Ferreira).
-
------> 5.4.2137 (August 9, 2013)
-
-Build system: Still attempting to fix problems with the autoconf build system on
-Ubuntu machines. Change mbsystem/src/opts/Makefile.am so that building this
-utility does not depend on GMT libraries (since it doesn't).
-
------> 5.4.2136 (August 8, 2013)
-
-Build system: Attempted to fix problems with the autoconf build system on
-Ubuntu machines. Reset the automake version to 2.65 from 2.69 as specified
-in the mbsystem/configure.in file. Also added a conditional reference to
-libmbgsf to the requirements for mbcopy in mbsystem/src/utilities/Makefile.am.
-
------> 5.4.2135 (August 7, 2013)
-
-Mbdatalist: Fixed generation of old-format fbt files.
-
-Web page documentation: Updated basic web pages included in the distribution.
-
------> 5.4.2134 (July 31, 2013)
-
-Heading and nav interpolation (src/mbaux/mb_spline.c): Fixed function
-mb_linear_interp_degrees() so that negative latitude values are allowed.
-
-Mbkongsbergpreprocess: Added checking so that interpolated heading and
-navigation are in the correct domains.
-
------> 5.4.2133 (July 29, 2013)
-
-Heading and nav interpolation (src/mbaux/mb_spline.c): Modified function
-mb_linear_interp_degrees() so that return values must be in the range
-  0.0 <= value < 360.0
-to fix bad heading values near due north.
-
-Mbclean: added -Ttolerance option which will recast the timestamps of edit
-events read from edit save files to match the pingtimes, where the tolerance
-value in seconds defines how close the timestamps must be to be considered the
-same. This is used to override timestamp differences greater than 0.0011 seconds
-that can arise when edits are extracted from one set of files (perhaps processed
-using software other than MB-System) using mbgetesf and then applied to a
-different set of files (presumably as part of MB-System processing).
-
------> 5.4.2132 (July 26, 2013)
-
-Format 88 (Reson s7k): Fixed layout of snippet backscatter into sidescan in the
-near-nadir region.
-
-Format 88 (Reson s7k): Mbprocess now routinely recreates multibeam sidescan
-during processing. This allows backscatter from beams flagged as bad to be
-excluded from the multibeam sidescan.
-
-Mbinfo: Fixes to XML output from mbinfo (Christian Ferreira)
-
-Format 201 (Hysweep): Substantially changed i/o logic to handle the many
-different variants of data logged through Hysweep.
-
-Format 201 (Hysweep): Augmented to handle sidescan data in conjunction with
-multibeam bathymetry. The i/o module will lay the raw sidescan out on the
-bathymetry to generate "processed" sidescan. That will be included in any output
-file as MSS records (an MB-System extension to the HSX format), which can be
-corrected and filtered in the usual way.
-
-Format 88 (Reson s7k): Fixed bug in which sidescan generated from backscatter
-records was flipped port to starboard. Also fixed layout of backscatter in the
-near-nadir region.
-
------> 5.4.2129 (July 8, 2013)
-
-Build system: Attempted to implement changes to the build system suggested by
-Kurt Schwehr and Hamish Bowman.
-
-Mbrolltimelag: Augmented to allow specification of the time lag interval used
-in correllation calculations with arbitrary start and end times.
-
-Mbnavlist: Fixed problems with outputting attitude data from some variants of
-Kongsberg data.
-
-Mbgrid: Changed the convergence criteria for the zgrid interpolation algorithm
-to simply be that the largest change in the grid value is no more than 1 mm.
-
-Formats 56 and 57: Augmented handling of Kongsberg EM1002 data to recognize and
-fix erroneous transmit and receive beamwidth values.
-
-Mbprocess and mbvelocitytool: Augmented raytracing code to handle high angle
-rays without rounding errors producing a square root of a negative number.
-This fixed problems with sample EM1002 data.
-
------> 5.4.2128 (June 18, 2013)
-
-Mblist: Fixed bug that flagged as bad all sidescan pixels with negative values.
-
-src/mbio/projections.h and src/utilities/levitus.h: Removed from svn version
-control as these are created during the build process.
-
-Build system: Implemented changes to the build system contributed by
-Kurt Schwehr that enable building MB-System without support for GSF or inclusion
-of the GSF source code from SAIC. This optional removal of GSF support addresses
-the lack of a proper open source or free software license for the GSF source
-code distribution from SAIC. MB-System distributions that include GSF code or
-require the GSF library cannot be included in official open source package
-collections such as Debian.
-
-Mbgrid: Changed the usage of the zgrid interpolation by mbgrid. Release 5.3.1989
-included changes to speed up interpolation by calculating a smooth model for a
-low resolution grid and then resampling this onto the full resolution grid. This
-approach has the problem that the low resolution interpolation can work poorly
-near data. Mbgrid still does low resolution interpolation as part of the
-slope estimation stage of algorithms 5 and 6 and as part of background
-interpolation, but once again does the primary interpolation stage at full
-resolution.
-
------> 5.4.2123 (June 10, 2013)
-
-Many changes implementing fixes to the new build system from Bob Covill,
-Hamish Bowman, and Christian Ferreira. Moved key auto-generated header file
-from mbsystem/src/mbsystem_config.h to mbsystem/src/mbio/mb_config.h.
-
-Mbm_route2mission: added support for more than one type of survey behavior
-in an AUV mission as controlled by waypoint type in the route files
-exported from mbgrdviz.
-
-Moved program hsdump to mbhsdump.
-
-Fixed some potential buffer overflows and other errors identified by
-Hamish Bowman.
-
-Changed the header of the mbm_* perl macros to #!/usr/bin/env perl as
-suggested by Hamish Bowman and Kurt Schwehr.
-
------> 5.4.2082 (May 24, 2013)
-
-Configure.cmd: Added -DBYTESWAPPED to the recommended pre-options for the
-configure script on Macs.
-
-MBF_EM710RAW (format 58) and MBF_EM710MBA (format 59): Added EM2045 to the
-list of supported Kongsberg multibeam sonars (also known as the EM2040D).
-
------> 5.4.2081 (May 23, 2013)
-
-Build System: Have implemented an autotools-based build system with a
-configure script, following on the initial work by Bob Covill and others.
-The man page and web page documentation have been moved into the source
-tree. The old install_makefiles build system has been updated to still work.
-
--------------------------------------------------------------------------------
-MB-SYSTEM VERSION 5.3 RELEASE NOTES:
--------------------------------------------------------------------------------
-
------> 5.3.2062 (May 17, 2013)
-
-Mbprocess: Fixed a couple more mistakes on lines 5659 and 5662 in mbprocess.c.
-
------> 5.3.2061 (May 16, 2013)
-
-Perl macros: Renamed all perl source files in mbsystem/src/macros by removing
-the *.pl suffix. This is another change to allow use of the GNU autotools for
-building MB-System. The easy way for automake to handle executable scripts is
-to just copy them to the bin directory; renaming the scripts is harder to set
-up.
-
------> 5.3.2060 (May 14, 2013)
-
-Mbsvplist: Added -N option to limit the number of SVP profiles that can be
-output. (contributed by Suzanne O'Hara)
-
------> 5.3.2059 (May 14, 2013)
-
-Mbprocess: Fixed bug in mbprocess in which angle rotation calculations mixed
-degrees and radians when attitude is merged as part of an external navigation
-stream. (Contributed by Bob Covill)
-
-Mbsvplist: Added -T option to output CSV delimited table
-(contributed by Suzanne O'Hara)
-
------> 5.3.2056 (May 7, 2013)
-
-Formats 221 and 222: Added empty i/o module files to ultimately support two
-new formats, both handling data from SEA SWATHplus interferometric sonars:
-	MBF_SWPLSSXI - 221
-	MBF_SWPLSSXP - 222
-The new files include:
-	mbio/mbsys_swathplus.c
-	mbio/mbsys_swathplus.h
-	mbio/mbr_swplssxi.c
-	mbio/mbr_swplssxp.c
-
------> 5.3.2055 (May 7, 2013)
-
-Many files: fixed issues that result in compiler warnings.
-
-Mb7k2ss: Fixed problem that overwrote the first extracted sidescan line.
-
-Mbgrid: Added gridding algorithm 6, called footprint weighted mean. This
-differs from algorithm 5, called footprint slope weighted mean, in that it
-omits the use of the local slope, and thus requires only a single pass
-through the data.
-
-Format 121 (GSF): Added fix from Christian Ferreira to reset the
-depth_corrector value to zero if necessary
-
------> 5.3.2053 (April 4, 2013)
-
-Mb7k2ss: Fixed line breakouts so that the first line is output separate from
-the second.
-
-Formats 162, 163, 168, 169 (text xyz variants): Fixed i/o modules to handle files
-with leading white space before the first column.
-
-Mbset: Added -N option to turn off merging of navigation from MBnavadjust and
-also remove the *.na0 files.
-
-Mbgrid, mbmosaic, mbm_grid: Fixed documentation descriptions of the options
-controlling the spline interpolation, particularly the tension.
-
-Mbm_grdtiff: Fixed the image display program called in the tiff-creating
-script created by mbm_grdtiff.
-
-Mbdatalist: Recast the output format for the -S option. One now gets a single
-line of output for each file unless the -V option is also specified.
-
------> 5.3.2051 (March 20, 2013)
-
-Formats 58 and 59 (mbf): The calculation of "sidescan" from raw backscatter
-samples has been improved. The sidescan can now be successfully
-recalculated by mbprocess following application of bathymetry edits.
-
-Mbprocess: Recalculation of Konsberg multibeam sidescan now enabled for
-formats 58 (mbf_em710raw) and 59 (mbf_em710mba) with command
-mbset -PSSRECALCMODE:1.
-
-Mbedit: soundings originally flagged by the sonar now return to that
-state if they are unflagged and then reflagged interactively.
-
-Mbgrdviz: Disabled "goaway" buttons in dialogs to minimize crashes.
-
-Mbeditviz: Disabled "goaway" buttons in dialogs to minimize crashes.
-
-Mbm_grdplot: Updated macros to derive system defaults from mbdefaults.
-
-Mbm_grdtiff: Updated macros to derive system defaults from mbdefaults.
-
-Mbm_histplot: Updated macros to derive system defaults from mbdefaults.
-
-Mbm_grd3dplot: Updated macros to derive system defaults from mbdefaults.
-
-Mbm_vrefcheck: Updated macros to derive system defaults from mbdefaults.
-
-Mbm_plot: Updated macros to derive system defaults from mbdefaults.
-
------> 5.3.2042 (March 12, 2013)
-
-MBkongsbergpreprocess: Fixed calculation of transmit time for sector subpings.
-
-Format 58 (mbf_em710raw): Improved translation of bottom pick parameters to
-beam flags.
-
-MBgrdviz: Added export of routes to Hypack lnw format and to degrees + decimal
-minutes format.
-
------> 5.3.2017 (March 3, 2013)
-
-Mb7k2ss: Program exits if topography grid specified but reading the file fails.
-
------> 5.3.2016 (March 2, 2013)
-
-Mb7k2ss: Fixed plotting correlation functions.
-
-Mbm_xyplot: Fixed handling of NaN values in input data - no longer includes NaN
-inputs in sorting to determine min max.
-
------> 5.3.2015 (March 1, 2013)
-
-Format 88 (mbf_reson7kr): Fixed some debugging print statements of hexadecimal
-values.
-
-Mbm_route2mission: Added command line control of multibeam sonar settings.
-
-Mbprocess: Fixed handling of tide data with just one value.
-
-Mbeditviz: Fixed calculation of corrected attitude and position for pings at
-start and end of files.Previously badly mislocated pings happened unpredictably.
-
-Mbfilter: Fixed handling of nonfatal read errors.
-
-Format 94 (mbf_l3xseraw): Made storage available for sound speed profiles much
-larger to handle some ridiculous data samples.
-
-Mbauvloglist: Added code to output readable date and time values if desired.
-
-mbm_xbt: Fixed code to more generally handle actual headers in Sippican MK12 data.
-
-mbaux/mb_spline.c: Fixed extrapolation error in linear interpolation code.
-
-Formats 162, 163, 168, 169 (xyz, yxz, xyt, yxt): Augmented code to handle text
-triples with NaN values.
-
-Mbotps: made /usr/local/otps the default location for the OSU Tidal Prediction Software (OTPS)
-
-Format 21 (mbf_hsatlraw): Fixed failure to initialize the internal storage structure.
-
------> 5.3.2013 (January 29, 2013)
-
-Format 94 (mbf_l3xseraw): Fixed bug causing memory faults in Linux when data
-with large svp records are encountered. SVP records can now have as many as
-8192 entries.
-
------> 5.3.2012 (January 25, 2013)
-
-Mbkongsbergpreprocess: Fixed bug causing seg faults on Linux
-
------> 5.3.2011 (January 17, 2013)
-
-Format 88 (mbf_reson7kr): Removed debug messages left in by mistake
-
------> 5.3.2010 (January 14, 2013)
-
-Format 88 (mbf_reson7kr): Fixed reporting of angular beam widths, particularly
-for pre-2009 data in which the alongtrack value was reported incorrectly.
-
-Mbgrid: Changed the weighted footprint algorithm to correctly use the beamwidth
-scaling parameter set with the -W option.
-
------> 5.3.2009 (January 10, 2013)
-
-Format 88 (mbf_reson7kr): Fixed a bug introduced at 5.3.2004 in first-time
-parsing of current Reson 7k data that caused erroneous flagging of some beams.
-
------> 5.3.2008 (January 6, 2013)
-
------> 5.3.2007 (January 5, 2013)
-
-Mbkongsbergpreprocess: Fixed -O option to direct all output to a single file.
-Mb7kpreprocess: Fixed -O option to direct all output to a single file.
-
------> 5.3.2006 (January 4, 2013)
-
-Mbkongsbergpreprocess: Fixed -D option to put output files in the specified
-directory.
-
------> 5.3.2005 (December 31, 2012)
-
-Mbsvplist: Added -M option to control SVP printing. If mode=0 (the default), then
-the first SVP of each file will be output, plus any SVP that is different from
-the previous SVP. If mode=1, then only the first instance of each unique SVP will
-be output, even through multiple files referenced through a datalist structure.
-If mode=2, then all SVPs will be output even if they are duplicates (equivalent
-to the -D option). The -D option is retained for compatibility.
-
-Format 88 (mbf_reson7kr): MB-System now recognizes files with a *.7k suffix as
-Reson multibeam data in format 88. Usually Reson data are logged to files with
-a *.s7k suffix.
-
-Mbm_route2mission: Updated the calculation of the number of photos to be taken
-during a Dorado-class AUV bottom photography mission.
-
-Formats 58 (mbf_em710raw) and 59 (mbf_em710mba): Added support for for the
-"Extraparameters" datagram.
-
-Formats 58 (mbf_em710raw) and 59 (mbf_em710mba): Changed the encoding of binary
-values in the format 58 and 59 files written by MB-System to be little-endian
-(Intel byte order). The Kongsberg format specification allows byte encoding to
-be little or big-endian, and previously MB-System has consistently used big-endian.
-
-Mblist: Fixed bug regarding the output of transmit pulse length values.
-
-Mbprocess: Altered mbprocess so that input SVP files are checked for zero
-thickness layers.
-
------> 5.3.2004 (December 12, 2012)
-
-Mbsvplist: Added -S option to output surface sound speed from survey data rather
-
-Mb7kpreprocess: Changed lever arm correction specified with the -D option to
-involve three dimensions rather than just two.
-
-Format 88 (mbf_reson7kr): Fixed so that mbctdlist and mbsvplist can output
-surface sound speed values from Reson 7k data.
-
-Format 88 (mbf_reson7kr): Fixed so that the storage of bathymetry acrosstrack and
-alongtrack distance values in bathymetry (7006) records is correct. MB-System has
-output incorrect 7006 records since the Reson 7k format (88) was first supported.
-The error was that the acrosstrack and alongtrack distance values were transposed
-relative to the format specification and the data output by the PDS2000 datalogger
-(a reality that only became apparent when I finally had access to a sample of
-PDS2000-logged data). The format 88 i/o module has been augmented to detect if
-data being read derives from pre-fix versions of MB-System, and to fix the data
-if necessary. The existence of this error and its fix should be invisible to
-users, except that data written by pre-fix MB-System will probably import to
-other software packages with the acrosstrack and alongtrack distances switched.
-
-Mbmosaic: Fixed azimuthal priority weighting so that directional mosaicing is
-more reliable.
-
------> 5.3.2000 (Navember 14, 2012)
-
-Mbinfo: Changed mbinfo to gracefully handle the situation of reading a file that
-has no data records while the -P option is specified (gracefully means not
-seg faulting).
-
-Mbmosaic: fixed bug in the use of the azimuth weighting factor.
-
------> 5.3.1999 (Navember 13, 2012)
-
-Mbm_route2mission: Added multibeam pulse length as a command line argument.
-
-Mbnavadjust: Added capability to solve for a z-offset model in which each
-survey has a uniform or constant z-offset, and then reset all ties automatically using
-those z-offsets.
-
-Format 88 (mbf_reson7kr): Fixed bug that caused seg faults with pings that have no valid soundings.
-
------> 5.3.1998 (Navember 6, 2012)
-
-Mb7kpreprocess: Added -C option to apply roll bias and pitch bias during preprocessing. Fixed
-rotation calculations so that side-looking and up looking mapping data can be handled
-properly.
-
-Mbmosaic: added checks for valid topography grid file.
-
-Mbprocess: Fixed rotation calculations so that side-looking and up looking mapping data
-can be handled properly.
-
-Mbm_route2mission: added handling of third specified altitude value in AUV missions.
-
-Mbeditviz: Fixed rotation calculations so that side-looking and up looking mapping data
-can be handled properly.
-
-Formats 56 (mbf_em300raw) and 57 (mbf_em300mba): added support for asynchronous attitude
-output, in particular by mbnavlist -K18.
-
------> 5.3.1995 (October 27, 2012)
------> 5.3.1994 (October 27, 2012)
-
-Mbfilter: when filtering sidescan the output file now includes any bathymetry available in the
-original file. The bathymetry can be used by mbmosaic for calculating apparent grazing
-angles and data priorities.
-
-Mbmosaic: substantially rewrote the calculation of apparent grazing angle for sidescan
-data to be more reliable and to optionally use a topographic model supplied by a
-topography grid (specified with the -T option).
-
-Mb7k2ss: removed functions associated with laying out sidescan on a 3D topographic
-model. These functions are now found in src/mbaux/mb_intersectgrid.c.
-
-Format 88 (mbf_reson7kr) and mb7kpreprocess: added support for multibeam sidescan
-derived from either the backscatter records or the snippet records. The snippets are
-generally better, and are the default source when . The program mb7kpreprocess can be
-set to generate the multibeam sidescan from either record type. The multibeam sidescan is stored using
-MB-System-only "processed sidescan" records as an MB-System-specific extension
-to the 7k format.
-
-libmbaux: added functions to the mbaux library that locate the intersection of
-arbitrary vectors from a sonar platform with a topographic grid. This code is
-located in src/mbaux/mb_intersectgrid.c, and includes functions formerly found
-in src/utilities/mb7k2ss.c. These functions are now used to lay sidescan out
-on a seafloor topographic model and to calculate the apparent grazing angles
-needed for angle-based priority calculation in mbmosaic.
-
-Mbgrid: fixed -Cclip[/mode] option so that -C0/3 will in fact fully interpolate
-the resulting grid.
-
-Format 88 (mbf_reson7kr): fixed travel time and angle calculation for current
-generation data using v2detectionsetup data records.
-
-Mbgrid and mbmosaic: Added -Rfactor option that will allow users to specify that
-the output grid extent will be the data extent expanded by a multiplicitive
-factor. For instance, specifying factor = 1.1 means the grid is expanded 5% to
-the west, east, south and north for a total expansion of 0.1 or 10%.
-
------> 5.3.1989 (October 4, 2012)
-
-Mbm_grdplot & mbm_grdtiff: Fixed application of strict color table bounds in
-mbm_grdplot and mbm_grdtiff.
-
-mb7k2ss: Added -Q option so that sidescan lines can be constructed based on the
-times starting and ending waypoints were reached.
-
-Format 71 (mbf_mbldeoih): Fixed scaling of sidescan values to handle data with
-small values.
-
-Mbgrid and mbmosaic: Fixed the zgrid interpolation code, and also changed the
-usage so that the interpolation stages will proceed much more rapidly. This is
-now accomplished for large grids by iteratively calculating a smooth Laplacian model
-for a low resolution grid and then resampling this onto the desired full resolution
-grid using bilinear interpolation.
-
------> 5.3.1988 (September 29, 2012)
-
-Format 71 (mbf_mbldeoih): Implemented automatic scaling of sidescan values to improve
-fidelity of stored values to the original values.
-
-MBeditviz: Fixed region selection to include topography min and max within that
-region.
-
-Reson 7k data (format 88, mbf_reson7kr): fixed calculation of beam angles from
-7026 7k Detection records.
-
-MBnavadjust: the tie (or block) view now honors the "With Selected Survey" and
-"With Selected File" display modes.
-
-MB7kpreprocess: Added control for the use or nonuse of attitude sensor time delay
-data embedded in MBARI "Bluefin Navigation" records.
-
-MB7k2ss: Added option to define sidescan line start and end points using a list
-of times generated using mbroutetime (duplicating an option of mbextractsegy).
-
-MB7k2ss: When extracting sidescan data from 7k data files to separate format 71 files,
-use navigation, heading, sonar depth, and attitude data from multibeam data records
-in the 7k data file (previously these values derived from asynchronous navigation,
-heading, attitude, etc, records).
-
------> 5.3.1986 (September 12, 2012)
-
-MBnavadjust now treats data from interferometric sonars different than data
-from other sonars. When interferometric bathymetry is imported, the many soundings
-are binned and averaged into 1-degree wide "pseudo-beams" to allow reasonable
-(both visually and computationally) contouring.
-
-Added MBIO function mb_sonartype() that returns the type of sonar associated
-with some data, using the definitions:
-  #define	MB_SONARTYPE_UNKNOWN		0
-  #define	MB_SONARTYPE_ECHOSOUNDER	1
-  #define	MB_SONARTYPE_MULTIBEAM		2
-  #define	MB_SONARTYPE_SIDESCAN		3
-  #define	MB_SONARTYPE_INTERFEROMETRIC	4
-
-Added function to mbnavadjust that will estimate vertical offset between surveys
-and then set relevant ties accordingly.
-
-Fixed some plotting defaults for mbm_histplot.
-
-Added -MXexcludepercent option to mblist to exclude a user defined
-percentage of outer beams from mblist output. (contributed by Suzanne O'Hara)
-
------> 5.3.1982 (August 15, 2012)
-
-Fixed significant issue in mb7kpreprocess and in Reson 7k format support in general.
-The code was not handling the current raw detection data records correctly.
-
-Fixed mbotps so that it handles requests for sound speed models on locations that
-are dry land in the Topex mdoels more gracefully.
-
-Fixed minor info printing issue with mbnavadjust (now doesn't report failure to
-invert unless there is a failure to invert).
-
-Improved performance of navigation and attitude merging for both mb7kpreprocess
-and mbkongsbergpreprocess
-
-Added new functionality to mbkongsbergpreprocess (contributed by Suzanne O'Hara):
-  -Added -D<outputDirectory> argument to allow users to set new directory for
-    output files; original code always created output in input directory.
-    This is a problem where users should not be modifying original directories.
-    Using this flag allows the user to use the datalist option and is easier
-    than copying the original mb58 data to a different directory or to using a
-    script that loops through all the data using the -D option
-  -Added -C flag to output counts. Current code always outputs many rows of
-    information that can be confusing. The default now is to work silently
-    unless there is a problem.
-
------> 5.3.1981 (August 2, 2012)
-
-Fixed problem with mbprocess in which the heading was unexpectedly replaced by course-made-good.
-Now this can only happen with HEADINGMODE:1 or HEADINGMODE:2 in the parameter file.
-
-Fixed error in the definition of the OMG HDCS format in mbf_omghdcsj.h
-This fix provided by Bob Covill.
-
------> 5.3.1980 (July 13, 2012)
-
-Augmented support for L3 XSE format (94) so that data from recent SeaBeam 3000 and SeaBeam 3050
-multibeams can be processed.
-
-Added option to mbinfo to generate output in XML (contributed by Christian Ferreira)
-
-Augmented the i/o module for Reson 7k data to work with data files that do not
-include the 7006 bathymetry records but instead include the raw detection 7027
-records.
-
-Altered mbnavlist so that longitude and latitude values are output with a
-precision about equivalent to 0.1 mm, the same as mblist and mbinfo.
-
-Altered mbprocess so that navigation shifts and offsets are applied to merged
-navigation. Navigation derived from mbnavadjust is not affected.
-
-Added new program mbkongsbergpreprocess, which reads data from a third generation
-Kongsberg multibeam sonar (e.g. EM122, EM302, EM710),  interpolates  the asynchronous
-navigation, heading, and attitude onto the multibeam data, and writes a new file
-with that information correctly embedded in the multibeam  survey  data.  The  input
-files  may  be  in  the  vendor  format  MBF_EM710RAW  (format id 58) or the MB-System
-extended format MBF_EM710MBA (format id 59); the output  files  will  always  be  in
-the  MB-System  extended  format MBF_EM710MBA (format id 59).
-
-Updated GSF library to new release 3.04 from SAIC.
-
-Removed local($[) = 0 initializations from all perl macros for compatibility with the
-current version of perl (some macros were missed when this was done before 5.3.1955).
-
-Fixed problem with mbprocess in which merged roll and pitch data were not applied
-to the bathymetry unless the bathymetry was being recalculated by raytracing.
-
-Added ability to change the read and write buffers for file i/o, initially just
-for Reson 7k and Kongsberg current generation data. This allows one to tune for
-the highest throughput file i/o for a given situation (e.g. 10 MB buffers achieve
-5-10% faster throughput on the MBARI network).
-
-Altered i/o module mbr_image83p.c for Imagenex DeltaT data so that if no roll or
-pitch data are stored, the sonar is treated as if it is pointed down rather than
-horizontal. Also fixed the module so that the profile tile angle parameter is
-used correctly.
-
------> 5.3.1955 (May 16, 2012)
-
-Removed ($[) = 0 initializations from all perl macros for compatibility with the
-current version of perl.
-
-Updated PROJ4 to the 4.8.0 release.
-
-Added code for a new i/o module reading (but not yet writing) Benthos 1624 sidescan
-data in the XTF format. This read-only i/o module has a format id of 211. This code
-has been contributed by Jens Renken (MARUM/University of Bremen). The intent is to
-complete the i/o module to allow full processing of the Benthos 1624 data.
-
-Added a new macro, mbm_bpr,  to translate pressure data from a Seabird SBE53 pressure sensor
-used as a Bottom Pressure Recorder (BPR) into tidal data that can be used to correct swath
-bathymetry data.
-
-Changed default Postscript viewer for Linux or Mac to be gv rather than Ghostview.
-
-Added option to mbinfo (-X1) to generate output in the json format. If the -O option
-is used to make metadata files, then the addition of -X1 will cause the output files
-to be named "*_inf.json" rather than "*.inf". Suzanne O'Hara (LDEO) contributed this
-improvement.
-
-Augmented mbsvplist with option -C which causes the program to output the number of
-unique SVPs in each file to stdout. Suzanne O'Hara (LDEO) contributed this
-improvement.
-
-Fixed multiple problems with mbcontour and the underlying contouring library that
-were producing crashes in many circumstances.
-
-Updated the MBARI AUV mission generator mbm_route2mission to reflect current operational
-parameters for the MBARI Mapping AUV.
-
-Applied fixes to the Marine Sonics sidescan i/o module (mbr_mstiffss.c) contributed
-by Val Schmidt of UNH/CCOM.
-
-Changed the color table in mbnavadjust to eliminate yellow contours, which are difficult to see.
-
-Added output of potential temperature to mbctdlist.
-
-Altered subbottom section plots generated by mbextractsegy. The first cut plots
-generated when mbextractsegy is used to extract subbottom data into segy files are broken
-into multiple section plots for long files (representing survey lines if extracted
-according to a route file). Previously, all section plots for a given line had a time sweep
-encompassing the data for the entire line. Now, if the total sweep exceeds 1 second, then
-the sections plots will be generated using only the sweep required for each section alone.
-
-Improved the robustness of calculating longitude latitude bounds for segy data using
-mbsegyinfo.
-
-Added capability to mbsegygrid to grid and plot subbottom sections based on distance between
-the end points of a survey line. This approach to plotting subbottom sections removes the
-impact of speed variations and deemphasizes data where the sonar platform moved slowly
-or stopped.
-
------> 5.3.1941 (March 6, 2012)
-
-Fixed sidescan filtering with mbfilter. The filtered sidescan output in
-format 71 files had incorrect acrosstrack locations.
-
-Fixed problems with sidescan generation for current generation
-Kongsberg data (formats 58 and 59). The code previously tended to choose too
-small of a pixel size, resulting in a sidescan swath narrower than the real
-swath width.
-
-Fixed swath contouring and track plotting by mbcontour and mbm_plot. Subtle changes
-in the GMT pslib resulted in contours and tracks only partly plotting in some
-Postscript devices. The MB-System code now explicitly chooses when to call
-stroke operations in the Postscript, rather than leaving that up to pslib.
-
-Fixed format 24 (mbf_hsldeoih) so that certain old files with extra bytes in some
-comment records can be read correctly.
-
-Added output of raw values from current generation Kongsberg data (formats 58 and 59)
-to mblist.
-
------> 5.3.1937
-
-Changed the resolution of navigation in fbt (format 71) files and
-fnv files to be 1e-9 degrees, equivalent to about 0.1 mm. Similarly change
-the navigation resolution in the output of mbinfo, and thus in inf files.
-This affects mbr_mbldeoih.c, mbsys_ldeoih.c mbsys_ldeoih.h in src/mbio,
-and mbinfo.c and mblist.c in src/utilities.
-
-Add importing and display of "vector" data in mbview and mbgrdviz. The
-vector files are GMT-style segmented files of lon, lat, topography value triples.
-These are displayed as lines colored according to the value. Controls for
-setting the color tables still have to be added.
-
-Changed mbgrid so that any background (option -K) is calculated first,
-before significant memory is allocated. This avoids crashes due to
-attempted forks that overrun available memory.
-
-Fixed beamwidth calculation for Reson 7k data. Fix in mbr_reson7kr.c
-and mbsys_reson7k.c.
-
-Fixed overflow during iterative search for beam angle values in
-mbr_em710raw.c
-
-Added capability to mbauvloglist to output angle values in degrees rather
-than radians.
-
-Added code to mbnavadjust to detect when the uncertainty ellipsoid of one
-or more ties contains a zero value that will cause the inversion to fail.
-In this case, the program prints out which ties are problematic, and declines
-to calculate the inversion.
-
-Fixed beamwidth values stored in fbt files.
-
-Added JSON output option to mbinfo. This addition provided by Suzanne O'Hara of
-LDEO/IEDA.
-
-Added graceful exit to mbm_grdplot when a call to grdinfo fails. Fix provided by
-Hamish Bowman of the University of Otago.
-
-Bug fixes to mbr_mstiffss.c related to reading Marine Sonics sidescan data. This fix
-provided by Val Schmidt of CCOM/JHC at University of New Hampshire.
-
------> 5.3.1917 (January 10, 2012)
-
-Added preliminary support for HYSWEEP HSX format as MBIO format 201. Added program mbhysweeppreprocess to preprocess the HSX data.
-
-Fixed bug in mb_lever() function in mb_angle.c.
-
-GSF 3.03 update.
-
------> 5.3.1912 (November 19, 2011)
-
-Formats 58 and 59 (third generation Kongsberg multibeam data):
-Augmented code to handle bathymetry data in which beams are reported
-as having valid soundings but actually have zero ranges and NaN
-bathymetry, acrosstrack distance, and alongtrack distance values.
-
-Formats 58 and 59 (third generation Kongsberg multibeam data):
-Fixes to the handling of attitude ecords, particularly with regard
-to writing the records.
-
------> 5.3.1909 (November 16, 2011)
-
-Program mbnavlist:
-Fixed attitude record output so that use of -K18, -K55, -K56, or -K57
-results in output lines for all attitude records, even when position
-or heading data are not available for interpolation.
-
-Formats 58 and 59 (third generation Kongsberg multibeam data):
-Fixed the i/o modules to successfully output attitude and netattitude
-records identified as MB_DATA_ATTITUDE1,  MB_DATA_ATTITUDE2, or
-MB_DATA_ATTITUDE3.
-
------> 5.3.1907 (November 9, 2011)
-
-Program mblist:
-Added output of beam bottom detection algorithm (amplitude or phase)
-to mblist. One can now use Q and q as valid output values that can
-be included in the arguments to the -O option.
-
-Program mbnavlist:
-Added ability to output navigation data keyed to primary or
-ancilliary attitude data. For instance, use of the -K18 option will
-cause the mbnavlist output to occur for all attitude samples in the
-primary attitude data stream. The timestamps will be those of the
-attitude records, and any position, speed, or sonar depth values
-requested will be interpolated onto the attitude timestamps.
-
-Program mbm_route2mission:
-Enabled the generation of AUV missions in which multibeam beamformed
-data ("water column") are recorded in addition to bathymetry and
-backscatter.
-
-Program mb7kpreprocess:
-Fixed integration of MBARI AUV INS log data into the processing of
-Reson 7k data.
-
-Program mbrolltimelag:
-Fixed a bug that rarely produced a failure of time lag correlation
-calculation.
-
-Third generation Kongsberg data (formats 58 & 59:
-Fixed handling of different attitude records, in that the code
-now recognizes multiple sources of roll, pitch, and heave when
-they appear in a datastream. The data records identified as the
-primary attitude source are identified as type MB_DATA_ATTITUDE (18)
-while ancilliary records will be identified as MB_DATA_ATTITUDE1 (55),
-MB_DATA_ATTITUDE2 (56), or MB_DATA_ATTITUDE3(57).
-
------> 5.3.1906 (September 28, 2011)
-
-Program mbnavadjust:
-Added -D option to invert foreground (normally black) and background
-(normally white) colors in the interactive plots
-
-Format 88 MBF_RESON7KR (Reson 7k multibeam data):
-Fixed deallocation of MBF_RESON7KR data structures.
-
-Program mb7kpreprocess:
-Fixed some filtering code in mb7kpreprocess.
-
-Program mbrolltimelag:
-Added -K option to mbrolltimelag - this duplicates the new -K option
-in mbnavlist and is used when mbrolltimelag calls mbnavlist to extract
-the roll time series.
-
-Program mbnavlist:
-Augmented mbnavlist to allow extraction of data keyed to data records
-other than navigation or survey data. A new -Kkind option allows
-users to specify output at the times of attitude, heading, or other
-record types.
-
-Programs mbedit, mbeditviz, mbnavedit, mbclean, mbprocess:
-Added ability to disable file locking using the program mbdefaults
-and the .mbio_defaults file in the user's home directory.
-If a user disables file locking by running
-     mbdefaults -U0
-then the programs mbedit, mbeditviz, mbnavedit, mbclean, and
-mbprocess will not set new file locks and will ignore any existing
-file locks. In short, a user can disable the entire file locking
-mechanism in MB-System.
-
-New macros mbm_multicopy, mbm_multidatalist, mbm_multiprocess:
-Added three new macros authored by Christian Ferreira. These are
-mbm_multicopy, mbm_multidatalist, and mbm_multiprocess. All three
-are used to execute tasks on large numbers of swath files by starting
-multiple processes in parallel. The mbm_multicopy macro accomplishes
-copying of files from one format to another. The mbm_multidatalist
-macro accomplishes the creation of ancilliary files. The mbm_multiprocess
-macro accomplishes processing with mbprocess. These all require the
-Parallel-Forkmanager Perl module available from www.cpan.org.
-
-Program mbclean:
-Added flagging by acrosstrack distance to mbclean. Also added esf
-file locking for compatibility with mbedit and mbeditviz, and
-fixed handling of old edits.
-
-Program mbgrid:
-Fixed a problem with the footprint algorithm of mbgrid
-that sometimes left holes that could not be filled by interpolation.
-
-Macro mbm_route2mission:
-Added ability to mix constant altitude and constant depth behaviors
-within a single AUV mission to mbm_route2mission.
-
-Format 88 MBF_RESON7KR (Reson 7k multibeam data):
-Fixes to handling of asynchronous attitude data in format 88 (Reson s7k)
-and calculation of time lag estimates.
-
-Program mbextractsegy:
-Adjustments to the default plots of segy data by mbextractsegy.
-
-Macro mbm_route2mission:
-Fixes to generation of MBARI AUV missions by mbm_route2mission.
-
-Format 88 MBF_RESON7KR (Reson 7k multibeam data):
-Fixed extraction of raw, asynchronous attitude data from Reson 7k
-data using rollpitchheave records (e.g. from the MARUM AUV), which in
-turn fixes the calculation of attitude time lag estimates using
-mbrolltimelag.
-
-Program mb7kpreprocess:
-Fixed application of time lag model by mb7kpreprocess for the case
-of Reson 7k data using rollpitchheave records (e.g. from the MARUM AUV).
-
-Program mblist:
-Added -UN option to mblist that ignores output of lines
-associated with zero longitude or latitude values. This option
-will be used by mbdatalist to create *.fnv files.
-
-Format 71 MBF_LDEOIH (generic swath):
-Provided a means to continue using the old definition of
-swath format MBF_LDEOIH (format 71) for fbt files.
-Users can now use mbdefaults to set the format 71 version that
-will be generated when fbt files are created by mbdatalist and
-mbprocess. If
- 	mbdefaults -Fold
-is executed, the .mbio_defaults file in the user's home directory
-will be altered so that all new fbt files are in the old format.
-The purpose of this backwards compatibility is to allow users to
-take advantage of the Fledermaus capability for editing bathymetry
-in MB-System processing environments. This involved changes to mbcopy
-as well as to the MBF_LDEOIH i/o module.
-
-Program mbnavadjust:
-Changed the swath data import code so that sections will be created even
-when all beams have been flagged as bad. This is to allow surveys
-to remain intact, with no breaks, because the concept of a continuous
-survey is increasingly important in MBnavadjust. Also altered the
-status displays and listings to show survey id along with file and
-section id's.
-
-Format 71 MBF_LDEOIH (generic swath):
-Updated the definition of swath format MBF_LDEOIH (format 71),
-which is used for the "fast bathymetry" or *.fbt files in MB-System
-processing environments. The previous form of *.fbt files had a
-serious limitation in that bathymetry from multibeams operated
-near the seafloor in deep water did not represent the full
-numerical resolution of those data. The updated format allows for
-depth and distance resolution to 0.001 m even in the deep ocean.
-Old *.fbt files are read transparently, but newly written files
-will be in the new form.
-IMPORTANT: In order to avoid compatibility issues, all users
-operating on the same projects should upgrade to this version or
-higher once one user upgrades.
-
-Format 88 MBF_RESON7KR (Reson 7k multibeam data):
-Updated support for Reson 7k data to include the "1022" record.
-We still don't know what this is, but the code now reads and
-writes it without complaint.
-
-Program mbinfo:
-Fixed mbinfo handling of swath files with no good data
-(Thanks Suzanne O'Hara)
-
-MBIO function mb_get_format():
-Changed mb_get_format() function in mb_format.c so that formats
-are inferred from parameter files if they exist.
-
-Program mbnavadjust:
-Supplemented informational output to stdout from MBnavadjust.
-
-Format 71 MBF_LDEOIH (generic swath):
-Started development of new version of format 71 (mbf_ldeoih).
-
-Program mb7kpreprocess:
-Fixed translation of beam quality values into MB-System beam flags
-by mb7kpreprocess.
-
-Program mbextractsegy:
-Fixed calculation of line breaks by mbextractsegy.
-
-MBIO function mb_get_format():
-Augmented mb_get_format() in mb_format.c to look for the format id
-value in mbprocess parameter files before trying to make sense of
-file suffixes.
-
-Program mbedit:
-Fixed MBedit's handling of files not conforming to the MB-System
-filename suffix convention.
-
-Macro mbm_xyplot:
-Allow users of mbm_xyplot to specify both axis annotation with the
--B option and axis labeling with the -L option.
-
-Program mbeditviz:
-Implemented workaround for MBeditviz crash problem on Poseidon Linux.
-MBeditviz would shut down whenever a second map view was requested with
-an Xserver error named GLXBadContextTag. Previously, the OpenGL rendering
-within X11/Motif widgets has been implemented with the graphics calls
-always sent through the X11 window server. I have now set the code to
-allow direct rendering through hardware when that is possible. For reasons
-I do not understand, this change results in MBeditviz no longer crashing
-on my Poseidon Linux test machine.
-
-Programs mbedit, mbnavedit, mbeditviz:
-Fixed font issue for MBedit, MBnavedit, and MBeditviz by using courier
-rather than monaco as a fixed-width font for the available file list
-widgets.
-
-Program mbprocess:
-Added support for the "Rolling Deck to Repository" (R2R) navigation format
-as both an MB-System format (format id 172) and an mbprocess navigation
-merging format (NAVFORMAT=10)
-
-Macros mbm_grdplot and mbm_grdtiff:
-Modified mbm_grdplot and mbm_grdtiff so that the -Y option strictly enforces
-the colormap min max bounds set with the -Z option.
-
-Formats 132 MBF_EDGJSTAR and 133 MBF_EDGJSTR2 (Edgetech Jstar):
-Fixed support for Edgetech Jstar files (formats 132 and 133) so that the
-output of mb7k2jstar and mbprocess are compatible with Edgetech programs.
-
-Programs mbedit, mbeditviz, and mbnavedit:
-Added file locking to mbedit, mbeditviz, and mbnavedit. All three programs
-can now load datalists and display lists of files available for editing.
-These lists show whether the file has been previously edited and if the
-file is locked. Locked files cannot be loaded or edited. As before, mbprocess
-also locks files during processing and skips files that are locked by
-other programs. The program mbdatalist can be used to detect (-S) and remove
-(-Y) orphan file locks in files referenced by datalist structures.
-
-Program mbprocess:
-Fixed bug in mbprocess.c involving parsing of NMEA GGA strings when
-reading in navigation for merging with survey data.
-
-Program mbnavadjust:
-Changed MBnavadjust to allow more file modes, in turn allowing
-more control over which data has the most influence over the navigation
-solutions. In addition to the previously existing modes (Fixed, Good, Poor),
-surveys can now be set to FixedXY and FixedZ modes where the navigation
-of the files so identified will have the specified coordinates fixed
-(unadjusted) and the other coordinate(s) treated as Good. In particular,
-this allowed us to simultaneously adjust navigation from overlapping
-MBARI Mapping AUV and ABE surveys in which the Mapping AUV pressure depth
-was clearly more accurate than the ABE vehicle depths. By setting the
-MBARI data to mode FixedZ, we were able to force the solution to adjust
-the ABE navigation to match the Mapping AUV vertical reference, while still
-allowing lateral (XY) adjustments of all the AUV navigation.
-
-Program mbnavadjust:
-Changed MBnavadjust to output user, cpu, and time of changes to
-project files and as comments to the adjusted navigation files. Also changed
-mbprocess to handle comments in adjusted navigation files.
-
-Program mbm_copy:
-Fixed -C option of mbm_copy.
-
-Format 192 MBF_IMAGEMBA (Imagenex DeltaT):
-Fixed i/o module for extended format Imagenex DeltaT data (format 192) by removing code
-that recalculated bathymetry unnecessarily.
-
-Program mbdatalist:
-Added -Y option to mbdatalist to remove any leftover lock files.
-
-Parsing *.inf files:
-Fixed bug in parsing file start and end times in *.inf files.
-
-MBIO functions mb_defaults(), mb_env(), and mb_lonflip():
-Changed mb_defaults(), mb_env(), and mb_lonflip() functions to always return
-MB_SUCCESS status even when ~/.mbio_defaults file does not exist. Working with
-system defaults hould not be an error.
-
-Program mbeditviz:
-Changed mbeditviz_import_file() function in mbeditviz_prog.c to reset global
-status to MB_SUCCESS on entry.
-
-Program mbclean:
-Incomplete implementation of Dana Yoerger's changes to mbclean. Not yet tested.
-
-Program mbnavedit:
-Increased verbosity of mbnavedit for -X option.
-
--------------------------------------------------------------------------------
-MB-SYSTEM VERSION 5.2 RELEASE NOTES:
--------------------------------------------------------------------------------
-
------> 5.2.1880 (December 30, 2010)
-
-Augmented mbotps to output tide in both
- 	time_d tide
-and
- 	year month day hour minute seconds tide
-using a -Atideformat command line option.
-
-Added new kluge processing option to mb7kpreprocess (-K2)
-that zeros alongtrack angles. This fixes some recent sample
-Reson 7k data.
-
-Recast lever arm calculation due to roll and pitch rotations
-in mb_angle.c.
-
-More changes to the handling of current generation Kongsberg
-data in mbr_em710raw.c.
-
-Fixed handling of beam alongtrack distance values during bathymetry
-recalculation by raytracing.
-
-Improved beam info display in mbeditviz.
-
-Fixed mbnavadjust recalculation of the 3D cross-correlation function
-after changing the vertical offset.
-
-Changed mbr_image83p.c, mbr_imagemba.c, and mbsys_imae83p.c so that
-calculation of beam angles happens during the first read of the data.
-
-Replaced strsep() with strtok() in mbr_edgjstar.c. This is to allow
-MB-System to be more easily built on Solaris systems.
-
-Fixed mbset so that it recognizes sidescan cutting commands (SSCUTNUMBER,
-SSCUTDISTANCE, SSCUTSPEED).
-
------> 5.1.3beta1875
-
-Altered -P option in mbsvplist. Previously this option (which turns on
-bathymetry recalculation by raytracing in mbprocess using the water sound
-speed models extracted from the data files) set the raytracing to
-correct the takeoff angles for the difference between the sound speed
-used for beamforming (surface sound velocity or SSV) and the sound speed
-at the sonar depth in the water sound speed model. Now, mbsvplist sets
-mbprocess to leave the takeoff angles unchanged. This is more more
-consistent with the expectation that raytracing through the original
-sound speed model should yield values matching the original bathymetry.
-
-Altered mbprocess bathymetry recalculation by raytracing to better handle
-cases where large heave values bring the sonar array above the nominal
-water line. In this case, a static heave offset is calculated, raytracing
-is done from the top of the water sound speed model, and the heave offset
-is added to the raytracing result.
-
-Improved the autopicking function of mbnavadjust.
-
-Fixed a bug in handling the per-beam heave values in current generation
-Kongsberg data (formats 58 & 59).
-
-Changed mbm_route2mission to allow command line argument control of AUV
-speed during ascent/descent, survey lines, and transit lines. Also added
-control of the "deltaDepthRestart" value controlling how far up the AUV
-should float after an altitude abort before resuming the mission.
-
-More changes to support of Kongsberg current generation multibeam
-data in formats 58 and 59. As previously noted, the angles used to recalculate
-bathymetry from raw travel times by raytracing are estimated by iteratively
-seeking to match the original bathymetry reported by the sonar. These angles
-are estimated when data are first read as format 58 and then embedded in
-format 59 data (presumably when mbcopy is used to translate format 58 files to
-format 59)for later use by mbprocess. The default algorithm matches the original
-bathymetry to within about 0.1% altitude by calculating an effective heave for
-each ping and takeoff angles for each beam. A second algorithm (which can only
-be activated by uncommenting an #ifdef statement in mbr_em710raw.c) matches the
-orginal bathymetry by modifying both the takeoff angles and the travel time
-measurement - this achieves matching of the original bathymetry to about 0.02%
-of altitude. Use of the second algorithm is not recommended because modifying
-the fundamental observations (travel times) to match the sonar's calculation
-is, well, unsatisfying and wrong. The bad option is there because I took the
-time to code it to see how well it would work.
-
------> 5.1.3beta1874
-
-The function mb_get_info() now properly applies the lonflip value. This
-in turn allows mbgrid to infer correct bounds in situations where the
-lonflip is important (e.g. data across the +/-180 degree boundary when
-lonflip is -1 or 1).
-
-Changed MBnavadjust so that an "Inversion Smoothing" value replaces a
-no-longer-used "Inversion Precision" value. This value, accessible under
-the Options dialog, sets the importance of smoothing in the adjusted
-navigation model. The default is 4.00, and possible ranges are 0.10 to
-10.0, where the smoothing penalty weight applied to the first and
-second derivatives of the adjusted navigation perturbation is ten
-raised to this power.
-
-Added support for Kongsberg EM2040 multibeam in formats 58 and 59.
-
-Changed MBnavadjust so that default settings for section length and
-contour interval are appropriate for high resolution surveys such
-as those produced by AUV's equipped with >100 kHz multibeams.
-
-Fixed plotting macros mbm_plot, mbm_grdplot, mbm_xyplot, mbm_grd3dplot
-so that the calls to display postscript graphics using gv in the output
-plotting scripts scale plots to fit on the screen.
-
-Fixed mbm_route2mission to use proper camera control when generating
-mission scripts for the MBARI Benthic Imaging AUV.
-
-Added -W option to set the desired swath width of sidescan output from
-mb7k2ss.
-
-Updated the i/o module supporting OMG HDCS (the John Hughes Clarke format)
-to handle HDCS version 4. These mods contributed by Bob Covill.
-
-Fixed mb7kpreprocess to check for and ignore repeated ancilliary and
-survey data records.
-
-Update GSF code to version 3.02, released 28 September 2010.
-
-Set MBeditviz to resolve format id's in output parameter files when
-filenames do not follow known suffix conventions.
-
-Added support for a number of new data records in the Reson 7k data format,
-following the 19 June 2009 addendum to the 7k format version 1.00 specification.
-
-Changed mb_malloc() calls in mb_format.c and mb_buffer.c to mb_mallocd() calls
-for greater debugging capability.
-
-Added some debugging statements to mbprocess.c.
-
-Changed mbm_grdplot macro to use the variable names embedded in seismic section
-GMT grid files generated by mbsegygrid.
-
-Improved autopicking in MBnavadjust to the point where it is actually useful.
-Also fixed bug that caused eventual seg faults when analyzing many crossings
-in a single session.
-
-Fixes to  Reson s7k (format 88) support allowing mbnavlist to use position
-records as navigation channel 3. This in turn allows mbrolltimelag to work
-with Reson 7k data collected by MARUM (University of Bremen).
-
-Added file name and line output to debug messages in mbr_l3xseraw.c to aid
-in later work to fully support the current XSE data format.
-
-Set mbrolltimelag to only attempt to generate a variable time lag model
-plot if more than one robust time lag values have been generated.
-
-Updating in preparation for beta release version 5.1.3beta1874.
-
------> 5.1.3beta1862
-
-Moved src/mbaux/mb_rt.c to src/mbio/mb_rt.c and made this
-raytracing code part of libmbio rather than libmbaux.
-
-Fixed deallocation of raytracing data in mbprocess.
-
-Added source type flag (CW or chirp) definition to src/mbio/mb_status.h
-
-Add mb_io_pulses() function definition to src/mbio/mb_io.h as a
-pointer for functions in i/o modules that extract source type (CW or chirp)
-for individual beams. Added mb_pulses() function calls to src/mbio/mb_define.h
-and src/mbio/mb_access.c.
-
-Added mbsys_simrad3_pulses() function to i/o module for current
-generation Kongsberg (Simrad) data in src/mbio/mbsys_simrad3_pulses().
-
-Altered i/o module for current generation Kongsberg (Simrad) data
-so that bathymetry calculation using raytracing works correctly.
-This involves src/mbio/mbr_em710raw.c and src/mbio/mbsys_simrad3.c.
-The problem is that the current raw beam and angle datagram stores
-travel times and angles uncorrected for motion and attitude. My
-attempts to properly calculate the attitude and motion
-compensation have not succeeded (as measured by succeeding in replicating
-the original bathymetry when used with the original sound speed model).
-This version achieves accurate estimation of the compensated angles
-for each sounding by finding a ray (through iteration) that replicates
-the original sounding position by raytracing through the original
-sound speed model. The depth difference is stored as a per-beam heave
-correction, and the angles are stored normally. This calculation is
-done only on the raw data format 58. When mbcopy is used to translate
-the data to the processing format 59, the compensated angles are stored
-in extended bathymetry datagrams. This scheme suffices to allow full
-processing of the data, but is not satisfying in that I clearly still do not
-fully understand the raw data format
-
-Fixed issues with a number of manual pages.
-
------> 5.1.3beta1860
-
-Further changes to mbnavadjust:
-- The inversion stops if it is diverging rather than converging on a navigation adjustment model solution.
-- The program will insure that all crossings have the later section second by flipping the order of crossings if necessary while reading an old project.
-- The program also resorts the crossings when it reads a project.
-
------> 5.1.3beta1858
-
-Slight modification to mbm_grdplot map annotation scheme (degrees + minutes
-for maps up to 4 degrees across where only degrees shown before for maps
-wider than 1 degree).
-
-Changes to mbm_route2mission to accomodate new capability of MBARI
-Mapping AUV to record full water column data from the Reson 7125 multibeam.
-
-Move mb_mergesort() function prototype from mb_esf.c to mb_define.h.
-
-MBnavadjust augmented with capability to check for new crossings and
-to recalculate overlap coverage of existing crossings after inversions.
-Users can also toggle previously analyzed crossing to "unset" status.
-
-MB7kpreprocess augmented to handle Reson 7111 data sample from NGDC.
-
-Fixed incorrect listing MB_DATA defines in mb_status.h.
-
-Added per-beam heave data to mbsys_simrad3 ping structure to support
-bathymetry recalculation for EM710, EM302, EM122 data. Defined new
-processed bathymetry record for use in format 59, and set code to
-transparently read the old record and write only the new record.
-Mostly fixed handling of attitude data in bathymetry recalculation.
-There still seems to be a problem with handling heading data.
-
------> 5.1.3beta1855
-
-Fixed error in beam angle calculation for third generation Simrad multibeam
-data (formats 58 and 59, EM710, EM302, EM122) that made bathymetry recalculation
-by raytracing badly wrong.
-
------> 5.1.3beta1851
-
-Fixed problem where mb7kpreprocess made beams that should have been null
-valid but flagged.
-
-Fixed bug that caused mbclean to fail to actually flag some beams
-identified for flagging.
-
-Added button to zero all z offsets on crossings for cases where tidal
-corrections have been made before data were imported into a mbnavadjust
-project.
-
-Fixed mbgetesf manual page.
-
-Fixed mode control in mbgetesf so one can extract the complete beam flag
-state from a swath file. MBgetesf is now used by MBeditviz to get the
-original beam flag state of raw swath bathymetry when processed files
-are read.
-
-Fixed sorting of beamflag edit events in edit save file data as used by
-MBedit, MBeditviz, MBclean, MBareaclean, and MBprocess. This fixes a
-problem wherein some edits performed by MBeditviz were dropped by
-MBprocess. Also, MBgetesf is now used by MBeditviz to get the original
-beam flag state of raw swath bathymetry when processed files are read.
-
------> 5.1.3beta1844
-
-Fixed yet another bug in MBnavadjust - this time getting the
-importation of old project files correct and, more importantly,
-getting the z-offset sign correct in the Naverr display.
-
------> 5.1.3beta1843
-
-Updated mb7k2ss man page.
-
-Fixed bug in mbrolltimelag regarding popen/pclose use.
-
-Fixed bug in mb_process.c file locking.
-
-Fixed mbotps man page.Fixed bug in MBeditviz and added hot keys for
-editing (only partially successful because it's hard to reliably get
-the keyboard focus onto the rendering OpenGL widget.
-
-Fixed mbotps man page.
-
-Augmented MBnavadjust to allow referencing high resolution bathymetry
-(e.g. AUV surveys) to lower resolution bathymetry (e.g. hull mounted
-multibeam surveys). The navigation of specified files (typically the
-data collected from the surface where GPS is available) can be fixed
-so that everything else floats and is adjusted relative to those data.
-
-mbprocess - improved error reporting to show why files are not being processed.
-
-mbmosaic - fixed aspects of the footprint calculation, particularly
-fixing a bug that prevented footprints from being fully covered.
-
-Added -S option to mbprocess for debugging file status values used to
-determine whether processed data files are "out of date".
-
-Greatly improved mbnavadjust by adding a interim solution for a smooth
-navigation adjustment model fitting ties to fixed (immovable) data and
-by making all of the internal crossing and tie conventions consistent.
-MBnavadjust now outputs version 3.0 nvh project files, but will transparently
-read and translate earlier version nvh project files.
-
------> 5.1.3beta1829
-
-From now on beta releases will be named according to the corresponding
-source archive revision in the MB-System Subversion source code archive.
-This will allow us (and users) to more precisely track code changes relative
-to the beta releases.
-
-Fixed support of Reson 7k data (format 88) to work with MARUM
-AUV data. Includes changes to mb7kpreprocess.
-
-Fixed 64 bit issues with Simrad, Reson 7k, and L3 XSE data
-(formats 58, 59, 88, 94).
-
-Fixed 64 bit issues with mbnavedit, mbclean, and mbneptune2esf.
-
-Added buttons to MBedit to immediately go to the start or end of the data.
-
-Fixed sidescan beamwidths used by the Edgetech Jstar format i/o
-modules (formats 132 & 133).
-
-Fixed memory management errors in MBgrdviz and mbfilter.
-
-Fixed more 64 bit  and memory management issues in MBeditviz and MBgrdviz.
-
-Added a plot reset button and an ability to autoscale on unflagged soundings
-only in the MBeditviz 3D sounding cloud display.
-
-Fixed handling of site and route points far from the display view in MBgrdviz.
-
-Put actual (but still incomplete) text into the MBeditviz man page.
-
-Changed print format for unsigned long values from %ld to %lu to avoid copious
-warning messages in Ubuntu.
-
--------------------------------------------------------------------------------
-MB-SYSTEM VERSION 5.1.2 RELEASE NOTES:
--------------------------------------------------------------------------------
-
-Fixed pixel calculation algorithm in mbmosaic. Previously, sidescan
-data from each pixel were being treated as extending over a
-larger area than is correct.
-
-Ressurected program mbfilter with an new implementation. Allows
-low pass, high pass, and contrast enhancement filtering of amplitude
-and sidescan data. Implemented so that filtered data are stored
-in ancilliary files ending in *.ffa (amplitude) and *.ffs (sidescan).
-The data type selection options of mbswath, mbm_plot, and mbmosaic
-all now allow users to select filtered data.
-
-Improved handling current generation Simrad multibeam data (e.g.
-EM710, EM122) through formats 58 (MBF_EM710RAW) and 59 (MBF_EM710MBA).
-There still seems to be a problem with calculating the takeoff angles
-for recalculating bathymetry by raytracing, probably due to a problem
-interpolating the correct roll and pitch values.
-
-Changed processing kluge 004. Previously kluge 004 caused mbprocess
-to not output survey data with time stamps prior to the last good ping.
-Now the dropped data will have time stamps prior to or equal to that
-of the last good ping.
-
-Fixed problem reading and writing format 16 (MBF_SBSIOSWB) data on
-little-endian systems.
-
-Added support for new ROV Doc Ricketts navigation data as format 165.
-
-Added a Gaussian mean smoothing algorithm to MBnavedit. This is primarily
-intended for smoothing USBL or LBL based navigation of submerged platforms
-(e.g. ROVs or submersibles).
-
-Altered the install_makefiles perl script used to generate the makefiles
-during installation of MB-System. The install_makefiles script now
-automatically determines whether the local architecture is big or
-little "endian". Consequently, the "BYTESWAPPED" parameter no longer
-needs to be set in install_makefiles, and has been removed. The "GRAPHICAL"
-parameter has also been removed. Now, install_makefiles builds the
-graphical utilities only if the Motif libraries and header file
-location are specified with the MOTIFLIBs and MOTIFINCDIR parameters.
-Also, install_makefiles now allows users to specify the use of independent
-installations of the GSF and PROJ4 libraries. By default, the versions of
-these libraries distributed with MB-System will be built and used.
-
-Fixed bug in mbedit in which the view mode switched spontaneously after
-loading a new file and advancing the view buffer.
-
-Improved efficiency of attitude interpolation when reading Simrad multibeam
-data. This greatly improves the speed at which Simrad multibeam data files
-are read and processed.
-
-Fixed bug in mbm_grdplot which sometimes produces broken color tables.
-
-Updated GSF library code to GSF release 3.01.
-
-Fixed bug in EM710 support (format 59) involving netattitude datagrams.
-
-Changed licensing from GPL version 2 to GPL version 3.
-
------> 5.1.2beta07
-
-Fixed MB-System compatibility with GMT 4.5.0
-
-Fixed mbps memory handling.
-
-MBgrdviz now displays ping/shot numbers when navigation is picked.
-MBextractsegy now embeds line numbers into the output segy files.
-
------> 5.1.2beta08
-
-Fixed mbauvloglist to work with all MBARI AUV logs.
-
-Fixed mbm_route2mission so that the AUV mission segment duration always
-corresponds to the actual mission segment length.
-
-Added file locking to the mbprocess system. Now, when mbprocess starts
-working on a swath file, it creates a *.lck file parallel to the swath file
-and deletes the *.lck file when processing is complete. Other instances of
-mbprocess will skip a locked file. This allows users to run multiple instances
-of mbprocess on multiple machines on the same datalist structure. This
-crude sort of parallel processing can greatly speed up reprocessing of
-large datasets. This locking functionality will be extended to the processing
-tools mbedit, mbeditviz, and mbnavedit in the future.
-
------> 5.1.2beta09
-
-Fixed bug in SeaBeam 2112 support that misplaced some sidescan data
-on little-endian machines.
-
-Fixed the mbview library so that MBgrdviz will enable display of routes,
-sites, and navigation on all open windows when such data is loaded into
-one of the windows.
-
-Fixed cause of frequent MBgrdviz crashes when displaying multiple windows.
-
-Implemented timed background plotting in MBgrdviz so that full resolution
-displays automatically appear within a few seconds of the end of mouse
-interactions. Previously one had to click the "Full" button to get a full
-resolution view. At this point, the redisplay fails to happen occasionally.
-
-Greatly increased speed of reading third generation Simrad data (formats 58 & 59,
-EM710, EM302, EM122).
-
------> 5.1.2beta11
-
-Fixed mb7k2ss to avoid creating shadow zones in the extracted sidescan.
-
-Fixed support for dual-head Simrad EM3002 data (formats 56 and 57).
-
-Changed mbdatalist so that the -Z option (create datalistp.mb-1 datalist
-file referencing an input datalist with the $PROCESSED tag set) can be
-executed in conjunction with creating ancilliary files with the -O or
--N options.
-
------> 5.1.2beta12
-
-Updated proj library to 4.7.0 release. If the installing user chooses to
-use the proj distributed with MB-System, then the programs proj and geod
-will now be built and installed in the bin directory.
-
-Rooted through the entire codebase fixing obvious failure points for
-64-bit compilation. Most of the issues identified so far relate to
-storing address values in variables declared as "int".
-
-Completed moving the code base into subversion hosted at Lamont by
-first updating the subversion archive to 5.1.2beta11 and then committing
-the copious mods related to the 64-bit cleanup.
-
-Changed the suffix of the Perl source files in src/macros from
-".perl" to ".pl".
-
-Changed the section name for the MB-System man pages from "l" to "1"
-for programs and "3" for libraries and functions. This is in line with
-common practice and follows a similar change by GMT.
-
-Modified support for Edgetech JSTAR sidescan/subbottom files (formats 132 & 133)
-to work with a new data sample from GEOMAR. MB-System can now automatically
-distinguish between low frequency (132) and high frequency (133) sidescan
-data.
-
-Modified support for Reson 7k multibeams (format 88) to work with a
-new data sample from GEOMAR. Altered interpretation of initial beam quality
-flags, improving initial beamflags.
-
-Fixed problems with survey generation in mbgrdviz.
-
-Improved read-only support for XTF format Reson 8XXX data
-(format 84 MBF_XTFR8101), but still don't have time stamping of
-attitude data correct.
-
-Augmented edit save file format and beam flag handling in order to deal
-successfully with multiple head multibeams that produce multiple pings
-with identical time stamps. This affects mbprocess, mbedit, mbeditviz,
-mbclean, and mbareaclean.
-
-Added program mbotps to generate open ocean tidal models at specified
-times and locations using the Oregon State Tidal Prediction Software
-(OTPS) package. This program will build whether OTPS is installed or
-not, but will only work if the OTPS programs are installed and in the
-user's path. The OTPS predictions are based on global barotropic inverse
-tidal solutions obtained with OTIS and available for download at:
-     http://www.coas.oregonstate.edu/research/po/research/tide/
-
-Added program mbsegypsd to calculate sonograms from segy time series data.
-Sonograms are 2D displays of power spectral density (PSD) functions (y-axis)
-versus time (x-axis). One PSD is calculated for each trace in the segy file.
-This program requires linking with the FFTW (Fastest FFT in The West) package.
-
------> 5.1.2beta13
-
-Fixed many more issues relating to clean compiles on 64 bit machines.
-In particular, store GSF and netCDF data stream id's in their own
-int-size variables rather than a pointer-size FILE variable, and
-declare mbview instance parameters as size_t rather than int so that
-passing these values through Xt event notify function calls as pointer
-values is clean. Also changed casting of pointer values to long for
-debug printing so that the pointer values are now casted to size_t
-values. This should allow for compatibility with Windows 64 bit builds,
-as Windows 64 bit C has a different type model than the rest of the
-universe (e.g. long = 32 bit on Windows but long = 64 bit for gcc).
-
------> 5.1.2beta14
-
-Fixed a few more issues relating to clean compiles on 64 bit machines.
-We're iterating towards a working version by getting problem reports
-from people like Hamish Bowman, Bob Arko, and Bob Covill.
-
------> 5.1.2beta15
-
-Fixed EM3002 support to reliably detect whether data comes from a single
-or double head sonar (formats 56 & 57).
-
-Fixed problem with EM710 support (formats 58 & 59).
-
------> 5.1.2
-
-Incorporates all changes listed above.
-
-Fixed memory management bug for formats 56 and 57 (Simrad EM3002 etc).
-
--------------------------------------------------------------------------------
-MB-SYSTEM VERSION 5.1.1 RELEASE NOTES:
--------------------------------------------------------------------------------
-
-Fixed longstanding error in src/mbio/mb_angle.c in the application
-of roll and pitch angles. Previously, the pitch rotation was applied
-first, which is incorrect, but only produced obvious errors with
-large pitch values. Now roll is applied first, and the translation
-between sonar coordinates and raytracing coordinates is correct.
-
-Ping number, and more importantly for seismic data, shot number
-annotation of navigation tracks is now supported by mbm_grdplot.
-
-Improved handling of navigation plotting and annotation by
-mbcontour, mbm_plot, and mbm_grdplot. It is now easier to specify
-time, ping number, and filename annotation of navigation tracks.
-
-Major modifications have been made to MBnavadjust. MBnavadjust
-now picks offsets in z (depth) as well as x (longitude) and
-y (latitude). An autopicking algorithm has been implemented,
-and a display of the optimal navigation adjustment model added
-as well.
-
-The acrosstrack view of MBedit now shows the real alongtrack
-positions of the soundings.
-
-Fixed bug in mbsys_gsf.c that incorrectly calculated the alongtrack
-distance of sidescan samples in "snippet" sidescan data contained in
-GSF format (121) multibeam data. On occasion this bug produced
-egregiously wrong alongtrack values.
-
-Fixed bug in mbgrid that caused failure to write Arc Ascii grids
-with option -G4.
-
-Augmented i/o module for XSE format (94) to support current version
-of SeaBeam 2112 sonars on WHOI ships. This data format now has
-an MB-System extension to its multibeam records that includes
-interpolated navigation values. Previously only asynchronous
-navigation was handled.
-
-Fixed bug in old Simrad i/o module regarding EM121A data.
-
-Added prototype of MBeditviz, a tool that combines 3D bathymetry
-editing and patch test capability.
-
-MBeditviz can be started from MBgrdviz. Any selected files (using
-navigation selection) will be loaded.
-
-Fixed further issues with the XSE format i/o module.
-
-Added swath file copy function to mbdatalist.
-
-Fixed calculation of grazing angles in mblist by adding sonar
-depth to the calculation.
-
-Added some additional large format page sizes to the plot macros
-mbm_plot, mbm_grdplot, mbm_grd3dplot, mbm_xyplot, and mbm_histplot.
-
-Added mblist capability to output tables using column delimiters
-other than tabs (e.g. commas to make csv files).
-
-Modified mbnavedit so that any nav points that repeat previous lon
-and lat values will be automatically flagged as bad.
-
-Fixed footprint calculation in mbmosaic, correcting problems in
-sidescan mosaic creation.
-
-Altered mbm_utm to work with comma delimited input data as well as
-white space delimited data.
-
-Updated proj library to current version 4.5.0.
-
-Updated gsf to the current version 2.07.
-
-Sidescan extracted from MBARI Mapping AUV data can now be laid out
-on a topography grid rather than laid out with a flat bottom
-assumption (mb7k2ss).
-
-The sidescan and amplitude correction scheme (mbbackangle & mbprocess)
-can now use a topography grid to calculate grazing angles.
-
-Altered several programs so that sidescan data can have valid zero or
-negative values. Stopped applying a shift to Simrad sidescan and amplitude
-values to force them to be positive.
-
-Added decimation feature to mblist, mbnavlist, and mbsegylist. Also added
-and/or fixed the delimiter, segment, and binary output features for all
-three listing programs.
-
-Added mbcopy capability to merge bathymetry and beam flags from a third
-"merge" swath file. This is a Gordon Keith contribution.
-
-MB-System programs will now recognize filename suffixes of the form
-".MB***" as well as ".mb***". Capitalized versions of many vendor
-format suffixes are also supported.
-
-Fixed error in mblist manual page.
-
-Fixed mbswath handling  of time gap errors that made plotting of
-single beam data problematic.
-
-Fixed problem with processing mgd77 data. Can now use mbedit to process
-single beam echosounder bathymetry.
-
-Made checking for data min maxes and bounds more robust to improve
-parsing through large databases.
-
-Added some generic gain values to mblist as part of the "raw" list.
-To do this, added mb_gains() function to MBIO. This is currently
-defined for SeaBeam 2112, Simrad, and Reson 7k multibeams.
-
-Added new program mbabsorption to calculate the sound absorption of
-seawater as a function of salinity, pH, temperature, depth, and
-frequency.
-
-Changed macro mbm_grdplot so that the -T option causes the coastline
-to be drawn without grayscale filling of dry areas. To obtain the
-previously default behavior, add -MTG128.
-
-Added support for newer Simrad multibeam data (e.g. EM710) in
-vendor format MBF_EM710RAW (format id 58) and processing
-format MBF_EM710MBA (format id 59)
-
-Updated format MBF_OMGHDCSJ (151), which supports the John Hughes
-Clark HDCS (SwathEd) format, to handle all of John's "version 3"
-data. John's "version 4" format is not yet supported.
-
-Added calculation and use of three dimensional covariance in
-the xyz nav offsets used by mbnavadjust.
-
-Added processing kluge006 to mbprocess. This "kluge" allows users to
-change the sonar draft value without changing the calculated bathymetry.
-This fixes a problem in which Atalante Simard data were exported by
-Caris into GSF with an incorrect sonar draft.
-
-Added program mbtime to allow command line conversion between calendar
-times and unix time values.
-
-Fixed mbprocess so that changes to the sonar depth/draft derived from
-mbnavadjust are output to the processed data. Previously the bathymetry
-was corrected, but not the sonar depth/draft.
-
-Fixed formats 58/59 to support EM302, EM122 in addition to EM710. Also
-supported "network attitude" datagram as source of attitude.
-
-Changed mbnavadjust inversion to use simplistic iterative relaxation
-rather than a full matrix solver. This targeted solver is faster and
-avoids some bad behavior around survey starts and ends.
-
-Fixed mbedit scaling for swath widths less than 6 m.
-
-Added formats 191 and 192 to support Imagenex Delta T multibeams.
-Format 191 supports the 83P vendor format and format 192 is an
-extended processing format. This format also supports data from
-the Odom ES3 multibeam sonar.
-
-Lengthened filename char arrays in mbedit, mbnavedit, and mbvelocitytool
-to prevent possible overflows with large paths.
-
-Updated the GSF code to new GSF version 2.09
-
-Fixed support of UNB OMG HDCS format 151 to handle situation where
-ancillary sidescan files are missing.
-
-Added new program mbctdlist to allow mblist style text output of
-CTD data from swath files. Initially relevant only to Reson 7k format data.
-
-Applied patches to mbgrid and mbmosaic to handle lonflipping of bounds in
-projected coordinates.
-
-Added format 26 to support Hydrosweep DS data format used by SOPAC.
-
-Fixed support for EM302 sonars.
-
-Augmented mbgrid footprint gridding algorithm. When used with the -F5
-option, mbgrid now does a first pass, low resolution grid to provide
-a local slope estimate. During the second pass, final gridding,
-individual beam footprints are tilted to reflect the local slope,
-increasing the high-resolution fidelity of the resulting topographic
-model.
-
-Enhanced the patch test capability of mbeditviz. MBeditviz can now be
-used to model time lag as well as roll, pitch, and heading bias. In order
-to use the time lag function, users must place files parallel to each
-swath file containing time series of attitude, heading, and sonardepth.
-These files contain the full asynchronous times series for heading,
-sonardepth, roll, and pitch and the synchronous time series for roll
-and pitch (asynchronous means the raw sensor data sampled more frequently
-than the sonar ping rate, and synchronous means the sensor data sampled
-at ping times).
-Each time series file uses epoch times in seconds as the first column.
-These files are:
-	*.ath - asynchronous heading - time heading
-	*.ats - asynchronous sonardepth - time sonardepth
-	*.ata - asynchronous attitude - time roll pitch
-	*.sta - synchronous attitude - time roll pitch
-Asynchronous data are not available in all formats. When available, the
-asynchronous data can be extracted using mbnavlist. The synchronous
-attitude can be extracted using mblist.
-
-Added support for EM12D data in the Caraibes netcdf form as format 76.
-Contributed by Gordon Keith.
-
-Removed a number of obsolete programs and macros from the distribution.
-The following are no longer distributed with MB-System:
- 	mbanglecorrect
- 	mbbackangleold
- 	mbbath
- 	mbcleanold
- 	mbeditold
- 	mbfilter
- 	mbgetmask
- 	mbmask
- 	mbmerge
- 	mbm_dslnavfix.perl
- 	mbm_fmtvel.perl
- 	mbm_vrefcheck.perl
- 	mbm_rollerror.perl
- 	mbnaveditold
- 	mbsmooth
- 	mbtide
- 	mbunclean
-
--------------------------------------------------------------------------------
-MB-SYSTEM VERSION 5.1.0 RELEASE NOTES:
--------------------------------------------------------------------------------
-
-The version 5.1.0 release of MB-System contains both bug fixes
-and new capabilities relative to the 5.0.9 release.
-
-A typo in the mbgrid man page was fixed.
-
-A catastrophic error in the i/o module for the MBF_ASCIIYXZ
-format was fixed.
-
-The proj library was updated to use code from the Proj 4.4.9 release.
-
-The proj and GSF libraries internal to MB-System have been
-renamed libmbproj and libmbgsf to avoid name conflicts with
-proj and gsf in package managers like fink for MacOsX.
-
-Fixed mbprocess problem with per-beam heave values when applying
-rotational bathymetry correction - previously did not initialize
-heave values for non-null but flagged beams.
-
-A minor change to mbbackangle to output the slope correction
-status (-Q) in the coments in the output file.
-
-Altered mbbackangle so that it outputs at least one table,
-even if there are no survey pings in a file. This prevents
-mbprocess from failing on data files with no survey pings.
-
-Also altered mbbackangle so that it outputs a single global
-correction table based on all of the input data. This can
-be used for uniform correction of sidescan and amplitude
-data.s
-
-A new program mbrolltimelag calculates the cross-correlation
-between roll data and the difference between the seafloor
-slope and the roll. If there is a time lag in the roll data,
-then the two series should have a cross correlation maximum
-at a nonzero time lag.
-
-New macro mbm_histplot for simple histogram plots.
-
-MBgrdviz now has a profile display capability. Profiles can
-be displayed and exported from two point picks, selected routes,
-and selected navigation. The profile view is enabled from the
-view menu.
-
-Fixed problems with output of ESRI ARC ascii grids from
-mbgrid and mbmosiac.
-
-Added interactive control over the target of precision of the
-navigation inversion in MBnavadjust.
-
-Added output of Winfrog pts file to mbm_route2mission.
-
-Added output of Winfrog pts file to mbgrdviz.
-
-MBedit now automatically chooses appropriate acrosstrack and
-vertical annotation intervals when files are opened.
-
-MBextractsegy now will extract subbottom data to segy files
-in sequential line files based on waypoints in a route file.
-The program generates a plotting shellscript that will in
-turn generate profile plots of the segy data. Long lines will
-be broken up into multiple plots.
-
-Updated manual page for mbm_route2mission.
-
-A bug in mbgrdtiff has been fixed that mislocated the geoTIFF
-images by 1/2 pixel, thanks to Gordon Keith.
-
-The plotting macros mbm_plot, mbm_grdplot, mbm_xyplot,
-mbm_3dgrdplot, and mbm_histplot all now use the current
-GMT default parameter PLOT_DEGREE_FORMAT rather than
-the old DEGREE_FORMAT.
-
-Upgraded the mbsystem/gsf code to GSF version 2.0.4. Since the
-libgsf code now has #ifdef statements allowing compilation
-under MacOSX, the code contained in MB-System no longer has
-modifications relative to the generic GSF releases.
-
-Added support for Simrad EM710 data in formats 56 and 57.
-
-Fixed byte count problem with comment records in format 94 (XSE data).
-
-Added GMT_end() calls to all programs calling gmtlib and pslib functions
-so that GMT "advisory file locking" does not system() calls to GMT programs.
-
-Put (void *) casts into qsort() calls to avoid compiler warnings.
-
-The macro mbm_grdplot now handles calls for a linear plot with
-decreasing x values (e.g. using -Jx-0.01/20 to specify the projection).
-
-A new edit mode called "grab" has been added to MBedit. In this
-mode, the user drags a rectangle on the ping display. When the mouse
-is released, all unflagged beams within that rectangle are flagged.
-
-All MB-System programs that read or write grids have been altered
-so that they will work with GMT 4.1.3 built in the default fashion
-(i.e. GMT built with "advisory file locking" enabled).
-
-Fixed mbgrdtiff so that it creates geographic GeoTIFF images with
-the longitude bounds consistent with the user's default or
-specified lonflip value.
-
-MBlist can now print out values associated with the port-most and
-starboard-most non-null beams and pixels. Use the special '=' or '+'
-characters in the -O option.
-
-Support was added for a new MBARI ROV navigation format (format id 170)
-
-Support was added for SEGY seismic data as single beam format (id = 160).
-Heading values are stored in an unused space in the trace header - this
-is an MB-System specific modification that will only be found in segy
-files generated by mbextractsegy.
-
-Ping number, and more importantly for seismic data, shot number
-annotation of navigation tracks is now supported by mbcontour and
-mbm_plot.
-
-Fixed problem reading some Simrad multibeam data with slightly broken
-bathymetry records.
-
--------------------------------------------------------------------------------
-MB-SYSTEM VERSION 5.0.9 RELEASE NOTES:
--------------------------------------------------------------------------------
-
-The version 5.0.9 release of MB-System is purely a bug fix
-release, and includes only a few changes relative to the 5.0.8
-release.
-
-The macros mbm_grdtiff, mbm_grd2arc, mbm_grd3dplot, mbm_grdinfo,
-mbm_grdtiff, mbm_grd2geovrml, and mbm_grdcut have been fixed to
-work properly with the output of the GMT 4.1 version of grdinfo.
-
-The code in src/mbio/mb_swap.c has been fixed so it will compile
-using the Solaris cc compiler.
-
-MBprocess had been fixed so that it will read navigation
-formats using julian days properly.
-
-MBnavedit has been altered so that speed and acceleration weighting
-values in the smooth inversion function can be less than 1.0.
-
-
--------------------------------------------------------------------------------
-MB-SYSTEM VERSION 5.0.8 RELEASE NOTES:
--------------------------------------------------------------------------------
-
-The version 5.0.8 release of MB-System includes several changes
-relative to the 5.0.7 release.
-
-MB-System 5.0.8 requires GMT 4.1 in order to build successfully.
-
-The format 75 (MBF_MBNETCDF) i/o module has been altered to
-handle multiple pings with the same time stamp without breaking
-the beam edit (edit save file) scheme, which depends upon
-unique time stamps. When multiple pings with the same time
-stamp are encountered, the subsequent pings have multiples
-of 2 msec added so that each has a detectably unique time
-stamp. This issue relates to Thompson Seafalcon II multibeam
-data; this sonar collects five simultaneous acrosstrack swathes.
-Since this is a deep water sonar, the maximum 10 msec time
-addition should not introduce excessive error in navigation
-or other aspects of the data.
-
-The Edgetech Jstar format is now supported through the new
-MB-System formats 132 and 133. The Jstar format is relevant
-to Edgetech FSDW systems (and related sonar products). The
-FSDW systems include chirp subbottom profiler and dual
-frequency chirp sidescan sonar. Format 132 treats the low
-frequency sidescan as survey data, and format 133 treats
-the high frequency sidescan as survey data.
-
-Incorrect trace scaling of subbottom and sidescan data
-in the Reson 7k format (format 88) has been fixed.
-
-A new program called mb7k2jstar has been added that extracts
-Edgetech subbottom and sidescan data from Reson 7k format (88)
-files and writes that data in Edgetech Jstar (132/133) format
-files.
-
-The comments in the install_makefiles script has been updated
-to show the correct parameters needed to build MB-System on
-a current Solaris system.
-
-A feature to apply longitude and latitude offsets to navigation
-data has been added to MBnavedit.
-
-The program mbextractsegy can now extract subbottom profiler
-data in segy format from both Reson 7k files (format 88) and
-Edgetech Jstar files (formats 132 and 133).
-
-MBprocess kluge005 has been defined to cause survey data
-timestamps to be replaced by the timestamps of the corresponding
-merged navigation records. This allows timestamps fixed using
-MBnavedit to be inserted into processed data.
-
-The program mbsegygrid can now apply a simple time-varying
-gain to traces before gridding. This gain may begin at either
-the start of each trace or at the seafloor arrival time. The
-user may also set the length of time the gain is applied;
-samples after the end of the gain window are zeroed.
-
-The method for determining the best altitude value to be used
-in correcting amplitude and sidescan data has been improved
-in programs mbbackangle and mbbprocess.
-
-The program mbgrid once again uses the Zgrid algorithm for
-thin plate spline interpolation. The code allows for the GMT
-Surface algorithm to be used instead by compiling with a
--DUSESURFACE compile flag.
-
-The macros mbm_grdplot and mbm_grd3dplot have been altered so
-that histogram equalization will work even if grdhisteq returns
-a smaller number of valid intervals than requested.
-
-The capability of plotting amplitude vs. grazing angle histograms
-from mbbackangle results has been fixed for sidescan data.
-
-A further significant architectural change was implemented for  release
-5.0.8  in  order  to support data formats that have no explicit maximum
-number of beams or pixels. The memory management of arrays used to hold
-bathymetry,  amplitude,  and  sidescan data has been made dynamic. Now,
-when data records are encountered that include larger numbers of  beams
-or  pixels  than  will  fit  in  the arrays previously allocated, those
-arrays are reallocated to the required size. This is handled  automati-
-cally for all of the internal arrays used by MBIO functions. Of course,
-applications using MBIO must  allocate  arrays  that  are  passed  into
-functions  like  mb_read, mb_get_all, and mb_get to be populated by the
-desired data. In order for these arrays to be managed dynamically,  the
-application  must  first register each array by passing the location of
-the array pointer to a new function called mb_register_array.
-
-The program MBgrdtiff has been altered so that the geoTiff images
-produced are more generally portable.
-
-A program called mbrolltimelag has been written to analyze attitude
-time lag. This macro extracts raw attitude and apparent slope values
-from multibeam data, and then calculates the cross correlation between
-roll and apparent slope over a specified range of time lags. If there
-is a an attitude time lag, then the bathymetry collected over a planar
-bottom should be dominated by a jitter that is correlated, with a time
-lag, with the roll signal.
-
-The format 56 (vendor Simrad multibeam format) i/o module has been
-altered to support data logged on byteswapped platforms (e.g. Windows
-Intel PC's.). The Simrad multibeam formats 56 and 57 now support
-recently introduced raw angle/range and water column imagery datagrams.
-These i/o modules also now handle cases where the beams listed in a
-sidescan datagram do not exactly match the beams listed in the corresponding
-bathymetry datagram differently than before. Previously the entire
-ping would have been dropped. Now, the ping is preserved but the raw
-sidescan samples are not used to generate binned sidescan.
-
-The program mbdatalist has been augmented to allow users to easily identify
-some problems with swath data files and the processing parameters
-specified in parameter files. The -n and -o options are used to generate
-ancillary files for all swath files referenced through a recursive datalist
-structure. These options now invoke mbinfo with the -n option, causing
-the "inf" files to include listings of easily identified data problems.
-The -q option of mbdatalist now extracts and lists these data problems
-as well as problems with the processing parameters.The possible data problems
-include:
-        No survey data found
-        Zero longitude or latitude in survey data
-        Instantaneous speed exceeds 25 km/hr
-        Average speed exceeds 25 km/hr
-        Sounding depth exceeds 11000 m
-        Unsupported Simrad datagram
-To populate the "inf" files of existing datalist structures with data problem
-notices, use mbdatalist with the -n option.
-
-The program mbvelocitytool now allows users to interactively set the
-center as well as the range of the water sound speed model plot window.
-
-Fixed mbm_plot so that it calculates reasonable plot bounds at high
-latitudes.
-
-The program mbset now accepts '=' as well as ':' as separators between
-parameter names and values in -P option arguments (as suggested by
-Bob Covill).
-
-The install_makefiles script has been altered so that the editable
-parameters are located towards the top of the file rather than below
-the documentation of example settings for different operating systems.
-
-The program mbareaclean now incorporates a mean filter as well as a
-median filter (contributed by Gordon Keith).
-
-The program mbmosaic will now mosaic grazing angle or acrosstrack slope as
-well as amplitude or sidescan data (contributed by Gordon Keith).
-
-The program mblist will now output some format specific values from
-Simrad multibeams (formats 56 and 57). In particular, some
-system parameters, raw amplitude values, and raw sidescan samples
-may now be output (Contributed by Gordon Keith).
-
-A new macro called mbm_makedatalist can easily generate a datalist
-referencing all identifiable swath files in a specified directory.
-
-There is a known but not understood bug in MBnavedit. When built on
-SUSE 10 systems, use of the smooth inversion function causes the first
-line of the output edited navigation to have NaN values for the
-longitude and lattitude.
-
--------------------------------------------------------------------------------
-MB-SYSTEM VERSION 5.0.7 RELEASE NOTES:
--------------------------------------------------------------------------------
-
-The version 5.0.7 release of MB-System includes several changes
-relative to the 5.0.6 release.
-
-MBprocess and MBset now support merging sonar depth
-(or draft) from separate time series files. This is
-controlled by the SONARDEPTHMODE, SONARDEPTHFILE,
-and SONARDEPTHFORMAT mbprocess parameters.
-
-A bug in mbgrid has been fixed that affected the footprint
-gridding algorithm used with bathymetry from sonars on
-submerged platforms.
-
-MBedit has new view options. The default is the the
-traditional waterfall view. Users may now also view the
-soundings from an alongtrack view perspective and an
-acrosstrack view perspective without static vertical
-offsets between pings. The view mode is controlled from
-the View menu and from keyboard macros (characters '2',
-'3', and '4').
-
-The 5.0.6 release mistakenly left the code in mbr_em300raw.c
-in debug mode, causing copious stderr output when reading
-raw Simrad data (format 56). This has been corrected.
-
-Problems with the output in debug mode of mbr_em300raw.c and
-mbr_em300mba.c have been fixed.
-
-The handling of the tickinfo string in the plot macros
-mbm_plot, mbm_grdplot, mbm_grd3dplot, and mbm_xyplot have
-been fixed.
-
-The orientation of the filename annotation by mbcontour
-has been fixed, and control over that orientation has been
-added to mbcontour and mbm_plot.
-
-Fixed problem of uninitialized data in mbr_mbpronav.c.
-
-Fixed problem with occasional incorrect scaling of sonar
-depth in mbldeoih format (71) data.
-
-Fixed problem in which sonar depth could be calculated
-from implausible pressure values in some single beam
-or navigation formats.
-
-Improved handling of interpolated asynchronous data,
-especially sonar depth, in Reson 7k data (format 88).
-
-A capability to interpolate over repeated values was added
-to mbnavedit.
-
-Fixed a problem with the beam footprint gridding algorithm
-in mbgrid that caused beam footprints to be miscalculated
-for submerged sonars.
-
-Fixed MBgrdviz crashes related to route data by fixing
-problem with allocation and deallocation of route
-arrays in the mbview library.
-
-Moved tide correction to end of processing tasks so that
-it doesn't mess up grazing angle calculations for amplitude
-and sidescan correction.
-
-Added option to mbm_grdplot allowing the user to specify
-a separate grid file to be contoured. This code was
-contributed by Gordon Keith.
-
--------------------------------------------------------------------------------
-MB-SYSTEM VERSION 5.0.6 RELEASE NOTES:
--------------------------------------------------------------------------------
-
-The version 5.0.6 release of MB-System includes several changes
-relative to the 5.0.5 release.
-
-The man page for mbprocess has been updated with full
-documentation of the navigation formats supported for
-merging by mbprocess.
-
-The merging of heading and attitude data from navigation files
-has been fixed.
-
-The ability to merge attitude data from a separate file
-has been added to mbprocess, and the mbprocess and mbset
-man pages have been updated.
-
-A problem producing ascii grids from mbgrid and mbmosaic
-has been identified, and a fix suggested by Gordon Keith
-adopted.
-
-A problem with the -D option of mblist has been identified,
-and a fix suggested by Gordon Keith adopted.
-
-A new program called mbneptune2esf has been contributed by
-Gordon Keith. MBneptune2esf  imports manual data flagging
-performed using Simrad's NEPTUNE software and flags those
-beams  in  the corresponding MB-System files.
-
-A new program called mbauvnavusbl has been added to the
-distribution. MBauvnavusbl reads a primary navigation file
-(usually from a submerged platform swath survey) and also
-reads secondary navigation (e.g. USBL fixes).  The program
-calculates position offsets between the raw survey navigation
-and the secondary navigation every 3600 seconds (10 minutes),
-and then linearly interpolates and applies this adjustment
-vector for each primary navigation position. The adjusted
-navigation is output.
-
-The ability to annotate tracklines on swath plots with
-the swath filenames has been added to mbm_plot and
-mbcontour. The annotation occurs at the beginning of the
-data associated with each file. This option can be used
-most simply by specifying -NF in mbm_plot. The suggestion
-and initial implementation were contributed by Gordon Keith.
-
-A problem with setting file paths in parameter files in
-the different directories associated with recursive
-datalists has been fixed. The nature of and fix to this
-bug were determined by Gordon Keith.
-
-Fixed makefiles to link libpsl.a with all programs making
-libgmt.a calls. This was necessitated by changes to the
-GMT4.0 release relative to the GMT4.0beta release.
-
-Implemented latest GSF release (2.0.3).
-
-Fixed, but not satisfactorily, a problem reading some older
-EM3000 data with the current format 56 i/o module.
-
-Added release version of simple grid visualization demo
-mbgrdviz.
-
-Improved the ability of mbgrid to embed background
-datasets.
-
--------------------------------------------------------------------------------
-MB-SYSTEM VERSION 5.0.5 RELEASE NOTES:
--------------------------------------------------------------------------------
-
-The version 5.0.5 release of MB-System includes several changes
-relative to the 5.0.4 release.
-
-The program mbgrid can now obtain background data from GMT grid
-files using grd2xyz as well as through raster databases using
-grdraster. See the -Kbackground option documentation in the
-mbgrid manual page.
-
-The macro mbm_xbt has been substantially updated.
-
-The -G option of mbinfo now avoids reporting zero starting
-positions (it always ignored zero positions for the reported
-data bounds).
-
-Provides read-only support for Edgetech sidescan and subbottom
-profiler data in the new Reson 6046 format (format id 88).
-
-A new program mbextractsegy allows for the extraction of
-subbottom profiler data into separate files in the SEGY
-format (this can apply only to data formats that incorporate
-subbottom data in with swath sonar data, and at present only
-supports format 88).
-
-A new program mbsegyinfo is a utility for reading a segy
-format seismic data file and outputting some basic statistics.
-The table generated shows the filename, data counts, navigation
-totals, time and navigation of the first and last data records,
-minimum and maximum data values, and the geographic bounding box
-of the data.
-
-A new program mbsegylist is a utility to output specified
-header values from segy seismic data files to stdout.
-The option -Ooutput_format is used to control the type and
-order of values output. By default, mbsegylist produces
-ASCII files in spreadsheet style, with data columns separated by
-tabs. Alternatively, the output can be binary, with each field
-represented as a double precision float (-A option).
-
-A new program mbsegygrid generates grids from subbottom
-profiler data (and seismic reflection data, and potentially
-other seismic data) in the SEGY format. These grids can then
-be displayed using GMT (through mbm_grdplot if desired).
-
-The program mbm_plot now works properly when start and end times
-are specified using the -MMB and -MME options.
-
-A bug involving the handling of edit save filenames by mbset and
-mbprocess has been fixed.
-
-Errors in handling Simrad datagrams and edit save files on
-byteswapped  machines (e.g. Intel or AMD processors) have been
-fixed.
-
-The program mbdatalist has a new option -Z which causes a
-standard "datalistp.mb-1" file to be created. This is a
-convenience file that applies the $PROCESSED flag to be
-applied to the swath files referenced in a datalist named
-"datalist.mb-1".
-
-Problems with the creation of amplitude vs. grazing angle
-correction tables using mbbackangle, and the use of those
-tables by mbprocess, have been fixed. The default settings
-for mbbackangle and amplitude vs. grazing angle correction
-by mbprocess have been changed.
-
-The default angle mode for raytracing has been changed so
-that starting angles are adjusted using Snell's Law for the
-difference between the SSV and the initial depth in the SVP.
-This change affects mbvelocitytool, mbsvplist, mbset, and
-mbprocess.
-
-The program mbsvplist now has an option -P that not only
-outputs SVPs in a swath file to individual ancillary SVP
-files (as with the -O option), but also sets the first SVP
-output file to be used by mbprocess to recalculate the
-bathymetry.
-
-Problems with the MGD77 format i/o module have been fixed
-according to suggestions from Bob Covill.
-
--------------------------------------------------------------------------------
-MB-SYSTEM VERSION 5.0.4 RELEASE NOTES:
--------------------------------------------------------------------------------
-
-The version 5.0.4 release of MB-System includes several changes
-relative to the 5.0.3 release.
-
-All of the interactive tools (MBedit, MBnavedit, MBvelocitytool,
-MBnavadjust) have been changed to require linking with the Motif 2.0
-or later library (or compatible open source versions such as OpenMotif
-or LessTif).
-
-The MB-System distribution is now compatible with GMT 4.0b. There have
-been minor changes to the pslib and gmtlib APIs, so it is necessary
-to specify the linked version of GMT in the mbsystem/install_makefiles
-script. Set:
-	$GMTVERSION = "4.0";
-if you are using GMT 4.0b, or set:
-	$GMTVERSION = "3.4";
-if you are still using GMT 3.4
-
-MBnavadjust has a significant new feature in which the contours
-displayed by the Nav Err window can be pre-generated. This greatly
-increases the speed with which the bathymetry crossings can be
-analyzed.
-
-A "Flag View" feature has been added to MBedit, allowing users to
-flag all of the beams in the current display. Key macros have also
-been defined for both the "Flag View" and "Unflag View" buttons.
-
-The raw Hydrosweep DS format (format 21) i/o module now estimates
-travel times from the bathymetry when data files lacking travel time
-records are read. This allows users to recalculate bathymetry by
-raytracing even if the travel times are not recorded.
-
--------------------------------------------------------------------------------
-MB-SYSTEM VERSION 5.0.3 RELEASE NOTES:
--------------------------------------------------------------------------------
-
-The version 5.0.3 release of MB-System includes two bug fixes
-relative to the 5.0.2 release.
-
-We have fixed a bug in the i/o modules for Simrad multibeam
-data (formats 56 and 57) that caused a failure to gracefully
-handle unsupported datagrams on byteswapped systems (e.g.
-Intel processors running Linux).
-
-We have fixed a bug that caused edit save files to be incorrectly
-read on byteswapped systems (e.g. Intel processors running Linux).
-
-We have fixed a bug in the i/o modules for binary SeaBeam 2100
-data (formats 42 and 43) that caused data to be written incorrectly
-on byteswapped systems (e.g. Intel processors running Linux).
-
--------------------------------------------------------------------------------
-MB-SYSTEM VERSION 5.0.2 RELEASE NOTES:
--------------------------------------------------------------------------------
-
-The version 5.0.2 release of MB-System includes two bug fixes
-relative to the 5.0.1 release.
-
-We have fixed a bug in the i/o module for Elac Bottomchart data
-in the XSE format (94) in which the sonar depth was added to
-bathymetry values when new data files were written.
-
-We have also fixed problems related to reading and writing
-SeaBeam 2100 data in the binary formats 42 and 43.
-
--------------------------------------------------------------------------------
-MB-SYSTEM VERSION 5.0.1 RELEASE NOTES:
--------------------------------------------------------------------------------
-
-The version 5.0.1 release of MB-System includes two bug fixes
-relative to the 5.0.0 release. The program mbgrid has been
-fixed so that it compiles correctly under Red Hat Linux. The
-program mbcopy has been fixed so that time and space bounds
-are successfully applied to pings with a time gap error.
-
-Also, the distribution now has a top directory name of mbsystem-5.0.1
-rather than just mbsystem. This will allow users to unpack the
-distribution in the target location without overwriting an existing
-older MB-System installation. Users can then rename the directory to
-mbsystem or create a soft link to mbsystem-5.0.1 named mbsystem
-(e.g. ln -s mbsystem-5.0.1 mbsystem).
-
--------------------------------------------------------------------------------
-MB-SYSTEM VERSION 5.0.0 RELEASE NOTES:
--------------------------------------------------------------------------------
-
-The version 5.0 release of MB-System includes a number of
-changes and improvements relative to the version 4 releases.
-The most significant changes include:
-
-A new approach to managing data processing.
-- Many tools - one output file.
-    In previous versions of MB-System, each processing
-    program read an input swath data file and
-    produced an output swath data file. This "serial"
-    processing scheme generally produced a large number of
-    intermediate data files. MB-System version 5.0 features the
-    integration of the editing and analysis tools with a single
-    program, mbprocess, that outputs processed data files. The
-    new "parallel" processing scheme covers bathymetry data
-    processing, but does not yet incorporate the sidescan
-    processing capabilities. All of the old tools and
-    capabilities are still part of the distribution.
-- Recursive datalists.
-    The lists of data files used by gridding and plotting
-    programs can now be recursive, making it simpler to manage
-    data from many different surveys.
-- Automatic format identification.
-    MB-System programs will now attempt to automatically
-    identify the swath data format based on the filename suffix.
-- Extended inf files.
-    Users can generate inf files by directing the output
-    of mbinfo to a file named by adding an
-    ".inf" suffix to the swath data file name. Several programs
-    can parse inf files, if they exist, to quickly obtain data
-    locations or ranges. This feature speeds operations such as
-    gridding, mosaicing, and automated plotting.
-
-New tools.
-- mbnavadjust.
-    This new tool allows users to adjust poorly
-    navigated surveys by matching features in overlapping
-    swathes. It is particularly useful for processing surveys
-    conducted from submerged platforms.
-- mbprocess.
-    This new tool performs a variety of processing
-    tasks and produces a single output processed swath data
-    file. The program mbprocess can apply bathymetry edits from
-    mbedit and mbclean, navigation edits from mbnavedit, sound
-    velocity profile changes from mbvelocitytool, and a variety
-    of other corrections.
-- mbset.
-    This new tool allows users to create and modify the
-    parameter files used to control the operation of mbprocess.
-- mbdatalist.
-    This new tool allows users to list the files referenced by
-    a recursive datalist structure. It can also be used to create
-    the ancillary ".inf", ".fbt", and ".fnv" files for all of the
-    data files referenced in a recursive datalist structure.
-- mbsvplist.
-    This new tool lists water sound velocity profiles embedded in
-    swath data files, creating secondary files that  can be read
-    into MBvelocitytool.
-- mbareaclean.
-    This new tool identifies and flags artifacts in swath sonar
-    bathymetry data within a specified area of interest. The area
-    is divided into a grid with square cells or bins, and the
-    data are grouped according to these bins. Once all of  data
-    are read, statistical tests are applied  to the soundings
-    within each bin.
-
-Improved bathymetry and navigation editors.
-- MBedit and MBnavedit now swallow data files whole rather than
-    reading in limited size buffers.
-- MBedit now outputs beam edit events rather than an entire swath
-    file. The edits are applied by MBprocess.
-- MBnavedit now outputs the edited navigation rather than an entire
-    swath file. The edited navigation is merged using MBprocess.
-- Both editors show the position of the currently displayed data
-    within the entire data file.
-- MBnavedit has two navigation modeling modes relevant to swath
-    data collected using poorly navigated ROVs and towfishes. One
-    mode applies a dead reckoning model with interactively set drifts,
-    and the other involves inverting for an optimally smooth
-    navigation by penalizing speed and acceleration.
-
-Support for Projected Coordinate Systems
-- MB-System now incorporates the source code for the PROJ.4
-    Cartographic Projections library, providing support for
-   (apparently) all commonly used geodetic coordinate systems.
-    PROJ.4 was developed by Gerald Evenden (then of the USGS),
-    and was obtained from the www.remotesensing.org website.
-- A large number of commonly used projected coordinate systems
-    (e.g. UTM) are defined in a file (mbsystem/share/projections.dat)
-    distributed with MB-System. These include all of the standard
-    UTM zones, all of the standard state plate coordinate systems,
-    and most of the European Petroleum Survey Group (EPSG)
-    coordinate systems (also including UTM).
-- MB-System can now handle swath data that is navigated in a supported
-    projected coordinate system. In particular, data files that are
-    navigated with UTM eastings and northings instead of longitude and
-    latitude can now be plotted and processed with MB-System.
-- The programs mbgrid and mbmosaic can now output grids and mosaics
-    in any of the projected coordinate systems specified in
-    mbsystem/share/projections.dat.
-- The TIFF  images generated with mbm_grdtiff and mbgrdtiff
-    now fully conform to the GeoTIFF standard, providing that the
-    source grids or mosaics were generated using mbgrid or mbmosaic
-    in either Geographic coordinates, UTM coordinates, or any of the
-    EPSG coordinate systems specified in the projections.dat file.
-    This means, for instance, that GeoTIFF images generated  with
-    mbgrdtiff will be properly georeferenced when they are
-    imported into ESRI ArcGIS or other GIS packages.
-
-Restructuring the code.
-- All of the C code now conforms to the ANSI C standard.
-- The underlying input/output library (MBIO) has been
-    substantially rewritten. The structure has been streamlined,
-    simplifying both future development and support of the
-    existing code. The MBIO API has been greatly modified.
-
-Handling of old Simrad multibeam data.
-- Vendor format data from the old Simrad multibeams (pre-
-    1997 sonars) are now supported by a single format id (51)
-    rather than a separate format id for each sonar model. The
-    old format id's are automatically aliased to 51, so existing
-    shellscripts will continue to work.
-- Sidescan data from old Simrad multibeams (pre-1997 sonars)
-    are now handled in the same manner as data from the newer
-    sonars (e.g. EM3000, EM3000, EM120). The raw samples in the
-    vendor data format are binned, averaged, and interpolated
-    into a 1024 pixel sidescan swath. This binned sidescan is
-    not saved in the vendor format, so it is recommended that
-    the data be copied to an extended format (57) that stores
-    both bathymetry beam flags and processed sidescan. Format 57
-    is also used for processing data from the current Simrad
-    multibeam sonars.
-
-Streamlining of MB-System Default Parameters.
-- Prior to version 5.0, the MB-System defaults set by mbdefaults
-    included the format id, a control for ping averaging,
-    longitude and latitude bounds for windowing by area, and
-    begin and end times for windowing in time. These values are
-    no longer set in the .mbio_defaults file or controlled by
-    mbdefaults. As noted above, the format id is automatically
-    identified from the filename when possible. When filenames
-    do not match one of the recognized structures, users must
-    specify the format using the relevant programs -Fformat option.
-    The controls for ping averaging and windowing in time and
-    space are rarely used, and must now be explicitly set in
-    command line arguments.
-
-New Data Formats
-- Furuno HS10 multibeam bathymetry is supported as format 171.
-- SeaBeam 2120 multibeam data in the L3 Communications XSE format
-    are supported as format 94 (already used to support Elac
-    Bottomchart MkII XSE data).
-- Raw STN Atlas multibeam data generated by the upgraded
-    Hydrosweep DS2 multibeam on the R/V Ewing are supported by
-    read-only format 182. Processing is supported using the
-    augmented read-write format 183.
-- The IFREMER netCDF multibeam archiving data format is supported
-    as format 75. Similarly, the IFREMER netCDF navigation
-    archiving data format is supported as format 167.
-- The STN Atlas processing data format SURF is supported as
-    format 181. At present, SURF is supported as a read-only
-    format. This allows plotting and gridding of the SURF data,
-    but not processing. Writing or translating the SURF data to
-    allow processing will be supported in a later version.
-- The Hawaii Mapping Research Group's new MR1 format is supported
-    as format 64. This format is used to disseminate data from
-    both the HMRG interferometric sonars (e.g. MR1) and the
-    WHOI DSL 120 deep-towed inteferometric sonar. This format has
-    been supported by including the code for the HMRG library
-    libmr1pr in the MB-System library. Thanks to Roger Davis and
-    HMRG for making the code available under the GPL.
diff --git a/src/html/ChayesJul2003.gif b/src/html/ChayesJul2003.gif
deleted file mode 100644
index 1b60b9b..0000000
Binary files a/src/html/ChayesJul2003.gif and /dev/null differ
diff --git a/src/html/Christina_d_S_Ferreira_crop.jpg b/src/html/Christina_d_S_Ferreira_crop.jpg
deleted file mode 100644
index 5715f32..0000000
Binary files a/src/html/Christina_d_S_Ferreira_crop.jpg and /dev/null differ
diff --git a/src/html/KrystleAnderson2013.gif b/src/html/KrystleAnderson2013.gif
deleted file mode 100644
index fa07d3e..0000000
Binary files a/src/html/KrystleAnderson2013.gif and /dev/null differ
diff --git a/src/html/MBTeamJul2003.gif b/src/html/MBTeamJul2003.gif
deleted file mode 100644
index 64f1493..0000000
Binary files a/src/html/MBTeamJul2003.gif and /dev/null differ
diff --git a/src/html/MBTeamJul2003.jpg b/src/html/MBTeamJul2003.jpg
deleted file mode 100644
index 4e87bdc..0000000
Binary files a/src/html/MBTeamJul2003.jpg and /dev/null differ
diff --git a/src/html/Makefile.am b/src/html/Makefile.am
deleted file mode 100644
index a29bc0e..0000000
--- a/src/html/Makefile.am
+++ /dev/null
@@ -1,101 +0,0 @@
-dist_mbsystemhtml_DATA = \
-caress2001.gif \
-caress_chayes_ferreira_Feb2014.jpg \
-ChayesJul2003.gif \
-Christina_d_S_Ferreira_crop.jpg \
-ChangeLog.txt \
-gpl.html \
-index.html \
-KrystleAnderson2013.gif \
-mb7k2jstar.html \
-mb7k2ss.html \
-mb7kpreprocess.html \
-mbabsorption.html \
-mbareaclean.html \
-mbauvloglist.html \
-mbauvnavusbl.html \
-mbbackangle.html \
-mbclean.html \
-mbcontour.html \
-mbcopy.html \
-mbctdlist.html \
-mbdatalist.html \
-mbdefaults.html \
-mbdumpesf.html \
-mbedit.html \
-mbeditviz.html \
-mbextractsegy.html \
-mbfilter.html \
-mbformat.html \
-mbgetesf.html \
-mbgrdtiff.html \
-mbgrdviz.html \
-mbgrid.html \
-mbhistogram.html \
-mbhsdump.html \
-mbhysweeppreprocess.html \
-mbinfo.html \
-mbio.html \
-mbkongsbergpreprocess.html \
-mblevitus.html \
-mblist.html \
-mbm_arc2grd.html \
-mbm_bpr.html \
-mbm_copy.html \
-mbm_grd2arc.html \
-mbm_grd2geovrml.html \
-mbm_grd3dplot.html \
-mbm_grdcut.html \
-mbm_grdinfo.html \
-mbm_grdplot.html \
-mbm_grdtiff.html \
-mbm_grid.html \
-mbm_histplot.html \
-mbm_makedatalist.html \
-mbm_multicopy.html \
-mbm_multidatalist.html \
-mbm_multiprocess.html \
-mbmosaic.html \
-mbm_plot.html \
-mbm_route2mission.html \
-mbm_stat.html \
-mbm_utm.html \
-mbm_xbt.html \
-mbm_xyplot.html \
-mbnavadjust.html \
-mbnavadjustmerge.html \
-mbnavedit.html \
-mbnavlist.html \
-mbneptune2esf.html \
-mbotps.html \
-mbprocess.html \
-mbps.html \
-mbrollbias.html \
-mbrolltimelag.html \
-mbroutetime.html \
-mbsegygrid.html \
-mbsegyinfo.html \
-mbsegylist.html \
-mbsegypsd.html \
-mbset.html \
-mbstripnan.html \
-mbsvplist.html \
-mbsvpselect.html \
-mbswath.html \
-mbsystem_capabilities.html \
-mbsystem_copyright.html \
-mbsystem_faq.html \
-mbsystem_formats.html \
-mbsystem_future.html \
-mbsystem_home.html \
-mbsystem_how_to_get.html \
-mbsystem.html \
-mbsystem_logo.gif \
-mbsystem_logo_small.gif \
-mbsystem_man_list.html \
-mbsystem_version.txt \
-mbsystem_whatsnew.html \
-MBTeamJul2003.jpg \
-mbtime.html \
-mbvelocitytool.html \
-ValJul2003.gif
diff --git a/src/html/Makefile.in b/src/html/Makefile.in
deleted file mode 100644
index 2e46a8a..0000000
--- a/src/html/Makefile.in
+++ /dev/null
@@ -1,618 +0,0 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
-
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-
-VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
-am__make_running_with_option = \
-  case $${target_option-} in \
-      ?) ;; \
-      *) echo "am__make_running_with_option: internal error: invalid" \
-              "target option '$${target_option-}' specified" >&2; \
-         exit 1;; \
-  esac; \
-  has_opt=no; \
-  sane_makeflags=$$MAKEFLAGS; \
-  if $(am__is_gnu_make); then \
-    sane_makeflags=$$MFLAGS; \
-  else \
-    case $$MAKEFLAGS in \
-      *\\[\ \	]*) \
-        bs=\\; \
-        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
-          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
-    esac; \
-  fi; \
-  skip_next=no; \
-  strip_trailopt () \
-  { \
-    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
-  }; \
-  for flg in $$sane_makeflags; do \
-    test $$skip_next = yes && { skip_next=no; continue; }; \
-    case $$flg in \
-      *=*|--*) continue;; \
-        -*I) strip_trailopt 'I'; skip_next=yes;; \
-      -*I?*) strip_trailopt 'I';; \
-        -*O) strip_trailopt 'O'; skip_next=yes;; \
-      -*O?*) strip_trailopt 'O';; \
-        -*l) strip_trailopt 'l'; skip_next=yes;; \
-      -*l?*) strip_trailopt 'l';; \
-      -[dEDm]) skip_next=yes;; \
-      -[JT]) skip_next=yes;; \
-    esac; \
-    case $$flg in \
-      *$$target_option*) has_opt=yes; break;; \
-    esac; \
-  done; \
-  test $$has_opt = yes
-am__make_dryrun = (target_option=n; $(am__make_running_with_option))
-am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-subdir = src/html
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(dist_mbsystemhtml_DATA)
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
-	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
-	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
-	$(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-	$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/src/mbio/mb_config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-AM_V_P = $(am__v_P_ at AM_V@)
-am__v_P_ = $(am__v_P_ at AM_DEFAULT_V@)
-am__v_P_0 = false
-am__v_P_1 = :
-AM_V_GEN = $(am__v_GEN_ at AM_V@)
-am__v_GEN_ = $(am__v_GEN_ at AM_DEFAULT_V@)
-am__v_GEN_0 = @echo "  GEN     " $@;
-am__v_GEN_1 = 
-AM_V_at = $(am__v_at_ at AM_V@)
-am__v_at_ = $(am__v_at_ at AM_DEFAULT_V@)
-am__v_at_0 = @
-am__v_at_1 = 
-SOURCES =
-DIST_SOURCES =
-am__can_run_installinfo = \
-  case $$AM_UPDATE_INFO_DIR in \
-    n|no|NO) false;; \
-    *) (install-info --version) >/dev/null 2>&1;; \
-  esac
-am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
-am__vpath_adj = case $$p in \
-    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
-    *) f=$$p;; \
-  esac;
-am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
-am__install_max = 40
-am__nobase_strip_setup = \
-  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
-am__nobase_strip = \
-  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
-am__nobase_list = $(am__nobase_strip_setup); \
-  for p in $$list; do echo "$$p $$p"; done | \
-  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
-  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
-    if (++n[$$2] == $(am__install_max)) \
-      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
-    END { for (dir in files) print dir, files[dir] }'
-am__base_list = \
-  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
-  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
-am__uninstall_files_from_dir = { \
-  test -z "$$files" \
-    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
-    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
-         $(am__cd) "$$dir" && rm -f $$files; }; \
-  }
-am__installdirs = "$(DESTDIR)$(mbsystemhtmldir)"
-DATA = $(dist_mbsystemhtml_DATA)
-am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-CC = @CC@
-CCAS = @CCAS@
-CCASDEPMODE = @CCASDEPMODE@
-CCASFLAGS = @CCASFLAGS@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DLLTOOL = @DLLTOOL@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GREP = @GREP@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBM = @LIBM@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIBTOOL_DEPS = @LIBTOOL_DEPS@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LTLIBOBJS = @LTLIBOBJS@
-LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
-MAINT = @MAINT@
-MAKEINFO = @MAKEINFO@
-MANIFEST_TOOL = @MANIFEST_TOOL@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-OTPS_DIR = @OTPS_DIR@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_URL = @PACKAGE_URL@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PKG_CONFIG = @PKG_CONFIG@
-PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
-PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-VERSION = @VERSION@
-XDR_LIB = @XDR_LIB@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_AR = @ac_ct_AR@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-fftw_app = @fftw_app@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libGLU_CFLAGS = @libGLU_CFLAGS@
-libGLU_LIBS = @libGLU_LIBS@
-libXm_CFLAGS = @libXm_CFLAGS@
-libXm_LIBS = @libXm_LIBS@
-libdir = @libdir@
-libexecdir = @libexecdir@
-libfftw3_CFLAGS = @libfftw3_CFLAGS@
-libfftw3_LIBS = @libfftw3_LIBS@
-libfftw_CPPFLAGS = @libfftw_CPPFLAGS@
-libfftw_LIBS = @libfftw_LIBS@
-libgmt_CFLAGS = @libgmt_CFLAGS@
-libgmt_CPPFLAGS = @libgmt_CPPFLAGS@
-libgmt_LIBS = @libgmt_LIBS@
-libmotif_CPPFLAGS = @libmotif_CPPFLAGS@
-libmotif_LIBS = @libmotif_LIBS@
-libnetcdf_CFLAGS = @libnetcdf_CFLAGS@
-libnetcdf_CPPFLAGS = @libnetcdf_CPPFLAGS@
-libnetcdf_LIBS = @libnetcdf_LIBS@
-libopengl_CPPFLAGS = @libopengl_CPPFLAGS@
-libopengl_LIBS = @libopengl_LIBS@
-libproj_CFLAGS = @libproj_CFLAGS@
-libproj_CPPFLAGS = @libproj_CPPFLAGS@
-libproj_LIBS = @libproj_LIBS@
-libpsl_CFLAGS = @libpsl_CFLAGS@
-libpsl_LIBS = @libpsl_LIBS@
-localedir = @localedir@
-localstatedir = @localstatedir@
-mandir = @mandir@
-mbsystemdatadir = @mbsystemdatadir@
-mbsystemhtmldir = @mbsystemhtmldir@
-mbsystempsdir = @mbsystempsdir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-dist_mbsystemhtml_DATA = \
-caress2001.gif \
-caress_chayes_ferreira_Feb2014.jpg \
-ChayesJul2003.gif \
-Christina_d_S_Ferreira_crop.jpg \
-ChangeLog.txt \
-gpl.html \
-index.html \
-KrystleAnderson2013.gif \
-mb7k2jstar.html \
-mb7k2ss.html \
-mb7kpreprocess.html \
-mbabsorption.html \
-mbareaclean.html \
-mbauvloglist.html \
-mbauvnavusbl.html \
-mbbackangle.html \
-mbclean.html \
-mbcontour.html \
-mbcopy.html \
-mbctdlist.html \
-mbdatalist.html \
-mbdefaults.html \
-mbdumpesf.html \
-mbedit.html \
-mbeditviz.html \
-mbextractsegy.html \
-mbfilter.html \
-mbformat.html \
-mbgetesf.html \
-mbgrdtiff.html \
-mbgrdviz.html \
-mbgrid.html \
-mbhistogram.html \
-mbhsdump.html \
-mbhysweeppreprocess.html \
-mbinfo.html \
-mbio.html \
-mbkongsbergpreprocess.html \
-mblevitus.html \
-mblist.html \
-mbm_arc2grd.html \
-mbm_bpr.html \
-mbm_copy.html \
-mbm_grd2arc.html \
-mbm_grd2geovrml.html \
-mbm_grd3dplot.html \
-mbm_grdcut.html \
-mbm_grdinfo.html \
-mbm_grdplot.html \
-mbm_grdtiff.html \
-mbm_grid.html \
-mbm_histplot.html \
-mbm_makedatalist.html \
-mbm_multicopy.html \
-mbm_multidatalist.html \
-mbm_multiprocess.html \
-mbmosaic.html \
-mbm_plot.html \
-mbm_route2mission.html \
-mbm_stat.html \
-mbm_utm.html \
-mbm_xbt.html \
-mbm_xyplot.html \
-mbnavadjust.html \
-mbnavadjustmerge.html \
-mbnavedit.html \
-mbnavlist.html \
-mbneptune2esf.html \
-mbotps.html \
-mbprocess.html \
-mbps.html \
-mbrollbias.html \
-mbrolltimelag.html \
-mbroutetime.html \
-mbsegygrid.html \
-mbsegyinfo.html \
-mbsegylist.html \
-mbsegypsd.html \
-mbset.html \
-mbstripnan.html \
-mbsvplist.html \
-mbsvpselect.html \
-mbswath.html \
-mbsystem_capabilities.html \
-mbsystem_copyright.html \
-mbsystem_faq.html \
-mbsystem_formats.html \
-mbsystem_future.html \
-mbsystem_home.html \
-mbsystem_how_to_get.html \
-mbsystem.html \
-mbsystem_logo.gif \
-mbsystem_logo_small.gif \
-mbsystem_man_list.html \
-mbsystem_version.txt \
-mbsystem_whatsnew.html \
-MBTeamJul2003.jpg \
-mbtime.html \
-mbvelocitytool.html \
-ValJul2003.gif
-
-all: all-am
-
-.SUFFIXES:
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
-	@for dep in $?; do \
-	  case '$(am__configure_deps)' in \
-	    *$$dep*) \
-	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-	        && { if test -f $@; then exit 0; else break; fi; }; \
-	      exit 1;; \
-	  esac; \
-	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/html/Makefile'; \
-	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --gnu src/html/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	@case '$?' in \
-	  *config.status*) \
-	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-	esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-
-mostlyclean-libtool:
-	-rm -f *.lo
-
-clean-libtool:
-	-rm -rf .libs _libs
-install-dist_mbsystemhtmlDATA: $(dist_mbsystemhtml_DATA)
-	@$(NORMAL_INSTALL)
-	@list='$(dist_mbsystemhtml_DATA)'; test -n "$(mbsystemhtmldir)" || list=; \
-	if test -n "$$list"; then \
-	  echo " $(MKDIR_P) '$(DESTDIR)$(mbsystemhtmldir)'"; \
-	  $(MKDIR_P) "$(DESTDIR)$(mbsystemhtmldir)" || exit 1; \
-	fi; \
-	for p in $$list; do \
-	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
-	  echo "$$d$$p"; \
-	done | $(am__base_list) | \
-	while read files; do \
-	  echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(mbsystemhtmldir)'"; \
-	  $(INSTALL_DATA) $$files "$(DESTDIR)$(mbsystemhtmldir)" || exit $$?; \
-	done
-
-uninstall-dist_mbsystemhtmlDATA:
-	@$(NORMAL_UNINSTALL)
-	@list='$(dist_mbsystemhtml_DATA)'; test -n "$(mbsystemhtmldir)" || list=; \
-	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
-	dir='$(DESTDIR)$(mbsystemhtmldir)'; $(am__uninstall_files_from_dir)
-tags TAGS:
-
-ctags CTAGS:
-
-cscope cscopelist:
-
-
-distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	list='$(DISTFILES)'; \
-	  dist_files=`for file in $$list; do echo $$file; done | \
-	  sed -e "s|^$$srcdirstrip/||;t" \
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
-	case $$dist_files in \
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
-			   sort -u` ;; \
-	esac; \
-	for file in $$dist_files; do \
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  if test -d $$d/$$file; then \
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
-	    if test -d "$(distdir)/$$file"; then \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
-	  else \
-	    test -f "$(distdir)/$$file" \
-	    || cp -p $$d/$$file "$(distdir)/$$file" \
-	    || exit 1; \
-	  fi; \
-	done
-check-am: all-am
-check: check-am
-all-am: Makefile $(DATA)
-installdirs:
-	for dir in "$(DESTDIR)$(mbsystemhtmldir)"; do \
-	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
-	done
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
-	if test -z '$(STRIP)'; then \
-	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	      install; \
-	else \
-	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
-	fi
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
-	@echo "This command is intended for maintainers to use"
-	@echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-generic clean-libtool mostlyclean-am
-
-distclean: distclean-am
-	-rm -f Makefile
-distclean-am: clean-am distclean-generic
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am: install-dist_mbsystemhtmlDATA
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am:
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
-	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-generic mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am: uninstall-dist_mbsystemhtmlDATA
-
-.MAKE: install-am install-strip
-
-.PHONY: all all-am check check-am clean clean-generic clean-libtool \
-	cscopelist-am ctags-am distclean distclean-generic \
-	distclean-libtool distdir dvi dvi-am html html-am info info-am \
-	install install-am install-data install-data-am \
-	install-dist_mbsystemhtmlDATA install-dvi install-dvi-am \
-	install-exec install-exec-am install-html install-html-am \
-	install-info install-info-am install-man install-pdf \
-	install-pdf-am install-ps install-ps-am install-strip \
-	installcheck installcheck-am installdirs maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-generic \
-	mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \
-	uninstall-am uninstall-dist_mbsystemhtmlDATA
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/html/ValJul2003.gif b/src/html/ValJul2003.gif
deleted file mode 100644
index 834fb52..0000000
Binary files a/src/html/ValJul2003.gif and /dev/null differ
diff --git a/src/html/caress.gif b/src/html/caress.gif
deleted file mode 100644
index 555430e..0000000
Binary files a/src/html/caress.gif and /dev/null differ
diff --git a/src/html/caress2001.gif b/src/html/caress2001.gif
deleted file mode 100644
index 9ccc97e..0000000
Binary files a/src/html/caress2001.gif and /dev/null differ
diff --git a/src/html/caress_chayes_ferreira_Feb2014.jpg b/src/html/caress_chayes_ferreira_Feb2014.jpg
deleted file mode 100644
index 9da7e43..0000000
Binary files a/src/html/caress_chayes_ferreira_Feb2014.jpg and /dev/null differ
diff --git a/src/html/chayes.gif b/src/html/chayes.gif
deleted file mode 100644
index d614515..0000000
Binary files a/src/html/chayes.gif and /dev/null differ
diff --git a/src/html/gpl.html b/src/html/gpl.html
deleted file mode 100644
index 34b70e4..0000000
--- a/src/html/gpl.html
+++ /dev/null
@@ -1,604 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
-<HTML>
-<HEAD>
-   <TITLE>GNU General Public License</TITLE>
-  <meta http-equiv="Content-Type" content="text/html">
-  <meta name="Title" content="MB-System: Mapping the Seafloor">
-  <meta name="Author" content="David Caress, Dale Chayes">
-  <meta name="Description" content="open source software for processing bathymetry and backscatter data from multibeam and sidescan sonar">
-  <meta name="Keywords" content="seafloor,mapping,multibeam,sonar,bathymetry,sidescan,swath processing,open,source,software">
-</HEAD>
-<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#336699" VLINK="#997040" ALINK="#CC9900">
-<BODY>
-
-<CENTER>
-  <h3 style="text-align: center;">GNU GENERAL PUBLIC LICENSE</h3>
-  <p style="text-align: center;">Version 3, 29 June 2007</p>
-  <p>Copyright © 2007 Free Software Foundation, Inc. <http://fsf.org/></p>
-  <p> Everyone is permitted to copy and distribute verbatim copies
-    of this license document, but changing it is not allowed.</p>
-  <h3 align="center"><a name="preamble"></a>Preamble</h3>
-  <p align="left">The GNU General Public License is a free, copyleft license for
-    software and other kinds of works.</p>
-  <p align="left">The licenses for most software and other practical works are designed
-    to take away your freedom to share and change the works.  By contrast,
-    the GNU General Public License is intended to guarantee your freedom to
-    share and change all versions of a program--to make sure it remains free
-    software for all its users.  We, the Free Software Foundation, use the
-    GNU General Public License for most of our software; it applies also to
-    any other work released this way by its authors.  You can apply it to
-    your programs, too.</p>
-  <p align="left">When we speak of free software, we are referring to freedom, not
-    price.  Our General Public Licenses are designed to make sure that you
-    have the freedom to distribute copies of free software (and charge for
-    them if you wish), that you receive source code or can get it if you
-    want it, that you can change the software or use pieces of it in new
-    free programs, and that you know you can do these things.</p>
-  <p align="left">To protect your rights, we need to prevent others from denying you
-    these rights or asking you to surrender the rights.  Therefore, you have
-    certain responsibilities if you distribute copies of the software, or if
-    you modify it: responsibilities to respect the freedom of others.</p>
-  <p align="left">For example, if you distribute copies of such a program, whether
-    gratis or for a fee, you must pass on to the recipients the same
-    freedoms that you received.  You must make sure that they, too, receive
-    or can get the source code.  And you must show them these terms so they
-    know their rights.</p>
-  <p align="left">Developers that use the GNU GPL protect your rights with two steps:
-    (1) assert copyright on the software, and (2) offer you this License
-    giving you legal permission to copy, distribute and/or modify it.</p>
-  <p align="left">For the developers' and authors' protection, the GPL clearly explains
-    that there is no warranty for this free software.  For both users' and
-    authors' sake, the GPL requires that modified versions be marked as
-    changed, so that their problems will not be attributed erroneously to
-    authors of previous versions.</p>
-  <p align="left">Some devices are designed to deny users access to install or run
-    modified versions of the software inside them, although the manufacturer
-    can do so.  This is fundamentally incompatible with the aim of
-    protecting users' freedom to change the software.  The systematic
-    pattern of such abuse occurs in the area of products for individuals to
-    use, which is precisely where it is most unacceptable.  Therefore, we
-    have designed this version of the GPL to prohibit the practice for those
-    products.  If such problems arise substantially in other domains, we
-    stand ready to extend this provision to those domains in future versions
-    of the GPL, as needed to protect the freedom of users.</p>
-  <p align="left">Finally, every program is threatened constantly by software patents.
-    States should not allow patents to restrict development and use of
-    software on general-purpose computers, but in those that do, we wish to
-    avoid the special danger that patents applied to a free program could
-    make it effectively proprietary.  To prevent this, the GPL assures that
-    patents cannot be used to render the program non-free.</p>
-  <p align="left">The precise terms and conditions for copying, distribution and
-    modification follow.</p>
-  <h3 align="center"><a name="terms"></a>TERMS AND CONDITIONS</h3>
-  <h4 align="left"><a name="section0"></a>0. Definitions.</h4>
-  <p align="left">“This License” refers to version 3 of the GNU General Public License.</p>
-  <p align="left">“Copyright” also means copyright-like laws that apply to other kinds of
-    works, such as semiconductor masks.</p>
-  <p align="left">“The Program” refers to any copyrightable work licensed under this
-    License.  Each licensee is addressed as “you”.  “Licensees” and
-  “recipients” may be individuals or organizations.</p>
-  <p align="left">To “modify” a work means to copy from or adapt all or part of the work
-    in a fashion requiring copyright permission, other than the making of an
-    exact copy.  The resulting work is called a “modified version” of the
-    earlier work or a work “based on” the earlier work.</p>
-  <p align="left">A “covered work” means either the unmodified Program or a work based
-    on the Program.</p>
-  <p align="left">To “propagate” a work means to do anything with it that, without
-    permission, would make you directly or secondarily liable for
-    infringement under applicable copyright law, except executing it on a
-    computer or modifying a private copy.  Propagation includes copying,
-    distribution (with or without modification), making available to the
-    public, and in some countries other activities as well.</p>
-  <p align="left">To “convey” a work means any kind of propagation that enables other
-    parties to make or receive copies.  Mere interaction with a user through
-    a computer network, with no transfer of a copy, is not conveying.</p>
-  <p align="left">An interactive user interface displays “Appropriate Legal Notices”
-    to the extent that it includes a convenient and prominently visible
-    feature that (1) displays an appropriate copyright notice, and (2)
-    tells the user that there is no warranty for the work (except to the
-    extent that warranties are provided), that licensees may convey the
-    work under this License, and how to view a copy of this License.  If
-    the interface presents a list of user commands or options, such as a
-    menu, a prominent item in the list meets this criterion.</p>
-  <h4 align="left"><a name="section1"></a>1. Source Code.</h4>
-  <p align="left">The “source code” for a work means the preferred form of the work
-    for making modifications to it.  “Object code” means any non-source
-    form of a work.</p>
-  <p align="left">A “Standard Interface” means an interface that either is an official
-    standard defined by a recognized standards body, or, in the case of
-    interfaces specified for a particular programming language, one that
-    is widely used among developers working in that language.</p>
-  <p align="left">The “System Libraries” of an executable work include anything, other
-    than the work as a whole, that (a) is included in the normal form of
-    packaging a Major Component, but which is not part of that Major
-    Component, and (b) serves only to enable use of the work with that
-    Major Component, or to implement a Standard Interface for which an
-    implementation is available to the public in source code form.  A
-  “Major Component”, in this context, means a major essential component
-    (kernel, window system, and so on) of the specific operating system
-    (if any) on which the executable work runs, or a compiler used to
-    produce the work, or an object code interpreter used to run it.</p>
-  <p align="left">The “Corresponding Source” for a work in object code form means all
-    the source code needed to generate, install, and (for an executable
-    work) run the object code and to modify the work, including scripts to
-    control those activities.  However, it does not include the work's
-    System Libraries, or general-purpose tools or generally available free
-    programs which are used unmodified in performing those activities but
-    which are not part of the work.  For example, Corresponding Source
-    includes interface definition files associated with source files for
-    the work, and the source code for shared libraries and dynamically
-    linked subprograms that the work is specifically designed to require,
-    such as by intimate data communication or control flow between those
-    subprograms and other parts of the work.</p>
-  <p align="left">The Corresponding Source need not include anything that users
-    can regenerate automatically from other parts of the Corresponding
-    Source.</p>
-  <p align="left">The Corresponding Source for a work in source code form is that
-    same work.</p>
-  <h4 align="left"><a name="section2"></a>2. Basic Permissions.</h4>
-  <p align="left">All rights granted under this License are granted for the term of
-    copyright on the Program, and are irrevocable provided the stated
-    conditions are met.  This License explicitly affirms your unlimited
-    permission to run the unmodified Program.  The output from running a
-    covered work is covered by this License only if the output, given its
-    content, constitutes a covered work.  This License acknowledges your
-    rights of fair use or other equivalent, as provided by copyright law.</p>
-  <p align="left">You may make, run and propagate covered works that you do not
-    convey, without conditions so long as your license otherwise remains
-    in force.  You may convey covered works to others for the sole purpose
-    of having them make modifications exclusively for you, or provide you
-    with facilities for running those works, provided that you comply with
-    the terms of this License in conveying all material for which you do
-    not control copyright.  Those thus making or running the covered works
-    for you must do so exclusively on your behalf, under your direction
-    and control, on terms that prohibit them from making any copies of
-    your copyrighted material outside their relationship with you.</p>
-  <p align="left">Conveying under any other circumstances is permitted solely under
-    the conditions stated below.  Sublicensing is not allowed; section 10
-    makes it unnecessary.</p>
-  <h4 align="left"><a name="section3"></a>3. Protecting Users' Legal Rights From Anti-Circumvention Law.</h4>
-  <p align="left">No covered work shall be deemed part of an effective technological
-    measure under any applicable law fulfilling obligations under article
-    11 of the WIPO copyright treaty adopted on 20 December 1996, or
-    similar laws prohibiting or restricting circumvention of such
-    measures.</p>
-  <p align="left">When you convey a covered work, you waive any legal power to forbid
-    circumvention of technological measures to the extent such circumvention
-    is effected by exercising rights under this License with respect to
-    the covered work, and you disclaim any intention to limit operation or
-    modification of the work as a means of enforcing, against the work's
-    users, your or third parties' legal rights to forbid circumvention of
-    technological measures.</p>
-  <h4 align="left"><a name="section4"></a>4. Conveying Verbatim Copies.</h4>
-  <p align="left">You may convey verbatim copies of the Program's source code as you
-    receive it, in any medium, provided that you conspicuously and
-    appropriately publish on each copy an appropriate copyright notice;
-    keep intact all notices stating that this License and any
-    non-permissive terms added in accord with section 7 apply to the code;
-    keep intact all notices of the absence of any warranty; and give all
-    recipients a copy of this License along with the Program.</p>
-  <p align="left">You may charge any price or no price for each copy that you convey,
-    and you may offer support or warranty protection for a fee.</p>
-  <h4 align="left"><a name="section5"></a>5. Conveying Modified Source Versions.</h4>
-  <p align="left">You may convey a work based on the Program, or the modifications to
-    produce it from the Program, in the form of source code under the
-    terms of section 4, provided that you also meet all of these conditions:</p>
-  <div align="left">
-    <ul>
-      <li>a) The work must carry prominent notices stating that you modified
-        it, and giving a relevant date.</li>
-      <li>b) The work must carry prominent notices stating that it is
-        released under this License and any conditions added under section
-        7.  This requirement modifies the requirement in section 4 to
-        “keep intact all notices”.</li>
-      <li>c) You must license the entire work, as a whole, under this
-        License to anyone who comes into possession of a copy.  This
-        License will therefore apply, along with any applicable section 7
-        additional terms, to the whole of the work, and all its parts,
-        regardless of how they are packaged.  This License gives no
-        permission to license the work in any other way, but it does not
-        invalidate such permission if you have separately received it.</li>
-      <li>d) If the work has interactive user interfaces, each must display
-        Appropriate Legal Notices; however, if the Program has interactive
-        interfaces that do not display Appropriate Legal Notices, your
-        work need not make them do so.</li>
-    </ul>
-  </div>
-  <p align="left">A compilation of a covered work with other separate and independent
-    works, which are not by their nature extensions of the covered work,
-    and which are not combined with it such as to form a larger program,
-    in or on a volume of a storage or distribution medium, is called an
-  “aggregate” if the compilation and its resulting copyright are not
-    used to limit the access or legal rights of the compilation's users
-    beyond what the individual works permit.  Inclusion of a covered work
-    in an aggregate does not cause this License to apply to the other
-    parts of the aggregate.</p>
-  <h4 align="left"><a name="section6"></a>6. Conveying Non-Source Forms.</h4>
-  <p align="left">You may convey a covered work in object code form under the terms
-    of sections 4 and 5, provided that you also convey the
-    machine-readable Corresponding Source under the terms of this License,
-    in one of these ways:</p>
-  <div align="left">
-    <ul>
-      <li>a) Convey the object code in, or embodied in, a physical product
-        (including a physical distribution medium), accompanied by the
-        Corresponding Source fixed on a durable physical medium
-        customarily used for software interchange.</li>
-      <li>b) Convey the object code in, or embodied in, a physical product
-        (including a physical distribution medium), accompanied by a
-        written offer, valid for at least three years and valid for as
-        long as you offer spare parts or customer support for that product
-        model, to give anyone who possesses the object code either (1) a
-        copy of the Corresponding Source for all the software in the
-        product that is covered by this License, on a durable physical
-        medium customarily used for software interchange, for a price no
-        more than your reasonable cost of physically performing this
-        conveying of source, or (2) access to copy the
-        Corresponding Source from a network server at no charge.</li>
-      <li>c) Convey individual copies of the object code with a copy of the
-        written offer to provide the Corresponding Source.  This
-        alternative is allowed only occasionally and noncommercially, and
-        only if you received the object code with such an offer, in accord
-        with subsection 6b.</li>
-      <li>d) Convey the object code by offering access from a designated
-        place (gratis or for a charge), and offer equivalent access to the
-        Corresponding Source in the same way through the same place at no
-        further charge.  You need not require recipients to copy the
-        Corresponding Source along with the object code.  If the place to
-        copy the object code is a network server, the Corresponding Source
-        may be on a different server (operated by you or a third party)
-        that supports equivalent copying facilities, provided you maintain
-        clear directions next to the object code saying where to find the
-        Corresponding Source.  Regardless of what server hosts the
-        Corresponding Source, you remain obligated to ensure that it is
-        available for as long as needed to satisfy these requirements.</li>
-      <li>e) Convey the object code using peer-to-peer transmission, provided
-        you inform other peers where the object code and Corresponding
-        Source of the work are being offered to the general public at no
-        charge under subsection 6d.</li>
-    </ul>
-  </div>
-  <p align="left">A separable portion of the object code, whose source code is excluded
-    from the Corresponding Source as a System Library, need not be
-    included in conveying the object code work.</p>
-  <p align="left">A “User Product” is either (1) a “consumer product”, which means any
-    tangible personal property which is normally used for personal, family,
-    or household purposes, or (2) anything designed or sold for incorporation
-    into a dwelling.  In determining whether a product is a consumer product,
-    doubtful cases shall be resolved in favor of coverage.  For a particular
-    product received by a particular user, “normally used” refers to a
-    typical or common use of that class of product, regardless of the status
-    of the particular user or of the way in which the particular user
-    actually uses, or expects or is expected to use, the product.  A product
-    is a consumer product regardless of whether the product has substantial
-    commercial, industrial or non-consumer uses, unless such uses represent
-    the only significant mode of use of the product.</p>
-  <p align="left">“Installation Information” for a User Product means any methods,
-    procedures, authorization keys, or other information required to install
-    and execute modified versions of a covered work in that User Product from
-    a modified version of its Corresponding Source.  The information must
-    suffice to ensure that the continued functioning of the modified object
-    code is in no case prevented or interfered with solely because
-    modification has been made.</p>
-  <p align="left">If you convey an object code work under this section in, or with, or
-    specifically for use in, a User Product, and the conveying occurs as
-    part of a transaction in which the right of possession and use of the
-    User Product is transferred to the recipient in perpetuity or for a
-    fixed term (regardless of how the transaction is characterized), the
-    Corresponding Source conveyed under this section must be accompanied
-    by the Installation Information.  But this requirement does not apply
-    if neither you nor any third party retains the ability to install
-    modified object code on the User Product (for example, the work has
-    been installed in ROM).</p>
-  <p align="left">The requirement to provide Installation Information does not include a
-    requirement to continue to provide support service, warranty, or updates
-    for a work that has been modified or installed by the recipient, or for
-    the User Product in which it has been modified or installed.  Access to a
-    network may be denied when the modification itself materially and
-    adversely affects the operation of the network or violates the rules and
-    protocols for communication across the network.</p>
-  <p align="left">Corresponding Source conveyed, and Installation Information provided,
-    in accord with this section must be in a format that is publicly
-    documented (and with an implementation available to the public in
-    source code form), and must require no special password or key for
-    unpacking, reading or copying.</p>
-  <h4 align="left"><a name="section7"></a>7. Additional Terms.</h4>
-  <p align="left">“Additional permissions” are terms that supplement the terms of this
-    License by making exceptions from one or more of its conditions.
-    Additional permissions that are applicable to the entire Program shall
-    be treated as though they were included in this License, to the extent
-    that they are valid under applicable law.  If additional permissions
-    apply only to part of the Program, that part may be used separately
-    under those permissions, but the entire Program remains governed by
-    this License without regard to the additional permissions.</p>
-  <p align="left">When you convey a copy of a covered work, you may at your option
-    remove any additional permissions from that copy, or from any part of
-    it.  (Additional permissions may be written to require their own
-    removal in certain cases when you modify the work.)  You may place
-    additional permissions on material, added by you to a covered work,
-    for which you have or can give appropriate copyright permission.</p>
-  <p align="left">Notwithstanding any other provision of this License, for material you
-    add to a covered work, you may (if authorized by the copyright holders of
-    that material) supplement the terms of this License with terms:</p>
-  <div align="left">
-    <ul>
-      <li>a) Disclaiming warranty or limiting liability differently from the
-        terms of sections 15 and 16 of this License; or</li>
-      <li>b) Requiring preservation of specified reasonable legal notices or
-        author attributions in that material or in the Appropriate Legal
-        Notices displayed by works containing it; or</li>
-      <li>c) Prohibiting misrepresentation of the origin of that material, or
-        requiring that modified versions of such material be marked in
-        reasonable ways as different from the original version; or</li>
-      <li>d) Limiting the use for publicity purposes of names of licensors or
-        authors of the material; or</li>
-      <li>e) Declining to grant rights under trademark law for use of some
-        trade names, trademarks, or service marks; or</li>
-      <li>f) Requiring indemnification of licensors and authors of that
-        material by anyone who conveys the material (or modified versions of
-        it) with contractual assumptions of liability to the recipient, for
-        any liability that these contractual assumptions directly impose on
-        those licensors and authors.</li>
-    </ul>
-  </div>
-  <p align="left">All other non-permissive additional terms are considered “further
-    restrictions” within the meaning of section 10.  If the Program as you
-    received it, or any part of it, contains a notice stating that it is
-    governed by this License along with a term that is a further
-    restriction, you may remove that term.  If a license document contains
-    a further restriction but permits relicensing or conveying under this
-    License, you may add to a covered work material governed by the terms
-    of that license document, provided that the further restriction does
-    not survive such relicensing or conveying.</p>
-  <p align="left">If you add terms to a covered work in accord with this section, you
-    must place, in the relevant source files, a statement of the
-    additional terms that apply to those files, or a notice indicating
-    where to find the applicable terms.</p>
-  <p align="left">Additional terms, permissive or non-permissive, may be stated in the
-    form of a separately written license, or stated as exceptions;
-    the above requirements apply either way.</p>
-  <h4 align="left"><a name="section8"></a>8. Termination.</h4>
-  <p align="left">You may not propagate or modify a covered work except as expressly
-    provided under this License.  Any attempt otherwise to propagate or
-    modify it is void, and will automatically terminate your rights under
-    this License (including any patent licenses granted under the third
-    paragraph of section 11).</p>
-  <p align="left">However, if you cease all violation of this License, then your
-    license from a particular copyright holder is reinstated (a)
-    provisionally, unless and until the copyright holder explicitly and
-    finally terminates your license, and (b) permanently, if the copyright
-    holder fails to notify you of the violation by some reasonable means
-    prior to 60 days after the cessation.</p>
-  <p align="left">Moreover, your license from a particular copyright holder is
-    reinstated permanently if the copyright holder notifies you of the
-    violation by some reasonable means, this is the first time you have
-    received notice of violation of this License (for any work) from that
-    copyright holder, and you cure the violation prior to 30 days after
-    your receipt of the notice.</p>
-  <p align="left">Termination of your rights under this section does not terminate the
-    licenses of parties who have received copies or rights from you under
-    this License.  If your rights have been terminated and not permanently
-    reinstated, you do not qualify to receive new licenses for the same
-    material under section 10.</p>
-  <h4 align="left"><a name="section9"></a>9. Acceptance Not Required for Having Copies.</h4>
-  <p align="left">You are not required to accept this License in order to receive or
-    run a copy of the Program.  Ancillary propagation of a covered work
-    occurring solely as a consequence of using peer-to-peer transmission
-    to receive a copy likewise does not require acceptance.  However,
-    nothing other than this License grants you permission to propagate or
-    modify any covered work.  These actions infringe copyright if you do
-    not accept this License.  Therefore, by modifying or propagating a
-    covered work, you indicate your acceptance of this License to do so.</p>
-  <h4 align="left"><a name="section10"></a>10. Automatic Licensing of Downstream Recipients.</h4>
-  <p align="left">Each time you convey a covered work, the recipient automatically
-    receives a license from the original licensors, to run, modify and
-    propagate that work, subject to this License.  You are not responsible
-    for enforcing compliance by third parties with this License.</p>
-  <p align="left">An “entity transaction” is a transaction transferring control of an
-    organization, or substantially all assets of one, or subdividing an
-    organization, or merging organizations.  If propagation of a covered
-    work results from an entity transaction, each party to that
-    transaction who receives a copy of the work also receives whatever
-    licenses to the work the party's predecessor in interest had or could
-    give under the previous paragraph, plus a right to possession of the
-    Corresponding Source of the work from the predecessor in interest, if
-    the predecessor has it or can get it with reasonable efforts.</p>
-  <p align="left">You may not impose any further restrictions on the exercise of the
-    rights granted or affirmed under this License.  For example, you may
-    not impose a license fee, royalty, or other charge for exercise of
-    rights granted under this License, and you may not initiate litigation
-    (including a cross-claim or counterclaim in a lawsuit) alleging that
-    any patent claim is infringed by making, using, selling, offering for
-    sale, or importing the Program or any portion of it.</p>
-  <h4 align="left"><a name="section11"></a>11. Patents.</h4>
-  <p align="left">A “contributor” is a copyright holder who authorizes use under this
-    License of the Program or a work on which the Program is based.  The
-    work thus licensed is called the contributor's “contributor version”.</p>
-  <p align="left">A contributor's “essential patent claims” are all patent claims
-    owned or controlled by the contributor, whether already acquired or
-    hereafter acquired, that would be infringed by some manner, permitted
-    by this License, of making, using, or selling its contributor version,
-    but do not include claims that would be infringed only as a
-    consequence of further modification of the contributor version.  For
-    purposes of this definition, “control” includes the right to grant
-    patent sublicenses in a manner consistent with the requirements of
-    this License.</p>
-  <p align="left">Each contributor grants you a non-exclusive, worldwide, royalty-free
-    patent license under the contributor's essential patent claims, to
-    make, use, sell, offer for sale, import and otherwise run, modify and
-    propagate the contents of its contributor version.</p>
-  <p align="left">In the following three paragraphs, a “patent license” is any express
-    agreement or commitment, however denominated, not to enforce a patent
-    (such as an express permission to practice a patent or covenant not to
-    sue for patent infringement).  To “grant” such a patent license to a
-    party means to make such an agreement or commitment not to enforce a
-    patent against the party.</p>
-  <p align="left">If you convey a covered work, knowingly relying on a patent license,
-    and the Corresponding Source of the work is not available for anyone
-    to copy, free of charge and under the terms of this License, through a
-    publicly available network server or other readily accessible means,
-    then you must either (1) cause the Corresponding Source to be so
-    available, or (2) arrange to deprive yourself of the benefit of the
-    patent license for this particular work, or (3) arrange, in a manner
-    consistent with the requirements of this License, to extend the patent
-    license to downstream recipients.  “Knowingly relying” means you have
-    actual knowledge that, but for the patent license, your conveying the
-    covered work in a country, or your recipient's use of the covered work
-    in a country, would infringe one or more identifiable patents in that
-    country that you have reason to believe are valid.</p>
-  <p align="left">If, pursuant to or in connection with a single transaction or
-    arrangement, you convey, or propagate by procuring conveyance of, a
-    covered work, and grant a patent license to some of the parties
-    receiving the covered work authorizing them to use, propagate, modify
-    or convey a specific copy of the covered work, then the patent license
-    you grant is automatically extended to all recipients of the covered
-    work and works based on it.</p>
-  <p align="left">A patent license is “discriminatory” if it does not include within
-    the scope of its coverage, prohibits the exercise of, or is
-    conditioned on the non-exercise of one or more of the rights that are
-    specifically granted under this License.  You may not convey a covered
-    work if you are a party to an arrangement with a third party that is
-    in the business of distributing software, under which you make payment
-    to the third party based on the extent of your activity of conveying
-    the work, and under which the third party grants, to any of the
-    parties who would receive the covered work from you, a discriminatory
-    patent license (a) in connection with copies of the covered work
-    conveyed by you (or copies made from those copies), or (b) primarily
-    for and in connection with specific products or compilations that
-    contain the covered work, unless you entered into that arrangement,
-    or that patent license was granted, prior to 28 March 2007.</p>
-  <p align="left">Nothing in this License shall be construed as excluding or limiting
-    any implied license or other defenses to infringement that may
-    otherwise be available to you under applicable patent law.</p>
-  <h4 align="left"><a name="section12"></a>12. No Surrender of Others' Freedom.</h4>
-  <p align="left">If conditions are imposed on you (whether by court order, agreement or
-    otherwise) that contradict the conditions of this License, they do not
-    excuse you from the conditions of this License.  If you cannot convey a
-    covered work so as to satisfy simultaneously your obligations under this
-    License and any other pertinent obligations, then as a consequence you may
-    not convey it at all.  For example, if you agree to terms that obligate you
-    to collect a royalty for further conveying from those to whom you convey
-    the Program, the only way you could satisfy both those terms and this
-    License would be to refrain entirely from conveying the Program.</p>
-  <h4 align="left"><a name="section13"></a>13. Use with the GNU Affero General Public License.</h4>
-  <p align="left">Notwithstanding any other provision of this License, you have
-    permission to link or combine any covered work with a work licensed
-    under version 3 of the GNU Affero General Public License into a single
-    combined work, and to convey the resulting work.  The terms of this
-    License will continue to apply to the part which is the covered work,
-    but the special requirements of the GNU Affero General Public License,
-    section 13, concerning interaction through a network will apply to the
-    combination as such.</p>
-  <h4 align="left"><a name="section14"></a>14. Revised Versions of this License.</h4>
-  <p align="left">The Free Software Foundation may publish revised and/or new versions of
-    the GNU General Public License from time to time.  Such new versions will
-    be similar in spirit to the present version, but may differ in detail to
-    address new problems or concerns.</p>
-  <p align="left">Each version is given a distinguishing version number.  If the
-    Program specifies that a certain numbered version of the GNU General
-    Public License “or any later version” applies to it, you have the
-    option of following the terms and conditions either of that numbered
-    version or of any later version published by the Free Software
-    Foundation.  If the Program does not specify a version number of the
-    GNU General Public License, you may choose any version ever published
-    by the Free Software Foundation.</p>
-  <p align="left">If the Program specifies that a proxy can decide which future
-    versions of the GNU General Public License can be used, that proxy's
-    public statement of acceptance of a version permanently authorizes you
-    to choose that version for the Program.</p>
-  <p align="left">Later license versions may give you additional or different
-    permissions.  However, no additional obligations are imposed on any
-    author or copyright holder as a result of your choosing to follow a
-    later version.</p>
-  <h4 align="left"><a name="section15"></a>15. Disclaimer of Warranty.</h4>
-  <p align="left">THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
-    APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
-    HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM “AS IS” WITHOUT WARRANTY
-    OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
-    THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-    PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
-    IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
-    ALL NECESSARY SERVICING, REPAIR OR CORRECTION.</p>
-  <h4 align="left"><a name="section16"></a>16. Limitation of Liability.</h4>
-  <p align="left">IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-    WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
-    THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
-    GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
-    USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
-    DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
-    PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
-    EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
-    SUCH DAMAGES.</p>
-  <h4 align="left"><a name="section17"></a>17. Interpretation of Sections 15 and 16.</h4>
-  <p align="left">If the disclaimer of warranty and limitation of liability provided
-    above cannot be given local legal effect according to their terms,
-    reviewing courts shall apply local law that most closely approximates
-    an absolute waiver of all civil liability in connection with the
-    Program, unless a warranty or assumption of liability accompanies a
-    copy of the Program in return for a fee.</p>
-  <p align="center">END OF TERMS AND CONDITIONS</p>
-  <h3 align="center"><a name="howto"></a>How to Apply These Terms to Your New Programs</h3>
-  <p align="left">If you develop a new program, and you want it to be of the greatest
-    possible use to the public, the best way to achieve this is to make it
-    free software which everyone can redistribute and change under these terms.</p>
-  <p align="left">To do so, attach the following notices to the program.  It is safest
-    to attach them to the start of each source file to most effectively
-    state the exclusion of warranty; and each file should have at least
-    the “copyright” line and a pointer to where the full notice is found.</p>
-  <div align="left">
-    <pre>    <one line to give the program's name and a brief idea of what it does.>
-    Copyright (C) <year>  <name of author>
-
-    This program is free software: you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation, either version 3 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with this program.  If not, see <http://www.gnu.org/licenses/>.
-  </pre>
-  </div>
-  <p align="left">Also add information on how to contact you by electronic and paper mail.</p>
-  <p align="left">If the program does terminal interaction, make it output a short
-    notice like this when it starts in an interactive mode:</p>
-  <div align="left">
-    <pre>    <program>  Copyright (C) <year>  <name of author>
-    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
-    This is free software, and you are welcome to redistribute it
-    under certain conditions; type `show c' for details.
-  </pre>
-  </div>
-  <p align="left">The hypothetical commands `show w' and `show c' should show the appropriate
-    parts of the General Public License.  Of course, your program's commands
-    might be different; for a GUI interface, you would use an “about box”.</p>
-  <p align="left">You should also get your employer (if you work as a programmer) or school,
-    if any, to sign a “copyright disclaimer” for the program, if necessary.
-    For more information on this, and how to apply and follow the GNU GPL, see
-  <http://www.gnu.org/licenses/>.</p>
-  <p align="left">The GNU General Public License does not permit incorporating your program
-    into proprietary programs.  If your program is a subroutine library, you
-    may consider it more useful to permit linking proprietary applications with
-    the library.  If this is what you want to do, use the GNU Lesser General
-    Public License instead of this License.  But first, please read
-<http://www.gnu.org/philosophy/why-not-lgpl.html>.</p></CENTER>
-
-<CENTER>
-  <P>The above license was obtained from the <A HREF="http://www.gnu.org/">Free
-Software Foundation</A> in July, 2009.<BR>
-  Previous MB-System releases were licensed using the GNU General Public License version 2.<BR><BR>
-    Last Updated: $Date: 2004/12/18 01:29:20 $ $Revision: 5.3 $</P>
-</CENTER>
-
-<P>
-<HR WIDTH="67%"></P>
-
-<P><A HREF="mbsystem_home.html"><IMG SRC="mbsystem_logo_small.gif" BORDER=0 HEIGHT=55 WIDTH=158 ALIGN=BOTTOM></A><A HREF="mbsystem_home.html">Back
-to MB-System Home Page...</A></P>
-
-</BODY>
-</HTML>
diff --git a/src/html/index.html b/src/html/index.html
deleted file mode 100644
index e1c1169..0000000
--- a/src/html/index.html
+++ /dev/null
@@ -1,312 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
-<html>
-<head>
-  <title>MB-System Documentation</title>
-  <meta http-equiv="Content-Type" content="text/html">
-  <meta name="Title" content="MB-System: Mapping the Seafloor">
-  <meta name="Author" content="David Caress, Dale Chayes">
-  <meta name="Description"
- content="open source software for processing bathymetry and backscatter data from multibeam and sidescan sonar">
-  <meta name="Keywords"
- content="seafloor,mapping,multibeam,sonar,bathymetry,sidescan,swath processing,open,source,software">
-</head>
-<body alink="#cc9900" bgcolor="#ffffff" link="#336699" text="#000000"
- vlink="#997040">
-<h2 align="center"><img src="mbsystem_logo.gif" height="207" width="616"></h2>
-<center>
-<dl>
-  <dt><b><font size="+2">Seafloor Mapping Software:</font></b></dt>
-</dl>
-</center>
-<center>
-<dl>
-  <dt><b><font size="+2">Processing and Display</font></b></dt>
-</dl>
-</center>
-<center>
-<dl>
-  <dt><b><font size="+2">of Swath Sonar Data</font></b></dt>
-</dl>
-</center>
-<center>
-<dl>
-  <dt><b> </b></dt>
-</dl>
-</center>
-<center>
-<dl>
-  <dt><b><font size="+1"><a href="http://www.mbari.org/staff/caress">David
-W. Caress</a> (1) and <a href="http://www.ldeo.columbia.edu/%7Edale">Dale
-N. Chayes</a> (2)</font></b></dt>
-</dl>
-</center>
-<center>
-<dl>
-  <dt><b>1. <a href="http://www.mbari.org/">Monterey Bay Aquarium
-Research Institute</a></b></dt>
-</dl>
-</center>
-<center>
-<dl>
-  <dt><b>2. <a href="http://www.ldeo.columbia.edu/">Lamont-Doherty
-Earth Observatory</a></b></dt>
-</dl>
-</center>
-<center>
-<dl>
-  <dt><b>of <a href="http://www.columbia.edu/">Columbia University</a></b></dt>
-</dl>
-</center>
-<center>
-<p></p>
-<hr width="67%">
-<p></p>
-</center>
-<center>
-<dl>
-  <dt><b><font size="+1">Introduction</font></b></dt>
-</dl>
-</center>
-<p>MB-System is an open source software package for the processing and
-display of bathymetry and backscatter imagery data derived from
-multibeam,
-interferometry, and sidescan sonars. This software is distributed
-freely (and
-for free) in the form of source code for Unix platforms. The heart of
-the
-system is an input/output library called MBIO which allows programs to
-work
-transparently with any of a number of supported swath sonar data
-formats.
-This approach has allowed the creation of "generic" utilities which can
-be
-applied in a uniform manner to sonar data from a variety of sources.
-Most of
-the programs are command-line tools, but the package does include
-graphical
-tools for editing swath bathymetry, editing navigation, modeling
-bathymetry
-calculation, and adjusting survey navigation.</p>
-<p>The acronym MB stands for MultiBeam; this reflects the fact that the
-early
-development of MB-System focused on processing data from deep sea multibeam sonars (which were the only kind around back then). However, MB-System now supports several data formats from
-sidescan
-and interferometric sonars and works with data from all depth ranges.</p>
-<p>The <a href="http://www.nsf.gov">National Science Foundation</a>
-(NSF) has
-been the primary supporter of MB-System development. NSF initially
-provided
-grants to the authors at the <a href="http://www.ldeo.columbia.edu">
-Lamont-Doherty Earth Observatory</a> in 1993 (two years), and 1995
-(five
-years). <a href="http://www.seabeam.com/"> SeaBeam Instruments</a>
-also
-contributed significant effort from 1994 to 1999. This support has been
-renewed
-through successive parallel five year grants (2001-2006, 2006-2011, 2013-2017) to Caress at the <a
- href="http://www.mbari.org"> Monterey Bay Aquarium Research Institute</a>
-(MBARI) and to Chayes at Lamont. Since 2001, MBARI, with support from the Packard Foundation, has matched 
-the NSF support as part of its seafloor mapping program. </p>
-<p>The original NSF mandate was to create a set of generic tools which
-would
-work with all of the sonar data used in NSF-supported projects. Not
-surprisingly, the core of the MB-System user community consists of
-NSF-supported researchers at U.S. institutions such as the
-Lamont-Doherty
-Earth Observatory, the Scripps Institution of Oceanography, and the
-Woods
-Hole Oceanographic Institution. However, MB-System has also come to be
-used
-widely in the international marine geological community.</p>
-<p>The MB-System source code is distributed under the <a
- href="gpl.html"> GNU
-General Public License</a> as formulated by the <a
- href="http://www.gnu.org/">GNU Project.</a> MB-System
-installation depends on
-some other software packages (e.g. <a
- href="http://gmt.soest.hawaii.edu/"> GMT</a> and <a
- href="http://www.unidata.ucar.edu/software/netcdf/">netCDF</a> ), all of
-which are freely available as source code.</p>
-<p>This documention is distributed with and refers to the MB-System release
-with <a href="mbsystem_version.txt">this version</a>.</p>
-<center>
-<p></p>
-<hr width="67%">
-<p></p>
-</center>
-<center>
-<dl>
-  <dt><b><font size="+1">Information About MB-System:</font></b></dt>
-</dl>
-</center>
-<ul>
-  <li><a href="mbsystem_whatsnew.html">What's new in MB-System version 5</a></li>
-  <li><a href="mbsystem_capabilities.html">Short list of capabilities</a></li>
-  <li><a href="mbsystem_man_list.html">List of MB-System programs and
-links to manual pages</a></li>
-  <li><a href="mbsystem_formats.html">List of supported swath data
-formats</a></li>
-  <li><a href="mbsystem_how_to_get.html">How to get and install
-MB-System</a></li>
-  <li><a href="mbsystem_faq.html">Frequently Asked Questions (and
-answers)</a></li>
-  <li><a href="mbsystem_future.html">Future MB-System development plans</a></li>
-  <li><a href="mbsystem_copyright.html">Copyright and Caveat</a></li>
-</ul>
-<center>
-<p></p>
-<hr width="67%">
-<p></p>
-</center>
-<center>
-<center>
-<dl>
-  <dt><b><font size="+1">Contacting the MB-System Team:</font></b></dt>
-</dl>
-</center>
-<div style="text-align: justify;">
-Although the MB-System authors' personal email addresses are listed
-below, we
-greatly prefer that all inquiries, requests, and problem reports
-regarding
-MB-System be directed to the <a
- href="http://listserver.mbari.org/sympa/arc/mbsystem">MB-System
-Discussion list</a>.<br>
-<br>
-<span style="text-decoration: underline;"></span></div>
-<center>
-<hr width="67%"></center>
-<dl>
-  <dt><a name="MB-authors"></a> <b><font size="+1">The MB-System Core Team</font><font size="+1">:
-    </font></b></dt>
-</dl>
-</center>
-<center>
-<table cellpadding="0" cellspacing="0" width="100%">
-  <tbody>
-    <tr>
-      <td align="center" valign="top">
-      <dt><img alt="David W. Caress 2001" src="caress2001.gif" width="120"></dt>
-        <dt><b><a href="http://www.mbari.org/staff/caress">David W. Caress</a></b></dt>
-        <dt><a href="mailto:caress at mbari.org">caress at mbari.org</a></dt>
-        <dt>Software Engineer</dt>
-        <dt><a href="http://www.mbari.org">Monterey Bay Aquarium Research Institute</a></dt>
-        <dt>7700 Sandholdt Road</dt>
-        <dt>Moss Landing, CA 95039</dt>
-        <dt> </dt>
-      </td>
-    </tr>
-    <tr>
-      <td align="center" valign="top">
-      <dl>
-     <dt><img alt="Dale N. Chayes 2003" src="ChayesJul2003.gif" width="120"></dt>
-      <dt><b><a href="http://www.ldeo.columbia.edu/%7Edale">Dale N. Chayes</a></b></dt>
-        <dt><a href="mailto:dale at ldeo.columbia.edu">dale at ldeo.columbia.edu</a></dt>
-        <dt>Research Engineer</dt>
-        <dt><a href="http://www.ldeo.columbia.edu">Lamont-Doherty
-Earth Observatory</a> of <a href="http://www.columbia.edu">Columbia
-University</a></dt>
-        <dt>Palisades, NY 10964</dt>
-        <dd> </dd>
-      </dl>
-      </td>
-    </tr>
-    <tr>
-      <td align="center" valign="top">
-      <dt><img src="Christina_d_S_Ferreira_crop.jpg" width="120" alt="Christian dos Santos Ferreira 2014"></dt>
-      <dt><b><a href="https://www.marum.de/en/Christian_dos_Santos_Ferreira.html">Christian dos Santos Ferreira</a></b></dt>
-        <dt><a href="mailto:cferreira at marum.de">cferreira at marum.de</a></dt>
-        <dt>Seafloor Imaging Specialist<br>
-          <a href="http://www.marum.de">MARUM - Center for Marine Environmental Sciences</a><br>
-          <a href="http://www.uni-bremen.de">University of Bremen</a>, </dt>
-        <dt>Bremen, Germany</dt>
-        <dt> </dt>
-      </td>
-    </tr>
-  </tbody>
-</table>
-</center>
-<dd><br>
-</dd>
-<center>
-<p></p>
-<hr width="67%">
-<p></p>
-</center>
-<center>
-<dl>
-  <dt><a name="MB-documentors"></a> <b><font size="+1"> Documentation:</font></b></dt>
-</dl>
-</center>
-<center>
-
-<table cellpadding="0" cellspacing="0" width="100%">
-  <tbody>
-    <tr>
-      <td height="384" align="center" valign="top">
-      <div align="center">
-      <dt><img alt="Krystle Anderson 2013" src="KrystleAnderson2013.gif" width="120"></dt>
-        <dt><b>Krystle Anderson</b></dt>
-        <dt><a href="mailto:krystle at mbari.org">krystle at mbari.org</a></dt>
-        <dt>Research Technician</dt>
-        <dt><a href="http://www.mbari.org">Monterey Bay Aquarium Research Institute</a></dt>
-        <dt>7700 Sandholdt Road</dt>
-        <dt>Moss Landing, CA 95039</dt>
-        <dt> </dt>
-        <dt></dt>
-      </div>
-      <div align="center">
-      <dt><img alt="Val Schmidt at LDEO in July 2003" src="ValJul2003.gif" width="120"></dt>
-        <dt><b>Val Schmidt</b></dt>
-        <dt>(Emeritus)</dt>
-        <dt><a href="mailto:vschmidt at ccom.unh.edu">vschmidt at ccom.unh.edu</a></dt>
-        <dt>Research Engineer</dt>
-        <dt><a href="http://www.ccom.unh.edu">Center of Coastal and Ocean Mapping</a></dt>
-        <dt><a href="http://www.ccom.unh.edu">Joint Hydrographic Center</a> of</dt>
-        <dt><a href="http://www.unh.edu">University of New Hampshire</a></dt>
-        <dt>Durham, NH 03824</dt>
-      </div>
-      </td>
-    </tr>
-  </tbody>
-</table>
-</center>
-<center>
-<hr width="67%">
-<p></p>
-</center>
-<center>
-<dl>
-  <dt><a name="MB-team"></a> <b><font size="+1">The MB-System Team 2014:</font></b></dt>
-</dl>
-</center>
-<center>
-<dl>
-  <dt><b><font size="+1"><img alt="Ferreira, Caress, Chayes at MBARI February 2014" src="caress_chayes_ferreira_Feb2014.jpg"> </font></b></dt>
-</dl>
-</center>
-<center>
-<dl>
-  <dt><a name="MB-team"></a> <b><font size="+1">The MB-System Team circa 2003:</font></b></dt>
-</dl>
-</center>
-<center>
-<dl>
-  <dt><b><font size="+1"><img alt="July 2003 at IRI Building, LDEO" src="MBTeamJul2003.jpg"> </font></b></dt>
-</dl>
-</center>
-<dl>
-  <dt><br>
-  </dt>
-</dl>
-<center>
-<p>Last Updated: $Id: mbsystem_home.html 2180 2014-04-02 20:58:34Z caress $</p>
-</center>
-<p></p>
-<div align="center">
-<hr width="67%"></div>
-<br>
- 
-<p></p>
-</body>
-</html>
diff --git a/src/html/lamont_logo.gif b/src/html/lamont_logo.gif
deleted file mode 100644
index fdf222b..0000000
Binary files a/src/html/lamont_logo.gif and /dev/null differ
diff --git a/src/html/lamont_masthead.gif b/src/html/lamont_masthead.gif
deleted file mode 100644
index fdf222b..0000000
Binary files a/src/html/lamont_masthead.gif and /dev/null differ
diff --git a/src/html/make_mbhtml b/src/html/make_mbhtml
deleted file mode 100755
index 6b2e35d..0000000
--- a/src/html/make_mbhtml
+++ /dev/null
@@ -1,220 +0,0 @@
-eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
-                    & eval 'exec perl -S $0 $argv:q'
-                         if 0;
-#--------------------------------------------------------------------
-#    The MB-system:	make_mbhtml	8/19/97
-#    $Id: make_mbhtml 2175 2014-03-18 23:03:39Z caress $
-#
-#    Copyright (c) 1997-2014 by 
-#    D. W. Caress (caress at lamont.ldgo.columbia.edu)
-#    and D. N. Chayes (dale at lamont.ldgo.columbia.edu)
-#    Lamont-Doherty Earth Observatory
-#    Palisades, NY  10964
-#
-#    See README file for copying and redistribution conditions.
-#--------------------------------------------------------------------
-#
-# Command:
-#   make_mbhtml
-#
-# Purpose:
-#   Macro to automatically generate html files from
-#   MB-System man pages and place them in the mbsystem/html
-#   directory. This tool is not for direct inclusion in the
-#   MB-System distribution.
-#
-# Author:
-#   David W. Caress
-#   Lamont-Doherty Earth Observatory
-#   Palisades, NY  10964
-#   August 19,  1997
-#
-# Version:
-#   $Id: make_mbhtml 2175 2014-03-18 23:03:39Z caress $
-#
-# Revisions:
-#   $Log: make_mbhtml,v $
-#   Revision 5.12  2003/12/04 23:10:21  caress
-#   Fixed problems with format 54 EM12DARW due to old code assuming how internal structure was packed. Also changed handling of beamflags for formats that don't support beamflags. Now flagged beams will always be nulled in such cases.
-#
-#   Revision 5.11  2003/08/07 21:21:50  caress
-#   Changed to reflect use of CVS instead of raw RCS and the placement of source manual pages in mbystem/man/manl instead of src/* directories.
-#
-#   Revision 5.10  2003/04/17 21:43:48  caress
-#   Release 5.0.beta30
-#
-#   Revision 5.9  2002/08/30 19:55:38  caress
-#   Release 5.0.beta22.
-#   Fixed script for SGI.
-#
-#   Revision 5.8  2002/08/28 01:36:56  caress
-#   Updated documentation for 5.0.beta22.
-#
-#   Revision 5.7  2002/07/22 01:11:43  caress
-#   Added generation of postscript files.
-#
-#   Revision 5.6  2002/01/02 20:20:08  caress
-#   Fixed handling of operating system differences.
-#
-# Revision 5.5  2001/12/30  21:03:54  caress
-# Fixed handling of operating system parameter.
-#
-#   Revision 5.4  2001/11/19 23:52:41  dcaress
-#   Made it work on both SGI's and Linux.
-#
-#   Revision 5.3  2001-07-20 11:00:05-07  caress
-#   Don't know what I did...
-#
-# Revision 5.2  2001/06/08  21:54:03  caress
-# Version 5.0.beta01
-#
-# Revision 5.1  2001/04/25  05:10:56  caress
-# Changed from using awf to groff.
-#
-#   Revision 5.0  2001/03/23 01:48:38  caress
-#   Trying to get out release 5.0.beta00.
-#
-# Revision 4.3  1997/09/17  21:48:31  caress
-# Fixed typo.
-#
-# Revision 4.2  1997/09/17  21:46:07  caress
-# Put last update into man page html files.
-#
-# Revision 4.1  1997/09/17  20:07:29  caress
-# Fixed details.
-#
-# Revision 4.0  1997/09/15  19:13:10  caress
-# Real Version 4.5
-#
-#
-#--------------------------------------------------------------------
-#
-# Set program name
-$program_name = "make_mbhtml";
-
-# Make html and ps directories if necessary
-print "make sure ../../html and ../../ps exist and are empty\n";
-`mkdir ../../html`;
-`mkdir ../../ps`;
-`/bin/rm -f ../../html/*`;
-`/bin/rm -f ../../ps/*`;
-
-# generate mbsystem_formats.html using special option for mbformat
-print "mbformat -W > mbsystem_formats.html\n";
-`mbformat -W > mbsystem_formats.html`;
-
-# Copy necessary files
- at preformatted_files = `/bin/ls -1 mbsystem*.html gpl.html MBTeamJul2003.gif caress2001.gif ChayesJul2003.gif ValJul2003.gif mbsystem*.gif`;
-foreach $file (@preformatted_files) {
-    chop($file);
-    print "cp $file ../../html\n";
-    `cp $file ../../html`;
-    chmod 0664, "../../html/$file";
-    }
-
-# Make index.html
-`cd ../../html ; ln -s mbsystem_home.html index.html`;
-
-# Get list of man page files to process
- at manual_pages = `/bin/ls -1 ../../man/man*/* | grep [mh][bs]`;
-
-# Get header and footer data
- at man_header_lines = `cat mbsystem_man_hdr.frag`;
- at man_header2_lines = `cat mbsystem_man_hdr2.frag`;
- at man_footer_lines = `cat mbsystem_man_ftr.frag`;
-
-# Get operating system
-$os = `uname -s`;
-chop($os);
-if ($os eq "IRIX64") 
-    {
-    $groff = "awf";
-    $groff = "/usr/freeware/bin/groff";
-    }
-else
-    {
-    $groff = "groff";
-    }
-print "Operating System: $os\nFormatter: $groff\n";
-
-# Loop over files
-`cc man2html.c -o man2html`;
-foreach $manpageraw (@manual_pages) {
-    chop($manpageraw);
-    ($man_page) = $manpageraw =~ /^\.\.\/\.\.\/man\/man.\/(\S+)\../;
-    print "\nProcessing manual page for $man_page...\n";
-
-    # first generate a postscript version for mbsystem/ps
-    print "Generating ../../ps/$man_page.ps\n";
-    `$groff -man -Tps $manpageraw > ../../ps/$man_page.ps`;
-    
-    # Generate an initial html file
-    print "Generating ../../html/$man_page.html\n";
-    $raw_html_file = "./$man_page.html";
-    $date = `head -1 $manpageraw | awk '{print \$4,\$5,\$6}'`;
-    chop($date);
-    chop($date);
-    $date = substr($date, 1);
-#    `cat $manpageraw | ./man2html -leftm 1 -topm 5 -botm 5 -pgsize 55 > $raw_html_file`; 
-#    `$groff -man -Thtml $manpageraw  > $raw_html_file`;
-    `cat $manpageraw | man2html -f > $raw_html_file`;
-
-    # Open the input file
-    if (!open(IHTML,"$raw_html_file"))
-	{
-	print "\a";
-	die "Cannot open raw html file $raw_html_file\nMacro $program_name aborted.\n";
-	}
-
-    # Open the output html file
-    $html_file = "../../html/$man_page.html";
-    if (!open(OHTML,">$html_file"))
-	{
-	print "\a";
-	die "Cannot open output file $html_file\nMacro $program_name aborted.\n";
-	}
-
-    # Put header stuff into html file
-    foreach $line (@man_header_lines) {
-	print OHTML $line;
-	}
-    print OHTML "   <TITLE>MB-System Unix Manual Page: $man_page</TITLE>\n";
-    foreach $line (@man_header2_lines) {
-	print OHTML $line;
-	}
-	
-    # Read and process lines from raw html file
-    $line_count = 0;
-    $line_total = `cat $raw_html_file | wc -l`;
-    while ($line = <IHTML>) {
-	$line_count++;
-	if ($line_count > 3 
-	    && $line_count < $line_total - 3)
-	    {
-	    print OHTML $line;
-	    }
-	}
-
-    # Close and remove the raw html file
-    close IHTML;
-    `rm -f $raw_html_file`;
-    
-    # Put last update date line into html file
-    print OHTML "</PRE>\n\n<CENTER><P><BR>\nLast Updated: $date</P></CENTER>\n\n";
-
-    # Put footer stuff into html file
-    foreach $line (@man_footer_lines) {
-	print OHTML $line;
-	}
-
-    # Close the output file and set mode
-    close OHTML;
-    chmod 0664, $html_file;
-    
-    # End loop over man pages
-    }
-    
-# Exit the program
-exit 0;
-
-#-----------------------------------------------------------------------
diff --git a/src/html/man2html b/src/html/man2html
deleted file mode 100755
index 39eba3a..0000000
Binary files a/src/html/man2html and /dev/null differ
diff --git a/src/html/man2html.c b/src/html/man2html.c
deleted file mode 100644
index 1d9b127..0000000
--- a/src/html/man2html.c
+++ /dev/null
@@ -1,4270 +0,0 @@
-/*
- * $Id: man2html.c 1770 2009-10-19 17:16:39Z caress $
- *
-** This program was written by Richard Verhoeven (NL:5482ZX35)
-** at the Eindhoven University of Technology. Email: rcb5 at win.tue.nl
-**
-** Permission is granted to distribute, modify and use this program as long
-** as this comment is not removed or changed.
-*/
-
-/* 
- * man2html-linux-1.0/1.1
- * This version modified for Redhat/Caldera linux - March 1996.
- * Michael Hamilton <michael at actrix.gen.nz>.
- *
- * man2html-linux-1.2
- * Added support for BSD mandoc pages - I didn't have any documentation
- * on the mandoc macros, so I may have missed some.
- * Michael Hamilton <michael at actrix.gen.nz>.
- *
- * vh-man2html-1.3
- * Renamed to avoid confusion (V for Verhoeven, H for Hamilton).
- *
- * vh-man2html-1.4
- * Now uses /etc/man.config
- * Added support for compressed pages.
- * Added "length-safe" string operations for client input parameters.
- * More secure, -M secured, and client input string lengths checked.
- *
- *
- * This is now the LessTif version, check for that cpp #define.
- * Note that worthwhile additions are no longer marked with this
- * flag! Also we meanwhile dropped all functionality which we 
- * don't need - so this is no longer a version compatible with the
- * original ...
- *
- *
- * WAIT!!! This is now a version hacked for generation of MB-System
- * man pages as part of the distribution-generating scripts
- *   David W. Caress
- *   Monterey Bay Aquarium Research Institute
- *   August 6, 2002
- *
- */
-
-/*
-** If you want to use this program for your WWW server, adjust the line
-** which defines the CGIBASE or compile it with the -DCGIBASE='"..."' option.
-**
-** You have to adjust the built-in manpath to your local system. Note that
-** every directory should start and end with the '/' and that the first
-** directory should be "/" to allow a full path as an argument.
-**
-** The program first check if PATH_INFO contains some information.
-** If it does (t.i. man2html/some/thing is used), the program will look
-** for a manpage called PATH_INFO in the manpath.
-**
-** Otherwise the manpath is searched for the specified command line argument,
-** where the following options can be used:
-**
-** name      name of manpage (csh, printf, xv, troff)
-** section   the section (1 2 3 4 5 6 7 8 9 n l 1v ...)
-** -M path   an extra directory to look for manpages (replaces "/")
-**
-** If man2html finds multiple manpages that satisfy the options, an index
-** is displayed and the user can make a choice. If only one page is
-** found, that page will be displayed.
-**
-** man2html will add links to the converted manpages. The function add_links
-** is used for that. At the moment it will add links as follows, where   
-**     indicates what should match to start with:
-** ^^^
-** Recognition           Item            Link
-** ----------------------------------------------------------
-** name(*)               Manpage         ../man?/name.*
-**     ^
-** name at hostname         Email address   mailto:name at hostname
-**     ^
-** method://string       URL             method://string
-**       ^^^
-** www.host.name         WWW server      http://www.host.name
-** ^^^^
-** ftp.host.name         FTP server      ftp://ftp.host.name
-** ^^^^
-** <file.h>              Include file    file:/usr/include/file.h
-**      ^^^
-**
-** Since man2html does not check if manpages, hosts or email addresses exist,
-** some links might not work. For manpages, some extra checks are performed
-** to make sure not every () pair creates a link. Also out of date pages
-** might point to incorrect places.
-**
-** The program will not allow users to get system specific files, such as
-** /etc/passwd. It will check that "man" is part of the specified file and
-** that  "/../" isn't. Even if someone manages to get such file, man2html will
-** handle it like a manpage and will usually not produce any output (or crash).
-**
-** If you find any bugs when normal manpages are converted, please report
-** them to me (rcb5 at win.tue.nl) after you have checked that man(1) can handle
-** the manpage correct.
-**
-** Known bugs and missing features:
-**
-**  * Equations are not converted at all.
-**  * Tables are converted but some features are not possible in html.
-**  * The tabbing environment is converted by counting characters and adding
-**    spaces. This might go wrong (outside <PRE>)
-**  * Some pages look beter if man2html works in troff mode, especially pages
-**    with tables. You can deside at compile time which made you want to use.
-**
-**    -DNROFF=0     troff mode
-**    -DNROFF=1     nroff mode   (default)
-**
-**    if you install both modes, you should compile with the correct CGIBASE.
-**  * Some manpages rely on the fact that troff/nroff is used to convert
-**    them and use features which are not descripted in the man manpages.
-**    (definitions, calculations, conditionals, requests). I can't guarantee
-**    that all these features work on all manpages. (I didn't have the
-**    time to look through all the available manpages.)
-*/
-
-
-/*
-#ifdef HAVE_CONFIG_H
-#include "LTconfig.h"
-#endif
-*/
-
-#ifndef NOLESSTIF
-#ifndef LESSTIF
-#define LESSTIF
-#endif
-#endif
-
-#ifdef LESSTIF
-#define NROFF 0
-#undef CASE_SENSITIVE /* amai: ? should be ok for us .. */
-#ifdef MAKEINDEX
-#undef MAKEINDEX
-#endif
-#define DISABLE_ZCATS
-#endif
-
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include <time.h>
-/* #include <errno.h> */
-#ifndef LESSTIF
-#include <sys/types.h>
-#include <sys/time.h>
-#include <sys/stat.h>
-#include <dirent.h>
-#include <errno.h>
-#include <unistd.h>
-#endif
-
-#ifdef  WITH_DMALLOC
-#ifndef DMALLOC_FUNC_CHECK
-#define DMALLOC_FUNC_CHECK
-#endif
-#include <dmalloc.h>
-#endif /* WITH_DMALLOC */
-
-
-#define NULL_TERMINATED(n) ((n) + 1)
-
-#define HUGE_STR_MAX  10000
-#define LARGE_STR_MAX 2000
-#define MED_STR_MAX   500
-#define SMALL_STR_MAX 100
-#define TINY_STR_MAX  10
-
-#define MAX_MAN_PATHS 100	/* Max number of directories */
-#define MAX_ZCATS     10	/* Max number of zcat style programs */
-#define MAX_WORDLIST  100
-
-
-#ifndef TOPLEVELDOC
-#define TOPLEVELDOC "/home/httpd/html/man.html"
-#endif
-
-#ifndef CGIBASE
-#define CGIBASE "http://localhost/cgi-bin/man2html"
-#endif
-
-#ifndef	MAINCONTENTS
-#define	MAINCONTENTS	CGIBASE
-#endif
-
-#ifndef NROFF
-#define NROFF 1
-#endif
-
-
-static int dofilter = 0;
-static int doweb    = 0; /* specific link conversion */
-
-
-#ifdef LESSTIF
-static const char *signature = "<HR>\n"
-"This document was created by <EM>man2html</EM>,\n"
-"using the manual pages.<BR>\n";
-#else
-static const char *signature = "<HR>\n"
-"This document was created by\n"
-"<A HREF=\""CGIBASE"\">man2html</A>,\n"
-"using the manual pages.<BR>\n"
-"Time: %s\n";
-static char location_base[NULL_TERMINATED(MED_STR_MAX)] = "";
-#endif
-
-/* timeformat for signature */
-#define TIMEFORMAT "%T GMT, %B %d, %Y"
-
-/* BSD mandoc Bl/El lists to HTML list types */
-#define BL_DESC_LIST   1
-#define BL_BULLET_LIST 2
-#define BL_ENUM_LIST   4
-
-/* BSD mandoc Bd/Ed example(?) blocks */
-#define BD_LITERAL  1
-#define BD_INDENT   2
-
-/* Don't bother with free(), it will just slow us down, the ultimate
-   free will be exit() anyway.  Hack to fix a malloc bug that I couldn't
-   track down (michael at actrix.gen.nz).
-   */
-/* Where do people learn to #redefine a standard function ?? :-(
-  #define free(x)
-*/
-
-/* no 'const' here! */
-static char *manpath[MAX_MAN_PATHS + 1] = { 
-                    "/",	/* for searches when path is absolute
-				 * But will be constrained by UNSECURE_MANPATH
-				 * setting.
-				 */
-		    "/usr/man/",
-		    "/usr/local/man/",
-		    "/usr/X11/man/",
-		    "/usr/X11R5/man/",
-		    "/usr/X11R6/man/",
-		    "/usr/dt/man/",
-		    "/usr/exp/man/",
-		    "/usr/openwin/man/",
-		    "/usr/tex/man/",
-		    "/usr/www/man/",
-		    "/usr/lang/man/",
-		    "/usr/gnu/man/",
-		    "/usr/motif/man/",
-		    "/usr/titools/man/",
-		    "/usr/sunpc/man/",
-		    "/usr/ncd/man/",
-		    "/usr/newsprint/man/",
-		    NULL };
-
-#ifndef DISABLE_ZCATS
-static const char *zcats[MAX_ZCATS + 1] = {
-                    ".Z\0/bin/zcat",
-                    ".gz\0/bin/gzip -d -c",
-                    NULL };
-#endif
-
-
-static char
-*strgrow(char *old, int len) 
-{
-  char *new;
-  
-/*  fprintf(stderr, "strlen(old)=%i\n", strlen(old)); */
-  new = realloc(old, (strlen(old) + len + 1) * sizeof(char));
-  if (!new) {
-    fprintf(stderr, "man2html: out of memory");
-    exit(EXIT_FAILURE);
-  }
-  return new;  
-}
-
-
-static char
-*stralloc(int len)
-{					
-  /* allocate enough for len + NULL */
-  char *new = malloc((len + 1) * sizeof(char));
-  if (!new) {
-    fprintf(stderr, "man2html: out of memory");
-    exit(EXIT_FAILURE);
-  }
-  return new;
-}
-
-
-#ifndef LESSTIF
-static char
-*strduplicate(char *from)
-{				
-/* Some systems don't have strdup so lets use our own - which can also
- * check for out of memory. 
- */
-  char *new = stralloc(strlen(from));
-
-  strcpy(new, from);
-  return new;
-}
-
-
-static char
-*strmaxcat(char *to, const char *from, int n)
-{				/* Assumes space for n plus a null */
-  int to_len = strlen(to);
-
-  if (to_len < n) {
-    int from_len = strlen(from);
-    int cp = (to_len + from_len <= n) ? from_len : n - to_len;
-    strncpy(to + to_len, from, cp);
-    to[to_len + cp] = '\0';
-  }
-  return to;
-}
-
-
-static char
-*escape_input(const char *str)
-/* takes string and escapes all metacharacters.  should be used before
-   including string in system() or similar call. */
-{
-  int i,j = 0;
-  static char new[NULL_TERMINATED(MED_STR_MAX)];
-
-  if (strlen(str) * 2 + 1 > MED_STR_MAX) {
-    fprintf(stderr, 
-	    "man2html: escape_input - str too long:\n%-80s...\n",
-	    str);
-    exit(EXIT_FAILURE);
-  }
-
-  for (i = 0; i < strlen(str); i++) {
-    if (!( ((str[i] >= 'A') && (str[i] <= 'Z')) ||
-           ((str[i] >= 'a') && (str[i] <= 'z')) ||
-           ((str[i] >= '0') && (str[i] <= '9')) )) {
-      new[j] = '\\';
-      j++;
-    }
-    new[j] = str[i];
-    j++;
-  }
-  new[j] = '\0';
-  return new;
-}                      
-
-
-static void
-usage(void)
-{
-    char buffer[NULL_TERMINATED(LARGE_STR_MAX)];
-    FILE *toplevel = fopen(TOPLEVELDOC, "r");
-    
-    if (!toplevel && errno == ENOENT) {
-      fputs("Content-type: text/html\n\n"
-	     "<HTML>\n"
-           "<HEAD>\n"
-	     "<TITLE>Manual Pages</TITLE>\n"
-	     "</HEAD><BODY>\n"
-	     "<H1>Manual Pages</H1>\n"
-	     "This is a HyperText interface to the UNIX manpages.\n"
-	     "You can enter a program name, the section, an extra\n"
-	     "directory (using -M) or a full name. For example\n"
-	     "<UL><LI><TT>elm</TT>\n"
-	     "<LI><TT>elm 1</TT>\n"
-	     "<LI><TT>-M /usr/local/man elm</TT>\n"
-	     "<LI><TT>/local/gcc/man/man1/gperf.1</TT>\n"
-	     "</UL>\n"
-	     "<ISINDEX>\n"
-	     "<P>\n"
-	     "This man2html converter was written by \n"
-	     "<A HREF=\"http://wsinwp01.win.tue.nl:1234/index.html\">"
-	     "Richard Verhoeven</A>\n"
-	     "</BODY></HTML>\n", stdout);
-      exit(0);      
-    }
-
-    if (!toplevel) {
-      fprintf(stderr, "man2html: error openning %s: %s\n", TOPLEVELDOC, strerror(errno));
-      exit(EXIT_FAILURE);
-    }
-    while (fgets(buffer, LARGE_STR_MAX, toplevel)) {
-        fputs(buffer,stdout);
-    }
-    if (!feof(toplevel)) {
-        fprintf(stderr, "man2html: error reading %s: %s\n", TOPLEVELDOC, strerror(errno));
-	exit(EXIT_FAILURE);
-    }
-    fclose(toplevel);
-    exit(0);
-}
-#endif /* #if LESSTIF */
-
-
-static char
-*strmaxcpy(char *to, const char *from, size_t n)
-{				/* Assumes space for n plus a null */
-  int len = strlen(from);
-  strncpy(to, from, n);
-  to[(len <= n) ? len : n] = '\0';
-  return to;
-}
-
-
-static char
-*strlimitcpy(char *to, const char *from, size_t n, size_t limit)
-{                               /* Assumes space for limit plus a null */
-  int len = n > limit ? limit : n;
-  strmaxcpy(to, from, len);
-  to[len] = '\0';
-  return to;
-}
-
-
-#ifndef DISABLE_ZCATS
-static FILE
-*pipe_open(const char *cmd, const char *filename)
-{
-  FILE *pipe_stream = NULL;
-  char cmdline[NULL_TERMINATED(LARGE_STR_MAX)];
-
-  if (strlen(filename) * 2 + 1 + strlen(cmd) + 1 > LARGE_STR_MAX) {
-    fprintf(stderr, "man2html: pipe_open - str too long:\n%-80s...\n", 
-	    filename);
-    return NULL;
-  }
-  strmaxcpy(cmdline, cmd, LARGE_STR_MAX);
-  strmaxcat(cmdline, " ", LARGE_STR_MAX);
-  strmaxcat(cmdline, escape_input(filename), LARGE_STR_MAX);  
-
-  pipe_stream = popen(cmdline, "r");	/* Potentially dangerious - CGI access to sh */
-  /* fprintf(stderr, "openned %s %s\n", cmdline, filename);  */
-  return pipe_stream;
-}
-
-static int pipe_close(FILE *f)
-{
-  return pclose(f);
-}
-#endif /* #ifndef DISABLE_ZCATS */
-
-
-
-/* below this you should not change anything unless you know a lot
-** about this program or about troff.
-*/
-
-
-typedef struct STRDEF STRDEF;
-struct STRDEF {
-    int nr,slen;
-    char *st;
-    STRDEF *next;
-};
-
-typedef struct INTDEF INTDEF;
-struct INTDEF {
-    int nr;
-    int val;
-    int incr;
-    INTDEF *next;
-};
-
-static char NEWLINE[2]="\n";
-static char idxlabel[6] = "ixAAA";
-
-#define INDEXFILE "/tmp/manindex.list"
-
-static char *fname;
-#ifdef MAKEINDEX
-static FILE *idxfile;
-#endif
-
-static STRDEF *chardef, *strdef, *defdef;
-static INTDEF *intdef;
-
-#define V(A,B) ((A)*256+(B))
-
-static INTDEF standardint[] = {
-    { V('n',' '), NROFF,0, NULL },
-    { V('t',' '), 1-NROFF,0, NULL },
-    { V('o',' '), 1,0, NULL },
-    { V('e',' '), 0,0, NULL },
-    { V('.','l'), 70,0,NULL },
-    { V('.','$'), 0,0, NULL },
-    { V('.','A'), NROFF,0, NULL },
-    { V('.','T'), 1-NROFF,0, NULL },
-    { V('.','V'), 1,0, NULL }, /* the me package tests for this */
-    { 0, 0, 0, NULL } };
-
-static STRDEF standardstring[] = {
-    { V('R',' '), 1, "®", NULL },
-    { V('l','q'), 2, "``", NULL },
-    { V('r','q'), 2, "''", NULL },
-    { 0, 0, NULL, NULL}
-};
-
-
-static STRDEF standardchar[] = {
-    { V('*','*'), 1, "*", NULL  },
-    { V('*','A'), 1, "A", NULL  },
-    { V('*','B'), 1, "B", NULL  },
-    { V('*','C'), 2, "Xi", NULL  },
-    { V('*','D'), 5, "Delta", NULL  },
-    { V('*','E'), 1, "E", NULL  },
-    { V('*','F'), 3, "Phi", NULL  },
-    { V('*','G'), 5, "Gamma", NULL  },
-    { V('*','H'), 5, "Theta", NULL  },
-    { V('*','I'), 1, "I", NULL  },
-    { V('*','K'), 1, "K", NULL  },
-    { V('*','L'), 6, "Lambda", NULL  },
-    { V('*','M'), 1, "M", NULL  },
-    { V('*','N'), 1, "N", NULL  },
-    { V('*','O'), 1, "O", NULL  },
-    { V('*','P'), 2, "Pi", NULL  },
-    { V('*','Q'), 3, "Psi", NULL  },
-    { V('*','R'), 1, "P", NULL  },
-    { V('*','S'), 5, "Sigma", NULL  },
-    { V('*','T'), 1, "T", NULL  },
-    { V('*','U'), 1, "Y", NULL  },
-    { V('*','W'), 5, "Omega", NULL  },
-    { V('*','X'), 1, "X", NULL  },
-    { V('*','Y'), 1, "H", NULL  },
-    { V('*','Z'), 1, "Z", NULL  },
-    { V('*','a'), 5, "alpha", NULL },
-    { V('*','b'), 4, "beta", NULL },
-    { V('*','c'), 2, "xi", NULL },
-    { V('*','d'), 5, "delta", NULL },
-    { V('*','e'), 7, "epsilon", NULL },
-    { V('*','f'), 3, "phi", NULL },
-    { V('*','g'), 5, "gamma", NULL },
-    { V('*','h'), 5, "theta", NULL },
-    { V('*','i'), 4, "iota", NULL },
-    { V('*','k'), 5, "kappa", NULL },
-    { V('*','l'), 6, "lambda", NULL },
-    { V('*','m'), 1, "µ", NULL  },
-    { V('*','n'), 2, "nu", NULL },
-    { V('*','o'), 1, "o", NULL },
-    { V('*','p'), 2, "pi", NULL },
-    { V('*','q'), 3, "psi", NULL },
-    { V('*','r'), 3, "rho", NULL },
-    { V('*','s'), 5, "sigma", NULL },
-    { V('*','t'), 3, "tau", NULL },
-    { V('*','u'), 7, "upsilon", NULL },
-    { V('*','w'), 5, "omega", NULL },
-    { V('*','x'), 3, "chi", NULL },
-    { V('*','y'), 3, "eta", NULL },
-    { V('*','z'), 4, "zeta", NULL },
-    { V('t','s'), 5, "sigma", NULL },
-    { V('+','-'), 1, "±", NULL  },
-    { V('1','2'), 1, "½", NULL  },
-    { V('1','4'), 1, "¼", NULL  },
-    { V('3','4'), 1, "¾", NULL  },
-    { V('F','i'), 3, "ffi", NULL  },
-    { V('F','l'), 3, "ffl", NULL  },
-    { V('a','a'), 1, "´", NULL  },
-    { V('a','p'), 1, "~", NULL  },
-    { V('b','r'), 1, "|", NULL  },
-    { V('b','u'), 1, "*", NULL  },
-    { V('b','v'), 1, "|", NULL  },
-    { V('c','i'), 1, "o", NULL  },
-    { V('c','o'), 1, "©", NULL  },
-    { V('c','t'), 1, "¢", NULL  },
-    { V('d','e'), 1, "°", NULL  },
-    { V('d','g'), 1, "+", NULL  },
-    { V('d','i'), 1, "÷", NULL  },
-    { V('e','m'), 1, "-", NULL  },
-    { V('e','m'), 3, "---", NULL },
-    { V('e','q'), 1, "=", NULL  },
-    { V('e','s'), 1, "Ø", NULL  },
-    { V('f','f'), 2, "ff", NULL  },
-    { V('f','i'), 2, "fi", NULL  },
-    { V('f','l'), 2, "fl", NULL  },
-    { V('f','m'), 1, "´", NULL  },
-    { V('g','a'), 1, "`", NULL  },
-    { V('h','y'), 1, "-", NULL  },
-    { V('l','c'), 2, "|¯", NULL  },
-    { V('l','f'), 2, "|_", NULL  },
-    { V('l','k'), 1, "<FONT SIZE=+2>{</FONT>", NULL  },
-    { V('m','i'), 1, "-", NULL  },
-    { V('m','u'), 1, "×", NULL  },
-    { V('n','o'), 1, "¬", NULL  },
-    { V('o','r'), 1, "|", NULL  },
-    { V('p','l'), 1, "+", NULL  },
-    { V('r','c'), 2, "¯|", NULL  },
-    { V('r','f'), 2, "_|", NULL  },
-    { V('r','g'), 1, "®", NULL  },
-    { V('r','k'), 1, "<FONT SIZE=+2>}</FONT>", NULL  },
-    { V('r','n'), 1, "¯", NULL  },
-    { V('r','u'), 1, "_", NULL  },
-    { V('s','c'), 1, "§", NULL  },
-    { V('s','l'), 1, "/", NULL  },
-    { V('s','q'), 2, "[]", NULL  },
-    { V('u','l'), 1, "_", NULL  },
-    { 0, 0, NULL, NULL  }
-};
-
-/* default: print code */
-
-
-static char escapesym='\\',
-            nobreaksym='\'',
-	    controlsym='.',
-	    fieldsym=0,
-	    padsym=0;
-
-static char *buffer=NULL;
-static int buffpos=0, buffmax=0;
-static int scaninbuff=0;
-static int itemdepth=0;
-static int dl_set[20]= { 0 };
-static int still_dd=0;
-static int tabstops[20] = { 8, 16, 24, 32, 40, 48, 56, 64, 72, 80, 88, 96 };
-static int maxtstop=12;
-static int curpos=0;
-static char **argument=NULL;
-static char charb[TINY_STR_MAX];
-
-static char *scan_troff(char *c, int san, char **result);
-static char *scan_troff_mandoc(char *c, int san, char **result);
-
-
-static void
-print_sig(void)
-{
-    char datbuf[NULL_TERMINATED(MED_STR_MAX)];
-    struct tm *timetm;
-    time_t clock;
-
-    datbuf[0]='\0';
-#ifdef TIMEFORMAT
-    clock=time(NULL);
-    timetm=gmtime(&clock);
-    strftime(datbuf,MED_STR_MAX,TIMEFORMAT, timetm);
-#endif
-    printf(signature, datbuf);
-}
-
-
-static char
-*expand_char(int nr)
-{
-  STRDEF *h;
-
-  h=chardef;
-  if (!nr) return NULL;
-  while (h)
-      if (h->nr==nr) {
-	  curpos+=h->slen;
-	  return h->st;
-      } else
-	  h=h->next;
-  charb[0]=nr/256;
-  charb[1]=nr%256;
-  charb[2]='\0';  
-  if (charb[0] == '<') {	/* Fix up <= */
-    charb[4] = charb[1];
-    strncpy(charb, "<", 4);
-    charb[5] = '\0';
-  }
-  curpos+=2;
-  return charb;
-}
-
-
-static char 
-*expand_string(int nr)
-{
-  STRDEF *h=strdef;
-
-  if (!nr) return NULL;
-  while (h)
-      if (h->nr==nr) {
-	  curpos+=h->slen;
-	  return h->st;
-    } else
-	h=h->next;
-  return NULL;
-}
-
-#ifndef LESSTIF
-static char
-*trim_compress_suffix(char *filename) 
-{
-  static char result[NULL_TERMINATED(MED_STR_MAX)];
-  int trim;
-
-  if (strcmp(filename + strlen(filename) - 3, ".gz") == 0) {
-    trim = 3;
-  }
-  else if (strcmp(filename + strlen(filename) - 2, ".Z") == 0
-	   || strcmp(filename + strlen(filename) - 2, ".z") == 0) {
-    trim = 2;
-  }
-  else 
-    trim = 0;
-
-  strlimitcpy(result, filename, strlen(filename) - trim, MED_STR_MAX);
-  result[strlen(filename) - trim + 1] = '\0';
-  return result;
-}
-#endif
-
-
-static char 
-*read_man_page(const char *filename) 
-{
-  int man_pipe = 0;
-  char *man_buf = NULL;
-#ifndef DISABLE_ZCATS
-  int i;
-#endif
-
-
-#ifndef DISABLE_ZCATS
-  for (i = 0; zcats[i]; i++) {
-    if (strcmp(filename + strlen(filename) - strlen(zcats[i]), zcats[i]) == 0) {
-      man_pipe = 1;
-      break;
-    }
-  }
-#endif
-
-#ifdef LESSTIF
-  if (strcmp(filename, "-") == 0) {
-    int len;
-    char buffer[HUGE_STR_MAX];
-
-/* fprintf(stderr, "Read from stdin\n"); */
-    man_buf = stralloc(3);
-    strcpy(man_buf, "\n");
-    while ((len = fread(buffer, 1, sizeof(buffer)-1, stdin)) > 0) {
-        buffer[len]='\0';
-	man_buf = strgrow(man_buf, len);
-	strcat(man_buf, buffer);
-      }
-    man_buf = strgrow(man_buf, 1);
-    strcat(man_buf, "\n");
-  } else
-#endif
-
-  if (man_pipe) {  /* Input from a pipe */
-#ifndef DISABLE_ZCATS
-    FILE *man_stream = NULL;
-    int len;
-    char buffer[HUGE_STR_MAX];
-
-    man_stream = pipe_open(zcats[i] + strlen(zcats[i]) + 1, filename);  
-/* fprintf(stderr, "opened .%s.\n", filename); */
-    if (man_stream) {
-      man_buf = stralloc(5);
-      strcpy(man_buf, "\n");
-      while ((len = fread(buffer, 1, sizeof(buffer)-1, man_stream)) > 0) {
-        buffer[len]='\0';
-	man_buf = strgrow(man_buf, len);
-	strcat(man_buf, buffer);
-      }
-      man_buf = strgrow(man_buf, 1);
-      strcat(man_buffer, "\n");
-      pipe_close(man_stream);
-    }
-#endif
-  }
-#ifndef LESSTIF
-  else { /* Non-pipe input */
-    FILE *man_stream = NULL;
-    struct stat stbuf;
-    int buf_size;
-
-    if (stat(filename, &stbuf) == -1) { 
-      return NULL;
-    }
-    buf_size = stbuf.st_size;
-    man_buf = stralloc(buf_size+5);
-    man_pipe = 0;
-    man_stream = fopen(filename, "r");
-    if (man_stream) {
-      man_buf[0] = '\n';
-      if (fread(man_buf+1, 1, buf_size, man_stream) == buf_size) {
-	man_buf[buf_size] = '\n';
-	man_buf[buf_size + 1] = man_buf[buf_size + 2] = '\0';
-      }
-      else {
-	man_buf = NULL;
-      }
-      fclose(man_stream);
-    }
-  }
-  /* fprintf(stderr, "read .%s.\n", filename); */
-#endif
-
-/* fprintf(stderr, "Read %i bytes\n", strlen(man_buf)); */
-/* fprintf(stderr, "Read %s\n", man_buf); */
-  return man_buf;
-}
-
-
-static char outbuffer[NULL_TERMINATED(HUGE_STR_MAX)];
-static int obp=0;
-static int no_newline_output=0;
-static int newline_for_fun=0;
-static int output_possible=0;
-static int out_length=0;
-
-
-static void 
-add_links(char *c)
-{
-    /*
-    ** Add the links to the output.
-    ** At the moment the following are recognized:
-    **
-    ** name(*)                 -> ../man?/name.*
-    ** method://string         -> method://string
-    ** www.host.name           -> http://www.host.name
-    ** ftp.host.name           -> ftp://ftp.host.name
-    ** name at host               -> mailto:name at host
-    ** <name.h>                -> file:/usr/include/name.h   (guess)
-    **
-    ** Other possible links to add in the future:
-    **
-    ** /dir/dir/file  -> file:/dir/dir/file
-    */
-    int i,j,nr;
-    char *f, *g,*h;
-    char *idtest[6]; /* url, mailto, www, ftp, manpage */
-    out_length+=strlen(c);
-    /* search for (section) */
-    nr=0;
-    idtest[0]=strstr(c+1,"://");
-    idtest[1]=strchr(c+1,'@');
-    idtest[2]=strstr(c,"www.");
-    idtest[3]=strstr(c,"ftp.");
-    idtest[4]=strchr(c+1,'(');
-    idtest[5]=strstr(c+1,".h>");
-    for (i=0; i<6; i++) nr += (idtest[i]!=NULL);
-    while (nr) {
-	j=-1;
-	for (i=0; i<6; i++)
-	    if (idtest[i] && (j<0 || idtest[i]<idtest[j])) j=i;
-	switch (j) {
-	case 5: /* <name.h> */
-	    f=idtest[5];
-	    h=f+2;
-	    g=f;
-	    while (g>c && g[-1]!=';') g--;
-	    if (g!=c) {
-		char t;
-		t=*g;
-		*g='\0';
-		fputs(c, stdout);
-		*g=t;*h='\0';
-		if (doweb==1)
-		   printf("<A HREF=\"include/%s\">%s</A>>", g,g);
-		else
-		   printf("<A HREF=\"file:/usr/include/%s\">%s</A>>", g,g);
-		c=f+6;
-	    } else {
-		f[5]='\0';
-		fputs(c, stdout);
-		f[5]=';';
-		c=f+5;
-	    }
-	    break;
-	case 4: /* manpage */
-	    f=idtest[j];
-	    /* check section */
-	    g=strchr(f,')');
-	    if (g && f-g<6 && (isalnum(f[-1]) || f[-1]=='>') &&
-		((isdigit(f[1]) && f[1]!='0' &&
-		  (f[2]==')' || (isalpha(f[2]) && f[3]==')') || f[2]=='X')) ||
-		 (f[2]==')' && (f[1]=='n' || f[1]=='l')))) {
-		/* this might be a link */
-		h=f-1;
-		/* skip html makeup */
-		while (h>c && *h=='>') {
-		    while (h!=c && *h!='<') h--;
-		    if (h!=c) h--;
-		}
-		if (isalnum(*h)) {
-		    char t,sec,subsec, *e;
-		    e=h+1;
-		    sec=f[1];
-		    subsec=f[2];
-		    if ((subsec=='X' && f[3]!=')')|| subsec==')') subsec='\0';
-		    while (h>c && (isalnum(h[-1]) || h[-1]=='_' ||
-				    h[-1]=='-' || h[-1]=='.'))
-			h--;
-		    t=*h;
-		    *h='\0';
-		    fputs(c, stdout);
-		    *h=t;
-		    t=*e;
-		    *e='\0';
-		    if (dofilter)
-		    	{
-/*fprintf(stderr,"LINK?: h:%s sec:%c\n",h,sec);*/
-			if ((h[0] == 'm' && h[1] == 'b')
-				|| (strcmp(h,"hsdump") == 0)
-				|| (strcmp(h,"xbt") == 0))
-				{
-				printf("<A HREF=\"%s.html\">%s</A>", h, h);
-				}
-			else
-				{
-				printf("%s", h);
-				}
-			}
-		    else
-		    if (subsec)
-			printf("<A HREF=\""
-			       CGIBASE
-			       "?man%c/%s.%c%c\">%s</A>",
-			       sec, h, sec, tolower(subsec), h);
-		    else
-			printf("<A HREF=\""
-			       CGIBASE
-			       "?man%c/%s.%c\">%s</A>",
-			       sec, h, sec, h);
-		    *e=t;
-		    c=e;
-		}
-	    }
-	    *f='\0';
-	    fputs(c, stdout);
-	    *f='(';
-	    idtest[4]=f-1;
-	    c=f;
-	    break; /* manpage */
-	case 3: /* ftp */
-	case 2: /* www */
-	    g=f=idtest[j];
-	    while (*g && (isalnum(*g) || *g=='_' || *g=='-' || *g=='+' ||
-			  *g=='.')) g++;
-	    if (g[-1]=='.') g--;
-	    if (g-f>4) {
-		char t;
-		t=*f; *f='\0';
-		fputs(c, stdout);
-		*f=t; t=*g;*g='\0';
-		printf("<A HREF=\"%s://%s\">%s</A>", (j==3?"ftp":"http"),
-		       f,f);
-		*g=t;
-		c=g;
-	    } else {
-		f[3]='\0';
-		fputs(c, stdout);
-		c=f+3;
-		f[3]='.';
-	    }
-	    break;
-	case 1: /* mailto */
-	    g=f=idtest[1];
-	    while (g>c && (isalnum(g[-1]) || g[-1]=='_' || g[-1]=='-' ||
-			   g[-1]=='+' || g[-1]=='.' || g[-1]=='%')) g--;
-	    h=f+1;
-	    while (*h && (isalnum(*h) || *h=='_' || *h=='-' || *h=='+' ||
-			  *h=='.')) h++;
-	    if (*h=='.') h--;
-	    if (h-f>4 && f-g>1) {
-		char t;
-		t=*g;
-		*g='\0';
-		fputs(c, stdout);
-		*g=t;t=*h;*h='\0';
-		printf("<A HREF=\"mailto:%s\">%s</A>",g,g);
-		*h=t;
-		c=h;
-	    } else {
-		*f='\0';
-		fputs(c, stdout);
-		*f='@';
-		idtest[1]=c;
-		c=f;
-	    }
-	    break;
-	case 0: /* url */
-	    g=f=idtest[0];
-	    while (g>c && isalpha(g[-1]) && islower(g[-1])) g--;
-	    h=f+3;
-	    while (*h && !isspace(*h) && *h!='<' && *h!='>' && *h!='"' &&
-		   *h!='&') h++;
-	    if (f-g>2 && f-g<7 && h-f>3) {
-		char t;
-		t=*g;
-		*g='\0';
-		fputs(c, stdout);
-		*g=t; t=*h; *h='\0';
-		printf("<A HREF=\"%s\">%s</A>", g,g);
-		*h=t;
-		c=h;
-	    } else {
-		f[1]='\0';
-		fputs(c, stdout);
-		f[1]='/';
-		c=f+1;
-	    }
-	    break;
-	default:
-	    break;
-	}
-	nr=0;
-	if (idtest[0] && idtest[0]<c) idtest[0]=strstr(c+1,"://");
-	if (idtest[1] && idtest[1]<c) idtest[1]=strchr(c+1,'@');
-	if (idtest[2] && idtest[2]<c) idtest[2]=strstr(c,"www.");
-	if (idtest[3] && idtest[3]<c) idtest[3]=strstr(c,"ftp.");
-	if (idtest[4] && idtest[4]<c) idtest[4]=strchr(c+1,'(');
-	if (idtest[5] && idtest[5]<c) idtest[5]=strstr(c+1,".h>");
-	for (i=0; i<6; i++) nr += (idtest[i]!=NULL);
-    }
-    fputs(c, stdout);
-}
-
-static int current_font=0;
-static int current_size=0;
-static int fillout=1;
-
-
-static void
-out_html(const char *d)
-{
-  char *c, *c0;
-
-  if (!d) return;
-  c=(char *)malloc(strlen(d)+1);
-  c0=c;
-  strcpy(c, d); 
-
-  if (no_newline_output) {
-      int i=0;
-      no_newline_output=1;
-      while (c[i]) {
-	  if (!no_newline_output) c[i-1]=c[i];
-	  if (c[i]=='\n') no_newline_output=0;
-	  i++;
-      }
-      if (!no_newline_output) c[i-1]=0;
-  }
-  if (scaninbuff) {
-      while (*c) {
-	  if (buffpos>=buffmax) {
-	      char *h;
-	      h=realloc(buffer, buffmax*2);
-	      if (!h) exit(1);
-	      buffer=h;
-	      buffmax=buffmax*2;
-	  }
-	  buffer[buffpos++]=*c++;
-      }
-  } else
-      if (output_possible) {
-	  while (*c) {
-	      outbuffer[obp++]=*c;
-	      if (*c=='\n' || obp > HUGE_STR_MAX) {
-		  outbuffer[obp]='\0';
-		  add_links(outbuffer);
-		  obp=0;
-	      }
-	      c++;
-	  }
-      }
-  free(c0);
-}
-
-#define FO0 ""
-#define FC0 ""
-#define FO1 "<I>"
-#define FC1 "</I>"
-#define FO2 "<B>"
-#define FC2 "</B>"
-#define FO3 "<TT>"
-#define FC3 "</TT>"
-
-static const char *switchfont[16] = {
-                   "", FC0 FO1, FC0 FO2, FC0 FO3,
-			 FC1 FO0, ""     , FC1 FO2, FC1 FO3,
-			 FC2 FO0, FC2 FO1, ""     , FC2 FO3,
-			 FC3 FO0, FC3 FO1, FC3 FO2, ""
-};
-
-
-static const char
-*change_to_font(int nr)
-{
-  int i;
-
-  switch (nr) {
-  case '0': nr++;
-  case '1': case '2': case '3': case '4': nr=nr-'1'; break;
-  case V('C','W'): nr=3; break;
-  case 'L': nr=3; break;
-  case 'B': nr=2; break;
-  case 'I': nr=1; break;
-  case 'P': case 'R': nr=0; break;
-  case 0: case 1: case 2: case 3: break;
-  default: nr=0; break;
-  }
-  i= current_font*4+nr%4;
-  current_font=nr%4;
-  return switchfont[i];
-}
-
-
-static char
-*change_to_size(int nr)
-{
-  int i;
-  static char sizebuf[200];
-
-  switch (nr) {
-  case '0': case '1': case '2': case '3': case '4': case '5': case '6':
-  case '7': case '8': case '9': nr=nr-'0'; break;
-  case '\0': break;
-  default: nr=current_size+nr; if (nr>9) nr=9; if (nr< -9) nr=-9; break;
-  }
-  if (nr==current_size) return "";
-  i=current_font;
-  sizebuf[0]='\0';
-  strcat(sizebuf, change_to_font(0));
-  if (current_size) strcat(sizebuf, "</FONT>");
-  current_size=nr;
-  if (nr) {
-    int l;
-    strcat(sizebuf, "<FONT SIZE=");
-    l=strlen(sizebuf);
-    if (nr>0) sizebuf[l++]='+'; else sizebuf[l++]='-',nr=-nr;
-    sizebuf[l++]=nr+'0';
-    sizebuf[l++]='>';
-    sizebuf[l]='\0';
-  }
-  strcat(sizebuf, change_to_font(i));
-  return sizebuf;
-}
-
-static int intresult=0;
-
-#define SKIPEOL while (*c && *c++!='\n')
-
-static int skip_escape=0;
-static int single_escape=0;
-
-
-static char
-*scan_escape(char *c)
-{
-    const char *h=NULL;
-    char b[5];
-    INTDEF *intd;
-    int exoutputp,exskipescape;
-    int i,j;
-
-    intresult=0;
-    switch (*c) {
-    case 'e': h="\\"; curpos++;break;
-    case '0':
-    case ' ': h=" ";curpos++; break;
-    case '|': h=""; break;
-    case '"': SKIPEOL; c--; h=""; break;
-    case '$':
-	if (argument) {
-	    c++;
-	    i=(*c -'1');
-	    if (!(h=argument[i])) h="";
-	}
-	break;
-    case 'z':
-	c++;
-	if (*c=='\\') { c=scan_escape(c+1); c--;h=""; }
-	else {
-	    b[0]=*c;
-	    b[1]='\0';
-	    h="";
-	}
-	break;
-    case 'k': c++; if (*c=='(') c+=2;
-    case '^':
-    case '!':
-    case '%':
-    case 'a':
-    case 'd':
-    case 'r':
-    case 'u':
-    case '\n':
-    case '&': h=""; break;
-    case '(':
-	c++;
-	i= c[0]*256+c[1];
-	c++;
-	h = expand_char(i);
-	break;
-    case '*':
-	c++;
-	if (*c=='(') {
-	    c++;
-	    i= c[0]*256+c[1];
-	    c++;
-	} else
-	    i= *c *256+' ';
-	h = expand_string(i);
-	break;
-    case 'f':
-	c++;	
-	if (*c=='\\') {
-	    c++;
-	    c=scan_escape(c);
-	    c--;
-	    i=intresult;
-	} else 	if (*c != '(')
-	    i=*c;
-	else {
-	    c++;
-	    i=c[0]*256+c[1];
-	    c++;
-	}
-	if (!skip_escape) h=change_to_font(i); else h="";
-	break;
-    case 's':
-	c++;
-	j=0;i=0;
-	if (*c=='-') {j= -1; c++;} else if (*c=='+') {j=1; c++;}
-	if (*c=='0') c++; else if (*c=='\\') {
-	    c++;
-	    c=scan_escape(c);
-	    i=intresult; if (!j) j=1;
-	} else
-	    while (isdigit(*c) && (!i || (!j && i<4))) i=i*10+(*c++)-'0';
-	if (!j) { j=1; if (i) i=i-10; }
-	if (!skip_escape) h=change_to_size(i*j); else h="";
-	c--;
-	break;
-    case 'n':
-	c++;
-	j=0;
-	switch (*c) {
-	case '+': j=1; c++; break;
-	case '-': j=-1; c++; break;
-	default: break;
-	}
-	if (*c=='(') {
-	    c++;
-	    i=V(c[0],c[1]);
-	    c=c+1;
-	} else {
-	    i=V(c[0],' ');
-	}
-	intd=intdef;
-	while (intd && intd->nr!=i) intd=intd->next;
-	if (intd) {
-	    intd->val=intd->val+j*intd->incr;
-	    intresult=intd->val;
-	} else {
-	    switch (i) {
-	    case V('.','s'): intresult=current_size; break;
-	    case V('.','f'): intresult=current_font; break;
-	    default: intresult=0; break;
-	    }
-	}
-	h="";
-	break;
-    case 'w':
-	c++;
-	i=*c;
-	c++;
-	exoutputp=output_possible;
-	exskipescape=skip_escape;
-	output_possible=0;
-	skip_escape=1;
-	j=0;
-	while (*c!=i) {
-	    j++;
-	    if (*c==escapesym) c=scan_escape(c+1); else c++;
-	}
-	output_possible=exoutputp;
-	skip_escape=exskipescape;
-	intresult=j;
-	break;
-    case 'l': h="<HR>"; curpos=0;
-    case 'b':
-    case 'v':
-    case 'x':
-    case 'o':
-    case 'L':
-    case 'h':
-	c++;
-	i=*c;
-	c++;
-	exoutputp=output_possible;
-	exskipescape=skip_escape;
-	output_possible=0;
-	skip_escape=1;
-	while (*c != i)
-	    if (*c==escapesym) c=scan_escape(c+1);
-	    else c++;
-	output_possible=exoutputp;
-	skip_escape=exskipescape;
-	break;
-    case 'c': no_newline_output=1; break;
-    case '{': newline_for_fun++; h="";break;
-    case '}': if (newline_for_fun) newline_for_fun--; h="";break;
-    case 'p': h="<BR>\n";curpos=0; break;
-    case 't': h="\t";curpos=(curpos+8)&0xfff8; break;
-    case '<': h="<";curpos++; break;
-    case '>': h=">";curpos++; break;
-    case '\\': if (single_escape) { c--; break;}
-    default: b[0]=*c; b[1]=0; h=b; curpos++; break;
-    }
-    c++;
-    if (!skip_escape) out_html(h);
-    return c;
-}
-
-typedef struct TABLEITEM TABLEITEM;
-
-struct TABLEITEM {
-    char *contents;
-    int size,align,valign,colspan,rowspan,font,vleft,vright,space,width;
-    TABLEITEM *next;
-};
-
-static TABLEITEM emptyfield = {NULL,0,0,0,1,1,0,0,0,0,0,NULL};
-
-typedef struct TABLEROW TABLEROW;
-
-struct TABLEROW {
-    TABLEITEM *first;
-    TABLEROW *prev, *next;
-};
-
-static char *tableopt[]= { "center", "expand", "box", "allbox", "doublebox",
-			   "tab", "linesize", "delim", NULL };
-static int tableoptl[] = { 6,6,3,6,9,3,8,5,0};
-
-
-static void clear_table(TABLEROW *table)
-{
-    TABLEROW *tr1,*tr2;
-    TABLEITEM *ti1,*ti2;
-
-    tr1=table;
-    while (tr1->prev) tr1=tr1->prev;
-    while (tr1) {
-	ti1=tr1->first;
-	while (ti1) {
-	    ti2=ti1->next;
-	    if (ti1->contents) free(ti1->contents);
-	    free(ti1);
-	    ti1=ti2;
-	}
-	tr2=tr1;
-	tr1=tr1->next;
-	free(tr2);
-    }
-}
-
-static char *scan_expression(char *c, int *result);
-
-static char *scan_format(char *c, TABLEROW **result, int *maxcol)
-{
-    TABLEROW *layout, *currow;
-    TABLEITEM *curfield;
-    int i,j;
-    if (*result) {
-	clear_table(*result);
-    }
-    layout= currow=(TABLEROW*) malloc(sizeof(TABLEROW));
-    currow->next=currow->prev=NULL;
-    currow->first=curfield=(TABLEITEM*) malloc(sizeof(TABLEITEM));
-    *curfield=emptyfield;
-    while (*c && *c!='.') {
-	switch (*c) {
-	case 'C': case 'c': case 'N': case 'n':
-	case 'R': case 'r': case 'A': case 'a':
-	case 'L': case 'l': case 'S': case 's':
-	case '^': case '_':
-	    if (curfield->align) {
-		curfield->next=(TABLEITEM*)malloc(sizeof(TABLEITEM));
-		curfield=curfield->next;
-		*curfield=emptyfield;
-	    }
-	    curfield->align=toupper(*c);
-	    c++;
-	    break;
-	case 'i': case 'I': case 'B': case 'b':
-	    curfield->font = toupper(*c);
-	    c++;
-	    break;
-	case 'f': case 'F':
-	    c++;
-	    curfield->font = toupper(*c);
-	    c++;
-	    if (!isspace(*c)) c++;
-	    break;
-	case 't': case 'T': curfield->valign='t'; c++; break;
-	case 'p': case 'P':
-	    c++;
-	    i=j=0;
-	    if (*c=='+') { j=1; c++; }
-	    if (*c=='-') { j=-1; c++; }
-	    while (isdigit(*c)) i=i*10+(*c++)-'0';
-	    if (j) curfield->size= i*j; else curfield->size=j-10;
-	    break;
-	case 'v': case 'V':
-	case 'w': case 'W':
-	    c=scan_expression(c+2,&curfield->width);
-	    break;
-	case '|':
-	    if (curfield->align) curfield->vleft++;
-	    else curfield->vright++;
-	    c++;
-	    break;
-	case 'e': case 'E':
-	    c++;
-	    break;
-	case '0': case '1': case '2': case '3': case '4':
-	case '5': case '6': case '7': case '8': case '9':
-	    i=0;
-	    while (isdigit(*c)) i=i*10+(*c++)-'0';
-	    curfield->space=i;
-	    break;
-	case ',': case '\n':
-	    currow->next=(TABLEROW*)malloc(sizeof(TABLEROW));
-	    currow->next->prev=currow;
-	    currow=currow->next;
-	    currow->next=NULL;
-	    curfield=currow->first=(TABLEITEM*)malloc(sizeof(TABLEITEM));
-	    *curfield=emptyfield;
-	    c++;
-	    break;
-	default:
-	    c++;
-	    break;
-	}
-    }
-    if (*c=='.') while (*c++!='\n');
-    *maxcol=0;
-    currow=layout;
-    while (currow) {
-	curfield=layout->first;
-	i=0;
-	while (curfield) {
-	    i++;
-	    curfield=curfield->next;
-	}
-	if (i>*maxcol) *maxcol=i;
-	currow=currow->next;
-    }
-    *result=layout;
-    return c;
-}
-
-static TABLEROW *next_row(TABLEROW *tr)
-{
-    if (tr->next) {
-	tr=tr->next;
-	if (!tr->next) next_row(tr);
-	return tr;
-    } else {
-	TABLEITEM *ti, *ti2;
-	tr->next=(TABLEROW*)malloc(sizeof(TABLEROW));
-	tr->next->prev=tr;
-	ti=tr->first;
-	tr=tr->next;
-	tr->next=NULL;
-	if (ti) tr->first=ti2=(TABLEITEM*) malloc(sizeof(TABLEITEM));
-	else tr->first=ti2=NULL;
-	while (ti!=ti2) {
-	    *ti2=*ti;
-	    ti2->contents=NULL;
-	    if ((ti=ti->next)) {
-		ti2->next=(TABLEITEM*) malloc(sizeof(TABLEITEM));
-	    }
-	    ti2=ti2->next;
-	}
-	return tr;
-    }
-}
-
-static char itemreset[20]="\\fR\\s0";
-
-static char *scan_table(char *c)
-{
-    char *h, *g;
-    int center=0, expand=0, box=0, border=0, linesize=1;
-    int i,j,maxcol=0, finished=0;
-    int oldfont, oldsize,oldfillout;
-    char itemsep='\t';
-    TABLEROW *layout=NULL, *currow;
-    TABLEITEM *curfield;
-    while (*c++!='\n');
-    h=c;
-    if (*h=='.') return c-1;
-    oldfont=current_font;
-    oldsize=current_size;
-    oldfillout=fillout;
-    out_html(change_to_font(0));
-    out_html(change_to_size(0));
-    if (!fillout) {
-	fillout=1;
-	out_html("</PRE>");
-    }
-    while (*h && *h!='\n') h++;
-    if (h[-1]==';') {
-	/* scan table options */
-	while (c<h) {
-	    while (isspace(*c)) c++;
-	    for (i=0; tableopt[i] && strncmp(tableopt[i],c,tableoptl[i]);i++);
-	    c=c+tableoptl[i];
-	    switch (i) {
-	    case 0: center=1; break;
-	    case 1: expand=1; break;
-	    case 2: box=1; break;
-	    case 3: border=1; break;
-	    case 4: box=2; break;
-	    case 5: while (*c++!='('); itemsep=*c++; break;
-	    case 6: while (*c++!='('); linesize=0;
-		while (isdigit(*c)) linesize=linesize*10+(*c++)-'0';
-		break;
-	    case 7: while (*c!=')') c++;
-	    default: break;
-	    }
-	    c++;
-	}
-	c=h+1;
-    }
-    /* scan layout */
-    c=scan_format(c,&layout, &maxcol);
-    currow=layout;
-    next_row(currow);
-    curfield=layout->first;
-    i=0;
-    while (!finished) {
-	/* search item */
-	h=c;
-	if ((*c=='_' || *c=='=') && (c[1]==itemsep || c[1]=='\n')) {
-	    if (c[-1]=='\n' && c[1]=='\n') {
-		if (currow->prev) {
-		    currow->prev->next=(TABLEROW*) malloc(sizeof(TABLEROW));
-		    currow->prev->next->next=currow;
-		    currow->prev->next->prev=currow->prev;
-		    currow->prev=currow->prev->next;
-		} else {
-		    currow->prev=layout=(TABLEROW*) malloc(sizeof(TABLEROW));
-		    currow->prev->prev=NULL;
-		    currow->prev->next=currow;
-		}
-		curfield=currow->prev->first=
-		    (TABLEITEM*) malloc(sizeof(TABLEITEM));
-		*curfield=emptyfield;
-		curfield->align=*c;
-		curfield->colspan=maxcol;
-		curfield=currow->first;
-		c=c+2;
-	    } else {
-		if (curfield) {
-		    curfield->align=*c;
-		    do {
-			curfield=curfield->next;
-		    } while (curfield && curfield->align=='S');
-		}
-		if (c[1]=='\n') {
-		    currow=next_row(currow);
-		    curfield=currow->first;
-		}
-		c=c+2;
-	    }
-	} else if (*c=='T' && c[1]=='{') {
-	    h=c+2;
-	    c=strstr(h,"\nT}");
-	    c++;
-	    *c='\0';
-	    g=NULL;
-	    scan_troff(h,0,&g);
-	    scan_troff(itemreset, 0,&g);
-	    *c='T';
-	    c+=3;
-	    if (curfield) {
-		curfield->contents=g;
-		do {
-		    curfield=curfield->next;
-		} while (curfield && curfield->align=='S');
-	    } else
-		if (g) free(g);
-	    if (c[-1]=='\n') {
-		currow=next_row(currow);
-		curfield=currow->first;
-	    }
-	} else if (*c=='.' && c[1]=='T' && c[2]=='&' && c[-1]=='\n') {
-	    TABLEROW *hr;
-	    while (*c++!='\n');
-	    hr=currow;
-	    currow=currow->prev;
-	    hr->prev=NULL;
-	    c=scan_format(c,&hr, &i);
-	    hr->prev=currow;
-	    currow->next=hr;
-	    currow=hr;
-	    next_row(currow);
-	    curfield=currow->first;
-	} else if (*c=='.' && c[1]=='T' && c[2]=='E' && c[-1]=='\n') {
-	    finished=1;
-	    while (*c++!='\n');
-	    if (currow->prev)
-		currow->prev->next=NULL;
-	    currow->prev=NULL;
-	    clear_table(currow);
-	} else if (*c=='.' && c[-1]=='\n' && !isdigit(c[1])) {
-	    /* skip troff request inside table (usually only .sp ) */
-	    while (*c++!='\n');
-	} else {
-	    h=c;
-	    while (*c && (*c!=itemsep || c[-1]=='\\') &&
-		   (*c!='\n' || c[-1]=='\\')) c++;
-	    i=0;
-	    if (*c==itemsep) {i=1; *c='\n'; }
-	    if (h[0]=='\\' && h[2]=='\n' &&
-		(h[1]=='_' || h[1]=='^')) {
-		if (curfield) {
-		    curfield->align=h[1];
-		    do {
-			curfield=curfield->next;
-		    } while (curfield && curfield->align=='S');
-		}
-		h=h+3;
-	    } else {
-		g=NULL;
-		h=scan_troff(h,1,&g);
-		scan_troff(itemreset,0,&g);
-		if (curfield) {
-		    curfield->contents=g;
-		    do {
-			curfield=curfield->next;
-		    } while (curfield && curfield->align=='S');
-		} else if (g) free(g);
-	    }
-	    if (i) *c=itemsep;
-	    c=h;
-	    if (c[-1]=='\n') {
-		currow=next_row(currow);
-		curfield=currow->first;
-	    }
-	}
-    }
-    /* calculate colspan and rowspan */
-    currow=layout;
-    while (currow->next) currow=currow->next;
-    while (currow) {
-	TABLEITEM *ti, *ti1=NULL, *ti2=NULL;
-	ti=currow->first;
-	if (currow->prev) ti1=currow->prev->first;
-	while (ti) {
-	    switch (ti->align) {
-	    case 'S':
-		if (ti2) {
-		    ti2->colspan++;
-		    if (ti2->rowspan<ti->rowspan) ti2->rowspan=ti->rowspan;
-		}
-		break;
-	    case '^':
-		if (ti1) ti1->rowspan++;
-	    default:
-		if (!ti2) ti2=ti;
-		else {
-		    do {
-			ti2=ti2->next;
-		    } while (ti2 && curfield->align=='S');
-		}
-		break;
-	    }
-	    ti=ti->next;
-	    if (ti1) ti1=ti1->next;
-	}
-	currow=currow->prev;
-    }
-    /* produce html output */
-    if (center) out_html("<CENTER>");
-    if (box==2) out_html("<TABLE BORDER><TR><TD>");
-    out_html("<TABLE");
-    if (box || border) {
-	out_html(" BORDER");
-	if (!border) out_html("><TR><TD><TABLE");
-	if (expand) out_html(" WIDTH=100%");
-    }
-    out_html(">\n");
-    currow=layout;
-    while (currow) {
-	j=0;
-	out_html("<TR VALIGN=top>");
-	curfield=currow->first;
-	while (curfield) {
-	    if (curfield->align!='S' && curfield->align!='^') {
-		out_html("<TD");
-		switch (curfield->align) {
-		case 'N':
-		    curfield->space+=4;
-		case 'R':
-		    out_html(" ALIGN=right");
-		    break;
-		case 'C':
-		    out_html(" ALIGN=center");
-		default:
-		    break;
-		}
-		if (!curfield->valign && curfield->rowspan>1)
-		    out_html(" VALIGN=center");
-		if (curfield->colspan>1) {
-		    char buf[5];
-		    out_html(" COLSPAN=");
-		    sprintf(buf, "%i", curfield->colspan);
-		    out_html(buf);
-		}
-		if (curfield->rowspan>1) {
-		    char buf[5];
-		    out_html(" ROWSPAN=");
-		    sprintf(buf, "%i", curfield->rowspan);
-		    out_html(buf);
-		}
-		j=j+curfield->colspan;
-		out_html(">");
-		if (curfield->size) out_html(change_to_size(curfield->size));
-		if (curfield->font) out_html(change_to_font(curfield->font));
-		switch (curfield->align) {
-		case '=': out_html("<HR><HR>"); break;
-		case '_': out_html("<HR>"); break;
-		default:
-		    if (curfield->contents) out_html(curfield->contents);
-		    break;
-		}
-		if (curfield->space)
-		    for (i=0; i<curfield->space;i++) out_html(" ");
-		if (curfield->font) out_html(change_to_font(0));
-		if (curfield->size) out_html(change_to_size(0));
-		if (j>=maxcol && curfield->align>'@' && curfield->align!='_')
-		    out_html("<BR>");
-		out_html("</TD>");
-	    }
-	    curfield=curfield->next;
-	}
-	out_html("</TR>\n");
-	currow=currow->next;
-    }
-    if (box && !border) out_html("</TABLE>");
-    out_html("</TABLE>");
-    if (box==2) out_html("</TABLE>");
-    if (center) out_html("</CENTER>\n");
-    else out_html("\n");
-    if (!oldfillout) out_html("<PRE>");
-    fillout=oldfillout;
-    out_html(change_to_size(oldsize));
-    out_html(change_to_font(oldfont));
-    return c;
-}
-
-static char *scan_expression(char *c, int *result)
-{
-    int value=0,value2,sign=1,opex=0;
-    char oper='c';
-
-    if (*c=='!') {
-	c=scan_expression(c+1, &value);
-	value= (!value);
-    } else if (*c=='n') {
-	c++;
-	value=NROFF;
-    } else if (*c=='t') {
-	c++;
-	value=1-NROFF;
-    } else if (*c=='\'' || *c=='"' || *c<' ' || (*c=='\\' && c[1]=='(')) {
-	/* ?string1?string2?
-	** test if string1 equals string2.
-	*/
-	char *st1=NULL, *st2=NULL, *h;
-	char *tcmp=NULL;
-	char sep;
-	sep=*c;
-	if (sep=='\\') {
-	    tcmp=c;
-	    c=c+3;
-	}
-	c++;
-	h=c;
-	while (*c!= sep && (!tcmp || strncmp(c,tcmp,4))) c++;
-	*c='\n';
-	scan_troff(h, 1, &st1);
-	*c=sep;
-	if (tcmp) c=c+3;
-	c++;
-	h=c;
-	while (*c!=sep && (!tcmp || strncmp(c,tcmp,4))) c++;
-	*c='\n';
-	scan_troff(h,1,&st2);
-	*c=sep;
-	if (!st1 && !st2) value=1;
-	else if (!st1 || !st2) value=0;
-	else value=(!strcmp(st1, st2));
-	if (st1) free(st1);
-	if (st2) free(st2);
-	if (tcmp) c=c+3;
-	c++;
-    } else {
-	while (*c && !isspace(*c) && *c!=')') {
-	    opex=0;
-	    switch (*c) {
-	    case '(':
-		c=scan_expression(c+1, &value2);
-		value2=sign*value2;
-		opex=1;
-		break;
-	    case '.':
-	    case '0': case '1':
-	    case '2': case '3':
-	    case '4': case '5':
-	    case '6': case '7':
-	    case '8': case '9': {
-		int num=0,denum=1;
-		value2=0;
-		while (isdigit(*c)) value2=value2*10+((*c++)-'0');
-		if (*c=='.') {
-		    c++;
-		    while (isdigit(*c)) {
-			num=num*10+((*c++)-'0');
-			denum=denum*10;
-		    }
-		}
-		if (isalpha(*c)) {
-		    /* scale indicator */
-		    switch (*c) {
-		    case 'i': /* inch -> 10pt */
-			value2=value2*10+(num*10+denum/2)/denum;
-			num=0;
-			break;
-		    default:
-			break;
-		    }
-		    c++;
-		}
-		value2=value2+(num+denum/2)/denum;
-		value2=sign*value2;
-		opex=1;
-		break;
-	    }
-	    case '\\':
-		c=scan_escape(c+1);
-		value2=intresult*sign;
-		if (isalpha(*c)) c++; /* scale indicator */
-		opex=1;
-		break;
-	    case '-':
-		if (oper) { sign=-1; c++; break; }
-	    case '>':
-	    case '<':
-	    case '+':
-	    case '/':
-	    case '*':
-	    case '%':
-	    case '&':
-	    case '=':
-	    case ':':
-		if (c[1]=='=') oper=(*c++) +16; else oper=*c;
-		c++;
-		break;
-	    default: c++; break;
-	    }
-	    if (opex) {
-		sign=1;
-		switch (oper) {
-		case 'c': value=value2; break;
-		case '-': value=value-value2; break;
-		case '+': value=value+value2; break;
-		case '*': value=value*value2; break;
-		case '/': if (value2) value=value/value2; break;
-		case '%': if (value2) value=value%value2; break;
-		case '<': value=(value<value2); break;
-		case '>': value=(value>value2); break;
-		case '>'+16: value=(value>=value2); break;
-		case '<'+16: value=(value<=value2); break;
-		case '=': case '='+16: value=(value==value2); break;
-		case '&': value = (value && value2); break;
-		case ':': value = (value || value2); break;
-		default: fprintf(stderr, "man2html: unknown operator %c.\n", oper);
-		}
-		oper=0;
-	    }
-	}
-	if (*c==')') c++;
-    }
-    *result=value;
-    return c;
-}
-
-static void trans_char(char *c, char s, char t)
-{
-    char *sl=c;
-    int slash=0;
-    while (*sl!='\n' || slash) {
-	if (!slash) {
-	    if (*sl==escapesym)
-		slash=1;
-	    else if (*sl==s)
-		*sl=t;
-	} else slash=0;
-	sl++;
-    }
-}
-
-static char *fill_words(char *c, char *words[], int *n)
-{
-    char *sl=c;
-    int slash=0;
-    int skipspace=0;
-    *n=0;
-    words[*n]=sl;
-    while (*sl && (*sl!='\n' || slash)) {
-	if (!slash) {
-	    if (*sl=='"') {
-		/* *sl='\a'; */
-		*sl=' '; /* change to avoid putting \a characters into the html - DWC 9/24/2004 */
-		skipspace=!skipspace;
-	    } else if (*sl==escapesym)
-		slash=1;
-	    else if ((*sl==' ' || *sl=='\t') && !skipspace) {
-		*sl='\n';
-		if (words[*n]!=sl) (*n)++;
-		words[*n]=sl+1;
-	    }
-	} else {
-	    if (*sl=='"') {
-		sl--;
-		*sl='\n';
-		if (words[*n]!=sl) (*n)++;
-		sl++;
-		while (*sl && *sl !='\n') sl++;
-		words[*n]=sl;
-		sl--;
-	    }
-	    slash=0;
-	}
-	sl++;
-    }
-    if (sl!=words[*n]) (*n)++;
-    return sl;
-}
-
-static char *abbrev_list[] = {
-    "GSBG", "Getting Started ",
-    "SUBG", "Customizing SunOS",
-    "SHBG", "Basic Troubleshooting",
-    "SVBG", "SunView User's Guide",
-    "MMBG", "Mail and Messages",
-    "DMBG", "Doing More with SunOS",
-    "UNBG", "Using the Network",
-    "GDBG", "Games, Demos & Other Pursuits",
-    "CHANGE", "SunOS 4.1 Release Manual",
-    "INSTALL", "Installing SunOS 4.1",
-    "ADMIN", "System and Network Administration",
-    "SECUR", "Security Features Guide",
-    "PROM", "PROM User's Manual",
-    "DIAG", "Sun System Diagnostics",
-    "SUNDIAG", "Sundiag User's Guide",
-    "MANPAGES", "SunOS Reference Manual",
-    "REFMAN", "SunOS Reference Manual",
-    "SSI", "Sun System Introduction",
-    "SSO", "System Services Overview",
-    "TEXT", "Editing Text Files",
-    "DOCS", "Formatting Documents",
-    "TROFF", "Using <B>nroff</B> and <B>troff</B>",
-    "INDEX", "Global Index",
-    "CPG", "C Programmer's Guide",
-    "CREF", "C Reference Manual",
-    "ASSY", "Assembly Language Reference",
-    "PUL", "Programming Utilities and Libraries",
-    "DEBUG", "Debugging Tools",
-    "NETP", "Network Programming",
-    "DRIVER", "Writing Device Drivers",
-    "STREAMS", "STREAMS Programming",
-    "SBDK", "SBus Developer's Kit",
-    "WDDS", "Writing Device Drivers for the SBus",
-    "FPOINT", "Floating-Point Programmer's Guide",
-    "SVPG", "SunView 1 Programmer's Guide",
-    "SVSPG", "SunView 1 System Programmer's Guide",
-    "PIXRCT", "Pixrect Reference Manual",
-    "CGI", "SunCGI Reference Manual",
-    "CORE", "SunCore Reference Manual",
-    "4ASSY", "Sun-4 Assembly Language Reference",
-    "SARCH", "<FONT SIZE=-1>SPARC</FONT> Architecture Manual",
-    "KR", "The C Programming Language",
-    NULL, NULL };
-
-static char *lookup_abbrev(char *c)
-{
-    int i=0;
-
-    if (!c) return "";
-    while (abbrev_list[i] && strcmp(c,abbrev_list[i])) i=i+2;
-    if (abbrev_list[i]) return abbrev_list[i+1];
-    else return c;
-}
-
-static char *section_list[] = {
-    "1", "User Commands ",
-    "1C", "User Commands",
-    "1G", "User Commands",
-    "1S", "User Commands",
-    "1V", "User Commands ",
-    "2", "System Calls",
-    "2V", "System Calls",
-    "3", "C Library Functions",
-    "3C", "Compatibility Functions",
-    "3F", "Fortran Library Routines",
-    "3K", "Kernel VM Library Functions",
-    "3L", "Lightweight Processes Library",
-    "3M", "Mathematical Library",
-    "3N", "Network Functions",
-    "3R", "RPC Services Library",
-    "3S", "Standard I/O Functions",
-    "3V", "C Library Functions",
-    "3X", "Miscellaneous Library Functions",
-    "4", "Devices and Network Interfaces",
-    "4F", "Protocol Families",
-    "4I", "Devices and Network Interfaces",
-    "4M", "Devices and Network Interfaces",
-    "4N", "Devices and Network Interfaces",
-    "4P", "Protocols",
-    "4S", "Devices and Network Interfaces",
-    "4V", "Devices and Network Interfaces",
-    "5", "File Formats",
-    "5V", "File Formats",
-    "6", "Games and Demos",
-    "7", "Environments, Tables, and Troff Macros",
-    "7V", "Environments, Tables, and Troff Macros",
-    "8", "Maintenance Commands",
-    "8C", "Maintenance Commands",
-    "8S", "Maintenance Commands",
-    "8V", "Maintenance Commands",
-    "L", "Local Commands",
-/* for Solaris: 
-    "1", "User Commands",
-    "1B", "SunOS/BSD Compatibility Package Commands",
-    "1b", "SunOS/BSD Compatibility Package Commands",
-    "1C", "Communication Commands ",
-    "1c", "Communication Commands",
-    "1F", "FMLI Commands ",
-    "1f", "FMLI Commands",
-    "1G", "Graphics and CAD Commands ",
-    "1g", "Graphics and CAD Commands ",
-    "1M", "Maintenance Commands",
-    "1m", "Maintenance Commands",
-    "1S", "SunOS Specific Commands",
-    "1s", "SunOS Specific Commands",
-    "2", "System Calls",
-    "3", "C Library Functions",
-    "3B", "SunOS/BSD Compatibility Library Functions",
-    "3b", "SunOS/BSD Compatibility Library Functions",
-    "3C", "C Library Functions",
-    "3c", "C Library Functions",
-    "3E", "C Library Functions",
-    "3e", "C Library Functions",
-    "3F", "Fortran Library Routines",
-    "3f", "Fortran Library Routines",
-    "3G", "C Library Functions",
-    "3g", "C Library Functions",
-    "3I", "Wide Character Functions",
-    "3i", "Wide Character Functions",
-    "3K", "Kernel VM Library Functions",
-    "3k", "Kernel VM Library Functions",
-    "3L", "Lightweight Processes Library",
-    "3l", "Lightweight Processes Library",
-    "3M", "Mathematical Library",
-    "3m", "Mathematical Library",
-    "3N", "Network Functions",
-    "3n", "Network Functions",
-    "3R", "Realtime Library",
-    "3r", "Realtime Library",
-    "3S", "Standard I/O Functions",
-    "3s", "Standard I/O Functions",
-    "3T", "Threads Library",
-    "3t", "Threads Library",
-    "3W", "C Library Functions",
-    "3w", "C Library Functions",
-    "3X", "Miscellaneous Library Functions",
-    "3x", "Miscellaneous Library Functions",
-    "4", "File Formats",
-    "4B", "SunOS/BSD Compatibility Package File Formats",
-    "4b", "SunOS/BSD Compatibility Package File Formats",
-    "5", "Headers, Tables, and Macros",
-    "6", "Games and Demos",
-    "7", "Special Files",
-    "7B", "SunOS/BSD Compatibility Special Files",
-    "7b", "SunOS/BSD Compatibility Special Files",
-    "8", "Maintenance Procedures",
-    "8C", "Maintenance Procedures",
-    "8c", "Maintenance Procedures",
-    "8S", "Maintenance Procedures",
-    "8s", "Maintenance Procedures",
-    "9", "DDI and DKI",
-    "9E", "DDI and DKI Driver Entry Points",
-    "9e", "DDI and DKI Driver Entry Points",
-    "9F", "DDI and DKI Kernel Functions",
-    "9f", "DDI and DKI Kernel Functions",
-    "9S", "DDI and DKI Data Structures",
-    "9s", "DDI and DKI Data Structures",
-    "L", "Local Commands",
-*/
-    NULL, "Misc. Reference Manual Pages",
-    NULL, NULL
-};
-
-static char *section_name(char *c)
-{
-    int i=0;
-
-    if (!c) return "";
-    while (section_list[i] && strcmp(c,section_list[i])) i=i+2;
-    if (section_list[i+1]) return section_list[i+1];
-    else return c;
-}
-
-static char manidx[NULL_TERMINATED(HUGE_STR_MAX)];
-static int subs=0;
-static int mip=0;
-static char label[5]="lbAA";
-
-static void add_to_index(int level, char *item)
-{
-    char *c=NULL;
-    label[3]++;
-    if (label[3]>'Z') {
-	label[3]='A';
-	label[2]++;
-    }
-    if (level != subs) {
-	if (subs) {
-	    strmaxcpy(manidx+mip, "</DL>\n", HUGE_STR_MAX - mip);
-	    mip+=6;
-	} else {
-	    strmaxcpy(manidx+mip, "<DL>\n", HUGE_STR_MAX - mip);
-	    mip+=5;
-	}
-    }
-    subs=level;
-    scan_troff(item, 1, &c);
-    sprintf(manidx+mip, "<DT><A HREF=\"#%s\">%s</A><DD>\n", label, c);
-    if (c) free(c);
-    while (manidx[mip]) mip++;
-}
-
-static char *skip_till_newline(char *c)
-{
-    int lvl=0;
-
-    while ((*c && *c!='\n') || lvl>0) {
-	if (*c=='\\') {
-	    c++;
-	    if (*c=='}') lvl--; else if (*c=='{') lvl++;
-	}
-	c++;
-    }
-    c++;
-    if (lvl<0 && newline_for_fun) {
-	newline_for_fun = newline_for_fun+lvl;
-	if (newline_for_fun<0) newline_for_fun=0;
-    }
-    return c;
-}
-
-static int ifelseval=0;
-
-static char *scan_request(char *c)
-{
-				  /* BSD Mandoc stuff */
-    static int mandoc_synopsis=0; /* True if we are in the synopsis section */
-    static int mandoc_command=0;  /* True if this is mandoc page */
-    static int mandoc_bd_options; /* Only copes with non-nested Bd's */
-
-    int i,j,mode=0;
-    char *h;
-    char *wordlist[MAX_WORDLIST];
-    int words;
-    char *sl;
-    STRDEF *owndef;
-    while (*c==' ' || *c=='\t') c++;
-    if (c[0]=='\n') return c+1;
-    if (c[1]=='\n') j=1; else j=2;
-    while (c[j]==' ' || c[j]=='\t') j++;
-    if (c[0]==escapesym) {
-	/* some pages use .\" .\$1 .\} */
-	/* .\$1 is too difficult/stuppid */
-	if (c[1]=='$') c=skip_till_newline(c);
-	else
-	    c = scan_escape(c+1);
-    } else {
-	i=V(c[0],c[1]);
-	switch (i) {
-	case V('a','b'):
-	    h=c+j;
-	    while (*h && *h !='\n') h++;
-	    *h='\0';
-	    if (scaninbuff && buffpos) {
-		buffer[buffpos]='\0';
-		puts(buffer);
-	    }
-	    /* fprintf(stderr, "%s\n", c+2); */
-	    exit(0);
-	    break;
-	case V('d','i'):
-	    {
-		STRDEF *de;
-		c=c+j;
-		i=V(c[0],c[1]);
-		if (*c=='\n') { c++;break; }
-		while (*c && *c!='\n') c++;
-		c++;
-		h=c;
-		while (*c && strncmp(c,".di",3)) while (*c && *c++!='\n');
-		*c='\0';
-		de=strdef;
-		while (de && de->nr !=i) de=de->next;
-		if (!de) {
-		    de=(STRDEF*) malloc(sizeof(STRDEF));
-		    de->nr=i;
-		    de->slen=0;
-		    de->next=strdef;
-		    de->st=NULL;
-		    strdef=de;
-		} else {
-		    if (de->st) free(de->st);
-		    de->slen=0;
-		    de->st=NULL;
-		}
-		scan_troff(h,0,&de->st);
-		*c='.';
-		while (*c && *c++!='\n');
-		break;
-	    }
-	case V('d','s'):
-	    mode=1;
-	case V('a','s'):
-	    {
-		STRDEF *de;
-		int oldcurpos=curpos;
-		c=c+j;
-		i=V(c[0],c[1]);
-		j=0;
-		while (c[j] && c[j]!='\n') j++;
-		if (j<3) { c=c+j; break; }
-		if (c[1]==' ') c=c+1; else c=c+2;
-		while (isspace(*c)) c++;
-		if (*c=='"') c++;
-		de=strdef;
-		while (de && de->nr != i) de=de->next;
-		single_escape=1;
-		curpos=0;
-		if (!de) {
-		    char *h;
-		    de=(STRDEF*) malloc(sizeof(STRDEF));
-		    de->nr=i;
-		    de->slen=0;
-		    de->next=strdef;
-		    de->st=NULL;
-		    strdef=de;
-		    h=NULL;
-		    c=scan_troff(c, 1, &h);
-		    de->st=h;
-		    de->slen=curpos;
-		} else {
-		    if (mode) {
-			char *h=NULL;
-			c=scan_troff(c, 1, &h);
-			free(de->st);
-			de->slen=0;
-			de->st=h;
-		    } else
-			c=scan_troff(c,1,&de->st);
-		    de->slen+=curpos;
-		}
-		single_escape=0;
-		curpos=oldcurpos;
-	    }
-	    break;
-	case V('b','r'):
-	    if (still_dd) out_html("<DD>");
-	    else out_html("<BR>\n");
-	    curpos=0;
-	    c=c+j;
-	    if (c[0]==escapesym) { c=scan_escape(c+1); }
-	    c=skip_till_newline(c);break;
-	case V('c','2'):
-	    c=c+j;
-	    if (*c!='\n') { nobreaksym=*c; }
-	    else nobreaksym='\'';
-	    c=skip_till_newline(c);
-	    break;
-	case V('c','c'):
-	    c=c+j;
-	    if (*c!='\n') { controlsym=*c; }
-	    else controlsym='.';
-	    c=skip_till_newline(c);
-	    break;
-	case V('c','e'):
-	    c=c+j;
-	    if (*c=='\n') { i=1; }
-	    else {
-		i=0;
-		while ('0'<=*c && *c<='9') {
-		    i=i*10+*c-'0';
-		    c++;
-		}
-	    }
-	    c=skip_till_newline(c);
-	    /* center next i lines */
-	    if (i>0) {
-		out_html("<CENTER>\n");
-		while (i && *c) {
-		    char *line=NULL;
-		    c=scan_troff(c,1, &line);
-		    if (line && strncmp(line, "<BR>", 4)) {
-			out_html(line);
-			out_html("<BR>\n");
-			i--;
-		    }
-		}
-		out_html("</CENTER>\n");
-		curpos=0;
-	    }
-	    break;
-	case V('e','c'):
-	    c=c+j;
-	    if (*c!='\n') { escapesym=*c; }
-	    else escapesym='\\';
-	    break;
-	    c=skip_till_newline(c);
-	case V('e','o'):
-	    escapesym='\0';
-	    c=skip_till_newline(c);
-	    break;
-	case V('e','x'):
-	    exit(0);
-	    break;
-	case V('f','c'):
-	    c=c+j;
-	    if  (*c=='\n') {
-		fieldsym=padsym='\0';
-	    } else {
-		fieldsym=c[0];
-		padsym=c[1];
-	    }
-	    c=skip_till_newline(c);
-	    break;
-	case V('f','i'):
-	    if (!fillout) {
-		out_html(change_to_font(0));
-		out_html(change_to_size('0'));
-		out_html("</PRE>\n");
-	    }
-	    curpos=0;
-	    fillout=1;
-	    c=skip_till_newline(c);
-	    break;
-	case V('f','t'):
-	    c=c+j;
-	    if (*c=='\n') {
-		out_html(change_to_font(0));
-	    } else {
-		if (*c==escapesym) {
-		    int fn;
-		    c=scan_expression(c, &fn);
-		    c--;
-		    out_html(change_to_font(fn));
-		} else {
-		    out_html(change_to_font((int)*c));
-		    c++;
-		}
-	    }
-	    c=skip_till_newline(c);
-	    break;
-	case V('e','l'):
-	    /* .el anything : else part of if else */
-	    if (ifelseval) {
-		c=c+j;
-		c[-1]='\n';
-		c=scan_troff(c,1,NULL);
-	    } else
-		c=skip_till_newline(c+j);
-	    break;
-	case V('i','e'):
-	    /* .ie c anything : then part of if else */	
-	case V('i','f'):
-	    /* .if c anything
-	     * .if !c anything
-	     * .if N anything
-	     * .if !N anything
-	     * .if 'string1'string2' anything
-	     * .if !'string1'string2' anything
-	     */
-	    c=c+j;
-	    c=scan_expression(c, &i);
-	    ifelseval=!i;
-	    if (i) {
-		*c='\n';
-		c++;
-		c=scan_troff(c,1,NULL);
-	    } else
-		c=skip_till_newline(c);
-	    break;
-	case V('i','g'):
-	    {
-		char *endwith="..\n";
-		i=3;
-		c=c+j;
-		if (*c!='\n') {
-		    endwith=c-1;i=1;
-		    c[-1]='.';
-		    while (*c && *c!='\n') c++,i++;
-		}
-		c++;
-		while (*c && strncmp(c,endwith,i)) while (*c++!='\n');
-		while (*c++!='\n');
-		break;
-	    }
-	case V('n','f'):
-	    if (fillout) {
-		out_html(change_to_font(0));
-		out_html(change_to_size('0'));
-		out_html("<PRE>\n");
-	    }
-	    curpos=0;
-	    fillout=0;
-	    c=skip_till_newline(c);
-	    break;
-	case V('p','s'):
-	    c=c+j;
-	    if (*c=='\n') {
-		out_html(change_to_size('0'));
-	    } else {
-		j=0;i=0;
-		if (*c=='-') { j= -1;c++; } else if (*c=='+') { j=1;c++;}
-		c=scan_expression(c, &i);
-		if (!j) { j=1; if (i>5) i=i-10; }
-		out_html(change_to_size(i*j));
-	    }
-	    c=skip_till_newline(c);
-	    break;
-	case V('s','p'):
-	    c=c+j;
-	    if (fillout) out_html("<P>"); else {
-		out_html(NEWLINE);
-		NEWLINE[0]='\n';
-	    }
-	    curpos=0;
-	    c=skip_till_newline(c);
-	    break;
-#ifndef LESSTIF
-	case V('s','o'):
-	    {
-		struct stat stbuf;
-		int l = 0;
-		char *buf;
-		char *name=NULL;
-		curpos=0;
-		c=c+j;
-		if (*c=='/') {
-		    h=c;
-		} else {
-		    h=c-3;
-		    h[0]='.';
-		    h[1]='.';
-		    h[2]='/';
-		}
-		while (*c!='\n') c++;
-		*c='\0';
-		scan_troff(h,1, &name);
-		if (name[3]=='/') h=name+3; else h=name;
-		if (stat(h, &stbuf)!=-1) l=stbuf.st_size;
-		buf = stralloc(l+4);
-#if NOCGI
-                if (!out_length) {
-		    char *t,*s;
-		    t=strrchr(fname, '/');
-		    if (!t) t=fname;
-		    fprintf(stderr, "ln -s %s.html %s.html\n", h, t);
-		    s=strrchr(t, '.');if (!s) s=t;
-		    printf("<HTML>\n"
-                       "<HEAD><TITLE> Manpage of %s</TITLE>\n"
-                       "</HEAD><BODY>\n"
-                       "See the manpage for <A HREF=\"%s.html\">%s</A>.\n"
-                       "</BODY></HTML>\n",
-			   s, h, h);
-		} else
-#endif
-                {
-		    /* this works alright, except for section 3 */
-		    buf=read_man_page(h);
-		    if (!buf) {
-		      
-			fprintf(stderr, "man2html: unable to open or read file %s.\n",
-				h); 
-			out_html("<BLOCKQUOTE>"
-				 "man2html: unable to open or read file.\n");
-			out_html(h);
-			out_html("</BLOCKQUOTE>\n");
-		    } 
-		    else {
-			buf[0]=buf[l]='\n';
-			buf[l+1]=buf[l+2]='\0';
-			scan_troff(buf+1,0,NULL);
-		    }
-		    if (buf) free(buf);
-		}
-		*c++='\n';
-		break;
-	    }
-#endif
-	case V('t','a'):
-	    c=c+j;
-	    j=0;
-	    while (*c!='\n') {
-		sl=scan_expression(c, &tabstops[j]);
-		if (*c=='-' || *c=='+') tabstops[j]+=tabstops[j-1];
-		c=sl;
-		while (*c==' ' || *c=='\t') c++;
-		j++;
-	    }
-	    maxtstop=j;
-	    curpos=0;
-	    break;
-	case V('t','i'):
-	    /*while (itemdepth || dl_set[itemdepth]) {
-		out_html("</DL>\n");
-		if (dl_set[itemdepth]) dl_set[itemdepth]=0;
-		else itemdepth--;
-	    }*/
-	    out_html("<BR>\n");
-	    c=c+j;
-	    c=scan_expression(c, &j);
-	    for (i=0; i<j; i++) out_html(" ");
-	    curpos=j;
-	    c=skip_till_newline(c);
-	    break;
-	case V('t','m'):
-	    c=c+j;
-	    h=c;
-	    while (*c!='\n') c++;
-	    *c='\0';
-	    /* fprintf(stderr,"%s\n", h); */
-	    *c='\n';
-	    break;
-	case V('B',' '):
-	case V('B','\n'):
-	case V('I',' '):
-	case V('I','\n'):
-            /* parse one line in a certain font */
-	    out_html(change_to_font((int)*c));
-	    trans_char(c,'"','\a');
-	    c=c+j;
-	    if (*c=='\n') c++;
-	    c=scan_troff(c, 1, NULL);
-	    out_html(change_to_font((int)'R'));
-	    out_html(NEWLINE);
-	    if (fillout) curpos++; else curpos=0;
-	    break;
-	case V('O','P'):  /* groff manpages use this construction */
-            /* .OP a b : [ <B>a</B> <I>b</I> ] */
-	    mode=1;
-	    c[0]='B'; c[1]='I';
-	    out_html(change_to_font('R'));
-	    out_html("[");
-	    curpos++;
-	case V('B','R'):
-	case V('B','I'):
-	case V('I','B'):
-	case V('I','R'):
-	case V('R','B'):
-	case V('R','I'):
-	    {
-		char font[2] ;
-		font[0] = c[0]; font[1] = c[1];
-		c=c+j;
-		if (*c=='\n') c++;
-		sl=fill_words(c, wordlist, &words);
-		c=sl+1;
-		/* .BR name (section)
-		** indicates a link. It will be added in the output routine.
-		*/
-		for (i=0; i<words; i++) {
-		    if (mode) { out_html(" "); curpos++; }
-		    wordlist[i][-1]=' ';
-		    out_html(change_to_font((int)font[i&1]));
-		    scan_troff(wordlist[i],1,NULL);
-		}
-		out_html(change_to_font('R'));
-		if (mode) { out_html(" ]"); curpos++;}
-		out_html(NEWLINE); if (!fillout) curpos=0; else curpos++;
-	    }
-	    break;
-	case V('D','T'):
-	    for (j=0;j<20; j++) tabstops[j]=(j+1)*8;
-	    maxtstop=20;
-	    c=skip_till_newline(c); break;
-	case V('I','P'):
-	    sl=fill_words(c+j, wordlist, &words);
-	    c=sl+1;
-            if (!dl_set[itemdepth]) {
-		out_html("<DL COMPACT>\n");
-		dl_set[itemdepth]=1;
-	    }
-	    out_html("<DT>");
-            if (words) {
-		scan_troff(wordlist[0], 1,NULL);
-	    }
-	    out_html("<DD>");
-	    curpos=0;
-	    break;
-	case V('T','P'):
-	    if (!dl_set[itemdepth]) {
-		out_html("<DL COMPACT>\n");
-		dl_set[itemdepth]=1;
-	    }
-	    out_html("<DT>");
-	    c=skip_till_newline(c);
-	    /* somewhere a definition ends with '.TP' */
-	    if (!*c) still_dd=1; else {
-		c=scan_troff(c,1,NULL);
-		out_html("<DD>");
-	    }
-	    curpos=0;
-	    break;
-	case V('I','X'):
-            /* general index */
-	    sl = fill_words(c+j, wordlist, &words);
-	    c=sl+1;
-	    j=4;
-	    while (idxlabel[j]=='Z') idxlabel[j--]='A';
-	    idxlabel[j]++;
-#ifdef MAKEINDEX
-            fprintf(idxfile, "%s@%s@", fname, idxlabel);
-	    for (j=0; j<words; j++) {
-		h=NULL;
-		scan_troff(wordlist[j], 1, &h);
-		fprintf(idxfile, "_\b@%s", h);
-		free(h);
-	    }
-	    fprintf(idxfile,"\n");
-#endif
-            out_html("<A NAME=\"");
-	    out_html(idxlabel);
-	    /* this will not work in mosaic (due to a bug).
-	    ** Adding ' ' between '>' and '<' solves it, but creates
-	    ** some space. A normal space does not work.
-	    */
-	    out_html("\"></A>");
-	    break;
-	case V('L','P'):
-	case V('P','P'):
-	    if (dl_set[itemdepth]) {
-		out_html("</DL>\n");
-		dl_set[itemdepth]=0;
-	    }
-	    if (fillout) out_html("<P>\n"); else {
-		out_html(NEWLINE);
-		NEWLINE[0]='\n';
-	    }
-	    curpos=0;
-	    c=skip_till_newline(c);
-	    break;
-	case V('H','P'):
-	    if (!dl_set[itemdepth]) {
-		out_html("<DL COMPACT>");
-		dl_set[itemdepth]=1;
-	    }
-	    out_html("<DT>\n");
-	    still_dd=1;
-	    c=skip_till_newline(c);
-	    curpos=0;
-	    break;
-	case V('P','D'): 
-	    c=skip_till_newline(c); 
-	    break;
-	case V('R','s'):	/* BSD mandoc */
-	case V('R','S'):
-	    sl=fill_words(c+j, wordlist, &words);
-	    j=1;
-	    if (words>0) scan_expression(wordlist[0], &j);
-	    if (j>=0) {
-		itemdepth++;
-		dl_set[itemdepth]=0;
-		out_html("<DL COMPACT><DT><DD>");
-		c=skip_till_newline(c);
-		curpos=0;
-		break;
-	    }
-	case V('R','e'):	/* BSD mandoc */
-	case V('R','E'):
-	    if (itemdepth > 0) {
-		if (dl_set[itemdepth]) out_html("</DL>");
-		out_html("</DL>\n");
-		itemdepth--;
-	    }
-	    c=skip_till_newline(c);
-	    curpos=0;
-	    break;
-	case V('S','B'):
-	    out_html(change_to_size(-1));
-	    out_html(change_to_font('B'));
-	    c=scan_troff(c+j, 1, NULL);
-	    out_html(change_to_font('R'));
-	    out_html(change_to_size('0'));
-	    break;
-	case V('S','M'):
-	    c=c+j;
-	    if (*c=='\n') c++;
-	    out_html(change_to_size(-1));
-	    trans_char(c,'"','\a');
-	    c=scan_troff(c,1,NULL);
-	    out_html(change_to_size('0'));
-	    break;
-	case V('S','s'):	/* BSD mandoc */
-	    mandoc_command = 1;
-	case V('S','S'):
-	    mode=1;
-	case V('S','h'):	/* BSD mandoc */
-				/* hack for fallthru from above */
-	    mandoc_command = !mode || mandoc_command; 
-	case V('S','H'):
-	    c=c+j;
-	    if (*c=='\n') c++;
-	    while (itemdepth || dl_set[itemdepth]) {
-		out_html("</DL>\n");
-		if (dl_set[itemdepth]) dl_set[itemdepth]=0;
-		else if (itemdepth > 0) itemdepth--;
-	    }
-	    out_html(change_to_font(0));
-	    out_html(change_to_size(0));
-	    if (!fillout) {
-		fillout=1;
-		out_html("</PRE>");
-	    }
-	    trans_char(c,'"', '\a');
-	    add_to_index(mode, c);
-	    out_html("<A NAME=\"");
-	    out_html(label);
-	    /*   for mosaic users */
-	    if (mode) out_html("\"> </A>\n<H3>");
-	    else out_html("\"> </A>\n<H2>");
-	    mandoc_synopsis = strncmp(c, "SYNOPSIS", 8) == 0;
-	    c = mandoc_command ? scan_troff_mandoc(c,1,NULL) : scan_troff(c,1,NULL);
-	    if (mode) out_html("</H3>\n");
-	    else out_html("</H2>\n");
-	    curpos=0;
-	    break;
-	case V('T','S'):
-	    c=scan_table(c);
-	    break;
-	case V('D','t'):	/* BSD mandoc */
-	    mandoc_command = 1;
-	case V('T','H'):
-	    if (!output_possible) {
-		sl = fill_words(c+j, wordlist, &words);
-		if (words>1) {
-		    for (i=1; i<words; i++) wordlist[i][-1]='\0';
-		    *sl='\0';
-		    output_possible=1;
-		    out_html("<HTML>\n");
-                out_html("<HEAD><TITLE>Manpage of ");
-		    out_html(wordlist[0]);
-		    out_html("</TITLE>\n</HEAD><BODY>\n<H1>");
-		    out_html(wordlist[0]);
-		    out_html("</H1>\nSection: ");
-		    if (words>4) out_html(wordlist[4]);
-		    else
-			out_html(section_name(wordlist[1]));
-		    out_html(" (");
-		    out_html(wordlist[1]);
-		    if (words>2) {
-			out_html(")<BR>Updated: ");
-			scan_troff(wordlist[2], 1, NULL);
-		    } else out_html(")");
-		    out_html("<BR><A HREF=\"#index\">Index</A>\n");
-		    *sl='\n';
-/*		    fputs("<BR><A HREF=\""
-			  MAINCONTENTS
-			  "\">Return to Main Contents</A>\n", stdout);*/
-		    out_html("<HR>\n");
-		    if (mandoc_command) out_html("<BR>BSD mandoc<BR>");
-		}
-		c=sl+1;
-	    } else c=skip_till_newline(c);
-	    curpos=0;
-	    break;
-	case V('T','X'):
-	    sl=fill_words(c+j, wordlist, &words);
-	    *sl='\0';
-	    out_html(change_to_font('I'));
-	    if (words>1) wordlist[1][-1]='\0';
-	    c=lookup_abbrev(wordlist[0]);
-	    curpos+=strlen(c);
-	    out_html(c);
-	    out_html(change_to_font('R'));
-	    if (words>1)
-		out_html(wordlist[1]);
-	    *sl='\n';
-	    c=sl+1;
-	    break;
-	case V('r','m'):
-            /* .rm xx : Remove request, macro or string */
-	case V('r','n'):
-            /* .rn xx yy : Rename request, macro or string xx to yy */
-	    {
-		STRDEF *de;
-		c=c+j;
-		i=V(c[0],c[1]);
-		c=c+2;
-		while (isspace(*c) && *c!='\n') c++;
-		j=V(c[0],c[1]);
-		while (*c && *c!='\n') c++;
-		c++;
-		de=strdef;
-		while (de && de->nr!=j) de=de->next;
-		if (de) {
-		    if (de->st) free(de->st);
-		    de->nr=0;
-		}
-		de=strdef;
-		while (de && de->nr!=i) de=de->next;
-		if (de) de->nr=j;
-		break;
-	    }
-	case V('n','x'):
-            /* .nx filename : next file. */
-	case V('i','n'):
-            /* .in +-N : Indent */
-	    c=skip_till_newline(c);
-	    break;
-	case V('n','r'):
-            /* .nr R +-N M: define and set number register R by +-N;
-	    **  auto-increment by M
-	    */
-	    {
-		INTDEF *intd;
-		c=c+j;
-		i=V(c[0],c[1]);
-		c=c+2;
-		intd=intdef;
-		while (intd && intd->nr!=i) intd=intd->next;
-		if (!intd) {
-		    intd = (INTDEF*) malloc(sizeof(INTDEF));
-		    intd->nr=i;
-		    intd->val=0;
-		    intd->incr=0;
-		    intd->next=intdef;
-		    intdef=intd;
-		}
-		while (*c==' ' || *c=='\t') c++;
-		c=scan_expression(c,&intd->val);
-		if (*c!='\n') {
-		    while (*c==' ' || *c=='\t') c++;
-		    c=scan_expression(c,&intd->incr);
-		}
-		c=skip_till_newline(c);
-		break;
-	    }
-	case V('a','m'):
-            /* .am xx yy : append to a macro. */
-            /* define or handle as .ig yy */
-	    mode=1;
-	case V('d','e'):
-            /* .de xx yy : define or redefine macro xx; end at .yy (..) */
-            /* define or handle as .ig yy */
-	    {
-		STRDEF *de;
-		int olen=0;
-		c=c+j;
-		sl=fill_words(c, wordlist, &words);
-		i=V(c[0],c[1]);j=2;
-		if (words==1) wordlist[1]=".."; else {
-		    wordlist[1]--;
-		    wordlist[1][0]='.';
-		    j=3;
-		}
-		c=sl+1;
-		sl=c;
-		while (*c && strncmp(c,wordlist[1],j)) c=skip_till_newline(c);
-		de=defdef;
-		while (de && de->nr!= i) de=de->next;
-		if (mode && de) olen=strlen(de->st);
-		j=olen+c-sl;
-		h = stralloc(j*2+4);
-		if (h) {
-		    for (j=0; j<olen; j++)
-			h[j]=de->st[j];
-		    if (!j || h[j-1]!='\n')
-			h[j++]='\n';
-		    while (sl!=c) {
-			if (sl[0]=='\\' && sl[1]=='\\') {
-			    h[j++]='\\'; sl++;
-			} else
-			    h[j++]=*sl;
-			sl++;
-		    }
-		    h[j]='\0';
-		    if (de) {
-			if (de->st) free(de->st);
-			de->st=h;
-		    } else {
-			de = (STRDEF*) malloc(sizeof(STRDEF));
-			de->nr=i;
-			de->next=defdef;
-			de->st=h;
-			defdef=de;
-		    }
-		}
-	    }
-	    c=skip_till_newline(c);
-	    break;
-	case V('B','l'):	/* BSD mandoc */
-	  {
-	    char list_options[NULL_TERMINATED(MED_STR_MAX)]; 
-	    char *nl = strchr(c,'\n');
-	    c=c+j;
-	    if (dl_set[itemdepth]) {  /* These things can nest. */
-	        itemdepth++;
-	    }
-	    if (nl) {		  /* Parse list options */
-	        strlimitcpy(list_options, c, nl - c, MED_STR_MAX);
-	    }
-	    if (strstr(list_options, "-bullet")) { /* HTML Unnumbered List */
-	        dl_set[itemdepth] = BL_BULLET_LIST;
-	        out_html("<UL>\n");
-	    }
-	    else if (strstr(list_options, "-enum")) { /* HTML Ordered List */
-	        dl_set[itemdepth] = BL_ENUM_LIST;
-	        out_html("<OL>\n");
-	    }
-	    else {		  /* HTML Descriptive List */
-	        dl_set[itemdepth] = BL_DESC_LIST;
-	        out_html("<DL COMPACT>\n");
-	    }
-	    if (fillout) out_html("<P>\n"); else {
-		out_html(NEWLINE);
-		NEWLINE[0]='\n';
-	    }
-	    curpos=0;
-	    c=skip_till_newline(c);
-	    break;
-	  }
-	case V('E','l'):	/* BSD mandoc */
-	    c=c+j;
-	    if (dl_set[itemdepth] & BL_DESC_LIST) {
-		out_html("</DL>\n");
-	    }
-	    else if (dl_set[itemdepth] & BL_BULLET_LIST) {
-		out_html("</UL>\n");
-	    }
-	    else if (dl_set[itemdepth] & BL_ENUM_LIST) {
-		out_html("</OL>\n");
-	    }
-	    dl_set[itemdepth]=0;
-	    if (itemdepth > 0) itemdepth--;
-	    if (fillout) out_html("<P>\n"); else {
-		out_html(NEWLINE);
-		NEWLINE[0]='\n';
-	    }
-	    curpos=0;
-	    c=skip_till_newline(c);
-	    break;
-	case V('I','t'):	/* BSD mandoc */
-	    c=c+j;
-	    if (strncmp(c, "Xo", 2) == 0 && isspace(*(c+2))) {
-	        c = skip_till_newline(c); 
-	    }
-	    if (dl_set[itemdepth] & BL_DESC_LIST) {
-	        out_html("<DT>");
-		out_html(change_to_font('B'));
-	        if (*c=='\n') {	  /* Don't allow embedded comms after a newline */
-		    c++;	  
-		    c=scan_troff(c,1,NULL);
-		}
-		else {		  /* Do allow embedded comms on the same line. */
-		    c=scan_troff_mandoc(c,1,NULL);
-		}
-		out_html(change_to_font('R'));
-		out_html(NEWLINE);
-		out_html("<DD>");
-	    }
-	    else if (dl_set[itemdepth] & (BL_BULLET_LIST | BL_ENUM_LIST)) {
-	        out_html("<LI>");
-		c=scan_troff_mandoc(c,1,NULL);
-		out_html(NEWLINE);
-	    }
-	    if (fillout) curpos++; else curpos=0;
-	    break;
-	case V('B','k'):	/* BSD mandoc */
-	case V('E','k'):	/* BSD mandoc */
-	case V('D','d'):	/* BSD mandoc */
-	case V('O','s'):	/* BSD mandoc */
-	    trans_char(c,'"','\a');
-	    c=c+j;
-	    if (*c=='\n') c++;
-	    c=scan_troff_mandoc(c, 1, NULL);
-	    out_html(NEWLINE);
-	    if (fillout) curpos++; else curpos=0;
-	    break;
-	case V('B','t'):	/* BSD mandoc */
-	    trans_char(c,'"','\a');
-	    c=c+j;
-	    out_html(" is currently in beta test.");
-	    if (fillout) curpos++; else curpos=0;
-	    break;
-	case V('B','x'):	/* BSD mandoc */
-	    trans_char(c,'"','\a');
-	    c=c+j;
-	    if (*c=='\n') c++;
-	    out_html("BSD ");
-	    c=scan_troff_mandoc(c, 1, NULL);
-	    if (fillout) curpos++; else curpos=0;
-	    break;
-	case V('D','l'):	/* BSD mandoc */
-	    c=c+j;
-	    out_html(NEWLINE);
-	    out_html("<BLOCKQUOTE>");	    
-	    out_html(change_to_font('L'));
-	    if (*c=='\n') c++;
-	    c=scan_troff_mandoc(c, 1, NULL);	    
-	    out_html(change_to_font('R'));
-	    out_html("</BLOCKQUOTE>");	    
-	    if (fillout) curpos++; else curpos=0;
-	    break;
-	case V('B','d'):	/* BSD mandoc */
-	  {			/* Seems like a kind of example/literal mode */
-	    char bd_options[NULL_TERMINATED(MED_STR_MAX)]; 
-	    char *nl = strchr(c,'\n');
-	    c=c+j;
-	    if (nl) {
-	      strlimitcpy(bd_options, c, nl - c, MED_STR_MAX);
-	    }
-	    out_html(NEWLINE);
-	    mandoc_bd_options = 0; /* Remember options for terminating Bl */
-	    if (strstr(bd_options, "-offset indent")) {
-	        mandoc_bd_options |= BD_INDENT;
-	        out_html("<BLOCKQUOTE>\n");
-	    }
-	    if (   strstr(bd_options, "-literal")
-		|| strstr(bd_options, "-unfilled")) {
-	        if (fillout) {
-		    mandoc_bd_options |= BD_LITERAL;
-		    out_html(change_to_font(0));
-		    out_html(change_to_size('0'));
-		    out_html("<PRE>\n");
-		}
-		curpos=0;
-		fillout=0;
-	    }
-	    c=skip_till_newline(c);
-	    break;
-	  }
-	case V('E','d'):	/* BSD mandoc */
-	    if (mandoc_bd_options & BD_LITERAL) {
-	        if (!fillout) {
-		    out_html(change_to_font(0));
-		    out_html(change_to_size('0'));
-		    out_html("</PRE>\n");
-		}
-	    }
-	    if (mandoc_bd_options & BD_INDENT)
-	        out_html("</BLOCKQUOTE>\n");
-	    curpos=0;
-	    fillout=1;
-	    c=skip_till_newline(c);
-	    break;
-	case V('B','e'):	/* BSD mandoc */
-	    c=c+j;
-	    if (fillout) out_html("<P>"); else {
-		out_html(NEWLINE);
-		NEWLINE[0]='\n';
-	    }
-	    curpos=0;
-	    c=skip_till_newline(c);
-	    break;
-	case V('X','r'):	/* BSD mandoc */
-	    {
-	      /* Translate xyz 1 to xyz(1) 
-	       * Allow for multiple spaces.  Allow the section to be missing.
-	       */
-	      char buff[NULL_TERMINATED(MED_STR_MAX)];
-	      char *bufptr;
-	      trans_char(c,'"','\a');
-	      bufptr = buff;
-	      c = c+j;
-	      if (*c == '\n') c++; /* Skip spaces */
-	      while (isspace(*c) && *c != '\n') c++;
-	      while (isalnum(*c)) { /* Copy the xyz part */
-		*bufptr = *c;
-		bufptr++; if (bufptr >= buff + MED_STR_MAX) break;
-		c++;
-	      }
-	      while (isspace(*c) && *c != '\n') c++;	/* Skip spaces */
-	      if (isdigit(*c)) { /* Convert the number if there is one */
-		*bufptr = '(';
-		bufptr++; 
-		if (bufptr < buff + MED_STR_MAX) {
-		  while (isalnum(*c)) { 
-		    *bufptr = *c; 
-		    bufptr++; if (bufptr >= buff + MED_STR_MAX) break;
-		    c++;
-		  }
-		  if (bufptr < buff + MED_STR_MAX) {
-		    *bufptr = ')';
-		    bufptr++;
-		  }
-		}
-	      }
-
-	      while (*c != '\n') { /* Copy the remainder */
-		if (!isspace(*c)) {
-		  *bufptr = *c;
-		  bufptr++; if (bufptr >= buff + MED_STR_MAX) break;
-		}
-		c++;
-	      }
-	      *bufptr = '\n';
-	      scan_troff_mandoc(buff, 1, NULL);
-
-	      out_html(NEWLINE);
-	      if (fillout) curpos++; else curpos=0;
-	    }
-	    break;	  
-	case V('F','l'):	/* BSD mandoc */
-	    trans_char(c,'"','\a');
-	    c=c+j;
-	    out_html("-");
-	    if (*c!='\n') {
-	        out_html(change_to_font('B'));
-	        c=scan_troff_mandoc(c, 1, NULL);
-	        out_html(change_to_font('R'));
-            }
-	    out_html(NEWLINE);
-	    if (fillout) curpos++; else curpos=0;
-	    break;
-	case V('P','a'):	/* BSD mandoc */
-	case V('P','f'):	/* BSD mandoc */
-	    trans_char(c,'"','\a');
-	    c=c+j;
-	    if (*c=='\n') c++;
-	    c=scan_troff_mandoc(c, 1, NULL);
-	    out_html(NEWLINE);
-	    if (fillout) curpos++; else curpos=0;
-	    break;
-	case V('P','p'):	/* BSD mandoc */
-	    if (fillout) out_html("<P>\n"); else {
-		out_html(NEWLINE);
-		NEWLINE[0]='\n';
-	    }
-	    curpos=0;
-	    c=skip_till_newline(c);
-	    break;
-	case V('D','q'):	/* BSD mandoc */
-	    trans_char(c,'"','\a');
-	    c=c+j;
-	    if (*c=='\n') c++;
-	    out_html("``");
-	    c=scan_troff_mandoc(c, 1, NULL);
-	    out_html("''");
-	    out_html(NEWLINE);
-	    if (fillout) curpos++; else curpos=0;
-	    break;
-	case V('O','p'):	/* BSD mandoc */
-	    trans_char(c,'"','\a');
-	    c=c+j;
-	    if (*c=='\n') c++;
-	    out_html(change_to_font('R'));
-	    out_html("[");
-	    c=scan_troff_mandoc(c, 1, NULL);
-	    out_html(change_to_font('R'));
-	    out_html("]");
-	    out_html(NEWLINE);
-	    if (fillout) curpos++; else curpos=0;
-	    break;
-	case V('O','o'):	/* BSD mandoc */
-	    trans_char(c,'"','\a');
-	    c=c+j;
-	    if (*c=='\n') c++;
-	    out_html(change_to_font('R'));
-	    out_html("[");
-	    c=scan_troff_mandoc(c, 1, NULL);
-	    if (fillout) curpos++; else curpos=0;
-	    break;
-	case V('O','c'):	/* BSD mandoc */
-	    trans_char(c,'"','\a');
-	    c=c+j;
-	    c=scan_troff_mandoc(c, 1, NULL);
-	    out_html(change_to_font('R'));
-	    out_html("]");
-	    if (fillout) curpos++; else curpos=0;
-	    break;
-	case V('P','q'):	/* BSD mandoc */
-	    trans_char(c,'"','\a');
-	    c=c+j;
-	    if (*c=='\n') c++;
-	    out_html("(");
-	    c=scan_troff_mandoc(c, 1, NULL);
-	    out_html(")");
-	    out_html(NEWLINE);
-	    if (fillout) curpos++; else curpos=0;
-	    break;
-	case V('Q','l'):	/* BSD mandoc */
-	  {			/* Single quote first word in the line */
-	    char *sp;
-	    trans_char(c,'"','\a');
-	    c=c+j;
-	    if (*c=='\n') c++;
-	    sp = c;	  
-	    do {		/* Find first whitespace after the 
-				 * first word that isn't a mandoc macro 
-				 */
-	      while (*sp && isspace(*sp)) sp++;	    
-	      while (*sp && !isspace(*sp)) sp++;
-	    } while (*sp && isupper(*(sp-2)) && islower(*(sp-1)));
-
-				/* Use a newline to mark the end of text to 
-				 * be quoted 
-				 */
-	    if (*sp) *sp = '\n';
-	    out_html("`");	/* Quote the text */
-	    c=scan_troff_mandoc(c, 1, NULL);
-	    out_html("'");
-	    out_html(NEWLINE);
-	    if (fillout) curpos++; else curpos=0;
-	    break;
-	  }
-	case V('S','q'):	/* BSD mandoc */
-	    trans_char(c,'"','\a');
-	    c=c+j;
-	    if (*c=='\n') c++;
-	    out_html("`");
-	    c=scan_troff_mandoc(c, 1, NULL);
-	    out_html("'");
-	    out_html(NEWLINE);
-	    if (fillout) curpos++; else curpos=0;
-	    break;
-	case V('A','r'):	/* BSD mandoc */
-            /* parse one line in italics */
-	    out_html(change_to_font('I'));
-	    trans_char(c,'"','\a');
-	    c=c+j;
-	    if (*c=='\n') {	/* An empty Ar means "file ..." */
-	        out_html("file ...");
-	    }
-	    else {
-	        c=scan_troff_mandoc(c, 1, NULL);
-	    }
-	    out_html(change_to_font('R'));
-	    out_html(NEWLINE);
-	    if (fillout) curpos++; else curpos=0;
-	    break;
-	case V('A','d'):	/* BSD mandoc */
-	case V('E','m'):	/* BSD mandoc */
-	case V('V','a'):	/* BSD mandoc */
-	case V('X','c'):	/* BSD mandoc */
-            /* parse one line in italics */
-	    out_html(change_to_font('I'));
-	    trans_char(c,'"','\a');
-	    c=c+j;
-	    if (*c=='\n') c++;
-	    c=scan_troff_mandoc(c, 1, NULL);
-	    out_html(change_to_font('R'));
-	    out_html(NEWLINE);
-	    if (fillout) curpos++; else curpos=0;
-	    break;
-	case V('N','d'):	/* BSD mandoc */
-	    trans_char(c,'"','\a');
-	    c=c+j;
-	    if (*c=='\n') c++;
-	    out_html(" - ");
-	    c=scan_troff_mandoc(c, 1, NULL);
-	    out_html(NEWLINE);
-	    if (fillout) curpos++; else curpos=0;
-	    break;
-	case V('N','m'):	/* BSD mandoc */
-	  {
-	    static char mandoc_name[NULL_TERMINATED(SMALL_STR_MAX)] = "";
-	    trans_char(c,'"','\a');
-	    c=c+j;
-	    if (mandoc_synopsis) {    /* Break lines only in the Synopsis. 
-				       * The Synopsis section seems to be treated
-				       * as a special case - Bummer!
-				       */
-	        static int count = 0; /* Don't break on the first Nm */
-	        if (count) {
-		    out_html("<BR>");
-		}
-		else {
-		    char *end = strchr(c, '\n');
-		    if (end) {	/* Remember the name for later. */
-		        strlimitcpy(mandoc_name, c, end - c, SMALL_STR_MAX);
-		    }
-		}
-		count++;
-	    }			
-	    out_html(change_to_font('B'));
-	    while (*c == ' '|| *c == '\t') c++;
-	    if (*c == '\n') {	/* If Nm has no argument, use one from an earlier
-				 * Nm command that did have one.  Hope there aren't
-				 * too many commands that do this.
-				 */
-	        out_html(mandoc_name);
-	    } 
-	    else {
-	        c=scan_troff_mandoc(c, 1, NULL);
-	    }
-	    out_html(change_to_font('R'));
-	    out_html(NEWLINE);
-	    if (fillout) curpos++; else curpos=0;
-	    break;
-	  }
-	case V('C','d'):	/* BSD mandoc */
-	case V('C','m'):	/* BSD mandoc */
-	case V('I','c'):	/* BSD mandoc */
-	case V('M','s'):	/* BSD mandoc */
-	case V('O','r'):	/* BSD mandoc */
-	case V('S','y'):	/* BSD mandoc */
-            /* parse one line in bold */
-	    out_html(change_to_font('B'));
-	    trans_char(c,'"','\a');
-	    c=c+j;
-	    if (*c=='\n') c++;
-	    c=scan_troff_mandoc(c, 1, NULL);
-	    out_html(change_to_font('R'));
-	    out_html(NEWLINE);
-	    if (fillout) curpos++; else curpos=0;
-	    break;
-	case V('D','v'):	/* BSD mandoc */
-	case V('E','v'):	/* BSD mandoc */
-	case V('F','r'):	/* BSD mandoc */
-	case V('L','i'):	/* BSD mandoc */
-	case V('N','o'):	/* BSD mandoc */
-	case V('N','s'):	/* BSD mandoc */
-	case V('T','n'):	/* BSD mandoc */
-	case V('n','N'):	/* BSD mandoc */
-	    trans_char(c,'"','\a');
-	    c=c+j;
-	    if (*c=='\n') c++;
-	    out_html(change_to_font('B'));
-	    c=scan_troff_mandoc(c, 1, NULL);
-	    out_html(change_to_font('R'));
-	    out_html(NEWLINE);
-	    if (fillout) curpos++; else curpos=0;
-	    break;
-	case V('%','A'):	/* BSD mandoc biblio stuff */
-	case V('%','D'):
-	case V('%','N'):
-	case V('%','O'):
-	case V('%','P'):
-	case V('%','Q'):
-	case V('%','V'):
-	    c=c+j;
-	    if (*c=='\n') c++;
-	    c=scan_troff(c, 1, NULL); /* Don't allow embedded mandoc coms */
-	    if (fillout) curpos++; else curpos=0;
-	    break;
-	case V('%','B'):
-	case V('%','J'):
-	case V('%','R'):
-	case V('%','T'):
-	    c=c+j;
-	    out_html(change_to_font('I'));
-	    if (*c=='\n') c++;
-	    c=scan_troff(c, 1, NULL); /* Don't allow embedded mandoc coms */
-	    out_html(change_to_font('R'));
-	    if (fillout) curpos++; else curpos=0;
-	    break;
-	default:
-            /* search macro database of self-defined macros */
-	    owndef = defdef;
-	    while (owndef && owndef->nr!=i) owndef=owndef->next;
-	    if (owndef) {
-		char **oldargument;
-		int deflen;
-		int onff;
-		sl=fill_words(c+j, wordlist, &words);
-		c=sl+1;
-		*sl='\0';
-		for (i=1;i<words; i++) wordlist[i][-1]='\0';
-		for (i=0; i<words; i++) {
-		    char *h=NULL;
-		    if (mandoc_command) {
-		      scan_troff_mandoc(wordlist[i],1,&h);
-		    }
-		    else {
-		      scan_troff(wordlist[i],1,&h);
-		    }
-		    wordlist[i]=h;
-		}
-		for (i=words;i<20; i++) wordlist[i]=NULL;
-		deflen = strlen(owndef->st);
-		for (i=0; (owndef->st[deflen+2+i]=owndef->st[i]); i++);
-		oldargument=argument;
-		argument=wordlist;
-		onff=newline_for_fun;
-		if (mandoc_command) {
-		  scan_troff_mandoc(owndef->st+deflen+2, 0, NULL);
-		}
-		else {
-		  scan_troff(owndef->st+deflen+2, 0, NULL);
-		}
-		newline_for_fun=onff;
-		argument=oldargument;
-		for (i=0; i<words; i++) if (wordlist[i]) free(wordlist[i]);
-		*sl='\n';
-	    }
-	    else if (mandoc_command && 
-		     ((isupper(*c) && islower(*(c+1)))
-		      || (islower(*c) && isupper(*(c+1))))
-		     ) {	/* Let through any BSD mandoc commands that haven't
-				 * been delt with.
-				 * I don't want to miss anything out of the text.
-				 */
-	        char buf[4];
-		strncpy(buf,c,2);
-		buf[2] = ' ';	
-		buf[3] = '\0';
-		out_html(buf);	/* Print the command (it might just be text). */
-	        c=c+j;
-	        trans_char(c,'"','\a');
-		if (*c=='\n') c++;
-		out_html(change_to_font('R'));
-		c=scan_troff(c, 1, NULL);
-		out_html(NEWLINE);
-		if (fillout) curpos++; else curpos=0;
-	    }
-	    else {
-		c=skip_till_newline(c);
-	    }
-	    break;
-	}
-    }
-    if (fillout) { out_html(NEWLINE); curpos++; }
-    NEWLINE[0]='\n';
-    return c;
-}
-
-
-static int contained_tab=0;
-static int mandoc_line=0;	/* Signals whether to look for embedded mandoc
-				 * commands.
-				 */
-
-static char *scan_troff(char *c, int san, char **result)
-{   /* san : stop at newline */
-    char *h;
-    char intbuff[NULL_TERMINATED(MED_STR_MAX)];
-    int ibp=0;
-#define FLUSHIBP  if (ibp) { intbuff[ibp]=0; out_html(intbuff); ibp=0; }
-    char *exbuffer;
-    int exbuffpos, exbuffmax, exscaninbuff, exnewline_for_fun;
-    int usenbsp=0;
-
-    exbuffer=buffer;
-    exbuffpos=buffpos;
-    exbuffmax=buffmax;
-    exnewline_for_fun=newline_for_fun;
-    exscaninbuff=scaninbuff;
-    newline_for_fun=0;
-    if (result) {
-	if (*result) {
-	    buffer=*result;
-	    buffpos=strlen(buffer);
-	    buffmax=buffpos;
-	} else {
-	    buffer = stralloc(LARGE_STR_MAX);
-	    buffpos=0;
-	    buffmax=LARGE_STR_MAX;
-	}
-	scaninbuff=1;
-    }
-    h=c;
-    /* start scanning */
-
-    while (*h && (!san || newline_for_fun || *h!='\n')) {
-
-	if (*h==escapesym) {
-	    h++;
-	    FLUSHIBP;
-	    h = scan_escape(h);
-	} else if (*h==controlsym && h[-1]=='\n') {
-	    h++;
-	    FLUSHIBP;
-	    h = scan_request(h);
-	    if (san && h[-1]=='\n') h--;
-	} else if (mandoc_line
-		   && *(h) && isupper(*(h))
-		   && *(h+1) && islower(*(h+1)) 
-		   && *(h+2) && isspace(*(h+2))) {
-	    /* BSD imbedded command eg ".It Fl Ar arg1 Fl Ar arg2" */
-	    FLUSHIBP;
-	    h = scan_request(h);
-	    if (san && h[-1]=='\n') h--;
-	} else if (*h==nobreaksym && h[-1]=='\n') {
-	    h++;
-	    FLUSHIBP;
-	    h = scan_request(h);
-	    if (san && h[-1]=='\n') h--;
-	} else {
-	    if (h[-1]=='\n' && still_dd && isalnum(*h)) {
-		/* sometimes a .HP request is not followed by a .br request */
-		FLUSHIBP;
-		out_html("<DD>");
-		curpos=0;
-		still_dd=0;
-	    }
-	    switch (*h) {
-	    case '&':
-		intbuff[ibp++]='&';
-		intbuff[ibp++]='a';
-		intbuff[ibp++]='m';
-		intbuff[ibp++]='p';
-		intbuff[ibp++]=';';
-		curpos++;
-		break;
-	    case '<':
-		intbuff[ibp++]='&';
-		intbuff[ibp++]='l';
-		intbuff[ibp++]='t';
-		intbuff[ibp++]=';';
-		curpos++;
-		break;
-	    case '>':
-		intbuff[ibp++]='&';
-		intbuff[ibp++]='g';
-		intbuff[ibp++]='t';
-		intbuff[ibp++]=';';
-		curpos++;
-		break;
-	    case '"':
-		intbuff[ibp++]='&';
-		intbuff[ibp++]='q';
-		intbuff[ibp++]='u';
-		intbuff[ibp++]='o';
-		intbuff[ibp++]='t';
-		intbuff[ibp++]=';';
-		curpos++;
-		break;
-	    case '\n':
-		if (h[-1]=='\n' && fillout) {
-		    intbuff[ibp++]='<';
-		    intbuff[ibp++]='P';
-		    intbuff[ibp++]='>';
-		}
-		if (contained_tab && fillout) {
-		    intbuff[ibp++]='<';
-		    intbuff[ibp++]='B';
-		    intbuff[ibp++]='R';
-		    intbuff[ibp++]='>';
-		}
-		contained_tab=0;
-		curpos=0;
-		usenbsp=0;
-		intbuff[ibp++]='\n';
-		break;
-	    case '\t':
-		{
-		    int curtab=0;
-		    contained_tab=1;
-		    FLUSHIBP;
-		    /* like a typewriter, not like TeX */
-		    tabstops[19]=curpos+1;
-		    while (curtab<maxtstop && tabstops[curtab]<=curpos)
-			curtab++;
-		    if (curtab<maxtstop) {
-			if (!fillout) {
-			    while (curpos<tabstops[curtab]) {
-				intbuff[ibp++]=' ';
-				if (ibp>480) { FLUSHIBP; }
-				curpos++;
-			    }
-			} else {
-			    out_html("<TT>");
-			    while (curpos<tabstops[curtab]) {
-				out_html(" ");
-				curpos++;
-			    }
-			    out_html("</TT>");
-			}
-		    }
-		}
-		break;
-	    default:
-		if (*h==' ' && (h[-1]=='\n' || usenbsp)) {
-		    FLUSHIBP;
-		    if (!usenbsp && fillout) {
-			out_html("<BR>");
-			curpos=0;
-		    }
-		    usenbsp=fillout;
-		    if (usenbsp) out_html(" "); else intbuff[ibp++]=' ';
-		} else if (*h>31 && *h<127) intbuff[ibp++]=*h;
-		else if (((unsigned char)(*h))>127) {
-		    intbuff[ibp++]='&';
-		    intbuff[ibp++]='#';
-		    intbuff[ibp++]='0'+((unsigned char)(*h))/100;
-		    intbuff[ibp++]='0'+(((unsigned char)(*h))%100)/10;
-		    intbuff[ibp++]='0'+((unsigned char)(*h))%10;
-		    intbuff[ibp++]=';';
-		}
-		curpos++;
-		break;
-	    }
-	    if (ibp > (MED_STR_MAX - 20)) FLUSHIBP;
-	    h++;
-	}
-    }
-    FLUSHIBP;
-    if (buffer) buffer[buffpos]='\0';
-    if (san && *h) h++;
-    newline_for_fun=exnewline_for_fun;
-    if (result) {
-	*result = buffer;
-	buffer=exbuffer;
-	buffpos=exbuffpos;
-	buffmax=exbuffmax;
-	scaninbuff=exscaninbuff;
-    }
-    return h;
-}
-
-
-static char 
-*scan_troff_mandoc(char *c, int san, char **result)
-{
-    char *ret, *end = c;
-    int oldval = mandoc_line;
-    mandoc_line = 1;
-    while (*end && *end != '\n') {
-        end++;
-    }
-
-    if (end > c + 2
-        && ispunct(*(end - 1)) 
-	&& isspace(*(end - 2)) && *(end - 2) != '\n') {
-      /* Don't format lonely punctuation E.g. in "xyz ," format
-       * the xyz and then append the comma removing the space.
-       */
-        *(end - 2) = '\n';
-	ret = scan_troff(c, san, result);
-        *(end - 2) = *(end - 1);
-        *(end - 1) = ' ';
-    }
-    else {
-	ret = scan_troff(c, san, result);
-    }
-    mandoc_line = oldval;
-    return ret;
-}
-
-static char *sectionname=NULL;
-
-#ifndef LESSTIF
-
-static STRDEF *foundpages=NULL;
-static const char *sections = "123456789nl";
-
-static int 
-search_manpath_all(char *name)
-{
-    char smfbuf[NULL_TERMINATED(LARGE_STR_MAX)];
-    char cmpbuf[NULL_TERMINATED(MED_STR_MAX)];
-    int i,j,n,l,nr=0;
-    DIR *dr;
-    struct dirent *de;
-    STRDEF *h=NULL;
-
-    strmaxcpy(cmpbuf,name, MED_STR_MAX - 2);
-    if (strlen(name) > MED_STR_MAX) {
-      fprintf(stderr, 
-	      "man2html: search_manpath_all - name too long: \n%-80s...\n",
-	      name);
-      exit(EXIT_FAILURE);
-    }
-
-    n=strlen(name);
-    cmpbuf[n++]='.';
-    cmpbuf[n+1]='\0';
-    for (i=0; manpath[i]; i++) {
-	strmaxcpy(smfbuf, manpath[i], LARGE_STR_MAX - 10);
-	l=strlen(smfbuf);
-	strcpy(smfbuf+l, "man");
-	l+=3;
-	smfbuf[l+1]='\0';
-	for (j=0; sections[j]; j++) {
-	    smfbuf[l]=sections[j];
-	    cmpbuf[n]=sections[j];
-	    if ((dr=opendir(smfbuf))) {
-		while ((de=readdir(dr))) {
-#ifdef CASE_SENSITIVE
-		    if (!strncasecmp(de->d_name, cmpbuf, n+1)) {
-#else
-		    if (!strncmp(de->d_name, cmpbuf, n+1)) {
-#endif
-			if (h) {
-			    h->next=(STRDEF*) malloc(sizeof(STRDEF));
-			    h=h->next;
-			} else
-			    h=foundpages=(STRDEF*) malloc(sizeof(STRDEF));
-			h->nr=i*256+j;
-			nr++;
-			h->st = strduplicate(de->d_name);
-			h->next=NULL;
-		    }
-		}
-		closedir(dr);
-	    }
-	}
-    }
-    return nr;
-}
-
-
-static int
-search_manpath_section(char *name, char* section)
-{
-    char smfbuf[NULL_TERMINATED(LARGE_STR_MAX)];
-    char cmpbuf[NULL_TERMINATED(SMALL_STR_MAX)];
-    int i,j,n,l,nr=0;
-    DIR *dr;
-    struct dirent *de;
-    STRDEF *h=NULL;
-
-    if (!section) return search_manpath_all(name);
-    j=0;
-    while (sections[j] && sections[j]!=section[0]) j++;
-    if (!sections[j]) return search_manpath_all(name);
-    if (strlen(name) > SMALL_STR_MAX) {
-      fprintf(stderr, 
-	      "man2html: search_manpath_section - name too long: \n%-80s...\n",
-	      name);
-      exit(EXIT_FAILURE);
-    }
-    strmaxcpy(cmpbuf,name, SMALL_STR_MAX);
-    n=strlen(name);
-    cmpbuf[n++]='.';
-    cmpbuf[n++]=section[0];
-    cmpbuf[n]='\0';
-    for (i=0; manpath[i]; i++) {
-	strmaxcpy(smfbuf, manpath[i], LARGE_STR_MAX - 10);
-	l=strlen(smfbuf);
-	strcpy(smfbuf+l, "man");
-	l+=3;
-	smfbuf[l]=section[0];
-	smfbuf[l+1]='\0';
-	if ((dr=opendir(smfbuf))) {
-	    while ((de=readdir(dr))) {
-#ifdef CASE_SENSITIVE
-		if (!strncasecmp(de->d_name, cmpbuf, n)) {
-#else
-		if (!strncmp(de->d_name, cmpbuf, n)) {
-#endif
-		    if (h) {
-			h->next=(STRDEF*) malloc(sizeof(STRDEF));
-			h=h->next;
-		    } else
-			h=foundpages=(STRDEF*) malloc(sizeof(STRDEF));
-		    h->nr=i*256+j;
-		    nr++;
-		    h->st = strduplicate(de->d_name);
-		    h->next=NULL;
-		}
-	    }
-	    closedir(dr);
-	}
-    }
-    return nr;
-}
-
-static char smfbuf[NULL_TERMINATED(LARGE_STR_MAX)];
-
-
-static char 
-*search_manpath(const char *name)
-{
-    int i;
-    struct stat stbuf;
-
-    for (i=0; manpath[i]; i++) {
-	if (strlen(name) + strlen(manpath[i]) > LARGE_STR_MAX) {
-	    fprintf(stderr, 
-		    "man2html: search_manpath - name too long: \n%-80s...\n",
-		    name);
-	    exit(EXIT_FAILURE);
-        }
-	strmaxcpy(smfbuf, manpath[i], LARGE_STR_MAX);
-	strmaxcat(smfbuf, name, LARGE_STR_MAX);
-	if (stat(smfbuf, &stbuf) !=-1) return smfbuf;
-    }
-    return NULL;
-}
-
-
-static void
-get_man_config(void)
-{
-#ifdef MAN_CONFIG
-  FILE *config = NULL;
-  int num_paths = 1;			/* Zero is reserved for searches */
-  int num_zcats = 0;
-  char buffer[NULL_TERMINATED(MED_STR_MAX + 1)]; /* Allow for adding a "/" */
-
-  config = fopen(MAN_CONFIG, "r");
-  if (!config) {
-    return;				/* Assume no config. */
-  }
-
-  while (fgets(buffer, MED_STR_MAX, config)) {
-    char *dir, *line = buffer;
-    line = line + strspn(line, " \t"); /* Skip spaces and tabs */
-    if (num_paths < MAX_MAN_PATHS 
-	&& strncmp("MANPATH", line, 7) == 0 
-	&& (dir = strchr(line, '/'))) {	/* dir points to start of dir-name */
-      char *end_dir = strpbrk(dir, " \t\n") ;
-      if (end_dir) {			/* End of dir name. */
-	(*end_dir) = '/';		/* Replace newline/space with "/" */
-        (*(end_dir + 1)) = '\0';
-      }
-      manpath[num_paths] = strduplicate(dir);
-      num_paths++;
-    }
-#ifndef DISABLE_ZCATS
-    else if (num_zcats < MAX_ZCATS
-	     && *line == '.') {
-      char *sp, *new;
-      line[strlen(line) - 1] = '\0';	/* Remove newline */
-      zcats[num_zcats] = strduplicate(line);
-      sp = strpbrk(zcats[num_zcats], " \t");
-      if (sp) {				/* Chop off trailing spaces */
-	(*sp) = '\0';
-	num_zcats++;
-      }
-      else {
-	free(zcats[num_zcats]);
-      }
-    }
-#endif
-  }
-  if (num_paths != 0) {			/* Mark new end of paths list */
-    manpath[num_paths] = NULL;
-  }
-#ifndef DISABLE_ZCATS
-  if (num_zcats != 0) {			/* Mark new end of zcats list */
-    zcats[num_zcats] = NULL;
-  }
-#endif
-
-#ifndef UNSECURE_MANPATH
-					/* Make sure settable first path is
-					 * a valid path.
-					 */
-
-  if (strcmp(manpath[0], "/") != 0) {   /* Something other than default */
-    int i;
-    for (i = 1; manpath[i]; i++) {	/* Set - see if it is a valid prefix */
-      if (strncmp(manpath[i], manpath[0], strlen(manpath[i])) == 0) {
-	break;				/* valid */
-      }
-    }
-					/* Also check for .. */
-    if (!manpath[i] || strstr(manpath[0], "..") != NULL) { /* invalid */
-      fprintf(stderr, "man2html: invalid -M path: %s\n", manpath[0]);
-      manpath[0] = manpath[1];
-    }
-  }
-#endif
-  fclose(config);
-#endif
-}
-
-#endif /* !LESSTIF */
-
-
-int
-main(int argc, char **argv)
-{
-    char *t=NULL;
-    int l,i;
-    char *buf=NULL;
-    int mopt=0;
-#ifndef LESSTIF
-    int notinsection=0;
-#endif
-    char *h;
-    char *fullname="";
-    STRDEF *stdf;
-
-#ifndef LESSTIF
-    t = getenv("PATH_INFO");
-#endif
-
-    if (!t || !*t) /* not :  cgi/man2html/mani/name.i */ {
-	i=1;
-	while (i<argc) {
-	    switch (argv[i][0]) {
-	    case '-':
-		if (argv[i][1]=='M') {	/* First path to search */
-		    mopt=1;
-		    if (i+1<argc) {
-			char *s1, *s2;
-			i++;
-			l=strlen(argv[i]);
-			manpath[0] = stralloc(l+2);
-			s1=manpath[0];
-			s2=argv[i];
-			while ((*s1=*s2)) {
-			    if (*s2=='%') {
-				s2++;
-				*s1=0;
-				if (isdigit(*s2)) *s1=*s2-'0';
-				else              *s1=tolower(*s2)-'a'+10;
-				s2++;
-				*s1=(*s1)*16;
-				if (isdigit(*s2)) *s1=*s1+*s2-'0';
-				else              *s1=*s1+tolower(*s2)-'a'+10;
-			    }
-			    s1++;
-			    s2++;
-			}
-			if (s1[-1]!='/') { *s1++='/';*s1='\0'; }
-		    }
-		}
-		else if (argv[i][1] == 'f') { /* Filter */
-			dofilter=1;
-		}
-		else if (argv[i][1] == 'w') { /* for webpage */
-			doweb=1;
-		}
-		break;
-	    case '1': case '2': case '3': case '4': case '5': case '6':
-	    case '7': case '8': case '9': case 'n': case 'l':
-					/* Section name eg 1 or 1n */
-		if (!argv[i][1]) {
-		    sectionname=argv[i];
-		    break;
-		} else
-		    if (!argv[i][2] && isalpha(argv[i][1]) &&
-			!isalpha(argv[i][0]) && islower(argv[i][1])) {
-			sectionname=argv[i];
-			break;
-		    }
-	    default:
-		if (argv[i][0])
-		    t=argv[i];
-		break;
-	    }
-	    i++;
-	}
-	if (t) {			/* Man page name */
-	    char *s1, *s2;
-	    i++;
-	    s2=t;
-	    t = s1 = stralloc(strlen(t));
-	    while ((*s1=*s2)) {
-		if (*s2=='%') {
-		    s2++;
-		    *s1=0;
-		    if (isdigit(*s2)) *s1=*s2-'0';
-		    else              *s1=tolower(*s2)-'a'+10;
-		    s2++;
-		    *s1=(*s1)*16;
-		    if (isdigit(*s2)) *s1=*s1+*s2-'0';
-		    else              *s1=*s1+tolower(*s2)-'a'+10;
-		}
-		s1++;
-		s2++;
-	    }
-	}
-    }
-
-    if (! dofilter) {
-
-#ifdef LESSTIF
-    fprintf(stderr, "LessTif's man2html\n");
-    fprintf(stderr, "Sorry, this mode is not supported by this binary!\n");
-    exit(1);
-#else    
-    if (!t || !*t) usage();		/* No man page requested */
-
-    get_man_config();
-
-    i=0;
-    h=t;
-
-    if (strncmp(CGIBASE, "http:", 5) == 0 && strncmp(CGIBASE, "http://", 7) != 0 
-	&& getenv("SERVER_NAME")) {	
-
-        /* Work out name for any redirect */
-
-        char *ptr = CGIBASE;
-	char *s = getenv("SERVER_NAME");
-	if (strlen(s) > MED_STR_MAX - strlen(CGIBASE) - 7) {
-	  fprintf(stderr, 
-		  "man2html: error - server name is too long: \n%-80s...\n",
-		  s);
-	  exit(EXIT_FAILURE);
-	}
-        strmaxcpy(location_base, "http://", MED_STR_MAX);
-        strmaxcat(location_base, getenv("SERVER_NAME"), MED_STR_MAX);
-        strmaxcat(location_base, ptr + 5, MED_STR_MAX);	    
-    }
-    else {
-        strcpy(location_base, CGIBASE);
-    }
-
-    while (*h) i=i+(*h++ == '/');
-    if (i==0) {
-	if (sectionname) {
-	    char fname[NULL_TERMINATED(LARGE_STR_MAX)];
-
-	    if (strlen(t) + strlen(sectionname) + 6 > LARGE_STR_MAX) {
-	        fprintf(stderr, 
-			"man2html: error - name too long: man%c/%-80s.%-80s\n",
-			sectionname[0],t,sectionname);
-	        exit(EXIT_FAILURE);
-	    }
-	    sprintf(fname, "man%c/%s.%s", sectionname[0],t,sectionname);
-	    h=search_manpath(fname);
-	    if (h) {
-		printf("Location: %s%s\n\n", location_base, h);
-		exit(0);
-	    } else {
-		if (sectionname[1]) fname[strlen(fname)-1]='\0';
-		i=search_manpath_section(t,sectionname);
-		notinsection=(i>0);
-	    }
-	}
-	if (!i) i=search_manpath_all(t);
-	if (i==1 || (i>1 && mopt)) {
-	    printf("Location: %s%sman%c/%s\n\n",
-		   location_base,
-		   manpath[foundpages->nr/256],
-		   sections[foundpages->nr%256],
-		   foundpages->st);
-	    exit(0);
-	}
-	printf("Content-type: text/html\n\n"
-	       "<HTML>\n"
-             "<HEAD>\n<TITLE>Index to %s manpages.</TITLE>\n"
-	       "</HEAD><BODY>\n<H1>Index to %s manpages%s%c</H1>\n", t, t,
-	       (notinsection?" for section ":""),
-	       (notinsection?sectionname[0]:' '));
-	if (!i)
-	    printf("Sorry, no manpages available for %s.\n", t);
-	else {
-	    STRDEF *strd;
-	    fputs("<UL>\n", stdout);
-	    strd=foundpages;
-	    while (strd) {
-		printf("<LI><A HREF=\"" CGIBASE "%sman%c/%s\">"
-		       "%s</A> (%s)\n", manpath[strd->nr/256],
-		       sections[strd->nr%256], strd->st, trim_compress_suffix(strd->st),
-		       manpath[strd->nr/256]);
-		strd=strd->next;
-	    }
-	    fputs("</UL>\n", stdout);
-	}
-	fputs("</BODY></HTML>\n", stdout);
-	exit(0);
-    }
-    fputs("Content-type: text/html\n\n", stdout);
-
-    if (*t == '/') {
-      for (i = 1; manpath[i]; i++) {
-	if (strncmp(manpath[i], t, strlen(manpath[i])) == 0) {
-	  break;
-	}
-      }
-      if (!manpath[i]) {
-	fprintf(stderr, "man2html: request for non man file %s\n", t);
-	printf("<HTML>\n"
-             "<HEAD><TITLE>Manpage: Error</TITLE>\n"
-	       "</HEAD><BODY>\n<H1>Only manpages are allowed.</H1>\n"
-	       "To view the file you wanted, use this\n"
-	       "<A HREF=\"file:%s\">link</A> instead\n"
-	       "</BODY></HTML>\n", t);
-	exit(0);
-      }
-    }
-    else {
-      fprintf(stderr, "man2html: request for non man file %s\n", t);
-      h=strstr(t, "man"); 
-      if (!h || strchr(h, '/') == NULL) {
-	printf("<HTML>\n"
-             "<HEAD><TITLE>Manpage: Error</TITLE>\n"
-	       "</HEAD><BODY>\n<H1>Only manpages are allowed</H1>\n"
-	       "To view the file you wanted, use this\n"
-	       "<A HREF=\"file:%s\">link</A> instead\n"
-	       "</BODY></HTML>\n", t);
-	exit(0);
-      }
-    }
-
-    h=strstr(t,"/../");
-    if (h) {
-        fprintf(stderr, "man2html: attempt to use .. in man2html: %s\n", t);
-	fputs("<HTML>\n"
-            "<HEAD><TITLE>Manpage: Error</TITLE>\n"
-	      "</HEAD><BODY>\n<H1>Warning.</H1>\n"
-	      "You still try to get files which are manpages. Using the\n"
-	      "<B>..</B> construction to get to a different directory will\n"
-	      "<B>not</B> work either. If you try this very often, you\n"
-	      "will end up in a black list.\n"
-	      "</BODY></HTML>\n", stdout);
-	exit(0);
-    }
-    h=search_manpath(t);
-    if (!h && i>2) {
-	char *g;
-	g=strrchr(t,'/');
-	*g='.';
-	h=strrchr(t,'/');
-	*g='/';
-	h=search_manpath(h);
-    }
-    if (!h) {
-	h=strrchr(t,'.');
-	if (h) {
-	    *h='\0';
-	    sectionname=h+1;
-	} else sectionname=NULL;
-	h=strrchr(t,'/');
-	if (!h) h=t; else h++;
-	printf("<HTML>\n"
-             "<HEAD><TITLE>No manpage for %s.</TITLE>\n"
-	       "</HEAD><BODY>\n<H1>No manpage for %s.</H1>\n"
-	       "Sorry, the manpage for %s does not exist%s%s",
-	       h,h,h, (sectionname? " in section ":""),
-	       (sectionname?sectionname:""));
-       	i=search_manpath_all(h);
-	if (!i) {
-	    if (sectionname)
-	      fputs(", nor in any other section.\n", stdout);
-	    else
-	      fputs("in any section.\n", stdout);
-	    fputs("<HR>\n"
-		  "The links to other manual pages are not always correct.\n"
-		  "Normally you will get a list of possible replacements,\n"
-		  "but in this case the manual page just can't be found.\n",
-		  stdout);
-	} else {
-	    STRDEF *strd;
-	    printf(".\nMaybe you can use %s instead.\n<UL>\n",
-		   (i>1?"one of the following pages":"this page"));
-	    strd=foundpages;
-	    while (strd) {
-		printf("<LI><A HREF=\"" CGIBASE "%sman%c/%s\">"
-		       "%s</A> (%s)\n", manpath[strd->nr/256],
-		       sections[strd->nr%256], strd->st, trim_compress_suffix(strd->st),
-		       manpath[strd->nr/256]);
-		strd=strd->next;
-	    }
-	    fputs("</UL>\n", stdout);
-	}
-	fputs("</BODY></HTML>\n", stdout);
-	exit(0);
-    }
-    fullname=h;
-    t=strrchr(h,'/');
-    if (t) {
-	*t='\0';
-	if (!chdir(h))
-	    h=t+1;
-	*t='/';
-    }
-    buf=read_man_page(h);
-    if (!buf) {
-	t=strrchr(h,'.');
-	if (t) *t='\0';
-	t=strrchr(h,'/');
-	if (!t) t=h; else t++;
-	printf("<HTML>\n"
-             "<HEAD><TITLE>No manpage for %s.</TITLE>\n"
-	       "</HEAD><BODY>\n<H1>No manpage for %s.</H1>\n"
-	       "Sorry, unable to convert the manpage for %s.\n"
-	       "</BODY></HTML>\n", t,t,t);
-	exit(0);
-    }
-  }
-#endif 	/* !LESSTIF */
-  } else { /* We're filtering */
-	h = "-";
-	buf=read_man_page(h);
-  }
-
-
-    fname=h;
-#ifdef MAKEINDEX
-    idxfile=fopen(INDEXFILE, "a");
-#endif
-    stdf=&standardchar[0];
-    i=0;
-    while (stdf->nr) {
-	stdf->next=&standardchar[i];
-	stdf=stdf->next;
-	i++;
-    }
-    chardef=&standardchar[0];
-    stdf=&standardstring[0];
-    i=0;
-    while (stdf->nr) {
-	stdf->next=&standardstring[i];
-	stdf=stdf->next;
-	i++;
-    }
-    strdef=&standardstring[0];
-    intdef=&standardint[0];
-    i=0;
-    while (intdef->nr) {
-	intdef->next=&standardint[i];
-	intdef=intdef->next;
-	i++;
-    }
-    intdef=&standardint[0];
-    defdef=NULL;
-    scan_troff(buf+1,0,NULL);
-    while (itemdepth || dl_set[itemdepth]) {
-	out_html("</DL>\n");
-	if (dl_set[itemdepth]) dl_set[itemdepth]=0;
-	else if (itemdepth > 0) itemdepth--;
-    }
-    out_html(change_to_font(0));
-    out_html(change_to_size(0));
-    if (!fillout) {
-	fillout=1;
-	out_html("</PRE>");
-    }
-    out_html(NEWLINE);
-    if (output_possible) {
-	/*   for mosaic users */
-	fputs("<HR>\n<A NAME=\"index\"> </A><H2>Index</H2>\n<DL>\n", 
-	      stdout);
-	manidx[mip]=0;
-	fputs(manidx,stdout);
-	if (subs) fputs("</DL>\n", stdout);
-	fputs("</DL>\n", stdout);
-	print_sig();
-	fputs("</BODY>\n</HTML>\n", stdout);
-    } else {
-	printf("<HTML>\n"
-             "<HEAD><TITLE>Invalid Manpage</TITLE></HEAD>\n"
-	       "<BODY><H1>Invalid Manpage</H1>\n"
-	       "You tried to retrieve an incorrect manpage.\n"
-	       "The page does not contain a manpage header and will\n"
-	       "not produce any output.\n"
-	       "If the page is a formatted manpage, you might want to use\n"
-	       "a different man2html (or cat2html) converter.\n"
-	       "You can also try to load the\n"
-	       "<A HREF=\"file://localhost%s\">plain file</A>\n",
-	       fullname);
-	print_sig();
-	fputs("</BODY>\n</HTML>\n", stdout);
-    }
-#ifdef MAKEINDEX
-    if (idxfile) fclose(idxfile);
-#endif
-
-    if (buf)
-       free(buf);
-    
-    exit(0);
-}
diff --git a/src/html/mb7k2jstar.html b/src/html/mb7k2jstar.html
deleted file mode 100644
index 78a8687..0000000
--- a/src/html/mb7k2jstar.html
+++ /dev/null
@@ -1,386 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<HTML VERSION="2.0">
-<HEAD>
-   <TITLE>MB-System Unix Manual Page: mb7k2jstar</TITLE>
-<!-- WEBMAGIC VERSION NUMBER="2.0.2" -->
-<!-- WEBMAGIC TRANSLATION NAME="ServerRoot" SRC="/var/www/htdocs/" DST="/" -->
-<!-- WEBMAGIC TRANSLATION NAME="ProjectRoot" SRC="./" DST="" -->
-</HEAD>
-<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#336699" VLINK="#997040" ALINK="#CC9900">
-<BODY>
-<CENTER><H3><U>MB-System Unix Manual Page</U></H3></CENTER>
-<PRE>
-<H1>mb7k2jstar</H1>
-Section:  MB-System 5.0  (1)<BR>Updated:  3 June 2013 <BR><A HREF="#index">Index</A>
-<HR>
-
-<A NAME="lbAB"> </A>
-<H2>NAME</H2>
-
-<B>mb7k2jstar</B> - extracts subbottom profiler and/or sidescan sonar
-data from Reson 7k format data files into Edgetech Jstar format data files.
-<P>
-<A NAME="lbAC"> </A>
-<H2>VERSION</H2>
-
-Version 5.0
-<P>
-<A NAME="lbAD"> </A>
-<H2>SYNOPSIS</H2>
-
-<B>mb7k2jstar</B> [<B>-I</B><I>file </I><B>-A</B><I>type</I>
-<B>-B</B><I>bottompickmode/bottompickthreshold</I> <B>-C</B>
-<B>-F</B><I>format</I> <B>-L</B><I>startline/lineroot</I>
-<B>-M -O</B><I>outfile</I> <B>-R</B><I>routefile</I> <B>-X -H -V</B>]
-<P>
-<A NAME="lbAE"> </A>
-<H2>DESCRIPTION</H2>
-
-<B>MB7k2jstar</B> is a utility that extracts Edgetech subbottom
-profiler and sidescan data from Reson 7k format (MBIO format 88) data and
-outputs in the Edgetech Jstar format (MBIO formats 132 and 133).
-By default, <B>mb7k2jstar</B> extracts all channels of
-sonar data from the Reson 7k file to the Edgetech Jstar file.
-Edgetech sonar systems may include dual frequency sidescans and a
-subbottom profiler. Users may use the <B>-A</B> option to specify
-which channels are extracted. <B>MB7k2jstar</B> operates on single
-input files or on datalists. By default there will be a separate
-output file for every input file, but if the <B>-O</B> option
-is used to specify an output file, data from all input files will
-be directed to that single output file.
-<P>
-The extracted Jstar data file(s) can be organized three ways. If the <B>-O</B>
-option is used to specify a single Jstar output file, then all of the
-Jstar data will be output to that single file. If the <B>-R</B> option is
-used to specify a survey route file that includes the waypoints covered
-while collecting the data file(s) referenced by <B>-I</B><I>file</I>, then
-the output Jstar data will be broken up by the sequential lines defined by
-the waypoints. In this case each output Jstar file will be named using the
-line root name specified by <B>-L</B><I>startline/lineroot</I> with a sequential line
-number starting from <I>startline</I>. If neither the <B>-O</B> or <B>-L</B>
-options are used, each input swath file will have a corresponding Jstar output
-file.
-<P>
-When the user specifies that all Edgetech sidescan and subbottom
-data be extracted but does not specify the output file name, the
-output files will have the "*.jsf" suffix recognized by Edgetech
-software. If the <B>-A</B><I>1</I> option is used to specify that only
-low frequency sidescan be extracted, the output files will have
-an "*.mb132" suffix. If the <B>-A</B><I>1</I> option is used to specify that only
-high frequency sidescan be extracted, the output files will have
-an "*.mb133" suffix.
-<P>
-<A NAME="lbAF"> </A>
-<H2>AUTHORSHIP</H2>
-
-David W. Caress (<A HREF="mailto:caress at mbari.org">caress at mbari.org</A>)
-<BR>
-
-<BR>  Monterey Bay Aquarium Research Institute
-<BR>
-
-Dale N. Chayes (<A HREF="mailto:dale at ldeo.columbia.edu">dale at ldeo.columbia.edu</A>)
-<BR>
-
-<BR>  Lamont-Doherty Earth Observatory
-<P>
-<A NAME="lbAG"> </A>
-<H2>OPTIONS</H2>
-
-<DL COMPACT>
-<DT><B>-A</B>
-
-<DD>
-<I>mode</I>
-<BR>
-
-This option sets the types of data to be extracted and output.
-If <B>-A</B><I>1</I> is given, then any low frequency sidescan
-in the input will be extracted to the output. If <B>-A</B><I>2</I>
-is given, then any high frequency sidescan records are extracted.
-The <B>-A</B><I>3</I> option causes subbottom profiler records to
-be extracted. Default: All Edgetech sidescan and subbottom
-profiler records are extracted.
-<DT><B>-B</B>
-
-<DD>
-<I>bottompickmode/bottompickthreshold</I>
-<BR>
-
-This option sets the source of the sonar first arrival time embedded into
-the Jstar format trace headers. This value can be used for
-laying out sidescan on the seafloor. If <I>bottompickmode</I> = 1,
-then <B>mb7k2jstar</B> will use the altitude value associated with
-platform navigation. If <I>bottompickmode</I> = 2, then <B>mb7k2jstar</B>
-will extract the first arrival time from multibeam bathymetry in the
-7k data stream. If <I>bottompickmode</I> = 3, then <B>mb7k2jstar</B>
-will pick the first arrival time in the sidescan sonar data by looking
-for the first sample with an amplitude > <I>bottompickthreshold</I> times the
-maximum amplitude in the trace.
-Default: <I>bottompickmode</I> = 1.
-<DT><B>-C</B>
-
-<DD>
-<BR>
-
-This option causes  <B>mb7k2jstar</B> to print out any comment records
-encountered in the input Reson 7k data.
-<DT><B>-F</B>
-
-<DD>
-<I>format</I>
-<BR>
-
-Sets the data format used if the input is read from stdin
-or from a file. If <I>format</I> < 0, then the input file specified
-with the <B>-I</B> option will actually contain a list of input swath sonar
-data files. This program only reads Reson 7k format data files (<B>MBIO</B>
-format 88).
-<DT><B>-H</B>
-
-<DD>
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-<DT><B>-I</B>
-
-<DD>
-<I>infile</I>
-<BR>
-
-Sets the input file path. If <I>format</I> > 0 (set with the
-<B>-f</B> option or <B>mbdefaults</B>) then the swath sonar data contained in <I>infile</I>
-is read and processed. If <I>format</I> < 0, then <I>infile</I>
-is assumed to be an ascii file containing a list of the input swath sonar
-data files to be processed and their formats.  The program will read
-the data in each one of these files.
-In the <I>infile</I> file, each
-data file should be followed by a data format identifier, e.g.:
-<BR> <TT>       </TT>datafile1 88<BR>
-<BR> <TT>       </TT>datafile2 88<BR>
-<BR>
-
-This program only reads Reson 7k format data files (<B>MBIO</B>
-format 88).
-<DT><B>-L</B>
-
-<DD>
-<I>startline/lineroot</I>
-<BR>
-
-This option sets the starting line number and the output filename root
-used when <B>-R</B> is specified so that data are output according
-to planned survey lines. Default: <I>startline</I> = 1; <I>lineroot</I> = "jstar".
-<DT><B>-M</B>
-
-<DD>
-<BR>
-
-This option causes <B>mb7k2jstar</B> to omit data during turns when
-extracting into line files according to a specified set of waypoints
-(<B>-R</B> option). The traces will not be output until the heading is
-within 15 degrees of the next survey line's bearing.
-<DT><B>-O</B>
-
-<DD>
-<BR>
-
-This option sets the output Edgetech Jstar (<B>MBIO</B> format 132/133) format file path.
-If <B>-O</B> is not invoked,
-the output jstar filename (or files if a datalist is being processed) will
-be the input swath filename with the ".s7k" or ".mb88" suffix replaced by a new suffix.
-An ".jsf" suffix is used when all Edgetech record types are extracted
-to the output, ".mb132" is used when the low frequency sidescan records are extracted,
-and ".mb133" is used when the high frequency sidescan records are extracted. The record
-types to be extracted are set using the <B>-A</B> option.
-<DT><B>-R</B>
-
-<DD>
-<I>routefile</I>
-<BR>
-
-This option specifies an <B>mbgrdviz</B> route file containing the intended
-waypoints of the survey. If <I>routefile</I> is specified, <B>mb7k2jstar</B>
-will output Jstar data in files corresponding to the planned survey lines.
-The output Jstar file names will be based on <I>lineroot</I> and will include
-the line number starting with <I>starline</I>, both of which are specified
-using the <B>-L</B> options.  If neither <B>-O</B> nore <B>-R</B> are invoked,
-the output Jstar filename (or files if a datalist is being processed) will
-be the input swath filename with an appropriate suffix appended (".jsf" for
-mixed Jstar files, ".mb132" for low frequency sidescan only files, and ".mb133"
-for high frequency sidescan only files).
-<DT><B>-V</B>
-
-<DD>
-This option increases the verbosity of <B>mb7k2jstar</B>, causing it
-to print out messages regarding its progress to stdout.
-<DT><B>-X</B>
-
-<DD>
-This option switches port and starboard sidescan channels.
-<P>
-</DL>
-<A NAME="lbAH"> </A>
-<H2>EXAMPLES</H2>
-
-Suppose that one has collected a Reson 7k datafile incorporating
-multibeam sonar data, sidescan data, and subbottom profiler data, and
-that the filename is:
-<BR> <TT>       </TT>20050418_150155.s7k<BR>
-<BR>
-
-<P>
-In order to extract all of the Edgetech sonar data into a Jstar file, one can use
-<B>mb7k2jstar</B> with no special arguments:
-<BR> <TT>       </TT>mb7k2jstar -I 20040722_152111.s7k<BR>
-<BR>
-
-which yields the following output:
-<P>
-<BR> <TT>       </TT>Data records read from: 20050418_150155.s7k<BR>
-<BR> <TT>       </TT>     Survey:        990<BR>
-<BR> <TT>       </TT>     File Header:   1<BR>
-<BR> <TT>       </TT>     Bluefin CTD:   989<BR>
-<BR> <TT>       </TT>     Bluefin Nav:   760<BR>
-<BR> <TT>       </TT>     Subbottom:     989<BR>
-<BR> <TT>       </TT>     Low Sidescan:  990<BR>
-<BR> <TT>       </TT>     High Sidescan: 989<BR>
-<BR> <TT>       </TT>Data records written to: 20050418_150155.jsf<BR>
-<BR> <TT>       </TT>     Subbottom:     989<BR>
-<BR> <TT>       </TT>     Low Sidescan:  990<BR>
-<BR> <TT>       </TT>     High Sidescan: 989<BR>
-<P>
-One may also extract just the low frequency sidescan by using the <B>-A</B><I>1</I> option:
-<BR> <TT>       </TT>mb7k2jstar -I 20040722_152111.s7k -A1<BR>
-<BR>
-
-which yields the following output:
-<P>
-<BR> <TT>       </TT>Data records read from: 20050418_150155.s7k<BR>
-<BR> <TT>       </TT>     Survey:        990<BR>
-<BR> <TT>       </TT>     File Header:   1<BR>
-<BR> <TT>       </TT>     Bluefin CTD:   989<BR>
-<BR> <TT>       </TT>     Bluefin Nav:   760<BR>
-<BR> <TT>       </TT>     Subbottom:     989<BR>
-<BR> <TT>       </TT>     Low Sidescan:  990<BR>
-<BR> <TT>       </TT>     High Sidescan: 989<BR>
-<BR> <TT>       </TT>Data records written to: 20050418_150155.mb132<BR>
-<BR> <TT>       </TT>     Subbottom:     0<BR>
-<BR> <TT>       </TT>     Low Sidescan:  990<BR>
-<BR> <TT>       </TT>     High Sidescan: 0<BR>
-<P>
-One may also extract just the high frequency sidescan by using the <B>-A</B><I>2</I> option:
-<BR> <TT>       </TT>mb7k2jstar -I 20040722_152111.s7k -A2<BR>
-<BR>
-
-which yields the following output:
-<P>
-<BR> <TT>       </TT>Data records read from: 20050418_150155.s7k<BR>
-<BR> <TT>       </TT>     Survey:        990<BR>
-<BR> <TT>       </TT>     File Header:   1<BR>
-<BR> <TT>       </TT>     Bluefin CTD:   989<BR>
-<BR> <TT>       </TT>     Bluefin Nav:   760<BR>
-<BR> <TT>       </TT>     Subbottom:     989<BR>
-<BR> <TT>       </TT>     Low Sidescan:  990<BR>
-<BR> <TT>       </TT>     High Sidescan: 989<BR>
-<BR> <TT>       </TT>Data records written to: 20050418_150155.mb132<BR>
-<BR> <TT>       </TT>     Subbottom:     0<BR>
-<BR> <TT>       </TT>     Low Sidescan:  990<BR>
-<BR> <TT>       </TT>     High Sidescan: 0<BR>
-<P>
-<BR> <TT>       </TT>2527 records output to segy file 20040722_154429.s7k.segy<BR>
-<BR>
-
-<P>
-Users may process multiple Reson 7k files by inputting a datalist, or list of
-swath data files. All of the extracted data records can be output to a single
-file by specifying the output file with the <B>-O</B> option. For example, if
-one has a datalist file called datalistp.mb-1 that references three Reson 7k files:
-<BR> <TT>       </TT>20050418_150155p.mb88 88<BR>
-<BR> <TT>       </TT>20050418_151812p.mb88 88<BR>
-<BR>
-
-and one wants all the low frequency sidescan data collated into a single
-Jstar data file called 20050418_sslow.mb132, then use the following command:
-<BR> <TT>       </TT>mb7k2jstar -A1 -I datalistp.mb-1 -O 20050418_sslow.mb132<BR>
-<BR>
-
-which yields the following output:
-<BR> <TT>       </TT>Data records to extract:<BR>
-<BR> <TT>       </TT>     Low Sidescan<BR>
-<P>
-<BR> <TT>       </TT>Data records read from: 20050418_150155p.mb88<BR>
-<BR> <TT>       </TT>     Survey:        990<BR>
-<BR> <TT>       </TT>     File Header:   2<BR>
-<BR> <TT>       </TT>     Bluefin CTD:   989<BR>
-<BR> <TT>       </TT>     Bluefin Nav:   760<BR>
-<BR> <TT>       </TT>     Subbottom:     989<BR>
-<BR> <TT>       </TT>     Low Sidescan:  990<BR>
-<BR> <TT>       </TT>     High Sidescan: 989<BR>
-<BR> <TT>       </TT>Data records written to: 20050418_sslow.mb132<BR>
-<BR> <TT>       </TT>     Subbottom:     0<BR>
-<BR> <TT>       </TT>     Low Sidescan:  990<BR>
-<BR> <TT>       </TT>     High Sidescan: 0<BR>
-<P>
-<BR> <TT>       </TT>Data records read from: 20050418_151812p.mb88<BR>
-<BR> <TT>       </TT>     Survey:        741<BR>
-<BR> <TT>       </TT>     File Header:   2<BR>
-<BR> <TT>       </TT>     Bluefin CTD:   741<BR>
-<BR> <TT>       </TT>     Bluefin Nav:   563<BR>
-<BR> <TT>       </TT>     Subbottom:     741<BR>
-<BR> <TT>       </TT>     Low Sidescan:  742<BR>
-<BR> <TT>       </TT>     High Sidescan: 741<BR>
-<BR> <TT>       </TT>Data records written to: 20050418_sslow.mb132<BR>
-<BR> <TT>       </TT>     Subbottom:     0<BR>
-<BR> <TT>       </TT>     Low Sidescan:  742<BR>
-<BR> <TT>       </TT>     High Sidescan: 0<BR>
-<P>
-<BR> <TT>       </TT>Total data records read from: 20050418_151812p.mb88<BR>
-<BR> <TT>       </TT>     Survey:        1731<BR>
-<BR> <TT>       </TT>     File Header:   4<BR>
-<BR> <TT>       </TT>     Bluefin CTD:   1730<BR>
-<BR> <TT>       </TT>     Bluefin Nav:   1323<BR>
-<BR> <TT>       </TT>     Subbottom:     1730<BR>
-<BR> <TT>       </TT>     Low Sidescan:  1732<BR>
-<BR> <TT>       </TT>     High Sidescan: 1730<BR>
-<BR> <TT>       </TT>Total data records written to: 20050418_sslow.mb132<BR>
-<BR> <TT>       </TT>     Subbottom:     0<BR>
-<BR> <TT>       </TT>     Low Sidescan:  1732<BR>
-<BR> <TT>       </TT>     High Sidescan: 0<BR>
-<P>
-<A NAME="lbAI"> </A>
-<H2>SEE ALSO</H2>
-
-<B><A HREF="mbsystem.html">mbsystem</A></B>(1), <B><A HREF="mbformat.html">mbformat</A></B>(1), <B><A HREF="mbinfo.html">mbinfo</A></B>(1)
-<P>
-<A NAME="lbAJ"> </A>
-<H2>BUGS</H2>
-
-No doubt.
-<P>
-
-<HR>
-<A NAME="index"> </A><H2>Index</H2>
-<DL>
-<DT><A HREF="#lbAB">NAME</A><DD>
-<DT><A HREF="#lbAC">VERSION</A><DD>
-<DT><A HREF="#lbAD">SYNOPSIS</A><DD>
-<DT><A HREF="#lbAE">DESCRIPTION</A><DD>
-<DT><A HREF="#lbAF">AUTHORSHIP</A><DD>
-<DT><A HREF="#lbAG">OPTIONS</A><DD>
-<DT><A HREF="#lbAH">EXAMPLES</A><DD>
-<DT><A HREF="#lbAI">SEE ALSO</A><DD>
-<DT><A HREF="#lbAJ">BUGS</A><DD>
-</DL>
-<HR>
-</PRE>
-
-<CENTER><P><BR>
-Last Updated: 3 June 2013</P></CENTER>
-
-<HR>
-<P><A HREF="mbsystem_man_list.html">Return to list of MB-System manual pages...</A></P>
-<P><A HREF="mbsystem_home.html"><IMG SRC="mbsystem_logo_small.gif" BORDER=0 HEIGHT=55 WIDTH=158 ALIGN=BOTTOM></A><A HREF="mbsystem_home.html">Back
-to MB-System Home Page...</A></P>
-
-</BODY>
-</HTML>
diff --git a/src/html/mb7k2ss.html b/src/html/mb7k2ss.html
deleted file mode 100644
index b2a7a7b..0000000
--- a/src/html/mb7k2ss.html
+++ /dev/null
@@ -1,452 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<HTML VERSION="2.0">
-<HEAD>
-   <TITLE>MB-System Unix Manual Page: mb7k2ss</TITLE>
-<!-- WEBMAGIC VERSION NUMBER="2.0.2" -->
-<!-- WEBMAGIC TRANSLATION NAME="ServerRoot" SRC="/var/www/htdocs/" DST="/" -->
-<!-- WEBMAGIC TRANSLATION NAME="ProjectRoot" SRC="./" DST="" -->
-</HEAD>
-<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#336699" VLINK="#997040" ALINK="#CC9900">
-<BODY>
-<CENTER><H3><U>MB-System Unix Manual Page</U></H3></CENTER>
-<PRE>
-<H1>mb7k2ss</H1>
-Section:  MB-System 5.0  (1)<BR>Updated:  3 June 2013 <BR><A HREF="#index">Index</A>
-<HR>
-
-<A NAME="lbAB"> </A>
-<H2>NAME</H2>
-
-<B>mb7k2ss</B> - extracts sidescan sonar
-data from Reson 7k format data, bins and lays the sidescan
-onto the seafloor, and outputs files in the MBF_MBLDEOIH
-formst (MBIO format id 71).
-<P>
-<A NAME="lbAC"> </A>
-<H2>VERSION</H2>
-
-Version 5.0
-<P>
-<A NAME="lbAD"> </A>
-<H2>SYNOPSIS</H2>
-
-<B>mb7k2ss</B> [<B>-A</B><I>type</I>
-<B>-B</B><I>bottompickmode/bottompickthreshold</I> <B>-C</B> <B>-D</B><I>interpbins</I>
-<B>-F</B><I>format</I> <B>-I</B><I>file</I> <B>-L</B><I>startline/lineroot</I>
-<B>-M -O</B><I>outfile</I> <B>-Q</B><I>routetimefile</I> <B>-R</B><I>routefile</I>
-<B>-T</B><I>topogridfile</I> <B>-U</B><I>rangethreshold</I> <B>-X -H -V</B>]
-<P>
-<A NAME="lbAE"> </A>
-<H2>DESCRIPTION</H2>
-
-<B>mb7k2ss</B> is a utility that extracts Edgetech sidescan data from
-Reson 7k format (MBIO format 88) data and outputs in the MBF_MBLDEOIH
-format (MBIO format 71). Edgetech sonar systems may include dual
-frequency sidescans and a subbottom profiler. Users may use the <B>-A</B>
-option to specify whether low frequency or high frequency sidescan data
-are extracted. By default, low frequency sidescan is extracted.
-<B>MB7k2ss</B> can operate on a single input file or on a datalist
-referencing many input files.
-<P>
-The raw sidescan consists of port and starboard channels, each with
-thousands of samples ordered uniformly in time from the sonar ping.
-<B>MB7k2ss</B> outputs a lower resolution single sidescan swath laid
-out onto the seafloor and ordered in pixels with uniform spacing in
-acrosstrack distance. Typically the output swath will have 4001
-sidescan pixels, each representing an average of several raw samples.
-To achieve this result, the program calculates the location
-of each raw sample, and bins the samples into the output swath.
-By default, the program uses the sonar altitude and a flat bottom
-assumption to calculate the sample positions. If a topography grid
-covering the survey area is input using the <B>-T</B> option, then
-the sample positions will be calculated using that topography and
-the resulting sidescan will be properly located on the seafloor
-(that is, if the topography is accurate...).
-<P>
-The method used to determine the sonar altitude is controlled using the
-<B>-B</B> option. By default, the program will use the altitude value
-recorded in the vehicle navigation records. Users may also specify use
-of nadir bathymetry from co-recorded multibeam bathymetry, or the
-altitude can be picked from the first arrival observed in the sidescan
-data itself.
-<P>
-The extracted sidescan data file(s) can be organized three ways.By
-default there will be a separate output file for every input file.
-If the <B>-O</B> option is used to specify a single output file, then
-all of the specified sidescan data will be output to that file. If
-the <B>-Q</B> or <B>-R</B> option is used to specify a survey route file
-that includes the waypoints covered while collecting the data file(s)
-referenced by <B>-I</B><I>file</I>, then the output sidescan data will
-be broken up by the sequential lines defined by the waypoints. The
-<B>-R</B> option requires a route file of the form exported by <B>MBgrdviz</B>.
-The <B>-Q</B> option requires a route file that includes the time
-at which each waypoint is reached in the data; this can be generated
-from a regular route file using <B>mbroutetime</B>. In either of these
-cases each output file will be named using the  line root name
-specified by <B>-L</B><I>startline/lineroot</I> with a sequential line
-number starting from <I>startline</I>. All output files will have a
-".mb71" suffix.
-<P>
-The program <B>mbextractsegy</B> is available to extract subbottom profiler
-data from Reson 7k data.
-<P>
-<A NAME="lbAF"> </A>
-<H2>AUTHORSHIP</H2>
-
-David W. Caress (<A HREF="mailto:caress at mbari.org">caress at mbari.org</A>)
-<BR>
-
-<BR>  Monterey Bay Aquarium Research Institute
-<BR>
-
-Dale N. Chayes (<A HREF="mailto:dale at ldeo.columbia.edu">dale at ldeo.columbia.edu</A>)
-<BR>
-
-<BR>  Lamont-Doherty Earth Observatory
-<P>
-<A NAME="lbAG"> </A>
-<H2>OPTIONS</H2>
-
-<DL COMPACT>
-<DT><B>-A</B>
-
-<DD>
-<I>mode</I>
-<BR>
-
-This option sets the types of data to be extracted and output.
-If <B>-A</B><I>1</I> is given, then any low frequency sidescan
-in the input will be extracted to the output. If <B>-A</B><I>2</I>
-is given, then any high frequency sidescan records are extracted.
-Default: Low frequency sidescan records are extracted.
-<DT><B>-B</B>
-
-<DD>
-<I>bottompickmode/bottompickthreshold</I>
-<BR>
-
-This option sets the source of the sonar first arrival time used for
-laying out sidescan on the seafloor. If <I>bottompickmode</I> = 1,
-then <B>mb7k2ss</B> will use the altitude value associated with
-platform navigation. If <I>bottompickmode</I> = 2, then <B>mb7k2ss</B>
-will extract the first arrival time from multibeam bathymetry in the
-7k data stream. If <I>bottompickmode</I> = 3, then <B>mb7k2ss</B>
-will pick the first arrival time in the sidescan sonar data by looking
-for the first sample with an amplitude > <I>bottompickthreshold</I> times the
-maximum amplitude in the trace. The altitude used will be the average of
-the first arrival times calculated for the port and starboard channels.
-Default: fIbottompickmode = 1.
-<DT><B>-C</B>
-
-<DD>
-<BR>
-
-This option causes  <B>mb7k2ss</B> to print out any comment records
-encountered in the input Reson 7k data.
-<DT><B>-D</B>
-
-<DD>
-<I>interpbins</I>
-<BR>
-
-Causes interpolation over gaps in the output sidescan resulting from draping
-the sidescan on topography. The <I>interpbins</I> values sets the maximum
-gap size over which interpolation will be applied.
-<DT><B>-F</B>
-
-<DD>
-<I>format</I>
-<BR>
-
-Sets the data format used if the input is read from stdin
-or from a file. If <I>format</I> < 0, then the input file specified
-with the <B>-I</B> option will actually contain a list of input swath sonar
-data files. This program only reads Reson 7k format data files (<B>MBIO</B>
-format 88).
-<DT><B>-H</B>
-
-<DD>
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-<DT><B>-I</B>
-
-<DD>
-<I>infile</I>
-<BR>
-
-Sets the input file path. If <I>format</I> > 0 (set with the
-<B>-f</B> option or <B>mbdefaults</B>) then the swath sonar data contained in <I>infile</I>
-is read and processed. If <I>format</I> < 0, then <I>infile</I>
-is assumed to be an ascii file containing a list of the input swath sonar
-data files to be processed and their formats.  The program will read
-the data in each one of these files.
-In the <I>infile</I> file, each
-data file should be followed by a data format identifier, e.g.:
-<BR> <TT>       </TT>datafile1 88<BR>
-<BR> <TT>       </TT>datafile2 88<BR>
-<BR>
-
-This program only reads Reson 7k format data files (<B>MBIO</B>
-format 88).
-<DT><B>-L</B>
-
-<DD>
-<I>startline/lineroot</I>
-<BR>
-
-This option sets the starting line number and the output filename root
-used when <B>-R</B> is specified so that data are output according
-to planned survey lines. Default: <I>startline</I> = 1; <I>lineroot</I> = "jstar".
-<DT><B>-M</B>
-
-<DD>
-<BR>
-
-This option causes <B>mb7k2ss</B> to omit data during turns when
-extracting into line files according to a specified set of waypoints
-(<B>-R</B> option). The traces will not be output until the heading is
-within 15 degrees of the next survey line's bearing.
-<DT><B>-O</B>
-
-<DD>
-<BR>
-
-This option sets the output MBF_LDEOIH (<B>MBIO</B> format 71) format file path.
-If <B>-O</B> is not invoked, the output filename (or filenames if a datalist
-is being processed) will be the input swath filename with the ".s7k" or ".mb88"
-suffix replaced by a ".mb71) suffix. The record types to be extracted are set
-using the <B>-A</B> option.
-<DT><B>-Q</B>
-
-<DD>
-<I>routetimefile</I>
-<BR>
-
-This option specifies a file containing the times that the survey reached
-the intended waypoints. This text file consists of lines of the form:
-<BR> <TT>       </TT>count waypoint longitude latitude heading time_d<BR>
-<BR>
-
-where count is just an integer counter starting at 0, waypoint is the waypoint
-number starting at 0, longitude and latitude are the waypoint position in
-decimal degrees, heading is the heading in decimal degrees, and time_d is
-the unix or epoch time (time since 00:00:00 January 1, 1970) in decimal
-seconds that the survey reached this waypoint. This file can be generated from
-an <B>mbgrdviz</B> route file and survey data using the program <B>mbroutetime</B>.
-If <I>routetimefile</I> is specified, <B>mb7k2ss</B>
-will output data in files corresponding to the planned survey lines.
-The output file names will be based on <I>lineroot</I> and will include
-the line number starting with <I>starline</I>, both of which are specified
-using the <B>-L</B> options.  If none of <B>-O</B>, <B>-Q</B>, or <B>-R</B> are
-invoked, the output filename (or files if a datalist is being processed) will
-be the input swath filename with an ".mb71" suffix appended.
-<DT><B>-R</B>
-
-<DD>
-<I>routefile</I>
-<BR>
-
-This option specifies an <B>mbgrdviz</B> route file containing the intended
-waypoints of the survey. If <I>routefile</I> is specified, <B>mb7k2ss</B>
-will output sidescan data in files corresponding to the planned survey lines.
-The output file names will be based on <I>lineroot</I> and will include
-the line number starting with <I>starline</I>, both of which are specified
-using the <B>-L</B> options.  If none of <B>-O</B>, <B>-Q</B>, or <B>-R</B> are
-invoked, the output filename (or files if a datalist is being processed) will
-be the input swath filename with an ".mb71" suffix appended.
-<DT><B>-T</B>
-
-<DD>
-<I>topogridfile</I>
-<BR>
-
-This option specifies a GMT grid file containing a topography model of the
-survey area. When available, <B>mb7k2ss</B>, uses the topography to calculate
-the position of each raw sidescan sample on the seafloor prior to binning
-the sample into the swath data. This method is considerable improvement over the
-flat bottom assumption used when topography is unavailable. The grid file
-must contain topography (positive up) rather than bathymetry (positive down).
-<DT><B>-U</B>
-
-<DD>
-<I>rangethreshold</I>
-<BR>
-
-If the <B>-R</B> option is specified, <B>mb7k2ss</B> breaks up the
-output into files corresponding to survey lines specified in a route file.
-This option sets the threshold distance in meters used to determine when
-a waypoint along the route has been reached; the program considers the
-next waypoint reached when the range to the waypoint becomes smaller
-than <I>rangethreshold</I> and then ceases to decrease.
-Default: <I>rangethreshold</I> = 50 m.
-<DT><B>-V</B>
-
-<DD>
-This option increases the verbosity of <B>mb7k2ss</B>, causing it
-to print out messages regarding its progress to stdout.
-<DT><B>-W</B>
-
-<DD>
-<I>swathwidth</I>
-This option sets the output sidescan swath width in meters. By default
-<B>mb7k2ss</B> calculates the swath width to use all of the samples available
-in the original data.
-<DT><B>-X</B>
-
-<DD>
-This option switches port and starboard sidescan channels.
-<P>
-</DL>
-<A NAME="lbAH"> </A>
-<H2>EXAMPLES</H2>
-
-Suppose that we have collected two Reson 7k datafiles incorporating
-multibeam sonar data, sidescan data, and subbottom profiler data, and
-that the filenames are:
-<BR>        20070809_173212.s7k
-<BR>        20070809_175133.s7k
-After running <B>mb7kpreprocess</B> on these files to fix issues and
-prepare the data for processing, we will have two additional files named:
-<BR>        20070809_173212.mb88
-<BR>        20070809_175133.mb88
-After editing the bathymetry in the ".mb88" files with <B>mbedit</B>,
-and running <B>mbprocess</B> to apply the edits, we will have two processed
-files that are, among other uses, suitable for sidescan extraction:
-<BR>        20070809_173212p.mb88
-<BR>        20070809_175133p.mb88
-If we have two datalist files, one called datalist.mb-1 referencing the ".mb88"
-files with the following contents:
-<BR>        20070809_173212p.mb88 88
-<BR>        20070809_175133p.mb88 88
-and another called datalistp.mb-1 referencing the first datalist with a
-$PROCESSED tag:
-<BR>        $PROCESSED
-<BR>        datalist.mb-1 -1
-then we can extract the Edgetech sidescan from the processed files using:
-<BR>        mb7k2ss -v -A1 -B2 -I datalistp.mb-1 \
-<BR>        <TT>        </TT>-M -X -R MAUV_Axial_1v4.rte -L1/Axial07SS \<BR>
-<BR>        <TT>        </TT>-T AxialCalderaMBARIAllTopo.grd<BR>
-Here the <B>-R</B> option specifies an <B>MBgrdviz</B> route file that was
-followed in collecting the data. By using this option, the output sidescan
-files will be broken into lines defined by the route waypoints, and the
-output filenames will be sequentially numbered. The <B>-T</B> option specifies a
-topography grid that is used by <B>mb7k2ss</B> to lay out the sidescan on
-the seafloor. The output appears as follows:
-<BR>        Program mb7k2ss
-<BR> <TT>       </TT>Version $Id: mb7k2ss.1 2096 2013-06-04 08:17:22Z caress $<BR>
-<BR> <TT>       </TT>MB-system Version 5.1.1beta5<BR>
-<P>
-<BR> <TT>       </TT>Data records to extract:<BR>
-<BR> <TT>       </TT>     Low Sidescan<BR>
-<BR> <TT>       </TT>     Sidescan port and starboard exchanged<BR>
-<P>
-<BR> <TT>       </TT>Imported 45 waypoints from route file: MAUV_Axial_1v4.rte<BR>
-<BR> <TT>       </TT>Grid read:<BR>
-<BR> <TT>       </TT>  Dimensions: 2072 3558<BR>
-<BR> <TT>       </TT>  Geographic Coordinate System Name: Geographic WGS84<BR>
-<BR> <TT>       </TT>  Geographic Coordinate System ID:   4326<BR>
-<BR> <TT>       </TT>  Longitude:  229.926767 230.060367  0.000065<BR>
-<BR> <TT>       </TT>  Latitude:   45.866667 46.026700  0.000045<BR>
-<BR> <TT>       </TT>  Internal Grid Projection Mode:         0<BR>
-<BR> <TT>       </TT>  Internal Grid Projection ID:           epsg4326<BR>
-<BR> <TT>       </TT>Data Read:<BR>
-<BR> <TT>       </TT>  grid_projection_mode:     0<BR>
-<BR> <TT>       </TT>  grid_projection_id:       epsg4326<BR>
-<BR> <TT>       </TT>  nodatavalue:              -10000000.000000<BR>
-<BR> <TT>       </TT>  nx:                       2072<BR>
-<BR> <TT>       </TT>  ny:                       3558<BR>
-<BR> <TT>       </TT>  min:                      -2302.588135<BR>
-<BR> <TT>       </TT>  max:                      -1382.877319<BR>
-<BR> <TT>       </TT>  xmin:                     229.926767<BR>
-<BR> <TT>       </TT>  xmax:                     230.060367<BR>
-<BR> <TT>       </TT>  ymin:                     45.866667<BR>
-<BR> <TT>       </TT>  ymax:                     46.026700<BR>
-<BR> <TT>       </TT>  dx:                       0.000065<BR>
-<BR> <TT>       </TT>  dy:                       0.000045<BR>
-<BR> <TT>       </TT>  data:                     71467008<BR>
-<P>
-<BR> <TT>       </TT>Data records read from: 20070809_173212p.mb88<BR>
-<BR> <TT>       </TT>     Survey:        2330<BR>
-<BR> <TT>       </TT>     File Header:   2<BR>
-<BR> <TT>       </TT>     Bluefin CTD:   1152<BR>
-<BR> <TT>       </TT>     Bluefin Nav:   942<BR>
-<BR> <TT>       </TT>     Subbottom:     0<BR>
-<BR> <TT>       </TT>     Low Sidescan:  2328<BR>
-<BR> <TT>       </TT>     High Sidescan: 0<BR>
-<P>
-<BR> <TT>       </TT>Generating inf file for Axial07SS_0001_sslo.mb71<BR>
-<BR> <TT>       </TT>Generating fnv file for Axial07SS_0001_sslo.mb71<BR>
-<P>
-<BR> <TT>       </TT>Data records written to: Axial07SS_0001_sslo.mb71<BR>
-<BR> <TT>       </TT>     Low Sidescan:  2759<BR>
-<BR> <TT>       </TT>     High Sidescan: 0<BR>
-<P>
-<BR> <TT>       </TT>Generating inf file for Axial07SS_0002_sslo.mb71<BR>
-<BR> <TT>       </TT>Generating fnv file for Axial07SS_0002_sslo.mb71<BR>
-<P>
-<BR> <TT>       </TT>Data records written to: Axial07SS_0002_sslo.mb71<BR>
-<BR> <TT>       </TT>     Low Sidescan:  369<BR>
-<BR> <TT>       </TT>     High Sidescan: 0<BR>
-<P>
-<BR> <TT>       </TT>Data records read from: 20070809_175133p.mb88<BR>
-<BR> <TT>       </TT>     Survey:        2367<BR>
-<BR> <TT>       </TT>     File Header:   2<BR>
-<BR> <TT>       </TT>     Bluefin CTD:   1158<BR>
-<BR> <TT>       </TT>     Bluefin Nav:   942<BR>
-<BR> <TT>       </TT>     Subbottom:     0<BR>
-<BR> <TT>       </TT>     Low Sidescan:  2367<BR>
-<BR> <TT>       </TT>     High Sidescan: 0<BR>
-<P>
-<BR> <TT>       </TT>Generating inf file for Axial07SS_0003_sslo.mb71<BR>
-<BR> <TT>       </TT>Generating fnv file for Axial07SS_0003_sslo.mb71<BR>
-<P>
-<BR> <TT>       </TT>Total data records read:<BR>
-<BR> <TT>       </TT>     Survey:        4697<BR>
-<BR> <TT>       </TT>     File Header:   4<BR>
-<BR> <TT>       </TT>     Bluefin CTD:   2310<BR>
-<BR> <TT>       </TT>     Bluefin Nav:   1884<BR>
-<BR> <TT>       </TT>     Subbottom:     0<BR>
-<BR> <TT>       </TT>     Low Sidescan:  4695<BR>
-<BR> <TT>       </TT>     High Sidescan: 0<BR>
-<BR> <TT>       </TT> Total data records written:<BR>
-<BR> <TT>       </TT>      Low Sidescan:  4160<BR>
-<BR> <TT>       </TT>      High Sidescan: 0<BR>
-<P>
-<A NAME="lbAI"> </A>
-<H2>SEE ALSO</H2>
-
-<B><A HREF="mbsystem.html">mbsystem</A></B>(1), <B><A HREF="mbformat.html">mbformat</A></B>(1), <B><A HREF="mbinfo.html">mbinfo</A></B>(1), <B><A HREF="mb7kpreprocess.html">mb7kpreprocess</A></B>(1),
-<B><A HREF="mb7k2jstar.html">mb7k2jstar</A></B>(1), <B><A HREF="mbextractsegy.html">mbextractsegy</A></B>(1), <B><A HREF="mbbackangle.html">mbbackangle</A></B>(1), <B><A HREF="mbprocess.html">mbprocess</A></B>(1)
-<P>
-<A NAME="lbAJ"> </A>
-<H2>BUGS</H2>
-
-No doubt.
-<P>
-
-<HR>
-<A NAME="index"> </A><H2>Index</H2>
-<DL>
-<DT><A HREF="#lbAB">NAME</A><DD>
-<DT><A HREF="#lbAC">VERSION</A><DD>
-<DT><A HREF="#lbAD">SYNOPSIS</A><DD>
-<DT><A HREF="#lbAE">DESCRIPTION</A><DD>
-<DT><A HREF="#lbAF">AUTHORSHIP</A><DD>
-<DT><A HREF="#lbAG">OPTIONS</A><DD>
-<DT><A HREF="#lbAH">EXAMPLES</A><DD>
-<DT><A HREF="#lbAI">SEE ALSO</A><DD>
-<DT><A HREF="#lbAJ">BUGS</A><DD>
-</DL>
-<HR>
-</PRE>
-
-<CENTER><P><BR>
-Last Updated: 3 June 2013</P></CENTER>
-
-<HR>
-<P><A HREF="mbsystem_man_list.html">Return to list of MB-System manual pages...</A></P>
-<P><A HREF="mbsystem_home.html"><IMG SRC="mbsystem_logo_small.gif" BORDER=0 HEIGHT=55 WIDTH=158 ALIGN=BOTTOM></A><A HREF="mbsystem_home.html">Back
-to MB-System Home Page...</A></P>
-
-</BODY>
-</HTML>
diff --git a/src/html/mb7kpreprocess.html b/src/html/mb7kpreprocess.html
deleted file mode 100644
index a2c0052..0000000
--- a/src/html/mb7kpreprocess.html
+++ /dev/null
@@ -1,346 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<HTML VERSION="2.0">
-<HEAD>
-   <TITLE>MB-System Unix Manual Page: mb7kpreprocess</TITLE>
-<!-- WEBMAGIC VERSION NUMBER="2.0.2" -->
-<!-- WEBMAGIC TRANSLATION NAME="ServerRoot" SRC="/var/www/htdocs/" DST="/" -->
-<!-- WEBMAGIC TRANSLATION NAME="ProjectRoot" SRC="./" DST="" -->
-</HEAD>
-<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#336699" VLINK="#997040" ALINK="#CC9900">
-<BODY>
-<CENTER><H3><U>MB-System Unix Manual Page</U></H3></CENTER>
-<PRE>
-<H1>mb7kpreprocess</H1>
-Section:  MB-System 5.0  (1)<BR>Updated:  12 November 2014 <BR><A HREF="#index">Index</A>
-<HR>
-
-<A NAME="lbAB"> </A>
-<H2>NAME</H2>
-
-<B>mb7kpreprocess</B> - performs preprocessing of Reson 7k multibeam data
-in the 7k format (<B>MBIO</B> format 88).
-<P>
-<A NAME="lbAC"> </A>
-<H2>VERSION</H2>
-
-Version 5.0
-<P>
-<A NAME="lbAD"> </A>
-<H2>SYNOPSIS</H2>
-
-<B>mb7kpreprocess</B> [<B>-A</B> <B>-B</B> <B>-C</B><I>rollbias/pitchbias</I>
-<B>-D</B><I>offx/offy[/offdepth]</I> <B>-F</B><I>format</I>
-<B>-I</B><I>file </I><B>-K</B><I>klugemode</I> <B>-L</B> <B>-M</B><I>rockfile</I> <B>-N</B><I>insfile</I> <B>-O</B><I>outfile</I>
-<B>-P</B><I>sonardepthfile</I> <B>-PF</B><I>filterlength/filterdepth</I>
-<B>-T</B><I>timelag</I> <B>-W</B><I>dslfile</I> <B>-H -V</B>]
-<P>
-<A NAME="lbAE"> </A>
-<H2>DESCRIPTION</H2>
-
-<B>mb7kpreprocess</B> reads a Reson 7k (format 88) file, interpolates the
-asynchronous navigation and attitude onto the multibeam data,
-and writes a new 7k file with that information correctly embedded
-in the multibeam data. This program can also fix various problems
-with 7k data (early generations of the 6046 datalogger failed to
-to meet the data format specification exactly).
-<P>
-<A NAME="lbAF"> </A>
-<H2>AUTHORSHIP</H2>
-
-David W. Caress (<A HREF="mailto:caress at mbari.org">caress at mbari.org</A>)
-<BR>
-
-<BR>  Monterey Bay Aquarium Research Institute
-<BR>
-
-Dale N. Chayes (<A HREF="mailto:dale at ldeo.columbia.edu">dale at ldeo.columbia.edu</A>)
-<BR>
-
-<BR>  Lamont-Doherty Earth Observatory
-<P>
-<A NAME="lbAG"> </A>
-<H2>OPTIONS</H2>
-
-<DL COMPACT>
-<DT><B>-A</B>
-
-<DD>
-<BR>
-
-This option causes the program to output multibeam records occuring before the first
-available navigation and attitude data. Normally, these records are ignored.
-<DT><B>-B</B>
-
-<DD>
-<I>mode</I>
-<BR>
-
-This option is only relevant to MBARI Mapping AUV data that includes Edgetech sidescan
-and subbottom profiler data with multibeam data in a Reson 7k format file, and where the
-sonars are all synchronized to ping simulataneously. If <B>-B</B> is specified with
-<I>mode</I>=1, then the multibeam time stamps will be reset to the time stamp values of
-the Edgetech data records. If <B>-B</B> is given with <I>mode</I>=2, then the Edgetech
-data time stamps will be reset to the values of the multibeam data records. Although the
-sonar computer clocks are supposed to be synchronized, this clock discipline sometimes fails.
-<DT><B>-C</B>
-
-<DD>
-<I>rollbias/pitchbias</I>
-<BR>
-
-This option sets the roll and pitch bias of the sonar with respect to the attitude sensor
-in degrees. If specified, these parameters are applied to the sonar attitude data prior to
-the calculation of bathymetry from travel times and angles.
-<DT><B>-D</B>
-
-<DD>
-<I>offx/offz[/offdepth]</I>
-<BR>
-
-This option sets horizontal and vertical.distance offsets between the vehicle's
-depth sensor and the multibeam receive head. If specified, these values are used
-in a lever-arm calculation to determine the sonar depth change  associated with
-vehicle pitch. The <I>offdepth</I> value, if specified, is a static depth offset to be
-applied to the vehicle depth data.
-<DT><B>-F</B>
-
-<DD>
-<I>format</I>
-<BR>
-
-Sets the data format used if the input is read from stdin
-or from a file. If <I>format</I> < 0, then the input file specified
-with the <B>-I</B> option will actually contain a list of input swath sonar
-data files. This program only reads Reson 7k format data files (<B>MBIO</B>
-format 88).
-<DT><B>-H</B>
-
-<DD>
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-<DT><B>-I</B>
-
-<DD>
-<I>infile</I>
-<BR>
-
-Sets the input file path. If <I>format</I> > 0 (set with the
-<B>-f</B> option or <B>mbdefaults</B>) then the swath sonar data contained in <I>infile</I>
-is read and processed. If <I>format</I> < 0, then <I>infile</I>
-is assumed to be an ascii file containing a list of the input swath sonar
-data files to be processed and their formats.  The program will read
-the data in each one of these files.
-In the <I>infile</I> file, each
-data file should be followed by a data format identifier, e.g.:
-<BR> <TT>       </TT>datafile1 88<BR>
-<BR> <TT>       </TT>datafile2 88<BR>
-<BR>
-
-This program only reads Reson 7k format data files (<B>MBIO</B>
-format 88).
-<DT><B>-K</B>
-
-<DD>
-<I>klugemode</I>
-<BR>
-
-This option causes the program to implement one of the available
-processing "kluge" fixes. This are unusual steps required to fix
-data with particular, unusual problems. Kluge 1 forces <B>mb7kpreprocess</B>
-to replace the sonar depth value with values from vertical
-depth data records. Kuge 2 forces <B>mb7kpreprocess</B> to zero the initial
-beam alongtrack distance values.
-<DT><B>-L</B>
-
-<DD>
-<BR>
-
-This option causes the program to list the timetags of bathymetry,
-sidescan, subbottom, navigation, and attitude data records.
-<DT><B>-M</B>
-
-<DD>
-<I>rockfile</I>
-<BR>
-
-The program will read navigation and attitude from the Steve Rock navigation
-and attitude file <I>rockfile</I> and merge those data with the multibeam, sidescan,
-and subbtottom data in the 7k file.If a timelag model is specified using
-<B>-T</B><I>timelag</I>, the time lag will be applied to the navigation and
-attitude data before merging with the sonar data. The navigation and attitude
-data from <I>rockfile</I> will also be embedded in asynchronous data records
-in the output 7k format data. Any pre-existing navigation data records will
-be replaced. The similar <B>-N</B><I>insfile</I> and <B>-W</B><I>dslfile</I> options
-cause merging of data from MBARI AUV logfiles and WHOI DSL navigation files,
-respectively. The Steve Rock navigation and attitude file is a text file with
-seven space delimited columns:
-<BR> <TT>       </TT>time_d longitude latitude sonardepth heading roll pitch<BR>
-<BR>
-
-where time_d is decimal seconds since the start of 1970, longitude, latitude,
-heading, roll, and pitch are in decimal degrees, and sonardepth is in meters.
-<DT><B>-N</B>
-
-<DD>
-<I>insfile</I>
-<BR>
-
-The program will read navigation and attitude from the MBARI AUV navigation
-log file <I>insfile</I> and merge those data with the multibeam, sidescan,
-and subbtottom data in the 7k file. If a timelag model is specified using
-<B>-T</B><I>timelag</I>, the time lag will be applied to the navigation and
-attitude data before merging with the sonar data. The navigation and attitude
-data from <I>insfile</I> will also be embedded in asynchronous data records
-in the output 7k format data. Any pre-existing navigation data records will
-be replaced. MBARI AUV navigation files are binary and specific to MBARI.
-<DT><B>-O</B>
-
-<DD>
-<I>outfile</I>
-<BR>
-
-This option causes <B>mb7kpreprocess</B> to output all data to a single file
-specified as <I>outfile</I>. By default, the program creates output files for
-each input file.
-<DT><B>-P</B>
-
-<DD>
-<I>sonardepthfile</I>
-<BR>
-
-The program will read sonar depth data from <I>sonardepthfile</I> and merge
-those data with the multibeam, sidescan, and subbtottom data in the 7k file.
-The <I>sonardepthfile</I> is a text data file containing two space delimited columns:
-<BR> <TT>       </TT>time_d sonardepth<BR>
-<BR>
-
-where:
-<BR> <TT>       </TT>time_d - decimal epoch seconds (since start of 1970)<BR>
-<BR> <TT>       </TT>sonardepth - sonar depth in meters, positive down<BR>
-<DT><B>-PF</B>
-
-<DD>
-<B>-PF</B><I>filterlength/filterdepth</I>
-This option specifies Gaussian tapered time domain filtering of the
-sonar depth data to be merged with the survey data, regardless of source.
-The <I>filterlength</I> value specifies
-the filter window length in seconds, and the <I>filterdepth</I> value controls
-the depths to which filtering is applied. The filtered sonar depth is used
-to depths up to twice the <I>filterdepth</I> value. Below that threshold, the
-value used transitions to unfiltered with an exponential taper. This filtering
-is used in two ways. First, one can apply short period smoothing of noisy
-sonar depth at all by specifying a small <I>filterlength</I> (e.g. 2 seconds)
-and a <I>filterdepth</I> value deeper than the vehicle's track. Second, when
-an AUV or ROV is operated at shallow depths, the pressure
-values used to determine depth are affected by waves at the sea surface. In this
-case, a longer period <I>filterlength</I> (e.g. 10 seconds) and a shallower
-<I>filterdepth</I> (e.g. 50 meters) may be used to lessen the artifacts due to
-surface swell.
-<DT><B>-S</B>
-
-<DD>
-<I>sidescansource</I>
-<BR>
-
-This option specifies the data record type source of the backscatter data
-used to generate pseudo-sidescan data from Reson multibeam sonars. If
-<I>sidescansource</I> = 'C' then the sidescan will be derived from calibrated
-"snippet" records, if the <I>sidescansource</I> = 'S' then the sidescan will be derived from "snippet" records. If <I>sidescansource</I> = 'B' then the sidescan will be derived from "backscatter"
-records. The difference is that the "backscatter" records contain port and
-starboard time series derived from beams formed with a large acrosstrack
-beamwidth, and the "snippet" records contain short sections of beamformed
-time series centered on the bottom return times in each of the valid bathymetry
-beams.
-<DT><B>-T</B>
-
-<DD>
-<I>timelag</I>
-<BR>
-
-This option specifies a <I>timelag</I> value in seconds to be applied
-to the navigation and attitude data prior to it being merged with the
-bathymetry. If <I>timelag</I> is a valid path to a file containing time
-stamp and time lag pairs, then these data will be read and the time lag
-applied to particular records will be interpolated by time.
-<DT><B>-W</B>
-
-<DD>
-<I>dslfile</I>
-<BR>
-
-The program will read navigation and attitude from the WHOI DSL navigation
-and attitude file <I>dslfile</I> and merge those data with the multibeam, sidescan,
-and subbtottom data in the 7k file.If a timelag model is specified using
-<B>-T</B><I>timelag</I>, the time lag will be applied to the navigation and
-attitude data before merging with the sonar data. Any pre-existing navigation data
-records will be replaced. The similar <B>-N</B><I>insfile</I> and <B>-W</B><I>dslfile</I>
-options cause merging of data from MBARI AUV logfiles and WHOI DSL navigation files,
-respectively. The WHOI DSL navigation and attitude file is a text file with
-eleven space delimited columns:
-<BR> <TT>       </TT>PPL date time vehicle latitude longitude depth heading pitch roll id<BR>
-<BR>
-
-where:
-<BR> <TT>       </TT>PPL - tag indicating processed navigation and attitude<BR>
-<BR> <TT>       </TT>date - yyyy/mm/dd<BR>
-<BR> <TT>       </TT>time - hh:mm:ss.sss<BR>
-<BR> <TT>       </TT>vehicle - SEN for Sentry<BR>
-<BR> <TT>       </TT>latitude - decimal degrees<BR>
-<BR> <TT>       </TT>longitude - decimal degrees<BR>
-<BR> <TT>       </TT>depth - sonar depth in meters<BR>
-<BR> <TT>       </TT>pitch - decimal degrees<BR>
-<BR> <TT>       </TT>roll - decimal degrees<BR>
-<BR> <TT>       </TT>id - seems to be 1.00<BR>
-<P>
-</DL>
-<A NAME="lbAH"> </A>
-<H2>EXAMPLES</H2>
-
-Suppose that one has collected a Reson 7k datafile incorporating
-multibeam sonar data, sidescan data, and subbottom profiler data, and
-that the filename is:
-<BR> <TT>       </TT>20050418_150155.s7k<BR>
-<BR>
-
-<P>
-In order to preprocess the data in a 7k data file, one can use
-<B>mb7kpreprocess</B> with no special arguments:
-<BR> <TT>       </TT>mb7kpreprocess -I 20040722_152111.s7k<BR>
-<P>
-<A NAME="lbAI"> </A>
-<H2>SEE ALSO</H2>
-
-<B><A HREF="mbsystem.html">mbsystem</A></B>(1), <B><A HREF="mbformat.html">mbformat</A></B>(1), <B><A HREF="mbinfo.html">mbinfo</A></B>(1)
-<P>
-<A NAME="lbAJ"> </A>
-<H2>BUGS</H2>
-
-Oh yeah.
-<P>
-
-<HR>
-<A NAME="index"> </A><H2>Index</H2>
-<DL>
-<DT><A HREF="#lbAB">NAME</A><DD>
-<DT><A HREF="#lbAC">VERSION</A><DD>
-<DT><A HREF="#lbAD">SYNOPSIS</A><DD>
-<DT><A HREF="#lbAE">DESCRIPTION</A><DD>
-<DT><A HREF="#lbAF">AUTHORSHIP</A><DD>
-<DT><A HREF="#lbAG">OPTIONS</A><DD>
-<DT><A HREF="#lbAH">EXAMPLES</A><DD>
-<DT><A HREF="#lbAI">SEE ALSO</A><DD>
-<DT><A HREF="#lbAJ">BUGS</A><DD>
-</DL>
-<HR>
-</PRE>
-
-<CENTER><P><BR>
-Last Updated: 12 November 2014</P></CENTER>
-
-<HR>
-<P><A HREF="mbsystem_man_list.html">Return to list of MB-System manual pages...</A></P>
-<P><A HREF="mbsystem_home.html"><IMG SRC="mbsystem_logo_small.gif" BORDER=0 HEIGHT=55 WIDTH=158 ALIGN=BOTTOM></A><A HREF="mbsystem_home.html">Back
-to MB-System Home Page...</A></P>
-
-</BODY>
-</HTML>
diff --git a/src/html/mbabsorption.html b/src/html/mbabsorption.html
deleted file mode 100644
index ae40fd8..0000000
--- a/src/html/mbabsorption.html
+++ /dev/null
@@ -1,276 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<HTML VERSION="2.0">
-<HEAD>
-   <TITLE>MB-System Unix Manual Page: mbabsorption</TITLE>
-<!-- WEBMAGIC VERSION NUMBER="2.0.2" -->
-<!-- WEBMAGIC TRANSLATION NAME="ServerRoot" SRC="/var/www/htdocs/" DST="/" -->
-<!-- WEBMAGIC TRANSLATION NAME="ProjectRoot" SRC="./" DST="" -->
-</HEAD>
-<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#336699" VLINK="#997040" ALINK="#CC9900">
-<BODY>
-<CENTER><H3><U>MB-System Unix Manual Page</U></H3></CENTER>
-<PRE>
-<H1>mblevitus</H1>
-Section:  MB-System 5.0  (1)<BR>Updated:  3 June 2013 <BR><A HREF="#index">Index</A>
-<HR>
-
-<A NAME="lbAB"> </A>
-<H2>NAME</H2>
-
-<B>mbabsorption</B> - calculates the absorption of sound in sea water in dB/km
-as a function of frequency, temperature, salinity, sound speed, and depth.
-<P>
-<P>
-<A NAME="lbAC"> </A>
-<H2>VERSION</H2>
-
-Version 5.0
-<P>
-<A NAME="lbAD"> </A>
-<H2>SYNOPSIS</H2>
-
-<B>mbabsorption</B> [<B>-C</B><I>soundspeed</I> <B>-D</B><I>depth</I> 
-<B>-F</B><I>frequency</I> <B>-P</B><I>ph</I> <B>-S</B><I>salinity</I> <B>-T</B><I>temperature</I> <B>-V -H</B>]
-<P>
-<A NAME="lbAE"> </A>
-<H2>DESCRIPTION</H2>
-
-<B>mbabsorption</B> - calculates the absorption of sound in sea water in dB/km
-<BR> as a function of frequency (kHz), temperature (degrees C), salinity (per mil), 
-depth (m), pH, and water sound speed (m/sec). 
-<P>
-<BR> We use the Francois and Garrison equations from:
-<BR>    Francois, R.E., Garrison, G.R., "Sound absorption based
-<BR>      on ocean measurements: Part I: Pure water and magnesium
-<BR>      sulfate contributions", J. Acoust. Soc. Am., 72(3), 
-<BR>      896-907, 1982.
-<BR>    Francois, R.E., Garrison, G.R., "Sound absorption based
-<BR>      on ocean measurements: Part II: Boric acid contribution
-<BR>      and equation for total absorption", J. Acoust. Soc. Am., 
-<BR>      72(6), 1879-1890, 1982.
-<P>
-Francois and Garrison [1982] model the sound absorption in
-sea water as resulting from contributions from pure water,
-magnesium sulfate, and boric acid. The boric acid contribution
-is significant below 10 kHz. The equations are:
-<P>
-<BR> <TT>       </TT>absorption = Boric Acid Contribution<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT>+ MbSO4 Contribution<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT>+ Pure Water Contribution<BR>
-<BR> <TT>       </TT><BR>
-<BR>
-
-Boric Acid Contribution:
-<BR> <TT>       </TT>AlphaB = Ab * Pb * Fb * f**2<BR>
-<BR> <TT>       </TT>         -------------------<BR>
-<BR> <TT>       </TT>            f**2 + Fb**2<BR>
-<BR> <TT>       </TT>    <BR>
-<BR> <TT>       </TT>Ab = 8.86 / c * 10**(0.78 * pH - 5) (dB/km/kHz)<BR>
-<BR> <TT>       </TT>Pb = 1<BR>
-<BR> <TT>       </TT>Fb = 2.8 * (S / 35)**0.5 * 10**(4 - 1245 / Tk) (kHz)<BR>
-<BR> <TT>       </TT><TT>        </TT><BR>
-<BR>
-
-MgSO4 Contribution:
-<BR> <TT>       </TT>AlphaM = Am * Pm * Fm * f**2<BR>
-<BR> <TT>       </TT>         -------------------<BR>
-<BR> <TT>       </TT>            f**2 + Fm**2<BR>
-<TT>        </TT><TT>        </TT><BR>
-<BR> <TT>       </TT>Am = 21.44 * S * (1 + 0.025 * T) / c (dB/km/kHZ)<BR>
-<BR> <TT>       </TT>Pm = 1 - 0.000137 * D + 0.0000000062 * D**2<BR>
-<BR> <TT>       </TT>Fm = (8.17 * 10**(8 - 1990 / Tk)) / (1 + 0.0018 * (S - 35))  (kHz)<BR>
-<BR> 
-<BR>
-
-Pure Water Contribution:
-<BR> <TT>       </TT>AlphaW = Aw * Pw * f**2<BR>
-<BR>  
-<BR> <TT>       </TT>For T <= 20 deg C<BR>
-<BR> <TT>       </TT>  Aw = 0.0004397 - 0.0000259 * T<BR>
-<BR> <TT>       </TT>          + 0.000000911 * T**2 - 0.000000015 * T**3 (dB/km/kHz) <BR>
-<BR> <TT>       </TT>For T > 20 deg C<BR>
-<BR> <TT>       </TT>  Aw = 0.0003964 - 0.00001146 * T<BR>
-<BR> <TT>       </TT>          + 0.000000145 * T**2 - 0.00000000049 * T**3 (dB/km/kHz) <BR>
-<BR> <TT>       </TT>Pw = 1 - 0.0000383 * D + 0.00000000049 * D**2 <BR>
-<BR> 
-<BR>
-
-Parameters:
-<BR> <TT>       </TT>f = sound frequency (kHz)<BR>
-<BR> <TT>       </TT>c = speed of sound (m/s)<BR>
-<BR> <TT>       </TT>T = temperature (deg C)<BR>
-<BR> <TT>       </TT>Tk = temperature (deg K) = T + 273 (deg K)<BR>
-<BR> <TT>       </TT>S = salinity (per mil)<BR>
-<BR> <TT>       </TT>D = depth (m)<BR>
-<P>
-<BR>
-
-If the speed of sound is not specified by the user, it will be
-calculated from temperature, salinity, and depth using:
-<BR>
-
-<BR> <TT>       </TT>c =~ 1412 + 3.21 * T + 1.19 * S + 0.0167 * D<BR>
-<P>
-<BR>
-
-Normally, <B>mbabsorption</B> simply prints the resulting absorption
-value to stdout. If the <B>-V</B> option is specified, the output will
-include a listing of the parameters used in calculating the absorption.
-<BR> 
-<A NAME="lbAF"> </A>
-<H2>AUTHORSHIP</H2>
-
-David W. Caress (<A HREF="mailto:caress at mbari.org">caress at mbari.org</A>)
-<BR>
-
-<BR>  Monterey Bay Aquarium Research Institute
-<BR>
-
-Dale N. Chayes (<A HREF="mailto:dale at ldeo.columbia.edu">dale at ldeo.columbia.edu</A>)
-<BR>
-
-<BR>  Lamont-Doherty Earth Observatory
-<P>
-<A NAME="lbAG"> </A>
-<H2>OPTIONS</H2>
-
-<DL COMPACT>
-<DT><B>-H</B>
-
-<DD>
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-<DT><B>-C</B>
-
-<DD>
-<I>soundspeed</I>
-<BR>
-
-Specifies the water sound speed in m/sec. If the option is
-not used, the water sound speed will be calculated from the
-temperature, salinity, and depth. 
-<DT><B>-D</B>
-
-<DD>
-<I>depth</I>
-<BR>
-
-Sets the depth in meters at which the sound absorption should be calculated.
-Default: <I>depth</I> = 0.0 m (i.e. the sea surface).
-<DT><B>-F</B>
-
-<DD>
-<I>frequency</I>
-<BR>
-
-Sets the sound frequency in kHz at which the sound absorption should be calculated.
-Default: <I>frequency</I> = 200 kHz.
-<DT><B>-P</B>
-
-<DD>
-<I>ph</I>
-<BR>
-
-Sets the pH value at which the sound absorption should be calculated.
-Default: <I>ph</I> = 8.
-<DT><B>-S</B>
-
-<DD>
-<I>salinity</I>
-<BR>
-
-Sets the salinity in per mil at which the sound absorption should be calculated.
-Default: <I>salinity</I> = 35 per mil.
-<DT><B>-T</B>
-
-<DD>
-<I>temperature</I>
-<BR>
-
-Sets the temperature in degrees C at which the sound absorption should be calculated.
-Default: <I>temperature</I> = 10.0 degrees C.
-<DT><B>-V</B>
-
-<DD>
-Normally, <B>mbabsorption</B> outputs only a single absorption value 
-to the stdout stream.  If the
-<B>-V</B> flag is given, then <B>mbabsorption</B> works in a "verbose" mode and
-also outputs the parameters used to calculate the absorption.
-<P>
-</DL>
-<A NAME="lbAH"> </A>
-<H2>EXAMPLES</H2>
-
-Suppose that one wishes to obtain the water sound absorption for
-a 200 kHz multibeam sonar operating at a depth of 1000 meters (on
-an AUV, for instance) in water with a salinity of 35 per mil, a pH
-of 8, and a temperature of 4 degrees C. The following will suffice:
-<BR>
-
-<BR> <TT>       </TT>mbabsorption -D1000 -F200 -P8 -S35 -T4<BR>
-<BR>
-
-The output will be:
-<BR> 37.692561
-<BR> 
-<BR>
-
-In order to obtain a more readable result, use the <B>-V</B> option:
-<BR>
-
-<BR> <TT>       </TT>mbabsorption -D1000 -F200 -P8 -S35 -T4 -V<BR>
-<BR>
-
-The output will be:
-<BR>
-
-<BR> Program MBabsorption
-<BR> Version $Id: mbabsorption.1 2096 2013-06-04 08:17:22Z caress $
-<BR> MB-system Version 5.1.1beta15
-<BR> 
-<BR> Input Parameters:
-<BR>      Frequency:        200.000000 kHz
-<BR>      Temperature:      4.000000 deg C
-<BR>      Salinity:         35.000000 per mil
-<BR>      Depth:            1000.000000 m
-<BR>      pH:               8.000000
-<BR> Result:
-<BR>      Sound absorption: 37.692561 dB/km
-<P>
-<A NAME="lbAI"> </A>
-<H2>SEE ALSO</H2>
-
-<B><A HREF="mbsystem.html">mbsystem</A></B>(1)
-<P>
-<A NAME="lbAJ"> </A>
-<H2>BUGS</H2>
-
-None known.
-<P>
-
-<HR>
-<A NAME="index"> </A><H2>Index</H2>
-<DL>
-<DT><A HREF="#lbAB">NAME</A><DD>
-<DT><A HREF="#lbAC">VERSION</A><DD>
-<DT><A HREF="#lbAD">SYNOPSIS</A><DD>
-<DT><A HREF="#lbAE">DESCRIPTION</A><DD>
-<DT><A HREF="#lbAF">AUTHORSHIP</A><DD>
-<DT><A HREF="#lbAG">OPTIONS</A><DD>
-<DT><A HREF="#lbAH">EXAMPLES</A><DD>
-<DT><A HREF="#lbAI">SEE ALSO</A><DD>
-<DT><A HREF="#lbAJ">BUGS</A><DD>
-</DL>
-<HR>
-</PRE>
-
-<CENTER><P><BR>
-Last Updated: 3 June 2013</P></CENTER>
-
-<HR>
-<P><A HREF="mbsystem_man_list.html">Return to list of MB-System manual pages...</A></P>
-<P><A HREF="mbsystem_home.html"><IMG SRC="mbsystem_logo_small.gif" BORDER=0 HEIGHT=55 WIDTH=158 ALIGN=BOTTOM></A><A HREF="mbsystem_home.html">Back
-to MB-System Home Page...</A></P>
-
-</BODY>
-</HTML>
diff --git a/src/html/mbareaclean.html b/src/html/mbareaclean.html
deleted file mode 100644
index c82a347..0000000
--- a/src/html/mbareaclean.html
+++ /dev/null
@@ -1,381 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<HTML VERSION="2.0">
-<HEAD>
-   <TITLE>MB-System Unix Manual Page: mbareaclean</TITLE>
-<!-- WEBMAGIC VERSION NUMBER="2.0.2" -->
-<!-- WEBMAGIC TRANSLATION NAME="ServerRoot" SRC="/var/www/htdocs/" DST="/" -->
-<!-- WEBMAGIC TRANSLATION NAME="ProjectRoot" SRC="./" DST="" -->
-</HEAD>
-<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#336699" VLINK="#997040" ALINK="#CC9900">
-<BODY>
-<CENTER><H3><U>MB-System Unix Manual Page</U></H3></CENTER>
-<PRE>
-<H1>mbareaclean</H1>
-Section:  MB-System 5.0  (1)<BR>Updated:  29 September 2013 <BR><A HREF="#index">Index</A>
-<HR>
-
-<A NAME="lbAB"> </A>
-<H2>NAME</H2>
-
-<B>mbareaclean</B> - Tool to automatically flag bad beams in swath
-sonar bathymetry data within a specified area.
-<P>
-<A NAME="lbAC"> </A>
-<H2>VERSION</H2>
-
-Version 5.0
-<P>
-<A NAME="lbAD"> </A>
-<H2>SYNOPSIS</H2>
-
-<B>mbareaclean</B>  <B>-R</B><I>west/east/south/north</I>  <B>-S</B><I>binsize</I>
-[<B>-D</B><I>threshold</I> <B>-F</B><I>format</I> <B>-I</B><I>infile</I>
-<B>-B -G -H -M</B><I>threshold</I>[<I>/nmin</I>[<I>/nmax</I>]]
-<B>-N</B>[-]<I>min_beam</I>[<I>/maxbeam</I>] <B>-T</B><I>type</I> -V]
-<P>
-<A NAME="lbAE"> </A>
-<H2>DESCRIPTION</H2>
-
-<B>mbareaclean</B> identifies and flags artifacts in swath sonar
-bathymetry data within a specified area of interest.
-The input data are one swath file or a datalist referencing multiple
-swath files. The user may specify the work area in longitude and latitude
-bounds, along with a bin size in meters. If these are not specified, the
-program will attempt to set useful values. The area is divided into a grid with
-square cells of the specified bin size. As the data are read, each of
-the soundings that fall within one of the bins is stored. Once all of
-data are read, one or more statistical tests are performed on the soundings
-within each bin, providing there are a sufficient number of soundings.
-<P>
-The user may specify one or both of the following actions:
-<BR>  1) Previously unflagged soundings that fail a test are
-flagged as bad
-<BR>  2) Previously flagged soundings that pass all tests are
-unflagged (the <B>-G</B> option)..
-<P>
-The edit events are output to edit save files which can be applied
-to the data by the program <B>mbprocess</B>. These are the same edit save
-files created and/or modified by <B>mbclean</B> and <B>mbedit</B>.
-If a sounding's flag status is changed, that flagging action is output
-to the edit save file of the swath file containing that sounding. This
-program will create edit save files if necessary, or append to those that
-already exist.
-<P>
-At present only two algorithms for identifying good and bad beams is
-implemented. The first is a simple median filter controlled by the
-<B>-M</B><I>threshold/nmin[/nmax]</I> option. Soundings that differ from the
-median depth by a value greater than <I>threshold</I> times the sonar
-altitude will be considered "bad". So, if <I>threshold</I> = 0.05, then
-any sounding that is 5% greater or less than the median depth will be
-considered bad. The <I>nmin</I> parameter sets the minimum number of
-soundings required to use the median filter. The <I>nmax</I> parameter
-sets the maximum number of soundings allowed within a cell. If the number
-of initially good beams in a cell exceeds <I>nmax</I>, then only the <I>nmax</I>
-soundings nearest the median value remain unflagged, and the rest are
-flagged even if they meet the threshold test. The default values are
-<I>threshold</I> = 0.25, <I>nmin</I> = 10, and <I>nmax</I> = infinite.
-<P>
-The second algorithm is a simple standard deviation filter controlled by the
-<B>-D</B><I>threshold/nmin</I> option. Soundings that differ from the
-mean depth by a value greater than <I>threshold</I> times the standard deviation
-of the bin will be considered "bad". So, if <I>threshold</I> = 2, then
-any sounding that is more than 2 standard deviations greater or less than the mean depth will be
-considered bad. The <I>nmin</I> parameter sets the minimum number of
-soundings required to use the filter, The default values are
-<I>threshold</I> = 2.0 and <I>nmin</I> = 10.
-<P>
-Two options allow limiting the soundings that may be flagged.
-<B>-N</B>[-]<I>min_beam/maxbeam</I> limits flagging to only those beams in
-(or out) of the given range.
-<B>-T</B><I>type</I> limits flagging to soundings using the specified bottom
-detection algorithm.
-Many sounders use amplitude detection algorithms for the central beams
-and phase detection algorithms for the outer beams, falling back to
-amplitude detection when phase detection fails.
-Amplitude detections in the outer beams are second rate soundings and
-frequently have a higher range of errors than other soundings.
-Using <B>-N</B> and <B>-T</B> together allows stricter cleaning algorithms
-to be applied to these lower quality data. For example to flag bad all
-amplitude detections in the outer thirty beams which are more than one standard deviation
-from the mean: <B>-N-30 -T1 -D1</B>.
-<P>
-<A NAME="lbAF"> </A>
-<H2>AUTHORSHIP</H2>
-
-David W. Caress (<A HREF="mailto:caress at mbari.org">caress at mbari.org</A>)
-<BR>
-
-<BR>  Monterey Bay Aquarium Research Institute
-<BR>
-
-Dale N. Chayes (<A HREF="mailto:dale at ldeo.columbia.edu">dale at ldeo.columbia.edu</A>)
-<BR>
-
-<BR>  Lamont-Doherty Earth Observatory
-<BR>
-
-<P>
-<A NAME="lbAG"> </A>
-<H2>OPTIONS</H2>
-
-<DL COMPACT>
-<DT><B>-B</B>
-
-<DD>
-<BR>
-
-This option causes <B>mbareaclean</B> to flag as bad any previously unflagged
-soundings that fail one of the specified statistical tests. If neither <B>-B</B>
-or <B>-G</B> are specified, then the program will by default use this option.
-<DT><B>-D</B>
-
-<DD>
-<I>threshold</I>[<I>/nmin</I>]
-<BR>
-
-Turns on use of a standard deviation filter test for the soundings.
-Soundings that differ from the
-mean depth by a value greater than <I>threshold</I> times the standard deviation
-will be considered "bad". So, if <I>threshold</I> = 2.0, then
-any sounding that is twice the standard deviation from the mean depth will be
-considered bad. The <I>nmin</I> parameter sets the minimum number of
-soundings required to use the standard deviation filter. The default values are
-<I>threshold</I> = 2.0 and <I>nmin</I> = 10.
-<DT><B>-F</B>
-
-<DD>
-<I>format</I>
-<BR>
-
-Sets the data format used to read <I>infile</I>.
-If <I>format</I> < 0, then the input file specified
-with the <B>-I</B> option will actually contain a list of input swath sonar
-data files. This program uses the <B>MBIO</B> library
-and will read or write any swath sonar
-format supported by <B>MBIO</B>. A list of the swath sonar data formats
-currently supported by <B>MBIO</B> and their identifier values
-is given in the <B>MBIO</B> manual page. Default: <I>format</I> = 11.
-<DT><B>-G</B>
-
-<DD>
-This option cause <B>mbarealcean</B> to unflag (set good) any previously flagged
-soundings that pass all of the specified statistical tests. If neither <B>-B</B>
-or <B>-G</B> are specified, then the program will by default apply the  <B>-B</B>
-option.
-<DT><B>-H</B>
-
-<DD>
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-<DT><B>-I</B>
-
-<DD>
-<I>infile</I>
-<BR>
-
-Sets the input filename. If <I>format</I> > 0 (set with the
-<B>-F</B> option) then the swath sonar data contained in <I>infile</I>
-is read and processed. If <I>format</I> < 0, then <I>infile</I>
-is assumed to be an ascii file containing a list of the input swath sonar
-data files to be processed and their formats.  The program will read
-and process the data in all of these files. Each input file will
-have an associated output file with either the ".esf" suffix.
-In the <I>infile</I> file, each
-data file should be followed by a data format identifier, e.g.:
-<BR> <TT>       </TT>datafile1 11<BR>
-<BR> <TT>       </TT>datafile2 24<BR>
-<BR>
-
-This program uses the <B>MBIO</B> library and will read or write any swath sonar
-format supported by <B>MBIO</B>. A list of the swath sonar data formats
-currently supported by <B>MBIO</B> and their identifier values
-is given in the <B>MBIO</B> manual page. Default: <I>infile</I> = "datalist.mb-1".
-<DT><B>-M</B>
-
-<DD>
-<I>threshold</I>[<I>/nmin</I>]
-<BR>
-
-Turns on use of a median filter test for the soundings. If no other test is
-specified, the median filter test is used by default. Soundings that differ from the
-median depth by a value greater than <I>threshold</I> times the sonar
-altitude will be considered "bad". So, if <I>threshold</I> = 0.05, then
-any sounding that is 5% greater or less than the median depth will be
-considered bad. The <I>nmin</I> parameter sets the minimum number of
-soundings required to use the median filter, The default values are
-<I>threshold</I> = 0.25 and <I>nmin</I> = 10.
-<DT><B>-N</B>
-
-<DD>
-[-]<I>min_beam</I>[<I>/max_beam</I>]
-<BR>
-
-Limits the beams to which flagging will be applied.
-Only soundings for beams from <I>min_beam</I> to <I>max_beam</I>, inclusive, will have flags applied.
-If <I>min_beam</I> is preceded by a <B>-</B> then only beams outside the range will be flagged.
-If <I>max_beam</I> is not given it will be set so that an equal number of beams lay above it as
-lay below <I>min_beam</I>. So for a Simrad EM1002 sounder with 111 beams <B>-N-30</B> will only flag
-beam numbers 1 to 29 and 82 to 111.
-All good soundings, regardless of beam, will be included in the calculations of median, mean
-and standard deviation for the bin.
-<DT><B>-R</B>
-
-<DD>
-<I>west/east/south/north</I>
-<BR>
-
-Sets the longitude and latitude bounds within which swath sonar
-data will be read, binned, and tested. Soundings lying outside these
-bounds will be ignored.
-<BR>
-
-Default: The program will determine and use a square area encompassing
-all of the data contained in the input files.
-<DT><B>-S</B>
-
-<DD>
-<I>binsize</I>
-<BR>
-
-Sets the size of the bins to be used in meters. The area specified
-with the <B>-R</B> option will be broken into a grid with cells that
-are roughly <I>binsize</I> meters east-west and north-south.
-<BR>
-
-Default: A binsize equal to 0.2 times the maximum sonar altitude
-will be used.
-<DT><B>-T</B>
-
-<DD>
-<I>detect_type</I>
-<BR>
-
-Limits the soundings to which flagging will be applied to only those which
-use the specified bottom detection algorithm.
-<I>detect_type</I> must be one of:
-<BR>      0 - unknown algorithm
-<BR>      1 - amplitude detection
-<BR>      2 - phase detection
-<DT><B>-V</B>
-
-<DD>
-Normally, <B>mbareaclean</B> works "silently" without outputting
-anything to the stderr stream.  If the
-<B>-V</B> flag is given, then <B>mbareaclean</B> works in a "verbose" mode and
-outputs the program version being used, all error status messages,
-and the number of beams flagged as bad.
-<P>
-</DL>
-<A NAME="lbAH"> </A>
-<H2>EXAMPLES</H2>
-
-Suppose we are working with a set of 5 Reson 8101 multibeam data files comprising a
-shallow water survey. One of these files has previously been edited with <B>mbedit</B>,
-so an esf file exists and contains a number of pre-existing edits.
-If we know that this survey is contained in the area specified
-by -R-122.42556/-122.41974/47.67111/47.67529, then we can invoke <B>mbareaclean</B>
-using:
-<BR> <TT>       </TT>mbareaclean -Idatalist.mb-1 \<BR>
-<BR>  <TT>      </TT><TT>        </TT>-B -M0.1/10 -S2.5 \<BR>
-<BR> <TT>       </TT><TT>        </TT>-R-122.42556/-122.41974/47.67111/47.67529  \<BR>
-<BR> <TT>       </TT><TT>        </TT>-V<BR>
-<BR>
-
-where the bin size is 2.5 meters, the median filter threshold is 0.1 (or 10%)
-of the sonar altitude, and the minimum number of sounding required for
-filtering is 10. The results look like:
-<P>
-<BR> Program MBAREACLEAN
-<BR> Version $Id: mbareaclean.1 2155 2013-10-13 20:55:57Z caress $
-<BR> MB-system Version 5.0.beta29
-<BR> Area of interest:
-<BR>      Minimum Longitude: -122.425560 Maximum Longitude: -122.419740
-<BR>      Minimum Latitude:  47.671110 Maximum Latitude:  47.675290
-<BR>      Bin Size:   2.500000
-<BR>      Dimensions: 175 186
-<BR> Cleaning algorithms:
-<BR>      Median filter: ON
-<BR>      Plane fit:     OFF
-<BR> Output:
-<BR>      Flag unflagged soundings identified as bad:  ON
-<BR>      Unflag flagged soundings identified as good: OFF
-<P>
-<BR> Processing 001_1730.fbt
-<BR> Sorting 41580 old edits...
-<BR> 10000 of 41580 old edits sorted...
-<BR> 20000 of 41580 old edits sorted...
-<BR> 30000 of 41580 old edits sorted...
-<BR> 40000 of 41580 old edits sorted...
-<BR> pings:1169  beams:   20233 good   41686 flagged   56150 null
-<P>
-<BR> Processing 003_1733.fbt
-<BR> pings: 991  beams:   52439 good     159 flagged   47493 null
-<P>
-<BR> Processing 005_1736.fbt
-<BR> pings:1011  beams:   53080 good     588 flagged   48443 null
-<P>
-<BR> Processing 007_1739.fbt
-<BR> pings: 922  beams:   48854 good     212 flagged   44056 null
-<P>
-<BR> Processing 009_1741.fbt
-<BR> pings:1017  beams:   53416 good     586 flagged   48715 null
-<P>
-<BR> MBareaclean Processing Totals:
-<BR> -------------------------
-<BR> 5 total swath data files processed
-<BR> 5110 total pings processed
-<BR> 271253 total soundings processed
-<BR> -------------------------
-<BR>   0 soundings:  61919 flagged:      0 unflagged:      0  file:001_1730
-<BR>   1 soundings:  52598 flagged:      0 unflagged:      0  file:003_1733
-<BR>   2 soundings:  53668 flagged:      0 unflagged:      0  file:005_1736
-<BR>   3 soundings:  49066 flagged:      0 unflagged:      0  file:007_1739
-<BR>   4 soundings:  54002 flagged:      0 unflagged:      0  file:009_1741
-<P>
-<P>
-<A NAME="lbAI"> </A>
-<H2>SEE ALSO</H2>
-
-<B><A HREF="mbsystem.html">mbsystem</A></B>(1), <B><A HREF="mbclean.html">mbclean</A></B>(1), <B><A HREF="mbedit.html">mbedit</A></B>(1),
-<B><A HREF="mbinfo.html">mbinfo</A></B>(1) <B><A HREF="mbprocess.html">mbprocess</A></B>(1),
-<P>
-<A NAME="lbAJ"> </A>
-<H2>BUGS</H2>
-
-The algorithms implemented in <B>mbareaclean</B> simply
-don't detect all bathymetric artifacts that
-are obvious to the eye on contour charts.  Although
-the autofiltering tools <B>mbareaclean</B> and <B>mbclean</B>
-often do a credible first pass at
-flagging obvious artifacts, we strongly recommend that
-any swath bathymetry processing stream include
-interactive editing of the
-bathymetry data (e.g. <B>mbedit</B>).
-<P>
-
-<HR>
-<A NAME="index"> </A><H2>Index</H2>
-<DL>
-<DT><A HREF="#lbAB">NAME</A><DD>
-<DT><A HREF="#lbAC">VERSION</A><DD>
-<DT><A HREF="#lbAD">SYNOPSIS</A><DD>
-<DT><A HREF="#lbAE">DESCRIPTION</A><DD>
-<DT><A HREF="#lbAF">AUTHORSHIP</A><DD>
-<DT><A HREF="#lbAG">OPTIONS</A><DD>
-<DT><A HREF="#lbAH">EXAMPLES</A><DD>
-<DT><A HREF="#lbAI">SEE ALSO</A><DD>
-<DT><A HREF="#lbAJ">BUGS</A><DD>
-</DL>
-<HR>
-</PRE>
-
-<CENTER><P><BR>
-Last Updated: 29 September 2013</P></CENTER>
-
-<HR>
-<P><A HREF="mbsystem_man_list.html">Return to list of MB-System manual pages...</A></P>
-<P><A HREF="mbsystem_home.html"><IMG SRC="mbsystem_logo_small.gif" BORDER=0 HEIGHT=55 WIDTH=158 ALIGN=BOTTOM></A><A HREF="mbsystem_home.html">Back
-to MB-System Home Page...</A></P>
-
-</BODY>
-</HTML>
diff --git a/src/html/mbauvloglist.html b/src/html/mbauvloglist.html
deleted file mode 100644
index ddb4cd7..0000000
--- a/src/html/mbauvloglist.html
+++ /dev/null
@@ -1,492 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<HTML VERSION="2.0">
-<HEAD>
-   <TITLE>MB-System Unix Manual Page: mbauvloglist</TITLE>
-<!-- WEBMAGIC VERSION NUMBER="2.0.2" -->
-<!-- WEBMAGIC TRANSLATION NAME="ServerRoot" SRC="/var/www/htdocs/" DST="/" -->
-<!-- WEBMAGIC TRANSLATION NAME="ProjectRoot" SRC="./" DST="" -->
-</HEAD>
-<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#336699" VLINK="#997040" ALINK="#CC9900">
-<BODY>
-<CENTER><H3><U>MB-System Unix Manual Page</U></H3></CENTER>
-<PRE>
-<H1>mbauvloglist</H1>
-Section:  MB-System 5.0  (1)<BR>Updated:  18 February 2015 <BR><A HREF="#index">Index</A>
-<HR>
-
-<A NAME="lbAB"> </A>
-<H2>NAME</H2>
-
-<B>mbauvloglist</B> - Lists table data from an MBARI AUV mission log file.
-<P>
-<A NAME="lbAC"> </A>
-<H2>VERSION</H2>
-
-Version 5.0
-<P>
-<A NAME="lbAD"> </A>
-<H2>SYNOPSIS</H2>
-
-<B>mbauvloglist</B> <B>-I</B><I>file</I> [<B>-F</B><I>printformat</I> <B>-L</B><I>lonflip</I>
-<B>-M</B><I>mode</I> <B>-N</B><I>navfile</I> <B>-O</B><I>list</I> <B>-P -S</B> <B>-V -H</B> ]
-<P>
-<A NAME="lbAE"> </A>
-<H2>DESCRIPTION</H2>
-
-MBauvloglist reads an MBARI AUV mission log file and lists specified
-fields in tab-delimited text output. MBARI AUV mission logs  are binary
-files with an ascii header describing the units, name, and binary size
-of each value in a single record. An example of a log file header is:
-<P>
-# binary fastcatlog
-<BR>
-
-# timeTag time %8.8e ,time ,UNKNOWN
-<BR>
-
-# double conductivity %8.8e ,Calculated conductivity ,Siemens/meter
-<BR>
-
-# double temperature %8.8e ,Calculated temperature ,Celsius
-<BR>
-
-# double pressure %8.8e ,Calculated pressure ,Decibars
-<BR>
-
-# double calculated_salinity %8.8e ,Calculated salinity ,Volts
-<BR>
-
-# double cond_frequency %8.8e ,Raw Conductivity frequency ,Hertz
-<BR>
-
-# double temp_counts %8.8e ,Raw Pressure A/D counts ,Unitless
-<BR>
-
-# double pressure_counts %8.8e ,pressure_counts ,Unitless
-<BR>
-
-# double pressure_temp_comp_voltage_reading %8.8e ,Raw pressure temp compensation voltage reading ,Volts
-<BR>
-
-# double calculated_sound_velocity %8.8e ,Calculated sound velocity ,M/s
-<BR>
-
-# begin
-<P>
-Users can extract arbitrary text lists of values in the AUV log files by using the <B>-O</B>
-option repeatedly to specify fields by name (e.g. calculated_sound_velocity)
-in the order desired. The print formatting statements (e.g. %8.8e) included in the log
-header is used by default. However, users can use the <B>-F</B> option to specify
-optional formatting for fields specified in following <B>-O</B> commands.
-<P>
-To find out the values contained in any particular log file, use the <B>-P</B> option alone
-to print out a list of the contents. Then run <B>mbauvloglist</B> again using the <B>-O</B> option
-to specify each of the desired values in the desired order of columns. The <B>-F</B> option
-can be used to set the printing format. Otherwise, the default format specified in the
-log header will be used.
-<P>
-The <B>-M</B><I>mode</I> option sets the output mode. By default, the output will be ASCII
-text with tab characters between fields, which is equivalent to <B>-M</B><I>0</I>. If
-fImode = 1, then the output will be ASCII text with comma delimiters. If <I>mode</I> = 1,
-then the output will binary values (8-btye double or 4-byte int values) with nothing between
-the desired fields.
-<P>
-For log files that do not include navigation, an external navigation file in the "fnv"
-format may be specified using the <B>-N</B> option. 
-<P>
-As of August 2009, the contents of the MBARI Mapping AUV missions logs are:
-<P>
-DropWeight.log Contents:
-<BR> timeTag time %8.8e ,time ,UNKNOWN
-<BR> short WDTimer %d ,Count Down Timer ,Seconds
-<BR> short BWTimer %d ,Burn Wire Timer ,Seconds
-<BR> short WDClear %d ,Watch Dog Clear ,Unitless
-<BR> short AcommsDN %d ,Acoustic Comms Drop Now ,Unitless
-<BR> short WDStatus %d ,Watch Dog Status ,Unknown
-<BR> short DWout %d ,Drop Weight Active ,Unitless
-<BR> short GulperProxIn %d ,Gulper Proximity Sensor ,Unitless
-<P>
-adam6017.log Contents:
-<BR> timeTag time %8.8e ,time ,UNKNOWN
-<BR> double chan0 %8.8e ,chan0 ,UNKNOWN
-<BR> double chan1 %8.8e ,chan1 ,UNKNOWN
-<BR> double chan2 %8.8e ,chan2 ,UNKNOWN
-<BR> double chan3 %8.8e ,chan3 ,UNKNOWN
-<BR> double chan4 %8.8e ,chan4 ,UNKNOWN
-<BR> double chan5 %8.8e ,chan5 ,UNKNOWN
-<BR> double chan6 %8.8e ,chan6 ,UNKNOWN
-<BR> double chan7 %8.8e ,chan7 ,UNKNOWN
-<P>
-ats.log Contents:
-<BR> timeTag time %8.8e ,time ,UNKNOWN
-<BR> double AtsDelta %8.8e ,Last ms drift bt Reson and Auv clocks: drift = delta0 - (tReson-tAuv) ,seconds
-<BR> double AtsDrift %8.8e ,AtsDrift ,seconds
-<P>
-dvl.log Contents:
-<BR> timeTag time %8.8e ,time ,UNKNOWN
-<BR> double dvlBotVelx %8.8e ,dvlBotVelx ,UNKNOWN
-<BR> double dvlBotVely %8.8e ,dvlBotVely ,UNKNOWN
-<BR> double dvlBotVelz %8.8e ,dvlBotVelz ,UNKNOWN
-<BR> double dvlBotVele %8.8e ,dvlBotVele ,UNKNOWN
-<BR> short dvlBotVelStat %d ,dvlBotVelStat ,UNKNOWN
-<BR> double dvlWatVelx %8.8e ,dvlWatVelx ,UNKNOWN
-<BR> double dvlWatVely %8.8e ,dvlWatVely ,UNKNOWN
-<BR> double dvlWatVelz %8.8e ,dvlWatVelz ,UNKNOWN
-<BR> double dvlWatVele %8.8e ,dvlWatVele ,UNKNOWN
-<BR> short dvlWatVelStat %d ,dvlWatVelStat ,UNKNOWN
-<BR> double dvlTemp %8.8e ,dvlTemp ,UNKNOWN
-<BR> double dvlPitch %8.8e ,dvlPitch ,UNKNOWN
-<BR> double dvlRoll %8.8e ,dvlRoll ,UNKNOWN
-<BR> double dvlHeading %8.8e ,dvlHeading ,UNKNOWN
-<BR> double dvlBeam1 %4.6f ,dvlBeam1 ,UNKNOWN
-<BR> double dvlBeam2 %4.6f ,dvlBeam2 ,UNKNOWN
-<BR> double dvlBeam3 %4.6f ,dvlBeam3 ,UNKNOWN
-<BR> double dvlBeam4 %8.8e ,dvlBeam4 ,UNKNOWN
-<BR> double dvlRange %8.8e ,dvlRange ,UNKNOWN
-<BR> double dvlToping %20.4f ,dvlToping ,UNKNOWN
-<BR> double dvlSpdSnd %12.4f ,dvlSpdSnd ,UNKNOWN
-<P>
-dynamicControl.log Contents:
-<BR> timeTag time %8.8e ,time ,UNKNOWN
-<BR> double myTime %.2f ,myTime ,UNKNOWN
-<BR> double xTrackError %8.8e ,xTrackError ,UNKNOWN
-<BR> double cPsi %8.8e ,cPsi ,UNKNOWN
-<BR> double cDeltaR %8.8e ,cDeltaR ,UNKNOWN
-<BR> double tPsi %8.8e ,tPsi ,UNKNOWN
-<BR> double psiProp %8.8e ,psiProp ,UNKNOWN
-<BR> double psiInt %8.8e ,psiInt ,UNKNOWN
-<BR> double psiRate %8.8e ,psiRate ,UNKNOWN
-<BR> double xteIntegral %8.8e ,xteIntegral ,UNKNOWN
-<BR> double kxte %8.8e ,kxte ,UNKNOWN
-<BR> double dPsi %8.8e ,dPsi ,UNKNOWN
-<BR> double speedCmd %8.8e ,speedCmd ,UNKNOWN
-<BR> double omegaCmd %8.8e ,omegaCmd ,UNKNOWN
-<BR> double cDepth %8.8e ,cDepth ,UNKNOWN
-<BR> double tDepth %8.8e ,tDepth ,UNKNOWN
-<BR> double DepthError %8.8e ,DepthError ,UNKNOWN
-<BR> double dIntegral %8.8e ,dIntegral ,UNKNOWN
-<BR> double mDepthRateTerm %8.8e ,mDepthRateTerm ,UNKNOWN
-<BR> double cTheta %8.8e ,cTheta ,UNKNOWN
-<BR> double pitchProp %8.8e ,pitchProp ,UNKNOWN
-<BR> double pitchInt %8.8e ,pitchInt ,UNKNOWN
-<BR> double pitchRate %8.8e ,pitchRate ,UNKNOWN
-<BR> double pitchIntInp %8.8e ,pitchIntInp ,UNKNOWN
-<BR> double cDeltaEBL %8.8e ,cDeltaEBL ,UNKNOWN
-<BR> double cDeltaE %8.8e ,cDeltaE ,UNKNOWN
-<BR> double targetNorthing %13.2f ,targetNorthing ,UNKNOWN
-<BR> double targetEasting %13.2f ,targetEasting ,UNKNOWN
-<BR> double newBearing %8.8e ,newBearing ,UNKNOWN
-<BR> double newNorthing %13.2f ,newNorthing ,UNKNOWN
-<BR> double newEasting %13.2f ,newEasting ,UNKNOWN
-<BR> short first %d ,first ,UNKNOWN
-<P>
-fastcatlog.log Contents:
-<BR> timeTag time %8.8e ,time ,UNKNOWN
-<BR> double conductivity %8.8e ,Calculated conductivity ,Siemens/meter
-<BR> double temperature %8.8e ,Calculated temperature ,Celsius
-<BR> double pressure %8.8e ,Calculated pressure ,Decibars
-<BR> double calculated_salinity %8.8e ,Calculated salinity ,Volts
-<BR> double cond_frequency %8.8e ,Raw Conductivity frequency ,Hertz
-<BR> double temp_counts %8.8e ,Raw Pressure A/D counts ,Unitless
-<BR> double pressure_counts %8.8e ,pressure_counts ,Unitless
-<BR> double pressure_temp_comp_voltage_reading %8.8e ,Raw pressure temp compensation voltage reading ,Volts
-<BR> double calculated_sound_velocity %8.8e ,Calculated sound velocity ,M/s
-<P>
-gps.log Contents:
-<BR> timeTag time %8.8e ,time ,UNKNOWN
-<BR> integer hours %d ,Hours ,Hours
-<BR> integer minutes %d ,Minutes ,Minutes
-<BR> integer seconds %d ,Seconds ,Seconds
-<BR> integer centiSeconds %d ,CentiSeconds ,CentiSeconds
-<BR> angle latitude %8.8e ,Vehicle latitude ,Degrees
-<BR> angle longitude %8.8e ,Vehicle longitude ,Degrees
-<BR> short quality %d ,GPS quality code ,Unitless
-<BR> short numberOfSatellites %d ,Number of satellites visible ,Unitless
-<BR> double hdop %8.8e ,Horizontal dilution of precision ,Unitless
-<BR> double antennaHeight %8.8e ,Altitude of GPS antenna above mean sea level ,meters
-<BR> double geoHeight %8.8e ,Geoidal separation ,meters
-<BR> short dgpsDataAge %d ,Age of differential GPS correction ,seconds
-<BR> short dgpsRSID %d ,Differential reference station ID ,Unitless
-<P>
-kearfott.log Contents:
-<BR> timeTag time %8.8e ,time ,UNKNOWN
-<BR> integer mCyclesK %d ,mCyclesK ,UNKNOWN
-<BR> integer mModeK %d ,mModeK ,UNKNOWN
-<BR> integer mMonK %d ,mMonK ,UNKNOWN
-<BR> double mLatK %3.8f ,mLatK ,UNKNOWN
-<BR> double mLonK %3.8f ,mLonK ,UNKNOWN
-<BR> double mNorthK %13.2f ,mNorthK ,UNKNOWN
-<BR> double mEastK %13.2f ,mEastK ,UNKNOWN
-<BR> double mDepthK %8.8e ,mDepthK ,UNKNOWN
-<BR> double mRollK %8.8e ,mRollK ,UNKNOWN
-<BR> double mPitchK %8.8e ,mPitchK ,UNKNOWN
-<BR> double mHeadK %8.8e ,mHeadK ,UNKNOWN
-<BR> double mVbodyxK %8.8e ,mVbodyxK ,UNKNOWN
-<BR> double mVbodyyK %8.8e ,mVbodyyK ,UNKNOWN
-<BR> double mVbodyzK %8.8e ,mVbodyzK ,UNKNOWN
-<BR> double mAccelxK %8.8e ,mAccelxK ,UNKNOWN
-<BR> double mAccelyK %8.8e ,mAccelyK ,UNKNOWN
-<BR> double mAccelzK %8.8e ,mAccelzK ,UNKNOWN
-<BR> double mPrateK %8.8e ,mPrateK ,UNKNOWN
-<BR> double mQrateK %8.8e ,mQrateK ,UNKNOWN
-<BR> double mRrateK %8.8e ,mRrateK ,UNKNOWN
-<BR> double utcTime %8.8e ,utcTime ,UNKNOWN
-<P>
-m3dmgx1.log Contents:
-<BR> timeTag time %8.8e ,time ,UNKNOWN
-<BR> angle mRollCB %8.8e ,Roll ,Degrees
-<BR> angle mOmega_xCB %8.8e ,Roll rate ,Degrees/second
-<BR> angle mPitchCB %8.8e ,Pitch ,Degrees
-<BR> angle mOmega_yCB %8.8e ,Pitch rate ,Degrees/second
-<BR> angle mYawCB %8.8e ,Yaw ,Degrees
-<BR> angle mOmega_zCB %8.8e ,Yaw rate ,Degrees/second
-<BR> double mAccel_xCB %8.8e ,Acceleration along vehicle x-axis ,G
-<BR> double mAccel_yCB %8.8e ,Acceleration along vehicle y-axis ,G
-<BR> double mAccel_zCB %8.8e ,Acceleration along vehicle z-axis ,G
-<BR> double mMag_xCB %8.8e ,Magnetic field along vehicle x-axis ,Gauss
-<BR> double mMag_yCB %8.8e ,Magnetic field along vehicle y-axis ,Gauss
-<BR> double mMag_zCB %8.8e ,Magnetic field along vehicle z-axis ,Gauss
-<BR> double mTempCB %8.8e ,Crossbow internal temperature ,Celsius
-<P>
-navigation.log Contents:
-<BR> timeTag time %8.8e ,time ,UNKNOWN
-<BR> double mPos_x %13.2f ,Vehicle Northing (WGS 84 Zone 10S) ,Meters
-<BR> double mPos_y %13.2f ,Vehicle Easting (WGS 84 Zone 10S) ,Meters
-<BR> double mDepth %8.8e ,Vehicle Depth ,Meters
-<BR> double mGpsNorth %13.2f ,Northing (WGS 84 Zone 10S) based upon GPS fix ,Meters
-<BR> double mGpsEast %13.2f ,Easting (WGS 84 Zone 10S) based upon GPS fix ,Meters
-<BR> integer mGpsValid %d ,GPS fix Status code ,Unitless
-<BR> double mPhi %8.8e ,Vehicle roll ,Degrees
-<BR> double mTheta %8.8e ,Vehicle pitch ,Degrees
-<BR> double mPsi %8.8e ,Vehicle yaw ,Degrees
-<BR> double mOmega_x %8.8e ,Vehicle roll rate ,Degrees/second
-<BR> double mOmega_y %8.8e ,Vehicle pitch rate ,Degrees/second
-<BR> double mOmega_z %8.8e ,Vehicle yaw rate ,Degrees/second
-<BR> double mPsaRange %8.8e ,Altimeter range ,Meters
-<BR> double mAltitude %8.8e ,Vehicle altitude above bottom ,Meters
-<BR> double mDvlAltitude %8.8e ,mDvlAltitude ,UNKNOWN
-<BR> double mWaterSpeed %8.8e ,Current speed based upon DVL data ,Meters/second
-<BR> integer mDvlValid %d ,Dvl valid flag in Navigation ,UNKNOWN
-<BR> integer mDvlNewData %d ,Navigation thinks the Dvl has new data ,UNKNOWN
-<BR> double mDeltaT %8.8e ,Time between Dvl updates ,Seconds
-<BR> double nfix %13.2f ,Northing (WGS 84 Zone 10S) based upon baseline fix ,Meters
-<BR> double efix %13.2f ,Easting (WGS 84 Zone 10S) based upon baseline fix ,Meters
-<BR> double filter_north %13.2f ,Kalman filter northing (WGS 84 Zone 10S) ,Meters
-<BR> double filter_east %13.2f ,Kalman filter easting (WGS 84 Zone 10S) ,Meters
-<BR> double filter_depth %8.8e ,Kalman filter depth ,Meters
-<BR> double north_current %8.8e ,Northward flowing current estimate ,Meters/second
-<BR> double east_current %8.8e ,Eastward flowing current estimate ,Meters/second
-<BR> double speed_bias %8.8e ,Speed bias based upon long baseline fixes ,Meters/second
-<BR> double heading_bias %8.8e ,Heading bias based upon long baseline fixes ,Degrees
-<BR> double latitude %5.8f ,latitude ,UNKNOWN
-<BR> double longitude %5.8f ,longitude ,UNKNOWN
-<P>
-parosci.log Contents:
-<BR> timeTag time %8.8e ,time ,UNKNOWN
-<BR> double depth %8.3lf ,Depth ,Meters
-<BR> double temp %8.8e ,Pressure Sensor Internal Temp ,Celsius
-<BR> double pressure %8.8lf ,Pressure ,Bars
-<BR> double temp_period %8.8lf ,Temperature Period ,Microseconds
-<BR> double pres_period %8.8lf ,Pressure Period ,Microseconds
-<P>
-tailCone.log Contents:
-<BR> timeTag time %8.8e ,time ,UNKNOWN
-<BR> integer status %d ,status ,UNKNOWN
-<BR> integer elevatorCurrent %d ,elevatorCurrent ,UNKNOWN
-<BR> integer rudderCurrent %d ,rudderCurrent ,UNKNOWN
-<BR> float propCurrent1 %f ,propCurrent1 ,UNKNOWN
-<BR> integer propCurrent2 %d ,propCurrent2 ,UNKNOWN
-<BR> integer propRpm %d ,propRpm ,UNKNOWN
-<BR> float elevatorAngle %f ,elevatorAngle ,UNKNOWN
-<BR> float rudderAngle %f ,rudderAngle ,UNKNOWN
-<BR> integer propPwm %d ,propPwm ,UNKNOWN
-<BR> integer propTemp %d ,propTemp ,UNKNOWN
-<P>
-<A NAME="lbAF"> </A>
-<H2>AUTHORSHIP</H2>
-
-David W. Caress (<A HREF="mailto:caress at mbari.org">caress at mbari.org</A>)
-<BR>
-
-<BR>  Monterey Bay Aquarium Research Institute
-<BR>
-
-Dale N. Chayes (<A HREF="mailto:dale at ldeo.columbia.edu">dale at ldeo.columbia.edu</A>)
-<BR>
-
-<BR>  Lamont-Doherty Earth Observatory
-<P>
-<A NAME="lbAG"> </A>
-<H2>OPTIONS</H2>
-
-<DL COMPACT>
-<DT><B>-H</B>
-
-<DD>
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-<DT><B>-F</B>
-
-<DD>
-<I>printformat</I>
-<BR>
-
-Sets the printing format (in fprintf() style) of the next value specified using
-the <B>-O</B> option. By default, <B>mbauvloglist</B> uses the print format specified
-in the log file header. If the <B>-F</B> option has been used, using it again with
-<I>printformat</I> equal to "default" will reset the print format to that specified
-in the log file header.
-<DT><B>-I</B>
-
-<DD>
-<I>ifile</I>
-<BR>
-
-Sets the input MBARI AUV mission log  filename.
-<DT><B>-L</B>
-
-<DD>
-<I>lonflip</I>
-<BR>
-
-Sets the range of the longitude values output.
-If <I>lonflip</I>=-1 then the longitude values will be in
-the range from -360 to 0 degrees. If <I>lonflip</I>=0
-then the longitude values will be in
-the range from -180 to 180 degrees. If <I>lonflip</I>=1
-then the longitude values will be in
-the range from 0 to 360 degrees.
-Default: <B>mbauvloglist</B> uses the user default <I>lonflip</I> set using
-<B>mbdefaults</B>.
-<DT><B>-M</B>
-
-<DD>
-<I>mode</I>
-<BR>
-
-Specifies the output mode. If <I>mode</I> = 0, then the output is
-ASCII text with tab delimiters between fields. If <I>mode</I> = 1,
-then the output is ASCII text with comma delimiters between fields.
-If <I>mode</I> = 2, then the output is binary with no values or breaks
-between fields. Default: ASCII text with tab delimiters.
-<DT><B>-N</B>
-
-<DD>
-<I>navfile</I>
-<BR>
-
-Specifies a navigation file in the "fnv" format that contains position,
-heading, sensor depth, and attitude data. Values merged (interpolated)
-from these data can be specified for output using the
-<BR>     mergeLon
-<BR>     mergeLat
-<BR>     mergeHeading
-<BR>     mergeSpeed
-<BR>     mergeDraft
-<BR>     mergeSensordepth
-<BR>     mergeRoll
-<BR>     mergePitch
-<BR>     mergeHeave
-<BR>
-
-valuenames in the <B>-O</B> option.
-<DT><B>-O</B>
-
-<DD>
-<I>valuename</I>
-<BR>
-
-Causes <B>mbauvloglist</B> to output the specified value. This option can be
-given multiple times, and the values will be output in the order specified.
-The valid valuename strings consist of those defined in the header of the
-log file being parsed, plus the following:
-<BR>     zero
-<BR>     timeTag
-<BR>     mergeLon
-<BR>     mergeLat
-<BR>     mergeHeading
-<BR>     mergeSpeed
-<BR>     mergeDraft
-<BR>     mergeSensordepth
-<BR>     mergeRoll
-<BR>     mergePitch
-<BR>     mergeHeave
-<BR>
-
-All of the special values are double values. Those beginning with "merge"
-derive from interpolation of data from an external navigation file
-specified using the <B>-N</B> option.
-<DT><B>-P</B>
-
-<DD>
-<BR>
-
-Prints out the log file header.
-<DT><B>-S</B>
-
-<DD>
-<BR>
-
-Scales angular values to be in degrees instead of radians.
-<DT><B>-V</B>
-
-<DD>
-The <B>-V</B> option causes the program to be verbose.
-</DL>
-<A NAME="lbAH"> </A>
-<H2>EXAMPLE</H2>
-
-To extract a list of pressure and water sound speed from the CTD log of an
-AUV mission, use:
-<BR> <TT>       </TT>mbauvloglist -I mvc_logs/2006.224.00/fastcatlog.log \<BR>
-<BR> <TT>       </TT><TT>        </TT>-F%f -O pressure -O calculated_sound_velocity<BR>
-<BR>
-
-This simple list is ordered as the data were collected, following the ups
-and downs of the AUV mission. In order to construct a model of the water
-sound speed as a function of depth, one can sort the output of <B>mbauvloglist</B>
-(using the program <B>sort</B>) to be ordered with increasing pressure (depth),
-and then resampled into uniform increments of pressure using the <B>GMT</B>
-program <B>sample1d</B>.
-<BR> <TT>       </TT>mbauvloglist -I mvc_logs/2006.224.00/fastcatlog.log \<BR>
-<BR> <TT>       </TT><TT>        </TT>-F%f -O pressure -O calculated_sound_velocity \<BR>
-<BR> <TT>       </TT><TT>        </TT>| sort -n -u > auv_ssv.txt<BR>
-<BR> <TT>       </TT>sample1d auv_ssv.txt -Fl -H1 -S0.0 -I10.0 > auv_ssv_bin.txt<BR>
-<P>
-<A NAME="lbAI"> </A>
-<H2>SEE ALSO</H2>
-
-<B><A HREF="mbsystem.html">mbsystem</A></B>(1), <B>sample1d</B>, <B>sort</B>.
-<P>
-<A NAME="lbAJ"> </A>
-<H2>BUGS</H2>
-
-Indubitably.
-<P>
-
-<HR>
-<A NAME="index"> </A><H2>Index</H2>
-<DL>
-<DT><A HREF="#lbAB">NAME</A><DD>
-<DT><A HREF="#lbAC">VERSION</A><DD>
-<DT><A HREF="#lbAD">SYNOPSIS</A><DD>
-<DT><A HREF="#lbAE">DESCRIPTION</A><DD>
-<DT><A HREF="#lbAF">AUTHORSHIP</A><DD>
-<DT><A HREF="#lbAG">OPTIONS</A><DD>
-<DT><A HREF="#lbAH">EXAMPLE</A><DD>
-<DT><A HREF="#lbAI">SEE ALSO</A><DD>
-<DT><A HREF="#lbAJ">BUGS</A><DD>
-</DL>
-<HR>
-</PRE>
-
-<CENTER><P><BR>
-Last Updated: 18 February 2015</P></CENTER>
-
-<HR>
-<P><A HREF="mbsystem_man_list.html">Return to list of MB-System manual pages...</A></P>
-<P><A HREF="mbsystem_home.html"><IMG SRC="mbsystem_logo_small.gif" BORDER=0 HEIGHT=55 WIDTH=158 ALIGN=BOTTOM></A><A HREF="mbsystem_home.html">Back
-to MB-System Home Page...</A></P>
-
-</BODY>
-</HTML>
diff --git a/src/html/mbauvnavusbl.html b/src/html/mbauvnavusbl.html
deleted file mode 100644
index 0dfecef..0000000
--- a/src/html/mbauvnavusbl.html
+++ /dev/null
@@ -1,154 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<HTML VERSION="2.0">
-<HEAD>
-   <TITLE>MB-System Unix Manual Page: mbauvnavusbl</TITLE>
-<!-- WEBMAGIC VERSION NUMBER="2.0.2" -->
-<!-- WEBMAGIC TRANSLATION NAME="ServerRoot" SRC="/var/www/htdocs/" DST="/" -->
-<!-- WEBMAGIC TRANSLATION NAME="ProjectRoot" SRC="./" DST="" -->
-</HEAD>
-<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#336699" VLINK="#997040" ALINK="#CC9900">
-<BODY>
-<CENTER><H3><U>MB-System Unix Manual Page</U></H3></CENTER>
-<PRE>
-<H1>mbauvnavusbl</H1>
-Section:  MB-System 5.0  (1)<BR>Updated:  3 June 2013 <BR><A HREF="#index">Index</A>
-<HR>
-
-<A NAME="lbAB"> </A>
-<H2>NAME</H2>
-
-<B>mbauvnavusbl</B> - Adjusts inertial navigation of a submerged platform/vehicle
-to be consistent with more accurate but less precise surface tracking (USBL) navigation. 
-<P>
-<A NAME="lbAC"> </A>
-<H2>VERSION</H2>
-
-Version 5.0
-<P>
-<A NAME="lbAD"> </A>
-<H2>SYNOPSIS</H2>
-
-<B>mbauvnavusbl</B> <B>-I</B><I>inavfile</I> [<B>-L</B>
-<B>-O</B><I>onavfile</I>  <B>-U</B><I>usblfile</I><B>-V -H</B> ]
-<P>
-<A NAME="lbAE"> </A>
-<H2>DESCRIPTION</H2>
-
-MBauvnavusbl reads a primary navigation file (usually from a submerged platform
-swath survey) and also reads secondary navigation (e.g. USBL fixes). 
-The program calculates position offsets between the raw survey navigation
-and the secondary navigation every 3600 seconds (10 minutes), and then 
-linearly interpolates and applies this adjustment vector for each 
-primary navigation position. 
-<P>
-The inertial navigation is read in format 166 and the USBL navigation is 
-read from format 165 files. The adjusted navigation is output in format 166.
-<P>
-<A NAME="lbAF"> </A>
-<H2>AUTHORSHIP</H2>
-
-David W. Caress (<A HREF="mailto:caress at mbari.org">caress at mbari.org</A>)
-<BR>
-
-<BR>  Monterey Bay Aquarium Research Institute
-<BR>
-
-Dale N. Chayes (<A HREF="mailto:dale at ldeo.columbia.edu">dale at ldeo.columbia.edu</A>)
-<BR>
-
-<BR>  Lamont-Doherty Earth Observatory
-<P>
-<A NAME="lbAG"> </A>
-<H2>OPTIONS</H2>
-
-<DL COMPACT>
-<DT><B>-H</B>
-
-<DD>
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-<DT><B>-I</B>
-
-<DD>
-<I>inavfile</I>
-<BR>
-
-Sets the input navigation filename. The navigation data must be
-in format 166.
-<B>-L</B>
-
-<I>lonflip</I>
-<BR>
-
-Sets the range of the longitude values used.
-If <I>lonflip</I>=-1 then the longitude values will be in
-the range from -360 to 0 degrees. If <I>lonflip</I>=0 
-then the longitude values will be in
-the range from -180 to 180 degrees. If <I>lonflip</I>=1 
-then the longitude values will be in
-the range from 0 to 360 degrees.
-Default: <B>mbauvnavusbl</B> uses the user default <I>lonflip</I> set using
-<B>mbdefaults</B>.
-<DT><B>-O</B>
-
-<DD>
-<I>onavfile</I>
-<BR>
-
-Sets the output navigation filename. The navigation data will be
-in format 166.
-<DT><B>-U</B>
-
-<DD>
-<I>usblfile</I>
-<BR>
-
-Sets the input usbl navigation filename. The usbl navigation data must be
-in format 165.
-<DT><B>-V</B>
-
-<DD>
-The <B>-V</B> option causes the program to be verbose.
-</DL>
-<A NAME="lbAH"> </A>
-<H2>EXAMPLE</H2>
-
-Coming...
-<P>
-<A NAME="lbAI"> </A>
-<H2>SEE ALSO</H2>
-
-<B><A HREF="mbsystem.html">mbsystem</A></B>(1)
-<P>
-<A NAME="lbAJ"> </A>
-<H2>BUGS</H2>
-
-Da.
-<P>
-
-<HR>
-<A NAME="index"> </A><H2>Index</H2>
-<DL>
-<DT><A HREF="#lbAB">NAME</A><DD>
-<DT><A HREF="#lbAC">VERSION</A><DD>
-<DT><A HREF="#lbAD">SYNOPSIS</A><DD>
-<DT><A HREF="#lbAE">DESCRIPTION</A><DD>
-<DT><A HREF="#lbAF">AUTHORSHIP</A><DD>
-<DT><A HREF="#lbAG">OPTIONS</A><DD>
-<DT><A HREF="#lbAH">EXAMPLE</A><DD>
-<DT><A HREF="#lbAI">SEE ALSO</A><DD>
-<DT><A HREF="#lbAJ">BUGS</A><DD>
-</DL>
-<HR>
-</PRE>
-
-<CENTER><P><BR>
-Last Updated: 3 June 2013</P></CENTER>
-
-<HR>
-<P><A HREF="mbsystem_man_list.html">Return to list of MB-System manual pages...</A></P>
-<P><A HREF="mbsystem_home.html"><IMG SRC="mbsystem_logo_small.gif" BORDER=0 HEIGHT=55 WIDTH=158 ALIGN=BOTTOM></A><A HREF="mbsystem_home.html">Back
-to MB-System Home Page...</A></P>
-
-</BODY>
-</HTML>
diff --git a/src/html/mbbackangle.html b/src/html/mbbackangle.html
deleted file mode 100644
index 104e59b..0000000
--- a/src/html/mbbackangle.html
+++ /dev/null
@@ -1,476 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<HTML VERSION="2.0">
-<HEAD>
-   <TITLE>MB-System Unix Manual Page: mbbackangle</TITLE>
-<!-- WEBMAGIC VERSION NUMBER="2.0.2" -->
-<!-- WEBMAGIC TRANSLATION NAME="ServerRoot" SRC="/var/www/htdocs/" DST="/" -->
-<!-- WEBMAGIC TRANSLATION NAME="ProjectRoot" SRC="./" DST="" -->
-</HEAD>
-<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#336699" VLINK="#997040" ALINK="#CC9900">
-<BODY>
-<CENTER><H3><U>MB-System Unix Manual Page</U></H3></CENTER>
-<PRE>
-<H1>mbbackangle</H1>
-Section:  MB-System 5.0  (1)<BR>Updated:  3 June 2013 <BR><A HREF="#index">Index</A>
-<HR>
-
-<A NAME="lbAB"> </A>
-<H2>NAME</H2>
-
-<B>mbbackangle</B> - Generates tables of the average amplitude or
-sidescan values in swath sonar data as a function of
-the grazing angle with the seafloor.
-<P>
-<A NAME="lbAC"> </A>
-<H2>VERSION</H2>
-
-Version 5.0
-<P>
-<A NAME="lbAD"> </A>
-<H2>SYNOPSIS</H2>
-
-<B>mbbackangle</B> [<B>-A</B><I>kind</I>
-<B>-C</B> <B>-D</B> <B>-F</B><I>format</I>
-<B>-G</B><I>kind/angle/max/nx/ny</I>
-<B>-I</B><I>file</I>
-<B>-N</B><I>nangle/anglemax</I> <B>-P</B><I>pings</I> <B>-Q</B>
-<B>-R</B><I>refangle</I> <B>-T</B><I>topogridfile</I> <B>-Z</B><I>altitude</I> <B>-V -H</B>]
-<P>
-<A NAME="lbAE"> </A>
-<H2>DESCRIPTION</H2>
-
-The program <B>mbbackangle</B> reads a swath sonar data file
-containing beam amplitude and/or sidescan data and generates tables
-of the average amplitude and/or sidescan values as a function of
-the grazing angle with the seafloor. These tables can be used
-by the program <B>mbprocess</B> to correct the sidescan or
-amplitude data for the variation with grazing angle. No assumption
-is made about the nature of the data or the sonar used to
-collect it.
-<P>
-The user specifies the angular width
-of the swath considered and the number of angular bins in that
-swath; the average amplitude or sidescan value within each bin
-form the output data. By default, the grazing angle is calculated simply using the
-acrosstrack distance and depth at the beam or pixel location.
-If bathymetry is not available, the seafloor is assumed to be flat
-with a sonar altitude specified by the <B>-Z</B> option.
-If the <B>-Q</B> option is used, then the acrosstrack bottom slope
-at the beam or pixel location is factored into the grazing angle
-values. For bins outside the nadir region (angles > 15.0 degrees
-from vertical), the averaging extends over the neighboring bins (three bins
-averaged for each value). The user also specifies the number of pings
-to be read to generate each table; the default is 50 pings.
-<P>
-The results are written to a file named by
-adding a ".sga" suffix to the swath filename for sidescan and
-".aga" for amplitude. These files contain a series of amplitude vs.
-grazing angle tables, each time tagged according to the average time
-of the pings used to generate that table. The swath file's
-<B>mbprocess</B> parameter file is also modified (or created if necessary)
-so that sidescan or amplitude correction is enabled.
-<P>
-The correction tables are read and interpolated according to ping time
-by <B>mbprocess</B>. The correction value for each amplitude or sidescan
-sample is also interpolated using the samples apparent grazing angle.
-The grazing angle is calculated using a flat bottom assumption
-by default but, if the <B>-Q</B> option is used, will instead be
-calculated using the acrosstrack slope in the bathymetry (if available) .
-If the <B>-T</B> option is used to specify a topography grid of the area
-of interest, then the grazing angle is calculated using that grid rather
-than any bathymetry data within the file being processed.
-<P>
-If the values are in dB, and therefore log scaled, then the corrections
-are subtracted from the raw values and then the value of the correction
-table at the reference angle (specified with the <B>-R</B> option) is
-added back in. In the case of linear data, the correction operation is
-to divide by the correction value and then multiply by the reference
-value. At present, only SeaBeam 2100 sidescan values are linear; all
-other amplitude and sidescan data supported by <B>MB-System</B> are
-in dB.
-<P>
-If the <B>-G</B> option is used, then <B>mbbackangle</B> also generates
-gridded histograms of the amplitude versus grazing angle values for
-each swath data file processed. The user specifies the bounds and dimensions
-of the grids; the <B>-G</B> option must be given twice to produce grids
-of both amplitude and sidescan histograms. In addition to outputting the
-grids, <B>mbbackangle</B> uses <B>mbm_grdplot</B> to generate <B>GMT</B>
-shellscripts that, when executed, will generate plots of the gridded
-histograms overlain with the amplitude versus grazing angle tables in
-the ".aga" and ".sga" files.
-<P>
-<A NAME="lbAF"> </A>
-<H2>AUTHORSHIP</H2>
-
-David W. Caress (<A HREF="mailto:caress at mbari.org">caress at mbari.org</A>)
-<BR>
-
-<BR>  Monterey Bay Aquarium Research Institute
-<BR>
-
-Dale N. Chayes (<A HREF="mailto:dale at ldeo.columbia.edu">dale at ldeo.columbia.edu</A>)
-<BR>
-
-<BR>  Lamont-Doherty Earth Observatory
-<P>
-<A NAME="lbAG"> </A>
-<H2>OPTIONS</H2>
-
-<DL COMPACT>
-<DT><B>-A</B>
-
-<DD>
-<I>kind</I>
-<BR>
-
-Determines if beam amplitude (<I>kind</I> = 1)
-and/or sidescan (<I>kind</I> = 2) data will be processed.
-Default: both amplitude and sidescan data are processed.
-<DT><B>-C</B>
-
-<DD>
-Normally, <B>mbbackangle</B> produces a table of amplitude vs
-grazing angle values which is asymmetric about the vertical
-(zero angle) axis. If <B>-C</B> is specified, the amplitude
-vs grazing angle function will be forced to be symmetric.
-Generally, it is better to not use this option in <B>mbbackangle</B>,
-and to instead use <B>mbset</B> to set symmetric or asymmetric
-sidescan correction in the <B>mbprocess</B> parameter file.
-<DT><B>-D</B>
-
-<DD>
-This option causes <B>mbbackangle</B> to dump the output to
-stdout rather than to ".sga" or ".aga" files..
-<DT><B>-F</B>
-
-<DD>
-<I>format</I>
-<BR>
-
-Sets the <B>MBIO</B> integer format identifier
-for the input file specified with the
-<B>-I</B> option. By default, <B>mbbackangle</B>
-infers the format from the "*.mbXX" <B>MB-System</B> suffix
-convention.
-<DT><B>-G</B>
-
-<DD>
-<I>kind/angle/max/nx/ny</I>
-<BR>
-
-This option causes <B>mbbackangle</B> to output gridded histograms
-of the amplitude versus grazing angle data for each swath file
-processed. The program also generates a shellscript to produce a
-first-cut <B>GMT</B> postscript plot of the histogram overlain by
-the amplitude versus grazing angle tables used by <B>mbprocess</B>.
-The <I>kind</I> parameter indicates whether an amplitude (<I>kind</I> = 1)
-or sidescan (<I>kind</I> = 2) histogram is desired; the <B>-G</B> command
-must be given twice (once with <I>kind</I> = 1 and once with <I>kind</I> = 2)
-to generate both amplitude and sidescan histograms. The histogram grid
-consists of <I>nx</I> bins extending from -<I>angle</I> to +<I>angle</I> degrees in the
-x-dimension, and <I>ny</I> bins extending from 0.0 to <I>max</I> in the
-y-dimension. The values of the histogram are normalized so that they sum
-to 1000.0 within each angle bin.
-<DT><B>-H</B>
-
-<DD>
-This "help" flag causes the program to print out a description
-of its operation and then exit immediately.
-<DT><B>-I</B>
-
-<DD>
-<I>filename</I>
-<BR>
-
-Sets the input filename. If <I>format</I> > 0 (set with the
-<B>-F</B> option) then the swath sonar data contained in <I>infile</I>
-is read and processed. If <I>format</I> < 0, then <I>infile</I>
-is assumed to be an ascii file containing a list of the input swath sonar
-data files to be processed and their formats.  The program will read
-and process the data in each one of these files. Each input file will
-have an associated output file with either the ".sga" or ".aga" suffix.
-In the <I>infile</I> file, each
-data file should be followed by a data format identifier, e.g.:
-<BR> <TT>       </TT>datafile1 11<BR>
-<BR> <TT>       </TT>datafile2 24<BR>
-<BR>
-
-This program uses the <B>MBIO</B> library and will read any swath sonar
-format supported by <B>MBIO</B>. A list of the swath sonar data formats
-currently supported by <B>MBIO</B> and their identifier values
-is given in the <B>MBIO</B> manual page. Default: <I>infile</I> = "datalist.mb-1".
-<DT><B>-N</B>
-
-<DD>
-<I>nangle/angle</I>
-<BR>
-
-The amplitude vs grazing angle table is calculated by binning the
-amplitude values according to their grazing angles and averaging
-the amplitudes within each bin. This option sets the number of
-grazing angle bins (<I>nangle</I>) and the maximum angle considered
-(<I>angle</I>). The grazing angle function will be defined at
-<I>nangle</I> points spaced equally from -<I>angle</I> to
-+<I>angle</I>. The <I>nangle</I> value should be an odd integer
-so that the middle bin is centered on the angle 0.0.
-Default: <I>nangle</I> = 81, <I>angle</I> = 80.0.
-<DT><B>-P</B>
-
-<DD>
-<I>pings</I>
-<BR>
-
-Sets the number of pings to be read and averaged for each
-amplitude vs grazing angle table. The output "*.sga" or ".aga" files
-will generally contain many tables, each with a timestamp
-corresponding to the average of the ping times used for
-each table. A table may be output averaged over a lesser number
-of beams if a time gap is encountered in the data, and also at
-the end of the file. Default: <I>pings</I> = 50.
-<DT><B>-Q</B>
-
-<DD>
-By default, <B>mbbackangle</B> does not use seafloor slopes in
-calculating the grazing angles for each amplitude beam and sidescan
-pixel. This option causes the program to calculate acrosstrack slopes
-from swath bathymetry, if available, and to factor these slopes
-into the grazing angle calculation for each data point.
-<DT><B>-R</B>
-
-<DD>
-<I>refangle</I>
-Sets the reference angle that will be used by <B>mbprocess</B> in
-applying the amplitude and/or sidescan correction tables generated
-by <B>mbbackangle</B>. Default: <I>refangle</I> = 30.0 degrees.
-<DT><B>-T</B>
-
-<DD>
-<I>topogridfile</I>
-By default, <B>mbbackangle</B> does not use seafloor slopes in
-calculating the grazing angles for each amplitude beam and sidescan
-pixel. This option causes the program to calculate acrosstrack slopes
-using the topography grid <I>topogridfile</I>, and to factor these slopes
-into the grazing angle calculation for each data point.
-<DT><B>-V</B>
-
-<DD>
-Normally, <B>mbbackangle</B> works "silently" without outputting
-anything to the stderr stream.  If the
-<B>-V</B> flag is given, then <B>mbmask</B> works in a "verbose" mode and
-outputs the program version being used and all error status messages.
-<DT><B>-Z</B>
-
-<DD>
-<I>depth</I>
-<BR>
-
-This option specifies a default sonar altitude value in meters to be
-used whenever bathymetry values are unavailable. A flat seafloor
-(zero slope) will be assumed wherever the default depth needs
-to be used (e.g. data files with sidescan but no bathymetry, or
-the outer parts of swaths where the sidescan may extend further
-than the bathymetry). If this option is not specified, any
-amplitude or sidescan values without associated bathymetry
-information will not be used in calculating the amplitude
-vs grazing angle table.
-<P>
-</DL>
-<A NAME="lbAH"> </A>
-<H2>EXAMPLE</H2>
-
-Suppose one has a Simrad EM300 data file called
-<BR>       0003_20020425_022926.mb57
-which contains 131 pings. In order to correct the beam amplitude and sidescan
-with mbprocess, first use <B>mbbackangle</B> to generate the
-amplitude vs grazing angle tables:
-<BR> <TT>       </TT>mbbackangle -I mbari_1998_988_msn.mb57 \<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT>-N81/80.0 -P50 \<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT>-G1/80/60/81/121 \<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT>-G2/80/60/81/121 \<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT>-V<BR>
-<BR>
-
-Here the angle bins will be 2.0 degree wide, the table
-will extend from -80.0 degees (port) to +80.0 (starboard),
-and each table will represent the averages over up to 50
-pings. The output looks like:
-<P>
-<BR> <TT>       </TT>Program mbbackangle<BR>
-<BR> <TT>       </TT>Version $Id: mbbackangle.1 2096 2013-06-04 08:17:22Z caress $<BR>
-<BR> <TT>       </TT>MB-system Version 5.0.4<BR>
-<P>
-<BR> <TT>       </TT>Pings to average:    50<BR>
-<BR> <TT>       </TT>Number of angle bins: 81<BR>
-<BR> <TT>       </TT>Maximum angle:         80.000000<BR>
-<BR> <TT>       </TT>Default altitude:      0.000000<BR>
-<BR> <TT>       </TT>Working on beam amplitude data...<BR>
-<BR> <TT>       </TT>Working on sidescan data...<BR>
-<BR> <TT>       </TT>Using flat bottom assumption in calculating correction tables...<BR>
-<BR> <TT>       </TT>Outputting gridded histograms of beam amplitude vs grazing angle...<BR>
-<BR> <TT>       </TT>Outputting gridded histograms of sidescan amplitude vs grazing angle...<BR>
-<P>
-<BR> <TT>       </TT>processing swath file: mbari_1998_988_msn.mb57 57<BR>
-<P>
-<BR> <TT>       </TT>7274 records processed<BR>
-<BR> <TT>       </TT>805564 amplitude data processed<BR>
-<BR> <TT>       </TT>146 tables written to mbari_1998_988_msn.mb57.aga<BR>
-<BR> <TT>       </TT>5371412 sidescan data processed<BR>
-<BR> <TT>       </TT>146 tables written to mbari_1998_988_msn.mb57.sga<BR>
-<P>
-<BR> <TT>       </TT>Plot generation shellscript <mbari_1998_988_msn.mb57_aga.grd.cmd> created.<BR>
-<BR> <TT>       </TT>Plot generation shellscript <mbari_1998_988_msn.mb57_sga.grd.cmd> created.<BR>
-<P>
-<BR> <TT>       </TT>7274 total records processed<BR>
-<BR> <TT>       </TT>805564 total amplitude data processed<BR>
-<BR> <TT>       </TT>146 total aga tables written<BR>
-<BR> <TT>       </TT>5371412 total sidescan data processed<BR>
-<BR> <TT>       </TT>146 total sga tables written<BR>
-<P>
-The output files include the amplitude versus grazing angle tables in
-mbari_1998_988_msn.mb57.aga and mbari_1998_988_msn.mb57.sga, the
-gridded histogram files mbari_1998_988_msn.mb57_aga.grd and
-mbari_1998_988_msn.mb57_sga.grd, and the plotting shellscripts
-mbari_1998_988_msn.mb57_aga.grd.cmd and
-mbari_1998_988_msn.mb57_sga.grd.cmd. The <B>mbprocess</B> parameter file
-mbari_1998_988_msn.mb57.par has also been either
-created (if necessary) or modified to enable sidescan
-correction using the ".sga" tables. The first of the six tables
-in mbari_1998_988_msn.mb57.sga looks like:
-<BR> <TT>       </TT>## Sidescan correction table files generated by program mbbackangle<BR>
-<BR> <TT>       </TT>## Version $Id: mbbackangle.1 2096 2013-06-04 08:17:22Z caress $<BR>
-<BR> <TT>       </TT>## MB-system Version 5.0.4<BR>
-<BR> <TT>       </TT>## Table file format: 1.0.0<BR>
-<BR> <TT>       </TT>## Run by user <caress> on cpu <hess> at <Fri Oct  1 11:18:30 2004><BR>
-<BR> <TT>       </TT>## Input swath file:      mbari_1998_988_msn.mb57<BR>
-<BR> <TT>       </TT>## Input swath format:    57<BR>
-<BR> <TT>       </TT>## Output table file:     mbari_1998_988_msn.mb57.sga<BR>
-<BR> <TT>       </TT>## Pings to average:      50<BR>
-<BR> <TT>       </TT>## Number of angle bins:  81<BR>
-<BR> <TT>       </TT>## Maximum angle:         80.000000<BR>
-<BR> <TT>       </TT>## Default altitude:      0.000000<BR>
-<BR> <TT>       </TT>## Data type:             sidescan<BR>
-<BR> <TT>       </TT># table: 0<BR>
-<BR> <TT>       </TT># nping: 50<BR>
-<BR> <TT>       </TT># time:  1998/06/10 14:55:24.979779    897490524.979780<BR>
-<BR> <TT>       </TT># nangles: 81<BR>
-<BR> <TT>       </TT>-80.0000       0.0000       0.0000<BR>
-<BR> <TT>       </TT>-78.0000       0.0000       0.0000<BR>
-<BR> <TT>       </TT>-76.0000       0.0000       0.0000<BR>
-<BR> <TT>       </TT>-74.0000       0.0000       0.0000<BR>
-<BR> <TT>       </TT>-72.0000       0.0000       0.0000<BR>
-<BR> <TT>       </TT>-70.0000       0.0000       0.0000<BR>
-<BR> <TT>       </TT>-68.0000       0.0000       0.0000<BR>
-<BR> <TT>       </TT>-66.0000       0.0000       0.0000<BR>
-<BR> <TT>       </TT>-64.0000      33.4828       7.5915<BR>
-<BR> <TT>       </TT>-62.0000      32.4068       5.4016<BR>
-<BR> <TT>       </TT>-60.0000      31.9667       5.3320<BR>
-<BR> <TT>       </TT>-58.0000      31.7880       5.1880<BR>
-<BR> <TT>       </TT>-56.0000      31.6249       5.0681<BR>
-<BR> <TT>       </TT>-54.0000      31.6362       4.9521<BR>
-<BR> <TT>       </TT>-52.0000      31.5590       5.0482<BR>
-<BR> <TT>       </TT>-50.0000      31.3955       5.1242<BR>
-<BR> <TT>       </TT>-48.0000      31.0372       5.2364<BR>
-<BR> <TT>       </TT>-46.0000      30.9569       5.1092<BR>
-<BR> <TT>       </TT>-44.0000      30.8126       4.9848<BR>
-<BR> <TT>       </TT>-42.0000      30.3497       4.9611<BR>
-<BR> <TT>       </TT>-40.0000      29.7660       4.9479<BR>
-<BR> <TT>       </TT>-38.0000      29.2746       4.9727<BR>
-<BR> <TT>       </TT>-36.0000      29.1929       4.9734<BR>
-<BR> <TT>       </TT>-34.0000      29.1729       4.9893<BR>
-<BR> <TT>       </TT>-32.0000      28.7375       5.0295<BR>
-<BR> <TT>       </TT>-30.0000      28.6560       5.0031<BR>
-<BR> <TT>       </TT>-28.0000      28.0609       5.1757<BR>
-<BR> <TT>       </TT>-26.0000      27.3652       5.2692<BR>
-<BR> <TT>       </TT>-24.0000      26.2536       5.1193<BR>
-<BR> <TT>       </TT>-22.0000      25.2113       4.8437<BR>
-<BR> <TT>       </TT>-20.0000      24.9033       4.5717<BR>
-<BR> <TT>       </TT>-18.0000      24.4118       4.5952<BR>
-<BR> <TT>       </TT>-16.0000      24.4341       4.5824<BR>
-<BR> <TT>       </TT>-14.0000      24.3251       4.7864<BR>
-<BR> <TT>       </TT>-12.0000      23.6965       4.1409<BR>
-<BR> <TT>       </TT>-10.0000      24.1326       3.7653<BR>
-<BR> <TT>       </TT>-8.0000      26.1912       4.2246<BR>
-<BR> <TT>       </TT>-6.0000      27.9516       4.5724<BR>
-<BR> <TT>       </TT>-4.0000      31.1992       5.6401<BR>
-<BR> <TT>       </TT>-2.0000      29.2624       5.8076<BR>
-<BR> <TT>       </TT> 0.0000      27.4466       4.3310<BR>
-<BR> <TT>       </TT> 2.0000      24.9780       4.1345<BR>
-<BR> <TT>       </TT> 4.0000      24.2328       4.0980<BR>
-<BR> <TT>       </TT> 6.0000      23.3917       4.6856<BR>
-<BR> <TT>       </TT> 8.0000      24.0867       4.5882<BR>
-<BR> <TT>       </TT>10.0000      23.2293       4.6383<BR>
-<BR> <TT>       </TT>12.0000      24.1375       4.5005<BR>
-<BR> <TT>       </TT>14.0000      25.1402       4.6843<BR>
-<BR> <TT>       </TT>16.0000      25.1948       4.9131<BR>
-<BR> <TT>       </TT>18.0000      25.0986       5.0503<BR>
-<BR> <TT>       </TT>20.0000      25.0798       5.0769<BR>
-<BR> <TT>       </TT>22.0000      25.0582       5.1801<BR>
-<BR> <TT>       </TT>24.0000      25.6108       5.1108<BR>
-<BR> <TT>       </TT>26.0000      25.8393       5.0068<BR>
-<BR> <TT>       </TT>28.0000      26.3232       4.9469<BR>
-<BR> <TT>       </TT>30.0000      26.4346       5.0686<BR>
-<BR> <TT>       </TT>32.0000      26.6474       5.1690<BR>
-<BR> <TT>       </TT>34.0000      27.0092       5.2098<BR>
-<BR> <TT>       </TT>36.0000      27.1987       5.1664<BR>
-<BR> <TT>       </TT>38.0000      27.3710       5.2504<BR>
-<BR> <TT>       </TT>40.0000      27.1160       5.1788<BR>
-<BR> <TT>       </TT>42.0000      27.0691       5.1418<BR>
-<BR> <TT>       </TT>44.0000      27.2547       4.8907<BR>
-<BR> <TT>       </TT>46.0000      27.7406       4.9654<BR>
-<BR> <TT>       </TT>48.0000      28.1568       4.9277<BR>
-<BR> <TT>       </TT>50.0000      28.4015       4.9687<BR>
-<BR> <TT>       </TT>52.0000      28.4042       4.9034<BR>
-<BR> <TT>       </TT>54.0000      28.3741       4.9500<BR>
-<BR> <TT>       </TT>56.0000      28.5195       4.9799<BR>
-<BR> <TT>       </TT>58.0000      28.6455       5.0142<BR>
-<BR> <TT>       </TT>60.0000      28.9284       4.9876<BR>
-<BR> <TT>       </TT>62.0000      28.9028       5.0380<BR>
-<BR> <TT>       </TT>64.0000       0.0000       0.0000<BR>
-<BR> <TT>       </TT>66.0000       0.0000       0.0000<BR>
-<BR> <TT>       </TT>68.0000       0.0000       0.0000<BR>
-<BR> <TT>       </TT>70.0000       0.0000       0.0000<BR>
-<BR> <TT>       </TT>72.0000       0.0000       0.0000<BR>
-<BR> <TT>       </TT>74.0000       0.0000       0.0000<BR>
-<BR> <TT>       </TT>76.0000       0.0000       0.0000<BR>
-<BR> <TT>       </TT>78.0000       0.0000       0.0000<BR>
-<BR> <TT>       </TT>80.0000       0.0000       0.0000<BR>
-<BR> <TT>       </TT>#<BR>
-<BR> <TT>       </TT>#<BR>
-<P>
-<A NAME="lbAI"> </A>
-<H2>SEE ALSO</H2>
-
-<B><A HREF="mbsystem.html">mbsystem</A></B>(1), <B><A HREF="mbprocess.html">mbprocess</A></B>(1), <B><A HREF="mbset.html">mbset</A></B>(1), <B><A HREF="mbfilter.html">mbfilter</A></B>(1)
-<P>
-<A NAME="lbAJ"> </A>
-<H2>BUGS</H2>
-
-None worth bragging about.
-<P>
-
-<HR>
-<A NAME="index"> </A><H2>Index</H2>
-<DL>
-<DT><A HREF="#lbAB">NAME</A><DD>
-<DT><A HREF="#lbAC">VERSION</A><DD>
-<DT><A HREF="#lbAD">SYNOPSIS</A><DD>
-<DT><A HREF="#lbAE">DESCRIPTION</A><DD>
-<DT><A HREF="#lbAF">AUTHORSHIP</A><DD>
-<DT><A HREF="#lbAG">OPTIONS</A><DD>
-<DT><A HREF="#lbAH">EXAMPLE</A><DD>
-<DT><A HREF="#lbAI">SEE ALSO</A><DD>
-<DT><A HREF="#lbAJ">BUGS</A><DD>
-</DL>
-<HR>
-</PRE>
-
-<CENTER><P><BR>
-Last Updated: 3 June 2013</P></CENTER>
-
-<HR>
-<P><A HREF="mbsystem_man_list.html">Return to list of MB-System manual pages...</A></P>
-<P><A HREF="mbsystem_home.html"><IMG SRC="mbsystem_logo_small.gif" BORDER=0 HEIGHT=55 WIDTH=158 ALIGN=BOTTOM></A><A HREF="mbsystem_home.html">Back
-to MB-System Home Page...</A></P>
-
-</BODY>
-</HTML>
diff --git a/src/html/mbclean.html b/src/html/mbclean.html
deleted file mode 100644
index 0d284e5..0000000
--- a/src/html/mbclean.html
+++ /dev/null
@@ -1,590 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<HTML VERSION="2.0">
-<HEAD>
-   <TITLE>MB-System Unix Manual Page: mbclean</TITLE>
-<!-- WEBMAGIC VERSION NUMBER="2.0.2" -->
-<!-- WEBMAGIC TRANSLATION NAME="ServerRoot" SRC="/var/www/htdocs/" DST="/" -->
-<!-- WEBMAGIC TRANSLATION NAME="ProjectRoot" SRC="./" DST="" -->
-</HEAD>
-<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#336699" VLINK="#997040" ALINK="#CC9900">
-<BODY>
-<CENTER><H3><U>MB-System Unix Manual Page</U></H3></CENTER>
-<PRE>
-<H1>mbclean</H1>
-Section:  MB-System 5.0  (1)<BR>Updated:  14 April 2015 <BR><A HREF="#index">Index</A>
-<HR>
-
-<A NAME="lbAB"> </A>
-<H2>NAME</H2>
-
-<B>mbclean</B> - Tool to automatically flag bad beams in swath sonar bathymetry data.
-<P>
-<A NAME="lbAC"> </A>
-<H2>VERSION</H2>
-
-Version 5.0
-<P>
-<A NAME="lbAD"> </A>
-<H2>SYNOPSIS</H2>
-
-<B>mbclean</B> [<B>-A</B><I>max</I> <B>-B</B><I>low/high</I> <B>-C</B><I>slope/units</I>
-<B>-D</B><I>min/max</I> <B>-F</B><I>format</I>
-<B>-G</B><I>fraction_low/fraction_high</I>
-<B>-I</B><I>infile</I> <B>-K</B><I>range_min</I> <B>-L</B><I>lonflip</I>
-<B>-M</B><I>mode</I> <B>-O</B><I>outfile</I> <B>-P</B><I>min_speed/max_speed</I> <B>-Q</B><I>backup</I>
-<B>-R</B><I>maxheadingrate</I> <B>-S</B><I>slope/mode/units</I>
-<B>-T</B><I>tolerance</I> <B>-U</B><I>nmin</I> <B>-W</B><I>west/east/south/north</I> <B>-X</B><I>beamsleft/beamsright</I>
-<B>-Y</B><I>distanceleft/distanceright</I> <B>-Z -V -H</B>]
-<P>
-<A NAME="lbAE"> </A>
-<H2>DESCRIPTION</H2>
-
-<B>mbclean</B> identifies and flags artifacts in swath sonar bathymetry data.
-Several algorithms are available for identifying artifacts; multiple
-algorithms can be applied in a single pass.
-The most commonly used approach is to identify artifacts
-based on excessive bathymetric slopes.
-Spikes where an excessive slope occurs before and reverses after a beam
-can also be removed.
-If desired, <B>mbclean</B> will also flag beams
-associated with "rails" where
-outer beams have smaller acrosstrack distances
-than more inner beams (<B>-Q</B> option).
-Low and high bounds on acceptable depth values can be set; depth values
-outside the acceptable range will be flagged. The acceptable depth
-ranges can either be absolute (<B>-B</B> option), relative to
-the local median depth (<B>-A</B> option) or defined by low
-and high fractions of the local median depth (<B>-G</B> option).
-A set number of outer beams can also be flagged.
-<P>
-The order in which the flagging algorithms are applied is
-as follows:
-<BR>
-
-<BR> <TT>       </TT>1. Flag specified numbers of outer beams<BR>
-<BR> <TT>       </TT><TT>        </TT>(<B>-X</B> option).<BR>
-<BR> <TT>       </TT>2. Flag outer beams by acrosstrack distance<BR>
-<BR> <TT>       </TT><TT>        </TT>(<B>-Y</B> option).<BR>
-<TT>        </TT>3. Flag all beams in pings outside specified<BR>
-<TT>        </TT><TT>        </TT>acceptable speed range (<B>-P</B> option).<BR>
-<TT>        </TT>4. Flag all beams in pings outside specified<BR>
-<TT>        </TT><TT>        </TT>acceptable position bounds (<B>-W</B> option).<BR>
-<TT>        </TT>5. Flag all beams in pings with zero<BR>
-<TT>        </TT><TT>        </TT>longitude and latitude values (<B>-Z</B> option).<BR>
-<BR> <TT>       </TT>6. Flag soundings outside specified acceptable<BR>
-<BR> <TT>       </TT><TT>        </TT>depth range (<B>-B</B> option).<BR>
-<BR> <TT>       </TT>7. Flag soundings with ranges less than<BR>
-<BR> <TT>       </TT><TT>        </TT>specified minimum value (<B>-B</B> option).<BR>
-<BR> <TT>       </TT>8. Flag pings with excessive heading change rate<BR>
-<TT>        </TT>        (<B>-R</B> option).<BR>
-<BR> <TT>       </TT>9. Zap "rails" (<B>-Q</B> option).<BR>
-<BR> <TT>       </TT>10. Flag soundings with acrosstrack distances <BR>
-<BR> <TT>       </TT><TT>        </TT>greater than specified maximum value<BR>
-<BR> <TT>       </TT><TT>        </TT>(<B>-B</B> option).<BR>
-<BR> <TT>       </TT>11. Flag soundings outside acceptable depth range<BR>
-<BR> <TT>       </TT><TT>        </TT>using fractions of local median depth<BR>
-<BR> <TT>       </TT><TT>        </TT>(<B>-G</B> option).<BR>
-<BR> <TT>       </TT>12. Flag soundings outside acceptable depth range<BR>
-<BR> <TT>       </TT><TT>        </TT>using deviation from local median depth<BR>
-<BR> <TT>       </TT><TT>        </TT>(<B>-A</B> option).<BR>
-<BR> <TT>       </TT>13. Flag soundings associated with spikes (<B>-S</B> option).<BR>
-<BR> <TT>       </TT>14. Flag soundings associated with excessive slopes<BR>
-<BR> <TT>       </TT><TT>        </TT>(<B>-C</B> option or default).<BR>
-<BR> <TT>       </TT>15. Flag all soundings in pings with too few<BR>
-<BR> <TT>       </TT><TT>        </TT>good soundings (<B>-U</B> option).<BR>
-<P>
-This program flags beams by outputting the flags as
-edit events to an "edit save file", like that produced
-by <B>mbedit</B>. If an "edit save file" (named by adding
-a ".esf" suffix to the input swath filename) already
-exists, the edits are read in and applied before the
-<B>mbclean</B> flagging algorithms are used.
-Once generated, the edit events can be applied
-to the data using the program <B>mbprocess</B>, which
-outputs a processed swath data file.
-The <B>mbprocess</B> program is also used to merge
-edited navigation, recalculate bathymetry, and apply
-other corrections to swath bathymetry data.
-<P>
-<A NAME="lbAF"> </A>
-<H2>AUTHORSHIP</H2>
-
-David W. Caress (<A HREF="mailto:caress at mbari.org">caress at mbari.org</A>)
-<BR>
-
-<BR>  Monterey Bay Aquarium Research Institute
-<BR>
-
-Dale N. Chayes (<A HREF="mailto:dale at ldeo.columbia.edu">dale at ldeo.columbia.edu</A>)
-<BR>
-
-<BR>  Lamont-Doherty Earth Observatory
-<BR>
-
-Alberto Malinverno
-<BR>
-
-<BR>  Schlumberger-Doll
-<P>
-<A NAME="lbAG"> </A>
-<H2>OPTIONS</H2>
-
-<DL COMPACT>
-<DT><B>-A</B>
-
-<DD>
-<I>max</I>
-<BR>
-
-This option sets the range of acceptable depth values relative to
-the local median depth. The median depth is obtained from the
-current ping and the pings immediately before and after that
-ping.  If a depth value deviates from the median depth by more
-than <I>max</I>, then it
-will be flagged. No deviation from the median depth checking is
-done if the <B>-A</B> option
-is not used.
-<DT><B>-B</B>
-
-<DD>
-<I>low/high</I>
-<BR>
-
-This option sets the range of acceptable depth values.  If a depth
-value is less than <I>low</I> or more than <I>high</I> then it
-will be flagged. No depth range checking is done if the <B>-B</B> option
-is not used.
-<DT><B>-C</B>
-
-<DD>
-<I>slope/unit</I>
-<BR>
-
-The value <I>slope</I> is the maximum acceptable slope. Beams associated
-with excessive slopes will be flagged or removed according to the
-operational mode specified using the <B>-M</B> option. This method will
-be used if no other algorithms are specified; if other algorithms are
-specified but <B>-C</B> is not used then no slope checking will occur.
-<I>unit</I> is optional and specifies the unit of <I>slope</I>,
-0 (default) indicates the slope is in tangents, 1 slope is in radians,
-2 slope is in degrees.
-Default: <I>slope</I> = 1.0
-<DT><B>-D</B>
-
-<DD>
-<I>min/max</I>
-<BR>
-
-Sets the minimum and maximum allowed distances between beams used for
-some of the flagging algorithms.  Both values are expressed in terms
-of fractions of the local median depth. Thus, <B>-D</B><I>0.01/0.25</I>
-will translate, if the local median depth is 1000 meters, to a minimum
-distance of 10 meters and a maximum distance of 250 meters.
-The <I>min</I> value sets the minimum distance
-between beams required for an excessive slope to be used
-to flag bad beams.
-The navigation and heading of the ship are used to calculate the locations
-of beams.  Ship turns often cause beams of adjacent pings to overlap, causing
-the distances between these beams to become quite small.  This can, in turn,
-magnify noise in the bathymetry data to produce slope estimates which
-are excessively large. The <I>max</I> value sets the maximum distance
-between the current beam and other beams for those beams to be used
-in evaluating the current beam. For instance, only beams within the
-maximum distance are used to calculate the local median depth, and only
-beams within the maximum distance are used to check for excessive slopes.
-Default: <I>min/max</I> = 0.01/0.25.
-<DT><B>-F</B>
-
-<DD>
-<I>format</I>
-<BR>
-
-Sets the data format used if the input is read from stdin
-or from a file. If <I>format</I> < 0, then the input file specified
-with the <B>-I</B> option will actually contain a list of input swath sonar
-data files. This program uses the <B>MBIO</B> library
-and will read or write any swath sonar
-format supported by <B>MBIO</B>. A list of the swath sonar data formats
-currently supported by <B>MBIO</B> and their identifier values
-is given in the <B>MBIO</B> manual page. Default: <I>format</I> = 11.
-<DT><B>-G</B>
-
-<DD>
-<I>fraction_low/fraction_high</I>
-<BR>
-
-This option sets the range of acceptable depth values relative to
-low and high fractions of the local median depth.
-The median depth is obtained from the
-current ping and the pings immediately before and after that
-ping.  If a depth
-value is less than <I>fraction_low</I> times the median depth
-(e.g. <I>fraction_low</I> = 0.5 means one half the median
-depth) or more than <I>fraction_high</I> times the median depth then it
-will be flagged. No fractional depth range checking is
-done if the <B>-G</B> option
-is not used.
-<DT><B>-H</B>
-
-<DD>
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-<DT><B>-I</B>
-
-<DD>
-<I>infile</I>
-<BR>
-
-Sets the input filename. If <I>format</I> > 0 (set with the
-<B>-F</B> option) then the swath sonar data contained in <I>infile</I>
-is read and processed. If <I>format</I> < 0, then <I>infile</I>
-is assumed to be an ascii file containing a list of the input swath sonar
-data files to be processed and their formats.  The program will read
-and process the data in each one of these files. Each input file will
-have an associated output file with either the ".sga" or ".aga" suffix.
-In the <I>infile</I> file, each
-data file should be followed by a data format identifier, e.g.:
-<BR> <TT>       </TT>datafile1 11<BR>
-<BR> <TT>       </TT>datafile2 24<BR>
-<BR>
-
-This program uses the <B>MBIO</B> library and will read or write any swath sonar
-format supported by <B>MBIO</B>. A list of the swath sonar data formats
-currently supported by <B>MBIO</B> and their identifier values
-is given in the <B>MBIO</B> manual page. Default: <I>infile</I> = "datalist.mb-1".
-<DT><B>-K</B>
-
-<DD>
-<I>range_min</I>
-<BR>
-
-This option causes all unflagged beams with ranges less than
-<I>range_min</I> to be flagged as bad. The value <I>range_min</I>
-is specified in meters.
-<DT><B>-L</B>
-
-<DD>
-<I>lonflip</I>
-<BR>
-
-Sets the range of the longitude values used.
-If <I>lonflip</I>=-1 then the longitude values will be in
-the range from -360 to 0 degrees. If <I>lonflip</I>=0
-then the longitude values will be in
-the range from -180 to 180 degrees. If <I>lonflip</I>=1
-then the longitude values will be in
-the range from 0 to 360 degrees.
-Default: <I>lonflip</I> = 0.
-<DT><B>-M</B>
-
-<DD>
-<I>mode</I>
-<BR>
-
-Sets the manner in which bad beams identified by excessive slope
-are handled.
-<BR> <TT>       </TT><I>mode</I> = 1:<TT>       </TT>Flags one beam associated with each outlier slope.<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT>The flagged beam is the one furthest from the local<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT>median depth.<BR>
-<BR> <TT>       </TT><I>mode</I> = 2:<TT>       </TT>Flags both beams associated with each outlier slope.<BR>
-Default: <I>mode</I> = 1.
-<DT><B>-P</B>
-
-<DD>
-<I>speed_low/speed_high</I>
-<BR>
-
-This option causes <B>mbclean</B> to flag as bad all beams in pings
-associated with platform speed outside the acceptable range from
-<I>speed_low</I> to <I>speed_high</I>. The speed values are specified
-in km/hour.
-<DT><B>-Q</B>
-
-<DD>
-<I>backup</I>
-<BR>
-
-This flag causes <B>mbclean</B> to search for bad "rails" in the
-swath sonar swath; the "rails" refer to groups of outer beams which
-have crosstrack distances (and depths) much less than they should
-have.  These are identified when one or more outer beams lies
-more than <I>backup</I> meters inboard of a more inner beam; all beams
-meeting this criteria are flagged.
-<DT><B>-R</B>
-
-<DD>
-<I>maxheadingrate</I>
-<BR>
-
-The value <I>maxheadingrate</I> is the maximum acceptable rate of change in
-heading in degrees/second. All soundings associated with pings for which the
-heading was changing at a greater rate will be flagged.
-<DT><B>-S</B>
-
-<DD>
-<I>slope/mode/unit</I>
-<BR>
-
-The value <I>slope</I> is the maximum acceptable spike slope.
-If the slope from the preceding beam to this beam exceeds this value,
-and the slope from this beam to subsequent beam exceeds this value but
-with an opposite sign this beam is considered a spike and
-will be flagged or removed according to the
-operational mode specified using the <B>-M</B> option.
-Acrosstrack slopes are determined by the preceding and subsequent beams
-in the same ping. Alongtrack slopes are
-determined from the same beam in the previous and subsequent pings.
-Alongtrack are fairly sensitive to the minimum distance <B>-D</B> option,
-which will normally need to be set less to a very small value for alongtrack slopes
-to be detected. There is no test that alongtrack distances are all in the same direction.
-<P>
-If <I>mode</I> is 1 (default) only acrosstrack spikes are detected.
-If <I>mode</I> is 2 only alongtrack spikes are detected.
-If <I>mode</I> is 3 both along track and across track slopes are checked.
-<P>
-<I>unit</I> is optional and specifies the unit of <I>slope</I>,
-0 (default) indicates the slope is in tangents, 1 slope is in radians,
-2 slope is in degrees.
-A beam is not considered a spike if either the preceding or subsequent beam
-has already been flagged.
-Default: <I>slope</I> = 1.0
-<DT><B>-T</B>
-
-<DD>
-<I>tolerance</I>
-<BR>
-
-If requested this option will reset the timestamps of edit events from an
-existing esf file to exactly match the timestamps of the survey pings. The
-/fItolerance/fP value sets how close timestamps must be in seconds to be
-considered a match. This option handles the case where survey data have been
-processed using non-<B>MB-System</B> software and a user is extracting the
-edits from one set of files with <B>mbgetesf</B> and then applying them to
-another using <B>mbprocess</B>.
-<DT><B>-U</B>
-
-<DD>
-<I>nmin</I>
-<BR>
-
-This flag causes <B>mbclean</B> to search for port or starboard
-halves of pings which contain fewer than <I>nmin</I> good bathymetry
-values. All bathymetry values in the affected half-pings are
-flagged.
-<DT><B>-V</B>
-
-<DD>
-Normally, <B>mbclean</B> works "silently" without outputting
-anything to the stderr stream.  If the
-<B>-V</B> flag is given, then <B>mbclean</B> works in a "verbose" mode and
-outputs the program version being used, all error status messages,
-and the number of beams flagged as bad.
-<DT><B>-W</B>
-
-<DD>
-<I>west/east/south/north</I>
-<BR>
-
-This option causes <B>mbclean</B> to flag as bad all beams in pings
-with navigation outside the specified acceptable bounds. 
-<DT><B>-X</B>
-
-<DD>
-<I>zap_beams</I>
-<BR>
-
-If this option is used, the outermost <I>zap_beams</I> at both ends
-of the swath are flagged as bad; this is useful if the outer beams
-are known to be unreliable. Default: <I>zap_beams</I> = 0.
-<DT><B>-Y</B>
-
-<DD>
-<I>distanceleft/distanceright</I>
-<BR>
-
-This option causes <B>mbclean</B> to flag as bad all beams with
-acrosstrack distances more to port than <I>distanceleft</I>
-and more to starboard than <I>distanceright</I>. The distances
-are defined in meters, and distances to port of nadir are
-negative.
-<DT><B>-Z</B>
-
-<DD>
-<BR>
-
-This option causes <B>mbclean</B> to flag as bad all beams in pings
-with zero longitude and latitude values. 
-<P>
-</DL>
-<A NAME="lbAH"> </A>
-<H2>EXAMPLES</H2>
-
-Suppose one wishes to do a first pass edit of
-six Simrad EM300 files in
-the processing format (format 57). A datalist referencing these
-six files exists as the file datalist.mb-1 and has the contents:
-<BR> <TT>       </TT>0001_20020424_212920.mb57 57<BR>
-<BR> <TT>       </TT>0002_20020425_011607.mb57 57<BR>
-<BR> <TT>       </TT>0003_20020425_022926.mb57 57<BR>
-<BR> <TT>       </TT>0004_20020425_024336.mb57 57<BR>
-<BR> <TT>       </TT>0005_20020425_034057.mb57 57<BR>
-<BR> <TT>       </TT>0006_20020425_045013.mb57 57<BR>
-<BR>
-
-Use the following to flag any
-beams which deviate by more than 20% from the local median
-depth or which produce a slope greater than 3.5 (74 degrees):
-<P>
-<BR> <TT>       </TT>mbclean -Idatalist.mb-1 \<BR>
-<BR> <TT>       </TT><TT>        </TT>-M1 -C3.5 -D0.01/0.20 \<BR>
-<BR> <TT>       </TT><TT>        </TT>-G0.80/1.20<BR>
-<P>
-The program will output flagging statistics for each file and
-give totals at the end. If the <B>-V</B> option is specified,
-<B>mbclean</B> will also output information for each beam that
-is flagged. Here is an example of the nonverbose output:
-<BR>
-
-<BR>
-
-<BR> <TT>       </TT>Processing 0001_20020424_212920.mb57<BR>
-<BR> <TT>       </TT>908 bathymetry data records processed<BR>
-<BR> <TT>       </TT>0 outer beams zapped<BR>
-<BR> <TT>       </TT>0 beams zapped for too few good beams in ping<BR>
-<BR> <TT>       </TT>0 beams out of acceptable depth range<BR>
-<BR> <TT>       </TT>64 beams out of acceptable fractional depth range<BR>
-<BR> <TT>       </TT>0 beams exceed acceptable deviation from median depth<BR>
-<BR> <TT>       </TT>0 bad rail beams identified<BR>
-<BR> <TT>       </TT>1601 excessive slopes identified<BR>
-<TT>        </TT>0 excessive spikes identified<BR>
-<BR> <TT>       </TT>1665 beams flagged<BR>
-<BR> <TT>       </TT>0 beams unflagged<BR>
-<P>
-<BR> <TT>       </TT>Processing 0002_20020425_011607.mb57<BR>
-<BR> <TT>       </TT>259 bathymetry data records processed<BR>
-<BR> <TT>       </TT>0 outer beams zapped<BR>
-<BR> <TT>       </TT>0 beams zapped for too few good beams in ping<BR>
-<BR> <TT>       </TT>0 beams out of acceptable depth range<BR>
-<BR> <TT>       </TT>0 beams out of acceptable fractional depth range<BR>
-<BR> <TT>       </TT>0 beams exceed acceptable deviation from median depth<BR>
-<BR> <TT>       </TT>0 bad rail beams identified<BR>
-<BR> <TT>       </TT>242 excessive slopes identified<BR>
-<TT>        </TT>0 excessive spikes identified<BR>
-<BR> <TT>       </TT>242 beams flagged<BR>
-<BR> <TT>       </TT>0 beams unflagged<BR>
-<P>
-<BR> <TT>       </TT>Processing 0003_20020425_022926.mb57<BR>
-<BR> <TT>       </TT>65 bathymetry data records processed<BR>
-<BR> <TT>       </TT>0 outer beams zapped<BR>
-<BR> <TT>       </TT>0 beams zapped for too few good beams in ping<BR>
-<BR> <TT>       </TT>0 beams out of acceptable depth range<BR>
-<BR> <TT>       </TT>9 beams out of acceptable fractional depth range<BR>
-<BR> <TT>       </TT>0 beams exceed acceptable deviation from median depth<BR>
-<BR> <TT>       </TT>0 bad rail beams identified<BR>
-<BR> <TT>       </TT>497 excessive slopes identified<BR>
-<TT>        </TT>0 excessive spikes identified<BR>
-<BR> <TT>       </TT>506 beams flagged<BR>
-<BR> <TT>       </TT>0 beams unflagged<BR>
-<P>
-<BR> <TT>       </TT>Processing 0004_20020425_024336.mb57<BR>
-<BR> <TT>       </TT>410 bathymetry data records processed<BR>
-<BR> <TT>       </TT>0 outer beams zapped<BR>
-<BR> <TT>       </TT>0 beams zapped for too few good beams in ping<BR>
-<BR> <TT>       </TT>0 beams out of acceptable depth range<BR>
-<BR> <TT>       </TT>0 beams out of acceptable fractional depth range<BR>
-<BR> <TT>       </TT>0 beams exceed acceptable deviation from median depth<BR>
-<BR> <TT>       </TT>0 bad rail beams identified<BR>
-<BR> <TT>       </TT>148 excessive slopes identified<BR>
-<TT>        </TT>0 excessive spikes identified<BR>
-<BR> <TT>       </TT>148 beams flagged<BR>
-<BR> <TT>       </TT>0 beams unflagged<BR>
-<P>
-<BR> <TT>       </TT>Processing 0005_20020425_034057.mb57<BR>
-<BR> <TT>       </TT>252 bathymetry data records processed<BR>
-<BR> <TT>       </TT>0 outer beams zapped<BR>
-<BR> <TT>       </TT>0 beams zapped for too few good beams in ping<BR>
-<BR> <TT>       </TT>0 beams out of acceptable depth range<BR>
-<BR> <TT>       </TT>0 beams out of acceptable fractional depth range<BR>
-<BR> <TT>       </TT>0 beams exceed acceptable deviation from median depth<BR>
-<BR> <TT>       </TT>0 bad rail beams identified<BR>
-<BR> <TT>       </TT>100 excessive slopes identified<BR>
-<TT>        </TT>0 excessive spikes identified<BR>
-<BR> <TT>       </TT>100 beams flagged<BR>
-<BR> <TT>       </TT>0 beams unflagged<BR>
-<P>
-<BR> <TT>       </TT>Processing 0006_20020425_045013.mb57<BR>
-<BR> <TT>       </TT>562 bathymetry data records processed<BR>
-<BR> <TT>       </TT>0 outer beams zapped<BR>
-<BR> <TT>       </TT>0 beams zapped for too few good beams in ping<BR>
-<BR> <TT>       </TT>0 beams out of acceptable depth range<BR>
-<BR> <TT>       </TT>0 beams out of acceptable fractional depth range<BR>
-<BR> <TT>       </TT>0 beams exceed acceptable deviation from median depth<BR>
-<BR> <TT>       </TT>0 bad rail beams identified<BR>
-<BR> <TT>       </TT>41 excessive slopes identified<BR>
-<TT>        </TT>0 excessive spikes identified<BR>
-<BR> <TT>       </TT>41 beams flagged<BR>
-<BR> <TT>       </TT>0 beams unflagged<BR>
-<P>
-<BR> <TT>       </TT>MBclean Processing Totals:<BR>
-<BR> <TT>       </TT>-------------------------<BR>
-<BR> <TT>       </TT>6 total swath data files processed<BR>
-<BR> <TT>       </TT>2456 total bathymetry data records processed<BR>
-<BR> <TT>       </TT>0 total beams flagged in old esf files<BR>
-<BR> <TT>       </TT>0 total beams unflagged in old esf files<BR>
-<BR> <TT>       </TT>0 total beams zeroed in old esf files<BR>
-<BR> <TT>       </TT>0 total outer beams zapped<BR>
-<BR> <TT>       </TT>0 total beams zapped for too few good beams in ping<BR>
-<BR> <TT>       </TT>0 total beams out of acceptable depth range<BR>
-<BR> <TT>       </TT>73 total beams out of acceptable fractional depth range<BR>
-<BR> <TT>       </TT>0 total beams exceed acceptable deviation from median depth<BR>
-<BR> <TT>       </TT>0 total bad rail beams identified<BR>
-<BR> <TT>       </TT>2629 total excessive slopes identified<BR>
-<TT>        </TT>0 total excessive spikes identified<BR>
-<BR> <TT>       </TT>2702 total beams flagged<BR>
-<BR> <TT>       </TT>0 total beams unflagged<BR>
-<P>
-<A NAME="lbAI"> </A>
-<H2>SEE ALSO</H2>
-
-<B><A HREF="mbsystem.html">mbsystem</A></B>(1), <B><A HREF="mbedit.html">mbedit</A></B>(1),
-<B><A HREF="mbinfo.html">mbinfo</A></B>(1) <B><A HREF="mbprocess.html">mbprocess</A></B>(1),
-<P>
-<A NAME="lbAJ"> </A>
-<H2>BUGS</H2>
-
-The algorithms implemented in <B>mbclean</B> simply
-don't detect all bathymetric artifacts that
-are obvious to the eye on contour charts.  Although
-<B>mbclean</B> often does a credible first pass at
-flagging obvious artifacts, we strongly recommend that
-any swath bathymetry processing stream include
-interactive editing of the
-bathymetry data (e.g. <B>mbedit</B>).
-<P>
-
-<HR>
-<A NAME="index"> </A><H2>Index</H2>
-<DL>
-<DT><A HREF="#lbAB">NAME</A><DD>
-<DT><A HREF="#lbAC">VERSION</A><DD>
-<DT><A HREF="#lbAD">SYNOPSIS</A><DD>
-<DT><A HREF="#lbAE">DESCRIPTION</A><DD>
-<DT><A HREF="#lbAF">AUTHORSHIP</A><DD>
-<DT><A HREF="#lbAG">OPTIONS</A><DD>
-<DT><A HREF="#lbAH">EXAMPLES</A><DD>
-<DT><A HREF="#lbAI">SEE ALSO</A><DD>
-<DT><A HREF="#lbAJ">BUGS</A><DD>
-</DL>
-<HR>
-</PRE>
-
-<CENTER><P><BR>
-Last Updated: 14 April 2015</P></CENTER>
-
-<HR>
-<P><A HREF="mbsystem_man_list.html">Return to list of MB-System manual pages...</A></P>
-<P><A HREF="mbsystem_home.html"><IMG SRC="mbsystem_logo_small.gif" BORDER=0 HEIGHT=55 WIDTH=158 ALIGN=BOTTOM></A><A HREF="mbsystem_home.html">Back
-to MB-System Home Page...</A></P>
-
-</BODY>
-</HTML>
diff --git a/src/html/mbcontour.html b/src/html/mbcontour.html
deleted file mode 100644
index 8d8ed59..0000000
--- a/src/html/mbcontour.html
+++ /dev/null
@@ -1,591 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<HTML VERSION="2.0">
-<HEAD>
-   <TITLE>MB-System Unix Manual Page: mbcontour</TITLE>
-<!-- WEBMAGIC VERSION NUMBER="2.0.2" -->
-<!-- WEBMAGIC TRANSLATION NAME="ServerRoot" SRC="/var/www/htdocs/" DST="/" -->
-<!-- WEBMAGIC TRANSLATION NAME="ProjectRoot" SRC="./" DST="" -->
-</HEAD>
-<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#336699" VLINK="#997040" ALINK="#CC9900">
-<BODY>
-<CENTER><H3><U>MB-System Unix Manual Page</U></H3></CENTER>
-<PRE>
-<H1>mbcontour</H1>
-Section:  MB-System 5.0  (1)<BR>Updated:  5 February 2015 <BR><A HREF="#index">Index</A>
-<HR>
-
-<A NAME="lbAB"> </A>
-<H2>NAME</H2>
-
-<B>mbcontour</B> - <B>GMT</B> plug-in module for color fill or color shaded relief
-swath plots of swath sonar data using Postscript.
-<P>
-<A NAME="lbAC"> </A>
-<H2>VERSION</H2>
-
-Version 5.0
-<P>
-<A NAME="lbAD"> </A>
-<H2>SYNOPSIS</H2>
-
-<B>gmt mbcontour</B> <B>-J</B><I>parameters</I> <B>-R</B><I>west/east/south/north
-</I>[<B>-A</B><I>cont_int/col_int/tic_int/lab_int/tic_int/lab_hgt/lab_spacing</I>
-<B>-B</B><I>tickinfo</I> <B>-b</B><I>yr/mo/da/hr/mn/sc</I>
-<B>-C</B><I>contourfile</I> <B>-c</B><I>copies</I>
-<B>-D</B><I>time_tick/time_annot/date_annot/time_tick_len</I>
-<B>-E</B><I>yr/mo/da/hr/mn/sc</I>
-<B>-f</B><I>format</I> <B>-F</B><I>red/green/blue</I> <B>-G</B><I>name_hgt[/name_perp]</I>
-<B>-I</B><I>infile</I> <B>-K</B> <B>-L</B><I>lonflip</I>
-<B>-M</B><I>pingnumber_tick/pingnumber_annot/pingnumber_tick_len</I>
-<B>-N</B><I>nplot</I> <B>-O</B> <B>-P</B> <B>-p</B><I>pings</I>
-<B>-Q</B> <B>-S</B><I>speed </I><B>-T</B><I>timegap</I> <B>-U</B> <B>-W</B> <B>-X</B><I>x-shift</I>
-<B>-Y</B><I>y-shift</I> <B>-Z</B><I>algorithm</I>
-<B>-V -H</B>]
-<P>
-<A NAME="lbAE"> </A>
-<H2>DESCRIPTION</H2>
-
-<B>mbcontour</B> is a plug-in module for plotting bathymetry contours
-from swath sonar data using <B>GMT</B> (Generic Mapping Tools). Like
-<B>mbswath</B>, <B>mbcontour</B> is fully compatible with the <B>GMT</B>
-package version 5. Two contouring
-algorithms are available; the <B>-Z</B> option specifies which is used.
-The first, default approach draws contours between successive pings;
-this algorithm is simple and therefore fast but produces poor
-looking contours when beams from one ping lie "behind" beams from a
-previous ping (this happens for sonars that ping at nonnull pitch
-angles or for the "inside" beams when ships make sharp turns). The
-second algorithm constructs a triangular network from the available
-soundings and contours the network; this approach is complicated
-and therefore slow but produces good looking contours under most
-conditions. The contour levels  and colors can be controlled
-directly or set implicitly using contour and color change intervals.
-Contours can also be set to have ticks pointing downhill.
-<P>
-Shiptracks can also be plotted using the <B>-D</B>, <B>-G</B>, and
-<B>-M</B> options. The <B>-D</B> option controls the basic track
-plotting, including time annotation. The <B>-G</B>
-option causes the start of each swath data file to be annotated with
-the filename. The <B>-M</B> option controls ping number annotation,
-or shot number annotation in the case of segy format seismic data.
-<P>
-Before opening an input swath data file, <B>mbcontour</B> checks for
-an ascii file in the same directory having the same name except
-that ".inf" is appended to the end. The program assumes that this
-ascii file contains the output of the program <B>mbinfo</B> run on
-the input data file. If the ".inf" file exists, <B>mbcontour</B> reads
-the minimum and maximum longitude and latitude bounds from the
-<B>mbinfo</B> output and compares those to the bounds
-for the plot. If the ".inf" file indicates that none of the data
-in the input file lies inside the plot bounds, that input
-file is skipped. This allows users to maintain a single master list
-of data files for use in all plotting without the performance penalty
-of <B>mbcontour</B> reading through all the data files, even those
-with no relevent data. We recommend that users maintain a ".inf"
-file for each swath data file used for gridding or plotting. The
-<B>GMT</B> modules <B>mbswath</B> and <B>mbgrid</B> also use ".inf" files
-in the same fashion.
-<P>
-In order for <B>GMT</B> to successfully execute <B>mbcontour</B>, the
-location of the shared library <I>libmbgmt</I> containing this module must be known to <B>GMT</B>.
-This can be accomplished by either setting the GMT_CUSTOM_LIBS parameter
-in the file gmt.conf that is part of the GMT installation, by setting
-this parameter in the file gmt.conf in the user's home directory, or by
-using the GMT module <B>gmtset</B> to modify this parameter in the
-current working directory. If, for instance, the <I>libmbgmt</I> shared library
-has been installed in the file /usr/lib/libmbgmt.dylib, then the
-GMT_CUSTOM_LIBS parameter in a gmt.conf file can be set to:
-<BR>        GMT_CUSTOM_LIBS = /usr/lib/libmbgmt.dylib
-<P>
-<A NAME="lbAF"> </A>
-<H2>AUTHORSHIP</H2>
-
-David W. Caress (<A HREF="mailto:caress at mbari.org">caress at mbari.org</A>)
-<BR>
-
-<BR>  Monterey Bay Aquarium Research Institute
-<BR>
-
-Dale N. Chayes (<A HREF="mailto:dale at ldeo.columbia.edu">dale at ldeo.columbia.edu</A>)
-<BR>
-
-<BR>  Lamont-Doherty Earth Observatory
-<P>
-<A NAME="lbAG"> </A>
-<H2>OPTIONS</H2>
-
-<DL COMPACT>
-<DT><B>-A</B>
-
-<DD>
-<I>cont_int/col_int/tic_int/lab_int/tic_len/lab_hgt/lab_spacing</I>
-<BR>
-
-If specific contour levels are not specified with the <I>-C</I> option,
-then contours will be
-generated in four colors (black, red, green, and blue) with intervals,
-annotations, and tickmarks controlled by these parameters.  Contours will be
-generated at invervals of <I>cont_int</I> meters.  Color changes
-will occur at intervals of <I>col_int</I> meters.  Contours will have
-downhill facing tickmarks <I>tic_int</I> inches long every <I>tic_int</I>
-meters. Contours will have annotations
-<I>label_len</I> inches high every <I>lab_int</I> meters. The origins of
-contour labels will be separated by at least <I>lab_spacing</I>
-inches (potentially overlapping labels will be omitted);
-if <I>lab_spacing</I> = 0.0 then the spacing will be defined by
-<I>lab_hgt</I>. If fewer than seven parameters are specified, the
-default values are used for the  missing parameters.
-Defaults: <I>cont_int</I> = 25; <I>col_int</I> = 100;
-<I>tic_int</I> = 100; <I>lab_int</I> = 100; <I>tic_int</I> = 0.1;
-<I>lab_hgt</I> = 0.05; <I>lab_spacing</I> = 0.0.
-<DT><B>-B</B>
-
-<DD>
-<I>tickinfo</I>
-<BR>
-
-Sets map boundary tickmark intervals. See <B>psbasemap</B> for details.
-<DT><B>-b</B>
-
-<DD>
-<I>yr/mo/da/hr/mn/sc</I>
-<BR>
-
-Sets the starting time for data allowed in the input data; pings
-with times before the starting time will be ignored.
-Default: <I>yr/mo/da/hr/mn/sc</I> = 1962/2/21/10/30/0.
-<DT><B>-C</B>
-
-<DD>
-<I>contourfile</I>
-<BR>
-
-Sets the file from which the contour levels and their
-style and color are read.
-This file consists of lines in the format:
-<BR>    <I>level label tick red green blue</I>
-<BR>
-
-where <I>level</I> is the depth value to be contoured
-in meters, <I>label</I>
-is either 'a' for annotated or 'n' for not annotated,
-<I>tick</I> is either 't' for tick marks or 'n' for no
-tick marks, and <I>red</I>, <I>green</I>,
-and <I>blue</I> set the color of the contour lines (these values can
-range from 0 to 255). If a GMT cpt file is given as the <I>contourfile</I>,
-the color boundaries specified in the cpt file will be interpreted as
-contour levels to be plotted with unannotated, unticked, black contours.
-If contours are specified using the <B>-C</B> option, then any use
-of the <B>-A</B> option will be ignored.
-<DT><B>-D</B>
-
-<DD>
-<I>time_tick/time_annot/date_annot/time_tick_len</I>
-<BR>
-
-Sets the parameters governing the annotation of the shiptrack.
-Time marks are made with "X" marks along the shiptrack; annotated
-time marks show the time in HH:MM format next to the time mark
-and annotated date marks show the time and julian day in
-HH:MM/DDD format.  The "X" marks are
-<I>time_tick_len</I> inches high for normal time marks and
-1.5 times <I>time_tick_len</I> inches high for annotated time or date
-marks.  The interval of time ticks, annotated time ticks, and
-annotated date ticks are given in hours by
-<I>time_tick</I>, <I>time_annot</I>, and <I>date_annot</I>, respectively.
-Defaults: <I>time_tick</I> = 0.25; <I>time_annot</I> = 1.0;
-<I>date_annot</I> = 4.0; <I>time_tick_len</I> = 0.1.
-<DT><B>-E</B>
-
-<DD>
-<I>yr/mo/da/hr/mn/sc</I>
-<BR>
-
-Sets the ending time for data allowed in the input data; pings
-with times after the ending time will be ignored.
-Default: <I>yr/mo/da/hr/mn/sc</I> = 2062/2/21/10/30/0.
-<DT><B>-f</B>
-
-<DD>
-<I>format</I>
-<BR>
-
-Sets the data format used if the input is read from stdin
-or from a file. If <I>format</I> < 0, then the input file specified
-with the <B>-I</B> option will actually contain a list of input swath sonar
-data files. This program uses the <B>MBIO</B> library
-and will read or write any swath sonar
-format supported by <B>MBIO</B>. A list of the swath sonar data formats
-currently supported by <B>MBIO</B> and their identifier values
-is given in the <B>MBIO</B> manual page. Default: <I>format</I> = -1.
-<DT><B>-F</B>
-
-<DD>
-<I>red/green/blue</I>
-<BR>
-
-Sets the color used for Frame and annotation. [Default is black]
-<DT><B>-G</B>
-
-<DD>
-<I>name_hgt[/name_perp]</I>
-<BR>
-
-Turns on swath file name annotation. The <I>name_hgt</I> parameter
-sets the height of the lettering in inches. By default, the file
-name will be plotted along the shiptrack. If the <I>name_perp</I>
-parameter is given as 1, then the file name will be plotted
-perpendicular to the shiptrack. The <B>-G</B> option implies
-track plotting, so if the <B>-D</B> option is not also specified, then
-track plotting will be turned on with default parameters.
-Default: <I>name_hgt</I> = 0.1.
-<DT><B>-H</B>
-
-<DD>
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-<DT><B>-I</B>
-
-<DD>
-<I>infile</I>
-<BR>
-
-Sets the input filename. If <I>format</I> > 0 (set with the
-<B>-f</B> option) then the swath sonar data contained in <I>infile</I>
-is read and processed. If <I>format</I> < 0, then <I>infile</I>
-is assumed to be an ascii file containing a list of the input swath sonar
-data files to be processed and their formats.  The program will read
-and plot the data in each one of these files.
-In the <I>infile</I> file, each
-data file should be followed by a data format identifier, e.g.:
-<BR>    datafile1 11
-<BR>    datafile2 24
-<BR>
-
-This program uses the <B>MBIO</B> library and will read any swath sonar
-format supported by <B>MBIO</B>. A list of the swath sonar data formats
-currently supported by <B>MBIO</B> and their identifier values
-is given in the <B>MBIO</B> manual page.
-<BR>
-
-An input datafile may be accompanied by a "fast bathymetry" or "fbt" file
-and by a "fast navigation" or "fnv" file. The "fbt" and "fnv" file naming
-convention is to add the
-".fbt" or ".fbt" suffix to the original swath
-data filename.
-An "fbt" file contains only swath bathymetry information
-in a compact format (format 71),
-and is thus quick to read. In the
-event that bathymetry contours
-is being generated, <B>mbcontour</B>
-will attempt to read an "fbt" file in lieu of the original data.
-An "fnv" file contains only navigation information in a compact
-ASCII format (format 166), and is thus even quicker to read.
-When <B>mbcontour</B> is only generating a shiptrack plot, it will
-attempt to read an "fnv" file in lieu of the original data.
-<P>
-<DT><B>-J</B>
-
-<DD>
-Selects the map projection. Scale is inch/degree, 1:xxxxx.
-or width in inches (upper case modifier).
-<BR>
-
-<P>
-<B>CYLINDRICAL PROJECTIONS:</B>
-<BR>
-
-<P>
-<B>-Jc</B><I>lon0/lat0/scale</I> (Cassini)
-<BR>
-
-<B>-Jm</B><I>scale</I> (Mercator)
-<BR>
-
-<B>-Joa</B><I>lon0/lat0/azimuth/scale</I> (Oblique Mercator - point and azimuth)
-<BR>
-
-<B>-Job</B><I>lon0/lat0/lon1/lat1/scale</I> (Oblique Mercator - two points)
-<BR>
-
-<B>-Joc</B><I>lon0/lat0/lonp/latp/scale</I> (Oblique Mercator - point and pole)
-<BR>
-
-<B>-Jq</B><I>lon0/scale</I> (Equidistant Cylindrical Projection (Plate Carree))
-<BR>
-
-<B>-Jt</B><I>lon0/scale</I> (TM - Transverse Mercator)
-<BR>
-
-<B>-Ju</B><I>zone/scale</I> (UTM - Universal Transverse Mercator)
-<BR>
-
-<B>-Jy</B><I>lon0/lats/scale</I> (Basic Cylindrical Projection)
-<BR>
-
-<P>
-<B>AZIMUTHAL PROJECTIONS:</B>
-<BR>
-
-<P>
-<B>-Ja</B><I>lon0/lat0/scale</I> (Lambert).
-<BR>
-
-<B>-Je</B><I>lon0/lat0/scale</I> (Equidistant).
-<BR>
-
-<B>-Jg</B><I>lon0/lat0/scale</I> (Orthographic).
-<BR>
-
-<B>-Js</B><I>lon0/lat0/scale</I> (General Stereographic)
-<BR>
-
-<P>
-<B>CONIC PROJECTIONS:</B>
-<BR>
-
-<P>
-<B>-Jb</B><I>lon0/lat0/lat1/lat2/scale</I> (Albers)
-<BR>
-
-<B>-Jl</B><I>lon0/lat0/lat1/lat2/scale</I> (Lambert)
-<BR>
-
-<P>
-<B>MISCELLANEOUS PROJECTIONS:</B>
-<BR>
-
-<P>
-<B>-Jh</B><I>lon0/scale</I> (Hammer)
-<BR>
-
-<B>-Ji</B><I>lon0/scale</I> (Sinusoidal)
-<BR>
-
-<B>-Jk</B><I>lon0/scale</I> (Eckert VI)
-<BR>
-
-<B>-Jn</B><I>lon0/scale</I> (Robinson)
-<BR>
-
-<B>-Jr</B><I>lon0/scale</I> (Winkel Tripel)
-<BR>
-
-<B>-Jw</B><I>lon0/scale</I> (Mollweide)
-<BR>
-
-<P>
-<B>NON-GEOGRAPHICAL PROJECTIONS:</B>
-<BR>
-
-<P>
-<B>-Jp</B><I>scale</I> (Linear projection for polar (theta,r) coordinates)
-<BR>
-
-<B>-Jx</B><I>x-scale</I>[<B>l|p</B><I>pow</I>][<I>/y-scale</I>[<B>l|p</B><I>pow</I>]] (Linear, log, and power scaling)
-<BR>
-
-More details can be found in the <B>psbasemap</B> manpages.
-<BR>
-
-<DT><B>-K</B>
-
-<DD>
-More <I>PostScript</I> code will be appended later [Default terminates the plot system].
-<DT><B>-L</B>
-
-<DD>
-<I>lonflip</I>
-<BR>
-
-Sets the range of the longitude values returned by the swath sonar i/o routines.
-If <I>lonflip</I>=-1 then the longitude values will be in
-the range from -360 to 0 degrees. If <I>lonflip</I>=0
-then the longitude values will be in
-the range from -180 to 180 degrees. If <I>lonflip</I>=1
-then the longitude values will be in
-the range from 0 to 360 degrees.
-Default: <I>lonflip</I> = 0.
-<DT><B>-M</B>
-
-<DD>
-<I>pingnumber_tick/pingnumber_annot/pingnumber_tick_len</I>
-<BR>
-
-Sets the parameters governing the pingnumber annotation of the shiptrack.
-Tick marks are made along the shiptrack at <I>pingnumber_tick</I> intervals; these
-are <I>time_tick_len</I> inches long. Longer tick marks are made along the
-shiptrack at <I>pingnumber_annot</I> intervals; these are 1.5 times <I>time_tick_len</I>
-inches long.
-Defaults: <I>pingnumber_tick</I> = 50; <I>pingnumber_annot</I> = 100;
-<I>pingnumber_tick_len</I> = 0.1.
-<DT><B>-N</B>
-
-<DD>
-<I>nplot</I>
-Sets the number of pings to be read in before each contouring
-episode. See the description of the <B>-Z</B><I>algorithm</I> option
-for advice on reasonable values
-Default: <I>nplot</I> = 50 unless <B>-Z</B><I>1</I> is specified,
-in which case the default is <I>nplot</I> = 5.
-<DT><B>-O</B>
-
-<DD>
-Selects Overlay plot mode [Default initializes a new plot system].
-<DT><B>-P</B>
-
-<DD>
-Selects Portrait plotting mode [GMT Default is Landscape, see gmtdefaults to change this].
-<DT><B>-p</B>
-
-<DD>
-<I>pings</I>
-<BR>
-
-Sets the ping averaging of the input data. If <I>pings</I> = 1, then
-no ping averaging is performed. If <I>pings</I> > 0, then
-that number of input pings will be averaged to produce one output
-ping.  If <I>pings</I> = 0, then the ping averaging will automatically
-be done so that the along-track ping spacing is equal to the across-track
-beam spacing.
-Default: <I>pings</I> = 1 (no ping averaging).
-<DT><B>-Q</B>
-
-<DD>
-Causes the program to plot the triangles constructed as part of the
-contouring if the "triangle algorithm" is specified using the
-<B>-Z</B><I>1</I> option. This allows the data distribution to be
-directly viewed.
-<DT><B>-R</B>
-
-<DD>
-<I>west/east/south/north</I>
-<BR>
-
-Sets the longitude and latitude bounds within which swath sonar
-data will be read and plotted. Only the data which lies within
-these bounds will be read.
-Default: <I>west</I>=-360, east<I>=360</I>, <I>south</I>=-90, <I>north</I>=90.
-<DT><B>-S</B>
-
-<DD>
-<I>speed</I>
-<BR>
-
-Sets the minimum speed in km/hr (5.5 kts ~ 10 km/hr) allowed in
-the input data; pings associated with a smaller ship speed will not be
-processed. Default: <I>speed</I> = 0.
-<DT><B>-T</B>
-
-<DD>
-<I>timegap</I>
-<BR>
-
-Sets the maximum time gap in minutes between adjacent pings allowed before
-the data is considered to have a gap. Default: <I>timegap</I> = 1.
-<DT><B>-U</B>
-
-<DD>
-Draw Unix System time stamp on plot.  Optionally, append a label, or 'c' which will plot
-the command string.
-<DT><B>-V</B>
-
-<DD>
-Selects verbose mode, which will send progress reports to stderr [Default runs "silently"].
-<DT><B>-W</B>
-
-<DD>
-Normally, <B>mbcontour</B> works with bathymetry values in meters.  If the
-<B>-W</B> flag is given, then <B>mbcontour</B> will contour the bathymetry
-values in feet.
-<DT><B>-X -Y</B>
-
-<DD>
-Shift origin of plot by (<I>x-shift,y-shift</I>) inches  [Default is (1,1) for new plots, (0,0) for overlays].
-<DT><B>-Z</B>
-
-<DD>
-<I>algorithm</I>
-<BR>
-
-Sets the contouring algorithm to be used. If <I>algorithm</I>=0,
-a simple ping to ping contouring approach is used; this algorithm
-is fast but produces poor looking contours when used with data
-where beams from one ping may lie "behind" beams from previous
-pings (this happens for sonars that ping at nonnull pitch
-angles or for the "inside" beams when ships make sharp turns).
-If <I>algorithm</I>=1 then a triangular network is constructed from
-the available soundings and this network is in turn contoured;
-this algorithm is slow but produces good looking contours in
-most cases. It is important to note that the time required for
-"triangle" algorithm increases with the square of the number
-of beams to be contoured; thus it is sensible to keep the number
-of pings contoured at a time small (e.g. use <B>-N</B><I>5</I>).
-The time required for the "ping to ping" algorithm varies linearly
-with the number of pings contoured; thus larger numbers of pings
-may be reasonably contoured at a time (e.g. use <B>-N</B><I>50</I>).
-Default: <I>algorithm</I> = 0.
-<DT><B>-#</B>
-
-<DD>
-Specifies the number of plot copies. [Default is 1]
-</DL>
-<A NAME="lbAH"> </A>
-<H2>EXAMPLES</H2>
-
-Suppose the user has a Hydrosweep data file in the L-DEO in-house
-binary format (<B>MBIO</B> format id 24) called hs_ew9302_161_mn.mb24
-which lies in the region w/s/e/n = -32.1874/-26.6236/54.6349/56.7536.
-The following will suffice to generate a traditional four-color contour plot:
-<BR>    gmt mbcontour -Idatalist -Jm2.44652         -R-25.7252/-23.0683/59.7415/61.0699
-<BR>        -Ba0.5314g0.5314         -A50.0/250.0/250.0/250.0/0.01/0.1         -p1 -P -X1 -Y1 -K -V > mbcontour.ps
-<BR>
-
-where the file datalist contains:
-<BR>    hs_ew9302_161_mn.mb24 24
-<BR>
-
-A plot including a navigation track can also be created using
-<B>mbcontour</B>.  Here the <B>-D</B> flag is used to add a plot
-of the ship track annotated with time marks every 0.25 hours,
-annotated time marks every hour, and day annotations every four hours:
-<BR>    gmt mbcontour -Idatalist -Jm2.44652         -R-25.7252/-23.0683/59.7415/61.0699         -Ba0.5314g0.5314":.File hs_ew9302_161_bmn.mb24:"         -D0.25/1/4/0.1         -A50.0/250.0/250.0/250.0/0.01/0.1        &nbsp [...]
-<P>
-<A NAME="lbAI"> </A>
-<H2>SEE ALSO</H2>
-
-<B><A HREF="mbsystem.html">mbsystem</A></B>(1), <B><A HREF="mbm_plot.html">mbm_plot</A></B>(1), <B><A HREF="mbswath.html">mbswath</A></B>(1),
-<B>gmtsystem</B>(1), <B>psbasemap</B>(1), <B>psto24</B>(1)
-<P>
-<A NAME="lbAJ"> </A>
-<H2>BUGS</H2>
-
-Please let us know.
-<P>
-
-<HR>
-<A NAME="index"> </A><H2>Index</H2>
-<DL>
-<DT><A HREF="#lbAB">NAME</A><DD>
-<DT><A HREF="#lbAC">VERSION</A><DD>
-<DT><A HREF="#lbAD">SYNOPSIS</A><DD>
-<DT><A HREF="#lbAE">DESCRIPTION</A><DD>
-<DT><A HREF="#lbAF">AUTHORSHIP</A><DD>
-<DT><A HREF="#lbAG">OPTIONS</A><DD>
-<DT><A HREF="#lbAH">EXAMPLES</A><DD>
-<DT><A HREF="#lbAI">SEE ALSO</A><DD>
-<DT><A HREF="#lbAJ">BUGS</A><DD>
-</DL>
-<HR>
-</PRE>
-
-<CENTER><P><BR>
-Last Updated: 5 February 2015</P></CENTER>
-
-<HR>
-<P><A HREF="mbsystem_man_list.html">Return to list of MB-System manual pages...</A></P>
-<P><A HREF="mbsystem_home.html"><IMG SRC="mbsystem_logo_small.gif" BORDER=0 HEIGHT=55 WIDTH=158 ALIGN=BOTTOM></A><A HREF="mbsystem_home.html">Back
-to MB-System Home Page...</A></P>
-
-</BODY>
-</HTML>
diff --git a/src/html/mbcopy.html b/src/html/mbcopy.html
deleted file mode 100644
index 3d38f9b..0000000
--- a/src/html/mbcopy.html
+++ /dev/null
@@ -1,316 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<HTML VERSION="2.0">
-<HEAD>
-   <TITLE>MB-System Unix Manual Page: mbcopy</TITLE>
-<!-- WEBMAGIC VERSION NUMBER="2.0.2" -->
-<!-- WEBMAGIC TRANSLATION NAME="ServerRoot" SRC="/var/www/htdocs/" DST="/" -->
-<!-- WEBMAGIC TRANSLATION NAME="ProjectRoot" SRC="./" DST="" -->
-</HEAD>
-<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#336699" VLINK="#997040" ALINK="#CC9900">
-<BODY>
-<CENTER><H3><U>MB-System Unix Manual Page</U></H3></CENTER>
-<PRE>
-<H1>mbcopy</H1>
-Section:  MB-System 5.0  (1)<BR>Updated:  3 June 2013 <BR><A HREF="#index">Index</A>
-<HR>
-
-<A NAME="lbAB"> </A>
-<H2>NAME</H2>
-
-<B>mbcopy</B> - Copy swath sonar bathymetry data files.
-<P>
-<A NAME="lbAC"> </A>
-<H2>VERSION</H2>
-
-Version 5.0
-<P>
-<A NAME="lbAD"> </A>
-<H2>SYNOPSIS</H2>
-
-<B>mbcopy</B> [<B>-B</B><I>yr/mo/da/hr/mn/sc</I> <B>-C</B><I>commentfile</I> <B>-D</B>
-<B>-E</B><I>yr/mo/da/hr/mn/sc</I> <B>-F</B><I>informat[/outformat[/mergeformat]]</I> 
-<B>-H</B> <B>-I</B><I>infilename</I> 
-<B>-L</B><I>lonflip</I> <B>-M</B><I>mergefilename</I> <B>-N</B> <B>-O</B><I>outfilename</I> 
-<B>-P</B><I>pings</I> <B>-Q</B><I>sleep_factor</I> <B>-R</B><I>west/east/south/north</I> 
-<B>-S</B><I>speed</I> <B>-V</B>]
-<P>
-<A NAME="lbAE"> </A>
-<H2>DESCRIPTION</H2>
-
-<B>mbcopy</B> is a utility for copying swath sonar data files which
-may be used to change formats, average pings, or window
-in time and space. <B>mbcopy</B> can be used as a filter from
-stdin to stdout, or it may do i/o to and from files.
-<P>
-<A NAME="lbAF"> </A>
-<H2>AUTHORSHIP</H2>
-
-David W. Caress (<A HREF="mailto:caress at mbari.org">caress at mbari.org</A>)
-<BR>
-
-<BR>  Monterey Bay Aquarium Research Institute
-<BR>
-
-Dale N. Chayes (<A HREF="mailto:dale at ldeo.columbia.edu">dale at ldeo.columbia.edu</A>)
-<BR>
-
-<BR>  Lamont-Doherty Earth Observatory
-<P>
-<A NAME="lbAG"> </A>
-<H2>OPTIONS</H2>
-
-<DL COMPACT>
-<DT><B>-B</B>
-
-<DD>
-<I>yr/mo/da/hr/mn/sc</I>
-<BR>
-
-This option sets the starting time for data allowed in the input data.
-The <B>-E</B> option sets the ending time for data. If the 
-starting time is before the ending time, then any data
-with a time stamp before the starting time or after the
-ending time is ignored. If instead the starting time is
-after the ending time, then any data between the ending
-and starting time will be ignored. This scheme allows time
-windowing both inside and outside a specified interval.
-Default: <I>yr/mo/da/hr/mn/sc</I> = 1962/2/21/10/30/0.
-<DT><B>-C</B>
-
-<DD>
-<I>commentfile</I>
-<BR>
-
-Text file containing comments which are inserted into the
-beginning of the output data stream.  This option is typically
-used to insert a data pedigree statement at the beginning of
-data processing.
-<DT><B>-D</B>
-
-<DD>
-This option only works when the output format is MBLDEOIH (format 71).
-When <B>-D</B> is invoked, <B>mbcopy</B> only outputs swath bathymetry
-data (any amplitude and sidescan data found in the input are ignored).
-The <B>MB-System</B> program <B>mbdatalist</B> uses this option to 
-generate "fast bathymetry" or "fbt" files. See the <B>MB-System</B>
-manual page for information on the use and utility of "fbt" files.
-<DT><B>-E</B>
-
-<DD>
-<I>yr/mo/da/hr/mn/sc</I>
-<BR>
-
-This option sets the ending time for data allowed in the input data.
-The <B>-B</B> option sets the starting time for data. If the 
-starting time is before the ending time, then any data
-with a time stamp before the starting time or after the
-ending time is ignored. If instead the starting time is
-after the ending time, then any data between the ending
-and starting time will be ignored. This scheme allows time
-windowing both inside and outside a specified interval.
-Default: <I>yr/mo/da/hr/mn/sc</I> = 2062/2/21/10/30/0.
-<DT><B>-F</B>
-
-<DD>
-<I>informat[/outformat[/mergeformat]]</I>
-<BR>
-
-Sets the format for the input and output swath sonar data using 
-<B>MBIO</B> integer format identifiers. If only <I>informat</I> is specified,
-then <I>outformat</I> is assumed to be the same. If bathymetry merging is
-specified with the <B>-M</B> option, then the optional <I>mergeformat</I> 
-specifies the format of the merge file.
-This program uses the <B>MBIO</B> library and will read or write any swath sonar
-format supported by <B>MBIO</B>. A list of the swath sonar data formats
-currently supported by <B>MBIO</B> and their identifier values
-is given in the <B>MBIO</B> manual page. When the <I>informat</I> and
-<I>outformat</I> values are both associated with the same swath sonar
-sonar system (e.g. the Atlas Hydrosweep DS system), then the complete
-data stream contained in the input file can be copied to the output
-file.  If the two formats are associated with two different swath sonar
-systems, then only the time stamp, navigation, and beam values will
-be copied.  The use of ping averaging also causes a partial data stream
-to be passed, even when compatible or identical input and output formats
-are specified (see the <B>-P</B> option).
-Default: <I>informat</I> = 11; <I>outformat</I> = 11.
-<DT><B>-H</B>
-
-<DD>
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-<DT><B>-I</B>
-
-<DD>
-<I>infilename</I>
-<BR>
-
-Data file from which the input data will be read. If
-no input file is specified, the input will be read
-from stdin. Default: <I>infilename</I> = stdin.
-<DT><B>-L</B>
-
-<DD>
-<I>lonflip</I>
-<BR>
-
-Sets the range of the longitude values returned.
-If <I>lonflip</I>=-1 then the longitude values will be in
-the range from -360 to 0 degrees. If <I>lonflip</I>=0 
-then the longitude values will be in
-the range from -180 to 180 degrees. If <I>lonflip</I>=1 
-then the longitude values will be in
-the range from 0 to 360 degrees.
-Default: <I>lonflip</I> = 0.
-<DT><B>-M</B>
-
-<DD>
-<I>mergefilename</I>
-<BR>
-
-If a merge file is specified then the bathymetry data and flags
-from the merge file will be written to the output file along with 
-the remaining data from the input file.
-This can be used to merge two processing streams, one for bathymetry
-data and the other for other data sets. The input file and merge file 
-must both be based on the same raw data.
-<DT><B>-N</B>
-
-<DD>
-Normally, <B>mbcopy</B> generates a set of comment records at
-the beginning of the output stream which record when, how,
-and by whom <B>mbcopy</B> was run.  If the
-<B>-N</B> flag is given, these comments are not included in 
-the output stream, and, in addition, any preexisting comment records
-in the input data stream are not passed to the output data stream.
-However, the <B>-N</B> option does not affect the insertion of
-comments from a text file if specified using the <B>-C</B> option.
-<DT><B>-O</B>
-
-<DD>
-<I>outfilename</I>
-<BR>
-
-Data file to which the output data will be written. If
-no output file is specified, the output will be written to
-stdout. Default: <I>outfilename</I> = stdout.
-<DT><B>-P</B>
-
-<DD>
-<I>pings</I>
-<BR>
-
-Sets the ping averaging of the input data. If <I>pings</I> = 1, then
-no ping averaging is performed. If <I>pings</I> > 0, then
-that number of input pings will be averaged to produce one output
-ping.  If <I>pings</I> = 0, then the ping averaging will automatically
-be done so that the along-track ping spacing is equal to the across-track
-beam spacing. If ping averaging is used (<I>pings</I> != 1), then
-only a partial data stream can be copied (see the <B>-F</B> option).
-Default: <I>pings</I> = 1 (no ping averaging).
-<DT><B>-Q</B>
-
-<DD>
-<I>sleep_factor</I>
-<BR>
-
-Causes the program to sleep before writing each data record, thus simulating
-a simple data logger. The amount of time slept is the time between the
-previous and current pings times the value <I>sleep_factor</I>.
-Default: <I>sleep_factor</I> = 1.0
-<DT><B>-R</B>
-
-<DD>
-<I>west/east/south/north</I>
-<BR>
-
-Sets the longitude and latitude bounds within which swath sonar 
-data will be read. Only the data which lies within these bounds will
-be copied. 
-Default: <I>west</I>=-360, east<I>=360</I>, <I>south</I>=-90, <I>north</I>=90.
-<DT><B>-S</B>
-
-<DD>
-<I>speed</I>
-<BR>
-
-Sets the minimum speed in km/hr (5.5 kts ~ 10 km/hr) allowed in 
-the input data; pings associated with a smaller ship speed will not be
-copied. Default: <I>speed</I> = 0.
-<DT><B>-T</B>
-
-<DD>
-<I>timegap</I>
-<BR>
-
-Sets the maximum time gap in minutes between adjacent pings allowed before
-the data is considered to have a gap. Default: <I>timegap</I> = 1.
-<DT><B>-V</B>
-
-<DD>
-Normally, <B>mbcopy</B> works "silently" without outputting
-anything to the stderr stream.  If the
-<B>-V</B> flag is given, then <B>mbcopy</B> works in a "verbose" mode and
-outputs the program version being used, all error status messages, 
-and the number of records input and output.
-<P>
-</DL>
-<A NAME="lbAH"> </A>
-<H2>EXAMPLES</H2>
-
-Suppose one wishes to copy a raw Hydrosweep file (format 21) called hs_raw into a
-L-DEO binary Hydrosweep file (format 24) called hs_binary while windowing the data
-into a region between 145W and 140W longitude and between 10S and 5S
-longitude. The following will suffice:
-<BR> <TT>       </TT>mbcopy -P1 -F21/24 -R-145/-140/-10/-5 -Ihs_raw -Ohs_binary<BR>
-<P>
-Suppose one has a program called thrash_prog which requires Hydrosweep
-data to be input in the URI format (format 23) to stdin, but the existing
-data is in a raw Hydrosweep file (format 21).  The following will work:
-<BR> <TT>       </TT>mbcopy -P1 -F21/23 | thrash_prog<BR>
-<P>
-where a pipe (|) has been used to direct the stdout stream from <B>mbcopy</B>
-to the stdin stream of thrash_prog.
-<P>
-Suppose one has some raw data from a Simrad EM300 that has been cleaned and processed
-by a third party using other software and exported as a GSF file, but one wants to 
-access the original Simrad attitude and backscatter data with the corrected bathymetry 
-data.  The following will work:
-<BR> <TT>       </TT>mbcopy -F56/57/121 -I0015_20040212_052714_raw.all -M20040212_052714.gsf -O20040212_052714.mb57<BR>
-<P>
-<A NAME="lbAI"> </A>
-<H2>SEE ALSO</H2>
-
-<B><A HREF="mbsystem.html">mbsystem</A></B>(1), <B><A HREF="mbio.html">mbio</A></B>(1)
-<P>
-<A NAME="lbAJ"> </A>
-<H2>BUGS</H2>
-
-Certainly.
-<P>
-
-<HR>
-<A NAME="index"> </A><H2>Index</H2>
-<DL>
-<DT><A HREF="#lbAB">NAME</A><DD>
-<DT><A HREF="#lbAC">VERSION</A><DD>
-<DT><A HREF="#lbAD">SYNOPSIS</A><DD>
-<DT><A HREF="#lbAE">DESCRIPTION</A><DD>
-<DT><A HREF="#lbAF">AUTHORSHIP</A><DD>
-<DT><A HREF="#lbAG">OPTIONS</A><DD>
-<DT><A HREF="#lbAH">EXAMPLES</A><DD>
-<DT><A HREF="#lbAI">SEE ALSO</A><DD>
-<DT><A HREF="#lbAJ">BUGS</A><DD>
-</DL>
-<HR>
-</PRE>
-
-<CENTER><P><BR>
-Last Updated: 3 June 2013</P></CENTER>
-
-<HR>
-<P><A HREF="mbsystem_man_list.html">Return to list of MB-System manual pages...</A></P>
-<P><A HREF="mbsystem_home.html"><IMG SRC="mbsystem_logo_small.gif" BORDER=0 HEIGHT=55 WIDTH=158 ALIGN=BOTTOM></A><A HREF="mbsystem_home.html">Back
-to MB-System Home Page...</A></P>
-
-</BODY>
-</HTML>
diff --git a/src/html/mbctdlist.html b/src/html/mbctdlist.html
deleted file mode 100644
index 2cc5320..0000000
--- a/src/html/mbctdlist.html
+++ /dev/null
@@ -1,281 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<HTML VERSION="2.0">
-<HEAD>
-   <TITLE>MB-System Unix Manual Page: mbctdlist</TITLE>
-<!-- WEBMAGIC VERSION NUMBER="2.0.2" -->
-<!-- WEBMAGIC TRANSLATION NAME="ServerRoot" SRC="/var/www/htdocs/" DST="/" -->
-<!-- WEBMAGIC TRANSLATION NAME="ProjectRoot" SRC="./" DST="" -->
-</HEAD>
-<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#336699" VLINK="#997040" ALINK="#CC9900">
-<BODY>
-<CENTER><H3><U>MB-System Unix Manual Page</U></H3></CENTER>
-<PRE>
-<H1>mbctdlist</H1>
-Section:  MB-System 5.0  (1)<BR>Updated:  3 June 2013 <BR><A HREF="#index">Index</A>
-<HR>
-
-<A NAME="lbAB"> </A>
-<H2>NAME</H2>
-
-<B>mbctdlist</B> - List CTD data in swath sonar data files.
-<P>
-<A NAME="lbAC"> </A>
-<H2>VERSION</H2>
-
-Version 5.0
-<P>
-<A NAME="lbAD"> </A>
-<H2>SYNOPSIS</H2>
-
-<B>mbctdlist</B> [<B>-A</B> <B>-D</B><I>decimate</I> <B>-F</B><I>format</I>
-<B>-G</B><I>delimeter</I> <B>-H</B> <B>-I</B><I>file </I>
-<B>-O</B><I>output_format</I> <B>-V</B> <B>-Z</B><I>segment</I>]
-<P>
-<A NAME="lbAE"> </A>
-<H2>DESCRIPTION</H2>
-
-<B>MBctdlist</B> prints the specified contents of CTD records
-in a swath sonar data file to stdout. CTD stands for conductivity,
-temperature, and depth (pressure). Some seafoor mapping sonar platforms
-(e.g. ROVs or AUVs) carry CTDs. The CTD data may be included in the
-sonar data stream to enable calculation of water sound speed for use
-in sonar settings and/or data processing. In addition to the raw
-conductivity (S/m), temperature (degree C), and pressure (dBar) data,
-salinity (ppu), depth (m), and water sound speed (m/s) are typically
-available by calculation.<B>MBctdlist</B> can also output navigation
-and time stamp values. By default, <B>mbctdlist</B>  produces ASCII files in
-spreadsheet style, with data columns separated by tabs. Alternatively,
-other column delimiters can be used (<B>-G</B> option), or
-the output can be binary, with each field represented
-as a double precision float (<B>-A</B> option). The
-option <B>-O</B><I>output_format</I> is
-used to control the data types that are sent to stdout. The output stream can
-be decimated using the <B>-D</B> option. The output of
-<B>mbctdlist</B> can be piped to plotting and data analysis programs.
-<P>
-<A NAME="lbAF"> </A>
-<H2>AUTHORSHIP</H2>
-
-David W. Caress (<A HREF="mailto:caress at mbari.org">caress at mbari.org</A>)
-<BR>
-
-<BR>  Monterey Bay Aquarium Research Institute
-<BR>
-
-Dale N. Chayes (<A HREF="mailto:dale at ldeo.columbia.edu">dale at ldeo.columbia.edu</A>)
-<BR>
-
-<BR>  Lamont-Doherty Earth Observatory
-<BR>
-
-<P>
-<A NAME="lbAG"> </A>
-<H2>OPTIONS</H2>
-
-<DL COMPACT>
-<DT><B>-A</B>
-
-<DD>
-<BR>
-
-Causes the output to be binary (native double precision floating
-point) rather than ASCII. Some
-output options cannot be represented as single binary floats (e.g.
-time strings and longitude or latitude broken into degrees
-and minutes. These values are output as multiple fields as
-appropriate.
-Default: ASCII output with fields separated by tabs.
-<DT><B>-D</B>
-
-<DD>
-<I>decimate</I>
-<BR>
-
-Sets the decimation of the output data. By default (i.e. <I>decimate</I>=1),
-every available data record is output. If <I>decimate</I>>1, then only
-every "<I>decimate</I>"th record will be output. Default: <I>decimate</I>=1.
-<DT><B>-F</B>
-
-<DD>
-<I>format</I>
-<BR>
-
-Sets the format for the input swath sonar data using
-<B>MBIO</B> integer format identifiers.
-This program uses the <B>MBIO</B> library and will read any swath sonar
-format supported by <B>MBIO</B>. A list of the swath sonar data formats
-currently supported by <B>MBIO</B> and their identifier values
-is given in the <B>MBIO</B> manual page. Default: <I>format</I> = 11.
-<DT><B>-G</B>
-
-<DD>
-<I>delimiter</I>
-<BR>
-
-Sets the character(s) used to separate output fields when ascii
-columns are output. Default: tabs are used as delimiters.
-<DT><B>-H</B>
-
-<DD>
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-<DT><B>-I</B>
-
-<DD>
-<I>file</I>
-<BR>
-
-Sets the input filename. If <I>format</I> > 0 (set with the
-<B>-F</B> option) then the swath sonar data contained in <I>file</I>
-is read and processed. If <I>format</I> < 0, then <I>file</I>
-is assumed to be an ascii file containing a list of the input swath sonar
-data files to be processed and their formats.  The program will read
-the data in each one of these files.
-In the <I>file</I> file, each
-data file should be followed by a data format identifier, e.g.:
-<BR> <TT>       </TT>datafile.mb88 88<BR>
-<BR> <TT>       </TT>datafile.mb88 88<BR>
-<BR>
-
-This program uses the <B>MBIO</B> library and will read any swath sonar
-format supported by <B>MBIO</B>. However, only files in formats supporting
-CTD data will contain relevant data and produce an output.
-A list of the swath sonar data formats
-currently supported by <B>MBIO</B> and their identifier values
-is given in the <B>MBIO</B> manual page.
-Default: <I>file</I> = "datalist.mb-1".
-<DT><B>-L</B>
-
-<DD>
-<I>lonflip</I>
-<BR>
-
-Sets the range of the longitude values returned.
-If <I>lonflip</I>=-1 then the longitude values will be in
-the range from -360 to 0 degrees. If <I>lonflip</I>=0
-then the longitude values will be in
-the range from -180 to 180 degrees. If <I>lonflip</I>=1
-then the longitude values will be in
-the range from 0 to 360 degrees.
-Default: <I>lonflip</I> = 0.
-<DT><B>-O</B>
-
-<DD>
-<I>output_format</I>
-<BR>
-
-Determines the form of the output. <I>Output_format</I> is a string composed
-of one or more of the following characters:
-<P>
-<BR> <TT>       </TT><B>C</B>  for conductivity (S/m)<BR>
-<BR> <TT>       </TT><B>^C</B> for sonar altitude (meters)<BR>
-<BR> <TT>       </TT><B>c</B>  for temperature (degree C)<BR>
-<BR> <TT>       </TT><B>^c</B> for sonar depth (meters)<BR>
-<BR> <TT>       </TT><B>H</B>  for heading (degrees)<BR>
-<BR> <TT>       </TT><B>h</B>  for course made good (degrees)<BR>
-<BR>  <TT>      </TT><B>J</B>  for a time string (yyyy jd hh mm ss.ssssss)<BR>
-<BR>                 where jd is the julian day of the year
-<BR>  <TT>      </TT><B>j</B>  for a time string (yyyy jd dm ss.ssssss)<BR>
-<BR>                 where jd is the julian day of the year
-<BR>                 and dm is the minute of the day
-<BR> <TT>       </TT><B>L</B>  for cumulative along-track distance (km)<BR>
-<BR> <TT>       </TT><B>l</B>  for cumulative along-track distance (m)<BR>
-<BR> <TT>       </TT><B>M</B>  for unix time in decimal seconds since 1/1/70 00:00:00<BR>
-<BR> <TT>       </TT><B>m</B>  for time in decimal seconds since first record<BR>
-<BR>  <TT>      </TT><B>P</B>  for potential temperature (degree)<BR>
-<BR>  <TT>      </TT><B>S</B>  for salinity (ppu)<BR>
-<BR>  <TT>      </TT><B>^S</B> for speed (km/hr)<BR>
-<BR>  <TT>      </TT><B>s</B>  for water sound speed (m/s)<BR>
-<BR>  <TT>      </TT><B>^s</B> for speed made good (km/hr)<BR>
-<BR>  <TT>      </TT><B>T</B>  for a time string (yyyy/mm/dd/hh/mm/ss)<BR>
-<BR> <TT>       </TT><B>t</B>  for a time string (yyyy mm dd hh mm ss)<BR>
-<BR> <TT>       </TT><B>U</B>  for unix time in integer seconds since 1/1/70 00:00:00<BR>
-<BR> <TT>       </TT><B>u</B>  for time in integer seconds since first record<BR>
-<BR> <TT>       </TT><B>V</B>  for ping interval (decimal seconds)<BR>
-<BR> <TT>       </TT><B>X</B>  for longitude (decimal degrees)<BR>
-<BR> <TT>       </TT><B>x</B>  for longitude (degrees + decimal minutes + E/W)<BR>
-<BR> <TT>       </TT><B>Y</B>  for latitude (decimal degrees)<BR>
-<BR> <TT>       </TT><B>y</B>  for latitude (degrees + decimal minutes + N/S)<BR>
-<P>
-Default <I>output_format</I> = <B>TXYCc^cSs</B> (Time, lon, lat, conductivity,
-temperature, depth, salinity, sound speed).
-<DT><B>-V</B>
-
-<DD>
-Normally, <B>mbctdlist</B> works "silently" without outputting
-anything to the stderr stream.  If the
-<B>-V</B> flag is given, then <B>mbctdlist</B> works in a "verbose" mode and
-outputs the program version being used and all error status messages.
-<DT><B>-Z</B>
-
-<DD>
-<I>segment</I>
-<BR>
-
-Causes the ascii output of different input swath files
-(e.g. when a datalist is specified with the <B>-I</B> option)
-to be separated by lines with <I>segment</I>. If <I>segment</I>
-is a single character, then the output is a multiple segment
-file of the sort accepted by the <B>GMT</B> program <B>psxy</B>.
-This option only works with ascii output, and is thus disabled
-when the <B>-A</B> option is specified. The most common usage
-is <B>-Z</B>I>.
-<P>
-</DL>
-<A NAME="lbAH"> </A>
-<H2>EXAMPLES</H2>
-
-Suppose one wishes to obtain a ctd list from a Reson 7125 data file
-in the 7k format (MBIO id 88) called 20080904_231809p.mb88. To
-obtain a listing with time in unix second forms followed
-by longitude, latitude, and salinity, the following will suffice:
-<P>
-<BR> <TT>       </TT>mbctdlist -i 20080904_231809p.mb88 -OMXYS | more<BR>
-<P>
-The output will be as follows:
-<P>
-<BR> <TT>       </TT>1220570288.486000       -129.066699       47.997246     34.305<BR>
-<BR> <TT>       </TT>1220570288.685999       -129.066702       47.997245     34.304<BR>
-<BR> <TT>       </TT>1220570288.885999       -129.066706       47.997244     34.305<BR>
-<BR> <TT>       </TT>1220570289.086000       -129.066710       47.997243     34.305<BR>
-<BR> <TT>       </TT>1220570289.286000       -129.066713       47.997242     34.304<BR>
-<BR> <TT>       </TT>.....<BR>
-<P>
-<A NAME="lbAI"> </A>
-<H2>SEE ALSO</H2>
-
-<B><A HREF="mbsystem.html">mbsystem</A></B>(1), <B><A HREF="mbinfo.html">mbinfo</A></B>(1)
-<P>
-<A NAME="lbAJ"> </A>
-<H2>BUGS</H2>
-
-<B>mbctdlist</B> initially only works with data in the MBF_RESON7KR format (MBIO format id 88)
-supporting Reson 7k series multibeam sonars.
-<P>
-
-<HR>
-<A NAME="index"> </A><H2>Index</H2>
-<DL>
-<DT><A HREF="#lbAB">NAME</A><DD>
-<DT><A HREF="#lbAC">VERSION</A><DD>
-<DT><A HREF="#lbAD">SYNOPSIS</A><DD>
-<DT><A HREF="#lbAE">DESCRIPTION</A><DD>
-<DT><A HREF="#lbAF">AUTHORSHIP</A><DD>
-<DT><A HREF="#lbAG">OPTIONS</A><DD>
-<DT><A HREF="#lbAH">EXAMPLES</A><DD>
-<DT><A HREF="#lbAI">SEE ALSO</A><DD>
-<DT><A HREF="#lbAJ">BUGS</A><DD>
-</DL>
-<HR>
-</PRE>
-
-<CENTER><P><BR>
-Last Updated: 3 June 2013</P></CENTER>
-
-<HR>
-<P><A HREF="mbsystem_man_list.html">Return to list of MB-System manual pages...</A></P>
-<P><A HREF="mbsystem_home.html"><IMG SRC="mbsystem_logo_small.gif" BORDER=0 HEIGHT=55 WIDTH=158 ALIGN=BOTTOM></A><A HREF="mbsystem_home.html">Back
-to MB-System Home Page...</A></P>
-
-</BODY>
-</HTML>
diff --git a/src/html/mbdatalist.html b/src/html/mbdatalist.html
deleted file mode 100644
index 00a0daf..0000000
--- a/src/html/mbdatalist.html
+++ /dev/null
@@ -1,483 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<HTML VERSION="2.0">
-<HEAD>
-   <TITLE>MB-System Unix Manual Page: mbdatalist</TITLE>
-<!-- WEBMAGIC VERSION NUMBER="2.0.2" -->
-<!-- WEBMAGIC TRANSLATION NAME="ServerRoot" SRC="/var/www/htdocs/" DST="/" -->
-<!-- WEBMAGIC TRANSLATION NAME="ProjectRoot" SRC="./" DST="" -->
-</HEAD>
-<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#336699" VLINK="#997040" ALINK="#CC9900">
-<BODY>
-<CENTER><H3><U>MB-System Unix Manual Page</U></H3></CENTER>
-<PRE>
-<H1>mbdatalist</H1>
-Section:  MB-System 5.0  (1)<BR>Updated:  3 June 2013 <BR><A HREF="#index">Index</A>
-<HR>
-
-<A NAME="lbAB"> </A>
-<H2>NAME</H2>
-
-<B>mbdatalist</B> - parses recursive datalist files and outputs the
-complete list of data files, formats, and file weights.
-<P>
-<A NAME="lbAC"> </A>
-<H2>VERSION</H2>
-
-Version 5.0
-<P>
-<A NAME="lbAD"> </A>
-<H2>SYNOPSIS</H2>
-
-<B>mbdatalist</B> [<B>-C</B> <B>-F</B><I>format</I> <B>-I</B><I>filename</I> <B>-N -O -P -Q -R -S -U -Y -Z -V -H</B>]
-<P>
-<A NAME="lbAE"> </A>
-<H2>DESCRIPTION</H2>
-
-<B>MBdatalist</B> is a utility for parsing datalist files.
-Datalist files, or lists of swath data files and their format ids,
-are used by a number
-of <B>MB-System</B> programs. These lists may contain references
-to other datalists, making them recursive. See the <B>MB-System</B>
-manual page for details on the format and structure of datalists.
-The program <B>mbdatalist</B> outputs each
-swath data filename, format id, and file
-weight encountered as it descends through the input datalist tree. If a
-swath data file rather than a datalist is provided as input, the
-same swath data filename and format will be the sole output.
-<P>
-This program
-can be used in shellscripts to read datalists in the same fashion
-as <B>MB-System</B> programs like <B>mbgrid</B> and <B>mbprocess</B>.
-This program can also be used to check and debug complex recursive
-datalist structures.
-<P>
-The program <B>mbprocess</B> operates on "raw" swath data files,
-producing a "processed" swath data file (see the <B>mbprocess</B> man
-page for explanation).
-The <B>MB-System</B> algorithm for reading datalists will,
-if a flag is set, replace a swath file name with the associated
-"processed" file name when that "processed" file exists. This
-flag may be set by embedding "$PROCESSED" as a line in a datalist
-or it may be set first by the calling program. The flag may also
-be set to preclude reporting "processed" file names (embedding "$RAW"
-in a datalist accomplishes this). When setting this flag within
-datalists, the first encounter of a $PROCESSED or $RAW tag will
-prevail over later instances of either tag. The <B>-P</B> and <B>-U</B>
-options force <B>mbdatalist</B> to output processed file names
-when they exist (<B>-P</B>) or to only output unprocessed
-(raw) file names (<B>-U</B>).
-<P>
-Programs such as <B>mbgrid</B> try to check statistics or "inf"
-files to see if the corresponding data files include data within
-the specified geographic bounds. Other programs look for
-"fast bathymetry" or "fast navigation" ("fbt" or "fnv") files
-in order to read the data more quickly. The <B>-N</B> option causes
-<B>mbdatalist</B> to create these three types of ancillary files
-for each swath data file. The <B>-O</B> option causes <B>mbdatalist</B>
-to create the "inf", "fbt", and "fnv" files only when they don't
-already exist or are out of date (older than the data file).
-<P>
-Datalists may also contain a third value, called the grid
-weight, which is used by <B>mbgrid</B> to priortize data.
-The larger the grid weight, the more importance <B>mbgrid</B>
-attaches to the related bathymetry data. Grid weights can
-be applied to datalist entries which are themselves datalist
-files, causing these weights to be associated with all of
-files referenced therein. However, the default behavior is
-for any grid weight in a particular datalist entry to override
-values derived from higher levels in the recursive structure.
-This behavior can be reversed if a $NOLOCALWEIGHT tag is placed
-in the datalist, or in a datalist higher up in the structure.
-See the <B>MB-System</B> manual page for a more complete
-description.
-<P>
-The <B>-R</B><I>w/e/s/n</I> option causes the program to check each
-data file with an "inf" file for overlap with the desired bounds,
-and only report those files with data in the desired area (or no
-"inf" file to check). This behavior mimics that of <B>mbgrid</B>,
-allowing users to check what data files will contribute to gridding
-some particular area.
-<P>
-The <B>-Q</B> option causes the program to check each data file for
-the existence of any ancillary files (e.g. navigation files, edit
-save files, etc.) referenced in its mbprocess parameter file
-(if the parameter file exists). The program will list any problem
-found with the processing parameters, and will also list any
-data problem noted in the "inf" files. The possible data problems
-include:
-<BR>        No survey data found
-<BR>        Zero longitude or latitude in survey data
-<BR>        Instantaneous speed exceeds 25 km/hr
-<BR>        Average speed exceeds 25 km/hr
-<BR>        Sounding depth exceeds 11000 m
-<BR>        Unsupported Simrad datagram
-<P>
-The <B>-Z</B> option causes the program to generate a datalist file
-named "datalistp.mb-1" and then exit. This datalist has the following form:
-<BR>
-
-<BR> <TT>       </TT>$PROCESSED<BR>
-<BR> <TT>       </TT>datalist.mb-1 -1<BR>
-<BR>
-
-This file is a commonly used convenience because it allows users to easily
-reference the swath files listed (directly or recursively) through
-the datalist "datalist.mb-1" with the $PROCESSED flag on. So, in order to
-grid the processed bathymetry rather than the raw bathymetry, run <B>mbgrid</B>
-with "datalistp.mb-1" as the input rather than "datalist.mb-1".
-<P>
-The <B>-S</B> option causes <B>mbdatalist</B> to report the status of the files
-it lists, including whether the file is up to date or needs reprocessing,
-and if the file is locked. <B>MBprocess</B> sets locks while operating on
-a swath file to prevent other instances of <B>mbprocess</B> from simultaneously
-operating on that same file. This allows one to run <B>mbprocess</B> multiple
-times simultaneously on a single datalist, either on a single multiprocessor
-machine or on multiple computers mounting the same filesystem.
-The consists of creating a small text file
-named by appending ".lck" to the swath filename; while this file exists
-other programs will not modify the locked file. The locking program deletes
-the lock file when it is done. Orphaned lock files may be left if <B>mbprocess</B>
-crashes or is interrupted. These will prevent reprocessing by <B>mbprocess</B>,
-but can be both detected with the <B>-S</B> option and removed using the <B>-Y</B> option.
-<P>
-Finally, this program can be used to copy the swath files referenced in a
-datalist structure to a single directory and to create a datalist there
-(names "datalist.mb-1") that references those swath files. This is
-accomplished using the <I>-C</I> option. The <I>-C</I> copy function will
-not be done if the <I>-N</I>, <I>-O</I>, or <I>-Q</I> options are specified,
-but is compatible with the <I>-P</I>, <I>-R</I>, and <I>-U</I> options.
-<P>
-<A NAME="lbAF"> </A>
-<H2>AUTHORSHIP</H2>
-
-David W. Caress (<A HREF="mailto:caress at mbari.org">caress at mbari.org</A>)
-<BR>
-
-<BR>  Monterey Bay Aquarium Research Institute
-<BR>
-
-Dale N. Chayes (<A HREF="mailto:dale at ldeo.columbia.edu">dale at ldeo.columbia.edu</A>)
-<BR>
-
-<BR>  Lamont-Doherty Earth Observatory
-<P>
-<A NAME="lbAG"> </A>
-<H2>OPTIONS</H2>
-
-<DL COMPACT>
-<DT><B>-C</B>
-
-<DD>
-<BR>
-
-Causes the swath files referenced in the input datalist structure to be
-copied to the current directory and creates a datalist
-(names "datalist.mb-1") that references the copied swath files.
-The copy function will not be done if the <I>-N</I>, <I>-O</I>, or <I>-Q</I> options are specified.
-If the <I>-P</I>, <I>-R</I>, and <I>-U</I> options are specified these
-functions will modify which swath files are copied. Any ancilliary files
-(e.g. *inf metadata files) will also be copied, but processed data
-files derived from the target copied files will not be copied.
-<DT><B>-F</B>
-
-<DD>
-<I>format</I>
-<BR>
-
-Sets the data format associated with the datalist or swath data
-file specified with the <B>-I</B> option. By default, this program
-will attempt to determine the format from the input file suffix
-(e.g. a file ending in .mb57 has a format id of 57, and a file
-ending in .mb-1 has a format id of -1). A datalist has a format id
-of -1.
-<DT><B>-H</B>
-
-<DD>
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-<DT><B>-I</B>
-
-<DD>
-<I>filename</I>
-<BR>
-
-Sets the input filename. If <I>format</I> > 0 (set with the
-<B>-f</B> option) then the swath data filename specified by <I>infile</I>
-is output along with its format and a file weight of 1.0.
-If <I>format</I> < 0, then <I>infile</I>
-is treated as a datalist file containing a list of the input swath sonar
-data files to be processed and their formats.  The program will parse
-the datalist (recursively, if necessary) and output each swath filename
-and the associated format and file weight.
-<DT><B>-N</B>
-
-<DD>
-This argument causes <B>MBdatalist</B> to generate three types of ancillary
-data files ("inf", "fbt", and "fnv").
-In all cases,
-the ancillary filenames are just the original filename with
-".inf", ".fbt", or ".fnv" appended on the end.
-<B>MB-System</B> makes use of ancillary data files in a number
-of instances. The most prominent ancillary files are metadata or
-"inf" files (created from the output of <B>mbinfo</B>).
-Programs such as <B>mbgrid</B> and <B>mbm_plot</B> try to check "inf"
-files to see if the corresponding data files include data within
-desired areas. Additional ancillary files are used to speed
-plotting and gridding functions. The "fast bath" or "fbt" files
-are generated by copying the swath bathymetry to a sparse,
-quickly read format (format 71). The "fast nav" or "fnv" files
-are just ASCII lists of navigation generated using <B>mblist</B>
-with a <B>-O</B><I>tMXYHSc</I> option. Programs such as <B>mbgrid</B>,
-<B>mbswath</B>, and <B>mbcontour</B> will try to read "fbt" and "fnv" files
-instead of the full data files whenever only bathymetry or
-navigation information are required.
-<DT><B>-O</B>
-
-<DD>
-This argument causes <B>MBdatalist</B> to generate the three ancillary
-data files ("inf", "fbt", and "fnv") if
-these files don't already exist or are out of date.
-<DT><B>-P</B>
-
-<DD>
-Normally, <B>mbdatalist</B> allows $PROCESSED and $RAW tags within
-the datalist files to determine whether processed file names are
-reported when available ($PROCESSED) or only raw file names are
-reported ($RAW). The <B>-P</B> option forces <B>mbdatalist</B>
-to output processed file names when they exist.
-<DT><B>-Q</B>
-
-<DD>
-This option causes the program to check each
-data file for the existence of any ancillary files
-referenced in its mbprocess parameter file
-(if the parameter file exists). The relevant ancillary
-files include edit save files generated by <B>mbedit</B>
-or <B>mbclean</B>, navigation files generated by <B>mbnavedit</B>
-or <B>mbnavadjust</B>, tide files, and svp files. An error message
-is output for each missing ancillary file.
-<DT><B>-R</B>
-
-<DD>
-<I>w/e/s/n</I>
-<BR>
-
-The bounds of the desired area are set in longitude
-and latitude using w=west, e=east, s=south, and n=north.
-This option causes the program to check each
-data file with an "inf" file for overlap with
-the desired bounds, and only report those
-files with data in the desired area (or no
-"inf" file to check). This behavior mimics that of
-<B>mbgrid</B>, allowing users to check what data files will
-contribute to gridding some particular area.
-<DT><B>-S</B>
-
-<DD>
-This option causes <B>mbdatalist</B> to report the status of the files
-it lists, including whether the file is up to date or needs reprocessing,
-and if the file is locked. <B>MBprocess</B> sets locks while operating on
-a swath file to prevent other instances of <B>mbprocess</B> from simultaneously
-operating on that same file. Locking consists of creating a small text file
-named by appending ".lck" to the swath filename; while this file exists
-other programs will not modify the locked file. The locking program deletes
-the lock file when it is done. Orphaned lock files may be left if <B>mbprocess</B>
-crashes or is interrupted. These will prevent reprocessing by <B>mbprocess</B>,
-but can be both detected and removed using <B>mbdatalist</B>.
-<DT><B>-U</B>
-
-<DD>
-Normally, <B>mbdatalist</B> allows $PROCESSED and $RAW tags within
-the datalist files to determine whether processed file names are
-reported when available ($PROCESSED) or
-only (raw) unprocessed file names are
-reported ($RAW). The <B>-U</B> option forces <B>mbdatalist</B>
-to only output raw file names.
-<DT><B>-V</B>
-
-<DD>
-Normally, <B>mbdatalist</B> only prints out the filenames and formats.
-If the <B>-V</B> flag is given, then <B>mbinfo</B> works in a "verbose" mode and
-outputs the program version being used.
-<DT><B>-Y</B>
-
-<DD>
-This option causes <B>mbdatalist</B> to remove any processing locks on files
-it parses. <B>MBprocess</B> and other programs may set locks while
-operating on a swath file to prevent other programs from simultaneously
-operating on that same file.The consists of creating a small text file
-named by appending ".lck" to the swath filename; while this file exists
-other programs will not modify the locked file. The locking program deletes
-the lock file when it is done. Orphaned lock files may be left if <B>MB-System</B>
-programs crash or are interrupted. These can be detected using the <B>-S</B>
-option of <B>mbdatalist</B>.
-<DT><B>-Z</B>
-
-<DD>
-The <B>-Z</B> option causes the program to generate a datalist file that
-will first set a $PROCESSED flag and then reference the input
-file specified using the <B>-I</B><I>filename</I> option.
-The output datalist is named
-by adding a "p.mb-1" suffix to the root of the input file (the root is
-the portion before any <B>MB-System</B> suffix).
-<BR>
-
-By default, the input is assumed to be a datalist named datalist.mb-1, resulting
-in an output datalist named datalistp.mb-1 with the following contents:
-<BR>
-
-<BR> <TT>       </TT>$PROCESSED<BR>
-<BR> <TT>       </TT>datalist.mb-1 -1<BR>
-<BR>
-
-If the input file is specified as a datalist like
-datalist_sslo.mb-1, then the output datalist
-datalist_sslop.mb-1
-will have the following contents:
-<BR>
-
-<BR> <TT>       </TT>$PROCESSED<BR>
-<BR> <TT>       </TT>datalist_sslo.mb-1 -1<BR>
-<BR>
-
-If the input file is specified as a swath file like
-20050916122920.mb57, then the output datalist 20050916122920p.mb-1
-will have the following contents:
-<BR>
-
-<BR> <TT>       </TT>$PROCESSED<BR>
-<BR> <TT>       </TT>20050916122920.mb57 57<BR>
-<P>
-</DL>
-<A NAME="lbAH"> </A>
-<H2>EXAMPLES</H2>
-
-Suppose we have two swath data files from an EM3000 multibeam
-and another two from an Hydrosweep MD multibeam. We might
-construct two datalist files. For the EM3000 we might
-have a file dlst_em3000.mb-1 containing:
-<BR> <TT>       </TT>0004_20010705_165004_raw.mb57 57<BR>
-<BR> <TT>       </TT>0005_20010705_172010_raw.mb57 57<BR>
-<BR>
-
-For the Hydrosweep MD data we might have a file dlst_hsmd.mb-1
-containing:
-<BR> <TT>       </TT>al10107051649.mb102 102<BR>
-<BR> <TT>       </TT>al10107051719.mb102 102<BR>
-<P>
-Further suppose that we have found it necessary to edit
-the bathymetry in 0005_20010705_172010_raw.mb57 and
-al10107051719.mb102 using <B>mbedit</B>, and that <B>mbprocess</B>
-has been run on both files to generate processed files
-called 0005_20010705_172010_rawp.mb57 and
-al10107051719p.mb102.
-<P>
-If we run:
-<BR> <TT>       </TT>mbdatalist -I dlst_em3000.mb-1<BR>
-<BR>
-
-the output is:
-<BR> <TT>       </TT>0004_20010705_165004_raw.mb57 57 1.000000<BR>
-<BR> <TT>       </TT>0005_20010705_172010_raw.mb57 57 1.000000<BR>
-<BR>
-
-Here the file name is followed by the format and then
-by a third column containing the default file weight of 1.0.
-<P>
-Similarly, if we run:
-<BR> <TT>       </TT>mbdatalist -I dlst_hsmd.mb-1<BR>
-<BR>
-
-the output is:
-<BR> <TT>       </TT>al10107051649.mb102 102 1.000000<BR>
-<BR> <TT>       </TT>al10107051719.mb102 102 1.000000<BR>
-<P>
-If we insert a line
-<BR> <TT>       </TT>$PROCESSED<BR>
-<BR>
-
-at the top of both dlst_hsmd.mb-1 and dlst_em3000.mb-1,
-then the output of <B>mbdatalist</B> changes so that:
-<BR> <TT>       </TT>mbdatalist -I dlst_em3000.mb-1<BR>
-<BR>
-
-yields:
-<BR> <TT>       </TT>0004_20010705_165004_raw.mb57 57 1.000000<BR>
-<BR> <TT>       </TT>0005_20010705_172010_rawp.mb57 57 1.000000<BR>
-and:
-<BR> <TT>       </TT>mbdatalist -I dlst_hsmd.mb-1<BR>
-<BR>
-
-yields:
-<BR> <TT>       </TT>al10107051649.mb102 102 1.000000<BR>
-<BR> <TT>       </TT>al10107051719p.mb102 102 1.000000<BR>
-<P>
-Now suppose we create a datalist file called dlst_all.mb-1
-that refers to the two datalists shown above (without the
-$PROCESSED tags). If the contents of dlst_all.mb-1 are:
-<BR> <TT>       </TT>dlst_em3000.mb-1 -1 100.0<BR>
-<BR> <TT>       </TT>dlst_hsmd.mb-1   -1   1.0<BR>
-<BR>
-
-where we have specified different file weights for the
-two datalists, then:
-<BR> <TT>       </TT>mbdatalist -I dlst_all.mb-1<BR>
-<BR>
-
-yields:
-<BR> <TT>       </TT>0004_20010705_165004_raw.mb57 57 100.000000<BR>
-<BR> <TT>       </TT>0005_20010705_172010_raw.mb57 57 100.000000<BR>
-<BR> <TT>       </TT>al10107051649.mb102 102 1.000000<BR>
-<BR> <TT>       </TT>al10107051719.mb102 102 1.000000<BR>
-<P>
-Now, if we use the <B>-P</B> option to force <B>mbdatalist</B>
-to output processed data file names when possible, then:
-<BR> <TT>       </TT>mbdatalist -I dlst_all.mb-1 -P<BR>
-<BR>
-
-yields:
-<BR> <TT>       </TT>0004_20010705_165004_raw.mb57 57 100.000000<BR>
-<BR> <TT>       </TT>0005_20010705_172010_rawp.mb57 57 100.000000<BR>
-<BR> <TT>       </TT>al10107051649.mb102 102 1.000000<BR>
-<BR> <TT>       </TT>al10107051719p.mb102 102 1.000000<BR>
-<P>
-<A NAME="lbAI"> </A>
-<H2>SEE ALSO</H2>
-
-<B><A HREF="mbsystem.html">mbsystem</A></B>(1)
-<P>
-<A NAME="lbAJ"> </A>
-<H2>BUGS</H2>
-
-No true bugs here, only distantly related arthropods... Yum.
-Seriously, it would be better if the copy function preserved
-the modification times of the copied swath files and ancilliary
-files. Copying of processed files should also be an option.
-<P>
-
-<HR>
-<A NAME="index"> </A><H2>Index</H2>
-<DL>
-<DT><A HREF="#lbAB">NAME</A><DD>
-<DT><A HREF="#lbAC">VERSION</A><DD>
-<DT><A HREF="#lbAD">SYNOPSIS</A><DD>
-<DT><A HREF="#lbAE">DESCRIPTION</A><DD>
-<DT><A HREF="#lbAF">AUTHORSHIP</A><DD>
-<DT><A HREF="#lbAG">OPTIONS</A><DD>
-<DT><A HREF="#lbAH">EXAMPLES</A><DD>
-<DT><A HREF="#lbAI">SEE ALSO</A><DD>
-<DT><A HREF="#lbAJ">BUGS</A><DD>
-</DL>
-<HR>
-</PRE>
-
-<CENTER><P><BR>
-Last Updated: 3 June 2013</P></CENTER>
-
-<HR>
-<P><A HREF="mbsystem_man_list.html">Return to list of MB-System manual pages...</A></P>
-<P><A HREF="mbsystem_home.html"><IMG SRC="mbsystem_logo_small.gif" BORDER=0 HEIGHT=55 WIDTH=158 ALIGN=BOTTOM></A><A HREF="mbsystem_home.html">Back
-to MB-System Home Page...</A></P>
-
-</BODY>
-</HTML>
diff --git a/src/html/mbdefaults.html b/src/html/mbdefaults.html
deleted file mode 100644
index 9ea0731..0000000
--- a/src/html/mbdefaults.html
+++ /dev/null
@@ -1,332 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<HTML VERSION="2.0">
-<HEAD>
-   <TITLE>MB-System Unix Manual Page: mbdefaults</TITLE>
-<!-- WEBMAGIC VERSION NUMBER="2.0.2" -->
-<!-- WEBMAGIC TRANSLATION NAME="ServerRoot" SRC="/var/www/htdocs/" DST="/" -->
-<!-- WEBMAGIC TRANSLATION NAME="ProjectRoot" SRC="./" DST="" -->
-</HEAD>
-<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#336699" VLINK="#997040" ALINK="#CC9900">
-<BODY>
-<CENTER><H3><U>MB-System Unix Manual Page</U></H3></CENTER>
-<PRE>
-<H1>mbdefaults</H1>
-Section:  MB-System 5.0  (1)<BR>Updated:  5 September 2014 <BR><A HREF="#index">Index</A>
-<HR>
-
-<A NAME="lbAB"> </A>
-<H2>NAME</H2>
-
-<B>mbdefaults</B> - Set or list default mbio parameters for
-reading and writing swath sonar data
-<P>
-<A NAME="lbAC"> </A>
-<H2>VERSION</H2>
-
-Version 5.0
-<P>
-<A NAME="lbAD"> </A>
-<H2>SYNOPSIS</H2>
-
-<B>mbdefaults</B> [<B>-B</B><I>fileiobuffer</I> <B>-D</B><I>psdisplay</I> <B>-F</B><I>fbtversion</I>  <B>-I</B><I>imagedisplay</I>
-<B>-L</B><I>lonflip</I> <B>-M</B><I>mbviewsettings</I> <B>-T</B><I>timegap</I> <B>-U</B><I>uselockfiles</I>
-<B>-W</B><I>project</I> <B>-V -H</B>]
-<P>
-<A NAME="lbAE"> </A>
-<H2>DESCRIPTION</H2>
-
-<B>mbdefaults</B> is a utility for setting or listing the default read
-parameters used by some <B>MBIO</B> utilities such as <B>MBcopy</B> or <B>MBgrdviz</B>.
-If a user wishes to set default
-parameters different from those set by the <B>MBIO</B> library, then
-these specialized default values must be stored
-in the file .mbio_defaults in the users home directory.  If any option
-flag is given in invoking <B>mbdefaults</B>, then a new .mbio_defaults
-file will be written incorporating the newly set parameters along with
-any old parameters which have not been reset. If no option flag
-is given, then <B>mbdefaults</B> will list the current default values
-(set by <B>mbio</B> if no .mbio_defaults file exists).
-<P>
-<A NAME="lbAF"> </A>
-<H2>CHANGES FROM VERSION 4.6</H2>
-
-Note that prior to version 5.0, the <B>MB-System</B> defaults
-set by <B>mbdefaults</B> included the format id, a control for
-ping averaging, longitude and latitude bounds for windowing
-by area, and begin and end times for windowing in time. These
-values are no longer set in the .mbio_defaults file or controlled
-by <B>mbdefaults</B>.
-<P>
-<A NAME="lbAG"> </A>
-<H2>AUTHORSHIP</H2>
-
-David W. Caress (<A HREF="mailto:caress at mbari.org">caress at mbari.org</A>)
-<BR>
-
-<BR>  Monterey Bay Aquarium Research Institute
-<BR>
-
-Dale N. Chayes (<A HREF="mailto:dale at ldeo.columbia.edu">dale at ldeo.columbia.edu</A>)
-<BR>
-
-<BR>  Lamont-Doherty Earth Observatory
-<P>
-<A NAME="lbAH"> </A>
-<H2>OPTIONS</H2>
-
-<DL COMPACT>
-<DT><B>-B</B>
-
-<DD>
-<I>fileiobuffer</I>
-<BR>
-
-Sets the file i/o block buffer size for certain formats (currently formats 88 and 58).
-The <I>fileiobuffer</I> value is in kilobytes, so <I>fileiobuffer</I> = 1000 corresponds
-rougly to a one megabyte buffer.
-This option allows users to optimize i/o speed of certain large and complex data formats
-(e.g Reson 7k and current generation Kongsberg multibeam) by increasing the block buffer
-size from the system default. Making the buffer size larger generally has benefit only
-when reading over a network; this option has little impact for filesystems mounted from
-locally attached hard drives. At MBARI, where our primary data storage is accessed over
-a gigabit ethernet network, setting <I>fileiobuffer</I> = 10000 achieves an 8% run time reduction
-for <B>mbprocess</B>. Default: <I>fileiobuffer</I> = 0, which corresponds to the system
-default.
-<DT><B>-D</B>
-
-<DD>
-<I>psdisplay</I>
-<BR>
-
-Sets the program used for displaying Postscript graphics files
-on a screen; this facility is used by shellscripts created through
-macros like <B>mbm_plot</B>. The default Postscript display
-utility is <B>gv</B>. Another common Postscript display utilities
-is <B>ghostview</B>; past postscript viewers included <B>pageview</B>
-(for Sun workstations) and <B>xpsview</B> (for Silicon Graphics workstations).
-<DT><B>-F</B>
-
-<DD>
-<I>fbtversion</I>
-<BR>
-
-Set the version of fbt files created by <B>mbdatalist</B> and <B>mbprocess</B>.
-If <I>fbtversion</I> = 2, "old", or "OLD", then the pre-5.3.1897 version of
-format 71 will be used to write the "fast bathymetry" or "*.fbt" files.
-If <I>fbtversion</I> = 3, "new", or "NEW", then the new, 5.3.1897-or-later version of
-format 71 will be used to write the "fast bathymetry" or "*.fbt" files.
-<P>
-<DT><B>-H</B>
-
-<DD>
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-<DT><B>-I</B>
-
-<DD>
-<I>imagedisplay</I>
-<BR>
-
-Sets the program used for displaying Tiff image files
-on a screen; this facility is used by shellscripts created through
-macros like <B>mbm_grdtiff</B>. The default image display
-utility is <B>xv</B>. Other common image display utilities
-are <B>gimp</B> (GNU image processing) and <B>gqview</B>.
-<DT><B>-L</B>
-
-<DD>
-<I>lonflip</I>
-<BR>
-
-Sets the range of the longitude values returned.
-If <I>lonflip</I>=-1 then the longitude values will be in
-the range from -360 to 0 degrees. If <I>lonflip</I>=0
-then the longitude values will be in
-the range from -180 to 180 degrees. If <I>lonflip</I>=1
-then the longitude values will be in
-the range from 0 to 360 degrees.
-Default: <I>lonflip</I> = 0.
-<DT><B>-MP</B>
-
-<DD>
-<I>colortable/colortable_mode/shade_mode</I>
-<BR>
-
-Sets the default colortable, colortable mode, and shading mode for
-the programs <B>MBgrdviz</B> and <B>MBeditviz</B>. The <I>colortable</I> identifiers are
-similar to those used for <B>mbm_grdplot</B>:
-<BR>        0 = Haxby colortable
-<BR>        1 = Bright colortable
-<BR>        2 = Muted colortable
-<BR>        3 = Grayscale colortable
-<BR>        4 = Flat Gray colortable
-<BR>        5 = Sealevel 1 colortable
-<BR>        6 = Sealevel 2 colortable
-<BR>
-
-The <I>colortable_mode</I> refers to whether low values
-are represented by "cool" colors (e.g. blue) and high values
-by "hot" colors (e.g. red), which corresponds to <I>colortable_mode</I> = 0,
-or the opposite, which corresponds to <I>colortable_mode</I> = 1.
-<P>
-The <I>shade_mode</I> value determines whether shading is off
-(<I>shade_mode</I> = 0), done by illumination(<I>shade_mode</I> = 1),
-or done using slope magnitude (<I>shade_mode</I> = 2). Shading by overlay
-cannot be a default because overlay data are not always defined.
-<DT><B>-MG</B>
-
-<DD>
-<I>slope_colortable/slope_colortable_mode</I>
-<BR>
-
-Sets the default colortable and colortable mode for displays of slope
-using the programs <B>MBgrdviz</B> and <B>MBeditviz</B>.
-The colortable and colortable mode identifiers are the same as given
-above for <B>-MP</B>.
-<DT><B>-MO</B>
-
-<DD>
-<I>secondary_colortable/secondary_colortable_mode</I>
-<BR>
-
-Sets the default colortable and colortable mode for displays of 
-overlay data using the programs <B>MBgrdviz</B> and <B>MBeditviz</B>.
-The colortable and colortable mode identifiers are the same as given
-above for <B>-MP</B>.
-<DT><B>-MI</B>
-
-<DD>
-<I>magnitude/elevation/azimuth</I>
-<BR>
-
-Sets the default parameters for shading by illumination using the
-programs <B>MBgrdviz</B> and <B>MBeditviz</B>.
-The <I>elevation</I> and <I>azimuth</I> values are in degrees.
-<DT><B>-MS</B>
-
-<DD>
-<I>magnitude</I>
-<BR>
-
-Sets the default parameter for shading by slope magnitude using the
-programs <B>MBgrdviz</B> and <B>MBeditviz</B>.
-<DT><B>-T</B>
-
-<DD>
-<I>timegap</I>
-<BR>
-
-Sets the maximum time gap in minutes between adjacent pings allowed before
-the data is considered to have a gap. Default: <I>timegap</I> = 1.
-<DT><B>-U</B>
-
-<DD>
-<I>uselockfiles</I>
-<BR>
-
-Sets whether <B>MB-System</B> uses the file locking mechanism to insure that
-a swath file is only processed or edited by a single program at a time.
-To revert to pre-lockfile behavior for <B>mbedit</B>, <B>mbeditviz</B>,
-<B>mbclean</B>, <B>mbareaclean</B>, <B>mbnavedit</B>, and <B>mbprocess</B>,
-use <B>-U</B><I>0</I> or  <B>-U</B><I>no</I>. To reinstate use of lock files,
-use <B>-U</B><I>1</I> or  <B>-U</B><I>yes</I>.
-<DT><B>-V</B>
-
-<DD>
-Normally, <B>mbdefaults</B> outputs only a list of the default values
-to the stdout stream.  If the
-<B>-V</B> flag is given, then <B>mbdefaults</B> works in a "verbose" mode and
-also outputs the program version being used.
-<DT><B>-W</B>
-
-<DD>
-<I>project</I>
-<BR>
-
-Sets the name of the default project. This will be used by
-MB-System database management utilities yet to be created.
-Default: <I>project</I> = "none".
-<P>
-</DL>
-<A NAME="lbAI"> </A>
-<H2>EXAMPLES</H2>
-
-Suppose that one wishes the default Postscript viewer to
-be xpsview rather than gv.
-The following will suffice to create (or rewrite)
-a .mbio_defaults file in the users home directory:
-<TT>        </TT>mbdefaults -Dxpsview<BR>
-<P>
-The output will be:
-<P>
-<BR> New MBIO Default Control Parameters:
-<BR> lonflip:  0
-<BR> timegap:  1.000000
-<BR> ps viewer:  xspsview
-<BR> img viewer: xv
-<BR> project:    none
-<BR> fbtversion: 3 (new)
-<BR> uselockfiles: 1
-<BR> fileiobuffer: 10000 (use 10000 kB buffer for fread() & fwrite())
-<P>
-Suppose that one just wishes to see what the current default
-parameters are.  The following will suffice:
-<TT>        </TT>mbdefaults<BR>
-<P>
-The output will be
-<P>
-<BR> Current MBIO Default Control Parameters:
-<BR> lonflip:    0
-<BR> timegap:    1.000000
-<BR> ps viewer:  ghostview
-<BR> img viewer: xv
-<BR> project:    none
-<BR> fbtversion: 3 (new)
-<BR> uselockfiles: 1
-<BR> fileiobuffer: 10000 (use 10000 kB buffer for fread() & fwrite())
-<P>
-<A NAME="lbAJ"> </A>
-<H2>SEE ALSO</H2>
-
-<B><A HREF="mbsystem.html">mbsystem</A></B>(1), <B><A HREF="mbio.html">mbio</A></B>(1), <B><A HREF="mbcontour.html">mbcontour</A></B>(1),
-<B><A HREF="mbswath.html">mbswath</A></B>(1), <B><A HREF="mbgrdtiff.html">mbgrdtiff</A></B>(1),
-<B><A HREF="mbm_plot.html">mbm_plot</A></B>(1), <B><A HREF="mbm_grdplot.html">mbm_grdplot</A></B>(1),
-<B><A HREF="mbm_grd3dplot.html">mbm_grd3dplot</A></B>(1), <B><A HREF="mbm_xyplot.html">mbm_xyplot</A></B>(1), <B><A HREF="mbm_grdtiff.html">mbm_grdtiff</A></B>(1)
-<P>
-<A NAME="lbAK"> </A>
-<H2>BUGS</H2>
-
-Too simple to have any really interesting bugs.
-<P>
-Well, ok, this program occassionally runs wild, destroying filesystems
-and eating young children. But don't worry, it could never
-happen to you...
-<P>
-
-<HR>
-<A NAME="index"> </A><H2>Index</H2>
-<DL>
-<DT><A HREF="#lbAB">NAME</A><DD>
-<DT><A HREF="#lbAC">VERSION</A><DD>
-<DT><A HREF="#lbAD">SYNOPSIS</A><DD>
-<DT><A HREF="#lbAE">DESCRIPTION</A><DD>
-<DT><A HREF="#lbAF">CHANGES FROM VERSION 4.6</A><DD>
-<DT><A HREF="#lbAG">AUTHORSHIP</A><DD>
-<DT><A HREF="#lbAH">OPTIONS</A><DD>
-<DT><A HREF="#lbAI">EXAMPLES</A><DD>
-<DT><A HREF="#lbAJ">SEE ALSO</A><DD>
-<DT><A HREF="#lbAK">BUGS</A><DD>
-</DL>
-<HR>
-</PRE>
-
-<CENTER><P><BR>
-Last Updated: 5 September 2014</P></CENTER>
-
-<HR>
-<P><A HREF="mbsystem_man_list.html">Return to list of MB-System manual pages...</A></P>
-<P><A HREF="mbsystem_home.html"><IMG SRC="mbsystem_logo_small.gif" BORDER=0 HEIGHT=55 WIDTH=158 ALIGN=BOTTOM></A><A HREF="mbsystem_home.html">Back
-to MB-System Home Page...</A></P>
-
-</BODY>
-</HTML>
diff --git a/src/html/mbdumpesf.html b/src/html/mbdumpesf.html
deleted file mode 100644
index aa40759..0000000
--- a/src/html/mbdumpesf.html
+++ /dev/null
@@ -1,192 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<HTML VERSION="2.0">
-<HEAD>
-   <TITLE>MB-System Unix Manual Page: mbdumpesf</TITLE>
-<!-- WEBMAGIC VERSION NUMBER="2.0.2" -->
-<!-- WEBMAGIC TRANSLATION NAME="ServerRoot" SRC="/var/www/htdocs/" DST="/" -->
-<!-- WEBMAGIC TRANSLATION NAME="ProjectRoot" SRC="./" DST="" -->
-</HEAD>
-<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#336699" VLINK="#997040" ALINK="#CC9900">
-<BODY>
-<CENTER><H3><U>MB-System Unix Manual Page</U></H3></CENTER>
-<PRE>
-<H1>mbdumpesf</H1>
-Section:  MB-System 5.0  (1)<BR>Updated:  3 May 2015 <BR><A HREF="#index">Index</A>
-<HR>
-
-<A NAME="lbAB"> </A>
-<H2>NAME</H2>
-
-<B>mbdumpesf</B> - Output beam edits from a binary edit save file, either in the binary form or as an ASCII text dump.
-<P>
-<A NAME="lbAC"> </A>
-<H2>VERSION</H2>
-
-Version 5.0
-<P>
-<A NAME="lbAD"> </A>
-<H2>SYNOPSIS</H2>
-
-<B>mbdumpesf</B> <B>--input=</B><I>file</I>
-[<B>--output=</B><I>file</I> <B>--ignore-unflag</B> <B>--ignore-flag</B>
-<B>--ignore-filter</B> <B>--ignore-zero</B> <B>--verbose</B> <B>--help</B>]
-<P>
-<A NAME="lbAE"> </A>
-<H2>DESCRIPTION</H2>
-
-Swath bathymetry data is typically edited either with interactive
-tools such as <B>mbedit</B> or automatic filters such as <B>mbclean</B>.
-In <B>MB-System</B>, the beam flags are stored in binary "edit save files"
-(file suffix ".esf"). The program <B>mbdumpesf</B> reads and outputs esf files. If
-no output file is specified, then each of the edit events is written in ASCII text
-as a single line to stdout. If an output file is specified with the <B>--output=</B><I>file</I>
-option, then the edit save data will be written to that file in binary form.
-<P>
-The four types of edit events supported by esf files are:
-<BR>
-
-<BR> <TT>       </TT>action=1: flag manually<BR>
-<BR> <TT>       </TT>action=2: unflag<BR>
-<BR> <TT>       </TT>action=3: zero - make beam null<BR>
-<BR> <TT>       </TT>action=4: flag by autofilter<BR>
-<BR>
-
-This program can be forced to ignore (exclude from the output) any of the event
-types using the options <B>--ignore-unflag</B>, <B>--ignore-flag</B>,
-<B>--ignore-filter</B>, and <B>--ignore-zero</B>.
-<P>
-<A NAME="lbAF"> </A>
-<H2>AUTHORSHIP</H2>
-
-David W. Caress (<A HREF="mailto:caress at mbari.org">caress at mbari.org</A>)
-<BR>
-
-<BR>  Monterey Bay Aquarium Research Institute
-<BR>
-
-Dale N. Chayes (<A HREF="mailto:dale at ldeo.columbia.edu">dale at ldeo.columbia.edu</A>)
-<BR>
-
-<BR>  Lamont-Doherty Earth Observatory
-<P>
-<A NAME="lbAG"> </A>
-<H2>MBDUMPESF OPTIONS</H2>
-
-<DL COMPACT>
-<DT><B>--input=</B><I>file</I><DD>
-"Edit save file" (esf file) from which the edit events will be read.
-<DT><B>--output=</B><I>file</I><DD>
-Specifies output esf file. If this option is not used, then the edit
-event stream will be output to stdout as a sequence of ASCII text lines.
-<DT><B>--ignore-unflag</B><DD>
-Causes <B>mbdumpesf</B> to not output any unflag edit events read from
-the input.
-<DT><B>--ignore-flag</B><DD>
-Causes <B>mbdumpesf</B> to not output any flag edit events read from
-the input.
-<DT><B>--ignore-filter</B><DD>
-Causes <B>mbdumpesf</B> to not output any filter edit events read from
-the input.
-<DT><B>--ignore-zero</B><DD>
-Causes <B>mbdumpesf</B> to not output any zero edit events read from
-the input.
-<DT><B>--verbose</B><DD>
-Normally, <B>mbdumpesf</B> outputs one line for each edit event in
-the input esf file.  If the
---verbose flag is given, then <B>mbdumpesf</B> also outputs the
-total number of each type of edit event at the end of the listing.
-<DT><B>--help</B><DD>
-This "help" flag causes the program to print out a description
-of its operation and then exit immediately.
-<P>
-</DL>
-<A NAME="lbAH"> </A>
-<H2>EXAMPLES</H2>
-
-Suppose one has edited a swath file 20080422_222636.mb88, resulting
-in an esf file named 20080422_222636.mb88.esf. To dump the edit events
-as a text stream, use <B>mbdumpesf</B>:
-<BR>
-
-<BR> <TT>       </TT>mbdumpesf -I 20080422_222636.mb88.esf<BR>
-<BR>
-
-The output will look something like:
-<BR>
-
-<P>
-<BR>
-
-EDITS READ: i:0 time: 947562291.799000 2008/04/22 22:26:36.799000 beam:21 action:1
-<BR>
-
-EDITS READ: i:1 time: 947562291.799000 2008/04/22 22:26:36.799000 beam:22 action:1
-<BR>
-
-EDITS READ: i:2 time: 947562291.799000 2008/04/22 22:26:36.799000 beam:23 action:1
-<BR>
-
-EDITS READ: i:3 time: 947562291.799000 2008/04/22 22:26:36.799000 beam:24 action:1
-<BR>
-
-EDITS READ: i:4 time: 947562291.799000 2008/04/22 22:26:36.799000 beam:25 action:1
-<BR>
-
-EDITS READ: i:5 time: 947562291.799000 2008/04/22 22:26:36.799000 beam:26 action:1
-<BR>
-
-EDITS READ: i:6 time: 947562291.799000 2008/04/22 22:26:36.799000 beam:27 action:1
-<BR>
-
-EDITS READ: i:7 time: 947562291.799000 2008/04/22 22:26:36.799000 beam:28 action:1
-<BR>
-
-<P>
-<BR>
-
-Here the large time value is epoch seconds (seconds since 1/1/1970), and the
-edit event action values are:
-<BR>
-
-<BR> <TT>       </TT>action=1: flag manually<BR>
-<BR> <TT>       </TT>action=2: unflag<BR>
-<BR> <TT>       </TT>action=3: zero - make beam null<BR>
-<BR> <TT>       </TT>action=4: flag by autofilter<BR>
-<P>
-<A NAME="lbAI"> </A>
-<H2>SEE ALSO</H2>
-
-<B><A HREF="mbsystem.html">mbsystem</A></B>(1), <B><A HREF="mbedit.html">mbedit</A></B>(1), <B><A HREF="mbeditviz.html">mbeditviz</A></B>(1), fBmbclean(1), <B><A HREF="mbunclean.html">mbunclean</A></B>(1)
-<P>
-<A NAME="lbAJ"> </A>
-<H2>BUGS</H2>
-
-Too simple to have any interesting problems.
-<P>
-
-<HR>
-<A NAME="index"> </A><H2>Index</H2>
-<DL>
-<DT><A HREF="#lbAB">NAME</A><DD>
-<DT><A HREF="#lbAC">VERSION</A><DD>
-<DT><A HREF="#lbAD">SYNOPSIS</A><DD>
-<DT><A HREF="#lbAE">DESCRIPTION</A><DD>
-<DT><A HREF="#lbAF">AUTHORSHIP</A><DD>
-<DT><A HREF="#lbAG">MBDUMPESF OPTIONS</A><DD>
-<DT><A HREF="#lbAH">EXAMPLES</A><DD>
-<DT><A HREF="#lbAI">SEE ALSO</A><DD>
-<DT><A HREF="#lbAJ">BUGS</A><DD>
-</DL>
-<HR>
-</PRE>
-
-<CENTER><P><BR>
-Last Updated: 3 May 2015</P></CENTER>
-
-<HR>
-<P><A HREF="mbsystem_man_list.html">Return to list of MB-System manual pages...</A></P>
-<P><A HREF="mbsystem_home.html"><IMG SRC="mbsystem_logo_small.gif" BORDER=0 HEIGHT=55 WIDTH=158 ALIGN=BOTTOM></A><A HREF="mbsystem_home.html">Back
-to MB-System Home Page...</A></P>
-
-</BODY>
-</HTML>
diff --git a/src/html/mbedit.html b/src/html/mbedit.html
deleted file mode 100644
index 5b68f09..0000000
--- a/src/html/mbedit.html
+++ /dev/null
@@ -1,1059 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<HTML VERSION="2.0">
-<HEAD>
-   <TITLE>MB-System Unix Manual Page: mbedit</TITLE>
-<!-- WEBMAGIC VERSION NUMBER="2.0.2" -->
-<!-- WEBMAGIC TRANSLATION NAME="ServerRoot" SRC="/var/www/htdocs/" DST="/" -->
-<!-- WEBMAGIC TRANSLATION NAME="ProjectRoot" SRC="./" DST="" -->
-</HEAD>
-<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#336699" VLINK="#997040" ALINK="#CC9900">
-<BODY>
-<CENTER><H3><U>MB-System Unix Manual Page</U></H3></CENTER>
-<PRE>
-<H1>mbedit</H1>
-Section:  MB-System 5.0  (1)<BR>Updated:  3 June 2013 <BR><A HREF="#index">Index</A>
-<HR>
-
-<A NAME="lbAB"> </A>
-<H2>NAME</H2>
-
-<B>mbedit</B> - Interactive editor used to flag bad bathymetry values in swath sonar bathymetry data.
-<P>
-<A NAME="lbAC"> </A>
-<H2>VERSION</H2>
-
-Version 5.0
-<P>
-<A NAME="lbAD"> </A>
-<H2>SYNOPSIS</H2>
-
-<B>mbedit</B> [<B>-B</B><I>yr/mo/da/hr/mn/sc</I>
-<B>-D</B> <B>-E</B><I>yr/mo/da/hr/mn/sc</I>
-<B>-F</B><I>format</I> <B> -G -I</B><I>infile</I> <B>-X -V -H</B>]
-<P>
-<A NAME="lbAE"> </A>
-<H2>DESCRIPTION</H2>
-
-<B>MBedit</B> is an interactive editor
-used to identify and flag artifacts in swath sonar
-bathymetry data. Once a file has been
-read in, <B>MBedit</B> displays the bathymetry profiles
-from several pings, allowing the user to identify and flag anomalous
-beams. In extreme circumstances,
-entire pings may be nulled (see "KEYBOARD ACTIONS").
-<P>
-In the default mode the edit events are output to
-an "edit save" file. The program can also be operated
-in a "browse" mode where no edit events are output.
-If saved, the edit events can be applied
-to the data using the program <B>mbprocess</B>, which
-outputs a processed swath data file.
-The <B>mbprocess</B> program is also used to merge
-edited navigation, recalculate bathymetry, and apply
-other corrections to swath bathymetry data. Users
-may cause <B>mbprocess</B> to be run automatically by
-specifying the <B>-X</B> option when starting <B>mbedit</B>.
-<P>
-In previous  versions of <B>MB-System</B>
-(version 4.6.10 or earlier), <B>mbedit</B>
-produced output swath data files directly by reading and
-storing all of the swath data information in memory (including
-non-survey data records). This approach limited the
-amount of data that could be handled
-at once, frequently requiring users to process files in
-small pieces. The current version only stores the bathymetry
-data and only outputs changes to the beam flag status
-(good data or bad data) of bathymetry soundings.
-<P>
-The default <B>mbedit</B> display consists of several
-bathymetry acrosstrack profiles plotted with vertical
-offsets between each profile (in waterfall fashion). The
-profiles are plotted within
-a box with annotation showing the scaling of the x
-(acrosstrack distance) and y (depth) axes. Alternatively, the
-display can show the profiles without the waterfall offsets,
-with the view being either in the alongtrack direction, or in
-the acrosstrack dimension.
-<P>
-The number of pings displayed,
-and the width, vertical exageration, and annotation of the plot
-are all set by the user. Unflagged bathymetry points
-are shown as small filled black squares, and flagged bathymtetry points
-are shown as small unfilled red or blue squares. Soundings
-flagged manually are shown in red, and those flagged by filter
-algorithms are shown in green. When a sounding is selected in the
-info mode, it is displayed as a large, filled, blue square.
-The unflagged or good bathymetry
-points are connected by black line segments to show the acrosstrack
-bathymetry profiles for each ping. If the <B>Show Flagged Profile</B>
-toggle is set on, then red line segments connect the flagged depth
-values in the acrosstrack bathymetry profile.
-Each of the displayed pings has a label giving the record number
-in the data file, the ping time, and the center beam depth.
-<P>
-The editing is driven by the left mouse button and
-involves four basic edit modes and one information mode. In toggle
-mode each mouse pick toggles the nearest bathymetry point between
-flagged and unflagged states. In pick mode each mouse pick flags
-the nearest bathymetry point. In erase mode the left mouse button
-is held down as the cursor is dragged over the data; all bathymetry
-points touched by the mouse are flagged. Restore mode is just like
-erase mode, except that the affected bathymetry values are unflagged.
-In grab mode, a red rectangle is drawn as the mouse is dragged
-with the left button down. When the button is released, all
-unflagged soundings within the rectangle are flagged. Finally,
-info mode acts like pick mode, except that instead of flagging
-the nearest sounding, the program displays information about the
-selected ping and sounding above the bathymetry profile box.
-A few keyboard macros described below add additional flexibility
-to the editing process.
-<P>
-<B>MBedit</B> has some limited automatic flagging and unflagging
-options. The <B>Unflag View</B> button allows users to unflag all of
-the currently visible soundings, and the <B>Unflag Forward</B>
-button unflags all soundings from the current position forward
-to the end of the data held in memory. The <B>Controls</B> menu
-includes a <B>Filters...</B> button that brings up a dialog
-which sets the automatic flagging functions. At present, these
-include a median filter algorithm, a "wrong side filter", "data
-cutting" by beam number, and "data cutting" by acrosstrack
-distance. The "wrong side" filter flags soundings positioned on
-the "wrong" side of the swath (port soundings incorrectly located
-on the starboard side, or vice versa). The two "data cutting"
-algorithms flag beams inside or outside of specified beam number
-ranges or acrosstrack distance ranges, respectively.  Additional
-automatic filters will be added in later versions.
-<P>
-If the ping includes flagged depths outside the plotting box, the ping label
-is underlain by a green box. If
-the ping includes unflagged depths outside the plotting box, the label
-is underlain by a red box, and a small black box appears to the left
-of the label. These colored labels help users identify
-bad bathymetry points which lie outside the box defined by the current
-vertical exageration and plot width values. In the case where unflagged
-depths lie outside the plotting box (red label), clicking on the small
-black box to the left of the ping label automatically flags all of the
-depth values outside the plotting box. Alternatively,
-users can decrease the
-vertical exageration and/or increase the plot width to bring the
-offending bathymetry points into view. Users should be aware that
-extreme bathymetric slopes or the use of high vertical exagerations
-may cause good depth values to lie outside the plotting box for
-the first and last pings in view.
-<P>
-The middle and right mouse buttons allow the user to step forward
-and backward, respectively, through the data file. The <B>Forward</B>
-and <B>Reverse</B> buttons provide a duplicate stepping capability.
-Left-handed users may reverse the right and left mouse button functions by pulling down
-the <B>Reverse Mouse Buttons</B> menu item from the <B>Controls</B> button.
-<P>
-<B>MBedit</B> can hold up to 25000 swath bathymetry
-profiles at a time in memory. In the case that
-a data file contains more survey data records than can be held in memory,
-users will find it necessary to step through multiple buffers of
-data. The <B>Next Buffer</B> button will cause <B>MBedit</B> to
-dump the current buffer contents and read in a new set of data.
-The handling of buffered data is set
-using the <B>Buffer Controls</B> dialog accessed by pulling down the
-<B>Buffer Controls...</B> menu item from the <B>Controls</B> button.
-The <B>Buffer Controls</B> dialog includes two slider controls, one
-entitled <B>Data Buffer Size</B> and the other <B>Buffer Retain Size</B>.
-Users on memory limited machines may find it necessary to set the
-maximum buffer size to a smaller number using the
-<B>Data Buffer Size</B> slider.  The <B>Buffer Retain Size</B>
-slider sets the number of data records
-retained from the old buffer when more data are loaded.
-<P>
-The user can bring up a <B>Go To Specified Time</B> dialog
-by pulling down the <B>Go to a specified time...</B> menu item from the
-<B>Controls</B> button. This dialog
-allows the user to specify the time of a particular ping to be viewed.
-The first ping with a time tag later than or equal to the specified time
-is then displayed, providing such a ping is available. If an appropriate
-ping is not available in the current buffer, <B>MBedit</B> will dump
-and load buffers of data until such a ping is found or the end of the
-file is reached. Thus, specifying an incorrect "go to" time may cause
-<B>MBedit</B> to close the file. Caution is advised in using this feature.
-<P>
-<B>MBedit</B> creates "edit save" files containing a list of each
-edit command executed during an editing session. These files are
-given names consisting of the input filename appended with ".esf".
-The program also modifies the <B>mbprocess</B> parameter file
-for the input file by specifying the edit save file and setting
-the <B>mbprocess</B> mode to apply the edits when generating a
-processed swath output file. If no parameter file named "ifile.par"
-exists, <B>mbedit</B> creates one.
-<P>
-If a user seeks to open a swath sonar data
-file and an associated edit save file already exists, the user is
-given an option to apply the saved edits to the data as it is loaded.
-If the user chooses not to apply the saved edits, those edits will
-be lost as a new edit save file is created.
-If (as is usually the case) the saved edits are to be
-applied, <B>MBedit</B> copies the edit
-save file to a file named "mbedit_tmp.esf" and reads the saved
-edits from that second file. In this way, the use of
-edit save files and <B>mbprocess</B> allows users
-to edit a swath data file multiple times without generating
-multiple output files. Subsequent editing sessions serve to
-update the processed data rather than generate additional
-edited data files.
-<P>
-<A NAME="lbAF"> </A>
-<H2>AUTHORSHIP</H2>
-
-David W. Caress (<A HREF="mailto:caress at mbari.org">caress at mbari.org</A>)
-<BR>
-
-<BR>  Monterey Bay Aquarium Research Institute
-<BR>
-
-Dale N. Chayes (<A HREF="mailto:dale at ldeo.columbia.edu">dale at ldeo.columbia.edu</A>)
-<BR>
-
-<BR>  Lamont-Doherty Earth Observatory
-<P>
-<A NAME="lbAG"> </A>
-<H2>OPTIONS</H2>
-
-<DL COMPACT>
-<DT><B>-B</B>
-
-<DD>
-<I>yr/mo/da/hr/mn/sc</I>
-<BR>
-
-Sets the starting time for data allowed in the input data; pings
-with times before the starting time will be ignored.
-Default: <I>yr/mo/da/hr/mn/sc</I> = 1962/2/21/10/30/0.
-<DT><B>-D</B>
-
-<DD>
-Starts up the program in "browse" mode. If a file is opened
-in browse mode (either at startup or later), none
-of the edited data will be output to a file. The default
-is to output the edited data to a file.
-<DT><B>-E</B>
-
-<DD>
-<I>yr/mo/da/hr/mn/sc</I>
-<BR>
-
-Sets the ending time for data allowed in the input data; pings
-with times after the ending time will be ignored.
-Default: <I>yr/mo/da/hr/mn/sc</I> = 2062/2/21/10/30/0.
-<DT><B>-F</B>
-
-<DD>
-<I>format</I>
-<BR>
-
-Sets the format at startup for the input and output swath sonar data using
-<B>MBIO</B> integer format identifiers. This value can also be set
-interactively when specifying the input file.
-This program uses the <B>MBIO</B> library and will read any swath sonar
-format supported by <B>MBIO</B>. A list of the swath sonar data formats
-currently supported by <B>MBIO</B> and their identifier values
-is given in the <B>MBIO</B> manual page.
-Default: <I>format</I> = 11.
-<DT><B>-G</B>
-
-<DD>
-This flag causes the program to treat the <B>Done</B> button as
-equivalent to the <B>Quit</B> button. This option is used when
-<B>MBedit</B> is started automatically by some other process and
-only a single file is to edited.
-<DT><B>-H</B>
-
-<DD>
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-<DT><B>-I</B>
-
-<DD>
-<I>infile</I>
-<BR>
-
-Sets the data file from which the input data will be read at startup.
-This option is usually used only when <B>MBedit</B> is started
-automatically from some other process. The <B>-F</B> option should
-also be used to set the data format id. If the <B>-B</B> option is
-not used to specify browse mode, then the edit save output file is
-automatically set as <I>infile</I> with ".esf" appended.
-<DT><B>-X</B>
-
-<DD>
-This option causes <B>mbprocess</B> to run automatically
-on an input swath data file when the <B>mbedit</B> editing session
-is completed. The <B>-X</B> option effectively means that the
-corresponding processed swath data is generated or updated immediately.
-The program <B>mbprocess</B> will not be invoked if the
-editing session is in the browse mode.
-<DT><B>-V</B>
-
-<DD>
-Normally, <B>MBedit</B> outputs information to the stderr stream
-regarding the number of records loaded and dumped.  If the
-<B>-V</B> flag is given, then <B>MBedit</B> works in a "verbose" mode and
-outputs the program version being used, all error status messages,
-and a large amount of other information including all of the
-beams flagged or zeroed.
-<P>
-</DL>
-<A NAME="lbAH"> </A>
-<H2>INTERACTIVE CONTROLS</H2>
-
-<DL COMPACT>
-<DT><B>File</B>
-
-<DD>
-This button accesses a pulldown menu with two push buttons:
-<B>Open</B> and <B>File Selection List</B>,
-<DT><B>File->Open</B>
-
-<DD>
-This button brings up a popup window which allows the user to
-specify an input swath sonar bathymetry data file, its <B>MBIO</B>
-format id, and  the output mode.
-This program uses the <B>MBIO</B> library and
-will read or write any swath sonar
-format supported by <B>MBIO</B>. A list of the swath sonar data
-formats currently supported by <B>MBIO</B> and their
-identifier values is given in the <B>MBIO</B> manual page.
-If the swath sonar data file is named using the <B>MB-System</B>
-suffix convention (format 11 files end with ".mb11", format
-41 files end with ".mb41", etc.), then the program will
-automatically use the appropriate format id; otherwise the
-format must be set by the user.
-The popup window also allows the output mode to be set to "browse"
-so that no edit events are output.
-When a valid file is specified and the <B>OK</B> button
-is clicked, file will be added to an internal list of swath files
-available for editing, and then that file will be loaded into
-memory for editing (if another file was already loaded, that file
-is closed out gracefully before the new file is loaded).
-If the specified input is a datalist (format
-id = -1), then all of the files referenced through that datalist
-will be added to the internal list, and the first of those files
-loaded. When a file is loaded for editing, <B>MBedit</B> reads
-as much data as will fit into the data buffer (typically 25000 records)
-and several pings are displayed as stacked bathymetry profiles.
-<DT><B>File->File Selection List</B>
-
-<DD>
-This button brings up a popup window displaying the internal list of
-swath files available for editing. The list has four columns.
-The first (left-most) column is either blank or shows "<locked>" or "<loaded>".
-If a file is loaded for editing by this program, it shows as "<loaded>".
-If a file is being edited or processed by another program, it shows as
-"<locked>". Locked files cannot be opened for editing, and any file
-loaded for editing by <B>MBedit</B> will show as "locked" to other
-programs. The second column is either blank or shows "<esf>". This indicates if
-a file has been previously edited so that an edit save file already
-exists. The third and fourth columns show the filename path and the <B>MBIO</B>
-format id, respectively.
-Users can select one of the files in the available list. If the "Edit Selected File"
-button is clicked, the selected file will be opened for editing (and any
-file already loaded will be closed first). If the "Remove Selected File"
-button is selected, then the selected file will be removed from the available
-list.
-<DT><B>View</B>
-
-<DD>
-This button accesses a pulldown menu with several toggle buttons:
-<B>Waterfall View</B>,
-<B>Alongtrack View</B>,
-<B>Acrosstrack View</B>,
-<B>Show Flagged Profile</B>,
-<B>Show Bottom Detect Algorithms</B>,
-<B>Wide Bathymetry Profiles</B>,
-<B>Plot Time Stamps</B>,
-<B>Plot Ping Interval</B>,
-<B>Plot Longitude</B>,
-<B>Plot Latitude</B>,
-<B>Plot Heading</B>,
-<B>Plot Speed</B>,
-<B>Plot Center Beam Depth</B>,
-<B>Plot Sonar Altitude</B>,
-<B>Plot Sonar Depth</B>,
-<B>Plot Roll</B>,
-<B>Plot Pitch</B>, and
-<B>Plot Heave</B>.
-<BR>
-
-The first three toggle buttons set the view mode, which may
-be a waterfall view, an alongtrack view, or an acrosstrack
-view. The next two toggle buttons set simple display options
-and may be set or unset individually.
-The remaining toggle buttons control the display plot
-modes; only one mode and therefore one of these toggle buttons may
-be set at any time.
-<DT><B>View->Waterfall View</B>
-
-<DD>
-Sets the <B>mbedit</B> display so that the
-bathymetry acrosstrack profiles are plotted with vertical
-offsets between each profile (in waterfall fashion).
-<DT><B>View->Alongtrack View</B>
-
-<DD>
-Sets the <B>mbedit</B> display so that the
-bathymetry acrosstrack profiles are viewed in the alongtrack
-direction without vertical offsets between the pings.
-<DT><B>View->Acrosstrack View</B>
-
-<DD>
-Sets the <B>mbedit</B> display so that the
-bathymetry acrosstrack profiles are viewed in the acrosstrack
-direction without vertical offsets between the pings.
-<DT><B>View->Show Flagged Profile</B>
-
-<DD>
-This toggle allows the user to specify whether the acrosstrack
-bathymetry profile includes only the unflagged or "good" bathymetry
-(toggle set to "Off") or
-whether the profile also includes the flagged or "bad" bathymetry
-(toggle set to "On"). In
-the latter case, red line segments show the portion of the profile
-associated with the flagged depth points.
-<DT><B>View->Show Bottom Detect Algorithms</B>
-
-<DD>
-This toggle allows the user to specify whether the beams are
-colored according to their flagging status (toggle set to "Off"
-or according to the bottom detect algorithm used by the sonar
-(toggle set to "On"). The default is to color each sounding
-according to its flagging status - unflagged beams are black,
-manually flagged beams are red, and filter flagged beams are
-green. If the beams are colored according to bottom detect
-algorithm, then amplitude detects are shown in black, phase
-detects are shown in red, and beams for which the bottom
-detection algorithm is unknown are shown in green. Users should
-be aware that many swath data formats do not include bottom
-detection algorithm information.
-<DT><B>View->Wide Bathymetry Profiles</B>
-
-<DD>
-This toggle, when set, causes <B>mbedit</B> to display the widest
-possible plots of the bathymetry profiles. All of the other options
-discussed immediately below narrow the primary plot in order to
-present additional information on the left side of the window.
-<DT><B>View->Plot Time Stamps</B>
-
-<DD>
-This toggle, when set, causes <B>mbedit</B> to display time stamp
-information to the left of the bathymetry profiles.
-<DT><B>View->Plot Ping Interval</B>
-
-<DD>
-This toggle, when set, causes <B>mbedit</B> to display an
-automatically scaled vertical time series plot of the time between pings.
-<BR> This plot appears to the left of the bathymetry profiles.
-<DT><B>View->Plot Longitude</B>
-
-<DD>
-This toggle, when set, causes <B>mbedit</B> to display an
-automatically scaled vertical time series plot of the
-navigation longitude associated with each ping.
-<BR> This plot appears to the left of the bathymetry profiles.
-<DT><B>View->Plot Latitude</B>
-
-<DD>
-This toggle, when set, causes <B>mbedit</B> to display an
-automatically scaled vertical time series plot of the
-navigation latitude associated with each ping.
-<BR> This plot appears to the left of the bathymetry profiles.
-<DT><B>View->Plot Heading</B>
-
-<DD>
-This toggle, when set, causes <B>mbedit</B> to display an
-automatically scaled vertical time series plot of the
-heading associated with each ping.
-<BR> This plot appears to the left of the bathymetry profiles.
-<DT><B>View->Plot Speed</B>
-
-<DD>
-This toggle, when set, causes <B>mbedit</B> to display an
-automatically scaled vertical time series plot of the
-speed associated with each ping.
-<BR> This plot appears to the left of the bathymetry profiles.
-<DT><B>View->Plot Center Beam Depth</B>
-
-<DD>
-This toggle, when set, causes <B>mbedit</B> to display an
-automatically scaled vertical time series plot of the
-speed associated with each ping.
-<BR> This plot appears to the left of the bathymetry profiles.
-<DT><B>View->Plot Sonar Depth</B>
-
-<DD>
-This toggle, when set, causes <B>mbedit</B> to display an
-automatically scaled vertical time series plot of the
-sonar depth associated with each ping.
-<BR> This plot appears to the left of the bathymetry profiles.
-<DT><B>View->Plot Sonar Altitude</B>
-
-<DD>
-This toggle, when set, causes <B>mbedit</B> to display an
-automatically scaled vertical time series plot of the
-sonar altitude associated with each ping.
-<BR> This plot appears to the left of the bathymetry profiles.
-<DT><B>View->Plot Roll</B>
-
-<DD>
-This toggle, when set, causes <B>mbedit</B> to display an
-automatically scaled vertical time series plot of the
-roll associated with each ping. In addition to the roll
-time series shown in black, an estimate of the acrosstrack
-seafloor slope is shown in red (calculated by linear
-regression of the unflagged soundings for each ping), and
-the difference between the roll and apparent slope is shown
-in blue. If the sonar roll has been correctly applied, the
-roll and seafloor slope should be uncorrelated. If there is
-a timing error in the roll correction, then the apparent
-seafloor slope may correlate strongly with the roll.
-<BR> This plot appears to the left of the bathymetry profiles.
-<DT><B>View->Plot Pitch</B>
-
-<DD>
-This toggle, when set, causes <B>mbedit</B> to display an
-automatically scaled vertical time series plot of the
-pitch associated with each ping.
-<BR> This plot appears to the left of the bathymetry profiles.
-<DT><B>View->Plot Heave</B>
-
-<DD>
-This toggle, when set, causes <B>mbedit</B> to display an
-automatically scaled vertical time series plot of the
-heave associated with each ping.
-<BR> This plot appears to the left of the bathymetry profiles.
-<DT><B>Controls</B>
-
-<DD>
-This button accesses a pulldown menu with six items:
-<B>Go To Specified Time...</B>, <B>Buffer Controls...</B>,
-<B>Annotation...</B>, <B>Filters...</B>,
-<B>Reverse Right/Left Key Macros</B>, and
-<B>Reverse Mouse Buttons</B>.
-The first (top) four items bring up a dialog of
-the same name. These dialogs are discussed below.
-The last two items are toggle buttons which set mouse button
-and key macro behaviors.
-<DT><B>Controls->Go To Specified Time...</B>
-
-<DD>
-This menu item brings up a dialog which allows the user to
-specify the time of a particular ping to be displayed.  Once the
-year, month, day, hour, minute, and second values are entered, clicking
-the <B>Apply</B> button causes <B>mbedit</B> to seek the specified
-target time.  If the current data buffer begins after the target
-time, an error is returned.  If the target time is later than the
-end of the current data buffer, then <B>mbedit</B> will dump and
-load buffers until the target time is reached or the data file ends.
-If the end of the file is reached during the search, the file will
-be closed.
-<DT><B>Controls->Buffer Controls...</B>
-
-<DD>
-This menu item brings up a dialog which allows the user
-to set the data buffer handling
-through two sliders discussed immediately below.
-<DT><B>Controls->Buffer Controls->Data Buffer Size</B>
-
-<DD>
-This slider on the <B>Buffer Controls</B> dialog
-sets the number of data records which can be held
-in the data buffer.  Any change becomes effective the next time
-that a data file is read in.
-<DT><B>Controls->Buffer Controls->Buffer Retain Size</B>
-
-<DD>
-This slider on the <B>Buffer Controls</B> dialog
-sets the number of data records which are held over in
-the buffer each time the old buffer is written out.
-<DT><B>Controls->Annotation...</B>
-
-<DD>
-This menu item brings up a dialog which
-allows the user to set the annotation intervals for
-the across track distance and depth axes through the two sliders
-discussed immediately below.
-<DT><B>Controls->Annotation->X Axis Tick Interval</B>
-
-<DD>
-This slider on the <B>Annotation</B> dialog
-sets the tick interval in m for the across track
-distance axis.
-If a particular value is desired which cannot be
-obtained by dragging the slider, the slider
-can be changed by increments of 1 by clicking with the left button
-inside the slider area, but not on the slider itself.
-<DT><B>Controls->Annotation->Y Axis Tick Interval</B>
-
-<DD>
-This slider on the <B>Annotation</B> dialog
-sets the tick interval in m for the depth axis.
-If a particular value is desired which cannot be
-obtained by dragging the slider, the slider
-can be changed by increments of 1 by clicking with the left button
-inside the slider area, but not on the slider itself.
-<DT><B>Controls->Filters</B>
-
-<DD>
-This menu item brings up a dialog which
-allows the user to turn automatic bathymetry filtering algorithms
-on and off and to set the filter parameters
-through the widgets discussed immediately below.
-Clicking on the <B>Apply</B> button first removes any previous
-automatic filter flags and then applies the current
-filter settings to the swath bathymetry data. These actions
-are applied only from the current position
-to the end of the data currently
-in memory. The filtering is not applied (or unapplied) to
-pings earlier in the data file than the current position.
-The <B>Reset</B> button restores the filter settings that
-were applied last.
-<DT><B>Controls->Filters->Median Spike Fllter</B>
-
-<DD>
-This toggle button turns automatic median filtering of
-bathymetry profiles on and off.
-When median filtering is enabled, the median depth is
-calculated for each bathymetry ping. Each sounding in the
-ping is compared with the median value; any sounding that
-differs from the median by a percentage
-greater than a threshold percentage
-is flagged as bad data.
-<DT><B>Controls->Filters->% Median Depth Threshold</B>
-
-<DD>
-This slider sets the threshold of the median depth
-filter in units of percentage of the median depth.
-<DT><B>Controls->Filters->Wrong Side Fllter</B>
-
-<DD>
-This toggle button turns automatic wrong side filtering of
-bathymetry profiles on and off. This filter expects
-bathymetry beams to be numbered from port to
-starboard. Any beam numbered less than the
-center beam with a positive
-(starboard) acrosstrack distance is considered to
-be on the "wrong side", and any beam numbered higher than
-the center beam with a negative (port) acrosstrack distance
-is similarly regarded. For most swath data, the center
-beam occurs near the midway point in the beam list. This
-algorithm ignores apparent wrong side beams close to
-the midway beam, where close is defined as being within
-a threshold number of the midway beam.
-<DT><B>Controls->Filters->Beams from Center Threshold</B>
-
-<DD>
-This slider sets the threshold of beam locations
-checked by the wrong side filter.
-<DT><B>Controls->Filters->Flag by Beam Number</B>
-
-<DD>
-This toggle button turns automatic beam flagging by
-beam number on and off. The flagging is controlled by
-start and end beam number values (set by the two
-sliders discussed immediately below). If the start beam
-number is less than or equal to the end beam number, then
-all beams between and including the start and end are
-flagged, producing a flagged zone within the swath. If
-the start beam number is greater than the end beam number,
-then all beams before and including the end beam are flagged,
-and all beams including and after the start beam are flagged.
-This produces flagging of both swath edges.
-<DT><B>Controls->Filters->Start Flagging Beam Number</B>
-
-<DD>
-This slider sets the beam number at which flagging by beam number starts.
-<DT><B>Controls->Filters->End Flagging Beam Number</B>
-
-<DD>
-This slider sets the beam number at which flagging by beam number ends.
-<DT><B>Controls->Filters->Flag by Distance</B>
-
-<DD>
-This toggle button turns automatic beam flagging by
-acrosstrack distance on and off. The flagging is controlled by
-start and end distance values (set by the two
-sliders discussed immediately below). If the start distance
-is less than or equal to the end distance, then
-all beams with acrosstrack distances between
-the start and end distances are
-flagged, producing a flagged zone within the swath. If
-the start distance is greater than the end distance,
-then all beams with acrosstrack distance less than
-the end distance are flagged,
-and all beams with acrosstrack distance greater than
-the start distance are flagged.
-This produces flagging of both swath edges.
-<DT><B>Controls->Filters->Start Flagging Distance</B>
-
-<DD>
-This slider sets the beam number at which flagging
-by acrosstrack distance starts.
-<DT><B>Controls->Filters->End Flagging Distance</B>
-
-<DD>
-This slider sets the beam number at which flagging
-by acrosstrack distance ends.
-<DT><B>Controls->Reverse Right/Left Key Macros</B>
-
-<DD>
-This toggle button, when set, reverses the
-key macros associated with flagging all beams
-to the left or right of the last picked beam. This
-means that the 'A', 'a', 'J', and 'j' keys will
-flag to the right rather than to the left. Similarly,
-the  'D', 'd', 'L', and 'l' keys will flag to the
-left rather than to the right. This option allows users
-to conveniently handle swath bathymetry in which the
-beams are mistakenly ordered starboard to port instead
-of the usual port to starboard.
-<DT><B>Controls->Reverse Mouse Buttons</B>
-
-<DD>
-This toggle button, when set, reverses the meaning of
-the right and left mouse buttons. This option is for
-the convenience of left-handed users.
-<DT><B>Start</B>
-
-<DD>
-This button causes the set of displayed pings to step backward to the
-beginning of the current buffer. The middle mouse button causes
-the same action if the 'G' or 'g' key is down.
-<DT><B>Reverse</B>
-
-<DD>
-This button causes the set of displayed pings to step <I>nstep</I>
-pings backward in the current buffer.  The middle mouse button causes
-the same action.
-<DT><B>Forward</B>
-
-<DD>
-This button causes the set of displayed pings to step <I>nstep</I>
-pings forward in the current buffer.  The right mouse button causes
-the same action.
-<DT><B>End</B>
-
-<DD>
-This button causes the set of displayed pings to step forward to the
-end of the current buffer. The right mouse button causes
-the same action if the 'G' or 'g' key is down.
-<DT><B>Next Buffer</B>
-
-<DD>
-This button causes the program to write out the data from the
-current buffer and then read in and display the next buffer.
-If there is no more data to be read in after the current buffer
-has been written out, then the input and output files are closed.
-<DT><B>Done | Next File</B>
-
-<DD>
-When the last file in the list of files available for editing has been loaded,
-this button shows as "Done". Otherwise, it shows as "Next File". In either
-case, this button causes the program to write out all of the edited navigation
-data and then close the current file. If the current file is not the last
-one in the available list, then the next unlocked file will be loaded for editing.
-<DT><B>Quit</B>
-
-<DD>
-This button causes the program to exit gracefully.  If a data file
-has been loaded, all of the edited navigation will be written to the output file
-before exiting.
-<DT><B>About</B>
-
-<DD>
-This button causes the program to bring up a dialog showing the
-program's name, version, and authors.
-<DT><B>Acrosstrack Width</B>
-
-<DD>
-This slider sets the width of the plot in meters; in general this
-value should be slightly larger than the swath width of the data
-being edited. If a particular value is desired which cannot be
-obtained by dragging the slider (e.g., the user wants a plot
-width of 10 meters but the slider jumps from 1 to 47), the slider
-can be changed by increments of 1 by clicking with the left button
-inside the slider area, but not on the slider itself.
-<DT><B>Vertical Exageration</B>
-
-<DD>
-This slider sets the depth scale in terms of vertical exageration.
-The depth scale will change as the cross track distance scale is
-changed to maintain the same vertical exageration.
-If a particular value is desired which cannot be
-obtained by dragging the slider, the slider
-can be changed by increments of 0.01 by clicking with the left button
-inside the slider area, but not on the slider itself.
-<DT><B>Mode</B>
-
-<DD>
-This set of radio buttons allows the user to specify the edit mode. If
-mode is set to <I>Toggle</I>, then clicking the left mouse button will
-cause the nearest beam to toggle between flagged and unflagged.  If mode
-is set to <I>Pick</I>, then clicking the left mouse button will cause
-the nearest unflagged beam to be flagged.  If mode
-is set to <I>Erase</I>, then the cursor will change to an erasor and
-any beam with the cursor while the left mouse button is held down
-will be flagged.  If mode is set to <I>Restore</I>, the behavior will
-be the same as for <I>Erase</I> except that the affected beams will be
-unflagged instead of flagged. In <I>Grab</I> mode, a red rectangle is drawn
-as the mouse is dragged with the left button down. When the button is
-released, all unflagged soundings within the rectangle are flagged.
-<I>Info</I> mode acts like pick mode, except that instead of flagging
-the nearest sounding, the program displays information about the
-selected ping and sounding above the bathymetry profile box.
-The edit mode can also be set using key macros (see the keyboard
-action section):
-<BR>
-
-<BR> <TT>       </TT>Toggle:<TT> </TT><TT>        </TT>'Q', 'q', 'U', 'u'<BR>
-<BR> <TT>       </TT>Pick:<TT>   </TT><TT>        </TT>'W', 'w', 'I', 'i'<BR>
-<BR> <TT>       </TT>Erase:<TT>  </TT><TT>        </TT>'E', 'e', 'O', 'o'<BR>
-<BR> <TT>       </TT>Restore:<TT>        </TT>'R', 'r', 'P', 'p'<BR>
-<BR> <TT>       </TT>Grab:<TT>   </TT><TT>        </TT>'Y', 'y', '}, ']'<BR>
-<BR> <TT>       </TT>Info:<TT>   </TT><TT>        </TT>'T', 't', '{', '['<BR>
-<DT><B>Unflag View</B>
-
-<DD>
-This button flags all unflagged beams among the currently
-displayed pings. Pings in the buffer before or after the current
-display are unaffected.
-<DT><B>Unflag View</B>
-
-<DD>
-This button unflags all flagged beams among the currently
-displayed pings. Pings in the buffer before or after the current
-display are unaffected.
-<DT><B>Unflag Forward</B>
-
-<DD>
-This button  unflags all flagged beams among all pings from
-the start of the current display to the end of the current
-data buffer. Pings before the start of the current display are
-unaffected.
-<DT><B>Number of pings shown</B>
-
-<DD>
-This slider sets the number of pings shown at a time.
-<DT><B>Number of pings to step</B>
-
-<DD>
-This slider sets the number of pings to step when the <B>Forward</B>
-or <B>Reverse</B> buttons are pushed.
-<P>
-</DL>
-<A NAME="lbAI"> </A>
-<H2>MOUSE ACTIONS</H2>
-
-<DL COMPACT>
-<DT><B>Left Mouse Button</B>
-
-<DD>
-The left mouse button is used to pick beams.  Good beams are
-shown as filled black squares and bad (flagged) beams as unfilled red
-or green squares.  The
-result of picking a particular beam depends on the current edit mode,
-as set by the <B>Mode</B> button or keyboard macros defined below. The
-last picked beam (and ping) is remembered for use with
-some of the keyboard actions described below.
-<DT><B>Middle Mouse Button</B>
-
-<DD>
-The middle mouse button causes the set of displayed pings to step <I>nstep</I>
-pings backward in the current buffer.  The control button <B>Reverse</B> causes
-the same action. If the 'G' or 'g' key is depressed, the display will jump
-to the beginning of the current buffer.
-<DT><B>Right Mouse Button</B>
-
-<DD>
-The right mouse button causes the set of displayed pings to step <I>nstep</I>
-pings forward in the current buffer.  The control button <B>Forward</B> causes
-the same action. If the 'G' or 'g' key is depressed, the display will jump
-to the end of the current buffer.
-<P>
-</DL>
-<A NAME="lbAJ"> </A>
-<H2>KEYBOARD ACTIONS</H2>
-
-<DL COMPACT>
-<DT><B>'G' or 'g'</B>
-
-<DD>
-<B>Big Jump:</B>
-
-Scolling forward while pressing one of these keys jumps to the end
-of the current buffer, and scrolling backward jumps to the beginning of the buffer.
-<DT><B>'Z', 'z', 'M', or 'm'</B>
-
-<DD>
-<B>Bad Ping:</B>
-
-Pressing one of these keys causes all of the beams in the last picked
-ping to be flagged as bad.
-<DT><B>'X', 'x', '<', or ','</B>
-
-<DD>
-<B>Right:</B>
-
-Pressing one of these keys causes all of the unflagged beams
-in the current display to to be flagged as bad. This is equivalent
-to the CFlag View button.
-<DT><B>'C', 'c', '>', or '.'</B>
-
-<DD>
-<B>Right:</B>
-
-Pressing one of these keys causes all of the flagged beams
-in the current display to to be unflagged. This is equivalent
-to the <B>Unflag View</B> button.
-<DT><B>'S', 's', 'K', or 'k'</B>
-
-<DD>
-<B>Good Ping:</B>
-
-Pressing one of these keys causes all of the beams in the last picked
-ping to be unflagged as good.
-<DT><B>'A', 'a', 'J', or 'j'</B>
-
-<DD>
-<B>Left:</B>
-
-Pressing one of these keys causes all of the beams including and to
-the left of the last picked beam to be flagged as bad.
-<DT><B>'D', 'd', 'L', or 'l'</B>
-
-<DD>
-<B>Right:</B>
-
-Pressing one of these keys causes all of the beams including and to
-the right of the last picked beam to be flagged as bad.
-<DT><B>'!'</B>
-
-<DD>
-<B>Zero Ping:</B>
-
-Pressing this key causes all of the beams in the ping
-associated with the last picked beam to be zeroed. This
-should be used only for completely ridiculous values, as
-the values are not recoverable.
-<DT><B>'Q', 'q', 'U', or 'u'</B>
-
-<DD>
-<B>Toggle Mode:</B>
-
-Pressing one of these keys sets the edit mode to "toggle" so that
-clicking the left mouse button will cause
-the nearest beam to toggle between flagged and unflagged.
-The edit mode can also be set using the <B>Mode</B> toggle buttons.
-<DT><B>'W', 'w', 'I', or 'i'</B>
-
-<DD>
-<B>Pick Mode:</B>
-
-Pressing one of these keys sets the edit mode to "pick" so that
-clicking the left mouse button will cause
-the nearest unflagged beam to be flagged.
-The edit mode can also be set using the <B>Mode</B> toggle buttons.
-<DT><B>'E', 'e', 'O', or 'o'</B>
-
-<DD>
-<B>Erase Mode:</B>
-
-Pressing one of these keys sets the edit mode to "erase" so that
-clicking the left mouse button will cause
-any beam under the cursor while the left mouse button is held down
-to be flagged.
-The edit mode can also be set using the <B>Mode</B> toggle buttons.
-<DT><B>'R', 'r', 'P', or 'p'</B>
-
-<DD>
-<B>Restore Mode:</B>
-
-Pressing one of these keys sets the edit mode to "restore" so that
-clicking the left mouse button will cause any beam under the cursor
-while the left mouse button is held down to be unflagged.
-The edit mode can also be set using the <B>Mode</B> toggle buttons.
-<DT><B>'T', 't', '{', or '['</B>
-
-<DD>
-<B>Grab Mode:</B>
-
-Pressing one of these keys sets the edit mode to "grab" so that
-dragging the left mouse button will draw a red rectangle. Any beams
-inside the rectangle when the left mouse button is released will
-be flagged. The edit mode can also be set using the <B>Mode</B>
-toggle buttons.
-<DT><B>'Y', 'y', '}', or ']'</B>
-
-<DD>
-<B>Info Mode:</B>
-
-Pressing one of these keys sets the edit mode to "info" so that
-clicking the left mouse button will cause information about the
-nearest beam to be displayed above the bathymetry profile box.
-The edit mode can also be set using the <B>Mode</B> toggle buttons.
-<DT><B>'2'</B>
-
-<DD>
-Sets the <B>mbedit</B> display so that the
-bathymetry acrosstrack profiles are plotted with vertical
-offsets between each profile (in waterfall fashion).
-<DT><B>'3'</B>
-
-<DD>
-Sets the <B>mbedit</B> display so that the
-bathymetry acrosstrack profiles are viewed in the alongtrack
-direction without vertical offsets between the pings.
-<DT><B>'4'</B>
-
-<DD>
-Sets the <B>mbedit</B> display so that the
-bathymetry acrosstrack profiles are viewed in the acrosstrack
-direction without vertical offsets between the pings.
-<P>
-</DL>
-<A NAME="lbAK"> </A>
-<H2>SEE ALSO</H2>
-
-<B><A HREF="mbsystem.html">mbsystem</A></B>(1), <B><A HREF="mbprocess.html">mbprocess</A></B>(1), <B><A HREF="mbset.html">mbset</A></B>(1),
-<B><A HREF="mbclean.html">mbclean</A></B>(1), <B><A HREF="mbeditviz.html">mbeditviz</A></B>(1), <B><A HREF="mbinfo.html">mbinfo</A></B>(1)
-<P>
-<A NAME="lbAL"> </A>
-<H2>BUGS</H2>
-
-This program is only fun when the data are good. The main
-window for <B>mbedit</B> is not resizable.
-<P>
-
-<HR>
-<A NAME="index"> </A><H2>Index</H2>
-<DL>
-<DT><A HREF="#lbAB">NAME</A><DD>
-<DT><A HREF="#lbAC">VERSION</A><DD>
-<DT><A HREF="#lbAD">SYNOPSIS</A><DD>
-<DT><A HREF="#lbAE">DESCRIPTION</A><DD>
-<DT><A HREF="#lbAF">AUTHORSHIP</A><DD>
-<DT><A HREF="#lbAG">OPTIONS</A><DD>
-<DT><A HREF="#lbAH">INTERACTIVE CONTROLS</A><DD>
-<DT><A HREF="#lbAI">MOUSE ACTIONS</A><DD>
-<DT><A HREF="#lbAJ">KEYBOARD ACTIONS</A><DD>
-<DT><A HREF="#lbAK">SEE ALSO</A><DD>
-<DT><A HREF="#lbAL">BUGS</A><DD>
-</DL>
-<HR>
-</PRE>
-
-<CENTER><P><BR>
-Last Updated: 3 June 2013</P></CENTER>
-
-<HR>
-<P><A HREF="mbsystem_man_list.html">Return to list of MB-System manual pages...</A></P>
-<P><A HREF="mbsystem_home.html"><IMG SRC="mbsystem_logo_small.gif" BORDER=0 HEIGHT=55 WIDTH=158 ALIGN=BOTTOM></A><A HREF="mbsystem_home.html">Back
-to MB-System Home Page...</A></P>
-
-</BODY>
-</HTML>
diff --git a/src/html/mbeditviz.html b/src/html/mbeditviz.html
deleted file mode 100644
index edf274a..0000000
--- a/src/html/mbeditviz.html
+++ /dev/null
@@ -1,229 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<HTML VERSION="2.0">
-<HEAD>
-   <TITLE>MB-System Unix Manual Page: mbeditviz</TITLE>
-<!-- WEBMAGIC VERSION NUMBER="2.0.2" -->
-<!-- WEBMAGIC TRANSLATION NAME="ServerRoot" SRC="/var/www/htdocs/" DST="/" -->
-<!-- WEBMAGIC TRANSLATION NAME="ProjectRoot" SRC="./" DST="" -->
-</HEAD>
-<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#336699" VLINK="#997040" ALINK="#CC9900">
-<BODY>
-<CENTER><H3><U>MB-System Unix Manual Page</U></H3></CENTER>
-<PRE>
-<H1>MBeditviz</H1>
-Section:  MB-System 5.0  (1)<BR>Updated:  2 June 2014 <BR><A HREF="#index">Index</A>
-<HR>
-
-<A NAME="lbAB"> </A>
-<H2>NAME</H2>
-
-<B>MBeditviz</B> - 3D visualization-based editing of swath bathymetry soundings.
-<P>
-<A NAME="lbAC"> </A>
-<H2>VERSION</H2>
-
-Version 5.0
-<P>
-<A NAME="lbAD"> </A>
-<H2>SYNOPSIS</H2>
-
-<B>MBeditviz</B> [-I<I>datalist</I> <B>-V -H</B>]
-<P>
-<A NAME="lbAE"> </A>
-<H2>DESCRIPTION</H2>
-
-<P>
-<I>Overview</I>
-<P>
-<B>MBeditviz</B> is an interactive 2D/3D visualization-based tool for editing swath
-bathymetry data. The bathymetry data from selected files are read into memory, gridded,
-and displayed in the same 2D/3D visualization environment used by <B>MBgrdviz</B>. In
-this environment, users can select arbitrary areas or regions. All of the soundings in
-the selected areas are displayed in a 3D "cloud" that can be rotated, zoomed, and exaggerated.
-These soundings can also be edited using the same edit mouse modes as in <B>MBedit</B>.
-<B>MBeditviz</B> operates with "edit save files" (*.esf) in the same fashion as <B>MBedit</B>,
-<B>mbclean</B>, and <B>mbareaclean</B>. To apply the edits in processing, simply run <B>mbprocess</B>
-on a datalist referencing the relevant files.
-<P>
-<I>Starting Up</I>
-<P>
-The initial MBeditviz display shows a list of the swath files you have identified by using
-the "File->Open Swath File" menu item. The list has four columns.
-The first (left-most) column is either blank or shows "<locked>" or "<loaded>".
-If a file is loaded for gridding and editing by this program, it shows as "<loaded>".
-If a file is being edited or processed by another program, it shows as
-"<locked>". Locked files cannot be opened for editing, and any file
-loaded for editing by <B>MBeditviz</B> will show as "locked" to other
-programs. The second column is either blank or shows "<esf>". This indicates if
-a file has been previously edited so that an edit save file already
-exists. The third column indicates, if the file is loaded, whether asynchronous heading ("H"),
-sonar depth ("S"), and attitude ("A") time series data have been loaded along with the
-swath bathymetry data. These asynchronous data are required in order to use <B>MBeditviz</B>
-to assess time lag issues, but are not available for all datasets.
-The fourth and fifth columns show the filename and the <B>MBIO</B>
-format id, respectively.
-Users can select one of the files in the available list. If the "Edit Selected File"
-button is clicked, the selected file will be opened for editing (and any
-file already loaded will be closed first). If the "Remove Selected File"
-button is selected, then the selected file will be removed from the available
-list.
-<P>
-<P>
-You can select some or all of the files in the list.
-When you click on the "View All Files" or the "View Selected Files", MBeditviz reads the
-specified files, loading all of the soundings into memory. The program then brings up a
-"Grid Parameters" dialog which suggests a grid cell size and shows the implied dimensions
-of a grid enclosing all of the data. The two issues to keep in mind are that you want the
-grid to be reasonably sized (dimensions <2500 or so on my laptop) and that no interpolation
-is applied in the gridding, so too small a grid cell size will leave gaps between soundings
-in the map view. When you click "Apply", MBeditviz grids the soundings, and then displays
-the grid using the same 2D/3D interface as MBgrdviz, including the navigation associated with
-the selected swath files.
-<P>
-The navigation associated with the selected swath files will be displayed as well, and can
-be selected or queried by setting the mouse mode to
-<P>
-Data files that have been previously edited with <B>MBeditviz</B>, <B>MBedit</B>, <B>mbclean</B>,
-or <B>mbareaclean</B> will have two related ancilliary files with suffixes ".esf" and ".par".
-The "*.esf" file is the edit save file containing all of the flag and unflag edit events
-generated for soundings in a data file. The "*.par" file is the processing parameter file
-that contains all of the processing parameters and instructions to be applied by the program
-<B>mbprocess</B>. <B>MBeditviz</B> will read and apply the pre-existing edit events as files
-are read into memory. The initial gridded view of the bathymetry will reflect all of the
-pre-existing edit events.
-<P>
-<I>Displaying a "Sounding Cloud"</I>
-<P>
-Once you have an MBeditviz survey display, set the mouse mode to "Pick Area" and either use
-the left button to drag a square "region", or use the middle button to drag an arbitrarily
-oriented "area" (also, if an area is defined the right button decreases/increases the width
-of the area). Each time you define or change a picked region or area, MBeditviz will display
-the point cloud of soundings located in the region or area. Since <B>MBeditviz</B> also displays
-the swath file navigation, users can also change the mouse mode to "Pick Nav" or "Pick Nav File"
-and select portions of the navigation. In this case the sounding cloud will encompass all of
-the data associated with the selected navigation. The 3Dsoundings view is manipulated
-using the middle and right mouse buttons in either rotation mode or zoom/exagerate mode.
-<P>
-You can edit the soundings in the point cloud context using the left mouse button. The
-editing mouse modes work just like MBedit. The View menu in the
-point cloud display lets you show, or not show, the flagged soundings (which are displayed in red).
-<P>
-<I>Changing Sounding Colors</I>
-<P>
-The [3D Soundings]:<Action> pulldown menu has seven buttons that allow the user to change the
-display color of all currently selected unflagged soundings. Each of these options
-(black, red, yellow, green, bluegreen, blue, purple) acts on the soundings  displayed in
-the 3D Soundings window, and these color settings are saved when the 3D Soundings window is
-dismissed or redisplayed. This feature can aid in using <B>MBeditviz</B> for patch test
-(bias parameter) analysis. For instance, if a survey includes reciprocal lines (two coincident
-survey lines collected in opposite directions), one can use a narrow strip of soundings across
-the swaths to assess the roll bias value. This analysis is easier if the soundings from the
-two reciprocal swaths can be differentiated. To accomplish this, a user can select one line using the
-[MBview]:<Pick Nav> mode, bringing those associated soundings up in the 3D Soundings window,
-and then set all those soundings to be colored green. The soundings of the opposite line
-can be similarly colored purple. Then, selecting a narrow area across the reciprocal lines
-will select and display soundings from both lines, and those soundings will be green or
-purple depending on which line they are part of.
-<P>
-<I>Applying the Bathyemtry Edits</I>
-<P>
-When you dismiss the gridded view, the esf files of the affected files will be updated just
-as they are with MBedit. The program also modifies the <B>mbprocess</B> parameter file
-for the input file by specifying the edit save file and setting the <B>mbprocess</B> mode to
-apply the edits when generating a processed swath output file. If no parameter file exists,
-<B>mbeditviz</B> creates one.
-<P>
-<A NAME="lbAF"> </A>
-<H2>AUTHORSHIP</H2>
-
-David W. Caress (<A HREF="mailto:caress at mbari.org">caress at mbari.org</A>)
-<BR>
-
-<BR>  Monterey Bay Aquarium Research Institute
-<BR>
-
-Dale N. Chayes (<A HREF="mailto:dale at ldeo.columbia.edu">dale at ldeo.columbia.edu</A>)
-<BR>
-
-<BR>  Lamont-Doherty Earth Observatory
-<P>
-<A NAME="lbAG"> </A>
-<H2>OPTIONS</H2>
-
-<DL COMPACT>
-<DT><B>-H</B>
-
-<DD>
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-<DT><B>-I</B>
-
-<DD>
-<I>datalist</I>
-<BR>
-
-Sets an <B>MB-System</B> datalist file to be parsed on input for swath data files
-to list as available for editing.
-This option is usually used when <B>MBeditviz</B> is started
-automatically from some other process, such as <B>MBgrdviz</B>.
-<DT><B>-V</B>
-
-<DD>
-Normally, <B>MBeditviz</B> outputs limited information to the stderr stream.
-If the <B>-V</B> flag is given, then <B>MBeditviz</B> works in a "verbose" mode and
-outputs the program version being used, all error status messages,
-and a large amount of other information including all of the
-beams flagged or zeroed.
-<P>
-</DL>
-<A NAME="lbAH"> </A>
-<H2>INTERACTIVE CONTROLS</H2>
-
-<P>
-<A NAME="lbAI"> </A>
-<H2>MOUSE ACTIONS</H2>
-
-<P>
-<A NAME="lbAJ"> </A>
-<H2>KEYBOARD ACTIONS</H2>
-
-<P>
-<A NAME="lbAK"> </A>
-<H2>SEE ALSO</H2>
-
-<B><A HREF="mbsystem.html">mbsystem</A></B>(1), <B><A HREF="mbedit.html">mbedit</A></B>(1), <B><A HREF="mbprocess.html">mbprocess</A></B>(1) <B><A HREF="mbset.html">mbset</A></B>(1)
-<P>
-<A NAME="lbAL"> </A>
-<H2>BUGS</H2>
-
-This program is not done, nor is it adequately documented.
-<P>
-
-<HR>
-<A NAME="index"> </A><H2>Index</H2>
-<DL>
-<DT><A HREF="#lbAB">NAME</A><DD>
-<DT><A HREF="#lbAC">VERSION</A><DD>
-<DT><A HREF="#lbAD">SYNOPSIS</A><DD>
-<DT><A HREF="#lbAE">DESCRIPTION</A><DD>
-<DT><A HREF="#lbAF">AUTHORSHIP</A><DD>
-<DT><A HREF="#lbAG">OPTIONS</A><DD>
-<DT><A HREF="#lbAH">INTERACTIVE CONTROLS</A><DD>
-<DT><A HREF="#lbAI">MOUSE ACTIONS</A><DD>
-<DT><A HREF="#lbAJ">KEYBOARD ACTIONS</A><DD>
-<DT><A HREF="#lbAK">SEE ALSO</A><DD>
-<DT><A HREF="#lbAL">BUGS</A><DD>
-</DL>
-<HR>
-</PRE>
-
-<CENTER><P><BR>
-Last Updated: 2 June 2014</P></CENTER>
-
-<HR>
-<P><A HREF="mbsystem_man_list.html">Return to list of MB-System manual pages...</A></P>
-<P><A HREF="mbsystem_home.html"><IMG SRC="mbsystem_logo_small.gif" BORDER=0 HEIGHT=55 WIDTH=158 ALIGN=BOTTOM></A><A HREF="mbsystem_home.html">Back
-to MB-System Home Page...</A></P>
-
-</BODY>
-</HTML>
diff --git a/src/html/mbextractsegy.html b/src/html/mbextractsegy.html
deleted file mode 100644
index 41bb24d..0000000
--- a/src/html/mbextractsegy.html
+++ /dev/null
@@ -1,440 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<HTML VERSION="2.0">
-<HEAD>
-   <TITLE>MB-System Unix Manual Page: mbextractsegy</TITLE>
-<!-- WEBMAGIC VERSION NUMBER="2.0.2" -->
-<!-- WEBMAGIC TRANSLATION NAME="ServerRoot" SRC="/var/www/htdocs/" DST="/" -->
-<!-- WEBMAGIC TRANSLATION NAME="ProjectRoot" SRC="./" DST="" -->
-</HEAD>
-<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#336699" VLINK="#997040" ALINK="#CC9900">
-<BODY>
-<CENTER><H3><U>MB-System Unix Manual Page</U></H3></CENTER>
-<PRE>
-<H1>mbextractsegy</H1>
-Section:  MB-System 5.0  (1)<BR>Updated:  3 June 2013 <BR><A HREF="#index">Index</A>
-<HR>
-
-<A NAME="lbAB"> </A>
-<H2>NAME</H2>
-
-<B>mbextractsegy</B> - extracts subbottom profiler, center beam reflection,
-or seismic reflection data from swath data supported by MB-System and
-rewrites it as a SEGY file.
-<P>
-<A NAME="lbAC"> </A>
-<H2>VERSION</H2>
-
-Version 5.0
-<P>
-<A NAME="lbAD"> </A>
-<H2>SYNOPSIS</H2>
-
-<B>mbextractsegy</B> [<B>-B</B><I>yr/mo/da/hr/mn/sc</I> <B>-E</B><I>yr/mo/da/hr/mn/sc</I>
-<B>-F</B><I>format</I> <B>-I</B><I>file</I> <B>-J</B><I>xscale/yscale/maxwidth</I>
-<B>-L</B><I>startline/lineroot</I> <B>-M -O</B><I>segyfile</I> <B>-Q</B><I>routetimefile</I>
-<B>-R</B><I>routefile</I> <B>-S</B><I>sampleformat</I>
-<B>-T</B><I>timeshift</I> <B>-U</B><I>rangethreshold</I> <B>-Z</B><I>plotmax</I> <B>-V -H</B>]
-<P>
-<A NAME="lbAE"> </A>
-<H2>DESCRIPTION</H2>
-
-<B>MBextractsegy</B> is a utility for reading a swath sonar data file
-or files, extracting subbottom profiler, center beam reflection,
-or seismic reflection data, and outputting that selected data
-as a SEGY file. Parameters such as sonar depth, seafloor depth, and
-position are embedded into the SEGY data. The SEGY files are
-output in a form used by the seismic reflection processing package
-<B>SIOSEIS</B>. A "sinf" file containing statistics about the content
-of the SEGY file is created automatically by <B>MBextractsegy</B>; this
-file is named by adding a ".sinf" suffix to the SEGY filename.
-<P>
-At present, the only swath data formats from which subbottom data
-can be extracted are format 88 (Reson 7k format), format 132
-(Edgetech Jstar format), and format 133 (Edgetech Jstar format).
-<P>
-The extracted segy data file(s) can be organized three ways. If the <B>-O</B>
-option is used to specify a single segy output file, then all of the
-segy data will be output to that single file. If either the <B>-Q</B> or
-<B>-R</B> options are used to specify a survey route file that includes
-the waypoints covered while collecting the data file(s) referenced by
-<B>-I</B><I>file</I>, then the output segy data will be broken up by the
-sequential lines defined by the waypoints. The <B>-Q</B> option specifies a
-route file that includes the time at which each waypoint is reached in the
-data, and the <B>-R</B> option specifies a route file of the form exported by
-<B>MBgrdviz</B>. In the waypoint-driven case each output segy file will be named
-using the line root name specified by <B>-L</B><I>startline/lineroot</I> with a
-sequential line number starting from <I>startline</I>. If neither the <B>-O</B> or
-<B>-L</B> options are used, each input swath file will have a corresponding
-segy output file with the ".segy" suffix added to the original filename.
-<P>
-<B>MBextractsegy</B> also generates a "first cut plot" script that will generate
-grayscale section plots in Postscript of each segy file using the programs
-<B>MBsegygrid</B> and <B>mbm_grdplot</B>. The <B>-Z</B> sets the trace value
-corresponding to the maximum grayscale (black) in the section plots.
-<P>
-<A NAME="lbAF"> </A>
-<H2>AUTHORSHIP</H2>
-
-David W. Caress (<A HREF="mailto:caress at mbari.org">caress at mbari.org</A>)
-<BR>
-
-<BR>  Monterey Bay Aquarium Research Institute
-<BR>
-
-Dale N. Chayes (<A HREF="mailto:dale at ldeo.columbia.edu">dale at ldeo.columbia.edu</A>)
-<BR>
-
-<BR>  Lamont-Doherty Earth Observatory
-<P>
-<A NAME="lbAG"> </A>
-<H2>OPTIONS</H2>
-
-<DL COMPACT>
-<DT><B>-B</B>
-
-<DD>
-<I>yr/mo/da/hr/mn/sc</I>
-<BR>
-
-This option sets the starting time for data allowed in the input data.
-The <B>-E</B> option sets the ending time for data. If the
-starting time is before the ending time, then any data
-with a time stamp before the starting time or after the
-ending time is ignored. If instead the starting time is
-after the ending time, then any data between the ending
-and starting time will be ignored. This scheme allows time
-windowing both inside and outside a specified interval.
-Default: <I>yr/mo/da/hr/mn/sc</I> = 1962/2/21/10/30/0.
-<B>-E</B>
-
-<I>yr/mo/da/hr/mn/sc</I>
-<BR>
-
-This option sets the ending time for data allowed in the input data.
-The <B>-B</B> option sets the starting time for data. If the
-starting time is before the ending time, then any data
-with a time stamp before the starting time or after the
-ending time is ignored. If instead the starting time is
-after the ending time, then any data between the ending
-and starting time will be ignored. This scheme allows time
-windowing both inside and outside a specified interval.
-Default: <I>yr/mo/da/hr/mn/sc</I> = 2062/2/21/10/30/0.
-<DT><B>-F</B>
-
-<DD>
-<I>format</I>
-<BR>
-
-Sets the data format used if the input is read from stdin
-or from a file. If <I>format</I> < 0, then the input file specified
-with the <B>-I</B> option will actually contain a list of input swath sonar
-data files. This program uses the <B>MBIO</B> library
-and will read or write any swath sonar
-format supported by <B>MBIO</B>. A list of the swath sonar data formats
-currently supported by <B>MBIO</B> and their identifier values
-is given in the <B>MBIO</B> manual page. The default format is set
-using the program <B>mbdefaults</B>..
-<DT><B>-H</B>
-
-<DD>
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-<DT><B>-I</B>
-
-<DD>
-<I>infile</I>
-<BR>
-
-Sets the input file path. If <I>format</I> > 0 (set with the
-<B>-f</B> option or <B>mbdefaults</B>) then the swath sonar data contained in <I>infile</I>
-is read and processed. If <I>format</I> < 0, then <I>infile</I>
-is assumed to be an ascii file containing a list of the input swath sonar
-data files to be processed and their formats.  The program will read
-the data in each one of these files.
-In the <I>infile</I> file, each
-data file should be followed by a data format identifier, e.g.:
-<BR> <TT>       </TT>datafile1 11<BR>
-<BR> <TT>       </TT>datafile2 24<BR>
-<BR>
-
-This program uses the <B>MBIO</B> library and will read or write any swath sonar
-format supported by <B>MBIO</B>. A list of the swath sonar data formats
-currently supported by <B>MBIO</B> and their identifier values
-is given in the <B>MBIO</B> manual page. Default: <I>infile</I> = "stdin".
-<DT><B>-J</B>
-
-<DD>
-<I>xscale/yscale/maxwidth</I>
-<BR>
-
-Sets the scale of the default section plots. The <I>xscale</I> value is
-in inches per shot, and the <I>yscale</I> value is in inches per second.
-The <I>maxwidth</I> value sets the maximum plot width in inches. If
-<I>xscale</I> and the shot range imply a width greater than <I>maxwidth</I>,
-then the section will be broken up into multiple plots.
-Default: <I>xscale</I> = 0.01; <I>yscale</I> = 75; <I>maxwidth</I> = 45.0
-<DT><B>-L</B>
-
-<DD>
-<I>startline/lineroot</I>
-<BR>
-
-This option sets the starting line number and the output filename root
-used when <B>-R</B> is specified so that data are output according
-to planned survey lines. Default: <I>startline</I> = 1; <I>lineroot</I> = "sbp".
-<DT><B>-M</B>
-
-<DD>
-<BR>
-
-This option causes <B>mbextractsegy</B> to omit data during turns when
-extracting into line files according to a specified set of waypoints
-(<B>-R</B> option). The traces will not be output until the heading is
-within 15 degrees of the next survey line's bearing.
-<DT><B>-O</B>
-
-<DD>
-<BR>
-
-This option sets the output SEGY file path. If neither <B>-O</B> nore <B>-R</B> are invoked,
-the output SEGY filename (or files if a datalist is being processed) will
-be the input swath filename with ".segy" appended.
-<DT><B>-Q</B>
-
-<DD>
-<I>routetimefile</I>
-<BR>
-
-This option specifies route file containing the times that the survey reached
-the intended waypoints. This text file consists of lines of the form:
-<BR> <TT>       </TT>count waypoint longitude latitude heading time_d<BR>
-<BR>
-
-where count is just an integer counter starting at 0, waypoint is the waypoint
-number starting at 0, longitude and latitude are the waypoint position in
-decimal degrees, heading is the heading in decimal degrees, and time_d is
-the unix or epoch time (time since 00:00:00 January 1, 1970) in decimal
-seconds that the survey reached this waypoint. This file can be generated from
-an <B>mbgrdviz</B> route file and survey data using the program <B>mbroutetime</B>.
-If <I>routetimefile</I> is specified, <B>mbextractsegy</B>
-will output SEGY data in files corresponding to the planned survey lines.
-The output SEGY file names will be based on <I>lineroot</I> and will include
-the line number starting with <I>starline</I>, both of which are specified
-using the <B>-L</B> options.  If neither <B>-O</B> nore <B>-R</B> are invoked,
-the output SEGY filename (or files if a datalist is being processed) will
-be the input swath filename with ".segy" appended.
-<DT><B>-R</B>
-
-<DD>
-<I>routefile</I>
-<BR>
-
-This option specifies an <B>mbgrdviz</B> route file containing the intended
-waypoints of the survey. If <I>routefile</I> is specified, <B>mbextractsegy</B>
-will output SEGY data in files corresponding to the planned survey lines.
-The output SEGY file names will be based on <I>lineroot</I> and will include
-the line number starting with <I>starline</I>, both of which are specified
-using the <B>-L</B> options.  If neither <B>-O</B> nore <B>-R</B> are invoked,
-the output SEGY filename (or files if a datalist is being processed) will
-be the input swath filename with ".segy" appended.
-<DT><B>-S</B>
-
-<DD>
-<I>sampleformat</I>
-<BR>
-
-Sets the sample format desired for use in the output SEGY file. Options include:
-<BR> <TT>       </TT>MB_SEGY_SAMPLEFORMAT_NONE           1<BR>
-<BR> <TT>       </TT>MB_SEGY_SAMPLEFORMAT_TRACE          2<BR>
-<BR> <TT>       </TT>MB_SEGY_SAMPLEFORMAT_ENVELOPE       3<BR>
-<BR> <TT>       </TT>MB_SEGY_SAMPLEFORMAT_ANALYTIC       4<BR>
-<BR>
-
-MB_SEGY_SAMPLEFORMAT_TRACE implies that the seismic trace is in the original,
-most raw form with both positive and negative values.
-MB_SEGY_SAMPLEFORMAT_ANALYTIC implies that the trace has been
-been transformed from the original time series to an analytic signal containing
-both real and imaginary parts. Both the real and imaginary signals
-are stored in the SEGY file. MB_SEGY_SAMPLEFORMAT_ENVELOPE implies that the
-analytic signal has been reduced back to a single real, positive-only envelope
-signal by taking the magnitude of the real and imaginary parts at every sample.
-It is important to note that this option only sets the desired sample format, and
-the program may find it necessary to store the data in an alternate form. For
-instance, if the user specifies MB_SEGY_SAMPLEFORMAT_TRACE or
-MB_SEGY_SAMPLEFORMAT_ANALYTIC but the swath file only contains envelope data,
-the data will be written in the envelope form. The default value of
-MB_SEGY_SAMPLEFORMAT_NONE allows the program to choose the most appropriate
-sample format.
-<DT><B>-U</B>
-
-<DD>
-<I>rangethreshold</I>
-<BR>
-
-If the <B>-R</B> option is specified, <B>mbextractsegy</B> breaks up the
-output into files corresponding to survey lines specified in a route file.
-This option sets the threshold distance in meters used to determine when
-a waypoint along the route has been reached; the program considers the
-next waypoint reached when the range to the waypoint becomes smaller
-than <I>rangethreshold</I> and then ceases to decrease.
-Default: <I>rangethreshold</I> = 25 m.
-<DT><B>-Z</B>
-
-<DD>
-<I>plotmax</I>
-<BR>
-
-Specifies the trace value corresponding to the maximum grayscale (black)
-in the section plots. Default: <I>plotmax</I> = 50.
-<DT><B>-V</B>
-
-<DD>
-This option increases the verbosity of <B>mbextractsegy</B>, causing it
-to print out messages regarding its progress to stdout.
-<P>
-</DL>
-<A NAME="lbAH"> </A>
-<H2>EXAMPLES</H2>
-
-Suppose that one has collected a set of Reson 7k datafiles incorporating
-multibeam sonar data, sidescan data, and subbottom profiler data, and
-that the filenames are:
-<BR> <TT>       </TT>20040722_152111.s7k<BR>
-<BR> <TT>       </TT>20040722_154429.s7k<BR>
-<BR> <TT>       </TT>20040722_160809.s7k<BR>
-<BR>
-
-<P>
-In order to extract the subbottom data into segy files, one can use
-<B>mbextractsegy</B> on each file in turn, for example:
-<BR> <TT>       </TT>mbextractsegy -I 20040722_152111.s7k<BR>
-<BR>
-
-which yields the following output:
-<BR> <TT>       </TT>2527 records output to segy file 20040722_154429.s7k.segy<BR>
-<BR>
-
-In this command the 7k file format id of 88 is inferred from the
-".7k" filename suffix.
-<P>
-One may also input a datalist file referencing all of the 7k files. The
-contents of a datalist file (typically named datalist.mb-1) would look like:
-<BR> <TT>       </TT>20040722_152111.s7k 88<BR>
-<BR> <TT>       </TT>20040722_154429.s7k 88<BR>
-<BR> <TT>       </TT>20040722_160809.s7k 88<BR>
-<BR>
-
-where the second column is the data format id (see the <B>mbsystem</B> man page
-for a discussion of datalist files). To operate on all the files in
-a single command, use:
-<BR> <TT>       </TT>mbextractsegy -I datalist.mb-1<BR>
-<BR> which yields the following output:
-<BR> <TT>       </TT>2527 records output to segy file 20040722_154429.s7k.segy<BR>
-<BR> <TT>       </TT>2568 records output to segy file 20040722_160809.s7k.segy<BR>
-<BR> <TT>       </TT>2569 records output to segy file 20040722_163148.s7k.segy<BR>
-<BR>
-
-In this command the datalist format id of -1 is inferred from the
-".mb-1" filename suffix.
-<P>
-Use of the <B>-V</B> option causes <B>mbextractsegy</B> to output information
-about every tenth record written to a segy file. So:
-<BR> <TT>       </TT>mbextractsegy -I 20040722_152111.s7k -V<BR>
-<BR>
-
-which yields the following output:
-<BR> <TT>       </TT>2527 records output to segy file 20040722_154429.s7k.segy<BR>
-<BR>
-
-<BR> <TT>       </TT>Outputting subbottom data to segy file 20040722_152111.s7k.segy<BR>
-<BR> <TT>       </TT>file:20040722_152111.s7k record:10 shot:65  2004/204 15:20:42.083 samples:8330 interval:64 usec  minmax: 0.000000 17487.244141<BR>
-<BR> <TT>       </TT>file:20040722_152111.s7k record:20 shot:75  2004/204 15:20:47.698 samples:8330 interval:64 usec  minmax: 0.000000 16525.875000<BR>
-<BR> <TT>       </TT>......... lines omitted ..........<BR>
-<BR> <TT>       </TT>file:20040722_152111.s7k record:2510 shot:2565  2004/204 15:44:05.893 samples:8330 interval:64 usec  minmax: 0.000000 17616.189453<BR>
-<BR> <TT>       </TT>file:20040722_152111.s7k record:2520 shot:2575  2004/204 15:44:11.507 samples:8330 interval:64 usec  minmax: 0.000000 31888.093750<BR>
-<BR> <TT>       </TT>2527 records output to segy file 20040722_152111.s7k.segy<BR>
-<BR>
-
-<B>MBextractsegy</B> also generates a "sinf" file containing statistics about the data in the segy
-file 20040722_152111.s7k.segy. The contents of the sinf file 20040722_152111.s7k.segy.sinf are:
-<BR> <TT>       </TT>SEGY Data File:      20040722_152111.s7k.segy<BR>
-<P>
-<BR> <TT>       </TT>File Header Info:<BR>
-<BR> <TT>       </TT>  Channels:                          1<BR>
-<BR> <TT>       </TT>  Auxiliary Channels:                0<BR>
-<BR> <TT>       </TT>  Sample Interval (usec):           64<BR>
-<BR> <TT>       </TT>  Number of Samples in Trace:     8330<BR>
-<BR> <TT>       </TT>  Trace length (sec):         0.533120<BR>
-<BR> <TT>       </TT>  Data Format:                IEEE 32 bit integer<BR>
-<BR> <TT>       </TT>  CDP Fold:                          0<BR>
-<P>
-<BR> <TT>       </TT>Data Totals:<BR>
-<BR> <TT>       </TT>  Number of Traces:               2527<BR>
-<BR> <TT>       </TT>  Min Max Delta:<BR>
-<BR> <TT>       </TT>    Shot number:                    56     2582     2527<BR>
-<BR> <TT>       </TT>    Shot trace:                      1        1        1<BR>
-<BR> <TT>       </TT>    RP number:                      56     2582     2527<BR>
-<BR> <TT>       </TT>    RP trace:                        1        1        1<BR>
-<BR> <TT>       </TT>    Delay (sec):              0.000000 0.000000 0.000000<BR>
-<BR> <TT>       </TT>    Range (m):                0.000000 0.000000 0.000000<BR>
-<BR> <TT>       </TT>    Receiver Elevation (m):   -224.030000 -2.860000 -221.170000<BR>
-<BR> <TT>       </TT>    Source Elevation (m):     -224.030000 -2.860000 -221.170000<BR>
-<BR> <TT>       </TT>    Source Depth (m):         2.860000 224.030000 -221.170000<BR>
-<BR> <TT>       </TT>    Receiver Water Depth (m): 51.510000 487.670000 -436.160000<BR>
-<BR> <TT>       </TT>    Source Water Depth (m):   51.510000 487.670000 -436.160000<BR>
-<P>
-<BR> <TT>       </TT>Navigation Totals:<BR>
-<P>
-<BR> <TT>       </TT>  Start of Data:<BR>
-<BR> <TT>       </TT>    Time:  07 22 2004 15:20:37.029000  JD204<BR>
-<BR> <TT>       </TT>    Lon: -121.8573     Lat:   36.7755<BR>
-<P>
-<BR> <TT>       </TT>  End of Data:<BR>
-<BR> <TT>       </TT>    Time:  07 22 2004 15:44:15.438000  JD204<BR>
-<BR> <TT>       </TT>    Lon: -121.8572     Lat:   36.7952<BR>
-<P>
-<BR> <TT>       </TT>Limits:<BR>
-<BR> <TT>       </TT>  Minimum Longitude:    -121.8574   Maximum Longitude:    -121.8572<BR>
-<BR> <TT>       </TT>  Minimum Latitude:       36.7755   Maximum Latitude:       36.7952<BR>
-<P>
-<P>
-<P>
-<A NAME="lbAI"> </A>
-<H2>SEE ALSO</H2>
-
-<B><A HREF="mbsystem.html">mbsystem</A></B>(1), <B><A HREF="mbsegyinfo.html">mbsegyinfo</A></B>(1), <B><A HREF="mbsegylist.html">mbsegylist</A></B>(1), <B><A HREF="mbsegygrid.html">mbsegygrid</A></B>(1),
-<B>SIOSEIS</B>(<A HREF="http://sioseis.ucsd.edu/">http://sioseis.ucsd.edu/</A> )
-<P>
-<A NAME="lbAJ"> </A>
-<H2>BUGS</H2>
-
-Doesn't support all of the data formats containing subbottom or center beam
-reflection data..
-<P>
-
-<HR>
-<A NAME="index"> </A><H2>Index</H2>
-<DL>
-<DT><A HREF="#lbAB">NAME</A><DD>
-<DT><A HREF="#lbAC">VERSION</A><DD>
-<DT><A HREF="#lbAD">SYNOPSIS</A><DD>
-<DT><A HREF="#lbAE">DESCRIPTION</A><DD>
-<DT><A HREF="#lbAF">AUTHORSHIP</A><DD>
-<DT><A HREF="#lbAG">OPTIONS</A><DD>
-<DT><A HREF="#lbAH">EXAMPLES</A><DD>
-<DT><A HREF="#lbAI">SEE ALSO</A><DD>
-<DT><A HREF="#lbAJ">BUGS</A><DD>
-</DL>
-<HR>
-</PRE>
-
-<CENTER><P><BR>
-Last Updated: 3 June 2013</P></CENTER>
-
-<HR>
-<P><A HREF="mbsystem_man_list.html">Return to list of MB-System manual pages...</A></P>
-<P><A HREF="mbsystem_home.html"><IMG SRC="mbsystem_logo_small.gif" BORDER=0 HEIGHT=55 WIDTH=158 ALIGN=BOTTOM></A><A HREF="mbsystem_home.html">Back
-to MB-System Home Page...</A></P>
-
-</BODY>
-</HTML>
diff --git a/src/html/mbfilter.html b/src/html/mbfilter.html
deleted file mode 100644
index 4fe3888..0000000
--- a/src/html/mbfilter.html
+++ /dev/null
@@ -1,440 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<HTML VERSION="2.0">
-<HEAD>
-   <TITLE>MB-System Unix Manual Page: mbfilter</TITLE>
-<!-- WEBMAGIC VERSION NUMBER="2.0.2" -->
-<!-- WEBMAGIC TRANSLATION NAME="ServerRoot" SRC="/var/www/htdocs/" DST="/" -->
-<!-- WEBMAGIC TRANSLATION NAME="ProjectRoot" SRC="./" DST="" -->
-</HEAD>
-<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#336699" VLINK="#997040" ALINK="#CC9900">
-<BODY>
-<CENTER><H3><U>MB-System Unix Manual Page</U></H3></CENTER>
-<PRE>
-<H1>mbfilter</H1>
-Section:  MB-System 5.0  (1)<BR>Updated:  3 June 2013 <BR><A HREF="#index">Index</A>
-<HR>
-
-<A NAME="lbAB"> </A>
-<H2>NAME</H2>
-
-<B>mbfilter</B> - Apply some simple filter functions to sidescan or beam
-amplitude data from swath sonar data files.
-<P>
-<A NAME="lbAC"> </A>
-<H2>VERSION</H2>
-
-Version 5.0
-<P>
-<A NAME="lbAD"> </A>
-<H2>SYNOPSIS</H2>
-
-<B>mbfilter</B> [<B>-A</B><I>kind</I>
-<B>-B</B><I>yr/mo/da/hr/mn/sc
-</I><B>-C</B><I>mode/xdim/ldim/iteration</I>
-<B>-D</B><I>mode/xdim/ldim/iteration[/offset]</I>
-<B>-E</B><I>yr/mo/da/hr/mn/sc
-</I><B>-F</B><I>format</I> <B>-I</B><I>infile</I> <B>-N</B><I>buffersize</I>
-<B>-R</B><I>west/east/south/north</I>
-<B>-S</B><I>mode/xdim/ldim/iteration[/threshold_lo/threshold_hi]</I>
-<B>-V -H</B>]
-<P>
-<A NAME="lbAE"> </A>
-<H2>DESCRIPTION</H2>
-
-<B>mbfilter</B> applies one or more simple filters to the specified
-sidescan or beam amplitude data. The filters
-include:
-<BR>  -S1: boxcar mean for low-pass filtering
-<BR>  -S2: gaussian mean for low-pass filtering
-<BR>  -S3: boxcar median for low-pass filtering
-<BR>  -S4: inverse gradient for low-pass filtering
-<BR>  -D1: boxcar mean subtraction for high-pass filtering
-<BR>  -D2: gaussian mean subtraction for high-pass filtering
-<BR>  -D3: boxcar median subtraction for high-pass filtering
-<BR>  -C1: edge detection for contrast enhancement
-<BR>  -C2: gradient magnitude subtraction for contrast enhancement
-<P>
-These filters are mostly intended for use with sidescan
-data. In particular, the low-pass or smoothing filters
-can be used for first-order speckle reduction in sidescan
-data, and the high-pass filters can be used to emphasize
-fine scale structure in the data. A combination of
-low-pass and high-pass filtering can effectively perform
-band-pass filtering. The contrast enhancing
-filters can, under certain circumstances, sharpen sidescan
-images of the seafloor. The low-pass and contrast
-enhancement filters are described
-in the paper by Sauter and Parson (1994) listed below.
-<P>
-The filtering used here is designed and applied in the
-same manner as spatial filters are applied to images.
-The swath data is treated as an image, with the x and
-y coordinates corresponding to pixel (or beam) number and
-ping number, respectively. The filters consist of M x N
-matrices which are convolved with the swath data image
-(M is the filter dimension in the acrosstrack direction
-and N is the filter dimension in the alongtrack direction).
-Missing or flagged data are ignored in the filtering
-process.
-<P>
-Low-pass filters are specified with the <B>-S</B> option,
-high-pass filters with the <B>-D</B> option, and contrast
-enhancement with the <B>-C</B> option. Users can apply up
-to ten filters in any order; the filters are applied
-in the order in which they are specified on the command line.
-Users can apply as many iterations of each filter as
-desired. The user specifies the window size
-used by the filters (3x3 or 5x5 are typical for using smoothing
-filters iteratively to reduce speckle; larger windows like 3x20
-are typical for high-pass filtering).
-<P>
-The boxcar mean, gaussian mean, and median filter all
-achieve similar results in uniformly smoothing the data;
-the boxcar mean is faster to apply, the gaussian mean preserves
-the frequency content of the data better, and the median filter
-is least sensitive to spikes in the data. The inverse
-gradient filter applies averaging weights which depend on the
-inverse gradient of the data. This approach causes the filter
-to smooth regions without distinct edges much more than regions
-with edges, thus tending to preserve the sharpness of features
-more than the simpler smoothing filters.
-<P>
-The median smoothing filter can be set by the <B>-T</B>
-option to operate with low and high
-ratio thresholds (the value is changed only if the original
-value divided by the median value is less than the low
-threshold or greater than the high threshold). This allows the
-filter to preferentially despike the data. In particular, this
-approach is useful for suppressing "stripes" or "bad"
-pings which have amplitude or sidescan values differing significantly
-from surrounding pings.
-<P>
-The high-pass filters are constructed by calculating a low-pass
-filtered version of the data and then subtracting that from
-the original data. An offset value is added to the high-passed
-data so that it is positive (negative values are considered
-flagged as bad in some formats and not allowed in others).
-The high-pass filters can be used to remove
-long-wavelength variations in seafloor reflectivity in order
-to emphasize fine-scale structure.
-<P>
-The contrast enhancement filters are generally only successful
-when applied after smoothing because of their tendency to
-amplify noise. The edge detection filter enhances contrast by
-tending to shift values on either side of a boundary away
-from the average value across the boundary. A 5 X 5 filter or
-larger is generally required for success with the edge detection
-algorithm. The gradient filter increases contrast by subtracting
-twice the local gradient magnitude from each value.
-<P>
-The filtered amplitude or sidescan data are written to ancilliary
-files located parallel to the input swath data files. Filtered
-amplitude data will be in files named by adding ".ffa" to the input
-file name, and sidescan data will be in files with an ".ffs" suffix.
-Filtered amplitude or sidescan data can be plotted with <B>mbm_plot</B> by
-appending "F" to that macro's mode argument (e.g. <B>-G</B><I>4F</I> for filtered
-amplitude data, and  <B>-G</B><I>5F</I> for filtered sidescan data).
-If accessing <B>mbswath</B> directly rather than through <B>mbm_plot</B>,
-plot the filtered data by appending "F" to the program's mode argument
-(e.g. <B>-Z</B><I>4F</I> for filtered
-amplitude data, and  <B>-Z</B><I>5F</I> for filtered sidescan data).
-When using <B>mbmosaic</B> to generate mosaics of amplitude or sidescan data,
-the filtered data can be accessed by appending "F" to the data kind argument
-(e.g. <B>-A</B><I>3F</I> for amplitude and  <B>-A</B><I>4F</I> for sidescan data.
-<P>
-<A NAME="lbAF"> </A>
-<H2>AUTHORSHIP</H2>
-
-David W. Caress (<A HREF="mailto:caress at mbari.org">caress at mbari.org</A>)
-<BR>
-
-<BR>  Monterey Bay Aquarium Research Institute
-<BR>
-
-Dale N. Chayes (<A HREF="mailto:dale at ldeo.columbia.edu">dale at ldeo.columbia.edu</A>)
-<BR>
-
-<BR>  Lamont-Doherty Earth Observatory
-<P>
-<A NAME="lbAG"> </A>
-<H2>OPTIONS</H2>
-
-<DL COMPACT>
-<DT><B>-A</B>
-
-<DD>
-<I>kind</I>
-<BR>
-
-Determines whether beam amplitude (<I>kind</I> = 1),
-or sidescan (<I>kind</I> = 2) data will be processed.
-Default: <I>kind</I> = 2.
-<DT><B>-B</B>
-
-<DD>
-<I>yr/mo/da/hr/mn/sc</I>
-<BR>
-
-This option sets the starting time for data allowed in the input data.
-The <B>-E</B> option sets the ending time for data. If the
-starting time is before the ending time, then any data
-with a time stamp before the starting time or after the
-ending time is ignored. If instead the starting time is
-after the ending time, then any data between the ending
-and starting time will be ignored. This scheme allows time
-windowing both inside and outside a specified interval.
-Default: <I>yr/mo/da/hr/mn/sc</I> = 1962/2/21/10/30/0.
-<DT><B>-C</B>
-
-<DD>
-<I>mode/xdim/ldim/iteration</I>
-<BR>
-
-<BR>
-
-Turns on contrast enhancement filtering and sets the
-filter parameters to be
-used. Here <I>mode</I> specifies the filter type:
-<BR> <TT>       </TT><I>mode</I> = 1 : Edge Detection Filter<BR>
-<BR> <TT>       </TT><I>mode</I> = 2 : Gradient Magnitude Subtraction Filter<BR>
-<BR>
-
-The dimensions of the data window used are set using <I>xdim</I>
-(acrosstrack dimension) and <I>ldim</I> (alongtrack dimension).
-Values of <I>xdim</I> = 5 and <I>ldim</I> = 5 are typical, but
-larger or smaller dimensions can be used.
-The <I>iteration</I> value specifies
-the number of times the filter is applied; there is no limit to
-this value.
-Default: contrast enhancement off, <I>xdim</I> = 5, <I>ldim</I> = 5,
-<I>iteration</I> = 1.
-<DT><B>-D</B>
-
-<DD>
-<I>mode/xdim/ldim/iteration/offset</I>
-<BR>
-
-Turns on high-pass filtering and sets the filter parameters to be
-used. Here <I>mode</I> specifies the filter type:
-<BR> <TT>       </TT><I>mode</I> = 1 : Boxcar Mean Subtraction Filter<BR>
-<BR> <TT>       </TT><I>mode</I> = 2 : Gaussian Mean Subtraction Filter<BR>
-<BR> <TT>       </TT><I>mode</I> = 3 : Boxcar Median Subtraction Filter<BR>
-<BR>
-
-The dimensions of the data window used are set using <I>xdim</I>
-(acrosstrack dimension) and <I>ldim</I> (alongtrack dimension).
-Values of <I>xdim</I> = 3 and <I>ldim</I> = 3 are typical, but
-larger dimensions can be used. The <I>iteration</I> value specifies
-the number of times the filter is applied; there is no limit to
-this value, but high-pass filters are generally only applied
-once. The <I>offset</I> value is added to each high-pass filtered
-value to force the results to be positive; this value should be
-chosen according to the range of values allowed in the
-data type and data formats being used (e.g. for SeaBeam 2100
-sidescan as represented in format 41, the sidescan values
-can range from 1 to 65535, so an <I>offset</I> = 1000 is appropriate).
-Default: high-pass filtering off, <I>xdim</I> = 3, <I>ldim</I> = 10,
-<I>iteration</I> = 1, <I>offset</I> = 1000.
-<DT><B>-E</B>
-
-<DD>
-<I>yr/mo/da/hr/mn/sc</I>
-<BR>
-
-This option sets the ending time for data allowed in the input data.
-The <B>-B</B> option sets the starting time for data. If the
-starting time is before the ending time, then any data
-with a time stamp before the starting time or after the
-ending time is ignored. If instead the starting time is
-after the ending time, then any data between the ending
-and starting time will be ignored. This scheme allows time
-windowing both inside and outside a specified interval.
-Default: <I>yr/mo/da/hr/mn/sc</I> = 2062/2/21/10/30/0.
-<DT><B>-F</B>
-
-<DD>
-<I>format</I>
-<BR>
-
-Sets the MBIO integer format identifier for the input file  specified  with
-the  -I option. By default, mbfilter derives the format id from the mbpro-
-cess parameter file associated with the input file (-I option) or, if  nec-
-essary, infers the format from the "*.mbXX" MB-System suffix convention.
-<DT><B>-H</B>
-
-<DD>
-This "help" flag causes the program to print out a description
-of its operation and then exit immediately.
-<DT><B>-I</B>
-
-<DD>
-<I>infile</I>
-<BR>
-
-Swath data file from which the input data will be read, or a datalist  file
-containing a list of input swath data files and/or other datalist files. If
-infile is a datalist file, then mbprocess will attempt to process all  data
-files identified by recursively reading infile.
-Default: <I>infile</I> = "datalist.mb-1"
-<DT><B>-N</B>
-
-<DD>
-<I>buffersize</I>
-<BR>
-
-Sets the maximum number of data records which can be
-read into the buffer. In general, data records may be
-of several different types (e.g. parameter, position,
-comment) in addition to survey data records. Many data
-formats include many more position data records than
-survey data records. Thus, a large buffer may be required
-to access a reasonable number of survey data records.
-However, on memory limited machines large buffer sizes
-can lead to poor performance due to memory swapping.
-The default value of <I>buffersize</I> = 500 is appropriate
-for most cases, but users can set the buffer size as required.
-The absolute maximum buffer size is 5000.
-Default: <I>buffersize</I> = 500.
-<DT><B>-R</B>
-
-<DD>
-<I>west/east/south/north</I>
-<BR>
-
-Sets the longitude and latitude bounds within which swath sonar
-data will be read. Only the data which lies within these bounds will
-be copied.
-Default: <I>west</I>=-360, east<I>=360</I>, <I>south</I>=-90, <I>north</I>=90.
-<DT><B>-S</B>
-
-<DD>
-<I>mode/xdim/ldim/iteration</I>
-<BR>
-
-Turns on low-pass smoothing filtering and sets the filter
-parameters to be used to
-smooth the data. Here <I>mode</I> specifies the filter type:
-<BR> <TT>       </TT><I>mode</I> = 1 : Boxcar Mean Filter<BR>
-<BR> <TT>       </TT><I>mode</I> = 2 : Gaussian Mean Filter<BR>
-<BR> <TT>       </TT><I>mode</I> = 3 : Boxcar Median Filter<BR>
-<BR> <TT>       </TT><I>mode</I> = 4 : Boxcar Inverse Gradient Filter<BR>
-<BR>
-
-The dimensions of the data window used are set using <I>xdim</I>
-(acrosstrack dimension) and <I>ldim</I> (alongtrack dimension).
-Values of <I>xdim</I> = 3 and <I>ldim</I> = 3 are typical, but
-larger dimensions can be used. The <I>iteration</I> value specifies
-the number of times the filter is applied; there is no limit to
-this value.
-Default: <I>mode</I> = 1, <I>xdim</I> = 3, <I>ldim</I> = 3,
-<I>iteration</I> = 1.
-<DT><B>-T</B>
-
-<DD>
-<I>threshold_lo/threshold_hi</I>
-<BR>
-
-This option causes the boxcar median smoothing filter to
-operate with low and high
-ratio thresholds (the value is changed only if the original
-value divided by the median value is less than <I>threshold_lo</I>
-or greater than <I>threshold_hi</I>). This allows the
-filter to preferentially despike the data. In particular, this
-approach is useful for suppressing "stripes" or "bad"
-pings which have amplitude or sidescan values differing significantly
-from surrounding pings. This option only works with the median
-smoothing filter.
-<DT><B>-V</B>
-
-<DD>
-Normally, <B>mbfilter</B> works "silently" without outputting
-anything to the stderr stream.  If the
-<B>-V</B> flag is given, then <B>mbfilter</B> works in a "verbose"
-mode and outputs the program version being used, the values
-of some important control parameters, and
-all error status messages.
-<P>
-</DL>
-<A NAME="lbAH"> </A>
-<H2>EXAMPLES</H2>
-
-Suppose one has a SeaBeam 2100 data file called test.mb41
-which contains bathymetry (121 beams in a 120 degree swath),
-beam amplitude (121 beams coincident with bathymetry),
-and sidescan data (2000 pixels, roughly a 150 degree swath)
-which has been corrected for the amplitude vs grazing angle
-variation using the program <B>mbanglecorrect</B>.
-Plots of the corrected sidescan often show a large amount
-of speckle that was suppressed in plots of the raw data
-by the large contrast between the specular and non-specular
-regions of the swath. To reduce the speckle and make coherent
-features of the data clearer, the user can apply any of
-the smoothing filters available in <B>mbfilter</B>. One iteration
-of the boxcar mean filter can be applied as follows:
-<BR> <TT>       </TT>mbfilter -F41 -Itest.mb41 -Otest_mean.mb41  <TT>    </TT><TT>        </TT>-S1/3/3/1<BR>
-<BR>
-
-Five iterations of the inverse gradient filter can be applied as follows:
-<BR> <TT>       </TT>mbfilter -F41 -Itest.mb41 -Otest_igrad.mb41  <TT>   </TT><TT>        </TT>-S4/3/3/5<BR>
-<BR>
-
-To remove large scale variations in seafloor reflectivity, one can
-apply a high-pass filter to the data:
-<BR> <TT>       </TT>mbfilter -F41 -Itest.mb41 -Otest_hipass.mb41  <TT>  </TT><TT>        </TT>-D1/3/10/1/10000<BR>
-<BR>
-
-To first apply a high-pass filter to emphasize fine-scale structure
-and then apply a low-pass filter to reduce speckle:
-<BR> <TT>       </TT>mbfilter -F41 -Itest.mb41 -Otest_hipass.mb41  <TT>  </TT><TT>        </TT>-D1/3/10/1/10000 -S4/3/3/5<BR>
-<BR>
-
-To first reduce speckle by smoothing the data with Gaussian
-mean filter and apply an edge detection contrast enhancement
-filter:
-<BR> <TT>       </TT>mbfilter -F41 -Itest.mb41 -Otest_hipass.mb41  <TT>  </TT><TT>        </TT>-S3/7/7/1 -C1/5/5/1<BR>
-<P>
-<A NAME="lbAI"> </A>
-<H2>SEE ALSO</H2>
-
-<B><A HREF="mbsystem.html">mbsystem</A></B>(1), <B><A HREF="mbmosaic.html">mbmosaic</A></B>(1), <B><A HREF="mbm_plot.html">mbm_plot</A></B>(1), <B><A HREF="mbbackangle.html">mbbackangle</A></B>(1), <B><A HREF="mbanglecorrect.html">mbanglecorrect</A></B>(1)
-<P>
-<A NAME="lbAJ"> </A>
-<H2>REFERENCES</H2>
-
-Sauter, D., and L. Parson, Spatial filtering for speckle reduction,
-contrast enchancement, and texture analysis of GLORIA images,
-<I>IEEE J. Ocean. Eng.</I>, <B>19</B>, 563-576, 1994.
-<P>
-<A NAME="lbAK"> </A>
-<H2>BUGS</H2>
-
-All the filtering in the world won't make bad data good.
-<P>
-
-<HR>
-<A NAME="index"> </A><H2>Index</H2>
-<DL>
-<DT><A HREF="#lbAB">NAME</A><DD>
-<DT><A HREF="#lbAC">VERSION</A><DD>
-<DT><A HREF="#lbAD">SYNOPSIS</A><DD>
-<DT><A HREF="#lbAE">DESCRIPTION</A><DD>
-<DT><A HREF="#lbAF">AUTHORSHIP</A><DD>
-<DT><A HREF="#lbAG">OPTIONS</A><DD>
-<DT><A HREF="#lbAH">EXAMPLES</A><DD>
-<DT><A HREF="#lbAI">SEE ALSO</A><DD>
-<DT><A HREF="#lbAJ">REFERENCES</A><DD>
-<DT><A HREF="#lbAK">BUGS</A><DD>
-</DL>
-<HR>
-</PRE>
-
-<CENTER><P><BR>
-Last Updated: 3 June 2013</P></CENTER>
-
-<HR>
-<P><A HREF="mbsystem_man_list.html">Return to list of MB-System manual pages...</A></P>
-<P><A HREF="mbsystem_home.html"><IMG SRC="mbsystem_logo_small.gif" BORDER=0 HEIGHT=55 WIDTH=158 ALIGN=BOTTOM></A><A HREF="mbsystem_home.html">Back
-to MB-System Home Page...</A></P>
-
-</BODY>
-</HTML>
diff --git a/src/html/mbformat.html b/src/html/mbformat.html
deleted file mode 100644
index 4caba4f..0000000
--- a/src/html/mbformat.html
+++ /dev/null
@@ -1,212 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<HTML VERSION="2.0">
-<HEAD>
-   <TITLE>MB-System Unix Manual Page: mbformat</TITLE>
-<!-- WEBMAGIC VERSION NUMBER="2.0.2" -->
-<!-- WEBMAGIC TRANSLATION NAME="ServerRoot" SRC="/var/www/htdocs/" DST="/" -->
-<!-- WEBMAGIC TRANSLATION NAME="ProjectRoot" SRC="./" DST="" -->
-</HEAD>
-<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#336699" VLINK="#997040" ALINK="#CC9900">
-<BODY>
-<CENTER><H3><U>MB-System Unix Manual Page</U></H3></CENTER>
-<PRE>
-<H1>mbformat</H1>
-Section:  MB-System 5.0  (1)<BR>Updated:  3 June 2013 <BR><A HREF="#index">Index</A>
-<HR>
-
-<A NAME="lbAB"> </A>
-<H2>NAME</H2>
-
-<B>mbformat</B> -  List information about swath sonar data formats
-supported by the <B>MBIO</B> library.
-<P>
-<A NAME="lbAC"> </A>
-<H2>VERSION</H2>
-
-Version 5.0
-<P>
-<A NAME="lbAD"> </A>
-<H2>SYNOPSIS<B>mbformat</B> [<B> -F</B><I>format</I> <B>-I</B><I>file</I> <B>-L -K -V -H</B>]</H2>
-
-<P>
-<A NAME="lbAE"> </A>
-<H2>DESCRIPTION</H2>
-
-<B>mbformat</B> is a utility which identifies the swath sonar data formats
-associated with <B>mbio</B> format id's.  If no format id or input filename
-is specified, <B>mbformat</B> lists all of the currently supported formats 
-along with short descriptions. If a format id is specified using the 
-<B>-F</B> option, then <B>mbformat</B> prints a short description of that 
-format. If a filename is specified using the <B>-I</B> option, then 
-<B>mbformat</B> attempts to identify a valid format id for that file using 
-swath data filename prefix and suffix conventions embedded in <B>MB-System</B>. 
-The program also determines the filename "root", which is the filename minus 
-whatever format-specific prefix or suffix has been recognized. In no prefix
-or suffix is recognized, then the root is simply the entire filename.
-<P>
-Normally, <B>mbformat</B>
-prints out a brief description of each identified format. If the <B>-L</B>
-option is used, <B>mbformat</B> simply prints out the valid format id number,
-or 0 if a file or format has been specified but no valid id can be identified.
-If the <B>-K</B> option is used, <B>mbformat</B> will print out the filename
-"root" followed by the format id number.
-<P>
-<A NAME="lbAF"> </A>
-<H2>AUTHORSHIP</H2>
-
-David W. Caress (<A HREF="mailto:caress at mbari.org">caress at mbari.org</A>)
-<BR>
-
-<BR>  Monterey Bay Aquarium Research Institute
-<BR>
-
-Dale N. Chayes (<A HREF="mailto:dale at ldeo.columbia.edu">dale at ldeo.columbia.edu</A>)
-<BR>
-
-<BR>  Lamont-Doherty Earth Observatory
-<P>
-<A NAME="lbAG"> </A>
-<H2>OPTIONS</H2>
-
-<DL COMPACT>
-<DT><B>-F</B>
-
-<DD>
-<I>format</I>
-<BR>
-
-Sets the format id to be listed.  If no format is given, all of the 
-currently supported formats will be listed. A list of the swath sonar data formats
-currently supported by <B>MBIO</B> and their identifier values
-is given in the <B>MBIO</B> manual page.
-<DT><B>-H</B>
-
-<DD>
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-<DT><B>-I</B>
-
-<DD>
-<I>file</I>
-<BR>
-
-Sets the filename to be tested against known filename prefix and
-suffix conventions in order to identify the format id.
-<DT><B>-K</B>
-
-<DD>
-Causes the fileroot and the format id to be output. The fileroot
-is the filename with any format specific suffix removed.
-<DT><B>-L</B>
-
-<DD>
-Causes the format descriptions to be omitted 
-so that only the <B>MBIO</B> format id numbers are listed.
-<DT><B>-V</B>
-
-<DD>
-Normally, <B>mbformat</B> only prints out format descriptions.  If the
-<B>-V</B> flag is given, then <B>mbformat</B> works in a "verbose" mode and
-also outputs the program version being used.
-<P>
-</DL>
-<A NAME="lbAH"> </A>
-<H2>EXAMPLES</H2>
-
-Suppose one wishes to identify the swath sonar data format associated
-with a format id of 11.  The following will suffice:
-<BR>
-
-<BR> <TT>       </TT>mbformat -F11<BR>
-<BR>
-
-and the result will be this output:
-<BR>  MBIO data format id: 11
-<BR>  Format name:          MBF_SBSIOMRG
-<BR>  Informal Description: SIO merge Sea Beam
-<BR>  Attributes:           Sea Beam, bathymetry, 16 beams, binary, uncentered,
-<BR>                        SIO.
-<P>
-Suppose one wishes to list all of the currently supported data formats.
-The following will suffice:
-<BR>
-
-<BR> <TT>       </TT>mbformat<BR>
-<P>
-Suppose one wants to find out what format is associated with a raw
-SeaBeam 2112 file named sb199811231045.rec:
-<BR>
-
-<BR> <TT>       </TT>mbformat -I sb199811231045.rec<BR>
-<BR>
-
-This results in the output:
-<BR>  MBIO data format id: 41
-<BR>  Format name:          MBF_SB2100RW
-<BR>  Informal Description: SeaBeam 2100 series vender format
-<BR>  Attributes:           SeaBeam 2100, bathymetry, amplitude 
-<BR>                        and sidescan, 151 beams and 2000 pixels, ascii 
-<BR>                        with binary sidescan, SeaBeam Instruments.
-<P>
-Using the -K option:
-<BR>
-
-<BR> <TT>       </TT>mbformat -K -I sb199811231045.rec<BR>
-<BR>
-
-will produce the following output:
-<BR>
-
-<BR>  sb199811231045 41
-<BR>
-
-where the format id has been identified as 41 because of the ".rec"
-file suffix and the fileroot has been identified as "sb199811231045"
-by removing the suffix. Use of the -L option:
-<BR>
-
-<BR> <TT>       </TT>mbformat -L -I sb199811231045.rec<BR>
-<BR>
-
-will produce output with just format id:
-<BR>
-
-<BR>  41
-<P>
-<A NAME="lbAI"> </A>
-<H2>SEE ALSO</H2>
-
-<B><A HREF="mbsystem.html">mbsystem</A></B>(1), <B><A HREF="mbio.html">mbio</A></B>(1)
-<P>
-<A NAME="lbAJ"> </A>
-<H2>BUGS</H2>
-
-No known bugs.
-<P>
-
-<HR>
-<A NAME="index"> </A><H2>Index</H2>
-<DL>
-<DT><A HREF="#lbAB">NAME</A><DD>
-<DT><A HREF="#lbAC">VERSION</A><DD>
-<DT><A HREF="#lbAD">SYNOPSIS<B>mbformat</B> [<B> -F</B><I>format</I> <B>-I</B><I>file</I> <B>-L -K -V -H</B>]</A><DD>
-<DT><A HREF="#lbAE">DESCRIPTION</A><DD>
-<DT><A HREF="#lbAF">AUTHORSHIP</A><DD>
-<DT><A HREF="#lbAG">OPTIONS</A><DD>
-<DT><A HREF="#lbAH">EXAMPLES</A><DD>
-<DT><A HREF="#lbAI">SEE ALSO</A><DD>
-<DT><A HREF="#lbAJ">BUGS</A><DD>
-</DL>
-<HR>
-</PRE>
-
-<CENTER><P><BR>
-Last Updated: 3 June 2013</P></CENTER>
-
-<HR>
-<P><A HREF="mbsystem_man_list.html">Return to list of MB-System manual pages...</A></P>
-<P><A HREF="mbsystem_home.html"><IMG SRC="mbsystem_logo_small.gif" BORDER=0 HEIGHT=55 WIDTH=158 ALIGN=BOTTOM></A><A HREF="mbsystem_home.html">Back
-to MB-System Home Page...</A></P>
-
-</BODY>
-</HTML>
diff --git a/src/html/mbformat.txt b/src/html/mbformat.txt
deleted file mode 100644
index 6280b72..0000000
--- a/src/html/mbformat.txt
+++ /dev/null
@@ -1,540 +0,0 @@
-
-Supported MBIO Formats:
-
-<UL>
-<LI>MBIO Data Format ID:  11
-
-<UL>
-<LI>Format name:          MBF_SBSIOMRG </LI>
-<LI>Informal Description: SIO merge Sea Beam </LI>
-<LI>Attributes:           Sea Beam, bathymetry, 16 beams, binary, uncentered,
-                      SIO.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  12
-
-<UL>
-<LI>Format name:          MBF_SBSIOCEN </LI>
-<LI>Informal Description: SIO centered Sea Beam </LI>
-<LI>Attributes:           Sea Beam, bathymetry, 19 beams, binary, centered,
-                      SIO.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  13
-
-<UL>
-<LI>Format name:          MBF_SBSIOLSI </LI>
-<LI>Informal Description: SIO LSI Sea Beam </LI>
-<LI>Attributes:           Sea Beam, bathymetry, 19 beams, binary, centered, 
-                      obsolete, SIO.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  14
-
-<UL>
-<LI>Format name:          MBF_SBURICEN </LI>
-<LI>Informal Description: URI Sea Beam </LI>
-<LI>Attributes:           Sea Beam, bathymetry, 19 beams, binary, centered,
-                      URI.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  15
-
-<UL>
-<LI>Format name:          MBF_SBURIVAX </LI>
-<LI>Informal Description: URI Sea Beam from VAX </LI>
-<LI>Attributes:           Sea Beam, bathymetry, 19 beams, binary, centered,
-                      VAX byte order, URI.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  16
-
-<UL>
-<LI>Format name:          MBF_SBSIOSWB </LI>
-<LI>Informal Description: SIO Swath-bathy SeaBeam </LI>
-<LI>Attributes:           Sea Beam, bathymetry, 19 beams, binary, centered,
-                      SIO.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  17
-
-<UL>
-<LI>Format name:          MBF_SBIFREMR </LI>
-<LI>Informal Description: IFREMER Archive SeaBeam </LI>
-<LI>Attributes:           Sea Beam, bathymetry, 19 beams, ascii, centered,
-                      IFREMER.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  21
-
-<UL>
-<LI>Format name:          MBF_HSATLRAW </LI>
-<LI>Informal Description: Raw Hydrosweep </LI>
-<LI>Attributes:           Hydrosweep DS, bathymetry and amplitude, 59 beams,
-                      ascii, Atlas Electronik.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  22
-
-<UL>
-<LI>Format name
-<UL>
-<LI>Format name:          MBF_HSLDEDMB
-<LI>Informal Description: EDMB Hydrosweep
-<LI>Attributes:           Hydrosweep DS, bathymetry, 59 beams, binary, NRL.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  23
-
-<UL>
-<LI>Format name:          MBF_HSURICEN
-<LI>Informal Description: URI Hydrosweep
-<LI>Attributes:           Hydrosweep DS, 59 beams, bathymetry, binary, URI.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  24
-
-<UL>
-<LI>Format name:          MBF_HSLDEOIH
-<LI>Informal Description: L-DEO in-house binary Hydrosweep
-<LI>Attributes:           Hydrosweep DS, 59 beams, bathymetry and amplitude, 
-                      binary, centered, L-DEO.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  25
-
-<UL>
-<LI>Format name:          MBF_HSURIVAX
-<LI>Informal Description: URI Hydrosweep from VAX
-<LI>Attributes:           Hydrosweep DS, 59 beams, bathymetry, binary,
-                      VAX byte order, URI.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  32
-
-<UL>
-<LI>Format name
-<UL>
-<LI>Format name:          MBF_SB2000SB
-<LI>Informal Description: SIO Swath-bathy SeaBeam 2000 format
-<LI>Attributes:           SeaBeam 2000, bathymetry, 121 beams, 
-                      binary,  SIO.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  33
-
-<UL>
-<LI>Format name:          MBF_SB2000SS
-<LI>Informal Description: SIO Swath-bathy SeaBeam 2000 format
-<LI>Attributes:           SeaBeam 2000, sidescan,
-                      1000 pixels for 4-bit sidescan,
-                      2000 pixels for 12+-bit sidescan,
-                      binary,  SIO.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  41
-
-<UL>
-<LI>Format name:          MBF_SB2100RW
-<LI>Informal Description: SeaBeam 2100 series vender format
-<LI>Attributes:           SeaBeam 2100, bathymetry, amplitude 
-                      and sidescan, 151 beams and 2000 pixels, ascii 
-                      with binary sidescan, SeaBeam Instruments.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  42
-
-<UL>
-<LI>Format name:          MBF_SB2100B1
-<LI>Informal Description: SeaBeam 2100 series vender format
-<LI>Attributes:           SeaBeam 2100, bathymetry, amplitude 
-                      and sidescan, 151 beams bathymetry,
-                      2000 pixels sidescan, binary,
-                      SeaBeam Instruments and L-DEO.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  43
-
-<UL>
-<LI>Format name:          MBF_SB2100B2
-<LI>Informal Description: SeaBeam 2100 series vender format
-<LI>Attributes:           SeaBeam 2100, bathymetry and amplitude,  
-                      151 beams bathymetry,
-                      binary,
-                      SeaBeam Instruments and L-DEO.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  51
-
-<UL>
-<LI>Format name:          MBF_EMOLDRAW
-<LI>Informal Description: Old Simrad vendor multibeam format
-<LI>Attributes:           Simrad EM1000, EM12S, EM12D, 
-                      and EM121 multibeam sonars,
-                      bathymetry, amplitude, and sidescan,
-                      60 beams for EM1000, 81 beams for EM12S/D,
-		      121 beams for EM121, variable pixels,
-		      ascii + binary, Simrad.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  53
-
-<UL>
-<LI>Format name
-<UL>
-<LI>Format name:          MBF_EM12IFRM
-<LI>Informal Description: IFREMER TRISMUS format for Simrad EM12
-<LI>Attributes:           Simrad EM12S and EM12D,
-                      bathymetry, amplitude, and sidescan
-                      81 beams, variable pixels, binary, IFREMER.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  54
-
-<UL>
-<LI>Format name:          MBF_EM12DARW
-<LI>Informal Description: Simrad EM12S RRS Darwin processed format
-<LI>Attributes:           Simrad EM12S, bathymetry and amplitude,
-                      81 beams, binary, Oxford University.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  56
-
-<UL>
-<LI>Format name:          MBF_EM300RAW
-<LI>Informal Description: Simrad current multibeam vendor format
-<LI>Attributes:           Simrad EM120, EM300, EM1002, EM3000, 
-                      bathymetry, amplitude, and sidescan,
-                      up to 254 beams, variable pixels, ascii + binary, Simrad.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  57
-
-<UL>
-<LI>Format name:          MBF_EM300MBA
-<LI>Informal Description: Simrad multibeam processing format
-<LI>Attributes:           Old and new Simrad multibeams, 
-                      EM12S, EM12D, EM121, EM120, EM300, 
-                      EM100, EM1000, EM950, EM1002, EM3000, 
-                      bathymetry, amplitude, and sidescan,
-                      up to 254 beams, variable pixels, ascii + binary, MBARI.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  61
-
-<UL>
-<LI>Format name:          MBF_MR1PRHIG
-<LI>Informal Description: SOEST MR1 post processed format
-<LI>Attributes:           SOEST MR1, bathymetry and sidescan,
-                      variable beams and pixels, xdr binary, 
-                      SOEST, University of Hawaii.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  62
-
-<UL>
-<LI>Format name:          MBF_MR1ALDEO
-<LI>Informal Description: L-DEO MR1 post processed format with travel times
-<LI>Attributes:           L-DEO MR1, bathymetry and sidescan,
-                      variable beams and pixels, xdr binary, 
-                      L-DEO.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  63
-
-<UL>
-<LI>Format name:          MBF_MR1BLDEO
-<LI>Informal Description: L-DEO small MR1 post processed format with travel times
-<LI>Attributes:           L-DEO MR1, bathymetry and sidescan,
-                      variable beams and pixels, xdr binary, 
-                      L-DEO.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  71
-
-<UL>
-<LI>Format name
-<UL>
-<LI>Format name:          MBF_MBLDEOIH
-<LI>Informal Description: L-DEO in-house generic multibeam
-<LI>Attributes:           Data from all sonar systems, bathymetry, 
-                      amplitude and sidescan, variable beams and pixels, 
-                      binary, centered, L-DEO.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  81
-
-<UL>
-<LI>Format name:          MBF_CBAT9001
-<LI>Informal Description: Reson SeaBat 9001 shallow water multibeam
-<LI>Attributes:           60 beam bathymetry and amplitude,
-                      binary, University of New Brunswick.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  82
-
-<UL>
-<LI>Format name:          MBF_CBAT8101
-<LI>Informal Description: Reson SeaBat 8101 shallow water multibeam
-<LI>Attributes:           101 beam bathymetry and amplitude,
-                      binary, SeaBeam Instruments.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  83
-
-<UL>
-<LI>Format name:          MBF_HYPC8101
-<LI>Informal Description: Reson SeaBat 8101 shallow water multibeam
-<LI>Attributes:           101 beam bathymetry,
-                      ASCII, read-only, Coastal Oceanographics.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  91
-
-<UL>
-<LI>Format name:          MBF_BCHRTUNB
-<LI>Informal Description: Elac BottomChart shallow water multibeam
-<LI>Attributes:           56 beam bathymetry and amplitude,
-                      binary, University of New Brunswick.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  92
-
-<UL>
-<LI>Format name:          MBF_ELMK2UNB
-<LI>Informal Description: Elac BottomChart MkII shallow water multibeam
-<LI>Attributes:           126 beam bathymetry and amplitude,
-                      binary, University of New Brunswick.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  93
-
-<UL>
-<LI>Format name:          MBF_BCHRXUNB
-<LI>Informal Description: Elac BottomChart shallow water multibeam
-<LI>Attributes:           56 beam bathymetry and amplitude,
-                      binary, University of New Brunswick.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  94
-
-<UL>
-<LI>Format name:          MBF_ELMK2XSE
-<LI>Informal Description: ELAC and SeaBeam multibeam
-<LI>Attributes:           151 beam bathymetry and amplitude,
-                      2000 pixels sidescan, 
-                      binary, L-3 Communications ELAC Nautik.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  101
-
-<UL>
-<LI>Format name:          MBF_HSMDARAW
-<LI>Informal Description: Atlas HSMD medium depth multibeam raw format
-<LI>Attributes:           40 beam bathymetry, 160 pixel sidescan,
-                      XDR (binary), STN Atlas Elektronik.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  102
-
-<UL>
-<LI>Format name:          MBF_HSMDLDIH
-<LI>Informal Description: Atlas HSMD medium depth multibeam processed format
-<LI>Attributes:           40 beam bathymetry, 160 pixel sidescan,
-                      XDR (binary), L-DEO.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  111
-
-<UL>
-<LI>Format name
-<UL>
-<LI>Format name:          MBF_DSL120SF
-<LI>Informal Description: WHOI DSL AMS-120 processed format
-<LI>Attributes:           2048 beam bathymetry, 8192 pixel sidescan,
-                      binary, single files, WHOI DSL.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  112
-
-<UL>
-<LI>Format name:          MBF_DSL120PF
-<LI>Informal Description: WHOI DSL AMS-120 processed format
-<LI>Attributes:           2048 beam bathymetry, 8192 pixel sidescan,
-                      binary, parallel bathymetry and amplitude files, WHOI DSL.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  121
-
-<UL>
-<LI>Format name:          MBF_GSFGENMB
-<LI>Informal Description: SAIC Generic Sensor Format (GSF)
-<LI>Attributes:           variable beams,  bathymetry and amplitude,
-                      binary, single files, SAIC.</LI>
-</UL>
-</UL> 
-
-<UL>
-<LI>MBIO Data Format ID:  131
-
-<UL>
-<LI>Format name:          MBF_MSTIFFSS
-<LI>Informal Description: MSTIFF sidescan format
-<LI>Attributes:           variable pixels,  sidescan,
-                      binary TIFF variant, single files, Sea Scan.</LI>
-</UL>
-</UL> 
-
-<UL>
-<LI>MBIO Data Format ID:  141
-
-<UL>
-<LI>Format name:          MBF_OICGEODA
-<LI>Informal Description: OIC swath sonar format
-<LI>Attributes:           variable beam bathymetry and
-                      amplitude, variable pixel sidescan, binary,
-		      Oceanic Imaging Consultants.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  142
-
-<UL>
-<LI>Format name:          MBF_OICMBARI
-<LI>Informal Description: OIC-style extended swath sonar format
-<LI>Attributes:           variable beam bathymetry and
-                      amplitude, variable pixel sidescan, binary,
-		      MBARI.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  151
-
-<UL>
-<LI>Format name
-<UL>
-<LI>Format name:          MBF_OMGHDCSJ
-<LI>Informal Description: UNB OMG HDCS format (the John Hughes Clarke format)
-<LI>Attributes:           variable beam bathymetry and
-                      amplitude, variable pixel sidescan, binary,
-		      UNB.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  161
-
-<UL>
-<LI>Format name:          MBF_MGD77DAT
-<LI>Informal Description: NGDC MGD77 underway geophysics format
-<LI>Attributes:           single beam bathymetry, nav, magnetics,
-                      gravity, ascii, NOAA NGDC.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  165
-
-<UL>
-<LI>Format name:          MBF_MBARIROV
-<LI>Informal Description: MBARI ROV navigation format
-<LI>Attributes:           ROV navigation, MBARI.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  166
-
-<UL>
-<LI>Format name:          MBF_MBPRONAV
-<LI>Informal Description: MB-System simple navigation format
-<LI>Attributes:           navigation, MBARI.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  171
-
-<UL>
-<LI>Format name:          MBF_HS10JAMS
-<LI>Informal Description: Furuno HS-10 multibeam format,
-<LI>Attributes:           45 beams bathymetry and amplitude,
-                      ascii, JAMSTEC.</LI>
-</UL>
-</UL>
diff --git a/src/html/mbgetesf.html b/src/html/mbgetesf.html
deleted file mode 100644
index 7ac7b48..0000000
--- a/src/html/mbgetesf.html
+++ /dev/null
@@ -1,213 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<HTML VERSION="2.0">
-<HEAD>
-   <TITLE>MB-System Unix Manual Page: mbgetesf</TITLE>
-<!-- WEBMAGIC VERSION NUMBER="2.0.2" -->
-<!-- WEBMAGIC TRANSLATION NAME="ServerRoot" SRC="/var/www/htdocs/" DST="/" -->
-<!-- WEBMAGIC TRANSLATION NAME="ProjectRoot" SRC="./" DST="" -->
-</HEAD>
-<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#336699" VLINK="#997040" ALINK="#CC9900">
-<BODY>
-<CENTER><H3><U>MB-System Unix Manual Page</U></H3></CENTER>
-<PRE>
-<H1>mbgetesf</H1>
-Section:  MB-System 5.0  (1)<BR>Updated:  3 June 2013 <BR><A HREF="#index">Index</A>
-<HR>
-
-<A NAME="lbAB"> </A>
-<H2>NAME</H2>
-
-<B>mbgetesf</B> - Extract swath bathymetry data flags into an edit save file.
-<P>
-<A NAME="lbAC"> </A>
-<H2>VERSION</H2>
-
-Version 5.0
-<P>
-<A NAME="lbAD"> </A>
-<H2>SYNOPSIS</H2>
-
-<B>mbgetesf</B> [<B>-F</B>format <B>-I</B>infile <B>-M</B>mode <B>-O</B>esffile <B>-V -H</B>]
-<P>
-<A NAME="lbAE"> </A>
-<H2>DESCRIPTION</H2>
-
-Swath bathymetry data is typically edited either with interactive
-tools such as <B>mbedit</B> or automatic filters such as <B>mbclean</B>.
-The beams which are deemed "bad" are flagged, and the flags are
-output to an "edit save file", which can be applied to data
-later by <B>mbprocess</B>.
-Occasionally, the need arises to translate data
-flagging information from one file to another which represents a
-different version of the same dataset.  In particular, it may happen
-that editing has been done on a data format which does not support
-all of the original data stream (e.g. the edmb Hydrosweep format 22,
-which does not contain travel times or amplitudes), but the user now
-wishes to work with the complete data stream without having to redo
-the editing process.
-<P>
-The utility <B>mbgetesf</B> allows the user to extract
-the flagging information in the form of an
-"edit save file" like those generated by <B>mbedit</B> and
-<B>mbclean</B>. These edits can be applied to data later
-using <B>mbprocess</B>. If the edit save file is named
-properly (an ".esf" suffix added to the input swath file
-name), the edits can automatically be loaded into <B>mbedit</B> or
-<B>mbclean</B>.
-<P>
-The user can extract edit events from only the flagged beams (<B>-M</B><I>1</I>),
-or can extract edit events specifying null and flagged beams (<B>-M</B><I>2</I>)
-and all (good, flagged, and null) beams (<B>-M</B><I>3</I>). The latter cases are necessary only if
-previous editing has involved nulling beams that were
-originally classified as good or unflagging beams that were
-originally flagged.
-<P>
-The default input is from stdin, and the default output is
-to standard out.
-<P>
-<A NAME="lbAF"> </A>
-<H2>AUTHORSHIP</H2>
-
-David W. Caress (<A HREF="mailto:caress at mbari.org">caress at mbari.org</A>)
-<BR>
-
-<BR>  Monterey Bay Aquarium Research Institute
-<BR>
-
-Dale N. Chayes (<A HREF="mailto:dale at ldeo.columbia.edu">dale at ldeo.columbia.edu</A>)
-<BR>
-
-<BR>  Lamont-Doherty Earth Observatory
-<P>
-<A NAME="lbAG"> </A>
-<H2>OPTIONS</H2>
-
-<DL COMPACT>
-<DT><B>-F</B>
-
-<DD>
-<I>format</I>
-<BR>
-
-Sets the format for the input and output swath data using
-<B>MBIO</B> integer format identifiers.
-These utilities uses the <B>MBIO</B> library and will read any swath data
-format supported by <B>MBIO</B>. A list of the swath data formats
-currently supported by <B>MBIO</B> and their identifier values
-is given in the <B>MBIO</B> manual page.
-<DT><B>-H</B>
-
-<DD>
-This "help" flag causes the program to print out a description
-of its operation and then exit immediately.
-<DT><B>-I</B>
-
-<DD>
-<I>infile</I>
-<BR>
-
-Data file from which the input data will be read. If
-no input file is specified, the input will be read
-from stdin. Default: <I>infile</I> = stdin.
-<DT><B>-M</B>
-
-<DD>
-<I>mode</I>
-<BR>
-
-Specifies which beam flag values are output as edit events.
-If <I>mode</I> = 1, then only flagged beams are output. If
-<I>mode</I> = 2, then flagged and null beams are output. If
-<I>mode</I> = 3, then an edit event will be output for every
-beam, including those that are "good" (neither flagged nor
-null). Default: <I>mode</I> = 1.
-<DT><B>-O</B>
-
-<DD>
-<I>esffile</I>
-<BR>
-
-Specifies output edit save file to which the
-edit events will be written. If
-no edit save file is specified, the output will be written
-to stdout. Default: <I>esffile</I> = stdout.
-<DT><B>-V</B>
-
-<DD>
-Normally, <B>mbgetesf</B> works "silently" without outputting
-anything to the stderr stream.  If the
-<B>-V</B> flag is given, then <B>mbgetesf</B> works in a "verbose" mode and
-outputs the program version being used and all error status messages.
-<P>
-</DL>
-<A NAME="lbAH"> </A>
-<H2>EXAMPLES</H2>
-
-Suppose one has an edmb format (<B>MBIO</B> format id 22) Hydrosweep
-file called hs_ew9103_143.mb22 which has been edited using older
-versions of <B>mbedit</B> so that no edit save file was generated.
-Further suppose that one's thesis advisor
-suggests that the bathymetry would be better if it were recalculated
-from travel times using a new water velocity model, requiring that
-the raw Hydrosweep data (originally collected in format 21 but
-recently translated to format 24) in the file hs_ew9103_143.mb24
-be used. First extract the edit events in the form of
-a edit save file from the edited edmb file:
-<BR> <TT>       </TT>mbgetesf -F22 -Ihs_ew9103_143.mb22  <TT>    </TT><TT>        </TT>-Ohs_ew9103_143.mb24.esf -V<BR>
-<BR>
-
-Note that the edit save file has been given the name of the
-second swath file with ".esf" appended. This naming convention
-is the same as if <B>mbedit</B> or <B>mbclean</B> had been
-run on hs_ew9103_143.mb24. Now, running either <B>mbedit</B> or <B>mbclean</B>
-will automatically load the edit events as a starting point
-for editing or filtering.
-To simply apply the extracted edit events to the swath bathymetry,
-first use <B>mbset</B> to enable applying the edits in the
-<B>mbprocess</B> parameter file, and then run <B>mbprocess</B>
-to actually apply the edits and generate a processed output
-swath file:
-<BR> <TT>       </TT>mbset -Ihs_ew9103_143.mb24  <TT>    </TT><TT>        </TT>-PEDITSAVEMODE:1  <TT>      </TT><TT>        </TT>-PEDITSAVEFILE:hs_ew9103_143.mb24.esf  -V<BR>
-<BR> <TT>       </TT>mbprocess -Ihs_ew9103_143.mb24 -V<BR>
-<BR>
-
-The output swath file will be named hs_ew9103_143p.mb24.
-<P>
-<A NAME="lbAI"> </A>
-<H2>SEE ALSO</H2>
-
-<B><A HREF="mbsystem.html">mbsystem</A></B>(1), <B><A HREF="mbedit.html">mbedit</A></B>(1), <B><A HREF="mbclean.html">mbclean</A></B>(1),
-<B><A HREF="mbset.html">mbset</A></B>(1), <B><A HREF="mbprocess.html">mbprocess</A></B>(1).
-<P>
-<A NAME="lbAJ"> </A>
-<H2>BUGS</H2>
-
-Let us know.
-<P>
-
-<HR>
-<A NAME="index"> </A><H2>Index</H2>
-<DL>
-<DT><A HREF="#lbAB">NAME</A><DD>
-<DT><A HREF="#lbAC">VERSION</A><DD>
-<DT><A HREF="#lbAD">SYNOPSIS</A><DD>
-<DT><A HREF="#lbAE">DESCRIPTION</A><DD>
-<DT><A HREF="#lbAF">AUTHORSHIP</A><DD>
-<DT><A HREF="#lbAG">OPTIONS</A><DD>
-<DT><A HREF="#lbAH">EXAMPLES</A><DD>
-<DT><A HREF="#lbAI">SEE ALSO</A><DD>
-<DT><A HREF="#lbAJ">BUGS</A><DD>
-</DL>
-<HR>
-</PRE>
-
-<CENTER><P><BR>
-Last Updated: 3 June 2013</P></CENTER>
-
-<HR>
-<P><A HREF="mbsystem_man_list.html">Return to list of MB-System manual pages...</A></P>
-<P><A HREF="mbsystem_home.html"><IMG SRC="mbsystem_logo_small.gif" BORDER=0 HEIGHT=55 WIDTH=158 ALIGN=BOTTOM></A><A HREF="mbsystem_home.html">Back
-to MB-System Home Page...</A></P>
-
-</BODY>
-</HTML>
diff --git a/src/html/mbgrdtiff.html b/src/html/mbgrdtiff.html
deleted file mode 100644
index a35d04b..0000000
--- a/src/html/mbgrdtiff.html
+++ /dev/null
@@ -1,249 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<HTML VERSION="2.0">
-<HEAD>
-   <TITLE>MB-System Unix Manual Page: mbgrdtiff</TITLE>
-<!-- WEBMAGIC VERSION NUMBER="2.0.2" -->
-<!-- WEBMAGIC TRANSLATION NAME="ServerRoot" SRC="/var/www/htdocs/" DST="/" -->
-<!-- WEBMAGIC TRANSLATION NAME="ProjectRoot" SRC="./" DST="" -->
-</HEAD>
-<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#336699" VLINK="#997040" ALINK="#CC9900">
-<BODY>
-<CENTER><H3><U>MB-System Unix Manual Page</U></H3></CENTER>
-<PRE>
-<H1>mbgrdtiff</H1>
-Section:  MB-System 5.0  (1)<BR>Updated:  5 February 2015 <BR><A HREF="#index">Index</A>
-<HR>
-
-<A NAME="lbAB"> </A>
-<H2>NAME</H2>
-
-<B>mbgrdtiff</B> - <B>GMT</B> plug-in module for generating a geographically
-located GeoTIFF image from a GMT grid file.
-<P>
-<A NAME="lbAC"> </A>
-<H2>VERSION</H2>
-
-Version 5.0
-<P>
-<A NAME="lbAD"> </A>
-<H2>SYNOPSIS</H2>
-
-<B>gmt mbgrdtiff</B> <B>-C</B><I>cptfile</I> <B>-I</B><I>grdfile</I>
-<B>-O</B><I>tiff_file</I> [<B>-H</B> <B>-K</B><I>intensfile</I> <B>-V -W</B>]
-<P>
-<A NAME="lbAE"> </A>
-<H2>DESCRIPTION</H2>
-
-<B>mbgrdtiff</B> is a plug-in module to generate a Geographically located
-GeoTiff image from a <B>GMT</B> grid file using <B>GMT</B> (Generic Mapping Tools).
-Like <B>mbcontour</B> and <B>mbswath</B>, <B>mbgrdtiff</B>
-is fully compatible with the <B>GMT</B> package version 5.
-A GeoTIFF image file includes location, projection and scaling information.
-The image generation used by <B>mbgrdtiff</B> is identical to
-that of the Postscript-producing <B>GMT</B> program
-<B>grdimage</B>. In particular, the color map is applied from
-a <B>GMT</B> CPT file, and shading overlay grids may be applied.
-The image is 8 bits
-per pixel if the color map is a grayscale, and 24 bits
-per pixel otherwise. In order to automatically generate a
-reasonable image of a grid, use the macro <B>mbm_grdtiff</B>.
-The program <B>mbgrdtiff</B> recognizes the coordinate system
-used by <B>mbgrid</B> or <B>mbmosaic</B> to generate a grid file, and
-then embeds the projection and grid bounds information into the TIFF
-image in accordance with the GeoTIFF standard. A number of GIS software
-packages recognize the georeferencing information in GeoTIFF images.
-In particular, images generated by <B>mbgrdtiff</B> from grids created
-using <B>mbgrid</B> or <B>mbmosaic</B> can be loaded into the
-GRASS, ArcInfo, ArcView, and ArcGIS GIS packages as geographically located
-coverages.  The <B>mbgrid</B> and <B>mbmosaic</B> manual pages each contain
-an appendix with a complete list of the projected coordinate systems that
-may used in grid generation. Some software packages (e.g. Winfrog) do not
-recognize the embedded coordinate system information, and install require
-a parallel "world" file to specify the bounds and resolution. The <B>-W</B>
-option causes a world file to be generated with a ".tfw" suffix.
-<P>
-In order for <B>GMT</B> to successfully execute <B>mbgrdtiff</B>, the
-location of the shared library <I>libmbgmt</I> containing this module must be known to <B>GMT</B>.
-This can be accomplished by either setting the GMT_CUSTOM_LIBS parameter
-in the file gmt.conf that is part of the GMT installation, by setting
-this parameter in the file gmt.conf in the user's home directory, or by
-using the GMT module <B>gmtset</B> to modify this parameter in the
-current working directory. If, for instance, the <I>libmbgmt</I> shared library
-has been installed in the file /usr/lib/libmbgmt.dylib, then the
-GMT_CUSTOM_LIBS parameter in a gmt.conf file can be set to:
-<BR>        GMT_CUSTOM_LIBS = /usr/lib/libmbgmt.dylib
-<P>
-<A NAME="lbAF"> </A>
-<H2>AUTHORSHIP</H2>
-
-David W. Caress (<A HREF="mailto:caress at mbari.org">caress at mbari.org</A>)
-<BR>
-
-<BR>  Monterey Bay Aquarium Research Institute
-<BR>
-
-Dale N. Chayes (<A HREF="mailto:dale at ldeo.columbia.edu">dale at ldeo.columbia.edu</A>)
-<BR>
-
-<BR>  Lamont-Doherty Earth Observatory
-<P>
-<A NAME="lbAG"> </A>
-<H2>OPTIONS</H2>
-
-<DL COMPACT>
-<DT><B>-C</B>
-
-<DD>
-Sets the color palette (CPT) file which controls the color of the plot.
-See documentation of the GMT package for a complete description
-of cpt files. If the R, G, and B values in the CPT file are all
-equal for each data level (i.e. R=G=B), the the output TIFF
-image will be 8 bits per pixel. Otherwise, the output TIFF image
-will be 24 bits per pixel.
-<DT><B>-H</B>
-
-<DD>
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-<DT><B>-I</B>
-
-<DD>
-<I>grdfile</I>
-<BR>
-
-The first invocation of the <B>-I</B><I>grdfile</I> option sets
-the name of the gridded data file to be plotted.
-The data must be in a form acceptable to <B>GMT</B> version 3
-programs (see the <B>GMT</B> Cookbook & Technical Reference).
-<DT><B>-I</B>
-
-<DD>
-<I>intensity_file</I>
-<BR>
-
-The second invocation of the <B>-I</B><I>grdfile</I> option sets
-the name of a gridded data file containing
-intensity values to be used for shading the map.
-Alternatively, <I>grdfile</I> may be a list of grid files
-(one filename on each line) to be used together. If a
-list of files is supplied, the intensity files must
-conform in order to the list of data grid files they will shade.
-<DT><B>-O</B>
-
-<DD>
-<I>root</I>
-<BR>
-
-Sets the root used to construct the filename of the output shellscript
-(<I>root</I>.cmd) and names of files created when the shellscript is
-run.  Normally the
-name of the input grid file or grid file list is
-used as the <I>root</I>.
-<DT><B>-V</B>
-
-<DD>
-Selects verbose mode [Default runs "silently"].
-<DT><B>-W</B>
-
-<DD>
-The <B>-W</B> option causes a "world" file to be generated parallel to the
-GeoTiff image with a ".tfw" suffix. Some software packages (e.g. Winfrog) do
-not recognize the coordinate information embedded in the GeoTiff file, and
-look for a world file.
-</DL>
-<A NAME="lbAH"> </A>
-<H2>EXAMPLES</H2>
-
-Suppose we have obtained two GRD files called PunaA_bath.grd
-and PunaA_ss.grd, both with dimensions
-1162 x 1068. The file PunaA_bath.grd contains seafloor
-topography (depth values are negative, ranging
-from -5035 m to -1619 m), and the file PunaA_ss.grd
-contains a sidescan mosaic (reflectivity values
-ranging from 0 to 128 dB). In order to generate
-a 24 bit color TIFF image of the seafloor topography, we use:
-<BR>
-
-<BR> <TT>       </TT>gmt mbgrdtiff -I PunaA_bath.grd  <TT>       </TT><TT>        </TT>-O PunaA_bath.tif  <TT>     </TT><TT>        </TT>-C bath.cpt -V<BR>
-<BR>
-
-where the color is controlled by a GMT cpt file bath.cpt
-containing:
-<BR>
-
-<BR> <TT>       </TT>-5250  37  57 175 -4875  40 127 251<BR>
-<BR> <TT>       </TT>-4875  40 127 251 -4500  50 190 255<BR>
-<BR> <TT>       </TT>-4500  50 190 255 -4125 106 235 255<BR>
-<BR> <TT>       </TT>-4125 106 235 255 -3750 138 236 174<BR>
-<BR> <TT>       </TT>-3750 138 236 174 -3375 205 255 162<BR>
-<BR> <TT>       </TT>-3375 205 255 162 -3000 240 236 121<BR>
-<BR> <TT>       </TT>-3000 240 236 121 -2625 255 189  87<BR>
-<BR> <TT>       </TT>-2625 255 189  87 -2250 255 161  68<BR>
-<BR> <TT>       </TT>-2250 255 161  68 -1875 255 186 133<BR>
-<BR> <TT>       </TT>-1875 255 186 133 -1500 255 255 255<BR>
-<BR>
-
-In order to generate
-an 8 bit grayscale TIFF image of the sidescan mosaic, we use:
-<BR>
-
-<BR> <TT>       </TT>gmt mbgrdtiff -I PunaA_ss.grd  <TT> </TT><TT>        </TT>-O PunaA_ss.tif  <TT>       </TT><TT>        </TT>-C ss.cpt -V<BR>
-<BR>
-
-where the grayscale is controlled by a GMT cpt file ss.cpt
-containing:
-<BR>
-
-<BR> <TT>       </TT> 0.00   0   0   0   16.50  26  26  26<BR>
-<BR> <TT>       </TT>16.50  26  26  26   22.87  51  51  51<BR>
-<BR> <TT>       </TT>22.87  51  51  51   27.00  77  77  77<BR>
-<BR> <TT>       </TT>27.00  77  77  77   30.00 102 102 102<BR>
-<BR> <TT>       </TT>30.00 102 102 102   32.25 128 128 128<BR>
-<BR> <TT>       </TT>32.25 128 128 128   34.25 153 153 153<BR>
-<BR> <TT>       </TT>34.25 153 153 153   36.25 179 179 179<BR>
-<BR> <TT>       </TT>36.25 179 179 179   38.50 204 204 204<BR>
-<BR> <TT>       </TT>38.50 204 204 204   41.23 230 230 230<BR>
-<BR> <TT>       </TT>41.23 230 230 230  128.00 255 255 255<BR>
-<BR>
-
-Here greater reflectivity amplitudes are represented by
-light grayscales.
-<P>
-<A NAME="lbAI"> </A>
-<H2>SEE ALSO</H2>
-
-<B><A HREF="mbsystem.html">mbsystem</A></B>(1), <B><A HREF="mbm_grdplot.html">mbm_grdplot</A></B>(1), <B><A HREF="mbgrid.html">mbgrid</A></B>(1), <B><A HREF="mbmosaic.html">mbmosaic</A></B>(1),
-<B><A HREF="mbm_grid.html">mbm_grid</A></B>(1), <B><A HREF="mbm_grdtiff.html">mbm_grdtiff</A></B>(1), <B>gmt</B>(1), <B>grdimage</B>(1)
-<P>
-<A NAME="lbAJ"> </A>
-<H2>BUGS</H2>
-
-Let us know.
-<P>
-
-<HR>
-<A NAME="index"> </A><H2>Index</H2>
-<DL>
-<DT><A HREF="#lbAB">NAME</A><DD>
-<DT><A HREF="#lbAC">VERSION</A><DD>
-<DT><A HREF="#lbAD">SYNOPSIS</A><DD>
-<DT><A HREF="#lbAE">DESCRIPTION</A><DD>
-<DT><A HREF="#lbAF">AUTHORSHIP</A><DD>
-<DT><A HREF="#lbAG">OPTIONS</A><DD>
-<DT><A HREF="#lbAH">EXAMPLES</A><DD>
-<DT><A HREF="#lbAI">SEE ALSO</A><DD>
-<DT><A HREF="#lbAJ">BUGS</A><DD>
-</DL>
-<HR>
-</PRE>
-
-<CENTER><P><BR>
-Last Updated: 5 February 2015</P></CENTER>
-
-<HR>
-<P><A HREF="mbsystem_man_list.html">Return to list of MB-System manual pages...</A></P>
-<P><A HREF="mbsystem_home.html"><IMG SRC="mbsystem_logo_small.gif" BORDER=0 HEIGHT=55 WIDTH=158 ALIGN=BOTTOM></A><A HREF="mbsystem_home.html">Back
-to MB-System Home Page...</A></P>
-
-</BODY>
-</HTML>
diff --git a/src/html/mbgrdviz.html b/src/html/mbgrdviz.html
deleted file mode 100644
index 62a6b3c..0000000
--- a/src/html/mbgrdviz.html
+++ /dev/null
@@ -1,719 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<HTML VERSION="2.0">
-<HEAD>
-   <TITLE>MB-System Unix Manual Page: mbgrdviz</TITLE>
-<!-- WEBMAGIC VERSION NUMBER="2.0.2" -->
-<!-- WEBMAGIC TRANSLATION NAME="ServerRoot" SRC="/var/www/htdocs/" DST="/" -->
-<!-- WEBMAGIC TRANSLATION NAME="ProjectRoot" SRC="./" DST="" -->
-</HEAD>
-<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#336699" VLINK="#997040" ALINK="#CC9900">
-<BODY>
-<CENTER><H3><U>MB-System Unix Manual Page</U></H3></CENTER>
-<PRE>
-<H1>mbgrdviz</H1>
-Section:  MB-System 5.0  (1)<BR>Updated:  16 August 2013 <BR><A HREF="#index">Index</A>
-<HR>
-
-<A NAME="lbAB"> </A>
-<H2>NAME</H2>
-
-<B>MBgrdviz</B> - Simple interactive 2D/3D visualization of GMT grids.
-<P>
-<A NAME="lbAC"> </A>
-<H2>VERSION</H2>
-
-Version 5.0
-<P>
-<A NAME="lbAD"> </A>
-<H2>SYNOPSIS</H2>
-
-<B>MBgrdviz</B> [-I<I>gridfile</I> <B>-T -V -H</B>]
-<P>
-<A NAME="lbAE"> </A>
-<H2>DESCRIPTION</H2>
-
-<P>
-<I>Overview</I>
-<P>
-<B>MBgrdviz</B> is an interactive 2D/3D visualization tool for <B>GMT</B> topography
-grid files. <B>MBgrdviz</B> can be used for general data visualization and also has features
-integrating it with swath mapping data processing and swath survey planning.
-<P>
-Once a topographic grid has been read, it may be displayed either as a 2D map or as
-a 3D model. The 2D view can be panned and zoomed; the 3D view also allows arbitrary
-rotations of both the topography model and the viewpoint.
-<P>
-In addition to the primary topography, other data sets (e.g. sidescan sonar
-mosaics) can be read and displayed as overlays on the topography. Navigation
-of ships or underwater vehicles can be read and displayed; if associated with
-swath data the extent of mapping coverage can be displayed. Site data (individual
-point locations) can be read, displayed, interactively created and modified, and
-saved. Route data (collections of waypoints) can also be read, displayed,
-interactively created and modified, and saved.
-<P>
-The topography data can be shown using a number of colortables. The colortables can
-be linearly stretched between minimum and maximum values, or applied using
-a histogram equalization. The display may also be shaded using an
-illumination model, slope magnitude, or overlay grid data. Overlay data
-can be displayed draped on the topography. Topographic
-contours can be displayed using a user defined contour interval.
-<P>
-In addition to modifying the view, users can interact with the display in
-several ways. Users can pick single points on the surface to determine position
-and topography values, or pick and drag to determine range and bearing between
-two locations. Arbitrary rectangular regions with north-south and east-west boundaries or
-arbitrarily oriented rectangular areas can be defined by picking and dragging.
-The data within a region can be opened as a new display; areas can be used
-for survey planning.
-<P>
-Topographic profiles associated with two-point picks, selected navigation, or
-selected routes can be displayed in a separate window and saved.
-<P>
-<B>MBgrdviz</B> can be used to select swath data files for editing or analysis
-using other <B>MB-System</B> tools. If survey navigation has been read and
-displayed, a user may interactively select files of interest, and then start up
-the interactive waterfall bathymetry editor <B>MBedit</B> to work on those files.
-Also available are the interactive, visualization based bathymetry editor
-<B>MBeditviz</B>, the navigation editor <B>MBnavedit</B>, and the water sound
-speed modeling tool <B>MBvelocitytool</B>.
-<P>
-<B>MBgrdviz</B> supports as many as ten displays deriving either from reading
-topography grids or extracting user defined regions from existing displays.
-<P>
-<I>Starting Up</I>
-<P>
-When <B>MBgrdviz</B> is invoked on the command line, a single window comes up with
-the title <B>MBgrdviz</B> and two menus: <B>File</B> and <B>Help</B>. The <B>Help</B>
-menu contains a single item named <B>About</B>, which brings up a simple
-information window including the MB-System release version identifier.
-The <B>File</B> menu contains several items, but initially only the <B>Open Primary
-Grid</B> and <B>Quit</B> items are enabled. Selecting <B>Open Primary Grid</B> brings
-up a filesystem browser window that allows users to find and select the desired
-<B>GMT</B> topography grid. By default, the browser filter is set to display only
-files ending with a ".grd" suffix. Users can change this filter (e.g. setting it
-to "*" will display all files) and then hit the <B>Filter</B> button to relist the
-files as desired. Once the desired topography grid file has been located and
-selected so that its full path appears in the <B>Selection</B> text item, clicking
-the <B>OK</B> button will cause <B>MBgrdviz</B> to read the grid and open an <B>MBview</B>
-display window. Initially, the topography will be displayed in 2D, or map view mode.
-The default color table will be "Haxby", and the topography will be shaded using slope magnitude.
-<P>
-<I>Picking, Zooming, Panning in 2D View</I>
-<P>
-<B>MBgrdviz</B> will initially be in the "pan and zoom" mouse mode.
-<P>
-In this mode, if the cursor is over
-topography when the left button is clicked, a red X will appear at the
-pick point and an info window on the left side of the <B>MBview</B> display window
-will show the longitude, latitude, and topography value of the pick point.
-If the left button is used to drag the cursor from one location to another, both
-the pick and release points will be shown as red Xs and a red line will be displayed
-in between. The info window will show both the start and end positions and also the
-range and bearing between the two locations.
-<P>
-The middle button can be used to pan by clicking, holding down, and moving the cursor.
-<P>
-The right button can be used to zoom the display by clicking, holding down,
-and moving the cursor up to zoom in or down to zoom out.
-<P>
-<I>Manipulating a 3D View</I>
-<P>
-The user can switch from 2D map view to 3D view mode using the <View->3D Display> menu item
-(and can switch back using the<View->Map Display> menu item). In the 3D view mode, picking,
-panning, and zooming are done in the same fashion as in the map view. However, the
-display is a perspective view that includes both rotation of the topographic model and
-of the viewpoint. To rotate the model, select the "Rotate Model" button (or the <Mouse->Rotate Model>
-menu item). The left button can be used to pick topography, the middle button will rotate the model
-when clicked and dragged, and the right button will change the vertical exageration when
-clicked and moved up (more exageration) or down (less exageration). To rotate the viewpoint,
-select the "Rotate View" button (or the <Mouse->Rotate View>
-menu item). The left button can be used to pick topography, the middle button will rotate the model
-when clicked and dragged, and the right button will change the vertical exageration when
-clicked and moved up (more exageration) or down (less exageration).
-<P>
-<A NAME="lbAF"> </A>
-<H2>AUTHORSHIP</H2>
-
-David W. Caress (<A HREF="mailto:caress at mbari.org">caress at mbari.org</A>)
-<BR>
-
-<BR>  Monterey Bay Aquarium Research Institute
-<BR>
-
-Dale N. Chayes (<A HREF="mailto:dale at ldeo.columbia.edu">dale at ldeo.columbia.edu</A>)
-<BR>
-
-<BR>  Lamont-Doherty Earth Observatory
-<P>
-<A NAME="lbAG"> </A>
-<H2>OPTIONS</H2>
-
-<DL COMPACT>
-<DT><B>-H</B>
-
-<DD>
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-<DT><B>-I</B>
-
-<DD>
-<I>gridfile</I>
-<BR>
-
-Sets a GMT grid file to be read and displayed at startup.
-This option is usually used only when <B>MBgrdviz</B> is started
-automatically from some other process.
-<DT><B>-T</B>
-
-<DD>
-Sets a test grid to be calculated and displayed at startup.This
-allows the program to be tested even when a grid file is
-unavailable.
-<DT><B>-V</B>
-
-<DD>
-Normally, <B>MBgrdviz</B> outputs limited information to the stderr stream.
-If the <B>-V</B> flag is given, then <B>MBgrdviz</B> works in a "verbose" mode and
-outputs the program version being used, all error status messages,
-and a large amount of other information including all of the
-beams flagged or zeroed.
-<P>
-</DL>
-<A NAME="lbAH"> </A>
-<H2>INTERACTIVE CONTROLS: MBgrdviz Startup Window</H2>
-
-<DL COMPACT>
-<DT><B>[MBgrdviz]:<File->Open Primary Grid></B>
-
-<DD>
-This menu button pops up a file browser that allows the user to
-select an input <B>GMT</B> grid file. If the OK button is clicked, <B>MBgrdviz</B> will
-attempt to read a topography grid from the specified file. If successful,
-a new <B>MBview</B> window will appear displaying the topography.
-<DT><B>[MBgrdviz]:<File->Open Site></B>
-
-<DD>
-This menu button pops up a file browser that allows the user to
-select an input site file. A site file specifies one or more
-individual locations that can be displayed and interactively moved.
-Site files are text with each line delineating a single site with
-white space delimited columns
-<DT><B>[MBgrdviz]:<File->Open Route></B>
-
-<DD>
-<DT><B>[MBgrdviz]:<File->Open Navigation></B>
-
-<DD>
-<DT><B>[MBgrdviz]:<File->Open Swath></B>
-
-<DD>
-<DT><B>[MBgrdviz]:<File->Save Site></B>
-
-<DD>
-<DT><B>[MBgrdviz]:<File->Save Route></B>
-
-<DD>
-<DT><B>[MBgrdviz]:<File->Quit></B>
-
-<DD>
-This button causes the program to exit (mostly) gracefully.
-<DT><B>[MBgrdviz]:<Help->About></B>
-
-<DD>
-This button causes the program to bring up a dialog showing the
-program's name, version, and authors.
-<P>
-</DL>
-<A NAME="lbAI"> </A>
-<H2>INTERACTIVE CONTROLS: MBview Main Window</H2>
-
-<DL COMPACT>
-<DT><B>[MBview]:<View->Map Display></B>
-
-<DD>
-<DT><B>[MBview]:<View->3D Display></B>
-
-<DD>
-<DT><B>[MBview]:<View->Topography></B>
-
-<DD>
-<DT><B>[MBview]:<View->Topography Slope></B>
-
-<DD>
-<DT><B>[MBview]:<View->Overlay></B>
-
-<DD>
-<DT><B>[MBview]:<View->No Shading></B>
-
-<DD>
-<DT><B>[MBview]:<View->Shading by Illumination></B>
-
-<DD>
-<DT><B>[MBview]:<View->Shading by Slope></B>
-
-<DD>
-<DT><B>[MBview]:<View->Shading by Overlay></B>
-
-<DD>
-<DT><B>[MBview]:<View->Topography Contours></B>
-
-<DD>
-<DT><B>[MBview]:<View->Sites></B>
-
-<DD>
-<DT><B>[MBview]:<View->Routes></B>
-
-<DD>
-<DT><B>[MBview]:<View->Navigation></B>
-
-<DD>
-<DT><B>[MBview]:<View->Draped Navigation></B>
-
-<DD>
-<DT><B>[MBview]:<View->Haxby Colortable></B>
-
-<DD>
-<DT><B>[MBview]:<View->Bright Rainbow Colortable></B>
-
-<DD>
-<DT><B>[MBview]:<View->Muted Rainbow Colortable></B>
-
-<DD>
-<DT><B>[MBview]:<View->Grayscale Colortable></B>
-
-<DD>
-<DT><B>[MBview]:<View->Flat Gray Colortable></B>
-
-<DD>
-<DT><B>[MBview]:<View->Sealevel Colortable></B>
-
-<DD>
-<DT><B>[MBview]:<Controls->Colors and Contours></B>
-
-<DD>
-<DT><B>[MBview]:<Controls->2D Controls></B>
-
-<DD>
-<DT><B>[MBview]:<Controls->3D Controls></B>
-
-<DD>
-<DT><B>[MBview]:<Controls->Shading></B>
-
-<DD>
-<DT><B>[MBview]:<Controls->Resolution></B>
-
-<DD>
-<DT><B>[MBview]:<Controls->Projections></B>
-
-<DD>
-<DT><B>[MBview]:<Controls->Site List></B>
-
-<DD>
-<DT><B>[MBview]:<Controls->Route List></B>
-
-<DD>
-<DT><B>[MBview]:<Controls->Navigation List></B>
-
-<DD>
-<DT><B>[MBview]:<Mouse->Full></B>
-
-<DD>
-<DT><B>[MBview]:<Mouse->Reset></B>
-
-<DD>
-<DT><B>[MBview]:<Mouse->Clear></B>
-
-<DD>
-<DT><B>[MBview]:<Mouse->Pan and Zoom></B>
-
-<DD>
-<DT><B>[MBview]:<Mouse->Rotate Model></B>
-
-<DD>
-<DT><B>[MBview]:<Mouse->Rotate View></B>
-
-<DD>
-<DT><B>[MBview]:<Mouse->Shading></B>
-
-<DD>
-<DT><B>[MBview]:<Mouse->Pick Area></B>
-
-<DD>
-<DT><B>[MBview]:<Mouse->Edit Sites></B>
-
-<DD>
-<DT><B>[MBview]:<Mouse->Edit Routes></B>
-
-<DD>
-<DT><B>[MBview]:<Mouse->Pick Nav></B>
-
-<DD>
-<DT><B>[MBview]:<Action->About MBview...></B>
-
-<DD>
-<DT><B>[MBview]:<Action->Open Overlay Grid></B>
-
-<DD>
-<DT><B>[MBview]:<Action->Open Site File></B>
-
-<DD>
-<DT><B>[MBview]:<Action->Open Route File></B>
-
-<DD>
-<DT><B>[MBview]:<Action->Open Navigation></B>
-
-<DD>
-<DT><B>[MBview]:<Action->Open Swath File></B>
-
-<DD>
-<DT><B>[MBview]:<Action->Save Site File></B>
-
-<DD>
-<DT><B>[MBview]:<Action->Save Route File></B>
-
-<DD>
-<DT><B>[MBview]:<Action->Save Route as Winfrog PTS File></B>
-
-<DD>
-<DT><B>[MBview]:<Action->Save Route as Winfrog WPT File></B>
-
-<DD>
-<DT><B>[MBview]:<Action->Save Route as Degrees + Decimal Minutes File></B>
-
-<DD>
-<DT><B>[MBview]:<Action->Save Route as Hypack LNW File></B>
-
-<DD>
-<DT><B>[MBview]:<Action->Save Profile File></B>
-
-<DD>
-<DT><B>[MBview]:<Action->Open Selected Nav in MBedit></B>
-
-<DD>
-<DT>B [MBview]:<Action->Open Selected Nav in MBeditviz><DD>
-<DT>B [MBview]:<Action->Open Selected Nav in MBnavedit><DD>
-<DT>B [MBview]:<Action->Open Selected Nav in MBvelocitytool><DD>
-<DT><B>[MBview]:<Action->Open Region as New View></B>
-
-<DD>
-<DT><B>[MBview]:<Action->Generate Survey Route from Area></B>
-
-<DD>
-<DT><B>[MBview]:<Dismiss->Dismiss></B>
-
-<DD>
-<DT><B>[MBview]:<Full></B>
-
-<DD>
-<DT><B>[MBview]:<Reset></B>
-
-<DD>
-<DT><B>[MBview]:<Clear></B>
-
-<DD>
-<DT><B>[MBview]:<Pan and Zoom></B>
-
-<DD>
-<DT><B>[MBview]:<Rotate Model></B>
-
-<DD>
-<DT><B>[MBview]:<Rotate View></B>
-
-<DD>
-<DT><B>[MBview]:<Shading></B>
-
-<DD>
-<DT><B>[MBview]:<Pick Area></B>
-
-<DD>
-<DT><B>[MBview]:<Edit Sites></B>
-
-<DD>
-<DT><B>[MBview]:<Edit Routes></B>
-
-<DD>
-<DT><B>[MBview]:<Pick Nav></B>
-
-<DD>
-<P>
-</DL>
-<A NAME="lbAJ"> </A>
-<H2>INTERACTIVE CONTROLS: MBview Colors and Contours Window</H2>
-
-<DL COMPACT>
-<DT><B>[Colors and Contours]:{Data Color Bounds}Minimum</B>
-
-<DD>
-<DT><B>[Colors and Contours]:{Data Color Bounds}Maximum</B>
-
-<DD>
-<DT><B>[Colors and Contours]:{Data Color Bounds}<<Cold-to-Hot><Hot-to-Cold>></B>
-
-<DD>
-<DT><B>[Colors and Contours]:Data Contour Interval</B>
-
-<DD>
-<DT><B>[Colors and Contours]:{Data Slope Color Bounds}Minimum</B>
-
-<DD>
-<DT><B>[Colors and Contours]:{Data Slope Color Bounds}Maximum</B>
-
-<DD>
-<DT><B>[Colors and Contours]:{Data Slope Color Bounds}<<Cold-to-Hot><Hot-to-Cold>></B>
-
-<DD>
-<DT><B>[Colors and Contours]:{Overlay Color Bounds}Minimum</B>
-
-<DD>
-<DT><B>[Colors and Contours]:{Overlay Color Bounds}Maximum</B>
-
-<DD>
-<DT><B>[Colors and Contours]:{Overlay Color Bounds}<<Cold-to-Hot><Hot-to-Cold>></B>
-
-<DD>
-<DT><B>[Colors and Contours]:<Apply></B>
-
-<DD>
-<DT><B>[Colors and Contours]:<Dismiss></B>
-
-<DD>
-<P>
-</DL>
-<A NAME="lbAK"> </A>
-<H2>INTERACTIVE CONTROLS: MBview Colors and Contours Window</H2>
-
-<DL COMPACT>
-<DT><B>[2D Parameters]:{View Offset}X</B>
-
-<DD>
-<DT><B>[2D Parameters]:{View Offset}Y</B>
-
-<DD>
-<DT><B>[2D Parameters]:{View Offset}Zoom</B>
-
-<DD>
-<DT><B>[2D Parameters]:<Apply></B>
-
-<DD>
-<DT><B>[2D Parameters]:<Dismiss></B>
-
-<DD>
-<P>
-</DL>
-<A NAME="lbAL"> </A>
-<H2>INTERACTIVE CONTROLS: MBview Colors and Contours Window</H2>
-
-<DL COMPACT>
-<DT><B>[3D Parameters]:{Model Orientation & Zoom}Azimuth</B>
-
-<DD>
-<DT><B>[3D Parameters]:{Model Orientation & Zoom}Elevation</B>
-
-<DD>
-<DT><B>[3D Parameters]:{Model Orientation & Zoom}Zoom</B>
-
-<DD>
-<DT><B>[3D Parameters]:{View Orientation & Zoom}Azimuth</B>
-
-<DD>
-<DT><B>[3D Parameters]:{View Orientation & Zoom}Elevation</B>
-
-<DD>
-<B>[3D Parameters]:{View Orientation & Zoom}Zoom</B>
-
-<DT><B>[3D Parameters]:Vertical Exageration</B>
-
-<DD>
-<DT><B>[3D Parameters]:{Pan}X</B>
-
-<DD>
-<DT><B>[3D Parameters]:{Pan}Y</B>
-
-<DD>
-<DT><B>[3D Parameters]:<Apply></B>
-
-<DD>
-<DT><B>[2D Parameters]:<Dismiss></B>
-
-<DD>
-<P>
-</DL>
-<A NAME="lbAM"> </A>
-<H2>INTERACTIVE CONTROLS: MBview Colors and Contours Window</H2>
-
-<DL COMPACT>
-<DT><B>[Shading Parameters]:{Shading by Illumination}Amplitude</B>
-
-<DD>
-<DT><B>[Shading Parameters]:{Shading by Illumination}Azimuth</B>
-
-<DD>
-<DT><B>[Shading Parameters]:{Shading by Illumination}Elevation</B>
-
-<DD>
-<DT><B>[Shading Parameters]:{Shading by Slope}Amplitude</B>
-
-<DD>
-<DT><B>[Shading Parameters]:{Shading by Overlay}Amplitude</B>
-
-<DD>
-<DT><B>[Shading Parameters]:{Shading by Overlay}Center</B>
-
-<DD>
-<DT><B>[Shading Parameters]:{Shading by Overlay}<<Cold-to-Hot><Hot-to-Cold>></B>
-
-<DD>
-<DT><B>[Shading Parameters]:<Apply></B>
-
-<DD>
-<DT><B>[Shading Parameters]:<Dismiss></B>
-
-<DD>
-<P>
-</DL>
-<A NAME="lbAN"> </A>
-<H2>INTERACTIVE CONTROLS: MBview Colors and Contours Window</H2>
-
-<DL COMPACT>
-<DT><B>[Rendering Resolution]:<Dismiss></B>
-
-<DD>
-<DT><B>[Rendering Resolution]:==Low Resolution Dimension==</B>
-
-<DD>
-<DT><B>[Rendering Resolution]:==High Resolution Dimension==</B>
-
-<DD>
-<DT><B>[Rendering Resolution]:<Dismiss></B>
-
-<DD>
-<DT><B>[Rendering Resolution]:<Dismiss></B>
-
-<DD>
-<P>
-</DL>
-<A NAME="lbAO"> </A>
-<H2>INTERACTIVE CONTROLS: MBview Colors and Contours Window</H2>
-
-<DL COMPACT>
-<DT><B>[Projections]:{Display Projection}<<Geographic><UTM><Spheroid>></B>
-
-<DD>
-<DT><B>[Projections]:<Dismiss></B>
-
-<DD>
-<P>
-</DL>
-<A NAME="lbAP"> </A>
-<H2>INTERACTIVE CONTROLS: MBview Colors and Contours Window</H2>
-
-<DL COMPACT>
-<DT><B>[Site List]:|Site List|</B>
-
-<DD>
-<DT><B>[Site List]:<Delete Selected Sites></B>
-
-<DD>
-<DT><B>[Site List]:<Dismiss></B>
-
-<DD>
-<P>
-</DL>
-<A NAME="lbAQ"> </A>
-<H2>INTERACTIVE CONTROLS: MBview Colors and Contours Window</H2>
-
-<DL COMPACT>
-<DT><B>[Route List]:|Route List|</B>
-
-<DD>
-<DT><B>[Route List]:<Delete Selected Routes></B>
-
-<DD>
-<DT><B>[Route List]:<Dismiss></B>
-
-<DD>
-<P>
-</DL>
-<A NAME="lbAR"> </A>
-<H2>INTERACTIVE CONTROLS: MBview Colors and Contours Window</H2>
-
-<DL COMPACT>
-<DT><B>[Navigation List]:|Navigation List|</B>
-
-<DD>
-<DT><B>[Navigation List]:<Delete Selected Navigation></B>
-
-<DD>
-<DT><B>[Navigation List]:<Dismiss></B>
-
-<DD>
-<P>
-</DL>
-<A NAME="lbAS"> </A>
-<H2>MOUSE ACTIONS</H2>
-
-<P>
-<A NAME="lbAT"> </A>
-<H2>KEYBOARD ACTIONS</H2>
-
-<P>
-<A NAME="lbAU"> </A>
-<H2>MBGRDVIZ ROUTE FILES</H2>
-
-<P>
-<A NAME="lbAV"> </A>
-<H2>MBGRDVIZ SITE FILES</H2>
-
-<P>
-<A NAME="lbAW"> </A>
-<H2>SEE ALSO</H2>
-
-<B><A HREF="mbsystem.html">mbsystem</A></B>(1)
-<P>
-<A NAME="lbAX"> </A>
-<H2>BUGS</H2>
-
-This program is not done, nor is it adequately documented.
-<P>
-<P>
-
-<HR>
-<A NAME="index"> </A><H2>Index</H2>
-<DL>
-<DT><A HREF="#lbAB">NAME</A><DD>
-<DT><A HREF="#lbAC">VERSION</A><DD>
-<DT><A HREF="#lbAD">SYNOPSIS</A><DD>
-<DT><A HREF="#lbAE">DESCRIPTION</A><DD>
-<DT><A HREF="#lbAF">AUTHORSHIP</A><DD>
-<DT><A HREF="#lbAG">OPTIONS</A><DD>
-<DT><A HREF="#lbAH">INTERACTIVE CONTROLS: MBgrdviz Startup Window</A><DD>
-<DT><A HREF="#lbAI">INTERACTIVE CONTROLS: MBview Main Window</A><DD>
-<DT><A HREF="#lbAJ">INTERACTIVE CONTROLS: MBview Colors and Contours Window</A><DD>
-<DT><A HREF="#lbAK">INTERACTIVE CONTROLS: MBview Colors and Contours Window</A><DD>
-<DT><A HREF="#lbAL">INTERACTIVE CONTROLS: MBview Colors and Contours Window</A><DD>
-<DT><A HREF="#lbAM">INTERACTIVE CONTROLS: MBview Colors and Contours Window</A><DD>
-<DT><A HREF="#lbAN">INTERACTIVE CONTROLS: MBview Colors and Contours Window</A><DD>
-<DT><A HREF="#lbAO">INTERACTIVE CONTROLS: MBview Colors and Contours Window</A><DD>
-<DT><A HREF="#lbAP">INTERACTIVE CONTROLS: MBview Colors and Contours Window</A><DD>
-<DT><A HREF="#lbAQ">INTERACTIVE CONTROLS: MBview Colors and Contours Window</A><DD>
-<DT><A HREF="#lbAR">INTERACTIVE CONTROLS: MBview Colors and Contours Window</A><DD>
-<DT><A HREF="#lbAS">MOUSE ACTIONS</A><DD>
-<DT><A HREF="#lbAT">KEYBOARD ACTIONS</A><DD>
-<DT><A HREF="#lbAU">MBGRDVIZ ROUTE FILES</A><DD>
-<DT><A HREF="#lbAV">MBGRDVIZ SITE FILES</A><DD>
-<DT><A HREF="#lbAW">SEE ALSO</A><DD>
-<DT><A HREF="#lbAX">BUGS</A><DD>
-</DL>
-<HR>
-</PRE>
-
-<CENTER><P><BR>
-Last Updated: 16 August 2013</P></CENTER>
-
-<HR>
-<P><A HREF="mbsystem_man_list.html">Return to list of MB-System manual pages...</A></P>
-<P><A HREF="mbsystem_home.html"><IMG SRC="mbsystem_logo_small.gif" BORDER=0 HEIGHT=55 WIDTH=158 ALIGN=BOTTOM></A><A HREF="mbsystem_home.html">Back
-to MB-System Home Page...</A></P>
-
-</BODY>
-</HTML>
diff --git a/src/html/mbgrid.html b/src/html/mbgrid.html
deleted file mode 100644
index 73e991f..0000000
--- a/src/html/mbgrid.html
+++ /dev/null
@@ -1,8425 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<HTML VERSION="2.0">
-<HEAD>
-   <TITLE>MB-System Unix Manual Page: mbgrid</TITLE>
-<!-- WEBMAGIC VERSION NUMBER="2.0.2" -->
-<!-- WEBMAGIC TRANSLATION NAME="ServerRoot" SRC="/var/www/htdocs/" DST="/" -->
-<!-- WEBMAGIC TRANSLATION NAME="ProjectRoot" SRC="./" DST="" -->
-</HEAD>
-<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#336699" VLINK="#997040" ALINK="#CC9900">
-<BODY>
-<CENTER><H3><U>MB-System Unix Manual Page</U></H3></CENTER>
-<PRE>
-<H1>mbgrid</H1>
-Section:  MB-System 5.0  (1)<BR>Updated:  29 November 2014 <BR><A HREF="#index">Index</A>
-<HR>
-
-<A NAME="lbAB"> </A>
-<H2>NAME</H2>
-
-<B>mbgrid</B> - Grid bathymetry, amplitude, or sidescan data
-from swath sonar data files.
-<P>
-<A NAME="lbAC"> </A>
-<H2>VERSION</H2>
-
-Version 5.0
-<P>
-<A NAME="lbAD"> </A>
-<H2>SYNOPSIS</H2>
-
-<B>mbgrid</B> <B>-I</B><I>filelist</I> <B>-O</B><I>root</I>
-[<B>-A</B><I>datatype</I>
-<B>-B</B><I>border</I> -C<I>clip</I>[<I>/mode</I>] <B>-D</B><I>xdim/ydim</I>
-<B>-E</B><I>dx/dy/units[!]</I> <B>-F</B><I>mode</I>
-<B>-G</B><I>gridkind</I> <B>-J</B><I>projection</I> <B>-K</B><I>background</I>
-<B>-L</B><I>lonflip</I> <B>-M -N -P</B><I>pings</I> <B>-Q</B>
-<B>-R</B><I>west/east/south/north</I> <B>-R</B><I>factor</I>
-<B>-S</B><I>speed</I> <B>-T</B><I>tension</I> <B>-U</B><I>time</I>
-<B>-V</B> -W<I>scale</I> <B>-X</B><I>extend</I>]
-<P>
-<A NAME="lbAE"> </A>
-<H2>DESCRIPTION</H2>
-
-<B>mbgrid</B> is a utility used to grid bathymetry, amplitude, or sidescan
-data contained in a set of swath sonar data files. This program uses
-one of four algorithms to grid regions covered by swath sonar
-swaths and then can fill in gaps between the swaths (to the degree
-specified by the user) using a thin plate spline interpolation.
-The gridding algorithms include gaussian weighted average,
-median filter, minimum filter (use minimum value in grid bin), and
-maximum filter (use maximum value in grid bin).
-<P>
-The user must specify a file containing a list of the data files to
-be used and their data formats (<B>-I</B>), and a character string
-to be used as the root of the output filenames (<B>-O</B>). The user
-may specify the bounds of the region to be gridded
-(<B>-R</B><I>west/east/south/north</I>), and
-either the dimensions (<B>-D</B>) or node spacing <B>-E</B> of the grid,
-If the bounds and grid dimensions (or spacing) are not specified, the
-program will select the region encompassing all of the data in the
-input files and a grid spacing equivalent to 0.02 times the maximum
-sonar altitude. The automatically calculated grid bounds will exactly
-correspond to the smallest rectangular region including the data unless
-the user specifies a larger region using <B>-R</B><I>factor</I>. The value
-<I>factor</I> must be greater than one; if <I>factor</I> = 1.1 then the
-grid bounds will be expanded to the east and west by an amount 0.05 times
-the data bounds east-west extend and to the north and south by an amount
-0.05 times the data bounds north-south extent. The user can also specify
-the type of the input data (<B>-A</B>), the width of the gaussian filter
-used for weighted average gridding (<B>-W</B>), the maximum distance from
-data points that the spline interpolation is used (<B>-C</B>), the
-format of the output files, and other parameters.
-<P>
-By default, <B>mbgrid</B> generates grids in Geographic coordinates,
-meaning that position is defined in longitude and latitude using
-the WGS84 horizontal datum. The <B>-J</B> option can be used to specify
-an alternate, projected coordinate system (PCS). When a PCS is used,
-position will be defined in eastings and northings (meters) relative
-to the origin of the particular PCS. Universal Transverse Mercator
-is the most commonly used PCS in the oceanographic community, but
-<B>mbgrid</B> supports a large number of other PCS as well. A list of
-the supported PCS's is provided at the end of this manual page.
-<P>
-Before opening an input swath data file, <B>mbgrid</B> checks for
-an ascii file in the same directory having the same name except
-that ".inf" is appended to the end. The program assumes that this
-ascii file contains the output of the program <B>mbinfo</B> run on
-the input data file. If the ".inf" file exists, <B>mbgrid</B> reads
-the minimum and maximum longitude and latitude bounds from the
-<B>mbinfo</B> output and compares those to the working bounds
-for the grid. If the ".inf" file indicates that none of the data
-in the input file lies inside the working grid bounds, that input
-file is skipped. This allows users to maintain a single master list
-of data files for use in all gridding without the performance penalty
-of <B>mbgrid</B> reading through all the data files, even those
-with no relevent data. We recommend that users maintain a ".inf"
-file for each swath data file used for gridding or plotting. The
-programs <B>mbswath</B> and <B>mbcontour</B> also use ".inf" files
-in the same fashion.
-<P>
-Usually, the internal working grid has the same boundaries as the
-output grid. However, the <B>-X</B> option
-allows the size of the internal grid to be increased so that data outside
-the grid can be used to guide the spline interpolation of data gaps which
-happen to lie at the the edge of the grid.  This is particularly important
-when adjacent grids are created which should match along the edges.
-The data input bounds are set to a region three times as large as
-the working grid in both longitude and latitude.  The program reads all
-pings which lie within the data input bounds, and accepts all beam
-values with locations within the working grid. In addition to swath sonar
-data in formats supported by <B>MB-System</B> (see the <B>MB-System</B> manual
-page), <B>mbgrid</B> can also read data from ASCII text files in
-longitude, latitude, value triples. This allows one to incorporate
-conventional echosounder bathymetry data into the gridding.
-<P>
-The available gridding algorithms specified with the <B>-F</B> option are:
-<BR>
-
-<BR>     1. Gaussian weighted mean filter
-<BR>     2. Median filter
-<BR>     3. Minimum filter
-<BR>     4. Maximum filter
-<BR>     5. Beam footprint with slope
-<BR>     6. Beam footprint
-<BR>
-
-Algorithms 5 and 6 can only be used to grid bathymetry data, and are
-not available for gridding amplitude or sidescan data.
-<P>
-If the default weighted average gridding scheme (<B>-F</B><I>1</I>) 
-is being used, each data point's contribution to a Gaussian weighted
-average for each nearby grid cell is calculated as the point is read
-and added to the grid cell sums.  The weighting function is given by:
-<BR> <TT>       </TT>W(r) = Aexp(-r**2/a**2)<BR>
-<BR>
-
-where r is the distance from the center of the grid point to the data point,
-a is the distance at which the weighting function falls to 1/e of its
-maximum value, and A is a normalizing factor set so that the sum of all
-the weights adds to a value of 1.  Normally, the distance a is set to be
-half the average grid point spacing, but this can be varied using the <B>-W</B>
-option.
-<P>
-If the <B>-F</B><I>2</I> option is used, the gridding is performed with a
-median filter scheme instead of a Gaussian weighted average. In this
-approach, all of the values for each bin are held in memory until
-all of the data has been read. Then, the median value for each bin
-is assigned as the gridded value for that bin.  The advantage of a
-median filter approach is that it is relatively insensitive to
-isolated artifacts in the data, provided that several samples
-exist for each bin.  The disadvantage to the median filter is
-that in the absence of artifacts, the weighted average scheme
-does a better job of representing the gridded field, particularly
-if the spectral characteristics of the gridded field are important.
-The median filter approach also requires much more memory than
-a weighted average. In general, edited bathymetry should be gridded
-using the Gaussian weighted average, while unedited bathymetry,
-beam amplitude, and sidescan data should be gridded using the
-median filter.
-<P>
-The minimum filter (<B>-F</B><I>3</I>) and maximum filter
-(<B>-F</B><I>4</I>) gridding schemes work like the median filter,
-except that the minimum or maximum bin values are reported
-instead of the median. These algorithms can be useful for
-producing grids which strongly reflect outliers in the
-data. Hydrographers often prefer to grid bathymetry using a minimum
-depth scheme because they are most interested in the
-shallowest (most dangerous) soundings in their data.
-<P>
-If the <B>-F</B><I>5</I> option is used, gridding of multibeam bathymetry
-is performed using beam footprints rather than a weighting function tied to
-the grid cell spacing. In this algorithm, the beam footprints are calculated
-using the angular beamwidths and the sonar altitude above the seafloor.
-A weighting value is calculated for each grid cell which fully or
-parially lies within the beam footprint; these weighting values
-represent the fraction of the beam contained within the cell. Each
-footprint is tilted according to the local slope; the slope is estimated
-from a low resolution, first pass grid created by simple mean filtering
-the soundings. The slope grid is generated using a cell size twice that
-of the final grid. This approach allows one to sensibly grid data using
-a resolution greater than that of the raw data. Thus, if one has data
-with a large depth variation, one can generate a grid with a cell spacing
-appropriate for the high resolution, shallow data and still get
-sensible results in deep regions where the grid cells may be
-much smaller than the beam footprints. Bathymetry data derived from
-sources other than multibeam data (e.g. xyz, lidar, photogrammetry)
-are treated as points rather than soundings with footprints; the
-full weight of each sounding is applied to the grid cell in which it
-is located.
-<P>
-The <B>-F</B><I>6</I> option results in beam footprint gridding of multibeam
-data without application of a local slope estimate.
-<P>
-Normally, all of the data which falls into the region of interest
-is used to construct the gridded data set. This means that the
-data from overlapping swaths will be "averaged" in the region of
-overlap. Averaging bathymetry data from overlapping swaths is
-usually fine, but averaging imagery data (beam amplitude or sidescan)
-derived from different swaths is usually undesirable. The <B>-U</B>
-option allows the user to force <B>mbgrid</B> to ignore data which
-overlies regions already covered by previous data (as defined by
-a time lag criterea). Alternatively, the user can force the program
-to use only the last data in a region, again as defined by a time
-lag. This option works best with the median filter scheme.
-<P>
-The gridding can be augmented by interpolation using a 2D thin plate
-spline algorithm with optional tension. The use of interpolation is
-set with the <B>-C</B><I>clip[/mode]</I> option, and is only used to fill
-in grid cells left undefined after all of the swath data have been
-processed. The <I>clip</I> value sets the distance from swath data to
-which the interpolation is applied (this distance is specified as
-an integer number of grid cells, so the physical distance is
-<I>clip</I> times the grid cell interval). If
-<I>mode</I> = 1 (the default), undefined cells will be filled with interpolation
-only if cells filled with swath data are found within
-<I>clip</I> cells in two opposite directions
-(e.g east and west, or northeast and southwest). This approach serves
-to fill in data gaps while avoiding adding an interpolated band around
-the edges of a survey. A caution: a large value of <I>clip</I>
-combined with <I>mode</I> = 1 will be VERY slow. If <I>mode</I> = 2, then
-undefined cells will be filled with the interpolation if they are within
-<I>clip</I> cells of swath data in any direction. This approach is faster,
-but can make a survey look larger and more complete than in reality.
-If <I>mode</I> = 3 or <I>clip</I> is
-set to a value greater than both dimensions of the output grid, then
-all grid cells not set by swath data will be filled by interpolation.
-The <B>-T</B><I>tension</I> option modulates the thin plate spline algorithm.
-Using the default <I>tension</I> = 0.0 corresponds to a minimum curvature,
-pure Laplacian solution. If <I>tension</I> is made large, the solution
-tends toward a thin plate spline and is effectively flattened.
-<P>
-The <B>-K</B><I>background</I> option is used to underlay a bathymetry or topography
-grid with a global or regional topography model. The background data
-model can be read from a GMT grid file or from a database accessed by the <B>GMT</B> program <B>grdraster</B>.
-In the former case <I>background</I> is just the file path for the
-background grid. In the latter case <I>background</I> is an
-identifier number used to specify which
-dataset to extract using <B>grdraster</B>. These identifiers are user
-defined and vary with <B>GMT</B> installations. When the <B>-K</B><I>background</I>
-option is invoked, <B>grd2xyz</B> or <B>grdraster</B> is used to extract all of the longitude,
-latitude, and topography values within the specified database that lie
-within the desired grid. These values are interpolated onto the desired
-grid locations using the thin plate spline algorithm, and then mapped onto
-the grid wherever the values are undefined by either swath data or the
-spline interpolation invoked with the <B>-C</B> option.
-<P>
-For magnetic inversions it is useful to have a bathymetry grid which
-tails off to a constant value at the border.  To facilitate this, the
-<B>-B</B> option allows the user to set the border of a smoothly
-interpolated grid to a constant value wherever no data are present.
-This is useful only if the data are confined to the central region
-of the grid and a smooth interpolation is done with a large <I>clip</I>
-so that the entire grid is filled.
-<P>
-The output grid will by default contain values of 99999.9 at cells
-containing no data; if the <B>-N</B> option is used then the flagging
-value used is NaN, or not-a-number.
-<P>
-The names of the output files are based on the root character string
-specified using the <B>-O</B> option. A number of grid formats are
-supported, including all of the grid formats supported by <B>GMT</B>.
-See the <B>-G</B> option below for a list of the available formats.
-If the grid is output in any of the <B>GMT</B> grid formats,
-then its filename is "root.grd", and a shellscript
-which will allow the contents of the grid to be viewed using <B>GMT</B> programs
-is also output with the filename "root.grd.cmd".  If the
-<B>-G</B><I>1</I> option is used to specify an ascii format grid, then the
-output grid filename will be "root.asc", but no plotting shellscript
-will be created.
-<P>
-A datalist file containing references to all of the swath files actually
-contibuting to the grid is also created. This file is named by adding
-a ".mb-1" suffix to the root string.
-<P>
-The <B>-M</B> option causes <B>mbgrid</B> to output two additional
-grids, the first ("root_num.grd") being the number of data
-points located within each bin, and the second ("root_sd.grd")
-being the standard deviation of the
-data points located within each bin.  Plotting shellscripts
-called "root_num.grd.cmd" and "root_sd.grd.cmd" are also output
-if the grids are in a <B>GMT</B> grid format. The <B>-M</B>
-option is ignored when the minimum or maximum filter gridding
-algorithms are used.
-<P>
-<A NAME="lbAF"> </A>
-<H2>AUTHORSHIP</H2>
-
-David W. Caress (<A HREF="mailto:caress at mbari.org">caress at mbari.org</A>)
-<BR>
-
-<BR>  Monterey Bay Aquarium Research Institute
-<BR>
-
-Dale N. Chayes (<A HREF="mailto:dale at ldeo.columbia.edu">dale at ldeo.columbia.edu</A>)
-<BR>
-
-<BR>  Lamont-Doherty Earth Observatory
-<P>
-<A NAME="lbAG"> </A>
-<H2>OPTIONS</H2>
-
-<DL COMPACT>
-<DT><B>-A</B>
-
-<DD>
-<I>datatype</I>
-<BR>
-
-Sets the type of data to be read and gridded. If <I>datatype</I> = 1,
-bathymetry data will be gridded (positive downwards). If <I>datatype</I> = 2,
-bathymetry data will be gridded as topography (positive upwards).
-If <I>datatype</I> = 3,
-amplitude data will be gridded.  If <I>datatype</I> = 4,
-sidescan data will be gridded. Default: <I>datatype</I> = 1 (bathymetry).
-<DT><B>-B</B>
-
-<DD>
-<I>border</I>
-<BR>
-
-Sets the border of a smoothly interpolated grid to the value <I>border</I>
-wherever no data exist, provided <I>border</I> > 0.0.
-Default: <I>border</I> = 0.0
-<DT><B>-C</B>
-
-<DD>
-<I>clip[/mode]</I>
-<BR>
-
-Controls the use of spline interpolation to fill grid cells not
-filled by swath data. The <I>clip</I> value sets the distance from
-swath data (in grid cells) that the spline interpolation may be
-applied. If <I>clip</I>=0 no spline interpolation will be done.
-If <I>mode</I>=1 (the default), then the interpolation will fill
-data gaps up to two times <I>clip</I> grid cells in size. If <I>mode</I>=2
-then the spline interpolation will fill all undefined cells within
-a distance of <I>clip</I> cells from data. If <I>mode</I> = 3 or <I>clip</I> is
-set to a value greater than both dimensions of the output grid, then
-all grid cells not set by swath data will be filled by interpolation.
-Default: <I>clip</I> = 0 and <I>mode</I> = 1.
-<DT><B>-D</B>
-
-<DD>
-<I>xdim/ydim</I>
-<BR>
-
-Sets the dimensions of the output grid.  This option is superceded
-if the user specifies the grid spacing with the <B>-E</B> option.
-Default:  <I>xdim</I> = <I>ydim</I> = 101.
-<DT><B>-E</B>
-
-<DD>
-<I>dx/dy/units[!]</I>
-<BR>
-
-Sets the grid cell spacing to <I>dx</I> in longitude and <I>dy</I>
-in latitude. If <I>units</I> is not specified, the <I>dx</I>
-and <I>dy</I> values are assumed to be in meters. Valid values
-for <I>units</I> include "km", "meters", and "degrees".
-If not in degrees, the grid cell spacing values are converted to
-degrees using the central latitude of the grid. If
-<I>dy</I> = 0.0, then the latitude cell spacing will be set
-equal to the longitude cell spacing (after conversion to
-degrees, if necessary).
-By default, the grid spacing is calculated from
-the grid bounds and the grid dimensions. When the user
-uses the <B>-E</B> option to set the cell spacings, the
-grid dimensions are calculated using the grid bounds and
-grid cell spacings. However, slight adjustments to the
-grid cell spacings are usually required to keep
-the grid bounds as specified. Appending an ! to the end of
-the <B>-E</B> arguments forces <B>mbgrid</B> to use the
-exact grid cell spacing values specified by adjusting the
-grid bounds.
-Default: If neither the <B>-E</B> or <B>-DP options are specified,
-the program sets the grid cell spacing to be 0.02 times the maximum
-sonar altitude in the input files.
-<DT>-F</B>
-
-<DD>
-<I>mode</I>
-<BR>
-
-Sets the gridding algorithm to be used.
-<BR> <TT>       </TT><I>mode</I> = 1:         Gaussian Weighted Mean<BR>
-<BR> <TT>       </TT><I>mode</I> = 2:         Median Filter<BR>
-<BR> <TT>       </TT><I>mode</I> = 3:         Minimum Filter<BR>
-<BR> <TT>       </TT><I>mode</I> = 4:         Maximum Filter<BR>
-<BR> <TT>       </TT><I>mode</I> = 5:         Weighted Sonar Footprint with slope<BR>
-<BR> <TT>       </TT><I>mode</I> = 6:         Weighted Sonar Footprint<BR>
-The default is <I>mode</I> = 1 (Gaussian Weighted Mean).
-<DT><B>-G</B>
-
-<DD>
-<I>gridkind</I>
-<BR>
-
-This option sets the format of the output grid file.
-The default is to output a GMT netCDF 4-byte float grid.
-The user may specify the grid format either by using an
-identifier number, or by using the <B>GMT</B> grid format
-syntax, which allows for scaling and offsets of the data.
-<P>
-First, the simple grid format identifiers are:
-<BR> <TT>       </TT><I>gridkind</I> = 1:<TT>   </TT>ASCII table<BR>
-<BR> <TT>       </TT><I>gridkind</I> = 2:<TT>   </TT>binary file (<B>GMT</B> version 1 GRD file)<BR>
-<BR> <TT>       </TT><I>gridkind</I> = 3:<TT>   </TT>netCDF file (<B>GMT</B> version 2 GRD file)<BR>
-<BR> <TT>       </TT><I>gridkind</I> = 4:<TT>   </TT>Arc/Info and ArcView ASCII grid<BR>
-<BR> <TT>       </TT><I>gridkind</I> = 100:<TT> </TT>GMT netCDF 4-byte float format [Default]<BR>
-<BR> <TT>       </TT><I>gridkind</I> = 101:<TT> </TT>Native binary single precision floats in scanlines with leading grd header<BR>
-<BR> <TT>       </TT><I>gridkind</I> = 102:<TT> </TT>Native binary short integers in scanlines with leading grd header<BR>
-<BR> <TT>       </TT><I>gridkind</I> = 103:<TT> </TT>8-bit standard Sun rasterfile (colormap ignored)<BR>
-<BR> <TT>       </TT><I>gridkind</I> = 104:<TT> </TT>Native binary unsigned char in scanlines with leading grd header<BR>
-<BR> <TT>       </TT><I>gridkind</I> = 105:<TT> </TT>Native binary bits in scanlines with leading grd header<BR>
-<BR> <TT>       </TT><I>gridkind</I> = 106:<TT> </TT>Native binary ``surfer'' grid files<BR>
-<BR> <TT>       </TT><I>gridkind</I> = 107:<TT> </TT>netCDF 1-byte byte format<BR>
-<BR> <TT>       </TT><I>gridkind</I> = 108:<TT> </TT>netCDF 1-byte char format<BR>
-<BR> <TT>       </TT><I>gridkind</I> = 109:<TT> </TT>netCDF 2-byte int format<BR>
-<BR> <TT>       </TT><I>gridkind</I> = 110:<TT> </TT>netCDF 4-byte int format<BR>
-<BR> <TT>       </TT><I>gridkind</I> = 111:<TT> </TT>netCDF 8-byte double format<BR>
-<BR>
-
-<P>
-Second, a <B>GMT</B> grid format string has the form:
-<BR>
-
-<BR> <TT>       </TT>=id[/scale/offset[/nan]]<BR>
-<BR>
-
-where id is the <B>GMT</B> format id, and the other values
-are optional. If <I>scale</I> and <I>offset</I> are given, the
-data will be multiplied by <I>scale</I> and offset by <I>offset</I>
-prior to being output. The <I>nan</I> value sets the value used for
-"not-a-number". The <B>GMT</B> format id's for these format strings are:
-<BR> <TT>       </TT><I>id</I> = 0:<TT> </TT>GMT netCDF 4-byte float format [Default]<BR>
-<BR> <TT>       </TT><I>id</I> = 1:<TT> </TT>Native binary single precision floats in scanlines with leading grd header<BR>
-<BR> <TT>       </TT><I>id</I> = 2:<TT> </TT>Native binary short integers in scanlines with leading grd header<BR>
-<BR> <TT>       </TT><I>id</I> = 3:<TT> </TT>8-bit standard Sun rasterfile (colormap ignored)<BR>
-<BR> <TT>       </TT><I>id</I> = 4:<TT> </TT>Native binary unsigned char in scanlines with leading grd header<BR>
-<BR> <TT>       </TT><I>id</I> = 5:<TT> </TT>Native binary bits in scanlines with leading grd header<BR>
-<BR> <TT>       </TT><I>id</I> = 6:<TT> </TT>Native binary ``surfer'' grid files<BR>
-<BR> <TT>       </TT><I>id</I> = 7:<TT> </TT>netCDF 1-byte byte format<BR>
-<BR> <TT>       </TT><I>id</I> = 8:<TT> </TT>netCDF 1-byte char format<BR>
-<BR> <TT>       </TT><I>id</I> = 9:<TT> </TT>netCDF 2-byte int format<BR>
-<BR> <TT>       </TT><I>id</I> = 10:<TT>        </TT>netCDF 4-byte int format<BR>
-<BR> <TT>       </TT><I>id</I> = 11:<TT>        </TT>netCDF 8-byte double format<BR>
-<BR>
-
-Note that the following arguments are equivalent because they
-all produce a standard <B>GMT</B> netCDF 4-byte float grid:
-<BR> <TT>       </TT><B>-G</B><I>3</I><BR>
-<BR> <TT>       </TT><B>-G</B><I>100</I><BR>
-<BR> <TT>       </TT><B>-G</B><I>=0</I><BR>
-<BR>
-
-Should the user wish to produce a grid in native binary floats,
-then the following two arguments will work:
-<BR> <TT>       </TT><B>-G</B><I>101</I><BR>
-<BR> <TT>       </TT><B>-G</B><I>=1</I><BR>
-<BR>
-
-Should the user wish to produce a grid in native short int format
-with a scaling factor of 10, an offset of 32000, and a NaN value
-of 32767, then the following arguments will suffice:
-<BR>
-
-<BR> <TT>       </TT><B>-G</B><I>=2/10/32000/32767</I><BR>
-<P>
-If <I>gridkind</I> = 3 or <I>gridkind</I> >= 100,
-<B>mbgrid</B> also outputs shellscripts
-which run <B>GMT</B> programs to provide preliminary color
-fill maps of the gridded data. These shellscripts are
-generated using the <B>mbm_grdplot</B> macro.
-<P>
-If <I>gridkind</I> = 4, the output grids will be in the Arc/Info ASCII
-grid format.  Arc/Info ASCII grids use "square" bins,
-meaning that the longitude and latitude grid cell spacings must
-be identical. Thus, whenever the <I>gridkind</I> = 4 option is
-used, the <B>-E</B> option must also be used in a way which
-ensures equal grid cell spacings (see the <B>-E</B> documentation
-above).
-Default: <I>gridkind</I> = 100.
-<DT><B>-H</B>
-
-<DD>
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-<DT><B>-I</B>
-
-<DD>
-<I>datalist</I>
-<BR>
-
-Sets the filename of the file containing a list of the input swath sonar
-data files and their formats.  In the <I>datalist</I> file, each
-data file should be followed by a data format identifier, e.g.:
-<BR> <TT>       </TT>datafile1 11<BR>
-<BR> <TT>       </TT>datafile2 24<BR>
-<BR>
-
-This program uses the <B>MBIO</B> library and will read any swath sonar
-format supported by <B>MBIO</B>. A list of the swath sonar data formats
-currently supported by <B>MBIO</B> and their identifier values
-is given in the <B>MBIO</B> manual page.  A format identifier of 0 indicates
-that the file contains lines of (lon, lat, depth) triples which can be read
-in free format.
-<BR>
-
-An input datafile may be accompanied by a "fast bathymetry" or "fbt" file.
-An "fbt" file contains only swath bathymetry information in a compact format (format 71),
-and is thus quick to read. The "fbt" fine naming convention is to add the
-".fbt" suffix to the original swath
-data filename. In the
-event that a bathymetry or topography grid is being generated, <B>mbgrid</B>
-will attempt to read an "fbt" file in lieu of the original data.
-Default: <I>datalist</I> = datalist.mb-1
-<DT><B>-J</B>
-
-<DD>
-<I>projection</I>
-By default, <B>mbgrid</B> generates grids in Geographic coordinates,
-meaning that position is defined in longitude and latitude using
-the WGS84 geographic coordinate system.
-The <B>-J</B> option can be used to specify
-an alternate, projected coordinate system (PCS). When a PCS is used,
-position will be defined in eastings and northings (meters) relative
-to the origin of the particular PCS. Universal Transverse Mercator
-is the most commonly used PCS in the oceanographic community, but
-<B>mbgrid</B> supports a large number of other PCS's as well.
-The underlying projection functions derive from the <B>PROJ.4</B> library
-written by Gerald Evenden, then of the U.S. Geological Survey.
-<P>
-The <I>projection</I> argument for the <B>-J</B> option can be either
-a PCS identifier from the projection definition list provided at the
-end of this manual page, or simply <B>-J</B><I>U</I> to specify using
-UTM in whatever zone is appropriate for the grid bounds specified
-with the <B>-R</B> option.
-<P>
-For instance, to fully specify a particular northern UTM
-zone, set <I>projection</I> = UTMXXN where XX gives
-the UTM zone (defined from 01 to 60). As an example, a northern UTM
-zone 12 projection can be specified using <B>-J</B><I>UTM12N</I>.
-Southern UTM zones are specified as UTMXXS. The European Petroleum
-Survey Group (EPSG) has defined a large number of PCS's used worldwide
-and assigned number id's to each; one can also specify the northern
-UTM zone 12 projection using its EPSG designation,
-or <B>-J</B><I>epsg32612</I>.
-When the projected coordinate system is fully specified
-by the <B>-J</B> option, then the grid bounds may be specified using
-<B>-R</B> in either longitude and latitude or in eastings and northings.
-<P>
-Alternatively, one may indicate a UTM projection without specifying the
-zone by using <B>-J</B><I>U</I>. In this case, the
-UTM zone will be inferred from the midpoint of the
-specified longitude and latitude bounds, and then the
-longitude and latitude bounds given with the
-<B>-fR</B> option are translated to UTM eastings and northings.
-<P>
-All grids and mosaics produced by <B>MB-System</B>
-programs contain identifiers that are recognized
-by the plotting macros <B>mbm_grdplot</B>,
-<B>mbm_grd3dplot</B>, and <B>mbm_grdtiff</B>.
-These plotting macros automatically use a
-linear map projection whenever they
-encounter grids and mosaics that are already
-in a projected coordinate system. Also, the program <B>mbgrdtiff</B>
-automatically inserts the appropriate projection information into
-the GeoTIFF images it generates. As a result, images generated by
-<B>mbgrdtiff</B> will be properly georeferenced when they are imported
-into GIS software.
-<P>
-<DT><B>-K</B>
-
-<DD>
-<I>background</I>
-<BR>
-
-Enables filling in all undefined grid cells with bathymetry or topography
-from a global or regional database. If raster data have been locally made
-available through the <B>GMT</B> program <B>grdraster</B>, these can be
-accessed by specifying <I>background</I> as the <B>grdraster</B> dataset id number
-(e.g. <B>-K</B><I>4</I> - note that <B>grdraster</B>
-datasets are numbered starting at 1).
-Users can also use data in GMT grids as a background (including grids
-generated by <B>mbgrid</B>) by specifying <I>background</I> as the file path
-to the desired grid (e.g. <B>-K</B><I>/usr/local/share/globaltopo.grd</I>).
-<P>
-<DT><B>-L</B>
-
-<DD>
-<I>lonflip</I>
-<BR>
-
-Sets the range of the longitude values returned.
-If <I>lonflip</I>=-1 then the longitude values will be in
-the range from -360 to 0 degrees. If <I>lonflip</I>=0
-then the longitude values will be in
-the range from -180 to 180 degrees. If <I>lonflip</I>=1
-then the longitude values will be in
-the range from 0 to 360 degrees.
-Default: <I>lonflip</I> = 0.
-<DT><B>-M</B>
-
-<DD>
-Causes two additional grids to be output. One is a grid containing
-the standard deviation of the data within each grid cell relative
-to the grid value, the other contains the number of data
-points in each grid cell. This option is ignored when the minimum
-or maximum filter gridding algorithms are used (see the -F option).
-<DT><B>-N</B>
-
-<DD>
-Causes grid cells with no data and no interpolation to be set to a
-value of NaN instead of the default value of 99999.9.  The NaN value
-is expected by <B>GMT</B> programs such <B>grdview</B>.
-<DT><B>-O</B>
-
-<DD>
-<I>root</I>
-<BR>
-
-Sets the character string to be used as the root of the
-output filenames. For example, if the grid is output as a <B>GMT</B>
-version 2 GRD format (netCDF) file (the default),
-then its filename is "root.grd". If the
-<B>-G</B><I>1</I> option is used to specify an ascii format grid, then the
-output grid filename will be "root.asc". If the
-<B>-G</B><I>2</I> option is used to specify a version 1 GRD
-format (binary) grid, then the
-output grid filename will be "root.grd1". If the output grid is
-in the <B>GMT</B> version 2 GRD format, a shellscript
-which will allow the contents of the grid to viewed using <B>GMT</B> programs
-is also output with the filename "root.grd.cmd".
-<DT><B>-P</B>
-
-<DD>
-<I>pings</I>
-Sets the ping averaging of the input data. If <I>pings</I> > 0, then
-that number of input pings will be averaged to produce one output
-ping.  If <I>pings</I> = 0, then the ping averaging will automatically
-be done so that the along-track ping spacing is equal to the across-track
-beam spacing. Default: <I>pings</I> = 1.
-<DT><B>-Q</B>
-
-<DD>
-Normally, bathymetry or topography data is gridded in meters. If
-this option is used, bathymetry or topography data is gridded
-in feet.
-<DT><B>-R</B>
-
-<DD>
-<I>west/east/south/north</I>
-<BR>
-
-<I>factor</I>
-<BR>
-
-The first form sets the longitude and latitude bounds of the output grid.
-By default (if the <B>-R</B><I>west/east/south/north</I>
-option is not specified) the program will set
-the grid bounds to be the area encompassing all of the data in the
-input files. The second form (<B>-R</B><I>factor</I>) expands the automatically
-calculated bounds by the multiplicative <I>factor</I>.The value
-<I>factor</I> must be greater than one; if <I>factor</I> = 1.1 then the
-grid bounds will be expanded to the east and west by an amount 0.05 times
-the data bounds east-west extend and to the north and south by an amount
-0.05 times the data bounds north-south extent.
-If the user uses the <B>-E</B> option to set the grid spacing, then the dimensions
-will be calculated from the grid bounds and spacing. In these
-circumstances rounding errors will usually require that the eastern
-and northern bounds be adjusted to fit exactly with the
-grid dimensions and spacing.
-Default: If the <B>-R</B><I>west/east/south/north</I>
-option is not specified, the program will set
-the grid bounds to be the area encompassing all of the data in the
-input files.
-<DT><B>-S</B>
-
-<DD>
-<I>speed</I>
-<BR>
-
-Sets the minimum speed in km/hr (5.5 kts ~ 10 km/hr) allowed in
-the input data; pings associated with a smaller ship speed will not be
-output. Default: <I>speed</I> = 0.
-<DT><B>-T</B>
-
-<DD>
-<I>tension</I>
-<BR>
-
-Sets the <I>tension</I> value used in the thin plate spline interpolation.
-<P>
-A <I>tension</I> of 0 gives a minimum curvature surface with free edges;
-this is a pure Laplacian solution. A nonzero <I>tension</I> tends to
-suppress spurious oscillations and flatten
-the interpolation toward the edges; a <I>tension</I> of infinity
-yields a pure thin plate spline solution. The <I>tension</I> must be zero or
-greater.
-Default: <I>tension</I> = 0.0 (minimum curvature solution).
-<DT><B>-U</B>
-
-<DD>
-<I>time</I>
-<BR>
-
-Forces <B>mbgrid</B> to avoid averaging overlapping swaths by
-ignoring the data from later swaths. "Later" data is identified
-using the <I>time</I> value. The time of the first data point
-is saved for each bin in the grid; any other data points which
-are more than <I>time</I> minutes before or after the initial
-data point in the relevent bin are ignored. If <I>time</I> is
-negative, the last data in a bin (within the time lag criterea)
-will be saved and used instead of the first data.
-<DT><B>-V-</B>
-
-<DD>
-Normally, <B>mbgrid</B> prints out information regarding its
-controlling parameters during execution; the
-<B>-V</B> option causes the program to also print out statements
-indicating its progress.
-<DT><B>-W</B>
-
-<DD>
-<I>scale</I>
-<BR>
-
-Sets the width of the gaussian weighting function in terms of
-the grid spacing.  The distance to the 1/e point of the weighting
-function is given by half of the grid spacing times <I>scale</I>.
-Default: <I>scale</I> = 1.0
-<DT><B>-X</B>
-
-<DD>
-<I>extend</I>
-<BR>
-
-Extends the size of the internal grid so that the output grid is a
-subset from the center of a larger grid.   This allows data outside
-the output grid to guide the spline interpolation of data gaps which
-happen to lie at the the edge of the output grid.  The amount of
-extension is <I>extend</I> times the grid width/height to each side.
-Thus, if <I>extend</I>=1.0, then the internal grid will have dimensions
-three times the output grid.
-Default: <I>extend</I> = 0.0
-</DL>
-<A NAME="lbAH"> </A>
-<H2>EXAMPLES</H2>
-
-Suppose you want to grid some Hydrosweep data in six data files over
-a region with longitude bounds of 139.9W to 139.65W and latitude bounds
-of 9.7S to 9.45S.  To get a 110 m grid spacing, you need a grid dimensions
-of 251 (x or longitude) and 251 (y or latitude). First,
-create a datalist file using a text editor which contains the
-data filenames followed by the appropriate format identifier:
-<P>
-<BR> <TT>       </TT>d123e.mb24 24<BR>
-<BR> <TT>       </TT>d126e.mb24 24<BR>
-<BR> <TT>       </TT>d128e.mb24 24<BR>
-<BR> <TT>       </TT>d129e.mb24 24<BR>
-<BR> <TT>       </TT>d130e.mb24 24<BR>
-<BR> <TT>       </TT>d131e.mb24 24<BR>
-<P>
-Then, run <B>mbgrid</B> as follows:
-<BR> <TT>       </TT>mbgrid -R220.1/220.35/-9.7/-9.45 -D251/251 \<BR>
-<BR> <TT>       </TT><TT>        </TT>-L1 -C251  -N \<BR>
-<BR> <TT>       </TT><TT>        </TT>-Idatalist -Ourville_int -V<BR>
-<P>
-By specifying a clipping dimension of 251 we insure that the grid
-will be filled in through spine interpolation even in the areas
-not covered by data. The output looks like:
-<P>
-<BR> Program MBGRID
-<BR> Version $Id: mbgrid.1 2215 2014-11-29 22:21:19Z caress $
-<BR> MB-system Version 4.5
-<P>
-<BR> MBGRID Parameters:
-<BR> List of input files: datalist
-<BR> Output fileroot:     urville_int
-<BR> Input Data Type:     Bathymetry
-<BR> Gridding algorithm:  Gaussian Weighted Mean
-<BR> Grid dimensions: 251 251
-<BR> Grid bounds:
-<BR>   Longitude:  220.1000  220.3500
-<BR>   Latitude:    -9.7000   -9.4500
-<BR> Working grid dimensions: 251 251
-<BR> Working Grid bounds:
-<BR>   Longitude:  220.1000  220.3500
-<BR>   Latitude:    -9.7000   -9.4500
-<BR> Input data bounds:
-<BR>   Longitude:  219.8500  220.6000
-<BR>   Latitude:    -9.9500   -9.2000
-<BR> Longitude interval: 0.001000 degrees or 109.778801 m
-<BR> Latitude interval:  0.001000 degrees or 110.605002 m
-<BR> Gaussian filter 1/e length: 0.055096 km
-<BR> Spline interpolation applied with clipping dimension: 251
-<BR> Spline tension (range 0.0 to 1.0): 10000000000.000000
-<BR> Grid format 3:  GMT version 2 grd (netCDF)
-<BR> NaN values used to flag regions with no data
-<BR> MBIO parameters:
-<BR>   Ping averaging:       1
-<BR>   Longitude flipping:   1
-<BR>   Speed minimum:       0.0 km/hr
-<P>
-<BR> 29075 data points processed in d123e.mb8
-<BR> 0 data points processed in d125e.mb8
-<BR> 98175 data points processed in d126e.mb8
-<BR> 68637 data points processed in d128e.mb8
-<BR> 20703 data points processed in d129e.mb8
-<BR> 80372 data points processed in d130e.mb8
-<BR> 55620 data points processed in d131e.mb8
-<P>
-<BR> 352582 total data points processed
-<P>
-<BR> Making raw grid...
-<P>
-<BR> Doing spline interpolation with 53513 data points...
-<P>
-<BR> Total number of bins:            63001
-<BR> Bins set using data:             53513
-<BR> Bins set using interpolation:    9488
-<BR> Bins not set:                    0
-<BR> Maximum number of data in a bin: 65
-<BR> Minimum value:     504.93   Maximum value:    3405.75
-<BR> Minimum sigma:    0.14060   Maximum sigma:  275.53399
-<P>
-<BR> Outputting results...
-<P>
-<BR> executing mbm_grdplot...
-<BR> mbm_grdplot -Iurville_int.grd -G1 -C -D -V -L"File urville_int.grd - Bathymetry Grid:Depth (m)"
-<P>
-<BR> Program Status:
-<BR> --------------
-<P>
-<BR>   Plot Style:
-<BR>     Color Fill
-<BR>     Contours
-<BR>     Horizontal Color Scale
-<P>
-<BR>   Input Files:
-<BR>     Data GRD File:            urville_int.grd
-<BR>     Intensity GRD List File:
-<P>
-<BR>   Output Files:
-<BR>     Output plot name root:    urville_int.grd
-<BR>     Color palette table:      urville_int.grd.cpt
-<BR>     Plotting shellscript:     urville_int.grd.cmd
-<BR>     Plot file:                urville_int.grd.ps
-<P>
-<BR>   Plot Attributes:
-<BR>     Plot width:               6.5000
-<BR>     Plot height:              6.5489
-<BR>     Page size:                a
-<BR>     Page width:               8.5
-<BR>     Page height:              11
-<BR>     Projection:           -Jm26
-<BR>     Axes annotation:          5m/5m:."File urville_int.grd - Bathymetry Grid":
-<BR>     Orientation:              portrait
-<BR>     Number of colors:         11
-<BR>     Color Palette:            Haxby Colors
-<BR>     Colors reversed
-<P>
-<BR>   Grid Data Attributes:
-<BR>     Longitude min max:         220.1000   220.3500
-<BR>     Latitude min max:       -9.7000    -9.4500
-<BR>     Data min max:                 504.9       3406
-<P>
-<BR>   Primary Grid Plotting Controls:
-<BR>     Contour control:          100
-<BR>     Color start datum:        350.000000
-<BR>     Color end datum:          3850.000000
-<BR>     Color datum interval:     350.000000
-<P>
-<BR>   GMT Default Values Reset in Script:
-<BR>     PAPER_WIDTH               8.5
-<BR>     ANOT_FONT                 Helvetica
-<BR>     LABEL_FONT                Helvetica
-<BR>     HEADER_FONT               Helvetica
-<BR>     ANOT_FONT_SIZE            8
-<BR>     LABEL_FONT_SIZE           8
-<BR>     HEADER_FONT_SIZE          10
-<BR>     FRAME_WIDTH               0.074999999999999997
-<BR>     TICK_LENGTH               0.074999999999999997
-<BR>     PAGE_ORIENTATION          LANDSCAPE
-<BR>     COLOR_BACKGROUND          0/0/0
-<BR>     COLOR_FOREGROUND          255/255/255
-<BR>     COLOR_NAN                 255/255/255
-<P>
-<BR> --------------
-<P>
-<BR> Plot generation shellscript <urville_int.grd.cmd> created.
-<P>
-<BR> Instructions:
-<BR>   Execute <urville_int.grd.cmd> to generate Postscript plot <urville_int.grd.ps>.
-<BR>   Executing <urville_int.grd.cmd> also invokes xpsview to view the plot on the screen.
-<P>
-<BR> --------------
-<P>
-<P>
-<BR> Done.
-<P>
-The names of the output files are based on the root character string
-specified using the <B>-O</B> option.  Since the grid is output as a netCDF
-GRD format file, its filename is "urville_int.grd"; a shellscript
-which will allow the contents of the grid to viewed using <B>GMT</B> programs
-is also output with the filename "urville_int.grd.cmd".
-<P>
-Suppose that one wants to grid the same data considered above using
-the median filtering scheme instead of the default Gaussian weighted
-mean scheme and also outputting grids of the data density and
-standard deviation values. The following will suffice:
-<BR> <TT>       </TT>mbgrid -R220.1/220.35/-9.7/-9.45 -D251/251 \<BR>
-<BR> <TT>       </TT><TT>        </TT>-L1 -C251 -N \<BR>
-<BR> <TT>       </TT><TT>        </TT>-Idatalist -Ourville_int -F2 -M -V<BR>
-<P>
-<A NAME="lbAI"> </A>
-<H2>SEE ALSO</H2>
-
-<B><A HREF="mbsystem.html">mbsystem</A></B>(1), <B><A HREF="mbmosaic.html">mbmosaic</A></B>(1), <B><A HREF="mbm_grid.html">mbm_grid</A></B>(1), <B><A HREF="mbm_grd2arc.html">mbm_grd2arc</A></B>(1)
-<P>
-<A NAME="lbAJ"> </A>
-<H2>BUGS</H2>
-
-The options for this program have grown a bit complicated.
-If you have other problems, please let us know.
-<P>
-<A NAME="lbAK"> </A>
-<H2>APPENDIX 1: PROJECTED COORDINATE SYSTEM IDENTIFIERS</H2>
-
-The following is a list of the projected coordinate systems (PCS's)
-that are supported by MB-System. The full PCS definitions are
-found in the file mbsystem/share/Projections.dat. These definitions
-are in the <B>PROJ.4</B> format and derive from the <B>PROJ.4</B>
-4.6.1 distribution obtained from <A HREF="http://trac.osgeo.org/proj/">http://trac.osgeo.org/proj/</A>
-in September 2008. The proj library source code has been
-incorporated unchanged into the MB-System package.
-<P>
-The first item on each line is the PCS identifier inside brackets, such
-as <UTM10N> or <epsg32749>. To specify using one of these PCS's, use
-the <B>-J</B> option, e.g. <B>-J</B><I>UTM10N</I> or <B>-J</B><I>epsg32749</I>.
-<P>
-<BR> ---------------------------------------------------------
-<BR> Standard Universal Transverse Mercator (UTM)
-<BR>     and Universal Polar Stereographic (UPS)
-<BR>     projected coordinate systems for MB-System
-<BR> ---------------------------------------------------------
-<P>
-<BR> <UTM01N> : WGS 84 / UTM zone 1N
-<BR> <UTM02N> : WGS 84 / UTM zone 2N
-<BR> <UTM03N> : WGS 84 / UTM zone 3N
-<BR> <UTM04N> : WGS 84 / UTM zone 4N
-<BR> <UTM05N> : WGS 84 / UTM zone 5N
-<BR> <UTM06N> : WGS 84 / UTM zone 6N
-<BR> <UTM07N> : WGS 84 / UTM zone 7N
-<BR> <UTM08N> : WGS 84 / UTM zone 8N
-<BR> <UTM09N> : WGS 84 / UTM zone 9N
-<BR> <UTM10N> : WGS 84 / UTM zone 10N
-<BR> <UTM11N> : WGS 84 / UTM zone 11N
-<BR> <UTM12N> : WGS 84 / UTM zone 12N
-<BR> <UTM13N> : WGS 84 / UTM zone 13N
-<BR> <UTM14N> : WGS 84 / UTM zone 14N
-<BR> <UTM15N> : WGS 84 / UTM zone 15N
-<BR> <UTM16N> : WGS 84 / UTM zone 16N
-<BR> <UTM17N> : WGS 84 / UTM zone 17N
-<BR> <UTM18N> : WGS 84 / UTM zone 18N
-<BR> <UTM19N> : WGS 84 / UTM zone 19N
-<BR> <UTM20N> : WGS 84 / UTM zone 20N
-<BR> <UTM21N> : WGS 84 / UTM zone 21N
-<BR> <UTM22N> : WGS 84 / UTM zone 22N
-<BR> <UTM23N> : WGS 84 / UTM zone 23N
-<BR> <UTM24N> : WGS 84 / UTM zone 24N
-<BR> <UTM25N> : WGS 84 / UTM zone 25N
-<BR> <UTM26N> : WGS 84 / UTM zone 26N
-<BR> <UTM27N> : WGS 84 / UTM zone 27N
-<BR> <UTM28N> : WGS 84 / UTM zone 28N
-<BR> <UTM29N> : WGS 84 / UTM zone 29N
-<BR> <UTM30N> : WGS 84 / UTM zone 30N
-<BR> <UTM31N> : WGS 84 / UTM zone 31N
-<BR> <UTM32N> : WGS 84 / UTM zone 32N
-<BR> <UTM33N> : WGS 84 / UTM zone 33N
-<BR> <UTM34N> : WGS 84 / UTM zone 34N
-<BR> <UTM35N> : WGS 84 / UTM zone 35N
-<BR> <UTM36N> : WGS 84 / UTM zone 36N
-<BR> <UTM37N> : WGS 84 / UTM zone 37N
-<BR> <UTM38N> : WGS 84 / UTM zone 38N
-<BR> <UTM39N> : WGS 84 / UTM zone 39N
-<BR> <UTM40N> : WGS 84 / UTM zone 40N
-<BR> <UTM41N> : WGS 84 / UTM zone 41N
-<BR> <UTM42N> : WGS 84 / UTM zone 42N
-<BR> <UTM43N> : WGS 84 / UTM zone 43N
-<BR> <UTM44N> : WGS 84 / UTM zone 44N
-<BR> <UTM45N> : WGS 84 / UTM zone 45N
-<BR> <UTM46N> : WGS 84 / UTM zone 46N
-<BR> <UTM47N> : WGS 84 / UTM zone 47N
-<BR> <UTM48N> : WGS 84 / UTM zone 48N
-<BR> <UTM49N> : WGS 84 / UTM zone 49N
-<BR> <UTM50N> : WGS 84 / UTM zone 50N
-<BR> <UTM51N> : WGS 84 / UTM zone 51N
-<BR> <UTM52N> : WGS 84 / UTM zone 52N
-<BR> <UTM53N> : WGS 84 / UTM zone 53N
-<BR> <UTM54N> : WGS 84 / UTM zone 54N
-<BR> <UTM55N> : WGS 84 / UTM zone 55N
-<BR> <UTM56N> : WGS 84 / UTM zone 56N
-<BR> <UTM57N> : WGS 84 / UTM zone 57N
-<BR> <UTM58N> : WGS 84 / UTM zone 58N
-<BR> <UTM59N> : WGS 84 / UTM zone 59N
-<BR> <UTM60N> : WGS 84 / UTM zone 60N
-<BR> <UTM01S> : WGS 84 / UTM zone 1S
-<BR> <UTM02S> : WGS 84 / UTM zone 2S
-<BR> <UTM03S> : WGS 84 / UTM zone 3S
-<BR> <UTM04S> : WGS 84 / UTM zone 4S
-<BR> <UTM05S> : WGS 84 / UTM zone 5S
-<BR> <UTM06S> : WGS 84 / UTM zone 6S
-<BR> <UTM07S> : WGS 84 / UTM zone 7S
-<BR> <UTM08S> : WGS 84 / UTM zone 8S
-<BR> <UTM09S> : WGS 84 / UTM zone 9S
-<BR> <UTM10S> : WGS 84 / UTM zone 10S
-<BR> <UTM11S> : WGS 84 / UTM zone 11S
-<BR> <UTM12S> : WGS 84 / UTM zone 12S
-<BR> <UTM13S> : WGS 84 / UTM zone 13S
-<BR> <UTM14S> : WGS 84 / UTM zone 14S
-<BR> <UTM15S> : WGS 84 / UTM zone 15S
-<BR> <UTM16S> : WGS 84 / UTM zone 16S
-<BR> <UTM17S> : WGS 84 / UTM zone 17S
-<BR> <UTM18S> : WGS 84 / UTM zone 18S
-<BR> <UTM19S> : WGS 84 / UTM zone 19S
-<BR> <UTM20S> : WGS 84 / UTM zone 20S
-<BR> <UTM21S> : WGS 84 / UTM zone 21S
-<BR> <UTM22S> : WGS 84 / UTM zone 22S
-<BR> <UTM23S> : WGS 84 / UTM zone 23S
-<BR> <UTM24S> : WGS 84 / UTM zone 24S
-<BR> <UTM25S> : WGS 84 / UTM zone 25S
-<BR> <UTM26S> : WGS 84 / UTM zone 26S
-<BR> <UTM27S> : WGS 84 / UTM zone 27S
-<BR> <UTM28S> : WGS 84 / UTM zone 28S
-<BR> <UTM29S> : WGS 84 / UTM zone 29S
-<BR> <UTM30S> : WGS 84 / UTM zone 30S
-<BR> <UTM31S> : WGS 84 / UTM zone 31S
-<BR> <UTM32S> : WGS 84 / UTM zone 32S
-<BR> <UTM33S> : WGS 84 / UTM zone 33S
-<BR> <UTM34S> : WGS 84 / UTM zone 34S
-<BR> <UTM35S> : WGS 84 / UTM zone 35S
-<BR> <UTM36S> : WGS 84 / UTM zone 36S
-<BR> <UTM37S> : WGS 84 / UTM zone 37S
-<BR> <UTM38S> : WGS 84 / UTM zone 38S
-<BR> <UTM39S> : WGS 84 / UTM zone 39S
-<BR> <UTM40S> : WGS 84 / UTM zone 40S
-<BR> <UTM41S> : WGS 84 / UTM zone 41S
-<BR> <UTM42S> : WGS 84 / UTM zone 42S
-<BR> <UTM43S> : WGS 84 / UTM zone 43S
-<BR> <UTM44S> : WGS 84 / UTM zone 44S
-<BR> <UTM45S> : WGS 84 / UTM zone 45S
-<BR> <UTM46S> : WGS 84 / UTM zone 46S
-<BR> <UTM47S> : WGS 84 / UTM zone 47S
-<BR> <UTM48S> : WGS 84 / UTM zone 48S
-<BR> <UTM49S> : WGS 84 / UTM zone 49S
-<BR> <UTM50S> : WGS 84 / UTM zone 50S
-<BR> <UTM51S> : WGS 84 / UTM zone 51S
-<BR> <UTM52S> : WGS 84 / UTM zone 52S
-<BR> <UTM53S> : WGS 84 / UTM zone 53S
-<BR> <UTM54S> : WGS 84 / UTM zone 54S
-<BR> <UTM55S> : WGS 84 / UTM zone 55S
-<BR> <UTM56S> : WGS 84 / UTM zone 56S
-<BR> <UTM57S> : WGS 84 / UTM zone 57S
-<BR> <UTM58S> : WGS 84 / UTM zone 58S
-<BR> <UTM59S> : WGS 84 / UTM zone 59S
-<BR> <UTM60S> : WGS 84 / UTM zone 60S
-<BR> <UPSN> : WGS 84 / UPS North
-<BR> <UPSS> : WGS 84 / UPS South
-<P>
-<BR> ---------------------------------------------------------
-<BR> Listing of State Plane North American Datum Zones
-<BR> ---------------------------------------------------------
-<BR>   MB-System projection ids are the zone number
-<BR>   prefixed by either "nad27sp" or "nad83sp"
-<BR> ----------------------------------------------
-<BR>                                NGS zone number
-<BR> State and zone                  1927     1983
-<BR> ----------------------------------------------
-<BR> Alabama east ..................  101      101
-<BR> Alabama west ..................  102      102
-<BR> Alaska zone no. 1 ............. 5001     5001
-<BR> Alaska zone no. 2 ............. 5002     5002
-<BR> Alaska zone no. 3 ............. 5003     5003
-<BR> Alaska zone no. 4 ............. 5004     5004
-<BR> Alaska zone no. 5 ............. 5005     5005
-<BR> Alaska zone no. 6 ............. 5006     5006
-<BR> Alaska zone no. 7 ............. 5007     5007
-<BR> Alaska zone no. 8 ............. 5008     5008
-<BR> Alaska zone no. 9 ............. 5009     5009
-<BR> Alaska zone no. 10 ............ 5010     5010
-<BR> American Samoa ................ 5300
-<BR> Arizona central ...............  202      202
-<BR> Arizona east ..................  201      201
-<BR> Arizona west ..................  203      203
-<BR> Arkansas north ................  301      301
-<BR> Arkansas south ................  302      302
-<BR> California I ..................  401      401
-<BR> California II .................  402      402
-<BR> California III ................  403      403
-<BR> California IV .................  404      404
-<BR> California V ..................  405      405
-<BR> California VI .................  406      406
-<BR> California VII ................  407
-<BR> Colorado central ..............  502      502
-<BR> Colorado north ................  501      501
-<BR> Colorado south ................  503      503
-<BR> Connecticut ...................  600      600
-<BR> Delaware ......................  700      700
-<BR> Florida east ..................  901      901
-<BR> Florida north .................  903      903
-<BR> Florida west ..................  902      902
-<BR> Georgia east .................. 1001     1001
-<BR> Georgia west .................. 1002     1002
-<BR> Guam Island ................... 5400
-<BR> Hawaii 1 ...................... 5101     5101
-<BR> Hawaii 2 ...................... 5102     5102
-<BR> Hawaii 3 ...................... 5103     5103
-<BR> Hawaii 4 ...................... 5104     5104
-<BR> Hawaii 5 ...................... 5105     5105
-<BR> Idaho central ................. 1102     1102
-<BR> Idaho east .................... 1101     1101
-<BR> Idaho west .................... 1103     1103
-<BR> Illinois east ................. 1201     1201
-<BR> Illinois west ................. 1202     1202
-<BR> Indiana east .................. 1301     1301
-<BR> Indiana west .................. 1302     1302
-<BR> Iowa north .................... 1401     1401
-<BR> Iowa south .................... 1402     1402
-<BR> Kansas north .................. 1501     1501
-<BR> Kansas south .................. 1502     1502
-<BR> Kentucky north ................ 1601     1601
-<BR> Kentucky south ................ 1602     1602
-<BR> Louisiana north ............... 1701     1701
-<BR> Louisiana offshore ............ 1703     1703
-<BR> Louisiana south ............... 1702     1702
-<BR> Maine east .................... 1801     1801
-<BR> Maine west .................... 1802     1802
-<BR> Maryland ...................... 1900     1900
-<BR> Massachusetts island .......... 2002     2002
-<BR> Massachusetts mainland ........ 2001     2001
-<BR> Michigan central/l ............ 2112     2112 current
-<BR> Michigan central/m ............ 2102          old
-<BR> Michigan east ................. 2101          old
-<BR> Michigan north ................ 2111     2111 current
-<BR> Michigan south ................ 2113     2113 current
-<BR> Michigan west ................. 2103          old
-<BR> Minnesota central ............. 2202     2202
-<BR> Minnesota north ............... 2201     2201
-<BR> Minnesota south ............... 2203     2203
-<BR> Mississippi east .............. 2301     2301
-<BR> Mississippi west .............. 2302     2302
-<BR> Missouri central .............. 2402     2402
-<BR> Missouri east ................. 2401     2401
-<BR> Missouri west ................. 2403     2403
-<BR> Montana .......................          2500
-<BR> Montana central ............... 2502
-<BR> Montana north ................. 2501
-<BR> Montana south ................. 2503
-<BR> Nebraska ......................          2600
-<BR> Nebraska north ................ 2601
-<BR> Nebraska south ................ 2602
-<BR> Nevada central ................ 2702     2702
-<BR> Nevada east ................... 2701     2701
-<BR> Nevada west ................... 2703     2703
-<BR> New hampshire ................. 2800     2800
-<BR> New jersey .................... 2900     2900
-<BR> New mexico central ............ 3002     3002
-<BR> New mexico east ............... 3001     3001
-<BR> New mexico west ............... 3003     3003
-<BR> New york central .............. 3102     3102
-<BR> New york east ................. 3101     3101
-<BR> New york long island .......... 3104     3104
-<BR> New york west ................. 3103     3103
-<BR> North carolina ................ 3200     3200
-<BR> North dakota north ............ 3301     3301
-<BR> North dakota south ............ 3302     3302
-<BR> Ohio north .................... 3401     3401
-<BR> Ohio south .................... 3402     3402
-<BR> Oklahoma north ................ 3501     3501
-<BR> Oklahoma south ................ 3502     3502
-<BR> Oregon north .................. 3601     3601
-<BR> Oregon south .................. 3602     3602
-<BR> Pennsylvania north ............ 3701     3701
-<BR> Pennsylvania south ............ 3702     3702
-<BR> Puerto Rico, Virgin Islands ... 5201     5200
-<BR> Rhode Island .................. 3800     3800
-<BR> South Carolina ................          3900
-<BR> South Carolina north .......... 3901
-<BR> South Carolina south .......... 3902
-<BR> South Dakota north ............ 4001     4001
-<BR> South Dakota south ............ 4002     4002
-<BR> Tennessee ..................... 4100     4100
-<BR> Texas central ................. 4203     4203
-<BR> Texas north ................... 4201     4201
-<BR> Texas north central ........... 4202     4202
-<BR> Texas south ................... 4205     4205
-<BR> Texas south central ........... 4204     4204
-<BR> Utah central .................. 4302     4302
-<BR> Utah north .................... 4301     4301
-<BR> Utah south .................... 4303     4303
-<BR> Vermont ....................... 4400     4400
-<BR> Virgin Islands, St. Croix ..... 5202
-<BR> Virginia north ................ 4501     4501
-<BR> Virginia south ................ 4502     4502
-<BR> Washington north .............. 4601     4601
-<BR> Washington south .............. 4602     4602
-<BR> West Virginia north ........... 4701     4701
-<BR> West Virginia south ........... 4702     4702
-<BR> Wisconsin central ............. 4802     4802
-<BR> Wisconsin north ............... 4801     4801
-<BR> Wisconsin south ............... 4803     4803
-<BR> Wyoming east .................. 4901     4901
-<BR> Wyoming east central .......... 4902     4902
-<BR> Wyoming west .................. 4904     4904
-<BR> Wyoming west central .......... 4903     4903
-<BR> ----------------------------------------------
-<P>
-<BR> ---------------------------------------------------------
-<BR> State Plane Coordinate Systems
-<BR> North American Datum 1927
-<BR> ---------------------------------------------------------
-<BR> <nad27sp101> : alabama east> : nad27sp
-<BR> <nad27sp102> : alabama west> : nad27sp
-<BR> <nad27sp5010> : alaska zone no. 10> : nad27sp
-<BR> <nad27sp5300> : american samoa> : nad27sp
-<BR> <nad27sp201> : arizona east> : nad27sp
-<BR> <nad27sp202> : arizona central> : nad27sp
-<BR> <nad27sp203> : arizona west> : nad27sp
-<BR> <nad27sp301> : arkansas north> : nad27sp
-<BR> <nad27sp302> : arkansas south> : nad27sp
-<BR> <nad27sp401> : california i> : nad27sp
-<BR> <nad27sp402> : california ii> : nad27sp
-<BR> <nad27sp403> : california iii> : nad27sp
-<BR> <nad27sp404> : california iv> : nad27sp
-<BR> <nad27sp405> : california v> : nad27sp
-<BR> <nad27sp406> : california vi> : nad27sp
-<BR> <nad27sp407> : california vii> : nad27sp
-<BR> <nad27sp501> : colorado north> : nad27sp
-<BR> <nad27sp502> : colorado central> : nad27sp
-<BR> <nad27sp503> : colorado south> : nad27sp
-<BR> <nad27sp600> : connecticut ---> : nad27sp
-<BR> <nad27sp700> : delaware ---> : nad27sp
-<BR> <nad27sp901> : florida east> : nad27sp
-<BR> <nad27sp902> : florida west> : nad27sp
-<BR> <nad27sp903> : florida north> : nad27sp
-<BR> <nad27sp1001> : georgia east> : nad27sp
-<BR> <nad27sp1002> : georgia west> : nad27sp
-<BR> <nad27sp5101> : hawaii 1> : nad27sp
-<BR> <nad27sp5102> : hawaii 2> : nad27sp
-<BR> <nad27sp5103> : hawaii 3> : nad27sp
-<BR> <nad27sp5104> : hawaii 4> : nad27sp
-<BR> <nad27sp5105> : hawaii 5> : nad27sp
-<BR> <nad27sp1101> : idaho east> : nad27sp
-<BR> <nad27sp1102> : idaho central> : nad27sp
-<BR> <nad27sp1103> : idaho west> : nad27sp
-<BR> <nad27sp1201> : illinois east> : nad27sp
-<BR> <nad27sp1202> : illinois west> : nad27sp
-<BR> <nad27sp1301> : indiana east> : nad27sp
-<BR> <nad27sp1302> : indiana west> : nad27sp
-<BR> <nad27sp1401> : iowa north> : nad27sp
-<BR> <nad27sp1402> : iowa south> : nad27sp
-<BR> <nad27sp1501> : kansas north> : nad27sp
-<BR> <nad27sp1502> : kansas south> : nad27sp
-<BR> <nad27sp1601> : kentucky north> : nad27sp
-<BR> <nad27sp1602> : kentucky south> : nad27sp
-<BR> <nad27sp1701> : louisiana north> : nad27sp
-<BR> <nad27sp1702> : louisiana south> : nad27sp
-<BR> <nad27sp1703> : louisiana offshore> : nad27sp
-<BR> <nad27sp1801> : maine east> : nad27sp
-<BR> <nad27sp1802> : maine west> : nad27sp
-<BR> <nad27sp1900> : maryland ---> : nad27sp
-<BR> <nad27sp2001> : massachusetts mainland> : nad27sp
-<BR> <nad27sp2002> : massachusetts island> : nad27sp
-<BR> <nad27sp2101> : michigan east> : nad27sp
-<BR> <nad27sp2102> : michigan central/m> : nad27sp
-<BR> <nad27sp2103> : michigan west> : nad27sp
-<BR> <nad27sp2111> : michigan north> : nad27sp
-<BR> <nad27sp2112> : michigan central/l> : nad27sp
-<BR> <nad27sp2113> : michigan south> : nad27sp
-<BR> <nad27sp2201> : minnesota north> : nad27sp
-<BR> <nad27sp2202> : minnesota central> : nad27sp
-<BR> <nad27sp2203> : minnesota south> : nad27sp
-<BR> <nad27sp2301> : mississippi east> : nad27sp
-<BR> <nad27sp2302> : mississippi west> : nad27sp
-<BR> <nad27sp2401> : missouri east> : nad27sp
-<BR> <nad27sp2402> : missouri central> : nad27sp
-<BR> <nad27sp2403> : missouri west> : nad27sp
-<BR> <nad27sp2501> : montana north> : nad27sp
-<BR> <nad27sp2502> : montana central> : nad27sp
-<BR> <nad27sp2503> : montana south> : nad27sp
-<BR> <nad27sp2601> : nebraska north> : nad27sp
-<BR> <nad27sp2602> : nebraska south> : nad27sp
-<BR> <nad27sp2701> : nevada east> : nad27sp
-<BR> <nad27sp2702> : nevada central> : nad27sp
-<BR> <nad27sp2703> : nevada west> : nad27sp
-<BR> <nad27sp2800> : new hampshire ---> : nad27sp
-<BR> <nad27sp2900> : new jersey ---> : nad27sp
-<BR> <nad27sp3001> : new mexico east> : nad27sp
-<BR> <nad27sp3002> : new mexico central> : nad27sp
-<BR> <nad27sp3003> : new mexico west> : nad27sp
-<BR> <nad27sp3101> : new york east> : nad27sp
-<BR> <nad27sp3102> : new york central> : nad27sp
-<BR> <nad27sp3103> : new york west> : nad27sp
-<BR> <nad27sp3104> : new york long island> : nad27sp
-<BR> <nad27sp3200> : north carolina ---> : nad27sp
-<BR> <nad27sp3301> : north dakota north> : nad27sp
-<BR> <nad27sp3302> : north dakota south> : nad27sp
-<BR> <nad27sp3401> : ohio north> : nad27sp
-<BR> <nad27sp3402> : ohio south> : nad27sp
-<BR> <nad27sp3501> : oklahoma north> : nad27sp
-<BR> <nad27sp3502> : oklahoma south> : nad27sp
-<BR> <nad27sp3601> : oregon north> : nad27sp
-<BR> <nad27sp3602> : oregon south> : nad27sp
-<BR> <nad27sp3701> : pennsylvania north> : nad27sp
-<BR> <nad27sp3702> : pennsylvania south> : nad27sp
-<BR> <nad27sp3800> : rhode island ---> : nad27sp
-<BR> <nad27sp3901> : south carolina north> : nad27sp
-<BR> <nad27sp3902> : south carolina south> : nad27sp
-<BR> <nad27sp4001> : south dakota north> : nad27sp
-<BR> <nad27sp4002> : south dakota south> : nad27sp
-<BR> <nad27sp4100> : tennessee ---> : nad27sp
-<BR> <nad27sp4201> : texas north> : nad27sp
-<BR> <nad27sp4202> : texas north central> : nad27sp
-<BR> <nad27sp4203> : texas central> : nad27sp
-<BR> <nad27sp4204> : texas south central> : nad27sp
-<BR> <nad27sp4205> : texas south> : nad27sp
-<BR> <nad27sp4301> : utah north> : nad27sp
-<BR> <nad27sp4302> : utah central> : nad27sp
-<BR> <nad27sp4303> : utah south> : nad27sp
-<BR> <nad27sp4400> : vermont ---> : nad27sp
-<BR> <nad27sp4501> : virginia north> : nad27sp
-<BR> <nad27sp4502> : virginia south> : nad27sp
-<BR> <nad27sp4601> : washington north> : nad27sp
-<BR> <nad27sp4602> : washington south> : nad27sp
-<BR> <nad27sp4701> : west virginia north> : nad27sp
-<BR> <nad27sp4702> : west virginia south> : nad27sp
-<BR> <nad27sp4801> : wisconsin north> : nad27sp
-<BR> <nad27sp4802> : wisconsin central> : nad27sp
-<BR> <nad27sp4803> : wisconsin south> : nad27sp
-<BR> <nad27sp4901> : wyoming east> : nad27sp
-<BR> <nad27sp4902> : wyoming east central> : nad27sp
-<BR> <nad27sp4903> : wyoming west central> : nad27sp
-<BR> <nad27sp4904> : wyoming west> : nad27sp
-<BR> <nad27sp5001> : alaska zone no. 1> : nad27sp
-<BR> <nad27sp5002> : alaska zone no. 2> : nad27sp
-<BR> <nad27sp5003> : alaska zone no. 3> : nad27sp
-<BR> <nad27sp5004> : alaska zone no. 4> : nad27sp
-<BR> <nad27sp5005> : alaska zone no. 5> : nad27sp
-<BR> <nad27sp5006> : alaska zone no. 6> : nad27sp
-<BR> <nad27sp5007> : alaska zone no. 7> : nad27sp
-<BR> <nad27sp5008> : alaska zone no. 8> : nad27sp
-<BR> <nad27sp5009> : alaska zone no. 9> : nad27sp
-<BR> <nad27sp5201> : puerto rico and virgin islands> : nad27sp
-<BR> <nad27sp5202> : virgin islands st. croix> : nad27sp
-<BR> <nad27sp5400> : guam island> : nad27sp
-<P>
-<BR> ---------------------------------------------------------
-<BR> State Plane Coordinate Systems
-<BR> North American Datum 1983
-<BR> ---------------------------------------------------------
-<BR> <nad83sp101> : alabama east> : nad83
-<BR> <nad83sp102> : alabama west> : nad83
-<BR> <nad83sp5010> : alaska zone no. 10> : nad83
-<BR> <nad83sp201> : arizona east> : nad83
-<BR> <nad83sp202> : arizona central> : nad83
-<BR> <nad83sp203> : arizona west> : nad83
-<BR> <nad83sp301> : arkansas north> : nad83
-<BR> <nad83sp302> : arkansas south> : nad83
-<BR> <nad83sp401> : california i> : nad83
-<BR> <nad83sp402> : california ii> : nad83
-<BR> <nad83sp403> : california iii> : nad83
-<BR> <nad83sp404> : california iv> : nad83
-<BR> <nad83sp405> : california v> : nad83
-<BR> <nad83sp406> : california vi> : nad83
-<BR> <nad83sp501> : colorado north> : nad83
-<BR> <nad83sp502> : colorado central> : nad83
-<BR> <nad83sp503> : colorado south> : nad83
-<BR> <nad83sp600> : connecticut ---> : nad83
-<BR> <nad83sp700> : delaware ---> : nad83
-<BR> <nad83sp901> : florida east> : nad83
-<BR> <nad83sp902> : florida west> : nad83
-<BR> <nad83sp903> : florida north> : nad83
-<BR> <nad83sp1001> : georgia east> : nad83
-<BR> <nad83sp1002> : georgia west> : nad83
-<BR> <nad83sp5101> : hawaii 1> : nad83
-<BR> <nad83sp5102> : hawaii 2> : nad83
-<BR> <nad83sp5103> : hawaii 3> : nad83
-<BR> <nad83sp5104> : hawaii 4> : nad83
-<BR> <nad83sp5105> : hawaii 5> : nad83
-<BR> <nad83sp1101> : idaho east> : nad83
-<BR> <nad83sp1102> : idaho central> : nad83
-<BR> <nad83sp1103> : idaho west> : nad83
-<BR> <nad83sp1201> : illinois east> : nad83
-<BR> <nad83sp1202> : illinois west> : nad83
-<BR> <nad83sp1301> : indiana east> : nad83
-<BR> <nad83sp1302> : indiana west> : nad83
-<BR> <nad83sp1401> : iowa north> : nad83
-<BR> <nad83sp1402> : iowa south> : nad83
-<BR> <nad83sp1501> : kansas north> : nad83
-<BR> <nad83sp1502> : kansas south> : nad83
-<BR> <nad83sp1601> : kentucky north> : nad83
-<BR> <nad83sp1602> : kentucky south> : nad83
-<BR> <nad83sp1701> : louisiana north> : nad83
-<BR> <nad83sp1702> : louisiana south> : nad83
-<BR> <nad83sp1703> : louisiana offshore> : nad83
-<BR> <nad83sp1801> : maine east> : nad83
-<BR> <nad83sp1802> : maine west> : nad83
-<BR> <nad83sp1900> : maryland ---> : nad83
-<BR> <nad83sp2001> : massachusetts mainland> : nad83
-<BR> <nad83sp2002> : massachusetts island> : nad83
-<BR> <nad83sp2111> : michigan north> : nad83
-<BR> <nad83sp2112> : michigan central/l> : nad83
-<BR> <nad83sp2113> : michigan south> : nad83
-<BR> <nad83sp2201> : minnesota north> : nad83
-<BR> <nad83sp2202> : minnesota central> : nad83
-<BR> <nad83sp2203> : minnesota south> : nad83
-<BR> <nad83sp2301> : mississippi east> : nad83
-<BR> <nad83sp2302> : mississippi west> : nad83
-<BR> <nad83sp2401> : missouri east> : nad83
-<BR> <nad83sp2402> : missouri central> : nad83
-<BR> <nad83sp2403> : missouri west> : nad83
-<BR> <nad83sp2500> : montana> : nad83
-<BR> <nad83sp2600> : nebraska> : nad83
-<BR> <nad83sp2701> : nevada east> : nad83
-<BR> <nad83sp2702> : nevada central> : nad83
-<BR> <nad83sp2703> : nevada west> : nad83
-<BR> <nad83sp2800> : new hampshire ---> : nad83
-<BR> <nad83sp2900> : new jersey ---> : nad83
-<BR> <nad83sp3001> : new mexico east> : nad83
-<BR> <nad83sp3002> : new mexico central> : nad83
-<BR> <nad83sp3003> : new mexico west> : nad83
-<BR> <nad83sp3101> : new york east> : nad83
-<BR> <nad83sp3102> : new york central> : nad83
-<BR> <nad83sp3103> : new york west> : nad83
-<BR> <nad83sp3104> : new york long island> : nad83
-<BR> <nad83sp3200> : north carolina ---> : nad83
-<BR> <nad83sp3301> : north dakota north> : nad83
-<BR> <nad83sp3302> : north dakota south> : nad83
-<BR> <nad83sp3401> : ohio north> : nad83
-<BR> <nad83sp3402> : ohio south> : nad83
-<BR> <nad83sp3501> : oklahoma north> : nad83
-<BR> <nad83sp3502> : oklahoma south> : nad83
-<BR> <nad83sp3601> : oregon north> : nad83
-<BR> <nad83sp3602> : oregon south> : nad83
-<BR> <nad83sp3701> : pennsylvania north> : nad83
-<BR> <nad83sp3702> : pennsylvania south> : nad83
-<BR> <nad83sp3800> : rhode island ---> : nad83
-<BR> <nad83sp3900> : south carolina> : nad83
-<BR> <nad83sp4001> : south dakota north> : nad83
-<BR> <nad83sp4002> : south dakota south> : nad83
-<BR> <nad83sp4100> : tennessee ---> : nad83
-<BR> <nad83sp4201> : texas north> : nad83
-<BR> <nad83sp4202> : texas north central> : nad83
-<BR> <nad83sp4203> : texas central> : nad83
-<BR> <nad83sp4204> : texas south central> : nad83
-<BR> <nad83sp4205> : texas south> : nad83
-<BR> <nad83sp4301> : utah north> : nad83
-<BR> <nad83sp4302> : utah central> : nad83
-<BR> <nad83sp4303> : utah south> : nad83
-<BR> <nad83sp4400> : vermont ---> : nad83
-<BR> <nad83sp4501> : virginia north> : nad83
-<BR> <nad83sp4502> : virginia south> : nad83
-<BR> <nad83sp4601> : washington north> : nad83
-<BR> <nad83sp4602> : washington south> : nad83
-<BR> <nad83sp4701> : west virginia north> : nad83
-<BR> <nad83sp4702> : west virginia south> : nad83
-<BR> <nad83sp4801> : wisconsin north> : nad83
-<BR> <nad83sp4802> : wisconsin central> : nad83
-<BR> <nad83sp4803> : wisconsin south> : nad83
-<BR> <nad83sp4901> : wyoming east> : nad83
-<BR> <nad83sp4902> : wyoming east central> : nad83
-<BR> <nad83sp4903> : wyoming west central> : nad83
-<BR> <nad83sp4904> : wyoming west> : nad83
-<BR> <nad83sp5001> : alaska zone no. 1> : nad83
-<BR> <nad83sp5002> : alaska zone no. 2> : nad83
-<BR> <nad83sp5003> : alaska zone no. 3> : nad83
-<BR> <nad83sp5004> : alaska zone no. 4> : nad83
-<BR> <nad83sp5005> : alaska zone no. 5> : nad83
-<BR> <nad83sp5006> : alaska zone no. 6> : nad83
-<BR> <nad83sp5007> : alaska zone no. 7> : nad83
-<BR> <nad83sp5008> : alaska zone no. 8> : nad83
-<BR> <nad83sp5009> : alaska zone no. 9> : nad83
-<BR> <nad83sp5200> : puerto rico and virgin islands> : nad83
-<P>
-<BR> ---------------------------------------------------------
-<BR> Great Lakes Grids using Clarke 1866 ellipsoid
-<BR> ---------------------------------------------------------
-<BR> <erie-etal> : Lake Erie, Ontario and St. Lawrence River.
-<BR> <huron> : Lake Huron
-<BR> <michigan> : Lake Michigan
-<BR> <superior> : Lake Superior, Lake of the Woods
-<P>
-<BR> ---------------------------------------------------------
-<BR> EPSG projection definitions
-<BR> ---------------------------------------------------------
-<BR> <epsg4001> : Unknown datum based upon the Airy 1830 ellipsoid
-<BR> <epsg4002> : Unknown datum based upon the Airy Modified 1849 ellipsoid
-<BR> <epsg4003> : Unknown datum based upon the Australian National Spheroid
-<BR> <epsg4004> : Unknown datum based upon the Bessel 1841 ellipsoid
-<BR> <epsg4005> : Unknown datum based upon the Bessel Modified ellipsoid
-<BR> <epsg4006> : Unknown datum based upon the Bessel Namibia ellipsoid
-<BR> <epsg4007> : Unknown datum based upon the Clarke 1858 ellipsoid
-<BR> <epsg4008> : Unknown datum based upon the Clarke 1866 ellipsoid
-<BR> <epsg4009> : Unknown datum based upon the Clarke 1866 Michigan ellipsoid
-<BR> <epsg4010> : Unknown datum based upon the Clarke 1880 (Benoit) ellipsoid
-<BR> <epsg4011> : Unknown datum based upon the Clarke 1880 (IGN) ellipsoid
-<BR> <epsg4012> : Unknown datum based upon the Clarke 1880 (RGS) ellipsoid
-<BR> <epsg4013> : Unknown datum based upon the Clarke 1880 (Arc) ellipsoid
-<BR> <epsg4014> : Unknown datum based upon the Clarke 1880 (SGA 1922) ellipsoid
-<BR> <epsg4015> : Unknown datum based upon the Everest 1830 (1937 Adjustment) ellipsoid
-<BR> <epsg4016> : Unknown datum based upon the Everest 1830 (1967 Definition) ellipsoid
-<BR> <epsg4018> : Unknown datum based upon the Everest 1830 Modified ellipsoid
-<BR> <epsg4019> : Unknown datum based upon the GRS 1980 ellipsoid
-<BR> <epsg4020> : Unknown datum based upon the Helmert 1906 ellipsoid
-<BR> <epsg4021> : Unknown datum based upon the Indonesian National Spheroid
-<BR> <epsg4022> : Unknown datum based upon the International 1924 ellipsoid
-<BR> <epsg4024> : Unknown datum based upon the Krassowsky 1940 ellipsoid
-<BR> <epsg4025> : Unknown datum based upon the NWL 9D ellipsoid
-<BR> <epsg4027> : Unknown datum based upon the Plessis 1817 ellipsoid
-<BR> <epsg4028> : Unknown datum based upon the Struve 1860 ellipsoid
-<BR> <epsg4029> : Unknown datum based upon the War Office ellipsoid
-<BR> <epsg4030> : Unknown datum based upon the WGS 84 ellipsoid
-<BR> <epsg4031> : Unknown datum based upon the GEM 10C ellipsoid
-<BR> <epsg4032> : Unknown datum based upon the OSU86F ellipsoid
-<BR> <epsg4033> : Unknown datum based upon the OSU91A ellipsoid
-<BR> <epsg4034> : Unknown datum based upon the Clarke 1880 ellipsoid
-<BR> <epsg4035> : Unknown datum based upon the Authalic Sphere
-<BR> <epsg4036> : Unknown datum based upon the GRS 1967 ellipsoid
-<BR> <epsg4041> : Unknown datum based upon the Average Terrestrial System 1977 ellipsoid
-<BR> <epsg4042> : Unknown datum based upon the Everest (1830 Definition) ellipsoid
-<BR> <epsg4043> : Unknown datum based upon the WGS 72 ellipsoid
-<BR> <epsg4044> : Unknown datum based upon the Everest 1830 (1962 Definition) ellipsoid
-<BR> <epsg4045> : Unknown datum based upon the Everest 1830 (1975 Definition) ellipsoid
-<BR> <epsg4047> : Unspecified datum based upon the GRS 1980 Authalic Sphere
-<BR> <epsg4052> : Unspecified datum based upon the Clarke 1866 Authalic Sphere
-<BR> <epsg4053> : Unspecified datum based upon the International 1924 Authalic Sphere
-<BR> <epsg4054> : Unspecified datum based upon the Hughes 1980 ellipsoid
-<BR> <epsg4120> : Greek
-<BR> <epsg4121> : GGRS87
-<BR> <epsg4122> : ATS77
-<BR> <epsg4123> : KKJ
-<BR> <epsg4124> : RT90
-<BR> <epsg4125> : Samboja
-<BR> <epsg4126> : LKS94 (ETRS89)
-<BR> <epsg4127> : Tete
-<BR> <epsg4128> : Madzansua
-<BR> <epsg4129> : Observatario
-<BR> <epsg4130> : Moznet
-<BR> <epsg4131> : Indian 1960
-<BR> <epsg4132> : FD58
-<BR> <epsg4133> : EST92
-<BR> <epsg4134> : PDO Survey Datum 1993
-<BR> <epsg4135> : Old Hawaiian
-<BR> <epsg4136> : St. Lawrence Island
-<BR> <epsg4137> : St. Paul Island
-<BR> <epsg4138> : St. George Island
-<BR> <epsg4139> : Puerto Rico
-<BR> <epsg4140> : NAD83(CSRS98)
-<BR> <epsg4141> : Israel
-<BR> <epsg4142> : Locodjo 1965
-<BR> <epsg4143> : Abidjan 1987
-<BR> <epsg4144> : Kalianpur 1937
-<BR> <epsg4145> : Kalianpur 1962
-<BR> <epsg4146> : Kalianpur 1975
-<BR> <epsg4147> : Hanoi 1972
-<BR> <epsg4148> : Hartebeesthoek94
-<BR> <epsg4149> : CH1903
-<BR> <epsg4150> : CH1903+
-<BR> <epsg4151> : CHTRF95
-<BR> <epsg4152> : NAD83(HARN)
-<BR> <epsg4153> : Rassadiran
-<BR> <epsg4154> : ED50(ED77)
-<BR> <epsg4155> : Dabola 1981
-<BR> <epsg4156> : S-JTSK
-<BR> <epsg4157> : Mount Dillon
-<BR> <epsg4158> : Naparima 1955
-<BR> <epsg4159> : ELD79
-<BR> <epsg4160> : Chos Malal 1914
-<BR> <epsg4161> : Pampa del Castillo
-<BR> <epsg4162> : Korean 1985
-<BR> <epsg4163> : Yemen NGN96
-<BR> <epsg4164> : South Yemen
-<BR> <epsg4165> : Bissau
-<BR> <epsg4166> : Korean 1995
-<BR> <epsg4167> : NZGD2000
-<BR> <epsg4168> : Accra
-<BR> <epsg4169> : American Samoa 1962
-<BR> <epsg4170> : SIRGAS
-<BR> <epsg4171> : RGF93
-<BR> <epsg4172> : POSGAR
-<BR> <epsg4173> : IRENET95
-<BR> <epsg4174> : Sierra Leone 1924
-<BR> <epsg4175> : Sierra Leone 1968
-<BR> <epsg4176> : Australian Antarctic
-<BR> <epsg4178> : Pulkovo 1942(83)
-<BR> <epsg4179> : Pulkovo 1942(58)
-<BR> <epsg4180> : EST97
-<BR> <epsg4181> : Luxembourg 1930
-<BR> <epsg4182> : Azores Occidental 1939
-<BR> <epsg4183> : Azores Central 1948
-<BR> <epsg4184> : Azores Oriental 1940
-<BR> <epsg4185> : Madeira 1936
-<BR> <epsg4188> : OSNI 1952
-<BR> <epsg4189> : REGVEN
-<BR> <epsg4190> : POSGAR 98
-<BR> <epsg4191> : Albanian 1987
-<BR> <epsg4192> : Douala 1948
-<BR> <epsg4193> : Manoca 1962
-<BR> <epsg4194> : Qornoq 1927
-<BR> <epsg4195> : Scoresbysund 1952
-<BR> <epsg4196> : Ammassalik 1958
-<BR> <epsg4197> : Garoua
-<BR> <epsg4198> : Kousseri
-<BR> <epsg4199> : Egypt 1930
-<BR> <epsg4200> : Pulkovo 1995
-<BR> <epsg4201> : Adindan
-<BR> <epsg4202> : AGD66
-<BR> <epsg4203> : AGD84
-<BR> <epsg4204> : Ain el Abd
-<BR> <epsg4205> : Afgooye
-<BR> <epsg4206> : Agadez
-<BR> <epsg4207> : Lisbon
-<BR> <epsg4208> : Aratu
-<BR> <epsg4209> : Arc 1950
-<BR> <epsg4210> : Arc 1960
-<BR> <epsg4211> : Batavia
-<BR> <epsg4212> : Barbados 1938
-<BR> <epsg4213> : Beduaram
-<BR> <epsg4214> : Beijing 1954
-<BR> <epsg4215> : Belge 1950
-<BR> <epsg4216> : Bermuda 1957
-<BR> <epsg4218> : Bogota 1975
-<BR> <epsg4219> : Bukit Rimpah
-<BR> <epsg4220> : Camacupa
-<BR> <epsg4221> : Campo Inchauspe
-<BR> <epsg4222> : Cape
-<BR> <epsg4223> : Carthage
-<BR> <epsg4224> : Chua
-<BR> <epsg4225> : Corrego Alegre
-<BR> <epsg4226> : Cote d'Ivoire
-<BR> <epsg4227> : Deir ez Zor
-<BR> <epsg4228> : Douala
-<BR> <epsg4229> : Egypt 1907
-<BR> <epsg4230> : ED50
-<BR> <epsg4231> : ED87
-<BR> <epsg4232> : Fahud
-<BR> <epsg4233> : Gandajika 1970
-<BR> <epsg4234> : Garoua
-<BR> <epsg4235> : Guyane Francaise
-<BR> <epsg4236> : Hu Tzu Shan
-<BR> <epsg4237> : HD72
-<BR> <epsg4238> : ID74
-<BR> <epsg4239> : Indian 1954
-<BR> <epsg4240> : Indian 1975
-<BR> <epsg4241> : Jamaica 1875
-<BR> <epsg4242> : JAD69
-<BR> <epsg4243> : Kalianpur 1880
-<BR> <epsg4244> : Kandawala
-<BR> <epsg4245> : Kertau 1968
-<BR> <epsg4246> : KOC
-<BR> <epsg4247> : La Canoa
-<BR> <epsg4248> : PSAD56
-<BR> <epsg4249> : Lake
-<BR> <epsg4250> : Leigon
-<BR> <epsg4251> : Liberia 1964
-<BR> <epsg4252> : Lome
-<BR> <epsg4253> : Luzon 1911
-<BR> <epsg4254> : Hito XVIII 1963
-<BR> <epsg4255> : Herat North
-<BR> <epsg4256> : Mahe 1971
-<BR> <epsg4257> : Makassar
-<BR> <epsg4258> : ETRS89
-<BR> <epsg4259> : Malongo 1987
-<BR> <epsg4260> : Manoca
-<BR> <epsg4261> : Merchich
-<BR> <epsg4262> : Massawa
-<BR> <epsg4263> : Minna
-<BR> <epsg4264> : Mhast
-<BR> <epsg4265> : Monte Mario
-<BR> <epsg4266> : M'poraloko
-<BR> <epsg4267> : NAD27
-<BR> <epsg4268> : NAD27 Michigan
-<BR> <epsg4269> : NAD83
-<BR> <epsg4270> : Nahrwan 1967
-<BR> <epsg4271> : Naparima 1972
-<BR> <epsg4272> : NZGD49
-<BR> <epsg4273> : NGO 1948
-<BR> <epsg4274> : Datum 73
-<BR> <epsg4275> : NTF
-<BR> <epsg4276> : NSWC 9Z-2
-<BR> <epsg4277> : OSGB 1936
-<BR> <epsg4278> : OSGB70
-<BR> <epsg4279> : OS(SN)80
-<BR> <epsg4280> : Padang
-<BR> <epsg4281> : Palestine 1923
-<BR> <epsg4282> : Pointe Noire
-<BR> <epsg4283> : GDA94
-<BR> <epsg4284> : Pulkovo 1942
-<BR> <epsg4285> : Qatar 1974
-<BR> <epsg4286> : Qatar 1948
-<BR> <epsg4287> : Qornoq
-<BR> <epsg4288> : Loma Quintana
-<BR> <epsg4289> : Amersfoort
-<BR> <epsg4291> : SAD69
-<BR> <epsg4292> : Sapper Hill 1943
-<BR> <epsg4293> : Schwarzeck
-<BR> <epsg4294> : Segora
-<BR> <epsg4295> : Serindung
-<BR> <epsg4296> : Sudan
-<BR> <epsg4297> : Tananarive
-<BR> <epsg4298> : Timbalai 1948
-<BR> <epsg4299> : TM65
-<BR> <epsg4300> : TM75
-<BR> <epsg4301> : Tokyo
-<BR> <epsg4302> : Trinidad 1903
-<BR> <epsg4303> : TC(1948)
-<BR> <epsg4304> : Voirol 1875
-<BR> <epsg4306> : Bern 1938
-<BR> <epsg4307> : Nord Sahara 1959
-<BR> <epsg4308> : RT38
-<BR> <epsg4309> : Yacare
-<BR> <epsg4310> : Yoff
-<BR> <epsg4311> : Zanderij
-<BR> <epsg4312> : MGI
-<BR> <epsg4313> : Belge 1972
-<BR> <epsg4314> : DHDN
-<BR> <epsg4315> : Conakry 1905
-<BR> <epsg4316> : Dealul Piscului 1933
-<BR> <epsg4317> : Dealul Piscului 1970
-<BR> <epsg4318> : NGN
-<BR> <epsg4319> : KUDAMS
-<BR> <epsg4322> : WGS 72
-<BR> <epsg4324> : WGS 72BE
-<BR> <epsg4326> : WGS 84
-<BR> <epsg4600> : Anguilla 1957
-<BR> <epsg4601> : Antigua 1943
-<BR> <epsg4602> : Dominica 1945
-<BR> <epsg4603> : Grenada 1953
-<BR> <epsg4604> : Montserrat 1958
-<BR> <epsg4605> : St. Kitts 1955
-<BR> <epsg4606> : St. Lucia 1955
-<BR> <epsg4607> : St. Vincent 1945
-<BR> <epsg4608> : NAD27(76)
-<BR> <epsg4609> : NAD27(CGQ77)
-<BR> <epsg4610> : Xian 1980
-<BR> <epsg4611> : Hong Kong 1980
-<BR> <epsg4612> : JGD2000
-<BR> <epsg4613> : Segara
-<BR> <epsg4614> : QND95
-<BR> <epsg4615> : Porto Santo
-<BR> <epsg4616> : Selvagem Grande
-<BR> <epsg4617> : NAD83(CSRS)
-<BR> <epsg4618> : SAD69
-<BR> <epsg4619> : SWEREF99
-<BR> <epsg4620> : Point 58
-<BR> <epsg4621> : Fort Marigot
-<BR> <epsg4622> : Guadeloupe 1948
-<BR> <epsg4623> : CSG67
-<BR> <epsg4624> : RGFG95
-<BR> <epsg4625> : Martinique 1938
-<BR> <epsg4626> : Reunion 1947
-<BR> <epsg4627> : RGR92
-<BR> <epsg4628> : Tahiti 52
-<BR> <epsg4629> : Tahaa 54
-<BR> <epsg4630> : IGN72 Nuku Hiva
-<BR> <epsg4631> : K0 1949
-<BR> <epsg4632> : Combani 1950
-<BR> <epsg4633> : IGN56 Lifou
-<BR> <epsg4634> : IGN72 Grand Terre
-<BR> <epsg4635> : ST87 Ouvea
-<BR> <epsg4636> : Petrels 1972
-<BR> <epsg4637> : Perroud 1950
-<BR> <epsg4638> : Saint Pierre et Miquelon 1950
-<BR> <epsg4639> : MOP78
-<BR> <epsg4640> : RRAF 1991
-<BR> <epsg4641> : IGN53 Mare
-<BR> <epsg4642> : ST84 Ile des Pins
-<BR> <epsg4643> : ST71 Belep
-<BR> <epsg4644> : NEA74 Noumea
-<BR> <epsg4645> : RGNC 1991
-<BR> <epsg4646> : Grand Comoros
-<BR> <epsg4657> : Reykjavik 1900
-<BR> <epsg4658> : Hjorsey 1955
-<BR> <epsg4659> : ISN93
-<BR> <epsg4660> : Helle 1954
-<BR> <epsg4661> : LKS92
-<BR> <epsg4662> : IGN72 Grande Terre
-<BR> <epsg4663> : Porto Santo 1995
-<BR> <epsg4664> : Azores Oriental 1995
-<BR> <epsg4665> : Azores Central 1995
-<BR> <epsg4666> : Lisbon 1890
-<BR> <epsg4667> : IKBD-92
-<BR> <epsg4668> : ED79
-<BR> <epsg4669> : LKS94
-<BR> <epsg4670> : IGM95
-<BR> <epsg4671> : Voirol 1879
-<BR> <epsg4672> : CI1971
-<BR> <epsg4673> : CI1979
-<BR> <epsg4674> : SIRGAS 2000
-<BR> <epsg4675> : Guam 1963
-<BR> <epsg4676> : Vientiane 1982
-<BR> <epsg4677> : Lao 1993
-<BR> <epsg4678> : Lao 1997
-<BR> <epsg4679> : Jouik 1961
-<BR> <epsg4680> : Nouakchott 1965
-<BR> <epsg4681> : Mauritania 1999
-<BR> <epsg4682> : Gulshan 303
-<BR> <epsg4683> : PRS92
-<BR> <epsg4684> : Gan 1970
-<BR> <epsg4685> : Gandajika
-<BR> <epsg4686> : MAGNA-SIRGAS
-<BR> <epsg4687> : RGPF
-<BR> <epsg4688> : Fatu Iva 72
-<BR> <epsg4689> : IGN63 Hiva Oa
-<BR> <epsg4690> : Tahiti 79
-<BR> <epsg4691> : Moorea 87
-<BR> <epsg4692> : Maupiti 83
-<BR> <epsg4693> : Nakhl-e Ghanem
-<BR> <epsg4694> : POSGAR 94
-<BR> <epsg4695> : Katanga 1955
-<BR> <epsg4696> : Kasai 1953
-<BR> <epsg4697> : IGC 1962 6th Parallel South
-<BR> <epsg4698> : IGN 1962 Kerguelen
-<BR> <epsg4699> : Le Pouce 1934
-<BR> <epsg4700> : IGN Astro 1960
-<BR> <epsg4701> : IGCB 1955
-<BR> <epsg4702> : Mauritania 1999
-<BR> <epsg4703> : Mhast 1951
-<BR> <epsg4704> : Mhast (onshore)
-<BR> <epsg4705> : Mhast (offshore)
-<BR> <epsg4706> : Egypt Gulf of Suez S-650 TL
-<BR> <epsg4707> : Tern Island 1961
-<BR> <epsg4708> : Cocos Islands 1965
-<BR> <epsg4709> : Iwo Jima 1945
-<BR> <epsg4710> : St. Helena 1971
-<BR> <epsg4711> : Marcus Island 1952
-<BR> <epsg4712> : Ascension Island 1958
-<BR> <epsg4713> : Ayabelle Lighthouse
-<BR> <epsg4714> : Bellevue
-<BR> <epsg4715> : Camp Area Astro
-<BR> <epsg4716> : Phoenix Islands 1966
-<BR> <epsg4717> : Cape Canaveral
-<BR> <epsg4718> : Solomon 1968
-<BR> <epsg4719> : Easter Island 1967
-<BR> <epsg4720> : Fiji 1986
-<BR> <epsg4721> : Fiji 1956
-<BR> <epsg4722> : South Georgia 1968
-<BR> <epsg4723> : Grand Cayman 1959
-<BR> <epsg4724> : Diego Garcia 1969
-<BR> <epsg4725> : Johnston Island 1961
-<BR> <epsg4726> : Little Cayman 1961
-<BR> <epsg4727> : Midway 1961
-<BR> <epsg4728> : Pico de la Nieves
-<BR> <epsg4729> : Pitcairn 1967
-<BR> <epsg4730> : Santo 1965
-<BR> <epsg4731> : Viti Levu 1916
-<BR> <epsg4732> : Marshall Islands 1960
-<BR> <epsg4733> : Wake Island 1952
-<BR> <epsg4734> : Tristan 1968
-<BR> <epsg4735> : Kusaie 1951
-<BR> <epsg4736> : Deception Island
-<BR> <epsg4737> : Korea 2000
-<BR> <epsg4738> : Hong Kong 1963
-<BR> <epsg4739> : Hong Kong 1963(67)
-<BR> <epsg4740> : PZ-90
-<BR> <epsg4741> : FD54
-<BR> <epsg4742> : GDM2000
-<BR> <epsg4743> : Karbala 1979 (Polservice)
-<BR> <epsg4744> : Nahrwan 1934
-<BR> <epsg4745> : RD/83
-<BR> <epsg4746> : PD/83
-<BR> <epsg4747> : GR96
-<BR> <epsg4748> : Vanua Levu 1915
-<BR> <epsg4749> : RGNC91-93
-<BR> <epsg4750> : ST87 Ouvea
-<BR> <epsg4751> : Kertau (RSO)
-<BR> <epsg4752> : Viti Levu 1912
-<BR> <epsg4753> : fk89
-<BR> <epsg4754> : LGD2006
-<BR> <epsg4755> : DGN95
-<BR> <epsg4756> : VN-2000
-<BR> <epsg4757> : SVY21
-<BR> <epsg4758> : JAD2001
-<BR> <epsg4759> : NAD83(NSRS2007)
-<BR> <epsg4760> : WGS 66
-<BR> <epsg4801> : Bern 1898 (Bern)
-<BR> <epsg4802> : Bogota 1975 (Bogota)
-<BR> <epsg4803> : Lisbon (Lisbon)
-<BR> <epsg4804> : Makassar (Jakarta)
-<BR> <epsg4805> : MGI (Ferro)
-<BR> <epsg4806> : Monte Mario (Rome)
-<BR> <epsg4807> : NTF (Paris)
-<BR> <epsg4808> : Padang (Jakarta)
-<BR> <epsg4809> : Belge 1950 (Brussels)
-<BR> <epsg4810> : Tananarive (Paris)
-<BR> <epsg4811> : Voirol 1875 (Paris)
-<BR> <epsg4813> : Batavia (Jakarta)
-<BR> <epsg4814> : RT38 (Stockholm)
-<BR> <epsg4815> : Greek (Athens)
-<BR> <epsg4816> : Carthage (Paris)
-<BR> <epsg4817> : NGO 1948 (Oslo)
-<BR> <epsg4818> : S-JTSK (Ferro)
-<BR> <epsg4819> : Nord Sahara 1959 (Paris)
-<BR> <epsg4820> : Segara (Jakarta)
-<BR> <epsg4821> : Voirol 1879 (Paris)
-<BR> <epsg4901> : ATF (Paris)
-<BR> <epsg4902> : NDG (Paris)
-<BR> <epsg4903> : Madrid 1870 (Madrid)
-<BR> <epsg4904> : Lisbon 1890 (Lisbon)
-<BR> <epsg2000> : Anguilla 1957 / British West Indies Grid
-<BR> <epsg2001> : Antigua 1943 / British West Indies Grid
-<BR> <epsg2002> : Dominica 1945 / British West Indies Grid
-<BR> <epsg2003> : Grenada 1953 / British West Indies Grid
-<BR> <epsg2004> : Montserrat 1958 / British West Indies Grid
-<BR> <epsg2005> : St. Kitts 1955 / British West Indies Grid
-<BR> <epsg2006> : St. Lucia 1955 / British West Indies Grid
-<BR> <epsg2007> : St. Vincent 45 / British West Indies Grid
-<BR> <epsg2008> : NAD27(CGQ77) / SCoPQ zone 2
-<BR> <epsg2009> : NAD27(CGQ77) / SCoPQ zone 3
-<BR> <epsg2010> : NAD27(CGQ77) / SCoPQ zone 4
-<BR> <epsg2011> : NAD27(CGQ77) / SCoPQ zone 5
-<BR> <epsg2012> : NAD27(CGQ77) / SCoPQ zone 6
-<BR> <epsg2013> : NAD27(CGQ77) / SCoPQ zone 7
-<BR> <epsg2014> : NAD27(CGQ77) / SCoPQ zone 8
-<BR> <epsg2015> : NAD27(CGQ77) / SCoPQ zone 9
-<BR> <epsg2016> : NAD27(CGQ77) / SCoPQ zone 10
-<BR> <epsg2017> : NAD27(76) / MTM zone 8
-<BR> <epsg2018> : NAD27(76) / MTM zone 9
-<BR> <epsg2019> : NAD27(76) / MTM zone 10
-<BR> <epsg2020> : NAD27(76) / MTM zone 11
-<BR> <epsg2021> : NAD27(76) / MTM zone 12
-<BR> <epsg2022> : NAD27(76) / MTM zone 13
-<BR> <epsg2023> : NAD27(76) / MTM zone 14
-<BR> <epsg2024> : NAD27(76) / MTM zone 15
-<BR> <epsg2025> : NAD27(76) / MTM zone 16
-<BR> <epsg2026> : NAD27(76) / MTM zone 17
-<BR> <epsg2027> : NAD27(76) / UTM zone 15N
-<BR> <epsg2028> : NAD27(76) / UTM zone 16N
-<BR> <epsg2029> : NAD27(76) / UTM zone 17N
-<BR> <epsg2030> : NAD27(76) / UTM zone 18N
-<BR> <epsg2031> : NAD27(CGQ77) / UTM zone 17N
-<BR> <epsg2032> : NAD27(CGQ77) / UTM zone 18N
-<BR> <epsg2033> : NAD27(CGQ77) / UTM zone 19N
-<BR> <epsg2034> : NAD27(CGQ77) / UTM zone 20N
-<BR> <epsg2035> : NAD27(CGQ77) / UTM zone 21N
-<BR> <epsg2036> : NAD83(CSRS98) / New Brunswick Stereo (deprecated)
-<BR> <epsg2037> : NAD83(CSRS98) / UTM zone 19N (deprecated)
-<BR> <epsg2038> : NAD83(CSRS98) / UTM zone 20N (deprecated)
-<BR> <epsg2039> : Israel / Israeli TM Grid
-<BR> <epsg2040> : Locodjo 1965 / UTM zone 30N
-<BR> <epsg2041> : Abidjan 1987 / UTM zone 30N
-<BR> <epsg2042> : Locodjo 1965 / UTM zone 29N
-<BR> <epsg2043> : Abidjan 1987 / UTM zone 29N
-<BR> <epsg2044> : Hanoi 1972 / Gauss-Kruger zone 18
-<BR> <epsg2045> : Hanoi 1972 / Gauss-Kruger zone 19
-<BR> <epsg2056> : CH1903+ / LV95
-<BR> <epsg2057> : Rassadiran / Nakhl e Taqi
-<BR> <epsg2058> : ED50(ED77) / UTM zone 38N
-<BR> <epsg2059> : ED50(ED77) / UTM zone 39N
-<BR> <epsg2060> : ED50(ED77) / UTM zone 40N
-<BR> <epsg2061> : ED50(ED77) / UTM zone 41N
-<BR> <epsg2062> : Madrid 1870 (Madrid) / Spain
-<BR> <epsg2063> : Dabola 1981 / UTM zone 28N (deprecated)
-<BR> <epsg2064> : Dabola 1981 / UTM zone 29N (deprecated)
-<BR> <epsg2065> : S-JTSK (Ferro) / Krovak
-<BR> <epsg2066> : Mount Dillon / Tobago Grid
-<BR> <epsg2067> : Naparima 1955 / UTM zone 20N
-<BR> <epsg2068> : ELD79 / Libya zone 5
-<BR> <epsg2069> : ELD79 / Libya zone 6
-<BR> <epsg2070> : ELD79 / Libya zone 7
-<BR> <epsg2071> : ELD79 / Libya zone 8
-<BR> <epsg2072> : ELD79 / Libya zone 9
-<BR> <epsg2073> : ELD79 / Libya zone 10
-<BR> <epsg2074> : ELD79 / Libya zone 11
-<BR> <epsg2075> : ELD79 / Libya zone 12
-<BR> <epsg2076> : ELD79 / Libya zone 13
-<BR> <epsg2077> : ELD79 / UTM zone 32N
-<BR> <epsg2078> : ELD79 / UTM zone 33N
-<BR> <epsg2079> : ELD79 / UTM zone 34N
-<BR> <epsg2080> : ELD79 / UTM zone 35N
-<BR> <epsg2081> : Chos Malal 1914 / Argentina zone 2
-<BR> <epsg2082> : Pampa del Castillo / Argentina zone 2
-<BR> <epsg2083> : Hito XVIII 1963 / Argentina zone 2
-<BR> <epsg2084> : Hito XVIII 1963 / UTM zone 19S
-<BR> <epsg2085> : NAD27 / Cuba Norte
-<BR> <epsg2086> : NAD27 / Cuba Sur
-<BR> <epsg2087> : ELD79 / TM 12 NE
-<BR> <epsg2088> : Carthage / TM 11 NE
-<BR> <epsg2089> : Yemen NGN96 / UTM zone 38N
-<BR> <epsg2090> : Yemen NGN96 / UTM zone 39N
-<BR> <epsg2091> : South Yemen / Gauss Kruger zone 8 (deprecated)
-<BR> <epsg2092> : South Yemen / Gauss Kruger zone 9 (deprecated)
-<BR> <epsg2093> : Hanoi 1972 / GK 106 NE
-<BR> <epsg2094> : WGS 72BE / TM 106 NE
-<BR> <epsg2095> : Bissau / UTM zone 28N
-<BR> <epsg2096> : Korean 1985 / Korea East Belt
-<BR> <epsg2097> : Korean 1985 / Korea Central Belt
-<BR> <epsg2098> : Korean 1985 / Korea West Belt
-<BR> <epsg2099> : Qatar 1948 / Qatar Grid
-<BR> <epsg2100> : GGRS87 / Greek Grid
-<BR> <epsg2101> : Lake / Maracaibo Grid M1
-<BR> <epsg2102> : Lake / Maracaibo Grid
-<BR> <epsg2103> : Lake / Maracaibo Grid M3
-<BR> <epsg2104> : Lake / Maracaibo La Rosa Grid
-<BR> <epsg2105> : NZGD2000 / Mount Eden Circuit 2000
-<BR> <epsg2106> : NZGD2000 / Bay of Plenty Circuit 2000
-<BR> <epsg2107> : NZGD2000 / Poverty Bay Circuit 2000
-<BR> <epsg2108> : NZGD2000 / Hawkes Bay Circuit 2000
-<BR> <epsg2109> : NZGD2000 / Taranaki Circuit 2000
-<BR> <epsg2110> : NZGD2000 / Tuhirangi Circuit 2000
-<BR> <epsg2111> : NZGD2000 / Wanganui Circuit 2000
-<BR> <epsg2112> : NZGD2000 / Wairarapa Circuit 2000
-<BR> <epsg2113> : NZGD2000 / Wellington Circuit 2000
-<BR> <epsg2114> : NZGD2000 / Collingwood Circuit 2000
-<BR> <epsg2115> : NZGD2000 / Nelson Circuit 2000
-<BR> <epsg2116> : NZGD2000 / Karamea Circuit 2000
-<BR> <epsg2117> : NZGD2000 / Buller Circuit 2000
-<BR> <epsg2118> : NZGD2000 / Grey Circuit 2000
-<BR> <epsg2119> : NZGD2000 / Amuri Circuit 2000
-<BR> <epsg2120> : NZGD2000 / Marlborough Circuit 2000
-<BR> <epsg2121> : NZGD2000 / Hokitika Circuit 2000
-<BR> <epsg2122> : NZGD2000 / Okarito Circuit 2000
-<BR> <epsg2123> : NZGD2000 / Jacksons Bay Circuit 2000
-<BR> <epsg2124> : NZGD2000 / Mount Pleasant Circuit 2000
-<BR> <epsg2125> : NZGD2000 / Gawler Circuit 2000
-<BR> <epsg2126> : NZGD2000 / Timaru Circuit 2000
-<BR> <epsg2127> : NZGD2000 / Lindis Peak Circuit 2000
-<BR> <epsg2128> : NZGD2000 / Mount Nicholas Circuit 2000
-<BR> <epsg2129> : NZGD2000 / Mount York Circuit 2000
-<BR> <epsg2130> : NZGD2000 / Observation Point Circuit 2000
-<BR> <epsg2131> : NZGD2000 / North Taieri Circuit 2000
-<BR> <epsg2132> : NZGD2000 / Bluff Circuit 2000
-<BR> <epsg2133> : NZGD2000 / UTM zone 58S
-<BR> <epsg2134> : NZGD2000 / UTM zone 59S
-<BR> <epsg2135> : NZGD2000 / UTM zone 60S
-<BR> <epsg2136> : Accra / Ghana National Grid
-<BR> <epsg2137> : Accra / TM 1 NW
-<BR> <epsg2138> : NAD27(CGQ77) / Quebec Lambert
-<BR> <epsg2139> : NAD83(CSRS98) / SCoPQ zone 2 (deprecated)
-<BR> <epsg2140> : NAD83(CSRS98) / MTM zone 3 (deprecated)
-<BR> <epsg2141> : NAD83(CSRS98) / MTM zone 4 (deprecated)
-<BR> <epsg2142> : NAD83(CSRS98) / MTM zone 5 (deprecated)
-<BR> <epsg2143> : NAD83(CSRS98) / MTM zone 6 (deprecated)
-<BR> <epsg2144> : NAD83(CSRS98) / MTM zone 7 (deprecated)
-<BR> <epsg2145> : NAD83(CSRS98) / MTM zone 8 (deprecated)
-<BR> <epsg2146> : NAD83(CSRS98) / MTM zone 9 (deprecated)
-<BR> <epsg2147> : NAD83(CSRS98) / MTM zone 10 (deprecated)
-<BR> <epsg2148> : NAD83(CSRS98) / UTM zone 21N (deprecated)
-<BR> <epsg2149> : NAD83(CSRS98) / UTM zone 18N (deprecated)
-<BR> <epsg2150> : NAD83(CSRS98) / UTM zone 17N (deprecated)
-<BR> <epsg2151> : NAD83(CSRS98) / UTM zone 13N (deprecated)
-<BR> <epsg2152> : NAD83(CSRS98) / UTM zone 12N (deprecated)
-<BR> <epsg2153> : NAD83(CSRS98) / UTM zone 11N (deprecated)
-<BR> <epsg2154> : RGF93 / Lambert-93
-<BR> <epsg2155> : American Samoa 1962 / American Samoa Lambert (deprecated)
-<BR> <epsg2156> : NAD83(HARN) / UTM zone 59S (deprecated)
-<BR> <epsg2157> : IRENET95 / Irish Transverse Mercator
-<BR> <epsg2158> : IRENET95 / UTM zone 29N
-<BR> <epsg2159> : Sierra Leone 1924 / New Colony Grid
-<BR> <epsg2160> : Sierra Leone 1924 / New War Office Grid
-<BR> <epsg2161> : Sierra Leone 1968 / UTM zone 28N
-<BR> <epsg2162> : Sierra Leone 1968 / UTM zone 29N
-<BR> <epsg2163> : US National Atlas Equal Area
-<BR> <epsg2164> : Locodjo 1965 / TM 5 NW
-<BR> <epsg2165> : Abidjan 1987 / TM 5 NW
-<BR> <epsg2166> : Pulkovo 1942(83) / Gauss Kruger zone 3 (deprecated)
-<BR> <epsg2167> : Pulkovo 1942(83) / Gauss Kruger zone 4 (deprecated)
-<BR> <epsg2168> : Pulkovo 1942(83) / Gauss Kruger zone 5 (deprecated)
-<BR> <epsg2169> : Luxembourg 1930 / Gauss
-<BR> <epsg2170> : MGI / Slovenia Grid
-<BR> <epsg2171> : Pulkovo 1942(58) / Poland zone I (deprecated)
-<BR> <epsg2172> : Pulkovo 1942(58) / Poland zone II
-<BR> <epsg2173> : Pulkovo 1942(58) / Poland zone III
-<BR> <epsg2174> : Pulkovo 1942(58) / Poland zone IV
-<BR> <epsg2175> : Pulkovo 1942(58) / Poland zone V
-<BR> <epsg2176> : ETRS89 / Poland CS2000 zone 5
-<BR> <epsg2177> : ETRS89 / Poland CS2000 zone 6
-<BR> <epsg2178> : ETRS89 / Poland CS2000 zone 7
-<BR> <epsg2179> : ETRS89 / Poland CS2000 zone 8
-<BR> <epsg2180> : ETRS89 / Poland CS92
-<BR> <epsg2188> : Azores Occidental 1939 / UTM zone 25N
-<BR> <epsg2189> : Azores Central 1948 / UTM zone 26N
-<BR> <epsg2190> : Azores Oriental 1940 / UTM zone 26N
-<BR> <epsg2191> : Madeira 1936 / UTM zone 28N (deprecated)
-<BR> <epsg2192> : ED50 / France EuroLambert
-<BR> <epsg2193> : NZGD2000 / New Zealand Transverse Mercator
-<BR> <epsg2194> : American Samoa 1962 / American Samoa Lambert (deprecated)
-<BR> <epsg2195> : NAD83(HARN) / UTM zone 2S
-<BR> <epsg2196> : ETRS89 / Kp2000 Jutland
-<BR> <epsg2197> : ETRS89 / Kp2000 Zealand
-<BR> <epsg2198> : ETRS89 / Kp2000 Bornholm
-<BR> <epsg2199> : Albanian 1987 / Gauss Kruger zone 4 (deprecated)
-<BR> <epsg2200> : ATS77 / New Brunswick Stereographic (ATS77)
-<BR> <epsg2201> : REGVEN / UTM zone 18N
-<BR> <epsg2202> : REGVEN / UTM zone 19N
-<BR> <epsg2203> : REGVEN / UTM zone 20N
-<BR> <epsg2204> : NAD27 / Tennessee
-<BR> <epsg2205> : NAD83 / Kentucky North
-<BR> <epsg2206> : ED50 / 3-degree Gauss-Kruger zone 9
-<BR> <epsg2207> : ED50 / 3-degree Gauss-Kruger zone 10
-<BR> <epsg2208> : ED50 / 3-degree Gauss-Kruger zone 11
-<BR> <epsg2209> : ED50 / 3-degree Gauss-Kruger zone 12
-<BR> <epsg2210> : ED50 / 3-degree Gauss-Kruger zone 13
-<BR> <epsg2211> : ED50 / 3-degree Gauss-Kruger zone 14
-<BR> <epsg2212> : ED50 / 3-degree Gauss-Kruger zone 15
-<BR> <epsg2213> : ETRS89 / TM 30 NE
-<BR> <epsg2214> : Douala 1948 / AOF west (deprecated)
-<BR> <epsg2215> : Manoca 1962 / UTM zone 32N
-<BR> <epsg2216> : Qornoq 1927 / UTM zone 22N
-<BR> <epsg2217> : Qornoq 1927 / UTM zone 23N
-<BR> <epsg2219> : ATS77 / UTM zone 19N
-<BR> <epsg2220> : ATS77 / UTM zone 20N
-<BR> <epsg2222> : NAD83 / Arizona East (ft)
-<BR> <epsg2223> : NAD83 / Arizona Central (ft)
-<BR> <epsg2224> : NAD83 / Arizona West (ft)
-<BR> <epsg2225> : NAD83 / California zone 1 (ftUS)
-<BR> <epsg2226> : NAD83 / California zone 2 (ftUS)
-<BR> <epsg2227> : NAD83 / California zone 3 (ftUS)
-<BR> <epsg2228> : NAD83 / California zone 4 (ftUS)
-<BR> <epsg2229> : NAD83 / California zone 5 (ftUS)
-<BR> <epsg2230> : NAD83 / California zone 6 (ftUS)
-<BR> <epsg2231> : NAD83 / Colorado North (ftUS)
-<BR> <epsg2232> : NAD83 / Colorado Central (ftUS)
-<BR> <epsg2233> : NAD83 / Colorado South (ftUS)
-<BR> <epsg2234> : NAD83 / Connecticut (ftUS)
-<BR> <epsg2235> : NAD83 / Delaware (ftUS)
-<BR> <epsg2236> : NAD83 / Florida East (ftUS)
-<BR> <epsg2237> : NAD83 / Florida West (ftUS)
-<BR> <epsg2238> : NAD83 / Florida North (ftUS)
-<BR> <epsg2239> : NAD83 / Georgia East (ftUS)
-<BR> <epsg2240> : NAD83 / Georgia West (ftUS)
-<BR> <epsg2241> : NAD83 / Idaho East (ftUS)
-<BR> <epsg2242> : NAD83 / Idaho Central (ftUS)
-<BR> <epsg2243> : NAD83 / Idaho West (ftUS)
-<BR> <epsg2244> : NAD83 / Indiana East (ftUS) (deprecated)
-<BR> <epsg2245> : NAD83 / Indiana West (ftUS) (deprecated)
-<BR> <epsg2246> : NAD83 / Kentucky North (ftUS)
-<BR> <epsg2247> : NAD83 / Kentucky South (ftUS)
-<BR> <epsg2248> : NAD83 / Maryland (ftUS)
-<BR> <epsg2249> : NAD83 / Massachusetts Mainland (ftUS)
-<BR> <epsg2250> : NAD83 / Massachusetts Island (ftUS)
-<BR> <epsg2251> : NAD83 / Michigan North (ft)
-<BR> <epsg2252> : NAD83 / Michigan Central (ft)
-<BR> <epsg2253> : NAD83 / Michigan South (ft)
-<BR> <epsg2254> : NAD83 / Mississippi East (ftUS)
-<BR> <epsg2255> : NAD83 / Mississippi West (ftUS)
-<BR> <epsg2256> : NAD83 / Montana (ft)
-<BR> <epsg2257> : NAD83 / New Mexico East (ftUS)
-<BR> <epsg2258> : NAD83 / New Mexico Central (ftUS)
-<BR> <epsg2259> : NAD83 / New Mexico West (ftUS)
-<BR> <epsg2260> : NAD83 / New York East (ftUS)
-<BR> <epsg2261> : NAD83 / New York Central (ftUS)
-<BR> <epsg2262> : NAD83 / New York West (ftUS)
-<BR> <epsg2263> : NAD83 / New York Long Island (ftUS)
-<BR> <epsg2264> : NAD83 / North Carolina (ftUS)
-<BR> <epsg2265> : NAD83 / North Dakota North (ft)
-<BR> <epsg2266> : NAD83 / North Dakota South (ft)
-<BR> <epsg2267> : NAD83 / Oklahoma North (ftUS)
-<BR> <epsg2268> : NAD83 / Oklahoma South (ftUS)
-<BR> <epsg2269> : NAD83 / Oregon North (ft)
-<BR> <epsg2270> : NAD83 / Oregon South (ft)
-<BR> <epsg2271> : NAD83 / Pennsylvania North (ftUS)
-<BR> <epsg2272> : NAD83 / Pennsylvania South (ftUS)
-<BR> <epsg2273> : NAD83 / South Carolina (ft)
-<BR> <epsg2274> : NAD83 / Tennessee (ftUS)
-<BR> <epsg2275> : NAD83 / Texas North (ftUS)
-<BR> <epsg2276> : NAD83 / Texas North Central (ftUS)
-<BR> <epsg2277> : NAD83 / Texas Central (ftUS)
-<BR> <epsg2278> : NAD83 / Texas South Central (ftUS)
-<BR> <epsg2279> : NAD83 / Texas South (ftUS)
-<BR> <epsg2280> : NAD83 / Utah North (ft)
-<BR> <epsg2281> : NAD83 / Utah Central (ft)
-<BR> <epsg2282> : NAD83 / Utah South (ft)
-<BR> <epsg2283> : NAD83 / Virginia North (ftUS)
-<BR> <epsg2284> : NAD83 / Virginia South (ftUS)
-<BR> <epsg2285> : NAD83 / Washington North (ftUS)
-<BR> <epsg2286> : NAD83 / Washington South (ftUS)
-<BR> <epsg2287> : NAD83 / Wisconsin North (ftUS)
-<BR> <epsg2288> : NAD83 / Wisconsin Central (ftUS)
-<BR> <epsg2289> : NAD83 / Wisconsin South (ftUS)
-<BR> <epsg2290> : ATS77 / Prince Edward Isl. Stereographic (ATS77)
-<BR> <epsg2291> : NAD83(CSRS98) / Prince Edward Isl. Stereographic (NAD83) (deprecated)
-<BR> <epsg2292> : NAD83(CSRS98) / Prince Edward Isl. Stereographic (NAD83) (deprecated)
-<BR> <epsg2294> : ATS77 / MTM Nova Scotia zone 4
-<BR> <epsg2295> : ATS77 / MTM Nova Scotia zone 5
-<BR> <epsg2308> : Batavia / TM 109 SE
-<BR> <epsg2309> : WGS 84 / TM 116 SE
-<BR> <epsg2310> : WGS 84 / TM 132 SE
-<BR> <epsg2311> : WGS 84 / TM 6 NE
-<BR> <epsg2312> : Garoua / UTM zone 33N
-<BR> <epsg2313> : Kousseri / UTM zone 33N
-<BR> <epsg2314> : Trinidad 1903 / Trinidad Grid (ftCla)
-<BR> <epsg2315> : Campo Inchauspe / UTM zone 19S
-<BR> <epsg2316> : Campo Inchauspe / UTM zone 20S
-<BR> <epsg2317> : PSAD56 / ICN Regional
-<BR> <epsg2318> : Ain el Abd / Aramco Lambert
-<BR> <epsg2319> : ED50 / TM27
-<BR> <epsg2320> : ED50 / TM30
-<BR> <epsg2321> : ED50 / TM33
-<BR> <epsg2322> : ED50 / TM36
-<BR> <epsg2323> : ED50 / TM39
-<BR> <epsg2324> : ED50 / TM42
-<BR> <epsg2325> : ED50 / TM45
-<BR> <epsg2326> : Hong Kong 1980 Grid System
-<BR> <epsg2327> : Xian 1980 / Gauss-Kruger zone 13
-<BR> <epsg2328> : Xian 1980 / Gauss-Kruger zone 14
-<BR> <epsg2329> : Xian 1980 / Gauss-Kruger zone 15
-<BR> <epsg2330> : Xian 1980 / Gauss-Kruger zone 16
-<BR> <epsg2331> : Xian 1980 / Gauss-Kruger zone 17
-<BR> <epsg2332> : Xian 1980 / Gauss-Kruger zone 18
-<BR> <epsg2333> : Xian 1980 / Gauss-Kruger zone 19
-<BR> <epsg2334> : Xian 1980 / Gauss-Kruger zone 20
-<BR> <epsg2335> : Xian 1980 / Gauss-Kruger zone 21
-<BR> <epsg2336> : Xian 1980 / Gauss-Kruger zone 22
-<BR> <epsg2337> : Xian 1980 / Gauss-Kruger zone 23
-<BR> <epsg2338> : Xian 1980 / Gauss-Kruger CM 75E
-<BR> <epsg2339> : Xian 1980 / Gauss-Kruger CM 81E
-<BR> <epsg2340> : Xian 1980 / Gauss-Kruger CM 87E
-<BR> <epsg2341> : Xian 1980 / Gauss-Kruger CM 93E
-<BR> <epsg2342> : Xian 1980 / Gauss-Kruger CM 99E
-<BR> <epsg2343> : Xian 1980 / Gauss-Kruger CM 105E
-<BR> <epsg2344> : Xian 1980 / Gauss-Kruger CM 111E
-<BR> <epsg2345> : Xian 1980 / Gauss-Kruger CM 117E
-<BR> <epsg2346> : Xian 1980 / Gauss-Kruger CM 123E
-<BR> <epsg2347> : Xian 1980 / Gauss-Kruger CM 129E
-<BR> <epsg2348> : Xian 1980 / Gauss-Kruger CM 135E
-<BR> <epsg2349> : Xian 1980 / 3-degree Gauss-Kruger zone 25
-<BR> <epsg2350> : Xian 1980 / 3-degree Gauss-Kruger zone 26
-<BR> <epsg2351> : Xian 1980 / 3-degree Gauss-Kruger zone 27
-<BR> <epsg2352> : Xian 1980 / 3-degree Gauss-Kruger zone 28
-<BR> <epsg2353> : Xian 1980 / 3-degree Gauss-Kruger zone 29
-<BR> <epsg2354> : Xian 1980 / 3-degree Gauss-Kruger zone 30
-<BR> <epsg2355> : Xian 1980 / 3-degree Gauss-Kruger zone 31
-<BR> <epsg2356> : Xian 1980 / 3-degree Gauss-Kruger zone 32
-<BR> <epsg2357> : Xian 1980 / 3-degree Gauss-Kruger zone 33
-<BR> <epsg2358> : Xian 1980 / 3-degree Gauss-Kruger zone 34
-<BR> <epsg2359> : Xian 1980 / 3-degree Gauss-Kruger zone 35
-<BR> <epsg2360> : Xian 1980 / 3-degree Gauss-Kruger zone 36
-<BR> <epsg2361> : Xian 1980 / 3-degree Gauss-Kruger zone 37
-<BR> <epsg2362> : Xian 1980 / 3-degree Gauss-Kruger zone 38
-<BR> <epsg2363> : Xian 1980 / 3-degree Gauss-Kruger zone 39
-<BR> <epsg2364> : Xian 1980 / 3-degree Gauss-Kruger zone 40
-<BR> <epsg2365> : Xian 1980 / 3-degree Gauss-Kruger zone 41
-<BR> <epsg2366> : Xian 1980 / 3-degree Gauss-Kruger zone 42
-<BR> <epsg2367> : Xian 1980 / 3-degree Gauss-Kruger zone 43
-<BR> <epsg2368> : Xian 1980 / 3-degree Gauss-Kruger zone 44
-<BR> <epsg2369> : Xian 1980 / 3-degree Gauss-Kruger zone 45
-<BR> <epsg2370> : Xian 1980 / 3-degree Gauss-Kruger CM 75E
-<BR> <epsg2371> : Xian 1980 / 3-degree Gauss-Kruger CM 78E
-<BR> <epsg2372> : Xian 1980 / 3-degree Gauss-Kruger CM 81E
-<BR> <epsg2373> : Xian 1980 / 3-degree Gauss-Kruger CM 84E
-<BR> <epsg2374> : Xian 1980 / 3-degree Gauss-Kruger CM 87E
-<BR> <epsg2375> : Xian 1980 / 3-degree Gauss-Kruger CM 90E
-<BR> <epsg2376> : Xian 1980 / 3-degree Gauss-Kruger CM 93E
-<BR> <epsg2377> : Xian 1980 / 3-degree Gauss-Kruger CM 96E
-<BR> <epsg2378> : Xian 1980 / 3-degree Gauss-Kruger CM 99E
-<BR> <epsg2379> : Xian 1980 / 3-degree Gauss-Kruger CM 102E
-<BR> <epsg2380> : Xian 1980 / 3-degree Gauss-Kruger CM 105E
-<BR> <epsg2381> : Xian 1980 / 3-degree Gauss-Kruger CM 108E
-<BR> <epsg2382> : Xian 1980 / 3-degree Gauss-Kruger CM 111E
-<BR> <epsg2383> : Xian 1980 / 3-degree Gauss-Kruger CM 114E
-<BR> <epsg2384> : Xian 1980 / 3-degree Gauss-Kruger CM 117E
-<BR> <epsg2385> : Xian 1980 / 3-degree Gauss-Kruger CM 120E
-<BR> <epsg2386> : Xian 1980 / 3-degree Gauss-Kruger CM 123E
-<BR> <epsg2387> : Xian 1980 / 3-degree Gauss-Kruger CM 126E
-<BR> <epsg2388> : Xian 1980 / 3-degree Gauss-Kruger CM 129E
-<BR> <epsg2389> : Xian 1980 / 3-degree Gauss-Kruger CM 132E
-<BR> <epsg2390> : Xian 1980 / 3-degree Gauss-Kruger CM 135E
-<BR> <epsg2391> : KKJ / Finland zone 1
-<BR> <epsg2392> : KKJ / Finland zone 2
-<BR> <epsg2393> : KKJ / Finland Uniform Coordinate System
-<BR> <epsg2394> : KKJ / Finland zone 4
-<BR> <epsg2395> : South Yemen / Gauss-Kruger zone 8
-<BR> <epsg2396> : South Yemen / Gauss-Kruger zone 9
-<BR> <epsg2397> : Pulkovo 1942(83) / Gauss-Kruger zone 3
-<BR> <epsg2398> : Pulkovo 1942(83) / Gauss-Kruger zone 4
-<BR> <epsg2399> : Pulkovo 1942(83) / Gauss-Kruger zone 5
-<BR> <epsg2400> : RT90 2.5 gon W (deprecated)
-<BR> <epsg2401> : Beijing 1954 / 3-degree Gauss-Kruger zone 25
-<BR> <epsg2402> : Beijing 1954 / 3-degree Gauss-Kruger zone 26
-<BR> <epsg2403> : Beijing 1954 / 3-degree Gauss-Kruger zone 27
-<BR> <epsg2404> : Beijing 1954 / 3-degree Gauss-Kruger zone 28
-<BR> <epsg2405> : Beijing 1954 / 3-degree Gauss-Kruger zone 29
-<BR> <epsg2406> : Beijing 1954 / 3-degree Gauss-Kruger zone 30
-<BR> <epsg2407> : Beijing 1954 / 3-degree Gauss-Kruger zone 31
-<BR> <epsg2408> : Beijing 1954 / 3-degree Gauss-Kruger zone 32
-<BR> <epsg2409> : Beijing 1954 / 3-degree Gauss-Kruger zone 33
-<BR> <epsg2410> : Beijing 1954 / 3-degree Gauss-Kruger zone 34
-<BR> <epsg2411> : Beijing 1954 / 3-degree Gauss-Kruger zone 35
-<BR> <epsg2412> : Beijing 1954 / 3-degree Gauss-Kruger zone 36
-<BR> <epsg2413> : Beijing 1954 / 3-degree Gauss-Kruger zone 37
-<BR> <epsg2414> : Beijing 1954 / 3-degree Gauss-Kruger zone 38
-<BR> <epsg2415> : Beijing 1954 / 3-degree Gauss-Kruger zone 39
-<BR> <epsg2416> : Beijing 1954 / 3-degree Gauss-Kruger zone 40
-<BR> <epsg2417> : Beijing 1954 / 3-degree Gauss-Kruger zone 41
-<BR> <epsg2418> : Beijing 1954 / 3-degree Gauss-Kruger zone 42
-<BR> <epsg2419> : Beijing 1954 / 3-degree Gauss-Kruger zone 43
-<BR> <epsg2420> : Beijing 1954 / 3-degree Gauss-Kruger zone 44
-<BR> <epsg2421> : Beijing 1954 / 3-degree Gauss-Kruger zone 45
-<BR> <epsg2422> : Beijing 1954 / 3-degree Gauss-Kruger CM 75E
-<BR> <epsg2423> : Beijing 1954 / 3-degree Gauss-Kruger CM 78E
-<BR> <epsg2424> : Beijing 1954 / 3-degree Gauss-Kruger CM 81E
-<BR> <epsg2425> : Beijing 1954 / 3-degree Gauss-Kruger CM 84E
-<BR> <epsg2426> : Beijing 1954 / 3-degree Gauss-Kruger CM 87E
-<BR> <epsg2427> : Beijing 1954 / 3-degree Gauss-Kruger CM 90E
-<BR> <epsg2428> : Beijing 1954 / 3-degree Gauss-Kruger CM 93E
-<BR> <epsg2429> : Beijing 1954 / 3-degree Gauss-Kruger CM 96E
-<BR> <epsg2430> : Beijing 1954 / 3-degree Gauss-Kruger CM 99E
-<BR> <epsg2431> : Beijing 1954 / 3-degree Gauss-Kruger CM 102E
-<BR> <epsg2432> : Beijing 1954 / 3-degree Gauss-Kruger CM 105E
-<BR> <epsg2433> : Beijing 1954 / 3-degree Gauss-Kruger CM 108E
-<BR> <epsg2434> : Beijing 1954 / 3-degree Gauss-Kruger CM 111E
-<BR> <epsg2435> : Beijing 1954 / 3-degree Gauss-Kruger CM 114E
-<BR> <epsg2436> : Beijing 1954 / 3-degree Gauss-Kruger CM 117E
-<BR> <epsg2437> : Beijing 1954 / 3-degree Gauss-Kruger CM 120E
-<BR> <epsg2438> : Beijing 1954 / 3-degree Gauss-Kruger CM 123E
-<BR> <epsg2439> : Beijing 1954 / 3-degree Gauss-Kruger CM 126E
-<BR> <epsg2440> : Beijing 1954 / 3-degree Gauss-Kruger CM 129E
-<BR> <epsg2441> : Beijing 1954 / 3-degree Gauss-Kruger CM 132E
-<BR> <epsg2442> : Beijing 1954 / 3-degree Gauss-Kruger CM 135E
-<BR> <epsg2443> : JGD2000 / Japan Plane Rectangular CS I
-<BR> <epsg2444> : JGD2000 / Japan Plane Rectangular CS II
-<BR> <epsg2445> : JGD2000 / Japan Plane Rectangular CS III
-<BR> <epsg2446> : JGD2000 / Japan Plane Rectangular CS IV
-<BR> <epsg2447> : JGD2000 / Japan Plane Rectangular CS V
-<BR> <epsg2448> : JGD2000 / Japan Plane Rectangular CS VI
-<BR> <epsg2449> : JGD2000 / Japan Plane Rectangular CS VII
-<BR> <epsg2450> : JGD2000 / Japan Plane Rectangular CS VIII
-<BR> <epsg2451> : JGD2000 / Japan Plane Rectangular CS IX
-<BR> <epsg2452> : JGD2000 / Japan Plane Rectangular CS X
-<BR> <epsg2453> : JGD2000 / Japan Plane Rectangular CS XI
-<BR> <epsg2454> : JGD2000 / Japan Plane Rectangular CS XII
-<BR> <epsg2455> : JGD2000 / Japan Plane Rectangular CS XIII
-<BR> <epsg2456> : JGD2000 / Japan Plane Rectangular CS XIV
-<BR> <epsg2457> : JGD2000 / Japan Plane Rectangular CS XV
-<BR> <epsg2458> : JGD2000 / Japan Plane Rectangular CS XVI
-<BR> <epsg2459> : JGD2000 / Japan Plane Rectangular CS XVII
-<BR> <epsg2460> : JGD2000 / Japan Plane Rectangular CS XVIII
-<BR> <epsg2461> : JGD2000 / Japan Plane Rectangular CS XIX
-<BR> <epsg2462> : Albanian 1987 / Gauss-Kruger zone 4
-<BR> <epsg2463> : Pulkovo 1995 / Gauss-Kruger CM 21E
-<BR> <epsg2464> : Pulkovo 1995 / Gauss-Kruger CM 27E
-<BR> <epsg2465> : Pulkovo 1995 / Gauss-Kruger CM 33E
-<BR> <epsg2466> : Pulkovo 1995 / Gauss-Kruger CM 39E
-<BR> <epsg2467> : Pulkovo 1995 / Gauss-Kruger CM 45E
-<BR> <epsg2468> : Pulkovo 1995 / Gauss-Kruger CM 51E
-<BR> <epsg2469> : Pulkovo 1995 / Gauss-Kruger CM 57E
-<BR> <epsg2470> : Pulkovo 1995 / Gauss-Kruger CM 63E
-<BR> <epsg2471> : Pulkovo 1995 / Gauss-Kruger CM 69E
-<BR> <epsg2472> : Pulkovo 1995 / Gauss-Kruger CM 75E
-<BR> <epsg2473> : Pulkovo 1995 / Gauss-Kruger CM 81E
-<BR> <epsg2474> : Pulkovo 1995 / Gauss-Kruger CM 87E
-<BR> <epsg2475> : Pulkovo 1995 / Gauss-Kruger CM 93E
-<BR> <epsg2476> : Pulkovo 1995 / Gauss-Kruger CM 99E
-<BR> <epsg2477> : Pulkovo 1995 / Gauss-Kruger CM 105E
-<BR> <epsg2478> : Pulkovo 1995 / Gauss-Kruger CM 111E
-<BR> <epsg2479> : Pulkovo 1995 / Gauss-Kruger CM 117E
-<BR> <epsg2480> : Pulkovo 1995 / Gauss-Kruger CM 123E
-<BR> <epsg2481> : Pulkovo 1995 / Gauss-Kruger CM 129E
-<BR> <epsg2482> : Pulkovo 1995 / Gauss-Kruger CM 135E
-<BR> <epsg2483> : Pulkovo 1995 / Gauss-Kruger CM 141E
-<BR> <epsg2484> : Pulkovo 1995 / Gauss-Kruger CM 147E
-<BR> <epsg2485> : Pulkovo 1995 / Gauss-Kruger CM 153E
-<BR> <epsg2486> : Pulkovo 1995 / Gauss-Kruger CM 159E
-<BR> <epsg2487> : Pulkovo 1995 / Gauss-Kruger CM 165E
-<BR> <epsg2488> : Pulkovo 1995 / Gauss-Kruger CM 171E
-<BR> <epsg2489> : Pulkovo 1995 / Gauss-Kruger CM 177E
-<BR> <epsg2490> : Pulkovo 1995 / Gauss-Kruger CM 177W
-<BR> <epsg2491> : Pulkovo 1995 / Gauss-Kruger CM 171W
-<BR> <epsg2492> : Pulkovo 1942 / Gauss-Kruger CM 9E
-<BR> <epsg2493> : Pulkovo 1942 / Gauss-Kruger CM 15E
-<BR> <epsg2494> : Pulkovo 1942 / Gauss-Kruger CM 21E
-<BR> <epsg2495> : Pulkovo 1942 / Gauss-Kruger CM 27E
-<BR> <epsg2496> : Pulkovo 1942 / Gauss-Kruger CM 33E
-<BR> <epsg2497> : Pulkovo 1942 / Gauss-Kruger CM 39E
-<BR> <epsg2498> : Pulkovo 1942 / Gauss-Kruger CM 45E
-<BR> <epsg2499> : Pulkovo 1942 / Gauss-Kruger CM 51E
-<BR> <epsg2500> : Pulkovo 1942 / Gauss-Kruger CM 57E
-<BR> <epsg2501> : Pulkovo 1942 / Gauss-Kruger CM 63E
-<BR> <epsg2502> : Pulkovo 1942 / Gauss-Kruger CM 69E
-<BR> <epsg2503> : Pulkovo 1942 / Gauss-Kruger CM 75E
-<BR> <epsg2504> : Pulkovo 1942 / Gauss-Kruger CM 81E
-<BR> <epsg2505> : Pulkovo 1942 / Gauss-Kruger CM 87E
-<BR> <epsg2506> : Pulkovo 1942 / Gauss-Kruger CM 93E
-<BR> <epsg2507> : Pulkovo 1942 / Gauss-Kruger CM 99E
-<BR> <epsg2508> : Pulkovo 1942 / Gauss-Kruger CM 105E
-<BR> <epsg2509> : Pulkovo 1942 / Gauss-Kruger CM 111E
-<BR> <epsg2510> : Pulkovo 1942 / Gauss-Kruger CM 117E
-<BR> <epsg2511> : Pulkovo 1942 / Gauss-Kruger CM 123E
-<BR> <epsg2512> : Pulkovo 1942 / Gauss-Kruger CM 129E
-<BR> <epsg2513> : Pulkovo 1942 / Gauss-Kruger CM 135E
-<BR> <epsg2514> : Pulkovo 1942 / Gauss-Kruger CM 141E
-<BR> <epsg2515> : Pulkovo 1942 / Gauss-Kruger CM 147E
-<BR> <epsg2516> : Pulkovo 1942 / Gauss-Kruger CM 153E
-<BR> <epsg2517> : Pulkovo 1942 / Gauss-Kruger CM 159E
-<BR> <epsg2518> : Pulkovo 1942 / Gauss-Kruger CM 165E
-<BR> <epsg2519> : Pulkovo 1942 / Gauss-Kruger CM 171E
-<BR> <epsg2520> : Pulkovo 1942 / Gauss-Kruger CM 177E
-<BR> <epsg2521> : Pulkovo 1942 / Gauss-Kruger CM 177W
-<BR> <epsg2522> : Pulkovo 1942 / Gauss-Kruger CM 171W
-<BR> <epsg2523> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 7
-<BR> <epsg2524> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 8
-<BR> <epsg2525> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 9
-<BR> <epsg2526> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 10
-<BR> <epsg2527> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 11
-<BR> <epsg2528> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 12
-<BR> <epsg2529> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 13
-<BR> <epsg2530> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 14
-<BR> <epsg2531> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 15
-<BR> <epsg2532> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 16
-<BR> <epsg2533> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 17
-<BR> <epsg2534> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 18
-<BR> <epsg2535> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 19
-<BR> <epsg2536> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 20
-<BR> <epsg2537> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 21
-<BR> <epsg2538> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 22
-<BR> <epsg2539> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 23
-<BR> <epsg2540> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 24
-<BR> <epsg2541> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 25
-<BR> <epsg2542> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 26
-<BR> <epsg2543> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 27
-<BR> <epsg2544> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 28
-<BR> <epsg2545> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 29
-<BR> <epsg2546> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 30
-<BR> <epsg2547> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 31
-<BR> <epsg2548> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 32
-<BR> <epsg2549> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 33
-<BR> <epsg2550> : Samboja / UTM zone 50S (deprecated)
-<BR> <epsg2551> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 34
-<BR> <epsg2552> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 35
-<BR> <epsg2553> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 36
-<BR> <epsg2554> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 37
-<BR> <epsg2555> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 38
-<BR> <epsg2556> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 39
-<BR> <epsg2557> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 40
-<BR> <epsg2558> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 41
-<BR> <epsg2559> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 42
-<BR> <epsg2560> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 43
-<BR> <epsg2561> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 44
-<BR> <epsg2562> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 45
-<BR> <epsg2563> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 46
-<BR> <epsg2564> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 47
-<BR> <epsg2565> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 48
-<BR> <epsg2566> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 49
-<BR> <epsg2567> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 50
-<BR> <epsg2568> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 51
-<BR> <epsg2569> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 52
-<BR> <epsg2570> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 53
-<BR> <epsg2571> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 54
-<BR> <epsg2572> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 55
-<BR> <epsg2573> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 56
-<BR> <epsg2574> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 57
-<BR> <epsg2575> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 58
-<BR> <epsg2576> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 59
-<BR> <epsg2577> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 60 (deprecated)
-<BR> <epsg2578> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 61
-<BR> <epsg2579> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 62
-<BR> <epsg2580> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 63
-<BR> <epsg2581> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 64
-<BR> <epsg2582> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 21E
-<BR> <epsg2583> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 24E
-<BR> <epsg2584> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 27E
-<BR> <epsg2585> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 30E
-<BR> <epsg2586> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 33E
-<BR> <epsg2587> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 36E
-<BR> <epsg2588> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 39E
-<BR> <epsg2589> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 42E
-<BR> <epsg2590> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 45E
-<BR> <epsg2591> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 48E
-<BR> <epsg2592> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 51E
-<BR> <epsg2593> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 54E
-<BR> <epsg2594> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 57E
-<BR> <epsg2595> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 60E
-<BR> <epsg2596> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 63E
-<BR> <epsg2597> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 66E
-<BR> <epsg2598> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 69E
-<BR> <epsg2599> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 72E
-<BR> <epsg2600> : Lietuvos Koordinoei Sistema 1994 (deprecated)
-<BR> <epsg2601> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 75E
-<BR> <epsg2602> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 78E
-<BR> <epsg2603> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 81E
-<BR> <epsg2604> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 84E
-<BR> <epsg2605> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 87E
-<BR> <epsg2606> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 90E
-<BR> <epsg2607> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 93E
-<BR> <epsg2608> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 96E
-<BR> <epsg2609> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 99E
-<BR> <epsg2610> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 102E
-<BR> <epsg2611> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 105E
-<BR> <epsg2612> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 108E
-<BR> <epsg2613> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 111E
-<BR> <epsg2614> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 114E
-<BR> <epsg2615> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 117E
-<BR> <epsg2616> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 120E
-<BR> <epsg2617> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 123E
-<BR> <epsg2618> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 126E
-<BR> <epsg2619> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 129E
-<BR> <epsg2620> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 132E
-<BR> <epsg2621> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 135E
-<BR> <epsg2622> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 138E
-<BR> <epsg2623> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 141E
-<BR> <epsg2624> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 144E
-<BR> <epsg2625> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 147E
-<BR> <epsg2626> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 150E
-<BR> <epsg2627> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 153E
-<BR> <epsg2628> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 156E
-<BR> <epsg2629> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 159E
-<BR> <epsg2630> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 162E
-<BR> <epsg2631> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 165E
-<BR> <epsg2632> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 168E
-<BR> <epsg2633> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 171E
-<BR> <epsg2634> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 174E
-<BR> <epsg2635> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 177E
-<BR> <epsg2636> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 180E
-<BR> <epsg2637> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 177W
-<BR> <epsg2638> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 174W
-<BR> <epsg2639> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 171W
-<BR> <epsg2640> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 168W
-<BR> <epsg2641> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 7
-<BR> <epsg2642> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 8
-<BR> <epsg2643> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 9
-<BR> <epsg2644> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 10
-<BR> <epsg2645> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 11
-<BR> <epsg2646> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 12
-<BR> <epsg2647> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 13
-<BR> <epsg2648> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 14
-<BR> <epsg2649> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 15
-<BR> <epsg2650> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 16
-<BR> <epsg2651> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 17
-<BR> <epsg2652> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 18
-<BR> <epsg2653> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 19
-<BR> <epsg2654> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 20
-<BR> <epsg2655> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 21
-<BR> <epsg2656> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 22
-<BR> <epsg2657> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 23
-<BR> <epsg2658> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 24
-<BR> <epsg2659> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 25
-<BR> <epsg2660> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 26
-<BR> <epsg2661> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 27
-<BR> <epsg2662> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 28
-<BR> <epsg2663> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 29
-<BR> <epsg2664> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 30
-<BR> <epsg2665> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 31
-<BR> <epsg2666> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 32
-<BR> <epsg2667> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 33
-<BR> <epsg2668> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 34
-<BR> <epsg2669> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 35
-<BR> <epsg2670> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 36
-<BR> <epsg2671> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 37
-<BR> <epsg2672> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 38
-<BR> <epsg2673> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 39
-<BR> <epsg2674> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 40
-<BR> <epsg2675> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 41
-<BR> <epsg2676> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 42
-<BR> <epsg2677> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 43
-<BR> <epsg2678> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 44
-<BR> <epsg2679> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 45
-<BR> <epsg2680> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 46
-<BR> <epsg2681> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 47
-<BR> <epsg2682> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 48
-<BR> <epsg2683> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 49
-<BR> <epsg2684> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 50
-<BR> <epsg2685> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 51
-<BR> <epsg2686> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 52
-<BR> <epsg2687> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 53
-<BR> <epsg2688> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 54
-<BR> <epsg2689> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 55
-<BR> <epsg2690> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 56
-<BR> <epsg2691> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 57
-<BR> <epsg2692> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 58
-<BR> <epsg2693> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 59
-<BR> <epsg2694> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 60 (deprecated)
-<BR> <epsg2695> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 61
-<BR> <epsg2696> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 62
-<BR> <epsg2697> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 63
-<BR> <epsg2698> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 64
-<BR> <epsg2699> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 21E
-<BR> <epsg2700> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 24E
-<BR> <epsg2701> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 27E
-<BR> <epsg2702> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 30E
-<BR> <epsg2703> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 33E
-<BR> <epsg2704> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 36E
-<BR> <epsg2705> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 39E
-<BR> <epsg2706> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 42E
-<BR> <epsg2707> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 45E
-<BR> <epsg2708> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 48E
-<BR> <epsg2709> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 51E
-<BR> <epsg2710> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 54E
-<BR> <epsg2711> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 57E
-<BR> <epsg2712> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 60E
-<BR> <epsg2713> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 63E
-<BR> <epsg2714> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 66E
-<BR> <epsg2715> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 69E
-<BR> <epsg2716> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 72E
-<BR> <epsg2717> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 75E
-<BR> <epsg2718> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 78E
-<BR> <epsg2719> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 81E
-<BR> <epsg2720> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 84E
-<BR> <epsg2721> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 87E
-<BR> <epsg2722> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 90E
-<BR> <epsg2723> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 93E
-<BR> <epsg2724> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 96E
-<BR> <epsg2725> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 99E
-<BR> <epsg2726> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 102E
-<BR> <epsg2727> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 105E
-<BR> <epsg2728> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 108E
-<BR> <epsg2729> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 111E
-<BR> <epsg2730> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 114E
-<BR> <epsg2731> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 117E
-<BR> <epsg2732> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 120E
-<BR> <epsg2733> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 123E
-<BR> <epsg2734> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 126E
-<BR> <epsg2735> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 129E
-<BR> <epsg2736> : Tete / UTM zone 36S
-<BR> <epsg2737> : Tete / UTM zone 37S
-<BR> <epsg2738> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 132E
-<BR> <epsg2739> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 135E
-<BR> <epsg2740> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 138E
-<BR> <epsg2741> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 141E
-<BR> <epsg2742> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 144E
-<BR> <epsg2743> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 147E
-<BR> <epsg2744> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 150E
-<BR> <epsg2745> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 153E
-<BR> <epsg2746> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 156E
-<BR> <epsg2747> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 159E
-<BR> <epsg2748> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 162E
-<BR> <epsg2749> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 165E
-<BR> <epsg2750> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 168E
-<BR> <epsg2751> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 171E
-<BR> <epsg2752> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 174E
-<BR> <epsg2753> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 177E
-<BR> <epsg2754> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 180E
-<BR> <epsg2755> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 177W
-<BR> <epsg2756> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 174W
-<BR> <epsg2757> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 171W
-<BR> <epsg2758> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 168W
-<BR> <epsg2759> : NAD83(HARN) / Alabama East
-<BR> <epsg2760> : NAD83(HARN) / Alabama West
-<BR> <epsg2761> : NAD83(HARN) / Arizona East
-<BR> <epsg2762> : NAD83(HARN) / Arizona Central
-<BR> <epsg2763> : NAD83(HARN) / Arizona West
-<BR> <epsg2764> : NAD83(HARN) / Arkansas North
-<BR> <epsg2765> : NAD83(HARN) / Arkansas South
-<BR> <epsg2766> : NAD83(HARN) / California zone 1
-<BR> <epsg2767> : NAD83(HARN) / California zone 2
-<BR> <epsg2768> : NAD83(HARN) / California zone 3
-<BR> <epsg2769> : NAD83(HARN) / California zone 4
-<BR> <epsg2770> : NAD83(HARN) / California zone 5
-<BR> <epsg2771> : NAD83(HARN) / California zone 6
-<BR> <epsg2772> : NAD83(HARN) / Colorado North
-<BR> <epsg2773> : NAD83(HARN) / Colorado Central
-<BR> <epsg2774> : NAD83(HARN) / Colorado South
-<BR> <epsg2775> : NAD83(HARN) / Connecticut
-<BR> <epsg2776> : NAD83(HARN) / Delaware
-<BR> <epsg2777> : NAD83(HARN) / Florida East
-<BR> <epsg2778> : NAD83(HARN) / Florida West
-<BR> <epsg2779> : NAD83(HARN) / Florida North
-<BR> <epsg2780> : NAD83(HARN) / Georgia East
-<BR> <epsg2781> : NAD83(HARN) / Georgia West
-<BR> <epsg2782> : NAD83(HARN) / Hawaii zone 1
-<BR> <epsg2783> : NAD83(HARN) / Hawaii zone 2
-<BR> <epsg2784> : NAD83(HARN) / Hawaii zone 3
-<BR> <epsg2785> : NAD83(HARN) / Hawaii zone 4
-<BR> <epsg2786> : NAD83(HARN) / Hawaii zone 5
-<BR> <epsg2787> : NAD83(HARN) / Idaho East
-<BR> <epsg2788> : NAD83(HARN) / Idaho Central
-<BR> <epsg2789> : NAD83(HARN) / Idaho West
-<BR> <epsg2790> : NAD83(HARN) / Illinois East
-<BR> <epsg2791> : NAD83(HARN) / Illinois West
-<BR> <epsg2792> : NAD83(HARN) / Indiana East
-<BR> <epsg2793> : NAD83(HARN) / Indiana West
-<BR> <epsg2794> : NAD83(HARN) / Iowa North
-<BR> <epsg2795> : NAD83(HARN) / Iowa South
-<BR> <epsg2796> : NAD83(HARN) / Kansas North
-<BR> <epsg2797> : NAD83(HARN) / Kansas South
-<BR> <epsg2798> : NAD83(HARN) / Kentucky North
-<BR> <epsg2799> : NAD83(HARN) / Kentucky South
-<BR> <epsg2800> : NAD83(HARN) / Louisiana North
-<BR> <epsg2801> : NAD83(HARN) / Louisiana South
-<BR> <epsg2802> : NAD83(HARN) / Maine East
-<BR> <epsg2803> : NAD83(HARN) / Maine West
-<BR> <epsg2804> : NAD83(HARN) / Maryland
-<BR> <epsg2805> : NAD83(HARN) / Massachusetts Mainland
-<BR> <epsg2806> : NAD83(HARN) / Massachusetts Island
-<BR> <epsg2807> : NAD83(HARN) / Michigan North
-<BR> <epsg2808> : NAD83(HARN) / Michigan Central
-<BR> <epsg2809> : NAD83(HARN) / Michigan South
-<BR> <epsg2810> : NAD83(HARN) / Minnesota North
-<BR> <epsg2811> : NAD83(HARN) / Minnesota Central
-<BR> <epsg2812> : NAD83(HARN) / Minnesota South
-<BR> <epsg2813> : NAD83(HARN) / Mississippi East
-<BR> <epsg2814> : NAD83(HARN) / Mississippi West
-<BR> <epsg2815> : NAD83(HARN) / Missouri East
-<BR> <epsg2816> : NAD83(HARN) / Missouri Central
-<BR> <epsg2817> : NAD83(HARN) / Missouri West
-<BR> <epsg2818> : NAD83(HARN) / Montana
-<BR> <epsg2819> : NAD83(HARN) / Nebraska
-<BR> <epsg2820> : NAD83(HARN) / Nevada East
-<BR> <epsg2821> : NAD83(HARN) / Nevada Central
-<BR> <epsg2822> : NAD83(HARN) / Nevada West
-<BR> <epsg2823> : NAD83(HARN) / New Hampshire
-<BR> <epsg2824> : NAD83(HARN) / New Jersey
-<BR> <epsg2825> : NAD83(HARN) / New Mexico East
-<BR> <epsg2826> : NAD83(HARN) / New Mexico Central
-<BR> <epsg2827> : NAD83(HARN) / New Mexico West
-<BR> <epsg2828> : NAD83(HARN) / New York East
-<BR> <epsg2829> : NAD83(HARN) / New York Central
-<BR> <epsg2830> : NAD83(HARN) / New York West
-<BR> <epsg2831> : NAD83(HARN) / New York Long Island
-<BR> <epsg2832> : NAD83(HARN) / North Dakota North
-<BR> <epsg2833> : NAD83(HARN) / North Dakota South
-<BR> <epsg2834> : NAD83(HARN) / Ohio North
-<BR> <epsg2835> : NAD83(HARN) / Ohio South
-<BR> <epsg2836> : NAD83(HARN) / Oklahoma North
-<BR> <epsg2837> : NAD83(HARN) / Oklahoma South
-<BR> <epsg2838> : NAD83(HARN) / Oregon North
-<BR> <epsg2839> : NAD83(HARN) / Oregon South
-<BR> <epsg2840> : NAD83(HARN) / Rhode Island
-<BR> <epsg2841> : NAD83(HARN) / South Dakota North
-<BR> <epsg2842> : NAD83(HARN) / South Dakota South
-<BR> <epsg2843> : NAD83(HARN) / Tennessee
-<BR> <epsg2844> : NAD83(HARN) / Texas North
-<BR> <epsg2845> : NAD83(HARN) / Texas North Central
-<BR> <epsg2846> : NAD83(HARN) / Texas Central
-<BR> <epsg2847> : NAD83(HARN) / Texas South Central
-<BR> <epsg2848> : NAD83(HARN) / Texas South
-<BR> <epsg2849> : NAD83(HARN) / Utah North
-<BR> <epsg2850> : NAD83(HARN) / Utah Central
-<BR> <epsg2851> : NAD83(HARN) / Utah South
-<BR> <epsg2852> : NAD83(HARN) / Vermont
-<BR> <epsg2853> : NAD83(HARN) / Virginia North
-<BR> <epsg2854> : NAD83(HARN) / Virginia South
-<BR> <epsg2855> : NAD83(HARN) / Washington North
-<BR> <epsg2856> : NAD83(HARN) / Washington South
-<BR> <epsg2857> : NAD83(HARN) / West Virginia North
-<BR> <epsg2858> : NAD83(HARN) / West Virginia South
-<BR> <epsg2859> : NAD83(HARN) / Wisconsin North
-<BR> <epsg2860> : NAD83(HARN) / Wisconsin Central
-<BR> <epsg2861> : NAD83(HARN) / Wisconsin South
-<BR> <epsg2862> : NAD83(HARN) / Wyoming East
-<BR> <epsg2863> : NAD83(HARN) / Wyoming East Central
-<BR> <epsg2864> : NAD83(HARN) / Wyoming West Central
-<BR> <epsg2865> : NAD83(HARN) / Wyoming West
-<BR> <epsg2866> : NAD83(HARN) / Puerto Rico & Virgin Is.
-<BR> <epsg2867> : NAD83(HARN) / Arizona East (ft)
-<BR> <epsg2868> : NAD83(HARN) / Arizona Central (ft)
-<BR> <epsg2869> : NAD83(HARN) / Arizona West (ft)
-<BR> <epsg2870> : NAD83(HARN) / California zone 1 (ftUS)
-<BR> <epsg2871> : NAD83(HARN) / California zone 2 (ftUS)
-<BR> <epsg2872> : NAD83(HARN) / California zone 3 (ftUS)
-<BR> <epsg2873> : NAD83(HARN) / California zone 4 (ftUS)
-<BR> <epsg2874> : NAD83(HARN) / California zone 5 (ftUS)
-<BR> <epsg2875> : NAD83(HARN) / California zone 6 (ftUS)
-<BR> <epsg2876> : NAD83(HARN) / Colorado North (ftUS)
-<BR> <epsg2877> : NAD83(HARN) / Colorado Central (ftUS)
-<BR> <epsg2878> : NAD83(HARN) / Colorado South (ftUS)
-<BR> <epsg2879> : NAD83(HARN) / Connecticut (ftUS)
-<BR> <epsg2880> : NAD83(HARN) / Delaware (ftUS)
-<BR> <epsg2881> : NAD83(HARN) / Florida East (ftUS)
-<BR> <epsg2882> : NAD83(HARN) / Florida West (ftUS)
-<BR> <epsg2883> : NAD83(HARN) / Florida North (ftUS)
-<BR> <epsg2884> : NAD83(HARN) / Georgia East (ftUS)
-<BR> <epsg2885> : NAD83(HARN) / Georgia West (ftUS)
-<BR> <epsg2886> : NAD83(HARN) / Idaho East (ftUS)
-<BR> <epsg2887> : NAD83(HARN) / Idaho Central (ftUS)
-<BR> <epsg2888> : NAD83(HARN) / Idaho West (ftUS)
-<BR> <epsg2889> : NAD83(HARN) / Indiana East (ftUS) (deprecated)
-<BR> <epsg2890> : NAD83(HARN) / Indiana West (ftUS) (deprecated)
-<BR> <epsg2891> : NAD83(HARN) / Kentucky North (ftUS)
-<BR> <epsg2892> : NAD83(HARN) / Kentucky South (ftUS)
-<BR> <epsg2893> : NAD83(HARN) / Maryland (ftUS)
-<BR> <epsg2894> : NAD83(HARN) / Massachusetts Mainland (ftUS)
-<BR> <epsg2895> : NAD83(HARN) / Massachusetts Island (ftUS)
-<BR> <epsg2896> : NAD83(HARN) / Michigan North (ft)
-<BR> <epsg2897> : NAD83(HARN) / Michigan Central (ft)
-<BR> <epsg2898> : NAD83(HARN) / Michigan South (ft)
-<BR> <epsg2899> : NAD83(HARN) / Mississippi East (ftUS)
-<BR> <epsg2900> : NAD83(HARN) / Mississippi West (ftUS)
-<BR> <epsg2901> : NAD83(HARN) / Montana (ft)
-<BR> <epsg2902> : NAD83(HARN) / New Mexico East (ftUS)
-<BR> <epsg2903> : NAD83(HARN) / New Mexico Central (ftUS)
-<BR> <epsg2904> : NAD83(HARN) / New Mexico West (ftUS)
-<BR> <epsg2905> : NAD83(HARN) / New York East (ftUS)
-<BR> <epsg2906> : NAD83(HARN) / New York Central (ftUS)
-<BR> <epsg2907> : NAD83(HARN) / New York West (ftUS)
-<BR> <epsg2908> : NAD83(HARN) / New York Long Island (ftUS)
-<BR> <epsg2909> : NAD83(HARN) / North Dakota North (ft)
-<BR> <epsg2910> : NAD83(HARN) / North Dakota South (ft)
-<BR> <epsg2911> : NAD83(HARN) / Oklahoma North (ftUS)
-<BR> <epsg2912> : NAD83(HARN) / Oklahoma South (ftUS)
-<BR> <epsg2913> : NAD83(HARN) / Oregon North (ft)
-<BR> <epsg2914> : NAD83(HARN) / Oregon South (ft)
-<BR> <epsg2915> : NAD83(HARN) / Tennessee (ftUS)
-<BR> <epsg2916> : NAD83(HARN) / Texas North (ftUS)
-<BR> <epsg2917> : NAD83(HARN) / Texas North Central (ftUS)
-<BR> <epsg2918> : NAD83(HARN) / Texas Central (ftUS)
-<BR> <epsg2919> : NAD83(HARN) / Texas South Central (ftUS)
-<BR> <epsg2920> : NAD83(HARN) / Texas South (ftUS)
-<BR> <epsg2921> : NAD83(HARN) / Utah North (ft)
-<BR> <epsg2922> : NAD83(HARN) / Utah Central (ft)
-<BR> <epsg2923> : NAD83(HARN) / Utah South (ft)
-<BR> <epsg2924> : NAD83(HARN) / Virginia North (ftUS)
-<BR> <epsg2925> : NAD83(HARN) / Virginia South (ftUS)
-<BR> <epsg2926> : NAD83(HARN) / Washington North (ftUS)
-<BR> <epsg2927> : NAD83(HARN) / Washington South (ftUS)
-<BR> <epsg2928> : NAD83(HARN) / Wisconsin North (ftUS)
-<BR> <epsg2929> : NAD83(HARN) / Wisconsin Central (ftUS)
-<BR> <epsg2930> : NAD83(HARN) / Wisconsin South (ftUS)
-<BR> <epsg2931> : Beduaram / TM 13 NE
-<BR> <epsg2932> : QND95 / Qatar National Grid
-<BR> <epsg2933> : Segara / UTM zone 50S
-<BR> <epsg2934> : Segara (Jakarta) / NEIEZ (deprecated)
-<BR> <epsg2935> : Pulkovo 1942 / CS63 zone A1
-<BR> <epsg2936> : Pulkovo 1942 / CS63 zone A2
-<BR> <epsg2937> : Pulkovo 1942 / CS63 zone A3
-<BR> <epsg2938> : Pulkovo 1942 / CS63 zone A4
-<BR> <epsg2939> : Pulkovo 1942 / CS63 zone K2
-<BR> <epsg2940> : Pulkovo 1942 / CS63 zone K3
-<BR> <epsg2941> : Pulkovo 1942 / CS63 zone K4
-<BR> <epsg2942> : Porto Santo / UTM zone 28N
-<BR> <epsg2943> : Selvagem Grande / UTM zone 28N
-<BR> <epsg2944> : NAD83(CSRS) / SCoPQ zone 2
-<BR> <epsg2945> : NAD83(CSRS) / MTM zone 3
-<BR> <epsg2946> : NAD83(CSRS) / MTM zone 4
-<BR> <epsg2947> : NAD83(CSRS) / MTM zone 5
-<BR> <epsg2948> : NAD83(CSRS) / MTM zone 6
-<BR> <epsg2949> : NAD83(CSRS) / MTM zone 7
-<BR> <epsg2950> : NAD83(CSRS) / MTM zone 8
-<BR> <epsg2951> : NAD83(CSRS) / MTM zone 9
-<BR> <epsg2952> : NAD83(CSRS) / MTM zone 10
-<BR> <epsg2953> : NAD83(CSRS) / New Brunswick Stereo
-<BR> <epsg2954> : NAD83(CSRS) / Prince Edward Isl. Stereographic (NAD83)
-<BR> <epsg2955> : NAD83(CSRS) / UTM zone 11N
-<BR> <epsg2956> : NAD83(CSRS) / UTM zone 12N
-<BR> <epsg2957> : NAD83(CSRS) / UTM zone 13N
-<BR> <epsg2958> : NAD83(CSRS) / UTM zone 17N
-<BR> <epsg2959> : NAD83(CSRS) / UTM zone 18N
-<BR> <epsg2960> : NAD83(CSRS) / UTM zone 19N
-<BR> <epsg2961> : NAD83(CSRS) / UTM zone 20N
-<BR> <epsg2962> : NAD83(CSRS) / UTM zone 21N
-<BR> <epsg2964> : NAD27 / Alaska Albers
-<BR> <epsg2965> : NAD83 / Indiana East (ftUS)
-<BR> <epsg2966> : NAD83 / Indiana West (ftUS)
-<BR> <epsg2967> : NAD83(HARN) / Indiana East (ftUS)
-<BR> <epsg2968> : NAD83(HARN) / Indiana West (ftUS)
-<BR> <epsg2969> : Fort Marigot / UTM zone 20N
-<BR> <epsg2970> : Guadeloupe 1948 / UTM zone 20N
-<BR> <epsg2971> : CSG67 / UTM zone 22N
-<BR> <epsg2972> : RGFG95 / UTM zone 22N
-<BR> <epsg2973> : Martinique 1938 / UTM zone 20N
-<BR> <epsg2975> : RGR92 / UTM zone 40S
-<BR> <epsg2976> : Tahiti 52 / UTM zone 6S
-<BR> <epsg2977> : Tahaa 54 / UTM zone 5S
-<BR> <epsg2978> : IGN72 Nuku Hiva / UTM zone 7S
-<BR> <epsg2979> : K0 1949 / UTM zone 42S (deprecated)
-<BR> <epsg2980> : Combani 1950 / UTM zone 38S
-<BR> <epsg2981> : IGN56 Lifou / UTM zone 58S
-<BR> <epsg2982> : IGN72 Grand Terre / UTM zone 58S (deprecated)
-<BR> <epsg2983> : ST87 Ouvea / UTM zone 58S (deprecated)
-<BR> <epsg2984> : RGNC 1991 / Lambert New Caledonia (deprecated)
-<BR> <epsg2987> : Saint Pierre et Miquelon 1950 / UTM zone 21N
-<BR> <epsg2988> : MOP78 / UTM zone 1S
-<BR> <epsg2989> : RRAF 1991 / UTM zone 20N
-<BR> <epsg2990> : Reunion 1947 / TM Reunion (deprecated)
-<BR> <epsg2991> : NAD83 / Oregon Lambert
-<BR> <epsg2992> : NAD83 / Oregon Lambert (ft)
-<BR> <epsg2993> : NAD83(HARN) / Oregon Lambert
-<BR> <epsg2994> : NAD83(HARN) / Oregon Lambert (ft)
-<BR> <epsg2995> : IGN53 Mare / UTM zone 58S
-<BR> <epsg2996> : ST84 Ile des Pins / UTM zone 58S
-<BR> <epsg2997> : ST71 Belep / UTM zone 58S
-<BR> <epsg2998> : NEA74 Noumea / UTM zone 58S
-<BR> <epsg2999> : Grand Comoros / UTM zone 38S
-<BR> <epsg3000> : Segara / NEIEZ
-<BR> <epsg3001> : Batavia / NEIEZ
-<BR> <epsg3002> : Makassar / NEIEZ
-<BR> <epsg3003> : Monte Mario / Italy zone 1
-<BR> <epsg3004> : Monte Mario / Italy zone 2
-<BR> <epsg3005> : NAD83 / BC Albers
-<BR> <epsg3006> : SWEREF99 TM
-<BR> <epsg3007> : SWEREF99 12 00
-<BR> <epsg3008> : SWEREF99 13 30
-<BR> <epsg3009> : SWEREF99 15 00
-<BR> <epsg3010> : SWEREF99 16 30
-<BR> <epsg3011> : SWEREF99 18 00
-<BR> <epsg3012> : SWEREF99 14 15
-<BR> <epsg3013> : SWEREF99 15 45
-<BR> <epsg3014> : SWEREF99 17 15
-<BR> <epsg3015> : SWEREF99 18 45
-<BR> <epsg3016> : SWEREF99 20 15
-<BR> <epsg3017> : SWEREF99 21 45
-<BR> <epsg3018> : SWEREF99 23 15
-<BR> <epsg3019> : RT90 7.5 gon V
-<BR> <epsg3020> : RT90 5 gon V
-<BR> <epsg3021> : RT90 2.5 gon V
-<BR> <epsg3022> : RT90 0 gon
-<BR> <epsg3023> : RT90 2.5 gon O
-<BR> <epsg3024> : RT90 5 gon O
-<BR> <epsg3025> : RT38 7.5 gon V
-<BR> <epsg3026> : RT38 5 gon V
-<BR> <epsg3027> : RT38 2.5 gon V
-<BR> <epsg3028> : RT38 0 gon
-<BR> <epsg3029> : RT38 2.5 gon O
-<BR> <epsg3030> : RT38 5 gon O
-<BR> <epsg3031> : WGS 84 / Antarctic Polar Stereographic
-<BR> <epsg3032> : WGS 84 / Australian Antarctic Polar Stereographic
-<BR> <epsg3033> : WGS 84 / Australian Antarctic Lambert
-<BR> <epsg3034> : ETRS89 / ETRS-LCC
-<BR> <epsg3035> : ETRS89 / ETRS-LAEA
-<BR> <epsg3036> : Moznet / UTM zone 36S
-<BR> <epsg3037> : Moznet / UTM zone 37S
-<BR> <epsg3038> : ETRS89 / ETRS-TM26
-<BR> <epsg3039> : ETRS89 / ETRS-TM27
-<BR> <epsg3040> : ETRS89 / ETRS-TM28
-<BR> <epsg3041> : ETRS89 / ETRS-TM29
-<BR> <epsg3042> : ETRS89 / ETRS-TM30
-<BR> <epsg3043> : ETRS89 / ETRS-TM31
-<BR> <epsg3044> : ETRS89 / ETRS-TM32
-<BR> <epsg3045> : ETRS89 / ETRS-TM33
-<BR> <epsg3046> : ETRS89 / ETRS-TM34
-<BR> <epsg3047> : ETRS89 / ETRS-TM35
-<BR> <epsg3048> : ETRS89 / ETRS-TM36
-<BR> <epsg3049> : ETRS89 / ETRS-TM37
-<BR> <epsg3050> : ETRS89 / ETRS-TM38
-<BR> <epsg3051> : ETRS89 / ETRS-TM39
-<BR> <epsg3054> : Hjorsey 1955 / UTM zone 26N
-<BR> <epsg3055> : Hjorsey 1955 / UTM zone 27N
-<BR> <epsg3056> : Hjorsey 1955 / UTM zone 28N
-<BR> <epsg3057> : ISN93 / Lambert 1993
-<BR> <epsg3058> : Helle 1954 / Jan Mayen Grid
-<BR> <epsg3059> : LKS92 / Latvia TM
-<BR> <epsg3060> : IGN72 Grande Terre / UTM zone 58S
-<BR> <epsg3061> : Porto Santo 1995 / UTM zone 28N
-<BR> <epsg3062> : Azores Oriental 1995 / UTM zone 26N
-<BR> <epsg3063> : Azores Central 1995 / UTM zone 26N
-<BR> <epsg3064> : IGM95 / UTM zone 32N
-<BR> <epsg3065> : IGM95 / UTM zone 33N
-<BR> <epsg3066> : ED50 / Jordan TM
-<BR> <epsg3067> : ETRS89 / ETRS-TM35FIN
-<BR> <epsg3068> : DHDN / Soldner Berlin
-<BR> <epsg3069> : NAD27 / Wisconsin Transverse Mercator
-<BR> <epsg3070> : NAD83 / Wisconsin Transverse Mercator
-<BR> <epsg3071> : NAD83(HARN) / Wisconsin Transverse Mercator
-<BR> <epsg3072> : NAD83 / Maine CS2000 East
-<BR> <epsg3073> : NAD83 / Maine CS2000 Central (deprecated)
-<BR> <epsg3074> : NAD83 / Maine CS2000 West
-<BR> <epsg3075> : NAD83(HARN) / Maine CS2000 East
-<BR> <epsg3076> : NAD83(HARN) / Maine CS2000 Central (deprecated)
-<BR> <epsg3077> : NAD83(HARN) / Maine CS2000 West
-<BR> <epsg3078> : NAD83 / Michigan Oblique Mercator
-<BR> <epsg3079> : NAD83(HARN) / Michigan Oblique Mercator
-<BR> <epsg3080> : NAD27 / Shackleford
-<BR> <epsg3081> : NAD83 / Texas State Mapping System
-<BR> <epsg3082> : NAD83 / Texas Centric Lambert Conformal
-<BR> <epsg3083> : NAD83 / Texas Centric Albers Equal Area
-<BR> <epsg3084> : NAD83(HARN) / Texas Centric Lambert Conformal
-<BR> <epsg3085> : NAD83(HARN) / Texas Centric Albers Equal Area
-<BR> <epsg3086> : NAD83 / Florida GDL Albers
-<BR> <epsg3087> : NAD83(HARN) / Florida GDL Albers
-<BR> <epsg3088> : NAD83 / Kentucky Single Zone
-<BR> <epsg3089> : NAD83 / Kentucky Single Zone (ftUS)
-<BR> <epsg3090> : NAD83(HARN) / Kentucky Single Zone
-<BR> <epsg3091> : NAD83(HARN) / Kentucky Single Zone (ftUS)
-<BR> <epsg3092> : Tokyo / UTM zone 51N
-<BR> <epsg3093> : Tokyo / UTM zone 52N
-<BR> <epsg3094> : Tokyo / UTM zone 53N
-<BR> <epsg3095> : Tokyo / UTM zone 54N
-<BR> <epsg3096> : Tokyo / UTM zone 55N
-<BR> <epsg3097> : JGD2000 / UTM zone 51N
-<BR> <epsg3098> : JGD2000 / UTM zone 52N
-<BR> <epsg3099> : JGD2000 / UTM zone 53N
-<BR> <epsg3100> : JGD2000 / UTM zone 54N
-<BR> <epsg3101> : JGD2000 / UTM zone 55N
-<BR> <epsg3102> : American Samoa 1962 / American Samoa Lambert
-<BR> <epsg3103> : Mauritania 1999 / UTM zone 28N (deprecated)
-<BR> <epsg3104> : Mauritania 1999 / UTM zone 29N (deprecated)
-<BR> <epsg3105> : Mauritania 1999 / UTM zone 30N (deprecated)
-<BR> <epsg3106> : Gulshan 303 / Bangladesh Transverse Mercator
-<BR> <epsg3107> : GDA94 / SA Lambert
-<BR> <epsg3108> : ETRS89 / Guernsey Grid
-<BR> <epsg3109> : ETRS89 / Jersey Transverse Mercator
-<BR> <epsg3110> : AGD66 / Vicgrid66
-<BR> <epsg3111> : GDA94 / Vicgrid94
-<BR> <epsg3112> : GDA94 / Geoscience Australia Lambert
-<BR> <epsg3113> : GDA94 / BCSG02
-<BR> <epsg3114> : MAGNA-SIRGAS / Colombia Far West zone
-<BR> <epsg3115> : MAGNA-SIRGAS / Colombia West zone
-<BR> <epsg3116> : MAGNA-SIRGAS / Colombia Bogota zone
-<BR> <epsg3117> : MAGNA-SIRGAS / Colombia East Central zone
-<BR> <epsg3118> : MAGNA-SIRGAS / Colombia East zone
-<BR> <epsg3119> : Douala 1948 / AEF west
-<BR> <epsg3120> : Pulkovo 1942(58) / Poland zone I
-<BR> <epsg3121> : PRS92 / Philippines zone 1
-<BR> <epsg3122> : PRS92 / Philippines zone 2
-<BR> <epsg3123> : PRS92 / Philippines zone 3
-<BR> <epsg3124> : PRS92 / Philippines zone 4
-<BR> <epsg3125> : PRS92 / Philippines zone 5
-<BR> <epsg3126> : ETRS89 / ETRS-GK19FIN
-<BR> <epsg3127> : ETRS89 / ETRS-GK20FIN
-<BR> <epsg3128> : ETRS89 / ETRS-GK21FIN
-<BR> <epsg3129> : ETRS89 / ETRS-GK22FIN
-<BR> <epsg3130> : ETRS89 / ETRS-GK23FIN
-<BR> <epsg3131> : ETRS89 / ETRS-GK24FIN
-<BR> <epsg3132> : ETRS89 / ETRS-GK25FIN
-<BR> <epsg3133> : ETRS89 / ETRS-GK26FIN
-<BR> <epsg3134> : ETRS89 / ETRS-GK27FIN
-<BR> <epsg3135> : ETRS89 / ETRS-GK28FIN
-<BR> <epsg3136> : ETRS89 / ETRS-GK29FIN
-<BR> <epsg3137> : ETRS89 / ETRS-GK30FIN
-<BR> <epsg3138> : ETRS89 / ETRS-GK31FIN
-<BR> <epsg3140> : Viti Levu 1912 / Viti Levu Grid
-<BR> <epsg3141> : Fiji 1956 / UTM zone 60S
-<BR> <epsg3142> : Fiji 1956 / UTM zone 1S
-<BR> <epsg3143> : Fiji 1986 / Fiji Map Grid (deprecated)
-<BR> <epsg3146> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 6
-<BR> <epsg3147> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 18E
-<BR> <epsg3148> : Indian 1960 / UTM zone 48N
-<BR> <epsg3149> : Indian 1960 / UTM zone 49N
-<BR> <epsg3150> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 6
-<BR> <epsg3151> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 18E
-<BR> <epsg3152> : ST74
-<BR> <epsg3153> : NAD83(CSRS) / BC Albers
-<BR> <epsg3154> : NAD83(CSRS) / UTM zone 7N
-<BR> <epsg3155> : NAD83(CSRS) / UTM zone 8N
-<BR> <epsg3156> : NAD83(CSRS) / UTM zone 9N
-<BR> <epsg3157> : NAD83(CSRS) / UTM zone 10N
-<BR> <epsg3158> : NAD83(CSRS) / UTM zone 14N
-<BR> <epsg3159> : NAD83(CSRS) / UTM zone 15N
-<BR> <epsg3160> : NAD83(CSRS) / UTM zone 16N
-<BR> <epsg3161> : NAD83 / Ontario MNR Lambert
-<BR> <epsg3162> : NAD83(CSRS) / Ontario MNR Lambert
-<BR> <epsg3163> : RGNC91-93 / Lambert New Caledonia
-<BR> <epsg3164> : ST87 Ouvea / UTM zone 58S
-<BR> <epsg3165> : NEA74 Noumea / Noumea Lambert
-<BR> <epsg3166> : NEA74 Noumea / Noumea Lambert 2
-<BR> <epsg3167> : Kertau (RSO) / RSO Malaya (ch)
-<BR> <epsg3168> : Kertau (RSO) / RSO Malaya (m)
-<BR> <epsg3169> : RGNC91-93 / UTM zone 57S
-<BR> <epsg3170> : RGNC91-93 / UTM zone 58S
-<BR> <epsg3171> : RGNC91-93 / UTM zone 59S
-<BR> <epsg3172> : IGN53 Mare / UTM zone 59S
-<BR> <epsg3174> : NAD83 / Great Lakes Albers
-<BR> <epsg3175> : NAD83 / Great Lakes and St Lawrence Albers
-<BR> <epsg3176> : Indian 1960 / TM 106 NE
-<BR> <epsg3177> : LGD2006 / Libya TM
-<BR> <epsg3178> : GR96 / UTM zone 18N
-<BR> <epsg3179> : GR96 / UTM zone 19N
-<BR> <epsg3180> : GR96 / UTM zone 20N
-<BR> <epsg3181> : GR96 / UTM zone 21N
-<BR> <epsg3182> : GR96 / UTM zone 22N
-<BR> <epsg3183> : GR96 / UTM zone 23N
-<BR> <epsg3184> : GR96 / UTM zone 24N
-<BR> <epsg3185> : GR96 / UTM zone 25N
-<BR> <epsg3186> : GR96 / UTM zone 26N
-<BR> <epsg3187> : GR96 / UTM zone 27N
-<BR> <epsg3188> : GR96 / UTM zone 28N
-<BR> <epsg3189> : GR96 / UTM zone 29N
-<BR> <epsg3190> : LGD2006 / Libya TM zone 5
-<BR> <epsg3191> : LGD2006 / Libya TM zone 6
-<BR> <epsg3192> : LGD2006 / Libya TM zone 7
-<BR> <epsg3193> : LGD2006 / Libya TM zone 8
-<BR> <epsg3194> : LGD2006 / Libya TM zone 9
-<BR> <epsg3195> : LGD2006 / Libya TM zone 10
-<BR> <epsg3196> : LGD2006 / Libya TM zone 11
-<BR> <epsg3197> : LGD2006 / Libya TM zone 12
-<BR> <epsg3198> : LGD2006 / Libya TM zone 13
-<BR> <epsg3199> : LGD2006 / UTM zone 32N
-<BR> <epsg3200> : FD58 / Iraq zone
-<BR> <epsg3201> : LGD2006 / UTM zone 33N
-<BR> <epsg3202> : LGD2006 / UTM zone 34N
-<BR> <epsg3203> : LGD2006 / UTM zone 35N
-<BR> <epsg3204> : WGS 84 / SCAR IMW SP19-20
-<BR> <epsg3205> : WGS 84 / SCAR IMW SP21-22
-<BR> <epsg3206> : WGS 84 / SCAR IMW SP23-24
-<BR> <epsg3207> : WGS 84 / SCAR IMW SQ01-02
-<BR> <epsg3208> : WGS 84 / SCAR IMW SQ19-20
-<BR> <epsg3209> : WGS 84 / SCAR IMW SQ21-22
-<BR> <epsg3210> : WGS 84 / SCAR IMW SQ37-38
-<BR> <epsg3211> : WGS 84 / SCAR IMW SQ39-40
-<BR> <epsg3212> : WGS 84 / SCAR IMW SQ41-42
-<BR> <epsg3213> : WGS 84 / SCAR IMW SQ43-44
-<BR> <epsg3214> : WGS 84 / SCAR IMW SQ45-46
-<BR> <epsg3215> : WGS 84 / SCAR IMW SQ47-48
-<BR> <epsg3216> : WGS 84 / SCAR IMW SQ49-50
-<BR> <epsg3217> : WGS 84 / SCAR IMW SQ51-52
-<BR> <epsg3218> : WGS 84 / SCAR IMW SQ53-54
-<BR> <epsg3219> : WGS 84 / SCAR IMW SQ55-56
-<BR> <epsg3220> : WGS 84 / SCAR IMW SQ57-58
-<BR> <epsg3221> : WGS 84 / SCAR IMW SR13-14
-<BR> <epsg3222> : WGS 84 / SCAR IMW SR15-16
-<BR> <epsg3223> : WGS 84 / SCAR IMW SR17-18
-<BR> <epsg3224> : WGS 84 / SCAR IMW SR19-20
-<BR> <epsg3225> : WGS 84 / SCAR IMW SR27-28
-<BR> <epsg3226> : WGS 84 / SCAR IMW SR29-30
-<BR> <epsg3227> : WGS 84 / SCAR IMW SR31-32
-<BR> <epsg3228> : WGS 84 / SCAR IMW SR33-34
-<BR> <epsg3229> : WGS 84 / SCAR IMW SR35-36
-<BR> <epsg3230> : WGS 84 / SCAR IMW SR37-38
-<BR> <epsg3231> : WGS 84 / SCAR IMW SR39-40
-<BR> <epsg3232> : WGS 84 / SCAR IMW SR41-42
-<BR> <epsg3233> : WGS 84 / SCAR IMW SR43-44
-<BR> <epsg3234> : WGS 84 / SCAR IMW SR45-46
-<BR> <epsg3235> : WGS 84 / SCAR IMW SR47-48
-<BR> <epsg3236> : WGS 84 / SCAR IMW SR49-50
-<BR> <epsg3237> : WGS 84 / SCAR IMW SR51-52
-<BR> <epsg3238> : WGS 84 / SCAR IMW SR53-54
-<BR> <epsg3239> : WGS 84 / SCAR IMW SR55-56
-<BR> <epsg3240> : WGS 84 / SCAR IMW SR57-58
-<BR> <epsg3241> : WGS 84 / SCAR IMW SR59-60
-<BR> <epsg3242> : WGS 84 / SCAR IMW SS04-06
-<BR> <epsg3243> : WGS 84 / SCAR IMW SS07-09
-<BR> <epsg3244> : WGS 84 / SCAR IMW SS10-12
-<BR> <epsg3245> : WGS 84 / SCAR IMW SS13-15
-<BR> <epsg3246> : WGS 84 / SCAR IMW SS16-18
-<BR> <epsg3247> : WGS 84 / SCAR IMW SS19-21
-<BR> <epsg3248> : WGS 84 / SCAR IMW SS25-27
-<BR> <epsg3249> : WGS 84 / SCAR IMW SS28-30
-<BR> <epsg3250> : WGS 84 / SCAR IMW SS31-33
-<BR> <epsg3251> : WGS 84 / SCAR IMW SS34-36
-<BR> <epsg3252> : WGS 84 / SCAR IMW SS37-39
-<BR> <epsg3253> : WGS 84 / SCAR IMW SS40-42
-<BR> <epsg3254> : WGS 84 / SCAR IMW SS43-45
-<BR> <epsg3255> : WGS 84 / SCAR IMW SS46-48
-<BR> <epsg3256> : WGS 84 / SCAR IMW SS49-51
-<BR> <epsg3257> : WGS 84 / SCAR IMW SS52-54
-<BR> <epsg3258> : WGS 84 / SCAR IMW SS55-57
-<BR> <epsg3259> : WGS 84 / SCAR IMW SS58-60
-<BR> <epsg3260> : WGS 84 / SCAR IMW ST01-04
-<BR> <epsg3261> : WGS 84 / SCAR IMW ST05-08
-<BR> <epsg3262> : WGS 84 / SCAR IMW ST09-12
-<BR> <epsg3263> : WGS 84 / SCAR IMW ST13-16
-<BR> <epsg3264> : WGS 84 / SCAR IMW ST17-20
-<BR> <epsg3265> : WGS 84 / SCAR IMW ST21-24
-<BR> <epsg3266> : WGS 84 / SCAR IMW ST25-28
-<BR> <epsg3267> : WGS 84 / SCAR IMW ST29-32
-<BR> <epsg3268> : WGS 84 / SCAR IMW ST33-36
-<BR> <epsg3269> : WGS 84 / SCAR IMW ST37-40
-<BR> <epsg3270> : WGS 84 / SCAR IMW ST41-44
-<BR> <epsg3271> : WGS 84 / SCAR IMW ST45-48
-<BR> <epsg3272> : WGS 84 / SCAR IMW ST49-52
-<BR> <epsg3273> : WGS 84 / SCAR IMW ST53-56
-<BR> <epsg3274> : WGS 84 / SCAR IMW ST57-60
-<BR> <epsg3275> : WGS 84 / SCAR IMW SU01-05
-<BR> <epsg3276> : WGS 84 / SCAR IMW SU06-10
-<BR> <epsg3277> : WGS 84 / SCAR IMW SU11-15
-<BR> <epsg3278> : WGS 84 / SCAR IMW SU16-20
-<BR> <epsg3279> : WGS 84 / SCAR IMW SU21-25
-<BR> <epsg3280> : WGS 84 / SCAR IMW SU26-30
-<BR> <epsg3281> : WGS 84 / SCAR IMW SU31-35
-<BR> <epsg3282> : WGS 84 / SCAR IMW SU36-40
-<BR> <epsg3283> : WGS 84 / SCAR IMW SU41-45
-<BR> <epsg3284> : WGS 84 / SCAR IMW SU46-50
-<BR> <epsg3285> : WGS 84 / SCAR IMW SU51-55
-<BR> <epsg3286> : WGS 84 / SCAR IMW SU56-60
-<BR> <epsg3287> : WGS 84 / SCAR IMW SV01-10
-<BR> <epsg3288> : WGS 84 / SCAR IMW SV11-20
-<BR> <epsg3289> : WGS 84 / SCAR IMW SV21-30
-<BR> <epsg3290> : WGS 84 / SCAR IMW SV31-40
-<BR> <epsg3291> : WGS 84 / SCAR IMW SV41-50
-<BR> <epsg3292> : WGS 84 / SCAR IMW SV51-60
-<BR> <epsg3293> : WGS 84 / SCAR IMW SW01-60
-<BR> <epsg3294> : WGS 84 / USGS Transantarctic Mountains
-<BR> <epsg3296> : RGPF / UTM zone 5S
-<BR> <epsg3297> : RGPF / UTM zone 6S
-<BR> <epsg3298> : RGPF / UTM zone 7S
-<BR> <epsg3299> : RGPF / UTM zone 8S
-<BR> <epsg3300> : Estonian Coordinate System of 1992
-<BR> <epsg3301> : Estonian Coordinate System of 1997
-<BR> <epsg3302> : IGN63 Hiva Oa / UTM zone 7S
-<BR> <epsg3303> : Fatu Iva 72 / UTM zone 7S
-<BR> <epsg3304> : Tahiti 79 / UTM zone 6S
-<BR> <epsg3305> : Moorea 87 / UTM zone 6S
-<BR> <epsg3306> : Maupiti 83 / UTM zone 5S
-<BR> <epsg3307> : Nakhl-e Ghanem / UTM zone 39N
-<BR> <epsg3308> : GDA94 / NSW Lambert
-<BR> <epsg3309> : NAD27 / California Albers
-<BR> <epsg3310> : NAD83 / California Albers
-<BR> <epsg3311> : NAD83(HARN) / California Albers
-<BR> <epsg3312> : CSG67 / UTM zone 21N
-<BR> <epsg3313> : RGFG95 / UTM zone 21N
-<BR> <epsg3314> : Katanga 1955 / Katanga Lambert
-<BR> <epsg3315> : Katanga 1955 / Katanga TM
-<BR> <epsg3316> : Kasai 1953 / Congo TM zone 22
-<BR> <epsg3317> : Kasai 1953 / Congo TM zone 24
-<BR> <epsg3318> : IGC 1962 / Congo TM zone 12
-<BR> <epsg3319> : IGC 1962 / Congo TM zone 14
-<BR> <epsg3320> : IGC 1962 / Congo TM zone 16
-<BR> <epsg3321> : IGC 1962 / Congo TM zone 18
-<BR> <epsg3322> : IGC 1962 / Congo TM zone 20
-<BR> <epsg3323> : IGC 1962 / Congo TM zone 22
-<BR> <epsg3324> : IGC 1962 / Congo TM zone 24
-<BR> <epsg3325> : IGC 1962 / Congo TM zone 26
-<BR> <epsg3326> : IGC 1962 / Congo TM zone 28
-<BR> <epsg3327> : IGC 1962 / Congo TM zone 30
-<BR> <epsg3328> : Pulkovo 1942(58) / GUGiK-80
-<BR> <epsg3329> : Pulkovo 1942(58) / 3-degree Gauss-Kruger zone 5
-<BR> <epsg3330> : Pulkovo 1942(58) / 3-degree Gauss-Kruger zone 6
-<BR> <epsg3331> : Pulkovo 1942(58) / 3-degree Gauss-Kruger zone 7
-<BR> <epsg3332> : Pulkovo 1942(58) / 3-degree Gauss-Kruger zone 8
-<BR> <epsg3333> : Pulkovo 1942(58) / Gauss-Kruger zone 3
-<BR> <epsg3334> : Pulkovo 1942(58) / Gauss-Kruger zone 4
-<BR> <epsg3335> : Pulkovo 1942(58) / Gauss-Kruger zone 5
-<BR> <epsg3336> : IGN 1962 Kerguelen / UTM zone 42S
-<BR> <epsg3337> : Le Pouce 1934 / Mauritius Grid
-<BR> <epsg3338> : NAD83 / Alaska Albers
-<BR> <epsg3339> : IGCB 1955 / Congo TM zone 12
-<BR> <epsg3340> : IGCB 1955 / Congo TM zone 14
-<BR> <epsg3341> : IGCB 1955 / Congo TM zone 16
-<BR> <epsg3342> : IGCB 1955 / UTM zone 33S
-<BR> <epsg3343> : Mauritania 1999 / UTM zone 28N
-<BR> <epsg3344> : Mauritania 1999 / UTM zone 29N
-<BR> <epsg3345> : Mauritania 1999 / UTM zone 30N
-<BR> <epsg3346> : LKS94 / Lithuania TM
-<BR> <epsg3347> : NAD83 / Statistics Canada Lambert
-<BR> <epsg3348> : NAD83(CSRS) / Statistics Canada Lambert
-<BR> <epsg3349> : WGS 84 / PDC Mercator
-<BR> <epsg3350> : Pulkovo 1942 / CS63 zone C0
-<BR> <epsg3351> : Pulkovo 1942 / CS63 zone C1
-<BR> <epsg3352> : Pulkovo 1942 / CS63 zone C2
-<BR> <epsg3353> : Mhast (onshore) / UTM zone 32S
-<BR> <epsg3354> : Mhast (offshore) / UTM zone 32S
-<BR> <epsg3355> : Egypt Gulf of Suez S-650 TL / Red Belt
-<BR> <epsg3356> : Grand Cayman 1959 / UTM zone 17N
-<BR> <epsg3357> : Little Cayman 1961 / UTM zone 17N
-<BR> <epsg3358> : NAD83(HARN) / North Carolina
-<BR> <epsg3359> : NAD83(HARN) / North Carolina (ftUS) (deprecated)
-<BR> <epsg3360> : NAD83(HARN) / South Carolina
-<BR> <epsg3361> : NAD83(HARN) / South Carolina (ft)
-<BR> <epsg3362> : NAD83(HARN) / Pennsylvania North
-<BR> <epsg3363> : NAD83(HARN) / Pennsylvania North (ftUS)
-<BR> <epsg3364> : NAD83(HARN) / Pennsylvania South
-<BR> <epsg3365> : NAD83(HARN) / Pennsylvania South (ftUS)
-<BR> <epsg3366> : Hong Kong 1963 Grid System (deprecated)
-<BR> <epsg3367> : IGN Astro 1960 / UTM zone 28N
-<BR> <epsg3368> : IGN Astro 1960 / UTM zone 29N
-<BR> <epsg3369> : IGN Astro 1960 / UTM zone 30N
-<BR> <epsg3370> : NAD27 / UTM zone 59N
-<BR> <epsg3371> : NAD27 / UTM zone 60N
-<BR> <epsg3372> : NAD83 / UTM zone 59N
-<BR> <epsg3373> : NAD83 / UTM zone 60N
-<BR> <epsg3374> : FD54 / UTM zone 29N
-<BR> <epsg3375> : GDM2000 / Peninsula RSO
-<BR> <epsg3376> : GDM2000 / East Malaysia BRSO
-<BR> <epsg3377> : GDM2000 / Johor Grid
-<BR> <epsg3378> : GDM2000 / Sembilan and Melaka Grid
-<BR> <epsg3379> : GDM2000 / PahangGrid
-<BR> <epsg3380> : GDM2000 / Selangor Grid
-<BR> <epsg3381> : GDM2000 / Terengganu Grid
-<BR> <epsg3382> : GDM2000 / Pinang Grid
-<BR> <epsg3383> : GDM2000 / Kedah and Perlis Grid
-<BR> <epsg3384> : GDM2000 / Perak Grid
-<BR> <epsg3385> : GDM2000 / Kelantan Grid
-<BR> <epsg3386> : KKJ / Finland zone 0
-<BR> <epsg3387> : KKJ / Finland zone 5
-<BR> <epsg3388> : Pulkovo 1942 / Caspian Sea Mercator
-<BR> <epsg3389> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 60
-<BR> <epsg3390> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 60
-<BR> <epsg3391> : Karbala 1979 (Polservice) / UTM zone 37N
-<BR> <epsg3392> : Karbala 1979 (Polservice) / UTM zone 38N
-<BR> <epsg3393> : Karbala 1979 (Polservice) / UTM zone 39N
-<BR> <epsg3394> : Nahrwan 1934 / Iraq zone
-<BR> <epsg3395> : WGS 84 / World Mercator
-<BR> <epsg3396> : PD/83 / Gauss-Kruger zone 3
-<BR> <epsg3397> : PD/83 / Gauss-Kruger zone 4
-<BR> <epsg3398> : RD/83 / Gauss-Kruger zone 4
-<BR> <epsg3399> : RD/83 / Gauss-Kruger zone 5
-<BR> <epsg3400> : NAD83 / Alberta 10-TM (Forest)
-<BR> <epsg3401> : NAD83 / Alberta 10-TM (Resource)
-<BR> <epsg3402> : NAD83(CSRS) / Alberta 10-TM (Forest)
-<BR> <epsg3403> : NAD83(CSRS) / Alberta 10-TM (Resource)
-<BR> <epsg3404> : NAD83(HARN) / North Carolina (ftUS)
-<BR> <epsg3405> : VN-2000 / UTM zone 48N
-<BR> <epsg3406> : VN-2000 / UTM zone 49N
-<BR> <epsg3407> : Hong Kong 1963 Grid System
-<BR> <epsg3408> : NSIDC EASE-Grid North
-<BR> <epsg3409> : NSIDC EASE-Grid South
-<BR> <epsg3411> : NSIDC Sea Ice Polar Stereographic North
-<BR> <epsg3412> : NSIDC Sea Ice Polar Stereographic South
-<BR> <epsg3413> : WGS 84 / NSIDC Sea Ice Polar Stereographic North
-<BR> <epsg3414> : SVY21 / Singapore TM
-<BR> <epsg3415> : WGS 72BE / South China Sea Lambert
-<BR> <epsg3416> : ETRS89 / Austria Lambert
-<BR> <epsg3417> : NAD83 / Iowa North (ft US)
-<BR> <epsg3418> : NAD83 / Iowa South (ft US)
-<BR> <epsg3419> : NAD83 / Kansas North (ft US)
-<BR> <epsg3420> : NAD83 / Kansas South (ft US)
-<BR> <epsg3421> : NAD83 / Nevada East (ft US)
-<BR> <epsg3422> : NAD83 / Nevada Central (ft US)
-<BR> <epsg3423> : NAD83 / Nevada West (ft US)
-<BR> <epsg3424> : NAD83 / New Jersey (ft US)
-<BR> <epsg3425> : NAD83(HARN) / Iowa North (ft US)
-<BR> <epsg3426> : NAD83(HARN) / Iowa South (ft US)
-<BR> <epsg3427> : NAD83(HARN) / Kansas North (ft US)
-<BR> <epsg3428> : NAD83(HARN) / Kansas South (ft US)
-<BR> <epsg3429> : NAD83(HARN) / Nevada East (ft US)
-<BR> <epsg3430> : NAD83(HARN) / Nevada Central (ft US)
-<BR> <epsg3431> : NAD83(HARN) / Nevada West (ft US)
-<BR> <epsg3432> : NAD83(HARN) / New Jersey (ft US)
-<BR> <epsg3433> : NAD83 / Arkansas North (ftUS)
-<BR> <epsg3434> : NAD83 / Arkansas South (ftUS)
-<BR> <epsg3435> : NAD83 / Illinois East (ftUS)
-<BR> <epsg3436> : NAD83 / Illinois West (ftUS)
-<BR> <epsg3437> : NAD83 / New Hampshire (ftUS)
-<BR> <epsg3438> : NAD83 / Rhode Island (ftUS)
-<BR> <epsg3439> : PSD93 / UTM zone 39N
-<BR> <epsg3440> : PSD93 / UTM zone 40N
-<BR> <epsg3441> : NAD83(HARN) / Arkansas North (ftUS)
-<BR> <epsg3442> : NAD83(HARN) / Arkansas South (ftUS)
-<BR> <epsg3443> : NAD83(HARN) / Illinois East (ftUS)
-<BR> <epsg3444> : NAD83(HARN) / Illinois West (ftUS)
-<BR> <epsg3445> : NAD83(HARN) / New Hampshire (ftUS)
-<BR> <epsg3446> : NAD83(HARN) / Rhode Island (ftUS)
-<BR> <epsg3447> : ETRS89 / Belgian Lambert 2005
-<BR> <epsg3448> : JAD2001 / Jamaica Metric Grid
-<BR> <epsg3449> : JAD2001 / UTM zone 17N
-<BR> <epsg3450> : JAD2001 / UTM zone 18N
-<BR> <epsg3451> : NAD83 / Louisiana North (ftUS)
-<BR> <epsg3452> : NAD83 / Louisiana South (ftUS)
-<BR> <epsg3453> : NAD83 / Louisiana Offshore (ftUS)
-<BR> <epsg3454> : NAD83 / South Dakota North (ftUS)
-<BR> <epsg3455> : NAD83 / South Dakota South (ftUS)
-<BR> <epsg3456> : NAD83(HARN) / Louisiana North (ftUS)
-<BR> <epsg3457> : NAD83(HARN) / Louisiana South (ftUS)
-<BR> <epsg3458> : NAD83(HARN) / South Dakota North (ftUS)
-<BR> <epsg3459> : NAD83(HARN) / South Dakota South (ftUS)
-<BR> <epsg3460> : Fiji 1986 / Fiji Map Grid
-<BR> <epsg3461> : Dabola 1981 / UTM zone 28N
-<BR> <epsg3462> : Dabola 1981 / UTM zone 29N
-<BR> <epsg3463> : NAD83 / Maine CS2000 Central
-<BR> <epsg3464> : NAD83(HARN) / Maine CS2000 Central
-<BR> <epsg3465> : NAD83(NSRS2007) / Alabama East
-<BR> <epsg3466> : NAD83(NSRS2007) / Alabama West
-<BR> <epsg3467> : NAD83(NSRS2007) / Alaska Albers
-<BR> <epsg3468> : NAD83(NSRS2007) / Alaska zone 1
-<BR> <epsg3469> : NAD83(NSRS2007) / Alaska zone 2
-<BR> <epsg3470> : NAD83(NSRS2007) / Alaska zone 3
-<BR> <epsg3471> : NAD83(NSRS2007) / Alaska zone 4
-<BR> <epsg3472> : NAD83(NSRS2007) / Alaska zone 5
-<BR> <epsg3473> : NAD83(NSRS2007) / Alaska zone 6
-<BR> <epsg3474> : NAD83(NSRS2007) / Alaska zone 7
-<BR> <epsg3475> : NAD83(NSRS2007) / Alaska zone 8
-<BR> <epsg3476> : NAD83(NSRS2007) / Alaska zone 9
-<BR> <epsg3477> : NAD83(NSRS2007) / Alaska zone 10
-<BR> <epsg3478> : NAD83(NSRS2007) / Arizona Central
-<BR> <epsg3479> : NAD83(NSRS2007) / Arizona Central (ft)
-<BR> <epsg3480> : NAD83(NSRS2007) / Arizona East
-<BR> <epsg3481> : NAD83(NSRS2007) / Arizona East (ft)
-<BR> <epsg3482> : NAD83(NSRS2007) / Arizona West
-<BR> <epsg3483> : NAD83(NSRS2007) / Arizona West (ft)
-<BR> <epsg3484> : NAD83(NSRS2007) / Arkansas North
-<BR> <epsg3485> : NAD83(NSRS2007) / Arkansas North (ftUS)
-<BR> <epsg3486> : NAD83(NSRS2007) / Arkansas South
-<BR> <epsg3487> : NAD83(NSRS2007) / Arkansas South (ftUS)
-<BR> <epsg3488> : NAD83(NSRS2007) / California Albers
-<BR> <epsg3489> : NAD83(NSRS2007) / California zone 1
-<BR> <epsg3490> : NAD83(NSRS2007) / California zone 1 (ftUS)
-<BR> <epsg3491> : NAD83(NSRS2007) / California zone 2
-<BR> <epsg3492> : NAD83(NSRS2007) / California zone 2 (ftUS)
-<BR> <epsg3493> : NAD83(NSRS2007) / California zone 3
-<BR> <epsg3494> : NAD83(NSRS2007) / California zone 3 (ftUS)
-<BR> <epsg3495> : NAD83(NSRS2007) / California zone 4
-<BR> <epsg3496> : NAD83(NSRS2007) / California zone 4 (ftUS)
-<BR> <epsg3497> : NAD83(NSRS2007) / California zone 5
-<BR> <epsg3498> : NAD83(NSRS2007) / California zone 5 (ftUS)
-<BR> <epsg3499> : NAD83(NSRS2007) / California zone 6
-<BR> <epsg3500> : NAD83(NSRS2007) / California zone 6 (ftUS)
-<BR> <epsg3501> : NAD83(NSRS2007) / Colorado Central
-<BR> <epsg3502> : NAD83(NSRS2007) / Colorado Central (ftUS)
-<BR> <epsg3503> : NAD83(NSRS2007) / Colorado North
-<BR> <epsg3504> : NAD83(NSRS2007) / Colorado North (ftUS)
-<BR> <epsg3505> : NAD83(NSRS2007) / Colorado South
-<BR> <epsg3506> : NAD83(NSRS2007) / Colorado South (ftUS)
-<BR> <epsg3507> : NAD83(NSRS2007) / Connecticut
-<BR> <epsg3508> : NAD83(NSRS2007) / Connecticut (ftUS)
-<BR> <epsg3509> : NAD83(NSRS2007) / Delaware
-<BR> <epsg3510> : NAD83(NSRS2007) / Delaware (ftUS)
-<BR> <epsg3511> : NAD83(NSRS2007) / Florida East
-<BR> <epsg3512> : NAD83(NSRS2007) / Florida East (ftUS)
-<BR> <epsg3513> : NAD83(NSRS2007) / Florida GDL Albers
-<BR> <epsg3514> : NAD83(NSRS2007) / Florida North
-<BR> <epsg3515> : NAD83(NSRS2007) / Florida North (ftUS)
-<BR> <epsg3516> : NAD83(NSRS2007) / Florida West
-<BR> <epsg3517> : NAD83(NSRS2007) / Florida West (ftUS)
-<BR> <epsg3518> : NAD83(NSRS2007) / Georgia East
-<BR> <epsg3519> : NAD83(NSRS2007) / Georgia East (ftUS)
-<BR> <epsg3520> : NAD83(NSRS2007) / Georgia West
-<BR> <epsg3521> : NAD83(NSRS2007) / Georgia West (ftUS)
-<BR> <epsg3522> : NAD83(NSRS2007) / Idaho Central
-<BR> <epsg3523> : NAD83(NSRS2007) / Idaho Central (ftUS)
-<BR> <epsg3524> : NAD83(NSRS2007) / Idaho East
-<BR> <epsg3525> : NAD83(NSRS2007) / Idaho East (ftUS)
-<BR> <epsg3526> : NAD83(NSRS2007) / Idaho West
-<BR> <epsg3527> : NAD83(NSRS2007) / Idaho West (ftUS)
-<BR> <epsg3528> : NAD83(NSRS2007) / Illinois East
-<BR> <epsg3529> : NAD83(NSRS2007) / Illinois East (ftUS)
-<BR> <epsg3530> : NAD83(NSRS2007) / Illinois West
-<BR> <epsg3531> : NAD83(NSRS2007) / Illinois West (ftUS)
-<BR> <epsg3532> : NAD83(NSRS2007) / Indiana East
-<BR> <epsg3533> : NAD83(NSRS2007) / Indiana East (ftUS)
-<BR> <epsg3534> : NAD83(NSRS2007) / Indiana West
-<BR> <epsg3535> : NAD83(NSRS2007) / Indiana West (ftUS)
-<BR> <epsg3536> : NAD83(NSRS2007) / Iowa North
-<BR> <epsg3537> : NAD83(NSRS2007) / Iowa North (ft US)
-<BR> <epsg3538> : NAD83(NSRS2007) / Iowa South
-<BR> <epsg3539> : NAD83(NSRS2007) / Iowa South (ft US)
-<BR> <epsg3540> : NAD83(NSRS2007) / Kansas North
-<BR> <epsg3541> : NAD83(NSRS2007) / Kansas North (ft US)
-<BR> <epsg3542> : NAD83(NSRS2007) / Kansas South
-<BR> <epsg3543> : NAD83(NSRS2007) / Kansas South (ft US)
-<BR> <epsg3544> : NAD83(NSRS2007) / Kentucky North
-<BR> <epsg3545> : NAD83(NSRS2007) / Kentucky North (ftUS)
-<BR> <epsg3546> : NAD83(NSRS2007) / Kentucky Single Zone
-<BR> <epsg3547> : NAD83(NSRS2007) / Kentucky Single Zone (ftUS)
-<BR> <epsg3548> : NAD83(NSRS2007) / Kentucky South
-<BR> <epsg3549> : NAD83(NSRS2007) / Kentucky South (ftUS)
-<BR> <epsg3550> : NAD83(NSRS2007) / Louisiana North
-<BR> <epsg3551> : NAD83(NSRS2007) / Louisiana North (ftUS)
-<BR> <epsg3552> : NAD83(NSRS2007) / Louisiana South
-<BR> <epsg3553> : NAD83(NSRS2007) / Louisiana South (ftUS)
-<BR> <epsg3554> : NAD83(NSRS2007) / Maine CS2000 Central
-<BR> <epsg3555> : NAD83(NSRS2007) / Maine CS2000 East
-<BR> <epsg3556> : NAD83(NSRS2007) / Maine CS2000 West
-<BR> <epsg3557> : NAD83(NSRS2007) / Maine East
-<BR> <epsg3558> : NAD83(NSRS2007) / Maine West
-<BR> <epsg3559> : NAD83(NSRS2007) / Maryland
-<BR> <epsg3560> : NAD83 / Utah North (ftUS)
-<BR> <epsg3561> : Old Hawaiian / Hawaii zone 1
-<BR> <epsg3562> : Old Hawaiian / Hawaii zone 2
-<BR> <epsg3563> : Old Hawaiian / Hawaii zone 3
-<BR> <epsg3564> : Old Hawaiian / Hawaii zone 4
-<BR> <epsg3565> : Old Hawaiian / Hawaii zone 5
-<BR> <epsg3566> : NAD83 / Utah Central (ftUS)
-<BR> <epsg3567> : NAD83 / Utah South (ftUS)
-<BR> <epsg3568> : NAD83(HARN) / Utah North (ftUS)
-<BR> <epsg3569> : NAD83(HARN) / Utah Central (ftUS)
-<BR> <epsg3570> : NAD83(HARN) / Utah South (ftUS)
-<BR> <epsg3571> : WGS 84 / North Pole LAEA Bering Sea
-<BR> <epsg3572> : WGS 84 / North Pole LAEA Alaska
-<BR> <epsg3573> : WGS 84 / North Pole LAEA Canada
-<BR> <epsg3574> : WGS 84 / North Pole LAEA Atlantic
-<BR> <epsg3575> : WGS 84 / North Pole LAEA Europe
-<BR> <epsg3576> : WGS 84 / North Pole LAEA Russia
-<BR> <epsg3577> : GDA94 / Australian Albers
-<BR> <epsg3578> : NAD83 / Yukon Albers
-<BR> <epsg3579> : NAD83(CSRS) / Yukon Albers
-<BR> <epsg3580> : NAD83 / NWT Lambert
-<BR> <epsg3581> : NAD83(CSRS) / NWT Lambert
-<BR> <epsg3582> : NAD83(NSRS2007) / Maryland (ftUS)
-<BR> <epsg3583> : NAD83(NSRS2007) / Massachusetts Island
-<BR> <epsg3584> : NAD83(NSRS2007) / Massachusetts Island (ftUS)
-<BR> <epsg3585> : NAD83(NSRS2007) / Massachusetts Mainland
-<BR> <epsg3586> : NAD83(NSRS2007) / Massachusetts Mainland (ftUS)
-<BR> <epsg3587> : NAD83(NSRS2007) / Michigan Central
-<BR> <epsg3588> : NAD83(NSRS2007) / Michigan Central (ft)
-<BR> <epsg3589> : NAD83(NSRS2007) / Michigan North
-<BR> <epsg3590> : NAD83(NSRS2007) / Michigan North (ft)
-<BR> <epsg3591> : NAD83(NSRS2007) / Michigan Oblique Mercator
-<BR> <epsg3592> : NAD83(NSRS2007) / Michigan South
-<BR> <epsg3593> : NAD83(NSRS2007) / Michigan South (ft)
-<BR> <epsg3594> : NAD83(NSRS2007) / Minnesota Central
-<BR> <epsg3595> : NAD83(NSRS2007) / Minnesota North
-<BR> <epsg3596> : NAD83(NSRS2007) / Minnesota South
-<BR> <epsg3597> : NAD83(NSRS2007) / Mississippi East
-<BR> <epsg3598> : NAD83(NSRS2007) / Mississippi East (ftUS)
-<BR> <epsg3599> : NAD83(NSRS2007) / Mississippi West
-<BR> <epsg3600> : NAD83(NSRS2007) / Mississippi West (ftUS)
-<BR> <epsg3601> : NAD83(NSRS2007) / Missouri Central
-<BR> <epsg3602> : NAD83(NSRS2007) / Missouri East
-<BR> <epsg3603> : NAD83(NSRS2007) / Missouri West
-<BR> <epsg3604> : NAD83(NSRS2007) / Montana
-<BR> <epsg3605> : NAD83(NSRS2007) / Montana (ft)
-<BR> <epsg3606> : NAD83(NSRS2007) / Nebraska
-<BR> <epsg3607> : NAD83(NSRS2007) / Nevada Central
-<BR> <epsg3608> : NAD83(NSRS2007) / Nevada Central (ft US)
-<BR> <epsg3609> : NAD83(NSRS2007) / Nevada East
-<BR> <epsg3610> : NAD83(NSRS2007) / Nevada East (ft US)
-<BR> <epsg3611> : NAD83(NSRS2007) / Nevada West
-<BR> <epsg3612> : NAD83(NSRS2007) / Nevada West (ft US)
-<BR> <epsg3613> : NAD83(NSRS2007) / New Hampshire
-<BR> <epsg3614> : NAD83(NSRS2007) / New Hampshire (ftUS)
-<BR> <epsg3615> : NAD83(NSRS2007) / New Jersey
-<BR> <epsg3616> : NAD83(NSRS2007) / New Jersey (ft US)
-<BR> <epsg3617> : NAD83(NSRS2007) / New Mexico Central
-<BR> <epsg3618> : NAD83(NSRS2007) / New Mexico Central (ftUS)
-<BR> <epsg3619> : NAD83(NSRS2007) / New Mexico East
-<BR> <epsg3620> : NAD83(NSRS2007) / New Mexico East (ftUS)
-<BR> <epsg3621> : NAD83(NSRS2007) / New Mexico West
-<BR> <epsg3622> : NAD83(NSRS2007) / New Mexico West (ftUS)
-<BR> <epsg3623> : NAD83(NSRS2007) / New York Central
-<BR> <epsg3624> : NAD83(NSRS2007) / New York Central (ftUS)
-<BR> <epsg3625> : NAD83(NSRS2007) / New York East
-<BR> <epsg3626> : NAD83(NSRS2007) / New York East (ftUS)
-<BR> <epsg3627> : NAD83(NSRS2007) / New York Long Island
-<BR> <epsg3628> : NAD83(NSRS2007) / New York Long Island (ftUS)
-<BR> <epsg3629> : NAD83(NSRS2007) / New York West
-<BR> <epsg3630> : NAD83(NSRS2007) / New York West (ftUS)
-<BR> <epsg3631> : NAD83(NSRS2007) / North Carolina
-<BR> <epsg3632> : NAD83(NSRS2007) / North Carolina (ftUS)
-<BR> <epsg3633> : NAD83(NSRS2007) / North Dakota North
-<BR> <epsg3634> : NAD83(NSRS2007) / North Dakota North (ft)
-<BR> <epsg3635> : NAD83(NSRS2007) / North Dakota South
-<BR> <epsg3636> : NAD83(NSRS2007) / North Dakota South (ft)
-<BR> <epsg3637> : NAD83(NSRS2007) / Ohio North
-<BR> <epsg3638> : NAD83(NSRS2007) / Ohio South
-<BR> <epsg3639> : NAD83(NSRS2007) / Oklahoma North
-<BR> <epsg3640> : NAD83(NSRS2007) / Oklahoma North (ftUS)
-<BR> <epsg3641> : NAD83(NSRS2007) / Oklahoma South
-<BR> <epsg3642> : NAD83(NSRS2007) / Oklahoma South (ftUS)
-<BR> <epsg3643> : NAD83(NSRS2007) / Oregon Lambert
-<BR> <epsg3644> : NAD83(NSRS2007) / Oregon Lambert (ft)
-<BR> <epsg3645> : NAD83(NSRS2007) / Oregon North
-<BR> <epsg3646> : NAD83(NSRS2007) / Oregon North (ft)
-<BR> <epsg3647> : NAD83(NSRS2007) / Oregon South
-<BR> <epsg3648> : NAD83(NSRS2007) / Oregon South (ft)
-<BR> <epsg3649> : NAD83(NSRS2007) / Pennsylvania North
-<BR> <epsg3650> : NAD83(NSRS2007) / Pennsylvania North (ftUS)
-<BR> <epsg3651> : NAD83(NSRS2007) / Pennsylvania South
-<BR> <epsg3652> : NAD83(NSRS2007) / Pennsylvania South (ftUS)
-<BR> <epsg3653> : NAD83(NSRS2007) / Rhode Island
-<BR> <epsg3654> : NAD83(NSRS2007) / Rhode Island (ftUS)
-<BR> <epsg3655> : NAD83(NSRS2007) / South Carolina
-<BR> <epsg3656> : NAD83(NSRS2007) / South Carolina (ft)
-<BR> <epsg3657> : NAD83(NSRS2007) / South Dakota North
-<BR> <epsg3658> : NAD83(NSRS2007) / South Dakota North (ftUS)
-<BR> <epsg3659> : NAD83(NSRS2007) / South Dakota South
-<BR> <epsg3660> : NAD83(NSRS2007) / South Dakota South (ftUS)
-<BR> <epsg3661> : NAD83(NSRS2007) / Tennessee
-<BR> <epsg3662> : NAD83(NSRS2007) / Tennessee (ftUS)
-<BR> <epsg3663> : NAD83(NSRS2007) / Texas Central
-<BR> <epsg3664> : NAD83(NSRS2007) / Texas Central (ftUS)
-<BR> <epsg3665> : NAD83(NSRS2007) / Texas Centric Albers Equal Area
-<BR> <epsg3666> : NAD83(NSRS2007) / Texas Centric Lambert Conformal
-<BR> <epsg3667> : NAD83(NSRS2007) / Texas North
-<BR> <epsg3668> : NAD83(NSRS2007) / Texas North (ftUS)
-<BR> <epsg3669> : NAD83(NSRS2007) / Texas North Central
-<BR> <epsg3670> : NAD83(NSRS2007) / Texas North Central (ftUS)
-<BR> <epsg3671> : NAD83(NSRS2007) / Texas South
-<BR> <epsg3672> : NAD83(NSRS2007) / Texas South (ftUS)
-<BR> <epsg3673> : NAD83(NSRS2007) / Texas South Central
-<BR> <epsg3674> : NAD83(NSRS2007) / Texas South Central (ftUS)
-<BR> <epsg3675> : NAD83(NSRS2007) / Utah Central
-<BR> <epsg3676> : NAD83(NSRS2007) / Utah Central (ft)
-<BR> <epsg3677> : NAD83(NSRS2007) / Utah Central (ftUS)
-<BR> <epsg3678> : NAD83(NSRS2007) / Utah North
-<BR> <epsg3679> : NAD83(NSRS2007) / Utah North (ft)
-<BR> <epsg3680> : NAD83(NSRS2007) / Utah North (ftUS)
-<BR> <epsg3681> : NAD83(NSRS2007) / Utah South
-<BR> <epsg3682> : NAD83(NSRS2007) / Utah South (ft)
-<BR> <epsg3683> : NAD83(NSRS2007) / Utah South (ftUS)
-<BR> <epsg3684> : NAD83(NSRS2007) / Vermont
-<BR> <epsg3685> : NAD83(NSRS2007) / Virginia North
-<BR> <epsg3686> : NAD83(NSRS2007) / Virginia North (ftUS)
-<BR> <epsg3687> : NAD83(NSRS2007) / Virginia South
-<BR> <epsg3688> : NAD83(NSRS2007) / Virginia South (ftUS)
-<BR> <epsg3689> : NAD83(NSRS2007) / Washington North
-<BR> <epsg3690> : NAD83(NSRS2007) / Washington North (ftUS)
-<BR> <epsg3691> : NAD83(NSRS2007) / Washington South
-<BR> <epsg3692> : NAD83(NSRS2007) / Washington South (ftUS)
-<BR> <epsg3693> : NAD83(NSRS2007) / West Virginia North
-<BR> <epsg3694> : NAD83(NSRS2007) / West Virginia South
-<BR> <epsg3695> : NAD83(NSRS2007) / Wisconsin Central
-<BR> <epsg3696> : NAD83(NSRS2007) / Wisconsin Central (ftUS)
-<BR> <epsg3697> : NAD83(NSRS2007) / Wisconsin North
-<BR> <epsg3698> : NAD83(NSRS2007) / Wisconsin North (ftUS)
-<BR> <epsg3699> : NAD83(NSRS2007) / Wisconsin South
-<BR> <epsg3700> : NAD83(NSRS2007) / Wisconsin South (ftUS)
-<BR> <epsg3701> : NAD83(NSRS2007) / Wisconsin Transverse Mercator
-<BR> <epsg3702> : NAD83(NSRS2007) / Wyoming East
-<BR> <epsg3703> : NAD83(NSRS2007) / Wyoming East Central
-<BR> <epsg3704> : NAD83(NSRS2007) / Wyoming West Central
-<BR> <epsg3705> : NAD83(NSRS2007) / Wyoming West
-<BR> <epsg3706> : NAD83(NSRS2007) / UTM zone 59N
-<BR> <epsg3707> : NAD83(NSRS2007) / UTM zone 60N
-<BR> <epsg3708> : NAD83(NSRS2007) / UTM zone 1N
-<BR> <epsg3709> : NAD83(NSRS2007) / UTM zone 2N
-<BR> <epsg3710> : NAD83(NSRS2007) / UTM zone 3N
-<BR> <epsg3711> : NAD83(NSRS2007) / UTM zone 4N
-<BR> <epsg3712> : NAD83(NSRS2007) / UTM zone 5N
-<BR> <epsg3713> : NAD83(NSRS2007) / UTM zone 6N
-<BR> <epsg3714> : NAD83(NSRS2007) / UTM zone 7N
-<BR> <epsg3715> : NAD83(NSRS2007) / UTM zone 8N
-<BR> <epsg3716> : NAD83(NSRS2007) / UTM zone 9N
-<BR> <epsg3717> : NAD83(NSRS2007) / UTM zone 10N
-<BR> <epsg3718> : NAD83(NSRS2007) / UTM zone 11N
-<BR> <epsg3719> : NAD83(NSRS2007) / UTM zone 12N
-<BR> <epsg3720> : NAD83(NSRS2007) / UTM zone 13N
-<BR> <epsg3721> : NAD83(NSRS2007) / UTM zone 14N
-<BR> <epsg3722> : NAD83(NSRS2007) / UTM zone 15N
-<BR> <epsg3723> : NAD83(NSRS2007) / UTM zone 16N
-<BR> <epsg3724> : NAD83(NSRS2007) / UTM zone 17N
-<BR> <epsg3725> : NAD83(NSRS2007) / UTM zone 18N
-<BR> <epsg3726> : NAD83(NSRS2007) / UTM zone 19N
-<BR> <epsg3727> : Reunion 1947 / TM Reunion
-<BR> <epsg3728> : NAD83(NSRS2007) / Ohio North (ftUS)
-<BR> <epsg3729> : NAD83(NSRS2007) / Ohio South (ftUS)
-<BR> <epsg3730> : NAD83(NSRS2007) / Wyoming East (ftUS)
-<BR> <epsg3731> : NAD83(NSRS2007) / Wyoming East Central (ftUS)
-<BR> <epsg3732> : NAD83(NSRS2007) / Wyoming West Central (ftUS)
-<BR> <epsg3733> : NAD83(NSRS2007) / Wyoming West (ftUS)
-<BR> <epsg3734> : NAD83 / Ohio North (ftUS)
-<BR> <epsg3735> : NAD83 / Ohio South (ftUS)
-<BR> <epsg3736> : NAD83 / Wyoming East (ftUS)
-<BR> <epsg3737> : NAD83 / Wyoming East Central (ftUS)
-<BR> <epsg3738> : NAD83 / Wyoming West Central (ftUS)
-<BR> <epsg3739> : NAD83 / Wyoming West (ftUS)
-<BR> <epsg3740> : NAD83(HARN) / UTM zone 10N
-<BR> <epsg3741> : NAD83(HARN) / UTM zone 11N
-<BR> <epsg3742> : NAD83(HARN) / UTM zone 12N
-<BR> <epsg3743> : NAD83(HARN) / UTM zone 13N
-<BR> <epsg3744> : NAD83(HARN) / UTM zone 14N
-<BR> <epsg3745> : NAD83(HARN) / UTM zone 15N
-<BR> <epsg3746> : NAD83(HARN) / UTM zone 16N
-<BR> <epsg3747> : NAD83(HARN) / UTM zone 17N
-<BR> <epsg3748> : NAD83(HARN) / UTM zone 18N
-<BR> <epsg3749> : NAD83(HARN) / UTM zone 19N
-<BR> <epsg3750> : NAD83(HARN) / UTM zone 4N
-<BR> <epsg3751> : NAD83(HARN) / UTM zone 5N
-<BR> <epsg3752> : WGS 84 / Mercator 41
-<BR> <epsg3753> : NAD83(HARN) / Ohio North (ftUS)
-<BR> <epsg3754> : NAD83(HARN) / Ohio South (ftUS)
-<BR> <epsg3755> : NAD83(HARN) / Wyoming East (ftUS)
-<BR> <epsg3756> : NAD83(HARN) / Wyoming East Central (ftUS)
-<BR> <epsg3757> : NAD83(HARN) / Wyoming West Central (ftUS)
-<BR> <epsg3758> : NAD83(HARN) / Wyoming West (ftUS)
-<BR> <epsg3759> : NAD83 / Hawaii zone 3 (ftUS)
-<BR> <epsg3760> : NAD83(HARN) / Hawaii zone 3 (ftUS)
-<BR> <epsg3761> : NAD83(CSRS) / UTM zone 22N
-<BR> <epsg3762> : WGS 84 / South Georgia Lambert
-<BR> <epsg3920> : Puerto Rico / UTM zone 20N
-<BR> <epsg3991> : Puerto Rico State Plane CS of 1927
-<BR> <epsg3992> : Puerto Rico / St. Croix
-<BR> <epsg20004> : Pulkovo 1995 / Gauss-Kruger zone 4
-<BR> <epsg20005> : Pulkovo 1995 / Gauss-Kruger zone 5
-<BR> <epsg20006> : Pulkovo 1995 / Gauss-Kruger zone 6
-<BR> <epsg20007> : Pulkovo 1995 / Gauss-Kruger zone 7
-<BR> <epsg20008> : Pulkovo 1995 / Gauss-Kruger zone 8
-<BR> <epsg20009> : Pulkovo 1995 / Gauss-Kruger zone 9
-<BR> <epsg20010> : Pulkovo 1995 / Gauss-Kruger zone 10
-<BR> <epsg20011> : Pulkovo 1995 / Gauss-Kruger zone 11
-<BR> <epsg20012> : Pulkovo 1995 / Gauss-Kruger zone 12
-<BR> <epsg20013> : Pulkovo 1995 / Gauss-Kruger zone 13
-<BR> <epsg20014> : Pulkovo 1995 / Gauss-Kruger zone 14
-<BR> <epsg20015> : Pulkovo 1995 / Gauss-Kruger zone 15
-<BR> <epsg20016> : Pulkovo 1995 / Gauss-Kruger zone 16
-<BR> <epsg20017> : Pulkovo 1995 / Gauss-Kruger zone 17
-<BR> <epsg20018> : Pulkovo 1995 / Gauss-Kruger zone 18
-<BR> <epsg20019> : Pulkovo 1995 / Gauss-Kruger zone 19
-<BR> <epsg20020> : Pulkovo 1995 / Gauss-Kruger zone 20
-<BR> <epsg20021> : Pulkovo 1995 / Gauss-Kruger zone 21
-<BR> <epsg20022> : Pulkovo 1995 / Gauss-Kruger zone 22
-<BR> <epsg20023> : Pulkovo 1995 / Gauss-Kruger zone 23
-<BR> <epsg20024> : Pulkovo 1995 / Gauss-Kruger zone 24
-<BR> <epsg20025> : Pulkovo 1995 / Gauss-Kruger zone 25
-<BR> <epsg20026> : Pulkovo 1995 / Gauss-Kruger zone 26
-<BR> <epsg20027> : Pulkovo 1995 / Gauss-Kruger zone 27
-<BR> <epsg20028> : Pulkovo 1995 / Gauss-Kruger zone 28
-<BR> <epsg20029> : Pulkovo 1995 / Gauss-Kruger zone 29
-<BR> <epsg20030> : Pulkovo 1995 / Gauss-Kruger zone 30
-<BR> <epsg20031> : Pulkovo 1995 / Gauss-Kruger zone 31
-<BR> <epsg20032> : Pulkovo 1995 / Gauss-Kruger zone 32
-<BR> <epsg20064> : Pulkovo 1995 / Gauss-Kruger 4N (deprecated)
-<BR> <epsg20065> : Pulkovo 1995 / Gauss-Kruger 5N (deprecated)
-<BR> <epsg20066> : Pulkovo 1995 / Gauss-Kruger 6N (deprecated)
-<BR> <epsg20067> : Pulkovo 1995 / Gauss-Kruger 7N (deprecated)
-<BR> <epsg20068> : Pulkovo 1995 / Gauss-Kruger 8N (deprecated)
-<BR> <epsg20069> : Pulkovo 1995 / Gauss-Kruger 9N (deprecated)
-<BR> <epsg20070> : Pulkovo 1995 / Gauss-Kruger 10N (deprecated)
-<BR> <epsg20071> : Pulkovo 1995 / Gauss-Kruger 11N (deprecated)
-<BR> <epsg20072> : Pulkovo 1995 / Gauss-Kruger 12N (deprecated)
-<BR> <epsg20073> : Pulkovo 1995 / Gauss-Kruger 13N (deprecated)
-<BR> <epsg20074> : Pulkovo 1995 / Gauss-Kruger 14N (deprecated)
-<BR> <epsg20075> : Pulkovo 1995 / Gauss-Kruger 15N (deprecated)
-<BR> <epsg20076> : Pulkovo 1995 / Gauss-Kruger 16N (deprecated)
-<BR> <epsg20077> : Pulkovo 1995 / Gauss-Kruger 17N (deprecated)
-<BR> <epsg20078> : Pulkovo 1995 / Gauss-Kruger 18N (deprecated)
-<BR> <epsg20079> : Pulkovo 1995 / Gauss-Kruger 19N (deprecated)
-<BR> <epsg20080> : Pulkovo 1995 / Gauss-Kruger 20N (deprecated)
-<BR> <epsg20081> : Pulkovo 1995 / Gauss-Kruger 21N (deprecated)
-<BR> <epsg20082> : Pulkovo 1995 / Gauss-Kruger 22N (deprecated)
-<BR> <epsg20083> : Pulkovo 1995 / Gauss-Kruger 23N (deprecated)
-<BR> <epsg20084> : Pulkovo 1995 / Gauss-Kruger 24N (deprecated)
-<BR> <epsg20085> : Pulkovo 1995 / Gauss-Kruger 25N (deprecated)
-<BR> <epsg20086> : Pulkovo 1995 / Gauss-Kruger 26N (deprecated)
-<BR> <epsg20087> : Pulkovo 1995 / Gauss-Kruger 27N (deprecated)
-<BR> <epsg20088> : Pulkovo 1995 / Gauss-Kruger 28N (deprecated)
-<BR> <epsg20089> : Pulkovo 1995 / Gauss-Kruger 29N (deprecated)
-<BR> <epsg20090> : Pulkovo 1995 / Gauss-Kruger 30N (deprecated)
-<BR> <epsg20091> : Pulkovo 1995 / Gauss-Kruger 31N (deprecated)
-<BR> <epsg20092> : Pulkovo 1995 / Gauss-Kruger 32N (deprecated)
-<BR> <epsg20135> : Adindan / UTM zone 35N
-<BR> <epsg20136> : Adindan / UTM zone 36N
-<BR> <epsg20137> : Adindan / UTM zone 37N
-<BR> <epsg20138> : Adindan / UTM zone 38N
-<BR> <epsg20248> : AGD66 / AMG zone 48
-<BR> <epsg20249> : AGD66 / AMG zone 49
-<BR> <epsg20250> : AGD66 / AMG zone 50
-<BR> <epsg20251> : AGD66 / AMG zone 51
-<BR> <epsg20252> : AGD66 / AMG zone 52
-<BR> <epsg20253> : AGD66 / AMG zone 53
-<BR> <epsg20254> : AGD66 / AMG zone 54
-<BR> <epsg20255> : AGD66 / AMG zone 55
-<BR> <epsg20256> : AGD66 / AMG zone 56
-<BR> <epsg20257> : AGD66 / AMG zone 57
-<BR> <epsg20258> : AGD66 / AMG zone 58
-<BR> <epsg20348> : AGD84 / AMG zone 48
-<BR> <epsg20349> : AGD84 / AMG zone 49
-<BR> <epsg20350> : AGD84 / AMG zone 50
-<BR> <epsg20351> : AGD84 / AMG zone 51
-<BR> <epsg20352> : AGD84 / AMG zone 52
-<BR> <epsg20353> : AGD84 / AMG zone 53
-<BR> <epsg20354> : AGD84 / AMG zone 54
-<BR> <epsg20355> : AGD84 / AMG zone 55
-<BR> <epsg20356> : AGD84 / AMG zone 56
-<BR> <epsg20357> : AGD84 / AMG zone 57
-<BR> <epsg20358> : AGD84 / AMG zone 58
-<BR> <epsg20436> : Ain el Abd / UTM zone 36N
-<BR> <epsg20437> : Ain el Abd / UTM zone 37N
-<BR> <epsg20438> : Ain el Abd / UTM zone 38N
-<BR> <epsg20439> : Ain el Abd / UTM zone 39N
-<BR> <epsg20440> : Ain el Abd / UTM zone 40N
-<BR> <epsg20499> : Ain el Abd / Bahrain Grid
-<BR> <epsg20538> : Afgooye / UTM zone 38N
-<BR> <epsg20539> : Afgooye / UTM zone 39N
-<BR> <epsg20790> : Lisbon (Lisbon)/Portuguese National Grid
-<BR> <epsg20791> : Lisbon (Lisbon)/Portuguese Grid
-<BR> <epsg20822> : Aratu / UTM zone 22S
-<BR> <epsg20823> : Aratu / UTM zone 23S
-<BR> <epsg20824> : Aratu / UTM zone 24S
-<BR> <epsg20934> : Arc 1950 / UTM zone 34S
-<BR> <epsg20935> : Arc 1950 / UTM zone 35S
-<BR> <epsg20936> : Arc 1950 / UTM zone 36S
-<BR> <epsg21035> : Arc 1960 / UTM zone 35S
-<BR> <epsg21036> : Arc 1960 / UTM zone 36S
-<BR> <epsg21037> : Arc 1960 / UTM zone 37S
-<BR> <epsg21095> : Arc 1960 / UTM zone 35N
-<BR> <epsg21096> : Arc 1960 / UTM zone 36N
-<BR> <epsg21097> : Arc 1960 / UTM zone 37N
-<BR> <epsg21100> : Batavia (Jakarta) / NEIEZ (deprecated)
-<BR> <epsg21148> : Batavia / UTM zone 48S
-<BR> <epsg21149> : Batavia / UTM zone 49S
-<BR> <epsg21150> : Batavia / UTM zone 50S
-<BR> <epsg21291> : Barbados 1938 / British West Indies Grid
-<BR> <epsg21292> : Barbados 1938 / Barbados National Grid
-<BR> <epsg21413> : Beijing 1954 / Gauss-Kruger zone 13
-<BR> <epsg21414> : Beijing 1954 / Gauss-Kruger zone 14
-<BR> <epsg21415> : Beijing 1954 / Gauss-Kruger zone 15
-<BR> <epsg21416> : Beijing 1954 / Gauss-Kruger zone 16
-<BR> <epsg21417> : Beijing 1954 / Gauss-Kruger zone 17
-<BR> <epsg21418> : Beijing 1954 / Gauss-Kruger zone 18
-<BR> <epsg21419> : Beijing 1954 / Gauss-Kruger zone 19
-<BR> <epsg21420> : Beijing 1954 / Gauss-Kruger zone 20
-<BR> <epsg21421> : Beijing 1954 / Gauss-Kruger zone 21
-<BR> <epsg21422> : Beijing 1954 / Gauss-Kruger zone 22
-<BR> <epsg21423> : Beijing 1954 / Gauss-Kruger zone 23
-<BR> <epsg21453> : Beijing 1954 / Gauss-Kruger CM 75E
-<BR> <epsg21454> : Beijing 1954 / Gauss-Kruger CM 81E
-<BR> <epsg21455> : Beijing 1954 / Gauss-Kruger CM 87E
-<BR> <epsg21456> : Beijing 1954 / Gauss-Kruger CM 93E
-<BR> <epsg21457> : Beijing 1954 / Gauss-Kruger CM 99E
-<BR> <epsg21458> : Beijing 1954 / Gauss-Kruger CM 105E
-<BR> <epsg21459> : Beijing 1954 / Gauss-Kruger CM 111E
-<BR> <epsg21460> : Beijing 1954 / Gauss-Kruger CM 117E
-<BR> <epsg21461> : Beijing 1954 / Gauss-Kruger CM 123E
-<BR> <epsg21462> : Beijing 1954 / Gauss-Kruger CM 129E
-<BR> <epsg21463> : Beijing 1954 / Gauss-Kruger CM 135E
-<BR> <epsg21473> : Beijing 1954 / Gauss-Kruger 13N (deprecated)
-<BR> <epsg21474> : Beijing 1954 / Gauss-Kruger 14N (deprecated)
-<BR> <epsg21475> : Beijing 1954 / Gauss-Kruger 15N (deprecated)
-<BR> <epsg21476> : Beijing 1954 / Gauss-Kruger 16N (deprecated)
-<BR> <epsg21477> : Beijing 1954 / Gauss-Kruger 17N (deprecated)
-<BR> <epsg21478> : Beijing 1954 / Gauss-Kruger 18N (deprecated)
-<BR> <epsg21479> : Beijing 1954 / Gauss-Kruger 19N (deprecated)
-<BR> <epsg21480> : Beijing 1954 / Gauss-Kruger 20N (deprecated)
-<BR> <epsg21481> : Beijing 1954 / Gauss-Kruger 21N (deprecated)
-<BR> <epsg21482> : Beijing 1954 / Gauss-Kruger 22N (deprecated)
-<BR> <epsg21483> : Beijing 1954 / Gauss-Kruger 23N (deprecated)
-<BR> <epsg21500> : Belge 1950 (Brussels) / Belge Lambert 50
-<BR> <epsg21780> : Bern 1898 (Bern) / LV03C
-<BR> <epsg21781> : CH1903 / LV03
-<BR> <epsg21817> : Bogota 1975 / UTM zone 17N (deprecated)
-<BR> <epsg21818> : Bogota 1975 / UTM zone 18N
-<BR> <epsg21891> : Bogota 1975 / Colombia West zone (deprecated)
-<BR> <epsg21892> : Bogota 1975 / Colombia Bogota zone (deprecated)
-<BR> <epsg21893> : Bogota 1975 / Colombia East Central zone (deprecated)
-<BR> <epsg21894> : Bogota 1975 / Colombia East (deprecated)
-<BR> <epsg21896> : Bogota 1975 / Colombia West zone
-<BR> <epsg21897> : Bogota 1975 / Colombia Bogota zone
-<BR> <epsg21898> : Bogota 1975 / Colombia East Central zone
-<BR> <epsg21899> : Bogota 1975 / Colombia East
-<BR> <epsg22032> : Camacupa / UTM zone 32S
-<BR> <epsg22033> : Camacupa / UTM zone 33S
-<BR> <epsg22091> : Camacupa / TM 11.30 SE
-<BR> <epsg22092> : Camacupa / TM 12 SE
-<BR> <epsg22171> : POSGAR 98 / Argentina 1
-<BR> <epsg22172> : POSGAR 98 / Argentina 2
-<BR> <epsg22173> : POSGAR 98 / Argentina 3
-<BR> <epsg22174> : POSGAR 98 / Argentina 4
-<BR> <epsg22175> : POSGAR 98 / Argentina 5
-<BR> <epsg22176> : POSGAR 98 / Argentina 6
-<BR> <epsg22177> : POSGAR 98 / Argentina 7
-<BR> <epsg22181> : POSGAR 94 / Argentina 1
-<BR> <epsg22182> : POSGAR 94 / Argentina 2
-<BR> <epsg22183> : POSGAR 94 / Argentina 3
-<BR> <epsg22184> : POSGAR 94 / Argentina 4
-<BR> <epsg22185> : POSGAR 94 / Argentina 5
-<BR> <epsg22186> : POSGAR 94 / Argentina 6
-<BR> <epsg22187> : POSGAR 94 / Argentina 7
-<BR> <epsg22191> : Campo Inchauspe / Argentina 1
-<BR> <epsg22192> : Campo Inchauspe / Argentina 2
-<BR> <epsg22193> : Campo Inchauspe / Argentina 3
-<BR> <epsg22194> : Campo Inchauspe / Argentina 4
-<BR> <epsg22195> : Campo Inchauspe / Argentina 5
-<BR> <epsg22196> : Campo Inchauspe / Argentina 6
-<BR> <epsg22197> : Campo Inchauspe / Argentina 7
-<BR> <epsg22234> : Cape / UTM zone 34S
-<BR> <epsg22235> : Cape / UTM zone 35S
-<BR> <epsg22236> : Cape / UTM zone 36S
-<BR> <epsg22332> : Carthage / UTM zone 32N
-<BR> <epsg22391> : Carthage / Nord Tunisie
-<BR> <epsg22392> : Carthage / Sud Tunisie
-<BR> <epsg22521> : Corrego Alegre / UTM zone 21S
-<BR> <epsg22522> : Corrego Alegre / UTM zone 22S
-<BR> <epsg22523> : Corrego Alegre / UTM zone 23S
-<BR> <epsg22524> : Corrego Alegre / UTM zone 24S
-<BR> <epsg22525> : Corrego Alegre / UTM zone 25S
-<BR> <epsg22700> : Deir ez Zor / Levant Zone
-<BR> <epsg22770> : Deir ez Zor / Syria Lambert
-<BR> <epsg22780> : Deir ez Zor / Levant Stereographic
-<BR> <epsg22832> : Douala / UTM zone 32N (deprecated)
-<BR> <epsg22991> : Egypt 1907 / Blue Belt
-<BR> <epsg22992> : Egypt 1907 / Red Belt
-<BR> <epsg22993> : Egypt 1907 / Purple Belt
-<BR> <epsg22994> : Egypt 1907 / Extended Purple Belt
-<BR> <epsg23028> : ED50 / UTM zone 28N
-<BR> <epsg23029> : ED50 / UTM zone 29N
-<BR> <epsg23030> : ED50 / UTM zone 30N
-<BR> <epsg23031> : ED50 / UTM zone 31N
-<BR> <epsg23032> : ED50 / UTM zone 32N
-<BR> <epsg23033> : ED50 / UTM zone 33N
-<BR> <epsg23034> : ED50 / UTM zone 34N
-<BR> <epsg23035> : ED50 / UTM zone 35N
-<BR> <epsg23036> : ED50 / UTM zone 36N
-<BR> <epsg23037> : ED50 / UTM zone 37N
-<BR> <epsg23038> : ED50 / UTM zone 38N
-<BR> <epsg23090> : ED50 / TM 0 N
-<BR> <epsg23095> : ED50 / TM 5 NE
-<BR> <epsg23239> : Fahud / UTM zone 39N
-<BR> <epsg23240> : Fahud / UTM zone 40N
-<BR> <epsg23433> : Garoua / UTM zone 33N (deprecated)
-<BR> <epsg23700> : HD72 / EOV
-<BR> <epsg23830> : DGN95 / Indonesia TM-3 zone 46.2
-<BR> <epsg23831> : DGN95 / Indonesia TM-3 zone 47.1
-<BR> <epsg23832> : DGN95 / Indonesia TM-3 zone 47.2
-<BR> <epsg23833> : DGN95 / Indonesia TM-3 zone 48.1
-<BR> <epsg23834> : DGN95 / Indonesia TM-3 zone 48.2
-<BR> <epsg23835> : DGN95 / Indonesia TM-3 zone 49.1
-<BR> <epsg23836> : DGN95 / Indonesia TM-3 zone 49.2
-<BR> <epsg23837> : DGN95 / Indonesia TM-3 zone 50.1
-<BR> <epsg23838> : DGN95 / Indonesia TM-3 zone 50.2
-<BR> <epsg23839> : DGN95 / Indonesia TM-3 zone 51.1
-<BR> <epsg23840> : DGN95 / Indonesia TM-3 zone 51.2
-<BR> <epsg23841> : DGN95 / Indonesia TM-3 zone 52.1
-<BR> <epsg23842> : DGN95 / Indonesia TM-3 zone 52.2
-<BR> <epsg23843> : DGN95 / Indonesia TM-3 zone 53.1
-<BR> <epsg23844> : DGN95 / Indonesia TM-3 zone 53.2
-<BR> <epsg23845> : DGN95 / Indonesia TM-3 zone 54.1
-<BR> <epsg23846> : ID74 / UTM zone 46N
-<BR> <epsg23847> : ID74 / UTM zone 47N
-<BR> <epsg23848> : ID74 / UTM zone 48N
-<BR> <epsg23849> : ID74 / UTM zone 49N
-<BR> <epsg23850> : ID74 / UTM zone 50N
-<BR> <epsg23851> : ID74 / UTM zone 51N
-<BR> <epsg23852> : ID74 / UTM zone 52N
-<BR> <epsg23853> : ID74 / UTM zone 53N (deprecated)
-<BR> <epsg23866> : DGN95 / UTM zone 46N
-<BR> <epsg23867> : DGN95 / UTM zone 47N
-<BR> <epsg23868> : DGN95 / UTM zone 48N
-<BR> <epsg23869> : DGN95 / UTM zone 49N
-<BR> <epsg23870> : DGN95 / UTM zone 50N
-<BR> <epsg23871> : DGN95 / UTM zone 51N
-<BR> <epsg23872> : DGN95 / UTM zone 52N
-<BR> <epsg23877> : DGN95 / UTM zone 47S
-<BR> <epsg23878> : DGN95 / UTM zone 48S
-<BR> <epsg23879> : DGN95 / UTM zone 49S
-<BR> <epsg23880> : DGN95 / UTM zone 50S
-<BR> <epsg23881> : DGN95 / UTM zone 51S
-<BR> <epsg23882> : DGN95 / UTM zone 52S
-<BR> <epsg23883> : DGN95 / UTM zone 53S
-<BR> <epsg23884> : DGN95 / UTM zone 54S
-<BR> <epsg23886> : ID74 / UTM zone 46S (deprecated)
-<BR> <epsg23887> : ID74 / UTM zone 47S
-<BR> <epsg23888> : ID74 / UTM zone 48S
-<BR> <epsg23889> : ID74 / UTM zone 49S
-<BR> <epsg23890> : ID74 / UTM zone 50S
-<BR> <epsg23891> : ID74 / UTM zone 51S
-<BR> <epsg23892> : ID74 / UTM zone 52S
-<BR> <epsg23893> : ID74 / UTM zone 53S
-<BR> <epsg23894> : ID74 / UTM zone 54S
-<BR> <epsg23946> : Indian 1954 / UTM zone 46N
-<BR> <epsg23947> : Indian 1954 / UTM zone 47N
-<BR> <epsg23948> : Indian 1954 / UTM zone 48N
-<BR> <epsg24047> : Indian 1975 / UTM zone 47N
-<BR> <epsg24048> : Indian 1975 / UTM zone 48N
-<BR> <epsg24100> : Jamaica 1875 / Jamaica (Old Grid)
-<BR> <epsg24200> : JAD69 / Jamaica National Grid
-<BR> <epsg24305> : Kalianpur 1937 / UTM zone 45N
-<BR> <epsg24306> : Kalianpur 1937 / UTM zone 46N
-<BR> <epsg24311> : Kalianpur 1962 / UTM zone 41N
-<BR> <epsg24312> : Kalianpur 1962 / UTM zone 42N
-<BR> <epsg24313> : Kalianpur 1962 / UTM zone 43N
-<BR> <epsg24342> : Kalianpur 1975 / UTM zone 42N
-<BR> <epsg24343> : Kalianpur 1975 / UTM zone 43N
-<BR> <epsg24344> : Kalianpur 1975 / UTM zone 44N
-<BR> <epsg24345> : Kalianpur 1975 / UTM zone 45N
-<BR> <epsg24346> : Kalianpur 1975 / UTM zone 46N
-<BR> <epsg24347> : Kalianpur 1975 / UTM zone 47N
-<BR> <epsg24370> : Kalianpur 1880 / India zone 0
-<BR> <epsg24371> : Kalianpur 1880 / India zone I
-<BR> <epsg24372> : Kalianpur 1880 / India zone IIa
-<BR> <epsg24373> : Kalianpur 1880 / India zone III
-<BR> <epsg24374> : Kalianpur 1880 / India zone IV
-<BR> <epsg24375> : Kalianpur 1937 / India zone IIb
-<BR> <epsg24376> : Kalianpur 1962 / India zone I
-<BR> <epsg24377> : Kalianpur 1962 / India zone IIa
-<BR> <epsg24378> : Kalianpur 1975 / India zone I
-<BR> <epsg24379> : Kalianpur 1975 / India zone IIa
-<BR> <epsg24380> : Kalianpur 1975 / India zone IIb
-<BR> <epsg24381> : Kalianpur 1975 / India zone III
-<BR> <epsg24382> : Kalianpur 1880 / India zone IIb
-<BR> <epsg24383> : Kalianpur 1975 / India zone IV
-<BR> <epsg24500> : Kertau 1968 / Singapore Grid
-<BR> <epsg24547> : Kertau 1968 / UTM zone 47N
-<BR> <epsg24548> : Kertau 1968 / UTM zone 48N
-<BR> <epsg24571> : Kertau / R.S.O. Malaya (ch) (deprecated)
-<BR> <epsg24600> : KOC Lambert
-<BR> <epsg24718> : La Canoa / UTM zone 18N
-<BR> <epsg24719> : La Canoa / UTM zone 19N
-<BR> <epsg24720> : La Canoa / UTM zone 20N
-<BR> <epsg24817> : PSAD56 / UTM zone 17N
-<BR> <epsg24818> : PSAD56 / UTM zone 18N
-<BR> <epsg24819> : PSAD56 / UTM zone 19N
-<BR> <epsg24820> : PSAD56 / UTM zone 20N
-<BR> <epsg24821> : PSAD56 / UTM zone 21N
-<BR> <epsg24877> : PSAD56 / UTM zone 17S
-<BR> <epsg24878> : PSAD56 / UTM zone 18S
-<BR> <epsg24879> : PSAD56 / UTM zone 19S
-<BR> <epsg24880> : PSAD56 / UTM zone 20S
-<BR> <epsg24881> : PSAD56 / UTM zone 21S
-<BR> <epsg24882> : PSAD56 / UTM zone 22S
-<BR> <epsg24891> : PSAD56 / Peru west zone
-<BR> <epsg24892> : PSAD56 / Peru central zone
-<BR> <epsg24893> : PSAD56 / Peru east zone
-<BR> <epsg25000> : Leigon / Ghana Metre Grid
-<BR> <epsg25231> : Lome / UTM zone 31N
-<BR> <epsg25391> : Luzon 1911 / Philippines zone I
-<BR> <epsg25392> : Luzon 1911 / Philippines zone II
-<BR> <epsg25393> : Luzon 1911 / Philippines zone III
-<BR> <epsg25394> : Luzon 1911 / Philippines zone IV
-<BR> <epsg25395> : Luzon 1911 / Philippines zone V
-<BR> <epsg25700> : Makassar (Jakarta) / NEIEZ (deprecated)
-<BR> <epsg25828> : ETRS89 / UTM zone 28N
-<BR> <epsg25829> : ETRS89 / UTM zone 29N
-<BR> <epsg25830> : ETRS89 / UTM zone 30N
-<BR> <epsg25831> : ETRS89 / UTM zone 31N
-<BR> <epsg25832> : ETRS89 / UTM zone 32N
-<BR> <epsg25833> : ETRS89 / UTM zone 33N
-<BR> <epsg25834> : ETRS89 / UTM zone 34N
-<BR> <epsg25835> : ETRS89 / UTM zone 35N
-<BR> <epsg25836> : ETRS89 / UTM zone 36N
-<BR> <epsg25837> : ETRS89 / UTM zone 37N
-<BR> <epsg25838> : ETRS89 / UTM zone 38N
-<BR> <epsg25884> : ETRS89 / TM Baltic93
-<BR> <epsg25932> : Malongo 1987 / UTM zone 32S
-<BR> <epsg26191> : Merchich / Nord Maroc
-<BR> <epsg26192> : Merchich / Sud Maroc
-<BR> <epsg26193> : Merchich / Sahara (deprecated)
-<BR> <epsg26194> : Merchich / Sahara Nord
-<BR> <epsg26195> : Merchich / Sahara Sud
-<BR> <epsg26237> : Massawa / UTM zone 37N
-<BR> <epsg26331> : Minna / UTM zone 31N
-<BR> <epsg26332> : Minna / UTM zone 32N
-<BR> <epsg26391> : Minna / Nigeria West Belt
-<BR> <epsg26392> : Minna / Nigeria Mid Belt
-<BR> <epsg26393> : Minna / Nigeria East Belt
-<BR> <epsg26432> : Mhast / UTM zone 32S (deprecated)
-<BR> <epsg26591> : Monte Mario (Rome) / Italy zone 1 (deprecated)
-<BR> <epsg26592> : Monte Mario (Rome) / Italy zone 2 (deprecated)
-<BR> <epsg26632> : M'poraloko / UTM zone 32N
-<BR> <epsg26692> : M'poraloko / UTM zone 32S
-<BR> <epsg26701> : NAD27 / UTM zone 1N
-<BR> <epsg26702> : NAD27 / UTM zone 2N
-<BR> <epsg26703> : NAD27 / UTM zone 3N
-<BR> <epsg26704> : NAD27 / UTM zone 4N
-<BR> <epsg26705> : NAD27 / UTM zone 5N
-<BR> <epsg26706> : NAD27 / UTM zone 6N
-<BR> <epsg26707> : NAD27 / UTM zone 7N
-<BR> <epsg26708> : NAD27 / UTM zone 8N
-<BR> <epsg26709> : NAD27 / UTM zone 9N
-<BR> <epsg26710> : NAD27 / UTM zone 10N
-<BR> <epsg26711> : NAD27 / UTM zone 11N
-<BR> <epsg26712> : NAD27 / UTM zone 12N
-<BR> <epsg26713> : NAD27 / UTM zone 13N
-<BR> <epsg26714> : NAD27 / UTM zone 14N
-<BR> <epsg26715> : NAD27 / UTM zone 15N
-<BR> <epsg26716> : NAD27 / UTM zone 16N
-<BR> <epsg26717> : NAD27 / UTM zone 17N
-<BR> <epsg26718> : NAD27 / UTM zone 18N
-<BR> <epsg26719> : NAD27 / UTM zone 19N
-<BR> <epsg26720> : NAD27 / UTM zone 20N
-<BR> <epsg26721> : NAD27 / UTM zone 21N
-<BR> <epsg26722> : NAD27 / UTM zone 22N
-<BR> <epsg26729> : NAD27 / Alabama East
-<BR> <epsg26730> : NAD27 / Alabama West
-<BR> <epsg26731> : NAD27 / Alaska zone 1
-<BR> <epsg26732> : NAD27 / Alaska zone 2
-<BR> <epsg26733> : NAD27 / Alaska zone 3
-<BR> <epsg26734> : NAD27 / Alaska zone 4
-<BR> <epsg26735> : NAD27 / Alaska zone 5
-<BR> <epsg26736> : NAD27 / Alaska zone 6
-<BR> <epsg26737> : NAD27 / Alaska zone 7
-<BR> <epsg26738> : NAD27 / Alaska zone 8
-<BR> <epsg26739> : NAD27 / Alaska zone 9
-<BR> <epsg26740> : NAD27 / Alaska zone 10
-<BR> <epsg26741> : NAD27 / California zone I
-<BR> <epsg26742> : NAD27 / California zone II
-<BR> <epsg26743> : NAD27 / California zone III
-<BR> <epsg26744> : NAD27 / California zone IV
-<BR> <epsg26745> : NAD27 / California zone V
-<BR> <epsg26746> : NAD27 / California zone VI
-<BR> <epsg26747> : NAD27 / California zone VII (deprecated)
-<BR> <epsg26748> : NAD27 / Arizona East
-<BR> <epsg26749> : NAD27 / Arizona Central
-<BR> <epsg26750> : NAD27 / Arizona West
-<BR> <epsg26751> : NAD27 / Arkansas North
-<BR> <epsg26752> : NAD27 / Arkansas South
-<BR> <epsg26753> : NAD27 / Colorado North
-<BR> <epsg26754> : NAD27 / Colorado Central
-<BR> <epsg26755> : NAD27 / Colorado South
-<BR> <epsg26756> : NAD27 / Connecticut
-<BR> <epsg26757> : NAD27 / Delaware
-<BR> <epsg26758> : NAD27 / Florida East
-<BR> <epsg26759> : NAD27 / Florida West
-<BR> <epsg26760> : NAD27 / Florida North
-<BR> <epsg26766> : NAD27 / Georgia East
-<BR> <epsg26767> : NAD27 / Georgia West
-<BR> <epsg26768> : NAD27 / Idaho East
-<BR> <epsg26769> : NAD27 / Idaho Central
-<BR> <epsg26770> : NAD27 / Idaho West
-<BR> <epsg26771> : NAD27 / Illinois East
-<BR> <epsg26772> : NAD27 / Illinois West
-<BR> <epsg26773> : NAD27 / Indiana East
-<BR> <epsg26774> : NAD27 / Indiana West
-<BR> <epsg26775> : NAD27 / Iowa North
-<BR> <epsg26776> : NAD27 / Iowa South
-<BR> <epsg26777> : NAD27 / Kansas North
-<BR> <epsg26778> : NAD27 / Kansas South
-<BR> <epsg26779> : NAD27 / Kentucky North
-<BR> <epsg26780> : NAD27 / Kentucky South
-<BR> <epsg26781> : NAD27 / Louisiana North
-<BR> <epsg26782> : NAD27 / Louisiana South
-<BR> <epsg26783> : NAD27 / Maine East
-<BR> <epsg26784> : NAD27 / Maine West
-<BR> <epsg26785> : NAD27 / Maryland
-<BR> <epsg26786> : NAD27 / Massachusetts Mainland
-<BR> <epsg26787> : NAD27 / Massachusetts Island
-<BR> <epsg26791> : NAD27 / Minnesota North
-<BR> <epsg26792> : NAD27 / Minnesota Central
-<BR> <epsg26793> : NAD27 / Minnesota South
-<BR> <epsg26794> : NAD27 / Mississippi East
-<BR> <epsg26795> : NAD27 / Mississippi West
-<BR> <epsg26796> : NAD27 / Missouri East
-<BR> <epsg26797> : NAD27 / Missouri Central
-<BR> <epsg26798> : NAD27 / Missouri West
-<BR> <epsg26799> : NAD27 / California zone VII
-<BR> <epsg26801> : NAD Michigan / Michigan East
-<BR> <epsg26802> : NAD Michigan / Michigan Old Central
-<BR> <epsg26803> : NAD Michigan / Michigan West
-<BR> <epsg26811> : NAD Michigan / Michigan North
-<BR> <epsg26812> : NAD Michigan / Michigan Central
-<BR> <epsg26813> : NAD Michigan / Michigan South
-<BR> <epsg26901> : NAD83 / UTM zone 1N
-<BR> <epsg26902> : NAD83 / UTM zone 2N
-<BR> <epsg26903> : NAD83 / UTM zone 3N
-<BR> <epsg26904> : NAD83 / UTM zone 4N
-<BR> <epsg26905> : NAD83 / UTM zone 5N
-<BR> <epsg26906> : NAD83 / UTM zone 6N
-<BR> <epsg26907> : NAD83 / UTM zone 7N
-<BR> <epsg26908> : NAD83 / UTM zone 8N
-<BR> <epsg26909> : NAD83 / UTM zone 9N
-<BR> <epsg26910> : NAD83 / UTM zone 10N
-<BR> <epsg26911> : NAD83 / UTM zone 11N
-<BR> <epsg26912> : NAD83 / UTM zone 12N
-<BR> <epsg26913> : NAD83 / UTM zone 13N
-<BR> <epsg26914> : NAD83 / UTM zone 14N
-<BR> <epsg26915> : NAD83 / UTM zone 15N
-<BR> <epsg26916> : NAD83 / UTM zone 16N
-<BR> <epsg26917> : NAD83 / UTM zone 17N
-<BR> <epsg26918> : NAD83 / UTM zone 18N
-<BR> <epsg26919> : NAD83 / UTM zone 19N
-<BR> <epsg26920> : NAD83 / UTM zone 20N
-<BR> <epsg26921> : NAD83 / UTM zone 21N
-<BR> <epsg26922> : NAD83 / UTM zone 22N
-<BR> <epsg26923> : NAD83 / UTM zone 23N
-<BR> <epsg26929> : NAD83 / Alabama East
-<BR> <epsg26930> : NAD83 / Alabama West
-<BR> <epsg26931> : NAD83 / Alaska zone 1
-<BR> <epsg26932> : NAD83 / Alaska zone 2
-<BR> <epsg26933> : NAD83 / Alaska zone 3
-<BR> <epsg26934> : NAD83 / Alaska zone 4
-<BR> <epsg26935> : NAD83 / Alaska zone 5
-<BR> <epsg26936> : NAD83 / Alaska zone 6
-<BR> <epsg26937> : NAD83 / Alaska zone 7
-<BR> <epsg26938> : NAD83 / Alaska zone 8
-<BR> <epsg26939> : NAD83 / Alaska zone 9
-<BR> <epsg26940> : NAD83 / Alaska zone 10
-<BR> <epsg26941> : NAD83 / California zone 1
-<BR> <epsg26942> : NAD83 / California zone 2
-<BR> <epsg26943> : NAD83 / California zone 3
-<BR> <epsg26944> : NAD83 / California zone 4
-<BR> <epsg26945> : NAD83 / California zone 5
-<BR> <epsg26946> : NAD83 / California zone 6
-<BR> <epsg26948> : NAD83 / Arizona East
-<BR> <epsg26949> : NAD83 / Arizona Central
-<BR> <epsg26950> : NAD83 / Arizona West
-<BR> <epsg26951> : NAD83 / Arkansas North
-<BR> <epsg26952> : NAD83 / Arkansas South
-<BR> <epsg26953> : NAD83 / Colorado North
-<BR> <epsg26954> : NAD83 / Colorado Central
-<BR> <epsg26955> : NAD83 / Colorado South
-<BR> <epsg26956> : NAD83 / Connecticut
-<BR> <epsg26957> : NAD83 / Delaware
-<BR> <epsg26958> : NAD83 / Florida East
-<BR> <epsg26959> : NAD83 / Florida West
-<BR> <epsg26960> : NAD83 / Florida North
-<BR> <epsg26961> : NAD83 / Hawaii zone 1
-<BR> <epsg26962> : NAD83 / Hawaii zone 2
-<BR> <epsg26963> : NAD83 / Hawaii zone 3
-<BR> <epsg26964> : NAD83 / Hawaii zone 4
-<BR> <epsg26965> : NAD83 / Hawaii zone 5
-<BR> <epsg26966> : NAD83 / Georgia East
-<BR> <epsg26967> : NAD83 / Georgia West
-<BR> <epsg26968> : NAD83 / Idaho East
-<BR> <epsg26969> : NAD83 / Idaho Central
-<BR> <epsg26970> : NAD83 / Idaho West
-<BR> <epsg26971> : NAD83 / Illinois East
-<BR> <epsg26972> : NAD83 / Illinois West
-<BR> <epsg26973> : NAD83 / Indiana East
-<BR> <epsg26974> : NAD83 / Indiana West
-<BR> <epsg26975> : NAD83 / Iowa North
-<BR> <epsg26976> : NAD83 / Iowa South
-<BR> <epsg26977> : NAD83 / Kansas North
-<BR> <epsg26978> : NAD83 / Kansas South
-<BR> <epsg26979> : NAD83 / Kentucky North (deprecated)
-<BR> <epsg26980> : NAD83 / Kentucky South
-<BR> <epsg26981> : NAD83 / Louisiana North
-<BR> <epsg26982> : NAD83 / Louisiana South
-<BR> <epsg26983> : NAD83 / Maine East
-<BR> <epsg26984> : NAD83 / Maine West
-<BR> <epsg26985> : NAD83 / Maryland
-<BR> <epsg26986> : NAD83 / Massachusetts Mainland
-<BR> <epsg26987> : NAD83 / Massachusetts Island
-<BR> <epsg26988> : NAD83 / Michigan North
-<BR> <epsg26989> : NAD83 / Michigan Central
-<BR> <epsg26990> : NAD83 / Michigan South
-<BR> <epsg26991> : NAD83 / Minnesota North
-<BR> <epsg26992> : NAD83 / Minnesota Central
-<BR> <epsg26993> : NAD83 / Minnesota South
-<BR> <epsg26994> : NAD83 / Mississippi East
-<BR> <epsg26995> : NAD83 / Mississippi West
-<BR> <epsg26996> : NAD83 / Missouri East
-<BR> <epsg26997> : NAD83 / Missouri Central
-<BR> <epsg26998> : NAD83 / Missouri West
-<BR> <epsg27037> : Nahrwan 1967 / UTM zone 37N
-<BR> <epsg27038> : Nahrwan 1967 / UTM zone 38N
-<BR> <epsg27039> : Nahrwan 1967 / UTM zone 39N
-<BR> <epsg27040> : Nahrwan 1967 / UTM zone 40N
-<BR> <epsg27120> : Naparima 1972 / UTM zone 20N
-<BR> <epsg27200> : NZGD49 / New Zealand Map Grid
-<BR> <epsg27205> : NZGD49 / Mount Eden Circuit
-<BR> <epsg27206> : NZGD49 / Bay of Plenty Circuit
-<BR> <epsg27207> : NZGD49 / Poverty Bay Circuit
-<BR> <epsg27208> : NZGD49 / Hawkes Bay Circuit
-<BR> <epsg27209> : NZGD49 / Taranaki Circuit
-<BR> <epsg27210> : NZGD49 / Tuhirangi Circuit
-<BR> <epsg27211> : NZGD49 / Wanganui Circuit
-<BR> <epsg27212> : NZGD49 / Wairarapa Circuit
-<BR> <epsg27213> : NZGD49 / Wellington Circuit
-<BR> <epsg27214> : NZGD49 / Collingwood Circuit
-<BR> <epsg27215> : NZGD49 / Nelson Circuit
-<BR> <epsg27216> : NZGD49 / Karamea Circuit
-<BR> <epsg27217> : NZGD49 / Buller Circuit
-<BR> <epsg27218> : NZGD49 / Grey Circuit
-<BR> <epsg27219> : NZGD49 / Amuri Circuit
-<BR> <epsg27220> : NZGD49 / Marlborough Circuit
-<BR> <epsg27221> : NZGD49 / Hokitika Circuit
-<BR> <epsg27222> : NZGD49 / Okarito Circuit
-<BR> <epsg27223> : NZGD49 / Jacksons Bay Circuit
-<BR> <epsg27224> : NZGD49 / Mount Pleasant Circuit
-<BR> <epsg27225> : NZGD49 / Gawler Circuit
-<BR> <epsg27226> : NZGD49 / Timaru Circuit
-<BR> <epsg27227> : NZGD49 / Lindis Peak Circuit
-<BR> <epsg27228> : NZGD49 / Mount Nicholas Circuit
-<BR> <epsg27229> : NZGD49 / Mount York Circuit
-<BR> <epsg27230> : NZGD49 / Observation Point Circuit
-<BR> <epsg27231> : NZGD49 / North Taieri Circuit
-<BR> <epsg27232> : NZGD49 / Bluff Circuit
-<BR> <epsg27258> : NZGD49 / UTM zone 58S
-<BR> <epsg27259> : NZGD49 / UTM zone 59S
-<BR> <epsg27260> : NZGD49 / UTM zone 60S
-<BR> <epsg27291> : NZGD49 / North Island Grid
-<BR> <epsg27292> : NZGD49 / South Island Grid
-<BR> <epsg27391> : NGO 1948 (Oslo) / NGO zone I
-<BR> <epsg27392> : NGO 1948 (Oslo) / NGO zone II
-<BR> <epsg27393> : NGO 1948 (Oslo) / NGO zone III
-<BR> <epsg27394> : NGO 1948 (Oslo) / NGO zone IV
-<BR> <epsg27395> : NGO 1948 (Oslo) / NGO zone V
-<BR> <epsg27396> : NGO 1948 (Oslo) / NGO zone VI
-<BR> <epsg27397> : NGO 1948 (Oslo) / NGO zone VII
-<BR> <epsg27398> : NGO 1948 (Oslo) / NGO zone VIII
-<BR> <epsg27429> : Datum 73 / UTM zone 29N
-<BR> <epsg27492> : Datum 73 / Modified Portuguese Grid
-<BR> <epsg27500> : ATF (Paris) / Nord de Guerre
-<BR> <epsg27561> : NTF (Paris) / Lambert Nord France
-<BR> <epsg27562> : NTF (Paris) / Lambert Centre France
-<BR> <epsg27563> : NTF (Paris) / Lambert Sud France
-<BR> <epsg27564> : NTF (Paris) / Lambert Corse
-<BR> <epsg27571> : NTF (Paris) / Lambert zone I
-<BR> <epsg27572> : NTF (Paris) / Lambert zone II
-<BR> <epsg27573> : NTF (Paris) / Lambert zone III
-<BR> <epsg27574> : NTF (Paris) / Lambert zone IV
-<BR> <epsg27581> : NTF (Paris) / France I (deprecated)
-<BR> <epsg27582> : NTF (Paris) / France II (deprecated)
-<BR> <epsg27583> : NTF (Paris) / France III (deprecated)
-<BR> <epsg27584> : NTF (Paris) / France IV (deprecated)
-<BR> <epsg27591> : NTF (Paris) / Nord France (deprecated)
-<BR> <epsg27592> : NTF (Paris) / Centre France (deprecated)
-<BR> <epsg27593> : NTF (Paris) / Sud France (deprecated)
-<BR> <epsg27594> : NTF (Paris) / Corse (deprecated)
-<BR> <epsg27700> : OSGB 1936 / British National Grid
-<BR> <epsg28191> : Palestine 1923 / Palestine Grid
-<BR> <epsg28192> : Palestine 1923 / Palestine Belt
-<BR> <epsg28193> : Palestine 1923 / Israeli CS Grid
-<BR> <epsg28232> : Pointe Noire / UTM zone 32S
-<BR> <epsg28348> : GDA94 / MGA zone 48
-<BR> <epsg28349> : GDA94 / MGA zone 49
-<BR> <epsg28350> : GDA94 / MGA zone 50
-<BR> <epsg28351> : GDA94 / MGA zone 51
-<BR> <epsg28352> : GDA94 / MGA zone 52
-<BR> <epsg28353> : GDA94 / MGA zone 53
-<BR> <epsg28354> : GDA94 / MGA zone 54
-<BR> <epsg28355> : GDA94 / MGA zone 55
-<BR> <epsg28356> : GDA94 / MGA zone 56
-<BR> <epsg28357> : GDA94 / MGA zone 57
-<BR> <epsg28358> : GDA94 / MGA zone 58
-<BR> <epsg28402> : Pulkovo 1942 / Gauss-Kruger zone 2
-<BR> <epsg28403> : Pulkovo 1942 / Gauss-Kruger zone 3
-<BR> <epsg28404> : Pulkovo 1942 / Gauss-Kruger zone 4
-<BR> <epsg28405> : Pulkovo 1942 / Gauss-Kruger zone 5
-<BR> <epsg28406> : Pulkovo 1942 / Gauss-Kruger zone 6
-<BR> <epsg28407> : Pulkovo 1942 / Gauss-Kruger zone 7
-<BR> <epsg28408> : Pulkovo 1942 / Gauss-Kruger zone 8
-<BR> <epsg28409> : Pulkovo 1942 / Gauss-Kruger zone 9
-<BR> <epsg28410> : Pulkovo 1942 / Gauss-Kruger zone 10
-<BR> <epsg28411> : Pulkovo 1942 / Gauss-Kruger zone 11
-<BR> <epsg28412> : Pulkovo 1942 / Gauss-Kruger zone 12
-<BR> <epsg28413> : Pulkovo 1942 / Gauss-Kruger zone 13
-<BR> <epsg28414> : Pulkovo 1942 / Gauss-Kruger zone 14
-<BR> <epsg28415> : Pulkovo 1942 / Gauss-Kruger zone 15
-<BR> <epsg28416> : Pulkovo 1942 / Gauss-Kruger zone 16
-<BR> <epsg28417> : Pulkovo 1942 / Gauss-Kruger zone 17
-<BR> <epsg28418> : Pulkovo 1942 / Gauss-Kruger zone 18
-<BR> <epsg28419> : Pulkovo 1942 / Gauss-Kruger zone 19
-<BR> <epsg28420> : Pulkovo 1942 / Gauss-Kruger zone 20
-<BR> <epsg28421> : Pulkovo 1942 / Gauss-Kruger zone 21
-<BR> <epsg28422> : Pulkovo 1942 / Gauss-Kruger zone 22
-<BR> <epsg28423> : Pulkovo 1942 / Gauss-Kruger zone 23
-<BR> <epsg28424> : Pulkovo 1942 / Gauss-Kruger zone 24
-<BR> <epsg28425> : Pulkovo 1942 / Gauss-Kruger zone 25
-<BR> <epsg28426> : Pulkovo 1942 / Gauss-Kruger zone 26
-<BR> <epsg28427> : Pulkovo 1942 / Gauss-Kruger zone 27
-<BR> <epsg28428> : Pulkovo 1942 / Gauss-Kruger zone 28
-<BR> <epsg28429> : Pulkovo 1942 / Gauss-Kruger zone 29
-<BR> <epsg28430> : Pulkovo 1942 / Gauss-Kruger zone 30
-<BR> <epsg28431> : Pulkovo 1942 / Gauss-Kruger zone 31
-<BR> <epsg28432> : Pulkovo 1942 / Gauss-Kruger zone 32
-<BR> <epsg28462> : Pulkovo 1942 / Gauss-Kruger 2N (deprecated)
-<BR> <epsg28463> : Pulkovo 1942 / Gauss-Kruger 3N (deprecated)
-<BR> <epsg28464> : Pulkovo 1942 / Gauss-Kruger 4N (deprecated)
-<BR> <epsg28465> : Pulkovo 1942 / Gauss-Kruger 5N (deprecated)
-<BR> <epsg28466> : Pulkovo 1942 / Gauss-Kruger 6N (deprecated)
-<BR> <epsg28467> : Pulkovo 1942 / Gauss-Kruger 7N (deprecated)
-<BR> <epsg28468> : Pulkovo 1942 / Gauss-Kruger 8N (deprecated)
-<BR> <epsg28469> : Pulkovo 1942 / Gauss-Kruger 9N (deprecated)
-<BR> <epsg28470> : Pulkovo 1942 / Gauss-Kruger 10N (deprecated)
-<BR> <epsg28471> : Pulkovo 1942 / Gauss-Kruger 11N (deprecated)
-<BR> <epsg28472> : Pulkovo 1942 / Gauss-Kruger 12N (deprecated)
-<BR> <epsg28473> : Pulkovo 1942 / Gauss-Kruger 13N (deprecated)
-<BR> <epsg28474> : Pulkovo 1942 / Gauss-Kruger 14N (deprecated)
-<BR> <epsg28475> : Pulkovo 1942 / Gauss-Kruger 15N (deprecated)
-<BR> <epsg28476> : Pulkovo 1942 / Gauss-Kruger 16N (deprecated)
-<BR> <epsg28477> : Pulkovo 1942 / Gauss-Kruger 17N (deprecated)
-<BR> <epsg28478> : Pulkovo 1942 / Gauss-Kruger 18N (deprecated)
-<BR> <epsg28479> : Pulkovo 1942 / Gauss-Kruger 19N (deprecated)
-<BR> <epsg28480> : Pulkovo 1942 / Gauss-Kruger 20N (deprecated)
-<BR> <epsg28481> : Pulkovo 1942 / Gauss-Kruger 21N (deprecated)
-<BR> <epsg28482> : Pulkovo 1942 / Gauss-Kruger 22N (deprecated)
-<BR> <epsg28483> : Pulkovo 1942 / Gauss-Kruger 23N (deprecated)
-<BR> <epsg28484> : Pulkovo 1942 / Gauss-Kruger 24N (deprecated)
-<BR> <epsg28485> : Pulkovo 1942 / Gauss-Kruger 25N (deprecated)
-<BR> <epsg28486> : Pulkovo 1942 / Gauss-Kruger 26N (deprecated)
-<BR> <epsg28487> : Pulkovo 1942 / Gauss-Kruger 27N (deprecated)
-<BR> <epsg28488> : Pulkovo 1942 / Gauss-Kruger 28N (deprecated)
-<BR> <epsg28489> : Pulkovo 1942 / Gauss-Kruger 29N (deprecated)
-<BR> <epsg28490> : Pulkovo 1942 / Gauss-Kruger 30N (deprecated)
-<BR> <epsg28491> : Pulkovo 1942 / Gauss-Kruger 31N (deprecated)
-<BR> <epsg28492> : Pulkovo 1942 / Gauss-Kruger 32N (deprecated)
-<BR> <epsg28600> : Qatar 1974 / Qatar National Grid
-<BR> <epsg28991> : Amersfoort / RD Old
-<BR> <epsg28992> : Amersfoort / RD New
-<BR> <epsg29100> : SAD69 / Brazil Polyconic (deprecated)
-<BR> <epsg29101> : SAD69 / Brazil Polyconic
-<BR> <epsg29118> : SAD69 / UTM zone 18N (deprecated)
-<BR> <epsg29119> : SAD69 / UTM zone 19N (deprecated)
-<BR> <epsg29120> : SAD69 / UTM zone 20N (deprecated)
-<BR> <epsg29121> : SAD69 / UTM zone 21N (deprecated)
-<BR> <epsg29122> : SAD69 / UTM zone 22N (deprecated)
-<BR> <epsg29168> : SAD69 / UTM zone 18N
-<BR> <epsg29169> : SAD69 / UTM zone 19N
-<BR> <epsg29170> : SAD69 / UTM zone 20N
-<BR> <epsg29171> : SAD69 / UTM zone 21N
-<BR> <epsg29172> : SAD69 / UTM zone 22N
-<BR> <epsg29177> : SAD69 / UTM zone 17S (deprecated)
-<BR> <epsg29178> : SAD69 / UTM zone 18S (deprecated)
-<BR> <epsg29179> : SAD69 / UTM zone 19S (deprecated)
-<BR> <epsg29180> : SAD69 / UTM zone 20S (deprecated)
-<BR> <epsg29181> : SAD69 / UTM zone 21S (deprecated)
-<BR> <epsg29182> : SAD69 / UTM zone 22S (deprecated)
-<BR> <epsg29183> : SAD69 / UTM zone 23S (deprecated)
-<BR> <epsg29184> : SAD69 / UTM zone 24S (deprecated)
-<BR> <epsg29185> : SAD69 / UTM zone 25S (deprecated)
-<BR> <epsg29187> : SAD69 / UTM zone 17S
-<BR> <epsg29188> : SAD69 / UTM zone 18S
-<BR> <epsg29189> : SAD69 / UTM zone 19S
-<BR> <epsg29190> : SAD69 / UTM zone 20S
-<BR> <epsg29191> : SAD69 / UTM zone 21S
-<BR> <epsg29192> : SAD69 / UTM zone 22S
-<BR> <epsg29193> : SAD69 / UTM zone 23S
-<BR> <epsg29194> : SAD69 / UTM zone 24S
-<BR> <epsg29195> : SAD69 / UTM zone 25S
-<BR> <epsg29220> : Sapper Hill 1943 / UTM zone 20S
-<BR> <epsg29221> : Sapper Hill 1943 / UTM zone 21S
-<BR> <epsg29333> : Schwarzeck / UTM zone 33S
-<BR> <epsg29635> : Sudan / UTM zone 35N (deprecated)
-<BR> <epsg29636> : Sudan / UTM zone 36N (deprecated)
-<BR> <epsg29700> : Tananarive (Paris) / Laborde Grid (deprecated)
-<BR> <epsg29702> : Tananarive (Paris) / Laborde Grid approximation
-<BR> <epsg29738> : Tananarive / UTM zone 38S
-<BR> <epsg29739> : Tananarive / UTM zone 39S
-<BR> <epsg29849> : Timbalai 1948 / UTM zone 49N
-<BR> <epsg29850> : Timbalai 1948 / UTM zone 50N
-<BR> <epsg29871> : Timbalai 1948 / RSO Borneo (ch)
-<BR> <epsg29872> : Timbalai 1948 / RSO Borneo (ft)
-<BR> <epsg29873> : Timbalai 1948 / RSO Borneo (m)
-<BR> <epsg29900> : TM65 / Irish National Grid (deprecated)
-<BR> <epsg29901> : OSNI 1952 / Irish National Grid
-<BR> <epsg29902> : TM65 / Irish Grid
-<BR> <epsg29903> : TM75 / Irish Grid
-<BR> <epsg30161> : Tokyo / Japan Plane Rectangular CS I
-<BR> <epsg30162> : Tokyo / Japan Plane Rectangular CS II
-<BR> <epsg30163> : Tokyo / Japan Plane Rectangular CS III
-<BR> <epsg30164> : Tokyo / Japan Plane Rectangular CS IV
-<BR> <epsg30165> : Tokyo / Japan Plane Rectangular CS V
-<BR> <epsg30166> : Tokyo / Japan Plane Rectangular CS VI
-<BR> <epsg30167> : Tokyo / Japan Plane Rectangular CS VII
-<BR> <epsg30168> : Tokyo / Japan Plane Rectangular CS VIII
-<BR> <epsg30169> : Tokyo / Japan Plane Rectangular CS IX
-<BR> <epsg30170> : Tokyo / Japan Plane Rectangular CS X
-<BR> <epsg30171> : Tokyo / Japan Plane Rectangular CS XI
-<BR> <epsg30172> : Tokyo / Japan Plane Rectangular CS XII
-<BR> <epsg30173> : Tokyo / Japan Plane Rectangular CS XIII
-<BR> <epsg30174> : Tokyo / Japan Plane Rectangular CS XIV
-<BR> <epsg30175> : Tokyo / Japan Plane Rectangular CS XV
-<BR> <epsg30176> : Tokyo / Japan Plane Rectangular CS XVI
-<BR> <epsg30177> : Tokyo / Japan Plane Rectangular CS XVII
-<BR> <epsg30178> : Tokyo / Japan Plane Rectangular CS XVIII
-<BR> <epsg30179> : Tokyo / Japan Plane Rectangular CS XIX
-<BR> <epsg30200> : Trinidad 1903 / Trinidad Grid
-<BR> <epsg30339> : TC(1948) / UTM zone 39N
-<BR> <epsg30340> : TC(1948) / UTM zone 40N
-<BR> <epsg30491> : Voirol 1875 / Nord Algerie (ancienne)
-<BR> <epsg30492> : Voirol 1875 / Sud Algerie (ancienne)
-<BR> <epsg30493> : Voirol 1879 / Nord Algerie (ancienne)
-<BR> <epsg30494> : Voirol 1879 / Sud Algerie (ancienne)
-<BR> <epsg30729> : Nord Sahara 1959 / UTM zone 29N
-<BR> <epsg30730> : Nord Sahara 1959 / UTM zone 30N
-<BR> <epsg30731> : Nord Sahara 1959 / UTM zone 31N
-<BR> <epsg30732> : Nord Sahara 1959 / UTM zone 32N
-<BR> <epsg30791> : Nord Sahara 1959 / Voirol Unifie Nord
-<BR> <epsg30792> : Nord Sahara 1959 / Voirol Unifie Sud
-<BR> <epsg30800> : RT38 2.5 gon W (deprecated)
-<BR> <epsg31028> : Yoff / UTM zone 28N
-<BR> <epsg31121> : Zanderij / UTM zone 21N
-<BR> <epsg31154> : Zanderij / TM 54 NW
-<BR> <epsg31170> : Zanderij / Suriname Old TM
-<BR> <epsg31171> : Zanderij / Suriname TM
-<BR> <epsg31251> : MGI (Ferro) / Austria GK West Zone
-<BR> <epsg31252> : MGI (Ferro) / Austria GK Central Zone
-<BR> <epsg31253> : MGI (Ferro) / Austria GK East Zone
-<BR> <epsg31254> : MGI / Austria GK West
-<BR> <epsg31255> : MGI / Austria GK Central
-<BR> <epsg31256> : MGI / Austria GK East
-<BR> <epsg31257> : MGI / Austria GK M28
-<BR> <epsg31258> : MGI / Austria GK M31
-<BR> <epsg31259> : MGI / Austria GK M34
-<BR> <epsg31265> : MGI / 3-degree Gauss zone 5 (deprecated)
-<BR> <epsg31266> : MGI / 3-degree Gauss zone 6 (deprecated)
-<BR> <epsg31267> : MGI / 3-degree Gauss zone 7 (deprecated)
-<BR> <epsg31268> : MGI / 3-degree Gauss zone 8 (deprecated)
-<BR> <epsg31275> : MGI / Balkans zone 5
-<BR> <epsg31276> : MGI / Balkans zone 6
-<BR> <epsg31277> : MGI / Balkans zone 7
-<BR> <epsg31278> : MGI / Balkans zone 8 (deprecated)
-<BR> <epsg31279> : MGI / Balkans zone 8
-<BR> <epsg31281> : MGI (Ferro) / Austria West Zone
-<BR> <epsg31282> : MGI (Ferro) / Austria Central Zone
-<BR> <epsg31283> : MGI (Ferro) / Austria East Zone
-<BR> <epsg31284> : MGI / Austria M28
-<BR> <epsg31285> : MGI / Austria M31
-<BR> <epsg31286> : MGI / Austria M34
-<BR> <epsg31287> : MGI / Austria Lambert
-<BR> <epsg31288> : MGI (Ferro) / M28
-<BR> <epsg31289> : MGI (Ferro) / M31
-<BR> <epsg31290> : MGI (Ferro) / M34
-<BR> <epsg31291> : MGI (Ferro) / Austria West Zone (deprecated)
-<BR> <epsg31292> : MGI (Ferro) / Austria Central Zone (deprecated)
-<BR> <epsg31293> : MGI (Ferro) / Austria East Zone (deprecated)
-<BR> <epsg31294> : MGI / M28 (deprecated)
-<BR> <epsg31295> : MGI / M31 (deprecated)
-<BR> <epsg31296> : MGI / M34 (deprecated)
-<BR> <epsg31297> : MGI / Austria Lambert (deprecated)
-<BR> <epsg31300> : Belge 1972 / Belge Lambert 72
-<BR> <epsg31370> : Belge 1972 / Belgian Lambert 72
-<BR> <epsg31461> : DHDN / 3-degree Gauss zone 1 (deprecated)
-<BR> <epsg31462> : DHDN / 3-degree Gauss zone 2 (deprecated)
-<BR> <epsg31463> : DHDN / 3-degree Gauss zone 3 (deprecated)
-<BR> <epsg31464> : DHDN / 3-degree Gauss zone 4 (deprecated)
-<BR> <epsg31465> : DHDN / 3-degree Gauss zone 5 (deprecated)
-<BR> <epsg31466> : DHDN / Gauss-Kruger zone 2
-<BR> <epsg31467> : DHDN / Gauss-Kruger zone 3
-<BR> <epsg31468> : DHDN / Gauss-Kruger zone 4
-<BR> <epsg31469> : DHDN / Gauss-Kruger zone 5
-<BR> <epsg31528> : Conakry 1905 / UTM zone 28N
-<BR> <epsg31529> : Conakry 1905 / UTM zone 29N
-<BR> <epsg31600> : Dealul Piscului 1933/ Stereo 33
-<BR> <epsg31700> : Dealul Piscului 1970/ Stereo 70
-<BR> <epsg31838> : NGN / UTM zone 38N
-<BR> <epsg31839> : NGN / UTM zone 39N
-<BR> <epsg31900> : KUDAMS / KTM (deprecated)
-<BR> <epsg31901> : KUDAMS / KTM
-<BR> <epsg31965> : SIRGAS 2000 / UTM zone 11N
-<BR> <epsg31966> : SIRGAS 2000 / UTM zone 12N
-<BR> <epsg31967> : SIRGAS 2000 / UTM zone 13N
-<BR> <epsg31968> : SIRGAS 2000 / UTM zone 14N
-<BR> <epsg31969> : SIRGAS 2000 / UTM zone 15N
-<BR> <epsg31970> : SIRGAS 2000 / UTM zone 16N
-<BR> <epsg31971> : SIRGAS 2000 / UTM zone 17N
-<BR> <epsg31972> : SIRGAS 2000 / UTM zone 18N
-<BR> <epsg31973> : SIRGAS 2000 / UTM zone 19N
-<BR> <epsg31974> : SIRGAS 2000 / UTM zone 20N
-<BR> <epsg31975> : SIRGAS 2000 / UTM zone 21N
-<BR> <epsg31976> : SIRGAS 2000 / UTM zone 22N
-<BR> <epsg31977> : SIRGAS 2000 / UTM zone 17S
-<BR> <epsg31978> : SIRGAS 2000 / UTM zone 18S
-<BR> <epsg31979> : SIRGAS 2000 / UTM zone 19S
-<BR> <epsg31980> : SIRGAS 2000 / UTM zone 20S
-<BR> <epsg31981> : SIRGAS 2000 / UTM zone 21S
-<BR> <epsg31982> : SIRGAS 2000 / UTM zone 22S
-<BR> <epsg31983> : SIRGAS 2000 / UTM zone 23S
-<BR> <epsg31984> : SIRGAS 2000 / UTM zone 24S
-<BR> <epsg31985> : SIRGAS 2000 / UTM zone 25S
-<BR> <epsg31986> : SIRGAS / UTM zone 17N
-<BR> <epsg31987> : SIRGAS / UTM zone 18N
-<BR> <epsg31988> : SIRGAS / UTM zone 19N
-<BR> <epsg31989> : SIRGAS / UTM zone 20N
-<BR> <epsg31990> : SIRGAS / UTM zone 21N
-<BR> <epsg31991> : SIRGAS / UTM zone 22N
-<BR> <epsg31992> : SIRGAS / UTM zone 17S
-<BR> <epsg31993> : SIRGAS / UTM zone 18S
-<BR> <epsg31994> : SIRGAS / UTM zone 19S
-<BR> <epsg31995> : SIRGAS / UTM zone 20S
-<BR> <epsg31996> : SIRGAS / UTM zone 21S
-<BR> <epsg31997> : SIRGAS / UTM zone 22S
-<BR> <epsg31998> : SIRGAS / UTM zone 23S
-<BR> <epsg31999> : SIRGAS / UTM zone 24S
-<BR> <epsg32000> : SIRGAS / UTM zone 25S
-<BR> <epsg32001> : NAD27 / Montana North
-<BR> <epsg32002> : NAD27 / Montana Central
-<BR> <epsg32003> : NAD27 / Montana South
-<BR> <epsg32005> : NAD27 / Nebraska North
-<BR> <epsg32006> : NAD27 / Nebraska South
-<BR> <epsg32007> : NAD27 / Nevada East
-<BR> <epsg32008> : NAD27 / Nevada Central
-<BR> <epsg32009> : NAD27 / Nevada West
-<BR> <epsg32010> : NAD27 / New Hampshire
-<BR> <epsg32011> : NAD27 / New Jersey
-<BR> <epsg32012> : NAD27 / New Mexico East
-<BR> <epsg32013> : NAD27 / New Mexico Central
-<BR> <epsg32014> : NAD27 / New Mexico West
-<BR> <epsg32015> : NAD27 / New York East
-<BR> <epsg32016> : NAD27 / New York Central
-<BR> <epsg32017> : NAD27 / New York West
-<BR> <epsg32018> : NAD27 / New York Long Island
-<BR> <epsg32019> : NAD27 / North Carolina
-<BR> <epsg32020> : NAD27 / North Dakota North
-<BR> <epsg32021> : NAD27 / North Dakota South
-<BR> <epsg32022> : NAD27 / Ohio North
-<BR> <epsg32023> : NAD27 / Ohio South
-<BR> <epsg32024> : NAD27 / Oklahoma North
-<BR> <epsg32025> : NAD27 / Oklahoma South
-<BR> <epsg32026> : NAD27 / Oregon North
-<BR> <epsg32027> : NAD27 / Oregon South
-<BR> <epsg32028> : NAD27 / Pennsylvania North
-<BR> <epsg32029> : NAD27 / Pennsylvania South
-<BR> <epsg32030> : NAD27 / Rhode Island
-<BR> <epsg32031> : NAD27 / South Carolina North
-<BR> <epsg32033> : NAD27 / South Carolina South
-<BR> <epsg32034> : NAD27 / South Dakota North
-<BR> <epsg32035> : NAD27 / South Dakota South
-<BR> <epsg32036> : NAD27 / Tennessee (deprecated)
-<BR> <epsg32037> : NAD27 / Texas North
-<BR> <epsg32038> : NAD27 / Texas North Central
-<BR> <epsg32039> : NAD27 / Texas Central
-<BR> <epsg32040> : NAD27 / Texas South Central
-<BR> <epsg32041> : NAD27 / Texas South
-<BR> <epsg32042> : NAD27 / Utah North
-<BR> <epsg32043> : NAD27 / Utah Central
-<BR> <epsg32044> : NAD27 / Utah South
-<BR> <epsg32045> : NAD27 / Vermont
-<BR> <epsg32046> : NAD27 / Virginia North
-<BR> <epsg32047> : NAD27 / Virginia South
-<BR> <epsg32048> : NAD27 / Washington North
-<BR> <epsg32049> : NAD27 / Washington South
-<BR> <epsg32050> : NAD27 / West Virginia North
-<BR> <epsg32051> : NAD27 / West Virginia South
-<BR> <epsg32052> : NAD27 / Wisconsin North
-<BR> <epsg32053> : NAD27 / Wisconsin Central
-<BR> <epsg32054> : NAD27 / Wisconsin South
-<BR> <epsg32055> : NAD27 / Wyoming East
-<BR> <epsg32056> : NAD27 / Wyoming East Central
-<BR> <epsg32057> : NAD27 / Wyoming West Central
-<BR> <epsg32058> : NAD27 / Wyoming West
-<BR> <epsg32061> : NAD27 / Guatemala Norte
-<BR> <epsg32062> : NAD27 / Guatemala Sur
-<BR> <epsg32064> : NAD27 / BLM 14N (ftUS)
-<BR> <epsg32065> : NAD27 / BLM 15N (ftUS)
-<BR> <epsg32066> : NAD27 / BLM 16N (ftUS)
-<BR> <epsg32067> : NAD27 / BLM 17N (ftUS)
-<BR> <epsg32074> : NAD27 / BLM 14N (feet) (deprecated)
-<BR> <epsg32075> : NAD27 / BLM 15N (feet) (deprecated)
-<BR> <epsg32076> : NAD27 / BLM 16N (feet) (deprecated)
-<BR> <epsg32077> : NAD27 / BLM 17N (feet) (deprecated)
-<BR> <epsg32081> : NAD27 / MTM zone 1
-<BR> <epsg32082> : NAD27 / MTM zone 2
-<BR> <epsg32083> : NAD27 / MTM zone 3
-<BR> <epsg32084> : NAD27 / MTM zone 4
-<BR> <epsg32085> : NAD27 / MTM zone 5
-<BR> <epsg32086> : NAD27 / MTM zone 6
-<BR> <epsg32098> : NAD27 / Quebec Lambert
-<BR> <epsg32099> : NAD27 / Louisiana Offshore
-<BR> <epsg32100> : NAD83 / Montana
-<BR> <epsg32104> : NAD83 / Nebraska
-<BR> <epsg32107> : NAD83 / Nevada East
-<BR> <epsg32108> : NAD83 / Nevada Central
-<BR> <epsg32109> : NAD83 / Nevada West
-<BR> <epsg32110> : NAD83 / New Hampshire
-<BR> <epsg32111> : NAD83 / New Jersey
-<BR> <epsg32112> : NAD83 / New Mexico East
-<BR> <epsg32113> : NAD83 / New Mexico Central
-<BR> <epsg32114> : NAD83 / New Mexico West
-<BR> <epsg32115> : NAD83 / New York East
-<BR> <epsg32116> : NAD83 / New York Central
-<BR> <epsg32117> : NAD83 / New York West
-<BR> <epsg32118> : NAD83 / New York Long Island
-<BR> <epsg32119> : NAD83 / North Carolina
-<BR> <epsg32120> : NAD83 / North Dakota North
-<BR> <epsg32121> : NAD83 / North Dakota South
-<BR> <epsg32122> : NAD83 / Ohio North
-<BR> <epsg32123> : NAD83 / Ohio South
-<BR> <epsg32124> : NAD83 / Oklahoma North
-<BR> <epsg32125> : NAD83 / Oklahoma South
-<BR> <epsg32126> : NAD83 / Oregon North
-<BR> <epsg32127> : NAD83 / Oregon South
-<BR> <epsg32128> : NAD83 / Pennsylvania North
-<BR> <epsg32129> : NAD83 / Pennsylvania South
-<BR> <epsg32130> : NAD83 / Rhode Island
-<BR> <epsg32133> : NAD83 / South Carolina
-<BR> <epsg32134> : NAD83 / South Dakota North
-<BR> <epsg32135> : NAD83 / South Dakota South
-<BR> <epsg32136> : NAD83 / Tennessee
-<BR> <epsg32137> : NAD83 / Texas North
-<BR> <epsg32138> : NAD83 / Texas North Central
-<BR> <epsg32139> : NAD83 / Texas Central
-<BR> <epsg32140> : NAD83 / Texas South Central
-<BR> <epsg32141> : NAD83 / Texas South
-<BR> <epsg32142> : NAD83 / Utah North
-<BR> <epsg32143> : NAD83 / Utah Central
-<BR> <epsg32144> : NAD83 / Utah South
-<BR> <epsg32145> : NAD83 / Vermont
-<BR> <epsg32146> : NAD83 / Virginia North
-<BR> <epsg32147> : NAD83 / Virginia South
-<BR> <epsg32148> : NAD83 / Washington North
-<BR> <epsg32149> : NAD83 / Washington South
-<BR> <epsg32150> : NAD83 / West Virginia North
-<BR> <epsg32151> : NAD83 / West Virginia South
-<BR> <epsg32152> : NAD83 / Wisconsin North
-<BR> <epsg32153> : NAD83 / Wisconsin Central
-<BR> <epsg32154> : NAD83 / Wisconsin South
-<BR> <epsg32155> : NAD83 / Wyoming East
-<BR> <epsg32156> : NAD83 / Wyoming East Central
-<BR> <epsg32157> : NAD83 / Wyoming West Central
-<BR> <epsg32158> : NAD83 / Wyoming West
-<BR> <epsg32161> : NAD83 / Puerto Rico & Virgin Is.
-<BR> <epsg32164> : NAD83 / BLM 14N (ftUS)
-<BR> <epsg32165> : NAD83 / BLM 15N (ftUS)
-<BR> <epsg32166> : NAD83 / BLM 16N (ftUS)
-<BR> <epsg32167> : NAD83 / BLM 17N (ftUS)
-<BR> <epsg32180> : NAD83 / SCoPQ zone 2
-<BR> <epsg32181> : NAD83 / MTM zone 1
-<BR> <epsg32182> : NAD83 / MTM zone 2
-<BR> <epsg32183> : NAD83 / MTM zone 3
-<BR> <epsg32184> : NAD83 / MTM zone 4
-<BR> <epsg32185> : NAD83 / MTM zone 5
-<BR> <epsg32186> : NAD83 / MTM zone 6
-<BR> <epsg32187> : NAD83 / MTM zone 7
-<BR> <epsg32188> : NAD83 / MTM zone 8
-<BR> <epsg32189> : NAD83 / MTM zone 9
-<BR> <epsg32190> : NAD83 / MTM zone 10
-<BR> <epsg32191> : NAD83 / MTM zone 11
-<BR> <epsg32192> : NAD83 / MTM zone 12
-<BR> <epsg32193> : NAD83 / MTM zone 13
-<BR> <epsg32194> : NAD83 / MTM zone 14
-<BR> <epsg32195> : NAD83 / MTM zone 15
-<BR> <epsg32196> : NAD83 / MTM zone 16
-<BR> <epsg32197> : NAD83 / MTM zone 17
-<BR> <epsg32198> : NAD83 / Quebec Lambert
-<BR> <epsg32199> : NAD83 / Louisiana Offshore
-<BR> <epsg32201> : WGS 72 / UTM zone 1N
-<BR> <epsg32202> : WGS 72 / UTM zone 2N
-<BR> <epsg32203> : WGS 72 / UTM zone 3N
-<BR> <epsg32204> : WGS 72 / UTM zone 4N
-<BR> <epsg32205> : WGS 72 / UTM zone 5N
-<BR> <epsg32206> : WGS 72 / UTM zone 6N
-<BR> <epsg32207> : WGS 72 / UTM zone 7N
-<BR> <epsg32208> : WGS 72 / UTM zone 8N
-<BR> <epsg32209> : WGS 72 / UTM zone 9N
-<BR> <epsg32210> : WGS 72 / UTM zone 10N
-<BR> <epsg32211> : WGS 72 / UTM zone 11N
-<BR> <epsg32212> : WGS 72 / UTM zone 12N
-<BR> <epsg32213> : WGS 72 / UTM zone 13N
-<BR> <epsg32214> : WGS 72 / UTM zone 14N
-<BR> <epsg32215> : WGS 72 / UTM zone 15N
-<BR> <epsg32216> : WGS 72 / UTM zone 16N
-<BR> <epsg32217> : WGS 72 / UTM zone 17N
-<BR> <epsg32218> : WGS 72 / UTM zone 18N
-<BR> <epsg32219> : WGS 72 / UTM zone 19N
-<BR> <epsg32220> : WGS 72 / UTM zone 20N
-<BR> <epsg32221> : WGS 72 / UTM zone 21N
-<BR> <epsg32222> : WGS 72 / UTM zone 22N
-<BR> <epsg32223> : WGS 72 / UTM zone 23N
-<BR> <epsg32224> : WGS 72 / UTM zone 24N
-<BR> <epsg32225> : WGS 72 / UTM zone 25N
-<BR> <epsg32226> : WGS 72 / UTM zone 26N
-<BR> <epsg32227> : WGS 72 / UTM zone 27N
-<BR> <epsg32228> : WGS 72 / UTM zone 28N
-<BR> <epsg32229> : WGS 72 / UTM zone 29N
-<BR> <epsg32230> : WGS 72 / UTM zone 30N
-<BR> <epsg32231> : WGS 72 / UTM zone 31N
-<BR> <epsg32232> : WGS 72 / UTM zone 32N
-<BR> <epsg32233> : WGS 72 / UTM zone 33N
-<BR> <epsg32234> : WGS 72 / UTM zone 34N
-<BR> <epsg32235> : WGS 72 / UTM zone 35N
-<BR> <epsg32236> : WGS 72 / UTM zone 36N
-<BR> <epsg32237> : WGS 72 / UTM zone 37N
-<BR> <epsg32238> : WGS 72 / UTM zone 38N
-<BR> <epsg32239> : WGS 72 / UTM zone 39N
-<BR> <epsg32240> : WGS 72 / UTM zone 40N
-<BR> <epsg32241> : WGS 72 / UTM zone 41N
-<BR> <epsg32242> : WGS 72 / UTM zone 42N
-<BR> <epsg32243> : WGS 72 / UTM zone 43N
-<BR> <epsg32244> : WGS 72 / UTM zone 44N
-<BR> <epsg32245> : WGS 72 / UTM zone 45N
-<BR> <epsg32246> : WGS 72 / UTM zone 46N
-<BR> <epsg32247> : WGS 72 / UTM zone 47N
-<BR> <epsg32248> : WGS 72 / UTM zone 48N
-<BR> <epsg32249> : WGS 72 / UTM zone 49N
-<BR> <epsg32250> : WGS 72 / UTM zone 50N
-<BR> <epsg32251> : WGS 72 / UTM zone 51N
-<BR> <epsg32252> : WGS 72 / UTM zone 52N
-<BR> <epsg32253> : WGS 72 / UTM zone 53N
-<BR> <epsg32254> : WGS 72 / UTM zone 54N
-<BR> <epsg32255> : WGS 72 / UTM zone 55N
-<BR> <epsg32256> : WGS 72 / UTM zone 56N
-<BR> <epsg32257> : WGS 72 / UTM zone 57N
-<BR> <epsg32258> : WGS 72 / UTM zone 58N
-<BR> <epsg32259> : WGS 72 / UTM zone 59N
-<BR> <epsg32260> : WGS 72 / UTM zone 60N
-<BR> <epsg32301> : WGS 72 / UTM zone 1S
-<BR> <epsg32302> : WGS 72 / UTM zone 2S
-<BR> <epsg32303> : WGS 72 / UTM zone 3S
-<BR> <epsg32304> : WGS 72 / UTM zone 4S
-<BR> <epsg32305> : WGS 72 / UTM zone 5S
-<BR> <epsg32306> : WGS 72 / UTM zone 6S
-<BR> <epsg32307> : WGS 72 / UTM zone 7S
-<BR> <epsg32308> : WGS 72 / UTM zone 8S
-<BR> <epsg32309> : WGS 72 / UTM zone 9S
-<BR> <epsg32310> : WGS 72 / UTM zone 10S
-<BR> <epsg32311> : WGS 72 / UTM zone 11S
-<BR> <epsg32312> : WGS 72 / UTM zone 12S
-<BR> <epsg32313> : WGS 72 / UTM zone 13S
-<BR> <epsg32314> : WGS 72 / UTM zone 14S
-<BR> <epsg32315> : WGS 72 / UTM zone 15S
-<BR> <epsg32316> : WGS 72 / UTM zone 16S
-<BR> <epsg32317> : WGS 72 / UTM zone 17S
-<BR> <epsg32318> : WGS 72 / UTM zone 18S
-<BR> <epsg32319> : WGS 72 / UTM zone 19S
-<BR> <epsg32320> : WGS 72 / UTM zone 20S
-<BR> <epsg32321> : WGS 72 / UTM zone 21S
-<BR> <epsg32322> : WGS 72 / UTM zone 22S
-<BR> <epsg32323> : WGS 72 / UTM zone 23S
-<BR> <epsg32324> : WGS 72 / UTM zone 24S
-<BR> <epsg32325> : WGS 72 / UTM zone 25S
-<BR> <epsg32326> : WGS 72 / UTM zone 26S
-<BR> <epsg32327> : WGS 72 / UTM zone 27S
-<BR> <epsg32328> : WGS 72 / UTM zone 28S
-<BR> <epsg32329> : WGS 72 / UTM zone 29S
-<BR> <epsg32330> : WGS 72 / UTM zone 30S
-<BR> <epsg32331> : WGS 72 / UTM zone 31S
-<BR> <epsg32332> : WGS 72 / UTM zone 32S
-<BR> <epsg32333> : WGS 72 / UTM zone 33S
-<BR> <epsg32334> : WGS 72 / UTM zone 34S
-<BR> <epsg32335> : WGS 72 / UTM zone 35S
-<BR> <epsg32336> : WGS 72 / UTM zone 36S
-<BR> <epsg32337> : WGS 72 / UTM zone 37S
-<BR> <epsg32338> : WGS 72 / UTM zone 38S
-<BR> <epsg32339> : WGS 72 / UTM zone 39S
-<BR> <epsg32340> : WGS 72 / UTM zone 40S
-<BR> <epsg32341> : WGS 72 / UTM zone 41S
-<BR> <epsg32342> : WGS 72 / UTM zone 42S
-<BR> <epsg32343> : WGS 72 / UTM zone 43S
-<BR> <epsg32344> : WGS 72 / UTM zone 44S
-<BR> <epsg32345> : WGS 72 / UTM zone 45S
-<BR> <epsg32346> : WGS 72 / UTM zone 46S
-<BR> <epsg32347> : WGS 72 / UTM zone 47S
-<BR> <epsg32348> : WGS 72 / UTM zone 48S
-<BR> <epsg32349> : WGS 72 / UTM zone 49S
-<BR> <epsg32350> : WGS 72 / UTM zone 50S
-<BR> <epsg32351> : WGS 72 / UTM zone 51S
-<BR> <epsg32352> : WGS 72 / UTM zone 52S
-<BR> <epsg32353> : WGS 72 / UTM zone 53S
-<BR> <epsg32354> : WGS 72 / UTM zone 54S
-<BR> <epsg32355> : WGS 72 / UTM zone 55S
-<BR> <epsg32356> : WGS 72 / UTM zone 56S
-<BR> <epsg32357> : WGS 72 / UTM zone 57S
-<BR> <epsg32358> : WGS 72 / UTM zone 58S
-<BR> <epsg32359> : WGS 72 / UTM zone 59S
-<BR> <epsg32360> : WGS 72 / UTM zone 60S
-<BR> <epsg32401> : WGS 72BE / UTM zone 1N
-<BR> <epsg32402> : WGS 72BE / UTM zone 2N
-<BR> <epsg32403> : WGS 72BE / UTM zone 3N
-<BR> <epsg32404> : WGS 72BE / UTM zone 4N
-<BR> <epsg32405> : WGS 72BE / UTM zone 5N
-<BR> <epsg32406> : WGS 72BE / UTM zone 6N
-<BR> <epsg32407> : WGS 72BE / UTM zone 7N
-<BR> <epsg32408> : WGS 72BE / UTM zone 8N
-<BR> <epsg32409> : WGS 72BE / UTM zone 9N
-<BR> <epsg32410> : WGS 72BE / UTM zone 10N
-<BR> <epsg32411> : WGS 72BE / UTM zone 11N
-<BR> <epsg32412> : WGS 72BE / UTM zone 12N
-<BR> <epsg32413> : WGS 72BE / UTM zone 13N
-<BR> <epsg32414> : WGS 72BE / UTM zone 14N
-<BR> <epsg32415> : WGS 72BE / UTM zone 15N
-<BR> <epsg32416> : WGS 72BE / UTM zone 16N
-<BR> <epsg32417> : WGS 72BE / UTM zone 17N
-<BR> <epsg32418> : WGS 72BE / UTM zone 18N
-<BR> <epsg32419> : WGS 72BE / UTM zone 19N
-<BR> <epsg32420> : WGS 72BE / UTM zone 20N
-<BR> <epsg32421> : WGS 72BE / UTM zone 21N
-<BR> <epsg32422> : WGS 72BE / UTM zone 22N
-<BR> <epsg32423> : WGS 72BE / UTM zone 23N
-<BR> <epsg32424> : WGS 72BE / UTM zone 24N
-<BR> <epsg32425> : WGS 72BE / UTM zone 25N
-<BR> <epsg32426> : WGS 72BE / UTM zone 26N
-<BR> <epsg32427> : WGS 72BE / UTM zone 27N
-<BR> <epsg32428> : WGS 72BE / UTM zone 28N
-<BR> <epsg32429> : WGS 72BE / UTM zone 29N
-<BR> <epsg32430> : WGS 72BE / UTM zone 30N
-<BR> <epsg32431> : WGS 72BE / UTM zone 31N
-<BR> <epsg32432> : WGS 72BE / UTM zone 32N
-<BR> <epsg32433> : WGS 72BE / UTM zone 33N
-<BR> <epsg32434> : WGS 72BE / UTM zone 34N
-<BR> <epsg32435> : WGS 72BE / UTM zone 35N
-<BR> <epsg32436> : WGS 72BE / UTM zone 36N
-<BR> <epsg32437> : WGS 72BE / UTM zone 37N
-<BR> <epsg32438> : WGS 72BE / UTM zone 38N
-<BR> <epsg32439> : WGS 72BE / UTM zone 39N
-<BR> <epsg32440> : WGS 72BE / UTM zone 40N
-<BR> <epsg32441> : WGS 72BE / UTM zone 41N
-<BR> <epsg32442> : WGS 72BE / UTM zone 42N
-<BR> <epsg32443> : WGS 72BE / UTM zone 43N
-<BR> <epsg32444> : WGS 72BE / UTM zone 44N
-<BR> <epsg32445> : WGS 72BE / UTM zone 45N
-<BR> <epsg32446> : WGS 72BE / UTM zone 46N
-<BR> <epsg32447> : WGS 72BE / UTM zone 47N
-<BR> <epsg32448> : WGS 72BE / UTM zone 48N
-<BR> <epsg32449> : WGS 72BE / UTM zone 49N
-<BR> <epsg32450> : WGS 72BE / UTM zone 50N
-<BR> <epsg32451> : WGS 72BE / UTM zone 51N
-<BR> <epsg32452> : WGS 72BE / UTM zone 52N
-<BR> <epsg32453> : WGS 72BE / UTM zone 53N
-<BR> <epsg32454> : WGS 72BE / UTM zone 54N
-<BR> <epsg32455> : WGS 72BE / UTM zone 55N
-<BR> <epsg32456> : WGS 72BE / UTM zone 56N
-<BR> <epsg32457> : WGS 72BE / UTM zone 57N
-<BR> <epsg32458> : WGS 72BE / UTM zone 58N
-<BR> <epsg32459> : WGS 72BE / UTM zone 59N
-<BR> <epsg32460> : WGS 72BE / UTM zone 60N
-<BR> <epsg32501> : WGS 72BE / UTM zone 1S
-<BR> <epsg32502> : WGS 72BE / UTM zone 2S
-<BR> <epsg32503> : WGS 72BE / UTM zone 3S
-<BR> <epsg32504> : WGS 72BE / UTM zone 4S
-<BR> <epsg32505> : WGS 72BE / UTM zone 5S
-<BR> <epsg32506> : WGS 72BE / UTM zone 6S
-<BR> <epsg32507> : WGS 72BE / UTM zone 7S
-<BR> <epsg32508> : WGS 72BE / UTM zone 8S
-<BR> <epsg32509> : WGS 72BE / UTM zone 9S
-<BR> <epsg32510> : WGS 72BE / UTM zone 10S
-<BR> <epsg32511> : WGS 72BE / UTM zone 11S
-<BR> <epsg32512> : WGS 72BE / UTM zone 12S
-<BR> <epsg32513> : WGS 72BE / UTM zone 13S
-<BR> <epsg32514> : WGS 72BE / UTM zone 14S
-<BR> <epsg32515> : WGS 72BE / UTM zone 15S
-<BR> <epsg32516> : WGS 72BE / UTM zone 16S
-<BR> <epsg32517> : WGS 72BE / UTM zone 17S
-<BR> <epsg32518> : WGS 72BE / UTM zone 18S
-<BR> <epsg32519> : WGS 72BE / UTM zone 19S
-<BR> <epsg32520> : WGS 72BE / UTM zone 20S
-<BR> <epsg32521> : WGS 72BE / UTM zone 21S
-<BR> <epsg32522> : WGS 72BE / UTM zone 22S
-<BR> <epsg32523> : WGS 72BE / UTM zone 23S
-<BR> <epsg32524> : WGS 72BE / UTM zone 24S
-<BR> <epsg32525> : WGS 72BE / UTM zone 25S
-<BR> <epsg32526> : WGS 72BE / UTM zone 26S
-<BR> <epsg32527> : WGS 72BE / UTM zone 27S
-<BR> <epsg32528> : WGS 72BE / UTM zone 28S
-<BR> <epsg32529> : WGS 72BE / UTM zone 29S
-<BR> <epsg32530> : WGS 72BE / UTM zone 30S
-<BR> <epsg32531> : WGS 72BE / UTM zone 31S
-<BR> <epsg32532> : WGS 72BE / UTM zone 32S
-<BR> <epsg32533> : WGS 72BE / UTM zone 33S
-<BR> <epsg32534> : WGS 72BE / UTM zone 34S
-<BR> <epsg32535> : WGS 72BE / UTM zone 35S
-<BR> <epsg32536> : WGS 72BE / UTM zone 36S
-<BR> <epsg32537> : WGS 72BE / UTM zone 37S
-<BR> <epsg32538> : WGS 72BE / UTM zone 38S
-<BR> <epsg32539> : WGS 72BE / UTM zone 39S
-<BR> <epsg32540> : WGS 72BE / UTM zone 40S
-<BR> <epsg32541> : WGS 72BE / UTM zone 41S
-<BR> <epsg32542> : WGS 72BE / UTM zone 42S
-<BR> <epsg32543> : WGS 72BE / UTM zone 43S
-<BR> <epsg32544> : WGS 72BE / UTM zone 44S
-<BR> <epsg32545> : WGS 72BE / UTM zone 45S
-<BR> <epsg32546> : WGS 72BE / UTM zone 46S
-<BR> <epsg32547> : WGS 72BE / UTM zone 47S
-<BR> <epsg32548> : WGS 72BE / UTM zone 48S
-<BR> <epsg32549> : WGS 72BE / UTM zone 49S
-<BR> <epsg32550> : WGS 72BE / UTM zone 50S
-<BR> <epsg32551> : WGS 72BE / UTM zone 51S
-<BR> <epsg32552> : WGS 72BE / UTM zone 52S
-<BR> <epsg32553> : WGS 72BE / UTM zone 53S
-<BR> <epsg32554> : WGS 72BE / UTM zone 54S
-<BR> <epsg32555> : WGS 72BE / UTM zone 55S
-<BR> <epsg32556> : WGS 72BE / UTM zone 56S
-<BR> <epsg32557> : WGS 72BE / UTM zone 57S
-<BR> <epsg32558> : WGS 72BE / UTM zone 58S
-<BR> <epsg32559> : WGS 72BE / UTM zone 59S
-<BR> <epsg32560> : WGS 72BE / UTM zone 60S
-<BR> <epsg32601> : WGS 84 / UTM zone 1N
-<BR> <epsg32602> : WGS 84 / UTM zone 2N
-<BR> <epsg32603> : WGS 84 / UTM zone 3N
-<BR> <epsg32604> : WGS 84 / UTM zone 4N
-<BR> <epsg32605> : WGS 84 / UTM zone 5N
-<BR> <epsg32606> : WGS 84 / UTM zone 6N
-<BR> <epsg32607> : WGS 84 / UTM zone 7N
-<BR> <epsg32608> : WGS 84 / UTM zone 8N
-<BR> <epsg32609> : WGS 84 / UTM zone 9N
-<BR> <epsg32610> : WGS 84 / UTM zone 10N
-<BR> <epsg32611> : WGS 84 / UTM zone 11N
-<BR> <epsg32612> : WGS 84 / UTM zone 12N
-<BR> <epsg32613> : WGS 84 / UTM zone 13N
-<BR> <epsg32614> : WGS 84 / UTM zone 14N
-<BR> <epsg32615> : WGS 84 / UTM zone 15N
-<BR> <epsg32616> : WGS 84 / UTM zone 16N
-<BR> <epsg32617> : WGS 84 / UTM zone 17N
-<BR> <epsg32618> : WGS 84 / UTM zone 18N
-<BR> <epsg32619> : WGS 84 / UTM zone 19N
-<BR> <epsg32620> : WGS 84 / UTM zone 20N
-<BR> <epsg32621> : WGS 84 / UTM zone 21N
-<BR> <epsg32622> : WGS 84 / UTM zone 22N
-<BR> <epsg32623> : WGS 84 / UTM zone 23N
-<BR> <epsg32624> : WGS 84 / UTM zone 24N
-<BR> <epsg32625> : WGS 84 / UTM zone 25N
-<BR> <epsg32626> : WGS 84 / UTM zone 26N
-<BR> <epsg32627> : WGS 84 / UTM zone 27N
-<BR> <epsg32628> : WGS 84 / UTM zone 28N
-<BR> <epsg32629> : WGS 84 / UTM zone 29N
-<BR> <epsg32630> : WGS 84 / UTM zone 30N
-<BR> <epsg32631> : WGS 84 / UTM zone 31N
-<BR> <epsg32632> : WGS 84 / UTM zone 32N
-<BR> <epsg32633> : WGS 84 / UTM zone 33N
-<BR> <epsg32634> : WGS 84 / UTM zone 34N
-<BR> <epsg32635> : WGS 84 / UTM zone 35N
-<BR> <epsg32636> : WGS 84 / UTM zone 36N
-<BR> <epsg32637> : WGS 84 / UTM zone 37N
-<BR> <epsg32638> : WGS 84 / UTM zone 38N
-<BR> <epsg32639> : WGS 84 / UTM zone 39N
-<BR> <epsg32640> : WGS 84 / UTM zone 40N
-<BR> <epsg32641> : WGS 84 / UTM zone 41N
-<BR> <epsg32642> : WGS 84 / UTM zone 42N
-<BR> <epsg32643> : WGS 84 / UTM zone 43N
-<BR> <epsg32644> : WGS 84 / UTM zone 44N
-<BR> <epsg32645> : WGS 84 / UTM zone 45N
-<BR> <epsg32646> : WGS 84 / UTM zone 46N
-<BR> <epsg32647> : WGS 84 / UTM zone 47N
-<BR> <epsg32648> : WGS 84 / UTM zone 48N
-<BR> <epsg32649> : WGS 84 / UTM zone 49N
-<BR> <epsg32650> : WGS 84 / UTM zone 50N
-<BR> <epsg32651> : WGS 84 / UTM zone 51N
-<BR> <epsg32652> : WGS 84 / UTM zone 52N
-<BR> <epsg32653> : WGS 84 / UTM zone 53N
-<BR> <epsg32654> : WGS 84 / UTM zone 54N
-<BR> <epsg32655> : WGS 84 / UTM zone 55N
-<BR> <epsg32656> : WGS 84 / UTM zone 56N
-<BR> <epsg32657> : WGS 84 / UTM zone 57N
-<BR> <epsg32658> : WGS 84 / UTM zone 58N
-<BR> <epsg32659> : WGS 84 / UTM zone 59N
-<BR> <epsg32660> : WGS 84 / UTM zone 60N
-<BR> <epsg32661> : WGS 84 / UPS North
-<BR> <epsg32662> : WGS 84 / Plate Carree
-<BR> <epsg32664> : WGS 84 / BLM 14N (ftUS)
-<BR> <epsg32665> : WGS 84 / BLM 15N (ftUS)
-<BR> <epsg32666> : WGS 84 / BLM 16N (ftUS)
-<BR> <epsg32667> : WGS 84 / BLM 17N (ftUS)
-<BR> <epsg32701> : WGS 84 / UTM zone 1S
-<BR> <epsg32702> : WGS 84 / UTM zone 2S
-<BR> <epsg32703> : WGS 84 / UTM zone 3S
-<BR> <epsg32704> : WGS 84 / UTM zone 4S
-<BR> <epsg32705> : WGS 84 / UTM zone 5S
-<BR> <epsg32706> : WGS 84 / UTM zone 6S
-<BR> <epsg32707> : WGS 84 / UTM zone 7S
-<BR> <epsg32708> : WGS 84 / UTM zone 8S
-<BR> <epsg32709> : WGS 84 / UTM zone 9S
-<BR> <epsg32710> : WGS 84 / UTM zone 10S
-<BR> <epsg32711> : WGS 84 / UTM zone 11S
-<BR> <epsg32712> : WGS 84 / UTM zone 12S
-<BR> <epsg32713> : WGS 84 / UTM zone 13S
-<BR> <epsg32714> : WGS 84 / UTM zone 14S
-<BR> <epsg32715> : WGS 84 / UTM zone 15S
-<BR> <epsg32716> : WGS 84 / UTM zone 16S
-<BR> <epsg32717> : WGS 84 / UTM zone 17S
-<BR> <epsg32718> : WGS 84 / UTM zone 18S
-<BR> <epsg32719> : WGS 84 / UTM zone 19S
-<BR> <epsg32720> : WGS 84 / UTM zone 20S
-<BR> <epsg32721> : WGS 84 / UTM zone 21S
-<BR> <epsg32722> : WGS 84 / UTM zone 22S
-<BR> <epsg32723> : WGS 84 / UTM zone 23S
-<BR> <epsg32724> : WGS 84 / UTM zone 24S
-<BR> <epsg32725> : WGS 84 / UTM zone 25S
-<BR> <epsg32726> : WGS 84 / UTM zone 26S
-<BR> <epsg32727> : WGS 84 / UTM zone 27S
-<BR> <epsg32728> : WGS 84 / UTM zone 28S
-<BR> <epsg32729> : WGS 84 / UTM zone 29S
-<BR> <epsg32730> : WGS 84 / UTM zone 30S
-<BR> <epsg32731> : WGS 84 / UTM zone 31S
-<BR> <epsg32732> : WGS 84 / UTM zone 32S
-<BR> <epsg32733> : WGS 84 / UTM zone 33S
-<BR> <epsg32734> : WGS 84 / UTM zone 34S
-<BR> <epsg32735> : WGS 84 / UTM zone 35S
-<BR> <epsg32736> : WGS 84 / UTM zone 36S
-<BR> <epsg32737> : WGS 84 / UTM zone 37S
-<BR> <epsg32738> : WGS 84 / UTM zone 38S
-<BR> <epsg32739> : WGS 84 / UTM zone 39S
-<BR> <epsg32740> : WGS 84 / UTM zone 40S
-<BR> <epsg32741> : WGS 84 / UTM zone 41S
-<BR> <epsg32742> : WGS 84 / UTM zone 42S
-<BR> <epsg32743> : WGS 84 / UTM zone 43S
-<BR> <epsg32744> : WGS 84 / UTM zone 44S
-<BR> <epsg32745> : WGS 84 / UTM zone 45S
-<BR> <epsg32746> : WGS 84 / UTM zone 46S
-<BR> <epsg32747> : WGS 84 / UTM zone 47S
-<BR> <epsg32748> : WGS 84 / UTM zone 48S
-<BR> <epsg32749> : WGS 84 / UTM zone 49S
-<BR> <epsg32750> : WGS 84 / UTM zone 50S
-<BR> <epsg32751> : WGS 84 / UTM zone 51S
-<BR> <epsg32752> : WGS 84 / UTM zone 52S
-<BR> <epsg32753> : WGS 84 / UTM zone 53S
-<BR> <epsg32754> : WGS 84 / UTM zone 54S
-<BR> <epsg32755> : WGS 84 / UTM zone 55S
-<BR> <epsg32756> : WGS 84 / UTM zone 56S
-<BR> <epsg32757> : WGS 84 / UTM zone 57S
-<BR> <epsg32758> : WGS 84 / UTM zone 58S
-<BR> <epsg32759> : WGS 84 / UTM zone 59S
-<BR> <epsg32760> : WGS 84 / UTM zone 60S
-<BR> <epsg32761> : WGS 84 / UPS South
-<BR> <epsg32766> : WGS 84 / TM 36 SE
-<P>
-<BR> ---------------------------------------------------------
-<BR> Additional EPSG-like projection definitions
-<BR> ---------------------------------------------------------
-<BR> OGC-defined extended codes  (41000--41999) see <A HREF="http://www.digitalearth.gov/wmt/auto.html">http://www.digitalearth.gov/wmt/auto.html</A>
-<BR> ---------------------------------------------------------
-<BR> <epsg41001> : WGS84 / Simple Mercator
-<P>
-<BR> ---------------------------------------------------------
-<BR> CubeWerx-defined extended codes  (42100--42199)
-<BR> ---------------------------------------------------------
-<BR> <epsg42101> : WGS 84 / LCC Canada
-<BR> <epsg42102> : NAD83 / BC Albers (this has been superceeded but is kept for compatibility)
-<BR> <epsg42103> : WGS 84 / LCC USA
-<BR> <epsg42103> : NAD83 / MTM zone 8 Québec
-<BR> <epsg42105> : WGS84 / Merc NorthAm
-<BR> <epsg42106> : WGS84 / Lambert Azim Mozambique
-<P>
-<BR> ---------------------------------------------------------
-<BR> CubeWerx-customer definitions  (42300--42399)
-<BR> ---------------------------------------------------------
-<BR> <epsg42301> : NAD27 / Polar Stereographic / CM=-98
-<BR> <epsg42302>JapanOrtho.09 09
-<BR> <epsg42303> : NAD83 / Albers NorthAm
-<BR> <epsg42304> : NAD83 / NRCan LCC Canada
-<BR> <epsg42305> : France_II
-<BR> <epsg42306> : NAD83/QC_LCC
-<BR> <epsg42307> : NAD83 / Texas Central - feet
-<BR> <epsg42308> : NAD27 / California Albers
-<BR> <epsg42309> : NAD 83 / LCC Canada AVHRR-2
-<BR> <epsg42310> : WGS84+GRS80 / Mercator
-<BR> <epsg42311> : NAD83 / LCC Statcan
-<P>
-<BR> ---------------------------------------------------------
-<BR> ESRI projection definitions
-<BR> ---------------------------------------------------------
-<BR> <esri2000> : Anguilla 1957 / British West Indies Grid
-<BR> <esri2001> : Antigua 1943 / British West Indies Grid
-<BR> <esri2002> : Dominica 1945 / British West Indies Grid
-<BR> <esri2003> : Grenada 1953 / British West Indies Grid
-<BR> <esri2004> : Montserrat 58 / British West Indies Grid
-<BR> <esri2005> : St Kitts 1955 / British West Indies Grid
-<BR> <esri2006> : St Lucia 1955 / British West Indies Grid
-<BR> <esri2007> : St Vincent 45 / British West Indies Grid
-<BR> <esri2008> : NAD27(CGQ77) / SCoPQ zone 2
-<BR> <esri2009> : NAD27(CGQ77) / SCoPQ zone 3
-<BR> <esri2010> : NAD27(CGQ77) / SCoPQ zone 4
-<BR> <esri2011> : NAD27(CGQ77) / SCoPQ zone 5
-<BR> <esri2012> : NAD27(CGQ77) / SCoPQ zone 6
-<BR> <esri2013> : NAD27(CGQ77) / SCoPQ zone 7
-<BR> <esri2014> : NAD27(CGQ77) / SCoPQ zone 8
-<BR> <esri2015> : NAD27(CGQ77) / SCoPQ zone 9
-<BR> <esri2016> : NAD27(CGQ77) / SCoPQ zone 10
-<BR> <esri2017> : NAD27(76) / MTM zone 8
-<BR> <esri2018> : NAD27(76) / MTM zone 9
-<BR> <esri2019> : NAD27(76) / MTM zone 10
-<BR> <esri2020> : NAD27(76) / MTM zone 11
-<BR> <esri2021> : NAD27(76) / MTM zone 12
-<BR> <esri2022> : NAD27(76) / MTM zone 13
-<BR> <esri2023> : NAD27(76) / MTM zone 14
-<BR> <esri2024> : NAD27(76) / MTM zone 15
-<BR> <esri2025> : NAD27(76) / MTM zone 16
-<BR> <esri2026> : NAD27(76) / MTM zone 17
-<BR> <esri2027> : NAD27(76) / UTM zone 15N
-<BR> <esri2028> : NAD27(76) / UTM zone 16N
-<BR> <esri2029> : NAD27(76) / UTM zone 17N
-<BR> <esri2030> : NAD27(76) / UTM zone 18N
-<BR> <esri2031> : NAD27(CGQ77) / UTM zone 17N
-<BR> <esri2032> : NAD27(CGQ77) / UTM zone 18N
-<BR> <esri2033> : NAD27(CGQ77) / UTM zone 19N
-<BR> <esri2034> : NAD27(CGQ77) / UTM zone 20N
-<BR> <esri2035> : NAD27(CGQ77) / UTM zone 21N
-<BR> <esri2036> : NAD83(CSRS98) / New Brunswick Stereo
-<BR> <esri2037> : NAD83(CSRS98) / UTM zone 19N
-<BR> <esri2038> : NAD83(CSRS98) / UTM zone 20N
-<BR> <esri2039> : Israel / Israeli TM Grid
-<BR> <esri2040> : Locodjo 1965 / UTM zone 30N
-<BR> <esri2041> : Abidjan 1987 / UTM zone 30N
-<BR> <esri2042> : Locodjo 1965 / UTM zone 29N
-<BR> <esri2043> : Abidjan 1987 / UTM zone 29N
-<BR> <esri2044> : Hanoi 1972 / Gauss-Kruger zone 18
-<BR> <esri2045> : Hanoi 1972 / Gauss-Kruger zone 19
-<BR> <esri2056> : CH1903+ / LV95
-<BR> <esri2057> : Rassadiran / Nakhl e Taqi
-<BR> <esri2058> : ED50(ED77) / UTM zone 38N
-<BR> <esri2059> : ED50(ED77) / UTM zone 39N
-<BR> <esri2060> : ED50(ED77) / UTM zone 40N
-<BR> <esri2061> : ED50(ED77) / UTM zone 41N
-<BR> <esri2062> : Madrid 1870 (Madrid) / Spain
-<BR> <esri2063> : Dabola 1981 / UTM zone 28N
-<BR> <esri2064> : Dabola 1981 / UTM zone 29N
-<BR> <esri2065> : S-JTSK (Ferro) / Krovak
-<BR> <esri2066> : Mount Dillon / Tobago Grid
-<BR> <esri2067> : Naparima 1955 / UTM zone 20N
-<BR> <esri2068> : ELD79 / Libya zone 5
-<BR> <esri2069> : ELD79 / Libya zone 6
-<BR> <esri2070> : ELD79 / Libya zone 7
-<BR> <esri2071> : ELD79 / Libya zone 8
-<BR> <esri2072> : ELD79 / Libya zone 9
-<BR> <esri2073> : ELD79 / Libya zone 10
-<BR> <esri2074> : ELD79 / Libya zone 11
-<BR> <esri2075> : ELD79 / Libya zone 12
-<BR> <esri2076> : ELD79 / Libya zone 13
-<BR> <esri2077> : ELD79 / UTM zone 32N
-<BR> <esri2078> : ELD79 / UTM zone 33N
-<BR> <esri2079> : ELD79 / UTM zone 34N
-<BR> <esri2080> : ELD79 / UTM zone 35N
-<BR> <esri2081> : Chos Malal 1914 / Argentina zone 2
-<BR> <esri2082> : Pampa del Castillo / Argentina zone 2
-<BR> <esri2083> : Hito XVIII 1963 / Argentina zone 2
-<BR> <esri2084> : Hito XVIII 1963 / UTM zone 19S
-<BR> <esri2085> : NAD27 / Cuba Norte
-<BR> <esri2086> : NAD27 / Cuba Sur
-<BR> <esri2087> : ELD79 / TM 12 NE
-<BR> <esri2088> : Carthage / TM 11 NE
-<BR> <esri2089> : Yemen NGN96 / UTM zone 38N
-<BR> <esri2090> : Yemen NGN96 / UTM zone 39N
-<BR> <esri2091> : South Yemen / Gauss Kruger zone 8
-<BR> <esri2092> : South Yemen / Gauss Kruger zone 9
-<BR> <esri2093> : Hanoi 1972 / GK 106 NE
-<BR> <esri2094> : WGS 72BE / TM 106 NE
-<BR> <esri2095> : Bissau / UTM zone 28N
-<BR> <esri2096> : Korean 1985 / Korea East Belt
-<BR> <esri2097> : Korean 1985 / Korea Central Belt
-<BR> <esri2098> : Korean 1985 / Korea West Belt
-<BR> <esri2099> : Qatar 1948 / Qatar Grid
-<BR> <esri2100> : GGRS87 / Greek Grid
-<BR> <esri2101> : Lake / Maracaibo Grid M1
-<BR> <esri2102> : Lake / Maracaibo Grid
-<BR> <esri2103> : Lake / Maracaibo Grid M3
-<BR> <esri2104> : Lake / Maracaibo La Rosa Grid
-<BR> <esri2105> : NZGD2000 / Mount Eden Circuit 2000
-<BR> <esri2106> : NZGD2000 / Bay of Plenty Circuit 2000
-<BR> <esri2107> : NZGD2000 / Poverty Bay Circuit 2000
-<BR> <esri2108> : NZGD2000 / Hawkes Bay Circuit 2000
-<BR> <esri2109> : NZGD2000 / Taranaki Circuit 2000
-<BR> <esri2110> : NZGD2000 / Tuhirangi Circuit 2000
-<BR> <esri2111> : NZGD2000 / Wanganui Circuit 2000
-<BR> <esri2112> : NZGD2000 / Wairarapa Circuit 2000
-<BR> <esri2113> : NZGD2000 / Wellington Circuit 2000
-<BR> <esri2114> : NZGD2000 / Collingwood Circuit 2000
-<BR> <esri2115> : NZGD2000 / Nelson Circuit 2000
-<BR> <esri2116> : NZGD2000 / Karamea Circuit 2000
-<BR> <esri2117> : NZGD2000 / Buller Circuit 2000
-<BR> <esri2118> : NZGD2000 / Grey Circuit 2000
-<BR> <esri2119> : NZGD2000 / Amuri Circuit 2000
-<BR> <esri2120> : NZGD2000 / Marlborough Circuit 2000
-<BR> <esri2121> : NZGD2000 / Hokitika Circuit 2000
-<BR> <esri2122> : NZGD2000 / Okarito Circuit 2000
-<BR> <esri2123> : NZGD2000 / Jacksons Bay Circuit 2000
-<BR> <esri2124> : NZGD2000 / Mount Pleasant Circuit 2000
-<BR> <esri2125> : NZGD2000 / Gawler Circuit 2000
-<BR> <esri2126> : NZGD2000 / Timaru Circuit 2000
-<BR> <esri2127> : NZGD2000 / Lindis Peak Circuit 2000
-<BR> <esri2128> : NZGD2000 / Mount Nicholas Circuit 2000
-<BR> <esri2129> : NZGD2000 / Mount York Circuit 2000
-<BR> <esri2130> : NZGD2000 / Observation Point Circuit 2000
-<BR> <esri2131> : NZGD2000 / North Taieri Circuit 2000
-<BR> <esri2132> : NZGD2000 / Bluff Circuit 2000
-<BR> <esri2133> : NZGD2000 / UTM zone 58S
-<BR> <esri2134> : NZGD2000 / UTM zone 59S
-<BR> <esri2135> : NZGD2000 / UTM zone 60S
-<BR> <esri2136> : Accra / Ghana National Grid
-<BR> <esri2137> : Accra / TM 1 NW
-<BR> <esri2138> : NAD27(CGQ77) / Quebec Lambert
-<BR> <esri2139> : NAD83(CSRS98) / SCoPQ zone 2
-<BR> <esri2140> : NAD83(CSRS98) / MTM zone 3
-<BR> <esri2141> : NAD83(CSRS98) / MTM zone 4
-<BR> <esri2142> : NAD83(CSRS98) / MTM zone 5
-<BR> <esri2143> : NAD83(CSRS98) / MTM zone 6
-<BR> <esri2144> : NAD83(CSRS98) / MTM zone 7
-<BR> <esri2145> : NAD83(CSRS98) / MTM zone 8
-<BR> <esri2146> : NAD83(CSRS98) / MTM zone 9
-<BR> <esri2147> : NAD83(CSRS98) / MTM zone 10
-<BR> <esri2148> : NAD83(CSRS98) / UTM zone 21N
-<BR> <esri2149> : NAD83(CSRS98) / UTM zone 18N
-<BR> <esri2150> : NAD83(CSRS98) / UTM zone 17N
-<BR> <esri2151> : NAD83(CSRS98) / UTM zone 13N
-<BR> <esri2152> : NAD83(CSRS98) / UTM zone 12N
-<BR> <esri2153> : NAD83(CSRS98) / UTM zone 11N
-<BR> <esri2154> : RGF93 / Lambert-93
-<BR> <esri2155> : American Samoa 1962 / American Samoa Lambert
-<BR> <esri2156> : NAD83(HARN) / UTM zone 59S
-<BR> <esri2157> : IRENET95 / Irish Transverse Mercator
-<BR> <esri2158> : IRENET95 / UTM zone 29N
-<BR> <esri2159> : Sierra Leone 1924 / New Colony Grid
-<BR> <esri2160> : Sierra Leone 1924 / New War Office Grid
-<BR> <esri2161> : Sierra Leone 1968 / UTM zone 28N
-<BR> <esri2162> : Sierra Leone 1968 / UTM zone 29N
-<BR> <esri2163> : US National Atlas Equal Area
-<BR> <esri2164> : Locodjo 1965 / TM 5 NW
-<BR> <esri2165> : Abidjan 1987 / TM 5 NW
-<BR> <esri2166> : Pulkovo 1942(83) / Gauss Kruger zone 3
-<BR> <esri2167> : Pulkovo 1942(83) / Gauss Kruger zone 4
-<BR> <esri2168> : Pulkovo 1942(83) / Gauss Kruger zone 5
-<BR> <esri2169> : Luxembourg 1930 / Gauss
-<BR> <esri2170> : MGI / Slovenia Grid
-<BR> <esri2171> : Pulkovo 1942(58) / Poland zone I
-<BR> <esri2172> : Pulkovo 1942(58) / Poland zone II
-<BR> <esri2173> : Pulkovo 1942(58) / Poland zone III
-<BR> <esri2174> : Pulkovo 1942(58) / Poland zone IV
-<BR> <esri2175> : Pulkovo 1942(58) / Poland zone V
-<BR> <esri2176> : ETRS89 / Poland CS2000 zone 5
-<BR> <esri2177> : ETRS89 / Poland CS2000 zone 6
-<BR> <esri2178> : ETRS89 / Poland CS2000 zone 7
-<BR> <esri2179> : ETRS89 / Poland CS2000 zone 8
-<BR> <esri2180> : ETRS89 / Poland CS92
-<BR> <esri2188> : Azores Occidental 1939 / UTM zone 25N
-<BR> <esri2189> : Azores Central 1948 / UTM zone 26N
-<BR> <esri2190> : Azores Oriental 1940 / UTM zone 26N
-<BR> <esri2191> : Madeira 1936 / UTM zone 28N
-<BR> <esri2192> : ED50 / France EuroLambert
-<BR> <esri2193> : NZGD2000 / New Zealand Transverse Mercator
-<BR> <esri2194> : American Samoa 1962 / American Samoa Lambert
-<BR> <esri2195> : NAD83(HARN) / UTM zone 2S
-<BR> <esri2196> : ETRS89 / Kp2000 Jutland
-<BR> <esri2197> : ETRS89 / Kp2000 Zealand
-<BR> <esri2198> : ETRS89 / Kp2000 Bornholm
-<BR> <esri2199> : Albanian 1987 / Gauss Kruger zone 4
-<BR> <esri2200> : ATS77 / New Brunswick Stereographic (ATS77)
-<BR> <esri2201> : REGVEN / UTM zone 18N
-<BR> <esri2202> : REGVEN / UTM zone 19N
-<BR> <esri2203> : REGVEN / UTM zone 20N
-<BR> <esri2204> : NAD27 / Tennessee
-<BR> <esri2205> : NAD83 / Kentucky North
-<BR> <esri2206> : ED50 / 3-degree Gauss-Kruger zone 9
-<BR> <esri2207> : ED50 / 3-degree Gauss-Kruger zone 10
-<BR> <esri2208> : ED50 / 3-degree Gauss-Kruger zone 11
-<BR> <esri2209> : ED50 / 3-degree Gauss-Kruger zone 12
-<BR> <esri2210> : ED50 / 3-degree Gauss-Kruger zone 13
-<BR> <esri2211> : ED50 / 3-degree Gauss-Kruger zone 14
-<BR> <esri2212> : ED50 / 3-degree Gauss-Kruger zone 15
-<BR> <esri2213> : ETRS89 / TM 30 NE
-<BR> <esri2214> : Douala 1948 / AOF west
-<BR> <esri2215> : Manoca 1962 / UTM zone 32N
-<BR> <esri2216> : Qornoq 1927 / UTM zone 22N
-<BR> <esri2217> : Qornoq 1927 / UTM zone 23N
-<BR> <esri2219> : ATS77 / UTM zone 19N
-<BR> <esri2220> : ATS77 / UTM zone 20N
-<BR> <esri2222> : NAD83 / Arizona East (ft)
-<BR> <esri2223> : NAD83 / Arizona Central (ft)
-<BR> <esri2224> : NAD83 / Arizona West (ft)
-<BR> <esri2225> : NAD83 / California zone 1 (ftUS)
-<BR> <esri2226> : NAD83 / California zone 2 (ftUS)
-<BR> <esri2227> : NAD83 / California zone 3 (ftUS)
-<BR> <esri2228> : NAD83 / California zone 4 (ftUS)
-<BR> <esri2229> : NAD83 / California zone 5 (ftUS)
-<BR> <esri2230> : NAD83 / California zone 6 (ftUS)
-<BR> <esri2231> : NAD83 / Colorado North (ftUS)
-<BR> <esri2232> : NAD83 / Colorado Central (ftUS)
-<BR> <esri2233> : NAD83 / Colorado South (ftUS)
-<BR> <esri2234> : NAD83 / Connecticut (ftUS)
-<BR> <esri2235> : NAD83 / Delaware (ftUS)
-<BR> <esri2236> : NAD83 / Florida East (ftUS)
-<BR> <esri2237> : NAD83 / Florida West (ftUS)
-<BR> <esri2238> : NAD83 / Florida North (ftUS)
-<BR> <esri2239> : NAD83 / Georgia East (ftUS)
-<BR> <esri2240> : NAD83 / Georgia West (ftUS)
-<BR> <esri2241> : NAD83 / Idaho East (ftUS)
-<BR> <esri2242> : NAD83 / Idaho Central (ftUS)
-<BR> <esri2243> : NAD83 / Idaho West (ftUS)
-<BR> <esri2244> : NAD83 / Indiana East (ftUS)
-<BR> <esri2245> : NAD83 / Indiana West (ftUS)
-<BR> <esri2246> : NAD83 / Kentucky North (ftUS)
-<BR> <esri2247> : NAD83 / Kentucky South (ftUS)
-<BR> <esri2248> : NAD83 / Maryland (ftUS)
-<BR> <esri2249> : NAD83 / Massachusetts Mainland (ftUS)
-<BR> <esri2250> : NAD83 / Massachusetts Island (ftUS)
-<BR> <esri2251> : NAD83 / Michigan North (ft)
-<BR> <esri2252> : NAD83 / Michigan Central (ft)
-<BR> <esri2253> : NAD83 / Michigan South (ft)
-<BR> <esri2254> : NAD83 / Mississippi East (ftUS)
-<BR> <esri2255> : NAD83 / Mississippi West (ftUS)
-<BR> <esri2256> : NAD83 / Montana (ft)
-<BR> <esri2257> : NAD83 / New Mexico East (ftUS)
-<BR> <esri2258> : NAD83 / New Mexico Central (ftUS)
-<BR> <esri2259> : NAD83 / New Mexico West (ftUS)
-<BR> <esri2260> : NAD83 / New York East (ftUS)
-<BR> <esri2261> : NAD83 / New York Central (ftUS)
-<BR> <esri2262> : NAD83 / New York West (ftUS)
-<BR> <esri2263> : NAD83 / New York Long Island (ftUS)
-<BR> <esri2264> : NAD83 / North Carolina (ftUS)
-<BR> <esri2265> : NAD83 / North Dakota North (ft)
-<BR> <esri2266> : NAD83 / North Dakota South (ft)
-<BR> <esri2267> : NAD83 / Oklahoma North (ftUS)
-<BR> <esri2268> : NAD83 / Oklahoma South (ftUS)
-<BR> <esri2269> : NAD83 / Oregon North (ft)
-<BR> <esri2270> : NAD83 / Oregon South (ft)
-<BR> <esri2271> : NAD83 / Pennsylvania North (ftUS)
-<BR> <esri2272> : NAD83 / Pennsylvania South (ftUS)
-<BR> <esri2273> : NAD83 / South Carolina (ft)
-<BR> <esri2274> : NAD83 / Tennessee (ftUS)
-<BR> <esri2275> : NAD83 / Texas North (ftUS)
-<BR> <esri2276> : NAD83 / Texas North Central (ftUS)
-<BR> <esri2277> : NAD83 / Texas Central (ftUS)
-<BR> <esri2278> : NAD83 / Texas South Central (ftUS)
-<BR> <esri2279> : NAD83 / Texas South (ftUS)
-<BR> <esri2280> : NAD83 / Utah North (ft)
-<BR> <esri2281> : NAD83 / Utah Central (ft)
-<BR> <esri2282> : NAD83 / Utah South (ft)
-<BR> <esri2283> : NAD83 / Virginia North (ftUS)
-<BR> <esri2284> : NAD83 / Virginia South (ftUS)
-<BR> <esri2285> : NAD83 / Washington North (ftUS)
-<BR> <esri2286> : NAD83 / Washington South (ftUS)
-<BR> <esri2287> : NAD83 / Wisconsin North (ftUS)
-<BR> <esri2288> : NAD83 / Wisconsin Central (ftUS)
-<BR> <esri2289> : NAD83 / Wisconsin South (ftUS)
-<BR> <esri2290> : ATS77 / Prince Edward Isl. Stereographic (ATS77)
-<BR> <esri2291> : NAD83(CSRS98) / Prince Edward Isl. Stereographic (NAD83)
-<BR> <esri2292> : NAD83(CSRS98) / Prince Edward Isl. Stereographic (NAD83)
-<BR> <esri2294> : ATS77 / MTM Nova Scotia zone 4
-<BR> <esri2295> : ATS77 / MTM Nova Scotia zone 5
-<BR> <esri2308> : Batavia / TM 109 SE
-<BR> <esri2309> : WGS 84 / TM 116 SE
-<BR> <esri2310> : WGS 84 / TM 132 SE
-<BR> <esri2311> : WGS 84 / TM 6 NE
-<BR> <esri2312> : Garoua / UTM zone 33N
-<BR> <esri2313> : Kousseri / UTM zone 33N
-<BR> <esri2314> : Trinidad 1903 / Trinidad Grid (ftCla)
-<BR> <esri2315> : Campo Inchauspe / UTM zone 19S
-<BR> <esri2316> : Campo Inchauspe / UTM zone 20S
-<BR> <esri2317> : PSAD56 / ICN Regional
-<BR> <esri2318> : Ain el Abd / Aramco Lambert
-<BR> <esri2319> : ED50 / TM27
-<BR> <esri2320> : ED50 / TM30
-<BR> <esri2321> : ED50 / TM33
-<BR> <esri2322> : ED50 / TM36
-<BR> <esri2323> : ED50 / TM39
-<BR> <esri2324> : ED50 / TM42
-<BR> <esri2325> : ED50 / TM45
-<BR> <esri2326> : Hong Kong 1980 Grid System
-<BR> <esri2327> : Xian 1980 / Gauss-Kruger zone 13
-<BR> <esri2328> : Xian 1980 / Gauss-Kruger zone 14
-<BR> <esri2329> : Xian 1980 / Gauss-Kruger zone 15
-<BR> <esri2330> : Xian 1980 / Gauss-Kruger zone 16
-<BR> <esri2331> : Xian 1980 / Gauss-Kruger zone 17
-<BR> <esri2332> : Xian 1980 / Gauss-Kruger zone 18
-<BR> <esri2333> : Xian 1980 / Gauss-Kruger zone 19
-<BR> <esri2334> : Xian 1980 / Gauss-Kruger zone 20
-<BR> <esri2335> : Xian 1980 / Gauss-Kruger zone 21
-<BR> <esri2336> : Xian 1980 / Gauss-Kruger zone 22
-<BR> <esri2337> : Xian 1980 / Gauss-Kruger zone 23
-<BR> <esri2338> : Xian 1980 / Gauss-Kruger CM 75E
-<BR> <esri2339> : Xian 1980 / Gauss-Kruger CM 81E
-<BR> <esri2340> : Xian 1980 / Gauss-Kruger CM 87E
-<BR> <esri2341> : Xian 1980 / Gauss-Kruger CM 93E
-<BR> <esri2342> : Xian 1980 / Gauss-Kruger CM 99E
-<BR> <esri2343> : Xian 1980 / Gauss-Kruger CM 105E
-<BR> <esri2344> : Xian 1980 / Gauss-Kruger CM 111E
-<BR> <esri2345> : Xian 1980 / Gauss-Kruger CM 117E
-<BR> <esri2346> : Xian 1980 / Gauss-Kruger CM 123E
-<BR> <esri2347> : Xian 1980 / Gauss-Kruger CM 129E
-<BR> <esri2348> : Xian 1980 / Gauss-Kruger CM 135E
-<BR> <esri2349> : Xian 1980 / 3-degree Gauss-Kruger zone 25
-<BR> <esri2350> : Xian 1980 / 3-degree Gauss-Kruger zone 26
-<BR> <esri2351> : Xian 1980 / 3-degree Gauss-Kruger zone 27
-<BR> <esri2352> : Xian 1980 / 3-degree Gauss-Kruger zone 28
-<BR> <esri2353> : Xian 1980 / 3-degree Gauss-Kruger zone 29
-<BR> <esri2354> : Xian 1980 / 3-degree Gauss-Kruger zone 30
-<BR> <esri2355> : Xian 1980 / 3-degree Gauss-Kruger zone 31
-<BR> <esri2356> : Xian 1980 / 3-degree Gauss-Kruger zone 32
-<BR> <esri2357> : Xian 1980 / 3-degree Gauss-Kruger zone 33
-<BR> <esri2358> : Xian 1980 / 3-degree Gauss-Kruger zone 34
-<BR> <esri2359> : Xian 1980 / 3-degree Gauss-Kruger zone 35
-<BR> <esri2360> : Xian 1980 / 3-degree Gauss-Kruger zone 36
-<BR> <esri2361> : Xian 1980 / 3-degree Gauss-Kruger zone 37
-<BR> <esri2362> : Xian 1980 / 3-degree Gauss-Kruger zone 38
-<BR> <esri2363> : Xian 1980 / 3-degree Gauss-Kruger zone 39
-<BR> <esri2364> : Xian 1980 / 3-degree Gauss-Kruger zone 40
-<BR> <esri2365> : Xian 1980 / 3-degree Gauss-Kruger zone 41
-<BR> <esri2366> : Xian 1980 / 3-degree Gauss-Kruger zone 42
-<BR> <esri2367> : Xian 1980 / 3-degree Gauss-Kruger zone 43
-<BR> <esri2368> : Xian 1980 / 3-degree Gauss-Kruger zone 44
-<BR> <esri2369> : Xian 1980 / 3-degree Gauss-Kruger zone 45
-<BR> <esri2370> : Xian 1980 / 3-degree Gauss-Kruger CM 75E
-<BR> <esri2371> : Xian 1980 / 3-degree Gauss-Kruger CM 78E
-<BR> <esri2372> : Xian 1980 / 3-degree Gauss-Kruger CM 81E
-<BR> <esri2373> : Xian 1980 / 3-degree Gauss-Kruger CM 84E
-<BR> <esri2374> : Xian 1980 / 3-degree Gauss-Kruger CM 87E
-<BR> <esri2375> : Xian 1980 / 3-degree Gauss-Kruger CM 90E
-<BR> <esri2376> : Xian 1980 / 3-degree Gauss-Kruger CM 93E
-<BR> <esri2377> : Xian 1980 / 3-degree Gauss-Kruger CM 96E
-<BR> <esri2378> : Xian 1980 / 3-degree Gauss-Kruger CM 99E
-<BR> <esri2379> : Xian 1980 / 3-degree Gauss-Kruger CM 102E
-<BR> <esri2380> : Xian 1980 / 3-degree Gauss-Kruger CM 105E
-<BR> <esri2381> : Xian 1980 / 3-degree Gauss-Kruger CM 108E
-<BR> <esri2382> : Xian 1980 / 3-degree Gauss-Kruger CM 111E
-<BR> <esri2383> : Xian 1980 / 3-degree Gauss-Kruger CM 114E
-<BR> <esri2384> : Xian 1980 / 3-degree Gauss-Kruger CM 117E
-<BR> <esri2385> : Xian 1980 / 3-degree Gauss-Kruger CM 120E
-<BR> <esri2386> : Xian 1980 / 3-degree Gauss-Kruger CM 123E
-<BR> <esri2387> : Xian 1980 / 3-degree Gauss-Kruger CM 126E
-<BR> <esri2388> : Xian 1980 / 3-degree Gauss-Kruger CM 129E
-<BR> <esri2389> : Xian 1980 / 3-degree Gauss-Kruger CM 132E
-<BR> <esri2390> : Xian 1980 / 3-degree Gauss-Kruger CM 135E
-<BR> <esri2391> : KKJ / Finland zone 1
-<BR> <esri2392> : KKJ / Finland zone 2
-<BR> <esri2393> : KKJ / Finland Uniform Coordinate System
-<BR> <esri2394> : KKJ / Finland zone 4
-<BR> <esri2395> : South Yemen / Gauss-Kruger zone 8
-<BR> <esri2396> : South Yemen / Gauss-Kruger zone 9
-<BR> <esri2397> : Pulkovo 1942(83) / Gauss-Kruger zone 3
-<BR> <esri2398> : Pulkovo 1942(83) / Gauss-Kruger zone 4
-<BR> <esri2399> : Pulkovo 1942(83) / Gauss-Kruger zone 5
-<BR> <esri2400> : RT90 2.5 gon W
-<BR> <esri2401> : Beijing 1954 / 3-degree Gauss-Kruger zone 25
-<BR> <esri2402> : Beijing 1954 / 3-degree Gauss-Kruger zone 26
-<BR> <esri2403> : Beijing 1954 / 3-degree Gauss-Kruger zone 27
-<BR> <esri2404> : Beijing 1954 / 3-degree Gauss-Kruger zone 28
-<BR> <esri2405> : Beijing 1954 / 3-degree Gauss-Kruger zone 29
-<BR> <esri2406> : Beijing 1954 / 3-degree Gauss-Kruger zone 30
-<BR> <esri2407> : Beijing 1954 / 3-degree Gauss-Kruger zone 31
-<BR> <esri2408> : Beijing 1954 / 3-degree Gauss-Kruger zone 32
-<BR> <esri2409> : Beijing 1954 / 3-degree Gauss-Kruger zone 33
-<BR> <esri2410> : Beijing 1954 / 3-degree Gauss-Kruger zone 34
-<BR> <esri2411> : Beijing 1954 / 3-degree Gauss-Kruger zone 35
-<BR> <esri2412> : Beijing 1954 / 3-degree Gauss-Kruger zone 36
-<BR> <esri2413> : Beijing 1954 / 3-degree Gauss-Kruger zone 37
-<BR> <esri2414> : Beijing 1954 / 3-degree Gauss-Kruger zone 38
-<BR> <esri2415> : Beijing 1954 / 3-degree Gauss-Kruger zone 39
-<BR> <esri2416> : Beijing 1954 / 3-degree Gauss-Kruger zone 40
-<BR> <esri2417> : Beijing 1954 / 3-degree Gauss-Kruger zone 41
-<BR> <esri2418> : Beijing 1954 / 3-degree Gauss-Kruger zone 42
-<BR> <esri2419> : Beijing 1954 / 3-degree Gauss-Kruger zone 43
-<BR> <esri2420> : Beijing 1954 / 3-degree Gauss-Kruger zone 44
-<BR> <esri2421> : Beijing 1954 / 3-degree Gauss-Kruger zone 45
-<BR> <esri2422> : Beijing 1954 / 3-degree Gauss-Kruger CM 75E
-<BR> <esri2423> : Beijing 1954 / 3-degree Gauss-Kruger CM 78E
-<BR> <esri2424> : Beijing 1954 / 3-degree Gauss-Kruger CM 81E
-<BR> <esri2425> : Beijing 1954 / 3-degree Gauss-Kruger CM 84E
-<BR> <esri2426> : Beijing 1954 / 3-degree Gauss-Kruger CM 87E
-<BR> <esri2427> : Beijing 1954 / 3-degree Gauss-Kruger CM 90E
-<BR> <esri2428> : Beijing 1954 / 3-degree Gauss-Kruger CM 93E
-<BR> <esri2429> : Beijing 1954 / 3-degree Gauss-Kruger CM 96E
-<BR> <esri2430> : Beijing 1954 / 3-degree Gauss-Kruger CM 99E
-<BR> <esri2431> : Beijing 1954 / 3-degree Gauss-Kruger CM 102E
-<BR> <esri2432> : Beijing 1954 / 3-degree Gauss-Kruger CM 105E
-<BR> <esri2433> : Beijing 1954 / 3-degree Gauss-Kruger CM 108E
-<BR> <esri2434> : Beijing 1954 / 3-degree Gauss-Kruger CM 111E
-<BR> <esri2435> : Beijing 1954 / 3-degree Gauss-Kruger CM 114E
-<BR> <esri2436> : Beijing 1954 / 3-degree Gauss-Kruger CM 117E
-<BR> <esri2437> : Beijing 1954 / 3-degree Gauss-Kruger CM 120E
-<BR> <esri2438> : Beijing 1954 / 3-degree Gauss-Kruger CM 123E
-<BR> <esri2439> : Beijing 1954 / 3-degree Gauss-Kruger CM 126E
-<BR> <esri2440> : Beijing 1954 / 3-degree Gauss-Kruger CM 129E
-<BR> <esri2441> : Beijing 1954 / 3-degree Gauss-Kruger CM 132E
-<BR> <esri2442> : Beijing 1954 / 3-degree Gauss-Kruger CM 135E
-<BR> <esri2443> : JGD2000 / Japan Plane Rectangular CS I
-<BR> <esri2444> : JGD2000 / Japan Plane Rectangular CS II
-<BR> <esri2445> : JGD2000 / Japan Plane Rectangular CS III
-<BR> <esri2446> : JGD2000 / Japan Plane Rectangular CS IV
-<BR> <esri2447> : JGD2000 / Japan Plane Rectangular CS V
-<BR> <esri2448> : JGD2000 / Japan Plane Rectangular CS VI
-<BR> <esri2449> : JGD2000 / Japan Plane Rectangular CS VII
-<BR> <esri2450> : JGD2000 / Japan Plane Rectangular CS VIII
-<BR> <esri2451> : JGD2000 / Japan Plane Rectangular CS IX
-<BR> <esri2452> : JGD2000 / Japan Plane Rectangular CS X
-<BR> <esri2453> : JGD2000 / Japan Plane Rectangular CS XI
-<BR> <esri2454> : JGD2000 / Japan Plane Rectangular CS XII
-<BR> <esri2455> : JGD2000 / Japan Plane Rectangular CS XIII
-<BR> <esri2456> : JGD2000 / Japan Plane Rectangular CS XIV
-<BR> <esri2457> : JGD2000 / Japan Plane Rectangular CS XV
-<BR> <esri2458> : JGD2000 / Japan Plane Rectangular CS XVI
-<BR> <esri2459> : JGD2000 / Japan Plane Rectangular CS XVII
-<BR> <esri2460> : JGD2000 / Japan Plane Rectangular CS XVIII
-<BR> <esri2461> : JGD2000 / Japan Plane Rectangular CS XIX
-<BR> <esri2462> : Albanian 1987 / Gauss-Kruger zone 4
-<BR> <esri2463> : Pulkovo 1995 / Gauss-Kruger CM 21E
-<BR> <esri2464> : Pulkovo 1995 / Gauss-Kruger CM 27E
-<BR> <esri2465> : Pulkovo 1995 / Gauss-Kruger CM 33E
-<BR> <esri2466> : Pulkovo 1995 / Gauss-Kruger CM 39E
-<BR> <esri2467> : Pulkovo 1995 / Gauss-Kruger CM 45E
-<BR> <esri2468> : Pulkovo 1995 / Gauss-Kruger CM 51E
-<BR> <esri2469> : Pulkovo 1995 / Gauss-Kruger CM 57E
-<BR> <esri2470> : Pulkovo 1995 / Gauss-Kruger CM 63E
-<BR> <esri2471> : Pulkovo 1995 / Gauss-Kruger CM 69E
-<BR> <esri2472> : Pulkovo 1995 / Gauss-Kruger CM 75E
-<BR> <esri2473> : Pulkovo 1995 / Gauss-Kruger CM 81E
-<BR> <esri2474> : Pulkovo 1995 / Gauss-Kruger CM 87E
-<BR> <esri2475> : Pulkovo 1995 / Gauss-Kruger CM 93E
-<BR> <esri2476> : Pulkovo 1995 / Gauss-Kruger CM 99E
-<BR> <esri2477> : Pulkovo 1995 / Gauss-Kruger CM 105E
-<BR> <esri2478> : Pulkovo 1995 / Gauss-Kruger CM 111E
-<BR> <esri2479> : Pulkovo 1995 / Gauss-Kruger CM 117E
-<BR> <esri2480> : Pulkovo 1995 / Gauss-Kruger CM 123E
-<BR> <esri2481> : Pulkovo 1995 / Gauss-Kruger CM 129E
-<BR> <esri2482> : Pulkovo 1995 / Gauss-Kruger CM 135E
-<BR> <esri2483> : Pulkovo 1995 / Gauss-Kruger CM 141E
-<BR> <esri2484> : Pulkovo 1995 / Gauss-Kruger CM 147E
-<BR> <esri2485> : Pulkovo 1995 / Gauss-Kruger CM 153E
-<BR> <esri2486> : Pulkovo 1995 / Gauss-Kruger CM 159E
-<BR> <esri2487> : Pulkovo 1995 / Gauss-Kruger CM 165E
-<BR> <esri2488> : Pulkovo 1995 / Gauss-Kruger CM 171E
-<BR> <esri2489> : Pulkovo 1995 / Gauss-Kruger CM 177E
-<BR> <esri2490> : Pulkovo 1995 / Gauss-Kruger CM 177W
-<BR> <esri2491> : Pulkovo 1995 / Gauss-Kruger CM 171W
-<BR> <esri2492> : Pulkovo 1942 / Gauss-Kruger CM 9E
-<BR> <esri2493> : Pulkovo 1942 / Gauss-Kruger CM 15E
-<BR> <esri2494> : Pulkovo 1942 / Gauss-Kruger CM 21E
-<BR> <esri2495> : Pulkovo 1942 / Gauss-Kruger CM 27E
-<BR> <esri2496> : Pulkovo 1942 / Gauss-Kruger CM 33E
-<BR> <esri2497> : Pulkovo 1942 / Gauss-Kruger CM 39E
-<BR> <esri2498> : Pulkovo 1942 / Gauss-Kruger CM 45E
-<BR> <esri2499> : Pulkovo 1942 / Gauss-Kruger CM 51E
-<BR> <esri2500> : Pulkovo 1942 / Gauss-Kruger CM 57E
-<BR> <esri2501> : Pulkovo 1942 / Gauss-Kruger CM 63E
-<BR> <esri2502> : Pulkovo 1942 / Gauss-Kruger CM 69E
-<BR> <esri2503> : Pulkovo 1942 / Gauss-Kruger CM 75E
-<BR> <esri2504> : Pulkovo 1942 / Gauss-Kruger CM 81E
-<BR> <esri2505> : Pulkovo 1942 / Gauss-Kruger CM 87E
-<BR> <esri2506> : Pulkovo 1942 / Gauss-Kruger CM 93E
-<BR> <esri2507> : Pulkovo 1942 / Gauss-Kruger CM 99E
-<BR> <esri2508> : Pulkovo 1942 / Gauss-Kruger CM 105E
-<BR> <esri2509> : Pulkovo 1942 / Gauss-Kruger CM 111E
-<BR> <esri2510> : Pulkovo 1942 / Gauss-Kruger CM 117E
-<BR> <esri2511> : Pulkovo 1942 / Gauss-Kruger CM 123E
-<BR> <esri2512> : Pulkovo 1942 / Gauss-Kruger CM 129E
-<BR> <esri2513> : Pulkovo 1942 / Gauss-Kruger CM 135E
-<BR> <esri2514> : Pulkovo 1942 / Gauss-Kruger CM 141E
-<BR> <esri2515> : Pulkovo 1942 / Gauss-Kruger CM 147E
-<BR> <esri2516> : Pulkovo 1942 / Gauss-Kruger CM 153E
-<BR> <esri2517> : Pulkovo 1942 / Gauss-Kruger CM 159E
-<BR> <esri2518> : Pulkovo 1942 / Gauss-Kruger CM 165E
-<BR> <esri2519> : Pulkovo 1942 / Gauss-Kruger CM 171E
-<BR> <esri2520> : Pulkovo 1942 / Gauss-Kruger CM 177E
-<BR> <esri2521> : Pulkovo 1942 / Gauss-Kruger CM 177W
-<BR> <esri2522> : Pulkovo 1942 / Gauss-Kruger CM 171W
-<BR> <esri2523> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 7
-<BR> <esri2524> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 8
-<BR> <esri2525> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 9
-<BR> <esri2526> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 10
-<BR> <esri2527> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 11
-<BR> <esri2528> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 12
-<BR> <esri2529> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 13
-<BR> <esri2530> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 14
-<BR> <esri2531> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 15
-<BR> <esri2532> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 16
-<BR> <esri2533> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 17
-<BR> <esri2534> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 18
-<BR> <esri2535> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 19
-<BR> <esri2536> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 20
-<BR> <esri2537> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 21
-<BR> <esri2538> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 22
-<BR> <esri2539> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 23
-<BR> <esri2540> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 24
-<BR> <esri2541> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 25
-<BR> <esri2542> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 26
-<BR> <esri2543> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 27
-<BR> <esri2544> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 28
-<BR> <esri2545> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 29
-<BR> <esri2546> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 30
-<BR> <esri2547> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 31
-<BR> <esri2548> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 32
-<BR> <esri2549> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 33
-<BR> <esri2550> : Samboja / UTM zone 50S
-<BR> <esri2551> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 34
-<BR> <esri2552> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 35
-<BR> <esri2553> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 36
-<BR> <esri2554> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 37
-<BR> <esri2555> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 38
-<BR> <esri2556> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 39
-<BR> <esri2557> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 40
-<BR> <esri2558> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 41
-<BR> <esri2559> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 42
-<BR> <esri2560> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 43
-<BR> <esri2561> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 44
-<BR> <esri2562> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 45
-<BR> <esri2563> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 46
-<BR> <esri2564> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 47
-<BR> <esri2565> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 48
-<BR> <esri2566> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 49
-<BR> <esri2567> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 50
-<BR> <esri2568> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 51
-<BR> <esri2569> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 52
-<BR> <esri2570> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 53
-<BR> <esri2571> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 54
-<BR> <esri2572> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 55
-<BR> <esri2573> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 56
-<BR> <esri2574> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 57
-<BR> <esri2575> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 58
-<BR> <esri2576> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 59
-<BR> <esri2577> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 60
-<BR> <esri2578> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 61
-<BR> <esri2579> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 62
-<BR> <esri2580> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 63
-<BR> <esri2581> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 64
-<BR> <esri2582> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 21E
-<BR> <esri2583> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 24E
-<BR> <esri2584> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 27E
-<BR> <esri2585> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 30E
-<BR> <esri2586> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 33E
-<BR> <esri2587> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 36E
-<BR> <esri2588> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 39E
-<BR> <esri2589> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 42E
-<BR> <esri2590> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 45E
-<BR> <esri2591> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 48E
-<BR> <esri2592> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 51E
-<BR> <esri2593> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 54E
-<BR> <esri2594> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 57E
-<BR> <esri2595> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 60E
-<BR> <esri2596> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 63E
-<BR> <esri2597> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 66E
-<BR> <esri2598> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 69E
-<BR> <esri2599> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 72E
-<BR> <esri2600> : Lietuvos Koordinoei Sistema 1994
-<BR> <esri2601> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 75E
-<BR> <esri2602> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 78E
-<BR> <esri2603> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 81E
-<BR> <esri2604> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 84E
-<BR> <esri2605> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 87E
-<BR> <esri2606> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 90E
-<BR> <esri2607> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 93E
-<BR> <esri2608> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 96E
-<BR> <esri2609> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 99E
-<BR> <esri2610> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 102E
-<BR> <esri2611> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 105E
-<BR> <esri2612> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 108E
-<BR> <esri2613> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 111E
-<BR> <esri2614> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 114E
-<BR> <esri2615> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 117E
-<BR> <esri2616> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 120E
-<BR> <esri2617> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 123E
-<BR> <esri2618> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 126E
-<BR> <esri2619> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 129E
-<BR> <esri2620> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 132E
-<BR> <esri2621> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 135E
-<BR> <esri2622> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 138E
-<BR> <esri2623> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 141E
-<BR> <esri2624> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 144E
-<BR> <esri2625> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 147E
-<BR> <esri2626> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 150E
-<BR> <esri2627> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 153E
-<BR> <esri2628> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 156E
-<BR> <esri2629> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 159E
-<BR> <esri2630> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 162E
-<BR> <esri2631> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 165E
-<BR> <esri2632> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 168E
-<BR> <esri2633> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 171E
-<BR> <esri2634> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 174E
-<BR> <esri2635> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 177E
-<BR> <esri2636> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 180E
-<BR> <esri2637> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 177W
-<BR> <esri2638> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 174W
-<BR> <esri2639> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 171W
-<BR> <esri2640> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 168W
-<BR> <esri2641> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 7
-<BR> <esri2642> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 8
-<BR> <esri2643> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 9
-<BR> <esri2644> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 10
-<BR> <esri2645> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 11
-<BR> <esri2646> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 12
-<BR> <esri2647> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 13
-<BR> <esri2648> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 14
-<BR> <esri2649> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 15
-<BR> <esri2650> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 16
-<BR> <esri2651> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 17
-<BR> <esri2652> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 18
-<BR> <esri2653> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 19
-<BR> <esri2654> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 20
-<BR> <esri2655> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 21
-<BR> <esri2656> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 22
-<BR> <esri2657> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 23
-<BR> <esri2658> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 24
-<BR> <esri2659> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 25
-<BR> <esri2660> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 26
-<BR> <esri2661> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 27
-<BR> <esri2662> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 28
-<BR> <esri2663> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 29
-<BR> <esri2664> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 30
-<BR> <esri2665> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 31
-<BR> <esri2666> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 32
-<BR> <esri2667> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 33
-<BR> <esri2668> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 34
-<BR> <esri2669> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 35
-<BR> <esri2670> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 36
-<BR> <esri2671> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 37
-<BR> <esri2672> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 38
-<BR> <esri2673> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 39
-<BR> <esri2674> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 40
-<BR> <esri2675> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 41
-<BR> <esri2676> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 42
-<BR> <esri2677> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 43
-<BR> <esri2678> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 44
-<BR> <esri2679> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 45
-<BR> <esri2680> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 46
-<BR> <esri2681> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 47
-<BR> <esri2682> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 48
-<BR> <esri2683> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 49
-<BR> <esri2684> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 50
-<BR> <esri2685> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 51
-<BR> <esri2686> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 52
-<BR> <esri2687> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 53
-<BR> <esri2688> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 54
-<BR> <esri2689> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 55
-<BR> <esri2690> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 56
-<BR> <esri2691> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 57
-<BR> <esri2692> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 58
-<BR> <esri2693> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 59
-<BR> <esri2694> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 60
-<BR> <esri2695> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 61
-<BR> <esri2696> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 62
-<BR> <esri2697> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 63
-<BR> <esri2698> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 64
-<BR> <esri2699> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 21E
-<BR> <esri2700> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 24E
-<BR> <esri2701> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 27E
-<BR> <esri2702> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 30E
-<BR> <esri2703> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 33E
-<BR> <esri2704> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 36E
-<BR> <esri2705> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 39E
-<BR> <esri2706> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 42E
-<BR> <esri2707> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 45E
-<BR> <esri2708> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 48E
-<BR> <esri2709> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 51E
-<BR> <esri2710> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 54E
-<BR> <esri2711> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 57E
-<BR> <esri2712> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 60E
-<BR> <esri2713> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 63E
-<BR> <esri2714> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 66E
-<BR> <esri2715> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 69E
-<BR> <esri2716> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 72E
-<BR> <esri2717> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 75E
-<BR> <esri2718> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 78E
-<BR> <esri2719> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 81E
-<BR> <esri2720> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 84E
-<BR> <esri2721> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 87E
-<BR> <esri2722> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 90E
-<BR> <esri2723> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 93E
-<BR> <esri2724> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 96E
-<BR> <esri2725> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 99E
-<BR> <esri2726> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 102E
-<BR> <esri2727> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 105E
-<BR> <esri2728> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 108E
-<BR> <esri2729> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 111E
-<BR> <esri2730> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 114E
-<BR> <esri2731> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 117E
-<BR> <esri2732> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 120E
-<BR> <esri2733> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 123E
-<BR> <esri2734> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 126E
-<BR> <esri2735> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 129E
-<BR> <esri2736> : Tete / UTM zone 36S
-<BR> <esri2737> : Tete / UTM zone 37S
-<BR> <esri2738> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 132E
-<BR> <esri2739> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 135E
-<BR> <esri2740> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 138E
-<BR> <esri2741> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 141E
-<BR> <esri2742> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 144E
-<BR> <esri2743> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 147E
-<BR> <esri2744> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 150E
-<BR> <esri2745> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 153E
-<BR> <esri2746> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 156E
-<BR> <esri2747> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 159E
-<BR> <esri2748> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 162E
-<BR> <esri2749> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 165E
-<BR> <esri2750> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 168E
-<BR> <esri2751> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 171E
-<BR> <esri2752> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 174E
-<BR> <esri2753> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 177E
-<BR> <esri2754> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 180E
-<BR> <esri2755> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 177W
-<BR> <esri2756> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 174W
-<BR> <esri2757> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 171W
-<BR> <esri2758> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 168W
-<BR> <esri2759> : NAD83(HARN) / Alabama East
-<BR> <esri2760> : NAD83(HARN) / Alabama West
-<BR> <esri2761> : NAD83(HARN) / Arizona East
-<BR> <esri2762> : NAD83(HARN) / Arizona Central
-<BR> <esri2763> : NAD83(HARN) / Arizona West
-<BR> <esri2764> : NAD83(HARN) / Arkansas North
-<BR> <esri2765> : NAD83(HARN) / Arkansas South
-<BR> <esri2766> : NAD83(HARN) / California zone 1
-<BR> <esri2767> : NAD83(HARN) / California zone 2
-<BR> <esri2768> : NAD83(HARN) / California zone 3
-<BR> <esri2769> : NAD83(HARN) / California zone 4
-<BR> <esri2770> : NAD83(HARN) / California zone 5
-<BR> <esri2771> : NAD83(HARN) / California zone 6
-<BR> <esri2772> : NAD83(HARN) / Colorado North
-<BR> <esri2773> : NAD83(HARN) / Colorado Central
-<BR> <esri2774> : NAD83(HARN) / Colorado South
-<BR> <esri2775> : NAD83(HARN) / Connecticut
-<BR> <esri2776> : NAD83(HARN) / Delaware
-<BR> <esri2777> : NAD83(HARN) / Florida East
-<BR> <esri2778> : NAD83(HARN) / Florida West
-<BR> <esri2779> : NAD83(HARN) / Florida North
-<BR> <esri2780> : NAD83(HARN) / Georgia East
-<BR> <esri2781> : NAD83(HARN) / Georgia West
-<BR> <esri2782> : NAD83(HARN) / Hawaii zone 1
-<BR> <esri2783> : NAD83(HARN) / Hawaii zone 2
-<BR> <esri2784> : NAD83(HARN) / Hawaii zone 3
-<BR> <esri2785> : NAD83(HARN) / Hawaii zone 4
-<BR> <esri2786> : NAD83(HARN) / Hawaii zone 5
-<BR> <esri2787> : NAD83(HARN) / Idaho East
-<BR> <esri2788> : NAD83(HARN) / Idaho Central
-<BR> <esri2789> : NAD83(HARN) / Idaho West
-<BR> <esri2790> : NAD83(HARN) / Illinois East
-<BR> <esri2791> : NAD83(HARN) / Illinois West
-<BR> <esri2792> : NAD83(HARN) / Indiana East
-<BR> <esri2793> : NAD83(HARN) / Indiana West
-<BR> <esri2794> : NAD83(HARN) / Iowa North
-<BR> <esri2795> : NAD83(HARN) / Iowa South
-<BR> <esri2796> : NAD83(HARN) / Kansas North
-<BR> <esri2797> : NAD83(HARN) / Kansas South
-<BR> <esri2798> : NAD83(HARN) / Kentucky North
-<BR> <esri2799> : NAD83(HARN) / Kentucky South
-<BR> <esri2800> : NAD83(HARN) / Louisiana North
-<BR> <esri2801> : NAD83(HARN) / Louisiana South
-<BR> <esri2802> : NAD83(HARN) / Maine East
-<BR> <esri2803> : NAD83(HARN) / Maine West
-<BR> <esri2804> : NAD83(HARN) / Maryland
-<BR> <esri2805> : NAD83(HARN) / Massachusetts Mainland
-<BR> <esri2806> : NAD83(HARN) / Massachusetts Island
-<BR> <esri2807> : NAD83(HARN) / Michigan North
-<BR> <esri2808> : NAD83(HARN) / Michigan Central
-<BR> <esri2809> : NAD83(HARN) / Michigan South
-<BR> <esri2810> : NAD83(HARN) / Minnesota North
-<BR> <esri2811> : NAD83(HARN) / Minnesota Central
-<BR> <esri2812> : NAD83(HARN) / Minnesota South
-<BR> <esri2813> : NAD83(HARN) / Mississippi East
-<BR> <esri2814> : NAD83(HARN) / Mississippi West
-<BR> <esri2815> : NAD83(HARN) / Missouri East
-<BR> <esri2816> : NAD83(HARN) / Missouri Central
-<BR> <esri2817> : NAD83(HARN) / Missouri West
-<BR> <esri2818> : NAD83(HARN) / Montana
-<BR> <esri2819> : NAD83(HARN) / Nebraska
-<BR> <esri2820> : NAD83(HARN) / Nevada East
-<BR> <esri2821> : NAD83(HARN) / Nevada Central
-<BR> <esri2822> : NAD83(HARN) / Nevada West
-<BR> <esri2823> : NAD83(HARN) / New Hampshire
-<BR> <esri2824> : NAD83(HARN) / New Jersey
-<BR> <esri2825> : NAD83(HARN) / New Mexico East
-<BR> <esri2826> : NAD83(HARN) / New Mexico Central
-<BR> <esri2827> : NAD83(HARN) / New Mexico West
-<BR> <esri2828> : NAD83(HARN) / New York East
-<BR> <esri2829> : NAD83(HARN) / New York Central
-<BR> <esri2830> : NAD83(HARN) / New York West
-<BR> <esri2831> : NAD83(HARN) / New York Long Island
-<BR> <esri2832> : NAD83(HARN) / North Dakota North
-<BR> <esri2833> : NAD83(HARN) / North Dakota South
-<BR> <esri2834> : NAD83(HARN) / Ohio North
-<BR> <esri2835> : NAD83(HARN) / Ohio South
-<BR> <esri2836> : NAD83(HARN) / Oklahoma North
-<BR> <esri2837> : NAD83(HARN) / Oklahoma South
-<BR> <esri2838> : NAD83(HARN) / Oregon North
-<BR> <esri2839> : NAD83(HARN) / Oregon South
-<BR> <esri2840> : NAD83(HARN) / Rhode Island
-<BR> <esri2841> : NAD83(HARN) / South Dakota North
-<BR> <esri2842> : NAD83(HARN) / South Dakota South
-<BR> <esri2843> : NAD83(HARN) / Tennessee
-<BR> <esri2844> : NAD83(HARN) / Texas North
-<BR> <esri2845> : NAD83(HARN) / Texas North Central
-<BR> <esri2846> : NAD83(HARN) / Texas Central
-<BR> <esri2847> : NAD83(HARN) / Texas South Central
-<BR> <esri2848> : NAD83(HARN) / Texas South
-<BR> <esri2849> : NAD83(HARN) / Utah North
-<BR> <esri2850> : NAD83(HARN) / Utah Central
-<BR> <esri2851> : NAD83(HARN) / Utah South
-<BR> <esri2852> : NAD83(HARN) / Vermont
-<BR> <esri2853> : NAD83(HARN) / Virginia North
-<BR> <esri2854> : NAD83(HARN) / Virginia South
-<BR> <esri2855> : NAD83(HARN) / Washington North
-<BR> <esri2856> : NAD83(HARN) / Washington South
-<BR> <esri2857> : NAD83(HARN) / West Virginia North
-<BR> <esri2858> : NAD83(HARN) / West Virginia South
-<BR> <esri2859> : NAD83(HARN) / Wisconsin North
-<BR> <esri2860> : NAD83(HARN) / Wisconsin Central
-<BR> <esri2861> : NAD83(HARN) / Wisconsin South
-<BR> <esri2862> : NAD83(HARN) / Wyoming East
-<BR> <esri2863> : NAD83(HARN) / Wyoming East Central
-<BR> <esri2864> : NAD83(HARN) / Wyoming West Central
-<BR> <esri2865> : NAD83(HARN) / Wyoming West
-<BR> <esri2866> : NAD83(HARN) / Puerto Rico & Virgin Is.
-<BR> <esri2867> : NAD83(HARN) / Arizona East (ft)
-<BR> <esri2868> : NAD83(HARN) / Arizona Central (ft)
-<BR> <esri2869> : NAD83(HARN) / Arizona West (ft)
-<BR> <esri2870> : NAD83(HARN) / California zone 1 (ftUS)
-<BR> <esri2871> : NAD83(HARN) / California zone 2 (ftUS)
-<BR> <esri2872> : NAD83(HARN) / California zone 3 (ftUS)
-<BR> <esri2873> : NAD83(HARN) / California zone 4 (ftUS)
-<BR> <esri2874> : NAD83(HARN) / California zone 5 (ftUS)
-<BR> <esri2875> : NAD83(HARN) / California zone 6 (ftUS)
-<BR> <esri2876> : NAD83(HARN) / Colorado North (ftUS)
-<BR> <esri2877> : NAD83(HARN) / Colorado Central (ftUS)
-<BR> <esri2878> : NAD83(HARN) / Colorado South (ftUS)
-<BR> <esri2879> : NAD83(HARN) / Connecticut (ftUS)
-<BR> <esri2880> : NAD83(HARN) / Delaware (ftUS)
-<BR> <esri2881> : NAD83(HARN) / Florida East (ftUS)
-<BR> <esri2882> : NAD83(HARN) / Florida West (ftUS)
-<BR> <esri2883> : NAD83(HARN) / Florida North (ftUS)
-<BR> <esri2884> : NAD83(HARN) / Georgia East (ftUS)
-<BR> <esri2885> : NAD83(HARN) / Georgia West (ftUS)
-<BR> <esri2886> : NAD83(HARN) / Idaho East (ftUS)
-<BR> <esri2887> : NAD83(HARN) / Idaho Central (ftUS)
-<BR> <esri2888> : NAD83(HARN) / Idaho West (ftUS)
-<BR> <esri2889> : NAD83(HARN) / Indiana East (ftUS)
-<BR> <esri2890> : NAD83(HARN) / Indiana West (ftUS)
-<BR> <esri2891> : NAD83(HARN) / Kentucky North (ftUS)
-<BR> <esri2892> : NAD83(HARN) / Kentucky South (ftUS)
-<BR> <esri2893> : NAD83(HARN) / Maryland (ftUS)
-<BR> <esri2894> : NAD83(HARN) / Massachusetts Mainland (ftUS)
-<BR> <esri2895> : NAD83(HARN) / Massachusetts Island (ftUS)
-<BR> <esri2896> : NAD83(HARN) / Michigan North (ft)
-<BR> <esri2897> : NAD83(HARN) / Michigan Central (ft)
-<BR> <esri2898> : NAD83(HARN) / Michigan South (ft)
-<BR> <esri2899> : NAD83(HARN) / Mississippi East (ftUS)
-<BR> <esri2900> : NAD83(HARN) / Mississippi West (ftUS)
-<BR> <esri2901> : NAD83(HARN) / Montana (ft)
-<BR> <esri2902> : NAD83(HARN) / New Mexico East (ftUS)
-<BR> <esri2903> : NAD83(HARN) / New Mexico Central (ftUS)
-<BR> <esri2904> : NAD83(HARN) / New Mexico West (ftUS)
-<BR> <esri2905> : NAD83(HARN) / New York East (ftUS)
-<BR> <esri2906> : NAD83(HARN) / New York Central (ftUS)
-<BR> <esri2907> : NAD83(HARN) / New York West (ftUS)
-<BR> <esri2908> : NAD83(HARN) / New York Long Island (ftUS)
-<BR> <esri2909> : NAD83(HARN) / North Dakota North (ft)
-<BR> <esri2910> : NAD83(HARN) / North Dakota South (ft)
-<BR> <esri2911> : NAD83(HARN) / Oklahoma North (ftUS)
-<BR> <esri2912> : NAD83(HARN) / Oklahoma South (ftUS)
-<BR> <esri2913> : NAD83(HARN) / Oregon North (ft)
-<BR> <esri2914> : NAD83(HARN) / Oregon South (ft)
-<BR> <esri2915> : NAD83(HARN) / Tennessee (ftUS)
-<BR> <esri2916> : NAD83(HARN) / Texas North (ftUS)
-<BR> <esri2917> : NAD83(HARN) / Texas North Central (ftUS)
-<BR> <esri2918> : NAD83(HARN) / Texas Central (ftUS)
-<BR> <esri2919> : NAD83(HARN) / Texas South Central (ftUS)
-<BR> <esri2920> : NAD83(HARN) / Texas South (ftUS)
-<BR> <esri2921> : NAD83(HARN) / Utah North (ft)
-<BR> <esri2922> : NAD83(HARN) / Utah Central (ft)
-<BR> <esri2923> : NAD83(HARN) / Utah South (ft)
-<BR> <esri2924> : NAD83(HARN) / Virginia North (ftUS)
-<BR> <esri2925> : NAD83(HARN) / Virginia South (ftUS)
-<BR> <esri2926> : NAD83(HARN) / Washington North (ftUS)
-<BR> <esri2927> : NAD83(HARN) / Washington South (ftUS)
-<BR> <esri2928> : NAD83(HARN) / Wisconsin North (ftUS)
-<BR> <esri2929> : NAD83(HARN) / Wisconsin Central (ftUS)
-<BR> <esri2930> : NAD83(HARN) / Wisconsin South (ftUS)
-<BR> <esri2931> : Beduaram / TM 13 NE
-<BR> <esri2932> : QND95 / Qatar National Grid
-<BR> <esri2933> : Segara / UTM zone 50S
-<BR> <esri2934> : Segara (Jakarta) / NEIEZ
-<BR> <esri2935> : Pulkovo 1942 / CS63 zone A1
-<BR> <esri2936> : Pulkovo 1942 / CS63 zone A2
-<BR> <esri2937> : Pulkovo 1942 / CS63 zone A3
-<BR> <esri2938> : Pulkovo 1942 / CS63 zone A4
-<BR> <esri2939> : Pulkovo 1942 / CS63 zone K2
-<BR> <esri2940> : Pulkovo 1942 / CS63 zone K3
-<BR> <esri2941> : Pulkovo 1942 / CS63 zone K4
-<BR> <esri2942> : Porto Santo / UTM zone 28N
-<BR> <esri2943> : Selvagem Grande / UTM zone 28N
-<BR> <esri2944> : NAD83(CSRS) / SCoPQ zone 2
-<BR> <esri2945> : NAD83(CSRS) / MTM zone 3
-<BR> <esri2946> : NAD83(CSRS) / MTM zone 4
-<BR> <esri2947> : NAD83(CSRS) / MTM zone 5
-<BR> <esri2948> : NAD83(CSRS) / MTM zone 6
-<BR> <esri2949> : NAD83(CSRS) / MTM zone 7
-<BR> <esri2950> : NAD83(CSRS) / MTM zone 8
-<BR> <esri2951> : NAD83(CSRS) / MTM zone 9
-<BR> <esri2952> : NAD83(CSRS) / MTM zone 10
-<BR> <esri2953> : NAD83(CSRS) / New Brunswick Stereo
-<BR> <esri2954> : NAD83(CSRS) / Prince Edward Isl. Stereographic (NAD83)
-<BR> <esri2955> : NAD83(CSRS) / UTM zone 11N
-<BR> <esri2956> : NAD83(CSRS) / UTM zone 12N
-<BR> <esri2957> : NAD83(CSRS) / UTM zone 13N
-<BR> <esri2958> : NAD83(CSRS) / UTM zone 17N
-<BR> <esri2959> : NAD83(CSRS) / UTM zone 18N
-<BR> <esri2960> : NAD83(CSRS) / UTM zone 19N
-<BR> <esri2961> : NAD83(CSRS) / UTM zone 20N
-<BR> <esri2962> : NAD83(CSRS) / UTM zone 21N
-<BR> <esri3036> : Moznet / UTM zone 36S
-<BR> <esri3037> : Moznet / UTM zone 37S
-<BR> <esri3148> : Indian 1960 / UTM zone 48N
-<BR> <esri3149> : Indian 1960 / UTM zone 49N
-<BR> <esri3176> : Indian 1960 / TM 106 NE
-<BR> <esri3200> : FD58 / Iraq zone
-<BR> <esri3300> : Estonian Coordinate System of 1992
-<BR> <esri3301> : Estonian Coordinate System of 1997
-<BR> <esri3439> : PSD93 / UTM zone 39N
-<BR> <esri3440> : PSD93 / UTM zone 40N
-<BR> <esri3561> : Old Hawaiian / Hawaii zone 1
-<BR> <esri3562> : Old Hawaiian / Hawaii zone 2
-<BR> <esri3563> : Old Hawaiian / Hawaii zone 3
-<BR> <esri3564> : Old Hawaiian / Hawaii zone 4
-<BR> <esri3565> : Old Hawaiian / Hawaii zone 5
-<BR> <esri3920> : Puerto Rico / UTM zone 20N
-<BR> <esri3991> : Puerto Rico State Plane CS of 1927
-<BR> <esri3992> : Puerto Rico / St. Croix
-<BR> <esri4001> : Unknown datum based upon the Airy 1830 ellipsoid
-<BR> <esri4002> : Unknown datum based upon the Airy Modified 1849 ellipsoid
-<BR> <esri4003> : Unknown datum based upon the Australian National Spheroid
-<BR> <esri4004> : Unknown datum based upon the Bessel 1841 ellipsoid
-<BR> <esri4005> : Unknown datum based upon the Bessel Modified ellipsoid
-<BR> <esri4006> : Unknown datum based upon the Bessel Namibia ellipsoid
-<BR> <esri4007> : Unknown datum based upon the Clarke 1858 ellipsoid
-<BR> <esri4008> : Unknown datum based upon the Clarke 1866 ellipsoid
-<BR> <esri4009> : Unknown datum based upon the Clarke 1866 Michigan ellipsoid
-<BR> <esri4010> : Unknown datum based upon the Clarke 1880 (Benoit) ellipsoid
-<BR> <esri4011> : Unknown datum based upon the Clarke 1880 (IGN) ellipsoid
-<BR> <esri4012> : Unknown datum based upon the Clarke 1880 (RGS) ellipsoid
-<BR> <esri4013> : Unknown datum based upon the Clarke 1880 (Arc) ellipsoid
-<BR> <esri4014> : Unknown datum based upon the Clarke 1880 (SGA 1922) ellipsoid
-<BR> <esri4015> : Unknown datum based upon the Everest 1830 (1937 Adjustment) ellipsoid
-<BR> <esri4016> : Unknown datum based upon the Everest 1830 (1967 Definition) ellipsoid
-<BR> <esri4018> : Unknown datum based upon the Everest 1830 Modified ellipsoid
-<BR> <esri4019> : Unknown datum based upon the GRS 1980 ellipsoid
-<BR> <esri4020> : Unknown datum based upon the Helmert 1906 ellipsoid
-<BR> <esri4021> : Unknown datum based upon the Indonesian National Spheroid
-<BR> <esri4022> : Unknown datum based upon the International 1924 ellipsoid
-<BR> <esri4024> : Unknown datum based upon the Krassowsky 1940 ellipsoid
-<BR> <esri4025> : Unknown datum based upon the NWL 9D ellipsoid
-<BR> <esri4027> : Unknown datum based upon the Plessis 1817 ellipsoid
-<BR> <esri4028> : Unknown datum based upon the Struve 1860 ellipsoid
-<BR> <esri4029> : Unknown datum based upon the War Office ellipsoid
-<BR> <esri4030> : Unknown datum based upon the WGS 84 ellipsoid
-<BR> <esri4031> : Unknown datum based upon the GEM 10C ellipsoid
-<BR> <esri4032> : Unknown datum based upon the OSU86F ellipsoid
-<BR> <esri4033> : Unknown datum based upon the OSU91A ellipsoid
-<BR> <esri4034> : Unknown datum based upon the Clarke 1880 ellipsoid
-<BR> <esri4035> : Unknown datum based upon the Authalic Sphere
-<BR> <esri4036> : Unknown datum based upon the GRS 1967 ellipsoid
-<BR> <esri4041> : Unknown datum based upon the Average Terrestrial System 1977 ellipsoid
-<BR> <esri4042> : Unknown datum based upon the Everest (1830 Definition) ellipsoid
-<BR> <esri4043> : Unknown datum based upon the WGS 72 ellipsoid
-<BR> <esri4044> : Unknown datum based upon the Everest 1830 (1962 Definition) ellipsoid
-<BR> <esri4045> : Unknown datum based upon the Everest 1830 (1975 Definition) ellipsoid
-<BR> <esri4047> : Unspecified based upon the GRS 1980 Authalic Sphere
-<BR> <esri4120> : Greek
-<BR> <esri4121> : GGRS87
-<BR> <esri4122> : ATS77
-<BR> <esri4123> : KKJ
-<BR> <esri4124> : RT90
-<BR> <esri4125> : Samboja
-<BR> <esri4126> : LKS94 (ETRS89)
-<BR> <esri4127> : Tete
-<BR> <esri4128> : Madzansua
-<BR> <esri4129> : Observatario
-<BR> <esri4130> : Moznet
-<BR> <esri4131> : Indian 1960
-<BR> <esri4132> : FD58
-<BR> <esri4133> : EST92
-<BR> <esri4134> : PDO Survey Datum 1993
-<BR> <esri4135> : Old Hawaiian
-<BR> <esri4136> : St. Lawrence Island
-<BR> <esri4137> : St. Paul Island
-<BR> <esri4138> : St. George Island
-<BR> <esri4139> : Puerto Rico
-<BR> <esri4140> : NAD83(CSRS98)
-<BR> <esri4141> : Israel
-<BR> <esri4142> : Locodjo 1965
-<BR> <esri4143> : Abidjan 1987
-<BR> <esri4144> : Kalianpur 1937
-<BR> <esri4145> : Kalianpur 1962
-<BR> <esri4146> : Kalianpur 1975
-<BR> <esri4147> : Hanoi 1972
-<BR> <esri4148> : Hartebeesthoek94
-<BR> <esri4149> : CH1903
-<BR> <esri4150> : CH1903+
-<BR> <esri4151> : CHTRF95
-<BR> <esri4152> : NAD83(HARN)
-<BR> <esri4153> : Rassadiran
-<BR> <esri4154> : ED50(ED77)
-<BR> <esri4155> : Dabola 1981
-<BR> <esri4156> : S-JTSK
-<BR> <esri4157> : Mount Dillon
-<BR> <esri4158> : Naparima 1955
-<BR> <esri4159> : ELD79
-<BR> <esri4160> : Chos Malal 1914
-<BR> <esri4161> : Pampa del Castillo
-<BR> <esri4162> : Korean 1985
-<BR> <esri4163> : Yemen NGN96
-<BR> <esri4164> : South Yemen
-<BR> <esri4165> : Bissau
-<BR> <esri4166> : Korean 1995
-<BR> <esri4167> : NZGD2000
-<BR> <esri4168> : Accra
-<BR> <esri4169> : American Samoa 1962
-<BR> <esri4170> : SIRGAS
-<BR> <esri4171> : RGF93
-<BR> <esri4172> : POSGAR
-<BR> <esri4173> : IRENET95
-<BR> <esri4174> : Sierra Leone 1924
-<BR> <esri4175> : Sierra Leone 1968
-<BR> <esri4176> : Australian Antarctic
-<BR> <esri4178> : Pulkovo 1942(83)
-<BR> <esri4179> : Pulkovo 1942(58)
-<BR> <esri4180> : EST97
-<BR> <esri4181> : Luxembourg 1930
-<BR> <esri4182> : Azores Occidental 1939
-<BR> <esri4183> : Azores Central 1948
-<BR> <esri4184> : Azores Oriental 1940
-<BR> <esri4185> : Madeira 1936
-<BR> <esri4188> : OSNI 1952
-<BR> <esri4189> : REGVEN
-<BR> <esri4190> : POSGAR 98
-<BR> <esri4191> : Albanian 1987
-<BR> <esri4192> : Douala 1948
-<BR> <esri4193> : Manoca 1962
-<BR> <esri4194> : Qornoq 1927
-<BR> <esri4195> : Scoresbysund 1952
-<BR> <esri4196> : Ammassalik 1958
-<BR> <esri4197> : Garoua
-<BR> <esri4198> : Kousseri
-<BR> <esri4199> : Egypt 1930
-<BR> <esri4200> : Pulkovo 1995
-<BR> <esri4201> : Adindan
-<BR> <esri4202> : AGD66
-<BR> <esri4203> : AGD84
-<BR> <esri4204> : Ain el Abd
-<BR> <esri4205> : Afgooye
-<BR> <esri4206> : Agadez
-<BR> <esri4207> : Lisbon
-<BR> <esri4208> : Aratu
-<BR> <esri4209> : Arc 1950
-<BR> <esri4210> : Arc 1960
-<BR> <esri4211> : Batavia
-<BR> <esri4212> : Barbados 1938
-<BR> <esri4213> : Beduaram
-<BR> <esri4214> : Beijing 1954
-<BR> <esri4215> : Belge 1950
-<BR> <esri4216> : Bermuda 1957
-<BR> <esri4218> : Bogota 1975
-<BR> <esri4219> : Bukit Rimpah
-<BR> <esri4220> : Camacupa
-<BR> <esri4221> : Campo Inchauspe
-<BR> <esri4222> : Cape
-<BR> <esri4223> : Carthage
-<BR> <esri4224> : Chua
-<BR> <esri4225> : Corrego Alegre
-<BR> <esri4226> : Cote d'Ivoire
-<BR> <esri4227> : Deir ez Zor
-<BR> <esri4228> : Douala
-<BR> <esri4229> : Egypt 1907
-<BR> <esri4230> : ED50
-<BR> <esri4231> : ED87
-<BR> <esri4232> : Fahud
-<BR> <esri4233> : Gandajika 1970
-<BR> <esri4234> : Garoua
-<BR> <esri4235> : Guyane Francaise
-<BR> <esri4236> : Hu Tzu Shan
-<BR> <esri4237> : HD72
-<BR> <esri4238> : ID74
-<BR> <esri4239> : Indian 1954
-<BR> <esri4240> : Indian 1975
-<BR> <esri4241> : Jamaica 1875
-<BR> <esri4242> : JAD69
-<BR> <esri4243> : Kalianpur 1880
-<BR> <esri4244> : Kandawala
-<BR> <esri4245> : Kertau
-<BR> <esri4246> : KOC
-<BR> <esri4247> : La Canoa
-<BR> <esri4248> : PSAD56
-<BR> <esri4249> : Lake
-<BR> <esri4250> : Leigon
-<BR> <esri4251> : Liberia 1964
-<BR> <esri4252> : Lome
-<BR> <esri4253> : Luzon 1911
-<BR> <esri4254> : Hito XVIII 1963
-<BR> <esri4255> : Herat North
-<BR> <esri4256> : Mahe 1971
-<BR> <esri4257> : Makassar
-<BR> <esri4258> : ETRS89
-<BR> <esri4259> : Malongo 1987
-<BR> <esri4260> : Manoca
-<BR> <esri4261> : Merchich
-<BR> <esri4262> : Massawa
-<BR> <esri4263> : Minna
-<BR> <esri4264> : Mhast
-<BR> <esri4265> : Monte Mario
-<BR> <esri4266> : M'poraloko
-<BR> <esri4267> : NAD27
-<BR> <esri4268> : NAD27 Michigan
-<BR> <esri4269> : NAD83
-<BR> <esri4270> : Nahrwan 1967
-<BR> <esri4271> : Naparima 1972
-<BR> <esri4272> : NZGD49
-<BR> <esri4273> : NGO 1948
-<BR> <esri4274> : Datum 73
-<BR> <esri4275> : NTF
-<BR> <esri4276> : NSWC 9Z-2
-<BR> <esri4277> : OSGB 1936
-<BR> <esri4278> : OSGB70
-<BR> <esri4279> : OS(SN)80
-<BR> <esri4280> : Padang
-<BR> <esri4281> : Palestine 1923
-<BR> <esri4282> : Pointe Noire
-<BR> <esri4283> : GDA94
-<BR> <esri4284> : Pulkovo 1942
-<BR> <esri4285> : Qatar 1974
-<BR> <esri4286> : Qatar 1948
-<BR> <esri4287> : Qornoq
-<BR> <esri4288> : Loma Quintana
-<BR> <esri4289> : Amersfoort
-<BR> <esri4291> : SAD69
-<BR> <esri4292> : Sapper Hill 1943
-<BR> <esri4293> : Schwarzeck
-<BR> <esri4294> : Segora
-<BR> <esri4295> : Serindung
-<BR> <esri4296> : Sudan
-<BR> <esri4297> : Tananarive
-<BR> <esri4298> : Timbalai 1948
-<BR> <esri4299> : TM65
-<BR> <esri4300> : TM75
-<BR> <esri4301> : Tokyo
-<BR> <esri4302> : Trinidad 1903
-<BR> <esri4303> : TC(1948)
-<BR> <esri4304> : Voirol 1875
-<BR> <esri4306> : Bern 1938
-<BR> <esri4307> : Nord Sahara 1959
-<BR> <esri4308> : RT38
-<BR> <esri4309> : Yacare
-<BR> <esri4310> : Yoff
-<BR> <esri4311> : Zanderij
-<BR> <esri4312> : MGI
-<BR> <esri4313> : Belge 1972
-<BR> <esri4314> : DHDN
-<BR> <esri4315> : Conakry 1905
-<BR> <esri4316> : Dealul Piscului 1933
-<BR> <esri4317> : Dealul Piscului 1970
-<BR> <esri4318> : NGN
-<BR> <esri4319> : KUDAMS
-<BR> <esri4322> : WGS 72
-<BR> <esri4324> : WGS 72BE
-<BR> <esri4326> : WGS 84
-<BR> <esri4600> : Anguilla 1957
-<BR> <esri4601> : Antigua 1943
-<BR> <esri4602> : Dominica 1945
-<BR> <esri4603> : Grenada 1953
-<BR> <esri4604> : Montserrat 1958
-<BR> <esri4605> : St. Kitts 1955
-<BR> <esri4606> : St. Lucia 1955
-<BR> <esri4607> : St. Vincent 1945
-<BR> <esri4608> : NAD27(76)
-<BR> <esri4609> : NAD27(CGQ77)
-<BR> <esri4610> : Xian 1980
-<BR> <esri4611> : Hong Kong 1980
-<BR> <esri4612> : JGD2000
-<BR> <esri4613> : Segara
-<BR> <esri4614> : QND95
-<BR> <esri4615> : Porto Santo
-<BR> <esri4616> : Selvagem Grande
-<BR> <esri4617> : NAD83(CSRS)
-<BR> <esri4801> : Bern 1898 (Bern)
-<BR> <esri4802> : Bogota 1975 (Bogota)
-<BR> <esri4803> : Lisbon (Lisbon)
-<BR> <esri4804> : Makassar (Jakarta)
-<BR> <esri4805> : MGI (Ferro)
-<BR> <esri4806> : Monte Mario (Rome)
-<BR> <esri4807> : NTF (Paris)
-<BR> <esri4808> : Padang (Jakarta)
-<BR> <esri4809> : Belge 1950 (Brussels)
-<BR> <esri4810> : Tananarive (Paris)
-<BR> <esri4811> : Voirol 1875 (Paris)
-<BR> <esri4813> : Batavia (Jakarta)
-<BR> <esri4814> : RT38 (Stockholm)
-<BR> <esri4815> : Greek (Athens)
-<BR> <esri4816> : Carthage (Paris)
-<BR> <esri4817> : NGO 1948 (Oslo)
-<BR> <esri4818> : S-JTSK (Ferro)
-<BR> <esri4819> : Nord Sahara 1959 (Paris)
-<BR> <esri4820> : Segara (Jakarta)
-<BR> <esri4901> : ATF (Paris)
-<BR> <esri4902> : NDG (Paris)
-<BR> <esri4903> : Madrid 1870 (Madrid)
-<BR> <esri4904> : Lisbon 1890 (Lisbon)
-<BR> <esri20004> : Pulkovo 1995 / Gauss-Kruger zone 4
-<BR> <esri20005> : Pulkovo 1995 / Gauss-Kruger zone 5
-<BR> <esri20006> : Pulkovo 1995 / Gauss-Kruger zone 6
-<BR> <esri20007> : Pulkovo 1995 / Gauss-Kruger zone 7
-<BR> <esri20008> : Pulkovo 1995 / Gauss-Kruger zone 8
-<BR> <esri20009> : Pulkovo 1995 / Gauss-Kruger zone 9
-<BR> <esri20010> : Pulkovo 1995 / Gauss-Kruger zone 10
-<BR> <esri20011> : Pulkovo 1995 / Gauss-Kruger zone 11
-<BR> <esri20012> : Pulkovo 1995 / Gauss-Kruger zone 12
-<BR> <esri20013> : Pulkovo 1995 / Gauss-Kruger zone 13
-<BR> <esri20014> : Pulkovo 1995 / Gauss-Kruger zone 14
-<BR> <esri20015> : Pulkovo 1995 / Gauss-Kruger zone 15
-<BR> <esri20016> : Pulkovo 1995 / Gauss-Kruger zone 16
-<BR> <esri20017> : Pulkovo 1995 / Gauss-Kruger zone 17
-<BR> <esri20018> : Pulkovo 1995 / Gauss-Kruger zone 18
-<BR> <esri20019> : Pulkovo 1995 / Gauss-Kruger zone 19
-<BR> <esri20020> : Pulkovo 1995 / Gauss-Kruger zone 20
-<BR> <esri20021> : Pulkovo 1995 / Gauss-Kruger zone 21
-<BR> <esri20022> : Pulkovo 1995 / Gauss-Kruger zone 22
-<BR> <esri20023> : Pulkovo 1995 / Gauss-Kruger zone 23
-<BR> <esri20024> : Pulkovo 1995 / Gauss-Kruger zone 24
-<BR> <esri20025> : Pulkovo 1995 / Gauss-Kruger zone 25
-<BR> <esri20026> : Pulkovo 1995 / Gauss-Kruger zone 26
-<BR> <esri20027> : Pulkovo 1995 / Gauss-Kruger zone 27
-<BR> <esri20028> : Pulkovo 1995 / Gauss-Kruger zone 28
-<BR> <esri20029> : Pulkovo 1995 / Gauss-Kruger zone 29
-<BR> <esri20030> : Pulkovo 1995 / Gauss-Kruger zone 30
-<BR> <esri20031> : Pulkovo 1995 / Gauss-Kruger zone 31
-<BR> <esri20032> : Pulkovo 1995 / Gauss-Kruger zone 32
-<BR> <esri20064> : Pulkovo 1995 / Gauss-Kruger 4N
-<BR> <esri20065> : Pulkovo 1995 / Gauss-Kruger 5N
-<BR> <esri20066> : Pulkovo 1995 / Gauss-Kruger 6N
-<BR> <esri20067> : Pulkovo 1995 / Gauss-Kruger 7N
-<BR> <esri20068> : Pulkovo 1995 / Gauss-Kruger 8N
-<BR> <esri20069> : Pulkovo 1995 / Gauss-Kruger 9N
-<BR> <esri20070> : Pulkovo 1995 / Gauss-Kruger 10N
-<BR> <esri20071> : Pulkovo 1995 / Gauss-Kruger 11N
-<BR> <esri20072> : Pulkovo 1995 / Gauss-Kruger 12N
-<BR> <esri20073> : Pulkovo 1995 / Gauss-Kruger 13N
-<BR> <esri20074> : Pulkovo 1995 / Gauss-Kruger 14N
-<BR> <esri20075> : Pulkovo 1995 / Gauss-Kruger 15N
-<BR> <esri20076> : Pulkovo 1995 / Gauss-Kruger 16N
-<BR> <esri20077> : Pulkovo 1995 / Gauss-Kruger 17N
-<BR> <esri20078> : Pulkovo 1995 / Gauss-Kruger 18N
-<BR> <esri20079> : Pulkovo 1995 / Gauss-Kruger 19N
-<BR> <esri20080> : Pulkovo 1995 / Gauss-Kruger 20N
-<BR> <esri20081> : Pulkovo 1995 / Gauss-Kruger 21N
-<BR> <esri20082> : Pulkovo 1995 / Gauss-Kruger 22N
-<BR> <esri20083> : Pulkovo 1995 / Gauss-Kruger 23N
-<BR> <esri20084> : Pulkovo 1995 / Gauss-Kruger 24N
-<BR> <esri20085> : Pulkovo 1995 / Gauss-Kruger 25N
-<BR> <esri20086> : Pulkovo 1995 / Gauss-Kruger 26N
-<BR> <esri20087> : Pulkovo 1995 / Gauss-Kruger 27N
-<BR> <esri20088> : Pulkovo 1995 / Gauss-Kruger 28N
-<BR> <esri20089> : Pulkovo 1995 / Gauss-Kruger 29N
-<BR> <esri20090> : Pulkovo 1995 / Gauss-Kruger 30N
-<BR> <esri20091> : Pulkovo 1995 / Gauss-Kruger 31N
-<BR> <esri20092> : Pulkovo 1995 / Gauss-Kruger 32N
-<BR> <esri20137> : Adindan / UTM zone 37N
-<BR> <esri20138> : Adindan / UTM zone 38N
-<BR> <esri20248> : AGD66 / AMG zone 48
-<BR> <esri20249> : AGD66 / AMG zone 49
-<BR> <esri20250> : AGD66 / AMG zone 50
-<BR> <esri20251> : AGD66 / AMG zone 51
-<BR> <esri20252> : AGD66 / AMG zone 52
-<BR> <esri20253> : AGD66 / AMG zone 53
-<BR> <esri20254> : AGD66 / AMG zone 54
-<BR> <esri20255> : AGD66 / AMG zone 55
-<BR> <esri20256> : AGD66 / AMG zone 56
-<BR> <esri20257> : AGD66 / AMG zone 57
-<BR> <esri20258> : AGD66 / AMG zone 58
-<BR> <esri20348> : AGD84 / AMG zone 48
-<BR> <esri20349> : AGD84 / AMG zone 49
-<BR> <esri20350> : AGD84 / AMG zone 50
-<BR> <esri20351> : AGD84 / AMG zone 51
-<BR> <esri20352> : AGD84 / AMG zone 52
-<BR> <esri20353> : AGD84 / AMG zone 53
-<BR> <esri20354> : AGD84 / AMG zone 54
-<BR> <esri20355> : AGD84 / AMG zone 55
-<BR> <esri20356> : AGD84 / AMG zone 56
-<BR> <esri20357> : AGD84 / AMG zone 57
-<BR> <esri20358> : AGD84 / AMG zone 58
-<BR> <esri20437> : Ain el Abd / UTM zone 37N
-<BR> <esri20438> : Ain el Abd / UTM zone 38N
-<BR> <esri20439> : Ain el Abd / UTM zone 39N
-<BR> <esri20499> : Ain el Abd / Bahrain Grid
-<BR> <esri20538> : Afgooye / UTM zone 38N
-<BR> <esri20539> : Afgooye / UTM zone 39N
-<BR> <esri20790> : Lisbon (Lisbon)/Portuguese National Grid
-<BR> <esri20791> : Lisbon (Lisbon)/Portuguese Grid
-<BR> <esri20822> : Aratu / UTM zone 22S
-<BR> <esri20823> : Aratu / UTM zone 23S
-<BR> <esri20824> : Aratu / UTM zone 24S
-<BR> <esri20934> : Arc 1950 / UTM zone 34S
-<BR> <esri20935> : Arc 1950 / UTM zone 35S
-<BR> <esri20936> : Arc 1950 / UTM zone 36S
-<BR> <esri21035> : Arc 1960 / UTM zone 35S
-<BR> <esri21036> : Arc 1960 / UTM zone 36S
-<BR> <esri21037> : Arc 1960 / UTM zone 37S
-<BR> <esri21095> : Arc 1960 / UTM zone 35N
-<BR> <esri21096> : Arc 1960 / UTM zone 36N
-<BR> <esri21097> : Arc 1960 / UTM zone 37N
-<BR> <esri21100> : Batavia (Jakarta) / NEIEZ
-<BR> <esri21148> : Batavia / UTM zone 48S
-<BR> <esri21149> : Batavia / UTM zone 49S
-<BR> <esri21150> : Batavia / UTM zone 50S
-<BR> <esri21291> : Barbados 1938 / British West Indies Grid
-<BR> <esri21292> : Barbados 1938 / Barbados National Grid
-<BR> <esri21413> : Beijing 1954 / Gauss-Kruger zone 13
-<BR> <esri21414> : Beijing 1954 / Gauss-Kruger zone 14
-<BR> <esri21415> : Beijing 1954 / Gauss-Kruger zone 15
-<BR> <esri21416> : Beijing 1954 / Gauss-Kruger zone 16
-<BR> <esri21417> : Beijing 1954 / Gauss-Kruger zone 17
-<BR> <esri21418> : Beijing 1954 / Gauss-Kruger zone 18
-<BR> <esri21419> : Beijing 1954 / Gauss-Kruger zone 19
-<BR> <esri21420> : Beijing 1954 / Gauss-Kruger zone 20
-<BR> <esri21421> : Beijing 1954 / Gauss-Kruger zone 21
-<BR> <esri21422> : Beijing 1954 / Gauss-Kruger zone 22
-<BR> <esri21423> : Beijing 1954 / Gauss-Kruger zone 23
-<BR> <esri21453> : Beijing 1954 / Gauss-Kruger CM 75E
-<BR> <esri21454> : Beijing 1954 / Gauss-Kruger CM 81E
-<BR> <esri21455> : Beijing 1954 / Gauss-Kruger CM 87E
-<BR> <esri21456> : Beijing 1954 / Gauss-Kruger CM 93E
-<BR> <esri21457> : Beijing 1954 / Gauss-Kruger CM 99E
-<BR> <esri21458> : Beijing 1954 / Gauss-Kruger CM 105E
-<BR> <esri21459> : Beijing 1954 / Gauss-Kruger CM 111E
-<BR> <esri21460> : Beijing 1954 / Gauss-Kruger CM 117E
-<BR> <esri21461> : Beijing 1954 / Gauss-Kruger CM 123E
-<BR> <esri21462> : Beijing 1954 / Gauss-Kruger CM 129E
-<BR> <esri21463> : Beijing 1954 / Gauss-Kruger CM 135E
-<BR> <esri21473> : Beijing 1954 / Gauss-Kruger 13N
-<BR> <esri21474> : Beijing 1954 / Gauss-Kruger 14N
-<BR> <esri21475> : Beijing 1954 / Gauss-Kruger 15N
-<BR> <esri21476> : Beijing 1954 / Gauss-Kruger 16N
-<BR> <esri21477> : Beijing 1954 / Gauss-Kruger 17N
-<BR> <esri21478> : Beijing 1954 / Gauss-Kruger 18N
-<BR> <esri21479> : Beijing 1954 / Gauss-Kruger 19N
-<BR> <esri21480> : Beijing 1954 / Gauss-Kruger 20N
-<BR> <esri21481> : Beijing 1954 / Gauss-Kruger 21N
-<BR> <esri21482> : Beijing 1954 / Gauss-Kruger 22N
-<BR> <esri21483> : Beijing 1954 / Gauss-Kruger 23N
-<BR> <esri21500> : Belge 1950 (Brussels) / Belge Lambert 50
-<BR> <esri21780> : Bern 1898 (Bern) / LV03C
-<BR> <esri21781> : CH1903 / LV03
-<BR> <esri21817> : Bogota 1975 / UTM zone 17N
-<BR> <esri21818> : Bogota 1975 / UTM zone 18N
-<BR> <esri21891> : Bogota 1975 / Colombia West zone
-<BR> <esri21892> : Bogota 1975 / Colombia Bogota zone
-<BR> <esri21893> : Bogota 1975 / Colombia East Central zone
-<BR> <esri21894> : Bogota 1975 / Colombia East
-<BR> <esri22032> : Camacupa / UTM zone 32S
-<BR> <esri22033> : Camacupa / UTM zone 33S
-<BR> <esri22091> : Camacupa / TM 11.30 SE
-<BR> <esri22092> : Camacupa / TM 12 SE
-<BR> <esri22191> : Campo Inchauspe / Argentina 1
-<BR> <esri22192> : Campo Inchauspe / Argentina 2
-<BR> <esri22193> : Campo Inchauspe / Argentina 3
-<BR> <esri22194> : Campo Inchauspe / Argentina 4
-<BR> <esri22195> : Campo Inchauspe / Argentina 5
-<BR> <esri22196> : Campo Inchauspe / Argentina 6
-<BR> <esri22197> : Campo Inchauspe / Argentina 7
-<BR> <esri22234> : Cape / UTM zone 34S
-<BR> <esri22235> : Cape / UTM zone 35S
-<BR> <esri22236> : Cape / UTM zone 36S
-<BR> <esri22332> : Carthage / UTM zone 32N
-<BR> <esri22391> : Carthage / Nord Tunisie
-<BR> <esri22392> : Carthage / Sud Tunisie
-<BR> <esri22523> : Corrego Alegre / UTM zone 23S
-<BR> <esri22524> : Corrego Alegre / UTM zone 24S
-<BR> <esri22700> : Deir ez Zor / Levant Zone
-<BR> <esri22770> : Deir ez Zor / Syria Lambert
-<BR> <esri22780> : Deir ez Zor / Levant Stereographic
-<BR> <esri22832> : Douala / UTM zone 32N
-<BR> <esri22991> : Egypt 1907 / Blue Belt
-<BR> <esri22992> : Egypt 1907 / Red Belt
-<BR> <esri22993> : Egypt 1907 / Purple Belt
-<BR> <esri22994> : Egypt 1907 / Extended Purple Belt
-<BR> <esri23028> : ED50 / UTM zone 28N
-<BR> <esri23029> : ED50 / UTM zone 29N
-<BR> <esri23030> : ED50 / UTM zone 30N
-<BR> <esri23031> : ED50 / UTM zone 31N
-<BR> <esri23032> : ED50 / UTM zone 32N
-<BR> <esri23033> : ED50 / UTM zone 33N
-<BR> <esri23034> : ED50 / UTM zone 34N
-<BR> <esri23035> : ED50 / UTM zone 35N
-<BR> <esri23036> : ED50 / UTM zone 36N
-<BR> <esri23037> : ED50 / UTM zone 37N
-<BR> <esri23038> : ED50 / UTM zone 38N
-<BR> <esri23090> : ED50 / TM 0 N
-<BR> <esri23095> : ED50 / TM 5 NE
-<BR> <esri23239> : Fahud / UTM zone 39N
-<BR> <esri23240> : Fahud / UTM zone 40N
-<BR> <esri23433> : Garoua / UTM zone 33N
-<BR> <esri23700> : HD72 / EOV
-<BR> <esri23846> : ID74 / UTM zone 46N
-<BR> <esri23847> : ID74 / UTM zone 47N
-<BR> <esri23848> : ID74 / UTM zone 48N
-<BR> <esri23849> : ID74 / UTM zone 49N
-<BR> <esri23850> : ID74 / UTM zone 50N
-<BR> <esri23851> : ID74 / UTM zone 51N
-<BR> <esri23852> : ID74 / UTM zone 52N
-<BR> <esri23853> : ID74 / UTM zone 53N
-<BR> <esri23886> : ID74 / UTM zone 46S
-<BR> <esri23887> : ID74 / UTM zone 47S
-<BR> <esri23888> : ID74 / UTM zone 48S
-<BR> <esri23889> : ID74 / UTM zone 49S
-<BR> <esri23890> : ID74 / UTM zone 50S
-<BR> <esri23891> : ID74 / UTM zone 51S
-<BR> <esri23892> : ID74 / UTM zone 52S
-<BR> <esri23893> : ID74 / UTM zone 53S
-<BR> <esri23894> : ID74 / UTM zone 54S
-<BR> <esri23946> : Indian 1954 / UTM zone 46N
-<BR> <esri23947> : Indian 1954 / UTM zone 47N
-<BR> <esri23948> : Indian 1954 / UTM zone 48N
-<BR> <esri24047> : Indian 1975 / UTM zone 47N
-<BR> <esri24048> : Indian 1975 / UTM zone 48N
-<BR> <esri24100> : Jamaica 1875 / Jamaica (Old Grid)
-<BR> <esri24200> : JAD69 / Jamaica National Grid
-<BR> <esri24305> : Kalianpur 1937 / UTM zone 45N
-<BR> <esri24306> : Kalianpur 1937 / UTM zone 46N
-<BR> <esri24311> : Kalianpur 1962 / UTM zone 41N
-<BR> <esri24312> : Kalianpur 1962 / UTM zone 42N
-<BR> <esri24313> : Kalianpur 1962 / UTM zone 43N
-<BR> <esri24342> : Kalianpur 1975 / UTM zone 42N
-<BR> <esri24343> : Kalianpur 1975 / UTM zone 43N
-<BR> <esri24344> : Kalianpur 1975 / UTM zone 44N
-<BR> <esri24345> : Kalianpur 1975 / UTM zone 45N
-<BR> <esri24346> : Kalianpur 1975 / UTM zone 46N
-<BR> <esri24347> : Kalianpur 1975 / UTM zone 47N
-<BR> <esri24370> : Kalianpur 1880 / India zone 0
-<BR> <esri24371> : Kalianpur 1880 / India zone I
-<BR> <esri24372> : Kalianpur 1880 / India zone IIa
-<BR> <esri24373> : Kalianpur 1880 / India zone III
-<BR> <esri24374> : Kalianpur 1880 / India zone IV
-<BR> <esri24375> : Kalianpur 1937 / India zone IIb
-<BR> <esri24376> : Kalianpur 1962 / India zone I
-<BR> <esri24377> : Kalianpur 1962 / India zone IIa
-<BR> <esri24378> : Kalianpur 1975 / India zone I
-<BR> <esri24379> : Kalianpur 1975 / India zone IIa
-<BR> <esri24380> : Kalianpur 1975 / India zone IIb
-<BR> <esri24381> : Kalianpur 1975 / India zone III
-<BR> <esri24382> : Kalianpur 1880 / India zone IIb
-<BR> <esri24383> : Kalianpur 1975 / India zone IV
-<BR> <esri24500> : Kertau / Singapore Grid
-<BR> <esri24547> : Kertau / UTM zone 47N
-<BR> <esri24548> : Kertau / UTM zone 48N
-<BR> <esri24571> : Kertau / R.S.O. Malaya (ch)
-<BR> <esri24600> : KOC Lambert
-<BR> <esri24718> : La Canoa / UTM zone 18N
-<BR> <esri24719> : La Canoa / UTM zone 19N
-<BR> <esri24720> : La Canoa / UTM zone 20N
-<BR> <esri24818> : PSAD56 / UTM zone 18N
-<BR> <esri24819> : PSAD56 / UTM zone 19N
-<BR> <esri24820> : PSAD56 / UTM zone 20N
-<BR> <esri24821> : PSAD56 / UTM zone 21N
-<BR> <esri24877> : PSAD56 / UTM zone 17S
-<BR> <esri24878> : PSAD56 / UTM zone 18S
-<BR> <esri24879> : PSAD56 / UTM zone 19S
-<BR> <esri24880> : PSAD56 / UTM zone 20S
-<BR> <esri24882> : PSAD56 / UTM zone 22S
-<BR> <esri24891> : PSAD56 / Peru west zone
-<BR> <esri24892> : PSAD56 / Peru central zone
-<BR> <esri24893> : PSAD56 / Peru east zone
-<BR> <esri25000> : Leigon / Ghana Metre Grid
-<BR> <esri25231> : Lome / UTM zone 31N
-<BR> <esri25391> : Luzon 1911 / Philippines zone I
-<BR> <esri25392> : Luzon 1911 / Philippines zone II
-<BR> <esri25393> : Luzon 1911 / Philippines zone III
-<BR> <esri25394> : Luzon 1911 / Philippines zone IV
-<BR> <esri25395> : Luzon 1911 / Philippines zone V
-<BR> <esri25700> : Makassar (Jakarta) / NEIEZ
-<BR> <esri25828> : ETRS89 / UTM zone 28N
-<BR> <esri25829> : ETRS89 / UTM zone 29N
-<BR> <esri25830> : ETRS89 / UTM zone 30N
-<BR> <esri25831> : ETRS89 / UTM zone 31N
-<BR> <esri25832> : ETRS89 / UTM zone 32N
-<BR> <esri25833> : ETRS89 / UTM zone 33N
-<BR> <esri25834> : ETRS89 / UTM zone 34N
-<BR> <esri25835> : ETRS89 / UTM zone 35N
-<BR> <esri25836> : ETRS89 / UTM zone 36N
-<BR> <esri25837> : ETRS89 / UTM zone 37N
-<BR> <esri25838> : ETRS89 / UTM zone 38N
-<BR> <esri25884> : ETRS89 / TM Baltic93
-<BR> <esri25932> : Malongo 1987 / UTM zone 32S
-<BR> <esri26191> : Merchich / Nord Maroc
-<BR> <esri26192> : Merchich / Sud Maroc
-<BR> <esri26193> : Merchich / Sahara
-<BR> <esri26237> : Massawa / UTM zone 37N
-<BR> <esri26331> : Minna / UTM zone 31N
-<BR> <esri26332> : Minna / UTM zone 32N
-<BR> <esri26391> : Minna / Nigeria West Belt
-<BR> <esri26392> : Minna / Nigeria Mid Belt
-<BR> <esri26393> : Minna / Nigeria East Belt
-<BR> <esri26432> : Mhast / UTM zone 32S
-<BR> <esri26591> : Monte Mario (Rome) / Italy zone 1
-<BR> <esri26592> : Monte Mario (Rome) / Italy zone 2
-<BR> <esri26632> : M'poraloko / UTM zone 32N
-<BR> <esri26692> : M'poraloko / UTM zone 32S
-<BR> <esri26703> : NAD27 / UTM zone 3N
-<BR> <esri26704> : NAD27 / UTM zone 4N
-<BR> <esri26705> : NAD27 / UTM zone 5N
-<BR> <esri26706> : NAD27 / UTM zone 6N
-<BR> <esri26707> : NAD27 / UTM zone 7N
-<BR> <esri26708> : NAD27 / UTM zone 8N
-<BR> <esri26709> : NAD27 / UTM zone 9N
-<BR> <esri26710> : NAD27 / UTM zone 10N
-<BR> <esri26711> : NAD27 / UTM zone 11N
-<BR> <esri26712> : NAD27 / UTM zone 12N
-<BR> <esri26713> : NAD27 / UTM zone 13N
-<BR> <esri26714> : NAD27 / UTM zone 14N
-<BR> <esri26715> : NAD27 / UTM zone 15N
-<BR> <esri26716> : NAD27 / UTM zone 16N
-<BR> <esri26717> : NAD27 / UTM zone 17N
-<BR> <esri26718> : NAD27 / UTM zone 18N
-<BR> <esri26719> : NAD27 / UTM zone 19N
-<BR> <esri26720> : NAD27 / UTM zone 20N
-<BR> <esri26721> : NAD27 / UTM zone 21N
-<BR> <esri26722> : NAD27 / UTM zone 22N
-<BR> <esri26729> : NAD27 / Alabama East
-<BR> <esri26730> : NAD27 / Alabama West
-<BR> <esri26731> : NAD27 / Alaska zone 1
-<BR> <esri26732> : NAD27 / Alaska zone 2
-<BR> <esri26733> : NAD27 / Alaska zone 3
-<BR> <esri26734> : NAD27 / Alaska zone 4
-<BR> <esri26735> : NAD27 / Alaska zone 5
-<BR> <esri26736> : NAD27 / Alaska zone 6
-<BR> <esri26737> : NAD27 / Alaska zone 7
-<BR> <esri26738> : NAD27 / Alaska zone 8
-<BR> <esri26739> : NAD27 / Alaska zone 9
-<BR> <esri26740> : NAD27 / Alaska zone 10
-<BR> <esri26741> : NAD27 / California zone I
-<BR> <esri26742> : NAD27 / California zone II
-<BR> <esri26743> : NAD27 / California zone III
-<BR> <esri26744> : NAD27 / California zone IV
-<BR> <esri26745> : NAD27 / California zone V
-<BR> <esri26746> : NAD27 / California zone VI
-<BR> <esri26747> : NAD27 / California zone VII
-<BR> <esri26748> : NAD27 / Arizona East
-<BR> <esri26749> : NAD27 / Arizona Central
-<BR> <esri26750> : NAD27 / Arizona West
-<BR> <esri26751> : NAD27 / Arkansas North
-<BR> <esri26752> : NAD27 / Arkansas South
-<BR> <esri26753> : NAD27 / Colorado North
-<BR> <esri26754> : NAD27 / Colorado Central
-<BR> <esri26755> : NAD27 / Colorado South
-<BR> <esri26756> : NAD27 / Connecticut
-<BR> <esri26757> : NAD27 / Delaware
-<BR> <esri26758> : NAD27 / Florida East
-<BR> <esri26759> : NAD27 / Florida West
-<BR> <esri26760> : NAD27 / Florida North
-<BR> <esri26766> : NAD27 / Georgia East
-<BR> <esri26767> : NAD27 / Georgia West
-<BR> <esri26768> : NAD27 / Idaho East
-<BR> <esri26769> : NAD27 / Idaho Central
-<BR> <esri26770> : NAD27 / Idaho West
-<BR> <esri26771> : NAD27 / Illinois East
-<BR> <esri26772> : NAD27 / Illinois West
-<BR> <esri26773> : NAD27 / Indiana East
-<BR> <esri26774> : NAD27 / Indiana West
-<BR> <esri26775> : NAD27 / Iowa North
-<BR> <esri26776> : NAD27 / Iowa South
-<BR> <esri26777> : NAD27 / Kansas North
-<BR> <esri26778> : NAD27 / Kansas South
-<BR> <esri26779> : NAD27 / Kentucky North
-<BR> <esri26780> : NAD27 / Kentucky South
-<BR> <esri26781> : NAD27 / Louisiana North
-<BR> <esri26782> : NAD27 / Louisiana South
-<BR> <esri26783> : NAD27 / Maine East
-<BR> <esri26784> : NAD27 / Maine West
-<BR> <esri26785> : NAD27 / Maryland
-<BR> <esri26786> : NAD27 / Massachusetts Mainland
-<BR> <esri26787> : NAD27 / Massachusetts Island
-<BR> <esri26791> : NAD27 / Minnesota North
-<BR> <esri26792> : NAD27 / Minnesota Central
-<BR> <esri26793> : NAD27 / Minnesota South
-<BR> <esri26794> : NAD27 / Mississippi East
-<BR> <esri26795> : NAD27 / Mississippi West
-<BR> <esri26796> : NAD27 / Missouri East
-<BR> <esri26797> : NAD27 / Missouri Central
-<BR> <esri26798> : NAD27 / Missouri West
-<BR> <esri26801> : NAD Michigan / Michigan East
-<BR> <esri26802> : NAD Michigan / Michigan Old Central
-<BR> <esri26803> : NAD Michigan / Michigan West
-<BR> <esri26811> : NAD Michigan / Michigan North
-<BR> <esri26812> : NAD Michigan / Michigan Central
-<BR> <esri26813> : NAD Michigan / Michigan South
-<BR> <esri26903> : NAD83 / UTM zone 3N
-<BR> <esri26904> : NAD83 / UTM zone 4N
-<BR> <esri26905> : NAD83 / UTM zone 5N
-<BR> <esri26906> : NAD83 / UTM zone 6N
-<BR> <esri26907> : NAD83 / UTM zone 7N
-<BR> <esri26908> : NAD83 / UTM zone 8N
-<BR> <esri26909> : NAD83 / UTM zone 9N
-<BR> <esri26910> : NAD83 / UTM zone 10N
-<BR> <esri26911> : NAD83 / UTM zone 11N
-<BR> <esri26912> : NAD83 / UTM zone 12N
-<BR> <esri26913> : NAD83 / UTM zone 13N
-<BR> <esri26914> : NAD83 / UTM zone 14N
-<BR> <esri26915> : NAD83 / UTM zone 15N
-<BR> <esri26916> : NAD83 / UTM zone 16N
-<BR> <esri26917> : NAD83 / UTM zone 17N
-<BR> <esri26918> : NAD83 / UTM zone 18N
-<BR> <esri26919> : NAD83 / UTM zone 19N
-<BR> <esri26920> : NAD83 / UTM zone 20N
-<BR> <esri26921> : NAD83 / UTM zone 21N
-<BR> <esri26922> : NAD83 / UTM zone 22N
-<BR> <esri26923> : NAD83 / UTM zone 23N
-<BR> <esri26929> : NAD83 / Alabama East
-<BR> <esri26930> : NAD83 / Alabama West
-<BR> <esri26931> : NAD83 / Alaska zone 1
-<BR> <esri26932> : NAD83 / Alaska zone 2
-<BR> <esri26933> : NAD83 / Alaska zone 3
-<BR> <esri26934> : NAD83 / Alaska zone 4
-<BR> <esri26935> : NAD83 / Alaska zone 5
-<BR> <esri26936> : NAD83 / Alaska zone 6
-<BR> <esri26937> : NAD83 / Alaska zone 7
-<BR> <esri26938> : NAD83 / Alaska zone 8
-<BR> <esri26939> : NAD83 / Alaska zone 9
-<BR> <esri26940> : NAD83 / Alaska zone 10
-<BR> <esri26941> : NAD83 / California zone 1
-<BR> <esri26942> : NAD83 / California zone 2
-<BR> <esri26943> : NAD83 / California zone 3
-<BR> <esri26944> : NAD83 / California zone 4
-<BR> <esri26945> : NAD83 / California zone 5
-<BR> <esri26946> : NAD83 / California zone 6
-<BR> <esri26948> : NAD83 / Arizona East
-<BR> <esri26949> : NAD83 / Arizona Central
-<BR> <esri26950> : NAD83 / Arizona West
-<BR> <esri26951> : NAD83 / Arkansas North
-<BR> <esri26952> : NAD83 / Arkansas South
-<BR> <esri26953> : NAD83 / Colorado North
-<BR> <esri26954> : NAD83 / Colorado Central
-<BR> <esri26955> : NAD83 / Colorado South
-<BR> <esri26956> : NAD83 / Connecticut
-<BR> <esri26957> : NAD83 / Delaware
-<BR> <esri26958> : NAD83 / Florida East
-<BR> <esri26959> : NAD83 / Florida West
-<BR> <esri26960> : NAD83 / Florida North
-<BR> <esri26961> : NAD83 / Hawaii zone 1
-<BR> <esri26962> : NAD83 / Hawaii zone 2
-<BR> <esri26963> : NAD83 / Hawaii zone 3
-<BR> <esri26964> : NAD83 / Hawaii zone 4
-<BR> <esri26965> : NAD83 / Hawaii zone 5
-<BR> <esri26966> : NAD83 / Georgia East
-<BR> <esri26967> : NAD83 / Georgia West
-<BR> <esri26968> : NAD83 / Idaho East
-<BR> <esri26969> : NAD83 / Idaho Central
-<BR> <esri26970> : NAD83 / Idaho West
-<BR> <esri26971> : NAD83 / Illinois East
-<BR> <esri26972> : NAD83 / Illinois West
-<BR> <esri26973> : NAD83 / Indiana East
-<BR> <esri26974> : NAD83 / Indiana West
-<BR> <esri26975> : NAD83 / Iowa North
-<BR> <esri26976> : NAD83 / Iowa South
-<BR> <esri26977> : NAD83 / Kansas North
-<BR> <esri26978> : NAD83 / Kansas South
-<BR> <esri26979> : NAD83 / Kentucky North
-<BR> <esri26980> : NAD83 / Kentucky South
-<BR> <esri26981> : NAD83 / Louisiana North
-<BR> <esri26982> : NAD83 / Louisiana South
-<BR> <esri26983> : NAD83 / Maine East
-<BR> <esri26984> : NAD83 / Maine West
-<BR> <esri26985> : NAD83 / Maryland
-<BR> <esri26986> : NAD83 / Massachusetts Mainland
-<BR> <esri26987> : NAD83 / Massachusetts Island
-<BR> <esri26988> : NAD83 / Michigan North
-<BR> <esri26989> : NAD83 / Michigan Central
-<BR> <esri26990> : NAD83 / Michigan South
-<BR> <esri26991> : NAD83 / Minnesota North
-<BR> <esri26992> : NAD83 / Minnesota Central
-<BR> <esri26993> : NAD83 / Minnesota South
-<BR> <esri26994> : NAD83 / Mississippi East
-<BR> <esri26995> : NAD83 / Mississippi West
-<BR> <esri26996> : NAD83 / Missouri East
-<BR> <esri26997> : NAD83 / Missouri Central
-<BR> <esri26998> : NAD83 / Missouri West
-<BR> <esri27038> : Nahrwan 1967 / UTM zone 38N
-<BR> <esri27039> : Nahrwan 1967 / UTM zone 39N
-<BR> <esri27040> : Nahrwan 1967 / UTM zone 40N
-<BR> <esri27120> : Naparima 1972 / UTM zone 20N
-<BR> <esri27200> : NZGD49 / New Zealand Map Grid
-<BR> <esri27205> : NZGD49 / Mount Eden Circuit
-<BR> <esri27206> : NZGD49 / Bay of Plenty Circuit
-<BR> <esri27207> : NZGD49 / Poverty Bay Circuit
-<BR> <esri27208> : NZGD49 / Hawkes Bay Circuit
-<BR> <esri27209> : NZGD49 / Taranaki Circuit
-<BR> <esri27210> : NZGD49 / Tuhirangi Circuit
-<BR> <esri27211> : NZGD49 / Wanganui Circuit
-<BR> <esri27212> : NZGD49 / Wairarapa Circuit
-<BR> <esri27213> : NZGD49 / Wellington Circuit
-<BR> <esri27214> : NZGD49 / Collingwood Circuit
-<BR> <esri27215> : NZGD49 / Nelson Circuit
-<BR> <esri27216> : NZGD49 / Karamea Circuit
-<BR> <esri27217> : NZGD49 / Buller Circuit
-<BR> <esri27218> : NZGD49 / Grey Circuit
-<BR> <esri27219> : NZGD49 / Amuri Circuit
-<BR> <esri27220> : NZGD49 / Marlborough Circuit
-<BR> <esri27221> : NZGD49 / Hokitika Circuit
-<BR> <esri27222> : NZGD49 / Okarito Circuit
-<BR> <esri27223> : NZGD49 / Jacksons Bay Circuit
-<BR> <esri27224> : NZGD49 / Mount Pleasant Circuit
-<BR> <esri27225> : NZGD49 / Gawler Circuit
-<BR> <esri27226> : NZGD49 / Timaru Circuit
-<BR> <esri27227> : NZGD49 / Lindis Peak Circuit
-<BR> <esri27228> : NZGD49 / Mount Nicholas Circuit
-<BR> <esri27229> : NZGD49 / Mount York Circuit
-<BR> <esri27230> : NZGD49 / Observation Point Circuit
-<BR> <esri27231> : NZGD49 / North Taieri Circuit
-<BR> <esri27232> : NZGD49 / Bluff Circuit
-<BR> <esri27258> : NZGD49 / UTM zone 58S
-<BR> <esri27259> : NZGD49 / UTM zone 59S
-<BR> <esri27260> : NZGD49 / UTM zone 60S
-<BR> <esri27291> : NZGD49 / North Island Grid
-<BR> <esri27292> : NZGD49 / South Island Grid
-<BR> <esri27391> : NGO 1948 (Oslo) / NGO zone I
-<BR> <esri27392> : NGO 1948 (Oslo) / NGO zone II
-<BR> <esri27393> : NGO 1948 (Oslo) / NGO zone III
-<BR> <esri27394> : NGO 1948 (Oslo) / NGO zone IV
-<BR> <esri27395> : NGO 1948 (Oslo) / NGO zone V
-<BR> <esri27396> : NGO 1948 (Oslo) / NGO zone VI
-<BR> <esri27397> : NGO 1948 (Oslo) / NGO zone VII
-<BR> <esri27398> : NGO 1948 (Oslo) / NGO zone VIII
-<BR> <esri27429> : Datum 73 / UTM zone 29N
-<BR> <esri27492> : Datum 73 / Modified Portuguese Grid
-<BR> <esri27500> : ATF (Paris) / Nord de Guerre
-<BR> <esri27561> : NTF (Paris) / Lambert Nord France
-<BR> <esri27562> : NTF (Paris) / Lambert Centre France
-<BR> <esri27563> : NTF (Paris) / Lambert Sud France
-<BR> <esri27564> : NTF (Paris) / Lambert Corse
-<BR> <esri27571> : NTF (Paris) / Lambert zone I
-<BR> <esri27572> : NTF (Paris) / Lambert zone II
-<BR> <esri27573> : NTF (Paris) / Lambert zone III
-<BR> <esri27574> : NTF (Paris) / Lambert zone IV
-<BR> <esri27581> : NTF (Paris) / France I
-<BR> <esri27582> : NTF (Paris) / France II
-<BR> <esri27583> : NTF (Paris) / France III
-<BR> <esri27584> : NTF (Paris) / France IV
-<BR> <esri27591> : NTF (Paris) / Nord France
-<BR> <esri27592> : NTF (Paris) / Centre France
-<BR> <esri27593> : NTF (Paris) / Sud France
-<BR> <esri27594> : NTF (Paris) / Corse
-<BR> <esri27700> : OSGB 1936 / British National Grid
-<BR> <esri28191> : Palestine 1923 / Palestine Grid
-<BR> <esri28192> : Palestine 1923 / Palestine Belt
-<BR> <esri28193> : Palestine 1923 / Israeli CS Grid
-<BR> <esri28232> : Pointe Noire / UTM zone 32S
-<BR> <esri28348> : GDA94 / MGA zone 48
-<BR> <esri28349> : GDA94 / MGA zone 49
-<BR> <esri28350> : GDA94 / MGA zone 50
-<BR> <esri28351> : GDA94 / MGA zone 51
-<BR> <esri28352> : GDA94 / MGA zone 52
-<BR> <esri28353> : GDA94 / MGA zone 53
-<BR> <esri28354> : GDA94 / MGA zone 54
-<BR> <esri28355> : GDA94 / MGA zone 55
-<BR> <esri28356> : GDA94 / MGA zone 56
-<BR> <esri28357> : GDA94 / MGA zone 57
-<BR> <esri28358> : GDA94 / MGA zone 58
-<BR> <esri28402> : Pulkovo 1942 / Gauss-Kruger zone 2
-<BR> <esri28403> : Pulkovo 1942 / Gauss-Kruger zone 3
-<BR> <esri28404> : Pulkovo 1942 / Gauss-Kruger zone 4
-<BR> <esri28405> : Pulkovo 1942 / Gauss-Kruger zone 5
-<BR> <esri28406> : Pulkovo 1942 / Gauss-Kruger zone 6
-<BR> <esri28407> : Pulkovo 1942 / Gauss-Kruger zone 7
-<BR> <esri28408> : Pulkovo 1942 / Gauss-Kruger zone 8
-<BR> <esri28409> : Pulkovo 1942 / Gauss-Kruger zone 9
-<BR> <esri28410> : Pulkovo 1942 / Gauss-Kruger zone 10
-<BR> <esri28411> : Pulkovo 1942 / Gauss-Kruger zone 11
-<BR> <esri28412> : Pulkovo 1942 / Gauss-Kruger zone 12
-<BR> <esri28413> : Pulkovo 1942 / Gauss-Kruger zone 13
-<BR> <esri28414> : Pulkovo 1942 / Gauss-Kruger zone 14
-<BR> <esri28415> : Pulkovo 1942 / Gauss-Kruger zone 15
-<BR> <esri28416> : Pulkovo 1942 / Gauss-Kruger zone 16
-<BR> <esri28417> : Pulkovo 1942 / Gauss-Kruger zone 17
-<BR> <esri28418> : Pulkovo 1942 / Gauss-Kruger zone 18
-<BR> <esri28419> : Pulkovo 1942 / Gauss-Kruger zone 19
-<BR> <esri28420> : Pulkovo 1942 / Gauss-Kruger zone 20
-<BR> <esri28421> : Pulkovo 1942 / Gauss-Kruger zone 21
-<BR> <esri28422> : Pulkovo 1942 / Gauss-Kruger zone 22
-<BR> <esri28423> : Pulkovo 1942 / Gauss-Kruger zone 23
-<BR> <esri28424> : Pulkovo 1942 / Gauss-Kruger zone 24
-<BR> <esri28425> : Pulkovo 1942 / Gauss-Kruger zone 25
-<BR> <esri28426> : Pulkovo 1942 / Gauss-Kruger zone 26
-<BR> <esri28427> : Pulkovo 1942 / Gauss-Kruger zone 27
-<BR> <esri28428> : Pulkovo 1942 / Gauss-Kruger zone 28
-<BR> <esri28429> : Pulkovo 1942 / Gauss-Kruger zone 29
-<BR> <esri28430> : Pulkovo 1942 / Gauss-Kruger zone 30
-<BR> <esri28431> : Pulkovo 1942 / Gauss-Kruger zone 31
-<BR> <esri28432> : Pulkovo 1942 / Gauss-Kruger zone 32
-<BR> <esri28462> : Pulkovo 1942 / Gauss-Kruger 2N
-<BR> <esri28463> : Pulkovo 1942 / Gauss-Kruger 3N
-<BR> <esri28464> : Pulkovo 1942 / Gauss-Kruger 4N
-<BR> <esri28465> : Pulkovo 1942 / Gauss-Kruger 5N
-<BR> <esri28466> : Pulkovo 1942 / Gauss-Kruger 6N
-<BR> <esri28467> : Pulkovo 1942 / Gauss-Kruger 7N
-<BR> <esri28468> : Pulkovo 1942 / Gauss-Kruger 8N
-<BR> <esri28469> : Pulkovo 1942 / Gauss-Kruger 9N
-<BR> <esri28470> : Pulkovo 1942 / Gauss-Kruger 10N
-<BR> <esri28471> : Pulkovo 1942 / Gauss-Kruger 11N
-<BR> <esri28472> : Pulkovo 1942 / Gauss-Kruger 12N
-<BR> <esri28473> : Pulkovo 1942 / Gauss-Kruger 13N
-<BR> <esri28474> : Pulkovo 1942 / Gauss-Kruger 14N
-<BR> <esri28475> : Pulkovo 1942 / Gauss-Kruger 15N
-<BR> <esri28476> : Pulkovo 1942 / Gauss-Kruger 16N
-<BR> <esri28477> : Pulkovo 1942 / Gauss-Kruger 17N
-<BR> <esri28478> : Pulkovo 1942 / Gauss-Kruger 18N
-<BR> <esri28479> : Pulkovo 1942 / Gauss-Kruger 19N
-<BR> <esri28480> : Pulkovo 1942 / Gauss-Kruger 20N
-<BR> <esri28481> : Pulkovo 1942 / Gauss-Kruger 21N
-<BR> <esri28482> : Pulkovo 1942 / Gauss-Kruger 22N
-<BR> <esri28483> : Pulkovo 1942 / Gauss-Kruger 23N
-<BR> <esri28484> : Pulkovo 1942 / Gauss-Kruger 24N
-<BR> <esri28485> : Pulkovo 1942 / Gauss-Kruger 25N
-<BR> <esri28486> : Pulkovo 1942 / Gauss-Kruger 26N
-<BR> <esri28487> : Pulkovo 1942 / Gauss-Kruger 27N
-<BR> <esri28488> : Pulkovo 1942 / Gauss-Kruger 28N
-<BR> <esri28489> : Pulkovo 1942 / Gauss-Kruger 29N
-<BR> <esri28490> : Pulkovo 1942 / Gauss-Kruger 30N
-<BR> <esri28491> : Pulkovo 1942 / Gauss-Kruger 31N
-<BR> <esri28492> : Pulkovo 1942 / Gauss-Kruger 32N
-<BR> <esri28600> : Qatar 1974 / Qatar National Grid
-<BR> <esri28991> : Amersfoort / RD Old
-<BR> <esri28992> : Amersfoort / RD New
-<BR> <esri29100> : SAD69 / Brazil Polyconic
-<BR> <esri29118> : SAD69 / UTM zone 18N
-<BR> <esri29119> : SAD69 / UTM zone 19N
-<BR> <esri29120> : SAD69 / UTM zone 20N
-<BR> <esri29121> : SAD69 / UTM zone 21N
-<BR> <esri29122> : SAD69 / UTM zone 22N
-<BR> <esri29177> : SAD69 / UTM zone 17S
-<BR> <esri29178> : SAD69 / UTM zone 18S
-<BR> <esri29179> : SAD69 / UTM zone 19S
-<BR> <esri29180> : SAD69 / UTM zone 20S
-<BR> <esri29181> : SAD69 / UTM zone 21S
-<BR> <esri29182> : SAD69 / UTM zone 22S
-<BR> <esri29183> : SAD69 / UTM zone 23S
-<BR> <esri29184> : SAD69 / UTM zone 24S
-<BR> <esri29185> : SAD69 / UTM zone 25S
-<BR> <esri29220> : Sapper Hill 1943 / UTM zone 20S
-<BR> <esri29221> : Sapper Hill 1943 / UTM zone 21S
-<BR> <esri29333> : Schwarzeck / UTM zone 33S
-<BR> <esri29635> : Sudan / UTM zone 35N
-<BR> <esri29636> : Sudan / UTM zone 36N
-<BR> <esri29700> : Tananarive (Paris) / Laborde Grid
-<BR> <esri29738> : Tananarive / UTM zone 38S
-<BR> <esri29739> : Tananarive / UTM zone 39S
-<BR> <esri29849> : Timbalai 1948 / UTM zone 49N
-<BR> <esri29850> : Timbalai 1948 / UTM zone 50N
-<BR> <esri29871> : Timbalai 1948 / R.S.O. Borneo (ch)
-<BR> <esri29872> : Timbalai 1948 / R.S.O. Borneo (ft)
-<BR> <esri29873> : Timbalai 1948 / R.S.O. Borneo (m)
-<BR> <esri29900> : TM65 / Irish National Grid
-<BR> <esri29901> : OSNI 1952 / Irish National Grid
-<BR> <esri29902> : TM65 / Irish Grid
-<BR> <esri29903> : TM75 / Irish Grid
-<BR> <esri30161> : Tokyo / Japan Plane Rectangular CS I
-<BR> <esri30162> : Tokyo / Japan Plane Rectangular CS II
-<BR> <esri30163> : Tokyo / Japan Plane Rectangular CS III
-<BR> <esri30164> : Tokyo / Japan Plane Rectangular CS IV
-<BR> <esri30165> : Tokyo / Japan Plane Rectangular CS V
-<BR> <esri30166> : Tokyo / Japan Plane Rectangular CS VI
-<BR> <esri30167> : Tokyo / Japan Plane Rectangular CS VII
-<BR> <esri30168> : Tokyo / Japan Plane Rectangular CS VIII
-<BR> <esri30169> : Tokyo / Japan Plane Rectangular CS IX
-<BR> <esri30170> : Tokyo / Japan Plane Rectangular CS X
-<BR> <esri30171> : Tokyo / Japan Plane Rectangular CS XI
-<BR> <esri30172> : Tokyo / Japan Plane Rectangular CS XII
-<BR> <esri30173> : Tokyo / Japan Plane Rectangular CS XIII
-<BR> <esri30174> : Tokyo / Japan Plane Rectangular CS XIV
-<BR> <esri30175> : Tokyo / Japan Plane Rectangular CS XV
-<BR> <esri30176> : Tokyo / Japan Plane Rectangular CS XVI
-<BR> <esri30177> : Tokyo / Japan Plane Rectangular CS XVII
-<BR> <esri30178> : Tokyo / Japan Plane Rectangular CS XVIII
-<BR> <esri30179> : Tokyo / Japan Plane Rectangular CS XIX
-<BR> <esri30200> : Trinidad 1903 / Trinidad Grid
-<BR> <esri30339> : TC(1948) / UTM zone 39N
-<BR> <esri30340> : TC(1948) / UTM zone 40N
-<BR> <esri30491> : Voirol 1875 / Nord Algerie (ancienne)
-<BR> <esri30492> : Voirol 1875 / Sud Algerie (ancienne)
-<BR> <esri30729> : Nord Sahara 1959 / UTM zone 29N
-<BR> <esri30730> : Nord Sahara 1959 / UTM zone 30N
-<BR> <esri30731> : Nord Sahara 1959 / UTM zone 31N
-<BR> <esri30732> : Nord Sahara 1959 / UTM zone 32N
-<BR> <esri30791> : Nord Sahara 1959 / Voirol Unifie Nord
-<BR> <esri30792> : Nord Sahara 1959 / Voirol Unifie Sud
-<BR> <esri30800> : RT38 2.5 gon W
-<BR> <esri31028> : Yoff / UTM zone 28N
-<BR> <esri31121> : Zanderij / UTM zone 21N
-<BR> <esri31154> : Zanderij / TM 54 NW
-<BR> <esri31170> : Zanderij / Suriname Old TM
-<BR> <esri31171> : Zanderij / Suriname TM
-<BR> <esri31265> : MGI / 3-degree Gauss zone 5
-<BR> <esri31266> : MGI / 3-degree Gauss zone 6
-<BR> <esri31267> : MGI / 3-degree Gauss zone 7
-<BR> <esri31268> : MGI / 3-degree Gauss zone 8
-<BR> <esri31275> : MGI / Balkans zone 5
-<BR> <esri31276> : MGI / Balkans zone 6
-<BR> <esri31277> : MGI / Balkans zone 7
-<BR> <esri31278> : MGI / Balkans zone 8
-<BR> <esri31279> : MGI / Balkans zone 8
-<BR> <esri31281> : MGI (Ferro) / Austria West Zone
-<BR> <esri31282> : MGI (Ferro) / Austria Central Zone
-<BR> <esri31283> : MGI (Ferro) / Austria East Zone
-<BR> <esri31284> : MGI / M28
-<BR> <esri31285> : MGI / M31
-<BR> <esri31286> : MGI / M34
-<BR> <esri31287> : MGI / Austria Lambert
-<BR> <esri31291> : MGI (Ferro) / Austria West Zone
-<BR> <esri31292> : MGI (Ferro) / Austria Central Zone
-<BR> <esri31293> : MGI (Ferro) / Austria East Zone
-<BR> <esri31294> : MGI / M28
-<BR> <esri31295> : MGI / M31
-<BR> <esri31296> : MGI / M34
-<BR> <esri31297> : MGI / Austria Lambert
-<BR> <esri31300> : Belge 1972 / Belge Lambert 72
-<BR> <esri31370> : Belge 1972 / Belgian Lambert 72
-<BR> <esri31461> : DHDN / 3-degree Gauss zone 1
-<BR> <esri31462> : DHDN / 3-degree Gauss zone 2
-<BR> <esri31463> : DHDN / 3-degree Gauss zone 3
-<BR> <esri31464> : DHDN / 3-degree Gauss zone 4
-<BR> <esri31465> : DHDN / 3-degree Gauss zone 5
-<BR> <esri31466> : DHDN / Gauss-Kruger zone 2
-<BR> <esri31467> : DHDN / Gauss-Kruger zone 3
-<BR> <esri31468> : DHDN / Gauss-Kruger zone 4
-<BR> <esri31469> : DHDN / Gauss-Kruger zone 5
-<BR> <esri31528> : Conakry 1905 / UTM zone 28N
-<BR> <esri31529> : Conakry 1905 / UTM zone 29N
-<BR> <esri31600> : Dealul Piscului 1933/ Stereo 33
-<BR> <esri31700> : Dealul Piscului 1970/ Stereo 70
-<BR> <esri31838> : NGN / UTM zone 38N
-<BR> <esri31839> : NGN / UTM zone 39N
-<BR> <esri31900> : KUDAMS / KTM
-<BR> <esri31986> : SIRGAS / UTM zone 17N
-<BR> <esri31987> : SIRGAS / UTM zone 18N
-<BR> <esri31988> : SIRGAS / UTM zone 19N
-<BR> <esri31989> : SIRGAS / UTM zone 20N
-<BR> <esri31990> : SIRGAS / UTM zone 21N
-<BR> <esri31991> : SIRGAS / UTM zone 22N
-<BR> <esri31992> : SIRGAS / UTM zone 17S
-<BR> <esri31993> : SIRGAS / UTM zone 18S
-<BR> <esri31994> : SIRGAS / UTM zone 19S
-<BR> <esri31995> : SIRGAS / UTM zone 20S
-<BR> <esri31996> : SIRGAS / UTM zone 21S
-<BR> <esri31997> : SIRGAS / UTM zone 22S
-<BR> <esri31998> : SIRGAS / UTM zone 23S
-<BR> <esri31999> : SIRGAS / UTM zone 24S
-<BR> <esri32000> : SIRGAS / UTM zone 25S
-<BR> <esri32001> : NAD27 / Montana North
-<BR> <esri32002> : NAD27 / Montana Central
-<BR> <esri32003> : NAD27 / Montana South
-<BR> <esri32005> : NAD27 / Nebraska North
-<BR> <esri32006> : NAD27 / Nebraska South
-<BR> <esri32007> : NAD27 / Nevada East
-<BR> <esri32008> : NAD27 / Nevada Central
-<BR> <esri32009> : NAD27 / Nevada West
-<BR> <esri32010> : NAD27 / New Hampshire
-<BR> <esri32011> : NAD27 / New Jersey
-<BR> <esri32012> : NAD27 / New Mexico East
-<BR> <esri32013> : NAD27 / New Mexico Central
-<BR> <esri32014> : NAD27 / New Mexico West
-<BR> <esri32015> : NAD27 / New York East
-<BR> <esri32016> : NAD27 / New York Central
-<BR> <esri32017> : NAD27 / New York West
-<BR> <esri32018> : NAD27 / New York Long Island
-<BR> <esri32019> : NAD27 / North Carolina
-<BR> <esri32020> : NAD27 / North Dakota North
-<BR> <esri32021> : NAD27 / North Dakota South
-<BR> <esri32022> : NAD27 / Ohio North
-<BR> <esri32023> : NAD27 / Ohio South
-<BR> <esri32024> : NAD27 / Oklahoma North
-<BR> <esri32025> : NAD27 / Oklahoma South
-<BR> <esri32026> : NAD27 / Oregon North
-<BR> <esri32027> : NAD27 / Oregon South
-<BR> <esri32028> : NAD27 / Pennsylvania North
-<BR> <esri32029> : NAD27 / Pennsylvania South
-<BR> <esri32030> : NAD27 / Rhode Island
-<BR> <esri32031> : NAD27 / South Carolina North
-<BR> <esri32033> : NAD27 / South Carolina South
-<BR> <esri32034> : NAD27 / South Dakota North
-<BR> <esri32035> : NAD27 / South Dakota South
-<BR> <esri32036> : NAD27 / Tennessee
-<BR> <esri32037> : NAD27 / Texas North
-<BR> <esri32038> : NAD27 / Texas North Central
-<BR> <esri32039> : NAD27 / Texas Central
-<BR> <esri32040> : NAD27 / Texas South Central
-<BR> <esri32041> : NAD27 / Texas South
-<BR> <esri32042> : NAD27 / Utah North
-<BR> <esri32043> : NAD27 / Utah Central
-<BR> <esri32044> : NAD27 / Utah South
-<BR> <esri32045> : NAD27 / Vermont
-<BR> <esri32046> : NAD27 / Virginia North
-<BR> <esri32047> : NAD27 / Virginia South
-<BR> <esri32048> : NAD27 / Washington North
-<BR> <esri32049> : NAD27 / Washington South
-<BR> <esri32050> : NAD27 / West Virginia North
-<BR> <esri32051> : NAD27 / West Virginia South
-<BR> <esri32052> : NAD27 / Wisconsin North
-<BR> <esri32053> : NAD27 / Wisconsin Central
-<BR> <esri32054> : NAD27 / Wisconsin South
-<BR> <esri32055> : NAD27 / Wyoming East
-<BR> <esri32056> : NAD27 / Wyoming East Central
-<BR> <esri32057> : NAD27 / Wyoming West Central
-<BR> <esri32058> : NAD27 / Wyoming West
-<BR> <esri32061> : NAD27 / Guatemala Norte
-<BR> <esri32062> : NAD27 / Guatemala Sur
-<BR> <esri32064> : NAD27 / BLM 14N (ftUS)
-<BR> <esri32065> : NAD27 / BLM 15N (ftUS)
-<BR> <esri32066> : NAD27 / BLM 16N (ftUS)
-<BR> <esri32067> : NAD27 / BLM 17N (ftUS)
-<BR> <esri32074> : NAD27 / BLM 14N (feet)
-<BR> <esri32075> : NAD27 / BLM 15N (feet)
-<BR> <esri32076> : NAD27 / BLM 16N (feet)
-<BR> <esri32077> : NAD27 / BLM 17N (feet)
-<BR> <esri32081> : NAD27 / MTM zone 1
-<BR> <esri32082> : NAD27 / MTM zone 2
-<BR> <esri32083> : NAD27 / MTM zone 3
-<BR> <esri32084> : NAD27 / MTM zone 4
-<BR> <esri32085> : NAD27 / MTM zone 5
-<BR> <esri32086> : NAD27 / MTM zone 6
-<BR> <esri32098> : NAD27 / Quebec Lambert
-<BR> <esri32100> : NAD83 / Montana
-<BR> <esri32104> : NAD83 / Nebraska
-<BR> <esri32107> : NAD83 / Nevada East
-<BR> <esri32108> : NAD83 / Nevada Central
-<BR> <esri32109> : NAD83 / Nevada West
-<BR> <esri32110> : NAD83 / New Hampshire
-<BR> <esri32111> : NAD83 / New Jersey
-<BR> <esri32112> : NAD83 / New Mexico East
-<BR> <esri32113> : NAD83 / New Mexico Central
-<BR> <esri32114> : NAD83 / New Mexico West
-<BR> <esri32115> : NAD83 / New York East
-<BR> <esri32116> : NAD83 / New York Central
-<BR> <esri32117> : NAD83 / New York West
-<BR> <esri32118> : NAD83 / New York Long Island
-<BR> <esri32119> : NAD83 / North Carolina
-<BR> <esri32120> : NAD83 / North Dakota North
-<BR> <esri32121> : NAD83 / North Dakota South
-<BR> <esri32122> : NAD83 / Ohio North
-<BR> <esri32123> : NAD83 / Ohio South
-<BR> <esri32124> : NAD83 / Oklahoma North
-<BR> <esri32125> : NAD83 / Oklahoma South
-<BR> <esri32126> : NAD83 / Oregon North
-<BR> <esri32127> : NAD83 / Oregon South
-<BR> <esri32128> : NAD83 / Pennsylvania North
-<BR> <esri32129> : NAD83 / Pennsylvania South
-<BR> <esri32130> : NAD83 / Rhode Island
-<BR> <esri32133> : NAD83 / South Carolina
-<BR> <esri32134> : NAD83 / South Dakota North
-<BR> <esri32135> : NAD83 / South Dakota South
-<BR> <esri32136> : NAD83 / Tennessee
-<BR> <esri32137> : NAD83 / Texas North
-<BR> <esri32138> : NAD83 / Texas North Central
-<BR> <esri32139> : NAD83 / Texas Central
-<BR> <esri32140> : NAD83 / Texas South Central
-<BR> <esri32141> : NAD83 / Texas South
-<BR> <esri32142> : NAD83 / Utah North
-<BR> <esri32143> : NAD83 / Utah Central
-<BR> <esri32144> : NAD83 / Utah South
-<BR> <esri32145> : NAD83 / Vermont
-<BR> <esri32146> : NAD83 / Virginia North
-<BR> <esri32147> : NAD83 / Virginia South
-<BR> <esri32148> : NAD83 / Washington North
-<BR> <esri32149> : NAD83 / Washington South
-<BR> <esri32150> : NAD83 / West Virginia North
-<BR> <esri32151> : NAD83 / West Virginia South
-<BR> <esri32152> : NAD83 / Wisconsin North
-<BR> <esri32153> : NAD83 / Wisconsin Central
-<BR> <esri32154> : NAD83 / Wisconsin South
-<BR> <esri32155> : NAD83 / Wyoming East
-<BR> <esri32156> : NAD83 / Wyoming East Central
-<BR> <esri32157> : NAD83 / Wyoming West Central
-<BR> <esri32158> : NAD83 / Wyoming West
-<BR> <esri32161> : NAD83 / Puerto Rico & Virgin Is.
-<BR> <esri32180> : NAD83 / SCoPQ zone 2
-<BR> <esri32181> : NAD83 / MTM zone 1
-<BR> <esri32182> : NAD83 / MTM zone 2
-<BR> <esri32183> : NAD83 / MTM zone 3
-<BR> <esri32184> : NAD83 / MTM zone 4
-<BR> <esri32185> : NAD83 / MTM zone 5
-<BR> <esri32186> : NAD83 / MTM zone 6
-<BR> <esri32187> : NAD83 / MTM zone 7
-<BR> <esri32188> : NAD83 / MTM zone 8
-<BR> <esri32189> : NAD83 / MTM zone 9
-<BR> <esri32190> : NAD83 / MTM zone 10
-<BR> <esri32191> : NAD83 / MTM zone 11
-<BR> <esri32192> : NAD83 / MTM zone 12
-<BR> <esri32193> : NAD83 / MTM zone 13
-<BR> <esri32194> : NAD83 / MTM zone 14
-<BR> <esri32195> : NAD83 / MTM zone 15
-<BR> <esri32196> : NAD83 / MTM zone 16
-<BR> <esri32197> : NAD83 / MTM zone 17
-<BR> <esri32198> : NAD83 / Quebec Lambert
-<BR> <esri32201> : WGS 72 / UTM zone 1N
-<BR> <esri32202> : WGS 72 / UTM zone 2N
-<BR> <esri32203> : WGS 72 / UTM zone 3N
-<BR> <esri32204> : WGS 72 / UTM zone 4N
-<BR> <esri32205> : WGS 72 / UTM zone 5N
-<BR> <esri32206> : WGS 72 / UTM zone 6N
-<BR> <esri32207> : WGS 72 / UTM zone 7N
-<BR> <esri32208> : WGS 72 / UTM zone 8N
-<BR> <esri32209> : WGS 72 / UTM zone 9N
-<BR> <esri32210> : WGS 72 / UTM zone 10N
-<BR> <esri32211> : WGS 72 / UTM zone 11N
-<BR> <esri32212> : WGS 72 / UTM zone 12N
-<BR> <esri32213> : WGS 72 / UTM zone 13N
-<BR> <esri32214> : WGS 72 / UTM zone 14N
-<BR> <esri32215> : WGS 72 / UTM zone 15N
-<BR> <esri32216> : WGS 72 / UTM zone 16N
-<BR> <esri32217> : WGS 72 / UTM zone 17N
-<BR> <esri32218> : WGS 72 / UTM zone 18N
-<BR> <esri32219> : WGS 72 / UTM zone 19N
-<BR> <esri32220> : WGS 72 / UTM zone 20N
-<BR> <esri32221> : WGS 72 / UTM zone 21N
-<BR> <esri32222> : WGS 72 / UTM zone 22N
-<BR> <esri32223> : WGS 72 / UTM zone 23N
-<BR> <esri32224> : WGS 72 / UTM zone 24N
-<BR> <esri32225> : WGS 72 / UTM zone 25N
-<BR> <esri32226> : WGS 72 / UTM zone 26N
-<BR> <esri32227> : WGS 72 / UTM zone 27N
-<BR> <esri32228> : WGS 72 / UTM zone 28N
-<BR> <esri32229> : WGS 72 / UTM zone 29N
-<BR> <esri32230> : WGS 72 / UTM zone 30N
-<BR> <esri32231> : WGS 72 / UTM zone 31N
-<BR> <esri32232> : WGS 72 / UTM zone 32N
-<BR> <esri32233> : WGS 72 / UTM zone 33N
-<BR> <esri32234> : WGS 72 / UTM zone 34N
-<BR> <esri32235> : WGS 72 / UTM zone 35N
-<BR> <esri32236> : WGS 72 / UTM zone 36N
-<BR> <esri32237> : WGS 72 / UTM zone 37N
-<BR> <esri32238> : WGS 72 / UTM zone 38N
-<BR> <esri32239> : WGS 72 / UTM zone 39N
-<BR> <esri32240> : WGS 72 / UTM zone 40N
-<BR> <esri32241> : WGS 72 / UTM zone 41N
-<BR> <esri32242> : WGS 72 / UTM zone 42N
-<BR> <esri32243> : WGS 72 / UTM zone 43N
-<BR> <esri32244> : WGS 72 / UTM zone 44N
-<BR> <esri32245> : WGS 72 / UTM zone 45N
-<BR> <esri32246> : WGS 72 / UTM zone 46N
-<BR> <esri32247> : WGS 72 / UTM zone 47N
-<BR> <esri32248> : WGS 72 / UTM zone 48N
-<BR> <esri32249> : WGS 72 / UTM zone 49N
-<BR> <esri32250> : WGS 72 / UTM zone 50N
-<BR> <esri32251> : WGS 72 / UTM zone 51N
-<BR> <esri32252> : WGS 72 / UTM zone 52N
-<BR> <esri32253> : WGS 72 / UTM zone 53N
-<BR> <esri32254> : WGS 72 / UTM zone 54N
-<BR> <esri32255> : WGS 72 / UTM zone 55N
-<BR> <esri32256> : WGS 72 / UTM zone 56N
-<BR> <esri32257> : WGS 72 / UTM zone 57N
-<BR> <esri32258> : WGS 72 / UTM zone 58N
-<BR> <esri32259> : WGS 72 / UTM zone 59N
-<BR> <esri32260> : WGS 72 / UTM zone 60N
-<BR> <esri32301> : WGS 72 / UTM zone 1S
-<BR> <esri32302> : WGS 72 / UTM zone 2S
-<BR> <esri32303> : WGS 72 / UTM zone 3S
-<BR> <esri32304> : WGS 72 / UTM zone 4S
-<BR> <esri32305> : WGS 72 / UTM zone 5S
-<BR> <esri32306> : WGS 72 / UTM zone 6S
-<BR> <esri32307> : WGS 72 / UTM zone 7S
-<BR> <esri32308> : WGS 72 / UTM zone 8S
-<BR> <esri32309> : WGS 72 / UTM zone 9S
-<BR> <esri32310> : WGS 72 / UTM zone 10S
-<BR> <esri32311> : WGS 72 / UTM zone 11S
-<BR> <esri32312> : WGS 72 / UTM zone 12S
-<BR> <esri32313> : WGS 72 / UTM zone 13S
-<BR> <esri32314> : WGS 72 / UTM zone 14S
-<BR> <esri32315> : WGS 72 / UTM zone 15S
-<BR> <esri32316> : WGS 72 / UTM zone 16S
-<BR> <esri32317> : WGS 72 / UTM zone 17S
-<BR> <esri32318> : WGS 72 / UTM zone 18S
-<BR> <esri32319> : WGS 72 / UTM zone 19S
-<BR> <esri32320> : WGS 72 / UTM zone 20S
-<BR> <esri32321> : WGS 72 / UTM zone 21S
-<BR> <esri32322> : WGS 72 / UTM zone 22S
-<BR> <esri32323> : WGS 72 / UTM zone 23S
-<BR> <esri32324> : WGS 72 / UTM zone 24S
-<BR> <esri32325> : WGS 72 / UTM zone 25S
-<BR> <esri32326> : WGS 72 / UTM zone 26S
-<BR> <esri32327> : WGS 72 / UTM zone 27S
-<BR> <esri32328> : WGS 72 / UTM zone 28S
-<BR> <esri32329> : WGS 72 / UTM zone 29S
-<BR> <esri32330> : WGS 72 / UTM zone 30S
-<BR> <esri32331> : WGS 72 / UTM zone 31S
-<BR> <esri32332> : WGS 72 / UTM zone 32S
-<BR> <esri32333> : WGS 72 / UTM zone 33S
-<BR> <esri32334> : WGS 72 / UTM zone 34S
-<BR> <esri32335> : WGS 72 / UTM zone 35S
-<BR> <esri32336> : WGS 72 / UTM zone 36S
-<BR> <esri32337> : WGS 72 / UTM zone 37S
-<BR> <esri32338> : WGS 72 / UTM zone 38S
-<BR> <esri32339> : WGS 72 / UTM zone 39S
-<BR> <esri32340> : WGS 72 / UTM zone 40S
-<BR> <esri32341> : WGS 72 / UTM zone 41S
-<BR> <esri32342> : WGS 72 / UTM zone 42S
-<BR> <esri32343> : WGS 72 / UTM zone 43S
-<BR> <esri32344> : WGS 72 / UTM zone 44S
-<BR> <esri32345> : WGS 72 / UTM zone 45S
-<BR> <esri32346> : WGS 72 / UTM zone 46S
-<BR> <esri32347> : WGS 72 / UTM zone 47S
-<BR> <esri32348> : WGS 72 / UTM zone 48S
-<BR> <esri32349> : WGS 72 / UTM zone 49S
-<BR> <esri32350> : WGS 72 / UTM zone 50S
-<BR> <esri32351> : WGS 72 / UTM zone 51S
-<BR> <esri32352> : WGS 72 / UTM zone 52S
-<BR> <esri32353> : WGS 72 / UTM zone 53S
-<BR> <esri32354> : WGS 72 / UTM zone 54S
-<BR> <esri32355> : WGS 72 / UTM zone 55S
-<BR> <esri32356> : WGS 72 / UTM zone 56S
-<BR> <esri32357> : WGS 72 / UTM zone 57S
-<BR> <esri32358> : WGS 72 / UTM zone 58S
-<BR> <esri32359> : WGS 72 / UTM zone 59S
-<BR> <esri32360> : WGS 72 / UTM zone 60S
-<BR> <esri32401> : WGS 72BE / UTM zone 1N
-<BR> <esri32402> : WGS 72BE / UTM zone 2N
-<BR> <esri32403> : WGS 72BE / UTM zone 3N
-<BR> <esri32404> : WGS 72BE / UTM zone 4N
-<BR> <esri32405> : WGS 72BE / UTM zone 5N
-<BR> <esri32406> : WGS 72BE / UTM zone 6N
-<BR> <esri32407> : WGS 72BE / UTM zone 7N
-<BR> <esri32408> : WGS 72BE / UTM zone 8N
-<BR> <esri32409> : WGS 72BE / UTM zone 9N
-<BR> <esri32410> : WGS 72BE / UTM zone 10N
-<BR> <esri32411> : WGS 72BE / UTM zone 11N
-<BR> <esri32412> : WGS 72BE / UTM zone 12N
-<BR> <esri32413> : WGS 72BE / UTM zone 13N
-<BR> <esri32414> : WGS 72BE / UTM zone 14N
-<BR> <esri32415> : WGS 72BE / UTM zone 15N
-<BR> <esri32416> : WGS 72BE / UTM zone 16N
-<BR> <esri32417> : WGS 72BE / UTM zone 17N
-<BR> <esri32418> : WGS 72BE / UTM zone 18N
-<BR> <esri32419> : WGS 72BE / UTM zone 19N
-<BR> <esri32420> : WGS 72BE / UTM zone 20N
-<BR> <esri32421> : WGS 72BE / UTM zone 21N
-<BR> <esri32422> : WGS 72BE / UTM zone 22N
-<BR> <esri32423> : WGS 72BE / UTM zone 23N
-<BR> <esri32424> : WGS 72BE / UTM zone 24N
-<BR> <esri32425> : WGS 72BE / UTM zone 25N
-<BR> <esri32426> : WGS 72BE / UTM zone 26N
-<BR> <esri32427> : WGS 72BE / UTM zone 27N
-<BR> <esri32428> : WGS 72BE / UTM zone 28N
-<BR> <esri32429> : WGS 72BE / UTM zone 29N
-<BR> <esri32430> : WGS 72BE / UTM zone 30N
-<BR> <esri32431> : WGS 72BE / UTM zone 31N
-<BR> <esri32432> : WGS 72BE / UTM zone 32N
-<BR> <esri32433> : WGS 72BE / UTM zone 33N
-<BR> <esri32434> : WGS 72BE / UTM zone 34N
-<BR> <esri32435> : WGS 72BE / UTM zone 35N
-<BR> <esri32436> : WGS 72BE / UTM zone 36N
-<BR> <esri32437> : WGS 72BE / UTM zone 37N
-<BR> <esri32438> : WGS 72BE / UTM zone 38N
-<BR> <esri32439> : WGS 72BE / UTM zone 39N
-<BR> <esri32440> : WGS 72BE / UTM zone 40N
-<BR> <esri32441> : WGS 72BE / UTM zone 41N
-<BR> <esri32442> : WGS 72BE / UTM zone 42N
-<BR> <esri32443> : WGS 72BE / UTM zone 43N
-<BR> <esri32444> : WGS 72BE / UTM zone 44N
-<BR> <esri32445> : WGS 72BE / UTM zone 45N
-<BR> <esri32446> : WGS 72BE / UTM zone 46N
-<BR> <esri32447> : WGS 72BE / UTM zone 47N
-<BR> <esri32448> : WGS 72BE / UTM zone 48N
-<BR> <esri32449> : WGS 72BE / UTM zone 49N
-<BR> <esri32450> : WGS 72BE / UTM zone 50N
-<BR> <esri32451> : WGS 72BE / UTM zone 51N
-<BR> <esri32452> : WGS 72BE / UTM zone 52N
-<BR> <esri32453> : WGS 72BE / UTM zone 53N
-<BR> <esri32454> : WGS 72BE / UTM zone 54N
-<BR> <esri32455> : WGS 72BE / UTM zone 55N
-<BR> <esri32456> : WGS 72BE / UTM zone 56N
-<BR> <esri32457> : WGS 72BE / UTM zone 57N
-<BR> <esri32458> : WGS 72BE / UTM zone 58N
-<BR> <esri32459> : WGS 72BE / UTM zone 59N
-<BR> <esri32460> : WGS 72BE / UTM zone 60N
-<BR> <esri32501> : WGS 72BE / UTM zone 1S
-<BR> <esri32502> : WGS 72BE / UTM zone 2S
-<BR> <esri32503> : WGS 72BE / UTM zone 3S
-<BR> <esri32504> : WGS 72BE / UTM zone 4S
-<BR> <esri32505> : WGS 72BE / UTM zone 5S
-<BR> <esri32506> : WGS 72BE / UTM zone 6S
-<BR> <esri32507> : WGS 72BE / UTM zone 7S
-<BR> <esri32508> : WGS 72BE / UTM zone 8S
-<BR> <esri32509> : WGS 72BE / UTM zone 9S
-<BR> <esri32510> : WGS 72BE / UTM zone 10S
-<BR> <esri32511> : WGS 72BE / UTM zone 11S
-<BR> <esri32512> : WGS 72BE / UTM zone 12S
-<BR> <esri32513> : WGS 72BE / UTM zone 13S
-<BR> <esri32514> : WGS 72BE / UTM zone 14S
-<BR> <esri32515> : WGS 72BE / UTM zone 15S
-<BR> <esri32516> : WGS 72BE / UTM zone 16S
-<BR> <esri32517> : WGS 72BE / UTM zone 17S
-<BR> <esri32518> : WGS 72BE / UTM zone 18S
-<BR> <esri32519> : WGS 72BE / UTM zone 19S
-<BR> <esri32520> : WGS 72BE / UTM zone 20S
-<BR> <esri32521> : WGS 72BE / UTM zone 21S
-<BR> <esri32522> : WGS 72BE / UTM zone 22S
-<BR> <esri32523> : WGS 72BE / UTM zone 23S
-<BR> <esri32524> : WGS 72BE / UTM zone 24S
-<BR> <esri32525> : WGS 72BE / UTM zone 25S
-<BR> <esri32526> : WGS 72BE / UTM zone 26S
-<BR> <esri32527> : WGS 72BE / UTM zone 27S
-<BR> <esri32528> : WGS 72BE / UTM zone 28S
-<BR> <esri32529> : WGS 72BE / UTM zone 29S
-<BR> <esri32530> : WGS 72BE / UTM zone 30S
-<BR> <esri32531> : WGS 72BE / UTM zone 31S
-<BR> <esri32532> : WGS 72BE / UTM zone 32S
-<BR> <esri32533> : WGS 72BE / UTM zone 33S
-<BR> <esri32534> : WGS 72BE / UTM zone 34S
-<BR> <esri32535> : WGS 72BE / UTM zone 35S
-<BR> <esri32536> : WGS 72BE / UTM zone 36S
-<BR> <esri32537> : WGS 72BE / UTM zone 37S
-<BR> <esri32538> : WGS 72BE / UTM zone 38S
-<BR> <esri32539> : WGS 72BE / UTM zone 39S
-<BR> <esri32540> : WGS 72BE / UTM zone 40S
-<BR> <esri32541> : WGS 72BE / UTM zone 41S
-<BR> <esri32542> : WGS 72BE / UTM zone 42S
-<BR> <esri32543> : WGS 72BE / UTM zone 43S
-<BR> <esri32544> : WGS 72BE / UTM zone 44S
-<BR> <esri32545> : WGS 72BE / UTM zone 45S
-<BR> <esri32546> : WGS 72BE / UTM zone 46S
-<BR> <esri32547> : WGS 72BE / UTM zone 47S
-<BR> <esri32548> : WGS 72BE / UTM zone 48S
-<BR> <esri32549> : WGS 72BE / UTM zone 49S
-<BR> <esri32550> : WGS 72BE / UTM zone 50S
-<BR> <esri32551> : WGS 72BE / UTM zone 51S
-<BR> <esri32552> : WGS 72BE / UTM zone 52S
-<BR> <esri32553> : WGS 72BE / UTM zone 53S
-<BR> <esri32554> : WGS 72BE / UTM zone 54S
-<BR> <esri32555> : WGS 72BE / UTM zone 55S
-<BR> <esri32556> : WGS 72BE / UTM zone 56S
-<BR> <esri32557> : WGS 72BE / UTM zone 57S
-<BR> <esri32558> : WGS 72BE / UTM zone 58S
-<BR> <esri32559> : WGS 72BE / UTM zone 59S
-<BR> <esri32560> : WGS 72BE / UTM zone 60S
-<BR> <esri32601> : WGS 84 / UTM zone 1N
-<BR> <esri32602> : WGS 84 / UTM zone 2N
-<BR> <esri32603> : WGS 84 / UTM zone 3N
-<BR> <esri32604> : WGS 84 / UTM zone 4N
-<BR> <esri32605> : WGS 84 / UTM zone 5N
-<BR> <esri32606> : WGS 84 / UTM zone 6N
-<BR> <esri32607> : WGS 84 / UTM zone 7N
-<BR> <esri32608> : WGS 84 / UTM zone 8N
-<BR> <esri32609> : WGS 84 / UTM zone 9N
-<BR> <esri32610> : WGS 84 / UTM zone 10N
-<BR> <esri32611> : WGS 84 / UTM zone 11N
-<BR> <esri32612> : WGS 84 / UTM zone 12N
-<BR> <esri32613> : WGS 84 / UTM zone 13N
-<BR> <esri32614> : WGS 84 / UTM zone 14N
-<BR> <esri32615> : WGS 84 / UTM zone 15N
-<BR> <esri32616> : WGS 84 / UTM zone 16N
-<BR> <esri32617> : WGS 84 / UTM zone 17N
-<BR> <esri32618> : WGS 84 / UTM zone 18N
-<BR> <esri32619> : WGS 84 / UTM zone 19N
-<BR> <esri32620> : WGS 84 / UTM zone 20N
-<BR> <esri32621> : WGS 84 / UTM zone 21N
-<BR> <esri32622> : WGS 84 / UTM zone 22N
-<BR> <esri32623> : WGS 84 / UTM zone 23N
-<BR> <esri32624> : WGS 84 / UTM zone 24N
-<BR> <esri32625> : WGS 84 / UTM zone 25N
-<BR> <esri32626> : WGS 84 / UTM zone 26N
-<BR> <esri32627> : WGS 84 / UTM zone 27N
-<BR> <esri32628> : WGS 84 / UTM zone 28N
-<BR> <esri32629> : WGS 84 / UTM zone 29N
-<BR> <esri32630> : WGS 84 / UTM zone 30N
-<BR> <esri32631> : WGS 84 / UTM zone 31N
-<BR> <esri32632> : WGS 84 / UTM zone 32N
-<BR> <esri32633> : WGS 84 / UTM zone 33N
-<BR> <esri32634> : WGS 84 / UTM zone 34N
-<BR> <esri32635> : WGS 84 / UTM zone 35N
-<BR> <esri32636> : WGS 84 / UTM zone 36N
-<BR> <esri32637> : WGS 84 / UTM zone 37N
-<BR> <esri32638> : WGS 84 / UTM zone 38N
-<BR> <esri32639> : WGS 84 / UTM zone 39N
-<BR> <esri32640> : WGS 84 / UTM zone 40N
-<BR> <esri32641> : WGS 84 / UTM zone 41N
-<BR> <esri32642> : WGS 84 / UTM zone 42N
-<BR> <esri32643> : WGS 84 / UTM zone 43N
-<BR> <esri32644> : WGS 84 / UTM zone 44N
-<BR> <esri32645> : WGS 84 / UTM zone 45N
-<BR> <esri32646> : WGS 84 / UTM zone 46N
-<BR> <esri32647> : WGS 84 / UTM zone 47N
-<BR> <esri32648> : WGS 84 / UTM zone 48N
-<BR> <esri32649> : WGS 84 / UTM zone 49N
-<BR> <esri32650> : WGS 84 / UTM zone 50N
-<BR> <esri32651> : WGS 84 / UTM zone 51N
-<BR> <esri32652> : WGS 84 / UTM zone 52N
-<BR> <esri32653> : WGS 84 / UTM zone 53N
-<BR> <esri32654> : WGS 84 / UTM zone 54N
-<BR> <esri32655> : WGS 84 / UTM zone 55N
-<BR> <esri32656> : WGS 84 / UTM zone 56N
-<BR> <esri32657> : WGS 84 / UTM zone 57N
-<BR> <esri32658> : WGS 84 / UTM zone 58N
-<BR> <esri32659> : WGS 84 / UTM zone 59N
-<BR> <esri32660> : WGS 84 / UTM zone 60N
-<BR> <esri32661> : WGS 84 / UPS North
-<BR> <esri32701> : WGS 84 / UTM zone 1S
-<BR> <esri32702> : WGS 84 / UTM zone 2S
-<BR> <esri32703> : WGS 84 / UTM zone 3S
-<BR> <esri32704> : WGS 84 / UTM zone 4S
-<BR> <esri32705> : WGS 84 / UTM zone 5S
-<BR> <esri32706> : WGS 84 / UTM zone 6S
-<BR> <esri32707> : WGS 84 / UTM zone 7S
-<BR> <esri32708> : WGS 84 / UTM zone 8S
-<BR> <esri32709> : WGS 84 / UTM zone 9S
-<BR> <esri32710> : WGS 84 / UTM zone 10S
-<BR> <esri32711> : WGS 84 / UTM zone 11S
-<BR> <esri32712> : WGS 84 / UTM zone 12S
-<BR> <esri32713> : WGS 84 / UTM zone 13S
-<BR> <esri32714> : WGS 84 / UTM zone 14S
-<BR> <esri32715> : WGS 84 / UTM zone 15S
-<BR> <esri32716> : WGS 84 / UTM zone 16S
-<BR> <esri32717> : WGS 84 / UTM zone 17S
-<BR> <esri32718> : WGS 84 / UTM zone 18S
-<BR> <esri32719> : WGS 84 / UTM zone 19S
-<BR> <esri32720> : WGS 84 / UTM zone 20S
-<BR> <esri32721> : WGS 84 / UTM zone 21S
-<BR> <esri32722> : WGS 84 / UTM zone 22S
-<BR> <esri32723> : WGS 84 / UTM zone 23S
-<BR> <esri32724> : WGS 84 / UTM zone 24S
-<BR> <esri32725> : WGS 84 / UTM zone 25S
-<BR> <esri32726> : WGS 84 / UTM zone 26S
-<BR> <esri32727> : WGS 84 / UTM zone 27S
-<BR> <esri32728> : WGS 84 / UTM zone 28S
-<BR> <esri32729> : WGS 84 / UTM zone 29S
-<BR> <esri32730> : WGS 84 / UTM zone 30S
-<BR> <esri32731> : WGS 84 / UTM zone 31S
-<BR> <esri32732> : WGS 84 / UTM zone 32S
-<BR> <esri32733> : WGS 84 / UTM zone 33S
-<BR> <esri32734> : WGS 84 / UTM zone 34S
-<BR> <esri32735> : WGS 84 / UTM zone 35S
-<BR> <esri32736> : WGS 84 / UTM zone 36S
-<BR> <esri32737> : WGS 84 / UTM zone 37S
-<BR> <esri32738> : WGS 84 / UTM zone 38S
-<BR> <esri32739> : WGS 84 / UTM zone 39S
-<BR> <esri32740> : WGS 84 / UTM zone 40S
-<BR> <esri32741> : WGS 84 / UTM zone 41S
-<BR> <esri32742> : WGS 84 / UTM zone 42S
-<BR> <esri32743> : WGS 84 / UTM zone 43S
-<BR> <esri32744> : WGS 84 / UTM zone 44S
-<BR> <esri32745> : WGS 84 / UTM zone 45S
-<BR> <esri32746> : WGS 84 / UTM zone 46S
-<BR> <esri32747> : WGS 84 / UTM zone 47S
-<BR> <esri32748> : WGS 84 / UTM zone 48S
-<BR> <esri32749> : WGS 84 / UTM zone 49S
-<BR> <esri32750> : WGS 84 / UTM zone 50S
-<BR> <esri32751> : WGS 84 / UTM zone 51S
-<BR> <esri32752> : WGS 84 / UTM zone 52S
-<BR> <esri32753> : WGS 84 / UTM zone 53S
-<BR> <esri32754> : WGS 84 / UTM zone 54S
-<BR> <esri32755> : WGS 84 / UTM zone 55S
-<BR> <esri32756> : WGS 84 / UTM zone 56S
-<BR> <esri32757> : WGS 84 / UTM zone 57S
-<BR> <esri32758> : WGS 84 / UTM zone 58S
-<BR> <esri32759> : WGS 84 / UTM zone 59S
-<BR> <esri32760> : WGS 84 / UTM zone 60S
-<BR> <esri32761> : WGS 84 / UPS South
-<BR> <esri32766> : WGS 84 / TM 36 SE
-<BR> <esri20002> : Pulkovo 1995 GK Zone 2
-<BR> <esri20003> : Pulkovo 1995 GK Zone 3
-<BR> <esri20062> : Pulkovo 1995 GK Zone 2N
-<BR> <esri20063> : Pulkovo 1995 GK Zone 3N
-<BR> <esri24721> : La Canoa UTM Zone 21N
-<BR> <esri26761> : NAD 1927 StatePlane Hawaii 1 FIPS 5101
-<BR> <esri26762> : NAD 1927 StatePlane Hawaii 2 FIPS 5102
-<BR> <esri26763> : NAD 1927 StatePlane Hawaii 3 FIPS 5103
-<BR> <esri26764> : NAD 1927 StatePlane Hawaii 4 FIPS 5104
-<BR> <esri26765> : NAD 1927 StatePlane Hawaii 5 FIPS 5105
-<BR> <esri26788> : NAD 1927 StatePlane Michigan North FIPS 2111
-<BR> <esri26789> : NAD 1927 StatePlane Michigan Central FIPS 2112
-<BR> <esri26790> : NAD 1927 StatePlane Michigan South FIPS 2113
-<BR> <esri30591> : Nord Algerie
-<BR> <esri30592> : Sud Algerie
-<BR> <esri31491> : Germany Zone 1
-<BR> <esri31492> : Germany Zone 2
-<BR> <esri31493> : Germany Zone 3
-<BR> <esri31494> : Germany Zone 4
-<BR> <esri31495> : Germany Zone 5
-<BR> <esri32059> : NAD 1927 StatePlane Puerto Rico FIPS 5201
-<BR> <esri32060> : NAD 1927 StatePlane Virgin Islands St Croix FIPS 5202
-<BR> <esri53001> : Sphere Plate Carree
-<BR> <esri53002> : Sphere Equidistant Cylindrical
-<BR> <esri53003> : Sphere Miller Cylindrical
-<BR> <esri53004> : Sphere Mercator
-<BR> <esri53008> : Sphere Sinusoidal
-<BR> <esri53009> : Sphere Mollweide
-<BR> <esri53010> : Sphere Eckert VI
-<BR> <esri53011> : Sphere Eckert V
-<BR> <esri53012> : Sphere Eckert IV
-<BR> <esri53013> : Sphere Eckert III
-<BR> <esri53014> : Sphere Eckert II
-<BR> <esri53015> : Sphere Eckert I
-<BR> <esri53016> : Sphere Gall Stereographic
-<BR> <esri53017> : Sphere Behrmann
-<BR> <esri53018> : Sphere Winkel I
-<BR> <esri53019> : Sphere Winkel II
-<BR> <esri53021> : Sphere Polyconic
-<BR> <esri53022> : Sphere Quartic Authalic
-<BR> <esri53023> : Sphere Loximuthal
-<BR> <esri53024> : Sphere Bonne
-<BR> <esri53025> : Sphere Hotine
-<BR> <esri53026> : Sphere Stereographic
-<BR> <esri53027> : Sphere Equidistant Conic
-<BR> <esri53028> : Sphere Cassini
-<BR> <esri53029> : Sphere Van der Grinten I
-<BR> <esri53030> : Sphere Robinson
-<BR> <esri53031> : Sphere Two Point Equidistant
-<BR> <esri53032> : Sphere Azimuthal Equidistant
-<BR> <esri54001> : World Plate Carree
-<BR> <esri54002> : World Equidistant Cylindrical
-<BR> <esri54003> : World Miller Cylindrical
-<BR> <esri54004> : World Mercator
-<BR> <esri54008> : World Sinusoidal
-<BR> <esri54009> : World Mollweide
-<BR> <esri54010> : World Eckert VI
-<BR> <esri54011> : World Eckert V
-<BR> <esri54012> : World Eckert IV
-<BR> <esri54013> : World Eckert III
-<BR> <esri54014> : World Eckert II
-<BR> <esri54015> : World Eckert I
-<BR> <esri54016> : World Gall Stereographic
-<BR> <esri54017> : World Behrmann
-<BR> <esri54018> : World Winkel I
-<BR> <esri54019> : World Winkel II
-<BR> <esri54021> : World Polyconic
-<BR> <esri54022> : World Quartic Authalic
-<BR> <esri54023> : World Loximuthal
-<BR> <esri54024> : World Bonne
-<BR> <esri54025> : World Hotine
-<BR> <esri54026> : World Stereographic
-<BR> <esri54027> : World Equidistant Conic
-<BR> <esri54028> : World Cassini
-<BR> <esri54029> : World Van der Grinten I
-<BR> <esri54030> : World Robinson
-<BR> <esri54031> : World Two Point Equidistant
-<BR> <esri54032> : World Azimuthal Equidistant
-<BR> <esri65061> : NAD 1927 StatePlane Guam FIPS 5400
-<BR> <esri65161> : NAD 1983 StatePlane Guam FIPS 5400
-<BR> <esri102001> : Canada Albers Equal Area Conic
-<BR> <esri102002> : Canada Lambert Conformal Conic
-<BR> <esri102003> : USA Contiguous Albers Equal Area Conic
-<BR> <esri102004> : USA Contiguous Lambert Conformal Conic
-<BR> <esri102005> : USA Contiguous Equidistant Conic
-<BR> <esri102006> : Alaska Albers Equal Area Conic
-<BR> <esri102007> : Hawaii Albers Equal Area Conic
-<BR> <esri102008> : North America Albers Equal Area Conic
-<BR> <esri102009> : North America Lambert Conformal Conic
-<BR> <esri102010> : North America Equidistant Conic
-<BR> <esri102011> : Africa Sinusoidal
-<BR> <esri102012> : Asia Lambert Conformal Conic
-<BR> <esri102013> : Europe Albers Equal Area Conic
-<BR> <esri102014> : Europe Lambert Conformal Conic
-<BR> <esri102015> : South America Lambert Conformal Conic
-<BR> <esri102016> : North Pole Azimuthal Equidistant
-<BR> <esri102017> : North Pole Lambert Azimuthal Equal Area
-<BR> <esri102018> : North Pole Stereographic
-<BR> <esri102019> : South Pole Azimuthal Equidistant
-<BR> <esri102020> : South Pole Lambert Azimuthal Equal Area
-<BR> <esri102021> : South Pole Stereographic
-<BR> <esri102022> : Africa Albers Equal Area Conic
-<BR> <esri102023> : Africa Equidistant Conic
-<BR> <esri102024> : Africa Lambert Conformal Conic
-<BR> <esri102025> : Asia North Albers Equal Area Conic
-<BR> <esri102026> : Asia North Equidistant Conic
-<BR> <esri102027> : Asia North Lambert Conformal Conic
-<BR> <esri102028> : Asia South Albers Equal Area Conic
-<BR> <esri102029> : Asia South Equidistant Conic
-<BR> <esri102030> : Asia South Lambert Conformal Conic
-<BR> <esri102031> : Europe Equidistant Conic
-<BR> <esri102032> : South America Equidistant Conic
-<BR> <esri102033> : South America Albers Equal Area Conic
-<BR> <esri102065> : S-JTSK Krovak
-<BR> <esri102066> : S-JTSK Ferro Krovak East North
-<BR> <esri102067> : S-JTSK Krovak East North
-<BR> <esri102091> : Monte Mario Italy 1
-<BR> <esri102092> : Monte Mario Italy 2
-<BR> <esri102101> : NGO 1948 Norway Zone 1
-<BR> <esri102102> : NGO 1948 Norway Zone 2
-<BR> <esri102103> : NGO 1948 Norway Zone 3
-<BR> <esri102104> : NGO 1948 Norway Zone 4
-<BR> <esri102105> : NGO 1948 Norway Zone 5
-<BR> <esri102106> : NGO 1948 Norway Zone 6
-<BR> <esri102107> : NGO 1948 Norway Zone 7
-<BR> <esri102108> : NGO 1948 Norway Zone 8
-<BR> <esri102110> : RGF 1993 Lambert 93
-<BR> <esri102114> : Old Hawaiian UTM Zone 4N
-<BR> <esri102115> : Old Hawaiian UTM Zone 5N
-<BR> <esri102120> : NAD 1927 Michigan GeoRef Feet US
-<BR> <esri102121> : NAD 1983 Michigan GeoRef Feet US
-<BR> <esri102122> : NAD 1927 Michigan GeoRef Meters
-<BR> <esri102123> : NAD 1983 Michigan GeoRef Meters
-<BR> <esri102132> : NGO 1948 UTM Zone 32N
-<BR> <esri102133> : NGO 1948 UTM Zone 33N
-<BR> <esri102134> : NGO 1948 UTM Zone 34N
-<BR> <esri102135> : NGO 1948 UTM Zone 35N
-<BR> <esri102140> : Hong Kong 1980 Grid
-<BR> <esri102141> : Hong Kong 1980 UTM Zone 49N
-<BR> <esri102142> : Hong Kong 1980 UTM Zone 50N
-<BR> <esri102151> : Tokyo UTM Zone 51N
-<BR> <esri102152> : Tokyo UTM Zone 52N
-<BR> <esri102153> : Tokyo UTM Zone 53N
-<BR> <esri102154> : Tokyo UTM Zone 54N
-<BR> <esri102155> : Tokyo UTM Zone 55N
-<BR> <esri102156> : Tokyo UTM Zone 56N
-<BR> <esri102160> : Datum 73 Hayford Gauss IGeoE
-<BR> <esri102161> : Datum 73 Hayford Gauss IPCC
-<BR> <esri102162> : Graciosa Base SW 1948 UTM Zone 26N
-<BR> <esri102163> : Lisboa Bessel Bonne
-<BR> <esri102164> : Lisboa Hayford Gauss IGeoE
-<BR> <esri102165> : Lisboa Hayford Gauss IPCC
-<BR> <esri102166> : Observ Meteorologico 1939 UTM Zone 25N
-<BR> <esri102167> : Porto Santo 1936 UTM Zone 28N
-<BR> <esri102168> : Sao Braz UTM Zone 26N
-<BR> <esri102169> : Selvagem Grande 1938 UTM Zone 28N
-<BR> <esri102191> : Nord Maroc Degree
-<BR> <esri102192> : Sud Maroc Degree
-<BR> <esri102193> : Sahara Degree
-<BR> <esri102229> : NAD 1983 HARN StatePlane Alabama East FIPS 0101
-<BR> <esri102230> : NAD 1983 HARN StatePlane Alabama West FIPS 0102
-<BR> <esri102241> : NAD 1983 HARN StatePlane California I FIPS 0401
-<BR> <esri102242> : NAD 1983 HARN StatePlane California II FIPS 0402
-<BR> <esri102243> : NAD 1983 HARN StatePlane California III FIPS 0403
-<BR> <esri102244> : NAD 1983 HARN StatePlane California IV FIPS 0404
-<BR> <esri102245> : NAD 1983 HARN StatePlane California V FIPS 0405
-<BR> <esri102246> : NAD 1983 HARN StatePlane California VI FIPS 0406
-<BR> <esri102248> : NAD 1983 HARN StatePlane Arizona East FIPS 0201
-<BR> <esri102249> : NAD 1983 HARN StatePlane Arizona Central FIPS 0202
-<BR> <esri102250> : NAD 1983 HARN StatePlane Arizona West FIPS 0203
-<BR> <esri102251> : NAD 1983 HARN StatePlane Arkansas North FIPS 0301
-<BR> <esri102252> : NAD 1983 HARN StatePlane Arkansas South FIPS 0302
-<BR> <esri102253> : NAD 1983 HARN StatePlane Colorado North FIPS 0501
-<BR> <esri102254> : NAD 1983 HARN StatePlane Colorado Central FIPS 0502
-<BR> <esri102255> : NAD 1983 HARN StatePlane Colorado South FIPS 0503
-<BR> <esri102256> : NAD 1983 HARN StatePlane Connecticut FIPS 0600
-<BR> <esri102257> : NAD 1983 HARN StatePlane Delaware FIPS 0700
-<BR> <esri102258> : NAD 1983 HARN StatePlane Florida East FIPS 0901
-<BR> <esri102259> : NAD 1983 HARN StatePlane Florida West FIPS 0902
-<BR> <esri102260> : NAD 1983 HARN StatePlane Florida North FIPS 0903
-<BR> <esri102261> : NAD 1983 HARN StatePlane Hawaii 1 FIPS 5101
-<BR> <esri102262> : NAD 1983 HARN StatePlane Hawaii 2 FIPS 5102
-<BR> <esri102263> : NAD 1983 HARN StatePlane Hawaii 3 FIPS 5103
-<BR> <esri102264> : NAD 1983 HARN StatePlane Hawaii 4 FIPS 5104
-<BR> <esri102265> : NAD 1983 HARN StatePlane Hawaii 5 FIPS 5105
-<BR> <esri102266> : NAD 1983 HARN StatePlane Georgia East FIPS 1001
-<BR> <esri102267> : NAD 1983 HARN StatePlane Georgia West FIPS 1002
-<BR> <esri102268> : NAD 1983 HARN StatePlane Idaho East FIPS 1101
-<BR> <esri102269> : NAD 1983 HARN StatePlane Idaho Central FIPS 1102
-<BR> <esri102270> : NAD 1983 HARN StatePlane Idaho West FIPS 1103
-<BR> <esri102271> : NAD 1983 HARN StatePlane Illinois East FIPS 1201
-<BR> <esri102272> : NAD 1983 HARN StatePlane Illinois West FIPS 1202
-<BR> <esri102273> : NAD 1983 HARN StatePlane Indiana East FIPS 1301
-<BR> <esri102274> : NAD 1983 HARN StatePlane Indiana West FIPS 1302
-<BR> <esri102277> : NAD 1983 HARN StatePlane Kansas North FIPS 1501
-<BR> <esri102278> : NAD 1983 HARN StatePlane Kansas South FIPS 1502
-<BR> <esri102279> : NAD 1983 HARN StatePlane Kentucky North FIPS 1601
-<BR> <esri102280> : NAD 1983 HARN StatePlane Kentucky South FIPS 1602
-<BR> <esri102281> : NAD 1983 HARN StatePlane Louisiana North FIPS 1701
-<BR> <esri102282> : NAD 1983 HARN StatePlane Louisiana South FIPS 1702
-<BR> <esri102283> : NAD 1983 HARN StatePlane Maine East FIPS 1801
-<BR> <esri102284> : NAD 1983 HARN StatePlane Maine West FIPS 1802
-<BR> <esri102285> : NAD 1983 HARN StatePlane Maryland FIPS 1900
-<BR> <esri102286> : NAD 1983 HARN StatePlane Massachusetts Mainland FIPS 2001
-<BR> <esri102287> : NAD 1983 HARN StatePlane Massachusetts Island FIPS 2002
-<BR> <esri102288> : NAD 1983 HARN StatePlane Michigan North FIPS 2111
-<BR> <esri102289> : NAD 1983 HARN StatePlane Michigan Central FIPS 2112
-<BR> <esri102290> : NAD 1983 HARN StatePlane Michigan South FIPS 2113
-<BR> <esri102291> : NAD 1983 HARN StatePlane Minnesota North FIPS 2201
-<BR> <esri102292> : NAD 1983 HARN StatePlane Minnesota Central FIPS 2202
-<BR> <esri102293> : NAD 1983 HARN StatePlane Minnesota South FIPS 2203
-<BR> <esri102294> : NAD 1983 HARN StatePlane Mississippi East FIPS 2301
-<BR> <esri102295> : NAD 1983 HARN StatePlane Mississippi West FIPS 2302
-<BR> <esri102296> : NAD 1983 HARN StatePlane Missouri East FIPS 2401
-<BR> <esri102297> : NAD 1983 HARN StatePlane Missouri Central FIPS 2402
-<BR> <esri102298> : NAD 1983 HARN StatePlane Missouri West FIPS 2403
-<BR> <esri102300> : NAD 1983 HARN StatePlane Montana FIPS 2500
-<BR> <esri102304> : NAD 1983 HARN StatePlane Nebraska FIPS 2600
-<BR> <esri102307> : NAD 1983 HARN StatePlane Nevada East FIPS 2701
-<BR> <esri102308> : NAD 1983 HARN StatePlane Nevada Central FIPS 2702
-<BR> <esri102309> : NAD 1983 HARN StatePlane Nevada West FIPS 2703
-<BR> <esri102310> : NAD 1983 HARN StatePlane New Hampshire FIPS 2800
-<BR> <esri102311> : NAD 1983 HARN StatePlane New Jersey FIPS 2900
-<BR> <esri102312> : NAD 1983 HARN StatePlane New Mexico East FIPS 3001
-<BR> <esri102313> : NAD 1983 HARN StatePlane New Mexico Central FIPS 3002
-<BR> <esri102314> : NAD 1983 HARN StatePlane New Mexico West FIPS 3003
-<BR> <esri102315> : NAD 1983 HARN StatePlane New York East FIPS 3101
-<BR> <esri102316> : NAD 1983 HARN StatePlane New York Central FIPS 3102
-<BR> <esri102317> : NAD 1983 HARN StatePlane New York West FIPS 3103
-<BR> <esri102318> : NAD 1983 HARN StatePlane New York Long Island FIPS 3104
-<BR> <esri102320> : NAD 1983 HARN StatePlane North Dakota North FIPS 3301
-<BR> <esri102321> : NAD 1983 HARN StatePlane North Dakota South FIPS 3302
-<BR> <esri102322> : NAD 1983 HARN StatePlane Ohio North FIPS 3401
-<BR> <esri102323> : NAD 1983 HARN StatePlane Ohio South FIPS 3402
-<BR> <esri102324> : NAD 1983 HARN StatePlane Oklahoma North FIPS 3501
-<BR> <esri102325> : NAD 1983 HARN StatePlane Oklahoma South FIPS 3502
-<BR> <esri102326> : NAD 1983 HARN StatePlane Oregon North FIPS 3601
-<BR> <esri102327> : NAD 1983 HARN StatePlane Oregon South FIPS 3602
-<BR> <esri102330> : NAD 1983 HARN StatePlane Rhode Island FIPS 3800
-<BR> <esri102334> : NAD 1983 HARN StatePlane South Dakota North FIPS 4001
-<BR> <esri102335> : NAD 1983 HARN StatePlane South Dakota South FIPS 4002
-<BR> <esri102336> : NAD 1983 HARN StatePlane Tennessee FIPS 4100
-<BR> <esri102337> : NAD 1983 HARN StatePlane Texas North FIPS 4201
-<BR> <esri102338> : NAD 1983 HARN StatePlane Texas North Central FIPS 4202
-<BR> <esri102339> : NAD 1983 HARN StatePlane Texas Central FIPS 4203
-<BR> <esri102340> : NAD 1983 HARN StatePlane Texas South Central FIPS 4204
-<BR> <esri102341> : NAD 1983 HARN StatePlane Texas South FIPS 4205
-<BR> <esri102342> : NAD 1983 HARN StatePlane Utah North FIPS 4301
-<BR> <esri102343> : NAD 1983 HARN StatePlane Utah Central FIPS 4302
-<BR> <esri102344> : NAD 1983 HARN StatePlane Utah South FIPS 4303
-<BR> <esri102345> : NAD 1983 HARN StatePlane Vermont FIPS 4400
-<BR> <esri102346> : NAD 1983 HARN StatePlane Virginia North FIPS 4501
-<BR> <esri102347> : NAD 1983 HARN StatePlane Virginia South FIPS 4502
-<BR> <esri102348> : NAD 1983 HARN StatePlane Washington North FIPS 4601
-<BR> <esri102349> : NAD 1983 HARN StatePlane Washington South FIPS 4602
-<BR> <esri102350> : NAD 1983 HARN StatePlane West Virginia North FIPS 4701
-<BR> <esri102351> : NAD 1983 HARN StatePlane West Virginia South FIPS 4702
-<BR> <esri102352> : NAD 1983 HARN StatePlane Wisconsin North FIPS 4801
-<BR> <esri102353> : NAD 1983 HARN StatePlane Wisconsin Central FIPS 4802
-<BR> <esri102354> : NAD 1983 HARN StatePlane Wisconsin South FIPS 4803
-<BR> <esri102355> : NAD 1983 HARN StatePlane Wyoming East FIPS 4901
-<BR> <esri102356> : NAD 1983 HARN StatePlane Wyoming East Central FIPS 4902
-<BR> <esri102357> : NAD 1983 HARN StatePlane Wyoming West Central FIPS 4903
-<BR> <esri102358> : NAD 1983 HARN StatePlane Wyoming West FIPS 4904
-<BR> <esri102361> : NAD 1983 HARN StatePlane Puerto Rico Virgin Islands FIPS 5200
-<BR> <esri102491> : Nord Algerie Ancienne Degree
-<BR> <esri102492> : Sud Algerie Ancienne Degree
-<BR> <esri102581> : NTF France I degrees
-<BR> <esri102582> : NTF France II degrees
-<BR> <esri102583> : NTF France III degrees
-<BR> <esri102584> : NTF France IV degrees
-<BR> <esri102591> : Nord Algerie Degree
-<BR> <esri102592> : Sud Algerie Degree
-<BR> <esri102629> : NAD 1983 StatePlane Alabama East FIPS 0101 Feet
-<BR> <esri102630> : NAD 1983 StatePlane Alabama West FIPS 0102 Feet
-<BR> <esri102631> : NAD 1983 StatePlane Alaska 1 FIPS 5001 Feet
-<BR> <esri102632> : NAD 1983 StatePlane Alaska 2 FIPS 5002 Feet
-<BR> <esri102633> : NAD 1983 StatePlane Alaska 3 FIPS 5003 Feet
-<BR> <esri102634> : NAD 1983 StatePlane Alaska 4 FIPS 5004 Feet
-<BR> <esri102635> : NAD 1983 StatePlane Alaska 5 FIPS 5005 Feet
-<BR> <esri102636> : NAD 1983 StatePlane Alaska 6 FIPS 5006 Feet
-<BR> <esri102637> : NAD 1983 StatePlane Alaska 7 FIPS 5007 Feet
-<BR> <esri102638> : NAD 1983 StatePlane Alaska 8 FIPS 5008 Feet
-<BR> <esri102639> : NAD 1983 StatePlane Alaska 9 FIPS 5009 Feet
-<BR> <esri102640> : NAD 1983 StatePlane Alaska 10 FIPS 5010 Feet
-<BR> <esri102641> : NAD 1983 StatePlane California I FIPS 0401 Feet
-<BR> <esri102642> : NAD 1983 StatePlane California II FIPS 0402 Feet
-<BR> <esri102643> : NAD 1983 StatePlane California III FIPS 0403 Feet
-<BR> <esri102644> : NAD 1983 StatePlane California IV FIPS 0404 Feet
-<BR> <esri102645> : NAD 1983 StatePlane California V FIPS 0405 Feet
-<BR> <esri102646> : NAD 1983 StatePlane California VI FIPS 0406 Feet
-<BR> <esri102648> : NAD 1983 StatePlane Arizona East FIPS 0201 Feet
-<BR> <esri102649> : NAD 1983 StatePlane Arizona Central FIPS 0202 Feet
-<BR> <esri102650> : NAD 1983 StatePlane Arizona West FIPS 0203 Feet
-<BR> <esri102651> : NAD 1983 StatePlane Arkansas North FIPS 0301 Feet
-<BR> <esri102652> : NAD 1983 StatePlane Arkansas South FIPS 0302 Feet
-<BR> <esri102653> : NAD 1983 StatePlane Colorado North FIPS 0501 Feet
-<BR> <esri102654> : NAD 1983 StatePlane Colorado Central FIPS 0502 Feet
-<BR> <esri102655> : NAD 1983 StatePlane Colorado South FIPS 0503 Feet
-<BR> <esri102656> : NAD 1983 StatePlane Connecticut FIPS 0600 Feet
-<BR> <esri102657> : NAD 1983 StatePlane Delaware FIPS 0700 Feet
-<BR> <esri102658> : NAD 1983 StatePlane Florida East FIPS 0901 Feet
-<BR> <esri102659> : NAD 1983 StatePlane Florida West FIPS 0902 Feet
-<BR> <esri102660> : NAD 1983 StatePlane Florida North FIPS 0903 Feet
-<BR> <esri102661> : NAD 1983 StatePlane Hawaii 1 FIPS 5101 Feet
-<BR> <esri102662> : NAD 1983 StatePlane Hawaii 2 FIPS 5102 Feet
-<BR> <esri102663> : NAD 1983 StatePlane Hawaii 3 FIPS 5103 Feet
-<BR> <esri102664> : NAD 1983 StatePlane Hawaii 4 FIPS 5104 Feet
-<BR> <esri102665> : NAD 1983 StatePlane Hawaii 5 FIPS 5105 Feet
-<BR> <esri102666> : NAD 1983 StatePlane Georgia East FIPS 1001 Feet
-<BR> <esri102667> : NAD 1983 StatePlane Georgia West FIPS 1002 Feet
-<BR> <esri102668> : NAD 1983 StatePlane Idaho East FIPS 1101 Feet
-<BR> <esri102669> : NAD 1983 StatePlane Idaho Central FIPS 1102 Feet
-<BR> <esri102670> : NAD 1983 StatePlane Idaho West FIPS 1103 Feet
-<BR> <esri102671> : NAD 1983 StatePlane Illinois East FIPS 1201 Feet
-<BR> <esri102672> : NAD 1983 StatePlane Illinois West FIPS 1202 Feet
-<BR> <esri102673> : NAD 1983 StatePlane Indiana East FIPS 1301 Feet
-<BR> <esri102674> : NAD 1983 StatePlane Indiana West FIPS 1302 Feet
-<BR> <esri102675> : NAD 1983 StatePlane Iowa North FIPS 1401 Feet
-<BR> <esri102676> : NAD 1983 StatePlane Iowa South FIPS 1402 Feet
-<BR> <esri102677> : NAD 1983 StatePlane Kansas North FIPS 1501 Feet
-<BR> <esri102678> : NAD 1983 StatePlane Kansas South FIPS 1502 Feet
-<BR> <esri102679> : NAD 1983 StatePlane Kentucky North FIPS 1601 Feet
-<BR> <esri102680> : NAD 1983 StatePlane Kentucky South FIPS 1602 Feet
-<BR> <esri102681> : NAD 1983 StatePlane Louisiana North FIPS 1701 Feet
-<BR> <esri102682> : NAD 1983 StatePlane Louisiana South FIPS 1702 Feet
-<BR> <esri102683> : NAD 1983 StatePlane Maine East FIPS 1801 Feet
-<BR> <esri102684> : NAD 1983 StatePlane Maine West FIPS 1802 Feet
-<BR> <esri102685> : NAD 1983 StatePlane Maryland FIPS 1900 Feet
-<BR> <esri102686> : NAD 1983 StatePlane Massachusetts Mainland FIPS 2001 Feet
-<BR> <esri102687> : NAD 1983 StatePlane Massachusetts Island FIPS 2002 Feet
-<BR> <esri102688> : NAD 1983 StatePlane Michigan North FIPS 2111 Feet
-<BR> <esri102689> : NAD 1983 StatePlane Michigan Central FIPS 2112 Feet
-<BR> <esri102690> : NAD 1983 StatePlane Michigan South FIPS 2113 Feet
-<BR> <esri102691> : NAD 1983 StatePlane Minnesota North FIPS 2201 Feet
-<BR> <esri102692> : NAD 1983 StatePlane Minnesota Central FIPS 2202 Feet
-<BR> <esri102693> : NAD 1983 StatePlane Minnesota South FIPS 2203 Feet
-<BR> <esri102694> : NAD 1983 StatePlane Mississippi East FIPS 2301 Feet
-<BR> <esri102695> : NAD 1983 StatePlane Mississippi West FIPS 2302 Feet
-<BR> <esri102696> : NAD 1983 StatePlane Missouri East FIPS 2401 Feet
-<BR> <esri102697> : NAD 1983 StatePlane Missouri Central FIPS 2402 Feet
-<BR> <esri102698> : NAD 1983 StatePlane Missouri West FIPS 2403 Feet
-<BR> <esri102700> : NAD 1983 StatePlane Montana FIPS 2500 Feet
-<BR> <esri102704> : NAD 1983 StatePlane Nebraska FIPS 2600 Feet
-<BR> <esri102707> : NAD 1983 StatePlane Nevada East FIPS 2701 Feet
-<BR> <esri102708> : NAD 1983 StatePlane Nevada Central FIPS 2702 Feet
-<BR> <esri102709> : NAD 1983 StatePlane Nevada West FIPS 2703 Feet
-<BR> <esri102710> : NAD 1983 StatePlane New Hampshire FIPS 2800 Feet
-<BR> <esri102711> : NAD 1983 StatePlane New Jersey FIPS 2900 Feet
-<BR> <esri102712> : NAD 1983 StatePlane New Mexico East FIPS 3001 Feet
-<BR> <esri102713> : NAD 1983 StatePlane New Mexico Central FIPS 3002 Feet
-<BR> <esri102714> : NAD 1983 StatePlane New Mexico West FIPS 3003 Feet
-<BR> <esri102715> : NAD 1983 StatePlane New York East FIPS 3101 Feet
-<BR> <esri102716> : NAD 1983 StatePlane New York Central FIPS 3102 Feet
-<BR> <esri102717> : NAD 1983 StatePlane New York West FIPS 3103 Feet
-<BR> <esri102718> : NAD 1983 StatePlane New York Long Island FIPS 3104 Feet
-<BR> <esri102719> : NAD 1983 StatePlane North Carolina FIPS 3200 Feet
-<BR> <esri102720> : NAD 1983 StatePlane North Dakota North FIPS 3301 Feet
-<BR> <esri102721> : NAD 1983 StatePlane North Dakota South FIPS 3302 Feet
-<BR> <esri102722> : NAD 1983 StatePlane Ohio North FIPS 3401 Feet
-<BR> <esri102723> : NAD 1983 StatePlane Ohio South FIPS 3402 Feet
-<BR> <esri102724> : NAD 1983 StatePlane Oklahoma North FIPS 3501 Feet
-<BR> <esri102725> : NAD 1983 StatePlane Oklahoma South FIPS 3502 Feet
-<BR> <esri102726> : NAD 1983 StatePlane Oregon North FIPS 3601 Feet
-<BR> <esri102727> : NAD 1983 StatePlane Oregon South FIPS 3602 Feet
-<BR> <esri102728> : NAD 1983 StatePlane Pennsylvania North FIPS 3701 Feet
-<BR> <esri102729> : NAD 1983 StatePlane Pennsylvania South FIPS 3702 Feet
-<BR> <esri102730> : NAD 1983 StatePlane Rhode Island FIPS 3800 Feet
-<BR> <esri102733> : NAD 1983 StatePlane South Carolina FIPS 3900 Feet
-<BR> <esri102734> : NAD 1983 StatePlane South Dakota North FIPS 4001 Feet
-<BR> <esri102735> : NAD 1983 StatePlane South Dakota South FIPS 4002 Feet
-<BR> <esri102736> : NAD 1983 StatePlane Tennessee FIPS 4100 Feet
-<BR> <esri102737> : NAD 1983 StatePlane Texas North FIPS 4201 Feet
-<BR> <esri102738> : NAD 1983 StatePlane Texas North Central FIPS 4202 Feet
-<BR> <esri102739> : NAD 1983 StatePlane Texas Central FIPS 4203 Feet
-<BR> <esri102740> : NAD 1983 StatePlane Texas South Central FIPS 4204 Feet
-<BR> <esri102741> : NAD 1983 StatePlane Texas South FIPS 4205 Feet
-<BR> <esri102742> : NAD 1983 StatePlane Utah North FIPS 4301 Feet
-<BR> <esri102743> : NAD 1983 StatePlane Utah Central FIPS 4302 Feet
-<BR> <esri102744> : NAD 1983 StatePlane Utah South FIPS 4303 Feet
-<BR> <esri102745> : NAD 1983 StatePlane Vermont FIPS 4400 Feet
-<BR> <esri102746> : NAD 1983 StatePlane Virginia North FIPS 4501 Feet
-<BR> <esri102747> : NAD 1983 StatePlane Virginia South FIPS 4502 Feet
-<BR> <esri102748> : NAD 1983 StatePlane Washington North FIPS 4601 Feet
-<BR> <esri102749> : NAD 1983 StatePlane Washington South FIPS 4602 Feet
-<BR> <esri102750> : NAD 1983 StatePlane West Virginia North FIPS 4701 Feet
-<BR> <esri102751> : NAD 1983 StatePlane West Virginia South FIPS 4702 Feet
-<BR> <esri102752> : NAD 1983 StatePlane Wisconsin North FIPS 4801 Feet
-<BR> <esri102753> : NAD 1983 StatePlane Wisconsin Central FIPS 4802 Feet
-<BR> <esri102754> : NAD 1983 StatePlane Wisconsin South FIPS 4803 Feet
-<BR> <esri102755> : NAD 1983 StatePlane Wyoming East FIPS 4901 Feet
-<BR> <esri102756> : NAD 1983 StatePlane Wyoming East Central FIPS 4902 Feet
-<BR> <esri102757> : NAD 1983 StatePlane Wyoming West Central FIPS 4903 Feet
-<BR> <esri102758> : NAD 1983 StatePlane Wyoming West FIPS 4904 Feet
-<BR> <esri102761> : NAD 1983 StatePlane Puerto Rico Virgin Islands FIPS 5200 Feet
-<BR> <esri102766> : NAD 1983 StatePlane Guam FIPS 5400 Feet
-<BR> <esri103300> : Belge Lambert 1972
-<BR> <esri4023> : GCS International 1967
-<BR> <esri4217> : GCS Bern 1898
-<BR> <esri4305> : GCS Voirol Unifie 1960
-<BR> <esri4404> : GCS Montserrat 1958
-<BR> <esri4812> : GCS Voirol Unifie 1960 Paris
-<BR> <esri37001> : GCS WGS 1966
-<BR> <esri37002> : GCS Fischer 1960
-<BR> <esri37003> : GCS Fischer 1968
-<BR> <esri37004> : GCS Fischer Modified
-<BR> <esri37005> : GCS Hough 1960
-<BR> <esri37006> : GCS Everest Modified 1969
-<BR> <esri37007> : GCS Walbeck
-<BR> <esri37008> : GCS Sphere ARC INFO
-<BR> <esri37201> : GCS European 1979
-<BR> <esri37202> : GCS Everest Bangladesh
-<BR> <esri37203> : GCS Everest India Nepal
-<BR> <esri37204> : GCS Hjorsey 1955
-<BR> <esri37205> : GCS Hong Kong 1963
-<BR> <esri37206> : GCS Oman
-<BR> <esri37207> : GCS South Asia Singapore
-<BR> <esri37208> : GCS Ayabelle
-<BR> <esri37211> : GCS Point 58
-<BR> <esri37212> : GCS Beacon E 1945
-<BR> <esri37213> : GCS Tern Island 1961
-<BR> <esri37214> : GCS Astro 1952
-<BR> <esri37215> : GCS Bellevue IGN
-<BR> <esri37216> : GCS Canton 1966
-<BR> <esri37217> : GCS Chatham Island 1971
-<BR> <esri37218> : GCS DOS 1968
-<BR> <esri37219> : GCS Easter Island 1967
-<BR> <esri37220> : GCS Guam 1963
-<BR> <esri37221> : GCS GUX 1
-<BR> <esri37222> : GCS Johnston Island 1961
-<BR> <esri37223> : GCS Carthage Degree
-<BR> <esri37224> : GCS Midway 1961
-<BR> <esri37226> : GCS Pitcairn 1967
-<BR> <esri37227> : GCS Santo DOS 1965
-<BR> <esri37228> : GCS Viti Levu 1916
-<BR> <esri37229> : GCS Wake Eniwetok 1960
-<BR> <esri37230> : GCS Wake Island 1952
-<BR> <esri37231> : GCS Anna 1 1965
-<BR> <esri37232> : GCS Gan 1970
-<BR> <esri37233> : GCS ISTS 073 1969
-<BR> <esri37234> : GCS Kerguelen Island 1949
-<BR> <esri37235> : GCS Reunion
-<BR> <esri37237> : GCS Ascension Island 1958
-<BR> <esri37238> : GCS DOS 71 4
-<BR> <esri37239> : GCS Cape Canaveral
-<BR> <esri37240> : GCS Fort Thomas 1955
-<BR> <esri37241> : GCS Graciosa Base SW 1948
-<BR> <esri37242> : GCS ISTS 061 1968
-<BR> <esri37243> : GCS LC5 1961
-<BR> <esri37245> : GCS Observ Meteorologico 1939
-<BR> <esri37246> : GCS Pico de Las Nieves
-<BR> <esri37247> : GCS Porto Santo 1936
-<BR> <esri37249> : GCS Sao Braz
-<BR> <esri37250> : GCS Selvagem Grande 1938
-<BR> <esri37251> : GCS Tristan 1968
-<BR> <esri37252> : GCS Samoa 1962
-<BR> <esri37253> : GCS Camp Area
-<BR> <esri37254> : GCS Deception Island
-<BR> <esri37255> : GCS Gunung Segara
-<BR> <esri37257> : GCS S42 Hungary
-<BR> <esri37259> : GCS Kusaie 1951
-<BR> <esri37260> : GCS Alaskan Islands
-<BR> <esri104000> : GCS Assumed Geographic 1
-<BR> <esri104101> : GCS Estonia 1937
-<BR> <esri104102> : GCS Hermannskogel
-<BR> <esri104103> : GCS Sierra Leone 1960
-<BR> <esri104104> : GCS Hong Kong 1980
-<BR> <esri104105> : GCS Datum Lisboa Bessel
-<BR> <esri104106> : GCS Datum Lisboa Hayford
-<BR> <esri104107> : GCS RGF 1993
-<BR> <esri104108> : GCS NZGD 2000
-<BR> <esri104261> : GCS Merchich Degree
-<BR> <esri104304> : GCS Voirol 1875 Degree
-<BR> <esri104305> : GCS Voirol Unifie 1960 Degree
-<P>
-<BR> ---------------------------------------------------------
-<BR> Google mercator
-<BR> ---------------------------------------------------------
-<BR> <900913> Chris' funny epsgish code for the google mercator
-<P>
-<BR> ---------------------------------------------------------
-<BR> IGNF (French Mapping Agency) projection definitions
-<BR> ---------------------------------------------------------
-<BR> <ANAA92> : MOP92 (Anaa) Tuamotu
-<BR> <APAT86> : MOP86 (Apataki, Rapa, Hao) Tuamotu
-<BR> <ATI> : Ancienne Triangulation des Ingenieurs
-<BR> <CAD97> : Cadastre 1997
-<BR> <CIOBIH> : CIO-BIH
-<BR> <CROZ63> : Crozet 1963
-<BR> <CSG67> : Guyane CSG67
-<BR> <ED50> : ED50
-<BR> <EFATE57> : EFATE-IGN 1957
-<BR> <FANGA84> : MOP84 (Fangataufa 1984)
-<BR> <GUAD48> : Guadeloupe Ste Anne
-<BR> <GUADFM49> : Guadeloupe Fort Marigot
-<BR> <IGN63> : IGN 1963 (Hiva Oa, Tahuata, Mohotani)
-<BR> <IGN72> : IGN 1972 Grande-Terre / Ile des Pins
-<BR> <KAUE70> : MHPF70 (Kauehi) Tuamotu
-<BR> <KERG62CAR> : Kerguelen - K0
-<BR> <LIFOU56> : Lifou - Iles Loyaute (IGN56)
-<BR> <LUREF> : Nouvelle Triangulation du Grand Duche du Luxembourg
-<BR> <MARE53> : Mare - Iles Loyaute (IGN53)
-<BR> <MARQUI72> : IGN 1972 (Eiao, Hiva Oa, Mohotani) Marquises
-<BR> <MART38> : Martinique Fort-Desaix
-<BR> <MAYO50> : Mayotte Combani
-<BR> <MHEFO55F> : MHEFO 1955 (Fatu Huku)
-<BR> <MHPF67> : MHPF67 (Mangareva, Agakauitai, Aukena, Mekiro) Gambiers (Iles)
-<BR> <MOOREA87> : Moorea 1987
-<BR> <MOP90> : MOP90 (Tetiaroa) Iles de la Societe
-<BR> <NTF> : Nouvelle Triangulation Francaise
-<BR> <NUKU72> : IGN 1972 Nuku Hiva
-<BR> <NUKU94> : SAT94 (Nukutavake) Tuamotu
-<BR> <OUVEA72CAR> : Ouvea - Iles Loyaute (MHNC 1972 - OUVEA)
-<BR> <PETRELS72> : Petrels - IGN 1972
-<BR> <RAIA53> : IGN53 (IGN Raiatea-Tahaa) Raiatea-Tahaa-Bora Bora-Huahine
-<BR> <REUN47> : Reunion 1947
-<BR> <RGF93> : Reseau geodesique francais 1993
-<BR> <RGFG95> : Reseau geodesique francais de Guyane 1995
-<BR> <RGM04> : RGM04 (Reseau Geodesique de Mayotte 2004)
-<BR> <RGNC> : Reseau Geodesique de Nouvelle-Caledonie
-<BR> <RGPF> : RGPF (Reseau Geodesique de Polynesie Francaise)
-<BR> <RGR92> : Reseau geodesique Reunion 1992
-<BR> <RGSPM06> : Reseau Geodesique Saint-Pierre-et-Miquelon (2006)
-<BR> <RRAF91> : RRAF 1991 (Reseau de Reference des Antilles Francaises)
-<BR> <SAT84> : SAT84 (Rurutu) Iles Australes
-<BR> <SHOM84> : SHOM 1984 Martinique Montagne Du Vauclin
-<BR> <STPM50> : St Pierre et Miquelon 1950
-<BR> <TAHAA> : Raiatea - Tahaa 51-54 (Tahaa, Base Terme Est)
-<BR> <TAHI51> : Tahiti-Terme Nord 1951
-<BR> <TAHI79> : IGN79 (Tahiti) Iles de la Societe
-<BR> <TANNA> : Tanna Bloc Sud
-<BR> <TERA50> : Pointe Geologie - Perroud 1950
-<BR> <TUBU69> : MHPF 1969 (Tubuai) Iles Australes
-<BR> <WALL78> : Wallis-Uvea 1978 (MOP78)
-<BR> <WGS72> : World Geodetic System 1972
-<BR> <WGS84> : World Geodetic System 1984
-<BR> <ANAA92GEO> : MOP92 (Anaa) Tuamotu
-<BR> <APAT86GEO> : MOP86 (Apataki, Rapa, Hao) Tuamotu
-<BR> <ATIGEO> : Ancienne Triangulation des Ingenieurs
-<BR> <CAD97GEO> : Cadastre 1997
-<BR> <CROZ63GEO> : Crozet 1963
-<BR> <CSG67GEO> : Guyane CSG67 UTM fuseau 21
-<BR> <ED50G> : ED50
-<BR> <EFATE57GEO> : EFATE-IGN 1957
-<BR> <FANGA84GEO> : MOP84 (Fangataufa 1984)
-<BR> <GUAD48GEO> : Guadeloupe Ste Anne
-<BR> <GUADFM49GEO> : Guadeloupe Fort Marigot
-<BR> <IGN63GEO> : IGN 1963 (Hiva Oa, Tahuata, Mohotani)
-<BR> <IGN72GEO> : IGN 1972 Grande-Terre / Ile des Pins
-<BR> <KAUE70GEO> : MHPF70 (Kauehi) Tuamotu
-<BR> <KERG62GEO> : Kerguelen - K0
-<BR> <LIFOU56GEO> : Lifou - Iles Loyaute (IGN56)
-<BR> <LUXGEO> : Nouvelle Triangulation du Grand Duche du Luxembourg
-<BR> <MARE53GEO> : Mare - Iles Loyaute (IGN53)
-<BR> <MARQUI72GEO> : IGN 1972 (Eiao, Hiva Oa, Mohotani) Marquises
-<BR> <MART38GEO> : Martinique Fort-Desaix
-<BR> <MAYO50GEO> : Mayotte Combani
-<BR> <MHEFO55FGEO> : MHEFO 1955 (Fatu Huku)
-<BR> <MHPF67GEO> : MHPF67 (Mangareva, Agakauitai, Aukena, Mekiro) Gambiers (Iles)
-<BR> <MOOREA87GEO> : Moorea 1987
-<BR> <MOP90GEO> : MOP90 (Tetiaroa) Iles de la Societe
-<BR> <NTFG> : Nouvelle Triangulation Francaise Greenwich degres sexagesimaux
-<BR> <NTFP> : Nouvelle Triangulation Francaise Paris grades
-<BR> <NUKU72GEO> : IGN 1972 Nuku Hiva
-<BR> <NUKU94GEO> : SAT94 (Nukutavake) Tuamotu
-<BR> <OUVEA72GEO> : Ouvea - Iles Loyaute (MHNC 1972 - OUVEA)
-<BR> <RAIA53GEO> : IGN53 (IGN Raiatea-Tahaa) Raiatea-Tahaa-Bora Bora-Huahine
-<BR> <REUN47GEO> : Reunion 1947
-<BR> <RGF93G> : Reseau geodesique francais 1993
-<BR> <RGFG95GEO> : Reseau geodesique francais de Guyane 1995
-<BR> <RGM04GEO> : RGM04 (Reseau Geodesique de Mayotte 2004)
-<BR> <RGNCGEO> : Reseau Geodesique de Nouvelle-Caledonie
-<BR> <RGPFGEO> : RGPF (Reseau Geodesique de Polynesie Francaise)
-<BR> <RGR92GEO> : Reseau geodesique de la Reunion 1992
-<BR> <RGSPM06GEO> : Saint-Pierre-et-Miquelon (2006)
-<BR> <SAT84GEO> : SAT84 (Rurutu) Iles Australes
-<BR> <SHOM84GEO> : SHOM 1984 Martinique Montagne Du Vauclin
-<BR> <STPM50GEO> : St Pierre et Miquelon 1950
-<BR> <TAHAAGEO> : Raiatea - Tahaa 51-54 (Tahaa, Base Terme Est)
-<BR> <TAHI51GEO> : Tahiti-Terme Nord 1951
-<BR> <TAHI79GEO> : IGN79 (Tahiti) Iles de la Societe
-<BR> <TANNAGEO> : Tanna Bloc Sud
-<BR> <TERA50GEO> : Pointe Geologie - Perroud 1950
-<BR> <TUBU69GEO> : MHPF 1969 (Tubuai) Iles Australes
-<BR> <WALL78GEO> : Wallis - Uvea 1978 (MOP78)
-<BR> <WGS72G> : WGS72
-<BR> <WGS84G> : World Geodetic System 1984
-<BR> <WGS84RRAFGEO> : Reseau de reference des Antilles francaises (1988-1991)
-<BR> <XGEO> : Systeme CIO-BIH
-<BR> <ANAA92UTM6S> : MOP92 (Anaa) Tuamotu - UTM fuseau 6 Sud
-<BR> <APAT86UTM6S> : MOP86 (Apataki, Rapa, Hao) Tuamotu - UTM fuseau 6 Sud
-<BR> <APAT86UTM7S> : MOP86 (Apataki, Rapa, Hao) Tuamotu - UTM fuseau 7 Sud
-<BR> <CAD97UTM38S> : Cadastre 1997 - UTM fuseau 38 Sud
-<BR> <CROZ63UTM39S> : Crozet 1963
-<BR> <CSG67UTM21> : Guyane CSG67 UTM fuseau 21
-<BR> <CSG67UTM22> : Guyane CSG67 UTM fuseau 22
-<BR> <EFATE57UT59S> : EFATE-IGN 1957 - UTM fuseau 59 Sud
-<BR> <FANGA84UTM7S> : Fangataufa 1984 - UTM fuseau 7 Sud
-<BR> <GEOPORTALANF> : Geoportail - Antilles francaises
-<BR> <GEOPORTALCRZ> : Geoportail - Crozet
-<BR> <GEOPORTALFXX> : Geoportail - France metropolitaine
-<BR> <GEOPORTALGUF> : Geoportail - Guyane
-<BR> <GEOPORTALKER> : Geoportail - Kerguelen
-<BR> <GEOPORTALMYT> : Geoportail - Mayotte
-<BR> <GEOPORTALNCL> : Geoportail - Nouvelle-Caledonie
-<BR> <GEOPORTALPYF> : Geoportail - Polynesie francaise
-<BR> <GEOPORTALREU> : Geoportail - Reunion et dependances
-<BR> <GEOPORTALSPM> : Geoportail - Saint-Pierre et Miquelon
-<BR> <GEOPORTALWLF> : Geoportail - Wallis et Futuna
-<BR> <GUAD48UTM20> : Guadeloupe Ste Anne
-<BR> <GUADFM49U20> : Guadeloupe Fort Marigot
-<BR> <IGN63UTM7S> : IGN 1963 - Hiva Oa, Tahuata, Mohotani - UTM fuseau 7 Sud
-<BR> <IGN72LAM> : IGN 1972 - Lambert Nouvelle Caledonie
-<BR> <IGN72UTM58S> : IGN 1972 - UTM fuseau 58 Sud
-<BR> <KAUE70UTM6S> : MHPF70 (Kauehi) Tuamotu - UTM fuseau 6 Sud
-<BR> <KERG62UTM42S> : Kerguelen 1962
-<BR> <LAMB1> : Lambert I
-<BR> <LAMB1C> : Lambert I Carto
-<BR> <LAMB2> : Lambert II
-<BR> <LAMB2C> : Lambert II Carto
-<BR> <LAMB3> : Lambert III
-<BR> <LAMB3C> : Lambert III Carto
-<BR> <LAMB4> : Lambert IV
-<BR> <LAMB4C> : Lambert IV Carto
-<BR> <LAMB93> : Lambert 93
-<BR> <LAMBE> : Lambert II etendu
-<BR> <LAMBGC> : Lambert grand champ
-<BR> <LUXGAUSSK> : Luxembourg 1929
-<BR> <MARE53UTM58S> : Mare - Iles Loyaute - UTM fuseau 58 Sud
-<BR> <MART38UTM20> : Martinique Fort-Desaix
-<BR> <MAYO50UTM38S> : Mayotte Combani
-<BR> <MHPF67UTM8S> : MHPF67 (Mangareva, Agakauitai, Aukena, Mekiro) Gambiers (Iles) - UTM 8 S
-<BR> <MILLER> : Geoportail - Monde
-<BR> <MOOREA87U6S> : Moorea 1987 - UTM fuseau 6 Sud
-<BR> <MOP90UTM6S> : MOP90 (Tetiaroa) Iles de la Societe - UTM fuseau 6 Sud
-<BR> <NUKU72U7S> : IGN 1972 Nuku Hiva - UTM fuseau 7 Sud
-<BR> <NUKU94UTM7S> : IGN 1994 Nuku Hiva - UTM fuseau 7 Sud
-<BR> <OUVEA72U58S> : Ouvea - Iles Loyaute - UTM fuseau 58 Sud
-<BR> <RAIA53UTM5S> : IGN53 (IGN Raiatea-Tahaa) Raiatea-Tahaa-Bora Bora-Huahine - UTM fuseau 5
-<BR> <REUN47GAUSSL> : Reunion Gauss Laborde
-<BR> <RGF93CC42> : Projection conique conforme Zone 1
-<BR> <RGF93CC43> : Projection conique conforme Zone 2
-<BR> <RGF93CC44> : Projection conique conforme Zone 3
-<BR> <RGF93CC45> : Projection conique conforme Zone 4
-<BR> <RGF93CC46> : Projection conique conforme Zone 5
-<BR> <RGF93CC47> : Projection conique conforme Zone 6
-<BR> <RGF93CC48> : Projection conique conforme Zone 7
-<BR> <RGF93CC49> : Projection conique conforme Zone 8
-<BR> <RGF93CC50> : Projection conique conforme Zone 9
-<BR> <RGM04UTM38S> : UTM fuseau 38 Sud (Reseau Geodesique de Mayotte 2004)
-<BR> <RGNCLAM> : Reseau Geodesique de Nouvelle-Caledonie - Lambert Nouvelle Caledonie
-<BR> <RGNCUTM57S> : Reseau Geodesique de Nouvelle-Caledonie - UTM fuseau 57 Sud
-<BR> <RGNCUTM58S> : Reseau Geodesique de Nouvelle-Caledonie - UTM fuseau 58 Sud
-<BR> <RGNCUTM59S> : Reseau Geodesique de Nouvelle-Caledonie - UTM fuseau 59 Sud
-<BR> <RGPFUTM5S> : RGPF - UTM fuseau 5 Sud
-<BR> <RGPFUTM6S> : RGPF - UTM fuseau 6 Sud
-<BR> <RGPFUTM7S> : RGPF - UTM fuseau 7 Sud
-<BR> <RGR92UTM40S> : RGR92 UTM fuseau 40 Sud
-<BR> <RGSPM06U21> : Saint-Pierre-et-Miquelon (2006) UTM Fuseau 21 Nord
-<BR> <SAT84UTM5S> : SAT84 (Rurutu) Iles Australes - UTM fuseau 5 Sud
-<BR> <STEREOSX> : Stereographique polaire Sud
-<BR> <STPM50UTM21> : St Pierre et Miquelon 1950
-<BR> <TAHAAUTM05S> : Tahaa 1951
-<BR> <TAHI51UTM06S> : Tahiti-Terme Nord UTM fuseau 6 Sud
-<BR> <TAHI79UTM6S> : Tahiti 1979
-<BR> <TANNAUTM59S> : Tanna Bloc Sud - UTM fuseau 59 Sud
-<BR> <TERA50SPTA> : Terre Adelie Stereo polaire Terre Adelie
-<BR> <TERA50STEREO> : Terre Adelie 1950
-<BR> <TUBU69UTM6S> : Tubuai - Iles Australes - UTM fuseau 6 Sud
-<BR> <UTM01SW72> : World Geodetic System 1972 UTM fuseau 01 Sud
-<BR> <UTM01SW84> : World Geodetic System 1984 UTM fuseau 01 Sud
-<BR> <UTM01W84> : World Geodetic System 1984 UTM fuseau 01
-<BR> <UTM02SW84> : World Geodetic System 1984 UTM fuseau 02 Sud
-<BR> <UTM02W84> : World Geodetic System 1984 UTM fuseau 02
-<BR> <UTM03SW84> : World Geodetic System 1984 UTM fuseau 03 Sud
-<BR> <UTM03W84> : World Geodetic System 1984 UTM fuseau 03
-<BR> <UTM04SW84> : World Geodetic System 1984 UTM fuseau 04 Sud
-<BR> <UTM04W84> : World Geodetic System 1984 UTM fuseau 04
-<BR> <UTM05SW84> : World Geodetic System 1984 UTM fuseau 05 Sud
-<BR> <UTM05W84> : World Geodetic System 1984 UTM fuseau 05
-<BR> <UTM06SW84> : World Geodetic System 1984 UTM fuseau 06 Sud
-<BR> <UTM06W84> : World Geodetic System 1984 UTM fuseau 06
-<BR> <UTM07SW84> : World Geodetic System 1984 UTM fuseau 07 Sud
-<BR> <UTM07W84> : World Geodetic System 1984 UTM fuseau 07
-<BR> <UTM08SW84> : World Geodetic System 1984 UTM fuseau 08 Sud
-<BR> <UTM08W84> : World Geodetic System 1984 UTM fuseau 08
-<BR> <UTM09SW84> : World Geodetic System 1984 UTM fuseau 09 Sud
-<BR> <UTM09W84> : World Geodetic System 1984 UTM fuseau 09
-<BR> <UTM10SW84> : World Geodetic System 1984 UTM fuseau 10 Sud
-<BR> <UTM10W84> : World Geodetic System 1984 UTM fuseau 10
-<BR> <UTM11SW84> : World Geodetic System 1984 UTM fuseau 11 Sud
-<BR> <UTM11W84> : World Geodetic System 1984 UTM fuseau 11
-<BR> <UTM12SW84> : World Geodetic System 1984 UTM fuseau 12 Sud
-<BR> <UTM12W84> : World Geodetic System 1984 UTM fuseau 12
-<BR> <UTM13SW84> : World Geodetic System 1984 UTM fuseau 13 Sud
-<BR> <UTM13W84> : World Geodetic System 1984 UTM fuseau 13
-<BR> <UTM14SW84> : World Geodetic System 1984 UTM fuseau 14 Sud
-<BR> <UTM14W84> : World Geodetic System 1984 UTM fuseau 14
-<BR> <UTM15SW84> : World Geodetic System 1984 UTM fuseau 15 Sud
-<BR> <UTM15W84> : World Geodetic System 1984 UTM fuseau 15
-<BR> <UTM16SW84> : World Geodetic System 1984 UTM fuseau 16 Sud
-<BR> <UTM16W84> : World Geodetic System 1984 UTM fuseau 16
-<BR> <UTM17SW84> : World Geodetic System 1984 UTM fuseau 17 Sud
-<BR> <UTM17W84> : World Geodetic System 1984 UTM fuseau 17
-<BR> <UTM18SW84> : World Geodetic System 1984 UTM fuseau 18 Sud
-<BR> <UTM18W84> : World Geodetic System 1984 UTM fuseau 18
-<BR> <UTM19SW84> : World Geodetic System 1984 UTM fuseau 19 Sud
-<BR> <UTM19W84> : World Geodetic System 1984 UTM fuseau 19
-<BR> <UTM20SW84> : World Geodetic System 1984 UTM fuseau 20 Sud
-<BR> <UTM20W84> : World Geodetic System 1984 UTM fuseau 20
-<BR> <UTM20W84GUAD> : World Geodetic System 1984 UTM fuseau 20 Nord-Guadeloupe
-<BR> <UTM20W84MART> : World Geodetic System 1984 UTM fuseau 20 Nord-Martinique
-<BR> <UTM21SW84> : World Geodetic System 1984 UTM fuseau 21 Sud
-<BR> <UTM21W84> : World Geodetic System 1984 UTM fuseau 21
-<BR> <UTM22RGFG95> : RGFG95 UTM fuseau 22 Nord-Guyane
-<BR> <UTM22SW84> : World Geodetic System 1984 UTM fuseau 22 Sud
-<BR> <UTM22W84> : World Geodetic System 1984 UTM fuseau 22
-<BR> <UTM23SW84> : World Geodetic System 1984 UTM fuseau 23 Sud
-<BR> <UTM23W84> : World Geodetic System 1984 UTM fuseau 23
-<BR> <UTM24SW84> : World Geodetic System 1984 UTM fuseau 24 Sud
-<BR> <UTM24W84> : World Geodetic System 1984 UTM fuseau 24
-<BR> <UTM25SW84> : World Geodetic System 1984 UTM fuseau 25 Sud
-<BR> <UTM25W84> : World Geodetic System 1984 UTM fuseau 25
-<BR> <UTM26SW84> : World Geodetic System 1984 UTM fuseau 26 Sud
-<BR> <UTM26W84> : World Geodetic System 1984 UTM fuseau 26
-<BR> <UTM27SW84> : World Geodetic System 1984 UTM fuseau 27 Sud
-<BR> <UTM27W84> : World Geodetic System 1984 UTM fuseau 27
-<BR> <UTM28SW84> : World Geodetic System 1984 UTM fuseau 28 Sud
-<BR> <UTM28W84> : World Geodetic System 1984 UTM fuseau 28
-<BR> <UTM29SW84> : World Geodetic System 1984 UTM fuseau 29 Sud
-<BR> <UTM29W84> : World Geodetic System 1984 UTM fuseau 29
-<BR> <UTM30> : European Datum 1950 UTM fuseau 30
-<BR> <UTM30RGF93> : RGF93 UTM fuseau 30
-<BR> <UTM30SW84> : World Geodetic System 1984 UTM fuseau 30 Sud
-<BR> <UTM30W72> : World Geodetic System 1972 UTM fuseau 30
-<BR> <UTM30W84> : World Geodetic System 1984 UTM fuseau 30
-<BR> <UTM31> : European Datum 1950 UTM fuseau 31
-<BR> <UTM31RGF93> : RGF93 UTM fuseau 31
-<BR> <UTM31SW84> : World Geodetic System 1984 UTM fuseau 31 Sud
-<BR> <UTM31W72> : World Geodetic System 1972 UTM fuseau 31
-<BR> <UTM31W84> : World Geodetic System 1984 UTM fuseau 31
-<BR> <UTM32> : European Datum 1950 UTM fuseau 32
-<BR> <UTM32RGF93> : RGF93 UTM fuseau 32
-<BR> <UTM32SW84> : World Geodetic System 1984 UTM fuseau 32 Sud
-<BR> <UTM32W72> : World Geodetic System 1972 UTM fuseau 32
-<BR> <UTM32W84> : World Geodetic System 1984 UTM fuseau 32
-<BR> <UTM33SW84> : World Geodetic System 1984 UTM fuseau 33 Sud
-<BR> <UTM33W84> : World Geodetic System 1984 UTM fuseau 33
-<BR> <UTM34SW84> : World Geodetic System 1984 UTM fuseau 34 Sud
-<BR> <UTM34W84> : World Geodetic System 1984 UTM fuseau 34
-<BR> <UTM35SW84> : World Geodetic System 1984 UTM fuseau 35 Sud
-<BR> <UTM35W84> : World Geodetic System 1984 UTM fuseau 35
-<BR> <UTM36SW84> : World Geodetic System 1984 UTM fuseau 36 Sud
-<BR> <UTM36W84> : World Geodetic System 1984 UTM fuseau 36
-<BR> <UTM37SW84> : World Geodetic System 1984 UTM fuseau 37 Sud
-<BR> <UTM37W84> : World Geodetic System 1984 UTM fuseau 37
-<BR> <UTM38SW84> : World Geodetic System 1984 UTM fuseau 38 Sud
-<BR> <UTM38W84> : World Geodetic System 1984 UTM fuseau 38
-<BR> <UTM39SW84> : World Geodetic System 1984 UTM fuseau 39 Sud
-<BR> <UTM39W84> : World Geodetic System 1984 UTM fuseau 39
-<BR> <UTM40SW84> : World Geodetic System 1984 UTM fuseau 40 Sud
-<BR> <UTM40W84> : World Geodetic System 1984 UTM fuseau 40
-<BR> <UTM41SW84> : World Geodetic System 1984 UTM fuseau 41 Sud
-<BR> <UTM41W84> : World Geodetic System 1984 UTM fuseau 41
-<BR> <UTM42SW84> : World Geodetic System 1984 UTM fuseau 42 Sud
-<BR> <UTM42W84> : World Geodetic System 1984 UTM fuseau 42
-<BR> <UTM43SW84> : World Geodetic System 1984 UTM fuseau 43 Sud
-<BR> <UTM43W84> : World Geodetic System 1984 UTM fuseau 43
-<BR> <UTM44SW84> : World Geodetic System 1984 UTM fuseau 44 Sud
-<BR> <UTM44W84> : World Geodetic System 1984 UTM fuseau 44
-<BR> <UTM45SW84> : World Geodetic System 1984 UTM fuseau 45 Sud
-<BR> <UTM45W84> : World Geodetic System 1984 UTM fuseau 45
-<BR> <UTM46SW84> : World Geodetic System 1984 UTM fuseau 46 Sud
-<BR> <UTM46W84> : World Geodetic System 1984 UTM fuseau 46
-<BR> <UTM47SW84> : World Geodetic System 1984 UTM fuseau 47 Sud
-<BR> <UTM47W84> : World Geodetic System 1984 UTM fuseau 47
-<BR> <UTM48SW84> : World Geodetic System 1984 UTM fuseau 48 Sud
-<BR> <UTM48W84> : World Geodetic System 1984 UTM fuseau 48
-<BR> <UTM49SW84> : World Geodetic System 1984 UTM fuseau 49 Sud
-<BR> <UTM49W84> : World Geodetic System 1984 UTM fuseau 49
-<BR> <UTM50SW84> : World Geodetic System 1984 UTM fuseau 50 Sud
-<BR> <UTM50W84> : World Geodetic System 1984 UTM fuseau 50
-<BR> <UTM51SW84> : World Geodetic System 1984 UTM fuseau 51 Sud
-<BR> <UTM51W84> : World Geodetic System 1984 UTM fuseau 51
-<BR> <UTM52SW84> : World Geodetic System 1984 UTM fuseau 52 Sud
-<BR> <UTM52W84> : World Geodetic System 1984 UTM fuseau 52
-<BR> <UTM53SW84> : World Geodetic System 1984 UTM fuseau 53 Sud
-<BR> <UTM53W84> : World Geodetic System 1984 UTM fuseau 53
-<BR> <UTM54SW84> : World Geodetic System 1984 UTM fuseau 54 Sud
-<BR> <UTM54W84> : World Geodetic System 1984 UTM fuseau 54
-<BR> <UTM55SW84> : World Geodetic System 1984 UTM fuseau 55 Sud
-<BR> <UTM55W84> : World Geodetic System 1984 UTM fuseau 55
-<BR> <UTM56SW84> : World Geodetic System 1984 UTM fuseau 56 Sud
-<BR> <UTM56W84> : World Geodetic System 1984 UTM fuseau 56
-<BR> <UTM57SW84> : World Geodetic System 1984 UTM fuseau 57 Sud
-<BR> <UTM57W84> : World Geodetic System 1984 UTM fuseau 57
-<BR> <UTM58SW84> : World Geodetic System 1984 UTM fuseau 58 Sud
-<BR> <UTM58W84> : World Geodetic System 1984 UTM fuseau 58
-<BR> <UTM59SW84> : World Geodetic System 1984 UTM fuseau 59 Sud
-<BR> <UTM59W84> : World Geodetic System 1984 UTM fuseau 59
-<BR> <UTM60SW84> : World Geodetic System 1984 UTM fuseau 60 Sud
-<BR> <UTM60W84> : World Geodetic System 1984 UTM fuseau 60
-<BR> <WALL78UTM1S> : Wallis-Uvea 1978 (MOP78) UTM 1 SUD
-<P>
-<BR> ---------------------------------------------------------
-<BR> Various Non-U.S. Coordinate Systems,
-<BR> ---------------------------------------------------------
-<BR> <CH1903> : Swiss Coordinate System
-<BR> <madagascar> : Laborde grid for Madagascar
-<BR> <new_zealand> : New Zealand Map Grid (NZMG) - Projection unique to N.Z. so all factors fixed
-<BR> ---------------------------------------------------------
-<BR> Secondary grids DMA TM8358.1, p. 4.3
-<BR> ---------------------------------------------------------
-<BR> <bwi> : British West Indies
-<BR> <costa-n> : Costa Rica Norte
-<BR> <costa-s> : Costa Rica Sud
-<BR> <cuba-n> : Cuba Norte
-<BR> <cuba-s> : Cuba Sud
-<BR> <domin_rep> : Dominican Republic
-<BR> <egypt-1> : Egypt
-<BR> <egypt-2> : Egypt
-<BR> <egypt-3> : Egypt
-<BR> <egypt-4> : Egypt
-<BR> <egypt-5> : Egypt
-<BR> <el_sal> : El Salvador
-<BR> <guat-n> : Guatemala Norte
-<BR> <guat-s> : Guatemala Sud
-<BR> <haiti> : Haiti
-<BR> <hond-n> : Honduras Norte
-<BR> <hond-s> : Honduras Sud
-<BR> <levant> : Levant
-<BR> <nica-n> : Nicaragua Norte
-<BR> <nica-s> : Nicaragua Sud
-<BR> <nw-africa> : Northwest Africa
-<BR> <palestine> : Palestine
-<BR> <panama> : Panama
-<P>
-<BR> ---------------------------------------------------------
-<BR> other grids in DMA TM8358.1
-<BR> ---------------------------------------------------------
-<BR> <bng> : British National Grid
-<BR> <malay> : West Malaysian RSO Grid
-<BR> <india-I> : India Zone I
-<BR> <india-IIA> : India Zone IIA
-<BR> <india-IIB> : India Zone IIB
-<BR> <india-IIIA> : India Zone IIIA
-<BR> <india-IIIB> : India Zone IIIB
-<BR> <india-IVA> : India Zone IVA
-<BR> <india-IVB> : India Zone IVB
-<BR> <ceylon> : Ceylon Belt
-<BR> <irish> : Irish Transverse Mercator Grid
-<BR> <neiez> : Netherlands East Indies Equitorial Zone
-<BR> <n-alger> : Nord Algerie Grid
-<BR> <n-maroc> : Nord Maroc Grid
-<BR> <n-tunis> : Nord Tunisie Grid
-<BR> <s-alger> : Sud Algerie Grid
-<BR> <s-maroc> : Sud Maroc Grid
-<BR> <s-tunis> : Sud Tunisie Grid
-<P>
-<BR> ---------------------------------------------------------
-<BR> Gauss Krueger Grids for Germany
-<BR> ---------------------------------------------------------
-<BR> <gk2-d> : Gauss Krueger Grid for Germany
-<BR> <gk3-d> : Gauss Krueger Grid for Germany
-<BR> <gk4-d> : Gauss Krueger Grid for Germany
-<P>
-
-<HR>
-<A NAME="index"> </A><H2>Index</H2>
-<DL>
-<DT><A HREF="#lbAB">NAME</A><DD>
-<DT><A HREF="#lbAC">VERSION</A><DD>
-<DT><A HREF="#lbAD">SYNOPSIS</A><DD>
-<DT><A HREF="#lbAE">DESCRIPTION</A><DD>
-<DT><A HREF="#lbAF">AUTHORSHIP</A><DD>
-<DT><A HREF="#lbAG">OPTIONS</A><DD>
-<DT><A HREF="#lbAH">EXAMPLES</A><DD>
-<DT><A HREF="#lbAI">SEE ALSO</A><DD>
-<DT><A HREF="#lbAJ">BUGS</A><DD>
-<DT><A HREF="#lbAK">APPENDIX 1: PROJECTED COORDINATE SYSTEM IDENTIFIERS</A><DD>
-</DL>
-<HR>
-</PRE>
-
-<CENTER><P><BR>
-Last Updated: 29 November 2014</P></CENTER>
-
-<HR>
-<P><A HREF="mbsystem_man_list.html">Return to list of MB-System manual pages...</A></P>
-<P><A HREF="mbsystem_home.html"><IMG SRC="mbsystem_logo_small.gif" BORDER=0 HEIGHT=55 WIDTH=158 ALIGN=BOTTOM></A><A HREF="mbsystem_home.html">Back
-to MB-System Home Page...</A></P>
-
-</BODY>
-</HTML>
diff --git a/src/html/mbhistogram.html b/src/html/mbhistogram.html
deleted file mode 100644
index d302699..0000000
--- a/src/html/mbhistogram.html
+++ /dev/null
@@ -1,355 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<HTML VERSION="2.0">
-<HEAD>
-   <TITLE>MB-System Unix Manual Page: mbhistogram</TITLE>
-<!-- WEBMAGIC VERSION NUMBER="2.0.2" -->
-<!-- WEBMAGIC TRANSLATION NAME="ServerRoot" SRC="/var/www/htdocs/" DST="/" -->
-<!-- WEBMAGIC TRANSLATION NAME="ProjectRoot" SRC="./" DST="" -->
-</HEAD>
-<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#336699" VLINK="#997040" ALINK="#CC9900">
-<BODY>
-<CENTER><H3><U>MB-System Unix Manual Page</U></H3></CENTER>
-<PRE>
-<H1>mbhistogram</H1>
-Section:  MB-System 5.0  (1)<BR>Updated:  3 June 2013 <BR><A HREF="#index">Index</A>
-<HR>
-
-<A NAME="lbAB"> </A>
-<H2>NAME</H2>
-
-<B>mbhistogram</B> - Generate a histogram of bathymetry, amplitude, or sidescan values
-from swath sonar data files.
-<P>
-<A NAME="lbAC"> </A>
-<H2>VERSION</H2>
-
-Version 5.0
-<P>
-<A NAME="lbAD"> </A>
-<H2>SYNOPSIS</H2>
-
-<B>mbhistogram</B> [<B>-A</B><I>kind</I> <B>-B</B><I>yr/mo/da/hr/mn/sc</I> 
-<B>-C</B> <B>-D</B><I>min/max</I> <B>-E</B><I>yr/mo/da/hr/mn/sc</I> 
-<B>-F</B><I>format</I> <B>-G</B> <B>-I</B><I>filename</I> <B>-L</B><I>lonflip</I> 
-<B>-M</B><I>nintervals</I> <B>-N</B><I>nbins</I> <B>-P</B><I>ping</I> 
-<B>-R</B><I>west/east/south/north</I> <B>-S</B><I>speed</I> <B>-V -H</B>]
-<P>
-<A NAME="lbAE"> </A>
-<H2>DESCRIPTION</H2>
-
-<B>mbhistogram</B> reads a swath sonar data file and generates a histogram
-of the bathymetry,  amplitude,  or sidescan values. Alternatively, 
-mbhistogram can output a list of values which break up the
-distribution into equal sized regions. These values can be
-used to construct a color table, producing an image which
-is histogram equalized. If desired, the histogram
-can be recast into a Gaussian distribution before output or
-the calculation of the histrogram equalization This feature
-is similar to the Gaussian option of <B>grdhisteq</B>. The linear
-histogram equalization is most appropriate for use with 
-grayscale images, such as those produced from amplitude
-or sidescan data, and is used by the macro <B>mbm_plot</B>
-for that purpose. The Gaussian histogram equalization is
-well suited for shading of images, and is used by
-<B>mbm_plot</B> for shading of color bathymetry with
-amplitude data.
-The results are dumped to stdout.
-<P>
-<A NAME="lbAF"> </A>
-<H2>AUTHORSHIP</H2>
-
-David W. Caress (<A HREF="mailto:caress at mbari.org">caress at mbari.org</A>)
-<BR>
-
-<BR>  Monterey Bay Aquarium Research Institute
-<BR>
-
-Dale N. Chayes (<A HREF="mailto:dale at ldeo.columbia.edu">dale at ldeo.columbia.edu</A>)
-<BR>
-
-<BR>  Lamont-Doherty Earth Observatory
-<P>
-<A NAME="lbAG"> </A>
-<H2>OPTIONS</H2>
-
-<DL COMPACT>
-<DT><B>-A</B>
-
-<DD>
-<I>kind</I>
-<BR>
-
-Sets the kind of data to be processed, where 
-<BR> <TT>       </TT><I>kind</I> = 0 : histogram of bathymetry data<BR>
-<BR> <TT>       </TT><I>kind</I> = 1 : histogram of beam amplitude data<BR>
-<BR> <TT>       </TT><I>kind</I> = 2 : histogram of sidescan data<BR>
-Default: <I>kind</I> = 2.
-<DT><B>-B</B>
-
-<DD>
-<I>yr/mo/da/hr/mn/sc</I>
-<BR>
-
-This option sets the starting time for data allowed in the input data.
-The <B>-E</B> option sets the ending time for data. If the 
-starting time is before the ending time, then any data
-with a time stamp before the starting time or after the
-ending time is ignored. If instead the starting time is
-after the ending time, then any data between the ending
-and starting time will be ignored. This scheme allows time
-windowing both inside and outside a specified interval.
-Default: <I>yr/mo/da/hr/mn/sc</I> = 1962/2/21/10/30/0.
-<DT><B>-D</B>
-
-<DD>
-<I>min/max</I>
-<BR>
-
-Specifies the minimum and maximum data values used for
-constructing the histogram. 
-The width of the bins is determined by (<I>max</I> - <I>min</I>)
-divided by <I>nbins</I> (see the <B>-N</B> option).
-The <I>min</I> value is the
-center of the first histogram bin, and the <I>max</I> value is the
-center of the last histogram bin.
-Data values falling outside the range of the bins are ignored.
-<DT><B>-E</B>
-
-<DD>
-<I>yr/mo/da/hr/mn/sc</I>
-<BR>
-
-This option sets the ending time for data allowed in the input data.
-The <B>-B</B> option sets the starting time for data. If the 
-starting time is before the ending time, then any data
-with a time stamp before the starting time or after the
-ending time is ignored. If instead the starting time is
-after the ending time, then any data between the ending
-and starting time will be ignored. This scheme allows time
-windowing both inside and outside a specified interval.
-Default: <I>yr/mo/da/hr/mn/sc</I> = 2062/2/21/10/30/0.
-<DT><B>-F</B>
-
-<DD>
-<I>format</I>
-<BR>
-
-Sets the data format used if the input is read from stdin
-or from a file. If <I>format</I> < 0, then the input file specified
-with the <B>-I</B> option will actually contain a list of input swath sonar
-data files. This program uses the <B>MBIO</B> library 
-and will read or write any swath sonar
-format supported by <B>MBIO</B>. A list of the swath sonar data formats
-currently supported by <B>MBIO</B> and their identifier values
-is given in the <B>MBIO</B> manual page. Default: <I>format</I> = 11.
-<DT><B>-G</B>
-
-<DD>
-This option causes the data histogram to be recast into a
-Gaussian distribution.
-<DT><B>-I</B>
-
-<DD>
-<I>filename</I>
-<BR>
-
-Sets the input filename. If <I>format</I> > 0 (set with the 
-<B>-f</B> option) then the swath sonar data contained in <I>infile</I> 
-is read and processed. If <I>format</I> < 0, then <I>infile</I>
-is assumed to be an ascii file containing a list of the input swath sonar
-data files to be processed and their formats.  The program will read 
-the data in each one of these files.
-In the <I>infile</I> file, each
-data file should be followed by a data format identifier, e.g.:
-<BR> <TT>       </TT>datafile1 11<BR>
-<BR> <TT>       </TT>datafile2 24<BR>
-<BR>
-
-This program uses the <B>MBIO</B> library and will read or write any swath sonar
-format supported by <B>MBIO</B>. A list of the swath sonar data formats
-currently supported by <B>MBIO</B> and their identifier values
-is given in the <B>MBIO</B> manual page. Default: <I>infile</I> = "stdin".
-<DT><B>-L</B>
-
-<DD>
-<I>lonflip</I>
-<BR>
-
-Sets the range of the longitude values returned.
-If <I>lonflip</I>=-1 then the longitude values will be in
-the range from -360 to 0 degrees. If <I>lonflip</I>=0 
-then the longitude values will be in
-the range from -180 to 180 degrees. If <I>lonflip</I>=1 
-then the longitude values will be in
-the range from 0 to 360 degrees.
-Default: <I>lonflip</I> = 0.
-<DT><B>-M</B>
-
-<DD>
-<I>nintervals</I>
-<BR>
-
-If <I>nintervals</I> > 0 then <B>mbhistogram</B> will 
-calculate and output a list of values which break up
-the data distribution into equal sized regions.  This can
-be useful for constructing color tables which accentuate
-features in amplitude and sidescan data (the macro <B>mbm_plot</B>
-makes use of this feature). If this option is enabled, then the
-raw histogram is not output.
-<DT><B>-N</B>
-
-<DD>
-<I>nbins</I>
-<BR>
-
-Sets the number of bins used to calculate the histogram.
-<DT><B>-P</B>
-
-<DD>
-<I>pings</I>
-<BR>
-
-Sets the ping averaging of the input data. If <I>pings</I> = 1, then
-no ping averaging is performed. If <I>pings</I> > 0, then
-that number of input pings will be averaged to produce one output
-ping.  If <I>pings</I> = 0, then the ping averaging will automatically
-be done so that the along-track ping spacing is equal to the across-track
-beam spacing.
-Default: <I>pings</I> = 1 (no ping averaging).
-<DT><B>-R</B>
-
-<DD>
-<I>west/east/south/north</I>
-<BR>
-
-Sets the longitude and latitude bounds within which swath sonar 
-data will be read. Only the data which lies within these bounds will
-be read. 
-Default: <I>west</I>=-360, east<I>=360</I>, <I>south</I>=-90, <I>north</I>=90.
-<DT><B>-S</B>
-
-<DD>
-<I>speed</I>
-<BR>
-
-Sets the minimum speed in km/hr (5.5 kts ~ 10 km/hr) allowed in 
-the input data; pings associated with a smaller ship speed will not be
-copied. Default: <I>speed</I> = 0.
-<DT><B>-T</B>
-
-<DD>
-<I>timegap</I>
-<BR>
-
-Sets the maximum time gap in minutes between adjacent pings allowed before
-the data is considered to have a gap. Default: <I>timegap</I> = 1.
-<DT><B>-V</B>
-
-<DD>
-Normally, <B>mbhistogram</B> only prints out the statistics obtained
-by reading all of the data.  If the
-<B>-V</B> flag is given, then <B>MBCOPY</B> works in a "verbose" mode and
-outputs the program version being used and all read error status messages.
-<DT><B>-H</B>
-
-<DD>
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-<P>
-</DL>
-<A NAME="lbAH"> </A>
-<H2>EXAMPLES</H2>
-
-Suppose one wishes to obtain a histogram of the sidescan data
-in a file called mbexample.mb41 containing raw data from a SeaBeam
-2112 sonar (format 41). The following will suffice:
-<BR> mbhistogram -F41 -I sb199411211212.rec -D0.0/45000 -N25
-<BR>
-
-to yield the following histogram:
-<BR> 0.000000 183814
-<BR> 1875.000000 30845
-<BR> 3750.000000 5365
-<BR> 5625.000000 1918
-<BR> 7500.000000 951
-<BR> 9375.000000 591
-<BR> 11250.000000 403
-<BR> 13125.000000 232
-<BR> 15000.000000 189
-<BR> 16875.000000 127
-<BR> 18750.000000 108
-<BR> 20625.000000 75
-<BR> 22500.000000 85
-<BR> 24375.000000 48
-<BR> 26250.000000 30
-<BR> 28125.000000 31
-<BR> 30000.000000 28
-<BR> 31875.000000 21
-<BR> 33750.000000 10
-<BR> 35625.000000 9
-<BR> 37500.000000 4
-<BR> 39375.000000 2
-<BR> 41250.000000 2
-<BR> 43125.000000 2
-<BR> 45000.000000 1
-<BR>
-
-In order to obtain 16 values breaking up the distribution into
-equal sized regions, use the <B>-M</B> option:
-<BR> mbhistogram -F41 -I sb199411211212.rec -D0.0/45000 -N45000 -M25
-<BR>
-
-giving:
-<BR>  -0.500011
-<BR> 110.657221
-<BR> 137.446811
-<BR> 165.916284
-<BR> 199.635469
-<BR> 239.900007
-<BR> 287.726270
-<BR> 345.615610
-<BR> 418.142114
-<BR> 513.487776
-<BR> 639.986551
-<BR> 824.475879
-<BR> 1140.372280
-<BR> 1994.280032
-<BR> 44803.495633
-<P>
-<A NAME="lbAI"> </A>
-<H2>SEE ALSO</H2>
-
-<B><A HREF="mbsystem.html">mbsystem</A></B>(1), <B><A HREF="mbm_plot.html">mbm_plot</A></B>(1), grdhisteq(1)
-<P>
-<A NAME="lbAJ"> </A>
-<H2>BUGS</H2>
-
-You find em, we fix 'em...
-<P>
-
-<HR>
-<A NAME="index"> </A><H2>Index</H2>
-<DL>
-<DT><A HREF="#lbAB">NAME</A><DD>
-<DT><A HREF="#lbAC">VERSION</A><DD>
-<DT><A HREF="#lbAD">SYNOPSIS</A><DD>
-<DT><A HREF="#lbAE">DESCRIPTION</A><DD>
-<DT><A HREF="#lbAF">AUTHORSHIP</A><DD>
-<DT><A HREF="#lbAG">OPTIONS</A><DD>
-<DT><A HREF="#lbAH">EXAMPLES</A><DD>
-<DT><A HREF="#lbAI">SEE ALSO</A><DD>
-<DT><A HREF="#lbAJ">BUGS</A><DD>
-</DL>
-<HR>
-</PRE>
-
-<CENTER><P><BR>
-Last Updated: 3 June 2013</P></CENTER>
-
-<HR>
-<P><A HREF="mbsystem_man_list.html">Return to list of MB-System manual pages...</A></P>
-<P><A HREF="mbsystem_home.html"><IMG SRC="mbsystem_logo_small.gif" BORDER=0 HEIGHT=55 WIDTH=158 ALIGN=BOTTOM></A><A HREF="mbsystem_home.html">Back
-to MB-System Home Page...</A></P>
-
-</BODY>
-</HTML>
diff --git a/src/html/mbhsdump.html b/src/html/mbhsdump.html
deleted file mode 100644
index ca7f6aa..0000000
--- a/src/html/mbhsdump.html
+++ /dev/null
@@ -1,160 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<HTML VERSION="2.0">
-<HEAD>
-   <TITLE>MB-System Unix Manual Page: mbhsdump</TITLE>
-<!-- WEBMAGIC VERSION NUMBER="2.0.2" -->
-<!-- WEBMAGIC TRANSLATION NAME="ServerRoot" SRC="/var/www/htdocs/" DST="/" -->
-<!-- WEBMAGIC TRANSLATION NAME="ProjectRoot" SRC="./" DST="" -->
-</HEAD>
-<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#336699" VLINK="#997040" ALINK="#CC9900">
-<BODY>
-<CENTER><H3><U>MB-System Unix Manual Page</U></H3></CENTER>
-<PRE>
-<H1>mbhsdump</H1>
-Section:  MB-System 5.0  (1)<BR>Updated:  7 June 2013 <BR><A HREF="#index">Index</A>
-<HR>
-
-<A NAME="lbAB"> </A>
-<H2>NAME</H2>
-
-<B>mbhsdump</B> - lists the information contained in Hydrosweep DS data files.
-<P>
-<A NAME="lbAC"> </A>
-<H2>VERSION</H2>
-
-Version 5.0
-<P>
-<A NAME="lbAD"> </A>
-<H2>SYNOPSIS</H2>
-
-<B>mbhsdump</B> [<B>-F</B><I>format </I><B>-I</B><I>infile </I><B>-O</B><I>kind </I><B>-V -H</B>]
-<P>
-<A NAME="lbAE"> </A>
-<H2>DESCRIPTION</H2>
-
-<B>mbhsdump</B> lists the information contained in data records on
-Hydrosweep DS data files, including survey, calibrate, water velocity
-and comment records. The default input stream is stdin. Prior to version 5.4
-this program was named hsdump.
-<P>
-<A NAME="lbAF"> </A>
-<H2>AUTHORSHIP</H2>
-
-David W. Caress (<A HREF="mailto:caress at mbari.org">caress at mbari.org</A>)
-<BR>
-
-<BR>  Monterey Bay Aquarium Research Institute
-<BR>
-
-Dale N. Chayes (<A HREF="mailto:dale at ldeo.columbia.edu">dale at ldeo.columbia.edu</A>)
-<BR>
-
-<BR>  Lamont-Doherty Earth Observatory
-<P>
-<A NAME="lbAG"> </A>
-<H2>OPTIONS</H2>
-
-<DL COMPACT>
-<DT><B>-F</B>
-
-<DD>
-<I>format</I>
-<BR>
-
-Sets the format for the input and output swath sonar data using
-<B>MBIO</B> integer format identifiers.
-This program is specific to Hydrosweep DS data, and cannot be used
-with data from any other swath sonar system or with data in a Hydrosweep
-format that does not include water velocity records. Currently, the two formats
-which can be used are the raw Hydrosweep DS format (<B>MBIO</B> id 21)
-and the L-DEO in-house binary Hydrosweep format (<B>MBIO</B> id 24).
-Default: <I>format</I> = 5.
-<DT><B>-H</B>
-
-<DD>
-This "help" flag causes the program to print out a description
-of its operation and then exit immediately.
-<DT><B>-I</B>
-
-<DD>
-<I>infile</I>
-<BR>
-
-Data file from which the input data will be read. If
-no input file is specified, the input will be read
-from stdin. Default: <I>infile</I> = stdin.
-<DT><B>-O</B>
-
-<DD>
-<I>kind</I>
-<BR>
-
-Sets the kind of data record which will be listed, where the choices
-for kind include:
-<BR> <TT>       </TT>1:<TT>      </TT>Survey data record<BR>
-<BR> <TT>       </TT>2:<TT>      </TT>Comment record<BR>
-<BR> <TT>       </TT>3:<TT>      </TT>Calibrate data record<BR>
-<BR> <TT>       </TT>4:<TT>      </TT>Mean velocity data record<BR>
-<BR> <TT>       </TT>5:<TT>      </TT>Velocity profile data record<BR>
-<BR> <TT>       </TT>6:<TT>      </TT>Standby data record<BR>
-<BR> <TT>       </TT>7:<TT>      </TT>Navigation source data record<BR>
-<BR>
-
-This option can be given multiple times to set more than one
-kind of data record for listing.
-<DT><B>-V</B>
-
-<DD>
-Normally, <B>mbhsdump</B> lists only the contents of the data records
-which are specified with the <B>-O</B> option.  If the
-<B>-V</B> flag is given, then <B>mbhsdump</B> works in a "verbose" mode and
-outputs the program version being used, any comment records encountered
-in the data stream, and all error status messages.
-<P>
-</DL>
-<A NAME="lbAH"> </A>
-<H2>EXAMPLES</H2>
-
-Suppose one wishes to list out the water velocity records
-contained in the raw Hydrosweep (format 21) file hsraw.
-The following will suffice:
-<BR> <TT>       </TT>mbhsdump -F21 -O4 -O5 -Ihsraw<BR>
-<P>
-<A NAME="lbAI"> </A>
-<H2>SEE ALSO</H2>
-
-<B><A HREF="mbsystem.html">mbsystem</A></B>(1), <B><A HREF="mbinfo.html">mbinfo</A></B>(1), <B><A HREF="mblist.html">mblist</A></B>(1)
-<P>
-<A NAME="lbAJ"> </A>
-<H2>BUGS</H2>
-
-Other than the name change, this program hasn't been altered in this century.
-It is probably stale.
-<P>
-
-<HR>
-<A NAME="index"> </A><H2>Index</H2>
-<DL>
-<DT><A HREF="#lbAB">NAME</A><DD>
-<DT><A HREF="#lbAC">VERSION</A><DD>
-<DT><A HREF="#lbAD">SYNOPSIS</A><DD>
-<DT><A HREF="#lbAE">DESCRIPTION</A><DD>
-<DT><A HREF="#lbAF">AUTHORSHIP</A><DD>
-<DT><A HREF="#lbAG">OPTIONS</A><DD>
-<DT><A HREF="#lbAH">EXAMPLES</A><DD>
-<DT><A HREF="#lbAI">SEE ALSO</A><DD>
-<DT><A HREF="#lbAJ">BUGS</A><DD>
-</DL>
-<HR>
-</PRE>
-
-<CENTER><P><BR>
-Last Updated: 7 June 2013</P></CENTER>
-
-<HR>
-<P><A HREF="mbsystem_man_list.html">Return to list of MB-System manual pages...</A></P>
-<P><A HREF="mbsystem_home.html"><IMG SRC="mbsystem_logo_small.gif" BORDER=0 HEIGHT=55 WIDTH=158 ALIGN=BOTTOM></A><A HREF="mbsystem_home.html">Back
-to MB-System Home Page...</A></P>
-
-</BODY>
-</HTML>
diff --git a/src/html/mbhysweeppreprocess.html b/src/html/mbhysweeppreprocess.html
deleted file mode 100644
index 0d3c19c..0000000
--- a/src/html/mbhysweeppreprocess.html
+++ /dev/null
@@ -1,412 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<HTML VERSION="2.0">
-<HEAD>
-   <TITLE>MB-System Unix Manual Page: mbhysweeppreprocess</TITLE>
-<!-- WEBMAGIC VERSION NUMBER="2.0.2" -->
-<!-- WEBMAGIC TRANSLATION NAME="ServerRoot" SRC="/var/www/htdocs/" DST="/" -->
-<!-- WEBMAGIC TRANSLATION NAME="ProjectRoot" SRC="./" DST="" -->
-</HEAD>
-<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#336699" VLINK="#997040" ALINK="#CC9900">
-<BODY>
-<CENTER><H3><U>MB-System Unix Manual Page</U></H3></CENTER>
-<PRE>
-<H1>mbhysweeppreprocess</H1>
-Section:  MB-System 5.0  (1)<BR>Updated:  3 June 2013 <BR><A HREF="#index">Index</A>
-<HR>
-
-<A NAME="lbAB"> </A>
-<H2>NAME</H2>
-
-<B>mbhysweeppreprocess</B> - performs preprocessing of multibeam data
-in the Hysweep HSX format (<B>MBIO</B> format 201).
-<P>
-<A NAME="lbAC"> </A>
-<H2>VERSION</H2>
-
-Version 5.0
-<P>
-<A NAME="lbAD"> </A>
-<H2>SYNOPSIS</H2>
-
-<B>mbhysweeppreprocess</B>
-[<B>-A</B><I>offsettype/x/y/z/t</I> <B>-B</B><I>rollbias/pitchbias/headingbias</I>
-<B>-D</B><I>sonardepthfile</I> <B>-I</B><I>datalist</I>
-<B>-J</B><I>projection</I>  <B>-L</B>
-<B>-M</B><I>navformat</I> <B>-N</B><I>navfile</I>
-<B>-T</B><I>timelag</I>
-<B>-H</B> <B>-V</B>]
-<P>
-<A NAME="lbAE"> </A>
-<H2>DESCRIPTION</H2>
-
-<B>mbhysweeppreprocess</B> reads a Hysweep HSX (format 201) file, interpolates the
-asynchronous navigation and attitude onto the multibeam data,
-and writes a new HSX file with that information correctly embedded
-in the multibeam data. The user must specify a projection for the easting-northing
-navigation used in HSX files. This program can also fix various problems
-with multibeam data, and allows for lever arm correction of offsets between the
-sonar, the motion sensor, and the positioning sensor (provided the navigation
-and attitude data included in the HSX file are uncorrected for sensor offsets)..
-<P>
-<A NAME="lbAF"> </A>
-<H2>AUTHORSHIP</H2>
-
-David W. Caress (<A HREF="mailto:caress at mbari.org">caress at mbari.org</A>)
-<BR>
-
-<BR>  Monterey Bay Aquarium Research Institute
-<BR>
-
-Dale N. Chayes (<A HREF="mailto:dale at ldeo.columbia.edu">dale at ldeo.columbia.edu</A>)
-<BR>
-
-<BR>  Lamont-Doherty Earth Observatory
-<P>
-<A NAME="lbAG"> </A>
-<H2>OPTIONS</H2>
-
-<DL COMPACT>
-<DT><B>-A</B>
-
-<DD>
-<I>type/offsetx/offsety/offsetz/offsett</I>
-<BR>
-
-This option sets the spatial and time offset for a sensor relative to a reference
-point on the survey platform (by convention usually close to the center of mass and rotation).
-If <I>type</I> = 1, the offsets pertain to the survey sonar. If <I>type</I> = 2, the offsets
-pertain to the source of the attitude data, usually an MRU or INS. If <I>type</I> = 3, the
-offsets pertain to the source of the position or navigation data. The time offsets are
-referenced against the sonar data, thus the sonar time offset will usually be zero. If any
-of these offsets are defined, then <B>mbhysweeppreprocess</B> will use lever arm calculations
-to determine the x, y, and z offsets associated with the platform attitude for each ping, and
-add those to the sonar navigation and depth values.
-<DT><B>-B</B>
-
-<DD>
-<I>rollbias/pitchbias/headingbias</I>
-<BR>
-
-This option sets roll, pitch, and heading bias values to be applied before merging the attitude
-and heading data with the sonar data while calculating bathymetry.
-<DT><B>-D</B>
-
-<DD>
-<I>sonardepthfile</I>
-<BR>
-
-This option causes <B>mbhysweeppreprocess</B> to read a sonar depth time series from the specified
-file and use that data in place of any sonar depth (DFT) records present in the HSX file. The
-sonar depth data must be in an ascii format of the form:
-<BR>    yyyy:mm:dd:hh:mm:ss.sss zzzz.zzz
-<BR>
-
-where yyyy=year, mm=month, dd=day, hh=hour, mm=minute, ss.sss = seconds, and zzzz.zzz = sonar depth in meters.
-<DT><B>-F</B>
-
-<DD>
-<I>format</I>
-<BR>
-
-Sets the format of the input file specified with the <B>-I</B> option. This is normally omitted unless
-the input filename does not conform to the <B>MB-System</B> file naming conventions. For this
-program, the only relevant options are <I>format</I> = 201 for an HSX format file, or
-<I>format</I>= -1 for a datalist referencing multiple format 201 files.
-<DT><B>-H</B>
-
-<DD>
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-<DT><B>-I</B>
-
-<DD>
-<I>infile</I>
-<BR>
-
-Sets the input file path. If <I>format</I> > 0 (set with the
-<B>-f</B> option or <B>mbdefaults</B>) then the swath sonar data contained in <I>infile</I>
-is read and processed. If <I>format</I> < 0, then <I>infile</I>
-is assumed to be an ascii file containing a list of the input swath sonar
-data files to be processed and their formats.  The program will read
-the data in each one of these files.
-In the <I>infile</I> file, each
-data file should be followed by a data format identifier, e.g.:
-<BR>    datafile1 201
-<BR>    datafile2 201
-<BR>
-
-This program only reads Hysweep HSX format data files (<B>MBIO</B>
-format 201).
-<DT><B>-J</B>
-
-<DD>
-<I>projection</I>
-<BR>
-
-The Hypack and Hysweep software packages operate with navigation in a user-defined
-projected coordinate system. Resultantly, HSX format files contain positions in a
-projected coordinate system rather than longitude and latitude in geographic
-coordinates. Generally, the HSX files do not contain any description of the projection
-used to obtain the eastings and northings in those files. This option allows a
-user to specifiy the projection used to translate the eastings and northings back
-into longitude and latitude. If this option is not specified, <B>MB-System</B> will
-assume the data are associated with UTM zone 1 north. The projection identifier must
-conform to the same usage as with projections specified for <B>mbgrid</B>.
-For  instance, to fully specify a particular northern UTM zone, set projection = UTMXXN
-where XX gives the UTM zone (defined from 01 to 60). As an example, a northern UTM
-zone 12 projection can be specified using -JUTM12N.  Southern UTM zones are specified as
-UTMXXS. The European Petroleum Survey Group (EPSG) has defined a large number of PCS's
-used worldwide and assigned number id's to each; one can also specify the northern
-UTM zone 12 projection using its EPSG designation, or -Jepsg32612. The complete list
-of projected coordinate systems supported by <B>MB-System</B> is given in the <B>mbgrid</B>
-manual page.
-<DT><B>-L</B>
-
-<DD>
-<BR>
-
-This option causes the program to list the timetags of bathymetry,
-navigation, attitude, and other data records.
-<DT><B>-M</B>
-
-<DD>
-<I>navformat</I>
-<BR>
-
-Sets the input navigation file format used by the file specified with the
-<B>-N</B> option.
-<BR> At present, the only option for the navigation file format is <I>navformat</I>=1:
-<BR>    yyyy:mm:dd:hh:mm:ss.sss sssss.sss eeeeeeee.eee nnnnnnnn.nnn zzzz.zzz aaa.aaa hhh.hhh
-<BR>
-
-where yyyy=year, mm=month, dd=day, hh=hour, mm=minute, ss.sss = seconds, sssss.sss = seconds
-from the start of the year, eeeeeeee.eee = easting in meters, nnnnnnnnn.nnn = northing in
-meters, zzzz.zzz = sonar depth in meters, and hhh.hhh = heading in degrees.
-Default: <I>navformat</I>=1.
-<DT><B>-N</B>
-
-<DD>
-<I>navfile</I>
-<BR>
-
-The program will read navigation from the file <I>navfile</I>
-and merge those data with the multibeam data in the HSX file.
-If a timelag model is specified using
-<B>-T</B><I>timelag</I>, the time lag will be applied to the navigation and
-attitude data before merging with the sonar data. The navigation and attitude
-data from <I>navfile</I> will also be embedded in asynchronous data records
-in the output format 201 data. Any pre-existing navigation data records will
-remain unchanged in the data stream. However, the HSX file header will be altered
-to show the newly merged data as "enabled" and the original, asynchronous data
-as not enabled.
-<DT><B>-T</B>
-
-<DD>
-<I>timelag</I>
-<BR>
-
-This option specifies a <I>timelag</I> value in seconds to be applied
-to the navigation and attitude data prior to it being merged with the
-bathymetry. If <I>timelag</I> is a valid path to a file containing time
-stamp and time lag pairs, then these data will be read and the time lag
-applied to particular records will be interpolated by time.
-<DT><B>-V</B>
-
-<DD>
-This option increases the verbosity of <B>mbhysweeppreprocess</B> with
-respect to informational output to the shell.
-<P>
-</DL>
-<A NAME="lbAH"> </A>
-<H2>EXAMPLES</H2>
-
-Suppose that one has logged a set of five HSX files incorporating
-multibeam sonar data, navigation, attitude, heading, and altitude data,
-but not sonar depth data, all from an ROV platform. Further suppose
-that a datalist file named datalist_hsx.mb-1 references those
-files, and that a separate text file named  ROVnav.txt includes
-an improved vehicle navigation, including the sonar depth. Finally,
-suppose that the existing sensor offsets are known, but have not
-been applied to any of the existing data
-<BR>
-
-In order to merge the better navigation and sonar depth before
-starting MB-System processing, do something like:
-<BR>
-
-<BR>    mbhysweeppreprocess -I datalist_hsx.mb-1             -A1/0.42/2.005/-1.34/0.0             -A2/0.46/0.22/0.55/0.0             -A3/0.46/0.22/0.55/0.0             -JUTM01N -NROVnav.txt
-<BR>
-
-The program will output something like the following:
-<BR>    Data available for merging:
-<BR>        Navigation (northing easting sonardepth altitude heading): 120959
-<BR>        Sonar depth (sonardepth):                                  0
-<BR>        Time lag:                                                  0
-<P>
-<BR>    Offsets to be applied:
-<BR>           X (m)   Y (m)   Z (m)   T (sec)
-<BR>         Roll bias:       0.000
-<BR>         Pitch bias:      0.000
-<BR>         Heading bias:    0.000
-<BR>         Sonar:    0.420    2.005   -1.340    0.000
-<BR>         MRU:      0.420    2.005   -1.340    0.000
-<BR>         Nav:      0.420    2.005   -1.340    0.000
-<P>
-<BR>    Data records read from: 000_2004.HSX
-<BR>         Positions (POS):                   2651
-<BR>         Positions ignored (POS):           0
-<BR>         Heading (GYR):                     19486
-<BR>         Attitude (HCP):                    15752
-<BR>         Echosounder (altitude) (EC1):      2651
-<BR>         Dynamic draft (DFT):               0
-<BR>         Raw multibeam (RMB):               24438
-<BR>         Other:                             64978
-<P>
-<BR>    Data records read from: 000_2048.HSX
-<BR>         Positions (POS):                   2967
-<BR>         Positions ignored (POS):           0
-<BR>         Heading (GYR):                     21942
-<BR>         Attitude (HCP):                    17771
-<BR>         Echosounder (altitude) (EC1):      2967
-<BR>         Dynamic draft (DFT):               0
-<BR>         Raw multibeam (RMB):               25363
-<BR>         Other:                             71010
-<P>
-<BR>    Data records read from: 000_2138.HSX
-<BR>         Positions (POS):                   2573
-<BR>         Positions ignored (POS):           0
-<BR>         Heading (GYR):                     18936
-<BR>         Attitude (HCP):                    15307
-<BR>         Echosounder (altitude) (EC1):      2573
-<BR>         Dynamic draft (DFT):               0
-<BR>         Raw multibeam (RMB):               23398
-<BR>         Other:                             62787
-<P>
-<BR>    Data records read from: 000_2221.HSX
-<BR>         Positions (POS):                   2824
-<BR>         Positions ignored (POS):           0
-<BR>         Heading (GYR):                     20863
-<BR>         Attitude (HCP):                    16907
-<BR>         Echosounder (altitude) (EC1):      2824
-<BR>         Dynamic draft (DFT):               0
-<BR>         Raw multibeam (RMB):               23993
-<BR>         Other:                             67411
-<P>
-<BR>    Data records read from: 000_2308.HSX
-<BR>         Positions (POS):                   2657
-<BR>         Positions ignored (POS):           0
-<BR>         Heading (GYR):                     19571
-<BR>         Attitude (HCP):                    15818
-<BR>         Echosounder (altitude) (EC1):      2657
-<BR>         Dynamic draft (DFT):               0
-<BR>         Raw multibeam (RMB):               24009
-<BR>         Other:                             64712
-<P>
-<BR>    Total data records read from: datalist_hsx.mb-1
-<BR>         Positions (POS):                   13672
-<BR>         Positions ignored (POS):           0
-<BR>         Heading (GYR):                     100798
-<BR>         Attitude (HCP):                    81555
-<BR>         Echosounder (altitude) (EC1):      13672
-<BR>         Dynamic draft (DFT):               0
-<BR>         Raw multibeam (RMB):               121201
-<BR>         Other:                             330898
-<P>
-<BR>    Data records written to: 000_2004.mb201
-<BR>         Positions (POS):                   2651
-<BR>         Positions ignored (POS):           0
-<BR>         Heading (GYR):                     19486
-<BR>         Attitude (HCP):                    15752
-<BR>         Echosounder (altitude) (EC1):      2651
-<BR>         Dynamic draft (DFT):               0
-<BR>         Raw multibeam (RMB):               24438
-<BR>         Other:                             0
-<P>
-<BR>    Data records written to: 000_2048.mb201
-<BR>         Positions (POS):                   2967
-<BR>         Positions ignored (POS):           0
-<BR>         Heading (GYR):                     21942
-<BR>         Attitude (HCP):                    17771
-<BR>         Echosounder (altitude) (EC1):      2967
-<BR>         Dynamic draft (DFT):               0
-<BR>         Raw multibeam (RMB):               25363
-<BR>         Other:                             0
-<P>
-<BR>    Data records written to: 000_2138.mb201
-<BR>         Positions (POS):                   2573
-<BR>         Positions ignored (POS):           0
-<BR>         Heading (GYR):                     18936
-<BR>         Attitude (HCP):                    15307
-<BR>         Echosounder (altitude) (EC1):      2573
-<BR>         Dynamic draft (DFT):               0
-<BR>         Raw multibeam (RMB):               23398
-<BR>         Other:                             0
-<P>
-<BR>    Data records written to: 000_2221.mb201
-<BR>         Positions (POS):                   2824
-<BR>         Positions ignored (POS):           0
-<BR>         Heading (GYR):                     20863
-<BR>         Attitude (HCP):                    16907
-<BR>         Echosounder (altitude) (EC1):      2824
-<BR>         Dynamic draft (DFT):               0
-<BR>         Raw multibeam (RMB):               23993
-<BR>         Other:                             0
-<P>
-<BR>    Data records written to: 000_2308.mb201
-<BR>         Positions (POS):                   2657
-<BR>         Positions ignored (POS):           0
-<BR>         Heading (GYR):                     19571
-<BR>         Attitude (HCP):                    15818
-<BR>         Echosounder (altitude) (EC1):      2657
-<BR>         Dynamic draft (DFT):               0
-<BR>         Raw multibeam (RMB):               24009
-<BR>         Other:                             0
-<P>
-<BR>    Total data records written from: datalist_hsx.mb-1
-<BR>         Positions (POS):                   13672
-<BR>         Positions ignored (POS):           0
-<BR>         Heading (GYR):                     100798
-<BR>         Attitude (HCP):                    81555
-<BR>         Echosounder (altitude) (EC1):      13672
-<BR>         Dynamic draft (DFT):               0
-<BR>         Raw multibeam (RMB):               121201
-<BR>         Other:                             0
-<P>
-<A NAME="lbAI"> </A>
-<H2>SEE ALSO</H2>
-
-<B><A HREF="mbsystem.html">mbsystem</A></B>(1), <B><A HREF="mbformat.html">mbformat</A></B>(1), <B><A HREF="mbinfo.html">mbinfo</A></B>(1)
-<P>
-<A NAME="lbAJ"> </A>
-<H2>BUGS</H2>
-
-At this point, the HSX i/o module and preprocessor are only tested with a single
-survey of R2Sonic data.
-<P>
-
-<HR>
-<A NAME="index"> </A><H2>Index</H2>
-<DL>
-<DT><A HREF="#lbAB">NAME</A><DD>
-<DT><A HREF="#lbAC">VERSION</A><DD>
-<DT><A HREF="#lbAD">SYNOPSIS</A><DD>
-<DT><A HREF="#lbAE">DESCRIPTION</A><DD>
-<DT><A HREF="#lbAF">AUTHORSHIP</A><DD>
-<DT><A HREF="#lbAG">OPTIONS</A><DD>
-<DT><A HREF="#lbAH">EXAMPLES</A><DD>
-<DT><A HREF="#lbAI">SEE ALSO</A><DD>
-<DT><A HREF="#lbAJ">BUGS</A><DD>
-</DL>
-<HR>
-</PRE>
-
-<CENTER><P><BR>
-Last Updated: 3 June 2013</P></CENTER>
-
-<HR>
-<P><A HREF="mbsystem_man_list.html">Return to list of MB-System manual pages...</A></P>
-<P><A HREF="mbsystem_home.html"><IMG SRC="mbsystem_logo_small.gif" BORDER=0 HEIGHT=55 WIDTH=158 ALIGN=BOTTOM></A><A HREF="mbsystem_home.html">Back
-to MB-System Home Page...</A></P>
-
-</BODY>
-</HTML>
diff --git a/src/html/mbinfo.html b/src/html/mbinfo.html
deleted file mode 100644
index 92d87c5..0000000
--- a/src/html/mbinfo.html
+++ /dev/null
@@ -1,564 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<HTML VERSION="2.0">
-<HEAD>
-   <TITLE>MB-System Unix Manual Page: mbinfo</TITLE>
-<!-- WEBMAGIC VERSION NUMBER="2.0.2" -->
-<!-- WEBMAGIC TRANSLATION NAME="ServerRoot" SRC="/var/www/htdocs/" DST="/" -->
-<!-- WEBMAGIC TRANSLATION NAME="ProjectRoot" SRC="./" DST="" -->
-</HEAD>
-<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#336699" VLINK="#997040" ALINK="#CC9900">
-<BODY>
-<CENTER><H3><U>MB-System Unix Manual Page</U></H3></CENTER>
-<PRE>
-<H1>mbinfo</H1>
-Section:  MB-System 5.0  (1)<BR>Updated:  3 June 2013 <BR><A HREF="#index">Index</A>
-<HR>
-
-<A NAME="lbAB"> </A>
-<H2>NAME</H2>
-
-<B>mbinfo</B> - Output some basic statistics of swath sonar data files.
-<P>
-<A NAME="lbAC"> </A>
-<H2>VERSION</H2>
-
-Version 5.0
-<P>
-<A NAME="lbAD"> </A>
-<H2>SYNOPSIS</H2>
-
-<B>mbinfo</B> [<B>-B</B><I>yr/mo/da/hr/mn/sc</I> <B>-C -E</B><I>yr/mo/da/hr/mn/sc</I>
-<B>-F</B><I>format</I> <B>-G</B> <B>-I</B><I>filename</I>
-<B>-L</B><I>lonflip</I> <B>-M</B><I>londim/latdim</I>
-<B>-N</B> <B>-O</B> <B>-P</B><I>ping</I>
-<B>-R</B><I>west/east/south/north</I> <B>-S</B><I>speed</I> <B>-W</B>
-<B>-X</B><I>outputformat</I> <B>-V -H</B>]
-<P>
-<A NAME="lbAE"> </A>
-<H2>DESCRIPTION</H2>
-
-<B>MBinfo</B> is a utility for reading a swath sonar data file
-or files and outputting some basic statistics.  The table generated
-shows the filename, the data format id, a brief description of
-the format, any metadata that have been inserted into the data,
-data counts, navigation totals, time and navigation
-of the first and last data records, minimum and maximum
-data values, and the geographic bounding box of the data.
-The data counts include the total number of bathymetry,
-amplitude, and sidescan values read. These totals may be less
-than the maximum possible (number of data records times the
-maximum number of data supported for the particular data format)
-for formats supporting variable numbers of beams or pixels.
-Also reported are the numbers and percentages of good, zero,
-and flagged data values (good values are those which are neither
-zero nor flagged as bad).
-<P>
-An important function  of <B>mbinfo</B> is to generate ".inf"
-files that may be parsed by other <B>MB-System</B> programs
-and macros. Programs such as <B>mbgrid</B> and <B>mbmosaic</B>,
-read ".inf" files, when available, to
-determine whether input swath data files actually contain
-any data in the area of interest. The efficiency of these
-programs is enhanced by their ability to avoid reading files
-with no data in the area to be gridded or mosaiced. Programs
-such as <B>mbm_plot</B> and <B>mbm_grid</B> run <B>mbinfo</B> on
-input files to determine the data bounds. The availability
-of ".inf" files allows this information to be determined without
-having to read through each swath file.To create an ".inf" file, simply direct the
-output of <B>mbinfo</B> to a file named by adding the
-suffix ".inf" to the input swath
-data filename. This can also be accomplished using the <B>-O</B>
-option of <B>mbinfo</B>, or the <B>-N</B> and <B>-O</B> options of
-<B>mbdatalist</B>.
-<P>
-Data archives use metadata harvesting tools that often work better with
-information structured for machine parsing rather than for easy
-reading by humans. To output a variant of "*.inf" files in the JSON
-format (with "_inf.json" suffixes), use the <B>-X</B><I>1</I> option.
-Similarly, specifying the <B>-X</B><I>2</I> option will result in XML
-output in files with "_xml.inf" suffixes.
-<P>
-The program <B>mbprocess</B> can insert metadata recognized
-and printed by <B>mbinfo</B>. These metadata include items
-such as the sonar model, the vessel name, and bias parameters.
-See the <B>mbprocess</B> and
-<B>mbset</B> manual pages for details.
-<P>
-The data input may be averaged over several pings
-and/or windowed in time and space.  Comments in the data
-stream may also be printed out.
-The results are dumped to stdout.
-<P>
-If pings are averaged (<I>pings</I> > 2)
-<B>mbinfo</B> estimates the variance for each of the bathymetry beams
-and sidescan pixels
-by reading a set number of pings and then finding the
-variance of the values for each beam.  The bathymetry values are
-detrended before variances are calculated.
-<P>
-The program output can also be extended to include a coarse
-mask representing where data lies within the file's bounding
-box. This mask is shown as a table of 0's and 1's, where
-the 1's indicate bins with data. The dimensions of the mask
-are specified with the <B>-M</B><I>londim/latdim</I> option.
-For instance, if the user specifies <B>-M</B><I>10/10</I>, then
-<B>mbinfo</B> will read through the data once to establish the
-usual statistics, including the data bounding box. Then, the
-program will initialize a 10 X 10 grid with the minimum and
-maximum longitude and latitude of the bounding box, and
-read the data a second time. Each bin in which a sounding or
-pixel falls will be set to 1. After the second reading pass,
-the data location mask will be output at the end of the
-<B>mbinfo</B> output.
-<P>
-<A NAME="lbAF"> </A>
-<H2>AUTHORSHIP</H2>
-
-David W. Caress (<A HREF="mailto:caress at mbari.org">caress at mbari.org</A>)
-<BR>
-
-<BR>  Monterey Bay Aquarium Research Institute
-<BR>
-
-Dale N. Chayes (<A HREF="mailto:dale at ldeo.columbia.edu">dale at ldeo.columbia.edu</A>)
-<BR>
-
-<BR>  Lamont-Doherty Earth Observatory
-<P>
-<A NAME="lbAG"> </A>
-<H2>OPTIONS</H2>
-
-<DL COMPACT>
-<DT><B>-B</B>
-
-<DD>
-<I>yr/mo/da/hr/mn/sc</I>
-<BR>
-
-This option sets the starting time for data allowed in the input data.
-The <B>-E</B> option sets the ending time for data. If the
-starting time is before the ending time, then any data
-with a time stamp before the starting time or after the
-ending time is ignored. If instead the starting time is
-after the ending time, then any data between the ending
-and starting time will be ignored. This scheme allows time
-windowing both inside and outside a specified interval.
-Default: <I>yr/mo/da/hr/mn/sc</I> = 1962/2/21/10/30/0.
-<DT><B>-C</B>
-
-<DD>
-Normally, <B>mbinfo</B> ignores comments encountered in the
-data file.  If the <B>-C</B> flag is given, all of the comments will be
-printed out.
-<DT><B>-E</B>
-
-<DD>
-<I>yr/mo/da/hr/mn/sc</I>
-<BR>
-
-This option sets the ending time for data allowed in the input data.
-The <B>-B</B> option sets the starting time for data. If the
-starting time is before the ending time, then any data
-with a time stamp before the starting time or after the
-ending time is ignored. If instead the starting time is
-after the ending time, then any data between the ending
-and starting time will be ignored. This scheme allows time
-windowing both inside and outside a specified interval.
-Default: <I>yr/mo/da/hr/mn/sc</I> = 2062/2/21/10/30/0.
-<DT><B>-F</B>
-
-<DD>
-<I>format</I>
-<BR>
-
-Sets the data format used if the input is read from stdin
-or from a file. If <I>format</I> < 0, then the input file specified
-with the <B>-I</B> option will actually contain a list of input swath sonar
-data files. This program uses the <B>MBIO</B> library
-and will read or write any swath sonar
-format supported by <B>MBIO</B>. A list of the swath sonar data formats
-currently supported by <B>MBIO</B> and their identifier values
-is given in the <B>MBIO</B> manual page. The default format is
-set using <B>mbdefaults</B>.
-<DT><B>-G</B>
-
-<DD>
-Enables checking for reasonable navigation to be used in
-calculating the minimum and maximum longitude and latitude values.
-This mode excludes longitude and latitude values of 0.0 or
-those values associated with very large apparent speeds
-between pings (calculated using distance and time differences
-between adjacent pings). This option is particularly useful
-when one is trying to obtain reasonable bounds for a plot.
-<DT><B>-H</B>
-
-<DD>
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-<DT><B>-I</B>
-
-<DD>
-<I>filename</I>
-<BR>
-
-Sets the input filename. If <I>format</I> > 0 (set with the
-<B>-f</B> option) then the swath sonar data contained in <I>infile</I>
-is read and processed. If <I>format</I> < 0, then <I>infile</I>
-is assumed to be an ascii file containing a list of the input swath sonar
-data files to be processed and their formats.  The program will read
-the data in each one of these files.
-In the <I>infile</I> file, each
-data file should be followed by a data format identifier, e.g.:
-<BR> <TT>       </TT>datafile1 11<BR>
-<BR> <TT>       </TT>datafile2 24<BR>
-<BR>
-
-This program uses the <B>MBIO</B> library and will read or write any swath sonar
-format supported by <B>MBIO</B>. A list of the swath sonar data formats
-currently supported by <B>MBIO</B> and their identifier values
-is given in the <B>MBIO</B> manual page. Default: <I>infile</I> = "stdin".
-<DT><B>-L</B>
-
-<DD>
-<I>lonflip</I>
-<BR>
-
-Sets the range of the longitude values returned.
-If <I>lonflip</I>=-1 then the longitude values will be in
-the range from -360 to 0 degrees. If <I>lonflip</I>=0
-then the longitude values will be in
-the range from -180 to 180 degrees. If <I>lonflip</I>=1
-then the longitude values will be in
-the range from 0 to 360 degrees.
-Default: <B>mbinfo</B> selects the bext longitude range based
-on the first data.
-<DT><B>-M</B>
-
-<DD>
-<I>londim/latdim</I>
-<BR>
-
-The program output can be extended to include a coarse
-mask representing where data lies within the file's bounding
-box. This mask is shown as a table of 0's and 1's, where
-the 1's indicate bins with data. The dimensions of the mask
-are specified with the <B>-M</B><I>londim/latdim</I> option.
-<DT><B>-N</B>
-
-<DD>
-<BR>
-
-Extends the program output to include notices. These notices
-include three sections. The first is a list of all of the
-data record types (e.g. survey, comment, navigation, parameter)
-encountered while reading the file. Some formats are quite simple
-and only include survey records and comments. Other formats
-are complex and may contain many different sorts of data
-records, including some that only derive from a particular
-sonar model. The second section lists any nonfatal error messages
-(e.g. unintelligible record) generated while reading the
-file. Finally, the third section of notices lists any
-particular problems with the data that have been identified
-(e.g. some navigation is zero or some depths are too large
-to be correct).
-<DT><B>-O</B>
-
-<DD>
-<BR>
-
-This option causes the program output to be directed to
-"inf" files rather than to stdout. Each "inf" file is named
-using the original data file path with an ".inf" suffix appended.
-<DT><B>-P</B>
-
-<DD>
-<I>pings</I>
-<BR>
-
-Turns on variance calculations for the bathymetry, amplitude,
-and sidescan data (as available in the data stream).  If
-<I>pings</I> = 1, then no variance calculations are made.  If
-<I>pings</I> > 1, then variances are calculated for each beam
-and pixel using groups of <I>pings</I> values.  The bathymetry
-values are detrended before the variances are calculated;
-the amplitude and sidescan values are not detrended.  The
-variance calculations can provide crude measures of noise
-and/or signal as a function of beam and pixel number.
-Default: <I>pings</I> = 1 (no variance calculations).
-<DT><B>-R</B>
-
-<DD>
-<I>west/east/south/north</I>
-<BR>
-
-Sets the longitude and latitude bounds within which swath sonar
-data will be read. Only the data which lies within these bounds will
-be read.
-Default: <I>west</I>=-360, east<I>=360</I>, <I>south</I>=-90, <I>north</I>=90.
-<DT><B>-S</B>
-
-<DD>
-<I>speed</I>
-<BR>
-
-Sets the minimum speed in km/hr (5.5 kts ~ 10 km/hr) allowed in
-the input data; pings associated with a smaller ship speed will not be
-copied. Default: <I>speed</I> = 0.
-<DT><B>-T</B>
-
-<DD>
-<I>timegap</I>
-<BR>
-
-Sets the maximum time gap in minutes between adjacent pings allowed before
-the data is considered to have a gap. Default: <I>timegap</I> = 1.
-<DT><B>-V</B>
-
-<DD>
-Normally, <B>mbinfo</B> only prints out the statistics obtained
-by reading all of the data.  If the
-<B>-V</B> flag is given, then <B>mbinfo</B> works in a "verbose" mode and
-outputs the program version being used and all read error status messages.
-<DT><B>-W</B>
-
-<DD>
-Normally, <B>mbinfo</B> reports depth values in meters. If the
-<B>-W</B> flag is given, then <B>mbinfo</B> reports these values
-in feet.
-<DT><B>-X</B>
-
-<DD>
-<I>outputformat</I>
-<BR>
-
-Normally, <B>mbinfo</B> reports information as text formatted for easy
-reading. If this option is given with <I>outputformat</I>=1, then the
-output will be in the JSON format. If the <B>-O</B> option is used to
-explicitly make "*.inf" files, then the output will be JSON and the output
-filenames will be named using the original data file path with an "_inf.json"
-suffix appended. If this option is given with <I>outputformat</I>=2, then the
-output will be in the XML format. If the <B>-O</B> option is used to
-explicitly make "*.inf" files, then the output will be XML and the output
-filenames will be named using the original data file path with an "_inf.xml"
-suffix appended.
-<P>
-</DL>
-<A NAME="lbAH"> </A>
-<H2>EXAMPLES</H2>
-
-Suppose one wishes to know something about the contents of
-a Hydrosweep file (format 24) called example_hs.mb24.
-The following will suffice:
-<BR> <TT>       </TT>mbinfo -F24 -Iexample_hs.mb24<BR>
-<P>
-The following output is produced:
-<P>
-<P>
-<BR> Swath Data File:      example_hs.mb24
-<BR> MBIO Data Format ID:  24
-<BR> Format name:          MBF_HSLDEOIH
-<BR> Informal Description: L-DEO in-house binary Hydrosweep
-<BR> Attributes:           Hydrosweep DS, 59 beams, bathymetry and amplitude,
-<BR>                       binary, centered, L-DEO.
-<P>
-<BR> Data Totals:
-<BR> Number of Records:              263
-<BR> Bathymetry Data (59 beams):
-<BR>   Number of Beams:            15517
-<BR>   Number of Good Beams:       13661     88.04%
-<BR>   Number of Zero Beams:         868      5.59%
-<BR>   Number of Flagged Beams:      988      6.37%
-<BR> Amplitude Data (59 beams):
-<BR>   Number of Beams:            15517
-<BR>   Number of Good Beams:       13661     88.04%
-<BR>   Number of Zero Beams:         868      5.59%
-<BR>   Number of Flagged Beams:      988      6.37%
-<BR> Sidescan Data (0 pixels):
-<BR>   Number of Pixels:               0
-<BR>   Number of Good Pixels:          0      0.00%
-<BR>   Number of Zero Pixels:          0      0.00%
-<BR>   Number of Flagged Pixels:       0      0.00%
-<P>
-<BR> Navigation Totals:
-<BR> Total Time:             1.2425 hours
-<BR> Total Track Length:    20.9421 km
-<BR> Average Speed:         16.8548 km/hr ( 9.1107 knots)
-<P>
-<BR> Start of Data:
-<BR> Time:  08 14 1993 18:00:25.000000  JD226
-<BR> Lon:  -49.3011     Lat:   12.1444     Depth:  4920.0000 meters
-<BR> Speed: 18.3600 km/hr ( 9.9243 knots)  Heading:  97.2000 degrees
-<BR> Sonar Depth:    0.0000 m  Sonar Altitude: 4920.0000 m
-<P>
-<BR> End of Data:
-<BR> Time:  08 14 1993 19:14:58.000000  JD226
-<BR> Lon:  -49.1111     Lat:   12.1149     Depth:  5021.0000 meters
-<BR> Speed: 17.2800 km/hr ( 9.3405 knots)  Heading:  97.0000 degrees
-<BR> Sonar Depth:    0.0000 m  Sonar Altitude: 5021.0000 m
-<P>
-<BR> Limits:
-<BR> Minimum Longitude:     -49.3061   Maximum Longitude:     -49.1064
-<BR> Minimum Latitude:       12.0750   Maximum Latitude:       12.1806
-<BR> Minimum Sonar Depth:     0.0000   Maximum Sonar Depth:     0.0000
-<BR> Minimum Altitude:     4087.0000   Maximum Altitude:     5034.0000
-<BR> Minimum Depth:        3726.0000   Maximum Depth:        5190.0000
-<BR> Minimum Amplitude:     100.0000   Maximum Amplitude:    6380.0000
-<P>
-<P>
-Suppose we wanted to know how noisy the outer beams are relative
-to the inner beams.  We might try:
-<BR> <TT>       </TT>mbinfo -F24 -P5 -Iexample_hs.mb24<BR>
-<P>
-obtaining:
-<P>
-<BR> Swath Data File:      example_hs.mb24
-<BR> MBIO Data Format ID:  24
-<BR> Format name:          MBF_HSLDEOIH
-<BR> Informal Description: L-DEO in-house binary Hydrosweep
-<BR> Attributes:           Hydrosweep DS, 59 beams, bathymetry and amplitude,
-<BR>                       binary, centered, L-DEO.
-<P>
-<BR> Data Totals:
-<BR> Number of Records:              263
-<BR> Bathymetry Data (59 beams):
-<BR>   Number of Beams:            15517
-<BR>   Number of Good Beams:       13661     88.04%
-<BR>   Number of Zero Beams:         868      5.59%
-<BR>   Number of Flagged Beams:      988      6.37%
-<BR> Amplitude Data (59 beams):
-<BR>   Number of Beams:            15517
-<BR>   Number of Good Beams:       13661     88.04%
-<BR>   Number of Zero Beams:         868      5.59%
-<BR>   Number of Flagged Beams:      988      6.37%
-<BR> Sidescan Data (0 pixels):
-<BR>   Number of Pixels:               0
-<BR>   Number of Good Pixels:          0      0.00%
-<BR>   Number of Zero Pixels:          0      0.00%
-<BR>   Number of Flagged Pixels:       0      0.00%
-<P>
-<BR> Navigation Totals:
-<BR> Total Time:             1.2425 hours
-<BR> Total Track Length:    20.9421 km
-<BR> Average Speed:         16.8548 km/hr ( 9.1107 knots)
-<P>
-<BR> Start of Data:
-<BR> Time:  08 14 1993 18:00:25.000000  JD226
-<BR> Lon:  -49.3011     Lat:   12.1444     Depth:  4920.0000 meters
-<BR> Speed: 18.3600 km/hr ( 9.9243 knots)  Heading:  97.2000 degrees
-<BR> Sonar Depth:    0.0000 m  Sonar Altitude: 4920.0000 m
-<P>
-<BR> End of Data:
-<BR> Time:  08 14 1993 19:14:58.000000  JD226
-<BR> Lon:  -49.1111     Lat:   12.1149     Depth:  5021.0000 meters
-<BR> Speed: 17.2800 km/hr ( 9.3405 knots)  Heading:  97.0000 degrees
-<BR> Sonar Depth:    0.0000 m  Sonar Altitude: 5021.0000 m
-<P>
-<BR> Limits:
-<BR> Minimum Longitude:     -49.3061   Maximum Longitude:     -49.1064
-<BR> Minimum Latitude:       12.0750   Maximum Latitude:       12.1806
-<BR> Minimum Sonar Depth:     0.0000   Maximum Sonar Depth:     0.0000
-<BR> Minimum Altitude:     4087.0000   Maximum Altitude:     5034.0000
-<BR> Minimum Depth:        3726.0000   Maximum Depth:        5190.0000
-<BR> Minimum Amplitude:     100.0000   Maximum Amplitude:    6380.0000
-<P>
-<BR> Beam Bathymetry Variances:
-<BR> Pings Averaged: 5
-<BR>  Beam     N      Mean     Variance    Sigma
-<BR>  ----     -      ----     --------    -----
-<BR>    0      0       0.00       0.00      0.00
-<BR>    1      0       0.00       0.00      0.00
-<BR>    2    110    4719.59     342.69     18.51
-<BR>    3    105    4779.49     399.15     19.98
-<BR>    4    155    4748.81     280.18     16.74
-<BR>    5    155    4817.12     194.62     13.95
-<BR>    6    150    4826.44     197.76     14.06
-<BR>    7    160    4863.82     155.50     12.47
-<BR>    8    215    4806.08     229.11     15.14
-<BR>    9    235    4807.09     220.23     14.84
-<BR>   10    240    4766.29     158.83     12.60
-<BR>   11    250    4764.34     221.09     14.87
-<BR>   12    245    4765.35     146.24     12.09
-<BR>   13    250    4782.02     167.34     12.94
-<BR>   14    240    4798.38      92.98      9.64
-<BR>   15    245    4775.16      98.27      9.91
-<BR>   16    225    4782.35     136.30     11.67
-<BR>   17    210    4820.37      80.70      8.98
-<BR>   18    215    4821.15      80.97      9.00
-<BR>   19    215    4827.71      76.20      8.73
-<BR>   20    195    4842.65      84.22      9.18
-<BR>   21    190    4843.02     155.87     12.48
-<BR>   22    185    4884.28      73.69      8.58
-<BR>   23    175    4885.21      69.88      8.36
-<BR>   24    175    4871.47      52.01      7.21
-<BR>   25    180    4871.92      34.71      5.89
-<BR>   26    200    4830.80      36.83      6.07
-<BR>   27    205    4835.16      33.47      5.79
-<BR>   28    210    4809.96      43.07      6.56
-<BR>   29    190    4850.77      40.97      6.40
-<BR>   30    240    4768.69      64.23      8.01
-<BR>   31    240    4772.90      74.44      8.63
-<BR>   32    245    4760.11      57.97      7.61
-<BR>   33    255    4734.01      81.72      9.04
-<BR>   34    255    4728.19      82.21      9.07
-<BR>   35    260    4722.94      83.45      9.14
-<BR>   36    260    4721.95     102.02     10.10
-<BR>   37    260    4713.48      83.85      9.16
-<BR>   38    250    4715.40     101.33     10.07
-<BR>   39    255    4722.56     118.20     10.87
-<BR>   40    250    4727.48     109.13     10.45
-<BR>   41    255    4734.96     127.97     11.31
-<BR>   42    255    4724.53     124.06     11.14
-<BR>   43    230    4744.74     122.96     11.09
-<BR>   44    225    4752.16      98.22      9.91
-<BR>   45    230    4692.27     107.96     10.39
-<BR>   46    240    4696.93      95.93      9.79
-<BR>   47    230    4699.80     129.08     11.36
-<BR>   48    225    4696.32     145.20     12.05
-<BR>   49    220    4681.50     140.29     11.84
-<BR>   50    210    4676.16     103.35     10.17
-<BR>   51    180    4627.31     105.22     10.26
-<BR>   52    200    4654.55     207.85     14.42
-<BR>   53    130    4665.82     250.97     15.84
-<BR>   54    185    4704.29     300.80     17.34
-<BR>   55    135    4731.13     218.16     14.77
-<BR>   56    150    4736.29     178.16     13.35
-<BR>   57    115    4691.45     217.31     14.74
-<BR>   58      0       0.00       0.00      0.00
-<P>
-<A NAME="lbAI"> </A>
-<H2>SEE ALSO</H2>
-
-<B><A HREF="mbsystem.html">mbsystem</A></B>(1)
-<P>
-<A NAME="lbAJ"> </A>
-<H2>BUGS</H2>
-
-No bugs, only features. Maybe too many features...
-<P>
-
-<HR>
-<A NAME="index"> </A><H2>Index</H2>
-<DL>
-<DT><A HREF="#lbAB">NAME</A><DD>
-<DT><A HREF="#lbAC">VERSION</A><DD>
-<DT><A HREF="#lbAD">SYNOPSIS</A><DD>
-<DT><A HREF="#lbAE">DESCRIPTION</A><DD>
-<DT><A HREF="#lbAF">AUTHORSHIP</A><DD>
-<DT><A HREF="#lbAG">OPTIONS</A><DD>
-<DT><A HREF="#lbAH">EXAMPLES</A><DD>
-<DT><A HREF="#lbAI">SEE ALSO</A><DD>
-<DT><A HREF="#lbAJ">BUGS</A><DD>
-</DL>
-<HR>
-</PRE>
-
-<CENTER><P><BR>
-Last Updated: 3 June 2013</P></CENTER>
-
-<HR>
-<P><A HREF="mbsystem_man_list.html">Return to list of MB-System manual pages...</A></P>
-<P><A HREF="mbsystem_home.html"><IMG SRC="mbsystem_logo_small.gif" BORDER=0 HEIGHT=55 WIDTH=158 ALIGN=BOTTOM></A><A HREF="mbsystem_home.html">Back
-to MB-System Home Page...</A></P>
-
-</BODY>
-</HTML>
diff --git a/src/html/mbio.html b/src/html/mbio.html
deleted file mode 100644
index 4393744..0000000
--- a/src/html/mbio.html
+++ /dev/null
@@ -1,4213 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<HTML VERSION="2.0">
-<HEAD>
-   <TITLE>MB-System Unix Manual Page: mbio</TITLE>
-<!-- WEBMAGIC VERSION NUMBER="2.0.2" -->
-<!-- WEBMAGIC TRANSLATION NAME="ServerRoot" SRC="/var/www/htdocs/" DST="/" -->
-<!-- WEBMAGIC TRANSLATION NAME="ProjectRoot" SRC="./" DST="" -->
-</HEAD>
-<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#336699" VLINK="#997040" ALINK="#CC9900">
-<BODY>
-<CENTER><H3><U>MB-System Unix Manual Page</U></H3></CENTER>
-<PRE>
-<H1>mbio</H1>
-Section:  MB-System 5.0  (3)<BR>Updated:  3 June 2013 <BR><A HREF="#index">Index</A>
-<HR>
-
-<P>
-<A NAME="lbAB"> </A>
-<H2>NAME</H2>
-
-<B>mbio</B> - Format independent input/output library for swath mapping sonar data.
-<P>
-<A NAME="lbAC"> </A>
-<H2>VERSION</H2>
-
-Version 5.0
-<P>
-<A NAME="lbAD"> </A>
-<H2>DESCRIPTION</H2>
-
-<B>MBIO</B> (<B>M</B>ulti<B>B</B>eam <B>I</B>nput/<B>O</B>utput) is a library
-of functions used for reading and writing swath mapping sonar
-data files.  <B>MBIO</B> supports a large number of data
-formats associated with different institutions and different sonar systems.
-The purpose of <B>MBIO</B> is to allow users to write processing and display
-programs which are independent of particular data formats and to provide
-a standard approach to swath mapping sonar data i/o.
-<P>
-<A NAME="lbAE"> </A>
-<H2>AUTHORSHIP</H2>
-
-David W. Caress (<A HREF="mailto:caress at mbari.org">caress at mbari.org</A>)
-<BR>
-
-<BR>  Monterey Bay Aquarium Research Institute
-<BR>
-
-Dale N. Chayes (<A HREF="mailto:dale at ldeo.columbia.edu">dale at ldeo.columbia.edu</A>)
-<BR>
-
-<BR>  Lamont-Doherty Earth Observatory
-<P>
-<A NAME="lbAF"> </A>
-<H2>DATA TERMINOLOGY</H2>
-
-<B>MBIO</B> handles three types of swath mapping data:  beam bathymetry,
-beam amplitude, and sidescan.  Both amplitude and sidescan represent
-measures of backscatter strength. Beam amplitudes are backscatter
-values associated with the same preformed beams used to
-obtain bathymetry; <B>MBIO</B> assumes that a bathymetry value
-exists for each amplitude value and uses the bathymetry beam
-location for the amplitude.  Sidescan is generally constructed with
-a higher spatial resolution than bathymetry, and carries its
-own location parameters.  In the context of <B>MB-System</B> documentation,
-the discrete values of bathymetry and amplitude are referred
-to as "beams", and the discrete values of sidescan are referred to
-as "pixels". An additional difference between "beam" and "pixel"
-data involves data flagging. An array of "beamflags" is carried by
-<B>MBIO</B> functions which allows the bathymetry (and by extension
-the amplitude) data to be flagged as bad. The details of the
-beamflagging scheme are presented below.
-<P>
-<A NAME="lbAG"> </A>
-<H2>VERSION 5 CHANGES</H2>
-
-This document describes version 5 releases of <B>MBIO</B>.
-The source code structure used in version 4 <B>MBIO</B> had grown
-complex and difficult to support. In particular, the addition
-of new i/o modules had become excessively time consuming.
-Consequently, we have restructured and rewritten much of the library.
-Most of the changes are internal, but two  function calls have
-disappeared (<B>mb_put()</B> and <B>mb_write()</B>), and a
-number of new functions have been added.
-<P>
-A further significant architectural change was implemented for
-release 5.0.8 in order to support data formats that have no
-explicit maximum number of beams or pixels. The memory management
-of arrays used to hold bathymetry, amplitude, and sidescan data
-has been made dynamic. Now, when data records are encountered that
-include larger numbers of beams or pixels than will fit in the
-arrays previously allocated, those arrays are reallocated to
-the required size. This is handled automatically for all of the
-internal arrays used by <B>MBIO</B> functions. Of course,
-applications using <B>MBIO</B> must allocate arrays that are
-passed into functions like <B>mb_read</B>, <B>mb_get_all</B>, and
-<B>mb_get</B> to be populated by the desired data. In order for
-these arrays to be managed dynamically, the application must
-first register each array by passing the location of the array
-pointer to a new function called <B>mb_register_array</B>.
-<P>
-<A NAME="lbAH"> </A>
-<H2>OVERVIEW</H2>
-
-<B>MBIO</B> opens and initializes sonar data files for reading
-and writing using the functions <B>mb_read_init</B> and <B>mb_write_init</B>,
-respectively.  These functions return a pointer to a data structure
-including all relevent information about the opened file, the
-control parameters which determine how data is read or written,
-and the arrays used for processing the data as it is read or written.
-This pointer is then passed to the functions used for reading or
-writing.  There is no limit on the number of files which may be
-opened for reading or writing at any given time in a program.
-<P>
-The <B>mb_read_init</B> and <B>mb_write_init</B> functions also return
-initial maximum numbers of bathymetry beams, amplitude beams,
-and sidescan pixels that can be used to allocate data storage
-arrays of the appropriate sizes. However, for some data formats
-there are no specified maximum numbers of beams and pixels, and
-so in general the required dimensions may increase as data are
-read. Applications must pass appropriately dimensioned arrays
-into data extraction routines such as <B>mb_read</B>, <B>mb_get</B>,
-and <B>mb_get_all</B>. In order to enable dynamic memory management
-of thse application arrays, the application must first register
-each array by passing the array pointer location to the function
-<B>mb_register_array</B>.
-<P>
-Data files are closed using the function <B>mb_close</B>. All
-internal and registered arrays are deallocated as part of closing
-the file.
-<P>
-When it comes to actually reading and writing swath mapping
-sonar data, <B>MBIO</B> has three levels of i/o functionality:
-<BR> <TT>       </TT>1:<TT>      </TT>Simple reading of swath data files. The primary<BR>
-<BR> <TT>       </TT><TT>        </TT>functions are:<BR>
-<BR>  <TT>      </TT><TT>        </TT><TT>        </TT><B>mb_read()</B><BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><B>mb_get()</B><BR>
-<BR> <TT>       </TT><TT>        </TT>The positions of individual beams and pixels are<BR>
-<BR> <TT>       </TT><TT>        </TT>returned in longitude and latitude by<BR>
-<BR> <TT>       </TT><TT>        </TT><B>mb_read()</B> and in acrosstrack and alongtrack<BR>
-<BR> <TT>       </TT><TT>        </TT>distances by <B>mb_get()</B>. Only a limited set<BR>
-<BR> <TT>       </TT><TT>        </TT>of navigation information is returned. Comments<BR>
-<BR> <TT>       </TT><TT>        </TT>are also returned. These functions can be used<BR>
-<BR> <TT>       </TT><TT>        </TT>without any special include  files or any<BR>
-<BR> <TT>       </TT><TT>        </TT>knowledge of the actual data structures used<BR>
-<BR> <TT>       </TT><TT>        </TT>by the data formats or <B>MBIO</B>.<BR>
-<BR> <TT>       </TT>2:<TT>      </TT>Complete reading and writing of data structures<BR>
-<BR> <TT>       </TT><TT>        </TT>containing all of the available information.<BR>
-<BR> <TT>       </TT><TT>        </TT>Data records may be read or written without<BR>
-<BR> <TT>       </TT><TT>        </TT>extracting any of the information, or the<BR>
-<BR> <TT>       </TT><TT>        </TT>swath data may be passed with the data structure.<BR>
-<BR> <TT>       </TT><TT>        </TT>Several functions exist to extract information<BR>
-<BR> <TT>       </TT><TT>        </TT>from or insert information into the data<BR>
-<BR> <TT>       </TT><TT>        </TT>structures; otherwise, special include files<BR>
-<BR> <TT>       </TT><TT>        </TT>are required to make sense of the sonar-specific<BR>
-<BR> <TT>       </TT><TT>        </TT>data structures passed by level 2 i/o functions.<BR>
-<BR> <TT>       </TT><TT>        </TT>The basic read and write functions that only pass<BR>
-<BR> <TT>       </TT><TT>        </TT>pointers to internal data structures are:<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><B>mb_read_ping()</B><BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><B>mb_write_ping()</B><BR>
-<BR> <TT>       </TT><TT>        </TT>The read and write routines which also extract<BR>
-<BR> <TT>       </TT><TT>        </TT>or insert information are:<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><B>mb_get_all()</B><BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><B>mb_put_all()</B><BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><B>mb_put_comment()</B><BR>
-<BR> <TT>       </TT><TT>        </TT>The information extraction and insertion<BR>
-<BR> <TT>       </TT><TT>        </TT>functions are:<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><B>mb_insert()</B><BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><B>mb_extract()</B><BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><B>mb_extract_nav()</B><BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><B>mb_insert_nav()</B><BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><B>mb_extract_altitude()</B><BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><B>mb_insert_altitude()</B><BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><B>mb_ttimes()</B><BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><B>mb_copyrecord()</B><BR>
-<BR> <TT>       </TT>3:<TT>      </TT>Buffered reading and writing of data structures<BR>
-<BR> <TT>       </TT><TT>        </TT>containing all of the available information.<BR>
-<BR> <TT>       </TT><TT>        </TT>The primary functions are:<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><B>mb_buffer_init()</B><BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><B>mb_buffer_close()</B><BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><B>mb_buffer_load()</B><BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><B>mb_buffer_dump()</B><BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><B>mb_buffer_info()</B><BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><B>mb_buffer_get_next_data()</B><BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><B>mb_buffer_extract()</B><BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><B>mb_buffer_insert()</B><BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><B>mb_buffer_get_next_nav()</B><BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><B>mb_buffer_extract_nav()</B><BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><B>mb_buffer_insert_nav()</B><BR>
-<P>
-The level 1 <B>MBIO</B> functions allow users to read
-sonar data independent of format, with the limitation that
-only a limited set of navigation information is passed.  Thus, some of the
-information contained in certain data formats (e.g. the "heave" value
-in Hydrosweep DS data) is not passed by <B>mb_read()</B> or <B>mb_get()</B>.
-In general, the level 1 functions are useful for applications
-such as graphics which require only the navigation and the depth
-and/or backscatter values.
-<P>
-The level 2 functions (<B>mb_get_all()</B> and
-<B>mb_put_all()</B>) read and write the complete data
-structures, translate the data to internal data structures
-associated with each of the supported sonar systems, and
-pass pointers to these internal data structures. Additional
-functions allow a variety of information to be extracted
-from or inserted into the data structures (e.g. mb_extract()
-and mb_insert()). Additional information may be accessed
-using special include files to  decode the data structures.
-The great majority of processing programs use level 2 functions.
-<P>
-The level 3 functions provide buffered reading and
-writing which is useful for applications that generate
-output files and need access to multiple pings at a time.  In addition to reading
-(<B>mb_buffer_load()</B>) and writing (<B>mb_buffer_dump()</B>), functions
-exist for extracting information from the buffer (<B>mb_buffer_extract()</B>)
-and inserting information into the buffer (<B>mb_buffer_insert()</B>).
-<P>
-<B>MBIO</B> supports swath data in a number of different formats,
-each specified by a unique id number. The function <B>mb_format()</B>
-determines if a format id is valid. A set of similar functions
-returns information about the specified format
-(e.g. <B>mb_format_description()</B>, <B>mb_format_system()</B>,
-<B>mb_format_description()</B>, <B>mb_format_dimensions()</B>,
-<B>mb_format_flags()</B>, <B>mb_format_source()</B>,
-<B>mb_format_beamwidth()</B>).
-<P>
-Some <B>MB-System</B> programs can process multiple data
-files specified in "datalist" files. Each line of a datalist
-file contains a file path and the corresponding <B>MBIO</B>
-format id. Datalist files can be recursive and can contain
-comments. The functions used to extract input swath data
-file paths from datalist files
-includes <B>mb_datalist_open()</B>, <B>mb_datalist_read()</B>,
-and <B>mb_datalist_close()</B>.
-<P>
-A number of other <B>MBIO</B> functions dealing with default values for
-important parameters, error messages, memory management, and time conversions
-also exist and are discussed below.
-<P>
-<A NAME="lbAI"> </A>
-<H2>SUPPORTED SWATH SONAR SYSTEMS</H2>
-
-Each swath mapping sonar system outputs a data stream which includes some values
-or parameters unique to that system.  In general, a number of different data
-formats have come into use for data from each of the sonar systems; many of
-these formats include only a subset of the original data stream.  Internally,
-<B>MBIO</B> recognizes which sonar system each data format is associated
-with and uses a data structure including the complete data stream for that
-sonar.  Consequently, it is possible to read and write the complete
-data stream when using the level 2 or 3 <B>MBIO</B> functions.
-At present, formats associated with the following sonars are
-supported:
-<BR> <TT>       </TT>SeaBeam "classic" 16 beam multibeam sonar<BR>
-<BR> <TT>       </TT>Hydrosweep DS 59 beam multibeam sonar<BR>
-<BR> <TT>       </TT>Hydrosweep MD 40 beam mid-depth multibeam<BR>
-<BR> <TT>       </TT><TT>        </TT>sonar<BR>
-<BR> <TT>       </TT>SeaBeam 2000 multibeam sonar<BR>
-<BR> <TT>       </TT>SeaBeam 2112, 2120, and 2130 multibeam<BR>
-<BR> <TT>       </TT><TT>        </TT>sonars<BR>
-<BR> <TT>       </TT>Simrad EM12, EM121, EM950, and EM1000<BR>
-<BR> <TT>       </TT><TT>        </TT>multibeam sonars<BR>
-<BR> <TT>       </TT>Simrad EM120, EM300, EM1002, and EM3000<BR>
-<BR> <TT>       </TT><TT>        </TT>multibeam sonars<BR>
-<BR> <TT>       </TT>Hawaii MR-1 shallow tow interferometric<BR>
-<BR> <TT>       </TT><TT>        </TT>sonar<BR>
-<BR> <TT>       </TT>ELAC Bottomchart 1180 and 1050 multibeam<BR>
-<BR> <TT>       </TT><TT>        </TT>sonars<BR>
-<BR> <TT>       </TT>ELAC/SeaBeam Bottomchart Mk2 1180 and<BR>
-<BR> <TT>       </TT><TT>        </TT>1050 multibeam sonars<BR>
-<BR> <TT>       </TT>Reson Seabat 9001/9002 multibeam sonars<BR>
-<BR> <TT>       </TT>Reson Seabat 8101 multibeam sonars<BR>
-<BR> <TT>       </TT>Simrad/Mesotech SM2000 multibeam sonars<BR>
-<BR> <TT>       </TT>WHOI DSL AMS-120 deep tow interferometric<BR>
-<BR> <TT>       </TT><TT>        </TT>sonar<BR>
-<TT>        </TT>AMS-60 interferometric sonar<BR>
-<P>
-<A NAME="lbAJ"> </A>
-<H2>SUPPORTED FORMATS</H2>
-
-The following swath mapping sonar data formats are supported in this version of
-<B>MBIO</B>:
-<P>
-<BR>    MBIO Data Format ID:  11
-<BR>    Format name:          MBF_SBSIOMRG
-<BR>    Informal Description: SIO merge Sea Beam
-<BR>    Attributes:           Sea Beam, bathymetry, 16 beams,
-<BR>                          binary, uncentered, SIO.
-<P>
-<BR>    MBIO Data Format ID:  12
-<BR>    Format name:          MBF_SBSIOCEN
-<BR>    Informal Description: SIO centered Sea Beam
-<BR>    Attributes:           Sea Beam, bathymetry, 19 beams,
-<BR>                          binary, centered, SIO.
-<P>
-<BR>    MBIO Data Format ID:  13
-<BR>    Format name:          MBF_SBSIOLSI
-<BR>    Informal Description: SIO LSI Sea Beam
-<BR>    Attributes:           Sea Beam, bathymetry, 19 beams,
-<BR>                          binary, centered, obsolete, SIO.
-<P>
-<BR>    MBIO Data Format ID:  14
-<BR>    Format name:          MBF_SBURICEN
-<BR>    Informal Description: URI Sea Beam
-<BR>    Attributes:           Sea Beam, bathymetry, 19 beams,
-<BR>                          binary, centered, URI.
-<P>
-<BR>    MBIO Data Format ID:  15
-<BR>    Format name:          MBF_SBURIVAX
-<BR>    Informal Description: URI Sea Beam from VAX
-<BR>    Attributes:           Sea Beam, bathymetry, 19 beams,
-<BR>                          binary, centered,
-<BR>                          VAX byte order, URI.
-<P>
-<BR>    MBIO Data Format ID:  16
-<BR>    Format name:          MBF_SBSIOSWB
-<BR>    Informal Description: SIO Swath-bathy SeaBeam
-<BR>    Attributes:           Sea Beam, bathymetry, 19 beams,
-<BR>                          binary, centered, SIO.
-<P>
-<BR>    MBIO Data Format ID:  17
-<BR>    Format name:          MBF_SBIFREMR
-<BR>    Informal Description: IFREMER Archive SeaBeam
-<BR>    Attributes:           Sea Beam, bathymetry, 19 beams,
-<BR>                          ascii, centered, IFREMER.
-<P>
-<BR>    MBIO Data Format ID:  21
-<BR>    Format name:          MBF_HSATLRAW
-<BR>    Informal Description: Raw Hydrosweep
-<BR>    Attributes:           Hydrosweep DS, bathymetry and
-<BR>                          amplitude, 59 beams, ascii,
-<BR>                          Atlas Electronik.
-<P>
-<BR>    MBIO Data Format ID:  22
-<BR>    Format name:          MBF_HSLDEDMB
-<BR>    Informal Description: EDMB Hydrosweep
-<BR>    Attributes:           Hydrosweep DS, bathymetry,
-<BR>                          59 beams, binary, NRL.
-<P>
-<BR>    MBIO Data Format ID:  23
-<BR>    Format name:          MBF_HSURICEN
-<BR>    Informal Description: URI Hydrosweep
-<BR>    Attributes:           Hydrosweep DS, 59 beams,
-<BR>                          bathymetry, binary, URI.
-<P>
-<BR>    MBIO Data Format ID:  24
-<BR>    Format name:          MBF_HSLDEOIH
-<BR>    Informal Description: L-DEO in-house binary Hydrosweep
-<BR>    Attributes:           Hydrosweep DS, 59 beams,
-<BR>                          bathymetry and amplitude,
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT>  binary, centered, L-DEO.<BR>
-<P>
-<BR>    MBIO Data Format ID:  25
-<BR>    Format name:          MBF_HSURIVAX
-<BR>    Informal Description: URI Hydrosweep from VAX
-<BR>    Attributes:           Hydrosweep DS, 59 beams,
-<BR>                          bathymetry, binary, VAX byte
-<BR>                          order, URI.
-<P>
-<BR>    MBIO Data Format ID:  32
-<BR>    Format name:          MBF_SB2000SB
-<BR>    Informal Description: SIO Swath-bathy SeaBeam 2000
-<BR>    Attributes:           SeaBeam 2000, bathymetry, 121
-<BR>                          beams, binary,  SIO.
-<P>
-<BR>    MBIO Data Format ID:  33
-<BR>    Format name:          MBF_SB2000SS
-<BR>    Informal Description: SIO Swath-bathy SeaBeam 2000
-<BR>    Attributes:           SeaBeam 2000, sidescan,
-<BR>                          1000 pixels for 4-bit
-<BR>                          sidescan, 2000 pixels for
-<BR>                          12+-bit sidescan, binary,
-<BR>                          SIO.
-<P>
-<BR>    MBIO Data Format ID:  41
-<BR>    Format name:          MBF_SB2100RW
-<BR>    Informal Description: SeaBeam 2100 series vender format
-<BR>    Attributes:           SeaBeam 2100, bathymetry,
-<BR>                          amplitude and sidescan,
-<BR>                          151 beams and 2000 pixels,
-<BR>                          ascii with binary sidescan,
-<BR>                          SeaBeam Instruments.
-<P>
-<BR>    MBIO Data Format ID:  42
-<BR>    Format name:          MBF_SB2100B1
-<BR>    Informal Description: SeaBeam 2100 series vender format
-<BR>    Attributes:           SeaBeam 2100, bathymetry,
-<BR>                          amplitude and sidescan,
-<BR>                          151 beams bathymetry,
-<BR>                          2000 pixels sidescan, binary,
-<BR>                          SeaBeam Instruments and L-DEO.
-<P>
-<BR>    MBIO Data Format ID:  43
-<BR>    Format name:          MBF_SB2100B2
-<BR>    Informal Description: SeaBeam 2100 series vender format
-<BR>    Attributes:           SeaBeam 2100, bathymetry and
-<BR>                          amplitude, 151 beams bathymetry,
-<BR>                          binary, SeaBeam Instruments
-<BR>                          and L-DEO.
-<P>
-<BR>    MBIO Data Format ID:  51
-<BR>    Format name:          MBF_EMOLDRAW
-<BR>    Informal Description: Old Simrad vendor multibeam format
-<BR>    Attributes:           Simrad EM1000, EM12S, EM12D,
-<BR>                          and EM121 multibeam sonars,
-<BR>                          bathymetry, amplitude, and
-<BR>                          sidescan, 60 beams for EM1000,
-<BR>                          81 beams for EM12S/D, 121 beams
-<BR>                          for EM121, variable pixels,
-<BR>                          ascii + binary, Simrad.
-<P>
-<BR>    MBIO Data Format ID:  53
-<BR>    Format name:          MBF_EM12IFRM
-<BR>    Informal Description: IFREMER TRISMUS format for
-<BR>                          Simrad EM12
-<BR>    Attributes:           Simrad EM12S and EM12D,
-<BR>                          bathymetry, amplitude, and
-<BR>                          sidescan 81 beams, variable
-<BR>                          pixels, binary, IFREMER.
-<P>
-<BR>    MBIO Data Format ID:  54
-<BR>    Format name:          MBF_EM12DARW
-<BR>    Informal Description: Simrad EM12S RRS Darwin
-<BR>                          processed format
-<BR>    Attributes:           Simrad EM12S, bathymetry
-<BR>                          and amplitude, 81 beams,
-<BR>                          binary, Oxford University.
-<P>
-<BR>    MBIO Data Format ID:  56
-<BR>    Format name:          MBF_EM300RAW
-<BR>    Informal Description: Simrad current multibeam
-<BR>                          vendor format
-<BR>    Attributes:           Simrad EM120, EM300, EM1002,
-<BR>                          EM3000, bathymetry, amplitude,
-<BR>                          and sidescan, up to 254 beams,
-<BR>                          variable pixels, ascii + binary,
-<BR>                          Simrad.
-<P>
-<BR>    MBIO Data Format ID:  57
-<BR>    Format name:          MBF_EM300MBA
-<BR>    Informal Description: Simrad multibeam processing format
-<BR>    Attributes:           Old and new Simrad multibeams,
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT>  EM12S, EM12D, EM121, EM120,<BR>
-<BR>                          EM300, EM100, EM1000, EM950,
-<BR>                          EM1002, EM3000, bathymetry,
-<BR>                          amplitude, and sidescan,
-<BR>                          up to 254 beams, variable pixels,
-<BR>                          ascii + binary, MBARI.
-<P>
-<BR>    MBIO Data Format ID:  58
-<BR>    Format name:          MBF_EM710RAW
-<BR>    Informal Description: Simrad current multibeam vendor format
-<BR>    Attributes:           Simrad EM710,
-<BR>                          bathymetry, amplitude, and sidescan,
-<BR>                          up to 400 beams, variable pixels,
-<BR>    <TT>    </TT><TT>        </TT><TT>        </TT>  binary, Simrad.<BR>
-<P>
-<BR>    MBIO Data Format ID:  59
-<BR>    Format name:          MBF_EM710MBA
-<BR>    Informal Description: Simrad current multibeam vendor format
-<BR>    Attributes:           Simrad EM710,
-<BR>                          bathymetry, amplitude, and sidescan,
-<BR>                          up to 400 beams, variable pixels,
-<BR>    <TT>    </TT><TT>        </TT><TT>        </TT>  binary, Simrad.<BR>
-<P>
-<BR>    MBIO Data Format ID:  61
-<BR>    Format name:          MBF_MR1PRHIG
-<BR>    Informal Description: SOEST MR1 post processed format
-<BR>    Attributes:           SOEST MR1, bathymetry and
-<BR>                          sidescan, variable beams and
-<BR>                          pixels, xdr binary, SOEST,
-<BR>                          University of Hawaii.
-<P>
-<BR>    MBIO Data Format ID:  62
-<BR>    Format name:          MBF_MR1ALDEO
-<BR>    Informal Description: L-DEO MR1 post processed
-<BR>                          format with travel times
-<BR>    Attributes:           L-DEO MR1, bathymetry and
-<BR>                          sidescan, variable beams
-<BR>                          and pixels, xdr binary, L-DEO.
-<P>
-<BR>    MBIO Data Format ID:  63
-<BR>    Format name:          MBF_MR1BLDEO
-<BR>    Informal Description: L-DEO small MR1 post processed
-<BR>                          format with travel times
-<BR>    Attributes:           L-DEO MR1, bathymetry and sidescan,
-<BR>                          variable beams and pixels,
-<BR>                          xdr binary, L-DEO.
-<P>
-<BR>    MBIO Data Format ID:  64
-<BR>    Format name:          MBF_MR1PRVR2
-<BR>    Informal Description: SOEST MR1 post processed format
-<BR>    Attributes:           SOEST MR1, bathymetry and sidescan,
-<BR>                          variable beams and pixels, xdr binary,
-<BR>                          SOEST, University of Hawaii.
-<P>
-<BR>    MBIO Data Format ID:  71
-<BR>    Format name:          MBF_MBLDEOIH
-<BR>    Informal Description: L-DEO in-house generic multibeam
-<BR>    Attributes:           Data from all sonar systems,
-<BR>                          bathymetry, amplitude and
-<BR>                          sidescan, variable beams and
-<BR>                          pixels, binary, centered, L-DEO.
-<P>
-<BR>    MBIO Data Format ID:  75
-<BR>    Format name:          MBF_MBNETCDF
-<BR>    Informal Description: CARAIBES CDF multibeam
-<BR>    Attributes:           Data from all sonar systems,
-<BR>                          bathymetry only, variable
-<BR>                          beams, netCDF, IFREMER.
-<P>
-<BR>    MBIO Data Format ID:  81
-<BR>    Format name:          MBF_CBAT9001
-<BR>    Informal Description: Reson SeaBat 9001 shallow
-<BR>                          water multibeam
-<BR>    Attributes:           60 beam bathymetry and
-<BR>                          amplitude, binary, University
-<BR>                          of New Brunswick.
-<P>
-<BR>    MBIO Data Format ID:  82
-<BR>    Format name:          MBF_CBAT8101
-<BR>    Informal Description: Reson SeaBat 8101 shallow
-<BR>                          water multibeam
-<BR>    Attributes:           101 beam bathymetry and
-<BR>                          amplitude, binary, SeaBeam
-<BR>                          Instruments.
-<P>
-<BR>    MBIO Data Format ID:  83
-<BR>    Format name:          MBF_HYPC8101
-<BR>    Informal Description: Reson SeaBat 8101 shallow
-<BR>                          water multibeam
-<BR>    Attributes:           101 beam bathymetry,
-<BR>                          ASCII, read-only, Coastal
-<BR>                          Oceanographics.
-<P>
-<BR>    MBIO Data Format ID:  84
-<BR>    Format name:          MBF_XTFR8101
-<BR>    Informal Description: XTF format Reson SeaBat 81XX
-<BR>    Attributes:           240 beam bathymetry and amplitude,
-<BR>                          1024 pixel sidescan
-<BR>                          binary, read-only,
-<BR>                          Triton-Elics.
-<P>
-<BR>    MBIO Data Format ID:  88
-<BR>    Format name:          MBF_RESON7KR
-<BR>    Informal Description: Reson 7K multibeam vendor format
-<BR>    Attributes:           Reson 7K series multibeam sonars,
-<BR>                          bathymetry, amplitude, three
-<BR>                          channels sidescan, and subbottom
-<BR>                          up to 254 beams, variable pixels,
-<BR>                          binary, Reson.
-<P>
-<BR>    MBIO Data Format ID:  91
-<BR>    Format name:          MBF_BCHRTUNB
-<BR>    Informal Description: Elac BottomChart shallow
-<BR>                          water multibeam
-<BR>    Attributes:           56 beam bathymetry and
-<BR>                          amplitude, binary, University
-<BR>                          of New Brunswick.
-<P>
-<BR>    MBIO Data Format ID:  92
-<BR>    Format name:          MBF_ELMK2UNB
-<BR>    Informal Description: Elac BottomChart MkII shallow
-<BR>                          water multibeam
-<BR>    Attributes:           126 beam bathymetry and
-<BR>                          amplitude, binary, University
-<BR>                          of New Brunswick.
-<P>
-<BR>    MBIO Data Format ID:  93
-<BR>    Format name:          MBF_BCHRXUNB
-<BR>    Informal Description: Elac BottomChart shallow
-<BR>                          water multibeam
-<BR>    Attributes:           56 beam bathymetry and
-<BR>                          amplitude, binary, University
-<BR>                          of New Brunswick.
-<P>
-<BR>    MBIO Data Format ID:  94
-<BR>    Format name:          MBF_L3XSERAW
-<BR>    Informal Description: ELAC/SeaBeam XSE vendor format
-<BR>    Attributes:           Bottomchart MkII 50 kHz and
-<BR>                          180 kHz multibeam, SeaBeam 2120
-<BR>                          20 KHz multibeam, bathymetry,
-<BR>                          amplitude and sidescan, variable
-<BR>                          beams and pixels, binary, L3
-<BR>                          Communications (Elac Nautik
-<BR>                          and SeaBeam Instruments).
-<P>
-<BR>    MBIO Data Format ID:  101
-<BR>    Format name:          MBF_HSMDARAW
-<BR>    Informal Description: Atlas HSMD medium depth
-<BR>                          multibeam raw format
-<BR>    Attributes:           40 beam bathymetry, 160 pixel
-<BR>                          sidescan, XDR (binary),
-<BR>                          STN Atlas Elektronik.
-<P>
-<BR>    MBIO Data Format ID:  102
-<BR>    Format name:          MBF_HSMDLDIH
-<BR>    Informal Description: Atlas HSMD medium depth
-<BR>                          multibeam processed format
-<BR>    Attributes:           40 beam bathymetry, 160 pixel
-<BR>                          sidescan, XDR (binary), L-DEO.
-<P>
-<BR>    MBIO Data Format ID:  111
-<BR>    Format name:          MBF_DSL120SF
-<BR>    Informal Description: WHOI DSL AMS-120 processed format
-<BR>    Attributes:           2048 beam bathymetry,
-<BR>                          8192 pixel sidescan,
-<BR>                          binary, single files, WHOI DSL.
-<P>
-<BR>    MBIO Data Format ID:  112
-<BR>    Format name:          MBF_DSL120PF
-<BR>    Informal Description: WHOI DSL AMS-120 processed
-<BR>                          format
-<BR>    Attributes:           2048 beam bathymetry,
-<BR>                          8192 pixel sidescan,
-<BR>                          binary, parallel bathymetry
-<BR>                          and amplitude files, WHOI DSL.
-<P>
-<BR>    MBIO Data Format ID:  121
-<BR>    Format name:          MBF_GSFGENMB
-<BR>    Informal Description: SAIC Generic Sensor Format (GSF)
-<BR>    Attributes:           variable beams,  bathymetry
-<BR>                          and amplitude, binary,
-<BR>                          single files, SAIC.
-<P>
-<BR>    MBIO Data Format ID:  131
-<BR>    Format name:          MBF_MSTIFFSS
-<BR>    Informal Description: MSTIFF sidescan format
-<BR>    Attributes:           variable pixels,  sidescan,
-<BR>                          binary TIFF variant,
-<BR>                          single files, Sea Scan.
-<P>
-<BR>    MBIO Data Format ID:  132
-<BR>    Format name:          MBF_EDGJSTAR
-<BR>    Informal Description: Edgetech Jstar format
-<BR>    Attributes:           variable pixels, dual frequency
-<BR>                          sidescan and subbottom,
-<BR>                          binary SEGY variant, single files,
-<BR>                          low frequency sidescan returned as
-<BR>                          survey data, Edgetech.
-<P>
-<BR>    MBIO Data Format ID:  133
-<BR>    Format name:          MBF_EDGJSTR2
-<BR>    Informal Description: Edgetech Jstar format
-<BR>    Attributes:           variable pixels, dual frequency
-<BR>                          sidescan and subbottom,
-<BR>                          binary SEGY variant, single files,
-<BR>                          high frequency sidescan returned as
-<BR>                          survey data, Edgetech.
-<P>
-<P>
-<BR>    MBIO Data Format ID:  141
-<BR>    Format name:          MBF_OICGEODA
-<BR>    Informal Description: OIC swath sonar format
-<BR>    Attributes:           variable beam bathymetry and
-<BR>    <TT>    </TT><TT>        </TT><TT>        </TT>  amplitude, variable pixel<BR>
-<BR>                          sidescan, binary,
-<BR>    <TT>    </TT><TT>        </TT><TT>        </TT>  Oceanic Imaging Consultants<BR>
-<P>
-<BR>    MBIO Data Format ID:  142
-<BR>    Format name:          MBF_OICMBARI
-<BR>    Informal Description: OIC-style extended swath
-<BR>                          sonar format
-<BR>    Attributes:           variable beam bathymetry and
-<BR>                          amplitude, variable pixel
-<BR>                          sidescan, binary, MBARI
-<P>
-<BR>    MBIO Data Format ID:  151
-<BR>    Format name:          MBF_OMGHDCSJ
-<BR>    Informal Description: UNB OMG HDCS format
-<BR>                          (the John Hughes Clarke format)
-<BR>    Attributes:           variable beam bathymetry and
-<BR>                          amplitude, variable pixel
-<BR>                          sidescan, binary, UNB
-<P>
-<BR>    MBIO Data Format ID:  160
-<BR>    Format name:          MBF_SEGYSEGY
-<BR>    Informal Description: SEGY seismic data format
-<BR>    Attributes:           seismic or subbottom trace data,
-<BR>                          single beam bathymetry, nav,
-<BR>                          binary, SEG (SIOSEIS variant)
-<P>
-<BR>    MBIO Data Format ID:  161
-<BR>    Format name:          MBF_MGD77DAT
-<BR>    Informal Description: NGDC MGD77 underway geophysics
-<BR>                          format
-<BR>    Attributes:           single beam bathymetry, nav,
-<BR>                          magnetics, gravity, ascii,
-<BR>                          NOAA NGDC
-<P>
-<BR>    MBIO Data Format ID:  162
-<BR>    Format name:          MBF_ASCIIXYZ
-<BR>    Informal Description: Generic XYZ sounding format
-<BR>    Attributes:           XYZ (lon lat depth) ASCII
-<BR>                          soundings, generic
-<P>
-<BR>    MBIO Data Format ID:  163
-<BR>    Format name:          MBF_ASCIIYXZ
-<BR>    Informal Description: Generic YXZ sounding format
-<BR>    Attributes:           YXZ (lat lon depth) ASCII
-<BR>                          soundings, generic
-<P>
-<BR>    MBIO Data Format ID:  164
-<BR>    Format name:         MBF_HYDROB93
-<BR>    Informal Description: NGDC binary hydrographic
-<BR>                          sounding format
-<BR>    Attributes:           XYZ (lon lat depth) binary
-<BR>                          soundings
-<P>
-<BR>    MBIO Data Format ID:  165
-<BR>    Format name:          MBF_MBARIROV
-<BR>    Informal Description: MBARI ROV navigation format
-<BR>    Attributes:           ROV navigation, MBARI
-<P>
-<BR>    MBIO Data Format ID:  166
-<BR>    Format name:          MBF_MBPRONAV
-<BR>    Informal Description: MB-System simple navigation
-<BR>                          format
-<BR>    Attributes:           navigation, MBARI
-<P>
-<BR>    MBIO Data Format ID:  167
-<BR>    Format name:          MBF_MBNETCDF
-<BR>    Informal Description: CARAIBES CDF navigation
-<BR>    Attributes:           netCDF, IFREMER.
-<P>
-<BR>    MBIO Data Format ID:  168
-<BR>    Format name:          MBF_ASCIIXYT
-<BR>    Informal Description: Generic XYT sounding format
-<BR>    Attributes:           XYT (lon lat topography) ASCII
-<BR>                          soundings, generic
-<P>
-<BR>    MBIO Data Format ID:  169
-<BR>    Format name:          MBF_ASCIIYXT
-<BR>    Informal Description: Generic YXT sounding format
-<BR>    Attributes:           YXT (lat lon topograpy) ASCII
-<BR>                          soundings, generic
-<P>
-<BR>    MBIO Data Format ID:  170
-<BR>    Format name:          MBF_MBARROV2
-<BR>    Informal Description: MBARI ROV navigation format
-<BR>    Attributes:           ROV navigation, MBARI
-<P>
-<BR>    MBIO Data Format ID:  171
-<BR>    Format name:          MBF_HS10JAMS
-<BR>    Informal Description: Furuno HS-10 multibeam format,
-<BR>    Attributes:           45 beams bathymetry and amplitude,
-<BR>                          ascii, JAMSTEC
-<P>
-<BR>    MBIO Data Format ID:  181
-<BR>    Format name:          MBF_SAMESURF
-<BR>    Informal Description: SAM Electronics SURF format.
-<BR>    Attributes:           variable beams,  bathymetry,
-<BR>    <TT>    </TT><TT>        </TT><TT>        </TT>  amplitude,  and sidescan,<BR>
-<BR>                          binary, single files, SAM Electronics
-<TT>        </TT><TT>        </TT><TT>        </TT>  (formerly Krupp-Atlas Electronik).<BR>
-<P>
-<BR>    MBIO Data Format ID:  182
-<BR>    Format name:          MBF_HSDS2RAW
-<BR>    Informal Description: STN Atlas raw multibeam format
-<BR>    Attributes:           STN Atlas multibeam sonars,
-<BR>    <TT>    </TT><TT>        </TT><TT>        </TT>  Hydrosweep DS2, Hydrosweep MD,<BR>
-<BR>    <TT>    </TT><TT>        </TT><TT>        </TT>  Fansweep 10, Fansweep 20,<BR>
-<BR>    <TT>    </TT><TT>        </TT><TT>        </TT>  bathymetry, amplitude, and sidescan,<BR>
-<BR>    <TT>    </TT><TT>        </TT><TT>        </TT>  up to 1440 beams and 4096 pixels,<BR>
-<BR>    <TT>    </TT><TT>        </TT><TT>        </TT>  XDR binary, STN Atlas.<BR>
-<P>
-<BR>    MBIO Data Format ID:  183
-<BR>    Format name:          MBF_HSDS2LAM
-<BR>    Informal Description: L-DEO HSDS2 processing format
-<BR>    Attributes:           STN Atlas multibeam sonars,
-<BR>    <TT>    </TT><TT>        </TT><TT>        </TT>  Hydrosweep DS2, Hydrosweep MD,<BR>
-<BR>    <TT>    </TT><TT>        </TT><TT>        </TT>  Fansweep 10, Fansweep 20,<BR>
-<BR>    <TT>    </TT><TT>        </TT><TT>        </TT>  bathymetry, amplitude, and sidescan,<BR>
-<BR>    <TT>    </TT><TT>        </TT><TT>        </TT>  up to 1440 beams and 4096 pixels,<BR>
-<BR>    <TT>    </TT><TT>        </TT><TT>        </TT>  XDR binary, L-DEO.<BR>
-<P>
-<BR>    MBIO Data Format ID:  222
-<BR>    Format name:          MBF_SWPLSSXP
-<BR>    Informal Description: SEA interferometric processed data format
-<BR>    Attributes:           Submetrix Interferometers,
-<BR>                  SWATHplus-L, SWATHplus-M, SWATHplus-H,
-<BR>                  Bathyswath-1, Bathyswath-2,
-<BR>                  bathymetry and amplitude, SXP binary.
-<P>
-The institutional acronyms used above have the following meanings:
-<BR> <TT>       </TT>L-DEO<TT>   </TT>Lamont-Doherty Earth Observatory<BR>
-<BR> <TT>       </TT>MBARI<TT>   </TT>Monterey Bay Aquarium Research Institute<BR>
-<BR> <TT>       </TT>SIO<TT>     </TT>Scripps Institution of Oceanography<BR>
-<BR> <TT>       </TT>WHOI<TT>    </TT>Woods Hole Oceanographic Institution<BR>
-<BR> <TT>       </TT>URI<TT>     </TT>University of Rhode Island<BR>
-<BR> <TT>       </TT>NRL<TT>     </TT>Naval Research Laboratory<BR>
-<BR> <TT>       </TT>UNB<TT>     </TT>University of New Brunswick<BR>
-<BR> <TT>       </TT>UH<TT>      </TT>University of Hawaii<BR>
-<BR> <TT>       </TT>NOAA<TT>    </TT>National Oceans and Atmospheres Agency<BR>
-<BR> <TT>       </TT>NGDC<TT>    </TT>National Geophysical Data Center<BR>
-<BR> <TT>       </TT>USGS<TT>    </TT>United States Geological Survey<BR>
-<BR> <TT>       </TT>IFREMER<TT> </TT>French government agency responsible<BR>
-<BR> <TT>       </TT><TT>        </TT>for operation of French oceanographic<BR>
-<BR> <TT>       </TT><TT>        </TT>research fleet.<BR>
-<P>
-<A NAME="lbAK"> </A>
-<H2>FUNCTION STATUS AND ERROR CODES</H2>
-
-All of the <B>MBIO</B> functions return an integer status value with the
-convention that:
-<BR> <TT>       </TT>status = 1:<TT>     </TT>success<BR>
-<BR> <TT>       </TT>status = 0:<TT>     </TT>failure<BR>
-<BR>
-
-All <B>MBIO</B> functions also pass an error value argument which gives
-somewhat more information about problems than the status value.  The
-full suite of possible error values and the associated error messages are:
-<BR>  <TT>      </TT>error = 0:<TT>      </TT>"No error",<BR>
-<BR>  <TT>      </TT>error = -1:<TT>     </TT>"Time gap in data",<BR>
-<BR>  <TT>      </TT>error = -2:<TT>     </TT>"Data outside specified location<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT>bounds",<BR>
-<BR>  <TT>      </TT>error = -3:<TT>     </TT>"Data outside specified time interval",<BR>
-<BR>  <TT>      </TT>error = -4:<TT>     </TT>"Ship speed too small",<BR>
-<BR>  <TT>      </TT>error = -5:<TT>     </TT>"Comment record",<BR>
-<BR>  <TT>      </TT>error = -6:<TT>     </TT>"Neither a data record nor a comment<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT>record",<BR>
-<BR>  <TT>      </TT>error = -7:<TT>     </TT>"Unintelligible data record",<BR>
-<BR>  <TT>      </TT>error = -8:<TT>     </TT>"Ignore this data",<BR>
-<BR>  <TT>      </TT>error = -9:<TT>     </TT>"No data requested for buffer load",<BR>
-<BR>  <TT>      </TT>error = -10:<TT>    </TT>"Data buffer is full",<BR>
-<BR>  <TT>      </TT>error = -11:<TT>    </TT>"No data was loaded into the buffer",<BR>
-<BR>  <TT>      </TT>error = -12:<TT>    </TT>"Data buffer is empty",<BR>
-<BR>  <TT>      </TT>error = -13:<TT>    </TT>"No data was dumped from the buffer"<BR>
-<BR>  <TT>      </TT>error = -14:<TT>    </TT>"No more survey data records in buffer"<BR>
-<BR>  <TT>      </TT>error = -15:<TT>    </TT>"Data inconsistencies prevented<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT>inserting data into storage structure"<BR>
-<BR>  <TT>      </TT>error = 1:<TT>      </TT>"Unable to allocate memory,<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT>initialization failed",<BR>
-<BR>  <TT>      </TT>error = 2:<TT>      </TT>"Unable to open file,<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT>initialization failed",<BR>
-<BR>  <TT>      </TT>error = 3:<TT>      </TT>"Illegal format identifier,<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT>initialization failed",<BR>
-<BR>  <TT>      </TT>error = 4:<TT>      </TT>"Read error, probably end-of-file",<BR>
-<BR>  <TT>      </TT>error = 5:<TT>      </TT>"Write error",<BR>
-<BR>  <TT>      </TT>error = 6:<TT>      </TT>"No data in specified location bounds",<BR>
-<BR>  <TT>      </TT>error = 7:<TT>      </TT>"No data in specified time interval",<BR>
-<BR>  <TT>      </TT>error = 8:<TT>      </TT>"Invalid MBIO descriptor",<BR>
-<BR>  <TT>      </TT>error = 9:<TT>      </TT>"Inconsistent usage of MBIO descriptor",<BR>
-<BR>  <TT>      </TT>error = 10:<TT>     </TT>"No pings binned but no fatal error<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT>- this should not happen!",<BR>
-<BR>  <TT>      </TT>error = 11:<TT>     </TT>"Invalid data record type specified<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT>for writing",<BR>
-<BR>  <TT>      </TT>error = 12:<TT>     </TT>"Invalid control parameter specified<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT>by user",<BR>
-<BR>  <TT>      </TT>error = 13:<TT>     </TT>"Invalid buffer id",<BR>
-<BR>  <TT>      </TT>error = 14:<TT>     </TT>"Invalid system id - this should<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT>not happen!"<BR>
-<BR>  <TT>      </TT>error = 15:<TT>     </TT>"This data file is not in the specified format!"<BR>
-<BR>
-
-In general, programs should treat negative error values as non-fatal
-(reading and writing can continue) and positive error values as fatal (the data
-files should be closed and the program terminated).
-<BR>
-
-<A NAME="lbAL"> </A>
-<H2>FUNCTION VERBOSITY</H2>
-
-All of the <B>MBIO</B> functions are passed a <I>verbose</I> parameter which
-controls how much debugging information is output to standard error.  If
-<I>verbose</I> is 0 or 1, the <B>MBIO</B> functions will be silent.  If
-<I>verbose</I> is 2, then each function will output information as it is
-entered and as it returns, along with the parameter values passed into and
-returned out of the function.  Greater values of <I>verbose</I> will cause
-additional information to be output, including values at various stages
-of data processing during read and write operations.  In general, programs
-using <B>MBIO</B> functions should adopt the following verbosity conventions:
-<BR>
-
-<BR> <TT>       </TT><I>verbose</I> = 0:<TT>    </TT>"silent" or near-"silent" execution<BR>
-<BR> <TT>       </TT><I>verbose</I> = 1:<TT>    </TT>simple output including<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT>program name, version<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT>and simple progress updates<BR>
-<BR> <TT>       </TT><I>verbose</I> >= 2:<TT>   </TT>debug mode with copious output<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT>including every function call<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT>and status listings<BR>
-<A NAME="lbAM"> </A>
-<H2>INITIALIZATION AND CLOSING FUNCTIONS</H2>
-
-<P>
-int <B>mb_read_init</B>(
-<BR> <TT>       </TT><TT>        </TT>int <I>verbose</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>char <I>*file</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>format</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>pings</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>lonflip</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>bounds[4]</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>btime_i[7]</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>etime_i[7]</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>speedmin</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>timegap</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>char <I>**mbio_ptr</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*btime_d</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*etime_d</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*beams_bath</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*beams_amp</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*pixels_ss</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*error</I>);<BR>
-<P>
-The function <B>mb_read_init</B> initializes the data file to be read
-and the data structures required for reading the data. The <I>verbose</I>
-value controls the standard error output verbosity of the function.
-<P>
-The input control parameters have the following significance:
-<BR> <TT>       </TT><I>file</I>:<TT>   </TT><TT>        </TT>input filename<BR>
-<BR> <TT>       </TT><I>format</I>:<TT> </TT><TT>        </TT>input <B>MBIO</B> data format id<BR>
-<BR> <TT>       </TT><I>pings</I>:<TT>  </TT><TT>        </TT>ping averaging<BR>
-<BR> <TT>       </TT><I>lonflip</I>:<TT>        </TT><TT>        </TT>longitude flipping<BR>
-<BR> <TT>       </TT><I>bounds</I>:<TT> </TT><TT>        </TT>location bounds of acceptable data<BR>
-<BR> <TT>       </TT><I>btime_i</I>:<TT>        </TT><TT>        </TT>beginning time of acceptable data<BR>
-<BR> <TT>       </TT><I>etime_i</I>:<TT>        </TT><TT>        </TT>ending time of acceptable data<BR>
-<BR> <TT>       </TT><I>speedmin</I>:<TT>       </TT><TT>        </TT>minimum ship speed of acceptable data<BR>
-<BR> <TT>       </TT><I>timegap</I>:<TT>        </TT><TT>        </TT>maximum time allowed before data gap<BR>
-<P>
-The format identifier <I>format</I> specifies which of the supported
-data formats is being read or written; the currently supported formats
-are listed in the "SUPPORTED FORMATS" section.
-<P>
-The <I>pings</I> parameter determines whether and how pings are averaged as part
-of data input.  This parameter is used only by the functions <B>mb_read</B>
-and <B>mb_get</B>; <B>mb_get_all</B> and <B>mb_buffer_load</B> do not average
-pings.  If <I>pings</I> = 1, then no ping averaging will be done and
-each ping read will be returned unaltered by the reading function.  If
-<I>pings</I> > 1, then the navigation and beam data for <I>pings</I> pings
-will be read, averaged, and returned as the data for a single ping.  If
-<I>pings</I> = 0, then the ping averaging will be varied so that the
-along-track distance between averaged pings is as close as possible to the
-across-track distance between beams.
-<P>
-The <I>lonflip</I> paramenter determines the range in which longitude values
-are returned:
-<BR> <TT>       </TT><I>lonflip</I> = -1 : -360 to   0<BR>
-<BR> <TT>       </TT><I>lonflip</I> =  0 : -180 to 180<BR>
-<BR> <TT>       </TT><I>lonflip</I> =  1 :    0 to 360<BR>
-<P>
-The <I>bounds</I> array sets the area within which data are desired.
-Data which lie outside the area specified by <I>bounds</I> will
-be returned with an error by the reading function.
-The functions <B>mb_read</B>,
-<B>mb_get</B> and <B>mb_get_all</B> use the <I>bounds</I> array; the
-function <B>mb_buffer_load</B> does no location checking.
-<BR> <TT>       </TT><I>bounds</I>[0] : minimum longitude<BR>
-<BR> <TT>       </TT><I>bounds</I>[1] : maximum longitude<BR>
-<BR> <TT>       </TT><I>bounds</I>[2] : minimum latitude<BR>
-<BR> <TT>       </TT><I>bounds</I>[3] : maximum latitude<BR>
-<P>
-The <I>btime_i</I> array sets the desired beginning time for the data
-and the <I>etime_i</I> array sets the desired ending time.
-If the beginning time is earlier than the ending time, then any
-data with a time stamp before the beginning time or
-after the ending time will be returned with an
-MB_ERROR_OUT_TIME error by the reading function.
-If the beginning time is after the ending time, then
-data with time stamps between the ending and beginning
-time are returned with an error. This scheme allows time
-windowing outside or inside a specified interval.
-The functions <B>mb_read</B>,
-<B>mb_get</B> and <B>mb_get_all</B> use the
-<I>btime_i</I> and <I>btime_i</I> arrays; the
-function <B>mb_buffer_load</B> does no time checking.
-<BR> <TT>       </TT><I>btime</I>[0] : year<BR>
-<BR> <TT>       </TT><I>btime</I>[1] : month<BR>
-<BR> <TT>       </TT><I>btime</I>[2] : day<BR>
-<BR> <TT>       </TT><I>btime</I>[3] : hour<BR>
-<BR> <TT>       </TT><I>btime</I>[4] : minute<BR>
-<BR> <TT>       </TT><I>btime</I>[5] : second<BR>
-<BR> <TT>       </TT><I>btime</I>[6] : microsecond<BR>
-<BR> <TT>       </TT><I>etime</I>[0] : year<BR>
-<BR> <TT>       </TT><I>etime</I>[1] : month<BR>
-<BR> <TT>       </TT><I>etime</I>[2] : day<BR>
-<BR> <TT>       </TT><I>etime</I>[3] : hour<BR>
-<BR> <TT>       </TT><I>etime</I>[4] : minute<BR>
-<BR> <TT>       </TT><I>etime</I>[5] : second<BR>
-<BR> <TT>       </TT><I>etime</I>[6] : microsecond<BR>
-<P>
-The <I>speedmin</I> parameter sets the minimum acceptable ship speed for
-the data.  If the ship speed associated with any ping is less than
-<I>speedmin</I>, then that data will be returned with an error
-by the reading function.
-This is used to eliminate data collected while a ship is on station is
-a simple way. The functions <B>mb_read</B>,
-<B>mb_get</B> and <B>mb_get_all</B> use the <I>speedmin</I> value; the
-function <B>mb_buffer_load</B> does no speed checking.
-<P>
-The <I>timegap</I> parameter sets the minimum time gap allowed before a
-gap in the data is declared.  Ping averaging is not done across
-data gaps; an error is returned when time gaps are encountered.
-The functions <B>mb_read</B> and
-<B>mb_get</B> use the <I>timegap</I> value; the
-functions <B>mb_get_all</B> and <B>mb_buffer_load</B> do no ping averaging
-and thus have no need to check for time gaps.
-<P>
-The returned values are:
-<BR> <TT>       </TT><I>mbio_ptr</I>:<TT>       </TT>pointer to an <B>MBIO</B> descriptor structure<BR>
-<BR> <TT>       </TT><I>btime_d</I>:<TT>        </TT><TT>        </TT>desired beginning time in seconds<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>since 1/1/70 00:00:0<BR>
-<BR> <TT>       </TT><I>etime_d</I>:<TT>        </TT><TT>        </TT>desired ending time in seconds<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>since 1/1/70 00:00:0<BR>
-<BR> <TT>       </TT><I>beams_bath</I>:<TT>     </TT>maximum number of bathymetry beams<BR>
-<BR> <TT>       </TT><I>beams_amp</I>:<TT>      </TT>maximum number of amplitude beams<BR>
-<BR> <TT>       </TT><I>pixels_ss</I>:<TT>      </TT>maximum number of sidescan pixels<BR>
-<BR> <TT>       </TT><I>error</I>:<TT>  </TT><TT>        </TT>error value<BR>
-<BR>
-
-The structure pointed to by
-<I>mbio_ptr</I> holds the file descriptor and all of the control parameters
-which govern how the data is read; this pointer must be provided to
-the functions <B>mb_read</B>, <B>mb_get</B>, <B>mb_get_all</B>,
-or <B>mb_buffer_load</B> to read data. The values <I>beams_bath</I>,
-<I>beams_amp</I>, and <I>pixels_ss</I> return initial estimates of the maximum number
-of bathymetry and amplitude beams and sidescan pixels, respectively,
-that the specified data format may contain. In general, <I>beams_amp</I>
-will either be zero or equal to <I>beams_bath</I>. The values <I>btime_d</I>
-and <I>etime_d</I> give the desired beginning and end times of the data
-converted to seconds since 00:00:00 on January 1, 1970;
-<B>MBIO</B> uses these units to calculate time internally.
-<P>
-For most data formats, the initial maximum beam and pixel dimensions will not change.
-However, a few formats support both variable and arbitrarily large numbers
-of beams and/or pixels, and so applications must be capable of handling
-dynamic changes in the numbers of beams and pixels. The arrays allocated
-internally in the <I>mbio_ptr</I> structure are automatically increased
-when necessary. However, in order to successfully extract
-swath data using <I>mb_get</I>, <I>mb_get_all</I>, <I>mb_read</I>, or
-<I>mb_extract</I>, an application must also
-provide pointers to arrays large enough to hold the current maximum numbers
-of bathymetry beams, amplitude beams, and sidescan pixels. The function
-<I>mb_register_ioarray</I> allows applications to register array pointers
-so that these arrays are also dynamically allocated by <I>MBIO</I>. Registered
-arrays will be managed as data are read and then freed when <B>mb_close</B>
-is called.
-<P>
-A status value indicating success or failure is returned; an error value
-argument passes more detailed information about initialization failures.
-<P>
----------------------------------------------------------
-<BR>
-
-int <B>mb_write_init</B>(
-<BR> <TT>       </TT><TT>        </TT>int <I>verbose</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>char <I>*file</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>format</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>char <I>**mbio_ptr</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*beams_bath</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*beams_amp</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*pixels_ss</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*error</I>);<BR>
-<P>
-The function <B>mb_write_init</B> initializes the data file to be written
-and the data structures required for writing the data. The <I>verbose</I>
-value controls the standard error output verbosity of the function.
-<P>
-The input control parameters have the following significance:
-<BR> <TT>       </TT><I>file</I>:<TT>   </TT><TT>        </TT>output filename<BR>
-<BR> <TT>       </TT><I>format</I>:<TT> </TT><TT>        </TT>output <B>MBIO</B> data format id<BR>
-<P>
-The returned values are:
-<BR> <TT>       </TT><I>mbio_ptr</I>:<TT>       </TT>pointer to a structure describing<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>the output file<BR>
-<BR> <TT>       </TT><I>beams_bath</I>:<TT>     </TT>maximum number of bathymetry beams<BR>
-<BR> <TT>       </TT><I>beams_back</I>:<TT>     </TT>maximum number of backscatter beams<BR>
-<BR> <TT>       </TT><I>error</I>:<TT>  </TT><TT>        </TT>error value<BR>
-<P>
-The structure pointed to by
-<I>mbio_ptr</I> holds the output file descriptor; this pointer must be
-provided to
-the functions <B>mb_write</B>, <B>mb_put</B>, <B>mb_put_all</B>,
-or <B>mb_buffer_dump</B> to write data. The values <I>beams_bath</I>,
-<I>beams_amp</I>, and <I>pixels_ss</I> return the maximum number
-of bathymetry and amplitude beams and sidescan pixels, respectively,
-that the specified data format may contain.  In general, <I>beams_amp</I>
-will either be zero or equal to <I>beams_bath</I>.  In order to successfully
-write data, the calling program must
-provide pointers to arrays large enough to hold <I>beams_bath</I> bathymetry
-values, <I>beams_amp</I> amplitude values, and <I>pixels_ss</I> sidescan
-values.
-<P>
-For most data formats, the initial maximum beam and pixel dimensions will not change.
-However, a few formats support both variable and arbitrarily large numbers
-of beams and/or pixels, and so applications must be capable of handling
-dynamic changes in the numbers of beams and pixels. The arrays allocated
-internally in the <I>mbio_ptr</I> structure are automatically increased
-when necessary. However, in order to successfully insert modified
-swath data using <I>mb_put</I>, <I>mb_put_all</I>, or
-<I>mb_insert</I>, an application must also
-provide pointers to arrays large enough to hold the current maximum numbers
-of bathymetry beams, amplitude beams, and sidescan pixels. The function
-<I>mb_register_ioarray</I> allows applications to register array pointers
-so that these arrays are also dynamically allocated by <I>MBIO</I>. Registered
-arrays will be managed as data are read and written and then freed when <B>mb_close</B>
-is called.
-<P>
-A status value indicating success or failure is returned; an error value
-argument passes more detailed information about initialization failures.
-<P>
----------------------------------------------------------
-<BR>
-
-int <B>mb_register_array</B>(
-<BR> <TT>       </TT><TT>        </TT>int <I>verbose</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>void *<I>mbio_ptr</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>type</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>size</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>void **<I>handle</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*error</I>)<BR>
-<P>
-Registers an array pointer *<I>handle</I> so that the size of
-the allocated array can be managed dynamically by <B>MBIO</B>.
-Note that the location <I>**handle</I> of the array
-pointer must be supplied, not the pointer value *<I>handle</I>.
-The pointer value *<I>handle</I> should initially be NULL.
-The <I>type</I> value indicates whether this
-array is to be dimensioned according to the maximum number of
-bathymetry beams (<I>type</I> = 1), amplitude beams (<I>type</I> = 2),
-or sidescan pixels (<I>type</I> = 3). The <I>size</I>
-value indicates the size of each element array in bytes (e.g. a char
-array has <I>size</I> = 1, a short array has <I>size</I> = 2, an
-int array or a float array have <I>size</I> = 4, and a double array
-has <I>size</I> = 8). The array is associated with the <B>MBIO</B>
-descriptor <I>mbio_ptr</I>, and is freed when <I>mb_close</I> is
-called for this particular <I>mbio_ptr</I>.
-<P>
----------------------------------------------------------
-<BR>
-
-int <B>mb_close</B>(
-<BR> <TT>       </TT><TT>        </TT>int <I>verbose</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>char *<I>mbio_ptr</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*error</I>)<BR>
-<P>
-Closes the data file listed in the <B>MBIO</B> descriptor pointed to
-by <I>mbio_ptr</I> and releases all specially allocated memory,
-including all application arrays registered using <B>mb_register_array</B>..
-The <I>verbose</I> value controls the standard error output verbosity
-of the function. A status value indicating success or failure is
-returned; an error value argument passes more detailed information
-about failures.
-<A NAME="lbAN"> </A>
-<H2>LEVEL 1 FUNCTIONS</H2>
-
-<P>
----------------------------------------------------------
-<BR>
-
-int <B>mb_read</B>(
-<BR> <TT>       </TT><TT>        </TT>int <I>verbose</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>char <I>*mbio_ptr</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*kind</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*pings</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>time_i[7]</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*time_d</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*navlon</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*navlat</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*speed</I>,<BR>
-<BR>  <TT>      </TT><TT>        </TT>double <I>*heading</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*distance</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*altitude</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*sonardepth</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*nbath</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*namp</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*nss</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>char <I>*beamflag</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*bath</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*amp</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*bathlon</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*bathlat</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*ss</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*sslon</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*sslat</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>char <I>*comment</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*error</I>);<BR>
-<P>
-The function <B>mb_read</B> reads, processes, and returns sonar
-data according to the <B>MBIO</B> descriptor pointed to by <I>mbio_ptr</I>.
-The <I>verbose</I>
-value controls the standard error output verbosity of the function. A number
-of different data record types are recognized by <B>MB-System</B>, but
-<B>mb_read()</B> only returns survey and comment data records. The
-<I>kind</I> value indicates which type of record has been read.
-The data is in the form of bathymetry, amplitude, and sidescan values combined
-with the longitude and latitude locations of the bathymetry and
-sidescan measurements (amplitudes are coincident with the bathymetry).
-<P>
-The return values are:
-<BR> <TT>       </TT><I>kind</I>:<TT>   </TT><TT>        </TT>kind of data record read<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>1<TT>       </TT>survey data<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>2<TT>       </TT>comment<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>>=3<TT>     </TT>other data that cannot<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>be passed by <B>mb_read</B><BR>
-<BR> <TT>       </TT><I>pings</I>:<TT>  </TT><TT>        </TT>number of pings averaged to give current data<BR>
-<BR> <TT>       </TT><I>time_i</I>:<TT> </TT><TT>        </TT>time of current ping<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><I>time_i</I>[0]: year<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><I>time_i</I>[1]: month<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><I>time_i</I>[2]: day<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><I>time_i</I>[3]: hour<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><I>time_i</I>[4]: minute<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><I>time_i</I>[5]: second<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><I>time_i</I>[6]: microsecond<BR>
-<BR> <TT>       </TT><I>time_d</I>:<TT> </TT><TT>        </TT>time of current ping in seconds<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT>since 1/1/70 00:00:00<BR>
-<BR> <TT>       </TT><I>navlon</I>:<TT> </TT><TT>        </TT>longitude<BR>
-<BR> <TT>       </TT><I>navlat</I>:<TT> </TT><TT>        </TT>latitude<BR>
-<BR> <TT>       </TT><I>speed</I>:<TT>  </TT><TT>        </TT>ship speed in km/s<BR>
-<BR> <TT>       </TT><I>heading</I>:<TT>        </TT><TT>        </TT>ship heading in degrees<BR>
-<BR> <TT>       </TT><I>distance</I>:<TT>       </TT><TT>        </TT>distance along shiptrack since last<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT>ping in km<BR>
-<BR> <TT>       </TT><I>altitude</I>:<TT>       </TT><TT>        </TT>altitude of sonar above seafloor<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT>in m<BR>
-<BR> <TT>       </TT><I>sonardepth</I>:<TT>     </TT>depth of sonar in m<BR>
-<BR> <TT>       </TT><I>nbath</I>:<TT>  </TT><TT>        </TT>number of bathymetry values<BR>
-<BR> <TT>       </TT><I>namp</I>:<TT>   </TT><TT>        </TT>number of amplitude values<BR>
-<BR> <TT>       </TT><I>nss</I>:<TT>    </TT><TT>        </TT>number of sidescan values<BR>
-<BR> <TT>       </TT><I>beamflag</I>:<TT>       </TT><TT>        </TT>array of bathymetry flags<BR>
-<BR> <TT>       </TT><I>bath</I>:<TT>   </TT><TT>        </TT>array of bathymetry values in meters<BR>
-<BR> <TT>       </TT><I>amp</I>:<TT>    </TT><TT>        </TT>array of amplitude values in unknown units<BR>
-<BR> <TT>       </TT><I>bathlon</I>:<TT>        </TT><TT>        </TT>array of of longitude values corresponding<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT>to bathymetry<BR>
-<BR> <TT>       </TT><I>bathlat</I>:<TT>        </TT><TT>        </TT>array of of latitude values corresponding<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT>to bathymetry<BR>
-<BR> <TT>       </TT><I>ss</I>:<TT>     </TT><TT>        </TT>array of sidescan values in unknown units<BR>
-<BR> <TT>       </TT><I>sslon</I>:<TT>  </TT><TT>        </TT>array of of longitude values corresponding<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT>to sidescan<BR>
-<BR> <TT>       </TT><I>sslat</I>:<TT>  </TT><TT>        </TT>array of of latitude values corresponding<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT>to sidescan<BR>
-<BR> <TT>       </TT><I>comment</I>:<TT>        </TT>comment string<BR>
-<BR> <TT>       </TT><I>error</I>:<TT>  </TT><TT>        </TT>error value<BR>
-<P>
-A status value indicating success or failure is returned; the error value
-argument <I>error</I> passes more detailed information about
-read failures.
-<P>
----------------------------------------------------------
-<BR>
-
-int <B>mb_get</B>(
-<BR> <TT>       </TT><TT>        </TT>int <I>verbose</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>char <I>*mbio_ptr</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*kind</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*pings</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>time_i[7]</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*time_d</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*navlon</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*navlat</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*speed</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*heading</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*distance</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*altitude</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*sonardepth</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*nbath</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*namp</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*nss</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>char <I>*beamflag</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*bath</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*amp</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*bathacrosstrack</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*bathalongtrack</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*ss</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*ssacrosstrack</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*ssalongtrack</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>char <I>*comment</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*error</I>);<BR>
-<P>
-The function <B>mb_get</B> reads, processes, and returns sonar
-data according to the <B>MBIO</B> descriptor pointed to by <I>mbio_ptr</I>.
-The <I>verbose</I>
-value controls the standard error output verbosity of the function. A number
-of different data record types are recognized by <B>MB-System</B>, but
-<B>mb_get()</B> only returns survey and comment data records. The
-<I>kind</I> value indicates which type of record has been read.
-The data is in the form of bathymetry, amplitude, and sidescan values combined
-with the acrosstrack and alongtrack distances relative to the navigation
-of the bathymetry and sidescan
-measurements (amplitudes are coincident with the bathymetry values).
-<P>
-The return values are:
-<BR> <TT>       </TT><I>kind</I>:<TT>   </TT><TT>        </TT>kind of data record read<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>1<TT>       </TT>survey data<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>2<TT>       </TT>comment<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>>=3<TT>     </TT>other data that cannot<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>be passed by <B>mb_get</B><BR>
-<BR> <TT>       </TT><I>pings</I>:<TT>  </TT><TT>        </TT>number of pings averaged to give current data<BR>
-<BR> <TT>       </TT><I>time_i</I>:<TT> </TT><TT>        </TT>time of current ping<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><I>time_i</I>[0]: year<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><I>time_i</I>[1]: month<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><I>time_i</I>[2]: day<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><I>time_i</I>[3]: hour<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><I>time_i</I>[4]: minute<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><I>time_i</I>[5]: second<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><I>time_i</I>[6]: microsecond<BR>
-<BR> <TT>       </TT><I>time_d</I>:<TT> </TT><TT>        </TT>time of current ping in seconds<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT>since 1/1/70 00:00:00<BR>
-<BR> <TT>       </TT><I>navlon</I>:<TT> </TT><TT>        </TT>longitude<BR>
-<BR> <TT>       </TT><I>navlat</I>:<TT> </TT><TT>        </TT>latitude<BR>
-<BR> <TT>       </TT><I>speed</I>:<TT>  </TT><TT>        </TT>ship speed in km/s<BR>
-<BR> <TT>       </TT><I>heading</I>:<TT>        </TT><TT>        </TT>ship heading in degrees<BR>
-<BR> <TT>       </TT><I>distance</I>:<TT>       </TT>distance along shiptrack since last<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT>ping in km<BR>
-<BR> <TT>       </TT><I>altitude</I>:<TT>       </TT><TT>        </TT>altitude of sonar above seafloor<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT>in m<BR>
-<BR> <TT>       </TT><I>sonardepth</I>:<TT>     </TT>depth of sonar in m<BR>
-<BR> <TT>       </TT><I>nbath</I>:<TT>  </TT><TT>        </TT>number of bathymetry values<BR>
-<BR> <TT>       </TT><I>namp</I>:<TT>   </TT><TT>        </TT>number of amplitude values<BR>
-<BR> <TT>       </TT><I>nss</I>:<TT>    </TT><TT>        </TT>number of sidescan values<BR>
-<BR> <TT>       </TT><I>beamflag</I>:<TT>       </TT><TT>        </TT>array of bathymetry flags<BR>
-<BR> <TT>       </TT><I>bath</I>:<TT>   </TT><TT>        </TT>array of bathymetry values in meters<BR>
-<BR> <TT>       </TT><I>amp</I>:<TT>    </TT><TT>        </TT>array of amplitude values in unknown units<BR>
-<BR> <TT>       </TT><I>bathacrosstrack</I>:<TT>        </TT>array of of acrosstrack distances<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT>in meters corresponding to bathymetry<BR>
-<BR> <TT>       </TT><I>bathalongtrack</I>:<TT> </TT>array of of alongtrack distances<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT>in meters corresponding to bathymetry<BR>
-<BR> <TT>       </TT><I>ss</I>:<TT>     </TT><TT>        </TT>array of sidescan values in unknown units<BR>
-<BR> <TT>       </TT><I>ssacrosstrack</I>:<TT>  </TT>array of of acrosstrack distances<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT>in meters corresponding to sidescan<BR>
-<BR> <TT>       </TT><I>ssacrosstrack</I>:<TT>  </TT>array of of alongtrack distances<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT>in meters corresponding to sidescan<BR>
-<BR> <TT>       </TT><I>comment</I>:<TT>        </TT><TT>        </TT>comment string<BR>
-<BR> <TT>       </TT><I>error</I>:<TT>  </TT><TT>        </TT>error value<BR>
-<P>
-A status value indicating success or failure is returned; the error value
-argument <I>error</I> passes more detailed information about
-read failures.
-<P>
-<A NAME="lbAO"> </A>
-<H2>LEVEL 2 FUNCTIONS</H2>
-
-<P>
-int <B>mb_read_ping</B>(
-<BR> <TT>       </TT><TT>        </TT>int <I>verbose</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>char <I>*mbio_ptr</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>char <I>*store_ptr</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*kind</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*error</I>);<BR>
-<P>
-The function <B>mb_read_ping</B> reads and returns sonar
-data according to the <B>MBIO</B> descriptor pointed to by <I>mbio_ptr</I>.
-The <I>verbose</I>
-value controls the standard error output verbosity of the function.
-The data is returned one record at a time; no averaging is performed.
-A pointer to a data structure containing all of the data read is returned
-as <I>store_ptr</I>; the form of the data structure is determined by the
-sonar system associated with the format of the data being read. A number
-of different data record types are recognized by <B>MB-System</B>; the
-<I>kind</I> value indicates which type of record has been read.
-<P>
-The return values are:
-<BR> <TT>       </TT><I>store_ptr</I>:<TT>      </TT>pointer to complete data structure<BR>
-<BR> <TT>       </TT><I>kind</I>:<TT>   </TT><TT>        </TT>kind of data record read<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>1<TT>       </TT>survey data<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>2<TT>       </TT>comment<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>3<TT>       </TT>header<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>4<TT>       </TT>calibrate<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>5<TT>       </TT>mean sound speed<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>6<TT>       </TT>SVP<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>7<TT>       </TT>standby<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>8<TT>       </TT>nav source<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>9<TT>       </TT>parameter<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>10<TT>      </TT>start<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>11<TT>      </TT>stop<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>12<TT>      </TT>nav<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>13<TT>      </TT>run parameter<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>14<TT>      </TT>clock<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>15<TT>      </TT>tide<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>16<TT>      </TT>height<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>17<TT>      </TT>heading<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>18<TT>      </TT>attitude<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>19<TT>      </TT>ssv<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>20<TT>      </TT>angle<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>21<TT>      </TT>event<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>22<TT>      </TT>history<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>23<TT>      </TT>summary<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>24<TT>      </TT>processing parameters<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>25<TT>      </TT>sensor parameters<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>26<TT>      </TT>navigation error<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>27<TT>      </TT>uninterpretable line<BR>
-<BR> <TT>       </TT><I>error</I>:<TT>  </TT><TT>        </TT>error value<BR>
-<P>
-A status value indicating success or failure is returned; the error value
-argument <I>error</I> passes more detailed information about
-read failures.
-<P>
----------------------------------------------------------
-<BR>
-
-int <B>mb_write_ping</B>(
-<BR> <TT>       </TT><TT>        </TT>int <I>verbose</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>char <I>*mbio_ptr</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>char <I>*store_ptr</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*error</I>);<BR>
-<P>
-The function <B>mb_write_ping</B> writes sonar data to the file listed
-in the <B>MBIO</B> descriptor pointed to by <I>MBIO_ptr</I>.
-The <I>verbose</I>
-value controls the standard error output verbosity of the function.
-A pointer to a data structure containing all of the data read is passed
-as <I>store_ptr</I>; the form of the data structure is determined by the
-sonar system associated with the format of the data being written.
-The values to be output are:
-<BR> <TT>       </TT><I>store_ptr</I>:<TT>      </TT>pointer to complete data structure<BR>
-<P>
-The return values are:
-<BR> <TT>       </TT><I>error</I>:<TT>  </TT><TT>        </TT>error value<BR>
-<P>
-A status value indicating success or failure is returned; the error value
-argument <I>error</I> passes more detailed information about
-write failures.
-<P>
----------------------------------------------------------
-<BR>
-
-int <B>mb_get_store</B>(
-<BR> <TT>       </TT><TT>        </TT>int <I>verbose</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>char <I>*mbio_ptr</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>char <I>**store_ptr</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*error</I>);<BR>
-<P>
-The function <B>mb_get_store()</B> returns a pointer <I>*store_ptr</I>
-to the data storage structure associated with a particular <B>MBIO</B>
-descriptor <I>mbio_ptr</I>. The <B>mb_read_init()</B> and
-<B>mb_write_init()</B> functions
-both allocate one of these internal storage structures. The
-form of the data structure is determined by the
-sonar system associated with the format of the data being written.
-Storage structure pointers must be passed to level two <B>MBIO</B>
-functions such as <B>mb_write_ping()</B> and <B>mb_insert()</B>.
-The <I>verbose</I> value controls the standard error
-output verbosity of the function.
-<P>
-The return values are:
-<BR> <TT>       </TT><I>store_ptr</I>:<TT>      </TT>pointer to complete data structure<BR>
-<BR> <TT>       </TT><I>error</I>:<TT>  </TT><TT>        </TT>error value<BR>
-<P>
-A status value indicating success or failure is returned; the error value
-argument <I>error</I> passes more detailed information about failures.
-<P>
----------------------------------------------------------
-<BR>
-
-int <B>mb_get_all</B>(
-<BR> <TT>       </TT><TT>        </TT>int <I>verbose</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>char <I>*mbio_ptr</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>char <I>**store_ptr</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*kind</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>time_i[7]</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*time_d</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*navlon</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*navlat</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*speed</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*heading</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*distance</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*altitude</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*sonardepth</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*nbath</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*namp</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*nss</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>char <I>*beamflag</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*bath</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*amp</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*bathacrosstrack</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*bathalongtrack</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*ss</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*ssacrosstrack</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*ssalongtrack</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>char <I>*comment</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*error</I>);<BR>
-<P>
-The function <B>mb_get_all</B> reads and returns sonar
-data according to the <B>MBIO</B> descriptor pointed to by <I>mbio_ptr</I>.
-The <I>verbose</I>
-value controls the standard error output verbosity of the function.
-The data is returned one record at a time; no averaging is performed.
-A pointer to a data structure containing all of the data read is returned
-as <I>store_ptr</I>; the form of the data structure is determined by the
-sonar system associated with the format of the data being read. A number
-of different data record types are recognized by <B>MB-System</B>; the
-<I>kind</I> value indicates which type of record has been read. Additional
-data is returned if the data record is survey data (navigation,
-bathymetry, amplitude, and sidescan), navigation data (navigation only), or
-comment data (comment only).
-<P>
-The return values are:
-<BR> <TT>       </TT><I>store_ptr</I>:<TT>      </TT>pointer to complete data structure<BR>
-<BR> <TT>       </TT><I>kind</I>:<TT>   </TT><TT>        </TT>kind of data record read<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>1<TT>       </TT>survey data<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>2<TT>       </TT>comment<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>3<TT>       </TT>header<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>4<TT>       </TT>calibrate<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>5<TT>       </TT>mean sound speed<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>6<TT>       </TT>SVP<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>7<TT>       </TT>standby<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>8<TT>       </TT>nav source<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>9<TT>       </TT>parameter<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>10<TT>      </TT>start<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>11<TT>      </TT>stop<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>12<TT>      </TT>nav<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>13<TT>      </TT>run parameter<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>14<TT>      </TT>clock<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>15<TT>      </TT>tide<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>16<TT>      </TT>height<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>17<TT>      </TT>heading<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>18<TT>      </TT>attitude<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>19<TT>      </TT>ssv<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>20<TT>      </TT>angle<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>21<TT>      </TT>event<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>22<TT>      </TT>history<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>23<TT>      </TT>summary<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>24<TT>      </TT>processing parameters<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>25<TT>      </TT>sensor parameters<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>26<TT>      </TT>navigation error<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>27<TT>      </TT>uninterpretable line<BR>
-<BR> <TT>       </TT><I>time_i</I>:<TT> </TT><TT>        </TT>time of current ping<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><I>time_i</I>[0]: year<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><I>time_i</I>[1]: month<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><I>time_i</I>[2]: day<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><I>time_i</I>[3]: hour<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><I>time_i</I>[4]: minute<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><I>time_i</I>[5]: second<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><I>time_i</I>[6]: microsecond<BR>
-<BR> <TT>       </TT><I>time_d</I>:<TT> </TT><TT>        </TT>time of current ping in seconds<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT>since 1/1/70 00:00:00<BR>
-<BR> <TT>       </TT><I>navlon</I>:<TT> </TT><TT>        </TT>longitude<BR>
-<BR> <TT>       </TT><I>navlat</I>:<TT> </TT><TT>        </TT>latitude<BR>
-<BR> <TT>       </TT><I>speed</I>:<TT>  </TT><TT>        </TT>ship speed in km/s<BR>
-<BR> <TT>       </TT><I>heading</I>:<TT>        </TT><TT>        </TT>ship heading in degrees<BR>
-<BR> <TT>       </TT><I>distance</I>:<TT>       </TT>distance along shiptrack since last<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT>ping in km<BR>
-<BR> <TT>       </TT><I>altitude</I>:<TT>       </TT><TT>        </TT>altitude of sonar above seafloor<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT>in m<BR>
-<BR> <TT>       </TT><I>sonardepth</I>:<TT>     </TT>depth of sonar in m<BR>
-<BR> <TT>       </TT><I>nbath</I>:<TT>  </TT><TT>        </TT>number of bathymetry values<BR>
-<BR> <TT>       </TT><I>namp</I>:<TT>   </TT><TT>        </TT>number of amplitude values<BR>
-<BR> <TT>       </TT><I>nss</I>:<TT>    </TT><TT>        </TT>number of sidescan values<BR>
-<BR> <TT>       </TT><I>beamflag</I>:<TT>       </TT><TT>        </TT>array of bathymetry flags<BR>
-<BR> <TT>       </TT><I>bath</I>:<TT>   </TT><TT>        </TT>array of bathymetry values in meters<BR>
-<BR> <TT>       </TT><I>amp</I>:<TT>    </TT><TT>        </TT>array of amplitude values in unknown units<BR>
-<BR> <TT>       </TT><I>bathacrosstrack</I>:<TT>        </TT>array of of acrosstrack distances<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT>in meters corresponding to bathymetry<BR>
-<BR> <TT>       </TT><I>bathalongtrack</I>:<TT> </TT>array of of alongtrack distances<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT>in meters corresponding to bathymetry<BR>
-<BR> <TT>       </TT><I>ss</I>:<TT>     </TT><TT>        </TT>array of sidescan values in unknown units<BR>
-<BR> <TT>       </TT><I>ssacrosstrack</I>:<TT>  </TT>array of of acrosstrack distances<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT>in meters corresponding to sidescan<BR>
-<BR> <TT>       </TT><I>ssacrosstrack</I>:<TT>  </TT>array of of alongtrack distances<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT>in meters corresponding to sidescan<BR>
-<BR> <TT>       </TT><I>comment</I>:<TT>        </TT>comment string<BR>
-<BR> <TT>       </TT><I>error</I>:<TT>  </TT><TT>        </TT>error value<BR>
-<P>
-A status value indicating success or failure is returned; the error value
-argument <I>error</I> passes more detailed information about
-read failures.
-<P>
----------------------------------------------------------
-<BR>
-
-int <B>mb_put_all</B>(
-<BR> <TT>       </TT><TT>        </TT>int <I>verbose</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>char <I>*mbio_ptr</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>char <I>*store_ptr</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>usevalues</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>kind</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>time_i[7]</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>time_d</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>navlon</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>navlat</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>speed</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>heading</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>nbath</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>namp</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>nss</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>char <I>*beamflag</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*bath</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*amp</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*bathacrosstrack</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*bathalongtrack</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*ss</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*ssacrosstrack</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*ssalongtrack</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>char <I>*comment</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*error</I>);<BR>
-<P>
-The function <B>mb_put_all</B> writes sonar data to the file listed
-in the <B>MBIO</B> descriptor pointed to by <I>MBIO_ptr</I>.
-The <I>verbose</I>
-value controls the standard error output verbosity of the function.
-A pointer to a data structure containing all of the data read is passed
-as <I>store_ptr</I>; the form of the data structure is determined by the
-sonar system associated with the format of the data being written.
-Additional data is passed if the data record is survey data (navigation,
-bathymetry, amplitude, and sidescan), navigation data (navigation only), or
-comment data (comment only).
-If the <I>usevalues</I> flag is set to 1,
-then the passed values will be inserted in the data structure
-pointed to by <I>store_ptr</I> before
-the data is written.  If the <I>usevalues</I> flag is set to 0, the data
-structure pointed to by <I>store_ptr</I> will be written without modification.
-The values to be output are:
-<BR> <TT>       </TT><I>store_ptr</I>:<TT>      </TT>pointer to complete data structure<BR>
-<BR> <TT>       </TT><I>usevalues</I>:<TT>      </TT>flag controlling use of data passed by value<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>0<TT>       </TT>do not insert into data<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>structure before writing<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>the data<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>1<TT>       </TT>insert into data structure<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>before writing the data<BR>
-<BR> <TT>       </TT><I>kind</I>:<TT>   </TT><TT>        </TT>kind of data record to be written<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>1<TT>       </TT>survey data<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>2<TT>       </TT>comment<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>3<TT>       </TT>header<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>4<TT>       </TT>calibrate<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>5<TT>       </TT>mean sound speed<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>6<TT>       </TT>SVP<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>7<TT>       </TT>standby<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>8<TT>       </TT>nav source<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>9<TT>       </TT>parameter<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>10<TT>      </TT>start<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>11<TT>      </TT>stop<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>12<TT>      </TT>nav<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>13<TT>      </TT>run parameter<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>14<TT>      </TT>clock<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>15<TT>      </TT>tide<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>16<TT>      </TT>height<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>17<TT>      </TT>heading<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>18<TT>      </TT>attitude<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>19<TT>      </TT>ssv<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>20<TT>      </TT>angle<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>21<TT>      </TT>event<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>22<TT>      </TT>history<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>23<TT>      </TT>summary<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>24<TT>      </TT>processing parameters<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>25<TT>      </TT>sensor parameters<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>26<TT>      </TT>navigation error<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>27<TT>      </TT>uninterpretable line<BR>
-<BR> <TT>       </TT><I>time_i</I>:<TT> </TT><TT>        </TT>time of current ping (used if <I>time_i</I>[0] != 0)<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><I>time_i</I>[0]: year<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><I>time_i</I>[1]: month<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><I>time_i</I>[2]: day<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><I>time_i</I>[3]: hour<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><I>time_i</I>[4]: minute<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><I>time_i</I>[5]: second<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><I>time_i</I>[6]: microsecond<BR>
-<BR> <TT>       </TT><I>time_d</I>:<TT> </TT><TT>        </TT>time of current ping in seconds since<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT>1/1/70 00:00:00 (used if <I>time_i</I>[0] = 0)<BR>
-<BR> <TT>       </TT><I>navlon</I>:<TT> </TT><TT>        </TT>longitude<BR>
-<BR> <TT>       </TT><I>navlat</I>:<TT> </TT><TT>        </TT>latitude<BR>
-<BR> <TT>       </TT><I>speed</I>:<TT>  </TT><TT>        </TT>ship speed in km/s<BR>
-<BR> <TT>       </TT><I>heading</I>:<TT>        </TT><TT>        </TT>ship heading in degrees<BR>
-<BR> <TT>       </TT><I>nbath</I>:<TT>  </TT><TT>        </TT>number of bathymetry values<BR>
-<BR> <TT>       </TT><I>namp</I>:<TT>   </TT><TT>        </TT>number of amplitude values<BR>
-<BR> <TT>       </TT><I>nss</I>:<TT>    </TT><TT>        </TT>number of sidescan values<BR>
-<BR> <TT>       </TT><I>beamflag</I>:<TT>       </TT><TT>        </TT>array of bathymetry flags<BR>
-<BR> <TT>       </TT><I>bath</I>:<TT>   </TT><TT>        </TT>array of bathymetry values in meters<BR>
-<BR> <TT>       </TT><I>amp</I>:<TT>    </TT><TT>        </TT>array of amplitude values in unknown units<BR>
-<BR> <TT>       </TT><I>bathacrosstrack</I>:<TT>        </TT>array of of acrosstrack distances<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT>in meters corresponding to bathymetry<BR>
-<BR> <TT>       </TT><I>bathalongtrack</I>:<TT> </TT>array of of alongtrack distances<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT>in meters corresponding to bathymetry<BR>
-<BR> <TT>       </TT><I>ss</I>:<TT>     </TT><TT>        </TT>array of sidescan values in unknown units<BR>
-<BR> <TT>       </TT><I>ssacrosstrack</I>:<TT>  </TT>array of of acrosstrack distances<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT>in meters corresponding to sidescan<BR>
-<BR> <TT>       </TT><I>ssacrosstrack</I>:<TT>  </TT>array of of alongtrack distances<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT>in meters corresponding to sidescan<BR>
-<BR> <TT>       </TT><I>comment</I>:<TT>        </TT>comment string<BR>
-<P>
-The return values are:
-<BR> <TT>       </TT><I>error</I>:<TT>  </TT><TT>        </TT>error value<BR>
-<P>
-A status value indicating success or failure is returned; the error value
-argument <I>error</I> passes more detailed information about
-write failures.
-<P>
----------------------------------------------------------
-<BR>
-
-int <B>mb_put_comment</B>(
-<BR> <TT>       </TT><TT>        </TT>int <I>verbose</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>char <I>*mbio_ptr</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>char <I>*comment</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*error</I>);<BR>
-<P>
-The function <B>mb_put_comment</B> writes a comment to the file listed
-in the <B>MBIO</B> descriptor pointed to by <I>MBIO_ptr</I>.
-The <I>verbose</I>
-value controls the standard error output verbosity of the function.
-The data is in the form of a null terminated string. The maximum
-length of comments varies with different data formats. In
-general individual comments should be less than 80 characters
-long to insure compatibility with all formats.
-The values to be output are:
-<BR> <TT>       </TT><I>comment</I>:<TT>        </TT><TT>        </TT>comment string<BR>
-<P>
-The return values are:
-<BR> <TT>       </TT><I>error</I>:<TT>  </TT><TT>        </TT>error value<BR>
-<P>
-A status value indicating success or failure is returned; the error value
-argument <I>error</I> passes more detailed information about
-write failures.
-<P>
----------------------------------------------------------
-<BR>
-
-int <B>mb_extract</B>(
-<BR> <TT>       </TT><TT>        </TT>int <I>verbose</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>char <I>*mbio_ptr</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>char <I>*store_ptr</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*kind</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>time_i[7]</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*time_d</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*navlon</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*navlat</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*speed</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*heading</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*nbath</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*namp</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*nss</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>char <I>*beamflag</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*bath</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*amp</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*bathacrosstrack</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*bathalongtrack</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*ss</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*ssacrosstrack</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*ssalongtrack</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>char <I>*comment</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*error</I>);<BR>
-<P>
-The function <B>mb_extract</B> extracts sonar data from the
-structure pointed to by <I>*store_ptr</I> according to the
-<B>MBIO</B> descriptor pointed to by <I>mbio_ptr</I>.
-The <I>verbose</I> value controls the standard
-error output verbosity of the function.
-The form of the data structure is determined by the
-sonar system associated with the format of the data being read. A number
-of different data record types are recognized by <B>MB-System</B>; the
-<I>kind</I> value indicates which type of record is stored in <I>*store_ptr</I>.
-Additional
-data is returned if the data record is survey data (navigation,
-bathymetry, amplitude, and sidescan), navigation data (navigation only), or
-comment data (comment only).
-<P>
-The return values are:
-<BR> <TT>       </TT><I>kind</I>:<TT>   </TT><TT>        </TT>kind of data record read<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>1<TT>       </TT>survey data<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>2<TT>       </TT>comment<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>12<TT>      </TT>navigation<BR>
-<BR> <TT>       </TT><I>time_i</I>:<TT> </TT><TT>        </TT>time of current ping<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><I>time_i</I>[0]: year<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><I>time_i</I>[1]: month<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><I>time_i</I>[2]: day<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><I>time_i</I>[3]: hour<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><I>time_i</I>[4]: minute<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><I>time_i</I>[5]: second<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><I>time_i</I>[6]: microsecond<BR>
-<BR> <TT>       </TT><I>time_d</I>:<TT> </TT><TT>        </TT>time of current ping in seconds<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT>since 1/1/70 00:00:00<BR>
-<BR> <TT>       </TT><I>navlon</I>:<TT> </TT><TT>        </TT>longitude<BR>
-<BR> <TT>       </TT><I>navlat</I>:<TT> </TT><TT>        </TT>latitude<BR>
-<BR> <TT>       </TT><I>speed</I>:<TT>  </TT><TT>        </TT>ship speed in km/s<BR>
-<BR> <TT>       </TT><I>heading</I>:<TT>        </TT><TT>        </TT>ship heading in degrees<BR>
-<BR> <TT>       </TT><I>distance</I>:<TT>       </TT><TT>        </TT>distance along shiptrack since last<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT>ping in km<BR>
-<BR> <TT>       </TT><I>altitude</I>:<TT>       </TT><TT>        </TT>altitude of sonar above seafloor<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT>in m<BR>
-<BR> <TT>       </TT><I>sonardepth</I>:<TT>     </TT>depth of sonar in m<BR>
-<BR> <TT>       </TT><I>nbath</I>:<TT>  </TT><TT>        </TT>number of bathymetry values<BR>
-<BR> <TT>       </TT><I>namp</I>:<TT>   </TT><TT>        </TT>number of amplitude values<BR>
-<BR> <TT>       </TT><I>nss</I>:<TT>    </TT><TT>        </TT>number of sidescan values<BR>
-<BR> <TT>       </TT><I>beamflag</I>:<TT>       </TT><TT>        </TT>array of bathymetry flags<BR>
-<BR> <TT>       </TT><I>bath</I>:<TT>   </TT><TT>        </TT>array of bathymetry values in meters<BR>
-<BR> <TT>       </TT><I>amp</I>:<TT>    </TT><TT>        </TT>array of amplitude values in unknown units<BR>
-<BR> <TT>       </TT><I>bathacrosstrack</I>:<TT>        </TT>array of of acrosstrack distances<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT>in meters corresponding to bathymetry<BR>
-<BR> <TT>       </TT><I>bathalongtrack</I>:<TT> </TT>array of of alongtrack distances<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT>in meters corresponding to bathymetry<BR>
-<BR> <TT>       </TT><I>ss</I>:<TT>     </TT><TT>        </TT>array of sidescan values in unknown units<BR>
-<BR> <TT>       </TT><I>ssacrosstrack</I>:<TT>  </TT>array of of acrosstrack distances<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT>in meters corresponding to sidescan<BR>
-<BR> <TT>       </TT><I>ssacrosstrack</I>:<TT>  </TT>array of of alongtrack distances<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT>in meters corresponding to sidescan<BR>
-<BR> <TT>       </TT><I>comment</I>:<TT>        </TT>comment string<BR>
-<BR> <TT>       </TT><I>error</I>:<TT>  </TT><TT>        </TT>error value<BR>
-<P>
-A status value indicating success or failure is returned; the error value
-argument <I>error</I> passes more detailed information about
-extract failures.
-<P>
----------------------------------------------------------
-<BR>
-
-int <B>mb_insert</B>(
-<BR> <TT>       </TT><TT>        </TT>int <I>verbose</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>char <I>*mbio_ptr</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>char <I>*store_ptr</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>kind</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>time_i[7]</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>time_d</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>navlon</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>navlat</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>speed</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>heading</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>nbath</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>namp</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>nss</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>char <I>*beamflag</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*bath</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*amp</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*bathacrosstrack</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*bathalongtrack</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*ss</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*ssacrosstrack</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*ssalongtrack</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>char <I>*comment</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*error</I>);<BR>
-<P>
-The function <B>mb_insert</B> inserts sonar data into the
-structure pointed to by <I>*store_ptr</I> according to the
-<B>MBIO</B> descriptor pointed to by <I>mbio_ptr</I>.
-The <I>verbose</I> value controls the standard
-error output verbosity of the function.
-The form of the data structure is determined by the
-sonar system associated with the format of the data being read. A number
-of different data record types are recognized by <B>MB-System</B>; the
-<I>kind</I> value indicates which type of
-record is to be stored in <I>*store_ptr</I>.
-Data will be inserted only if the data record is survey data (navigation,
-bathymetry, amplitude, and sidescan), navigation data (navigation only), or
-comment data (comment only).
-The values to be inserted are:
-<BR> <TT>       </TT><I>kind</I>:<TT>   </TT><TT>        </TT>kind of data record inserted<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>1<TT>       </TT>survey data<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>2<TT>       </TT>comment<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>12<TT>      </TT>navigation<BR>
-<BR> <TT>       </TT><I>time_i</I>:<TT> </TT><TT>        </TT>time of current ping<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><I>time_i</I>[0]: year<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><I>time_i</I>[1]: month<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><I>time_i</I>[2]: day<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><I>time_i</I>[3]: hour<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><I>time_i</I>[4]: minute<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><I>time_i</I>[5]: second<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><I>time_i</I>[6]: microsecond<BR>
-<BR> <TT>       </TT><I>time_d</I>:<TT> </TT><TT>        </TT>time of current ping in seconds<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT>since 1/1/70 00:00:00<BR>
-<BR> <TT>       </TT><I>navlon</I>:<TT> </TT><TT>        </TT>longitude<BR>
-<BR> <TT>       </TT><I>navlat</I>:<TT> </TT><TT>        </TT>latitude<BR>
-<BR> <TT>       </TT><I>speed</I>:<TT>  </TT><TT>        </TT>ship speed in km/s<BR>
-<BR> <TT>       </TT><I>heading</I>:<TT>        </TT><TT>        </TT>ship heading in degrees<BR>
-<BR> <TT>       </TT><I>distance</I>:<TT>       </TT><TT>        </TT>distance along shiptrack since last<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT>ping in km<BR>
-<BR> <TT>       </TT><I>altitude</I>:<TT>       </TT><TT>        </TT>altitude of sonar above seafloor<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT>in m<BR>
-<BR> <TT>       </TT><I>sonardepth</I>:<TT>     </TT>depth of sonar in m<BR>
-<BR> <TT>       </TT><I>nbath</I>:<TT>  </TT><TT>        </TT>number of bathymetry values<BR>
-<BR> <TT>       </TT><I>namp</I>:<TT>   </TT><TT>        </TT>number of amplitude values<BR>
-<BR> <TT>       </TT><I>nss</I>:<TT>    </TT><TT>        </TT>number of sidescan values<BR>
-<BR> <TT>       </TT><I>beamflag</I>:<TT>       </TT><TT>        </TT>array of bathymetry flags<BR>
-<BR> <TT>       </TT><I>bath</I>:<TT>   </TT><TT>        </TT>array of bathymetry values in meters<BR>
-<BR> <TT>       </TT><I>amp</I>:<TT>    </TT><TT>        </TT>array of amplitude values in unknown units<BR>
-<BR> <TT>       </TT><I>bathacrosstrack</I>:<TT>        </TT>array of of acrosstrack distances<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT>in meters corresponding to bathymetry<BR>
-<BR> <TT>       </TT><I>bathalongtrack</I>:<TT> </TT>array of of alongtrack distances<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT>in meters corresponding to bathymetry<BR>
-<BR> <TT>       </TT><I>ss</I>:<TT>     </TT><TT>        </TT>array of sidescan values in unknown units<BR>
-<BR> <TT>       </TT><I>ssacrosstrack</I>:<TT>  </TT>array of of acrosstrack distances<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT>in meters corresponding to sidescan<BR>
-<BR> <TT>       </TT><I>ssacrosstrack</I>:<TT>  </TT>array of of alongtrack distances<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT>in meters corresponding to sidescan<BR>
-<BR> <TT>       </TT><I>comment</I>:<TT>        </TT>comment string<BR>
-<P>
-The return values are:
-<BR> <TT>       </TT><I>error</I>:<TT>  </TT><TT>        </TT>error value<BR>
-<P>
-A status value indicating success or failure is returned; the error value
-argument <I>error</I> passes more detailed information about
-insert failures.
-<P>
----------------------------------------------------------
-<BR>
-
-int <B>mb_extract_nav</B>(
-<BR> <TT>       </TT><TT>        </TT>int <I>verbose</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>char <I>*mbio_ptr</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>char <I>*store_ptr</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*kind</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>time_i[7]</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*time_d</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*navlon</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*navlat</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*speed</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*heading</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*draft</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*roll</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*pitch</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*heave</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*error</I>);<BR>
-<P>
-The function <B>mb_extract_nav</B> extracts navigation data from the
-structure pointed to by <I>*store_ptr</I> according to the
-<B>MBIO</B> descriptor pointed to by <I>mbio_ptr</I>.
-The <I>verbose</I> value controls the standard
-error output verbosity of the function.
-The form of the data structure is determined by the
-sonar system associated with the format of the data being read. A number
-of different data record types are recognized by <B>MB-System</B>; the
-<I>kind</I> value indicates which type of record is stored in <I>*store_ptr</I>.
-Navigation
-data is returned if the data record is survey data (navigation,
-bathymetry, amplitude, and sidescan) or navigation data (navigation only).
-<P>
-The return values are:
-<BR> <TT>       </TT><I>kind</I>:<TT>   </TT><TT>        </TT>kind of data record read<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT>1<TT>       </TT>survey data<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT>12<TT>      </TT>navigation<BR>
-<BR> <TT>       </TT><I>time_i</I>:<TT> </TT><TT>        </TT>time of current ping<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><I>time_i</I>[0]: year<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><I>time_i</I>[1]: month<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><I>time_i</I>[2]: day<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><I>time_i</I>[3]: hour<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><I>time_i</I>[4]: minute<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><I>time_i</I>[5]: second<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><I>time_i</I>[6]: microsecond<BR>
-<BR> <TT>       </TT><I>time_d</I>:<TT> </TT><TT>        </TT>time of current ping in seconds<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT>since 1/1/70 00:00:00<BR>
-<BR> <TT>       </TT><I>navlon</I>:<TT> </TT><TT>        </TT>longitude<BR>
-<BR> <TT>       </TT><I>navlat</I>:<TT> </TT><TT>        </TT>latitude<BR>
-<BR> <TT>       </TT><I>speed</I>:<TT>  </TT><TT>        </TT>ship speed in km/s<BR>
-<BR> <TT>       </TT><I>heading</I>:<TT>        </TT><TT>        </TT>ship heading in degrees<BR>
-<BR> <TT>       </TT><I>draft</I>:<TT>  </TT><TT>        </TT>sonar depth in meters<BR>
-<BR> <TT>       </TT><I>roll</I>:<TT>   </TT><TT>        </TT>sonar roll in degrees<BR>
-<BR> <TT>       </TT><I>pitch</I>:<TT>  </TT><TT>        </TT>sonar pitch in degrees<BR>
-<BR> <TT>       </TT><I>heave</I>:<TT>  </TT><TT>        </TT>sonar heave in meters<BR>
-<P>
-A status value indicating success or failure is returned; the error value
-argument <I>error</I> passes more detailed information about
-extract failures.
-<P>
----------------------------------------------------------
-<BR>
-
-int <B>mb_insert_nav</B>(
-<BR> <TT>       </TT><TT>        </TT>int <I>verbose</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>char <I>*mbio_ptr</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>char <I>*store_ptr</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>time_i[7]</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>time_d</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>navlon</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>navlat</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>speed</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>heading</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>draft</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>roll</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>pitch</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>heave</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*error</I>);<BR>
-<P>
-The function <B>mb_insert_nav</B> inserts navigation data into the
-structure pointed to by <I>*store_ptr</I> according to the
-<B>MBIO</B> descriptor pointed to by <I>mbio_ptr</I>.
-The <I>verbose</I> value controls the standard
-error output verbosity of the function.
-The form of the data structure is determined by the
-sonar system associated with the format of the data being read. A number
-of different data record types are recognized by <B>MB-System</B>; the
-<I>kind</I> value indicates which type of
-record is to be stored in <I>*store_ptr</I>.
-Data will be inserted only if the data record is survey data (navigation,
-bathymetry, amplitude, and sidescan), or navigation data (navigation only).
-The values to be inserted are:
-<BR> <TT>       </TT><I>time_i</I>:<TT> </TT><TT>        </TT>time of current ping<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><I>time_i</I>[0]: year<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><I>time_i</I>[1]: month<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><I>time_i</I>[2]: day<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><I>time_i</I>[3]: hour<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><I>time_i</I>[4]: minute<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><I>time_i</I>[5]: second<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><I>time_i</I>[6]: microsecond<BR>
-<BR> <TT>       </TT><I>time_d</I>:<TT> </TT><TT>        </TT>time of current ping in seconds<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT>since 1/1/70 00:00:00<BR>
-<BR> <TT>       </TT><I>navlon</I>:<TT> </TT><TT>        </TT>longitude<BR>
-<BR> <TT>       </TT><I>navlat</I>:<TT> </TT><TT>        </TT>latitude<BR>
-<BR> <TT>       </TT><I>speed</I>:<TT>  </TT><TT>        </TT>ship speed in km/s<BR>
-<BR> <TT>       </TT><I>heading</I>:<TT>        </TT><TT>        </TT>ship heading in degrees<BR>
-<BR> <TT>       </TT><I>draft</I>:<TT>  </TT><TT>        </TT>sonar depth in meters<BR>
-<BR> <TT>       </TT><I>roll</I>:<TT>   </TT><TT>        </TT>sonar roll in degrees<BR>
-<BR> <TT>       </TT><I>pitch</I>:<TT>  </TT><TT>        </TT>sonar pitch in degrees<BR>
-<BR> <TT>       </TT><I>heave</I>:<TT>  </TT><TT>        </TT>sonar heave in meters<BR>
-<P>
-The return values are:
-<BR> <TT>       </TT><I>error</I>:<TT>  </TT><TT>        </TT>error value<BR>
-<P>
-A status value indicating success or failure is returned; the error value
-argument <I>error</I> passes more detailed information about
-insert failures.
-<P>
----------------------------------------------------------
-<BR>
-
-int <B>mb_extract_altitude</B>(
-<BR> <TT>       </TT><TT>        </TT>int <I>verbose</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>char <I>*mbio_ptr</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>char <I>*store_ptr</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*kind</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*transducer_depth</I>,<BR>
-<BR>  <TT>      </TT><TT>        </TT>double <I>*altitude</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*error</I>);<BR>
-<P>
-The function <B>mb_extract_altitude</B> extracts the sonar transducer
-depth (<B>transducer_depth</B>) below the sea surface
-and the the sonar transducer <B>altitude</B> above the seafloor
-according to the
-<B>MBIO</B> descriptor pointed to by <I>mbio_ptr</I>.
-This function is not defined for all data formats.
-The <I>verbose</I> value controls the standard
-error output verbosity of the function.
-The form of the data structure is determined by the
-sonar system associated with the format of the data being read. A number
-of different data record types are recognized by <B>MB-System</B>; the
-<I>kind</I> value indicates which type of record is stored in <I>*store_ptr</I>.
-These data are returned only if the data record is survey data.
-These values are useful for
-sidescan processing applications. Both transducer depths and
-altitudes are reported in meters.
-<P>
-The return values are:
-<BR> <TT>       </TT><I>kind</I>:<TT>   </TT><TT>        </TT>kind of data record read (error<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT>if not survey data):<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>1<TT>       </TT>survey data<BR>
-<BR> <TT>       </TT><I>transducer_depth</I>:<TT>       </TT>depth of sonar in meters<BR>
-<BR> <TT>       </TT><I>altitude</I>:<TT>       </TT><TT>        </TT>altitude of sonar above seafloor<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT>in meters.<BR>
-<BR> <TT>       </TT><I>error</I>:<TT>  </TT><TT>        </TT>error value<BR>
-<P>
-A status value indicating success or failure is returned; the error value
-argument <I>error</I> passes more detailed information about
-data extraction failures.
-<P>
----------------------------------------------------------
-<BR>
-
-int <B>mb_insert_altitude</B>(
-<BR> <TT>       </TT><TT>        </TT>int <I>verbose</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>char <I>*mbio_ptr</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>char <I>*store_ptr</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>transducer_depth</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>altitude</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*error</I>);<BR>
-<P>
-The function <B>mb_insert_altitude</B> inserts
-sonar depth and altitude data into the
-structure pointed to by <I>*store_ptr</I> according to the
-<B>MBIO</B> descriptor pointed to by <I>mbio_ptr</I>.
-This function is not defined for all data formats.
-The <I>verbose</I> value controls the standard
-error output verbosity of the function.
-The form of the data structure is determined by the
-sonar system associated with the format of the data being read. A number
-of different data record types are recognized by <B>MB-System</B>.
-Data will be inserted only if the data record is survey data (navigation,
-bathymetry, amplitude, and sidescan).
-The values to be inserted are:
-<BR> <TT>       </TT><I>transducer_depth</I>:<TT>       </TT>depth of sonar in meters<BR>
-<BR> <TT>       </TT><I>altitude</I>:<TT>       </TT><TT>        </TT>altitude of sonar in meters<BR>
-<P>
-The return values are:
-<BR> <TT>       </TT><I>error</I>:<TT>  </TT><TT>        </TT>error value<BR>
-<P>
-A status value indicating success or failure is returned; the error value
-argument <I>error</I> passes more detailed information about
-insert failures.
-<P>
----------------------------------------------------------
-<BR>
-
-int <B>mb_extract_svp</B>(
-<BR> <TT>       </TT><TT>        </TT>int <I>verbose</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>char <I>*mbio_ptr</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>char <I>*store_ptr</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*kind</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*nsvp</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*depth</I>,<BR>
-<BR>  <TT>      </TT><TT>        </TT>double <I>*velocity</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*error</I>);<BR>
-<P>
-The function <B>mb_extract_svp</B> extracts a water sound
-velocity profile according to the
-<B>MBIO</B> descriptor pointed to by <I>mbio_ptr</I>.
-This function is not defined for all data formats.
-The <I>verbose</I> value controls the standard
-error output verbosity of the function.
-The form of the data structure is determined by the
-sonar system associated with the format of the data being read. A number
-of different data record types are recognized by <B>MB-System</B>; the
-<I>kind</I> value indicates which type of record is stored in <I>*store_ptr</I>.
-These data are returned only if the data record is a sound
-velocity profile record. These values are useful for
-calculating bathymetry from travel times and beam angles.
-<P>
-The return values are:
-<BR> <TT>       </TT><I>kind</I>:<TT>   </TT><TT>        </TT>kind of data record read (error<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT>if not SVP data):<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>6<TT>       </TT>SVP data<BR>
-<BR> <TT>       </TT><I>nsvp</I>:<TT>   </TT><TT>        </TT>number of depth and sound speed<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT>data in the profile<BR>
-<BR> <TT>       </TT><I>depth</I>:<TT>  </TT><TT>        </TT>array of depths in meters<BR>
-<BR> <TT>       </TT><I>velocity</I>:<TT>       </TT><TT>        </TT>array of sound speeds in m/sec<BR>
-<BR> <TT>       </TT><I>error</I>:<TT>  </TT><TT>        </TT>error value<BR>
-<P>
-A status value indicating success or failure is returned; the error value
-argument <I>error</I> passes more detailed information about
-data extraction failures.
-<P>
----------------------------------------------------------
-<BR>
-
-int <B>mb_insert_svp</B>(
-<BR> <TT>       </TT><TT>        </TT>int <I>verbose</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>char <I>*mbio_ptr</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>char <I>*store_ptr</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>nsvp</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*depth</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*velocity</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*error</I>);<BR>
-<P>
-The function <B>mb_insert_svp</B> inserts a water sound
-velocity profile according to the
-<B>MBIO</B> descriptor pointed to by <I>mbio_ptr</I>.
-This function is not defined for all data formats.
-The <I>verbose</I> value controls the standard
-error output verbosity of the function.
-The form of the data structure is determined by the
-sonar system associated with the format of the data being read. A number
-of different data record types are recognized by <B>MB-System</B>.
-These data are inserted only if the data record is a sound
-velocity profile record. These values are useful for
-calculating bathymetry from travel times and beam angles.
-The inserted values are:
-<BR> <TT>       </TT><I>nsvp</I>:<TT>   </TT><TT>        </TT>number of depth and sound speed<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT>data in the profile<BR>
-<BR> <TT>       </TT><I>depth</I>:<TT>  </TT><TT>        </TT>array of depths in meters<BR>
-<BR> <TT>       </TT><I>velocity</I>:<TT>       </TT><TT>        </TT>array of sound speeds in m/sec<BR>
-<P>
-The return values are:
-<BR> <TT>       </TT><I>error</I>:<TT>  </TT><TT>        </TT>error value<BR>
-<P>
-A status value indicating success or failure is returned; the error value
-argument <I>error</I> passes more detailed information about
-data insertion failures.
-<P>
----------------------------------------------------------
-<BR>
-
-int <B>mb_ttimes</B>(
-<BR> <TT>       </TT><TT>        </TT>int <I>verbose</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>char <I>*mbio_ptr</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>char <I>*store_ptr</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*kind</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*nbeams</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*ttimes</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double<TT>  </TT><I>*angles</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*angles_forward</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*angles_null</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*heave</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*alongtrack_offset</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*draft</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*ssv</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*error</I>);<BR>
-<P>
-The function <B>mb_ttimes</B> extracts travel times and beam
-angles from a sonar-specific data structure pointed to by
-<I>store_ptr</I>. These values are used for calculating
-swath bathymetry. The <I>verbose</I> value controls
-the standard error output verbosity of the function.
-The coordinates of the beam angles can be a bit confusing.
-The angles are returned in "takeoff angle coordinates"
-appropriate for raytracing. The array angles contains the
-angle from vertical and the array angles_forward
-contains the angle from acrosstrack. This
-coordinate system is distinct from the roll-pitch coordinates
-appropriate for correcting roll and pitch values. A description
-of these relevent coordinate systems is given below.
-The <B>angles_null</B> array
-contains the effective sonar array orientation for each beam. The
-<B>angles_null</B> array may be used to correct
-beam angles using Snell's law if the <B>ssv</B> is changed.
-The <B>angles_null</B> values reflect the sonar configuration.
-For example, some multibeam sonars have a flat transducer array, and
-so the <B>angles_null</B> array consists of <B>nbeams</B> zero values.
-Other multibeams have circular arrays so that the <B>angles_null</B>
-values equal the <B>angles</B> values. The <B>alongtrack_offset</B> array
-accommodates sonars which report multiple pings in a single
-survey record; each ping occurs at a different position along the
-shiptrack, producing alongtrack offsets relative to the navigation
-for some beam values. The sum of the <B>draft</B> value
-and the <B>heave</B> array values gives the depth
-of the sonar for each beam. For hull mounted installations the
-<B>draft</B> value is generally static but the <B>heave</B> values
-vary with time. For towed sonars the <B>draft</B> varies with time
-and the <B>heave</B> values are typically zero. The <B>ssv</B> value
-gives the water sound velocity at the sonar array.
-<P>
-The return values are:
-<BR> <TT>       </TT><I>kind</I>:<TT>   </TT><TT>        </TT>kind of data record read (error<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT>if not survey data):<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>1<TT>       </TT>survey data<BR>
-<BR> <TT>       </TT><I>nbeams</I>:<TT> </TT><TT>        </TT>number of beams<BR>
-<BR> <TT>       </TT><I>ttimes</I>:<TT> </TT><TT>        </TT>array of two-way travel times in seconds<BR>
-<BR> <TT>       </TT><I>angles</I>:<TT> </TT><TT>        </TT>array of angles from vertical in degrees<BR>
-<BR> <TT>       </TT><I>angles_forward</I>:<TT> </TT>array of angles from acrosstrack in degrees<BR>
-<BR> <TT>       </TT><I>angles_null</I>:<TT>    </TT>array of sonar array orientation in degrees<BR>
-<BR> <TT>       </TT><I>heave</I>:<TT>  </TT><TT>        </TT>array of heave values for each beam in meters<BR>
-<BR> <TT>       </TT><I>alongtrack_offset</I>:array of alongtrack distance offsets for<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT>each beam in meters<BR>
-<BR> <TT>       </TT><I>draft</I>:<TT>  </TT><TT>        </TT>draft of sonar in meters<BR>
-<BR> <TT>       </TT><I>ssv</I>:<TT>    </TT><TT>        </TT>water sound velocity at sonar in m/seconds<BR>
-<BR> <TT>       </TT><I>error</I>:<TT>  </TT><TT>        </TT>error value<BR>
-<P>
-A status value indicating success or failure is returned; the error value
-argument <I>error</I> passes more detailed information about
-data extraction failures.
-<P>
----------------------------------------------------------
-<BR>
-
-int <B>mb_detects</B>(
-<BR> <TT>       </TT><TT>        </TT>int <I>verbose</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>void <I>*mbio_ptr</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>void <I>*store_ptr</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*kind</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*nbeams</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*detects</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*error</I>);<BR>
-<P>
-The function <B>mb_detects</B> extracts beam bottom detect
-types from a sonar-specific data structure pointed to by
-<I>store_ptr</I>. These values indicate whether the depth
-value associated with a particular beam i derived from an
-amplitude detect (e.g. detects[i] = 1), a phase detect
-(e.g. detects[i] = 2), or the algorithm is unknown
-(e.g. detects[i] = 0). The <I>verbose</I> value controls
-the standard error output verbosity of the function.
-<P>
-The return values are:
-<BR> <TT>       </TT><I>kind</I>:<TT>   </TT><TT>        </TT>kind of data record read (error<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT>if not survey data):<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>1<TT>       </TT>survey data<BR>
-<BR> <TT>       </TT><I>nbeams</I>:<TT> </TT><TT>        </TT>number of beams<BR>
-<BR> <TT>       </TT><I>detects</I>:<TT>        </TT><TT>        </TT>array of <I>nbeams</I> bottom detect algorithm flags<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>0 = unknown<BR>
-<TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>1 = amplitude detect<BR>
-<TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>2 = phase detect<BR>
-<BR> <TT>       </TT><I>error</I>:<TT>  </TT><TT>        </TT>error value<BR>
-<P>
-A status value indicating success or failure is returned; the error value
-argument <I>error</I> passes more detailed information about
-data extraction failures. This functionality is available for
-only a subset of the supported sonars. If the corresponding low
-level routine is undefined, <I>*error</I> will be set to
-MB_ERROR_BAD_SYSTEM (14).
-<P>
----------------------------------------------------------
-<BR>
-
-int <B>mb_gains</B>(
-<BR> <TT>       </TT><TT>        </TT>int <I>verbose</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>void <I>*mbio_ptr</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>void <I>*store_ptr</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*kind</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*transmit_gain</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*pulse_length</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*receive_gain</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*error</I>);<BR>
-<P>
-The function <B>mb_gains</B> extracts the most basic gain
-settings from a sonar-specific data structure pointed to by
-<I>store_ptr</I>. In many cases, sonars have more complicated
-gain functions, particularly with respect to the receiver
-TVG function. In those cases, the receive gain returned here
-refers to the constant gain setting and does not include any
-TVG parameters. The <I>verbose</I> value controls
-the standard error output verbosity of the function.
-<P>
-The return values are:
-<BR> <TT>       </TT><I>kind</I>:<TT>   </TT><TT>        </TT>kind of data record read (error<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT>if not survey data):<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>1<TT>       </TT>survey data<BR>
-<BR> <TT>       </TT><I>transmit_gain</I>:<TT>  </TT>transmit gain (dB)<BR>
-<BR> <TT>       </TT><I>pulse_length</I>:<TT>   </TT>transmit pulse length (sec)<BR>
-<BR> <TT>       </TT><I>receive_gain</I>:<TT>   </TT>receive gain (dB)<BR>
-<BR> <TT>       </TT><I>error</I>:<TT>  </TT><TT>        </TT>error value<BR>
-<P>
-A status value indicating success or failure is returned; the error value
-argument <I>error</I> passes more detailed information about
-data extraction failures.  This functionality is available for
-only a subset of the supported sonars. If the corresponding low
-level routine is undefined, <I>*error</I> will be set to
-MB_ERROR_BAD_SYSTEM (14).
-<P>
----------------------------------------------------------
-<BR>
-
-int <B>mb_extract_rawss</B>(
-<BR> <TT>       </TT><TT>        </TT>int <I>verbose</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>char <I>*mbio_ptr</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>char <I>*store_ptr</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*kind</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*nrawss</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*rawss</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*rawssacrosstrack</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*rawssalongtrack</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*error</I>);<BR>
-<P>
-This function has not yet been implemented for any data format.
-The notion is that since some formats carry both "raw" and
-"processed" sidescan imagery, there should be functions to
-extract and insert the "raw" sidescan. Given that the meaning of "raw"
-sidescan varies greatly among sonars, the processing one might apply to
-the data will depend on the sonar source. The definition of
-<B>mb_extract_rawss</B> may well change when we actually implement it.
-<P>
----------------------------------------------------------
-<BR>
-
-int <B>mb_insert_rawss</B>(
-<BR> <TT>       </TT><TT>        </TT>int <I>verbose</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>char <I>*mbio_ptr</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>char <I>*store_ptr</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>nrawss</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*rawss</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*rawssacrosstrack</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*rawssalongtrack</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*error</I>);<BR>
-<P>
-This function has not yet been implemented for any data format.
-The notion is that since some formats carry both "raw" and
-"processed" sidescan imagery, there should be functions to
-extract and insert the "raw" sidescan. Given that the meaning of "raw"
-sidescan varies greatly among sonars, the processing one might apply to
-the data will depend on the sonar source. The definition of
-<B>mb_insert_rawss</B> may well change when we actually implement it.
-<P>
----------------------------------------------------------
-<BR>
-
-int <B>mb_copyrecord</B>(
-<BR> <TT>       </TT><TT>        </TT>int <I>verbose</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>char <I>*mbio_ptr</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>char <I>*store_ptr</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>char <I>*copy_ptr</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*error</I>);<BR>
-<P>
-The function <B>mb_copyrecord</B> copies the sonar-specific
-data structure pointed to by
-<I>store_ptr</I> into the data structure pointed to by <I>*copy_ptr</I>.
-The data structures must already have been allocated.
-<P>
-The return values are:
-<BR> <TT>       </TT><I>error</I>:<TT>  </TT><TT>        </TT>error value<BR>
-<P>
-A status value indicating success or failure is returned; the error value
-argument <I>error</I> passes more detailed information about
-data copy failures.
-<P>
-<A NAME="lbAP"> </A>
-<H2>LEVEL 3 FUNCTIONS</H2>
-
-<P>
-int <B>mb_buffer_init</B>(
-<BR> <TT>       </TT><TT>        </TT>int <I>verbose</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>char <I>**buff_ptr</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*error</I>);<BR>
-<P>
-The function <B>mb_buffer_init</B> initializes the data structures
-required for buffered i/0. A pointer to the buffer data structure
-is returned as *<I>buff_ptr</I>.
-The <I>verbose</I>
-value controls the standard error output verbosity of the function.
-<P>
-The return values are:
-<BR> <TT>       </TT>*<I>buff_ptr</I>:<TT>      </TT>pointer to buffer structure<BR>
-<BR> <TT>       </TT><I>error</I>:<TT>  </TT><TT>        </TT>error value<BR>
-<P>
-A status value indicating success or failure is returned; the error value
-argument <I>error</I> passes more detailed information about
-buffer initialization failures.
-<P>
----------------------------------------------------------
-<BR>
-
-int <B>mb_buffer_close</B>(
-<BR> <TT>       </TT><TT>        </TT>int <I>verbose</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>char <I>**buff_ptr</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>char <I>*mbio_ptr</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*error</I>);<BR>
-<P>
-The function <B>mb_buffer_close</B> releases all memory allocated
-for buffered i/0, including the structure pointed to by *<I>buff_ptr</I>.
-The <I>verbose</I>
-value controls the standard error output verbosity of the function.
-<P>
-The return values are:
-<BR> <TT>       </TT><I>error</I>:<TT>  </TT><TT>        </TT>error value<BR>
-<P>
-A status value indicating success or failure is returned; the error value
-argument <I>error</I> passes more detailed information about
-buffer deallocation failures.
-<P>
----------------------------------------------------------
-<BR>
-
-int <B>mb_buffer_load</B>(
-<BR> <TT>       </TT><TT>        </TT>int <I>verbose</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>char <I>*buff_ptr</I>,char <I>*mbio_ptr</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>nwant</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*nload</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*nbuff</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*error</I>);<BR>
-<P>
-The function <B>mb_buffer_load</B> loads data into the buffer pointed
-to by <I>buff_ptr</I> from the input file initialized in the
-<B>MBIO</B> descriptor pointed to by <I>mbio_ptr</I>.
-The <I>verbose</I>
-value controls the standard error output verbosity of the function.
-<P>
-The input control parameters have the following significance:
-<BR> <TT>       </TT><I>nwant</I>:<TT>  </TT><TT>        </TT>The number of data records desired<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT>in the buffer.<BR>
-<P>
-The returned values are:
-<BR> <TT>       </TT><I>nload</I>:<TT>  </TT><TT>        </TT>The number of data records loaded into the buffer.<BR>
-<BR> <TT>       </TT><I>nbuff</I>:<TT>  </TT><TT>        </TT>The total number of data records in the buffer after loading.<BR>
-<BR> <TT>       </TT><I>error</I>:<TT>  </TT><TT>        </TT>error value<BR>
-<P>
-The buffer may already contain data records when the <B>mb_buffer_load</B>
-call is made; if the number of previously loaded records is less than
-<I>nwant</I>, the function will attempt to read and load records
-until a total of <I>nwant</I> records are loaded. The <I>nload</I>
-value is the number of data records loaded during the current
-function call, and the <I>nbuff</I> value is the number of data
-records in the buffer at the completion of the <B>mb_buffer_load</B>
-call.
-A status value indicating success or failure is returned; the error value
-argument <I>error</I> passes more detailed information about
-buffer deallocation failures.
-<P>
----------------------------------------------------------
-<BR>
-
-int <B>mb_buffer_dump</B>(
-<BR> <TT>       </TT><TT>        </TT>int <I>verbose</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>char <I>*buff_ptr</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>char <I>*mbio_ptr</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>char <I>*ombio_ptr</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>nhold</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*ndump</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*nbuff</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*error</I>);<BR>
-<P>
-The function <B>mb_buffer_dump</B> dumps data from the buffer pointed
-to by *<I>buff_ptr</I> into the output file initialized in the
-<B>MBIO</B> descriptor pointed to by <I>ombio_ptr</I>. The data in the
-buffer were read from the input file initialized in the <B>MBIO</B>
-descriptor pointed to by <I>mbio_ptr</I>.
-The <I>verbose</I>
-value controls the standard error output verbosity of the function.
-<P>
-The input control parameters have the following significance:
-<BR> <TT>       </TT><I>nhold</I>:<TT>  </TT><TT>        </TT>The number of data records desired to be held<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT>in the buffer.<BR>
-<P>
-The returned values are:
-<BR> <TT>       </TT><I>nload</I>:<TT>  </TT><TT>        </TT>The number of data records dumped from the buffer.<BR>
-<BR> <TT>       </TT><I>nbuff</I>:<TT>  </TT><TT>        </TT>The total number of data records in the buffer after dumping.<BR>
-<BR> <TT>       </TT><I>error</I>:<TT>  </TT><TT>        </TT>error value<BR>
-<P>
-If the number of loaded records is more than
-<I>nhold</I>, the function will attempt to write out records
-from the beginning of the buffer until <I>nhold</I> records
-are left in the buffer. The <I>ndump</I>
-value is the number of data records dumped during the current
-function call, and the <I>nbuff</I> value is the number of data
-records in the buffer at the completion of the <B>mb_buffer_dump</B>
-call.
-A status value indicating success or failure is returned; the error value
-argument <I>error</I> passes more detailed information about
-buffer deallocation failures.
-<P>
----------------------------------------------------------
-<BR>
-
-int <B>mb_buffer_clear</B>(
-<BR> <TT>       </TT><TT>        </TT>int <I>verbose</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>char <I>*buff_ptr</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>char <I>*mbio_ptr</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>nhold</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*ndump</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*nbuff</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*error</I>);<BR>
-<P>
-The function <B>mb_buffer_clear</B> removes data from the buffer pointed
-to by *<I>buff_ptr</I> without writing those data records to an
-output file. An <B>MBIO</B> descriptor pointed to by <I>mbio_ptr</I>
-is still required, and generally represents the <B>MBIO</B> descriptor
-used to read and load the data originally.
-The <I>verbose</I>
-value controls the standard error output verbosity of the function.
-<P>
-The input control parameters have the following significance:
-<BR> <TT>       </TT><I>nwant</I>:<TT>  </TT><TT>        </TT>The number of data records desired to be held<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT>in the buffer.<BR>
-<P>
-The returned values are:
-<BR> <TT>       </TT><I>nload</I>:<TT>  </TT><TT>        </TT>The number of data records cleared from the buffer.<BR>
-<BR> <TT>       </TT><I>nbuff</I>:<TT>  </TT><TT>        </TT>The total number of data records in the buffer after dumping.<BR>
-<BR> <TT>       </TT><I>error</I>:<TT>  </TT><TT>        </TT>error value<BR>
-<P>
-If the number of loaded records is more than
-<I>nhold</I>, the function will attempt to clear out records
-from the beginning of the buffer until <I>nhold</I> records
-are left in the buffer. The <I>ndump</I>
-value is the number of data records cleared during the current
-function call, and the <I>nbuff</I> value is the number of data
-records in the buffer at the completion of the <B>mb_buffer_dump</B>
-call.
-A status value indicating success or failure is returned; the error value
-argument <I>error</I> passes more detailed information about
-buffer deallocation failures.
-<P>
----------------------------------------------------------
-<BR>
-
-int <B>mb_buffer_info</B>(
-<BR> <TT>       </TT><TT>        </TT>int <I>verbose</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>char <I>*buff_ptr</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>char <I>*mbio_ptr</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>id</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*system</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*kind</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*error</I>);<BR>
-<P>
-The function <B>mb_buffer_clear</B> removes data from the buffer pointed
-to by *<I>buff_ptr</I> without writing those data records to an
-output file. An <B>MBIO</B> descriptor pointed to by <I>mbio_ptr</I>
-is still required, and generally represents the <B>MBIO</B> descriptor
-used to read and load the data originally.
-The <I>verbose</I>
-value controls the standard error output verbosity of the function.
-<P>
-The input control parameters have the following significance:
-<BR> <TT>       </TT><I>nwant</I>:<TT>  </TT><TT>        </TT>The number of data records desired to be held<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT>in the buffer.<BR>
-<P>
-The returned values are:
-<BR> <TT>       </TT><I>nload</I>:<TT>  </TT><TT>        </TT>The number of data records cleared from the buffer.<BR>
-<BR> <TT>       </TT><I>nbuff</I>:<TT>  </TT><TT>        </TT>The total number of data records in the buffer after dumping.<BR>
-<BR> <TT>       </TT><I>error</I>:<TT>  </TT><TT>        </TT>error value<BR>
-<P>
-If the number of loaded records is more than
-<I>nhold</I>, the function will attempt to clear out records
-from the beginning of the buffer until <I>nhold</I> records
-are left in the buffer. The <I>ndump</I>
-value is the number of data records cleared during the current
-function call, and the <I>nbuff</I> value is the number of data
-records in the buffer at the completion of the <B>mb_buffer_dump</B>
-call.
-A status value indicating success or failure is returned; the error value
-argument <I>error</I> passes more detailed information about
-buffer deallocation failures.
-<P>
----------------------------------------------------------
-<BR>
-
-int <B>mb_buffer_get_next_data</B>(
-<BR> <TT>       </TT><TT>        </TT>int <I>verbose</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>char <I>*buff_ptr</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>char <I>*mbio_ptr</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>start</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*id</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>time_i[7]</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*time_d</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*navlon</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*navlat</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*speed</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*heading</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*nbath</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*namp</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*nss</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>char <I>*beamflag</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*bath</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*amp</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*bathacrosstrack</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*bathalongtrack</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*ss</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*ssacrosstrack</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*ssalongtrack</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*error</I>);<BR>
-<P>
-The function <B>mb_buffer_get_next_data</B> searches for the
-next survey data record in the buffer, beginning at buffer
-index <I>start</I>. Since buffer indexes begin at 0, the first
-call to <B>mb_buffer_get_next_data</B> should have <I>start</I> = 0.
-If a survey data record is found at or beyond <I>start</I>,
-<B>mb_buffer_get_next_data</B> returns the buffer index of that
-record in <I>id</I>. Data is also returned in the forms of bathymetry,
-amplitude, and sidescan survey data. No comments or other
-non-survey data records are returned.
-The <I>verbose</I>
-value controls the standard error output verbosity of the function.
-<P>
-The input control parameters have the following significance:
-<BR> <TT>       </TT><I>start</I>:<TT>  </TT><TT>        </TT>The buffer index at which to start<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT>searching for a survey data record.<BR>
-<P>
-The returned values are:
-<BR> <TT>       </TT><I>id</I>:<TT>     </TT><TT>        </TT>The buffer index of the first survey<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT>data record at or after <I>start</I>.<BR>
-<BR> <TT>       </TT><I>time_i</I>:<TT> </TT><TT>        </TT>time of current ping<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><I>time_i</I>[0]: year<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><I>time_i</I>[1]: month<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><I>time_i</I>[2]: day<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><I>time_i</I>[3]: hour<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><I>time_i</I>[4]: minute<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><I>time_i</I>[5]: second<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><I>time_i</I>[6]: microsecond<BR>
-<BR> <TT>       </TT><I>time_d</I>:<TT> </TT><TT>        </TT>time of current ping in seconds<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT>since 1/1/70 00:00:00<BR>
-<BR> <TT>       </TT><I>navlon</I>:<TT> </TT><TT>        </TT>longitude<BR>
-<BR> <TT>       </TT><I>navlat</I>:<TT> </TT><TT>        </TT>latitude<BR>
-<BR> <TT>       </TT><I>speed</I>:<TT>  </TT><TT>        </TT>ship speed in km/s<BR>
-<BR> <TT>       </TT><I>heading</I>:<TT>        </TT><TT>        </TT>ship heading in degrees<BR>
-<BR> <TT>       </TT><I>nbath</I>:<TT>  </TT><TT>        </TT>number of bathymetry values<BR>
-<BR> <TT>       </TT><I>namp</I>:<TT>   </TT><TT>        </TT>number of amplitude values<BR>
-<BR> <TT>       </TT><I>nss</I>:<TT>    </TT><TT>        </TT>number of sidescan values<BR>
-<TT>        </TT><I>beamflag</I>:<TT>       </TT><TT>        </TT>array of bathymetry flags<BR>
-<BR> <TT>       </TT><I>bath</I>:<TT>   </TT><TT>        </TT>array of bathymetry values in meters<BR>
-<BR> <TT>       </TT><I>amp</I>:<TT>    </TT><TT>        </TT>array of amplitude values in unknown units<BR>
-<BR> <TT>       </TT><I>bathacrosstrack</I>:<TT>        </TT>array of of acrosstrack distances<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT>in meters corresponding to bathymetry<BR>
-<BR> <TT>       </TT><I>bathalongtrack</I>:<TT> </TT>array of of alongtrack distances<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT>in meters corresponding to bathymetry<BR>
-<BR> <TT>       </TT><I>ss</I>:<TT>     </TT><TT>        </TT>array of sidescan values in unknown units<BR>
-<BR> <TT>       </TT><I>ssacrosstrack</I>:<TT>  </TT>array of of acrosstrack distances<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT>in meters corresponding to sidescan<BR>
-<BR> <TT>       </TT><I>ssacrosstrack</I>:<TT>  </TT>array of of alongtrack distances<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT>in meters corresponding to sidescan<BR>
-<BR> <TT>       </TT><I>error</I>:<TT>  </TT><TT>        </TT>error value<BR>
-<P>
-A status value indicating success or failure is returned; the error value
-argument <I>error</I> passes more detailed information about
-failures. The most common error occurs when no more survey data
-records remain to be found in the buffer; in this case,
-<I>error</I> = -14.
-<P>
----------------------------------------------------------
-<BR>
-
-int <B>mb_buffer_extract</B>(
-<BR> <TT>       </TT><TT>        </TT>int <I>verbose</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>char <I>*buff_ptr</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>char <I>*mbio_ptr</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>id</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*kind</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>time_i[7]</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*time_d</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*navlon</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*navlat</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*speed</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*heading</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*nbath</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*namp</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*nss</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>char <I>*beamflag</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*bath</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*amp</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*bathacrosstrack</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*bathalongtrack</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*ss</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*ssacrosstrack</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*ssalongtrack</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>char <I>*comment</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*error</I>);<BR>
-<P>
-The function <B>mb_buffer_extract</B> extracts and returns
-a subset of the data in a buffer record.
-The <I>verbose</I>
-value controls the standard error output verbosity of the function.
-The buffer record is specified with the
-buffer index <I>id</I>. The data is either
-in the form of bathymetry,
-amplitude, and sidescan survey data or a comment string.
-<P>
-The input control parameters have the following significance:
-<BR> <TT>       </TT><I>id</I>:<TT>     </TT><TT>        </TT>The buffer index of the data<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT>record to extract.<BR>
-<P>
-The returned values are:
-<BR> <TT>       </TT><I>kind</I>:<TT>   </TT><TT>        </TT>kind of data record extracted<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>1<TT>       </TT>survey data<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>2<TT>       </TT>comment<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>>=3<TT>     </TT>other data that cannot<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>be passed by <B>mb_buffer_extract</B><BR>
-<BR> <TT>       </TT><I>time_i</I>:<TT> </TT><TT>        </TT>time of current ping<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><I>time_i</I>[0]: year<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><I>time_i</I>[1]: month<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><I>time_i</I>[2]: day<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><I>time_i</I>[3]: hour<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><I>time_i</I>[4]: minute<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><I>time_i</I>[5]: second<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><I>time_i</I>[6]: microsecond<BR>
-<BR> <TT>       </TT><I>time_d</I>:<TT> </TT><TT>        </TT>time of current ping in seconds<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT>since 1/1/70 00:00:00<BR>
-<BR> <TT>       </TT><I>navlon</I>:<TT> </TT><TT>        </TT>longitude<BR>
-<BR> <TT>       </TT><I>navlat</I>:<TT> </TT><TT>        </TT>latitude<BR>
-<BR> <TT>       </TT><I>speed</I>:<TT>  </TT><TT>        </TT>ship speed in km/s<BR>
-<BR> <TT>       </TT><I>heading</I>:<TT>        </TT><TT>        </TT>ship heading in degrees<BR>
-<BR> <TT>       </TT><I>nbath</I>:<TT>  </TT><TT>        </TT>number of bathymetry values<BR>
-<BR> <TT>       </TT><I>namp</I>:<TT>   </TT><TT>        </TT>number of amplitude values<BR>
-<BR> <TT>       </TT><I>nss</I>:<TT>    </TT><TT>        </TT>number of sidescan values<BR>
-<BR> <TT>       </TT><I>beamflag</I>:<TT>       </TT><TT>        </TT>array of bathymetry flags<BR>
-<BR> <TT>       </TT><I>bath</I>:<TT>   </TT><TT>        </TT>array of bathymetry values in meters<BR>
-<BR> <TT>       </TT><I>amp</I>:<TT>    </TT><TT>        </TT>array of amplitude values in unknown units<BR>
-<BR> <TT>       </TT><I>bathacrosstrack</I>:<TT>        </TT>array of of acrosstrack distances<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT>in meters corresponding to bathymetry<BR>
-<BR> <TT>       </TT><I>bathalongtrack</I>:<TT> </TT>array of of alongtrack distances<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT>in meters corresponding to bathymetry<BR>
-<BR> <TT>       </TT><I>ss</I>:<TT>     </TT><TT>        </TT>array of sidescan values in unknown units<BR>
-<BR> <TT>       </TT><I>ssacrosstrack</I>:<TT>  </TT>array of of acrosstrack distances<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT>in meters corresponding to sidescan<BR>
-<BR> <TT>       </TT><I>ssacrosstrack</I>:<TT>  </TT>array of of alongtrack distances<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT>in meters corresponding to sidescan<BR>
-<BR> <TT>       </TT><I>comment</I>:<TT>        </TT><TT>        </TT>comment string<BR>
-<BR> <TT>       </TT><I>error</I>:<TT>  </TT><TT>        </TT>error value<BR>
-<P>
-A status value indicating success or failure is returned; the error value
-argument <I>error</I> passes more detailed information about
-extract failures.
-<P>
----------------------------------------------------------
-<BR>
-
-int <B>mb_buffer_insert</B>(
-<BR> <TT>       </TT><TT>        </TT>int <I>verbose</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>char <I>*buff_ptr</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>char <I>*mbio_ptr</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>id</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>time_i[7]</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>time_d</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>navlon</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>navlat</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>speed</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>heading</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>nbath</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>namp</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>nss</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>char <I>*beamflag</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*bath</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*amp</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*bathacrosstrack</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*bathalongtrack</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*ss</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*ssacrosstrack</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*ssalongtrack</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>char <I>*comment</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*error</I>);<BR>
-<P>
-The function <B>mb_buffer_insert</B> inserts data into a
-buffer record, replacing a subset of the original values.
-The <I>verbose</I>
-value controls the standard error output verbosity of the function.
-The buffer record is specified with the
-buffer index <I>id</I>. The data is either
-in the form of bathymetry,
-amplitude, and sidescan survey data or a comment string.
-<P>
-The input control parameters have the following significance:
-<BR> <TT>       </TT><I>id</I>:<TT>     </TT><TT>        </TT>The buffer index of the data<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT>record to insert.<BR>
-<P>
-The returned values are:
-<BR> <TT>       </TT><I>kind</I>:<TT>   </TT><TT>        </TT>kind of data record inserted<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>1<TT>       </TT>survey data<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>2<TT>       </TT>comment<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>>=3<TT>     </TT>other data that cannot<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>be passed by <B>mb_buffer_insert</B><BR>
-<BR> <TT>       </TT><I>time_i</I>:<TT> </TT><TT>        </TT>time of current ping<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><I>time_i</I>[0]: year<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><I>time_i</I>[1]: month<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><I>time_i</I>[2]: day<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><I>time_i</I>[3]: hour<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><I>time_i</I>[4]: minute<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><I>time_i</I>[5]: second<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><I>time_i</I>[6]: microsecond<BR>
-<BR> <TT>       </TT><I>time_d</I>:<TT> </TT><TT>        </TT>time of current ping in seconds<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT>since 1/1/70 00:00:00<BR>
-<BR> <TT>       </TT><I>navlon</I>:<TT> </TT><TT>        </TT>longitude<BR>
-<BR> <TT>       </TT><I>navlat</I>:<TT> </TT><TT>        </TT>latitude<BR>
-<BR> <TT>       </TT><I>speed</I>:<TT>  </TT><TT>        </TT>ship speed in km/s<BR>
-<BR> <TT>       </TT><I>heading</I>:<TT>        </TT><TT>        </TT>ship heading in degrees<BR>
-<BR> <TT>       </TT><I>nbath</I>:<TT>  </TT><TT>        </TT>number of bathymetry values<BR>
-<BR> <TT>       </TT><I>namp</I>:<TT>   </TT><TT>        </TT>number of amplitude values<BR>
-<BR> <TT>       </TT><I>nss</I>:<TT>    </TT><TT>        </TT>number of sidescan values<BR>
-<BR> <TT>       </TT><I>beamflag</I>:<TT>       </TT><TT>        </TT>array of bathymetry flags<BR>
-<BR> <TT>       </TT><I>bath</I>:<TT>   </TT><TT>        </TT>array of bathymetry values in meters<BR>
-<BR> <TT>       </TT><I>amp</I>:<TT>    </TT><TT>        </TT>array of amplitude values in unknown units<BR>
-<BR> <TT>       </TT><I>bathacrosstrack</I>:<TT>        </TT>array of of acrosstrack distances<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT>in meters corresponding to bathymetry<BR>
-<BR> <TT>       </TT><I>bathalongtrack</I>:<TT> </TT>array of of alongtrack distances<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT>in meters corresponding to bathymetry<BR>
-<BR> <TT>       </TT><I>ss</I>:<TT>     </TT><TT>        </TT>array of sidescan values in unknown units<BR>
-<BR> <TT>       </TT><I>ssacrosstrack</I>:<TT>  </TT>array of of acrosstrack distances<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT>in meters corresponding to sidescan<BR>
-<BR> <TT>       </TT><I>ssacrosstrack</I>:<TT>  </TT>array of of alongtrack distances<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT>in meters corresponding to sidescan<BR>
-<BR> <TT>       </TT><I>comment</I>:<TT>        </TT><TT>        </TT>comment string<BR>
-<P>
-The returned values are:
-<BR> <TT>       </TT><I>error</I>:<TT>  </TT><TT>        </TT>error value<BR>
-<P>
-A status value indicating success or failure is returned; the error value
-argument <I>error</I> passes more detailed information about
-insert failures.
-<P>
----------------------------------------------------------
-<BR>
-
-int <B>mb_buffer_get_next_nav</B>(
-<BR> <TT>       </TT><TT>        </TT>int <I>verbose</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>char <I>*buff_ptr</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>char <I>*mbio_ptr</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>start</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*id</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>time_i[7]</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*time_d</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*navlon</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*navlat</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*speed</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*heading</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*draft</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*roll</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*pitch</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*heave</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*error</I>);<BR>
-<P>
-The function <B>mb_buffer_get_next_nav</B> searches for the
-next survey data record in the buffer, beginning at buffer
-index <I>start</I>. Since buffer indexes begin at 0, the first
-call to <B>mb_buffer_get_next_nav</B> should have <I>start</I> = 0.
-If a survey data record is found at or beyond <I>start</I>,
-<B>mb_buffer_get_next_nav</B> returns the buffer index of that
-record in <I>id</I>. Navigation and vertical reference sensor
-data is also returned. No comments or other
-non-survey data records are returned.
-The <I>verbose</I>
-value controls the standard error output verbosity of the function.
-<P>
-The input control parameters have the following significance:
-<BR> <TT>       </TT><I>start</I>:<TT>  </TT><TT>        </TT>The buffer index at which to start<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT>searching for a survey data record.<BR>
-<P>
-The returned values are:
-<BR> <TT>       </TT><I>id</I>:<TT>     </TT><TT>        </TT>The buffer index of the first survey data record at or after <I>start</I>.<BR>
-<BR> <TT>       </TT><I>time_i</I>:<TT> </TT><TT>        </TT>time of current ping<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><I>time_i</I>[0]: year<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><I>time_i</I>[1]: month<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><I>time_i</I>[2]: day<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><I>time_i</I>[3]: hour<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><I>time_i</I>[4]: minute<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><I>time_i</I>[5]: second<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><I>time_i</I>[6]: microsecond<BR>
-<BR> <TT>       </TT><I>time_d</I>:<TT> </TT><TT>        </TT>time of current ping in seconds<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT>since 1/1/70 00:00:00<BR>
-<BR> <TT>       </TT><I>navlon</I>:<TT> </TT><TT>        </TT>longitude<BR>
-<BR> <TT>       </TT><I>navlat</I>:<TT> </TT><TT>        </TT>latitude<BR>
-<BR> <TT>       </TT><I>speed</I>:<TT>  </TT><TT>        </TT>ship speed in km/s<BR>
-<BR> <TT>       </TT><I>heading</I>:<TT>        </TT><TT>        </TT>ship heading in degrees<BR>
-<BR> <TT>       </TT><I>roll</I>:<TT>   </TT><TT>        </TT>ship roll in degrees<BR>
-<BR> <TT>       </TT><I>pitch</I>:<TT>  </TT><TT>        </TT>ship pitch in degrees<BR>
-<BR> <TT>       </TT><I>heave</I>:<TT>  </TT><TT>        </TT>ship heave in meters<BR>
-<P>
-A status value indicating success or failure is returned; the error value
-argument <I>error</I> passes more detailed information about
-failures. The most common error occurs when no more survey data
-records remain to be found in the buffer; in this case,
-<I>error</I> = -14.
-<P>
----------------------------------------------------------
-<BR>
-
-int <B>mb_buffer_extract_nav</B>(
-<BR> <TT>       </TT><TT>        </TT>int <I>verbose</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>char <I>*buff_ptr</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>char <I>*mbio_ptr</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>id</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*kind</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>time_i[7]</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*time_d</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*navlon</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*navlat</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*speed</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*heading</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*draft</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*roll</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*pitch</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*heave</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*error</I>);<BR>
-<P>
-The function <B>mb_buffer_extract_nav</B> extracts and returns
-a subset of the data in a buffer record.
-The <I>verbose</I>
-value controls the standard error output verbosity of the function.
-The buffer record is specified with the
-buffer index <I>id</I>. The data returned consists of navigation
-and vertical reference sensor data.
-<P>
-The input control parameters have the following significance:
-<BR> <TT>       </TT><I>id</I>:<TT>     </TT><TT>        </TT>The buffer index of the data<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT>record to extract.<BR>
-<P>
-The returned values are:
-<BR> <TT>       </TT><I>kind</I>:<TT>   </TT><TT>        </TT>kind of data record extracted<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>1<TT>       </TT>survey data<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>2<TT>       </TT>comment<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>>=3<TT>     </TT>other data that cannot<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>be passed by <B>mb_buffer_extract_nav</B><BR>
-<BR> <TT>       </TT><I>time_i</I>:<TT> </TT><TT>        </TT>time of current ping<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><I>time_i</I>[0]: year<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><I>time_i</I>[1]: month<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><I>time_i</I>[2]: day<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><I>time_i</I>[3]: hour<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><I>time_i</I>[4]: minute<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><I>time_i</I>[5]: second<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><I>time_i</I>[6]: microsecond<BR>
-<BR> <TT>       </TT><I>time_d</I>:<TT> </TT><TT>        </TT>time of current ping in seconds<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT>since 1/1/70 00:00:00<BR>
-<BR> <TT>       </TT><I>navlon</I>:<TT> </TT><TT>        </TT>longitude<BR>
-<BR> <TT>       </TT><I>navlat</I>:<TT> </TT><TT>        </TT>latitude<BR>
-<BR> <TT>       </TT><I>speed</I>:<TT>  </TT><TT>        </TT>ship speed in km/s<BR>
-<BR> <TT>       </TT><I>heading</I>:<TT>        </TT><TT>        </TT>ship heading in degrees<BR>
-<BR> <TT>       </TT><I>roll</I>:<TT>   </TT><TT>        </TT>ship roll in degrees<BR>
-<BR> <TT>       </TT><I>pitch</I>:<TT>  </TT><TT>        </TT>ship pitch in degrees<BR>
-<BR> <TT>       </TT><I>heave</I>:<TT>  </TT><TT>        </TT>ship heave in meters<BR>
-<P>
-A status value indicating success or failure is returned; the error value
-argument <I>error</I> passes more detailed information about
-extract failures.
-<P>
----------------------------------------------------------
-<BR>
-
-int <B>mb_buffer_insert_nav</B>(
-<BR> <TT>       </TT><TT>        </TT>int <I>verbose</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>char <I>*buff_ptr</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>char <I>*mbio_ptr</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>id</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>time_i[7]</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>time_d</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>navlon</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>navlat</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>speed</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>heading</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>draft</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>roll</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>pitch</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>heave</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*error</I>);<BR>
-<P>
-The function <B>mb_buffer_insert_nav</B> inserts navigation
-and vertical reference sensor data into a
-buffer record, replacing a subset of the original values.
-The <I>verbose</I>
-value controls the standard error output verbosity of the function.
-The buffer record is specified with the
-buffer index <I>id</I>.
-<P>
-The input control parameters have the following significance:
-<BR> <TT>       </TT><I>id</I>:<TT>     </TT><TT>        </TT>The buffer index of the data<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT>record to insert.<BR>
-<P>
-The returned values are:
-<BR> <TT>       </TT><I>kind</I>:<TT>   </TT><TT>        </TT>kind of data record inserted<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>1<TT>       </TT>survey data<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>2<TT>       </TT>comment<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>>=3<TT>     </TT>other data that cannot<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>be passed by <B>mb_buffer_insert_nav</B><BR>
-<BR> <TT>       </TT><I>time_i</I>:<TT> </TT><TT>        </TT>time of current ping<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><I>time_i</I>[0]: year<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><I>time_i</I>[1]: month<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><I>time_i</I>[2]: day<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><I>time_i</I>[3]: hour<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><I>time_i</I>[4]: minute<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><I>time_i</I>[5]: second<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><I>time_i</I>[6]: microsecond<BR>
-<BR> <TT>       </TT><I>time_d</I>:<TT> </TT><TT>        </TT>time of current ping in seconds<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT>since 1/1/70 00:00:00<BR>
-<BR> <TT>       </TT><I>navlon</I>:<TT> </TT><TT>        </TT>longitude<BR>
-<BR> <TT>       </TT><I>navlat</I>:<TT> </TT><TT>        </TT>latitude<BR>
-<BR> <TT>       </TT><I>speed</I>:<TT>  </TT><TT>        </TT>ship speed in km/s<BR>
-<BR> <TT>       </TT><I>heading</I>:<TT>        </TT><TT>        </TT>ship heading in degrees<BR>
-<BR> <TT>       </TT><I>roll</I>:<TT>   </TT><TT>        </TT>ship roll in degrees<BR>
-<BR> <TT>       </TT><I>pitch</I>:<TT>  </TT><TT>        </TT>ship pitch in degrees<BR>
-<BR> <TT>       </TT><I>heave</I>:<TT>  </TT><TT>        </TT>ship heave in meters<BR>
-<P>
-A status value indicating success or failure is returned; the error value
-argument <I>error</I> passes more detailed information about
-insert failures.
-<P>
----------------------------------------------------------
-<BR>
-
-int <B>mb_buffer_get_ptr</B>(
-<BR> <TT>       </TT><TT>        </TT>int <I>verbose</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>char <I>*buff_ptr</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>char <I>*mbio_ptr</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>id</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>char <I>**store_ptr</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*error</I>);<BR>
-<P>
-The function <B>mb_buffer_get_ptr</B> returns
-a pointer to the data structure in a buffer record.
-The <I>verbose</I>
-value controls the standard error output verbosity of the function.
-The buffer record is specified with the
-buffer index <I>id</I>. The data returned consists of a pointer
-to the data structure stored in the specified buffer record.
-<P>
-The input control parameters have the following significance:
-<BR> <TT>       </TT><I>id</I>:<TT>     </TT><TT>        </TT>The buffer index of the data<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT>record to locate.<BR>
-<P>
-The return values are:
-<BR> <TT>       </TT><I>*store_ptr</I>:<TT>     </TT>pointer to data in specified<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT>buffer record<BR>
-<BR> <TT>       </TT><I>error</I>:<TT>  </TT><TT>        </TT>error value<BR>
-<P>
-A status value indicating success or failure is returned; the error value
-argument <I>error</I> passes more detailed information about
-buffer failures.
-<P>
-<A NAME="lbAQ"> </A>
-<H2>MISCELLANEOUS FUNCTIONS</H2>
-
-<P>
-int <B>mb_defaults</B>(
-<BR> <TT>       </TT><TT>        </TT>int <I>verbose</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*format</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*pings</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*lonflip</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>bounds[4]</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*btime_i</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*etime_i</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*speedmin</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*timegap</I>);<BR>
-<P>
-The function <B>mb_defaults</B> provides default values of control
-parameters used by some of the <B>MBIO</B> functions. The <I>verbose</I>
-value controls the standard error output verbosity of the function.
-The other parameters
-are set by the function; the meaning of these parameters is discussed
-in the listings of the functions
-<B>mb_read_init</B> and <B>mb_write_init</B>.
-If an .mbio_defaults file exists in the user's home directory,
-the lonflip and timegap defaults are read from this file.
-Otherwise, the values are set as:
-<BR> <TT>       </TT><I>*lonflip</I> = 0<BR>
-<BR> <TT>       </TT><I>*timegap</I> = 1<BR>
-<BR>
-
-The other values are simply set as:
-<BR> <TT>       </TT><I>*format</I> = 0<BR>
-<BR> <TT>       </TT><I>*pings</I> = 1<BR>
-<BR> <TT>       </TT><I>bounds[0]</I> = -360.<BR>
-<BR> <TT>       </TT><I>bounds[1]</I> = 360.<BR>
-<BR> <TT>       </TT><I>bounds[2]</I> = -90.<BR>
-<BR> <TT>       </TT><I>bounds[3]</I> = 90.<BR>
-<BR> <TT>       </TT><I>btime_i[0]</I> = 1962;<BR>
-<BR> <TT>       </TT><I>btime_i[1]</I> = 2;<BR>
-<BR> <TT>       </TT><I>btime_i[2]</I> = 21;<BR>
-<BR> <TT>       </TT><I>btime_i[3]</I> = 10;<BR>
-<BR> <TT>       </TT><I>btime_i[4]</I> = 30;<BR>
-<BR> <TT>       </TT><I>btime_i[5]</I> = 0;<BR>
-<BR> <TT>       </TT><I>btime_i[6]</I> = 0;<BR>
-<BR> <TT>       </TT><I>etime_i[0]</I> = 2062;<BR>
-<BR> <TT>       </TT><I>etime_i[1]</I> = 2;<BR>
-<BR> <TT>       </TT><I>etime_i[2]</I> = 21;<BR>
-<BR> <TT>       </TT><I>etime_i[3]</I> = 10;<BR>
-<BR> <TT>       </TT><I>etime_i[4]</I> = 30;<BR>
-<BR> <TT>       </TT><I>etime_i[5]</I> = 0;<BR>
-<BR> <TT>       </TT><I>etime_i[6]</I> = 0;<BR>
-<BR> <TT>       </TT><I>*speedmin</I> = 0.0<BR>
-<P>
-A status value is returned to
-indicate success or failure.
-<P>
----------------------------------------------------------
-<BR>
-
-int <B>mb_env</B>(
-<BR> <TT>       </TT><TT>        </TT>int <I>verbose</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>char <I>*psdisplay</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>char <I>*imgdisplay</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>char <I>*mbproject</I>);<BR>
-<P>
-The function <B>mb_env</B> provides default values of Postscript
-and image display programs invoked by some <B>MB-System</B>
-programs and macros, and a default value for a working project
-name that will be used by future applications. The <I>verbose</I>
-value controls the standard error output verbosity of the function.
-If an .mbio_defaults file exists in the user's home directory,
-the <I>*psdisplay</I>, <I>*imgdisplay</I>, <I>*mbproject</I>
-defaults are read from this file.
-Otherwise, the values are set as:
-<BR> <TT>       </TT><I>psdisplay</I> =  "xpsview" (IRIX OS)<BR>
-<BR> <TT>       </TT>                   "pageview" (Solaris OS)<BR>
-<BR> <TT>       </TT>                   "gv" (other OS)<BR>
-<BR> <TT>       </TT>                   "ghostview" (other OS)<BR>
-<BR> <TT>       </TT><I>imgdisplay</I> = "gimp" (Linux OS)<BR>
-<BR> <TT>       </TT>                   "xv" (other than Linux OS)<BR>
-<BR> <TT>       </TT><I>mbproject</I> =  "none"<BR>
-<P>
----------------------------------------------------------
-<BR>
-
-int <B>mb_format</B>(
-<BR> <TT>       </TT><TT>        </TT>int <I>verbose</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*format</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*error</I>);<BR>
-<P>
-Given the format identifier <I>format</I>, <B>mb_format</B> checks if the
-format is valid.  If the format id corresponds to a value used in
-previous (<4.00) versions of <B>MB-System</B>, then the format value
-will be aliased to the current corresponding value.
-<P>
-The return values are:
-<BR>  <TT>      </TT><I>format</I>:<TT> </TT><TT>        </TT><B>MBIO</B> format id<BR>
-<BR>  <TT>      </TT><I>error</I>:<TT>  </TT><TT>        </TT>error value<BR>
-<P>
-A status value indicating success or failure is returned; the error value
-argument <I>error</I> passes more detailed information about failures.
-<P>
----------------------------------------------------------
-<BR>
-
-int <B>mb_format_register</B>(
-<BR> <TT>       </TT><TT>        </TT>int <I>verbose</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*format</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>char <I>*mbio_ptr</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*error</I>);<BR>
-<P>
-The function <B>mb_format_register</B> is called by <B>mb_read_init</B>
-and <B>mb_write_init</B> and serves to load format specific
-parameters and function parameters into the <B>MBIO</B>
-control structure pointed to by <I>*error</I>. The format id
-<I>*format</I> is first checked for validity. In some cases,
-formerly valid but now obsolete format id values are mapped
-to current values.
-<P>
-The input values are:
-<BR> <TT>       </TT><I>*format</I>:<TT>        </TT><TT>        </TT><B>MBIO</B> format id<BR>
-<BR> <TT>       </TT><I>*mbio_ptr</I>:<TT>      </TT>pointer to data in specified<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT>buffer record<BR>
-<P>
-The return values are:
-<BR>  <TT>      </TT><I>error</I>:<TT>  </TT><TT>        </TT>error value<BR>
-<P>
-A status value indicating success or failure is returned; the error value
-argument <I>error</I> passes more detailed information about failures.
-<P>
----------------------------------------------------------
-<BR>
-
-int <B>mb_format_info</B>(
-<BR> <TT>       </TT><TT>        </TT>int <I>verbose</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*format</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*system</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*beams_bath_max</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*beams_amp_max</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*pixels_ss_max</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>char <I>*format_name</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>char <I>*system_name</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>char <I>*format_description</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*numfile</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*filetype</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*variable_beams</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*traveltime</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*beam_flagging</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*nav_source</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*heading_source</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*vru_source</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*beamwidth_xtrack</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*beamwidth_ltrack</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*error</I>);<BR>
-<P>
-The function <B>mb_format_info</B> returns a variety of
-data format specific parameters. The format id
-<I>*format</I> is first checked for validity. In some cases,
-formerly valid but now obsolete format id values are mapped
-to current values.
-<P>
-The input values are:
-<BR> <TT>       </TT><I>*format</I>:<TT>        </TT><TT>        </TT><B>MBIO</B> format id<BR>
-<P>
-The return values are:
-<BR> <TT>       </TT><I>*format</I>:<TT>        </TT><TT>        </TT><B>MBIO</B> format id<BR>
-<BR> <TT>       </TT><I>*system</I>:<TT>        </TT><TT>        </TT><B>MBIO</B> sonar system id<BR>
-<BR> <TT>       </TT><I>*beams_bath_max</I>:<TT>        </TT>maximum number of bathymetry beams<BR>
-<BR> <TT>       </TT><I>*beams_amp_max</I>:<TT> </TT>maximum number of amplitude beams<BR>
-<BR> <TT>       </TT><I>*pixels_ss_max</I>:<TT> </TT>maximum number of sidescan pixels<BR>
-<BR> <TT>       </TT><I>*format_name</I>:<TT>   </TT><B>MBIO</B> format name<BR>
-<BR> <TT>       </TT><I>*system_name</I>:<TT>   </TT><B>MBIO</B> sonar system name<BR>
-<BR> <TT>       </TT><I>*format_description</I>:<TT>    </TT><B>MBIO</B> format description<BR>
-<BR> <TT>       </TT><I>*numfile</I>:<TT>       </TT><TT>        </TT>number of parallel data files used in format<BR>
-<BR> <TT>       </TT><I>*filetype</I>:<TT>      </TT>type of data files<BR>
-<BR> <TT>       </TT><I>*variable_beams</I>:<TT>        </TT>number of beams can vary [boolean]<BR>
-<BR> <TT>       </TT><I>*traveltime</I>:<TT>    </TT>travel time data available [boolean]<BR>
-<BR> <TT>       </TT><I>*beam_flagging</I>:<TT> </TT>beam flagging supported [boolean]<BR>
-<BR> <TT>       </TT><I>*nav_source</I>:<TT>    </TT>kind of data records containing navigation<BR>
-<BR> <TT>       </TT><I>*heading_source</I>:<TT>        </TT>kind of data records containing<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT>heading<BR>
-<BR> <TT>       </TT><I>*vru_source</I>:<TT>    </TT>kind of data records containing<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT>attitude<BR>
-<BR> <TT>       </TT><I>*beamwidth_xtrack</I>:<TT>      </TT>typical athwartships beam<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>width [degrees]<BR>
-<BR> <TT>       </TT><I>*beamwidth_ltrack</I>:<TT>      </TT>typical alongtrack beam<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>width [degrees]<BR>
-<BR>  <TT>      </TT><I>error</I>:<TT>  </TT><TT>        </TT>error value<BR>
-<P>
-A status value indicating success or failure is returned; the error value
-argument <I>error</I> passes more detailed information about failures.
-<P>
----------------------------------------------------------
-<BR>
-
-int <B>mb_format_system</B>(
-<BR> <TT>       </TT><TT>        </TT>int <I>verbose</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*format</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*system</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*error</I>);<BR>
-<P>
-The function <B>mb_format_system</B> returns
-the <B>MBIO</B> sonar system id. The format id
-<I>*format</I> is first checked for validity. In some cases,
-formerly valid but now oattintbsolete format id values are mapped
-to current values. The input values are:
-<BR> <TT>       </TT><I>*format</I>:<TT>        </TT><TT>        </TT><B>MBIO</B> format id<BR>
-<BR>
-
-The return values are:
-<BR> <TT>       </TT><I>*format</I>:<TT>        </TT><TT>        </TT><B>MBIO</B> format id<BR>
-<BR> <TT>       </TT><I>*system</I>:<TT>        </TT><TT>        </TT><B>MBIO</B> sonar system id<BR>
-<BR>   <TT>     </TT><I>error</I>:<TT>  </TT><TT>        </TT>error value<BR>
-<BR>
-
-A status value indicating success or failure is returned; the error value
-argument <I>error</I> passes more detailed information about failures.
-<P>
----------------------------------------------------------
-<BR>
-
-int <B>mb_format_description</B>(
-<BR> <TT>       </TT><TT>        </TT>int <I>verbose</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*format</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>char <I>*description</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*error</I>);<BR>
-<P>
-The function <B>mb_format_description</B> returns
-a short description of the format in the string
-<I>*description</I>. The format id
-<I>*format</I> is first checked for validity. In some cases,
-formerly valid but now obsolete format id values are mapped
-to current values. The input values are:
-<BR> <TT>       </TT><I>*format</I>:<TT>        </TT><TT>        </TT><B>MBIO</B> format id<BR>
-<BR>
-
-The return values are:
-<BR> <TT>       </TT><I>*format</I>:<TT>        </TT><TT>        </TT><B>MBIO</B> format id<BR>
-<BR> <TT>       </TT><I>*format_description</I>:<TT>    </TT><B>MBIO</B> format description<BR>
-<BR>   <TT>     </TT><I>error</I>:<TT>  </TT><TT>        </TT>error value<BR>
-<BR>
-
-A status value indicating success or failure is returned; the error value
-argument <I>error</I> passes more detailed information about failures.
-<P>
----------------------------------------------------------
-<BR>
-
-int <B>mb_format_dimensions</B>(
-<BR> <TT>       </TT><TT>        </TT>int <I>verbose</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*format</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*beams_bath_max</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*beams_amp_max</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*pixels_ss_max</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*error</I>);<BR>
-<P>
-The function <B>mb_format_dimensions</B> returns
-the maximum numbers of beams and pixels associated
-with a particular data format. The format id
-<I>*format</I> is first checked for validity. In some cases,
-formerly valid but now obsolete format id values are mapped
-to current values. The input values are:
-<BR> <TT>       </TT><I>*format</I>:<TT>        </TT><TT>        </TT><B>MBIO</B> format id<BR>
-<BR>
-
-The return values are:
-<BR> <TT>       </TT><I>*format</I>:<TT>        </TT><TT>        </TT><B>MBIO</B> format id<BR>
-<BR> <TT>       </TT><I>*beams_bath_max</I>:<TT>        </TT>maximum number of bathymetry beams<BR>
-<BR> <TT>       </TT><I>*beams_amp_max</I>:<TT> </TT>maximum number of amplitude beams<BR>
-<BR> <TT>       </TT><I>*pixels_ss_max</I>:<TT> </TT>maximum number of sidescan pixels<BR>
-<BR>   <TT>     </TT><I>error</I>:<TT>  </TT><TT>        </TT>error value<BR>
-<BR>
-
-A status value indicating success or failure is returned; the error value
-argument <I>error</I> passes more detailed information about failures.
-<P>
----------------------------------------------------------
-<BR>
-
-int <B>mb_format_flags</B>(
-<BR> <TT>       </TT><TT>        </TT>int <I>verbose</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*format</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*variable_beams</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*traveltime</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*beam_flagging</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*error</I>);<BR>
-<P>
-The function <B>mb_format_flags</B> returns
-flags indicating certain characteristics of the
-specified data format. The format id
-<I>*format</I> is first checked for validity. In some cases,
-formerly valid but now obsolete format id values are mapped
-to current values. The input values are:
-<BR> <TT>       </TT><I>*format</I>:<TT>        </TT><TT>        </TT><B>MBIO</B> format id<BR>
-<BR>
-
-The return values are:
-<BR> <TT>       </TT><I>*format</I>:<TT>        </TT><TT>        </TT><B>MBIO</B> format id<BR>
-<BR> <TT>       </TT><I>*variable_beams</I>:<TT>        </TT>number of beams can vary [boolean]<BR>
-<BR> <TT>       </TT><I>*traveltime</I>:<TT>    </TT>travel time data available [boolean]<BR>
-<BR> <TT>       </TT><I>*beam_flagging</I>:<TT> </TT>beam flagging supported [boolean]<BR>
-<BR>   <TT>     </TT><I>error</I>:<TT>  </TT><TT>        </TT>error value<BR>
-<BR>
-
-A status value indicating success or failure is returned; the error value
-argument <I>error</I> passes more detailed information about failures.
-<P>
----------------------------------------------------------
-<BR>
-
-int <B>mb_format_source</B>(
-<BR> <TT>       </TT><TT>        </TT>int <I>verbose</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*format</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*nav_source</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*heading_source</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*vru_source</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*error</I>);<BR>
-<P>
-The function <B>mb_format_source</B> returns
-flags indicating what kinds of data records contain
-navigation, heading, and attitude values in the
-specified data format. The format id
-<I>*format</I> is first checked for validity. In some cases,
-formerly valid but now obsolete format id values are mapped
-to current values. The input values are:
-<BR> <TT>       </TT><I>*format</I>:<TT>        </TT><TT>        </TT><B>MBIO</B> format id<BR>
-<BR>
-
-The return values are:
-<BR> <TT>       </TT><I>*format</I>:<TT>        </TT><TT>        </TT><B>MBIO</B> format id<BR>
-<BR> <TT>       </TT><I>*nav_source</I>:<TT>    </TT>kind of data records containing<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT>navigation<BR>
-<BR> <TT>       </TT><I>*heading_source</I>:<TT>        </TT>kind of data records containing<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT>heading<BR>
-<BR> <TT>       </TT><I>*vru_source</I>:<TT>    </TT>kind of data records containing<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT>attitude<BR>
-<BR>   <TT>     </TT><I>error</I>:<TT>  </TT><TT>        </TT>error value<BR>
-<BR>
-
-A status value indicating success or failure is returned; the error value
-argument <I>error</I> passes more detailed information about failures.
-<P>
----------------------------------------------------------
-<BR>
-
-int <B>mb_format_beamwidth</B>(
-<BR> <TT>       </TT><TT>        </TT>int <I>verbose</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*format</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*beamwidth_xtrack</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*beamwidth_ltrack</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*error</I>);<BR>
-<P>
-The function <B>mb_format_beamwidth</B> returns
-typical, upper bound values for athwartships and alongtrack
-beam widths. The format id
-<I>*format</I> is first checked for validity. In some cases,
-formerly valid but now obsolete format id values are mapped
-to current values. The input values are:
-<BR> <TT>       </TT><I>*format</I>:<TT>        </TT><TT>        </TT><B>MBIO</B> format id<BR>
-<BR>
-
-The return values are:
-<BR> <TT>       </TT><I>*format</I>:<TT>        </TT><TT>        </TT><B>MBIO</B> format id<BR>
-<BR> <TT>       </TT><I>*beamwidth_xtrack</I>:<TT>      </TT>typical athwartships beam<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>width [degrees]<BR>
-<BR> <TT>       </TT><I>*beamwidth_ltrack</I>:<TT>      </TT>typical alongtrack beam<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>width [degrees]<BR>
-<BR>   <TT>     </TT><I>error</I>:<TT>  </TT><TT>        </TT>error value<BR>
-<BR>
-
-A status value indicating success or failure is returned; the error value
-argument <I>error</I> passes more detailed information about failures.
-<P>
----------------------------------------------------------
-<BR>
-
-int <B>mb_datalist_open</B>(
-<BR> <TT>       </TT><TT>        </TT>int <I>verbose</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>char <I>**datalist</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>char <I>*path</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>look_processed</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*error</I>);<BR>
-<P>
-The function <B>mb_datalist_open</B> initializes reading
-from a datalist tree. The string <I>*path</I> is the
-path to the top level datalist file to be opened.
-The value <I>look_processed</I> indicates whether the datalist
-parsing should look for or ignore processed data files
-(see the <B>mbprocess</B> and <B>mbdatalist</B> manual pages).
-The input values are:
-<BR> <TT>       </TT><I>*path</I>:<TT>  </TT><TT>        </TT>datalist file to be opened<BR>
-<BR> <TT>       </TT><I>look_processed</I>:<TT> </TT>processed file behavior<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>0 : unset<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>1 : ignore processed files<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT><TT>        </TT>2 : return processed files<BR>
-<BR>
-
-The return values are:
-<BR> <TT>       </TT><I>**datalist</I>:<TT>     </TT>pointer to datalist<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT>structure<BR>
-<BR>   <TT>     </TT><I>error</I>:<TT>  </TT><TT>        </TT>error value<BR>
-<BR>
-
-A status value indicating success or failure is returned; the error value
-argument <I>error</I> passes more detailed information about failures.
-<P>
----------------------------------------------------------
-<BR>
-
-int <B>mb_datalist_read</B>(
-<BR> <TT>       </TT><TT>        </TT>int <I>verbose</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>char <I>*datalist</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>char <I>*path</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*format</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*weight</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*error</I>);<BR>
-<P>
-The function <B>mb_datalist_read</B> reads
-from a datalist tree, attempting to return the path
-to the next valid swath data file, the corresponding data
-format id, and a gridding weight
-(see the <B>mbprocess</B> and <B>mbdatalist</B> manual pages).
-Information about the
-datalist tree is embedded in a data structure pointed to
-by <I>*datalist</I>. The input values are:
-<BR> <TT>       </TT><I>*datalist</I>:<TT>      </TT>pointer to datalist<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT>structure<BR>
-<BR>
-
-The return values are:
-<BR> <TT>       </TT><I>*path</I>:<TT>  </TT><TT>        </TT>swath data file<BR>
-<BR> <TT>       </TT><I>*format</I>:<TT>        </TT><TT>        </TT><B>MBIO</B> format id<BR>
-<BR> <TT>       </TT><I>*weight</I>:<TT>        </TT><TT>        </TT><B>mbgrid</B> gridding weight<BR>
-<BR>   <TT>     </TT><I>error</I>:<TT>  </TT><TT>        </TT>error value<BR>
-<BR>
-
-A status value indicating success or failure is returned; the error value
-argument <I>error</I> passes more detailed information about failures.
-<P>
----------------------------------------------------------
-<BR>
-
-int <B>mb_datalist_close</B>(
-<BR> <TT>       </TT><TT>        </TT>int <I>verbose</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>char <I>**datalist</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*error</I>);<BR>
-<P>
-The function <B>mb_datalist_close</B> closes an
-open datalist tree, and deallocates the data structure pointed to
-by <I>*datalist</I>. The input values are:
-<BR> <TT>       </TT><I>*datalist</I>:<TT>      </TT>pointer to datalist<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT>structure<BR>
-<BR>
-
-The return values are:
-<BR>   <TT>     </TT><I>error</I>:<TT>  </TT><TT>        </TT>error value<BR>
-<BR>
-
-A status value indicating success or failure is returned; the error value
-argument <I>error</I> passes more detailed information about failures.
-<P>
----------------------------------------------------------
-<BR>
-
-int <B>mb_alloc</B>(
-<BR> <TT>       </TT><TT>        </TT>int <I>verbose</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>char <I>*mbio_ptr</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>char <I>**store_ptr</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*error</I>);<BR>
-<P>
-The function <B>mb_alloc</B> allocates a data structure
-for internal storage of swath sonar data
-and returns a pointer to this structure in <I>*store_ptr</I>.
-The data structure is specific to the data format identified
-in the <B>MBIO</B> data structure pointed to by <I>*mbio_ptr</I>.
-The input values are:
-<BR> <TT>       </TT><I>*mbio_ptr</I>:<TT>      </TT>pointer to <B>MBIO</B> structure<BR>
-<BR>
-
-The return values are:
-<BR> <TT>       </TT><I>**store_ptr</I>:<TT>    </TT>pointer to storage data<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT>structure<BR>
-<BR>   <TT>     </TT><I>error</I>:<TT>  </TT><TT>        </TT>error value<BR>
-<BR>
-
-A status value indicating success or failure is returned; the error value
-argument <I>error</I> passes more detailed information about failures.
-<P>
----------------------------------------------------------
-<BR>
-
-int <B>mb_deall</B>(
-<BR> <TT>       </TT><TT>        </TT>int <I>verbose</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>char <I>*mbio_ptr</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>char <I>**store_ptr</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*error</I>);<BR>
-<P>
-The function <B>mb_deall</B> deallocates a format specific
-swath sonar data structure pointed to by <I>*store_ptr</I>.
-The input values are:
-<BR> <TT>       </TT><I>*mbio_ptr</I>:<TT>      </TT>pointer to <B>MBIO</B> structure<BR>
-<BR> <TT>       </TT><I>*store_ptr</I>:<TT>     </TT>pointer to storage data<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT>structure<BR>
-<BR>
-
-The return values are:
-<BR>   <TT>     </TT><I>error</I>:<TT>  </TT><TT>        </TT>error value<BR>
-<BR>
-
-A status value indicating success or failure is returned; the error value
-argument <I>error</I> passes more detailed information about failures.
-<P>
----------------------------------------------------------
-<BR>
-
-int <B>mb_error</B>(
-<BR> <TT>       </TT><TT>        </TT>int <I>error</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>error</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>char <I>**message</I>);<BR>
-<P>
-Given the error value <I>error</I>, <B>mb_format_inf</B> returns a
-short error message in the string **<I>message</I>. The <I>verbose</I>
-value controls the standard error output verbosity of the function.  The return
-status value signals success if <I>format</I> is valid and failure otherwise.
-<P>
----------------------------------------------------------
-<BR>
-
-int <B>mb_navint_add</B>(
-<BR> <TT>       </TT><TT>        </TT>int <I>verbose</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>char <I>*mbio_ptr</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>time_d</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>lon</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>lat</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*error</I>);<BR>
-<P>
-The function <B>mb_navint_add</B> adds a navigation fix
-to a circular buffer of navigation values maintained in
-the <B>MBIO</B> data structure pointed to by <B>*mbio_ptr</B>.
-This buffer is used to interpolate navigation for data
-formats where the navigation is asynchronous (where navigation
-and survey pings come in different data records).
-The input values are:
-<BR> <TT>       </TT><I>*mbio_ptr</I>:<TT>      </TT>pointer to <B>MBIO</B> structure<BR>
-<BR> <TT>       </TT><I>time_d</I>:<TT> </TT><TT>        </TT>time of navigation fix in seconds<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT>since 1/1/70 00:00:00<BR>
-<BR> <TT>       </TT><I>lon</I>:<TT>    </TT><TT>        </TT>longitude (degrees)<BR>
-<BR> <TT>       </TT><I>lat</I>:<TT>    </TT><TT>        </TT>latitude (degrees)<BR>
-<BR>
-
-The return values are:
-<BR>   <TT>     </TT><I>error</I>:<TT>  </TT><TT>        </TT>error value<BR>
-<BR>
-
-A status value indicating success or failure is returned; the error value
-argument <I>error</I> passes more detailed information about failures.
-<P>
----------------------------------------------------------
-<BR>
-
-int <B>mb_navint_interp</B>(
-<BR> <TT>       </TT><TT>        </TT>int <I>verbose</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>char <I>*mbio_ptr</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>time_d</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>heading</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>rawspeed</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*lon</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*lat</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*speed</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*error</I>);<BR>
-<P>
-The function <B>mb_navint_interp</B> interpolates navigation to
-the time <I>time_d</I> using
-a circular buffer of navigation values maintained in
-the <B>MBIO</B> data structure pointed to by <B>*mbio_ptr</B>.
-This buffer is used to interpolate navigation for data
-formats where the navigation is asynchronous (where navigation
-and survey pings come in different data records).
-The input values are:
-<BR> <TT>       </TT><I>*mbio_ptr</I>:<TT>      </TT>pointer to <B>MBIO</B> structure<BR>
-<BR> <TT>       </TT><I>time_d</I>:<TT> </TT><TT>        </TT>time of current ping in seconds<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT>since 1/1/70 00:00:00<BR>
-<BR> <TT>       </TT><I>heading</I>:<TT>        </TT><TT>        </TT>heading in degrees<BR>
-<BR> <TT>       </TT><I>rawspeed</I>:<TT>       </TT><TT>        </TT>speed in km/hr<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT><TT>        </TT>(zero if not known)<BR>
-<BR>
-
-The return values are:
-<BR> <TT>       </TT><I>*lon</I>:<TT>   </TT><TT>        </TT>longitude (degrees)<BR>
-<BR> <TT>       </TT><I>*lat</I>:<TT>   </TT><TT>        </TT>latitude (degrees)<BR>
-<BR> <TT>       </TT><I>*speed</I>:<TT> </TT><TT>        </TT>speed made good in km/hr<BR>
-<BR>   <TT>     </TT><I>error</I>:<TT>  </TT><TT>        </TT>error value<BR>
-<BR>
-
-A status value indicating success or failure is returned; the error value
-argument <I>error</I> passes more detailed information about failures.
-<P>
----------------------------------------------------------
-<BR>
-
-int <B>mb_attint_add</B>(
-<BR> <TT>       </TT><TT>        </TT>int <I>verbose</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>char <I>*mbio_ptr</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>time_d</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>heave</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>roll</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>pitch</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*error</I>);<BR>
-<P>
-The function <B>mb_attint_add</B> adds an attitude
-(heave, roll, pitch) data point
-to a circular buffer of attitude values maintained in
-the <B>MBIO</B> data structure pointed to by <B>*mbio_ptr</B>.
-This buffer is used to interpolate attitude for data
-formats where the attitude is asynchronous (where attitude
-and survey pings come in different data records).
-The input values are:
-<BR> <TT>       </TT><I>*mbio_ptr</I>:<TT>      </TT>pointer to <B>MBIO</B> structure<BR>
-<BR> <TT>       </TT><I>time_d</I>:<TT> </TT><TT>        </TT>time of attitude in seconds<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT>since 1/1/70 00:00:00<BR>
-<BR> <TT>       </TT><I>heave</I>:<TT>  </TT><TT>        </TT>heave (meters, up +)<BR>
-<BR> <TT>       </TT><I>roll</I>:<TT>   </TT><TT>        </TT>roll (degrees, starboard up +)<BR>
-<BR> <TT>       </TT><I>pitch</I>:<TT>  </TT><TT>        </TT>pitch (degrees, forward up +)<BR>
-<BR>
-
-The return values are:
-<BR>   <TT>     </TT><I>error</I>:<TT>  </TT><TT>        </TT>error value<BR>
-<BR>
-
-A status value indicating success or failure is returned; the error value
-argument <I>error</I> passes more detailed information about failures.
-<P>
----------------------------------------------------------
-<BR>
-
-int <B>mb_attint_interp</B>(
-<BR> <TT>       </TT><TT>        </TT>int <I>verbose</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>char <I>*mbio_ptr</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>time_d</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*heave</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*roll</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*pitch</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*error</I>);<BR>
-<P>
-The function <B>mb_attint_interp</B> interpolates attitude
-(heave, roll, pitch) data to
-the time <I>time_d</I> using
-a circular buffer of attitude values maintained in
-the <B>MBIO</B> data structure pointed to by <B>*mbio_ptr</B>.
-This buffer is used to interpolate attitude for data
-formats where the attitude is asynchronous (where attitude
-and survey pings come in different data records).
-The input values are:
-<BR> <TT>       </TT><I>*mbio_ptr</I>:<TT>      </TT>pointer to <B>MBIO</B> structure<BR>
-<BR> <TT>       </TT><I>time_d</I>:<TT> </TT><TT>        </TT>time of current ping in seconds<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT>since 1/1/70 00:00:00<BR>
-<BR>
-
-The return values are:
-<BR> <TT>       </TT><I>*heave</I>:<TT> </TT><TT>        </TT>heave (meters, up +)<BR>
-<BR> <TT>       </TT><I>*roll</I>:<TT>  </TT><TT>        </TT>roll (degrees, starboard up +)<BR>
-<BR> <TT>       </TT><I>*pitch</I>:<TT> </TT><TT>        </TT>pitch (degrees, forward up +)<BR>
-<BR>   <TT>     </TT><I>error</I>:<TT>  </TT><TT>        </TT>error value<BR>
-<BR>
-
-A status value indicating success or failure is returned; the error value
-argument <I>error</I> passes more detailed information about failures.
-<P>
----------------------------------------------------------
-<BR>
-
-int <B>mb_hedint_add</B>(
-<BR> <TT>       </TT><TT>        </TT>int <I>verbose</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>char <I>*mbio_ptr</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>time_d</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>heading</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*error</I>);<BR>
-<P>
-The function <B>mb_hedint_add</B> adds a heading point
-to a circular buffer of heading values maintained in
-the <B>MBIO</B> data structure pointed to by <B>*mbio_ptr</B>.
-This buffer is used to interpolate heading for data
-formats where the heading is asynchronous (where heading
-and survey pings come in different data records).
-The input values are:
-<BR> <TT>       </TT><I>*mbio_ptr</I>:<TT>      </TT>pointer to <B>MBIO</B> structure<BR>
-<BR> <TT>       </TT><I>time_d</I>:<TT> </TT><TT>        </TT>time of heading value in seconds<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT>since 1/1/70 00:00:00<BR>
-<BR> <TT>       </TT><I>heading</I>:<TT>        </TT><TT>        </TT>heading (degrees)<BR>
-<BR>
-
-The return values are:
-<BR>   <TT>     </TT><I>error</I>:<TT>  </TT><TT>        </TT>error value<BR>
-<BR>
-
-A status value indicating success or failure is returned; the error value
-argument <I>error</I> passes more detailed information about failures.
-<P>
----------------------------------------------------------
-<BR>
-
-int <B>mb_hedint_interp</B>(
-<BR> <TT>       </TT><TT>        </TT>int <I>verbose</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>char <I>*mbio_ptr</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>time_d</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*heading</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*error</I>);<BR>
-<P>
-The function <B>mb_hedint_interp</B> interpolates heading to
-the time <I>time_d</I> using
-a circular buffer of heading values maintained in
-the <B>MBIO</B> data structure pointed to by <B>*mbio_ptr</B>.
-This buffer is used to interpolate heading for data
-formats where the heading is asynchronous (where heading
-and survey pings come in different data records).
-The input values are:
-<BR> <TT>       </TT><I>*mbio_ptr</I>:<TT>      </TT>pointer to <B>MBIO</B> structure<BR>
-<BR> <TT>       </TT><I>time_d</I>:<TT> </TT><TT>        </TT>time of current ping in seconds<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT>since 1/1/70 00:00:00<BR>
-<BR>
-
-The return values are:
-<BR> <TT>       </TT><I>*heading</I>:<TT>       </TT><TT>        </TT>heading in degrees<BR>
-<BR>   <TT>     </TT><I>error</I>:<TT>  </TT><TT>        </TT>error value<BR>
-<BR>
-
-A status value indicating success or failure is returned; the error value
-argument <I>error</I> passes more detailed information about failures.
-<P>
----------------------------------------------------------
-<BR>
-
-int <B>mb_get_double</B>(
-<BR> <TT>       </TT><TT>        </TT>double <I>*value</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>char <I>*str</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>nchar</I>);<BR>
-<P>
-The function <B>mb_get_double</B> parses the
-first <I>nchar</I> characters of the string
-<I>*str</I> for a floating point value, storing
-this value as a double in <I>*value</I>.
-<P>
----------------------------------------------------------
-<BR>
-
-int <B>mb_get_int</B>(
-<BR> <TT>       </TT><TT>        </TT>int <I>*value</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>char <I>*str</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>nchar</I>);<BR>
-<P>
-The function <B>mb_get_int</B> parses the
-first <I>nchar</I> characters of the string
-<I>*str</I> for an integer value, storing
-this value as a int in <I>*value</I>.
-<P>
----------------------------------------------------------
-<BR>
-
-int <B>mb_get_binary_short</B>(
-<BR> <TT>       </TT><TT>        </TT>int <I>swapped</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>void <I>*buffer</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>short <I>*value</I>);<BR>
-<P>
-The function <B>mb_get_binary_short</B> extracts
-a short int value from the first two bytes pointed to
-by <I>*buffer</I>. If the boolean <I>swapped</I> is true,
-the byte order of <I>*value</I> is swapped.
-<P>
----------------------------------------------------------
-<BR>
-
-int <B>mb_get_binary_int</B>(
-<BR> <TT>       </TT><TT>        </TT>int <I>swapped</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>void <I>*buffer</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*value</I>);<BR>
-<P>
-The function <B>mb_get_binary_int</B> extracts
-an int value from the first four bytes pointed to
-by <I>*buffer</I>. If the boolean <I>swapped</I> is true,
-the byte order of <I>*value</I> is swapped.
-<P>
----------------------------------------------------------
-<BR>
-
-int <B>mb_get_binary_float</B>(
-<BR> <TT>       </TT><TT>        </TT>int <I>swapped</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>void <I>*buffer</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>float *value);<BR>
-<P>
-The function <B>mb_get_binary_float</B> extracts
-a float value from the first four bytes pointed to
-by <I>*buffer</I>. If the boolean <I>swapped</I> is true,
-the byte order of <I>*value</I> is swapped.
-<P>
----------------------------------------------------------
-<BR>
-
-int <B>mb_get_binary_double</B>(
-<BR> <TT>       </TT><TT>        </TT>int <I>swapped</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>void <I>*buffer</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*value</I>);<BR>
-<P>
-The function <B>mb_get_binary_double</B> extracts
-a double value from the first eight bytes pointed to
-by <I>*buffer</I>. If the boolean <I>swapped</I> is true,
-the byte order of <I>*value</I> is swapped.
-<P>
----------------------------------------------------------
-<BR>
-
-int <B>mb_put_binary_short</B>(
-<BR> <TT>       </TT><TT>        </TT>int <I>swapped</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>short value,<BR>
-<BR> <TT>       </TT><TT>        </TT>void <I>*buffer</I>);<BR>
-<P>
-The function <B>mb_put_binary_short</B> inserts
-a short int value into the first two bytes pointed to
-by <I>*buffer</I>. If the boolean <I>swapped</I> is true,
-the byte order of <I>value</I> is swapped.
-<P>
----------------------------------------------------------
-<BR>
-
-int <B>mb_put_binary_int</B>(
-<BR> <TT>       </TT><TT>        </TT>int <I>swapped</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>value</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>void <I>*buffer</I>);<BR>
-<P>
-The function <B>mb_put_binary_int</B> inserts
-an int value into the first four bytes pointed to
-by <I>*buffer</I>. If the boolean <I>swapped</I> is true,
-the byte order of <I>value</I> is swapped.
-<P>
----------------------------------------------------------
-<BR>
-
-int <B>mb_put_binary_float</B>(
-<BR> <TT>       </TT><TT>        </TT>int <I>swapped</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>float value,<BR>
-<BR> <TT>       </TT><TT>        </TT>void <I>*buffer</I>);<BR>
-<P>
-The function <B>mb_put_binary_float</B> inserts
-a float value into the first four bytes pointed to
-by <I>*buffer</I>. If the boolean <I>swapped</I> is true,
-the byte order of <I>value</I> is swapped.
-<P>
----------------------------------------------------------
-<BR>
-
-int <B>mb_put_binary_double</B>(
-<BR> <TT>       </TT><TT>        </TT>int <I>swapped</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>value</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>void <I>*buffer</I>);<BR>
-<P>
-The function <B>mb_put_binary_double</B> inserts
-a double value into the first eight bytes pointed to
-by <I>*buffer</I>. If the boolean <I>swapped</I> is true,
-the byte order of <I>value</I> is swapped.
-<P>
----------------------------------------------------------
-<BR>
-
-int <B>mb_get_bounds</B>(
-<BR> <TT>       </TT><TT>        </TT>char <I>*text</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*bounds</I>);<BR>
-<P>
-The function <B>mb_get_bounds</B> parses the string
-<I>*text</I> and extracts geographic bounds of a
-rectangular region in the form:
-<BR> <TT>       </TT><TT>        </TT><I>bounds[0]</I>: minimum longitude<BR>
-<BR> <TT>       </TT><TT>        </TT><I>bounds[1]</I>: maximum longitude<BR>
-<BR> <TT>       </TT><TT>        </TT><I>bounds[2]</I>: minimum latitude<BR>
-<BR> <TT>       </TT><TT>        </TT><I>bounds[3]</I>: maximum latitude<BR>
-<BR>
-
-where <I>*text</I> is in the standard <B>GMT</B> bounds form.
-The longitude and latitude values in <I>*text</I>
-should separated by a '/' character, and individual
-values may be represented in decimal degrees or in
-"dd:mm:ss" form (dd=degrees, mm=minutes, ss=seconds).
-<P>
-double <B>mb_ddmmss_to_degree</B>(
-<BR> <TT>       </TT><TT>        </TT>char <I>*text</I>);<BR>
-<P>
-The function <B>mb_ddmmss_to_degree</B> parses the string
-<I>*text</I> and extracts a decimal longitude or latitude
-value from a "dd:mm:ss" (dd=degrees, mm=minutes, ss=seconds)
-value.
-<P>
----------------------------------------------------------
-<BR>
-
-int <B>mb_takeoff_to_rollpitch</B>(
-<BR> <TT>       </TT><TT>        </TT>int <I>verbose</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>theta</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>phi</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*alpha</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*beta</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*error</I>);<BR>
-<P>
-The function <B>mb_takeoff_to_rollpitch</B>
-translates angles from the "takeoff" coordinate
-reference frame to the "rollpitch" coordinate system.
-See the discussion of coordinate systems below.
-<P>
----------------------------------------------------------
-<BR>
-
-int <B>mb_rollpitch_to_takeoff</B>(
-<BR> <TT>       </TT><TT>        </TT>int <I>verbose</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>alpha</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>beta</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*theta</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>double <I>*phi</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*error</I>);<BR>
-<P>
-The function <B>mb_rollpitch_to_takeoff</B>
-translates angles from the "rollpitch" coordinate
-reference frame to the "takeoff" coordinate system.
-See the discussion of coordinate systems below.
-<P>
----------------------------------------------------------
-<BR>
-
-int <B>mb_double_compare</B>(double <I>*a</I>,
-<BR> <TT>       </TT><TT>        </TT>double <I>*b</I>);<BR>
-<P>
-The function <B>mb_double_compare</B>
-is used with the <B>qsort</B> function.
-This function returns 1 if a > b and -1 if a <= b.
-<P>
----------------------------------------------------------
-<BR>
-
-int <B>mb_int_compare</B>(
-<BR> <TT>       </TT><TT>        </TT>int <I>*a</I>,<BR>
-<BR> <TT>       </TT><TT>        </TT>int <I>*b</I>);<BR>
-<P>
-The function <B>mb_int_compare</B>
-is used with the <B>qsort</B> function.
-This function returns 1 if a > b and -1 if a <= b.
-<P>
-<A NAME="lbAR"> </A>
-<H2>COORDINATE SYSTEMS USED IN MB-SYSTEM</H2>
-
-I. Introduction
-<BR>
-
-The coordinate systems described below are used
-within <B>MB-System</B> for calculations involving
-the location in space of depth, amplitude, or
-sidescan data. In all cases the origin of the
-coordinate system is at the center of the sonar
-transducers.
-<P>
-II. Cartesian Coordinates
-<BR>
-
-The cartesian coordinate system used in <B>MB-System</B>
-is a bit odd because it is left-handed, as opposed
-to the right-handed x-y-z space conventionally
-used in most circumstances. With respect to the
-sonar (or the ship on which the sonar is mounted),
-the x-axis is athwartships with positive to starboard
-(to the right if facing forward), the y-axis is
-fore-aft with positive forward, and the z-axis is
-positive down.
-<P>
-III. Spherical Coordinates
-<BR>
-
-There are two non-traditional spherical coordinate
-systems used in <B>MB-System</B>. The first, referred to here
-as takeoff angle coordinates, is useful for raytracing.
-The second, referred to here as roll-pitch
-coordinates, is useful for taking account of
-corrections to roll and pitch angles.
-<P>
-III.1. Takeoff Angle Coordinates
-<P>
-The three parameters are r, theta, and phi, where
-r is the distance from the origin, theta is the
-angle from vertical down (that is, from the
-positive z-axis), and phi is the angle from
-acrosstrack (the positive x-axis) in the x-y plane.
-Note that theta is always positive; the direction
-in the x-y plane is given by phi.
-Raytracing is simple in these coordinates because
-the ray takeoff angle is just theta. However,
-applying roll or pitch corrections is complicated because
-roll and pitch have components in both theta and phi.
-<P>
-<BR> <TT>       </TT>0 <= theta <= PI/2<BR>
-<BR> <TT>       </TT>-PI/2 <= phi <= 3*PI/2<BR>
-<P>
-<BR> <TT>       </TT>x = rSIN(theta)COS(phi)<BR>
-<BR> <TT>       </TT>y = rSIN(theta)SIN(phi)<BR>
-<BR> <TT>       </TT>z = rCOS(theta)<BR>
-<P>
-<BR> <TT>       </TT>theta = 0    ---> vertical, along positive z-axis<BR>
-<BR> <TT>       </TT>theta = PI/2 ---> horizontal, in x-y plane<BR>
-<BR> <TT>       </TT>phi = -PI/2  ---> aft, in y-z plane with y negative<BR>
-<BR> <TT>       </TT>phi = 0      ---> port, in x-z plane with x positive<BR>
-<BR> <TT>       </TT>phi = PI/2   ---> forward, in y-z plane with y positive<BR>
-<BR> <TT>       </TT>phi = PI     ---> starboard, in x-z plane with x negative<BR>
-<BR> <TT>       </TT>phi = 3*PI/2 ---> aft, in y-z plane with y negative<BR>
-<P>
-III.2. Roll-Pitch Coordinates
-<P>
-The three parameters are r, alpha, and beta, where
-r is the distance from the origin, alpha is the angle
-forward (effectively pitch angle), and beta is the
-angle from horizontal in the x-z plane (effectively
-roll angle). Applying a roll or pitch correction is
-simple in these coordinates because pitch is just alpha
-and roll is just beta. However, raytracing is complicated
-because deflection from vertical has components in both
-alpha and beta.
-<P>
-<BR> <TT>       </TT>-PI/2 <= alpha <= PI/2<BR>
-<BR> <TT>       </TT>0 <= beta <= PI<BR>
-<P>
-<BR> <TT>       </TT>x = rCOS(alpha)COS(beta)<BR>
-<BR> <TT>       </TT>y = rSIN(alpha)<BR>
-<BR> <TT>       </TT>z = rCOS(alpha)SIN(beta)<BR>
-<P>
-<BR>  <TT>      </TT>alpha = -PI/2 ---> horizontal, in x-y plane with y negative<BR>
-<BR> <TT>       </TT>alpha = 0     ---> ship level, zero pitch, in x-z plane<BR>
-<BR> <TT>       </TT>alpha = PI/2  ---> horizontal, in x-y plane with y positive<BR>
-<BR> <TT>       </TT>beta = 0      ---> starboard, along positive x-axis<BR>
-<BR> <TT>       </TT>beta = PI/2   ---> in y-z plane rotated by alpha<BR>
-<BR> <TT>       </TT>beta = PI     ---> port, along negative x-axis<BR>
-<P>
-IV. SeaBeam Coordinates
-<P>
-The per-beam parameters in the SB2100 data format include
-angle-from-vertical and angle-forward. Angle-from-vertical
-is the same as theta except that it is signed based on
-the acrosstrack direction (positive to starboard, negative
-to port). The angle-forward values are also defined
-slightly differently from phi, in that angle-forward is
-signed differently on the port and starboard sides. The
-SeaBeam 2100 External Interface Specifications document
-includes both discussion and figures illustrating the
-angle-forward value. To summarize:
-<P>
-<BR>    Port:
-<P>
-<BR> <TT>       </TT>theta = absolute value of angle-from-vertical<BR>
-<P>
-<BR> <TT>       </TT>-PI/2 <= phi <= PI/2<BR>
-<BR> <TT>       </TT>is equivalent to<BR>
-<BR> <TT>       </TT>-PI/2 <= angle-forward <= PI/2<BR>
-<P>
-<BR> <TT>       </TT>phi = -PI/2 ---> angle-forward = -PI/2 (aft)<BR>
-<BR> <TT>       </TT>phi = 0     ---> angle-forward = 0     (starboard)<BR>
-<BR> <TT>       </TT>phi = PI/2  ---> angle-forward = PI/2  (forward)<BR>
-<P>
-<BR>    Starboard:
-<P>
-<BR> <TT>       </TT>theta = angle-from-vertical<BR>
-<P>
-<BR> <TT>       </TT>PI/2 <= phi <= 3*PI/2<BR>
-<BR> <TT>       </TT>is equivalent to<BR>
-<BR> <TT>       </TT>-PI/2 <= angle-forward <= PI/2<BR>
-<P>
-<BR> <TT>       </TT>phi = PI/2   ---> angle-forward = -PI/2 (forward)<BR>
-<BR> <TT>       </TT>phi = PI     ---> angle-forward = 0     (port)<BR>
-<BR> <TT>       </TT>phi = 3*PI/2 ---> angle-forward = PI/2  (aft)<BR>
-<P>
-V. Usage of Coordinate Systems in <B>MB-System</B>
-<P>
-Some sonar data formats provide angle values along with
-travel times. The angles are converted to takoff-angle
-coordinates regardless of the  storage form of the
-particular data format. Currently, most data formats
-do not contain an alongtrack component to the position
-values; in these cases the conversion is trivial since
-phi = beta = 0 and theta = alpha. The angle and travel time
-values can be accessed using the <B>MBIO</B> function <B>mb_ttimes</B>.
-All angle values passed by <B>MB-System</B> functions are in
-degrees rather than radians.
-<P>
-The programs <B>mbbath</B> and <B>mbvelocitytool</B> use angles in
-take-off angle coordinates to do the raytracing. If roll
-and/or pitch corrections are to be made, the angles are
-converted to roll-pitch coordinates, corrected, and then
-converted back prior to raytracing.
-<P>
-<P>
-<A NAME="lbAS"> </A>
-<H2>BEAM FLAGS USED IN MB-SYSTEM</H2>
-
-<B>MB-System</B> uses arrays of 1-byte "beamflag" values to indicate
-beam data quality. Each beamflag value is actually an eight bit mask
-allowing fairly complicated information to be stored regarding
-each bathymetry value. In particular, beams may be flagged as
-bad, they may be selected as being of special interest, and
-one or more reasons for flagging or selection may be indicated.
-This scheme is very similar to the convention used in the HMPS
-hydrographic data processing package and the SAIC Hydrobat
-package. The beam selection mechanism is not currently used by
-any <B>MB-System</B> programs.
-<P>
-The flag and select bits:
-<BR>  xxxxxx00 => This beam is neither flagged nor selected.
-<BR>  xxxxxx01 => This beam is flagged as bad and should be ignored.
-<BR>  xxxxxx10 => This beam has been selected.
-<P>
-Flagging modes:
-<BR>  00000001 => Flagged because no detection was made by the sonar.
-<BR>  xxxxx101 => Flagged by manual editing.
-<BR>  xxxx1x01 => Flagged by automatic filter.
-<BR>  xxx1xx01 => Flagged because uncertainty exceeds 1 X IHO standard.
-<BR>  xx1xxx01 => Flagged because uncertainty exceeds 2 X IHO standard.
-<BR>  x1xxxx01 => Flagged because footprint is too large
-<BR>  1xxxxx01 => Flagged by sonar as unreliable.
-<P>
-Selection modes:
-<BR>  00000010 => Selected, no reason specified.
-<BR>  xxxxx110 => Selected as least depth.
-<BR>  xxxx1x10 => Selected as average depth.
-<BR>  xxx1xx10 => Selected as maximum depth.
-<BR>  xx1xxx10 => Selected as location of sidescan contact.
-<BR>  x1xxxx10 => Selected, spare.
-<BR>  1xxxxx10 => Selected, spare.
-<P>
-<A NAME="lbAT"> </A>
-<H2>SEE ALSO</H2>
-
-<B><A HREF="mbsystem.html">mbsystem</A></B>(l), <B><A HREF="mbformat.html">mbformat</A></B>(l)
-<P>
-<A NAME="lbAU"> </A>
-<H2>BUGS</H2>
-
-What could go wrong in a mere 204,289 lines of code?
-<BR>
-
-Let us know...
-<P>
-
-<HR>
-<A NAME="index"> </A><H2>Index</H2>
-<DL>
-<DT><A HREF="#lbAB">NAME</A><DD>
-<DT><A HREF="#lbAC">VERSION</A><DD>
-<DT><A HREF="#lbAD">DESCRIPTION</A><DD>
-<DT><A HREF="#lbAE">AUTHORSHIP</A><DD>
-<DT><A HREF="#lbAF">DATA TERMINOLOGY</A><DD>
-<DT><A HREF="#lbAG">VERSION 5 CHANGES</A><DD>
-<DT><A HREF="#lbAH">OVERVIEW</A><DD>
-<DT><A HREF="#lbAI">SUPPORTED SWATH SONAR SYSTEMS</A><DD>
-<DT><A HREF="#lbAJ">SUPPORTED FORMATS</A><DD>
-<DT><A HREF="#lbAK">FUNCTION STATUS AND ERROR CODES</A><DD>
-<DT><A HREF="#lbAL">FUNCTION VERBOSITY</A><DD>
-<DT><A HREF="#lbAM">INITIALIZATION AND CLOSING FUNCTIONS</A><DD>
-<DT><A HREF="#lbAN">LEVEL 1 FUNCTIONS</A><DD>
-<DT><A HREF="#lbAO">LEVEL 2 FUNCTIONS</A><DD>
-<DT><A HREF="#lbAP">LEVEL 3 FUNCTIONS</A><DD>
-<DT><A HREF="#lbAQ">MISCELLANEOUS FUNCTIONS</A><DD>
-<DT><A HREF="#lbAR">COORDINATE SYSTEMS USED IN MB-SYSTEM</A><DD>
-<DT><A HREF="#lbAS">BEAM FLAGS USED IN MB-SYSTEM</A><DD>
-<DT><A HREF="#lbAT">SEE ALSO</A><DD>
-<DT><A HREF="#lbAU">BUGS</A><DD>
-</DL>
-<HR>
-</PRE>
-
-<CENTER><P><BR>
-Last Updated: 3 June 2013</P></CENTER>
-
-<HR>
-<P><A HREF="mbsystem_man_list.html">Return to list of MB-System manual pages...</A></P>
-<P><A HREF="mbsystem_home.html"><IMG SRC="mbsystem_logo_small.gif" BORDER=0 HEIGHT=55 WIDTH=158 ALIGN=BOTTOM></A><A HREF="mbsystem_home.html">Back
-to MB-System Home Page...</A></P>
-
-</BODY>
-</HTML>
diff --git a/src/html/mbkongsbergpreprocess.html b/src/html/mbkongsbergpreprocess.html
deleted file mode 100644
index c756c9e..0000000
--- a/src/html/mbkongsbergpreprocess.html
+++ /dev/null
@@ -1,402 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<HTML VERSION="2.0">
-<HEAD>
-   <TITLE>MB-System Unix Manual Page: mbkongsbergpreprocess</TITLE>
-<!-- WEBMAGIC VERSION NUMBER="2.0.2" -->
-<!-- WEBMAGIC TRANSLATION NAME="ServerRoot" SRC="/var/www/htdocs/" DST="/" -->
-<!-- WEBMAGIC TRANSLATION NAME="ProjectRoot" SRC="./" DST="" -->
-</HEAD>
-<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#336699" VLINK="#997040" ALINK="#CC9900">
-<BODY>
-<CENTER><H3><U>MB-System Unix Manual Page</U></H3></CENTER>
-<PRE>
-<H1>mbkongsbergpreprocess</H1>
-Section:  MB-System 5.0  (1)<BR>Updated:  12 November 2014 <BR><A HREF="#index">Index</A>
-<HR>
-
-<A NAME="lbAB"> </A>
-<H2>NAME</H2>
-
-<B>mbkongsbergpreprocess</B> - performs preprocessing of data from third generation
-Kongsberg multibeam sonars (e.g. EM122, EM302, EM710, EM2040, M3).
-<P>
-<A NAME="lbAC"> </A>
-<H2>VERSION</H2>
-
-Version 5.0
-<P>
-<A NAME="lbAD"> </A>
-<H2>SYNOPSIS</H2>
-
-<B>mbkongsbergpreprocess</B> [<B>-C</B> <B>-D</B><I>outputdirectory</I>
-<B>-E</B><I>offx/offy[/offdepth]</I>
-<B>-F</B><I>format</I>
-<B>-I</B><I>file </I><B>-O</B><I>outfile</I> <B>-P</B><I>filterlength/filterdepth</I>
-<B>-S</B><I>datatype/source</I>
-<B>-T</B><I>timelag</I> <B>-W -H -V</B>]
-<P>
-<A NAME="lbAE"> </A>
-<H2>DESCRIPTION</H2>
-
-<B>mbkongsbergpreprocess</B> reads data from a third generation
-Kongsberg multibeam sonar (e.g. EM122, EM302, EM710, EM2040, M3), interpolates the
-asynchronous navigation, heading, and attitude onto the multibeam data,
-and writes a new file with that information correctly embedded
-in the multibeam survey data. The input files may be in the vendor format
-MBF_EM710RAW (format id 58) or the <B>MB-System</B> extended format
-MBF_EM710MBA (format id 59); the output files will always be in
-the <B>MB-System</B> extended format MBF_EM710MBA (format id 59).
-<P>
-Like most modern swath survey data streams, Kongsberg multibeam data
-includes navigation, attitude, and heading data logged in separate
-data records as output by the respective sensors. Since each of these
-values is time stamped according to its origin rather than synced with
-multibeam pings, these values are asynchronous relative to the survey
-ping data. When multiple sources
-of navigation, heading, and/or attitude have been recorded in
-a data stream, <B>mbkongsbergpreprocess</B> allows the user to specify
-which asynchronous data are extracted and interpolated onto the
-survey data using the <B>-S</B> option.
-<P>
-This program allows the correction of a time latency
-(or time lag)  error between the sonar data and the attitude and
-navigation data using the <B>-T</B> option.
-<P>
-The format 58 files This program also creates four ancilliary files containing the full
-asynchronous attitude, sonar depth, and heading data and the synchronous
-attitude data in parallel with each output format 59 file.
-These files are used,
-when present, by <B>mbeditviz</B> to facillitate interactive analysis
-of time lag issues. Each of these are
-text files with white-space delimited columns; the first column
-is always time in decimal unix seconds. These have the following
-suffixes:
-<BR>    asynchronous attitude (roll and pitch):<TT>     </TT>*.ata<BR>
-<BR>    asynchronous heading:<TT>       </TT><TT>        </TT><TT>        </TT>*.ath<BR>
-<BR>    asynchronous sonar depth:<TT>   </TT><TT>        </TT><TT>        </TT>*.ats<BR>
-<BR>    synchronous attitude (roll and pitch):<TT>      </TT>*.sta<BR>
-<BR>    
-By default, <B>mbkongsbergpreprocess</B> ignores water column records and does
-not pass these large records into the output format 59 files. The <B>-W</B><I>1</I>
-option causes the water column records to be written in the output files.
-<P>
-<A NAME="lbAF"> </A>
-<H2>AUTHORSHIP</H2>
-
-David W. Caress (<A HREF="mailto:caress at mbari.org">caress at mbari.org</A>)
-<BR>
-
-<BR>  Monterey Bay Aquarium Research Institute
-<BR>
-
-Dale N. Chayes (<A HREF="mailto:dale at ldeo.columbia.edu">dale at ldeo.columbia.edu</A>)
-<BR>
-
-<BR>  Lamont-Doherty Earth Observatory
-<P>
-<A NAME="lbAG"> </A>
-<H2>OPTIONS</H2>
-
-<DL COMPACT>
-<DT><B>-C</B>
-
-<DD>
-<BR>
-
-This option causes <B>mbkongsbergpreprocess</B> to print counts of the many
-different data record types compising a Kongsberg data stream. The data record
-counts are output for each file and as totals from all files processed.
-<DT><B>-D</B>
-
-<DD>
-<I>outputdirectory</I>
-<BR>
-
-This option causes all format 59 output files to be placed in the specified directory
-<I>outputdirectory</I> rather than parallel to the original "raw" files.
-<DT><B>-E</B>
-
-<DD>
-<I>offx/offz[/offdepth]</I>
-<BR>
-
-This option is for data from submerged platforms such as ROVs or AUVs.
-This sets horizontal and vertical.distance offsets between the vehicle's
-depth sensor and the multibeam receive head. If specified, these values are used
-in a lever-arm calculation to determine the sonar depth change  associated with
-vehicle pitch. The <I>offdepth</I> value, if specified, is a static depth offset to be
-applied to the vehicle depth data.
-<DT><B>-F</B>
-
-<DD>
-<I>format</I>
-<BR>
-
-Sets the data format used if the input is read from stdin
-or from a file. If <I>format</I> < 0, then the input file specified
-with the <B>-I</B> option will actually contain a list of input swath sonar
-data files. This program only reads third generation Kongsberg multibeam
-format data files (<B>MBIO</B> formats 58 and 59).
-<DT><B>-H</B>
-
-<DD>
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-<DT><B>-I</B>
-
-<DD>
-<I>infile</I>
-<BR>
-
-Sets the input file path. If <I>format</I> > 0 (set with the
-<B>-f</B> option or <B>mbdefaults</B>) then the swath sonar data contained in <I>infile</I>
-is read and processed. If <I>format</I> < 0, then <I>infile</I>
-is assumed to be an ascii file containing a list of the input swath sonar
-data files to be processed and their formats.  The program will read
-the data in each one of these files.
-In the <I>infile</I> file, each
-data file should be followed by a data format identifier, e.g.:
-<BR> <TT>       </TT>datafile.all 58<BR>
-<BR> <TT>       </TT>datafile.all 58<BR>
-<BR>
-
-This program only reads third generation Kongsberg multibeam
-format data files (<B>MBIO</B> formats 58 and 59).
-<DT><B>-O</B>
-
-<DD>
-<I>outfile</I>
-<BR>
-
-This option causes <B>mbkongsbergpreprocess</B> to output all data to a single file
-specified as <I>outfile</I>. By default, the program creates output files for
-each input file. If the <B>-D</B><I>outputdirectory</I> option is also used, then
-the output file <I>outfile</I> will be in <I>outputdirectory</I>.
-<DT><B>-P</B>
-
-<DD>
-<I>filterlength/filterdepth</I>
-This option specifies Gaussian tapered time domain filtering of the
-sonar depth data to be merged with the survey data, regardless of source.
-The <I>filterlength</I> value specifies
-the filter window length in seconds, and the <I>filterdepth</I> value controls
-the depths to which filtering is applied. The filtered sonar depth is used
-to depths up to twice the <I>filterdepth</I> value. Below that threshold, the
-value used transitions to unfiltered with an exponential taper. This filtering
-is used in two ways. First, one can apply short period smoothing of noisy
-sonar depth at all by specifying a small <I>filterlength</I> (e.g. 2 seconds)
-and a <I>filterdepth</I> value deeper than the vehicle's track. Second, when
-an AUV or ROV is operated at shallow depths, the pressure
-values used to determine depth are affected by waves at the sea surface. In this
-case, a longer period <I>filterlength</I> (e.g. 10 seconds) and a shallower
-<I>filterdepth</I> (e.g. 50 meters) may be used to lessen the artifacts due to
-surface swell.
-<DT><B>-S</B>
-
-<DD>
-<I>datatype/source</I>
-<BR>
-
-This option specifies which data records should be the source of the
-navigation (<I>datatype</I> = 1), heading (<I>datatype</I> = 2), 
-attitude (<I>datatype</I> = 3), and sonar depth  (<I>datatype</I> = 4)
-data that are interpolated onto the
-survey ping times. In each case the <I>source</I> value specifies
-a data record type. The possibilities for Kongsberg data include:
-<BR>     MB_DATA_DATA<TT>       </TT><TT>        </TT>1<BR>
-<BR>     MB_DATA_NAV<TT>        </TT><TT>        </TT>12<BR>
-<BR>     MB_DATA_HEIGHT<TT>     </TT><TT>        </TT>16<BR>
-<BR>     MB_DATA_HEADING<TT>    </TT><TT>        </TT>17<BR>
-<BR>     MB_DATA_ATTITUDE<TT>   </TT><TT>        </TT>18<BR>
-<BR>     MB_DATA_NAV1<TT>       </TT><TT>        </TT>28<BR>
-<BR>     MB_DATA_NAV2<TT>       </TT><TT>        </TT>29<BR>
-<BR>     MB_DATA_NAV3<TT>       </TT><TT>        </TT>30<BR>
-<BR>     MB_DATA_ATTITUDE1<TT>  </TT><TT>        </TT>55<BR>
-<BR>     MB_DATA_ATTITUDE2<TT>  </TT><TT>        </TT>56<BR>
-<BR>     MB_DATA_ATTITUDE3<TT>  </TT><TT>        </TT>57<BR>
-<BR>
-
-The default values are:
-<BR>     nav_source = MB_DATA_NAV
-<BR>     attitude_source = MB_DATA_ATTITUDE
-<BR>     heading_source = MB_DATA_NAV
-<BR>     sonardepth_source = MB_DATA_DATA
-<BR>
-
-<DT><B>-T</B>
-
-<DD>
-<I>timelag</I>
-<BR>
-
-This option specifies a <I>timelag</I> value in seconds to be applied
-to the navigation and attitude data prior to it being merged with the
-bathymetry. If <I>timelag</I> is a valid path to a file containing time
-stamp and time lag pairs, then these data will be read and the time lag
-applied to particular records will be interpolated by time.
-<DT><B>-W</B>
-
-<DD>
-<I>mode</I>
-<BR>
-
-By default, <B>mbkongsbergpreprocess</B> ignores water column records and does
-not pass these large records into the output format 59 files. If <B>-W</B><I>1</I>
-is specified, then the water column records will be written to the output files.
-<P>
-</DL>
-<A NAME="lbAH"> </A>
-<H2>EXAMPLES</H2>
-
-Suppose that one has collected a set of three Kongsberg EM122 data files named:
-<BR>    0000_20111219_154640_METEOR_EM122.all
-<BR>    0001_20111219_163703_METEOR_EM122.all
-<BR>    0002_20111219_175708_METEOR_EM122.all
-<BR>
-
-First, we want to generate a "datalist" file referencing the raw survey files. The
-following will suffice:
-<BR>    /bin/ls -1 *all | awk '{print $1" 58"}' > datalist_raw.mb-1
-<BR>
-
-We want to use <B>mbkongsbergpreprocess</B> to gracefully interpolate the
-asynchronous navigation, heading and attitude data onto the survey data and
-to generate data files in the extended format (MBF_EM710MBA = 59). To learn
-which potential sources of navigation, heading and attitude are available, use
-<B>mbinfo</B> with the <B>-N</B> option:
-<BR>    $ mbinfo -I 0000_20111219_154640_METEOR_EM122.all -N
-<P>
-The <B>-N</B> option causes <B>mbinfo</B> to generate a list of the data record
-types read in the file at the end of the file statistics:
-<BR>
-
-<BR>    Swath Data File:      0000_20111219_154640_METEOR_EM122.all
-<BR>    MBIO Data Format ID:  58
-<BR>    Format name:          MBF_EM710RAW
-<BR>    Informal Description: Kongsberg current multibeam vendor format
-<BR>    Attributes:           Kongsberg EM122, EM302, EM710,
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT>  bathymetry, amplitude, and sidescan,<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT>  up to 400 beams, variable pixels, binary, Kongsberg.<BR>
-<P>
-<BR>    Data Totals:
-<BR>    Number of Records:                         334
-<BR>    Bathymetry Data (432 beams):
-<BR>      Number of Beams:           144288
-<BR>      Number of Good Beams:      129951     90.06%
-<BR>      Number of Zero Beams:           0      0.00%
-<BR>      Number of Flagged Beams:    14337      9.94%
-<BR>    Amplitude Data (432 beams):
-<BR>      Number of Beams:           144288
-<BR>      Number of Good Beams:      129951     90.06%
-<BR>      Number of Zero Beams:           0      0.00%
-<BR>      Number of Flagged Beams:    14337      9.94%
-<BR>    Sidescan Data (1024 pixels):
-<BR>      Number of Pixels:          342016
-<BR>      Number of Good Pixels:     289910     84.77%
-<BR>      Number of Zero Pixels:          0      0.00%
-<BR>      Number of Flagged Pixels:   52106     15.23%
-<P>
-<BR>    Navigation Totals:
-<BR>    Total Time:             0.8327 hours
-<BR>    Total Track Length:    13.6418 km
-<BR>    Average Speed:         16.3823 km/hr ( 8.8553 knots)
-<P>
-<BR>    Start of Data:
-<BR>    Time:  12 19 2011 15:46:27.537000  JD353 (2011-12-19T15:46:27.537000)
-<BR>    Lon:   -11.562232000     Lat:    36.848179850     Depth:  4931.4829 meters
-<BR>    Speed: 17.6040 km/hr ( 9.5157 knots)  Heading: 129.1900 degrees
-<BR>    Sonar Depth:    5.6975 m  Sonar Altitude: 5025.2964 m
-<P>
-<BR>    End of Data:
-<BR>    Time:  12 19 2011 16:36:25.308000  JD353 (2011-12-19T16:36:25.308000)
-<BR>    Lon:   -11.489473500     Lat:    36.771997400     Depth:  3242.5244 meters
-<BR>    Speed: 12.7800 km/hr ( 6.9081 knots)  Heading: 274.9200 degrees
-<BR>    Sonar Depth:    6.4334 m  Sonar Altitude: 3236.0911 m
-<P>
-<BR>    Limits:
-<BR>    Minimum Longitude:     -11.635798757   Maximum Longitude:     -11.391532562
-<BR>    Minimum Latitude:       36.723994163   Maximum Latitude:       36.919907119
-<BR>    Minimum Sonar Depth:     5.0135   Maximum Sonar Depth:     6.9798
-<BR>    Minimum Altitude:     3175.1121   Maximum Altitude:     5027.8770
-<BR>    Minimum Depth:        2391.9229   Maximum Depth:        5121.0713
-<BR>    Minimum Amplitude:     -59.2000   Maximum Amplitude:      -9.1000
-<BR>    Minimum Sidescan:      -90.1300   Maximum Sidescan:       -0.4700
-<P>
-<BR>    Data Record Type Notices:
-<BR>    DN: 334 MB_DATA_DATA (ID=1): survey data
-<BR>    DN: 1 MB_DATA_VELOCITY_PROFILE (ID=6): SVP
-<BR>    DN: 1 MB_DATA_START (ID=10): Simrad start datagram
-<BR>    DN: 1 MB_DATA_STOP (ID=11): Simrad stop datagram
-<BR>    DN: 3023 MB_DATA_NAV (ID=12): Navigation record
-<BR>    DN: 287 MB_DATA_RUN_PARAMETER (ID=13): Simrad runtime parameter datagram
-<BR>    DN: 3022 MB_DATA_CLOCK (ID=14): Simrad clock datagram
-<BR>    DN: 2964 MB_DATA_ATTITUDE (ID=18): Attitude record
-<BR>    DN: 731 MB_DATA_SSV (ID=19): Surface sound speed record
-<BR>    DN: 3022 MB_DATA_NAV3 (ID=30): Auxiliary nav system 3
-<BR>    DN: 3023 MB_DATA_STATUS (ID=46): Status record
-<BR>    DN: 2964 MB_DATA_ATTITUDE1 (55): ancillary attitude system 1
-<BR>    DN: 1512 MB_DATA_ATTITUDE2 (56): ancillary attitude system 2
-<P>
-<BR>    Nonfatal Error Notices:
-<BR>    EN: 20551 MB_ERROR_NO_DATA_REQUESTED (ID=-11): No data requested for buffer load
-<P>
-<BR>    Problem Notices:
-<P>
-This listing shows that the format 58 file includes
-MB_DATA_NAV (<I>source</I> = 12) and MB_DATA_NAV3 (<I>source</I> = 30) records,
-both of which include both position and heading data. Also included are three
-sources of attitude data: MB_DATA_ATTITUDE (<I>source</I> = 18),
-MB_DATA_ATTITUDE1 (<I>source</I> = 55), and MB_DATA_ATTITUDE2 (<I>source</I> = 56).
-<P>
-To extract and use the default navigation, heading, and attitude data, the
-following will suffice:
-<BR>    mbkongsbergpreprocess -I datalist_raw.mb-1 -V
-<P>
-An equivalent command that explicitly specifies the default asynchronous data
-sources using <B>-S</B><I>1/source</I> for navigation, <B>-S</B><I>2/source</I> for
-heading, and <B>-S</B><I>3/source</I> for attitude is:
-<BR>    mbkongsbergpreprocess -I datalist_raw.mb-1 -V <B>-S</B><I>1/12</I> <B>-S</B><I>2/12</I> <B>-S</B><I>3/18</I>
-<P>
-To interpolate navigation and heading from the secondary navigation source, use
-<BR>    <B>-S</B><I>1/30</I> <B>-S</B><I>2/30</I>
-<P>
-To interpolate attitude from ancillary attitude system 2, use:
-<BR>    <B>-S</B><I>3/56</I>
-<P>
-<A NAME="lbAI"> </A>
-<H2>SEE ALSO</H2>
-
-<B><A HREF="mbsystem.html">mbsystem</A></B>(1), <B><A HREF="mbformat.html">mbformat</A></B>(1), <B><A HREF="mbinfo.html">mbinfo</A></B>(1)
-<P>
-<A NAME="lbAJ"> </A>
-<H2>BUGS</H2>
-
-Not true bugs. More like arachnids.
-<P>
-
-<HR>
-<A NAME="index"> </A><H2>Index</H2>
-<DL>
-<DT><A HREF="#lbAB">NAME</A><DD>
-<DT><A HREF="#lbAC">VERSION</A><DD>
-<DT><A HREF="#lbAD">SYNOPSIS</A><DD>
-<DT><A HREF="#lbAE">DESCRIPTION</A><DD>
-<DT><A HREF="#lbAF">AUTHORSHIP</A><DD>
-<DT><A HREF="#lbAG">OPTIONS</A><DD>
-<DT><A HREF="#lbAH">EXAMPLES</A><DD>
-<DT><A HREF="#lbAI">SEE ALSO</A><DD>
-<DT><A HREF="#lbAJ">BUGS</A><DD>
-</DL>
-<HR>
-</PRE>
-
-<CENTER><P><BR>
-Last Updated: 12 November 2014</P></CENTER>
-
-<HR>
-<P><A HREF="mbsystem_man_list.html">Return to list of MB-System manual pages...</A></P>
-<P><A HREF="mbsystem_home.html"><IMG SRC="mbsystem_logo_small.gif" BORDER=0 HEIGHT=55 WIDTH=158 ALIGN=BOTTOM></A><A HREF="mbsystem_home.html">Back
-to MB-System Home Page...</A></P>
-
-</BODY>
-</HTML>
diff --git a/src/html/mblevitus.html b/src/html/mblevitus.html
deleted file mode 100644
index f142703..0000000
--- a/src/html/mblevitus.html
+++ /dev/null
@@ -1,300 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<HTML VERSION="2.0">
-<HEAD>
-   <TITLE>MB-System Unix Manual Page: mblevitus</TITLE>
-<!-- WEBMAGIC VERSION NUMBER="2.0.2" -->
-<!-- WEBMAGIC TRANSLATION NAME="ServerRoot" SRC="/var/www/htdocs/" DST="/" -->
-<!-- WEBMAGIC TRANSLATION NAME="ProjectRoot" SRC="./" DST="" -->
-</HEAD>
-<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#336699" VLINK="#997040" ALINK="#CC9900">
-<BODY>
-<CENTER><H3><U>MB-System Unix Manual Page</U></H3></CENTER>
-<PRE>
-<H1>mblevitus</H1>
-Section:  MB-System 5.0  (1)<BR>Updated:  3 June 2013 <BR><A HREF="#index">Index</A>
-<HR>
-
-<A NAME="lbAB"> </A>
-<H2>NAME</H2>
-
-<B>mblevitus</B> - Create a water velocity profile which is representative
-of the mean annual water column for a specified 1 degree by 1 degree
-region.
-<P>
-<A NAME="lbAC"> </A>
-<H2>VERSION</H2>
-
-Version 5.0
-<P>
-<A NAME="lbAD"> </A>
-<H2>SYNOPSIS</H2>
-
-<B>mblevitus</B> [<B>-R</B><I>lon/lat </I><B>-O</B><I>outfile </I><B>-V -H</B>]
-<P>
-<A NAME="lbAE"> </A>
-<H2>DESCRIPTION</H2>
-
-<B>mblevitus</B> generates a mean water sound velocity profile for a 
-specified location using temperature and salinity data
-from the 1982 Climatological Atlas of the World Ocean [Levitus, 1982].
-The water velocity profile is representative of the mean annual
-water column structure for a specified 1 degree by 1 degree region.
-The profile is output to a specified file which can be read and
-used by programs (e.g. <B>mbbath</B> or <B>mbvelocitytool</B>) 
-which calculate swath sonar sonar
-bathymetry from travel times by raytracing through a water velocity
-model.  
-<P>
-The Levitus [1982] reference is:
-<BR>     Levitus, S, Climatological Atlas of the World Ocean, 
-<BR>     NOAA Professional Paper 13, U.S. Government Printing Office, 
-<BR>     Washington D.C., 173pp, 1982.
-<BR>
-
-The water sound velocity values are calculated using
-the DelGrosso equations, following:
-<BR>     Dusha, B. D., P. F. Worcester, B. D. Cornuelle, 
-<BR>       B. M. Howe, "On equations for the speed of 
-<BR>       sound in seawater", J. Acoust. Soc. Am., 93, 
-<BR>       255-275, 1993
-<BR>
-
-The implementation of these equations follows code written
-at the Ocean Data Facility of the Scripps Institution of
-Oceanography.
-The depth to which the Levitus database defines the water
-column reflects regional water depths which may be exceeded in
-places.  <B>mblevitus</B> extends the water sound velocity profiles
-to a depth of 12000 meters using the deepest salinity and
-temperature values available in the database.
-If the specified location is
-subaerial, then no water velocity profile is calculated.
-<P>
-<A NAME="lbAF"> </A>
-<H2>AUTHORSHIP</H2>
-
-David W. Caress (<A HREF="mailto:caress at mbari.org">caress at mbari.org</A>)
-<BR>
-
-<BR>  Monterey Bay Aquarium Research Institute
-<BR>
-
-Dale N. Chayes (<A HREF="mailto:dale at ldeo.columbia.edu">dale at ldeo.columbia.edu</A>)
-<BR>
-
-<BR>  Lamont-Doherty Earth Observatory
-<P>
-<A NAME="lbAG"> </A>
-<H2>OPTIONS</H2>
-
-<DL COMPACT>
-<DT><B>-H</B>
-
-<DD>
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-<DT><B>-O</B>
-
-<DD>
-<I>outfile</I>
-<BR>
-
-Sets the output file for the water velocity profile. 
-Default: <I>outfile</I> = "velocity".
-<DT><B>-R</B>
-
-<DD>
-<I>lon/lat</I>
-<BR>
-
-Sets the longitude and latitude of the location of the water
-velocity profile.  Whole degrees should be used, as the database
-has a 1 degree by 1 degree resolution.
-Default: <I>lon</I>=0, <I>lat</I>=0.
-<DT><B>-V</B>
-
-<DD>
-Normally, <B>mblevitus</B> outputs only a minor bit of information 
-to the stdout stream.  If the
-<B>-V</B> flag is given, then <B>mblevitus</B> works in a "verbose" mode and
-also outputs the program version being used and the complete
-water column structure used to calculate the water velocity profile.
-<P>
-</DL>
-<A NAME="lbAH"> </A>
-<H2>EXAMPLES</H2>
-
-Suppose that one wishes to obtain a mean annual water velocity profile
-for processing Hydrosweep DS bathymetry data collected on the 
-Cocos-Nazca spreading center at 95W longitude and 2N latitude.
-The following will suffice:
-<BR>
-
-<BR> <TT>       </TT>mblevitus -R-95/2 -Ovelocity_profile -V<BR>
-<BR>
-
-The output will be:
-<P>
-<BR> Program MBLEVITUS
-<BR> MB-system Version 4.5
-<P>
-<BR> Location for mean annual water velocity profile:
-<BR>   Requested:  -95.0000 longitude   2.0000 latitude
-<BR>   Used:       265.5000 longitude   2.5000 latitude
-<BR> Values defined directly by Levitus database:      27
-<BR> Values assuming deepest salinity and temperature: 19
-<BR> Velocity points written:                          46
-<BR> Output file: velocity_profile
-<P>
-<BR> Mean annual water column profile:
-<BR>      Depth Temperature Salinity   Velocity
-<BR>     0.0000   25.6560   33.8830   1534.6998
-<BR>    10.0000   25.4080   33.8230   1534.2112
-<BR>    20.0000   24.5410   34.0190   1532.5010
-<BR>    30.0000   23.3290   34.2400   1529.9032
-<BR>    50.0000   19.7940   34.7450   1521.4298
-<BR>    75.0000   15.9700   34.9210   1510.8373
-<BR>   100.0000   14.5630   34.9400   1506.8495
-<BR>   125.0000   13.9500   34.9320   1505.2728
-<BR>   150.0000   13.5920   34.9270   1504.5077
-<BR>   200.0000   13.0430   34.9100   1503.4935
-<BR>   250.0000   12.4510   34.8780   1502.2893
-<BR>   300.0000   11.4720   34.8190   1499.6840
-<BR>   400.0000    9.4060   34.6990   1493.8119
-<BR>   500.0000    8.0400   34.6390   1490.2903
-<BR>   600.0000    7.0330   34.5950   1488.0126
-<BR>   700.0000    6.2200   34.5740   1486.4380
-<BR>   800.0000    5.5640   34.5620   1485.4464
-<BR>   900.0000    5.0280   34.5620   1484.9211
-<BR>  1000.0000    4.5840   34.5650   1484.7546
-<BR>  1100.0000    4.1950   34.5730   1484.8076
-<BR>  1200.0000    3.8570   34.5820   1485.0649
-<BR>  1300.0000    3.5860   34.5970   1485.6061
-<BR>  1400.0000    3.3320   34.6090   1486.2123
-<BR>  1500.0000    3.1020   34.6140   1486.9097
-<BR>  1750.0000    2.6290   34.6280   1489.0920
-<BR>  2000.0000    2.3010   34.6440   1491.9139
-<BR>  2500.0000    1.8770   34.6670   1498.6154
-<BR>  3000.0000    0.0000    0.0000   1507.2345
-<BR>  3500.0000    0.0000    0.0000   1515.9406
-<BR>  4000.0000    0.0000    0.0000   1524.7273
-<BR>  4500.0000    0.0000    0.0000   1533.5883
-<BR>  5000.0000    0.0000    0.0000   1542.5173
-<BR>  5500.0000    0.0000    0.0000   1551.5078
-<BR>  6000.0000    0.0000    0.0000   1560.5533
-<BR>  6500.0000    0.0000    0.0000   1569.6471
-<BR>  7000.0000    0.0000    0.0000   1578.7823
-<BR>  7500.0000    0.0000    0.0000   1587.9523
-<BR>  8000.0000    0.0000    0.0000   1597.1499
-<BR>  8500.0000    0.0000    0.0000   1606.3682
-<BR>  9000.0000    0.0000    0.0000   1615.6001
-<BR>  9500.0000    0.0000    0.0000   1624.8383
-<BR> 10000.0000    0.0000    0.0000   1634.0754
-<BR> 10500.0000    0.0000    0.0000   1643.3042
-<BR> 11000.0000    0.0000    0.0000   1652.5171
-<BR> 11500.0000    0.0000    0.0000   1661.7062
-<BR> 12000.0000    0.0000    0.0000   1670.8641
-<P>
-The contents of the output file velocity_profile are:
-<BR> # Water velocity profile created by program MBLEVITUS 
-<BR> # MB-system Version 4.5
-<BR> # Run by user <caress> on cpu <menard> at <Wed Mar 26 15:43:53 1997>
-<BR> # Water velocity profile derived from Levitus
-<BR> # temperature and salinity database.  This profile
-<BR> # represents the annual average water velocity
-<BR> # structure for a 1 degree X 1 degree area centered
-<BR> # at 265.5000 longitude and 2.5000 latitude.
-<BR> # This water velocity profile is in the form
-<BR> # of discrete (depth, velocity) points where
-<BR> # the depth is in meters and the velocity in
-<BR> # meters/second.
-<BR> # The first 27 velocity values are defined using the
-<BR> # salinity and temperature values available in the
-<BR> # Levitus database; the remaining 19 velocity values are
-<BR> # calculated using the deepest temperature
-<BR> # and salinity value available.
-<BR> 0.000000 1534.699829
-<BR> 10.000000 1534.211182
-<BR> 20.000000 1532.500977
-<BR> 30.000000 1529.903198
-<BR> 50.000000 1521.429810
-<BR> 75.000000 1510.837280
-<BR> 100.000000 1506.849487
-<BR> 125.000000 1505.272827
-<BR> 150.000000 1504.507690
-<BR> 200.000000 1503.493530
-<BR> 250.000000 1502.289307
-<BR> 300.000000 1499.683960
-<BR> 400.000000 1493.811890
-<BR> 500.000000 1490.290283
-<BR> 600.000000 1488.012573
-<BR> 700.000000 1486.437988
-<BR> 800.000000 1485.446411
-<BR> 900.000000 1484.921143
-<BR> 1000.000000 1484.754639
-<BR> 1100.000000 1484.807617
-<BR> 1200.000000 1485.064941
-<BR> 1300.000000 1485.606079
-<BR> 1400.000000 1486.212280
-<BR> 1500.000000 1486.909668
-<BR> 1750.000000 1489.092041
-<BR> 2000.000000 1491.913940
-<BR> 2500.000000 1498.615356
-<BR> 3000.000000 1507.234497
-<BR> 3500.000000 1515.940552
-<BR> 4000.000000 1524.727295
-<BR> 4500.000000 1533.588257
-<BR> 5000.000000 1542.517334
-<BR> 5500.000000 1551.507812
-<BR> 6000.000000 1560.553345
-<BR> 6500.000000 1569.647095
-<BR> 7000.000000 1578.782349
-<BR> 7500.000000 1587.952271
-<BR> 8000.000000 1597.149902
-<BR> 8500.000000 1606.368164
-<BR> 9000.000000 1615.600098
-<BR> 9500.000000 1624.838257
-<BR> 10000.000000 1634.075439
-<BR> 10500.000000 1643.304199
-<BR> 11000.000000 1652.517090
-<BR> 11500.000000 1661.706177
-<BR> 12000.000000 1670.864136
-<P>
-<A NAME="lbAI"> </A>
-<H2>SEE ALSO</H2>
-
-<B><A HREF="mbsystem.html">mbsystem</A></B>(1), <B><A HREF="mbvelocitytool.html">mbvelocitytool</A></B>(1), <B><A HREF="mbprocess.html">mbprocess</A></B>(1), <B><A HREF="mbset.html">mbset</A></B>(1), 
-<B><A HREF="mbm_xbt.html">mbm_xbt</A></B>(1)
-<P>
-<A NAME="lbAJ"> </A>
-<H2>BUGS</H2>
-
-None known.
-<P>
-
-<HR>
-<A NAME="index"> </A><H2>Index</H2>
-<DL>
-<DT><A HREF="#lbAB">NAME</A><DD>
-<DT><A HREF="#lbAC">VERSION</A><DD>
-<DT><A HREF="#lbAD">SYNOPSIS</A><DD>
-<DT><A HREF="#lbAE">DESCRIPTION</A><DD>
-<DT><A HREF="#lbAF">AUTHORSHIP</A><DD>
-<DT><A HREF="#lbAG">OPTIONS</A><DD>
-<DT><A HREF="#lbAH">EXAMPLES</A><DD>
-<DT><A HREF="#lbAI">SEE ALSO</A><DD>
-<DT><A HREF="#lbAJ">BUGS</A><DD>
-</DL>
-<HR>
-</PRE>
-
-<CENTER><P><BR>
-Last Updated: 3 June 2013</P></CENTER>
-
-<HR>
-<P><A HREF="mbsystem_man_list.html">Return to list of MB-System manual pages...</A></P>
-<P><A HREF="mbsystem_home.html"><IMG SRC="mbsystem_logo_small.gif" BORDER=0 HEIGHT=55 WIDTH=158 ALIGN=BOTTOM></A><A HREF="mbsystem_home.html">Back
-to MB-System Home Page...</A></P>
-
-</BODY>
-</HTML>
diff --git a/src/html/mblist.html b/src/html/mblist.html
deleted file mode 100644
index 7c74b2b..0000000
--- a/src/html/mblist.html
+++ /dev/null
@@ -1,846 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<HTML VERSION="2.0">
-<HEAD>
-   <TITLE>MB-System Unix Manual Page: mblist</TITLE>
-<!-- WEBMAGIC VERSION NUMBER="2.0.2" -->
-<!-- WEBMAGIC TRANSLATION NAME="ServerRoot" SRC="/var/www/htdocs/" DST="/" -->
-<!-- WEBMAGIC TRANSLATION NAME="ProjectRoot" SRC="./" DST="" -->
-</HEAD>
-<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#336699" VLINK="#997040" ALINK="#CC9900">
-<BODY>
-<CENTER><H3><U>MB-System Unix Manual Page</U></H3></CENTER>
-<PRE>
-<H1>mblist</H1>
-Section:  MB-System 5.0  (1)<BR>Updated:  17 May 2014 <BR><A HREF="#index">Index</A>
-<HR>
-
-<A NAME="lbAB"> </A>
-<H2>NAME</H2>
-
-<B>mblist</B> - List data in swath data files.
-<P>
-<A NAME="lbAC"> </A>
-<H2>VERSION</H2>
-
-Version 5.0
-<P>
-<A NAME="lbAD"> </A>
-<H2>SYNOPSIS</H2>
-
-<B>mblist</B> [<B>-A</B> <B>-B</B><I>yr/mo/da/hr/mn/sc</I>
-<B>-C</B>
-<B>-D</B><I>dumpmode</I>
-<B>-E</B><I>yr/mo/da/hr/mn/sc</I> <B>-F</B><I>format</I> <B>-G</B><I>delimiter</I>
-<B>-H</B> <B>-I</B><I>infilename</I> <B>-K</B><I>decimate</I>
-<B>-L</B><I>lonflip</I> <B>-M</B>[<I>start_beam/end_beam</I> | <B>A</B> | <B>X</B><I>percentage</I>]
-<B>-N</B><I>start_pixel/end_pixel</I>
-<B>-O</B><I>output_format</I> <B>-P</B><I>pings</I> <B>-Q</B>
-<B>-R</B><I>west/east/south/north</I>
-<B>-S</B><I>speed</I> <B>-T</B><I>timegap</I>
-<B>-U</B><I>check</I> <B>-V</B> <B>-W</B>
-<B>-X</B><I>outfile</I>
-<B>-Z</B><I>segment</I>]
-<P>
-<A NAME="lbAE"> </A>
-<H2>DESCRIPTION</H2>
-
-<B>mblist</B> is a utility to list the contents of a swath
-data file or files to stdout. By default, <B>mblist</B>
-produces ASCII files in
-spreadsheet style, with data columns separated by tabs. Alternatively,
-other column delimiters can be used (<B>-G</B> option), or
-the output can be binary, with each field represented
-as a double precision float (<B>-A</B> option).
-Output can also be in netCDF CDL (<B>-C</B> option) format,
-or as a binary netCDF file (<B>-C -A</B>).
-The output of
-<B>mblist</B> can be piped to plotting and data analysis programs. The
-option <B>-O</B><I>output_format</I> can be
-used to control the data types that
-are sent to stdout. The default is to output a single record for
-each survey ping, and for any output navigation values to reflect
-the sonar or ship navigation. In this mode, any output depth,
-amplitude, or sidescan values are derived from the beam and pixel
-located closest to the navigation (the most vertical position under
-the sonar). If the <B>-M</B> or <B>-N</B> options
-are used to set specific ranges of beams or pixels to be used,
-then records are output for each of the specified beams or
-pixels and any navigation, depth or sidescan values output reflect
-the positions and values of the specified beams or pixels.
-The data input may be averaged or windowed in time
-and space before it is listed.  Complete dumps of bathymetry,
-amplitude, or sidescan data are possible as well.
-<P>
-<A NAME="lbAF"> </A>
-<H2>AUTHORSHIP</H2>
-
-David W. Caress (<A HREF="mailto:caress at mbari.org">caress at mbari.org</A>)
-<BR>
-
-<BR>  Monterey Bay Aquarium Research Institute
-<BR>
-
-Dale N. Chayes (<A HREF="mailto:dale at ldeo.columbia.edu">dale at ldeo.columbia.edu</A>)
-<BR>
-
-<BR>  Lamont-Doherty Earth Observatory
-<BR>
-
-Alberto Malinverno
-<BR>
-
-<BR>  Schlumberger-Doll
-<P>
-<A NAME="lbAG"> </A>
-<H2>OPTIONS</H2>
-
-<DL COMPACT>
-<DT><B>-A</B>
-
-<DD>
-<BR>
-
-Causes the output to be binary (native double precision floating
-point) rather than ASCII. Some
-output options cannot be represented as single binary floats (e.g.
-time strings and longitude or latitude broken into degrees
-and minutes. These values are output as multiple fields as
-appropriate.
-Default: ASCII output with fields separated by tabs, or by another
-delimiter specified with the <B>-G</B> option.
-<DT><B>-B</B>
-
-<DD>
-<I>yr/mo/da/hr/mn/sc</I>
-<BR>
-
-This option sets the starting time for data allowed in the input data.
-The <B>-E</B> option sets the ending time for data. If the
-starting time is before the ending time, then any data
-with a time stamp before the starting time or after the
-ending time is ignored. If instead the starting time is
-after the ending time, then any data between the ending
-and starting time will be ignored. This scheme allows time
-windowing both inside and outside a specified interval.
-Default: <I>yr/mo/da/hr/mn/sc</I> = 1962/2/21/10/30/0.
-<DT><B>-C</B>
-
-<DD>
-<BR>
-
-Causes netCDF CDL format output to be generated (see <B>ncgen</B>).
-When the <B>-A</B> (binary) option is also set <B>mblist</B> will call <B>ncgen</B> to
-convert the CDL file to a binary netCDF file (default name is <I>mblist.nc</I>),
-if successful the CDL file will be removed.
-<DT><B>-D</B>
-
-<DD>
-<I>dumpmode</I>
-<BR>
-
-Normally, the output format is controlled by the <B>-O</B> option and
-the number of beams or pixels which are output is controlled by
-the <B>-M</B> and <B>-N</B> options.  The <B>-D</B> option provides
-a short cut for producing complete dumps of the longtitude and
-latitude locations of all beams or pixels along with the
-associated bathymetry, topography, amplitude, or sidescan values.
-The "lon lat value" triples are often useful for input into
-gridding programs (e.g. the <B>GMT</B> program <B>surface</B>) or
-other utilities. All valid (positive) values will be output, unless
-the <B>-Q</B> option is used to disable value checking.
-The <I>dumpmode</I> options are:
-<DT><DD>
-<I>dumpmode</I> = 1:  format controlled by <B>-O</B> option
-<DT><DD>
-<I>dumpmode</I> = 2:  longitude latitude depth
-<DT><DD>
-<I>dumpmode</I> = 3:  longitude latitude topography
-<DT><DD>
-<I>dumpmode</I> = 4:  longitude latitude amplitude
-<DT><DD>
-<I>dumpmode</I> = 5:  longitude latitude sidescan
-<BR>
-
-Use of the <B>-D</B> option supercedes the <B>-O</B>, <B>-M</B>,
-and <B>-N</B> options.
-Default: <I>mode</I> = 1.
-<DT><B>-E</B>
-
-<DD>
-<I>yr/mo/da/hr/mn/sc</I>
-<BR>
-
-This option sets the ending time for data allowed in the input data.
-The <B>-B</B> option sets the starting time for data. If the
-starting time is before the ending time, then any data
-with a time stamp before the starting time or after the
-ending time is ignored. If instead the starting time is
-after the ending time, then any data between the ending
-and starting time will be ignored. This scheme allows time
-windowing both inside and outside a specified interval.
-Default: <I>yr/mo/da/hr/mn/sc</I> = 2062/2/21/10/30/0.
-<DT><B>-F</B>
-
-<DD>
-<I>format</I>
-<BR>
-
-Sets the format for the input swath data using
-<B>MBIO</B> integer format identifiers.
-This program uses the <B>MBIO</B> library and will read any swath
-format supported by <B>MBIO</B>. A list of the swath data formats
-currently supported by <B>MBIO</B> and their identifier values
-is given in the <B>MBIO</B> manual page. Default: <I>format</I> = 11.
-<DT><B>-G</B>
-
-<DD>
-<I>delimiter</I>
-<BR>
-
-Sets the character(s) used to separate output fields when ascii
-columns are output. Default: tabs are used as delimiters.
-<DT><B>-H</B>
-
-<DD>
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-<DT><B>-I</B>
-
-<DD>
-<I>filename</I>
-<BR>
-
-Sets the input filename. If <I>format</I> > 0 (set with the
-<B>-F</B> option) then the swath data contained in <I>infile</I>
-is read and processed. If <I>format</I> < 0, then <I>infile</I>
-is assumed to be an ascii file containing a list of the input swath
-data files to be processed and their formats.  The program will read
-the data in each one of these files.
-In the <I>infile</I> file, each
-data file should be followed by a data format identifier, e.g.:
-<BR> <TT>       </TT>datafile1 11<BR>
-<BR> <TT>       </TT>datafile2 24<BR>
-<BR>
-
-This program uses the <B>MBIO</B> library and will read any swath
-format supported by <B>MBIO</B>. A list of the swath data formats
-currently supported by <B>MBIO</B> and their identifier values
-is given in the <B>MBIO</B> manual page.
-Default: <I>infile</I> = "datalist.mb-1".
-<DT><B>-K</B>
-
-<DD>
-<I>decimate</I>
-<BR>
-
-Sets the decimation of the output data. By default (i.e. <I>decimate</I>=1),
-every available data record is output. If <I>decimate</I>>1, then only
-every "<I>decimate</I>"th record will be output. Default: <I>decimate</I>=1.
-<DT><B>-L</B>
-
-<DD>
-<I>lonflip</I>
-<BR>
-
-Sets the range of the longitude values returned.
-If <I>lonflip</I>=-1 then the longitude values will be in
-the range from -360 to 0 degrees. If <I>lonflip</I>=0
-then the longitude values will be in
-the range from -180 to 180 degrees. If <I>lonflip</I>=1
-then the longitude values will be in
-the range from 0 to 360 degrees.
-Default: <I>lonflip</I> = 0.
-<DT><B>-M</B>
-
-<DD>
-<I>start_beam/end_beam</I> or <B>A</B> or <B>X</B><I>excludepercent</I>
-<BR>
-
-Determines the range of bathymetry beams for which records will be output.
-If this option is used, then any longitude and latitude values output
-will reflect the positions of individual beams on the seafloor.
-If <B>-MA</B> is given, then a record
-will be output for each valid beam. If <I>start_beam/end_beam</I>
-is specified, then records will be output only for beams in this
-range. Beam numbers start with zero on the port side.
-If <B>-MX</B><I>excludepercent</I> is given, then records will be output
-for each valid, non-excluded beam where the outer <I>excludepercent</I>
-percentage of beams are excluded.
-The default is to output a single record for each ping
-in which longitude and latitude values reflect
-the sonar navigation, the depth,
-topography, and amplitude values reflect the valid beam
-nearest to vertical, and the sidescan value reflects the pixel
-nearest to vertical.
-<DT><B>-N</B>
-
-<DD>
-<I>start_pixel/end_pixel</I> or <I>A</I>
-<BR>
-
-Determines the range of sidescan pixels for which records will be output.
-If <I>start_pixel/end_pixel</I>
-is specified, then records will be output only for pixels in this
-range. Pixel numbers start with zero on the port side. The default is
-to not output records associated with sidescan pixels. Instead,
-the default is to output a single record for each ping
-in which longitude and latitude values reflect
-the sonar navigation, the depth,
-topography, and amplitude values reflect the valid beam
-nearest to vertical, and the sidescan value reflects the pixel
-nearest to vertical. If <B>-N</B><I>A</I> is given, then a record
-will be output for all sidescan pixels.
-<DT><B>-O</B>
-
-<DD>
-<I>output_format</I>
-<BR>
-
-Determines the form of the output. <I>Output_format</I> is a string composed
-of one or more of the following characters:
-<DT><DD>
-<B>/</B>
-special character: this causes the value
-indicated by the next character to be  inverted. This applies only to simple
-numeric values such as depth and
-heading and not to values like time
-strings or positions with hemisphere
-characters.
-<DT><DD>
-<B>-</B>
-special character: this causes the value
-indicated by the next character to be
-multiplied by -1. This applies only
-to simple numeric values such as
-depth and heading and not to values
-like time strings or positions with
-hemisphere characters.
-<DT><DD>
-<B>=</B>
-special character: this causes the value
-indicated by the next character to
-derive from the port-most non-null
-beam or pixel. This applies only
-to numeric values associated with
-beams or pixels such as depth, longitude,
-or latitude.
-<DT><DD>
-<B>+</B>
-special character: this causes the value
-indicated by the next character to
-derive from the starboard-most non-null
-beam or pixel. This applies only
-to numeric values associated with
-beams or pixels such as depth, longitude,
-or latitude.
-<DT><DD>
-<B>A</B>
-for apparent seafloor crosstrack slope
-(degrees from horizontal with positive
-slopes dipping toward port.) Calculated
-by fitting a line to the the
-bathymetry data of each ping.
-<DT><DD>
-<B>a</B>
-for apparent seafloor crosstrack slope
-(degrees from horizontal with positive
-slopes dipping toward port.) Calculated
-by interpolation for each beam or pixel.
-<DT><DD>
-<B>B</B>
-for amplitude
-<DT><DD>
-<B>b</B>
-for sidescan
-<DT><DD>
-<B>C</B>
-for sonar altitude above the bottom (m)
-<DT><DD>
-<B>c</B>
-for sonar tranducer depth (m)
-<DT><DD>
-<B>D</B>
-for bathymetry acrosstrack distance (m)
-<DT><DD>
-<B>d</B>
-for sidescan acrosstrack distance (m)
-<DT><DD>
-<B>E</B>
-for bathymetry alongtrack distance (m)
-<DT><DD>
-<B>e</B>
-for sidescan alongtrack distance (m)
-<DT><DD>
-<B>F</B>
-for beamflag numeric value (1=null, 0=good, 5=manual, 9=filter, 129=sonar).
-<DT><DD>
-<B>f</B>
-for beamflag character value ('-'=null, 'G'=good, 'M'=manual, 'F'=filter, 'S'=sonar).
-<DT><DD>
-<B>G</B>
-for flat bottom grazing angle (degrees)
-<DT><DD>
-<B>g</B>
-for grazing angle using seafloor slope (degrees)
-<DT><DD>
-<B>H</B>
-for heading (degrees)
-<DT><DD>
-<B>h</B>
-for course made good (degrees)
-<DT><DD>
-<B>J</B>
-for a time string (yyyy jd hh mm ss.ssssss)
-where jd is the day of the year
-<DT><DD>
-<B>j</B>
-for a time string (yyyy jd dm ss.ssssss)
-where jd is the day of the year
-and dm is the minute of the day
-<DT><DD>
-<B>L</B>
-for cumulative along-track distance (km)
-<DT><DD>
-<B>l</B>
-for cumulative along-track distance (m)
-<DT><DD>
-<B>M</B>
-for unix (epoch) time in decimal seconds since 1/1/70 00:00:00
-<DT><DD>
-<B>m</B>
-for time in decimal seconds since first record
-<DT><DD>
-<B>N</B>
-for ping count
-<DT><DD>
-<B>P</B>  for pitch in degrees
-<DT><DD>
-<B>p</B>  for draft in meters
-<DT><DD>
-<B>Q</B>  for bottom detection type as letter (A=amplitude, P=phase, U=unknown)
-<DT><DD>
-<B>q</B>  for bottom detection type as number (1=amplitude, 2=phase, 0=unknown)
-<DT><DD>
-<B>R</B>  for roll in degrees
-<DT><DD>
-<B>r</B>  for heave in meters
-<DT><DD>
-<B>S</B>  for speed (km/hr)
-<DT><DD>
-<B>s</B>  for speed made good (km/hr)
-<DT><DD>
-<B>T</B>  for a time string (yyyy/mm/dd/hh/mm/ss)
-<DT><DD>
-<B>t</B>  for a time string (yyyy mm dd hh mm ss)
-<DT><DD>
-<B>U</B>  for unix time in integer seconds since 1/1/70 00:00:00
-<DT><DD>
-<B>u</B>  for time in integer seconds since first record
-<DT><DD>
-<B>V</B>  for ping interval (decimal seconds)
-<DT><DD>
-<B>X</B>  for longitude (decimal degrees)
-<DT><DD>
-<B>x</B>  for longitude (degrees + decimal minutes + E/W)
-<DT><DD>
-<B>Y</B>  for latitude (decimal degrees)
-<DT><DD>
-<B>y</B>  for latitude (degrees + decimal minutes + N/S)
-<DT><DD>
-<B>Z</B>  for topography (positive upwards) (m)
-<DT><DD>
-<B>z</B>  for depth (positive downwards) (m)
-<DT><DD>
-<B>#</B>  for beam or pixel number
-<DT><DD>
-<B> .</B>
-special character: this causes the next character to be
-interpretted from the following list rather than the above list.
-These allow access to raw values in format specific form and may
-not be supported by all formats.
-<DT><DD>
-<B> .A</B>  Amplitude (backscatter) in dB (formats 56 & 67 - Simrad multibeam only)
-<DT><DD>
-<B> .a</B>  Mean absorption coefficient in dB/km (formats 56 & 67 - Simrad multibeam some versions only)
-<DT><DD>
-<B> .B</B>  Normal incidence backscatter in dB (formats 56 & 67 - Simrad multibeam only)
-<DT><DD>
-<B> .b</B>  Oblique backscatter in dB (formats 56 & 67 - Simrad multibeam only)
-<DT><DD>
-<B> .c</B>  Mean backscatter, one value per ping (formats 56 & 67 - Simrad multibeam only)
-<DT><DD>
-<B> .d</B>  Beam depression angle (formats 56 & 67 - Simrad multibeam only)
-<DT><DD>
-<B> .F</B>  Filename
-<DT><DD>
-<B> .f</B>  File format
-<DT><DD>
-<B> .G</B>  Start of TVG ramp in samples (formats 56 & 67 - Simrad multibeam only)
-<DT><DD>
-<B> .g</B>  Stop of TVG ramp in samples (formats 56 & 67 - Simrad multibeam only)
-<DT><DD>
-<B> .L</B>  Transmit pulse length (usec) (formats 56 & 67 - Simrad multibeam only)
-<DT><DD>
-<B> .l</B>  Transmit pulse length (sec)
-<DT><DD>
-<B> .M</B>  Sounder mode (formats 56 & 67 - Simrad multibeam only)
-<DT><DD>
-<B> .N</B>  Ping number according to sounder (formats 56 & 67 - Simrad multibeam only)
-<DT><DD>
-<B> .p</B>  Raw sidescan pixels in dB (formats 56 & 67 - Simrad multibeam only).
-May be preceded by a number to give the first n pixels (NaN padded) of the beam,
-for example<B> .30p</B> will give the first 30 sidescan pixels of each beam.
-<DT><DD>
-<B> .R</B>  Range in samples (formats 56 & 67 - Simrad multibeam only)
-<DT><DD>
-<B> .r</B>  Sampling rate in Hz (formats 56 & 67 - Simrad multibeam only)
-<DT><DD>
-<B> .S</B>  Number of raw sidescan pixels per ping (formats 56 & 67 - Simrad multibeam only)
-<DT><DD>
-<B> .s</B>  Number of raw sidescan pixels per beam (formats 56 & 67 - Simrad multibeam only)
-<DT><DD>
-<B> .T</B>  Transmit gain (dB)
-<DT><DD>
-<B> .t</B>  Receive gain (dB)
-<P>
-<BR>
-
-Default <I>output_format</I> = <B>YXLZ</B> (latitude, longitude, cumulative
-along-track distance, and depth).
-<DT><B>-P</B>
-
-<DD>
-<I>pings</I>
-<BR>
-
-Sets the ping averaging of the input data. If <I>pings</I> = 1, then
-no ping averaging is performed. If <I>pings</I> > 0, then
-that number of input pings will be averaged to produce one output
-ping.  If <I>pings</I> = 0, then the ping averaging will automatically
-be done so that the along-track ping spacing is equal to the across-track
-beam spacing.
-Default: <I>pings</I> = 1 (no ping averaging).
-<DT><B>-Q</B>
-
-<DD>
-Disables value checking for validity (only positive bathymetry,
-amplitude, and sidescan values are valid).  This allows dumps
-of all of the data, including null or flagged beams and pixels.
-The flagged values are output without change. Null values are
-output as zero. This option is equivalent to <B>-U</B><I>2</I>.
-<DT><B>-R</B>
-
-<DD>
-<I>west/east/south/north</I>
-<BR>
-
-Sets the longitude and latitude bounds within which swath
-data will be read. Only the data which lies within these bounds will
-be read.
-Default: <I>west</I>=-360, east<I>=360</I>, <I>south</I>=-90, <I>north</I>=90.
-<DT><B>-S</B>
-
-<DD>
-<I>speed</I>
-<BR>
-
-Sets the minimum speed in km/hr (5.5 kts ~ 10 km/hr) allowed in
-the input data; pings associated with a smaller ship speed will not be
-copied. Default: <I>speed</I> = 0.
-<DT><B>-T</B>
-
-<DD>
-<I>timegap</I>
-<BR>
-
-Sets the maximum time gap in minutes between adjacent pings allowed before
-the data is considered to have a gap. Default: <I>timegap</I> = 1.
-<DT><B>-U</B>
-
-<DD>
-<I>check</I>
-<BR>
-
-Sets the manner in which <B>mblist</B> handles flagged and null
-bathymetry, amplitude, and sidescan values. By default, <B>mblist</B>
-omits lines of output if they contain flagged or null values. This
-default corresponds to <I>check</I> = 0.
-If <I>check</I> = 1, then flagged values will be output
-unchanged and null values will be ignored.
-If <I>check</I> = 2,
-then flagged values will be output unchanged and null values
-will be output as zero (This corresponds to the <B>-Q</B> option).
-If <I>check</I> = 3, then flagged values will be output unchanged
-and null values will be output as "NaN".
-If <I>check</I> = 4, then flagged values and null values
-will be output as "NaN".
-<DT><B>-V</B>
-
-<DD>
-Normally, <B>mblist</B> works "silently" without outputting
-anything to the stderr stream.  If the
-<B>-V</B> flag is given, then <B>mblist</B> works in a "verbose" mode and
-outputs the program version being used and all error status messages.
-<DT><B>-W</B>
-
-<DD>
-Normally, <B>mblist</B> outputs bathymetry and across and along
-track distances in meters.  If the
-<B>-W</B> flag is given, then <B>mblist</B> outputs these values
-in feet.
-<DT><B>-X</B>
-
-<DD>
-<I>outfile</I>
-<BR>
-
-Normally, <B>mblist</B> outputs to stdout.
-If the <B>-X</B> flag is given, then <B>mblist</B> creates a new file
-<I>outfile</I> and outputs to it.
-An output file must be specified if a netCDF file (<B>-C -A</B>) is required.
-<DT><B>-Z</B>
-
-<DD>
-<I>segment</I>
-<BR>
-
-Causes the ascii output of different input swath files
-(e.g. when a datalist is specified with the <B>-I</B> option)
-to be separated by lines with <I>segment</I>. If <I>segment</I>
-is a single character, then the output is a multiple segment
-file of the sort accepted by the <B>GMT</B> program <B>psxy</B>.
-This option only works with ascii output, and is thus disabled
-when the <B>-A</B> option is specified. The most common usage
-is <B>-Z</B>I>.
-<P>
-</DL>
-<A NAME="lbAH"> </A>
-<H2>EXAMPLES</H2>
-
-Suppose one wishes to obtain a centerbeam profile
-from a raw Hydrosweep file
-(format 21) in a region between 105W and 103W
-longitude and between 10S and 8S latitude. The following will suffice:
-<P>
-<TT>        </TT>mblist -Iinfile.mb21 -F21 -R-105/-103/-10/-8 -OLz<BR>
-<P>
-The output will be as follows:
-<P>
-<BR> <TT>       </TT>0.000  4378<BR>
-<BR> <TT>       </TT>0.085  4370<BR>
-<BR> <TT>       </TT>0.166  4370<BR>
-<BR> <TT>       </TT>0.247  4351<BR>
-<BR> <TT>       </TT>0.330  4353<BR>
-<BR> <TT>       </TT>0.407  4337<BR>
-<BR> <TT>       </TT>0.492  4334<BR>
-<BR> <TT>       </TT>0.571  4323<BR>
-<BR> <TT>       </TT>0.651  4316<BR>
-<BR> <TT>       </TT>0.737  4307<BR>
-<BR> <TT>       </TT>.....<BR>
-<P>
-Here the depth values will correspond to the beam in each
-ping which is located closest to vertical under the ship.
-<P>
-Suppose one wishes instead to obtain time, heading and speed data
-in the same file from 8AM to 9AM on August 10 1991. The following
-is appropriate:
-<P>
-<BR> <TT>       </TT>mblist -Iinfile.mb21 -F21 -B1991/8/10/8/0/0<BR>
-<BR> <TT>       </TT>-E1991/8/10/9/0/0 -OTHS<BR>
-<P>
-The output will be as follows:
-<P>
-<BR> <TT>       </TT>1991/08/10/08/00/05     283.9   41.29<BR>
-<BR> <TT>       </TT>1991/08/10/08/00/19     283.4   20.36<BR>
-<BR> <TT>       </TT>1991/08/10/08/00/33     285.1   20.36<BR>
-<BR> <TT>       </TT>1991/08/10/08/00/48     286.7   20.09<BR>
-<BR> <TT>       </TT>1991/08/10/08/01/02     284.9   20.08<BR>
-<BR> <TT>       </TT>1991/08/10/08/01/16     285.2   20.02<BR>
-<BR> <TT>       </TT>1991/08/10/08/01/44     284.2   20.20<BR>
-<BR> <TT>       </TT>1991/08/10/08/02/12     283.7   20.50<BR>
-<BR> <TT>       </TT>1991/08/10/08/02/41     283.6   20.75<BR>
-<BR> <TT>       </TT>1991/08/10/08/03/09     285.1   21.19<BR>
-<BR> <TT>       </TT>.....<BR>
-<P>
-Suppose one wishes a data series with along-track distance,
-topography and across-track distance of beam number 15 for the same file
-and time limits as above:
-<P>
-<BR> <TT>       </TT>mblist -Iinfile.mb21 -F21 -B1991/8/10/7/0/0<BR>
-<BR> <TT>       </TT>-E1991/8/10/9/0/0 -OLZD -M15/15<BR>
-<P>
-The output will be as follows:
-<P>
-<BR> <TT>       </TT>  0.000  4510   -1704<BR>
-<BR> <TT>       </TT>  0.172  4494   -1692<BR>
-<BR> <TT>       </TT>  0.260  4486   -1689<BR>
-<BR> <TT>       </TT>  0.343  4471   -1683<BR>
-<BR> <TT>       </TT>  0.427  4491   -1691<BR>
-<BR> <TT>       </TT>  0.506  4490   -1690<BR>
-<BR> <TT>       </TT>  0.591  4478   -1686<BR>
-<BR> <TT>       </TT>  0.676  4505   -1697<BR>
-<BR> <TT>       </TT>  0.763  4488   -1695<BR>
-<BR> <TT>       </TT>  0.849  4495   -1699<BR>
-<BR> <TT>       </TT>  .....<BR>
-<P>
-Supppose one wishes to obtain longitude, latitude, and
-depth at the centerbeam as x-y-z data for the same region as in the
-first example:
-<P>
-<BR> <TT>       </TT>mblist -Iinfile.mb21 -F21 -R-105/-103/-10/-8 -OXYz<BR>
-<P>
-The output will be as follows:
-<P>
-<BR> <TT>       </TT>-103.000236      -9.577439       4378<BR>
-<BR> <TT>       </TT>-103.000943      -9.577229       4370<BR>
-<BR> <TT>       </TT>-103.001651      -9.577020       4370<BR>
-<BR> <TT>       </TT>-103.002372      -9.576794       4351<BR>
-<BR> <TT>       </TT>-103.003041      -9.576584       4353<BR>
-<BR> <TT>       </TT>-103.003771      -9.576338       4337<BR>
-<BR> <TT>       </TT>-103.004456      -9.576105       4334<BR>
-<BR> <TT>       </TT>-103.005153      -9.575895       4323<BR>
-<BR> <TT>       </TT>-103.005903      -9.575679       4316<BR>
-<BR> <TT>       </TT>-103.006586      -9.575449       4307<BR>
-<BR> <TT>       </TT>.....<BR>
-<P>
-Suppose one wishes to obtain a dump of longitude, latitude, and
-depth for all good beams in a Hydrosweep data file. There are two ways to
-obtain this output. One can explicitly specify the output format as
-<B>-O</B><I>XYz</I> and the output beams as <B>-M</B><I>0/58</I>:
-<P>
-<BR> <TT>       </TT>mblist -Iinfile.mb21 -F21 -OXYz -M0/58<BR>
-<P>
-or one can use the equivalent <B>-D</B><I>2</I> shortcut:
-<P>
-<TT>        </TT>mblist -Iinfile.mb21 -F21 -D2<BR>
-<P>
-Either way, the output is as follows:
-<P>
-<BR> <TT>       </TT>-49.296454<TT>      </TT>  12.180552<TT>     </TT>  4866<BR>
-<BR> <TT>       </TT>-49.296695<TT>      </TT>  12.178668<TT>     </TT>  4858<BR>
-<BR> <TT>       </TT>-49.296923<TT>      </TT>  12.176893<TT>     </TT>  4855<BR>
-<BR> <TT>       </TT>-49.297123<TT>      </TT>  12.175341<TT>     </TT>  4877<BR>
-<BR> <TT>       </TT>-49.297319<TT>      </TT>  12.173808<TT>     </TT>  4895<BR>
-<BR> <TT>       </TT>-49.297536<TT>      </TT>  12.172122<TT>     </TT>  4879<BR>
-<BR> <TT>       </TT>-49.297744<TT>      </TT>  12.170498<TT>     </TT>  4865<BR>
-<BR> <TT>       </TT>-49.297909<TT>      </TT>  12.169216<TT>     </TT>  4904<BR>
-<BR> <TT>       </TT>-49.298100<TT>      </TT>  12.167727<TT>     </TT>  4899<BR>
-<BR> <TT>       </TT>-49.298299<TT>      </TT>  12.166175<TT>     </TT>  4871<BR>
-<BR> <TT>       </TT>-49.298476<TT>      </TT>  12.164803<TT>     </TT>  4873<BR>
-<BR> <TT>       </TT>-49.298639<TT>      </TT>  12.163530<TT>     </TT>  4891<BR>
-<BR> <TT>       </TT>.....<BR>
-<P>
-Suppose one wishes to obtain a dump of longitude, latitude, and
-depth for all beams, valid or not, in a Hydrosweep data file.
-The approach is the same as the preceding example, except that
-the <B>-Q</B> option is used to disable validity checking of
-beam values. One can explicitly specify the output format as
-<B>-O</B><I>XYz</I> and the output beams as <B>-M</B><I>0/58</I>:
-<P>
-<BR> <TT>       </TT>mblist -Iinfile.mb21 -F21 -OXYz -M0/58 -Q<BR>
-<P>
-or one can use the equivalent <B>-D</B><I>2</I> shortcut:
-<P>
-<TT>        </TT>mblist -Iinfile.mb21 -F21 -D2 -Q<BR>
-<P>
-Either way, the output includes both zero beams (no data) and
-beams with negative depths (flagged as bad data):
-<P>
-<BR> <TT>       </TT>-49.301094<TT>      </TT>  12.144409<TT>     </TT>     0<BR>
-<BR> <TT>       </TT>-49.301094<TT>      </TT>  12.144409<TT>     </TT>     0<BR>
-<BR> <TT>       </TT>-49.296454<TT>      </TT>  12.180552<TT>     </TT>  4866<BR>
-<BR> <TT>       </TT>-49.296695<TT>      </TT>  12.178668<TT>     </TT>  4858<BR>
-<BR> <TT>       </TT>-49.296923<TT>      </TT>  12.176893<TT>     </TT>  4855<BR>
-<BR> <TT>       </TT>-49.297123<TT>      </TT>  12.175341<TT>     </TT>  4877<BR>
-<BR> <TT>       </TT>-49.297319<TT>      </TT>  12.173808<TT>     </TT>  4895<BR>
-<BR> <TT>       </TT>-49.297536<TT>      </TT>  12.172122<TT>     </TT>  4879<BR>
-<BR> <TT>       </TT>-49.297744<TT>      </TT>  12.170498<TT>     </TT>  4865<BR>
-<BR> <TT>       </TT>-49.297909<TT>      </TT>  12.169216<TT>     </TT>  4904<BR>
-<BR> <TT>       </TT>-49.298100<TT>      </TT>  12.167727<TT>     </TT>  4899<BR>
-<BR> <TT>       </TT>-49.298100<TT>      </TT>  12.167727<TT>     </TT> -4144<BR>
-<BR> <TT>       </TT>-49.298299<TT>      </TT>  12.166175<TT>     </TT>  4871<BR>
-<BR> <TT>       </TT>-49.298476<TT>      </TT>  12.164803<TT>     </TT>  4873<BR>
-<BR> <TT>       </TT>-49.298639<TT>      </TT>  12.163530<TT>     </TT>  4891<BR>
-<BR> <TT>       </TT>.....<BR>
-<P>
-Finally, suppose one wishes to obtain a dump of longitude, latitude, and
-amplitude for all good beams in a Hydrosweep data file. There are two ways to
-obtain this output. One can explicitly specify the output format as
-<B>-O</B><I>XYB</I> and the output beams as <B>-M</B><I>0/58</I>:
-<P>
-<BR> <TT>       </TT>mblist -Iinfile.mb21 -F21 -OXYB -M0/58<BR>
-<P>
-or one can use the equivalent <B>-D</B><I>4</I> shortcut:
-<P>
-<TT>        </TT>mblist -Iinfile.mb21 -F21 -D4<BR>
-<P>
-Either way, the output is as follows:
-<P>
-<BR> <TT>       </TT>-49.296454<TT>      </TT>  12.180552<TT>     </TT>    13<BR>
-<BR> <TT>       </TT>-49.296695<TT>      </TT>  12.178668<TT>     </TT>    17<BR>
-<BR> <TT>       </TT>-49.296923<TT>      </TT>  12.176893<TT>     </TT>    16<BR>
-<BR> <TT>       </TT>-49.297123<TT>      </TT>  12.175341<TT>     </TT>    14<BR>
-<BR> <TT>       </TT>-49.297319<TT>      </TT>  12.173808<TT>     </TT>    17<BR>
-<BR> <TT>       </TT>-49.297536<TT>      </TT>  12.172122<TT>     </TT>     9<BR>
-<BR> <TT>       </TT>-49.297744<TT>      </TT>  12.170498<TT>     </TT>    14<BR>
-<BR> <TT>       </TT>-49.297909<TT>      </TT>  12.169216<TT>     </TT>    15<BR>
-<BR> <TT>       </TT>-49.298100<TT>      </TT>  12.167727<TT>     </TT>    12<BR>
-<BR> <TT>       </TT>-49.298299<TT>      </TT>  12.166175<TT>     </TT>    12<BR>
-<BR> <TT>       </TT>-49.298476<TT>      </TT>  12.164803<TT>     </TT>    28<BR>
-<BR> <TT>       </TT>-49.298639<TT>      </TT>  12.163530<TT>     </TT>    14<BR>
-<BR> <TT>       </TT>.....<BR>
-<P>
-Suppose one wishes to examine the number of raw sidescan pixels in Simrad EM1002 data file
-and the first 5 pixels of each beam:
-<P>
-<TT>        </TT>mblist -i 0044_20000425_093808.mb57 -MA -ON#.S.s.5p<BR>
-<P>
-The output will be as follows:
-<P>
-<BR>     1       0           11278     286      -31.5   -32.0   -32.0   -32.5   -33.0
-<BR>     1       1           11278     133      -34.5   -34.5   -34.5   -34.5   -33.5
-<BR>     1       2           11278     142      -40.0   -40.0   -40.0   -40.0   -40.0
-<BR>     1       3           11278     139      -40.0   -40.5   -40.5   -40.5   -40.5
-<BR>     1       4           11278     159      -39.5   -38.5   -38.5   -39.0   -38.5
-<BR>     ...
-<BR>     1      54           11278     1        -27.00  NaN     NaN     NaN     NaN
-<BR>     .....
-<P>
-<A NAME="lbAI"> </A>
-<H2>SEE ALSO</H2>
-
-<B><A HREF="mbsystem.html">mbsystem</A></B>(1), <B><A HREF="mbinfo.html">mbinfo</A></B>(1)
-<P>
-<A NAME="lbAJ"> </A>
-<H2>BUGS</H2>
-
-<B>mblist</B> is not able to list all of the information available in some
-swath data formats.
-<P>
-
-<HR>
-<A NAME="index"> </A><H2>Index</H2>
-<DL>
-<DT><A HREF="#lbAB">NAME</A><DD>
-<DT><A HREF="#lbAC">VERSION</A><DD>
-<DT><A HREF="#lbAD">SYNOPSIS</A><DD>
-<DT><A HREF="#lbAE">DESCRIPTION</A><DD>
-<DT><A HREF="#lbAF">AUTHORSHIP</A><DD>
-<DT><A HREF="#lbAG">OPTIONS</A><DD>
-<DT><A HREF="#lbAH">EXAMPLES</A><DD>
-<DT><A HREF="#lbAI">SEE ALSO</A><DD>
-<DT><A HREF="#lbAJ">BUGS</A><DD>
-</DL>
-<HR>
-</PRE>
-
-<CENTER><P><BR>
-Last Updated: 17 May 2014</P></CENTER>
-
-<HR>
-<P><A HREF="mbsystem_man_list.html">Return to list of MB-System manual pages...</A></P>
-<P><A HREF="mbsystem_home.html"><IMG SRC="mbsystem_logo_small.gif" BORDER=0 HEIGHT=55 WIDTH=158 ALIGN=BOTTOM></A><A HREF="mbsystem_home.html">Back
-to MB-System Home Page...</A></P>
-
-</BODY>
-</HTML>
diff --git a/src/html/mbm_arc2grd.html b/src/html/mbm_arc2grd.html
deleted file mode 100644
index 50544b9..0000000
--- a/src/html/mbm_arc2grd.html
+++ /dev/null
@@ -1,153 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<HTML VERSION="2.0">
-<HEAD>
-   <TITLE>MB-System Unix Manual Page: mbm_arc2grd</TITLE>
-<!-- WEBMAGIC VERSION NUMBER="2.0.2" -->
-<!-- WEBMAGIC TRANSLATION NAME="ServerRoot" SRC="/var/www/htdocs/" DST="/" -->
-<!-- WEBMAGIC TRANSLATION NAME="ProjectRoot" SRC="./" DST="" -->
-</HEAD>
-<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#336699" VLINK="#997040" ALINK="#CC9900">
-<BODY>
-<CENTER><H3><U>MB-System Unix Manual Page</U></H3></CENTER>
-<PRE>
-<H1>mbm_arc2grd</H1>
-Section:  MB-System 5.0  (1)<BR>Updated:  3 June 2013 <BR><A HREF="#index">Index</A>
-<HR>
-
-<A NAME="lbAB"> </A>
-<H2>NAME</H2>
-
-<B>mbm_arc2grd</B> - Macro to convert an ArcView ASCII grid 
-to a GMT  grid file in the GMT NetCDF grid format. 
-<P>
-<A NAME="lbAC"> </A>
-<H2>VERSION</H2>
-
-Version 5.0
-<P>
-<A NAME="lbAD"> </A>
-<H2>SYNOPSIS</H2>
-
-mbm_arc2grd <B>-I</B><I>arcfile</I> <B>-O</B><I>grdfile</I> [<B>-H -V</B>]
-<P>
-<A NAME="lbAE"> </A>
-<H2>DESCRIPTION</H2>
-
-<B>mbm_arc2grd</B> is a macro to convert a ArcView 
-ASCII grid to an GMT grid file in the 
-GMT NetCDF grid format. This allows users to import the grid
-into GMT. The grid will have the same grid interval in both 
-longitude and latitude.
-The macro first obtains the bounds, dimensions, and grid
-cell size of the grid by parsing the six line header.
-The macro then reformats the gridded data as xyz data,
-writing it to a temporary file. This temporary file is 
-processed using the GMT program <B>xyz2grd</B>,
-yielding a GMT GRD format grid file.
-<P>
-<A NAME="lbAF"> </A>
-<H2>AUTHORSHIP</H2>
-
-David W. Caress (<A HREF="mailto:caress at mbari.org">caress at mbari.org</A>)
-<BR>
-
-<BR>  Monterey Bay Aquarium Research Institute
-<BR>
-
-Dale N. Chayes (<A HREF="mailto:dale at ldeo.columbia.edu">dale at ldeo.columbia.edu</A>)
-<BR>
-
-<BR>  Lamont-Doherty Earth Observatory
-<P>
-<A NAME="lbAG"> </A>
-<H2>OPTIONS</H2>
-
-<DL COMPACT>
-<DT><B>-H</B>
-
-<DD>
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-<DT><B>-I</B>
-
-<DD>
-<I>arcfile</I>
-<BR>
-
-Sets the filename of the input ArcView ASCII grid.
-<DT><B>-O</B>
-
-<DD>
-<I>grdname</I>
-<BR>
-
-Sets the filename of the output GMT grid file. This file will be
-in the GMT NetCDF GRD format. 
-<DT><B>-V</B>
-
-<DD>
-The <B>-V</B> option causes <B>mbm_arc2grd</B> to print out status messages.
-<P>
-</DL>
-<A NAME="lbAH"> </A>
-<H2>EXAMPLES</H2>
-
-Suppose that we have obtained an ascii ArcView grid called
-kohalab.asc. To translate this file to a GMT grd file,
-the following will suffice:
-<BR>
-
-<BR>  <TT>      </TT>mbm_arc2grd -I kohalab.asc -O kohalab.grd -V<BR>
-<BR>
-
-Running the example above produced the following output:
-<BR> <TT>       </TT>Program mbm_arc2grd status:<BR>
-<BR> <TT>       </TT><TT>        </TT>Input ArcView ASCII  file: kohalab.asc<BR>
-<BR> <TT>       </TT><TT>        </TT>Output GRD file:           kohalab.grd<BR>
-<BR> <TT>       </TT><TT>        </TT>Grid dimensions:  1597  1431<BR>
-<BR> <TT>       </TT><TT>        </TT>Grid cell sizes:  0.0001914456033  0.0001914456033<BR>
-<BR>  <TT>      </TT><TT>        </TT>Grid bounds:      -155.72855  -155.423002817133    20.1318  20.405567212719<BR>
-<P>
-<BR> <TT>       </TT>Running xyz2grd...<BR>
-<BR> <TT>       </TT>xyz2grd: nx = 1597  ny = 1431<BR>
-<P>
-<A NAME="lbAI"> </A>
-<H2>SEE ALSO</H2>
-
-<B><A HREF="mbsystem.html">mbsystem</A></B>(1), <B><A HREF="mbm_grd2arc.html">mbm_grd2arc</A></B>(1),
-<B><A HREF="mbm_grid.html">mbm_grid</A></B>(1)
-<P>
-<A NAME="lbAJ"> </A>
-<H2>BUGS</H2>
-
-Perhaps.
-<P>
-<P>
-<P>
-
-<HR>
-<A NAME="index"> </A><H2>Index</H2>
-<DL>
-<DT><A HREF="#lbAB">NAME</A><DD>
-<DT><A HREF="#lbAC">VERSION</A><DD>
-<DT><A HREF="#lbAD">SYNOPSIS</A><DD>
-<DT><A HREF="#lbAE">DESCRIPTION</A><DD>
-<DT><A HREF="#lbAF">AUTHORSHIP</A><DD>
-<DT><A HREF="#lbAG">OPTIONS</A><DD>
-<DT><A HREF="#lbAH">EXAMPLES</A><DD>
-<DT><A HREF="#lbAI">SEE ALSO</A><DD>
-<DT><A HREF="#lbAJ">BUGS</A><DD>
-</DL>
-<HR>
-</PRE>
-
-<CENTER><P><BR>
-Last Updated: 3 June 2013</P></CENTER>
-
-<HR>
-<P><A HREF="mbsystem_man_list.html">Return to list of MB-System manual pages...</A></P>
-<P><A HREF="mbsystem_home.html"><IMG SRC="mbsystem_logo_small.gif" BORDER=0 HEIGHT=55 WIDTH=158 ALIGN=BOTTOM></A><A HREF="mbsystem_home.html">Back
-to MB-System Home Page...</A></P>
-
-</BODY>
-</HTML>
diff --git a/src/html/mbm_bpr.html b/src/html/mbm_bpr.html
deleted file mode 100644
index 801c649..0000000
--- a/src/html/mbm_bpr.html
+++ /dev/null
@@ -1,312 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<HTML VERSION="2.0">
-<HEAD>
-   <TITLE>MB-System Unix Manual Page: mbm_bpr</TITLE>
-<!-- WEBMAGIC VERSION NUMBER="2.0.2" -->
-<!-- WEBMAGIC TRANSLATION NAME="ServerRoot" SRC="/var/www/htdocs/" DST="/" -->
-<!-- WEBMAGIC TRANSLATION NAME="ProjectRoot" SRC="./" DST="" -->
-</HEAD>
-<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#336699" VLINK="#997040" ALINK="#CC9900">
-<BODY>
-<CENTER><H3><U>MB-System Unix Manual Page</U></H3></CENTER>
-<PRE>
-<H1>mbm_bpr</H1>
-Section:  MB\-System 5.0  (1)<BR>Updated:  3 June 2013 <BR><A HREF="#index">Index</A>
-<HR>
-
-<A NAME="lbAB"> </A>
-<H2>NAME</H2>
-
-<B>mbm_bpr</B> - MB-System macro to process data from a Seabird SBE53 pressure
-sensor into a tidal model for use by mbprocess.
-<P>
-<A NAME="lbAC"> </A>
-<H2>VERSION</H2>
-
-Version 5.0
-<P>
-<A NAME="lbAD"> </A>
-<H2>SYNOPSIS</H2>
-
-<B>mbm_bpr</B> <B>-I</B><I>bprfile</I> <B>-O</B><I>tidefile</I> [<B>-D</B><I>offset </I><B>R</B><I>lon/lat</I> <B>-T -H -V</B>]
-<P>
-<A NAME="lbAE"> </A>
-<H2>DESCRIPTION</H2>
-
-<B>mbm_bpr</B> is a perl shellscript used to translate pressure data from a Seabird SBE53 pressure
-sensor used as a Bottom Pressure Recorder (BPR) into tidal data that can be used to correct
-swath bathymetry data. The user specifies an input BPR data file in the *.tid format produced
-by Seabird software and the output path for the resulting tidefile.
-<P>
-By default, the output
-tidefile will be in the form of a text file with two columns:
-<BR>      time_d tide.
-<BR>
-
-Here time_d are time values in decimal epoch seconds (seconds since 1970 Jan 1 00:00:00) and the tide values
-are in meters. In this case, the tidefile is in format 1 as supported by <B>mbprocess</B>, so to make use of this
-tide data to correct swath bathymetry, use <B>mbset</B> as follows:
-<BR>      mbset -Idatalist.mb-1 -PTIDEFILE:tidefilename -PTIDEFORMAT:1
-<BR>
-
-where datalist.mb-1 is the datalist referring to the data files to be processed. After using <B>mbset</B> to
-turn on tide correction, run <B>mbprocess</B>:
-<BR>      mbprocess -Idatalist.mb-1
-<BR>
-
-<P>
-If the <B>-T</B> option is specified, then the output file will have the form of:
-<BR>      year month day hour min sec tide
-<BR>
-
-In this case, the tidefile is in format 2 as supported by <B>mbprocess</B>, so to make use of this
-tide data to correct swath bathymetry, use <B>mbset</B> as follows:
-<BR>      mbset -Idatalist.mb-1 -PTIDEFILE:tidefilename -PTIDEFORMAT:2
-<BR>
-
-where datalist.mb-1 is the datalist referring to the data files to be processed. After using <B>mbset</B> to
-turn on tide correction, run <B>mbprocess</B>.
-<P>
-The macro <B>mbm_bpr</B> calculates depth from pressure and latitude using the empirical formula for seawater in:
-<BR>
-
-<BR>        N. P. Fofonoff and R. C. Millard, Jr., Algorithms for computation of fundamental
-<BR>        properties of seawater, Unesco Tech. Papers in Mar. Sci., No. 44 1983.
-<BR>
-
-and then calculates tidal data as the difference between the observed depth and a vertical
-reference depth. If a location is supplied using the <B>-R</B> option,
-<B>mbm_bpr</B> uses the latitude in the depth calculation and also extracts a tidal model
-corresponding the to BPR deployment site and timespan using the program <B>mbotps</B>. The vertical
-reference is then the average difference between the tidal model and the observed depths.
-If the user does not supply a location using the <B>-R</B> option,
-a location on the equator is assumed for the depth calculation and the vertical reference is
-the mean depth of the middle half of the depth time series (i.e. depths from 1/4 to 3/4 of the total time span).
-The user can specify an additional offset to apply to the tide data using the <B>-D</B><I>offset</I> option.
-<P>
-If the <B>-T</B> option is not used, then <B>mbm_bpr</B> will also output a shellscript that will, if
-executed, generate a GMT postscript plot of the tide data output. If a location has been specified so that
-a tidal model was also generated, the model will be plotted with the tide data.
-<P>
-<A NAME="lbAF"> </A>
-<H2>AUTHORSHIP</H2>
-
-David W. Caress (<A HREF="mailto:caress at mbari.org">caress at mbari.org</A>)
-<BR>
-
-<BR>  Monterey Bay Aquarium Research Institute
-<BR>
-
-Dale N. Chayes (<A HREF="mailto:dale at ldeo.columbia.edu">dale at ldeo.columbia.edu</A>)
-<BR>
-
-<BR>  Lamont-Doherty Earth Observatory
-<BR>
-
-Suzanne H. O'Hara (<A HREF="mailto:sohara at ldeo.columbia.edu">sohara at ldeo.columbia.edu</A>)
-<BR>
-
-<BR>  Lamont-Doherty Earth Observatory
-<P>
-<A NAME="lbAG"> </A>
-<H2>OPTIONS</H2>
-
-<DL COMPACT>
-<DT><B>-D</B>
-
-<DD>
-<I>offset</I>
-<BR>
-
-An offset to be added to the calculated tidal data, in meters. Default: <I>offset</I>=0.
-<DT><B>-H</B>
-
-<DD>
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-<DT><B>-I</B>
-
-<DD>
-<I>bprfile</I>
-<BR>
-
-Input pressure data from the SBE53 pressure sensor in the Sea-Bird *.tid format.
-<DT><B>-O</B>
-
-<DD>
-<I>tidefile</I>
-<BR>
-
-Output tide data file path. The format of the tide data controlled by the use (or not) of the <B>-T</B> option.
-<DT><B>-R</B>
-
-<DD>
-<I>longitude/latitude</I>
-<BR>
-
-Sets the location of the BPR deployment. Here <I>longitude</I> and <I>latitude</I> are in decimal
-degrees.
-<DT><B>-T</B>
-
-<DD>
-Changes the tide data format output. The format of the tide data are normally
-in the form of a text file with two columns:
-<BR>      time_d tide
-<BR>
-
-where time_d are time values in decimal epoch seconds (seconds since 1970 Jan 1 00:00:00) and the tide values
-are in meters.
-If the <B>-T</B> option is specified, then the output file will instead have the form of:
-<BR>      year month day hour min sec tide
-<DT><B>-V</B>
-
-<DD>
-Causes <B>mbm_bpr</B> to operate in "verbose" mode so that it outputs
-more information than usual.
-<P>
-</DL>
-<A NAME="lbAH"> </A>
-<H2>Examples</H2>
-
-Suppose one has deployed an SBE53 at 110 deg 40.92220'W 26deg 27.18960'N at about 1200 m depth.
-The Sea-Bird processing software outputs data in *.tid files with output something like:
-<BR>     1   03/14/2012 16:27:21 99999.9999    20.2731
-<BR>     2   03/14/2012 16:28:21 99999.9999    20.2696
-<BR>     3   03/14/2012 16:29:21 99999.9999    20.2589
-<BR>     4   03/14/2012 16:30:21 99999.9999    20.2537
-<BR>     5   03/14/2012 16:31:21 99999.9999    20.2448
-<BR>     6   03/14/2012 16:32:21 99999.9999    20.2322
-<BR>     7   03/14/2012 16:33:21 99999.9999    20.2188
-<BR>     8   03/14/2012 16:34:21 99999.9999    20.2656
-<BR>     9   03/14/2012 16:35:21 99999.9999    20.3567
-<BR>    10   03/14/2012 16:36:21 99999.9999    20.4316
-<BR>    11   03/14/2012 16:37:21 99999.9999    20.4929
-<BR>    12   03/14/2012 16:38:21 99999.9999    20.5661
-<BR>    13   03/14/2012 16:39:21 99999.9999    20.6242
-<BR>    14   03/14/2012 16:40:21 99999.9999    20.6891
-<BR>    15   03/14/2012 16:41:21 99999.9999    20.7590
-<BR>    16   03/14/2012 16:42:21 99999.9999    19.8901
-<BR>    17   03/14/2012 16:43:21 99999.9999    18.1037
-<BR>    18   03/14/2012 16:44:21 99999.9999    17.2487
-<BR>    19   03/14/2012 16:45:21 99999.9999    15.9275
-<BR>    20   03/14/2012 16:46:21 99999.9999    14.7406
-<BR>    21   03/14/2012 16:47:21 99999.9999    13.7798
-<BR>    22   03/14/2012 16:48:21 99999.9999    13.0540
-<BR>    23   03/14/2012 16:49:21 99999.9999    12.3869
-<BR>    24   03/14/2012 16:50:21 99999.9999    11.8464
-<BR>    25   03/14/2012 16:51:21 99999.9999    11.1999
-<BR>    26   03/14/2012 16:52:21   528.8065    10.5061
-<BR>    27   03/14/2012 16:53:21   583.2633     9.9686
-<BR>    28   03/14/2012 16:54:21   637.7951     9.3547
-<BR>    29   03/14/2012 16:55:21   693.5947     8.8287
-<BR>    30   03/14/2012 16:56:21   748.5921     8.3998
-<BR>    31   03/14/2012 16:57:21   804.0302     8.0251
-<BR>    32   03/14/2012 16:58:21   859.5471     7.6560
-<BR>    33   03/14/2012 16:59:21   914.8043     7.3006
-<BR>    34   03/14/2012 17:00:21   969.7692     7.0322
-<BR>    35   03/14/2012 17:01:21  1023.0636     6.6673
-<BR>    36   03/14/2012 17:02:21  1077.7238     6.3327
-<BR>    37   03/14/2012 17:03:21  1132.0991     6.0528
-<BR>    38   03/14/2012 17:04:21  1186.9391     5.8203
-<BR>    39   03/14/2012 17:05:21  1241.4040     5.6089
-<BR>    40   03/14/2012 17:06:21  1295.6002     5.4167
-<BR>    41   03/14/2012 17:07:21  1350.1353     5.2188
-<BR>    42   03/14/2012 17:08:21  1404.8882     5.0195
-<BR>    43   03/14/2012 17:09:21  1460.2095     4.9215
-<BR>    44   03/14/2012 17:10:21  1514.6683     4.7630
-<BR>    45   03/14/2012 17:11:21  1568.9270     4.5651
-<BR>    46   03/14/2012 17:12:21  1623.3903     4.4452
-<BR>    47   03/14/2012 17:13:21  1678.6771     4.3075
-<BR>    48   03/14/2012 17:14:21  1733.7411     4.1910
-<BR>    49   03/14/2012 17:15:21  1789.1549     4.0284
-<BR>    50   03/14/2012 17:16:21  1844.5557     3.8760
-<BR>    51   03/14/2012 17:17:21  1869.8892     3.7976
-<BR>    52   03/14/2012 17:18:21  1869.8176     3.7534
-<BR>    53   03/14/2012 17:19:21  1869.8197     3.7088
-<BR>    54   03/14/2012 17:20:21  1869.8224     3.6828
-<BR>    55   03/14/2012 17:21:21  1869.8241     3.6682
-<BR>
-
-where the third column is the pressure in dbar and the fourth column is temperature in degrees C.
-The pressure increases and the temperature decreases as the sensor sinks to the seafloor following
-deployment off a ship. Once the sensor is on the seafloor, pressure variations reflect the tides.
-<P>
-To extract a tidal model, use <B>mbm_bpr</B> as follows:
-<BR>    mbm_bpr -I BPR.tid -OBPR.tde -R-110.682037/27.453160 -V
-<BR>
-
-The output to the shell looks like:
-<BR>    Program  Status:
-<BR>      1771 pressure values read from BPR.tid
-<BR>      Vertical reference to tidal model for position -110.682037 27.453160
-<BR>      Tide will be output as <time_d tide> values
-<BR>      A plot will be generated
-<BR>      Executing: mbotps -A1 -D1200 -R-110.682037/27.453160 -B2012/03/14/16/52/21 -E2012/03/15/22/22/21 -OBPR.tid_tidemodel.txt
-<BR>      Results are really in BPR.tid_tidemodel.txt
-<BR>      1690 pressure values output to BPR.tde
-<BR>      Vertical reference: 1267.31678290355 m
-<BR>      Executing mbm_xyplot -R1331743941.000000/1331850141.000000/-0.5071/0.5071 -IW0/0/0:BPR.tde -IW255/0/0:BPR.tid_tidemodel.txt -OBPR.tde_tideplot -L"Tide Data from BPR <BPR.tde> (black) & Tide Model (red):Seconds:Tide (meters)" -V
-<BR>      Executing <BPR.tde_tideplot.cmd> also invokes gv to view the plot on the screen.
-<BR>
-
-The output tidal data file BPR.tde has the form:
-<BR>    1331745441.000000 -0.0803109226781089
-<BR>    1331745501.000000 -0.129052283649798
-<BR>    1331745561.000000 -0.127622718432121
-<BR>    1331745621.000000 -0.125784706023751
-<BR>    1331745681.000000 -0.124627438960488
-<BR>    1331745741.000000 -0.123334022838208
-<BR>    1331745801.000000 -0.12285750111073
-<BR>    1331745861.000000 -0.121768308595847
-<BR>
-
-where the first column is time in seconds since January 1, 1970 (epoch seconds, aka unix
-seconds, aka time_d values within <B>MB-System</B>), and the second column is the tidal signal
-in meters. In this case the reference tidal model is provided by <B>mbotps</B>, and the
-plot created by running the output shellscript BPR.tde_tideplot.cmd plots both the tidal data
-calculated by <B>mbm_bpr</B> and the tidal model extracted using <B>mbotps</B>.
-<P>
-<A NAME="lbAI"> </A>
-<H2>SEE ALSO</H2>
-
-<B><A HREF="mbsystem.html">mbsystem</A></B>(1), <B><A HREF="mbprocess.html">mbprocess</A></B>(1), <B><A HREF="mbset.html">mbset</A></B>(1)
-<P>
-<A NAME="lbAJ"> </A>
-<H2>REFERENCES</H2>
-
-N. P. Fofonoff and R. C. Millard, Jr., Algorithms for computation of fundamental
-properties of seawater, Unesco Tech. Papers in Mar. Sci., No. 44 1983.
-<P>
-<A NAME="lbAK"> </A>
-<H2>BUGS</H2>
-
-Lobsters, really.
-<P>
-
-<HR>
-<A NAME="index"> </A><H2>Index</H2>
-<DL>
-<DT><A HREF="#lbAB">NAME</A><DD>
-<DT><A HREF="#lbAC">VERSION</A><DD>
-<DT><A HREF="#lbAD">SYNOPSIS</A><DD>
-<DT><A HREF="#lbAE">DESCRIPTION</A><DD>
-<DT><A HREF="#lbAF">AUTHORSHIP</A><DD>
-<DT><A HREF="#lbAG">OPTIONS</A><DD>
-<DT><A HREF="#lbAH">Examples</A><DD>
-<DT><A HREF="#lbAI">SEE ALSO</A><DD>
-<DT><A HREF="#lbAJ">REFERENCES</A><DD>
-<DT><A HREF="#lbAK">BUGS</A><DD>
-</DL>
-<HR>
-</PRE>
-
-<CENTER><P><BR>
-Last Updated: 3 June 2013</P></CENTER>
-
-<HR>
-<P><A HREF="mbsystem_man_list.html">Return to list of MB-System manual pages...</A></P>
-<P><A HREF="mbsystem_home.html"><IMG SRC="mbsystem_logo_small.gif" BORDER=0 HEIGHT=55 WIDTH=158 ALIGN=BOTTOM></A><A HREF="mbsystem_home.html">Back
-to MB-System Home Page...</A></P>
-
-</BODY>
-</HTML>
diff --git a/src/html/mbm_copy.html b/src/html/mbm_copy.html
deleted file mode 100644
index aea63cd..0000000
--- a/src/html/mbm_copy.html
+++ /dev/null
@@ -1,210 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<HTML VERSION="2.0">
-<HEAD>
-   <TITLE>MB-System Unix Manual Page: mbm_copy</TITLE>
-<!-- WEBMAGIC VERSION NUMBER="2.0.2" -->
-<!-- WEBMAGIC TRANSLATION NAME="ServerRoot" SRC="/var/www/htdocs/" DST="/" -->
-<!-- WEBMAGIC TRANSLATION NAME="ProjectRoot" SRC="./" DST="" -->
-</HEAD>
-<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#336699" VLINK="#997040" ALINK="#CC9900">
-<BODY>
-<CENTER><H3><U>MB-System Unix Manual Page</U></H3></CENTER>
-<PRE>
-<H1>mbm_copy</H1>
-Section:  MB-System 5.0  (1)<BR>Updated:  3 June 2013 <BR><A HREF="#index">Index</A>
-<HR>
-
-<A NAME="lbAB"> </A>
-<H2>NAME</H2>
-
-<B>mbm_copy</B> - Apply mbcopy to all files referenced through
-a datalist, using the MB-System file suffix convention
-to name the output files
-<P>
-<A NAME="lbAC"> </A>
-<H2>VERSION</H2>
-
-Version 5.0
-<P>
-<A NAME="lbAD"> </A>
-<H2>SYNOPSIS</H2>
-
-<B>mbm_copy</B> <B>-F</B><I>outputformat</I> <B>-I</B><I>datalist</I>
-[<B>-H</B> <B>-C -T</B> <B>-V</B>]
-<P>
-<A NAME="lbAE"> </A>
-<H2>DESCRIPTION</H2>
-
-<P>
-<B>mbm_copy</B> is a macro used to copy large numbers of swath data files
-from one data format to another using the program <B>mbcopy</B>.
-The input is a datalist file referencing
-all of the target swath files. The output swath file format is specified
-with the <B>-F</B> option. If the output swath file format is not specified,
-the output format will be the same as the input format.
-<P>
-The macro identifies a filename root for each input swath file. For files
-with recognized filename suffixes (e.g. ".mb61" for a format 61 file), the
-filename root is the part of the filename that comes before the suffix. For
-files without a recognized suffix, the filename root is the entire filename.
-So, for a format 57 data file called "0007_20020425_060531.mb57", the filename root
-is "0007_20020425_060531". For a format 121 file named "009_1659", the filename
-root "009_1659".
-<P>
-The output filenames are automatically constructed by adding the standard
-MB-System file suffix to the filename root. This suffix is ".mbXXX" where
-XXX is the two or three digit format id number. In the event that the output
-filename is the same as the input filename (likely only if the <B>-F</B> option
-is not used to set the output format), a "c" will be placed at the beginning
-of the output file suffix, making it "c.mbXXX".
-<P>
-The <B>-T</B> option causes this macro to print out the <B>mbcopy</B> commands
-it will execute without actually executing them. This test option allows
-users to check the consequences of their command before actually running it.
-<P>
-<A NAME="lbAF"> </A>
-<H2>AUTHORSHIP</H2>
-
-David W. Caress (<A HREF="mailto:caress at mbari.org">caress at mbari.org</A>)
-<BR>
-
-<BR>  Monterey Bay Aquarium Research Institute
-<BR>
-
-Dale N. Chayes (<A HREF="mailto:dale at ldeo.columbia.edu">dale at ldeo.columbia.edu</A>)
-<BR>
-
-<BR>  Lamont-Doherty Earth Observatory
-<P>
-<A NAME="lbAG"> </A>
-<H2>SIMPLE DESCRIPTION OF BASIC OPTIONS</H2>
-
-<DL COMPACT>
-<DT><B>-H</B>
-
-<DD>
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-<DT><B>-C</B>
-
-<DD>
-<BR>
-
-This option causes the program to check if each output file
-already exists, and to forgo copying those that do exist.
-<DT><B>-F</B>
-
-<DD>
-<I>outputformat</I>
-<BR>
-
-This option sets the output swath format. All of the swath data
-files referenced in the datalist specified with the <B>-I</B> option
-will be copied to format <I>outputformat</I> using <B>mbcopy</B>. If
-the <B>-F</B> option is not given, then the input files will be copied
-to their input formats.
-<DT><B>-I</B>
-
-<DD>
-<I>datalist</I>
-<BR>
-
-Sets the input datalist filename. A datalist is an ascii
-file containing a list of the input swath sonar
-data files to be copied and their formats.
-In the <I>datalist</I> file, each
-swath data file should be followed by a data format identifier, e.g.:
-<BR> <TT>       </TT>datafile1 11<BR>
-<BR> <TT>       </TT>datafile2 24<BR>
-<BR>
-
-As discussed in the <B>MB-System</B> manual page, datalists may reference
-other datalists, allowing users to construct recursive datalist structures.
-This program uses the <B>MBIO</B> library and will read or write any swath sonar
-format supported by <B>MBIO</B>. A list of the swath sonar data formats
-currently supported by <B>MBIO</B> and their identifier values
-is given in the <B>MBIO</B> manual page.
-<DT><B>-T</B>
-
-<DD>
-<BR>
-
-This option causes <B>mbm_copy</B> to print out the <B>mbcopy</B> commands
-it will execute without actually executing them. This test option allows
-users to check the consequences of their command before actually running it.
-<DT><B>-V</B>
-
-<DD>
-Causes <B>mbm_copy</B> to operate in "verbose" mode
-so that it outputs
-more information than usual.
-<P>
-</DL>
-<A NAME="lbAH"> </A>
-<H2>EXAMPLES</H2>
-
-Suppose one has three raw (format 56) Simrad EM300 data files:
-<BR> <TT>       </TT>0001_20020424_212920_raw.all<BR>
-<BR> <TT>       </TT>0002_20020425_011607_raw.all<BR>
-<BR> <TT>       </TT>0003_20020425_022926_raw.all<BR>
-<BR>
-
-One can generate a datalist called datalistr.mb-1 referencing these
-three swath files using a text editor or by using <B>awk</B>:
-<BR> <TT>       </TT>ls -1 *all | awk '{print $1" 56"}' > datalistr.mb-1<BR>
-<BR>
-
-In order to translate all three files in the processing format for
-Simrad multibeam data (format 57), use the <B>mbm_copy</B> macro:
-<BR> <TT>       </TT>mbm_copy -I datalistr.mb-1 -F 57 -T -V<BR>
-<BR>
-
-The macro prints out the following as it translates the swath data:
-<BR>  <TT>      </TT>Running: mbcopy -F56/57<BR>
-<BR> <TT>       </TT><TT>        </TT>-I0001_20020424_212920_raw.all<BR>
-<BR> <TT>       </TT><TT>        </TT>-O0001_20020424_212920.mb57<BR>
-<BR>  <TT>      </TT>Running: mbcopy -F56/57<BR>
-<BR> <TT>       </TT><TT>        </TT>-I0002_20020425_011607_raw.all<BR>
-<BR> <TT>       </TT><TT>        </TT>-O0002_20020425_011607.mb57<BR>
-<BR>  <TT>      </TT>Running: mbcopy -F56/57<BR>
-<BR> <TT>       </TT><TT>        </TT>-I0003_20020425_022926_raw.all<BR>
-<BR> <TT>       </TT><TT>        </TT>-O0003_20020425_022926.mb57<BR>
-<P>
-<A NAME="lbAI"> </A>
-<H2>SEE ALSO</H2>
-
-<B><A HREF="mbsystem.html">mbsystem</A></B>(1), <B><A HREF="mbcopy.html">mbcopy</A></B>(1),
-<B><A HREF="mbdatalist.html">mbdatalist</A></B>(1)
-<P>
-<A NAME="lbAJ"> </A>
-<H2>BUGS</H2>
-
-Perhaps.
-<P>
-
-<HR>
-<A NAME="index"> </A><H2>Index</H2>
-<DL>
-<DT><A HREF="#lbAB">NAME</A><DD>
-<DT><A HREF="#lbAC">VERSION</A><DD>
-<DT><A HREF="#lbAD">SYNOPSIS</A><DD>
-<DT><A HREF="#lbAE">DESCRIPTION</A><DD>
-<DT><A HREF="#lbAF">AUTHORSHIP</A><DD>
-<DT><A HREF="#lbAG">SIMPLE DESCRIPTION OF BASIC OPTIONS</A><DD>
-<DT><A HREF="#lbAH">EXAMPLES</A><DD>
-<DT><A HREF="#lbAI">SEE ALSO</A><DD>
-<DT><A HREF="#lbAJ">BUGS</A><DD>
-</DL>
-<HR>
-</PRE>
-
-<CENTER><P><BR>
-Last Updated: 3 June 2013</P></CENTER>
-
-<HR>
-<P><A HREF="mbsystem_man_list.html">Return to list of MB-System manual pages...</A></P>
-<P><A HREF="mbsystem_home.html"><IMG SRC="mbsystem_logo_small.gif" BORDER=0 HEIGHT=55 WIDTH=158 ALIGN=BOTTOM></A><A HREF="mbsystem_home.html">Back
-to MB-System Home Page...</A></P>
-
-</BODY>
-</HTML>
diff --git a/src/html/mbm_grd2arc.html b/src/html/mbm_grd2arc.html
deleted file mode 100644
index 6175bac..0000000
--- a/src/html/mbm_grd2arc.html
+++ /dev/null
@@ -1,196 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<HTML VERSION="2.0">
-<HEAD>
-   <TITLE>MB-System Unix Manual Page: mbm_grd2arc</TITLE>
-<!-- WEBMAGIC VERSION NUMBER="2.0.2" -->
-<!-- WEBMAGIC TRANSLATION NAME="ServerRoot" SRC="/var/www/htdocs/" DST="/" -->
-<!-- WEBMAGIC TRANSLATION NAME="ProjectRoot" SRC="./" DST="" -->
-</HEAD>
-<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#336699" VLINK="#997040" ALINK="#CC9900">
-<BODY>
-<CENTER><H3><U>MB-System Unix Manual Page</U></H3></CENTER>
-<PRE>
-<H1>mbm_grd2arc</H1>
-Section:  MB-System 5.0  (1)<BR>Updated:  3 June 2013 <BR><A HREF="#index">Index</A>
-<HR>
-
-<A NAME="lbAB"> </A>
-<H2>NAME</H2>
-
-<B>mbm_grd2arc</B> - Macro to convert a GMT
-grid file in the GMT NetCDF grid format
-to an ArcView ASCII grid.
-<P>
-<A NAME="lbAC"> </A>
-<H2>VERSION</H2>
-
-Version 5.0
-<P>
-<A NAME="lbAD"> </A>
-<H2>SYNOPSIS</H2>
-
-mbm_grd2arc <B>-I</B><I>grdfile</I> <B>-O</B><I>arcfile</I> [<B>-H</B> <B>-N</B><I>nodata</I> <B>-V</B>]
-<P>
-<A NAME="lbAE"> </A>
-<H2>DESCRIPTION</H2>
-
-<B>mbm_grd2arc</B> is a macro to convert a GMT
-grid file in the GMT NetCDF grid format
-to an ArcView ASCII grid. This allows users to import the grid
-into Arc/Info and ArcView. The grids must have the same grid
-interval in both longitude and latitude. If the grid was created
-using <B>mbgrid</B> or <B>mbmosaic</B>, the <B>-E</B> option
-must have been used in that program
-to set the grid cell sizes equal (see the mbgrid and mbmosaic
-manual pages).
-<BR>
-
-The macro first obtains the bounds, dimensions, and grid
-cell size of the grid using the GMT program <B>grdinfo</B>.
-The grid dimensions, the lower left position, and the
-grid cell size are written to the header of the output
-ArcView ASCII grid file.
-The macro then uses the GMT program <B>grd2xyz</B> to
-dump each of the grid values to a temporary ASCII file.
-This temporary file is read and parsed one value at
-a time.  Any NaN values are
-replaced by the <I>nodata</I> value specified with the <B>-N</B>
-option. Each final value is printed to the output file.
-<P>
-<A NAME="lbAF"> </A>
-<H2>AUTHORSHIP</H2>
-
-David W. Caress (<A HREF="mailto:caress at mbari.org">caress at mbari.org</A>)
-<BR>
-
-<BR>  Monterey Bay Aquarium Research Institute
-<BR>
-
-Dale N. Chayes (<A HREF="mailto:dale at ldeo.columbia.edu">dale at ldeo.columbia.edu</A>)
-<BR>
-
-<BR>  Lamont-Doherty Earth Observatory
-<P>
-<A NAME="lbAG"> </A>
-<H2>OPTIONS</H2>
-
-<DL COMPACT>
-<DT><B>-H</B>
-
-<DD>
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-<DT><B>-I</B>
-
-<DD>
-<I>grdname</I>
-<BR>
-
-Sets the filename of the input GMT grid file. This file must be
-in the GMT NetCDF GRD format.
-<DT><B>-N</B>
-
-<DD>
-<I>nodata</I>
-<BR>
-
-Sets the "no data" value used in the output ASCII file.
-Default: <I>nodata</I> = -99999.
-<DT><B>-O</B>
-
-<DD>
-<I>arcfile</I>
-<BR>
-
-Sets the filename of the output ArcView ASCII grid.
-<DT><B>-V</B>
-
-<DD>
-The <B>-V</B> option causes <B>mbm_grd2arc</B> to print out status messages.
-<P>
-</DL>
-<A NAME="lbAH"> </A>
-<H2>EXAMPLES</H2>
-
-Suppose that we have used <B>mbgrid</B> to obtain a
-topography grid file called KohalaA_bath.grd in the GMT NetCDF
-GRD format:
-<BR> <TT>       </TT>mbgrid -Idatalist \<BR>
-<BR> <TT>       </TT><TT>        </TT>-OKohalaA_bath \<BR>
-<BR> <TT>       </TT><TT>        </TT>-R-155.72855/-155.31928/20.09488/20.47645 \<BR>
-<BR> <TT>       </TT><TT>        </TT>-E30.0/0m! -A2 -N -G3 -C1 -V<BR>
-<BR>
-
-In this case, the <B>-E</B> option was used
-to force <B>mbgrid</B> to use equal longitude and latitude
-grid cell sizes. See the <B>mbgrid</B> or <B>mbmosaic</B> manual pages for
-details on the usage of the <B>-E</B> option in those
-programs.
-<P>
-In order to convert KohalaA_bath.grd to an ArcView ASCII grid
-so that the data can be imported into the Arc/Info or ArcView
-GIS packages, we use the <B>mbm_grd2arc</B> macro:
-<BR> <TT>       </TT>mbm_grd2arc -IKohalaA_bath.grd \<BR>
-<BR> <TT>       </TT><TT>        </TT>-OKohalaA_bath.asc -V<BR>
-<BR>
-
-Running the example above produced the following output:
-<P>
-<BR> <TT>       </TT>Program mbm_grd2arc status:<BR>
-<BR> <TT>       </TT>        Input GRD file:            KohalaA_bath.grd<BR>
-<BR> <TT>       </TT>        Output ArcView ASCII file: KohalaA_bath.asc<BR>
-<BR> <TT>       </TT>        Grid dimensions:  1426  1329<BR>
-<BR> <TT>       </TT>        Grid cell sizes:  0.0002871995719  0.0002871995719<BR>
-<BR> <TT>       </TT>        Grid bounds:      -155.72855  -155.3192906    20.09488  20.47628103<BR>
-<P>
-<BR> <TT>       </TT>Generating temporary file...<BR>
-<BR> <TT>       </TT>Parsing temporary file...<BR>
-<BR> <TT>       </TT>10% complete<BR>
-<BR> <TT>       </TT>20% complete<BR>
-<BR> <TT>       </TT>30% complete<BR>
-<BR> <TT>       </TT>40% complete<BR>
-<BR> <TT>       </TT>50% complete<BR>
-<BR> <TT>       </TT>60% complete<BR>
-<BR> <TT>       </TT>70% complete<BR>
-<BR> <TT>       </TT>80% complete<BR>
-<BR> <TT>       </TT>90% complete<BR>
-<BR> <TT>       </TT>100% complete<BR>
-<P>
-<A NAME="lbAI"> </A>
-<H2>SEE ALSO</H2>
-
-<B><A HREF="mbsystem.html">mbsystem</A></B>(1), <B><A HREF="mbgrid.html">mbgrid</A></B>(1),
-<B><A HREF="mbmosaic.html">mbmosaic</A></B>(1), <B><A HREF="mbm_arc2grd.html">mbm_arc2grd</A></B>(1), <B><A HREF="mbm_grid.html">mbm_grid</A></B>(1)
-<P>
-<A NAME="lbAJ"> </A>
-<H2>BUGS</H2>
-
-Maybe. Maybe not.
-<P>
-
-<HR>
-<A NAME="index"> </A><H2>Index</H2>
-<DL>
-<DT><A HREF="#lbAB">NAME</A><DD>
-<DT><A HREF="#lbAC">VERSION</A><DD>
-<DT><A HREF="#lbAD">SYNOPSIS</A><DD>
-<DT><A HREF="#lbAE">DESCRIPTION</A><DD>
-<DT><A HREF="#lbAF">AUTHORSHIP</A><DD>
-<DT><A HREF="#lbAG">OPTIONS</A><DD>
-<DT><A HREF="#lbAH">EXAMPLES</A><DD>
-<DT><A HREF="#lbAI">SEE ALSO</A><DD>
-<DT><A HREF="#lbAJ">BUGS</A><DD>
-</DL>
-<HR>
-</PRE>
-
-<CENTER><P><BR>
-Last Updated: 3 June 2013</P></CENTER>
-
-<HR>
-<P><A HREF="mbsystem_man_list.html">Return to list of MB-System manual pages...</A></P>
-<P><A HREF="mbsystem_home.html"><IMG SRC="mbsystem_logo_small.gif" BORDER=0 HEIGHT=55 WIDTH=158 ALIGN=BOTTOM></A><A HREF="mbsystem_home.html">Back
-to MB-System Home Page...</A></P>
-
-</BODY>
-</HTML>
diff --git a/src/html/mbm_grd2geovrml.html b/src/html/mbm_grd2geovrml.html
deleted file mode 100644
index aeedbcd..0000000
--- a/src/html/mbm_grd2geovrml.html
+++ /dev/null
@@ -1,529 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<HTML VERSION="2.0">
-<HEAD>
-   <TITLE>MB-System Unix Manual Page: mbm_grd2geovrml</TITLE>
-<!-- WEBMAGIC VERSION NUMBER="2.0.2" -->
-<!-- WEBMAGIC TRANSLATION NAME="ServerRoot" SRC="/var/www/htdocs/" DST="/" -->
-<!-- WEBMAGIC TRANSLATION NAME="ProjectRoot" SRC="./" DST="" -->
-</HEAD>
-<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#336699" VLINK="#997040" ALINK="#CC9900">
-<BODY>
-<CENTER><H3><U>MB-System Unix Manual Page</U></H3></CENTER>
-<PRE>
-<H1>mbm_grd2geovrml</H1>
-Section:  MB-System 5.0  (1)<BR>Updated:  3 June 2013 <BR><A HREF="#index">Index</A>
-<HR>
-
-<A NAME="lbAB"> </A>
-<H2>NAME</H2>
-
-<B>mbm_grd2geovrml</B> - Create and execute commands which generate
-a TerraVision tileset and GeoVRML terrain set that can be combined
-with other geospatial data for viewing in a web browser.
-<P>
-<A NAME="lbAC"> </A>
-<H2>VERSION</H2>
-
-Version 5.0
-<P>
-<A NAME="lbAD"> </A>
-<H2>SYNOPSIS</H2>
-
-<B>mbm_grd2geovrml</B> <I>bath_file</I>
-<B>-tvdir</B> <I>tvparent</I>
-<B>-vrmldir</B> <I>vrmlparent</I>
-<B>-olat</B> <I>lat</I>
-<B>-olon</B> <I>lon</I>
-<B>-vrmlurl</B> <I>url</I>
-<P>
-<P>
-Additional Options:
-<P>
-<B>-elevscale</B> <I>vert_exag</I>
-<B>-nowrz</B>
-<B>-noview</B>
-<B>-pallette</B> <I>pal</I>
-<B>-newimage</B> <I>type|file</I>
-<B>-white</B>
-<B>-zmax</B> <I>maxclip</I>
-<B>-zmin</B> <I>minclip</I>
-<B>-basename</B> <I>basename</I>
-<P>
-<A NAME="lbAE"> </A>
-<H2>DESCRIPTION</H2>
-
-<B>mbm_grd2geovrml</B> is a macro that takes as input a GMT
-geographic-coordinate bathymetry grid file (<I>bath_file</I>) and
-produces a terrain tile set that may be viewed in a web browser
-with an appropriate plugin.  The bathymetry (geometry) is paired with
-imagery (texture) to produce artificially illuminated terrain or slope
-shaded terrain. Alternatively, a co-registered image may be provided
-as a substitute to the latter imagery which is generated from the
-bathymetry data.  This may be used to, for instance, draping a side
-scan sonar image over the bathymetry.
-<P>
-Before the geoVRML files can be created an intermediate TerraVision
-tile set must be created from the input GMT bathymetry file and a
-TIFF image that is either generated from the bathymetry or specified
-from an existing file with the <I>-newimage</I> option.
-<P>
-This tileset is then used to
-generate a GeoVRML quadtree multi-resolution set of files.  The resulting
-set of files will be created in <I>vrmlparent</I>/<basename>, where
-<basename> is the same as <I>bath_file</I> without the usual '.grd' extension.
-This behavior may be overridded with the <B>-basename</B> option.  This
-is useful if an existing image file is specified with the <B>-newimage</B>
-<I>file</I> option, in which case the image file base name should be used with
-<B>-basename</B> (see second example below).
-<P>
-The index.html file produced in this directory can be
-loaded into Netscape 4.7 on a PC (properly configured with CosmoPlayer
-and GeoVRML 1.1) for interactive visualization. The resulting
-terrain can be used as a 3D basemap for use in visualizing
-other georeferenced data that has also been placed in GeoVRML
-using the same <B>-olat</B> and <B>-olon</B> settings.
-<P>
-GeoVRML (and TerraVision) expects rectangular gridded elevation data
-and browsers render all terrain data within the rectangle.  This presents a
-problem for ocean bathymetric data which often have irregular (not rectangular)
-boundaries.  Before converting a grid file to TerraVision format
-<B>mbm_grd2geovrml</B> replaces all no-data elevation values with a coarse
-resolution spline-filled extrapolation from the data in the irregular
-area. This results in a rectangular grid
-with smooth transitions from areas of elevation data to areas of no data.
-In the resulting GeoVRML the no data areas are colored black
-(or white if <B>-white</B> is specified).  If <B>-newimage</B>
-<I>file</I> is specified then the outer boundaries will stay the same
-color as in the image.
-<P>
-<A NAME="lbAF"> </A>
-<H2>AUTHORSHIP</H2>
-
-Mike McCann (<A HREF="mailto:mccann at mbari.org">mccann at mbari.org</A>)
-<BR>
-
-<BR>  Monterey Bay Aquarium Research Institute
-<BR>
-
-<P>
-<A NAME="lbAG"> </A>
-<H2>SIMPLE DESCRIPTION OF BASIC OPTIONS</H2>
-
-<DL COMPACT>
-<DT><B></B><I>bath_file</I>
-
-<DD>
-<BR>
-
-A GMT gridded bathymetry file in geographic (lat/lon) coordinates.
-The file can be expressed with just the base name without the .grd
-extension, in which case the macro will append '.grd.gz' to <I>bath_file</I>
-and uncompress the data upon input. If the compressed data file does not
-exist then '.grd' will be appended to <I>bath_file</I> and it will be
-used, if it exists.
-<P>
-<DT><B>-tvdir</B>
-
-<DD>
-<I>tvparent</I>
-<P>
-The TerraVision tileset destination directory.
-A subdirectory named <I>bath_file</I> (without the .grd extension)
-will be created here.
-<DT><B>-vrmldir</B>
-
-<DD>
-<I>vrmlparent</I>
-<BR>
-
-The GeoVRML tileset destination directory.
-A subdirectory named <I>bath_file</I> (without the .grd extension)
-will be created here.
-<P>
-<DT><B>-olat</B>
-
-<DD>
-<I>lat</I>
-<DT><B>-olon</B>
-
-<DD>
-<I>lon</I>
-<P>
-<BR>
-
-The geoOrigin latitude and longitude in decimal degrees. Because of single
-precision arithmetic in VRML97 it is necessary to define
-a geoOrigin from which offsets are computed before coordinates
-are passed into the visualization pipeline.  The geoOrigin should
-be within 5 degrees of the extent of the grid file in order to
-have submeter precision in the location of objects within the
-resulting GeoVRML output.  See the GeoVRML spec for more details.
-<BR>
-
-<P>
-<BR>
-
-The GeoOrigin of the terrain must be the same as the GeoOrigin
-of any other GeoVRML content (e.g. navigation tracks, sample
-locations) that you wish to combine with the terrain.
-<P>
-<DT><B>-vrmlurl</B>
-
-<DD>
-<I>url</I>
-<BR>
-
-All default URLs that are placed in the VRML files will be relative.
-However, you should use the <B>-vrmlurl</B> option to specify an absolute URL
-for the set of tiles.
-Then all of the URLs that are used in the VRML files (image
-texture links and childUrls in the GeoLOD node) will use this as
-their base URL.
-This is generally not desirable because hardcoding absolute URLs
-into your datasets means that the dataset is nonportable to another
-server, or
-different location on the same server. However, it may be necessary
-to write absolute URLs in your tile files, especially if you have
-many levels because
-some VRML browsers have problems with relative links, resulting
-in tiles and images that will not load.
-<P>
-</DL>
-<A NAME="lbAH"> </A>
-<H2>DESCRIPTION OF OPTIONAL OPTIONS</H2>
-
-<P>
-<DL COMPACT>
-<DT><B>-elevscale</B>
-
-<DD>
-<I>vert_exag</I>
-<BR>
-
-Factor with which to multiply elevations resulting in a vertical
-exaggeration of the terrain.  The default value is 1.0. Factors
-greater than 1.0 increase vertical exaggeration.
-<P>
-<DT><B>-nowrz</B>
-
-<DD>
-<BR>
-
-By default vrml output files are gzipped and saved with the .wrz
-extension.  Specify -nowrz to override this and save the files
-uncompressed with the .wrl extension.
-<P>
-<DT><B>-noview</B>
-
-<DD>
-<BR>
-
-By default a GeoViewpoint node with description 'home' is included
-with each GeoVRML tile file.  These viewpoints are helpful for
-creating terrain-only visualizations, but they also quickly fill up
-the viewpoint list when many tiles are loaded.  If you are
-creating GeoVRML tilesets
-to combine with other GeoVRML content that contain viewpoints
-then you may want to not have these 'home' viewpoints.
-Specify -noview to not include a GeoViewpoint with each tile.
-<P>
-<DT><B>-newimage</B>
-
-<DD>
-<I>type|file</I>
-<BR>
-
-By default an orthorectified image for the bathymetry is created by running
-<A HREF="mbm_grdtiff.html">mbm_grdtiff</A>(1) and then quadrupling the image size using ImageMagick
-mogrify(1). (The quadrupling together with the '-numpixels 16'
-argument in the make_geovrml(1) command results in identical resolution
-of the highest level GeoVRML tiles and the original bathymetric
-data.)  Making this image can be a time consuming process.  By default,
-if a file with '.tif' appended to <I>bath_file</I> (without the .grd
-extension) or appended to <I>basename</I> (if <I>-basename</I> option
-is specified) exists in $TMPDIR then
-a new image is not created.  To override this either remove the .tif
-file or specify the -newimage option.
-<P>
-<BR>
-
-<I>type|file</I> is the type used in the -G option of <A HREF="mbm_grdtiff.html">mbm_grdtiff</A>(1)
-or the name of a TIFF file that you wish draped over the bathymetry.
-<P>
-The default type value is 2 for synthetic illumination with Haxby color
-map (this may be modified with the <B>-pallette</B> option). Use 5 to shade
-the image by slope value.
-If <type|file> is an image file name then that file is assumed to be
-orthorectified TIFF image (ending in .tif) that is co-registered
-with the bathymetry file.
-This can be used to for example drape a side-scan sonar image
-over the elevation data.
-It is up to the user to confirm the co-registration between the terrain
-data and the image data.
-<P>
-<DT><B>-white</B>
-
-<DD>
-<BR>
-
-By default a black background is generated for the orthorectified
-image.  If a white background is desired (for example, for printing purposes)
-then use this option.  Typically, for computer visual display a black
-background works best.
-<P>
-<DT><B>-zmax</B>
-
-<DD>
-<I>maxclip</I>
-<DT><B>-zmin</B>
-
-<DD>
-<I>minclip</I>
-<P>
-Maxclip and minclip may be used clip the elevation data at set
-values.  For instance, to clip the elevation data at sealevel
-and tile only bathymetry use <B>-zmax 0</B>.  To force a color map
-of the standard Haxby colors between 4000 and 3000 meters
-depth use <B>-zmin -4000 -zmax -3000</B>.
-<P>
-<DT><B>-pallette</B>
-
-<DD>
-<I>pal</I>
-<P>
-The number of Color Lookup Table
-that is passed on to the -W1/ option of <A HREF="mbm_grdtiff.html">mbm_grdtiff</A>(1).
-The default value is 1 - the Haxby color map.  For reference, the
-color tables values are:
-<BR>        <I>pallette</I> = 1:     Haxby colors [default]
-<BR>        <I>pallette</I> = 2:     high Intensity colors
-<BR>        <I>pallette</I> = 3:     low Intensity colors
-<BR>        <I>pallette</I> = 4:     grayscale
-<BR>        <I>pallette</I> = 5:     uniform grayscale
-<BR>
-
-<P>
-<P>
-</DL>
-<A NAME="lbAI"> </A>
-<H2>ENVIRONMENT VARIABLE AND LOG FILE</H2>
-
-<P>
-The environment variable TMPDIR must be defined.  It specifies the
-directory in which <B>mbm_grd2geovrml</B> does its work.  $TMPDIR should
-have sufficient space to hold the temporary grid and image
-files that get created.  The resulting 4 times magnified tiff
-images are left in $TMPDIR.  These large image files are reused unless
-the <B>-newimage</B> option is specified.
-<P>
-A log file is saved at the end of processing in the <I>vrmlparent</I>
-directory.  It includes all the commands and their output.  This
-file may be edited and executed again in order to produce customized
-output.
-<P>
-<A NAME="lbAJ"> </A>
-<H2>EXAMPLES</H2>
-
-This example creates a GeoVRML set of terrain tiles from the bathymetry
-data in file PapauA_bath.grd.  The geometry
-files will not be compressed and viewpoints will be included with each
-tile.
-<BR>
-
-<P>
-<BR>
-
-<BR>  mbm_grd2geovrml PapauA_bath \
-<BR>    -olat 21 -olon -157 \
-<BR>    -tvdir ~/TileSets/Pyramids/hawaii \
-<BR>    -vrmldir ~/TileSets/geoVRML/hawaii \
-<BR>    -nowrz -vrmlurl \
-<BR>    <A HREF="http://menard/vrml/terrain/hawaii/PapauA_bath">http://menard/vrml/terrain/hawaii/PapauA_bath</A>
-<BR>
-
-<P>
-<BR>
-
-<P>
-<BR>
-
-This example creates a grid file of the Northeast Pacific
-at one minute resolution and creates the GeoVRML tiles of it
-with the elevations clipped at sea level.  A new synthetic
-illuminated Haxby-colored image is generated from the elevation data.
-<BR>
-
-<P>
-<BR>
-
-<BR>  # Extract 1 minute data for Northeastern Pacific Ocean
-<BR>  # and convert it to GeoVRML terrain
-<BR>  #
-<BR>  grdraster 4 -R-165/-105/15/50\
-<BR>        -GNEPacific.grd \
-<BR>        -I1m -V
-<P>
-<BR>  mbm_grd2geovrml NEPacific.grd \
-<BR>    -tvdir ~/TileSets/Pyramids/pacific \
-<BR>    -vrmldir ~/TileSets/geoVRML/pacific  \
-<BR>    -vrmlurl \
-<BR>    <A HREF="http://menard/vrml/terrain/hawaii/NEPacific">http://menard/vrml/terrain/hawaii/NEPacific</A> \
-<BR>    -zmax 0 -olat 35 -olon -135 -newimage
-<BR>
-
-<P>
-<BR>
-
-<P>
-<BR>
-
-This example generates a slope-shaded image from the bathymetry
-data in PapauA_bath.grd and saves the geoVRML file in the directory
-~/TileSets/geoVRML/hawaii/PapauA_slope.  No viewpoints are specified.
-<BR>
-
-<P>
-<BR>
-
-<P>
-<BR>  mbm_grd2geovrml PapauA_bath \
-<BR>      -olat 21 -olon -157 \
-<BR>      -tvdir ~/TileSets/Pyramids/hawaii \
-<BR>      -vrmldir ~/TileSets/geoVRML/hawaii \
-<BR>      -vrmlurl \
-<BR>      <A HREF="http://menard/vrml/terrain/hawaii/PapauA_slope">http://menard/vrml/terrain/hawaii/PapauA_slope</A> \
-<BR>      -noview \
-<BR>      -newimage 5 \
-<BR>      -basename PapauA_slope
-<P>
-<BR>
-
-<P>
-<BR>
-
-<P>
-<BR>
-
-This example uses a pre-generated side-scan sonar TIFF image and drapes
-it over the bathymetry data in PapauA_bath.grd.  Viewpoints are excluded.
-Ouptut is written to ~/TileSets/geoVRML/hawaii/PapauA_ssdtl.
-<BR>
-
-<P>
-<BR>
-
-<P>
-<BR>  mbm_grd2geovrml PapauA_bath \
-<BR>      -olat 21 -olon -157 \
-<BR>      -tvdir ~/TileSets/Pyramids/hawaii \
-<BR>      -vrmldir ~/TileSets/geoVRML/hawaii \
-<BR>      -vrmlurl \
-<BR>      <A HREF="http://menard/vrml/terrain/hawaii/PapauA_ssdtl">http://menard/vrml/terrain/hawaii/PapauA_ssdtl</A> \
-<BR>      -noview \
-<BR>      -newimage PapauA_ssdtl.tif \
-<BR>      -basename PapauA_ssdtl
-<P>
-<P>
-<P>
-<P>
-<A NAME="lbAK"> </A>
-<H2>SEE ALSO</H2>
-
-<P>
-This macro is built upon some pretty strong shoulders.  It uses
-all of these programs which must be installed on your system.
-<P>
-GMT programs:
-<B>grdclip</B>(1),
-<B>grdsample</B>(1),
-<B>grd2xyz</B>(1),
-<B>blockmean</B>(1),
-<B>surface</B>(1),
-<B>grdedit</B>(1),
-<B>grdmath</B>(1),
-<B>grdclip</B>(1),
-<P>
-mb-system macro:
-<B><A HREF="mbm_grdtiff.html">mbm_grdtiff</A></B>(1)
-<P>
-mb-system utility:
-<B><A HREF="mbstripNaN.html">mbstripNaN</A></B>(1)
-<P>
-tsmApi-2.3 (<A HREF="http://www.tsmapi.com)">http://www.tsmapi.com)</A> programs:
-<B>make_dem</B>(1),
-<B>make_oi</B>(1)
-<B>make_geovrml</B>(1)
-<P>
-Note that after you've created the TerraVision tile sets with this
-macro you may rerun make_geovrml(1) with different options, for
-instance to make files for a different server or with a different
-vertical exaggeration or background color.  This can save a lot
-of processing time if you don't need to generate a new image
-from the bathymetric data.
-<P>
-ImageMagick (<A HREF="http://www.imagemagick.org)">http://www.imagemagick.org)</A> program:
-<B>mogrify</B>(1)
-<P>
-<BR>
-
-Please see <A HREF="http://www.mbari.org/~mccann/vrml/ROVDataVis">http://www.mbari.org/~mccann/vrml/ROVDataVis</A>
-for example content and more information on the project that developed this
-macro.
-<A NAME="lbAL"> </A>
-<H2>BUGS</H2>
-
-<P>
-You need to manually clean up the leftover files that get created in $TMPDIR.
-<BR>
-
-<P>
-<BR>
-
-The <B>-vrmlurl</B> option must be specified.  As of 19 March 2003 there is a
-bug in <B>make_geovrml</B>(1) where if the <B>-vrmlurl</B> option  is not
-specified invalid VRML is
-generated.  This is generally not a problem.  Because of bugs in VRML browsers
-all URLs must be absolute anyway.
-<BR>
-
-<P>
-<BR>
-
-The GeoVRML content produced by this macro may be
-viewed using Internet Explorer
-with the Cortona 4.0 VRML plugin or in Netscape 4.7 with the CosmoPlayer
-plugin.  Both browsers have problems with loading a second world after
-you have viewed one.  Netscape 4.7 often must be closed by killing it
-with Windows Task Manager.  Sometimes the CosmoPlayer plugin will refuse
-to load at all.  If this happens try removing all cp* files in %TEMP% or
-logging in with another Windows account so that a different profile is used.
-<P>
-
-<HR>
-<A NAME="index"> </A><H2>Index</H2>
-<DL>
-<DT><A HREF="#lbAB">NAME</A><DD>
-<DT><A HREF="#lbAC">VERSION</A><DD>
-<DT><A HREF="#lbAD">SYNOPSIS</A><DD>
-<DT><A HREF="#lbAE">DESCRIPTION</A><DD>
-<DT><A HREF="#lbAF">AUTHORSHIP</A><DD>
-<DT><A HREF="#lbAG">SIMPLE DESCRIPTION OF BASIC OPTIONS</A><DD>
-<DT><A HREF="#lbAH">DESCRIPTION OF OPTIONAL OPTIONS</A><DD>
-<DT><A HREF="#lbAI">ENVIRONMENT VARIABLE AND LOG FILE</A><DD>
-<DT><A HREF="#lbAJ">EXAMPLES</A><DD>
-<DT><A HREF="#lbAK">SEE ALSO</A><DD>
-<DT><A HREF="#lbAL">BUGS</A><DD>
-</DL>
-<HR>
-</PRE>
-
-<CENTER><P><BR>
-Last Updated: 3 June 2013</P></CENTER>
-
-<HR>
-<P><A HREF="mbsystem_man_list.html">Return to list of MB-System manual pages...</A></P>
-<P><A HREF="mbsystem_home.html"><IMG SRC="mbsystem_logo_small.gif" BORDER=0 HEIGHT=55 WIDTH=158 ALIGN=BOTTOM></A><A HREF="mbsystem_home.html">Back
-to MB-System Home Page...</A></P>
-
-</BODY>
-</HTML>
diff --git a/src/html/mbm_grd3dplot.html b/src/html/mbm_grd3dplot.html
deleted file mode 100644
index eed9421..0000000
--- a/src/html/mbm_grd3dplot.html
+++ /dev/null
@@ -1,1146 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<HTML VERSION="2.0">
-<HEAD>
-   <TITLE>MB-System Unix Manual Page: mbm_grd3dplot</TITLE>
-<!-- WEBMAGIC VERSION NUMBER="2.0.2" -->
-<!-- WEBMAGIC TRANSLATION NAME="ServerRoot" SRC="/var/www/htdocs/" DST="/" -->
-<!-- WEBMAGIC TRANSLATION NAME="ProjectRoot" SRC="./" DST="" -->
-</HEAD>
-<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#336699" VLINK="#997040" ALINK="#CC9900">
-<BODY>
-<CENTER><H3><U>MB-System Unix Manual Page</U></H3></CENTER>
-<PRE>
-<H1>mbm_grd3dplot</H1>
-Section:  MB-System 5.0  (1)<BR>Updated:  9 January 2015 <BR><A HREF="#index">Index</A>
-<HR>
-
-<A NAME="lbAB"> </A>
-<H2>NAME</H2>
-
-<B>mbm_grd3dplot</B> - Create an executable shellscript which will generate
-a GMT 3D perspective plot of gridded data in a GMT grd file.
-<P>
-<A NAME="lbAC"> </A>
-<H2>VERSION</H2>
-
-Version 5.0
-<P>
-<A NAME="lbAD"> </A>
-<H2>SYNOPSIS</H2>
-
-<B>mbm_grd3dplot</B> <B>-I</B><I>file</I>
-[<B>-A</B>[<I>magnitude</I>[<I>/azimuth/elevation</I>]
-<B>-D</B>[<I>flipcolor/flipshade</I>]
-<B>-E</B>[<I>view_az/view_el</I>] <B>-F</B><I>exaggeration</I>
-<B>-G</B><I>color_mode</I> <B>-H</B> <B>-K</B><I>intensity_file </I>
-<B>-N</B><I>drape_file</I>
-<B>-O</B><I>root</I> <B>-P</B><I>pagesize </I>
-<B>-S</B><I>[color/shade]</I> <B>-U</B><I>orientation</I> <B>-V</B>
-<B>-W</B>[<I>color_style</I>[<I>/palette</I>[<I>ncolors</I>]] | <I>cptfile</I>] ]
-<P>
-Additional Options:
-<BR>
-
-[<B>-B</B><I>tickinfo</I>
-<B>-J</B><I>projection</I>[<I>/scale | width</I>]
-<B>-L</B><I>title</I>[<I>:scale_label</I>] <B>-M</B><I>misc</I>
-<B>-Q</B> <B>-R</B><I>w/e/s/n</I> <B>-X</B> <B>-Y</B>
-<B>-Z</B><I>min/max</I> ]
-<P>
-Miscellaneous Options:
-<BR>
-
-[<B>-MGD</B><I>gmtdef/value</I>  <B>-MGF</B><I>scale_loc</I>
-<B>-MGL</B>[<I>f</I>][<I>x</I>]<I>lon0/lat0/slat/length</I>[<I>units</I>][<I>+llabel</I>]
-<B>-MGQ</B><I>dpi</I> <B>-MGS</B><I>scalefactor</I>
-<B>-MGT</B><I>x/y/size/angle/font/just/text</I>
-<B>-MGU</B>[<I>/dx/dy/</I>][<I>label</I>]
-<B>-MVM</B><I>mesh_pen</I> <B>-MVN</B>[<I>null[/r/g/b]</I>] ]
-<P>
-<A NAME="lbAE"> </A>
-<H2>DESCRIPTION</H2>
-
-<B>mbm_grd3dplot</B> is a macro to generate a shellscript of GMT commands which, when
-executed, will generate a 3D perspective Postscript plot of
-gridded data.  Several styles of plots can be generated,
-including color fill views, color shaded relief views, mesh
-plot views, and text labels. Five different color schemes are
-included. The plot will be scaled to fit on the specified page
-size or, if the scale is user defined, the page size will be
-chosen in accordance with the plot size. The vertical exaggeration
-may be specified. The primary purpose
-of this macro is to allow the simple, semi-automated
-production of nice looking maps with a few command line
-arguments. For users seeking more control over the plot
-appearance, a number of additional optional arguments are
-provided. Truly ambitious users may edit the plot shellscript
-to take advantage of GMT capabilities not supported by this
-macro.
-<P>
-By default the output plot generation shellscript
-includes lines which execute a program to display the Postscript
-image on the screen. The program to be used to display the Postscript
-is set using <B>mbdefaults</B>; the default value can be overridden
-by setting the environment variable $MB_PS_VIEWER.
-Invoking the plot generation shellscript with
-a <B>-N</B> command line argument suppresses the screen
-display of the plot.
-<P>
-The plot scripts generated by this macro will work with
-GMT version 5.0 and later, and are not compatible with
-earlier versions of GMT.
-<P>
-<A NAME="lbAF"> </A>
-<H2>AUTHORSHIP</H2>
-
-David W. Caress (<A HREF="mailto:caress at mbari.org">caress at mbari.org</A>)
-<BR>
-
-<BR>  Monterey Bay Aquarium Research Institute
-<BR>
-
-Dale N. Chayes (<A HREF="mailto:dale at ldeo.columbia.edu">dale at ldeo.columbia.edu</A>)
-<BR>
-
-<BR>  Lamont-Doherty Earth Observatory
-<P>
-<A NAME="lbAG"> </A>
-<H2>SIMPLE DESCRIPTION OF BASIC OPTIONS</H2>
-
-<DL COMPACT>
-<DT><B>-A</B>
-
-<DD>
-<I>magnitude[/azimuth/elevation]</I>
-<BR>
-
-Sets the parameters which control the
-synthetic illumination of the gridded data (shaded relief).
-The value <I>magnitude</I>
-is an effective vertical exageration which modulates the intensity of
-the shading; typical values are in the 0.1 to 10 range.
-The value <I>azimuth</I>
-is the azimuth in degrees from north from which the data is illuminated.
-The value <I>elevation</I> is the elevation of the illumination
-in degrees from horizontal.
-Defaults: <I>magnitude</I> = 0.2; <I>azimuth</I> = 0.0;
-<I>elevation</I> = 30.0;
-<DT><B>-D</B>
-
-<DD>
-<I>[flipcolor/flipshade]</I>
-<BR>
-
-Normally, the color or grayscale tables used for color maps run from
-cool colors (or dark grays) for low grid values
-to hot colors (or light grays) for high grid values.
-This option reverses the color table so that cool colors (dark grays)
-correspond to high values and hot colors (light grays) to low values.
-If <B>-D</B> is given alone, it applies to the color table used
-for color or gray fill plots,  shaded or unshaded. If the plot
-is to be shaded,  either by synthetic illumination (<B>-G</B><I>2</I>)
-or using an intensity file (<B>-K</B> and <B>-G</B><I>3</I> options), then
-setting <I>flipshade</I> = 1 will cause the shading convention
-to be reversed (e.g. high intensities overlaid as light shading).
-Using <B>-D</B><I>0/1</I> will flip the shading convention
-but leave the default color convention.
-<DT><B>-E</B>
-
-<DD>
-[<I>view_az/view_el</I>]
-<BR>
-
-Sets the azimuth and elevation in degrees of the
-viewpoint for 3D perspective views.  An <I>view_az</I> of 0
-represents a view from the north, and <I>view_az</I> = 90
-represents a view from the east.  An <I>view_el</I> of 0
-represents a horizontal view.  Default: <I>view_az</I> = 200.;
-elevation = 40.
-<DT><B>-F</B>
-
-<DD>
-[<I>exaggeration</I>]
-<BR>
-
-Sets the vertical exaggeration of the perspective plot.
-By default the vertical exaggeration is chosen so that the
-plot fits nicely on the page. This option works only if the
-data are in geographic coordinates (longitude and latitude).
-<DT><B>-G</B>
-
-<DD>
-<I>color_mode</I>
-<BR>
-
-Turns on color fill plot and sets the style of the plot.
-<BR>
-
-<BR>        <I>color_mode</I> = 1: 3D color/gray fill.
-<BR>        <I>color_mode</I> = 2: 3D color/gray fill shaded by
-<BR>                        synthetic illumination.
-<BR>        <I>color_mode</I> = 3: 3D color/gray fill shaded by
-<BR>                        an intensity file. The <B>-K</B>
-<BR>                        option must be used to specify
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT>the intensity file.<BR>
-<BR>        <I>color_mode</I> = 4: 3D Color/gray fill of slope
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT>magnitude.<BR>
-<BR>        <I>color_mode</I> = 5: 3D Color/gray fill shaded by
-<BR>                        slope magnitude.
-<BR>        <I>color_mode</I> = 6: 3D mesh plot.
-<BR>        <I>color_mode</I> = 7: 3D mesh plot with contours.
-<DT><B>-H</B>
-
-<DD>
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-<DT><B>-I</B>
-
-<DD>
-<I>grdfile</I>
-<BR>
-
-Sets the name of the gridded data file to be plotted.
-Alternatively, <I>grdfile</I> may be a list of grid files
-(one filename on each line) to be plotted together.
-<DT><B>-K</B>
-
-<DD>
-<I>intensity_file</I>
-<BR>
-
-Sets the name of the gridded data file containing
-instensity values to be used for shading the map.
-<DT><B>-N</B>
-
-<DD>
-<I>drape_file</I>
-<BR>
-
-Sets the name of the gridded data file to be draped on
-the relief provided by the file specified with the <B>-I</B>
-option. If <B>-N</B><I>drape_file</I> is specified, then
-all color control options will apply to the data in
-\fIdrape_file.
-<DT><B>-O</B>
-
-<DD>
-<I>root</I>
-<BR>
-
-Sets the root used to construct the filename of the output shellscript
-(<I>root</I>.cmd) and names of files created when the shellscript is
-run.  Normally the
-name of the input grid file or grid file list is
-used as the <I>root</I>.
-<DT><B>-P</B>
-
-<DD>
-<I>pagesize</I>
-<BR>
-
-This option sets the size of the page the plot will be centered
-on. If the user does not set the plot scale, the plot will be
-sized as large as will fit on the designated page. If the user
-sets the plot scale such that the plot will not fit on the
-designated page, a larger page will be used.
-The supported page sizes include ANSI A, B, C, D, E,
-F, and E1, as well as most metric page sizes. See the
-COMPLETE DESCRIPTION OF OPTIONS section
-below for a complete list of
-the supported page sizes. The default page size is A.
-<DT><B>-S</B>
-
-<DD>
-<I>[color/shade]</I>
-<BR>
-
-This option enables effective histogram equalization of the
-color and/or shading of the gridded data. The equalization is
-not achieved by changing the data values, but rather by
-constructing the color or shading tables so that
-the boundaries in the tables encompass equal fractions of
-the datapoints. This serves to focus color or shading contrasts
-in value ranges corresponding to the bulk of the data values.
-If <B>-S</B> is given alone or with <I>color</I> = 1,
-it enables equalization of the color table used
-for color or gray fill plots,  shaded or unshaded. If the plot
-is to be shaded,  either by synthetic illumination (<B>-G</B><I>2</I>)
-or using an intensity file (<B>-K</B> and <B>-G</B><I>3</I> options), then
-setting <I>shade</I> = 1 will cause the shading to be equalized.
-Using <B>-S</B><I>0/1</I> will equalize the shading without
-equalizing the color table.
-<DT><B>-U</B>
-
-<DD>
-<I>orientation</I>
-<BR>
-
-Normally the orientation of the plot (portrait or landscape)
-is selected automatically so as to maximize the plot scale.
-The <B>-U</B> option allows the user to set the plot orientation. If
-<I>orientation</I> = 1, a portrait plot will be produced; if
-<I>orientation</I> = 2, a landscape plot will be produced.
-<DT><B>-V</B>
-
-<DD>
-Causes <B>mbm_grd3dplot</B> to operate in "verbose" mode
-so that it outputs
-more information than usual.
-<DT><B>-W</B>
-
-<DD>
-<I>[color_style</I>[<I>/palette</I>[<I>ncolors</I>]] | cptfile]
-<BR>
-
-This option controls the color scheme used for color
-fill plots.
-<P>
-If <I>color_style</I> = 1 [default], then
-the color scheme used will be a continuous grading
-of colors. If <I>color_style</I> = 2, the color scheme
-will be a set of discrete color intervals. The color
-palette used is set using <I>palette</I>. Five palettes
-are available:
-<BR> <TT>       </TT><I>palette</I> = 1:<TT>    </TT>Haxby colors [default]<BR>
-<BR> <TT>       </TT><I>palette</I> = 2:<TT>    </TT>high Intensity colors<BR>
-<BR> <TT>       </TT><I>palette</I> = 3:<TT>    </TT>low Intensity colors<BR>
-<BR> <TT>       </TT><I>palette</I> = 4:<TT>    </TT>grayscale<BR>
-<BR> <TT>       </TT><I>palette</I> = 5:<TT>    </TT>uniform grayscale<BR>
-<BR>
-
-A complete description of the color palettes is given
-in the COMPLETE DESCRIPTION OF OPTIONS section below.
-<BR>
-
-The <I>ncolors</I> parameter sets the number of color
-values used in plotting, whether the colors are
-represented in a continuous color scale or a
-stepped, discrete color scale [default is 11].
-<P>
-If the option argument is the path to an existing <B>GMT</B>
-color palette (CPT) file, then that CPT file and its
-color scheme will be used for the plot
-<P>
-</DL>
-<A NAME="lbAH"> </A>
-<H2>COMPLETE DESCRIPTION OF OPTIONS</H2>
-
-<DL COMPACT>
-<DT><B>-A</B>
-
-<DD>
-<I>magnitude[/azimuth]</I>
-<BR>
-
-Sets the parameters which control the
-synthetic illumination of the gridded data (shaded relief).
-The value <I>magnitude</I>
-is an effective vertical exageration which modulates the intensity of
-the shading; typical values are in the 0.1 to 0.5 range.
-The value <I>azimuth</I>
-is the azimuth from which the data is illuminated.
-Defaults: <I>magnitude</I> = 0.2; <I>azimuth</I> = 0.0;
-<DT><B>-B</B>
-
-<DD>
-<I>tickinfo</I>
-<BR>
-
-Sets map boundary tickmark intervals. See the <B>psbasemap</B>
-manual page for details. By default the program chooses
-basemap annotations based on the map boundaries.
-<DT><B>-D</B>
-
-<DD>
-<I>[flipcolor/flipshade]</I>
-<BR>
-
-Normally, the color or grayscale tables used for color maps run from
-cool colors (or dark grays) for low grid values
-to hot colors (or light grays) for high grid values.
-This option reverses the color table so that cool colors (dark grays)
-correspond to high values and hot colors (light grays) to low values.
-If <B>-D</B> is given alone, it applies to the color table used
-for color or gray fill plots,  shaded or unshaded. If the plot
-is to be shaded,  either by synthetic illumination (<B>-G</B><I>2</I>)
-or using an intensity file (<B>-K</B> and <B>-G</B><I>3</I> options), then
-setting <I>flipshade</I> = 1 will cause the shading convention
-to be reversed (e.g. high intensities overlaid as light shading).
-Using <B>-D</B><I>0/1</I> will flip the shading convention
-but leave the default color convention.
-<DT><B>-E</B>
-
-<DD>
-[<I>view_az/view_el</I>]
-<BR>
-
-Sets the azimuth and elevation in degrees of the
-viewpoint for 3D perspective views.  An <I>view_az</I> of 0
-represents a view from the north, and <I>view_az</I> = 90
-represents a view from the east.  An <I>view_el</I> of 0
-represents a horizontal view.  Default: <I>view_az</I> = 200.;
-elevation = 40.
-<DT><B>-G</B>
-
-<DD>
-<I>color_mode</I>
-<BR>
-
-Turns on color fill plot and sets the style of the plot.
-<BR>
-
-<BR>        <I>color_mode</I> = 1: 3D color/gray fill.
-<BR>        <I>color_mode</I> = 2: 3D color/gray fill shaded by
-<BR>                        synthetic illumination.
-<BR>        <I>color_mode</I> = 3: 3D color/gray fill shaded by
-<BR>                        an intensity file. The <B>-K</B>
-<BR>                        option must be used to specify
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT>the intensity file.<BR>
-<BR>        <I>color_mode</I> = 4: 3D Color/gray fill of slope
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT>magnitude.<BR>
-<BR>        <I>color_mode</I> = 5: 3D Color/gray fill shaded by
-<BR>                        slope magnitude.
-<BR>        <I>color_mode</I> = 6: 3D mesh plot.
-<BR>        <I>color_mode</I> = 7: 3D mesh plot with contours.
-<BR>
-
-See the <B>grdimage</B> manual page for information on shading
-with intensity files
-<DT><B>-H</B>
-
-<DD>
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-<DT><B>-I</B>
-
-<DD>
-<I>grdfile</I>
-<BR>
-
-Sets the name of the gridded data file to be plotted.
-The data must be in a form acceptable to <B>GMT</B> version 3
-programs (see the <B>GMT</B> Cookbook & Technical Reference).
-<DT><B>-J</B>
-
-<DD>
-<I>projection</I>[<I>/scale | /width</I>]
-<BR>
-
-Selects the map projection. By default the map projection is
-Mercator and the plot scale is chosen to fit on the selected
-page size (see <B>-P</B> option). The user may specify a
-different projection to be used, in which case the plot scale
-is still automatically chosen to fit the page. The user may
-also specify both the projection and the plot scale. If
-the projection specifying character is upper case, a plot
-width rather than a plot scale is used.
-The scale values are specified in inch/degree or in 1:xxxxx
-ratios. Plot widths are specified in inches. If the user
-specifies a plot scale such that the plot will not fit
-on the default A size page, a appropriately larger page
-size will be chosen.
-<BR>
-
-<P>
-<B>CYLINDRICAL PROJECTIONS:</B>
-<BR>
-
-<P>
-<B>-Jc</B><I>lon0/lat0/scale</I> (Cassini)
-<BR>
-
-<B>-Jm</B><I>scale</I> (Mercator)
-<BR>
-
-<B>-Joa</B><I>lon0/lat0/azimuth/scale</I> (Oblique Mercator - point and azimuth)
-<BR>
-
-<B>-Job</B><I>lon0/lat0/lon1/lat1/scale</I> (Oblique Mercator - two points)
-<BR>
-
-<B>-Joc</B><I>lon0/lat0/lonp/latp/scale</I> (Oblique Mercator - point and pole)
-<BR>
-
-<B>-Jq</B><I>lon0/scale</I> (Equidistant Cylindrical Projection (Plate Carree))
-<BR>
-
-<B>-Jt</B><I>lon0/scale</I> (TM - Transverse Mercator)
-<BR>
-
-<B>-Ju</B><I>zone/scale</I> (UTM - Universal Transverse Mercator)
-<BR>
-
-<B>-Jy</B><I>lon0/lats/scale</I> (Basic Cylindrical Projection)
-<BR>
-
-<P>
-<B>AZIMUTHAL PROJECTIONS:</B>
-<BR>
-
-<P>
-<B>-Ja</B><I>lon0/lat0/scale</I> (Lambert).
-<BR>
-
-<B>-Je</B><I>lon0/lat0/scale</I> (Equidistant).
-<BR>
-
-<B>-Jg</B><I>lon0/lat0/scale</I> (Orthographic).
-<BR>
-
-<B>-Js</B><I>lon0/lat0/scale</I> (General Stereographic)
-<BR>
-
-<P>
-<B>CONIC PROJECTIONS:</B>
-<BR>
-
-<P>
-<B>-Jb</B><I>lon0/lat0/lat1/lat2/scale</I> (Albers)
-<BR>
-
-<B>-Jl</B><I>lon0/lat0/lat1/lat2/scale</I> (Lambert)
-<BR>
-
-<P>
-<B>MISCELLANEOUS PROJECTIONS:</B>
-<BR>
-
-<P>
-<B>-Jh</B><I>lon0/scale</I> (Hammer)
-<BR>
-
-<B>-Ji</B><I>lon0/scale</I> (Sinusoidal)
-<BR>
-
-<B>-Jk</B><I>lon0/scale</I> (Eckert VI)
-<BR>
-
-<B>-Jn</B><I>lon0/scale</I> (Robinson)
-<BR>
-
-<B>-Jr</B><I>lon0/scale</I> (Winkel Tripel)
-<BR>
-
-<B>-Jw</B><I>lon0/scale</I> (Mollweide)
-<BR>
-
-<P>
-<B>NON-GEOGRAPHICAL PROJECTIONS:</B>
-<BR>
-
-<P>
-<B>-Jp</B><I>scale</I> (Linear projection for polar (theta,r) coordinates)
-<BR>
-
-<B>-Jx</B><I>x-scale</I>[<B>l|p</B><I>pow</I>][<I>/y-scale</I>[<B>l|p</B><I>pow</I>]] (Linear, log, and power scaling)
-<BR>
-
-More details can be found in the <B>psbasemap</B> manpages.
-<DT><B>-K</B>
-
-<DD>
-<I>intensity_file</I>
-<BR>
-
-Sets the name of the gridded data file containing
-instensity values to be used for shading the map.
-<DT><B>-L</B>
-
-<DD>
-<I>title:scalelabel</I>
-<BR>
-
-Sets the title and the label for the colorscale (if used) of
-the plot. Note that a colon (:) rather than a slash (/) is
-used to separate the labels. Colons cannot be used in the
-labels themselves. If this option is not used, then a default title
-and colorscale label are provided. If the title is supplied
-alone, a default colorscale label will be provided. To force
-no title use <B>-L</B>" "; to force no title or colorscale
-label use <B>-L</B>" : ".
-<DT><B>-M</B>
-
-<DD>
-A series of "miscellaneous" options are provided which are
-given as <B>-M</B> followed by a two character identifier, followed
-by any other parameters associated with that option.
-The <B>-M</B> options may be strung together separated by
-colons, e.g. "-MGQ100:GU", which is equivalent to
-"-MGQ -MGU".
-<DT><B>-N</B>
-
-<DD>
-<I>drape_file</I>
-<BR>
-
-Sets the name of the gridded data file to be draped on
-the relief provided by the file specified with the <B>-I</B>
-option. If <B>-N</B><I>drape_file</I> is specified, then
-all color control options will apply to the data in
-\fIdrape_file.
-<DT><B>-MGD</B>
-
-<DD>
-<I>gmtdef/value</I>
-<BR>
-
-Allows the user to set the <B>GMT</B> default values used as
-the plot is constructed. This command may be given repeatedly
-to set as many <B>GMT</B> defaults as required. For example, to
-set the basemap annotation font to Courier, use
-"-MGDANOT_FONT/Courier".
-<DT><B>-MGF</B>
-
-<DD>
-<I>scale_loc</I>
-<BR>
-
-Sets the location of the color scale. The possible values
-of <I>scale_loc</I> are:
-<BR> <TT>       </TT><I>scale_loc</I> = b:<TT>  </TT>bottom of plot<BR>
-<BR> <TT>       </TT><I>scale_loc</I> = t:<TT>  </TT>top of plot<BR>
-<BR> <TT>       </TT><I>scale_loc</I> = l:<TT>  </TT>left of plot<BR>
-<BR> <TT>       </TT><I>scale_loc</I> = r:<TT>  </TT>right of plot<BR>
-<BR>
-
-[Default <I>scale_loc</I> = b]
-<DT><B>-MGL</B>
-
-<DD>
-[<I>f</I>][<I>x</I>]<I>lon0/lat0/slat/length</I>[<I>units</I>][<I>+llabel</I>]
-<BR>
-
-Draws a simple map scale centered on <I>lon0/lat0</I>.
-Use <B>-Lf</B> to get a "fancy" scale [Default is plain].
-Use <B>-Lx</B> to specify the position in inches instead of map units.
-The scale is calculated at latitude <I>slat</I>; if the string "center" is used
-instead of a numerical value for <I>slat</I>, then the macro will set
-the scaling according to the center of the plot bounds.
-The scale length value <I>length</I> is in km 
-by default, but the units can be specified as one of e|f|k|M|n|u, where
-e = meters, f = feet, k = kilometers, M = statue miles, n = nautical miles,
-and u = US survey feet. Append <I>+l</I> to label the scale with the
-relevant units, or append <I>+l"label"</I> to set a different label string.
-<DT><B>-MGQ</B>
-
-<DD>
-<I>dpi</I>
-<BR>
-
-Sets the resolution in dots per inch of the raster image used
-for color fill maps. Larger values of <I>dpi</I> produce larger
-Postscript plot files. [Default is 100].
-<DT><B>-MGS</B>
-
-<DD>
-<I>scalefactor</I>
-<BR>
-
-The gridded data is multiplied by <I>scalefactor</I>.
-This option is most often used flip the sign of the
-data (<I>scalefactor</I> = -1). [Default no scaling]
-<DT><B>-MGT</B>
-
-<DD>
-<I>x/y/size/angle/font/just/text</I>
-<BR>
-
-Causes a text label to plotted on the map.
-<I>size</I> is text size in points, <I>angle</I> is
-measured in degrees counter-clockwise from horizontal,
-<I>fontno</I> sets the font type, <I>justify</I> sets the alignment.
-If <I>fontno</I> starts with a leading hyphen, then
-the remainder of <I>fontno</I> is taken to be a
-textstring with the desired fontname.  See the
-<B>gmtdefaults</B> man page for names and numbers of available fonts
-(or run <B>pstext -L</B>).  The alignment
-number refers to the part of the textstring that will be mapped
-onto the (<I>x,y</I>) point: 1 = Lower Left corner,
-2 = Lower Center, 3 = Lower Right, 5 = Mid Left, 6 = Mid Center,
-7 = Mid Right, 9 = Upper Left, 10 = Upper Center,
-11 = Upper Right. This option may be given as many times as
-needed.
-<DT><B>-MGU</B>
-
-<DD>
-[<I>/dx/dy/</I>][<I>label</I>]
-<BR>
-
-Draw Unix System time stamp on plot.  User may specify where the lower left corner
-of the stamp should fall on the page relative to lower left corner of plot in inch [Default is (-0.75,-0.75)].  Optionally,
-append a label, or <B>c</B> (which will plot the command string.)
-<DT><B>-MVM</B>
-
-<DD>
-<I>mesh_pen</I>
-<BR>
-
-Set pen attributes for mesh plot.  The mesh plot must be specified
-with the <B>-G</B> option. See chapter 4.12 in the
-GMT Technical reference for a discussion of GMT pen values.
-[Defaults: width = 1, color = 0/0/0,
-texture = solid].
-<DT><B>-MVN</B>
-
-<DD>
-[<I>null[/r/g/b]</I>]
-<BR>
-
-Draws a plane at the level of the <I>null</I> value (with
-respect to the data in the grid file specified with the <B>-I</B>
-option. If the optional r/g/b is provided,
-the frontal facade between the plane and the data perimeter is
-filled with this color. If <B>-MVN</B> is given by
-itself, then <B>mbm_grd3dplot</B> causes
-the null plane to be drawn at the minimum z-level and the facade
-to be colored a light gray (r=g=b=200).
-<DT><B>-O</B>
-
-<DD>
-<I>root</I>
-<BR>
-
-Sets the root used to construct the filename of the output shellscript
-(<I>root</I>.cmd) and names of files created when the shellscript is
-run.  Normally the
-name of the input grid file or grid file list is
-used as the <I>root</I>.
-<DT><B>-P</B>
-
-<DD>
-<I>pagesize</I>
-<BR>
-
-This option sets the size of the page the plot will be centered
-on. If the user does not set the plot scale, the plot will be
-sized as large as will fit on the designated page. If the user
-sets the plot scale such that the plot will not fit on the
-designated page, a larger page will be used.
-The supported page sizes are:
-<P>
-<BR>          American ANSI sizes:
-<BR>          A     8.5 x 11.0 in.    ( 215.9 x  279.4 mm)
-<BR>          B    11.0 x 17.0 in.    ( 279.4 x  431.8 mm)
-<BR>          C    17.0 x 22.0 in.    ( 431.8 x  558.8 mm)
-<BR>          D    22.0 x 34.0 in.    ( 558.8 x  863.6 mm)
-<BR>          E    34.0 x 44.0 in.    ( 863.6 x 1117.6 mm)
-<BR>          F    28.0 x 40.0 in.    ( 711.2 x 1016.0 mm)
-<BR>          E1   44.0 x 68.0 in.    (1117.6 x 1727.2 mm)
-<P>
-<BR>          Metric ISO A sizes:
-<BR>          A0   841.0 x 1189.0 mm  (33.11 x 46.81 in.)
-<BR>          A1   594.0 x  841.0 mm  (23.39 x 33.11 in.)
-<BR>          A2   420.0 x  594.0 mm  (16.54 x 23.39 in.)
-<BR>          A3   297.0 x  420.0 mm  (11.69 x 16.54 in.)
-<BR>          A4   210.0 x  297.0 mm  ( 8.27 x 11.69 in.)
-<BR>          A5   148.0 x  210.0 mm  ( 5.83 x  8.27 in.)
-<BR>          A6   105.0 x  148.0 mm  ( 4.13 x  5.83 in.)
-<BR>          A7    74.0 x  105.0 mm  ( 2.91 x  4.13 in.)
-<BR>          A8    52.0 x   74.0 mm  ( 2.05 x  2.91 in.)
-<BR>          A9    37.0 x   52.0 mm  ( 1.46 x  2.05 in.)
-<BR>          A10   26.0 x   37.0 mm  ( 1.02 x  1.46 in.)
-<P>
-<BR>          Metric ISO B sizes:
-<BR>          B0   1000.0x 1414.0 mm  (39.37 x 55.67 in.)
-<BR>          B1   707.0 x 1000.0 mm  (27.83 x 39.37 in.)
-<BR>          B2   500.0 x  707.0 mm  (19.68 x 27.83 in.)
-<BR>          B3   353.0 x  500.0 mm  (13.90 x 19.68 in.)
-<BR>          B4   250.0 x  353.0 mm  ( 9.84 x 13.90 in.)
-<BR>          B5   176.0 x  250.0 mm  ( 6.93 x  9.84 in.)
-<BR>          B6   125.0 x  176.0 mm  ( 4.92 x  6.93 in.)
-<BR>          B7    88.0 x  125.0 mm  ( 3.46 x  4.92 in.)
-<BR>          B8    62.0 x   88.0 mm  ( 2.44 x  3.46 in.)
-<BR>          B9    44.0 x   62.0 mm  ( 1.73 x  2.44 in.)
-<BR>          B10   31.0 x   44.0 mm  ( 1.22 x  1.73 in.)
-<P>
-<BR>          Metric ISO C sizes:
-<BR>          C0   914.4 x 1300.5 mm  (36.00 x 51.20 in.)
-<BR>          C1   650.2 x  914.4 mm  (25.60 x 36.00 in.)
-<BR>          C2   457.2 x  650.2 mm  (18.00 x 25.60 in.)
-<BR>          C3   325.1 x  457.2 mm  (12.80 x 18.00 in.)
-<BR>          C4   228.6 x  325.1 mm  ( 9.00 x 12.80 in.)
-<BR>          C5   162.6 x  228.6 mm  ( 6.40 x  9.00 in.)
-<BR>          C6   114.3 x  162.6 mm  ( 4.50 x  6.40 in.)
-<BR>          C7    81.3 x  114.3 mm  ( 3.20 x  4.50 in.)
-<P>
-<TT>        </TT>  MB-System large format sizes:<BR>
-<BR>          m1  1371.6 x 1828.8 mm  (54.00 x 72.00 in.)
-<BR>          m2  1371.6 x 2133.6 mm  (54.00 x 84.00 in.)
-<BR>          m3  1371.6 x 2438.4 mm  (54.00 x 96.00 in.)
-<BR>          m4  1524.0 x 1828.8 mm  (60.00 x 72.00 in.)
-<BR>          m5  1524.0 x 2133.6 mm  (60.00 x 84.00 in.)
-<BR>          m6  1524.0 x 2438.4 mm  (60.00 x 96.00 in.)
-<P>
-The default page size is A.
-<DT><B>-Q</B>
-
-<DD>
-Normally, the output plot generation shellscript
-includes lines which execute
-a program to display the Postscript image on the screen.
-This option causes those lines to be commented out so
-that executing the shellscript produces a Postscript plot
-but does not attempt to display it on the screen.
-Alternatively, invoking the plot generation shellscript with
-a <B>-N</B> command line argument also suppresses the screen
-display of the plot. The program
-to be used to display the Postscript is set
-using <B>mbdefaults</B>;
-the default value can be overridden by setting the environment
-variable $MB_PS_VIEWER.
-<DT><B>-R</B>
-
-<DD>
-<I>west/east/south/north</I>
-<BR>
-
-<I>west, east, south,</I> and <I>north</I> specify the Region of interest.  To specify boundaries
-in degrees and minutes [and seconds], use the dd:mm[:ss] format.  Append <B>r</B> if lower left and upper right
-map coordinates are given instead of wesn.
-You may ask for a larger <I>w/e/s/n</I> region to have more room between the image and the axes.
-A smaller region than specified in the grdfile will result in a subset of the grid [Default is
-region given by the grdfile].
-<DT><B>-S</B>
-
-<DD>
-<I>[color/shade]</I>
-<BR>
-
-This option enables effective histogram equalization of the
-color and/or shading of the gridded data. The equalization is
-not achieved by changing the data values, but rather by
-constructing the color or shading tables so that
-the boundaries in the tables encompass equal fractions of
-the datapoints. This serves to focus color or shading contrasts
-in value ranges corresponding to the bulk of the data values.
-If <B>-S</B> is given alone or with <I>color</I> = 1,
-it enables equalization of the color table used
-for color or gray fill plots,  shaded or unshaded. If the plot
-is to be shaded,  either by synthetic illumination (<B>-G</B><I>2</I>)
-or using an intensity file (<B>-K</B> and <B>-G</B><I>3</I> options), then
-setting <I>shade</I> = 1 will cause the shading to be equalized.
-Using <B>-S</B><I>0/1</I> will equalize the shading without
-equalizing the color table.
-<DT><B>-U</B>
-
-<DD>
-<I>orientation</I>
-<BR>
-
-Normally the orientation of the plot (portrait or landscape)
-is selected automatically so as to maximize the plot scale.
-The <B>-U</B> option allows the user to set the plot orientation. If
-<I>orientation</I> = 1, a portrait plot will be produced; if
-<I>orientation</I> = 2, a landscape plot will be produced.
-<DT><B>-W</B>
-
-<DD>
-<I>[color_style</I>[<I>/palette</I>[<I>ncolors</I>]] | cptfile]
-<BR>
-
-This option controls the color scheme used for color
-fill plots.
-<P>
-If <I>color_style</I> = 1 [default], then
-the color scheme used will be a continuous grading
-of colors. If <I>color_style</I> = 2, the color scheme
-will be a set of discrete color intervals. The color
-palette used is set using <I>palette</I>. Seven palettes
-are available:
-<BR> <TT>       </TT><I>palette</I> = 1:<TT>    </TT>Haxby colors [default]<BR>
-<BR> <TT>       </TT><I>palette</I> = 2:<TT>    </TT>high Intensity colors<BR>
-<BR> <TT>       </TT><I>palette</I> = 3:<TT>    </TT>low Intensity colors<BR>
-<BR> <TT>       </TT><I>palette</I> = 4:<TT>    </TT>grayscale<BR>
-<BR> <TT>       </TT><I>palette</I> = 5:<TT>    </TT>uniform grayscale<BR>
-<BR> <TT>       </TT><I>palette</I> = 6:<TT>    </TT>uniform black<BR>
-<BR> <TT>       </TT><I>palette</I> = 7:<TT>    </TT>uniform white<BR>
-<P>
-The RGB definitions of the color palettes are:
-<P>
-color palette 1 - Haxby Color Table
-<BR>  red:   255 255 255 255 240 205 138 106  50  40  37
-<BR>  green: 255 186 161 189 236 255 236 235 190 127  57
-<BR>  blue:  255 133  68  87 121 162 174 255 255 251 175
-<P>
-color palette 2 - High Intensity Colors
-<BR>  red:   255 255 255 255 128   0   0   0   0 128 255
-<BR>  green:   0  64 128 255 255 255 255 128   0   0   0
-<BR>  blue:    0   0   0   0   0   0 255 255 255 255 255
-<P>
-color palette 3 - Low Intensity Colors
-<BR>  red:   200 194 179 141  90   0   0   0   0  90 141
-<BR>  green:   0  49  90 141 179 200 141  90   0   0   0
-<BR>  blue:    0   0   0   0   0   0 141 179 200 179 141
-<P>
-color palette 4 - Grayscale
-<BR>  red:   255 230 204 179 153 128 102  77  51  26   0
-<BR>  green: 255 230 204 179 153 128 102  77  51  26   0
-<BR>  blue:  255 230 204 179 153 128 102  77  51  26   0
-<P>
-color palette 5 - Uniform Grayscale
-<BR>  red:   128 128 128 128 128 128 128 128 128 128 128
-<BR>  green: 128 128 128 128 128 128 128 128 128 128 128
-<BR>  blue:  128 128 128 128 128 128 128 128 128 128 128
-<P>
-color palette 6 - Uniform Black
-<BR>  red:     0   0   0   0   0   0   0   0   0   0   0
-<BR>  green:   0   0   0   0   0   0   0   0   0   0   0
-<BR>  blue:    0   0   0   0   0   0   0   0   0   0   0
-<P>
-color palette 7 - Uniform White
-<BR>  red:   255 255 255 255 255 255 255 255 255 255 255
-<BR>  green: 255 255 255 255 255 255 255 255 255 255 255
-<BR>  blue:  255 255 255 255 255 255 255 255 255 255 255
-<P>
-The Haxby colors have been adapted from a palette
-developed by Dr. William Haxby of the Lamont-Doherty
-Earth Observatory; this palette is pleasing to the
-eye and well suited for shading. The high intensity
-colors describe linear paths through RGB space from
-red to blue to green to purple; because the colors are high
-intensity they are not well suited to shading.
-The low intensity colors are similar to the high
-intensity, but muted and thus well suited to shading.
-The grayscale palette runs linearly from white to
-black and is commonly used for plots of sidescan and amplitude
-data. The uniform grayscale is useful for non-color
-shaded relief plots.
-<P>
-The <I>ncolors</I> parameter sets the number of color
-values used in plotting, whether the colors are
-represented in a continuous color scale or a
-stepped, discrete color scale [default is 11].
-<P>
-If the option argument is the path to an existing <B>GMT</B>
-color palette (CPT) file, then that CPT file and its
-color scheme will be used for the plot
-<DT><B>-V</B>
-
-<DD>
-Causes <B>mbm_grd3dplot</B> to operate in "verbose" mode
-so that it outputs
-more information than usual.
-<DT><B>-X</B>
-
-<DD>
-Normally, <B>mbm_grd3dplot</B> creates an executable shellscript and
-then exits.  This option will cause the shellscript to be executed
-in the background before <B>mbm_grd3dplot</B> exits.
-<DT><B>-Y</B>
-
-<DD>
-Normally, <B>mbm_grd3dplot</B> generates nicely rounded numbers
-for the boundaries of the color palette. Often, the resulting
-color bounds extend well outside the range of the gridded data.
-This option causes
-the color boundaries to be uniformly distributed between the
-minimum and maximum values of the grid.
-<DT><B>-Z</B>
-
-<DD>
-<I>min/max</I>
-<BR>
-
-This option overrides the minimum and maximum values of
-the gridded data, affecting the color palette and the
-contour interval if those parameters are not specified
-by the user.
-<P>
-</DL>
-<A NAME="lbAI"> </A>
-<H2>EXAMPLES</H2>
-
-Suppose we have obtained two GRD files with dimensions of
-127 by 194, one containing gridded bathymetry
-(grd_sb2112_example_bath) and the other gridded sidescan
-(grd_sb2112_example_ss). In order to generate a shellscript
-which will in turn generate a 3D color shaded relief
-view of the bathymetry, we use the <B>-G</B><I>2</I> option.
-The grid file is in
-bathymetry (positive down) rather in topography (positive
-up), so the bathymetry needs to be rescaled by multiplying
-by -1 (<B>-MGS</B><I>-1</I>). We choose an illumination magnitude of 0.4
-and an illumination azimuth of 45 degrees (<B>-A</B><I>0.4/45</I>). We
-also choose a perspective azimuth of 250 degrees and an
-elevation of 30 degrees (<B>-E</B><I>240/30</I>):
-<P>
-<BR>  <TT>      </TT>mbm_grd3dplot -Igrd_sb2112_example_bath \<BR>
-<BR>  <TT>      </TT>    -G2 -A0.4/45 -E250/30 -MGS-1 -X -V \<BR>
-<BR>  <TT>      </TT>    -Osb2112_example_bath3d<BR>
-<P>
-Now, to generate a 3D perspective view of the gridded
-bathymetry shaded using the gridded sidescan data, we
-use the <B>-G</B><I>3</I> and <B>-K</B> options.
-We want the sidescan data to
-be histogram equalized, so we use <B>-S</B><I>0/1</I>. We also want
-the shading to be more prominent than the default
-shading magnitude of 0.2 would produce, so we use <B>-A</B><I>0.5</I>:
-<P>
-<BR>  <TT>      </TT>mbm_grd3dplot -Igrd_sb2112_example_bath \<BR>
-<BR>  <TT>      </TT>    -Kgrd_sb2112_example_ss \<BR>
-<BR>  <TT>      </TT>    -G3 -A0.5 -E250/30 -D0/1 \<BR>
-<BR>  <TT>      </TT>    -S0/1 -MGS-1 -X -V \<BR>
-<BR>  <TT>      </TT>    -Osb2112_example_bathss3d<BR>
-<P>
-The first example produces and executes a plot generation
-shellscript called sb2112_example_bath3d.cmd and the second
-produces a shellscript called sb2112_example_bathss3d.cmd.
-As an example, the contents of the plotting shellscript
-"sb2112_example_bathss3d.cmd" are:
-<P>
-<BR> #
-<BR> # Shellscript to create Postscript plot of data in grd file
-<BR> # Created by macro mbm_grd3dplot
-<BR> #
-<BR> # This shellscript created by following command line:
-<BR> # mbm_grd3dplot -Igrd_sb2112_example_bath \
-<BR> #      -Kgrd_sb2112_example_ss -G3 -A0.5 \
-<BR> #      -E250/30 -D0/1 -S0/1 -MGS-1 -X -V \
-<BR> #      -Osb2112_example_bathss3d
-<BR> #
-<BR> # Save existing GMT defaults
-<BR> echo Saving GMT defaults...
-<BR> gmtdefaults -L > gmtdefaults$$
-<BR> #
-<BR> # Set new GMT defaults
-<BR> echo Setting new GMT defaults...
-<BR> gmtset ANOT_FONT Helvetica
-<BR> gmtset LABEL_FONT Helvetica
-<BR> gmtset HEADER_FONT Helvetica
-<BR> gmtset ANOT_FONT_SIZE 8
-<BR> gmtset LABEL_FONT_SIZE 8
-<BR> gmtset HEADER_FONT_SIZE 10
-<BR> gmtset FRAME_WIDTH 0.074999999999999997
-<BR> gmtset TICK_LENGTH 0.074999999999999997
-<BR> gmtset PAGE_ORIENTATION LANDSCAPE
-<BR> gmtset COLOR_BACKGROUND 0/0/0
-<BR> gmtset COLOR_FOREGROUND 255/255/255
-<BR> gmtset COLOR_NAN 255/255/255
-<BR> #
-<BR> # Make color palette table file
-<BR> echo Making color palette table file...
-<BR> echo  -4500  37  57 175  -4350  40 127 251 > \
-<BR> <TT>       </TT>sb2112_example_bathss3d.cpt<BR>
-<BR> echo  -4350  40 127 251  -4200  50 190 255 >> \
-<BR> <TT>       </TT>sb2112_example_bathss3d.cpt<BR>
-<BR> echo  -4200  50 190 255  -4050 106 235 255 >> \
-<BR> <TT>       </TT>sb2112_example_bathss3d.cpt<BR>
-<BR> echo  -4050 106 235 255  -3900 138 236 174 >> \
-<BR> <TT>       </TT>sb2112_example_bathss3d.cpt<BR>
-<BR> echo  -3900 138 236 174  -3750 205 255 162 >> \
-<BR> <TT>       </TT>sb2112_example_bathss3d.cpt<BR>
-<BR> echo  -3750 205 255 162  -3600 240 236 121 >> \
-<BR> <TT>       </TT>sb2112_example_bathss3d.cpt<BR>
-<BR> echo  -3600 240 236 121  -3450 255 189  87 >> \
-<BR> <TT>       </TT>sb2112_example_bathss3d.cpt<BR>
-<BR> echo  -3450 255 189  87  -3300 255 161  68 >> \
-<BR> <TT>       </TT>sb2112_example_bathss3d.cpt<BR>
-<BR> echo  -3300 255 161  68  -3150 255 186 133 >> \
-<BR> <TT>       </TT>sb2112_example_bathss3d.cpt<BR>
-<BR> echo  -3150 255 186 133  -3000 255 255 255 >> \
-<BR> <TT>       </TT>sb2112_example_bathss3d.cpt<BR>
-<BR> #
-<BR> # Rescale data
-<BR> echo Rescaling data by -1...
-<BR> echo Running grdmath...
-<BR> grdmath grd_sb2112_example_bath -1 x = \
-<BR> <TT>       </TT>grd_sb2112_example_bath.scale<BR>
-<BR> #
-<BR> # Get shading array
-<BR> echo Getting shading array...
-<BR> echo Running grdhisteq...
-<BR> grdhisteq grd_sb2112_example_ss \
-<BR> <TT>       </TT>-Ggrd_sb2112_example_ss.eq -N<BR>
-<BR> echo Running grdmath...
-<BR> grdmath grd_sb2112_example_ss.eq -0.5 x \
-<BR> <TT>       </TT>= grd_sb2112_example_ss.int<BR>
-<BR> rm -f grd_sb2112_example_ss.eq
-<BR> #
-<BR> # Make 3D view
-<BR> echo Running grdview...
-<BR> grdview grd_sb2112_example_bath.scale \
-<BR> <TT>       </TT>-Jm13.678801784792578 \<BR>
-<BR> <TT>       </TT>-Jz0.0014760910157720331 \<BR>
-<BR> <TT>       </TT>-E250/30 \<BR>
-<BR> <TT>       </TT>-R114.221/114.421/-31.9001/-31.6377 \<BR>
-<BR> <TT>       </TT>-Csb2112_example_bathss3d.cpt \<BR>
-<BR> <TT>       </TT>-N-4499.4399999999996/200/200/200 \<BR>
-<BR> <TT>       </TT>-Igrd_sb2112_example_ss.int \<BR>
-<BR> <TT>       </TT>-Qi \<BR>
-<BR> <TT>       </TT>-P -X1.8081565710006675 -Y2 -K -V \<BR>
-<BR> <TT>       </TT>> sb2112_example_bathss3d.ps<BR>
-<BR> #
-<BR> # Make color scale
-<BR> echo Running psscale...
-<BR> psscale -Csb2112_example_bathss3d.cpt \
-<BR> <TT>       </TT>-D2.4418/-0.5000/4.8837/0.1500h \<BR>
-<BR>  <TT>      </TT>-B":.Data Values:" \<BR>
-<BR> <TT>       </TT>-P -K -O -V >> sb2112_example_bathss3d.ps<BR>
-<BR> #
-<BR> # Make basemap
-<BR> echo Running psbasemap...
-<BR> psbasemap -Jm13.678801784792578 \
-<BR> <TT>       </TT>-Jz0.0014760910157720331 \<BR>
-<BR> <TT>       </TT>-E250/30 \<BR>
-<BR> <TT>       </TT>-R114.221/114.421/-31.9001/-31.6377 \<BR>
-<BR> <TT>       </TT>-B5m/5m:."Data File grd_sb2112_example_bath":WSZ \<BR>
-<BR> <TT>       </TT>-P -O -V >> sb2112_example_bathss3d.ps<BR>
-<BR> #
-<BR> # Delete surplus files
-<BR> echo Deleting surplus files...
-<BR> rm -f sb2112_example_bathss3d.cpt
-<BR> rm -f grd_sb2112_example_bath.scale
-<BR> #
-<BR> # Reset GMT default fonts
-<BR> echo Resetting GMT fonts...
-<BR> mv gmtdefaults$$ .gmtdefaults
-<BR> #
-<BR> # Run xpsview
-<BR> echo Running xpsview in background...
-<BR> xpsview -ps a -maxp 4m sb2112_example_bathss3d.ps &
-<BR> #
-<BR> # All done!
-<BR> echo All done!
-<P>
-<A NAME="lbAJ"> </A>
-<H2>SEE ALSO</H2>
-
-<B>grdimage</B>(1), <B>grdcontour</B>(1),
-<B><A HREF="mbdefaults.html">mbdefaults</A></B>(1), <B><A HREF="mbgrid.html">mbgrid</A></B>(1), <B><A HREF="mbsystem.html">mbsystem</A></B>(1),
-<B><A HREF="mbm_grd3dplot.html">mbm_grd3dplot</A></B>(1), <B><A HREF="mbm_plot.html">mbm_plot</A></B>(1),
-<B>psbasemap</B>(1), <B>pstext</B>(1), <B>psxy</B>(1)
-<P>
-<A NAME="lbAK"> </A>
-<H2>BUGS</H2>
-
-By making this macro more useful, we have also made it
-more complex.
-<P>
-
-<HR>
-<A NAME="index"> </A><H2>Index</H2>
-<DL>
-<DT><A HREF="#lbAB">NAME</A><DD>
-<DT><A HREF="#lbAC">VERSION</A><DD>
-<DT><A HREF="#lbAD">SYNOPSIS</A><DD>
-<DT><A HREF="#lbAE">DESCRIPTION</A><DD>
-<DT><A HREF="#lbAF">AUTHORSHIP</A><DD>
-<DT><A HREF="#lbAG">SIMPLE DESCRIPTION OF BASIC OPTIONS</A><DD>
-<DT><A HREF="#lbAH">COMPLETE DESCRIPTION OF OPTIONS</A><DD>
-<DT><A HREF="#lbAI">EXAMPLES</A><DD>
-<DT><A HREF="#lbAJ">SEE ALSO</A><DD>
-<DT><A HREF="#lbAK">BUGS</A><DD>
-</DL>
-<HR>
-</PRE>
-
-<CENTER><P><BR>
-Last Updated: 9 January 2015</P></CENTER>
-
-<HR>
-<P><A HREF="mbsystem_man_list.html">Return to list of MB-System manual pages...</A></P>
-<P><A HREF="mbsystem_home.html"><IMG SRC="mbsystem_logo_small.gif" BORDER=0 HEIGHT=55 WIDTH=158 ALIGN=BOTTOM></A><A HREF="mbsystem_home.html">Back
-to MB-System Home Page...</A></P>
-
-</BODY>
-</HTML>
diff --git a/src/html/mbm_grdcut.html b/src/html/mbm_grdcut.html
deleted file mode 100644
index bf2a3cd..0000000
--- a/src/html/mbm_grdcut.html
+++ /dev/null
@@ -1,180 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<HTML VERSION="2.0">
-<HEAD>
-   <TITLE>MB-System Unix Manual Page: mbm_grdcut</TITLE>
-<!-- WEBMAGIC VERSION NUMBER="2.0.2" -->
-<!-- WEBMAGIC TRANSLATION NAME="ServerRoot" SRC="/var/www/htdocs/" DST="/" -->
-<!-- WEBMAGIC TRANSLATION NAME="ProjectRoot" SRC="./" DST="" -->
-</HEAD>
-<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#336699" VLINK="#997040" ALINK="#CC9900">
-<BODY>
-<CENTER><H3><U>MB-System Unix Manual Page</U></H3></CENTER>
-<PRE>
-<H1>mbm_grdcut</H1>
-Section:  MB-System 5.0  (1)<BR>Updated:  9 November 2014 <BR><A HREF="#index">Index</A>
-<HR>
-
-<A NAME="lbAB"> </A>
-<H2>NAME</H2>
-
-<B>mbm_grdcut</B> - Macro to extract a specified subarea of a
-GMT GRD grid file as another GRD file.
-<P>
-<A NAME="lbAC"> </A>
-<H2>VERSION</H2>
-
-Version 5.0
-<P>
-<A NAME="lbAD"> </A>
-<H2>SYNOPSIS</H2>
-
-mbm_grdcut <B>-I</B><I>infile</I> <B>-O</B><I>outfile</I> <B>-R</B><I>w/e/s/n</I> [<B>-H</B> <B>-V</B>]
-<P>
-<A NAME="lbAE"> </A>
-<H2>DESCRIPTION</H2>
-
-<B>mbm_grdcut</B> is a macro to painlessly cut out a region from a
-GMT GRD grid file.
-The GMT program grdcut requires that one specify bounds which
-exactly match grid cell boundaries. Frequently, one just wants
-to extract an approximate region quickly, without calculating
-grid cell sizes and boundary locations. This macro does the
-the calculations and extracts the subregion closest to that
-specified by the user.
-<P>
-<A NAME="lbAF"> </A>
-<H2>AUTHORSHIP</H2>
-
-David W. Caress (<A HREF="mailto:caress at mbari.org">caress at mbari.org</A>)
-<BR>
-
-<BR>  Monterey Bay Aquarium Research Institute
-<BR>
-
-Dale N. Chayes (<A HREF="mailto:dale at ldeo.columbia.edu">dale at ldeo.columbia.edu</A>)
-<BR>
-
-<BR>  Lamont-Doherty Earth Observatory
-<P>
-<A NAME="lbAG"> </A>
-<H2>OPTIONS</H2>
-
-<DL COMPACT>
-<DT><B>-H</B>
-
-<DD>
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-<DT><B>-I</B>
-
-<DD>
-<I>infile</I>
-<BR>
-
-Sets the filename of the input GMT grid file. This file must be
-in the GMT NetCDF GRD format.
-<DT><B>-O</B>
-
-<DD>
-<I>outfile</I>
-<BR>
-
-Sets the filename of the output GMT grid file. This file will be
-in the GMT NetCDF GRD format.
-<DT><B>-R</B>
-
-<DD>
-<I>w/e/s/n</I>
-<BR>
-
-Sets the bounds of the area to be extracted from the input grid file.
-<DT><B>-V</B>
-
-<DD>
-The <B>-V</B> option causes <B>mbm_grdcut</B> to print out status messages.
-<P>
-</DL>
-<A NAME="lbAH"> </A>
-<H2>EXAMPLES</H2>
-
-Suppose that we have used <B>mbgrid</B> to obtain a
-topography grid file called KohalaA_bath.grd in the GMT NetCDF
-GRD format:
-<BR>    mbgrid -Idatalist \
-<BR>        -OKohalaA_bath \
-<BR>        -R-155.72855/-155.31928/20.09488/20.47645 \
-<BR>        -E30.0/0m! -A2 -N -G3 -C1 -V
-<BR>
-
-Further suppose that one wishes to extract a smaller grid with
-bounds of 155 degrees 31 minutes W to 155 degrees 26 minutes W
-in longitude and 20 degrees 13 minutes N to 20 degrees 18 minutes N
-in latitude. This can be done using the <B>GMT</B> program
-<B>grdcut</B>, but <B>grdcut</B> requires that the user specify
-bounds that exactly match the grid cell boundaries in the file.
-The <B>mbm_grdcut</B> macros allows one to specify approximate
-desired bounds, calculates the exact, nearest bounds
-that <B>grdcut</B> will accept, and then executes <B>grdcut</B>.
-<P>
-To obtain the desired sub-grid, the following will suffice:
-<BR>    mbm_grdcut -I KohalaA_bath.grd         -O Kohala_plunge.grd         -R-155:31/-155:26/20:13/20:18         -V
-<BR>
-
-The resulting output is:
-<BR>
-
-<BR>    Program mbm_grdcut status:
-<BR>        Input GRD file:         KohalaA_bath.grd
-<BR>        Output GRD file:        Kohala_plunge.grd
-<BR>        Input Grid bounds:      -155.72855 -155.3192906  20.09488 20.47628103
-<BR>        Input grid dimensions:  1426  1329
-<BR>        Grid cell sizes:        0.0002871995719  0.0002871995719
-<BR>        Requested Grid bounds:  -155.516667 -155.433333  20.216667 20.3
-<BR>        Output Grid bounds:     -155.516884 -155.433596  20.216653 20.299940
-<BR>        Output grid dimensions: 291  291
-<P>
-<BR>    Running grdcut...
-<BR>    grdcut KohalaA_bath.grd -GKohala_plunge.grd -R-155.516884/-155.433596/20.216653/20.299940 -V
-<BR>    grdcut: File spec:    W E S N dx dy nx ny:
-<BR>    grdcut: Old: -155.729 -155.319 20.0949 20.4763 0.0002872 0.0002872 1426 1329
-<BR>    grdcut: New: -155.517 -155.434 20.2167 20.2999 0.0002872 0.0002872  291  291
-<P>
-<P>
-<A NAME="lbAI"> </A>
-<H2>SEE ALSO</H2>
-
-<B><A HREF="mbsystem.html">mbsystem</A></B>(1), <B><A HREF="mbgrid.html">mbgrid</A></B>(1),
-<B><A HREF="mbmosaic.html">mbmosaic</A></B>(1), <B><A HREF="mbm_grid.html">mbm_grid</A></B>(1), <B><A HREF="mbm_grdplot.html">mbm_grdplot</A></B>(1)
-<P>
-<A NAME="lbAJ"> </A>
-<H2>BUGS</H2>
-
-Probably.
-<P>
-
-<HR>
-<A NAME="index"> </A><H2>Index</H2>
-<DL>
-<DT><A HREF="#lbAB">NAME</A><DD>
-<DT><A HREF="#lbAC">VERSION</A><DD>
-<DT><A HREF="#lbAD">SYNOPSIS</A><DD>
-<DT><A HREF="#lbAE">DESCRIPTION</A><DD>
-<DT><A HREF="#lbAF">AUTHORSHIP</A><DD>
-<DT><A HREF="#lbAG">OPTIONS</A><DD>
-<DT><A HREF="#lbAH">EXAMPLES</A><DD>
-<DT><A HREF="#lbAI">SEE ALSO</A><DD>
-<DT><A HREF="#lbAJ">BUGS</A><DD>
-</DL>
-<HR>
-</PRE>
-
-<CENTER><P><BR>
-Last Updated: 9 November 2014</P></CENTER>
-
-<HR>
-<P><A HREF="mbsystem_man_list.html">Return to list of MB-System manual pages...</A></P>
-<P><A HREF="mbsystem_home.html"><IMG SRC="mbsystem_logo_small.gif" BORDER=0 HEIGHT=55 WIDTH=158 ALIGN=BOTTOM></A><A HREF="mbsystem_home.html">Back
-to MB-System Home Page...</A></P>
-
-</BODY>
-</HTML>
diff --git a/src/html/mbm_grdinfo.html b/src/html/mbm_grdinfo.html
deleted file mode 100644
index 69d1a3c..0000000
--- a/src/html/mbm_grdinfo.html
+++ /dev/null
@@ -1,148 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<HTML VERSION="2.0">
-<HEAD>
-   <TITLE>MB-System Unix Manual Page: mbm_grdinfo</TITLE>
-<!-- WEBMAGIC VERSION NUMBER="2.0.2" -->
-<!-- WEBMAGIC TRANSLATION NAME="ServerRoot" SRC="/var/www/htdocs/" DST="/" -->
-<!-- WEBMAGIC TRANSLATION NAME="ProjectRoot" SRC="./" DST="" -->
-</HEAD>
-<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#336699" VLINK="#997040" ALINK="#CC9900">
-<BODY>
-<CENTER><H3><U>MB-System Unix Manual Page</U></H3></CENTER>
-<PRE>
-<H1>mbm_grdinfo</H1>
-Section:  MB-System 5.0  (1)<BR>Updated:  3 June 2013 <BR><A HREF="#index">Index</A>
-<HR>
-
-<A NAME="lbAB"> </A>
-<H2>NAME</H2>
-
-<B>mbm_grdinfo</B> - Macro to get information regarding a GMT grd file when the
-region of interest is a subset of the area covered in the
-input file.
-<P>
-<A NAME="lbAC"> </A>
-<H2>VERSION</H2>
-
-Version 5.0
-<P>
-<A NAME="lbAD"> </A>
-<H2>SYNOPSIS</H2>
-
-mbm_grdinfo <B>-I</B><I>infile</I> [<B>-R</B><I>w/e/s/n</I> <B>-H</B> <B>-V</B>]
-<P>
-<A NAME="lbAE"> </A>
-<H2>DESCRIPTION</H2>
-
-<B>mbm_grdinfo</B> is a macro to get information
-regarding a GMT grd file when the
-region of interest is a subset of the area covered in the
-input file. If no bounds are specified, the program grdinfo
-is called directly.  If longitude and latitude bounds are
-specified, then the specified region is cut from the input
-file using the macro mbm_grdinfo, and the information is
-obtained from the subset temporary grd file using grdinfo.
-<P>
-<A NAME="lbAF"> </A>
-<H2>AUTHORSHIP</H2>
-
-David W. Caress (<A HREF="mailto:caress at mbari.org">caress at mbari.org</A>)
-<BR>
-
-<BR>  Monterey Bay Aquarium Research Institute
-<BR>
-
-Dale N. Chayes (<A HREF="mailto:dale at ldeo.columbia.edu">dale at ldeo.columbia.edu</A>)
-<BR>
-
-<BR>  Lamont-Doherty Earth Observatory
-<P>
-<A NAME="lbAG"> </A>
-<H2>OPTIONS</H2>
-
-<DL COMPACT>
-<DT><B>-H</B>
-
-<DD>
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-<DT><B>-I</B>
-
-<DD>
-<I>infile</I>
-<BR>
-
-Sets the filename of the input GMT grid file. This file must be
-in the GMT NetCDF GRD format.
-<DT><B>-R</B>
-
-<DD>
-<I>w/e/s/n</I>
-<BR>
-
-Sets the bounds of the area of interest in the grid file. The
-information reported will pertain to this area only.
-<DT><B>-V</B>
-
-<DD>
-The <B>-V</B> option causes <B>mbm_grdinfo</B> to print out status messages.
-<P>
-</DL>
-<A NAME="lbAH"> </A>
-<H2>EXAMPLES</H2>
-
-Suppose that we have used <B>mbgrid</B> to obtain a
-topography grid file called KohalaA_bath.grd in the GMT NetCDF
-GRD format:
-<BR> <TT>       </TT>mbgrid -Idatalist \<BR>
-<BR> <TT>       </TT><TT>        </TT>-OKohalaA_bath \<BR>
-<BR> <TT>       </TT><TT>        </TT>-R-155.72855/-155.31928/20.09488/20.47645 \<BR>
-<BR> <TT>       </TT><TT>        </TT>-E30.0/0m! -A2 -N -G3 -C1 -V<BR>
-<BR>
-
-Further suppose that one wishes to determine the
-depth range in a smaller area with
-bounds of 155 degrees 31 minutes W to 155 degrees 26 minutes W
-in longitude and 20 degrees 13 minutes N to 20 degrees 18 minutes N
-in latitude. The following will suffice:
-<BR> <TT>       </TT>mbm_grdinfo -I KohalaA_bath.grd  <TT>       </TT><TT>        </TT>-R-155:31/-155:26/20:13/20:18 <TT>  </TT><TT>        </TT>-V<BR>
-<P>
-<A NAME="lbAI"> </A>
-<H2>SEE ALSO</H2>
-
-<B><A HREF="mbsystem.html">mbsystem</A></B>(1), <B><A HREF="mbm_grdplot.html">mbm_grdplot</A></B>(1), <B><A HREF="mbm_grdinfo.html">mbm_grdinfo</A></B>(1)
-<P>
-<A NAME="lbAJ"> </A>
-<H2>BUGS</H2>
-
-This macro is new and hasn't been tested in serious
-usage yet - let us know what to fix, add, or
-change!.
-<P>
-
-<HR>
-<A NAME="index"> </A><H2>Index</H2>
-<DL>
-<DT><A HREF="#lbAB">NAME</A><DD>
-<DT><A HREF="#lbAC">VERSION</A><DD>
-<DT><A HREF="#lbAD">SYNOPSIS</A><DD>
-<DT><A HREF="#lbAE">DESCRIPTION</A><DD>
-<DT><A HREF="#lbAF">AUTHORSHIP</A><DD>
-<DT><A HREF="#lbAG">OPTIONS</A><DD>
-<DT><A HREF="#lbAH">EXAMPLES</A><DD>
-<DT><A HREF="#lbAI">SEE ALSO</A><DD>
-<DT><A HREF="#lbAJ">BUGS</A><DD>
-</DL>
-<HR>
-</PRE>
-
-<CENTER><P><BR>
-Last Updated: 3 June 2013</P></CENTER>
-
-<HR>
-<P><A HREF="mbsystem_man_list.html">Return to list of MB-System manual pages...</A></P>
-<P><A HREF="mbsystem_home.html"><IMG SRC="mbsystem_logo_small.gif" BORDER=0 HEIGHT=55 WIDTH=158 ALIGN=BOTTOM></A><A HREF="mbsystem_home.html">Back
-to MB-System Home Page...</A></P>
-
-</BODY>
-</HTML>
diff --git a/src/html/mbm_grdplot.html b/src/html/mbm_grdplot.html
deleted file mode 100644
index 017a5ef..0000000
--- a/src/html/mbm_grdplot.html
+++ /dev/null
@@ -1,1641 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<HTML VERSION="2.0">
-<HEAD>
-   <TITLE>MB-System Unix Manual Page: mbm_grdplot</TITLE>
-<!-- WEBMAGIC VERSION NUMBER="2.0.2" -->
-<!-- WEBMAGIC TRANSLATION NAME="ServerRoot" SRC="/var/www/htdocs/" DST="/" -->
-<!-- WEBMAGIC TRANSLATION NAME="ProjectRoot" SRC="./" DST="" -->
-</HEAD>
-<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#336699" VLINK="#997040" ALINK="#CC9900">
-<BODY>
-<CENTER><H3><U>MB-System Unix Manual Page</U></H3></CENTER>
-<PRE>
-<H1>mbm_grdplot</H1>
-Section:  MB-System 5.0  (1)<BR>Updated:  9 January 2015 <BR><A HREF="#index">Index</A>
-<HR>
-
-<A NAME="lbAB"> </A>
-<H2>NAME</H2>
-
-<B>mbm_grdplot</B> - Create an executable shellscript which will generate
-a GMT map of gridded data in a GMT grd file.
-<P>
-<A NAME="lbAC"> </A>
-<H2>VERSION</H2>
-
-Version 5.0
-<P>
-<A NAME="lbAD"> </A>
-<H2>SYNOPSIS</H2>
-
-<B>mbm_grdplot</B> <B>-I</B><I>file</I>
-[<B>-A</B>[<I>magnitude</I>[<I>/azimuth/elevation</I>]
-<B>-C</B>[<I>contour_control</I>]
-<B>-D</B>[<I>flipcolor/flipshade</I>]
-<B>-G</B><I>color_mode</I> <B>-H</B>
-<B>-K</B><I>intensity_file</I>
-<B>-O</B><I>root</I> <B>-P</B><I>pagesize</I>
-<B>-S</B><I>[color/shade]</I> <B>-T</B>
-<B>-U</B><I>orientation</I> <B>-V</B>
-<B>-W</B><I>[color_style</I>[<I>/palette</I>[<I>ncolors</I>]] | <I>cptfile]</I> ]
-<P>
-Additional Options:
-<BR>
-
-[<B>-B</B><I>tickinfo</I> 
-<B>-F</B><I>contour_file</I>
-<B>-J</B><I>projection</I>[<I>/scale | width</I>]
-<B>-L</B><I>title</I>[<I>:scale_label</I>] <B>-M</B><I>misc</I>
-<B>-Q</B> <B>-R</B><I>w/e/s/n</I> <B>-X</B> <B>-Y</B>
-<B>-Z</B><I>min/max[/mode]</I> ]
-<P>
-Miscellaneous Options:
-<BR>
-
-[<B>-MGD</B><I>gmtdef/value</I>  <B>-MGF</B><I>scale_loc</I>
-<B>-MGL</B>[<I>f</I>][<I>x</I>]<I>lon0/lat0/slat/length</I>[<I>units</I>][<I>+llabel</I>]
-<B>-MGQ</B><I>dpi</I> <B>-MGS</B><I>scalefactor</I>
-<B>-MGT</B><I>x/y/size/angle/font/just/text</I>
-<B>-MGU</B>[<I>/dx/dy/</I>][<I>label</I>]
-<B>-MCA</B><I>anot_int/</I>[<I>ffont_size</I>][<I>aangle</I>][<I>/r/g/b</I>][<I>o</I>]]
-<B>-MCG</B><I>gap/width</I> <B>-MCQ</B><I>cut </I>
-<B>-MCT</B>[<I>+|-</I>][<I>gap/length</I>][<I>:LH</I>] <B>-MCW</B><I>type</I>[<I>pen</I>]
-<B>-MNA</B><I>[nhgt[/P] | P]</I>
-<B>-MNF</B><I>format</I> <B>-MNI</B><I>swathdata</I>
-<B>-MNN</B>[<I>ttick/tannot/dannot/tlen</I>[<I>/nhgt</I>] | <I>F</I> | <I>FP</I>]
-<B>-MNP</B>[<I>pingnumber_tick/pingnumber_annot/pingnumber_tick_len</I>]
-<B>-MTC</B><I>fill</I> <B>-MTD</B><I>resolution</I>
-<B>-MTG</B><I>fill</I> <B>-MTI</B><I>river[/pen]</I>
-<B>-MTN</B><I>border[/pen]</I> <B>-MTS</B><I>fill</I>
-<B>-MTW</B><I>pen</I>
-<B>-MXG</B><I>fill</I> <B>-MXI</B><I>xy_file </I>
-<B>-MXM</B>
-<B>-MXS</B><I>symbol/size</I> <B>-MXW</B><I>pen</I>]
-<P>
-<A NAME="lbAE"> </A>
-<H2>DESCRIPTION</H2>
-
-<B>mbm_grdplot</B> is a macro that generates a
-shellscript of <B>GMT</B> commands which,
-when executed, will generate a Postscript plot of gridded
-data.  Several styles of plots can be generated, including
-color fill maps, contour maps, color fill maps overlaid with
-contours, shaded relief color maps, slope magnitude maps,
-coastline maps, text labels, and xy data
-in lines or symbols. Five different color schemes are included.
-The plot will be scaled to fit on the specified page size
-or, if the scale is user defined, the page size will be
-chosen in accordance with the plot size. The primary purpose
-of this macro is to allow the simple, semi-automated
-production of nice looking maps with a few command line
-arguments. For users seeking more control over the plot
-appearance, a number of additional optional arguments are
-provided. Truly ambitious users may edit the plot shellscript
-to take advantage of <B>GMT</B> capabilities not supported by this
-macro. A companion macro <B>mbm_grd3dplot</B> can be used
-similarly to generate 3D perspective views of gridded data.
-<P>
-By default the output plot generation shellscript
-includes lines which execute a program to display the Postscript
-image on the screen. The program to be used to display the Postscript
-is set using <B>mbdefaults</B>; the default value can be overridden
-by setting the environment variable $MB_PS_VIEWER.
-Invoking the plot generation shellscript with
-a <B>-N</B> command line argument suppresses the screen
-display of the plot.
-<P>
-The plot scripts generated by this macro will work with
-GMT version 5.0 and later, and are not compatible with
-earlier versions of GMT.
-<P>
-<A NAME="lbAF"> </A>
-<H2>AUTHORSHIP</H2>
-
-David W. Caress (<A HREF="mailto:caress at mbari.org">caress at mbari.org</A>)
-<BR>
-
-<BR>  Monterey Bay Aquarium Research Institute
-<BR>
-
-Dale N. Chayes (<A HREF="mailto:dale at ldeo.columbia.edu">dale at ldeo.columbia.edu</A>)
-<BR>
-
-<BR>  Lamont-Doherty Earth Observatory
-<P>
-<A NAME="lbAG"> </A>
-<H2>SIMPLE DESCRIPTION OF BASIC OPTIONS</H2>
-
-<DL COMPACT>
-<DT><B>-A</B>
-
-<DD>
-<I>magnitude[/azimuth/elevation]</I>
-<BR>
-
-Sets the parameters which control the
-synthetic illumination of the gridded data (shaded relief).
-The value <I>magnitude</I>
-is an effective vertical exageration which modulates the intensity of
-the shading; typical values are in the 0.1 to 10 range.
-The value <I>azimuth</I>
-is the azimuth in degrees from north from which the data is illuminated.
-The value <I>elevation</I> is the elevation of the illumination
-in degrees from horizontal.
-Defaults: <I>magnitude</I> = 0.2; <I>azimuth</I> = 0.0;
-<I>elevation</I> = 30.0;
-<DT><B>-C</B>
-
-<DD>
-<I>contour_control</I>
-<BR>
-
-If <B>-C</B> is given alone, it causes unannotated contours
-to be drawn using a contour interval calculated from the
-data. The user may also use <I>contour_control</I>
-to specify the contour interval. See the COMPLETE DESCRIPTION OF OPTIONS
-section below for a more complete discussion.
-<DT><B>-D</B>
-
-<DD>
-<I>[flipcolor/flipshade]</I>
-<BR>
-
-Normally, the color or grayscale tables used for color maps run from
-cool colors (or dark grays) for low grid values
-to hot colors (or light grays) for high grid values.
-This option reverses the color table so that cool colors (dark grays)
-correspond to high values and hot colors (light grays) to low values.
-If <B>-D</B> is given alone, it applies to the color table used
-for color or gray fill plots,  shaded or unshaded. If the plot
-is to be shaded,  either by synthetic illumination (<B>-G</B><I>2</I>)
-or using an intensity file (<B>-K</B> and <B>-G</B><I>3</I> options), then
-setting <I>flipshade</I> = 1 will cause the shading convention
-to be reversed (e.g. high intensities overlaid as light shading).
-Using <B>-D</B><I>0/1</I> will flip the shading convention
-but leave the default color convention.
-<DT><B>-G</B>
-
-<DD>
-<I>color_mode</I>
-<BR>
-
-Turns on color fill plot and sets the style of the plot.
-<BR>
-
-<BR>        <I>color_mode</I> = 1: Color/gray fill.
-<BR>        <I>color_mode</I> = 2: Color/gray fill shaded by
-<BR>                        synthetic illumination.
-<BR>        <I>color_mode</I> = 3: Color/gray fill shaded by
-<BR>                        an intensity file. The <B>-K</B>
-<BR>                        option must be used to specify
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT>the intensity file.<BR>
-<BR>        <I>color_mode</I> = 4: Color/gray fill of slope
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT>magnitude.<BR>
-<BR>        <I>color_mode</I> = 5: Color/gray fill shaded by
-<BR>                        slope magnitude.
-<DT><B>-H</B>
-
-<DD>
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-<DT><B>-I</B>
-
-<DD>
-<I>grdfile</I>
-<BR>
-
-Sets the name of the gridded data file to be plotted.
-Alternatively, <I>grdfile</I> may be a list of grid files
-(one filename on each line) to be plotted together.
-<DT><B>-K</B>
-
-<DD>
-<I>intensity_file</I>
-<BR>
-
-Sets the name of the gridded data file containing
-intensity values to be used for shading the map.
-Alternatively, <I>grdfile</I> may be a list of grid files
-(one filename on each line) to be used together. If a
-list of file is supplied, the intensity files must
-conform in order to the data grid files they will shade.
-<DT><B>-O</B>
-
-<DD>
-<I>root</I>
-<BR>
-
-Sets the root used to construct the filename of the output shellscript
-(<I>root</I>.cmd) and names of files created when the shellscript is
-run.  Normally the
-name of the input grid file or grid file list is
-used as the <I>root</I>.
-<DT><B>-P</B>
-
-<DD>
-<I>pagesize</I>
-<BR>
-
-This option sets the size of the page the plot will be centered
-on. If the user does not set the plot scale, the plot will be
-sized as large as will fit on the designated page. If the user
-sets the plot scale such that the plot will not fit on the
-designated page, a larger page will be used.
-The supported page sizes include ANSI A, B, C, D, E,
-F, and E1, as well as most metric page sizes. See the
-COMPLETE DESCRIPTION OF OPTIONS section
-below for a complete list of
-the supported page sizes. The default page size is A.
-<DT><B>-S</B>
-
-<DD>
-<I>[color/shade]</I>
-<BR>
-
-This option enables effective histogram equalization of the
-color and/or shading of the gridded data. The equalization is
-not achieved by changing the data values, but rather by
-constructing the color or shading tables so that
-the boundaries in the tables encompass equal fractions of
-the datapoints. This serves to focus color or shading contrasts
-in value ranges corresponding to the bulk of the data values.
-If <B>-S</B> is given alone or with <I>color</I> = 1,
-it enables equalization of the color table used
-for color or gray fill plots,  shaded or unshaded. If the plot
-is to be shaded,  either by synthetic illumination (<B>-G</B><I>2</I>)
-or using an intensity file (<B>-K</B> and <B>-G</B><I>3</I> options), then
-setting <I>shade</I> = 1 will cause the shading to be equalized.
-Using <B>-S</B><I>0/1</I> will equalize the shading without
-equalizing the color table.
-<DT><B>-T</B>
-
-<DD>
-If <B>-T</B> is given, it causes a coastline to be drawn
-on the map. The default is to draw the coastline as the thinnest possible
-line. To exercise greater control of
-the coastline plotting, including color fill of "dry" areas and
-display of lakes, rivers, and political boundaries, use the
-<B>-MTC</B>, <B>-MTD</B>, <B>-MTG</B>, <B>-MTI</B>,
-<B>-MTN</B>, <B>-MTS</B>, and <B>-MTW</B> options described in the
-COMPLETE DESCRIPTION OF OPTIONS section below.
-<DT><B>-U</B>
-
-<DD>
-<I>orientation</I>
-<BR>
-
-Normally the orientation of the plot (portrait or landscape)
-is selected automatically so as to maximize the plot scale.
-The <B>-U</B> option allows the user to set the plot orientation. If
-<I>orientation</I> = 1, a portrait plot will be produced; if
-<I>orientation</I> = 2, a landscape plot will be produced.
-<DT><B>-V</B>
-
-<DD>
-Causes <B>mbm_grdplot</B> to operate in "verbose" mode
-so that it outputs
-more information than usual.
-<DT><B>-W</B>
-
-<DD>
-<I>[color_style</I>[<I>/palette</I>[<I>ncolors</I>]] | cptfile]
-<BR>
-
-This option controls the color scheme used for color
-fill plots.
-<P>
-If <I>color_style</I> = 1 [default], then
-the color scheme used will be a continuous grading
-of colors. If <I>color_style</I> = 2, the color scheme
-will be a set of discrete color intervals. The color
-palette used is set using <I>palette</I>. Five palettes
-are available:
-<BR> <TT>       </TT><I>palette</I> = 1:<TT>    </TT>Haxby colors [default]<BR>
-<BR> <TT>       </TT><I>palette</I> = 2:<TT>    </TT>high Intensity colors<BR>
-<BR> <TT>       </TT><I>palette</I> = 3:<TT>    </TT>low Intensity colors<BR>
-<BR> <TT>       </TT><I>palette</I> = 4:<TT>    </TT>grayscale<BR>
-<BR> <TT>       </TT><I>palette</I> = 5:<TT>    </TT>uniform grayscale<BR>
-<BR>
-
-A complete description of the color palettes is given
-in the COMPLETE DESCRIPTION OF OPTIONS section below.
-<P>
-The <I>ncolors</I> parameter sets the number of color
-values used in plotting, whether the colors are
-represented in a continuous color scale or a
-stepped, discrete color scale [default is 11].
-<P>
-If the option argument is the path to an existing <B>GMT</B>
-color palette (CPT) file, then that CPT file and its
-color scheme will be used for the plot
-<P>
-</DL>
-<A NAME="lbAH"> </A>
-<H2>COMPLETE DESCRIPTION OF OPTIONS</H2>
-
-<DL COMPACT>
-<DT><B>-A</B>
-
-<DD>
-<I>magnitude[/azimuth]</I>
-<BR>
-
-Sets the parameters which control the
-synthetic illumination of the gridded data (shaded relief).
-The value <I>magnitude</I>
-is an effective vertical exageration which modulates the intensity of
-the shading; typical values are in the 0.1 to 0.5 range.
-The value <I>azimuth</I>
-is the azimuth from which the data is illuminated.
-Defaults: <I>magnitude</I> = 0.2; <I>azimuth</I> = 0.0;
-<DT><B>-B</B>
-
-<DD>
-<I>tickinfo</I>
-<BR>
-
-Sets map boundary tickmark intervals. See the <B>psbasemap</B>
-manual page for details. By default the program chooses
-basemap annotations based on the map boundaries.
-<DT><B>-C</B>
-
-<DD>
-<I>contour_control</I>
-<BR>
-
-If <B>-C</B> is given alone, it causes unannotated contours
-to be drawn using a contour interval calculated from the
-data. If <I>contour_control</I> is given, it specifies
-the contours to be drawn in one of
-three possible ways:
-<P>
-If <I>contour_control</I> has the suffix ".cpt" and
-can be opened as a file, it is assumed
-to be a color palette table.  The color boundaries
-are then used as contour levels.
-If the cpt-file has anotation flags in the last
-column then those contours will be
-anotated.  By default no contours are labeled; use
-<B>-MCA</B> to anotate all contours.
-<P>
-If <I>contour_control</I> is a file but not a
-cpt-file, it is expected to contain contour levels
-in column 1 and a C(ontour) OR A(nnotate) in col 2.
-The levels marked C (or c) are contoured,
-the levels marked A (or a) are contoured and
-annotated.  Optionally, a third column may be
-present and contain the fixed anotation angle for
-this contour level.
-<P>
-If no file is found, then <I>contour_control</I> is
-interpreted as a constant contour interval.
-<P>
-If a file is given and <B>-MCT</B> is set,
-then only contours marked with upper case
-C or A will have tickmarks.
-<DT><B>-D</B>
-
-<DD>
-<I>[flipcolor/flipshade]</I>
-<BR>
-
-Normally, the color or grayscale tables used for color maps run from
-cool colors (or dark grays) for low grid values
-to hot colors (or light grays) for high grid values.
-This option reverses the color table so that cool colors (dark grays)
-correspond to high values and hot colors (light grays) to low values.
-If <B>-D</B> is given alone, it applies to the color table used
-for color or gray fill plots,  shaded or unshaded. If the plot
-is to be shaded,  either by synthetic illumination (<B>-G</B><I>2</I>)
-or using an intensity file (<B>-K</B> and <B>-G</B><I>3</I> options), then
-setting <I>flipshade</I> = 1 will cause the shading convention
-to be reversed (e.g. high intensities overlaid as light shading).
-Using <B>-D</B><I>0/1</I> will flip the shading convention
-but leave the default color convention.
-<DT><B>-F</B>
-
-<DD>
-<I>contour_file</I>
-<BR>
-
-Sets the name of the file to use for generating contour lines.
-The default is to use the file being plotted, but in some situations,
-it can be useful to specify a separate file for contouring. For example,
-one might wish to overlay a backscatter mosaic with bathymetry contours,
-or a shaded bathymetry map with gravity anomaly contours.
-<DT><B>-G</B>
-
-<DD>
-<I>color_mode</I>
-<BR>
-
-Turns on color fill plot and sets the style of the plot.
-<BR>
-
-<BR>        <I>color_mode</I> = 1: Color/gray fill.
-<BR>        <I>color_mode</I> = 2: Color/gray fill shaded by
-<BR>                        synthetic illumination.
-<BR>        <I>color_mode</I> = 3: Color/gray fill shaded by
-<BR>                        an intensity file. The <B>-K</B>
-<BR>                        option must be used to specify
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT>the intensity file.<BR>
-<BR>        <I>color_mode</I> = 4: Color/gray fill of slope
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT>magnitude.<BR>
-<BR>        <I>color_mode</I> = 5: Color/gray fill shaded by
-<BR>                        slope magnitude.
-<BR>
-
-See the <B>grdimage</B> manual page for information on shading
-with intensity files
-<DT><B>-H</B>
-
-<DD>
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-<DT><B>-I</B>
-
-<DD>
-<I>grdfile</I>
-<BR>
-
-Sets the name of the gridded data file to be plotted.
-The data must be in a form acceptable to <B>GMT</B> version 3
-programs (see the <B>GMT</B> Cookbook & Technical Reference).
-Alternatively, <I>grdfile</I> may be a list of grid files
-(one filename on each line) to be plotted together. This
-is useful when data from a region is broken up into several
-grid files rather than a single very large grid file.
-<DT><B>-J</B>
-
-<DD>
-<I>projection</I>[<I>/scale | /width</I>]
-<BR>
-
-Selects the map projection. By default the map projection is
-Mercator and the plot scale is chosen to fit on the selected
-page size (see <B>-P</B> option). The user may specify a
-different projection to be used, in which case the plot scale
-is still automatically chosen to fit the page. The user may
-also specify both the projection and the plot scale. If
-the projection specifying character is upper case, a plot
-width rather than a plot scale is used.
-The scale values are specified in inch/degree or in 1:xxxxx
-ratios. Plot widths are specified in inches. If the user
-specifies a plot scale such that the plot will not fit
-on the default A size page, a appropriately larger page
-size will be chosen.
-<BR>
-
-<P>
-<B>CYLINDRICAL PROJECTIONS:</B>
-<BR>
-
-<P>
-<B>-Jc</B><I>lon0/lat0/scale</I> (Cassini)
-<BR>
-
-<B>-Jm</B><I>scale</I> (Mercator)
-<BR>
-
-<B>-Joa</B><I>lon0/lat0/azimuth/scale</I> (Oblique Mercator - point and azimuth)
-<BR>
-
-<B>-Job</B><I>lon0/lat0/lon1/lat1/scale</I> (Oblique Mercator - two points)
-<BR>
-
-<B>-Joc</B><I>lon0/lat0/lonp/latp/scale</I> (Oblique Mercator - point and pole)
-<BR>
-
-<B>-Jq</B><I>lon0/scale</I> (Equidistant Cylindrical Projection (Plate Carree))
-<BR>
-
-<B>-Jt</B><I>lon0/scale</I> (TM - Transverse Mercator)
-<BR>
-
-<B>-Ju</B><I>zone/scale</I> (UTM - Universal Transverse Mercator)
-<BR>
-
-<B>-Jy</B><I>lon0/lats/scale</I> (Basic Cylindrical Projection)
-<BR>
-
-<P>
-<B>AZIMUTHAL PROJECTIONS:</B>
-<BR>
-
-<P>
-<B>-Ja</B><I>lon0/lat0/scale</I> (Lambert).
-<BR>
-
-<B>-Je</B><I>lon0/lat0/scale</I> (Equidistant).
-<BR>
-
-<B>-Jg</B><I>lon0/lat0/scale</I> (Orthographic).
-<BR>
-
-<B>-Js</B><I>lon0/lat0/scale</I> (General Stereographic)
-<BR>
-
-<P>
-<B>CONIC PROJECTIONS:</B>
-<BR>
-
-<P>
-<B>-Jb</B><I>lon0/lat0/lat1/lat2/scale</I> (Albers)
-<BR>
-
-<B>-Jl</B><I>lon0/lat0/lat1/lat2/scale</I> (Lambert)
-<BR>
-
-<P>
-<B>MISCELLANEOUS PROJECTIONS:</B>
-<BR>
-
-<P>
-<B>-Jh</B><I>lon0/scale</I> (Hammer)
-<BR>
-
-<B>-Ji</B><I>lon0/scale</I> (Sinusoidal)
-<BR>
-
-<B>-Jk</B><I>lon0/scale</I> (Eckert VI)
-<BR>
-
-<B>-Jn</B><I>lon0/scale</I> (Robinson)
-<BR>
-
-<B>-Jr</B><I>lon0/scale</I> (Winkel Tripel)
-<BR>
-
-<B>-Jw</B><I>lon0/scale</I> (Mollweide)
-<BR>
-
-<P>
-<B>NON-GEOGRAPHICAL PROJECTIONS:</B>
-<BR>
-
-<P>
-<B>-Jp</B><I>scale</I> (Linear projection for polar (theta,r) coordinates)
-<BR>
-
-<B>-Jx</B><I>x-scale</I>[<B>l|p</B><I>pow</I>][<I>/y-scale</I>[<B>l|p</B><I>pow</I>]] (Linear, log, and power scaling)
-<BR>
-
-More details can be found in the <B>psbasemap</B> manpages.
-<DT><B>-K</B>
-
-<DD>
-<I>intensity_file</I>
-<BR>
-
-Sets the name of the gridded data file containing
-intensity values to be used for shading the map.
-Alternatively, <I>grdfile</I> may be a list of grid files
-(one filename on each line) to be used together. If a
-list of files is supplied, the intensity files must
-conform in order to the list of data grid files they will shade.
-<DT><B>-L</B>
-
-<DD>
-<I>title:scalelabel</I>
-<BR>
-
-Sets the title and the label for the colorscale (if used) of
-the plot. Note that a colon (:) rather than a slash (/) is
-used to separate the labels. Colons cannot be used in the
-labels themselves. If this option is not used, then a default title
-and colorscale label are provided. If the title is supplied
-alone, a default colorscale label will be provided. To force
-no title use <B>-L</B>" "; to force no title or colorscale
-label use <B>-L</B>" : ".
-<DT><B>-M</B>
-
-<DD>
-A series of "miscellaneous" options are provided which are
-given as <B>-M</B> followed by a two character identifier, followed
-by any other parameters associated with that option.
-The <B>-M</B> options may be strung together separated by
-colons, e.g. "-MGQ100:GU:CA200/10", which is equivalent to
-"-MGQ -MGU -MCA200/10".
-<DT><B>-MGD</B>
-
-<DD>
-<I>gmtdef/value</I>
-<BR>
-
-Allows the user to set the <B>GMT</B> default values used as
-the plot is constructed. This command may be given repeatedly
-to set as many <B>GMT</B> defaults as required. For example, to
-set the basemap annotation font to Courier, use
-"-MGDANOT_FONT/Courier".
-<DT><B>-MGF</B>
-
-<DD>
-<I>scale_loc</I>
-<BR>
-
-Sets the location of the color scale. The possible values
-of <I>scale_loc</I> are:
-<BR> <TT>       </TT><I>scale_loc</I> = b:<TT>  </TT>bottom of plot<BR>
-<BR> <TT>       </TT><I>scale_loc</I> = t:<TT>  </TT>top of plot<BR>
-<BR> <TT>       </TT><I>scale_loc</I> = l:<TT>  </TT>left of plot<BR>
-<BR> <TT>       </TT><I>scale_loc</I> = r:<TT>  </TT>right of plot<BR>
-<BR>
-
-[Default <I>scale_loc</I> = b]
-<DT><B>-MGL</B>
-
-<DD>
-[<I>f</I>][<I>x</I>]<I>lon0/lat0/slat/length</I>[<I>units</I>][<I>+llabel</I>]
-<BR>
-
-Draws a simple map scale centered on <I>lon0/lat0</I>.
-Use <B>-Lf</B> to get a "fancy" scale [Default is plain].
-Use <B>-Lx</B> to specify the position in inches instead of map units.
-The scale is calculated at latitude <I>slat</I>; if the string "center" is used
-instead of a numerical value for <I>slat</I>, then the macro will set
-the scaling according to the center of the plot bounds.
-The scale length value <I>length</I> is in km 
-by default, but the units can be specified as one of e|f|k|M|n|u, where
-e = meters, f = feet, k = kilometers, M = statue miles, n = nautical miles,
-and u = US survey feet. Append <I>+l</I> to label the scale with the
-relevant units, or append <I>+l"label"</I> to set a different label string.
-<DT><B>-MGQ</B>
-
-<DD>
-<I>dpi</I>
-<BR>
-
-Sets the resolution in dots per inch of the raster image used
-for color fill maps. Larger values of <I>dpi</I> produce larger
-Postscript plot files. [Default is 100].
-<DT><B>-MGS</B>
-
-<DD>
-<I>scalefactor</I>
-<BR>
-
-The gridded data is multiplied by <I>scalefactor</I>.
-This option is most often used flip the sign of the
-data (<I>scalefactor</I> = -1). [Default no scaling]
-<DT><B>-MGT</B>
-
-<DD>
-<I>x/y/size/angle/font/just/text</I>
-<BR>
-
-Causes a text label to plotted on the map.
-<I>size</I> is text size in points, <I>angle</I> is
-measured in degrees counter-clockwise from horizontal,
-<I>fontno</I> sets the font type, <I>justify</I> sets the alignment.
-If <I>fontno</I> starts with a leading hyphen, then
-the remainder of <I>fontno</I> is taken to be a
-textstring with the desired fontname.  See the
-<B>gmtdefaults</B> man page for names and numbers of available fonts
-(or run <B>pstext -L</B>).  The alignment
-number refers to the part of the textstring that will be mapped
-onto the (<I>x,y</I>) point: 1 = Lower Left corner,
-2 = Lower Center, 3 = Lower Right, 5 = Mid Left, 6 = Mid Center,
-7 = Mid Right, 9 = Upper Left, 10 = Upper Center,
-11 = Upper Right. This option may be given as many times as
-needed.
-<DT><B>-MGU</B>
-
-<DD>
-[<I>/dx/dy/</I>][<I>label</I>]
-<BR>
-
-Draw Unix System time stamp on plot.  User may specify where the lower left corner
-of the stamp should fall on the page relative to lower left corner of plot in inch [Default is (-0.75,-0.75)].  Optionally,
-append a label, or <B>c</B> (which will plot the command string.)
-<DT><B>-MCA</B>
-
-<DD>
-<I>anot_int/</I>[<I>ffont_size</I>][<I>aangle</I>][<I>/r/g/b</I>][<I>o</I>]]
-<BR>
-
-<I>anot_int</I> is annotation interval in data units.
-Ignored if contour levels are given in a file.
-[Default is no annotations].  Several options
-can be set to modify the form of the annotation.
-Append f<I>font_size</I> to change font size [9],
-append <I>/r/g/b</I> to change color of text fill box
-[PAGE_COLOR], append a<I>angle</I> to fix
-annotation angle [Default follows contour],
-and append 'o' to draw the outline of the
-surrounding text box [Default is no outline].
-<DT><B>-MCG</B>
-
-<DD>
-<I>gap/width</I> <B>-MCQ</B><I>cut </I>
-<BR>
-
-<I>gap</I> is distance in inch between each
-annotation along the same contour.
-<I>width</I> is number of points over which to
-estimate the best fitting slope
-for contour labels  [Default is 4/10].
-<DT><B>-MCQ</B>
-
-<DD>
-<I>cut</I>
-<BR>
-
-Do not draw contours with less than <I>cut</I> number
-of points [Draw all contours].
-<DT><B>-MCT</B>
-
-<DD>
-[<I>+|-</I>][<I>gap/length</I>][<I>:LH</I>]
-<BR>
-
-Will draw tickmarks pointing in the downward direction every <I>gap</I> along the innermost closed contours.  Append <I>gap</I> and tickmark length (in inch) or use defaults [0.2/0.05].
-User may choose to tick only local highs or local lows by specifying <B>-T+</B> or <B>-T-</B>, respectively.  Appending :LH will plot the characters L and H at the center of closed
-innermost contours (local lows and highs).  L and H can be any single character (e.g., LH, -+, etc.)
-If a file is given by <B>-C</B> and <B>-T</B> is set,
-then only contours marked with upper case C or A will have tickmarks [and anotation].
-<DT><B>-MCW</B>
-
-<DD>
-<I>type</I>[<I>pen</I>]
-<BR>
-
-<I>type</I>, if present, can be 'a' for annotated contours or 'c' for regular contours [Default].
-<I>pen</I> sets the attributes for the particular line.  Default values for annotated contours:
-width = 3, color = black, texture = solid.  Regular contours have default width = 1.
-<DT><B>-MNA</B>
-
-<DD>
-<I>[nhgt[/P] | P]</I>
-<BR>
-
-Turns on filename annotation of navigation tracks. If <B>-MNA</B> is given
-without specifying any controlling parameters, then the lettering height
-<I>nhgt</I> is 0.15 and the filenames are plotted parallel to the
-navigation track from the start of the track. The lettering height can be
-specified using either <B>-MNA</B><I>nhgt</I> or <B>-MNA</B><I>nhgt/P</I>.
-If <B>-MNA</B><I>P</I> or <B>-MNA</B><I>nhgt/P</I> is specified,
-the filename will be plotted perpendicular to the navigation track.
-Filename annotation can also be specified using the <B>-N</B> option.
-Defaults: Filename annotation off.
-<DT><B>-MNF</B>
-
-<DD>
-<I>format</I>
-<BR>
-
-Sets the data format for the input swath data specified with the <B>-MNI</B>
-option. If <I>format</I> < 0, then the input file specified
-with the <B>-MNI</B> option will actually contain a list of input swath sonar
-data files. This program uses the <B>MBIO</B> library and will read or
-write any swath sonar format supported by <B>MBIO</B>. A list of the
-swath sonar data formats currently supported by <B>MBIO</B> and their
-identifier values is given in the <B>MBIO</B> manual page.
-Default: <I>format</I> = -1.
-<DT><B>-MNI</B>
-
-<DD>
-<I>swathdata</I>
-<BR>
-
-This option causes the navigation track of swath data to be
-plotted. Here <I>swathdata</I> is the input file, and may be either
-a single swath file or a list of swath files. If <I>format</I> > 0
-(set with the <B>-MNF</B> option) then the swath sonar data
-contained in <I>swathdata</I> is read and processed. If <I>format</I> < 0
-(the default),  then <I>swathdata</I>
-is assumed to be an ascii file containing a list of the input swath sonar
-data files to be processed and their formats.  The program will read
-the data in each one of these files.
-In the <I>swathdata</I> file, each
-data file should be followed by a data format identifier, e.g.:
-<BR> <TT>       </TT>datafile1 11<BR>
-<BR> <TT>       </TT>datafile2 24<BR>
-<BR>
-
-This program uses the <B>MBIO</B> library and will read or write any swath sonar
-format supported by <B>MBIO</B>. A list of the swath sonar data formats
-currently supported by <B>MBIO</B> and their identifier values
-is given in the <B>MBIO</B> manual page.
-<DT><B>-MNN</B>
-
-<DD>
-[<I>ttick/tannot/dannot/tlen</I>[<I>/nhgt/nperp</I>] | <I>F</I> | <I>FP</I>]
-<BR>
-
-This option sets the annotation of the swath file navigation
-plot specified using the <B>-MNI</B> option.
-Time marks are made with "X" marks along the shiptrack; annotated
-time marks show the time in HH:MM format next to the time mark
-and annotated date marks show the time and julian day in
-HH:MM/DDD format.  The "X" marks are
-<I>tlen</I> inches high for normal time marks and
-1.5 times <I>tlen</I> inches high for annotated time or date
-marks.  The interval of time ticks, annotated time ticks, and
-annotated date ticks are given in hours by
-<I>ttick</I>, <I>tannot</I>, and <I>dannot</I>, respectively.
-If the <I>nhgt</I> parameter is not given when the other parameters
-are specified, then no filename annotation will be done. If given,
-<I>nhgt</I> sets the height in inches of the filename annotation
-and turns that annotation on. If given as 1,
-<I>nperp</I> causes the filename annotation to be perpendicular
-to the shiptrack rather than parallel (the default).
-If the <B>-MNN</B><I>F</I> is given, then
-a navigation track will be generated using the default parameters
-and also with filename annotation along the shiptrack. If the
-<B>-MNN</B><I>FP</I> is given, then a navigation track will be generated
-with the default parameters and also with filename annotation
-perpendicular to the shiptrack.
-Defaults: <I>ttick</I> = 0.25; <I>tannot</I> = 1.0; <I>dannot</I> = 4.0;
-<I>tlen</I> = 0.1; <I>nhgt</I> = 0.1; <I>nperp</I> = 0.
-<DT><B>-MNP</B>
-
-<DD>
-<I>[pingnumber_tick/pingnumber_annot/pingnumber_tick_len]</I>
-<BR>
-
-Turns on ping number (or shot number) annotation of navigation tracks.
-Tick marks are made along the shiptrack at <I>pingnumber_tick</I> intervals; these
-are <I>tlen</I> inches long. Longer tick marks are made along the
-shiptrack at <I>pingnumber_annot</I> intervals; these are 1.5 times <I>tlen</I>
-inches long.
-Defaults: Pingnumber annotation off. If the <B>-MNP</B> option is given without
-specifying the controlling parameters, then <I>pingnumber_tick</I> = 50,
-<I>pingnumber_annot</I> = 100, and <I>pingnumber_tick_len</I> = 0.1.
-<DT><B>-MTC</B>
-
-<DD>
-<I>fill</I>
-<BR>
-
-Coastline plotting option.
-Set the shade (0-255), color (r/g/b), or pattern
-(p|Pdpi/pattern; see <B>-MTG</B>) for lakes  [Default is the
-fill chosen for "wet" areas (-S)].
-<DT><B>-MTD</B>
-
-<DD>
-<I>resolution</I>
-<BR>
-
-Coastline plotting option.
-Selects the resolution of the coastline data set to use ((f)ull,
-(h)igh, (i)ntermediate, (1)ow, and (c)rude).  The
-resolution drops off by 80% between data sets. [Default
-is l].
-<DT><B>-MTG</B>
-
-<DD>
-<I>fill</I>
-<BR>
-
-Coastline plotting option.
-Select painting or clipping of "dry" areas.  Append a
-shade, color, pattern, or c for clipping.  Specify the
-shade (0-255) or color (r/g/b), or <B>-MTG</B><I>pdpi/pattern</I>,
-where pattern gives the number of the built-in pattern
-(1-90) OR the name of a Sun 1-, 8-, or 24-bit raster
-file.  dpi sets the resolution of the image.  See <B>GMT</B>
-Cookbook & Technical Reference Appendix E for
-information on individual patterns.
-<DT><B>-MTI</B>
-
-<DD>
-<I>river[/pen]</I>
-<BR>
-
-Coastline plotting option.
-Draw rivers.  Specify the type of rivers and
-[optionally] append pen attributes  [Default pen:
-width = 1, color = 0/0/0, texture = solid].  Choose
-from the list of river types below.  Repeat option -I
-as often as necessary.
-<BR>     1 = Permanent major rivers
-<BR>     2 = Additional major rivers
-<BR>     3 = Additional rivers
-<BR>     4 = Minor rivers
-<BR>     5 = Intermittent rivers - major
-<BR>     6 = Intermittent rivers - additional
-<BR>     7 = Intermittent rivers - minor
-<BR>     8 = Major canals
-<BR>     9 = Minor canals
-<BR>     10 = Irrigation canals
-<BR>     a = All rivers and canals (1-10)
-<BR>     r = All permanent rivers (1-4)
-<BR>     i = All intermittent rivers (5-7)
-<BR>     c = All canals (8-10)
-<DT><B>-MTN</B>
-
-<DD>
-<I>border[/pen]</I>
-<BR>
-
-Coastline plotting option.
-Draw political boundaries.  Specify the type of
-boundary and [optionally] append pen attributes
-[Default pen:  width = 1, color = 0/0/0, texture =
-solid].  Choose from the list of boundaries below.
-Repeat option <B>-MTN</B> as often as necessary.
-<BR>     1 = National boundaries
-<BR>     2 = State boundaries within the Americas
-<BR>     3 = Marine boundaries
-<BR>     a = All boundaries (1-3)
-<DT><B>-MTS</B>
-
-<DD>
-<I>fill</I>
-<BR>
-
-Coastline plotting option.
-Select painting or clipping of "wet" areas.  Append the
-shade (0-255), color (r/g/b), pattern (see <B>-MTG</B>), or c
-for clipping.
-<DT><B>-MTW</B>
-
-<DD>
-<I>pen</I>
-<BR>
-
-Coastline plotting option.
-Append pen attributes  [Defaults:  width = 1, color = 0/0/0,
-texture = solid].
-<DT><B>-MXG</B>
-
-<DD>
-<I>fill</I>
-<BR>
-
-Select filling of symbols for xy plotting.
-Set the shade (0-255) or color
-(r/g/b) [Default is no fill]. To reset no fill,
-use <I>fill</I> = "N".
-For polygons, you may optionally specify
-<B>-Gp</B><I>icon_size/pattern</I>, where
-<I>pattern</I> gives the number of the
-image pattern (1-32) OR the name of a
-icon-format file.  <I>icon_size</I> sets
-the unit size in inch.
-To invert black and white pixels, use
-<B>-GP</B> instead of <B>-Gp</B>.  See
-<B>GMTs</B> Cookbook & Technical Reference
-Appendix E for information on individual patterns.
-<DT><B>-MXI</B>
-
-<DD>
-<I>xy_file </I>
-<BR>
-
-Specifies a file containing (x,y) pairs to be plotted
-as lines or symbols. The line and symbol characteristics
-are set using the last <B>-MXG</B>, <B>-MXS</B>, and <B>-MXW</B>
-options used. All of the <B>-MX</B> commands can be
-given multiple times, so by stringing series of these
-commands together the user can plot different files
-using different line or symbol characteristics.
-[Default is a solid black line].
-<DT><B>-MXM</B>
-
-<DD>
-<BR>
-
-Toggles expectation for xy data files having multiple
-segments, in which each segment is to be plotted
-separately. Segments are separated by a
-record whose first character is '>'. By default,
-unsegmented files are expected. Users may give this
-command multiple times, allowing some input files to
-be handled as segmented and others not.
-<DT><B>-MXS</B>
-
-<DD>
-<I>symbol/size</I>
-<BR>
-
-Selects symbol to be used for plotting the next xy data
-file. Setting <I>symbol</I> = "N" causes line plotting.
-Choose between:
-<DT><B>-MXSa</B>
-
-<DD>
-st<B>a</B>r.  <I>size</I> is radius of circumscribing circle.
-<DT><B>-MXSb</B>
-
-<DD>
-<B>b</B>ar extending from <I>base</I> to y.  <I>size</I> is bar width.  By default,
-<I>base</I> = 0.  Append /<I>base</I> to change this value.  Append <B>u</B> if <I>size</I>
-is in x-units [Default is inch].
-<DT><B>-MXSc</B>
-
-<DD>
-<B>c</B>ircle.  <I>size</I> is diameter of circle.
-<DT><B>-MXSd</B>
-
-<DD>
-<B>d</B>iamond.  <I>size</I> is side of diamond.
-<DT><B>-MXSe</B>
-
-<DD>
-<B>e</B>llipse.  Direction (in degrees counterclockwise from horizontal), major_axis (in inch), and minor_axis (in inch) must be found in columns 3, 4, and 5.
-<DT><B>-MXSf</B>
-
-<DD>
-<B>f</B>ault.  Give distance gap between ticks and ticklength in inch.  If gap is
-negative, it is interpreted to mean number of ticks instead.  Append <B>l</B> or <B>r</B> to draw tick on
-the left or right side of line [Default is centered].  Upper case <B>L</B> or <B>R</B> draws a triangle
-instead of line segment.
-<DT><B>-MXSh</B>
-
-<DD>
-<B>h</B>exagon.  Give side in inch.
-<DT><B>-MXSi</B>
-
-<DD>
-<B>i</B>nverted triangle.  Give side in inch.
-<DT><B>-MXSl</B>
-
-<DD>
-<B>l</B>etter or text string.  Give size in inch, and append /<I>string</I> after the size.  Note that the size is only approximate; no individual scaling
-is done for different characters.  Remember to escape special characters like *.
-<DT><B>-MXSp</B>
-
-<DD>
-<B>p</B>oint.  No size needs to be specified (1 pixel is used).
-<DT><B>-MXSs</B>
-
-<DD>
-<B>s</B>quare.  Give side in inch.
-<DT><B>-MXSt</B>
-
-<DD>
-<B>t</B>riangle.  Give side in inch.
-<DT><B>-MXSv</B>
-
-<DD>
-<B>v</B>ector.  Direction (in degrees counterclockwise from horizontal) and length (in inch) must be found in columns 3 and 4.  <I>size</I>,
-if present, will be interpreted as arrowwidth/headlength/headwidth (in inch) [Default is 0.03/0.12/0.1 inch].
-By default arrow attributes remains invariant to the length
-of the arrow.  To have the size of the vector scale down with decreasing size,
-append nnorm, where vectors shorter than <I>norm</I> will have their
-attributes scaled by length/<I>norm</I>.
-<DT><B>-MXSV</B>
-
-<DD>
-Same as <B>-MXSv</B>, except azimuth (in degrees east of north) should be given instead of direction.  The azimuth will
-be mapped into an angle based on the chosen map projection (<B>-MXSv</B> leaves the directions
-unchanged.)
-<DT><B>-MXSx</B>
-
-<DD>
-cross.  Give length in inch.
-<DT><B>-MXW</B>
-
-<DD>
-<I>pen</I>
-<BR>
-
-Set pen attributes for xy plotting. See chapter 4.12 in the
-GMT Technical reference for a discussion of GMT pen values.
-[Defaults: width = 1, color = 0/0/0,
-texture = solid].
-<DT><B>-O</B>
-
-<DD>
-<I>root</I>
-<BR>
-
-Sets the root used to construct the filename of the output shellscript
-(<I>root</I>.cmd) and names of files created when the shellscript is
-run.  Normally the
-name of the input grid file or grid file list is
-used as the <I>root</I>.
-<DT><B>-P</B>
-
-<DD>
-<I>pagesize</I>
-<BR>
-
-This option sets the size of the page the plot will be centered
-on. If the user does not set the plot scale, the plot will be
-sized as large as will fit on the designated page. If the user
-sets the plot scale such that the plot will not fit on the
-designated page, a larger page will be used.
-The supported page sizes are:
-<P>
-<BR>          American ANSI sizes:
-<BR>          A     8.5 x 11.0 in.    ( 215.9 x  279.4 mm)
-<BR>          B    11.0 x 17.0 in.    ( 279.4 x  431.8 mm)
-<BR>          C    17.0 x 22.0 in.    ( 431.8 x  558.8 mm)
-<BR>          D    22.0 x 34.0 in.    ( 558.8 x  863.6 mm)
-<BR>          E    34.0 x 44.0 in.    ( 863.6 x 1117.6 mm)
-<BR>          F    28.0 x 40.0 in.    ( 711.2 x 1016.0 mm)
-<BR>          E1   44.0 x 68.0 in.    (1117.6 x 1727.2 mm)
-<P>
-<BR>          Metric ISO A sizes:
-<BR>          A0   841.0 x 1189.0 mm  (33.11 x 46.81 in.)
-<BR>          A1   594.0 x  841.0 mm  (23.39 x 33.11 in.)
-<BR>          A2   420.0 x  594.0 mm  (16.54 x 23.39 in.)
-<BR>          A3   297.0 x  420.0 mm  (11.69 x 16.54 in.)
-<BR>          A4   210.0 x  297.0 mm  ( 8.27 x 11.69 in.)
-<BR>          A5   148.0 x  210.0 mm  ( 5.83 x  8.27 in.)
-<BR>          A6   105.0 x  148.0 mm  ( 4.13 x  5.83 in.)
-<BR>          A7    74.0 x  105.0 mm  ( 2.91 x  4.13 in.)
-<BR>          A8    52.0 x   74.0 mm  ( 2.05 x  2.91 in.)
-<BR>          A9    37.0 x   52.0 mm  ( 1.46 x  2.05 in.)
-<BR>          A10   26.0 x   37.0 mm  ( 1.02 x  1.46 in.)
-<P>
-<BR>          Metric ISO B sizes:
-<BR>          B0   1000.0x 1414.0 mm  (39.37 x 55.67 in.)
-<BR>          B1   707.0 x 1000.0 mm  (27.83 x 39.37 in.)
-<BR>          B2   500.0 x  707.0 mm  (19.68 x 27.83 in.)
-<BR>          B3   353.0 x  500.0 mm  (13.90 x 19.68 in.)
-<BR>          B4   250.0 x  353.0 mm  ( 9.84 x 13.90 in.)
-<BR>          B5   176.0 x  250.0 mm  ( 6.93 x  9.84 in.)
-<BR>          B6   125.0 x  176.0 mm  ( 4.92 x  6.93 in.)
-<BR>          B7    88.0 x  125.0 mm  ( 3.46 x  4.92 in.)
-<BR>          B8    62.0 x   88.0 mm  ( 2.44 x  3.46 in.)
-<BR>          B9    44.0 x   62.0 mm  ( 1.73 x  2.44 in.)
-<BR>          B10   31.0 x   44.0 mm  ( 1.22 x  1.73 in.)
-<P>
-<BR>          Metric ISO C sizes:
-<BR>          C0   914.4 x 1300.5 mm  (36.00 x 51.20 in.)
-<BR>          C1   650.2 x  914.4 mm  (25.60 x 36.00 in.)
-<BR>          C2   457.2 x  650.2 mm  (18.00 x 25.60 in.)
-<BR>          C3   325.1 x  457.2 mm  (12.80 x 18.00 in.)
-<BR>          C4   228.6 x  325.1 mm  ( 9.00 x 12.80 in.)
-<BR>          C5   162.6 x  228.6 mm  ( 6.40 x  9.00 in.)
-<BR>          C6   114.3 x  162.6 mm  ( 4.50 x  6.40 in.)
-<BR>          C7    81.3 x  114.3 mm  ( 3.20 x  4.50 in.)
-<P>
-<TT>        </TT>  MB-System large format sizes:<BR>
-<BR>          m1  1371.6 x 1828.8 mm  (54.00 x 72.00 in.)
-<BR>          m2  1371.6 x 2133.6 mm  (54.00 x 84.00 in.)
-<BR>          m3  1371.6 x 2438.4 mm  (54.00 x 96.00 in.)
-<BR>          m4  1524.0 x 1828.8 mm  (60.00 x 72.00 in.)
-<BR>          m5  1524.0 x 2133.6 mm  (60.00 x 84.00 in.)
-<BR>          m6  1524.0 x 2438.4 mm  (60.00 x 96.00 in.)
-<P>
-The default page size is A.
-<DT><B>-Q</B>
-
-<DD>
-Normally, the output plot generation shellscript
-includes lines which execute
-a program to display the Postscript image on the screen.
-This option causes those lines to be commented out so
-that executing the shellscript produces a Postscript plot
-but does not attempt to display it on the screen.
-Alternatively, invoking the plot generation shellscript with
-a <B>-N</B> command line argument also suppresses the screen
-display of the plot.
-The program
-to be used to display the Postscript is set
-using <B>mbdefaults</B>;
-the default value can be overridden by setting the environment
-variable $MB_PS_VIEWER.
-<DT><B>-R</B>
-
-<DD>
-<I>west/east/south/north</I>
-<BR>
-
-<I>west, east, south,</I> and <I>north</I> specify the Region of interest.  To specify boundaries
-in degrees and minutes [and seconds], use the dd:mm[:ss] format.  Append <B>r</B> if lower left and upper right
-map coordinates are given instead of wesn.
-You may ask for a larger <I>w/e/s/n</I> region to have more room between the image and the axes.
-A smaller region than specified in the grdfile will result in a subset of the grid [Default is
-region given by the grdfile].
-<DT><B>-S</B>
-
-<DD>
-<I>[color/shade]</I>
-<BR>
-
-This option enables effective histogram equalization of the
-color and/or shading of the gridded data. The equalization is
-not achieved by changing the data values, but rather by
-constructing the color or shading tables so that
-the boundaries in the tables encompass equal fractions of
-the datapoints. This serves to focus color or shading contrasts
-in value ranges corresponding to the bulk of the data values.
-If <B>-S</B> is given alone or with <I>color</I> = 1,
-it enables equalization of the color table used
-for color or gray fill plots,  shaded or unshaded. If the plot
-is to be shaded,  either by synthetic illumination (<B>-G</B><I>2</I>)
-or using an intensity file (<B>-K</B> and <B>-G</B><I>3</I> options), then
-setting <I>shade</I> = 1 will cause the shading to be equalized.
-Using <B>-S</B><I>0/1</I> will equalize the shading without
-equalizing the color table.
-<DT><B>-T</B>
-
-<DD>
-If <B>-T</B> is given, it causes a coastline to be drawn
-on the map. The default is to draw the coastline as the thinnest possible
-line. To exercise greater control of
-the coastline plotting, including color fill of "dry" areas and
-display of lakes, rivers, and political boundaries, use the
-<B>-MTC</B>, <B>-MTD</B>, <B>-MTG</B>, <B>-MTI</B>,
-<B>-MTN</B>, <B>-MTS</B>, and <B>-MTW</B> options.
-<DT><B>-U</B>
-
-<DD>
-<I>orientation</I>
-<BR>
-
-Normally the orientation of the plot (portrait or landscape)
-is selected automatically so as to maximize the plot scale.
-The <B>-U</B> option allows the user to set the plot orientation. If
-<I>orientation</I> = 1, a portrait plot will be produced; if
-<I>orientation</I> = 2, a landscape plot will be produced.
-<DT><B>-V</B>
-
-<DD>
-Causes <B>mbm_grdplot</B> to operate in "verbose" mode
-so that it outputs
-more information than usual.
-<DT><B>-W</B>
-
-<DD>
-<I>[color_style</I>[<I>/palette</I>[<I>ncolors</I>]] | cptfile]
-<BR>
-
-This option controls the color scheme used for color
-fill plots.
-<P>
-If <I>color_style</I> = 1 [default], then
-the color scheme used will be a continuous grading
-of colors. If <I>color_style</I> = 2, the color scheme
-will be a set of discrete color intervals. The color
-palette used is set using <I>palette</I>. Seven palettes
-are available:
-<BR> <TT>       </TT><I>palette</I> = 1:<TT>    </TT>Haxby colors [default]<BR>
-<BR> <TT>       </TT><I>palette</I> = 2:<TT>    </TT>high Intensity colors<BR>
-<BR> <TT>       </TT><I>palette</I> = 3:<TT>    </TT>low Intensity colors<BR>
-<BR> <TT>       </TT><I>palette</I> = 4:<TT>    </TT>grayscale<BR>
-<BR> <TT>       </TT><I>palette</I> = 5:<TT>    </TT>uniform grayscale<BR>
-<BR> <TT>       </TT><I>palette</I> = 6:<TT>    </TT>uniform black<BR>
-<BR> <TT>       </TT><I>palette</I> = 7:<TT>    </TT>uniform white<BR>
-<BR> <TT>       </TT><I>palette</I> = 8:<TT>    </TT>sealevel 1<BR>
-<BR> <TT>       </TT><I>palette</I> = 9:<TT>    </TT>sealevel 2<BR>
-<P>
-The RGB definitions of the color palettes are:
-<P>
-color palette 1 - Haxby Color Table
-<BR>  red:   255 255 255 255 240 205 138 106  50  40  37
-<BR>  green: 255 186 161 189 236 255 236 235 190 127  57
-<BR>  blue:  255 133  68  87 121 162 174 255 255 251 175
-<P>
-color palette 2 - High Intensity Colors
-<BR>  red:   255 255 255 255 128   0   0   0   0 128 255
-<BR>  green:   0  64 128 255 255 255 255 128   0   0   0
-<BR>  blue:    0   0   0   0   0   0 255 255 255 255 255
-<P>
-color palette 3 - Low Intensity Colors
-<BR>  red:   200 194 179 141  90   0   0   0   0  90 141
-<BR>  green:   0  49  90 141 179 200 141  90   0   0   0
-<BR>  blue:    0   0   0   0   0   0 141 179 200 179 141
-<P>
-color palette 4 - Grayscale
-<BR>  red:   255 230 204 179 153 128 102  77  51  26   0
-<BR>  green: 255 230 204 179 153 128 102  77  51  26   0
-<BR>  blue:  255 230 204 179 153 128 102  77  51  26   0
-<P>
-color palette 5 - Uniform Grayscale
-<BR>  red:   128 128 128 128 128 128 128 128 128 128 128
-<BR>  green: 128 128 128 128 128 128 128 128 128 128 128
-<BR>  blue:  128 128 128 128 128 128 128 128 128 128 128
-<P>
-color palette 6 - Uniform Black
-<BR>  red:     0   0   0   0   0   0   0   0   0   0   0
-<BR>  green:   0   0   0   0   0   0   0   0   0   0   0
-<BR>  blue:    0   0   0   0   0   0   0   0   0   0   0
-<P>
-color palette 7 - Uniform White
-<BR>  red:   255 255 255 255 255 255 255 255 255 255 255
-<BR>  green: 255 255 255 255 255 255 255 255 255 255 255
-<BR>  blue:  255 255 255 255 255 255 255 255 255 255 255
-<P>
-color pallette 8 - Sealevel 1
-<BR>  (colors here used above zero Haxby colors below)
-<BR>  red:   250 245 240 235 230 221 212 211 210 205 200
-<BR>  green: 250 240 230 221 212 201 190 180 170 160 150
-<BR>  blue:  120 112 104  96  88  80  72  64  56  48  40
-<P>
-color pallette 9 - Sealevel 2
-<BR>  (colors here used above zero Haxby colors below)
-<BR>  red:   255 210 170 145 120 120 104  67  33   0   0
-<BR>  green: 255 200 160 145 130 100 107 123 140 160 230
-<BR>  blue:  100  75  50  45  40  30  24   7   0   0   0
-<P>
-The Haxby colors have been adapted from a palette
-developed by Dr. William Haxby of the Lamont-Doherty
-Earth Observatory; this palette is pleasing to the
-eye and well suited for shading. The high intensity
-colors describe linear paths through RGB space from
-red to blue to green to purple; because the colors are high
-intensity they are not well suited to shading.
-The low intensity colors are similar to the high
-intensity, but muted and thus well suited to shading.
-The grayscale palette runs linearly from white to
-black and is commonly used for plots of sidescan and amplitude
-data. The uniform grayscale is useful for non-color
-shaded relief plots.
-<P>
-The <I>ncolors</I> parameter sets the number of color
-values used in plotting, whether the colors are
-represented in a continuous color scale or a
-stepped, discrete color scale [default is 11].
-<P>
-If the option argument is the path to an existing <B>GMT</B>
-color palette (CPT) file, then that CPT file and its
-color scheme will be used for the plot
-<DT><B>-X</B>
-
-<DD>
-Normally, <B>mbm_grdplot</B> creates an executable shellscript and
-then exits.  This option will cause the shellscript to be executed
-in the background before <B>mbm_grdplot</B> exits.
-<DT><B>-Y</B>
-
-<DD>
-Normally, <B>mbm_grdplot</B> generates nicely rounded numbers
-for the boundaries of the color palette. Often, the resulting
-color bounds extend well outside the range of the gridded data.
-This option causes the minimum and maximum color boundaries to
-exactly conform to the minimum and maximum values of the grid,
-or, if the <B>-Z</B> option is used, the minimum and maximum
-values specified by the user.
-<DT><B>-Z</B>
-
-<DD>
-<I>min/max[/mode]</I>
-<BR>
-
-This option overrides the minimum and maximum values of
-the gridded data, affecting the color palette and the
-contour interval if those parameters are not specified
-by the user. By default (i.e. <I>mode</I> is omitted
-or equal to 0), the macro selects the color palette bounds
-so that they encompass <I>min</I> and <I>max</I> while using
-nicely rounded numbers. If <I>mode</I> is omitted or equal
-to 0, then the color palette will end near <I>min</I> and
-<I>max</I> whether it is linear stretched or histogram equalized.
-If <I>mode</I> = 1, then the color stretching calculations
-will be done using <I>min</I> and <I>max</I>, but then the
-first and last values in the color palette will be set to
-the actual minimum and maximum values.so that all the data
-are displayed.
-<P>
-</DL>
-<A NAME="lbAI"> </A>
-<H2>EXAMPLES</H2>
-
-Suppose we have obtained two GRD files with dimensions of
-127 by 194, one containing gridded bathymetry
-(grd_sb2112_example_bath) and the other gridded sidescan
-(grd_sb2112_example_ss). In order to generate a shellscript
-which will in turn generate a contour plot of the bathymetry,
-the following will suffice:
-<P>
-<BR>  <TT>      </TT>mbm_grdplot -Igrd_sb2112_example_bath -C \<BR>
-<BR>  <TT>      </TT>    -V -Ogrd_sb2112_example_bathcont<BR>
-<P>
-In order to generate a color fill plot overlaid by
-contours, we use both the -G1 and -C options.
-Because the data has been gridded as bathymetry (positive
-down) rather than as topography (positive up), the default
-plot will have "hot" colors for deep regions and "cold"
-colors for shallow regions; this is the opposite of the
-convention we usually use. In order to fix the colors, we have
-to either rescale the data by multiplying the bathymetry
-by -1 (accomplished with -MGS-1), or flip the color
-palette (accomplished with -D). We use the latter approach:
-<P>
-<BR>  <TT>      </TT>mbm_grdplot -Igrd_sb2112_example_bath -G1 -C -D \<BR>
-<BR>  <TT>      </TT>    -V -Ogrd_sb2112_example_bathfill<BR>
-<P>
-In order to generate a grayscale plot of the sidescan grid,
-we use -G1 and -W1/4. We also use -D so that high sidescan
-amplitudes are shown as dark.
-<P>
-<BR>  <TT>      </TT>mbm_grdplot -Igrd_sb2112_example_ss -G1 -D \<BR>
-<BR>  <TT>      </TT>    -V -Ogrd_sb2112_example_ssfill<BR>
-<P>
-Now consider generating a shaded relief view of the
-gridded bathymetry. We choose to illuminate
-the bathymetry from the northeast (azimuth of 45 degrees)
-and to use a shading magnitude of 0.4 (-A0.4/45).
-Because this grid is so small, the default shaded
-relief image is likely to be grainy. To fix this problem, we
-specify a dots per inch resolution of 72 (-MGQ72); this
-will take longer and generate a larger plotfile, but the
-plot will look better. We also use the -L option to specify
-the title and color scale label for the plot.  We also use
-the -X flag this so that the plot generation shellscript is
-executed immediately. Here is the command:
-<P>
-<BR>  <TT>      </TT>mbm_grdplot -Igrd_sb2112_example_bath \<BR>
-<BR>  <TT>      </TT>    -G2 -A0.4/45 -D -MGQ72 -X -V \<BR>
-<BR>  <TT>      </TT>    -L"Shaded Relief Bathymetry":"Depth (meters)" \<BR>
-<BR>  <TT>      </TT>    -Osb2112_example_bathshade<BR>
-<P>
-Now, consider generating a plot of the bathymetry
-overlaid with the gridded sidescan.
-The sidescan overlay is specified using the -K option.
-We want the colors for the bathymetry to be chosen without
-histogram equalization, but we also want histogram
-equalization to be applied to the sidescan data used for
-shading. To do this, we use -S0/1, where the first number
-(0) specifies no histogram equalization of the color
-scale and the second number (1) causes histogram
-equalization of the shading sidescan data to be
-implemented. In order to maintain the convention that
-high sidescan amplitudes are black, we flip both the
-color palette (as in the previous example) and the
-shading scale with -D1/1. We could also flip the shading
-by specifying a negative shading magnitude (-A-0.4).
-In this case, we forgo specifying the image resolution,
-resulting in a grainy plot:
-<P>
-<BR>  <TT>      </TT>mbm_grdplot -Igrd_sb2112_example_bath \<BR>
-<BR>  <TT>      </TT>    -G3 -Kgrd_sb2112_example_ss \<BR>
-<BR>  <TT>      </TT>    -S0/1 -D1/1 -A0.4 -X -V \<BR>
-<BR>  <TT>      </TT>    -L"Bathymetry Overlaid With Sidescan":"Depth (meters)" \<BR>
-<BR>  <TT>      </TT>    -Osb2112_example_bathss<BR>
-<P>
-As an example, the contents of the plotting shellscript
-"grd_sb2112_example_bathfill.cmd" are:
-<P>
-<BR>
-
-<BR> #
-<BR> # Shellscript to create Postscript plot of data in grd file
-<BR> # Created by macro mbm_grdplot
-<BR> #
-<BR> # This shellscript created by following command line:
-<BR> # mbm_grdplot -Igrd_sb2112_example_bath -G1 -C -D \
-<BR> #<TT>      </TT>-V -Ogrd_sb2112_example_bathfill<BR>
-<BR> #
-<BR> # Save existing GMT defaults
-<BR> echo Saving GMT defaults...
-<BR> gmtdefaults -L > gmtdefaults$$
-<BR> #
-<BR> # Set new GMT defaults
-<BR> echo Setting new GMT defaults...
-<BR> gmtset ANOT_FONT Helvetica
-<BR> gmtset LABEL_FONT Helvetica
-<BR> gmtset HEADER_FONT Helvetica
-<BR> gmtset ANOT_FONT_SIZE 8
-<BR> gmtset LABEL_FONT_SIZE 8
-<BR> gmtset HEADER_FONT_SIZE 10
-<BR> gmtset FRAME_WIDTH 0.074999999999999997
-<BR> gmtset TICK_LENGTH 0.074999999999999997
-<BR> gmtset PAGE_ORIENTATION LANDSCAPE
-<BR> gmtset COLOR_BACKGROUND 0/0/0
-<BR> gmtset COLOR_FOREGROUND 255/255/255
-<BR> gmtset COLOR_NAN 255/255/255
-<BR> #
-<BR> # Make color palette table file
-<BR> echo Making color palette table file...
-<BR> echo   3000 255 255 255   3150 255 186 133 > \
-<TT>        </TT><TT>        </TT>grd_sb2112_example_bathfill.cpt<BR>
-<BR> echo   3150 255 186 133   3300 255 161  68 >> \
-<TT>        </TT><TT>        </TT>grd_sb2112_example_bathfill.cpt<BR>
-<BR> echo   3300 255 161  68   3450 255 189  87 >> \
-<TT>        </TT><TT>        </TT>grd_sb2112_example_bathfill.cpt<BR>
-<BR> echo   3450 255 189  87   3600 240 236 121 >> \
-<TT>        </TT><TT>        </TT>grd_sb2112_example_bathfill.cpt<BR>
-<BR> echo   3600 240 236 121   3750 205 255 162 >> \
-<TT>        </TT><TT>        </TT>grd_sb2112_example_bathfill.cpt<BR>
-<BR> echo   3750 205 255 162   3900 138 236 174 >> \
-<TT>        </TT><TT>        </TT>grd_sb2112_example_bathfill.cpt<BR>
-<BR> echo   3900 138 236 174   4050 106 235 255 >> \
-<TT>        </TT><TT>        </TT>grd_sb2112_example_bathfill.cpt<BR>
-<BR> echo   4050 106 235 255   4200  50 190 255 >> \
-<TT>        </TT><TT>        </TT>grd_sb2112_example_bathfill.cpt<BR>
-<BR> echo   4200  50 190 255   4350  40 127 251 >> \
-<TT>        </TT><TT>        </TT>grd_sb2112_example_bathfill.cpt<BR>
-<BR> echo   4350  40 127 251   4500  37  57 175 >> \
-<TT>        </TT><TT>        </TT>grd_sb2112_example_bathfill.cpt<BR>
-<BR> #
-<BR> # Make color image
-<BR> echo Running grdimage...
-<BR> grdimage grd_sb2112_example_bath -Jm24.418434289993325 \
-<BR>
-
-<BR>        -R114.221/114.421/-31.9001/-31.6377 \
-<BR>
-
-<BR>        -Cgrd_sb2112_example_bathfill.cpt \
-<BR>
-
-<BR>        -P -X1.8081565710006675 -Y2 -K -V \
-<BR>
-
-<BR>        > grd_sb2112_example_bathfill.ps
-<BR>
-
-<BR> #
-<BR> # Make contour plot
-<BR> echo Running grdcontour...
-<BR> grdcontour grd_sb2112_example_bath -Jm24.418434289993325 \
-<BR>
-
-<BR>        -R114.221/114.421/-31.9001/-31.6377 \
-<BR>
-
-<BR>        -C50 \
-<BR>
-
-<BR>        -L3144.51/4499.44 -Wc1p \
-<BR>
-
-<BR>        -P -K -O -V >> grd_sb2112_example_bathfill.ps
-<BR> #
-<BR>
-
-<BR> # Make color scale
-<BR> echo Running psscale...
-<BR> psscale -Cgrd_sb2112_example_bathfill.cpt \
-<BR>
-
-<BR>        -D2.4418/-0.5000/4.8837/0.1500h \
-<BR>
-
-<BR>        -B":.Data Values:" \
-<BR>
-
-<BR>        -P -K -O -V >> grd_sb2112_example_bathfill.ps
-<BR>
-
-<BR> #
-<BR> # Make basemap
-<BR> echo Running psbasemap...
-<BR> psbasemap -Jm24.418434289993325 \
-<BR>
-
-<BR>        -R114.221/114.421/-31.9001/-31.6377 \
-<BR>
-
-<BR>        -B5m/5m:."Data File grd_sb2112_example_bath": \
-<BR>
-
-<BR>        -P -O -V >> grd_sb2112_example_bathfill.ps
-<BR>
-
-<BR> #
-<BR> # Delete surplus files
-<BR> echo Deleting surplus files...
-<BR> rm -f grd_sb2112_example_bathfill.cpt
-<BR> #
-<BR> # Reset GMT default fonts
-<BR> echo Resetting GMT fonts...
-<BR> mv gmtdefaults$$ .gmtdefaults
-<BR> #
-<BR> # Run xpsview
-<BR> echo Running xpsview in background...
-<BR> xpsview -ps a -maxp 4m grd_sb2112_example_bathfill.ps &
-<BR> #
-<BR> # All done!
-<BR> echo All done!
-<P>
-<A NAME="lbAJ"> </A>
-<H2>SEE ALSO</H2>
-
-<B>grdimage</B>(1), <B>grdcontour</B>(1),
-<B><A HREF="mbdefaults.html">mbdefaults</A></B>(1), <B><A HREF="mbgrid.html">mbgrid</A></B>(1), <B><A HREF="mbsystem.html">mbsystem</A></B>(1),
-<B><A HREF="mbm_grd3dplot.html">mbm_grd3dplot</A></B>(1), <B><A HREF="mbm_plot.html">mbm_plot</A></B>(1),
-<B>psbasemap</B>(1), <B>pstext</B>(1), <B>psxy</B>(1)
-<P>
-<A NAME="lbAK"> </A>
-<H2>BUGS</H2>
-
-By making this macro more useful, we have also made it
-more complex.
-<P>
-
-<HR>
-<A NAME="index"> </A><H2>Index</H2>
-<DL>
-<DT><A HREF="#lbAB">NAME</A><DD>
-<DT><A HREF="#lbAC">VERSION</A><DD>
-<DT><A HREF="#lbAD">SYNOPSIS</A><DD>
-<DT><A HREF="#lbAE">DESCRIPTION</A><DD>
-<DT><A HREF="#lbAF">AUTHORSHIP</A><DD>
-<DT><A HREF="#lbAG">SIMPLE DESCRIPTION OF BASIC OPTIONS</A><DD>
-<DT><A HREF="#lbAH">COMPLETE DESCRIPTION OF OPTIONS</A><DD>
-<DT><A HREF="#lbAI">EXAMPLES</A><DD>
-<DT><A HREF="#lbAJ">SEE ALSO</A><DD>
-<DT><A HREF="#lbAK">BUGS</A><DD>
-</DL>
-<HR>
-</PRE>
-
-<CENTER><P><BR>
-Last Updated: 9 January 2015</P></CENTER>
-
-<HR>
-<P><A HREF="mbsystem_man_list.html">Return to list of MB-System manual pages...</A></P>
-<P><A HREF="mbsystem_home.html"><IMG SRC="mbsystem_logo_small.gif" BORDER=0 HEIGHT=55 WIDTH=158 ALIGN=BOTTOM></A><A HREF="mbsystem_home.html">Back
-to MB-System Home Page...</A></P>
-
-</BODY>
-</HTML>
diff --git a/src/html/mbm_grdtiff.html b/src/html/mbm_grdtiff.html
deleted file mode 100644
index 2beb578..0000000
--- a/src/html/mbm_grdtiff.html
+++ /dev/null
@@ -1,862 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<HTML VERSION="2.0">
-<HEAD>
-   <TITLE>MB-System Unix Manual Page: mbm_grdtiff</TITLE>
-<!-- WEBMAGIC VERSION NUMBER="2.0.2" -->
-<!-- WEBMAGIC TRANSLATION NAME="ServerRoot" SRC="/var/www/htdocs/" DST="/" -->
-<!-- WEBMAGIC TRANSLATION NAME="ProjectRoot" SRC="./" DST="" -->
-</HEAD>
-<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#336699" VLINK="#997040" ALINK="#CC9900">
-<BODY>
-<CENTER><H3><U>MB-System Unix Manual Page</U></H3></CENTER>
-<PRE>
-<H1>mbm_grdtiff</H1>
-Section:  MB-System 5.0  (1)<BR>Updated:  28 September 2013 <BR><A HREF="#index">Index</A>
-<HR>
-
-<A NAME="lbAB"> </A>
-<H2>NAME</H2>
-
-<B>mbm_grdtiff</B> - Create an executable shellscript which will generate
-a TIFF image of gridded data in a GMT grd file.
-<P>
-<A NAME="lbAC"> </A>
-<H2>VERSION</H2>
-
-Version 5.0
-<P>
-<A NAME="lbAD"> </A>
-<H2>SYNOPSIS</H2>
-
-<B>mbm_grdtiff</B> <B>-I</B><I>file</I>
-[<B>-A</B><I>magnitude[/azimuth/elevation]</I>
-<B>-G</B><I>color_mode</I> <B>-H</B> <B>-K</B><I>intensity_file</I>
-<B>-O</B><I>root</I> <B>-S</B><I>[color/shade]</I>
-<B>-V</B>
-<B>-W</B><I>[color_style</I>[<I>/palette</I>[<I>ncolors</I>]] | <I>cptfile]</I> ]
-<P>
-<P>
-Additional Options:
-<BR>
-
-[<B>-D</B><I>flipcolor/flipshade</I>
-<B>-MGS</B><I>scalefactor</I> <B>-MGW</B> <B>-Q</B> <B>-R</B><I>w/e/s/n</I>
-<B>-X</B> <B>-Y</B> <B>-Z</B><I>min/max[/mode]</I>]
-<P>
-<A NAME="lbAE"> </A>
-<H2>DESCRIPTION</H2>
-
-<B>mbm_grdtiff</B> is a macro to generate a shellscript
-which, when executed, will use the program <B>mbgrdtiff</B> to
-generate a geographically located TIFF image of gridded
-data. The primary purpose of this macro is to allow the simple,
-semi-automated production of a nice looking image with a few
-command line arguments. Several styles of images can be generated, including
-color fill and shaded relief maps. The available options mirror
-a subset of the options in <B>mbm_grdplot</B>, allowing users to easily
-generate equivalent Postscript plots and TIFF images of gridded
-data. The program <B>mbgrdtiff</B> recognizes the coordinate system
-used by <B>mbgrid</B> or <B>mbmosaic</B> to generate a grid file, and
-then embeds the projection and grid bounds information into the TIFF
-image in accordance with the GeoTIFF standard. A number of GIS software
-packages recognize the georeferencing information in GeoTIFF images.
-In particular, images generated by <B>mbgrdtiff</B> from grids created
-using <B>mbgrid</B> or <B>mbmosaic</B> can be loaded into the
-GRASS, ArcInfo, ArcView, and ArcGIS GIS packages as geographically located
-coverages. The <B>mbgrid</B> and <B>mbmosaic</B> manual pages each contain
-an appendix with a complete list of the projected coordinate systems that
-may used in grid generation. Some software packages (e.g. Winfrog) do not
-recognize the embedded coordinate system information, and install require
-a parallel "world" file to specify the bounds and resolution. The <B>-MGW</B>
-option causes a world file to be generated with a ".tfw" suffix.
-<P>
-<A NAME="lbAF"> </A>
-<H2>AUTHORSHIP</H2>
-
-David W. Caress (<A HREF="mailto:caress at mbari.org">caress at mbari.org</A>)
-<BR>
-
-<BR>  Monterey Bay Aquarium Research Institute
-<BR>
-
-Dale N. Chayes (<A HREF="mailto:dale at ldeo.columbia.edu">dale at ldeo.columbia.edu</A>)
-<BR>
-
-<BR>  Lamont-Doherty Earth Observatory
-<P>
-<A NAME="lbAG"> </A>
-<H2>SIMPLE DESCRIPTION OF BASIC OPTIONS</H2>
-
-<DL COMPACT>
-<DT><B>-A</B>
-
-<DD>
-<I>magnitude[/azimuth/elevation]</I>
-<BR>
-
-Sets the parameters which control the
-synthetic illumination of the gridded data (shaded relief).
-The value <I>magnitude</I>
-is an effective vertical exageration which modulates the intensity of
-the shading; typical values are in the 0.1 to 10 range.
-The value <I>azimuth</I>
-is the azimuth in degrees from north from which the data is illuminated.
-The value <I>elevation</I> is the elevation of the illumination
-in degrees from horizontal.
-Defaults: <I>magnitude</I> = 0.2; <I>azimuth</I> = 0.0;
-<I>elevation</I> = 30.0;
-<DT><B>-C</B>
-
-<DD>
-<I>contour_control</I>
-<BR>
-
-If <B>-C</B> is given alone, it causes unannotated contours
-to be drawn using a contour interval calculated from the
-data. The user may also use <I>contour_control</I>
-to specify the contour interval. See the COMPLETE DESCRIPTION OF OPTIONS
-section below for a more complete discussion.
-<DT><B>-D</B>
-
-<DD>
-<I>[flipcolor/flipshade]</I>
-<BR>
-
-Normally, the color or grayscale tables used for color maps run from
-cool colors (or dark grays) for low grid values
-to hot colors (or light grays) for high grid values.
-This option reverses the color table so that cool colors (dark grays)
-correspond to high values and hot colors (light grays) to low values.
-If <B>-D</B> is given alone, it applies to the color table used
-for color or gray fill plots,  shaded or unshaded. If the plot
-is to be shaded,  either by synthetic illumination (<B>-G</B><I>2</I>)
-or using an intensity file (<B>-K</B> and <B>-G</B><I>3</I> options), then
-setting <I>flipshade</I> = 1 will cause the shading convention
-to be reversed (e.g. high intensities overlaid as light shading).
-Using <B>-D</B><I>0/1</I> will flip the shading convention
-but leave the default color convention.
-<DT><B>-G</B>
-
-<DD>
-<I>color_mode</I>
-<BR>
-
-Turns on color fill plot and sets the style of the plot.
-<BR>
-
-<BR>        <I>color_mode</I> = 1: Color/gray fill.
-<BR>        <I>color_mode</I> = 2: Color/gray fill shaded by
-<BR>                        synthetic illumination.
-<BR>        <I>color_mode</I> = 3: Color/gray fill shaded by
-<BR>                        an intensity file. The <B>-K</B>
-<BR>                        option must be used to specify
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT>the intensity file.<BR>
-<BR>        <I>color_mode</I> = 4: Color/gray fill of slope
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT>magnitude.<BR>
-<BR>        <I>color_mode</I> = 5: Color/gray fill shaded by
-<BR>                        slope magnitude.
-<DT><B>-H</B>
-
-<DD>
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-<DT><B>-I</B>
-
-<DD>
-<I>grdfile</I>
-<BR>
-
-Sets the name of the gridded data file to be plotted.
-Alternatively, <I>grdfile</I> may be a list of grid files
-(one filename on each line) to be plotted together.
-<DT><B>-K</B>
-
-<DD>
-<I>intensity_file</I>
-<BR>
-
-Sets the name of the gridded data file containing
-instensity values to be used for shading the map.
-Alternatively, <I>grdfile</I> may be a list of grid files
-(one filename on each line) to be used together. If a
-list of file is supplied, the intensity files must
-conform in order to the data grid files they will shade.
-<DT><B>-O</B>
-
-<DD>
-<I>root</I>
-<BR>
-
-Sets the root used to construct the filename of the output shellscript
-(<I>root</I>.cmd) and names of files created when the shellscript is
-run.  Normally the
-name of the input grid file or grid file list is
-used as the <I>root</I>.
-<DT><B>-S</B>
-
-<DD>
-<I>[color/shade]</I>
-<BR>
-
-This option enables effective histogram equalization of the
-color and/or shading of the gridded data. The equalization is
-not achieved by changing the data values, but rather by
-constructing the color or shading tables so that
-the boundaries in the tables encompass equal fractions of
-the datapoints. This serves to focus color or shading contrasts
-in value ranges corresponding to the bulk of the data values.
-If <B>-S</B> is given alone or with <I>color</I> = 1,
-it enables equalization of the color table used
-for color or gray fill plots,  shaded or unshaded. If the plot
-is to be shaded,  either by synthetic illumination (<B>-G</B><I>2</I>)
-or using an intensity file (<B>-K</B> and <B>-G</B><I>3</I> options), then
-setting <I>shade</I> = 1 will cause the shading to be equalized.
-Using <B>-S</B><I>0/1</I> will equalize the shading without
-equalizing the color table.
-<DT><B>-U</B>
-
-<DD>
-<I>orientation</I>
-<BR>
-
-Normally the orientation of the plot (portrait or landscape)
-is selected automatically so as to maximize the plot scale.
-The <B>-U</B> option allows the user to set the plot orientation. If
-<I>orientation</I> = 1, a portrait plot will be produced; if
-<I>orientation</I> = 2, a landscape plot will be produced.
-<DT><B>-V</B>
-
-<DD>
-Causes <B>mbm_grdtiff</B> to operate in "verbose" mode
-so that it outputs
-more information than usual.
-<DT><B>-W</B>
-
-<DD>
-<I>[color_style</I>[<I>/palette</I>[<I>ncolors</I>]] | cptfile]
-<BR>
-
-This option controls the color scheme used for color
-fill plots.
-<P>
-If <I>color_style</I> = 1 [default], then
-the color scheme used will be a continuous grading
-of colors. If <I>color_style</I> = 2, the color scheme
-will be a set of discrete color intervals. The color
-palette used is set using <I>palette</I>. Five palettes
-are available:
-<BR> <TT>       </TT><I>palette</I> = 1:<TT>    </TT>Haxby colors [default]<BR>
-<BR> <TT>       </TT><I>palette</I> = 2:<TT>    </TT>high Intensity colors<BR>
-<BR> <TT>       </TT><I>palette</I> = 3:<TT>    </TT>low Intensity colors<BR>
-<BR> <TT>       </TT><I>palette</I> = 4:<TT>    </TT>grayscale<BR>
-<BR> <TT>       </TT><I>palette</I> = 5:<TT>    </TT>uniform grayscale<BR>
-<BR>
-
-A complete description of the color palettes is given
-in the COMPLETE DESCRIPTION OF OPTIONS section below.
-<P>
-The <I>ncolors</I> parameter sets the number of color
-values used in plotting, whether the colors are
-represented in a continuous color scale or a
-stepped, discrete color scale [default is 11].
-<P>
-If the option argument is the path to an existing <B>GMT</B>
-color palette (CPT) file, then that CPT file and its
-color scheme will be used for the plot
-<P>
-</DL>
-<A NAME="lbAH"> </A>
-<H2>COMPLETE DESCRIPTION OF OPTIONS</H2>
-
-<DL COMPACT>
-<DT><B>-A</B>
-
-<DD>
-<I>magnitude[/azimuth]</I>
-<BR>
-
-Sets the parameters which control the
-synthetic illumination of the gridded data (shaded relief).
-The value <I>magnitude</I>
-is an effective vertical exageration which modulates the intensity of
-the shading; typical values are in the 0.1 to 0.5 range.
-The value <I>azimuth</I>
-is the azimuth from which the data is illuminated.
-Defaults: <I>magnitude</I> = 0.2; <I>azimuth</I> = 0.0;
-<DT><B>-D</B>
-
-<DD>
-<I>[flipcolor/flipshade]</I>
-<BR>
-
-Normally, the color or grayscale tables used for color maps run from
-cool colors (or dark grays) for low grid values
-to hot colors (or light grays) for high grid values.
-This option reverses the color table so that cool colors (dark grays)
-correspond to high values and hot colors (light grays) to low values.
-If <B>-D</B> is given alone, it applies to the color table used
-for color or gray fill plots,  shaded or unshaded. If the plot
-is to be shaded,  either by synthetic illumination (<B>-G</B><I>2</I>)
-or using an intensity file (<B>-K</B> and <B>-G</B><I>3</I> options), then
-setting <I>flipshade</I> = 1 will cause the shading convention
-to be reversed (e.g. high intensities overlaid as light shading).
-Using <B>-D</B><I>0/1</I> will flip the shading convention
-but leave the default color convention.
-<DT><B>-G</B>
-
-<DD>
-<I>color_mode</I>
-<BR>
-
-Turns on color fill plot and sets the style of the plot.
-<BR>
-
-<BR>        <I>color_mode</I> = 1: Color/gray fill.
-<BR>        <I>color_mode</I> = 2: Color/gray fill shaded by
-<BR>                        synthetic illumination.
-<BR>        <I>color_mode</I> = 3: Color/gray fill shaded by
-<BR>                        an intensity file. The <B>-K</B>
-<BR>                        option must be used to specify
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT>the intensity file.<BR>
-<BR>        <I>color_mode</I> = 4: Color/gray fill of slope
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT>magnitude.<BR>
-<BR>        <I>color_mode</I> = 5: Color/gray fill shaded by
-<BR>                        slope magnitude.
-<BR>
-
-See the <B>mbgrdtiff</B> and <B>grdimage</B> manual pages
-for information on shading with intensity files
-<DT><B>-H</B>
-
-<DD>
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-<DT><B>-I</B>
-
-<DD>
-<I>grdfile</I>
-<BR>
-
-Sets the name of the gridded data file to be plotted.
-The data must be in a form acceptable to <B>GMT</B> version 3
-programs (see the <B>GMT</B> Cookbook & Technical Reference).
-Alternatively, <I>grdfile</I> may be a list of grid files
-(one filename on each line) to be plotted together. This
-is useful when data from a region is broken up into several
-grid files rather than a single very large grid file.
-<DT><B>-K</B>
-
-<DD>
-<I>intensity_file</I>
-<BR>
-
-Sets the name of the gridded data file containing
-instensity values to be used for shading the map.
-Alternatively, <I>grdfile</I> may be a list of grid files
-(one filename on each line) to be used together. If a
-list of files is supplied, the intensity files must
-conform in order to the list of data grid files they will shade.
-<DT><B>-M</B>
-
-<DD>
-A series of "miscellaneous" options are provided which are
-given as <B>-M</B> followed by a two character identifier, followed
-by any other parameters associated with that option.
-The <B>-M</B> options may be strung together separated by
-colons, e.g. "-MGQ100:GU:CA200/10", which is equivalent to
-"-MGQ -MGU -MCA200/10".
-<DT><B>-MGD</B>
-
-<DD>
-<I>gmtdef/value</I>
-<BR>
-
-Allows the user to set the <B>GMT</B> default values used as
-the plot is constructed. This command may be given repeatedly
-to set as many <B>GMT</B> defaults as required. For example, to
-set the basemap annotation font to Courier, use
-"-MGDANOT_FONT/Courier".
-<DT><B>-MGS</B>
-
-<DD>
-<I>scalefactor</I>
-<BR>
-
-The gridded data is multiplied by <I>scalefactor</I>.
-This option is most often used flip the sign of the
-data (<I>scalefactor</I> = -1). [Default no scaling]
-<DT><B>-MGW</B>
-
-<DD>
-The <B>-MGW</B> option causes a "world" file to be generated parallel to the
-GeoTiff image with a ".tfw" suffix. Some software packages (e.g. Winfrog) do
-not recognize the coordinate information embedded in the GeoTiff file, and
-look for a world file.
-<DT><B>-O</B>
-
-<DD>
-<I>root</I>
-<BR>
-
-Sets the root used to construct the filename of the output shellscript
-(<I>root</I>.cmd) and names of files created when the shellscript is
-run.  Normally the
-name of the input grid file or grid file list is
-used as the <I>root</I>.
-<DT><B>-Q</B>
-
-<DD>
-Normally, the output plot generation shellscript
-includes lines which execute
-the program <B>xv</B> to display the TIFF image on the screen.
-This option causes those lines to be commented out so
-that executing the shellscript produces a TIFF image
-but does not attempt to display it on the screen.
-<DT><B>-R</B>
-
-<DD>
-<I>west/east/south/north</I>
-<BR>
-
-<I>west, east, south,</I> and <I>north</I> specify the Region of interest.  To specify boundaries
-in degrees and minutes [and seconds], use the dd:mm[:ss] format.  Append <B>r</B> if lower left and upper right
-map coordinates are given instead of wesn.
-You may ask for a larger <I>w/e/s/n</I> region to have more room between the image and the axes.
-A smaller region than specified in the grdfile will result in a subset of the grid [Default is
-region given by the grdfile].
-<DT><B>-S</B>
-
-<DD>
-<I>[color/shade]</I>
-<BR>
-
-This option enables effective histogram equalization of the
-color and/or shading of the gridded data. The equalization is
-not achieved by changing the data values, but rather by
-constructing the color or shading tables so that
-the boundaries in the tables encompass equal fractions of
-the datapoints. This serves to focus color or shading contrasts
-in value ranges corresponding to the bulk of the data values.
-If <B>-S</B> is given alone or with <I>color</I> = 1,
-it enables equalization of the color table used
-for color or gray fill plots,  shaded or unshaded. If the plot
-is to be shaded,  either by synthetic illumination (<B>-G</B><I>2</I>)
-or using an intensity file (<B>-K</B> and <B>-G</B><I>3</I> options), then
-setting <I>shade</I> = 1 will cause the shading to be equalized.
-Using <B>-S</B><I>0/1</I> will equalize the shading without
-equalizing the color table.
-<DT><B>-V</B>
-
-<DD>
-Causes <B>mbm_grdtiff</B> to operate in "verbose" mode
-so that it outputs
-more information than usual.
-<DT><B>-W</B>
-
-<DD>
-<I>[color_style</I>[<I>/palette</I>[<I>ncolors</I>]] | cptfile]
-<BR>
-
-This option controls the color scheme used for color
-fill plots.
-<P>
-If <I>color_style</I> = 1 [default], then
-the color scheme used will be a continuous grading
-of colors. If <I>color_style</I> = 2, the color scheme
-will be a set of discrete color intervals. The color
-palette used is set using <I>palette</I>. Seven palettes
-are available:
-<BR> <TT>       </TT><I>palette</I> = 1:<TT>    </TT>Haxby colors [default]<BR>
-<BR> <TT>       </TT><I>palette</I> = 2:<TT>    </TT>high Intensity colors<BR>
-<BR> <TT>       </TT><I>palette</I> = 3:<TT>    </TT>low Intensity colors<BR>
-<BR> <TT>       </TT><I>palette</I> = 4:<TT>    </TT>grayscale<BR>
-<BR> <TT>       </TT><I>palette</I> = 5:<TT>    </TT>uniform grayscale<BR>
-<BR> <TT>       </TT><I>palette</I> = 6:<TT>    </TT>uniform black<BR>
-<BR> <TT>       </TT><I>palette</I> = 7:<TT>    </TT>uniform white<BR>
-<P>
-The RGB definitions of the color palettes are:
-<P>
-color palette 1 - Haxby Color Table
-<BR>  red:   255 255 255 255 240 205 138 106  50  40  37
-<BR>  green: 255 186 161 189 236 255 236 235 190 127  57
-<BR>  blue:  255 133  68  87 121 162 174 255 255 251 175
-<P>
-color palette 2 - High Intensity Colors
-<BR>  red:   255 255 255 255 128   0   0   0   0 128 255
-<BR>  green:   0  64 128 255 255 255 255 128   0   0   0
-<BR>  blue:    0   0   0   0   0   0 255 255 255 255 255
-<P>
-color palette 3 - Low Intensity Colors
-<BR>  red:   200 194 179 141  90   0   0   0   0  90 141
-<BR>  green:   0  49  90 141 179 200 141  90   0   0   0
-<BR>  blue:    0   0   0   0   0   0 141 179 200 179 141
-<P>
-color palette 4 - Grayscale
-<BR>  red:   255 230 204 179 153 128 102  77  51  26   0
-<BR>  green: 255 230 204 179 153 128 102  77  51  26   0
-<BR>  blue:  255 230 204 179 153 128 102  77  51  26   0
-<P>
-color palette 5 - Uniform Grayscale
-<BR>  red:   128 128 128 128 128 128 128 128 128 128 128
-<BR>  green: 128 128 128 128 128 128 128 128 128 128 128
-<BR>  blue:  128 128 128 128 128 128 128 128 128 128 128
-<P>
-color palette 6 - Uniform Black
-<BR>  red:     0   0   0   0   0   0   0   0   0   0   0
-<BR>  green:   0   0   0   0   0   0   0   0   0   0   0
-<BR>  blue:    0   0   0   0   0   0   0   0   0   0   0
-<P>
-color palette 7 - Uniform White
-<BR>  red:   255 255 255 255 255 255 255 255 255 255 255
-<BR>  green: 255 255 255 255 255 255 255 255 255 255 255
-<BR>  blue:  255 255 255 255 255 255 255 255 255 255 255
-<P>
-The Haxby colors have been adapted from a palette
-developed by Dr. William Haxby of the Lamont-Doherty
-Earth Observatory; this palette is pleasing to the
-eye and well suited for shading. The high intensity
-colors describe linear paths through RGB space from
-red to blue to green to purple; because the colors are high
-intensity they are not well suited to shading.
-The low intensity colors are similar to the high
-intensity, but muted and thus well suited to shading.
-The grayscale palette runs linearly from white to
-black and is commonly used for plots of sidescan and amplitude
-data. The uniform grayscale is useful for non-color
-shaded relief plots.
-<P>
-The <I>ncolors</I> parameter sets the number of color
-values used in plotting, whether the colors are
-represented in a continuous color scale or a
-stepped, discrete color scale [default is 11].
-<P>
-If the option argument is the path to an existing <B>GMT</B>
-color palette (CPT) file, then that CPT file and its
-color scheme will be used for the plot
-<DT><B>-X</B>
-
-<DD>
-Normally, <B>mbm_grdtiff</B> creates an executable shellscript and
-then exits.  This option will cause the shellscript to be executed
-in the background before <B>mbm_grdtiff</B> exits.
-<DT><B>-Y</B>
-
-<DD>
-Normally, <B>mbm_grdplot</B> generates nicely rounded numbers
-for the boundaries of the color palette. Often, the resulting
-color bounds extend well outside the range of the gridded data.
-This option causes the minimum and maximum color boundaries to
-exactly conform to the minimum and maximum values of the grid,
-or, if the <B>-Z</B> option is used, the minimum and maximum
-values specified by the user.
-<DT><B>-Z</B>
-
-<DD>
-<I>min/max[/mode]</I>
-<BR>
-
-This option overrides the minimum and maximum values of
-the gridded data, affecting the color palette and the
-contour interval if those parameters are not specified
-by the user. By default (i.e. <I>mode</I> is omitted
-or equal to 0), the macro selects the color palette bounds
-so that they encompass <I>min</I> and <I>max</I> while using
-nicely rounded numbers. If <I>mode</I> is omitted or equal
-to 0, then the color palette will end near <I>min</I> and
-<I>max</I> whether it is linear stretched or histogram equalized.
-If <I>mode</I> = 1, then the color stretching calculations
-will be done using <I>min</I> and <I>max</I>, but then the
-first and last values in the color palette will be set to
-the actual minimum and maximum values.so that all the data
-are displayed.
-<P>
-</DL>
-<A NAME="lbAI"> </A>
-<H2>EXAMPLES</H2>
-
-Suppose we have obtained two GRD files,
-one containing gridded bathymetry
-(testbath.grd) and the other mosaiced amplitude
-(testamp.grd).
-In order to generate a color fill TIFF image, we use the -G1 option.
-Because the data has been gridded as bathymetry (positive
-down) rather than as topography (positive up), the default
-plot will have "hot" colors for deep regions and "cold"
-colors for shallow regions; this is the opposite of the
-convention we usually use. In order to fix the colors, we have
-to either rescale the data by multiplying the bathymetry
-by -1 (accomplished with -MGS-1), or flip the color
-palette (accomplished with -D). We use the latter approach:
-<P>
-<BR>  <TT>      </TT>mbm_grdtiff -Itestbath.grd -G1 -D \<BR>
-<BR>  <TT>      </TT>    -V -Obath_fill<BR>
-<P>
-In order to generate a grayscale plot of the amplitude mosaic,
-we use -G1 and -W1/4. We also use -D so that high amplitude
-amplitudes are shown as dark.
-<P>
-<BR>  <TT>      </TT>mbm_grdtiff -Itestamp.grd -G1 -D -W1/4 \<BR>
-<BR>  <TT>      </TT>    -V -Oamp_fill<BR>
-<P>
-Now consider generating a shaded relief view of the
-gridded bathymetry. We choose to illuminate
-the bathymetry from the northeast (azimuth of 45 degrees)
-and to use a shading magnitude of 0.4 (-A0.4/45).
-We also use
-the -X flag this so that the plot generation shellscript is
-executed immediately. Here is the command:
-<P>
-<BR>  <TT>      </TT>mbm_grdtiff -Itestbath.grd \<BR>
-<BR>  <TT>      </TT>    -G2 -A0.4/45 -D -X -V \<BR>
-<BR>  <TT>      </TT>    -Obath_shade<BR>
-<P>
-Now, consider generating a plot of the bathymetry
-overlaid with the mosaiced amplitude.
-The amplitude overlay is specified using the -K option.
-We want the colors for the bathymetry to be chosen without
-histogram equalization, but we also want histogram
-equalization to be applied to the amplitude data used for
-shading. To do this, we use -S0/1, where the first number
-(0) specifies no histogram equalization of the color
-scale and the second number (1) causes histogram
-equalization of the shading amplitude data to be
-implemented. In order to maintain the convention that
-high amplitude amplitudes are black, we flip both the
-color palette (as in the previous example) and the
-shading scale with -D1/1. We could also flip the shading
-by specifying a negative shading magnitude (-A-0.4).
-<P>
-<BR>  <TT>      </TT>mbm_grdtiff -Itestbath.grd \<BR>
-<BR>  <TT>      </TT>    -G3 -Ktestamp.grd \<BR>
-<BR>  <TT>      </TT>    -S0/1 -D1/1 -A0.4 -X -V \<BR>
-<BR>  <TT>      </TT>    -Obath_amp<BR>
-<P>
-As an example, the contents of the plotting shellscript
-"bath_fill_tiff.cmd" are:
-<P>
-<BR>
-
-#! /bin/csh -f
-<BR>
-
-#
-<BR>
-
-# Shellscript to create TIFF image of data in grd file
-<BR>
-
-# Created by macro mbm_grdtiff
-<BR>
-
-#
-<BR>
-
-# This shellscript created by following command line:
-<BR>
-
-# mbm_grdtiff -Itestbath.grd -G1 -D -V -Obath_fill
-<BR>
-
-#
-<BR>
-
-# Define shell variables used in this script:
-<BR>
-
-set TIFF_FILE       = bath_fill.tif
-<BR>
-
-set CPT_FILE        = bath_fill.cpt
-<BR>
-
-set MAP_REGION      = -49.28/-49.13/12.05/12.2
-<BR>
-
-#
-<BR>
-
-# Save existing GMT defaults
-<BR>
-
-echo Saving GMT defaults...
-<BR>
-
-gmtdefaults -L > gmtdefaults$$
-<BR>
-
-#
-<BR>
-
-# Set new GMT defaults
-<BR>
-
-echo Setting new GMT defaults...
-<BR>
-
-gmtset COLOR_BACKGROUND 0/0/0
-<BR>
-
-gmtset COLOR_FOREGROUND 255/255/255
-<BR>
-
-gmtset COLOR_NAN 255/255/255
-<BR>
-
-gmtset DEGREE_FORMAT 3
-<BR>
-
-#
-<BR>
-
-# Make color palette table file
-<BR>
-
-echo Making color palette table file...
-<BR>
-
-echo  -5250 255 255 255  -5100 255 186 133 > $CPT_FILE
-<BR>
-
-echo  -5100 255 186 133  -4950 255 161  68 >> $CPT_FILE
-<BR>
-
-echo  -4950 255 161  68  -4800 255 189  87 >> $CPT_FILE
-<BR>
-
-echo  -4800 255 189  87  -4650 240 236 121 >> $CPT_FILE
-<BR>
-
-echo  -4650 240 236 121  -4500 205 255 162 >> $CPT_FILE
-<BR>
-
-echo  -4500 205 255 162  -4350 138 236 174 >> $CPT_FILE
-<BR>
-
-echo  -4350 138 236 174  -4200 106 235 255 >> $CPT_FILE
-<BR>
-
-echo  -4200 106 235 255  -4050  50 190 255 >> $CPT_FILE
-<BR>
-
-echo  -4050  50 190 255  -3900  40 127 251 >> $CPT_FILE
-<BR>
-
-echo  -3900  40 127 251  -3750  37  57 175 >> $CPT_FILE
-<BR>
-
-#
-<BR>
-
-# Define data files to be plotted:
-<BR>
-
-set DATA_FILE        = testbath.grd
-<BR>
-
-set INTENSITY_FILE   =
-<BR>
-
-#
-<BR>
-
-# Make tiff image
-<BR>
-
-echo Running mbgrdtiff...
-<BR>
-
-mbgrdtiff -I $DATA_FILE <BR>
-
-<TT>       </TT>-O $TIFF_FILE <BR>
-
-<TT>       </TT>-C $CPT_FILE <BR>
-
-<TT>       </TT>-V<BR>
-<BR>
-
-#
-<BR>
-
-# Delete surplus files
-<BR>
-
-echo Deleting surplus files...
-<BR>
-
-/bin/rm -f $CPT_FILE
-<BR>
-
-#
-<BR>
-
-# Reset GMT default fonts
-<BR>
-
-echo Resetting GMT fonts...
-<BR>
-
-/bin/mv gmtdefaults$$ .gmtdefaults
-<BR>
-
-#
-<BR>
-
-# Run xv
-<BR>
-
-echo Running xv in background...
-<BR>
-
-xv bath_fill.tif &
-<BR>
-
-#
-<BR>
-
-# All done!
-<BR>
-
-echo All done!
-<BR>
-
-<P>
-<A NAME="lbAJ"> </A>
-<H2>SEE ALSO</H2>
-
-<B><A HREF="mbsystem.html">mbsystem</A></B>(1), <B><A HREF="mbm_grdplot.html">mbm_grdplot</A></B>(1), <B><A HREF="mbgrid.html">mbgrid</A></B>(1), <B><A HREF="mbmosaic.html">mbmosaic</A></B>(1),
-<B><A HREF="mbm_grid.html">mbm_grid</A></B>(1), <B><A HREF="mbgrdtiff.html">mbgrdtiff</A></B>(1), <B>gmt</B>(1)(1), <B>grdimage</B>(1)
-<P>
-<A NAME="lbAK"> </A>
-<H2>BUGS</H2>
-
-This macro either has too many options, or not enough
-options. You choose.
-<P>
-
-<HR>
-<A NAME="index"> </A><H2>Index</H2>
-<DL>
-<DT><A HREF="#lbAB">NAME</A><DD>
-<DT><A HREF="#lbAC">VERSION</A><DD>
-<DT><A HREF="#lbAD">SYNOPSIS</A><DD>
-<DT><A HREF="#lbAE">DESCRIPTION</A><DD>
-<DT><A HREF="#lbAF">AUTHORSHIP</A><DD>
-<DT><A HREF="#lbAG">SIMPLE DESCRIPTION OF BASIC OPTIONS</A><DD>
-<DT><A HREF="#lbAH">COMPLETE DESCRIPTION OF OPTIONS</A><DD>
-<DT><A HREF="#lbAI">EXAMPLES</A><DD>
-<DT><A HREF="#lbAJ">SEE ALSO</A><DD>
-<DT><A HREF="#lbAK">BUGS</A><DD>
-</DL>
-<HR>
-</PRE>
-
-<CENTER><P><BR>
-Last Updated: 28 September 2013</P></CENTER>
-
-<HR>
-<P><A HREF="mbsystem_man_list.html">Return to list of MB-System manual pages...</A></P>
-<P><A HREF="mbsystem_home.html"><IMG SRC="mbsystem_logo_small.gif" BORDER=0 HEIGHT=55 WIDTH=158 ALIGN=BOTTOM></A><A HREF="mbsystem_home.html">Back
-to MB-System Home Page...</A></P>
-
-</BODY>
-</HTML>
diff --git a/src/html/mbm_grid.html b/src/html/mbm_grid.html
deleted file mode 100644
index 8abcee3..0000000
--- a/src/html/mbm_grid.html
+++ /dev/null
@@ -1,645 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<HTML VERSION="2.0">
-<HEAD>
-   <TITLE>MB-System Unix Manual Page: mbm_grid</TITLE>
-<!-- WEBMAGIC VERSION NUMBER="2.0.2" -->
-<!-- WEBMAGIC TRANSLATION NAME="ServerRoot" SRC="/var/www/htdocs/" DST="/" -->
-<!-- WEBMAGIC TRANSLATION NAME="ProjectRoot" SRC="./" DST="" -->
-</HEAD>
-<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#336699" VLINK="#997040" ALINK="#CC9900">
-<BODY>
-<CENTER><H3><U>MB-System Unix Manual Page</U></H3></CENTER>
-<PRE>
-<H1>mbm_grid</H1>
-Section:  MB-System 5.0  (1)<BR>Updated:  3 June 2013 <BR><A HREF="#index">Index</A>
-<HR>
-
-<A NAME="lbAB"> </A>
-<H2>NAME</H2>
-
-<B>mbm_grid</B> - Create an executable shellscript which will generate
-a grid (bathymetry or topography) or mosaic (amplitude or sidescan)
-of swath sonar swath data.
-<P>
-<A NAME="lbAC"> </A>
-<H2>VERSION</H2>
-
-Version 5.0
-<P>
-<A NAME="lbAD"> </A>
-<H2>SYNOPSIS</H2>
-
-mbm_grid <B>-I</B><I>file</I>
-<B>-F</B><I>format</I> <B>-O</B><I>root</I>
-<B>-R</B><I>west/east/south/north</I>
-[<B>-A</B><I>datatype</I> <B>-B</B><I>border</I> <B>-C</B><I>clip</I>
-<B>-D</B><I>xdim/ydim</I> <B>-E</B><I>dx/dy/units</I>
-{<B>-f</B><I>priority_range</I> | <B>-f</B><I>mode</I>}
-<B>-G</B><I>gridkind</I> <B>-H</B>
-<B>-J</B><I>projection</I> <B>-K</B><I>background</I>
-<B>-L</B><I>lonflip</I> <B>-M</B> <B>-N</B> <B>-P</B><I>pings</I>
-<B>-S</B><I>speed</I> <B>-T</B><I>tension</I>
-<B>-U</B><I>{azimuth/factor | time}</I>
-<B>-V</B> <B>-W</B><I>scale</I> <B>-X</B><I>extend</I>
-<B>-Y</B><I>priority_file</I> <B>-Z</B><I>bathdef</I>]
-<P>
-<A NAME="lbAE"> </A>
-<H2>DESCRIPTION</H2>
-
-<B>mbm_grid</B> is a macro to generate a shellscript of MB-System commands
-which, when executed, will generate a grid or mosaic of the
-specified swath sonar data. The grid or mosaic may be of
-bathymetry (positive down, <B>-A</B><I>1</I>),
-topography (positive up, <B>-A</B><I>2</I>),
-amplitude (<B>-A</B><I>3</I>), or sidescan data (<B>-A</B><I>4</I>).
-The primary purpose of this
-macro is to allow the simple, semi-automated production of
-grids and mosaics with a few command line arguments. The macro
-can determine the area covered by the swath data and set the
-grid bounds and dimensions accordingly. For users
-seeking more control over the grid and mosaic parameters,
-almost the full suite of mbgrid and mbmosaic commands are supported.
-See the manual pages for <B>mbgrid</B> and <B>mbmosaic</B> for
-complete explanations of how these programs work.
-<P>
-By default, <B>mbgrid</B> and <B>mbmosaic</B> generate grids in Geographic coordinates,
-meaning that position is defined in longitude and latitude using
-the WGS84 horizontal datum. The <B>-J</B> option can be used to specify
-an alternate, projected coordinate system (PCS). When a PCS is used,
-position will be defined in eastings and northings (meters) relative
-to the origin of the particular PCS. Universal Transverse Mercator
-is the most commonly used PCS in the oceanographic community, but
-<B>mbgrid</B> supports a large number of other PCS as well. A list of
-the supported PCS's is provided at the end of the <B>mbgrid</B> and
-<B>mbmosaic</B> manual pages.
-<P>
-<A NAME="lbAF"> </A>
-<H2>AUTHORSHIP</H2>
-
-David W. Caress (<A HREF="mailto:caress at mbari.org">caress at mbari.org</A>)
-<BR>
-
-<BR>  Monterey Bay Aquarium Research Institute
-<BR>
-
-Dale N. Chayes (<A HREF="mailto:dale at ldeo.columbia.edu">dale at ldeo.columbia.edu</A>)
-<BR>
-
-<BR>  Lamont-Doherty Earth Observatory
-<P>
-<A NAME="lbAG"> </A>
-<H2>OPTIONS</H2>
-
-<DL COMPACT>
-<DT><B>-A</B>
-
-<DD>
-<I>datatype</I>
-<BR>
-
-Sets the type of data to be read and gridded or mosaiced.
-If <I>datatype</I> = 1,
-bathymetry data will be gridded (positive downwards).
-If <I>datatype</I> = 2,
-bathymetry data will be gridded as topography (positive upwards).
-If <I>datatype</I> = 3,
-amplitude data will be mosaiced.  If <I>datatype</I> = 4,
-sidescan data will be mosaiced.
-Default: <I>datatype</I> = 1 (bathymetry).
-<DT><B>-B</B>
-
-<DD>
-<I>border</I>
-<BR>
-
-Sets the border of a smoothly interpolated grid
-to the value <I>border</I>
-wherever no data exist, provided <I>border</I> > 0.0.
-Default: <I>border</I> = 0.0
-<DT><B>-C</B>
-
-<DD>
-<I>clip</I>
-<BR>
-
-Sets the clipping dimension for the spline interpolation. If <I>clip</I>=0
-no spline interpolation will be done.  If <I>clip</I>>0
-<DT><B>-K</B>
-
-<DD>
-<I>background</I>
-<BR>
-
-Enables filling in all undefined grid cells with bathymetry or topography
-from a global or regional database accessed with the <B>GMT</B> program
-<B>grdraster</B>. The <I>background</I> specifies which locally defined
-database is accessed with <B>grdraster</B>.
-<BR> then the spline
-interpolation will fill data gaps to a distance of <I>clip</I> times
-the grid spacing.
-Default: <I>clip</I> = 0.
-<DT><B>-D</B>
-
-<DD>
-<I>xdim/ydim</I>
-<BR>
-
-Sets the dimensions of the output grid.
-This option is superceded
-if the user specifies the grid spacing with the <B>-E</B> option.
-Default:  <I>xdim</I> = <I>ydim</I> = 101.
-<DT><B>-E</B>
-
-<DD>
-<I>dx/dy/units</I>
-<BR>
-
-Sets the grid cell spacing to <I>dx</I> in longitude and <I>dy</I>
-in latitude. If <I>units</I> is not specified, the <I>dx</I>
-and <I>dy</I> values are assumed to be in meters. Valid values
-for <I>units</I> include "km", "meters", and "degrees".
-By default, the grid spacing is calculated from
-the grid bounds and the grid dimensions. When the user
-uses the <B>-E</B> option to set the grid spacing, the
-grid dimensions are calculated using the grid bounds and
-grid cell spacings. However, slight adjustments to the
-grid cell spacing values are usually required to keep
-the grid bounds as specified.
-<DT><B>-F</B>
-
-<DD>
-<I>format</I>
-<BR>
-
-Sets the data format for the input data.
-If <I>format</I> < 0, then the input file specified
-with the <B>-I</B> option will actually contain a list of input swath sonar
-data files. This program uses the <B>MBIO</B> library
-and will read or write any swath sonar
-format supported by <B>MBIO</B>. A list of the swath sonar data formats
-currently supported by <B>MBIO</B> and their identifier values
-is given in the <B>MBIO</B> manual page. Default: <I>format</I> = -1.
-<DT><B>-f</B>
-
-<DD>
-<I>mode</I>
-<BR>
-
-Sets the gridding algorithm to be used by <B>mbgrid</B> for bathymetry
-(<B>-A</B><I>1</I>) or topography c data.
-<BR> <TT>       </TT><I>mode</I> = 1:         Gaussian Weighted Mean<BR>
-<BR> <TT>       </TT><I>mode</I> = 2:         Median Filter<BR>
-<BR> <TT>       </TT><I>mode</I> = 3:         Minimum Filter<BR>
-<BR> <TT>       </TT><I>mode</I> = 4:         Maximum Filter<BR>
-The default is <I>mode</I> = 1 (Gaussian Weighted Mean).
-<DT><B>-f</B>
-
-<DD>
-<I>priority_range</I>
-<BR>
-
-Turns on Gaussian weighted mean mosaicing in <B>mbmosaic</B>
-for amplitude (<B>-A</B><I>3</I>) or sidescan (<B>-A</B><I>4</I>) data. The
-<I>priority_range</I> value determines which data points are
-used in the mosaicing. The minimum priority threshold for
-each bin is the highest priority value found among the
-samples in that bin minus the <I>priority_range</I> value.
-Only samples with priorities greater than this threshold
-are used in the Gaussian weighted mean mosaicing.
-The default is to simply set each bin's value equal to the
-value of the highest priority sample in that bin.
-<DT><B>-G</B>
-
-<DD>
-<I>gridkind</I>
-<BR>
-
-Sets the format of the output grid file.
-<BR> <TT>       </TT><I>gridkind</I> = 1:<TT>   </TT>Ascii table<BR>
-<BR> <TT>       </TT><I>gridkind</I> = 2:<TT>   </TT>binary file (GMT version 1 GRD file)<BR>
-<BR> <TT>       </TT><I>gridkind</I> = 3:<TT>   </TT>netCDF file (GMT version 2 GRD file)<BR>
-<BR>
-
-If <I>gridkind</I> = 3, <B>mbgrid</B> also outputs shellscripts
-which run GMT version 3 programs to provide preliminary color
-fill maps of the gridded data. These shellscripts are
-generated using the <B>mbm_grdplot</B> macro.
-Default: <I>gridkind</I> = 3.
-<DT><B>-H</B>
-
-<DD>
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-<DT><B>-I</B>
-
-<DD>
-<I>filename</I>
-<BR>
-
-Sets the input filename. If <I>format</I> > 0 (set with the
-<B>-f</B> option) then the swath sonar data contained in <I>infile</I>
-is read and processed. If <I>format</I> < 0 (the default),
-then <I>infile</I>
-is assumed to be an ascii file containing a list of the input swath sonar
-data files to be processed and their formats.  The program will read
-the data in each one of these files.
-In the <I>infile</I> file, each
-data file should be followed by a data format identifier, e.g.:
-<BR> <TT>       </TT>datafile1 11<BR>
-<BR> <TT>       </TT>datafile2 24<BR>
-<BR>
-
-This program uses the <B>MBIO</B> library and will read or write any swath sonar
-format supported by <B>MBIO</B>. A list of the swath sonar data formats
-currently supported by <B>MBIO</B> and their identifier values
-is given in the <B>MBIO</B> manual page.
-<DT><B>-J</B>
-
-<DD>
-<I>projection</I>
-By default, <B>mbgrid</B> and <B>mbmosaic</B> generate grids in Geographic coordinates,
-meaning that position is defined in longitude and latitude using
-the WGS84 geographic coordinate system.
-The <B>-J</B> option can be used to specify
-an alternate, projected coordinate system (PCS). When a PCS is used,
-position will be defined in eastings and northings (meters) relative
-to the origin of the particular PCS. Universal Transverse Mercator
-is the most commonly used PCS in the oceanographic community, but
-<B>mbgrid</B> supports a large number of other PCS's as well.
-The underlying projection functions derive from the <B>PROJ.4</B> library
-written by Gerald Evenden, then of the U.S. Geological Survey.
-<P>
-The <I>projection</I> argument for the <B>-J</B> option can be either
-a PCS identifier from the projection definition list provided at the
-end of this manual page, or simply <B>-J</B><I>U</I> to specify using
-UTM in whatever zone is appropriate for the grid bounds specified
-with the <B>-R</B> option.
-<P>
-For instance, to fully specify a particular northern UTM
-zone, set <I>projection</I> = UTMXXN where XX gives
-the UTM zone (defined from 01 to 60). As an example, a northern UTM
-zone 12 projection can be specified using <B>-J</B><I>UTM12N</I>.
-Southern UTM zones are specified as UTMXXS. The European Petroleum
-Survey Group (EPSG) has defined a large number of PCS's used worldwide
-and assigned number id's to each; one can also specify the northern
-UTM zone 12 projection using its EPSG designation,
-or <B>-J</B><I>epsg32612</I>.
-When the projected coordinate system is fully specified
-by the <B>-J</B> option, then the grid bounds may be specified using
-<B>-R</B> in either longitude and latitude or in eastings and northings.
-<P>
-Alternatively, one may indicate a UTM projection without specifying the
-zone by using <B>-J</B><I>U</I>. In this case, the
-UTM zone will be inferred from the midpoint of the
-specified longitude and latitude bounds, and then the
-longitude and latitude bounds given with the
-<B>-fR</B> option are translated to UTM eastings and northings.
-<P>
-All grids and mosaics produced by <B>MB-System</B>
-programs contain identifiers that are recognized
-by the plotting macros <B>mbm_grdplot</B>,
-<B>mbm_grd3dplot</B>, and <B>mbm_grdtiff</B>.
-These plotting macros automatically use a
-linear map projection whenever they
-encounter grids and mosaics that are already
-in a projected coordinate system. Also, the program <B>mbgrdtiff</B>
-automatically inserts the appropriate projection information into
-the GeoTIFF images it generates. As a result, images generated by
-<B>mbgrdtiff</B> will be properly georeferenced when they are imported
-into GIS software.
-<DT><B>-K</B>
-
-<DD>
-<I>background</I>
-<BR>
-
-The <B>-K</B><I>background</I> option is used to underlay a bathymetry or topography
-grid with a global or regional topography model. The background data
-model is accessed from a database using the <B>GMT</B> program grdraster.
-The <I>background</I> value is an identifier number used to specify which
-dataset to extract using <B>grdraster</B>. These identifiers are user
-defined and vary with installations. When the <B>-K</B><I>background</I>
-option is invoked, <B>grdraster</B> is used to extract all of the longitude,
-latitude, and topography values within the specified database that lie
-within the desired grid. These values are interpolated onto the desired
-grid locations using the thin plate spline algorithm, and then mapped onto
-the grid wherever the values are undefined by either swath data or the
-spline interpolation invoked with the <B>-C</B> option.
-<P>
-<DT><B>-L</B>
-
-<DD>
-<I>lonflip</I>
-<BR>
-
-Sets the range of the longitude values returned.
-If <I>lonflip</I>=-1 then the longitude values will be in
-the range from -360 to 0 degrees. If <I>lonflip</I>=0
-then the longitude values will be in
-the range from -180 to 180 degrees. If <I>lonflip</I>=1
-then the longitude values will be in
-the range from 0 to 360 degrees.
-Default: <I>lonflip</I> = 0.
-<DT><B>-M</B>
-
-<DD>
-Causes two additional grids to be output. One is a grid containing
-the standard deviation of the data within each grid cell relative
-to the grid value, the other contains the number of data
-points in each grid cell. This option is ignored when the minimum
-or maximum filter gridding algorithms are used (see the -F option).
-<DT><B>-N</B>
-
-<DD>
-Causes grid cells with no data and no interpolation to be set to a
-value of NaN instead of the default value of 99999.9.  The NaN value
-is expected by <B>GMT</B> programs such <B>grdview</B>.
-<DT><B>-O</B>
-
-<DD>
-<I>root</I>
-<BR>
-
-Sets the character string to be used as the root of the
-output filenames. For example, if the grid is output as a GMT
-version 2 GRD format (netCDF) file (the default),
-then its filename is "root.grd". If the
-<B>-G</B><I>1</I> option is used to specify an ascii format grid, then the
-output grid filename will be "root.asc". If the
-<B>-G</B><I>2</I> option is used to specify a version 1 GRD
-format (binary) grid, then the
-output grid filename will be "root.grd1". If the output grid is
-in the GMT version 2 GRD format, a shellscript
-which will allow the contents of the grid to viewed using GMT programs
-is also output with the filename "root.grd.cmd".
-<DT><B>-P</B>
-
-<DD>
-<I>pings</I>
-Sets the ping averaging of the input data. If <I>pings</I> > 0, then
-that number of input pings will be averaged to produce one output
-ping.  If <I>pings</I> = 0, then the ping averaging will automatically
-be done so that the along-track ping spacing is equal to the across-track
-beam spacing. Default: <I>pings</I> = 1.
-<DT><B>-Q</B>
-
-<DD>
-Normally, bathymetry or topography data is gridded in meters. If
-this option is used, bathymetry or topography data is gridded
-in feet.
-<DT><B>-R</B>
-
-<DD>
-<I>west/east/south/north</I>
-<BR>
-
-Sets the longitude and latitude bounds of the output grid. If the user
-uses the <B>-E</B> option to set the grid spacing, then the dimensions
-will be calculated from the grid bounds and spacing. In these
-circumstances rounding errors will usually require that the eastern
-and northern bounds be adjusted to fit exactly with the
-grid dimensions and spacing.
-<DT><B>-S</B>
-
-<DD>
-<I>speed</I>
-<BR>
-
-Sets the minimum speed in km/hr (5.5 kts ~ 10 km/hr) allowed in
-the input data; pings associated with a smaller ship speed will not be
-output. Default: <I>speed</I> = 0.
-<DT><B>-T</B>
-
-<DD>
-<I>tension</I>
-<BR>
-
-Sets the <I>tension</I> value used in the thin plate spline interpolation.
-<P>
-A <I>tension</I> of 0 gives a minimum curvature surface with free edges;
-this is a pure Laplacian solution. A nonzero <I>tension</I> tends to
-suppress spurious oscillations and flatten
-the interpolation toward the edges; a <I>tension</I> of infinity
-yields a pure spline solution. The <I>tension</I> must be zero or
-greater.
-Default: <I>tension</I> = 1.0e10 (pure spline solution).
-<DT><B>-U</B>
-
-<DD>
-<I>time</I>
-<BR>
-
-Forces <B>mbgrid</B> to avoid averaging overlapping swaths by
-ignoring the data from later swaths. "Later" data is identified
-using the <I>time</I> value. The time of the first data point
-is saved for each bin in the grid; any other data points which
-are more than <I>time</I> minutes before or after the initial
-data point in the relevent bin are ignored. If <I>time</I> is
-negative, the last data in a bin (within the time lag criterea)
-will be saved and used instead of the first data.
-<DT><B>-U</B>
-
-<DD>
-<I>azimuth/factor</I>
-<BR>
-
-Enables prioritizing data points according to their look azimuth
-(data on the port side of the swath have
-a look azimuth equal to the heading - 90 degrees, and data on the
-starboard side have a look azimuth equal to the heading + 90 degrees).
-Here <I>azimuth</I> is the preferred look azimuth, and <I>factor</I>
-modulates how rapidly the priority degrades away from the preferred
-look azimuth. The priority (p) for a data point is assigned as follows:
-<BR>        p = cos(f * (Ap - Al))
-<BR>
-
-when -90 < (f * (Ap - Al)) < 90 and
-<BR>        p = 0
-<BR>
-
-otherwise, where f = <I>factor</I>, Ap = <I>azimuth</I>, and Al is the
-look azimuth of the data point.
-If <I>factor</I> = 1.0, the priority will be 1.0
-at <I>azimuth</I> and will fall to zero for look
-azimuths more than 90 degrees away from <I>azimuth</I>.
-If <I>factor</I> > 1.0, the range of nonzero priorities will shrink
-to azimuths closer to <I>azimuth</I> (e.g. if <I>factor</I> = 2.0,
-nonzero priorities will be restricted to look azimuths within
-45 degrees of <I>azimuth</I>). If <I>factor</I> < 1.0, the
-range of nonzero priorities will expand (e.g. if <I>factor</I> = 0.5, only
-look azimuths 180 degrees away from <I>azimuth</I>
-will have a zero priority).
-<DT><B>-V</B>
-
-<DD>
-The <B>-V</B> option causes <B>mbm_grid</B> to print out statements
-indicating its progress.
-<DT><B>-W</B>
-
-<DD>
-<I>scale</I>
-<BR>
-
-Sets the width of the gaussian weighting function in terms of
-the grid spacing.  The distance to the 1/e point of the weighting
-function is given by half of the grid spacing times <I>scale</I>.
-Default: <I>scale</I> = 1.0
-<DT><B>-X</B>
-
-<DD>
-<I>extend</I>
-<BR>
-
-Extends the size of the internal grid so that the output grid is a
-subset from the center of a larger grid.   This allows data outside
-the output grid to guide the spline interpolation of data gaps which
-happen to lie at the the edge of the output grid.  The amount of
-extension is <I>extend</I> times the grid width/height to each side.
-Thus, if <I>extend</I>=1.0, then the internal grid will have dimensions
-three times the output grid.
-Default: <I>extend</I> = 0.0
-<DT><B>-Y</B>
-
-<DD>
-<I>priority_file</I>
-<BR>
-
-Enables priortization of data points based on their apparent
-grazing angle (this angle is the
-arctan(x/z) where x is acrosstrack distance and z is depth, so
-that the center of the swath has an apparent grazing angle of
-zero, the port swath edge has a large negative angle, and the
-starboard swath edge has a large positive angle). The file
-<I>priority_file</I> must contain a list of data priorities
-as a function of apparent grazing angle. The first line of
-the file should contain the minimum, or port-most grazing angle
-followed by the associated priority. The following lines
-should contain increasingly large grazing angles (and associated
-priorities) up to the maximum, or starboard-most, grazing angle.
-The highest priority assigned should be one, and the lowest zero.
-Priorities for grazing angles less than the minimum or greater
-than the maximum will be zero. See the examples below for a
-further explanation of the use of <I>priority_file</I>.
-<DT><B>-Z</B>
-
-<DD>
-<I>bath_default</I>
-<BR>
-
-Sets the default depth used for calculating grazing angles for
-amplitude or sidescan values where depths are not available.
-Default: <I>scale</I> = 1000.0
-<P>
-</DL>
-<A NAME="lbAH"> </A>
-<H2>EXAMPLES</H2>
-
-Suppose we have obtained a swath sonar data file called
-example_hs.mb24 collected using a SeaBeam 2112 sonar.
-This file contains bathymetry, beam amplitude, and
-sidescan data. In order to obtain a first cut bathymetry
-grid and first cut amplitude and sidescan mosaics, we
-use <B>mbm_grid</B> to generate shellscripts which in turn
-run <B>mbgrid</B> or <B>mbmosaic</B> to generate grids and mosaics.
-The following four commands generate gridding shellscripts
-for bathymetry, topography, amplitude, and sidescan,
-respectively:
-<P>
-<BR> <TT>       </TT>mbm_grid -F24 -I example_hs.mb24 \<BR>
-<TT>        </TT><TT>        </TT>-A1 -V -Obath<BR>
-<BR> <TT>       </TT>mbm_grid -F24 -I example_hs.mb24 \<BR>
-<BR> <TT>       </TT><TT>        </TT>-A2 -V -Otopo<BR>
-<BR> <TT>       </TT>mbm_grid -F24 -I example_hs.mb24 \<BR>
-<BR> <TT>       </TT><TT>        </TT>-A3 -V -Oamp<BR>
-<BR> <TT>       </TT>mbm_grid -F24 -I example_hs.mb24 \<BR>
-<BR> <TT>       </TT><TT>        </TT>-A4 -V -Oss<BR>
-<P>
-When the following shellscripts are executed, each will
-generate a both a grid (or mosaic) file and an additional
-shellscript which in turn will (when run) generate and display a
-postscript plot file:
-<P>
-<BR> <TT>       </TT>bath_mbgrid.cmd<BR>
-<BR> <TT>       </TT>topo_mbgrid.cmd<BR>
-<BR> <TT>       </TT>amp_mbmosaic.cmd<BR>
-<BR> <TT>       </TT>ss_mbmosaic.cmd<BR>
-<P>
-The program <B>mbinfo</B> is executed by <B>mbm_grid</B>
-to obtain the file statistics used to determine the grid
-bounds and bin size. The macro <B>mbm_grdplot</B> is executed
-by <B>mbgrid</B> or <B>mbmosaic</B> to generate the initial
-plots of the gridded data.
-<P>
-As an example, the contents of the gridding shellscript
-"bath_mbgrid.cmd" are:
-<P>
-<BR> #! /bin/csh -f
-<BR> #
-<BR> # Shellscript to grid or mosaic swath sonar data
-<BR> # Created by macro mbm_grid
-<BR> #
-<BR> # This shellscript created by following command line:
-<BR> # mbm_grid -F24 -I example_hs.mb24 -A1 -V -Obath
-<BR> #
-<BR> # Define shell variables used in this script:
-<BR> set REGION       = -49.316085/-49.096415/12.06972/12.18588
-<BR> set INPUT_FILE   = example_hs.mb24
-<BR> set INPUT_FORMAT = 24
-<BR> set ROOT         = bath
-<BR> #
-<BR> # Make datalist file
-<BR> echo Making datalist file...
-<BR> echo $INPUT_FILE $INPUT_FORMAT >! datalist$$
-<BR> #
-<BR> # Run mbgrid
-<BR> echo Running mbgrid...
-<BR> mbgrid -Idatalist$$ \
-<BR> <TT>       </TT>-R$REGION \<BR>
-<BR>  <TT>      </TT>-O$ROOT \<BR>
-<BR> <TT>       </TT>-A1 -N \<BR>
-<BR>  <TT>      </TT>-E363.3/363.3/meters \<BR>
-<BR> #
-<BR> # All done!
-<BR> echo All done!
-<P>
-<A NAME="lbAI"> </A>
-<H2>SEE ALSO</H2>
-
-<B><A HREF="mbsystem.html">mbsystem</A></B>(1), <B><A HREF="mbgrid.html">mbgrid</A></B>(1),
-<B><A HREF="mbmosaic.html">mbmosaic</A></B>(1), <B><A HREF="mbinfo.html">mbinfo</A></B>(1),
-<B><A HREF="mbm_grdplot.html">mbm_grdplot</A></B>(1)
-<P>
-<A NAME="lbAJ"> </A>
-<H2>BUGS</H2>
-
-This macro is new and hasn't been tested in serious
-usage yet - let us know what to fix, add, or
-change!.
-<P>
-
-<HR>
-<A NAME="index"> </A><H2>Index</H2>
-<DL>
-<DT><A HREF="#lbAB">NAME</A><DD>
-<DT><A HREF="#lbAC">VERSION</A><DD>
-<DT><A HREF="#lbAD">SYNOPSIS</A><DD>
-<DT><A HREF="#lbAE">DESCRIPTION</A><DD>
-<DT><A HREF="#lbAF">AUTHORSHIP</A><DD>
-<DT><A HREF="#lbAG">OPTIONS</A><DD>
-<DT><A HREF="#lbAH">EXAMPLES</A><DD>
-<DT><A HREF="#lbAI">SEE ALSO</A><DD>
-<DT><A HREF="#lbAJ">BUGS</A><DD>
-</DL>
-<HR>
-</PRE>
-
-<CENTER><P><BR>
-Last Updated: 3 June 2013</P></CENTER>
-
-<HR>
-<P><A HREF="mbsystem_man_list.html">Return to list of MB-System manual pages...</A></P>
-<P><A HREF="mbsystem_home.html"><IMG SRC="mbsystem_logo_small.gif" BORDER=0 HEIGHT=55 WIDTH=158 ALIGN=BOTTOM></A><A HREF="mbsystem_home.html">Back
-to MB-System Home Page...</A></P>
-
-</BODY>
-</HTML>
diff --git a/src/html/mbm_histplot.html b/src/html/mbm_histplot.html
deleted file mode 100644
index a9679cd..0000000
--- a/src/html/mbm_histplot.html
+++ /dev/null
@@ -1,418 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<HTML VERSION="2.0">
-<HEAD>
-   <TITLE>MB-System Unix Manual Page: mbm_histplot</TITLE>
-<!-- WEBMAGIC VERSION NUMBER="2.0.2" -->
-<!-- WEBMAGIC TRANSLATION NAME="ServerRoot" SRC="/var/www/htdocs/" DST="/" -->
-<!-- WEBMAGIC TRANSLATION NAME="ProjectRoot" SRC="./" DST="" -->
-</HEAD>
-<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#336699" VLINK="#997040" ALINK="#CC9900">
-<BODY>
-<CENTER><H3><U>MB-System Unix Manual Page</U></H3></CENTER>
-<PRE>
-<H1>mbm_histplot</H1>
-Section:  MB-System 5.0  (1)<BR>Updated:  9 January 2015 <BR><A HREF="#index">Index</A>
-<HR>
-
-<A NAME="lbAB"> </A>
-<H2>NAME</H2>
-
-<B>mbm_histplot</B> - Create an executable shellscript which will generate
-a GMT histogram plot of a dataset.
-<P>
-<A NAME="lbAC"> </A>
-<H2>VERSION</H2>
-
-Version 5.0
-<P>
-<A NAME="lbAD"> </A>
-<H2>SYNOPSIS</H2>
-
-<B>mbm_histplot</B> <B>-I</B><I>file</I>
-[<B>-G</B><I>fill</I> <B>-H</B>
-<B>-O</B><I>root</I> <B>-P</B><I>pagesize</I>
-<B>-U</B><I>orientation</I> <B>-V</B>
-<B>-W</B><I>pen</I> ]
-<P>
-Additional Options:
-<BR>
-
-[<B>-B</B><I>tickinfo</I> 
-<B>-J</B><I>projection</I>[<I>/scale | width</I>]
-<B>-L</B><I>title</I>[<I>:xlabel:ylabel</I>] <B>-M</B><I>misc</I>
-<B>-Q</B> <B>-R</B><I>w/e/s/n</I> <B>-X</B> <B>-Z</B>]
-<P>
-<A NAME="lbAE"> </A>
-<H2>DESCRIPTION</H2>
-
-<B>mbm_histplot</B> is a macro to generate a shellscript of
-GMT commands which, when executed, will generate a Postscript
-histogram plot of a set of data values.
-The plot will be scaled to fit on the specified page size
-or, if the scale is user defined, the page size will be
-chosen in accordance with the plot size. The primary purpose
-of this macro is to allow the simple, semi-automated
-production of nice looking plots with a few command line
-arguments. For users seeking more control over the plot
-appearance, a number of additional optional arguments are
-provided. Truly ambitious users may edit the plot shellscript
-to take advantage of GMT capabilities not supported by this
-macro.
-<P>
-By default the output plot generation shellscript
-includes lines which execute a program to display the Postscript
-image on the screen. The program to be used to display the Postscript
-is set using <B>mbdefaults</B>; the default value can be overridden
-by setting the environment variable $MB_PS_VIEWER.
-Invoking the plot generation shellscript with
-a <B>-N</B> command line argument suppresses the screen
-display of the plot.
-<P>
-The plot scripts generated by this macro will work with
-GMT version 5.0 and later, and are not compatible with
-earlier versions of GMT.
-<P>
-<A NAME="lbAF"> </A>
-<H2>AUTHORSHIP</H2>
-
-David W. Caress (<A HREF="mailto:caress at mbari.org">caress at mbari.org</A>)
-<BR>
-
-<BR>  Monterey Bay Aquarium Research Institute
-<BR>
-
-Dale N. Chayes (<A HREF="mailto:dale at ldeo.columbia.edu">dale at ldeo.columbia.edu</A>)
-<BR>
-
-<BR>  Lamont-Doherty Earth Observatory
-<BR>
-
-Suzanne H. O'Hara (<A HREF="mailto:sohara at ldeo.columbia.edu">sohara at ldeo.columbia.edu</A>)
-<BR>
-
-<BR>  Lamont-Doherty Earth Observatory
-<P>
-<A NAME="lbAG"> </A>
-<H2>OPTIONS</H2>
-
-<DL COMPACT>
-<DT><B>-B</B>
-
-<DD>
-<I>tickinfo</I>
-<BR>
-
-Sets map boundary tickmark intervals. See the <B>psbasemap</B>
-manual page for details. By default the program chooses
-basemap annotations based on the map boundaries.
-<DT><B>-C</B>
-
-<DD>
-<I>cellwidth</I>
-<BR>
-
-Sets the width of the cells into which the data are binned to form
-the histogram. The default is use a cell width that is 1/10 the
-data range.
-<DT><B>-G</B>
-
-<DD>
-<I>fill</I>
-<BR>
-
-Select filling of the histogram.
-Set the shade (0-255) or color
-(r/g/b) [Default is a light gray]. To reset no fill,
-use <I>fill</I> = "N".
-You may optionally specify
-<B>-Gp</B><I>icon_size/pattern</I>, where
-<I>pattern</I> gives the number of the
-image pattern (1-32) OR the name of a
-icon-format file.  <I>icon_size</I> sets
-the unit size in inch.
-To invert black and white pixels, use
-<B>-GP</B> instead of <B>-Gp</B>.  See
-<B>GMTs</B> Cookbook & Technical Reference
-Appendix E for information on individual patterns.
-<DT><B>-H</B>
-
-<DD>
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-<DT><B>-I</B>
-
-<DD>
-<I>[filepars:]xy_file</I>
-<BR>
-
-<P>
-Specifies the file containing the data to be plotted in a
-histogram. A single column of data is expected.
-<DT><B>-J</B>
-
-<DD>
-<I>projection</I>[<I>/width/height</I>]
-<BR>
-
-Sets the plot scale. The projection is linear (<B>-J</B><I>X), and
-the user can optionally specify the width and height.
-<DT></I><B>-L</B>
-
-<DD>
-<I>title[:xlabel[:ylabel]]</I>
-<BR>
-
-Sets the title and the labels for the x and y axes of
-the plot. Note that a colon (:) rather than a slash (/) is
-used to separate the labels. Colons cannot be used in the
-labels themselves. If this option is not used, then a default title
-and colorscale label are provided. If the title is supplied
-alone, no x or y-axis labels will be provided.
-<DT><B>-O</B>
-
-<DD>
-<I>root</I>
-<BR>
-
-Sets the root used to construct the filename of the output shellscript
-(<I>root</I>.cmd) and names of files created when the shellscript is
-run.  Normally the
-name of the input grid file or grid file list is
-used as the <I>root</I>.
-<DT><B>-P</B>
-
-<DD>
-<I>pagesize</I>
-<BR>
-
-This option sets the size of the page the plot will be centered
-on. If the user does not set the plot scale, the plot will be
-sized as large as will fit on the designated page. If the user
-sets the plot scale such that the plot will not fit on the
-designated page, a larger page will be used.
-The supported page sizes are:
-<P>
-<BR>          American ANSI sizes:
-<BR>          A     8.5 x 11.0 in.    ( 215.9 x  279.4 mm)
-<BR>          B    11.0 x 17.0 in.    ( 279.4 x  431.8 mm)
-<BR>          C    17.0 x 22.0 in.    ( 431.8 x  558.8 mm)
-<BR>          D    22.0 x 34.0 in.    ( 558.8 x  863.6 mm)
-<BR>          E    34.0 x 44.0 in.    ( 863.6 x 1117.6 mm)
-<BR>          F    28.0 x 40.0 in.    ( 711.2 x 1016.0 mm)
-<BR>          E1   44.0 x 68.0 in.    (1117.6 x 1727.2 mm)
-<P>
-<BR>          Metric ISO A sizes:
-<BR>          A0   841.0 x 1189.0 mm  (33.11 x 46.81 in.)
-<BR>          A1   594.0 x  841.0 mm  (23.39 x 33.11 in.)
-<BR>          A2   420.0 x  594.0 mm  (16.54 x 23.39 in.)
-<BR>          A3   297.0 x  420.0 mm  (11.69 x 16.54 in.)
-<BR>          A4   210.0 x  297.0 mm  ( 8.27 x 11.69 in.)
-<BR>          A5   148.0 x  210.0 mm  ( 5.83 x  8.27 in.)
-<BR>          A6   105.0 x  148.0 mm  ( 4.13 x  5.83 in.)
-<BR>          A7    74.0 x  105.0 mm  ( 2.91 x  4.13 in.)
-<BR>          A8    52.0 x   74.0 mm  ( 2.05 x  2.91 in.)
-<BR>          A9    37.0 x   52.0 mm  ( 1.46 x  2.05 in.)
-<BR>          A10   26.0 x   37.0 mm  ( 1.02 x  1.46 in.)
-<P>
-<BR>          Metric ISO B sizes:
-<BR>          B0   1000.0x 1414.0 mm  (39.37 x 55.67 in.)
-<BR>          B1   707.0 x 1000.0 mm  (27.83 x 39.37 in.)
-<BR>          B2   500.0 x  707.0 mm  (19.68 x 27.83 in.)
-<BR>          B3   353.0 x  500.0 mm  (13.90 x 19.68 in.)
-<BR>          B4   250.0 x  353.0 mm  ( 9.84 x 13.90 in.)
-<BR>          B5   176.0 x  250.0 mm  ( 6.93 x  9.84 in.)
-<BR>          B6   125.0 x  176.0 mm  ( 4.92 x  6.93 in.)
-<BR>          B7    88.0 x  125.0 mm  ( 3.46 x  4.92 in.)
-<BR>          B8    62.0 x   88.0 mm  ( 2.44 x  3.46 in.)
-<BR>          B9    44.0 x   62.0 mm  ( 1.73 x  2.44 in.)
-<BR>          B10   31.0 x   44.0 mm  ( 1.22 x  1.73 in.)
-<P>
-<BR>          Metric ISO C sizes:
-<BR>          C0   914.4 x 1300.5 mm  (36.00 x 51.20 in.)
-<BR>          C1   650.2 x  914.4 mm  (25.60 x 36.00 in.)
-<BR>          C2   457.2 x  650.2 mm  (18.00 x 25.60 in.)
-<BR>          C3   325.1 x  457.2 mm  (12.80 x 18.00 in.)
-<BR>          C4   228.6 x  325.1 mm  ( 9.00 x 12.80 in.)
-<BR>          C5   162.6 x  228.6 mm  ( 6.40 x  9.00 in.)
-<BR>          C6   114.3 x  162.6 mm  ( 4.50 x  6.40 in.)
-<BR>          C7    81.3 x  114.3 mm  ( 3.20 x  4.50 in.)
-<P>
-<TT>        </TT>  MB-System large format sizes:<BR>
-<BR>          m1  1371.6 x 1828.8 mm  (54.00 x 72.00 in.)
-<BR>          m2  1371.6 x 2133.6 mm  (54.00 x 84.00 in.)
-<BR>          m3  1371.6 x 2438.4 mm  (54.00 x 96.00 in.)
-<BR>          m4  1524.0 x 1828.8 mm  (60.00 x 72.00 in.)
-<BR>          m5  1524.0 x 2133.6 mm  (60.00 x 84.00 in.)
-<BR>          m6  1524.0 x 2438.4 mm  (60.00 x 96.00 in.)
-<P>
-The default page size is A.
-<DT><B>-Q</B>
-
-<DD>
-Normally, the output plot generation shellscript
-includes lines which execute
-a program to display the Postscript image on the screen.
-This option causes those lines to be commented out so
-that executing the shellscript produces a Postscript plot
-but does not attempt to display it on the screen.
-Alternatively, invoking the plot generation shellscript with
-a <B>-N</B> command line argument also suppresses the screen
-display of the plot. The program
-to be used to display the Postscript is set
-using <B>mbdefaults</B>;
-the default value can be overridden by setting the environment
-variable $MB_PS_VIEWER.
-<DT><B>-R</B>
-
-<DD>
-<I>west/east/south/north</I>
-<BR>
-
-<I>west, east, south,</I> and <I>north</I> specify the Region of interest. [Default is
-the range of the data and the histogram distribution].
-<DT><B>-U</B>
-
-<DD>
-<I>orientation</I>
-<BR>
-
-Normally the orientation of the plot (portrait or landscape)
-is selected automatically so as to maximize the plot scale.
-The <B>-U</B> option allows the user to set the plot orientation. If
-<I>orientation</I> = 1, a portrait plot will be produced; if
-<I>orientation</I> = 2, a landscape plot will be produced.
-<DT><B>-V</B>
-
-<DD>
-Causes <B>mbm_histplot</B> to operate in "verbose" mode
-so that it outputs
-more information than usual.
-<DT><B>-W</B>
-
-<DD>
-<I>pen</I>
-<BR>
-
-Set pen attributes for plotting. See chapter 4.12 in the
-GMT Technical reference for a discussion of GMT pen values.
-[Defaults: width = 1, color = 0/0/0,
-texture = solid].
-<DT><B>-X</B>
-
-<DD>
-Normally, <B>mbm_histplot</B> creates an executable shellscript and
-then exits.  This option will cause the shellscript to be executed
-in the background before <B>mbm_histplot</B> exits.
-<P>
-</DL>
-<A NAME="lbAH"> </A>
-<H2>EXAMPLES</H2>
-
-Suppose we have a single column ascii file of time lag estimates called
-timelag.dat. In order to generate a 6 inch wide and 4 inches high
-simple histogram plot of these data, use:
-<BR>
-
-<TT>       </TT>mbm_histplot -Itimelag.dat -Otimelaghist -JX6/4 -V<BR>
-to generate a GMT plot shellscript called timelaghist.cmd.
-<P>
-As an example, the contents of the plotting shellscript
-"timelaghist.cmd" are:
-<P>
-#! /bin/csh -f
-#
-# Shellscript to create Postscript plot of data in grd file
-# Created by macro mbm_histplot
-#
-# This shellscript created by following command line:
-# mbm_histplot -Itimelag.dat -Otimelaghist -JX6/4 -V
-#
-# Define shell variables used in this script:
-set PS_FILE         = timelaghist.ps
-set CPT_FILE        =
-set MAP_PROJECTION  = X
-set MAP_SCALE       = 6/4
-set MAP_REGION      = -0.57/0.12/0/50
-set X_OFFSET        = 2.5
-set Y_OFFSET        = 2.375
-#
-# Save existing GMT defaults
-echo Saving GMT defaults...
-gmtdefaults -L >! gmtdefaults$$
-#
-# Set new GMT defaults
-echo Setting new GMT defaults...
-gmtset MEASURE_UNIT inch
-gmtset PAPER_MEDIA archA+
-gmtset ANOT_FONT Helvetica
-gmtset LABEL_FONT Helvetica
-gmtset HEADER_FONT Helvetica
-gmtset ANOT_FONT_SIZE 8
-gmtset LABEL_FONT_SIZE 8
-gmtset HEADER_FONT_SIZE 10
-gmtset FRAME_WIDTH 0.075
-gmtset TICK_LENGTH 0.075
-gmtset PAGE_ORIENTATION LANDSCAPE
-gmtset COLOR_BACKGROUND 0/0/0
-gmtset COLOR_FOREGROUND 255/255/255
-gmtset COLOR_NAN 255/255/255
-gmtset DEGREE_FORMAT 3
-#
-# Make histogram
-echo Running pshistogram...
-pshistogram timelag.dat <TT>        </TT>-J$MAP_PROJECTION$MAP_SCALE <TT>    </TT>-R$MAP_REGION <TT>  </TT>-B0.05:" ":/5:"Frequency %"::."Frequency Histogram of timelag.dat": -W0.069 -Z1 -L1p -Ggray -X$X_OFFSET -Y$Y_OFFSET -V >! $PS_FILE<BR>
-#
-# Delete surplus files
-echo Deleting surplus files...
-/bin/rm -f $CPT_FILE
-#
-# Reset GMT default fonts
-echo Resetting GMT fonts...
-/bin/mv gmtdefaults$$ .gmtdefaults
-#
-# Run gv
-echo Running gv in background...
-gv --orientation=landscape --media=BBox $PS_FILE &
-#
-# All done!
-echo All done!
-<P>
-<A NAME="lbAI"> </A>
-<H2>SEE ALSO</H2>
-
-<B><A HREF="mbsystem.html">mbsystem</A></B>(1), <B><A HREF="mbdefaults.html">mbdefaults</A></B>(1),
-<B><A HREF="mbm_grdplot.html">mbm_grdplot</A></B>(1), <B><A HREF="mbm_grd3dplot.html">mbm_grd3dplot</A></B>(1),
-<B><A HREF="mbm_plot.html">mbm_plot</A></B>(1)
-<P>
-<A NAME="lbAJ"> </A>
-<H2>BUGS</H2>
-
-Please let us know.
-<P>
-
-<HR>
-<A NAME="index"> </A><H2>Index</H2>
-<DL>
-<DT><A HREF="#lbAB">NAME</A><DD>
-<DT><A HREF="#lbAC">VERSION</A><DD>
-<DT><A HREF="#lbAD">SYNOPSIS</A><DD>
-<DT><A HREF="#lbAE">DESCRIPTION</A><DD>
-<DT><A HREF="#lbAF">AUTHORSHIP</A><DD>
-<DT><A HREF="#lbAG">OPTIONS</A><DD>
-<DT><A HREF="#lbAH">EXAMPLES</A><DD>
-<DT><A HREF="#lbAI">SEE ALSO</A><DD>
-<DT><A HREF="#lbAJ">BUGS</A><DD>
-</DL>
-<HR>
-</PRE>
-
-<CENTER><P><BR>
-Last Updated: 9 January 2015</P></CENTER>
-
-<HR>
-<P><A HREF="mbsystem_man_list.html">Return to list of MB-System manual pages...</A></P>
-<P><A HREF="mbsystem_home.html"><IMG SRC="mbsystem_logo_small.gif" BORDER=0 HEIGHT=55 WIDTH=158 ALIGN=BOTTOM></A><A HREF="mbsystem_home.html">Back
-to MB-System Home Page...</A></P>
-
-</BODY>
-</HTML>
diff --git a/src/html/mbm_makedatalist.html b/src/html/mbm_makedatalist.html
deleted file mode 100644
index 244e493..0000000
--- a/src/html/mbm_makedatalist.html
+++ /dev/null
@@ -1,163 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<HTML VERSION="2.0">
-<HEAD>
-   <TITLE>MB-System Unix Manual Page: mbm_makedatalist</TITLE>
-<!-- WEBMAGIC VERSION NUMBER="2.0.2" -->
-<!-- WEBMAGIC TRANSLATION NAME="ServerRoot" SRC="/var/www/htdocs/" DST="/" -->
-<!-- WEBMAGIC TRANSLATION NAME="ProjectRoot" SRC="./" DST="" -->
-</HEAD>
-<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#336699" VLINK="#997040" ALINK="#CC9900">
-<BODY>
-<CENTER><H3><U>MB-System Unix Manual Page</U></H3></CENTER>
-<PRE>
-<H1>mbm_makedatalist</H1>
-Section:  MB-System 5.0  (1)<BR>Updated:  3 June 2013 <BR><A HREF="#index">Index</A>
-<HR>
-
-<A NAME="lbAB"> </A>
-<H2>NAME</H2>
-
-<B>mbm_makedatalist</B> - Macro to generate a datalist of the swath
-files in a specified directory.
-<P>
-<A NAME="lbAC"> </A>
-<H2>VERSION</H2>
-
-Version 5.0
-<P>
-<A NAME="lbAD"> </A>
-<H2>SYNOPSIS</H2>
-
-<B>mbm_makedatalist</B> [<B>-I</B><I>directory</I> <B>-O</B><I>datalist</I> <B>-H -V</B>]
-<P>
-<A NAME="lbAE"> </A>
-<H2>DESCRIPTION</H2>
-
-<B>Mbm_makedatalist</B> is a macro to generate an MB-System
-datalist file referencing all identifiable swath files in
-the specified target directory.
-<P>
-The output datalist will be placed in the current working
-directory. The output datalist is named datalist.mb-1
-by default, but can be specified with the <B>-O</B> option.
-If no target directory is specified with the <B>-I</B>
-option, then the current working directory is used. In order
-for swath files to be recognized and included in the datalist,
-they must conform to the MB-System swath file naming convention
-(see the <B>mbsystem</B> manual page for details).
-<P>
-<A NAME="lbAF"> </A>
-<H2>AUTHORSHIP</H2>
-
-David W. Caress (<A HREF="mailto:caress at mbari.org">caress at mbari.org</A>)
-<BR>
-
-<BR>  Monterey Bay Aquarium Research Institute
-<BR>
-
-Dale N. Chayes (<A HREF="mailto:dale at ldeo.columbia.edu">dale at ldeo.columbia.edu</A>)
-<BR>
-
-<BR>  Lamont-Doherty Earth Observatory
-<P>
-<A NAME="lbAG"> </A>
-<H2>OPTIONS</H2>
-
-<DL COMPACT>
-<DT><B>-H</B>
-
-<DD>
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-<DT><B>-I</B>
-
-<DD>
-<I>directory</I>
-<BR>
-
-Sets the path of the target directory.
-<DT><B>-O</B>
-
-<DD>
-<I>datalist</I>
-<BR>
-
-Sets the name of the output datalist file. Default: datalist.mb-1
-<DT><B>-V</B>
-
-<DD>
-The <B>-V</B> option causes <B>mbm_makedatalist</B> to print out status messages.
-<P>
-</DL>
-<A NAME="lbAH"> </A>
-<H2>EXAMPLES</H2>
-
-Suppose we have a set of swath files in a directory and we
-want to construct a datalist referring to those files. A simple
-directory listing shows four files:
-<BR>
-
-<BR> <TT>       </TT>20051019_154030.mb88<BR>
-<BR> <TT>       </TT>20051019_162540.mb88<BR>
-<BR> <TT>       </TT>20051019_171756.mb88<BR>
-<BR> <TT>       </TT>junk.txt<BR>
-<BR>
-
-of which three are identifiable as swath files because of the
-".mb88" file suffix. Running <B>mbm_makedatalist</B> in this
-directory with no arguments other than verbosity:
-<BR>
-
-<BR> <TT>       </TT>mbm_makedatalist -V<BR>
-<BR>
-
-produces a datalist file named datalist.mb-1. The contents of
-this file are:
-<BR>
-
-<BR> <TT>       </TT>./20051019_154030.mb88 88<BR>
-<BR> <TT>       </TT>./20051019_162540.mb88 88<BR>
-<BR> <TT>       </TT>./20051019_171756.mb88 88<BR>
-<BR>
-
-where the file junk.txt has been ignored.
-<P>
-<A NAME="lbAI"> </A>
-<H2>SEE ALSO</H2>
-
-<B><A HREF="mbsystem.html">mbsystem</A></B>(1), <B><A HREF="mbdatalist.html">mbdatalist</A></B>(1), <B><A HREF="mbinfo.html">mbinfo</A></B>(1)
-<P>
-<A NAME="lbAJ"> </A>
-<H2>BUGS</H2>
-
-This macro doesn't yet recognize when one swath file derives from
-another (e.g. line1p.mb57 can be inferred to be a processed
-version of line1.mb57).
-<P>
-
-<HR>
-<A NAME="index"> </A><H2>Index</H2>
-<DL>
-<DT><A HREF="#lbAB">NAME</A><DD>
-<DT><A HREF="#lbAC">VERSION</A><DD>
-<DT><A HREF="#lbAD">SYNOPSIS</A><DD>
-<DT><A HREF="#lbAE">DESCRIPTION</A><DD>
-<DT><A HREF="#lbAF">AUTHORSHIP</A><DD>
-<DT><A HREF="#lbAG">OPTIONS</A><DD>
-<DT><A HREF="#lbAH">EXAMPLES</A><DD>
-<DT><A HREF="#lbAI">SEE ALSO</A><DD>
-<DT><A HREF="#lbAJ">BUGS</A><DD>
-</DL>
-<HR>
-</PRE>
-
-<CENTER><P><BR>
-Last Updated: 3 June 2013</P></CENTER>
-
-<HR>
-<P><A HREF="mbsystem_man_list.html">Return to list of MB-System manual pages...</A></P>
-<P><A HREF="mbsystem_home.html"><IMG SRC="mbsystem_logo_small.gif" BORDER=0 HEIGHT=55 WIDTH=158 ALIGN=BOTTOM></A><A HREF="mbsystem_home.html">Back
-to MB-System Home Page...</A></P>
-
-</BODY>
-</HTML>
diff --git a/src/html/mbm_makesvp.html b/src/html/mbm_makesvp.html
deleted file mode 100644
index a2f7c5a..0000000
--- a/src/html/mbm_makesvp.html
+++ /dev/null
@@ -1,184 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<HTML VERSION="2.0">
-<HEAD>
-   <TITLE>MB-System Unix Manual Page: mbm_makesvp</TITLE>
-<!-- WEBMAGIC VERSION NUMBER="2.0.2" -->
-<!-- WEBMAGIC TRANSLATION NAME="ServerRoot" SRC="/var/www/htdocs/" DST="/" -->
-<!-- WEBMAGIC TRANSLATION NAME="ProjectRoot" SRC="./" DST="" -->
-</HEAD>
-<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#336699" VLINK="#997040" ALINK="#CC9900">
-<BODY>
-<CENTER><H3><U>MB-System Unix Manual Page</U></H3></CENTER>
-<PRE>
-<H1>mbm_makesvp</H1>
-Section:  MB-System 5.0  (1)<BR>Updated:  13 October 2013 <BR><A HREF="#index">Index</A>
-<HR>
-
-<A NAME="lbAB"> </A>
-<H2>NAME</H2>
-
-<B>mbm_makesvp</B> - Macro to extract sound speed and depth data from a datalist of swath files,
-and generate a sound velocity profile model from averages of the sound speed values in regular depth ranges.
-<P>
-<A NAME="lbAC"> </A>
-<H2>VERSION</H2>
-
-Version 5.0
-<P>
-<A NAME="lbAD"> </A>
-<H2>SYNOPSIS</H2>
-
-<B>mbm_makesvp</B> <B>-I</B><I>inputfile</I> [<B>-H -V</B>
-<B>-D</B><I>depthinterval</I> <B>-O</B><I>outputfile</I>]
-<P>
-<A NAME="lbAE"> </A>
-<H2>DESCRIPTION</H2>
-
-<B>mbm_makesvp</B> is a macro to extract sound speed and depth data from a datalist of swath files,
-and generate a sound velocity profile model from averages of the sound
-speed values in regular depth ranges. 
-<P>
-This macro uses <B>mbctdlist</B> to extract the sound speed values embedded in swath data files.
-This macro is intended for use with mapping data from submerged platforms (e.g. ROVs and AUVs) carrying
-CTD or sound speed sensors. Since the sound speed values are generally recorded during the
-entire ROV or AUV survey, these values can be used to construct a model for sound speed as
-a function of depth at the survey location.
-The sound speed and sonar depth value pairs are binned according to the <I>depthinterval</I>
-value, and average sound speed values are reported for bins with at least one value.
-The <B>-O</B> option specifies the output filename; by default the model is output to
-the stdout stream.
-<P>
-<A NAME="lbAF"> </A>
-<H2>AUTHORSHIP</H2>
-
-David W. Caress (<A HREF="mailto:caress at mbari.org">caress at mbari.org</A>)
-<BR>
-
-<BR>  Monterey Bay Aquarium Research Institute
-<BR>
-
-Dale N. Chayes (<A HREF="mailto:dale at ldeo.columbia.edu">dale at ldeo.columbia.edu</A>)
-<BR>
-
-<BR>  Lamont-Doherty Earth Observatory
-<P>
-<A NAME="lbAG"> </A>
-<H2>OPTIONS</H2>
-
-<DL COMPACT>
-<DT><B>-D</B>
-
-<DD>
-<I>depthinterval</I>
-<BR>
-
-Sets the size in meters of the depth bins used to calculate an average sound speed
-versus depth model. The default value is 25 meters.
-<DT><B>-F</B>
-
-<DD>
-<I>format</I>
-<BR>
-
-Sets the data format for the input data.
-If <I>format</I> < 0, then the input file specified
-with the <B>-I</B> option will actually contain a list of input swath sonar
-data files. This program uses the <B>MBIO</B> library
-and will read or write any swath sonar
-format supported by <B>MBIO</B>. A list of the swath sonar data formats
-currently supported by <B>MBIO</B> and their identifier values
-is given in the <B>MBIO</B> manual page. Default: <I>format</I> = -1.
-<DT><B>-H</B>
-
-<DD>
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-<DT><B>-I</B>
-
-<DD>
-<I>inputfile</I>
-<BR>
-
-Sets the input filename. If <I>format</I> > 0 (set with the
-<B>-f</B> option) then the swath sonar data contained in <I>infile</I>
-is read and processed. If <I>format</I> < 0 (the default),
-then <I>infile</I>
-is assumed to be an ascii file containing a list of the input swath sonar
-data files to be processed and their formats.  The program will read
-the data in each one of these files.
-In the <I>inputfile</I> file, each
-data file should be followed by a data format identifier, e.g.:
-<BR> <TT>       </TT>datafile1 11<BR>
-<BR> <TT>       </TT>datafile2 24<BR>
-<BR>
-
-This program uses the <B>MBIO</B> library and will read any swath sonar
-format supported by <B>MBIO</B>. However, not all formats contain
-sound speed or CTD information, and useful results can only be expected
-from data actually including the relevant values.
-A list of the swath sonar data formats
-currently supported by <B>MBIO</B> and their identifier values
-is given in the <B>MBIO</B> manual page. The default input filename is
-"datalist.mb-1".
-<DT><B>-O</B>
-
-<DD>
-<I>output</I>
-<BR>
-
-Sets the name of the output file for the sound speed versus depth model. By default,
-the model is output to the stdout stream.
-<DT><B>-V</B>
-
-<DD>
-The <B>-V</B> option causes <B>mbm_makesvp</B> to print out status messages.
-<P>
-</DL>
-<A NAME="lbAH"> </A>
-<H2>EXAMPLES</H2>
-
-Suppose we have a set of swath files from an AUV-based survey in a directory and we
-want to construct an average sound speed versus depth model from these data. The
-command:
-<BR>
-
-<TT>       </TT>mbm_makesvp -Idatalist.mb-1 -D25 -Osvp.txt -V<BR>
-will generate a model of sound speed versus depth in the output file "svp.txt".
-<P>
-<A NAME="lbAI"> </A>
-<H2>SEE ALSO</H2>
-
-<B><A HREF="mbsystem.html">mbsystem</A></B>(1), <B><A HREF="mbctdlist.html">mbctdlist</A></B>(1)
-<P>
-<A NAME="lbAJ"> </A>
-<H2>BUGS</H2>
-
-Likely yes.
-<P>
-
-<HR>
-<A NAME="index"> </A><H2>Index</H2>
-<DL>
-<DT><A HREF="#lbAB">NAME</A><DD>
-<DT><A HREF="#lbAC">VERSION</A><DD>
-<DT><A HREF="#lbAD">SYNOPSIS</A><DD>
-<DT><A HREF="#lbAE">DESCRIPTION</A><DD>
-<DT><A HREF="#lbAF">AUTHORSHIP</A><DD>
-<DT><A HREF="#lbAG">OPTIONS</A><DD>
-<DT><A HREF="#lbAH">EXAMPLES</A><DD>
-<DT><A HREF="#lbAI">SEE ALSO</A><DD>
-<DT><A HREF="#lbAJ">BUGS</A><DD>
-</DL>
-<HR>
-</PRE>
-
-<CENTER><P><BR>
-Last Updated: 13 October 2013</P></CENTER>
-
-<HR>
-<P><A HREF="mbsystem_man_list.html">Return to list of MB-System manual pages...</A></P>
-<P><A HREF="mbsystem_home.html"><IMG SRC="mbsystem_logo_small.gif" BORDER=0 HEIGHT=55 WIDTH=158 ALIGN=BOTTOM></A><A HREF="mbsystem_home.html">Back
-to MB-System Home Page...</A></P>
-
-</BODY>
-</HTML>
diff --git a/src/html/mbm_multicopy.html b/src/html/mbm_multicopy.html
deleted file mode 100644
index 4b302cb..0000000
--- a/src/html/mbm_multicopy.html
+++ /dev/null
@@ -1,236 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<HTML VERSION="2.0">
-<HEAD>
-   <TITLE>MB-System Unix Manual Page: mbm_multicopy</TITLE>
-<!-- WEBMAGIC VERSION NUMBER="2.0.2" -->
-<!-- WEBMAGIC TRANSLATION NAME="ServerRoot" SRC="/var/www/htdocs/" DST="/" -->
-<!-- WEBMAGIC TRANSLATION NAME="ProjectRoot" SRC="./" DST="" -->
-</HEAD>
-<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#336699" VLINK="#997040" ALINK="#CC9900">
-<BODY>
-<CENTER><H3><U>MB-System Unix Manual Page</U></H3></CENTER>
-<PRE>
-<H1>mbm_multicopy</H1>
-Section:  MB-System 5.0  (1)<BR>Updated:  3 June 2013 <BR><A HREF="#index">Index</A>
-<HR>
-
-<A NAME="lbAB"> </A>
-<H2>NAME</H2>
-
-<B>mbm_multicopy</B> - Apply mbcopy to all files referenced through
-a datalist using parallel processes. As with mbm_copy, the MB-System
-file suffix convention is used to name the output files.
-<P>
-<A NAME="lbAC"> </A>
-<H2>VERSION</H2>
-
-Version 5.0
-<P>
-<A NAME="lbAD"> </A>
-<H2>SYNOPSIS</H2>
-
-<B>mbm_multicopy</B> <B>-F</B><I>outputformat</I> <B>-I</B><I>datalist</I>
-[<B>-H</B> <B>-C -T</B> <B>-V</B> <B>-X</B><I>nprocesses</I>]
-<P>
-<A NAME="lbAE"> </A>
-<H2>DESCRIPTION</H2>
-
-<P>
-<B>mbm_multicopy</B> is a macro used to copy large numbers of swath data files
-from one data format to another using the program <B>mbcopy</B>.
-This macro is the same as <B>mbm_copy</B> except that it can execute more than
-one instance of <B>mbcopy</B> simultaneously.
-<P>
-The input is a datalist file referencing
-all of the target swath files. The output swath file format is specified
-with the <B>-F</B> option. If the output swath file format is not specified,
-the output format will be the same as the input format.
-<P>
-The macro identifies a filename root for each input swath file. For files
-with recognized filename suffixes (e.g. ".mb61" for a format 61 file), the
-filename root is the part of the filename that comes before the suffix. For
-files without a recognized suffix, the filename root is the entire filename.
-So, for a format 57 data file called "0007_20020425_060531.mb57", the filename root
-is "0007_20020425_060531". For a format 121 file named "009_1659", the filename
-root "009_1659".
-<P>
-The output filenames are automatically constructed by adding the standard
-MB-System file suffix to the filename root. This suffix is ".mbXXX" where
-XXX is the two or three digit format id number. In the event that the output
-filename is the same as the input filename (likely only if the <B>-F</B> option
-is not used to set the output format), a "c" will be placed at the beginning
-of the output file suffix, making it "c.mbXXX".
-<P>
-The <B>-X</B><I>nprocesses</I> option sets the number of parallel processes that can be
-started by <B>mbm_multicopy</B>. In general, the most efficient (fastest) execution of
-the overall command will be achieved when <I>nprocesses</I> equals the number of
-available CPUs or cores.
-<P>
-The <B>-T</B> option causes this macro to print out the <B>mbcopy</B> commands
-it will execute without actually executing them. This test option allows
-users to check the consequences of their command before actually running it.
-<P>
-<A NAME="lbAF"> </A>
-<H2>AUTHORSHIP</H2>
-
-Christian Ferreira
-<BR>
-
-<BR>  MARUM, University of Bremen
-<BR>
-
-David W. Caress (<A HREF="mailto:caress at mbari.org">caress at mbari.org</A>)
-<BR>
-
-<BR>  Monterey Bay Aquarium Research Institute
-<BR>
-
-Dale N. Chayes (<A HREF="mailto:dale at ldeo.columbia.edu">dale at ldeo.columbia.edu</A>)
-<BR>
-
-<BR>  Lamont-Doherty Earth Observatory
-<P>
-<A NAME="lbAG"> </A>
-<H2>SIMPLE DESCRIPTION OF BASIC OPTIONS</H2>
-
-<DL COMPACT>
-<DT><B>-H</B>
-
-<DD>
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-<DT><B>-C</B>
-
-<DD>
-<BR>
-
-This option causes the program to check if each output file
-already exists, and to forgo copying those that do exist.
-<DT><B>-F</B>
-
-<DD>
-<I>outputformat</I>
-<BR>
-
-This option sets the output swath format. All of the swath data
-files referenced in the datalist specified with the <B>-I</B> option
-will be copied to format <I>outputformat</I> using <B>mbcopy</B>. If
-the <B>-F</B> option is not given, then the input files will be copied
-to their input formats.
-<DT><B>-I</B>
-
-<DD>
-<I>datalist</I>
-<BR>
-
-Sets the input datalist filename. A datalist is an ascii
-file containing a list of the input swath sonar
-data files to be copied and their formats.
-In the <I>datalist</I> file, each
-swath data file should be followed by a data format identifier, e.g.:
-<BR> <TT>       </TT>datafile1 11<BR>
-<BR> <TT>       </TT>datafile2 24<BR>
-<BR>
-
-As discussed in the <B>MB-System</B> manual page, datalists may reference
-other datalists, allowing users to construct recursive datalist structures.
-This program uses the <B>MBIO</B> library and will read or write any swath sonar
-format supported by <B>MBIO</B>. A list of the swath sonar data formats
-currently supported by <B>MBIO</B> and their identifier values
-is given in the <B>MBIO</B> manual page.
-<DT><B>-T</B>
-
-<DD>
-<BR>
-
-This option causes <B>mbm_multicopy</B> to print out the <B>mbcopy</B> commands
-it will execute without actually executing them. This test option allows
-users to check the consequences of their command before actually running it.
-<DT><B>-V</B>
-
-<DD>
-Causes <B>mbm_multicopy</B> to operate in "verbose" mode
-so that it outputs
-more information than usual.
-<DT><B>-X</B>
-
-<DD>
-<I>nprocesses</I>
-<BR>
-
-This option sets the number of parallel, simultaneous <B>mbcopy</B> processes that may be
-run.
-<P>
-</DL>
-<A NAME="lbAH"> </A>
-<H2>EXAMPLES</H2>
-
-Suppose one has three raw (format 56) Simrad EM300 data files:
-<BR> <TT>       </TT>0001_20020424_212920_raw.all<BR>
-<BR> <TT>       </TT>0002_20020425_011607_raw.all<BR>
-<BR> <TT>       </TT>0003_20020425_022926_raw.all<BR>
-<BR>
-
-One can generate a datalist called datalistr.mb-1 referencing these
-three swath files using a text editor or by using <B>awk</B>:
-<BR> <TT>       </TT>ls -1 *all | awk '{print $1" 56"}' > datalistr.mb-1<BR>
-<BR>
-
-In order to translate all three files in the processing format for
-Simrad multibeam data (format 57), use the <B>mbm_multicopy</B> macro:
-<BR> <TT>       </TT>mbm_multicopy -I datalistr.mb-1 -F 57 -T -X2 -V<BR>
-<BR>
-
-The macro prints out the following as it translates the swath data:
-<BR> <TT>       </TT>Running mbm_multicopy...<BR>
-<BR> <TT>       </TT>Getting file list using mbdatalist...<BR>
-<BR> <TT>       </TT>Initializing parallel processing with as many as 2 processes<BR>
-<P>
-<BR>  <TT>      </TT>Running: mbcopy -F56/57<BR>
-<BR> <TT>       </TT><TT>        </TT>-I0001_20020424_212920_raw.all<BR>
-<BR> <TT>       </TT><TT>        </TT>-O0001_20020424_212920.mb57<BR>
-<BR>  <TT>      </TT>Running: mbcopy -F56/57<BR>
-<BR> <TT>       </TT><TT>        </TT>-I0002_20020425_011607_raw.all<BR>
-<BR> <TT>       </TT><TT>        </TT>-O0002_20020425_011607.mb57<BR>
-<BR>  <TT>      </TT>Running: mbcopy -F56/57<BR>
-<BR> <TT>       </TT><TT>        </TT>-I0003_20020425_022926_raw.all<BR>
-<BR> <TT>       </TT><TT>        </TT>-O0003_20020425_022926.mb57<BR>
-<P>
-<A NAME="lbAI"> </A>
-<H2>SEE ALSO</H2>
-
-<B><A HREF="mbsystem.html">mbsystem</A></B>(1), <B><A HREF="mbm_copy.html">mbm_copy</A></B>(1), <B><A HREF="mbcopy.html">mbcopy</A></B>(1),
-<B><A HREF="mbdatalist.html">mbdatalist</A></B>(1)
-<P>
-<A NAME="lbAJ"> </A>
-<H2>BUGS</H2>
-
-Perhaps.
-<P>
-
-<HR>
-<A NAME="index"> </A><H2>Index</H2>
-<DL>
-<DT><A HREF="#lbAB">NAME</A><DD>
-<DT><A HREF="#lbAC">VERSION</A><DD>
-<DT><A HREF="#lbAD">SYNOPSIS</A><DD>
-<DT><A HREF="#lbAE">DESCRIPTION</A><DD>
-<DT><A HREF="#lbAF">AUTHORSHIP</A><DD>
-<DT><A HREF="#lbAG">SIMPLE DESCRIPTION OF BASIC OPTIONS</A><DD>
-<DT><A HREF="#lbAH">EXAMPLES</A><DD>
-<DT><A HREF="#lbAI">SEE ALSO</A><DD>
-<DT><A HREF="#lbAJ">BUGS</A><DD>
-</DL>
-<HR>
-</PRE>
-
-<CENTER><P><BR>
-Last Updated: 3 June 2013</P></CENTER>
-
-<HR>
-<P><A HREF="mbsystem_man_list.html">Return to list of MB-System manual pages...</A></P>
-<P><A HREF="mbsystem_home.html"><IMG SRC="mbsystem_logo_small.gif" BORDER=0 HEIGHT=55 WIDTH=158 ALIGN=BOTTOM></A><A HREF="mbsystem_home.html">Back
-to MB-System Home Page...</A></P>
-
-</BODY>
-</HTML>
diff --git a/src/html/mbm_multidatalist.html b/src/html/mbm_multidatalist.html
deleted file mode 100644
index d03f162..0000000
--- a/src/html/mbm_multidatalist.html
+++ /dev/null
@@ -1,224 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<HTML VERSION="2.0">
-<HEAD>
-   <TITLE>MB-System Unix Manual Page: mbm_multidatalist</TITLE>
-<!-- WEBMAGIC VERSION NUMBER="2.0.2" -->
-<!-- WEBMAGIC TRANSLATION NAME="ServerRoot" SRC="/var/www/htdocs/" DST="/" -->
-<!-- WEBMAGIC TRANSLATION NAME="ProjectRoot" SRC="./" DST="" -->
-</HEAD>
-<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#336699" VLINK="#997040" ALINK="#CC9900">
-<BODY>
-<CENTER><H3><U>MB-System Unix Manual Page</U></H3></CENTER>
-<PRE>
-<H1>mbm_multidatalist</H1>
-Section:  MB-System 5.0  (1)<BR>Updated:  3 June 2013 <BR><A HREF="#index">Index</A>
-<HR>
-
-<A NAME="lbAB"> </A>
-<H2>NAME</H2>
-
-<B>mbm_multidatalist</B> - Macro to use mbdatalist with the <B>-O</B> option
-to generate standard  ancilliary files, using parallel processes.
-<P>
-<A NAME="lbAC"> </A>
-<H2>VERSION</H2>
-
-Version 5.0
-<P>
-<A NAME="lbAD"> </A>
-<H2>SYNOPSIS</H2>
-
-<B>mbm_multidatalist</B> <B>-I</B><I>datalist</I>
-[<B>-X</B><I>nprocesses</I> [<B>-N</B> <B>-H</B> <B>-V</B>]
-<P>
-<A NAME="lbAE"> </A>
-<H2>DESCRIPTION</H2>
-
-<P>
-<B>mbm_multidatalist</B> is a macro used to efficiently generate ancilliary files
-for the swath data files referenced in the input datalist file. This is
-accomplished by executing <B>mbdatalist</B> with the <B>-O</B> or <B>-N</B> option
-for each swath file.
-<P>
-Programs such as <B>mbgrid</B> try to check statistics or "inf"
-files to see if the corresponding data files include data within
-the specified geographic bounds. Other programs look for
-"fast bathymetry" or "fast navigation" ("fbt" or "fnv") files
-in order to read the data more quickly. The <B>-N</B> option causes
-<B>mbm_multidatalist</B> to create these three types of ancillary files
-for each swath data file. By default, <B>mbm_multidatalist</B>
-creates the "inf", "fbt", and "fnv" files only when they don't
-already exist or are out of date (older than the data file).
-The <B>-N</B> option causes <B>mbm_multidatalist</B> to create
-(or recreate) the ancillary files
-for each swath data file.
-<P>
-The <B>-X</B><I>nprocesses</I> option sets the number of parallel processes that can be
-started by <B>mbm_multidatalist</B>. In general, the most efficient (fastest) execution of
-the overall command will be achieved when <I>nprocesses</I> equals the number of
-available CPUs or cores.
-<P>
-<A NAME="lbAF"> </A>
-<H2>AUTHORSHIP</H2>
-
-Christian Ferreira
-<BR>
-
-<BR>  MARUM, University of Bremen
-<BR>
-
-David W. Caress (<A HREF="mailto:caress at mbari.org">caress at mbari.org</A>)
-<BR>
-
-<BR>  Monterey Bay Aquarium Research Institute
-<BR>
-
-Dale N. Chayes (<A HREF="mailto:dale at ldeo.columbia.edu">dale at ldeo.columbia.edu</A>)
-<BR>
-
-<BR>  Lamont-Doherty Earth Observatory
-<P>
-<A NAME="lbAG"> </A>
-<H2>SIMPLE DESCRIPTION OF BASIC OPTIONS</H2>
-
-<DL COMPACT>
-<DT><B>-H</B>
-
-<DD>
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-<DT><B>-C</B>
-
-<DD>
-<BR>
-
-This option causes the program to check if each output file
-already exists, and to forgo copying those that do exist.
-<DT><B>-I</B>
-
-<DD>
-<I>datalist</I>
-<BR>
-
-Sets the input datalist filename. A datalist is an ascii
-file containing a list of the input swath sonar
-data files to be copied and their formats.
-In the <I>datalist</I> file, each
-swath data file should be followed by a data format identifier, e.g.:
-<BR> <TT>       </TT>datafile1 11<BR>
-<BR> <TT>       </TT>datafile2 24<BR>
-<BR>
-
-As discussed in the <B>MB-System</B> manual page, datalists may reference
-other datalists, allowing users to construct recursive datalist structures.
-This program uses the <B>MBIO</B> library and will read or write any swath sonar
-format supported by <B>MBIO</B>. A list of the swath sonar data formats
-currently supported by <B>MBIO</B> and their identifier values
-is given in the <B>MBIO</B> manual page.
-<DT><B>-N</B>
-
-<DD>
-This argument causes <B>mbm_multidatalist</B> to generate the three ancillary
-data files ("inf", "fbt", and "fnv") even if they already exist and are up to date.
-<DT><B>-V</B>
-
-<DD>
-Causes <B>mbm_multidatalist</B> to operate in "verbose" mode
-so that it outputs
-more information than usual.
-<DT><B>-X</B>
-
-<DD>
-<I>nprocesses</I>
-<BR>
-
-This option sets the number of parallel, simultaneous <B>mbdatalist</B> processes that may be
-run.
-<P>
-</DL>
-<A NAME="lbAH"> </A>
-<H2>EXAMPLES</H2>
-
-Suppose one has two format 88 Reson 7125 data files:
-<BR> <TT>       </TT>20110805_053612.mb88<BR>
-<BR> <TT>       </TT>20110805_054149.mb88<BR>
-<BR>
-
-One can generate a datalist called datalistr.mb-1 referencing these
-three swath files using a text editor or by using <B>awk</B>:
-<BR> <TT>       </TT>ls -1 *.mb88 | awk '{print $1" 88"}' > datalist.mb-1<BR>
-<BR>
-
-In order to generate the usual ancilliary files (*.inf, *.fbt, and *.fnv files)
-use the <B>mbm_multidatalist</B> macro:
-<BR> <TT>       </TT>mbm_multidatalist -I datalist.mb-1 -X2 -V<BR>
-<BR>
-
-The macro prints out the following as it generates the *.inf, *.fbt, and *.fnv
-files for each swath data file:
-<P>
-<BR> <TT>       </TT>Running mbm_multidatalist...<BR>
-<BR> <TT>       </TT>Executing mbdatalist -I20110805_053612.mb88 -O -V<BR>
-<BR> <TT>       </TT>Executing mbdatalist -I20110805_054149.mb88 -O -V<BR>
-<P>
-<BR> <TT>       </TT>Program mbdatalist<BR>
-<P>
-<BR> <TT>       </TT>Version $Id: mbm_multidatalist.1 2096 2013-06-04 08:17:22Z caress $<BR>
-<BR> <TT>       </TT>Program mbdatalist<BR>
-<BR> <TT>       </TT>MB-system Version 5.3.1904<BR>
-<BR> <TT>       </TT>Version $Id: mbm_multidatalist.1 2096 2013-06-04 08:17:22Z caress $<BR>
-<BR> <TT>       </TT>MB-system Version 5.3.1904<BR>
-<P>
-<BR> <TT>       </TT>Generating inf file for 20110805_054149.mb88<BR>
-<P>
-<BR> <TT>       </TT>Generating inf file for 20110805_053612.mb88<BR>
-<BR> <TT>       </TT>Generating fbt file for 20110805_054149.mb88<BR>
-<BR> <TT>       </TT>Generating fbt file for 20110805_053612.mb88<BR>
-<BR> <TT>       </TT>Generating fnv file for 20110805_054149.mb88<BR>
-<BR> <TT>       </TT>Generating fnv file for 20110805_053612.mb88<BR>
-<P>
-<BR> <TT>       </TT>Total swath files:         1<BR>
-<P>
-<BR> <TT>       </TT>Total swath files:         1<BR>
-<P>
-Note that the terminal messages from the two <B>mbdatalist</B> processes are
-mixed because the processes are executed in parallel.
-<P>
-<A NAME="lbAI"> </A>
-<H2>SEE ALSO</H2>
-
-<B><A HREF="mbsystem.html">mbsystem</A></B>(1), <B><A HREF="mbdatalist.html">mbdatalist</A></B>(1), <B><A HREF="mbcopy.html">mbcopy</A></B>(1),
-<B><A HREF="mbdatalist.html">mbdatalist</A></B>(1)
-<P>
-<A NAME="lbAJ"> </A>
-<H2>BUGS</H2>
-
-Perhaps.
-<P>
-
-<HR>
-<A NAME="index"> </A><H2>Index</H2>
-<DL>
-<DT><A HREF="#lbAB">NAME</A><DD>
-<DT><A HREF="#lbAC">VERSION</A><DD>
-<DT><A HREF="#lbAD">SYNOPSIS</A><DD>
-<DT><A HREF="#lbAE">DESCRIPTION</A><DD>
-<DT><A HREF="#lbAF">AUTHORSHIP</A><DD>
-<DT><A HREF="#lbAG">SIMPLE DESCRIPTION OF BASIC OPTIONS</A><DD>
-<DT><A HREF="#lbAH">EXAMPLES</A><DD>
-<DT><A HREF="#lbAI">SEE ALSO</A><DD>
-<DT><A HREF="#lbAJ">BUGS</A><DD>
-</DL>
-<HR>
-</PRE>
-
-<CENTER><P><BR>
-Last Updated: 3 June 2013</P></CENTER>
-
-<HR>
-<P><A HREF="mbsystem_man_list.html">Return to list of MB-System manual pages...</A></P>
-<P><A HREF="mbsystem_home.html"><IMG SRC="mbsystem_logo_small.gif" BORDER=0 HEIGHT=55 WIDTH=158 ALIGN=BOTTOM></A><A HREF="mbsystem_home.html">Back
-to MB-System Home Page...</A></P>
-
-</BODY>
-</HTML>
diff --git a/src/html/mbm_multiprocess.html b/src/html/mbm_multiprocess.html
deleted file mode 100644
index a40f117..0000000
--- a/src/html/mbm_multiprocess.html
+++ /dev/null
@@ -1,200 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<HTML VERSION="2.0">
-<HEAD>
-   <TITLE>MB-System Unix Manual Page: mbm_multiprocess</TITLE>
-<!-- WEBMAGIC VERSION NUMBER="2.0.2" -->
-<!-- WEBMAGIC TRANSLATION NAME="ServerRoot" SRC="/var/www/htdocs/" DST="/" -->
-<!-- WEBMAGIC TRANSLATION NAME="ProjectRoot" SRC="./" DST="" -->
-</HEAD>
-<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#336699" VLINK="#997040" ALINK="#CC9900">
-<BODY>
-<CENTER><H3><U>MB-System Unix Manual Page</U></H3></CENTER>
-<PRE>
-<H1>mbm_multiprocess</H1>
-Section:  MB-System 5.0  (1)<BR>Updated:  3 June 2013 <BR><A HREF="#index">Index</A>
-<HR>
-
-<A NAME="lbAB"> </A>
-<H2>NAME</H2>
-
-<B>mbm_multiprocess</B> - Macro to run mbprocess on the swath files referenced
-by a datalist using parallel processes.
-<P>
-<A NAME="lbAC"> </A>
-<H2>VERSION</H2>
-
-Version 5.0
-<P>
-<A NAME="lbAD"> </A>
-<H2>SYNOPSIS</H2>
-
-<B>mbm_multiprocess</B> <B>-I</B><I>datalist</I>
-[<B>-X</B><I>nprocesses</I> <B>-H</B> <B>-V</B>]
-<P>
-<A NAME="lbAE"> </A>
-<H2>DESCRIPTION</H2>
-
-<P>
-<B>mbm_multiprocess</B> is a macro used to effeciently process large numbers of swath
-data files by executing parallel instances of the program <B>mbprocess</B>. See the
-<B>mbprocess</B> manual page for a description of its operation.
-<P>
-The <B>-X</B><I>nprocesses</I> option sets the number of parallel processes that can be
-started by <B>mbm_multiprocess</B>. In general, the most efficient (fastest) execution of
-the overall command will be achieved when <I>nprocesses</I> equals the number of
-available CPUs or cores.
-<P>
-<A NAME="lbAF"> </A>
-<H2>AUTHORSHIP</H2>
-
-Christian Ferreira
-<BR>
-
-<BR>  MARUM, University of Bremen
-<BR>
-
-David W. Caress (<A HREF="mailto:caress at mbari.org">caress at mbari.org</A>)
-<BR>
-
-<BR>  Monterey Bay Aquarium Research Institute
-<BR>
-
-Dale N. Chayes (<A HREF="mailto:dale at ldeo.columbia.edu">dale at ldeo.columbia.edu</A>)
-<BR>
-
-<BR>  Lamont-Doherty Earth Observatory
-<P>
-<A NAME="lbAG"> </A>
-<H2>SIMPLE DESCRIPTION OF BASIC OPTIONS</H2>
-
-<DL COMPACT>
-<DT><B>-H</B>
-
-<DD>
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-<DT><B>-I</B>
-
-<DD>
-<I>datalist</I>
-<BR>
-
-Sets the input datalist filename. A datalist is an ascii
-file containing a list of the input swath sonar
-data files to be copied and their formats.
-In the <I>datalist</I> file, each
-swath data file should be followed by a data format identifier, e.g.:
-<BR> <TT>       </TT>datafile1 11<BR>
-<BR> <TT>       </TT>datafile2 24<BR>
-<BR>
-
-As discussed in the <B>MB-System</B> manual page, datalists may reference
-other datalists, allowing users to construct recursive datalist structures.
-This program uses the <B>MBIO</B> library and will read or write any swath sonar
-format supported by <B>MBIO</B>. A list of the swath sonar data formats
-currently supported by <B>MBIO</B> and their identifier values
-is given in the <B>MBIO</B> manual page.
-<DT><B>-V</B>
-
-<DD>
-Causes <B>mbm_multiprocess</B> to operate in "verbose" mode
-so that it outputs
-more information than usual.
-<DT><B>-X</B>
-
-<DD>
-<I>nprocesses</I>
-<BR>
-
-This option sets the number of parallel, simultaneous <B>mbcopy</B> processes that may be
-run.
-<P>
-</DL>
-<A NAME="lbAH"> </A>
-<H2>EXAMPLES</H2>
-
-Suppose one has two format 88 Reson 7125 data files:
-<BR> <TT>       </TT>20110805_053612.mb88<BR>
-<BR> <TT>       </TT>20110805_054149.mb88<BR>
-<BR>
-
-and that these files are ready to be processed with <B>mbprocess</B>.
-In order to execute the processing using multiple, parallel processes,
-use the macro mbm_multiprocess with a datalist file referencing the
-target swath files as input:
-<BR> <TT>       </TT>mbm_multiprocess -Idatalist.mb-1 -V -X2<BR>
-<BR>
-
-The macro prints out the following as the processing proceeds:
-<P>
-<BR> <TT>       </TT>Running mbm_multiprocess...<BR>
-<P>
-<BR> <TT>       </TT>Program <mbprocess><BR>
-<P>
-<BR> <TT>       </TT>Program <mbprocess><BR>
-<BR> <TT>       </TT>Version $Id: mbm_multiprocess.1 2096 2013-06-04 08:17:22Z caress $<BR>
-<BR> <TT>       </TT>Version $Id: mbm_multiprocess.1 2096 2013-06-04 08:17:22Z caress $<BR>
-<BR> <TT>       </TT>MB-system Version 5.3.1904<BR>
-<BR> <TT>       </TT>MB-system Version 5.3.1904<BR>
-<P>
-<BR> <TT>       </TT>Program Operation:<BR>
-<P>
-<BR> <TT>       </TT>Program Operation:<BR>
-<BR> <TT>       </TT>  Input file:      20110805_053612.mb88<BR>
-<BR> <TT>       </TT>  Input file:      20110805_054149.mb88<BR>
-<BR> <TT>       </TT>  Format:          88<BR>
-<BR> <TT>       </TT>  Format:          88<BR>
-<BR> <TT>       </TT>  Files processed only if out of date.<BR>
-<BR> <TT>       </TT>  Files processed only if out of date.<BR>
-<BR> <TT>       </TT>  Comments embedded in output.<BR>
-<P>
-<BR> <TT>       </TT>  Comments embedded in output.<BR>
-<P>
-<BR> <TT>       </TT>**: Data processed - out of date - unlocked:<BR>
-<BR> <TT>       </TT><TT>        </TT>Input:  /Volumes/MappingAUVOps2011/test/20110805_054149.mb88<BR>
-<BR> <TT>       </TT><TT>        </TT>Output: /Volumes/MappingAUVOps2011/test/20110805_054149p.mb88<BR>
-<BR> <TT>       </TT>**: Data processed - out of date - unlocked:<BR>
-<BR> <TT>       </TT><TT>        </TT>Input:  /Volumes/MappingAUVOps2011/test/20110805_053612.mb88<BR>
-<BR> <TT>       </TT><TT>        </TT>Output: /Volumes/MappingAUVOps2011/test/20110805_053612p.mb88<BR>
-<P>
-Note that the terminal messages from the two <B>mbprocess</B> instances are
-mixed because the processes are executed in parallel.
-<P>
-<A NAME="lbAI"> </A>
-<H2>SEE ALSO</H2>
-
-<B><A HREF="mbsystem.html">mbsystem</A></B>(1), <B><A HREF="mbprocess.html">mbprocess</A></B>(1)
-<P>
-<A NAME="lbAJ"> </A>
-<H2>BUGS</H2>
-
-In insetos sao permitidos.
-Keine insekten hier gestattet ist.
-<P>
-
-<HR>
-<A NAME="index"> </A><H2>Index</H2>
-<DL>
-<DT><A HREF="#lbAB">NAME</A><DD>
-<DT><A HREF="#lbAC">VERSION</A><DD>
-<DT><A HREF="#lbAD">SYNOPSIS</A><DD>
-<DT><A HREF="#lbAE">DESCRIPTION</A><DD>
-<DT><A HREF="#lbAF">AUTHORSHIP</A><DD>
-<DT><A HREF="#lbAG">SIMPLE DESCRIPTION OF BASIC OPTIONS</A><DD>
-<DT><A HREF="#lbAH">EXAMPLES</A><DD>
-<DT><A HREF="#lbAI">SEE ALSO</A><DD>
-<DT><A HREF="#lbAJ">BUGS</A><DD>
-</DL>
-<HR>
-</PRE>
-
-<CENTER><P><BR>
-Last Updated: 3 June 2013</P></CENTER>
-
-<HR>
-<P><A HREF="mbsystem_man_list.html">Return to list of MB-System manual pages...</A></P>
-<P><A HREF="mbsystem_home.html"><IMG SRC="mbsystem_logo_small.gif" BORDER=0 HEIGHT=55 WIDTH=158 ALIGN=BOTTOM></A><A HREF="mbsystem_home.html">Back
-to MB-System Home Page...</A></P>
-
-</BODY>
-</HTML>
diff --git a/src/html/mbm_plot.html b/src/html/mbm_plot.html
deleted file mode 100644
index 5e51980..0000000
--- a/src/html/mbm_plot.html
+++ /dev/null
@@ -1,1586 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<HTML VERSION="2.0">
-<HEAD>
-   <TITLE>MB-System Unix Manual Page: mbm_plot</TITLE>
-<!-- WEBMAGIC VERSION NUMBER="2.0.2" -->
-<!-- WEBMAGIC TRANSLATION NAME="ServerRoot" SRC="/var/www/htdocs/" DST="/" -->
-<!-- WEBMAGIC TRANSLATION NAME="ProjectRoot" SRC="./" DST="" -->
-</HEAD>
-<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#336699" VLINK="#997040" ALINK="#CC9900">
-<BODY>
-<CENTER><H3><U>MB-System Unix Manual Page</U></H3></CENTER>
-<PRE>
-<H1>mbm_plot</H1>
-Section:  MB-System 5.0  (1)<BR>Updated:  9 January 2015 <BR><A HREF="#index">Index</A>
-<HR>
-
-<A NAME="lbAB"> </A>
-<H2>NAME</H2>
-
-<B>mbm_plot</B> - Create an executable shellscript which will generate
-a GMT plot of swath sonar swath data.
-<P>
-<A NAME="lbAC"> </A>
-<H2>VERSION</H2>
-
-Version 5.0
-<P>
-<A NAME="lbAD"> </A>
-<H2>SYNOPSIS</H2>
-
-<B>mbm_plot</B> <B>-F</B><I>format</I> <B>-I</B><I>file</I>
-[<B>-A</B>[<I>magnitude</I>[<I>/azimuth</I>]
-<B>-C</B><I>[cont_int/col_int/tic_int/lab_int/tic_len/lab_hgt]</I>
-<B>-D</B>[<I>flipcolor/flipshade</I>]
-<B>-G</B><I>color_mode[F]</I> <B>-H</B>
-<B>-N</B><I>[ttick/tannot/dannot/tlen[/nhgt] | F | FP]</I>
-<B>-O</B><I>root</I> <B>-P</B><I>pagesize </I>
-<B>-S</B><I>[color/shade]</I> <B>-T</B>
-<B>-U</B><I>orientation</I> <B>-V</B>
-<B>-W</B><I>[color_style</I>[<I>/palette</I>[<I>ncolors</I>]] | <I>cptfile]</I> ]
-<P>
-Additional Options:
-<BR>
-
-[<B>-B</B><I>tickinfo</I>
-<B>-J</B><I>projection</I>[<I>/scale | width</I>]
-<B>-L</B><I>title</I>[<I>:scale_label</I>] <B>-M</B><I>misc</I>
-<B>-Q</B> <B>-R</B><I>w/e/s/n</I> <B>-X</B> <B>-Y</B>
-<B>-Z</B><I>min/max</I> ]
-<P>
-Miscellaneous Options:
-<BR>
-
-[<B>-MGD</B><I>gmtdef/value</I>
-<B>-MGF</B><I>scale_loc</I>
-<B>-MGL</B>[<I>f</I>][<I>x</I>]<I>lon0/lat0/slat/length</I>[<I>units</I>][<I>+llabel</I>]
-<B>-MGQ</B><I>dpi</I>
-<B>-MGT</B><I>x/y/size/angle/font/just/text</I>
-<B>-MGU</B>[<I>/dx/dy/</I>][<I>label</I>]
-<B>-MMA</B><I>factor/mode/depth</I>
-<B>-MMB</B><I>yr/mo/da/hr/mn/sc</I>
-<B>-MMD</B><I>mode/scale[/min/max]</I>
-<B>-MME</B><I>yr/mo/da/hr/mn/sc</I>
-<B>-MML</B><I>lonflip</I>
-<B>-MMN</B><I>nplot</I> <B>-MMP</B><I>pings </I>
-<B>-MMS</B><I>speedmin</I>
-<B>-MMT</B><I>timegap</I> <B>-MMZ</B><I>algorithm</I>
-<B>-MNA</B><I>[nhgt[/P] | P]</I>
-<B>-MNP</B><I>[pingnumber_tick/pingnumber_annot/pingnumber_tick_len]</I>
-<B>-MTC</B><I>fill</I> <B>-MTD</B><I>resolution</I>
-<B>-MTG</B><I>fill</I> <B>-MTI</B><I>river[/pen]</I>
-<B>-MTN</B><I>border[/pen]</I> <B>-MTS</B><I>fill</I>
-<B>-MTW</B><I>pen</I>
-<B>-MXG</B><I>fill</I> <B>-MXI</B><I>xy_file </I>
-<B>-MXM</B>
-<B>-MXS</B><I>symbol/size</I> <B>-MXW</B><I>pen</I>]
-<P>
-<A NAME="lbAE"> </A>
-<H2>DESCRIPTION</H2>
-
-<B>mbm_plot</B> is a macro to generate a shellscript of MB-System and GMT commands
-which, when executed, will generate a Postscript plot of the
-specified swath sonar data. The plot may include bathymetry color
-fill (<B>-G</B><I>1</I>), bathymetry color shaded relief (<B>-G</B><I>2</I>), bathymetry
-shaded with amplitudes (<B>-G</B><I>3</I>), greyshade fill amplitude (<B>-G</B><I>4</I>),
-greyshade fill sidescan (<B>-G</B><I>5</I>), contoured bathymetry (<B>-C</B>),
-or annotated navigation. The plot may also include navigation tracks, text
-labels, xy data in lines or symbols, and coastlines.
-Five different color
-schemes are included. The plot will be scaled to fit on
-the specified page size or, if the scale is user defined,
-the page size will be chosen in accordance with the plot
-size. The primary purpose of this macro is to allow the
-simple, semi-automated production of nice looking maps with
-a few command line arguments. For users seeking more control
-over the plot appearance, a number of additional optional
-arguments are provided. Truly ambitious users may edit the
-plot shellscript to take advantage of MB-System and GMT
-capabilities not supported by this macro.
-<P>
-By default the output plot generation shellscript
-includes lines which execute a program to display the Postscript
-image on the screen. The program to be used to display the Postscript
-is set using <B>mbdefaults</B>; the default value can be overridden
-by setting the environment variable $MB_PS_VIEWER.
-Invoking the plot generation shellscript with
-a <B>-N</B> command line argument suppresses the screen
-display of the plot.
-<P>
-The plot scripts generated by this macro will work with
-GMT version 5.0 and later, and are not compatible with
-earlier versions of GMT.
-<P>
-<A NAME="lbAF"> </A>
-<H2>AUTHORSHIP</H2>
-
-David W. Caress (<A HREF="mailto:caress at mbari.org">caress at mbari.org</A>)
-<BR>
-
-<BR>  Monterey Bay Aquarium Research Institute
-<BR>
-
-Dale N. Chayes (<A HREF="mailto:dale at ldeo.columbia.edu">dale at ldeo.columbia.edu</A>)
-<BR>
-
-<BR>  Lamont-Doherty Earth Observatory
-<BR>
-
-<BR>  Suzanne H. O'Hara (<A HREF="mailto:sohara at ldeo.columbia.edu">sohara at ldeo.columbia.edu</A>)
-<BR>
-
-<BR>  Lamont-Doherty Earth Observatory
-<P>
-<A NAME="lbAG"> </A>
-<H2>SIMPLE DESCRIPTION OF BASIC OPTIONS</H2>
-
-<DL COMPACT>
-<DT><B>-A</B>
-
-<DD>
-<I>magnitude/azimuth</I> or <I>magnitude/median</I>
-<BR>
-
-Sets the parameters which control how <B>mbswath</B> generates
-simulated illumination of bathymetry, which can be either
-shaded relief bathymetry or bathymetry draped with amplitude data.
-If <I>mode</I> is set to 2 (shaded relief bathymetry) using the
-<B>-G</B> option, then the value <I>magnitude</I>
-is an effective vertical exageration which modulates the intensity of
-the shading; typical values are in the 1-5 range.  The value <I>azimuth</I>
-is the azimuth from which the bathymetry is illuminated.
-If <I>mode</I> is set to 3 (bathymetry shaded using amplitudes) using the
-<B>-G</B> option, then the value <I>magnitude</I>
-modulates the intensity of the shading; the value <I>median</I> sets the
-amplitude value which serves as the zero or neutral level.
-<DT><B>-C</B>
-
-<DD>
-Given by itself, the <B>-C</B> option produces a contour plot
-of the bathymetry data with a contour interval chosen according
-to the data in the file or files. If the <B>-G</B> option is used,
-the default contours will be drawn in black; otherwise, the
-default contours will be drawn in four colors (black, red,
-green, and blue) with color changes, annotations, and tickmarks
-every fourth contour interval. Additional optional parameters are
-described in the COMPLETE DESCRIPTION OF OPTIONS section below.
-<DT><B>-D</B>
-
-<DD>
-<I>[flipcolor/flipshade]</I>
-<BR>
-
-This option flips the color and shading conventions used by
-<B>mbm_plot</B>.
-Normally, the color or grayscale tables used for color bathymetry
-maps run from
-cool colors (or dark grays) for large depth values
-to hot colors (or light grays) for small depth values.
-In contrast, sidescan and beam amplitude data is normally plotted
-using light grays (or hot colors) for small amplitudes and
-dark grays (or cool colors) for large amplitudes.
-If <B>-D</B> is given alone or with <I>flipcolor</I> = 1,
-it applies to the color table used
-for color or gray fill plots,  shaded or unshaded. If the plot
-is to be shaded,  either by synthetic illumination (<B>-G</B><I>2</I>)
-or by overlaying amplitude data (<B>-G</B><I>3</I> option), then
-setting <I>flipshade</I> = 1 will cause the shading convention
-to be reversed (e.g. high amplitudes overlaid as light shading).
-Using <B>-D</B><I>0/1</I> will flip the shading convention
-but leave the default color convention.
-<DT><B>-F</B>
-
-<DD>
-<I>format</I>
-<BR>
-
-Sets the data format for the input data.
-If <I>format</I> < 0, then the input file specified
-with the <B>-I</B> option will actually contain a list of input swath sonar
-data files. This program uses the <B>MBIO</B> library
-and will read or write any swath sonar
-format supported by <B>MBIO</B>. A list of the swath sonar data formats
-currently supported by <B>MBIO</B> and their identifier values
-is given in the <B>MBIO</B> manual page. Default: <I>format</I> = -1.
-<DT><B>-G</B>
-
-<DD>
-<I>mode[F]</I>
-<BR>
-
-Turns on color fill swath plot and sets the style of the plot.
-<BR> <TT>       </TT><I>mode</I> = 1:<TT>       </TT>Color fill of bathymetry data.<BR>
-<BR> <TT>       </TT><I>mode</I> = 2:<TT>       </TT>Color shaded relief bathymetry.<BR>
-<BR> <TT>       </TT><I>mode</I> = 3:<TT>       </TT>Bathymetry shaded using amplitude data.<BR>
-<BR> <TT>       </TT><I>mode</I> = 4:<TT>       </TT>Grayscale fill of amplitude data.<BR>
-<BR> <TT>       </TT><I>mode</I> = 5:<TT>       </TT>Grayscale fill of sidescan data.<BR>
-<BR>
-
-If "F" is appended to <I>mode</I>, then <B>mbm_plot</B> will attempt
-to plot amplitude or sidescan data that have been filtered with <B>mbfilter</B>.
-If the desired filtered data files do not exist, then the plotting script
-generated by <B>mbm_plot</B> will fail when
-<B>mbswath</B> exits with an error message. Filtered amplitude
-data are stored in ancilliary files ending with ".ffa", and filtered
-sidescan files end in ".ffs". Filtering of bathymetry data is not supported,
-and so appending "F" to <I>mode</I> values of 1 or 2 will have no effect.
-<DT><B>-H</B>
-
-<DD>
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-<DT><B>-I</B>
-
-<DD>
-<I>filename</I>
-<BR>
-
-Sets the input filename. If <I>format</I> > 0 (set with the
-<B>-f</B> option) then the swath sonar data contained in <I>infile</I>
-is read and processed. If <I>format</I> < 0 (the default),
-then <I>infile</I>
-is assumed to be an ascii file containing a list of the input swath sonar
-data files to be processed and their formats.  The program will read
-the data in each one of these files.
-In the <I>infile</I> file, each
-data file should be followed by a data format identifier, e.g.:
-<BR> <TT>       </TT>datafile1 11<BR>
-<BR> <TT>       </TT>datafile2 24<BR>
-<BR>
-
-This program uses the <B>MBIO</B> library and will read or write any swath sonar
-format supported by <B>MBIO</B>. A list of the swath sonar data formats
-currently supported by <B>MBIO</B> and their identifier values
-is given in the <B>MBIO</B> manual page. The default input filename is
-"datalist.mb-1".
-<DT><B>-N</B>
-
-<DD>
-Given by itself, this option causes a navigation track plot to be generated.
-Additional optional parameters, including annotation control, are
-described in the COMPLETE DESCRIPTION OF OPTIONS section below.
-<DT><B>-O</B>
-
-<DD>
-<I>root</I>
-<BR>
-
-Sets the root used to construct the filename of the output shellscript
-(<I>root</I>.cmd) and names of files created when the shellscript is
-run.  By default, the
-name of the input data file or list file is used as the <I>root</I>.
-<DT><B>-P</B>
-
-<DD>
-<I>pagesize</I>
-<BR>
-
-This option sets the size of the page the plot will be centered
-on. If the user does not set the plot scale, the plot will be
-sized as large as will fit on the designated page. If the user
-sets the plot scale such that the plot will not fit on the
-designated page, a larger page will be used.
-The supported page sizes include ANSI A, B, C, D, E,
-F, and E1, as well as most metric page sizes. See the
-COMPLETE DESCRIPTION OF OPTIONS section
-below for a complete list of
-the supported page sizes. The default page size is A.
-<DT><B>-S</B>
-
-<DD>
-<I>[color/shade]</I>
-<BR>
-
-This option enables effective histogram equalization of the
-color and/or shading of thedata. The equalization is
-not achieved by changing the data values, but rather by
-constructing the color or shading tables so that
-the boundaries in the tables encompass equal fractions of
-the datapoints. This serves to focus color or shading contrasts
-in value ranges corresponding to the bulk of the data values,
-and is particularly useful for
-enhancing the contrast of sidescan and beam amplitude plots.
-If <B>-S</B> is given alone or with <I>color</I> = 1,
-it enables equalization of the color table used
-for color or gray fill plots,  shaded or unshaded. If the plot
-is to be shaded,  either by synthetic illumination (<B>-G</B><I>2</I>)
-or by overlaying amplitude data (<B>-G</B><I>3</I> option), then
-setting <I>shade</I> = 1 will cause the shading to be equalized.
-Using <B>-S</B><I>0/1</I> will equalize the shading without
-equalizing the color table.
-<DT><B>-T</B>
-
-<DD>
-If <B>-T</B> is given, it causes a coastline to be drawn
-on the map. The default is to draw the coastline and shade
-all dry land a uniform gray. To exercise greater control of
-the coastline plotting, use the
-<B>-MTC</B>, <B>-MTD</B>, <B>-MTG</B>, <B>-MTI</B>,
-<B>-MTN</B>, <B>-MTS</B>, and <B>-MTW</B> options described in the
-COMPLETE DESCRIPTION OF OPTIONS section below.
-<DT><B>-U</B>
-
-<DD>
-<I>orientation</I>
-<BR>
-
-Normally the orientation of the plot (portrait or landscape)
-is selected automatically so as to maximize the plot scale.
-The <B>-U</B> option allows the user to set the plot orientation. If
-<I>orientation</I> = 1, a portrait plot will be produced; if
-<I>orientation</I> = 2, a landscape plot will be produced.
-<DT><B>-V</B>
-
-<DD>
-Causes <B>mbm_plot</B> to operate in "verbose" mode
-so that it outputs
-more information than usual.
-<DT><B>-W</B>
-
-<DD>
-<I>[color_style</I>[<I>/palette</I>[<I>ncolors</I>]] | cptfile]
-<BR>
-
-This option controls the color scheme used for color
-fill plots.
-<P>
-If <I>color_style</I> = 1 [default], then
-the color scheme used will be a continuous grading
-of colors. If <I>color_style</I> = 2, the color scheme
-will be a set of discrete color intervals. The color
-palette used is set using <I>palette</I>. Five palettes
-are available:
-<BR> <TT>       </TT><I>palette</I> = 1:<TT>    </TT>Haxby colors [default]<BR>
-<BR> <TT>       </TT><I>palette</I> = 2:<TT>    </TT>high Intensity colors<BR>
-<BR> <TT>       </TT><I>palette</I> = 3:<TT>    </TT>low Intensity colors<BR>
-<BR> <TT>       </TT><I>palette</I> = 4:<TT>    </TT>grayscale<BR>
-<BR> <TT>       </TT><I>palette</I> = 5:<TT>    </TT>uniform grayscale<BR>
-<BR>
-
-A complete description of the color palettes is given
-in the COMPLETE DESCRIPTION OF OPTIONS section below.
-<P>
-The <I>ncolors</I> parameter sets the number of color
-values used in plotting, whether the colors are
-represented in a continuous color scale or a
-stepped, discrete color scale [default is 11].
-<P>
-If the option argument is the path to an existing <B>GMT</B>
-color palette (CPT) file, then that CPT file and its
-color scheme will be used for the plot
-<P>
-</DL>
-<A NAME="lbAH"> </A>
-<H2>COMPLETE DESCRIPTION OF OPTIONS</H2>
-
-<DL COMPACT>
-<DT><B>-A</B>
-
-<DD>
-<I>magnitude/azimuth</I> or <I>magnitude/median</I>
-<BR>
-
-Sets the parameters which control how <B>mbm_plot</B> generates
-simulated illumination of bathymetry, which can be either
-shaded relief bathymetry or bathymetry draped with amplitude data.
-If <I>mode</I> is set to 2 (shaded relief bathymetry) using the
-<B>-G</B> option, then the value <I>magnitude</I>
-is an effective vertical exageration which modulates the intensity of
-the shading; typical values are in the 1-5 range.  The value <I>azimuth</I>
-is the azimuth from which the bathymetry is illuminated.
-If <I>mode</I> is set to 3 (bathymetry shaded using amplitudes) using the
-<B>-G</B> option, then the value <I>magnitude</I>
-modulates the intensity of the shading; the value <I>median</I> sets the
-amplitude value which serves as the zero or neutral level.
-<DT><B>-B</B>
-
-<DD>
-<I>tickinfo</I>
-<BR>
-
-Sets map boundary tickmark intervals. See the <B>psbasemap</B>
-manual page for details. By default the program chooses
-basemap annotations based on the map boundaries.
-<DT><B>-C</B>
-
-<DD>
-<I>[cont_int/col_int/tic_int/lab_int/tic_len/lab_hgt]</I>
-<BR>
-
-Given by itself, the <B>-C</B> option produces a contour plot
-of the bathymetry data with a contour interval chosen according
-to the data in the file or files. If the <B>-G</B> option is used,
-the default contours will be drawn in black; otherwise, the
-default contours will be drawn in four colors (black, red,
-green, and blue) with color changes, annotations, and tickmarks
-every fourth contour interval.  If any of the optional
-parameters are appended, these values will control the contour interval
-and other contour characteristics.
-Contours will be
-generated at invervals of <I>cont_int</I> meters.  Color changes
-will occur at intervals of <I>col_int</I> meters.  Contours will have
-downhill facing tickmarks <I>tic_len</I> inches long every <I>tic_int</I>
-meters. Contours will have annotations
-<I>lab_hgt</I> inches high every <I>lab_int</I> meters.
-<DT><B>-D</B>
-
-<DD>
-<I>[flipcolor/flipshade]</I>
-<BR>
-
-This option flips the color and shading conventions used by
-<B>mbm_plot</B>.
-Normally, the color or grayscale tables used for color bathymetry
-maps run from
-cool colors (or dark grays) for large depth values
-to hot colors (or light grays) for small depth values.
-In contrast, sidescan and beam amplitude data is normally plotted
-using (light grays (or hot colors) for small amplitudes and
-dark grays (or cool colors) for large amplitudes.
-If <B>-D</B> is given alone or with <I>flipcolor</I> = 1,
-it applies to the color table used
-for color or gray fill plots,  shaded or unshaded. If the plot
-is to be shaded,  either by synthetic illumination (<B>-G</B><I>2</I>)
-or by overlaying amplitude data (<B>-G</B><I>3</I> option), then
-setting <I>flipshade</I> = 1 will cause the shading convention
-to be reversed (e.g. high amplitudes overlaid as light shading).
-Using <B>-D</B><I>0/1</I> will flip the shading convention
-but leave the default color convention.
-<DT><B>-F</B>
-
-<DD>
-<I>format</I>
-<BR>
-
-Sets the data format for the input data.
-If <I>format</I> < 0, then the input file specified
-with the <B>-I</B> option will actually contain a list of input swath sonar
-data files. This program uses the <B>MBIO</B> library
-and will read or write any swath sonar
-format supported by <B>MBIO</B>. A list of the swath sonar data formats
-currently supported by <B>MBIO</B> and their identifier values
-is given in the <B>MBIO</B> manual page. Default: <I>format</I> = -1.
-<DT><B>-G</B>
-
-<DD>
-<I>mode</I>
-<BR>
-
-Turns on color fill swath plot and sets the style of the plot.
-<BR> <TT>       </TT><I>mode</I> = 1:<TT>       </TT>Color fill of bathymetry data.<BR>
-<BR> <TT>       </TT><I>mode</I> = 2:<TT>       </TT>Color shaded relief bathymetry.<BR>
-<BR> <TT>       </TT><I>mode</I> = 3:<TT>       </TT>Bathymetry shaded using amplitude data.<BR>
-<BR> <TT>       </TT><I>mode</I> = 4:<TT>       </TT>Grayscale fill of amplitude data.<BR>
-<BR> <TT>       </TT><I>mode</I> = 5:<TT>       </TT>Grayscale fill of sidescan data.<BR>
-<DT><B>-H</B>
-
-<DD>
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-<DT><B>-I</B>
-
-<DD>
-<I>filename</I>
-<BR>
-
-Sets the input filename. If <I>format</I> > 0 (set with the
-<B>-f</B> option) then the swath sonar data contained in <I>infile</I>
-is read and processed. If <I>format</I> < 0 (the default),
-then <I>infile</I>
-is assumed to be an ascii file containing a list of the input swath sonar
-data files to be processed and their formats.  The program will read
-the data in each one of these files.
-In the <I>infile</I> file, each
-data file should be followed by a data format identifier, e.g.:
-<BR> <TT>       </TT>datafile1 11<BR>
-<BR> <TT>       </TT>datafile2 24<BR>
-<BR>
-
-This program uses the <B>MBIO</B> library and will read or write any swath sonar
-format supported by <B>MBIO</B>. A list of the swath sonar data formats
-currently supported by <B>MBIO</B> and their identifier values
-is given in the <B>MBIO</B> manual page.
-<DT><B>-J</B>
-
-<DD>
-<I>projection</I>[<I>/scale | /width</I>]
-<BR>
-
-Selects the map projection. By default the map projection is
-Mercator and the plot scale is chosen to fit on the selected
-page size (see <B>-P</B> option). The user may specify a
-different projection to be used, in which case the plot scale
-is still automatically chosen to fit the page. The user may
-also specify both the projection and the plot scale. If
-the projection specifying character is upper case, a plot
-width rather than a plot scale is used.
-The scale values are specified in inch/degree or in 1:xxxxx
-ratios. Plot widths are specified in inches. If the user
-specifies a plot scale such that the plot will not fit
-on the default A size page, a appropriately larger page
-size will be chosen.
-<BR>
-
-<P>
-<B>CYLINDRICAL PROJECTIONS:</B>
-<BR>
-
-<P>
-<B>-Jc</B><I>lon0/lat0/scale</I> (Cassini)
-<BR>
-
-<B>-Jm</B><I>scale</I> (Mercator)
-<BR>
-
-<B>-Joa</B><I>lon0/lat0/azimuth/scale</I> (Oblique Mercator - point and azimuth)
-<BR>
-
-<B>-Job</B><I>lon0/lat0/lon1/lat1/scale</I> (Oblique Mercator - two points)
-<BR>
-
-<B>-Joc</B><I>lon0/lat0/lonp/latp/scale</I> (Oblique Mercator - point and pole)
-<BR>
-
-<B>-Jq</B><I>lon0/scale</I> (Equidistant Cylindrical Projection (Plate Carree))
-<BR>
-
-<B>-Jt</B><I>lon0/scale</I> (TM - Transverse Mercator)
-<BR>
-
-<B>-Ju</B><I>zone/scale</I> (UTM - Universal Transverse Mercator)
-<BR>
-
-<B>-Jy</B><I>lon0/lats/scale</I> (Basic Cylindrical Projection)
-<BR>
-
-<P>
-<B>AZIMUTHAL PROJECTIONS:</B>
-<BR>
-
-<P>
-<B>-Ja</B><I>lon0/lat0/scale</I> (Lambert).
-<BR>
-
-<B>-Je</B><I>lon0/lat0/scale</I> (Equidistant).
-<BR>
-
-<B>-Jg</B><I>lon0/lat0/scale</I> (Orthographic).
-<BR>
-
-<B>-Js</B><I>lon0/lat0/scale</I> (General Stereographic)
-<BR>
-
-<P>
-<B>CONIC PROJECTIONS:</B>
-<BR>
-
-<P>
-<B>-Jb</B><I>lon0/lat0/lat1/lat2/scale</I> (Albers)
-<BR>
-
-<B>-Jl</B><I>lon0/lat0/lat1/lat2/scale</I> (Lambert)
-<BR>
-
-<P>
-<B>MISCELLANEOUS PROJECTIONS:</B>
-<BR>
-
-<P>
-<B>-Jh</B><I>lon0/scale</I> (Hammer)
-<BR>
-
-<B>-Ji</B><I>lon0/scale</I> (Sinusoidal)
-<BR>
-
-<B>-Jk</B><I>lon0/scale</I> (Eckert VI)
-<BR>
-
-<B>-Jn</B><I>lon0/scale</I> (Robinson)
-<BR>
-
-<B>-Jr</B><I>lon0/scale</I> (Winkel Tripel)
-<BR>
-
-<B>-Jw</B><I>lon0/scale</I> (Mollweide)
-<BR>
-
-<P>
-<B>NON-GEOGRAPHICAL PROJECTIONS:</B>
-<BR>
-
-<P>
-<B>-Jp</B><I>scale</I> (Linear projection for polar (theta,r) coordinates)
-<BR>
-
-<B>-Jx</B><I>x-scale</I>[<B>l|p</B><I>pow</I>][<I>/y-scale</I>[<B>l|p</B><I>pow</I>]] (Linear, log, and power scaling)
-<BR>
-
-More details can be found in the <B>psbasemap</B> manpages.
-<DT><B>-L</B>
-
-<DD>
-<I>title:scalelabel</I>
-<BR>
-
-Sets the title and the label for the colorscale (if used) of
-the plot. Note that a colon (:) rather than a slash (/) is
-used to separate the labels. Colons cannot be used in the
-labels themselves. If this option is not used, then a default title
-and colorscale label are provided. If the title is supplied
-alone, a default colorscale label will be provided. To force
-no title use <B>-L</B>" "; to force no title or colorscale
-label use <B>-L</B>" : ".
-<DT><B>-M</B>
-
-<DD>
-A series of "miscellaneous" options are provided which are
-given as <B>-M</B> followed by a two character identifier, followed
-by any other parameters associated with that option.
-The <B>-M</B> options may be strung together separated by
-colons, e.g. "-MGQ100:GU", which is equivalent to
-"-MGQ -MGU".
-<DT><B>-MGD</B>
-
-<DD>
-<I>gmtdef/value</I>
-<BR>
-
-Allows the user to set the <B>GMT</B> default values used as
-the plot is constructed. This command may be given repeatedly
-to set as many <B>GMT</B> defaults as required. For example, to
-set the basemap annotation font to Courier, use
-"-MGDANOT_FONT/Courier".
-<DT><B>-MGF</B>
-
-<DD>
-<I>scale_loc</I>
-<BR>
-
-Sets the location of the color scale. The possible values
-of <I>scale_loc</I> are:
-<BR> <TT>       </TT><I>scale_loc</I> = b:<TT>  </TT>bottom of plot<BR>
-<BR> <TT>       </TT><I>scale_loc</I> = t:<TT>  </TT>top of plot<BR>
-<BR> <TT>       </TT><I>scale_loc</I> = l:<TT>  </TT>left of plot<BR>
-<BR> <TT>       </TT><I>scale_loc</I> = r:<TT>  </TT>right of plot<BR>
-<BR>
-
-[Default <I>scale_loc</I> = b]
-<DT><B>-MGL</B>
-
-<DD>
-[<I>f</I>][<I>x</I>]<I>lon0/lat0/slat/length</I>[<I>units</I>][<I>+llabel</I>]
-<BR>
-
-Draws a simple map scale centered on <I>lon0/lat0</I>.
-Use <B>-Lf</B> to get a "fancy" scale [Default is plain].
-Use <B>-Lx</B> to specify the position in inches instead of map units.
-The scale is calculated at latitude <I>slat</I>; if the string "center" is used
-instead of a numerical value for <I>slat</I>, then the macro will set
-the scaling according to the center of the plot bounds.
-The scale length value <I>length</I> is in km 
-by default, but the units can be specified as one of e|f|k|M|n|u, where
-e = meters, f = feet, k = kilometers, M = statue miles, n = nautical miles,
-and u = US survey feet. Append <I>+l</I> to label the scale with the
-relevant units, or append <I>+l"label"</I> to set a different label string.
-<DT><B>-MGQ</B>
-
-<DD>
-<I>dpi</I>
-<BR>
-
-Sets the resolution in dots per inch of the raster image used
-for color fill maps. Larger values of <I>dpi</I> produce larger
-Postscript plot files. [Default is 100].
-<DT><B>-MGT</B>
-
-<DD>
-<I>x/y/size/angle/font/just/text</I>
-<BR>
-
-Causes a text label to plotted on the map.
-<I>size</I> is text size in points, <I>angle</I> is
-measured in degrees counter-clockwise from horizontal,
-<I>fontno</I> sets the font type, <I>justify</I> sets the alignment.
-If <I>fontno</I> starts with a leading hyphen, then
-the remainder of <I>fontno</I> is taken to be a
-textstring with the desired fontname.  See the
-<B>gmtdefaults</B> man page for names and numbers of available fonts
-(or run <B>pstext -L</B>).  The alignment
-number refers to the part of the textstring that will be mapped
-onto the (<I>x,y</I>) point: 1 = Lower Left corner,
-2 = Lower Center, 3 = Lower Right, 5 = Mid Left, 6 = Mid Center,
-7 = Mid Right, 9 = Upper Left, 10 = Upper Center,
-11 = Upper Right. This option may be given as many times as
-needed.
-<DT><B>-MGU</B>
-
-<DD>
-[<I>/dx/dy/</I>][<I>label</I>]
-<BR>
-
-Draw Unix System time stamp on plot.  User may specify where the lower left corner
-of the stamp should fall on the page relative to lower left corner of plot in inch [Default is (-0.75,-0.75)].  Optionally,
-append a label, or <B>c</B> (which will plot the command string.)
-<DT><B>-MMA</B><I>factor/mode/depth</I><DD>
-This option determines how the along-track dimension of the
-beam or pixel footprints is calculated. If <I>mode</I> = 1,
-then the fore-aft beam angle width of the sonar is used so that
-the width increases towards the outer parts of the swath.
-The fore-aft beam angle width (<B>MB-System</B> internally stores
-a value for each format/sonar) is multiplied by the <I>factor</I>
-value; a <I>factor</I> < 1.0 can be useful if the data highly
-oversamples the seafloor and a <I>factor</I> > 1.0 can fill in
-plots of data which undersample the seafloor. If the data
-stream does not include depth values (e.g. one is plotting
-pure sidescan data), then the <I>depth</I> value sets the
-depth value in meters used in the footprint calculations.
-If <I>mode</I> = 2, then the along-track dimension of the beam
-or pixel footprints is just the along-track distance between
-pings multiplied by the <I>factor</I> value.
-If mode = 3, then each data point is
-plotted as a point, and the factor and depth parameters
-are ignored.
-Default: <I>factor</I> = 1.0, <I>mode</I> = 1, <I>depth</I> = 3000.0.
-<DT><B>-MMB</B><I>yr/mo/da/hr/mn/sc</I><DD>
-Sets the starting time for data allowed in the input data; pings
-with times before the starting time will be ignored.
-Default: <I>yr/mo/da/hr/mn/sc</I> = 1962/2/21/10/30/0.
-<DT><B>-MMD</B><I>mode/scale[/min/max]</I><DD>
-Sets scaling of beam amplitude or sidescan pixel values which
-can be applied before plotting. If <I>mode</I> = 1 or 2, then
-a linear scaling of the form:
-<BR> <TT>       </TT>scaled_value = scale * (value - min) / (max - min)<BR>
-<BR>
-
-is applied.  If <I>mode</I> = 3 or 4, then a log10 scaling of
-the form:
-<BR> <TT>       </TT>scaled_value = scale * (20 * log10(value) - min) / (max - min)<BR>
-<BR>
-
-is applied.  If <I>mode</I> = 2 or 4, then the value (or 20*log10(value))
-will be clipped to <I>min</I> if it is smaller than <I>min</I> or <I>max</I>
-if it is greater than <I>max</I>; this clipping happens prior to the
-multiplication by <I>scale</I>. Default: <I>mode</I> = 1, <I>scale</I> = 1.0,
-<I>min</I> = 0.0, <I>max</I> = 1.0.
-<DT><B>-MME</B><I>yr/mo/da/hr/mn/sc</I><DD>
-Sets the ending time for data allowed in the input data; pings
-with times after the ending time will be ignored.
-Default: <I>yr/mo/da/hr/mn/sc</I> = 2062/2/21/10/30/0.
-<DT><B>-MML</B><I>lonflip</I><DD>
-If the <B>-R</B> option is not used to explicitly set the plot bounds, then
-the <I>lonflip</I> value sets the range of the longitude values used for
-calculating the desired bounds.  If  lonflip=-1
-then  the  longitude  values will be in the range from -360 to 0
-degrees. If lonflip=0 then the longitude values will be  in  the
-range  from -180 to 180 degrees. If lonflip=1 then the longitude
-values will be in the range from 0  to  360  degrees.   Default:
-<B>mbm_plot</B> uses the <I>lonflip</I> value set by <B>mbdefaults</B>.
-<DT><B>-MMN</B><I>nplot</I><DD>
-Sets the number of pings to be read in before each contouring
-episode. See the description of the <B>-MMZ</B><I>algorithm</I> option
-for advice on reasonable values
-Default: <I>nplot</I> = 50 unless <B>-MMZ</B><I>1</I> is specified,
-in which case the default is <I>nplot</I> = 5.
-<DT><B>-MMP</B><I>pings </I>
-
-<DD>
-<BR>
-
-Sets the ping averaging of the input swath sonar data. If <I>pings</I> = 1, then
-no ping averaging is performed. If <I>pings</I> > 0, then
-that number of input pings will be averaged to produce one output
-ping.  If <I>pings</I> = 0, then the ping averaging will automatically
-be done so that the along-track ping spacing is equal to the across-track
-beam spacing.
-Default: <I>pings</I> = 1 (no ping averaging).
-<DT><B>-MMS</B><I>speedmin</I><DD>
-Sets the minimum speed in km/hr (5.5 kts ~ 10 km/hr) allowed in
-the input data; pings associated with a smaller ship speed will not be
-processed. Default: <I>speed</I> = 0.
-<DT><B>-MMT</B>
-
-<DD>
-<I>timegap</I>
-<BR>
-
-Sets the maximum time gap in minutes between adjacent pings allowed before
-the data is considered to have a gap. Default: <I>timegap</I> = 1.
-<DT><B>-MMZ</B>
-
-<DD>
-<I>algorithm</I>
-<BR>
-
-Sets the contouring algorithm to be used. If <I>algorithm</I>=0,
-a simple ping to ping contouring approach is used; this algorithm
-is fast but produces poor looking contours when used with data
-where beams from one ping may lie "behind" beams from previous
-pings (this happens for sonars that ping at nonnull pitch
-angles or for the "inside" beams when ships make sharp turns).
-If <I>algorithm</I>=1 then a triangular network is constructed from
-the available soundings and this network is in turn contoured;
-this algorithm is slow but produces good looking contours in
-most cases. It is important to note that the time required for
-"triangle" algorithm increases with the square of the number
-of beams to be contoured; thus it is sensible to keep the number
-of pings contoured at a time small (e.g. use <B>-N</B><I>5</I>).
-The time required for the "ping to ping" algorithm varies linearly
-with the number of pings contoured; thus larger numbers of pings
-may be reasonably contoured at a time (e.g. use <B>-N</B><I>50</I>).
-Default: <I>algorithm</I> = 0 unless <I>format</I> = 41.
-<DT><B>-MNA</B>
-
-<DD>
-<I>[nhgt[/P] | P]</I>
-<BR>
-
-Turns on filename annotation of navigation tracks. If <B>-MNA</B> is given
-without specifying any controlling parameters, then the lettering height
-<I>nhgt</I> is 0.15 and the filenames are plotted parallel to the
-navigation track from the start of the track. The lettering height can be
-specified using either <B>-MNA</B><I>nhgt</I> or <B>-MNA</B><I>nhgt/P</I>.
-If <B>-MNA</B><I>P</I> or <B>-MNA</B><I>nhgt/P</I> is specified,
-the filename will be plotted perpendicular to the navigation track.
-Filename annotation can also be specified using the <B>-N</B> option.
-Defaults: Filename annotation off.
-<DT><B>-MNP</B>
-
-<DD>
-<I>[pingnumber_tick/pingnumber_annot/pingnumber_tick_len]</I>
-<BR>
-
-Turns on ping number (or shot number) annotation of navigation tracks.
-Tick marks are made along the shiptrack at <I>pingnumber_tick</I> intervals; these
-are <I>tlen</I> inches long. Longer tick marks are made along the
-shiptrack at <I>pingnumber_annot</I> intervals; these are 1.5 times <I>tlen</I>
-inches long.
-Defaults: Pingnumber annotation off. If the <B>-MNP</B> option is given without
-specifying the controlling parameters, then <I>pingnumber_tick</I> = 50,
-<I>pingnumber_annot</I> = 100, and <I>pingnumber_tick_len</I> = 0.1.
-<DT><B>-MTC</B>
-
-<DD>
-<I>fill</I>
-<BR>
-
-Coastline plotting option.
-Set the shade (0-255), color (r/g/b), or pattern
-(p|Pdpi/pattern; see <B>-MTG</B>) for lakes  [Default is the
-fill chosen for "wet" areas (-S)].
-<DT><B>-MTD</B>
-
-<DD>
-<I>resolution</I>
-<BR>
-
-Coastline plotting option.
-Selects the resolution of the coastline data set to use ((f)ull,
-(h)igh, (i)ntermediate, (1)ow, and (c)rude).  The
-resolution drops off by 80% between data sets. [Default
-is l].
-<DT><B>-MTG</B>
-
-<DD>
-<I>fill</I>
-<BR>
-
-Coastline plotting option.
-Select painting or clipping of "dry" areas.  Append a
-shade, color, pattern, or c for clipping.  Specify the
-shade (0-255) or color (r/g/b), or <B>-MTG</B><I>pdpi/pattern</I>,
-where pattern gives the number of the built-in pattern
-(1-90) OR the name of a Sun 1-, 8-, or 24-bit raster
-file.  dpi sets the resolution of the image.  See <B>GMT</B>
-Cookbook & Technical Reference Appendix E for
-information on individual patterns.
-<DT><B>-MTI</B>
-
-<DD>
-<I>river[/pen]</I>
-<BR>
-
-Coastline plotting option.
-Draw rivers.  Specify the type of rivers and
-[optionally] append pen attributes  [Default pen:
-width = 1, color = 0/0/0, texture = solid].  Choose
-from the list of river types below.  Repeat option -I
-as often as necessary.
-<BR>     1 = Permanent major rivers
-<BR>     2 = Additional major rivers
-<BR>     3 = Additional rivers
-<BR>     4 = Minor rivers
-<BR>     5 = Intermittent rivers - major
-<BR>     6 = Intermittent rivers - additional
-<BR>     7 = Intermittent rivers - minor
-<BR>     8 = Major canals
-<BR>     9 = Minor canals
-<BR>     10 = Irrigation canals
-<BR>     a = All rivers and canals (1-10)
-<BR>     r = All permanent rivers (1-4)
-<BR>     i = All intermittent rivers (5-7)
-<BR>     c = All canals (8-10)
-<DT><B>-MTN</B>
-
-<DD>
-<I>border[/pen]</I>
-<BR>
-
-Coastline plotting option.
-Draw political boundaries.  Specify the type of
-boundary and [optionally] append pen attributes
-[Default pen:  width = 1, color = 0/0/0, texture =
-solid].  Choose from the list of boundaries below.
-Repeat option <B>-MTN</B> as often as necessary.
-<BR>     1 = National boundaries
-<BR>     2 = State boundaries within the Americas
-<BR>     3 = Marine boundaries
-<BR>     a = All boundaries (1-3)
-<DT><B>-MTS</B>
-
-<DD>
-<I>fill</I>
-<BR>
-
-Coastline plotting option.
-Select painting or clipping of "wet" areas.  Append the
-shade (0-255), color (r/g/b), pattern (see <B>-MTG</B>), or c
-for clipping.
-<DT><B>-MTW</B>
-
-<DD>
-<I>pen</I>
-<BR>
-
-Coastline plotting option.
-Append pen attributes  [Defaults:  width = 1, color = 0/0/0,
-texture = solid].
-<DT><B>-MXG</B>
-
-<DD>
-<I>fill</I>
-<BR>
-
-Select filling of symbols for xy plotting.
-Set the shade (0-255) or color
-(r/g/b) [Default is no fill]. To reset no fill,
-use <I>fill</I> = "N".
-For polygons, you may optionally specify
-<B>-Gp</B><I>icon_size/pattern</I>, where
-<I>pattern</I> gives the number of the
-image pattern (1-32) OR the name of a
-icon-format file.  <I>icon_size</I> sets
-the unit size in inch.
-To invert black and white pixels, use
-<B>-GP</B> instead of <B>-Gp</B>.  See
-<B>GMTs</B> Cookbook & Technical Reference
-Appendix E for information on individual patterns.
-<DT><B>-MXI</B>
-
-<DD>
-<I>xy_file </I>
-<BR>
-
-Specifies a file containing (x,y) pairs to be plotted
-as lines or symbols. The line and symbol characteristics
-are set using the last <B>-MXG</B>, <B>-MXS</B>, and <B>-MXW</B>
-options used. All of the <B>-MX</B> commands can be
-given multiple times, so by stringing series of these
-commands together the user can plot different files
-using different line or symbol characteristics.
-[Default is a solid black line].
-<DT><B>-MXM</B>
-
-<DD>
-<BR>
-
-Toggles expectation for xy data files having multiple
-segments, in which each segment is to be plotted
-separately. Segments are separated by a
-record whose first character is '>'. By default,
-unsegmented files are expected. Users may give this
-command multiple times, allowing some input files to
-be handled as segmented and others not.
-<DT><B>-MXS</B>
-
-<DD>
-<I>symbol/size</I>
-<BR>
-
-Selects symbol to be used for plotting the next xy data
-file. Setting <I>symbol</I> = "N" causes line plotting.
-Choose between:
-<DT><B>-MXSa</B>
-
-<DD>
-st<B>a</B>r.  <I>size</I> is radius of circumscribing circle.
-<DT><B>-MXSb</B>
-
-<DD>
-<B>b</B>ar extending from <I>base</I> to y.  <I>size</I> is bar width.  By default,
-<I>base</I> = 0.  Append /<I>base</I> to change this value.  Append <B>u</B> if <I>size</I>
-is in x-units [Default is inch].
-<DT><B>-MXSc</B>
-
-<DD>
-<B>c</B>ircle.  <I>size</I> is diameter of circle.
-<DT><B>-MXSd</B>
-
-<DD>
-<B>d</B>iamond.  <I>size</I> is side of diamond.
-<DT><B>-MXSe</B>
-
-<DD>
-<B>e</B>llipse.  Direction (in degrees counterclockwise from horizontal), major_axis (in inch), and minor_axis (in inch) must be found in columns 3, 4, and 5.
-<DT><B>-MXSf</B>
-
-<DD>
-<B>f</B>ault.  Give distance gap between ticks and ticklength in inch.  If gap is
-negative, it is interpreted to mean number of ticks instead.  Append <B>l</B> or <B>r</B> to draw tick on
-the left or right side of line [Default is centered].  Upper case <B>L</B> or <B>R</B> draws a triangle
-instead of line segment.
-<DT><B>-MXSh</B>
-
-<DD>
-<B>h</B>exagon.  Give side in inch.
-<DT><B>-MXSi</B>
-
-<DD>
-<B>i</B>nverted triangle.  Give side in inch.
-<DT><B>-MXSl</B>
-
-<DD>
-<B>l</B>etter or text string.  Give size in inch, and append /<I>string</I> after the size.  Note that the size is only approximate; no individual scaling
-is done for different characters.  Remember to escape special characters like *.
-<DT><B>-MXSp</B>
-
-<DD>
-<B>p</B>oint.  No size needs to be specified (1 pixel is used).
-<DT><B>-MXSs</B>
-
-<DD>
-<B>s</B>quare.  Give side in inch.
-<DT><B>-MXSt</B>
-
-<DD>
-<B>t</B>riangle.  Give side in inch.
-<DT><B>-MXSv</B>
-
-<DD>
-<B>v</B>ector.  Direction (in degrees counterclockwise from horizontal) and length (in inch) must be found in columns 3 and 4.  <I>size</I>,
-if present, will be interpreted as arrowwidth/headlength/headwidth (in inch) [Default is 0.03/0.12/0.1 inch].
-By default arrow attributes remains invariant to the length
-of the arrow.  To have the size of the vector scale down with decreasing size,
-append nnorm, where vectors shorter than <I>norm</I> will have their
-attributes scaled by length/<I>norm</I>.
-<DT><B>-MXSV</B>
-
-<DD>
-Same as <B>-MXSv</B>, except azimuth (in degrees east of north) should be given instead of direction.  The azimuth will
-be mapped into an angle based on the chosen map projection (<B>-MXSv</B> leaves the directions
-unchanged.)
-<DT><B>-MXSx</B>
-
-<DD>
-cross.  Give length in inch.
-<DT><B>-MXW</B>
-
-<DD>
-<I>pen</I>
-<BR>
-
-Set pen attributes for xy plotting. See chapter 4.12 in the
-GMT Technical reference for a discussion of GMT pen values.
-[Defaults: width = 1, color = 0/0/0,
-texture = solid].
-<DT><B>-N</B>
-
-<DD>
-<I>[ttick/tannot/dannot/tlen[/nhgt/nperp]] | F | FP]</I>
-<BR>
-
-This option causes a navigation track plot to be generated, and
-can also set the start of each swath file to be annotated with the
-filename. If the <B>-N</B> option is given alone, then the
-navigation track will be plotted without any annotation,  The optional
-parameters allow users to control the details of the navigation
-track annotation. Time marks are made with "X" marks along the
-shiptrack; annotated time marks show the time in HH:MM format
-next to the time mark and annotated date marks show the time
-and julian day in HH:MM/DDD format.  The "X" marks are
-<I>tlen</I> inches high for normal time marks and
-1.5 times <I>tlen</I> inches high for annotated time or date
-marks.  The interval of time ticks, annotated time ticks, and
-annotated date ticks are given in hours by <I>ttick</I>,
-<I>tannot</I>, and <I>dannot</I>, respectively.
-If the <I>nhgt</I> parameter is not given when the other parameters
-are specified, then no filename annotation will be done. If given,
-<I>nhgt</I> sets the height in inches of the filename annotation
-and turns that annotation on. If given as 1, <I>nperp</I> causes
-the filename annotation to be perpendicular to the shiptrack rather
-than parallel (the default). If the <B>-N</B><I>F</I> is given, then
-a navigation track will be generated using the default parameters
-and also with filename annotation along the shiptrack. If the
-<B>-N</B><I>FP</I> is given, then a navigation track will be generated
-with the default parameters and also with filename annotation
-perpendicular to the shiptrack.
-Defaults if annotation is enabled: <I>ttick</I> = 0.25;
-<I>tannot</I> = 1.0; <I>dannot</I> = 4.0;
-<I>tlen</I> = 0.1; <I>nhgt</I> = 0.1; <I>nperp</I> = 0.
-<DT><B>-O</B>
-
-<DD>
-<I>root</I>
-<BR>
-
-Sets the root used to construct the filename of the output shellscript
-(<I>root</I>.cmd) and names of files created when the shellscript is
-run.  By default, the
-name of the input data file or list file is used as the <I>root</I>.
-<DT><B>-P</B>
-
-<DD>
-<I>pagesize</I>
-<BR>
-
-This option sets the size of the page the plot will be centered
-on. If the user does not set the plot scale, the plot will be
-sized as large as will fit on the designated page. If the user
-sets the plot scale such that the plot will not fit on the
-designated page, a larger page will be used.
-The supported page sizes are:
-<P>
-<BR>          American ANSI sizes:
-<BR>          A     8.5 x 11.0 in.    ( 215.9 x  279.4 mm)
-<BR>          B    11.0 x 17.0 in.    ( 279.4 x  431.8 mm)
-<BR>          C    17.0 x 22.0 in.    ( 431.8 x  558.8 mm)
-<BR>          D    22.0 x 34.0 in.    ( 558.8 x  863.6 mm)
-<BR>          E    34.0 x 44.0 in.    ( 863.6 x 1117.6 mm)
-<BR>          F    28.0 x 40.0 in.    ( 711.2 x 1016.0 mm)
-<BR>          E1   44.0 x 68.0 in.    (1117.6 x 1727.2 mm)
-<P>
-<BR>          Metric ISO A sizes:
-<BR>          A0   841.0 x 1189.0 mm  (33.11 x 46.81 in.)
-<BR>          A1   594.0 x  841.0 mm  (23.39 x 33.11 in.)
-<BR>          A2   420.0 x  594.0 mm  (16.54 x 23.39 in.)
-<BR>          A3   297.0 x  420.0 mm  (11.69 x 16.54 in.)
-<BR>          A4   210.0 x  297.0 mm  ( 8.27 x 11.69 in.)
-<BR>          A5   148.0 x  210.0 mm  ( 5.83 x  8.27 in.)
-<BR>          A6   105.0 x  148.0 mm  ( 4.13 x  5.83 in.)
-<BR>          A7    74.0 x  105.0 mm  ( 2.91 x  4.13 in.)
-<BR>          A8    52.0 x   74.0 mm  ( 2.05 x  2.91 in.)
-<BR>          A9    37.0 x   52.0 mm  ( 1.46 x  2.05 in.)
-<BR>          A10   26.0 x   37.0 mm  ( 1.02 x  1.46 in.)
-<P>
-<BR>          Metric ISO B sizes:
-<BR>          B0   1000.0x 1414.0 mm  (39.37 x 55.67 in.)
-<BR>          B1   707.0 x 1000.0 mm  (27.83 x 39.37 in.)
-<BR>          B2   500.0 x  707.0 mm  (19.68 x 27.83 in.)
-<BR>          B3   353.0 x  500.0 mm  (13.90 x 19.68 in.)
-<BR>          B4   250.0 x  353.0 mm  ( 9.84 x 13.90 in.)
-<BR>          B5   176.0 x  250.0 mm  ( 6.93 x  9.84 in.)
-<BR>          B6   125.0 x  176.0 mm  ( 4.92 x  6.93 in.)
-<BR>          B7    88.0 x  125.0 mm  ( 3.46 x  4.92 in.)
-<BR>          B8    62.0 x   88.0 mm  ( 2.44 x  3.46 in.)
-<BR>          B9    44.0 x   62.0 mm  ( 1.73 x  2.44 in.)
-<BR>          B10   31.0 x   44.0 mm  ( 1.22 x  1.73 in.)
-<P>
-<BR>          Metric ISO C sizes:
-<BR>          C0   914.4 x 1300.5 mm  (36.00 x 51.20 in.)
-<BR>          C1   650.2 x  914.4 mm  (25.60 x 36.00 in.)
-<BR>          C2   457.2 x  650.2 mm  (18.00 x 25.60 in.)
-<BR>          C3   325.1 x  457.2 mm  (12.80 x 18.00 in.)
-<BR>          C4   228.6 x  325.1 mm  ( 9.00 x 12.80 in.)
-<BR>          C5   162.6 x  228.6 mm  ( 6.40 x  9.00 in.)
-<BR>          C6   114.3 x  162.6 mm  ( 4.50 x  6.40 in.)
-<BR>          C7    81.3 x  114.3 mm  ( 3.20 x  4.50 in.)
-<P>
-<TT>        </TT>  MB-System large format sizes:<BR>
-<BR>          m1  1371.6 x 1828.8 mm  (54.00 x 72.00 in.)
-<BR>          m2  1371.6 x 2133.6 mm  (54.00 x 84.00 in.)
-<BR>          m3  1371.6 x 2438.4 mm  (54.00 x 96.00 in.)
-<BR>          m4  1524.0 x 1828.8 mm  (60.00 x 72.00 in.)
-<BR>          m5  1524.0 x 2133.6 mm  (60.00 x 84.00 in.)
-<BR>          m6  1524.0 x 2438.4 mm  (60.00 x 96.00 in.)
-<P>
-The default page size is A.
-<DT><B>-Q</B>
-
-<DD>
-Normally, the output plot generation shellscript
-includes lines which execute
-a program to display the Postscript image on the screen.
-This option causes those lines to be commented out so
-that executing the shellscript produces a Postscript plot
-but does not attempt to display it on the screen.
-Alternatively, invoking the plot generation shellscript with
-a <B>-N</B> command line argument also suppresses the screen
-display of the plot. The program
-to be used to display the Postscript is set
-using <B>mbdefaults</B>;
-the default value can be overridden by setting the environment
-variable $MB_PS_VIEWER.
-<DT><B>-R</B>
-
-<DD>
-<I>west/east/south/north</I>
-<BR>
-
-Sets the longitude and latitude bounds within which swath sonar
-data will be read. Normally the bounds are automatically chosen
-to include all of the input data.
-<DT><B>-S</B>
-
-<DD>
-<I>[color/shade]</I>
-<BR>
-
-This option enables effective histogram equalization of the
-color and/or shading of thedata. The equalization is
-not achieved by changing the data values, but rather by
-constructing the color or shading tables so that
-the boundaries in the tables encompass equal fractions of
-the datapoints. This serves to focus color or shading contrasts
-in value ranges corresponding to the bulk of the data values,
-and is particularly useful for
-enhancing the contrast of sidescan and beam amplitude plots.
-If <B>-S</B> is given alone or with <I>color</I> = 1,
-it enables equalization of the color table used
-for color or gray fill plots,  shaded or unshaded. If the plot
-is to be shaded,  either by synthetic illumination (<B>-G</B><I>2</I>)
-or by overlaying amplitude data (<B>-G</B><I>3</I> option), then
-setting <I>shade</I> = 1 will cause the shading to be equalized.
-Using <B>-S</B><I>0/1</I> will equalize the shading without
-equalizing the color table.
-<DT><B>-T</B>
-
-<DD>
-If <B>-T</B> is given, it causes a coastline to be drawn
-on the map. The default is to draw the coastline and shade
-all dry land a uniform gray. To exercise greater control of
-the coastline plotting, use the
-<B>-MTC</B>, <B>-MTD</B>, <B>-MTG</B>, <B>-MTI</B>,
-<B>-MTN</B>, <B>-MTS</B>, and <B>-MTW</B> options described in the
-<DT><B>-U</B>
-
-<DD>
-<I>orientation</I>
-<BR>
-
-Normally the orientation of the plot (portrait or landscape)
-is selected automatically so as to maximize the plot scale.
-The <B>-U</B> option allows the user to set the plot orientation. If
-<I>orientation</I> = 1, a portrait plot will be produced; if
-<I>orientation</I> = 2, a landscape plot will be produced.
-<DT><B>-V</B>
-
-<DD>
-Causes <B>mbm_plot</B> to operate in "verbose" mode so that it
-outputs more information than usual.
-<DT><B>-W</B>
-
-<DD>
-<I>[color_style</I>[<I>/palette</I>[<I>ncolors</I>]] | cptfile]
-<BR>
-
-This option controls the color scheme used for color
-fill plots.
-<P>
-If <I>color_style</I> = 1 [default], then
-the color scheme used will be a continuous grading
-of colors. If <I>color_style</I> = 2, the color scheme
-will be a set of discrete color intervals. The color
-palette used is set using <I>palette</I>. Seven palettes
-are available:
-<BR> <TT>       </TT><I>palette</I> = 1:<TT>    </TT>Haxby colors [default]<BR>
-<BR> <TT>       </TT><I>palette</I> = 2:<TT>    </TT>high Intensity colors<BR>
-<BR> <TT>       </TT><I>palette</I> = 3:<TT>    </TT>low Intensity colors<BR>
-<BR> <TT>       </TT><I>palette</I> = 4:<TT>    </TT>grayscale<BR>
-<BR> <TT>       </TT><I>palette</I> = 5:<TT>    </TT>uniform grayscale<BR>
-<BR> <TT>       </TT><I>palette</I> = 6:<TT>    </TT>uniform black<BR>
-<BR> <TT>       </TT><I>palette</I> = 7:<TT>    </TT>uniform white<BR>
-<P>
-The RGB definitions of the color palettes are:
-<P>
-color palette 1 - Haxby Color Table
-<BR>  red:   255 255 255 255 240 205 138 106  50  40  37
-<BR>  green: 255 186 161 189 236 255 236 235 190 127  57
-<BR>  blue:  255 133  68  87 121 162 174 255 255 251 175
-<P>
-color palette 2 - High Intensity Colors
-<BR>  red:   255 255 255 255 128   0   0   0   0 128 255
-<BR>  green:   0  64 128 255 255 255 255 128   0   0   0
-<BR>  blue:    0   0   0   0   0   0 255 255 255 255 255
-<P>
-color palette 3 - Low Intensity Colors
-<BR>  red:   200 194 179 141  90   0   0   0   0  90 141
-<BR>  green:   0  49  90 141 179 200 141  90   0   0   0
-<BR>  blue:    0   0   0   0   0   0 141 179 200 179 141
-<P>
-color palette 4 - Grayscale
-<BR>  red:   255 230 204 179 153 128 102  77  51  26   0
-<BR>  green: 255 230 204 179 153 128 102  77  51  26   0
-<BR>  blue:  255 230 204 179 153 128 102  77  51  26   0
-<P>
-color palette 5 - Uniform Grayscale
-<BR>  red:   128 128 128 128 128 128 128 128 128 128 128
-<BR>  green: 128 128 128 128 128 128 128 128 128 128 128
-<BR>  blue:  128 128 128 128 128 128 128 128 128 128 128
-<P>
-color palette 6 - Uniform Black
-<BR>  red:     0   0   0   0   0   0   0   0   0   0   0
-<BR>  green:   0   0   0   0   0   0   0   0   0   0   0
-<BR>  blue:    0   0   0   0   0   0   0   0   0   0   0
-<P>
-color palette 7 - Uniform White
-<BR>  red:   255 255 255 255 255 255 255 255 255 255 255
-<BR>  green: 255 255 255 255 255 255 255 255 255 255 255
-<BR>  blue:  255 255 255 255 255 255 255 255 255 255 255
-<P>
-The Haxby colors have been adapted from a palette
-developed by Dr. William Haxby of the Lamont-Doherty
-Earth Observatory; this palette is pleasing to the
-eye and well suited for shading. The high intensity
-colors describe linear paths through RGB space from
-red to blue to green to purple; because the colors are high
-intensity they are not well suited to shading.
-The low intensity colors are similar to the high
-intensity, but muted and thus well suited to shading.
-The grayscale palette runs linearly from white to
-black and is commonly used for plots of sidescan and amplitude
-data. The uniform grayscale is useful for non-color
-shaded relief plots.
-<P>
-The <I>ncolors</I> parameter sets the number of color
-values used in plotting, whether the colors are
-represented in a continuous color scale or a
-stepped, discrete color scale [default is 11].
-<P>
-If the option argument is the path to an existing <B>GMT</B>
-color palette (CPT) file, then that CPT file and its
-color scheme will be used for the plot
-<DT><B>-X</B>
-
-<DD>
-Normally, <B>mbm_plot</B> creates an executable shellscript and
-then exits.  This option will cause the shellscript to be executed
-in the background before <B>mbm_plot</B> exits.
-<DT><B>-Y</B>
-
-<DD>
-Normally, <B>mbm_plot</B> generates nicely rounded numbers
-for the boundaries of the color palette. Often, the resulting
-color bounds extend well outside the range of the gridded data.
-This option causes
-the color boundaries to be uniformly distributed between the
-minimum and maximum values of the grid.
-<DT><B>-Z</B>
-
-<DD>
-<I>min/max</I>
-<BR>
-
-This option overrides the minimum and maximum values of
-bathymetry data, affecting the color palette and the
-contour interval if those parameters are not specified
-by the user.
-<P>
-</DL>
-<A NAME="lbAI"> </A>
-<H2>EXAMPLES</H2>
-
-Suppose we have obtained a swath sonar data file called
-sb2112_example.mb41 collected using a SeaBeam 2112 sonar.
-This file contains bathymetry, beam amplitude, and
-sidescan data. In order to obtain initial views of the
-data in the file, we use <B>mbm_plot</B> to generate
-shellscripts which in turn generate plots when executed.
-The following five commands generate plotting shellscripts
-for color fill bathymetry overlaid with contours, color shaded
-relief bathymetry, color fill bathymetry overlaid with
-amplitudes, grayscale amplitudes, and grayscale sidescan,
-respectively:
-<P>
-<BR> <TT>       </TT>mbm_plot -F41 -I sb2112_example.mb41 -G1 -C    \<BR>
-<BR> <TT>       </TT><TT>        </TT>-N -V -Obathcont<BR>
-<BR> <TT>       </TT>mbm_plot -F41 -I sb2112_example.mb41 -G2       \<BR>
-<BR> <TT>       </TT><TT>        </TT>-N -V -Obathshade<BR>
-<BR> <TT>       </TT>mbm_plot -F41 -I sb2112_example.mb41 -G3 -S0/1 \<BR>
-<BR> <TT>       </TT><TT>        </TT>-N -V -Obathamp<BR>
-<BR> <TT>       </TT>mbm_plot -F41 -I sb2112_example.mb41 -G4 -S    \<BR>
-<BR> <TT>       </TT><TT>        </TT>-N -V -Oamp<BR>
-<BR> <TT>       </TT>mbm_plot -F41 -I sb2112_example.mb41 -G5 -S    \<BR>
-<BR> <TT>       </TT><TT>        </TT>-N -V -Oss<BR>
-<P>
-When the following shellscripts are executed, each will
-generate a postscript plot file and then display the plot
-on the screen:
-<P>
-<BR> <TT>       </TT>bathcont.cmd<BR>
-<BR> <TT>       </TT>bathshade.cmd<BR>
-<BR> <TT>       </TT>bathamp.cmd<BR>
-<BR> <TT>       </TT>amp.cmd<BR>
-<BR> <TT>       </TT>ss.cmd<BR>
-<P>
-Note that we use the <B>-S</B> option to apply histogram
-equalization to the amplitude and sidescan data, but not
-the bathymetry data. Also note that by specifying <B>-N</B>
-we obtain a track plot of the ship's navigation overlaid
-on the color or grayscale file plots.
-<P>
-Now suppose we have a set of SeaBeam 2112 data files
-comprising a short survey and that we want a plot
-of all the data together.  We create an ASCII text file which has
-a list of the filenames, each followed by the appropriate <B>MBIO</B>
-format id number, e.g.:
-<P>
-<BR> <TT>       </TT>sb2112_example_1.mb41 41<BR>
-<BR> <TT>       </TT>sb2112_example_2.mb41 41<BR>
-<BR> <TT>       </TT>sb2112_example_3.mb41 41<BR>
-<P>
-If the name of the data file list is "datalist", then
-using "<B>-F</B><I>-1</I> <B>-I</B><I>datalist</I>" will
-cause the macro to operate on all of the files
-together.  We desire a plot including color fill bathymetry
-overlaid with 25 meter contours and the ship's navigation.
-For this plot, we want a very bright colortable and we would like
-the colors to be discretely stepped rather than continuous;
-thus we use <B>-W</B><I>2/2</I>. We also choose to use the
-<B>-X</B> option, which causes <B>mbm_plot</B> to execute
-the shellscript it creates in the background before
-exiting. The <B>mbm_plot</B> command is:
-<P>
-<BR> <TT>       </TT>mbm_plot -F-1 -Idatalist -G1 -C25 -N \<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT>-X -V -Obathtest<BR>
-<P>
-As an example, the contents of the plotting shellscript
-"bathtest.cmd" are:
-<P>
-<BR> #
-<BR> # Shellscript to create Postscript plot of swath sonar data
-<BR> # Created by macro mbm_plot
-<BR> #
-<BR> # This shellscript created by following command line:
-<BR> # mbm_plot -F-1 -Idatalist -G1 -C25 -N -V -Obathtest
-<BR> #
-<BR> # Save existing GMT defaults
-<BR> echo Saving GMT defaults...
-<BR> gmtdefaults -L > gmtdefaults$$
-<BR> #
-<BR> # Set new GMT defaults
-<BR> echo Setting new GMT defaults...
-<BR> gmtset ANOT_FONT Helvetica
-<BR> gmtset LABEL_FONT Helvetica
-<BR> gmtset HEADER_FONT Helvetica
-<BR> gmtset ANOT_FONT_SIZE 8
-<BR> gmtset LABEL_FONT_SIZE 8
-<BR> gmtset HEADER_FONT_SIZE 10
-<BR> gmtset FRAME_WIDTH 0.074999999999999997
-<BR> gmtset TICK_LENGTH 0.074999999999999997
-<BR> gmtset PAGE_ORIENTATION LANDSCAPE
-<BR> gmtset COLOR_BACKGROUND 0/0/0
-<BR> gmtset COLOR_FOREGROUND 255/255/255
-<BR> gmtset COLOR_NAN 255/255/255
-<BR> #
-<BR> # Make color palette table file
-<BR> echo Making color palette table file...
-<BR> echo   2975 255 255 255   3150 255 186 133 > bathtest.cpt
-<BR> echo   3150 255 186 133   3325 255 161  68 >> bathtest.cpt
-<BR> echo   3325 255 161  68   3500 255 189  87 >> bathtest.cpt
-<BR> echo   3500 255 189  87   3675 240 236 121 >> bathtest.cpt
-<BR> echo   3675 240 236 121   3850 205 255 162 >> bathtest.cpt
-<BR> echo   3850 205 255 162   4025 138 236 174 >> bathtest.cpt
-<BR> echo   4025 138 236 174   4200 106 235 255 >> bathtest.cpt
-<BR> echo   4200 106 235 255   4375  50 190 255 >> bathtest.cpt
-<BR> echo   4375  50 190 255   4550  40 127 251 >> bathtest.cpt
-<BR> echo   4550  40 127 251   4725  37  57 175 >> bathtest.cpt
-<BR> #
-<BR> # Run mbswath
-<BR> echo Running mbswath...
-<BR> mbswath -f-1 -Idatalist \
-<BR> <TT>       </TT>-Jm22.198543775528325 \<BR>
-<BR> <TT>       </TT>-R114.210795/114.430905/-31.91322/-31.62458 \<BR>
-<BR> <TT>       </TT>-Cbathtest.cpt \<BR>
-<BR> <TT>       </TT>-p1 -A1 -Z1 \<BR>
-<BR> <TT>       </TT>-p1 \<BR>
-<BR> <TT>       </TT>-P -X1.8069392647842304 -Y2 -K -V > bathtest.ps<BR>
-<BR> #
-<BR> # Run mbcontour
-<BR> echo Running mbcontour...
-<BR> mbcontour -f-1 -Idatalist \
-<BR> <TT>       </TT>-Jm22.198543775528325 \<BR>
-<BR> <TT>       </TT>-R114.210795/114.430905/-31.91322/-31.62458 \<BR>
-<BR> <TT>       </TT>-A50/100000/100000/100000/0.01/0.1 \<BR>
-<BR> <TT>       </TT>-D0.25/1/4/0.15 \<BR>
-<BR>  <TT>      </TT>-p1 \<BR>
-<BR> <TT>       </TT>-P -K -O -V >> bathtest.ps<BR>
-<BR> #
-<BR> # Make color scale
-<BR> echo Running psscale...
-<BR> psscale -Cbathtest.cpt \
-<BR> <TT>       </TT>-D2.4431/-0.5000/4.8861/0.1500h \<BR>
-<BR> <TT>       </TT>-B":.Depth (meters):" \<BR>
-<BR> <TT>       </TT>-P -K -O -V >> bathtest.ps<BR>
-<BR> #
-<BR> # Make basemap
-<BR> echo Running psbasemap...
-<BR> psbasemap -Jm22.198543775528325 \
-<BR> <TT>       </TT>-R114.210795/114.430905/-31.91322/-31.62458 \<BR>
-<BR> <TT>       </TT>-B5m/5m:."Data List File datalist": \<BR>
-<BR> <TT>       </TT>-P -O -V >> bathtest.ps<BR>
-<BR> #
-<BR> # Delete surplus files
-<BR> echo Deleting surplus files...
-<BR> rm -f bathtest.cpt
-<BR> #
-<BR> # Reset GMT default fonts
-<BR> echo Resetting GMT fonts...
-<BR> mv gmtdefaults$$ .gmtdefaults
-<BR> #
-<BR> # Run xpsview
-<BR> echo Running xpsview in background...
-<BR> xpsview -ps a -maxp 4m bathtest.ps &
-<BR> #
-<BR> # All done!
-<BR> echo All done!
-<P>
-<A NAME="lbAJ"> </A>
-<H2>SEE ALSO</H2>
-
-<B><A HREF="mbsystem.html">mbsystem</A></B>(1), <B><A HREF="mbcontour.html">mbcontour</A></B>(1),
-<B><A HREF="mbswath.html">mbswath</A></B>(1), <B><A HREF="mbdefaults.html">mbdefaults</A></B>(1),
-<B><A HREF="mbm_grdplot.html">mbm_grdplot</A></B>(1), <B><A HREF="mbm_grd3dplot.html">mbm_grd3dplot</A></B>(1), <B><A HREF="mbfilter.html">mbfilter</A></B>(1)
-<P>
-<A NAME="lbAK"> </A>
-<H2>BUGS</H2>
-
-By making this macro more useful, we have also made it
-more complex.
-<P>
-
-<HR>
-<A NAME="index"> </A><H2>Index</H2>
-<DL>
-<DT><A HREF="#lbAB">NAME</A><DD>
-<DT><A HREF="#lbAC">VERSION</A><DD>
-<DT><A HREF="#lbAD">SYNOPSIS</A><DD>
-<DT><A HREF="#lbAE">DESCRIPTION</A><DD>
-<DT><A HREF="#lbAF">AUTHORSHIP</A><DD>
-<DT><A HREF="#lbAG">SIMPLE DESCRIPTION OF BASIC OPTIONS</A><DD>
-<DT><A HREF="#lbAH">COMPLETE DESCRIPTION OF OPTIONS</A><DD>
-<DT><A HREF="#lbAI">EXAMPLES</A><DD>
-<DT><A HREF="#lbAJ">SEE ALSO</A><DD>
-<DT><A HREF="#lbAK">BUGS</A><DD>
-</DL>
-<HR>
-</PRE>
-
-<CENTER><P><BR>
-Last Updated: 9 January 2015</P></CENTER>
-
-<HR>
-<P><A HREF="mbsystem_man_list.html">Return to list of MB-System manual pages...</A></P>
-<P><A HREF="mbsystem_home.html"><IMG SRC="mbsystem_logo_small.gif" BORDER=0 HEIGHT=55 WIDTH=158 ALIGN=BOTTOM></A><A HREF="mbsystem_home.html">Back
-to MB-System Home Page...</A></P>
-
-</BODY>
-</HTML>
diff --git a/src/html/mbm_route2mission.html b/src/html/mbm_route2mission.html
deleted file mode 100644
index 1035ff3..0000000
--- a/src/html/mbm_route2mission.html
+++ /dev/null
@@ -1,527 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<HTML VERSION="2.0">
-<HEAD>
-   <TITLE>MB-System Unix Manual Page: mbm_route2mission</TITLE>
-<!-- WEBMAGIC VERSION NUMBER="2.0.2" -->
-<!-- WEBMAGIC TRANSLATION NAME="ServerRoot" SRC="/var/www/htdocs/" DST="/" -->
-<!-- WEBMAGIC TRANSLATION NAME="ProjectRoot" SRC="./" DST="" -->
-</HEAD>
-<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#336699" VLINK="#997040" ALINK="#CC9900">
-<BODY>
-<CENTER><H3><U>MB-System Unix Manual Page</U></H3></CENTER>
-<PRE>
-<H1>mbm_route2mission</H1>
-Section:  MB-System 5.0  (1)<BR>Updated:  22 February 2015 <BR><A HREF="#index">Index</A>
-<HR>
-
-<A NAME="lbAB"> </A>
-<H2>NAME</H2>
-
-<B>mbm_route2mission</B> - Macro to convert an <B>mbgrdviz</B> route file into an
-MBARI AUV mission script.
-<P>
-<A NAME="lbAC"> </A>
-<H2>VERSION</H2>
-
-Version 5.0
-<P>
-<A NAME="lbAD"> </A>
-<H2>SYNOPSIS</H2>
-
-<B>mbm_route2mission</B> <B>-I</B><I>routefile</I>
-[<B>-A</B><I>altmin/altabort[/altdesired[/altdesired2[/altdesired3]]]</I>
-<B>-B</B><I>behavior</I> <B>-C</B><I>missiontime</I>
-<B>-D</B><I>depthconstant[/depthconstant2]</I>
-<B>-F</B><I>forwarddistance</I> <B>-G</B><I>gpsmode</I>
-<B>-J</B><I>depthprofilefile</I> <B>-L</B><I>approachdepth</I>
-<B>-M</B><I>[sensorlist]</I> <B>-N</B>[<I>spiraldescentaltitude</I>] <B>-O</B><I>missionfile</I>
-<B>-P</B><I>[startlon/startlat | startdistance]</I>
-<B>-R</B><I>transmitpower/receivegain[/rangeminfraction[/pulsewidth]]</I>
-<B>-S</B><I>speed</I> <B>-T</B><I>starttime</I> <B>-U</B><I>maxclimbrate</I>
-<B>-W</B><I>waypointspacing</I> <B>-V</B> <B>-H</B>]
-<P>
-<A NAME="lbAE"> </A>
-<H2>DESCRIPTION</H2>
-
-<B>mbm_route2mission</B> - Macro to convert an <B>mbgrdviz</B> route file into an
-MBARI AUV mission script.
-<P>
-MBARI Autonomous Underwater Vehicles, or AUVs, are controlled using a layered
-behavior system that is specified using a mission script. This macro generates
-an MBARI AUV mission script from an <B>MB-System</B> route file such as those
-generated interactively using <B>MBgrdviz</B>. The output MBARI AUV mission script
-is named using a ".cfg" suffix. A Winfrog waypoint file (ending in ".pts") is also
-output which mirrors the waypoints in the input route file.
-<P>
-The output AUV mission script includes safety behaviors that operate throughout
-a mission (e.g. missionTimer sets a mission timeout duration, and depthEnvelope
-sets depth and altitude limits). The script also includes the sequential behaviors
-required to take a vehicle from the start of a mission at the surface, obtaining
-the initial position from GPS, descent to depth, flying to the starting waypoint,
-running the desired survey lines with a desired depth or altitude profile,
-ascent to the surface, and reacquiring positioning from GPS. For seafloor mapping
-surveys, sonar settings and data logging are also controlled through the
-mission script.
-<P>
-The input route file specifies a survey mission as a set of sequential waypoints,
-and also includes the depth profile between those waypoints. Waypoints may be
-ordinary, the start of a survey line, or the end of a survey line (the start and
-end line waypoints are generated using the survey route planning feature of
-<B>MBgrdviz</B>). The spacing  of the depth profile points between the waypoints
-derives from the bathymetric grid used to generate the route.
-<P>
-The output mission specifies a larger number of waypoints than the input route file.
-The mission waypoints are generated every <I>waypointspacing</I> meters (specified
-with the <B>-W</B> option), and the AUV is commanded to fly at particular depths (or
-depth profiles) between each waypoint. By default, the AUV will be flown using a control
-behavior called WaypointDepth in which the commanded vehicle depth follows a linearly
-interpolated profile between the depth at the starting waypoint and the depth
-at the ending waypoint. The simpler alternative waypoint behavior specifies a
-single vehicle depth while flying to the next mission; as it begins each segment
-the vehicle will ascend or descend sharply to the desired depth and then fly
-level until the next waypoint is reached.
-<P>
-The <B>-A</B> option allows the user to set the basic vehicle
-altitude control. The vehicle's vertical position will be simulatneously controlled
-in terms of both altitude above the bottom and depth below the sea surface. The commanded
-depth between each waypoint is calculated by <B>mbm_route2mission</B> (using the bathymetry
-profiles in the input route file) to produce a vehicle altitude that is <I>altdesired</I>
-meters above the shallowest depth looking <I>forwarddistance</I> meters ahead. The
-forward looking feature allows the vehicle to be commanded to ascend prior to reaching
-large scarps. As the mission commences, the AUV attempts to fly at the commanded depth
-unless that would result in an altitude less than <I>altmin</I> meters. In that
-circumstance, the vehicle flies in an altitude-following mode. Thus, for consistent
-bottom-following, a common approach is to set <I>altmin</I> to the desired
-altitude and to set <I>altdesired</I> to a value slightly smaller than <I>altmin</I>.
-This strategy allows the look-ahead feature to bring the vehicle safely over steep rises
-while otherwise maintaining a constant altitude.
-<P>
-The <B>-G</B> option allows the user to specify that the vehicle ascend to the surface
-and reset positioning  with GPS at the beginning and/or end of survey lines.
-<P>
-The <B>-N</B> option allows the user to specify that the vehicle first move to the
-initial survey waypoint, and then follow a spiral descent to the desired survey depth.
-The <B>-L</B><I>approachdepth</I> option sets the vehicle depth as it approaches the
-first waypoint before the spiral descent. The optional <I>spiraldescentaltitude</I>
-parameter sets the altitude at which the spiral descent is terminated; if <B>-N</B>
-is given alone then <I>altdesired</I> from the <B>-A</B> option is used.
-These options are used for deepwater missions
-in which the vehicle navigation is updated by acoustic modem during the free
-inertial descents.
-<P>
-The mission script must also allow sufficient time for the vehicle to transit from its
-starting point to the first waypoint in the survey mission. The <B>-T</B> and <B>-P</B>
-options allow the user specify the AUV starting position, the distance to the first
-waypoint, or the time required to reach the first waypoint.
-<P>
-The MBARI Mapping AUV is equipped with a 200 kHz multibeam sonar, a 2-16 kHz chirp subbottom
-profiler, a 110 kHz chirp sidescan, and a 410 kHz chirp sidescan. The <B>-M</B> option is
-used to enable these mapping sonars in the AUV mission script. If the route file contains
-waypoints identified as line start and line end points, the subbottom profiler (if enabled) will be
-turned on and off at these points. The waypoint type value can be set interactively within
-<B>mbgrdviz</B>.
-<P>
-The MBARI Benthic Imaging AUV is equipped with dual strobes and a downward pointed camera.
-The <B>-MC</B> option is used to enable control of the camera in the AUV mission script. If the route file contains
-waypoints identified as line start and line end points, the camera (if enabled) will be
-turned on and off at these points. The waypoint type value can be set interactively within
-<B>mbgrdviz</B>.
-<P>
-<A NAME="lbAF"> </A>
-<H2>AUTHORSHIP</H2>
-
-David W. Caress (<A HREF="mailto:caress at mbari.org">caress at mbari.org</A>)
-<BR>
-
-<BR>  Monterey Bay Aquarium Research Institute
-<BR>
-
-Dale N. Chayes (<A HREF="mailto:dale at ldeo.columbia.edu">dale at ldeo.columbia.edu</A>)
-<BR>
-
-<BR>  Lamont-Doherty Earth Observatory
-<P>
-<A NAME="lbAG"> </A>
-<H2>OPTIONS</H2>
-
-<DL COMPACT>
-<DT><B>-A</B>
-
-<DD>
-<I>altmin/altabort[/altdesired[/altdesired2[/altdesired3]]]</I>
-<BR>
-
-Sets the AUV altitude control parameters. The missions generated by this
-script directly command the AUV's depth. However, the commanded depth
-will be overridden by the minimum altitude, or <I>altmin</I> value;
-the vehicle will adjust it's depth so that it does not fly any closer
-to the bottom than <I>altmin</I> meters. If the vehicle reaches an
-altitude equal to or less than <I>altabort</I> meters, then the
-mission will be aborted. The user may specify a desired altitude
-(<I>altdesired</I>) that is different than <I>altmin</I>, so that
-the commanded depths do not directly correspond to the minimum altitude.
-The user can also specify second or third desired altitude
-values <I>altdesired2</I> <I>altdesired3</I>
-that are used between waypoints of type START2 and END2, or START3
-and END3, respectively, as defined in
-<B>MBgrdviz</B> routes.
-<DT><B>-B</B>
-
-<DD>
-<I>behavior</I>
-<BR>
-
-Sets the AUV behavior used to fly the mission. If <I>behavior</I> = 0, then
-the AUV uses the WayPoint behavior in which a single vehicle depth is specified
-for the approach to each waypoint. If <I>behavior</I> = 1, then the AUV uses
-the WayPointDepth behavior in which each mission segment has both a starting
-and an ending depth specified, and the vehicle is commanded to fly a depth
-profile that is a linear ramp between the two depths. Default: <I>behavior</I> = 1;
-<DT><B>-C</B>
-
-<DD>
-<I>missiontime</I>
-<BR>
-
-Sets the maximum time allowed for the AUV mission. If the <I>missiontime</I> is
-exceeded, the AUV will transition to it's internal abort plan.
-Default: mission abort time calculated from mission parameters.
-<DT><B>-D</B>
-
-<DD>
-<I>depthconstant[/depthconstant2]</I>
-<BR>
-
-Sets constant depth values that will be used between waypoints of
-typ START4 and END4 for <I>depthconstant</I> and START5 and END5 for
-<I>depthconstant2</I>. These are the waypoint types defined in
-<B>MBgrdviz</B> routes. While these waypoint types are active, the
-AUV is commanded to the specified constant depth value.
-<DT><B>-F</B>
-
-<DD>
-<I>forwarddistance</I>
-<BR>
-
-The program looks <I>forwarddistance</I> m ahead for the shallowest bottom
-depth along the survey route, and then commands the vehicle to
-fly at least <I>altmin</I> above that depth.
-<DT><B>-G</B>
-
-<DD>
-<I>gpsmode</I>
-<BR>
-
-Sets the frequency with which the AUV will surface between survey lines to
-get GPS fixes. By default, the vehicle only get GPS fixes at the surface at
-the beginning and end of the mission, and not surface during the mission.
-If <I>gpsmode</I> = 1, then the vehicle will ascend for gps fixes at
-the start of each survey line. If <I>gpsmode</I> = 2, then the vehicle will
-ascend for gps fixes at the end of each survey line. If <I>gpsmode</I> = 3,
-then the vehicle will  ascend for gps fixes at the start and end of each survey line
-<DT><B>-H</B>
-
-<DD>
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-<DT><B>-I</B>
-
-<DD>
-<I>routefile</I>
-<BR>
-
-Sets the filename of the input <B>mbgrdviz</B> route file.
-A route file specifies a desired survey route as a set of
-lines between waypoints. In addition to the waypoints, the file
-also includes the depth profiles along those lines.
-<DT><B>-J</B>
-
-<DD>
-<I>depthprofilefile</I>
-<BR>
-
-Sets the filename of an input desired depth profile file. This is the depth
-profile that the vehicle should follow when flying the mission (as opposed to
-following the bottom at a particular altitude).
-<DT><B>-L</B>
-
-<DD>
-<I>approachdepth</I>
-<BR>
-
-Sets the vehicle depth during the approach to the first waypoint when a
-spiral descent to depth at the first waypoint is specified  using the <B>-N</B> option.
-<DT><B>-M</B>
-
-<DD>
-<I>[sensorlist]</I>
-This option enables control of the Mapping AUV's mapping sonars and other possible
-sensors. By default, the AUV mission is generated without turning on the mapping sonars.
-If <B>-M</B> is given alone, the multibeam, subbottom profiler, and both low and high
-frequency sidescan sonars will be enabled. The <I>sonarlist</I> parameter can
-optionally specify which sonars are enabled in addition to the multibeam (the
-multibeam serves as the ping timing master for all sonars, and thus must be
-enabled if any mapping sonars are enabled). The <I>sonarlist</I> value is
-made up of one or more of the following characters:
-<BR> <TT>       </TT><TT>        </TT>M<TT>       </TT>multibeam sonar<BR>
-<BR> <TT>       </TT><TT>        </TT>S<TT>       </TT>subbottom profiler (and multibeam)<BR>
-<BR> <TT>       </TT><TT>        </TT>L<TT>       </TT>low frequency sidescan (and multibeam)<BR>
-<BR> <TT>       </TT><TT>        </TT>H<TT>       </TT>high frequency sidescan (and multibeam)<BR>
-<BR> <TT>       </TT><TT>        </TT>B<TT>       </TT>multibeam beam (water column) data<BR>
-<BR> <TT>       </TT><TT>        </TT>C<TT>       </TT>benthic imaging camera and strobes<BR>
-<BR>
-
-Thus, <B>-M</B><I>SL</I> will cause the multibeam, the subbottom profiler, and
-the low frequency sidescan to be enabled while leaving the high frequency
-sidescan off.
-<DT><B>-N</B>
-
-<DD>
-<I>spiraldescentaltitude</I>
-Sets the mission to include a shallow transit to the first waypoint followed by a
-spiral descent to depth to start the survey. The descent is terminated at the
-altitude <I>spiraldescentaltitude</I> if specified here. Otherwise, the descent is
-terminated at the altitude <I>altdesired</I> from the <B>-A</B> option.
-<DT><B>-O</B>
-
-<DD>
-<I>missionfile</I>
-<BR>
-
-Sets the filename of the output MBARI AUV mission script.
-<DT><B>-P</B>
-
-<DD>
-<I>lon/lat</I>
-<BR>
-
-This sets the expected starting position (<I>lon</I> longitude
-and <I>lat</I> latitude) of the Mapping AUV so that the
-expected time to run to the first waypoint can be estimated. If neither
-the <B>-P</B> or <B>-T</B> options are specified, a distance of 500 meters
-to the first waypoint is assumed.
-<DT><B>-R</B>
-
-<DD>
-<I>transmitpower/receivegain[/rangeminfraction[/pulsewidth]]</I>
-<BR>
-
-This sets the key multibeam sonar parameters. Here <I>transmitpower</I> is
-the transmit power of the multibeam in dB, with a range of 0-220 dB. The
-multibeam receive gain has a range of 0-83 dB. The <I>rangeminfraction</I> variable
-sets the minimum range at which the multibeam will make bottom picks; this
-prevents the multibeam from picking on nearfield arrivals usually reflecting
-interference from other sonars. If the sonar is operating with an altitude of
-50 m and <I>rangeminfraction</I> = 0.2, then the range gating minimum range will be
-0.2 * 50 m = 10 m. The <I>pulsewidth</I> variable sets the multibeam sonar
-transmit pulse width in microseconds. Default: <I>transmitpower</I> = 220, <I>receivegain</I> = 220,
-<I>rangeminfraction</I> = 0.2, <I>pulsewidth</I> = 60.
-<DT><B>-S</B>
-
-<DD>
-<I>speed</I>
-<BR>
-
-This sets the commanded AUV speed in meters/second. Default: <I>speed</I> = 1.5 m/s.
-<DT><B>-T</B>
-
-<DD>
-<I>starttime</I>
-<BR>
-
-This sets the expected time required for the AUV to reach the first waypoint
-in the survey mission. If neither
-the <B>-P</B> or <B>-T</B> options are specified, a distance of 500 meters
-to the first waypoint is assumed.
-<DT><B>-U</B>
-
-<DD>
-<I>maxclimbrate</I>
-<BR>
-
-This sets the maximum climb rate in degrees allowed to be planned for the
-AUV mission. If the topography has a greater slope, the AUV will be brought
-up earlier so the planned climb angle never exceed <I>maxclimbrate</I>.
-Default: <I>maxclimbrate</I> = 25 degrees.
-<DT><B>-W</B>
-
-<DD>
-<I>waypointspacing</I>
-<BR>
-
-Sets the spacing in meters of the waypoints output to the mission script.
-<DT><B>-V</B>
-
-<DD>
-The <B>-V</B> option causes <B>mbm_route2mission</B> to print out status messages.
-<P>
-</DL>
-<A NAME="lbAH"> </A>
-<H2>EXAMPLES</H2>
-
-Suppose you are going to run the MBARI Mapping AUV on the Coaxial Segment of the
-Juan de Fuca Ridge. You have created a route file called Coaxial2009_1v3.rte using
-<B>mbgrdviz</B>. In order to create an MBARI AUV mission script for mission beginning
-with a spiral descent to an altitude of 50 m, followed by a survey run at a 75 m altitude,
-the following will suffice:
-<BR> <TT>       </TT>mbm_route2mission -I Coaxial2009_1v3.rte  <TT>      </TT><TT>        </TT>-A75/30/75 -B1  <TT>        </TT><TT>        </TT>-G0 -MSL -N50 -R220/83/0.3  -O Coaxial2009_1v3.cfg  -S1.5 -L30 -W100&nbs [...]
-<BR>
-
-The resulting mission script has the following header:
-<P>
-<BR>     # This MBARI Mapping AUV mission file has been generated
-<BR>     # by the MB-System program mbm_route2mission run by
-<BR>     # user <caress> on cpu <shepard> at <Thu Jul 30 11:36:47 PDT 2009>
-<BR>     #
-<BR>     # Mission Summary:
-<BR>     #     Route File:               Coaxial2009_1v3.rte
-<BR>     #     Mission File:             Coaxial2009_1v3.cfg
-<BR>     #     Distance:                 79501.503455 (m)
-<BR>     #     Estimated Time:           57203 (s)  15.890 (hr)
-<BR>     #     Abort Time:               60067 (s)
-<BR>     #     Max battery life:         64800 (s)
-<BR>     #     Safety margin:            1800 (s)
-<BR>     #     Ascend time:              2932 (s)
-<BR>     #     Way Points:               44
-<BR>     #     Route Points:             550
-<BR>     #     Survey behavior:          WaypointDepth
-<BR>     #     Descent style:            Spiral descent
-<BR>     #     Mapping sonar control enabled:
-<BR>     #                               Multibeam enabled
-<BR>     #                                 Multibeam receive gain:           83
-<BR>     #                                 Multibeam transmit gain:          220
-<BR>     #                                 Multibeam minimum range fraction: 0.3
-<BR>     #                               Subbottom enabled
-<BR>     #                               Low sidescan enabled
-<BR>     #                               High sidescan disabled
-<BR>     #
-<BR>     # Mission Parameters:
-<BR>     #     Vehicle Speed:            1.500000 (m/s) 2.915769 (knots)
-<BR>     #     Desired Vehicle Altitude: 75 (m)
-<BR>     #     Minimum Vehicle Altitude: 75 (m)
-<BR>     #     Abort Vehicle Altitude:   30 (m)
-<BR>     #     Maximum Vehicle Depth:    2525.307922 (m)
-<BR>     #     Abort Vehicle Depth:      2562.807922 (m)
-<BR>     #     Descent Vehicle Depth:    3 (m)
-<BR>     #     Spiral descent depth:     2324.917643 m
-<BR>     #     Spiral descent altitude:  50 m
-<BR>     #     Forward Looking Distance:  (m)
-<BR>     #     Waypoint Spacing:         100 (m)
-<BR>     #     GPS Duration:             600 (s)
-<BR>     #     Descend Rate:             0.417 (m/s)
-<BR>     #     Ascend Rate:              1 (m/s)
-<BR>     #     Initial descend Duration: 300 (s)
-<BR>     #     Setpoint Duration:        30 (s)
-<BR>     #
-<BR>     # The primary waypoints from the route file are:
-<BR>     #   <number> <longitude (deg)> <latitude (deg)> <topography (m)> <distance (m)> <type>
-<BR>     #   0 -129.588618 46.504590 -2384.917643 0.000000 3
-<BR>     #   1 -129.583151 46.507559 -2412.977865 533.709482 3
-<BR>     #   2 -129.569223 46.503420 -2548.389974 1697.143568 1
-<BR>     #   3 -129.566359 46.501080 -2494.963053 2037.557099 3
-<BR>     #   4 -129.548611 46.529852 -2539.510864 5512.537193 4
-<BR>     #   5 -129.551250 46.530628 -2562.807922 5732.537193 3
-<BR>     #   6 -129.568962 46.501924 -2531.034424 9199.497998 4
-<BR>     #   7 -129.571600 46.502699 -2519.138489 9419.497998 3
-<BR>     #   8 -129.553889 46.531404 -2547.114624 12886.458803 4
-<BR>     #   9 -129.556529 46.532180 -2514.533569 13106.458803 3
-<BR>     #   10 -129.574238 46.503475 -2470.815735 16573.419607 4
-<BR>     #   11 -129.576876 46.504250 -2444.596313 16793.419607 3
-<BR>     #   12 -129.559168 46.532956 -2521.781921 20260.380412 4
-<BR>     #   13 -129.561807 46.533732 -2537.382141 20480.380412 3
-<BR>     #   14 -129.579514 46.505026 -2429.459961 23947.341216 4
-<BR>     #   15 -129.582152 46.505801 -2412.764343 24167.341217 3
-<BR>     #   16 -129.564447 46.534508 -2545.397705 27634.302021 4
-<BR>     #   17 -129.567086 46.535284 -2534.068665 27854.302021 3
-<BR>     #   18 -129.584791 46.506576 -2398.283020 31321.262826 4
-<BR>     #   19 -129.587429 46.507352 -2390.671509 31541.262826 3
-<BR>     #   20 -129.569726 46.536059 -2489.889282 35008.223630 4
-<BR>     #   21 -129.572365 46.536835 -2465.280823 35228.223630 3
-<BR>     #   22 -129.590068 46.508127 -2389.067017 38695.184435 4
-<BR>     #   23 -129.592706 46.508902 -2409.290771 38915.184435 3
-<BR>     #   24 -129.575005 46.537610 -2466.533142 42382.145240 4
-<BR>     #   25 -129.577645 46.538386 -2491.371094 42602.145240 3
-<BR>     #   26 -129.595345 46.509677 -2397.609253 46069.106044 4
-<BR>     #   27 -129.597984 46.510452 -2413.315918 46289.106044 3
-<BR>     #   28 -129.580285 46.539161 -2499.048889 49756.066849 4
-<BR>     #   29 -129.582925 46.539937 -2523.030640 49976.066849 3
-<BR>     #   30 -129.600622 46.511227 -2443.481018 53443.027653 4
-<BR>     #   31 -129.603261 46.512002 -2419.008240 53663.027653 3
-<BR>     #   32 -129.585565 46.540712 -2518.522400 57129.988458 4
-<BR>     #   33 -129.588205 46.541487 -2498.521301 57349.988458 3
-<BR>     #   34 -129.605900 46.512777 -2450.386536 60816.949263 4
-<BR>     #   35 -129.608539 46.513552 -2473.623230 61036.949263 3
-<BR>     #   36 -129.590845 46.542262 -2487.422180 64503.910067 4
-<BR>     #   37 -129.593485 46.543038 -2491.040466 64723.910067 3
-<BR>     #   38 -129.611178 46.514327 -2472.610657 68190.870872 3
-<BR>     #   39 -129.606711 46.517999 -2485.114583 68723.704236 3
-<BR>     #   40 -129.557338 46.509809 -2488.398743 72619.152031 3
-<BR>     #   41 -129.550415 46.521262 -2545.285828 73998.189601 3
-<BR>     #   42 -129.600724 46.536447 -2470.920736 78209.372536 3
-<BR>     #   43 -129.606972 46.525648 -2443.988281 79501.503455 4
-<BR>     #
-<BR>     # A total of 550 mission points have been defined.
-<BR>     #
-<BR>     # Define Mission parameters:
-<BR>     #define MISSION_SPEED      1.500000
-<BR>     #define MISSION_DISTANCE   79501.503455
-<BR>     #define MISSION_TIME       57203
-<BR>     #define MISSION_TIMEOUT    60067
-<BR>     #define DEPTH_MAX          2525.307922
-<BR>     #define DEPTH_ABORT        2562.807922
-<BR>     #define ALTITUDE_DESIRED   75.000000
-<BR>     #define ALTITUDE_MIN       75.000000
-<BR>     #define ALTITUDE_ABORT     30.000000
-<BR>     #define GPS_DURATION       600
-<BR>     #define DESCENT_DEPTH      3.000000
-<BR>     #define SPIRAL_DESCENT_DEPTH      2324.917643
-<BR>     #define SPIRAL_DESCENT_ALTITUDE   50.000000
-<BR>     #define DESCEND_DURATION   300
-<BR>     #define SETPOINT_DURATION  30
-<BR>     #define GPSMINHITS         10
-<BR>     #define ASCENDRUDDER       3.000000
-<BR>     #define ASCENDPITCH        45.000000
-<BR>     #define ASCENDENDDEPTH     2.000000
-<BR>     #define DESCENDRUDDER      3.000000
-<BR>     #define DESCENDPITCH       -30.000000
-<BR>     #define MAXCROSSTRACKERROR 30
-<BR>     #define RESON_DURATION     6
-<BR>     #q
-<P>
-<A NAME="lbAI"> </A>
-<H2>SEE ALSO</H2>
-
-<B><A HREF="mbsystem.html">mbsystem</A></B>(1), <B><A HREF="mbgrdviz.html">mbgrdviz</A></B>(1)
-<P>
-<A NAME="lbAJ"> </A>
-<H2>BUGS</H2>
-
-Perhaps.
-<P>
-
-<HR>
-<A NAME="index"> </A><H2>Index</H2>
-<DL>
-<DT><A HREF="#lbAB">NAME</A><DD>
-<DT><A HREF="#lbAC">VERSION</A><DD>
-<DT><A HREF="#lbAD">SYNOPSIS</A><DD>
-<DT><A HREF="#lbAE">DESCRIPTION</A><DD>
-<DT><A HREF="#lbAF">AUTHORSHIP</A><DD>
-<DT><A HREF="#lbAG">OPTIONS</A><DD>
-<DT><A HREF="#lbAH">EXAMPLES</A><DD>
-<DT><A HREF="#lbAI">SEE ALSO</A><DD>
-<DT><A HREF="#lbAJ">BUGS</A><DD>
-</DL>
-<HR>
-</PRE>
-
-<CENTER><P><BR>
-Last Updated: 22 February 2015</P></CENTER>
-
-<HR>
-<P><A HREF="mbsystem_man_list.html">Return to list of MB-System manual pages...</A></P>
-<P><A HREF="mbsystem_home.html"><IMG SRC="mbsystem_logo_small.gif" BORDER=0 HEIGHT=55 WIDTH=158 ALIGN=BOTTOM></A><A HREF="mbsystem_home.html">Back
-to MB-System Home Page...</A></P>
-
-</BODY>
-</HTML>
diff --git a/src/html/mbm_stat.html b/src/html/mbm_stat.html
deleted file mode 100644
index bf59296..0000000
--- a/src/html/mbm_stat.html
+++ /dev/null
@@ -1,122 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<HTML VERSION="2.0">
-<HEAD>
-   <TITLE>MB-System Unix Manual Page: mbm_stat</TITLE>
-<!-- WEBMAGIC VERSION NUMBER="2.0.2" -->
-<!-- WEBMAGIC TRANSLATION NAME="ServerRoot" SRC="/var/www/htdocs/" DST="/" -->
-<!-- WEBMAGIC TRANSLATION NAME="ProjectRoot" SRC="./" DST="" -->
-</HEAD>
-<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#336699" VLINK="#997040" ALINK="#CC9900">
-<BODY>
-<CENTER><H3><U>MB-System Unix Manual Page</U></H3></CENTER>
-<PRE>
-<H1>mbm_stat</H1>
-Section:  MB-System 5.0  (1)<BR>Updated:  3 June 2013 <BR><A HREF="#index">Index</A>
-<HR>
-
-<A NAME="lbAB"> </A>
-<H2>NAME</H2>
-
-<B>mbm_stat</B> - Extract beam statistics from output generated by mbinfo.
-<P>
-<A NAME="lbAC"> </A>
-<H2>VERSION</H2>
-
-Version 5.0
-<P>
-<A NAME="lbAD"> </A>
-<H2>SYNOPSIS</H2>
-
-<B>mbm_stat</B> <B>-I</B><I>file</I> [<B>-V -H</B>]
-<P>
-<A NAME="lbAE"> </A>
-<H2>DESCRIPTION</H2>
-
-<B>mbm_stat</B> is a perl shellscript that extracts beam statistics from the
-output of <B>mbinfo</B>. The output of contains the base name of the data file,
-then number of hours of data in the data file, and the percentage of dropped
-and flagged beams. One line of output for each run of <B>mbinfo</B> is
-generated. This allows <B>mbm_stat</B> to be run on accumulated data such as
-might be generated by logging the daily mail statistics. Columns are tab
-delimited.
-<P>
-<A NAME="lbAF"> </A>
-<H2>AUTHORSHIP</H2>
-
-David W. Caress (<A HREF="mailto:caress at mbari.org">caress at mbari.org</A>)
-<BR>
-
-<BR>  Monterey Bay Aquarium Research Institute
-<BR>
-
-Dale N. Chayes (<A HREF="mailto:dale at ldeo.columbia.edu">dale at ldeo.columbia.edu</A>)
-<BR>
-
-<BR>  Lamont-Doherty Earth Observatory
-<BR>
-
-Suzanne H. O'Hara (<A HREF="mailto:sohara at ldeo.columbia.edu">sohara at ldeo.columbia.edu</A>)
-<BR>
-
-<BR>  Lamont-Doherty Earth Observatory
-<P>
-<A NAME="lbAG"> </A>
-<H2>OPTIONS</H2>
-
-<DL COMPACT>
-<DT><B>-H</B>
-
-<DD>
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-<DT><B>-I</B>
-
-<DD>
-<I>file</I>
-<BR>
-
-Data file to be processed which contains the output of one or
-more executions of <B>mbinfo</B>.
-<DT><B>-V</B>
-
-<DD>
-Causes <B>mbm_stat</B> to operate in "verbose" mode so that it outputs
-more information than usual.
-<P>
-</DL>
-<A NAME="lbAH"> </A>
-<H2>SEE ALSO</H2>
-
-<B><A HREF="mbsystem.html">mbsystem</A></B>(1), <B><A HREF="mbinfo.html">mbinfo</A></B>(1)
-<P>
-<A NAME="lbAI"> </A>
-<H2>BUGS</H2>
-
-Too simple to have any really interesting bugs.
-<P>
-
-<HR>
-<A NAME="index"> </A><H2>Index</H2>
-<DL>
-<DT><A HREF="#lbAB">NAME</A><DD>
-<DT><A HREF="#lbAC">VERSION</A><DD>
-<DT><A HREF="#lbAD">SYNOPSIS</A><DD>
-<DT><A HREF="#lbAE">DESCRIPTION</A><DD>
-<DT><A HREF="#lbAF">AUTHORSHIP</A><DD>
-<DT><A HREF="#lbAG">OPTIONS</A><DD>
-<DT><A HREF="#lbAH">SEE ALSO</A><DD>
-<DT><A HREF="#lbAI">BUGS</A><DD>
-</DL>
-<HR>
-</PRE>
-
-<CENTER><P><BR>
-Last Updated: 3 June 2013</P></CENTER>
-
-<HR>
-<P><A HREF="mbsystem_man_list.html">Return to list of MB-System manual pages...</A></P>
-<P><A HREF="mbsystem_home.html"><IMG SRC="mbsystem_logo_small.gif" BORDER=0 HEIGHT=55 WIDTH=158 ALIGN=BOTTOM></A><A HREF="mbsystem_home.html">Back
-to MB-System Home Page...</A></P>
-
-</BODY>
-</HTML>
diff --git a/src/html/mbm_utm.html b/src/html/mbm_utm.html
deleted file mode 100644
index de4b7c7..0000000
--- a/src/html/mbm_utm.html
+++ /dev/null
@@ -1,161 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<HTML VERSION="2.0">
-<HEAD>
-   <TITLE>MB-System Unix Manual Page: mbm_utm</TITLE>
-<!-- WEBMAGIC VERSION NUMBER="2.0.2" -->
-<!-- WEBMAGIC TRANSLATION NAME="ServerRoot" SRC="/var/www/htdocs/" DST="/" -->
-<!-- WEBMAGIC TRANSLATION NAME="ProjectRoot" SRC="./" DST="" -->
-</HEAD>
-<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#336699" VLINK="#997040" ALINK="#CC9900">
-<BODY>
-<CENTER><H3><U>MB-System Unix Manual Page</U></H3></CENTER>
-<PRE>
-<H1>mbm_project</H1>
-Section:  MB-System 5.0  (1)<BR>Updated:  3 June 2013 <BR><A HREF="#index">Index</A>
-<HR>
-
-<A NAME="lbAB"> </A>
-<H2>NAME</H2>
-
-<B>mbm_utm</B> - Macro to perform forward and inverse UTM projections
-of ASCII data triples.
-<P>
-<A NAME="lbAC"> </A>
-<H2>VERSION</H2>
-
-Version 5.0
-<P>
-<A NAME="lbAD"> </A>
-<H2>SYNOPSIS</H2>
-
-mbm_utm <B>-I</B><I>infile</I> <B>-O</B><I>outfile</I>
-<B>-Z</B><I>zone</I> <B>-E</B><I>ellipsoid</I> [<B>-F -Q -H -V</B>]
-<P>
-<A NAME="lbAE"> </A>
-<H2>DESCRIPTION</H2>
-
-<B>mbm_utm</B> is a macro to perform forward and inverse UTM projections
-of ASCII data triples using the GMT program mapproject.
-Forward projections translate from geographic data
-(lon, lat, value) to UTM eastings and northings (x, y, value).
-Inverse projections translate from (x, y, z) to (lon, lat, z).
-Both the input and output files must be specified.
-<P>
-<A NAME="lbAF"> </A>
-<H2>AUTHORSHIP</H2>
-
-David W. Caress (<A HREF="mailto:caress at mbari.org">caress at mbari.org</A>)
-<BR>
-
-<BR>  Monterey Bay Aquarium Research Institute
-<BR>
-
-Dale N. Chayes (<A HREF="mailto:dale at ldeo.columbia.edu">dale at ldeo.columbia.edu</A>)
-<BR>
-
-<BR>  Lamont-Doherty Earth Observatory
-<P>
-<A NAME="lbAG"> </A>
-<H2>SIMPLE DESCRIPTION OF BASIC OPTIONS</H2>
-
-<DL COMPACT>
-<DT><B>-H</B><DD>
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-<DT><B>-E</B><I>ellipsoid</I><DD>
-Sets the ellipsoid to be used. The default
-is to use the WGS-84 ellipsoid, in accordance with
-the NAD-83 datum. If ellipsoid = "Clarke-1866",
-then the Clarke-1866 ellipsoid will be used in
-accordance with the NAD-27 datum. Note that this
-macro cannot be used to accomplish a true datum
-shift between NAD-27 and NAD-83 because the 1986
-transition to NAD-83 also involved additional
-adjustments to positions.
-<DT><B>-F</B><DD>
-Causes <B>mbm_utm</B> to use or generate eastings and northings
-in feet rather than meters.
-<DT><B>-I</B><I>infile</I><DD>
-Sets the name of the data file to be processed.
-The first two columns of the ASCII input
-data stream must be either longitude and
-latitude values (for geographic to projected
-transformation) or easting and northing values
-(for projected to geographic transformation).
-Any additional columns of data are passed unaltered to the output.
-<DT><B>-O</B><I>outfile</I><DD>
-Sets the name of the output data file to be generated.
-The first two columns of the ASCII output
-data stream will be either easting and northing
-values (for geographic to projected
-transformation) or longitude and latitude values
-(for projected to geographic transformation).
-Any additional columns of data are passed unaltered to the output.
-<DT><B>-Q</B><DD>
-This option causes the transformation to be from
-projected coordinates (eastings and northings) to
-geographic coordinates (longitude and latitude).
-The default is to transform from geographic to
-projected coordinates.
-<DT><B>-Z</B><I>zone</I><DD>
-Sets the UTM zone.
-<P>
-</DL>
-<A NAME="lbAH"> </A>
-<H2>EXAMPLES</H2>
-
-Suppose we have a file containing longitude, latitude,
-and depth triples called llz.dat. To transform the
-coordinates to eastings and northings in the
-UTM Zone 10 projection, use:
-<BR>
-
-<BR> <TT>       </TT>mbm_utm -Illz.dat -Z10 -Oenz.dat<BR>
-<BR>
-
-The file enz.dat will contain eastings and northings
-instead of longitude and latitude values. To transform
-back to geographic coordinates, use:
-<BR>
-
-<BR> <TT>       </TT>mbm_utm -Ienz.dat -Z10 -Q -Ollz2.dat<BR>
-<BR>
-
-<P>
-<A NAME="lbAI"> </A>
-<H2>SEE ALSO</H2>
-
-<B><A HREF="mbsystem.html">mbsystem</A></B>(1), <B>project</B>
-<P>
-<A NAME="lbAJ"> </A>
-<H2>BUGS</H2>
-
-Too new to have bugs.
-<P>
-
-<HR>
-<A NAME="index"> </A><H2>Index</H2>
-<DL>
-<DT><A HREF="#lbAB">NAME</A><DD>
-<DT><A HREF="#lbAC">VERSION</A><DD>
-<DT><A HREF="#lbAD">SYNOPSIS</A><DD>
-<DT><A HREF="#lbAE">DESCRIPTION</A><DD>
-<DT><A HREF="#lbAF">AUTHORSHIP</A><DD>
-<DT><A HREF="#lbAG">SIMPLE DESCRIPTION OF BASIC OPTIONS</A><DD>
-<DT><A HREF="#lbAH">EXAMPLES</A><DD>
-<DT><A HREF="#lbAI">SEE ALSO</A><DD>
-<DT><A HREF="#lbAJ">BUGS</A><DD>
-</DL>
-<HR>
-</PRE>
-
-<CENTER><P><BR>
-Last Updated: 3 June 2013</P></CENTER>
-
-<HR>
-<P><A HREF="mbsystem_man_list.html">Return to list of MB-System manual pages...</A></P>
-<P><A HREF="mbsystem_home.html"><IMG SRC="mbsystem_logo_small.gif" BORDER=0 HEIGHT=55 WIDTH=158 ALIGN=BOTTOM></A><A HREF="mbsystem_home.html">Back
-to MB-System Home Page...</A></P>
-
-</BODY>
-</HTML>
diff --git a/src/html/mbm_xbt.html b/src/html/mbm_xbt.html
deleted file mode 100644
index 8e2b422..0000000
--- a/src/html/mbm_xbt.html
+++ /dev/null
@@ -1,163 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<HTML VERSION="2.0">
-<HEAD>
-   <TITLE>MB-System Unix Manual Page: mbm_xbt</TITLE>
-<!-- WEBMAGIC VERSION NUMBER="2.0.2" -->
-<!-- WEBMAGIC TRANSLATION NAME="ServerRoot" SRC="/var/www/htdocs/" DST="/" -->
-<!-- WEBMAGIC TRANSLATION NAME="ProjectRoot" SRC="./" DST="" -->
-</HEAD>
-<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#336699" VLINK="#997040" ALINK="#CC9900">
-<BODY>
-<CENTER><H3><U>MB-System Unix Manual Page</U></H3></CENTER>
-<PRE>
-<H1>mbm_xbt</H1>
-Section:  MB-System 5.0  (1)<BR>Updated:  3 June 2013 <BR><A HREF="#index">Index</A>
-<HR>
-
-<A NAME="lbAB"> </A>
-<H2>NAME</H2>
-
-<B>mbm_xbt</B> - Calculate sound speed from XBT data.
-<P>
-<A NAME="lbAC"> </A>
-<H2>VERSION</H2>
-
-Version 5.0
-<P>
-<A NAME="lbAD"> </A>
-<H2>SYNOPSIS</H2>
-
-<B>mbm_xbt</B> <B>-I</B><I>infile</I> [<B>-F</B><I>format</I>
-<B>-L</B><I>latitude</I> <B>-S</B><I>salinity</I> <B>-V -H</B>]
-<P>
-<A NAME="lbAE"> </A>
-<H2>DESCRIPTION</H2>
-
-<B>mbm_xbt</B> is a perl shellscript to translate various XBT data sets
-from depth and temperature into depth and sound speed.  Header
-lines are  turned into comments beginning with '#' characters. The
-output filename consists of the input filename with the suffix ".sv".
-The conversion is done using the DelGrosso equation as referenced
-in Dusha et al. [1993] (reference below).
-<P>
-<A NAME="lbAF"> </A>
-<H2>AUTHORSHIP</H2>
-
-David W. Caress (<A HREF="mailto:caress at mbari.org">caress at mbari.org</A>)
-<BR>
-
-<BR>  Monterey Bay Aquarium Research Institute
-<BR>
-
-Dale N. Chayes (<A HREF="mailto:dale at ldeo.columbia.edu">dale at ldeo.columbia.edu</A>)
-<BR>
-
-<BR>  Lamont-Doherty Earth Observatory
-<BR>
-
-Suzanne H. O'Hara (<A HREF="mailto:sohara at ldeo.columbia.edu">sohara at ldeo.columbia.edu</A>)
-<BR>
-
-<BR>  Lamont-Doherty Earth Observatory
-<P>
-<A NAME="lbAG"> </A>
-<H2>OPTIONS</H2>
-
-<DL COMPACT>
-<DT><B>-F</B>
-
-<DD>
-<I>format</I>
-<BR>
-
-Allows the user to select the type of XBT data. Currently supported
-formats are: 1 = Sparton XBT, 2 = Sippican MK12 XBT, 3 = Sippican MK21.
-Default: <I>format</I> = 2.
-<DT><B>-H</B>
-
-<DD>
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-<DT><B>-I</B>
-
-<DD>
-<I>file</I>
-<BR>
-
-Data file from which the input data will be read.
-<DT><B>-L</B>
-
-<DD>
-<I>latitude</I>
-<BR>
-
-Latitude of the XBT cast.
-<DT><B>-S</B>
-
-<DD>
-<I>salinity</I>
-<BR>
-
-Sets the salinity used to calculate sound speed from temperature
-and depth. The default value of 35 ppt may be significantly
-in error in some areas.  Default: <I>salinity</I> = 35.
-<DT><B>-V</B>
-
-<DD>
-Causes <B>mbm_xbt</B> to operate in "verbose" mode so that it outputs
-more information than usual.
-<P>
-</DL>
-<A NAME="lbAH"> </A>
-<H2>NOTES</H2>
-
-There is a hard limit in the code that prevents temperatures less than
--2.0 degrees C from being used. Input lines containing temperatures less
-than -2.0 will be ignored.
-<P>
-<A NAME="lbAI"> </A>
-<H2>SEE ALSO</H2>
-
-<B><A HREF="mbsystem.html">mbsystem</A></B>(1), <B><A HREF="mbprocess.html">mbprocess</A></B>(1), <B><A HREF="mbset.html">mbset</A></B>(1),
-<B><A HREF="mbvelocitytool.html">mbvelocitytool</A></B>(1), <B><A HREF="mblevitus.html">mblevitus</A></B>(1)
-<P>
-<A NAME="lbAJ"> </A>
-<H2>REFERENCES</H2>
-
-Dusha, B. D., P. F. Worcester, B. D. Cornuelle, B. M. Howe,
-On equations for the speed of sound in seawater, J. Acoust. Soc. Am.,
-93, 255-275, 1993.
-<P>
-<A NAME="lbAK"> </A>
-<H2>BUGS</H2>
-
-Let us know.
-<P>
-
-<HR>
-<A NAME="index"> </A><H2>Index</H2>
-<DL>
-<DT><A HREF="#lbAB">NAME</A><DD>
-<DT><A HREF="#lbAC">VERSION</A><DD>
-<DT><A HREF="#lbAD">SYNOPSIS</A><DD>
-<DT><A HREF="#lbAE">DESCRIPTION</A><DD>
-<DT><A HREF="#lbAF">AUTHORSHIP</A><DD>
-<DT><A HREF="#lbAG">OPTIONS</A><DD>
-<DT><A HREF="#lbAH">NOTES</A><DD>
-<DT><A HREF="#lbAI">SEE ALSO</A><DD>
-<DT><A HREF="#lbAJ">REFERENCES</A><DD>
-<DT><A HREF="#lbAK">BUGS</A><DD>
-</DL>
-<HR>
-</PRE>
-
-<CENTER><P><BR>
-Last Updated: 3 June 2013</P></CENTER>
-
-<HR>
-<P><A HREF="mbsystem_man_list.html">Return to list of MB-System manual pages...</A></P>
-<P><A HREF="mbsystem_home.html"><IMG SRC="mbsystem_logo_small.gif" BORDER=0 HEIGHT=55 WIDTH=158 ALIGN=BOTTOM></A><A HREF="mbsystem_home.html">Back
-to MB-System Home Page...</A></P>
-
-</BODY>
-</HTML>
diff --git a/src/html/mbm_xyplot.html b/src/html/mbm_xyplot.html
deleted file mode 100644
index 66fbdce..0000000
--- a/src/html/mbm_xyplot.html
+++ /dev/null
@@ -1,974 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<HTML VERSION="2.0">
-<HEAD>
-   <TITLE>MB-System Unix Manual Page: mbm_xyplot</TITLE>
-<!-- WEBMAGIC VERSION NUMBER="2.0.2" -->
-<!-- WEBMAGIC TRANSLATION NAME="ServerRoot" SRC="/var/www/htdocs/" DST="/" -->
-<!-- WEBMAGIC TRANSLATION NAME="ProjectRoot" SRC="./" DST="" -->
-</HEAD>
-<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#336699" VLINK="#997040" ALINK="#CC9900">
-<BODY>
-<CENTER><H3><U>MB-System Unix Manual Page</U></H3></CENTER>
-<PRE>
-<H1>mbm_xyplot</H1>
-Section:  MB-System 5.0  (1)<BR>Updated:  9 January 2015 <BR><A HREF="#index">Index</A>
-<HR>
-
-<A NAME="lbAB"> </A>
-<H2>NAME</H2>
-
-<B>mbm_xyplot</B> - Create an executable shellscript which will generate
-a GMT plot of xy data.
-<P>
-<A NAME="lbAC"> </A>
-<H2>VERSION</H2>
-
-Version 5.0
-<P>
-<A NAME="lbAD"> </A>
-<H2>SYNOPSIS</H2>
-
-<B>mbm_xyplot</B> <B>-I</B><I>[filepars:]file</I>
-[<B>-I</B><I>[filepars:]file</I> <B>-G</B><I>fill</I> <B>-H</B>
-<B>-O</B><I>root</I> <B>-P</B><I>pagesize</I>
-<B>-S</B><I>symbol/size</I>
-<B>-U</B><I>orientation</I> <B>-V</B>
-<B>-W</B><I>pen</I> ]
-<P>
-Additional Options:
-<BR>
-
-[<B>-B</B><I>tickinfo</I> 
-<B>-J</B><I>projection</I>[<I>/scale | width</I>]
-<B>-L</B><I>title</I>[<I>:xlabel:ylabel</I>] <B>-M</B><I>misc</I>
-<B>-Q</B> <B>-R</B><I>w/e/s/n</I> <B>-X</B> <B>-Z</B>]
-<P>
-Miscellaneous Options:
-<BR>
-
-[<B>-MGD</B><I>gmtdef/value</I>
-<B>-MGL</B>[<I>f</I>][<I>x</I>]<I>lon0/lat0/slat/length</I>[<I>units</I>][<I>+llabel</I>]
-<B>-MGT</B><I>x/y/size/angle/font/just/text</I>
-<B>-MGU</B>[<I>/dx/dy/</I>][<I>label</I>] ]
-<P>
-<A NAME="lbAE"> </A>
-<H2>DESCRIPTION</H2>
-
-<B>mbm_xyplot</B> is a macro to generate a shellscript of GMT commands which,
-when executed, will generate a Postscript plot of xy data.
-Axes may be linear, log,  or any of several geographic
-projections. Data may be plotted as symbols or lines.
-The plot will be scaled to fit on the specified page size
-or, if the scale is user defined, the page size will be
-chosen in accordance with the plot size. The primary purpose
-of this macro is to allow the simple, semi-automated
-production of nice looking plots with a few command line
-arguments.
-<P>
-By default <B>mbm_xyplot</B> expects the input data files to have
-values organized in columns separated by white space. However, users
-may optionally specify a non-white-space delimiter for each
-file. Input data files can have an arbitrary number of columns. When
-two or more columns exist the one may specify which two columns to
-plot (the first vs second is the default). In addition, users may
-optionally specify a single column to be plotted versus
-data-point-number.
-<P>
-The standard syntax with which one selects columns to plot may also be
-embedded into a larger Perl expression, which will be evaluated for
-each line of the data file. In this way, one may do on-the-fly
-mathematics or substring extractions as required.  Indeed, one may
-specify most any Perl expression that when evaluated, will be a
-numeric result for plotting. For example, one can multiply the values
-in a column by a constant, add the values of two columns together or
-even extract latitude and longitude degrees and minutes in a file of
-NMEA strings and convert the results to decimal degrees for
-plotting. The macro uses the specified delimter to extract the
-values from each column, evaluate the expressions, and then leaves the
-result in temporary data in files to be read by the plotting
-shellscript. The temporary files are deleted on execution of the shell
-script by default, but can optionally be retained for debugging
-purposes.
-<P>
-For users seeking more control over the plot
-appearance, a number of additional optional arguments are
-provided. Truly ambitious users may edit the plot shellscript
-to take advantage of GMT capabilities not supported by this
-macro.
-<P>
-By default the output plot generation shellscript
-includes lines which execute a program to display the Postscript
-image on the screen. The program to be used to display the Postscript
-is set using <B>mbdefaults</B>; the default value can be overridden
-by setting the environment variable $MB_PS_VIEWER.
-Invoking the plot generation shellscript with
-a <B>-N</B> command line argument suppresses the screen
-display of the plot.
-<P>
-The plot scripts generated by this macro will work with
-GMT version 5.0 and later, and are not compatible with
-earlier versions of GMT.
-<P>
-<A NAME="lbAF"> </A>
-<H2>AUTHORSHIP</H2>
-
-David W. Caress (<A HREF="mailto:caress at mbari.org">caress at mbari.org</A>)
-<BR>
-
-<BR>  Monterey Bay Aquarium Research Institute
-<BR>
-
-Dale N. Chayes (<A HREF="mailto:dale at ldeo.columbia.edu">dale at ldeo.columbia.edu</A>)
-<BR>
-
-<BR>  Lamont-Doherty Earth Observatory
-<BR>
-
-Suzanne H. O'Hara (<A HREF="mailto:sohara at ldeo.columbia.edu">sohara at ldeo.columbia.edu</A>)
-<BR>
-
-<BR>  Lamont-Doherty Earth Observatory
-<P>
-<A NAME="lbAG"> </A>
-<H2>SIMPLE DESCRIPTION OF BASIC OPTIONS</H2>
-
-<DL COMPACT>
-<DT><B>-G</B>
-
-<DD>
-<I>fill</I>
-<BR>
-
-Select filling of symbols for xy plotting.
-Set the shade (0-255) or color
-(r/g/b) [Default is no fill]. To reset no fill,
-use <I>fill</I> = "N".
-For polygons, you may optionally specify
-<B>-Gp</B><I>icon_size/pattern</I>, where
-<I>pattern</I> gives the number of the
-image pattern (1-32) OR the name of a
-icon-format file.  <I>icon_size</I> sets
-the unit size in inch.
-To invert black and white pixels, use
-<B>-GP</B> instead of <B>-Gp</B>.  See
-<B>GMTs</B> Cookbook & Technical Reference
-Appendix E for information on individual patterns.
-<DT><B>-H</B>
-
-<DD>
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-<DT><B>-I</B>
-
-<DD>
-<I>[filepars:]xy_file </I>
-<BR>
-
-Specifies a file containing (x,y) pairs to be plotted as lines or
-symbols. Optional parameters preceed the file name and consist of a
-list of flag-argument pairs, strung together with colons. These
-arguments may include the column delimiter, which columns to plot,
-line and symbol characteristics and a flag to specify when multiple
-data segments are embedded in a single file. The looks like the
-following.:
-<P>
-<B> -I</B><B>D</B><I>delimiter</I>:<B>C</B><I>columnsexpression</I>:<B>G</B><I>color</I>:<B>S</B><I>symbol</I>:<B>W</B><I>weight</I>:<B>M</B>:<B>xyfile</B>
-<P>
-Default parameters are whitespace [ D(\s+) ], column 1 vs column 2
-[ Cc[1]_c[2] ], black lines without symbols [ SN ], [ GN ], [ W1 ], and no
-multiple segments (omitted M flag).
-<P>
-Please see the "Complete Description of Options" below for details.
-<DT><B>-O</B>
-
-<DD>
-<I>root</I>
-<BR>
-
-Sets the root used to construct the filename of the output shellscript
-(<I>root</I>.cmd) and names of files created when the shellscript is
-run.  Normally the
-name of the input grid file or grid file list is
-used as the <I>root</I>.
-<DT><B>-P</B>
-
-<DD>
-<I>pagesize</I>
-<BR>
-
-This option sets the size of the page the plot will be centered
-on. If the user does not set the plot scale, the plot will be
-sized as large as will fit on the designated page. If the user
-sets the plot scale such that the plot will not fit on the
-designated page, a larger page will be used.
-The supported page sizes include ANSI A, B, C, D, E,
-F, and E1, as well as most metric page sizes. See the
-COMPLETE DESCRIPTION OF OPTIONS section
-below for a complete list of
-the supported page sizes. The default page size is A.
-<DT><B>-S</B>
-
-<DD>
-<I>symbol/size</I>
-<BR>
-
-Selects symbol to be used for plotting the next xy data
-file. Setting <I>symbol</I> = "N" causes line plotting.
-The list of available symbols is given in the
-COMPLETE DESCRIPTION OF OPTIONS section below.
-<DT><B>-U</B>
-
-<DD>
-<I>orientation</I>
-<BR>
-
-Normally the orientation of the plot (portrait or landscape)
-is selected automatically so as to maximize the plot scale.
-The <B>-U</B> option allows the user to set the plot orientation. If
-<I>orientation</I> = 1, a portrait plot will be produced; if
-<I>orientation</I> = 2, a landscape plot will be produced.
-<DT><B>-V</B>
-
-<DD>
-Causes <B>mbm_grdplot</B> to operate in "verbose" mode
-so that it outputs
-more information than usual.
-<DT><B>-W</B>
-
-<DD>
-<I>pen</I>
-<BR>
-
-Set pen attributes for xy plotting. See chapter 4.12 in the
-GMT Technical reference for a discussion of GMT pen values.
-[Defaults: width = 1, color = 0/0/0,
-texture = solid].
-<P>
-</DL>
-<A NAME="lbAH"> </A>
-<H2>COMPLETE DESCRIPTION OF OPTIONS</H2>
-
-<DL COMPACT>
-<DT><B>-B</B>
-
-<DD>
-<I>tickinfo</I>
-<BR>
-
-Sets map boundary tickmark intervals. See the <B>psbasemap</B>
-manual page for details. By default the program chooses
-basemap annotations based on the map boundaries.
-<DT><B>-G</B>
-
-<DD>
-<I>fill</I>
-<BR>
-
-Select filling of symbols for xy plotting.
-Set the shade (0-255) or color
-(r/g/b) [Default is no fill]. To reset no fill,
-use <I>fill</I> = "N".
-For polygons, you may optionally specify
-<B>-Gp</B><I>icon_size/pattern</I>, where
-<I>pattern</I> gives the number of the
-image pattern (1-32) OR the name of a
-icon-format file.  <I>icon_size</I> sets
-the unit size in inch.
-To invert black and white pixels, use
-<B>-GP</B> instead of <B>-Gp</B>.  See
-<B>GMTs</B> Cookbook & Technical Reference
-Appendix E for information on individual patterns.
-<DT><B>-H</B>
-
-<DD>
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-<DT><B>-I</B>
-
-<DD>
-<I>[filepars:]xy_file</I>
-<BR>
-
-<P>
-Specifies the files containing the data to be plotted, and for each
-file, a list of file parameters which are comprised of the rules used
-by <B>mbm_xyplot</B> to parse and manipulate the x and y values on the
-fly, as well as the line and symbol characters used for plotting the
-results.
-<P>
-The file parameters are an optional list of flags and their arguments
-concatinated and strung together with colons. A full specification has
-the following general syntax although individual flags and their
-arguments need not appear in any particular order as long as argument
-follows corresponding flag.:
-<P>
-<P>
-<B> -I</B><B>D</B><I>delimiter</I>:<B>C</B><I>columnsexpression</I>:<B>G</B><I>color</I>:<B>S</B><I>symbol</I>:<B>W</B><I>weight</I>:<B>M</B>:<B>xyfile</B>
-<P>
-The delimiter may be any character string. The default delimiter is
-whitespace.
-<P>
-By default, <B>mbm_xyplot</B> uses the first column as the x value and
-the second column as the y value for the plot. However, the <B>C</B>
-flag and column expression allows the user to chose other columns to
-plot. The general syntax is
-<P>
-<B>C</B> <I>c[xcol]_c[ycol]</I>
-<P>
-where 'xcol' and 'ycol' designate the x and y columns
-respectively. Columns are numbered starting at '1' one the left most
-column in the file. In addition, either c[] expression may be replaced
-with a single '#' symbol to plot the other variable vs. line
-number. For example,
-<P>
-<B>C</B> <I>#_c[ycol]</I>
-<P>
-will plot the values in column 'ycol' vs their line number in the file.
-<P>
-Other valid Perl expressions may be substituted for either column
-expression as well. For example, to plot in kilometers, a file whose
-columns contain x and y coordinates in meters, one would specify
-<P>
-<B>C</B> <I>c[0]/1000_c[1]/1000</I>
-<P>
-The line and symbol characteristics are set using the <B>G</B>,
-<B>S</B>, and <B>W</B> options.  For example, the command
-<B>-IG</B><I>255/0/0:</I><B>S</B><I>a/0.1:xy.dat</I> will plot the (x,y)
-data pairs in the file xy.dat as 0.1 inch diameter red stars.
-[Default is a solid black line]. See the psxy man page for more
-details.
-<P>
-When multiple data files are specified (with multiple <B>-I</B>
-statements, the last <B>G</B>, <B>S</B>, and <B>W</B> options specified
-are for subsequent files. In order to plot different files using
-different line or symbol characteristics, new sets of commands can be
-specified for each file.
-<P>
-Finally, note that there are two ways in which one may plot multiple
-data sets on the same plot. One may specify multiple sets of file arguments
-[i.e. <B>-I</B><I>[filepars:]xy_file</I>], one for each file to be
-plotted. This allows the most flexibility, including different
-one-the-fly manipulations and colors for each xy series.
-<P>
-An alternative is to utilize the "multiple segments" feature of
-<B>psxy</B>. Specify the <B>M</B> flag in the file argument list to
-invoke this feature. A single file may then contain all the data, one
-series after the next, with lines containing a single ">" and nothing
-more to delineate breaks in data segments. This is the default break
-character for psxy, and currently the only break character supported by
-mbm_xyplot. For example <B>-IM</B>:xy.dat would plot multiple data
-series in the file xy.dat whose segements were separated as in the
-following snippet:
-<P>
-1.2   3
-<BR>
-
-1.3   5
-<BR>
-
->
-<BR>
-
-0     .1
-<BR>
-
-0.1   .4
-<BR>
-
-<P>
-<DT><B>-J</B>
-
-<DD>
-<I>projection</I>[<I>/scale | /width</I>]
-<BR>
-
-Selects the map projection. By default the map projection is
-Mercator and the plot scale is chosen to fit on the selected
-page size (see <B>-P</B> option). The user may specify a
-different projection to be used, in which case the plot scale
-is still automatically chosen to fit the page. The user may
-also specify both the projection and the plot scale. If
-the projection specifying character is upper case, a plot
-width rather than a plot scale is used.
-The scale values are specified in inch/degree or in 1:xxxxx
-ratios. Plot widths are specified in inches. If the user
-specifies a plot scale such that the plot will not fit
-on the default A size page, a appropriately larger page
-size will be chosen.
-<BR>
-
-<P>
-<B>CYLINDRICAL PROJECTIONS:</B>
-<BR>
-
-<P>
-<B>-Jc</B><I>lon0/lat0/scale</I> (Cassini)
-<BR>
-
-<B>-Jm</B><I>scale</I> (Mercator)
-<BR>
-
-<B>-Joa</B><I>lon0/lat0/azimuth/scale</I> (Oblique Mercator - point and azimuth)
-<BR>
-
-<B>-Job</B><I>lon0/lat0/lon1/lat1/scale</I> (Oblique Mercator - two points)
-<BR>
-
-<B>-Joc</B><I>lon0/lat0/lonp/latp/scale</I> (Oblique Mercator - point and pole)
-<BR>
-
-<B>-Jq</B><I>lon0/scale</I> (Equidistant Cylindrical Projection (Plate Carree))
-<BR>
-
-<B>-Jt</B><I>lon0/scale</I> (TM - Transverse Mercator)
-<BR>
-
-<B>-Ju</B><I>zone/scale</I> (UTM - Universal Transverse Mercator)
-<BR>
-
-<B>-Jy</B><I>lon0/lats/scale</I> (Basic Cylindrical Projection)
-<BR>
-
-<P>
-<B>AZIMUTHAL PROJECTIONS:</B>
-<BR>
-
-<P>
-<B>-Ja</B><I>lon0/lat0/scale</I> (Lambert).
-<BR>
-
-<B>-Je</B><I>lon0/lat0/scale</I> (Equidistant).
-<BR>
-
-<B>-Jg</B><I>lon0/lat0/scale</I> (Orthographic).
-<BR>
-
-<B>-Js</B><I>lon0/lat0/scale</I> (General Stereographic)
-<BR>
-
-<P>
-<B>CONIC PROJECTIONS:</B>
-<BR>
-
-<P>
-<B>-Jb</B><I>lon0/lat0/lat1/lat2/scale</I> (Albers)
-<BR>
-
-<B>-Jl</B><I>lon0/lat0/lat1/lat2/scale</I> (Lambert)
-<BR>
-
-<P>
-<B>MISCELLANEOUS PROJECTIONS:</B>
-<BR>
-
-<P>
-<B>-Jh</B><I>lon0/scale</I> (Hammer)
-<BR>
-
-<B>-Ji</B><I>lon0/scale</I> (Sinusoidal)
-<BR>
-
-<B>-Jk</B><I>lon0/scale</I> (Eckert VI)
-<BR>
-
-<B>-Jn</B><I>lon0/scale</I> (Robinson)
-<BR>
-
-<B>-Jr</B><I>lon0/scale</I> (Winkel Tripel)
-<BR>
-
-<B>-Jw</B><I>lon0/scale</I> (Mollweide)
-<BR>
-
-<P>
-<B>NON-GEOGRAPHICAL PROJECTIONS:</B>
-<BR>
-
-<P>
-<B>-Jp</B><I>scale</I> (Linear projection for polar (theta,r) coordinates)
-<BR>
-
-<B>-Jx</B><I>x-scale</I>[<B>l|p</B><I>pow</I>][<I>/y-scale</I>[<B>l|p</B><I>pow</I>]] (Linear, log, and power scaling)
-<BR>
-
-More details can be found in the <B>psbasemap</B> manpages.
-<DT><B>-L</B>
-
-<DD>
-<I>title[:xlabel[:ylabel]]</I>
-<BR>
-
-Sets the title and the labels for the x and y axes of
-the plot. Note that a colon (:) rather than a slash (/) is
-used to separate the labels. Colons cannot be used in the
-labels themselves. If this option is not used, then a default title
-and colorscale label are provided. If the title is supplied
-alone, no x or y-axis labels will be provided.
-<DT><B>-M</B>
-
-<DD>
-A series of "miscellaneous" options are provided which are
-given as <B>-M</B> followed by a two character identifier, followed
-by any other parameters associated with that option.
-The <B>-M</B> options may be strung together separated by
-colons, e.g. "-MGQ100:GU:CA200/10", which is equivalent to
-"-MGQ -MGU -MCA200/10".
-<DT><B>-MGD</B>
-
-<DD>
-<I>gmtdef/value</I>
-<BR>
-
-Allows the user to set the <B>GMT</B> default values used as
-the plot is constructed. This command may be given repeatedly
-to set as many <B>GMT</B> defaults as required. For example, to
-set the basemap annotation font to Courier, use
-"-MGDANOT_FONT/Courier".
-<DT><B>-MGL</B>
-
-<DD>
-[<I>f</I>][<I>x</I>]<I>lon0/lat0/slat/length</I>[<I>units</I>][<I>+llabel</I>]
-<BR>
-
-Draws a simple map scale centered on <I>lon0/lat0</I>.
-Use <B>-Lf</B> to get a "fancy" scale [Default is plain].
-Use <B>-Lx</B> to specify the position in inches instead of map units.
-The scale is calculated at latitude <I>slat</I>; if the string "center" is used
-instead of a numerical value for <I>slat</I>, then the macro will set
-the scaling according to the center of the plot bounds.
-The scale length value <I>length</I> is in km 
-by default, but the units can be specified as one of e|f|k|M|n|u, where
-e = meters, f = feet, k = kilometers, M = statue miles, n = nautical miles,
-and u = US survey feet. Append <I>+l</I> to label the scale with the
-relevant units, or append <I>+l"label"</I> to set a different label string.
-<DT><B>-MGT</B>
-
-<DD>
-<I>x/y/size/angle/font/just/text</I>
-<BR>
-
-Causes a text label to plotted on the map.
-<I>size</I> is text size in points, <I>angle</I> is
-measured in degrees counter-clockwise from horizontal,
-<I>fontno</I> sets the font type, <I>justify</I> sets the alignment.
-If <I>fontno</I> starts with a leading hyphen, then
-the remainder of <I>fontno</I> is taken to be a
-textstring with the desired fontname.  See the
-<B>gmtdefaults</B> man page for names and numbers of available fonts
-(or run <B>pstext -L</B>).  The alignment
-number refers to the part of the textstring that will be mapped
-onto the (<I>x,y</I>) point: 1 = Lower Left corner,
-2 = Lower Center, 3 = Lower Right, 5 = Mid Left, 6 = Mid Center,
-7 = Mid Right, 9 = Upper Left, 10 = Upper Center,
-11 = Upper Right. This option may be given as many times as
-needed.
-<DT><B>-MGU</B>
-
-<DD>
-[<I>/dx/dy/</I>][<I>label</I>]
-<BR>
-
-Draw Unix System time stamp on plot.  User may specify where the lower left corner
-of the stamp should fall on the page relative to lower left corner of plot in inch [Default is (-0.75,-0.75)].  Optionally,
-append a label, or <B>c</B> (which will plot the command string.)
-<DT><B>-O</B>
-
-<DD>
-<I>root</I>
-<BR>
-
-Sets the root used to construct the filename of the output shellscript
-(<I>root</I>.cmd) and names of files created when the shellscript is
-run.  Normally the
-name of the input grid file or grid file list is
-used as the <I>root</I>.
-<DT><B>-P</B>
-
-<DD>
-<I>pagesize</I>
-<BR>
-
-This option sets the size of the page the plot will be centered
-on. If the user does not set the plot scale, the plot will be
-sized as large as will fit on the designated page. If the user
-sets the plot scale such that the plot will not fit on the
-designated page, a larger page will be used.
-The supported page sizes are:
-<P>
-<BR>          American ANSI sizes:
-<BR>          A     8.5 x 11.0 in.    ( 215.9 x  279.4 mm)
-<BR>          B    11.0 x 17.0 in.    ( 279.4 x  431.8 mm)
-<BR>          C    17.0 x 22.0 in.    ( 431.8 x  558.8 mm)
-<BR>          D    22.0 x 34.0 in.    ( 558.8 x  863.6 mm)
-<BR>          E    34.0 x 44.0 in.    ( 863.6 x 1117.6 mm)
-<BR>          F    28.0 x 40.0 in.    ( 711.2 x 1016.0 mm)
-<BR>          E1   44.0 x 68.0 in.    (1117.6 x 1727.2 mm)
-<P>
-<BR>          Metric ISO A sizes:
-<BR>          A0   841.0 x 1189.0 mm  (33.11 x 46.81 in.)
-<BR>          A1   594.0 x  841.0 mm  (23.39 x 33.11 in.)
-<BR>          A2   420.0 x  594.0 mm  (16.54 x 23.39 in.)
-<BR>          A3   297.0 x  420.0 mm  (11.69 x 16.54 in.)
-<BR>          A4   210.0 x  297.0 mm  ( 8.27 x 11.69 in.)
-<BR>          A5   148.0 x  210.0 mm  ( 5.83 x  8.27 in.)
-<BR>          A6   105.0 x  148.0 mm  ( 4.13 x  5.83 in.)
-<BR>          A7    74.0 x  105.0 mm  ( 2.91 x  4.13 in.)
-<BR>          A8    52.0 x   74.0 mm  ( 2.05 x  2.91 in.)
-<BR>          A9    37.0 x   52.0 mm  ( 1.46 x  2.05 in.)
-<BR>          A10   26.0 x   37.0 mm  ( 1.02 x  1.46 in.)
-<P>
-<BR>          Metric ISO B sizes:
-<BR>          B0   1000.0x 1414.0 mm  (39.37 x 55.67 in.)
-<BR>          B1   707.0 x 1000.0 mm  (27.83 x 39.37 in.)
-<BR>          B2   500.0 x  707.0 mm  (19.68 x 27.83 in.)
-<BR>          B3   353.0 x  500.0 mm  (13.90 x 19.68 in.)
-<BR>          B4   250.0 x  353.0 mm  ( 9.84 x 13.90 in.)
-<BR>          B5   176.0 x  250.0 mm  ( 6.93 x  9.84 in.)
-<BR>          B6   125.0 x  176.0 mm  ( 4.92 x  6.93 in.)
-<BR>          B7    88.0 x  125.0 mm  ( 3.46 x  4.92 in.)
-<BR>          B8    62.0 x   88.0 mm  ( 2.44 x  3.46 in.)
-<BR>          B9    44.0 x   62.0 mm  ( 1.73 x  2.44 in.)
-<BR>          B10   31.0 x   44.0 mm  ( 1.22 x  1.73 in.)
-<P>
-<BR>          Metric ISO C sizes:
-<BR>          C0   914.4 x 1300.5 mm  (36.00 x 51.20 in.)
-<BR>          C1   650.2 x  914.4 mm  (25.60 x 36.00 in.)
-<BR>          C2   457.2 x  650.2 mm  (18.00 x 25.60 in.)
-<BR>          C3   325.1 x  457.2 mm  (12.80 x 18.00 in.)
-<BR>          C4   228.6 x  325.1 mm  ( 9.00 x 12.80 in.)
-<BR>          C5   162.6 x  228.6 mm  ( 6.40 x  9.00 in.)
-<BR>          C6   114.3 x  162.6 mm  ( 4.50 x  6.40 in.)
-<BR>          C7    81.3 x  114.3 mm  ( 3.20 x  4.50 in.)
-<P>
-<TT>        </TT>  MB-System large format sizes:<BR>
-<BR>          m1  1371.6 x 1828.8 mm  (54.00 x 72.00 in.)
-<BR>          m2  1371.6 x 2133.6 mm  (54.00 x 84.00 in.)
-<BR>          m3  1371.6 x 2438.4 mm  (54.00 x 96.00 in.)
-<BR>          m4  1524.0 x 1828.8 mm  (60.00 x 72.00 in.)
-<BR>          m5  1524.0 x 2133.6 mm  (60.00 x 84.00 in.)
-<BR>          m6  1524.0 x 2438.4 mm  (60.00 x 96.00 in.)
-<P>
-The default page size is A.
-<DT><B>-Q</B>
-
-<DD>
-Normally, the output plot generation shellscript
-includes lines which execute
-a program to display the Postscript image on the screen.
-This option causes those lines to be commented out so
-that executing the shellscript produces a Postscript plot
-but does not attempt to display it on the screen.
-Alternatively, invoking the plot generation shellscript with
-a <B>-N</B> command line argument also suppresses the screen
-display of the plot.
-The program
-to be used to display the Postscript is set
-using <B>mbdefaults</B>;
-the default value can be overridden by setting the environment
-variable $MB_PS_VIEWER.
-<DT><B>-R</B>
-
-<DD>
-<I>west/east/south/north</I>
-<BR>
-
-<I>west, east, south,</I> and <I>north</I> specify the Region of interest.  To specify boundaries
-in degrees and minutes [and seconds], use the dd:mm[:ss] format.  Append <B>r</B> if lower left and upper right
-map coordinates are given instead of wesn.
-You may ask for a larger <I>w/e/s/n</I> region to have more room between the image and the axes.
-A smaller region than specified in the grdfile will result in a subset of the grid [Default is
-region given by the grdfile].
-<DT><B>-S</B>
-
-<DD>
-<I>symbol/size</I>
-<BR>
-
-Selects symbol to be used for plotting the next xy data
-file. Setting <I>symbol</I> = "N" causes line plotting.
-Choose between:
-<DT><B>-Sa</B>
-
-<DD>
-st<B>a</B>r.  <I>size</I> is radius of circumscribing circle.
-<DT><B>-Sb</B>
-
-<DD>
-<B>b</B>ar extending from <I>base</I> to y.  <I>size</I> is bar width.  By default,
-<I>base</I> = 0.  Append /<I>base</I> to change this value.  Append <B>u</B> if <I>size</I>
-is in x-units [Default is inch].
-<DT><B>-Sc</B>
-
-<DD>
-<B>c</B>ircle.  <I>size</I> is diameter of circle.
-<DT><B>-Sd</B>
-
-<DD>
-<B>d</B>iamond.  <I>size</I> is side of diamond.
-<DT><B>-Se</B>
-
-<DD>
-<B>e</B>llipse.  Direction (in degrees counterclockwise from horizontal), major_axis (in inch), and minor_axis (in inch) must be found in columns 3, 4, and 5.
-<DT><B>-Sf</B>
-
-<DD>
-<B>f</B>ault.  Give distance gap between ticks and ticklength in inch.  If gap is
-negative, it is interpreted to mean number of ticks instead.  Append <B>l</B> or <B>r</B> to draw tick on
-the left or right side of line [Default is centered].  Upper case <B>L</B> or <B>R</B> draws a triangle
-instead of line segment.
-<DT><B>-Sh</B>
-
-<DD>
-<B>h</B>exagon.  Give side in inch.
-<DT><B>-Si</B>
-
-<DD>
-<B>i</B>nverted triangle.  Give side in inch.
-<DT><B>-Sl</B>
-
-<DD>
-<B>l</B>etter or text string.  Give size in inch, and append /<I>string</I> after the size.  Note that the size is only approximate; no individual scaling
-is done for different characters.  Remember to escape special characters like *.
-<DT><B>-Sp</B>
-
-<DD>
-<B>p</B>oint.  No size needs to be specified (1 pixel is used).
-<DT><B>-Ss</B>
-
-<DD>
-<B>s</B>quare.  Give side in inch.
-<DT><B>-St</B>
-
-<DD>
-<B>t</B>riangle.  Give side in inch.
-<DT><B>-Sv</B>
-
-<DD>
-<B>v</B>ector.  Direction (in degrees counterclockwise from horizontal) and length (in inch) must be found in columns 3 and 4.  <I>size</I>,
-if present, will be interpreted as arrowwidth/headlength/headwidth (in inch) [Default is 0.03/0.12/0.1 inch].
-By default arrow attributes remains invariant to the length
-of the arrow.  To have the size of the vector scale down with decreasing size,
-append nnorm, where vectors shorter than <I>norm</I> will have their
-attributes scaled by length/<I>norm</I>.
-<DT><B>-SV</B>
-
-<DD>
-Same as <B>-Sv</B>, except azimuth (in degrees east of north) should be given instead of direction.  The azimuth will
-be mapped into an angle based on the chosen map projection (<B>-Sv</B> leaves the directions
-unchanged.)
-<DT><B>-Sx</B>
-
-<DD>
-cross.  Give length in inch.
-<DT><B>-U</B>
-
-<DD>
-<I>orientation</I>
-<BR>
-
-Normally the orientation of the plot (portrait or landscape)
-is selected automatically so as to maximize the plot scale.
-The <B>-U</B> option allows the user to set the plot orientation. If
-<I>orientation</I> = 1, a portrait plot will be produced; if
-<I>orientation</I> = 2, a landscape plot will be produced.
-<DT><B>-V</B>
-
-<DD>
-Causes <B>mbm_xyplot</B> to operate in "verbose" mode
-so that it outputs
-more information than usual.
-<DT><B>-W</B>
-
-<DD>
-<I>pen</I>
-<BR>
-
-Set pen attributes for xy plotting. See chapter 4.12 in the
-GMT Technical reference for a discussion of GMT pen values.
-[Defaults: width = 1, color = 0/0/0,
-texture = solid].
-<DT><B>-X</B>
-
-<DD>
-Normally, <B>mbm_xyplot</B> creates an executable shellscript and
-then exits.  This option will cause the shellscript to be executed
-in the background before <B>mbm_xyplot</B> exits.
-<DT><B>-Z</B>
-
-<DD>
-<B>mbm_xyplot</B> extracts the desired columns of the input data
-and creates secondary files with the xy values to be plotted.
-Normally these files are left in place by the plot shellscript
-to be used multiple times. The <B>-Z</B> option causes the
-shellscript to delete those secondary files.
-<P>
-</DL>
-<A NAME="lbAI"> </A>
-<H2>EXAMPLES</H2>
-
-Suppose we have obtained a swath sonar data file called
-sb2112_example.mb41 collected using a SeaBeam 2112 sonar.
-In order to obtain an xy plot of the center beam depth
-versus time, we first extract the time-depth xy doubles
-from the swath sonar file using <B>mblist</B>:
-<P>
-<BR> <TT>       </TT>mblist -F41 -Isb2112_example.mb41 -OmZ > mz.dat<BR>
-<P>
-Here time is in seconds from the start of the file and the
-depths are in meters, positive upward (topography rather
-than bathymetry).
-Now, we use <B>mbm_xyplot</B> to generate
-shellscripts which in turn generate plots when executed.
-First, we generate a simple black line plot:
-<P>
-<BR> <TT>       </TT>mbm_xyplot -Imz.dat -Omz<BR>
-<P>
-The above command generates an executable shellscript
-mz_line.cmd; executing this shellscript will generate a
-Postscript plot and display it on the screen.
-<P>
-Suppose we also have a sparse set of depth estimates
-in a file called sr.dat obtained
-by picking the seafloor on a seismic reflection record, and
-we wish to compare the two sets of depths. We can plot the
-swath sonar derived depths as a black line and the seismic
-derived depths as red stars as follows:
-<P>
-<BR> <TT>       </TT>mbm_xyplot -Omz_sr -Imz.dat \<BR>
-<BR> <TT>       </TT><TT>        </TT>-IG255/0/0:Sa/0.1:sr.dat<BR>
-<P>
-As an example, the contents of the plotting shellscript
-"mz.cmd" are:
-<P>
-<BR> #
-<BR> # Shellscript to create Postscript plot of data in grd file
-<BR> # Created by macro mbm_xyplot
-<BR> #
-<BR> # This shellscript created by following command line:
-<BR> # mbm_xyplot -Imz.dat -Omz
-<BR> #
-<BR> # Save existing GMT defaults
-<BR> echo Saving GMT defaults...
-<BR> gmtdefaults -L > gmtdefaults$$
-<BR> #
-<BR> # Set new GMT defaults
-<BR> echo Setting new GMT defaults...
-<BR> gmtset ANOT_FONT Helvetica
-<BR> gmtset LABEL_FONT Helvetica
-<BR> gmtset HEADER_FONT Helvetica
-<BR> gmtset ANOT_FONT_SIZE 8
-<BR> gmtset LABEL_FONT_SIZE 8
-<BR> gmtset HEADER_FONT_SIZE 10
-<BR> gmtset FRAME_WIDTH 0.074999999999999997
-<BR> gmtset TICK_LENGTH 0.074999999999999997
-<BR> gmtset PAGE_ORIENTATION LANDSCAPE
-<BR> gmtset COLOR_BACKGROUND 0/0/0
-<BR> gmtset COLOR_FOREGROUND 255/255/255
-<BR> gmtset COLOR_NAN 255/255/255
-<BR> #
-<BR> # Make xy data plot
-<BR> echo Running psxy...
-<BR> psxy mz.dat \
-<BR> <TT>       </TT>-Jx0.0011071486125582637/0.0062732342007434947 \<BR>
-<BR> <TT>       </TT>-R0/8128.99/-4382/-3306 \<BR>
-<BR> <TT>       </TT>-X1 -Y0.5 -K -V > mz.ps<BR>
-<BR> #
-# Make basemap
-<BR> echo Running psbasemap...
-<BR> psbasemap -Jx0.0011071486125582637/0.0062732342007434947 \
-<BR> <TT>       </TT>-R0/8128.99/-4382/-3306 \<BR>
-<BR> <TT>       </TT>-B500/100:."Data File mz.dat": \<BR>
-<BR> <TT>       </TT>-O -V >> mz.ps<BR>
-<BR> #
-<BR> # Delete surplus files
-<BR> echo Deleting surplus files...
-<BR> rm -f
-<BR> #
-<BR> # Reset GMT default fonts
-<BR> echo Resetting GMT fonts...
-<BR> mv gmtdefaults$$ .gmtdefaults
-<BR> #
-<BR> # Run xpsview
-<BR> echo Running xpsview in background...
-<BR> xpsview -ps a -or landscape -maxp 4m mz.ps &
-<BR> #
-<BR> # All done!
-<BR> echo All done!
-<P>
-<A NAME="lbAJ"> </A>
-<H2>ADVANCED EXAMPLES</H2>
-
-<P>
-Suppose we have a file of NMEA GGA strings logged from a GPS receiver
-whose data looks like the following:
-<P>
-filename: gps.raw:
-<P>
-<BR> $GPGGA,23.0,5427.89080,N,14600.29458,W,1,10,0.9,19.01,M,6.40,M,,*70
-<BR> $GPGGA,24.0,5427.89248,N,14600.30088,W,1,10,0.9,19.39,M,6.40,M,,*7B
-<BR> $GPGGA,25.0,5427.89424,N,14600.30713,W,1,10,0.9,19.72,M,6.40,M,,*7C
-<P>
-We can specify a comma delimited file and convert the latitude and
-longitude fields to decimal degrees on the fly with the following:
-<P>
-<BR>     mbm_xyplot -ID,:C'substr(c[5],0,3)+substr(c[5],3,length(c[5]))        /60_substr(c[3],0,2)+substr(c[3],2,length(c[3]))/60':gps.raw
-<P>
-This is about as ugly as it gets. However, it is quite
-straightforward and very handy, so let us pick this apart. The -I flag
-specifies the file to plot and its parameters. The D subfield followed
-by ',' indicates the file is comma delimited. The C subfield followed
-by the Perl expression extracts fields to plot. There are two
-expressions here, the x values, (longitude) and the x values
-(latitude) separated by an "_". In the longitude expression, the
-degree portion of the longitude, which is the 5th field (c[5]) is
-extracted and added to the minute portion of the longitude divided by
-60. The same is done with the latitude field, (c[3]).
-<P>
-Note the single quotes surrounding the C expression. These are
-required to ensure complex expressions such as these are not
-inadvertently interpreted by the shell.
-<P>
-<P>
-<P>
-<A NAME="lbAK"> </A>
-<H2>SEE ALSO</H2>
-
-<B><A HREF="mbsystem.html">mbsystem</A></B>(1), <B><A HREF="mbcontour.html">mbcontour</A></B>(1),
-<B><A HREF="mbswath.html">mbswath</A></B>(1), <B><A HREF="mbdefaults.html">mbdefaults</A></B>(1),
-<B><A HREF="mbm_grdplot.html">mbm_grdplot</A></B>(1), <B><A HREF="mbm_grd3dplot.html">mbm_grd3dplot</A></B>(1),
-<B><A HREF="mbm_plot.html">mbm_plot</A></B>(1)
-<P>
-<A NAME="lbAL"> </A>
-<H2>BUGS</H2>
-
-Please let us know.
-<P>
-
-<HR>
-<A NAME="index"> </A><H2>Index</H2>
-<DL>
-<DT><A HREF="#lbAB">NAME</A><DD>
-<DT><A HREF="#lbAC">VERSION</A><DD>
-<DT><A HREF="#lbAD">SYNOPSIS</A><DD>
-<DT><A HREF="#lbAE">DESCRIPTION</A><DD>
-<DT><A HREF="#lbAF">AUTHORSHIP</A><DD>
-<DT><A HREF="#lbAG">SIMPLE DESCRIPTION OF BASIC OPTIONS</A><DD>
-<DT><A HREF="#lbAH">COMPLETE DESCRIPTION OF OPTIONS</A><DD>
-<DT><A HREF="#lbAI">EXAMPLES</A><DD>
-<DT><A HREF="#lbAJ">ADVANCED EXAMPLES</A><DD>
-<DT><A HREF="#lbAK">SEE ALSO</A><DD>
-<DT><A HREF="#lbAL">BUGS</A><DD>
-</DL>
-<HR>
-</PRE>
-
-<CENTER><P><BR>
-Last Updated: 9 January 2015</P></CENTER>
-
-<HR>
-<P><A HREF="mbsystem_man_list.html">Return to list of MB-System manual pages...</A></P>
-<P><A HREF="mbsystem_home.html"><IMG SRC="mbsystem_logo_small.gif" BORDER=0 HEIGHT=55 WIDTH=158 ALIGN=BOTTOM></A><A HREF="mbsystem_home.html">Back
-to MB-System Home Page...</A></P>
-
-</BODY>
-</HTML>
diff --git a/src/html/mbmosaic.html b/src/html/mbmosaic.html
deleted file mode 100644
index e9b2d8b..0000000
--- a/src/html/mbmosaic.html
+++ /dev/null
@@ -1,8591 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<HTML VERSION="2.0">
-<HEAD>
-   <TITLE>MB-System Unix Manual Page: mbmosaic</TITLE>
-<!-- WEBMAGIC VERSION NUMBER="2.0.2" -->
-<!-- WEBMAGIC TRANSLATION NAME="ServerRoot" SRC="/var/www/htdocs/" DST="/" -->
-<!-- WEBMAGIC TRANSLATION NAME="ProjectRoot" SRC="./" DST="" -->
-</HEAD>
-<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#336699" VLINK="#997040" ALINK="#CC9900">
-<BODY>
-<CENTER><H3><U>MB-System Unix Manual Page</U></H3></CENTER>
-<PRE>
-<H1>mbmosaic</H1>
-Section:  MB-System 5.0  (1)<BR>Updated:  13 March 2014 <BR><A HREF="#index">Index</A>
-<HR>
-
-<A NAME="lbAB"> </A>
-<H2>NAME</H2>
-
-<B>mbmosaic</B> - Mosaic amplitude or sidescan data
-from swath mapping sonar data files.
-<P>
-<A NAME="lbAC"> </A>
-<H2>VERSION</H2>
-
-Version 5.0
-<P>
-<A NAME="lbAD"> </A>
-<H2>SYNOPSIS</H2>
-
-<B>mbmosaic</B> <B>-I</B><I>filelist</I> <B>-O</B><I>root</I>
-[<B>-A</B><I>datatype[F]</I>
-<B>-B</B><I>border</I> -C<I>clip</I> <B>-D</B><I>xdim/ydim</I>
-<B>-E</B><I>dx/dy/units[!]</I> <B>-F</B><I>priority_range[/weight]</I>
-<B>-G</B><I>gridkind</I>  <B>-J</B><I>projection</I>
-<B>-H -L</B><I>lonflip</I> <B>-M -N -P</B><I>pings</I>
-<B>-R</B><I>west/east/south/north</I> <B>-R</B><I>factor</I>
-<B>-S</B><I>speed</I> <B>-T</B><I>tension</I> <B>-U</B><I>bearing/factor[/mode]</I>
-<B>-V</B> -W<I>scale</I> <B>-X</B><I>extend</I>
-<B>-Y</B><I>priority_source</I> <B>-Z</B><I>bath_default</I>]
-<P>
-<A NAME="lbAE"> </A>
-<H2>DESCRIPTION</H2>
-
-<B>mbmosaic</B> is a utility used to mosaic amplitude or sidescan
-data contained in a set of swath sonar data files. This program
-allows users to prioritize data according to the associated grazing
-angle and according to look azimuth. Individual mosaic bin values
-can be either the value of the highest priority sample in the bin
-or the Gaussian weighted mean of the highest priority samples
-in the neighborhood of the bin (the samples used here are those
-with priorities within a specified range of the highest priority
-sample found). Users can thus construct
-mosaics which are dominantly from a particular part of the swath
-(e.g. prioritize the outer swath higher than the inner swath)
-or which are dominantly from a particular look azimuth
-(e.g. construct an east-looking mosaic by specifying a
-preferred look azimuth of 90 degrees).
-<P>
-The user must specify a file containing a list of the data files to
-be used and their data formats (<B>-I</B>), and a character string
-to be used as the root of the output filenames (<B>-O</B>). The user
-may specify the bounds of the region to be gridded (<B>-R</B>), and
-either the dimensions (<B>-D</B>) or node spacing <B>-E</B> of the grid,
-If the bounds and grid dimensions (or spacing) are not specified, the
-program will select the region encompassing all of the data in the
-input files and a grid spacing equivalent to 0.02 times the maximum
-sonar altitude. If the bounds and grid dimensions (or spacing) are not
-specified, the program will select the region encompassing all of the
-data in the input files and a grid spacing equivalent to 0.02 times the maximum
-sonar altitude. The automatically calculated grid bounds will exactly
-correspond to the smallest rectangular region including the data unless
-the user specifies a larger region using <B>-R</B><I>factor</I>. The value
-<I>factor</I> must be greater than one; if <I>factor</I> = 1.1 then the
-grid bounds will be expanded to the east and west by an amount 0.05 times
-the data bounds east-west extend and to the north and south by an amount
-0.05 times the data bounds north-south extent.
-The input data type (beam amplitude or sidescan) is specified using
-the <B>-A</B> option. Depending on the input datalist, the amplitude or
-sidescan data may be raw or corrected for variations in amplitude with
-grazing angle (see <B>mbbackangle</B> and <B>mbprocess</B>), and may be
-unfiltered or have been filtered using <B>mbfilter</B>.
-The user can also specify the range of allowable sample priorities used in
-the mosaicing (<B>-F</B>), the preferred look azimuth (<B>-U</B>), the
-maximum distance from data points that the spline interpolation is
-used (<B>-C</B>), the format of the output files, and other parameters.
-<P>
-By default, <B>mbmosaic</B> generates mosiacs in Geographic coordinates,
-meaning that position is defined in longitude and latitude using
-the WGS84 horizontal datum. The <B>-J</B> option can be used to specify
-an alternate, projected coordinate system (PCS). When a PCS is used,
-position will be defined in eastings and northings (meters) relative
-to the origin of the particular PCS. Universal Transverse Mercator
-is the most commonly used PCS in the oceanographic community, but
-<B>mbmosaic</B> supports a large number of other PCS as well. A list of
-the supported PCS's is provided at the end of this manual page.
-<P>
-Before opening an input swath data file, <B>mbmosaic</B> checks for
-an ascii file in the same directory having the same name except
-that ".inf" is appended to the end. The program assumes that this
-ascii file contains the output of the program <B>mbinfo</B> run on
-the input data file. If the ".inf" file exists, <B>mbmosaic</B> reads
-the minimum and maximum longitude and latitude bounds from the
-<B>mbinfo</B> output and compares those to the working bounds
-for the grid. If the ".inf" file indicates that none of the data
-in the input file lies inside the working grid bounds, that input
-file is skipped. This allows users to maintain a single master list
-of data files for use in all gridding without the performance penalty
-of <B>mbmosaic</B> reading through all the data files, even those
-with no relevent data. We recommend that users maintain a ".inf"
-file for each swath data file used for gridding or plotting. The
-programs <B>mbgrid</B>, <B>mbswath</B>, and <B>mbcontour</B>
-also use ".inf" files in the same fashion.
-<P>
-Usually, the internal working grid has the same boundaries as the
-output grid. However, the <B>-X</B> option
-allows the size of the internal grid to be increased so that data outside
-the grid can be used to guide the spline interpolation of data gaps which
-happen to lie at the the edge of the grid.  This is particularly important
-when adjacent grids are created which should match along the edges.
-The data input bounds are set to a region three times as large as
-the working grid in both longitude and latitude.  The program reads all
-pings which lie within the data input bounds, and accepts all data
-values with locations within the working grid.
-<P>
-The sample priorities are set according to three criteria. 
-The first criteria is set by using the <B>-Y</B> option
-to specify a file containing a list of data priorities
-as a function of apparent grazing angle (this angle is the
-arctan(x/z) where x is acrosstrack distance and z is depth, so
-that the center of the swath has an apparent grazing angle of
-zero, the port swath edge has a large negative angle, and the
-starboard swath edge has a large positive angle). The highest
-priority assigned should be one, and the lowest zero.
-<P>
-The second criteria is set by using the <B>-U</B> option to specify
-a preferred look azimuth (data on the port side of the swath have
-a look azimuth equal to the heading - 90 degrees, and data on the
-starboard side have a look azimuth equal to the heading + 90 degrees).
-The second parameter in the <B>-U</B> option is a factor (f) which
-modulates how rapidly the priority degrades away from the preferred
-look azimuth. The priority (p) is assigned as follows:
-<BR>        p = cos( f * (Ap - Aa))
-<BR>
-
-where Ap is the preferred look azimuth and Aa is the actual
-look azimuth. If f = 1.0, the priority will be 1.0
-at the preferred look azimuth and will fall to zero for look
-azimuths more than 90 degrees away from the preferred look
-azimuth. If f > 1.0, the range of nonzero priorities will shrink
-closer to the preferred look azimuth (e.g. if f = 2.0,
-nonzero priorities will be restricted to look azimuths within
-45 degrees of the preferred look azimuth). If f < 1.0, the
-range of nonzero priorities will expand (e.g. if f = 0.5, only
-look azimuths 180 degrees away from the preferred look azimuth
-will have a zero priority).
-<P>
-The third criteria is set by using the <B>-U</B> option to specify
-a preferred heading.
-The second parameter in the <B>-U</B> option is a factor (f) which
-modulates how rapidly the priority degrades away from the preferred
-heading. The priority (p) is assigned as follows:
-<BR>        p = cos( f * (Hp - Ha))
-<BR>
-
-where Hp is the preferred heading and Ha is the actual
-heading. If f = 1.0, the priority will be 1.0
-at the preferred heading and will fall to zero for heading
-more than 90 degrees away from the heading.
-If f > 1.0, the range of nonzero priorities will shrink
-closer to the preferred heading (e.g. if f = 2.0,
-nonzero priorities will be restricted to headings within
-45 degrees of the preferred heading). If f < 1.0, the
-range of nonzero priorities will expand (e.g. if f = 0.5, only
-headings 180 degrees away from the preferred heading
-will have a zero priority).
-<P>
-The priorities used in the mosaicing are found by multiplying
-the grazing angle, look azimuth, and heading priorities
-together. Of course, the priority associated with a criteria
-that is not used because it has not been specified will be
-simply 1.0.
-<P>
-The default behavior is to set each bin to the value of the highest
-priority sample found in that bin. If more than one sample has
-the same highest priority, the first such sample is used.
-If the <B>-F</B> option is used to set a range of acceptable
-priorities, then the mosaicing is done using a Gaussian weighted
-mean algorithm. The samples used are those with priorities larger
-than the highest priority found minus the range value.
-In this scheme, each sample's contribution
-to a Gaussian weighted average for each nearby grid cell
-is calculated using this weighting function:
-<BR> <TT>       </TT>W(r) = Aexp(r**2/a**2)<BR>
-<BR>
-
-where r is the distance from the center of the bin to the data point,
-a is the distance at which the weighting function falls to 1/e of its
-maximum value, and A is a normalizing factor set so that the sum of all
-the weights adds to a value of 1.  Normally, the distance a is set to be
-half the average grid point spacing, but this can be varied using the <B>-W</B>
-option.
-<P>
-If the weight parameter is used on the <B>-F</B> option then
-for weight = 0 [default] the above weight is used,
-for weight = 1 the above weight is multiplied by the sample priority,
-and for weight = 2 the above weight is multiplied by the square of the sample priority.
-Using <B>-F1/1</B> causes the priorities to be treated as weights rather than priorities.
-<P>
-If the <B>-C</B> option is used to set clipping to a value > 0, then a
-2D thin plate spline algorithm is applied to the successfully calculated
-grid values to fill in, or interpolate, gaps in the data.  New values
-are assigned only at grid points within a specified distance from
-the nearest data points (this distance is specified in terms of
-grid point spacing using the <B>-C</B> command).  Thus, small gaps
-in the data can be filled, or the whole grid can be filled in with
-a smooth interpolation.
-<P>
-The output grid will by default contain values of 99999.9 at cells
-containing no data; if the <B>-N</B> option is used then the flagging
-value used is NaN, or not-a-number.
-<P>
-The names of the output files are based on the root character string
-specified using the <B>-O</B> option. A number of grid formats are
-supported, including all of the grid formats supported by <B>GMT</B>.
-See the <B>-G</B> option below for a list of the available formats.
-If the grid is output in any of the <B>GMT</B> grid formats,
-then its filename is "root.grd", and a shellscript
-which will allow the contents of the grid to be viewed using <B>GMT</B> programs
-is also output with the filename "root.grd.cmd".  If the
-<B>-G</B><I>1</I> option is used to specify an ascii format grid, then the
-output grid filename will be "root.asc", but no plotting shellscript
-will be created.
-<P>
-A datalist file containing references to all of the swath files actually
-contibuting to the grid is also created. This file is named by adding
-a ".mb-1" suffix to the root string.
-<P>
-The <B>-M</B> option causes <B>mbmosaic</B> to output two additional
-grids, the first ("root_num.grd") being the number of high priority
-data points used within each bin, and the second ("root_sd.grd")
-being the standard deviation of the data points used within each bin.
-The <B>-M</B> option can only be used if Gaussian weighted mean
-mosaicing is enabled with the <B>-F</B> option.
-Plotting shellscripts
-called "root_num.grd.cmd" and "root_sd.grd.cmd" are also output
-if the grids are in a <B>GMT</B> grid format.
-<P>
-The <B>-J</B> option can be used to specify grids in UTM eastings
-and northings (meters) rather than in geographic coordinates
-(longitude and latitude degrees).
-<P>
-<A NAME="lbAF"> </A>
-<H2>AUTHORSHIP</H2>
-
-David W. Caress (<A HREF="mailto:caress at mbari.org">caress at mbari.org</A>)
-<BR>
-
-<BR>  Monterey Bay Aquarium Research Institute
-<BR>
-
-Dale N. Chayes (<A HREF="mailto:dale at ldeo.columbia.edu">dale at ldeo.columbia.edu</A>)
-<BR>
-
-<BR>  Lamont-Doherty Earth Observatory
-<P>
-<A NAME="lbAG"> </A>
-<H2>OPTIONS</H2>
-
-<DL COMPACT>
-<DT><B>-A</B>
-
-<DD>
-<I>datatype</I>
-<BR>
-
-Sets the type of data to be read and mosaiced.
-<BR> <TT>       </TT><I>datatype</I> = 3, amplitude data will be mosaiced.<BR>
-<BR> <TT>       </TT><I>datatype</I> = 4, sidescan data will be mosaiced.<BR>
-<BR> <TT>       </TT><I>datatype</I> = 5, flat bottom grazing angle will be mosaiced.<BR>
-<BR> <TT>       </TT><I>datatype</I> = 6, acrosstrack grazing angle will be mosaiced.<BR>
-<BR> <TT>       </TT><I>datatype</I> = 7, acrosstrack slope will be mosaiced.<BR>
-<BR>
-
-Mosaicing of bathymetry is not supported, and so <I>datatype</I> values of 1 (bathymetry)
-and 2 (topography) are not allowed. Bathymetry and topography should be gridded with
-<B>mbgrid</B>.
-If "F" is appended to <I>datatype</I>, then <B>mbmosaic</B> will attempt
-to mosaic amplitude or sidescan data that have been filtered with <B>mbfilter</B>.
-If the desired filtered data files do not exist, data input will fail and
-<B>mbmosiac</B> will exit with an error message. Filtered amplitude
-data are stored in ancilliary files ending with ".ffa", and filtered
-sidescan files end in ".ffs". Appending "F" to <I>mode</I> values of 5-7 will have no effect.
-Default: <I>datatype</I> = 4 (sidescan).
-<DT><B>-B</B>
-
-<DD>
-<I>border</I>
-<BR>
-
-Sets the border of a smoothly interpolated grid to the value <I>border</I>
-wherever no data exist, provided <I>border</I> > 0.0.
-Default: <I>border</I> = 0.0
-<DT><B>-C</B>
-
-<DD>
-<I>clip</I>
-<BR>
-
-Sets the clipping dimension for the spline interpolation. If <I>clip</I>=0
-no spline interpolation will be done.  If <I>clip</I>>0 then the spline
-interpolation will fill data gaps to a distance of <I>clip</I> times
-the grid spacing.
-Default: <I>clip</I> = 0.
-<DT><B>-D</B>
-
-<DD>
-<I>xdim/ydim</I>
-<BR>
-
-Sets the dimensions of the output grid.  This option is superceded
-if the user specifies the grid spacing with the <B>-E</B> option.
-Default:  <I>xdim</I> = <I>ydim</I> = 101.
-<DT><B>-E</B>
-
-<DD>
-<I>dx/dy/units[!]</I>
-<BR>
-
-Sets the grid cell spacing to <I>dx</I> in longitude and <I>dy</I>
-in latitude. If <I>units</I> is not specified, the <I>dx</I>
-and <I>dy</I> values are assumed to be in meters. Valid values
-for <I>units</I> include "km", "meters", and "degrees".
-If not in degrees, the grid cell spacing values are converted to
-degrees using the central latitude of the grid. If
-<I>dy</I> = 0.0, then the latitude cell spacing will be set
-equal to the longitude cell spacing (after conversion to
-degrees, if necessary).
-By default, the grid spacing is calculated from
-the grid bounds and the grid dimensions. When the user
-uses the <B>-E</B> option to set the cell spacings, the
-grid dimensions are calculated using the grid bounds and
-grid cell spacings. However, slight adjustments to the
-grid cell spacings are usually required to keep
-the grid bounds as specified. Appending an ! to the end of
-the <B>-E</B> arguments forces <B>mbmosaic</B> to use the
-exact grid cell spacing values specified by adjusting the
-grid bounds.
-Default: If neither the <B>-E</B> or <B>-D</B> options are specified,
-the program sets the grid cell spacing to be 0.02 times the maximum
-sonar altitude in the input files.
-<DT><B>-F</B>
-
-<DD>
-<I>priority_range[/weight]</I>
-<BR>
-
-Turns on Gaussian weighted mean mosaicing. The
-<I>priority_range</I> value determines which data points are
-used in the mosaicing. The minimum priority threshold for
-each bin is the highest priority value found among the
-samples in that bin minus the <I>priority_range</I> value.
-Only samples with priorities greater than this threshold
-are used in the Gaussian weighted mean mosaicing.
-The default is to simply set each bin's value equal to the
-value of the highest priority sample in that bin.
-The <I>weight</I> value, if present, causes priorities to be
-also used to weight values. A <I>weight</I> of 0 (the default) indicates
-priorities are not used as weights. A <I>weight</I> of 1
-indicates the Gaussian weight of each value is
-multiplied by its priority to get the value weight. A <I>weight</I> of 2
-indicates the Gaussian weight of each value is multiplied by the square of
-its priority to get the value weight.
-<DT><B>-G</B>
-
-<DD>
-<I>gridkind</I>
-<BR>
-
-This option sets the format of the output grid file.
-The default is to output a GMT netCDF 4-byte float grid.
-The user may specify the grid format either by using an
-identifier number, or by using the <B>GMT</B> grid format
-syntax, which allows for scaling and offsets of the data.
-<P>
-First, the simple grid format identifiers are:
-<BR> <TT>       </TT><I>gridkind</I> = 1:<TT>   </TT>ASCII table<BR>
-<BR> <TT>       </TT><I>gridkind</I> = 2:<TT>   </TT>binary file (<B>GMT</B> version 1 GRD file)<BR>
-<BR> <TT>       </TT><I>gridkind</I> = 3:<TT>   </TT>netCDF file (<B>GMT</B> version 2 GRD file)<BR>
-<BR> <TT>       </TT><I>gridkind</I> = 4:<TT>   </TT>Arc/Info and ArcView ASCII grid<BR>
-<BR> <TT>       </TT><I>gridkind</I> = 100:<TT> </TT>GMT netCDF 4-byte float format [Default]<BR>
-<BR> <TT>       </TT><I>gridkind</I> = 101:<TT> </TT>Native binary single precision floats in scanlines with leading grd header<BR>
-<BR> <TT>       </TT><I>gridkind</I> = 102:<TT> </TT>Native binary short integers in scanlines with leading grd header<BR>
-<BR> <TT>       </TT><I>gridkind</I> = 103:<TT> </TT>8-bit standard Sun rasterfile (colormap ignored)<BR>
-<BR> <TT>       </TT><I>gridkind</I> = 104:<TT> </TT>Native binary unsigned char in scanlines with leading grd header<BR>
-<BR> <TT>       </TT><I>gridkind</I> = 105:<TT> </TT>Native binary bits in scanlines with leading grd header<BR>
-<BR> <TT>       </TT><I>gridkind</I> = 106:<TT> </TT>Native binary ``surfer'' grid files<BR>
-<BR> <TT>       </TT><I>gridkind</I> = 107:<TT> </TT>netCDF 1-byte byte format<BR>
-<BR> <TT>       </TT><I>gridkind</I> = 108:<TT> </TT>netCDF 1-byte char format<BR>
-<BR> <TT>       </TT><I>gridkind</I> = 109:<TT> </TT>netCDF 2-byte int format<BR>
-<BR> <TT>       </TT><I>gridkind</I> = 110:<TT> </TT>netCDF 4-byte int format<BR>
-<BR> <TT>       </TT><I>gridkind</I> = 111:<TT> </TT>netCDF 8-byte double format<BR>
-<BR>
-
-<P>
-Second, a <B>GMT</B> grid format string has the form:
-<BR>
-
-<BR> <TT>       </TT>=id[/scale/offset[/nan]]<BR>
-<BR>
-
-where id is the <B>GMT</B> format id, and the other values
-are optional. If <I>scale</I> and <I>offset</I> are given, the
-data will be multiplied by <I>scale</I> and offset by <I>offset</I>
-prior to being output. The <I>nan</I> value sets the value used for
-"not-a-number". The <B>GMT</B> format id's for these format strings are:
-<BR> <TT>       </TT><I>id</I> = 0:<TT> </TT>GMT netCDF 4-byte float format [Default]<BR>
-<BR> <TT>       </TT><I>id</I> = 1:<TT> </TT>Native binary single precision floats in scanlines with leading grd header<BR>
-<BR> <TT>       </TT><I>id</I> = 2:<TT> </TT>Native binary short integers in scanlines with leading grd header<BR>
-<BR> <TT>       </TT><I>id</I> = 3:<TT> </TT>8-bit standard Sun rasterfile (colormap ignored)<BR>
-<BR> <TT>       </TT><I>id</I> = 4:<TT> </TT>Native binary unsigned char in scanlines with leading grd header<BR>
-<BR> <TT>       </TT><I>id</I> = 5:<TT> </TT>Native binary bits in scanlines with leading grd header<BR>
-<BR> <TT>       </TT><I>id</I> = 6:<TT> </TT>Native binary ``surfer'' grid files<BR>
-<BR> <TT>       </TT><I>id</I> = 7:<TT> </TT>netCDF 1-byte byte format<BR>
-<BR> <TT>       </TT><I>id</I> = 8:<TT> </TT>netCDF 1-byte char format<BR>
-<BR> <TT>       </TT><I>id</I> = 9:<TT> </TT>netCDF 2-byte int format<BR>
-<BR> <TT>       </TT><I>id</I> = 10:<TT>        </TT>netCDF 4-byte int format<BR>
-<BR> <TT>       </TT><I>id</I> = 11:<TT>        </TT>netCDF 8-byte double format<BR>
-<BR>
-
-Note that the following arguments are equivalent because they
-all produce a standard <B>GMT</B> netCDF 4-byte float grid:
-<BR> <TT>       </TT><B>-G</B><I>3</I><BR>
-<BR> <TT>       </TT><B>-G</B><I>100</I><BR>
-<BR> <TT>       </TT><B>-G</B><I>=0</I><BR>
-<BR>
-
-Should the user wish to produce a grid in native binary floats,
-then the following two arguments will work:
-<BR> <TT>       </TT><B>-G</B><I>101</I><BR>
-<BR> <TT>       </TT><B>-G</B><I>=1</I><BR>
-<BR>
-
-Should the user wish to produce a grid in native short int format
-with a scaling factor of 10, an offset of 32000, and a NaN value
-of 32767, then the following arguments will suffice:
-<BR>
-
-<BR> <TT>       </TT><B>-G</B><I>=2/10/32000/32767</I><BR>
-<P>
-If <I>gridkind</I> = 3 or <I>gridkind</I> >= 100,
-<B>mbgrid</B> also outputs shellscripts
-which run <B>GMT</B> programs to provide preliminary color
-fill maps of the gridded data. These shellscripts are
-generated using the <B>mbm_grdplot</B> macro.
-<P>
-If <I>gridkind</I> = 4, the output grids will be in the Arc/Info ASCII
-grid format.  Arc/Info ASCII grids use "square" bins,
-meaning that the longitude and latitude grid cell spacings must
-be identical. Thus, whenever the <I>gridkind</I> = 4 option is
-used, the <B>-E</B> option must also be used in a way which
-ensures equal grid cell spacings (see the <B>-E</B> documentation
-above).
-Default: <I>gridkind</I> = 100.
-<DT><B>-H</B>
-
-<DD>
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-<DT><B>-I</B>
-
-<DD>
-<I>datalist</I>
-<BR>
-
-Sets the filename of the file containing a list of the input swath sonar
-data files and their formats.  In the <I>datalist</I> file, each
-data file should be followed by a data format identifier, e.g.:
-<BR> <TT>       </TT>datafile1 11<BR>
-<BR> <TT>       </TT>datafile2 24<BR>
-<BR>
-
-This program uses the <B>MBIO</B> library and will read or write any swath sonar
-format supported by <B>MBIO</B>. A list of the swath sonar data formats
-currently supported by <B>MBIO</B> and their identifier values
-is given in the <B>MBIO</B> manual page.
-Default: <I>datalist</I> = datalist.mb-1
-<DT><B>-J</B>
-
-<DD>
-<I>projection</I>
-By default, <B>mbgrid</B> generates grids in Geographic coordinates,
-meaning that position is defined in longitude and latitude using
-the WGS84 geographic coordinate system.
-The <B>-J</B> option can be used to specify
-an alternate, projected coordinate system (PCS). When a PCS is used,
-position will be defined in eastings and northings (meters) relative
-to the origin of the particular PCS. Universal Transverse Mercator
-is the most commonly used PCS in the oceanographic community, but
-<B>mbgrid</B> supports a large number of other PCS's as well.
-The underlying projection functions derive from the <B>PROJ.4</B> library
-written by Gerald Evenden, then of the U.S. Geological Survey.
-<P>
-The <I>projection</I> argument for the <B>-J</B> option can be either
-a PCS identifier from the projection definition list provided at the
-end of this manual page, or simply <B>-J</B><I>U</I> to specify using
-UTM in whatever zone is appropriate for the grid bounds specified
-with the <B>-R</B> option.
-<P>
-For instance, to fully specify a particular northern UTM
-zone, set <I>projection</I> = UTMXXN where XX gives
-the UTM zone (defined from 01 to 60). As an example, a northern UTM
-zone 12 projection can be specified using <B>-J</B><I>UTM12N</I>.
-Southern UTM zones are specified as UTMXXS. The European Petroleum
-Survey Group (EPSG) has defined a large number of PCS's used worldwide
-and assigned number id's to each; one can also specify the northern
-UTM zone 12 projection using its EPSG designation,
-or <B>-J</B><I>epsg32612</I>.
-When the projected coordinate system is fully specified
-by the <B>-J</B> option, then the grid bounds may be specified using
-<B>-R</B> in either longitude and latitude or in eastings and northings.
-<P>
-Alternatively, one may indicate a UTM projection without specifying the
-zone by using <B>-J</B><I>U</I>. In this case, the
-UTM zone will be inferred from the midpoint of the
-specified longitude and latitude bounds, and then the
-longitude and latitude bounds given with the
-<B>-fR</B> option are translated to UTM eastings and northings.
-<P>
-All grids and mosaics produced by <B>MB-System</B>
-programs contain identifiers that are recognized
-by the plotting macros <B>mbm_grdplot</B>,
-<B>mbm_grd3dplot</B>, and <B>mbm_grdtiff</B>.
-These plotting macros automatically use a
-linear map projection whenever they
-encounter grids and mosaics that are already
-in a projected coordinate system. Also, the program <B>mbgrdtiff</B>
-automatically inserts the appropriate projection information into
-the GeoTIFF images it generates. As a result, images generated by
-<B>mbgrdtiff</B> will be properly georeferenced when they are imported
-into GIS software.
-<DT><B>-L</B>
-
-<DD>
-<I>lonflip</I>
-<BR>
-
-Sets the range of the longitude values returned.
-If <I>lonflip</I>=-1 then the longitude values will be in
-the range from -360 to 0 degrees. If <I>lonflip</I>=0
-then the longitude values will be in
-the range from -180 to 180 degrees. If <I>lonflip</I>=1
-then the longitude values will be in
-the range from 0 to 360 degrees.
-Default: <I>lonflip</I> = 0.
-<DT><B>-M</B>
-
-<DD>
-Causes two additional grids to be output. One is a grid containing
-the standard deviation of the data within each grid cell relative
-to the grid value, the other contains the number of data
-points in each grid cell. This option is ignored unless the
-Gaussian weighted mean mosaicing is enabled with the -F option.
-<DT><B>-N</B>
-
-<DD>
-Causes grid cells with no data and no interpolation to be set to a
-value of NaN instead of the default value of 99999.9.  The NaN value
-is expected by <B>GMT</B> programs such <B>grdview</B>.
-<DT><B>-O</B>
-
-<DD>
-<I>root</I>
-<BR>
-
-Sets the character string to be used as the root of the
-output filenames. For example, if the grid is output as a <B>GMT</B>
-version 2 GRD format (netCDF) file (the default),
-then its filename is "root.grd". If the
-<B>-G</B><I>1</I> option is used to specify an ascii format grid, then the
-output grid filename will be "root.asc". If the
-<B>-G</B><I>2</I> option is used to specify a version 1 GRD
-format (binary) grid, then the
-output grid filename will be "root.grd1". If the output grid is
-in the <B>GMT</B> version 2 GRD format, a shellscript
-which will allow the contents of the grid to viewed using <B>GMT</B> programs
-is also output with the filename "root.grd.cmd".
-<DT><B>-P</B>
-
-<DD>
-<I>pings</I>
-<BR>
-
-Sets the ping averaging of the input data. If <I>pings</I> > 0, then
-that number of input pings will be averaged to produce one output
-ping.  If <I>pings</I> = 0, then the ping averaging will automatically
-be done so that the along-track ping spacing is equal to the across-track
-beam spacing. Default: <I>pings</I> = 1.
-<DT><B>-R</B>
-
-<DD>
-<I>west/east/south/north</I>
-<BR>
-
-<I>factor</I>
-<BR>
-
-The first form sets the longitude and latitude bounds of the output grid.
-By default (if the <B>-R</B><I>west/east/south/north</I>
-option is not specified) the program will set
-the grid bounds to be the area encompassing all of the data in the
-input files. The second form (<B>-R</B><I>factor</I>) expands the automatically
-calculated bounds by the multiplicative <I>factor</I>.The value
-<I>factor</I> must be greater than one; if <I>factor</I> = 1.1 then the
-grid bounds will be expanded to the east and west by an amount 0.05 times
-the data bounds east-west extend and to the north and south by an amount
-0.05 times the data bounds north-south extent.
-If the user uses the <B>-E</B> option to set the grid spacing, then the dimensions
-will be calculated from the grid bounds and spacing. In these
-circumstances rounding errors will usually require that the eastern
-and northern bounds be adjusted to fit exactly with the
-grid dimensions and spacing.
-Default: If the <B>-R</B><I>west/east/south/north</I>
-option is not specified, the program will set
-the grid bounds to be the area encompassing all of the data in the
-input files.
-<DT><B>-S</B>
-
-<DD>
-<I>speed</I>
-<BR>
-
-Sets the minimum speed in km/hr (5.5 kts ~ 10 km/hr) allowed in
-the input data; pings associated with a smaller ship speed will not be
-output. Default: <I>speed</I> = 0.
-<DT><B>-T</B>
-
-<DD>
-<I>tension</I>
-<BR>
-
-Sets the <I>tension</I> value used in the thin plate spline interpolation.
-A <I>tension</I> of 0 gives a minimum curvature surface with free edges;
-this is a pure Laplacian solution. A nonzero <I>tension</I> tends to
-suppress spurious oscillations and flatten
-the interpolation toward the edges; a <I>tension</I> of infinity
-yields a pure spline solution. The <I>tension</I> must be zero or
-greater.
-Default: <I>tension</I> = 1.0e10 (pure spline solution).
-<DT><B>-U</B>
-
-<DD>
-<I>bearing/factor[/mode]</I>
-<BR>
-
-Enables prioritizing data points according to their look azimuth
-or to the platform heading at ping time.
-<P>
-If <I>mode</I> = 0 or is
-absent, then the look azimuth criteria is applied, with <I>bearing</I>
-being interpreted as the desired look azimuth. Data on the port side
-of the swath have a look azimuth equal to the heading - 90 degrees,
-and data on the starboard side have a look azimuth equal to the
-heading + 90 degrees). The <I>factor</I> value
-modulates how rapidly the priority degrades away from the preferred
-look azimuth. The priority (p) for a data point is assigned as follows:
-<BR>        p = cos(f * (Ap - Aa))
-<BR>
-
-when -90 < (f * (Ap - Aa)) < 90 and
-<BR>        p = 0
-<BR>
-
-otherwise, where f = <I>factor</I>, Ap = <I>bearing</I>, and Aa is the
-actual look azimuth of the data point.
-If <I>factor</I> = 1.0, the priority will be 1.0
-at <I>bearing</I> and will fall to zero for look
-azimuths more than 90 degrees away from <I>bearing</I>.
-If <I>factor</I> > 1.0, the range of nonzero priorities will shrink
-closer to <I>bearing</I> (e.g. if <I>factor</I> = 2.0,
-nonzero priorities will be restricted to look azimuths within
-45 degrees of <I>bearing</I>). If <I>factor</I> < 1.0, the
-range of nonzero priorities will expand (e.g. if <I>factor</I> = 0.5, only
-look azimuths 180 degrees away from <I>bearing</I>
-will have a zero priority).
-<P>
-If <I>mode</I> = 1 then the heading criteria is applied, with <I>bearing</I>
-being interpreted as the desired heading. The <I>factor</I> value
-modulates how rapidly the priority degrades away from the preferred
-heading. The priority (p) for a data point is assigned as follows:
-<BR>        p = cos(f * (Hp - Ha))
-<BR>
-
-when -90 < (f * (Hp - Ha)) < 90 and
-<BR>        p = 0
-<BR>
-
-otherwise, where f = <I>factor</I>, Ap = <I>bearing</I>, and Aa is the
-actual heading of the data point.
-If <I>factor</I> = 1.0, the priority will be 1.0
-at <I>bearing</I> and will fall to zero for headings
-more than 90 degrees away from <I>bearing</I>.
-If <I>factor</I> > 1.0, the range of nonzero priorities will shrink
-closer to <I>bearing</I> (e.g. if <I>factor</I> = 2.0,
-nonzero priorities will be restricted to headings within
-45 degrees of <I>bearing</I>). If <I>factor</I> < 1.0, the
-range of nonzero priorities will expand (e.g. if <I>factor</I> = 0.5, only
-headings 180 degrees away from <I>bearing</I>
-will have a zero priority).
-<DT><B>-V</B>
-
-<DD>
-Normally, <B>mbmosaic</B> prints out information regarding its
-controlling parameters during execution; the
-<B>-V</B> option causes the program to also print out statements
-indicating its progress.
-<DT><B>-W</B>
-
-<DD>
-<I>scale</I>
-<BR>
-
-Sets the width of the gaussian weighting function in terms of
-the grid spacing.  The distance to the 1/e point of the weighting
-function is given by half of the grid spacing times <I>scale</I>.
-Default: <I>scale</I> = 1.0
-<DT><B>-X</B>
-
-<DD>
-<I>extend</I>
-<BR>
-
-Extends the size of the internal grid so that the output grid is a
-subset from the center of a larger grid.   This allows data outside
-the output grid to guide the spline interpolation of data gaps which
-happen to lie at the the edge of the output grid.  The amount of
-extension is <I>extend</I> times the grid width/height to each side.
-Thus, if <I>extend</I>=1.0, then the internal grid will have dimensions
-three times the output grid.
-Default: <I>extend</I> = 0.0
-<DT><B>-Y</B>
-
-<DD>
-<I>priority_source</I>
-<BR>
-
-Enables priortization of data points based on their apparent
-grazing angle (this angle is arctan(x/z) where x is acrosstrack distance
-and z is sonar altitude, so
-that the center of the swath has an apparent grazing angle of
-zero, the port swath edge has a large negative angle, and the
-starboard swath edge has a large positive angle). A number of predefined
-priority tables are available and can be accessed by setting <I>priority_source</I>
-to a number from 1 to 8. These priority tables include:
-<P>
-<P>
-<I>priority_source</I> = 1:
-<BR>
-
-<BR>      Angle (deg)  Priority
-<BR>      ---------------------
-<BR> <TT>       </TT>  -60          1.0<BR>
-<BR> <TT>       </TT>    0          0.0<BR>
-<BR> <TT>       </TT>   60          1.0<BR>
-<P>
-<P>
-<I>priority_source</I> = 2:
-<BR>
-
-<BR>      Angle (deg)  Priority
-<BR>      ---------------------
-<BR> <TT>       </TT>  -67          1.0<BR>
-<BR> <TT>       </TT>    0          0.0<BR>
-<BR> <TT>       </TT>   67          1.0<BR>
-<P>
-<P>
-<I>priority_source</I> = 3:
-<BR>
-
-<BR>      Angle (deg)  Priority
-<BR>      ---------------------
-<BR> <TT>       </TT>  -75          1.0<BR>
-<BR> <TT>       </TT>    0          0.0<BR>
-<BR> <TT>       </TT>   75          1.0<BR>
-<P>
-<P>
-<I>priority_source</I> = 4:
-<BR>
-
-<BR>      Angle (deg)  Priority
-<BR>      ---------------------
-<BR> <TT>       </TT>  -85          1.0<BR>
-<BR> <TT>       </TT>    0          0.0<BR>
-<BR> <TT>       </TT>   85          1.0<BR>
-<P>
-<P>
-<I>priority_source</I> = 5:
-<BR>
-
-<BR>      Angle (deg)  Priority
-<BR>      ---------------------
-<BR> <TT>       </TT>  -60          0.0<BR>
-<BR> <TT>       </TT>    0          1.0<BR>
-<BR> <TT>       </TT>   60          0.0<BR>
-<P>
-<P>
-<I>priority_source</I> = 6:
-<BR>
-
-<BR>      Angle (deg)  Priority
-<BR>      ---------------------
-<BR> <TT>       </TT>  -67          0.0<BR>
-<BR> <TT>       </TT>    0          1.0<BR>
-<BR> <TT>       </TT>   67          0.0<BR>
-<P>
-<P>
-<I>priority_source</I> = 7:
-<BR>
-
-<BR>      Angle (deg)  Priority
-<BR>      ---------------------
-<BR> <TT>       </TT>  -75          0.0<BR>
-<BR> <TT>       </TT>    0          1.0<BR>
-<BR> <TT>       </TT>   75          0.0<BR>
-<P>
-<P>
-<I>priority_source</I> = 8:
-<BR>
-
-<BR>      Angle (deg)  Priority
-<BR>      ---------------------
-<BR> <TT>       </TT>  -85          0.0<BR>
-<BR> <TT>       </TT>    0          1.0<BR>
-<BR> <TT>       </TT>   85          0.0<BR>
-<P>
-<P>
-Alternatively, if <I>priority_source</I> specifies a file name, then the data
-priority table will be read from this file.
-The priority file should contain two columns: apparent grazing angles
-in degrees from vertical followed by data priority values between 0.0
-and 1.0. The first line of
-the file should contain the minimum, or port-most grazing angle
-followed by the associated priority. The following lines
-should contain increasingly large grazing angles (and associated
-priorities) up to the maximum, or starboard-most, grazing angle.
-The highest priority assigned should be one, and the lowest zero.
-Priorities for grazing angles less than the minimum or greater
-than the maximum will be zero. See the examples below for a
-further explanation of the use of <I>priority_source</I>.
-<DT><B>-Z</B>
-
-<DD>
-<I>bath_default</I>
-<BR>
-
-Sets the default depth used for calculating grazing angles for
-amplitude or sidescan values where depths are not available.
-Default: <I>scale</I> = 1000.0
-</DL>
-<A NAME="lbAH"> </A>
-<H2>EXAMPLES</H2>
-
-Suppose you want to mosaic some SeaBeam 2112 sidescan data
-in six data files over a region with longitude
-bounds of 113.4833E to 115.4333E and latitude bounds
-of 32.1166S to 31.5500S, and you would like a 100 m grid spacing.
-First, create a datalist file using a text editor which contains the
-data filenames followed by the appropriate format identifier:
-<P>
-<BR> <TT>       </TT>kn_perth_01.mb41 41<BR>
-<BR> <TT>       </TT>kn_perth_05.mb41 41<BR>
-<BR> <TT>       </TT>kn_perth_09.mb41 41<BR>
-<BR> <TT>       </TT>kn_perth_13.mb41 41<BR>
-<BR> <TT>       </TT>kn_perth_17.mb41 41<BR>
-<BR> <TT>       </TT>kn_perth_03.mb41 41<BR>
-<P>
-The nadir region of the sidescan swath is generally of little
-use because it is dominated by specular reflection rather
-than backscatter. In order to allow <B>mbmosaic</B> to
-preferentially use data from the outer swath, where possible,
-create another file containing a list of data priority as
-a function of apparent grazing angle:
-<P>
-<BR> <TT>       </TT>-60.0 0.2<BR>
-<BR> <TT>       </TT>-45.0 1.0<BR>
-<BR> <TT>       </TT>-15.0 0.8<BR>
-<BR> <TT>       </TT>-14.9 0.1<BR>
-<BR> <TT>       </TT>14.9 0.1<BR>
-<BR> <TT>       </TT>15.0 0.8<BR>
-<BR> <TT>       </TT>45.0 1.0<BR>
-<BR> <TT>       </TT>60.0 0.2<BR>
-<P>
-Here the negative angles denote the port side of the swath and
-the positive angles denote the starboard side of the swath.
-The priorities are linearly interpolated between the discreet
-angle/priority pairs.
-Note that the nadir region (angles less than +/- 15 degrees)
-has low priority, and that the highest priority is given to
-angles of 45 degrees. No data with angle magnitudes greater
-than 60 degrees will be used.
-<P>
-Then, run <B>mbmosaic</B> as follows:
-<BR> <TT>       </TT>mbmosaic -Idatalist \<BR>
-<BR> <TT>       </TT><TT>        </TT>-R114.1333/114.7833/-32.1166/-31.55 \<BR>
-<BR> <TT>       </TT><TT>        </TT>-A4 -E100/100/meters -N \<BR>
-<BR> <TT>       </TT><TT>        </TT>-Yangle_priority.dat -F0.10 -C10 \<BR>
-<BR> <TT>       </TT><TT>        </TT>-Operth_ss -V<BR>
-<P>
-The <B>-E</B> option specifies grid spacings of 100 meters in
-both the longitude and latitude; the dimensions of the output
-grid are calculated according by <B>mbmosaic</B>. The <B>-F</B>
-option enables Gaussian weighted mean mosaicing and the priority
-range of 0.10 means that for each bin, all data with priorities
-within 0.1 of the highest priority will be used.
-By specifying a clipping dimension of 10 we cause small gaps in
-the mosaic to be filled in through spine interpolation .
-The output looks like:
-<P>
-<BR> Program mbmosaic
-<BR> Version $Id: mbmosaic.1 2172 2014-03-14 07:28:54Z caress $
-<BR> MB-system Version 4.5
-<P>
-<BR> MBMOSAIC Parameters:
-<BR> List of input files: datalist
-<BR> Output fileroot:     perth_ss
-<BR> Input Data Type:     Sidescan
-<BR> Grid projection: Geographic
-<BR> Grid dimensions: 616 629
-<BR> Grid bounds:
-<BR>   Longitude:  114.1333  114.7833
-<BR>   Latitude:   -32.1166  -31.5500
-<BR> Working grid dimensions: 616 629
-<BR> Working Grid bounds:
-<BR>   Longitude:  114.1333  114.7833
-<BR>   Latitude:   -32.1166  -31.5500
-<BR> Longitude interval: 0.001057 degrees or 100.051035 m
-<BR> Latitude interval:  0.000902 degrees or 100.042679 m
-<BR> Specified Longitude interval: 100.000000 meters
-<BR> Specified Latitude interval:  100.000000 meters
-<BR> Input data bounds:
-<BR>   Longitude:  113.4833  115.4333
-<BR>   Latitude:   -32.6832  -30.9834
-<BR> Mosaicing algorithm:
-<BR>   Average of highest weighted pixels
-<BR>   Pixel weighting range: 0.100000
-<BR>   Pixels weighted by look azimuth
-<BR>   Preferred look azimuth: 90.000000
-<BR>   Look azimuth factor:    2.000000
-<BR>   Spline interpolation applied with clipping dimension: 10
-<BR>   Spline tension (range 0.0 to infinity): 10000000000.000000
-<BR> Grid format 3:  GMT version 2 grd (netCDF)
-<BR> NaN values used to flag regions with no data
-<BR> MBIO parameters:
-<BR>   Ping averaging:       1
-<BR>   Longitude flipping:   1
-<BR>   Speed minimum:       0.0 km/hr
-<P>
-<BR> 330814 data points processed in kn_perth_01.mb41
-<BR> 239709 data points processed in kn_perth_05.mb41
-<BR> 234034 data points processed in kn_perth_09.mb41
-<BR> 310066 data points processed in kn_perth_13.mb41
-<BR> 297318 data points processed in kn_perth_17.mb41
-<BR> 336504 data points processed in kn_perth_03.mb41
-<P>
-<BR> 1748445 total data points processed in highest weight pass
-<P>
-<BR> 330814 data points processed in kn_perth_01.mb41
-<BR> 239709 data points processed in kn_perth_05.mb41
-<BR> 234034 data points processed in kn_perth_09.mb41
-<BR> 310066 data points processed in kn_perth_13.mb41
-<BR> 297318 data points processed in kn_perth_17.mb41
-<BR> 336504 data points processed in kn_perth_03.mb41
-<P>
-<BR> 1748445 total data points processed in averaging pass
-<P>
-<BR> Making raw grid...
-<P>
-<BR> Doing spline interpolation with 86414 data points...
-<P>
-<BR> Total number of bins:            387464
-<BR> Bins set using data:             86414
-<BR> Bins set using interpolation:    58051
-<BR> Bins not set:                    242999
-<BR> Maximum number of data in a bin: 121
-<BR> Minimum value:   -6573.12   Maximum value:   97704.64
-<BR> Minimum sigma:    4.50125   Maximum sigma: 42979.49567
-<P>
-<BR> Outputting results...
-<P>
-<BR> executing mbm_grdplot...
-<BR> Running grdhisteq...
-<P>
-<BR> Program Status:
-<BR> --------------
-<P>
-<BR>   Plot Style:
-<BR>     Color Fill
-<BR>     Horizontal Color Scale
-<P>
-<BR>   Input Files:
-<BR>     Data GRD File:            perth_ss.grd
-<BR>     Intensity GRD List File:
-<P>
-<BR>   Output Files:
-<BR>     Output plot name root:    perth_ss.grd
-<BR>     Color palette table:      perth_ss.grd.cpt
-<BR>     Plotting shellscript:     perth_ss.grd.cmd
-<BR>     Plot file:                perth_ss.grd.ps
-<P>
-<BR>   Plot Attributes:
-<BR>     Plot width:               6.5000
-<BR>     Plot height:              6.6369
-<BR>     Page size:                a
-<BR>     Page width:               8.5
-<BR>     Page height:              11
-<BR>     Projection:               -Jm10
-<BR>     Axes annotation:          10m/10m
-<BR>     Orientation:              portrait
-<BR>     Number of colors:         11
-<BR>     Color Palette:            Grayscale
-<BR>     Colors reversed
-<P>
-<BR>   Grid Data Attributes:
-<BR>     Longitude min max:         114.1330   114.7830
-<BR>     Latitude min max:          -32.1166   -31.5500
-<BR>     Data min max:                 -6573   9.77e+04
-<P>
-<BR>   Primary Grid Plotting Controls:
-<BR>     Color start datum:        -12500.000000
-<BR>     Color end datum:          112500.000000
-<BR>     Histogram stretch applied to color palette
-<P>
-<BR>   GMT Default Values Reset in Script:
-<BR>     PAPER_WIDTH               8.5
-<BR>     ANOT_FONT                 Helvetica
-<BR>     LABEL_FONT                Helvetica
-<BR>     HEADER_FONT               Helvetica
-<BR>     ANOT_FONT_SIZE            8
-<BR>     LABEL_FONT_SIZE           8
-<BR>     HEADER_FONT_SIZE          10
-<BR>     FRAME_WIDTH               0.074999999999999997
-<BR>     TICK_LENGTH               0.074999999999999997
-<BR>     PAGE_ORIENTATION          LANDSCAPE
-<BR>     COLOR_BACKGROUND          0/0/0
-<BR>     COLOR_FOREGROUND          255/255/255
-<BR>     COLOR_NAN                 255/255/255
-<P>
-<BR> --------------
-<P>
-<BR> Plot generation shellscript <perth_ss.grd.cmd> created.
-<P>
-<BR> Instructions:
-<BR>   Execute <perth_ss.grd.cmd> to generate
-<BR>        Postscript plot <perth_ss.grd.ps>.
-<BR>   Executing <perth_ss.grd.cmd> also invokes
-<BR>        xpsview to view the plot on the screen.
-<P>
-<BR> --------------
-<P>
-<P>
-<BR> Done.
-<P>
-The names of the output files are based on the root character string
-specified using the <B>-O</B> option.  Since the grid is output as a netCDF
-GRD format file, its filename is "perth_ss.grd"; a shellscript
-which will allow the contents of the grid to viewed using <B>GMT</B> programs
-is also output with the filename "perth_ss.grd.cmd".
-<P>
-Suppose that one wants to produce a mosaic composed only of data
-with a more or less eastward look azimuth. Then add the <B>-U</B>
-option with a preferred azimuth of 90 degrees. A look azimuth
-factor of 2.0 will cause <B>mbmosaic</B> to reject any data with
-look azimuths outside a range of 45 to 135 degrees.
-The following will suffice:
-<BR> <TT>       </TT>mbmosaic -Idatalist \<BR>
-<BR> <TT>       </TT><TT>        </TT>-R114.1333/114.7833/-32.1166/-31.55 \<BR>
-<BR> <TT>       </TT><TT>        </TT>-A4 -E100/100/meters -N \<BR>
-<BR> <TT>       </TT><TT>        </TT>-Yangle_priority.dat -F0.10 -C10 \<BR>
-<BR> <TT>       </TT><TT>        </TT>-Operth_ss -U90/2.0 -V<BR>
-<P>
-<A NAME="lbAI"> </A>
-<H2>SEE ALSO</H2>
-
-<B><A HREF="mbsystem.html">mbsystem</A></B>(1), <B><A HREF="mbgrid.html">mbgrid</A></B>(1), <B><A HREF="mbm_grid.html">mbm_grid</A></B>(1), <B><A HREF="mbm_grd2arc.html">mbm_grd2arc</A></B>(1)
-<P>
-<A NAME="lbAJ"> </A>
-<H2>BUGS</H2>
-
-The options for this program have grown a bit complicated.
-If you have other problems, please let us know.
-<P>
-<P>
-<A NAME="lbAK"> </A>
-<H2>APPENDIX 1: PROJECTED COORDINATE SYSTEM IDENTIFIERS</H2>
-
-The following is a list of the projected coordinate systems (PCS's)
-that are supported by MB-System. The full PCS definitions are
-found in the file mbsystem/share/Projections.dat. These definitions
-are in the <B>PROJ.4</B> format and derive from the <B>PROJ.4</B>
-4.6.1 distribution obtained from <A HREF="http://trac.osgeo.org/proj/">http://trac.osgeo.org/proj/</A>
-in September 2008. The proj library source code has been
-incorporated unchanged into the MB-System package.
-<P>
-The first item on each line is the PCS identifier inside brackets, such
-as <UTM10N> or <epsg32749>. To specify using one of these PCS's, use
-the <B>-J</B> option, e.g. <B>-J</B><I>UTM10N</I> or <B>-J</B><I>epsg32749</I>.
-<P>
-<BR> ---------------------------------------------------------
-<BR> Standard Universal Transverse Mercator (UTM)
-<BR>     and Universal Polar Stereographic (UPS)
-<BR>     projected coordinate systems for MB-System
-<BR> ---------------------------------------------------------
-<P>
-<BR> <UTM01N> : WGS 84 / UTM zone 1N
-<BR> <UTM02N> : WGS 84 / UTM zone 2N
-<BR> <UTM03N> : WGS 84 / UTM zone 3N
-<BR> <UTM04N> : WGS 84 / UTM zone 4N
-<BR> <UTM05N> : WGS 84 / UTM zone 5N
-<BR> <UTM06N> : WGS 84 / UTM zone 6N
-<BR> <UTM07N> : WGS 84 / UTM zone 7N
-<BR> <UTM08N> : WGS 84 / UTM zone 8N
-<BR> <UTM09N> : WGS 84 / UTM zone 9N
-<BR> <UTM10N> : WGS 84 / UTM zone 10N
-<BR> <UTM11N> : WGS 84 / UTM zone 11N
-<BR> <UTM12N> : WGS 84 / UTM zone 12N
-<BR> <UTM13N> : WGS 84 / UTM zone 13N
-<BR> <UTM14N> : WGS 84 / UTM zone 14N
-<BR> <UTM15N> : WGS 84 / UTM zone 15N
-<BR> <UTM16N> : WGS 84 / UTM zone 16N
-<BR> <UTM17N> : WGS 84 / UTM zone 17N
-<BR> <UTM18N> : WGS 84 / UTM zone 18N
-<BR> <UTM19N> : WGS 84 / UTM zone 19N
-<BR> <UTM20N> : WGS 84 / UTM zone 20N
-<BR> <UTM21N> : WGS 84 / UTM zone 21N
-<BR> <UTM22N> : WGS 84 / UTM zone 22N
-<BR> <UTM23N> : WGS 84 / UTM zone 23N
-<BR> <UTM24N> : WGS 84 / UTM zone 24N
-<BR> <UTM25N> : WGS 84 / UTM zone 25N
-<BR> <UTM26N> : WGS 84 / UTM zone 26N
-<BR> <UTM27N> : WGS 84 / UTM zone 27N
-<BR> <UTM28N> : WGS 84 / UTM zone 28N
-<BR> <UTM29N> : WGS 84 / UTM zone 29N
-<BR> <UTM30N> : WGS 84 / UTM zone 30N
-<BR> <UTM31N> : WGS 84 / UTM zone 31N
-<BR> <UTM32N> : WGS 84 / UTM zone 32N
-<BR> <UTM33N> : WGS 84 / UTM zone 33N
-<BR> <UTM34N> : WGS 84 / UTM zone 34N
-<BR> <UTM35N> : WGS 84 / UTM zone 35N
-<BR> <UTM36N> : WGS 84 / UTM zone 36N
-<BR> <UTM37N> : WGS 84 / UTM zone 37N
-<BR> <UTM38N> : WGS 84 / UTM zone 38N
-<BR> <UTM39N> : WGS 84 / UTM zone 39N
-<BR> <UTM40N> : WGS 84 / UTM zone 40N
-<BR> <UTM41N> : WGS 84 / UTM zone 41N
-<BR> <UTM42N> : WGS 84 / UTM zone 42N
-<BR> <UTM43N> : WGS 84 / UTM zone 43N
-<BR> <UTM44N> : WGS 84 / UTM zone 44N
-<BR> <UTM45N> : WGS 84 / UTM zone 45N
-<BR> <UTM46N> : WGS 84 / UTM zone 46N
-<BR> <UTM47N> : WGS 84 / UTM zone 47N
-<BR> <UTM48N> : WGS 84 / UTM zone 48N
-<BR> <UTM49N> : WGS 84 / UTM zone 49N
-<BR> <UTM50N> : WGS 84 / UTM zone 50N
-<BR> <UTM51N> : WGS 84 / UTM zone 51N
-<BR> <UTM52N> : WGS 84 / UTM zone 52N
-<BR> <UTM53N> : WGS 84 / UTM zone 53N
-<BR> <UTM54N> : WGS 84 / UTM zone 54N
-<BR> <UTM55N> : WGS 84 / UTM zone 55N
-<BR> <UTM56N> : WGS 84 / UTM zone 56N
-<BR> <UTM57N> : WGS 84 / UTM zone 57N
-<BR> <UTM58N> : WGS 84 / UTM zone 58N
-<BR> <UTM59N> : WGS 84 / UTM zone 59N
-<BR> <UTM60N> : WGS 84 / UTM zone 60N
-<BR> <UTM01S> : WGS 84 / UTM zone 1S
-<BR> <UTM02S> : WGS 84 / UTM zone 2S
-<BR> <UTM03S> : WGS 84 / UTM zone 3S
-<BR> <UTM04S> : WGS 84 / UTM zone 4S
-<BR> <UTM05S> : WGS 84 / UTM zone 5S
-<BR> <UTM06S> : WGS 84 / UTM zone 6S
-<BR> <UTM07S> : WGS 84 / UTM zone 7S
-<BR> <UTM08S> : WGS 84 / UTM zone 8S
-<BR> <UTM09S> : WGS 84 / UTM zone 9S
-<BR> <UTM10S> : WGS 84 / UTM zone 10S
-<BR> <UTM11S> : WGS 84 / UTM zone 11S
-<BR> <UTM12S> : WGS 84 / UTM zone 12S
-<BR> <UTM13S> : WGS 84 / UTM zone 13S
-<BR> <UTM14S> : WGS 84 / UTM zone 14S
-<BR> <UTM15S> : WGS 84 / UTM zone 15S
-<BR> <UTM16S> : WGS 84 / UTM zone 16S
-<BR> <UTM17S> : WGS 84 / UTM zone 17S
-<BR> <UTM18S> : WGS 84 / UTM zone 18S
-<BR> <UTM19S> : WGS 84 / UTM zone 19S
-<BR> <UTM20S> : WGS 84 / UTM zone 20S
-<BR> <UTM21S> : WGS 84 / UTM zone 21S
-<BR> <UTM22S> : WGS 84 / UTM zone 22S
-<BR> <UTM23S> : WGS 84 / UTM zone 23S
-<BR> <UTM24S> : WGS 84 / UTM zone 24S
-<BR> <UTM25S> : WGS 84 / UTM zone 25S
-<BR> <UTM26S> : WGS 84 / UTM zone 26S
-<BR> <UTM27S> : WGS 84 / UTM zone 27S
-<BR> <UTM28S> : WGS 84 / UTM zone 28S
-<BR> <UTM29S> : WGS 84 / UTM zone 29S
-<BR> <UTM30S> : WGS 84 / UTM zone 30S
-<BR> <UTM31S> : WGS 84 / UTM zone 31S
-<BR> <UTM32S> : WGS 84 / UTM zone 32S
-<BR> <UTM33S> : WGS 84 / UTM zone 33S
-<BR> <UTM34S> : WGS 84 / UTM zone 34S
-<BR> <UTM35S> : WGS 84 / UTM zone 35S
-<BR> <UTM36S> : WGS 84 / UTM zone 36S
-<BR> <UTM37S> : WGS 84 / UTM zone 37S
-<BR> <UTM38S> : WGS 84 / UTM zone 38S
-<BR> <UTM39S> : WGS 84 / UTM zone 39S
-<BR> <UTM40S> : WGS 84 / UTM zone 40S
-<BR> <UTM41S> : WGS 84 / UTM zone 41S
-<BR> <UTM42S> : WGS 84 / UTM zone 42S
-<BR> <UTM43S> : WGS 84 / UTM zone 43S
-<BR> <UTM44S> : WGS 84 / UTM zone 44S
-<BR> <UTM45S> : WGS 84 / UTM zone 45S
-<BR> <UTM46S> : WGS 84 / UTM zone 46S
-<BR> <UTM47S> : WGS 84 / UTM zone 47S
-<BR> <UTM48S> : WGS 84 / UTM zone 48S
-<BR> <UTM49S> : WGS 84 / UTM zone 49S
-<BR> <UTM50S> : WGS 84 / UTM zone 50S
-<BR> <UTM51S> : WGS 84 / UTM zone 51S
-<BR> <UTM52S> : WGS 84 / UTM zone 52S
-<BR> <UTM53S> : WGS 84 / UTM zone 53S
-<BR> <UTM54S> : WGS 84 / UTM zone 54S
-<BR> <UTM55S> : WGS 84 / UTM zone 55S
-<BR> <UTM56S> : WGS 84 / UTM zone 56S
-<BR> <UTM57S> : WGS 84 / UTM zone 57S
-<BR> <UTM58S> : WGS 84 / UTM zone 58S
-<BR> <UTM59S> : WGS 84 / UTM zone 59S
-<BR> <UTM60S> : WGS 84 / UTM zone 60S
-<BR> <UPSN> : WGS 84 / UPS North
-<BR> <UPSS> : WGS 84 / UPS South
-<P>
-<BR> ---------------------------------------------------------
-<BR> Listing of State Plane North American Datum Zones
-<BR> ---------------------------------------------------------
-<BR>   MB-System projection ids are the zone number
-<BR>   prefixed by either "nad27sp" or "nad83sp"
-<BR> ----------------------------------------------
-<BR>                                NGS zone number
-<BR> State and zone                  1927     1983
-<BR> ----------------------------------------------
-<BR> Alabama east ..................  101      101
-<BR> Alabama west ..................  102      102
-<BR> Alaska zone no. 1 ............. 5001     5001
-<BR> Alaska zone no. 2 ............. 5002     5002
-<BR> Alaska zone no. 3 ............. 5003     5003
-<BR> Alaska zone no. 4 ............. 5004     5004
-<BR> Alaska zone no. 5 ............. 5005     5005
-<BR> Alaska zone no. 6 ............. 5006     5006
-<BR> Alaska zone no. 7 ............. 5007     5007
-<BR> Alaska zone no. 8 ............. 5008     5008
-<BR> Alaska zone no. 9 ............. 5009     5009
-<BR> Alaska zone no. 10 ............ 5010     5010
-<BR> American Samoa ................ 5300
-<BR> Arizona central ...............  202      202
-<BR> Arizona east ..................  201      201
-<BR> Arizona west ..................  203      203
-<BR> Arkansas north ................  301      301
-<BR> Arkansas south ................  302      302
-<BR> California I ..................  401      401
-<BR> California II .................  402      402
-<BR> California III ................  403      403
-<BR> California IV .................  404      404
-<BR> California V ..................  405      405
-<BR> California VI .................  406      406
-<BR> California VII ................  407
-<BR> Colorado central ..............  502      502
-<BR> Colorado north ................  501      501
-<BR> Colorado south ................  503      503
-<BR> Connecticut ...................  600      600
-<BR> Delaware ......................  700      700
-<BR> Florida east ..................  901      901
-<BR> Florida north .................  903      903
-<BR> Florida west ..................  902      902
-<BR> Georgia east .................. 1001     1001
-<BR> Georgia west .................. 1002     1002
-<BR> Guam Island ................... 5400
-<BR> Hawaii 1 ...................... 5101     5101
-<BR> Hawaii 2 ...................... 5102     5102
-<BR> Hawaii 3 ...................... 5103     5103
-<BR> Hawaii 4 ...................... 5104     5104
-<BR> Hawaii 5 ...................... 5105     5105
-<BR> Idaho central ................. 1102     1102
-<BR> Idaho east .................... 1101     1101
-<BR> Idaho west .................... 1103     1103
-<BR> Illinois east ................. 1201     1201
-<BR> Illinois west ................. 1202     1202
-<BR> Indiana east .................. 1301     1301
-<BR> Indiana west .................. 1302     1302
-<BR> Iowa north .................... 1401     1401
-<BR> Iowa south .................... 1402     1402
-<BR> Kansas north .................. 1501     1501
-<BR> Kansas south .................. 1502     1502
-<BR> Kentucky north ................ 1601     1601
-<BR> Kentucky south ................ 1602     1602
-<BR> Louisiana north ............... 1701     1701
-<BR> Louisiana offshore ............ 1703     1703
-<BR> Louisiana south ............... 1702     1702
-<BR> Maine east .................... 1801     1801
-<BR> Maine west .................... 1802     1802
-<BR> Maryland ...................... 1900     1900
-<BR> Massachusetts island .......... 2002     2002
-<BR> Massachusetts mainland ........ 2001     2001
-<BR> Michigan central/l ............ 2112     2112 current
-<BR> Michigan central/m ............ 2102          old
-<BR> Michigan east ................. 2101          old
-<BR> Michigan north ................ 2111     2111 current
-<BR> Michigan south ................ 2113     2113 current
-<BR> Michigan west ................. 2103          old
-<BR> Minnesota central ............. 2202     2202
-<BR> Minnesota north ............... 2201     2201
-<BR> Minnesota south ............... 2203     2203
-<BR> Mississippi east .............. 2301     2301
-<BR> Mississippi west .............. 2302     2302
-<BR> Missouri central .............. 2402     2402
-<BR> Missouri east ................. 2401     2401
-<BR> Missouri west ................. 2403     2403
-<BR> Montana .......................          2500
-<BR> Montana central ............... 2502
-<BR> Montana north ................. 2501
-<BR> Montana south ................. 2503
-<BR> Nebraska ......................          2600
-<BR> Nebraska north ................ 2601
-<BR> Nebraska south ................ 2602
-<BR> Nevada central ................ 2702     2702
-<BR> Nevada east ................... 2701     2701
-<BR> Nevada west ................... 2703     2703
-<BR> New hampshire ................. 2800     2800
-<BR> New jersey .................... 2900     2900
-<BR> New mexico central ............ 3002     3002
-<BR> New mexico east ............... 3001     3001
-<BR> New mexico west ............... 3003     3003
-<BR> New york central .............. 3102     3102
-<BR> New york east ................. 3101     3101
-<BR> New york long island .......... 3104     3104
-<BR> New york west ................. 3103     3103
-<BR> North carolina ................ 3200     3200
-<BR> North dakota north ............ 3301     3301
-<BR> North dakota south ............ 3302     3302
-<BR> Ohio north .................... 3401     3401
-<BR> Ohio south .................... 3402     3402
-<BR> Oklahoma north ................ 3501     3501
-<BR> Oklahoma south ................ 3502     3502
-<BR> Oregon north .................. 3601     3601
-<BR> Oregon south .................. 3602     3602
-<BR> Pennsylvania north ............ 3701     3701
-<BR> Pennsylvania south ............ 3702     3702
-<BR> Puerto Rico, Virgin Islands ... 5201     5200
-<BR> Rhode Island .................. 3800     3800
-<BR> South Carolina ................          3900
-<BR> South Carolina north .......... 3901
-<BR> South Carolina south .......... 3902
-<BR> South Dakota north ............ 4001     4001
-<BR> South Dakota south ............ 4002     4002
-<BR> Tennessee ..................... 4100     4100
-<BR> Texas central ................. 4203     4203
-<BR> Texas north ................... 4201     4201
-<BR> Texas north central ........... 4202     4202
-<BR> Texas south ................... 4205     4205
-<BR> Texas south central ........... 4204     4204
-<BR> Utah central .................. 4302     4302
-<BR> Utah north .................... 4301     4301
-<BR> Utah south .................... 4303     4303
-<BR> Vermont ....................... 4400     4400
-<BR> Virgin Islands, St. Croix ..... 5202
-<BR> Virginia north ................ 4501     4501
-<BR> Virginia south ................ 4502     4502
-<BR> Washington north .............. 4601     4601
-<BR> Washington south .............. 4602     4602
-<BR> West Virginia north ........... 4701     4701
-<BR> West Virginia south ........... 4702     4702
-<BR> Wisconsin central ............. 4802     4802
-<BR> Wisconsin north ............... 4801     4801
-<BR> Wisconsin south ............... 4803     4803
-<BR> Wyoming east .................. 4901     4901
-<BR> Wyoming east central .......... 4902     4902
-<BR> Wyoming west .................. 4904     4904
-<BR> Wyoming west central .......... 4903     4903
-<BR> ----------------------------------------------
-<P>
-<BR> ---------------------------------------------------------
-<BR> State Plane Coordinate Systems
-<BR> North American Datum 1927
-<BR> ---------------------------------------------------------
-<BR> <nad27sp101> : alabama east> : nad27sp
-<BR> <nad27sp102> : alabama west> : nad27sp
-<BR> <nad27sp5010> : alaska zone no. 10> : nad27sp
-<BR> <nad27sp5300> : american samoa> : nad27sp
-<BR> <nad27sp201> : arizona east> : nad27sp
-<BR> <nad27sp202> : arizona central> : nad27sp
-<BR> <nad27sp203> : arizona west> : nad27sp
-<BR> <nad27sp301> : arkansas north> : nad27sp
-<BR> <nad27sp302> : arkansas south> : nad27sp
-<BR> <nad27sp401> : california i> : nad27sp
-<BR> <nad27sp402> : california ii> : nad27sp
-<BR> <nad27sp403> : california iii> : nad27sp
-<BR> <nad27sp404> : california iv> : nad27sp
-<BR> <nad27sp405> : california v> : nad27sp
-<BR> <nad27sp406> : california vi> : nad27sp
-<BR> <nad27sp407> : california vii> : nad27sp
-<BR> <nad27sp501> : colorado north> : nad27sp
-<BR> <nad27sp502> : colorado central> : nad27sp
-<BR> <nad27sp503> : colorado south> : nad27sp
-<BR> <nad27sp600> : connecticut ---> : nad27sp
-<BR> <nad27sp700> : delaware ---> : nad27sp
-<BR> <nad27sp901> : florida east> : nad27sp
-<BR> <nad27sp902> : florida west> : nad27sp
-<BR> <nad27sp903> : florida north> : nad27sp
-<BR> <nad27sp1001> : georgia east> : nad27sp
-<BR> <nad27sp1002> : georgia west> : nad27sp
-<BR> <nad27sp5101> : hawaii 1> : nad27sp
-<BR> <nad27sp5102> : hawaii 2> : nad27sp
-<BR> <nad27sp5103> : hawaii 3> : nad27sp
-<BR> <nad27sp5104> : hawaii 4> : nad27sp
-<BR> <nad27sp5105> : hawaii 5> : nad27sp
-<BR> <nad27sp1101> : idaho east> : nad27sp
-<BR> <nad27sp1102> : idaho central> : nad27sp
-<BR> <nad27sp1103> : idaho west> : nad27sp
-<BR> <nad27sp1201> : illinois east> : nad27sp
-<BR> <nad27sp1202> : illinois west> : nad27sp
-<BR> <nad27sp1301> : indiana east> : nad27sp
-<BR> <nad27sp1302> : indiana west> : nad27sp
-<BR> <nad27sp1401> : iowa north> : nad27sp
-<BR> <nad27sp1402> : iowa south> : nad27sp
-<BR> <nad27sp1501> : kansas north> : nad27sp
-<BR> <nad27sp1502> : kansas south> : nad27sp
-<BR> <nad27sp1601> : kentucky north> : nad27sp
-<BR> <nad27sp1602> : kentucky south> : nad27sp
-<BR> <nad27sp1701> : louisiana north> : nad27sp
-<BR> <nad27sp1702> : louisiana south> : nad27sp
-<BR> <nad27sp1703> : louisiana offshore> : nad27sp
-<BR> <nad27sp1801> : maine east> : nad27sp
-<BR> <nad27sp1802> : maine west> : nad27sp
-<BR> <nad27sp1900> : maryland ---> : nad27sp
-<BR> <nad27sp2001> : massachusetts mainland> : nad27sp
-<BR> <nad27sp2002> : massachusetts island> : nad27sp
-<BR> <nad27sp2101> : michigan east> : nad27sp
-<BR> <nad27sp2102> : michigan central/m> : nad27sp
-<BR> <nad27sp2103> : michigan west> : nad27sp
-<BR> <nad27sp2111> : michigan north> : nad27sp
-<BR> <nad27sp2112> : michigan central/l> : nad27sp
-<BR> <nad27sp2113> : michigan south> : nad27sp
-<BR> <nad27sp2201> : minnesota north> : nad27sp
-<BR> <nad27sp2202> : minnesota central> : nad27sp
-<BR> <nad27sp2203> : minnesota south> : nad27sp
-<BR> <nad27sp2301> : mississippi east> : nad27sp
-<BR> <nad27sp2302> : mississippi west> : nad27sp
-<BR> <nad27sp2401> : missouri east> : nad27sp
-<BR> <nad27sp2402> : missouri central> : nad27sp
-<BR> <nad27sp2403> : missouri west> : nad27sp
-<BR> <nad27sp2501> : montana north> : nad27sp
-<BR> <nad27sp2502> : montana central> : nad27sp
-<BR> <nad27sp2503> : montana south> : nad27sp
-<BR> <nad27sp2601> : nebraska north> : nad27sp
-<BR> <nad27sp2602> : nebraska south> : nad27sp
-<BR> <nad27sp2701> : nevada east> : nad27sp
-<BR> <nad27sp2702> : nevada central> : nad27sp
-<BR> <nad27sp2703> : nevada west> : nad27sp
-<BR> <nad27sp2800> : new hampshire ---> : nad27sp
-<BR> <nad27sp2900> : new jersey ---> : nad27sp
-<BR> <nad27sp3001> : new mexico east> : nad27sp
-<BR> <nad27sp3002> : new mexico central> : nad27sp
-<BR> <nad27sp3003> : new mexico west> : nad27sp
-<BR> <nad27sp3101> : new york east> : nad27sp
-<BR> <nad27sp3102> : new york central> : nad27sp
-<BR> <nad27sp3103> : new york west> : nad27sp
-<BR> <nad27sp3104> : new york long island> : nad27sp
-<BR> <nad27sp3200> : north carolina ---> : nad27sp
-<BR> <nad27sp3301> : north dakota north> : nad27sp
-<BR> <nad27sp3302> : north dakota south> : nad27sp
-<BR> <nad27sp3401> : ohio north> : nad27sp
-<BR> <nad27sp3402> : ohio south> : nad27sp
-<BR> <nad27sp3501> : oklahoma north> : nad27sp
-<BR> <nad27sp3502> : oklahoma south> : nad27sp
-<BR> <nad27sp3601> : oregon north> : nad27sp
-<BR> <nad27sp3602> : oregon south> : nad27sp
-<BR> <nad27sp3701> : pennsylvania north> : nad27sp
-<BR> <nad27sp3702> : pennsylvania south> : nad27sp
-<BR> <nad27sp3800> : rhode island ---> : nad27sp
-<BR> <nad27sp3901> : south carolina north> : nad27sp
-<BR> <nad27sp3902> : south carolina south> : nad27sp
-<BR> <nad27sp4001> : south dakota north> : nad27sp
-<BR> <nad27sp4002> : south dakota south> : nad27sp
-<BR> <nad27sp4100> : tennessee ---> : nad27sp
-<BR> <nad27sp4201> : texas north> : nad27sp
-<BR> <nad27sp4202> : texas north central> : nad27sp
-<BR> <nad27sp4203> : texas central> : nad27sp
-<BR> <nad27sp4204> : texas south central> : nad27sp
-<BR> <nad27sp4205> : texas south> : nad27sp
-<BR> <nad27sp4301> : utah north> : nad27sp
-<BR> <nad27sp4302> : utah central> : nad27sp
-<BR> <nad27sp4303> : utah south> : nad27sp
-<BR> <nad27sp4400> : vermont ---> : nad27sp
-<BR> <nad27sp4501> : virginia north> : nad27sp
-<BR> <nad27sp4502> : virginia south> : nad27sp
-<BR> <nad27sp4601> : washington north> : nad27sp
-<BR> <nad27sp4602> : washington south> : nad27sp
-<BR> <nad27sp4701> : west virginia north> : nad27sp
-<BR> <nad27sp4702> : west virginia south> : nad27sp
-<BR> <nad27sp4801> : wisconsin north> : nad27sp
-<BR> <nad27sp4802> : wisconsin central> : nad27sp
-<BR> <nad27sp4803> : wisconsin south> : nad27sp
-<BR> <nad27sp4901> : wyoming east> : nad27sp
-<BR> <nad27sp4902> : wyoming east central> : nad27sp
-<BR> <nad27sp4903> : wyoming west central> : nad27sp
-<BR> <nad27sp4904> : wyoming west> : nad27sp
-<BR> <nad27sp5001> : alaska zone no. 1> : nad27sp
-<BR> <nad27sp5002> : alaska zone no. 2> : nad27sp
-<BR> <nad27sp5003> : alaska zone no. 3> : nad27sp
-<BR> <nad27sp5004> : alaska zone no. 4> : nad27sp
-<BR> <nad27sp5005> : alaska zone no. 5> : nad27sp
-<BR> <nad27sp5006> : alaska zone no. 6> : nad27sp
-<BR> <nad27sp5007> : alaska zone no. 7> : nad27sp
-<BR> <nad27sp5008> : alaska zone no. 8> : nad27sp
-<BR> <nad27sp5009> : alaska zone no. 9> : nad27sp
-<BR> <nad27sp5201> : puerto rico and virgin islands> : nad27sp
-<BR> <nad27sp5202> : virgin islands st. croix> : nad27sp
-<BR> <nad27sp5400> : guam island> : nad27sp
-<P>
-<BR> ---------------------------------------------------------
-<BR> State Plane Coordinate Systems
-<BR> North American Datum 1983
-<BR> ---------------------------------------------------------
-<BR> <nad83sp101> : alabama east> : nad83
-<BR> <nad83sp102> : alabama west> : nad83
-<BR> <nad83sp5010> : alaska zone no. 10> : nad83
-<BR> <nad83sp201> : arizona east> : nad83
-<BR> <nad83sp202> : arizona central> : nad83
-<BR> <nad83sp203> : arizona west> : nad83
-<BR> <nad83sp301> : arkansas north> : nad83
-<BR> <nad83sp302> : arkansas south> : nad83
-<BR> <nad83sp401> : california i> : nad83
-<BR> <nad83sp402> : california ii> : nad83
-<BR> <nad83sp403> : california iii> : nad83
-<BR> <nad83sp404> : california iv> : nad83
-<BR> <nad83sp405> : california v> : nad83
-<BR> <nad83sp406> : california vi> : nad83
-<BR> <nad83sp501> : colorado north> : nad83
-<BR> <nad83sp502> : colorado central> : nad83
-<BR> <nad83sp503> : colorado south> : nad83
-<BR> <nad83sp600> : connecticut ---> : nad83
-<BR> <nad83sp700> : delaware ---> : nad83
-<BR> <nad83sp901> : florida east> : nad83
-<BR> <nad83sp902> : florida west> : nad83
-<BR> <nad83sp903> : florida north> : nad83
-<BR> <nad83sp1001> : georgia east> : nad83
-<BR> <nad83sp1002> : georgia west> : nad83
-<BR> <nad83sp5101> : hawaii 1> : nad83
-<BR> <nad83sp5102> : hawaii 2> : nad83
-<BR> <nad83sp5103> : hawaii 3> : nad83
-<BR> <nad83sp5104> : hawaii 4> : nad83
-<BR> <nad83sp5105> : hawaii 5> : nad83
-<BR> <nad83sp1101> : idaho east> : nad83
-<BR> <nad83sp1102> : idaho central> : nad83
-<BR> <nad83sp1103> : idaho west> : nad83
-<BR> <nad83sp1201> : illinois east> : nad83
-<BR> <nad83sp1202> : illinois west> : nad83
-<BR> <nad83sp1301> : indiana east> : nad83
-<BR> <nad83sp1302> : indiana west> : nad83
-<BR> <nad83sp1401> : iowa north> : nad83
-<BR> <nad83sp1402> : iowa south> : nad83
-<BR> <nad83sp1501> : kansas north> : nad83
-<BR> <nad83sp1502> : kansas south> : nad83
-<BR> <nad83sp1601> : kentucky north> : nad83
-<BR> <nad83sp1602> : kentucky south> : nad83
-<BR> <nad83sp1701> : louisiana north> : nad83
-<BR> <nad83sp1702> : louisiana south> : nad83
-<BR> <nad83sp1703> : louisiana offshore> : nad83
-<BR> <nad83sp1801> : maine east> : nad83
-<BR> <nad83sp1802> : maine west> : nad83
-<BR> <nad83sp1900> : maryland ---> : nad83
-<BR> <nad83sp2001> : massachusetts mainland> : nad83
-<BR> <nad83sp2002> : massachusetts island> : nad83
-<BR> <nad83sp2111> : michigan north> : nad83
-<BR> <nad83sp2112> : michigan central/l> : nad83
-<BR> <nad83sp2113> : michigan south> : nad83
-<BR> <nad83sp2201> : minnesota north> : nad83
-<BR> <nad83sp2202> : minnesota central> : nad83
-<BR> <nad83sp2203> : minnesota south> : nad83
-<BR> <nad83sp2301> : mississippi east> : nad83
-<BR> <nad83sp2302> : mississippi west> : nad83
-<BR> <nad83sp2401> : missouri east> : nad83
-<BR> <nad83sp2402> : missouri central> : nad83
-<BR> <nad83sp2403> : missouri west> : nad83
-<BR> <nad83sp2500> : montana> : nad83
-<BR> <nad83sp2600> : nebraska> : nad83
-<BR> <nad83sp2701> : nevada east> : nad83
-<BR> <nad83sp2702> : nevada central> : nad83
-<BR> <nad83sp2703> : nevada west> : nad83
-<BR> <nad83sp2800> : new hampshire ---> : nad83
-<BR> <nad83sp2900> : new jersey ---> : nad83
-<BR> <nad83sp3001> : new mexico east> : nad83
-<BR> <nad83sp3002> : new mexico central> : nad83
-<BR> <nad83sp3003> : new mexico west> : nad83
-<BR> <nad83sp3101> : new york east> : nad83
-<BR> <nad83sp3102> : new york central> : nad83
-<BR> <nad83sp3103> : new york west> : nad83
-<BR> <nad83sp3104> : new york long island> : nad83
-<BR> <nad83sp3200> : north carolina ---> : nad83
-<BR> <nad83sp3301> : north dakota north> : nad83
-<BR> <nad83sp3302> : north dakota south> : nad83
-<BR> <nad83sp3401> : ohio north> : nad83
-<BR> <nad83sp3402> : ohio south> : nad83
-<BR> <nad83sp3501> : oklahoma north> : nad83
-<BR> <nad83sp3502> : oklahoma south> : nad83
-<BR> <nad83sp3601> : oregon north> : nad83
-<BR> <nad83sp3602> : oregon south> : nad83
-<BR> <nad83sp3701> : pennsylvania north> : nad83
-<BR> <nad83sp3702> : pennsylvania south> : nad83
-<BR> <nad83sp3800> : rhode island ---> : nad83
-<BR> <nad83sp3900> : south carolina> : nad83
-<BR> <nad83sp4001> : south dakota north> : nad83
-<BR> <nad83sp4002> : south dakota south> : nad83
-<BR> <nad83sp4100> : tennessee ---> : nad83
-<BR> <nad83sp4201> : texas north> : nad83
-<BR> <nad83sp4202> : texas north central> : nad83
-<BR> <nad83sp4203> : texas central> : nad83
-<BR> <nad83sp4204> : texas south central> : nad83
-<BR> <nad83sp4205> : texas south> : nad83
-<BR> <nad83sp4301> : utah north> : nad83
-<BR> <nad83sp4302> : utah central> : nad83
-<BR> <nad83sp4303> : utah south> : nad83
-<BR> <nad83sp4400> : vermont ---> : nad83
-<BR> <nad83sp4501> : virginia north> : nad83
-<BR> <nad83sp4502> : virginia south> : nad83
-<BR> <nad83sp4601> : washington north> : nad83
-<BR> <nad83sp4602> : washington south> : nad83
-<BR> <nad83sp4701> : west virginia north> : nad83
-<BR> <nad83sp4702> : west virginia south> : nad83
-<BR> <nad83sp4801> : wisconsin north> : nad83
-<BR> <nad83sp4802> : wisconsin central> : nad83
-<BR> <nad83sp4803> : wisconsin south> : nad83
-<BR> <nad83sp4901> : wyoming east> : nad83
-<BR> <nad83sp4902> : wyoming east central> : nad83
-<BR> <nad83sp4903> : wyoming west central> : nad83
-<BR> <nad83sp4904> : wyoming west> : nad83
-<BR> <nad83sp5001> : alaska zone no. 1> : nad83
-<BR> <nad83sp5002> : alaska zone no. 2> : nad83
-<BR> <nad83sp5003> : alaska zone no. 3> : nad83
-<BR> <nad83sp5004> : alaska zone no. 4> : nad83
-<BR> <nad83sp5005> : alaska zone no. 5> : nad83
-<BR> <nad83sp5006> : alaska zone no. 6> : nad83
-<BR> <nad83sp5007> : alaska zone no. 7> : nad83
-<BR> <nad83sp5008> : alaska zone no. 8> : nad83
-<BR> <nad83sp5009> : alaska zone no. 9> : nad83
-<BR> <nad83sp5200> : puerto rico and virgin islands> : nad83
-<P>
-<BR> ---------------------------------------------------------
-<BR> Great Lakes Grids using Clarke 1866 ellipsoid
-<BR> ---------------------------------------------------------
-<BR> <erie-etal> : Lake Erie, Ontario and St. Lawrence River.
-<BR> <huron> : Lake Huron
-<BR> <michigan> : Lake Michigan
-<BR> <superior> : Lake Superior, Lake of the Woods
-<P>
-<BR> ---------------------------------------------------------
-<BR> EPSG projection definitions
-<BR> ---------------------------------------------------------
-<BR> <epsg4001> : Unknown datum based upon the Airy 1830 ellipsoid
-<BR> <epsg4002> : Unknown datum based upon the Airy Modified 1849 ellipsoid
-<BR> <epsg4003> : Unknown datum based upon the Australian National Spheroid
-<BR> <epsg4004> : Unknown datum based upon the Bessel 1841 ellipsoid
-<BR> <epsg4005> : Unknown datum based upon the Bessel Modified ellipsoid
-<BR> <epsg4006> : Unknown datum based upon the Bessel Namibia ellipsoid
-<BR> <epsg4007> : Unknown datum based upon the Clarke 1858 ellipsoid
-<BR> <epsg4008> : Unknown datum based upon the Clarke 1866 ellipsoid
-<BR> <epsg4009> : Unknown datum based upon the Clarke 1866 Michigan ellipsoid
-<BR> <epsg4010> : Unknown datum based upon the Clarke 1880 (Benoit) ellipsoid
-<BR> <epsg4011> : Unknown datum based upon the Clarke 1880 (IGN) ellipsoid
-<BR> <epsg4012> : Unknown datum based upon the Clarke 1880 (RGS) ellipsoid
-<BR> <epsg4013> : Unknown datum based upon the Clarke 1880 (Arc) ellipsoid
-<BR> <epsg4014> : Unknown datum based upon the Clarke 1880 (SGA 1922) ellipsoid
-<BR> <epsg4015> : Unknown datum based upon the Everest 1830 (1937 Adjustment) ellipsoid
-<BR> <epsg4016> : Unknown datum based upon the Everest 1830 (1967 Definition) ellipsoid
-<BR> <epsg4018> : Unknown datum based upon the Everest 1830 Modified ellipsoid
-<BR> <epsg4019> : Unknown datum based upon the GRS 1980 ellipsoid
-<BR> <epsg4020> : Unknown datum based upon the Helmert 1906 ellipsoid
-<BR> <epsg4021> : Unknown datum based upon the Indonesian National Spheroid
-<BR> <epsg4022> : Unknown datum based upon the International 1924 ellipsoid
-<BR> <epsg4024> : Unknown datum based upon the Krassowsky 1940 ellipsoid
-<BR> <epsg4025> : Unknown datum based upon the NWL 9D ellipsoid
-<BR> <epsg4027> : Unknown datum based upon the Plessis 1817 ellipsoid
-<BR> <epsg4028> : Unknown datum based upon the Struve 1860 ellipsoid
-<BR> <epsg4029> : Unknown datum based upon the War Office ellipsoid
-<BR> <epsg4030> : Unknown datum based upon the WGS 84 ellipsoid
-<BR> <epsg4031> : Unknown datum based upon the GEM 10C ellipsoid
-<BR> <epsg4032> : Unknown datum based upon the OSU86F ellipsoid
-<BR> <epsg4033> : Unknown datum based upon the OSU91A ellipsoid
-<BR> <epsg4034> : Unknown datum based upon the Clarke 1880 ellipsoid
-<BR> <epsg4035> : Unknown datum based upon the Authalic Sphere
-<BR> <epsg4036> : Unknown datum based upon the GRS 1967 ellipsoid
-<BR> <epsg4041> : Unknown datum based upon the Average Terrestrial System 1977 ellipsoid
-<BR> <epsg4042> : Unknown datum based upon the Everest (1830 Definition) ellipsoid
-<BR> <epsg4043> : Unknown datum based upon the WGS 72 ellipsoid
-<BR> <epsg4044> : Unknown datum based upon the Everest 1830 (1962 Definition) ellipsoid
-<BR> <epsg4045> : Unknown datum based upon the Everest 1830 (1975 Definition) ellipsoid
-<BR> <epsg4047> : Unspecified datum based upon the GRS 1980 Authalic Sphere
-<BR> <epsg4052> : Unspecified datum based upon the Clarke 1866 Authalic Sphere
-<BR> <epsg4053> : Unspecified datum based upon the International 1924 Authalic Sphere
-<BR> <epsg4054> : Unspecified datum based upon the Hughes 1980 ellipsoid
-<BR> <epsg4120> : Greek
-<BR> <epsg4121> : GGRS87
-<BR> <epsg4122> : ATS77
-<BR> <epsg4123> : KKJ
-<BR> <epsg4124> : RT90
-<BR> <epsg4125> : Samboja
-<BR> <epsg4126> : LKS94 (ETRS89)
-<BR> <epsg4127> : Tete
-<BR> <epsg4128> : Madzansua
-<BR> <epsg4129> : Observatario
-<BR> <epsg4130> : Moznet
-<BR> <epsg4131> : Indian 1960
-<BR> <epsg4132> : FD58
-<BR> <epsg4133> : EST92
-<BR> <epsg4134> : PDO Survey Datum 1993
-<BR> <epsg4135> : Old Hawaiian
-<BR> <epsg4136> : St. Lawrence Island
-<BR> <epsg4137> : St. Paul Island
-<BR> <epsg4138> : St. George Island
-<BR> <epsg4139> : Puerto Rico
-<BR> <epsg4140> : NAD83(CSRS98)
-<BR> <epsg4141> : Israel
-<BR> <epsg4142> : Locodjo 1965
-<BR> <epsg4143> : Abidjan 1987
-<BR> <epsg4144> : Kalianpur 1937
-<BR> <epsg4145> : Kalianpur 1962
-<BR> <epsg4146> : Kalianpur 1975
-<BR> <epsg4147> : Hanoi 1972
-<BR> <epsg4148> : Hartebeesthoek94
-<BR> <epsg4149> : CH1903
-<BR> <epsg4150> : CH1903+
-<BR> <epsg4151> : CHTRF95
-<BR> <epsg4152> : NAD83(HARN)
-<BR> <epsg4153> : Rassadiran
-<BR> <epsg4154> : ED50(ED77)
-<BR> <epsg4155> : Dabola 1981
-<BR> <epsg4156> : S-JTSK
-<BR> <epsg4157> : Mount Dillon
-<BR> <epsg4158> : Naparima 1955
-<BR> <epsg4159> : ELD79
-<BR> <epsg4160> : Chos Malal 1914
-<BR> <epsg4161> : Pampa del Castillo
-<BR> <epsg4162> : Korean 1985
-<BR> <epsg4163> : Yemen NGN96
-<BR> <epsg4164> : South Yemen
-<BR> <epsg4165> : Bissau
-<BR> <epsg4166> : Korean 1995
-<BR> <epsg4167> : NZGD2000
-<BR> <epsg4168> : Accra
-<BR> <epsg4169> : American Samoa 1962
-<BR> <epsg4170> : SIRGAS
-<BR> <epsg4171> : RGF93
-<BR> <epsg4172> : POSGAR
-<BR> <epsg4173> : IRENET95
-<BR> <epsg4174> : Sierra Leone 1924
-<BR> <epsg4175> : Sierra Leone 1968
-<BR> <epsg4176> : Australian Antarctic
-<BR> <epsg4178> : Pulkovo 1942(83)
-<BR> <epsg4179> : Pulkovo 1942(58)
-<BR> <epsg4180> : EST97
-<BR> <epsg4181> : Luxembourg 1930
-<BR> <epsg4182> : Azores Occidental 1939
-<BR> <epsg4183> : Azores Central 1948
-<BR> <epsg4184> : Azores Oriental 1940
-<BR> <epsg4185> : Madeira 1936
-<BR> <epsg4188> : OSNI 1952
-<BR> <epsg4189> : REGVEN
-<BR> <epsg4190> : POSGAR 98
-<BR> <epsg4191> : Albanian 1987
-<BR> <epsg4192> : Douala 1948
-<BR> <epsg4193> : Manoca 1962
-<BR> <epsg4194> : Qornoq 1927
-<BR> <epsg4195> : Scoresbysund 1952
-<BR> <epsg4196> : Ammassalik 1958
-<BR> <epsg4197> : Garoua
-<BR> <epsg4198> : Kousseri
-<BR> <epsg4199> : Egypt 1930
-<BR> <epsg4200> : Pulkovo 1995
-<BR> <epsg4201> : Adindan
-<BR> <epsg4202> : AGD66
-<BR> <epsg4203> : AGD84
-<BR> <epsg4204> : Ain el Abd
-<BR> <epsg4205> : Afgooye
-<BR> <epsg4206> : Agadez
-<BR> <epsg4207> : Lisbon
-<BR> <epsg4208> : Aratu
-<BR> <epsg4209> : Arc 1950
-<BR> <epsg4210> : Arc 1960
-<BR> <epsg4211> : Batavia
-<BR> <epsg4212> : Barbados 1938
-<BR> <epsg4213> : Beduaram
-<BR> <epsg4214> : Beijing 1954
-<BR> <epsg4215> : Belge 1950
-<BR> <epsg4216> : Bermuda 1957
-<BR> <epsg4218> : Bogota 1975
-<BR> <epsg4219> : Bukit Rimpah
-<BR> <epsg4220> : Camacupa
-<BR> <epsg4221> : Campo Inchauspe
-<BR> <epsg4222> : Cape
-<BR> <epsg4223> : Carthage
-<BR> <epsg4224> : Chua
-<BR> <epsg4225> : Corrego Alegre
-<BR> <epsg4226> : Cote d'Ivoire
-<BR> <epsg4227> : Deir ez Zor
-<BR> <epsg4228> : Douala
-<BR> <epsg4229> : Egypt 1907
-<BR> <epsg4230> : ED50
-<BR> <epsg4231> : ED87
-<BR> <epsg4232> : Fahud
-<BR> <epsg4233> : Gandajika 1970
-<BR> <epsg4234> : Garoua
-<BR> <epsg4235> : Guyane Francaise
-<BR> <epsg4236> : Hu Tzu Shan
-<BR> <epsg4237> : HD72
-<BR> <epsg4238> : ID74
-<BR> <epsg4239> : Indian 1954
-<BR> <epsg4240> : Indian 1975
-<BR> <epsg4241> : Jamaica 1875
-<BR> <epsg4242> : JAD69
-<BR> <epsg4243> : Kalianpur 1880
-<BR> <epsg4244> : Kandawala
-<BR> <epsg4245> : Kertau 1968
-<BR> <epsg4246> : KOC
-<BR> <epsg4247> : La Canoa
-<BR> <epsg4248> : PSAD56
-<BR> <epsg4249> : Lake
-<BR> <epsg4250> : Leigon
-<BR> <epsg4251> : Liberia 1964
-<BR> <epsg4252> : Lome
-<BR> <epsg4253> : Luzon 1911
-<BR> <epsg4254> : Hito XVIII 1963
-<BR> <epsg4255> : Herat North
-<BR> <epsg4256> : Mahe 1971
-<BR> <epsg4257> : Makassar
-<BR> <epsg4258> : ETRS89
-<BR> <epsg4259> : Malongo 1987
-<BR> <epsg4260> : Manoca
-<BR> <epsg4261> : Merchich
-<BR> <epsg4262> : Massawa
-<BR> <epsg4263> : Minna
-<BR> <epsg4264> : Mhast
-<BR> <epsg4265> : Monte Mario
-<BR> <epsg4266> : M'poraloko
-<BR> <epsg4267> : NAD27
-<BR> <epsg4268> : NAD27 Michigan
-<BR> <epsg4269> : NAD83
-<BR> <epsg4270> : Nahrwan 1967
-<BR> <epsg4271> : Naparima 1972
-<BR> <epsg4272> : NZGD49
-<BR> <epsg4273> : NGO 1948
-<BR> <epsg4274> : Datum 73
-<BR> <epsg4275> : NTF
-<BR> <epsg4276> : NSWC 9Z-2
-<BR> <epsg4277> : OSGB 1936
-<BR> <epsg4278> : OSGB70
-<BR> <epsg4279> : OS(SN)80
-<BR> <epsg4280> : Padang
-<BR> <epsg4281> : Palestine 1923
-<BR> <epsg4282> : Pointe Noire
-<BR> <epsg4283> : GDA94
-<BR> <epsg4284> : Pulkovo 1942
-<BR> <epsg4285> : Qatar 1974
-<BR> <epsg4286> : Qatar 1948
-<BR> <epsg4287> : Qornoq
-<BR> <epsg4288> : Loma Quintana
-<BR> <epsg4289> : Amersfoort
-<BR> <epsg4291> : SAD69
-<BR> <epsg4292> : Sapper Hill 1943
-<BR> <epsg4293> : Schwarzeck
-<BR> <epsg4294> : Segora
-<BR> <epsg4295> : Serindung
-<BR> <epsg4296> : Sudan
-<BR> <epsg4297> : Tananarive
-<BR> <epsg4298> : Timbalai 1948
-<BR> <epsg4299> : TM65
-<BR> <epsg4300> : TM75
-<BR> <epsg4301> : Tokyo
-<BR> <epsg4302> : Trinidad 1903
-<BR> <epsg4303> : TC(1948)
-<BR> <epsg4304> : Voirol 1875
-<BR> <epsg4306> : Bern 1938
-<BR> <epsg4307> : Nord Sahara 1959
-<BR> <epsg4308> : RT38
-<BR> <epsg4309> : Yacare
-<BR> <epsg4310> : Yoff
-<BR> <epsg4311> : Zanderij
-<BR> <epsg4312> : MGI
-<BR> <epsg4313> : Belge 1972
-<BR> <epsg4314> : DHDN
-<BR> <epsg4315> : Conakry 1905
-<BR> <epsg4316> : Dealul Piscului 1933
-<BR> <epsg4317> : Dealul Piscului 1970
-<BR> <epsg4318> : NGN
-<BR> <epsg4319> : KUDAMS
-<BR> <epsg4322> : WGS 72
-<BR> <epsg4324> : WGS 72BE
-<BR> <epsg4326> : WGS 84
-<BR> <epsg4600> : Anguilla 1957
-<BR> <epsg4601> : Antigua 1943
-<BR> <epsg4602> : Dominica 1945
-<BR> <epsg4603> : Grenada 1953
-<BR> <epsg4604> : Montserrat 1958
-<BR> <epsg4605> : St. Kitts 1955
-<BR> <epsg4606> : St. Lucia 1955
-<BR> <epsg4607> : St. Vincent 1945
-<BR> <epsg4608> : NAD27(76)
-<BR> <epsg4609> : NAD27(CGQ77)
-<BR> <epsg4610> : Xian 1980
-<BR> <epsg4611> : Hong Kong 1980
-<BR> <epsg4612> : JGD2000
-<BR> <epsg4613> : Segara
-<BR> <epsg4614> : QND95
-<BR> <epsg4615> : Porto Santo
-<BR> <epsg4616> : Selvagem Grande
-<BR> <epsg4617> : NAD83(CSRS)
-<BR> <epsg4618> : SAD69
-<BR> <epsg4619> : SWEREF99
-<BR> <epsg4620> : Point 58
-<BR> <epsg4621> : Fort Marigot
-<BR> <epsg4622> : Guadeloupe 1948
-<BR> <epsg4623> : CSG67
-<BR> <epsg4624> : RGFG95
-<BR> <epsg4625> : Martinique 1938
-<BR> <epsg4626> : Reunion 1947
-<BR> <epsg4627> : RGR92
-<BR> <epsg4628> : Tahiti 52
-<BR> <epsg4629> : Tahaa 54
-<BR> <epsg4630> : IGN72 Nuku Hiva
-<BR> <epsg4631> : K0 1949
-<BR> <epsg4632> : Combani 1950
-<BR> <epsg4633> : IGN56 Lifou
-<BR> <epsg4634> : IGN72 Grand Terre
-<BR> <epsg4635> : ST87 Ouvea
-<BR> <epsg4636> : Petrels 1972
-<BR> <epsg4637> : Perroud 1950
-<BR> <epsg4638> : Saint Pierre et Miquelon 1950
-<BR> <epsg4639> : MOP78
-<BR> <epsg4640> : RRAF 1991
-<BR> <epsg4641> : IGN53 Mare
-<BR> <epsg4642> : ST84 Ile des Pins
-<BR> <epsg4643> : ST71 Belep
-<BR> <epsg4644> : NEA74 Noumea
-<BR> <epsg4645> : RGNC 1991
-<BR> <epsg4646> : Grand Comoros
-<BR> <epsg4657> : Reykjavik 1900
-<BR> <epsg4658> : Hjorsey 1955
-<BR> <epsg4659> : ISN93
-<BR> <epsg4660> : Helle 1954
-<BR> <epsg4661> : LKS92
-<BR> <epsg4662> : IGN72 Grande Terre
-<BR> <epsg4663> : Porto Santo 1995
-<BR> <epsg4664> : Azores Oriental 1995
-<BR> <epsg4665> : Azores Central 1995
-<BR> <epsg4666> : Lisbon 1890
-<BR> <epsg4667> : IKBD-92
-<BR> <epsg4668> : ED79
-<BR> <epsg4669> : LKS94
-<BR> <epsg4670> : IGM95
-<BR> <epsg4671> : Voirol 1879
-<BR> <epsg4672> : CI1971
-<BR> <epsg4673> : CI1979
-<BR> <epsg4674> : SIRGAS 2000
-<BR> <epsg4675> : Guam 1963
-<BR> <epsg4676> : Vientiane 1982
-<BR> <epsg4677> : Lao 1993
-<BR> <epsg4678> : Lao 1997
-<BR> <epsg4679> : Jouik 1961
-<BR> <epsg4680> : Nouakchott 1965
-<BR> <epsg4681> : Mauritania 1999
-<BR> <epsg4682> : Gulshan 303
-<BR> <epsg4683> : PRS92
-<BR> <epsg4684> : Gan 1970
-<BR> <epsg4685> : Gandajika
-<BR> <epsg4686> : MAGNA-SIRGAS
-<BR> <epsg4687> : RGPF
-<BR> <epsg4688> : Fatu Iva 72
-<BR> <epsg4689> : IGN63 Hiva Oa
-<BR> <epsg4690> : Tahiti 79
-<BR> <epsg4691> : Moorea 87
-<BR> <epsg4692> : Maupiti 83
-<BR> <epsg4693> : Nakhl-e Ghanem
-<BR> <epsg4694> : POSGAR 94
-<BR> <epsg4695> : Katanga 1955
-<BR> <epsg4696> : Kasai 1953
-<BR> <epsg4697> : IGC 1962 6th Parallel South
-<BR> <epsg4698> : IGN 1962 Kerguelen
-<BR> <epsg4699> : Le Pouce 1934
-<BR> <epsg4700> : IGN Astro 1960
-<BR> <epsg4701> : IGCB 1955
-<BR> <epsg4702> : Mauritania 1999
-<BR> <epsg4703> : Mhast 1951
-<BR> <epsg4704> : Mhast (onshore)
-<BR> <epsg4705> : Mhast (offshore)
-<BR> <epsg4706> : Egypt Gulf of Suez S-650 TL
-<BR> <epsg4707> : Tern Island 1961
-<BR> <epsg4708> : Cocos Islands 1965
-<BR> <epsg4709> : Iwo Jima 1945
-<BR> <epsg4710> : St. Helena 1971
-<BR> <epsg4711> : Marcus Island 1952
-<BR> <epsg4712> : Ascension Island 1958
-<BR> <epsg4713> : Ayabelle Lighthouse
-<BR> <epsg4714> : Bellevue
-<BR> <epsg4715> : Camp Area Astro
-<BR> <epsg4716> : Phoenix Islands 1966
-<BR> <epsg4717> : Cape Canaveral
-<BR> <epsg4718> : Solomon 1968
-<BR> <epsg4719> : Easter Island 1967
-<BR> <epsg4720> : Fiji 1986
-<BR> <epsg4721> : Fiji 1956
-<BR> <epsg4722> : South Georgia 1968
-<BR> <epsg4723> : Grand Cayman 1959
-<BR> <epsg4724> : Diego Garcia 1969
-<BR> <epsg4725> : Johnston Island 1961
-<BR> <epsg4726> : Little Cayman 1961
-<BR> <epsg4727> : Midway 1961
-<BR> <epsg4728> : Pico de la Nieves
-<BR> <epsg4729> : Pitcairn 1967
-<BR> <epsg4730> : Santo 1965
-<BR> <epsg4731> : Viti Levu 1916
-<BR> <epsg4732> : Marshall Islands 1960
-<BR> <epsg4733> : Wake Island 1952
-<BR> <epsg4734> : Tristan 1968
-<BR> <epsg4735> : Kusaie 1951
-<BR> <epsg4736> : Deception Island
-<BR> <epsg4737> : Korea 2000
-<BR> <epsg4738> : Hong Kong 1963
-<BR> <epsg4739> : Hong Kong 1963(67)
-<BR> <epsg4740> : PZ-90
-<BR> <epsg4741> : FD54
-<BR> <epsg4742> : GDM2000
-<BR> <epsg4743> : Karbala 1979 (Polservice)
-<BR> <epsg4744> : Nahrwan 1934
-<BR> <epsg4745> : RD/83
-<BR> <epsg4746> : PD/83
-<BR> <epsg4747> : GR96
-<BR> <epsg4748> : Vanua Levu 1915
-<BR> <epsg4749> : RGNC91-93
-<BR> <epsg4750> : ST87 Ouvea
-<BR> <epsg4751> : Kertau (RSO)
-<BR> <epsg4752> : Viti Levu 1912
-<BR> <epsg4753> : fk89
-<BR> <epsg4754> : LGD2006
-<BR> <epsg4755> : DGN95
-<BR> <epsg4756> : VN-2000
-<BR> <epsg4757> : SVY21
-<BR> <epsg4758> : JAD2001
-<BR> <epsg4759> : NAD83(NSRS2007)
-<BR> <epsg4760> : WGS 66
-<BR> <epsg4801> : Bern 1898 (Bern)
-<BR> <epsg4802> : Bogota 1975 (Bogota)
-<BR> <epsg4803> : Lisbon (Lisbon)
-<BR> <epsg4804> : Makassar (Jakarta)
-<BR> <epsg4805> : MGI (Ferro)
-<BR> <epsg4806> : Monte Mario (Rome)
-<BR> <epsg4807> : NTF (Paris)
-<BR> <epsg4808> : Padang (Jakarta)
-<BR> <epsg4809> : Belge 1950 (Brussels)
-<BR> <epsg4810> : Tananarive (Paris)
-<BR> <epsg4811> : Voirol 1875 (Paris)
-<BR> <epsg4813> : Batavia (Jakarta)
-<BR> <epsg4814> : RT38 (Stockholm)
-<BR> <epsg4815> : Greek (Athens)
-<BR> <epsg4816> : Carthage (Paris)
-<BR> <epsg4817> : NGO 1948 (Oslo)
-<BR> <epsg4818> : S-JTSK (Ferro)
-<BR> <epsg4819> : Nord Sahara 1959 (Paris)
-<BR> <epsg4820> : Segara (Jakarta)
-<BR> <epsg4821> : Voirol 1879 (Paris)
-<BR> <epsg4901> : ATF (Paris)
-<BR> <epsg4902> : NDG (Paris)
-<BR> <epsg4903> : Madrid 1870 (Madrid)
-<BR> <epsg4904> : Lisbon 1890 (Lisbon)
-<BR> <epsg2000> : Anguilla 1957 / British West Indies Grid
-<BR> <epsg2001> : Antigua 1943 / British West Indies Grid
-<BR> <epsg2002> : Dominica 1945 / British West Indies Grid
-<BR> <epsg2003> : Grenada 1953 / British West Indies Grid
-<BR> <epsg2004> : Montserrat 1958 / British West Indies Grid
-<BR> <epsg2005> : St. Kitts 1955 / British West Indies Grid
-<BR> <epsg2006> : St. Lucia 1955 / British West Indies Grid
-<BR> <epsg2007> : St. Vincent 45 / British West Indies Grid
-<BR> <epsg2008> : NAD27(CGQ77) / SCoPQ zone 2
-<BR> <epsg2009> : NAD27(CGQ77) / SCoPQ zone 3
-<BR> <epsg2010> : NAD27(CGQ77) / SCoPQ zone 4
-<BR> <epsg2011> : NAD27(CGQ77) / SCoPQ zone 5
-<BR> <epsg2012> : NAD27(CGQ77) / SCoPQ zone 6
-<BR> <epsg2013> : NAD27(CGQ77) / SCoPQ zone 7
-<BR> <epsg2014> : NAD27(CGQ77) / SCoPQ zone 8
-<BR> <epsg2015> : NAD27(CGQ77) / SCoPQ zone 9
-<BR> <epsg2016> : NAD27(CGQ77) / SCoPQ zone 10
-<BR> <epsg2017> : NAD27(76) / MTM zone 8
-<BR> <epsg2018> : NAD27(76) / MTM zone 9
-<BR> <epsg2019> : NAD27(76) / MTM zone 10
-<BR> <epsg2020> : NAD27(76) / MTM zone 11
-<BR> <epsg2021> : NAD27(76) / MTM zone 12
-<BR> <epsg2022> : NAD27(76) / MTM zone 13
-<BR> <epsg2023> : NAD27(76) / MTM zone 14
-<BR> <epsg2024> : NAD27(76) / MTM zone 15
-<BR> <epsg2025> : NAD27(76) / MTM zone 16
-<BR> <epsg2026> : NAD27(76) / MTM zone 17
-<BR> <epsg2027> : NAD27(76) / UTM zone 15N
-<BR> <epsg2028> : NAD27(76) / UTM zone 16N
-<BR> <epsg2029> : NAD27(76) / UTM zone 17N
-<BR> <epsg2030> : NAD27(76) / UTM zone 18N
-<BR> <epsg2031> : NAD27(CGQ77) / UTM zone 17N
-<BR> <epsg2032> : NAD27(CGQ77) / UTM zone 18N
-<BR> <epsg2033> : NAD27(CGQ77) / UTM zone 19N
-<BR> <epsg2034> : NAD27(CGQ77) / UTM zone 20N
-<BR> <epsg2035> : NAD27(CGQ77) / UTM zone 21N
-<BR> <epsg2036> : NAD83(CSRS98) / New Brunswick Stereo (deprecated)
-<BR> <epsg2037> : NAD83(CSRS98) / UTM zone 19N (deprecated)
-<BR> <epsg2038> : NAD83(CSRS98) / UTM zone 20N (deprecated)
-<BR> <epsg2039> : Israel / Israeli TM Grid
-<BR> <epsg2040> : Locodjo 1965 / UTM zone 30N
-<BR> <epsg2041> : Abidjan 1987 / UTM zone 30N
-<BR> <epsg2042> : Locodjo 1965 / UTM zone 29N
-<BR> <epsg2043> : Abidjan 1987 / UTM zone 29N
-<BR> <epsg2044> : Hanoi 1972 / Gauss-Kruger zone 18
-<BR> <epsg2045> : Hanoi 1972 / Gauss-Kruger zone 19
-<BR> <epsg2056> : CH1903+ / LV95
-<BR> <epsg2057> : Rassadiran / Nakhl e Taqi
-<BR> <epsg2058> : ED50(ED77) / UTM zone 38N
-<BR> <epsg2059> : ED50(ED77) / UTM zone 39N
-<BR> <epsg2060> : ED50(ED77) / UTM zone 40N
-<BR> <epsg2061> : ED50(ED77) / UTM zone 41N
-<BR> <epsg2062> : Madrid 1870 (Madrid) / Spain
-<BR> <epsg2063> : Dabola 1981 / UTM zone 28N (deprecated)
-<BR> <epsg2064> : Dabola 1981 / UTM zone 29N (deprecated)
-<BR> <epsg2065> : S-JTSK (Ferro) / Krovak
-<BR> <epsg2066> : Mount Dillon / Tobago Grid
-<BR> <epsg2067> : Naparima 1955 / UTM zone 20N
-<BR> <epsg2068> : ELD79 / Libya zone 5
-<BR> <epsg2069> : ELD79 / Libya zone 6
-<BR> <epsg2070> : ELD79 / Libya zone 7
-<BR> <epsg2071> : ELD79 / Libya zone 8
-<BR> <epsg2072> : ELD79 / Libya zone 9
-<BR> <epsg2073> : ELD79 / Libya zone 10
-<BR> <epsg2074> : ELD79 / Libya zone 11
-<BR> <epsg2075> : ELD79 / Libya zone 12
-<BR> <epsg2076> : ELD79 / Libya zone 13
-<BR> <epsg2077> : ELD79 / UTM zone 32N
-<BR> <epsg2078> : ELD79 / UTM zone 33N
-<BR> <epsg2079> : ELD79 / UTM zone 34N
-<BR> <epsg2080> : ELD79 / UTM zone 35N
-<BR> <epsg2081> : Chos Malal 1914 / Argentina zone 2
-<BR> <epsg2082> : Pampa del Castillo / Argentina zone 2
-<BR> <epsg2083> : Hito XVIII 1963 / Argentina zone 2
-<BR> <epsg2084> : Hito XVIII 1963 / UTM zone 19S
-<BR> <epsg2085> : NAD27 / Cuba Norte
-<BR> <epsg2086> : NAD27 / Cuba Sur
-<BR> <epsg2087> : ELD79 / TM 12 NE
-<BR> <epsg2088> : Carthage / TM 11 NE
-<BR> <epsg2089> : Yemen NGN96 / UTM zone 38N
-<BR> <epsg2090> : Yemen NGN96 / UTM zone 39N
-<BR> <epsg2091> : South Yemen / Gauss Kruger zone 8 (deprecated)
-<BR> <epsg2092> : South Yemen / Gauss Kruger zone 9 (deprecated)
-<BR> <epsg2093> : Hanoi 1972 / GK 106 NE
-<BR> <epsg2094> : WGS 72BE / TM 106 NE
-<BR> <epsg2095> : Bissau / UTM zone 28N
-<BR> <epsg2096> : Korean 1985 / Korea East Belt
-<BR> <epsg2097> : Korean 1985 / Korea Central Belt
-<BR> <epsg2098> : Korean 1985 / Korea West Belt
-<BR> <epsg2099> : Qatar 1948 / Qatar Grid
-<BR> <epsg2100> : GGRS87 / Greek Grid
-<BR> <epsg2101> : Lake / Maracaibo Grid M1
-<BR> <epsg2102> : Lake / Maracaibo Grid
-<BR> <epsg2103> : Lake / Maracaibo Grid M3
-<BR> <epsg2104> : Lake / Maracaibo La Rosa Grid
-<BR> <epsg2105> : NZGD2000 / Mount Eden Circuit 2000
-<BR> <epsg2106> : NZGD2000 / Bay of Plenty Circuit 2000
-<BR> <epsg2107> : NZGD2000 / Poverty Bay Circuit 2000
-<BR> <epsg2108> : NZGD2000 / Hawkes Bay Circuit 2000
-<BR> <epsg2109> : NZGD2000 / Taranaki Circuit 2000
-<BR> <epsg2110> : NZGD2000 / Tuhirangi Circuit 2000
-<BR> <epsg2111> : NZGD2000 / Wanganui Circuit 2000
-<BR> <epsg2112> : NZGD2000 / Wairarapa Circuit 2000
-<BR> <epsg2113> : NZGD2000 / Wellington Circuit 2000
-<BR> <epsg2114> : NZGD2000 / Collingwood Circuit 2000
-<BR> <epsg2115> : NZGD2000 / Nelson Circuit 2000
-<BR> <epsg2116> : NZGD2000 / Karamea Circuit 2000
-<BR> <epsg2117> : NZGD2000 / Buller Circuit 2000
-<BR> <epsg2118> : NZGD2000 / Grey Circuit 2000
-<BR> <epsg2119> : NZGD2000 / Amuri Circuit 2000
-<BR> <epsg2120> : NZGD2000 / Marlborough Circuit 2000
-<BR> <epsg2121> : NZGD2000 / Hokitika Circuit 2000
-<BR> <epsg2122> : NZGD2000 / Okarito Circuit 2000
-<BR> <epsg2123> : NZGD2000 / Jacksons Bay Circuit 2000
-<BR> <epsg2124> : NZGD2000 / Mount Pleasant Circuit 2000
-<BR> <epsg2125> : NZGD2000 / Gawler Circuit 2000
-<BR> <epsg2126> : NZGD2000 / Timaru Circuit 2000
-<BR> <epsg2127> : NZGD2000 / Lindis Peak Circuit 2000
-<BR> <epsg2128> : NZGD2000 / Mount Nicholas Circuit 2000
-<BR> <epsg2129> : NZGD2000 / Mount York Circuit 2000
-<BR> <epsg2130> : NZGD2000 / Observation Point Circuit 2000
-<BR> <epsg2131> : NZGD2000 / North Taieri Circuit 2000
-<BR> <epsg2132> : NZGD2000 / Bluff Circuit 2000
-<BR> <epsg2133> : NZGD2000 / UTM zone 58S
-<BR> <epsg2134> : NZGD2000 / UTM zone 59S
-<BR> <epsg2135> : NZGD2000 / UTM zone 60S
-<BR> <epsg2136> : Accra / Ghana National Grid
-<BR> <epsg2137> : Accra / TM 1 NW
-<BR> <epsg2138> : NAD27(CGQ77) / Quebec Lambert
-<BR> <epsg2139> : NAD83(CSRS98) / SCoPQ zone 2 (deprecated)
-<BR> <epsg2140> : NAD83(CSRS98) / MTM zone 3 (deprecated)
-<BR> <epsg2141> : NAD83(CSRS98) / MTM zone 4 (deprecated)
-<BR> <epsg2142> : NAD83(CSRS98) / MTM zone 5 (deprecated)
-<BR> <epsg2143> : NAD83(CSRS98) / MTM zone 6 (deprecated)
-<BR> <epsg2144> : NAD83(CSRS98) / MTM zone 7 (deprecated)
-<BR> <epsg2145> : NAD83(CSRS98) / MTM zone 8 (deprecated)
-<BR> <epsg2146> : NAD83(CSRS98) / MTM zone 9 (deprecated)
-<BR> <epsg2147> : NAD83(CSRS98) / MTM zone 10 (deprecated)
-<BR> <epsg2148> : NAD83(CSRS98) / UTM zone 21N (deprecated)
-<BR> <epsg2149> : NAD83(CSRS98) / UTM zone 18N (deprecated)
-<BR> <epsg2150> : NAD83(CSRS98) / UTM zone 17N (deprecated)
-<BR> <epsg2151> : NAD83(CSRS98) / UTM zone 13N (deprecated)
-<BR> <epsg2152> : NAD83(CSRS98) / UTM zone 12N (deprecated)
-<BR> <epsg2153> : NAD83(CSRS98) / UTM zone 11N (deprecated)
-<BR> <epsg2154> : RGF93 / Lambert-93
-<BR> <epsg2155> : American Samoa 1962 / American Samoa Lambert (deprecated)
-<BR> <epsg2156> : NAD83(HARN) / UTM zone 59S (deprecated)
-<BR> <epsg2157> : IRENET95 / Irish Transverse Mercator
-<BR> <epsg2158> : IRENET95 / UTM zone 29N
-<BR> <epsg2159> : Sierra Leone 1924 / New Colony Grid
-<BR> <epsg2160> : Sierra Leone 1924 / New War Office Grid
-<BR> <epsg2161> : Sierra Leone 1968 / UTM zone 28N
-<BR> <epsg2162> : Sierra Leone 1968 / UTM zone 29N
-<BR> <epsg2163> : US National Atlas Equal Area
-<BR> <epsg2164> : Locodjo 1965 / TM 5 NW
-<BR> <epsg2165> : Abidjan 1987 / TM 5 NW
-<BR> <epsg2166> : Pulkovo 1942(83) / Gauss Kruger zone 3 (deprecated)
-<BR> <epsg2167> : Pulkovo 1942(83) / Gauss Kruger zone 4 (deprecated)
-<BR> <epsg2168> : Pulkovo 1942(83) / Gauss Kruger zone 5 (deprecated)
-<BR> <epsg2169> : Luxembourg 1930 / Gauss
-<BR> <epsg2170> : MGI / Slovenia Grid
-<BR> <epsg2171> : Pulkovo 1942(58) / Poland zone I (deprecated)
-<BR> <epsg2172> : Pulkovo 1942(58) / Poland zone II
-<BR> <epsg2173> : Pulkovo 1942(58) / Poland zone III
-<BR> <epsg2174> : Pulkovo 1942(58) / Poland zone IV
-<BR> <epsg2175> : Pulkovo 1942(58) / Poland zone V
-<BR> <epsg2176> : ETRS89 / Poland CS2000 zone 5
-<BR> <epsg2177> : ETRS89 / Poland CS2000 zone 6
-<BR> <epsg2178> : ETRS89 / Poland CS2000 zone 7
-<BR> <epsg2179> : ETRS89 / Poland CS2000 zone 8
-<BR> <epsg2180> : ETRS89 / Poland CS92
-<BR> <epsg2188> : Azores Occidental 1939 / UTM zone 25N
-<BR> <epsg2189> : Azores Central 1948 / UTM zone 26N
-<BR> <epsg2190> : Azores Oriental 1940 / UTM zone 26N
-<BR> <epsg2191> : Madeira 1936 / UTM zone 28N (deprecated)
-<BR> <epsg2192> : ED50 / France EuroLambert
-<BR> <epsg2193> : NZGD2000 / New Zealand Transverse Mercator
-<BR> <epsg2194> : American Samoa 1962 / American Samoa Lambert (deprecated)
-<BR> <epsg2195> : NAD83(HARN) / UTM zone 2S
-<BR> <epsg2196> : ETRS89 / Kp2000 Jutland
-<BR> <epsg2197> : ETRS89 / Kp2000 Zealand
-<BR> <epsg2198> : ETRS89 / Kp2000 Bornholm
-<BR> <epsg2199> : Albanian 1987 / Gauss Kruger zone 4 (deprecated)
-<BR> <epsg2200> : ATS77 / New Brunswick Stereographic (ATS77)
-<BR> <epsg2201> : REGVEN / UTM zone 18N
-<BR> <epsg2202> : REGVEN / UTM zone 19N
-<BR> <epsg2203> : REGVEN / UTM zone 20N
-<BR> <epsg2204> : NAD27 / Tennessee
-<BR> <epsg2205> : NAD83 / Kentucky North
-<BR> <epsg2206> : ED50 / 3-degree Gauss-Kruger zone 9
-<BR> <epsg2207> : ED50 / 3-degree Gauss-Kruger zone 10
-<BR> <epsg2208> : ED50 / 3-degree Gauss-Kruger zone 11
-<BR> <epsg2209> : ED50 / 3-degree Gauss-Kruger zone 12
-<BR> <epsg2210> : ED50 / 3-degree Gauss-Kruger zone 13
-<BR> <epsg2211> : ED50 / 3-degree Gauss-Kruger zone 14
-<BR> <epsg2212> : ED50 / 3-degree Gauss-Kruger zone 15
-<BR> <epsg2213> : ETRS89 / TM 30 NE
-<BR> <epsg2214> : Douala 1948 / AOF west (deprecated)
-<BR> <epsg2215> : Manoca 1962 / UTM zone 32N
-<BR> <epsg2216> : Qornoq 1927 / UTM zone 22N
-<BR> <epsg2217> : Qornoq 1927 / UTM zone 23N
-<BR> <epsg2219> : ATS77 / UTM zone 19N
-<BR> <epsg2220> : ATS77 / UTM zone 20N
-<BR> <epsg2222> : NAD83 / Arizona East (ft)
-<BR> <epsg2223> : NAD83 / Arizona Central (ft)
-<BR> <epsg2224> : NAD83 / Arizona West (ft)
-<BR> <epsg2225> : NAD83 / California zone 1 (ftUS)
-<BR> <epsg2226> : NAD83 / California zone 2 (ftUS)
-<BR> <epsg2227> : NAD83 / California zone 3 (ftUS)
-<BR> <epsg2228> : NAD83 / California zone 4 (ftUS)
-<BR> <epsg2229> : NAD83 / California zone 5 (ftUS)
-<BR> <epsg2230> : NAD83 / California zone 6 (ftUS)
-<BR> <epsg2231> : NAD83 / Colorado North (ftUS)
-<BR> <epsg2232> : NAD83 / Colorado Central (ftUS)
-<BR> <epsg2233> : NAD83 / Colorado South (ftUS)
-<BR> <epsg2234> : NAD83 / Connecticut (ftUS)
-<BR> <epsg2235> : NAD83 / Delaware (ftUS)
-<BR> <epsg2236> : NAD83 / Florida East (ftUS)
-<BR> <epsg2237> : NAD83 / Florida West (ftUS)
-<BR> <epsg2238> : NAD83 / Florida North (ftUS)
-<BR> <epsg2239> : NAD83 / Georgia East (ftUS)
-<BR> <epsg2240> : NAD83 / Georgia West (ftUS)
-<BR> <epsg2241> : NAD83 / Idaho East (ftUS)
-<BR> <epsg2242> : NAD83 / Idaho Central (ftUS)
-<BR> <epsg2243> : NAD83 / Idaho West (ftUS)
-<BR> <epsg2244> : NAD83 / Indiana East (ftUS) (deprecated)
-<BR> <epsg2245> : NAD83 / Indiana West (ftUS) (deprecated)
-<BR> <epsg2246> : NAD83 / Kentucky North (ftUS)
-<BR> <epsg2247> : NAD83 / Kentucky South (ftUS)
-<BR> <epsg2248> : NAD83 / Maryland (ftUS)
-<BR> <epsg2249> : NAD83 / Massachusetts Mainland (ftUS)
-<BR> <epsg2250> : NAD83 / Massachusetts Island (ftUS)
-<BR> <epsg2251> : NAD83 / Michigan North (ft)
-<BR> <epsg2252> : NAD83 / Michigan Central (ft)
-<BR> <epsg2253> : NAD83 / Michigan South (ft)
-<BR> <epsg2254> : NAD83 / Mississippi East (ftUS)
-<BR> <epsg2255> : NAD83 / Mississippi West (ftUS)
-<BR> <epsg2256> : NAD83 / Montana (ft)
-<BR> <epsg2257> : NAD83 / New Mexico East (ftUS)
-<BR> <epsg2258> : NAD83 / New Mexico Central (ftUS)
-<BR> <epsg2259> : NAD83 / New Mexico West (ftUS)
-<BR> <epsg2260> : NAD83 / New York East (ftUS)
-<BR> <epsg2261> : NAD83 / New York Central (ftUS)
-<BR> <epsg2262> : NAD83 / New York West (ftUS)
-<BR> <epsg2263> : NAD83 / New York Long Island (ftUS)
-<BR> <epsg2264> : NAD83 / North Carolina (ftUS)
-<BR> <epsg2265> : NAD83 / North Dakota North (ft)
-<BR> <epsg2266> : NAD83 / North Dakota South (ft)
-<BR> <epsg2267> : NAD83 / Oklahoma North (ftUS)
-<BR> <epsg2268> : NAD83 / Oklahoma South (ftUS)
-<BR> <epsg2269> : NAD83 / Oregon North (ft)
-<BR> <epsg2270> : NAD83 / Oregon South (ft)
-<BR> <epsg2271> : NAD83 / Pennsylvania North (ftUS)
-<BR> <epsg2272> : NAD83 / Pennsylvania South (ftUS)
-<BR> <epsg2273> : NAD83 / South Carolina (ft)
-<BR> <epsg2274> : NAD83 / Tennessee (ftUS)
-<BR> <epsg2275> : NAD83 / Texas North (ftUS)
-<BR> <epsg2276> : NAD83 / Texas North Central (ftUS)
-<BR> <epsg2277> : NAD83 / Texas Central (ftUS)
-<BR> <epsg2278> : NAD83 / Texas South Central (ftUS)
-<BR> <epsg2279> : NAD83 / Texas South (ftUS)
-<BR> <epsg2280> : NAD83 / Utah North (ft)
-<BR> <epsg2281> : NAD83 / Utah Central (ft)
-<BR> <epsg2282> : NAD83 / Utah South (ft)
-<BR> <epsg2283> : NAD83 / Virginia North (ftUS)
-<BR> <epsg2284> : NAD83 / Virginia South (ftUS)
-<BR> <epsg2285> : NAD83 / Washington North (ftUS)
-<BR> <epsg2286> : NAD83 / Washington South (ftUS)
-<BR> <epsg2287> : NAD83 / Wisconsin North (ftUS)
-<BR> <epsg2288> : NAD83 / Wisconsin Central (ftUS)
-<BR> <epsg2289> : NAD83 / Wisconsin South (ftUS)
-<BR> <epsg2290> : ATS77 / Prince Edward Isl. Stereographic (ATS77)
-<BR> <epsg2291> : NAD83(CSRS98) / Prince Edward Isl. Stereographic (NAD83) (deprecated)
-<BR> <epsg2292> : NAD83(CSRS98) / Prince Edward Isl. Stereographic (NAD83) (deprecated)
-<BR> <epsg2294> : ATS77 / MTM Nova Scotia zone 4
-<BR> <epsg2295> : ATS77 / MTM Nova Scotia zone 5
-<BR> <epsg2308> : Batavia / TM 109 SE
-<BR> <epsg2309> : WGS 84 / TM 116 SE
-<BR> <epsg2310> : WGS 84 / TM 132 SE
-<BR> <epsg2311> : WGS 84 / TM 6 NE
-<BR> <epsg2312> : Garoua / UTM zone 33N
-<BR> <epsg2313> : Kousseri / UTM zone 33N
-<BR> <epsg2314> : Trinidad 1903 / Trinidad Grid (ftCla)
-<BR> <epsg2315> : Campo Inchauspe / UTM zone 19S
-<BR> <epsg2316> : Campo Inchauspe / UTM zone 20S
-<BR> <epsg2317> : PSAD56 / ICN Regional
-<BR> <epsg2318> : Ain el Abd / Aramco Lambert
-<BR> <epsg2319> : ED50 / TM27
-<BR> <epsg2320> : ED50 / TM30
-<BR> <epsg2321> : ED50 / TM33
-<BR> <epsg2322> : ED50 / TM36
-<BR> <epsg2323> : ED50 / TM39
-<BR> <epsg2324> : ED50 / TM42
-<BR> <epsg2325> : ED50 / TM45
-<BR> <epsg2326> : Hong Kong 1980 Grid System
-<BR> <epsg2327> : Xian 1980 / Gauss-Kruger zone 13
-<BR> <epsg2328> : Xian 1980 / Gauss-Kruger zone 14
-<BR> <epsg2329> : Xian 1980 / Gauss-Kruger zone 15
-<BR> <epsg2330> : Xian 1980 / Gauss-Kruger zone 16
-<BR> <epsg2331> : Xian 1980 / Gauss-Kruger zone 17
-<BR> <epsg2332> : Xian 1980 / Gauss-Kruger zone 18
-<BR> <epsg2333> : Xian 1980 / Gauss-Kruger zone 19
-<BR> <epsg2334> : Xian 1980 / Gauss-Kruger zone 20
-<BR> <epsg2335> : Xian 1980 / Gauss-Kruger zone 21
-<BR> <epsg2336> : Xian 1980 / Gauss-Kruger zone 22
-<BR> <epsg2337> : Xian 1980 / Gauss-Kruger zone 23
-<BR> <epsg2338> : Xian 1980 / Gauss-Kruger CM 75E
-<BR> <epsg2339> : Xian 1980 / Gauss-Kruger CM 81E
-<BR> <epsg2340> : Xian 1980 / Gauss-Kruger CM 87E
-<BR> <epsg2341> : Xian 1980 / Gauss-Kruger CM 93E
-<BR> <epsg2342> : Xian 1980 / Gauss-Kruger CM 99E
-<BR> <epsg2343> : Xian 1980 / Gauss-Kruger CM 105E
-<BR> <epsg2344> : Xian 1980 / Gauss-Kruger CM 111E
-<BR> <epsg2345> : Xian 1980 / Gauss-Kruger CM 117E
-<BR> <epsg2346> : Xian 1980 / Gauss-Kruger CM 123E
-<BR> <epsg2347> : Xian 1980 / Gauss-Kruger CM 129E
-<BR> <epsg2348> : Xian 1980 / Gauss-Kruger CM 135E
-<BR> <epsg2349> : Xian 1980 / 3-degree Gauss-Kruger zone 25
-<BR> <epsg2350> : Xian 1980 / 3-degree Gauss-Kruger zone 26
-<BR> <epsg2351> : Xian 1980 / 3-degree Gauss-Kruger zone 27
-<BR> <epsg2352> : Xian 1980 / 3-degree Gauss-Kruger zone 28
-<BR> <epsg2353> : Xian 1980 / 3-degree Gauss-Kruger zone 29
-<BR> <epsg2354> : Xian 1980 / 3-degree Gauss-Kruger zone 30
-<BR> <epsg2355> : Xian 1980 / 3-degree Gauss-Kruger zone 31
-<BR> <epsg2356> : Xian 1980 / 3-degree Gauss-Kruger zone 32
-<BR> <epsg2357> : Xian 1980 / 3-degree Gauss-Kruger zone 33
-<BR> <epsg2358> : Xian 1980 / 3-degree Gauss-Kruger zone 34
-<BR> <epsg2359> : Xian 1980 / 3-degree Gauss-Kruger zone 35
-<BR> <epsg2360> : Xian 1980 / 3-degree Gauss-Kruger zone 36
-<BR> <epsg2361> : Xian 1980 / 3-degree Gauss-Kruger zone 37
-<BR> <epsg2362> : Xian 1980 / 3-degree Gauss-Kruger zone 38
-<BR> <epsg2363> : Xian 1980 / 3-degree Gauss-Kruger zone 39
-<BR> <epsg2364> : Xian 1980 / 3-degree Gauss-Kruger zone 40
-<BR> <epsg2365> : Xian 1980 / 3-degree Gauss-Kruger zone 41
-<BR> <epsg2366> : Xian 1980 / 3-degree Gauss-Kruger zone 42
-<BR> <epsg2367> : Xian 1980 / 3-degree Gauss-Kruger zone 43
-<BR> <epsg2368> : Xian 1980 / 3-degree Gauss-Kruger zone 44
-<BR> <epsg2369> : Xian 1980 / 3-degree Gauss-Kruger zone 45
-<BR> <epsg2370> : Xian 1980 / 3-degree Gauss-Kruger CM 75E
-<BR> <epsg2371> : Xian 1980 / 3-degree Gauss-Kruger CM 78E
-<BR> <epsg2372> : Xian 1980 / 3-degree Gauss-Kruger CM 81E
-<BR> <epsg2373> : Xian 1980 / 3-degree Gauss-Kruger CM 84E
-<BR> <epsg2374> : Xian 1980 / 3-degree Gauss-Kruger CM 87E
-<BR> <epsg2375> : Xian 1980 / 3-degree Gauss-Kruger CM 90E
-<BR> <epsg2376> : Xian 1980 / 3-degree Gauss-Kruger CM 93E
-<BR> <epsg2377> : Xian 1980 / 3-degree Gauss-Kruger CM 96E
-<BR> <epsg2378> : Xian 1980 / 3-degree Gauss-Kruger CM 99E
-<BR> <epsg2379> : Xian 1980 / 3-degree Gauss-Kruger CM 102E
-<BR> <epsg2380> : Xian 1980 / 3-degree Gauss-Kruger CM 105E
-<BR> <epsg2381> : Xian 1980 / 3-degree Gauss-Kruger CM 108E
-<BR> <epsg2382> : Xian 1980 / 3-degree Gauss-Kruger CM 111E
-<BR> <epsg2383> : Xian 1980 / 3-degree Gauss-Kruger CM 114E
-<BR> <epsg2384> : Xian 1980 / 3-degree Gauss-Kruger CM 117E
-<BR> <epsg2385> : Xian 1980 / 3-degree Gauss-Kruger CM 120E
-<BR> <epsg2386> : Xian 1980 / 3-degree Gauss-Kruger CM 123E
-<BR> <epsg2387> : Xian 1980 / 3-degree Gauss-Kruger CM 126E
-<BR> <epsg2388> : Xian 1980 / 3-degree Gauss-Kruger CM 129E
-<BR> <epsg2389> : Xian 1980 / 3-degree Gauss-Kruger CM 132E
-<BR> <epsg2390> : Xian 1980 / 3-degree Gauss-Kruger CM 135E
-<BR> <epsg2391> : KKJ / Finland zone 1
-<BR> <epsg2392> : KKJ / Finland zone 2
-<BR> <epsg2393> : KKJ / Finland Uniform Coordinate System
-<BR> <epsg2394> : KKJ / Finland zone 4
-<BR> <epsg2395> : South Yemen / Gauss-Kruger zone 8
-<BR> <epsg2396> : South Yemen / Gauss-Kruger zone 9
-<BR> <epsg2397> : Pulkovo 1942(83) / Gauss-Kruger zone 3
-<BR> <epsg2398> : Pulkovo 1942(83) / Gauss-Kruger zone 4
-<BR> <epsg2399> : Pulkovo 1942(83) / Gauss-Kruger zone 5
-<BR> <epsg2400> : RT90 2.5 gon W (deprecated)
-<BR> <epsg2401> : Beijing 1954 / 3-degree Gauss-Kruger zone 25
-<BR> <epsg2402> : Beijing 1954 / 3-degree Gauss-Kruger zone 26
-<BR> <epsg2403> : Beijing 1954 / 3-degree Gauss-Kruger zone 27
-<BR> <epsg2404> : Beijing 1954 / 3-degree Gauss-Kruger zone 28
-<BR> <epsg2405> : Beijing 1954 / 3-degree Gauss-Kruger zone 29
-<BR> <epsg2406> : Beijing 1954 / 3-degree Gauss-Kruger zone 30
-<BR> <epsg2407> : Beijing 1954 / 3-degree Gauss-Kruger zone 31
-<BR> <epsg2408> : Beijing 1954 / 3-degree Gauss-Kruger zone 32
-<BR> <epsg2409> : Beijing 1954 / 3-degree Gauss-Kruger zone 33
-<BR> <epsg2410> : Beijing 1954 / 3-degree Gauss-Kruger zone 34
-<BR> <epsg2411> : Beijing 1954 / 3-degree Gauss-Kruger zone 35
-<BR> <epsg2412> : Beijing 1954 / 3-degree Gauss-Kruger zone 36
-<BR> <epsg2413> : Beijing 1954 / 3-degree Gauss-Kruger zone 37
-<BR> <epsg2414> : Beijing 1954 / 3-degree Gauss-Kruger zone 38
-<BR> <epsg2415> : Beijing 1954 / 3-degree Gauss-Kruger zone 39
-<BR> <epsg2416> : Beijing 1954 / 3-degree Gauss-Kruger zone 40
-<BR> <epsg2417> : Beijing 1954 / 3-degree Gauss-Kruger zone 41
-<BR> <epsg2418> : Beijing 1954 / 3-degree Gauss-Kruger zone 42
-<BR> <epsg2419> : Beijing 1954 / 3-degree Gauss-Kruger zone 43
-<BR> <epsg2420> : Beijing 1954 / 3-degree Gauss-Kruger zone 44
-<BR> <epsg2421> : Beijing 1954 / 3-degree Gauss-Kruger zone 45
-<BR> <epsg2422> : Beijing 1954 / 3-degree Gauss-Kruger CM 75E
-<BR> <epsg2423> : Beijing 1954 / 3-degree Gauss-Kruger CM 78E
-<BR> <epsg2424> : Beijing 1954 / 3-degree Gauss-Kruger CM 81E
-<BR> <epsg2425> : Beijing 1954 / 3-degree Gauss-Kruger CM 84E
-<BR> <epsg2426> : Beijing 1954 / 3-degree Gauss-Kruger CM 87E
-<BR> <epsg2427> : Beijing 1954 / 3-degree Gauss-Kruger CM 90E
-<BR> <epsg2428> : Beijing 1954 / 3-degree Gauss-Kruger CM 93E
-<BR> <epsg2429> : Beijing 1954 / 3-degree Gauss-Kruger CM 96E
-<BR> <epsg2430> : Beijing 1954 / 3-degree Gauss-Kruger CM 99E
-<BR> <epsg2431> : Beijing 1954 / 3-degree Gauss-Kruger CM 102E
-<BR> <epsg2432> : Beijing 1954 / 3-degree Gauss-Kruger CM 105E
-<BR> <epsg2433> : Beijing 1954 / 3-degree Gauss-Kruger CM 108E
-<BR> <epsg2434> : Beijing 1954 / 3-degree Gauss-Kruger CM 111E
-<BR> <epsg2435> : Beijing 1954 / 3-degree Gauss-Kruger CM 114E
-<BR> <epsg2436> : Beijing 1954 / 3-degree Gauss-Kruger CM 117E
-<BR> <epsg2437> : Beijing 1954 / 3-degree Gauss-Kruger CM 120E
-<BR> <epsg2438> : Beijing 1954 / 3-degree Gauss-Kruger CM 123E
-<BR> <epsg2439> : Beijing 1954 / 3-degree Gauss-Kruger CM 126E
-<BR> <epsg2440> : Beijing 1954 / 3-degree Gauss-Kruger CM 129E
-<BR> <epsg2441> : Beijing 1954 / 3-degree Gauss-Kruger CM 132E
-<BR> <epsg2442> : Beijing 1954 / 3-degree Gauss-Kruger CM 135E
-<BR> <epsg2443> : JGD2000 / Japan Plane Rectangular CS I
-<BR> <epsg2444> : JGD2000 / Japan Plane Rectangular CS II
-<BR> <epsg2445> : JGD2000 / Japan Plane Rectangular CS III
-<BR> <epsg2446> : JGD2000 / Japan Plane Rectangular CS IV
-<BR> <epsg2447> : JGD2000 / Japan Plane Rectangular CS V
-<BR> <epsg2448> : JGD2000 / Japan Plane Rectangular CS VI
-<BR> <epsg2449> : JGD2000 / Japan Plane Rectangular CS VII
-<BR> <epsg2450> : JGD2000 / Japan Plane Rectangular CS VIII
-<BR> <epsg2451> : JGD2000 / Japan Plane Rectangular CS IX
-<BR> <epsg2452> : JGD2000 / Japan Plane Rectangular CS X
-<BR> <epsg2453> : JGD2000 / Japan Plane Rectangular CS XI
-<BR> <epsg2454> : JGD2000 / Japan Plane Rectangular CS XII
-<BR> <epsg2455> : JGD2000 / Japan Plane Rectangular CS XIII
-<BR> <epsg2456> : JGD2000 / Japan Plane Rectangular CS XIV
-<BR> <epsg2457> : JGD2000 / Japan Plane Rectangular CS XV
-<BR> <epsg2458> : JGD2000 / Japan Plane Rectangular CS XVI
-<BR> <epsg2459> : JGD2000 / Japan Plane Rectangular CS XVII
-<BR> <epsg2460> : JGD2000 / Japan Plane Rectangular CS XVIII
-<BR> <epsg2461> : JGD2000 / Japan Plane Rectangular CS XIX
-<BR> <epsg2462> : Albanian 1987 / Gauss-Kruger zone 4
-<BR> <epsg2463> : Pulkovo 1995 / Gauss-Kruger CM 21E
-<BR> <epsg2464> : Pulkovo 1995 / Gauss-Kruger CM 27E
-<BR> <epsg2465> : Pulkovo 1995 / Gauss-Kruger CM 33E
-<BR> <epsg2466> : Pulkovo 1995 / Gauss-Kruger CM 39E
-<BR> <epsg2467> : Pulkovo 1995 / Gauss-Kruger CM 45E
-<BR> <epsg2468> : Pulkovo 1995 / Gauss-Kruger CM 51E
-<BR> <epsg2469> : Pulkovo 1995 / Gauss-Kruger CM 57E
-<BR> <epsg2470> : Pulkovo 1995 / Gauss-Kruger CM 63E
-<BR> <epsg2471> : Pulkovo 1995 / Gauss-Kruger CM 69E
-<BR> <epsg2472> : Pulkovo 1995 / Gauss-Kruger CM 75E
-<BR> <epsg2473> : Pulkovo 1995 / Gauss-Kruger CM 81E
-<BR> <epsg2474> : Pulkovo 1995 / Gauss-Kruger CM 87E
-<BR> <epsg2475> : Pulkovo 1995 / Gauss-Kruger CM 93E
-<BR> <epsg2476> : Pulkovo 1995 / Gauss-Kruger CM 99E
-<BR> <epsg2477> : Pulkovo 1995 / Gauss-Kruger CM 105E
-<BR> <epsg2478> : Pulkovo 1995 / Gauss-Kruger CM 111E
-<BR> <epsg2479> : Pulkovo 1995 / Gauss-Kruger CM 117E
-<BR> <epsg2480> : Pulkovo 1995 / Gauss-Kruger CM 123E
-<BR> <epsg2481> : Pulkovo 1995 / Gauss-Kruger CM 129E
-<BR> <epsg2482> : Pulkovo 1995 / Gauss-Kruger CM 135E
-<BR> <epsg2483> : Pulkovo 1995 / Gauss-Kruger CM 141E
-<BR> <epsg2484> : Pulkovo 1995 / Gauss-Kruger CM 147E
-<BR> <epsg2485> : Pulkovo 1995 / Gauss-Kruger CM 153E
-<BR> <epsg2486> : Pulkovo 1995 / Gauss-Kruger CM 159E
-<BR> <epsg2487> : Pulkovo 1995 / Gauss-Kruger CM 165E
-<BR> <epsg2488> : Pulkovo 1995 / Gauss-Kruger CM 171E
-<BR> <epsg2489> : Pulkovo 1995 / Gauss-Kruger CM 177E
-<BR> <epsg2490> : Pulkovo 1995 / Gauss-Kruger CM 177W
-<BR> <epsg2491> : Pulkovo 1995 / Gauss-Kruger CM 171W
-<BR> <epsg2492> : Pulkovo 1942 / Gauss-Kruger CM 9E
-<BR> <epsg2493> : Pulkovo 1942 / Gauss-Kruger CM 15E
-<BR> <epsg2494> : Pulkovo 1942 / Gauss-Kruger CM 21E
-<BR> <epsg2495> : Pulkovo 1942 / Gauss-Kruger CM 27E
-<BR> <epsg2496> : Pulkovo 1942 / Gauss-Kruger CM 33E
-<BR> <epsg2497> : Pulkovo 1942 / Gauss-Kruger CM 39E
-<BR> <epsg2498> : Pulkovo 1942 / Gauss-Kruger CM 45E
-<BR> <epsg2499> : Pulkovo 1942 / Gauss-Kruger CM 51E
-<BR> <epsg2500> : Pulkovo 1942 / Gauss-Kruger CM 57E
-<BR> <epsg2501> : Pulkovo 1942 / Gauss-Kruger CM 63E
-<BR> <epsg2502> : Pulkovo 1942 / Gauss-Kruger CM 69E
-<BR> <epsg2503> : Pulkovo 1942 / Gauss-Kruger CM 75E
-<BR> <epsg2504> : Pulkovo 1942 / Gauss-Kruger CM 81E
-<BR> <epsg2505> : Pulkovo 1942 / Gauss-Kruger CM 87E
-<BR> <epsg2506> : Pulkovo 1942 / Gauss-Kruger CM 93E
-<BR> <epsg2507> : Pulkovo 1942 / Gauss-Kruger CM 99E
-<BR> <epsg2508> : Pulkovo 1942 / Gauss-Kruger CM 105E
-<BR> <epsg2509> : Pulkovo 1942 / Gauss-Kruger CM 111E
-<BR> <epsg2510> : Pulkovo 1942 / Gauss-Kruger CM 117E
-<BR> <epsg2511> : Pulkovo 1942 / Gauss-Kruger CM 123E
-<BR> <epsg2512> : Pulkovo 1942 / Gauss-Kruger CM 129E
-<BR> <epsg2513> : Pulkovo 1942 / Gauss-Kruger CM 135E
-<BR> <epsg2514> : Pulkovo 1942 / Gauss-Kruger CM 141E
-<BR> <epsg2515> : Pulkovo 1942 / Gauss-Kruger CM 147E
-<BR> <epsg2516> : Pulkovo 1942 / Gauss-Kruger CM 153E
-<BR> <epsg2517> : Pulkovo 1942 / Gauss-Kruger CM 159E
-<BR> <epsg2518> : Pulkovo 1942 / Gauss-Kruger CM 165E
-<BR> <epsg2519> : Pulkovo 1942 / Gauss-Kruger CM 171E
-<BR> <epsg2520> : Pulkovo 1942 / Gauss-Kruger CM 177E
-<BR> <epsg2521> : Pulkovo 1942 / Gauss-Kruger CM 177W
-<BR> <epsg2522> : Pulkovo 1942 / Gauss-Kruger CM 171W
-<BR> <epsg2523> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 7
-<BR> <epsg2524> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 8
-<BR> <epsg2525> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 9
-<BR> <epsg2526> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 10
-<BR> <epsg2527> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 11
-<BR> <epsg2528> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 12
-<BR> <epsg2529> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 13
-<BR> <epsg2530> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 14
-<BR> <epsg2531> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 15
-<BR> <epsg2532> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 16
-<BR> <epsg2533> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 17
-<BR> <epsg2534> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 18
-<BR> <epsg2535> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 19
-<BR> <epsg2536> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 20
-<BR> <epsg2537> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 21
-<BR> <epsg2538> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 22
-<BR> <epsg2539> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 23
-<BR> <epsg2540> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 24
-<BR> <epsg2541> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 25
-<BR> <epsg2542> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 26
-<BR> <epsg2543> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 27
-<BR> <epsg2544> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 28
-<BR> <epsg2545> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 29
-<BR> <epsg2546> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 30
-<BR> <epsg2547> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 31
-<BR> <epsg2548> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 32
-<BR> <epsg2549> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 33
-<BR> <epsg2550> : Samboja / UTM zone 50S (deprecated)
-<BR> <epsg2551> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 34
-<BR> <epsg2552> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 35
-<BR> <epsg2553> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 36
-<BR> <epsg2554> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 37
-<BR> <epsg2555> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 38
-<BR> <epsg2556> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 39
-<BR> <epsg2557> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 40
-<BR> <epsg2558> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 41
-<BR> <epsg2559> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 42
-<BR> <epsg2560> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 43
-<BR> <epsg2561> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 44
-<BR> <epsg2562> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 45
-<BR> <epsg2563> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 46
-<BR> <epsg2564> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 47
-<BR> <epsg2565> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 48
-<BR> <epsg2566> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 49
-<BR> <epsg2567> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 50
-<BR> <epsg2568> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 51
-<BR> <epsg2569> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 52
-<BR> <epsg2570> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 53
-<BR> <epsg2571> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 54
-<BR> <epsg2572> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 55
-<BR> <epsg2573> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 56
-<BR> <epsg2574> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 57
-<BR> <epsg2575> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 58
-<BR> <epsg2576> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 59
-<BR> <epsg2577> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 60 (deprecated)
-<BR> <epsg2578> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 61
-<BR> <epsg2579> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 62
-<BR> <epsg2580> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 63
-<BR> <epsg2581> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 64
-<BR> <epsg2582> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 21E
-<BR> <epsg2583> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 24E
-<BR> <epsg2584> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 27E
-<BR> <epsg2585> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 30E
-<BR> <epsg2586> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 33E
-<BR> <epsg2587> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 36E
-<BR> <epsg2588> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 39E
-<BR> <epsg2589> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 42E
-<BR> <epsg2590> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 45E
-<BR> <epsg2591> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 48E
-<BR> <epsg2592> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 51E
-<BR> <epsg2593> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 54E
-<BR> <epsg2594> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 57E
-<BR> <epsg2595> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 60E
-<BR> <epsg2596> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 63E
-<BR> <epsg2597> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 66E
-<BR> <epsg2598> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 69E
-<BR> <epsg2599> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 72E
-<BR> <epsg2600> : Lietuvos Koordinoei Sistema 1994 (deprecated)
-<BR> <epsg2601> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 75E
-<BR> <epsg2602> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 78E
-<BR> <epsg2603> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 81E
-<BR> <epsg2604> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 84E
-<BR> <epsg2605> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 87E
-<BR> <epsg2606> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 90E
-<BR> <epsg2607> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 93E
-<BR> <epsg2608> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 96E
-<BR> <epsg2609> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 99E
-<BR> <epsg2610> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 102E
-<BR> <epsg2611> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 105E
-<BR> <epsg2612> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 108E
-<BR> <epsg2613> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 111E
-<BR> <epsg2614> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 114E
-<BR> <epsg2615> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 117E
-<BR> <epsg2616> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 120E
-<BR> <epsg2617> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 123E
-<BR> <epsg2618> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 126E
-<BR> <epsg2619> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 129E
-<BR> <epsg2620> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 132E
-<BR> <epsg2621> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 135E
-<BR> <epsg2622> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 138E
-<BR> <epsg2623> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 141E
-<BR> <epsg2624> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 144E
-<BR> <epsg2625> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 147E
-<BR> <epsg2626> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 150E
-<BR> <epsg2627> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 153E
-<BR> <epsg2628> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 156E
-<BR> <epsg2629> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 159E
-<BR> <epsg2630> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 162E
-<BR> <epsg2631> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 165E
-<BR> <epsg2632> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 168E
-<BR> <epsg2633> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 171E
-<BR> <epsg2634> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 174E
-<BR> <epsg2635> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 177E
-<BR> <epsg2636> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 180E
-<BR> <epsg2637> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 177W
-<BR> <epsg2638> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 174W
-<BR> <epsg2639> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 171W
-<BR> <epsg2640> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 168W
-<BR> <epsg2641> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 7
-<BR> <epsg2642> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 8
-<BR> <epsg2643> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 9
-<BR> <epsg2644> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 10
-<BR> <epsg2645> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 11
-<BR> <epsg2646> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 12
-<BR> <epsg2647> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 13
-<BR> <epsg2648> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 14
-<BR> <epsg2649> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 15
-<BR> <epsg2650> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 16
-<BR> <epsg2651> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 17
-<BR> <epsg2652> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 18
-<BR> <epsg2653> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 19
-<BR> <epsg2654> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 20
-<BR> <epsg2655> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 21
-<BR> <epsg2656> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 22
-<BR> <epsg2657> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 23
-<BR> <epsg2658> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 24
-<BR> <epsg2659> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 25
-<BR> <epsg2660> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 26
-<BR> <epsg2661> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 27
-<BR> <epsg2662> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 28
-<BR> <epsg2663> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 29
-<BR> <epsg2664> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 30
-<BR> <epsg2665> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 31
-<BR> <epsg2666> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 32
-<BR> <epsg2667> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 33
-<BR> <epsg2668> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 34
-<BR> <epsg2669> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 35
-<BR> <epsg2670> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 36
-<BR> <epsg2671> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 37
-<BR> <epsg2672> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 38
-<BR> <epsg2673> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 39
-<BR> <epsg2674> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 40
-<BR> <epsg2675> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 41
-<BR> <epsg2676> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 42
-<BR> <epsg2677> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 43
-<BR> <epsg2678> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 44
-<BR> <epsg2679> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 45
-<BR> <epsg2680> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 46
-<BR> <epsg2681> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 47
-<BR> <epsg2682> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 48
-<BR> <epsg2683> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 49
-<BR> <epsg2684> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 50
-<BR> <epsg2685> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 51
-<BR> <epsg2686> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 52
-<BR> <epsg2687> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 53
-<BR> <epsg2688> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 54
-<BR> <epsg2689> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 55
-<BR> <epsg2690> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 56
-<BR> <epsg2691> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 57
-<BR> <epsg2692> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 58
-<BR> <epsg2693> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 59
-<BR> <epsg2694> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 60 (deprecated)
-<BR> <epsg2695> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 61
-<BR> <epsg2696> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 62
-<BR> <epsg2697> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 63
-<BR> <epsg2698> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 64
-<BR> <epsg2699> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 21E
-<BR> <epsg2700> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 24E
-<BR> <epsg2701> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 27E
-<BR> <epsg2702> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 30E
-<BR> <epsg2703> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 33E
-<BR> <epsg2704> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 36E
-<BR> <epsg2705> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 39E
-<BR> <epsg2706> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 42E
-<BR> <epsg2707> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 45E
-<BR> <epsg2708> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 48E
-<BR> <epsg2709> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 51E
-<BR> <epsg2710> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 54E
-<BR> <epsg2711> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 57E
-<BR> <epsg2712> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 60E
-<BR> <epsg2713> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 63E
-<BR> <epsg2714> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 66E
-<BR> <epsg2715> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 69E
-<BR> <epsg2716> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 72E
-<BR> <epsg2717> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 75E
-<BR> <epsg2718> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 78E
-<BR> <epsg2719> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 81E
-<BR> <epsg2720> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 84E
-<BR> <epsg2721> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 87E
-<BR> <epsg2722> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 90E
-<BR> <epsg2723> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 93E
-<BR> <epsg2724> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 96E
-<BR> <epsg2725> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 99E
-<BR> <epsg2726> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 102E
-<BR> <epsg2727> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 105E
-<BR> <epsg2728> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 108E
-<BR> <epsg2729> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 111E
-<BR> <epsg2730> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 114E
-<BR> <epsg2731> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 117E
-<BR> <epsg2732> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 120E
-<BR> <epsg2733> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 123E
-<BR> <epsg2734> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 126E
-<BR> <epsg2735> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 129E
-<BR> <epsg2736> : Tete / UTM zone 36S
-<BR> <epsg2737> : Tete / UTM zone 37S
-<BR> <epsg2738> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 132E
-<BR> <epsg2739> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 135E
-<BR> <epsg2740> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 138E
-<BR> <epsg2741> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 141E
-<BR> <epsg2742> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 144E
-<BR> <epsg2743> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 147E
-<BR> <epsg2744> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 150E
-<BR> <epsg2745> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 153E
-<BR> <epsg2746> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 156E
-<BR> <epsg2747> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 159E
-<BR> <epsg2748> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 162E
-<BR> <epsg2749> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 165E
-<BR> <epsg2750> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 168E
-<BR> <epsg2751> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 171E
-<BR> <epsg2752> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 174E
-<BR> <epsg2753> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 177E
-<BR> <epsg2754> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 180E
-<BR> <epsg2755> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 177W
-<BR> <epsg2756> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 174W
-<BR> <epsg2757> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 171W
-<BR> <epsg2758> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 168W
-<BR> <epsg2759> : NAD83(HARN) / Alabama East
-<BR> <epsg2760> : NAD83(HARN) / Alabama West
-<BR> <epsg2761> : NAD83(HARN) / Arizona East
-<BR> <epsg2762> : NAD83(HARN) / Arizona Central
-<BR> <epsg2763> : NAD83(HARN) / Arizona West
-<BR> <epsg2764> : NAD83(HARN) / Arkansas North
-<BR> <epsg2765> : NAD83(HARN) / Arkansas South
-<BR> <epsg2766> : NAD83(HARN) / California zone 1
-<BR> <epsg2767> : NAD83(HARN) / California zone 2
-<BR> <epsg2768> : NAD83(HARN) / California zone 3
-<BR> <epsg2769> : NAD83(HARN) / California zone 4
-<BR> <epsg2770> : NAD83(HARN) / California zone 5
-<BR> <epsg2771> : NAD83(HARN) / California zone 6
-<BR> <epsg2772> : NAD83(HARN) / Colorado North
-<BR> <epsg2773> : NAD83(HARN) / Colorado Central
-<BR> <epsg2774> : NAD83(HARN) / Colorado South
-<BR> <epsg2775> : NAD83(HARN) / Connecticut
-<BR> <epsg2776> : NAD83(HARN) / Delaware
-<BR> <epsg2777> : NAD83(HARN) / Florida East
-<BR> <epsg2778> : NAD83(HARN) / Florida West
-<BR> <epsg2779> : NAD83(HARN) / Florida North
-<BR> <epsg2780> : NAD83(HARN) / Georgia East
-<BR> <epsg2781> : NAD83(HARN) / Georgia West
-<BR> <epsg2782> : NAD83(HARN) / Hawaii zone 1
-<BR> <epsg2783> : NAD83(HARN) / Hawaii zone 2
-<BR> <epsg2784> : NAD83(HARN) / Hawaii zone 3
-<BR> <epsg2785> : NAD83(HARN) / Hawaii zone 4
-<BR> <epsg2786> : NAD83(HARN) / Hawaii zone 5
-<BR> <epsg2787> : NAD83(HARN) / Idaho East
-<BR> <epsg2788> : NAD83(HARN) / Idaho Central
-<BR> <epsg2789> : NAD83(HARN) / Idaho West
-<BR> <epsg2790> : NAD83(HARN) / Illinois East
-<BR> <epsg2791> : NAD83(HARN) / Illinois West
-<BR> <epsg2792> : NAD83(HARN) / Indiana East
-<BR> <epsg2793> : NAD83(HARN) / Indiana West
-<BR> <epsg2794> : NAD83(HARN) / Iowa North
-<BR> <epsg2795> : NAD83(HARN) / Iowa South
-<BR> <epsg2796> : NAD83(HARN) / Kansas North
-<BR> <epsg2797> : NAD83(HARN) / Kansas South
-<BR> <epsg2798> : NAD83(HARN) / Kentucky North
-<BR> <epsg2799> : NAD83(HARN) / Kentucky South
-<BR> <epsg2800> : NAD83(HARN) / Louisiana North
-<BR> <epsg2801> : NAD83(HARN) / Louisiana South
-<BR> <epsg2802> : NAD83(HARN) / Maine East
-<BR> <epsg2803> : NAD83(HARN) / Maine West
-<BR> <epsg2804> : NAD83(HARN) / Maryland
-<BR> <epsg2805> : NAD83(HARN) / Massachusetts Mainland
-<BR> <epsg2806> : NAD83(HARN) / Massachusetts Island
-<BR> <epsg2807> : NAD83(HARN) / Michigan North
-<BR> <epsg2808> : NAD83(HARN) / Michigan Central
-<BR> <epsg2809> : NAD83(HARN) / Michigan South
-<BR> <epsg2810> : NAD83(HARN) / Minnesota North
-<BR> <epsg2811> : NAD83(HARN) / Minnesota Central
-<BR> <epsg2812> : NAD83(HARN) / Minnesota South
-<BR> <epsg2813> : NAD83(HARN) / Mississippi East
-<BR> <epsg2814> : NAD83(HARN) / Mississippi West
-<BR> <epsg2815> : NAD83(HARN) / Missouri East
-<BR> <epsg2816> : NAD83(HARN) / Missouri Central
-<BR> <epsg2817> : NAD83(HARN) / Missouri West
-<BR> <epsg2818> : NAD83(HARN) / Montana
-<BR> <epsg2819> : NAD83(HARN) / Nebraska
-<BR> <epsg2820> : NAD83(HARN) / Nevada East
-<BR> <epsg2821> : NAD83(HARN) / Nevada Central
-<BR> <epsg2822> : NAD83(HARN) / Nevada West
-<BR> <epsg2823> : NAD83(HARN) / New Hampshire
-<BR> <epsg2824> : NAD83(HARN) / New Jersey
-<BR> <epsg2825> : NAD83(HARN) / New Mexico East
-<BR> <epsg2826> : NAD83(HARN) / New Mexico Central
-<BR> <epsg2827> : NAD83(HARN) / New Mexico West
-<BR> <epsg2828> : NAD83(HARN) / New York East
-<BR> <epsg2829> : NAD83(HARN) / New York Central
-<BR> <epsg2830> : NAD83(HARN) / New York West
-<BR> <epsg2831> : NAD83(HARN) / New York Long Island
-<BR> <epsg2832> : NAD83(HARN) / North Dakota North
-<BR> <epsg2833> : NAD83(HARN) / North Dakota South
-<BR> <epsg2834> : NAD83(HARN) / Ohio North
-<BR> <epsg2835> : NAD83(HARN) / Ohio South
-<BR> <epsg2836> : NAD83(HARN) / Oklahoma North
-<BR> <epsg2837> : NAD83(HARN) / Oklahoma South
-<BR> <epsg2838> : NAD83(HARN) / Oregon North
-<BR> <epsg2839> : NAD83(HARN) / Oregon South
-<BR> <epsg2840> : NAD83(HARN) / Rhode Island
-<BR> <epsg2841> : NAD83(HARN) / South Dakota North
-<BR> <epsg2842> : NAD83(HARN) / South Dakota South
-<BR> <epsg2843> : NAD83(HARN) / Tennessee
-<BR> <epsg2844> : NAD83(HARN) / Texas North
-<BR> <epsg2845> : NAD83(HARN) / Texas North Central
-<BR> <epsg2846> : NAD83(HARN) / Texas Central
-<BR> <epsg2847> : NAD83(HARN) / Texas South Central
-<BR> <epsg2848> : NAD83(HARN) / Texas South
-<BR> <epsg2849> : NAD83(HARN) / Utah North
-<BR> <epsg2850> : NAD83(HARN) / Utah Central
-<BR> <epsg2851> : NAD83(HARN) / Utah South
-<BR> <epsg2852> : NAD83(HARN) / Vermont
-<BR> <epsg2853> : NAD83(HARN) / Virginia North
-<BR> <epsg2854> : NAD83(HARN) / Virginia South
-<BR> <epsg2855> : NAD83(HARN) / Washington North
-<BR> <epsg2856> : NAD83(HARN) / Washington South
-<BR> <epsg2857> : NAD83(HARN) / West Virginia North
-<BR> <epsg2858> : NAD83(HARN) / West Virginia South
-<BR> <epsg2859> : NAD83(HARN) / Wisconsin North
-<BR> <epsg2860> : NAD83(HARN) / Wisconsin Central
-<BR> <epsg2861> : NAD83(HARN) / Wisconsin South
-<BR> <epsg2862> : NAD83(HARN) / Wyoming East
-<BR> <epsg2863> : NAD83(HARN) / Wyoming East Central
-<BR> <epsg2864> : NAD83(HARN) / Wyoming West Central
-<BR> <epsg2865> : NAD83(HARN) / Wyoming West
-<BR> <epsg2866> : NAD83(HARN) / Puerto Rico & Virgin Is.
-<BR> <epsg2867> : NAD83(HARN) / Arizona East (ft)
-<BR> <epsg2868> : NAD83(HARN) / Arizona Central (ft)
-<BR> <epsg2869> : NAD83(HARN) / Arizona West (ft)
-<BR> <epsg2870> : NAD83(HARN) / California zone 1 (ftUS)
-<BR> <epsg2871> : NAD83(HARN) / California zone 2 (ftUS)
-<BR> <epsg2872> : NAD83(HARN) / California zone 3 (ftUS)
-<BR> <epsg2873> : NAD83(HARN) / California zone 4 (ftUS)
-<BR> <epsg2874> : NAD83(HARN) / California zone 5 (ftUS)
-<BR> <epsg2875> : NAD83(HARN) / California zone 6 (ftUS)
-<BR> <epsg2876> : NAD83(HARN) / Colorado North (ftUS)
-<BR> <epsg2877> : NAD83(HARN) / Colorado Central (ftUS)
-<BR> <epsg2878> : NAD83(HARN) / Colorado South (ftUS)
-<BR> <epsg2879> : NAD83(HARN) / Connecticut (ftUS)
-<BR> <epsg2880> : NAD83(HARN) / Delaware (ftUS)
-<BR> <epsg2881> : NAD83(HARN) / Florida East (ftUS)
-<BR> <epsg2882> : NAD83(HARN) / Florida West (ftUS)
-<BR> <epsg2883> : NAD83(HARN) / Florida North (ftUS)
-<BR> <epsg2884> : NAD83(HARN) / Georgia East (ftUS)
-<BR> <epsg2885> : NAD83(HARN) / Georgia West (ftUS)
-<BR> <epsg2886> : NAD83(HARN) / Idaho East (ftUS)
-<BR> <epsg2887> : NAD83(HARN) / Idaho Central (ftUS)
-<BR> <epsg2888> : NAD83(HARN) / Idaho West (ftUS)
-<BR> <epsg2889> : NAD83(HARN) / Indiana East (ftUS) (deprecated)
-<BR> <epsg2890> : NAD83(HARN) / Indiana West (ftUS) (deprecated)
-<BR> <epsg2891> : NAD83(HARN) / Kentucky North (ftUS)
-<BR> <epsg2892> : NAD83(HARN) / Kentucky South (ftUS)
-<BR> <epsg2893> : NAD83(HARN) / Maryland (ftUS)
-<BR> <epsg2894> : NAD83(HARN) / Massachusetts Mainland (ftUS)
-<BR> <epsg2895> : NAD83(HARN) / Massachusetts Island (ftUS)
-<BR> <epsg2896> : NAD83(HARN) / Michigan North (ft)
-<BR> <epsg2897> : NAD83(HARN) / Michigan Central (ft)
-<BR> <epsg2898> : NAD83(HARN) / Michigan South (ft)
-<BR> <epsg2899> : NAD83(HARN) / Mississippi East (ftUS)
-<BR> <epsg2900> : NAD83(HARN) / Mississippi West (ftUS)
-<BR> <epsg2901> : NAD83(HARN) / Montana (ft)
-<BR> <epsg2902> : NAD83(HARN) / New Mexico East (ftUS)
-<BR> <epsg2903> : NAD83(HARN) / New Mexico Central (ftUS)
-<BR> <epsg2904> : NAD83(HARN) / New Mexico West (ftUS)
-<BR> <epsg2905> : NAD83(HARN) / New York East (ftUS)
-<BR> <epsg2906> : NAD83(HARN) / New York Central (ftUS)
-<BR> <epsg2907> : NAD83(HARN) / New York West (ftUS)
-<BR> <epsg2908> : NAD83(HARN) / New York Long Island (ftUS)
-<BR> <epsg2909> : NAD83(HARN) / North Dakota North (ft)
-<BR> <epsg2910> : NAD83(HARN) / North Dakota South (ft)
-<BR> <epsg2911> : NAD83(HARN) / Oklahoma North (ftUS)
-<BR> <epsg2912> : NAD83(HARN) / Oklahoma South (ftUS)
-<BR> <epsg2913> : NAD83(HARN) / Oregon North (ft)
-<BR> <epsg2914> : NAD83(HARN) / Oregon South (ft)
-<BR> <epsg2915> : NAD83(HARN) / Tennessee (ftUS)
-<BR> <epsg2916> : NAD83(HARN) / Texas North (ftUS)
-<BR> <epsg2917> : NAD83(HARN) / Texas North Central (ftUS)
-<BR> <epsg2918> : NAD83(HARN) / Texas Central (ftUS)
-<BR> <epsg2919> : NAD83(HARN) / Texas South Central (ftUS)
-<BR> <epsg2920> : NAD83(HARN) / Texas South (ftUS)
-<BR> <epsg2921> : NAD83(HARN) / Utah North (ft)
-<BR> <epsg2922> : NAD83(HARN) / Utah Central (ft)
-<BR> <epsg2923> : NAD83(HARN) / Utah South (ft)
-<BR> <epsg2924> : NAD83(HARN) / Virginia North (ftUS)
-<BR> <epsg2925> : NAD83(HARN) / Virginia South (ftUS)
-<BR> <epsg2926> : NAD83(HARN) / Washington North (ftUS)
-<BR> <epsg2927> : NAD83(HARN) / Washington South (ftUS)
-<BR> <epsg2928> : NAD83(HARN) / Wisconsin North (ftUS)
-<BR> <epsg2929> : NAD83(HARN) / Wisconsin Central (ftUS)
-<BR> <epsg2930> : NAD83(HARN) / Wisconsin South (ftUS)
-<BR> <epsg2931> : Beduaram / TM 13 NE
-<BR> <epsg2932> : QND95 / Qatar National Grid
-<BR> <epsg2933> : Segara / UTM zone 50S
-<BR> <epsg2934> : Segara (Jakarta) / NEIEZ (deprecated)
-<BR> <epsg2935> : Pulkovo 1942 / CS63 zone A1
-<BR> <epsg2936> : Pulkovo 1942 / CS63 zone A2
-<BR> <epsg2937> : Pulkovo 1942 / CS63 zone A3
-<BR> <epsg2938> : Pulkovo 1942 / CS63 zone A4
-<BR> <epsg2939> : Pulkovo 1942 / CS63 zone K2
-<BR> <epsg2940> : Pulkovo 1942 / CS63 zone K3
-<BR> <epsg2941> : Pulkovo 1942 / CS63 zone K4
-<BR> <epsg2942> : Porto Santo / UTM zone 28N
-<BR> <epsg2943> : Selvagem Grande / UTM zone 28N
-<BR> <epsg2944> : NAD83(CSRS) / SCoPQ zone 2
-<BR> <epsg2945> : NAD83(CSRS) / MTM zone 3
-<BR> <epsg2946> : NAD83(CSRS) / MTM zone 4
-<BR> <epsg2947> : NAD83(CSRS) / MTM zone 5
-<BR> <epsg2948> : NAD83(CSRS) / MTM zone 6
-<BR> <epsg2949> : NAD83(CSRS) / MTM zone 7
-<BR> <epsg2950> : NAD83(CSRS) / MTM zone 8
-<BR> <epsg2951> : NAD83(CSRS) / MTM zone 9
-<BR> <epsg2952> : NAD83(CSRS) / MTM zone 10
-<BR> <epsg2953> : NAD83(CSRS) / New Brunswick Stereo
-<BR> <epsg2954> : NAD83(CSRS) / Prince Edward Isl. Stereographic (NAD83)
-<BR> <epsg2955> : NAD83(CSRS) / UTM zone 11N
-<BR> <epsg2956> : NAD83(CSRS) / UTM zone 12N
-<BR> <epsg2957> : NAD83(CSRS) / UTM zone 13N
-<BR> <epsg2958> : NAD83(CSRS) / UTM zone 17N
-<BR> <epsg2959> : NAD83(CSRS) / UTM zone 18N
-<BR> <epsg2960> : NAD83(CSRS) / UTM zone 19N
-<BR> <epsg2961> : NAD83(CSRS) / UTM zone 20N
-<BR> <epsg2962> : NAD83(CSRS) / UTM zone 21N
-<BR> <epsg2964> : NAD27 / Alaska Albers
-<BR> <epsg2965> : NAD83 / Indiana East (ftUS)
-<BR> <epsg2966> : NAD83 / Indiana West (ftUS)
-<BR> <epsg2967> : NAD83(HARN) / Indiana East (ftUS)
-<BR> <epsg2968> : NAD83(HARN) / Indiana West (ftUS)
-<BR> <epsg2969> : Fort Marigot / UTM zone 20N
-<BR> <epsg2970> : Guadeloupe 1948 / UTM zone 20N
-<BR> <epsg2971> : CSG67 / UTM zone 22N
-<BR> <epsg2972> : RGFG95 / UTM zone 22N
-<BR> <epsg2973> : Martinique 1938 / UTM zone 20N
-<BR> <epsg2975> : RGR92 / UTM zone 40S
-<BR> <epsg2976> : Tahiti 52 / UTM zone 6S
-<BR> <epsg2977> : Tahaa 54 / UTM zone 5S
-<BR> <epsg2978> : IGN72 Nuku Hiva / UTM zone 7S
-<BR> <epsg2979> : K0 1949 / UTM zone 42S (deprecated)
-<BR> <epsg2980> : Combani 1950 / UTM zone 38S
-<BR> <epsg2981> : IGN56 Lifou / UTM zone 58S
-<BR> <epsg2982> : IGN72 Grand Terre / UTM zone 58S (deprecated)
-<BR> <epsg2983> : ST87 Ouvea / UTM zone 58S (deprecated)
-<BR> <epsg2984> : RGNC 1991 / Lambert New Caledonia (deprecated)
-<BR> <epsg2987> : Saint Pierre et Miquelon 1950 / UTM zone 21N
-<BR> <epsg2988> : MOP78 / UTM zone 1S
-<BR> <epsg2989> : RRAF 1991 / UTM zone 20N
-<BR> <epsg2990> : Reunion 1947 / TM Reunion (deprecated)
-<BR> <epsg2991> : NAD83 / Oregon Lambert
-<BR> <epsg2992> : NAD83 / Oregon Lambert (ft)
-<BR> <epsg2993> : NAD83(HARN) / Oregon Lambert
-<BR> <epsg2994> : NAD83(HARN) / Oregon Lambert (ft)
-<BR> <epsg2995> : IGN53 Mare / UTM zone 58S
-<BR> <epsg2996> : ST84 Ile des Pins / UTM zone 58S
-<BR> <epsg2997> : ST71 Belep / UTM zone 58S
-<BR> <epsg2998> : NEA74 Noumea / UTM zone 58S
-<BR> <epsg2999> : Grand Comoros / UTM zone 38S
-<BR> <epsg3000> : Segara / NEIEZ
-<BR> <epsg3001> : Batavia / NEIEZ
-<BR> <epsg3002> : Makassar / NEIEZ
-<BR> <epsg3003> : Monte Mario / Italy zone 1
-<BR> <epsg3004> : Monte Mario / Italy zone 2
-<BR> <epsg3005> : NAD83 / BC Albers
-<BR> <epsg3006> : SWEREF99 TM
-<BR> <epsg3007> : SWEREF99 12 00
-<BR> <epsg3008> : SWEREF99 13 30
-<BR> <epsg3009> : SWEREF99 15 00
-<BR> <epsg3010> : SWEREF99 16 30
-<BR> <epsg3011> : SWEREF99 18 00
-<BR> <epsg3012> : SWEREF99 14 15
-<BR> <epsg3013> : SWEREF99 15 45
-<BR> <epsg3014> : SWEREF99 17 15
-<BR> <epsg3015> : SWEREF99 18 45
-<BR> <epsg3016> : SWEREF99 20 15
-<BR> <epsg3017> : SWEREF99 21 45
-<BR> <epsg3018> : SWEREF99 23 15
-<BR> <epsg3019> : RT90 7.5 gon V
-<BR> <epsg3020> : RT90 5 gon V
-<BR> <epsg3021> : RT90 2.5 gon V
-<BR> <epsg3022> : RT90 0 gon
-<BR> <epsg3023> : RT90 2.5 gon O
-<BR> <epsg3024> : RT90 5 gon O
-<BR> <epsg3025> : RT38 7.5 gon V
-<BR> <epsg3026> : RT38 5 gon V
-<BR> <epsg3027> : RT38 2.5 gon V
-<BR> <epsg3028> : RT38 0 gon
-<BR> <epsg3029> : RT38 2.5 gon O
-<BR> <epsg3030> : RT38 5 gon O
-<BR> <epsg3031> : WGS 84 / Antarctic Polar Stereographic
-<BR> <epsg3032> : WGS 84 / Australian Antarctic Polar Stereographic
-<BR> <epsg3033> : WGS 84 / Australian Antarctic Lambert
-<BR> <epsg3034> : ETRS89 / ETRS-LCC
-<BR> <epsg3035> : ETRS89 / ETRS-LAEA
-<BR> <epsg3036> : Moznet / UTM zone 36S
-<BR> <epsg3037> : Moznet / UTM zone 37S
-<BR> <epsg3038> : ETRS89 / ETRS-TM26
-<BR> <epsg3039> : ETRS89 / ETRS-TM27
-<BR> <epsg3040> : ETRS89 / ETRS-TM28
-<BR> <epsg3041> : ETRS89 / ETRS-TM29
-<BR> <epsg3042> : ETRS89 / ETRS-TM30
-<BR> <epsg3043> : ETRS89 / ETRS-TM31
-<BR> <epsg3044> : ETRS89 / ETRS-TM32
-<BR> <epsg3045> : ETRS89 / ETRS-TM33
-<BR> <epsg3046> : ETRS89 / ETRS-TM34
-<BR> <epsg3047> : ETRS89 / ETRS-TM35
-<BR> <epsg3048> : ETRS89 / ETRS-TM36
-<BR> <epsg3049> : ETRS89 / ETRS-TM37
-<BR> <epsg3050> : ETRS89 / ETRS-TM38
-<BR> <epsg3051> : ETRS89 / ETRS-TM39
-<BR> <epsg3054> : Hjorsey 1955 / UTM zone 26N
-<BR> <epsg3055> : Hjorsey 1955 / UTM zone 27N
-<BR> <epsg3056> : Hjorsey 1955 / UTM zone 28N
-<BR> <epsg3057> : ISN93 / Lambert 1993
-<BR> <epsg3058> : Helle 1954 / Jan Mayen Grid
-<BR> <epsg3059> : LKS92 / Latvia TM
-<BR> <epsg3060> : IGN72 Grande Terre / UTM zone 58S
-<BR> <epsg3061> : Porto Santo 1995 / UTM zone 28N
-<BR> <epsg3062> : Azores Oriental 1995 / UTM zone 26N
-<BR> <epsg3063> : Azores Central 1995 / UTM zone 26N
-<BR> <epsg3064> : IGM95 / UTM zone 32N
-<BR> <epsg3065> : IGM95 / UTM zone 33N
-<BR> <epsg3066> : ED50 / Jordan TM
-<BR> <epsg3067> : ETRS89 / ETRS-TM35FIN
-<BR> <epsg3068> : DHDN / Soldner Berlin
-<BR> <epsg3069> : NAD27 / Wisconsin Transverse Mercator
-<BR> <epsg3070> : NAD83 / Wisconsin Transverse Mercator
-<BR> <epsg3071> : NAD83(HARN) / Wisconsin Transverse Mercator
-<BR> <epsg3072> : NAD83 / Maine CS2000 East
-<BR> <epsg3073> : NAD83 / Maine CS2000 Central (deprecated)
-<BR> <epsg3074> : NAD83 / Maine CS2000 West
-<BR> <epsg3075> : NAD83(HARN) / Maine CS2000 East
-<BR> <epsg3076> : NAD83(HARN) / Maine CS2000 Central (deprecated)
-<BR> <epsg3077> : NAD83(HARN) / Maine CS2000 West
-<BR> <epsg3078> : NAD83 / Michigan Oblique Mercator
-<BR> <epsg3079> : NAD83(HARN) / Michigan Oblique Mercator
-<BR> <epsg3080> : NAD27 / Shackleford
-<BR> <epsg3081> : NAD83 / Texas State Mapping System
-<BR> <epsg3082> : NAD83 / Texas Centric Lambert Conformal
-<BR> <epsg3083> : NAD83 / Texas Centric Albers Equal Area
-<BR> <epsg3084> : NAD83(HARN) / Texas Centric Lambert Conformal
-<BR> <epsg3085> : NAD83(HARN) / Texas Centric Albers Equal Area
-<BR> <epsg3086> : NAD83 / Florida GDL Albers
-<BR> <epsg3087> : NAD83(HARN) / Florida GDL Albers
-<BR> <epsg3088> : NAD83 / Kentucky Single Zone
-<BR> <epsg3089> : NAD83 / Kentucky Single Zone (ftUS)
-<BR> <epsg3090> : NAD83(HARN) / Kentucky Single Zone
-<BR> <epsg3091> : NAD83(HARN) / Kentucky Single Zone (ftUS)
-<BR> <epsg3092> : Tokyo / UTM zone 51N
-<BR> <epsg3093> : Tokyo / UTM zone 52N
-<BR> <epsg3094> : Tokyo / UTM zone 53N
-<BR> <epsg3095> : Tokyo / UTM zone 54N
-<BR> <epsg3096> : Tokyo / UTM zone 55N
-<BR> <epsg3097> : JGD2000 / UTM zone 51N
-<BR> <epsg3098> : JGD2000 / UTM zone 52N
-<BR> <epsg3099> : JGD2000 / UTM zone 53N
-<BR> <epsg3100> : JGD2000 / UTM zone 54N
-<BR> <epsg3101> : JGD2000 / UTM zone 55N
-<BR> <epsg3102> : American Samoa 1962 / American Samoa Lambert
-<BR> <epsg3103> : Mauritania 1999 / UTM zone 28N (deprecated)
-<BR> <epsg3104> : Mauritania 1999 / UTM zone 29N (deprecated)
-<BR> <epsg3105> : Mauritania 1999 / UTM zone 30N (deprecated)
-<BR> <epsg3106> : Gulshan 303 / Bangladesh Transverse Mercator
-<BR> <epsg3107> : GDA94 / SA Lambert
-<BR> <epsg3108> : ETRS89 / Guernsey Grid
-<BR> <epsg3109> : ETRS89 / Jersey Transverse Mercator
-<BR> <epsg3110> : AGD66 / Vicgrid66
-<BR> <epsg3111> : GDA94 / Vicgrid94
-<BR> <epsg3112> : GDA94 / Geoscience Australia Lambert
-<BR> <epsg3113> : GDA94 / BCSG02
-<BR> <epsg3114> : MAGNA-SIRGAS / Colombia Far West zone
-<BR> <epsg3115> : MAGNA-SIRGAS / Colombia West zone
-<BR> <epsg3116> : MAGNA-SIRGAS / Colombia Bogota zone
-<BR> <epsg3117> : MAGNA-SIRGAS / Colombia East Central zone
-<BR> <epsg3118> : MAGNA-SIRGAS / Colombia East zone
-<BR> <epsg3119> : Douala 1948 / AEF west
-<BR> <epsg3120> : Pulkovo 1942(58) / Poland zone I
-<BR> <epsg3121> : PRS92 / Philippines zone 1
-<BR> <epsg3122> : PRS92 / Philippines zone 2
-<BR> <epsg3123> : PRS92 / Philippines zone 3
-<BR> <epsg3124> : PRS92 / Philippines zone 4
-<BR> <epsg3125> : PRS92 / Philippines zone 5
-<BR> <epsg3126> : ETRS89 / ETRS-GK19FIN
-<BR> <epsg3127> : ETRS89 / ETRS-GK20FIN
-<BR> <epsg3128> : ETRS89 / ETRS-GK21FIN
-<BR> <epsg3129> : ETRS89 / ETRS-GK22FIN
-<BR> <epsg3130> : ETRS89 / ETRS-GK23FIN
-<BR> <epsg3131> : ETRS89 / ETRS-GK24FIN
-<BR> <epsg3132> : ETRS89 / ETRS-GK25FIN
-<BR> <epsg3133> : ETRS89 / ETRS-GK26FIN
-<BR> <epsg3134> : ETRS89 / ETRS-GK27FIN
-<BR> <epsg3135> : ETRS89 / ETRS-GK28FIN
-<BR> <epsg3136> : ETRS89 / ETRS-GK29FIN
-<BR> <epsg3137> : ETRS89 / ETRS-GK30FIN
-<BR> <epsg3138> : ETRS89 / ETRS-GK31FIN
-<BR> <epsg3140> : Viti Levu 1912 / Viti Levu Grid
-<BR> <epsg3141> : Fiji 1956 / UTM zone 60S
-<BR> <epsg3142> : Fiji 1956 / UTM zone 1S
-<BR> <epsg3143> : Fiji 1986 / Fiji Map Grid (deprecated)
-<BR> <epsg3146> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 6
-<BR> <epsg3147> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 18E
-<BR> <epsg3148> : Indian 1960 / UTM zone 48N
-<BR> <epsg3149> : Indian 1960 / UTM zone 49N
-<BR> <epsg3150> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 6
-<BR> <epsg3151> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 18E
-<BR> <epsg3152> : ST74
-<BR> <epsg3153> : NAD83(CSRS) / BC Albers
-<BR> <epsg3154> : NAD83(CSRS) / UTM zone 7N
-<BR> <epsg3155> : NAD83(CSRS) / UTM zone 8N
-<BR> <epsg3156> : NAD83(CSRS) / UTM zone 9N
-<BR> <epsg3157> : NAD83(CSRS) / UTM zone 10N
-<BR> <epsg3158> : NAD83(CSRS) / UTM zone 14N
-<BR> <epsg3159> : NAD83(CSRS) / UTM zone 15N
-<BR> <epsg3160> : NAD83(CSRS) / UTM zone 16N
-<BR> <epsg3161> : NAD83 / Ontario MNR Lambert
-<BR> <epsg3162> : NAD83(CSRS) / Ontario MNR Lambert
-<BR> <epsg3163> : RGNC91-93 / Lambert New Caledonia
-<BR> <epsg3164> : ST87 Ouvea / UTM zone 58S
-<BR> <epsg3165> : NEA74 Noumea / Noumea Lambert
-<BR> <epsg3166> : NEA74 Noumea / Noumea Lambert 2
-<BR> <epsg3167> : Kertau (RSO) / RSO Malaya (ch)
-<BR> <epsg3168> : Kertau (RSO) / RSO Malaya (m)
-<BR> <epsg3169> : RGNC91-93 / UTM zone 57S
-<BR> <epsg3170> : RGNC91-93 / UTM zone 58S
-<BR> <epsg3171> : RGNC91-93 / UTM zone 59S
-<BR> <epsg3172> : IGN53 Mare / UTM zone 59S
-<BR> <epsg3174> : NAD83 / Great Lakes Albers
-<BR> <epsg3175> : NAD83 / Great Lakes and St Lawrence Albers
-<BR> <epsg3176> : Indian 1960 / TM 106 NE
-<BR> <epsg3177> : LGD2006 / Libya TM
-<BR> <epsg3178> : GR96 / UTM zone 18N
-<BR> <epsg3179> : GR96 / UTM zone 19N
-<BR> <epsg3180> : GR96 / UTM zone 20N
-<BR> <epsg3181> : GR96 / UTM zone 21N
-<BR> <epsg3182> : GR96 / UTM zone 22N
-<BR> <epsg3183> : GR96 / UTM zone 23N
-<BR> <epsg3184> : GR96 / UTM zone 24N
-<BR> <epsg3185> : GR96 / UTM zone 25N
-<BR> <epsg3186> : GR96 / UTM zone 26N
-<BR> <epsg3187> : GR96 / UTM zone 27N
-<BR> <epsg3188> : GR96 / UTM zone 28N
-<BR> <epsg3189> : GR96 / UTM zone 29N
-<BR> <epsg3190> : LGD2006 / Libya TM zone 5
-<BR> <epsg3191> : LGD2006 / Libya TM zone 6
-<BR> <epsg3192> : LGD2006 / Libya TM zone 7
-<BR> <epsg3193> : LGD2006 / Libya TM zone 8
-<BR> <epsg3194> : LGD2006 / Libya TM zone 9
-<BR> <epsg3195> : LGD2006 / Libya TM zone 10
-<BR> <epsg3196> : LGD2006 / Libya TM zone 11
-<BR> <epsg3197> : LGD2006 / Libya TM zone 12
-<BR> <epsg3198> : LGD2006 / Libya TM zone 13
-<BR> <epsg3199> : LGD2006 / UTM zone 32N
-<BR> <epsg3200> : FD58 / Iraq zone
-<BR> <epsg3201> : LGD2006 / UTM zone 33N
-<BR> <epsg3202> : LGD2006 / UTM zone 34N
-<BR> <epsg3203> : LGD2006 / UTM zone 35N
-<BR> <epsg3204> : WGS 84 / SCAR IMW SP19-20
-<BR> <epsg3205> : WGS 84 / SCAR IMW SP21-22
-<BR> <epsg3206> : WGS 84 / SCAR IMW SP23-24
-<BR> <epsg3207> : WGS 84 / SCAR IMW SQ01-02
-<BR> <epsg3208> : WGS 84 / SCAR IMW SQ19-20
-<BR> <epsg3209> : WGS 84 / SCAR IMW SQ21-22
-<BR> <epsg3210> : WGS 84 / SCAR IMW SQ37-38
-<BR> <epsg3211> : WGS 84 / SCAR IMW SQ39-40
-<BR> <epsg3212> : WGS 84 / SCAR IMW SQ41-42
-<BR> <epsg3213> : WGS 84 / SCAR IMW SQ43-44
-<BR> <epsg3214> : WGS 84 / SCAR IMW SQ45-46
-<BR> <epsg3215> : WGS 84 / SCAR IMW SQ47-48
-<BR> <epsg3216> : WGS 84 / SCAR IMW SQ49-50
-<BR> <epsg3217> : WGS 84 / SCAR IMW SQ51-52
-<BR> <epsg3218> : WGS 84 / SCAR IMW SQ53-54
-<BR> <epsg3219> : WGS 84 / SCAR IMW SQ55-56
-<BR> <epsg3220> : WGS 84 / SCAR IMW SQ57-58
-<BR> <epsg3221> : WGS 84 / SCAR IMW SR13-14
-<BR> <epsg3222> : WGS 84 / SCAR IMW SR15-16
-<BR> <epsg3223> : WGS 84 / SCAR IMW SR17-18
-<BR> <epsg3224> : WGS 84 / SCAR IMW SR19-20
-<BR> <epsg3225> : WGS 84 / SCAR IMW SR27-28
-<BR> <epsg3226> : WGS 84 / SCAR IMW SR29-30
-<BR> <epsg3227> : WGS 84 / SCAR IMW SR31-32
-<BR> <epsg3228> : WGS 84 / SCAR IMW SR33-34
-<BR> <epsg3229> : WGS 84 / SCAR IMW SR35-36
-<BR> <epsg3230> : WGS 84 / SCAR IMW SR37-38
-<BR> <epsg3231> : WGS 84 / SCAR IMW SR39-40
-<BR> <epsg3232> : WGS 84 / SCAR IMW SR41-42
-<BR> <epsg3233> : WGS 84 / SCAR IMW SR43-44
-<BR> <epsg3234> : WGS 84 / SCAR IMW SR45-46
-<BR> <epsg3235> : WGS 84 / SCAR IMW SR47-48
-<BR> <epsg3236> : WGS 84 / SCAR IMW SR49-50
-<BR> <epsg3237> : WGS 84 / SCAR IMW SR51-52
-<BR> <epsg3238> : WGS 84 / SCAR IMW SR53-54
-<BR> <epsg3239> : WGS 84 / SCAR IMW SR55-56
-<BR> <epsg3240> : WGS 84 / SCAR IMW SR57-58
-<BR> <epsg3241> : WGS 84 / SCAR IMW SR59-60
-<BR> <epsg3242> : WGS 84 / SCAR IMW SS04-06
-<BR> <epsg3243> : WGS 84 / SCAR IMW SS07-09
-<BR> <epsg3244> : WGS 84 / SCAR IMW SS10-12
-<BR> <epsg3245> : WGS 84 / SCAR IMW SS13-15
-<BR> <epsg3246> : WGS 84 / SCAR IMW SS16-18
-<BR> <epsg3247> : WGS 84 / SCAR IMW SS19-21
-<BR> <epsg3248> : WGS 84 / SCAR IMW SS25-27
-<BR> <epsg3249> : WGS 84 / SCAR IMW SS28-30
-<BR> <epsg3250> : WGS 84 / SCAR IMW SS31-33
-<BR> <epsg3251> : WGS 84 / SCAR IMW SS34-36
-<BR> <epsg3252> : WGS 84 / SCAR IMW SS37-39
-<BR> <epsg3253> : WGS 84 / SCAR IMW SS40-42
-<BR> <epsg3254> : WGS 84 / SCAR IMW SS43-45
-<BR> <epsg3255> : WGS 84 / SCAR IMW SS46-48
-<BR> <epsg3256> : WGS 84 / SCAR IMW SS49-51
-<BR> <epsg3257> : WGS 84 / SCAR IMW SS52-54
-<BR> <epsg3258> : WGS 84 / SCAR IMW SS55-57
-<BR> <epsg3259> : WGS 84 / SCAR IMW SS58-60
-<BR> <epsg3260> : WGS 84 / SCAR IMW ST01-04
-<BR> <epsg3261> : WGS 84 / SCAR IMW ST05-08
-<BR> <epsg3262> : WGS 84 / SCAR IMW ST09-12
-<BR> <epsg3263> : WGS 84 / SCAR IMW ST13-16
-<BR> <epsg3264> : WGS 84 / SCAR IMW ST17-20
-<BR> <epsg3265> : WGS 84 / SCAR IMW ST21-24
-<BR> <epsg3266> : WGS 84 / SCAR IMW ST25-28
-<BR> <epsg3267> : WGS 84 / SCAR IMW ST29-32
-<BR> <epsg3268> : WGS 84 / SCAR IMW ST33-36
-<BR> <epsg3269> : WGS 84 / SCAR IMW ST37-40
-<BR> <epsg3270> : WGS 84 / SCAR IMW ST41-44
-<BR> <epsg3271> : WGS 84 / SCAR IMW ST45-48
-<BR> <epsg3272> : WGS 84 / SCAR IMW ST49-52
-<BR> <epsg3273> : WGS 84 / SCAR IMW ST53-56
-<BR> <epsg3274> : WGS 84 / SCAR IMW ST57-60
-<BR> <epsg3275> : WGS 84 / SCAR IMW SU01-05
-<BR> <epsg3276> : WGS 84 / SCAR IMW SU06-10
-<BR> <epsg3277> : WGS 84 / SCAR IMW SU11-15
-<BR> <epsg3278> : WGS 84 / SCAR IMW SU16-20
-<BR> <epsg3279> : WGS 84 / SCAR IMW SU21-25
-<BR> <epsg3280> : WGS 84 / SCAR IMW SU26-30
-<BR> <epsg3281> : WGS 84 / SCAR IMW SU31-35
-<BR> <epsg3282> : WGS 84 / SCAR IMW SU36-40
-<BR> <epsg3283> : WGS 84 / SCAR IMW SU41-45
-<BR> <epsg3284> : WGS 84 / SCAR IMW SU46-50
-<BR> <epsg3285> : WGS 84 / SCAR IMW SU51-55
-<BR> <epsg3286> : WGS 84 / SCAR IMW SU56-60
-<BR> <epsg3287> : WGS 84 / SCAR IMW SV01-10
-<BR> <epsg3288> : WGS 84 / SCAR IMW SV11-20
-<BR> <epsg3289> : WGS 84 / SCAR IMW SV21-30
-<BR> <epsg3290> : WGS 84 / SCAR IMW SV31-40
-<BR> <epsg3291> : WGS 84 / SCAR IMW SV41-50
-<BR> <epsg3292> : WGS 84 / SCAR IMW SV51-60
-<BR> <epsg3293> : WGS 84 / SCAR IMW SW01-60
-<BR> <epsg3294> : WGS 84 / USGS Transantarctic Mountains
-<BR> <epsg3296> : RGPF / UTM zone 5S
-<BR> <epsg3297> : RGPF / UTM zone 6S
-<BR> <epsg3298> : RGPF / UTM zone 7S
-<BR> <epsg3299> : RGPF / UTM zone 8S
-<BR> <epsg3300> : Estonian Coordinate System of 1992
-<BR> <epsg3301> : Estonian Coordinate System of 1997
-<BR> <epsg3302> : IGN63 Hiva Oa / UTM zone 7S
-<BR> <epsg3303> : Fatu Iva 72 / UTM zone 7S
-<BR> <epsg3304> : Tahiti 79 / UTM zone 6S
-<BR> <epsg3305> : Moorea 87 / UTM zone 6S
-<BR> <epsg3306> : Maupiti 83 / UTM zone 5S
-<BR> <epsg3307> : Nakhl-e Ghanem / UTM zone 39N
-<BR> <epsg3308> : GDA94 / NSW Lambert
-<BR> <epsg3309> : NAD27 / California Albers
-<BR> <epsg3310> : NAD83 / California Albers
-<BR> <epsg3311> : NAD83(HARN) / California Albers
-<BR> <epsg3312> : CSG67 / UTM zone 21N
-<BR> <epsg3313> : RGFG95 / UTM zone 21N
-<BR> <epsg3314> : Katanga 1955 / Katanga Lambert
-<BR> <epsg3315> : Katanga 1955 / Katanga TM
-<BR> <epsg3316> : Kasai 1953 / Congo TM zone 22
-<BR> <epsg3317> : Kasai 1953 / Congo TM zone 24
-<BR> <epsg3318> : IGC 1962 / Congo TM zone 12
-<BR> <epsg3319> : IGC 1962 / Congo TM zone 14
-<BR> <epsg3320> : IGC 1962 / Congo TM zone 16
-<BR> <epsg3321> : IGC 1962 / Congo TM zone 18
-<BR> <epsg3322> : IGC 1962 / Congo TM zone 20
-<BR> <epsg3323> : IGC 1962 / Congo TM zone 22
-<BR> <epsg3324> : IGC 1962 / Congo TM zone 24
-<BR> <epsg3325> : IGC 1962 / Congo TM zone 26
-<BR> <epsg3326> : IGC 1962 / Congo TM zone 28
-<BR> <epsg3327> : IGC 1962 / Congo TM zone 30
-<BR> <epsg3328> : Pulkovo 1942(58) / GUGiK-80
-<BR> <epsg3329> : Pulkovo 1942(58) / 3-degree Gauss-Kruger zone 5
-<BR> <epsg3330> : Pulkovo 1942(58) / 3-degree Gauss-Kruger zone 6
-<BR> <epsg3331> : Pulkovo 1942(58) / 3-degree Gauss-Kruger zone 7
-<BR> <epsg3332> : Pulkovo 1942(58) / 3-degree Gauss-Kruger zone 8
-<BR> <epsg3333> : Pulkovo 1942(58) / Gauss-Kruger zone 3
-<BR> <epsg3334> : Pulkovo 1942(58) / Gauss-Kruger zone 4
-<BR> <epsg3335> : Pulkovo 1942(58) / Gauss-Kruger zone 5
-<BR> <epsg3336> : IGN 1962 Kerguelen / UTM zone 42S
-<BR> <epsg3337> : Le Pouce 1934 / Mauritius Grid
-<BR> <epsg3338> : NAD83 / Alaska Albers
-<BR> <epsg3339> : IGCB 1955 / Congo TM zone 12
-<BR> <epsg3340> : IGCB 1955 / Congo TM zone 14
-<BR> <epsg3341> : IGCB 1955 / Congo TM zone 16
-<BR> <epsg3342> : IGCB 1955 / UTM zone 33S
-<BR> <epsg3343> : Mauritania 1999 / UTM zone 28N
-<BR> <epsg3344> : Mauritania 1999 / UTM zone 29N
-<BR> <epsg3345> : Mauritania 1999 / UTM zone 30N
-<BR> <epsg3346> : LKS94 / Lithuania TM
-<BR> <epsg3347> : NAD83 / Statistics Canada Lambert
-<BR> <epsg3348> : NAD83(CSRS) / Statistics Canada Lambert
-<BR> <epsg3349> : WGS 84 / PDC Mercator
-<BR> <epsg3350> : Pulkovo 1942 / CS63 zone C0
-<BR> <epsg3351> : Pulkovo 1942 / CS63 zone C1
-<BR> <epsg3352> : Pulkovo 1942 / CS63 zone C2
-<BR> <epsg3353> : Mhast (onshore) / UTM zone 32S
-<BR> <epsg3354> : Mhast (offshore) / UTM zone 32S
-<BR> <epsg3355> : Egypt Gulf of Suez S-650 TL / Red Belt
-<BR> <epsg3356> : Grand Cayman 1959 / UTM zone 17N
-<BR> <epsg3357> : Little Cayman 1961 / UTM zone 17N
-<BR> <epsg3358> : NAD83(HARN) / North Carolina
-<BR> <epsg3359> : NAD83(HARN) / North Carolina (ftUS) (deprecated)
-<BR> <epsg3360> : NAD83(HARN) / South Carolina
-<BR> <epsg3361> : NAD83(HARN) / South Carolina (ft)
-<BR> <epsg3362> : NAD83(HARN) / Pennsylvania North
-<BR> <epsg3363> : NAD83(HARN) / Pennsylvania North (ftUS)
-<BR> <epsg3364> : NAD83(HARN) / Pennsylvania South
-<BR> <epsg3365> : NAD83(HARN) / Pennsylvania South (ftUS)
-<BR> <epsg3366> : Hong Kong 1963 Grid System (deprecated)
-<BR> <epsg3367> : IGN Astro 1960 / UTM zone 28N
-<BR> <epsg3368> : IGN Astro 1960 / UTM zone 29N
-<BR> <epsg3369> : IGN Astro 1960 / UTM zone 30N
-<BR> <epsg3370> : NAD27 / UTM zone 59N
-<BR> <epsg3371> : NAD27 / UTM zone 60N
-<BR> <epsg3372> : NAD83 / UTM zone 59N
-<BR> <epsg3373> : NAD83 / UTM zone 60N
-<BR> <epsg3374> : FD54 / UTM zone 29N
-<BR> <epsg3375> : GDM2000 / Peninsula RSO
-<BR> <epsg3376> : GDM2000 / East Malaysia BRSO
-<BR> <epsg3377> : GDM2000 / Johor Grid
-<BR> <epsg3378> : GDM2000 / Sembilan and Melaka Grid
-<BR> <epsg3379> : GDM2000 / PahangGrid
-<BR> <epsg3380> : GDM2000 / Selangor Grid
-<BR> <epsg3381> : GDM2000 / Terengganu Grid
-<BR> <epsg3382> : GDM2000 / Pinang Grid
-<BR> <epsg3383> : GDM2000 / Kedah and Perlis Grid
-<BR> <epsg3384> : GDM2000 / Perak Grid
-<BR> <epsg3385> : GDM2000 / Kelantan Grid
-<BR> <epsg3386> : KKJ / Finland zone 0
-<BR> <epsg3387> : KKJ / Finland zone 5
-<BR> <epsg3388> : Pulkovo 1942 / Caspian Sea Mercator
-<BR> <epsg3389> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 60
-<BR> <epsg3390> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 60
-<BR> <epsg3391> : Karbala 1979 (Polservice) / UTM zone 37N
-<BR> <epsg3392> : Karbala 1979 (Polservice) / UTM zone 38N
-<BR> <epsg3393> : Karbala 1979 (Polservice) / UTM zone 39N
-<BR> <epsg3394> : Nahrwan 1934 / Iraq zone
-<BR> <epsg3395> : WGS 84 / World Mercator
-<BR> <epsg3396> : PD/83 / Gauss-Kruger zone 3
-<BR> <epsg3397> : PD/83 / Gauss-Kruger zone 4
-<BR> <epsg3398> : RD/83 / Gauss-Kruger zone 4
-<BR> <epsg3399> : RD/83 / Gauss-Kruger zone 5
-<BR> <epsg3400> : NAD83 / Alberta 10-TM (Forest)
-<BR> <epsg3401> : NAD83 / Alberta 10-TM (Resource)
-<BR> <epsg3402> : NAD83(CSRS) / Alberta 10-TM (Forest)
-<BR> <epsg3403> : NAD83(CSRS) / Alberta 10-TM (Resource)
-<BR> <epsg3404> : NAD83(HARN) / North Carolina (ftUS)
-<BR> <epsg3405> : VN-2000 / UTM zone 48N
-<BR> <epsg3406> : VN-2000 / UTM zone 49N
-<BR> <epsg3407> : Hong Kong 1963 Grid System
-<BR> <epsg3408> : NSIDC EASE-Grid North
-<BR> <epsg3409> : NSIDC EASE-Grid South
-<BR> <epsg3411> : NSIDC Sea Ice Polar Stereographic North
-<BR> <epsg3412> : NSIDC Sea Ice Polar Stereographic South
-<BR> <epsg3413> : WGS 84 / NSIDC Sea Ice Polar Stereographic North
-<BR> <epsg3414> : SVY21 / Singapore TM
-<BR> <epsg3415> : WGS 72BE / South China Sea Lambert
-<BR> <epsg3416> : ETRS89 / Austria Lambert
-<BR> <epsg3417> : NAD83 / Iowa North (ft US)
-<BR> <epsg3418> : NAD83 / Iowa South (ft US)
-<BR> <epsg3419> : NAD83 / Kansas North (ft US)
-<BR> <epsg3420> : NAD83 / Kansas South (ft US)
-<BR> <epsg3421> : NAD83 / Nevada East (ft US)
-<BR> <epsg3422> : NAD83 / Nevada Central (ft US)
-<BR> <epsg3423> : NAD83 / Nevada West (ft US)
-<BR> <epsg3424> : NAD83 / New Jersey (ft US)
-<BR> <epsg3425> : NAD83(HARN) / Iowa North (ft US)
-<BR> <epsg3426> : NAD83(HARN) / Iowa South (ft US)
-<BR> <epsg3427> : NAD83(HARN) / Kansas North (ft US)
-<BR> <epsg3428> : NAD83(HARN) / Kansas South (ft US)
-<BR> <epsg3429> : NAD83(HARN) / Nevada East (ft US)
-<BR> <epsg3430> : NAD83(HARN) / Nevada Central (ft US)
-<BR> <epsg3431> : NAD83(HARN) / Nevada West (ft US)
-<BR> <epsg3432> : NAD83(HARN) / New Jersey (ft US)
-<BR> <epsg3433> : NAD83 / Arkansas North (ftUS)
-<BR> <epsg3434> : NAD83 / Arkansas South (ftUS)
-<BR> <epsg3435> : NAD83 / Illinois East (ftUS)
-<BR> <epsg3436> : NAD83 / Illinois West (ftUS)
-<BR> <epsg3437> : NAD83 / New Hampshire (ftUS)
-<BR> <epsg3438> : NAD83 / Rhode Island (ftUS)
-<BR> <epsg3439> : PSD93 / UTM zone 39N
-<BR> <epsg3440> : PSD93 / UTM zone 40N
-<BR> <epsg3441> : NAD83(HARN) / Arkansas North (ftUS)
-<BR> <epsg3442> : NAD83(HARN) / Arkansas South (ftUS)
-<BR> <epsg3443> : NAD83(HARN) / Illinois East (ftUS)
-<BR> <epsg3444> : NAD83(HARN) / Illinois West (ftUS)
-<BR> <epsg3445> : NAD83(HARN) / New Hampshire (ftUS)
-<BR> <epsg3446> : NAD83(HARN) / Rhode Island (ftUS)
-<BR> <epsg3447> : ETRS89 / Belgian Lambert 2005
-<BR> <epsg3448> : JAD2001 / Jamaica Metric Grid
-<BR> <epsg3449> : JAD2001 / UTM zone 17N
-<BR> <epsg3450> : JAD2001 / UTM zone 18N
-<BR> <epsg3451> : NAD83 / Louisiana North (ftUS)
-<BR> <epsg3452> : NAD83 / Louisiana South (ftUS)
-<BR> <epsg3453> : NAD83 / Louisiana Offshore (ftUS)
-<BR> <epsg3454> : NAD83 / South Dakota North (ftUS)
-<BR> <epsg3455> : NAD83 / South Dakota South (ftUS)
-<BR> <epsg3456> : NAD83(HARN) / Louisiana North (ftUS)
-<BR> <epsg3457> : NAD83(HARN) / Louisiana South (ftUS)
-<BR> <epsg3458> : NAD83(HARN) / South Dakota North (ftUS)
-<BR> <epsg3459> : NAD83(HARN) / South Dakota South (ftUS)
-<BR> <epsg3460> : Fiji 1986 / Fiji Map Grid
-<BR> <epsg3461> : Dabola 1981 / UTM zone 28N
-<BR> <epsg3462> : Dabola 1981 / UTM zone 29N
-<BR> <epsg3463> : NAD83 / Maine CS2000 Central
-<BR> <epsg3464> : NAD83(HARN) / Maine CS2000 Central
-<BR> <epsg3465> : NAD83(NSRS2007) / Alabama East
-<BR> <epsg3466> : NAD83(NSRS2007) / Alabama West
-<BR> <epsg3467> : NAD83(NSRS2007) / Alaska Albers
-<BR> <epsg3468> : NAD83(NSRS2007) / Alaska zone 1
-<BR> <epsg3469> : NAD83(NSRS2007) / Alaska zone 2
-<BR> <epsg3470> : NAD83(NSRS2007) / Alaska zone 3
-<BR> <epsg3471> : NAD83(NSRS2007) / Alaska zone 4
-<BR> <epsg3472> : NAD83(NSRS2007) / Alaska zone 5
-<BR> <epsg3473> : NAD83(NSRS2007) / Alaska zone 6
-<BR> <epsg3474> : NAD83(NSRS2007) / Alaska zone 7
-<BR> <epsg3475> : NAD83(NSRS2007) / Alaska zone 8
-<BR> <epsg3476> : NAD83(NSRS2007) / Alaska zone 9
-<BR> <epsg3477> : NAD83(NSRS2007) / Alaska zone 10
-<BR> <epsg3478> : NAD83(NSRS2007) / Arizona Central
-<BR> <epsg3479> : NAD83(NSRS2007) / Arizona Central (ft)
-<BR> <epsg3480> : NAD83(NSRS2007) / Arizona East
-<BR> <epsg3481> : NAD83(NSRS2007) / Arizona East (ft)
-<BR> <epsg3482> : NAD83(NSRS2007) / Arizona West
-<BR> <epsg3483> : NAD83(NSRS2007) / Arizona West (ft)
-<BR> <epsg3484> : NAD83(NSRS2007) / Arkansas North
-<BR> <epsg3485> : NAD83(NSRS2007) / Arkansas North (ftUS)
-<BR> <epsg3486> : NAD83(NSRS2007) / Arkansas South
-<BR> <epsg3487> : NAD83(NSRS2007) / Arkansas South (ftUS)
-<BR> <epsg3488> : NAD83(NSRS2007) / California Albers
-<BR> <epsg3489> : NAD83(NSRS2007) / California zone 1
-<BR> <epsg3490> : NAD83(NSRS2007) / California zone 1 (ftUS)
-<BR> <epsg3491> : NAD83(NSRS2007) / California zone 2
-<BR> <epsg3492> : NAD83(NSRS2007) / California zone 2 (ftUS)
-<BR> <epsg3493> : NAD83(NSRS2007) / California zone 3
-<BR> <epsg3494> : NAD83(NSRS2007) / California zone 3 (ftUS)
-<BR> <epsg3495> : NAD83(NSRS2007) / California zone 4
-<BR> <epsg3496> : NAD83(NSRS2007) / California zone 4 (ftUS)
-<BR> <epsg3497> : NAD83(NSRS2007) / California zone 5
-<BR> <epsg3498> : NAD83(NSRS2007) / California zone 5 (ftUS)
-<BR> <epsg3499> : NAD83(NSRS2007) / California zone 6
-<BR> <epsg3500> : NAD83(NSRS2007) / California zone 6 (ftUS)
-<BR> <epsg3501> : NAD83(NSRS2007) / Colorado Central
-<BR> <epsg3502> : NAD83(NSRS2007) / Colorado Central (ftUS)
-<BR> <epsg3503> : NAD83(NSRS2007) / Colorado North
-<BR> <epsg3504> : NAD83(NSRS2007) / Colorado North (ftUS)
-<BR> <epsg3505> : NAD83(NSRS2007) / Colorado South
-<BR> <epsg3506> : NAD83(NSRS2007) / Colorado South (ftUS)
-<BR> <epsg3507> : NAD83(NSRS2007) / Connecticut
-<BR> <epsg3508> : NAD83(NSRS2007) / Connecticut (ftUS)
-<BR> <epsg3509> : NAD83(NSRS2007) / Delaware
-<BR> <epsg3510> : NAD83(NSRS2007) / Delaware (ftUS)
-<BR> <epsg3511> : NAD83(NSRS2007) / Florida East
-<BR> <epsg3512> : NAD83(NSRS2007) / Florida East (ftUS)
-<BR> <epsg3513> : NAD83(NSRS2007) / Florida GDL Albers
-<BR> <epsg3514> : NAD83(NSRS2007) / Florida North
-<BR> <epsg3515> : NAD83(NSRS2007) / Florida North (ftUS)
-<BR> <epsg3516> : NAD83(NSRS2007) / Florida West
-<BR> <epsg3517> : NAD83(NSRS2007) / Florida West (ftUS)
-<BR> <epsg3518> : NAD83(NSRS2007) / Georgia East
-<BR> <epsg3519> : NAD83(NSRS2007) / Georgia East (ftUS)
-<BR> <epsg3520> : NAD83(NSRS2007) / Georgia West
-<BR> <epsg3521> : NAD83(NSRS2007) / Georgia West (ftUS)
-<BR> <epsg3522> : NAD83(NSRS2007) / Idaho Central
-<BR> <epsg3523> : NAD83(NSRS2007) / Idaho Central (ftUS)
-<BR> <epsg3524> : NAD83(NSRS2007) / Idaho East
-<BR> <epsg3525> : NAD83(NSRS2007) / Idaho East (ftUS)
-<BR> <epsg3526> : NAD83(NSRS2007) / Idaho West
-<BR> <epsg3527> : NAD83(NSRS2007) / Idaho West (ftUS)
-<BR> <epsg3528> : NAD83(NSRS2007) / Illinois East
-<BR> <epsg3529> : NAD83(NSRS2007) / Illinois East (ftUS)
-<BR> <epsg3530> : NAD83(NSRS2007) / Illinois West
-<BR> <epsg3531> : NAD83(NSRS2007) / Illinois West (ftUS)
-<BR> <epsg3532> : NAD83(NSRS2007) / Indiana East
-<BR> <epsg3533> : NAD83(NSRS2007) / Indiana East (ftUS)
-<BR> <epsg3534> : NAD83(NSRS2007) / Indiana West
-<BR> <epsg3535> : NAD83(NSRS2007) / Indiana West (ftUS)
-<BR> <epsg3536> : NAD83(NSRS2007) / Iowa North
-<BR> <epsg3537> : NAD83(NSRS2007) / Iowa North (ft US)
-<BR> <epsg3538> : NAD83(NSRS2007) / Iowa South
-<BR> <epsg3539> : NAD83(NSRS2007) / Iowa South (ft US)
-<BR> <epsg3540> : NAD83(NSRS2007) / Kansas North
-<BR> <epsg3541> : NAD83(NSRS2007) / Kansas North (ft US)
-<BR> <epsg3542> : NAD83(NSRS2007) / Kansas South
-<BR> <epsg3543> : NAD83(NSRS2007) / Kansas South (ft US)
-<BR> <epsg3544> : NAD83(NSRS2007) / Kentucky North
-<BR> <epsg3545> : NAD83(NSRS2007) / Kentucky North (ftUS)
-<BR> <epsg3546> : NAD83(NSRS2007) / Kentucky Single Zone
-<BR> <epsg3547> : NAD83(NSRS2007) / Kentucky Single Zone (ftUS)
-<BR> <epsg3548> : NAD83(NSRS2007) / Kentucky South
-<BR> <epsg3549> : NAD83(NSRS2007) / Kentucky South (ftUS)
-<BR> <epsg3550> : NAD83(NSRS2007) / Louisiana North
-<BR> <epsg3551> : NAD83(NSRS2007) / Louisiana North (ftUS)
-<BR> <epsg3552> : NAD83(NSRS2007) / Louisiana South
-<BR> <epsg3553> : NAD83(NSRS2007) / Louisiana South (ftUS)
-<BR> <epsg3554> : NAD83(NSRS2007) / Maine CS2000 Central
-<BR> <epsg3555> : NAD83(NSRS2007) / Maine CS2000 East
-<BR> <epsg3556> : NAD83(NSRS2007) / Maine CS2000 West
-<BR> <epsg3557> : NAD83(NSRS2007) / Maine East
-<BR> <epsg3558> : NAD83(NSRS2007) / Maine West
-<BR> <epsg3559> : NAD83(NSRS2007) / Maryland
-<BR> <epsg3560> : NAD83 / Utah North (ftUS)
-<BR> <epsg3561> : Old Hawaiian / Hawaii zone 1
-<BR> <epsg3562> : Old Hawaiian / Hawaii zone 2
-<BR> <epsg3563> : Old Hawaiian / Hawaii zone 3
-<BR> <epsg3564> : Old Hawaiian / Hawaii zone 4
-<BR> <epsg3565> : Old Hawaiian / Hawaii zone 5
-<BR> <epsg3566> : NAD83 / Utah Central (ftUS)
-<BR> <epsg3567> : NAD83 / Utah South (ftUS)
-<BR> <epsg3568> : NAD83(HARN) / Utah North (ftUS)
-<BR> <epsg3569> : NAD83(HARN) / Utah Central (ftUS)
-<BR> <epsg3570> : NAD83(HARN) / Utah South (ftUS)
-<BR> <epsg3571> : WGS 84 / North Pole LAEA Bering Sea
-<BR> <epsg3572> : WGS 84 / North Pole LAEA Alaska
-<BR> <epsg3573> : WGS 84 / North Pole LAEA Canada
-<BR> <epsg3574> : WGS 84 / North Pole LAEA Atlantic
-<BR> <epsg3575> : WGS 84 / North Pole LAEA Europe
-<BR> <epsg3576> : WGS 84 / North Pole LAEA Russia
-<BR> <epsg3577> : GDA94 / Australian Albers
-<BR> <epsg3578> : NAD83 / Yukon Albers
-<BR> <epsg3579> : NAD83(CSRS) / Yukon Albers
-<BR> <epsg3580> : NAD83 / NWT Lambert
-<BR> <epsg3581> : NAD83(CSRS) / NWT Lambert
-<BR> <epsg3582> : NAD83(NSRS2007) / Maryland (ftUS)
-<BR> <epsg3583> : NAD83(NSRS2007) / Massachusetts Island
-<BR> <epsg3584> : NAD83(NSRS2007) / Massachusetts Island (ftUS)
-<BR> <epsg3585> : NAD83(NSRS2007) / Massachusetts Mainland
-<BR> <epsg3586> : NAD83(NSRS2007) / Massachusetts Mainland (ftUS)
-<BR> <epsg3587> : NAD83(NSRS2007) / Michigan Central
-<BR> <epsg3588> : NAD83(NSRS2007) / Michigan Central (ft)
-<BR> <epsg3589> : NAD83(NSRS2007) / Michigan North
-<BR> <epsg3590> : NAD83(NSRS2007) / Michigan North (ft)
-<BR> <epsg3591> : NAD83(NSRS2007) / Michigan Oblique Mercator
-<BR> <epsg3592> : NAD83(NSRS2007) / Michigan South
-<BR> <epsg3593> : NAD83(NSRS2007) / Michigan South (ft)
-<BR> <epsg3594> : NAD83(NSRS2007) / Minnesota Central
-<BR> <epsg3595> : NAD83(NSRS2007) / Minnesota North
-<BR> <epsg3596> : NAD83(NSRS2007) / Minnesota South
-<BR> <epsg3597> : NAD83(NSRS2007) / Mississippi East
-<BR> <epsg3598> : NAD83(NSRS2007) / Mississippi East (ftUS)
-<BR> <epsg3599> : NAD83(NSRS2007) / Mississippi West
-<BR> <epsg3600> : NAD83(NSRS2007) / Mississippi West (ftUS)
-<BR> <epsg3601> : NAD83(NSRS2007) / Missouri Central
-<BR> <epsg3602> : NAD83(NSRS2007) / Missouri East
-<BR> <epsg3603> : NAD83(NSRS2007) / Missouri West
-<BR> <epsg3604> : NAD83(NSRS2007) / Montana
-<BR> <epsg3605> : NAD83(NSRS2007) / Montana (ft)
-<BR> <epsg3606> : NAD83(NSRS2007) / Nebraska
-<BR> <epsg3607> : NAD83(NSRS2007) / Nevada Central
-<BR> <epsg3608> : NAD83(NSRS2007) / Nevada Central (ft US)
-<BR> <epsg3609> : NAD83(NSRS2007) / Nevada East
-<BR> <epsg3610> : NAD83(NSRS2007) / Nevada East (ft US)
-<BR> <epsg3611> : NAD83(NSRS2007) / Nevada West
-<BR> <epsg3612> : NAD83(NSRS2007) / Nevada West (ft US)
-<BR> <epsg3613> : NAD83(NSRS2007) / New Hampshire
-<BR> <epsg3614> : NAD83(NSRS2007) / New Hampshire (ftUS)
-<BR> <epsg3615> : NAD83(NSRS2007) / New Jersey
-<BR> <epsg3616> : NAD83(NSRS2007) / New Jersey (ft US)
-<BR> <epsg3617> : NAD83(NSRS2007) / New Mexico Central
-<BR> <epsg3618> : NAD83(NSRS2007) / New Mexico Central (ftUS)
-<BR> <epsg3619> : NAD83(NSRS2007) / New Mexico East
-<BR> <epsg3620> : NAD83(NSRS2007) / New Mexico East (ftUS)
-<BR> <epsg3621> : NAD83(NSRS2007) / New Mexico West
-<BR> <epsg3622> : NAD83(NSRS2007) / New Mexico West (ftUS)
-<BR> <epsg3623> : NAD83(NSRS2007) / New York Central
-<BR> <epsg3624> : NAD83(NSRS2007) / New York Central (ftUS)
-<BR> <epsg3625> : NAD83(NSRS2007) / New York East
-<BR> <epsg3626> : NAD83(NSRS2007) / New York East (ftUS)
-<BR> <epsg3627> : NAD83(NSRS2007) / New York Long Island
-<BR> <epsg3628> : NAD83(NSRS2007) / New York Long Island (ftUS)
-<BR> <epsg3629> : NAD83(NSRS2007) / New York West
-<BR> <epsg3630> : NAD83(NSRS2007) / New York West (ftUS)
-<BR> <epsg3631> : NAD83(NSRS2007) / North Carolina
-<BR> <epsg3632> : NAD83(NSRS2007) / North Carolina (ftUS)
-<BR> <epsg3633> : NAD83(NSRS2007) / North Dakota North
-<BR> <epsg3634> : NAD83(NSRS2007) / North Dakota North (ft)
-<BR> <epsg3635> : NAD83(NSRS2007) / North Dakota South
-<BR> <epsg3636> : NAD83(NSRS2007) / North Dakota South (ft)
-<BR> <epsg3637> : NAD83(NSRS2007) / Ohio North
-<BR> <epsg3638> : NAD83(NSRS2007) / Ohio South
-<BR> <epsg3639> : NAD83(NSRS2007) / Oklahoma North
-<BR> <epsg3640> : NAD83(NSRS2007) / Oklahoma North (ftUS)
-<BR> <epsg3641> : NAD83(NSRS2007) / Oklahoma South
-<BR> <epsg3642> : NAD83(NSRS2007) / Oklahoma South (ftUS)
-<BR> <epsg3643> : NAD83(NSRS2007) / Oregon Lambert
-<BR> <epsg3644> : NAD83(NSRS2007) / Oregon Lambert (ft)
-<BR> <epsg3645> : NAD83(NSRS2007) / Oregon North
-<BR> <epsg3646> : NAD83(NSRS2007) / Oregon North (ft)
-<BR> <epsg3647> : NAD83(NSRS2007) / Oregon South
-<BR> <epsg3648> : NAD83(NSRS2007) / Oregon South (ft)
-<BR> <epsg3649> : NAD83(NSRS2007) / Pennsylvania North
-<BR> <epsg3650> : NAD83(NSRS2007) / Pennsylvania North (ftUS)
-<BR> <epsg3651> : NAD83(NSRS2007) / Pennsylvania South
-<BR> <epsg3652> : NAD83(NSRS2007) / Pennsylvania South (ftUS)
-<BR> <epsg3653> : NAD83(NSRS2007) / Rhode Island
-<BR> <epsg3654> : NAD83(NSRS2007) / Rhode Island (ftUS)
-<BR> <epsg3655> : NAD83(NSRS2007) / South Carolina
-<BR> <epsg3656> : NAD83(NSRS2007) / South Carolina (ft)
-<BR> <epsg3657> : NAD83(NSRS2007) / South Dakota North
-<BR> <epsg3658> : NAD83(NSRS2007) / South Dakota North (ftUS)
-<BR> <epsg3659> : NAD83(NSRS2007) / South Dakota South
-<BR> <epsg3660> : NAD83(NSRS2007) / South Dakota South (ftUS)
-<BR> <epsg3661> : NAD83(NSRS2007) / Tennessee
-<BR> <epsg3662> : NAD83(NSRS2007) / Tennessee (ftUS)
-<BR> <epsg3663> : NAD83(NSRS2007) / Texas Central
-<BR> <epsg3664> : NAD83(NSRS2007) / Texas Central (ftUS)
-<BR> <epsg3665> : NAD83(NSRS2007) / Texas Centric Albers Equal Area
-<BR> <epsg3666> : NAD83(NSRS2007) / Texas Centric Lambert Conformal
-<BR> <epsg3667> : NAD83(NSRS2007) / Texas North
-<BR> <epsg3668> : NAD83(NSRS2007) / Texas North (ftUS)
-<BR> <epsg3669> : NAD83(NSRS2007) / Texas North Central
-<BR> <epsg3670> : NAD83(NSRS2007) / Texas North Central (ftUS)
-<BR> <epsg3671> : NAD83(NSRS2007) / Texas South
-<BR> <epsg3672> : NAD83(NSRS2007) / Texas South (ftUS)
-<BR> <epsg3673> : NAD83(NSRS2007) / Texas South Central
-<BR> <epsg3674> : NAD83(NSRS2007) / Texas South Central (ftUS)
-<BR> <epsg3675> : NAD83(NSRS2007) / Utah Central
-<BR> <epsg3676> : NAD83(NSRS2007) / Utah Central (ft)
-<BR> <epsg3677> : NAD83(NSRS2007) / Utah Central (ftUS)
-<BR> <epsg3678> : NAD83(NSRS2007) / Utah North
-<BR> <epsg3679> : NAD83(NSRS2007) / Utah North (ft)
-<BR> <epsg3680> : NAD83(NSRS2007) / Utah North (ftUS)
-<BR> <epsg3681> : NAD83(NSRS2007) / Utah South
-<BR> <epsg3682> : NAD83(NSRS2007) / Utah South (ft)
-<BR> <epsg3683> : NAD83(NSRS2007) / Utah South (ftUS)
-<BR> <epsg3684> : NAD83(NSRS2007) / Vermont
-<BR> <epsg3685> : NAD83(NSRS2007) / Virginia North
-<BR> <epsg3686> : NAD83(NSRS2007) / Virginia North (ftUS)
-<BR> <epsg3687> : NAD83(NSRS2007) / Virginia South
-<BR> <epsg3688> : NAD83(NSRS2007) / Virginia South (ftUS)
-<BR> <epsg3689> : NAD83(NSRS2007) / Washington North
-<BR> <epsg3690> : NAD83(NSRS2007) / Washington North (ftUS)
-<BR> <epsg3691> : NAD83(NSRS2007) / Washington South
-<BR> <epsg3692> : NAD83(NSRS2007) / Washington South (ftUS)
-<BR> <epsg3693> : NAD83(NSRS2007) / West Virginia North
-<BR> <epsg3694> : NAD83(NSRS2007) / West Virginia South
-<BR> <epsg3695> : NAD83(NSRS2007) / Wisconsin Central
-<BR> <epsg3696> : NAD83(NSRS2007) / Wisconsin Central (ftUS)
-<BR> <epsg3697> : NAD83(NSRS2007) / Wisconsin North
-<BR> <epsg3698> : NAD83(NSRS2007) / Wisconsin North (ftUS)
-<BR> <epsg3699> : NAD83(NSRS2007) / Wisconsin South
-<BR> <epsg3700> : NAD83(NSRS2007) / Wisconsin South (ftUS)
-<BR> <epsg3701> : NAD83(NSRS2007) / Wisconsin Transverse Mercator
-<BR> <epsg3702> : NAD83(NSRS2007) / Wyoming East
-<BR> <epsg3703> : NAD83(NSRS2007) / Wyoming East Central
-<BR> <epsg3704> : NAD83(NSRS2007) / Wyoming West Central
-<BR> <epsg3705> : NAD83(NSRS2007) / Wyoming West
-<BR> <epsg3706> : NAD83(NSRS2007) / UTM zone 59N
-<BR> <epsg3707> : NAD83(NSRS2007) / UTM zone 60N
-<BR> <epsg3708> : NAD83(NSRS2007) / UTM zone 1N
-<BR> <epsg3709> : NAD83(NSRS2007) / UTM zone 2N
-<BR> <epsg3710> : NAD83(NSRS2007) / UTM zone 3N
-<BR> <epsg3711> : NAD83(NSRS2007) / UTM zone 4N
-<BR> <epsg3712> : NAD83(NSRS2007) / UTM zone 5N
-<BR> <epsg3713> : NAD83(NSRS2007) / UTM zone 6N
-<BR> <epsg3714> : NAD83(NSRS2007) / UTM zone 7N
-<BR> <epsg3715> : NAD83(NSRS2007) / UTM zone 8N
-<BR> <epsg3716> : NAD83(NSRS2007) / UTM zone 9N
-<BR> <epsg3717> : NAD83(NSRS2007) / UTM zone 10N
-<BR> <epsg3718> : NAD83(NSRS2007) / UTM zone 11N
-<BR> <epsg3719> : NAD83(NSRS2007) / UTM zone 12N
-<BR> <epsg3720> : NAD83(NSRS2007) / UTM zone 13N
-<BR> <epsg3721> : NAD83(NSRS2007) / UTM zone 14N
-<BR> <epsg3722> : NAD83(NSRS2007) / UTM zone 15N
-<BR> <epsg3723> : NAD83(NSRS2007) / UTM zone 16N
-<BR> <epsg3724> : NAD83(NSRS2007) / UTM zone 17N
-<BR> <epsg3725> : NAD83(NSRS2007) / UTM zone 18N
-<BR> <epsg3726> : NAD83(NSRS2007) / UTM zone 19N
-<BR> <epsg3727> : Reunion 1947 / TM Reunion
-<BR> <epsg3728> : NAD83(NSRS2007) / Ohio North (ftUS)
-<BR> <epsg3729> : NAD83(NSRS2007) / Ohio South (ftUS)
-<BR> <epsg3730> : NAD83(NSRS2007) / Wyoming East (ftUS)
-<BR> <epsg3731> : NAD83(NSRS2007) / Wyoming East Central (ftUS)
-<BR> <epsg3732> : NAD83(NSRS2007) / Wyoming West Central (ftUS)
-<BR> <epsg3733> : NAD83(NSRS2007) / Wyoming West (ftUS)
-<BR> <epsg3734> : NAD83 / Ohio North (ftUS)
-<BR> <epsg3735> : NAD83 / Ohio South (ftUS)
-<BR> <epsg3736> : NAD83 / Wyoming East (ftUS)
-<BR> <epsg3737> : NAD83 / Wyoming East Central (ftUS)
-<BR> <epsg3738> : NAD83 / Wyoming West Central (ftUS)
-<BR> <epsg3739> : NAD83 / Wyoming West (ftUS)
-<BR> <epsg3740> : NAD83(HARN) / UTM zone 10N
-<BR> <epsg3741> : NAD83(HARN) / UTM zone 11N
-<BR> <epsg3742> : NAD83(HARN) / UTM zone 12N
-<BR> <epsg3743> : NAD83(HARN) / UTM zone 13N
-<BR> <epsg3744> : NAD83(HARN) / UTM zone 14N
-<BR> <epsg3745> : NAD83(HARN) / UTM zone 15N
-<BR> <epsg3746> : NAD83(HARN) / UTM zone 16N
-<BR> <epsg3747> : NAD83(HARN) / UTM zone 17N
-<BR> <epsg3748> : NAD83(HARN) / UTM zone 18N
-<BR> <epsg3749> : NAD83(HARN) / UTM zone 19N
-<BR> <epsg3750> : NAD83(HARN) / UTM zone 4N
-<BR> <epsg3751> : NAD83(HARN) / UTM zone 5N
-<BR> <epsg3752> : WGS 84 / Mercator 41
-<BR> <epsg3753> : NAD83(HARN) / Ohio North (ftUS)
-<BR> <epsg3754> : NAD83(HARN) / Ohio South (ftUS)
-<BR> <epsg3755> : NAD83(HARN) / Wyoming East (ftUS)
-<BR> <epsg3756> : NAD83(HARN) / Wyoming East Central (ftUS)
-<BR> <epsg3757> : NAD83(HARN) / Wyoming West Central (ftUS)
-<BR> <epsg3758> : NAD83(HARN) / Wyoming West (ftUS)
-<BR> <epsg3759> : NAD83 / Hawaii zone 3 (ftUS)
-<BR> <epsg3760> : NAD83(HARN) / Hawaii zone 3 (ftUS)
-<BR> <epsg3761> : NAD83(CSRS) / UTM zone 22N
-<BR> <epsg3762> : WGS 84 / South Georgia Lambert
-<BR> <epsg3920> : Puerto Rico / UTM zone 20N
-<BR> <epsg3991> : Puerto Rico State Plane CS of 1927
-<BR> <epsg3992> : Puerto Rico / St. Croix
-<BR> <epsg20004> : Pulkovo 1995 / Gauss-Kruger zone 4
-<BR> <epsg20005> : Pulkovo 1995 / Gauss-Kruger zone 5
-<BR> <epsg20006> : Pulkovo 1995 / Gauss-Kruger zone 6
-<BR> <epsg20007> : Pulkovo 1995 / Gauss-Kruger zone 7
-<BR> <epsg20008> : Pulkovo 1995 / Gauss-Kruger zone 8
-<BR> <epsg20009> : Pulkovo 1995 / Gauss-Kruger zone 9
-<BR> <epsg20010> : Pulkovo 1995 / Gauss-Kruger zone 10
-<BR> <epsg20011> : Pulkovo 1995 / Gauss-Kruger zone 11
-<BR> <epsg20012> : Pulkovo 1995 / Gauss-Kruger zone 12
-<BR> <epsg20013> : Pulkovo 1995 / Gauss-Kruger zone 13
-<BR> <epsg20014> : Pulkovo 1995 / Gauss-Kruger zone 14
-<BR> <epsg20015> : Pulkovo 1995 / Gauss-Kruger zone 15
-<BR> <epsg20016> : Pulkovo 1995 / Gauss-Kruger zone 16
-<BR> <epsg20017> : Pulkovo 1995 / Gauss-Kruger zone 17
-<BR> <epsg20018> : Pulkovo 1995 / Gauss-Kruger zone 18
-<BR> <epsg20019> : Pulkovo 1995 / Gauss-Kruger zone 19
-<BR> <epsg20020> : Pulkovo 1995 / Gauss-Kruger zone 20
-<BR> <epsg20021> : Pulkovo 1995 / Gauss-Kruger zone 21
-<BR> <epsg20022> : Pulkovo 1995 / Gauss-Kruger zone 22
-<BR> <epsg20023> : Pulkovo 1995 / Gauss-Kruger zone 23
-<BR> <epsg20024> : Pulkovo 1995 / Gauss-Kruger zone 24
-<BR> <epsg20025> : Pulkovo 1995 / Gauss-Kruger zone 25
-<BR> <epsg20026> : Pulkovo 1995 / Gauss-Kruger zone 26
-<BR> <epsg20027> : Pulkovo 1995 / Gauss-Kruger zone 27
-<BR> <epsg20028> : Pulkovo 1995 / Gauss-Kruger zone 28
-<BR> <epsg20029> : Pulkovo 1995 / Gauss-Kruger zone 29
-<BR> <epsg20030> : Pulkovo 1995 / Gauss-Kruger zone 30
-<BR> <epsg20031> : Pulkovo 1995 / Gauss-Kruger zone 31
-<BR> <epsg20032> : Pulkovo 1995 / Gauss-Kruger zone 32
-<BR> <epsg20064> : Pulkovo 1995 / Gauss-Kruger 4N (deprecated)
-<BR> <epsg20065> : Pulkovo 1995 / Gauss-Kruger 5N (deprecated)
-<BR> <epsg20066> : Pulkovo 1995 / Gauss-Kruger 6N (deprecated)
-<BR> <epsg20067> : Pulkovo 1995 / Gauss-Kruger 7N (deprecated)
-<BR> <epsg20068> : Pulkovo 1995 / Gauss-Kruger 8N (deprecated)
-<BR> <epsg20069> : Pulkovo 1995 / Gauss-Kruger 9N (deprecated)
-<BR> <epsg20070> : Pulkovo 1995 / Gauss-Kruger 10N (deprecated)
-<BR> <epsg20071> : Pulkovo 1995 / Gauss-Kruger 11N (deprecated)
-<BR> <epsg20072> : Pulkovo 1995 / Gauss-Kruger 12N (deprecated)
-<BR> <epsg20073> : Pulkovo 1995 / Gauss-Kruger 13N (deprecated)
-<BR> <epsg20074> : Pulkovo 1995 / Gauss-Kruger 14N (deprecated)
-<BR> <epsg20075> : Pulkovo 1995 / Gauss-Kruger 15N (deprecated)
-<BR> <epsg20076> : Pulkovo 1995 / Gauss-Kruger 16N (deprecated)
-<BR> <epsg20077> : Pulkovo 1995 / Gauss-Kruger 17N (deprecated)
-<BR> <epsg20078> : Pulkovo 1995 / Gauss-Kruger 18N (deprecated)
-<BR> <epsg20079> : Pulkovo 1995 / Gauss-Kruger 19N (deprecated)
-<BR> <epsg20080> : Pulkovo 1995 / Gauss-Kruger 20N (deprecated)
-<BR> <epsg20081> : Pulkovo 1995 / Gauss-Kruger 21N (deprecated)
-<BR> <epsg20082> : Pulkovo 1995 / Gauss-Kruger 22N (deprecated)
-<BR> <epsg20083> : Pulkovo 1995 / Gauss-Kruger 23N (deprecated)
-<BR> <epsg20084> : Pulkovo 1995 / Gauss-Kruger 24N (deprecated)
-<BR> <epsg20085> : Pulkovo 1995 / Gauss-Kruger 25N (deprecated)
-<BR> <epsg20086> : Pulkovo 1995 / Gauss-Kruger 26N (deprecated)
-<BR> <epsg20087> : Pulkovo 1995 / Gauss-Kruger 27N (deprecated)
-<BR> <epsg20088> : Pulkovo 1995 / Gauss-Kruger 28N (deprecated)
-<BR> <epsg20089> : Pulkovo 1995 / Gauss-Kruger 29N (deprecated)
-<BR> <epsg20090> : Pulkovo 1995 / Gauss-Kruger 30N (deprecated)
-<BR> <epsg20091> : Pulkovo 1995 / Gauss-Kruger 31N (deprecated)
-<BR> <epsg20092> : Pulkovo 1995 / Gauss-Kruger 32N (deprecated)
-<BR> <epsg20135> : Adindan / UTM zone 35N
-<BR> <epsg20136> : Adindan / UTM zone 36N
-<BR> <epsg20137> : Adindan / UTM zone 37N
-<BR> <epsg20138> : Adindan / UTM zone 38N
-<BR> <epsg20248> : AGD66 / AMG zone 48
-<BR> <epsg20249> : AGD66 / AMG zone 49
-<BR> <epsg20250> : AGD66 / AMG zone 50
-<BR> <epsg20251> : AGD66 / AMG zone 51
-<BR> <epsg20252> : AGD66 / AMG zone 52
-<BR> <epsg20253> : AGD66 / AMG zone 53
-<BR> <epsg20254> : AGD66 / AMG zone 54
-<BR> <epsg20255> : AGD66 / AMG zone 55
-<BR> <epsg20256> : AGD66 / AMG zone 56
-<BR> <epsg20257> : AGD66 / AMG zone 57
-<BR> <epsg20258> : AGD66 / AMG zone 58
-<BR> <epsg20348> : AGD84 / AMG zone 48
-<BR> <epsg20349> : AGD84 / AMG zone 49
-<BR> <epsg20350> : AGD84 / AMG zone 50
-<BR> <epsg20351> : AGD84 / AMG zone 51
-<BR> <epsg20352> : AGD84 / AMG zone 52
-<BR> <epsg20353> : AGD84 / AMG zone 53
-<BR> <epsg20354> : AGD84 / AMG zone 54
-<BR> <epsg20355> : AGD84 / AMG zone 55
-<BR> <epsg20356> : AGD84 / AMG zone 56
-<BR> <epsg20357> : AGD84 / AMG zone 57
-<BR> <epsg20358> : AGD84 / AMG zone 58
-<BR> <epsg20436> : Ain el Abd / UTM zone 36N
-<BR> <epsg20437> : Ain el Abd / UTM zone 37N
-<BR> <epsg20438> : Ain el Abd / UTM zone 38N
-<BR> <epsg20439> : Ain el Abd / UTM zone 39N
-<BR> <epsg20440> : Ain el Abd / UTM zone 40N
-<BR> <epsg20499> : Ain el Abd / Bahrain Grid
-<BR> <epsg20538> : Afgooye / UTM zone 38N
-<BR> <epsg20539> : Afgooye / UTM zone 39N
-<BR> <epsg20790> : Lisbon (Lisbon)/Portuguese National Grid
-<BR> <epsg20791> : Lisbon (Lisbon)/Portuguese Grid
-<BR> <epsg20822> : Aratu / UTM zone 22S
-<BR> <epsg20823> : Aratu / UTM zone 23S
-<BR> <epsg20824> : Aratu / UTM zone 24S
-<BR> <epsg20934> : Arc 1950 / UTM zone 34S
-<BR> <epsg20935> : Arc 1950 / UTM zone 35S
-<BR> <epsg20936> : Arc 1950 / UTM zone 36S
-<BR> <epsg21035> : Arc 1960 / UTM zone 35S
-<BR> <epsg21036> : Arc 1960 / UTM zone 36S
-<BR> <epsg21037> : Arc 1960 / UTM zone 37S
-<BR> <epsg21095> : Arc 1960 / UTM zone 35N
-<BR> <epsg21096> : Arc 1960 / UTM zone 36N
-<BR> <epsg21097> : Arc 1960 / UTM zone 37N
-<BR> <epsg21100> : Batavia (Jakarta) / NEIEZ (deprecated)
-<BR> <epsg21148> : Batavia / UTM zone 48S
-<BR> <epsg21149> : Batavia / UTM zone 49S
-<BR> <epsg21150> : Batavia / UTM zone 50S
-<BR> <epsg21291> : Barbados 1938 / British West Indies Grid
-<BR> <epsg21292> : Barbados 1938 / Barbados National Grid
-<BR> <epsg21413> : Beijing 1954 / Gauss-Kruger zone 13
-<BR> <epsg21414> : Beijing 1954 / Gauss-Kruger zone 14
-<BR> <epsg21415> : Beijing 1954 / Gauss-Kruger zone 15
-<BR> <epsg21416> : Beijing 1954 / Gauss-Kruger zone 16
-<BR> <epsg21417> : Beijing 1954 / Gauss-Kruger zone 17
-<BR> <epsg21418> : Beijing 1954 / Gauss-Kruger zone 18
-<BR> <epsg21419> : Beijing 1954 / Gauss-Kruger zone 19
-<BR> <epsg21420> : Beijing 1954 / Gauss-Kruger zone 20
-<BR> <epsg21421> : Beijing 1954 / Gauss-Kruger zone 21
-<BR> <epsg21422> : Beijing 1954 / Gauss-Kruger zone 22
-<BR> <epsg21423> : Beijing 1954 / Gauss-Kruger zone 23
-<BR> <epsg21453> : Beijing 1954 / Gauss-Kruger CM 75E
-<BR> <epsg21454> : Beijing 1954 / Gauss-Kruger CM 81E
-<BR> <epsg21455> : Beijing 1954 / Gauss-Kruger CM 87E
-<BR> <epsg21456> : Beijing 1954 / Gauss-Kruger CM 93E
-<BR> <epsg21457> : Beijing 1954 / Gauss-Kruger CM 99E
-<BR> <epsg21458> : Beijing 1954 / Gauss-Kruger CM 105E
-<BR> <epsg21459> : Beijing 1954 / Gauss-Kruger CM 111E
-<BR> <epsg21460> : Beijing 1954 / Gauss-Kruger CM 117E
-<BR> <epsg21461> : Beijing 1954 / Gauss-Kruger CM 123E
-<BR> <epsg21462> : Beijing 1954 / Gauss-Kruger CM 129E
-<BR> <epsg21463> : Beijing 1954 / Gauss-Kruger CM 135E
-<BR> <epsg21473> : Beijing 1954 / Gauss-Kruger 13N (deprecated)
-<BR> <epsg21474> : Beijing 1954 / Gauss-Kruger 14N (deprecated)
-<BR> <epsg21475> : Beijing 1954 / Gauss-Kruger 15N (deprecated)
-<BR> <epsg21476> : Beijing 1954 / Gauss-Kruger 16N (deprecated)
-<BR> <epsg21477> : Beijing 1954 / Gauss-Kruger 17N (deprecated)
-<BR> <epsg21478> : Beijing 1954 / Gauss-Kruger 18N (deprecated)
-<BR> <epsg21479> : Beijing 1954 / Gauss-Kruger 19N (deprecated)
-<BR> <epsg21480> : Beijing 1954 / Gauss-Kruger 20N (deprecated)
-<BR> <epsg21481> : Beijing 1954 / Gauss-Kruger 21N (deprecated)
-<BR> <epsg21482> : Beijing 1954 / Gauss-Kruger 22N (deprecated)
-<BR> <epsg21483> : Beijing 1954 / Gauss-Kruger 23N (deprecated)
-<BR> <epsg21500> : Belge 1950 (Brussels) / Belge Lambert 50
-<BR> <epsg21780> : Bern 1898 (Bern) / LV03C
-<BR> <epsg21781> : CH1903 / LV03
-<BR> <epsg21817> : Bogota 1975 / UTM zone 17N (deprecated)
-<BR> <epsg21818> : Bogota 1975 / UTM zone 18N
-<BR> <epsg21891> : Bogota 1975 / Colombia West zone (deprecated)
-<BR> <epsg21892> : Bogota 1975 / Colombia Bogota zone (deprecated)
-<BR> <epsg21893> : Bogota 1975 / Colombia East Central zone (deprecated)
-<BR> <epsg21894> : Bogota 1975 / Colombia East (deprecated)
-<BR> <epsg21896> : Bogota 1975 / Colombia West zone
-<BR> <epsg21897> : Bogota 1975 / Colombia Bogota zone
-<BR> <epsg21898> : Bogota 1975 / Colombia East Central zone
-<BR> <epsg21899> : Bogota 1975 / Colombia East
-<BR> <epsg22032> : Camacupa / UTM zone 32S
-<BR> <epsg22033> : Camacupa / UTM zone 33S
-<BR> <epsg22091> : Camacupa / TM 11.30 SE
-<BR> <epsg22092> : Camacupa / TM 12 SE
-<BR> <epsg22171> : POSGAR 98 / Argentina 1
-<BR> <epsg22172> : POSGAR 98 / Argentina 2
-<BR> <epsg22173> : POSGAR 98 / Argentina 3
-<BR> <epsg22174> : POSGAR 98 / Argentina 4
-<BR> <epsg22175> : POSGAR 98 / Argentina 5
-<BR> <epsg22176> : POSGAR 98 / Argentina 6
-<BR> <epsg22177> : POSGAR 98 / Argentina 7
-<BR> <epsg22181> : POSGAR 94 / Argentina 1
-<BR> <epsg22182> : POSGAR 94 / Argentina 2
-<BR> <epsg22183> : POSGAR 94 / Argentina 3
-<BR> <epsg22184> : POSGAR 94 / Argentina 4
-<BR> <epsg22185> : POSGAR 94 / Argentina 5
-<BR> <epsg22186> : POSGAR 94 / Argentina 6
-<BR> <epsg22187> : POSGAR 94 / Argentina 7
-<BR> <epsg22191> : Campo Inchauspe / Argentina 1
-<BR> <epsg22192> : Campo Inchauspe / Argentina 2
-<BR> <epsg22193> : Campo Inchauspe / Argentina 3
-<BR> <epsg22194> : Campo Inchauspe / Argentina 4
-<BR> <epsg22195> : Campo Inchauspe / Argentina 5
-<BR> <epsg22196> : Campo Inchauspe / Argentina 6
-<BR> <epsg22197> : Campo Inchauspe / Argentina 7
-<BR> <epsg22234> : Cape / UTM zone 34S
-<BR> <epsg22235> : Cape / UTM zone 35S
-<BR> <epsg22236> : Cape / UTM zone 36S
-<BR> <epsg22332> : Carthage / UTM zone 32N
-<BR> <epsg22391> : Carthage / Nord Tunisie
-<BR> <epsg22392> : Carthage / Sud Tunisie
-<BR> <epsg22521> : Corrego Alegre / UTM zone 21S
-<BR> <epsg22522> : Corrego Alegre / UTM zone 22S
-<BR> <epsg22523> : Corrego Alegre / UTM zone 23S
-<BR> <epsg22524> : Corrego Alegre / UTM zone 24S
-<BR> <epsg22525> : Corrego Alegre / UTM zone 25S
-<BR> <epsg22700> : Deir ez Zor / Levant Zone
-<BR> <epsg22770> : Deir ez Zor / Syria Lambert
-<BR> <epsg22780> : Deir ez Zor / Levant Stereographic
-<BR> <epsg22832> : Douala / UTM zone 32N (deprecated)
-<BR> <epsg22991> : Egypt 1907 / Blue Belt
-<BR> <epsg22992> : Egypt 1907 / Red Belt
-<BR> <epsg22993> : Egypt 1907 / Purple Belt
-<BR> <epsg22994> : Egypt 1907 / Extended Purple Belt
-<BR> <epsg23028> : ED50 / UTM zone 28N
-<BR> <epsg23029> : ED50 / UTM zone 29N
-<BR> <epsg23030> : ED50 / UTM zone 30N
-<BR> <epsg23031> : ED50 / UTM zone 31N
-<BR> <epsg23032> : ED50 / UTM zone 32N
-<BR> <epsg23033> : ED50 / UTM zone 33N
-<BR> <epsg23034> : ED50 / UTM zone 34N
-<BR> <epsg23035> : ED50 / UTM zone 35N
-<BR> <epsg23036> : ED50 / UTM zone 36N
-<BR> <epsg23037> : ED50 / UTM zone 37N
-<BR> <epsg23038> : ED50 / UTM zone 38N
-<BR> <epsg23090> : ED50 / TM 0 N
-<BR> <epsg23095> : ED50 / TM 5 NE
-<BR> <epsg23239> : Fahud / UTM zone 39N
-<BR> <epsg23240> : Fahud / UTM zone 40N
-<BR> <epsg23433> : Garoua / UTM zone 33N (deprecated)
-<BR> <epsg23700> : HD72 / EOV
-<BR> <epsg23830> : DGN95 / Indonesia TM-3 zone 46.2
-<BR> <epsg23831> : DGN95 / Indonesia TM-3 zone 47.1
-<BR> <epsg23832> : DGN95 / Indonesia TM-3 zone 47.2
-<BR> <epsg23833> : DGN95 / Indonesia TM-3 zone 48.1
-<BR> <epsg23834> : DGN95 / Indonesia TM-3 zone 48.2
-<BR> <epsg23835> : DGN95 / Indonesia TM-3 zone 49.1
-<BR> <epsg23836> : DGN95 / Indonesia TM-3 zone 49.2
-<BR> <epsg23837> : DGN95 / Indonesia TM-3 zone 50.1
-<BR> <epsg23838> : DGN95 / Indonesia TM-3 zone 50.2
-<BR> <epsg23839> : DGN95 / Indonesia TM-3 zone 51.1
-<BR> <epsg23840> : DGN95 / Indonesia TM-3 zone 51.2
-<BR> <epsg23841> : DGN95 / Indonesia TM-3 zone 52.1
-<BR> <epsg23842> : DGN95 / Indonesia TM-3 zone 52.2
-<BR> <epsg23843> : DGN95 / Indonesia TM-3 zone 53.1
-<BR> <epsg23844> : DGN95 / Indonesia TM-3 zone 53.2
-<BR> <epsg23845> : DGN95 / Indonesia TM-3 zone 54.1
-<BR> <epsg23846> : ID74 / UTM zone 46N
-<BR> <epsg23847> : ID74 / UTM zone 47N
-<BR> <epsg23848> : ID74 / UTM zone 48N
-<BR> <epsg23849> : ID74 / UTM zone 49N
-<BR> <epsg23850> : ID74 / UTM zone 50N
-<BR> <epsg23851> : ID74 / UTM zone 51N
-<BR> <epsg23852> : ID74 / UTM zone 52N
-<BR> <epsg23853> : ID74 / UTM zone 53N (deprecated)
-<BR> <epsg23866> : DGN95 / UTM zone 46N
-<BR> <epsg23867> : DGN95 / UTM zone 47N
-<BR> <epsg23868> : DGN95 / UTM zone 48N
-<BR> <epsg23869> : DGN95 / UTM zone 49N
-<BR> <epsg23870> : DGN95 / UTM zone 50N
-<BR> <epsg23871> : DGN95 / UTM zone 51N
-<BR> <epsg23872> : DGN95 / UTM zone 52N
-<BR> <epsg23877> : DGN95 / UTM zone 47S
-<BR> <epsg23878> : DGN95 / UTM zone 48S
-<BR> <epsg23879> : DGN95 / UTM zone 49S
-<BR> <epsg23880> : DGN95 / UTM zone 50S
-<BR> <epsg23881> : DGN95 / UTM zone 51S
-<BR> <epsg23882> : DGN95 / UTM zone 52S
-<BR> <epsg23883> : DGN95 / UTM zone 53S
-<BR> <epsg23884> : DGN95 / UTM zone 54S
-<BR> <epsg23886> : ID74 / UTM zone 46S (deprecated)
-<BR> <epsg23887> : ID74 / UTM zone 47S
-<BR> <epsg23888> : ID74 / UTM zone 48S
-<BR> <epsg23889> : ID74 / UTM zone 49S
-<BR> <epsg23890> : ID74 / UTM zone 50S
-<BR> <epsg23891> : ID74 / UTM zone 51S
-<BR> <epsg23892> : ID74 / UTM zone 52S
-<BR> <epsg23893> : ID74 / UTM zone 53S
-<BR> <epsg23894> : ID74 / UTM zone 54S
-<BR> <epsg23946> : Indian 1954 / UTM zone 46N
-<BR> <epsg23947> : Indian 1954 / UTM zone 47N
-<BR> <epsg23948> : Indian 1954 / UTM zone 48N
-<BR> <epsg24047> : Indian 1975 / UTM zone 47N
-<BR> <epsg24048> : Indian 1975 / UTM zone 48N
-<BR> <epsg24100> : Jamaica 1875 / Jamaica (Old Grid)
-<BR> <epsg24200> : JAD69 / Jamaica National Grid
-<BR> <epsg24305> : Kalianpur 1937 / UTM zone 45N
-<BR> <epsg24306> : Kalianpur 1937 / UTM zone 46N
-<BR> <epsg24311> : Kalianpur 1962 / UTM zone 41N
-<BR> <epsg24312> : Kalianpur 1962 / UTM zone 42N
-<BR> <epsg24313> : Kalianpur 1962 / UTM zone 43N
-<BR> <epsg24342> : Kalianpur 1975 / UTM zone 42N
-<BR> <epsg24343> : Kalianpur 1975 / UTM zone 43N
-<BR> <epsg24344> : Kalianpur 1975 / UTM zone 44N
-<BR> <epsg24345> : Kalianpur 1975 / UTM zone 45N
-<BR> <epsg24346> : Kalianpur 1975 / UTM zone 46N
-<BR> <epsg24347> : Kalianpur 1975 / UTM zone 47N
-<BR> <epsg24370> : Kalianpur 1880 / India zone 0
-<BR> <epsg24371> : Kalianpur 1880 / India zone I
-<BR> <epsg24372> : Kalianpur 1880 / India zone IIa
-<BR> <epsg24373> : Kalianpur 1880 / India zone III
-<BR> <epsg24374> : Kalianpur 1880 / India zone IV
-<BR> <epsg24375> : Kalianpur 1937 / India zone IIb
-<BR> <epsg24376> : Kalianpur 1962 / India zone I
-<BR> <epsg24377> : Kalianpur 1962 / India zone IIa
-<BR> <epsg24378> : Kalianpur 1975 / India zone I
-<BR> <epsg24379> : Kalianpur 1975 / India zone IIa
-<BR> <epsg24380> : Kalianpur 1975 / India zone IIb
-<BR> <epsg24381> : Kalianpur 1975 / India zone III
-<BR> <epsg24382> : Kalianpur 1880 / India zone IIb
-<BR> <epsg24383> : Kalianpur 1975 / India zone IV
-<BR> <epsg24500> : Kertau 1968 / Singapore Grid
-<BR> <epsg24547> : Kertau 1968 / UTM zone 47N
-<BR> <epsg24548> : Kertau 1968 / UTM zone 48N
-<BR> <epsg24571> : Kertau / R.S.O. Malaya (ch) (deprecated)
-<BR> <epsg24600> : KOC Lambert
-<BR> <epsg24718> : La Canoa / UTM zone 18N
-<BR> <epsg24719> : La Canoa / UTM zone 19N
-<BR> <epsg24720> : La Canoa / UTM zone 20N
-<BR> <epsg24817> : PSAD56 / UTM zone 17N
-<BR> <epsg24818> : PSAD56 / UTM zone 18N
-<BR> <epsg24819> : PSAD56 / UTM zone 19N
-<BR> <epsg24820> : PSAD56 / UTM zone 20N
-<BR> <epsg24821> : PSAD56 / UTM zone 21N
-<BR> <epsg24877> : PSAD56 / UTM zone 17S
-<BR> <epsg24878> : PSAD56 / UTM zone 18S
-<BR> <epsg24879> : PSAD56 / UTM zone 19S
-<BR> <epsg24880> : PSAD56 / UTM zone 20S
-<BR> <epsg24881> : PSAD56 / UTM zone 21S
-<BR> <epsg24882> : PSAD56 / UTM zone 22S
-<BR> <epsg24891> : PSAD56 / Peru west zone
-<BR> <epsg24892> : PSAD56 / Peru central zone
-<BR> <epsg24893> : PSAD56 / Peru east zone
-<BR> <epsg25000> : Leigon / Ghana Metre Grid
-<BR> <epsg25231> : Lome / UTM zone 31N
-<BR> <epsg25391> : Luzon 1911 / Philippines zone I
-<BR> <epsg25392> : Luzon 1911 / Philippines zone II
-<BR> <epsg25393> : Luzon 1911 / Philippines zone III
-<BR> <epsg25394> : Luzon 1911 / Philippines zone IV
-<BR> <epsg25395> : Luzon 1911 / Philippines zone V
-<BR> <epsg25700> : Makassar (Jakarta) / NEIEZ (deprecated)
-<BR> <epsg25828> : ETRS89 / UTM zone 28N
-<BR> <epsg25829> : ETRS89 / UTM zone 29N
-<BR> <epsg25830> : ETRS89 / UTM zone 30N
-<BR> <epsg25831> : ETRS89 / UTM zone 31N
-<BR> <epsg25832> : ETRS89 / UTM zone 32N
-<BR> <epsg25833> : ETRS89 / UTM zone 33N
-<BR> <epsg25834> : ETRS89 / UTM zone 34N
-<BR> <epsg25835> : ETRS89 / UTM zone 35N
-<BR> <epsg25836> : ETRS89 / UTM zone 36N
-<BR> <epsg25837> : ETRS89 / UTM zone 37N
-<BR> <epsg25838> : ETRS89 / UTM zone 38N
-<BR> <epsg25884> : ETRS89 / TM Baltic93
-<BR> <epsg25932> : Malongo 1987 / UTM zone 32S
-<BR> <epsg26191> : Merchich / Nord Maroc
-<BR> <epsg26192> : Merchich / Sud Maroc
-<BR> <epsg26193> : Merchich / Sahara (deprecated)
-<BR> <epsg26194> : Merchich / Sahara Nord
-<BR> <epsg26195> : Merchich / Sahara Sud
-<BR> <epsg26237> : Massawa / UTM zone 37N
-<BR> <epsg26331> : Minna / UTM zone 31N
-<BR> <epsg26332> : Minna / UTM zone 32N
-<BR> <epsg26391> : Minna / Nigeria West Belt
-<BR> <epsg26392> : Minna / Nigeria Mid Belt
-<BR> <epsg26393> : Minna / Nigeria East Belt
-<BR> <epsg26432> : Mhast / UTM zone 32S (deprecated)
-<BR> <epsg26591> : Monte Mario (Rome) / Italy zone 1 (deprecated)
-<BR> <epsg26592> : Monte Mario (Rome) / Italy zone 2 (deprecated)
-<BR> <epsg26632> : M'poraloko / UTM zone 32N
-<BR> <epsg26692> : M'poraloko / UTM zone 32S
-<BR> <epsg26701> : NAD27 / UTM zone 1N
-<BR> <epsg26702> : NAD27 / UTM zone 2N
-<BR> <epsg26703> : NAD27 / UTM zone 3N
-<BR> <epsg26704> : NAD27 / UTM zone 4N
-<BR> <epsg26705> : NAD27 / UTM zone 5N
-<BR> <epsg26706> : NAD27 / UTM zone 6N
-<BR> <epsg26707> : NAD27 / UTM zone 7N
-<BR> <epsg26708> : NAD27 / UTM zone 8N
-<BR> <epsg26709> : NAD27 / UTM zone 9N
-<BR> <epsg26710> : NAD27 / UTM zone 10N
-<BR> <epsg26711> : NAD27 / UTM zone 11N
-<BR> <epsg26712> : NAD27 / UTM zone 12N
-<BR> <epsg26713> : NAD27 / UTM zone 13N
-<BR> <epsg26714> : NAD27 / UTM zone 14N
-<BR> <epsg26715> : NAD27 / UTM zone 15N
-<BR> <epsg26716> : NAD27 / UTM zone 16N
-<BR> <epsg26717> : NAD27 / UTM zone 17N
-<BR> <epsg26718> : NAD27 / UTM zone 18N
-<BR> <epsg26719> : NAD27 / UTM zone 19N
-<BR> <epsg26720> : NAD27 / UTM zone 20N
-<BR> <epsg26721> : NAD27 / UTM zone 21N
-<BR> <epsg26722> : NAD27 / UTM zone 22N
-<BR> <epsg26729> : NAD27 / Alabama East
-<BR> <epsg26730> : NAD27 / Alabama West
-<BR> <epsg26731> : NAD27 / Alaska zone 1
-<BR> <epsg26732> : NAD27 / Alaska zone 2
-<BR> <epsg26733> : NAD27 / Alaska zone 3
-<BR> <epsg26734> : NAD27 / Alaska zone 4
-<BR> <epsg26735> : NAD27 / Alaska zone 5
-<BR> <epsg26736> : NAD27 / Alaska zone 6
-<BR> <epsg26737> : NAD27 / Alaska zone 7
-<BR> <epsg26738> : NAD27 / Alaska zone 8
-<BR> <epsg26739> : NAD27 / Alaska zone 9
-<BR> <epsg26740> : NAD27 / Alaska zone 10
-<BR> <epsg26741> : NAD27 / California zone I
-<BR> <epsg26742> : NAD27 / California zone II
-<BR> <epsg26743> : NAD27 / California zone III
-<BR> <epsg26744> : NAD27 / California zone IV
-<BR> <epsg26745> : NAD27 / California zone V
-<BR> <epsg26746> : NAD27 / California zone VI
-<BR> <epsg26747> : NAD27 / California zone VII (deprecated)
-<BR> <epsg26748> : NAD27 / Arizona East
-<BR> <epsg26749> : NAD27 / Arizona Central
-<BR> <epsg26750> : NAD27 / Arizona West
-<BR> <epsg26751> : NAD27 / Arkansas North
-<BR> <epsg26752> : NAD27 / Arkansas South
-<BR> <epsg26753> : NAD27 / Colorado North
-<BR> <epsg26754> : NAD27 / Colorado Central
-<BR> <epsg26755> : NAD27 / Colorado South
-<BR> <epsg26756> : NAD27 / Connecticut
-<BR> <epsg26757> : NAD27 / Delaware
-<BR> <epsg26758> : NAD27 / Florida East
-<BR> <epsg26759> : NAD27 / Florida West
-<BR> <epsg26760> : NAD27 / Florida North
-<BR> <epsg26766> : NAD27 / Georgia East
-<BR> <epsg26767> : NAD27 / Georgia West
-<BR> <epsg26768> : NAD27 / Idaho East
-<BR> <epsg26769> : NAD27 / Idaho Central
-<BR> <epsg26770> : NAD27 / Idaho West
-<BR> <epsg26771> : NAD27 / Illinois East
-<BR> <epsg26772> : NAD27 / Illinois West
-<BR> <epsg26773> : NAD27 / Indiana East
-<BR> <epsg26774> : NAD27 / Indiana West
-<BR> <epsg26775> : NAD27 / Iowa North
-<BR> <epsg26776> : NAD27 / Iowa South
-<BR> <epsg26777> : NAD27 / Kansas North
-<BR> <epsg26778> : NAD27 / Kansas South
-<BR> <epsg26779> : NAD27 / Kentucky North
-<BR> <epsg26780> : NAD27 / Kentucky South
-<BR> <epsg26781> : NAD27 / Louisiana North
-<BR> <epsg26782> : NAD27 / Louisiana South
-<BR> <epsg26783> : NAD27 / Maine East
-<BR> <epsg26784> : NAD27 / Maine West
-<BR> <epsg26785> : NAD27 / Maryland
-<BR> <epsg26786> : NAD27 / Massachusetts Mainland
-<BR> <epsg26787> : NAD27 / Massachusetts Island
-<BR> <epsg26791> : NAD27 / Minnesota North
-<BR> <epsg26792> : NAD27 / Minnesota Central
-<BR> <epsg26793> : NAD27 / Minnesota South
-<BR> <epsg26794> : NAD27 / Mississippi East
-<BR> <epsg26795> : NAD27 / Mississippi West
-<BR> <epsg26796> : NAD27 / Missouri East
-<BR> <epsg26797> : NAD27 / Missouri Central
-<BR> <epsg26798> : NAD27 / Missouri West
-<BR> <epsg26799> : NAD27 / California zone VII
-<BR> <epsg26801> : NAD Michigan / Michigan East
-<BR> <epsg26802> : NAD Michigan / Michigan Old Central
-<BR> <epsg26803> : NAD Michigan / Michigan West
-<BR> <epsg26811> : NAD Michigan / Michigan North
-<BR> <epsg26812> : NAD Michigan / Michigan Central
-<BR> <epsg26813> : NAD Michigan / Michigan South
-<BR> <epsg26901> : NAD83 / UTM zone 1N
-<BR> <epsg26902> : NAD83 / UTM zone 2N
-<BR> <epsg26903> : NAD83 / UTM zone 3N
-<BR> <epsg26904> : NAD83 / UTM zone 4N
-<BR> <epsg26905> : NAD83 / UTM zone 5N
-<BR> <epsg26906> : NAD83 / UTM zone 6N
-<BR> <epsg26907> : NAD83 / UTM zone 7N
-<BR> <epsg26908> : NAD83 / UTM zone 8N
-<BR> <epsg26909> : NAD83 / UTM zone 9N
-<BR> <epsg26910> : NAD83 / UTM zone 10N
-<BR> <epsg26911> : NAD83 / UTM zone 11N
-<BR> <epsg26912> : NAD83 / UTM zone 12N
-<BR> <epsg26913> : NAD83 / UTM zone 13N
-<BR> <epsg26914> : NAD83 / UTM zone 14N
-<BR> <epsg26915> : NAD83 / UTM zone 15N
-<BR> <epsg26916> : NAD83 / UTM zone 16N
-<BR> <epsg26917> : NAD83 / UTM zone 17N
-<BR> <epsg26918> : NAD83 / UTM zone 18N
-<BR> <epsg26919> : NAD83 / UTM zone 19N
-<BR> <epsg26920> : NAD83 / UTM zone 20N
-<BR> <epsg26921> : NAD83 / UTM zone 21N
-<BR> <epsg26922> : NAD83 / UTM zone 22N
-<BR> <epsg26923> : NAD83 / UTM zone 23N
-<BR> <epsg26929> : NAD83 / Alabama East
-<BR> <epsg26930> : NAD83 / Alabama West
-<BR> <epsg26931> : NAD83 / Alaska zone 1
-<BR> <epsg26932> : NAD83 / Alaska zone 2
-<BR> <epsg26933> : NAD83 / Alaska zone 3
-<BR> <epsg26934> : NAD83 / Alaska zone 4
-<BR> <epsg26935> : NAD83 / Alaska zone 5
-<BR> <epsg26936> : NAD83 / Alaska zone 6
-<BR> <epsg26937> : NAD83 / Alaska zone 7
-<BR> <epsg26938> : NAD83 / Alaska zone 8
-<BR> <epsg26939> : NAD83 / Alaska zone 9
-<BR> <epsg26940> : NAD83 / Alaska zone 10
-<BR> <epsg26941> : NAD83 / California zone 1
-<BR> <epsg26942> : NAD83 / California zone 2
-<BR> <epsg26943> : NAD83 / California zone 3
-<BR> <epsg26944> : NAD83 / California zone 4
-<BR> <epsg26945> : NAD83 / California zone 5
-<BR> <epsg26946> : NAD83 / California zone 6
-<BR> <epsg26948> : NAD83 / Arizona East
-<BR> <epsg26949> : NAD83 / Arizona Central
-<BR> <epsg26950> : NAD83 / Arizona West
-<BR> <epsg26951> : NAD83 / Arkansas North
-<BR> <epsg26952> : NAD83 / Arkansas South
-<BR> <epsg26953> : NAD83 / Colorado North
-<BR> <epsg26954> : NAD83 / Colorado Central
-<BR> <epsg26955> : NAD83 / Colorado South
-<BR> <epsg26956> : NAD83 / Connecticut
-<BR> <epsg26957> : NAD83 / Delaware
-<BR> <epsg26958> : NAD83 / Florida East
-<BR> <epsg26959> : NAD83 / Florida West
-<BR> <epsg26960> : NAD83 / Florida North
-<BR> <epsg26961> : NAD83 / Hawaii zone 1
-<BR> <epsg26962> : NAD83 / Hawaii zone 2
-<BR> <epsg26963> : NAD83 / Hawaii zone 3
-<BR> <epsg26964> : NAD83 / Hawaii zone 4
-<BR> <epsg26965> : NAD83 / Hawaii zone 5
-<BR> <epsg26966> : NAD83 / Georgia East
-<BR> <epsg26967> : NAD83 / Georgia West
-<BR> <epsg26968> : NAD83 / Idaho East
-<BR> <epsg26969> : NAD83 / Idaho Central
-<BR> <epsg26970> : NAD83 / Idaho West
-<BR> <epsg26971> : NAD83 / Illinois East
-<BR> <epsg26972> : NAD83 / Illinois West
-<BR> <epsg26973> : NAD83 / Indiana East
-<BR> <epsg26974> : NAD83 / Indiana West
-<BR> <epsg26975> : NAD83 / Iowa North
-<BR> <epsg26976> : NAD83 / Iowa South
-<BR> <epsg26977> : NAD83 / Kansas North
-<BR> <epsg26978> : NAD83 / Kansas South
-<BR> <epsg26979> : NAD83 / Kentucky North (deprecated)
-<BR> <epsg26980> : NAD83 / Kentucky South
-<BR> <epsg26981> : NAD83 / Louisiana North
-<BR> <epsg26982> : NAD83 / Louisiana South
-<BR> <epsg26983> : NAD83 / Maine East
-<BR> <epsg26984> : NAD83 / Maine West
-<BR> <epsg26985> : NAD83 / Maryland
-<BR> <epsg26986> : NAD83 / Massachusetts Mainland
-<BR> <epsg26987> : NAD83 / Massachusetts Island
-<BR> <epsg26988> : NAD83 / Michigan North
-<BR> <epsg26989> : NAD83 / Michigan Central
-<BR> <epsg26990> : NAD83 / Michigan South
-<BR> <epsg26991> : NAD83 / Minnesota North
-<BR> <epsg26992> : NAD83 / Minnesota Central
-<BR> <epsg26993> : NAD83 / Minnesota South
-<BR> <epsg26994> : NAD83 / Mississippi East
-<BR> <epsg26995> : NAD83 / Mississippi West
-<BR> <epsg26996> : NAD83 / Missouri East
-<BR> <epsg26997> : NAD83 / Missouri Central
-<BR> <epsg26998> : NAD83 / Missouri West
-<BR> <epsg27037> : Nahrwan 1967 / UTM zone 37N
-<BR> <epsg27038> : Nahrwan 1967 / UTM zone 38N
-<BR> <epsg27039> : Nahrwan 1967 / UTM zone 39N
-<BR> <epsg27040> : Nahrwan 1967 / UTM zone 40N
-<BR> <epsg27120> : Naparima 1972 / UTM zone 20N
-<BR> <epsg27200> : NZGD49 / New Zealand Map Grid
-<BR> <epsg27205> : NZGD49 / Mount Eden Circuit
-<BR> <epsg27206> : NZGD49 / Bay of Plenty Circuit
-<BR> <epsg27207> : NZGD49 / Poverty Bay Circuit
-<BR> <epsg27208> : NZGD49 / Hawkes Bay Circuit
-<BR> <epsg27209> : NZGD49 / Taranaki Circuit
-<BR> <epsg27210> : NZGD49 / Tuhirangi Circuit
-<BR> <epsg27211> : NZGD49 / Wanganui Circuit
-<BR> <epsg27212> : NZGD49 / Wairarapa Circuit
-<BR> <epsg27213> : NZGD49 / Wellington Circuit
-<BR> <epsg27214> : NZGD49 / Collingwood Circuit
-<BR> <epsg27215> : NZGD49 / Nelson Circuit
-<BR> <epsg27216> : NZGD49 / Karamea Circuit
-<BR> <epsg27217> : NZGD49 / Buller Circuit
-<BR> <epsg27218> : NZGD49 / Grey Circuit
-<BR> <epsg27219> : NZGD49 / Amuri Circuit
-<BR> <epsg27220> : NZGD49 / Marlborough Circuit
-<BR> <epsg27221> : NZGD49 / Hokitika Circuit
-<BR> <epsg27222> : NZGD49 / Okarito Circuit
-<BR> <epsg27223> : NZGD49 / Jacksons Bay Circuit
-<BR> <epsg27224> : NZGD49 / Mount Pleasant Circuit
-<BR> <epsg27225> : NZGD49 / Gawler Circuit
-<BR> <epsg27226> : NZGD49 / Timaru Circuit
-<BR> <epsg27227> : NZGD49 / Lindis Peak Circuit
-<BR> <epsg27228> : NZGD49 / Mount Nicholas Circuit
-<BR> <epsg27229> : NZGD49 / Mount York Circuit
-<BR> <epsg27230> : NZGD49 / Observation Point Circuit
-<BR> <epsg27231> : NZGD49 / North Taieri Circuit
-<BR> <epsg27232> : NZGD49 / Bluff Circuit
-<BR> <epsg27258> : NZGD49 / UTM zone 58S
-<BR> <epsg27259> : NZGD49 / UTM zone 59S
-<BR> <epsg27260> : NZGD49 / UTM zone 60S
-<BR> <epsg27291> : NZGD49 / North Island Grid
-<BR> <epsg27292> : NZGD49 / South Island Grid
-<BR> <epsg27391> : NGO 1948 (Oslo) / NGO zone I
-<BR> <epsg27392> : NGO 1948 (Oslo) / NGO zone II
-<BR> <epsg27393> : NGO 1948 (Oslo) / NGO zone III
-<BR> <epsg27394> : NGO 1948 (Oslo) / NGO zone IV
-<BR> <epsg27395> : NGO 1948 (Oslo) / NGO zone V
-<BR> <epsg27396> : NGO 1948 (Oslo) / NGO zone VI
-<BR> <epsg27397> : NGO 1948 (Oslo) / NGO zone VII
-<BR> <epsg27398> : NGO 1948 (Oslo) / NGO zone VIII
-<BR> <epsg27429> : Datum 73 / UTM zone 29N
-<BR> <epsg27492> : Datum 73 / Modified Portuguese Grid
-<BR> <epsg27500> : ATF (Paris) / Nord de Guerre
-<BR> <epsg27561> : NTF (Paris) / Lambert Nord France
-<BR> <epsg27562> : NTF (Paris) / Lambert Centre France
-<BR> <epsg27563> : NTF (Paris) / Lambert Sud France
-<BR> <epsg27564> : NTF (Paris) / Lambert Corse
-<BR> <epsg27571> : NTF (Paris) / Lambert zone I
-<BR> <epsg27572> : NTF (Paris) / Lambert zone II
-<BR> <epsg27573> : NTF (Paris) / Lambert zone III
-<BR> <epsg27574> : NTF (Paris) / Lambert zone IV
-<BR> <epsg27581> : NTF (Paris) / France I (deprecated)
-<BR> <epsg27582> : NTF (Paris) / France II (deprecated)
-<BR> <epsg27583> : NTF (Paris) / France III (deprecated)
-<BR> <epsg27584> : NTF (Paris) / France IV (deprecated)
-<BR> <epsg27591> : NTF (Paris) / Nord France (deprecated)
-<BR> <epsg27592> : NTF (Paris) / Centre France (deprecated)
-<BR> <epsg27593> : NTF (Paris) / Sud France (deprecated)
-<BR> <epsg27594> : NTF (Paris) / Corse (deprecated)
-<BR> <epsg27700> : OSGB 1936 / British National Grid
-<BR> <epsg28191> : Palestine 1923 / Palestine Grid
-<BR> <epsg28192> : Palestine 1923 / Palestine Belt
-<BR> <epsg28193> : Palestine 1923 / Israeli CS Grid
-<BR> <epsg28232> : Pointe Noire / UTM zone 32S
-<BR> <epsg28348> : GDA94 / MGA zone 48
-<BR> <epsg28349> : GDA94 / MGA zone 49
-<BR> <epsg28350> : GDA94 / MGA zone 50
-<BR> <epsg28351> : GDA94 / MGA zone 51
-<BR> <epsg28352> : GDA94 / MGA zone 52
-<BR> <epsg28353> : GDA94 / MGA zone 53
-<BR> <epsg28354> : GDA94 / MGA zone 54
-<BR> <epsg28355> : GDA94 / MGA zone 55
-<BR> <epsg28356> : GDA94 / MGA zone 56
-<BR> <epsg28357> : GDA94 / MGA zone 57
-<BR> <epsg28358> : GDA94 / MGA zone 58
-<BR> <epsg28402> : Pulkovo 1942 / Gauss-Kruger zone 2
-<BR> <epsg28403> : Pulkovo 1942 / Gauss-Kruger zone 3
-<BR> <epsg28404> : Pulkovo 1942 / Gauss-Kruger zone 4
-<BR> <epsg28405> : Pulkovo 1942 / Gauss-Kruger zone 5
-<BR> <epsg28406> : Pulkovo 1942 / Gauss-Kruger zone 6
-<BR> <epsg28407> : Pulkovo 1942 / Gauss-Kruger zone 7
-<BR> <epsg28408> : Pulkovo 1942 / Gauss-Kruger zone 8
-<BR> <epsg28409> : Pulkovo 1942 / Gauss-Kruger zone 9
-<BR> <epsg28410> : Pulkovo 1942 / Gauss-Kruger zone 10
-<BR> <epsg28411> : Pulkovo 1942 / Gauss-Kruger zone 11
-<BR> <epsg28412> : Pulkovo 1942 / Gauss-Kruger zone 12
-<BR> <epsg28413> : Pulkovo 1942 / Gauss-Kruger zone 13
-<BR> <epsg28414> : Pulkovo 1942 / Gauss-Kruger zone 14
-<BR> <epsg28415> : Pulkovo 1942 / Gauss-Kruger zone 15
-<BR> <epsg28416> : Pulkovo 1942 / Gauss-Kruger zone 16
-<BR> <epsg28417> : Pulkovo 1942 / Gauss-Kruger zone 17
-<BR> <epsg28418> : Pulkovo 1942 / Gauss-Kruger zone 18
-<BR> <epsg28419> : Pulkovo 1942 / Gauss-Kruger zone 19
-<BR> <epsg28420> : Pulkovo 1942 / Gauss-Kruger zone 20
-<BR> <epsg28421> : Pulkovo 1942 / Gauss-Kruger zone 21
-<BR> <epsg28422> : Pulkovo 1942 / Gauss-Kruger zone 22
-<BR> <epsg28423> : Pulkovo 1942 / Gauss-Kruger zone 23
-<BR> <epsg28424> : Pulkovo 1942 / Gauss-Kruger zone 24
-<BR> <epsg28425> : Pulkovo 1942 / Gauss-Kruger zone 25
-<BR> <epsg28426> : Pulkovo 1942 / Gauss-Kruger zone 26
-<BR> <epsg28427> : Pulkovo 1942 / Gauss-Kruger zone 27
-<BR> <epsg28428> : Pulkovo 1942 / Gauss-Kruger zone 28
-<BR> <epsg28429> : Pulkovo 1942 / Gauss-Kruger zone 29
-<BR> <epsg28430> : Pulkovo 1942 / Gauss-Kruger zone 30
-<BR> <epsg28431> : Pulkovo 1942 / Gauss-Kruger zone 31
-<BR> <epsg28432> : Pulkovo 1942 / Gauss-Kruger zone 32
-<BR> <epsg28462> : Pulkovo 1942 / Gauss-Kruger 2N (deprecated)
-<BR> <epsg28463> : Pulkovo 1942 / Gauss-Kruger 3N (deprecated)
-<BR> <epsg28464> : Pulkovo 1942 / Gauss-Kruger 4N (deprecated)
-<BR> <epsg28465> : Pulkovo 1942 / Gauss-Kruger 5N (deprecated)
-<BR> <epsg28466> : Pulkovo 1942 / Gauss-Kruger 6N (deprecated)
-<BR> <epsg28467> : Pulkovo 1942 / Gauss-Kruger 7N (deprecated)
-<BR> <epsg28468> : Pulkovo 1942 / Gauss-Kruger 8N (deprecated)
-<BR> <epsg28469> : Pulkovo 1942 / Gauss-Kruger 9N (deprecated)
-<BR> <epsg28470> : Pulkovo 1942 / Gauss-Kruger 10N (deprecated)
-<BR> <epsg28471> : Pulkovo 1942 / Gauss-Kruger 11N (deprecated)
-<BR> <epsg28472> : Pulkovo 1942 / Gauss-Kruger 12N (deprecated)
-<BR> <epsg28473> : Pulkovo 1942 / Gauss-Kruger 13N (deprecated)
-<BR> <epsg28474> : Pulkovo 1942 / Gauss-Kruger 14N (deprecated)
-<BR> <epsg28475> : Pulkovo 1942 / Gauss-Kruger 15N (deprecated)
-<BR> <epsg28476> : Pulkovo 1942 / Gauss-Kruger 16N (deprecated)
-<BR> <epsg28477> : Pulkovo 1942 / Gauss-Kruger 17N (deprecated)
-<BR> <epsg28478> : Pulkovo 1942 / Gauss-Kruger 18N (deprecated)
-<BR> <epsg28479> : Pulkovo 1942 / Gauss-Kruger 19N (deprecated)
-<BR> <epsg28480> : Pulkovo 1942 / Gauss-Kruger 20N (deprecated)
-<BR> <epsg28481> : Pulkovo 1942 / Gauss-Kruger 21N (deprecated)
-<BR> <epsg28482> : Pulkovo 1942 / Gauss-Kruger 22N (deprecated)
-<BR> <epsg28483> : Pulkovo 1942 / Gauss-Kruger 23N (deprecated)
-<BR> <epsg28484> : Pulkovo 1942 / Gauss-Kruger 24N (deprecated)
-<BR> <epsg28485> : Pulkovo 1942 / Gauss-Kruger 25N (deprecated)
-<BR> <epsg28486> : Pulkovo 1942 / Gauss-Kruger 26N (deprecated)
-<BR> <epsg28487> : Pulkovo 1942 / Gauss-Kruger 27N (deprecated)
-<BR> <epsg28488> : Pulkovo 1942 / Gauss-Kruger 28N (deprecated)
-<BR> <epsg28489> : Pulkovo 1942 / Gauss-Kruger 29N (deprecated)
-<BR> <epsg28490> : Pulkovo 1942 / Gauss-Kruger 30N (deprecated)
-<BR> <epsg28491> : Pulkovo 1942 / Gauss-Kruger 31N (deprecated)
-<BR> <epsg28492> : Pulkovo 1942 / Gauss-Kruger 32N (deprecated)
-<BR> <epsg28600> : Qatar 1974 / Qatar National Grid
-<BR> <epsg28991> : Amersfoort / RD Old
-<BR> <epsg28992> : Amersfoort / RD New
-<BR> <epsg29100> : SAD69 / Brazil Polyconic (deprecated)
-<BR> <epsg29101> : SAD69 / Brazil Polyconic
-<BR> <epsg29118> : SAD69 / UTM zone 18N (deprecated)
-<BR> <epsg29119> : SAD69 / UTM zone 19N (deprecated)
-<BR> <epsg29120> : SAD69 / UTM zone 20N (deprecated)
-<BR> <epsg29121> : SAD69 / UTM zone 21N (deprecated)
-<BR> <epsg29122> : SAD69 / UTM zone 22N (deprecated)
-<BR> <epsg29168> : SAD69 / UTM zone 18N
-<BR> <epsg29169> : SAD69 / UTM zone 19N
-<BR> <epsg29170> : SAD69 / UTM zone 20N
-<BR> <epsg29171> : SAD69 / UTM zone 21N
-<BR> <epsg29172> : SAD69 / UTM zone 22N
-<BR> <epsg29177> : SAD69 / UTM zone 17S (deprecated)
-<BR> <epsg29178> : SAD69 / UTM zone 18S (deprecated)
-<BR> <epsg29179> : SAD69 / UTM zone 19S (deprecated)
-<BR> <epsg29180> : SAD69 / UTM zone 20S (deprecated)
-<BR> <epsg29181> : SAD69 / UTM zone 21S (deprecated)
-<BR> <epsg29182> : SAD69 / UTM zone 22S (deprecated)
-<BR> <epsg29183> : SAD69 / UTM zone 23S (deprecated)
-<BR> <epsg29184> : SAD69 / UTM zone 24S (deprecated)
-<BR> <epsg29185> : SAD69 / UTM zone 25S (deprecated)
-<BR> <epsg29187> : SAD69 / UTM zone 17S
-<BR> <epsg29188> : SAD69 / UTM zone 18S
-<BR> <epsg29189> : SAD69 / UTM zone 19S
-<BR> <epsg29190> : SAD69 / UTM zone 20S
-<BR> <epsg29191> : SAD69 / UTM zone 21S
-<BR> <epsg29192> : SAD69 / UTM zone 22S
-<BR> <epsg29193> : SAD69 / UTM zone 23S
-<BR> <epsg29194> : SAD69 / UTM zone 24S
-<BR> <epsg29195> : SAD69 / UTM zone 25S
-<BR> <epsg29220> : Sapper Hill 1943 / UTM zone 20S
-<BR> <epsg29221> : Sapper Hill 1943 / UTM zone 21S
-<BR> <epsg29333> : Schwarzeck / UTM zone 33S
-<BR> <epsg29635> : Sudan / UTM zone 35N (deprecated)
-<BR> <epsg29636> : Sudan / UTM zone 36N (deprecated)
-<BR> <epsg29700> : Tananarive (Paris) / Laborde Grid (deprecated)
-<BR> <epsg29702> : Tananarive (Paris) / Laborde Grid approximation
-<BR> <epsg29738> : Tananarive / UTM zone 38S
-<BR> <epsg29739> : Tananarive / UTM zone 39S
-<BR> <epsg29849> : Timbalai 1948 / UTM zone 49N
-<BR> <epsg29850> : Timbalai 1948 / UTM zone 50N
-<BR> <epsg29871> : Timbalai 1948 / RSO Borneo (ch)
-<BR> <epsg29872> : Timbalai 1948 / RSO Borneo (ft)
-<BR> <epsg29873> : Timbalai 1948 / RSO Borneo (m)
-<BR> <epsg29900> : TM65 / Irish National Grid (deprecated)
-<BR> <epsg29901> : OSNI 1952 / Irish National Grid
-<BR> <epsg29902> : TM65 / Irish Grid
-<BR> <epsg29903> : TM75 / Irish Grid
-<BR> <epsg30161> : Tokyo / Japan Plane Rectangular CS I
-<BR> <epsg30162> : Tokyo / Japan Plane Rectangular CS II
-<BR> <epsg30163> : Tokyo / Japan Plane Rectangular CS III
-<BR> <epsg30164> : Tokyo / Japan Plane Rectangular CS IV
-<BR> <epsg30165> : Tokyo / Japan Plane Rectangular CS V
-<BR> <epsg30166> : Tokyo / Japan Plane Rectangular CS VI
-<BR> <epsg30167> : Tokyo / Japan Plane Rectangular CS VII
-<BR> <epsg30168> : Tokyo / Japan Plane Rectangular CS VIII
-<BR> <epsg30169> : Tokyo / Japan Plane Rectangular CS IX
-<BR> <epsg30170> : Tokyo / Japan Plane Rectangular CS X
-<BR> <epsg30171> : Tokyo / Japan Plane Rectangular CS XI
-<BR> <epsg30172> : Tokyo / Japan Plane Rectangular CS XII
-<BR> <epsg30173> : Tokyo / Japan Plane Rectangular CS XIII
-<BR> <epsg30174> : Tokyo / Japan Plane Rectangular CS XIV
-<BR> <epsg30175> : Tokyo / Japan Plane Rectangular CS XV
-<BR> <epsg30176> : Tokyo / Japan Plane Rectangular CS XVI
-<BR> <epsg30177> : Tokyo / Japan Plane Rectangular CS XVII
-<BR> <epsg30178> : Tokyo / Japan Plane Rectangular CS XVIII
-<BR> <epsg30179> : Tokyo / Japan Plane Rectangular CS XIX
-<BR> <epsg30200> : Trinidad 1903 / Trinidad Grid
-<BR> <epsg30339> : TC(1948) / UTM zone 39N
-<BR> <epsg30340> : TC(1948) / UTM zone 40N
-<BR> <epsg30491> : Voirol 1875 / Nord Algerie (ancienne)
-<BR> <epsg30492> : Voirol 1875 / Sud Algerie (ancienne)
-<BR> <epsg30493> : Voirol 1879 / Nord Algerie (ancienne)
-<BR> <epsg30494> : Voirol 1879 / Sud Algerie (ancienne)
-<BR> <epsg30729> : Nord Sahara 1959 / UTM zone 29N
-<BR> <epsg30730> : Nord Sahara 1959 / UTM zone 30N
-<BR> <epsg30731> : Nord Sahara 1959 / UTM zone 31N
-<BR> <epsg30732> : Nord Sahara 1959 / UTM zone 32N
-<BR> <epsg30791> : Nord Sahara 1959 / Voirol Unifie Nord
-<BR> <epsg30792> : Nord Sahara 1959 / Voirol Unifie Sud
-<BR> <epsg30800> : RT38 2.5 gon W (deprecated)
-<BR> <epsg31028> : Yoff / UTM zone 28N
-<BR> <epsg31121> : Zanderij / UTM zone 21N
-<BR> <epsg31154> : Zanderij / TM 54 NW
-<BR> <epsg31170> : Zanderij / Suriname Old TM
-<BR> <epsg31171> : Zanderij / Suriname TM
-<BR> <epsg31251> : MGI (Ferro) / Austria GK West Zone
-<BR> <epsg31252> : MGI (Ferro) / Austria GK Central Zone
-<BR> <epsg31253> : MGI (Ferro) / Austria GK East Zone
-<BR> <epsg31254> : MGI / Austria GK West
-<BR> <epsg31255> : MGI / Austria GK Central
-<BR> <epsg31256> : MGI / Austria GK East
-<BR> <epsg31257> : MGI / Austria GK M28
-<BR> <epsg31258> : MGI / Austria GK M31
-<BR> <epsg31259> : MGI / Austria GK M34
-<BR> <epsg31265> : MGI / 3-degree Gauss zone 5 (deprecated)
-<BR> <epsg31266> : MGI / 3-degree Gauss zone 6 (deprecated)
-<BR> <epsg31267> : MGI / 3-degree Gauss zone 7 (deprecated)
-<BR> <epsg31268> : MGI / 3-degree Gauss zone 8 (deprecated)
-<BR> <epsg31275> : MGI / Balkans zone 5
-<BR> <epsg31276> : MGI / Balkans zone 6
-<BR> <epsg31277> : MGI / Balkans zone 7
-<BR> <epsg31278> : MGI / Balkans zone 8 (deprecated)
-<BR> <epsg31279> : MGI / Balkans zone 8
-<BR> <epsg31281> : MGI (Ferro) / Austria West Zone
-<BR> <epsg31282> : MGI (Ferro) / Austria Central Zone
-<BR> <epsg31283> : MGI (Ferro) / Austria East Zone
-<BR> <epsg31284> : MGI / Austria M28
-<BR> <epsg31285> : MGI / Austria M31
-<BR> <epsg31286> : MGI / Austria M34
-<BR> <epsg31287> : MGI / Austria Lambert
-<BR> <epsg31288> : MGI (Ferro) / M28
-<BR> <epsg31289> : MGI (Ferro) / M31
-<BR> <epsg31290> : MGI (Ferro) / M34
-<BR> <epsg31291> : MGI (Ferro) / Austria West Zone (deprecated)
-<BR> <epsg31292> : MGI (Ferro) / Austria Central Zone (deprecated)
-<BR> <epsg31293> : MGI (Ferro) / Austria East Zone (deprecated)
-<BR> <epsg31294> : MGI / M28 (deprecated)
-<BR> <epsg31295> : MGI / M31 (deprecated)
-<BR> <epsg31296> : MGI / M34 (deprecated)
-<BR> <epsg31297> : MGI / Austria Lambert (deprecated)
-<BR> <epsg31300> : Belge 1972 / Belge Lambert 72
-<BR> <epsg31370> : Belge 1972 / Belgian Lambert 72
-<BR> <epsg31461> : DHDN / 3-degree Gauss zone 1 (deprecated)
-<BR> <epsg31462> : DHDN / 3-degree Gauss zone 2 (deprecated)
-<BR> <epsg31463> : DHDN / 3-degree Gauss zone 3 (deprecated)
-<BR> <epsg31464> : DHDN / 3-degree Gauss zone 4 (deprecated)
-<BR> <epsg31465> : DHDN / 3-degree Gauss zone 5 (deprecated)
-<BR> <epsg31466> : DHDN / Gauss-Kruger zone 2
-<BR> <epsg31467> : DHDN / Gauss-Kruger zone 3
-<BR> <epsg31468> : DHDN / Gauss-Kruger zone 4
-<BR> <epsg31469> : DHDN / Gauss-Kruger zone 5
-<BR> <epsg31528> : Conakry 1905 / UTM zone 28N
-<BR> <epsg31529> : Conakry 1905 / UTM zone 29N
-<BR> <epsg31600> : Dealul Piscului 1933/ Stereo 33
-<BR> <epsg31700> : Dealul Piscului 1970/ Stereo 70
-<BR> <epsg31838> : NGN / UTM zone 38N
-<BR> <epsg31839> : NGN / UTM zone 39N
-<BR> <epsg31900> : KUDAMS / KTM (deprecated)
-<BR> <epsg31901> : KUDAMS / KTM
-<BR> <epsg31965> : SIRGAS 2000 / UTM zone 11N
-<BR> <epsg31966> : SIRGAS 2000 / UTM zone 12N
-<BR> <epsg31967> : SIRGAS 2000 / UTM zone 13N
-<BR> <epsg31968> : SIRGAS 2000 / UTM zone 14N
-<BR> <epsg31969> : SIRGAS 2000 / UTM zone 15N
-<BR> <epsg31970> : SIRGAS 2000 / UTM zone 16N
-<BR> <epsg31971> : SIRGAS 2000 / UTM zone 17N
-<BR> <epsg31972> : SIRGAS 2000 / UTM zone 18N
-<BR> <epsg31973> : SIRGAS 2000 / UTM zone 19N
-<BR> <epsg31974> : SIRGAS 2000 / UTM zone 20N
-<BR> <epsg31975> : SIRGAS 2000 / UTM zone 21N
-<BR> <epsg31976> : SIRGAS 2000 / UTM zone 22N
-<BR> <epsg31977> : SIRGAS 2000 / UTM zone 17S
-<BR> <epsg31978> : SIRGAS 2000 / UTM zone 18S
-<BR> <epsg31979> : SIRGAS 2000 / UTM zone 19S
-<BR> <epsg31980> : SIRGAS 2000 / UTM zone 20S
-<BR> <epsg31981> : SIRGAS 2000 / UTM zone 21S
-<BR> <epsg31982> : SIRGAS 2000 / UTM zone 22S
-<BR> <epsg31983> : SIRGAS 2000 / UTM zone 23S
-<BR> <epsg31984> : SIRGAS 2000 / UTM zone 24S
-<BR> <epsg31985> : SIRGAS 2000 / UTM zone 25S
-<BR> <epsg31986> : SIRGAS / UTM zone 17N
-<BR> <epsg31987> : SIRGAS / UTM zone 18N
-<BR> <epsg31988> : SIRGAS / UTM zone 19N
-<BR> <epsg31989> : SIRGAS / UTM zone 20N
-<BR> <epsg31990> : SIRGAS / UTM zone 21N
-<BR> <epsg31991> : SIRGAS / UTM zone 22N
-<BR> <epsg31992> : SIRGAS / UTM zone 17S
-<BR> <epsg31993> : SIRGAS / UTM zone 18S
-<BR> <epsg31994> : SIRGAS / UTM zone 19S
-<BR> <epsg31995> : SIRGAS / UTM zone 20S
-<BR> <epsg31996> : SIRGAS / UTM zone 21S
-<BR> <epsg31997> : SIRGAS / UTM zone 22S
-<BR> <epsg31998> : SIRGAS / UTM zone 23S
-<BR> <epsg31999> : SIRGAS / UTM zone 24S
-<BR> <epsg32000> : SIRGAS / UTM zone 25S
-<BR> <epsg32001> : NAD27 / Montana North
-<BR> <epsg32002> : NAD27 / Montana Central
-<BR> <epsg32003> : NAD27 / Montana South
-<BR> <epsg32005> : NAD27 / Nebraska North
-<BR> <epsg32006> : NAD27 / Nebraska South
-<BR> <epsg32007> : NAD27 / Nevada East
-<BR> <epsg32008> : NAD27 / Nevada Central
-<BR> <epsg32009> : NAD27 / Nevada West
-<BR> <epsg32010> : NAD27 / New Hampshire
-<BR> <epsg32011> : NAD27 / New Jersey
-<BR> <epsg32012> : NAD27 / New Mexico East
-<BR> <epsg32013> : NAD27 / New Mexico Central
-<BR> <epsg32014> : NAD27 / New Mexico West
-<BR> <epsg32015> : NAD27 / New York East
-<BR> <epsg32016> : NAD27 / New York Central
-<BR> <epsg32017> : NAD27 / New York West
-<BR> <epsg32018> : NAD27 / New York Long Island
-<BR> <epsg32019> : NAD27 / North Carolina
-<BR> <epsg32020> : NAD27 / North Dakota North
-<BR> <epsg32021> : NAD27 / North Dakota South
-<BR> <epsg32022> : NAD27 / Ohio North
-<BR> <epsg32023> : NAD27 / Ohio South
-<BR> <epsg32024> : NAD27 / Oklahoma North
-<BR> <epsg32025> : NAD27 / Oklahoma South
-<BR> <epsg32026> : NAD27 / Oregon North
-<BR> <epsg32027> : NAD27 / Oregon South
-<BR> <epsg32028> : NAD27 / Pennsylvania North
-<BR> <epsg32029> : NAD27 / Pennsylvania South
-<BR> <epsg32030> : NAD27 / Rhode Island
-<BR> <epsg32031> : NAD27 / South Carolina North
-<BR> <epsg32033> : NAD27 / South Carolina South
-<BR> <epsg32034> : NAD27 / South Dakota North
-<BR> <epsg32035> : NAD27 / South Dakota South
-<BR> <epsg32036> : NAD27 / Tennessee (deprecated)
-<BR> <epsg32037> : NAD27 / Texas North
-<BR> <epsg32038> : NAD27 / Texas North Central
-<BR> <epsg32039> : NAD27 / Texas Central
-<BR> <epsg32040> : NAD27 / Texas South Central
-<BR> <epsg32041> : NAD27 / Texas South
-<BR> <epsg32042> : NAD27 / Utah North
-<BR> <epsg32043> : NAD27 / Utah Central
-<BR> <epsg32044> : NAD27 / Utah South
-<BR> <epsg32045> : NAD27 / Vermont
-<BR> <epsg32046> : NAD27 / Virginia North
-<BR> <epsg32047> : NAD27 / Virginia South
-<BR> <epsg32048> : NAD27 / Washington North
-<BR> <epsg32049> : NAD27 / Washington South
-<BR> <epsg32050> : NAD27 / West Virginia North
-<BR> <epsg32051> : NAD27 / West Virginia South
-<BR> <epsg32052> : NAD27 / Wisconsin North
-<BR> <epsg32053> : NAD27 / Wisconsin Central
-<BR> <epsg32054> : NAD27 / Wisconsin South
-<BR> <epsg32055> : NAD27 / Wyoming East
-<BR> <epsg32056> : NAD27 / Wyoming East Central
-<BR> <epsg32057> : NAD27 / Wyoming West Central
-<BR> <epsg32058> : NAD27 / Wyoming West
-<BR> <epsg32061> : NAD27 / Guatemala Norte
-<BR> <epsg32062> : NAD27 / Guatemala Sur
-<BR> <epsg32064> : NAD27 / BLM 14N (ftUS)
-<BR> <epsg32065> : NAD27 / BLM 15N (ftUS)
-<BR> <epsg32066> : NAD27 / BLM 16N (ftUS)
-<BR> <epsg32067> : NAD27 / BLM 17N (ftUS)
-<BR> <epsg32074> : NAD27 / BLM 14N (feet) (deprecated)
-<BR> <epsg32075> : NAD27 / BLM 15N (feet) (deprecated)
-<BR> <epsg32076> : NAD27 / BLM 16N (feet) (deprecated)
-<BR> <epsg32077> : NAD27 / BLM 17N (feet) (deprecated)
-<BR> <epsg32081> : NAD27 / MTM zone 1
-<BR> <epsg32082> : NAD27 / MTM zone 2
-<BR> <epsg32083> : NAD27 / MTM zone 3
-<BR> <epsg32084> : NAD27 / MTM zone 4
-<BR> <epsg32085> : NAD27 / MTM zone 5
-<BR> <epsg32086> : NAD27 / MTM zone 6
-<BR> <epsg32098> : NAD27 / Quebec Lambert
-<BR> <epsg32099> : NAD27 / Louisiana Offshore
-<BR> <epsg32100> : NAD83 / Montana
-<BR> <epsg32104> : NAD83 / Nebraska
-<BR> <epsg32107> : NAD83 / Nevada East
-<BR> <epsg32108> : NAD83 / Nevada Central
-<BR> <epsg32109> : NAD83 / Nevada West
-<BR> <epsg32110> : NAD83 / New Hampshire
-<BR> <epsg32111> : NAD83 / New Jersey
-<BR> <epsg32112> : NAD83 / New Mexico East
-<BR> <epsg32113> : NAD83 / New Mexico Central
-<BR> <epsg32114> : NAD83 / New Mexico West
-<BR> <epsg32115> : NAD83 / New York East
-<BR> <epsg32116> : NAD83 / New York Central
-<BR> <epsg32117> : NAD83 / New York West
-<BR> <epsg32118> : NAD83 / New York Long Island
-<BR> <epsg32119> : NAD83 / North Carolina
-<BR> <epsg32120> : NAD83 / North Dakota North
-<BR> <epsg32121> : NAD83 / North Dakota South
-<BR> <epsg32122> : NAD83 / Ohio North
-<BR> <epsg32123> : NAD83 / Ohio South
-<BR> <epsg32124> : NAD83 / Oklahoma North
-<BR> <epsg32125> : NAD83 / Oklahoma South
-<BR> <epsg32126> : NAD83 / Oregon North
-<BR> <epsg32127> : NAD83 / Oregon South
-<BR> <epsg32128> : NAD83 / Pennsylvania North
-<BR> <epsg32129> : NAD83 / Pennsylvania South
-<BR> <epsg32130> : NAD83 / Rhode Island
-<BR> <epsg32133> : NAD83 / South Carolina
-<BR> <epsg32134> : NAD83 / South Dakota North
-<BR> <epsg32135> : NAD83 / South Dakota South
-<BR> <epsg32136> : NAD83 / Tennessee
-<BR> <epsg32137> : NAD83 / Texas North
-<BR> <epsg32138> : NAD83 / Texas North Central
-<BR> <epsg32139> : NAD83 / Texas Central
-<BR> <epsg32140> : NAD83 / Texas South Central
-<BR> <epsg32141> : NAD83 / Texas South
-<BR> <epsg32142> : NAD83 / Utah North
-<BR> <epsg32143> : NAD83 / Utah Central
-<BR> <epsg32144> : NAD83 / Utah South
-<BR> <epsg32145> : NAD83 / Vermont
-<BR> <epsg32146> : NAD83 / Virginia North
-<BR> <epsg32147> : NAD83 / Virginia South
-<BR> <epsg32148> : NAD83 / Washington North
-<BR> <epsg32149> : NAD83 / Washington South
-<BR> <epsg32150> : NAD83 / West Virginia North
-<BR> <epsg32151> : NAD83 / West Virginia South
-<BR> <epsg32152> : NAD83 / Wisconsin North
-<BR> <epsg32153> : NAD83 / Wisconsin Central
-<BR> <epsg32154> : NAD83 / Wisconsin South
-<BR> <epsg32155> : NAD83 / Wyoming East
-<BR> <epsg32156> : NAD83 / Wyoming East Central
-<BR> <epsg32157> : NAD83 / Wyoming West Central
-<BR> <epsg32158> : NAD83 / Wyoming West
-<BR> <epsg32161> : NAD83 / Puerto Rico & Virgin Is.
-<BR> <epsg32164> : NAD83 / BLM 14N (ftUS)
-<BR> <epsg32165> : NAD83 / BLM 15N (ftUS)
-<BR> <epsg32166> : NAD83 / BLM 16N (ftUS)
-<BR> <epsg32167> : NAD83 / BLM 17N (ftUS)
-<BR> <epsg32180> : NAD83 / SCoPQ zone 2
-<BR> <epsg32181> : NAD83 / MTM zone 1
-<BR> <epsg32182> : NAD83 / MTM zone 2
-<BR> <epsg32183> : NAD83 / MTM zone 3
-<BR> <epsg32184> : NAD83 / MTM zone 4
-<BR> <epsg32185> : NAD83 / MTM zone 5
-<BR> <epsg32186> : NAD83 / MTM zone 6
-<BR> <epsg32187> : NAD83 / MTM zone 7
-<BR> <epsg32188> : NAD83 / MTM zone 8
-<BR> <epsg32189> : NAD83 / MTM zone 9
-<BR> <epsg32190> : NAD83 / MTM zone 10
-<BR> <epsg32191> : NAD83 / MTM zone 11
-<BR> <epsg32192> : NAD83 / MTM zone 12
-<BR> <epsg32193> : NAD83 / MTM zone 13
-<BR> <epsg32194> : NAD83 / MTM zone 14
-<BR> <epsg32195> : NAD83 / MTM zone 15
-<BR> <epsg32196> : NAD83 / MTM zone 16
-<BR> <epsg32197> : NAD83 / MTM zone 17
-<BR> <epsg32198> : NAD83 / Quebec Lambert
-<BR> <epsg32199> : NAD83 / Louisiana Offshore
-<BR> <epsg32201> : WGS 72 / UTM zone 1N
-<BR> <epsg32202> : WGS 72 / UTM zone 2N
-<BR> <epsg32203> : WGS 72 / UTM zone 3N
-<BR> <epsg32204> : WGS 72 / UTM zone 4N
-<BR> <epsg32205> : WGS 72 / UTM zone 5N
-<BR> <epsg32206> : WGS 72 / UTM zone 6N
-<BR> <epsg32207> : WGS 72 / UTM zone 7N
-<BR> <epsg32208> : WGS 72 / UTM zone 8N
-<BR> <epsg32209> : WGS 72 / UTM zone 9N
-<BR> <epsg32210> : WGS 72 / UTM zone 10N
-<BR> <epsg32211> : WGS 72 / UTM zone 11N
-<BR> <epsg32212> : WGS 72 / UTM zone 12N
-<BR> <epsg32213> : WGS 72 / UTM zone 13N
-<BR> <epsg32214> : WGS 72 / UTM zone 14N
-<BR> <epsg32215> : WGS 72 / UTM zone 15N
-<BR> <epsg32216> : WGS 72 / UTM zone 16N
-<BR> <epsg32217> : WGS 72 / UTM zone 17N
-<BR> <epsg32218> : WGS 72 / UTM zone 18N
-<BR> <epsg32219> : WGS 72 / UTM zone 19N
-<BR> <epsg32220> : WGS 72 / UTM zone 20N
-<BR> <epsg32221> : WGS 72 / UTM zone 21N
-<BR> <epsg32222> : WGS 72 / UTM zone 22N
-<BR> <epsg32223> : WGS 72 / UTM zone 23N
-<BR> <epsg32224> : WGS 72 / UTM zone 24N
-<BR> <epsg32225> : WGS 72 / UTM zone 25N
-<BR> <epsg32226> : WGS 72 / UTM zone 26N
-<BR> <epsg32227> : WGS 72 / UTM zone 27N
-<BR> <epsg32228> : WGS 72 / UTM zone 28N
-<BR> <epsg32229> : WGS 72 / UTM zone 29N
-<BR> <epsg32230> : WGS 72 / UTM zone 30N
-<BR> <epsg32231> : WGS 72 / UTM zone 31N
-<BR> <epsg32232> : WGS 72 / UTM zone 32N
-<BR> <epsg32233> : WGS 72 / UTM zone 33N
-<BR> <epsg32234> : WGS 72 / UTM zone 34N
-<BR> <epsg32235> : WGS 72 / UTM zone 35N
-<BR> <epsg32236> : WGS 72 / UTM zone 36N
-<BR> <epsg32237> : WGS 72 / UTM zone 37N
-<BR> <epsg32238> : WGS 72 / UTM zone 38N
-<BR> <epsg32239> : WGS 72 / UTM zone 39N
-<BR> <epsg32240> : WGS 72 / UTM zone 40N
-<BR> <epsg32241> : WGS 72 / UTM zone 41N
-<BR> <epsg32242> : WGS 72 / UTM zone 42N
-<BR> <epsg32243> : WGS 72 / UTM zone 43N
-<BR> <epsg32244> : WGS 72 / UTM zone 44N
-<BR> <epsg32245> : WGS 72 / UTM zone 45N
-<BR> <epsg32246> : WGS 72 / UTM zone 46N
-<BR> <epsg32247> : WGS 72 / UTM zone 47N
-<BR> <epsg32248> : WGS 72 / UTM zone 48N
-<BR> <epsg32249> : WGS 72 / UTM zone 49N
-<BR> <epsg32250> : WGS 72 / UTM zone 50N
-<BR> <epsg32251> : WGS 72 / UTM zone 51N
-<BR> <epsg32252> : WGS 72 / UTM zone 52N
-<BR> <epsg32253> : WGS 72 / UTM zone 53N
-<BR> <epsg32254> : WGS 72 / UTM zone 54N
-<BR> <epsg32255> : WGS 72 / UTM zone 55N
-<BR> <epsg32256> : WGS 72 / UTM zone 56N
-<BR> <epsg32257> : WGS 72 / UTM zone 57N
-<BR> <epsg32258> : WGS 72 / UTM zone 58N
-<BR> <epsg32259> : WGS 72 / UTM zone 59N
-<BR> <epsg32260> : WGS 72 / UTM zone 60N
-<BR> <epsg32301> : WGS 72 / UTM zone 1S
-<BR> <epsg32302> : WGS 72 / UTM zone 2S
-<BR> <epsg32303> : WGS 72 / UTM zone 3S
-<BR> <epsg32304> : WGS 72 / UTM zone 4S
-<BR> <epsg32305> : WGS 72 / UTM zone 5S
-<BR> <epsg32306> : WGS 72 / UTM zone 6S
-<BR> <epsg32307> : WGS 72 / UTM zone 7S
-<BR> <epsg32308> : WGS 72 / UTM zone 8S
-<BR> <epsg32309> : WGS 72 / UTM zone 9S
-<BR> <epsg32310> : WGS 72 / UTM zone 10S
-<BR> <epsg32311> : WGS 72 / UTM zone 11S
-<BR> <epsg32312> : WGS 72 / UTM zone 12S
-<BR> <epsg32313> : WGS 72 / UTM zone 13S
-<BR> <epsg32314> : WGS 72 / UTM zone 14S
-<BR> <epsg32315> : WGS 72 / UTM zone 15S
-<BR> <epsg32316> : WGS 72 / UTM zone 16S
-<BR> <epsg32317> : WGS 72 / UTM zone 17S
-<BR> <epsg32318> : WGS 72 / UTM zone 18S
-<BR> <epsg32319> : WGS 72 / UTM zone 19S
-<BR> <epsg32320> : WGS 72 / UTM zone 20S
-<BR> <epsg32321> : WGS 72 / UTM zone 21S
-<BR> <epsg32322> : WGS 72 / UTM zone 22S
-<BR> <epsg32323> : WGS 72 / UTM zone 23S
-<BR> <epsg32324> : WGS 72 / UTM zone 24S
-<BR> <epsg32325> : WGS 72 / UTM zone 25S
-<BR> <epsg32326> : WGS 72 / UTM zone 26S
-<BR> <epsg32327> : WGS 72 / UTM zone 27S
-<BR> <epsg32328> : WGS 72 / UTM zone 28S
-<BR> <epsg32329> : WGS 72 / UTM zone 29S
-<BR> <epsg32330> : WGS 72 / UTM zone 30S
-<BR> <epsg32331> : WGS 72 / UTM zone 31S
-<BR> <epsg32332> : WGS 72 / UTM zone 32S
-<BR> <epsg32333> : WGS 72 / UTM zone 33S
-<BR> <epsg32334> : WGS 72 / UTM zone 34S
-<BR> <epsg32335> : WGS 72 / UTM zone 35S
-<BR> <epsg32336> : WGS 72 / UTM zone 36S
-<BR> <epsg32337> : WGS 72 / UTM zone 37S
-<BR> <epsg32338> : WGS 72 / UTM zone 38S
-<BR> <epsg32339> : WGS 72 / UTM zone 39S
-<BR> <epsg32340> : WGS 72 / UTM zone 40S
-<BR> <epsg32341> : WGS 72 / UTM zone 41S
-<BR> <epsg32342> : WGS 72 / UTM zone 42S
-<BR> <epsg32343> : WGS 72 / UTM zone 43S
-<BR> <epsg32344> : WGS 72 / UTM zone 44S
-<BR> <epsg32345> : WGS 72 / UTM zone 45S
-<BR> <epsg32346> : WGS 72 / UTM zone 46S
-<BR> <epsg32347> : WGS 72 / UTM zone 47S
-<BR> <epsg32348> : WGS 72 / UTM zone 48S
-<BR> <epsg32349> : WGS 72 / UTM zone 49S
-<BR> <epsg32350> : WGS 72 / UTM zone 50S
-<BR> <epsg32351> : WGS 72 / UTM zone 51S
-<BR> <epsg32352> : WGS 72 / UTM zone 52S
-<BR> <epsg32353> : WGS 72 / UTM zone 53S
-<BR> <epsg32354> : WGS 72 / UTM zone 54S
-<BR> <epsg32355> : WGS 72 / UTM zone 55S
-<BR> <epsg32356> : WGS 72 / UTM zone 56S
-<BR> <epsg32357> : WGS 72 / UTM zone 57S
-<BR> <epsg32358> : WGS 72 / UTM zone 58S
-<BR> <epsg32359> : WGS 72 / UTM zone 59S
-<BR> <epsg32360> : WGS 72 / UTM zone 60S
-<BR> <epsg32401> : WGS 72BE / UTM zone 1N
-<BR> <epsg32402> : WGS 72BE / UTM zone 2N
-<BR> <epsg32403> : WGS 72BE / UTM zone 3N
-<BR> <epsg32404> : WGS 72BE / UTM zone 4N
-<BR> <epsg32405> : WGS 72BE / UTM zone 5N
-<BR> <epsg32406> : WGS 72BE / UTM zone 6N
-<BR> <epsg32407> : WGS 72BE / UTM zone 7N
-<BR> <epsg32408> : WGS 72BE / UTM zone 8N
-<BR> <epsg32409> : WGS 72BE / UTM zone 9N
-<BR> <epsg32410> : WGS 72BE / UTM zone 10N
-<BR> <epsg32411> : WGS 72BE / UTM zone 11N
-<BR> <epsg32412> : WGS 72BE / UTM zone 12N
-<BR> <epsg32413> : WGS 72BE / UTM zone 13N
-<BR> <epsg32414> : WGS 72BE / UTM zone 14N
-<BR> <epsg32415> : WGS 72BE / UTM zone 15N
-<BR> <epsg32416> : WGS 72BE / UTM zone 16N
-<BR> <epsg32417> : WGS 72BE / UTM zone 17N
-<BR> <epsg32418> : WGS 72BE / UTM zone 18N
-<BR> <epsg32419> : WGS 72BE / UTM zone 19N
-<BR> <epsg32420> : WGS 72BE / UTM zone 20N
-<BR> <epsg32421> : WGS 72BE / UTM zone 21N
-<BR> <epsg32422> : WGS 72BE / UTM zone 22N
-<BR> <epsg32423> : WGS 72BE / UTM zone 23N
-<BR> <epsg32424> : WGS 72BE / UTM zone 24N
-<BR> <epsg32425> : WGS 72BE / UTM zone 25N
-<BR> <epsg32426> : WGS 72BE / UTM zone 26N
-<BR> <epsg32427> : WGS 72BE / UTM zone 27N
-<BR> <epsg32428> : WGS 72BE / UTM zone 28N
-<BR> <epsg32429> : WGS 72BE / UTM zone 29N
-<BR> <epsg32430> : WGS 72BE / UTM zone 30N
-<BR> <epsg32431> : WGS 72BE / UTM zone 31N
-<BR> <epsg32432> : WGS 72BE / UTM zone 32N
-<BR> <epsg32433> : WGS 72BE / UTM zone 33N
-<BR> <epsg32434> : WGS 72BE / UTM zone 34N
-<BR> <epsg32435> : WGS 72BE / UTM zone 35N
-<BR> <epsg32436> : WGS 72BE / UTM zone 36N
-<BR> <epsg32437> : WGS 72BE / UTM zone 37N
-<BR> <epsg32438> : WGS 72BE / UTM zone 38N
-<BR> <epsg32439> : WGS 72BE / UTM zone 39N
-<BR> <epsg32440> : WGS 72BE / UTM zone 40N
-<BR> <epsg32441> : WGS 72BE / UTM zone 41N
-<BR> <epsg32442> : WGS 72BE / UTM zone 42N
-<BR> <epsg32443> : WGS 72BE / UTM zone 43N
-<BR> <epsg32444> : WGS 72BE / UTM zone 44N
-<BR> <epsg32445> : WGS 72BE / UTM zone 45N
-<BR> <epsg32446> : WGS 72BE / UTM zone 46N
-<BR> <epsg32447> : WGS 72BE / UTM zone 47N
-<BR> <epsg32448> : WGS 72BE / UTM zone 48N
-<BR> <epsg32449> : WGS 72BE / UTM zone 49N
-<BR> <epsg32450> : WGS 72BE / UTM zone 50N
-<BR> <epsg32451> : WGS 72BE / UTM zone 51N
-<BR> <epsg32452> : WGS 72BE / UTM zone 52N
-<BR> <epsg32453> : WGS 72BE / UTM zone 53N
-<BR> <epsg32454> : WGS 72BE / UTM zone 54N
-<BR> <epsg32455> : WGS 72BE / UTM zone 55N
-<BR> <epsg32456> : WGS 72BE / UTM zone 56N
-<BR> <epsg32457> : WGS 72BE / UTM zone 57N
-<BR> <epsg32458> : WGS 72BE / UTM zone 58N
-<BR> <epsg32459> : WGS 72BE / UTM zone 59N
-<BR> <epsg32460> : WGS 72BE / UTM zone 60N
-<BR> <epsg32501> : WGS 72BE / UTM zone 1S
-<BR> <epsg32502> : WGS 72BE / UTM zone 2S
-<BR> <epsg32503> : WGS 72BE / UTM zone 3S
-<BR> <epsg32504> : WGS 72BE / UTM zone 4S
-<BR> <epsg32505> : WGS 72BE / UTM zone 5S
-<BR> <epsg32506> : WGS 72BE / UTM zone 6S
-<BR> <epsg32507> : WGS 72BE / UTM zone 7S
-<BR> <epsg32508> : WGS 72BE / UTM zone 8S
-<BR> <epsg32509> : WGS 72BE / UTM zone 9S
-<BR> <epsg32510> : WGS 72BE / UTM zone 10S
-<BR> <epsg32511> : WGS 72BE / UTM zone 11S
-<BR> <epsg32512> : WGS 72BE / UTM zone 12S
-<BR> <epsg32513> : WGS 72BE / UTM zone 13S
-<BR> <epsg32514> : WGS 72BE / UTM zone 14S
-<BR> <epsg32515> : WGS 72BE / UTM zone 15S
-<BR> <epsg32516> : WGS 72BE / UTM zone 16S
-<BR> <epsg32517> : WGS 72BE / UTM zone 17S
-<BR> <epsg32518> : WGS 72BE / UTM zone 18S
-<BR> <epsg32519> : WGS 72BE / UTM zone 19S
-<BR> <epsg32520> : WGS 72BE / UTM zone 20S
-<BR> <epsg32521> : WGS 72BE / UTM zone 21S
-<BR> <epsg32522> : WGS 72BE / UTM zone 22S
-<BR> <epsg32523> : WGS 72BE / UTM zone 23S
-<BR> <epsg32524> : WGS 72BE / UTM zone 24S
-<BR> <epsg32525> : WGS 72BE / UTM zone 25S
-<BR> <epsg32526> : WGS 72BE / UTM zone 26S
-<BR> <epsg32527> : WGS 72BE / UTM zone 27S
-<BR> <epsg32528> : WGS 72BE / UTM zone 28S
-<BR> <epsg32529> : WGS 72BE / UTM zone 29S
-<BR> <epsg32530> : WGS 72BE / UTM zone 30S
-<BR> <epsg32531> : WGS 72BE / UTM zone 31S
-<BR> <epsg32532> : WGS 72BE / UTM zone 32S
-<BR> <epsg32533> : WGS 72BE / UTM zone 33S
-<BR> <epsg32534> : WGS 72BE / UTM zone 34S
-<BR> <epsg32535> : WGS 72BE / UTM zone 35S
-<BR> <epsg32536> : WGS 72BE / UTM zone 36S
-<BR> <epsg32537> : WGS 72BE / UTM zone 37S
-<BR> <epsg32538> : WGS 72BE / UTM zone 38S
-<BR> <epsg32539> : WGS 72BE / UTM zone 39S
-<BR> <epsg32540> : WGS 72BE / UTM zone 40S
-<BR> <epsg32541> : WGS 72BE / UTM zone 41S
-<BR> <epsg32542> : WGS 72BE / UTM zone 42S
-<BR> <epsg32543> : WGS 72BE / UTM zone 43S
-<BR> <epsg32544> : WGS 72BE / UTM zone 44S
-<BR> <epsg32545> : WGS 72BE / UTM zone 45S
-<BR> <epsg32546> : WGS 72BE / UTM zone 46S
-<BR> <epsg32547> : WGS 72BE / UTM zone 47S
-<BR> <epsg32548> : WGS 72BE / UTM zone 48S
-<BR> <epsg32549> : WGS 72BE / UTM zone 49S
-<BR> <epsg32550> : WGS 72BE / UTM zone 50S
-<BR> <epsg32551> : WGS 72BE / UTM zone 51S
-<BR> <epsg32552> : WGS 72BE / UTM zone 52S
-<BR> <epsg32553> : WGS 72BE / UTM zone 53S
-<BR> <epsg32554> : WGS 72BE / UTM zone 54S
-<BR> <epsg32555> : WGS 72BE / UTM zone 55S
-<BR> <epsg32556> : WGS 72BE / UTM zone 56S
-<BR> <epsg32557> : WGS 72BE / UTM zone 57S
-<BR> <epsg32558> : WGS 72BE / UTM zone 58S
-<BR> <epsg32559> : WGS 72BE / UTM zone 59S
-<BR> <epsg32560> : WGS 72BE / UTM zone 60S
-<BR> <epsg32601> : WGS 84 / UTM zone 1N
-<BR> <epsg32602> : WGS 84 / UTM zone 2N
-<BR> <epsg32603> : WGS 84 / UTM zone 3N
-<BR> <epsg32604> : WGS 84 / UTM zone 4N
-<BR> <epsg32605> : WGS 84 / UTM zone 5N
-<BR> <epsg32606> : WGS 84 / UTM zone 6N
-<BR> <epsg32607> : WGS 84 / UTM zone 7N
-<BR> <epsg32608> : WGS 84 / UTM zone 8N
-<BR> <epsg32609> : WGS 84 / UTM zone 9N
-<BR> <epsg32610> : WGS 84 / UTM zone 10N
-<BR> <epsg32611> : WGS 84 / UTM zone 11N
-<BR> <epsg32612> : WGS 84 / UTM zone 12N
-<BR> <epsg32613> : WGS 84 / UTM zone 13N
-<BR> <epsg32614> : WGS 84 / UTM zone 14N
-<BR> <epsg32615> : WGS 84 / UTM zone 15N
-<BR> <epsg32616> : WGS 84 / UTM zone 16N
-<BR> <epsg32617> : WGS 84 / UTM zone 17N
-<BR> <epsg32618> : WGS 84 / UTM zone 18N
-<BR> <epsg32619> : WGS 84 / UTM zone 19N
-<BR> <epsg32620> : WGS 84 / UTM zone 20N
-<BR> <epsg32621> : WGS 84 / UTM zone 21N
-<BR> <epsg32622> : WGS 84 / UTM zone 22N
-<BR> <epsg32623> : WGS 84 / UTM zone 23N
-<BR> <epsg32624> : WGS 84 / UTM zone 24N
-<BR> <epsg32625> : WGS 84 / UTM zone 25N
-<BR> <epsg32626> : WGS 84 / UTM zone 26N
-<BR> <epsg32627> : WGS 84 / UTM zone 27N
-<BR> <epsg32628> : WGS 84 / UTM zone 28N
-<BR> <epsg32629> : WGS 84 / UTM zone 29N
-<BR> <epsg32630> : WGS 84 / UTM zone 30N
-<BR> <epsg32631> : WGS 84 / UTM zone 31N
-<BR> <epsg32632> : WGS 84 / UTM zone 32N
-<BR> <epsg32633> : WGS 84 / UTM zone 33N
-<BR> <epsg32634> : WGS 84 / UTM zone 34N
-<BR> <epsg32635> : WGS 84 / UTM zone 35N
-<BR> <epsg32636> : WGS 84 / UTM zone 36N
-<BR> <epsg32637> : WGS 84 / UTM zone 37N
-<BR> <epsg32638> : WGS 84 / UTM zone 38N
-<BR> <epsg32639> : WGS 84 / UTM zone 39N
-<BR> <epsg32640> : WGS 84 / UTM zone 40N
-<BR> <epsg32641> : WGS 84 / UTM zone 41N
-<BR> <epsg32642> : WGS 84 / UTM zone 42N
-<BR> <epsg32643> : WGS 84 / UTM zone 43N
-<BR> <epsg32644> : WGS 84 / UTM zone 44N
-<BR> <epsg32645> : WGS 84 / UTM zone 45N
-<BR> <epsg32646> : WGS 84 / UTM zone 46N
-<BR> <epsg32647> : WGS 84 / UTM zone 47N
-<BR> <epsg32648> : WGS 84 / UTM zone 48N
-<BR> <epsg32649> : WGS 84 / UTM zone 49N
-<BR> <epsg32650> : WGS 84 / UTM zone 50N
-<BR> <epsg32651> : WGS 84 / UTM zone 51N
-<BR> <epsg32652> : WGS 84 / UTM zone 52N
-<BR> <epsg32653> : WGS 84 / UTM zone 53N
-<BR> <epsg32654> : WGS 84 / UTM zone 54N
-<BR> <epsg32655> : WGS 84 / UTM zone 55N
-<BR> <epsg32656> : WGS 84 / UTM zone 56N
-<BR> <epsg32657> : WGS 84 / UTM zone 57N
-<BR> <epsg32658> : WGS 84 / UTM zone 58N
-<BR> <epsg32659> : WGS 84 / UTM zone 59N
-<BR> <epsg32660> : WGS 84 / UTM zone 60N
-<BR> <epsg32661> : WGS 84 / UPS North
-<BR> <epsg32662> : WGS 84 / Plate Carree
-<BR> <epsg32664> : WGS 84 / BLM 14N (ftUS)
-<BR> <epsg32665> : WGS 84 / BLM 15N (ftUS)
-<BR> <epsg32666> : WGS 84 / BLM 16N (ftUS)
-<BR> <epsg32667> : WGS 84 / BLM 17N (ftUS)
-<BR> <epsg32701> : WGS 84 / UTM zone 1S
-<BR> <epsg32702> : WGS 84 / UTM zone 2S
-<BR> <epsg32703> : WGS 84 / UTM zone 3S
-<BR> <epsg32704> : WGS 84 / UTM zone 4S
-<BR> <epsg32705> : WGS 84 / UTM zone 5S
-<BR> <epsg32706> : WGS 84 / UTM zone 6S
-<BR> <epsg32707> : WGS 84 / UTM zone 7S
-<BR> <epsg32708> : WGS 84 / UTM zone 8S
-<BR> <epsg32709> : WGS 84 / UTM zone 9S
-<BR> <epsg32710> : WGS 84 / UTM zone 10S
-<BR> <epsg32711> : WGS 84 / UTM zone 11S
-<BR> <epsg32712> : WGS 84 / UTM zone 12S
-<BR> <epsg32713> : WGS 84 / UTM zone 13S
-<BR> <epsg32714> : WGS 84 / UTM zone 14S
-<BR> <epsg32715> : WGS 84 / UTM zone 15S
-<BR> <epsg32716> : WGS 84 / UTM zone 16S
-<BR> <epsg32717> : WGS 84 / UTM zone 17S
-<BR> <epsg32718> : WGS 84 / UTM zone 18S
-<BR> <epsg32719> : WGS 84 / UTM zone 19S
-<BR> <epsg32720> : WGS 84 / UTM zone 20S
-<BR> <epsg32721> : WGS 84 / UTM zone 21S
-<BR> <epsg32722> : WGS 84 / UTM zone 22S
-<BR> <epsg32723> : WGS 84 / UTM zone 23S
-<BR> <epsg32724> : WGS 84 / UTM zone 24S
-<BR> <epsg32725> : WGS 84 / UTM zone 25S
-<BR> <epsg32726> : WGS 84 / UTM zone 26S
-<BR> <epsg32727> : WGS 84 / UTM zone 27S
-<BR> <epsg32728> : WGS 84 / UTM zone 28S
-<BR> <epsg32729> : WGS 84 / UTM zone 29S
-<BR> <epsg32730> : WGS 84 / UTM zone 30S
-<BR> <epsg32731> : WGS 84 / UTM zone 31S
-<BR> <epsg32732> : WGS 84 / UTM zone 32S
-<BR> <epsg32733> : WGS 84 / UTM zone 33S
-<BR> <epsg32734> : WGS 84 / UTM zone 34S
-<BR> <epsg32735> : WGS 84 / UTM zone 35S
-<BR> <epsg32736> : WGS 84 / UTM zone 36S
-<BR> <epsg32737> : WGS 84 / UTM zone 37S
-<BR> <epsg32738> : WGS 84 / UTM zone 38S
-<BR> <epsg32739> : WGS 84 / UTM zone 39S
-<BR> <epsg32740> : WGS 84 / UTM zone 40S
-<BR> <epsg32741> : WGS 84 / UTM zone 41S
-<BR> <epsg32742> : WGS 84 / UTM zone 42S
-<BR> <epsg32743> : WGS 84 / UTM zone 43S
-<BR> <epsg32744> : WGS 84 / UTM zone 44S
-<BR> <epsg32745> : WGS 84 / UTM zone 45S
-<BR> <epsg32746> : WGS 84 / UTM zone 46S
-<BR> <epsg32747> : WGS 84 / UTM zone 47S
-<BR> <epsg32748> : WGS 84 / UTM zone 48S
-<BR> <epsg32749> : WGS 84 / UTM zone 49S
-<BR> <epsg32750> : WGS 84 / UTM zone 50S
-<BR> <epsg32751> : WGS 84 / UTM zone 51S
-<BR> <epsg32752> : WGS 84 / UTM zone 52S
-<BR> <epsg32753> : WGS 84 / UTM zone 53S
-<BR> <epsg32754> : WGS 84 / UTM zone 54S
-<BR> <epsg32755> : WGS 84 / UTM zone 55S
-<BR> <epsg32756> : WGS 84 / UTM zone 56S
-<BR> <epsg32757> : WGS 84 / UTM zone 57S
-<BR> <epsg32758> : WGS 84 / UTM zone 58S
-<BR> <epsg32759> : WGS 84 / UTM zone 59S
-<BR> <epsg32760> : WGS 84 / UTM zone 60S
-<BR> <epsg32761> : WGS 84 / UPS South
-<BR> <epsg32766> : WGS 84 / TM 36 SE
-<P>
-<BR> ---------------------------------------------------------
-<BR> Additional EPSG-like projection definitions
-<BR> ---------------------------------------------------------
-<BR> OGC-defined extended codes  (41000--41999) see <A HREF="http://www.digitalearth.gov/wmt/auto.html">http://www.digitalearth.gov/wmt/auto.html</A>
-<BR> ---------------------------------------------------------
-<BR> <epsg41001> : WGS84 / Simple Mercator
-<P>
-<BR> ---------------------------------------------------------
-<BR> CubeWerx-defined extended codes  (42100--42199)
-<BR> ---------------------------------------------------------
-<BR> <epsg42101> : WGS 84 / LCC Canada
-<BR> <epsg42102> : NAD83 / BC Albers (this has been superceeded but is kept for compatibility)
-<BR> <epsg42103> : WGS 84 / LCC USA
-<BR> <epsg42103> : NAD83 / MTM zone 8 Québec
-<BR> <epsg42105> : WGS84 / Merc NorthAm
-<BR> <epsg42106> : WGS84 / Lambert Azim Mozambique
-<P>
-<BR> ---------------------------------------------------------
-<BR> CubeWerx-customer definitions  (42300--42399)
-<BR> ---------------------------------------------------------
-<BR> <epsg42301> : NAD27 / Polar Stereographic / CM=-98
-<BR> <epsg42302>JapanOrtho.09 09
-<BR> <epsg42303> : NAD83 / Albers NorthAm
-<BR> <epsg42304> : NAD83 / NRCan LCC Canada
-<BR> <epsg42305> : France_II
-<BR> <epsg42306> : NAD83/QC_LCC
-<BR> <epsg42307> : NAD83 / Texas Central - feet
-<BR> <epsg42308> : NAD27 / California Albers
-<BR> <epsg42309> : NAD 83 / LCC Canada AVHRR-2
-<BR> <epsg42310> : WGS84+GRS80 / Mercator
-<BR> <epsg42311> : NAD83 / LCC Statcan
-<P>
-<BR> ---------------------------------------------------------
-<BR> ESRI projection definitions
-<BR> ---------------------------------------------------------
-<BR> <esri2000> : Anguilla 1957 / British West Indies Grid
-<BR> <esri2001> : Antigua 1943 / British West Indies Grid
-<BR> <esri2002> : Dominica 1945 / British West Indies Grid
-<BR> <esri2003> : Grenada 1953 / British West Indies Grid
-<BR> <esri2004> : Montserrat 58 / British West Indies Grid
-<BR> <esri2005> : St Kitts 1955 / British West Indies Grid
-<BR> <esri2006> : St Lucia 1955 / British West Indies Grid
-<BR> <esri2007> : St Vincent 45 / British West Indies Grid
-<BR> <esri2008> : NAD27(CGQ77) / SCoPQ zone 2
-<BR> <esri2009> : NAD27(CGQ77) / SCoPQ zone 3
-<BR> <esri2010> : NAD27(CGQ77) / SCoPQ zone 4
-<BR> <esri2011> : NAD27(CGQ77) / SCoPQ zone 5
-<BR> <esri2012> : NAD27(CGQ77) / SCoPQ zone 6
-<BR> <esri2013> : NAD27(CGQ77) / SCoPQ zone 7
-<BR> <esri2014> : NAD27(CGQ77) / SCoPQ zone 8
-<BR> <esri2015> : NAD27(CGQ77) / SCoPQ zone 9
-<BR> <esri2016> : NAD27(CGQ77) / SCoPQ zone 10
-<BR> <esri2017> : NAD27(76) / MTM zone 8
-<BR> <esri2018> : NAD27(76) / MTM zone 9
-<BR> <esri2019> : NAD27(76) / MTM zone 10
-<BR> <esri2020> : NAD27(76) / MTM zone 11
-<BR> <esri2021> : NAD27(76) / MTM zone 12
-<BR> <esri2022> : NAD27(76) / MTM zone 13
-<BR> <esri2023> : NAD27(76) / MTM zone 14
-<BR> <esri2024> : NAD27(76) / MTM zone 15
-<BR> <esri2025> : NAD27(76) / MTM zone 16
-<BR> <esri2026> : NAD27(76) / MTM zone 17
-<BR> <esri2027> : NAD27(76) / UTM zone 15N
-<BR> <esri2028> : NAD27(76) / UTM zone 16N
-<BR> <esri2029> : NAD27(76) / UTM zone 17N
-<BR> <esri2030> : NAD27(76) / UTM zone 18N
-<BR> <esri2031> : NAD27(CGQ77) / UTM zone 17N
-<BR> <esri2032> : NAD27(CGQ77) / UTM zone 18N
-<BR> <esri2033> : NAD27(CGQ77) / UTM zone 19N
-<BR> <esri2034> : NAD27(CGQ77) / UTM zone 20N
-<BR> <esri2035> : NAD27(CGQ77) / UTM zone 21N
-<BR> <esri2036> : NAD83(CSRS98) / New Brunswick Stereo
-<BR> <esri2037> : NAD83(CSRS98) / UTM zone 19N
-<BR> <esri2038> : NAD83(CSRS98) / UTM zone 20N
-<BR> <esri2039> : Israel / Israeli TM Grid
-<BR> <esri2040> : Locodjo 1965 / UTM zone 30N
-<BR> <esri2041> : Abidjan 1987 / UTM zone 30N
-<BR> <esri2042> : Locodjo 1965 / UTM zone 29N
-<BR> <esri2043> : Abidjan 1987 / UTM zone 29N
-<BR> <esri2044> : Hanoi 1972 / Gauss-Kruger zone 18
-<BR> <esri2045> : Hanoi 1972 / Gauss-Kruger zone 19
-<BR> <esri2056> : CH1903+ / LV95
-<BR> <esri2057> : Rassadiran / Nakhl e Taqi
-<BR> <esri2058> : ED50(ED77) / UTM zone 38N
-<BR> <esri2059> : ED50(ED77) / UTM zone 39N
-<BR> <esri2060> : ED50(ED77) / UTM zone 40N
-<BR> <esri2061> : ED50(ED77) / UTM zone 41N
-<BR> <esri2062> : Madrid 1870 (Madrid) / Spain
-<BR> <esri2063> : Dabola 1981 / UTM zone 28N
-<BR> <esri2064> : Dabola 1981 / UTM zone 29N
-<BR> <esri2065> : S-JTSK (Ferro) / Krovak
-<BR> <esri2066> : Mount Dillon / Tobago Grid
-<BR> <esri2067> : Naparima 1955 / UTM zone 20N
-<BR> <esri2068> : ELD79 / Libya zone 5
-<BR> <esri2069> : ELD79 / Libya zone 6
-<BR> <esri2070> : ELD79 / Libya zone 7
-<BR> <esri2071> : ELD79 / Libya zone 8
-<BR> <esri2072> : ELD79 / Libya zone 9
-<BR> <esri2073> : ELD79 / Libya zone 10
-<BR> <esri2074> : ELD79 / Libya zone 11
-<BR> <esri2075> : ELD79 / Libya zone 12
-<BR> <esri2076> : ELD79 / Libya zone 13
-<BR> <esri2077> : ELD79 / UTM zone 32N
-<BR> <esri2078> : ELD79 / UTM zone 33N
-<BR> <esri2079> : ELD79 / UTM zone 34N
-<BR> <esri2080> : ELD79 / UTM zone 35N
-<BR> <esri2081> : Chos Malal 1914 / Argentina zone 2
-<BR> <esri2082> : Pampa del Castillo / Argentina zone 2
-<BR> <esri2083> : Hito XVIII 1963 / Argentina zone 2
-<BR> <esri2084> : Hito XVIII 1963 / UTM zone 19S
-<BR> <esri2085> : NAD27 / Cuba Norte
-<BR> <esri2086> : NAD27 / Cuba Sur
-<BR> <esri2087> : ELD79 / TM 12 NE
-<BR> <esri2088> : Carthage / TM 11 NE
-<BR> <esri2089> : Yemen NGN96 / UTM zone 38N
-<BR> <esri2090> : Yemen NGN96 / UTM zone 39N
-<BR> <esri2091> : South Yemen / Gauss Kruger zone 8
-<BR> <esri2092> : South Yemen / Gauss Kruger zone 9
-<BR> <esri2093> : Hanoi 1972 / GK 106 NE
-<BR> <esri2094> : WGS 72BE / TM 106 NE
-<BR> <esri2095> : Bissau / UTM zone 28N
-<BR> <esri2096> : Korean 1985 / Korea East Belt
-<BR> <esri2097> : Korean 1985 / Korea Central Belt
-<BR> <esri2098> : Korean 1985 / Korea West Belt
-<BR> <esri2099> : Qatar 1948 / Qatar Grid
-<BR> <esri2100> : GGRS87 / Greek Grid
-<BR> <esri2101> : Lake / Maracaibo Grid M1
-<BR> <esri2102> : Lake / Maracaibo Grid
-<BR> <esri2103> : Lake / Maracaibo Grid M3
-<BR> <esri2104> : Lake / Maracaibo La Rosa Grid
-<BR> <esri2105> : NZGD2000 / Mount Eden Circuit 2000
-<BR> <esri2106> : NZGD2000 / Bay of Plenty Circuit 2000
-<BR> <esri2107> : NZGD2000 / Poverty Bay Circuit 2000
-<BR> <esri2108> : NZGD2000 / Hawkes Bay Circuit 2000
-<BR> <esri2109> : NZGD2000 / Taranaki Circuit 2000
-<BR> <esri2110> : NZGD2000 / Tuhirangi Circuit 2000
-<BR> <esri2111> : NZGD2000 / Wanganui Circuit 2000
-<BR> <esri2112> : NZGD2000 / Wairarapa Circuit 2000
-<BR> <esri2113> : NZGD2000 / Wellington Circuit 2000
-<BR> <esri2114> : NZGD2000 / Collingwood Circuit 2000
-<BR> <esri2115> : NZGD2000 / Nelson Circuit 2000
-<BR> <esri2116> : NZGD2000 / Karamea Circuit 2000
-<BR> <esri2117> : NZGD2000 / Buller Circuit 2000
-<BR> <esri2118> : NZGD2000 / Grey Circuit 2000
-<BR> <esri2119> : NZGD2000 / Amuri Circuit 2000
-<BR> <esri2120> : NZGD2000 / Marlborough Circuit 2000
-<BR> <esri2121> : NZGD2000 / Hokitika Circuit 2000
-<BR> <esri2122> : NZGD2000 / Okarito Circuit 2000
-<BR> <esri2123> : NZGD2000 / Jacksons Bay Circuit 2000
-<BR> <esri2124> : NZGD2000 / Mount Pleasant Circuit 2000
-<BR> <esri2125> : NZGD2000 / Gawler Circuit 2000
-<BR> <esri2126> : NZGD2000 / Timaru Circuit 2000
-<BR> <esri2127> : NZGD2000 / Lindis Peak Circuit 2000
-<BR> <esri2128> : NZGD2000 / Mount Nicholas Circuit 2000
-<BR> <esri2129> : NZGD2000 / Mount York Circuit 2000
-<BR> <esri2130> : NZGD2000 / Observation Point Circuit 2000
-<BR> <esri2131> : NZGD2000 / North Taieri Circuit 2000
-<BR> <esri2132> : NZGD2000 / Bluff Circuit 2000
-<BR> <esri2133> : NZGD2000 / UTM zone 58S
-<BR> <esri2134> : NZGD2000 / UTM zone 59S
-<BR> <esri2135> : NZGD2000 / UTM zone 60S
-<BR> <esri2136> : Accra / Ghana National Grid
-<BR> <esri2137> : Accra / TM 1 NW
-<BR> <esri2138> : NAD27(CGQ77) / Quebec Lambert
-<BR> <esri2139> : NAD83(CSRS98) / SCoPQ zone 2
-<BR> <esri2140> : NAD83(CSRS98) / MTM zone 3
-<BR> <esri2141> : NAD83(CSRS98) / MTM zone 4
-<BR> <esri2142> : NAD83(CSRS98) / MTM zone 5
-<BR> <esri2143> : NAD83(CSRS98) / MTM zone 6
-<BR> <esri2144> : NAD83(CSRS98) / MTM zone 7
-<BR> <esri2145> : NAD83(CSRS98) / MTM zone 8
-<BR> <esri2146> : NAD83(CSRS98) / MTM zone 9
-<BR> <esri2147> : NAD83(CSRS98) / MTM zone 10
-<BR> <esri2148> : NAD83(CSRS98) / UTM zone 21N
-<BR> <esri2149> : NAD83(CSRS98) / UTM zone 18N
-<BR> <esri2150> : NAD83(CSRS98) / UTM zone 17N
-<BR> <esri2151> : NAD83(CSRS98) / UTM zone 13N
-<BR> <esri2152> : NAD83(CSRS98) / UTM zone 12N
-<BR> <esri2153> : NAD83(CSRS98) / UTM zone 11N
-<BR> <esri2154> : RGF93 / Lambert-93
-<BR> <esri2155> : American Samoa 1962 / American Samoa Lambert
-<BR> <esri2156> : NAD83(HARN) / UTM zone 59S
-<BR> <esri2157> : IRENET95 / Irish Transverse Mercator
-<BR> <esri2158> : IRENET95 / UTM zone 29N
-<BR> <esri2159> : Sierra Leone 1924 / New Colony Grid
-<BR> <esri2160> : Sierra Leone 1924 / New War Office Grid
-<BR> <esri2161> : Sierra Leone 1968 / UTM zone 28N
-<BR> <esri2162> : Sierra Leone 1968 / UTM zone 29N
-<BR> <esri2163> : US National Atlas Equal Area
-<BR> <esri2164> : Locodjo 1965 / TM 5 NW
-<BR> <esri2165> : Abidjan 1987 / TM 5 NW
-<BR> <esri2166> : Pulkovo 1942(83) / Gauss Kruger zone 3
-<BR> <esri2167> : Pulkovo 1942(83) / Gauss Kruger zone 4
-<BR> <esri2168> : Pulkovo 1942(83) / Gauss Kruger zone 5
-<BR> <esri2169> : Luxembourg 1930 / Gauss
-<BR> <esri2170> : MGI / Slovenia Grid
-<BR> <esri2171> : Pulkovo 1942(58) / Poland zone I
-<BR> <esri2172> : Pulkovo 1942(58) / Poland zone II
-<BR> <esri2173> : Pulkovo 1942(58) / Poland zone III
-<BR> <esri2174> : Pulkovo 1942(58) / Poland zone IV
-<BR> <esri2175> : Pulkovo 1942(58) / Poland zone V
-<BR> <esri2176> : ETRS89 / Poland CS2000 zone 5
-<BR> <esri2177> : ETRS89 / Poland CS2000 zone 6
-<BR> <esri2178> : ETRS89 / Poland CS2000 zone 7
-<BR> <esri2179> : ETRS89 / Poland CS2000 zone 8
-<BR> <esri2180> : ETRS89 / Poland CS92
-<BR> <esri2188> : Azores Occidental 1939 / UTM zone 25N
-<BR> <esri2189> : Azores Central 1948 / UTM zone 26N
-<BR> <esri2190> : Azores Oriental 1940 / UTM zone 26N
-<BR> <esri2191> : Madeira 1936 / UTM zone 28N
-<BR> <esri2192> : ED50 / France EuroLambert
-<BR> <esri2193> : NZGD2000 / New Zealand Transverse Mercator
-<BR> <esri2194> : American Samoa 1962 / American Samoa Lambert
-<BR> <esri2195> : NAD83(HARN) / UTM zone 2S
-<BR> <esri2196> : ETRS89 / Kp2000 Jutland
-<BR> <esri2197> : ETRS89 / Kp2000 Zealand
-<BR> <esri2198> : ETRS89 / Kp2000 Bornholm
-<BR> <esri2199> : Albanian 1987 / Gauss Kruger zone 4
-<BR> <esri2200> : ATS77 / New Brunswick Stereographic (ATS77)
-<BR> <esri2201> : REGVEN / UTM zone 18N
-<BR> <esri2202> : REGVEN / UTM zone 19N
-<BR> <esri2203> : REGVEN / UTM zone 20N
-<BR> <esri2204> : NAD27 / Tennessee
-<BR> <esri2205> : NAD83 / Kentucky North
-<BR> <esri2206> : ED50 / 3-degree Gauss-Kruger zone 9
-<BR> <esri2207> : ED50 / 3-degree Gauss-Kruger zone 10
-<BR> <esri2208> : ED50 / 3-degree Gauss-Kruger zone 11
-<BR> <esri2209> : ED50 / 3-degree Gauss-Kruger zone 12
-<BR> <esri2210> : ED50 / 3-degree Gauss-Kruger zone 13
-<BR> <esri2211> : ED50 / 3-degree Gauss-Kruger zone 14
-<BR> <esri2212> : ED50 / 3-degree Gauss-Kruger zone 15
-<BR> <esri2213> : ETRS89 / TM 30 NE
-<BR> <esri2214> : Douala 1948 / AOF west
-<BR> <esri2215> : Manoca 1962 / UTM zone 32N
-<BR> <esri2216> : Qornoq 1927 / UTM zone 22N
-<BR> <esri2217> : Qornoq 1927 / UTM zone 23N
-<BR> <esri2219> : ATS77 / UTM zone 19N
-<BR> <esri2220> : ATS77 / UTM zone 20N
-<BR> <esri2222> : NAD83 / Arizona East (ft)
-<BR> <esri2223> : NAD83 / Arizona Central (ft)
-<BR> <esri2224> : NAD83 / Arizona West (ft)
-<BR> <esri2225> : NAD83 / California zone 1 (ftUS)
-<BR> <esri2226> : NAD83 / California zone 2 (ftUS)
-<BR> <esri2227> : NAD83 / California zone 3 (ftUS)
-<BR> <esri2228> : NAD83 / California zone 4 (ftUS)
-<BR> <esri2229> : NAD83 / California zone 5 (ftUS)
-<BR> <esri2230> : NAD83 / California zone 6 (ftUS)
-<BR> <esri2231> : NAD83 / Colorado North (ftUS)
-<BR> <esri2232> : NAD83 / Colorado Central (ftUS)
-<BR> <esri2233> : NAD83 / Colorado South (ftUS)
-<BR> <esri2234> : NAD83 / Connecticut (ftUS)
-<BR> <esri2235> : NAD83 / Delaware (ftUS)
-<BR> <esri2236> : NAD83 / Florida East (ftUS)
-<BR> <esri2237> : NAD83 / Florida West (ftUS)
-<BR> <esri2238> : NAD83 / Florida North (ftUS)
-<BR> <esri2239> : NAD83 / Georgia East (ftUS)
-<BR> <esri2240> : NAD83 / Georgia West (ftUS)
-<BR> <esri2241> : NAD83 / Idaho East (ftUS)
-<BR> <esri2242> : NAD83 / Idaho Central (ftUS)
-<BR> <esri2243> : NAD83 / Idaho West (ftUS)
-<BR> <esri2244> : NAD83 / Indiana East (ftUS)
-<BR> <esri2245> : NAD83 / Indiana West (ftUS)
-<BR> <esri2246> : NAD83 / Kentucky North (ftUS)
-<BR> <esri2247> : NAD83 / Kentucky South (ftUS)
-<BR> <esri2248> : NAD83 / Maryland (ftUS)
-<BR> <esri2249> : NAD83 / Massachusetts Mainland (ftUS)
-<BR> <esri2250> : NAD83 / Massachusetts Island (ftUS)
-<BR> <esri2251> : NAD83 / Michigan North (ft)
-<BR> <esri2252> : NAD83 / Michigan Central (ft)
-<BR> <esri2253> : NAD83 / Michigan South (ft)
-<BR> <esri2254> : NAD83 / Mississippi East (ftUS)
-<BR> <esri2255> : NAD83 / Mississippi West (ftUS)
-<BR> <esri2256> : NAD83 / Montana (ft)
-<BR> <esri2257> : NAD83 / New Mexico East (ftUS)
-<BR> <esri2258> : NAD83 / New Mexico Central (ftUS)
-<BR> <esri2259> : NAD83 / New Mexico West (ftUS)
-<BR> <esri2260> : NAD83 / New York East (ftUS)
-<BR> <esri2261> : NAD83 / New York Central (ftUS)
-<BR> <esri2262> : NAD83 / New York West (ftUS)
-<BR> <esri2263> : NAD83 / New York Long Island (ftUS)
-<BR> <esri2264> : NAD83 / North Carolina (ftUS)
-<BR> <esri2265> : NAD83 / North Dakota North (ft)
-<BR> <esri2266> : NAD83 / North Dakota South (ft)
-<BR> <esri2267> : NAD83 / Oklahoma North (ftUS)
-<BR> <esri2268> : NAD83 / Oklahoma South (ftUS)
-<BR> <esri2269> : NAD83 / Oregon North (ft)
-<BR> <esri2270> : NAD83 / Oregon South (ft)
-<BR> <esri2271> : NAD83 / Pennsylvania North (ftUS)
-<BR> <esri2272> : NAD83 / Pennsylvania South (ftUS)
-<BR> <esri2273> : NAD83 / South Carolina (ft)
-<BR> <esri2274> : NAD83 / Tennessee (ftUS)
-<BR> <esri2275> : NAD83 / Texas North (ftUS)
-<BR> <esri2276> : NAD83 / Texas North Central (ftUS)
-<BR> <esri2277> : NAD83 / Texas Central (ftUS)
-<BR> <esri2278> : NAD83 / Texas South Central (ftUS)
-<BR> <esri2279> : NAD83 / Texas South (ftUS)
-<BR> <esri2280> : NAD83 / Utah North (ft)
-<BR> <esri2281> : NAD83 / Utah Central (ft)
-<BR> <esri2282> : NAD83 / Utah South (ft)
-<BR> <esri2283> : NAD83 / Virginia North (ftUS)
-<BR> <esri2284> : NAD83 / Virginia South (ftUS)
-<BR> <esri2285> : NAD83 / Washington North (ftUS)
-<BR> <esri2286> : NAD83 / Washington South (ftUS)
-<BR> <esri2287> : NAD83 / Wisconsin North (ftUS)
-<BR> <esri2288> : NAD83 / Wisconsin Central (ftUS)
-<BR> <esri2289> : NAD83 / Wisconsin South (ftUS)
-<BR> <esri2290> : ATS77 / Prince Edward Isl. Stereographic (ATS77)
-<BR> <esri2291> : NAD83(CSRS98) / Prince Edward Isl. Stereographic (NAD83)
-<BR> <esri2292> : NAD83(CSRS98) / Prince Edward Isl. Stereographic (NAD83)
-<BR> <esri2294> : ATS77 / MTM Nova Scotia zone 4
-<BR> <esri2295> : ATS77 / MTM Nova Scotia zone 5
-<BR> <esri2308> : Batavia / TM 109 SE
-<BR> <esri2309> : WGS 84 / TM 116 SE
-<BR> <esri2310> : WGS 84 / TM 132 SE
-<BR> <esri2311> : WGS 84 / TM 6 NE
-<BR> <esri2312> : Garoua / UTM zone 33N
-<BR> <esri2313> : Kousseri / UTM zone 33N
-<BR> <esri2314> : Trinidad 1903 / Trinidad Grid (ftCla)
-<BR> <esri2315> : Campo Inchauspe / UTM zone 19S
-<BR> <esri2316> : Campo Inchauspe / UTM zone 20S
-<BR> <esri2317> : PSAD56 / ICN Regional
-<BR> <esri2318> : Ain el Abd / Aramco Lambert
-<BR> <esri2319> : ED50 / TM27
-<BR> <esri2320> : ED50 / TM30
-<BR> <esri2321> : ED50 / TM33
-<BR> <esri2322> : ED50 / TM36
-<BR> <esri2323> : ED50 / TM39
-<BR> <esri2324> : ED50 / TM42
-<BR> <esri2325> : ED50 / TM45
-<BR> <esri2326> : Hong Kong 1980 Grid System
-<BR> <esri2327> : Xian 1980 / Gauss-Kruger zone 13
-<BR> <esri2328> : Xian 1980 / Gauss-Kruger zone 14
-<BR> <esri2329> : Xian 1980 / Gauss-Kruger zone 15
-<BR> <esri2330> : Xian 1980 / Gauss-Kruger zone 16
-<BR> <esri2331> : Xian 1980 / Gauss-Kruger zone 17
-<BR> <esri2332> : Xian 1980 / Gauss-Kruger zone 18
-<BR> <esri2333> : Xian 1980 / Gauss-Kruger zone 19
-<BR> <esri2334> : Xian 1980 / Gauss-Kruger zone 20
-<BR> <esri2335> : Xian 1980 / Gauss-Kruger zone 21
-<BR> <esri2336> : Xian 1980 / Gauss-Kruger zone 22
-<BR> <esri2337> : Xian 1980 / Gauss-Kruger zone 23
-<BR> <esri2338> : Xian 1980 / Gauss-Kruger CM 75E
-<BR> <esri2339> : Xian 1980 / Gauss-Kruger CM 81E
-<BR> <esri2340> : Xian 1980 / Gauss-Kruger CM 87E
-<BR> <esri2341> : Xian 1980 / Gauss-Kruger CM 93E
-<BR> <esri2342> : Xian 1980 / Gauss-Kruger CM 99E
-<BR> <esri2343> : Xian 1980 / Gauss-Kruger CM 105E
-<BR> <esri2344> : Xian 1980 / Gauss-Kruger CM 111E
-<BR> <esri2345> : Xian 1980 / Gauss-Kruger CM 117E
-<BR> <esri2346> : Xian 1980 / Gauss-Kruger CM 123E
-<BR> <esri2347> : Xian 1980 / Gauss-Kruger CM 129E
-<BR> <esri2348> : Xian 1980 / Gauss-Kruger CM 135E
-<BR> <esri2349> : Xian 1980 / 3-degree Gauss-Kruger zone 25
-<BR> <esri2350> : Xian 1980 / 3-degree Gauss-Kruger zone 26
-<BR> <esri2351> : Xian 1980 / 3-degree Gauss-Kruger zone 27
-<BR> <esri2352> : Xian 1980 / 3-degree Gauss-Kruger zone 28
-<BR> <esri2353> : Xian 1980 / 3-degree Gauss-Kruger zone 29
-<BR> <esri2354> : Xian 1980 / 3-degree Gauss-Kruger zone 30
-<BR> <esri2355> : Xian 1980 / 3-degree Gauss-Kruger zone 31
-<BR> <esri2356> : Xian 1980 / 3-degree Gauss-Kruger zone 32
-<BR> <esri2357> : Xian 1980 / 3-degree Gauss-Kruger zone 33
-<BR> <esri2358> : Xian 1980 / 3-degree Gauss-Kruger zone 34
-<BR> <esri2359> : Xian 1980 / 3-degree Gauss-Kruger zone 35
-<BR> <esri2360> : Xian 1980 / 3-degree Gauss-Kruger zone 36
-<BR> <esri2361> : Xian 1980 / 3-degree Gauss-Kruger zone 37
-<BR> <esri2362> : Xian 1980 / 3-degree Gauss-Kruger zone 38
-<BR> <esri2363> : Xian 1980 / 3-degree Gauss-Kruger zone 39
-<BR> <esri2364> : Xian 1980 / 3-degree Gauss-Kruger zone 40
-<BR> <esri2365> : Xian 1980 / 3-degree Gauss-Kruger zone 41
-<BR> <esri2366> : Xian 1980 / 3-degree Gauss-Kruger zone 42
-<BR> <esri2367> : Xian 1980 / 3-degree Gauss-Kruger zone 43
-<BR> <esri2368> : Xian 1980 / 3-degree Gauss-Kruger zone 44
-<BR> <esri2369> : Xian 1980 / 3-degree Gauss-Kruger zone 45
-<BR> <esri2370> : Xian 1980 / 3-degree Gauss-Kruger CM 75E
-<BR> <esri2371> : Xian 1980 / 3-degree Gauss-Kruger CM 78E
-<BR> <esri2372> : Xian 1980 / 3-degree Gauss-Kruger CM 81E
-<BR> <esri2373> : Xian 1980 / 3-degree Gauss-Kruger CM 84E
-<BR> <esri2374> : Xian 1980 / 3-degree Gauss-Kruger CM 87E
-<BR> <esri2375> : Xian 1980 / 3-degree Gauss-Kruger CM 90E
-<BR> <esri2376> : Xian 1980 / 3-degree Gauss-Kruger CM 93E
-<BR> <esri2377> : Xian 1980 / 3-degree Gauss-Kruger CM 96E
-<BR> <esri2378> : Xian 1980 / 3-degree Gauss-Kruger CM 99E
-<BR> <esri2379> : Xian 1980 / 3-degree Gauss-Kruger CM 102E
-<BR> <esri2380> : Xian 1980 / 3-degree Gauss-Kruger CM 105E
-<BR> <esri2381> : Xian 1980 / 3-degree Gauss-Kruger CM 108E
-<BR> <esri2382> : Xian 1980 / 3-degree Gauss-Kruger CM 111E
-<BR> <esri2383> : Xian 1980 / 3-degree Gauss-Kruger CM 114E
-<BR> <esri2384> : Xian 1980 / 3-degree Gauss-Kruger CM 117E
-<BR> <esri2385> : Xian 1980 / 3-degree Gauss-Kruger CM 120E
-<BR> <esri2386> : Xian 1980 / 3-degree Gauss-Kruger CM 123E
-<BR> <esri2387> : Xian 1980 / 3-degree Gauss-Kruger CM 126E
-<BR> <esri2388> : Xian 1980 / 3-degree Gauss-Kruger CM 129E
-<BR> <esri2389> : Xian 1980 / 3-degree Gauss-Kruger CM 132E
-<BR> <esri2390> : Xian 1980 / 3-degree Gauss-Kruger CM 135E
-<BR> <esri2391> : KKJ / Finland zone 1
-<BR> <esri2392> : KKJ / Finland zone 2
-<BR> <esri2393> : KKJ / Finland Uniform Coordinate System
-<BR> <esri2394> : KKJ / Finland zone 4
-<BR> <esri2395> : South Yemen / Gauss-Kruger zone 8
-<BR> <esri2396> : South Yemen / Gauss-Kruger zone 9
-<BR> <esri2397> : Pulkovo 1942(83) / Gauss-Kruger zone 3
-<BR> <esri2398> : Pulkovo 1942(83) / Gauss-Kruger zone 4
-<BR> <esri2399> : Pulkovo 1942(83) / Gauss-Kruger zone 5
-<BR> <esri2400> : RT90 2.5 gon W
-<BR> <esri2401> : Beijing 1954 / 3-degree Gauss-Kruger zone 25
-<BR> <esri2402> : Beijing 1954 / 3-degree Gauss-Kruger zone 26
-<BR> <esri2403> : Beijing 1954 / 3-degree Gauss-Kruger zone 27
-<BR> <esri2404> : Beijing 1954 / 3-degree Gauss-Kruger zone 28
-<BR> <esri2405> : Beijing 1954 / 3-degree Gauss-Kruger zone 29
-<BR> <esri2406> : Beijing 1954 / 3-degree Gauss-Kruger zone 30
-<BR> <esri2407> : Beijing 1954 / 3-degree Gauss-Kruger zone 31
-<BR> <esri2408> : Beijing 1954 / 3-degree Gauss-Kruger zone 32
-<BR> <esri2409> : Beijing 1954 / 3-degree Gauss-Kruger zone 33
-<BR> <esri2410> : Beijing 1954 / 3-degree Gauss-Kruger zone 34
-<BR> <esri2411> : Beijing 1954 / 3-degree Gauss-Kruger zone 35
-<BR> <esri2412> : Beijing 1954 / 3-degree Gauss-Kruger zone 36
-<BR> <esri2413> : Beijing 1954 / 3-degree Gauss-Kruger zone 37
-<BR> <esri2414> : Beijing 1954 / 3-degree Gauss-Kruger zone 38
-<BR> <esri2415> : Beijing 1954 / 3-degree Gauss-Kruger zone 39
-<BR> <esri2416> : Beijing 1954 / 3-degree Gauss-Kruger zone 40
-<BR> <esri2417> : Beijing 1954 / 3-degree Gauss-Kruger zone 41
-<BR> <esri2418> : Beijing 1954 / 3-degree Gauss-Kruger zone 42
-<BR> <esri2419> : Beijing 1954 / 3-degree Gauss-Kruger zone 43
-<BR> <esri2420> : Beijing 1954 / 3-degree Gauss-Kruger zone 44
-<BR> <esri2421> : Beijing 1954 / 3-degree Gauss-Kruger zone 45
-<BR> <esri2422> : Beijing 1954 / 3-degree Gauss-Kruger CM 75E
-<BR> <esri2423> : Beijing 1954 / 3-degree Gauss-Kruger CM 78E
-<BR> <esri2424> : Beijing 1954 / 3-degree Gauss-Kruger CM 81E
-<BR> <esri2425> : Beijing 1954 / 3-degree Gauss-Kruger CM 84E
-<BR> <esri2426> : Beijing 1954 / 3-degree Gauss-Kruger CM 87E
-<BR> <esri2427> : Beijing 1954 / 3-degree Gauss-Kruger CM 90E
-<BR> <esri2428> : Beijing 1954 / 3-degree Gauss-Kruger CM 93E
-<BR> <esri2429> : Beijing 1954 / 3-degree Gauss-Kruger CM 96E
-<BR> <esri2430> : Beijing 1954 / 3-degree Gauss-Kruger CM 99E
-<BR> <esri2431> : Beijing 1954 / 3-degree Gauss-Kruger CM 102E
-<BR> <esri2432> : Beijing 1954 / 3-degree Gauss-Kruger CM 105E
-<BR> <esri2433> : Beijing 1954 / 3-degree Gauss-Kruger CM 108E
-<BR> <esri2434> : Beijing 1954 / 3-degree Gauss-Kruger CM 111E
-<BR> <esri2435> : Beijing 1954 / 3-degree Gauss-Kruger CM 114E
-<BR> <esri2436> : Beijing 1954 / 3-degree Gauss-Kruger CM 117E
-<BR> <esri2437> : Beijing 1954 / 3-degree Gauss-Kruger CM 120E
-<BR> <esri2438> : Beijing 1954 / 3-degree Gauss-Kruger CM 123E
-<BR> <esri2439> : Beijing 1954 / 3-degree Gauss-Kruger CM 126E
-<BR> <esri2440> : Beijing 1954 / 3-degree Gauss-Kruger CM 129E
-<BR> <esri2441> : Beijing 1954 / 3-degree Gauss-Kruger CM 132E
-<BR> <esri2442> : Beijing 1954 / 3-degree Gauss-Kruger CM 135E
-<BR> <esri2443> : JGD2000 / Japan Plane Rectangular CS I
-<BR> <esri2444> : JGD2000 / Japan Plane Rectangular CS II
-<BR> <esri2445> : JGD2000 / Japan Plane Rectangular CS III
-<BR> <esri2446> : JGD2000 / Japan Plane Rectangular CS IV
-<BR> <esri2447> : JGD2000 / Japan Plane Rectangular CS V
-<BR> <esri2448> : JGD2000 / Japan Plane Rectangular CS VI
-<BR> <esri2449> : JGD2000 / Japan Plane Rectangular CS VII
-<BR> <esri2450> : JGD2000 / Japan Plane Rectangular CS VIII
-<BR> <esri2451> : JGD2000 / Japan Plane Rectangular CS IX
-<BR> <esri2452> : JGD2000 / Japan Plane Rectangular CS X
-<BR> <esri2453> : JGD2000 / Japan Plane Rectangular CS XI
-<BR> <esri2454> : JGD2000 / Japan Plane Rectangular CS XII
-<BR> <esri2455> : JGD2000 / Japan Plane Rectangular CS XIII
-<BR> <esri2456> : JGD2000 / Japan Plane Rectangular CS XIV
-<BR> <esri2457> : JGD2000 / Japan Plane Rectangular CS XV
-<BR> <esri2458> : JGD2000 / Japan Plane Rectangular CS XVI
-<BR> <esri2459> : JGD2000 / Japan Plane Rectangular CS XVII
-<BR> <esri2460> : JGD2000 / Japan Plane Rectangular CS XVIII
-<BR> <esri2461> : JGD2000 / Japan Plane Rectangular CS XIX
-<BR> <esri2462> : Albanian 1987 / Gauss-Kruger zone 4
-<BR> <esri2463> : Pulkovo 1995 / Gauss-Kruger CM 21E
-<BR> <esri2464> : Pulkovo 1995 / Gauss-Kruger CM 27E
-<BR> <esri2465> : Pulkovo 1995 / Gauss-Kruger CM 33E
-<BR> <esri2466> : Pulkovo 1995 / Gauss-Kruger CM 39E
-<BR> <esri2467> : Pulkovo 1995 / Gauss-Kruger CM 45E
-<BR> <esri2468> : Pulkovo 1995 / Gauss-Kruger CM 51E
-<BR> <esri2469> : Pulkovo 1995 / Gauss-Kruger CM 57E
-<BR> <esri2470> : Pulkovo 1995 / Gauss-Kruger CM 63E
-<BR> <esri2471> : Pulkovo 1995 / Gauss-Kruger CM 69E
-<BR> <esri2472> : Pulkovo 1995 / Gauss-Kruger CM 75E
-<BR> <esri2473> : Pulkovo 1995 / Gauss-Kruger CM 81E
-<BR> <esri2474> : Pulkovo 1995 / Gauss-Kruger CM 87E
-<BR> <esri2475> : Pulkovo 1995 / Gauss-Kruger CM 93E
-<BR> <esri2476> : Pulkovo 1995 / Gauss-Kruger CM 99E
-<BR> <esri2477> : Pulkovo 1995 / Gauss-Kruger CM 105E
-<BR> <esri2478> : Pulkovo 1995 / Gauss-Kruger CM 111E
-<BR> <esri2479> : Pulkovo 1995 / Gauss-Kruger CM 117E
-<BR> <esri2480> : Pulkovo 1995 / Gauss-Kruger CM 123E
-<BR> <esri2481> : Pulkovo 1995 / Gauss-Kruger CM 129E
-<BR> <esri2482> : Pulkovo 1995 / Gauss-Kruger CM 135E
-<BR> <esri2483> : Pulkovo 1995 / Gauss-Kruger CM 141E
-<BR> <esri2484> : Pulkovo 1995 / Gauss-Kruger CM 147E
-<BR> <esri2485> : Pulkovo 1995 / Gauss-Kruger CM 153E
-<BR> <esri2486> : Pulkovo 1995 / Gauss-Kruger CM 159E
-<BR> <esri2487> : Pulkovo 1995 / Gauss-Kruger CM 165E
-<BR> <esri2488> : Pulkovo 1995 / Gauss-Kruger CM 171E
-<BR> <esri2489> : Pulkovo 1995 / Gauss-Kruger CM 177E
-<BR> <esri2490> : Pulkovo 1995 / Gauss-Kruger CM 177W
-<BR> <esri2491> : Pulkovo 1995 / Gauss-Kruger CM 171W
-<BR> <esri2492> : Pulkovo 1942 / Gauss-Kruger CM 9E
-<BR> <esri2493> : Pulkovo 1942 / Gauss-Kruger CM 15E
-<BR> <esri2494> : Pulkovo 1942 / Gauss-Kruger CM 21E
-<BR> <esri2495> : Pulkovo 1942 / Gauss-Kruger CM 27E
-<BR> <esri2496> : Pulkovo 1942 / Gauss-Kruger CM 33E
-<BR> <esri2497> : Pulkovo 1942 / Gauss-Kruger CM 39E
-<BR> <esri2498> : Pulkovo 1942 / Gauss-Kruger CM 45E
-<BR> <esri2499> : Pulkovo 1942 / Gauss-Kruger CM 51E
-<BR> <esri2500> : Pulkovo 1942 / Gauss-Kruger CM 57E
-<BR> <esri2501> : Pulkovo 1942 / Gauss-Kruger CM 63E
-<BR> <esri2502> : Pulkovo 1942 / Gauss-Kruger CM 69E
-<BR> <esri2503> : Pulkovo 1942 / Gauss-Kruger CM 75E
-<BR> <esri2504> : Pulkovo 1942 / Gauss-Kruger CM 81E
-<BR> <esri2505> : Pulkovo 1942 / Gauss-Kruger CM 87E
-<BR> <esri2506> : Pulkovo 1942 / Gauss-Kruger CM 93E
-<BR> <esri2507> : Pulkovo 1942 / Gauss-Kruger CM 99E
-<BR> <esri2508> : Pulkovo 1942 / Gauss-Kruger CM 105E
-<BR> <esri2509> : Pulkovo 1942 / Gauss-Kruger CM 111E
-<BR> <esri2510> : Pulkovo 1942 / Gauss-Kruger CM 117E
-<BR> <esri2511> : Pulkovo 1942 / Gauss-Kruger CM 123E
-<BR> <esri2512> : Pulkovo 1942 / Gauss-Kruger CM 129E
-<BR> <esri2513> : Pulkovo 1942 / Gauss-Kruger CM 135E
-<BR> <esri2514> : Pulkovo 1942 / Gauss-Kruger CM 141E
-<BR> <esri2515> : Pulkovo 1942 / Gauss-Kruger CM 147E
-<BR> <esri2516> : Pulkovo 1942 / Gauss-Kruger CM 153E
-<BR> <esri2517> : Pulkovo 1942 / Gauss-Kruger CM 159E
-<BR> <esri2518> : Pulkovo 1942 / Gauss-Kruger CM 165E
-<BR> <esri2519> : Pulkovo 1942 / Gauss-Kruger CM 171E
-<BR> <esri2520> : Pulkovo 1942 / Gauss-Kruger CM 177E
-<BR> <esri2521> : Pulkovo 1942 / Gauss-Kruger CM 177W
-<BR> <esri2522> : Pulkovo 1942 / Gauss-Kruger CM 171W
-<BR> <esri2523> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 7
-<BR> <esri2524> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 8
-<BR> <esri2525> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 9
-<BR> <esri2526> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 10
-<BR> <esri2527> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 11
-<BR> <esri2528> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 12
-<BR> <esri2529> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 13
-<BR> <esri2530> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 14
-<BR> <esri2531> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 15
-<BR> <esri2532> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 16
-<BR> <esri2533> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 17
-<BR> <esri2534> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 18
-<BR> <esri2535> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 19
-<BR> <esri2536> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 20
-<BR> <esri2537> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 21
-<BR> <esri2538> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 22
-<BR> <esri2539> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 23
-<BR> <esri2540> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 24
-<BR> <esri2541> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 25
-<BR> <esri2542> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 26
-<BR> <esri2543> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 27
-<BR> <esri2544> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 28
-<BR> <esri2545> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 29
-<BR> <esri2546> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 30
-<BR> <esri2547> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 31
-<BR> <esri2548> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 32
-<BR> <esri2549> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 33
-<BR> <esri2550> : Samboja / UTM zone 50S
-<BR> <esri2551> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 34
-<BR> <esri2552> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 35
-<BR> <esri2553> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 36
-<BR> <esri2554> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 37
-<BR> <esri2555> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 38
-<BR> <esri2556> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 39
-<BR> <esri2557> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 40
-<BR> <esri2558> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 41
-<BR> <esri2559> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 42
-<BR> <esri2560> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 43
-<BR> <esri2561> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 44
-<BR> <esri2562> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 45
-<BR> <esri2563> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 46
-<BR> <esri2564> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 47
-<BR> <esri2565> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 48
-<BR> <esri2566> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 49
-<BR> <esri2567> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 50
-<BR> <esri2568> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 51
-<BR> <esri2569> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 52
-<BR> <esri2570> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 53
-<BR> <esri2571> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 54
-<BR> <esri2572> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 55
-<BR> <esri2573> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 56
-<BR> <esri2574> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 57
-<BR> <esri2575> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 58
-<BR> <esri2576> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 59
-<BR> <esri2577> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 60
-<BR> <esri2578> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 61
-<BR> <esri2579> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 62
-<BR> <esri2580> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 63
-<BR> <esri2581> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 64
-<BR> <esri2582> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 21E
-<BR> <esri2583> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 24E
-<BR> <esri2584> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 27E
-<BR> <esri2585> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 30E
-<BR> <esri2586> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 33E
-<BR> <esri2587> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 36E
-<BR> <esri2588> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 39E
-<BR> <esri2589> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 42E
-<BR> <esri2590> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 45E
-<BR> <esri2591> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 48E
-<BR> <esri2592> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 51E
-<BR> <esri2593> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 54E
-<BR> <esri2594> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 57E
-<BR> <esri2595> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 60E
-<BR> <esri2596> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 63E
-<BR> <esri2597> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 66E
-<BR> <esri2598> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 69E
-<BR> <esri2599> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 72E
-<BR> <esri2600> : Lietuvos Koordinoei Sistema 1994
-<BR> <esri2601> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 75E
-<BR> <esri2602> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 78E
-<BR> <esri2603> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 81E
-<BR> <esri2604> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 84E
-<BR> <esri2605> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 87E
-<BR> <esri2606> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 90E
-<BR> <esri2607> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 93E
-<BR> <esri2608> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 96E
-<BR> <esri2609> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 99E
-<BR> <esri2610> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 102E
-<BR> <esri2611> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 105E
-<BR> <esri2612> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 108E
-<BR> <esri2613> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 111E
-<BR> <esri2614> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 114E
-<BR> <esri2615> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 117E
-<BR> <esri2616> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 120E
-<BR> <esri2617> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 123E
-<BR> <esri2618> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 126E
-<BR> <esri2619> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 129E
-<BR> <esri2620> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 132E
-<BR> <esri2621> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 135E
-<BR> <esri2622> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 138E
-<BR> <esri2623> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 141E
-<BR> <esri2624> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 144E
-<BR> <esri2625> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 147E
-<BR> <esri2626> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 150E
-<BR> <esri2627> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 153E
-<BR> <esri2628> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 156E
-<BR> <esri2629> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 159E
-<BR> <esri2630> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 162E
-<BR> <esri2631> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 165E
-<BR> <esri2632> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 168E
-<BR> <esri2633> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 171E
-<BR> <esri2634> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 174E
-<BR> <esri2635> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 177E
-<BR> <esri2636> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 180E
-<BR> <esri2637> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 177W
-<BR> <esri2638> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 174W
-<BR> <esri2639> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 171W
-<BR> <esri2640> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 168W
-<BR> <esri2641> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 7
-<BR> <esri2642> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 8
-<BR> <esri2643> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 9
-<BR> <esri2644> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 10
-<BR> <esri2645> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 11
-<BR> <esri2646> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 12
-<BR> <esri2647> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 13
-<BR> <esri2648> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 14
-<BR> <esri2649> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 15
-<BR> <esri2650> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 16
-<BR> <esri2651> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 17
-<BR> <esri2652> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 18
-<BR> <esri2653> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 19
-<BR> <esri2654> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 20
-<BR> <esri2655> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 21
-<BR> <esri2656> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 22
-<BR> <esri2657> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 23
-<BR> <esri2658> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 24
-<BR> <esri2659> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 25
-<BR> <esri2660> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 26
-<BR> <esri2661> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 27
-<BR> <esri2662> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 28
-<BR> <esri2663> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 29
-<BR> <esri2664> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 30
-<BR> <esri2665> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 31
-<BR> <esri2666> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 32
-<BR> <esri2667> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 33
-<BR> <esri2668> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 34
-<BR> <esri2669> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 35
-<BR> <esri2670> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 36
-<BR> <esri2671> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 37
-<BR> <esri2672> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 38
-<BR> <esri2673> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 39
-<BR> <esri2674> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 40
-<BR> <esri2675> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 41
-<BR> <esri2676> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 42
-<BR> <esri2677> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 43
-<BR> <esri2678> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 44
-<BR> <esri2679> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 45
-<BR> <esri2680> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 46
-<BR> <esri2681> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 47
-<BR> <esri2682> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 48
-<BR> <esri2683> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 49
-<BR> <esri2684> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 50
-<BR> <esri2685> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 51
-<BR> <esri2686> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 52
-<BR> <esri2687> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 53
-<BR> <esri2688> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 54
-<BR> <esri2689> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 55
-<BR> <esri2690> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 56
-<BR> <esri2691> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 57
-<BR> <esri2692> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 58
-<BR> <esri2693> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 59
-<BR> <esri2694> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 60
-<BR> <esri2695> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 61
-<BR> <esri2696> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 62
-<BR> <esri2697> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 63
-<BR> <esri2698> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 64
-<BR> <esri2699> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 21E
-<BR> <esri2700> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 24E
-<BR> <esri2701> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 27E
-<BR> <esri2702> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 30E
-<BR> <esri2703> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 33E
-<BR> <esri2704> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 36E
-<BR> <esri2705> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 39E
-<BR> <esri2706> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 42E
-<BR> <esri2707> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 45E
-<BR> <esri2708> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 48E
-<BR> <esri2709> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 51E
-<BR> <esri2710> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 54E
-<BR> <esri2711> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 57E
-<BR> <esri2712> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 60E
-<BR> <esri2713> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 63E
-<BR> <esri2714> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 66E
-<BR> <esri2715> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 69E
-<BR> <esri2716> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 72E
-<BR> <esri2717> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 75E
-<BR> <esri2718> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 78E
-<BR> <esri2719> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 81E
-<BR> <esri2720> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 84E
-<BR> <esri2721> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 87E
-<BR> <esri2722> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 90E
-<BR> <esri2723> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 93E
-<BR> <esri2724> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 96E
-<BR> <esri2725> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 99E
-<BR> <esri2726> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 102E
-<BR> <esri2727> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 105E
-<BR> <esri2728> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 108E
-<BR> <esri2729> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 111E
-<BR> <esri2730> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 114E
-<BR> <esri2731> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 117E
-<BR> <esri2732> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 120E
-<BR> <esri2733> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 123E
-<BR> <esri2734> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 126E
-<BR> <esri2735> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 129E
-<BR> <esri2736> : Tete / UTM zone 36S
-<BR> <esri2737> : Tete / UTM zone 37S
-<BR> <esri2738> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 132E
-<BR> <esri2739> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 135E
-<BR> <esri2740> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 138E
-<BR> <esri2741> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 141E
-<BR> <esri2742> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 144E
-<BR> <esri2743> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 147E
-<BR> <esri2744> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 150E
-<BR> <esri2745> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 153E
-<BR> <esri2746> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 156E
-<BR> <esri2747> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 159E
-<BR> <esri2748> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 162E
-<BR> <esri2749> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 165E
-<BR> <esri2750> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 168E
-<BR> <esri2751> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 171E
-<BR> <esri2752> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 174E
-<BR> <esri2753> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 177E
-<BR> <esri2754> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 180E
-<BR> <esri2755> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 177W
-<BR> <esri2756> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 174W
-<BR> <esri2757> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 171W
-<BR> <esri2758> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 168W
-<BR> <esri2759> : NAD83(HARN) / Alabama East
-<BR> <esri2760> : NAD83(HARN) / Alabama West
-<BR> <esri2761> : NAD83(HARN) / Arizona East
-<BR> <esri2762> : NAD83(HARN) / Arizona Central
-<BR> <esri2763> : NAD83(HARN) / Arizona West
-<BR> <esri2764> : NAD83(HARN) / Arkansas North
-<BR> <esri2765> : NAD83(HARN) / Arkansas South
-<BR> <esri2766> : NAD83(HARN) / California zone 1
-<BR> <esri2767> : NAD83(HARN) / California zone 2
-<BR> <esri2768> : NAD83(HARN) / California zone 3
-<BR> <esri2769> : NAD83(HARN) / California zone 4
-<BR> <esri2770> : NAD83(HARN) / California zone 5
-<BR> <esri2771> : NAD83(HARN) / California zone 6
-<BR> <esri2772> : NAD83(HARN) / Colorado North
-<BR> <esri2773> : NAD83(HARN) / Colorado Central
-<BR> <esri2774> : NAD83(HARN) / Colorado South
-<BR> <esri2775> : NAD83(HARN) / Connecticut
-<BR> <esri2776> : NAD83(HARN) / Delaware
-<BR> <esri2777> : NAD83(HARN) / Florida East
-<BR> <esri2778> : NAD83(HARN) / Florida West
-<BR> <esri2779> : NAD83(HARN) / Florida North
-<BR> <esri2780> : NAD83(HARN) / Georgia East
-<BR> <esri2781> : NAD83(HARN) / Georgia West
-<BR> <esri2782> : NAD83(HARN) / Hawaii zone 1
-<BR> <esri2783> : NAD83(HARN) / Hawaii zone 2
-<BR> <esri2784> : NAD83(HARN) / Hawaii zone 3
-<BR> <esri2785> : NAD83(HARN) / Hawaii zone 4
-<BR> <esri2786> : NAD83(HARN) / Hawaii zone 5
-<BR> <esri2787> : NAD83(HARN) / Idaho East
-<BR> <esri2788> : NAD83(HARN) / Idaho Central
-<BR> <esri2789> : NAD83(HARN) / Idaho West
-<BR> <esri2790> : NAD83(HARN) / Illinois East
-<BR> <esri2791> : NAD83(HARN) / Illinois West
-<BR> <esri2792> : NAD83(HARN) / Indiana East
-<BR> <esri2793> : NAD83(HARN) / Indiana West
-<BR> <esri2794> : NAD83(HARN) / Iowa North
-<BR> <esri2795> : NAD83(HARN) / Iowa South
-<BR> <esri2796> : NAD83(HARN) / Kansas North
-<BR> <esri2797> : NAD83(HARN) / Kansas South
-<BR> <esri2798> : NAD83(HARN) / Kentucky North
-<BR> <esri2799> : NAD83(HARN) / Kentucky South
-<BR> <esri2800> : NAD83(HARN) / Louisiana North
-<BR> <esri2801> : NAD83(HARN) / Louisiana South
-<BR> <esri2802> : NAD83(HARN) / Maine East
-<BR> <esri2803> : NAD83(HARN) / Maine West
-<BR> <esri2804> : NAD83(HARN) / Maryland
-<BR> <esri2805> : NAD83(HARN) / Massachusetts Mainland
-<BR> <esri2806> : NAD83(HARN) / Massachusetts Island
-<BR> <esri2807> : NAD83(HARN) / Michigan North
-<BR> <esri2808> : NAD83(HARN) / Michigan Central
-<BR> <esri2809> : NAD83(HARN) / Michigan South
-<BR> <esri2810> : NAD83(HARN) / Minnesota North
-<BR> <esri2811> : NAD83(HARN) / Minnesota Central
-<BR> <esri2812> : NAD83(HARN) / Minnesota South
-<BR> <esri2813> : NAD83(HARN) / Mississippi East
-<BR> <esri2814> : NAD83(HARN) / Mississippi West
-<BR> <esri2815> : NAD83(HARN) / Missouri East
-<BR> <esri2816> : NAD83(HARN) / Missouri Central
-<BR> <esri2817> : NAD83(HARN) / Missouri West
-<BR> <esri2818> : NAD83(HARN) / Montana
-<BR> <esri2819> : NAD83(HARN) / Nebraska
-<BR> <esri2820> : NAD83(HARN) / Nevada East
-<BR> <esri2821> : NAD83(HARN) / Nevada Central
-<BR> <esri2822> : NAD83(HARN) / Nevada West
-<BR> <esri2823> : NAD83(HARN) / New Hampshire
-<BR> <esri2824> : NAD83(HARN) / New Jersey
-<BR> <esri2825> : NAD83(HARN) / New Mexico East
-<BR> <esri2826> : NAD83(HARN) / New Mexico Central
-<BR> <esri2827> : NAD83(HARN) / New Mexico West
-<BR> <esri2828> : NAD83(HARN) / New York East
-<BR> <esri2829> : NAD83(HARN) / New York Central
-<BR> <esri2830> : NAD83(HARN) / New York West
-<BR> <esri2831> : NAD83(HARN) / New York Long Island
-<BR> <esri2832> : NAD83(HARN) / North Dakota North
-<BR> <esri2833> : NAD83(HARN) / North Dakota South
-<BR> <esri2834> : NAD83(HARN) / Ohio North
-<BR> <esri2835> : NAD83(HARN) / Ohio South
-<BR> <esri2836> : NAD83(HARN) / Oklahoma North
-<BR> <esri2837> : NAD83(HARN) / Oklahoma South
-<BR> <esri2838> : NAD83(HARN) / Oregon North
-<BR> <esri2839> : NAD83(HARN) / Oregon South
-<BR> <esri2840> : NAD83(HARN) / Rhode Island
-<BR> <esri2841> : NAD83(HARN) / South Dakota North
-<BR> <esri2842> : NAD83(HARN) / South Dakota South
-<BR> <esri2843> : NAD83(HARN) / Tennessee
-<BR> <esri2844> : NAD83(HARN) / Texas North
-<BR> <esri2845> : NAD83(HARN) / Texas North Central
-<BR> <esri2846> : NAD83(HARN) / Texas Central
-<BR> <esri2847> : NAD83(HARN) / Texas South Central
-<BR> <esri2848> : NAD83(HARN) / Texas South
-<BR> <esri2849> : NAD83(HARN) / Utah North
-<BR> <esri2850> : NAD83(HARN) / Utah Central
-<BR> <esri2851> : NAD83(HARN) / Utah South
-<BR> <esri2852> : NAD83(HARN) / Vermont
-<BR> <esri2853> : NAD83(HARN) / Virginia North
-<BR> <esri2854> : NAD83(HARN) / Virginia South
-<BR> <esri2855> : NAD83(HARN) / Washington North
-<BR> <esri2856> : NAD83(HARN) / Washington South
-<BR> <esri2857> : NAD83(HARN) / West Virginia North
-<BR> <esri2858> : NAD83(HARN) / West Virginia South
-<BR> <esri2859> : NAD83(HARN) / Wisconsin North
-<BR> <esri2860> : NAD83(HARN) / Wisconsin Central
-<BR> <esri2861> : NAD83(HARN) / Wisconsin South
-<BR> <esri2862> : NAD83(HARN) / Wyoming East
-<BR> <esri2863> : NAD83(HARN) / Wyoming East Central
-<BR> <esri2864> : NAD83(HARN) / Wyoming West Central
-<BR> <esri2865> : NAD83(HARN) / Wyoming West
-<BR> <esri2866> : NAD83(HARN) / Puerto Rico & Virgin Is.
-<BR> <esri2867> : NAD83(HARN) / Arizona East (ft)
-<BR> <esri2868> : NAD83(HARN) / Arizona Central (ft)
-<BR> <esri2869> : NAD83(HARN) / Arizona West (ft)
-<BR> <esri2870> : NAD83(HARN) / California zone 1 (ftUS)
-<BR> <esri2871> : NAD83(HARN) / California zone 2 (ftUS)
-<BR> <esri2872> : NAD83(HARN) / California zone 3 (ftUS)
-<BR> <esri2873> : NAD83(HARN) / California zone 4 (ftUS)
-<BR> <esri2874> : NAD83(HARN) / California zone 5 (ftUS)
-<BR> <esri2875> : NAD83(HARN) / California zone 6 (ftUS)
-<BR> <esri2876> : NAD83(HARN) / Colorado North (ftUS)
-<BR> <esri2877> : NAD83(HARN) / Colorado Central (ftUS)
-<BR> <esri2878> : NAD83(HARN) / Colorado South (ftUS)
-<BR> <esri2879> : NAD83(HARN) / Connecticut (ftUS)
-<BR> <esri2880> : NAD83(HARN) / Delaware (ftUS)
-<BR> <esri2881> : NAD83(HARN) / Florida East (ftUS)
-<BR> <esri2882> : NAD83(HARN) / Florida West (ftUS)
-<BR> <esri2883> : NAD83(HARN) / Florida North (ftUS)
-<BR> <esri2884> : NAD83(HARN) / Georgia East (ftUS)
-<BR> <esri2885> : NAD83(HARN) / Georgia West (ftUS)
-<BR> <esri2886> : NAD83(HARN) / Idaho East (ftUS)
-<BR> <esri2887> : NAD83(HARN) / Idaho Central (ftUS)
-<BR> <esri2888> : NAD83(HARN) / Idaho West (ftUS)
-<BR> <esri2889> : NAD83(HARN) / Indiana East (ftUS)
-<BR> <esri2890> : NAD83(HARN) / Indiana West (ftUS)
-<BR> <esri2891> : NAD83(HARN) / Kentucky North (ftUS)
-<BR> <esri2892> : NAD83(HARN) / Kentucky South (ftUS)
-<BR> <esri2893> : NAD83(HARN) / Maryland (ftUS)
-<BR> <esri2894> : NAD83(HARN) / Massachusetts Mainland (ftUS)
-<BR> <esri2895> : NAD83(HARN) / Massachusetts Island (ftUS)
-<BR> <esri2896> : NAD83(HARN) / Michigan North (ft)
-<BR> <esri2897> : NAD83(HARN) / Michigan Central (ft)
-<BR> <esri2898> : NAD83(HARN) / Michigan South (ft)
-<BR> <esri2899> : NAD83(HARN) / Mississippi East (ftUS)
-<BR> <esri2900> : NAD83(HARN) / Mississippi West (ftUS)
-<BR> <esri2901> : NAD83(HARN) / Montana (ft)
-<BR> <esri2902> : NAD83(HARN) / New Mexico East (ftUS)
-<BR> <esri2903> : NAD83(HARN) / New Mexico Central (ftUS)
-<BR> <esri2904> : NAD83(HARN) / New Mexico West (ftUS)
-<BR> <esri2905> : NAD83(HARN) / New York East (ftUS)
-<BR> <esri2906> : NAD83(HARN) / New York Central (ftUS)
-<BR> <esri2907> : NAD83(HARN) / New York West (ftUS)
-<BR> <esri2908> : NAD83(HARN) / New York Long Island (ftUS)
-<BR> <esri2909> : NAD83(HARN) / North Dakota North (ft)
-<BR> <esri2910> : NAD83(HARN) / North Dakota South (ft)
-<BR> <esri2911> : NAD83(HARN) / Oklahoma North (ftUS)
-<BR> <esri2912> : NAD83(HARN) / Oklahoma South (ftUS)
-<BR> <esri2913> : NAD83(HARN) / Oregon North (ft)
-<BR> <esri2914> : NAD83(HARN) / Oregon South (ft)
-<BR> <esri2915> : NAD83(HARN) / Tennessee (ftUS)
-<BR> <esri2916> : NAD83(HARN) / Texas North (ftUS)
-<BR> <esri2917> : NAD83(HARN) / Texas North Central (ftUS)
-<BR> <esri2918> : NAD83(HARN) / Texas Central (ftUS)
-<BR> <esri2919> : NAD83(HARN) / Texas South Central (ftUS)
-<BR> <esri2920> : NAD83(HARN) / Texas South (ftUS)
-<BR> <esri2921> : NAD83(HARN) / Utah North (ft)
-<BR> <esri2922> : NAD83(HARN) / Utah Central (ft)
-<BR> <esri2923> : NAD83(HARN) / Utah South (ft)
-<BR> <esri2924> : NAD83(HARN) / Virginia North (ftUS)
-<BR> <esri2925> : NAD83(HARN) / Virginia South (ftUS)
-<BR> <esri2926> : NAD83(HARN) / Washington North (ftUS)
-<BR> <esri2927> : NAD83(HARN) / Washington South (ftUS)
-<BR> <esri2928> : NAD83(HARN) / Wisconsin North (ftUS)
-<BR> <esri2929> : NAD83(HARN) / Wisconsin Central (ftUS)
-<BR> <esri2930> : NAD83(HARN) / Wisconsin South (ftUS)
-<BR> <esri2931> : Beduaram / TM 13 NE
-<BR> <esri2932> : QND95 / Qatar National Grid
-<BR> <esri2933> : Segara / UTM zone 50S
-<BR> <esri2934> : Segara (Jakarta) / NEIEZ
-<BR> <esri2935> : Pulkovo 1942 / CS63 zone A1
-<BR> <esri2936> : Pulkovo 1942 / CS63 zone A2
-<BR> <esri2937> : Pulkovo 1942 / CS63 zone A3
-<BR> <esri2938> : Pulkovo 1942 / CS63 zone A4
-<BR> <esri2939> : Pulkovo 1942 / CS63 zone K2
-<BR> <esri2940> : Pulkovo 1942 / CS63 zone K3
-<BR> <esri2941> : Pulkovo 1942 / CS63 zone K4
-<BR> <esri2942> : Porto Santo / UTM zone 28N
-<BR> <esri2943> : Selvagem Grande / UTM zone 28N
-<BR> <esri2944> : NAD83(CSRS) / SCoPQ zone 2
-<BR> <esri2945> : NAD83(CSRS) / MTM zone 3
-<BR> <esri2946> : NAD83(CSRS) / MTM zone 4
-<BR> <esri2947> : NAD83(CSRS) / MTM zone 5
-<BR> <esri2948> : NAD83(CSRS) / MTM zone 6
-<BR> <esri2949> : NAD83(CSRS) / MTM zone 7
-<BR> <esri2950> : NAD83(CSRS) / MTM zone 8
-<BR> <esri2951> : NAD83(CSRS) / MTM zone 9
-<BR> <esri2952> : NAD83(CSRS) / MTM zone 10
-<BR> <esri2953> : NAD83(CSRS) / New Brunswick Stereo
-<BR> <esri2954> : NAD83(CSRS) / Prince Edward Isl. Stereographic (NAD83)
-<BR> <esri2955> : NAD83(CSRS) / UTM zone 11N
-<BR> <esri2956> : NAD83(CSRS) / UTM zone 12N
-<BR> <esri2957> : NAD83(CSRS) / UTM zone 13N
-<BR> <esri2958> : NAD83(CSRS) / UTM zone 17N
-<BR> <esri2959> : NAD83(CSRS) / UTM zone 18N
-<BR> <esri2960> : NAD83(CSRS) / UTM zone 19N
-<BR> <esri2961> : NAD83(CSRS) / UTM zone 20N
-<BR> <esri2962> : NAD83(CSRS) / UTM zone 21N
-<BR> <esri3036> : Moznet / UTM zone 36S
-<BR> <esri3037> : Moznet / UTM zone 37S
-<BR> <esri3148> : Indian 1960 / UTM zone 48N
-<BR> <esri3149> : Indian 1960 / UTM zone 49N
-<BR> <esri3176> : Indian 1960 / TM 106 NE
-<BR> <esri3200> : FD58 / Iraq zone
-<BR> <esri3300> : Estonian Coordinate System of 1992
-<BR> <esri3301> : Estonian Coordinate System of 1997
-<BR> <esri3439> : PSD93 / UTM zone 39N
-<BR> <esri3440> : PSD93 / UTM zone 40N
-<BR> <esri3561> : Old Hawaiian / Hawaii zone 1
-<BR> <esri3562> : Old Hawaiian / Hawaii zone 2
-<BR> <esri3563> : Old Hawaiian / Hawaii zone 3
-<BR> <esri3564> : Old Hawaiian / Hawaii zone 4
-<BR> <esri3565> : Old Hawaiian / Hawaii zone 5
-<BR> <esri3920> : Puerto Rico / UTM zone 20N
-<BR> <esri3991> : Puerto Rico State Plane CS of 1927
-<BR> <esri3992> : Puerto Rico / St. Croix
-<BR> <esri4001> : Unknown datum based upon the Airy 1830 ellipsoid
-<BR> <esri4002> : Unknown datum based upon the Airy Modified 1849 ellipsoid
-<BR> <esri4003> : Unknown datum based upon the Australian National Spheroid
-<BR> <esri4004> : Unknown datum based upon the Bessel 1841 ellipsoid
-<BR> <esri4005> : Unknown datum based upon the Bessel Modified ellipsoid
-<BR> <esri4006> : Unknown datum based upon the Bessel Namibia ellipsoid
-<BR> <esri4007> : Unknown datum based upon the Clarke 1858 ellipsoid
-<BR> <esri4008> : Unknown datum based upon the Clarke 1866 ellipsoid
-<BR> <esri4009> : Unknown datum based upon the Clarke 1866 Michigan ellipsoid
-<BR> <esri4010> : Unknown datum based upon the Clarke 1880 (Benoit) ellipsoid
-<BR> <esri4011> : Unknown datum based upon the Clarke 1880 (IGN) ellipsoid
-<BR> <esri4012> : Unknown datum based upon the Clarke 1880 (RGS) ellipsoid
-<BR> <esri4013> : Unknown datum based upon the Clarke 1880 (Arc) ellipsoid
-<BR> <esri4014> : Unknown datum based upon the Clarke 1880 (SGA 1922) ellipsoid
-<BR> <esri4015> : Unknown datum based upon the Everest 1830 (1937 Adjustment) ellipsoid
-<BR> <esri4016> : Unknown datum based upon the Everest 1830 (1967 Definition) ellipsoid
-<BR> <esri4018> : Unknown datum based upon the Everest 1830 Modified ellipsoid
-<BR> <esri4019> : Unknown datum based upon the GRS 1980 ellipsoid
-<BR> <esri4020> : Unknown datum based upon the Helmert 1906 ellipsoid
-<BR> <esri4021> : Unknown datum based upon the Indonesian National Spheroid
-<BR> <esri4022> : Unknown datum based upon the International 1924 ellipsoid
-<BR> <esri4024> : Unknown datum based upon the Krassowsky 1940 ellipsoid
-<BR> <esri4025> : Unknown datum based upon the NWL 9D ellipsoid
-<BR> <esri4027> : Unknown datum based upon the Plessis 1817 ellipsoid
-<BR> <esri4028> : Unknown datum based upon the Struve 1860 ellipsoid
-<BR> <esri4029> : Unknown datum based upon the War Office ellipsoid
-<BR> <esri4030> : Unknown datum based upon the WGS 84 ellipsoid
-<BR> <esri4031> : Unknown datum based upon the GEM 10C ellipsoid
-<BR> <esri4032> : Unknown datum based upon the OSU86F ellipsoid
-<BR> <esri4033> : Unknown datum based upon the OSU91A ellipsoid
-<BR> <esri4034> : Unknown datum based upon the Clarke 1880 ellipsoid
-<BR> <esri4035> : Unknown datum based upon the Authalic Sphere
-<BR> <esri4036> : Unknown datum based upon the GRS 1967 ellipsoid
-<BR> <esri4041> : Unknown datum based upon the Average Terrestrial System 1977 ellipsoid
-<BR> <esri4042> : Unknown datum based upon the Everest (1830 Definition) ellipsoid
-<BR> <esri4043> : Unknown datum based upon the WGS 72 ellipsoid
-<BR> <esri4044> : Unknown datum based upon the Everest 1830 (1962 Definition) ellipsoid
-<BR> <esri4045> : Unknown datum based upon the Everest 1830 (1975 Definition) ellipsoid
-<BR> <esri4047> : Unspecified based upon the GRS 1980 Authalic Sphere
-<BR> <esri4120> : Greek
-<BR> <esri4121> : GGRS87
-<BR> <esri4122> : ATS77
-<BR> <esri4123> : KKJ
-<BR> <esri4124> : RT90
-<BR> <esri4125> : Samboja
-<BR> <esri4126> : LKS94 (ETRS89)
-<BR> <esri4127> : Tete
-<BR> <esri4128> : Madzansua
-<BR> <esri4129> : Observatario
-<BR> <esri4130> : Moznet
-<BR> <esri4131> : Indian 1960
-<BR> <esri4132> : FD58
-<BR> <esri4133> : EST92
-<BR> <esri4134> : PDO Survey Datum 1993
-<BR> <esri4135> : Old Hawaiian
-<BR> <esri4136> : St. Lawrence Island
-<BR> <esri4137> : St. Paul Island
-<BR> <esri4138> : St. George Island
-<BR> <esri4139> : Puerto Rico
-<BR> <esri4140> : NAD83(CSRS98)
-<BR> <esri4141> : Israel
-<BR> <esri4142> : Locodjo 1965
-<BR> <esri4143> : Abidjan 1987
-<BR> <esri4144> : Kalianpur 1937
-<BR> <esri4145> : Kalianpur 1962
-<BR> <esri4146> : Kalianpur 1975
-<BR> <esri4147> : Hanoi 1972
-<BR> <esri4148> : Hartebeesthoek94
-<BR> <esri4149> : CH1903
-<BR> <esri4150> : CH1903+
-<BR> <esri4151> : CHTRF95
-<BR> <esri4152> : NAD83(HARN)
-<BR> <esri4153> : Rassadiran
-<BR> <esri4154> : ED50(ED77)
-<BR> <esri4155> : Dabola 1981
-<BR> <esri4156> : S-JTSK
-<BR> <esri4157> : Mount Dillon
-<BR> <esri4158> : Naparima 1955
-<BR> <esri4159> : ELD79
-<BR> <esri4160> : Chos Malal 1914
-<BR> <esri4161> : Pampa del Castillo
-<BR> <esri4162> : Korean 1985
-<BR> <esri4163> : Yemen NGN96
-<BR> <esri4164> : South Yemen
-<BR> <esri4165> : Bissau
-<BR> <esri4166> : Korean 1995
-<BR> <esri4167> : NZGD2000
-<BR> <esri4168> : Accra
-<BR> <esri4169> : American Samoa 1962
-<BR> <esri4170> : SIRGAS
-<BR> <esri4171> : RGF93
-<BR> <esri4172> : POSGAR
-<BR> <esri4173> : IRENET95
-<BR> <esri4174> : Sierra Leone 1924
-<BR> <esri4175> : Sierra Leone 1968
-<BR> <esri4176> : Australian Antarctic
-<BR> <esri4178> : Pulkovo 1942(83)
-<BR> <esri4179> : Pulkovo 1942(58)
-<BR> <esri4180> : EST97
-<BR> <esri4181> : Luxembourg 1930
-<BR> <esri4182> : Azores Occidental 1939
-<BR> <esri4183> : Azores Central 1948
-<BR> <esri4184> : Azores Oriental 1940
-<BR> <esri4185> : Madeira 1936
-<BR> <esri4188> : OSNI 1952
-<BR> <esri4189> : REGVEN
-<BR> <esri4190> : POSGAR 98
-<BR> <esri4191> : Albanian 1987
-<BR> <esri4192> : Douala 1948
-<BR> <esri4193> : Manoca 1962
-<BR> <esri4194> : Qornoq 1927
-<BR> <esri4195> : Scoresbysund 1952
-<BR> <esri4196> : Ammassalik 1958
-<BR> <esri4197> : Garoua
-<BR> <esri4198> : Kousseri
-<BR> <esri4199> : Egypt 1930
-<BR> <esri4200> : Pulkovo 1995
-<BR> <esri4201> : Adindan
-<BR> <esri4202> : AGD66
-<BR> <esri4203> : AGD84
-<BR> <esri4204> : Ain el Abd
-<BR> <esri4205> : Afgooye
-<BR> <esri4206> : Agadez
-<BR> <esri4207> : Lisbon
-<BR> <esri4208> : Aratu
-<BR> <esri4209> : Arc 1950
-<BR> <esri4210> : Arc 1960
-<BR> <esri4211> : Batavia
-<BR> <esri4212> : Barbados 1938
-<BR> <esri4213> : Beduaram
-<BR> <esri4214> : Beijing 1954
-<BR> <esri4215> : Belge 1950
-<BR> <esri4216> : Bermuda 1957
-<BR> <esri4218> : Bogota 1975
-<BR> <esri4219> : Bukit Rimpah
-<BR> <esri4220> : Camacupa
-<BR> <esri4221> : Campo Inchauspe
-<BR> <esri4222> : Cape
-<BR> <esri4223> : Carthage
-<BR> <esri4224> : Chua
-<BR> <esri4225> : Corrego Alegre
-<BR> <esri4226> : Cote d'Ivoire
-<BR> <esri4227> : Deir ez Zor
-<BR> <esri4228> : Douala
-<BR> <esri4229> : Egypt 1907
-<BR> <esri4230> : ED50
-<BR> <esri4231> : ED87
-<BR> <esri4232> : Fahud
-<BR> <esri4233> : Gandajika 1970
-<BR> <esri4234> : Garoua
-<BR> <esri4235> : Guyane Francaise
-<BR> <esri4236> : Hu Tzu Shan
-<BR> <esri4237> : HD72
-<BR> <esri4238> : ID74
-<BR> <esri4239> : Indian 1954
-<BR> <esri4240> : Indian 1975
-<BR> <esri4241> : Jamaica 1875
-<BR> <esri4242> : JAD69
-<BR> <esri4243> : Kalianpur 1880
-<BR> <esri4244> : Kandawala
-<BR> <esri4245> : Kertau
-<BR> <esri4246> : KOC
-<BR> <esri4247> : La Canoa
-<BR> <esri4248> : PSAD56
-<BR> <esri4249> : Lake
-<BR> <esri4250> : Leigon
-<BR> <esri4251> : Liberia 1964
-<BR> <esri4252> : Lome
-<BR> <esri4253> : Luzon 1911
-<BR> <esri4254> : Hito XVIII 1963
-<BR> <esri4255> : Herat North
-<BR> <esri4256> : Mahe 1971
-<BR> <esri4257> : Makassar
-<BR> <esri4258> : ETRS89
-<BR> <esri4259> : Malongo 1987
-<BR> <esri4260> : Manoca
-<BR> <esri4261> : Merchich
-<BR> <esri4262> : Massawa
-<BR> <esri4263> : Minna
-<BR> <esri4264> : Mhast
-<BR> <esri4265> : Monte Mario
-<BR> <esri4266> : M'poraloko
-<BR> <esri4267> : NAD27
-<BR> <esri4268> : NAD27 Michigan
-<BR> <esri4269> : NAD83
-<BR> <esri4270> : Nahrwan 1967
-<BR> <esri4271> : Naparima 1972
-<BR> <esri4272> : NZGD49
-<BR> <esri4273> : NGO 1948
-<BR> <esri4274> : Datum 73
-<BR> <esri4275> : NTF
-<BR> <esri4276> : NSWC 9Z-2
-<BR> <esri4277> : OSGB 1936
-<BR> <esri4278> : OSGB70
-<BR> <esri4279> : OS(SN)80
-<BR> <esri4280> : Padang
-<BR> <esri4281> : Palestine 1923
-<BR> <esri4282> : Pointe Noire
-<BR> <esri4283> : GDA94
-<BR> <esri4284> : Pulkovo 1942
-<BR> <esri4285> : Qatar 1974
-<BR> <esri4286> : Qatar 1948
-<BR> <esri4287> : Qornoq
-<BR> <esri4288> : Loma Quintana
-<BR> <esri4289> : Amersfoort
-<BR> <esri4291> : SAD69
-<BR> <esri4292> : Sapper Hill 1943
-<BR> <esri4293> : Schwarzeck
-<BR> <esri4294> : Segora
-<BR> <esri4295> : Serindung
-<BR> <esri4296> : Sudan
-<BR> <esri4297> : Tananarive
-<BR> <esri4298> : Timbalai 1948
-<BR> <esri4299> : TM65
-<BR> <esri4300> : TM75
-<BR> <esri4301> : Tokyo
-<BR> <esri4302> : Trinidad 1903
-<BR> <esri4303> : TC(1948)
-<BR> <esri4304> : Voirol 1875
-<BR> <esri4306> : Bern 1938
-<BR> <esri4307> : Nord Sahara 1959
-<BR> <esri4308> : RT38
-<BR> <esri4309> : Yacare
-<BR> <esri4310> : Yoff
-<BR> <esri4311> : Zanderij
-<BR> <esri4312> : MGI
-<BR> <esri4313> : Belge 1972
-<BR> <esri4314> : DHDN
-<BR> <esri4315> : Conakry 1905
-<BR> <esri4316> : Dealul Piscului 1933
-<BR> <esri4317> : Dealul Piscului 1970
-<BR> <esri4318> : NGN
-<BR> <esri4319> : KUDAMS
-<BR> <esri4322> : WGS 72
-<BR> <esri4324> : WGS 72BE
-<BR> <esri4326> : WGS 84
-<BR> <esri4600> : Anguilla 1957
-<BR> <esri4601> : Antigua 1943
-<BR> <esri4602> : Dominica 1945
-<BR> <esri4603> : Grenada 1953
-<BR> <esri4604> : Montserrat 1958
-<BR> <esri4605> : St. Kitts 1955
-<BR> <esri4606> : St. Lucia 1955
-<BR> <esri4607> : St. Vincent 1945
-<BR> <esri4608> : NAD27(76)
-<BR> <esri4609> : NAD27(CGQ77)
-<BR> <esri4610> : Xian 1980
-<BR> <esri4611> : Hong Kong 1980
-<BR> <esri4612> : JGD2000
-<BR> <esri4613> : Segara
-<BR> <esri4614> : QND95
-<BR> <esri4615> : Porto Santo
-<BR> <esri4616> : Selvagem Grande
-<BR> <esri4617> : NAD83(CSRS)
-<BR> <esri4801> : Bern 1898 (Bern)
-<BR> <esri4802> : Bogota 1975 (Bogota)
-<BR> <esri4803> : Lisbon (Lisbon)
-<BR> <esri4804> : Makassar (Jakarta)
-<BR> <esri4805> : MGI (Ferro)
-<BR> <esri4806> : Monte Mario (Rome)
-<BR> <esri4807> : NTF (Paris)
-<BR> <esri4808> : Padang (Jakarta)
-<BR> <esri4809> : Belge 1950 (Brussels)
-<BR> <esri4810> : Tananarive (Paris)
-<BR> <esri4811> : Voirol 1875 (Paris)
-<BR> <esri4813> : Batavia (Jakarta)
-<BR> <esri4814> : RT38 (Stockholm)
-<BR> <esri4815> : Greek (Athens)
-<BR> <esri4816> : Carthage (Paris)
-<BR> <esri4817> : NGO 1948 (Oslo)
-<BR> <esri4818> : S-JTSK (Ferro)
-<BR> <esri4819> : Nord Sahara 1959 (Paris)
-<BR> <esri4820> : Segara (Jakarta)
-<BR> <esri4901> : ATF (Paris)
-<BR> <esri4902> : NDG (Paris)
-<BR> <esri4903> : Madrid 1870 (Madrid)
-<BR> <esri4904> : Lisbon 1890 (Lisbon)
-<BR> <esri20004> : Pulkovo 1995 / Gauss-Kruger zone 4
-<BR> <esri20005> : Pulkovo 1995 / Gauss-Kruger zone 5
-<BR> <esri20006> : Pulkovo 1995 / Gauss-Kruger zone 6
-<BR> <esri20007> : Pulkovo 1995 / Gauss-Kruger zone 7
-<BR> <esri20008> : Pulkovo 1995 / Gauss-Kruger zone 8
-<BR> <esri20009> : Pulkovo 1995 / Gauss-Kruger zone 9
-<BR> <esri20010> : Pulkovo 1995 / Gauss-Kruger zone 10
-<BR> <esri20011> : Pulkovo 1995 / Gauss-Kruger zone 11
-<BR> <esri20012> : Pulkovo 1995 / Gauss-Kruger zone 12
-<BR> <esri20013> : Pulkovo 1995 / Gauss-Kruger zone 13
-<BR> <esri20014> : Pulkovo 1995 / Gauss-Kruger zone 14
-<BR> <esri20015> : Pulkovo 1995 / Gauss-Kruger zone 15
-<BR> <esri20016> : Pulkovo 1995 / Gauss-Kruger zone 16
-<BR> <esri20017> : Pulkovo 1995 / Gauss-Kruger zone 17
-<BR> <esri20018> : Pulkovo 1995 / Gauss-Kruger zone 18
-<BR> <esri20019> : Pulkovo 1995 / Gauss-Kruger zone 19
-<BR> <esri20020> : Pulkovo 1995 / Gauss-Kruger zone 20
-<BR> <esri20021> : Pulkovo 1995 / Gauss-Kruger zone 21
-<BR> <esri20022> : Pulkovo 1995 / Gauss-Kruger zone 22
-<BR> <esri20023> : Pulkovo 1995 / Gauss-Kruger zone 23
-<BR> <esri20024> : Pulkovo 1995 / Gauss-Kruger zone 24
-<BR> <esri20025> : Pulkovo 1995 / Gauss-Kruger zone 25
-<BR> <esri20026> : Pulkovo 1995 / Gauss-Kruger zone 26
-<BR> <esri20027> : Pulkovo 1995 / Gauss-Kruger zone 27
-<BR> <esri20028> : Pulkovo 1995 / Gauss-Kruger zone 28
-<BR> <esri20029> : Pulkovo 1995 / Gauss-Kruger zone 29
-<BR> <esri20030> : Pulkovo 1995 / Gauss-Kruger zone 30
-<BR> <esri20031> : Pulkovo 1995 / Gauss-Kruger zone 31
-<BR> <esri20032> : Pulkovo 1995 / Gauss-Kruger zone 32
-<BR> <esri20064> : Pulkovo 1995 / Gauss-Kruger 4N
-<BR> <esri20065> : Pulkovo 1995 / Gauss-Kruger 5N
-<BR> <esri20066> : Pulkovo 1995 / Gauss-Kruger 6N
-<BR> <esri20067> : Pulkovo 1995 / Gauss-Kruger 7N
-<BR> <esri20068> : Pulkovo 1995 / Gauss-Kruger 8N
-<BR> <esri20069> : Pulkovo 1995 / Gauss-Kruger 9N
-<BR> <esri20070> : Pulkovo 1995 / Gauss-Kruger 10N
-<BR> <esri20071> : Pulkovo 1995 / Gauss-Kruger 11N
-<BR> <esri20072> : Pulkovo 1995 / Gauss-Kruger 12N
-<BR> <esri20073> : Pulkovo 1995 / Gauss-Kruger 13N
-<BR> <esri20074> : Pulkovo 1995 / Gauss-Kruger 14N
-<BR> <esri20075> : Pulkovo 1995 / Gauss-Kruger 15N
-<BR> <esri20076> : Pulkovo 1995 / Gauss-Kruger 16N
-<BR> <esri20077> : Pulkovo 1995 / Gauss-Kruger 17N
-<BR> <esri20078> : Pulkovo 1995 / Gauss-Kruger 18N
-<BR> <esri20079> : Pulkovo 1995 / Gauss-Kruger 19N
-<BR> <esri20080> : Pulkovo 1995 / Gauss-Kruger 20N
-<BR> <esri20081> : Pulkovo 1995 / Gauss-Kruger 21N
-<BR> <esri20082> : Pulkovo 1995 / Gauss-Kruger 22N
-<BR> <esri20083> : Pulkovo 1995 / Gauss-Kruger 23N
-<BR> <esri20084> : Pulkovo 1995 / Gauss-Kruger 24N
-<BR> <esri20085> : Pulkovo 1995 / Gauss-Kruger 25N
-<BR> <esri20086> : Pulkovo 1995 / Gauss-Kruger 26N
-<BR> <esri20087> : Pulkovo 1995 / Gauss-Kruger 27N
-<BR> <esri20088> : Pulkovo 1995 / Gauss-Kruger 28N
-<BR> <esri20089> : Pulkovo 1995 / Gauss-Kruger 29N
-<BR> <esri20090> : Pulkovo 1995 / Gauss-Kruger 30N
-<BR> <esri20091> : Pulkovo 1995 / Gauss-Kruger 31N
-<BR> <esri20092> : Pulkovo 1995 / Gauss-Kruger 32N
-<BR> <esri20137> : Adindan / UTM zone 37N
-<BR> <esri20138> : Adindan / UTM zone 38N
-<BR> <esri20248> : AGD66 / AMG zone 48
-<BR> <esri20249> : AGD66 / AMG zone 49
-<BR> <esri20250> : AGD66 / AMG zone 50
-<BR> <esri20251> : AGD66 / AMG zone 51
-<BR> <esri20252> : AGD66 / AMG zone 52
-<BR> <esri20253> : AGD66 / AMG zone 53
-<BR> <esri20254> : AGD66 / AMG zone 54
-<BR> <esri20255> : AGD66 / AMG zone 55
-<BR> <esri20256> : AGD66 / AMG zone 56
-<BR> <esri20257> : AGD66 / AMG zone 57
-<BR> <esri20258> : AGD66 / AMG zone 58
-<BR> <esri20348> : AGD84 / AMG zone 48
-<BR> <esri20349> : AGD84 / AMG zone 49
-<BR> <esri20350> : AGD84 / AMG zone 50
-<BR> <esri20351> : AGD84 / AMG zone 51
-<BR> <esri20352> : AGD84 / AMG zone 52
-<BR> <esri20353> : AGD84 / AMG zone 53
-<BR> <esri20354> : AGD84 / AMG zone 54
-<BR> <esri20355> : AGD84 / AMG zone 55
-<BR> <esri20356> : AGD84 / AMG zone 56
-<BR> <esri20357> : AGD84 / AMG zone 57
-<BR> <esri20358> : AGD84 / AMG zone 58
-<BR> <esri20437> : Ain el Abd / UTM zone 37N
-<BR> <esri20438> : Ain el Abd / UTM zone 38N
-<BR> <esri20439> : Ain el Abd / UTM zone 39N
-<BR> <esri20499> : Ain el Abd / Bahrain Grid
-<BR> <esri20538> : Afgooye / UTM zone 38N
-<BR> <esri20539> : Afgooye / UTM zone 39N
-<BR> <esri20790> : Lisbon (Lisbon)/Portuguese National Grid
-<BR> <esri20791> : Lisbon (Lisbon)/Portuguese Grid
-<BR> <esri20822> : Aratu / UTM zone 22S
-<BR> <esri20823> : Aratu / UTM zone 23S
-<BR> <esri20824> : Aratu / UTM zone 24S
-<BR> <esri20934> : Arc 1950 / UTM zone 34S
-<BR> <esri20935> : Arc 1950 / UTM zone 35S
-<BR> <esri20936> : Arc 1950 / UTM zone 36S
-<BR> <esri21035> : Arc 1960 / UTM zone 35S
-<BR> <esri21036> : Arc 1960 / UTM zone 36S
-<BR> <esri21037> : Arc 1960 / UTM zone 37S
-<BR> <esri21095> : Arc 1960 / UTM zone 35N
-<BR> <esri21096> : Arc 1960 / UTM zone 36N
-<BR> <esri21097> : Arc 1960 / UTM zone 37N
-<BR> <esri21100> : Batavia (Jakarta) / NEIEZ
-<BR> <esri21148> : Batavia / UTM zone 48S
-<BR> <esri21149> : Batavia / UTM zone 49S
-<BR> <esri21150> : Batavia / UTM zone 50S
-<BR> <esri21291> : Barbados 1938 / British West Indies Grid
-<BR> <esri21292> : Barbados 1938 / Barbados National Grid
-<BR> <esri21413> : Beijing 1954 / Gauss-Kruger zone 13
-<BR> <esri21414> : Beijing 1954 / Gauss-Kruger zone 14
-<BR> <esri21415> : Beijing 1954 / Gauss-Kruger zone 15
-<BR> <esri21416> : Beijing 1954 / Gauss-Kruger zone 16
-<BR> <esri21417> : Beijing 1954 / Gauss-Kruger zone 17
-<BR> <esri21418> : Beijing 1954 / Gauss-Kruger zone 18
-<BR> <esri21419> : Beijing 1954 / Gauss-Kruger zone 19
-<BR> <esri21420> : Beijing 1954 / Gauss-Kruger zone 20
-<BR> <esri21421> : Beijing 1954 / Gauss-Kruger zone 21
-<BR> <esri21422> : Beijing 1954 / Gauss-Kruger zone 22
-<BR> <esri21423> : Beijing 1954 / Gauss-Kruger zone 23
-<BR> <esri21453> : Beijing 1954 / Gauss-Kruger CM 75E
-<BR> <esri21454> : Beijing 1954 / Gauss-Kruger CM 81E
-<BR> <esri21455> : Beijing 1954 / Gauss-Kruger CM 87E
-<BR> <esri21456> : Beijing 1954 / Gauss-Kruger CM 93E
-<BR> <esri21457> : Beijing 1954 / Gauss-Kruger CM 99E
-<BR> <esri21458> : Beijing 1954 / Gauss-Kruger CM 105E
-<BR> <esri21459> : Beijing 1954 / Gauss-Kruger CM 111E
-<BR> <esri21460> : Beijing 1954 / Gauss-Kruger CM 117E
-<BR> <esri21461> : Beijing 1954 / Gauss-Kruger CM 123E
-<BR> <esri21462> : Beijing 1954 / Gauss-Kruger CM 129E
-<BR> <esri21463> : Beijing 1954 / Gauss-Kruger CM 135E
-<BR> <esri21473> : Beijing 1954 / Gauss-Kruger 13N
-<BR> <esri21474> : Beijing 1954 / Gauss-Kruger 14N
-<BR> <esri21475> : Beijing 1954 / Gauss-Kruger 15N
-<BR> <esri21476> : Beijing 1954 / Gauss-Kruger 16N
-<BR> <esri21477> : Beijing 1954 / Gauss-Kruger 17N
-<BR> <esri21478> : Beijing 1954 / Gauss-Kruger 18N
-<BR> <esri21479> : Beijing 1954 / Gauss-Kruger 19N
-<BR> <esri21480> : Beijing 1954 / Gauss-Kruger 20N
-<BR> <esri21481> : Beijing 1954 / Gauss-Kruger 21N
-<BR> <esri21482> : Beijing 1954 / Gauss-Kruger 22N
-<BR> <esri21483> : Beijing 1954 / Gauss-Kruger 23N
-<BR> <esri21500> : Belge 1950 (Brussels) / Belge Lambert 50
-<BR> <esri21780> : Bern 1898 (Bern) / LV03C
-<BR> <esri21781> : CH1903 / LV03
-<BR> <esri21817> : Bogota 1975 / UTM zone 17N
-<BR> <esri21818> : Bogota 1975 / UTM zone 18N
-<BR> <esri21891> : Bogota 1975 / Colombia West zone
-<BR> <esri21892> : Bogota 1975 / Colombia Bogota zone
-<BR> <esri21893> : Bogota 1975 / Colombia East Central zone
-<BR> <esri21894> : Bogota 1975 / Colombia East
-<BR> <esri22032> : Camacupa / UTM zone 32S
-<BR> <esri22033> : Camacupa / UTM zone 33S
-<BR> <esri22091> : Camacupa / TM 11.30 SE
-<BR> <esri22092> : Camacupa / TM 12 SE
-<BR> <esri22191> : Campo Inchauspe / Argentina 1
-<BR> <esri22192> : Campo Inchauspe / Argentina 2
-<BR> <esri22193> : Campo Inchauspe / Argentina 3
-<BR> <esri22194> : Campo Inchauspe / Argentina 4
-<BR> <esri22195> : Campo Inchauspe / Argentina 5
-<BR> <esri22196> : Campo Inchauspe / Argentina 6
-<BR> <esri22197> : Campo Inchauspe / Argentina 7
-<BR> <esri22234> : Cape / UTM zone 34S
-<BR> <esri22235> : Cape / UTM zone 35S
-<BR> <esri22236> : Cape / UTM zone 36S
-<BR> <esri22332> : Carthage / UTM zone 32N
-<BR> <esri22391> : Carthage / Nord Tunisie
-<BR> <esri22392> : Carthage / Sud Tunisie
-<BR> <esri22523> : Corrego Alegre / UTM zone 23S
-<BR> <esri22524> : Corrego Alegre / UTM zone 24S
-<BR> <esri22700> : Deir ez Zor / Levant Zone
-<BR> <esri22770> : Deir ez Zor / Syria Lambert
-<BR> <esri22780> : Deir ez Zor / Levant Stereographic
-<BR> <esri22832> : Douala / UTM zone 32N
-<BR> <esri22991> : Egypt 1907 / Blue Belt
-<BR> <esri22992> : Egypt 1907 / Red Belt
-<BR> <esri22993> : Egypt 1907 / Purple Belt
-<BR> <esri22994> : Egypt 1907 / Extended Purple Belt
-<BR> <esri23028> : ED50 / UTM zone 28N
-<BR> <esri23029> : ED50 / UTM zone 29N
-<BR> <esri23030> : ED50 / UTM zone 30N
-<BR> <esri23031> : ED50 / UTM zone 31N
-<BR> <esri23032> : ED50 / UTM zone 32N
-<BR> <esri23033> : ED50 / UTM zone 33N
-<BR> <esri23034> : ED50 / UTM zone 34N
-<BR> <esri23035> : ED50 / UTM zone 35N
-<BR> <esri23036> : ED50 / UTM zone 36N
-<BR> <esri23037> : ED50 / UTM zone 37N
-<BR> <esri23038> : ED50 / UTM zone 38N
-<BR> <esri23090> : ED50 / TM 0 N
-<BR> <esri23095> : ED50 / TM 5 NE
-<BR> <esri23239> : Fahud / UTM zone 39N
-<BR> <esri23240> : Fahud / UTM zone 40N
-<BR> <esri23433> : Garoua / UTM zone 33N
-<BR> <esri23700> : HD72 / EOV
-<BR> <esri23846> : ID74 / UTM zone 46N
-<BR> <esri23847> : ID74 / UTM zone 47N
-<BR> <esri23848> : ID74 / UTM zone 48N
-<BR> <esri23849> : ID74 / UTM zone 49N
-<BR> <esri23850> : ID74 / UTM zone 50N
-<BR> <esri23851> : ID74 / UTM zone 51N
-<BR> <esri23852> : ID74 / UTM zone 52N
-<BR> <esri23853> : ID74 / UTM zone 53N
-<BR> <esri23886> : ID74 / UTM zone 46S
-<BR> <esri23887> : ID74 / UTM zone 47S
-<BR> <esri23888> : ID74 / UTM zone 48S
-<BR> <esri23889> : ID74 / UTM zone 49S
-<BR> <esri23890> : ID74 / UTM zone 50S
-<BR> <esri23891> : ID74 / UTM zone 51S
-<BR> <esri23892> : ID74 / UTM zone 52S
-<BR> <esri23893> : ID74 / UTM zone 53S
-<BR> <esri23894> : ID74 / UTM zone 54S
-<BR> <esri23946> : Indian 1954 / UTM zone 46N
-<BR> <esri23947> : Indian 1954 / UTM zone 47N
-<BR> <esri23948> : Indian 1954 / UTM zone 48N
-<BR> <esri24047> : Indian 1975 / UTM zone 47N
-<BR> <esri24048> : Indian 1975 / UTM zone 48N
-<BR> <esri24100> : Jamaica 1875 / Jamaica (Old Grid)
-<BR> <esri24200> : JAD69 / Jamaica National Grid
-<BR> <esri24305> : Kalianpur 1937 / UTM zone 45N
-<BR> <esri24306> : Kalianpur 1937 / UTM zone 46N
-<BR> <esri24311> : Kalianpur 1962 / UTM zone 41N
-<BR> <esri24312> : Kalianpur 1962 / UTM zone 42N
-<BR> <esri24313> : Kalianpur 1962 / UTM zone 43N
-<BR> <esri24342> : Kalianpur 1975 / UTM zone 42N
-<BR> <esri24343> : Kalianpur 1975 / UTM zone 43N
-<BR> <esri24344> : Kalianpur 1975 / UTM zone 44N
-<BR> <esri24345> : Kalianpur 1975 / UTM zone 45N
-<BR> <esri24346> : Kalianpur 1975 / UTM zone 46N
-<BR> <esri24347> : Kalianpur 1975 / UTM zone 47N
-<BR> <esri24370> : Kalianpur 1880 / India zone 0
-<BR> <esri24371> : Kalianpur 1880 / India zone I
-<BR> <esri24372> : Kalianpur 1880 / India zone IIa
-<BR> <esri24373> : Kalianpur 1880 / India zone III
-<BR> <esri24374> : Kalianpur 1880 / India zone IV
-<BR> <esri24375> : Kalianpur 1937 / India zone IIb
-<BR> <esri24376> : Kalianpur 1962 / India zone I
-<BR> <esri24377> : Kalianpur 1962 / India zone IIa
-<BR> <esri24378> : Kalianpur 1975 / India zone I
-<BR> <esri24379> : Kalianpur 1975 / India zone IIa
-<BR> <esri24380> : Kalianpur 1975 / India zone IIb
-<BR> <esri24381> : Kalianpur 1975 / India zone III
-<BR> <esri24382> : Kalianpur 1880 / India zone IIb
-<BR> <esri24383> : Kalianpur 1975 / India zone IV
-<BR> <esri24500> : Kertau / Singapore Grid
-<BR> <esri24547> : Kertau / UTM zone 47N
-<BR> <esri24548> : Kertau / UTM zone 48N
-<BR> <esri24571> : Kertau / R.S.O. Malaya (ch)
-<BR> <esri24600> : KOC Lambert
-<BR> <esri24718> : La Canoa / UTM zone 18N
-<BR> <esri24719> : La Canoa / UTM zone 19N
-<BR> <esri24720> : La Canoa / UTM zone 20N
-<BR> <esri24818> : PSAD56 / UTM zone 18N
-<BR> <esri24819> : PSAD56 / UTM zone 19N
-<BR> <esri24820> : PSAD56 / UTM zone 20N
-<BR> <esri24821> : PSAD56 / UTM zone 21N
-<BR> <esri24877> : PSAD56 / UTM zone 17S
-<BR> <esri24878> : PSAD56 / UTM zone 18S
-<BR> <esri24879> : PSAD56 / UTM zone 19S
-<BR> <esri24880> : PSAD56 / UTM zone 20S
-<BR> <esri24882> : PSAD56 / UTM zone 22S
-<BR> <esri24891> : PSAD56 / Peru west zone
-<BR> <esri24892> : PSAD56 / Peru central zone
-<BR> <esri24893> : PSAD56 / Peru east zone
-<BR> <esri25000> : Leigon / Ghana Metre Grid
-<BR> <esri25231> : Lome / UTM zone 31N
-<BR> <esri25391> : Luzon 1911 / Philippines zone I
-<BR> <esri25392> : Luzon 1911 / Philippines zone II
-<BR> <esri25393> : Luzon 1911 / Philippines zone III
-<BR> <esri25394> : Luzon 1911 / Philippines zone IV
-<BR> <esri25395> : Luzon 1911 / Philippines zone V
-<BR> <esri25700> : Makassar (Jakarta) / NEIEZ
-<BR> <esri25828> : ETRS89 / UTM zone 28N
-<BR> <esri25829> : ETRS89 / UTM zone 29N
-<BR> <esri25830> : ETRS89 / UTM zone 30N
-<BR> <esri25831> : ETRS89 / UTM zone 31N
-<BR> <esri25832> : ETRS89 / UTM zone 32N
-<BR> <esri25833> : ETRS89 / UTM zone 33N
-<BR> <esri25834> : ETRS89 / UTM zone 34N
-<BR> <esri25835> : ETRS89 / UTM zone 35N
-<BR> <esri25836> : ETRS89 / UTM zone 36N
-<BR> <esri25837> : ETRS89 / UTM zone 37N
-<BR> <esri25838> : ETRS89 / UTM zone 38N
-<BR> <esri25884> : ETRS89 / TM Baltic93
-<BR> <esri25932> : Malongo 1987 / UTM zone 32S
-<BR> <esri26191> : Merchich / Nord Maroc
-<BR> <esri26192> : Merchich / Sud Maroc
-<BR> <esri26193> : Merchich / Sahara
-<BR> <esri26237> : Massawa / UTM zone 37N
-<BR> <esri26331> : Minna / UTM zone 31N
-<BR> <esri26332> : Minna / UTM zone 32N
-<BR> <esri26391> : Minna / Nigeria West Belt
-<BR> <esri26392> : Minna / Nigeria Mid Belt
-<BR> <esri26393> : Minna / Nigeria East Belt
-<BR> <esri26432> : Mhast / UTM zone 32S
-<BR> <esri26591> : Monte Mario (Rome) / Italy zone 1
-<BR> <esri26592> : Monte Mario (Rome) / Italy zone 2
-<BR> <esri26632> : M'poraloko / UTM zone 32N
-<BR> <esri26692> : M'poraloko / UTM zone 32S
-<BR> <esri26703> : NAD27 / UTM zone 3N
-<BR> <esri26704> : NAD27 / UTM zone 4N
-<BR> <esri26705> : NAD27 / UTM zone 5N
-<BR> <esri26706> : NAD27 / UTM zone 6N
-<BR> <esri26707> : NAD27 / UTM zone 7N
-<BR> <esri26708> : NAD27 / UTM zone 8N
-<BR> <esri26709> : NAD27 / UTM zone 9N
-<BR> <esri26710> : NAD27 / UTM zone 10N
-<BR> <esri26711> : NAD27 / UTM zone 11N
-<BR> <esri26712> : NAD27 / UTM zone 12N
-<BR> <esri26713> : NAD27 / UTM zone 13N
-<BR> <esri26714> : NAD27 / UTM zone 14N
-<BR> <esri26715> : NAD27 / UTM zone 15N
-<BR> <esri26716> : NAD27 / UTM zone 16N
-<BR> <esri26717> : NAD27 / UTM zone 17N
-<BR> <esri26718> : NAD27 / UTM zone 18N
-<BR> <esri26719> : NAD27 / UTM zone 19N
-<BR> <esri26720> : NAD27 / UTM zone 20N
-<BR> <esri26721> : NAD27 / UTM zone 21N
-<BR> <esri26722> : NAD27 / UTM zone 22N
-<BR> <esri26729> : NAD27 / Alabama East
-<BR> <esri26730> : NAD27 / Alabama West
-<BR> <esri26731> : NAD27 / Alaska zone 1
-<BR> <esri26732> : NAD27 / Alaska zone 2
-<BR> <esri26733> : NAD27 / Alaska zone 3
-<BR> <esri26734> : NAD27 / Alaska zone 4
-<BR> <esri26735> : NAD27 / Alaska zone 5
-<BR> <esri26736> : NAD27 / Alaska zone 6
-<BR> <esri26737> : NAD27 / Alaska zone 7
-<BR> <esri26738> : NAD27 / Alaska zone 8
-<BR> <esri26739> : NAD27 / Alaska zone 9
-<BR> <esri26740> : NAD27 / Alaska zone 10
-<BR> <esri26741> : NAD27 / California zone I
-<BR> <esri26742> : NAD27 / California zone II
-<BR> <esri26743> : NAD27 / California zone III
-<BR> <esri26744> : NAD27 / California zone IV
-<BR> <esri26745> : NAD27 / California zone V
-<BR> <esri26746> : NAD27 / California zone VI
-<BR> <esri26747> : NAD27 / California zone VII
-<BR> <esri26748> : NAD27 / Arizona East
-<BR> <esri26749> : NAD27 / Arizona Central
-<BR> <esri26750> : NAD27 / Arizona West
-<BR> <esri26751> : NAD27 / Arkansas North
-<BR> <esri26752> : NAD27 / Arkansas South
-<BR> <esri26753> : NAD27 / Colorado North
-<BR> <esri26754> : NAD27 / Colorado Central
-<BR> <esri26755> : NAD27 / Colorado South
-<BR> <esri26756> : NAD27 / Connecticut
-<BR> <esri26757> : NAD27 / Delaware
-<BR> <esri26758> : NAD27 / Florida East
-<BR> <esri26759> : NAD27 / Florida West
-<BR> <esri26760> : NAD27 / Florida North
-<BR> <esri26766> : NAD27 / Georgia East
-<BR> <esri26767> : NAD27 / Georgia West
-<BR> <esri26768> : NAD27 / Idaho East
-<BR> <esri26769> : NAD27 / Idaho Central
-<BR> <esri26770> : NAD27 / Idaho West
-<BR> <esri26771> : NAD27 / Illinois East
-<BR> <esri26772> : NAD27 / Illinois West
-<BR> <esri26773> : NAD27 / Indiana East
-<BR> <esri26774> : NAD27 / Indiana West
-<BR> <esri26775> : NAD27 / Iowa North
-<BR> <esri26776> : NAD27 / Iowa South
-<BR> <esri26777> : NAD27 / Kansas North
-<BR> <esri26778> : NAD27 / Kansas South
-<BR> <esri26779> : NAD27 / Kentucky North
-<BR> <esri26780> : NAD27 / Kentucky South
-<BR> <esri26781> : NAD27 / Louisiana North
-<BR> <esri26782> : NAD27 / Louisiana South
-<BR> <esri26783> : NAD27 / Maine East
-<BR> <esri26784> : NAD27 / Maine West
-<BR> <esri26785> : NAD27 / Maryland
-<BR> <esri26786> : NAD27 / Massachusetts Mainland
-<BR> <esri26787> : NAD27 / Massachusetts Island
-<BR> <esri26791> : NAD27 / Minnesota North
-<BR> <esri26792> : NAD27 / Minnesota Central
-<BR> <esri26793> : NAD27 / Minnesota South
-<BR> <esri26794> : NAD27 / Mississippi East
-<BR> <esri26795> : NAD27 / Mississippi West
-<BR> <esri26796> : NAD27 / Missouri East
-<BR> <esri26797> : NAD27 / Missouri Central
-<BR> <esri26798> : NAD27 / Missouri West
-<BR> <esri26801> : NAD Michigan / Michigan East
-<BR> <esri26802> : NAD Michigan / Michigan Old Central
-<BR> <esri26803> : NAD Michigan / Michigan West
-<BR> <esri26811> : NAD Michigan / Michigan North
-<BR> <esri26812> : NAD Michigan / Michigan Central
-<BR> <esri26813> : NAD Michigan / Michigan South
-<BR> <esri26903> : NAD83 / UTM zone 3N
-<BR> <esri26904> : NAD83 / UTM zone 4N
-<BR> <esri26905> : NAD83 / UTM zone 5N
-<BR> <esri26906> : NAD83 / UTM zone 6N
-<BR> <esri26907> : NAD83 / UTM zone 7N
-<BR> <esri26908> : NAD83 / UTM zone 8N
-<BR> <esri26909> : NAD83 / UTM zone 9N
-<BR> <esri26910> : NAD83 / UTM zone 10N
-<BR> <esri26911> : NAD83 / UTM zone 11N
-<BR> <esri26912> : NAD83 / UTM zone 12N
-<BR> <esri26913> : NAD83 / UTM zone 13N
-<BR> <esri26914> : NAD83 / UTM zone 14N
-<BR> <esri26915> : NAD83 / UTM zone 15N
-<BR> <esri26916> : NAD83 / UTM zone 16N
-<BR> <esri26917> : NAD83 / UTM zone 17N
-<BR> <esri26918> : NAD83 / UTM zone 18N
-<BR> <esri26919> : NAD83 / UTM zone 19N
-<BR> <esri26920> : NAD83 / UTM zone 20N
-<BR> <esri26921> : NAD83 / UTM zone 21N
-<BR> <esri26922> : NAD83 / UTM zone 22N
-<BR> <esri26923> : NAD83 / UTM zone 23N
-<BR> <esri26929> : NAD83 / Alabama East
-<BR> <esri26930> : NAD83 / Alabama West
-<BR> <esri26931> : NAD83 / Alaska zone 1
-<BR> <esri26932> : NAD83 / Alaska zone 2
-<BR> <esri26933> : NAD83 / Alaska zone 3
-<BR> <esri26934> : NAD83 / Alaska zone 4
-<BR> <esri26935> : NAD83 / Alaska zone 5
-<BR> <esri26936> : NAD83 / Alaska zone 6
-<BR> <esri26937> : NAD83 / Alaska zone 7
-<BR> <esri26938> : NAD83 / Alaska zone 8
-<BR> <esri26939> : NAD83 / Alaska zone 9
-<BR> <esri26940> : NAD83 / Alaska zone 10
-<BR> <esri26941> : NAD83 / California zone 1
-<BR> <esri26942> : NAD83 / California zone 2
-<BR> <esri26943> : NAD83 / California zone 3
-<BR> <esri26944> : NAD83 / California zone 4
-<BR> <esri26945> : NAD83 / California zone 5
-<BR> <esri26946> : NAD83 / California zone 6
-<BR> <esri26948> : NAD83 / Arizona East
-<BR> <esri26949> : NAD83 / Arizona Central
-<BR> <esri26950> : NAD83 / Arizona West
-<BR> <esri26951> : NAD83 / Arkansas North
-<BR> <esri26952> : NAD83 / Arkansas South
-<BR> <esri26953> : NAD83 / Colorado North
-<BR> <esri26954> : NAD83 / Colorado Central
-<BR> <esri26955> : NAD83 / Colorado South
-<BR> <esri26956> : NAD83 / Connecticut
-<BR> <esri26957> : NAD83 / Delaware
-<BR> <esri26958> : NAD83 / Florida East
-<BR> <esri26959> : NAD83 / Florida West
-<BR> <esri26960> : NAD83 / Florida North
-<BR> <esri26961> : NAD83 / Hawaii zone 1
-<BR> <esri26962> : NAD83 / Hawaii zone 2
-<BR> <esri26963> : NAD83 / Hawaii zone 3
-<BR> <esri26964> : NAD83 / Hawaii zone 4
-<BR> <esri26965> : NAD83 / Hawaii zone 5
-<BR> <esri26966> : NAD83 / Georgia East
-<BR> <esri26967> : NAD83 / Georgia West
-<BR> <esri26968> : NAD83 / Idaho East
-<BR> <esri26969> : NAD83 / Idaho Central
-<BR> <esri26970> : NAD83 / Idaho West
-<BR> <esri26971> : NAD83 / Illinois East
-<BR> <esri26972> : NAD83 / Illinois West
-<BR> <esri26973> : NAD83 / Indiana East
-<BR> <esri26974> : NAD83 / Indiana West
-<BR> <esri26975> : NAD83 / Iowa North
-<BR> <esri26976> : NAD83 / Iowa South
-<BR> <esri26977> : NAD83 / Kansas North
-<BR> <esri26978> : NAD83 / Kansas South
-<BR> <esri26979> : NAD83 / Kentucky North
-<BR> <esri26980> : NAD83 / Kentucky South
-<BR> <esri26981> : NAD83 / Louisiana North
-<BR> <esri26982> : NAD83 / Louisiana South
-<BR> <esri26983> : NAD83 / Maine East
-<BR> <esri26984> : NAD83 / Maine West
-<BR> <esri26985> : NAD83 / Maryland
-<BR> <esri26986> : NAD83 / Massachusetts Mainland
-<BR> <esri26987> : NAD83 / Massachusetts Island
-<BR> <esri26988> : NAD83 / Michigan North
-<BR> <esri26989> : NAD83 / Michigan Central
-<BR> <esri26990> : NAD83 / Michigan South
-<BR> <esri26991> : NAD83 / Minnesota North
-<BR> <esri26992> : NAD83 / Minnesota Central
-<BR> <esri26993> : NAD83 / Minnesota South
-<BR> <esri26994> : NAD83 / Mississippi East
-<BR> <esri26995> : NAD83 / Mississippi West
-<BR> <esri26996> : NAD83 / Missouri East
-<BR> <esri26997> : NAD83 / Missouri Central
-<BR> <esri26998> : NAD83 / Missouri West
-<BR> <esri27038> : Nahrwan 1967 / UTM zone 38N
-<BR> <esri27039> : Nahrwan 1967 / UTM zone 39N
-<BR> <esri27040> : Nahrwan 1967 / UTM zone 40N
-<BR> <esri27120> : Naparima 1972 / UTM zone 20N
-<BR> <esri27200> : NZGD49 / New Zealand Map Grid
-<BR> <esri27205> : NZGD49 / Mount Eden Circuit
-<BR> <esri27206> : NZGD49 / Bay of Plenty Circuit
-<BR> <esri27207> : NZGD49 / Poverty Bay Circuit
-<BR> <esri27208> : NZGD49 / Hawkes Bay Circuit
-<BR> <esri27209> : NZGD49 / Taranaki Circuit
-<BR> <esri27210> : NZGD49 / Tuhirangi Circuit
-<BR> <esri27211> : NZGD49 / Wanganui Circuit
-<BR> <esri27212> : NZGD49 / Wairarapa Circuit
-<BR> <esri27213> : NZGD49 / Wellington Circuit
-<BR> <esri27214> : NZGD49 / Collingwood Circuit
-<BR> <esri27215> : NZGD49 / Nelson Circuit
-<BR> <esri27216> : NZGD49 / Karamea Circuit
-<BR> <esri27217> : NZGD49 / Buller Circuit
-<BR> <esri27218> : NZGD49 / Grey Circuit
-<BR> <esri27219> : NZGD49 / Amuri Circuit
-<BR> <esri27220> : NZGD49 / Marlborough Circuit
-<BR> <esri27221> : NZGD49 / Hokitika Circuit
-<BR> <esri27222> : NZGD49 / Okarito Circuit
-<BR> <esri27223> : NZGD49 / Jacksons Bay Circuit
-<BR> <esri27224> : NZGD49 / Mount Pleasant Circuit
-<BR> <esri27225> : NZGD49 / Gawler Circuit
-<BR> <esri27226> : NZGD49 / Timaru Circuit
-<BR> <esri27227> : NZGD49 / Lindis Peak Circuit
-<BR> <esri27228> : NZGD49 / Mount Nicholas Circuit
-<BR> <esri27229> : NZGD49 / Mount York Circuit
-<BR> <esri27230> : NZGD49 / Observation Point Circuit
-<BR> <esri27231> : NZGD49 / North Taieri Circuit
-<BR> <esri27232> : NZGD49 / Bluff Circuit
-<BR> <esri27258> : NZGD49 / UTM zone 58S
-<BR> <esri27259> : NZGD49 / UTM zone 59S
-<BR> <esri27260> : NZGD49 / UTM zone 60S
-<BR> <esri27291> : NZGD49 / North Island Grid
-<BR> <esri27292> : NZGD49 / South Island Grid
-<BR> <esri27391> : NGO 1948 (Oslo) / NGO zone I
-<BR> <esri27392> : NGO 1948 (Oslo) / NGO zone II
-<BR> <esri27393> : NGO 1948 (Oslo) / NGO zone III
-<BR> <esri27394> : NGO 1948 (Oslo) / NGO zone IV
-<BR> <esri27395> : NGO 1948 (Oslo) / NGO zone V
-<BR> <esri27396> : NGO 1948 (Oslo) / NGO zone VI
-<BR> <esri27397> : NGO 1948 (Oslo) / NGO zone VII
-<BR> <esri27398> : NGO 1948 (Oslo) / NGO zone VIII
-<BR> <esri27429> : Datum 73 / UTM zone 29N
-<BR> <esri27492> : Datum 73 / Modified Portuguese Grid
-<BR> <esri27500> : ATF (Paris) / Nord de Guerre
-<BR> <esri27561> : NTF (Paris) / Lambert Nord France
-<BR> <esri27562> : NTF (Paris) / Lambert Centre France
-<BR> <esri27563> : NTF (Paris) / Lambert Sud France
-<BR> <esri27564> : NTF (Paris) / Lambert Corse
-<BR> <esri27571> : NTF (Paris) / Lambert zone I
-<BR> <esri27572> : NTF (Paris) / Lambert zone II
-<BR> <esri27573> : NTF (Paris) / Lambert zone III
-<BR> <esri27574> : NTF (Paris) / Lambert zone IV
-<BR> <esri27581> : NTF (Paris) / France I
-<BR> <esri27582> : NTF (Paris) / France II
-<BR> <esri27583> : NTF (Paris) / France III
-<BR> <esri27584> : NTF (Paris) / France IV
-<BR> <esri27591> : NTF (Paris) / Nord France
-<BR> <esri27592> : NTF (Paris) / Centre France
-<BR> <esri27593> : NTF (Paris) / Sud France
-<BR> <esri27594> : NTF (Paris) / Corse
-<BR> <esri27700> : OSGB 1936 / British National Grid
-<BR> <esri28191> : Palestine 1923 / Palestine Grid
-<BR> <esri28192> : Palestine 1923 / Palestine Belt
-<BR> <esri28193> : Palestine 1923 / Israeli CS Grid
-<BR> <esri28232> : Pointe Noire / UTM zone 32S
-<BR> <esri28348> : GDA94 / MGA zone 48
-<BR> <esri28349> : GDA94 / MGA zone 49
-<BR> <esri28350> : GDA94 / MGA zone 50
-<BR> <esri28351> : GDA94 / MGA zone 51
-<BR> <esri28352> : GDA94 / MGA zone 52
-<BR> <esri28353> : GDA94 / MGA zone 53
-<BR> <esri28354> : GDA94 / MGA zone 54
-<BR> <esri28355> : GDA94 / MGA zone 55
-<BR> <esri28356> : GDA94 / MGA zone 56
-<BR> <esri28357> : GDA94 / MGA zone 57
-<BR> <esri28358> : GDA94 / MGA zone 58
-<BR> <esri28402> : Pulkovo 1942 / Gauss-Kruger zone 2
-<BR> <esri28403> : Pulkovo 1942 / Gauss-Kruger zone 3
-<BR> <esri28404> : Pulkovo 1942 / Gauss-Kruger zone 4
-<BR> <esri28405> : Pulkovo 1942 / Gauss-Kruger zone 5
-<BR> <esri28406> : Pulkovo 1942 / Gauss-Kruger zone 6
-<BR> <esri28407> : Pulkovo 1942 / Gauss-Kruger zone 7
-<BR> <esri28408> : Pulkovo 1942 / Gauss-Kruger zone 8
-<BR> <esri28409> : Pulkovo 1942 / Gauss-Kruger zone 9
-<BR> <esri28410> : Pulkovo 1942 / Gauss-Kruger zone 10
-<BR> <esri28411> : Pulkovo 1942 / Gauss-Kruger zone 11
-<BR> <esri28412> : Pulkovo 1942 / Gauss-Kruger zone 12
-<BR> <esri28413> : Pulkovo 1942 / Gauss-Kruger zone 13
-<BR> <esri28414> : Pulkovo 1942 / Gauss-Kruger zone 14
-<BR> <esri28415> : Pulkovo 1942 / Gauss-Kruger zone 15
-<BR> <esri28416> : Pulkovo 1942 / Gauss-Kruger zone 16
-<BR> <esri28417> : Pulkovo 1942 / Gauss-Kruger zone 17
-<BR> <esri28418> : Pulkovo 1942 / Gauss-Kruger zone 18
-<BR> <esri28419> : Pulkovo 1942 / Gauss-Kruger zone 19
-<BR> <esri28420> : Pulkovo 1942 / Gauss-Kruger zone 20
-<BR> <esri28421> : Pulkovo 1942 / Gauss-Kruger zone 21
-<BR> <esri28422> : Pulkovo 1942 / Gauss-Kruger zone 22
-<BR> <esri28423> : Pulkovo 1942 / Gauss-Kruger zone 23
-<BR> <esri28424> : Pulkovo 1942 / Gauss-Kruger zone 24
-<BR> <esri28425> : Pulkovo 1942 / Gauss-Kruger zone 25
-<BR> <esri28426> : Pulkovo 1942 / Gauss-Kruger zone 26
-<BR> <esri28427> : Pulkovo 1942 / Gauss-Kruger zone 27
-<BR> <esri28428> : Pulkovo 1942 / Gauss-Kruger zone 28
-<BR> <esri28429> : Pulkovo 1942 / Gauss-Kruger zone 29
-<BR> <esri28430> : Pulkovo 1942 / Gauss-Kruger zone 30
-<BR> <esri28431> : Pulkovo 1942 / Gauss-Kruger zone 31
-<BR> <esri28432> : Pulkovo 1942 / Gauss-Kruger zone 32
-<BR> <esri28462> : Pulkovo 1942 / Gauss-Kruger 2N
-<BR> <esri28463> : Pulkovo 1942 / Gauss-Kruger 3N
-<BR> <esri28464> : Pulkovo 1942 / Gauss-Kruger 4N
-<BR> <esri28465> : Pulkovo 1942 / Gauss-Kruger 5N
-<BR> <esri28466> : Pulkovo 1942 / Gauss-Kruger 6N
-<BR> <esri28467> : Pulkovo 1942 / Gauss-Kruger 7N
-<BR> <esri28468> : Pulkovo 1942 / Gauss-Kruger 8N
-<BR> <esri28469> : Pulkovo 1942 / Gauss-Kruger 9N
-<BR> <esri28470> : Pulkovo 1942 / Gauss-Kruger 10N
-<BR> <esri28471> : Pulkovo 1942 / Gauss-Kruger 11N
-<BR> <esri28472> : Pulkovo 1942 / Gauss-Kruger 12N
-<BR> <esri28473> : Pulkovo 1942 / Gauss-Kruger 13N
-<BR> <esri28474> : Pulkovo 1942 / Gauss-Kruger 14N
-<BR> <esri28475> : Pulkovo 1942 / Gauss-Kruger 15N
-<BR> <esri28476> : Pulkovo 1942 / Gauss-Kruger 16N
-<BR> <esri28477> : Pulkovo 1942 / Gauss-Kruger 17N
-<BR> <esri28478> : Pulkovo 1942 / Gauss-Kruger 18N
-<BR> <esri28479> : Pulkovo 1942 / Gauss-Kruger 19N
-<BR> <esri28480> : Pulkovo 1942 / Gauss-Kruger 20N
-<BR> <esri28481> : Pulkovo 1942 / Gauss-Kruger 21N
-<BR> <esri28482> : Pulkovo 1942 / Gauss-Kruger 22N
-<BR> <esri28483> : Pulkovo 1942 / Gauss-Kruger 23N
-<BR> <esri28484> : Pulkovo 1942 / Gauss-Kruger 24N
-<BR> <esri28485> : Pulkovo 1942 / Gauss-Kruger 25N
-<BR> <esri28486> : Pulkovo 1942 / Gauss-Kruger 26N
-<BR> <esri28487> : Pulkovo 1942 / Gauss-Kruger 27N
-<BR> <esri28488> : Pulkovo 1942 / Gauss-Kruger 28N
-<BR> <esri28489> : Pulkovo 1942 / Gauss-Kruger 29N
-<BR> <esri28490> : Pulkovo 1942 / Gauss-Kruger 30N
-<BR> <esri28491> : Pulkovo 1942 / Gauss-Kruger 31N
-<BR> <esri28492> : Pulkovo 1942 / Gauss-Kruger 32N
-<BR> <esri28600> : Qatar 1974 / Qatar National Grid
-<BR> <esri28991> : Amersfoort / RD Old
-<BR> <esri28992> : Amersfoort / RD New
-<BR> <esri29100> : SAD69 / Brazil Polyconic
-<BR> <esri29118> : SAD69 / UTM zone 18N
-<BR> <esri29119> : SAD69 / UTM zone 19N
-<BR> <esri29120> : SAD69 / UTM zone 20N
-<BR> <esri29121> : SAD69 / UTM zone 21N
-<BR> <esri29122> : SAD69 / UTM zone 22N
-<BR> <esri29177> : SAD69 / UTM zone 17S
-<BR> <esri29178> : SAD69 / UTM zone 18S
-<BR> <esri29179> : SAD69 / UTM zone 19S
-<BR> <esri29180> : SAD69 / UTM zone 20S
-<BR> <esri29181> : SAD69 / UTM zone 21S
-<BR> <esri29182> : SAD69 / UTM zone 22S
-<BR> <esri29183> : SAD69 / UTM zone 23S
-<BR> <esri29184> : SAD69 / UTM zone 24S
-<BR> <esri29185> : SAD69 / UTM zone 25S
-<BR> <esri29220> : Sapper Hill 1943 / UTM zone 20S
-<BR> <esri29221> : Sapper Hill 1943 / UTM zone 21S
-<BR> <esri29333> : Schwarzeck / UTM zone 33S
-<BR> <esri29635> : Sudan / UTM zone 35N
-<BR> <esri29636> : Sudan / UTM zone 36N
-<BR> <esri29700> : Tananarive (Paris) / Laborde Grid
-<BR> <esri29738> : Tananarive / UTM zone 38S
-<BR> <esri29739> : Tananarive / UTM zone 39S
-<BR> <esri29849> : Timbalai 1948 / UTM zone 49N
-<BR> <esri29850> : Timbalai 1948 / UTM zone 50N
-<BR> <esri29871> : Timbalai 1948 / R.S.O. Borneo (ch)
-<BR> <esri29872> : Timbalai 1948 / R.S.O. Borneo (ft)
-<BR> <esri29873> : Timbalai 1948 / R.S.O. Borneo (m)
-<BR> <esri29900> : TM65 / Irish National Grid
-<BR> <esri29901> : OSNI 1952 / Irish National Grid
-<BR> <esri29902> : TM65 / Irish Grid
-<BR> <esri29903> : TM75 / Irish Grid
-<BR> <esri30161> : Tokyo / Japan Plane Rectangular CS I
-<BR> <esri30162> : Tokyo / Japan Plane Rectangular CS II
-<BR> <esri30163> : Tokyo / Japan Plane Rectangular CS III
-<BR> <esri30164> : Tokyo / Japan Plane Rectangular CS IV
-<BR> <esri30165> : Tokyo / Japan Plane Rectangular CS V
-<BR> <esri30166> : Tokyo / Japan Plane Rectangular CS VI
-<BR> <esri30167> : Tokyo / Japan Plane Rectangular CS VII
-<BR> <esri30168> : Tokyo / Japan Plane Rectangular CS VIII
-<BR> <esri30169> : Tokyo / Japan Plane Rectangular CS IX
-<BR> <esri30170> : Tokyo / Japan Plane Rectangular CS X
-<BR> <esri30171> : Tokyo / Japan Plane Rectangular CS XI
-<BR> <esri30172> : Tokyo / Japan Plane Rectangular CS XII
-<BR> <esri30173> : Tokyo / Japan Plane Rectangular CS XIII
-<BR> <esri30174> : Tokyo / Japan Plane Rectangular CS XIV
-<BR> <esri30175> : Tokyo / Japan Plane Rectangular CS XV
-<BR> <esri30176> : Tokyo / Japan Plane Rectangular CS XVI
-<BR> <esri30177> : Tokyo / Japan Plane Rectangular CS XVII
-<BR> <esri30178> : Tokyo / Japan Plane Rectangular CS XVIII
-<BR> <esri30179> : Tokyo / Japan Plane Rectangular CS XIX
-<BR> <esri30200> : Trinidad 1903 / Trinidad Grid
-<BR> <esri30339> : TC(1948) / UTM zone 39N
-<BR> <esri30340> : TC(1948) / UTM zone 40N
-<BR> <esri30491> : Voirol 1875 / Nord Algerie (ancienne)
-<BR> <esri30492> : Voirol 1875 / Sud Algerie (ancienne)
-<BR> <esri30729> : Nord Sahara 1959 / UTM zone 29N
-<BR> <esri30730> : Nord Sahara 1959 / UTM zone 30N
-<BR> <esri30731> : Nord Sahara 1959 / UTM zone 31N
-<BR> <esri30732> : Nord Sahara 1959 / UTM zone 32N
-<BR> <esri30791> : Nord Sahara 1959 / Voirol Unifie Nord
-<BR> <esri30792> : Nord Sahara 1959 / Voirol Unifie Sud
-<BR> <esri30800> : RT38 2.5 gon W
-<BR> <esri31028> : Yoff / UTM zone 28N
-<BR> <esri31121> : Zanderij / UTM zone 21N
-<BR> <esri31154> : Zanderij / TM 54 NW
-<BR> <esri31170> : Zanderij / Suriname Old TM
-<BR> <esri31171> : Zanderij / Suriname TM
-<BR> <esri31265> : MGI / 3-degree Gauss zone 5
-<BR> <esri31266> : MGI / 3-degree Gauss zone 6
-<BR> <esri31267> : MGI / 3-degree Gauss zone 7
-<BR> <esri31268> : MGI / 3-degree Gauss zone 8
-<BR> <esri31275> : MGI / Balkans zone 5
-<BR> <esri31276> : MGI / Balkans zone 6
-<BR> <esri31277> : MGI / Balkans zone 7
-<BR> <esri31278> : MGI / Balkans zone 8
-<BR> <esri31279> : MGI / Balkans zone 8
-<BR> <esri31281> : MGI (Ferro) / Austria West Zone
-<BR> <esri31282> : MGI (Ferro) / Austria Central Zone
-<BR> <esri31283> : MGI (Ferro) / Austria East Zone
-<BR> <esri31284> : MGI / M28
-<BR> <esri31285> : MGI / M31
-<BR> <esri31286> : MGI / M34
-<BR> <esri31287> : MGI / Austria Lambert
-<BR> <esri31291> : MGI (Ferro) / Austria West Zone
-<BR> <esri31292> : MGI (Ferro) / Austria Central Zone
-<BR> <esri31293> : MGI (Ferro) / Austria East Zone
-<BR> <esri31294> : MGI / M28
-<BR> <esri31295> : MGI / M31
-<BR> <esri31296> : MGI / M34
-<BR> <esri31297> : MGI / Austria Lambert
-<BR> <esri31300> : Belge 1972 / Belge Lambert 72
-<BR> <esri31370> : Belge 1972 / Belgian Lambert 72
-<BR> <esri31461> : DHDN / 3-degree Gauss zone 1
-<BR> <esri31462> : DHDN / 3-degree Gauss zone 2
-<BR> <esri31463> : DHDN / 3-degree Gauss zone 3
-<BR> <esri31464> : DHDN / 3-degree Gauss zone 4
-<BR> <esri31465> : DHDN / 3-degree Gauss zone 5
-<BR> <esri31466> : DHDN / Gauss-Kruger zone 2
-<BR> <esri31467> : DHDN / Gauss-Kruger zone 3
-<BR> <esri31468> : DHDN / Gauss-Kruger zone 4
-<BR> <esri31469> : DHDN / Gauss-Kruger zone 5
-<BR> <esri31528> : Conakry 1905 / UTM zone 28N
-<BR> <esri31529> : Conakry 1905 / UTM zone 29N
-<BR> <esri31600> : Dealul Piscului 1933/ Stereo 33
-<BR> <esri31700> : Dealul Piscului 1970/ Stereo 70
-<BR> <esri31838> : NGN / UTM zone 38N
-<BR> <esri31839> : NGN / UTM zone 39N
-<BR> <esri31900> : KUDAMS / KTM
-<BR> <esri31986> : SIRGAS / UTM zone 17N
-<BR> <esri31987> : SIRGAS / UTM zone 18N
-<BR> <esri31988> : SIRGAS / UTM zone 19N
-<BR> <esri31989> : SIRGAS / UTM zone 20N
-<BR> <esri31990> : SIRGAS / UTM zone 21N
-<BR> <esri31991> : SIRGAS / UTM zone 22N
-<BR> <esri31992> : SIRGAS / UTM zone 17S
-<BR> <esri31993> : SIRGAS / UTM zone 18S
-<BR> <esri31994> : SIRGAS / UTM zone 19S
-<BR> <esri31995> : SIRGAS / UTM zone 20S
-<BR> <esri31996> : SIRGAS / UTM zone 21S
-<BR> <esri31997> : SIRGAS / UTM zone 22S
-<BR> <esri31998> : SIRGAS / UTM zone 23S
-<BR> <esri31999> : SIRGAS / UTM zone 24S
-<BR> <esri32000> : SIRGAS / UTM zone 25S
-<BR> <esri32001> : NAD27 / Montana North
-<BR> <esri32002> : NAD27 / Montana Central
-<BR> <esri32003> : NAD27 / Montana South
-<BR> <esri32005> : NAD27 / Nebraska North
-<BR> <esri32006> : NAD27 / Nebraska South
-<BR> <esri32007> : NAD27 / Nevada East
-<BR> <esri32008> : NAD27 / Nevada Central
-<BR> <esri32009> : NAD27 / Nevada West
-<BR> <esri32010> : NAD27 / New Hampshire
-<BR> <esri32011> : NAD27 / New Jersey
-<BR> <esri32012> : NAD27 / New Mexico East
-<BR> <esri32013> : NAD27 / New Mexico Central
-<BR> <esri32014> : NAD27 / New Mexico West
-<BR> <esri32015> : NAD27 / New York East
-<BR> <esri32016> : NAD27 / New York Central
-<BR> <esri32017> : NAD27 / New York West
-<BR> <esri32018> : NAD27 / New York Long Island
-<BR> <esri32019> : NAD27 / North Carolina
-<BR> <esri32020> : NAD27 / North Dakota North
-<BR> <esri32021> : NAD27 / North Dakota South
-<BR> <esri32022> : NAD27 / Ohio North
-<BR> <esri32023> : NAD27 / Ohio South
-<BR> <esri32024> : NAD27 / Oklahoma North
-<BR> <esri32025> : NAD27 / Oklahoma South
-<BR> <esri32026> : NAD27 / Oregon North
-<BR> <esri32027> : NAD27 / Oregon South
-<BR> <esri32028> : NAD27 / Pennsylvania North
-<BR> <esri32029> : NAD27 / Pennsylvania South
-<BR> <esri32030> : NAD27 / Rhode Island
-<BR> <esri32031> : NAD27 / South Carolina North
-<BR> <esri32033> : NAD27 / South Carolina South
-<BR> <esri32034> : NAD27 / South Dakota North
-<BR> <esri32035> : NAD27 / South Dakota South
-<BR> <esri32036> : NAD27 / Tennessee
-<BR> <esri32037> : NAD27 / Texas North
-<BR> <esri32038> : NAD27 / Texas North Central
-<BR> <esri32039> : NAD27 / Texas Central
-<BR> <esri32040> : NAD27 / Texas South Central
-<BR> <esri32041> : NAD27 / Texas South
-<BR> <esri32042> : NAD27 / Utah North
-<BR> <esri32043> : NAD27 / Utah Central
-<BR> <esri32044> : NAD27 / Utah South
-<BR> <esri32045> : NAD27 / Vermont
-<BR> <esri32046> : NAD27 / Virginia North
-<BR> <esri32047> : NAD27 / Virginia South
-<BR> <esri32048> : NAD27 / Washington North
-<BR> <esri32049> : NAD27 / Washington South
-<BR> <esri32050> : NAD27 / West Virginia North
-<BR> <esri32051> : NAD27 / West Virginia South
-<BR> <esri32052> : NAD27 / Wisconsin North
-<BR> <esri32053> : NAD27 / Wisconsin Central
-<BR> <esri32054> : NAD27 / Wisconsin South
-<BR> <esri32055> : NAD27 / Wyoming East
-<BR> <esri32056> : NAD27 / Wyoming East Central
-<BR> <esri32057> : NAD27 / Wyoming West Central
-<BR> <esri32058> : NAD27 / Wyoming West
-<BR> <esri32061> : NAD27 / Guatemala Norte
-<BR> <esri32062> : NAD27 / Guatemala Sur
-<BR> <esri32064> : NAD27 / BLM 14N (ftUS)
-<BR> <esri32065> : NAD27 / BLM 15N (ftUS)
-<BR> <esri32066> : NAD27 / BLM 16N (ftUS)
-<BR> <esri32067> : NAD27 / BLM 17N (ftUS)
-<BR> <esri32074> : NAD27 / BLM 14N (feet)
-<BR> <esri32075> : NAD27 / BLM 15N (feet)
-<BR> <esri32076> : NAD27 / BLM 16N (feet)
-<BR> <esri32077> : NAD27 / BLM 17N (feet)
-<BR> <esri32081> : NAD27 / MTM zone 1
-<BR> <esri32082> : NAD27 / MTM zone 2
-<BR> <esri32083> : NAD27 / MTM zone 3
-<BR> <esri32084> : NAD27 / MTM zone 4
-<BR> <esri32085> : NAD27 / MTM zone 5
-<BR> <esri32086> : NAD27 / MTM zone 6
-<BR> <esri32098> : NAD27 / Quebec Lambert
-<BR> <esri32100> : NAD83 / Montana
-<BR> <esri32104> : NAD83 / Nebraska
-<BR> <esri32107> : NAD83 / Nevada East
-<BR> <esri32108> : NAD83 / Nevada Central
-<BR> <esri32109> : NAD83 / Nevada West
-<BR> <esri32110> : NAD83 / New Hampshire
-<BR> <esri32111> : NAD83 / New Jersey
-<BR> <esri32112> : NAD83 / New Mexico East
-<BR> <esri32113> : NAD83 / New Mexico Central
-<BR> <esri32114> : NAD83 / New Mexico West
-<BR> <esri32115> : NAD83 / New York East
-<BR> <esri32116> : NAD83 / New York Central
-<BR> <esri32117> : NAD83 / New York West
-<BR> <esri32118> : NAD83 / New York Long Island
-<BR> <esri32119> : NAD83 / North Carolina
-<BR> <esri32120> : NAD83 / North Dakota North
-<BR> <esri32121> : NAD83 / North Dakota South
-<BR> <esri32122> : NAD83 / Ohio North
-<BR> <esri32123> : NAD83 / Ohio South
-<BR> <esri32124> : NAD83 / Oklahoma North
-<BR> <esri32125> : NAD83 / Oklahoma South
-<BR> <esri32126> : NAD83 / Oregon North
-<BR> <esri32127> : NAD83 / Oregon South
-<BR> <esri32128> : NAD83 / Pennsylvania North
-<BR> <esri32129> : NAD83 / Pennsylvania South
-<BR> <esri32130> : NAD83 / Rhode Island
-<BR> <esri32133> : NAD83 / South Carolina
-<BR> <esri32134> : NAD83 / South Dakota North
-<BR> <esri32135> : NAD83 / South Dakota South
-<BR> <esri32136> : NAD83 / Tennessee
-<BR> <esri32137> : NAD83 / Texas North
-<BR> <esri32138> : NAD83 / Texas North Central
-<BR> <esri32139> : NAD83 / Texas Central
-<BR> <esri32140> : NAD83 / Texas South Central
-<BR> <esri32141> : NAD83 / Texas South
-<BR> <esri32142> : NAD83 / Utah North
-<BR> <esri32143> : NAD83 / Utah Central
-<BR> <esri32144> : NAD83 / Utah South
-<BR> <esri32145> : NAD83 / Vermont
-<BR> <esri32146> : NAD83 / Virginia North
-<BR> <esri32147> : NAD83 / Virginia South
-<BR> <esri32148> : NAD83 / Washington North
-<BR> <esri32149> : NAD83 / Washington South
-<BR> <esri32150> : NAD83 / West Virginia North
-<BR> <esri32151> : NAD83 / West Virginia South
-<BR> <esri32152> : NAD83 / Wisconsin North
-<BR> <esri32153> : NAD83 / Wisconsin Central
-<BR> <esri32154> : NAD83 / Wisconsin South
-<BR> <esri32155> : NAD83 / Wyoming East
-<BR> <esri32156> : NAD83 / Wyoming East Central
-<BR> <esri32157> : NAD83 / Wyoming West Central
-<BR> <esri32158> : NAD83 / Wyoming West
-<BR> <esri32161> : NAD83 / Puerto Rico & Virgin Is.
-<BR> <esri32180> : NAD83 / SCoPQ zone 2
-<BR> <esri32181> : NAD83 / MTM zone 1
-<BR> <esri32182> : NAD83 / MTM zone 2
-<BR> <esri32183> : NAD83 / MTM zone 3
-<BR> <esri32184> : NAD83 / MTM zone 4
-<BR> <esri32185> : NAD83 / MTM zone 5
-<BR> <esri32186> : NAD83 / MTM zone 6
-<BR> <esri32187> : NAD83 / MTM zone 7
-<BR> <esri32188> : NAD83 / MTM zone 8
-<BR> <esri32189> : NAD83 / MTM zone 9
-<BR> <esri32190> : NAD83 / MTM zone 10
-<BR> <esri32191> : NAD83 / MTM zone 11
-<BR> <esri32192> : NAD83 / MTM zone 12
-<BR> <esri32193> : NAD83 / MTM zone 13
-<BR> <esri32194> : NAD83 / MTM zone 14
-<BR> <esri32195> : NAD83 / MTM zone 15
-<BR> <esri32196> : NAD83 / MTM zone 16
-<BR> <esri32197> : NAD83 / MTM zone 17
-<BR> <esri32198> : NAD83 / Quebec Lambert
-<BR> <esri32201> : WGS 72 / UTM zone 1N
-<BR> <esri32202> : WGS 72 / UTM zone 2N
-<BR> <esri32203> : WGS 72 / UTM zone 3N
-<BR> <esri32204> : WGS 72 / UTM zone 4N
-<BR> <esri32205> : WGS 72 / UTM zone 5N
-<BR> <esri32206> : WGS 72 / UTM zone 6N
-<BR> <esri32207> : WGS 72 / UTM zone 7N
-<BR> <esri32208> : WGS 72 / UTM zone 8N
-<BR> <esri32209> : WGS 72 / UTM zone 9N
-<BR> <esri32210> : WGS 72 / UTM zone 10N
-<BR> <esri32211> : WGS 72 / UTM zone 11N
-<BR> <esri32212> : WGS 72 / UTM zone 12N
-<BR> <esri32213> : WGS 72 / UTM zone 13N
-<BR> <esri32214> : WGS 72 / UTM zone 14N
-<BR> <esri32215> : WGS 72 / UTM zone 15N
-<BR> <esri32216> : WGS 72 / UTM zone 16N
-<BR> <esri32217> : WGS 72 / UTM zone 17N
-<BR> <esri32218> : WGS 72 / UTM zone 18N
-<BR> <esri32219> : WGS 72 / UTM zone 19N
-<BR> <esri32220> : WGS 72 / UTM zone 20N
-<BR> <esri32221> : WGS 72 / UTM zone 21N
-<BR> <esri32222> : WGS 72 / UTM zone 22N
-<BR> <esri32223> : WGS 72 / UTM zone 23N
-<BR> <esri32224> : WGS 72 / UTM zone 24N
-<BR> <esri32225> : WGS 72 / UTM zone 25N
-<BR> <esri32226> : WGS 72 / UTM zone 26N
-<BR> <esri32227> : WGS 72 / UTM zone 27N
-<BR> <esri32228> : WGS 72 / UTM zone 28N
-<BR> <esri32229> : WGS 72 / UTM zone 29N
-<BR> <esri32230> : WGS 72 / UTM zone 30N
-<BR> <esri32231> : WGS 72 / UTM zone 31N
-<BR> <esri32232> : WGS 72 / UTM zone 32N
-<BR> <esri32233> : WGS 72 / UTM zone 33N
-<BR> <esri32234> : WGS 72 / UTM zone 34N
-<BR> <esri32235> : WGS 72 / UTM zone 35N
-<BR> <esri32236> : WGS 72 / UTM zone 36N
-<BR> <esri32237> : WGS 72 / UTM zone 37N
-<BR> <esri32238> : WGS 72 / UTM zone 38N
-<BR> <esri32239> : WGS 72 / UTM zone 39N
-<BR> <esri32240> : WGS 72 / UTM zone 40N
-<BR> <esri32241> : WGS 72 / UTM zone 41N
-<BR> <esri32242> : WGS 72 / UTM zone 42N
-<BR> <esri32243> : WGS 72 / UTM zone 43N
-<BR> <esri32244> : WGS 72 / UTM zone 44N
-<BR> <esri32245> : WGS 72 / UTM zone 45N
-<BR> <esri32246> : WGS 72 / UTM zone 46N
-<BR> <esri32247> : WGS 72 / UTM zone 47N
-<BR> <esri32248> : WGS 72 / UTM zone 48N
-<BR> <esri32249> : WGS 72 / UTM zone 49N
-<BR> <esri32250> : WGS 72 / UTM zone 50N
-<BR> <esri32251> : WGS 72 / UTM zone 51N
-<BR> <esri32252> : WGS 72 / UTM zone 52N
-<BR> <esri32253> : WGS 72 / UTM zone 53N
-<BR> <esri32254> : WGS 72 / UTM zone 54N
-<BR> <esri32255> : WGS 72 / UTM zone 55N
-<BR> <esri32256> : WGS 72 / UTM zone 56N
-<BR> <esri32257> : WGS 72 / UTM zone 57N
-<BR> <esri32258> : WGS 72 / UTM zone 58N
-<BR> <esri32259> : WGS 72 / UTM zone 59N
-<BR> <esri32260> : WGS 72 / UTM zone 60N
-<BR> <esri32301> : WGS 72 / UTM zone 1S
-<BR> <esri32302> : WGS 72 / UTM zone 2S
-<BR> <esri32303> : WGS 72 / UTM zone 3S
-<BR> <esri32304> : WGS 72 / UTM zone 4S
-<BR> <esri32305> : WGS 72 / UTM zone 5S
-<BR> <esri32306> : WGS 72 / UTM zone 6S
-<BR> <esri32307> : WGS 72 / UTM zone 7S
-<BR> <esri32308> : WGS 72 / UTM zone 8S
-<BR> <esri32309> : WGS 72 / UTM zone 9S
-<BR> <esri32310> : WGS 72 / UTM zone 10S
-<BR> <esri32311> : WGS 72 / UTM zone 11S
-<BR> <esri32312> : WGS 72 / UTM zone 12S
-<BR> <esri32313> : WGS 72 / UTM zone 13S
-<BR> <esri32314> : WGS 72 / UTM zone 14S
-<BR> <esri32315> : WGS 72 / UTM zone 15S
-<BR> <esri32316> : WGS 72 / UTM zone 16S
-<BR> <esri32317> : WGS 72 / UTM zone 17S
-<BR> <esri32318> : WGS 72 / UTM zone 18S
-<BR> <esri32319> : WGS 72 / UTM zone 19S
-<BR> <esri32320> : WGS 72 / UTM zone 20S
-<BR> <esri32321> : WGS 72 / UTM zone 21S
-<BR> <esri32322> : WGS 72 / UTM zone 22S
-<BR> <esri32323> : WGS 72 / UTM zone 23S
-<BR> <esri32324> : WGS 72 / UTM zone 24S
-<BR> <esri32325> : WGS 72 / UTM zone 25S
-<BR> <esri32326> : WGS 72 / UTM zone 26S
-<BR> <esri32327> : WGS 72 / UTM zone 27S
-<BR> <esri32328> : WGS 72 / UTM zone 28S
-<BR> <esri32329> : WGS 72 / UTM zone 29S
-<BR> <esri32330> : WGS 72 / UTM zone 30S
-<BR> <esri32331> : WGS 72 / UTM zone 31S
-<BR> <esri32332> : WGS 72 / UTM zone 32S
-<BR> <esri32333> : WGS 72 / UTM zone 33S
-<BR> <esri32334> : WGS 72 / UTM zone 34S
-<BR> <esri32335> : WGS 72 / UTM zone 35S
-<BR> <esri32336> : WGS 72 / UTM zone 36S
-<BR> <esri32337> : WGS 72 / UTM zone 37S
-<BR> <esri32338> : WGS 72 / UTM zone 38S
-<BR> <esri32339> : WGS 72 / UTM zone 39S
-<BR> <esri32340> : WGS 72 / UTM zone 40S
-<BR> <esri32341> : WGS 72 / UTM zone 41S
-<BR> <esri32342> : WGS 72 / UTM zone 42S
-<BR> <esri32343> : WGS 72 / UTM zone 43S
-<BR> <esri32344> : WGS 72 / UTM zone 44S
-<BR> <esri32345> : WGS 72 / UTM zone 45S
-<BR> <esri32346> : WGS 72 / UTM zone 46S
-<BR> <esri32347> : WGS 72 / UTM zone 47S
-<BR> <esri32348> : WGS 72 / UTM zone 48S
-<BR> <esri32349> : WGS 72 / UTM zone 49S
-<BR> <esri32350> : WGS 72 / UTM zone 50S
-<BR> <esri32351> : WGS 72 / UTM zone 51S
-<BR> <esri32352> : WGS 72 / UTM zone 52S
-<BR> <esri32353> : WGS 72 / UTM zone 53S
-<BR> <esri32354> : WGS 72 / UTM zone 54S
-<BR> <esri32355> : WGS 72 / UTM zone 55S
-<BR> <esri32356> : WGS 72 / UTM zone 56S
-<BR> <esri32357> : WGS 72 / UTM zone 57S
-<BR> <esri32358> : WGS 72 / UTM zone 58S
-<BR> <esri32359> : WGS 72 / UTM zone 59S
-<BR> <esri32360> : WGS 72 / UTM zone 60S
-<BR> <esri32401> : WGS 72BE / UTM zone 1N
-<BR> <esri32402> : WGS 72BE / UTM zone 2N
-<BR> <esri32403> : WGS 72BE / UTM zone 3N
-<BR> <esri32404> : WGS 72BE / UTM zone 4N
-<BR> <esri32405> : WGS 72BE / UTM zone 5N
-<BR> <esri32406> : WGS 72BE / UTM zone 6N
-<BR> <esri32407> : WGS 72BE / UTM zone 7N
-<BR> <esri32408> : WGS 72BE / UTM zone 8N
-<BR> <esri32409> : WGS 72BE / UTM zone 9N
-<BR> <esri32410> : WGS 72BE / UTM zone 10N
-<BR> <esri32411> : WGS 72BE / UTM zone 11N
-<BR> <esri32412> : WGS 72BE / UTM zone 12N
-<BR> <esri32413> : WGS 72BE / UTM zone 13N
-<BR> <esri32414> : WGS 72BE / UTM zone 14N
-<BR> <esri32415> : WGS 72BE / UTM zone 15N
-<BR> <esri32416> : WGS 72BE / UTM zone 16N
-<BR> <esri32417> : WGS 72BE / UTM zone 17N
-<BR> <esri32418> : WGS 72BE / UTM zone 18N
-<BR> <esri32419> : WGS 72BE / UTM zone 19N
-<BR> <esri32420> : WGS 72BE / UTM zone 20N
-<BR> <esri32421> : WGS 72BE / UTM zone 21N
-<BR> <esri32422> : WGS 72BE / UTM zone 22N
-<BR> <esri32423> : WGS 72BE / UTM zone 23N
-<BR> <esri32424> : WGS 72BE / UTM zone 24N
-<BR> <esri32425> : WGS 72BE / UTM zone 25N
-<BR> <esri32426> : WGS 72BE / UTM zone 26N
-<BR> <esri32427> : WGS 72BE / UTM zone 27N
-<BR> <esri32428> : WGS 72BE / UTM zone 28N
-<BR> <esri32429> : WGS 72BE / UTM zone 29N
-<BR> <esri32430> : WGS 72BE / UTM zone 30N
-<BR> <esri32431> : WGS 72BE / UTM zone 31N
-<BR> <esri32432> : WGS 72BE / UTM zone 32N
-<BR> <esri32433> : WGS 72BE / UTM zone 33N
-<BR> <esri32434> : WGS 72BE / UTM zone 34N
-<BR> <esri32435> : WGS 72BE / UTM zone 35N
-<BR> <esri32436> : WGS 72BE / UTM zone 36N
-<BR> <esri32437> : WGS 72BE / UTM zone 37N
-<BR> <esri32438> : WGS 72BE / UTM zone 38N
-<BR> <esri32439> : WGS 72BE / UTM zone 39N
-<BR> <esri32440> : WGS 72BE / UTM zone 40N
-<BR> <esri32441> : WGS 72BE / UTM zone 41N
-<BR> <esri32442> : WGS 72BE / UTM zone 42N
-<BR> <esri32443> : WGS 72BE / UTM zone 43N
-<BR> <esri32444> : WGS 72BE / UTM zone 44N
-<BR> <esri32445> : WGS 72BE / UTM zone 45N
-<BR> <esri32446> : WGS 72BE / UTM zone 46N
-<BR> <esri32447> : WGS 72BE / UTM zone 47N
-<BR> <esri32448> : WGS 72BE / UTM zone 48N
-<BR> <esri32449> : WGS 72BE / UTM zone 49N
-<BR> <esri32450> : WGS 72BE / UTM zone 50N
-<BR> <esri32451> : WGS 72BE / UTM zone 51N
-<BR> <esri32452> : WGS 72BE / UTM zone 52N
-<BR> <esri32453> : WGS 72BE / UTM zone 53N
-<BR> <esri32454> : WGS 72BE / UTM zone 54N
-<BR> <esri32455> : WGS 72BE / UTM zone 55N
-<BR> <esri32456> : WGS 72BE / UTM zone 56N
-<BR> <esri32457> : WGS 72BE / UTM zone 57N
-<BR> <esri32458> : WGS 72BE / UTM zone 58N
-<BR> <esri32459> : WGS 72BE / UTM zone 59N
-<BR> <esri32460> : WGS 72BE / UTM zone 60N
-<BR> <esri32501> : WGS 72BE / UTM zone 1S
-<BR> <esri32502> : WGS 72BE / UTM zone 2S
-<BR> <esri32503> : WGS 72BE / UTM zone 3S
-<BR> <esri32504> : WGS 72BE / UTM zone 4S
-<BR> <esri32505> : WGS 72BE / UTM zone 5S
-<BR> <esri32506> : WGS 72BE / UTM zone 6S
-<BR> <esri32507> : WGS 72BE / UTM zone 7S
-<BR> <esri32508> : WGS 72BE / UTM zone 8S
-<BR> <esri32509> : WGS 72BE / UTM zone 9S
-<BR> <esri32510> : WGS 72BE / UTM zone 10S
-<BR> <esri32511> : WGS 72BE / UTM zone 11S
-<BR> <esri32512> : WGS 72BE / UTM zone 12S
-<BR> <esri32513> : WGS 72BE / UTM zone 13S
-<BR> <esri32514> : WGS 72BE / UTM zone 14S
-<BR> <esri32515> : WGS 72BE / UTM zone 15S
-<BR> <esri32516> : WGS 72BE / UTM zone 16S
-<BR> <esri32517> : WGS 72BE / UTM zone 17S
-<BR> <esri32518> : WGS 72BE / UTM zone 18S
-<BR> <esri32519> : WGS 72BE / UTM zone 19S
-<BR> <esri32520> : WGS 72BE / UTM zone 20S
-<BR> <esri32521> : WGS 72BE / UTM zone 21S
-<BR> <esri32522> : WGS 72BE / UTM zone 22S
-<BR> <esri32523> : WGS 72BE / UTM zone 23S
-<BR> <esri32524> : WGS 72BE / UTM zone 24S
-<BR> <esri32525> : WGS 72BE / UTM zone 25S
-<BR> <esri32526> : WGS 72BE / UTM zone 26S
-<BR> <esri32527> : WGS 72BE / UTM zone 27S
-<BR> <esri32528> : WGS 72BE / UTM zone 28S
-<BR> <esri32529> : WGS 72BE / UTM zone 29S
-<BR> <esri32530> : WGS 72BE / UTM zone 30S
-<BR> <esri32531> : WGS 72BE / UTM zone 31S
-<BR> <esri32532> : WGS 72BE / UTM zone 32S
-<BR> <esri32533> : WGS 72BE / UTM zone 33S
-<BR> <esri32534> : WGS 72BE / UTM zone 34S
-<BR> <esri32535> : WGS 72BE / UTM zone 35S
-<BR> <esri32536> : WGS 72BE / UTM zone 36S
-<BR> <esri32537> : WGS 72BE / UTM zone 37S
-<BR> <esri32538> : WGS 72BE / UTM zone 38S
-<BR> <esri32539> : WGS 72BE / UTM zone 39S
-<BR> <esri32540> : WGS 72BE / UTM zone 40S
-<BR> <esri32541> : WGS 72BE / UTM zone 41S
-<BR> <esri32542> : WGS 72BE / UTM zone 42S
-<BR> <esri32543> : WGS 72BE / UTM zone 43S
-<BR> <esri32544> : WGS 72BE / UTM zone 44S
-<BR> <esri32545> : WGS 72BE / UTM zone 45S
-<BR> <esri32546> : WGS 72BE / UTM zone 46S
-<BR> <esri32547> : WGS 72BE / UTM zone 47S
-<BR> <esri32548> : WGS 72BE / UTM zone 48S
-<BR> <esri32549> : WGS 72BE / UTM zone 49S
-<BR> <esri32550> : WGS 72BE / UTM zone 50S
-<BR> <esri32551> : WGS 72BE / UTM zone 51S
-<BR> <esri32552> : WGS 72BE / UTM zone 52S
-<BR> <esri32553> : WGS 72BE / UTM zone 53S
-<BR> <esri32554> : WGS 72BE / UTM zone 54S
-<BR> <esri32555> : WGS 72BE / UTM zone 55S
-<BR> <esri32556> : WGS 72BE / UTM zone 56S
-<BR> <esri32557> : WGS 72BE / UTM zone 57S
-<BR> <esri32558> : WGS 72BE / UTM zone 58S
-<BR> <esri32559> : WGS 72BE / UTM zone 59S
-<BR> <esri32560> : WGS 72BE / UTM zone 60S
-<BR> <esri32601> : WGS 84 / UTM zone 1N
-<BR> <esri32602> : WGS 84 / UTM zone 2N
-<BR> <esri32603> : WGS 84 / UTM zone 3N
-<BR> <esri32604> : WGS 84 / UTM zone 4N
-<BR> <esri32605> : WGS 84 / UTM zone 5N
-<BR> <esri32606> : WGS 84 / UTM zone 6N
-<BR> <esri32607> : WGS 84 / UTM zone 7N
-<BR> <esri32608> : WGS 84 / UTM zone 8N
-<BR> <esri32609> : WGS 84 / UTM zone 9N
-<BR> <esri32610> : WGS 84 / UTM zone 10N
-<BR> <esri32611> : WGS 84 / UTM zone 11N
-<BR> <esri32612> : WGS 84 / UTM zone 12N
-<BR> <esri32613> : WGS 84 / UTM zone 13N
-<BR> <esri32614> : WGS 84 / UTM zone 14N
-<BR> <esri32615> : WGS 84 / UTM zone 15N
-<BR> <esri32616> : WGS 84 / UTM zone 16N
-<BR> <esri32617> : WGS 84 / UTM zone 17N
-<BR> <esri32618> : WGS 84 / UTM zone 18N
-<BR> <esri32619> : WGS 84 / UTM zone 19N
-<BR> <esri32620> : WGS 84 / UTM zone 20N
-<BR> <esri32621> : WGS 84 / UTM zone 21N
-<BR> <esri32622> : WGS 84 / UTM zone 22N
-<BR> <esri32623> : WGS 84 / UTM zone 23N
-<BR> <esri32624> : WGS 84 / UTM zone 24N
-<BR> <esri32625> : WGS 84 / UTM zone 25N
-<BR> <esri32626> : WGS 84 / UTM zone 26N
-<BR> <esri32627> : WGS 84 / UTM zone 27N
-<BR> <esri32628> : WGS 84 / UTM zone 28N
-<BR> <esri32629> : WGS 84 / UTM zone 29N
-<BR> <esri32630> : WGS 84 / UTM zone 30N
-<BR> <esri32631> : WGS 84 / UTM zone 31N
-<BR> <esri32632> : WGS 84 / UTM zone 32N
-<BR> <esri32633> : WGS 84 / UTM zone 33N
-<BR> <esri32634> : WGS 84 / UTM zone 34N
-<BR> <esri32635> : WGS 84 / UTM zone 35N
-<BR> <esri32636> : WGS 84 / UTM zone 36N
-<BR> <esri32637> : WGS 84 / UTM zone 37N
-<BR> <esri32638> : WGS 84 / UTM zone 38N
-<BR> <esri32639> : WGS 84 / UTM zone 39N
-<BR> <esri32640> : WGS 84 / UTM zone 40N
-<BR> <esri32641> : WGS 84 / UTM zone 41N
-<BR> <esri32642> : WGS 84 / UTM zone 42N
-<BR> <esri32643> : WGS 84 / UTM zone 43N
-<BR> <esri32644> : WGS 84 / UTM zone 44N
-<BR> <esri32645> : WGS 84 / UTM zone 45N
-<BR> <esri32646> : WGS 84 / UTM zone 46N
-<BR> <esri32647> : WGS 84 / UTM zone 47N
-<BR> <esri32648> : WGS 84 / UTM zone 48N
-<BR> <esri32649> : WGS 84 / UTM zone 49N
-<BR> <esri32650> : WGS 84 / UTM zone 50N
-<BR> <esri32651> : WGS 84 / UTM zone 51N
-<BR> <esri32652> : WGS 84 / UTM zone 52N
-<BR> <esri32653> : WGS 84 / UTM zone 53N
-<BR> <esri32654> : WGS 84 / UTM zone 54N
-<BR> <esri32655> : WGS 84 / UTM zone 55N
-<BR> <esri32656> : WGS 84 / UTM zone 56N
-<BR> <esri32657> : WGS 84 / UTM zone 57N
-<BR> <esri32658> : WGS 84 / UTM zone 58N
-<BR> <esri32659> : WGS 84 / UTM zone 59N
-<BR> <esri32660> : WGS 84 / UTM zone 60N
-<BR> <esri32661> : WGS 84 / UPS North
-<BR> <esri32701> : WGS 84 / UTM zone 1S
-<BR> <esri32702> : WGS 84 / UTM zone 2S
-<BR> <esri32703> : WGS 84 / UTM zone 3S
-<BR> <esri32704> : WGS 84 / UTM zone 4S
-<BR> <esri32705> : WGS 84 / UTM zone 5S
-<BR> <esri32706> : WGS 84 / UTM zone 6S
-<BR> <esri32707> : WGS 84 / UTM zone 7S
-<BR> <esri32708> : WGS 84 / UTM zone 8S
-<BR> <esri32709> : WGS 84 / UTM zone 9S
-<BR> <esri32710> : WGS 84 / UTM zone 10S
-<BR> <esri32711> : WGS 84 / UTM zone 11S
-<BR> <esri32712> : WGS 84 / UTM zone 12S
-<BR> <esri32713> : WGS 84 / UTM zone 13S
-<BR> <esri32714> : WGS 84 / UTM zone 14S
-<BR> <esri32715> : WGS 84 / UTM zone 15S
-<BR> <esri32716> : WGS 84 / UTM zone 16S
-<BR> <esri32717> : WGS 84 / UTM zone 17S
-<BR> <esri32718> : WGS 84 / UTM zone 18S
-<BR> <esri32719> : WGS 84 / UTM zone 19S
-<BR> <esri32720> : WGS 84 / UTM zone 20S
-<BR> <esri32721> : WGS 84 / UTM zone 21S
-<BR> <esri32722> : WGS 84 / UTM zone 22S
-<BR> <esri32723> : WGS 84 / UTM zone 23S
-<BR> <esri32724> : WGS 84 / UTM zone 24S
-<BR> <esri32725> : WGS 84 / UTM zone 25S
-<BR> <esri32726> : WGS 84 / UTM zone 26S
-<BR> <esri32727> : WGS 84 / UTM zone 27S
-<BR> <esri32728> : WGS 84 / UTM zone 28S
-<BR> <esri32729> : WGS 84 / UTM zone 29S
-<BR> <esri32730> : WGS 84 / UTM zone 30S
-<BR> <esri32731> : WGS 84 / UTM zone 31S
-<BR> <esri32732> : WGS 84 / UTM zone 32S
-<BR> <esri32733> : WGS 84 / UTM zone 33S
-<BR> <esri32734> : WGS 84 / UTM zone 34S
-<BR> <esri32735> : WGS 84 / UTM zone 35S
-<BR> <esri32736> : WGS 84 / UTM zone 36S
-<BR> <esri32737> : WGS 84 / UTM zone 37S
-<BR> <esri32738> : WGS 84 / UTM zone 38S
-<BR> <esri32739> : WGS 84 / UTM zone 39S
-<BR> <esri32740> : WGS 84 / UTM zone 40S
-<BR> <esri32741> : WGS 84 / UTM zone 41S
-<BR> <esri32742> : WGS 84 / UTM zone 42S
-<BR> <esri32743> : WGS 84 / UTM zone 43S
-<BR> <esri32744> : WGS 84 / UTM zone 44S
-<BR> <esri32745> : WGS 84 / UTM zone 45S
-<BR> <esri32746> : WGS 84 / UTM zone 46S
-<BR> <esri32747> : WGS 84 / UTM zone 47S
-<BR> <esri32748> : WGS 84 / UTM zone 48S
-<BR> <esri32749> : WGS 84 / UTM zone 49S
-<BR> <esri32750> : WGS 84 / UTM zone 50S
-<BR> <esri32751> : WGS 84 / UTM zone 51S
-<BR> <esri32752> : WGS 84 / UTM zone 52S
-<BR> <esri32753> : WGS 84 / UTM zone 53S
-<BR> <esri32754> : WGS 84 / UTM zone 54S
-<BR> <esri32755> : WGS 84 / UTM zone 55S
-<BR> <esri32756> : WGS 84 / UTM zone 56S
-<BR> <esri32757> : WGS 84 / UTM zone 57S
-<BR> <esri32758> : WGS 84 / UTM zone 58S
-<BR> <esri32759> : WGS 84 / UTM zone 59S
-<BR> <esri32760> : WGS 84 / UTM zone 60S
-<BR> <esri32761> : WGS 84 / UPS South
-<BR> <esri32766> : WGS 84 / TM 36 SE
-<BR> <esri20002> : Pulkovo 1995 GK Zone 2
-<BR> <esri20003> : Pulkovo 1995 GK Zone 3
-<BR> <esri20062> : Pulkovo 1995 GK Zone 2N
-<BR> <esri20063> : Pulkovo 1995 GK Zone 3N
-<BR> <esri24721> : La Canoa UTM Zone 21N
-<BR> <esri26761> : NAD 1927 StatePlane Hawaii 1 FIPS 5101
-<BR> <esri26762> : NAD 1927 StatePlane Hawaii 2 FIPS 5102
-<BR> <esri26763> : NAD 1927 StatePlane Hawaii 3 FIPS 5103
-<BR> <esri26764> : NAD 1927 StatePlane Hawaii 4 FIPS 5104
-<BR> <esri26765> : NAD 1927 StatePlane Hawaii 5 FIPS 5105
-<BR> <esri26788> : NAD 1927 StatePlane Michigan North FIPS 2111
-<BR> <esri26789> : NAD 1927 StatePlane Michigan Central FIPS 2112
-<BR> <esri26790> : NAD 1927 StatePlane Michigan South FIPS 2113
-<BR> <esri30591> : Nord Algerie
-<BR> <esri30592> : Sud Algerie
-<BR> <esri31491> : Germany Zone 1
-<BR> <esri31492> : Germany Zone 2
-<BR> <esri31493> : Germany Zone 3
-<BR> <esri31494> : Germany Zone 4
-<BR> <esri31495> : Germany Zone 5
-<BR> <esri32059> : NAD 1927 StatePlane Puerto Rico FIPS 5201
-<BR> <esri32060> : NAD 1927 StatePlane Virgin Islands St Croix FIPS 5202
-<BR> <esri53001> : Sphere Plate Carree
-<BR> <esri53002> : Sphere Equidistant Cylindrical
-<BR> <esri53003> : Sphere Miller Cylindrical
-<BR> <esri53004> : Sphere Mercator
-<BR> <esri53008> : Sphere Sinusoidal
-<BR> <esri53009> : Sphere Mollweide
-<BR> <esri53010> : Sphere Eckert VI
-<BR> <esri53011> : Sphere Eckert V
-<BR> <esri53012> : Sphere Eckert IV
-<BR> <esri53013> : Sphere Eckert III
-<BR> <esri53014> : Sphere Eckert II
-<BR> <esri53015> : Sphere Eckert I
-<BR> <esri53016> : Sphere Gall Stereographic
-<BR> <esri53017> : Sphere Behrmann
-<BR> <esri53018> : Sphere Winkel I
-<BR> <esri53019> : Sphere Winkel II
-<BR> <esri53021> : Sphere Polyconic
-<BR> <esri53022> : Sphere Quartic Authalic
-<BR> <esri53023> : Sphere Loximuthal
-<BR> <esri53024> : Sphere Bonne
-<BR> <esri53025> : Sphere Hotine
-<BR> <esri53026> : Sphere Stereographic
-<BR> <esri53027> : Sphere Equidistant Conic
-<BR> <esri53028> : Sphere Cassini
-<BR> <esri53029> : Sphere Van der Grinten I
-<BR> <esri53030> : Sphere Robinson
-<BR> <esri53031> : Sphere Two Point Equidistant
-<BR> <esri53032> : Sphere Azimuthal Equidistant
-<BR> <esri54001> : World Plate Carree
-<BR> <esri54002> : World Equidistant Cylindrical
-<BR> <esri54003> : World Miller Cylindrical
-<BR> <esri54004> : World Mercator
-<BR> <esri54008> : World Sinusoidal
-<BR> <esri54009> : World Mollweide
-<BR> <esri54010> : World Eckert VI
-<BR> <esri54011> : World Eckert V
-<BR> <esri54012> : World Eckert IV
-<BR> <esri54013> : World Eckert III
-<BR> <esri54014> : World Eckert II
-<BR> <esri54015> : World Eckert I
-<BR> <esri54016> : World Gall Stereographic
-<BR> <esri54017> : World Behrmann
-<BR> <esri54018> : World Winkel I
-<BR> <esri54019> : World Winkel II
-<BR> <esri54021> : World Polyconic
-<BR> <esri54022> : World Quartic Authalic
-<BR> <esri54023> : World Loximuthal
-<BR> <esri54024> : World Bonne
-<BR> <esri54025> : World Hotine
-<BR> <esri54026> : World Stereographic
-<BR> <esri54027> : World Equidistant Conic
-<BR> <esri54028> : World Cassini
-<BR> <esri54029> : World Van der Grinten I
-<BR> <esri54030> : World Robinson
-<BR> <esri54031> : World Two Point Equidistant
-<BR> <esri54032> : World Azimuthal Equidistant
-<BR> <esri65061> : NAD 1927 StatePlane Guam FIPS 5400
-<BR> <esri65161> : NAD 1983 StatePlane Guam FIPS 5400
-<BR> <esri102001> : Canada Albers Equal Area Conic
-<BR> <esri102002> : Canada Lambert Conformal Conic
-<BR> <esri102003> : USA Contiguous Albers Equal Area Conic
-<BR> <esri102004> : USA Contiguous Lambert Conformal Conic
-<BR> <esri102005> : USA Contiguous Equidistant Conic
-<BR> <esri102006> : Alaska Albers Equal Area Conic
-<BR> <esri102007> : Hawaii Albers Equal Area Conic
-<BR> <esri102008> : North America Albers Equal Area Conic
-<BR> <esri102009> : North America Lambert Conformal Conic
-<BR> <esri102010> : North America Equidistant Conic
-<BR> <esri102011> : Africa Sinusoidal
-<BR> <esri102012> : Asia Lambert Conformal Conic
-<BR> <esri102013> : Europe Albers Equal Area Conic
-<BR> <esri102014> : Europe Lambert Conformal Conic
-<BR> <esri102015> : South America Lambert Conformal Conic
-<BR> <esri102016> : North Pole Azimuthal Equidistant
-<BR> <esri102017> : North Pole Lambert Azimuthal Equal Area
-<BR> <esri102018> : North Pole Stereographic
-<BR> <esri102019> : South Pole Azimuthal Equidistant
-<BR> <esri102020> : South Pole Lambert Azimuthal Equal Area
-<BR> <esri102021> : South Pole Stereographic
-<BR> <esri102022> : Africa Albers Equal Area Conic
-<BR> <esri102023> : Africa Equidistant Conic
-<BR> <esri102024> : Africa Lambert Conformal Conic
-<BR> <esri102025> : Asia North Albers Equal Area Conic
-<BR> <esri102026> : Asia North Equidistant Conic
-<BR> <esri102027> : Asia North Lambert Conformal Conic
-<BR> <esri102028> : Asia South Albers Equal Area Conic
-<BR> <esri102029> : Asia South Equidistant Conic
-<BR> <esri102030> : Asia South Lambert Conformal Conic
-<BR> <esri102031> : Europe Equidistant Conic
-<BR> <esri102032> : South America Equidistant Conic
-<BR> <esri102033> : South America Albers Equal Area Conic
-<BR> <esri102065> : S-JTSK Krovak
-<BR> <esri102066> : S-JTSK Ferro Krovak East North
-<BR> <esri102067> : S-JTSK Krovak East North
-<BR> <esri102091> : Monte Mario Italy 1
-<BR> <esri102092> : Monte Mario Italy 2
-<BR> <esri102101> : NGO 1948 Norway Zone 1
-<BR> <esri102102> : NGO 1948 Norway Zone 2
-<BR> <esri102103> : NGO 1948 Norway Zone 3
-<BR> <esri102104> : NGO 1948 Norway Zone 4
-<BR> <esri102105> : NGO 1948 Norway Zone 5
-<BR> <esri102106> : NGO 1948 Norway Zone 6
-<BR> <esri102107> : NGO 1948 Norway Zone 7
-<BR> <esri102108> : NGO 1948 Norway Zone 8
-<BR> <esri102110> : RGF 1993 Lambert 93
-<BR> <esri102114> : Old Hawaiian UTM Zone 4N
-<BR> <esri102115> : Old Hawaiian UTM Zone 5N
-<BR> <esri102120> : NAD 1927 Michigan GeoRef Feet US
-<BR> <esri102121> : NAD 1983 Michigan GeoRef Feet US
-<BR> <esri102122> : NAD 1927 Michigan GeoRef Meters
-<BR> <esri102123> : NAD 1983 Michigan GeoRef Meters
-<BR> <esri102132> : NGO 1948 UTM Zone 32N
-<BR> <esri102133> : NGO 1948 UTM Zone 33N
-<BR> <esri102134> : NGO 1948 UTM Zone 34N
-<BR> <esri102135> : NGO 1948 UTM Zone 35N
-<BR> <esri102140> : Hong Kong 1980 Grid
-<BR> <esri102141> : Hong Kong 1980 UTM Zone 49N
-<BR> <esri102142> : Hong Kong 1980 UTM Zone 50N
-<BR> <esri102151> : Tokyo UTM Zone 51N
-<BR> <esri102152> : Tokyo UTM Zone 52N
-<BR> <esri102153> : Tokyo UTM Zone 53N
-<BR> <esri102154> : Tokyo UTM Zone 54N
-<BR> <esri102155> : Tokyo UTM Zone 55N
-<BR> <esri102156> : Tokyo UTM Zone 56N
-<BR> <esri102160> : Datum 73 Hayford Gauss IGeoE
-<BR> <esri102161> : Datum 73 Hayford Gauss IPCC
-<BR> <esri102162> : Graciosa Base SW 1948 UTM Zone 26N
-<BR> <esri102163> : Lisboa Bessel Bonne
-<BR> <esri102164> : Lisboa Hayford Gauss IGeoE
-<BR> <esri102165> : Lisboa Hayford Gauss IPCC
-<BR> <esri102166> : Observ Meteorologico 1939 UTM Zone 25N
-<BR> <esri102167> : Porto Santo 1936 UTM Zone 28N
-<BR> <esri102168> : Sao Braz UTM Zone 26N
-<BR> <esri102169> : Selvagem Grande 1938 UTM Zone 28N
-<BR> <esri102191> : Nord Maroc Degree
-<BR> <esri102192> : Sud Maroc Degree
-<BR> <esri102193> : Sahara Degree
-<BR> <esri102229> : NAD 1983 HARN StatePlane Alabama East FIPS 0101
-<BR> <esri102230> : NAD 1983 HARN StatePlane Alabama West FIPS 0102
-<BR> <esri102241> : NAD 1983 HARN StatePlane California I FIPS 0401
-<BR> <esri102242> : NAD 1983 HARN StatePlane California II FIPS 0402
-<BR> <esri102243> : NAD 1983 HARN StatePlane California III FIPS 0403
-<BR> <esri102244> : NAD 1983 HARN StatePlane California IV FIPS 0404
-<BR> <esri102245> : NAD 1983 HARN StatePlane California V FIPS 0405
-<BR> <esri102246> : NAD 1983 HARN StatePlane California VI FIPS 0406
-<BR> <esri102248> : NAD 1983 HARN StatePlane Arizona East FIPS 0201
-<BR> <esri102249> : NAD 1983 HARN StatePlane Arizona Central FIPS 0202
-<BR> <esri102250> : NAD 1983 HARN StatePlane Arizona West FIPS 0203
-<BR> <esri102251> : NAD 1983 HARN StatePlane Arkansas North FIPS 0301
-<BR> <esri102252> : NAD 1983 HARN StatePlane Arkansas South FIPS 0302
-<BR> <esri102253> : NAD 1983 HARN StatePlane Colorado North FIPS 0501
-<BR> <esri102254> : NAD 1983 HARN StatePlane Colorado Central FIPS 0502
-<BR> <esri102255> : NAD 1983 HARN StatePlane Colorado South FIPS 0503
-<BR> <esri102256> : NAD 1983 HARN StatePlane Connecticut FIPS 0600
-<BR> <esri102257> : NAD 1983 HARN StatePlane Delaware FIPS 0700
-<BR> <esri102258> : NAD 1983 HARN StatePlane Florida East FIPS 0901
-<BR> <esri102259> : NAD 1983 HARN StatePlane Florida West FIPS 0902
-<BR> <esri102260> : NAD 1983 HARN StatePlane Florida North FIPS 0903
-<BR> <esri102261> : NAD 1983 HARN StatePlane Hawaii 1 FIPS 5101
-<BR> <esri102262> : NAD 1983 HARN StatePlane Hawaii 2 FIPS 5102
-<BR> <esri102263> : NAD 1983 HARN StatePlane Hawaii 3 FIPS 5103
-<BR> <esri102264> : NAD 1983 HARN StatePlane Hawaii 4 FIPS 5104
-<BR> <esri102265> : NAD 1983 HARN StatePlane Hawaii 5 FIPS 5105
-<BR> <esri102266> : NAD 1983 HARN StatePlane Georgia East FIPS 1001
-<BR> <esri102267> : NAD 1983 HARN StatePlane Georgia West FIPS 1002
-<BR> <esri102268> : NAD 1983 HARN StatePlane Idaho East FIPS 1101
-<BR> <esri102269> : NAD 1983 HARN StatePlane Idaho Central FIPS 1102
-<BR> <esri102270> : NAD 1983 HARN StatePlane Idaho West FIPS 1103
-<BR> <esri102271> : NAD 1983 HARN StatePlane Illinois East FIPS 1201
-<BR> <esri102272> : NAD 1983 HARN StatePlane Illinois West FIPS 1202
-<BR> <esri102273> : NAD 1983 HARN StatePlane Indiana East FIPS 1301
-<BR> <esri102274> : NAD 1983 HARN StatePlane Indiana West FIPS 1302
-<BR> <esri102277> : NAD 1983 HARN StatePlane Kansas North FIPS 1501
-<BR> <esri102278> : NAD 1983 HARN StatePlane Kansas South FIPS 1502
-<BR> <esri102279> : NAD 1983 HARN StatePlane Kentucky North FIPS 1601
-<BR> <esri102280> : NAD 1983 HARN StatePlane Kentucky South FIPS 1602
-<BR> <esri102281> : NAD 1983 HARN StatePlane Louisiana North FIPS 1701
-<BR> <esri102282> : NAD 1983 HARN StatePlane Louisiana South FIPS 1702
-<BR> <esri102283> : NAD 1983 HARN StatePlane Maine East FIPS 1801
-<BR> <esri102284> : NAD 1983 HARN StatePlane Maine West FIPS 1802
-<BR> <esri102285> : NAD 1983 HARN StatePlane Maryland FIPS 1900
-<BR> <esri102286> : NAD 1983 HARN StatePlane Massachusetts Mainland FIPS 2001
-<BR> <esri102287> : NAD 1983 HARN StatePlane Massachusetts Island FIPS 2002
-<BR> <esri102288> : NAD 1983 HARN StatePlane Michigan North FIPS 2111
-<BR> <esri102289> : NAD 1983 HARN StatePlane Michigan Central FIPS 2112
-<BR> <esri102290> : NAD 1983 HARN StatePlane Michigan South FIPS 2113
-<BR> <esri102291> : NAD 1983 HARN StatePlane Minnesota North FIPS 2201
-<BR> <esri102292> : NAD 1983 HARN StatePlane Minnesota Central FIPS 2202
-<BR> <esri102293> : NAD 1983 HARN StatePlane Minnesota South FIPS 2203
-<BR> <esri102294> : NAD 1983 HARN StatePlane Mississippi East FIPS 2301
-<BR> <esri102295> : NAD 1983 HARN StatePlane Mississippi West FIPS 2302
-<BR> <esri102296> : NAD 1983 HARN StatePlane Missouri East FIPS 2401
-<BR> <esri102297> : NAD 1983 HARN StatePlane Missouri Central FIPS 2402
-<BR> <esri102298> : NAD 1983 HARN StatePlane Missouri West FIPS 2403
-<BR> <esri102300> : NAD 1983 HARN StatePlane Montana FIPS 2500
-<BR> <esri102304> : NAD 1983 HARN StatePlane Nebraska FIPS 2600
-<BR> <esri102307> : NAD 1983 HARN StatePlane Nevada East FIPS 2701
-<BR> <esri102308> : NAD 1983 HARN StatePlane Nevada Central FIPS 2702
-<BR> <esri102309> : NAD 1983 HARN StatePlane Nevada West FIPS 2703
-<BR> <esri102310> : NAD 1983 HARN StatePlane New Hampshire FIPS 2800
-<BR> <esri102311> : NAD 1983 HARN StatePlane New Jersey FIPS 2900
-<BR> <esri102312> : NAD 1983 HARN StatePlane New Mexico East FIPS 3001
-<BR> <esri102313> : NAD 1983 HARN StatePlane New Mexico Central FIPS 3002
-<BR> <esri102314> : NAD 1983 HARN StatePlane New Mexico West FIPS 3003
-<BR> <esri102315> : NAD 1983 HARN StatePlane New York East FIPS 3101
-<BR> <esri102316> : NAD 1983 HARN StatePlane New York Central FIPS 3102
-<BR> <esri102317> : NAD 1983 HARN StatePlane New York West FIPS 3103
-<BR> <esri102318> : NAD 1983 HARN StatePlane New York Long Island FIPS 3104
-<BR> <esri102320> : NAD 1983 HARN StatePlane North Dakota North FIPS 3301
-<BR> <esri102321> : NAD 1983 HARN StatePlane North Dakota South FIPS 3302
-<BR> <esri102322> : NAD 1983 HARN StatePlane Ohio North FIPS 3401
-<BR> <esri102323> : NAD 1983 HARN StatePlane Ohio South FIPS 3402
-<BR> <esri102324> : NAD 1983 HARN StatePlane Oklahoma North FIPS 3501
-<BR> <esri102325> : NAD 1983 HARN StatePlane Oklahoma South FIPS 3502
-<BR> <esri102326> : NAD 1983 HARN StatePlane Oregon North FIPS 3601
-<BR> <esri102327> : NAD 1983 HARN StatePlane Oregon South FIPS 3602
-<BR> <esri102330> : NAD 1983 HARN StatePlane Rhode Island FIPS 3800
-<BR> <esri102334> : NAD 1983 HARN StatePlane South Dakota North FIPS 4001
-<BR> <esri102335> : NAD 1983 HARN StatePlane South Dakota South FIPS 4002
-<BR> <esri102336> : NAD 1983 HARN StatePlane Tennessee FIPS 4100
-<BR> <esri102337> : NAD 1983 HARN StatePlane Texas North FIPS 4201
-<BR> <esri102338> : NAD 1983 HARN StatePlane Texas North Central FIPS 4202
-<BR> <esri102339> : NAD 1983 HARN StatePlane Texas Central FIPS 4203
-<BR> <esri102340> : NAD 1983 HARN StatePlane Texas South Central FIPS 4204
-<BR> <esri102341> : NAD 1983 HARN StatePlane Texas South FIPS 4205
-<BR> <esri102342> : NAD 1983 HARN StatePlane Utah North FIPS 4301
-<BR> <esri102343> : NAD 1983 HARN StatePlane Utah Central FIPS 4302
-<BR> <esri102344> : NAD 1983 HARN StatePlane Utah South FIPS 4303
-<BR> <esri102345> : NAD 1983 HARN StatePlane Vermont FIPS 4400
-<BR> <esri102346> : NAD 1983 HARN StatePlane Virginia North FIPS 4501
-<BR> <esri102347> : NAD 1983 HARN StatePlane Virginia South FIPS 4502
-<BR> <esri102348> : NAD 1983 HARN StatePlane Washington North FIPS 4601
-<BR> <esri102349> : NAD 1983 HARN StatePlane Washington South FIPS 4602
-<BR> <esri102350> : NAD 1983 HARN StatePlane West Virginia North FIPS 4701
-<BR> <esri102351> : NAD 1983 HARN StatePlane West Virginia South FIPS 4702
-<BR> <esri102352> : NAD 1983 HARN StatePlane Wisconsin North FIPS 4801
-<BR> <esri102353> : NAD 1983 HARN StatePlane Wisconsin Central FIPS 4802
-<BR> <esri102354> : NAD 1983 HARN StatePlane Wisconsin South FIPS 4803
-<BR> <esri102355> : NAD 1983 HARN StatePlane Wyoming East FIPS 4901
-<BR> <esri102356> : NAD 1983 HARN StatePlane Wyoming East Central FIPS 4902
-<BR> <esri102357> : NAD 1983 HARN StatePlane Wyoming West Central FIPS 4903
-<BR> <esri102358> : NAD 1983 HARN StatePlane Wyoming West FIPS 4904
-<BR> <esri102361> : NAD 1983 HARN StatePlane Puerto Rico Virgin Islands FIPS 5200
-<BR> <esri102491> : Nord Algerie Ancienne Degree
-<BR> <esri102492> : Sud Algerie Ancienne Degree
-<BR> <esri102581> : NTF France I degrees
-<BR> <esri102582> : NTF France II degrees
-<BR> <esri102583> : NTF France III degrees
-<BR> <esri102584> : NTF France IV degrees
-<BR> <esri102591> : Nord Algerie Degree
-<BR> <esri102592> : Sud Algerie Degree
-<BR> <esri102629> : NAD 1983 StatePlane Alabama East FIPS 0101 Feet
-<BR> <esri102630> : NAD 1983 StatePlane Alabama West FIPS 0102 Feet
-<BR> <esri102631> : NAD 1983 StatePlane Alaska 1 FIPS 5001 Feet
-<BR> <esri102632> : NAD 1983 StatePlane Alaska 2 FIPS 5002 Feet
-<BR> <esri102633> : NAD 1983 StatePlane Alaska 3 FIPS 5003 Feet
-<BR> <esri102634> : NAD 1983 StatePlane Alaska 4 FIPS 5004 Feet
-<BR> <esri102635> : NAD 1983 StatePlane Alaska 5 FIPS 5005 Feet
-<BR> <esri102636> : NAD 1983 StatePlane Alaska 6 FIPS 5006 Feet
-<BR> <esri102637> : NAD 1983 StatePlane Alaska 7 FIPS 5007 Feet
-<BR> <esri102638> : NAD 1983 StatePlane Alaska 8 FIPS 5008 Feet
-<BR> <esri102639> : NAD 1983 StatePlane Alaska 9 FIPS 5009 Feet
-<BR> <esri102640> : NAD 1983 StatePlane Alaska 10 FIPS 5010 Feet
-<BR> <esri102641> : NAD 1983 StatePlane California I FIPS 0401 Feet
-<BR> <esri102642> : NAD 1983 StatePlane California II FIPS 0402 Feet
-<BR> <esri102643> : NAD 1983 StatePlane California III FIPS 0403 Feet
-<BR> <esri102644> : NAD 1983 StatePlane California IV FIPS 0404 Feet
-<BR> <esri102645> : NAD 1983 StatePlane California V FIPS 0405 Feet
-<BR> <esri102646> : NAD 1983 StatePlane California VI FIPS 0406 Feet
-<BR> <esri102648> : NAD 1983 StatePlane Arizona East FIPS 0201 Feet
-<BR> <esri102649> : NAD 1983 StatePlane Arizona Central FIPS 0202 Feet
-<BR> <esri102650> : NAD 1983 StatePlane Arizona West FIPS 0203 Feet
-<BR> <esri102651> : NAD 1983 StatePlane Arkansas North FIPS 0301 Feet
-<BR> <esri102652> : NAD 1983 StatePlane Arkansas South FIPS 0302 Feet
-<BR> <esri102653> : NAD 1983 StatePlane Colorado North FIPS 0501 Feet
-<BR> <esri102654> : NAD 1983 StatePlane Colorado Central FIPS 0502 Feet
-<BR> <esri102655> : NAD 1983 StatePlane Colorado South FIPS 0503 Feet
-<BR> <esri102656> : NAD 1983 StatePlane Connecticut FIPS 0600 Feet
-<BR> <esri102657> : NAD 1983 StatePlane Delaware FIPS 0700 Feet
-<BR> <esri102658> : NAD 1983 StatePlane Florida East FIPS 0901 Feet
-<BR> <esri102659> : NAD 1983 StatePlane Florida West FIPS 0902 Feet
-<BR> <esri102660> : NAD 1983 StatePlane Florida North FIPS 0903 Feet
-<BR> <esri102661> : NAD 1983 StatePlane Hawaii 1 FIPS 5101 Feet
-<BR> <esri102662> : NAD 1983 StatePlane Hawaii 2 FIPS 5102 Feet
-<BR> <esri102663> : NAD 1983 StatePlane Hawaii 3 FIPS 5103 Feet
-<BR> <esri102664> : NAD 1983 StatePlane Hawaii 4 FIPS 5104 Feet
-<BR> <esri102665> : NAD 1983 StatePlane Hawaii 5 FIPS 5105 Feet
-<BR> <esri102666> : NAD 1983 StatePlane Georgia East FIPS 1001 Feet
-<BR> <esri102667> : NAD 1983 StatePlane Georgia West FIPS 1002 Feet
-<BR> <esri102668> : NAD 1983 StatePlane Idaho East FIPS 1101 Feet
-<BR> <esri102669> : NAD 1983 StatePlane Idaho Central FIPS 1102 Feet
-<BR> <esri102670> : NAD 1983 StatePlane Idaho West FIPS 1103 Feet
-<BR> <esri102671> : NAD 1983 StatePlane Illinois East FIPS 1201 Feet
-<BR> <esri102672> : NAD 1983 StatePlane Illinois West FIPS 1202 Feet
-<BR> <esri102673> : NAD 1983 StatePlane Indiana East FIPS 1301 Feet
-<BR> <esri102674> : NAD 1983 StatePlane Indiana West FIPS 1302 Feet
-<BR> <esri102675> : NAD 1983 StatePlane Iowa North FIPS 1401 Feet
-<BR> <esri102676> : NAD 1983 StatePlane Iowa South FIPS 1402 Feet
-<BR> <esri102677> : NAD 1983 StatePlane Kansas North FIPS 1501 Feet
-<BR> <esri102678> : NAD 1983 StatePlane Kansas South FIPS 1502 Feet
-<BR> <esri102679> : NAD 1983 StatePlane Kentucky North FIPS 1601 Feet
-<BR> <esri102680> : NAD 1983 StatePlane Kentucky South FIPS 1602 Feet
-<BR> <esri102681> : NAD 1983 StatePlane Louisiana North FIPS 1701 Feet
-<BR> <esri102682> : NAD 1983 StatePlane Louisiana South FIPS 1702 Feet
-<BR> <esri102683> : NAD 1983 StatePlane Maine East FIPS 1801 Feet
-<BR> <esri102684> : NAD 1983 StatePlane Maine West FIPS 1802 Feet
-<BR> <esri102685> : NAD 1983 StatePlane Maryland FIPS 1900 Feet
-<BR> <esri102686> : NAD 1983 StatePlane Massachusetts Mainland FIPS 2001 Feet
-<BR> <esri102687> : NAD 1983 StatePlane Massachusetts Island FIPS 2002 Feet
-<BR> <esri102688> : NAD 1983 StatePlane Michigan North FIPS 2111 Feet
-<BR> <esri102689> : NAD 1983 StatePlane Michigan Central FIPS 2112 Feet
-<BR> <esri102690> : NAD 1983 StatePlane Michigan South FIPS 2113 Feet
-<BR> <esri102691> : NAD 1983 StatePlane Minnesota North FIPS 2201 Feet
-<BR> <esri102692> : NAD 1983 StatePlane Minnesota Central FIPS 2202 Feet
-<BR> <esri102693> : NAD 1983 StatePlane Minnesota South FIPS 2203 Feet
-<BR> <esri102694> : NAD 1983 StatePlane Mississippi East FIPS 2301 Feet
-<BR> <esri102695> : NAD 1983 StatePlane Mississippi West FIPS 2302 Feet
-<BR> <esri102696> : NAD 1983 StatePlane Missouri East FIPS 2401 Feet
-<BR> <esri102697> : NAD 1983 StatePlane Missouri Central FIPS 2402 Feet
-<BR> <esri102698> : NAD 1983 StatePlane Missouri West FIPS 2403 Feet
-<BR> <esri102700> : NAD 1983 StatePlane Montana FIPS 2500 Feet
-<BR> <esri102704> : NAD 1983 StatePlane Nebraska FIPS 2600 Feet
-<BR> <esri102707> : NAD 1983 StatePlane Nevada East FIPS 2701 Feet
-<BR> <esri102708> : NAD 1983 StatePlane Nevada Central FIPS 2702 Feet
-<BR> <esri102709> : NAD 1983 StatePlane Nevada West FIPS 2703 Feet
-<BR> <esri102710> : NAD 1983 StatePlane New Hampshire FIPS 2800 Feet
-<BR> <esri102711> : NAD 1983 StatePlane New Jersey FIPS 2900 Feet
-<BR> <esri102712> : NAD 1983 StatePlane New Mexico East FIPS 3001 Feet
-<BR> <esri102713> : NAD 1983 StatePlane New Mexico Central FIPS 3002 Feet
-<BR> <esri102714> : NAD 1983 StatePlane New Mexico West FIPS 3003 Feet
-<BR> <esri102715> : NAD 1983 StatePlane New York East FIPS 3101 Feet
-<BR> <esri102716> : NAD 1983 StatePlane New York Central FIPS 3102 Feet
-<BR> <esri102717> : NAD 1983 StatePlane New York West FIPS 3103 Feet
-<BR> <esri102718> : NAD 1983 StatePlane New York Long Island FIPS 3104 Feet
-<BR> <esri102719> : NAD 1983 StatePlane North Carolina FIPS 3200 Feet
-<BR> <esri102720> : NAD 1983 StatePlane North Dakota North FIPS 3301 Feet
-<BR> <esri102721> : NAD 1983 StatePlane North Dakota South FIPS 3302 Feet
-<BR> <esri102722> : NAD 1983 StatePlane Ohio North FIPS 3401 Feet
-<BR> <esri102723> : NAD 1983 StatePlane Ohio South FIPS 3402 Feet
-<BR> <esri102724> : NAD 1983 StatePlane Oklahoma North FIPS 3501 Feet
-<BR> <esri102725> : NAD 1983 StatePlane Oklahoma South FIPS 3502 Feet
-<BR> <esri102726> : NAD 1983 StatePlane Oregon North FIPS 3601 Feet
-<BR> <esri102727> : NAD 1983 StatePlane Oregon South FIPS 3602 Feet
-<BR> <esri102728> : NAD 1983 StatePlane Pennsylvania North FIPS 3701 Feet
-<BR> <esri102729> : NAD 1983 StatePlane Pennsylvania South FIPS 3702 Feet
-<BR> <esri102730> : NAD 1983 StatePlane Rhode Island FIPS 3800 Feet
-<BR> <esri102733> : NAD 1983 StatePlane South Carolina FIPS 3900 Feet
-<BR> <esri102734> : NAD 1983 StatePlane South Dakota North FIPS 4001 Feet
-<BR> <esri102735> : NAD 1983 StatePlane South Dakota South FIPS 4002 Feet
-<BR> <esri102736> : NAD 1983 StatePlane Tennessee FIPS 4100 Feet
-<BR> <esri102737> : NAD 1983 StatePlane Texas North FIPS 4201 Feet
-<BR> <esri102738> : NAD 1983 StatePlane Texas North Central FIPS 4202 Feet
-<BR> <esri102739> : NAD 1983 StatePlane Texas Central FIPS 4203 Feet
-<BR> <esri102740> : NAD 1983 StatePlane Texas South Central FIPS 4204 Feet
-<BR> <esri102741> : NAD 1983 StatePlane Texas South FIPS 4205 Feet
-<BR> <esri102742> : NAD 1983 StatePlane Utah North FIPS 4301 Feet
-<BR> <esri102743> : NAD 1983 StatePlane Utah Central FIPS 4302 Feet
-<BR> <esri102744> : NAD 1983 StatePlane Utah South FIPS 4303 Feet
-<BR> <esri102745> : NAD 1983 StatePlane Vermont FIPS 4400 Feet
-<BR> <esri102746> : NAD 1983 StatePlane Virginia North FIPS 4501 Feet
-<BR> <esri102747> : NAD 1983 StatePlane Virginia South FIPS 4502 Feet
-<BR> <esri102748> : NAD 1983 StatePlane Washington North FIPS 4601 Feet
-<BR> <esri102749> : NAD 1983 StatePlane Washington South FIPS 4602 Feet
-<BR> <esri102750> : NAD 1983 StatePlane West Virginia North FIPS 4701 Feet
-<BR> <esri102751> : NAD 1983 StatePlane West Virginia South FIPS 4702 Feet
-<BR> <esri102752> : NAD 1983 StatePlane Wisconsin North FIPS 4801 Feet
-<BR> <esri102753> : NAD 1983 StatePlane Wisconsin Central FIPS 4802 Feet
-<BR> <esri102754> : NAD 1983 StatePlane Wisconsin South FIPS 4803 Feet
-<BR> <esri102755> : NAD 1983 StatePlane Wyoming East FIPS 4901 Feet
-<BR> <esri102756> : NAD 1983 StatePlane Wyoming East Central FIPS 4902 Feet
-<BR> <esri102757> : NAD 1983 StatePlane Wyoming West Central FIPS 4903 Feet
-<BR> <esri102758> : NAD 1983 StatePlane Wyoming West FIPS 4904 Feet
-<BR> <esri102761> : NAD 1983 StatePlane Puerto Rico Virgin Islands FIPS 5200 Feet
-<BR> <esri102766> : NAD 1983 StatePlane Guam FIPS 5400 Feet
-<BR> <esri103300> : Belge Lambert 1972
-<BR> <esri4023> : GCS International 1967
-<BR> <esri4217> : GCS Bern 1898
-<BR> <esri4305> : GCS Voirol Unifie 1960
-<BR> <esri4404> : GCS Montserrat 1958
-<BR> <esri4812> : GCS Voirol Unifie 1960 Paris
-<BR> <esri37001> : GCS WGS 1966
-<BR> <esri37002> : GCS Fischer 1960
-<BR> <esri37003> : GCS Fischer 1968
-<BR> <esri37004> : GCS Fischer Modified
-<BR> <esri37005> : GCS Hough 1960
-<BR> <esri37006> : GCS Everest Modified 1969
-<BR> <esri37007> : GCS Walbeck
-<BR> <esri37008> : GCS Sphere ARC INFO
-<BR> <esri37201> : GCS European 1979
-<BR> <esri37202> : GCS Everest Bangladesh
-<BR> <esri37203> : GCS Everest India Nepal
-<BR> <esri37204> : GCS Hjorsey 1955
-<BR> <esri37205> : GCS Hong Kong 1963
-<BR> <esri37206> : GCS Oman
-<BR> <esri37207> : GCS South Asia Singapore
-<BR> <esri37208> : GCS Ayabelle
-<BR> <esri37211> : GCS Point 58
-<BR> <esri37212> : GCS Beacon E 1945
-<BR> <esri37213> : GCS Tern Island 1961
-<BR> <esri37214> : GCS Astro 1952
-<BR> <esri37215> : GCS Bellevue IGN
-<BR> <esri37216> : GCS Canton 1966
-<BR> <esri37217> : GCS Chatham Island 1971
-<BR> <esri37218> : GCS DOS 1968
-<BR> <esri37219> : GCS Easter Island 1967
-<BR> <esri37220> : GCS Guam 1963
-<BR> <esri37221> : GCS GUX 1
-<BR> <esri37222> : GCS Johnston Island 1961
-<BR> <esri37223> : GCS Carthage Degree
-<BR> <esri37224> : GCS Midway 1961
-<BR> <esri37226> : GCS Pitcairn 1967
-<BR> <esri37227> : GCS Santo DOS 1965
-<BR> <esri37228> : GCS Viti Levu 1916
-<BR> <esri37229> : GCS Wake Eniwetok 1960
-<BR> <esri37230> : GCS Wake Island 1952
-<BR> <esri37231> : GCS Anna 1 1965
-<BR> <esri37232> : GCS Gan 1970
-<BR> <esri37233> : GCS ISTS 073 1969
-<BR> <esri37234> : GCS Kerguelen Island 1949
-<BR> <esri37235> : GCS Reunion
-<BR> <esri37237> : GCS Ascension Island 1958
-<BR> <esri37238> : GCS DOS 71 4
-<BR> <esri37239> : GCS Cape Canaveral
-<BR> <esri37240> : GCS Fort Thomas 1955
-<BR> <esri37241> : GCS Graciosa Base SW 1948
-<BR> <esri37242> : GCS ISTS 061 1968
-<BR> <esri37243> : GCS LC5 1961
-<BR> <esri37245> : GCS Observ Meteorologico 1939
-<BR> <esri37246> : GCS Pico de Las Nieves
-<BR> <esri37247> : GCS Porto Santo 1936
-<BR> <esri37249> : GCS Sao Braz
-<BR> <esri37250> : GCS Selvagem Grande 1938
-<BR> <esri37251> : GCS Tristan 1968
-<BR> <esri37252> : GCS Samoa 1962
-<BR> <esri37253> : GCS Camp Area
-<BR> <esri37254> : GCS Deception Island
-<BR> <esri37255> : GCS Gunung Segara
-<BR> <esri37257> : GCS S42 Hungary
-<BR> <esri37259> : GCS Kusaie 1951
-<BR> <esri37260> : GCS Alaskan Islands
-<BR> <esri104000> : GCS Assumed Geographic 1
-<BR> <esri104101> : GCS Estonia 1937
-<BR> <esri104102> : GCS Hermannskogel
-<BR> <esri104103> : GCS Sierra Leone 1960
-<BR> <esri104104> : GCS Hong Kong 1980
-<BR> <esri104105> : GCS Datum Lisboa Bessel
-<BR> <esri104106> : GCS Datum Lisboa Hayford
-<BR> <esri104107> : GCS RGF 1993
-<BR> <esri104108> : GCS NZGD 2000
-<BR> <esri104261> : GCS Merchich Degree
-<BR> <esri104304> : GCS Voirol 1875 Degree
-<BR> <esri104305> : GCS Voirol Unifie 1960 Degree
-<P>
-<BR> ---------------------------------------------------------
-<BR> Google mercator
-<BR> ---------------------------------------------------------
-<BR> <900913> Chris' funny epsgish code for the google mercator
-<P>
-<BR> ---------------------------------------------------------
-<BR> IGNF (French Mapping Agency) projection definitions
-<BR> ---------------------------------------------------------
-<BR> <ANAA92> : MOP92 (Anaa) Tuamotu
-<BR> <APAT86> : MOP86 (Apataki, Rapa, Hao) Tuamotu
-<BR> <ATI> : Ancienne Triangulation des Ingenieurs
-<BR> <CAD97> : Cadastre 1997
-<BR> <CIOBIH> : CIO-BIH
-<BR> <CROZ63> : Crozet 1963
-<BR> <CSG67> : Guyane CSG67
-<BR> <ED50> : ED50
-<BR> <EFATE57> : EFATE-IGN 1957
-<BR> <FANGA84> : MOP84 (Fangataufa 1984)
-<BR> <GUAD48> : Guadeloupe Ste Anne
-<BR> <GUADFM49> : Guadeloupe Fort Marigot
-<BR> <IGN63> : IGN 1963 (Hiva Oa, Tahuata, Mohotani)
-<BR> <IGN72> : IGN 1972 Grande-Terre / Ile des Pins
-<BR> <KAUE70> : MHPF70 (Kauehi) Tuamotu
-<BR> <KERG62CAR> : Kerguelen - K0
-<BR> <LIFOU56> : Lifou - Iles Loyaute (IGN56)
-<BR> <LUREF> : Nouvelle Triangulation du Grand Duche du Luxembourg
-<BR> <MARE53> : Mare - Iles Loyaute (IGN53)
-<BR> <MARQUI72> : IGN 1972 (Eiao, Hiva Oa, Mohotani) Marquises
-<BR> <MART38> : Martinique Fort-Desaix
-<BR> <MAYO50> : Mayotte Combani
-<BR> <MHEFO55F> : MHEFO 1955 (Fatu Huku)
-<BR> <MHPF67> : MHPF67 (Mangareva, Agakauitai, Aukena, Mekiro) Gambiers (Iles)
-<BR> <MOOREA87> : Moorea 1987
-<BR> <MOP90> : MOP90 (Tetiaroa) Iles de la Societe
-<BR> <NTF> : Nouvelle Triangulation Francaise
-<BR> <NUKU72> : IGN 1972 Nuku Hiva
-<BR> <NUKU94> : SAT94 (Nukutavake) Tuamotu
-<BR> <OUVEA72CAR> : Ouvea - Iles Loyaute (MHNC 1972 - OUVEA)
-<BR> <PETRELS72> : Petrels - IGN 1972
-<BR> <RAIA53> : IGN53 (IGN Raiatea-Tahaa) Raiatea-Tahaa-Bora Bora-Huahine
-<BR> <REUN47> : Reunion 1947
-<BR> <RGF93> : Reseau geodesique francais 1993
-<BR> <RGFG95> : Reseau geodesique francais de Guyane 1995
-<BR> <RGM04> : RGM04 (Reseau Geodesique de Mayotte 2004)
-<BR> <RGNC> : Reseau Geodesique de Nouvelle-Caledonie
-<BR> <RGPF> : RGPF (Reseau Geodesique de Polynesie Francaise)
-<BR> <RGR92> : Reseau geodesique Reunion 1992
-<BR> <RGSPM06> : Reseau Geodesique Saint-Pierre-et-Miquelon (2006)
-<BR> <RRAF91> : RRAF 1991 (Reseau de Reference des Antilles Francaises)
-<BR> <SAT84> : SAT84 (Rurutu) Iles Australes
-<BR> <SHOM84> : SHOM 1984 Martinique Montagne Du Vauclin
-<BR> <STPM50> : St Pierre et Miquelon 1950
-<BR> <TAHAA> : Raiatea - Tahaa 51-54 (Tahaa, Base Terme Est)
-<BR> <TAHI51> : Tahiti-Terme Nord 1951
-<BR> <TAHI79> : IGN79 (Tahiti) Iles de la Societe
-<BR> <TANNA> : Tanna Bloc Sud
-<BR> <TERA50> : Pointe Geologie - Perroud 1950
-<BR> <TUBU69> : MHPF 1969 (Tubuai) Iles Australes
-<BR> <WALL78> : Wallis-Uvea 1978 (MOP78)
-<BR> <WGS72> : World Geodetic System 1972
-<BR> <WGS84> : World Geodetic System 1984
-<BR> <ANAA92GEO> : MOP92 (Anaa) Tuamotu
-<BR> <APAT86GEO> : MOP86 (Apataki, Rapa, Hao) Tuamotu
-<BR> <ATIGEO> : Ancienne Triangulation des Ingenieurs
-<BR> <CAD97GEO> : Cadastre 1997
-<BR> <CROZ63GEO> : Crozet 1963
-<BR> <CSG67GEO> : Guyane CSG67 UTM fuseau 21
-<BR> <ED50G> : ED50
-<BR> <EFATE57GEO> : EFATE-IGN 1957
-<BR> <FANGA84GEO> : MOP84 (Fangataufa 1984)
-<BR> <GUAD48GEO> : Guadeloupe Ste Anne
-<BR> <GUADFM49GEO> : Guadeloupe Fort Marigot
-<BR> <IGN63GEO> : IGN 1963 (Hiva Oa, Tahuata, Mohotani)
-<BR> <IGN72GEO> : IGN 1972 Grande-Terre / Ile des Pins
-<BR> <KAUE70GEO> : MHPF70 (Kauehi) Tuamotu
-<BR> <KERG62GEO> : Kerguelen - K0
-<BR> <LIFOU56GEO> : Lifou - Iles Loyaute (IGN56)
-<BR> <LUXGEO> : Nouvelle Triangulation du Grand Duche du Luxembourg
-<BR> <MARE53GEO> : Mare - Iles Loyaute (IGN53)
-<BR> <MARQUI72GEO> : IGN 1972 (Eiao, Hiva Oa, Mohotani) Marquises
-<BR> <MART38GEO> : Martinique Fort-Desaix
-<BR> <MAYO50GEO> : Mayotte Combani
-<BR> <MHEFO55FGEO> : MHEFO 1955 (Fatu Huku)
-<BR> <MHPF67GEO> : MHPF67 (Mangareva, Agakauitai, Aukena, Mekiro) Gambiers (Iles)
-<BR> <MOOREA87GEO> : Moorea 1987
-<BR> <MOP90GEO> : MOP90 (Tetiaroa) Iles de la Societe
-<BR> <NTFG> : Nouvelle Triangulation Francaise Greenwich degres sexagesimaux
-<BR> <NTFP> : Nouvelle Triangulation Francaise Paris grades
-<BR> <NUKU72GEO> : IGN 1972 Nuku Hiva
-<BR> <NUKU94GEO> : SAT94 (Nukutavake) Tuamotu
-<BR> <OUVEA72GEO> : Ouvea - Iles Loyaute (MHNC 1972 - OUVEA)
-<BR> <RAIA53GEO> : IGN53 (IGN Raiatea-Tahaa) Raiatea-Tahaa-Bora Bora-Huahine
-<BR> <REUN47GEO> : Reunion 1947
-<BR> <RGF93G> : Reseau geodesique francais 1993
-<BR> <RGFG95GEO> : Reseau geodesique francais de Guyane 1995
-<BR> <RGM04GEO> : RGM04 (Reseau Geodesique de Mayotte 2004)
-<BR> <RGNCGEO> : Reseau Geodesique de Nouvelle-Caledonie
-<BR> <RGPFGEO> : RGPF (Reseau Geodesique de Polynesie Francaise)
-<BR> <RGR92GEO> : Reseau geodesique de la Reunion 1992
-<BR> <RGSPM06GEO> : Saint-Pierre-et-Miquelon (2006)
-<BR> <SAT84GEO> : SAT84 (Rurutu) Iles Australes
-<BR> <SHOM84GEO> : SHOM 1984 Martinique Montagne Du Vauclin
-<BR> <STPM50GEO> : St Pierre et Miquelon 1950
-<BR> <TAHAAGEO> : Raiatea - Tahaa 51-54 (Tahaa, Base Terme Est)
-<BR> <TAHI51GEO> : Tahiti-Terme Nord 1951
-<BR> <TAHI79GEO> : IGN79 (Tahiti) Iles de la Societe
-<BR> <TANNAGEO> : Tanna Bloc Sud
-<BR> <TERA50GEO> : Pointe Geologie - Perroud 1950
-<BR> <TUBU69GEO> : MHPF 1969 (Tubuai) Iles Australes
-<BR> <WALL78GEO> : Wallis - Uvea 1978 (MOP78)
-<BR> <WGS72G> : WGS72
-<BR> <WGS84G> : World Geodetic System 1984
-<BR> <WGS84RRAFGEO> : Reseau de reference des Antilles francaises (1988-1991)
-<BR> <XGEO> : Systeme CIO-BIH
-<BR> <ANAA92UTM6S> : MOP92 (Anaa) Tuamotu - UTM fuseau 6 Sud
-<BR> <APAT86UTM6S> : MOP86 (Apataki, Rapa, Hao) Tuamotu - UTM fuseau 6 Sud
-<BR> <APAT86UTM7S> : MOP86 (Apataki, Rapa, Hao) Tuamotu - UTM fuseau 7 Sud
-<BR> <CAD97UTM38S> : Cadastre 1997 - UTM fuseau 38 Sud
-<BR> <CROZ63UTM39S> : Crozet 1963
-<BR> <CSG67UTM21> : Guyane CSG67 UTM fuseau 21
-<BR> <CSG67UTM22> : Guyane CSG67 UTM fuseau 22
-<BR> <EFATE57UT59S> : EFATE-IGN 1957 - UTM fuseau 59 Sud
-<BR> <FANGA84UTM7S> : Fangataufa 1984 - UTM fuseau 7 Sud
-<BR> <GEOPORTALANF> : Geoportail - Antilles francaises
-<BR> <GEOPORTALCRZ> : Geoportail - Crozet
-<BR> <GEOPORTALFXX> : Geoportail - France metropolitaine
-<BR> <GEOPORTALGUF> : Geoportail - Guyane
-<BR> <GEOPORTALKER> : Geoportail - Kerguelen
-<BR> <GEOPORTALMYT> : Geoportail - Mayotte
-<BR> <GEOPORTALNCL> : Geoportail - Nouvelle-Caledonie
-<BR> <GEOPORTALPYF> : Geoportail - Polynesie francaise
-<BR> <GEOPORTALREU> : Geoportail - Reunion et dependances
-<BR> <GEOPORTALSPM> : Geoportail - Saint-Pierre et Miquelon
-<BR> <GEOPORTALWLF> : Geoportail - Wallis et Futuna
-<BR> <GUAD48UTM20> : Guadeloupe Ste Anne
-<BR> <GUADFM49U20> : Guadeloupe Fort Marigot
-<BR> <IGN63UTM7S> : IGN 1963 - Hiva Oa, Tahuata, Mohotani - UTM fuseau 7 Sud
-<BR> <IGN72LAM> : IGN 1972 - Lambert Nouvelle Caledonie
-<BR> <IGN72UTM58S> : IGN 1972 - UTM fuseau 58 Sud
-<BR> <KAUE70UTM6S> : MHPF70 (Kauehi) Tuamotu - UTM fuseau 6 Sud
-<BR> <KERG62UTM42S> : Kerguelen 1962
-<BR> <LAMB1> : Lambert I
-<BR> <LAMB1C> : Lambert I Carto
-<BR> <LAMB2> : Lambert II
-<BR> <LAMB2C> : Lambert II Carto
-<BR> <LAMB3> : Lambert III
-<BR> <LAMB3C> : Lambert III Carto
-<BR> <LAMB4> : Lambert IV
-<BR> <LAMB4C> : Lambert IV Carto
-<BR> <LAMB93> : Lambert 93
-<BR> <LAMBE> : Lambert II etendu
-<BR> <LAMBGC> : Lambert grand champ
-<BR> <LUXGAUSSK> : Luxembourg 1929
-<BR> <MARE53UTM58S> : Mare - Iles Loyaute - UTM fuseau 58 Sud
-<BR> <MART38UTM20> : Martinique Fort-Desaix
-<BR> <MAYO50UTM38S> : Mayotte Combani
-<BR> <MHPF67UTM8S> : MHPF67 (Mangareva, Agakauitai, Aukena, Mekiro) Gambiers (Iles) - UTM 8 S
-<BR> <MILLER> : Geoportail - Monde
-<BR> <MOOREA87U6S> : Moorea 1987 - UTM fuseau 6 Sud
-<BR> <MOP90UTM6S> : MOP90 (Tetiaroa) Iles de la Societe - UTM fuseau 6 Sud
-<BR> <NUKU72U7S> : IGN 1972 Nuku Hiva - UTM fuseau 7 Sud
-<BR> <NUKU94UTM7S> : IGN 1994 Nuku Hiva - UTM fuseau 7 Sud
-<BR> <OUVEA72U58S> : Ouvea - Iles Loyaute - UTM fuseau 58 Sud
-<BR> <RAIA53UTM5S> : IGN53 (IGN Raiatea-Tahaa) Raiatea-Tahaa-Bora Bora-Huahine - UTM fuseau 5
-<BR> <REUN47GAUSSL> : Reunion Gauss Laborde
-<BR> <RGF93CC42> : Projection conique conforme Zone 1
-<BR> <RGF93CC43> : Projection conique conforme Zone 2
-<BR> <RGF93CC44> : Projection conique conforme Zone 3
-<BR> <RGF93CC45> : Projection conique conforme Zone 4
-<BR> <RGF93CC46> : Projection conique conforme Zone 5
-<BR> <RGF93CC47> : Projection conique conforme Zone 6
-<BR> <RGF93CC48> : Projection conique conforme Zone 7
-<BR> <RGF93CC49> : Projection conique conforme Zone 8
-<BR> <RGF93CC50> : Projection conique conforme Zone 9
-<BR> <RGM04UTM38S> : UTM fuseau 38 Sud (Reseau Geodesique de Mayotte 2004)
-<BR> <RGNCLAM> : Reseau Geodesique de Nouvelle-Caledonie - Lambert Nouvelle Caledonie
-<BR> <RGNCUTM57S> : Reseau Geodesique de Nouvelle-Caledonie - UTM fuseau 57 Sud
-<BR> <RGNCUTM58S> : Reseau Geodesique de Nouvelle-Caledonie - UTM fuseau 58 Sud
-<BR> <RGNCUTM59S> : Reseau Geodesique de Nouvelle-Caledonie - UTM fuseau 59 Sud
-<BR> <RGPFUTM5S> : RGPF - UTM fuseau 5 Sud
-<BR> <RGPFUTM6S> : RGPF - UTM fuseau 6 Sud
-<BR> <RGPFUTM7S> : RGPF - UTM fuseau 7 Sud
-<BR> <RGR92UTM40S> : RGR92 UTM fuseau 40 Sud
-<BR> <RGSPM06U21> : Saint-Pierre-et-Miquelon (2006) UTM Fuseau 21 Nord
-<BR> <SAT84UTM5S> : SAT84 (Rurutu) Iles Australes - UTM fuseau 5 Sud
-<BR> <STEREOSX> : Stereographique polaire Sud
-<BR> <STPM50UTM21> : St Pierre et Miquelon 1950
-<BR> <TAHAAUTM05S> : Tahaa 1951
-<BR> <TAHI51UTM06S> : Tahiti-Terme Nord UTM fuseau 6 Sud
-<BR> <TAHI79UTM6S> : Tahiti 1979
-<BR> <TANNAUTM59S> : Tanna Bloc Sud - UTM fuseau 59 Sud
-<BR> <TERA50SPTA> : Terre Adelie Stereo polaire Terre Adelie
-<BR> <TERA50STEREO> : Terre Adelie 1950
-<BR> <TUBU69UTM6S> : Tubuai - Iles Australes - UTM fuseau 6 Sud
-<BR> <UTM01SW72> : World Geodetic System 1972 UTM fuseau 01 Sud
-<BR> <UTM01SW84> : World Geodetic System 1984 UTM fuseau 01 Sud
-<BR> <UTM01W84> : World Geodetic System 1984 UTM fuseau 01
-<BR> <UTM02SW84> : World Geodetic System 1984 UTM fuseau 02 Sud
-<BR> <UTM02W84> : World Geodetic System 1984 UTM fuseau 02
-<BR> <UTM03SW84> : World Geodetic System 1984 UTM fuseau 03 Sud
-<BR> <UTM03W84> : World Geodetic System 1984 UTM fuseau 03
-<BR> <UTM04SW84> : World Geodetic System 1984 UTM fuseau 04 Sud
-<BR> <UTM04W84> : World Geodetic System 1984 UTM fuseau 04
-<BR> <UTM05SW84> : World Geodetic System 1984 UTM fuseau 05 Sud
-<BR> <UTM05W84> : World Geodetic System 1984 UTM fuseau 05
-<BR> <UTM06SW84> : World Geodetic System 1984 UTM fuseau 06 Sud
-<BR> <UTM06W84> : World Geodetic System 1984 UTM fuseau 06
-<BR> <UTM07SW84> : World Geodetic System 1984 UTM fuseau 07 Sud
-<BR> <UTM07W84> : World Geodetic System 1984 UTM fuseau 07
-<BR> <UTM08SW84> : World Geodetic System 1984 UTM fuseau 08 Sud
-<BR> <UTM08W84> : World Geodetic System 1984 UTM fuseau 08
-<BR> <UTM09SW84> : World Geodetic System 1984 UTM fuseau 09 Sud
-<BR> <UTM09W84> : World Geodetic System 1984 UTM fuseau 09
-<BR> <UTM10SW84> : World Geodetic System 1984 UTM fuseau 10 Sud
-<BR> <UTM10W84> : World Geodetic System 1984 UTM fuseau 10
-<BR> <UTM11SW84> : World Geodetic System 1984 UTM fuseau 11 Sud
-<BR> <UTM11W84> : World Geodetic System 1984 UTM fuseau 11
-<BR> <UTM12SW84> : World Geodetic System 1984 UTM fuseau 12 Sud
-<BR> <UTM12W84> : World Geodetic System 1984 UTM fuseau 12
-<BR> <UTM13SW84> : World Geodetic System 1984 UTM fuseau 13 Sud
-<BR> <UTM13W84> : World Geodetic System 1984 UTM fuseau 13
-<BR> <UTM14SW84> : World Geodetic System 1984 UTM fuseau 14 Sud
-<BR> <UTM14W84> : World Geodetic System 1984 UTM fuseau 14
-<BR> <UTM15SW84> : World Geodetic System 1984 UTM fuseau 15 Sud
-<BR> <UTM15W84> : World Geodetic System 1984 UTM fuseau 15
-<BR> <UTM16SW84> : World Geodetic System 1984 UTM fuseau 16 Sud
-<BR> <UTM16W84> : World Geodetic System 1984 UTM fuseau 16
-<BR> <UTM17SW84> : World Geodetic System 1984 UTM fuseau 17 Sud
-<BR> <UTM17W84> : World Geodetic System 1984 UTM fuseau 17
-<BR> <UTM18SW84> : World Geodetic System 1984 UTM fuseau 18 Sud
-<BR> <UTM18W84> : World Geodetic System 1984 UTM fuseau 18
-<BR> <UTM19SW84> : World Geodetic System 1984 UTM fuseau 19 Sud
-<BR> <UTM19W84> : World Geodetic System 1984 UTM fuseau 19
-<BR> <UTM20SW84> : World Geodetic System 1984 UTM fuseau 20 Sud
-<BR> <UTM20W84> : World Geodetic System 1984 UTM fuseau 20
-<BR> <UTM20W84GUAD> : World Geodetic System 1984 UTM fuseau 20 Nord-Guadeloupe
-<BR> <UTM20W84MART> : World Geodetic System 1984 UTM fuseau 20 Nord-Martinique
-<BR> <UTM21SW84> : World Geodetic System 1984 UTM fuseau 21 Sud
-<BR> <UTM21W84> : World Geodetic System 1984 UTM fuseau 21
-<BR> <UTM22RGFG95> : RGFG95 UTM fuseau 22 Nord-Guyane
-<BR> <UTM22SW84> : World Geodetic System 1984 UTM fuseau 22 Sud
-<BR> <UTM22W84> : World Geodetic System 1984 UTM fuseau 22
-<BR> <UTM23SW84> : World Geodetic System 1984 UTM fuseau 23 Sud
-<BR> <UTM23W84> : World Geodetic System 1984 UTM fuseau 23
-<BR> <UTM24SW84> : World Geodetic System 1984 UTM fuseau 24 Sud
-<BR> <UTM24W84> : World Geodetic System 1984 UTM fuseau 24
-<BR> <UTM25SW84> : World Geodetic System 1984 UTM fuseau 25 Sud
-<BR> <UTM25W84> : World Geodetic System 1984 UTM fuseau 25
-<BR> <UTM26SW84> : World Geodetic System 1984 UTM fuseau 26 Sud
-<BR> <UTM26W84> : World Geodetic System 1984 UTM fuseau 26
-<BR> <UTM27SW84> : World Geodetic System 1984 UTM fuseau 27 Sud
-<BR> <UTM27W84> : World Geodetic System 1984 UTM fuseau 27
-<BR> <UTM28SW84> : World Geodetic System 1984 UTM fuseau 28 Sud
-<BR> <UTM28W84> : World Geodetic System 1984 UTM fuseau 28
-<BR> <UTM29SW84> : World Geodetic System 1984 UTM fuseau 29 Sud
-<BR> <UTM29W84> : World Geodetic System 1984 UTM fuseau 29
-<BR> <UTM30> : European Datum 1950 UTM fuseau 30
-<BR> <UTM30RGF93> : RGF93 UTM fuseau 30
-<BR> <UTM30SW84> : World Geodetic System 1984 UTM fuseau 30 Sud
-<BR> <UTM30W72> : World Geodetic System 1972 UTM fuseau 30
-<BR> <UTM30W84> : World Geodetic System 1984 UTM fuseau 30
-<BR> <UTM31> : European Datum 1950 UTM fuseau 31
-<BR> <UTM31RGF93> : RGF93 UTM fuseau 31
-<BR> <UTM31SW84> : World Geodetic System 1984 UTM fuseau 31 Sud
-<BR> <UTM31W72> : World Geodetic System 1972 UTM fuseau 31
-<BR> <UTM31W84> : World Geodetic System 1984 UTM fuseau 31
-<BR> <UTM32> : European Datum 1950 UTM fuseau 32
-<BR> <UTM32RGF93> : RGF93 UTM fuseau 32
-<BR> <UTM32SW84> : World Geodetic System 1984 UTM fuseau 32 Sud
-<BR> <UTM32W72> : World Geodetic System 1972 UTM fuseau 32
-<BR> <UTM32W84> : World Geodetic System 1984 UTM fuseau 32
-<BR> <UTM33SW84> : World Geodetic System 1984 UTM fuseau 33 Sud
-<BR> <UTM33W84> : World Geodetic System 1984 UTM fuseau 33
-<BR> <UTM34SW84> : World Geodetic System 1984 UTM fuseau 34 Sud
-<BR> <UTM34W84> : World Geodetic System 1984 UTM fuseau 34
-<BR> <UTM35SW84> : World Geodetic System 1984 UTM fuseau 35 Sud
-<BR> <UTM35W84> : World Geodetic System 1984 UTM fuseau 35
-<BR> <UTM36SW84> : World Geodetic System 1984 UTM fuseau 36 Sud
-<BR> <UTM36W84> : World Geodetic System 1984 UTM fuseau 36
-<BR> <UTM37SW84> : World Geodetic System 1984 UTM fuseau 37 Sud
-<BR> <UTM37W84> : World Geodetic System 1984 UTM fuseau 37
-<BR> <UTM38SW84> : World Geodetic System 1984 UTM fuseau 38 Sud
-<BR> <UTM38W84> : World Geodetic System 1984 UTM fuseau 38
-<BR> <UTM39SW84> : World Geodetic System 1984 UTM fuseau 39 Sud
-<BR> <UTM39W84> : World Geodetic System 1984 UTM fuseau 39
-<BR> <UTM40SW84> : World Geodetic System 1984 UTM fuseau 40 Sud
-<BR> <UTM40W84> : World Geodetic System 1984 UTM fuseau 40
-<BR> <UTM41SW84> : World Geodetic System 1984 UTM fuseau 41 Sud
-<BR> <UTM41W84> : World Geodetic System 1984 UTM fuseau 41
-<BR> <UTM42SW84> : World Geodetic System 1984 UTM fuseau 42 Sud
-<BR> <UTM42W84> : World Geodetic System 1984 UTM fuseau 42
-<BR> <UTM43SW84> : World Geodetic System 1984 UTM fuseau 43 Sud
-<BR> <UTM43W84> : World Geodetic System 1984 UTM fuseau 43
-<BR> <UTM44SW84> : World Geodetic System 1984 UTM fuseau 44 Sud
-<BR> <UTM44W84> : World Geodetic System 1984 UTM fuseau 44
-<BR> <UTM45SW84> : World Geodetic System 1984 UTM fuseau 45 Sud
-<BR> <UTM45W84> : World Geodetic System 1984 UTM fuseau 45
-<BR> <UTM46SW84> : World Geodetic System 1984 UTM fuseau 46 Sud
-<BR> <UTM46W84> : World Geodetic System 1984 UTM fuseau 46
-<BR> <UTM47SW84> : World Geodetic System 1984 UTM fuseau 47 Sud
-<BR> <UTM47W84> : World Geodetic System 1984 UTM fuseau 47
-<BR> <UTM48SW84> : World Geodetic System 1984 UTM fuseau 48 Sud
-<BR> <UTM48W84> : World Geodetic System 1984 UTM fuseau 48
-<BR> <UTM49SW84> : World Geodetic System 1984 UTM fuseau 49 Sud
-<BR> <UTM49W84> : World Geodetic System 1984 UTM fuseau 49
-<BR> <UTM50SW84> : World Geodetic System 1984 UTM fuseau 50 Sud
-<BR> <UTM50W84> : World Geodetic System 1984 UTM fuseau 50
-<BR> <UTM51SW84> : World Geodetic System 1984 UTM fuseau 51 Sud
-<BR> <UTM51W84> : World Geodetic System 1984 UTM fuseau 51
-<BR> <UTM52SW84> : World Geodetic System 1984 UTM fuseau 52 Sud
-<BR> <UTM52W84> : World Geodetic System 1984 UTM fuseau 52
-<BR> <UTM53SW84> : World Geodetic System 1984 UTM fuseau 53 Sud
-<BR> <UTM53W84> : World Geodetic System 1984 UTM fuseau 53
-<BR> <UTM54SW84> : World Geodetic System 1984 UTM fuseau 54 Sud
-<BR> <UTM54W84> : World Geodetic System 1984 UTM fuseau 54
-<BR> <UTM55SW84> : World Geodetic System 1984 UTM fuseau 55 Sud
-<BR> <UTM55W84> : World Geodetic System 1984 UTM fuseau 55
-<BR> <UTM56SW84> : World Geodetic System 1984 UTM fuseau 56 Sud
-<BR> <UTM56W84> : World Geodetic System 1984 UTM fuseau 56
-<BR> <UTM57SW84> : World Geodetic System 1984 UTM fuseau 57 Sud
-<BR> <UTM57W84> : World Geodetic System 1984 UTM fuseau 57
-<BR> <UTM58SW84> : World Geodetic System 1984 UTM fuseau 58 Sud
-<BR> <UTM58W84> : World Geodetic System 1984 UTM fuseau 58
-<BR> <UTM59SW84> : World Geodetic System 1984 UTM fuseau 59 Sud
-<BR> <UTM59W84> : World Geodetic System 1984 UTM fuseau 59
-<BR> <UTM60SW84> : World Geodetic System 1984 UTM fuseau 60 Sud
-<BR> <UTM60W84> : World Geodetic System 1984 UTM fuseau 60
-<BR> <WALL78UTM1S> : Wallis-Uvea 1978 (MOP78) UTM 1 SUD
-<P>
-<BR> ---------------------------------------------------------
-<BR> Various Non-U.S. Coordinate Systems,
-<BR> ---------------------------------------------------------
-<BR> <CH1903> : Swiss Coordinate System
-<BR> <madagascar> : Laborde grid for Madagascar
-<BR> <new_zealand> : New Zealand Map Grid (NZMG) - Projection unique to N.Z. so all factors fixed
-<BR> ---------------------------------------------------------
-<BR> Secondary grids DMA TM8358.1, p. 4.3
-<BR> ---------------------------------------------------------
-<BR> <bwi> : British West Indies
-<BR> <costa-n> : Costa Rica Norte
-<BR> <costa-s> : Costa Rica Sud
-<BR> <cuba-n> : Cuba Norte
-<BR> <cuba-s> : Cuba Sud
-<BR> <domin_rep> : Dominican Republic
-<BR> <egypt-1> : Egypt
-<BR> <egypt-2> : Egypt
-<BR> <egypt-3> : Egypt
-<BR> <egypt-4> : Egypt
-<BR> <egypt-5> : Egypt
-<BR> <el_sal> : El Salvador
-<BR> <guat-n> : Guatemala Norte
-<BR> <guat-s> : Guatemala Sud
-<BR> <haiti> : Haiti
-<BR> <hond-n> : Honduras Norte
-<BR> <hond-s> : Honduras Sud
-<BR> <levant> : Levant
-<BR> <nica-n> : Nicaragua Norte
-<BR> <nica-s> : Nicaragua Sud
-<BR> <nw-africa> : Northwest Africa
-<BR> <palestine> : Palestine
-<BR> <panama> : Panama
-<P>
-<BR> ---------------------------------------------------------
-<BR> other grids in DMA TM8358.1
-<BR> ---------------------------------------------------------
-<BR> <bng> : British National Grid
-<BR> <malay> : West Malaysian RSO Grid
-<BR> <india-I> : India Zone I
-<BR> <india-IIA> : India Zone IIA
-<BR> <india-IIB> : India Zone IIB
-<BR> <india-IIIA> : India Zone IIIA
-<BR> <india-IIIB> : India Zone IIIB
-<BR> <india-IVA> : India Zone IVA
-<BR> <india-IVB> : India Zone IVB
-<BR> <ceylon> : Ceylon Belt
-<BR> <irish> : Irish Transverse Mercator Grid
-<BR> <neiez> : Netherlands East Indies Equitorial Zone
-<BR> <n-alger> : Nord Algerie Grid
-<BR> <n-maroc> : Nord Maroc Grid
-<BR> <n-tunis> : Nord Tunisie Grid
-<BR> <s-alger> : Sud Algerie Grid
-<BR> <s-maroc> : Sud Maroc Grid
-<BR> <s-tunis> : Sud Tunisie Grid
-<P>
-<BR> ---------------------------------------------------------
-<BR> Gauss Krueger Grids for Germany
-<BR> ---------------------------------------------------------
-<BR> <gk2-d> : Gauss Krueger Grid for Germany
-<BR> <gk3-d> : Gauss Krueger Grid for Germany
-<BR> <gk4-d> : Gauss Krueger Grid for Germany
-<P>
-
-<HR>
-<A NAME="index"> </A><H2>Index</H2>
-<DL>
-<DT><A HREF="#lbAB">NAME</A><DD>
-<DT><A HREF="#lbAC">VERSION</A><DD>
-<DT><A HREF="#lbAD">SYNOPSIS</A><DD>
-<DT><A HREF="#lbAE">DESCRIPTION</A><DD>
-<DT><A HREF="#lbAF">AUTHORSHIP</A><DD>
-<DT><A HREF="#lbAG">OPTIONS</A><DD>
-<DT><A HREF="#lbAH">EXAMPLES</A><DD>
-<DT><A HREF="#lbAI">SEE ALSO</A><DD>
-<DT><A HREF="#lbAJ">BUGS</A><DD>
-<DT><A HREF="#lbAK">APPENDIX 1: PROJECTED COORDINATE SYSTEM IDENTIFIERS</A><DD>
-</DL>
-<HR>
-</PRE>
-
-<CENTER><P><BR>
-Last Updated: 13 March 2014</P></CENTER>
-
-<HR>
-<P><A HREF="mbsystem_man_list.html">Return to list of MB-System manual pages...</A></P>
-<P><A HREF="mbsystem_home.html"><IMG SRC="mbsystem_logo_small.gif" BORDER=0 HEIGHT=55 WIDTH=158 ALIGN=BOTTOM></A><A HREF="mbsystem_home.html">Back
-to MB-System Home Page...</A></P>
-
-</BODY>
-</HTML>
diff --git a/src/html/mbnavadjust.html b/src/html/mbnavadjust.html
deleted file mode 100644
index 21ce48f..0000000
--- a/src/html/mbnavadjust.html
+++ /dev/null
@@ -1,1682 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<HTML VERSION="2.0">
-<HEAD>
-   <TITLE>MB-System Unix Manual Page: mbnavadjust</TITLE>
-<!-- WEBMAGIC VERSION NUMBER="2.0.2" -->
-<!-- WEBMAGIC TRANSLATION NAME="ServerRoot" SRC="/var/www/htdocs/" DST="/" -->
-<!-- WEBMAGIC TRANSLATION NAME="ProjectRoot" SRC="./" DST="" -->
-</HEAD>
-<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#336699" VLINK="#997040" ALINK="#CC9900">
-<BODY>
-<CENTER><H3><U>MB-System Unix Manual Page</U></H3></CENTER>
-<PRE>
-<H1>mbnavadjust</H1>
-Section:  MB-System 5.0  (1)<BR>Updated:  22 April 2015 <BR><A HREF="#index">Index</A>
-<HR>
-
-<A NAME="lbAB"> </A>
-<H2>NAME</H2>
-
-<B>mbnavadjust</B> - Package that solves for optimal navigation by
-matching bathymetry of overlapping swaths.
-<P>
-<A NAME="lbAC"> </A>
-<H2>VERSION</H2>
-
-Version 5.0
-<P>
-<A NAME="lbAD"> </A>
-<H2>SYNOPSIS</H2>
-
-<B>mbnavadjust</B> [<B>-V -H -D -R</B>]
-<P>
-<A NAME="lbAE"> </A>
-<H2>DESCRIPTION</H2>
-
-<B>MBnavadjust</B> is an interactive graphical program used to
-adjust swath data navigation by matching bathymetric features
-in overlapping and crossing swaths. The primary purpose of
-<B>mbnavadjust</B> is to eliminate relative navigational errors in swath
-data obtained from poorly navigated sonars. Submerged platforms
-such as towed vehicles, remotely operated vehicles (ROVs) and
-autonomous underwater vehicles (AUVs) are frequently not navigated
-with accuracy equivalent to the lateral resolution of
-swath bathymetry obtained with high frequency sonars operated
-close to the seafloor. This is  particularly true for systems
-that depend on ultra-short baseline navigation (USBL) or on
-inertial navigation (as opposed to long baseline (LBL) navigation
-obtained using transponder networks). Many old, pre-GPS surveys with
-hull mounted sonars also suffer from poor navigation relative to the
-resolution of the swath bathymetry, and can thus be improved with
-application of this tool. <B>MBnavadjust</B> also works well to
-co-register surveys at different scales. For instance, our
-initial use of this tool involved co-registering a deep-towed Reson
-8101 multibeam survey of the Loihi Seamount summit (offshore Hawaii)
-with a hull mounted Simrad EM300 multibeam survey.
-<P>
-When swath surveys are poorly navigated, features clearly imaged
-by the sonar may not match in overlapping and crossing swaths.
-However, by systematically determining the positional offsets between
-matching features throughout a survey, it is possible to solve,
-or invert, for a navigation model which is consistent with the
-original navigational constraints, satisfies the requirement
-of reasonableness, and also causes features in overlapping swaths
-to match within the sonar's resolution. The analysis and adjustment
-can be limited to lateral (x and y or longitude and latitude) offsets
-when all vertical offsets have been corrected prior to importation
-into <B>MBnavadjust</B> (e.g. tidal corrections have been made).
-Otherwise, the offset analysis and inversions are three dimensional.
-<P>
-Early attempts to address this problem (e.g. Nishimura et al. [1988])
-focused on automating the identification of matching features
-and their navigational offsets. The automated approach is
-problematic because seafloor features are complex, and the
-cross correlation function of matching features often exhibits
-multiple local minima. Our approach is to automate the identification
-of matching features and the ultimate solution for an optimal
-indentification while depending on interactive determination of
-the navigational offsets. We have not found an automatic algorithm
-that can reliably replace the human eye and brain in correctly
-lining up real seafloor features.
-<P>
-<B>MBnavadjust</B> operates within the context of the <B>mbprocess</B>
-parallel processing scheme, but it should used on data for which
-the initial navigation processing (e.g. <B>mbnavedit</B> is complete.
-When swath data files are imported into <B>mbnavadjust</B>, the data is
-taken from processed files generated by <B>mbprocess</B> whenever
-possible (when those files exist). If no processed file exists,
-the raw data file is used. When the processing with <B>mbnavadjust</B>
-is completed and an optimal navigation solution is achieved, new
-navigation files are generated (".na#" files, see below for full
-description) which supercede the ".nve" files
-generated by <B>mbnavedit</B>. Rerunning <B>mbprocess</B> will merge
-the new navigation into a new set of processed files. Once
-a swath file is processed with <B>mbnavadjust</B>, any further attempts
-to process the navigation with <B>mbnavedit</B> will only produce
-navigation files that are ignored by <B>mbprocess</B>. This behavior
-can be reversed manually using <B>mbset</B>, but then the user will
-unnecessarily complicating his or her efforts.
-<P>
-A companion program <B>mbnavadjustmerge</B> can add <B>mbnavadjust</B> projects
-together or or modify <B>mbnavadjust</B> prooject settings. 
-<P>
-The inversion for an optimal navigation which fits the offsets identified
-at matching features must also be reasonable. This is achieved by
-minimizing perturbations to speed and acceleration in the inversion.
-This approach of penalizing first and second derivatives within
-a linear inverse problem is common within the geophysical
-inverse theory literature (e.g. Parker [1994]).
-<P>
-Users are advised that <B>mbnavadjust</B> is complicated in both
-conception and implementation. We strongly recommend that users
-read all of the documentation provided below prior to attempting
-a first use of this software.
-The meaning and use of the individual widgets and windows employed in
-the graphical interface is provided in the <B>INTERACTIVE CONTROLS</B>
-section. The <B>USING MBNAVADJUST</B> section provides a more coherent
-discussion of how to use <B>mbnavadjust</B>, how this program interacts
-with the <B>mbprocess</B> parallel processing scheme, and the underlying
-concepts and algorithms.
-<P>
-<A NAME="lbAF"> </A>
-<H2>AUTHORSHIP</H2>
-
-David W. Caress (<A HREF="mailto:caress at mbari.org">caress at mbari.org</A>)
-<BR>
-
-<BR>  Monterey Bay Aquarium Research Institute
-<BR>
-
-Dale N. Chayes (<A HREF="mailto:dale at ldeo.columbia.edu">dale at ldeo.columbia.edu</A>)
-<BR>
-
-<BR>  Lamont-Doherty Earth Observatory
-<P>
-<A NAME="lbAG"> </A>
-<H2>OPTIONS</H2>
-
-<DL COMPACT>
-<DT><B>-H</B>
-
-<DD>
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-<DT><B>-D</B>
-
-<DD>
-Normally, <B>mbnavadjust</B> uses a white background for the
-interactive plots. This option causes the program to use a
-black background for the plots.
-<DT><B>-R</B>
-
-<DD>
-This option causes <B>mbnavadjust</B> to discard all navigation ties,
-set all crossings to "unanalyzed" status, and to save the project
-in this pristine state. Only use this option if you really, really
-want to start over.
-<DT><B>-V</B>
-
-<DD>
-Normally, <B>mbnavadjust</B> outputs nothing to the stderr stream.
-If the <B>-V</B> flag is given, then <B>mbnavadjust</B>
-works in a "verbose" mode and
-outputs the program version being used, all error status messages,
-and a large amount of other information.
-<P>
-</DL>
-<A NAME="lbAH"> </A>
-<H2>INTERACTIVE CONTROLS</H2>
-
-<P>
-<A NAME="lbAI"> </A>
-<H3>MBnavadjust Window</H3>
-
-This is the primary window of <B>mbnavadjust</B>.
-<P>
-<DL COMPACT>
-<DT><B>File</B>
-
-<DD>
-This button activates a pulldown menu with six items:
-<B>New</B>, <B>Open</B>, <B>Close</B>,
-<B>Import Swath Data</B>, and <B>Quit</B>.
-<P>
-<DT><B>File->New</B>
-
-<DD>
-This menu item brings up a popup window which allows the user to
-specify a new <B>mbnavadjust</B> project. As part of initializing
-a new project, <B>mbnavadjust</B> creates a file with a ".nvh"
-suffix and a directory with a ".dir" suffix.
-<DT><B>File->Open</B>
-
-<DD>
-This menu item brings up a popup window which allows the user to
-open an existing <B>mbnavadjust</B> project.
-<DT><B>File->Close</B>
-
-<DD>
-This menu item causes <B>mbnavadjust</B> to close the current project.
-<DT><B>File->Import Swath Data</B>
-
-<DD>
-This menu item brings up a popup window which allows the user to
-specify a swath sonar data file or a list of
-swath files to be imported into the current
-<B>mbnavadjust</B> project.
-This program uses the <B>MBIO</B> library and
-will read any swath sonar
-formats supported by <B>MBIO</B>. A list of the swath sonar data
-formats currently supported by <B>MBIO</B> and their
-identifier values is given in the <B>MBIO</B> manual page.
-If the swath sonar data file is named using the <B>MB-System</B>
-suffix convention (format 11 files end with ".mb11", format
-41 files end with ".mb41", etc.), then the program will
-automatically use the appropriate format id; otherwise the
-format must be set by the user in the format text box.
-<DT><B>File->Quit</B>
-
-<DD>
-This button causes <B>mbnavadjust</B> to quit. If a project has been
-created or opened, that project will be closed before the program
-quits.
-<DT><B>Option</B>
-
-<DD>
-This button brings up a pulldown menu with one item: <B>Controls</B>.
-<DT><B>Option->Controls</B>
-
-<DD>
-This menu item brings up a dialog window with several slider widgets
-that set parameters controlling how swath data are imported and displayed.
-These widgets are discussed in the <B>Controls</B> section below.
-<BR> .TP
-<B>View</B>
-
-This button brings up a pulldown menu with fifteen items in three
-groups. This menu controls the contents of the list widget in the lower
-right <B>MBnavadjust Window</B>. If an <B>mbnavadjust</B> project
-has been created or opened, the <B>Data Table</B> list
-widget will display a table of items controlled by these menu items,
-and the corresponding menu item will be disabled. Selection of another item
-items will change what is displayed in the <B>Data Table</B> list
-widget accordingly.
-<P>
-The first group includes the <B>Show Surveys</B>,
-<B>Show Data Files</B>, <B>Show Data File Sections</B>, <B>Show All Crossings</B>,
-<B>Show All Crossings</B>, <B>Show >25% Crossings</B>, <B>Show >50% Crossings</B>,
-<B>Show True Crossings</B>, and <B>Show Ties</B> items.
-<DT><B>View->Show Surveys</B>
-
-<DD>
-This menu item causes the <B>Data Table</B> list widget to display a list of the
-surveys in the current <B>mbnavadjust</B> project. Within <B>MBnavadjust</B>, a
-survey is a group of swath files that are contiguous in time.
-<DT><B>View->Show Data Files</B>
-
-<DD>
-This menu item causes the <B>Data Table</B> list widget to display a list of the swath
-data files in the current <B>mbnavadjust</B> project.
-<DT><B>View->Show Data File Sections</B>
-
-<DD>
-This menu item causes the <B>Data Table</B> list widget to display a list of the swath
-data sections in the current <B>mbnavadjust</B> project.
-<DT><B>View->Show All Crossings</B>
-
-<DD>
-This menu item causes the <B>Data Table</B> list widget to display a list of all the swath
-crossings in the current <B>mbnavadjust</B> project.
-When this option is set, selecting a list item causes <B>mbnavadjust</B> to load and display the selected
-selected crossing in the "Nav Err" window.
-<DT><B>View->Show >25% Crossings</B>
-
-<DD>
-This menu item causes the <B>Data Table</B> list widget to display a list of all the swath
-crossings in the current <B>mbnavadjust</B> project for which the two sections overlap by
-more than 25%.
-When this option is set, selecting a list item causes <B>mbnavadjust</B> to load and display the selected
-selected crossing in the "Nav Err" window.
-<DT><B>View->Show >50% Crossings</B>
-
-<DD>
-This menu item causes the <B>Data Table</B> list widget to display a list of all the swath
-crossings in the current <B>mbnavadjust</B> project for which the two sections overlap by
-more than 50%..
-When this option is set, selecting a list item causes <B>mbnavadjust</B> to load and display the selected
-selected crossing in the "Nav Err" window.
-<DT><B>View->Show True Crossings</B>
-
-<DD>
-This menu item causes the <B>Data Table</B> list widget to display a list of all the swath
-crossings  in the current <B>mbnavadjust</B> project for which the navigation tracks cross.
-When this option is set, selecting a list item causes <B>mbnavadjust</B> to load and display the selected
-selected crossing in the "Nav Err" window.
-<DT><B>View->Show Ties</B>
-
-<DD>
-This menu item causes the <B>Data Table</B> list widget to display a list of the tie points
-in the current <B>mbnavadjust</B> project.
-<P>
-The second group includes the
-<B>Show All Surveys</B>, <B>Show Only Selected Survey</B>, <B>Show Only Selected File</B>,
-and <B>Show Only Selected Section</B> items. One of these options is always active, and
-modifies what is displayed in the <B>Data Table</B> list.
-<DT><B>View->Show All Surveys</B>
-
-<DD>
-This menu item allows all of the possible items (file, sections, crossings, ties)
-to be displayed in the <B>Data Table</B> list.
-<DT><B>View->Show Only Selected Surveys</B>
-
-<DD>
-This menu item limits the items (file, sections, crossings, ties) displayed in
-the <B>Data Table</B> list to those associated with the most recently
-selected survey (e.g. a survey selected by clicking in the <B>Data Table</B> list
-while the <View->Show Surveys> option is active).
-<DT><B>View->Show Only Selected File</B>
-
-<DD>
-This menu item limits the items (file, sections, crossings, ties) displayed in
-the <B>Data Table</B> list to those associated with the most recently
-selected file (e.g. a file selected by clicking in the <B>Data Table</B> list
-while the <View->Show Files> option is active).
-<DT><B>View->Show Only Selected Section</B>
-
-<DD>
-This menu item limits the items (file, sections, crossings, ties) displayed in
-the <B>Data Table</B> list to those associated with the most recently
-selected section (e.g. a section selected by clicking in the <B>Data Table</B> list
-while the <View->Show Sections> option is active).
-<P>
-The third group includes two options:
-<DT><B>View->Visualize Survey</B>
-
-<DD>
-This option is not active, and is for future use.
-<DT><B>View->Show Modelplot</B>
-
-<DD>
-This option causes an addition "Model Plot" window to be shown that displays
-the navigation adjustment model as three time series: longitude on top, latitude
-in the middle, and vertical on the bottom.
-<DT><B>Action</B>
-
-<DD>
-This button brings up a pulldown menu with nine items:
-<B>Set File Poor Navigation</B>, <B>Set File Good Navigation</B>,
-<B>Set File Fixed Navigation</B>, <B>Auto-Pick Offsets</B>,
-<B>Check for New Crossings</B>, <B>Analyze Crossings</B>, <B>Zero All Z Offsets</B>,
-<B>Invert Navigation</B>, and <B>Apply Adjusted Navigation</B>.
-<DT><B>Action->Set File Poor Navigation</B>
-
-<DD>
-This menu item causes <B>mbnavadjust</B> to treat the navigation of
-a selected swath data file as poor. This option is only activated
-when the <B>Data Table</B> list widget shows a list of the imported
-swath files and one file has been selected by clicking in that list.
-In the case where no files are fixed, the final adjusted navigation model
-is centered on the average navigation offsets required for good files.
-The offsets tieing to files with poor navigation are ignored in
-calculating the averages.
-<DT><B>Action->Set File Good Navigation</B>
-
-<DD>
-This menu item causes <B>mbnavadjust</B> to treat the navigation of
-a selected swath data file as good, which is in fact the default state
-for swath files. This option is only activated
-when the <B>Data Table</B> list widget shows a list of the imported
-swath files and one file has been selected by clicking in that list.
-In the case where no files are fixed, the final adjusted navigation model
-is centered on the average navigation offsets required for good files.
-The offsets tieing to files with good navigation are used in
-calculating the averages.
-<DT><B>Action->Set File Fixed Navigation</B>
-
-<DD>
-This menu item causes <B>mbnavadjust</B> to treat the navigation of
-a selected swath data file as fixed, which means that all navigation
-points for this file will have zero offsets in the final adjusted navigation.
-Effectively, all of the offsets between fixed and unfixed files are taken up in
-the adjustments of the unfixed files.
-This option is only activated
-when the <B>Data Table</B> list widget shows a list of the imported
-swath files and one file has been selected by clicking in that list.
-<DT><B>Action->Auto-Pick Offsets</B>
-
-<DD>
-This menu item causes <B>mbnavadjust</B> to automatically pick offsets in
-all of the unset crossings currently displayed in the <B>Data Table</B> list.
-If <View->Show True Crossings> has been selected, then only true crossings are
-displayed and only the unset true crossings will be automatically picked.
-In general, unsupervised offset picks are frequently erroneous, and use
-of this experimental option is not encouraged.
-<DT><B>Action->Check For New Crossings</B>
-
-<DD>
-This menu item causes <B>mbnavadjust</B> to search for new crossings using
-the adjusted navigation from the current inversion. Often, new places where
-swaths overlap and cross emerge as the navigation is adjusted. The percentage
-of overlap is also recalculated for all of the existing crossings. If new true
-crossings are found, the user will be unable to perform a new inversion until
-all of the true crossings have been analyzed.
-<DT><B>Action->Analyze Crossings</B>
-
-<DD>
-This menu item causes <B>mbnavadjust</B> to load and display the first
-crossing in the "Nav Err" window.
-<DT><B>Action->Zero All Z Offsets</B>
-
-<DD>
-This menu item causes <B>mbnavadjust</B> to load and display the first
-crossing in the "Nav Err" window.
-<DT><B>Action->Invert Navigation</B>
-
-<DD>
-This menu item causes <B>mbnavadjust</B> to invert for an optimal
-navigation solution that fits the offsets defined at the navigation
-tie points while minimizing speed and acceleration. This option is
-only activated when all of the true crossings in the current
-<B>mbnavadjust</B> project have been analyzed interactively.
-<DT><B>Action->Apply Adjusted Navigation</B>
-
-<DD>
-This menu item causes <B>mbnavadjust</B> to export the adjusted
-navigation model from the current inversion to the
-swath files in the project.This option is
-only activated when the inversion is current, meaning that no new
-data have been imported and no changes to offset picks have been
-made since the last inversion.
-<DT><B>About</B>
-
-<DD>
-This button brings up a pulldown menu with one item: <B>About</B>.
-<DT><B>About->About</B>
-
-<DD>
-This menu item brings up a popup window that displays the program's
-name, authors, and version. Clicking the <B>Dismiss</B> button will
-close the window.
-<DT><B>Data Table</B>
-
-<DD>
-This list widget displays one of five tables of information regarding
-the current <B>mbnavadjust</B> project. These tables are a list of the
-imported swath surveys, the data files, the shorter data sections
-comprising each data file, a list of the identified crossing swaths, and
-a list of the navigation tie points defined interactively by the user.
-The <B>View</B> pulldown menu allows the user to set which table is displayed.
-<P>
-The survey list will look something like:
-<BR>
-
-<BR> <TT>       </TT>00 53 2009/08/03 08:18:49.484999 2009/08/03 22:52:59.375000 good<BR>
-<BR> <TT>       </TT>01 51 2009/08/04 09:03:11.938999 2009/08/04 23:02:03.470999 good<BR>
-<BR> <TT>       </TT>02 01 1998/05/13 01:33:36.791000 1998/05/13 02:42:11.703999 good<BR>
-<BR>
-
-Here the first column is the survey counter, the second is the number
-of swath files included in each survey, and the following information
-consists of the start and end times of the data in each survey
-shown in YYYY/MM/DD HH:MM:SS.SSSSSS format, followed by the survey status
-(poor, good, fixed, fixedxy, fixedz).
-<P>
-The file list will look something like:
-<BR>
-
-<BR> <TT>       </TT>0000:00  good   11  0.0  0.0 ../../20090803/20090803_081706.mb88<BR>
-<BR> <TT>       </TT>0001:00  good   11  0.0  0.0 ../../20090803/20090803_083332.mb88<BR>
-<BR> <TT>       </TT>0002:00  good   11  0.0  0.0 ../../20090803/20090803_085004.mb88<BR>
-<BR> <TT>       </TT>0003:00  good   11  0.0  0.0 ../../20090803/20090803_090636.mb88<BR>
-<BR> <TT>       </TT>0004:00  good   10  0.0  0.0 ../../20090803/20090803_092307.mb88<BR>
-<BR> <TT>       </TT> <TT>       </TT>..........................................<BR>
-<BR> <TT>       </TT>0053:01  good   12  0.0  0.0 ../../20090804/20090804_090127.mb88<BR>
-<BR> <TT>       </TT>0054:01  good   10  0.0  0.0 ../../20090804/20090804_092036.mb88<BR>
-<BR> <TT>       </TT>0055:01  good   11  0.0  0.0 ../../20090804/20090804_093707.mb88<BR>
-<BR> <TT>       </TT>0056:01  good   10  0.0  0.0 ../../20090804/20090804_095339.mb88<BR>
-<BR> <TT>       </TT>0057:01  good   11  0.0  0.0 ../../20090804/20090804_101010.mb88<BR>
-<BR> <TT>       </TT> <TT>       </TT>..........................................<BR>
-<BR> <TT>       </TT>0104:02  fixed   8  0.0  0.0 ../../MBARI/1998em300/mbari_1998_630_msn.mb57<BR>
-<BR>
-
-Here the first column is the file counter and survey counter separated by a colon.
-The second column indicates the file navigations state; "gd" indicates good
-navigation, "pr" indicates poor navigation, and "fx" indicates fixed
-navigation. The third column shows the number of sections extracted from this file.
-The fourth and fifth columns show any heading
-or roll bias offsets in degrees applied to the swath data for that file.
-The sixth column gives the name of the swath data file imported into
-<B>mbnavadjust</B>. Note that the name shown here is that of the "raw"
-swath file. The data imported by <B>mbnavadjust</B> is,
-if possible, extracted from a "processed" swath file
-generated by <B>mbprocess</B> rather than the
-associated "raw" file.
-<P>
-The file section list will look something like:
-<BR>
-
-<BR> <TT>       </TT>00:0000:00 2009/08/03 08:17:07.546998 2009/08/03 08:18:49.484999<BR>
-<BR> <TT>       </TT>00:0000:01 2009/08/03 08:18:49.984999 2009/08/03 08:20:26.952999<BR>
-<BR> <TT>       </TT>00:0000:02 2009/08/03 08:20:27.452999 2009/08/03 08:22:05.890999<BR>
-<BR> <TT>       </TT>00:0000:03 2009/08/03 08:22:06.390999 2009/08/03 08:23:43.344001<BR>
-<BR> <TT>       </TT>00:0000:04 2009/08/03 08:23:43.844001 2009/08/03 08:25:19.796999<BR>
-<BR> <TT>       </TT>00:0000:05 2009/08/03 08:25:20.296999 2009/08/03 08:26:57.265997<BR>
-<BR> <TT>       </TT>00:0000:06 2009/08/03 08:26:57.765997 2009/08/03 08:28:35.219001<BR>
-<BR> <TT>       </TT>00:0000:07 2009/08/03 08:28:35.719001 2009/08/03 08:30:16.155999<BR>
-<BR> <TT>       </TT>00:0000:08 2009/08/03 08:30:16.655999 2009/08/03 08:31:57.594001<BR>
-<BR> <TT>       </TT>00:0000:09 2009/08/03 08:31:58.094001 2009/08/03 08:33:36.546999<BR>
-<BR> <TT>       </TT>00:0000:10 2009/08/03 08:33:37.046999 2009/08/03 08:33:37.546999<BR>
-<BR>
-
-Here the first column shows the section id with the survey counter, the file counter,
-and the section counter separated by colons. The following information
-consists of the start and end times of each section
-shown in YYYY/MM/DD HH:MM:SS.SSSSSS format.
-<P>
-The crossing list will look something like:
-<BR> <TT>       </TT>-X    0 000:009 001:000  21  0<BR>
-<BR> <TT>       </TT>-     1 001:009 002:000  10  0<BR>
-<BR> <TT>       </TT>-     2 002:009 003:000  10  0<BR>
-<BR> <TT>       </TT>U     3 003:009 004:000   6  0<BR>
-<BR> <TT>       </TT>-     4 005:009 006:000  13  0<BR>
-<BR> <TT>       </TT>U     5 007:009 008:000   3  0<BR>
-<BR> <TT>       </TT>U     6 009:008 009:010   2  0<BR>
-<BR> <TT>       </TT>*     7 009:008 010:000  16  1<BR>
-<BR> <TT>       </TT>*X    8 009:009 010:000  41  1<BR>
-<BR> <TT>       </TT>-     9 009:008 010:001   1  0<BR>
-<BR>
-
-Here the first column indicates the processing status for the
-crossing. The first character is the status flag. If the status flag is "U",
-then no decision has been made about skipping or tieing this crossing.
-New crossings always show a "U" flag prior to being
-inspected by a user. If the first character is "-", then the crossing
-has been skipped, and if the first character is "*", then at least one
-tie point has been set. The second column is the crossing counter. The
-third and fourth columns identify the swath data sections that overlap
-in this crossing. Each are identified by their file id and section id
-separated by ":". The fifth column indicates the percentage of overlap
-of the two sections in this crossing. The larger the degree of overlap,
-the more likely that diagnostic matching topographic features exist that
-can be used to determine the navigation offsets required for this crossing.
-The sixth, and last column gives the number of tie
-points that have been defined for each crossing. New crossings always
-begin with 0 tie points prior to being inspected by a user.
-<P>
-The tie point list will look something like:
-<BR>
-
-<BR> <TT>       </TT>   7 0 009:008:07 010:000:04 00:00  1.02 -2.87 0.00 |  9.61  8.49 1.40 | 0.041 0.107 0.027<BR>
-<BR> <TT>       </TT>   8 0 009:009:02 010:000:00 00:00  0.90 -4.47 0.00 |  7.37  6.30 2.29 | 0.040 0.184 0.033<BR>
-<BR> <TT>       </TT>  12 0 009:008:04 010:002:04 00:00  4.11 -8.24 0.00 |  9.28  5.99 1.80 | 0.037 0.021 0.025<BR>
-<BR> <TT>       </TT>  14 0 010:000:02 010:002:06 00:00  2.12 -4.38 0.00 |  7.50  6.70 1.10 | 0.007 0.065 0.005<BR>
-<BR> <TT>       </TT>  16 0 009:007:04 010:003:04 00:00  5.90 -5.90 0.00 |  8.66  6.84 1.70 | 0.019 0.085 0.027<BR>
-<BR> <TT>       </TT>  19 0 009:006:04 010:004:04 00:00  8.32 -6.83 0.00 |  8.78  8.55 6.65 | 0.026 0.066 0.024<BR>
-<BR> <TT>       </TT>  21 0 009:005:05 010:005:03 00:00  8.96 -8.75 0.00 | 12.38  8.74 5.16 | 0.008 0.045 0.008<BR>
-<BR> <TT>       </TT>  23 0 009:004:04 010:006:04 00:00 12.23 -5.98 0.00 |  7.03  4.49 1.40 | 0.019 0.034 0.010<BR>
-<BR> <TT>       </TT>  26 0 009:003:04 010:007:04 00:00 17.42 -4.36 0.00 | 13.92 10.11 1.80 | 0.025 0.037 0.028<BR>
-<BR>
-
-Here the first column indicates the crossing which contains the tie point,
-and the second column shows which tie point (of those defined for that
-crossing) is displayed in a particular line. The third and fourth columns
-identify the navigation control points of the tie point. The navigation
-control points are specified by file, section, and nav point numbers separated
-by ":". The fifth through seventh columns are the longitude, latitude and vertical
-offsets (in meters) set interactively by the user. These represent the distance the second
-navigation control point must be moved relative to the first in order to make
-the bathymetry in the two swaths match. The tenth through twelth columns show the
-magnitude of the three axes of the uncertainly ellipsoid associated with each tie.
-The uncertainly ellipsoid is estimated as a 3x3 tensor and used to weight the tie
-offsets in the navigation adjustment inversion. Here the major and second axes are
-always close to horizontal, and the minor is axis is always close to vertical.
-The last three columns are nonzero only
-after an inversion for an optimal navigation solution has been performed. These
-represent the residual, or difference, between the offset calculated for this tie
-point in the inversion and that set by the user
-(displayed in the fifth through seventh columns).
-<P>
-If the file list is displayed and one file is selected by clicking in
-the list, then the user can fix or unfix the navigation of that file using
-the <Action->Fix File> or <Action->Unfix File> pulldown menu items.
-If either the crossing list or the tie point list are displayed, selecting
-one crossing or one tie point by clicking in the list widget will cause
-the specified crossing to be loaded and displayed in the <B>Nav Err</B>
-window.
-<P>
-</DL>
-<A NAME="lbAJ"> </A>
-<H3>Controls Window</H3>
-
-This dialog window is brought up by clicking the <B>Option->Controls</B>
-menu item in the <B>MBnavadjust Window</B>. This window includes two slider
-widgets setting data importation parameters, four slider widgets setting
-data display parameters, a button to apply any changes, and a button to
-dismiss the window.
-<P>
-<DL COMPACT>
-<DT><B>Max Section Length (km)</B>
-
-<DD>
-When <B>mbnavadjust</B> imports swath data, it breaks each data file
-up into a set of sections, or pieces. The geographical coverages of all sections
-are then compared to determine where swaths overlap or cross. This control
-sets the section track length. The ideal section length varies with the sonar
-altitude and ping rate. If the section length is too short, there will be too
-many small sections and an excessive number of crossings to analyze. If the
-section length is too large, individual sections will be slow to load and display.
-<DT><B>Max # Soundings in Section</B>
-
-<DD>
-This slider widget sets an additional or alternative control on swath data section size: the
-maximum number of soundings (not pings) that may be included in a given section. For some
-datasets, it may be more convenient to use the number of soundings rather than the track
-length as the criterea for breaking files up into sections.
-<DT><B>Decimation</B>
-
-<DD>
-When swath bathymetry sections are displayed in the <B>Nav Err</B> window,
-the primary display consists of bathymetric contours.
-The time required for calculating these
-contours is linear with the number of soundings. This slider allows users to
-decimate the pings used for the contour displays. If the decimation is set
-to 1, all soundings are used. If the decimation is set to 2, the soundings from
-every second ping are used for contouring.
-<DT><B>Contour Interval (m)</B>
-
-<DD>
-This slider widget sets the depth interval in meters for the bathymetric contours.
-<DT><B>Color Interval (m)</B>
-
-<DD>
-This slider widget sets the the depth interval in meters at which the
-color of the bathymetric contours changes. The contours are generated in four
-colors: black, red, green, and blue. The color interval should be a multiple
-of the contour interval.
-<DT><B>Tick Interval (m)</B>
-
-<DD>
-This slider widget sets the depth interval in meters at which contours have
-downhill facing tickmarks. The tick interval should be a multiple of the contour
-interval.
-<DT><B>Inversion Smoothing</B>
-
-<DD>
-This slider widget sets the importance of smoothing in the adjusted
-navigation model. Larger values yield a smoother model, smaller values a rougher model.
-The default is 4.00, and possible ranges are 0.10 to
-10.0, where the smoothing penalty weight applied to the first and
-second derivatives of the adjusted navigation perturbation is ten
-raised to this power.
-<DT><B>Apply</B>
-
-<DD>
-This button applies any changed values in the slider widgets of the <B>Controls Window</B>.
-If the <B>Controls Window</B> is closed without the <B>Apply</B> button being clicked, all
-changes to the values controlled by the sliders are lost.
-<DT><B>Dismiss</B>
-
-<DD>
-This button closes the <B>Controls Window</B>.
-<P>
-</DL>
-<A NAME="lbAK"> </A>
-<H3>Nav Err Window</H3>
-
-This window allows users to interactively inspect crossing swaths,
-define navigation tie points where bathymetric features can be matched,
-and set the navigation offsets at those tie points. This window can
-be brought up in a number of ways. If one pulls down the
-menu option <Action->Analyze Crossings>, then the "Nav Error" window
-will come up with the first crossing loaded. Alternatively, if the
-<View->Show All Crossings> menu item has been selected so that a table of
-crossings is displayed, clicking once on any of the crossing items in
-this tabel will bring up the  "Nav Error" window with that crossing loaded.
-Similarly, if tie points have been established and the tie point table
-displayed by selecting the <View->Show Ties> menu item, then clicking on
-any of the tie items this table will bring up the "Nav Error" window
-and load the crossing that includes the selected tie point. If the
-"Nav Error" window is already displayed, clicking on crossing or tie items
-in the display tables will load the selected crossing in place of whatever
-crossing was previously shown.
-<P>
-The Nav Err window includes a number of button widgets and three display
-canvases. The larger display to the right shows bathymetric contour maps
-of the overlapping swaths overlain by navigation tracks and any tie points
-that have been defined for the current crossing. The smaller canvas on the
-middle left shows the RMS bathymetry misfit between the two swaths as a
-function of lateral (x and y) offset using the current vertical (z)offset. The
-smallest canvas on the lower left shows the RMS Bathymetry misfit between
-the two swaths as a function of vertical offset using the current
-lateral offset.
-<P>
-<DL COMPACT>
-<DT><B>Contour Display</B>
-
-<DD>
-This canvas displays color bathymetric contours from both overlapping
-swaths in the current swath crossing. Initially, the display is scaled
-so that the entire area covered by the current crossing is visible. The
-bathymetric contours of the second swath can be moved relative to those
-of the first by dragging with the left mouse button in the canvas. The
-current navigational offset changes as the contours shift. The location
-of the current lateral offset also changes simultaneously on the misfit plot. The
-user can display a subregion of the current map by dragging a rectangle in the canvas
-with the middle mouse button. This zoom operation can be repeated as many times
-as desired. The right mouse button is used to set the location of the current
-navigational tie point. When the right mouse button is clicked on a point in
-the contour map, the closest navigation control points from each swath to
-that position are selected for the current tie point. In practice, the user
-should right-click on the bathymetric feature being matched to set the
-tie point correctly.
-<DT><B>Lateral Misfit Display</B>
-
-<DD>
-This canvas shows a color two dimensional plot of the RMS bathymetric misfit
-between the two overlapping swaths. The misfit is shown as a function
-of relative lateral (x and y) offsets between the two  swaths using the
-current vertical (z) offset.  Put
-another  way,  the misfit plot shows how good, or bad, the
-misfit becomes as one moves one swath relative to another.
-The  lowest misfit values are shown in red; higher misfits
-are shown in blues to purples. The location of the minimum
-misfit  is  marked by a black "X", and the location of the
-current navigation offset is shown by a small  red  square
-with a black outline. If an inversion has been performed, a
-small black "+" will mark the location of the offset calculated
-by the inversion. If a user left-clicks in the Lateral Misfit Display, the
-location of the cursor is taken as the new navigation offset
-and the red square moves to that location. Simultaneously, the
-bathymetric contours in the Contour Display shift to reflect
-the new offset.
-<DT><B>Vertical Misfit Display</B>
-
-<DD>
-This canvas shows a color profile plot of the RMS bathymetric misfit
-between the two overlapping swaths. The misfit is shown as a function
-of relative vertical (z) offset between the two  swaths using the
-current lateral (x andy) offsets.  Put
-another  way,  the misfit plot shows how good, or bad, the
-misfit becomes as one moves one swath vertically relative to another.
-The  lowest misfit values are shown in red and as high points
-in the profile; higher misfits
-are shown in blues to purples and as low points. The location of the minimum
-misfit  is  marked by a black "X", and the location of the
-current vertical offset is shown by a solid line. If an inversion has been performed, a
-small black "+" will mark the location of the offset calculated
-by the inversion. If a user left-clicks in the Vertical Misfit Display, the
-location of the cursor is taken as the new vertical offset
-and the solid line moves to that location. Simultaneously, the
-bathymetric contours in the Contour Display shift to reflect
-the new offset.
-<DT><B>Settings</B>
-
-<DD>
-This button brings up a pulldown menu with two items: Biases and <B>ContoursB
-<DT>Settings->Biases</B>
-
-<DD>
-This menu item brings up a dialog window with several slider widgets
-that set roll and heading bias values.
-These widgets are discussed in the <B>Biases</B> section below.
-<DT><B>Settings->Contours</B>
-
-<DD>
-This menu item brings up a dialog window with several slider widgets
-that set parameters controlling how swath data are imported and displayed.
-These widgets are discussed in the <B>Controls</B> section above.
-<DT><B>Previous</B>
-
-<DD>
-Clicking this button causes the Nav Err window to load and display the previous crossing.
-<DT><B>Next</B>
-
-<DD>
-Clicking this button causes the Nav Err window to load and display the next crossing.
-<DT><B>Next Unset</B>
-
-<DD>
-Clicking this button causes the Nav Err window to load and display the next crossing which
-has no tie points set and has not been explicitly skipped.
-<DT><B>Skip Crossing</B>
-
-<DD>
-This button indicates that no good tie points can be defined for the current crossing.
-The program <B>mbnavadjust</B> will not allow an inversion to be calculated until all true crossings
-either have tie points defined or have been explicitly skipped.
-<DT><B>Full Size</B>
-
-<DD>
-Clicking this button causes the contour display to resize so that it shows the entire area
-covered by the swath sections in the current crossing.
-<DT><B>Unset Crossing</B>
-
-<DD>
-This button returns the current crossing to the original unset state, deleting any ties that
-have been set.
-<DT><B>Reset Crossing</B>
-
-<DD>
-This button is active only if a tie has been set for the current crossing. If a tie exists,
-and the user has changed the current offset from that of the current tie, then this button
-returns the working offset values to that of the existing tie.
-<DT><B>Set Offset</B>
-
-<DD>
-This very important button causes the current navigational offset to be set for the
-current tie point and crossing. This button is the only way that the navigational offsets
-are actually applied to the <B>mbnavadjust</B> project. If the user closes the Nav Err window,
-changes the loaded crossing, or changes the active tie point without clicking <Set Offset>,
-whatever navigational offset was viewed will be lost. Tie points are displayed in yellow
-once they are set, and in red when either the navigational offset or the navigation
-points have been changed but not yet set.
-<DT><B>Zero Z Offset</B>
-
-<DD>
-This button sets the current vertical offset to zero meters.
-<DT><B>Add Tie</B>
-
-<DD>
-This button adds a new tie point for the current crossing and makes this new tie point
-active. The tie point initially adopts the current navigational offset.
-<DT><B>Zero Offset</B>
-
-<DD>
-This button sets the current navigational offset to zero meters for longitude, latitude, and vertical.
-<DT><B>Select Tie</B>
-
-<DD>
-If more than one navigation tie point has been defined for a crossing,
-then only one tie point can be active at any time. The navigation control points of the
-active tie points will be displayed as red boxes, and those of any inactive
-tie points will be shown as smaller red boxes. This button changes the active tie point.
-Repeatedly clicking this button will cycle through all of the tie points in the
-current crossing. Note that each tie point has its own offset defined, so in general
-the positions of the bathymetric contours will change as the active tie point changes.
-<DT><B>Delete Tie</B>
-
-<DD>
-This button deletes the current active tie point.
-<DT><B>Dismiss</B>
-
-<DD>
-This button closes the Nav Err window.
-<DT><B>Minimum Misfit</B>
-
-<DD>
-This button shifts the current offset to the value identified as the minimum misfit in
-the current misfit display. The minimum misfit is shown as the large black X on the
-color lateral misfit plot and on the vertical misfit profile.
-<DT><B>Minimum XY Misfit</B>
-
-<DD>
-This button shifts the current lateral offset to the values identified as the minimum lateral misfit in
-the current misfit display. The vertical offset is not changed. The minimum lateral
-misfit is shown as the small black X on the lateral misfit plot. This button is generally
-used when the data are already corrected for all vertical offsets (e.g. tides), and so
-all z offsets can be confined to zero values.
-<DT><B>Center on Zero Offset</B>
-
-<DD>
-This button causes the misfit plot to be regenerated using a zero navigational offset as the plot origin.
-<DT><B>Center on Current Offset</B>
-
-<DD>
-This button causes the misfit plot to be regenerated using the current navigational offset as the plot origin.
-<P>
-</DL>
-<A NAME="lbAL"> </A>
-<H3>Biases Window</H3>
-
-This dialog window is brought up by clicking the <B>Settings->Biases</B>
-menu item in the <B>Nav Err Window</B>. The controls allow users to set
-roll and heading bias (or offset) values to be a applied to some or all of
-the swath bathymetry in the <B>mbnavadjust</B> project. Under most circumstances,
-roll bias and pitch bias problems should be resolved before swath data are
-imported into <B>mbnavadjust</B>. However, these settings make it possible to
-deal with bias issues if they are discovered during the navigation adjustment
-process. This window includes two toggle
-buttons to set the bias mode, four slider widgets to set the bias parameters,
-a button to apply the bias settings to all swath files, a button to apply the bias
-settings to the current swath file, and a button to
-dismiss the window.
-<P>
-<DL COMPACT>
-<DT><B>Same Biases (km)</B>
-
-<DD>
-This toggle button sets the bias mode so that the heading and roll bias is identical
-for both swath data sections in the current crossing. The <Different Biases> toggle
-is deselected when this toggle is selected.
-<DT><B>Different Biases (km)</B>
-
-<DD>
-This toggle button sets the bias mode so that the heading and roll bias can be
-different between the two swath data sections in the current crossing.  The <Same Biases> toggle
-is deselected when this toggle is selected.
-<DT><B>Section 1 Biases (deg) -> Heading</B>
-
-<DD>
-This slider widget sets the heading bias for swath section 1. The
-<DT><B>Section 1 Biases (deg) -> Roll</B>
-
-<DD>
-This slider widget sets the roll bias for swath section 1.
-<DT><B>Section 2 Biases (deg) -> Heading</B>
-
-<DD>
-This slider widget sets the heading bias for swath section 2.
-<DT><B>Section 2 Biases (deg) -> Roll</B>
-
-<DD>
-This slider widget sets the roll bias for swath section 2.
-<DT><B>Apply to All Files</B>
-
-<DD>
-This button sets the current heading and roll bias values as the
-bias values for all swath files in the <B>mbnavadjust</B> project.
-This button is only enabled when the <Same Biases> toggle is selected.
-<DT><B>Apply</B>
-
-<DD>
-This button sets the current heading and roll bias values as the
-bias values for the swath sections in the current crossing. The bathymetry
-contours and misfit plot are recalculated and redisplayed using the
-new bias values.
-<DT><B>Dismiss</B>
-
-<DD>
-This button closes the <B>Controls Window</B>.
-<P>
-<P>
-</DL>
-<A NAME="lbAM"> </A>
-<H2>USING MBNAVADJUST 1: IMPORTING DATA</H2>
-
-Users begin using <B>mbnavadjust</B> by starting up the program
-on the command line:
-<BR>
-
-<BR> <TT>       </TT>mbnavadjust<BR>
-<BR>
-
-In order to get started, one must either open an existing
-<B>mbnavadjust</B> project or initialize a new one. Both options
-are available under the <File> menu with the <File->New> and <File->Open>
-menu buttons. When one pulls down the <File->New> option, a dialog opens
-that allows navigation of the filesystem and specification of
-a project name. Whatever project location and name is chosen,
-a directory "{project_path}/{project_name}.dir" and a file
-"{project_path}/{project_name}.nvh" will be created. Once
-a project exists and has been opened, swath data can be imported and then
-analyzed. To open an existing <B>mbnavadjust</B> project, click
-the <File->Open> option and select the corresponding "*.nvh" file.
-<P>
-The main <B>mbnavadjust</B> window displays basic information in a set of
-labels in the upper left, including the open project name, the number of
-files imported, the number of crossings found, the number of crossings
-analyzed, the number of navigation tie points set, and whether an
-up-to-date inversion for optimal navigation has been performed. A scrollable
-text window in the lower left displays messages regarding all actions
-performed by the program during the current session. Another scrollable
-window on the right displays one of three tables of information according
-a user selection under the <View> menu. The three choices are a table
-of the imported swath files, a table of the swath crossings, and a table
-of the interactively defined navigation tie points. If no swath data has
-yet been imported, then the all of the tables will be empty. Once some data
-files are imported, the swath file table will have entries and
-some number of crossings will be defined (assuming that
-swaths do overlap and cross), but no tie points will yet be defined.
-<P>
-In order to import swath data into an <B>mbnavadjust</B> project,
-pull down the <File->Import Swath Data> menu item. A file selection
-dialog will appear. Swath data can be imported in single files or through
-datalists (see the <B>MB-System</B> manual page for a description
-of recursive datalists). As with other <B>MB-System</B> programs, the format
-id will be automatically determined if possible for each file selected.
-If a filename does not follow the the <B>MB-System</B> naming convention, the
-user may need to manually set the format id in the appropriately labeled
-dialog text widget.
-<P>
-Each file that is imported is broken into
-a number of sections. The maximum size of the sections in line length or
-in number of soundings is set in a dialog opened by clicking on
-<Option->Controls>. Navigation control points are selected at regular
-intervals within each section. The control point distance interval is
-approximately  one tenth of the specified segment length, so there are
-up to 11 control points for each section. The data for each section is
-written as a format 71 bathymetry-only file in the "*.dir" directory.
-As the files are imported, the areal extent of each section is
-compared to the other sections. Any pair of sections that overlap
-is added to a list of crossings to be investigated graphically. This list
-can be displayed by pulling down the <View->Show Crossings> menu item.
-<P>
-As the user later works through the crossings, he or she will will define
-tie points whenever the overlapping bathymetry allows the navigational offset
-to be determined reliably in three dimensions. Each tie point will reference
-two of the navigation control points, one from each swath in the crossing.
-Ultimately, some crossings will allow one, or in some case multiple tie
-points to be defined. Other crossings will still have no tie points, either
-because the swaths don't really overlap or because there aren't any
-distinctive features to match. When all of the crossings have been inspected,
-then the user can invoke inversion for an optimal navigation solution.
-In cases where the data are known to be already corrected for vertical offsets,
-such as tides, then the user can uniformly set the vertical (z) components of
-offsets to zero.
-<P>
-<A NAME="lbAN"> </A>
-<H2>USING MBNAVADJUST 2: INSPECTING CROSSINGS</H2>
-
-<P>
-<A NAME="lbAO"> </A>
-<H3>Bringing Up The Nav Error Window</H3>
-
-<P>
-The heart of <B>mbnavadjust</B> is the interactive inspection of the
-swath crossings. One can bring up the crossing inspection window
-(entitled "Nav Error") in a number of ways. If one pulls down the
-menu option <Action->Analyze Crossings>, then the "Nav Error" window
-will come up with the first crossing loaded. Alternatively, if the
-<View->Show Crossings> menu item has been selected so that a table of
-crossings is displayed, clicking once on any of the crossing items in
-this tabel will bring up the  "Nav Error" window with that crossing loaded.
-Similarly, if tie points have been established and the tie point table
-displayed by selecting the <View->Show Ties> menu item, then clicking on
-any of the tie items this table will bring up the "Nav Error" window
-and load the crossing that includes the selected tie point. If the
-"Nav Error" window is already displayed, clicking on crossing or tie items
-in the display tables will load the selected crossing in place of whatever
-crossing was previously shown.
-<P>
-Once the "Nav Err" window is displayed, the user can also move through
-the crossings by clicking on the <Previous>, <Next>, and <Next Unset>
-buttons. The <Previous> and <Next> buttons will load the previous or
-next, respectively, crossings in the crossing list. As discussed below,
-each crossing must ultimately be "resolved" by either having one or
-more navigation offsets set at particular "tie points", or by being
-"skipped" because no matchable seafloor features are found. The <Next Unset>
-button will load the next crossing that has not been resolved.
-To close the "Nav Err" window, click the <Dismiss> button.
-<P>
-<A NAME="lbAP"> </A>
-<H3>Interactively Matching Seafloor Features</H3>
-
-<P>
-The "Nav Error" window is complicated in appearance, and
-regrettably complicated in function also.
-The purpose is to allow the user to determine if any seafloor features
-can be confidently matched in the overlapping swaths. If so, one or more
-tie points can be defined. In order to ease the identification of matching
-features, two simultaneous displays are provided.
-The larger plot on the right consists of overlain
-bathymetric contours derived from each of the two swaths. The smaller
-canvas on the left shows a color two dimensional plot
-of the RMS misfit between the two swaths. The misfit is shown
-as a function of relative lateral offsets between the two swaths. Put another
-way, the misfit plot shows how good, or bad, the misfit becomes as one moves
-one swath relative to another. The lowest misfit values are shown in red; higher
-misfits are shown in blues to purples. The location of the global (three dimensional)
-minimum misfit is marked by the large black "X", the location of the minimum misfit
-using the current vertical offset value is marked by a small black "x",
-and the location of the current navigation offset is
-shown by a small red square with a black outline.
-<P>
-The interactive aspect of the "Nav Error" window works simultaneously
-in both displays. If the user holds down the left mouse button in the
-contour plot and moves the cursor, the bathymetry contours from one swath
-will move along with the cursor. In this way, the user can move one of the
-swaths around relative to the other until the contours line up and features
-match. As the contours move, the red square showing the current offset location
-also moves on the misfit plot. The user can thus visually relate the contour matching
-to the misfit function. The combination of these two displays greatly improves
-a user's ability to reliably determine navigational offsets (and to conclude
-where navigational offsets cannot be determined).
-<P>
-The "Nav Err" window includes two buttons that are particularly useful during
-efforts to match seafloor features. The <Minimum Misfit>
-button below the misfit display will cause
-<B>mbnavadjust</B> to set the current navigational offset to that
-associated with the smallest misfit for the current misfit display. This button
-is often used first to get close to the right offsets.
-The <Zero Offset> button above the contour display will return both displays
-to a state of zero navigational offset.
-<P>
-The relationship between the contoured bathymetry and the misfit plot
-is usually quite clear. If a strongly matching seafloor feature
-exists, then a distinct minimum will show up in the misfit plot. If the navigation
-is good and the feature already matches, then the misfit minimum will be located
-at the center of the plot, corresponding to an offset that is zero distance in
-both the east-west and north-south directions. If the navigation is bad, then
-the misfit minimum will be offset from the origin, and the offset vector
-will correspond to how far and what direction one must move one swath so that
-the features in both swaths match. In cases where there is no distinctive
-seafloor feature to match, the misfit plot will not display a strong
-minimum and it will be impossible to determine the relative navigational
-offset. Alternatively, the existence of multiple similar features can
-produce multiple local minima in the misfit map. In this case, the ambiguity
-between multiple possible solutions prevents the determination of the
-navigational offset. We have found that combining both contour
-and misfit displays allows interactive, visually based decision making that
-is more generally reliable than any automated scheme we can devise.
-<P>
-Navigational offsets can only be used when they are associated with specific
-points on the overlapping swath navigation. These points are called "tie points".
-All crossings will begin with no tie points, and users can generate one or more
-tie points for any crossing as required.
-The creation and manipulation of tie points is discussed in detail in a later section.
-<P>
-It is also important to understand that any apparent navigation offset observed
-in the contour and misfit plots is relative. It may turn
-out that both swaths are poorly navigated and have to be moved, or that all
-of the offset can be applied to one swath or the other. The set of decisions about
-how to distribute the relative navigation offsets among the affected swath files
-intrinsically involves speed and acceleration changes. Fortunately,
-we are able to formulate the automated inversion process discussed below to obtain an
-optimal navigation solution.
-<P>
-<A NAME="lbAQ"> </A>
-<H3>Display Controls</H3>
-
-<P>
-The user controls the appearance of the bathymetry contour plot.
-The contours are generated at regular intervals in depth, and also change
-color and are annotated with downhill facing tickmarks at regular intervals.
-A controls dialog brought up by clicking on the <Settings->Contours> button
-allows the user to set the contour, color change, and tickmark intervals. This
-same dialog also sets a decimation parameter that causes the contours to be
-calculated from fewer soundings (the data are decimated by ignoring pings). The application of
-decimation may speed up the crossing loadings, but is not generally recommended
-unless the bathymetry is strongly oversampled.
-<P>
-Users may also use a "zoom" feature to focus on small areas in the contour plot.
-The center mouse button is used to drag a box over a region of interest in the
-contour plot. When the center button is released, both the contour and misfit plots
-are regenerated to show the smaller area.
-Users may zoom as many times in succession as
-desired. One cannot undo the individual zoom events, but clicking the <Full Size>
-button in the "Nav Err" window will cause the plots to show the original, full
-area covered by the two swaths in the current crossing.
-<P>
-The misfit plot represents lateral offsets scaled according to the current
-contour plot display. Specifically, the width and height of the misfit plot
-correspond to one half the width and height of the bathymetry contour plot.
-When the bathymetry plot area changes due to a zoom event, the misfit is
-recalculated and redisplayed centered around the current offset. The color map
-used for the misfit display is automatically scaled according to the
-minimum and maximum misfit values.
-<P>
-<A NAME="lbAR"> </A>
-<H3>Setting Crossing Ties and Offsets</H3>
-
-<P>
-In order to actually set the relative navigational offset between two particular
-points on overlapping or crossing swaths, the user must first create a tie point.
-This is accomplished by clicking on the <Add Tie> button in the "Nav Err" window.
-Once a tie point exists, it will be shown on the contour plot as two
-yellow or red-filled, black
-outlined squares connected by a thin black line. Each of the squares
-is located along one of the swath navigation tracks, and represents one of
-the navigation control points defined during data importation.
-There can be multiple tie points for each crossing, and
-each one is created by clicking on the <Add Tie> button.
-<P>
-Only one tie point
-will be active at any time. The active tie point is displayed with larger boxes
-(the inactive tie points are only 1/4 the size. If only one tie point has been
-defined, it will always be active. If more than one tie point exists,
-clicking on the <Select Tie> button in the "Nav Err" window will change the
-active tie point to the next in the list for the displayed crossing
-(the tie points are selected in the order in which they were
-created). If the user wishes to delete a tie point, then click <Select Tie> until
-the undesirable tie point is active, and then click <Delete Tie>.
-The active tie point will be
-displayed in red fill if either the associated navigation
-control points or the navigational offset have been changed since it was
-created or last set. If the active tie point is up-to-date, then it will
-be displayed in yellow fill. Each new tie point is initially displayed
-in yellow. All inactive tie points will be shown in yellow fill.
-<P>
-When viewing a crossing with one or more tie points, the offsets displayed are
-associated with the current tie point. As one moves the contours to match
-overlapping features, it is important to remember that the navigational
-offset will be applied to the navigation points indicated for the current
-tie. Thus, the feature being matched should derive from data (soundings)
-associated with those particular points on the shiptrack. This is
-accomplished by clicking on the bathymetric feature in the contour display
-with the right mouse button. The "right-click" causes <B>mbnavadjust</B> to
-find the soundings from each swath that are closest to the point clicked, and
-then to shift the current tie point to the navigation points on each swath
-that include these soundings (that is, the navigation points associated with
-the sonar pings that include the closest soundings).
-<P>
-In order to set, and save, a navigational offset that causes a bathymetric
-feature to be matched in overlapping swaths, the user must click the
-<Set Offset> button above the contour display. If a user changes
-the active tie point or loads a different crossing
-without clicking <Set Tie>, then no offset information will be saved.
-Conversely, for any crossing with one or more tie points,
-the <Reset Offset> button will reset the navigational
-offset to the last value set for the current crossing and tie point.
-<P>
-So, in practice, setting navigational offsets that will be used in obtaining
-an optimal navigation solution involves the following steps:
-<BR>
-
-<BR> <TT>       </TT>1. Identify a bathymetric feature with<BR>
-<BR> <TT>       </TT>   overlapping data so that it can be<BR>
-<BR> <TT>       </TT>   matched.<BR>
-<BR> <TT>       </TT>2. Create a tie point by clicking the<BR>
-<BR> <TT>       </TT>   <Add Tie> button.<BR>
-<BR> <TT>       </TT>3. Set the tie point location by right<BR>
-<BR> <TT>       </TT>   -clicking on the feature.<BR>
-<BR> <TT>       </TT>4. If necessary, zoom the display to<BR>
-<BR> <TT>       </TT>   focus on the bathymetric feature<BR>
-<BR> <TT>       </TT>   of interest by dragging a box<BR>
-<BR> <TT>       </TT>   with the middle mouse button.<BR>
-<BR> <TT>       </TT>5. Adjust the offsets so that the<BR>
-<BR> <TT>       </TT>   feature is matched in both swaths<BR>
-<BR> <TT>       </TT>   (operating in the contour display,<BR>
-<BR> <TT>       </TT>   the misfit display, or both).<BR>
-<BR> <TT>       </TT>6. Click the <Set Offset> button.<BR>
-<BR>
-
-These steps should be followed for every feature that can be matched
-in overlapping swaths.
-<P>
-In some cases, the user will find it useful
-to create and set multiple tie points in a single crossing. Other crossings
-may not allow any features to be matched. Users should click the
-<Skip Crossing> button on crossings that do not allow one or more offsets
-to be determined. In fact, <B>mbnavadjust</B> will
-only allow the calculation of a navigation
-solution when all of the crossings have been acted on by either having tie
-points set or by having been explicitly skipped.
-<P>
-Users should feel free to iterate any way they like during
-crossing inspection. Crossings may be displayed as many
-times as desired, and ties can be created, deleted, and
-changed without restriction. Users may also quit <B>mbnavadjust</B>
-and then later reopen the same project without losing any
-information.
-<P>
-<A NAME="lbAS"> </A>
-<H3>Setting Good, Poor and Fixed Navigation</H3>
-
-<P>
-The adjusted navigation model produced by <B>MBnavadjust</B> should be
-accurate to the bathymetric resolution in a relative sense, but fitting
-a set of relative offset ties does not provide constraints on the global
-location of the survey data. <B>MBnavadjust</B> provides two means to
-control the global location of the adjusted navigation. First, the global
-location of the model is essentially an average of the overall offsets
-associated with good navigation. Users may use the <Action->Set File Poor Navigation>
-menu item to set selected surveys or files to be ignored in setting the
-global model. Second, if certain data files are thought to have correct
-navigation, they can be fixed (e.g. to have zero adjustment) using the
-<Action->Set File Fixed Navigation> menu item. In this case, all of the
-non-fixed files are adjusted relative to the fixed files.
-<P>
-<A NAME="lbAT"> </A>
-<H2>USING MBNAVADJUST 3: INVERTING FOR AN OPTIMAL NAVIGATION SOLUTION</H2>
-
-<P>
-<A NAME="lbAU"> </A>
-<H3>Performing the Inversion</H3>
-
-<P>
-Once the user has interactively analyzed all of the crossings
-and closed the "Nav Err" window by clicking the <Dismiss> button,
-the <Action->Invert navigation> button becomes enabled. Clicking
-this button causes <B>mbnavadjust</B> to construct and solve
-an inversion for the optimal navigation.
-<P>
-The inversion solves for navigation adjustments at each
-navigation control point which satisfy the offsets at the tie points while
-minimizing speed and acceleration. The speed and acceleration penalty is
-set using a penalty weight value that may be varied. If the penalty weight
-is large, the navigation adjustments may be smooth and small but not fit the
-tie point offsets well. An infinite penalty weight produces uniformly
-zero adjustments. In contrast, a small penalty weight allows the tie point offsets
-to be fit as well as possible even if large speed and acceleration spikes
-are a consequence. Hoever, even with a zero penalty weight the inversion may
-not be able to exactly satisfy all of the tie point offsets. If some of
-the tie point offsets are conflicting (e.g. one tie point requires a navigation
-control point to move to the west while another tie point requires a
-move to the east), then the offsets cannot all be simultaneously fit
-exactly.
-<P>
-The inversion is actually performed many times with different penalty weights,
-and the "best" solution is selected and applied to the data. The details of
-how the "best" solution is identified are given in the section "Details
-of the Inversion" section below. A log of the inversion parameters, the results
-from each of the inversion iterations, and detailed results from the final
-inversion are output to the Message text window. The program then
-outputs an adjusted navigation file for each of the input swath files and
-updates (or creates) the parameter file for each swath file so that
-<B>mbprocess</B> will merge the adjusted navigation.
-<P>
-The output adjusted navigation files are named by adding a ".na#" suffix
-to the original swath data filename. If a swath file imported into
-<B>mbnavadjust</B> for the first time is named:
-<BR>
-
-<BR> <TT>       </TT>mbari_1998_55.mb57<BR>
-<BR>
-
-then the adjusted navigation resulting from that project will be named:
-<BR>
-
-<BR> <TT>       </TT>mbari_1998_55.mb57.na0<BR>
-<BR>
-
-If this file is imported into a second <B>mbnavadjust</B> project, the
-result from inversion in that project will be:
-<BR>
-
-<BR> <TT>       </TT>mbari_1998_55.mb57.na1<BR>
-<BR>
-
-In addition to generating the adjusted navigation, <B>mbnavadjust</B> also
-sets the NAVADJMODE and NAVADJFILE values in the <B>mbprocess</B>
-parameter file. In this case, the parameter file is named:
-<BR>
-
-<BR> <TT>       </TT>mbari_1998_55.mb57.par<BR>
-<BR>
-
-and the processed swath file generated by running <B>mbprocess</B> is:
-<BR>
-
-<BR> <TT>       </TT>mbari_1998_55p.mb57<BR>
-<BR>
-
-Refer to the <B>mbprocess</B> and <B>mbset</B> manual pages for details on
-the control and use of <B>mbprocess</B>.
-<P>
-Note that the relevant parameter file settings will reflect the most recent
-inversion in <B>mbnavadjust</B>.
-Users do need to be aware that the order of navigation processing is important
-because, when possible, <B>mbnavadjust</B> imports existing processed data files.
-The data within the <B>mbnavadjust</B> projects are not, however, updated when the
-source data are updated. Consequently,
-standard navigation processing should be completed and applied with <B>mbprocess</B>
-before a swath file is imported into an <B>mbnavadjust</B> project. If a swath
-file is to be used in multiple <B>mbnavadjust</B> projects, the first project
-should be finalized and the results applied before data are imported into the
-second.
-<P>
-<A NAME="lbAV"> </A>
-<H3>Fine-Tuning the Inversion</H3>
-
-<P>
-Once an inversion has been performed, the user should inspect the fit for each
-of the tie points before accepting and applying the adjusted navigation. The relationship
-between the interactively defined navigation offsets and the offsets associated with
-the inversion can be investigated numerically in the tie points table or
-visually in the "Nav Err" window.
-<P>
-We suggest first examining the tie points table
-by pulling down the <View->Show Ties> menu item. This table shows, from left to
-right, the identity of each tie point, the longitude and latitude offsets defined
-by the user (in meters), and the longitude and latitude residuals, or
-differences between these offsets and those associated with the inversion (in meters).
-If any of these residuals are unexpectedly large, simply clicking on the table line
-showing the suspect navigation tie will bring up the "Nav Err" window and load the
-crossing including that navigation tie. Once an inversion is performed, the
-"Nav Err" crossing displays show the inverted offset as a small '+' symbol
-on the misfit plot. The user can then determine whether the
-previously set navigation offset is truly required by the data. On occasion, one
-discovers that the offset obtained in the inversion is as consistent with
-the bathymetry as the offset originally set by the user. Once the offset values
-have been adjusted as necessary, they can be reset by clicking on the
-<Set Offset> button (just as in the earlier interactive sessions).
-<P>
-Once all of the suspect navigation ties have been inspected, and perhaps corrected,
-another inversion can be generated using the revised set of offsets. In this way,
-users can iterate over cycles of inversion and inspection until a satisfactory
-(self-consistemt) solution is obtained. When the final inversion has been
-performed, the user can then run <B>mbprocess</B> on all of the affected swath data
-files to produce a set of processed files incorporating the optimally adjusted
-navigation. Once again, we emphasize that users should always finalize an
-<B>mbnavadjust</B> project before importing affected swath data into another
-<B>mbnavadjust</B> project.
-<P>
-<A NAME="lbAW"> </A>
-<H3>Details of the Inversion</H3>
-
-<P>
-The inversion is constructed as a sparse overdetermined least squares
-matrix problem. Suppose we have N navigation control points in all of the
-swath files and have defined M tie points. The form of the problem is:
-<BR>
-
-<P>
-<BR>
-
-<BR> <TT>       </TT><B>A</B> <B>X</B> = <B>D</B><BR>
-<BR>
-
-<P>
-<BR>
-
-Here <B>X</B> is the vector of unknowns, which happen to be the changes in the longitude
-and latitude values of all of the navigation control points. So, there
-are 2N unknowns. Note that we
-do not solve directly for longitude and latitude, but rather for the change,
-or perturbation, to the longitude and latitude values.
-The matrix <B>A</B> contains 2N columns corresponding to
-the unknowns and a row for each of the constraints we can apply to
-the navigation adjustment problem. The number of elements in the "data"
-vector <B>D</B> also corresponds to the number of constraints.
-We apply four sets of constraints in this inverse problem:
-<BR>
-
-<BR> <TT>       </TT>1) Fixed navigation points<BR>
-<BR>
-
-<BR> <TT>       </TT>2) Penalize speed (first derivative)<BR>
-<BR>
-
-<BR> <TT>       </TT>3) Penalize acceleration (second derivative)<BR>
-<BR>
-
-<BR> <TT>       </TT>4) Fit navigation offsets at tie points<BR>
-<P>
-The first kind of constraint is simply expressed as:
-<BR>
-
-<P>
-<BR>
-
-<BR> <TT>       </TT>XLONj = 0<BR>
-<BR>
-
-<P>
-<BR>
-
-<TT>       </TT>XLATj = 0<BR>
-<BR>
-
-<P>
-<BR>
-
-where XLONj is the longitude change
-and XLATj is the latitude change for the "j"th navigation control point.
-<P>
-The second contraint (speed) is also one of minimization:
-<BR>
-
-<P>
-<BR>
-
-<BR> <TT>       </TT>-XLONj + XLONj+1<BR>
-<BR>
-
-<BR> <TT>       </TT>----------------  = 0<BR>
-<BR>
-
-<BR> <TT>       </TT>    -Tj + Tj+1<BR>
-<BR>
-
-<P>
-<BR>
-
-<BR> <TT>       </TT>-XLATj + XLATj+1<BR>
-<BR>
-
-<BR> <TT>       </TT>----------------  = 0<BR>
-<BR>
-
-<BR> <TT>       </TT>    -Tj + Tj+1<BR>
-<BR>
-
-<P>
-<BR>
-
-Here XLONj+1 and XLATj+1 are the longitude and latitude changes
-for the "j+1"th navigational control point and Tj and Tj+1 are the
-times of the "j"th and "j+1"th navigational control points. The
-denominator in these expressions is thus the time difference between
-the two navigation points. The speed constraint can only be applied
-to navigation control points that are sequential, and is not applied
-across breaks in the swath data. Note that multiple swath files
-may be sequential without breaks, while time gaps or breaks can occur
-within a single swath file. The existence of gaps or breaks in the
-swath data is determined solely on the basis of time gaps as the data
-are imported.
-<P>
-The third contraint (acceleration) is also one of minimization:
-<BR>
-
-<P>
-<BR>
-
-<BR> <TT>       </TT>XLONj - 2 * XLONj+1 + XLONj+2<BR>
-<BR>
-
-<BR> <TT>       </TT>-----------------------------     = 0<BR>
-<BR>
-
-<BR> <TT>       </TT>    -Tj + Tj+2<BR>
-<BR>
-
-<P>
-<BR>
-
-<BR> <TT>       </TT>XLATj -2 * XLATj+1 + XLATj+2<BR>
-<BR>
-
-<BR> <TT>       </TT>-----------------------------     = 0<BR>
-<BR>
-
-<BR> <TT>       </TT>    -Tj + Tj+2<BR>
-<BR>
-
-<P>
-<BR>
-
-The second derivative calculation requires three sequential
-navigation control points: j, j+1, and j+2.
-Here XLONj+2 and XLATj+2 are the longitude and latitude changes
-for the "j+2"th navigational control point and Tj and Tj+2 are the
-times of the "j"th and "j+2"th navigational control points. The
-denominator in these expressions is thus the time difference between
-the "j"th and "j+1"th navigation points.
-<P>
-The final, and most important constraints
-are the relative navigation ofsets defined for each of the M tie points.
-Since each offset has a longitude and a latitude value, there are 2M
-rows in <B>A</B> and elements in <B>D</B> associated with the tie points.
-If the "i"th tie point specifies an offset DLONi and DLATi between the "j1"th and "j2"th
-navigation control points, then the constraint may be expressed as:
-<BR>
-
-<P>
-<BR>
-
-<BR> <TT>       </TT>-XLONj1 + XLONj2 = DLONi<BR>
-<BR>
-
-<P>
-<BR>
-
-<BR> <TT>       </TT>-XLATj1 + XLATj2 = DLATi<BR>
-<BR>
-
-<P>
-<BR>
-
-<P>
-The size of the matrix problem will vary with the number of navigation
-control points, tie points, fixed points, and time gaps. However, the addition
-of the speed and acceleration minimization constraints guarentees that the
-number of constraints will always be larger than the number of unknowns, and
-so we will always be solving an overdetermined least squares problem.
-Each of the above equations contribute one row to the matrix problem, and each
-of these rows has at most three nonzero elements in <B>A</B>. As a result,
-this matrix problem is also always extremely sparse. This condition allows
-us to use one of a class of approximate least squares solution algorithms that are
-efficient in solving sparse problems. The algorithm used for <B>mbnavadjust</B>
-inversions is that of Olsen [1987].
-<P>
-The importance of the speed and acceleration minimization constraints is varied
-by multiplying the associated matrix row elements by a penalty weight value.
-In practice, the inversion is constructed and solved with many different
-penalty weights, and the "best" inversion is selected and applied. Generally
-speaking, we seek the smoothest inversion that satisfactorily fits the
-tie point offsets. We set smoothness using the penalty weight value so that larger
-penalty weights correspond to smoother solutions.
-We measure the fit to the tie point offsets using the usual least squares
-calculation:
-<BR>
-
-<BR> <TT>       </TT>   2      2                                    2<BR>
-<BR> <TT>       </TT>Fit  = Chi  = SUM(  (DLONi - (XLONj2 - XLONj1))<BR>
-<BR> <TT>       </TT>                                               2<BR>
-<BR> <TT>       </TT>                  + (DLATi - (XLATj2 - XLATj1))  )<BR>
-<BR>
-
-using the same notation as above. Note that the units of Chi are distance, and so
-are physically meaningful. A smaller Chi corresponds to a better fit to the
-tie point offsets. The Chi value will be smallest for a zero
-penalty weight, and increase as more smoothing is applied.
-<P>
-The initial solution is generated using a very small penalty weight to
-insure that the smoothing is negligible and that the tie point offsets are fit
-to the maximum degree possible. This first inversion is used to set a "reference"
-value of Chi. In some cases, the tie points offsets do not substantially conflict
-and it is possible for the inversion to fit the offsets nearly exactly so that
-Chi is quite small. If the initial Chi is greater than the target precision for
-the inversion (set from the Controls panel), <B>mbnavadjust</B> sets the
-reference fit to this initial value. Otherwise, the reference fit is set to
-the target precision. The default value is 0.1 meters, which is appropriate for
-high resolution, low-altitude surveys. Larger values will be more appropriate
-for large altitude (e.g. deep water hull-mounted) surveys. The program then
-recalculates solutions with different penalty weights until the resulting Chi
-is between 1.05 and 1.1 times the reference fit. This last solution is chosen
-as the best solution, reported as the navigation adjustment inversion solution,
-and applied to that swath data navigation.  The justification for choosing the
-optimal solution in this fashion is that this approach insures that the smoothness
-constraint is sufficient large to be impacting the fit, but not so large that
-the fit has been substantially degraded.
-<P>
-<A NAME="lbAX"> </A>
-<H2>REFERENCES</H2>
-
-<P>
-Nishimura, C. E., and D. W. Forsyth, Improvements in navigation
-using SeaBeam crossing errors, <I>Mar. Geophys. Res.</I>, <B>9</B>, 333-352, 1988.
-<BR>
-
-<BR>
-
-Olson, A. H., A Chebyshev condition for accelerating convergence of iterative tomographic
-methods - Solving large least squares problems,
-Phys. Earth Planet. Inter., 47, 333-345, 1987.
-<BR>
-
-<BR>
-
-Parker, R. L., <B>Geophysical Inverse Theory</B>, Princeton University Press, Princeton, NJ, 1994.
-<P>
-<A NAME="lbAY"> </A>
-<H2>SEE ALSO</H2>
-
-<B><A HREF="mbnavadjustmerge.html">mbnavadjustmerge</A>(1)</B>, <B><A HREF="mbsystem.html">mbsystem</A></B>(1), <B><A HREF="mbio.html">mbio</A></B>(1), <B><A HREF="mbprocess.html">mbprocess</A></B>(1),
-<B><A HREF="mbnavedit.html">mbnavedit</A></B>(1), <B><A HREF="mbset.html">mbset</A></B>(1)
-<P>
-<A NAME="lbAZ"> </A>
-<H2>BUGS</H2>
-
-It used to be too new to be bulletproof, now its too complicated to be bulletproof.
-Good luck.
-<P>
-
-<HR>
-<A NAME="index"> </A><H2>Index</H2>
-<DL>
-<DT><A HREF="#lbAB">NAME</A><DD>
-<DT><A HREF="#lbAC">VERSION</A><DD>
-<DT><A HREF="#lbAD">SYNOPSIS</A><DD>
-<DT><A HREF="#lbAE">DESCRIPTION</A><DD>
-<DT><A HREF="#lbAF">AUTHORSHIP</A><DD>
-<DT><A HREF="#lbAG">OPTIONS</A><DD>
-<DT><A HREF="#lbAH">INTERACTIVE CONTROLS</A><DD>
-<DL>
-<DT><A HREF="#lbAI">MBnavadjust Window</A><DD>
-<DT><A HREF="#lbAJ">Controls Window</A><DD>
-<DT><A HREF="#lbAK">Nav Err Window</A><DD>
-<DT><A HREF="#lbAL">Biases Window</A><DD>
-</DL>
-<DT><A HREF="#lbAM">USING MBNAVADJUST 1: IMPORTING DATA</A><DD>
-<DT><A HREF="#lbAN">USING MBNAVADJUST 2: INSPECTING CROSSINGS</A><DD>
-<DL>
-<DT><A HREF="#lbAO">Bringing Up The Nav Error Window</A><DD>
-<DT><A HREF="#lbAP">Interactively Matching Seafloor Features</A><DD>
-<DT><A HREF="#lbAQ">Display Controls</A><DD>
-<DT><A HREF="#lbAR">Setting Crossing Ties and Offsets</A><DD>
-<DT><A HREF="#lbAS">Setting Good, Poor and Fixed Navigation</A><DD>
-</DL>
-<DT><A HREF="#lbAT">USING MBNAVADJUST 3: INVERTING FOR AN OPTIMAL NAVIGATION SOLUTION</A><DD>
-<DL>
-<DT><A HREF="#lbAU">Performing the Inversion</A><DD>
-<DT><A HREF="#lbAV">Fine-Tuning the Inversion</A><DD>
-<DT><A HREF="#lbAW">Details of the Inversion</A><DD>
-</DL>
-<DT><A HREF="#lbAX">REFERENCES</A><DD>
-<DT><A HREF="#lbAY">SEE ALSO</A><DD>
-<DT><A HREF="#lbAZ">BUGS</A><DD>
-</DL>
-<HR>
-</PRE>
-
-<CENTER><P><BR>
-Last Updated: 22 April 2015</P></CENTER>
-
-<HR>
-<P><A HREF="mbsystem_man_list.html">Return to list of MB-System manual pages...</A></P>
-<P><A HREF="mbsystem_home.html"><IMG SRC="mbsystem_logo_small.gif" BORDER=0 HEIGHT=55 WIDTH=158 ALIGN=BOTTOM></A><A HREF="mbsystem_home.html">Back
-to MB-System Home Page...</A></P>
-
-</BODY>
-</HTML>
diff --git a/src/html/mbnavadjustmerge.html b/src/html/mbnavadjustmerge.html
deleted file mode 100644
index f394c89..0000000
--- a/src/html/mbnavadjustmerge.html
+++ /dev/null
@@ -1,373 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<HTML VERSION="2.0">
-<HEAD>
-   <TITLE>MB-System Unix Manual Page: mbnavadjustmerge</TITLE>
-<!-- WEBMAGIC VERSION NUMBER="2.0.2" -->
-<!-- WEBMAGIC TRANSLATION NAME="ServerRoot" SRC="/var/www/htdocs/" DST="/" -->
-<!-- WEBMAGIC TRANSLATION NAME="ProjectRoot" SRC="./" DST="" -->
-</HEAD>
-<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#336699" VLINK="#997040" ALINK="#CC9900">
-<BODY>
-<CENTER><H3><U>MB-System Unix Manual Page</U></H3></CENTER>
-<PRE>
-<H1>mbnavadjustmerge</H1>
-Section:  MB-System 5.0  (1)<BR>Updated:  21 March 2015 <BR><A HREF="#index">Index</A>
-<HR>
-
-<A NAME="lbAB"> </A>
-<H2>NAME</H2>
-
-<B>mbnavadjustmerge</B> - Tool to merge two MBnavadjust projects,
-either adding one to the first or outputting a new project combining
-both existing projects.
-<P>
-<A NAME="lbAC"> </A>
-<H2>VERSION</H2>
-
-Version 5.0
-<P>
-<A NAME="lbAD"> </A>
-<H2>SYNOPSIS</H2>
-
-<B>mbnavadjustmerge</B> --input=project-base [--input=project-add --output=project-output
---set-global-tie=file:section[:snav]/xoffset/yoffset/zoffset[/xsigma/ysigma/zsigma]
---set-global-tie-xyz=file:section[:snav]
---set-global-tie-xyonly=file:section[:snav]
---set-global-tie-zonly=file:section[:snav]
---unset-global-tie=file:section
---add-crossing=file1:section1/file2:section2
---set-tie=file1:section1/file2:section2/xoffset/yoffset/zoffset
---set-tie-xyz=file1:section1/file2:section2
---set-tie-xyonly=file1:section1/file2:section2
---set-tie-zonly=file1:section1/file2:section2
---unset-tie=file1:section1/file2:section2
---set-ties-xyz-with-file=file
---set-ties-xyonly-with-file=file
---set-ties-zonly-with-file=file
---set-ties-xyz-by-survey=survey
---set-ties-xyonly-by-survey=survey
---set-ties-zonly-by-survey=survey
---set-ties-xyz-by-block=survey1/survey2--set-ties-xyonly-by-block=survey1/survey2
---set-ties-zonly-by-block=survey1/survey2
---set-ties-zoffset-by-block=survey1/survey2/zoffset
---skip-unset-crossings
---insert-discontinuity=file:section
---verbose --help ]
-<P>
-<A NAME="lbAE"> </A>
-<H2>DESCRIPTION</H2>
-
-<B>MBnavadjustmerge</B> is a command line program that merges two
-existing <B>MBnavadjust</B> projects or modifies a single
-<B>MBnavadjust</B> project.
-<P>
-<B>MBnavadjust</B> is an interactive graphical program used to
-adjust swath data navigation by matching bathymetric features
-in overlapping and crossing swaths. The primary purpose of
-<B>mbnavadjust</B> is to eliminate relative navigational errors in swath
-data obtained from poorly navigated sonars.
-<P>
-With respect to the merging function, if the <B>MBnavadjustmerge</B>
-user specifies two input projects and no output project, then the
-second project is added to the first. If an output project is specified, then the
-two projects are merged and the new combined project is output.
-<P>
-In order to make use of the project modification commands, a
-single input project must be specified, along with one or more
-of the modification commands. These can include adding crossings,
-setting tie z-offset values, setting tie offsets (even if no
-corresponding crossing already exists), setting tie modes
-(xy only, z only, xyz),  and deleting ties.
-<P>
-<A NAME="lbAF"> </A>
-<H2>AUTHORSHIP</H2>
-
-David W. Caress (<A HREF="mailto:caress at mbari.org">caress at mbari.org</A>)
-<BR>
-
-<BR>  Monterey Bay Aquarium Research Institute
-<BR>
-
-Dale N. Chayes (<A HREF="mailto:dale at ldeo.columbia.edu">dale at ldeo.columbia.edu</A>)
-<BR>
-
-<BR>  Lamont-Doherty Earth Observatory
-<P>
-<A NAME="lbAG"> </A>
-<H2>OPTIONS</H2>
-
-<DL COMPACT>
-<DT><B>--input=project-base</B>
-
-<DD>
-<B>--input=project-add</B>
-
-The <B>--input</B> option defines an existing, input <B>MBnavadjust</B>
-project. A project may be defined by a relative or absolute path
-to the project *.nvh file or the project *.dir directory. This option
-can be used twice to specify two input projects. The first
-use of <B>--input</B> defines the base input project, and the second
-defines the add input project. In the case where the <B>--output</B>
-option is used to define an output project, the two input projects
-will both be copied to the new output project (<I>project-base</I> 
-first followed by <I>project-add</I>). If the <B>output</B> option is
-not specified, then the <I>project-base</I> project is used as the
-output, and the <I>project-add</I> project is added on to the
-<I>project-base</I> project. If only the base input project is
-specified, then that project will be modified according to one or
-more of the "add", "delete", "skip", or "set" commands.
-<DT><B>--output=project-output</B>
-
-<DD>
-This option defines the new <B>MBnavadjust output project. The two
-input projects will both be copied to the new output project
-(</B><I>project-base</I>  first followed by <I>project-add</I>).
-If the <B>output</B> option is
-not specified, then the <I>project-base</I> project is used as the
-output, and the <I>project-add</I> project is added on to the
-<I>project-base</I> project.
-<DT><B>--set-global-tie=file:section[:snav]/xoffset/yoffset/zoffset[/xsigma/ysigma/zsigma]</B>
-
-<DD>
-This options sets a global tie for a navigation point in the project. Global ties are
-ties to the global reference frame, which generally means GPS positions (e.g. WGS84).
-The file and section id's must be specified, along with the x (east-west), y (north-south),
-and z (vertical postive up) offset values in meters. If the snav id (navigation point id)
-is not specified, it is assumed to be 0, the first navigation point in the
-specified section. If the uncertainties in the global tie (xsigma, ysigma, zsigma)
-are not specified, then xsigma = ysigma = 10 m and zsigma = 0.5 m are assumed.
-<DT><B>--set-global-tie-xyz=file:section[:snav]</B>
-
-<DD>
-This option sets the mode of the existing specified global tie in the
-<B>MBnavadjust</B> project to be "XYZ". This means all three
-coordinates of the tie will be used as constraints in the inversion
-for an optimal navigation model.
-<DT><B>--set-global-tie-xyonly=file:section[:snav]</B>
-
-<DD>
-This option sets the mode of the existing specified global tie in the
-<B>MBnavadjust</B> project to be "XY". This means only the horizontal
-coordinates of the tie will be used as constraints in the inversion
-for an optimal navigation model.
-<DT><B>--set-global-tie-zonly=file:section[:snav]</B>
-
-<DD>
-This option sets the mode of the existing specified global tie in the
-<B>MBnavadjust</B> project to be "Z". This means only the vertical
-coordinate of the tie will be used as a constraint in the inversion
-for an optimal navigation model.
-<DT><B>--unset-global-tie=file:section</B>
-
-<DD>
-This option unsets (deletes) the specified global tie in the
-<B>MBnavadjust</B> project. 
-<DT><B>--add-crossing=file1:section1/file2:section2</B>
-
-<DD>
-This option adds the specified crossing to the <B>MBnavadjust</B> project.
-<DT><B>--set-tie=file1:section1/file2:section2/xoffset/yoffset/zoffset</B>
-
-<DD>
-This option adds the specified tie to the <B>MBnavadjust</B> project.
-If the corresponding crossing does not already exist, it will be
-created.
-<DT><B>--set-tie-xyz=file1:section1/file2:section2</B>
-
-<DD>
-This option sets the mode of the existing specified tie in the
-<B>MBnavadjust</B> project to be "XYZ". This means all three
-coordinates of the tie will be used as constraints in the inversion
-for an optimal navigation model.
-<DT><B>--set-tie-xyonly=file1:section1/file2:section2</B>
-
-<DD>
-This option sets the mode of the existing specified tie in the
-<B>MBnavadjust</B> project to be "XY". This means only the horizontal
-coordinates of the tie will be used as constraints in the inversion
-for an optimal navigation model.
-<DT><B>--set-tie-zonly=file1:section1/file2:section2</B>
-
-<DD>
-This option sets the mode of the existing specified tie in the
-<B>MBnavadjust</B> project to be "Z". This means only the vertical
-coordinate of the tie will be used as a constraint in the inversion
-for an optimal navigation model.
-<DT><B>--unset-tie=file1:section1/file2:section2</B>
-
-<DD>
-This option unsets (deletes) the specified tie in the
-<B>MBnavadjust</B> project. 
-<DT><B>--set-ties-xyz-with-file=file</B>
-
-<DD>
-This option sets the mode of all ties involved with the specified
-file in the <B>MBnavadjust</B> project to be "XYZ". This means all three
-coordinates of these ties will be used as constraints in the inversion
-for an optimal navigation model.
-<DT><B>--set-ties-xyonly-with-file=file</B>
-
-<DD>
-This option sets the mode of all ties involved with the specified
-file in the <B>MBnavadjust</B> project to be "XY". This means only the horizontal
-coordinates of these ties will be used as constraints in the inversion
-for an optimal navigation model.
-<DT><B>--set-ties-zonly-with-file=file</B>
-
-<DD>
-This option sets the mode of all ties involved with the specified
-file in the <B>MBnavadjust</B> project to be "Z". This means only the vertical
-coordinate of these ties will be used as constraints in the inversion
-for an optimal navigation model.
-<DT><B>--set-ties-xyz-with-survey=survey</B>
-
-<DD>
-This option sets the mode of all ties involved with the specified
-survey in the <B>MBnavadjust</B> project to be "XYZ". This means all three
-coordinates of these ties will be used as constraints in the inversion
-for an optimal navigation model.
-<DT><B>--set-ties-xyonly-with-survey=survey</B>
-
-<DD>
-This option sets the mode of all ties involved with the specified
-survey in the <B>MBnavadjust</B> project to be "XY". This means only the horizontal
-coordinates of these ties will be used as constraints in the inversion
-for an optimal navigation model.
-<DT><B>--set-ties-zonly-with-survey=survey</B>
-
-<DD>
-This option sets the mode of all ties involved with the specified
-survey in the <B>MBnavadjust</B> project to be "Z". This means only the vertical
-coordinate of these ties will be used as constraints in the inversion
-for an optimal navigation model.
-<DT><B>--set-ties-xyz-by-survey=survey</B>
-
-<DD>
-This option sets the mode of all ties between two sections in the specified
-survey in the <B>MBnavadjust</B> project to be "XYZ". This means all three
-coordinates of these ties will be used as constraints in the inversion
-for an optimal navigation model.
-<DT><B>--set-ties-xyonly-by-survey=survey</B>
-
-<DD>
-This option sets the mode of all ties between two sections in the specified
-survey in the <B>MBnavadjust</B> project to be "XY". This means only the horizontal
-coordinates of these ties will be used as constraints in the inversion
-for an optimal navigation model.
-<DT><B>--set-ties-zonly-by-survey=survey</B>
-
-<DD>
-This option sets the mode of all ties between two sections in the specified
-survey in the <B>MBnavadjust</B> project to be "Z". This means only the vertical
-coordinate of these ties will be used as constraints in the inversion
-for an optimal navigation model.
-<DT><B>--set-ties-xyz-by-block=survey1/survey2</B>
-
-<DD>
-This option sets the mode of all ties between sections of the specified
-two surveys in the <B>MBnavadjust</B> project to be "XYZ". This means all three
-coordinates of these ties will be used as constraints in the inversion
-for an optimal navigation model.
-<DT><B>--set-ties-xyonly-by-block=survey1/survey2</B>
-
-<DD>
-This option sets the mode of all ties between sections in the specified
-two surveys in the <B>MBnavadjust</B> project to be "XY". This means only the horizontal
-coordinates of these ties will be used as constraints in the inversion
-for an optimal navigation model.
-<DT><B>--set-ties-zonly-by-block=survey1/survey2</B>
-
-<DD>
-This option sets the mode of all ties between sections in the specified
-two surveys in the <B>MBnavadjust</B> project to be "Z". This means only the vertical
-coordinate of these ties will be used as constraints in the inversion
-for an optimal navigation model.
-<DT><B>--set-ties-zoffset-by-block=survey1/survey2/zoffset</B>
-
-<DD>
-This option resets the zoffset value of all ties between sections in the specified
-two surveys.
-<DT><B>--skip-unset-crossings</B>
-
-<DD>
-This option sets all unset crossings in the input projects to be
-skipped. This does not apply to any new crossings between the two
-merged projects.
-<DT><B>--verbose</B>
-
-<DD>
-This option increases the verbosity of <B>MBnavadjustmerge</B>, which
-means that more information than by default is output to the stderr stream of the
-shell.
-<DT><B>--help</B>
-
-<DD>
-This option causes <B>MBnavadjustmergeP to output a list of the
-possible command line options, and then exit.
-<P>
-</DL>
-</B><A NAME="lbAH"> </A>
-<H2>EXAMPLES</H2>
-
-Suppose you have two AUV survey missions, 20140515m1 and 10140515m2, that overlap
-slightly. If you have used <B>MBnavadjust</B> to adjust the navigation of the
-two missions separately, you can use <B>MBnavadjustmerge</B> to merge the two
-<B>MBnavadjust</B> projects into a single new project without losing any of the
-ties made between overlapping sections in the existing projects. If the two
-existing projects are named "Navadjust20140515m1" and "Navadjust20140515m2",
-respectively, then there exist project files with a ".nvh" suffix and project
-directories with a ".dir" suffix. To create a new <B>MBnavadjust</B> project
-combining the two existing projects, the following will suffice:
-<BR>
-
-<BR>     mbnavadjustmerge --input=Navadjust20140515m1.nvh                       --input=Navadjust20140515m2.nvh                       --output=Navadjust20140515All.nvh
-<P>
-The new project Navadjust20140515All can be opened and analyzed further using
-<B>MBnavadjust</B>. When opening the new project, the user should first solve
-for a comprehensive navigation adjustment model by selecting the <Action->Invert Navigation>
-menu item, and then find the crossings between the two previously separate missions
-by selecting the <Action->Check For New Crossings> menu item.
-<P>
-If the <B>--skip-unset-crossings</B> option is added to the above command, then
-all unset crossings in the two input projects will be set to "skipped" mode in
-the output project.
-<P>
-<A NAME="lbAI"> </A>
-<H2>SEE ALSO</H2>
-
-<B><A HREF="mbsystem.html">mbsystem</A></B>(1), <B><A HREF="mbio.html">mbio</A></B>(1), <B><A HREF="mbprocess.html">mbprocess</A></B>(1),
-<B><A HREF="mbnavadjust.html">mbnavadjust</A></B>(1), <B><A HREF="mbset.html">mbset</A></B>(1)
-<P>
-<A NAME="lbAJ"> </A>
-<H2>BUGS</H2>
-
-It started out simple and bulletproof, but now it's too complicated to be bulletproof. It's probably nerfgunproof, though.
-Good luck.
-<P>
-
-<HR>
-<A NAME="index"> </A><H2>Index</H2>
-<DL>
-<DT><A HREF="#lbAB">NAME</A><DD>
-<DT><A HREF="#lbAC">VERSION</A><DD>
-<DT><A HREF="#lbAD">SYNOPSIS</A><DD>
-<DT><A HREF="#lbAE">DESCRIPTION</A><DD>
-<DT><A HREF="#lbAF">AUTHORSHIP</A><DD>
-<DT><A HREF="#lbAG">OPTIONS</A><DD>
-<DT><A HREF="#lbAH">EXAMPLES</A><DD>
-<DT><A HREF="#lbAI">SEE ALSO</A><DD>
-<DT><A HREF="#lbAJ">BUGS</A><DD>
-</DL>
-<HR>
-</PRE>
-
-<CENTER><P><BR>
-Last Updated: 21 March 2015</P></CENTER>
-
-<HR>
-<P><A HREF="mbsystem_man_list.html">Return to list of MB-System manual pages...</A></P>
-<P><A HREF="mbsystem_home.html"><IMG SRC="mbsystem_logo_small.gif" BORDER=0 HEIGHT=55 WIDTH=158 ALIGN=BOTTOM></A><A HREF="mbsystem_home.html">Back
-to MB-System Home Page...</A></P>
-
-</BODY>
-</HTML>
diff --git a/src/html/mbnavedit.html b/src/html/mbnavedit.html
deleted file mode 100644
index 3d54fc6..0000000
--- a/src/html/mbnavedit.html
+++ /dev/null
@@ -1,835 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<HTML VERSION="2.0">
-<HEAD>
-   <TITLE>MB-System Unix Manual Page: mbnavedit</TITLE>
-<!-- WEBMAGIC VERSION NUMBER="2.0.2" -->
-<!-- WEBMAGIC TRANSLATION NAME="ServerRoot" SRC="/var/www/htdocs/" DST="/" -->
-<!-- WEBMAGIC TRANSLATION NAME="ProjectRoot" SRC="./" DST="" -->
-</HEAD>
-<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#336699" VLINK="#997040" ALINK="#CC9900">
-<BODY>
-<CENTER><H3><U>MB-System Unix Manual Page</U></H3></CENTER>
-<PRE>
-<H1>mbnavedit</H1>
-Section:  MB-System 5.0  (1)<BR>Updated:  3 June 2013 <BR><A HREF="#index">Index</A>
-<HR>
-
-<A NAME="lbAB"> </A>
-<H2>NAME</H2>
-
-<B>mbnavedit</B> - Interactive navigation editor for swath sonar data.
-<P>
-<A NAME="lbAC"> </A>
-<H2>VERSION</H2>
-
-Version 5.0
-<P>
-<A NAME="lbAD"> </A>
-<H2>SYNOPSIS</H2>
-
-<B>mbnavedit</B> [<B>-B</B><I>yr/mo/da/hr/mn/sc</I>
-<B>-D</B> <B>-E</B><I>yr/mo/da/hr/mn/sc</I>
-<B>-F</B><I>format </I><B>-G</B> <B>-I</B><I>infile </I><B>-N -P -T -X -V -H</B>]
-<P>
-<A NAME="lbAE"> </A>
-<H2>DESCRIPTION</H2>
-
-<B>MBnavedit</B> is an interactive editor used to identify and fix
-problems with the navigation of swath sonar data.
-<P>
-In the default mode the edited navigation is output to
-a file with the suffix ".nve" appended to the input swath
-data filename. The program can also be operated
-in a "browse" mode where no navigation is output.
-If saved, the edited navigation can be merged
-with the swath data using the program <B>mbprocess</B>, which
-outputs a processed swath data file.
-The <B>mbprocess</B> program is also used to apply
-bathymetry edits, recalculate bathymetry, and apply
-other corrections to swath bathymetry data. Users
-may cause <B>mbprocess</B> to be run automatically by
-specifying the <B>-X</B> option when starting <B>MBnavedit</B>.
-<P>
-In previous  versions of <B>MB-System</B>
-(version 4.6.10 or earlier), <B>MBnavedit</B>
-produced output swath data files directly by reading and
-storing all of the swath data information in memory (including
-non-survey data records). This approach limited the
-amount of data that could be handled
-at once, frequently requiring users to process files in
-small pieces. The current version only stores
-and outputs the navigation data.
-<P>
-Once the navigation
-from a swath data file has been
-read in, <B>MBnavedit</B> displays autoscaled plots of the longitude,
-latitude, speed, heading, and sonar depth time series, along with a plot of
-the time interval between navigation values. The user may select
-outliers and interpolate over them or, in the case of heading or
-speed data, replace the erroneous values with estimates derived
-from "course-made-good" or "speed-made-good", respectively.
-Data can only be selected and altered in a single
-plot at a time (this avoids confusion and prevents mistakes).
-<P>
-The nature of the navigation data being edited depends upon the
-data format. Some data formats include the navigation in the
-same data records as the ping or survey data. This synchronous
-navigation implies that either in the sonar or in later processing,
-the raw navigation has been interpolated to yield values at the
-same time stamps as the sonar pings. Other data formats do not
-hold navigation values in the survey data records, and instead use
-separate navigation records with different time stamps. This
-asynchronous navigation requires that MBIO interpolate or
-extrapolate the navigation as the survey data records are read.
-For data formats with synchronous navigation, the navigation
-values edited using <B>MBnavedit</B> are those in the survey data
-records. For data formats with only asynchronous navigation,
-<B>MBnavedit</B> displays and operates on the values from the
-navigation records. The <B>MBIO</B> manual page includes a listing
-of which type of navigation is used by the supported data formats.
-<P>
-For some data formats, the user can also
-inspect plots of roll, pitch, and heaved
-data to determine if the ship's vertical reference sensors
-were working properly.
-<P>
-The edited data is usually output to a file, but the program
-can be operated in a "browse" mode where no data is output.
-<P>
-<A NAME="lbAF"> </A>
-<H2>SMOOTHING NAVIGATION</H2>
-
-<P>
-Three algorithms for obtaining and using smooth navigation models are
-available. Replacing the original navigation with a smoothed
-version can be advantageous in some cases of very noisy
-navigation (typically from sonars on towed platforms or
-submerged vehicles). The first smoothing scheme is the covolution
-of a Gaussian kernal of user-defined time width with the data.
-Users may select and flag outlier navigation points; any flagged
-points are not used to calculate the Gaussian-weighted mean
-navigation values.
-The second approach is simple dead reckoning
-from the initial position using the current (possibly edited)
-heading and speed values. The dead reckoning navigation can also
-incorporate user-specified longitude and latitude drift rates.
-The third algorithm is an inversion for a smooth
-navigation that minimizes
-speed and acceleration while fitting the original navigation
-in a least squares sense. The inversion weighting against
-speed and acceleration are user specified, and only unflagged
-navigation values are used in the inversion.
-<P>
-<A NAME="lbAG"> </A>
-<H2>HANDLING BAD TIME STAMPS</H2>
-
-<P>
-The time interval plot allows
-users to spot problems with time stamps and to change the
-time stamps, if necessary. The most obvious time stamp errors
-are multiple pings with the same time stamps (producing a zero
-time interval value), or
-sequential pings with decreasing time stamps (resulting in
-negative time interval values). <B>MBnavedit</B>
-provides two tools for dealing with zero or negative time intervals:
-time stamp interpolation or deletion of the affected pings. Control
-dialogs allow users to apply either to the entire buffer at once.
-Time stamp interpolation may also be accomplished by selecting
-the relevant values in the time interval display, and then
-selecting interpolation.
-<P>
-If the navigation is
-asynchronous, that generally means the time interval should be
-constant since navigation systems are set to output values at
-a uniform rate. A problem with the time stamps of asynchronous
-navigation should produce spikes in both the time interval plot
-and the speed-made-good plot, and can be solved by selecting
-the offending point in the time interval plot and interpolating
-to reset the time stamp.
-<P>
-If the navigation is synchronous with the sonar
-pings, then the time interval will likely vary because the ping
-rate for most sonars varies with the sonars altitude above the
-seafloor. In this case, time stamp problems will
-not produce spikes in the speed-made-good plot
-because the navigation has been interpolated
-using the existing time stamps. Time interval spikes may also
-reflect problems with the sonar (e.g. occasional failure to ping
-at the appropriate time) rather than erroneous time stamps.
-<P>
-<A NAME="lbAH"> </A>
-<H2>AUTHORSHIP</H2>
-
-David W. Caress (<A HREF="mailto:caress at mbari.org">caress at mbari.org</A>)
-<BR>
-
-<BR>  Monterey Bay Aquarium Research Institute
-<BR>
-
-Dale N. Chayes (<A HREF="mailto:dale at ldeo.columbia.edu">dale at ldeo.columbia.edu</A>)
-<BR>
-
-<BR>  Lamont-Doherty Earth Observatory
-<P>
-<A NAME="lbAI"> </A>
-<H2>OPTIONS</H2>
-
-<B>-B</B>
-
-<I>yr/mo/da/hr/mn/sc</I>
-<BR>
-
-Sets the starting time for data allowed in the input data; pings
-with times before the starting time will be ignored.
-Default: <I>yr/mo/da/hr/mn/sc</I> = 1962/2/21/10/30/0.
-<DL COMPACT>
-<DT><B>-D</B>
-
-<DD>
-Starts up the program in "browse" mode. If a file is opened
-in browse mode (either at startup or later), none
-of the edited data will be output to a file. The default
-is to output the edited data to a file.
-<DT><B>-E</B>
-
-<DD>
-<I>yr/mo/da/hr/mn/sc</I>
-<BR>
-
-Sets the ending time for data allowed in the input data; pings
-with times after the ending time will be ignored.
-Default: <I>yr/mo/da/hr/mn/sc</I> = 2062/2/21/10/30/0.
-<DT><B>-F</B>
-
-<DD>
-<I>format</I>
-<BR>
-
-Sets the format at startup for the input and output swath sonar data using
-<B>MBIO</B> integer format identifiers. This value can also be set
-interactively when specifying the input file.
-This program uses the <B>MBIO</B> library and will read or write any swath sonar
-format supported by <B>MBIO</B>. A list of the swath sonar data formats
-currently supported by <B>MBIO</B> and their identifier values
-is given in the <B>MBIO</B> manual page.
-Default: <I>format</I> = 11.
-<DT><B>-G</B>
-
-<DD>
-This flag causes <B>MBnavedit</B> to treat the <B>Done</B> button as
-equivalent to the <B>Quit</B> button. This option is used when
-<B>MBnavedit</B> is started automatically by some other process and
-only a single file is to edited.
-<DT><B>-H</B>
-
-<DD>
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-<DT><B>-I</B>
-
-<DD>
-<I>infile</I>
-<BR>
-
-Sets the data file from which the input data will be read at startup.
-This value can also be set interactively.  If the input file is named
-using the <B>MB-System</B> convention of an ".mbXX" suffix (the XX
-corresponds to the <B>MBIO</B> format id), then the output file name
-will have an "e.mbXX" suffix. Otherwise, the output file will
-be <I>infile</I> with ".ed" appended.
-<DT><B>-N</B>
-
-<DD>
-Normally, all <B>MB-System</B> processing
-programs embed comment records describing the processing actions
-and parameters into output swath data files.
-This flag, when used in conjunction with the <B>-X</B> flag,
-causes <B>MBnavedit</B> to invoke <B>mbprocess</B> with it's
-<B>-N</B> option. In turn, this causes <B>mbprocess</B> to
-generate an output, processed swath data file without any
-comment records.
-<DT><B>-O</B>
-
-<DD>
-<I>outfile</I>
-<BR>
-
-Sets the output data file, overriding the file naming conventions
-discussed above in the <B>-I</B> option.
-<DT><B>-P</B>
-
-<DD>
-Causes <B>MBnavedit</B> to load and work with navigation from
-survey data records even if the data format uses asynchronous
-navigation records. In this case, the only edits which will
-actually be applied to the output data are changes to the
-time stamps of the survey records.
-<DT><B>-V</B>
-
-<DD>
-Normally, <B>MBnavedit</B> outputs information to the stderr stream
-regarding the number of records loaded and dumped.  If the
-<B>-V</B> flag is given, then <B>MBnavedit</B> works in a "verbose" mode and
-outputs the program version being used, all error status messages,
-and a large amount of other information including all of the
-beams flagged or zeroed.
-<DT><B>-X</B>
-
-<DD>
-This option causes <B>mbprocess</B> to run automatically
-on an input swath data file when the <B>MBnavedit</B> editing session
-is completed. The <B>-X</B> option effectively means that the
-corresponding processed swath data is generated or updated immediately.
-The program <B>mbprocess</B> will not be invoked if the
-editing session is in the browse mode.
-<P>
-</DL>
-<A NAME="lbAJ"> </A>
-<H2>INTERACTIVE CONTROLS</H2>
-
-<DL COMPACT>
-<DT><B>File</B>
-
-<DD>
-This button accesses a pulldown menu with two push buttons:
-<B>Open</B> and <B>File Selection List</B>,
-<DT><B>File->Open</B>
-
-<DD>
-This button brings up a popup window which allows the user to
-specify an input swath sonar bathymetry data file, its <B>MBIO</B>
-format id, and  the output mode.
-This program uses the <B>MBIO</B> library and
-will read or write any swath sonar
-format supported by <B>MBIO</B>. A list of the swath sonar data
-formats currently supported by <B>MBIO</B> and their
-identifier values is given in the <B>MBIO</B> manual page.
-If the swath sonar data file is named using the <B>MB-System</B>
-suffix convention (format 11 files end with ".mb11", format
-41 files end with ".mb41", etc.), then the program will
-automatically use the appropriate format id; otherwise the
-format must be set by the user.
-The popup window also allows the output mode to be set to "browse"
-so that no edit events are output.
-When a valid file is specified and the <B>OK</B> button
-is clicked, file will be added to an internal list of swath files
-available for editing, and then that file will be loaded into
-memory for editing (if another file was already loaded, that file
-is closed out gracefully before the new file is loaded).
-If the specified input is a datalist (format
-id = -1), then all of the files referenced through that datalist
-will be added to the internal list, and the first of those files
-loaded. When a file is loaded for editing, <B>MBnavedit</B> reads
-as much data as will fit into the data buffer (typically 25000 records)
-and several pings are displayed as stacked bathymetry profiles.
-<DT><B>File->File Selection List</B>
-
-<DD>
-This button brings up a popup window displaying the internal list of
-swath files available for editing. The list has four columns.
-The first (left-most) column is either blank or shows "<locked>" or "<loaded>".
-If a file is loaded for editing by this program, it shows as "<loaded>".
-If a file is being edited or processed by another program, it shows as
-"<locked>". Locked files cannot be opened for editing, and any file
-loaded for editing by <B>MBnavedit</B> will show as "locked" to other
-programs. The second column is either blank or shows "<nve>". This indicates if
-a file has been previously edited so that an edited navigation file already
-exists. The third and fourth columns show the filename path and the <B>MBIO</B>
-format id, respectively.
-Users can select one of the files in the available list. If the "Edit Selected File"
-button is clicked, the selected file will be opened for editing (and any
-file already loaded will be closed first). If the "Remove Selected File"
-button is selected, then the selected file will be removed from the available
-list.
-<DT><B>Controls</B>
-
-<DD>
-This button activates a pulldown menu with five buttons:
-<B>Time Stepping</B>, <B>Nav Modeling</B>, <B>Time Interpolation</B>,
-<B>Delete Bad Times</B>, and <B>Position Offset</B>. Each
-of these buttons brings up a dialog window containing widgets
-that set parameters or perform actions.
-<DT><B>Controls->Time Stepping->Time Span Shown</B>
-
-<DD>
-This slider sets the number of seconds of data shown at a time.
-This value is also set by the <B>Show Entire Buffer</B> button (sets
-time shown to all available data) and the <B>Pick Time Interval</B>
-function (sets time shown to an interactively specified interval).
-<DT><B>Controls->Time Stepping->Time Step</B>
-
-<DD>
-This slider sets the number of seconds to step when the <B>Forward</B>
-or <B>Reverse</B> buttons are pushed.
-<DT><B>Controls->Navigation Modeling->Off</B>
-
-<DD>
-This toggle button turns navigation modeling off.
-<DT><B>Controls->Navigation Modeling->Gaussian Mean</B>
-
-<DD>
-This toggle button enables navigation smoothing by convolution
-with a Gaussian kernel of user defined time width.
-When this toggle button is highlighted, a smooth
-navigation model is calculated and displayed
-as a blue line in both the longitude and latitude plots.
-The <B>Show Smooth Inversion</B> toggle buttons
-also appear (already enabled)
-for both the longitude and latitude plots
-among the plot display toggles on the left side of the main
-<B>MBnavedit</B> window.
-<DT><B>Controls->Navigation Modeling->Dead Reckoning</B>
-
-<DD>
-This toggle button enables dead reckoning navigation calculation.
-When this toggle button is highlighted, a dead reckoning
-navigation model is calculated from the initial position
-using the current heading and speed data and displayed
-as a blue line in both the longitude and latitude plots.
-The <B>Show Dead Reckoning</B> toggle buttons also appear (already enabled)
-for both the longitude and latitude plots
-among the plot display toggles on the left side of the main
-<B>MBnavedit</B> window.
-<DT><B>Controls->Navigation Modeling->Smooth Inversion</B>
-
-<DD>
-This toggle button enables inversion for a smooth navigation
-model which fits the original positions in a least squares
-sense while minimizing speed and acceleration.
-When this toggle button is highlighted, a smooth
-navigation model is calculated and displayed
-as a blue line in both the longitude and latitude plots.
-The <B>Show Smooth Inversion</B> toggle buttons
-also appear (already enabled)
-for both the longitude and latitude plots
-among the plot display toggles on the left side of the main
-<B>MBnavedit</B> window.
-<DT><B>Controls->Navigation Modeling->Gaussian Mean Time Window</B>
-
-<DD>
-This slider sets the width in seconds of the Gaussian smoothing
-kernel. If Gaussian mean smoothing is enabled, changing this slider
-causes the smoothing to be recalculated and the results shown on
-the longitude and latitude plots.
-<DT><B>Controls->Navigation Modeling->Dead Reckoning Longitude Drift</B>
-
-<DD>
-This slider sets the longitude drift rate in degrees/hour
-applied to the dead reckoning navigation calculation. If
-dead reckoning is enabled, changes
-to this slider cause the dead reckoning calculation to be
-redone and the results shown on the longitude and latitude plots.
-<DT><B>Controls->Navigation Modeling->Dead Reckoning Latitude Drift</B>
-
-<DD>
-This slider sets the latitude drift rate in degrees/hour
-applied to the dead reckoning navigation calculation. If
-dead reckoning is enabled, changes
-to this slider cause the dead reckoning calculation to be
-redone and the results shown on the longitude and latitude plots.
-<DT><B>Controls->Navigation Modeling->Speed Deviation</B>
-
-<DD>
-This text entry sets the penalty weighting against speed
-applied in the inversion for a smooth navigation. Higher values
-result in a smoother model; lower values result in a model
-that more closely follows the original navigation. The
-default value is 100. This value is not actually set until
-the <B>Apply</B> button to the left is clicked.
-<DT><B>Controls->Navigation Modeling->Acceleration</B>
-
-<DD>
-This text entry sets the penalty weighting against accleration
-applied in the inversion for a smooth navigation. Higher values
-result in a smoother model; lower values result in a model
-that more closely follows the original navigation. The
-default value is 100. This value is not actually set until
-the <B>Apply</B> button to the left is clicked.
-<DT><B>Controls->Navigation Modeling->Apply</B>
-
-<DD>
-This button causes the values in the <B>Speed Deviation</B> and
-<B>Acceleration</B> text entries to its right to be applied. If
-smooth inversion is enabled, then clicking this button
-will cause the inversion to be recalculated and the results
-displayed in the longitude and latitude plots.
-<DT><B>Controls->Navigation Modeling->Dismiss</B>
-
-<DD>
-This button causes the <B>Navigation Modeling</B> dialog
-to disappear.
-<DT><B>Controls->Time Interpolation->Apply</B>
-
-<DD>
-This button causes the time stamps of all data in
-the current buffer associated
-with negative or zero time intervals to be interpolated so
-that the time intervals are positive. The <B>Time Interpolation</B>
-dialog disappears after this action is taken.
-<DT><B>Controls->Time Interpolation->Dismiss</B>
-
-<DD>
-This button causes the <B>Time Interpolation</B> dialog
-to disappear.
-<DT><B>Controls->Delete Bad Times->Apply</B>
-
-<DD>
-This button causes all data in
-the current buffer associated
-with negative or zero time intervals to be deleted.
-The <B>Delete Bad Times</B>
-dialog disappears after this action is taken.
-<DT><B>Controls->Delete Bad Times->Dismiss</B>
-
-<DD>
-This button causes the <B>Delete Bad Times</B> dialog
-to disappear.
-<DT><B>Controls->Position Offset->Longitude Offset</B>
-
-<DD>
-This text widget allows the user to set the desired
-longitude offset in degrees.
-<DT><B>Controls->Position Offset->Latitude Offset</B>
-
-<DD>
-This text widget allows the user to set the desired
-latitude offset in degrees.
-<DT><B>Controls->Position Offset->Apply</B>
-
-<DD>
-This button applies the current longitude and latitude
-offsets to all of the navigation data.
-The <B>Position Offset</B>
-dialog disappears after this action is taken.
-<DT><B>Controls->Position Offset->Dismiss</B>
-
-<DD>
-This button causes the <B>Delete Bad Times</B> dialog
-to disappear.
-<DT><B>Start</B>
-
-<DD>
-This button causes the set of displayed pings to step backward to the
-beginning of the current buffer.
-<DT><B>Reverse</B>
-
-<DD>
-This button causes the set of displayed pings to step <I>nstep</I>
-pings backward in the current buffer.  The middle mouse button causes
-the same action.
-<DT><B>Forward</B>
-
-<DD>
-This button causes the set of displayed pings to step <I>nstep</I>
-pings forward in the current buffer.  The right mouse button causes
-the same action.
-<DT><B>End</B>
-
-<DD>
-This button causes the set of displayed pings to step forward to the
-end of the current buffer.
-<DT><B>Next Buffer</B>
-
-<DD>
-This button causes the program to write out the data from the
-current buffer and then read in and display the next buffer.
-If there is no more data to be read in after the current buffer
-has been written out, then the input and output files are closed.
-<DT><B>Show All</B>
-
-<DD>
-This button causes the plots to expand to show all of the data
-in the current buffer.
-<DT><B>Pick Zoom</B>
-
-<DD>
-This button allows users to focus the plots on a particular
-time interval. Once the button is pushed, the left mouse button
-is used to select the left edge of the time selection. Similarly,
-the middle mouse button selects the right edge of the time selection.
-Both ends of the time selection can be adjusted multiple times.
-Once the time interval of interest is selected to the users
-satisfaction, pressing the right mouse button will cause the
-plots to be redrawn with the selected beginning and ending
-times.
-<DT><B>Done | Next File</B>
-
-<DD>
-When the last file in the list of files available for editing has been loaded,
-this button shows as "Done". Otherwise, it shows as "Next File". In either
-case, this button causes the program to write out all of the edited navigation
-data and then close the current file. If the current file is not the last
-one in the available list, then the next unlocked file will be loaded for editing.
-<DT><B>Quit</B>
-
-<DD>
-This button causes the program to exit gracefully.  If a data file
-has been loaded, all of the edits will be output before exiting.
-<DT><B>About</B>
-
-<DD>
-This button causes a dialog to appear showing some information
-about the program.
-<DT><B>Interpolate</B>
-
-<DD>
-This button causes the selected data to be
-replaced by linear interpolation
-of the surrounding unselected data. If the selection extends to the
-edge of the data, the selected data will be replaced by the first
-unselected datum on the other side.
-<DT><B>Interpolate Repeats</B>
-
-<DD>
-This button causes any repeated values in the selected data to be
-replaced by linear interpolation between the first of the repeated
-values and the next different value.
-<DT><B>Revert Selection</B>
-
-<DD>
-This button causes the selected data to revert to their
-original values.
-<DT><B>Use Solution</B>
-
-<DD>
-This button only appears when one of the two navigation
-modeling algorithms is activated from the Navigation Modeling
-dialog.
-This button causes any selected longitude or latitude values
-to be replaced by values from navigation modeling. Either
-dead reckoning or smooth inversion navigation modeling
-must be enabled. The longitude and latitude values are
-replaced in pairs (if a longitude value is selected, the
-corresponding latitude value will also be replaced, and
-vice versa). The typical sequence is to:
-<BR>    1) adjust the modeling until an acceptable solution
-<BR>       is achieved.
-<BR>    2) click on the <B>Select All</B> toggle button
-<BR>    3) click in either the longitude or latitude plot
-<BR>       so that all values in that window are selected
-<BR>    4) click on the <B>Use Solution</B> button so that the
-<BR>       navigation model is adopted for all longitude
-<BR>       and latitude values
-<DT><B>Flag</B>
-
-<DD>
-This button only appears when either of the Gaussian mean or the smooth inversion navigation
-modeling algorithm is activated from the Navigation Modeling
-dialog.
-This button causes any selected longitude or latitude values
-to be flagged to be ignored by the navigation smoothing
-algorithm. Flagged positions are shown in orange.
-<DT><B>Unflag</B>
-
-<DD>
-This button only appears when the Gaussian mean or smooth inversion navigation
-modeling algorithm is activated from the Navigation Modeling
-dialog.
-This button causes any selected longitude or latitude values
-to be unflagged. Flagged positions are ignored by the navigation smoothing
-algorithm. Any positions which are unflagged will once again be
-used by the modeling method. Flagged positions are shown in orange.
-Unflagged positions are shown in either black (if they are unchanged)
-or purple (if they have been altered by interpolation or application
-of a modeling solution).
-<DT><B>Pick</B>
-
-<DD>
-Clicking on this toggle button sets the edit mode to "pick". In
-this case, clicking the left mouse button will cause the
-nearest data value to toggle between selected (red) and
-unselected.
-<DT><B>Select</B>
-
-<DD>
-Clicking on this toggle button sets the edit mode to "select". In
-this case, clicking and dragging the left mouse button will
-cause any data value touched by the cursor to become selected.
-<DT><B>Deselect</B>
-
-<DD>
-Clicking on this toggle button sets the edit mode to "deselect". In
-this case, clicking and dragging the left mouse button will
-cause any data value touched by the cursor to become unselected.
-<DT><B>Select All</B>
-
-<DD>
-Clicking on this toggle button sets the edit mode to "select all". In
-this case, clicking in any of the editable plots will cause all
-of the data in that plot to be selected.
-<DT><B>Deselect All</B>
-
-<DD>
-Clicking on this toggle button sets the edit mode to "select all". In
-this case, clicking in any of the editable plots will cause all
-of the data in that plot to be unselected.
-<DT><B>Time Interval Plot</B>
-
-<DD>
-This toggle button turns the time interval plot on and off.
-<DT><B>Show Original Data (Time Interval Plot)</B>
-
-<DD>
-When this toggle button is on, the time interval plot includes a
-green line representing the original time interval values.
-<DT><B>Longitude Plot</B>
-
-<DD>
-This toggle button turns the longitude plot on and off.
-<DT><B>Show Original Data (Longitude Plot)</B>
-
-<DD>
-When this toggle button is on, the longitude plot includes a
-green line representing the original longitude values.
-<DT><B>Show Dead Reckoning (Longitude Plot)</B>
-
-<DD>
-When this toggle button is on, the longitude plot includes a
-blue line representing the dead reckoning longitude values.
-<DT><B>Show Smooth Inversion (Longitude Plot)</B>
-
-<DD>
-When this toggle button is on, the longitude plot includes a
-blue line representing the smooth inversion longitude values.
-<DT><B>Latitude Plot</B>
-
-<DD>
-This toggle button turns the latitude plot on and off.
-<DT><B>Show Original Data (Latitude Plot)</B>
-
-<DD>
-When this toggle button is on, the latitude plot includes a
-green line representing the original latitude values.
-<DT><B>Show Dead Reckoning (Latitude Plot)</B>
-
-<DD>
-When this toggle button is on, the latitude plot includes a
-blue line representing the dead reckoning latitude values.
-<DT><B>Show Smooth Inversion (Latitude Plot)</B>
-
-<DD>
-When this toggle button is on, the latitude plot includes a
-blue line representing the smooth inversion latitude values.
-<DT><B>Speed Plot</B>
-
-<DD>
-This toggle button turns the speed plot on and off.
-<DT><B>Show Original Data (Speed Plot)</B>
-
-<DD>
-When this toggle button is on, the speed plot includes a
-green line representing the original speed values.
-<DT><B>Show Speed-Made-Good (Speed Plot)</B>
-
-<DD>
-When this toggle button is on, the speed plot includes a
-blue line representing the speed-made-good values derived
-from the longitude and latitude time series.
-<DT><B>Use Speed-Made-Good (Speed Plot)</B>
-
-<DD>
-When this button is pushed, any selected data in the speed
-plot will be replaced by the current estimates of speed-made-good.
-<DT><B>Heading Plot</B>
-
-<DD>
-This toggle button turns the heading plot on and off.
-<DT><B>Show Original Data (Heading Plot)</B>
-
-<DD>
-When this toggle button is on, the speed plot includes a
-green line representing the original speed values.
-<DT><B>Show Course-Made-Good (Heading Plot)</B>
-
-<DD>
-When this toggle button is on, the heading plot includes a
-blue line representing the course-made-good values derived
-from the longitude and latitude time series.
-<DT><B>Use Course-Made-Good (Heading Plot)</B>
-
-<DD>
-When this button is pushed, any selected data in the heading
-plot will be replaced by the current estimates of course-made-good.
-<DT><B>Roll, Pitch, and Heave Plots</B>
-
-<DD>
-This toggle button turns the roll, pitch, and heave plots on and off.
-Unlike the other plots, the data in these plots is not editable.
-These data are shown purely to allow users to determine if the
-vertical reference sensors were working properly at the time the
-data was collected (note: many swath data formats do not contain roll,
-pitch, and heave data).
-<P>
-</DL>
-<A NAME="lbAK"> </A>
-<H2>MOUSE ACTIONS</H2>
-
-<DL COMPACT>
-<DT><B>Left Mouse Button</B>
-
-<DD>
-The left mouse button is used to pick data values.  Unselected data
-values are shown as filled black squares and selected values
-as empty red squares.  The manner in which data are selected or
-unselected is controlled by the edit mode, as set by the
-<B>Pick</B>, <B>Select</B>, <B>Deselect</B>, <B>Select All</B>, and
-<B>Deselect All</B> buttons.
-<DT><B>Middle Mouse Button</B>
-
-<DD>
-The middle mouse button causes the set of displayed data to
-step backward in the current buffer by the amount of time
-set on the <B>Time Step</B> slider.
-The control button <B>Reverse</B> causes
-the same action.
-<DT><B>Right Mouse Button</B>
-
-<DD>
-The right mouse button causes the set of displayed data to
-step forward in the current buffer by the amount of time
-set on the <B>Time Step</B> slider.
-The control button <B>Forward</B> causes
-the same action.
-<P>
-</DL>
-<A NAME="lbAL"> </A>
-<H2>SEE ALSO</H2>
-
-<B><A HREF="mbsystem.html">mbsystem</A></B>(1), <B><A HREF="mbio.html">mbio</A></B>(1), <B><A HREF="mbprocess.html">mbprocess</A></B>(1), <B><A HREF="mbset.html">mbset</A></B>(1),
-<B><A HREF="mbedit.html">mbedit</A></B>(1), <B><A HREF="mbeditviz.html">mbeditviz</A></B>(1), <B><A HREF="mbinfo.html">mbinfo</A></B>(1)
-<P>
-<A NAME="lbAM"> </A>
-<H2>BUGS</H2>
-
-This program doesn't handle the roll, pitch, and heave data in a general way.
-<P>
-
-<HR>
-<A NAME="index"> </A><H2>Index</H2>
-<DL>
-<DT><A HREF="#lbAB">NAME</A><DD>
-<DT><A HREF="#lbAC">VERSION</A><DD>
-<DT><A HREF="#lbAD">SYNOPSIS</A><DD>
-<DT><A HREF="#lbAE">DESCRIPTION</A><DD>
-<DT><A HREF="#lbAF">SMOOTHING NAVIGATION</A><DD>
-<DT><A HREF="#lbAG">HANDLING BAD TIME STAMPS</A><DD>
-<DT><A HREF="#lbAH">AUTHORSHIP</A><DD>
-<DT><A HREF="#lbAI">OPTIONS</A><DD>
-<DT><A HREF="#lbAJ">INTERACTIVE CONTROLS</A><DD>
-<DT><A HREF="#lbAK">MOUSE ACTIONS</A><DD>
-<DT><A HREF="#lbAL">SEE ALSO</A><DD>
-<DT><A HREF="#lbAM">BUGS</A><DD>
-</DL>
-<HR>
-</PRE>
-
-<CENTER><P><BR>
-Last Updated: 3 June 2013</P></CENTER>
-
-<HR>
-<P><A HREF="mbsystem_man_list.html">Return to list of MB-System manual pages...</A></P>
-<P><A HREF="mbsystem_home.html"><IMG SRC="mbsystem_logo_small.gif" BORDER=0 HEIGHT=55 WIDTH=158 ALIGN=BOTTOM></A><A HREF="mbsystem_home.html">Back
-to MB-System Home Page...</A></P>
-
-</BODY>
-</HTML>
diff --git a/src/html/mbnavlist.html b/src/html/mbnavlist.html
deleted file mode 100644
index afafd72..0000000
--- a/src/html/mbnavlist.html
+++ /dev/null
@@ -1,521 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<HTML VERSION="2.0">
-<HEAD>
-   <TITLE>MB-System Unix Manual Page: mbnavlist</TITLE>
-<!-- WEBMAGIC VERSION NUMBER="2.0.2" -->
-<!-- WEBMAGIC TRANSLATION NAME="ServerRoot" SRC="/var/www/htdocs/" DST="/" -->
-<!-- WEBMAGIC TRANSLATION NAME="ProjectRoot" SRC="./" DST="" -->
-</HEAD>
-<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#336699" VLINK="#997040" ALINK="#CC9900">
-<BODY>
-<CENTER><H3><U>MB-System Unix Manual Page</U></H3></CENTER>
-<PRE>
-<H1>mbnavlist</H1>
-Section:  MB-System 5.0  (1)<BR>Updated:  3 June 2013 <BR><A HREF="#index">Index</A>
-<HR>
-
-<A NAME="lbAB"> </A>
-<H2>NAME</H2>
-
-<B>mbnavlist</B> - List navigation data in swath sonar data files.
-<P>
-<A NAME="lbAC"> </A>
-<H2>VERSION</H2>
-
-Version 5.0
-<P>
-<A NAME="lbAD"> </A>
-<H2>SYNOPSIS</H2>
-
-<B>mbnavlist</B> [<B>-B</B><I>yr/mo/da/hr/mn/sc</I> <B>-D</B><I>decimate</I>
-<B>-E</B><I>yr/mo/da/hr/mn/sc</I> <B>-F</B><I>format</I>
-<B>-G</B><I>delimeter</I> <B>-H</B> <B>-I</B><I>file</I> <B>-K</B><I>kind</I>
-<B>-L</B><I>lonflip</I> <B>-N</B><I>navchannel</I>
-<B>-O</B><I>output_format</I> <B>-R</B><I>west/east/south/north</I>
-<B>-S</B><I>speed</I> <B>-T</B><I>timegap</I> <B>-V</B> <B>-Z</B><I>segment</I>]
-<P>
-<A NAME="lbAE"> </A>
-<H2>DESCRIPTION</H2>
-
-<B>mbnavlist</B> prints the specified contents of navigation records
-in a swath sonar data file to stdout. By default, <B>mbnavlist</B>
-produces ASCII files in
-spreadsheet style, with data columns separated by tabs. Alternatively,
-other column delimiters can be used (<B>-G</B> option), or
-the output can be binary, with each field represented
-as a double precision float (<B>-A</B> option).  The output stream can
-be decimated using the <B>-D</B> option. The output of
-<B>mbnavlist</B> can be piped to plotting and data analysis programs. The
-option <B>-O</B><I>output_format</I> can be
-used to control the data types that
-are sent to stdout.
-<P>
-By default, <B>mbnavlist</B> extracts navigation from the
-data record type listed as the "navigation source" for a particular
-data format. Swath data formats may contain synchronous navigation
-(navigation is included in survey data records), asynchronous navigation
-(navigation comes in records separate from and at different times
-than the survey data records), or both (survey records contain merged
-navigation while the original asynchronous navigation is preserved in
-separate navigation records). Some data formats provide for multiple
-navigation sources, so that there are more than one channel of
-asynchronous data records. In this case one channel is always designated
-as the primary or active navigation channel. The <B>-N</B> option allows
-the user to specify that <B>mbnavlist</B> outputs navigation from
-the primary asynchronous navigation (<B>-N</B><I>0</I>) or from one
-of three auxiliary navigation channels
-(<B>-N</B><I>1</I>, <B>-N</B><I>2</I>, or <B>-N</B><I>3</I>). If the data
-format only uses asynchronous navigation, then the default
-navigation source will already be the primary asynchronous navigation
-and <B>-N</B> need not be used. If <B>-N</B> is used but the data file
-does not contain asynchronous navigation or the specified auxiliary
-navigation channels, then <B>mbnavlist</B> will output nothing. To
-determine if a datafile contains asynchronous navigation and/or auxiliary
-navigation, run <B>mbinfo</B> using its <B>-N</B> option to get counts
-of all data record types in the file.
-<P>
-Just to make things more complicated, many data formats formats pass
-heading and attitude data in records separate from position, and often
-with different timestamps and sampling rates. If, for instance, the
-attitude data are sampled at 10 Hz but position is only sampled at
-1 Hz, extracting roll using <B>mbnavlist</B> will, by default, either
-output roll values only at the sonar ping times (if the navigation source
-is the survey data) or at the position record times (if the navigation
-source is the asynchronous position data, but not at the attitude data
-times. Moreover, the attitude data will be interpolated onto the times
-of sonar pings or position fixes. In order to extract the full attitude
-data stream, the <B>-K</B><I>kind</I> option may be used, where <I>kind</I>
-is the identifier for the record type to be used as the trigger for output.
-Any desired values not contained in the selected record will be interpolated
-onto the times of the selected record. In order to identify the records
-available in a particular data file, use <B>mbinfo</B> with the <B>-N</B>
-option. This will show if a data file contains records of type MB_DATA_ATTITUDE,
-which has a record type identifier of 18, A list of the record type
-identifiers used within <B>MB-System</B> is given below, although not
-all of the record types have time stamps or can be used to define
-<B>mbnavlist</B> output. For example, requesting <B>mbnavlist</B> output
-associated with comment records will yield nonuseful results.
-<P>
-<A NAME="lbAF"> </A>
-<H2>AUTHORSHIP</H2>
-
-David W. Caress (<A HREF="mailto:caress at mbari.org">caress at mbari.org</A>)
-<BR>
-
-<BR>  Monterey Bay Aquarium Research Institute
-<BR>
-
-Dale N. Chayes (<A HREF="mailto:dale at ldeo.columbia.edu">dale at ldeo.columbia.edu</A>)
-<BR>
-
-<BR>  Lamont-Doherty Earth Observatory
-<BR>
-
-<P>
-<A NAME="lbAG"> </A>
-<H2>OPTIONS</H2>
-
-<DL COMPACT>
-<DT><B>-A</B>
-
-<DD>
-<BR>
-
-Causes the output to be binary (native double precision floating
-point) rather than ASCII. Some
-output options cannot be represented as single binary floats (e.g.
-time strings and longitude or latitude broken into degrees
-and minutes. These values are output as multiple fields as
-appropriate.
-Default: ASCII output with fields separated by tabs.
-<DT><B>-B</B>
-
-<DD>
-<I>yr/mo/da/hr/mn/sc</I>
-<BR>
-
-This option sets the starting time for data allowed in the input data.
-The <B>-E</B> option sets the ending time for data. If the
-starting time is before the ending time, then any data
-with a time stamp before the starting time or after the
-ending time is ignored. If instead the starting time is
-after the ending time, then any data between the ending
-and starting time will be ignored. This scheme allows time
-windowing both inside and outside a specified interval.
-Default: <I>yr/mo/da/hr/mn/sc</I> = 1962/2/21/10/30/0.
-<DT><B>-D</B>
-
-<DD>
-<I>decimate</I>
-<BR>
-
-Sets the decimation of the output data. By default (i.e. <I>decimate</I>=1),
-every available data record is output. If <I>decimate</I>>1, then only
-every "<I>decimate</I>"th record will be output. Default: <I>decimate</I>=1.
-<DT><B>-E</B>
-
-<DD>
-<I>yr/mo/da/hr/mn/sc</I>
-<BR>
-
-This option sets the ending time for data allowed in the input data.
-The <B>-B</B> option sets the starting time for data. If the
-starting time is before the ending time, then any data
-with a time stamp before the starting time or after the
-ending time is ignored. If instead the starting time is
-after the ending time, then any data between the ending
-and starting time will be ignored. This scheme allows time
-windowing both inside and outside a specified interval.
-Default: <I>yr/mo/da/hr/mn/sc</I> = 2062/2/21/10/30/0.
-<DT><B>-F</B>
-
-<DD>
-<I>format</I>
-<BR>
-
-Sets the format for the input swath sonar data using
-<B>MBIO</B> integer format identifiers.
-This program uses the <B>MBIO</B> library and will read any swath sonar
-format supported by <B>MBIO</B>. A list of the swath sonar data formats
-currently supported by <B>MBIO</B> and their identifier values
-is given in the <B>MBIO</B> manual page. Default: <I>format</I> = 11.
-<DT><B>-G</B>
-
-<DD>
-<I>delimiter</I>
-<BR>
-
-Sets the character(s) used to separate output fields when ascii
-columns are output. Default: tabs are used as delimiters.
-<DT><B>-H</B>
-
-<DD>
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-<DT><B>-I</B>
-
-<DD>
-<I>file</I>
-<BR>
-
-Sets the input filename. If <I>format</I> > 0 (set with the
-<B>-F</B> option) then the swath sonar data contained in <I>file</I>
-is read and processed. If <I>format</I> < 0, then <I>file</I>
-is assumed to be an ascii file containing a list of the input swath sonar
-data files to be processed and their formats.  The program will read
-the data in each one of these files.
-In the <I>file</I> file, each
-data file should be followed by a data format identifier, e.g.:
-<BR> <TT>       </TT>datafile1 11<BR>
-<BR> <TT>       </TT>datafile2 24<BR>
-<BR>
-
-This program uses the <B>MBIO</B> library and will read or write any swath sonar
-format supported by <B>MBIO</B>. A list of the swath sonar data formats
-currently supported by <B>MBIO</B> and their identifier values
-is given in the <B>MBIO</B> manual page.
-Default: <I>file</I> = "datalist.mb-1".
-<DT><B>-K</B>
-
-<DD>
-<I>kind</I>
-<BR>
-
-This option sets the type of data record used as the trigger for
-output. By default, data are output when the record type listed as
-the "navigation source" for a particular data format is encountered.
-The <B>-K</B> option causes output to be keyed to data records of
-type <I>kind</I>, where <I>kind</I> may be integer values such as:
-<BR>     MB_DATA_DATA<TT>       </TT><TT>        </TT><TT>        </TT>1<TT>       </TT>/* general survey data */<BR>
-<BR>     MB_DATA_CALIBRATE<TT>  </TT><TT>        </TT>4<TT>       </TT>/* Hydrosweep DS */<BR>
-<BR>     MB_DATA_MEAN_VELOCITY<TT>      </TT><TT>        </TT>5<TT>       </TT>/* Hydrosweep DS */<BR>
-<BR>     MB_DATA_VELOCITY_PROFILE<TT>   </TT>6<TT>       </TT>/* general */<BR>
-<BR>     MB_DATA_NAV<TT>        </TT><TT>        </TT><TT>        </TT>12<TT>      </TT>/* Simrad, Reson 7k */<BR>
-<BR>     MB_DATA_HEADING<TT>    </TT><TT>        </TT><TT>        </TT>17<TT>      </TT>/* Simrad, Hypack */<BR>
-<BR>     MB_DATA_ATTITUDE<TT>   </TT><TT>        </TT>18<TT>      </TT>/* Simrad, Hypack, Reson 7k */<BR>
-<BR>     MB_DATA_SSV<TT>        </TT><TT>        </TT><TT>        </TT>19<TT>      </TT>/* Simrad */<BR>
-<BR>     MB_DATA_NAV1<TT>       </TT><TT>        </TT><TT>        </TT>28<TT>      </TT>/* ancillary nav system 1 */<BR>
-<BR>     MB_DATA_NAV2<TT>       </TT><TT>        </TT><TT>        </TT>29<TT>      </TT>/* ancillary nav system 2 */<BR>
-<BR>     MB_DATA_NAV3<TT>       </TT><TT>        </TT><TT>        </TT>30<TT>      </TT>/* ancillary nav system 3 */<BR>
-<BR>     MB_DATA_MOTION<TT>     </TT><TT>        </TT><TT>        </TT>32<TT>      </TT>/* Reson 7k */<BR>
-<BR>     MB_DATA_SIDESCAN2<TT>  </TT><TT>        </TT>37<TT>      </TT>/* Reson 7k, XTF */<BR>
-<BR>     MB_DATA_SIDESCAN3<TT>  </TT><TT>        </TT>38<TT>      </TT>/* Reson 7k, XTF */<BR>
-<BR>     MB_DATA_ROLL<TT>       </TT><TT>        </TT><TT>        </TT>40<TT>      </TT>/* Reson 7k */<BR>
-<BR>     MB_DATA_PITCH<TT>      </TT><TT>        </TT><TT>        </TT>41<TT>      </TT>/* Reson 7k */<BR>
-<BR>     MB_DATA_NMEA_RMC<TT>   </TT><TT>        </TT>48<TT>      </TT>/* NMEA */<BR>
-<BR>     MB_DATA_NMEA_DBT<TT>   </TT><TT>        </TT>49<TT>      </TT>/* NMEA */<BR>
-<BR>     MB_DATA_NMEA_DPT<TT>   </TT><TT>        </TT>50<TT>      </TT>/* NMEA */<BR>
-<BR>     MB_DATA_NMEA_ZDA<TT>   </TT><TT>        </TT>51<TT>      </TT>/* NMEA */<BR>
-<BR>     MB_DATA_NMEA_GLL<TT>   </TT><TT>        </TT>52<TT>      </TT>/* NMEA */<BR>
-<BR>     MB_DATA_NMEA_GGA<TT>   </TT><TT>        </TT>53<TT>      </TT>/* NMEA */<BR>
-<BR>     MB_DATA_ATTITUDE1<TT>  </TT><TT>        </TT>55<TT>      </TT>/* ancillary attitude system 1 */<BR>
-<BR>     MB_DATA_ATTITUDE2<TT>  </TT><TT>        </TT>56      /* ancillary attitude system 2 */<BR>
-<BR>     MB_DATA_ATTITUDE3<TT>  </TT><TT>        </TT>57<TT>      </TT>/* ancillary attitude system 3 */<BR>
-<BR>
-
-For example, using <B>-K</B><I>18</I> will cause <B>mbnavlist</B> to output
-at the times of attitude data records. One consequence will be that
-any roll, pitch, or heave values specified with the <B>-O</B> option will
-be output without modification, whereas other values (e.g. position) will
-be interpolated onto the time of the attitude record.
-This option supercedes the <B>-N</B> option.
-<DT><B>-L</B>
-
-<DD>
-<I>lonflip</I>
-<BR>
-
-Sets the range of the longitude values returned.
-If <I>lonflip</I>=-1 then the longitude values will be in
-the range from -360 to 0 degrees. If <I>lonflip</I>=0
-then the longitude values will be in
-the range from -180 to 180 degrees. If <I>lonflip</I>=1
-then the longitude values will be in
-the range from 0 to 360 degrees.
-Default: <I>lonflip</I> = 0.
-<DT><B>-N</B>
-
-<DD>
-<I>navchannel</I>
-<BR>
-
-Sets <B>mbnavlist</B> to look for navigation in navigation records rather
-than the record type listed as the "navigation source" for a particular
-data format. Swath data formats may contain synchronous navigation
-(navigation is included in survey data records), asynchronous navigation
-(navigation comes in records separate from and at different times
-than the survey data records), or both (survey records contain merged
-navigation while the original asynchronous navigation is preserved in
-separate navigation records). Some data formats provide for multiple
-navigation sources, so that there are more than one channel of
-asynchronous data records. In this case one channel is always designated
-as the primary or active navigation channel. The <B>-N</B> option allows
-the user to specify that <B>mbnavlist</B> outputs navigation from
-the primary asynchronous navigation (<B>-N</B><I>0</I>) or from one
-of three auxiliary navigation channels
-(<B>-N</B><I>1</I>, <B>-N</B><I>2</I>, or <B>-N</B><I>3</I>). If <B>-N</B> is
-used but the data file
-does not contain asynchronous navigation or the specified auxiliary
-navigation channels, then <B>mbnavlist</B> will output nothing. To
-determine if a datafile contains asynchronous navigation and/or auxiliary
-navigation, run <B>mbinfo</B> using its <B>-N</B> option to get counts
-of all data record types in the file. This option is superceded by the
-<B>-K</B> option.
-<DT><B>-O</B>
-
-<DD>
-<I>output_format</I>
-<BR>
-
-Determines the form of the output. <I>Output_format</I> is a string composed
-of one or more of the following characters:
-<P>
-<BR> <TT>       </TT><B>c</B>  for sonar depth (meters)<BR>
-<BR> <TT>       </TT><B>H</B>  for heading (degrees)<BR>
-<BR> <TT>       </TT><B>h</B>  for course made good (degrees)<BR>
-<BR>  <TT>      </TT><B>J</B>  for a time string (yyyy jd hh mm ss.ssssss)<BR>
-<BR>                 where jd is the julian day of the year
-<BR>  <TT>      </TT><B>j</B>  for a time string (yyyy jd dm ss.ssssss)<BR>
-<BR>                 where jd is the julian day of the year
-<BR>                 and dm is the minute of the day
-<BR> <TT>       </TT><B>L</B>  for cumulative along-track distance (km)<BR>
-<BR> <TT>       </TT><B>l</B>  for cumulative along-track distance (m)<BR>
-<BR> <TT>       </TT><B>M</B>  for unix time in decimal seconds since 1/1/70 00:00:00<BR>
-<BR> <TT>       </TT><B>m</B>  for time in decimal seconds since first record<BR>
-<BR> <TT>       </TT><B>N</B>  for ping count<BR>
-<BR> <TT>       </TT><B>P</B>  for pitch in degrees<BR>
-<BR> <TT>       </TT><B>p</B>  for draft in meters<BR>
-<BR> <TT>       </TT><B>R</B>  for roll in degrees<BR>
-<BR> <TT>       </TT><B>r</B>  for heave in meters<BR>
-<BR>  <TT>      </TT><B>S</B>  for speed (km/hr)<BR>
-<BR>  <TT>      </TT><B>s</B>  for speed made good (km/hr)<BR>
-<BR>  <TT>      </TT><B>T</B>  for a time string (yyyy/mm/dd/hh/mm/ss)<BR>
-<BR> <TT>       </TT><B>t</B>  for a time string (yyyy mm dd hh mm ss)<BR>
-<BR> <TT>       </TT><B>U</B>  for unix time in integer seconds since 1/1/70 00:00:00<BR>
-<BR> <TT>       </TT><B>u</B>  for time in integer seconds since first record<BR>
-<BR> <TT>       </TT><B>V</B>  for ping interval (decimal seconds)<BR>
-<BR> <TT>       </TT><B>X</B>  for longitude (decimal degrees)<BR>
-<BR> <TT>       </TT><B>x</B>  for longitude (degrees + decimal minutes + E/W)<BR>
-<BR> <TT>       </TT><B>Y</B>  for latitude (decimal degrees)<BR>
-<BR> <TT>       </TT><B>y</B>  for latitude (degrees + decimal minutes + N/S)<BR>
-<P>
-Default <I>output_format</I> = <B>tMXYHs</B> (time, unix time, latitude,
-longitude, heading, speed).
-<DT><B>-R</B>
-
-<DD>
-<I>west/east/south/north</I>
-<BR>
-
-Sets the longitude and latitude bounds within which swath sonar
-data will be read. Only the data which lies within these bounds will
-be read.
-Default: <I>west</I>=-360, east<I>=360</I>, <I>south</I>=-90, <I>north</I>=90.
-<DT><B>-S</B>
-
-<DD>
-<I>speed</I>
-<BR>
-
-Sets the minimum speed in km/hr (5.5 kts ~ 10 km/hr) allowed in
-the input data; pings associated with a smaller ship speed will not be
-copied. Default: <I>speed</I> = 0.
-<DT><B>-T</B>
-
-<DD>
-<I>timegap</I>
-<BR>
-
-Sets the maximum time gap in minutes between adjacent pings allowed before
-the data is considered to have a gap. Default: <I>timegap</I> = 1.
-<DT><B>-V</B>
-
-<DD>
-Normally, <B>mbnavlist</B> works "silently" without outputting
-anything to the stderr stream.  If the
-<B>-V</B> flag is given, then <B>mbnavlist</B> works in a "verbose" mode and
-outputs the program version being used and all error status messages.
-<DT><B>-Z</B>
-
-<DD>
-<I>segment</I>
-<BR>
-
-Causes the ascii output of different input swath files
-(e.g. when a datalist is specified with the <B>-I</B> option)
-to be separated by lines with <I>segment</I>. If <I>segment</I>
-is a single character, then the output is a multiple segment
-file of the sort accepted by the <B>GMT</B> program <B>psxy</B>.
-This option only works with ascii output, and is thus disabled
-when the <B>-A</B> option is specified. The most common usage
-is <B>-Z</B>I>.
-<P>
-</DL>
-<A NAME="lbAH"> </A>
-<H2>EXAMPLES</H2>
-
-Suppose one wishes to obtain a navigation list from a Simrad EM300 data file
-in the MBARI format (MBIO id 57) called mbari_1998_107_msn.mb57. To
-obtain a listing with time in unix second forms followed
-by longitude and latitude, the following will suffice:
-<P>
-<BR> <TT>       </TT>mbnavlist -F57 -i mbari_1998_107_msn.mb57 -OMXY | more<BR>
-<P>
-The output will be as follows:
-<P>
-<BR> <TT>       </TT>889125106.792000        -155.898471       19.979325<BR>
-<BR> <TT>       </TT>889125108.148000        -155.898586       19.979400<BR>
-<BR> <TT>       </TT>889125109.496000        -155.898738       19.979454<BR>
-<BR> <TT>       </TT>889125110.852000        -155.898876       19.979504<BR>
-<BR> <TT>       </TT>889125112.207000        -155.899020       19.979544<BR>
-<BR> <TT>       </TT>889125113.571000        -155.899204       19.979591<BR>
-<BR> <TT>       </TT>889125114.921000        -155.899479       19.979485<BR>
-<BR> <TT>       </TT>.....<BR>
-<A NAME="lbAI"> </A>
-<H2>MB-SYSTEM DATA RECORD TYPES</H2>
-
-This list gives the data record types and numerical identifiers
-used within <B>MB-System</B>. Users can specify that <B>mbnavlist</B>
-output be keyed to the time stamps of particular record types by
-using the <B>-K</B><I>kind</I> option where <I>kind</I> corresponds
-to the desired record type identifier from this table.
-<P>
-<BR>     MB_DATA_KINDS<TT>      </TT><TT>        </TT><TT>        </TT>54<BR>
-<BR>     MB_DATA_NONE<TT>       </TT><TT>        </TT><TT>        </TT>0<BR>
-<BR>     MB_DATA_DATA<TT>       </TT><TT>        </TT><TT>        </TT>1<TT>       </TT>general survey data<BR>
-<BR>     MB_DATA_COMMENT<TT>    </TT><TT>        </TT><TT>        </TT>2<TT>       </TT>general comment<BR>
-<BR>     MB_DATA_HEADER<TT>     </TT><TT>        </TT><TT>        </TT>3<TT>       </TT>general header<BR>
-<BR>     MB_DATA_CALIBRATE<TT>  </TT><TT>        </TT>4<TT>       </TT>Hydrosweep DS<BR>
-<BR>     MB_DATA_MEAN_VELOCITY<TT>      </TT><TT>        </TT>5<TT>       </TT>Hydrosweep DS<BR>
-<BR>     MB_DATA_VELOCITY_PROFILE<TT>   </TT>6<TT>       </TT>general<BR>
-<BR>     MB_DATA_STANDBY<TT>    </TT><TT>        </TT><TT>        </TT>7<TT>       </TT>Hydrosweep DS<BR>
-<BR>     MB_DATA_NAV_SOURCE<TT> </TT><TT>        </TT>8<TT>       </TT>Hydrosweep DS<BR>
-<BR>     MB_DATA_PARAMETER<TT>  </TT><TT>        </TT>9<TT>       </TT>general<BR>
-<BR>     MB_DATA_START<TT>      </TT><TT>        </TT><TT>        </TT>10<TT>      </TT>Simrad<BR>
-<BR>     MB_DATA_STOP<TT>       </TT><TT>        </TT><TT>        </TT>11<TT>      </TT>Simrad<BR>
-<BR>     MB_DATA_NAV<TT>        </TT><TT>        </TT><TT>        </TT>12<TT>      </TT>Simrad, Reson 7k<BR>
-<BR>     MB_DATA_RUN_PARAMETER<TT>      </TT><TT>        </TT>13<TT>      </TT>Simrad<BR>
-<BR>     MB_DATA_CLOCK<TT>      </TT><TT>        </TT><TT>        </TT>14<TT>      </TT>Simrad<BR>
-<BR>     MB_DATA_TIDE<TT>       </TT><TT>        </TT><TT>        </TT>15<TT>      </TT>Simrad, Reson 7k<BR>
-<BR>     MB_DATA_HEIGHT<TT>     </TT><TT>        </TT><TT>        </TT>16<TT>      </TT>Simrad<BR>
-<BR>     MB_DATA_HEADING<TT>    </TT><TT>        </TT><TT>        </TT>17<TT>      </TT>Simrad, Hypack<BR>
-<BR>     MB_DATA_ATTITUDE<TT>   </TT><TT>        </TT>18<TT>      </TT>Simrad, Hypack, Reson 7k<BR>
-<BR>     MB_DATA_SSV<TT>        </TT><TT>        </TT><TT>        </TT>19<TT>      </TT>Simrad<BR>
-<BR>     MB_DATA_ANGLE<TT>      </TT><TT>        </TT><TT>        </TT>20<TT>      </TT>HSMD<BR>
-<BR>     MB_DATA_EVENT<TT>      </TT><TT>        </TT><TT>        </TT>21<TT>      </TT>HSMD<BR>
-<BR>     MB_DATA_HISTORY<TT>    </TT><TT>        </TT><TT>        </TT>22<TT>      </TT>GSF<BR>
-<BR>     MB_DATA_SUMMARY<TT>    </TT><TT>        </TT><TT>        </TT>23<TT>      </TT>GSF<BR>
-<BR>     MB_DATA_PROCESSING_PARAMETERS<TT>      </TT>24<TT>      </TT>GSF<BR>
-<BR>     MB_DATA_SENSOR_PARAMETERS<TT>  </TT>25<TT>      </TT>GSF<BR>
-<BR>     MB_DATA_NAVIGATION_ERROR<TT>   </TT>26<TT>      </TT>GSF<BR>
-<BR>     MB_DATA_RAW_LINE<TT>   </TT><TT>        </TT>27<TT>      </TT>uninterpretable line for ascii formats<BR>
-<BR>     MB_DATA_NAV1<TT>       </TT><TT>        </TT><TT>        </TT>28<TT>      </TT>ancillary nav system 1<BR>
-<BR>     MB_DATA_NAV2<TT>       </TT><TT>        </TT><TT>        </TT>29<TT>      </TT>ancillary nav system 2<BR>
-<BR>     MB_DATA_NAV3<TT>       </TT><TT>        </TT><TT>        </TT>30<TT>      </TT>ancillary nav system 3<BR>
-<BR>     MB_DATA_TILT<TT>       </TT><TT>        </TT><TT>        </TT>31<TT>      </TT>Simrad<BR>
-<BR>     MB_DATA_MOTION<TT>     </TT><TT>        </TT><TT>        </TT>32<TT>      </TT>Reson 7k<BR>
-<BR>     MB_DATA_CTD<TT>        </TT><TT>        </TT><TT>        </TT>33<TT>      </TT>Reson 7k<BR>
-<BR>     MB_DATA_SUBBOTTOM_MCS<TT>      </TT><TT>        </TT>34<TT>      </TT>Reson 7k<BR>
-<BR>     MB_DATA_SUBBOTTOM_CNTRBEAM<TT> </TT>35<TT>      </TT>Simrad<BR>
-<BR>     MB_DATA_SUBBOTTOM_SUBBOTTOM<TT>        </TT>36<TT>      </TT>Reson 7k, XTF<BR>
-<BR>     MB_DATA_SIDESCAN2<TT>  </TT><TT>        </TT>37<TT>      </TT>Reson 7k, XTF<BR>
-<BR>     MB_DATA_SIDESCAN3<TT>  </TT><TT>        </TT>38<TT>      </TT>Reson 7k, XTF<BR>
-<BR>     MB_DATA_IMAGE<TT>      </TT><TT>        </TT><TT>        </TT>39<TT>      </TT>Reson 7k<BR>
-<BR>     MB_DATA_ROLL<TT>       </TT><TT>        </TT><TT>        </TT>40<TT>      </TT>Reson 7k<BR>
-<BR>     MB_DATA_PITCH<TT>      </TT><TT>        </TT><TT>        </TT>41<TT>      </TT>Reson 7k<BR>
-<BR>     MB_DATA_ABSORPTIONLOSS<TT>     </TT><TT>        </TT>42<TT>      </TT>Reson 7k<BR>
-<BR>     MB_DATA_SPREADINGLOSS<TT>      </TT><TT>        </TT>43<TT>      </TT>Reson 7k<BR>
-<BR>     MB_DATA_INSTALLATION<TT>       </TT><TT>        </TT>44<TT>      </TT>Reson 7k<BR>
-<BR>     MB_DATA_WATER_COLUMN<TT>       </TT><TT>        </TT>45<TT>      </TT>Simrad<BR>
-<BR>     MB_DATA_STATUS<TT>     </TT><TT>        </TT><TT>        </TT>46<TT>      </TT>Simrad, XTF<BR>
-<BR>     MB_DATA_DVL<TT>        </TT><TT>        </TT><TT>        </TT>47<TT>      </TT>JSTAR<BR>
-<BR>     MB_DATA_NMEA_RMC<TT>   </TT><TT>        </TT>48<TT>      </TT>NMEA<BR>
-<BR>     MB_DATA_NMEA_DBT<TT>   </TT><TT>        </TT>49<TT>      </TT>NMEA<BR>
-<BR>     MB_DATA_NMEA_DPT<TT>   </TT><TT>        </TT>50<TT>      </TT>NMEA<BR>
-<BR>     MB_DATA_NMEA_ZDA<TT>   </TT><TT>        </TT>51<TT>      </TT>NMEA<BR>
-<BR>     MB_DATA_NMEA_GLL<TT>   </TT><TT>        </TT>52<TT>      </TT>NMEA<BR>
-<BR>     MB_DATA_NMEA_GGA<TT>   </TT><TT>        </TT>53<TT>      </TT>NMEA<BR>
-<BR>     MB_DATA_SURVEY_LINE<TT>        </TT><TT>        </TT>54<TT>      </TT>Reson 7k<BR>
-<BR>     MB_DATA_ATTITUDE1<TT>  </TT><TT>        </TT>55<TT>      </TT>ancillary attitude system 1<BR>
-<BR>     MB_DATA_ATTITUDE2<TT>  </TT><TT>        </TT>56      ancillary attitude system 2<BR>
-<BR>     MB_DATA_ATTITUDE3<TT>  </TT><TT>        </TT>57<TT>      </TT>ancillary attitude system 3<BR>
-<P>
-<A NAME="lbAJ"> </A>
-<H2>SEE ALSO</H2>
-
-<B><A HREF="mbsystem.html">mbsystem</A></B>(1), <B><A HREF="mbinfo.html">mbinfo</A></B>(1)
-<P>
-<A NAME="lbAK"> </A>
-<H2>BUGS</H2>
-
-<B>mbnavlist</B> is not able to list all of the navigation information
-available in some swath data formats.
-<P>
-
-<HR>
-<A NAME="index"> </A><H2>Index</H2>
-<DL>
-<DT><A HREF="#lbAB">NAME</A><DD>
-<DT><A HREF="#lbAC">VERSION</A><DD>
-<DT><A HREF="#lbAD">SYNOPSIS</A><DD>
-<DT><A HREF="#lbAE">DESCRIPTION</A><DD>
-<DT><A HREF="#lbAF">AUTHORSHIP</A><DD>
-<DT><A HREF="#lbAG">OPTIONS</A><DD>
-<DT><A HREF="#lbAH">EXAMPLES</A><DD>
-<DT><A HREF="#lbAI">MB-SYSTEM DATA RECORD TYPES</A><DD>
-<DT><A HREF="#lbAJ">SEE ALSO</A><DD>
-<DT><A HREF="#lbAK">BUGS</A><DD>
-</DL>
-<HR>
-</PRE>
-
-<CENTER><P><BR>
-Last Updated: 3 June 2013</P></CENTER>
-
-<HR>
-<P><A HREF="mbsystem_man_list.html">Return to list of MB-System manual pages...</A></P>
-<P><A HREF="mbsystem_home.html"><IMG SRC="mbsystem_logo_small.gif" BORDER=0 HEIGHT=55 WIDTH=158 ALIGN=BOTTOM></A><A HREF="mbsystem_home.html">Back
-to MB-System Home Page...</A></P>
-
-</BODY>
-</HTML>
diff --git a/src/html/mbneptune2esf.html b/src/html/mbneptune2esf.html
deleted file mode 100644
index b3e0737..0000000
--- a/src/html/mbneptune2esf.html
+++ /dev/null
@@ -1,277 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<HTML VERSION="2.0">
-<HEAD>
-   <TITLE>MB-System Unix Manual Page: mbneptune2esf</TITLE>
-<!-- WEBMAGIC VERSION NUMBER="2.0.2" -->
-<!-- WEBMAGIC TRANSLATION NAME="ServerRoot" SRC="/var/www/htdocs/" DST="/" -->
-<!-- WEBMAGIC TRANSLATION NAME="ProjectRoot" SRC="./" DST="" -->
-</HEAD>
-<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#336699" VLINK="#997040" ALINK="#CC9900">
-<BODY>
-<CENTER><H3><U>MB-System Unix Manual Page</U></H3></CENTER>
-<PRE>
-<H1>mbneptune2esf</H1>
-Section:  MB-System 5.0  (1)<BR>Updated:  3 June 2013 <BR><A HREF="#index">Index</A>
-<HR>
-
-<A NAME="lbAB"> </A>
-<H2>NAME</H2>
-
-<B>mbneptune2esf</B> - Tool to import beam flags from Simrad's Neptune system.
-<P>
-<A NAME="lbAC"> </A>
-<H2>VERSION</H2>
-
-Version 5.0
-<P>
-<A NAME="lbAD"> </A>
-<H2>SYNOPSIS</H2>
-
-<B>mbneptune2esf</B> [<B>-F</B><I>format</I>
-<B>-I</B><I>infile</I> <B>-O</B><I>outfile</I>
-<B>-M</B><I>mode</I> <B>-R</B><I>rules_file</I> <B>-V -H</B>]
-<P>
-<A NAME="lbAE"> </A>
-<H2>DESCRIPTION</H2>
-
-<B>mbneptune2esf</B> imports manual data flagging performed using Simrad's NEPTUNE
-software and flags those beams in the corresponding MB-System files.
-<P>
-The <B>binstat</B> tool in Simrad's NEPTUNE software has a number of advantages over mbedit
-as a tool for flagging bad data, including access to a variety of statistics from gridding
-the data. MB-System is generally more flexible and powerful in a number of other areas.
-<B>mbneptune2esf</B> tries to give you the best of both worlds.
-<P>
-<B>mbneptune2esf</B> reads a binstat_?.rules file generated by manually cleaning
-data using the correlation plot in the binstat tool of the neptune sofware
-written by Kongsberg Simrad and writes these edits in a mbsystem esf file.
-The purpose of this tool is to allow data cleaning done using neptune to
-be carried into the mbsystem environment - thus making neptune a more useful
-tool.
-<P>
-<B>mbneptune2esf</B> applies all the manual edits in the rules file given to those
-of the input files it recognises as matching the original lines.
-A line is considered to match if the line name contained in the rules file
-(e.g. 0002_20000408_221415) is part of the file name of the data file
-(e.g. 0002_20000408_221415.mb57).
-<P>
-Swath line files should be converted to format 57 using mbcopy before
-using this program, as format 56 does not have the ability to flag data
-(although data can be zeroed - but zero may be a valid depth).
-<P>
-Data flagged by rules generated in binstat is not flagged by this program -
-only manually flagged data is flagged.
-<P>
-<B>mbneptune2esf</B> can also be used to transfer processing done in neptune to other surveys.
-Neptune breaks a survey up into a number of blocks and records all the
-processing done in these blocks. Changing a block results in a loss of
-all the existing processing information. When adding data to an existing
-survey that falls outside any existing block, all of the existing blocks
-must be removed, and therefore all of the processing is lost.
-<B>mbneptune2esf</B> and <B>mbprocess</B>
-can be used to zero all the beams flagged during neptune processing and
-the processed files can then be used as the basis for a new survey, preserving
-the manual flagging (but losing the flagged data).
-The zero data can then be easily flagged in neptune.
-<P>
-<BR> <TT>       </TT>cd $RAWDATAHOME<BR>
-<BR> <TT>       </TT>ls *raw.all | while (read file) ; do<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT>echo $file 56 1 >> datalist.mb-1<BR>
-<BR> <TT>       </TT><TT>        </TT>done<BR>
-<BR> <TT>       </TT>cat $PROCHOME/old_survey/binstat_*.rules | mbneptune2esf -m3<BR>
-<BR> <TT>       </TT>mbprocess<BR>
-<BR> <TT>       </TT>cat *p.mb56 | handleEmX new_survey op<BR>
-<P>
-This program flags beams by outputting the flags as
-edit events to an "edit save file", like that produced
-by <B>mbedit</B>. If an "edit save file" (named by adding
-a ".esf" suffix to the input swath filename) already
-exists, the edits are read in and applied before the
-<B>mbneptune2esf</B> flagging algorithms are used.
-Once generated, the edit events can be applied
-to the data using the program <B>mbprocess</B>, which
-outputs a processed swath data file.
-The <B>mbprocess</B> program is also used to merge
-edited navigation, recalculate bathymetry, and apply
-other corrections to swath bathymetry data.
-<P>
-<A NAME="lbAF"> </A>
-<H2>AUTHORSHIP</H2>
-
-Gordon Keith (<A HREF="mailto:gordon.keith at csiro.au">gordon.keith at csiro.au</A>)
-<BR>
-
-<BR>  CSIRO Australia
-<BR>
-
-David W. Caress (<A HREF="mailto:caress at mbari.org">caress at mbari.org</A>)
-<BR>
-
-<BR>  Monterey Bay Aquarium Research Institute
-<BR>
-
-Dale N. Chayes (<A HREF="mailto:dale at ldeo.columbia.edu">dale at ldeo.columbia.edu</A>)
-<BR>
-
-<BR>  Lamont-Doherty Earth Observatory
-<P>
-<A NAME="lbAG"> </A>
-<H2>OPTIONS</H2>
-
-<DL COMPACT>
-<DT><B>-F</B>
-
-<DD>
-<I>format</I>
-<BR>
-
-Sets the data format used if the input is read from stdin
-or from a file. If <I>format</I> < 0, then the input file specified
-with the <B>-I</B> option will actually contain a list of input swath sonar
-data files. This program uses the <B>MBIO</B> library
-and will read or write any swath sonar
-format supported by <B>MBIO</B>. A list of the swath sonar data formats
-currently supported by <B>MBIO</B> and their identifier values
-is given in the <B>MBIO</B> manual page. Default: <I>format</I> = 11.
-Only formats 56 and 57 files are affected by this program. Other files are
-ignored.
-<DT><B>-H</B>
-
-<DD>
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-<DT><B>-I</B>
-
-<DD>
-<I>infile</I>
-<BR>
-
-Sets the input filename. If <I>format</I> > 0 (set with the
-<B>-F</B> option) then the swath sonar data contained in <I>infile</I>
-is read and processed. If <I>format</I> < 0, then <I>infile</I>
-is assumed to be an ascii file containing a list of the input swath sonar
-data files to be processed and their formats.  The program will read
-and process the data in each one of these files. Each input file will
-have an associated output file with the ".esf" suffix.
-In the <I>infile</I> file, each
-data file should be followed by a data format identifier, e.g.:
-<BR> <TT>       </TT>datafile1 11<BR>
-<BR> <TT>       </TT>datafile2 24<BR>
-<BR>
-
-This program uses the <B>MBIO</B> library and will read or write any swath sonar
-format supported by <B>MBIO</B>. A list of the swath sonar data formats
-currently supported by <B>MBIO</B> and their identifier values
-is given in the <B>MBIO</B> manual page.
-Only formats 56 and 57 files are affected by this program. Other files are ignored.
-Default: <I>infile</I> = "datalist.mb-1".
-<DT><B>-M</B>
-
-<DD>
-<I>mode</I>
-<BR>
-
-Sets the manner in which flagged by neptune are handled.
-<BR> <TT>       </TT><I>mode</I> = 1:<TT>       </TT>Flags the flagged beam.<BR>
-<BR> <TT>       </TT><I>mode</I> = 3:<TT>       </TT>Zeros the flagged beam.<BR>
-Default: <I>mode</I> = 1.
-<DT><B>-O</B>
-
-<DD>
-<I>outfile</I>
-<BR>
-
-Specifies a file to write a copy of the beam information extracted from the
-rules file. Mostly for debugging purposes.
-<DT><B>-R</B>
-
-<DD>
-<I>rules_file</I>
-<BR>
-
-The binstat rules file containing the manual flagging rules to be
-applied. Rules files are normally $PROCHOME/<I>survey</I>/binstat_<I>block</I>.rules.
-The LINES_PING_BEAM_RULE rules from this file will be applied to the
-matching line(s) in the input file.
-Default: <I>rules_file</I> = stdin.
-<DT><B>-V</B>
-
-<DD>
-Normally, <B>mbneptune2esf</B> works "silently" without outputting
-anything to the stderr stream.  If the
-<B>-V</B> flag is given, then <B>mbneptune2esf</B> works in a "verbose" mode and
-outputs the program version being used, all error status messages,
-and the number of beams flagged as bad.
-<P>
-</DL>
-<A NAME="lbAH"> </A>
-<H2>EXAMPLES</H2>
-
-<P>
-The normal use of <B>mbneptune2esf</B> would be to apply all the manual edits
-in a Neptune survey to the coresponding MB-System survey represented by a
-datalist:
-<P>
-<TT>        </TT>cat $PROCHOME/Broken_Reef/binstat_*.rules | \<BR>
-<BR> <TT>       </TT><TT>        </TT>mbneptune2esf -I/data/mbproc/Broken_Reef/datalist.mb-1<BR>
-<P>
-Since the default input file is the datalist in the current directory,
-the following is equivalent if the Neptune environment variable PROCHOME
-evaluates to /data/proc:
-<P>
-<BR> <TT>       </TT>cd /data/mbproc/Broken_Reef<BR>
-<BR> <TT>       </TT>cat /data/proc/Broken_Reef/binstat_*.rules | mbneptune2esf<BR>
-<P>
-To apply the manual edits from a particular block of a Neptune survey
-to only one of the related data files:
-<P>
-<BR> <TT>       </TT>mbneptune2esf -R $PROCHOME/Broken_Reef/binstat_1.rules \<BR>
-<BR> <TT>       </TT><TT>        </TT>-F57 -I0032_20000408_221201.mb57<BR>
-<P>
-To use the manual edits from a particular block of a Neptune survey
-to zero the beams of one of the related data files:
-<P>
-<BR> <TT>       </TT>mbneptune2esf -R $PROCHOME/Broken_Reef/binstat_2.rules<BR>
-<BR> <TT>       </TT><TT>        </TT>-M3  -F56 -I0002_20000408_153940_raw.all<BR>
-<P>
-<A NAME="lbAI"> </A>
-<H2>SEE ALSO</H2>
-
-<B><A HREF="mbsystem.html">mbsystem</A></B>(1), <B><A HREF="mbclean.html">mbclean</A></B>(1), <B><A HREF="mbedit.html">mbedit</A></B>(1),
-<B><A HREF="mbprocess.html">mbprocess</A></B>(1)
-<P>
-<A NAME="lbAJ"> </A>
-<H2>BUGS</H2>
-
-<B>mbneptune2esf</B> does not flag beams flagged by rules in binstat,
-only beams that are flagged manually using the correlation plot.
-<P>
-Probably plenty of others.
-<P>
-
-<HR>
-<A NAME="index"> </A><H2>Index</H2>
-<DL>
-<DT><A HREF="#lbAB">NAME</A><DD>
-<DT><A HREF="#lbAC">VERSION</A><DD>
-<DT><A HREF="#lbAD">SYNOPSIS</A><DD>
-<DT><A HREF="#lbAE">DESCRIPTION</A><DD>
-<DT><A HREF="#lbAF">AUTHORSHIP</A><DD>
-<DT><A HREF="#lbAG">OPTIONS</A><DD>
-<DT><A HREF="#lbAH">EXAMPLES</A><DD>
-<DT><A HREF="#lbAI">SEE ALSO</A><DD>
-<DT><A HREF="#lbAJ">BUGS</A><DD>
-</DL>
-<HR>
-</PRE>
-
-<CENTER><P><BR>
-Last Updated: 3 June 2013</P></CENTER>
-
-<HR>
-<P><A HREF="mbsystem_man_list.html">Return to list of MB-System manual pages...</A></P>
-<P><A HREF="mbsystem_home.html"><IMG SRC="mbsystem_logo_small.gif" BORDER=0 HEIGHT=55 WIDTH=158 ALIGN=BOTTOM></A><A HREF="mbsystem_home.html">Back
-to MB-System Home Page...</A></P>
-
-</BODY>
-</HTML>
diff --git a/src/html/mbotps.html b/src/html/mbotps.html
deleted file mode 100644
index dec5c36..0000000
--- a/src/html/mbotps.html
+++ /dev/null
@@ -1,457 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<HTML VERSION="2.0">
-<HEAD>
-   <TITLE>MB-System Unix Manual Page: mbotps</TITLE>
-<!-- WEBMAGIC VERSION NUMBER="2.0.2" -->
-<!-- WEBMAGIC TRANSLATION NAME="ServerRoot" SRC="/var/www/htdocs/" DST="/" -->
-<!-- WEBMAGIC TRANSLATION NAME="ProjectRoot" SRC="./" DST="" -->
-</HEAD>
-<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#336699" VLINK="#997040" ALINK="#CC9900">
-<BODY>
-<CENTER><H3><U>MB-System Unix Manual Page</U></H3></CENTER>
-<PRE>
-<H1>mbotps</H1>
-Section:  MB-System 5.0  (1)<BR>Updated:  20 November 2014 <BR><A HREF="#index">Index</A>
-<HR>
-
-<A NAME="lbAB"> </A>
-<H2>NAME</H2>
-
-<B>mbotps</B> - Predicts tides using the OSU Tidal Prediction Software (OTPS) distribution.
-<P>
-<A NAME="lbAC"> </A>
-<H2>VERSION</H2>
-
-Version 5.0
-<P>
-<A NAME="lbAD"> </A>
-<H2>SYNOPSIS</H2>
-
-<B>mbotps</B> [<B>-A</B><I>tideformat</I> <B>-B</B><I>year/month/day/hour/minute/second</I>
-<B>-D</B><I>interval</I> <B>-E</B><I>year/month/day/hour/minute/second
-</I><B>-F</B><I>format</I> <B>-I</B><I>datalist.mb-1</I>
-<B>-M</B> <B>-O</B><I>output</I> <B>-P</B><I>otps_location</I>
-<B>-R</B><I>lon/lat</I> <B>-T</B><I>model</I> <B>-V</B>]
-<P>
-<A NAME="lbAE"> </A>
-<H2>DESCRIPTION</H2>
-
-<B>MBotps</B> is a utility that predicts tides using the OTPS (OSU Tidal Prediction
-Software) package that can be downloaded at:
-<BR>    <A HREF="http://www.coas.oregonstate.edu/research/po/research/tide/">http://www.coas.oregonstate.edu/research/po/research/tide/</A>
-The OTPS utilities are operated in a batch mode using command files with
-a fairly arcane format. <B>MBotps</B> provides a command line interface that
-allows <B>MB-System</B> users to easily obtain tide models for specified locations
-and times. <B>MBotps</B> is built during a normal installation of <B>MB-System</B>,
-but will work only if the OTPS package has been installed separately and
-the OTPS location has been specified. See the INSTALL file in the <B>MB-System</B>
-top directory for guidance on the build process. 
-<P>
-There are actually three variants of the OTPS package available for download and
-installation: OTPS, OTPSnc, and OTPS2. The three versions use different tide
-model formats, but otherwise are used in the same way. OTPS uses tide models
-stored in a native binary format, OTPSnc  uses tide models in a netCDF format,
-and OTPS2 uses hybrid tide models combining a low resolution global model with
-higher resolution representation of many coastal regions.
-<P>
-The local OTPSnc installation can include more than one tidal model; several global
-and local models are available from the Oregon State tide group. By default,
-<B>mbotps</B> attempts to use a global tide model named tpxo7.2. Users can use
-the <B>-T</B><I>model</I> option to specify the desired model. If no model is
-specified, and tpxo7.2 is not available, then <B>mbotps</B> will use the first
-valid model found. It is the user's responsibility to ensure that the positions
-of requested tide values lie within the specified tide model's domain.
-<P>
-The OTPSnc models generally take the form of four files, all of which should be
-placed in a directory named "DATA" in the OTPSnc installation. For a model named
-ES2008, the files are:
-<BR>    Model_ES2008
-<BR>    gridES2008.nc
-<BR>    hf.ES2008.nc
-<BR>    uv.ES2008.nc
-<BR>
-
-Here the first file is a text file that references the other three; for
-<B>mbotps</B> the model name consists of the text that follows "Model_" in the
-first file's name. Most of the models one can obtain from the OSU tide group
-are intended to be used by running the OTPSnc program <B>predict_tide</B> from the
-OTPSnc installation directory, and thus reference the data files using relative
-paths. For example, the original contents of Model_ES2008 are:
-<BR>    DATA/gridES2008.nc
-<BR>    DATA/hf.ES2008.nc
-<BR>    DATA/uv.ES2008.nc
-<BR>
-
-In order for the OTPSnc to work when called by <B>mbotps</B>, the model data file
-paths must be global rather than relative. If the OTPSnc package has been
-installed in /usr/local/OTPSnc, then the model file Model_ES2008 should be
-edited to have the following contents:
-<BR>    /usr/local/OTPSnc/DATA/gridES2008.nc
-<BR>    /usr/local/OTPSnc/DATA/DATA/hf.ES2008.nc
-<BR>    /usr/local/OTPSnc/DATA/DATA/uv.ES2008.nc
-<BR>
-
-<P>
-<B>MBotps</B> can be operated in two modes. First, users may use the <B>-R</B>,
-<B>-B</B>, and <B>-E</B> options to specify a location and the beginning and end times of
-a tidal model for that location. The <B>-D</B> option sets the time interval of values in
-the output tidal model, and the <B>-O</B> option sets the output tidal model filename.
-<P>
-Alternatively, instead of specifying a place and time range, the user may specify
-one or more swath data files using the <B>-I</B> option. A tidal model is produced for
-each swath file in which tidal values are calculated using the sonar navigation
-locations at intervals specified with the <B>-D</B> option, and if the <B>-M</B> option
-is specified, the swath file's processing parameter file is modified so that <B>mbprocess</B>
-applies the tidal model during processing.
-<P>
-<A NAME="lbAF"> </A>
-<H2>AUTHORSHIP</H2>
-
-David W. Caress (<A HREF="mailto:caress at mbari.org">caress at mbari.org</A>)
-<BR>
-
-<BR>  Monterey Bay Aquarium Research Institute
-<BR>
-
-Dale N. Chayes (<A HREF="mailto:dale at ldeo.columbia.edu">dale at ldeo.columbia.edu</A>)
-<BR>
-
-<BR>  Lamont-Doherty Earth Observatory
-<P>
-<A NAME="lbAG"> </A>
-<H2>OPTIONS</H2>
-
-<DL COMPACT>
-<DT><B>-A</B>
-
-<DD>
-<I>tideformat</I>
-<BR>
-
-This option sets the tide format of the output text tide model files.
-If <I>tideformat</I> = 2 (the default), the tide is output in this format:
-<BR>
-
-<BR> <TT>       </TT>year month day hour minute second tide<BR>
-<BR>
-
-where the tide value is in meters.
-If <I>tideformat</I> = 1, then the output format is:
-<BR>
-
-<BR> <TT>       </TT>time_d tide<BR>
-<BR>
-
-where time_d is in seconds since January 1, 1970 and tide is in meters.
-<DT><B>-B</B>
-
-<DD>
-<I>yr/mo/da/hr/mn/sc</I>
-<BR>
-
-This option sets the starting time for for the output tidal model.
-<DT><B>-D</B>
-
-<DD>
-<I>interval</I>
-<BR>
-
-This option sets the time interval between tidal model values in seconds.
-Default: 60 seconds.
-<DT><B>-E</B>
-
-<DD>
-<I>yr/mo/da/hr/mn/sc</I>
-<BR>
-
-This option sets the ending time for the output tidal model
-<DT><B>-F</B>
-
-<DD>
-<I>format</I>
-<BR>
-
-Sets the data format of the input swath data file specified with the
-<B>-I</B> option. If <I>format</I> < 0, then the input file specified
-with the <B>-I</B> option will actually contain a list of input swath sonar
-data files. This program uses the <B>MBIO</B> library and will read any
-swath sonar format with timestamps supported by <B>MBIO</B>.
-A list of the swath sonar data formats
-currently supported by <B>MBIO</B> and their identifier values
-is given in the <B>MBIO</B> manual page. The default format is
-set using <B>mbdefaults</B>.
-<DT><B>-H</B>
-
-<DD>
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-<DT><B>-I</B>
-
-<DD>
-<I>filename</I>
-<BR>
-
-Sets the input filename. If <I>format</I> > 0 (set with the
-<B>-f</B> option) then the swath sonar data contained in <I>infile</I>
-is read and processed. If <I>format</I> < 0, then <I>infile</I>
-is assumed to be an ascii file containing a list of the input swath sonar
-data files to be processed and their formats.  The program will read
-the data in each one of these files.
-In the <I>infile</I> file, each
-data file should be followed by a data format identifier, e.g.:
-<BR> <TT>       </TT>datafile1 11<BR>
-<BR> <TT>       </TT>datafile2 24<BR>
-<BR>
-
-This program uses the <B>MBIO</B> library and will read or write any swath sonar
-format supported by <B>MBIO</B>. A list of the swath sonar data formats
-currently supported by <B>MBIO</B> and their identifier values
-is given in the <B>MBIO</B> manual page. Default: <I>infile</I> = "stdin".
-<DT><B>-M</B>
-
-<DD>
-If the <B>-I</B> option has been used so that tidal models are created for swath files,
-then this option causes each swath file's parameter file to be modified so that
-<B>mbprocess</B> will read and apply the ancilliary tidal model file created by
-<B>mbotps</B>.
-<DT><B>-O</B>
-
-<DD>
-<I>filename</I>
-<BR>
-
-Sets the filename of the tidal model output.
-<DT><B>-P</B>
-
-<DD>
-<I>otps_location</I>
-<BR>
-
-Sets the path to the local installation of OTPS, which in turn defines the
-location of the program <B>predict_tide</B> called by <B>mbotps</B> and
-the tide model to be used by <B>predict_tide</B>.
-<DT><B>-R</B>
-
-<DD>
-<I>longitude/latitude</I>
-<BR>
-
-Sets the longitude and latitude position at which the tidal model will be
-calculated.
-<DT><B>-T</B>
-
-<DD>
-<I>model</I>
-<BR>
-
-Sets the name of the OTPSnc tidal model to be used. This model must be part of
-the local OTPSnc installation. Examples include "tpxo7.2" and "altas".
-Default: "tpxo7.2"
-<DT><B>-V</B>
-
-<DD>
-Increases the verbosity of <B>mbotps</B>.
-<P>
-</DL>
-<A NAME="lbAH"> </A>
-<H2>EXAMPLES</H2>
-
-Suppose one wishes to obtain a tidal model for the location 121W 36N extending
-at 60 second intervals over the day February 21, 2009. The following will suffice:
-<BR> <TT>       </TT>mbotps -R-125/36 -B2009/02/21/00/00/00 -E2009/02/21/23/59/59 -V<BR>
-<BR>
-
-<BR>
-
-The shell output looks like:
-<P>
-<BR> <TT>       </TT>Program mbotps<BR>
-<BR> <TT>       </TT>Version $Id: mbotps.1 2215 2014-11-29 22:21:19Z caress $<BR>
-<BR> <TT>       </TT>MB-system Version 5.4.2137<BR>
-<P>
-<BR> <TT>       </TT>Checking for available OTPS tide models<BR>
-<BR> <TT>       </TT>OTPS location: /usr/local/OTPSnc<BR>
-<BR> <TT>       </TT>Valid OTPS tidal models:<BR>
-<BR> <TT>       </TT>     tpxo7.2<BR>
-<BR> <TT>       </TT>Number of available OTPS tide models: 1<BR>
-<P>
-<BR> <TT>       </TT>Using OTPS tide model:            tpxo7.2<BR>
-<P>
-<BR>  <TT>      </TT>Lat/Lon/Time file:tmp_mbotps_llt_10311.txt<BR>
-<BR>  <TT>      </TT>Predict OCEAN tide<BR>
-<BR> <TT>       </TT>Interpolate minor constituents<BR>
-<P>
-<BR> <TT>       </TT>Model:        OTPSnc/DATA/Model_tpxo7.2<BR>
-<BR> <TT>       </TT>Model is on grid uniform in lat,lon<BR>
-<BR> <TT>       </TT>Lat limits:     -90.1250000       90.1250000<BR>
-<BR> <TT>       </TT>Lon limits:     0.125000000       360.125000<BR>
-<BR> <TT>       </TT>Constituents: m2  s2  n2  k2  k1  o1  p1  q1  mf  mm  m4  ms4 mn4<BR>
-<BR> <TT>       </TT>Predict elevations (m)<BR>
-<BR> <TT>       </TT>Constituents to include: m2  s2  n2  k2  k1  o1  p1  q1  mf  mm  m4  ms4 mn4<BR>
-<BR> <TT>       </TT>Reading model... done<BR>
-<BR> <TT>       </TT>Results are in tmp_mbotps_llttd_10311.txt<BR>
-<P>
-<BR> <TT>       </TT>Results are really in tide_model.txt<BR>
-<BR>
-
-The output tidal model is in the file tide_model.txt, which includes
-data that look like:
-<BR> <TT>       </TT># Tide model generated by program mbotps<BR>
-<BR> <TT>       </TT># Version: $Id: mbotps.1 2215 2014-11-29 22:21:19Z caress $<BR>
-<BR> <TT>       </TT># MB-System Version: 5.4.2137<BR>
-<BR> <TT>       </TT># Tide model generated by program mbotps<BR>
-<BR> <TT>       </TT># which in turn calls OTPS program predict_tide obtained from:<BR>
-<BR> <TT>       </TT>#     <A HREF="http://www.coas.oregonstate.edu/research/po/research/tide/">http://www.coas.oregonstate.edu/research/po/research/tide/</A><BR>
-<BR> <TT>       </TT>#<BR>
-<BR> <TT>       </TT># OTPSnc tide model:<BR>
-<BR> <TT>       </TT>#      tpxo7.2<BR>
-<BR> <TT>       </TT># Output format:<BR>
-<BR> <TT>       </TT>#      year month day hour minute second tide<BR>
-<BR> <TT>       </TT># where tide is in meters<BR>
-<BR> <TT>       </TT># Run by user <caress> on cpu <deitz> at <Thu Aug 15 17:53:22 2013><BR>
-<BR> <TT>       </TT># Model:        OTPSnc/DATA/Model_tpxo7.2<BR>
-<BR> <TT>       </TT># Constituents included: m2  s2  n2  k2  k1  o1  p1  q1  mf  mm  m4  ms4 mn4<BR>
-<BR> <TT>       </TT>2009 02 21 00 00 00   -0.6840<BR>
-<BR> <TT>       </TT>2009 02 21 00 01 00   -0.6820<BR>
-<BR> <TT>       </TT>2009 02 21 00 02 00   -0.6790<BR>
-<BR> <TT>       </TT>2009 02 21 00 03 00   -0.6770<BR>
-<BR> <TT>       </TT>2009 02 21 00 04 00   -0.6740<BR>
-<BR> <TT>       </TT>2009 02 21 00 05 00   -0.6720<BR>
-<BR> <TT>       </TT>2009 02 21 00 06 00   -0.6690<BR>
-<BR> <TT>       </TT>2009 02 21 00 07 00   -0.6660<BR>
-<BR> <TT>       </TT>2009 02 21 00 08 00   -0.6640<BR>
-<BR> <TT>       </TT>2009 02 21 00 09 00   -0.6610<BR>
-<BR> <TT>       </TT>2009 02 21 00 10 00   -0.6580<BR>
-<BR> <TT>       </TT>2009 02 21 00 11 00   -0.6560<BR>
-<BR> <TT>       </TT>2009 02 21 00 12 00   -0.6530<BR>
-<BR> <TT>       </TT>2009 02 21 00 13 00   -0.6500<BR>
-<BR> <TT>       </TT>.................<BR>
-<BR> <TT>       </TT>2009 02 21 23 54 00   -0.7980<BR>
-<BR> <TT>       </TT>2009 02 21 23 55 00   -0.7970<BR>
-<BR> <TT>       </TT>2009 02 21 23 56 00   -0.7950<BR>
-<BR> <TT>       </TT>2009 02 21 23 57 00   -0.7940<BR>
-<BR> <TT>       </TT>2009 02 21 23 58 00   -0.7920<BR>
-<BR> <TT>       </TT>2009 02 21 23 59 00   -0.7900<BR>
-<BR>
-
-<BR>
-
-Now, suppose that one wants to apply tide corrections directly to a set of EM3002
-data in GSF format. First, execute <B>mbotps</B> with the datalist for the swath
-data specified as input:
-<BR> <TT>       </TT>mbotps -Idatalist.mb-1 -V<BR>
-<BR>
-
-The resulting shell output looks like:
-<BR>
-
-<BR> <TT>       </TT>Program mbotps<BR>
-<BR> <TT>       </TT>Version $Id: mbotps.1 2215 2014-11-29 22:21:19Z caress $<BR>
-<BR> <TT>       </TT>MB-system Version 5.4.2137<BR>
-<P>
-<BR> <TT>       </TT>Checking for available OTPS tide models<BR>
-<BR> <TT>       </TT>OTPS location: /usr/local/OTPSnc<BR>
-<BR> <TT>       </TT>Valid OTPS tidal models:<BR>
-<BR> <TT>       </TT>     tpxo7.2<BR>
-<BR> <TT>       </TT>Number of available OTPS tide models: 1<BR>
-<P>
-<BR> <TT>       </TT>Using OTPS tide model:            tpxo7.2<BR>
-<P>
-<BR> <TT>       </TT>---------------------------------------<BR>
-<P>
-<BR> <TT>       </TT>Processing tides for himbb05291.d23.mb121<BR>
-<P>
-<BR> <TT>       </TT>35602 records read from himbb05291.d23.mb121.fnv<BR>
-<P>
-<BR> <TT>       </TT> Lat/Lon/Time file:tmp_mbotps_llt_7413.txt<BR>
-<BR> <TT>       </TT> Constituents to include: m2  s2  n2  k2  k1  o1  p1  q1<BR>
-<BR> <TT>       </TT> Predict OCEAN tide<BR>
-<BR> <TT>       </TT> Interpolate minor constituents<BR>
-<P>
-<BR> <TT>       </TT> Model:        ss/sandbox/tides/OTPSnc/DATA/Model_tpxo7.2<BR>
-<BR> <TT>       </TT> Model is on grid uniform in lat,lon<BR>
-<BR> <TT>       </TT> Lat limits:    -90.125 90.125<BR>
-<BR> <TT>       </TT> Lon limits:    0.125 360.125<BR>
-<BR> <TT>       </TT> Constituents: m2  s2  n2  k2  k1  o1  p1  q1  mf  mm  m4  ms4 mn4<BR>
-<BR> <TT>       </TT> Predict elevations (m)<BR>
-<BR> <TT>       </TT> Constituents to include: m2  s2  n2  k2  k1  o1  p1  q1<BR>
-<BR> <TT>       </TT> Reading model... done<BR>
-<BR> <TT>       </TT> Results are in tmp_mbotps_llttd_7413.txt<BR>
-<P>
-<BR> <TT>       </TT>Results are really in himbb05291.d23.mb121.tde<BR>
-<BR>
-
-<BR>
-
-The output tide files have the same structure shown above:
-<BR> <TT>       </TT># Tide model generated by program mbotps<BR>
-<BR> <TT>       </TT># Version: $Id: mbotps.1 2215 2014-11-29 22:21:19Z caress $<BR>
-<BR> <TT>       </TT># MB-System Version: 5.4.2137<BR>
-<BR> <TT>       </TT># Tide model generated by program mbotps<BR>
-<BR> <TT>       </TT># which in turn calls OTPS program predict_tide obtained from:<BR>
-<BR> <TT>       </TT>#     <A HREF="http://www.coas.oregonstate.edu/research/po/research/tide/">http://www.coas.oregonstate.edu/research/po/research/tide/</A><BR>
-<BR> <TT>       </TT>#<BR>
-<BR> <TT>       </TT># OTPSnc tide model:<BR>
-<BR> <TT>       </TT>#      tpxo7.2<BR>
-<BR> <TT>       </TT># Output format:<BR>
-<BR> <TT>       </TT>#      year month day hour minute second tide<BR>
-<BR> <TT>       </TT># where tide is in meters<BR>
-<BR> <TT>       </TT># Run by user <caress> on cpu <deitz> at <Thu Aug 15 17:53:22 2013><BR>
-<BR> <TT>       </TT># Model:        OTPSnc/DATA/Model_tpxo7.2<BR>
-<BR> <TT>       </TT># Constituents included: m2  s2  n2  k2  k1  o1  p1  q1  mf  mm  m4  ms4 mn4<BR>
-<BR> <TT>       </TT>2005 10 18 19 01 36    0.0800<BR>
-<BR> <TT>       </TT>2005 10 18 19 02 36    0.0790<BR>
-<BR> <TT>       </TT>2005 10 18 19 03 36    0.0770<BR>
-<BR> <TT>       </TT>2005 10 18 19 04 36    0.0760<BR>
-<BR> <TT>       </TT>2005 10 18 19 05 37    0.0750<BR>
-<BR> <TT>       </TT>2005 10 18 19 06 37    0.0730<BR>
-<BR> <TT>       </TT>2005 10 18 19 07 37    0.0720<BR>
-<BR> <TT>       </TT>2005 10 18 19 08 37    0.0710<BR>
-<BR> <TT>       </TT>2005 10 18 19 09 37    0.0700<BR>
-<BR>
-
-In addition to generating *.tde files for each swath file referenced by the
-input datalist structure, <B>mbotps</B> modifies the parameter file associated
-with each swath file (creating it if necessary) so that tide correction is enabled
-using the *.tde file and tide format 2. When <B>mbprocess</B> is run on the same
-datalist, the files will be reprocessed, and the processing will include the
-application of the tide correction to all bathymetry.
-<P>
-<A NAME="lbAI"> </A>
-<H2>SEE ALSO</H2>
-
-<B><A HREF="mbsystem.html">mbsystem</A></B>(1), <B>mbprocess</B>, <B>mbset</B>
-<P>
-<A NAME="lbAJ"> </A>
-<H2>BUGS</H2>
-
-Installing the Fortran90 OTPSnc package from Oregon State is not particularly
-easy.
-<P>
-
-<HR>
-<A NAME="index"> </A><H2>Index</H2>
-<DL>
-<DT><A HREF="#lbAB">NAME</A><DD>
-<DT><A HREF="#lbAC">VERSION</A><DD>
-<DT><A HREF="#lbAD">SYNOPSIS</A><DD>
-<DT><A HREF="#lbAE">DESCRIPTION</A><DD>
-<DT><A HREF="#lbAF">AUTHORSHIP</A><DD>
-<DT><A HREF="#lbAG">OPTIONS</A><DD>
-<DT><A HREF="#lbAH">EXAMPLES</A><DD>
-<DT><A HREF="#lbAI">SEE ALSO</A><DD>
-<DT><A HREF="#lbAJ">BUGS</A><DD>
-</DL>
-<HR>
-</PRE>
-
-<CENTER><P><BR>
-Last Updated: 20 November 2014</P></CENTER>
-
-<HR>
-<P><A HREF="mbsystem_man_list.html">Return to list of MB-System manual pages...</A></P>
-<P><A HREF="mbsystem_home.html"><IMG SRC="mbsystem_logo_small.gif" BORDER=0 HEIGHT=55 WIDTH=158 ALIGN=BOTTOM></A><A HREF="mbsystem_home.html">Back
-to MB-System Home Page...</A></P>
-
-</BODY>
-</HTML>
diff --git a/src/html/mbpreprocess.html b/src/html/mbpreprocess.html
deleted file mode 100644
index ae55338..0000000
--- a/src/html/mbpreprocess.html
+++ /dev/null
@@ -1,135 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<HTML VERSION="2.0">
-<HEAD>
-   <TITLE>MB-System Unix Manual Page: mbpreprocess</TITLE>
-<!-- WEBMAGIC VERSION NUMBER="2.0.2" -->
-<!-- WEBMAGIC TRANSLATION NAME="ServerRoot" SRC="/var/www/htdocs/" DST="/" -->
-<!-- WEBMAGIC TRANSLATION NAME="ProjectRoot" SRC="./" DST="" -->
-</HEAD>
-<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#336699" VLINK="#997040" ALINK="#CC9900">
-<BODY>
-<CENTER><H3><U>MB-System Unix Manual Page</U></H3></CENTER>
-<PRE>
-<H1>mbpreprocess</H1>
-Section:  MB-System 5.0  (1)<BR>Updated:  14 March 2014 <BR><A HREF="#index">Index</A>
-<HR>
-
-<A NAME="lbAB"> </A>
-<H2>NAME</H2>
-
-<B>mbpreprocess</B> - performs preprocessing of swath sonar data as part of setting
-up an MB-System processing structure for a dataset.
-<P>
-<A NAME="lbAC"> </A>
-<H2>VERSION</H2>
-
-Version 5.0
-<P>
-<A NAME="lbAD"> </A>
-<H2>SYNOPSIS</H2>
-
-<B>mbpreprocess</B> [ 
-<B>--verbose</B>
-<B>--help</B>
-<B>--input</B>=<I>FILE</I>
-<B>--format</B>=<I>FORMAT</I>
-<B>--nav_file</B>=<I>FILE</I>
-<B>--nav_file_format</B>=<I>FORMAT</I>
-<B>--nav_async</B>=<I>RECORDTYPE</I>
-<B>--sensordepth_file</B>=<I>FILE</I>
-<B>--sensordepth_file_format</B>=<I>FILE</I>
-<B>--sensordepth_async</B>=<I>RECORDTYPE</I>
-<B>--heading_file</B>=<I>FILE</I>
-<B>--heading_file_format</B>=<I>FORMAT</I>
-<B>--heading_async</B>=<I>RECORDTYPE</I>
-<B>--attitude_file</B>=<I>FILE</I>
-<B>--attitude_file_format</B>=<I>FORMAT</I>
-<B>--attitude_async</B>=<I>RECORDTYPE</I>
-<B>--timeshift_file</B>=<I>FILE</I>
-<B>--timeshift_constant</B>=<I>TIME</I>
-<B>--timeshift_apply_nav</B>
-<B>--timeshift_apply_sensordepth</B>
-<B>--timeshift_apply_heading</B>
-<B>--timeshift_apply_attitude</B>
-<B>--timeshift_apply_all_ancilliary</B>
-<B>--timeshift_apply_survey</B>
-<B>--timeshift_apply_all</B>
-]
-<P>
-<A NAME="lbAE"> </A>
-<H2>DESCRIPTION</H2>
-
-MBpreprocess handles preprocessing of swath sonar data as part of setting
-up an MB-System processing structure for a dataset. This program replaces
-the several format-specific preprocessing programs
-found in MB-System version 5 releases with a single program for version 6.
-This program is under development, and is not ready for general use at
-this time.
-<P>
-<A NAME="lbAF"> </A>
-<H2>AUTHORSHIP</H2>
-
-David W. Caress (<A HREF="mailto:caress at mbari.org">caress at mbari.org</A>)
-<BR>
-
-<BR>  Monterey Bay Aquarium Research Institute
-<BR>
-
-Dale N. Chayes (<A HREF="mailto:dale at ldeo.columbia.edu">dale at ldeo.columbia.edu</A>)
-<BR>
-
-<BR>  Lamont-Doherty Earth Observatory
-<P>
-<A NAME="lbAG"> </A>
-<H2>OPTIONS</H2>
-
-<DL COMPACT>
-<DT><B>--verbose</B>
-
-<DD>
-By default <B>mbpreprocess</B> outputs minimal information to the shell. This option
-causes the program to indicate it's progress as it runs. Goody.
-<P>
-</DL>
-<A NAME="lbAH"> </A>
-<H2>EXAMPLES</H2>
-
-To be written.....
-<P>
-<A NAME="lbAI"> </A>
-<H2>SEE ALSO</H2>
-
-<B><A HREF="mbsystem.html">mbsystem</A></B>(1), <B><A HREF="mbdatalist.html">mbdatalist</A></B>(1), <B><A HREF="mbprocess.html">mbprocess</A></B>(1)
-<P>
-<A NAME="lbAJ"> </A>
-<H2>BUGS</H2>
-
-Oh yeah.
-<P>
-
-<HR>
-<A NAME="index"> </A><H2>Index</H2>
-<DL>
-<DT><A HREF="#lbAB">NAME</A><DD>
-<DT><A HREF="#lbAC">VERSION</A><DD>
-<DT><A HREF="#lbAD">SYNOPSIS</A><DD>
-<DT><A HREF="#lbAE">DESCRIPTION</A><DD>
-<DT><A HREF="#lbAF">AUTHORSHIP</A><DD>
-<DT><A HREF="#lbAG">OPTIONS</A><DD>
-<DT><A HREF="#lbAH">EXAMPLES</A><DD>
-<DT><A HREF="#lbAI">SEE ALSO</A><DD>
-<DT><A HREF="#lbAJ">BUGS</A><DD>
-</DL>
-<HR>
-</PRE>
-
-<CENTER><P><BR>
-Last Updated: 14 March 2014</P></CENTER>
-
-<HR>
-<P><A HREF="mbsystem_man_list.html">Return to list of MB-System manual pages...</A></P>
-<P><A HREF="mbsystem_home.html"><IMG SRC="mbsystem_logo_small.gif" BORDER=0 HEIGHT=55 WIDTH=158 ALIGN=BOTTOM></A><A HREF="mbsystem_home.html">Back
-to MB-System Home Page...</A></P>
-
-</BODY>
-</HTML>
diff --git a/src/html/mbprocess.html b/src/html/mbprocess.html
deleted file mode 100644
index 72d75a5..0000000
--- a/src/html/mbprocess.html
+++ /dev/null
@@ -1,1502 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<HTML VERSION="2.0">
-<HEAD>
-   <TITLE>MB-System Unix Manual Page: mbprocess</TITLE>
-<!-- WEBMAGIC VERSION NUMBER="2.0.2" -->
-<!-- WEBMAGIC TRANSLATION NAME="ServerRoot" SRC="/var/www/htdocs/" DST="/" -->
-<!-- WEBMAGIC TRANSLATION NAME="ProjectRoot" SRC="./" DST="" -->
-</HEAD>
-<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#336699" VLINK="#997040" ALINK="#CC9900">
-<BODY>
-<CENTER><H3><U>MB-System Unix Manual Page</U></H3></CENTER>
-<PRE>
-<H1>mbprocess</H1>
-Section:  MB\-System 5.0  (1)<BR>Updated:  10 November 2014 <BR><A HREF="#index">Index</A>
-<HR>
-
-<A NAME="lbAB"> </A>
-<H2>NAME</H2>
-
-<B>mbprocess</B> - this program performs a
-variety of swath data processing
-functions in a single step (producing
-a single output swath data file),
-including merging navigation, recalculating
-bathymetry from travel time
-and angle data by raytracing through a
-layered water sound velocity model,
-applying changes to ship draft, roll bias and pitch bias,
-applying tides,
-and applying bathymetry edits from edit save files.
-<P>
-<A NAME="lbAC"> </A>
-<H2>VERSION</H2>
-
-Version 5.0
-<P>
-<A NAME="lbAD"> </A>
-<H2>SYNOPSIS</H2>
-
-<B>mbprocess</B> <B>-I</B><I>infile</I> [<B>-F</B><I>format</I>
-<B>-N</B> <B>-O</B><I>outfile</I> <B>-P -S -T -V -H</B>]
-<P>
-<A NAME="lbAE"> </A>
-<H2>DESCRIPTION</H2>
-
-The program <B>mbprocess</B> is a tool for
-processing swath sonar bathymetry data.
-This program
-can perform a variety of swath data processing functions in
-a single step (producing a single output swath data file),
-including:
-<BR>     - Merge edited navigation generated by <B>mbnavedit</B>.
-<BR>     - Apply bathymetry edit flags from <B>mbedit</B>
-<BR>       and <B>mbclean</B>
-<BR>     - Recalculate bathymetry from raw travel time and
-<BR>       angle data by raytracing through water sound speed
-<BR>       models from <B>mbvelocitytool</B> or <B>mbsvplist</B>.
-<BR>     - Apply changes to roll bias, pitch bias, heading
-<BR>       bias, and draft values.
-<BR>     - Recalculate sidescan from raw backscatter samples
-<BR>       (Simrad multibeam data only).
-<BR>     - Apply corrections to sidescan based on amplitude vs
-<BR>       grazing angle tables obtained with <B>mbbackangle</B>.
-<BR>     - Apply tides to bathymetry.
-<BR>     - Insert metadata.
-<P>
-The actions of <B>mbprocess</B> are controlled by text
-parameter files. Each <B>mbprocess</B> parameter file
-contains single line commands that set
-processing modes and parameters. The program <B>mbset</B>
-can be used to create and modify <B>mbprocess</B> parameter files.
-Other programs such as <B>mbedit</B>, <B>mbnavedit</B>,
-<B>mbvelocitytool</B>, <B>mbnavadjust</B>, and <B>mbclean</B>
-modify or create (if needed) <B>mbprocess</B> parameter files.
-<P>
-The input file "infile"  must be specified with the <B>-I</B> option.
-If "infile" is a datalist, then <B>mbprocess</B> will
-attempt to process each swath data file identified by recursively
-reading the datalist. Otherwise, <B>mbprocess</B> will attempt
-to process "infile" directly.
-<P>
-For any swath data file "datafile", the program
-will look for and use a parameter file with the
-name "datafile.par". If no parameter file exists, <B>mbprocess</B>
-will infer a reasonable processing path by looking for navigation
-and mbedit edit save files.The data format
-can also be specified, though the program can
-infer the format if the standard MB-System suffix convention
-is used (*.mbXX where XX is the MB-System format id number).
-<P>
-The processed output swath files produced by <B>mbprocess</B>
-are named using a convention based on the data format id.
-<B>MB-System</B> data formats are specified
-using two-digit or three-digit numbers (see the <B>MBIO</B> manual page).
-If an input swath data file is named "root.mbXX", where XX is the format
-id, then the default processed output file will be "rootp.mbXX"
-(e.g. mydata.mb71 -> mydatap.mb71).
-The "p" inserted before the ".mbXX" suffix indicates the output
-file has been created by <B>mbprocess</B>.
-If the input file does not follow the *.mbXX naming convention,
-then the output filename will just consist of the input name
-with "p.mbXX" added as a suffix (e.g. mydata -> mydatap.mb71)
-<P>
-By default, <B>mbprocess</B> will only process a swath data
-file if the processed output file is either missing or out
-of date relative to the input swath data file, the parameter
-file, or any of the ancillary data files referred to in
-the parameter file (e.g. navigation files, edit save files,
-svp files). If the <B>-P</B> option is specified, <B>mbprocess</B>
-will process every file, whether it needs it or not.
-<P>
-<A NAME="lbAF"> </A>
-<H2>MBPROCESS PARAMETER FILE COMMANDS</H2>
-
-<P>
-The <B>mbprocess</B> commands found in parameter files are:
-<P>
-<BR> GENERAL PARAMETERS:
-<BR>   EXPLICIT
-<BR>        causes mbprocess to set modes implicitely
-<BR>        - e.g. the SVPFILE command will also set
-<BR>          raytracing on even if the RAYTRACE command
-<BR>          is not given [explicit mode commands required]
-<BR>   FORMAT constant
-<BR>        sets format id [no default]
-<BR>   INFILE filename
-<BR>        sets input file path [no default]
-<BR>   OUTFILE filename
-<BR>        sets output file path [no default]
-<P>
-<BR> NAVIGATION MERGING:
-<BR>   NAVMODE boolean
-<BR>        sets navigation merging [0]
-<BR>          0: navigation merge off
-<BR>          1: navigation merge on
-<BR>   NAVFILE filename
-<BR>        sets navigation file path [no default]
-<BR>   NAVFORMAT constant
-<BR>        sets navigation file format [9]
-<BR> <TT>       </TT>see below for documentation of the<BR>
-<BR> <TT>       </TT>supported navigation formats<BR>
-<BR>   NAVHEADING boolean
-<BR>        sets heading to be merged from navigation file
-<BR>        - note: heading merged from navigation before
-<BR>          heading correction applied
-<BR>          0: heading not changed
-<BR>          1: heading merged from navigation file
-<BR>   NAVSPEED boolean
-<BR>        sets speed to be merged from navigation file
-<BR>          0: speed not changed
-<BR>          1: speed merged from navigation file
-<BR>   NAVDRAFT boolean
-<BR>        sets draft to be merged from navigation file
-<BR>        - note: draft merged from navigation before
-<BR>          draft correction applied
-<BR>          0: draft not changed
-<BR>          1: draft merged from navigation file
-<BR>   NAVATTITUDE boolean
-<BR>        sets roll, pitch and heave to be merged from
-<BR>        navigation file
-<BR>        - note: roll, pitch, and heave merged from
-<BR>          navigation before roll bias and pitch bias
-<BR>          corrections applied
-<BR>          0: roll, pitch, and heave not changed
-<BR>          1: roll, pitch, and heave merged from
-<BR>             navigation file
-<BR>   NAVINTERP boolean
-<BR>        sets navigation interpolation algorithm [0]
-<BR>          0: linear interpolation (recommended)
-<BR>          1: spline interpolation
-<BR>   NAVTIMESHIFT constant
-<BR>        sets navigation time shift (seconds) [0.0]
-<BR>        - note: time shift added to timestamps of
-<BR>          navigation fixes read in from NAVFILE
-<BR>          prior to merging
-<P>
-<BR> NAVIGATION OFFSETS AND SHIFTS:
-<BR>        - These offsets and shifts will be applied to the
-<BR>          original navigation and to any merged navigation,
-<BR>          but will not be applied to adjusted navigation
-<BR>          (because generally adjusted navigation generated
-<BR>          by mbnavadjust already has offsets and shifts
-<BR>          applied).
-<BR>   NAVSHIFT boolean
-<BR>        sets navigation offset [0]
-<BR>        - note: offsets and shifts are applied to navigation
-<BR>          values from both survey and navigation records, and
-<BR>          are applied to navigation read in from
-<BR>          NAVFILE prior to merging
-<BR>        - note: offsets and shifts are NOT applied to adjusted
-<BR>          navigation values from NAVADJFILE
-<BR>   NAVOFFSETX constant
-<BR>        sets navigation athwartship offset (meters) [0.0]
-<BR>        - note: the effective navigation shift is
-<BR>          (NAVOFFSETX - SONAROFFSETX), and the
-<BR>          navigation is corrected by subtracting
-<BR>          this effective shift.
-<BR>        - note: athwartship shift is positive to
-<BR>          starboard.
-<BR>   NAVOFFSETY constant
-<BR>        sets navigation fore-aft offset (meters) [0.0]
-<BR>        - note: the effective navigation shift is
-<BR>          (NAVOFFSETY - SONAROFFSETY), and the
-<BR>          navigation is corrected by subtracting
-<BR>          this effective shift.
-<BR>        - note: fore-aft shift is positive forward.
-<BR>   NAVOFFSETZ constant
-<BR>        sets navigation vertical offset (meters) [0.0]
-<BR>        - note: this value is not yet used for
-<BR>          anything.
-<BR>        - note: vertical shift is positive down.
-<BR>   NAVSHIFTLON constant
-<BR>        sets navigation longitude shift (degrees) [0.0]
-<BR>   NAVSHIFTLAT constant
-<BR>        sets navigation latitude shift (degrees) [0.0]
-<P>
-<BR> ADJUSTED NAVIGATION MERGING:
-<BR>   NAVADJMODE mode
-<BR>        sets navigation merging from mbnavadjust [0]
-<BR>        - can apply to longitude and latitude only
-<BR>          or longitude, latitude, and depth offset
-<BR>          0: adjusted navigation merge off
-<BR>          1: adjusted navigation merge on
-<BR>          2: adjusted navigation and depth offset merge on
-<BR>   NAVADJFILE filename
-<BR>        sets adjusted navigation file path
-<BR>        - this file supercedes navigation file for
-<BR>          lon and lat only
-<BR>        - uses mbnavadjust output
-<BR>   NAVADJINTERP boolean
-<BR>        sets adjusted navigation interpolation algorithm [0]
-<BR>          0: linear interpolation (recommended)
-<BR>          1: spline interpolation
-<P>
-<BR>  ATTITUDE MERGING:
-<BR>    ATTITUDEMODE mode
-<BR>        sets attitude (roll, pitch, and heave) merging [0]
-<BR>        - roll, pitch, and heave merged before
-<BR>          roll bias and pitch bias corrections applied
-<BR>        - attitude merging from a separate file supersedes
-<BR>          attitude merging from a navigation file
-<BR>          0: attitude merging off
-<BR>          1: attitude merging on
-<BR>    ATTITUDEFILE filename
-<BR>        sets attitude file path
-<BR>    ATTITUDEFORMAT constant
-<BR>        sets attitude file format [1]
-<BR>        - attitude files can be in one of four ASCII
-<BR>          table formats
-<BR>          1: format is <time_d roll pitch heave>
-<BR>          2: format is <yr mon day hour min sec roll pitch heave>
-<BR>          3: format is <yr jday hour min sec roll pitch heave>
-<BR>          4: format is <yr jday daymin sec roll pitch heave>
-<BR>        - time_d = decimal seconds since 1/1/1970
-<BR>        - daymin = decimal minutes start of day
-<BR>        - roll = positive starboard up, degrees
-<BR>        - pitch = positive forward up, degrees
-<BR>        - heave = positive up, meters
-<P>
-<BR>  SONARDEPTH MERGING:
-<BR>    SONARDEPTHMODE mode
-<BR>        sets sonardepth merging [0]
-<BR>        - sonardepth merged before
-<BR>          draft corrections applied
-<BR>        - sonardepth merging from a separate file supersedes
-<BR>          draft merging from a navigation file
-<BR>          0: sonardepth merging off
-<BR>          1: sonardepth merging on
-<BR>    SONARDEPTHFILE filename
-<BR>        sets sonardepth file path
-<BR>    SONARDEPTHFORMAT constant
-<BR>        sets sonardepth file format [1]
-<BR>        - sonardepth files can be in one of four ASCII
-<BR>          table formats
-<BR>          1: format is <time_d sonardepth>
-<BR>          2: format is <yr mon day hour min sec sonardepth>
-<BR>          3: format is <yr jday hour min sec sonardepth>
-<BR>          4: format is <yr jday daymin sec sonardepth>
-<BR>        - time_d = decimal seconds since 1/1/1970
-<BR>        - daymin = decimal minutes start of day
-<BR>        - sonardepth = sonar depth positive down, meters
-<P>
-<BR> DATA CUTTING:
-<BR>   DATACUTCLEAR
-<BR>        removes all existing data cutting commands
-<BR>   DATACUT kind mode min max
-<BR>        adds new data cutting command, where:
-<BR>          kind = 0 : cut applied to bathymetry data
-<BR>          kind = 1 : cut applied to amplitude data
-<BR>          kind = 2 : cut applied to sidescan data
-<BR>          mode = 0 : min and max indicate start and end
-<BR>                     beam/pixel numbers between which data
-<BR>                     are flagged or zeroed
-<BR>          mode = 1 : min and max indicate start and end
-<BR>                     acrosstrack distance (m) between which
-<BR>                     data are flagged or zeroed
-<BR>   BATHCUTNUMBER min max
-<BR>        adds new bathymetry data cutting command where
-<BR>        min and max are the start and end beam numbers
-<BR>        between which data are flagged (note that
-<BR>        flagging bathymetry also flags amplitude data)
-<BR>   BATHCUTDISTANCE min max
-<BR>        adds new bathymetry data cutting command where
-<BR>        min and max are the start and end acrosstrack
-<BR>        distance (m) between which data are flagged
-<BR>        (note that flagging bathymetry also flags
-<BR>        amplitude data)
-<BR>   BATHCUTSPEED min max
-<BR>        adds new bathymetry data cutting command where
-<BR>        all beams are flagged for pings with a ship
-<BR>        or vehicle speed less than min or greater than
-<BR>        max (note that flagging bathymetry also flags
-<BR>        amplitude data)
-<BR>   AMPCUTNUMBER min max
-<BR>        adds new amplitude data cutting command where
-<BR>        min and max are the start and end beam numbers
-<BR>        between which amplitude data are zeroed (note
-<BR>        that zeroing amplitude data has no impact on
-<BR>        bathymetry data)
-<BR>   AMPCUTDISTANCE min max
-<BR>        adds new amplitude data cutting command where
-<BR>        min and max are the start and end acrosstrack
-<BR>        distance (m) between which amplitude data are
-<BR>        zeroed (note that zeroing amplitude data has
-<BR>        no impact on bathymetry data)
-<BR>   AMPCUTSPEED min max
-<BR>        adds new amplitude data cutting command where
-<BR>        all amplitude values are zeroed for pings with
-<BR>        a ship or vehicle speed less than min or greater
-<BR>        than max (note that zeroing amplitude data has
-<BR>        no impact on bathymetry data)
-<BR>   SSCUTNUMBER min max
-<BR>        adds new sidescan data cutting command where
-<BR>        min and max are the start and end pixel numbers
-<BR>        between which sidescan data are zeroed  (note
-<BR>        that zeroing sidescan data has no impact on
-<BR>        bathymetry data)
-<BR>   SSCUTDISTANCE min max
-<BR>        adds new sidescan data cutting command where
-<BR>        min and max are the start and end acrosstrack
-<BR>        distance (m) between which sidescan data are
-<BR>        zeroed  (note that zeroing sidescan data has
-<BR>        no impact on bathymetry data)
-<BR>   SSCUTSPEED min max
-<BR>        adds new sidescan data cutting command where
-<BR>        all sidescan values are zeroed for pings with
-<BR>        a ship or vehicle speed less than min or greater
-<BR>        than max (note that zeroing sidescan data has
-<BR>        no impact on bathymetry data)
-<P>
-<BR> BATHYMETRY EDITING:
-<BR>   EDITSAVEMODE boolean
-<BR>        turns on reading edit save file (from mbedit) [0]
-<BR>   EDITSAVEFILE filename
-<BR>        sets edit save file path (from mbedit) [none]
-<P>
-<BR> BATHYMETRY RECALCULATION:
-<BR>   SVPMODE mode
-<BR>        sets usage of a water sound speed model (sound
-<BR>        velocity profile, or SVP) [0]
-<BR>         0: bathymetry recalculation by raytracing off
-<BR>         1: bathymetry recalculation by raytracing on
-<BR>         2: translate depths from corrected to uncorrected
-<BR>            or vice versa depending on SOUNDSPEEDREF
-<BR>            command
-<BR>   SVPFILE filename
-<BR>        sets SVP file path [no default]
-<BR>   SSVMODE boolean
-<BR>        sets surface sound velocity (SSV) mode [0]
-<BR>         0: use SSV from file
-<BR>         1: offset SSV from file (set by SSV command)
-<BR>         2: use constant SSV (set by SSV command)
-<BR>   SSV constant/offset
-<BR>        sets SSV value or offset (m/s) [1500.0]
-<BR>   ANGLEMODE mode
-<BR>        sets handling of beam angles during
-<BR>        raytracing [1]
-<BR>         0: angles not changed before raytracing
-<BR>         1: angles adjusted using Snell's Law for
-<BR>            the difference between the surface sound
-<BR>            velocity (SSV) and the sound speed at
-<BR>            the sonar depth in the SVP.
-<BR>         2: angles adjusted using Snell's Law and
-<BR>            the sonar array geometry for the
-<BR>            difference between the surface sound
-<BR>            velocity (SSV) and the sound speed at
-<BR>            the sonar depth in the SVP.
-<BR>   TTMULTIPLY multiplier
-<BR>        sets value multiplied by travel times [1.0]
-<BR>   SOUNDSPEEDREF boolean
-<BR>        determines the handling of the sound
-<BR>        speed reference for bathymetry [1]
-<BR>        - note: if raytracing is turned off then
-<BR>          this command implies correcting or
-<BR>          uncorrecting using the SVP specified
-<BR>          with the SVPFILE command
-<BR>         0: produce "uncorrected" bathymetry
-<BR>            referenced to a uniform 1500 m/s
-<BR>            water sound speed model.
-<BR>         1: produce "corrected" bathymetry
-<BR>            referenced to a realistic water
-<BR>            sound speed model.
-<P>
-<BR> STATIC BEAM BATHYMETRY OFFSETS:
-<BR>   STATICMODE mode
-<BR>        sets offsetting of bathymetry by
-<BR>        per-beam statics [0]
-<BR>          0: static correction off
-<BR>          1: static correction by beam number
-<BR>          2: static correction by acrosstrack beam angle
-<BR>   STATICFILE filename
-<BR>        sets static per-beam file path [no default]
-<BR>        - static files are two-column ascii tables
-<BR>        - if correction is by beam number then
-<BR>          the beam # is in column 1 and
-<BR>          the depth offset is in m in column 2
-<BR>        - if correction is by beam angle then
-<BR>          the beam angle (starboard positive)
-<BR>          is in column 1 and
-<BR>          the depth offset is in m in column 2
-<P>
-<BR> DRAFT CORRECTION:
-<BR>   DRAFTMODE mode
-<BR>        sets draft correction [0]
-<BR>        - note: draft merged from navigation before
-<BR>          draft correction applied
-<BR>          0: no draft correction
-<BR>          1: draft correction by offset
-<BR>          2: draft correction by multiply
-<BR>          3: draft correction by offset and multiply
-<BR>          4: draft set to constant
-<BR>   DRAFT constant
-<BR>        sets draft value (m) [0.0]
-<BR>   DRAFTOFFSET offset
-<BR>        sets value added to draft (m) [0.0]
-<BR>   DRAFTMULTIPLY multiplier
-<BR>        sets value multiplied by draft [1.0]
-<P>
-<BR> HEAVE CORRECTION:
-<BR>   HEAVEMODE mode
-<BR>        sets heave correction [0]
-<BR>        - note: heave correction by offset and/or
-<BR>          multiplication is added to any lever
-<BR>          heave correction, and then either used in
-<BR>          bathymetry recalculation or added to
-<BR>          existing bathymetry
-<BR>          0: no heave correction
-<BR>          1: heave correction by offset
-<BR>          2: heave correction by multiply
-<BR>          3: heave correction by offset and multiply
-<BR>   HEAVEOFFSET offset
-<BR>        sets value added to heave (m)
-<BR>   HEAVEMULTIPLY multiplier
-<BR>        sets value multiplied by heave
-<P>
-<BR> LEVER CORRECTION:
-<BR>   LEVERMODE mode
-<BR>        sets heave correction by lever calculation [0]
-<BR>        - note: lever heave correction is added to
-<BR>          any heave correction by offset and/or
-<BR>          multiplication, and then either used in
-<BR>          bathymetry recalculation or added to
-<BR>          existing bathymetry
-<BR>          0: no lever calculation
-<BR>          1: heave correction by lever calculation
-<BR>   VRUOFFSETX constant
-<BR>        sets athwartships offset of attitude sensor (m)
-<BR>        - note: positive to starboard
-<BR>   VRUOFFSETY constant
-<BR>        sets fore-aft offset of attitude sensor (m)
-<BR>        - note: positive forward
-<BR>   VRUOFFSETZ constant
-<BR>        sets vertical offset of attitude sensor (m)
-<BR>        - note: positive down
-<BR>   SONAROFFSETX constant
-<BR>        sets athwartships offset of sonar receive array (m)
-<BR>        - note: positive to starboard
-<BR>   SONAROFFSETY constant
-<BR>        sets fore-aft offset of sonar receive array (m)
-<BR>        - note: positive forward
-<BR>   SONAROFFSETZ constant
-<BR>        sets vertical offset of sonar receive array (m)
-<BR>        - note: positive down
-<P>
-<BR> ROLL CORRECTION:
-<BR>   ROLLBIASMODE mode
-<BR>        sets roll correction [0]
-<BR>          0: no roll correction
-<BR>          1: roll correction by single roll bias
-<BR>          2: roll correction by separate port and
-<BR>             starboard roll bias
-<BR>   ROLLBIAS offset
-<BR>        sets roll bias (degrees)
-<BR>   ROLLBIASPORT offset
-<BR>        sets port roll bias (degrees)
-<BR>   ROLLBIASSTBD offset
-<BR>        sets starboard roll bias (degrees)
-<P>
-<BR> PITCH CORRECTION:
-<BR>   PITCHBIASMODE mode
-<BR>        sets pitch correction [0]
-<BR>          0: no pitch correction
-<BR>          1: pitch correction by pitch bias
-<BR>   PITCHBIAS offset
-<BR>        sets pitch bias (degrees)
-<P>
-<BR> HEADING CORRECTION:
-<BR>   HEADINGMODE mode
-<BR>        sets heading correction [no heading correction]
-<BR>        - note: heading merged from navigation before
-<BR>          heading correction applied
-<BR>          0: no heading correction
-<BR>          1: heading correction using course
-<BR>             made good
-<BR>          2: heading correction by offset
-<BR>          3: heading correction using course
-<BR>             made good and offset
-<BR>   HEADINGOFFSET offset
-<BR>        sets value added to heading (degrees)
-<P>
-<BR> TIDE CORRECTION:
-<BR>   TIDEMODE mode
-<BR>        sets tide correction [0]
-<BR>        - note: tide added to bathymetry after
-<BR>          all other calculations and corrections
-<BR>          0: tide correction off
-<BR>          1: tide correction on
-<BR>   TIDEFILE filename
-<BR>        sets tide file path
-<BR>   TIDEFORMAT constan
-<BR>        sets tide file format [1]
-<BR>        - tide files can be in one of four ASCII
-<BR>          table formats
-<BR>          1: format is <time_d tide>
-<BR>          2: format is <yr mon day hour min sec tide>
-<BR>          3: format is <yr jday hour min sec tide>
-<BR>          4: format is <yr jday daymin sec tide>
-<BR>        - time_d = decimal seconds since 1/1/1970
-<BR>        - daymin = decimal minutes start of day
-<P>
-<BR> AMPLITUDE CORRECTION:
-<BR>   AMPCORRMODE  boolean
-<BR>        sets correction of amplitude for
-<BR>        amplitude vs grazing angle function
-<BR>          0: amplitude correction off
-<BR>          1: amplitude correction on
-<BR>   AMPCORRFILE filename
-<BR>        sets amplitude correction file path
-<BR>        [no default]
-<BR>   AMPCORRTYPE mode
-<BR>        sets sidescan correction type [0]
-<BR>          0: correction by subtraction (dB scale)
-<BR>          1: correction by division (linear scale)
-<BR>   AMPCORRSYMMETRY boolean
-<BR>        forces correction function to be symmetric [1]
-<BR>   AMPCORRANGLE constant
-<BR>        sets amplitude correction reference angle
-<BR>        (deg) [30.0]
-<BR>   AMPCORRSLOPE mode
-<BR>        sets amplitude correction slope mode [0]
-<BR>          0: local slope ignored in calculating correction
-<BR>          1: local slope used in calculating correction
-<BR>          2: topography grid used in calculating correction
-<BR> <TT>       </TT>  <TT>      </TT>but slope ignored<BR>
-<BR>          3: local slope from topography grid used in
-<BR> <TT>       </TT><TT>        </TT>  calculating correction<BR>
-<P>
-<BR> SIDESCAN CORRECTION:
-<BR>   SSCORRMODE  boolean
-<BR>        sets correction of sidescan for
-<BR>        amplitude vs grazing angle function
-<BR>          0: sidescan correction off
-<BR>          1: sidescan correction on
-<BR>   SSCORRFILE filename
-<BR>        sets sidescan correction file path
-<BR>        [no default]
-<BR>   SSCORRTYPE mode
-<BR>        sets sidescan correction type [0]
-<BR>          0: correction by subtraction (dB scale)
-<BR>          1: correction by division (linear scale)
-<BR>   SSCORRSYMMETRY boolean
-<BR>        forces correction function to be symmetric [1]
-<BR>   SSCORRANGLE constant
-<BR>        sets sidescan correction reference angle
-<BR>        (deg) [30.0]
-<BR>   SSCORRSLOPE mode
-<BR>        sets sidescan correction slope mode [0]
-<BR>          0: local slope ignored in calculating correction
-<BR>          1: local slope used in calculating correction
-<BR>          2: topography grid used in calculating correction
-<BR> <TT>       </TT>  <TT>      </TT>but slope ignored<BR>
-<BR>          3: local slope from topography grid used in
-<BR> <TT>       </TT><TT>        </TT>  calculating correction<BR>
-<BR>   AMPSSCORRTOPOFILE
-<BR>        Sets topography grid used for correcting amplitude
-<BR>        and sidescan
-<P>
-<BR> SIDESCAN RECALCULATION:
-<BR>   SSRECALCMODE  boolean
-<BR>        sets recalculation of sidescan for
-<BR>        Simrad multibeam data
-<BR>          0: sidescan recalculation off
-<BR>          1: sidescan recalculation on
-<BR>   SSPIXELSIZE constant
-<BR>        sets recalculated sidescan pixel size (m) [0.0]
-<BR>        - a zero value causes the pixel size to
-<BR>          be recalculated for every data record
-<BR>   SSSWATHWIDTH  constant
-<BR>        sets sidescan swath width (degrees) [0.0]
-<BR>        - a zero value causes the swath width
-<BR>          to be recalculated for every data record
-<BR>   SSINTERPOLATE  constant
-<BR>        sets sidescan interpolation distance
-<BR>        (number of pixels)
-<P>
-<BR> METADATA INSERTION:
-<BR>   METAVESSEL string
-<BR>        sets mbinfo metadata string for vessel
-<BR>   METAINSTITUTION string
-<BR>        sets mbinfo metadata string for vessel
-<BR>        operator institution or company
-<BR>   METAPLATFORM string
-<BR>        sets mbinfo metadata string for sonar
-<BR>        platform (ship or vehicle)
-<BR>   METASONAR string
-<BR>        sets mbinfo metadata string for sonar
-<BR>        model name
-<BR>   METASONARVERSION string
-<BR>        sets mbinfo metadata string for sonar
-<BR>        version (usually software version)
-<BR>   METACRUISEID string
-<BR>        sets mbinfo metadata string for institutional
-<BR>        cruise id
-<BR>   METACRUISENAME string
-<BR>        sets mbinfo metadata string for descriptive
-<BR>        cruise name
-<BR>   METAPI string
-<BR>        sets mbinfo metadata string for principal
-<BR>        investigator
-<BR>   METAPIINSTITUTION string
-<BR>        sets mbinfo metadata string for principal
-<BR>        investigator
-<BR>   METACLIENT string
-<BR>        sets mbinfo metadata string fo data owner
-<BR>        (usually PI institution)
-<BR>   METASVCORRECTED boolean
-<BR>        sets mbinfo metadata boolean for sound
-<BR>        velocity corrected depths
-<BR>   METATIDECORRECTED boolean
-<BR>        sets mbinfo metadata boolean for tide
-<BR>        corrected bathymetry
-<BR>   METABATHEDITMANUAL boolean
-<BR>        sets mbinfo metadata boolean for manually
-<BR>        edited bathymetry
-<BR>   METABATHEDITAUTO boolean
-<BR>        sets mbinfo metadata boolean for automatically
-<BR>        edited bathymetry
-<BR>   METAROLLBIAS constant
-<BR>        sets mbinfo metadata constant for roll bias
-<BR>        (degrees + to starboard)
-<BR>   METAPITCHBIAS constant
-<BR>        sets mbinfo metadata constant for pitch bias
-<BR>        (degrees + forward)
-<BR>   METAHEADINGBIAS constant
-<BR>        sets mbinfo metadata constant for heading bias
-<BR>   METADRAFT constant
-<BR>        sets mbinfo metadata constant for vessel draft (m)
-<P>
-<BR> PROCESSING KLUGES:
-<BR>   KLUGE001 boolean
-<BR>        enables correction of travel times in
-<BR>        Hydrosweep DS2 data from the R/V Maurice
-<BR>        Ewing in 2001 and 2002.
-<BR>   KLUGE002 boolean
-<BR>        enables correction of draft values in
-<BR>        Simrad data
-<BR>        - some Simrad multibeam data has had an
-<BR>          error in which the heave has bee added
-<BR>          to the sonar depth (draft for hull
-<BR>          mounted sonars)
-<BR>        - this correction subtracts the heave
-<BR>          value from the sonar depth
-<BR>   KLUGE003 boolean
-<BR>        enables correction of beam angles in
-<BR>        SeaBeam 2112 data
-<BR>        - a data sample from the SeaBeam 2112 on
-<BR>          the USCG Icebreaker Healy (collected on
-<BR>          23 July 2003) was found to have an error
-<BR>          in which the beam angles had 0.25 times
-<BR>          the roll added
-<BR>        - this correction subtracts 0.25 * roll
-<BR>          from the beam angles before the bathymetry
-<BR>          is recalculated by raytracing through a
-<BR>          water sound velocity profile
-<BR>        - the mbprocess parameter files must be
-<BR>          set to enable bathymetry recalculation
-<BR>          by raytracing in order to apply this
-<BR>          correction
-<BR>   KLUGE004 boolean
-<BR>        deletes survey data associated with duplicate
-<BR>        or reversed time tags
-<BR>        - if survey data records are encountered
-<BR>          with time tags less than or equal to the
-<BR>          last good time tag, an error is set and
-<BR>          the data record is not output to the
-<BR>          processed data file.
-<BR>   KLUGE005 boolean
-<BR>        replaces survey record timestamps with
-<BR>        timestamps of corresponding merged navigation
-<BR>        records
-<BR>        - this feature allows users to fix
-<BR>          timestamp errors using MBnavedit and
-<BR>          then insert the corrected timestamps
-<BR>          into processed data
-<BR>   KLUGE006 boolean
-<BR> <TT>       </TT>changes sonar depth / draft values without<BR>
-<BR>        changing bathymetry values
-<BR>   KLUGE007 boolean
-<BR>        processing kluge 007 (not yet defined)
-<BR>        - occasionaly odd processing problems will
-<BR>          occur that are specific to a particular
-<BR>          survey or sonar version
-<BR>        - mbprocess will allow one-time fixes to
-<BR>          be defined as "kluges" that can be turned
-<BR>          on through the parameter files.
-<P>
-<A NAME="lbAG"> </A>
-<H2>ANCILLARY DATA FILES</H2>
-
-<P>
-<B>MB-System</B> also uses a number of ancillary data files, most
-of which relate to <B>mbprocess</B> in some way. By default,
-these ancillary data files are named by adding a short suffix
-to the primary data file name (e.g. ".par", ".svp", ".esf", ".nve")
-<P>
-The common ancillary files are listed below. The example names
-given here follow from an input swath data file name of mydata.mb71.
-<P>
-The processing parameter file used by <B>mbprocess</B> has
-an ".par" suffix. These files are generated
-or modified by <B>mbset</B>, <B>mbedit</B>, <B>mbnavedit</B>,
-<B>mbvelocitytool</B>, <B>mbnavadjust</B>, and <B>mbclean</B>.
-<BR>        mydata.mb71.par
-<P>
-The most prominent ancillary files are metadata or
-"inf" files (created from the output of <B>mbinfo</B>).
-Programs such as <B>mbgrid</B> and <B>mbm_plot</B> try to check "inf"
-files to see if the corresponding data files include data within
-desired areas. The program <B>mbprocess</B> automatically generates
-an "inf" file for any processed output swath file.
-Also, the program <B>mbdatalist</B> is often used to
-create or update "inf" files for large groups of swath data files.
-<BR>        mydata.mb71.inf
-<P>
-The "fast bath" or "fbt" files
-are generated by copying the swath bathymetry to a sparse,
-quickly read format (format 71). Programs such as <B>mbgrid</B>,
-<B>mbswath</B>, and <B>mbcontour</B> will try to read "fbt" files
-instead of the full data files whenever only bathymetry
-information are required. The program <B>mbprocess</B>
-automatically generates
-an "fbt" file for any processed output swath file.
-Also, the program <B>mbdatalist</B> is often used to
-create or update "fbt" files for large groups of swath data files.
-These files are not generated or used
-when the original swath data is already
-in a compact bathymetry-only data format.
-<BR>        mydata.mb71.fbt
-<P>
-The "fast nav" or "fnv" files
-are just ASCII lists of navigation generated using <B>mblist</B>
-with a <B>-O</B><I>tMXYHSc</I> option. Programs such as <B>mbgrid</B>,
-<B>mbswath</B>, and <B>mbcontour</B> will try to read "fnv" files
-instead of the full data files whenever only
-navigation information are required. These files are not generated or used
-when the original data is already
-in a single-beam or navigation data format.
-<BR>        mydata.mb71.fnv
-<P>
-The bathymetry edit save file generated by <B>mbedit</B> and
-<B>mbclean</B> has an ".esf" suffix.
-<BR>        mydata.mb71.esf
-<P>
-A water sound velocity profile (SVP) file generated
-by <B>mbvelocitytool</B> has an ".svp" suffix unless
-the user specifies otherwise.
-<BR>        mydata.mb71.svp
-<P>
-Water sound velocity profile (SVP) files generated
-by <B>mbsvplist</B> also use the ".svp" suffix.
-However, multiple SVP files may be
-extracted from each input swath file, so the files are
-numbered using a "_YYY.svp" suffix, where YYY increments
-from 001.
-<BR>        mydata.mb71_001.svp
-<BR>        mydata.mb71_002.svp
-<BR>        mydata.mb71_003.svp
-<P>
-Edited navigation files generated by <B>mbnavedit</B> have
-an ".nve" suffix:
-<BR>        mydata.mb71.nve
-<BR>
-
-These navigation files can be read independently using format 166.
-<P>
-Adjusted navigation files generated by <B>mbnavadjust</B>
-have an ".naY" suffix, where "Y" is a number between 0-9.
-The <B>mbnavadjust</B> package may be used multiple times
-for a survey; the adjustments are numbered sequentially from
-"0":
-<BR>        mydata.mb71.na0
-<BR>        mydata.mb71.na1
-<BR>        mydata.mb71.na2
-<BR>
-
-and so on. These navigation files can be read independently using format 166.
-<P>
-<A NAME="lbAH"> </A>
-<H2>AUTHORSHIP</H2>
-
-David W. Caress (<A HREF="mailto:caress at mbari.org">caress at mbari.org</A>)
-<BR>
-
-<BR>  Monterey Bay Aquarium Research Institute
-<BR>
-
-Dale N. Chayes (<A HREF="mailto:dale at ldeo.columbia.edu">dale at ldeo.columbia.edu</A>)
-<BR>
-
-<BR>  Lamont-Doherty Earth Observatory
-<P>
-<A NAME="lbAI"> </A>
-<H2>OPTIONS</H2>
-
-<DL COMPACT>
-<DT><B>-F</B>
-
-<DD>
-<I>format</I>
-<BR>
-
-Sets the <B>MBIO</B> integer format identifier
-for the input file specified with the
-<B>-I</B> option. By default, <B>mbprocess</B>
-derives the format id from the <B>mbprocess</B> parameter file
-associated with the input file (<B>-I</B> option) or, if necessary,
-infers the format from the "*.mbXX" <B>MB-System</B> suffix
-convention.
-<DT><B>-H</B>
-
-<DD>
-This "help" flag causes the program to print out a description
-of its operation and then exit immediately.
-<DT><B>-I</B>
-
-<DD>
-<I>infile</I>
-<BR>
-
-Swath data file from which the input data will be read, or
-a datalist file containing a list of input swath data files
-and/or other datalist files. If <I>infile</I> is a
-datalist file, then <B>mbprocess</B> will attempt to
-process all data files identified by recursively reading
-<I>infile</I>.
-<DT><B>-N</B>
-
-<DD>
-<BR>
-
-By default, <B>mbprocess</B> passes any comment records
-it encounters in the input data to the output data file
-and additionally embeds new comment records detailing the
-processing parameters used by <B>mbprocess</B>.
-This option causes <B>mbprocess</B> to not pass new or old
-comment records to the output data file.
-<DT><B>-O</B>
-
-<DD>
-<I>outfile</I>
-<BR>
-
-Data file to which the output data will be written. If
-no output file is specified, the output filename is
-set automatically. If an input swath data file
-is named "root.mbXX", where XX is the format
-id, then the default processed output file will be "rootp.mbXX".
-The "p" inserted before the ".mbXX" suffix indicates the output
-file has been created by <B>mbprocess</B>.
-If the input file does not follow the *.mbXX naming convention,
-then the output filename will just consist of the input name
-with "p.mbXX" added as a suffix.
-<DT><B>-P</B>
-
-<DD>
-<BR>
-
-By default, <B>mbprocess</B> will only process a swath data
-file if the processed output file is either missing or out
-of date relative to the input swath data file, the parameter
-file, or any of the ancillary data files referred to in
-the parameter file (e.g. navigation files, edit save files,
-svp files). If the <B>-P</B> option is specified, <B>mbprocess</B>
-will process every file, whether it needs it or not.
-<DT><B>-T</B>
-
-<DD>
-<BR>
-
-This option puts <B>mbprocess</B> into a test mode. The program
-will report whether or not it would process a file, but it
-will not actually process the data or produce an output
-processed file.
-<DT><B>-S</B>
-
-<DD>
-<BR>
-
-This option causes <B>mbprocess</B> to print out the status of
-each file (e.g. up to date, out of date, locked, unlocked) along
-with the file modification times used to determine if the output
-file is out of date.
-<DT><B>-V</B>
-
-<DD>
-Normally, <B>mbprocess</B> works "silently" without outputting
-anything to the stderr stream.  If the
-<B>-V</B> flag is given, then <B>mbprocess</B> works in a "verbose" mode and
-outputs the program version being used, the processing parameters
-being use, and some statistics regarding the processing accomplished.
-<P>
-</DL>
-<A NAME="lbAJ"> </A>
-<H2>NAVIGATION FORMATS</H2>
-
-The navigation formats that are supported for merging by <B>mbprocess</B>
-include the following:
-<BR> <TT>       </TT><B>MBprocess</B> ID          Name<BR>
-<BR> <TT>       </TT>------------------      ----<BR>
-<BR> <TT>       </TT>         1              Simple Decimal Time<BR>
-<BR> <TT>       </TT>         2              Simple Date 1<BR>
-<BR> <TT>       </TT>         3              Simple Date 2<BR>
-<BR> <TT>       </TT>         4              Simple Date 3<BR>
-<BR> <TT>       </TT>         5              L-DEO Processed Nav<BR>
-<BR> <TT>       </TT>         6              NMEA 0183 - GLL<BR>
-<BR> <TT>       </TT>         7              NMEA 0183 - GGA<BR>
-<BR> <TT>       </TT>         8              Simrad 90 Nav<BR>
-<BR> <TT>       </TT>         9              MBPRONAV (*.nve Files)<BR>
-<BR> <TT>       </TT>         10             R2RNAV (*_hires.r2rnav Files)<BR>
-<P>
-Format 1 (Simple Decimal Time):
-<BR> <TT>       </TT>- text<BR>
-<BR> <TT>       </TT>- fields separated by white space<BR>
-<BR> <TT>       </TT>- each line contains the following fields:<BR>
-<BR> <TT>       </TT><TT>        </TT>time_d lon lat<BR>
-<BR> <TT>       </TT>- time_d : decimal seconds since 1970 Jan 1 00:00:00.00<BR>
-<BR> <TT>       </TT>- lon: decimal longitude (deg)<BR>
-<BR> <TT>       </TT>- lat: decimal latitude (deg)<BR>
-<P>
-Format 2 (Simple Date 1):
-<BR> <TT>       </TT>- text<BR>
-<BR> <TT>       </TT>- fields separated by white space<BR>
-<BR> <TT>       </TT>- each line contains the following fields:<BR>
-<BR> <TT>       </TT><TT>        </TT>yr mon day hour min sec lon lat<BR>
-<BR> <TT>       </TT>- yr: four-digit year<BR>
-<BR> <TT>       </TT>- mon: integer month of year<BR>
-<BR> <TT>       </TT>- day: integer day of month<BR>
-<BR> <TT>       </TT>- hour: integer hour of day<BR>
-<BR> <TT>       </TT>- min: integer minute of hour<BR>
-<BR> <TT>       </TT>- sec: decimal second of minute<BR>
-<BR> <TT>       </TT>- lon: decimal longitude (deg)<BR>
-<BR> <TT>       </TT>- lat: decimal latitude (deg)<BR>
-<P>
-Format 3 (Simple Date 2):
-<BR> <TT>       </TT>- text<BR>
-<BR> <TT>       </TT>- fields separated by white space<BR>
-<BR> <TT>       </TT>- each line contains the following fields:<BR>
-<BR> <TT>       </TT><TT>        </TT>yr jday hour min sec lon lat<BR>
-<BR> <TT>       </TT>- yr: four-digit year<BR>
-<BR> <TT>       </TT>- jday: integer julian day of year<BR>
-<BR> <TT>       </TT>- hour: integer hour of day<BR>
-<BR> <TT>       </TT>- min: integer minute of hour<BR>
-<BR> <TT>       </TT>- sec: decimal second of minute<BR>
-<BR> <TT>       </TT>- lon: decimal longitude (deg)<BR>
-<BR> <TT>       </TT>- lat: decimal latitude (deg)<BR>
-<P>
-Format 4 (Simple Date 3):
-<BR> <TT>       </TT>- text<BR>
-<BR> <TT>       </TT>- fields separated by white space<BR>
-<BR> <TT>       </TT>- each line contains the following fields:<BR>
-<BR> <TT>       </TT><TT>        </TT>yr jday daymin sec lon lat<BR>
-<BR> <TT>       </TT>- yr: four-digit year<BR>
-<BR> <TT>       </TT>- jday: integer julian day of year<BR>
-<BR> <TT>       </TT>- daymin: integer minute of day<BR>
-<BR> <TT>       </TT>- sec: decimal second of minute<BR>
-<BR> <TT>       </TT>- lon: decimal longitude (deg)<BR>
-<BR> <TT>       </TT>- lat: decimal latitude (deg)<BR>
-<P>
-Format 5 (L-DEO Processed Nav):
-<BR> <TT>       </TT>- text<BR>
-<BR> <TT>       </TT>- fields separated by white space<BR>
-<BR> <TT>       </TT>- each line contains the following fields:<BR>
-<BR> <TT>       </TT><TT>        </TT>timetag NorS latd latm EorW lond lonm src dr1 dr2<BR>
-<BR> <TT>       </TT>- timetag: comes in two forms<BR>
-<BR> <TT>       </TT><TT>        </TT>form 1: yy+jjj:hh:mm:ss.sss<BR>
-<BR> <TT>       </TT><TT>        </TT>form 2: yyyy+jjj:hh:mm:ss.sss<BR>
-<BR> <TT>       </TT>- yy: either two-digit or four-digit year<BR>
-<BR> <TT>       </TT>- jjj: integer julian day of year<BR>
-<BR> <TT>       </TT>- hh: integer hour of day<BR>
-<BR> <TT>       </TT>- mm: integer minute of hour<BR>
-<BR> <TT>       </TT>- ss.sss: decimal second of minute<BR>
-<BR> <TT>       </TT>- NorS: 'S' for southern hemisphere<BR>
-<BR> <TT>       </TT>        'N' for northern hemisphere<BR>
-<BR> <TT>       </TT>- latd: integer latitude degrees<BR>
-<BR> <TT>       </TT>- latm: decimal latitude minutes<BR>
-<BR> <TT>       </TT>- EorW: 'E' for eastern hemisphere<BR>
-<BR> <TT>       </TT>        'W' for western hemisphere<BR>
-<BR> <TT>       </TT>- lond: integer longitude degrees<BR>
-<BR> <TT>       </TT>- lonm: decimal longitude minutes<BR>
-<BR> <TT>       </TT>- src: nav source (e.g. gp1, dr, satl)<BR>
-<BR> <TT>       </TT>        'gp1'  - GPS receiver 1<BR>
-<BR> <TT>       </TT>        'dr'   - dead reckoning<BR>
-<BR> <TT>       </TT>        'satl' - transit satellite<BR>
-<BR> <TT>       </TT>- dr1: nonzero when src is 'dr'<BR>
-<BR> <TT>       </TT>- dr2: nonzero when src is 'dr'<BR>
-<P>
-Format 6 (NMEA 0183 - GLL):
-<BR> <TT>       </TT>- text<BR>
-<BR> <TT>       </TT>- fields separated by commas<BR>
-<BR> <TT>       </TT>- nav derived from GLL strings<BR>
-<P>
-Format 7 (NMEA 0183 - GGA):
-<BR> <TT>       </TT>- text<BR>
-<BR> <TT>       </TT>- fields separated by commas<BR>
-<BR> <TT>       </TT>- nav derived from GGA strings<BR>
-<P>
-Format 8 (Simrad 90 Nav):
-<BR> <TT>       </TT>- text<BR>
-<BR> <TT>       </TT>- fields not separated by white space<BR>
-<BR> <TT>       </TT>- each line contains the following fields:<BR>
-<BR> <TT>       </TT><TT>        </TT>ddmmyy_hhmmss.ss_LLlllllN_LLLllllllE<BR>
-<TT>        </TT>- dd: day of month<BR>
-<BR> <TT>       </TT>- mm: integer month of year<BR>
-<TT>        </TT>- yy: two-digit year<BR>
-<BR> <TT>       </TT>- hh: integer hour of day<BR>
-<BR> <TT>       </TT>- mm: integer minute of hour<BR>
-<BR> <TT>       </TT>- ss.ss: decimal second of minute<BR>
-<BR> <TT>       </TT>- LL: integer latitude degrees<BR>
-<BR> <TT>       </TT>- lllll: integer latitude minutes X 1000<BR>
-<BR> <TT>       </TT>- N:    'S' for southern hemisphere<BR>
-<BR> <TT>       </TT>        'N' for northern hemisphere<BR>
-<BR> <TT>       </TT>- LLL: integer longitude degrees<BR>
-<BR> <TT>       </TT>- lllll: integer longitude minutes X 1000<BR>
-<BR> <TT>       </TT>- E:    'E' for eastern hemisphere<BR>
-<BR> <TT>       </TT>        'W' for western hemisphere<BR>
-<P>
-Format 9 (MBPRONAV (*.nve Files)):
-<BR> <TT>       </TT>- text<BR>
-<BR> <TT>       </TT>- fields separated by white space<BR>
-<BR> <TT>       </TT>- each line contains at least 9, and possibly as many as 19, of the following fields:<BR>
-<BR>  <TT>      </TT><TT>        </TT>yr mn dy hr mi se td ln lt hg sp dr rl pt hv pln plt sln slt<BR>
-<BR> <TT>       </TT>- yr: four-digit year<BR>
-<BR> <TT>       </TT>- mn: integer month of year<BR>
-<BR> <TT>       </TT>- dy: integer day of month<BR>
-<BR> <TT>       </TT>- hr: integer hour of day<BR>
-<BR> <TT>       </TT>- mi: integer minute of hour<BR>
-<BR> <TT>       </TT>- se: decimal second of minute<BR>
-<BR> <TT>       </TT>- td : decimal seconds since 1970 Jan 1 00:00:00.00<BR>
-<BR> <TT>       </TT>- ln: decimal longitude (deg)<BR>
-<BR> <TT>       </TT>- lt: decimal latitude (deg)<BR>
-<BR> <TT>       </TT>- hg: decimal heading (deg)<BR>
-<BR> <TT>       </TT>- sp: decimal speed (km/hr)<BR>
-<BR> <TT>       </TT>- dr: decimal draft (m)<BR>
-<BR> <TT>       </TT>- rl: decimal roll (deg)<BR>
-<BR> <TT>       </TT>- pt: decimal pitch (deg)<BR>
-<BR> <TT>       </TT>- hv: decimal heave (m)<BR>
-<BR> <TT>       </TT>- pln: decimal longitude of portmost sounding (deg)<BR>
-<BR> <TT>       </TT>- plt: decimal latitude of portmost sounding (deg)<BR>
-<BR> <TT>       </TT>- sln: decimal longitude of starboardmost sounding (deg)<BR>
-<BR> <TT>       </TT>- slt: decimal latitude of starboardmost sounding (deg)<BR>
-<P>
-Format 10 (R2RNAV (*_hires.r2rnav Files)):
-<BR> <TT>       </TT>- text<BR>
-<TT>        </TT>- also works with *_1min.r2rnav and *_control.r2rnav files<BR>
-<BR> <TT>       </TT><TT>        </TT>- these lack the GPS parameters<BR>
-<BR> <TT>       </TT>- defined by SIO GDC as part of the R2R project<BR>
-<BR> <TT>       </TT>- columns separated by tabs<BR>
-<BR> <TT>       </TT>- each line contains the following fields<BR>
-<BR> <TT>       </TT><TT>        </TT>yyyy-mm-ddThh:mm:ss.sssZ lon lat q n d h<BR>
-<BR>  <TT>      </TT>- yyyy: four-digit year<BR>
-<BR>  <TT>      </TT>- mm: integer month of year<BR>
-<BR>  <TT>      </TT>- dd: integer day of month<BR>
-<BR> <TT>       </TT>- T: the letter "T" is always between the date and the time<BR>
-<BR>  <TT>      </TT>- hh: integer hour of day<BR>
-<BR>  <TT>      </TT>- mm: integer minute of hour<BR>
-<BR>  <TT>      </TT>- ss.sss: decimal second of minute<BR>
-<BR> <TT>       </TT>- Z: the letter "Z" is always there to specify UTC time zone<BR>
-<BR>  <TT>      </TT>- lo: decimal longitude (deg) (-180 to +180<BR>
-<BR>  <TT>      </TT>- la: decimal latitude (deg) (-90 to +90)<BR>
-<BR>  <TT>      </TT>- q: GPS quality<BR>
-<BR>  <TT>      </TT>- n: number of GPS satellites<BR>
-<BR>  <TT>      </TT>- d: GPS dilution<BR>
-<BR> <TT>       </TT>- h: GPS antenna height (m)<BR>
-<P>
-<A NAME="lbAK"> </A>
-<H2>EXAMPLES</H2>
-
-Suppose the user has a Simrad EM120 data file called
-"0051_20010829_223755.mb57" that requires processing.
-<P>
-Editing the bathymetry data in this file with mbedit will generate
-an edit save file "0051_20010829_223755.mb57.esf" and
-an mbprocess parameter file "0051_20010829_223755.mb57.par".
-The contents of the parameter file are:
-<P>
-<BR> ## MB-System processing parameter file
-<BR> ## Written by mb_pr_writepar version $Id: mbprocess.1 2210 2014-11-10 19:53:01Z caress $
-<BR> ## MB-system Version 5.0.beta22
-<BR> ## Generated by user <caress> on cpu <menard> at <Fri Sep  6 21:27:41 2002>
-<BR> ##
-<BR> ##
-<BR> ## Forces explicit reading of parameter modes.
-<BR> EXPLICIT
-<BR> ##
-<BR> ## General Parameters:
-<BR> FORMAT 57
-<BR> INFILE /data/0051_20010829_223755.mb57
-<BR> OUTFILE /data/0051_20010829_223755p.mb57
-<BR> ##
-<BR> ## Navigation Merging:
-<BR> NAVMODE 0
-<BR> NAVFILE /data/0051_20010829_223755.mb57.nve
-<BR> NAVFORMAT 0
-<BR> NAVHEADING 0
-<BR> NAVSPEED 0
-<BR> NAVDRAFT 0
-<BR> NAVATTITUDE 0
-<BR> NAVINTERP 0
-<BR> NAVTIMESHIFT 0.000000
-<BR> ##
-<BR> ## Navigation Offsets and Shifts:
-<BR> NAVSHIFT 0
-<BR> NAVOFFSETX 0.000000
-<BR> NAVOFFSETY 0.000000
-<BR> NAVOFFSETZ 0.000000
-<BR> NAVSHIFTLON 0.000000
-<BR> NAVSHIFTLAT 0.000000
-<BR> ##
-<BR> ## Adjusted Navigation Merging:
-<BR> NAVADJMODE 0
-<BR> NAVADJFILE
-<BR> NAVADJINTERP 0
-<BR> ##
-<BR> ## Attitude Merging:
-<BR> ATTITUDEMODE 0
-<BR> ATTITUDEFILE
-<BR> ATTITUDEFORMAT 1
-<BR> ##
-<BR> ## Sonardepth Merging:
-<BR> SONARDEPTHMODE 0
-<BR> SONARDEPTHFILE
-<BR> SONARDEPTHFORMAT 1
-<BR> ##
-<BR> ## Data cutting:
-<BR> DATACUTCLEAR
-<BR> ##
-<BR> ## Bathymetry Flagging:
-<BR> EDITSAVEMODE 1
-<BR> EDITSAVEFILE /data/0051_20010829_223755.mb57.esf
-<BR> ##
-<BR> ## Bathymetry Recalculation:
-<BR> SVPMODE 0
-<BR> SVPFILE
-<BR> SSVMODE 0
-<BR> SSV 0.000000
-<BR> TTMODE 0
-<BR> TTMULTIPLY 1.000000
-<BR> ANGLEMODE 0
-<BR> SOUNDSPEEDREF 1
-<BR> ##
-<BR> ## Draft Correction:
-<BR> DRAFTMODE 0
-<BR> DRAFT 0.000000
-<BR> DRAFTOFFSET 0.000000
-<BR> DRAFTMULTIPLY 1.000000
-<BR> ##
-<BR> ## Heave Correction:
-<BR> HEAVEMODE 0
-<BR> HEAVEOFFSET 0.000000
-<BR> HEAVEMULTIPLY 1.000000
-<BR> ##
-<BR> ## Lever Correction:
-<BR> LEVERMODE 0
-<BR> VRUOFFSETX 0.000000
-<BR> VRUOFFSETY 0.000000
-<BR> VRUOFFSETZ 0.000000
-<BR> SONAROFFSETX 0.000000
-<BR> SONAROFFSETY 0.000000
-<BR> SONAROFFSETZ 0.000000
-<BR> ##
-<BR> ## Roll Correction:
-<BR> ROLLBIASMODE 0
-<BR> ROLLBIAS 0.000000
-<BR> ROLLBIASPORT 0.000000
-<BR> ROLLBIASSTBD 0.000000
-<BR> ##
-<BR> ## Pitch Correction:
-<BR> PITCHBIASMODE 0
-<BR> PITCHBIAS 0.000000
-<BR> ##
-<BR> ## Heading Correction:
-<BR> HEADINGMODE 0
-<BR> HEADINGOFFSET 0.000000
-<BR> ##
-<BR> ## Tide Correction:
-<BR> TIDEMODE 0
-<BR> TIDEFILE
-<BR> TIDEFORMAT 1
-<BR> ##
-<BR> ## Amplitude Correction:
-<BR> AMPCORRMODE 0
-<BR> AMPCORRFILE
-<BR> AMPCORRTYPE 0
-<BR> AMPCORRSYMMETRY 1
-<BR> AMPCORRANGLE 30.000000
-<BR> AMPCORRSLOPE 0
-<BR> ##
-<BR> ## Sidescan Correction:
-<BR> SSCORRMODE 0
-<BR> SSCORRFILE
-<BR> SSCORRTYPE 0
-<BR> SSCORRSYMMETRY 1
-<BR> SSCORRANGLE 30.000000
-<BR> SSCORRSLOPE 0
-<BR> ##
-<BR> ## Sidescan Recalculation:
-<BR> SSRECALCMODE 0
-<BR> SSPIXELSIZE 0.000000
-<BR> SSSWATHWIDTH 0.000000
-<BR> SSINTERPOLATE 0
-<BR> ##
-<BR> ## Metadata Insertion:
-<BR> METAVESSEL
-<BR> METAINSTITUTION
-<BR> METAPLATFORM
-<BR> METASONAR
-<BR> METASONARVERSION
-<BR> METACRUISEID
-<BR> METACRUISENAME
-<BR> METAPI
-<BR> METAPIINSTITUTION
-<BR> METACLIENT
-<BR> METASVCORRECTED -1
-<BR> METATIDECORRECTED -1
-<BR> METABATHEDITMANUAL -1
-<BR> METABATHEDITAUTO -1
-<BR> METAROLLBIAS 0.000000
-<BR> METAPITCHBIAS 0.000000
-<BR> METAHEADINGBIAS 0.000000
-<BR> METADRAFT 0.000000
-<BR> ##
-<BR> ## Processing Kluges
-<P>
-Editing the navigation with mbnavedit will generate
-a navigation file named "0051_20010829_223755.mb57.nve"
-and will modify the parameter file. The changed lines
-in "0051_20010829_223755.mb57.par" are:
-<P>
-<BR> ## Navigation Merging:
-<BR> NAVMODE 1
-<BR> NAVFILE /data/0051_20010829_223755.mb57.nve
-<BR> NAVFORMAT 9
-<BR> NAVHEADING 1
-<BR> NAVSPEED 1
-<BR> NAVDRAFT 1
-<BR> NAVATTITUDE 1
-<P>
-At this point, running <B>mbprocess</B> on
-"0051_20010829_223755.mb57" will apply the bathymetry
-flags from <B>mbedit</B> and merge the navigation from
-<B>mbnavedit</B>, but will not modify the data in any
-other way.
-<P>
-If the user wants to recalculate the bathymetry using
-an SVP file "0051_20010829_223755.mb57.svp"
-and a roll bias correction
-of +0.5 degrees, the following will suffice:
-<P>
-<BR>        mbset -I 0051_20010829_223755.mb57                 -PSVPFILE:0051_20010829_223755.mb57.svp                 -PROLLBIAS:0.5                 -PDRAFT:1.95    & [...]
-<P>
-The affected lines in "0051_20010829_223755.mb57.par" are:
-<P>
-<BR> ##
-<BR> ## Bathymetry Recalculation:
-<BR> SVPMODE 1
-<BR> SVPFILE 0051_20010829_223755.mb57.svp
-<BR> SSVMODE 0
-<BR> SSV 0.000000
-<BR> TTMODE 0
-<BR> TTMULTIPLY 1.000000
-<BR> ANGLEMODE 0
-<BR> SOUNDSPEEDREF 1
-<BR> ##
-<BR> ## Draft Correction:
-<BR> DRAFTMODE 4
-<BR> DRAFT 1.950000
-<BR> DRAFTOFFSET 0.000000
-<BR> DRAFTMULTIPLY 1.000000
-<BR> ##
-<BR> ## Roll Correction:
-<BR> ROLLBIASMODE 1
-<BR> ROLLBIAS 0.500000
-<BR> ROLLBIASPORT 0.000000
-<BR> ROLLBIASSTBD 0.000000
-<P>
-To process the data, run mbprocess:
-<P>
-<BR>        mbprocess -I0051_20010829_223755.mb57 -V
-<P>
-<BR> The output to the terminal is:
-<BR> Program mbprocess
-<BR> Version $Id: mbprocess.1 2210 2014-11-10 19:53:01Z caress $
-<BR> MB-System Version 5.0.beta07
-<P>
-<BR> Program <mbprocess>
-<BR> Version $Id: mbprocess.1 2210 2014-11-10 19:53:01Z caress $
-<BR> MB-system Version 5.0.beta07
-<P>
-<BR> Program Operation:
-<BR>   Input file:      0051_20010829_223755.mb57
-<BR>   Format:          57
-<BR>   Files processed only if out of date.
-<BR>   Comments embedded in output.
-<P>
-<BR> Data processed - out of date:
-<BR>  Input:  0051_20010829_223755.mb57
-<BR>  Output: /u/mbuser/survey/0051_20010829_223755p.mb57
-<P>
-<BR> Input and Output Files:
-<BR>   Format:                        57
-<BR>   Input file:                    0051_20010829_223755.mb57
-<BR>   Output file:                   /u/mbuser/survey/0051_20010829_223755p.mb57
-<BR>   Comments in output: ON
-<P>
-<BR> Navigation Merging:
-<BR>   Navigation merged from navigation file.
-<BR>   Heading merged from navigation file.
-<BR>   Speed merged from navigation file.
-<BR>   Draft merged from navigation file.
-<BR>   Navigation file:               /u/mbuser/survey/0051_20010829_223755.mb57.nve
-<BR>   Navigation algorithm:          linear interpolation
-<BR>   Navigation time shift:         0.000000
-<P>
-<BR> Navigation Offsets and Shifts:
-<BR>   Navigation positions not shifted.
-<P>
-<BR> Adjusted Navigation Merging:
-<BR>   Navigation not merged from adjusted navigation file.
-<BR>   Adjusted navigation file:
-<BR>   Adjusted navigation algorithm: linear interpolation
-<P>
-<BR> Data Cutting:
-<BR>   Data cutting disabled.
-<P>
-<BR> Bathymetry Editing:
-<BR>   Bathymetry edits applied from file.
-<BR>   Bathymetry edit file:          0051_20010829_223755.mb57.esf
-<P>
-<BR> Bathymetry Recalculation:
-<BR>   Bathymetry recalculated by raytracing.
-<BR>   SVP file:                      0051_20010829_223755.mb57.svp
-<BR>   SSV not modified.
-<BR>   SSV offset/constant:           0.000000 m/s
-<BR>   Travel time multiplier:        1.000000 m
-<P>
-<BR> Bathymetry Water Sound Speed Reference:
-<BR>   Output bathymetry reference:   CORRECTED
-<BR>   Depths recalculated as corrected
-<P>
-<BR> Draft Correction:
-<BR>   Draft set to constant.
-<BR>   Draft constant:                1.950000 m
-<BR>   Draft offset:                  0.000000 m
-<BR>   Draft multiplier:              1.000000 m
-<P>
-<BR> Heave Correction:
-<BR>   Heave not modified.
-<BR>   Heave offset:                  0.000000 m
-<BR>   Heave multiplier:              1.000000 m
-<P>
-<BR> Lever Correction:
-<BR>   Lever calculation off.
-<P>
-<BR> Tide Correction:
-<BR>   Tide calculation off.
-<P>
-<BR> Roll Correction:
-<BR>   Roll offset by bias.
-<BR>   Roll bias:                     0.500000 deg
-<BR>   Port roll bias:                0.000000 deg
-<BR>   Starboard roll bias:           0.000000 deg
-<P>
-<BR> Pitch Correction:
-<BR>   Pitch not modified.
-<BR>   Pitch bias:                    0.000000 deg
-<P>
-<BR> Heading Correction:
-<BR>   Heading not modified.
-<BR>   Heading offset:                0.000000 deg
-<P>
-<BR> Amplitude Corrections:
-<BR>   Amplitude correction off.
-<P>
-<BR> Sidescan Corrections:
-<BR>   Sidescan correction off.
-<P>
-<BR> Sidescan Recalculation:
-<BR>   Sidescan not recalculated.
-<BR>   Sidescan pixel size:           0.000000
-<BR>   Sidescan swath width:          0.000000
-<BR>   Sidescan interpolation:        0
-<P>
-<BR> Metadata Insertion:
-<BR>   Metadata vessel:
-<BR>   Metadata institution:
-<BR>   Metadata platform:
-<BR>   Metadata sonar:
-<BR>   Metadata sonarversion:
-<BR>   Metadata cruiseid:
-<BR>   Metadata cruisename:
-<BR>   Metadata pi:
-<BR>   Metadata piinstitution:
-<BR>   Metadata client:
-<BR>   Metadata svcorrected:          -1
-<BR>   Metadata tidecorrected         -1
-<BR>   Metadata batheditmanual        -1
-<BR>   Metadata batheditauto:         -1
-<BR>   Metadata rollbias:             0.000000
-<BR>   Metadata pitchbias:            0.000000
-<BR>   Metadata headingbias:          0.000000
-<BR>   Metadata draft:                0.000000
-<P>
-<BR> 236 navigation records read
-<BR> Nav start time: 2001 08 29 22:38:02.082999
-<BR> Nav end time:   2001 08 29 23:37:22.322000
-<P>
-<BR> 47 bathymetry edits read
-<P>
-<BR> 236 input data records
-<BR> 3587 input nav records
-<BR> 17 input comment records
-<BR> 6617 input other records
-<BR> 236 output data records
-<BR> 3587 output nav records
-<BR> 64 output comment records
-<BR> 6617 output other records
-<P>
-<BR> Generating inf file for /u/mbuser/survey/0051_20010829_223755p.mb57
-<BR> Generating fbt file for /u/mbuser/survey/0051_20010829_223755p.mb57
-<BR> Generating fnv file for /u/mbuser/survey/0051_20010829_223755p.mb57
-<P>
-<A NAME="lbAL"> </A>
-<H2>SEE ALSO</H2>
-
-<B><A HREF="mbsystem.html">mbsystem</A></B>(1), <B><A HREF="mbset.html">mbset</A></B>(1),
-<B><A HREF="mbedit.html">mbedit</A></B>(1), <B><A HREF="mbnavedit.html">mbnavedit</A></B>(1), <B><A HREF="mbvelocitytool.html">mbvelocitytool</A></B>(1)
-<P>
-<A NAME="lbAM"> </A>
-<H2>BUGS</H2>
-
-You tell me.
-<P>
-
-<HR>
-<A NAME="index"> </A><H2>Index</H2>
-<DL>
-<DT><A HREF="#lbAB">NAME</A><DD>
-<DT><A HREF="#lbAC">VERSION</A><DD>
-<DT><A HREF="#lbAD">SYNOPSIS</A><DD>
-<DT><A HREF="#lbAE">DESCRIPTION</A><DD>
-<DT><A HREF="#lbAF">MBPROCESS PARAMETER FILE COMMANDS</A><DD>
-<DT><A HREF="#lbAG">ANCILLARY DATA FILES</A><DD>
-<DT><A HREF="#lbAH">AUTHORSHIP</A><DD>
-<DT><A HREF="#lbAI">OPTIONS</A><DD>
-<DT><A HREF="#lbAJ">NAVIGATION FORMATS</A><DD>
-<DT><A HREF="#lbAK">EXAMPLES</A><DD>
-<DT><A HREF="#lbAL">SEE ALSO</A><DD>
-<DT><A HREF="#lbAM">BUGS</A><DD>
-</DL>
-<HR>
-</PRE>
-
-<CENTER><P><BR>
-Last Updated: 10 November 2014</P></CENTER>
-
-<HR>
-<P><A HREF="mbsystem_man_list.html">Return to list of MB-System manual pages...</A></P>
-<P><A HREF="mbsystem_home.html"><IMG SRC="mbsystem_logo_small.gif" BORDER=0 HEIGHT=55 WIDTH=158 ALIGN=BOTTOM></A><A HREF="mbsystem_home.html">Back
-to MB-System Home Page...</A></P>
-
-</BODY>
-</HTML>
diff --git a/src/html/mbps.html b/src/html/mbps.html
deleted file mode 100644
index 465a9ea..0000000
--- a/src/html/mbps.html
+++ /dev/null
@@ -1,285 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<HTML VERSION="2.0">
-<HEAD>
-   <TITLE>MB-System Unix Manual Page: mbps</TITLE>
-<!-- WEBMAGIC VERSION NUMBER="2.0.2" -->
-<!-- WEBMAGIC TRANSLATION NAME="ServerRoot" SRC="/var/www/htdocs/" DST="/" -->
-<!-- WEBMAGIC TRANSLATION NAME="ProjectRoot" SRC="./" DST="" -->
-</HEAD>
-<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#336699" VLINK="#997040" ALINK="#CC9900">
-<BODY>
-<CENTER><H3><U>MB-System Unix Manual Page</U></H3></CENTER>
-<PRE>
-<H1>MBPS</H1>
-Section:  MB-System 5.0  (1)<BR>Updated:  3 June 2013 <BR><A HREF="#index">Index</A>
-<HR>
-
-<A NAME="lbAB"> </A>
-<H2>NAME</H2>
-
-<B>mbps</B> - Generates a PostScript perspective plot of a piece of swath sonar data.
-<P>
-<A NAME="lbAC"> </A>
-<H2>VERSION</H2>
-
-Version 5.0
-<P>
-<A NAME="lbAD"> </A>
-<H2>SYNOPSIS</H2>
-
-<B>mbps</B> [<B>-F</B><I>format </I><B>-I</B><I>filename </I><B>-Nnpingsmax</B><I> </I><B>-Ppings</B><I>
-</I><B>-A</B><I>alpha </I><B>-B</B><I>yr/mo/da/hr/mn/sc
-</I><B>-D</B><I>view_direction </I><B>-E</B><I>yr/mo/da/hr/mn/sc </I><B>-G</B><I>gap
-</I><B>-K</B><I>eta </I><B>-S</B><I>speedmin </I><B>-T</B><I>"title" </I><B>-X</B><I>ve
-</I><B>-W</B><I>meters_per_inch </I><B>-Y</B><I>display_stats </I><B>-Z</B><I>display_scales
-</I><B>-V -H</B>]
-<P>
-<A NAME="lbAE"> </A>
-<H2>DESCRIPTION</H2>
-
-<B>mbps</B> is a utility to generate an (almost correct) perspective view
-of a piece of swath sonar data. It is especially useful to get a detailed
-view of the quality of the data (which is not very well assessed in a contour
-plot) and to make pretty pictures of features that fit within a swath.
-The output is PostScript code, that can be piped to a PostScript printer, or to a file.
-The options are a bit hard to interpret without a picture. Consider a
-frame of reference tied to the ship, with z upward, x across the track
-(port being negative, starboard positive) and y along the track. Using
-the <B>-D</B> option, the data can be viewed from port, starboard,
-or from the back. In the first two cases, the y-axis is horizontal in
-the plot; in the third case, the x-axis is horizontal.  The angle <I>alpha</I>
-is the angle between the x-axis and the y-axis in the final view; <I>eta</I> is the angle of elevation of the observing point (90 degrees being the zenith).  The
-data points are plotted as triangular polygons with the vertices at three good (ie. unflagged) adjacent data points. A given point is adjacent to 8 points in the surrounding swath (top, bottom, 2 sides, and 4 corners).  Now that you are thoroughly
-confused, just try plotting a half-hour or so of data from your favorite
-place. The defaults are such that a decent plot should come out.
-The plot will be scaled automatically to fit on a page, and will contain vertical and horizontal scales, an arrow pointing in the direction of the ship's motion, coordinate axes, and miscellaneous
-information identifying the piece of data being plotted.
-Now change some of the options, and things should get clearer.
-<P>
-<A NAME="lbAF"> </A>
-<H2>AUTHORSHIP</H2>
-
-Russ T. Alexander
-<BR>
-
-<BR>  Formerly at University of California at Santa Barbara
-<BR>
-
-Alberto Malinverno (now at Schlumberger)
-<BR>
-
-<BR>  Lamont-Doherty Earth Observatory
-<P>
-<A NAME="lbAG"> </A>
-<H2>OPTIONS</H2>
-
-<DL COMPACT>
-<DT><B>-A</B>
-
-<DD>
-<I>alpha</I>
-<BR>
-
-Sets the angle alpha (degrees) between the y-axis (shiptrack direction) and
-the x-axis (across-track). Default = <I>alpha = 70.
-<DT></I><B>-B</B>
-
-<DD>
-<I>yr/mo/da/hr/mn/sc</I>
-<BR>
-
-This option sets the starting time for data allowed in the input data.
-The <B>-E</B> option sets the ending time for data. If the
-starting time is before the ending time, then any data
-with a time stamp before the starting time or after the
-ending time is ignored. If instead the starting time is
-after the ending time, then any data between the ending
-and starting time will be ignored. This scheme allows time
-windowing both inside and outside a specified interval.
-Default: <I>yr/mo/da/hr/mn/sc</I> = 1962/2/21/10/30/0.
-<DT><B>-D</B>
-
-<DD>
-<I>view_direction</I>
-<BR>
-
-Sets the viewing direction; <I>viewdir</I> is a single character, either
-P/p (view from the port side), S/s (starboard), or B/b (back). Default
-<I>view_direction = S.
-<DT></I><B>-E</B>
-
-<DD>
-<I>yr/mo/da/hr/mn/sc</I>
-<BR>
-
-This option sets the ending time for data allowed in the input data.
-The <B>-B</B> option sets the starting time for data. If the
-starting time is before the ending time, then any data
-with a time stamp before the starting time or after the
-ending time is ignored. If instead the starting time is
-after the ending time, then any data between the ending
-and starting time will be ignored. This scheme allows time
-windowing both inside and outside a specified interval.
-Default: <I>yr/mo/da/hr/mn/sc</I> = 2062/2/21/10/30/0.
-<DT><B>-F</B>
-
-<DD>
-<I>format</I>
-<BR>
-
-Sets the format for the input swath sonar data using
-<B>MBIO</B> integer format identifiers.
-This program uses the <B>MBIO</B> library and will read any swath sonar
-format supported by <B>MBIO</B>. A list of the swath sonar data formats
-currently supported by <B>MBIO</B> and their identifier values
-is given in the <B>MBIO</B> manual page. Default: <I>format</I> = 11.
-<DT><B>-G</B>
-
-<DD>
-<I>gap</I>
-<BR>
-
-Sets the manner in which data gaps are displayed.  If <I>gap </I>= 1 then
-gaps are filled with black.  If <I>gap </I>= 0 then gaps are not filled and appear the same as the background color of the paper.
-Default: <I>gap </I>= 1.
-<DT><B>-H</B>
-
-<DD>
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-<DT><B>-I</B>
-
-<DD>
-<I>filename</I>
-<BR>
-
-File from which the input data will be read. If
-no input file is specified, the input will be read
-from stdin. Default: <I>filename</I> = stdin.
-<DT><B>-K</B>
-
-<DD>
-<I>eta</I>
-<BR>
-
-Sets the angle eta (degrees) that is the elevation of the observer over
-the plane defined by the mean depth. Default <I>eta = 45.
-<DT></I><B>-N</B>
-
-<DD>
-<I>npingsmax</I>
-<BR>
-
-Sets the maximum number of pings to be read and plotted.
-Default: <I>npingsmax</I> = 1000.
-<DT><B>-P</B>
-
-<DD>
-<I>pings</I>
-<BR>
-
-Sets the ping averaging of the input data. If <I>pings</I> = 1, then
-no ping averaging is performed. If <I>pings</I> > 0, then
-that number of input pings will be averaged to produce one output
-ping.  If <I>pings</I> = 0, then the ping averaging will automatically
-be done so that the along-track ping spacing is equal to the across-track
-beam spacing.
-Default: <I>pings</I> = 1 (no ping averaging).
-<DT><B>-S</B>
-
-<DD>
-<I>speedmin</I>
-<BR>
-
-Sets the minimum speed in km/hr (5.5 kts ~ 10 km/hr) allowed in
-the input data; pings associated with a smaller ship speed will not be used. Default: <I>speed</I> = 0.
-<DT><B>-T</B>
-
-<DD>
-<I>"title"</I>
-<BR>
-
-Sets the title printed at the top of the plot.  The title should be enclosed within double quotes.  Default: no title.
-<DT><B>-V</B>
-
-<DD>
-If the <B>-V</B> flag is given, then <B>mbps</B> works in a "verbose" mode and
-outputs the program version being used and all read error status messages.
-<DT><B>-W</B>
-
-<DD>
-<I>meters_per_inch</I>
-<BR>
-
-Sets the horizontal plotting scale.  Default: automatically calculates
-a scale such that the plot fits on a page.
-<DT><B>-X</B>
-
-<DD>
-<I>ve</I>
-<BR>
-
-Sets the vertical exaggeration. Default <I>ve</I> = 5.
-<DT><B>-Y</B>
-
-<DD>
-<I>display_stats</I>
-<BR>
-
-Sets whether the final plot includes info such as mean latitude, mean longitude, mean heading, <I>alpha</I>, <I>eta</I>, <I>ve</I>, scale, track length, begin time, and end time. if <I>display_stats </I>= 1 then the above info is plotted; if <I>dispaly_stats </I>= 0 then it is not plotted.  Default: <I>display_stats  </I>= 1.
-<DT><B>-Z</B>
-
-<DD>
-<I>display_scales</I>
-<BR>
-
-Sets whether the final plot includes a horizontal scale, a vertical scale, an arrow pointing in the ship heading direction, and coordinate axes.  if <I>display_scales </I>= 1 then the above info is plotted; if <I>dispaly_scales </I>= 0 then it is not plotted.  Default: <I>display_scales  </I>= 1.
-<P>
-</DL>
-<A NAME="lbAH"> </A>
-<H2>EXAMPLES</H2>
-
-Suppose one wishes to take a look at data from a Hydrosweep file in
-L-DGO edmb format (data.edmb), starting at 09:00 and ending at
-10:30 on September 3, 1991. The following will output PostScript to a file called fred.
-<P>
-<BR> <TT>       </TT>mbps -F22 -Idata.edmb -B1991/9/3/9/0/0 -E1991/9/3/10/30/0 > fred<BR>
-<P>
-<A NAME="lbAI"> </A>
-<H2>SEE ALSO</H2>
-
-<B><A HREF="mbsystem.html">mbsystem</A></B>(1), <B><A HREF="mbcontour.html">mbcontour</A></B>(1), <B><A HREF="mbswath.html">mbswath</A></B>(1)
-<P>
-<A NAME="lbAJ"> </A>
-<H2>BUGS</H2>
-
-<B>mbps</B> assumes that the ship was moving on a straight line. Weird
-plots will result if this is not the case.  <B>mbps </B>only draws polygons bewteen 3 adjacent good points; if isolated points without 2 neighbors exist they will not be apparent in the final plot.  The filling of bad polygons is not perfect and gaps in the black fill, especially at the edges of swaths, may occur.
-<P>
-
-<HR>
-<A NAME="index"> </A><H2>Index</H2>
-<DL>
-<DT><A HREF="#lbAB">NAME</A><DD>
-<DT><A HREF="#lbAC">VERSION</A><DD>
-<DT><A HREF="#lbAD">SYNOPSIS</A><DD>
-<DT><A HREF="#lbAE">DESCRIPTION</A><DD>
-<DT><A HREF="#lbAF">AUTHORSHIP</A><DD>
-<DT><A HREF="#lbAG">OPTIONS</A><DD>
-<DT><A HREF="#lbAH">EXAMPLES</A><DD>
-<DT><A HREF="#lbAI">SEE ALSO</A><DD>
-<DT><A HREF="#lbAJ">BUGS</A><DD>
-</DL>
-<HR>
-</PRE>
-
-<CENTER><P><BR>
-Last Updated: 3 June 2013</P></CENTER>
-
-<HR>
-<P><A HREF="mbsystem_man_list.html">Return to list of MB-System manual pages...</A></P>
-<P><A HREF="mbsystem_home.html"><IMG SRC="mbsystem_logo_small.gif" BORDER=0 HEIGHT=55 WIDTH=158 ALIGN=BOTTOM></A><A HREF="mbsystem_home.html">Back
-to MB-System Home Page...</A></P>
-
-</BODY>
-</HTML>
diff --git a/src/html/mbrollbias.html b/src/html/mbrollbias.html
deleted file mode 100644
index 2fd0469..0000000
--- a/src/html/mbrollbias.html
+++ /dev/null
@@ -1,229 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<HTML VERSION="2.0">
-<HEAD>
-   <TITLE>MB-System Unix Manual Page: mbrollbias</TITLE>
-<!-- WEBMAGIC VERSION NUMBER="2.0.2" -->
-<!-- WEBMAGIC TRANSLATION NAME="ServerRoot" SRC="/var/www/htdocs/" DST="/" -->
-<!-- WEBMAGIC TRANSLATION NAME="ProjectRoot" SRC="./" DST="" -->
-</HEAD>
-<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#336699" VLINK="#997040" ALINK="#CC9900">
-<BODY>
-<CENTER><H3><U>MB-System Unix Manual Page</U></H3></CENTER>
-<PRE>
-<H1>mbrollbias</H1>
-Section:  MB-System 5.0  (1)<BR>Updated:  3 June 2013 <BR><A HREF="#index">Index</A>
-<HR>
-
-<A NAME="lbAB"> </A>
-<H2>NAME</H2>
-
-<B>mbrollbias</B> - Assess roll bias of swath sonar sonar systems.
-<P>
-<A NAME="lbAC"> </A>
-<H2>VERSION</H2>
-
-Version 5.0
-<P>
-<A NAME="lbAD"> </A>
-<H2>SYNOPSIS</H2>
-
-<B>mbrollbias</B> <B>-F</B><I>format1/format2 </I><B>-L</B><I>lonflip </I><B>-I</B><I>file1 </I><B>-J</B><I>file2 </I><B>-R</B><I>west/east/south/north [</I><B>-D</B><I>xdim/ydim </I><B>-H -V</B><I>]
-<P>
-</I><A NAME="lbAE"> </A>
-<H2>DESCRIPTION</H2>
-
-<B>mbrollbias</B> is a utility used to assess roll bias of swath sonar
-sonar systems using bathymetry data from two swaths covering the same
-seafloor in opposite directions. The program takes two input
-files and calculates best fitting planes for each dataset.
-The roll bias is calculated by solving for a common roll bias
-factor which explains the difference between the seafloor
-slopes observed on the two swaths.  This approach assumes that
-pitch bias is not a factor; this assumption is most correct when
-the heading of the two shiptracks are exactly opposite. The area is
-divided into a number of rectangular regions and calculations are done
-in each region containing a sufficient number of data from both
-swaths.  The data contained in the two datafiles should be processed to
-ensure that no artifacts will bias the roll bias calculations.
-Typically, this means using <B>mbclean</B> and or <B>mbedit</B> to
-remove noisy outer beams.
-A positive roll bias value means that the the vertical reference
-used by the swath sonar system is biased to starboard,
-giving rise to shallow bathymetry to port and deep bathymetry
-to starboard.  Results are written to stdout.
-<P>
-<A NAME="lbAF"> </A>
-<H2>AUTHORSHIP</H2>
-
-David W. Caress (<A HREF="mailto:caress at mbari.org">caress at mbari.org</A>)
-<BR>
-
-<BR>  Monterey Bay Aquarium Research Institute
-<BR>
-
-Dale N. Chayes (<A HREF="mailto:dale at ldeo.columbia.edu">dale at ldeo.columbia.edu</A>)
-<BR>
-
-<BR>  Lamont-Doherty Earth Observatory
-<P>
-<A NAME="lbAG"> </A>
-<H2>OPTIONS</H2>
-
-<DL COMPACT>
-<DT><B>-F</B>
-
-<DD>
-<I>format1/format2</I>
-<BR>
-
-Sets the <B>MBIO</B> format identifiers for the first and
-second data files, respectively.
-This program uses the <B>MBIO</B> library and will read or write any swath sonar
-format supported by <B>MBIO</B>. A list of the swath sonar data formats
-currently supported by <B>MBIO</B> and their identifier values
-is given in the <B>MBIO</B> manual page.
-<DT><B>-D</B>
-
-<DD>
-<I>xdim/ydim</I>
-<BR>
-
-The area specified using the <B>-R</B> option is divided up into
-a grid of rectangular regions; roll bias calculations are done
-in each of these regions providing sufficient data is available
-from both data files.  This option sets the dimensions of the
-region grid.  Use <I>xdim</I> = <I>ydim</I> = 1 to make one
-calculation for the entire area.
-Default:  <I>xdim</I> = <I>ydim</I> = 1.
-<DT><B>-H</B>
-
-<DD>
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-<DT><B>-I</B>
-
-<DD>
-<I>file1</I>
-<BR>
-
-Sets the filename of the first data file to be analyzed.
-<DT><B>-J</B>
-
-<DD>
-<I>file2</I>
-<BR>
-
-Sets the filename of the second data file to be analyzed.
-<DT><B>-L</B>
-
-<DD>
-<I>lonflip</I>
-<BR>
-
-Sets the range of the longitude values returned.
-If <I>lonflip</I>=-1 then the longitude values will be in
-the range from -360 to 0 degrees. If <I>lonflip</I>=0
-then the longitude values will be in
-the range from -180 to 180 degrees. If <I>lonflip</I>=1
-then the longitude values will be in
-the range from 0 to 360 degrees.
-Default: <I>lonflip</I> = 0.
-<DT><B>-R</B>
-
-<DD>
-<I>west/east/south/north</I>
-<BR>
-
-Sets the longitude and latitude bounds of the area of the roll bias test.
-<DT><B>-V</B>
-
-<DD>
-The <B>-V</B> option causes the program to print out the program name
-and version during execution.
-</DL>
-<A NAME="lbAH"> </A>
-<H2>EXAMPLE</H2>
-
-Suppose you want to calculate roll bias using two coincident swaths
-of Hydrosweep DS data collected in nearly opposite directions.
-Run <B>mbrollbias</B> as follows:
-<P>
-<BR> <TT>       </TT>mbrollbias -R-51.07/-50.98/9.0166/9.117 -D1/1 -F22/22<BR>
-<BR> <TT>       </TT><TT>        </TT>-Ihs_leg1_z.mb22 -Jhs_leg2_z.mb22 -V<BR>
-<P>
-The output looks like:
-<P>
-<BR> Program mbrollbias
-<BR> Version $Id: mbrollbias.1 2096 2013-06-04 08:17:22Z caress $
-<BR> MB-system Version 4.00
-<P>
-<BR> mbrollbias Parameters:
-<BR> Input file 1:     hs_leg1_z.mb22
-<BR> Input file 2:     hs_leg2_z.mb22
-<BR> Region grid bounds:
-<BR>   Longitude:  -51.0700  -50.9800
-<BR>   Latitude:     9.0166    9.1170
-<BR> Region grid dimensions: 1 1
-<BR> Longitude interval: 0.090000 degrees or 9.894392 km
-<BR> Latitude interval:  0.100400 degrees or 11.104426 km
-<BR> Longitude flipping:   0
-<P>
-<BR> 4840 depth points counted in hs_leg1_z.mb22
-<BR> 1733 depth points counted in hs_leg2_z.mb22
-<BR> 4840 depth points read from hs_leg1_z.mb22
-<BR> 1733 depth points read from hs_leg2_z.mb22
-<P>
-<BR> Region 0 (0 0) bounds:
-<BR>     Longitude:  -51.0700  -50.9800
-<BR>     Latitude:     9.0166    9.1170
-<BR> First data file:    hs_leg1_z.mb22
-<BR>     Number of data: 4840
-<BR>     Mean heading:   107.845062
-<BR>     Plane fit:      4.759709 -0.002327 -0.004623
-<BR> Second data file:   hs_leg2_z.mb22
-<BR>     Number of data: 1733
-<BR>     Mean heading:   302.022793
-<BR>     Plane fit:      4.640304 0.008438 0.008494
-<BR> Roll bias:   -0.007288 (-0.417598 degrees)
-<BR> Roll bias is positive to port, negative to starboard.
-<BR> A postive roll bias means the ship rolls to port,
-<BR>     giving rise to shallow bathymetry to port and
-<BR>     deep bathymetry to starboard.
-<P>
-<A NAME="lbAI"> </A>
-<H2>SEE ALSO</H2>
-
-<B><A HREF="mbsystem.html">mbsystem</A></B>(1)
-<P>
-<A NAME="lbAJ"> </A>
-<H2>BUGS</H2>
-
-Probably.
-<P>
-
-<HR>
-<A NAME="index"> </A><H2>Index</H2>
-<DL>
-<DT><A HREF="#lbAB">NAME</A><DD>
-<DT><A HREF="#lbAC">VERSION</A><DD>
-<DT><A HREF="#lbAD">SYNOPSIS</A><DD>
-<DT><A HREF="#lbAE">DESCRIPTION</A><DD>
-<DT><A HREF="#lbAF">AUTHORSHIP</A><DD>
-<DT><A HREF="#lbAG">OPTIONS</A><DD>
-<DT><A HREF="#lbAH">EXAMPLE</A><DD>
-<DT><A HREF="#lbAI">SEE ALSO</A><DD>
-<DT><A HREF="#lbAJ">BUGS</A><DD>
-</DL>
-<HR>
-</PRE>
-
-<CENTER><P><BR>
-Last Updated: 3 June 2013</P></CENTER>
-
-<HR>
-<P><A HREF="mbsystem_man_list.html">Return to list of MB-System manual pages...</A></P>
-<P><A HREF="mbsystem_home.html"><IMG SRC="mbsystem_logo_small.gif" BORDER=0 HEIGHT=55 WIDTH=158 ALIGN=BOTTOM></A><A HREF="mbsystem_home.html">Back
-to MB-System Home Page...</A></P>
-
-</BODY>
-</HTML>
diff --git a/src/html/mbrolltimelag.html b/src/html/mbrolltimelag.html
deleted file mode 100644
index f681053..0000000
--- a/src/html/mbrolltimelag.html
+++ /dev/null
@@ -1,283 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<HTML VERSION="2.0">
-<HEAD>
-   <TITLE>MB-System Unix Manual Page: mbrolltimelag</TITLE>
-<!-- WEBMAGIC VERSION NUMBER="2.0.2" -->
-<!-- WEBMAGIC TRANSLATION NAME="ServerRoot" SRC="/var/www/htdocs/" DST="/" -->
-<!-- WEBMAGIC TRANSLATION NAME="ProjectRoot" SRC="./" DST="" -->
-</HEAD>
-<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#336699" VLINK="#997040" ALINK="#CC9900">
-<BODY>
-<CENTER><H3><U>MB-System Unix Manual Page</U></H3></CENTER>
-<PRE>
-<H1>mbrolltimelag</H1>
-Section:  MB-System 5.0  (1)<BR>Updated:  3 June 2013 <BR><A HREF="#index">Index</A>
-<HR>
-
-<A NAME="lbAB"> </A>
-<H2>NAME</H2>
-
-<B>mbrolltimelag</B> - Calculates cross correlation between the apparent
-bottom slope in swath bathymetry data and the roll time series used by
-the sonar in order to assess attitude time lag problems.
-<P>
-<A NAME="lbAC"> </A>
-<H2>VERSION</H2>
-
-Version 5.0
-<P>
-<A NAME="lbAD"> </A>
-<H2>SYNOPSIS</H2>
-
-<B>mbrolltimelag</B> <B>-I</B><I>swathdata</I> [<B>-F</B><I>format</I>
-<B>-K</B><I>rollsource</I> <B>-N</B><I>nping</I> <B>-O</B><I>outroot</I> <B>-S</B><I>navchannel</I>
-<B>-T</B><I>nlag/lagmin/lagmax</I> <B>-V -H</B> ]
-<A NAME="lbAE"> </A>
-<H2>DESCRIPTION</H2>
-
-<B>MBrolltimelag</B> is an utility used to assess relative time errors,
-or time lag, between the ping timestamps of swath bathymetry data
-and the sonar attitude (roll and pitch) used in calculating
-the bathymetry. For any sonar ping, a roll error will cause
-the acrosstrack bathymetry profile to rotate vertically so that
-it is too shallow on one side of the swath and too deep on the other.
-Consequently, if no correction is made for the roll of the sonar, then the
-bathymetry data will appear to be ruffled in the outer swath.
-If the timestamps of the roll and ping data are consistent, then
-correcting for roll will produce bathymetry without these pronounced
-across-track artifacts. If, however, there is a lag between the two
-sets of time stamps, then the roll values used for correction will
-be incorrect, and the ruffles will still occur.
-<P>
-In order to determine the amount of time lag, if any, associated
-with a swath bathymetry dataset, this program calculates the
-cross correlation between the roll signal and the apparent bottom
-slope in the case of no roll correction (in practice this latter
-value is found by subtracting the applied roll value from the
-apparent acrosstrack bottom slope). If the seafloor is planar so
-that the apparent slope signal is dominated by roll error, then
-there will be a distinct peak in the cross correlation function
-at the actual time lag.
-<P>
-<B>MBrolltimelag</B> reads one or more swath sonar data files
-containing bathymetry data and calculates many cross correlation
-functions. The number of pings used for each calculation is
-specified with the <B>-N</B><I>nping</I> option. The range of time
-lags used and the number of lag values are all specified using
-the <B>-T</B><I>nlag/lagmin/lagmax</I> option. The cross correlation
-functions are output to a file named "swathdata_xcorr.txt", where
-<I>swathdata</I> is the input file or datalist specified with the
-<B>-I</B><I>swathdata</I> option. The macro <B>mbm_xyplot</B> is also
-called to generate a plot shellscript that, if run, will generate
-a postscript plot of the correlation functions.
-<P>
-<A NAME="lbAF"> </A>
-<H2>AUTHORSHIP</H2>
-
-David W. Caress (<A HREF="mailto:caress at mbari.org">caress at mbari.org</A>)
-<BR>
-
-<BR>  Monterey Bay Aquarium Research Institute
-<BR>
-
-Dale N. Chayes (<A HREF="mailto:dale at ldeo.columbia.edu">dale at ldeo.columbia.edu</A>)
-<BR>
-
-<BR>  Lamont-Doherty Earth Observatory
-<P>
-<A NAME="lbAG"> </A>
-<H2>OPTIONS</H2>
-
-<DL COMPACT>
-<DT><B>-F</B>
-
-<DD>
-<I>format</I>
-<BR>
-
-Sets the <B>MBIO</B> integer format identifier
-for the input file specified with the
-<B>-I</B> option. By default, <B>mbrolltimelag</B>
-infers the format from the "*.mbXX" <B>MB-System</B> suffix
-convention.
-<DT><B>-H</B>
-
-<DD>
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-<DT><B>-I</B>
-
-<DD>
-<I>filename</I>
-<BR>
-
-Sets the input filename. If <I>format</I> > 0 (set with the
-<B>-F</B> option) then the swath sonar data contained in <I>infile</I>
-is read and processed. If <I>format</I> < 0, then <I>infile</I>
-is assumed to be an ascii file containing a list of the input swath sonar
-data files to be processed and their formats.  The program will read
-and process the data in each one of these files. Each input file will
-have an associated output file with either the ".sga" or ".aga" suffix.
-In the <I>infile</I> file, each
-data file should be followed by a data format identifier, e.g.:
-<BR> <TT>       </TT>datafile1 11<BR>
-<BR> <TT>       </TT>datafile2 24<BR>
-<BR>
-
-This program uses the <B>MBIO</B> library and will read any swath sonar
-format supported by <B>MBIO</B>. A list of the swath sonar data formats
-currently supported by <B>MBIO</B> and their identifier values
-is given in the <B>MBIO</B> manual page. Default: <I>infile</I> = "datalist.mb-1".
-<DT><B>-K</B>
-
-<DD>
-<I>Krollsource</I>
-<BR>
-
-This option sets the type of data record from which the roll values
-will be extracted. By default, the roll values are extracted from
-survey data records. If the <B>-S</B> option is used, the roll data
-will be extracted from primary or ancilliary navigation records. If
-this <B>-K</B> option is set, then the roll data will be extracted from
-data records of type <I>Krollsource</I>, where the possible values are listed
-here:
-<BR>     MB_DATA_DATA<TT>       </TT><TT>        </TT><TT>        </TT>1<TT>       </TT>/* general survey data */<BR>
-<BR>     MB_DATA_CALIBRATE<TT>  </TT><TT>        </TT>4<TT>       </TT>/* Hydrosweep DS */<BR>
-<BR>     MB_DATA_MEAN_VELOCITY<TT>      </TT>5<TT>       </TT>/* Hydrosweep DS */<BR>
-<BR>     MB_DATA_VELOCITY_PROFILE<TT>   </TT>6<TT>       </TT>/* general */<BR>
-<BR>     MB_DATA_NAV<TT>        </TT><TT>        </TT><TT>        </TT>12<TT>      </TT>/* Simrad, Reson 7k */<BR>
-<BR>     MB_DATA_HEADING<TT>    </TT><TT>        </TT>17<TT>      </TT>/* Simrad, Hypack */<BR>
-<BR>     MB_DATA_ATTITUDE<TT>   </TT><TT>        </TT>18<TT>      </TT>/* Simrad, Hypack, Reson 7k */<BR>
-<BR>     MB_DATA_SSV<TT>        </TT><TT>        </TT><TT>        </TT>19<TT>      </TT>/* Simrad */<BR>
-<BR>     MB_DATA_NAV1<TT>       </TT><TT>        </TT><TT>        </TT>28<TT>      </TT>/* ancillary nav system 1 */<BR>
-<BR>     MB_DATA_NAV2<TT>       </TT><TT>        </TT><TT>        </TT>29<TT>      </TT>/* ancillary nav system 2 */<BR>
-<BR>     MB_DATA_NAV3<TT>       </TT><TT>        </TT><TT>        </TT>30<TT>      </TT>/* ancillary nav system 3 */<BR>
-<BR>     MB_DATA_MOTION<TT>     </TT><TT>        </TT><TT>        </TT>32<TT>      </TT>/* Reson 7k */<BR>
-<BR>     MB_DATA_SIDESCAN2<TT>  </TT><TT>        </TT>37<TT>      </TT>/* Reson 7k, XTF */<BR>
-<BR>     MB_DATA_SIDESCAN3<TT>  </TT><TT>        </TT>38<TT>      </TT>/* Reson 7k, XTF */<BR>
-<BR>     MB_DATA_ROLL<TT>       </TT><TT>        </TT><TT>        </TT>40<TT>      </TT>/* Reson 7k */<BR>
-<BR>     MB_DATA_PITCH<TT>      </TT><TT>        </TT><TT>        </TT>41<TT>      </TT>/* Reson 7k */<BR>
-<BR>     MB_DATA_NMEA_RMC<TT>   </TT><TT>        </TT>48<TT>      </TT>/* NMEA */<BR>
-<BR>     MB_DATA_NMEA_DBT<TT>   </TT><TT>        </TT>49<TT>      </TT>/* NMEA */<BR>
-<BR>     MB_DATA_NMEA_DPT<TT>   </TT><TT>        </TT>50<TT>      </TT>/* NMEA */<BR>
-<BR>     MB_DATA_NMEA_ZDA<TT>   </TT><TT>        </TT>51<TT>      </TT>/* NMEA */<BR>
-<BR>     MB_DATA_NMEA_GLL<TT>   </TT><TT>        </TT>52<TT>      </TT>/* NMEA */<BR>
-<BR>     MB_DATA_NMEA_GGA<TT>   </TT><TT>        </TT>53<TT>      </TT>/* NMEA */<BR>
-<BR>     MB_DATA_ATTITUDE1<TT>  </TT><TT>        </TT>55<TT>      </TT>/* ancillary attitude system 1 */<BR>
-<BR>     MB_DATA_ATTITUDE2<TT>  </TT><TT>        </TT>56      /* ancillary attitude system 2 */<BR>
-<BR>     MB_DATA_ATTITUDE3<TT>  </TT><TT>        </TT>57<TT>      </TT>/* ancillary attitude system 3 */<BR>
-<BR>
-
-A typical value is <I>Krollsource</I>=18, which specifies extraction of roll from asynchronous attitude
-data records. This option supercedes the <B>-S</B> option.
-<DT><B>-N</B>
-
-<DD>
-<I>nping</I>
-<BR>
-
-Sets the number of pings to be read for each cross correlation calculation.
-Default: <I>nping</I> = 50.
-<DT><B>-O</B>
-
-<DD>
-<I>outroot</I>
-<BR>
-
-Sets the root of the output filenames.
-Default: output root is is the input filename minus any <B>MB-System</B>
-filename suffixe (e.g. the root derived from "datalistp.mb-1" will be
-"datalist").
-<DT><B>-S</B>
-
-<DD>
-<I>navchannel</I>
-<BR>
-
-Sets <B>MBrolltimelag</B> to read the roll data from navigation records rather
-than the record type listed as the "navigation source" for a particular
-data format. Swath data formats may contain synchronous navigation
-(navigation is included in survey data records), asynchronous navigation
-(navigation comes in records separate from and at different times
-than the survey data records), or both (survey records contain merged
-navigation while the original asynchronous navigation is preserved in
-separate navigation records). Some data formats provide for multiple
-navigation sources, so that there are more than one channel of
-asynchronous data records. In this case one channel is always designated
-as the primary or active navigation channel. The <B>-S</B> option allows
-the user to specify that <B>MBrolltimelag</B> uses roll from
-the primary asynchronous navigation (<B>-N</B><I>0</I>) or from one
-of three auxiliary navigation channels
-(<B>-N</B><I>1</I>, <B>-N</B><I>2</I>, or <B>-N</B><I>3</I>). If <B>-N</B> is
-used but the data file
-does not contain asynchronous navigation or the specified auxiliary
-navigation channels, then <B>mbnavlist</B> will output nothing. To
-determine if a datafile contains asynchronous navigation and/or auxiliary
-navigation, run <B>mbinfo</B> using its <B>-N</B> option to get counts
-of all data record types in the file.
-Default: <I>navchannel</I> = 1.
-<DT><B>-T</B>
-
-<DD>
-<I>nlag/lagmin/lagmax</I>
-<BR>
-
-Sets the time lag values used for the cross correlation calculations. A total
-of <I>nlag</I>  cross correlation values will be calculated evenly spaced from
-<I>lagmin</I> seconds to <I>lagmax</I> seconds.
-Default: <I>nlag</I> = 41, <I>lagmin</I> = -2.0 seconds, <I>lagmax</I> = 2.0 seconds.
-<DT><B>-V</B>
-
-<DD>
-The <B>-V</B> option causes the program to be verbose.
-</DL>
-<A NAME="lbAH"> </A>
-<H2>EXAMPLE</H2>
-
-Suppose you want to evaluate the possible roll time lag in a collection
-of Reson 7125 files referenced by a datalist called datalistp.mb-1. The
-sonar was pinging at 2Hz (twice a second), and roll is available at 10 Hz
-in asynchronous navigation records that can be accessed with
-<I>navchannel</I> = 2. We choose to calculate the cross correlation with
-time lags separated by 0.1 seconds from -2.0 to 2.0 seconds. The following
-will suffice:
-<P>
-<BR> <TT>       </TT>mbrolltimelag -Idatalistp.mb-1 -N41/-2.0/2.0 -S2 -V<BR>
-<P>
-<A NAME="lbAI"> </A>
-<H2>SEE ALSO</H2>
-
-<B><A HREF="mbsystem.html">mbsystem</A></B>(1)
-<P>
-<A NAME="lbAJ"> </A>
-<H2>BUGS</H2>
-
-Da.
-<P>
-
-<HR>
-<A NAME="index"> </A><H2>Index</H2>
-<DL>
-<DT><A HREF="#lbAB">NAME</A><DD>
-<DT><A HREF="#lbAC">VERSION</A><DD>
-<DT><A HREF="#lbAD">SYNOPSIS</A><DD>
-<DT><A HREF="#lbAE">DESCRIPTION</A><DD>
-<DT><A HREF="#lbAF">AUTHORSHIP</A><DD>
-<DT><A HREF="#lbAG">OPTIONS</A><DD>
-<DT><A HREF="#lbAH">EXAMPLE</A><DD>
-<DT><A HREF="#lbAI">SEE ALSO</A><DD>
-<DT><A HREF="#lbAJ">BUGS</A><DD>
-</DL>
-<HR>
-</PRE>
-
-<CENTER><P><BR>
-Last Updated: 3 June 2013</P></CENTER>
-
-<HR>
-<P><A HREF="mbsystem_man_list.html">Return to list of MB-System manual pages...</A></P>
-<P><A HREF="mbsystem_home.html"><IMG SRC="mbsystem_logo_small.gif" BORDER=0 HEIGHT=55 WIDTH=158 ALIGN=BOTTOM></A><A HREF="mbsystem_home.html">Back
-to MB-System Home Page...</A></P>
-
-</BODY>
-</HTML>
diff --git a/src/html/mbroutetime.html b/src/html/mbroutetime.html
deleted file mode 100644
index 0744e2d..0000000
--- a/src/html/mbroutetime.html
+++ /dev/null
@@ -1,271 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<HTML VERSION="2.0">
-<HEAD>
-   <TITLE>MB-System Unix Manual Page: mbroutetime</TITLE>
-<!-- WEBMAGIC VERSION NUMBER="2.0.2" -->
-<!-- WEBMAGIC TRANSLATION NAME="ServerRoot" SRC="/var/www/htdocs/" DST="/" -->
-<!-- WEBMAGIC TRANSLATION NAME="ProjectRoot" SRC="./" DST="" -->
-</HEAD>
-<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#336699" VLINK="#997040" ALINK="#CC9900">
-<BODY>
-<CENTER><H3><U>MB-System Unix Manual Page</U></H3></CENTER>
-<PRE>
-<H1>mbroutetime</H1>
-Section:  MB-System 5.0  (1)<BR>Updated:  3 June 2013 <BR><A HREF="#index">Index</A>
-<HR>
-
-<A NAME="lbAB"> </A>
-<H2>NAME</H2>
-
-<B>mbroutetime</B> - Program to output a list of the times when a survey passes the waypoints
-of a planned survey route.
-<P>
-<A NAME="lbAC"> </A>
-<H2>VERSION</H2>
-
-Version 5.0
-<P>
-<A NAME="lbAD"> </A>
-<H2>SYNOPSIS</H2>
-
-<B>mbroutetime</B> <B>-Rroutefile [-F</B><I>format</I> <B>-I</B><I>file</I>
-<B>-O</B><I>waypointtimefile</I> <B>-U</B><I>rangethreshold</I> <B>-H -V</B>]
-<P>
-<A NAME="lbAE"> </A>
-<H2>DESCRIPTION</H2>
-
-<B>mbroutetime</B> -
-<P>
-<A NAME="lbAF"> </A>
-<H2>AUTHORSHIP</H2>
-
-David W. Caress (<A HREF="mailto:caress at mbari.org">caress at mbari.org</A>)
-<BR>
-
-<BR>  Monterey Bay Aquarium Research Institute
-<BR>
-
-Dale N. Chayes (<A HREF="mailto:dale at ldeo.columbia.edu">dale at ldeo.columbia.edu</A>)
-<BR>
-
-<BR>  Lamont-Doherty Earth Observatory
-<P>
-<A NAME="lbAG"> </A>
-<H2>OPTIONS</H2>
-
-<DL COMPACT>
-<DT><B>-F</B>
-
-<DD>
-<I>format</I>
-<BR>
-
-Sets the format for the input swath data using
-<B>MBIO</B> integer format identifiers.
-This program uses the <B>MBIO</B> library and will read any swath
-format supported by <B>MBIO</B>. A list of the swath data formats
-currently supported by <B>MBIO</B> and their identifier values
-is given in the <B>MBIO</B> manual page. Default: <I>format</I> = 11.
-<DT><B>-H</B>
-
-<DD>
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-<DT><B>-I</B>
-
-<DD>
-<I>filename</I>
-<BR>
-
-Sets the input filename. If <I>format</I> > 0 (set with the
-<B>-F</B> option) then the swath data contained in <I>infile</I>
-is read and processed. If <I>format</I> < 0, then <I>infile</I>
-is assumed to be an ascii file containing a list of the input swath
-data files to be processed and their formats.  The program will read
-the data in each one of these files.
-In the <I>infile</I> file, each
-data file should be followed by a data format identifier, e.g.:
-<BR> <TT>       </TT>datafile1 11<BR>
-<BR> <TT>       </TT>datafile2 24<BR>
-<BR>
-
-This program uses the <B>MBIO</B> library and will read any swath
-format supported by <B>MBIO</B>. A list of the swath data formats
-currently supported by <B>MBIO</B> and their identifier values
-is given in the <B>MBIO</B> manual page.
-Default: <I>infile</I> = "datalist.mb-1".
-<DT><B>-V</B>
-
-<DD>
-The <B>-V</B> option causes <B>mbroutetime</B> to print out status messages.
-<P>
-</DL>
-<A NAME="lbAH"> </A>
-<H2>EXAMPLES</H2>
-
-Suppose you are going to run the MBARI Mapping AUV on the Coaxial Segment of the
-Juan de Fuca Ridge. You have created a route file called Coaxial2009_1v3.rte using
-<B>mbgrdviz</B>. In order to create an MBARI AUV mission script for mission beginning
-with a spiral descent to an altitude of 50 m, followed by a survey run at a 75 m altitude,
-the following will suffice:
-<BR> <TT>       </TT>mbroutetime -I Coaxial2009_1v3.rte  <TT>    </TT><TT>        </TT>-A75/30/75 -B1  <TT>        </TT><TT>        </TT>-G0 -MSL -N50 -R220/83/0.3  -O Coaxial2009_1v3.cfg  -S1.5 -L30 -W100 -V<BR>
-<BR>
-
-The resulting mission script has the following header:
-<P>
-<BR>     # This MBARI Mapping AUV mission file has been generated
-<BR>     # by the MB-System program mbroutetime run by
-<BR>     # user <caress> on cpu <shepard> at <Thu Jul 30 11:36:47 PDT 2009>
-<BR>     #
-<BR>     # Mission Summary:
-<BR>     #     Route File:               Coaxial2009_1v3.rte
-<BR>     #     Mission File:             Coaxial2009_1v3.cfg
-<BR>     #     Distance:                 79501.503455 (m)
-<BR>     #     Estimated Time:           57203 (s)  15.890 (hr)
-<BR>     #     Abort Time:               60067 (s)
-<BR>     #     Max battery life:         64800 (s)
-<BR>     #     Safety margin:            1800 (s)
-<BR>     #     Ascend time:              2932 (s)
-<BR>     #     Way Points:               44
-<BR>     #     Route Points:             550
-<BR>     #     Survey behavior:          WaypointDepth
-<BR>     #     Descent style:            Spiral descent
-<BR>     #     Mapping sonar control enabled:
-<BR>     #                               Multibeam enabled
-<BR>     #                                 Multibeam receive gain:           83
-<BR>     #                                 Multibeam transmit gain:          220
-<BR>     #                                 Multibeam minimum range fraction: 0.3
-<BR>     #                               Subbottom enabled
-<BR>     #                               Low sidescan enabled
-<BR>     #                               High sidescan disabled
-<BR>     #
-<BR>     # Mission Parameters:
-<BR>     #     Vehicle Speed:            1.500000 (m/s) 2.915769 (knots)
-<BR>     #     Desired Vehicle Altitude: 75 (m)
-<BR>     #     Minimum Vehicle Altitude: 75 (m)
-<BR>     #     Abort Vehicle Altitude:   30 (m)
-<BR>     #     Maximum Vehicle Depth:    2525.307922 (m)
-<BR>     #     Abort Vehicle Depth:      2562.807922 (m)
-<BR>     #     Descent Vehicle Depth:    3 (m)
-<BR>     #     Spiral descent depth:     2324.917643 m
-<BR>     #     Spiral descent altitude:  50 m
-<BR>     #     Forward Looking Distance:  (m)
-<BR>     #     Waypoint Spacing:         100 (m)
-<BR>     #     GPS Duration:             600 (s)
-<BR>     #     Descend Rate:             0.417 (m/s)
-<BR>     #     Ascend Rate:              1 (m/s)
-<BR>     #     Initial descend Duration: 300 (s)
-<BR>     #     Setpoint Duration:        30 (s)
-<BR>     #
-<BR>     # The primary waypoints from the route file are:
-<BR>     #   <number> <longitude (deg)> <latitude (deg)> <topography (m)> <distance (m)> <type>
-<BR>     #   0 -129.588618 46.504590 -2384.917643 0.000000 3
-<BR>     #   1 -129.583151 46.507559 -2412.977865 533.709482 3
-<BR>     #   2 -129.569223 46.503420 -2548.389974 1697.143568 1
-<BR>     #   3 -129.566359 46.501080 -2494.963053 2037.557099 3
-<BR>     #   4 -129.548611 46.529852 -2539.510864 5512.537193 4
-<BR>     #   5 -129.551250 46.530628 -2562.807922 5732.537193 3
-<BR>     #   6 -129.568962 46.501924 -2531.034424 9199.497998 4
-<BR>     #   7 -129.571600 46.502699 -2519.138489 9419.497998 3
-<BR>     #   8 -129.553889 46.531404 -2547.114624 12886.458803 4
-<BR>     #   9 -129.556529 46.532180 -2514.533569 13106.458803 3
-<BR>     #   10 -129.574238 46.503475 -2470.815735 16573.419607 4
-<BR>     #   11 -129.576876 46.504250 -2444.596313 16793.419607 3
-<BR>     #   12 -129.559168 46.532956 -2521.781921 20260.380412 4
-<BR>     #   13 -129.561807 46.533732 -2537.382141 20480.380412 3
-<BR>     #   14 -129.579514 46.505026 -2429.459961 23947.341216 4
-<BR>     #   15 -129.582152 46.505801 -2412.764343 24167.341217 3
-<BR>     #   16 -129.564447 46.534508 -2545.397705 27634.302021 4
-<BR>     #   17 -129.567086 46.535284 -2534.068665 27854.302021 3
-<BR>     #   18 -129.584791 46.506576 -2398.283020 31321.262826 4
-<BR>     #   19 -129.587429 46.507352 -2390.671509 31541.262826 3
-<BR>     #   20 -129.569726 46.536059 -2489.889282 35008.223630 4
-<BR>     #   21 -129.572365 46.536835 -2465.280823 35228.223630 3
-<BR>     #   22 -129.590068 46.508127 -2389.067017 38695.184435 4
-<BR>     #   23 -129.592706 46.508902 -2409.290771 38915.184435 3
-<BR>     #   24 -129.575005 46.537610 -2466.533142 42382.145240 4
-<BR>     #   25 -129.577645 46.538386 -2491.371094 42602.145240 3
-<BR>     #   26 -129.595345 46.509677 -2397.609253 46069.106044 4
-<BR>     #   27 -129.597984 46.510452 -2413.315918 46289.106044 3
-<BR>     #   28 -129.580285 46.539161 -2499.048889 49756.066849 4
-<BR>     #   29 -129.582925 46.539937 -2523.030640 49976.066849 3
-<BR>     #   30 -129.600622 46.511227 -2443.481018 53443.027653 4
-<BR>     #   31 -129.603261 46.512002 -2419.008240 53663.027653 3
-<BR>     #   32 -129.585565 46.540712 -2518.522400 57129.988458 4
-<BR>     #   33 -129.588205 46.541487 -2498.521301 57349.988458 3
-<BR>     #   34 -129.605900 46.512777 -2450.386536 60816.949263 4
-<BR>     #   35 -129.608539 46.513552 -2473.623230 61036.949263 3
-<BR>     #   36 -129.590845 46.542262 -2487.422180 64503.910067 4
-<BR>     #   37 -129.593485 46.543038 -2491.040466 64723.910067 3
-<BR>     #   38 -129.611178 46.514327 -2472.610657 68190.870872 3
-<BR>     #   39 -129.606711 46.517999 -2485.114583 68723.704236 3
-<BR>     #   40 -129.557338 46.509809 -2488.398743 72619.152031 3
-<BR>     #   41 -129.550415 46.521262 -2545.285828 73998.189601 3
-<BR>     #   42 -129.600724 46.536447 -2470.920736 78209.372536 3
-<BR>     #   43 -129.606972 46.525648 -2443.988281 79501.503455 4
-<BR>     #
-<BR>     # A total of 550 mission points have been defined.
-<BR>     #
-<BR>     # Define Mission parameters:
-<BR>     #define MISSION_SPEED      1.500000
-<BR>     #define MISSION_DISTANCE   79501.503455
-<BR>     #define MISSION_TIME       57203
-<BR>     #define MISSION_TIMEOUT    60067
-<BR>     #define DEPTH_MAX          2525.307922
-<BR>     #define DEPTH_ABORT        2562.807922
-<BR>     #define ALTITUDE_DESIRED   75.000000
-<BR>     #define ALTITUDE_MIN       75.000000
-<BR>     #define ALTITUDE_ABORT     30.000000
-<BR>     #define GPS_DURATION       600
-<BR>     #define DESCENT_DEPTH      3.000000
-<BR>     #define SPIRAL_DESCENT_DEPTH      2324.917643
-<BR>     #define SPIRAL_DESCENT_ALTITUDE   50.000000
-<BR>     #define DESCEND_DURATION   300
-<BR>     #define SETPOINT_DURATION  30
-<BR>     #define GPSMINHITS         10
-<BR>     #define ASCENDRUDDER       3.000000
-<BR>     #define ASCENDPITCH        45.000000
-<BR>     #define ASCENDENDDEPTH     2.000000
-<BR>     #define DESCENDRUDDER      3.000000
-<BR>     #define DESCENDPITCH       -30.000000
-<BR>     #define MAXCROSSTRACKERROR 30
-<BR>     #define RESON_DURATION     6
-<BR>     #q
-<P>
-<A NAME="lbAI"> </A>
-<H2>SEE ALSO</H2>
-
-<B><A HREF="mbsystem.html">mbsystem</A></B>(1), <B><A HREF="mbgrdviz.html">mbgrdviz</A></B>(1)
-<P>
-<A NAME="lbAJ"> </A>
-<H2>BUGS</H2>
-
-Perhaps.
-<P>
-
-<HR>
-<A NAME="index"> </A><H2>Index</H2>
-<DL>
-<DT><A HREF="#lbAB">NAME</A><DD>
-<DT><A HREF="#lbAC">VERSION</A><DD>
-<DT><A HREF="#lbAD">SYNOPSIS</A><DD>
-<DT><A HREF="#lbAE">DESCRIPTION</A><DD>
-<DT><A HREF="#lbAF">AUTHORSHIP</A><DD>
-<DT><A HREF="#lbAG">OPTIONS</A><DD>
-<DT><A HREF="#lbAH">EXAMPLES</A><DD>
-<DT><A HREF="#lbAI">SEE ALSO</A><DD>
-<DT><A HREF="#lbAJ">BUGS</A><DD>
-</DL>
-<HR>
-</PRE>
-
-<CENTER><P><BR>
-Last Updated: 3 June 2013</P></CENTER>
-
-<HR>
-<P><A HREF="mbsystem_man_list.html">Return to list of MB-System manual pages...</A></P>
-<P><A HREF="mbsystem_home.html"><IMG SRC="mbsystem_logo_small.gif" BORDER=0 HEIGHT=55 WIDTH=158 ALIGN=BOTTOM></A><A HREF="mbsystem_home.html">Back
-to MB-System Home Page...</A></P>
-
-</BODY>
-</HTML>
diff --git a/src/html/mbsegygrid.html b/src/html/mbsegygrid.html
deleted file mode 100644
index b7ca273..0000000
--- a/src/html/mbsegygrid.html
+++ /dev/null
@@ -1,425 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<HTML VERSION="2.0">
-<HEAD>
-   <TITLE>MB-System Unix Manual Page: mbsegygrid</TITLE>
-<!-- WEBMAGIC VERSION NUMBER="2.0.2" -->
-<!-- WEBMAGIC TRANSLATION NAME="ServerRoot" SRC="/var/www/htdocs/" DST="/" -->
-<!-- WEBMAGIC TRANSLATION NAME="ProjectRoot" SRC="./" DST="" -->
-</HEAD>
-<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#336699" VLINK="#997040" ALINK="#CC9900">
-<BODY>
-<CENTER><H3><U>MB-System Unix Manual Page</U></H3></CENTER>
-<PRE>
-<H1>mbsegygrid</H1>
-Section:  MB-System 5.0  (1)<BR>Updated:  12 October 2013 <BR><A HREF="#index">Index</A>
-<HR>
-
-<A NAME="lbAB"> </A>
-<H2>NAME</H2>
-
-<B>mbsegygrid</B> - Generate time vs. trace number grids of seismic data from segy files.
-<P>
-<A NAME="lbAC"> </A>
-<H2>VERSION</H2>
-
-Version 5.0
-<P>
-<A NAME="lbAD"> </A>
-<H2>SYNOPSIS</H2>
-
-<B>mbsegygrid</B> <B>-I</B><I>segyfile</I> <B>-O</B><I>gridfile</I>
-[<B>-A</B><I>shotscale/timescale</I> <B>-B</B><I>maxvalue/window</I> <B>-D</B><I>decimatex/decimatey</I>
-<B>-G</B><I>mode/gain[/window]</I>
-<B>-S</B><I>mode[/start/end[/schan/echan]]</I> <B>-T</B><I>sweep[/delay]</I>
-<B>-W</B><I>mode/start/end</I> <B>-H -V</B>]";
-<P>
-<A NAME="lbAE"> </A>
-<H2>DESCRIPTION</H2>
-
-<B>MBsegygrid</B> generates grids of seismic data from segy files.
-The program works by inserting trace data into a grid in
-which the y-axis is some measure of trace number, range, or distance
-along a profile, and the y-axis is time. The output files are <B>GMT</B> netCDF
-format grid files.
-<P>
-By default or with use of the <B>-A</B> option, the x-dimension of
-the grid is determined by the number of traces specified
-by the <B>-S</B> option and any decimation specified with option <B>-D</B>.
-If the <B>-R</B> option is used, then the profile will represent a line between
-specified start and end positions divided into binning cells according to a specified
-cell size, and the x-dimension of the grid will be the distance along the
-line (in meters) divided by the cell size and any decimation specified with
-option <B>-D</B>.
-<P>
-The y-dimension of the grid is determined by the sample spacing, any decimation
-specified with option <B>-D</B>, and the time sweep specified by the  <B>-T</B>
-option.
-<P>
-If the <B>-S</B> option is not specified, then all of the traces in the segy file
-will be gridded. If the time sweep and delay (if any) are not specified using
-the <B>-T</B> option, then the sweep and delay will be set so that all trace samples
-are incorporated into the grid.
-<P>
-A simple time-varying gain can be applied to the traces before gridding using
-the <B>-G</B> option. The start time for the gain may be either the start
-of the trace or the seafloor arrival time.
-<P>
-Simple time-domain low-pass filtering can be applied to the traces before
-gridding using the <B>-F</B> option.
-<P>
-Regions of the grid without data are indicated in the output by NaN values.
-<P>
-<A NAME="lbAF"> </A>
-<H2>AUTHORSHIP</H2>
-
-David W. Caress (<A HREF="mailto:caress at mbari.org">caress at mbari.org</A>)
-<BR>
-
-<BR>  Monterey Bay Aquarium Research Institute
-<BR>
-
-Dale N. Chayes (<A HREF="mailto:dale at ldeo.columbia.edu">dale at ldeo.columbia.edu</A>)
-<BR>
-
-<BR>  Lamont-Doherty Earth Observatory
-<P>
-<A NAME="lbAG"> </A>
-<H2>OPTIONS</H2>
-
-<DL COMPACT>
-<DT><B>-A</B>
-
-<DD>
-<I>shotscale/timescale</I>
-<BR>
-
-This option causes the x-axis to be rescaled from shot number to distance in meters
-and the y-axis to be rescaled from time in seconds to depth in meters.
-The <I>shotscale</I> value represents the shot spacing in meters and the
-<I>timescale</I> value is the scaling from time to depth (typically 750 m/s
-for the water column).
-<DT><B>-B</B>
-
-<DD>
-<I>maxvalue[/window]</I>
-<BR>
-
-This option causes the application of automatic gain control (AGC). At each sample, a time interval
-<I>window</I> seconds long centered on the sample is considered. The sample value is multiplied
-by a scaling factor calculated as <I>maxvalue</I> divided by the maximum original value in the
-time interval. This approach can emphasize coherent arrivals regardless of amplitude level. If
-<I>window</I> is not specified, then the <I>window is taken to be the trace length in time so that
-the entire trace is normalized using the same scale factor, and all traces has the same maximum
-value of maxvalue</I>.
-<DT><B>-D</B>
-
-<DD>
-<I>decimatex/decimatey</I>
-<BR>
-
-Sets the decimation of traces (<I>decimatex</I>) and samples (<I>decimatey</I>) used in
-generating the output grid. The downsampling of the data is actually accomplished by averaging
-the values within each grid bin rather than omitting traces or samples.
-<DT><B>-F</B>
-
-<DD>
-<I>mode/window</I>
-<BR>
-
-Sets the application of low-pass filtering to the trace data. The filtering is applied
-by convolving a filter function of length <I>window</I> seconds with the trace. Currently the only
-available filter is a cosine taper, set using <I>mode</I> = 1.
-<DT><B>-G</B>
-
-<DD>
-<I>mode/gain[/window]</I>
-<BR>
-
-Sets the application of gain to the trace data. The <I>mode</I> value determines how
-the gain is applied. If <I>mode</I> = 0, no gain is applied.If <I>mode</I> = 1,
-the gain is applied starting from the beginning of the trace. If  <I>mode</I> = 2,
-the gain is applied starting at the seafloor (assuming that a seafloor pick has
-been defined in the segy data file). The <I>gain</I> value sets the gain applied
-as follows. If G = <I>gain</I> and t is the time in seconds since the start of
-gain application, then each sample is multiplied by a factor of (1 + (G * t)).
-The parameter <I>window</I>, if given, sets the length of the time interval
-in seconds that gain is applied. When the gain is windowed, trace values after
-the end of the gain window are zeroed.
-<DT><B>-H</B>
-
-<DD>
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-<DT><B>-I</B>
-
-<DD>
-<I>segyfile</I>
-<BR>
-
-Sets the filename of the input segy seismic data file to be gridded.
-<DT><B>-O</B>
-
-<DD>
-<I>gridfile</I>
-<BR>
-
-Sets the filename for the output GMT netCDF format grid.
-<DT><B>-R</B>
-
-<DD>
-<I>cellsize/startlon/endlon/startlat/endlat</I>
-<BR>
-
-If the <B>-R</B> option is used, then the profile will represent a line between
-start and end positions specified using longitude and latitude values in
-decimal degrees. This line segment is divided into binning cells according to
-<I>cellsize</I> in meters, and the x-dimension of the grid will be the distance along the
-line (in meters) divided by the cell size and any decimation specified with
-option <B>-D</B>. Effectively, the location of each trace will be projected onto the line
-segment and the segment added to the appropriate cell. Where cells have multiple traces,
-the traces will be averaged.
-<DT><B>-S</B>
-
-<DD>
-<I>mode[/start/end[/schan/echan]]</I>
-<BR>
-
-This option sets the range of traces that are gridded, and thus determines
-the x-dimension of the output grid (also impacted by any decimation
-specified with <B>-D</B>). If <I>mode</I> = 0, then <I>start</I> and <I>end</I>
-refer to shot numbers. This typically is useful for subbottom data or seismic
-data in shot gather form. If <I>mode</I> = 1, then <I>start</I> and <I>end</I>
-refer to CMP (or RP or CDP) numbers. This typically is useful for seismic
-reflection data in stacked or CMP gather forms. If the data are multichannel
-seismic reflection or seismic refraction in either shot or CMP gathers, the
-start and end of the channels selected for gridding is set using the optional <I>schan</I>
-and <I>echan</I>, respectively. The x-dimension of the output grid is determined by
-(<I>end</I> - <I>start</I> + 1) * (<I>echan</I> - <I>schan</I> + 1) / <I>decimatex</I>.
-<DT><B>-T</B>
-
-<DD>
-<I>sweep[/delay]</I>
-<BR>
-
-Sets the time range of seismic data to be gridded. The <I>sweep</I> specifies
-the number of seconds of data comprising the y-axis of the grid. The number of
-samples follows from the sample interval of the data, and any decimation
-applied using <B>-D</B>. The optional <I>delay</I> value sets the sweep
-start time, again in seconds.
-The y-dimension of the output grid is determined by
-<I>sweep</I> / sampleinterval / <I>decimatey</I>, where the sampleinterval is
-a parameter read with the seismic data.
-<DT><B>-V</B>
-
-<DD>
-Normally, <B>mbsegygrid</B> prints out information regarding its
-controlling parameters during execution; the
-<B>-V</B> option causes the program to also print out statements
-indicating its progress.
-<DT><B>-W</B>
-
-<DD>
-<I>mode/start/end</I>
-<BR>
-
-This option can be used to limit the data being gridded to a particular time
-window in various ways. This option does not impact the definition of the overall
-grid bounds, but does restrict the data gridded to samples within particular times
-of interest. If <I>mode</I> = 1, then <I>start</I> and <I>end</I> are simply start and end
-times of good data in seconds. If <I>mode</I> = 2, then <I>start</I> and <I>end</I> are relative to
-the time of the bottom return. In this case <I>start</I> is often negative so that the
-grid shows data above the seafloor, and then down into the subsurface. Finally, if <I>mode</I> = 3,
-then <I>start</I> and <I>end</I> are relative to the time corresponding to the sonar
-depth.
-<P>
-</DL>
-<A NAME="lbAH"> </A>
-<H2>EXAMPLES</H2>
-
-Suppose that we have a Reson 7k format file (format 88) called 20040722_152111.s7k
-that contains subbottom profiler data. Further suppose that we
-have used <B>mbextractsegy</B> to extract the subbottom profiler data
-into a segy format file called 20040722_152111.s7k.segy. <B>MBextractsegy</B>
-also generates a "sinf" file containing statistics about the data in the segy
-file. In this case, the contents of the sinf file 20040722_152111.s7k.segy.sinf are:
-<BR> <TT>       </TT>SEGY Data File:      20040722_152111.s7k.segy<BR>
-<P>
-<BR> <TT>       </TT>File Header Info:<BR>
-<BR> <TT>       </TT>  Channels:                          1<BR>
-<BR> <TT>       </TT>  Auxiliary Channels:                0<BR>
-<BR> <TT>       </TT>  Sample Interval (usec):           64<BR>
-<BR> <TT>       </TT>  Number of Samples in Trace:     8330<BR>
-<BR> <TT>       </TT>  Trace length (sec):         0.533120<BR>
-<BR> <TT>       </TT>  Data Format:                IEEE 32 bit integer<BR>
-<BR> <TT>       </TT>  CDP Fold:                          0<BR>
-<P>
-<BR> <TT>       </TT>Data Totals:<BR>
-<BR> <TT>       </TT>  Number of Traces:               2527<BR>
-<BR> <TT>       </TT>  Min Max Delta:<BR>
-<BR> <TT>       </TT>    Shot number:                    56     2582     2527<BR>
-<BR> <TT>       </TT>    Shot trace:                      1        1        1<BR>
-<BR> <TT>       </TT>    RP number:                      56     2582     2527<BR>
-<BR> <TT>       </TT>    RP trace:                        1        1        1<BR>
-<BR> <TT>       </TT>    Delay (sec):              0.000000 0.000000 0.000000<BR>
-<BR> <TT>       </TT>    Range (m):                0.000000 0.000000 0.000000<BR>
-<BR> <TT>       </TT>    Receiver Elevation (m):   -224.030000 -2.860000 -221.170000<BR>
-<BR> <TT>       </TT>    Source Elevation (m):     -224.030000 -2.860000 -221.170000<BR>
-<BR> <TT>       </TT>    Source Depth (m):         2.860000 224.030000 -221.170000<BR>
-<BR> <TT>       </TT>    Receiver Water Depth (m): 51.510000 487.670000 -436.160000<BR>
-<BR> <TT>       </TT>    Source Water Depth (m):   51.510000 487.670000 -436.160000<BR>
-<P>
-<BR> <TT>       </TT>Navigation Totals:<BR>
-<P>
-<BR> <TT>       </TT>  Start of Data:<BR>
-<BR> <TT>       </TT>    Time:  07 22 2004 15:20:37.029000  JD204<BR>
-<BR> <TT>       </TT>    Lon: -121.8573     Lat:   36.7755<BR>
-<P>
-<BR> <TT>       </TT>  End of Data:<BR>
-<BR> <TT>       </TT>    Time:  07 22 2004 15:44:15.438000  JD204<BR>
-<BR> <TT>       </TT>    Lon: -121.8572     Lat:   36.7952<BR>
-<P>
-<BR> <TT>       </TT>Limits:<BR>
-<BR> <TT>       </TT>  Minimum Longitude:    -121.8574   Maximum Longitude:    -121.8572<BR>
-<BR> <TT>       </TT>  Minimum Latitude:       36.7755   Maximum Latitude:       36.7952<BR>
-<P>
-In order to generate a time vs. trace number grid of all traces in the
-segy file, with a column for each trace and a row for each time sample,
-one can simply invoke <B>mbsegygrid</B> without specifying a range of
-desired traces or the desired time sweep. The program automatically sizes
-the grid to include all traces and samples, taking into account trace start
-delays if necessary. The root of the output grid filename is specified with
-the <B>-O</B> option; if "SubbottomGrid" is specified then the output
-grid will be named SubbottomGrid.grd. The command is:
-<BR> <TT>       </TT>mbsegygrid -I 20040722_152111.s7k.segy  <TT>        </TT><TT>        </TT>-O SubbottomGrid<BR>
-<BR>
-
-and the output to the terminal looks like:
-<P>
-<BR> <TT>       </TT>MBsegygrid Parameters:<BR>
-<BR> <TT>       </TT>Input segy file:         20040722_152111.s7k.segy<BR>
-<BR> <TT>       </TT>Output fileroot:         SubbottomGrid<BR>
-<BR> <TT>       </TT>Input Parameters:<BR>
-<BR> <TT>       </TT>     trace mode:         1<BR>
-<BR> <TT>       </TT>     trace start:        56<BR>
-<BR> <TT>       </TT>     trace end:          2582<BR>
-<BR> <TT>       </TT>     channel start:      1<BR>
-<BR> <TT>       </TT>     channel end:        1<BR>
-<BR> <TT>       </TT>     trace decimation:   1<BR>
-<BR> <TT>       </TT>     time sweep:         0.533120 seconds<BR>
-<BR> <TT>       </TT>     time delay:         0.000000 seconds<BR>
-<BR> <TT>       </TT>     sample interval:    0.000064 seconds<BR>
-<BR> <TT>       </TT>     sample decimation:  1<BR>
-<BR> <TT>       </TT>     window mode:        0<BR>
-<BR> <TT>       </TT>     window start:       0.000000 seconds<BR>
-<BR> <TT>       </TT>     window end:         0.000000 seconds<BR>
-<BR> <TT>       </TT>     gain mode:          0<BR>
-<BR> <TT>       </TT>     gain:               0.000000<BR>
-<BR> <TT>       </TT>Output Parameters:<BR>
-<BR> <TT>       </TT>     grid filename:      SubbottomGrid.grd<BR>
-<BR> <TT>       </TT>     x grid dimension:   2527<BR>
-<BR> <TT>       </TT>     y grid dimension:   8331<BR>
-<BR> <TT>       </TT>     grid xmin:          55.500000<BR>
-<BR> <TT>       </TT>     grid xmax:          2582.500000<BR>
-<BR> <TT>       </TT>     grid ymin:          -0.533152<BR>
-<BR> <TT>       </TT>     grid ymax:          0.000032<BR>
-<BR> <TT>       </TT>     NaN values used to flag regions with no data<BR>
-<BR> <TT>       </TT>PROCESS read:0 position:0 rp:56 channel:1 2004/204 15:20:37.029 samples:8330 interval:64 usec minmax: 0.000000 2425.784912<BR>
-<BR> <TT>       </TT>PROCESS read:25 position:25 rp:81 channel:1 2004/204 15:20:51.068 samples:8330 interval:64 usec minmax: 0.000000 3832.087402<BR>
-<BR> <TT>       </TT>PROCESS read:50 position:50 rp:106 channel:1 2004/204 15:21:05.106 samples:8330 interval:64 usec minmax: 0.000000 1590.149658<BR>
-<BR> <TT>       </TT>....................<BR>
-<BR> <TT>       </TT>PROCESS read:2475 position:2475 rp:2531 channel:1 2004/204 15:43:46.800 samples:8330 interval:64 usec minmax: 0.000000 991.466064<BR>
-<BR> <TT>       </TT>PROCESS read:2500 position:2500 rp:2556 channel:1 2004/204 15:44:00.838 samples:8330 interval:64 usec minmax: 0.000000 838.286926<BR>
-<BR> <TT>       </TT>PROCESS read:2525 position:2525 rp:2581 channel:1 2004/204 15:44:14.877 samples:8330 interval:64 usec minmax: 0.000000 985.870667<BR>
-<P>
-<BR> <TT>       </TT>--------------<BR>
-<P>
-<BR> <TT>       </TT>Plot generation shellscript <SubbottomGrid.grd.cmd> created.<BR>
-<P>
-<BR> <TT>       </TT>Instructions:<BR>
-<BR> <TT>       </TT>  Execute <SubbottomGrid.grd.cmd> to generate Postscript plot <SubbottomGrid.grd.ps>.<BR>
-<BR> <TT>       </TT>  Executing <SubbottomGrid.grd.cmd> also invokes gv to view the plot on the screen.<BR>
-<P>
-<BR> <TT>       </TT>--------------<BR>
-<P>
-The size of the the output grid can be checked using the <B>GMT</B> program
-<B>grdinfo</B>. The results of the command:
-<BR> <TT>       </TT>grdinfo SubbottomGrid.grd<BR>
-<BR>
-
-look like:
-<BR> <TT>       </TT>SubbottomGrid.grd: Title: Seismic Grid from 20040722_152111.s7k.segy<BR>
-<BR> <TT>       </TT>SubbottomGrid.grd: Command:<BR>
-<BR> <TT>       </TT>SubbottomGrid.grd: Remark:<BR>
-<BR> <TT>       </TT>        Projection: SeismicProfile<BR>
-<BR> <TT>       </TT>        Grid created by MBsegygrid<BR>
-<BR> <TT>       </TT>        MB-system Version 5.0.4<BR>
-<BR> <TT>       </TT>        Run by <caress> on <hess> at <Thu Sep 23 16:24:39 2004><BR>
-<BR> <TT>       </TT>SubbottomGrid.grd: Pixel node registration used<BR>
-<BR> <TT>       </TT>SubbottomGrid.grd: grdfile format # 0<BR>
-<BR> <TT>       </TT>SubbottomGrid.grd: x_min: 55.5 x_max: 2582.5 x_inc: 1 units: Trace Number nx: 2527<BR>
-<BR> <TT>       </TT>SubbottomGrid.grd: y_min: -0.533152 y_max: 3.2e-05 y_inc: 6.4e-05 units: Time (seconds) ny: 8331<BR>
-<BR> <TT>       </TT>SubbottomGrid.grd: z_min: 0 z_max: 2623.34 units: Trace Signal<BR>
-<BR> <TT>       </TT>SubbottomGrid.grd: scale_factor: 1 add_offset: 0<BR>
-<P>
-<B>MBsegygrid</B> also uses the macro <B>mbm_grdplot</B> to generate a shellscript
-called SubbottomGrid.grd.cmd that, when executed, will use <B>GMT</B> commands
-to generate a Postscript plot of the grid.
-<P>
-In order to generate a grid of a subset of the subbottom data (for instance,
-shots 1500 - 2000 and the time sweep from 0.25 to 0.35 seconds), use the <B>-S</B>
-and <B>-T</B> options:
-<BR> <TT>       </TT>mbsegygrid -I 20040722_152111.s7k.segy  <TT>        </TT><TT>        </TT>-O SubbottomGrid2  <TT>     </TT><TT>        </TT>-S0/1500/2000 -T0.1/0.25<BR>
-<BR>
-
-This time the <B>grdinfo</B> output looks like:
-<BR> <TT>       </TT>SubbottomGrid2.grd: Title: Seismic Grid from 20040722_152111.s7k.segy<BR>
-<BR> <TT>       </TT>SubbottomGrid2.grd: Command:<BR>
-<BR> <TT>       </TT>SubbottomGrid2.grd: Remark:<BR>
-<BR> <TT>       </TT>        Projection: SeismicProfile<BR>
-<BR> <TT>       </TT>        Grid created by MBsegygrid<BR>
-<BR> <TT>       </TT>        MB-system Version 5.0.4<BR>
-<BR> <TT>       </TT>        Run by <caress> on <hess> at <Thu Sep 23 16:40:34 2004><BR>
-<BR> <TT>       </TT>SubbottomGrid2.grd: Pixel node registration used<BR>
-<BR> <TT>       </TT>SubbottomGrid2.grd: grdfile format # 0<BR>
-<BR> <TT>       </TT>SubbottomGrid2.grd: x_min: 1499.5 x_max: 2000.5 x_inc: 1 units: Trace Number nx: 501<BR>
-<BR> <TT>       </TT>SubbottomGrid2.grd: y_min: -0.35 y_max: -0.249968 y_inc: 6.4e-05 units: Time (seconds) ny: 1563<BR>
-<BR> <TT>       </TT>SubbottomGrid2.grd: z_min: 0 z_max: 558.42 units: Trace Signal<BR>
-<BR> <TT>       </TT>SubbottomGrid2.grd: scale_factor: 1 add_offset: 0<BR>
-<P>
-<A NAME="lbAI"> </A>
-<H2>SEE ALSO</H2>
-
-<B><A HREF="mbsystem.html">mbsystem</A></B>(1), <B><A HREF="mbm_grdplot.html">mbm_grdplot</A></B>(1), <B><A HREF="mbmosaic.html">mbmosaic</A></B>(1), <B><A HREF="mbm_grid.html">mbm_grid</A></B>(1)
-<P>
-<A NAME="lbAJ"> </A>
-<H2>BUGS</H2>
-
-This tool isn't close to being complete...
-<P>
-
-<HR>
-<A NAME="index"> </A><H2>Index</H2>
-<DL>
-<DT><A HREF="#lbAB">NAME</A><DD>
-<DT><A HREF="#lbAC">VERSION</A><DD>
-<DT><A HREF="#lbAD">SYNOPSIS</A><DD>
-<DT><A HREF="#lbAE">DESCRIPTION</A><DD>
-<DT><A HREF="#lbAF">AUTHORSHIP</A><DD>
-<DT><A HREF="#lbAG">OPTIONS</A><DD>
-<DT><A HREF="#lbAH">EXAMPLES</A><DD>
-<DT><A HREF="#lbAI">SEE ALSO</A><DD>
-<DT><A HREF="#lbAJ">BUGS</A><DD>
-</DL>
-<HR>
-</PRE>
-
-<CENTER><P><BR>
-Last Updated: 12 October 2013</P></CENTER>
-
-<HR>
-<P><A HREF="mbsystem_man_list.html">Return to list of MB-System manual pages...</A></P>
-<P><A HREF="mbsystem_home.html"><IMG SRC="mbsystem_logo_small.gif" BORDER=0 HEIGHT=55 WIDTH=158 ALIGN=BOTTOM></A><A HREF="mbsystem_home.html">Back
-to MB-System Home Page...</A></P>
-
-</BODY>
-</HTML>
diff --git a/src/html/mbsegyinfo.html b/src/html/mbsegyinfo.html
deleted file mode 100644
index 4c183c0..0000000
--- a/src/html/mbsegyinfo.html
+++ /dev/null
@@ -1,199 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<HTML VERSION="2.0">
-<HEAD>
-   <TITLE>MB-System Unix Manual Page: mbsegyinfo</TITLE>
-<!-- WEBMAGIC VERSION NUMBER="2.0.2" -->
-<!-- WEBMAGIC TRANSLATION NAME="ServerRoot" SRC="/var/www/htdocs/" DST="/" -->
-<!-- WEBMAGIC TRANSLATION NAME="ProjectRoot" SRC="./" DST="" -->
-</HEAD>
-<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#336699" VLINK="#997040" ALINK="#CC9900">
-<BODY>
-<CENTER><H3><U>MB-System Unix Manual Page</U></H3></CENTER>
-<PRE>
-<H1>mbsegyinfo</H1>
-Section:  MB-System 5.0  (1)<BR>Updated:  3 June 2013 <BR><A HREF="#index">Index</A>
-<HR>
-
-<A NAME="lbAB"> </A>
-<H2>NAME</H2>
-
-<B>mbsegyinfo</B> - Output some basic statistics of segy format seismic data files.
-<P>
-<A NAME="lbAC"> </A>
-<H2>VERSION</H2>
-
-Version 5.0
-<P>
-<A NAME="lbAD"> </A>
-<H2>SYNOPSIS</H2>
-
-<B>mbsegyinfo</B> [<B>-I</B><I>filename</I> <B>-L</B><I>lonflip</I> <B>-O</B> <B>-H -V</B>]
-<P>
-<A NAME="lbAE"> </A>
-<H2>DESCRIPTION</H2>
-
-<B>MBsegyinfo</B> is a utility for reading a segy format seismic data file
-or files and outputting some basic statistics.  The table generated
-shows the filename, data counts, navigation totals, time and navigation
-of the first and last data records, minimum and maximum
-data values, and the geographic bounding box of the data.
-<P>
-An important function  of <B>mbsegyinfo</B> is to generate segy
-information, or ".sinf"
-files, that may be parsed by other <B>MB-System</B> programs
-and macros. To create an ".sinf" file, simply direct the
-output of <B>mbsegyinfo</B> to a file named by adding the
-suffix ".sinf" to the input swath data filename. The
-<B>-O</B> option accomplishes this same task
-automatically.
-<P>
-<A NAME="lbAF"> </A>
-<H2>AUTHORSHIP</H2>
-
-David W. Caress (<A HREF="mailto:caress at mbari.org">caress at mbari.org</A>)
-<BR>
-
-<BR>  Monterey Bay Aquarium Research Institute
-<BR>
-
-Dale N. Chayes (<A HREF="mailto:dale at ldeo.columbia.edu">dale at ldeo.columbia.edu</A>)
-<BR>
-
-<BR>  Lamont-Doherty Earth Observatory
-<P>
-<A NAME="lbAG"> </A>
-<H2>OPTIONS</H2>
-
-<DL COMPACT>
-<DT><B>-H</B>
-
-<DD>
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-<DT><B>-I</B>
-
-<DD>
-<I>filename</I>
-<BR>
-
-Sets the input segy seismic data filename. Default: <I>infile</I> = "stdin".
-<DT><B>-L</B>
-
-<DD>
-<I>lonflip</I>
-<BR>
-
-Sets the range of the longitude values returned.
-If <I>lonflip</I>=-1 then the longitude values will be in
-the range from -360 to 0 degrees. If <I>lonflip</I>=0
-then the longitude values will be in
-the range from -180 to 180 degrees. If <I>lonflip</I>=1
-then the longitude values will be in
-the range from 0 to 360 degrees.
-Default: <B>mbsegyinfo selects the bext longitude range based
-on the first data.
-<DT>-O</B>
-
-<DD>
-<BR>
-
-This option causes the program output to be directed to
-".sinf" files rather than to stdout. Each ".sinf" file is named
-using the original data file path with an ".sinf" suffix appended.
-<DT><B>-V</B>
-
-<DD>
-Normally, <B>mbsegyinfo</B> only prints out the statistics obtained
-by reading all of the data.  If the
-<B>-V</B> flag is given, then <B>mbsegyinfo</B> works in a "verbose" mode and
-outputs the program version being used and all read error status messages.
-<P>
-</DL>
-<A NAME="lbAH"> </A>
-<H2>EXAMPLES</H2>
-
-Suppose one wishes to know something about the contents of
-a segy subbottom profiler data file named 20040722_152111.s7k.segy.
-The following will suffice:
-<BR> <TT>       </TT>mbsegyinfo -I 20040722_152111.s7k.segy<BR>
-<BR>
-
-and returns the following output:
-<BR> <TT>       </TT>SEGY Data File:      20040722_152111.s7k.segy<BR>
-<P>
-<BR> <TT>       </TT>File Header Info:<BR>
-<BR> <TT>       </TT>  Channels:                          1<BR>
-<BR> <TT>       </TT>  Auxiliary Channels:                0<BR>
-<BR> <TT>       </TT>  Sample Interval (usec):           64<BR>
-<BR> <TT>       </TT>  Number of Samples in Trace:     8330<BR>
-<BR>          Trace length (sec):         0.533120
-<BR> <TT>       </TT>  Data Format:                IEEE 32 bit integer<BR>
-<BR> <TT>       </TT>  CDP Fold:                          0<BR>
-<P>
-<BR> <TT>       </TT>Data Totals:<BR>
-<BR> <TT>       </TT>  Number of Traces:               2527<BR>
-<BR> <TT>       </TT>  Min Max Delta:<BR>
-<BR> <TT>       </TT>    Shot number:                    56     2582     2527<BR>
-<BR> <TT>       </TT>    Shot trace:                      1        1        1<BR>
-<BR> <TT>       </TT>    RP number:                      56     2582     2527<BR>
-<BR> <TT>       </TT>    RP trace:                        1        1        1<BR>
-<BR>            Delay (sec):              0.000000 0.000000 0.000000
-<BR> <TT>       </TT>    Range (m):                0.000000 0.000000 0.000000<BR>
-<BR> <TT>       </TT>    Receiver Elevation (m):   -224.030000 -2.860000 -221.170000<BR>
-<BR> <TT>       </TT>    Source Elevation (m):     -224.030000 -2.860000 -221.170000<BR>
-<BR> <TT>       </TT>    Source Depth (m):         2.860000 224.030000 -221.170000<BR>
-<BR> <TT>       </TT>    Receiver Water Depth (m): 51.510000 487.670000 -436.160000<BR>
-<BR> <TT>       </TT>    Source Water Depth (m):   51.510000 487.670000 -436.160000<BR>
-<P>
-<BR> <TT>       </TT>Navigation Totals:<BR>
-<P>
-<BR> <TT>       </TT>  Start of Data:<BR>
-<BR> <TT>       </TT>    Time:  07 22 2004 15:20:37.029000  JD204<BR>
-<BR> <TT>       </TT>    Lon: -121.8573     Lat:   36.7755<BR>
-<P>
-<BR> <TT>       </TT>  End of Data:<BR>
-<BR> <TT>       </TT>    Time:  07 22 2004 15:44:15.438000  JD204<BR>
-<BR> <TT>       </TT>    Lon: -121.8572     Lat:   36.7952<BR>
-<P>
-<BR> <TT>       </TT>Limits:<BR>
-<BR> <TT>       </TT>  Minimum Longitude:    -121.8574   Maximum Longitude:    -121.8572<BR>
-<BR> <TT>       </TT>  Minimum Latitude:       36.7755   Maximum Latitude:       36.7952<BR>
-<P>
-<A NAME="lbAI"> </A>
-<H2>SEE ALSO</H2>
-
-<B><A HREF="mbsystem.html">mbsystem</A></B>(1), <B><A HREF="mbextractsegy.html">mbextractsegy</A></B>(1), <B><A HREF="mbsegylist.html">mbsegylist</A></B>(1), <B><A HREF="mbsegygrid.html">mbsegygrid</A></B>(1),
-<B>SIOSEIS</B>(<A HREF="http://sioseis.ucsd.edu/">http://sioseis.ucsd.edu/</A> )
-<P>
-<A NAME="lbAJ"> </A>
-<H2>BUGS</H2>
-
-Maybe. Depends on who's asking...
-<P>
-
-<HR>
-<A NAME="index"> </A><H2>Index</H2>
-<DL>
-<DT><A HREF="#lbAB">NAME</A><DD>
-<DT><A HREF="#lbAC">VERSION</A><DD>
-<DT><A HREF="#lbAD">SYNOPSIS</A><DD>
-<DT><A HREF="#lbAE">DESCRIPTION</A><DD>
-<DT><A HREF="#lbAF">AUTHORSHIP</A><DD>
-<DT><A HREF="#lbAG">OPTIONS</A><DD>
-<DT><A HREF="#lbAH">EXAMPLES</A><DD>
-<DT><A HREF="#lbAI">SEE ALSO</A><DD>
-<DT><A HREF="#lbAJ">BUGS</A><DD>
-</DL>
-<HR>
-</PRE>
-
-<CENTER><P><BR>
-Last Updated: 3 June 2013</P></CENTER>
-
-<HR>
-<P><A HREF="mbsystem_man_list.html">Return to list of MB-System manual pages...</A></P>
-<P><A HREF="mbsystem_home.html"><IMG SRC="mbsystem_logo_small.gif" BORDER=0 HEIGHT=55 WIDTH=158 ALIGN=BOTTOM></A><A HREF="mbsystem_home.html">Back
-to MB-System Home Page...</A></P>
-
-</BODY>
-</HTML>
diff --git a/src/html/mbsegylist.html b/src/html/mbsegylist.html
deleted file mode 100644
index d81224b..0000000
--- a/src/html/mbsegylist.html
+++ /dev/null
@@ -1,301 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<HTML VERSION="2.0">
-<HEAD>
-   <TITLE>MB-System Unix Manual Page: mbsegylist</TITLE>
-<!-- WEBMAGIC VERSION NUMBER="2.0.2" -->
-<!-- WEBMAGIC TRANSLATION NAME="ServerRoot" SRC="/var/www/htdocs/" DST="/" -->
-<!-- WEBMAGIC TRANSLATION NAME="ProjectRoot" SRC="./" DST="" -->
-</HEAD>
-<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#336699" VLINK="#997040" ALINK="#CC9900">
-<BODY>
-<CENTER><H3><U>MB-System Unix Manual Page</U></H3></CENTER>
-<PRE>
-<H1>mbsegylist</H1>
-Section:  MB-System 5.0  (1)<BR>Updated:  3 June 2013 <BR><A HREF="#index">Index</A>
-<HR>
-
-<A NAME="lbAB"> </A>
-<H2>NAME</H2>
-
-<B>mbsegylist</B> - List selected header values in segy format seismic data files.
-<P>
-<A NAME="lbAC"> </A>
-<H2>VERSION</H2>
-
-Version 5.0
-<P>
-<A NAME="lbAD"> </A>
-<H2>SYNOPSIS</H2>
-
-<B>mbsegylist</B> [<B>-A</B> <B>-D</B><I>decimate</I>
-<B>-H</B> <B>-G</B><I>delimeter</I> <B>-I</B><I>infilename</I>
-<B>-L</B><I>lonflip</I> <B>-O</B><I>output_format</I>
-<B>-U</B><I>check</I> <B>-V</B> <B>-Z</B><I>segment</I>]
-<P>
-<A NAME="lbAE"> </A>
-<H2>DESCRIPTION</H2>
-
-<B>MBsegylist</B> is a utility to output specified header values
-from segy seismic data files to stdout. The
-option <B>-O</B><I>output_format</I> is
-used to control the type and order of values output.
-By default, <B>mbsegylist</B>  produces ASCII files in
-spreadsheet style, with data columns separated by tabs. Alternatively,
-the output can be binary, with each field represented
-as a double precision float (<B>-A</B> option).
-<P>
-<A NAME="lbAF"> </A>
-<H2>AUTHORSHIP</H2>
-
-David W. Caress (<A HREF="mailto:caress at mbari.org">caress at mbari.org</A>)
-<BR>
-
-<BR>  Monterey Bay Aquarium Research Institute
-<BR>
-
-Dale N. Chayes (<A HREF="mailto:dale at ldeo.columbia.edu">dale at ldeo.columbia.edu</A>)
-<BR>
-
-<BR>  Lamont-Doherty Earth Observatory
-<P>
-<A NAME="lbAG"> </A>
-<H2>OPTIONS</H2>
-
-<DL COMPACT>
-<DT><B>-A</B>
-
-<DD>
-<BR>
-
-Causes the output to be binary (native double precision floating
-point) rather than ASCII. Some
-output options cannot be represented as single binary floats (e.g.
-time strings and longitude or latitude broken into degrees
-and minutes. These values are output as multiple fields as
-appropriate.
-Default: ASCII output with fields separated by tabs.
-<DT><B>-D</B>
-
-<DD>
-<I>decimate</I>
-<BR>
-
-Sets the decimation of the output data. By default (i.e. <I>decimate</I>=1),
-every available data record is output. If <I>decimate</I>>1, then only
-every "<I>decimate</I>"th record will be output. Default: <I>decimate</I>=1.
-<DT><B>-G</B>
-
-<DD>
-<I>delimiter</I>
-<BR>
-
-Sets the character(s) used to separate output fields when ascii
-columns are output. Default: tabs are used as delimiters.
-<DT><B>-H</B>
-
-<DD>
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-<DT><B>-I</B>
-
-<DD>
-<I>filename</I>
-<BR>
-
-Sets the filename of the input segy seismic data file.
-<DT><B>-L</B>
-
-<DD>
-<I>lonflip</I>
-<BR>
-
-Sets the range of the longitude values returned.
-If <I>lonflip</I>=-1 then the longitude values will be in
-the range from -360 to 0 degrees. If <I>lonflip</I>=0
-then the longitude values will be in
-the range from -180 to 180 degrees. If <I>lonflip</I>=1
-then the longitude values will be in
-the range from 0 to 360 degrees.
-Default: <I>lonflip</I> = 0.
-<DT><B>-O</B>
-
-<DD>
-<I>output_format</I>
-<BR>
-
-Determines the form of the output; <I>output_format</I> is a string composed
-of one or more of the following characters:
-<DT><DD>
-<B>/</B>
-special character: this causes the value
-indicated by the next character to be  inverted. This applies only to simple
-numeric values such as depth and
-heading and not to values like time
-strings orpositions with hemisphere
-characters.
-<DT><DD>
-<B>-</B>
-special character: this causes the value
-indicated by the next character to be
-multiplied by -1. This applies only
-to simple numeric values such as
-depth and heading and not to values
-like time strings or positions with
-hemisphere characters.
-<DT><DD>
-<B>C</B>
-for CMP (or RP or CDP) gather number of a trace
-<DT><DD>
-<B>c</B>
-for trace number within a CMP (or RP or CDP) gather
-<DT><DD>
-<B>D</B>
-for trace start delay (seconds)
-<DT><DD>
-<B>I</B>
-for sample length (seconds)
-<DT><DD>
-<B>i</B>
-for time interval since last trace (seconds)
-<DT><DD>
-<B>J</B>
-for a time string (yyyy jd hh mm ss.ssssss)
-where jd is the day of the year
-<DT><DD>
-<B>j</B>
-for a time string (yyyy jd dm ss.ssssss)
-where jd is the day of the year
-and dm is the minute of the day
-<DT><DD>
-<B>L</B>
-for trace length (seconds)
-<DT><DD>
-<B>M</B>
-for unix (epoch) time in decimal seconds since 1/1/70 00:00:00
-<DT><DD>
-<B>m</B>
-for time in decimal seconds since first record
-<DT><DD>
-<B>N</B>
-for number of samples in the trace
-<DT><DD>
-<B>n</B>
-for trace counter (starts from 0)
-<DT><DD>
-<B>R</B>  for range from source to receiver (m)
-<DT><DD>
-<B>S</B>  for shot number
-<DT><DD>
-<B>s</B>  for trace number within a shot gather
-<DT><DD>
-<B>T</B>  for a time string (yyyy/mm/dd/hh/mm/ss)
-<DT><DD>
-<B>t</B>  for a time string (yyyy mm dd hh mm ss)
-<DT><DD>
-<B>U</B>  for unix time in integer seconds since 1/1/70 00:00:00
-<DT><DD>
-<B>u</B>  for time in integer seconds since first record
-<DT><DD>
-<B>V</B>  for shot or ping interval (decimal seconds)
-<DT><DD>
-<B>X</B>  for longitude (decimal degrees)
-<DT><DD>
-<B>x</B>  for longitude (degrees + decimal minutes + E/W)
-<DT><DD>
-<B>Y</B>  for latitude (decimal degrees)
-<DT><DD>
-<B>y</B>  for latitude (degrees + decimal minutes + N/S)
-<DT><DD>
-<B>Z</B>  for source or sonar depth (positive downwards) (m)
-<DT><DD>
-<B>z</B>  for depth (positive downwards) (m)
-<BR>
-
-<P>
-Default <I>output_format</I> = <B>TiXYSsCcDINL</B>
-(time, time interval, lon, lat, shot, shot trace #, cmp, cmp trace #,
-delay, sample length, number samples, trace length)
-<DT><B>-V</B>
-
-<DD>
-Normally, <B>mbsegylist</B> works "silently" without outputting
-anything to the stderr stream.  If the
-<B>-V</B> flag is given, then <B>mbsegylist</B> works in a "verbose" mode and
-outputs the program version being used and all error status messages.
-<DT><B>-Z</B>
-
-<DD>
-<I>segment</I>
-<BR>
-
-Causes the ascii output of different input segy files
-(e.g. when a datalist is specified with the <B>-I</B> option)
-to be separated by lines with <I>segment</I>. If <I>segment</I>
-is a single character, then the output is a multiple segment
-file of the sort accepted by the <B>GMT</B> program <B>psxy</B>.
-This option only works with ascii output, and is thus disabled
-when the <B>-A</B> option is specified. The most common usage
-is <B>-Z</B>I>.
-<P>
-</DL>
-<A NAME="lbAH"> </A>
-<H2>EXAMPLES</H2>
-
-Suppose one has a subbottom profiler segy data file called
-20040722_152111.s7k.segy.
-<P>
-In order to obtain a listing of the shot number, time tag, and position
-of the traces in the file, use <B>mbsegylist</B> as follows:
-<BR> <TT>       </TT>mbsegylist -I 20040722_152111.s7k.segy -OSTXY<BR>
-<P>
-The output will be as follows:
-<P>
-<BR>    56  2004/07/22/15/20/37.029000      -121.857289       36.775508
-<BR>    57  2004/07/22/15/20/37.590000      -121.857289       36.775514
-<BR>    58  2004/07/22/15/20/38.152000      -121.857289       36.775519
-<BR>    59  2004/07/22/15/20/38.713000      -121.857289       36.775525
-<BR>    60  2004/07/22/15/20/39.275000      -121.857289       36.775531
-<BR>    61  2004/07/22/15/20/39.837000      -121.857289       36.775536
-<BR>    62  2004/07/22/15/20/40.398000      -121.857289       36.775542
-<BR>    63  2004/07/22/15/20/40.960000      -121.857289       36.775547
-<BR>    64  2004/07/22/15/20/41.521000      -121.857289       36.775553
-<BR>  <TT>      </TT>.....<BR>
-<P>
-<A NAME="lbAI"> </A>
-<H2>SEE ALSO</H2>
-
-<B><A HREF="mbsystem.html">mbsystem</A></B>(1), <B><A HREF="mbextractsegy.html">mbextractsegy</A></B>(1), <B><A HREF="mbsegyinfo.html">mbsegyinfo</A></B>(1), <B><A HREF="mbsegygrid.html">mbsegygrid</A></B>(1),
-<B>SIOSEIS</B>(<A HREF="http://sioseis.ucsd.edu/">http://sioseis.ucsd.edu/</A> )
-<P>
-<A NAME="lbAJ"> </A>
-<H2>BUGS</H2>
-
-Si. Oui. Ya. Da. Yes. Mess.
-<P>
-
-<HR>
-<A NAME="index"> </A><H2>Index</H2>
-<DL>
-<DT><A HREF="#lbAB">NAME</A><DD>
-<DT><A HREF="#lbAC">VERSION</A><DD>
-<DT><A HREF="#lbAD">SYNOPSIS</A><DD>
-<DT><A HREF="#lbAE">DESCRIPTION</A><DD>
-<DT><A HREF="#lbAF">AUTHORSHIP</A><DD>
-<DT><A HREF="#lbAG">OPTIONS</A><DD>
-<DT><A HREF="#lbAH">EXAMPLES</A><DD>
-<DT><A HREF="#lbAI">SEE ALSO</A><DD>
-<DT><A HREF="#lbAJ">BUGS</A><DD>
-</DL>
-<HR>
-</PRE>
-
-<CENTER><P><BR>
-Last Updated: 3 June 2013</P></CENTER>
-
-<HR>
-<P><A HREF="mbsystem_man_list.html">Return to list of MB-System manual pages...</A></P>
-<P><A HREF="mbsystem_home.html"><IMG SRC="mbsystem_logo_small.gif" BORDER=0 HEIGHT=55 WIDTH=158 ALIGN=BOTTOM></A><A HREF="mbsystem_home.html">Back
-to MB-System Home Page...</A></P>
-
-</BODY>
-</HTML>
diff --git a/src/html/mbsegypsd.html b/src/html/mbsegypsd.html
deleted file mode 100644
index 0298aee..0000000
--- a/src/html/mbsegypsd.html
+++ /dev/null
@@ -1,316 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<HTML VERSION="2.0">
-<HEAD>
-   <TITLE>MB-System Unix Manual Page: mbsegypsd</TITLE>
-<!-- WEBMAGIC VERSION NUMBER="2.0.2" -->
-<!-- WEBMAGIC TRANSLATION NAME="ServerRoot" SRC="/var/www/htdocs/" DST="/" -->
-<!-- WEBMAGIC TRANSLATION NAME="ProjectRoot" SRC="./" DST="" -->
-</HEAD>
-<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#336699" VLINK="#997040" ALINK="#CC9900">
-<BODY>
-<CENTER><H3><U>MB-System Unix Manual Page</U></H3></CENTER>
-<PRE>
-<H1>mbsegypsd</H1>
-Section:  MB-System 5.0  (1)<BR>Updated:  3 June 2013 <BR><A HREF="#index">Index</A>
-<HR>
-
-<A NAME="lbAB"> </A>
-<H2>NAME</H2>
-
-<B>mbsegypsd</B> - Calculates the power spectral densisty function (PSD) of each trace in a
-segy file, outputting the PSD estimates as a GMT grid file with trace number along
-the x axis and frequency along the y axis.
-<P>
-<A NAME="lbAC"> </A>
-<H2>VERSION</H2>
-
-Version 5.0
-<P>
-<A NAME="lbAD"> </A>
-<H2>SYNOPSIS</H2>
-
-<B>mbsegypsd</B> <B>-I</B><I>file</I> <B>-O</B><I>root
-[</I><B>-A</B><I>shotscale</I> <B>-D</B><I>decimatex</I> <B>-R</B>
-<B>-S</B><I>mode[/start/end[/schan/echan]]</I> <B>-T</B><I>sweep[/delay]</I>
-<B>-W</B><I>mode/start/end</I> <B>-H</B> <B>-V</B>]";
-<P>
-<A NAME="lbAE"> </A>
-<H2>DESCRIPTION</H2>
-
-<B>mbsegypsd</B> calculates the power spectral densisty function (PSD) of each
-trace in a segy file, outputting the PSD estimates as a grid with
-trace number along the x axis and frequency along the y axis.
-The output files are <B>GMT</B> netCDF format grid files.
-<P>
-The x-dimension of the grid is determined by the number of traces specified
-by the <B>-S</B> option and any decimation specified with option <B>-D</B>.
-If the <B>-S</B> option is not specified, then all of the traces in the segy file
-will be processed. If the time sweep and delay (if any) are not specified using
-the <B>-T</B> option, then the sweep and delay will be set so that all trace samples
-are incorporated into the grid.
-<P>
-The y-dimension of the grid is determined by the sample interval in the time series
-data. The frequency range runs from zero Hz to a maximum frequency given
-in Hz by 1/(2*sampleinterval), where the sampleinterval is in seconds. So,
-for instance, hydrophone data sampled at 26 kHz (26000 samples/second) will
-have a sample interval of (1/26000 = 0.00003846 seconds). In this case, the
-PSD will be calculated for frequencies ranging from 0 Hz to 13000 Hz (13 kHz).
-<P>
-For each trace, the PSD will be calculated by ensemble averaging, which means that
-the trace will be broken up into a number of segments of length <I>nfft</I> (specified
-with the <B>-N</B> option, default = 1024), a fast-Fourier-transform (FFT) will be
-calculated for each segment, and the PSD estimate will be the average of
-the FFT magnitudes over all segments. Before the FFT is calculated, each segment
-is multiplied by a Hanning (cosine) taper; the PSD estimates are normalized to
-account for the loss of signal due to the taper application.
-<P>
-The output grid can be either in linear units (Intensity/Hz) or in log-scaled dB/Hz
-calculated as 20 * log10 (raw-PSD-value). The default is the former, and the
-<B>-L</B> option causes output in the dB/Hz form.
-<P>
-A shellscript invoking <B>GMT</B> programs to plot the PSD grid is automatically
-generated.
-<P>
-<A NAME="lbAF"> </A>
-<H2>AUTHORSHIP</H2>
-
-David W. Caress (<A HREF="mailto:caress at mbari.org">caress at mbari.org</A>)
-<BR>
-
-<BR>  Monterey Bay Aquarium Research Institute
-<BR>
-
-Dale N. Chayes (<A HREF="mailto:dale at ldeo.columbia.edu">dale at ldeo.columbia.edu</A>)
-<BR>
-
-<BR>  Lamont-Doherty Earth Observatory
-<P>
-<A NAME="lbAG"> </A>
-<H2>OPTIONS</H2>
-
-<DL COMPACT>
-<DT><B>-A</B>
-
-<DD>
-<I>shotscale</I>
-<BR>
-
-This option causes the x-axis to be rescaled from shot number to distance in meters.
-The <I>shotscale</I> value represents the shot spacing in meters.
-<DT><B>-D</B>
-
-<DD>
-<I>decimatex</I>
-<BR>
-
-Sets the decimation of traces (<I>decimatex</I>) used in generating the output grid.
-<DT><B>-H</B>
-
-<DD>
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-<DT><B>-I</B>
-
-<DD>
-<I>segyfile</I>
-<BR>
-
-Sets the filename of the input segy seismic data file to be gridded.
-<DT><B>-L</B>
-
-<DD>
-<BR>
-
-Sets the PSD grid output to be in dB/Hz.
-<DT><B>-O</B>
-
-<DD>
-<I>root</I>
-<BR>
-
-Sets the filename root for the output GMT netCDF format grid.
-<DT><B>-S</B>
-
-<DD>
-<I>mode[/start/end[/schan/echan]]</I>
-<BR>
-
-This option sets the range of traces that are gridded, and thus determines
-the x-dimension of the output grid (also impacted by any decimation
-specified with <B>-D</B>). If <I>mode</I> = 0, then <I>start</I> and <I>end</I>
-refer to shot numbers. This typically is useful for subbottom data or seismic
-data in shot gather form. If <I>mode</I> = 1, then <I>start</I> and <I>end</I>
-refer to CMP (or RP or CDP) numbers. This typically is useful for seismic
-reflection data in stacked or CMP gather forms. If the data are multichannel
-seismic reflection or seismic refraction in either shot or CMP gathers, the
-start and end of the channels selected for gridding is set using the optional <I>schan</I>
-and <I>echan</I>, respectively. The x-dimension of the output grid is determined by
-(<I>end</I> - <I>start</I> + 1) * (<I>echan</I> - <I>schan</I> + 1) / <I>decimatex</I>.
-<DT><B>-T</B>
-
-<DD>
-<I>sweep[/delay]</I>
-<BR>
-
-The <I>sweep</I> value sets the time range of seismic data to be processed in seconds.
-The optional <I>delay</I> value sets the sweep start time, again in seconds.
-<DT><B>-V</B>
-
-<DD>
-Normally, <B>mbsegypsd</B> prints out information regarding its
-controlling parameters during execution; the
-<B>-V</B> option causes the program to also print out statements
-indicating its progress.
-<DT><B>-W</B>
-
-<DD>
-<I>mode/start/end</I>
-<BR>
-
-This option can be used to limit the data being processed to a particular time
-window in various ways. This option does not impact the definition of the overall
-grid bounds, but does restrict the data processed to samples within particular times
-of interest. If <I>mode</I> = 1, then <I>start</I> and <I>end</I> are simply start and end
-times of good data in seconds. If <I>mode</I> = 2, then <I>start</I> and <I>end</I> are relative to
-the time of the bottom return. In this case <I>start</I> is often negative so that the
-grid shows data above the seafloor, and then down into the subsurface. Finally, if <I>mode</I> = 3,
-then <I>start</I> and <I>end</I> are relative to the time corresponding to the sonar
-depth.
-<P>
-</DL>
-<A NAME="lbAH"> </A>
-<H2>EXAMPLES</H2>
-
-Suppose that one has a segy file of hydrophone data sampled at a
-37 microsecond interval, corresponding to a 27027 Hz sampling rate.
-Each of 1610 traces consists of 64865 samples. In order to create a
-sonogram displaying the power spectral density as a function of
-time, execute mbsegypsd as follows:
-<BR>
-
-<BR> <TT>       </TT>mbsegypsd -I 20090922_1833_V3422_S7_CH025ms.segy -N1024 -L -O testpsd -V<BR>
-<BR>
-
-Here the <B>-N</B> option sets the FFT dimension used to be 1024 samples, which
-means that the PSD estimate for each trace is the average of 64865 / 1024 = 63
-calculations. The shell output of the program is:
-<BR>
-
-<BR> <TT>       </TT>Program mbsegypsd<BR>
-<BR> <TT>       </TT>Version $Id: mbsegypsd.1 2096 2013-06-04 08:17:22Z caress $<BR>
-<BR> <TT>       </TT>MB-system Version 5.1.2beta12<BR>
-<P>
-<BR> <TT>       </TT>MBsegypsd Parameters:<BR>
-<BR> <TT>       </TT>Input segy file:         20090922_1833_V3422_S7_CH025ms.segy<BR>
-<BR> <TT>       </TT>Output fileroot:         testpsd<BR>
-<BR> <TT>       </TT>Input Parameters:<BR>
-<BR> <TT>       </TT>     trace mode:         0<BR>
-<BR> <TT>       </TT>     trace start:        0<BR>
-<BR> <TT>       </TT>     trace end:          1609<BR>
-<BR> <TT>       </TT>     channel start:      1<BR>
-<BR> <TT>       </TT>     channel end:        1<BR>
-<BR> <TT>       </TT>     trace decimation:   1<BR>
-<BR> <TT>       </TT>     time sweep:         2.399968 seconds<BR>
-<BR> <TT>       </TT>     time delay:         0.000000 seconds<BR>
-<BR> <TT>       </TT>     sample interval:    0.000037 seconds<BR>
-<BR> <TT>       </TT>     window mode:        0<BR>
-<BR> <TT>       </TT>     window start:       0.000000 seconds<BR>
-<BR> <TT>       </TT>     window end:         0.000000 seconds<BR>
-<BR> <TT>       </TT>Output Parameters:<BR>
-<BR> <TT>       </TT>     grid filename:      testpsd.grd<BR>
-<BR> <TT>       </TT>     psd filename:       testpsd_psd.txt<BR>
-<BR> <TT>       </TT>     x grid dimension:   1610<BR>
-<BR> <TT>       </TT>     y grid dimension:   513<BR>
-<BR> <TT>       </TT>     grid xmin:          -0.500000<BR>
-<BR> <TT>       </TT>     grid xmax:          1609.500000<BR>
-<BR> <TT>       </TT>     grid ymin:          -13.171066<BR>
-<BR> <TT>       </TT>     grid ymax:          13500.342448<BR>
-<BR> <TT>       </TT>     NaN values used to flag regions with no data<BR>
-<BR> <TT>       </TT>     shotscale:          1.000000<BR>
-<BR> <TT>       </TT>     frequencyscale:     1.000000<BR>
-<P>
-<BR> <TT>       </TT>PROCESS read:0 position:0 shot:0 channel:1 2009/265 18:32:59.000 samples:64864 interval:37 usec minmax: -102498.789062 -187.008667<BR>
-<BR> <TT>       </TT>PROCESS read:25 position:25 shot:25 channel:1 2009/265 18:34:14.000 samples:64864 interval:37 usec minmax: -201902.890625 9166.462891<BR>
-<BR> <TT>       </TT>PROCESS read:50 position:50 shot:50 channel:1 2009/265 18:35:29.000 samples:64864 interval:37 usec minmax: -203695.765625 28316.906250<BR>
-<BR> <TT>       </TT>PROCESS read:75 position:75 shot:75 channel:1 2009/265 18:36:44.000 samples:64864 interval:37 usec minmax: -201434.375000 24819.115234<BR>
-<BR> <TT>       </TT>PROCESS read:100 position:100 shot:100 channel:1 2009/265 18:37:59.000 samples:64864 interval:37 usec minmax: -16544.123047 37.462040<BR>
-<BR> <TT>       </TT>............................<BR>
-<BR> <TT>       </TT>PROCESS read:1500 position:1500 shot:1500 channel:1 2009/265 19:47:59.000 samples:64864 interval:37 usec minmax: -8367.179688 -876.420044<BR>
-<BR> <TT>       </TT>PROCESS read:1525 position:1525 shot:1525 channel:1 2009/265 19:49:14.000 samples:64864 interval:37 usec minmax: -9163.580078 201.037201<BR>
-<BR> <TT>       </TT>PROCESS read:1550 position:1550 shot:1550 channel:1 2009/265 19:50:29.000 samples:64864 interval:37 usec minmax: -12128.291016 -993.766357<BR>
-<BR> <TT>       </TT>PROCESS read:1575 position:1575 shot:1575 channel:1 2009/265 19:51:44.000 samples:64864 interval:37 usec minmax: -67764.585938 2457.883789<BR>
-<BR> <TT>       </TT>PROCESS read:1600 position:1600 shot:1600 channel:1 2009/265 19:52:59.000 samples:64864 interval:37 usec minmax: -190216.031250 -14304.720703<BR>
-<BR> .br
-<BR> .br
-The output PSD grid file is named testpsd.grd. A shellscript named
-testpsd.grd.cmd is also created that, when executed, will generate a plot of the
-sonogram. <B>MBsegypsd</B> also outputs an ascii file containing the average PSD for the
-entire segy file in the form of frequency PSD pairs. In this case, the average PSD file
-is named testpsd_psd.txt, and has contents like:
-<BR>
-
-<BR> <TT>       </TT>0.000000 193.762464<BR>
-<BR> <TT>       </TT>26.342132 99.114274<BR>
-<BR> <TT>       </TT>52.684263 93.781880<BR>
-<BR> <TT>       </TT>79.026395 86.775795<BR>
-<BR> <TT>       </TT>105.368526 80.297280<BR>
-<BR> <TT>       </TT>131.710658 74.908340<BR>
-<BR> <TT>       </TT>158.052790 71.366137<BR>
-<BR> <TT>       </TT>184.394921 70.319082<BR>
-<BR> <TT>       </TT>210.737053 69.840534<BR>
-<BR> <TT>       </TT>237.079184 70.794517<BR>
-<BR> <TT>       </TT>263.421316 72.002905<BR>
-<BR> <TT>       </TT>289.763448 71.979001<BR>
-<BR> <TT>       </TT>316.105579 70.637717<BR>
-<BR> <TT>       </TT>342.447711 69.652364<BR>
-<BR> <TT>       </TT>..............<BR>
-<BR> <TT>       </TT>13329.118592 -13.659568<BR>
-<BR> <TT>       </TT>13355.460724 -13.722928<BR>
-<BR> <TT>       </TT>13381.802855 -12.981740<BR>
-<BR> <TT>       </TT>13408.144987 -12.626286<BR>
-<BR> <TT>       </TT>13434.487119 -12.533222<BR>
-<BR> <TT>       </TT>13460.829250 -13.659002<BR>
-<BR> <TT>       </TT>13487.171382 -24.474310<BR>
-<BR>
-
-A shellscript named testpsd_psd.txt.cmd is created that will, when executed, generate
-a plot of the average PSD.
-<P>
-<A NAME="lbAI"> </A>
-<H2>SEE ALSO</H2>
-
-<B><A HREF="mbsystem.html">mbsystem</A></B>(1), <B><A HREF="mbm_grdplot.html">mbm_grdplot</A></B>(1), <B><A HREF="mbmosaic.html">mbmosaic</A></B>(1), <B><A HREF="mbm_grid.html">mbm_grid</A></B>(1)
-<P>
-<A NAME="lbAJ"> </A>
-<H2>BUGS</H2>
-
-Probably...
-The plots could be better...
-<P>
-
-<HR>
-<A NAME="index"> </A><H2>Index</H2>
-<DL>
-<DT><A HREF="#lbAB">NAME</A><DD>
-<DT><A HREF="#lbAC">VERSION</A><DD>
-<DT><A HREF="#lbAD">SYNOPSIS</A><DD>
-<DT><A HREF="#lbAE">DESCRIPTION</A><DD>
-<DT><A HREF="#lbAF">AUTHORSHIP</A><DD>
-<DT><A HREF="#lbAG">OPTIONS</A><DD>
-<DT><A HREF="#lbAH">EXAMPLES</A><DD>
-<DT><A HREF="#lbAI">SEE ALSO</A><DD>
-<DT><A HREF="#lbAJ">BUGS</A><DD>
-</DL>
-<HR>
-</PRE>
-
-<CENTER><P><BR>
-Last Updated: 3 June 2013</P></CENTER>
-
-<HR>
-<P><A HREF="mbsystem_man_list.html">Return to list of MB-System manual pages...</A></P>
-<P><A HREF="mbsystem_home.html"><IMG SRC="mbsystem_logo_small.gif" BORDER=0 HEIGHT=55 WIDTH=158 ALIGN=BOTTOM></A><A HREF="mbsystem_home.html">Back
-to MB-System Home Page...</A></P>
-
-</BODY>
-</HTML>
diff --git a/src/html/mbset.html b/src/html/mbset.html
deleted file mode 100644
index 2bc63a4..0000000
--- a/src/html/mbset.html
+++ /dev/null
@@ -1,1296 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<HTML VERSION="2.0">
-<HEAD>
-   <TITLE>MB-System Unix Manual Page: mbset</TITLE>
-<!-- WEBMAGIC VERSION NUMBER="2.0.2" -->
-<!-- WEBMAGIC TRANSLATION NAME="ServerRoot" SRC="/var/www/htdocs/" DST="/" -->
-<!-- WEBMAGIC TRANSLATION NAME="ProjectRoot" SRC="./" DST="" -->
-</HEAD>
-<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#336699" VLINK="#997040" ALINK="#CC9900">
-<BODY>
-<CENTER><H3><U>MB-System Unix Manual Page</U></H3></CENTER>
-<PRE>
-<H1>mbset</H1>
-Section:  MB-System 5.0  (1)<BR>Updated:  10 November 2014 <BR><A HREF="#index">Index</A>
-<HR>
-
-<A NAME="lbAB"> </A>
-<H2>NAME</H2>
-
-<B>mbset</B> - Sets values in <B>mbprocess</B> parameter files.
-<P>
-<A NAME="lbAC"> </A>
-<H2>VERSION</H2>
-
-Version 5.0
-<P>
-<A NAME="lbAD"> </A>
-<H2>SYNOPSIS</H2>
-
-<B>mbset</B> <B>-I</B><I>infile</I>
-[<B>-E -L</B> <B>-P</B><I>PARAMETER:value</I> -V -H]
-<P>
-<A NAME="lbAE"> </A>
-<H2>DESCRIPTION</H2>
-
-<B>mbset</B> is a utility for creating and
-modifying <B>mbprocess</B> parameter files.
-<P>
-The program <B>mbprocess</B>
-can perform a variety of swath data processing functions in
-a single step (producing a single output swath data file),
-including:
-<BR>     - Merge edited navigation generated by <B>mbnavedit</B>.
-<BR>     - Apply bathymetry edit flags from <B>mbedit</B>
-<BR>       and <B>mbclean</B>
-<BR>     - Recalculate bathymetry from raw travel time and
-<BR>       angle data by raytracing through water sound speed
-<BR>       models from <B>mbvelocitytool</B> or <B>mbsvplist</B>.
-<BR>     - Apply changes to roll bias, pitch bias, heading
-<BR>       bias, and draft values.
-<BR>     - Recalculate sidescan from raw backscatter samples
-<BR>       (Simrad multibeam data only).
-<BR>     - Apply tides to bathymetry.
-<BR>     - Insert metadata.
-<P>
-The actions of <B>mbprocess</B> are controlled by text
-parameter files. Each <B>mbprocess</B> parameter file
-contains single line commands that set
-processing modes and parameters. The <B>-P</B> option of
-<B>mbset</B> is used to modify a single <B>mbprocess</B> parameter
-command. This option can be invoked as many times as desired
-on the command line, allowing <B>mbset</B> to set multiple
-<B>mbprocess</B> processing parameters and modes.
-If the swath data file
-specified by the <B>-I</B><I>infile</I> option of
-<B>mbset</B> has an existing <B>mbprocess</B> parameter file,
-then that parameter file will be read and the existing
-parameter values will be modified. If no <B>mbprocess</B>
-parameter file exists, then <B>mbset</B> starts with
-default processing parameters, modifies those, and then
-generates a new parameter file.
-<P>
-If the input file specified by the <B>-I</B> option is
-a single swath data file, <B>mbset</B> will act on that
-file and it's parameter file only. If the input file is
-a datalist, then <B>mbset</B> will act on all swath files
-extracted from the datalist (and any recursively parsed
-datalist files). This function allows users to easily
-set uniform processing parameters for large numbers of
-data files. The default input file is "datalist.mb-1".
-<P>
-The processing parameter file used by <B>mbprocess</B> has
-an ".par" suffix. In addition to <B>mbset</B>,
-these files are generated or modified by
-<B>mbedit</B>, <B>mbnavedit</B>,
-<B>mbvelocitytool</B>, <B>mbnavadjust</B>, and <B>mbclean</B>.
-<P>
-The processed output swath files produced by <B>mbprocess</B>
-are named using a convention based on the data format id.
-<B>MB-System</B> data formats are specified
-using two-digit or three-digit numbers (see the <B>MBIO</B> manual page).
-If an input swath data file is named "root.mbXX", where XX is the format
-id, then the default processed output file will be "rootp.mbXX"
-(e.g. mydata.mb71 -> mydatap.mb71).
-The "p" inserted before the ".mbXX" suffix indicates the output
-file has been created by <B>mbprocess</B>.
-If the input file does not follow the *.mbXX naming convention,
-then the output filename will just consist of the input name
-with "p.mbXX" added as a suffix (e.g. mydata -> mydatap.mb71)
-<P>
-<A NAME="lbAF"> </A>
-<H2>MBPROCESS PARAMETER FILE COMMANDS</H2>
-
-<P>
-The <B>mbprocess</B> parameter file commands modified by <B>mbset</B> are:
-<P>
-<BR> GENERAL PARAMETERS:
-<BR>   EXPLICIT
-<BR>        causes mbprocess to set modes implicitely
-<BR>        - e.g. the SVPFILE command will also set
-<BR>          raytracing on even if the RAYTRACE command
-<BR>          is not given [explicit mode commands required]
-<BR>   FORMAT constant
-<BR>        sets format id [no default]
-<BR>   INFILE filename
-<BR>        sets input file path [no default]
-<BR>   OUTFILE filename
-<BR>        sets output file path [no default]
-<P>
-<BR> NAVIGATION MERGING:
-<BR>   NAVMODE boolean
-<BR>        sets navigation merging [0]
-<BR>          0: navigation merge off
-<BR>          1: navigation merge on
-<BR>   NAVFILE filename
-<BR>        sets navigation file path [no default]
-<BR>   NAVFORMAT constant
-<BR>        sets navigation file format [9]
-<BR> <TT>       </TT>see the <B>mbprocess</B> man page for<BR>
-<BR> <TT>       </TT>documentation of the supported<BR>
-<BR> <TT>       </TT>navigation formats.<BR>
-<BR>   NAVHEADING boolean
-<BR>        sets heading to be merged from navigation file
-<BR>        - note: heading merged from navigation before
-<BR>          heading correction applied
-<BR>          0: heading not changed
-<BR>          1: heading merged from navigation file
-<BR>   NAVSPEED boolean
-<BR>        sets speed to be merged from navigation file
-<BR>          0: speed not changed
-<BR>          1: speed merged from navigation file
-<BR>   NAVDRAFT boolean
-<BR>        sets draft to be merged from navigation file
-<BR>        - note: draft merged from navigation before
-<BR>          draft correction applied
-<BR>          0: draft not changed
-<BR>          1: draft merged from navigation file
-<BR>   NAVATTITUDE boolean
-<BR>        sets roll, pitch and heave to be merged from
-<BR>        navigation file
-<BR>        - note: roll, pitch, and heave merged from
-<BR>          navigation before roll bias and pitch bias
-<BR>          corrections applied
-<BR>          0: roll, pitch, and heave not changed
-<BR>          1: roll, pitch, and heave merged from
-<BR>             navigation file
-<BR>   NAVINTERP boolean
-<BR>        sets navigation interpolation algorithm [0]
-<BR>          0: linear interpolation (recommended)
-<BR>          1: spline interpolation
-<BR>   NAVTIMESHIFT constant
-<BR>        sets navigation time shift (seconds) [0.0]
-<BR>        - note: time shift added to timestamps of
-<BR>          navigation fixes read in from NAVFILE
-<BR>          prior to merging
-<P>
-<BR> NAVIGATION OFFSETS AND SHIFTS:
-<BR>   NAVSHIFT boolean
-<BR>        sets navigation offset [0]
-<BR>        - note: offsets and shifts are applied to navigation
-<BR>          values from both survey and navigation records, and
-<BR>          are applied to navigation read in from
-<BR>          NAVFILE prior to merging
-<BR>        - note: offsets and shifts are NOT applied to adjusted
-<BR>          navigation values from NAVADJFILE
-<BR>   NAVOFFSETX constant
-<BR>        sets navigation athwartship offset (meters) [0.0]
-<BR>        - note: the effective navigation shift is
-<BR>          (NAVOFFSETX - SONAROFFSETX), and the
-<BR>          navigation is corrected by subtracting
-<BR>          this effective shift.
-<BR>        - note: athwartship shift is positive to
-<BR>          starboard.
-<BR>   NAVOFFSETY constant
-<BR>        sets navigation fore-aft offset (meters) [0.0]
-<BR>        - note: the effective navigation shift is
-<BR>          (NAVOFFSETY - SONAROFFSETY), and the
-<BR>          navigation is corrected by subtracting
-<BR>          this effective shift.
-<BR>        - note: fore-aft shift is positive forward.
-<BR>   NAVOFFSETZ constant
-<BR>        sets navigation vertical offset (meters) [0.0]
-<BR>        - note: this value is not yet used for
-<BR>          anything.
-<BR>        - note: vertical shift is positive down.
-<BR>   NAVSHIFTLON constant
-<BR>        sets navigation longitude shift (degrees) [0.0]
-<BR>   NAVSHIFTLAT constant
-<BR>        sets navigation latitude shift (degrees) [0.0]
-<P>
-<BR> ADJUSTED NAVIGATION MERGING:
-<BR>   NAVADJMODE mode
-<BR>        sets navigation merging from mbnavadjust [0]
-<BR>        - can apply to longitude and latitude only
-<BR>          or longitude, latitude, and depth offset
-<BR>          0: adjusted navigation merge off
-<BR>          1: adjusted navigation merge on
-<BR>          2: adjusted navigation and depth offset merge on
-<BR>   NAVADJFILE filename
-<BR>        sets adjusted navigation file path
-<BR>        - this file supercedes navigation file for
-<BR>          lon and lat only
-<BR>        - uses mbnavadjust output
-<BR>   NAVADJINTERP boolean
-<BR>        sets adjusted navigation interpolation algorithm [0]
-<BR>          0: linear interpolation (recommended)
-<BR>          1: spline interpolation
-<P>
-<BR>  ATTITUDE MERGING:
-<BR>    ATTITUDEMODE mode
-<BR>        sets attitude (roll, pitch, and heave) merging [0]
-<BR>        - roll, pitch, and heave merged before
-<BR>          roll bias and pitch bias corrections applied
-<BR>        - attitude merging from a separate file supersedes
-<BR>          attitude merging from a navigation file
-<BR>          0: attitude merging off
-<BR>          1: attitude merging on
-<BR>    ATTITUDEFILE filename
-<BR>        sets attitude file path
-<BR>    ATTITUDEFORMAT constant
-<BR>        sets attitude file format [1]
-<BR>        - attitude files can be in one of four ASCII
-<BR>          table formats
-<BR>          1: format is <time_d roll pitch heave>
-<BR>          2: format is <yr mon day hour min sec roll pitch heave>
-<BR>          3: format is <yr jday hour min sec roll pitch heave>
-<BR>          4: format is <yr jday daymin sec roll pitch heave>
-<BR>        - time_d = decimal seconds since 1/1/1970
-<BR>        - daymin = decimal minutes start of day
-<BR>        - roll = positive starboard up, degrees
-<BR>        - pitch = positive forward up, degrees
-<BR>        - heave = positive up, meters
-<P>
-<BR>  SONARDEPTH MERGING:
-<BR>    SONARDEPTHMODE mode
-<BR>        sets sonardepth merging [0]
-<BR>        - sonardepth merged before
-<BR>          draft corrections applied
-<BR>        - sonardepth merging from a separate file supersedes
-<BR>          draft merging from a navigation file
-<BR>          0: sonardepth merging off
-<BR>          1: sonardepth merging on
-<BR>    SONARDEPTHFILE filename
-<BR>        sets sonardepth file path
-<BR>    SONARDEPTHFORMAT constant
-<BR>        sets sonardepth file format [1]
-<BR>        - sonardepth files can be in one of four ASCII
-<BR>          table formats
-<BR>          1: format is <time_d sonardepth>
-<BR>          2: format is <yr mon day hour min sec sonardepth>
-<BR>          3: format is <yr jday hour min sec sonardepth>
-<BR>          4: format is <yr jday daymin sec sonardepth>
-<BR>        - time_d = decimal seconds since 1/1/1970
-<BR>        - daymin = decimal minutes start of day
-<BR>        - sonardepth = sonar depth positive down, meters
-<P>
-<BR> DATA CUTTING:
-<BR>   DATACUTCLEAR
-<BR>        removes all existing data cutting commands
-<BR>   DATACUT kind mode min max
-<BR>        adds new data cutting command, where:
-<BR>          kind = 0 : cut applied to bathymetry data
-<BR>          kind = 1 : cut applied to amplitude data
-<BR>          kind = 2 : cut applied to sidescan data
-<BR>          mode = 0 : min and max indicate start and end
-<BR>                     beam/pixel numbers between which data
-<BR>                     are flagged or zeroed
-<BR>          mode = 1 : min and max indicate start and end
-<BR>                     acrosstrack distance (m) between which
-<BR>                     data are flagged or zeroed
-<BR>   BATHCUTNUMBER min max
-<BR>        adds new bathymetry data cutting command where
-<BR>        min and max are the start and end beam numbers
-<BR>        between which data are flagged (note that
-<BR>        flagging bathymetry also flags amplitude data)
-<BR>   BATHCUTDISTANCE min max
-<BR>        adds new bathymetry data cutting command where
-<BR>        min and max are the start and end acrosstrack
-<BR>        distance (m) between which data are flagged
-<BR>        (note that flagging bathymetry also flags
-<BR>        amplitude data)
-<BR>   BATHCUTSPEED min max
-<BR>        adds new bathymetry data cutting command where
-<BR>        all beams are flagged for pings with a ship
-<BR>        or vehicle speed less than min or greater than
-<BR>        max (note that flagging bathymetry also flags
-<BR>        amplitude data)
-<BR>   AMPCUTNUMBER min max
-<BR>        adds new amplitude data cutting command where
-<BR>        min and max are the start and end beam numbers
-<BR>        between which amplitude data are zeroed (note
-<BR>        that zeroing amplitude data has no impact on
-<BR>        bathymetry data)
-<BR>   AMPCUTDISTANCE min max
-<BR>        adds new amplitude data cutting command where
-<BR>        min and max are the start and end acrosstrack
-<BR>        distance (m) between which amplitude data are
-<BR>        zeroed (note that zeroing amplitude data has
-<BR>        no impact on bathymetry data)
-<BR>   AMPCUTSPEED min max
-<BR>        adds new amplitude data cutting command where
-<BR>        all amplitude values are zeroed for pings with
-<BR>        a ship or vehicle speed less than min or greater
-<BR>        than max (note that zeroing amplitude data has
-<BR>        no impact on bathymetry data)
-<BR>   SSCUTNUMBER min max
-<BR>        adds new sidescan data cutting command where
-<BR>        min and max are the start and end pixel numbers
-<BR>        between which sidescan data are zeroed  (note
-<BR>        that zeroing sidescan data has no impact on
-<BR>        bathymetry data)
-<BR>   SSCUTDISTANCE min max
-<BR>        adds new sidescan data cutting command where
-<BR>        min and max are the start and end acrosstrack
-<BR>        distance (m) between which sidescan data are
-<BR>        zeroed  (note that zeroing sidescan data has
-<BR>        no impact on bathymetry data)
-<BR>   SSCUTSPEED min max
-<BR>        adds new sidescan data cutting command where
-<BR>        all sidescan values are zeroed for pings with
-<BR>        a ship or vehicle speed less than min or greater
-<BR>        than max (note that zeroing sidescan data has
-<BR>        no impact on bathymetry data)
-<P>
-<BR> BATHYMETRY EDITING:
-<BR>   EDITSAVEMODE boolean
-<BR>        turns on reading edit save file (from mbedit) [0]
-<BR>   EDITSAVEFILE filename
-<BR>        sets edit save file path (from mbedit) [none]
-<P>
-<BR> BATHYMETRY RECALCULATION:
-<BR>   SVPMODE mode
-<BR>        sets usage of a water sound speed model (sound
-<BR>        velocity profile, or SVP) [0]
-<BR>         0: bathymetry recalculation by raytracing off
-<BR>         1: bathymetry recalculation by raytracing on
-<BR>         2: translate depths from corrected to uncorrected
-<BR>            or vice versa depending on SOUNDSPEEDREF
-<BR>            command
-<BR>   SVPFILE filename
-<BR>        sets SVP file path [no default]
-<BR>   SSVMODE boolean
-<BR>        sets surface sound velocity (SSV) mode [0]
-<BR>         0: use SSV from file
-<BR>         1: offset SSV from file (set by SSV command)
-<BR>         2: use constant SSV (set by SSV command)
-<BR>   SSV constant/offset
-<BR>        sets SSV value or offset (m/s) [1500.0]
-<BR>   ANGLEMODE mode
-<BR>        sets handling of beam angles during
-<BR>        raytracing [1]
-<BR>         0: angles not changed before raytracing
-<BR>         1: angles adjusted using Snell's Law for
-<BR>            the difference between the surface sound
-<BR>            velocity (SSV) and the sound speed at
-<BR>            the sonar depth in the SVP.
-<BR>         2: angles adjusted using Snell's Law and
-<BR>            the sonar array geometry for the
-<BR>            difference between the surface sound
-<BR>            velocity (SSV) and the sound speed at
-<BR>            the sonar depth in the SVP.
-<BR>   TTMULTIPLY multiplier
-<BR>        sets value multiplied by travel times [1.0]
-<BR>   SOUNDSPEEDREF boolean
-<BR>        determines the handling of the sound
-<BR>        speed reference for bathymetry [1]
-<BR>        - note: if raytracing is turned off then
-<BR>          this command implies correcting or
-<BR>          uncorrecting using the SVP specified
-<BR>          with the SVPFILE command
-<BR>         0: produce "uncorrected" bathymetry
-<BR>            referenced to a uniform 1500 m/s
-<BR>            water sound speed model.
-<BR>         1: produce "corrected" bathymetry
-<BR>            referenced to a realistic water
-<BR>            sound speed model.
-<P>
-<BR> STATIC BEAM BATHYMETRY OFFSETS:
-<BR>   STATICMODE mode
-<BR>        sets offsetting of bathymetry by
-<BR>        per-beam statics [0]
-<BR>          0: static correction off
-<BR>          1: static correction by beam number
-<BR>          2: static correction by acrosstrack beam angle
-<BR>   STATICFILE filename
-<BR>        sets static per-beam file path [no default]
-<BR>        - static files are two-column ascii tables
-<BR>        - if correction is by beam number then
-<BR>          the beam # is in column 1 and
-<BR>          the depth offset is in m in column 2
-<BR>        - if correction is by beam angle then
-<BR>          the beam angle (starboard positive)
-<BR>          is in column 1 and
-<BR>          the depth offset is in m in column 2
-<P>
-<BR> DRAFT CORRECTION:
-<BR>   DRAFTMODE mode
-<BR>        sets draft correction [0]
-<BR>        - note: draft merged from navigation before
-<BR>          draft correction applied
-<BR>          0: no draft correction
-<BR>          1: draft correction by offset
-<BR>          2: draft correction by multiply
-<BR>          3: draft correction by offset and multiply
-<BR>          4: draft set to constant
-<BR>   DRAFT constant
-<BR>        sets draft value (m) [0.0]
-<BR>   DRAFTOFFSET offset
-<BR>        sets value added to draft (m) [0.0]
-<BR>   DRAFTMULTIPLY multiplier
-<BR>        sets value multiplied by draft [1.0]
-<P>
-<BR> HEAVE CORRECTION:
-<BR>   HEAVEMODE mode
-<BR>        sets heave correction [0]
-<BR>        - note: heave correction by offset and/or
-<BR>          multiplication is added to any lever
-<BR>          heave correction, and then either used in
-<BR>          bathymetry recalculation or added to
-<BR>          existing bathymetry
-<BR>          0: no heave correction
-<BR>          1: heave correction by offset
-<BR>          2: heave correction by multiply
-<BR>          3: heave correction by offset and multiply
-<BR>   HEAVEOFFSET offset
-<BR>        sets value added to heave (m)
-<BR>   HEAVEMULTIPLY multiplier
-<BR>        sets value multiplied by heave
-<P>
-<BR> LEVER CORRECTION:
-<BR>   LEVERMODE mode
-<BR>        sets heave correction by lever calculation [0]
-<BR>        - note: lever heave correction is added to
-<BR>          any heave correction by offset and/or
-<BR>          multiplication, and then either used in
-<BR>          bathymetry recalculation or added to
-<BR>          existing bathymetry
-<BR>          0: no lever calculation
-<BR>          1: heave correction by lever calculation
-<BR>   VRUOFFSETX constant
-<BR>        sets athwartships offset of attitude sensor (m)
-<BR>        - note: positive to starboard
-<BR>   VRUOFFSETY constant
-<BR>        sets fore-aft offset of attitude sensor (m)
-<BR>        - note: positive forward
-<BR>   VRUOFFSETZ constant
-<BR>        sets vertical offset of attitude sensor (m)
-<BR>        - note: positive down
-<BR>   SONAROFFSETX constant
-<BR>        sets athwartships offset of sonar receive array (m)
-<BR>        - note: positive to starboard
-<BR>   SONAROFFSETY constant
-<BR>        sets fore-aft offset of sonar receive array (m)
-<BR>        - note: positive forward
-<BR>   SONAROFFSETZ constant
-<BR>        sets vertical offset of sonar receive array (m)
-<BR>        - note: positive down
-<P>
-<BR> ROLL CORRECTION:
-<BR>   ROLLBIASMODE mode
-<BR>        sets roll correction [0]
-<BR>          0: no roll correction
-<BR>          1: roll correction by single roll bias
-<BR>          2: roll correction by separate port and
-<BR>             starboard roll bias
-<BR>   ROLLBIAS offset
-<BR>        sets roll bias (degrees)
-<BR>   ROLLBIASPORT offset
-<BR>        sets port roll bias (degrees)
-<BR>   ROLLBIASSTBD offset
-<BR>        sets starboard roll bias (degrees)
-<P>
-<BR> PITCH CORRECTION:
-<BR>   PITCHBIASMODE mode
-<BR>        sets pitch correction [0]
-<BR>          0: no pitch correction
-<BR>          1: pitch correction by pitch bias
-<BR>   PITCHBIAS offset
-<BR>        sets pitch bias (degrees)
-<P>
-<BR> HEADING CORRECTION:
-<BR>   HEADINGMODE mode
-<BR>        sets heading correction [no heading correction]
-<BR>        - note: heading merged from navigation before
-<BR>          heading correction applied
-<BR>          0: no heading correction
-<BR>          1: heading correction using course
-<BR>             made good
-<BR>          2: heading correction by offset
-<BR>          3: heading correction using course
-<BR>             made good and offset
-<BR>   HEADINGOFFSET offset
-<BR>        sets value added to heading (degrees)
-<P>
-<BR> TIDE CORRECTION:
-<BR>   TIDEMODE mode
-<BR>        sets tide correction [0]
-<BR>        - note: tide added to bathymetry after
-<BR>          all other calculations and corrections
-<BR>          0: tide correction off
-<BR>          1: tide correction on
-<BR>   TIDEFILE filename
-<BR>        sets tide file path
-<BR>   TIDEFORMAT constan
-<BR>        sets tide file format [1]
-<BR>        - tide files can be in one of four ASCII
-<BR>          table formats
-<BR>          1: format is <time_d tide>
-<BR>          2: format is <yr mon day hour min sec tide>
-<BR>          3: format is <yr jday hour min sec tide>
-<BR>          4: format is <yr jday daymin sec tide>
-<BR>        - time_d = decimal seconds since 1/1/1970
-<BR>        - daymin = decimal minutes start of day
-<P>
-<BR> AMPLITUDE CORRECTION:
-<BR>   AMPCORRMODE  boolean
-<BR>        sets correction of amplitude for
-<BR>        amplitude vs grazing angle function
-<BR>          0: amplitude correction off
-<BR>          1: amplitude correction on
-<BR>   AMPCORRFILE filename
-<BR>        sets amplitude correction file path
-<BR>        [no default]
-<BR>   AMPCORRTYPE mode
-<BR>        sets sidescan correction type [0]
-<BR>          0: correction by subtraction (dB scale)
-<BR>          1: correction by division (linear scale)
-<BR>   AMPCORRSYMMETRY boolean
-<BR>        forces correction function to be symmetric [1]
-<BR>   AMPCORRANGLE constant
-<BR>        sets amplitude correction reference angle
-<BR>        (deg) [30.0]
-<BR>   AMPCORRSLOPE mode
-<BR>        sets amplitude correction slope mode [0]
-<BR>          0: local slope ignored in calculating correction
-<BR>          1: local slope used in calculating correction
-<BR>          2: topography grid used in calculating correction
-<BR>             but slope ignored
-<BR>          3: local slope from topography grid used in
-<BR>             calculating correction
-<P>
-<BR> SIDESCAN CORRECTION:
-<BR>   SSCORRMODE  boolean
-<BR>        sets correction of sidescan for
-<BR>        amplitude vs grazing angle function
-<BR>          0: sidescan correction off
-<BR>          1: sidescan correction on
-<BR>   SSCORRFILE filename
-<BR>        sets sidescan correction file path
-<BR>        [no default]
-<BR>   SSCORRTYPE mode
-<BR>        sets sidescan correction type [0]
-<BR>          0: correction by subtraction (dB scale)
-<BR>          1: correction by division (linear scale)
-<BR>   SSCORRSYMMETRY boolean
-<BR>        forces correction function to be symmetric [1]
-<BR>   SSCORRANGLE constant
-<BR>        sets sidescan correction reference angle
-<BR>        (deg) [30.0]
-<BR>   SSCORRSLOPE mode
-<BR>        sets sidescan correction slope mode [0]
-<BR>          0: local slope ignored in calculating correction
-<BR>          1: local slope used in calculating correction
-<BR>          2: topography grid used in calculating correction
-<BR>             but slope ignored
-<BR>          3: local slope from topography grid used in
-<BR>             calculating correction
-<BR>   AMPSSCORRTOPOFILE
-<BR>        Sets topography grid used for correcting amplitude
-<BR>        and sidescan
-<P>
-<BR> SIDESCAN RECALCULATION:
-<BR>   SSRECALCMODE  boolean
-<BR>        sets recalculation of sidescan for
-<BR>        Simrad multibeam data
-<BR>          0: sidescan recalculation off
-<BR>          1: sidescan recalculation on
-<BR>   SSPIXELSIZE constant
-<BR>        sets recalculated sidescan pixel size (m) [0.0]
-<BR>        - a zero value causes the pixel size to
-<BR>          be recalculated for every data record
-<BR>   SSSWATHWIDTH  constant
-<BR>        sets sidescan swath width (degrees) [0.0]
-<BR>        - a zero value causes the swath width
-<BR>          to be recalculated for every data record
-<BR>   SSINTERPOLATE  constant
-<BR>        sets sidescan interpolation distance
-<BR>        (number of pixels)
-<P>
-<BR> METADATA INSERTION:
-<BR>   METAVESSEL string
-<BR>        sets mbinfo metadata string for vessel
-<BR>   METAINSTITUTION string
-<BR>        sets mbinfo metadata string for vessel
-<BR>        operator institution or company
-<BR>   METAPLATFORM string
-<BR>        sets mbinfo metadata string for sonar
-<BR>        platform (ship or vehicle)
-<BR>   METASONAR string
-<BR>        sets mbinfo metadata string for sonar
-<BR>        model name
-<BR>   METASONARVERSION string
-<BR>        sets mbinfo metadata string for sonar
-<BR>        version (usually software version)
-<BR>   METACRUISEID string
-<BR>        sets mbinfo metadata string for institutional
-<BR>        cruise id
-<BR>   METACRUISENAME string
-<BR>        sets mbinfo metadata string for descriptive
-<BR>        cruise name
-<BR>   METAPI string
-<BR>        sets mbinfo metadata string for principal
-<BR>        investigator
-<BR>   METAPIINSTITUTION string
-<BR>        sets mbinfo metadata string for principal
-<BR>        investigator
-<BR>   METACLIENT string
-<BR>        sets mbinfo metadata string fo data owner
-<BR>        (usually PI institution)
-<BR>   METASVCORRECTED boolean
-<BR>        sets mbinfo metadata boolean for sound
-<BR>        velocity corrected depths
-<BR>   METATIDECORRECTED boolean
-<BR>        sets mbinfo metadata boolean for tide
-<BR>        corrected bathymetry
-<BR>   METABATHEDITMANUAL boolean
-<BR>        sets mbinfo metadata boolean for manually
-<BR>        edited bathymetry
-<BR>   METABATHEDITAUTO boolean
-<BR>        sets mbinfo metadata boolean for automatically
-<BR>        edited bathymetry
-<BR>   METAROLLBIAS constant
-<BR>        sets mbinfo metadata constant for roll bias
-<BR>        (degrees + to starboard)
-<BR>   METAPITCHBIAS constant
-<BR>        sets mbinfo metadata constant for pitch bias
-<BR>        (degrees + forward)
-<BR>   METAHEADINGBIAS constant
-<BR>        sets mbinfo metadata constant for heading bias
-<BR>   METADRAFT constant
-<BR>        sets mbinfo metadata constant for vessel draft (m)
-<P>
-<BR> PROCESSING KLUGES:
-<BR>   KLUGE001 boolean
-<BR>        enables correction of travel times in
-<BR>        Hydrosweep DS2 data from the R/V Maurice
-<BR>        Ewing in 2001 and 2002.
-<BR>   KLUGE002 boolean
-<BR>        enables correction of draft values in
-<BR>        Simrad data
-<BR>        - some Simrad multibeam data has had an
-<BR>          error in which the heave has bee added
-<BR>          to the sonar depth (draft for hull
-<BR>          mounted sonars)
-<BR>        - this correction subtracts the heave
-<BR>          value from the sonar depth
-<BR>   KLUGE003 boolean
-<BR>        enables correction of beam angles in
-<BR>        SeaBeam 2112 data
-<BR>        - a data sample from the SeaBeam 2112 on
-<BR>          the USCG Icebreaker Healy (collected on
-<BR>          23 July 2003) was found to have an error
-<BR>          in which the beam angles had 0.25 times
-<BR>          the roll added
-<BR>        - this correction subtracts 0.25 * roll
-<BR>          from the beam angles before the bathymetry
-<BR>          is recalculated by raytracing through a
-<BR>          water sound velocity profile
-<BR>        - the mbprocess parameter files must be
-<BR>          set to enable bathymetry recalculation
-<BR>          by raytracing in order to apply this
-<BR>          correction
-<BR>   KLUGE004 boolean
-<BR>        deletes survey data associated with duplicate
-<BR>        or reversed time tags
-<BR>        - if survey data records are encountered
-<BR>          with time tags less than or equal to the
-<BR>          last good time tag, an error is set and
-<BR>          the data record is not output to the
-<BR>          processed data file.
-<BR>   KLUGE005 boolean
-<BR>        replaces survey record timestamps with
-<BR>        timestamps of corresponding merged navigation
-<BR>        records
-<BR>        - this feature allows users to fix
-<BR>          timestamp errors using MBnavedit and
-<BR>          then insert the corrected timestamps
-<BR>          into processed data
-<BR>   KLUGE006 boolean
-<BR> <TT>       </TT>changes sonar depth / draft values without<BR>
-<BR>        changing bathymetry values
-<BR>   KLUGE007 boolean
-<BR>        processing kluge 007 (not yet defined)
-<BR>        - occasionaly odd processing problems will
-<BR>          occur that are specific to a particular
-<BR>          survey or sonar version
-<BR>        - mbprocess will allow one-time fixes to
-<BR>          be defined as "kluges" that can be turned
-<BR>          on through the parameter files.
-<P>
-<A NAME="lbAG"> </A>
-<H2>ANCILLARY DATA FILES</H2>
-
-<P>
-<B>MB-System</B> also uses a number of ancillary data files, most
-of which relate to <B>mbprocess</B> in some way. By default,
-these ancillary data files are named by adding a short suffix
-to the primary data file name (e.g. ".par", ".svp", ".esf", ".nve")
-<P>
-The common ancillary files are listed below. The example names
-given here follow from an input swath data file name of mydata.mb71.
-<P>
-The processing parameter file used by <B>mbprocess</B> has
-an ".par" suffix. These files are generated
-or modified by <B>mbset</B>, <B>mbedit</B>, <B>mbnavedit</B>,
-<B>mbvelocitytool</B>, <B>mbnavadjust</B>, and <B>mbclean</B>.
-<BR>        mydata.mb71.par
-<P>
-The most prominent ancillary files are metadata or
-"inf" files (created from the output of <B>mbinfo</B>).
-Programs such as <B>mbgrid</B> and <B>mbm_plot</B> try to check "inf"
-files to see if the corresponding data files include data within
-desired areas. The program <B>mbprocess</B> automatically generates
-an "inf" file for any processed output swath file.
-Also, the program <B>mbdatalist</B> is often used to
-create or update "inf" files for large groups of swath data files.
-<BR>        mydata.mb71.inf
-<BR>        mydata.mb71.inf
-<P>
-The "fast bath" or "fbt" files
-are generated by copying the swath bathymetry to a sparse,
-quickly read format (format 71). Programs such as <B>mbgrid</B>,
-<B>mbswath</B>, and <B>mbcontour</B> will try to read "fbt" files
-instead of the full data files whenever only bathymetry
-information are required. The program <B>mbprocess</B>
-automatically generates
-an "fbt" file for any processed output swath file.
-Also, the program <B>mbdatalist</B> is often used to
-create or update "fbt" files for large groups of swath data files.
-These files are not generated or used
-when the original swath data is already
-in a compact bathymetry-only data format.
-<BR>        mydata.mb71.fbt
-<P>
-The "fast nav" or "fnv" files
-are just ASCII lists of navigation generated using <B>mblist</B>
-with a <B>-O</B><I>tMXYHSc</I> option. Programs such as <B>mbgrid</B>,
-<B>mbswath</B>, and <B>mbcontour</B> will try to read "fnv" files
-instead of the full data files whenever only
-navigation information are required. These files are not generated or used
-when the original data is already
-in a single-beam or navigation data format.
-<BR>        mydata.mb71.fnv
-<P>
-The bathymetry edit save file generated by <B>mbedit</B> and
-<B>mbclean</B> has an ".esf" suffix.
-<BR>        mydata.mb71.esf
-<P>
-A water sound velocity profile (SVP) file generated
-by <B>mbvelocitytool</B> has an ".svp" suffix unless
-the user specifies otherwise.
-<BR>        mydata.mb71.svp
-<P>
-Water sound velocity profile (SVP) files generated
-by <B>mbsvplist</B> also use the ".svp" suffix.
-However, multiple SVP files may be
-extracted from each input swath file, so the files are
-numbered using a "_YYY.svp" suffix, where YYY increments
-from 001.
-<BR>        mydata.mb71_001.svp
-<BR>        mydata.mb71_002.svp
-<BR>        mydata.mb71_003.svp
-<P>
-Edited navigation files generated by <B>mbnavedit</B> have
-an ".nve" suffix:
-<BR>        mydata.mb71.nve
-<BR>
-
-These navigation files can be read independently using format 166.
-<P>
-Adjusted navigation files generated by <B>mbnavadjust</B>
-have an ".naY" suffix, where "Y" is a number between 0-9.
-The <B>mbnavadjust</B> package may be used multiple times
-for a survey; the adjustments are numbered sequentially from
-"0":
-<BR>        mydata.mb71.na0
-<BR>        mydata.mb71.na1
-<BR>        mydata.mb71.na2
-<BR>
-
-and so on. These navigation files can be read independently using format 166.
-<P>
-<A NAME="lbAH"> </A>
-<H2>AUTHORSHIP</H2>
-
-David W. Caress (<A HREF="mailto:caress at mbari.org">caress at mbari.org</A>)
-<BR>
-
-<BR>  Monterey Bay Aquarium Research Institute
-<BR>
-
-Dale N. Chayes (<A HREF="mailto:dale at ldeo.columbia.edu">dale at ldeo.columbia.edu</A>)
-<BR>
-
-<BR>  Lamont-Doherty Earth Observatory
-<P>
-<A NAME="lbAI"> </A>
-<H2>OPTIONS</H2>
-
-<DL COMPACT>
-<DT><B>-E</B>
-
-<DD>
-<BR>
-
-This option causes <B>mbset</B> to require all
-processing modes to be explicitly set by <B>-P</B>
-calls. Normally, <B>mbset</B> will implicitly set
-some modes based on the parameters applied. For example,
-if a user applies <B>-P</B><I>SVPFILE:best.svp</I>, <B>mbset</B>
-would normally set the bathymetry recalculation mode
-on so that the SVP file specified actually gets used.
-<DT><B>-I</B>
-
-<DD>
-<I>infile</I>
-<BR>
-
-Swath data file for which an <B>mbprocess</B> parameter file
-will be created or updated, or
-a datalist file containing a list of input swath data files
-and/or other datalist files. If <I>infile</I> is a
-datalist file, then <B>mbset</B> will attempt to
-update or create the parameter files for all swath data
-files identified by recursively reading <I>infile</I>.
-Default <I>infile</I>: datalist.mb-1
-<DT><B>-L</B>
-
-<DD>
-<BR>
-
-If given once, this option causes <B>mbset</B> to look for any edit save
-files and navigation files with expected names
-and set the <B>mbprocess</B> parameters so that these files
-are used. If multiple navigation files are available
-(reflecting use of <B>mbnavedit</B> and one or more
-uses of <B>mbnavadjust</B>), then the latest (highest numbered)
-<B>mbnavadjust</B> solution is used.
-If <B>-L</B> is given twice, <B>mbset</B> will also look
-for any SVP files with expected names
-and set the <B>mbprocess</B> parameters so that these files
-are used for recalculating bathymetry by raytracing.
-If multiple SVP files are available
-(reflecting use of <B>mbsvplist</B> and <B>mbvelocitytool</B>),
-then the file derived from <B>mbvelocitytool</B>
-is used.
-If <B>-L</B> is given three times or more, then <B>mbset</B> will
-not look for any ancillary files, but instead reset
-the paths to all output files to be "local", meaning located
-in the same directory as the input file. This special option
-allows users to fix parameter files containing full paths for
-output files (as generated by early versions of this program).
-<DT><B>-H</B>
-
-<DD>
-This "help" flag causes the program to print out a description
-of its operation and then exit immediately.
-<DT><B>-P</B>
-
-<DD>
-<I>PARAMETER:value</I>
-The <B>-P</B> option of <B>mbset</B> is used to modify a single
-<B>mbprocess</B> parameter command. Here <I>PARAMETER</I> may be
-any of the processing parameter names listed above, and <I>value</I>
-is the corresponding value to be set. This option can be invoked
-as many times as desired on the command line, allowing <B>mbset</B>
-to set multiple <B>mbprocess</B> processing parameters and modes.
-The separater between <I>PARAMETER</I> and <I>value</I> can be
-either ':' or '='. Only the first ':' or '=' acts as a separater;
-later instances of these characters are taken as part of <I>value</I>.
-<DT><B>-V</B>
-
-<DD>
-Normally, <B>mbset</B> works "silently" without outputting
-anything to the stderr stream.  If the
-<B>-V</B> flag is given, then <B>mbset</B> works in a "verbose" mode and
-outputs the program version being used and lists the processing
-parameters output to the <B>mbprocess</B> parameter file.
-<P>
-</DL>
-<A NAME="lbAJ"> </A>
-<H2>EXAMPLES</H2>
-
-Suppose the user has a Simrad EM120 data file called
-"0051_20010829_223755.mb57" that requires processing.
-<P>
-Editing the bathymetry data in this file with mbedit will generate
-an edit save file "0051_20010829_223755.mb57.esf" and
-an mbprocess parameter file "0051_20010829_223755.mb57.par".
-The contents of the parameter file are:
-<P>
-<BR> ## MB-System processing parameter file
-<BR> ## Written by mb_pr_writepar version $Id: mbset.1 2210 2014-11-10 19:53:01Z caress $
-<BR> ## MB-system Version 5.0.beta22
-<BR> ## Generated by user <caress> on cpu <menard> at <Fri Sep  6 21:27:41 2002>
-<BR> ##
-<BR> ##
-<BR> ## Forces explicit reading of parameter modes.
-<BR> EXPLICIT
-<BR> ##
-<BR> ## General Parameters:
-<BR> FORMAT 57
-<BR> INFILE /data/0051_20010829_223755.mb57
-<BR> OUTFILE /data/0051_20010829_223755p.mb57
-<BR> ##
-<BR> ## Navigation Merging:
-<BR> NAVMODE 0
-<BR> NAVFILE /data/0051_20010829_223755.mb57.nve
-<BR> NAVFORMAT 0
-<BR> NAVHEADING 0
-<BR> NAVSPEED 0
-<BR> NAVDRAFT 0
-<BR> NAVATTITUDE 0
-<BR> NAVINTERP 0
-<BR> NAVTIMESHIFT 0.000000
-<BR> ##
-<BR> ## Navigation Offsets and Shifts:
-<BR> NAVSHIFT 0
-<BR> NAVOFFSETX 0.000000
-<BR> NAVOFFSETY 0.000000
-<BR> NAVOFFSETZ 0.000000
-<BR> NAVSHIFTLON 0.000000
-<BR> NAVSHIFTLAT 0.000000
-<BR> ##
-<BR> ## Adjusted Navigation Merging:
-<BR> NAVADJMODE 0
-<BR> NAVADJFILE
-<BR> NAVADJINTERP 0
-<BR> ##
-<BR> ## Attitude Merging:
-<BR> ATTITUDEMODE 0
-<BR> ATTITUDEFILE
-<BR> ATTITUDEFORMAT 1
-<BR> ##
-<BR> ## Sonardepth Merging:
-<BR> SONARDEPTHMODE 0
-<BR> SONARDEPTHFILE
-<BR> SONARDEPTHFORMAT 1
-<BR> ##
-<BR> ## Data cutting:
-<BR> DATACUTCLEAR
-<BR> ##
-<BR> ## Bathymetry Flagging:
-<BR> EDITSAVEMODE 1
-<BR> EDITSAVEFILE /data/0051_20010829_223755.mb57.esf
-<BR> ##
-<BR> ## Bathymetry Recalculation:
-<BR> SVPMODE 0
-<BR> SVPFILE
-<BR> SSVMODE 0
-<BR> SSV 0.000000
-<BR> TTMODE 0
-<BR> TTMULTIPLY 1.000000
-<BR> ANGLEMODE 0
-<BR> SOUNDSPEEDREF 1
-<BR> ##
-<BR> ## Draft Correction:
-<BR> DRAFTMODE 0
-<BR> DRAFT 0.000000
-<BR> DRAFTOFFSET 0.000000
-<BR> DRAFTMULTIPLY 1.000000
-<BR> ##
-<BR> ## Heave Correction:
-<BR> HEAVEMODE 0
-<BR> HEAVEOFFSET 0.000000
-<BR> HEAVEMULTIPLY 1.000000
-<BR> ##
-<BR> ## Lever Correction:
-<BR> LEVERMODE 0
-<BR> VRUOFFSETX 0.000000
-<BR> VRUOFFSETY 0.000000
-<BR> VRUOFFSETZ 0.000000
-<BR> SONAROFFSETX 0.000000
-<BR> SONAROFFSETY 0.000000
-<BR> SONAROFFSETZ 0.000000
-<BR> ##
-<BR> ## Roll Correction:
-<BR> ROLLBIASMODE 0
-<BR> ROLLBIAS 0.000000
-<BR> ROLLBIASPORT 0.000000
-<BR> ROLLBIASSTBD 0.000000
-<BR> ##
-<BR> ## Pitch Correction:
-<BR> PITCHBIASMODE 0
-<BR> PITCHBIAS 0.000000
-<BR> ##
-<BR> ## Heading Correction:
-<BR> HEADINGMODE 0
-<BR> HEADINGOFFSET 0.000000
-<BR> ##
-<BR> ## Tide Correction:
-<BR> TIDEMODE 0
-<BR> TIDEFILE
-<BR> TIDEFORMAT 1
-<BR> ##
-<BR> ## Amplitude Correction:
-<BR> AMPCORRMODE 0
-<BR> AMPCORRFILE
-<BR> AMPCORRTYPE 0
-<BR> AMPCORRSYMMETRY 1
-<BR> AMPCORRANGLE 30.000000
-<BR> AMPCORRSLOPE 0
-<BR> ##
-<BR> ## Sidescan Correction:
-<BR> SSCORRMODE 0
-<BR> SSCORRFILE
-<BR> SSCORRTYPE 0
-<BR> SSCORRSYMMETRY 1
-<BR> SSCORRANGLE 30.000000
-<BR> SSCORRSLOPE 0
-<BR> ##
-<BR> ## Sidescan Recalculation:
-<BR> SSRECALCMODE 0
-<BR> SSPIXELSIZE 0.000000
-<BR> SSSWATHWIDTH 0.000000
-<BR> SSINTERPOLATE 0
-<BR> ##
-<BR> ## Metadata Insertion:
-<BR> METAVESSEL
-<BR> METAINSTITUTION
-<BR> METAPLATFORM
-<BR> METASONAR
-<BR> METASONARVERSION
-<BR> METACRUISEID
-<BR> METACRUISENAME
-<BR> METAPI
-<BR> METAPIINSTITUTION
-<BR> METACLIENT
-<BR> METASVCORRECTED -1
-<BR> METATIDECORRECTED -1
-<BR> METABATHEDITMANUAL -1
-<BR> METABATHEDITAUTO -1
-<BR> METAROLLBIAS 0.000000
-<BR> METAPITCHBIAS 0.000000
-<BR> METAHEADINGBIAS 0.000000
-<BR> METADRAFT 0.000000
-<BR> ##
-<BR> ## Processing Kluges:
-<P>
-Editing the navigation with mbnavedit will generate
-a navigation file named "0051_20010829_223755.mb57.nve"
-and will modify the parameter file. The changed lines
-in "0051_20010829_223755.mb57.par" are:
-<P>
-<BR> ## Navigation Merging:
-<BR> NAVMODE 1
-<BR> NAVFILE /data/0051_20010829_223755.mb57.nve
-<BR> NAVFORMAT 9
-<BR> NAVHEADING 1
-<BR> NAVSPEED 1
-<BR> NAVDRAFT 1
-<BR> NAVATTITUDE 1
-<P>
-At this point, running <B>mbprocess</B> on
-"0051_20010829_223755.mb57" will apply the bathymetry
-flags from <B>mbedit</B> and merge the navigation from
-<B>mbnavedit</B>, but will not modify the data in any
-other way.
-<P>
-If the user wants to recalculate the bathymetry using
-an SVP file "0051_20010829_223755.mb57.svp"
-and a roll bias correction
-of +0.5 degrees, the following will suffice:
-<P>
-<BR>        mbset -I 0051_20010829_223755.mb57                -PSVPFILE:0051_20010829_223755.mb57.svp                -PROLLBIAS:0.5                -PDRAFT:1.95       & [...]
-<P>
-The affected lines in "0051_20010829_223755.mb57.par" are:
-<P>
-<BR> ##
-<BR> ## Bathymetry Recalculation:
-<BR> SVPMODE 1
-<BR> SVPFILE 0051_20010829_223755.mb57.svp
-<BR> SSVMODE 0
-<BR> SSV 0.000000
-<BR> TTMODE 0
-<BR> TTMULTIPLY 1.000000
-<BR> ANGLEMODE 0
-<BR> SOUNDSPEEDREF 1
-<BR> ##
-<BR> ## Draft Correction:
-<BR> DRAFTMODE 4
-<BR> DRAFT 1.950000
-<BR> DRAFTOFFSET 0.000000
-<BR> DRAFTMULTIPLY 1.000000
-<BR> ##
-<BR> ## Roll Correction:
-<BR> ROLLBIASMODE 1
-<BR> ROLLBIAS 0.500000
-<BR> ROLLBIASPORT 0.000000
-<BR> ROLLBIASSTBD 0.000000
-<P>
-To process the data, run mbprocess:
-<P>
-<BR>        mbprocess -I0051_20010829_223755.mb57 -V
-<P>
-<BR> The output to the terminal is:
-<BR> Program mbprocess
-<BR> Version $Id: mbset.1 2210 2014-11-10 19:53:01Z caress $
-<BR> MB-System Version 5.0.beta07
-<P>
-<BR> Program <mbprocess>
-<BR> Version $Id: mbset.1 2210 2014-11-10 19:53:01Z caress $
-<BR> MB-system Version 5.0.beta07
-<P>
-<BR> Program Operation:
-<BR>   Input file:      0051_20010829_223755.mb57
-<BR>   Format:          57
-<BR>   Files processed only if out of date.
-<BR>   Comments embedded in output.
-<P>
-<BR> Data processed - out of date:
-<BR>  Input:  0051_20010829_223755.mb57
-<BR>  Output: 0051_20010829_223755p.mb57
-<P>
-<BR> Input and Output Files:
-<BR>   Format:                        57
-<BR>   Input file:                    0051_20010829_223755.mb57
-<BR>   Output file:                   0051_20010829_223755p.mb57
-<BR>   Comments in output: ON
-<P>
-<BR> Navigation Merging:
-<BR>   Navigation merged from navigation file.
-<BR>   Heading merged from navigation file.
-<BR>   Speed merged from navigation file.
-<BR>   Draft merged from navigation file.
-<BR>   Navigation file:               0051_20010829_223755.mb57.nve
-<BR>   Navigation algorithm:          linear interpolation
-<BR>   Navigation time shift:         0.000000
-<P>
-<BR> Navigation Offsets and Shifts:
-<BR>   Navigation positions not shifted.
-<P>
-<BR> Adjusted Navigation Merging:
-<BR>   Navigation not merged from adjusted navigation file.
-<BR>   Adjusted navigation file:
-<BR>   Adjusted navigation algorithm: linear interpolation
-<P>
-<BR> Data Cutting:
-<BR>   Data cutting disabled.
-<P>
-<BR> Bathymetry Editing:
-<BR>   Bathymetry edits applied from file.
-<BR>   Bathymetry edit file:          0051_20010829_223755.mb57.esf
-<P>
-<BR> Bathymetry Recalculation:
-<BR>   Bathymetry recalculated by raytracing.
-<BR>   SVP file:                      0051_20010829_223755.mb57.svp
-<BR>   SSV not modified.
-<BR>   SSV offset/constant:           0.000000 m/s
-<BR>   Travel time multiplier:        1.000000 m
-<P>
-<BR> Bathymetry Water Sound Speed Reference:
-<BR>   Output bathymetry reference:   CORRECTED
-<BR>   Depths recalculated as corrected
-<P>
-<BR> Draft Correction:
-<BR>   Draft set to constant.
-<BR>   Draft constant:                1.950000 m
-<BR>   Draft offset:                  0.000000 m
-<BR>   Draft multiplier:              1.000000 m
-<P>
-<BR> Heave Correction:
-<BR>   Heave not modified.
-<BR>   Heave offset:                  0.000000 m
-<BR>   Heave multiplier:              1.000000 m
-<P>
-<BR> Lever Correction:
-<BR>   Lever calculation off.
-<P>
-<BR> Tide Correction:
-<BR>   Tide calculation off.
-<P>
-<BR> Roll Correction:
-<BR>   Roll offset by bias.
-<BR>   Roll bias:                     0.500000 deg
-<BR>   Port roll bias:                0.000000 deg
-<BR>   Starboard roll bias:           0.000000 deg
-<P>
-<BR> Pitch Correction:
-<BR>   Pitch not modified.
-<BR>   Pitch bias:                    0.000000 deg
-<P>
-<BR> Heading Correction:
-<BR>   Heading not modified.
-<BR>   Heading offset:                0.000000 deg
-<P>
-<BR> Amplitude Corrections:
-<BR>   Amplitude correction off.
-<P>
-<BR> Sidescan Corrections:
-<BR>   Sidescan correction off.
-<P>
-<BR> Sidescan Recalculation:
-<BR>   Sidescan not recalculated.
-<BR>   Sidescan pixel size:           0.000000
-<BR>   Sidescan swath width:          0.000000
-<BR>   Sidescan interpolation:        0
-<P>
-<BR> Metadata Insertion:
-<BR>   Metadata vessel:
-<BR>   Metadata institution:
-<BR>   Metadata platform:
-<BR>   Metadata sonar:
-<BR>   Metadata sonarversion:
-<BR>   Metadata cruiseid:
-<BR>   Metadata cruisename:
-<BR>   Metadata pi:
-<BR>   Metadata piinstitution:
-<BR>   Metadata client:
-<BR>   Metadata svcorrected:          -1
-<BR>   Metadata tidecorrected         -1
-<BR>   Metadata batheditmanual        -1
-<BR>   Metadata batheditauto:         -1
-<BR>   Metadata rollbias:             0.000000
-<BR>   Metadata pitchbias:            0.000000
-<BR>   Metadata headingbias:          0.000000
-<BR>   Metadata draft:                0.000000
-<P>
-<BR> 236 navigation records read
-<BR> Nav start time: 2001 08 29 22:38:02.082999
-<BR> Nav end time:   2001 08 29 23:37:22.322000
-<P>
-<BR> 47 bathymetry edits read
-<P>
-<BR> 236 input data records
-<BR> 3587 input nav records
-<BR> 17 input comment records
-<BR> 6617 input other records
-<BR> 236 output data records
-<BR> 3587 output nav records
-<BR> 64 output comment records
-<BR> 6617 output other records
-<P>
-<BR> Generating inf file for 0051_20010829_223755p.mb57
-<P>
-<P>
-<A NAME="lbAK"> </A>
-<H2>SEE ALSO</H2>
-
-<B><A HREF="mbsystem.html">mbsystem</A></B>(1), <B><A HREF="mbprocess.html">mbprocess</A></B>(1),
-<B><A HREF="mbedit.html">mbedit</A></B>(1), <B><A HREF="mbnavedit.html">mbnavedit</A></B>(1), <B><A HREF="mbvelocitytool.html">mbvelocitytool</A></B>(1)
-<P>
-<A NAME="lbAL"> </A>
-<H2>BUGS</H2>
-
-Oh yeah...
-<P>
-
-<HR>
-<A NAME="index"> </A><H2>Index</H2>
-<DL>
-<DT><A HREF="#lbAB">NAME</A><DD>
-<DT><A HREF="#lbAC">VERSION</A><DD>
-<DT><A HREF="#lbAD">SYNOPSIS</A><DD>
-<DT><A HREF="#lbAE">DESCRIPTION</A><DD>
-<DT><A HREF="#lbAF">MBPROCESS PARAMETER FILE COMMANDS</A><DD>
-<DT><A HREF="#lbAG">ANCILLARY DATA FILES</A><DD>
-<DT><A HREF="#lbAH">AUTHORSHIP</A><DD>
-<DT><A HREF="#lbAI">OPTIONS</A><DD>
-<DT><A HREF="#lbAJ">EXAMPLES</A><DD>
-<DT><A HREF="#lbAK">SEE ALSO</A><DD>
-<DT><A HREF="#lbAL">BUGS</A><DD>
-</DL>
-<HR>
-</PRE>
-
-<CENTER><P><BR>
-Last Updated: 10 November 2014</P></CENTER>
-
-<HR>
-<P><A HREF="mbsystem_man_list.html">Return to list of MB-System manual pages...</A></P>
-<P><A HREF="mbsystem_home.html"><IMG SRC="mbsystem_logo_small.gif" BORDER=0 HEIGHT=55 WIDTH=158 ALIGN=BOTTOM></A><A HREF="mbsystem_home.html">Back
-to MB-System Home Page...</A></P>
-
-</BODY>
-</HTML>
diff --git a/src/html/mbstripnan.html b/src/html/mbstripnan.html
deleted file mode 100644
index c5dfeaf..0000000
--- a/src/html/mbstripnan.html
+++ /dev/null
@@ -1,125 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<HTML VERSION="2.0">
-<HEAD>
-   <TITLE>MB-System Unix Manual Page: mbstripnan</TITLE>
-<!-- WEBMAGIC VERSION NUMBER="2.0.2" -->
-<!-- WEBMAGIC TRANSLATION NAME="ServerRoot" SRC="/var/www/htdocs/" DST="/" -->
-<!-- WEBMAGIC TRANSLATION NAME="ProjectRoot" SRC="./" DST="" -->
-</HEAD>
-<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#336699" VLINK="#997040" ALINK="#CC9900">
-<BODY>
-<CENTER><H3><U>MB-System Unix Manual Page</U></H3></CENTER>
-<PRE>
-<H1>mbstripNaN</H1>
-Section:  MB-System 5.0  (1)<BR>Updated:  3 June 2013 <BR><A HREF="#index">Index</A>
-<HR>
-
-<A NAME="lbAB"> </A>
-<H2>NAME</H2>
-
-<B>mbstripNaN</B> - filter to remove NaN nodes
-<P>
-<A NAME="lbAC"> </A>
-<H2>VERSION</H2>
-
-Version 5.0
-<P>
-<A NAME="lbAD"> </A>
-<H2>SYNOPSIS</H2>
-
-<B>mbstripNaN</B>
-<P>
-<A NAME="lbAE"> </A>
-<H2>DESCRIPTION</H2>
-
-<B>mbstripNaN</B> is a utility for removing NaN nodes that are produced
-by the GMT utilities <B>grd2xyz</B> and <B>blockmean</B> with the -bo
-option.  The standard output
-of <B>mbstripNaN</B> may be fed into the standard input of <B>surface</B> with
-the -bi option.  This is used by the <B>mbm_grd2geovrml</B> utility in
-order to spline fill areas of no data so that irregular bathymetry may
-be effectively visualized using GeoVRML which has no concept of NaN.
-<P>
-Note that <B>mbstripNaN</B> works with a double precision data stream.
-<P>
-The code is simple.  Here it is:
-<P>
-<BR>  #include <<A HREF="file:/usr/include/stdio.h">stdio.h</A>>
-<BR>  #include <<A HREF="file:/usr/include/math.h">math.h</A>>
-<P>
-<BR>  /*
-<BR>   * Read double x,y,z on stdin and send to stdout all
-<BR>   * triplets but ones where z == NaN
-<BR>   */
-<BR>  main () {
-<BR> <TT>       </TT>  struct node { double lon, lat, height; };<BR>
-<BR> <TT>       </TT>  struct node n;<BR>
-<BR> <TT>       </TT>  while ( ( fread(&n, 24, 1, stdin) > 0 ) ) {<BR>
-<BR> <TT>       </TT><TT>        </TT>  if ( ! isnan(n.height) ) {<BR>
-<BR> <TT>       </TT><TT>        </TT><TT>        </TT>  fwrite(&n, 24, 1, stdout);<BR>
-<BR> <TT>       </TT><TT>        </TT>  }<BR>
-<BR> <TT>       </TT>  }<BR>
-<BR>   }
-<P>
-<P>
-<A NAME="lbAF"> </A>
-<H2>EXAMPLE</H2>
-
-<P>
-This is a command that <B>mbm_grd2geovrml</B> constructs and executes:
-<P>
-<BR>  #
-<BR>  # Convert grid to xyz format for filling in blank
-<BR>  # areas, preprocess w/blockmean, use surface to
-<BR>  # extrapolate to no data areas
-<BR>  #
-<BR>  grd2xyz -bo Samp_OregonMarginI_bath.grd | blockmean \
-<BR>    -bi -bo -V -I0.00336363636363635/0.00134545454545457 \
-<BR>    -R-125.2/-124.867/45/45.1332 | mbstripNaN | surface \
-<BR>    -bi -I0.00336363636363635/0.00134545454545457 \
-<BR>    -S0.333312 -T0.35 -GTmp_OregonMarginI_bath.grd -V \
-<BR>    -R-125.2/-124.867/45/45.1332
-<P>
-<P>
-<A NAME="lbAG"> </A>
-<H2>SEE ALSO</H2>
-
-<P>
-<B>grd2xyz</B>(1),
-<B>blockmean</B>(1),
-<B>surface</B>(1),
-<B><A HREF="mbm_grd2geovrml.html">mbm_grd2geovrml</A></B>(1)
-<P>
-<P>
-<P>
-<A NAME="lbAH"> </A>
-<H2>BUGS</H2>
-
-<P>
-How many bugs can there be in an 8 line program?
-<P>
-
-<HR>
-<A NAME="index"> </A><H2>Index</H2>
-<DL>
-<DT><A HREF="#lbAB">NAME</A><DD>
-<DT><A HREF="#lbAC">VERSION</A><DD>
-<DT><A HREF="#lbAD">SYNOPSIS</A><DD>
-<DT><A HREF="#lbAE">DESCRIPTION</A><DD>
-<DT><A HREF="#lbAF">EXAMPLE</A><DD>
-<DT><A HREF="#lbAG">SEE ALSO</A><DD>
-<DT><A HREF="#lbAH">BUGS</A><DD>
-</DL>
-<HR>
-</PRE>
-
-<CENTER><P><BR>
-Last Updated: 3 June 2013</P></CENTER>
-
-<HR>
-<P><A HREF="mbsystem_man_list.html">Return to list of MB-System manual pages...</A></P>
-<P><A HREF="mbsystem_home.html"><IMG SRC="mbsystem_logo_small.gif" BORDER=0 HEIGHT=55 WIDTH=158 ALIGN=BOTTOM></A><A HREF="mbsystem_home.html">Back
-to MB-System Home Page...</A></P>
-
-</BODY>
-</HTML>
diff --git a/src/html/mbsvplist.html b/src/html/mbsvplist.html
deleted file mode 100644
index 8ede3d2..0000000
--- a/src/html/mbsvplist.html
+++ /dev/null
@@ -1,287 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<HTML VERSION="2.0">
-<HEAD>
-   <TITLE>MB-System Unix Manual Page: mbsvplist</TITLE>
-<!-- WEBMAGIC VERSION NUMBER="2.0.2" -->
-<!-- WEBMAGIC TRANSLATION NAME="ServerRoot" SRC="/var/www/htdocs/" DST="/" -->
-<!-- WEBMAGIC TRANSLATION NAME="ProjectRoot" SRC="./" DST="" -->
-</HEAD>
-<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#336699" VLINK="#997040" ALINK="#CC9900">
-<BODY>
-<CENTER><H3><U>MB-System Unix Manual Page</U></H3></CENTER>
-<PRE>
-<H1>mbsvplist</H1>
-Section:  MB-System 5.0  (1)<BR>Updated:  17 March 2014 <BR><A HREF="#index">Index</A>
-<HR>
-
-<A NAME="lbAB"> </A>
-<H2>NAME</H2>
-
-<B>mbsvplist</B> - List water sound velocity profiles in swath sonar data files.
-<P>
-<A NAME="lbAC"> </A>
-<H2>VERSION</H2>
-
-Version 5.0
-<P>
-<A NAME="lbAD"> </A>
-<H2>SYNOPSIS</H2>
-
-<B>mbsvplist</B> [<B>-C -D -F</B><I>format </I><B>-H -I</B><I>file </I><B>-M</B><I>mode</I> <B>-O -P -S -V -Z</B>]
-<P>
-<A NAME="lbAE"> </A>
-<H2>DESCRIPTION</H2>
-
-This program, <B>mbsvplist</B>, lists all water
-sound velocity profiles (SVPs) within swath data files.
-Swath bathymetry is calculated from raw angles and travel
-times by raytracing through a model of the speed of sound
-in water. Many swath data formats allow SVPs to be
-embedded in the data, and often the SVPs used to
-calculate the data will be included.
-By default, all unique SVPs encountered are
-listed to stdout. The SVPs may instead be
-written to individual files with names FILE_XXX.svp,
-where FILE is the swath data filename and XXX is the
-SVP count within the file. The SVP files output by <B>mbsvplist</B>
-include a header line starting with "## MB-SVP" and including the
-timestamp and location of the SVP record as inferred from its
-location in the file. This header record is recognized by the program
-<B>mbsvpselect</B> which uses the information to select the best
-SVP models to apply to swath data files for bathymetry recalculation.
-Some files contain SVPs at
-regular intervals, typically with the same SVP duplicated
-many times. By default, <B>mbsvplist</B> ignores duplicate
-SVPs. The <B>-D</B> option causes duplicate SVPs to be output.
-The <B>-P</B> option
-implies <B>-O</B>, and also causes the parameter file to be modified
-so that the first SVP output for each file becomes the
-SVP used for recalculating bathymetry for that swath file.
-The <B>-C</B> option causes <B>mbsvplist</B> to output the number
-of unique SVPs in a file to the shell (standard out).
-The <B>-S</B> option causes <B>mbsvplist</B> to output the sound velocity values
-used for beamforming by the sonar (often called surface sound velocity, or SSV)
-instead of SVP profiles. Each SSV value will be paired with the
-corresponding sonar depth, and there will generally be one SSV value output
-for each survey ping.
-<P>
-<A NAME="lbAF"> </A>
-<H2>AUTHORSHIP</H2>
-
-David W. Caress (<A HREF="mailto:caress at mbari.org">caress at mbari.org</A>)
-<BR>
-
-<BR>  Monterey Bay Aquarium Research Institute
-<BR>
-
-Dale N. Chayes (<A HREF="mailto:dale at ldeo.columbia.edu">dale at ldeo.columbia.edu</A>)
-<BR>
-
-<BR>  Lamont-Doherty Earth Observatory
-<BR>
-
-<P>
-<A NAME="lbAG"> </A>
-<H2>OPTIONS</H2>
-
-<DL COMPACT>
-<DT><B>-C</B>
-
-<DD>
-<BR>
-
-Causes <B>mbsvplist</B> to output the number of unique SVPs in each file to the shell (standard out).
-<DT><B>-D</B>
-
-<DD>
-<BR>
-
-Causes <B>mbsvplist</B> to output duplicate SVPs. This is equivalent to <B>-M</B><I>2</I>.
-<DT><B>-F</B>
-
-<DD>
-<I>format</I>
-<BR>
-
-Sets the format for the input swath sonar data using
-<B>MBIO</B> integer format identifiers.
-If <I>format</I> < 0, then the input
-file specified with the <B>-I</B>
-option will actually contain
-a list of input swath sonar data files.
-This program uses the <B>MBIO</B> library and will read any swath sonar
-format supported by <B>MBIO</B>. A list of the swath sonar data formats
-currently supported by <B>MBIO</B> and their identifier values
-is given in the <B>MBIO</B> manual page.
-<DT><B>-H</B>
-
-<DD>
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-<DT><B>-I</B>
-
-<DD>
-<I>file</I>
-<BR>
-
-Sets the input filename. If <I>format</I> > 0 (set with the
-<B>-F</B> option) then the swath sonar data contained in <I>file</I>
-is read and processed. If <I>format</I> < 0, then <I>file</I>
-is assumed to be an ascii file containing a list of the input swath sonar
-data files to be processed and their formats.  The program will read
-the data in each one of these files.
-In the <I>file</I> file, each
-data file should be followed by a data format identifier, e.g.:
-<BR> <TT>       </TT>datafile1 11<BR>
-<BR> <TT>       </TT>datafile2 24<BR>
-<BR>
-
-This program uses the <B>MBIO</B> library and will read or write any swath sonar
-format supported by <B>MBIO</B>. A list of the swath sonar data formats
-currently supported by <B>MBIO</B> and their identifier values
-is given in the <B>MBIO</B> manual page. Default: <I>file</I> = "datalist.mb-1".
-<DT><B>-M</B>
-
-<DD>
-<I>mode</I>
-<BR>
-
-Sets the SVP output mode. If <I>mode</I>=0 (the default), then the first SVP of
-each file will be output, plus any SVP that is different from the previous SVP.
-If <I>mode</I>=1, then only the first instance of each unique SVP will be output, even
-through multiple files referenced through a datalist structure. If <I>mode</I>=2,
-then all SVPs will be output even if they are duplicates (equivalent to the <B>-D</B> option).
-<DT><B>-O</B>
-
-<DD>
-<BR>
-
-By default, <B>mbsvplist</B> writes the SVP records to
-stdout. This option causes the program to instead write
-the SVPs to individual files with names FILE_XXX.svp,
-where FILE is the source swath data filename and XXX is the
-SVP count within the file.
-<DT><B>-P</B>
-
-<DD>
-<BR>
-
-This option implies the output option <B>-O</B>. Additionally,
-this option sets the first SVP output for each swathfile to be used for
-recalculating the bathymetry in that swathfile by <B>mbprocess</B>
-by modifying the associated parameter file.
-<DT><B>-S</B>
-
-<DD>
-<BR>
-
-This option causes <B>mbsvplist</B> to output the sound velocity values
-used for beamforming by the sonar (often called surface sound velocity, or SSV)
-instead of SVP profiles. Each SSV value will be paired with the
-corresponding sonar depth, and in general one depth-SSV pair will be output
-for each survey ping.
-<DT><B>-V</B>
-
-<DD>
-Normally, <B>mbsvplist</B> works "silently" without outputting
-anything to the stderr stream.  If the
-<B>-V</B> flag is given, then <B>mblist</B> works in a "verbose" mode and
-outputs the program version being used and all error status messages.
-<DT><B>-Z</B>
-
-<DD>
-Normally, <B>mbsvplist</B> faithfully outputs the SVP data just
-as it is stored in the swath files. Rarely, sonars may store SVP
-data with a nonzero depth for the first sound speed value, a
-circumstance that causes problems with bathymetry recalculation
-using <B>mbprocess</B>. The <B>-Z</B> option causes <B>mbsvplist</B>
-to replace the first depth value with zero before outputting the
-SVP.
-<P>
-</DL>
-<A NAME="lbAH"> </A>
-<H2>EXAMPLES</H2>
-
-Suppose one wishes to obtain an SVP list from a Simrad EM300 data file
-in the MBARI format (MBIO id 57) called mbari_1998_107_msn.mb57. To
-obtain a listing to stdout, the following will suffice:
-<P>
-<BR> <TT>       </TT>mbsvplist -F57 -I mbari_1998_526_msn.mb57 -V<BR>
-<P>
-The output will be as follows:
-<P>
-<BR> Program mbsvplist
-<BR> Version $Id: mbsvplist.1 2173 2014-03-18 01:13:37Z caress $
-<BR> MB-system Version 5.0
-<P>
-<BR> Searching mbari_1998_526_msn.mb57 for SVP records
-<BR> Outputting SVP to file:
-<BR> ## Water Sound Velocity Profile (SVP)
-<BR> ## Output by Program mbsvplist
-<BR> ## Program Version $Id: mbsvplist.1 2173 2014-03-18 01:13:37Z caress $
-<BR> ## MB-System Version 5.0.alpha01
-<BR> ## Run by user <caress> on cpu <menard> at <Thu Jan  4 13:36:44 2001>
-<BR> ## Swath File: mbari_1998_526_msn.mb57
-<BR> ## Start Time: 1998/05/02 01:33:08.300000
-<BR> ## SVP Count: 1
-<BR> ## Number of SVP Points: 15
-<BR>     0.00        1503.50
-<BR>     9.99        1502.70
-<BR>    19.98        1501.80
-<BR>    30.00        1501.40
-<BR>    39.99        1501.40
-<BR>    49.98        1499.90
-<BR>    60.00        1499.80
-<BR>    69.99        1497.50
-<BR>    79.98        1496.90
-<BR>    90.00        1496.90
-<BR>    99.99        1495.10
-<BR>   198.99        1486.60
-<BR>   498.99        1480.60
-<BR>  1000.98        1481.90
-<BR>  1830.00        1488.70
-<BR> ##
-<BR> ##
-<BR> 4 SVP records read
-<BR> 1 SVP records written
-<P>
-Total 4 SVP records read
-Total 1 SVP records written
-<P>
-<A NAME="lbAI"> </A>
-<H2>SEE ALSO</H2>
-
-<B><A HREF="mbsystem.html">mbsystem</A></B>(1), <B><A HREF="mbprocess.html">mbprocess</A></B>(1), <B><A HREF="mbsvpselect.html">mbsvpselect</A></B>(1)
-<P>
-<A NAME="lbAJ"> </A>
-<H2>BUGS</H2>
-
-Probably.
-<P>
-
-<HR>
-<A NAME="index"> </A><H2>Index</H2>
-<DL>
-<DT><A HREF="#lbAB">NAME</A><DD>
-<DT><A HREF="#lbAC">VERSION</A><DD>
-<DT><A HREF="#lbAD">SYNOPSIS</A><DD>
-<DT><A HREF="#lbAE">DESCRIPTION</A><DD>
-<DT><A HREF="#lbAF">AUTHORSHIP</A><DD>
-<DT><A HREF="#lbAG">OPTIONS</A><DD>
-<DT><A HREF="#lbAH">EXAMPLES</A><DD>
-<DT><A HREF="#lbAI">SEE ALSO</A><DD>
-<DT><A HREF="#lbAJ">BUGS</A><DD>
-</DL>
-<HR>
-</PRE>
-
-<CENTER><P><BR>
-Last Updated: 17 March 2014</P></CENTER>
-
-<HR>
-<P><A HREF="mbsystem_man_list.html">Return to list of MB-System manual pages...</A></P>
-<P><A HREF="mbsystem_home.html"><IMG SRC="mbsystem_logo_small.gif" BORDER=0 HEIGHT=55 WIDTH=158 ALIGN=BOTTOM></A><A HREF="mbsystem_home.html">Back
-to MB-System Home Page...</A></P>
-
-</BODY>
-</HTML>
diff --git a/src/html/mbsvpselect.html b/src/html/mbsvpselect.html
deleted file mode 100644
index a719614..0000000
--- a/src/html/mbsvpselect.html
+++ /dev/null
@@ -1,336 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<HTML VERSION="2.0">
-<HEAD>
-   <TITLE>MB-System Unix Manual Page: mbsvpselect</TITLE>
-<!-- WEBMAGIC VERSION NUMBER="2.0.2" -->
-<!-- WEBMAGIC TRANSLATION NAME="ServerRoot" SRC="/var/www/htdocs/" DST="/" -->
-<!-- WEBMAGIC TRANSLATION NAME="ProjectRoot" SRC="./" DST="" -->
-</HEAD>
-<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#336699" VLINK="#997040" ALINK="#CC9900">
-<BODY>
-<CENTER><H3><U>MB-System Unix Manual Page</U></H3></CENTER>
-<PRE>
-<H1>mbsvpselect</H1>
-Section:  MB-System 5.0  (1)<BR>Updated:  13 March 2014 <BR><A HREF="#index">Index</A>
-<HR>
-
-<A NAME="lbAB"> </A>
-<H2>NAME</H2>
-
-<B>mbsvpselect</B> - Mbsvpselect chooses and implements the best
-available sound speed model for each swath file in a survey
-<P>
-<A NAME="lbAC"> </A>
-<H2>VERSION</H2>
-
-Version 5.0
-<P>
-<A NAME="lbAD"> </A>
-<H2>SYNOPSIS</H2>
-
-mbsvpselect -N -V -Idatalist -Ssvplist -Pmode[/criteria[/submode]]
-<P>
-[-P0, -P1, -P2/period, -P3/range, -P3/range/1]
-<B>mbsvpselect</B> [<B>-C -D -F</B><I>format </I><B>-H -I</B><I>file </I><B>-M</B><I>mode</I> <B>-O -P -S -V -Z</B>]
-<P>
-<A NAME="lbAE"> </A>
-<H2>DESCRIPTION</H2>
-
-Mbsvpselect chooses and implements the best available sound speed model
-for each swath file in a survey. The user provides a list of the
-available sound speed models and specifies the criteria used for
-model selection. The program uses mbset to turn on bathymetry
-recalculation by raytracing through the sound speed model selected
-for each swath file.
-<P>
-Description:
-<P>
-The tool aims to help users to automatically apply the sound velocity
-correction to the survey files. since most surveys involve several SVPs,
-the seletion of the appropriate SVP for each survey profile is still
-missing in MB-System.
-<P>
-After finding the appropriate svp for each profile based on the choosed
-method, the results are copied to a txt file that shows each survey
-profile with the corresponding SVP. the tool also calls mbset automatically
-so no need to assign SVP to the data. it is done automatically.
-<P>
-There are 5 methods for choosing the appropriate SVP for each survey
-profile. These methods are:
-<P>
-1. Nearest SVP in position: the middle position of each survey profile
-<BR>   is calculated and the geodesics (shortest distance on the ellipsoid)
-<BR>   to all SVPs are calcualted. and the SVP with the shortest distance is
-<BR>   chosen. when the middle position of the survey profile is calculated
-<BR>   there is an option to check for 0 lat 0 long wrong values. if it is
-<BR>   found at the starting the geodesic will be calculated to the end of
-<BR>   the profile.
-<P>
-2. Nearest in time: the time interveal between the starting time of
-<BR>   the profile and the time of the SVP, and the SVP with  the shortest
-<BR>   interval will be chosen.
-<P>
-3. Nearest in position within time: a default time radius from the
-<BR>   profile is set as 10 hours, and within this period the nearest SVP
-<BR>   in position is chosen. if none of the SVPs are within this period the
-<BR>   nearest in position will be taken despit of the period threshold. The
-<BR>   period threshold can be set by the user.
-<P>
-4. Nearest in time within range: similar to the previous option but
-<BR>   this time a default range of 10000 meters is set and within this range
-<BR>   the svp nearest in time is chosen. also this 10000 meter value could
-<BR>   be set by the user.
-<P>
-5. Nearest in season within range: similar to the previous option the
-<BR>   selected SVP could be chosen based on the month only not on the year.
-<BR>   it means within the specified range the user could chose either the svp
-<BR>   nearest in time or the svp nearest in month (this could be interpreted
-<BR>   as the svp that falls in the same seasonal period despite of the year
-<BR>   when it was taken).
-<P>
-Mbsvpselect reads the .inf file of each swath file referenced in a recursive
-datalist structure to determine the location and collection time of the
-relevant data. The ancilliary *.inf, *.fbt, and *.fnv files must be created
-first. The water sound speed models (called SVPs by convention as an acronym
-for Sound Velocity Profiles) to be used must include one of three supported
-file headers specifying the time and location of the model.
-<P>
-University of Bremen SVP headers:
-<BR>  MB-SVP 2011/01/08 19:30:00 -52.965437  -36.986314
-<BR>  (keyword yyyy/mm/dd hh:mm:ss latitude longitude)
-<P>
-MB-System SVPs as now output by mbsvplist:
-<BR>  #MB-SVP 2011/01/08 19:30:00 -36.986314 -52.965437
-<BR>  (keyword yyyy/mm/dd hh:mm:ss longitude latitude)
-<P>
-CARIS sound velocity header format:
-<BR>  Section 2013-150 23:22:18 -57:02:01 -26:02:18
-<BR>  (keyword yyyy-yearDay  hh:mm:ss latitude (degree:min:sec) longitude (degree:min:sec))
-<P>
-Mbsvpselect supports SVP files with single models or files with multiple models where
-new headers occur between models.
-<P>
-Instructions:
-<P>
-1) Set up a survey (or surveys) for MB-System processing in the usual way,
-<BR>   including creating a datalist file referencing the swath data of interest
-<BR>   and generating the ancilliary *.inf, *.fbt, and *.fnv files for each of
-<BR>   the swath files.
-2) Create an svplist file (analagous to a datalist, but referencing the
-<BR>   relevant SVP files). Each SVP file is expected to be a text file with
-<BR>   depth-sound speed pairs on each line (depth in meters, sound speed in
-<BR>   meters/second) excepting for a header line at the start of each discrete
-<BR>   model. Any of the header formats listed above will work.
-<BR>   that refers to a local svp datalist. the local datalists includes
-3) In order to turn on bathymetry recalculation by raytracing through the
-<BR>   most appropriate sound speed model for each swath file, call mbsvpselect:
-<P>
-<BR>     mbsvpselect -N -V -Idatalist -Ssvplist [-P0, -P1, -P2/period, -P3/range, -P3/range/1]
-<P>
-<BR>   -N is the option to check 0 latitude 0 longitude in the survey lines.
-<BR>   -V verbosity.
-<BR>   -I input datalist
-<BR>   -S input svp datalist
-<BR>   -P the method for choosing the svp where:
-<BR>       -P or -P0                 is the nearest in position
-<BR>       -P1                       is the nearest in time
-<BR>       -P2                       is nearest in position within time (default time period is 10 hours)
-<BR>       -P2/time                  is nearest in position within specified time period (in hours)
-<BR>       -P3                       is nearest in time within range   (default range is 10000 meters)
-<BR>       -P3/range or -P3/range/0  is nearest in time within specified range (in meters)
-<BR>       -P3/range/1                     is nearest in month (seasonal) within specified range in meter.
-<P>
-<A NAME="lbAF"> </A>
-<H2>AUTHORSHIP</H2>
-
-Ammar Aljuhe (<A HREF="mailto:ammaraljuhne at gmail.com">ammaraljuhne at gmail.com</A>)
-<BR>
-
-<BR>  MARUM, University of Bremen
-<BR>
-
-Christian do Santos Ferreira (<A HREF="mailto:cferreira at marum.de">cferreira at marum.de</A>)
-<BR>
-
-<BR>  MARUM, University of Bremen
-<BR>
-
-<P>
-<A NAME="lbAG"> </A>
-<H2>OPTIONS</H2>
-
-<DL COMPACT>
-<DT><B>-H</B>
-
-<DD>
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-<DT><B>-I</B>
-
-<DD>
-<I>datalist</I>
-<BR>
-
-Sets the input datalist file, where <I>datalist</I>
-is an ascii file containing a list of the input swath sonar
-data files to be processed and their formats.  The program will read
-the data in each one of these files.
-In the <I>file</I> file, each
-data file should be followed by a data format identifier, e.g.:
-<BR> <TT>       </TT>datafile1 11<BR>
-<BR> <TT>       </TT>datafile2 24<BR>
-<BR>
-
-This program uses the <B>MBIO</B> library and will operate on any swath sonar
-format supported by <B>MBIO</B>. A list of the swath sonar data formats
-currently supported by <B>MBIO</B> and their identifier values
-is given in the <B>MBIO</B> manual page. Default: <I>file</I> = "datalist.mb-1".
-<DT><B>-N</B>
-
-<DD>
-<BR>
-
-Causes the program to check for SVPs with zero longitude and latitude values.
-<DT><B>-P</B>
-
-<DD>
-<BR>
-
-This option sets the criteria by which <B>mbsvpselect</B> selects the
-sound speed model to be used for each swath file.
-<BR>  -P or -P0             nearest in position
-<BR>  -P1                   nearest in time
-<BR>  -P2                   nearest in position within time 
-<BR>  -P2/time              nearest in position within specified time period
-<BR>  -P3<TT>   </TT><TT>        </TT><TT>        </TT>nearest in time within range   <BR>
-<BR>  -P3/range  <TT>   </TT><TT>        </TT>nearest in time within specified range<BR>
-<BR>  -P3/range/0  <TT> </TT><TT>        </TT>nearest in time within specified range<BR>
-<BR>  -P3/range/1           nearest in month (seasonal) within specified range
-<BR>
-
-The times are specified in hours and the ranges in meters. 
-The default time period is 10 hours and the default range is 10000 meters.
-<DT><B>-S</B>
-
-<DD>
-<I>svplist</I>
-<BR>
-
-Sets the input svplist file, where <I>svplist</I>
-is an ascii file containing a list of the input sound speed model
-or SVP files.  The program will read
-the location and time stamp information for all of the models
-in each one of these files.
-In the <I>svplist</I> file, each
-SVP file should be on a separate line, e.g.:
-<BR> <TT>       </TT>svpfile1<BR>
-<BR> <TT>       </TT>svpfile2<BR>
-<BR>
-
-Default: <I>file</I> = "svplist.mb-1".
-<DT><B>-V</B>
-
-<DD>
-Normally, <B>mbsvpselect</B> works "silently" without outputting
-anything to the stderr stream.  If the
-<B>-V</B> flag is given, then <B>mblist</B> works in a "verbose" mode and
-outputs the program version being used and all error status messages.
-<P>
-</DL>
-<A NAME="lbAH"> </A>
-<H2>EXAMPLES</H2>
-
-Suppose you are working in a directory called Survey_1 containing
-swath files that need to have the bathymetry recalculated by
-raytracing through water sound speed models. The local datalist
-file might contain something like:
-<BR>     13349457_3934_2845.mb88 88
-<BR>     13645323_3433_5543.mb88 88
-<BR>     46372536_6563_4637.mb88 88
-<BR>     64362825_6344_2635.mb88 88
-<P>
-or, if you use absolute passwords, something like:
-<P>
-<BR>     /MyMac/User/Survey_1/13349457_3934_2845.mb88 88
-<BR>     /MyMac/User/Survey_1/13645323_3433_5543.mb88 88
-<BR>     /MyMac/User/Survey_1/46372536_6563_4637.mb88 88
-<BR>     /MyMac/User/Survey_1/64362825_6344_2635.mb88 88
-<P>
-By convention, this datalist will be named something
-like datalist.mb-1, where the ".mb-1" suffix indicates to
-MB-System programs that this is a datalist file. As
-documented elsewhere, datalist files can contain entries
-that reference datalists rather than single files; thus
-datalists can be recursive.
-<P>
-Suppose that the water properties were variable during this
-survey, with the variability dominated by location.Further suppose 
-that there are three SVP files in a separate directory with
-names such as svp1.svp, svp2.svp, and svp3.svp. Each of these files
-contains a single model derived from CTD casts at a particular
-place and time indicated in the single header line. In that directory
-one can create an svplist file named SVP_list.mb-1 with contents:
-<BR>     svp1.svp
-<BR>     svp2.svp
-<BR>     svp3.svp
-Since mbsvpselect allows svplists to be recursive (like datalists),
-one can create a second svplist named my_svplist.mb-1in the survey 
-processing directory that references the first with an entry like:
-<P>
-<BR>     /MyMac/User/Survey_1/SVP_folder/SVP_list.mb-1 -1
-<P>
-In order to turn on bathymetry recalculation for all of the
-swath files referenced by datalist.mb-1 using the most appropriate
-of the available sound speed models, run mbsvpselect with arguments
-like:
-<P>
-<BR>     mbsvpselect -N -V -I datalist.mb-1 -S my_svplist.mb-1 -P2/50
-<P>
-Here the -P2/50 option specifies that the sound speed model to be
-used for each file will be the closest one collected within 50 hours
-of the swath data. The bathymetry recalculation will be turned on
-using an mbset call of the form:
-<P>
-<BR>     mbset -Idatalist.mb-1 -PSVPFILE:/MyMac/User/Survey_1/SVP_folder/svp1.svp
-<P>
-Following the mbsvpselect usage, mbprocess must be run to actually
-reprocess the swath data, including bathymetry recalculation by
-raytracing.
-<P>
-<A NAME="lbAI"> </A>
-<H2>SEE ALSO</H2>
-
-<B><A HREF="mbsystem.html">mbsystem</A></B>(1), <B><A HREF="mbprocess.html">mbprocess</A></B>(1), <B><A HREF="mbset.html">mbset</A></B>(1), <B><A HREF="mbsvplist.html">mbsvplist</A></B>(1)
-<P>
-<A NAME="lbAJ"> </A>
-<H2>BUGS</H2>
-
-The bugs are special because they are from Egypt, Germany, and Brazil.
-<P>
-
-<HR>
-<A NAME="index"> </A><H2>Index</H2>
-<DL>
-<DT><A HREF="#lbAB">NAME</A><DD>
-<DT><A HREF="#lbAC">VERSION</A><DD>
-<DT><A HREF="#lbAD">SYNOPSIS</A><DD>
-<DT><A HREF="#lbAE">DESCRIPTION</A><DD>
-<DT><A HREF="#lbAF">AUTHORSHIP</A><DD>
-<DT><A HREF="#lbAG">OPTIONS</A><DD>
-<DT><A HREF="#lbAH">EXAMPLES</A><DD>
-<DT><A HREF="#lbAI">SEE ALSO</A><DD>
-<DT><A HREF="#lbAJ">BUGS</A><DD>
-</DL>
-<HR>
-</PRE>
-
-<CENTER><P><BR>
-Last Updated: 13 March 2014</P></CENTER>
-
-<HR>
-<P><A HREF="mbsystem_man_list.html">Return to list of MB-System manual pages...</A></P>
-<P><A HREF="mbsystem_home.html"><IMG SRC="mbsystem_logo_small.gif" BORDER=0 HEIGHT=55 WIDTH=158 ALIGN=BOTTOM></A><A HREF="mbsystem_home.html">Back
-to MB-System Home Page...</A></P>
-
-</BODY>
-</HTML>
diff --git a/src/html/mbswath.html b/src/html/mbswath.html
deleted file mode 100644
index 63ed8cf..0000000
--- a/src/html/mbswath.html
+++ /dev/null
@@ -1,629 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<HTML VERSION="2.0">
-<HEAD>
-   <TITLE>MB-System Unix Manual Page: mbswath</TITLE>
-<!-- WEBMAGIC VERSION NUMBER="2.0.2" -->
-<!-- WEBMAGIC TRANSLATION NAME="ServerRoot" SRC="/var/www/htdocs/" DST="/" -->
-<!-- WEBMAGIC TRANSLATION NAME="ProjectRoot" SRC="./" DST="" -->
-</HEAD>
-<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#336699" VLINK="#997040" ALINK="#CC9900">
-<BODY>
-<CENTER><H3><U>MB-System Unix Manual Page</U></H3></CENTER>
-<PRE>
-<H1>mbswath</H1>
-Section:  MB-System 5.0  (1)<BR>Updated:  5 February 2015 <BR><A HREF="#index">Index</A>
-<HR>
-
-<A NAME="lbAB"> </A>
-<H2>NAME</H2>
-
-<B>mbswath</B> - <B>GMT</B> plug-in module for color fill or color shaded relief
-swath plots of swath sonar data using Postscript.
-<P>
-<A NAME="lbAC"> </A>
-<H2>VERSION</H2>
-
-Version 5.0
-<P>
-<A NAME="lbAD"> </A>
-<H2>SYNOPSIS</H2>
-
-<B>gmt mbswath</B> <B>-C</B><I>cptfile</I> <B>-J</B><I>parameters</I>
-<B>-R</B><I>west/east/south/north</I> [<B>-A</B><I>factor/mode/depth</I>
-<B>-B</B><I>tickinfo</I> <B>-b</B><I>yr/mo/da/hr/mn/sc</I>
-<B>-c</B><I>copies</I> <B>-D</B><I>mode/scale/min/max</I>
-<B>-E</B><I>yr/mo/da/hr/mn/sc</I>
-<B>-f</B><I>format</I> <B>-F</B><I>red/green/blue</I>
-<B>-G</B><I>magnitude/azimuth</I> <B>-I</B><I>datalist</I> <B>-K</B>
-<B>-N</B><I>cptfile</I> <B>-O</B> <B>-P</B> <B>-p</B><I>pings </I><B>-Q</B><I>dpi</I> <B>-S</B><I>speed</I>
-<B>-T</B><I>timegap</I> <B>-U</B> <B>-W</B> <B>-X</B><I>x-shift</I> <B>-Y</B><I>y-shift</I> <B>-Z</B><I>mode[F]</I>
-<B>-0 -1 -2</B>
-<B>-V -H</B>]
-<P>
-<A NAME="lbAE"> </A>
-<H2>DESCRIPTION</H2>
-
-<B>mbswath</B> is a plug-in module for plotting swath sonar data in color fill
-or color shaded relief using <B>GMT</B> (Generic Mapping Tools).
-Like <B>mbcontour</B>, <B>mbswath</B>
-is fully compatible with the <B>GMT</B> package version 5, including the use
-of GMT style color pallete (cpt) files to control the color table.
-A 24-bit true color <I>PostScript</I> file is output using one of
-three methods. Unless individual polygon fills are used (<B>-1</B> option),
-only one call to <B>mbswath</B> can be made for each plot because the
-color image produced covers the entire plot space.
-The program can read data from a single swath sonar file or from
-multiple files as referenced by an MB-System datalist file.
-<P>
-Before opening an input swath data file, <B>mbmbswath</B> checks for
-an ascii file in the same directory having the same name except
-that ".inf" is appended to the end. The program assumes that this
-ascii file contains the output of the program <B>mbinfo</B> run on
-the input data file. If the ".inf" file exists, <B>mbswath</B> reads
-the minimum and maximum longitude and latitude bounds from the
-<B>mbinfo</B> output and compares those to the bounds
-for the plot. If the ".inf" file indicates that none of the data
-in the input file lies inside the plot bounds, that input
-file is skipped. This allows users to maintain a single master list
-of data files for use in all plotting without the performance penalty
-of <B>mbswath</B> reading through all the data files, even those
-with no relevent data. We recommend that users maintain a ".inf"
-file for each swath data file used for gridding or plotting. The
-<B>GMT</B> modules <B>mbcontour</B> and <B>mbgrid</B> also use ".inf" files
-in the same fashion.
-<P>
-If <B>mbfilter</B> has been used to filter amplitude and/or sidescan
-data in the desired input, then the <B>-Z</B> option can be used
-to specify plotting the filtered rather than unfiltered data.
-<P>
-In order for <B>GMT</B> to successfully execute <B>mbswath</B>, the
-location of the shared library <I>libmbgmt</I> containing this module must be known to <B>GMT</B>.
-This can be accomplished by either setting the GMT_CUSTOM_LIBS parameter
-in the file gmt.conf that is part of the GMT installation, by setting
-this parameter in the file gmt.conf in the user's home directory, or by
-using the GMT module <B>gmtset</B> to modify this parameter in the
-current working directory. If, for instance, the <I>libmbgmt</I> shared library
-has been installed in the file /usr/lib/libmbgmt.dylib, then the
-GMT_CUSTOM_LIBS parameter in a gmt.conf file can be set to:
-<BR>        GMT_CUSTOM_LIBS = /usr/lib/libmbgmt.dylib
-<P>
-<A NAME="lbAF"> </A>
-<H2>AUTHORSHIP</H2>
-
-David W. Caress (<A HREF="mailto:caress at mbari.org">caress at mbari.org</A>)
-<BR>
-
-<BR>  Monterey Bay Aquarium Research Institute
-<BR>
-
-Dale N. Chayes (<A HREF="mailto:dale at ldeo.columbia.edu">dale at ldeo.columbia.edu</A>)
-<BR>
-
-<BR>  Lamont-Doherty Earth Observatory
-<P>
-<A NAME="lbAG"> </A>
-<H2>OPTIONS</H2>
-
-<DL COMPACT>
-<DT><B>-A</B>
-
-<DD>
-<I>factor/mode/depth</I>
-<BR>
-
-This option determines how the along-track dimension of the
-beam or pixel footprints is calculated. If <I>mode</I> = 1,
-then the fore-aft beam angle width of the sonar is used so that
-the width increases towards the outer parts of the swath.
-The fore-aft beam angle width (<B>MB-System</B> internally stores
-a value for each format/sonar) is multiplied by the <I>factor</I>
-value; a <I>factor</I> < 1.0 can be useful if the data highly
-oversamples the seafloor and a <I>factor</I> > 1.0 can fill in
-plots of data which undersample the seafloor. If the data
-stream does not include depth values (e.g. one is plotting
-pure sidescan data), then the <I>depth</I> value sets the
-depth value in meters used in the footprint calculations.
-If <I>mode</I> = 2, then the along-track dimension of the beam
-or pixel footprints is just the along-track distance between
-pings multiplied by the <I>factor</I> value.
-If <I>mode</I> = 3, then each data point is plotted as a point,
-and the <I>factor</I> and <I>depth</I> parameters are ignored.
-Default: <I>factor</I> = 1.0, <I>mode</I> = 1, <I>depth</I> = 3000.0.
-<DT><B>-B</B>
-
-<DD>
-<I>tickinfo</I>
-<BR>
-
-Sets map boundary tickmark intervals. See the <B>psbasemap</B>
-manual page for details.
-<DT><B>-b</B>
-
-<DD>
-<I>yr/mo/da/hr/mn/sc</I>
-<BR>
-
-Sets the starting time for data allowed in the input data; pings
-with times before the starting time will be ignored.
-Default: <I>yr/mo/da/hr/mn/sc</I> = 1962/2/21/10/30/0.
-<DT><B>-C</B>
-
-<DD>
-Sets the color palette file which controls the color of the plot.
-See documentation of the GMT package for a complete description
-of cpt files.
-<DT><B>-c</B>
-
-<DD>
-<I>copies</I>
-<BR>
-
-Specifies the number of plot copies (the default is 1).
-<DT><B>-D</B>
-
-<DD>
-<I>mode/scale/min/max</I>
-<BR>
-
-Sets scaling of beam amplitude or sidescan pixel values which
-can be applied before plotting. If <I>mode</I> = 1 or 2, then
-a linear scaling of the form:
-<BR> <TT>       </TT>scaled_value = scale * (value - min) / (max - min)<BR>
-<BR>
-
-is applied.  If <I>mode</I> = 3 or 4, then a log10 scaling of
-the form:
-<BR> <TT>       </TT>scaled_value = scale * (20 * log10(value) - min) / (max - min)<BR>
-<BR>
-
-is applied.  If <I>mode</I> = 2 or 4, then the value (or 20*log10(value))
-will be clipped to <I>min</I> if it is smaller than <I>min</I> or <I>max</I>
-if it is greater than <I>max</I>; this clipping happens prior to the
-multiplication by <I>scale</I>. Default: <I>mode</I> = 1, <I>scale</I> = 1.0,
-<I>min</I> = 0.0, <I>max</I> = 1.0.
-<DT><B>-E</B>
-
-<DD>
-<I>yr/mo/da/hr/mn/sc</I>
-<BR>
-
-Sets the ending time for data allowed in the input data; pings
-with times after the ending time will be ignored.
-Default: <I>yr/mo/da/hr/mn/sc</I> = 2062/2/21/10/30/0.
-<DT><B>-F</B>
-
-<DD>
-<I>red/green/blue</I>
-<BR>
-
-Sets the color used for Frame and annotation. [Default is black]
-<DT><B>-f</B>
-
-<DD>
-<I>format</I>
-<BR>
-
-Sets the data format used if the input is read from stdin
-or from a file. If <I>format</I> < 0, then the input file specified
-with the <B>-I</B> option will actually contain a list of input swath sonar
-data files. This program uses the <B>MBIO</B> library
-and will read or write any swath sonar
-format supported by <B>MBIO</B>. A list of the swath sonar data formats
-currently supported by <B>MBIO</B> and their identifier values
-is given in the <B>MBIO</B> manual page. Default: <I>format</I> = -1.
-<DT><B>-G</B>
-
-<DD>
-<I>magnitude/azimuth</I> or <I>magnitude/median</I>
-<BR>
-
-Sets the parameters which control how <B>mbswath</B> generates
-simulated illumination of bathymetry, which can be either
-shaded relief bathymetry or bathymetry draped with amplitude data.
-If <I>mode</I> is set to 2 (shaded relief bathymetry) using the
-<B>-Z</B> option, then the value <I>magnitude</I>
-is an effective vertical exageration which modulates the intensity of
-the shading; typical values are in the 1-5 range.  The value <I>azimuth</I>
-is the azimuth from which the bathymetry is illuminated.
-If <I>mode</I> is set to 3 (bathymetry shaded using amplitudes) using the
-<B>-Z</B> option, then the value <I>magnitude</I>
-modulates the intensity of the shading; the value <I>median</I> sets the
-amplitude value which serves as the zero or neutral level.
-<DT><B>-H</B>
-
-<DD>
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-<DT><B>-I</B>
-
-<DD>
-<I>infile</I>
-<BR>
-
-Sets the input filename. If <I>format</I> > 0 (set with the
-<B>-f</B> option) then the swath sonar data contained in <I>infile</I>
-is read and processed. If <I>format</I> < 0, then <I>infile</I>
-is assumed to be an ascii file containing a list of the input swath sonar
-data files to be processed and their formats.  The program will read
-and plot the data in each one of these files.
-In the <I>infile</I> file, each
-data file should be followed by a data format identifier, e.g.:
-<BR> <TT>       </TT>datafile1 11<BR>
-<BR> <TT>       </TT>datafile2 24<BR>
-<BR>
-
-This program uses the <B>MBIO</B> library and will read any swath sonar
-format supported by <B>MBIO</B>. A list of the swath sonar data formats
-currently supported by <B>MBIO</B> and their identifier values
-is given in the <B>MBIO</B> manual page.
-<BR>
-
-An input datafile may be accompanied by a "fast bathymetry" or "fbt" file.
-The "fbt" fine naming
-convention is to add the
-".fbt" suffix to the original swath
-data filename.
-An "fbt" file contains only swath bathymetry information
-in a compact format (format 71),
-and is thus quick to read. If <B>mbswath</B> is
-generating a plot containing only bathymetry
-(<B>-Z</B><I>1</I> and <B>-Z</B><I>2</I>).
-the program
-will attempt to read an "fbt" file in lieu of the original data.
-<DT><B>-J</B>
-
-<DD>
-Selects the map projection. Scale is inch/degree, 1:xxxxx.
-or width in inches (upper case modifier).
-<BR>
-
-<P>
-<B>CYLINDRICAL PROJECTIONS:</B>
-<BR>
-
-<P>
-<B>-Jc</B><I>lon0/lat0/scale</I> (Cassini)
-<BR>
-
-<B>-Jm</B><I>scale</I> (Mercator)
-<BR>
-
-<B>-Joa</B><I>lon0/lat0/azimuth/scale</I> (Oblique Mercator - point and azimuth)
-<BR>
-
-<B>-Job</B><I>lon0/lat0/lon1/lat1/scale</I> (Oblique Mercator - two points)
-<BR>
-
-<B>-Joc</B><I>lon0/lat0/lonp/latp/scale</I> (Oblique Mercator - point and pole)
-<BR>
-
-<B>-Jq</B><I>lon0/scale</I> (Equidistant Cylindrical Projection (Plate Carree))
-<BR>
-
-<B>-Jt</B><I>lon0/scale</I> (TM - Transverse Mercator)
-<BR>
-
-<B>-Ju</B><I>zone/scale</I> (UTM - Universal Transverse Mercator)
-<BR>
-
-<B>-Jy</B><I>lon0/lats/scale</I> (Basic Cylindrical Projection)
-<BR>
-
-<P>
-<B>AZIMUTHAL PROJECTIONS:</B>
-<BR>
-
-<P>
-<B>-Ja</B><I>lon0/lat0/scale</I> (Lambert).
-<BR>
-
-<B>-Je</B><I>lon0/lat0/scale</I> (Equidistant).
-<BR>
-
-<B>-Jg</B><I>lon0/lat0/scale</I> (Orthographic).
-<BR>
-
-<B>-Js</B><I>lon0/lat0/scale</I> (General Stereographic)
-<BR>
-
-<P>
-<B>CONIC PROJECTIONS:</B>
-<BR>
-
-<P>
-<B>-Jb</B><I>lon0/lat0/lat1/lat2/scale</I> (Albers)
-<BR>
-
-<B>-Jl</B><I>lon0/lat0/lat1/lat2/scale</I> (Lambert)
-<BR>
-
-<P>
-<B>MISCELLANEOUS PROJECTIONS:</B>
-<BR>
-
-<P>
-<B>-Jh</B><I>lon0/scale</I> (Hammer)
-<BR>
-
-<B>-Ji</B><I>lon0/scale</I> (Sinusoidal)
-<BR>
-
-<B>-Jk</B><I>lon0/scale</I> (Eckert VI)
-<BR>
-
-<B>-Jn</B><I>lon0/scale</I> (Robinson)
-<BR>
-
-<B>-Jr</B><I>lon0/scale</I> (Winkel Tripel)
-<BR>
-
-<B>-Jw</B><I>lon0/scale</I> (Mollweide)
-<BR>
-
-<P>
-<B>NON-GEOGRAPHICAL PROJECTIONS:</B>
-<BR>
-
-<P>
-<B>-Jp</B><I>scale</I> (Linear projection for polar (theta,r) coordinates)
-<BR>
-
-<B>-Jx</B><I>x-scale</I>[<B>l|p</B><I>pow</I>][<I>/y-scale</I>[<B>l|p</B><I>pow</I>]] (Linear, log, and power scaling)
-<BR>
-
-More details can be found in the <B>psbasemap</B> manpages.
-<DT><B>-K</B>
-
-<DD>
-More <I>PostScript</I> code will be appended later [Default terminates the plot system].
-<DT><B>-L</B>
-
-<DD>
-<I>lonflip</I>
-<BR>
-
-Sets the range of the longitude values returned by the swath sonar i/o routines.
-If <I>lonflip</I>=-1 then the longitude values will be in
-the range from -360 to 0 degrees. If <I>lonflip</I>=0
-then the longitude values will be in
-the range from -180 to 180 degrees. If <I>lonflip</I>=1
-then the longitude values will be in
-the range from 0 to 360 degrees.
-Default: <I>lonflip</I> = 0.
-<DT><B>-N</B>
-
-<DD>
-<I>cptfile</I>
-<BR>
-
-Normally, shading of bathymetry with amplitudes (<I>mode</I> = 3
-as set with the <B>-Z</B> option) is accomplished
-by linearly mapping the amplitudes to shade values. This option
-specifies a grayscale cpt file used to map amplitude values
-to grayscale shade values.
-<DT><B>-O</B>
-
-<DD>
-Selects Overlay plot mode [Default initializes a new plot system].
-<DT><B>-P</B>
-
-<DD>
-Selects Portrait plotting mode [GMT Default is Landscape, see gmtdefaults to change this].
-<DT><B>-p</B>
-
-<DD>
-<I>pings</I>
-<BR>
-
-Sets the ping averaging of the input data. If <I>pings</I> = 1, then
-no ping averaging is performed. If <I>pings</I> > 0, then
-that number of input pings will be averaged to produce one output
-ping.  If <I>pings</I> = 0, then the ping averaging will automatically
-be done so that the along-track ping spacing is equal to the across-track
-beam spacing.
-Default: <I>pings</I> = 1 (no ping averaging).
-<DT><B>-Q</B>
-
-<DD>
-<I>dpi</I>
-<BR>
-
-Sets the resolution of the color image output by <B>mbswath</B>
-in pixels per inch (except when the <B>-1</B> option is used to force individual
-polygon color fills). Default: <I>dpi</I> = 100.
-<DT><B>-R</B>
-
-<DD>
-<I>west/east/south/north</I>
-<BR>
-
-Sets the longitude and latitude bounds within which swath sonar
-data will be read and plotted. Only the data which lies within
-these bounds will be read.
-Default: <I>west</I>=-360, east<I>=360</I>, <I>south</I>=-90, <I>north</I>=90.
-<DT><B>-S</B>
-
-<DD>
-<I>speed</I>
-<BR>
-
-Sets the minimum speed in km/hr (5.5 kts ~ 10 km/hr) allowed in
-the input data; pings associated with a smaller ship speed will not be
-processed. Default: <I>speed</I> = 0.
-<DT><B>-T</B>
-
-<DD>
-<I>timegap</I>
-<BR>
-
-Sets the maximum time gap in minutes between adjacent pings allowed before
-the data is considered to have a gap. Default: <I>timegap</I> = 1.
-<DT><B>-U</B>
-
-<DD>
-Draw Unix System time stamp on plot.  Optionally, append a label, or 'c' which will plot
-the command string.
-<DT><B>-V</B>
-
-<DD>
-Selects verbose mode, which will send progress reports to stderr [Default runs "silently"].
-<DT><B>-W</B>
-
-<DD>
-Normally, <B>mbswath</B> works with bathymetry values in meters.  If the
-<B>-W</B> flag is given, then <B>mbswath</B> will work with bathymetry
-values in feet. The color palette file used must conform to the
-range of bathymetry values in feet.
-<DT><B>-X -Y</B>
-
-<DD>
-Shift origin of plot by (<I>x-shift,y-shift</I>) inches  [Default is (1,1) for new plots, (0,0) for overlays].
-<DT><B>-Z</B>
-
-<DD>
-<I>mode[F]</I>
-<BR>
-
-Sets the style of the plot.
-<BR> <TT>       </TT><I>mode</I> = 1:<TT>       </TT>Color fill of bathymetry data.<BR>
-<BR> <TT>       </TT><I>mode</I> = 2:<TT>       </TT>Color shaded relief bathymetry.<BR>
-<BR> <TT>       </TT><I>mode</I> = 3:<TT>       </TT>Bathymetry shaded using amplitude data.<BR>
-<BR> <TT>       </TT><I>mode</I> = 4:<TT>       </TT>Color fill of amplitude data.<BR>
-<BR> <TT>       </TT><I>mode</I> = 5:<TT>       </TT>Color fill of sidescan data.<BR>
-<BR>
-
-If "F" is appended to <I>mode</I>, then <B>mbswath</B> will attempt
-to plot amplitude or sidescan data that have been filtered with <B>mbfilter</B>.
-If the desired filtered data files do not exist, plotting will fail and
-<B>mbswath</B> will exit with an error message. Filtered amplitude
-data are stored in ancilliary files ending with ".ffa", and filtered
-sidescan files end in ".ffs". Filtering of bathymetry data is not supported,
-and so appending "F" to <I>mode</I> values of 1 or 2 will have no effect.
-Default: <I>mode</I> = 1;
-<DT><B>-0</B>
-
-<DD>
-Create the image using the Adobe <I>PostScript</I> colorimage operator.
-This is the default.
-<DT><B>-1</B>
-
-<DD>
-Create the image by plotting individual color polygons.
-<DT><B>-2</B>
-
-<DD>
-Create the image by color separation using three calls to image for later
-processing by <B>psto24</B>.
-</DL>
-<A NAME="lbAH"> </A>
-<H2>EXAMPLES</H2>
-
-Suppose the user has a Hydrosweep data file in the L-DEO in-house
-binary format (<B>MBIO</B> format id 24) called hs_ew9302_157_mn.mb24
-which lies in the region w/s/e/n = -32.1874/-26.6236/54.6349/56.7536.
-The following will suffice to generate a color fill plot:
-<BR> <TT>       </TT>gmt mbswath -Idatalist -Jm1.46578 -R-32.1874/-26.6236/54.6349/56.7536<BR>
-<BR> <TT>       </TT><TT>        </TT>-B1/1 -Ccolor.cpt -p1 -A1 -Q100 -Z2<BR>
-<BR> <TT>       </TT><TT>        </TT>-X1 -Y1.75 -V > mbswath.ps<BR>
-<BR>
-
-where the file datalist contains:
-<BR> <TT>       </TT>hs_ew9302_157_mn.mb24 24<BR>
-<BR>
-
-A more complicated plot including a navigation track and a color scale
-can be created using <B>mbswath</B> in conjunction with other GMT
-and GMT-compatible utilities.  The following is an example of a shellscript
-which generates such a plot and then displays it on the screen:
-<P>
-<BR> #
-<BR> # Shellscript to create Postscript plot of swath sonar data
-<BR> # Created by macro mbm_plot
-<BR> #
-<BR> # Make datalist file
-<BR> echo Making datalist file...
-<BR> echo hs_ew9302_157_bmn.mb24 24 > datalist
-<BR> #
-<BR> # Make color palette table file
-<BR> echo Making color palette table file...
-<BR> echo 2235 255 255 255 2372 255 221 171 > hs_ew9302_157_bmn.mb24.cpt
-<BR> echo 2372 255 221 171 2509 255 186 133 >> hs_ew9302_157_bmn.mb24.cpt
-<BR> echo 2509 255 186 133 2646 255 161 68 >> hs_ew9302_157_bmn.mb24.cpt
-<BR> echo 2646 255 161 68 2783 255 189 87 >> hs_ew9302_157_bmn.mb24.cpt
-<BR> echo 2783 255 189 87 2920 240 236 121 >> hs_ew9302_157_bmn.mb24.cpt
-<BR> echo 2920 240 236 121 3057 205 255 162 >> hs_ew9302_157_bmn.mb24.cpt
-<BR> echo 3057 205 255 162 3193 138 236 174 >> hs_ew9302_157_bmn.mb24.cpt
-<BR> echo 3193 138 236 174 3330 106 235 255 >> hs_ew9302_157_bmn.mb24.cpt
-<BR> echo 3330 106 235 255 3467 87 215 255 >> hs_ew9302_157_bmn.mb24.cpt
-<BR> echo 3467 87 215 255 3604 50 190 255 >> hs_ew9302_157_bmn.mb24.cpt
-<BR> echo 3604 50 190 255 3741 0 160 255 >> hs_ew9302_157_bmn.mb24.cpt
-<BR> echo 3741 0 160 255 3878 40 127 251 >> hs_ew9302_157_bmn.mb24.cpt
-<BR> echo 3878 40 127 251 4015 21 92 236 >> hs_ew9302_157_bmn.mb24.cpt
-<BR> echo 4015 21 92 236 4152 37 57 175 >> hs_ew9302_157_bmn.mb24.cpt
-<BR> #
-<BR> # Run mbswath
-<BR> echo Running mbswath...
-<BR> gmt mbswath -Idatalist -Jm1.46578 -R-32.1874/-26.6236/54.6349/56.7536  <TT>        </TT>-B1.1128/1.1128":.Data File hs_ew9302_157_bmn.mb24:"  -Chs_ew9302_157_bmn.mb24.cpt -p1 -A1 -Q100 -G5/0 -Z2 -X1  -Y1.75 -K -V > hs_ew9302_157_bmn.mb24.ps<BR>
-<BR> #
-<BR> # Run mblist
-<BR> echo Running mblist...
-<BR> mblist -F24 -Ihs_ew9302_157_bmn.mb24 -OXYU > hs_ew9302_157_bmn.mb24.nav
-<BR> #
-<BR> # Run pstrack
-<BR> echo Running pstrack...
-<BR> gmt pstrack hs_ew9302_157_bmn.mb24.nav -Jm1.46578  <TT>    </TT>-R-32.1874/-26.6236/54.6349/56.7536 -B1.1128/1.1128":.Data File  hs_ew9302_157_bmn.mb24:" -W1p -Mt15ma1h -O -K >> hs_ew9302_157_bmn.mb24.ps<BR>
-<BR> #
-<BR> # Run psscale
-<BR> echo Running psscale...
-<BR> gmt psscale  -Chs_ew9302_157_bmn.mb24.cpt -D4.0777/-0.5000/6.5242/0.1500h
-<BR> <TT>       </TT>-B":.Depth (meters):" -O -V >> hs_ew9302_157_bmn.mb24.ps<BR>
-<BR> #
-<BR> # Delete surplus files
-<BR> echo Deleting surplus files...
-<BR> rm -f hs_ew9302_157_bmn.mb24.cpt datalist hs_ew9302_157_bmn.mb24.nav
-<BR> #
-<BR> # Run pageview
-<BR> echo Running gv in background...
-<BR> gv hs_ew9302_157_bmn.mb24.ps &
-<BR> #
-<BR> # All done!
-<BR> echo All done!
-<P>
-<A NAME="lbAI"> </A>
-<H2>SEE ALSO</H2>
-
-<B><A HREF="mbsystem.html">mbsystem</A></B>(1), <B><A HREF="mbm_plot.html">mbm_plot</A></B>(1), <B><A HREF="mbcontour.html">mbcontour</A></B>(1),  <B><A HREF="mbfilter.html">mbfilter</A></B>(1),
-<B>gmtsystem</B>(1), <B>psbasemap</B>(1), <B>psto24</B>(1)
-<P>
-<A NAME="lbAJ"> </A>
-<H2>BUGS</H2>
-
-Let us know.
-<P>
-
-<HR>
-<A NAME="index"> </A><H2>Index</H2>
-<DL>
-<DT><A HREF="#lbAB">NAME</A><DD>
-<DT><A HREF="#lbAC">VERSION</A><DD>
-<DT><A HREF="#lbAD">SYNOPSIS</A><DD>
-<DT><A HREF="#lbAE">DESCRIPTION</A><DD>
-<DT><A HREF="#lbAF">AUTHORSHIP</A><DD>
-<DT><A HREF="#lbAG">OPTIONS</A><DD>
-<DT><A HREF="#lbAH">EXAMPLES</A><DD>
-<DT><A HREF="#lbAI">SEE ALSO</A><DD>
-<DT><A HREF="#lbAJ">BUGS</A><DD>
-</DL>
-<HR>
-</PRE>
-
-<CENTER><P><BR>
-Last Updated: 5 February 2015</P></CENTER>
-
-<HR>
-<P><A HREF="mbsystem_man_list.html">Return to list of MB-System manual pages...</A></P>
-<P><A HREF="mbsystem_home.html"><IMG SRC="mbsystem_logo_small.gif" BORDER=0 HEIGHT=55 WIDTH=158 ALIGN=BOTTOM></A><A HREF="mbsystem_home.html">Back
-to MB-System Home Page...</A></P>
-
-</BODY>
-</HTML>
diff --git a/src/html/mbswplspreprocess.html b/src/html/mbswplspreprocess.html
deleted file mode 100644
index db3077d..0000000
--- a/src/html/mbswplspreprocess.html
+++ /dev/null
@@ -1,278 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<HTML VERSION="2.0">
-<HEAD>
-   <TITLE>MB-System Unix Manual Page: mbswplspreprocess</TITLE>
-<!-- WEBMAGIC VERSION NUMBER="2.0.2" -->
-<!-- WEBMAGIC TRANSLATION NAME="ServerRoot" SRC="/var/www/htdocs/" DST="/" -->
-<!-- WEBMAGIC TRANSLATION NAME="ProjectRoot" SRC="./" DST="" -->
-</HEAD>
-<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#336699" VLINK="#997040" ALINK="#CC9900">
-<BODY>
-<CENTER><H3><U>MB-System Unix Manual Page</U></H3></CENTER>
-<PRE>
-<H1>mbswplspreprocess</H1>
-Section:  MB-System 5.0  (1)<BR>Updated:  26 March 2014 <BR><A HREF="#index">Index</A>
-<HR>
-
-<A NAME="lbAB"> </A>
-<H2>NAME</H2>
-
-<B>mbswplspreprocess</B> - prepairs a SWATHplus sonar file (<B>MBIO</B> 
-format 222) for processed with MB System.                             
-<A NAME="lbAC"> </A>
-<H2>VERSION</H2>
-
-Version 5.0
-<P>
-<A NAME="lbAD"> </A>
-<H2>SYNOPSIS</H2>
-
-<B>mbswplspreprocess</B> [<B>-ABGNRSHV</B>] [<B>-F</B><I>format</I>] 
-[<B>-J</B><I>proj4command</I>] [<B>-O</B><I>outfile</I>] <B>-I</B><I>file
-<P>
-</I><A NAME="lbAE"> </A>
-<H2>DESCRIPTION</H2>
-
-<B>mbswplspreprocess</B> prepairs a SWATHplus SXP (<B>MBIO</B> format 222) 
-file for processing with MB System. 
-<P>
-
-MB System can read and plot SXP files 
-without modification. However, many of the editing and calibration programs 
-work best if each transducer channel is stored in a separate file (use 
-the <B>-S</B> option). In particular, multiple transducer channels pinging 
-simultaneously will trip up time filtering, since each channel in the 
-ping series has the same time stamp.                                  
-<P>
-
-If during data acquisition using the SEA SWATH Real-Time Acquisition System 
-(SEA Swath Processor), the "Store All Data" option was selected in combination 
-with the "Downsample" Bathy filter, the SXP ping records will contain 
-both the original data (all samples rejected) and the filtered data (all 
-samples accepted) simultaneously. This will confuse most programs in MB 
-System. Use the <B>-B</B> and <B>-R</B> options as needed to strip out 
-the undesired set prior to processing.                                
-<P>
-
-SXP ping records contain both a raw amplitude and a processed amplitude 
-value for each sample. MB System reads and writes ONLY the processed amplitude 
-values, leaving the raw values untouched. Use the <B>-A</B> option to 
-copy (or restore) the raw amplitude values into the processed amplitude 
-slots so that they can be accessed by MB System.              
-<BR>
-
-<A NAME="lbAF"> </A>
-<H2>AUTHORSHIP</H2>
-
-David P. Finlayson (<A HREF="mailto:dfinlayson at usgs.gov">dfinlayson at usgs.gov</A>)
-<BR>
-
-<BR> Pacific Coastal and Marine Science Center, USGS
-<BR>
-
-<A NAME="lbAG"> </A>
-<H2>OPTIONS</H2>
-
-<DL COMPACT>
-<DT><B>-A</B>
-
-<DD>
-<BR>
-
-This option causes the program to copy the raw amplitude values stored 
-with each sample into the corresponding processed amplitude slot where 
-it can then be used by MB System.
-<DT><B>-B</B>
-
-<DD>
-<BR>
-
-This option causes the program to reverse the sample flag setting. That 
-is, rejected samples become accepted samples and vis-a-vis. This option 
-is always applied before option <B>-R</B>.                 
-<DT><B>-F</B>
-
-<DD>
-<I>format</I>
-<BR>
-
-Sets the data format used if the input is read from stdin or from a file. 
-If <I>format</I> < 0, then the input file specified with the <B>-I</B> 
-option will actually contain a list of input swath sonar data files. This 
-program only reads Bathyswath (SWATHplus) format data files (<B>MBIO</B> 
-format 222).                                                                                                          
-<DT><B>-G</B>
-
-<DD>
-Print to stdout an ASCII representation of each data record read from the file.
-<DT><B>-H</B>
-
-<DD>
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-<DT><B>-I</B>
-
-<DD>
-<I>infile</I>
-<BR>
-
-Sets the input file path. If <I>format</I> > 0 (set with the
-<B>-f</B> option or <B>mbdefaults</B>) then the swath sonar data contained in <I>infile</I>
-is read and processed. If <I>format</I> < 0, then <I>infile</I>
-is assumed to be an ascii file containing a list of the input swath sonar
-data files to be processed and their formats.  The program will read
-the data in each one of these files.
-In the <I>infile</I> file, each
-data file should be followed by a data format identifier, e.g.:
-<BR> <TT>       </TT>datafile1 222 1<BR>
-<BR> <TT>       </TT>datafile2 222 1<BR>
-<BR>
-
-This program only reads SWATHplus format data files (<B>MBIO</B> format 
-222). .                                                               
-<DT><B>-J</B>
-
-<DD>
-<I>projection</I>
-<BR>
-
-The SWATHplus software packages operate with navigation in a user-defined
-projected coordinate system.  Resultantly, SXP format files contain
-positions in a projected coordinate system rather than longitude and
-latitude in geographic coordinates.  Generally, the SXP files do not contain
-any description of the projection used to obtain the eastings and northings
-in those files.  This option allows a user to specifiy the projection used
-to translate the eastings and northings back into longitude and latitude. 
-If this option is not specified, <B>MB-System</B> will assume the data are
-associated with UTM zone 1 north.  The projection identifier must conform to
-the same usage as with projections specified for <B>mbgrid</B>.  For
-instance, to fully specify a particular northern UTM zone, set projection =
-UTMXXN where XX gives the UTM zone (defined from 01 to 60).  As an example,
-a northern UTM zone 12 projection can be specified using -JUTM12N.  Southern
-UTM zones are specified as UTMXXS.  The European Petroleum Survey Group
-(EPSG) has defined a large number of PCS's used worldwide and assigned
-number id's to each; one can also specify the northern UTM zone 12
-projection using its EPSG designation, or -Jepsg32612.  The complete list of
-projected coordinate systems supported by MB-System is given in the mbgrid
-manual page.
-<DT><B>-N</B>
-
-<DD>
-Do not write output file. Useful for inspecting files, especially combined 
-with <B>-G</B>.
-<DT><B>-O</B>
-
-<DD>
-<I>outfile</I>
-<BR>
-
-This option causes <B>mbswplspreprocess</B> to output all data to a single file
-specified as <I>outfile</I>. By default, the program creates output files for
-each input file. If combined with <B>-S</B>, this will serve as the basename
-for a set of output files, one for each transducer.
-<DT><B>-R</B>
-
-<DD>
-This option removes all rejected samples from pings before writing output.
-<DT><B>-S</B>
-
-<DD>
-This option saves each transducer channel into a separate output file. This is
-the best way to handle simultaneous pinging in MB System and the only way to
-handle 3 or more transducer channel systems. The transducer channel will
-be appended to the output filename as follows:
-<BR>
-
-outfile_txer<channel>.mb222
-</DL>
-<A NAME="lbAH"> </A>
-<H2>EXAMPLES</H2>
-
-Suppose that one has collected a SWATHplus datafile incorporating interferometric 
-sonar data from a 2-transducer system pinging simultaneously. The file name 
-is:
-<P>
-
-<PRE>
-<DL COMPACT><DT><DD>20140418_150155.sxp
-</DL>
-</PRE>
-
-<P>
-
-To split each transducer into its own file for better filtering support 
-from MB System, to reset the amplitude values to their original pre-processed 
-values, and to strip out any previously flagged data run:
-<P>
-
-<PRE>
-<DL COMPACT><DT><DD>mbswplspreprocess -SAR -I20140418_150155.sxp
-</DL>
-</PRE>
-
-<P>
-
-To export the data records stored in an SXP file to a text file:
-<P>
-
-<PRE>
-<DL COMPACT><DT><DD>mbswplspreprocess -GN -I20140418_150155.sxp > output.txt
-</DL>
-</PRE>
-
-<P>
-
-<A NAME="lbAI"> </A>
-<H2>NOTES</H2>
-
-The SXP file format does not contain sufficient information to completely re-process 
-the data in MB System itself. For example, you should not attempt to re-calculate 
-bathymetry based on new sound velocity information. Ridged translations and
-rotations are OK (static shifts in x, y, or z, rotations about the transducer reference point) 
-provided that each transducer channel resides in its own file (see the <B>-S</B> option). It is 
-always safe to edit and filter the soundings in <B>mbedit</B> and <B>mbeditviz</B>.                         
-<P>
-
-SXP files use a projected coordinate system for all transducer and sea 
-floor sample coordinates. The user must supply a .PRJ file defining the 
-coordinate system (usually UTM) for each input file before proceeding 
-with further processing in MB System. The coordinate system is not stored 
-in the SXP file data itself.                                          
-<A NAME="lbAJ"> </A>
-<H2>SEE ALSO</H2>
-
-<B><A HREF="mbsystem.html">mbsystem</A></B>(1), <B><A HREF="mbformat.html">mbformat</A></B>(1), <B><A HREF="mbinfo.html">mbinfo</A></B>(1)
-<P>
-<A NAME="lbAK"> </A>
-<H2>BUGS</H2>
-
-Oh yeah.
-<P>
-
-<HR>
-<A NAME="index"> </A><H2>Index</H2>
-<DL>
-<DT><A HREF="#lbAB">NAME</A><DD>
-<DT><A HREF="#lbAC">VERSION</A><DD>
-<DT><A HREF="#lbAD">SYNOPSIS</A><DD>
-<DT><A HREF="#lbAE">DESCRIPTION</A><DD>
-<DT><A HREF="#lbAF">AUTHORSHIP</A><DD>
-<DT><A HREF="#lbAG">OPTIONS</A><DD>
-<DT><A HREF="#lbAH">EXAMPLES</A><DD>
-<DT><A HREF="#lbAI">NOTES</A><DD>
-<DT><A HREF="#lbAJ">SEE ALSO</A><DD>
-<DT><A HREF="#lbAK">BUGS</A><DD>
-</DL>
-<HR>
-</PRE>
-
-<CENTER><P><BR>
-Last Updated: 26 March 2014</P></CENTER>
-
-<HR>
-<P><A HREF="mbsystem_man_list.html">Return to list of MB-System manual pages...</A></P>
-<P><A HREF="mbsystem_home.html"><IMG SRC="mbsystem_logo_small.gif" BORDER=0 HEIGHT=55 WIDTH=158 ALIGN=BOTTOM></A><A HREF="mbsystem_home.html">Back
-to MB-System Home Page...</A></P>
-
-</BODY>
-</HTML>
diff --git a/src/html/mbsystem.html b/src/html/mbsystem.html
deleted file mode 100644
index 2b09590..0000000
--- a/src/html/mbsystem.html
+++ /dev/null
@@ -1,1681 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<HTML VERSION="2.0">
-<HEAD>
-   <TITLE>MB-System Unix Manual Page: mbsystem</TITLE>
-<!-- WEBMAGIC VERSION NUMBER="2.0.2" -->
-<!-- WEBMAGIC TRANSLATION NAME="ServerRoot" SRC="/var/www/htdocs/" DST="/" -->
-<!-- WEBMAGIC TRANSLATION NAME="ProjectRoot" SRC="./" DST="" -->
-</HEAD>
-<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#336699" VLINK="#997040" ALINK="#CC9900">
-<BODY>
-<CENTER><H3><U>MB-System Unix Manual Page</U></H3></CENTER>
-<PRE>
-<H1>mbsystem</H1>
-Section:  MB-System 5.5  (1)<BR>Updated:  26 January 2015 <BR><A HREF="#index">Index</A>
-<HR>
-
-<A NAME="lbAB"> </A>
-<H2>NAME</H2>
-
-<B>mbsystem</B> - A set of utilities for manipulating and
-processing swath sonar bathymetry, amplitude, and sidescan data.
-<P>
-<A NAME="lbAC"> </A>
-<H2>VERSION</H2>
-
-Version 5.5
-<P>
-<A NAME="lbAD"> </A>
-<H2>AUTHORSHIP</H2>
-
-David W. Caress (<A HREF="mailto:caress at mbari.org">caress at mbari.org</A>)
-<BR>
-
-<BR>  Monterey Bay Aquarium Research Institute
-<BR>
-
-Dale N. Chayes (<A HREF="mailto:dale at ldeo.columbia.edu">dale at ldeo.columbia.edu</A>)
-<BR>
-
-<BR>  Lamont-Doherty Earth Observatory
-<P>
-<A NAME="lbAE"> </A>
-<H2>INTRODUCTION</H2>
-
-<B>MB-System</B> is a software package consisting of programs which manipulate, process, list, or
-display swath sonar bathymetry, amplitude, and sidescan data. This software is distributed freely
-(and for free) in the form of source code for Unix platforms. The heart of the system is an
-input/output library called <B>MBIO</B> which allows programs to work transparently with any of a
-number of supported swath sonar data formats. This approach has allowed the creation of
-"generic" utilities which can be applied in a uniform manner to sonar data from a variety of
-sources. Most of the programs are command-line tools, but the package does include graphical
-tools for editing swath bathymetry, editing navigation, modeling bathymetry calculation, and
-adjusting survey navigation.
-<P>
-The acronym MB stands for MultiBeam; this reflects the fact that the early development of
-<B>MB-System</B> focused on processing deep sea bathymetry data from ship-mounted multibeam
-sonars. However, <B>MB-System</B> now supports several data formats from sidescan and interferometric
-sonars and works with sonar data that map the seafloor at scales from centimeters to kilometers.
-<P>
-The original National Science Foundation (NSF) mandate in 1993 was to create a set of generic tools
-that would work with all of the sonar data collected on U.S. academic research vessels in NSF-supported
-projects. Not surprisingly, the early core of the <B>MB-System</B> user community consisted of
-NSF-supported researchers at U.S. institutions such as the Lamont-Doherty Earth Observatory, the Scripps
-Institution of Oceanography, and the Woods Hole Oceanographic Institution. However, in recent years
-<B>MB-System</B> has also come to be used widely in the international oceanographic community and in the
-marine technology industry.
-<P>
-The <B>MB-System</B> source code is distributed under the GNU General Public License as formulated
-by the GNU Project. <B>MB-System</B> installation depends on some other software packages (e.g.
-GMT and netCDF), all of which are freely available as source code.
-<P>
-<A NAME="lbAF"> </A>
-<H2>COPYRIGHT AND LICENSING</H2>
-
-<B>MB-System</B> Copyright (C) 1993-2015 by
-<BR>
-
-David W. Caress (<A HREF="mailto:caress at mbari.org">caress at mbari.org</A>)
-<BR>    Monterey Bay Aquarium Research Institute
-<BR>    Moss Landing, CA 95039
-<BR>
-
-Dale N. Chayes (<A HREF="mailto:dale at ldeo.columbia.edu">dale at ldeo.columbia.edu</A>)
-<BR>    Lamont-Doherty Earth Observatory of Columbia University
-<BR>    Palisades, NY 10964
-<BR>
-
-All Rights Reserved
-<BR>
-
-All Wrongs Remembered
-<P>
-The <B>MB-System</B> source code is distributed under the GNU General Public License as formulated
-by the GNU Project. Early <B>MB-System</B> distributions were described as "public domain",
-which meant there was no restrictions whatsoever on the use of the code. We adopted
-the more restrictive GNU GPL license in order to insure that anyone who distributes software
-based in whole or in part on <B>MB-System</B> also distributes the modified <B>MB-System</B> source code
-and any additional source code.
-<P>
-The GNU GPL also prohibits the distribution of proprietary executables linked with
-<B>MB-System</B> libraries unless the source code is also distributed. We waive this restriction on
-distributing proprietary compiled programs for specific software products if and only if those
-software products meet the following two conditions:
-<DL COMPACT><DT><DD>
-<DL COMPACT><DT>
-
-<DD>1) The software product was created, sold, and delivered to customers using source code
-derived from <B>MB-System</B> release 4.6 distributions.
-<BR>
-
-<DT>
-
-<DD>2) The software product was sold and delivered to customers prior to January 1, 2001.
-</DL></DL>
-
-<P>
-<A NAME="lbAG"> </A>
-<H2>HISTORY</H2>
-
-The development of <B>MB-System</B> began in 1990 as part of David Caress' research at
-the Lamont-Doherty Earth Observatory (LDEO), which involved swath bathymetry data collected
-with SeaBeam multibeam sonars. Development was accelerated in 1991 as part of an effort to
-support the new STN-Atlas Hydrosweep DS multibeam sonar on LDEO's ship, the R/V Maurice Ewing.
-Dale Chayes, a Lamont-Doherty engineer, was responsible for the maintenance and operation
-of the Ewing's Hydrosweep. As part of a grant in 1993 and 1994 to Chayes and Caress to upgrade
-the Hydrosweep operations on the Ewing, the National Science Foundation provided support
-to improve and extend <B>MB-System</B>. The intent of this initial grant was to provide a
-standard "generic" set of tools for processing and display of swath sonar data that could
-be used by the U.S. academic community. The first generally released version of <B>MB-System</B>
-(3.0) was made available in the Spring of 1993. This was followed by versions 3.1 and 3.2 in
-July, 1993, version 3.3 in November, 1993, and version 3.4 in December 1993. All of these
-early releases supported only SeaBeam and Hydrosweep data.
-<P>
-SeaBeam Instruments and Antarctic Support Associates provided additional support in
-1994 for the development of <B>MB-System</B>, with particular emphasis on capabilities related
-to the new SeaBeam 2100 series of sonars. A considerably enhanced <B>MB-System</B> version
-4.0 was released on October 22, 1994; this release followed an almost complete rewrite of
-the underlying source code. The new capabilities included support for sidescan as well as
-bathymetry data and support for data from a number of very different sonars.
-<P>
-The National Science Foundation funded a five year effort begun in 1995 to maintain and
-further develop <B>MB-System</B>. From 1994 to 1997, SeaBeam Instruments (a major
-multibeam sonar manufacturer and, at the time, the principal employer of David W.
-Caress) provided significant support for <B>MB-System</B> development and maintenance.
-Similarly, the Newport, RI office of the Science Applications International Corporation
-(SAIC) supported some <B>MB-System</B> development during 1997-1998, when David W.
-Caress worked there. Version 4.1 was released in November, 1994, followed by 4.2 in
-February 1995, 4.3 on March 12, 1996, 4.4 on August 27, 1996, and 4.5 on September 23,
-1997.
-<P>
-David Caress joined the Monterey Bay Aquarium Research Institute (MBARI) in
-September, 1998. Version 4.6 was released on April 16, 1999. The final update to version
-4.6 (4.6.10) was announced on March 8, 2000. The primary innovations during this period
-included support for the new generation of Simrad multibeam sonars and tools for
-generating data products that could be imported directly into GIS software packages.
-<P>
-The National Science Foundation has continued to support <B>MB-System</B> development through
-additional five year grants (2001-2006 & 2006-2011) to MBARI and
-L-DEO. The Packard Foundation matches the NSF support to Caress at MBARI. The version 5.0 release
-incorporated another substantial rewrite of the underlying code as well as providing
-significant new capabilities. Thirty one 5.0 "beta" distributions were released during
-2001-2003, with the full 5.0.0 version released on December 5, 2003. Active development
-continued with 5.1.0 released on November 26, 2006, 5.1.1 on December 31, 2008.
-and 5.1.2 on December 31, 2009. Since the advent of 5.0, over sixty "beta" and "official"
-distributions of <B>MB-System</B> have been released. Beginning with 5.2.1880 on December 30, 2010,
-<B>MB-System</B> distributions are tied to the revisions in the source code archive (the third number
-corresponds to the revision id in the archive).
-<P>
-Since 2004 a major theme of <B>MB-System</B> development has been the processing of multibeam, sidescan,
-and subbottom profiler data collected on submerged platforms, particularly autonomous
-underwater vehicles (AUVs).
-<P>
-<A NAME="lbAH"> </A>
-<H2>WHAT'S NEW ABOUT VERSION 5</H2>
-
-The version 5.0 release of <B>MB-System</B> included a number of changes and improvements relative
-to the version 4 releases. The most significant changes included:
-<P>
-<A NAME="lbAI"> </A>
-<H3>A new approach to managing data processing.</H3>
-
-<DL COMPACT>
-<DT>*<DD>
-Many tools - one output file. In previous versions of <B>MB-System</B>, each processing
-program read an input swath data file and produced an output swath data file. This
-"serial" processing scheme generally produced a large number of intermediate data
-files. <B>MB-System</B> version 5.0 features the integration of the editing and analysis
-tools with a single program, mbprocess, that outputs processed data files. The new
-"parallel" processing scheme covers bathymetry data processing, but does not yet
-incorporate the sidescan processing capabilities. All of the old tools and capabilities
-are still part of the distribution.
-<DT>*<DD>
-Recursive datalists. The lists of data files used by gridding and plotting programs can
-now be recursive, making it simpler to manage data from many different surveys.
-<DT>*<DD>
-Automatic format identification. <B>MB-System</B> programs will now attempt to
-automatically identify the swath data format based on the filename suffix.
-<DT>*<DD>
-Ancillary data files. Many common <B>MB-System</B> tasks (e.g. swath plotting
-and gridding) can be accomplished more rapidly using ancillary data files containing
-file statistics (".inf" files), quickly read bathymetry (".fbt" files), and
-(".fnv") files. Each of these files is named by adding the indicated four character
-suffix to the original swath data filename. The ".inf" files are created by directing
-the output of <B>mbinfo</B> to a file. The ".fbt" files are creating by using
-<B>mbcopy</B> to extract the bathymetry into a format 71 file. The ".fnv" files
-are created using <B>mblist</B> to create a text navigation list.
-These ancillary files are automatically created together using the
-program <B>mbdatalist</B>.
-<P>
-</DL>
-<A NAME="lbAJ"> </A>
-<H3>New tools.</H3>
-
-<DL COMPACT>
-<DT>*<DD>
-<B>mbnavadjust</B>. This new tool allows users to adjust poorly navigated surveys by
-matching features in overlapping swathes. It is particularly useful for processing
-surveys conducted from submerged platforms.
-<DT>*<DD>
-<B>mbprocess</B>. This new tool performs a variety of processing tasks and produces a
-single output processed swath data file. The program mbprocess can apply
-bathymetry edits from mbedit and mbclean, navigation edits from mbnavedit, sound
-velocity profile changes from mbvelocitytool, and a variety of other corrections.
-<DT>*<DD>
-<B>mbset</B>. This new tool allows users to create and modify the parameter files used to
-control the operation of mbprocess.
-<DT>*<DD>
-<B>mbdatalist</B>. This new tool allows users to list the files referenced by
-a recursive datalist structure. It can also be used to create the ancillary ".inf",
-".fbt", and ".fnv" files for all of the data files referenced in a recursive datalist
-structure.
-<DT>*<DD>
-<B>mbsvplist</B>. This new tool lists water sound velocity profiles embedded
-in swath data files, creating secondary files that
-can be read into MBvelocitytool.
-<DT>*<DD>
-<B>mbareaclean</B>. This new tool identifies and flags artifacts in swath sonar
-bathymetry data within a specified area of interest. The
-area is divided into a grid with square cells or bins, and the
-data are grouped according to these bins. Once all
-of  data  are read, statistical tests are applied
-to the soundings within each bin.
-<P>
-</DL>
-<A NAME="lbAK"> </A>
-<H3>Support for Projected Coordinate Systems.</H3>
-
-<DL COMPACT>
-<DT>*<DD>
-<B>MB-System</B> now incorporates the source code for the PROJ.4 Cartographic Projections library,
-providing support for (apparently) all commonly used geodetic coordinate systems.
-<B>PROJ.4</B> was developed by Gerald Evenden (then of the USGS), and was obtained from
-the <A HREF="http://www.remotesensing.org">www.remotesensing.org</A> website.
-<DT>*<DD>
-A large number of commonly used projected coordinate systems (e.g. UTM) are defined
-in a file (mbsystem/share/projections.dat) distributed with <B>MB-System</B>. These include
-all of the standard UTM zones, all of the standard state plate coordinate systems, and
-most of the European Petroleum Survey Group (EPSG) coordinate systems (also including UTM).
-<DT>*<DD>
-<B>MB-System</B> can now handle swath data that is navigated in a supported projected
-coordinate system. In particular, data files that are navigated with UTM eastings and
-northings instead of longitude and latitude can now be plotted and processed with
-<B>MB-System</B>.
-<DT>*<DD>
-The programs <B>mbgrid</B> and <B>mbmosaic</B> can now output grids and mosaics in any of
-the projected coordinate systems specified in mbsystem/share/projections.dat.
-<DT>*<DD>
-The TIFF images generated with <B>mbm_grdtiff</B> and <B>mbgrdtiff</B> now fully conform
-to the GeoTIFF standard, providing that the source grids or mosaics were generated
-using <B>mbgrid</B> or <B>mbmosaic</B> in either Geographic coordinates, UTM coordinates,
-or any of the EPSG coordinate systems specified in the projections.dat file. This means,
-for instance, that GeoTIFF images generated with <B>mbgrdtiff</B> will be properly
-georeferenced when they are imported into ESRI <B>ArcGIS</B> or other GIS packages.
-<P>
-</DL>
-<A NAME="lbAL"> </A>
-<H3>Restructuring the code.</H3>
-
-<DL COMPACT>
-<DT>*<DD>
-All of the C code now conforms to the ANSI C standard.
-<DT>*<DD>
-The underlying input/output library (<B>MBIO</B>) has been substantially rewritten. The
-structure has been streamlined, simplifying both future development and support of
-the existing code. The <B>MBIO</B> API has been greatly modified.
-<P>
-</DL>
-<A NAME="lbAM"> </A>
-<H3>Handling of old Simrad multibeam data.</H3>
-
-<DL COMPACT>
-<DT>*<DD>
-Vendor format data from the old Simrad multibeams (pre-1997 sonars) are now
-supported by a single format id (51) rather than a separate format id for each sonar
-model. The old format id's are automatically aliased to 51, so existing shellscripts
-will continue to work.
-<DT>*<DD>
-<B>MB-System</B> no longer supports beam flagging in format 51 data. The use of mbedit and mbclean on format 51
-data will cause the flagged beams to be irrevocably nulled. Previous versions of <B>MB-System</B> used the highest bit
-in the depth values to represent beam flags because no Simrad data seemed to use that bit. We have not obtained
-data with depth values using the full bit-range, conflicting with the old beam flagging scheme. We recommend
-that old Simrad data be translated to the extended processing format (57) which contains proper beam flags and
-supports all processing functions. Format 57 is also used for processing data from the current Simrad multibeam
-sonars.
-<DT>*<DD>
-Sidescan data from old Simrad multibeams (pre-1997 sonars) are now handled in the same manner as data from
-the newer sonars (e.g. EM3000, EM3000, EM120). The raw samples in the vendor data format are binned,
-averaged, and interpolated into a 1024 pixel sidescan swath. This binned sidescan is not saved in the vendor
-format, so (as above) it is recommended that the data be translated to an extended format (57) that stores both
-bathymetry beam flags and processed sidescan.
-<P>
-</DL>
-<A NAME="lbAN"> </A>
-<H3>Streamlining of MB-System Default Parameters.</H3>
-
-<DL COMPACT>
-<DT>*<DD>
-Prior to version 5.0, the <B>MB-System</B> defaults
-set by <B>mbdefaults</B> included the format id, a control for
-ping averaging, longitude and latitude bounds for windowing
-by area, and begin and end times for windowing in time. These
-values are no longer set in the .mbio_defaults file or controlled
-by <B>mbdefaults</B>. As noted above, the format id is automatically
-identified from the filename when possible. When filenames do not
-match one of the recognized structures, users must specify the
-format using the relevant programs <B>-F</B><I>format</I> option.
-The controls for ping averaging and windowing in time and space
-are rarely used, and must now be explicitly set in command
-line arguments.
-<P>
-</DL>
-<A NAME="lbAO"> </A>
-<H3>New Data Formats.</H3>
-
-<DL COMPACT>
-<DT>*<DD>
-Furuno HS10 multibeam bathymetry is supported as format 171.
-<DT>*<DD>
-SeaBeam 2120 multibeam data in the L3 Communications XSE format are supported as format 94 (already used
-to support Elac Bottomchart MkII XSE data).
-<DT>*<DD>
-Raw STN Atlas multibeam data generated by the upgraded Hydrosweep DS2 multibeam on the R/V Ewing are
-supported by read-only format 182. Processing is supported using the augmented read-write format 183.
-<DT>*<DD>
-The IFREMER netCDF multibeam archiving data format is supported as format 75. Similarly, the IFREMER
-netCDF navigation archiving data format is supported as format 167.
-<DT>*<DD>
-The STN Atlas processing data format SURF is supported as format 181. At
-present, SURF is supported as a read-only format. This allows plotting and gridding
-of the SURF data, but not processing. Writing or translating the SURF data to
-allow processing will be supported in a later version.
-<DT>*<DD>
-The Hawaii Mapping Research Group's new MR1 format is supported as format 64.
-This format is used to disseminate data from both the HMRG
-interferometric sonars (e.g. MR1) and the WHOI DSL 120
-deep-towed inteferometric sonar. This format has been
-supported by including the code for the HMRG library libmr1pr
-in the <B>MB-System MBIO</B> library. Thanks to Roger Davis and HMRG for
-making the code available under the GPL.
-<DT>*<DD>
-The Edgetech Jstar format for sidescan and subbottom data is
-now supported as formats 132 and 133.
-<P>
-</DL>
-<A NAME="lbAP"> </A>
-<H2>THE NEW VERSION 5 DATA PROCESSING STRUCTURE</H2>
-
-Previous versions of <B>MB-System</B> have emphasized
-processing utilities that operate serially, that is, that
-read in an input swath data file, modify it, and then
-output a second swath data file. Serial processing utilities do allow
-for great flexibility in processing because one uses only
-the programs required and, in general, the order in which
-the programs are used does matter. However, one consequence of serial
-processing has been that processing data frequently results in a large
-number of intermediate data files. For instance, if
-an EM300 data file called "mbari_1998_524.mb57" has
-spikes in the bathymetry, outliers in the navigation, and
-the bathymetry has been calculated using an incorrect model
-for the water sound speed structure, users of <B>MB-System</B>
-would previously have processed it with a sequence
-something like this:
-<P>
-<BR>     1) Run <B>mbclean</B> to automatically flag
-<BR>        the obvious bathymetric artifacts.
-<BR>            Input:  mbari_1998_524.mb57
-<BR>            Output: mbari_1998_524_c.mb57
-<P>
-<BR>     2) Run <B>mbedit</B> to interactively flag
-<BR>        bathymetric artifacts.
-<BR>            Input:  mbari_1998_524_c.mb57
-<BR>            Output: mbari_1998_524_ce.mb57
-<P>
-<BR>     3) Run <B>mbnavedit</B> to interactively clean
-<BR>        the navigation.
-<BR>            Input:  mbari_1998_524_ce.mb57
-<BR>            Output: mbari_1998_524_cen.mb57
-<P>
-<BR>     4) Run <B>mbvelocitytool</B> to generate an
-<BR>        appropriate sound velocity profile (SVP) for
-<BR>        recalculating the bathymetry.
-<BR>            Input:  mbari_1998_524_cen.mb57
-<BR>            Output: good.svp
-<P>
-<BR>     5) Run <B>mbbath</B> to recalculate the
-<BR>        bathymetry using the SVP file generated
-<BR>        using <B>mbvelocitytool</B>.
-<BR>            Input:  mbari_1998_524_cen.mb57
-<BR>            Input:  good.svp
-<BR>            Output: mbari_1998_524_cenb.mb57
-<P>
-<BR>     6) Run <B>mbsimradmakess</B> to recalculate the
-<BR>            sidescan while ignoring sidescan samples
-<BR>            from beams now flagged as bad.
-<BR>            Input:  mbari_1998_524_cenb.mb57
-<BR>            Output: mbari_1998_524_cenbs.mb57
-<P>
-<BR>     7) Run <B>mbbackangle</B> to calculate an amplitude
-<BR>      vs grazing angle table for correcting
-<BR>      sidescan.
-<BR>            Input:  mbari_1998_524_cenbs.mb57
-<BR>            Output: ampvsga.dat
-<P>
-<BR>     8) Run <B>mbanglecorrect</B> to correct the sidescan.
-<BR>            Input:  mbari_1998_524_cenbs.mb57
-<BR>            Input: ampvsga.dat
-<BR>            Output: mbari_1998_524_cenbsc.mb57
-<P>
-The result of this processing includes the input swath
-data file, the final swath data file, and five
-intermediate swath data files. The impact of this approach
-on data storage requirements is obvious (though some users
-have ameliorated the issue by working with scripts that
-automatically delete unneeded data files or by piping
-data from one non-graphical process to
-another to avoid making intermediate files).
-The serial processing approach
-also presents data management problems because data files
-frequently have different processing requirements, even
-within a single survey. We have found that working with
-very large datasets can be awkward when only a minority
-of data files require navigation editing or bathymetric
-recalculation, or when some data files require multiple
-episodes of bathymetry and navigation editing.
-<P>
-<B>MB-System</B> version 5 includes new utilities implementing
-a parallel processing scheme that simplifies the processing
-of most swath data. This scheme is centered around the program
-<B>mbprocess</B>, which can accomplish the following
-processing tasks in a single step:
-<DL COMPACT><DT><DD>
-<DL COMPACT>
-<DT>*<DD>
-Merge edited navigation generated by <B>mbnavedit</B>.
-<DT>*<DD>
-Apply bathymetry edit flags from <B>mbedit</B>
-and <B>mbclean</B>
-<DT>*<DD>
-Recalculate bathymetry from raw travel time and
-angle data by raytracing through water sound speed
-models from <B>mbvelocitytool</B> or <B>mbsvplist</B>.
-<DT>*<DD>
-Apply changes to roll bias, pitch bias, heading
-bias, and draft values.
-<DT>*<DD>
-Recalculate sidescan from raw backscatter samples
-(Simrad multibeam data only).
-<DT>*<DD>
-Recalculate sidescan from raw backscatter samples
-(Simrad multibeam data only).
-<DT>*<DD>
-Correct sidescan for amplitude vs grazing angle
-patterns.
-<DT>*<DD>
-Apply tides to bathymetry.
-<BR>
-
-</DL></DL>
-
-The actions of <B>mbprocess</B> are controlled by text
-parameter files. Each <B>mbprocess</B> parameter file is
-named by adding a ".par" suffix to the associated input
-swath data file and contains single line commands that set
-processing modes and parameters. Tools such as <B>mbedit</B>,
-<B>mbnavedit</B>, and <B>mbclean</B> all generate and/or modify
-parameter files in addition to generating parallel files
-used by <B>mbprocess</B>. The program <B>mbset</B>
-can also be used to create and modify <B>mbprocess</B>
-parameter files.
-<P>
-The same processing steps described above as a serial
-processing scheme can be accomplished with the new parallel
-processing scheme as follows:
-<P>
-<BR>     1) Run <B>mbdatalist</B> to create ancillary
-<BR>        data files containing statistics
-<BR>        (".inf"), quickly read bathymetry
-<BR>        (".fbt"), and quickly read navigation
-<BR>        (".fnv"). These files are used to
-<BR>        speed common operations such as swath
-<BR>        plotting and gridding.
-<BR>            Input:  mbari_1998_524.mb57
-<BR>            Output: mbari_1998_524.mb57.inf
-<BR>                    mbari_1998_524.mb57.fbt
-<BR>                    mbari_1998_524.mb57.fnv
-<P>
-<BR>     2) Run <B>mbclean</B> to identify
-<BR>        the obvious bathymetric artifacts
-<BR>        and output a list of the edit events.
-<BR>        The parameter file is created and
-<BR>        set to apply bathymetry flags from
-<BR>        the ".esf" file.
-<BR>            Input:  mbari_1998_524.mb57
-<BR>            Output: mbari_1998_524.mb57.esf
-<BR>                    mbari_1998_524.mb57.par
-<P>
-<BR>     3) Run <B>mbedit</B> to interactively
-<BR>        identify bathymetric artifacts
-<BR>        and output a list of the edit events.
-<BR>        The existing edits from <B>mbclean</B>
-<BR>        are loaded and applied prior to editing.
-<BR>        The parameter file is updated and
-<BR>        set to apply bathymetry flags from
-<BR>        the ".esf" file.
-<BR>            Input:  mbari_1998_524.mb57
-<BR>                    mbari_1998_524.mb57.esf
-<BR>                    mbari_1998_524.mb57.par
-<BR>            Output: mbari_1998_524.mb57.esf
-<BR>                    mbari_1998_524.mb57.par
-<P>
-<BR>     4) Run <B>mbnavedit</B> to interactively
-<BR>        clean the navigation. The edited
-<BR>        navigation is output to the ".nve" file.
-<BR>        The parameter file is updated and
-<BR>        set to merge the navigation from
-<BR>        the ".nve" file.
-<BR>            Input:  mbari_1998_524.mb57
-<BR>                    mbari_1998_524.mb57.par
-<BR>            Output: mbari_1998_524.mb57.nve
-<BR>                    mbari_1998_524.mb57.par
-<P>
-<BR>     5) Run <B>mbvelocitytool</B> to generate an
-<BR>        an appropriate sound velocity profile
-<BR>        (SVP) for recalculating the bathymetry.
-<BR>        The SVP is output to the ".svp" file.
-<BR>        The parameter file is updated and
-<BR>        set to recalculate the bathymetry by
-<BR>        raytracing through the SVP model from
-<BR>        the ".svp" file.
-<BR>            Input:  mbari_1998_524.mb57
-<BR>                    mbari_1998_524.mb57.par
-<BR>            Output: mbari_1998_524.mb57.svp
-<BR>                    mbari_1998_524.mb57.par
-<P>
-<BR>     6) Run <B>mbbackangle</B> to generate an
-<BR>        a set of amplitude vs grazing angle
-<BR>        tables at regular intervals in the
-<BR>        data. These tables are placed into
-<BR>        a single ".sga" file. The parameter
-<BR>        file is updated and set to correct
-<BR>        the sidescan by interpolating the
-<BR>        amplitude vs grazing angle table for
-<BR>        each ping.
-<BR>            Input:  mbari_1998_524.mb57
-<BR>                    mbari_1998_524.mb57.par
-<BR>            Output: mbari_1998_524.mb57.sga
-<BR>                    mbari_1998_524.mb57.par
-<P>
-<BR>     7) Run <B>mbset</B> to set the parameter file
-<BR>        so that mbprocess will recalculate
-<BR>        the sidescan (this is for Simrad
-<BR>        multibeam data only) while ignoring
-<BR>        sidescan samples from beams now flagged
-<BR>        as bad.
-<BR>            Input:  mbari_1998_524.mb57.par
-<BR>            Output: mbari_1998_524.mb57.par
-<P>
-<BR>     8) Run <B>mbprocess</B> to apply the bathymetric
-<BR>        edits, merge the cleaned navigation,
-<BR>        recalculate the bathymetry, recalculate
-<BR>        the sidescan, and correct the sidescan.
-<BR>        The processed swath data is written to
-<BR>        an output swath data file. The usual
-<BR>        ancillary data files containing statistics,
-<BR>        quickly read bathymetry, and quickly
-<BR>        read navigation are also created.
-<BR>            Input:  mbari_1998_524.mb57
-<BR>                    mbari_1998_524.mb57.esf
-<BR>                    mbari_1998_524.mb57.nve
-<BR>                    mbari_1998_524.mb57.svp
-<BR>                    mbari_1998_524.mb57.aga
-<BR>                    mbari_1998_524.mb57.par
-<BR>            Output: mbari_1998_524p.mb57
-<BR>                    mbari_1998_524p.mb57.inf
-<BR>                    mbari_1998_524p.mb57.fbt
-<BR>                    mbari_1998_524p.mb57.fnv
-<P>
-The result of this processing is a single output swath
-data file. Moreover, the processed output can be easily
-updated if, for example, additional bathymetry editing
-is required. If the <B>mbedit</B> program is used again,
-it will load the existing edit events from the ".esf"
-file and then update the ".esf" file. To incorporate the
-updated bathymetry edits, one just runs <B>mbprocess</B>
-again. One can similarly change the SVP file without
-impacting on the bathymetry editing or navigation editing
-components of the processing.
-<P>
-All of the old, serial processing utilities are still
-distributed with <B>MB-System</B>. However, some of the serial
-tools have been replaced by new versions of the same name
-(e.g. <B>mbedit</B>, <B>mbclean</B>, <B>mbbackangle</B>, and <B>mbnavedit</B>).
-In these cases, the old versions are preserved as programs
-with "old" added to their names (e.g. <B>mbeditold</B>,
-<B>mbcleanold</B>, <B>mbbackangleold</B>, and <B>mbnaveditold</B>).
-<P>
-<A NAME="lbAQ"> </A>
-<H2>THE NEW VERSION 5 DATALIST FILES</H2>
-
-Previous versions of <B>MB-System</B> have used lists of
-data files, or datalists, as input to several programs
-(e.g. <B>mbgrid</B>, <B>mbmosaic</B>, <B>mbinfo</B>,
-<B>mblist</B>, and <B>mbm_plot</B>). The basic datalist
-entry has consisted of a swath data name (often including
-the entire path) followed by a space and then the <B>MB-System</B> format
-id for that file. Datalist entry lines starting with
-the character '#' are considered comments. Version 5 extends
-the definition and usage of datalists in several
-significant ways. First, datalists may now be recursive.
-A datalist entry may be another datalist file, as indicated
-by a format id of -1. Second, datalists entries may contain
-a third column which is interpreted as a gridding weight
-value by <B>mbgird</B>. This third value may be used to
-weight some data higher than other data. For example, one might
-weight SeaBeam 2112 data with a value of 1.0 and lower
-quality SeaBeam classic data with a value of 0.001. The result
-would be that the newer 2112 data effectively overlies the less good
-data wherever overlap occurs. The third new feature of datalists
-works with data processed using the new parallel processing scheme.
-In the parallel processing scheme the raw data files are often,
-but not always,
-accompanied by processed files produced by <B>mbprocess</B>.
-It is awkward to maintain datalists that directly refer to the
-current best datafiles. If one inserts the text $PROCESSED
-into the first line of a datalist containing raw files,
-then programs like <B>mbgrid</B> will read the processed file
-if it exists, but otherwise will read the raw file. Similarly,
-a first line of $RAW will force the programs to only
-read the raw files directly referenced in the datalist. These
-options also work recursively. The first instance of
-a $PROCESSED or $RAW tag will prevail over all
-others encountered through a hierarchy of recursive datalists.
-The gridding weight values will also be applied recursively,
-so one can specify the gridding weight for a large number of
-data files by applying to a datalist entry which is itself
-a datalist referencing those files. However, gridding weights
-are by default overridden by any values applied to the file
-entries themselves (this behavior can be reversed using the
-datalist tag $NOLOCALWEIGHT).
-<P>
-<A NAME="lbAR"> </A>
-<H2>VERSION 5 FILE NAMING CONVENTIONS</H2>
-
-The version 5 <B>MB-System</B> programs make extensive use
-of standardized filename suffixes. These suffixes allow
-<B>MB-System</B> programs to know what kinds of files it is working
-with, and in particular to determine swath data formats without
-the user having to specify them. Although the processing will
-generally work even if a user does not use the standard
-filenaming convention, we can guarentee that the user's work
-will be much easier if the convention is followed. Quite
-simply, the convention is for swath files to end with a
-suffix of the format ".mbXX" or ".mbXXX", where XX or XXX
-is the two digit or three digit <B>MB-System</B> format id,
-respectively. For instance, a Simrad EM3000 file in the
-processing format 57 might have a name like:
-<BR> <TT>       </TT>0053_20020518_205816.mb57<BR>
-<BR>
-
-and a Reson 8101 file in the GSF format 121 might have
-a name like:
-<BR> <TT>       </TT>039_2106.mb121<BR>
-<BR>
-
-<B>MB-System</B> programs are able to recognize many standard
-filename conventions used by sonar vendors or data logging
-package vendors. For instance, filenames with a "_raw.all"
-suffix, like:
-<BR> <TT>       </TT>0053_20020518_205816_raw.all<BR>
-<BR>
-
-are recognized as either old (format 51) or new (format 56)
-Simrad multibeam data (and the programs also determine which
-of the two formats apply). Filenames ending with ".rec" are
-recognized as SeaBeam 2100 multibeam data. Filenames ending
-with ".xse" are known to be Elac Bottomchart or SeaBeam
-2100 multibeam data in the XSE format 94. In these instances
-the program <B>mbprocess</B> will automatically replace the
-vendor suffix with the <B>MB-System</B> convention suffix when
-it creates a processed output file.
-<P>
-<A NAME="lbAS"> </A>
-<H2>LIST OF MB-SYSTEM PROGRAMS AND MACROS</H2>
-
-See the individual manual pages for detailed information about
-specific programs.
-See the manual page for <B>MBIO</B> for information about the
-i/o library and the swath sonar data formats supported by <B>MBIO</B>.
-<P>
-These are the MB-system programs which are used in the
-version 5 parallel processing scheme. Those programs that
-are also relevant to the serial processing scheme are
-marked with an *:
-<BR> <B>mb7k2jstar</B>: Extract Jstar format (format 132) sidescan
-<BR> <TT>       </TT><TT>        </TT>and subbottom data from Reson 7k (format 88)<BR>
-<BR> <TT>       </TT><TT>        </TT>data files.<BR>
-<BR> <B>mb7k2ss</B>: Extract sidescan sonar data from Reson 7k format
-<BR> <TT>       </TT><TT>        </TT>data, bins and lays the sidescan onto the<BR>
-<BR> <TT>       </TT><TT>        </TT>seafloor, and outputs files in the MBF_MBLDEOIH<BR>
-<BR> <TT>       </TT><TT>        </TT>formst (MBIO format 71).<BR>
-<BR> <B>mb7kpreprocess</B>: Preprocess Reson 7k data (MBIO format 88),
-<BR> <TT>       </TT><TT>        </TT>including applying time lag and biases to<BR>
-<BR> <TT>       </TT><TT>        </TT>attitude and navigation data.<BR>
-<BR> <B>mbhysweeppreprocess</B>: Preprocess multibeam data in the
-<BR> <TT>       </TT><TT>        </TT>Hysweep HSX format (MBIO format 201).<BR>
-<BR> <B>mbkongsbergpreprocess</B>: Preprocess data from third generation
-<BR> <TT>       </TT><TT>        </TT>Kongsberg multibeam sonars (MBIO formats 58 and 59).<BR>
-<BR> <B>mbbackangle</B>:  Generates tables of the average
-<BR> <TT>       </TT><TT>        </TT>amplitude or sidescan values as a<BR>
-<BR> <TT>       </TT><TT>        </TT>function of the grazing angle with<BR>
-<BR> <TT>       </TT><TT>        </TT>the seafloor at regular intervals in<BR>
-<TT>        </TT><TT>        </TT>the data.<BR>
-<BR> <B>mbclean</B>:  Automatically identifies and
-<BR> <TT>       </TT><TT>        </TT>flags bad beams in swath sonar<BR>
-<BR> <TT>       </TT><TT>        </TT>bathymetry data.<BR>
-<BR> <B>mbcontour</B>*:  Generate GMT compatible Postscript
-<BR> <TT>       </TT><TT>        </TT>color swath contour plots.<BR>
-<BR> <B>mbcopy</B>*:  Copy swath sonar data files.
-<BR> <B>mbdatalist</B>:  Parses recursive datalist files
-<BR>  <TT>      </TT><TT>        </TT>and outputs the  complete  list  of<BR>
-<BR> <TT>       </TT><TT>        </TT>data  files,  formats,  and  file weights.<BR>
-<BR> <B>mbdefaults</B>*:  Set or list default mbio parameters
-<BR> <TT>       </TT><TT>        </TT>for reading and writing swath sonar data<BR>
-<BR> <B>mbedit</B>:  Interactive editor used to flag bad
-<BR> <TT>       </TT><TT>        </TT>beams in swath sonar bathymetry data.<BR>
-<BR> <B>mbextractsegy</B>: Extract subbottom profiler or
-<BR> <TT>       </TT><TT>        </TT>center beam reflection data to segy files.<BR>
-<BR> <B>mbformat</B>*:   List information about swath sonar
-<BR> <TT>       </TT><TT>        </TT>data formats supported by the <B>MBIO</B> library.<BR>
-<BR> <B>mbgetesf</B>*:  Extract list of flagging or unflagging
-<BR> <TT>       </TT><TT>        </TT>beam edit events from a swath sonar data<BR>
-<BR> <TT>       </TT><TT>        </TT>file in the edit save file (".esf") format<BR>
-<BR> <TT>       </TT><TT>        </TT>used by <B>mbedit</B>, <B>mbclean</B>, and<BR>
-<BR> <TT>       </TT><TT>        </TT><B>mbprocess</B>.<BR>
-<BR> <B>mbgrdtiff</B>: Generate TIFF image from gridded data
-<BR> <B>mbgrdviz</B>: Vizualize GMT grids.
-<BR> <B>mbgrid</B>*:  Grid bathymetry, amplitude, and sidescan
-<BR> <TT>       </TT><TT>        </TT>data from swath sonar data files.<BR>
-<BR> <B>mbhistogram</B>*:  Obtain histogram of bathymetry,
-<BR> <TT>       </TT><TT>        </TT>amplitude, or sidescan data from<BR>
-<BR>  <TT>      </TT><TT>        </TT>swath sonar data files.<BR>
-<BR> <B>mbinfo</B>*:  Output some basic statistics of
-<BR> <TT>       </TT><TT>        </TT>swath sonar data files.<BR>
-<BR> <B>mblevitus</B>*:  Create a water velocity profile
-<BR> <TT>       </TT><TT>        </TT>which is representative of the mean<BR>
-<BR> <TT>       </TT><TT>        </TT>annual water column for a specified<BR>
-<BR> <TT>       </TT><TT>        </TT>1 degree by 1 degree region.<BR>
-<BR> <B>mblist</B>*:  List data in swath sonar data files.
-<BR> <B>mbmosaic</B>*:  Mosaic sidescan and amplitude data.
-<BR> <B>mbnavadjust</B>:  Interactive navigation adjustment
-<BR> <TT>       </TT><TT>        </TT>package that adjusts navigation so<BR>
-<BR> <TT>       </TT><TT>        </TT>that swath bathymetry matches where<BR>
-<BR> <TT>       </TT><TT>        </TT>swathes overlap or cross.<BR>
-<BR> <B>mbnavedit</B>:  Interactive editor used to fix
-<BR> <TT>       </TT><TT>        </TT>problems with navigation in<BR>
-<BR> <TT>       </TT><TT>        </TT>swath sonar data files.<BR>
-<BR> <B>mbnavlist</B>*:  List navigation data in swath
-<BR> <TT>       </TT><TT>        </TT>sonar data files.<BR>
-<BR> <B>mbneptune2esf</B>: Extract bathymetry edits from
-<BR> <TT>       </TT><TT>        </TT>Simrad Neptune software into edit save<BR>
-<TT>        </TT><TT>        </TT>file format.<BR>
-<BR> <B>mbprocess</B>: Performs a variety of processing
-<BR> <TT>       </TT><TT>        </TT>tasks in a single step, including<BR>
-<BR> <TT>       </TT><TT>        </TT>merging navigation, applying<BR>
-<BR> <TT>       </TT><TT>        </TT>bathymetry edits, recalculating<BR>
-<BR> <TT>       </TT><TT>        </TT>bathymetry, and recalculating<BR>
-<BR> <TT>       </TT><TT>        </TT>sidescan.<BR>
-<BR> <B>mbps</B>*:    Simple perspective views of swath
-<BR> <TT>       </TT><TT>        </TT>bathymetry in Postscript.<BR>
-<BR> <B>mbrolltimelag</B>:  Estimate attitude time lag by cross
-<BR> <TT>       </TT><TT>        </TT>correlation of apparent bottom slope with the<BR>
-<BR> <TT>       </TT><TT>        </TT>roll time series:<BR>
-<BR> <B>mbsegygrid</B>: Generate time vs. trace number
-<BR> <TT>       </TT><TT>        </TT>grids of seismic data from segy files.<BR>
-<BR> <B>mbsegyinfo</B>: Output some basic statistics of
-<BR> <TT>       </TT><TT>        </TT>segy seismic data files.<BR>
-<BR> <B>mbsegylist</B>: List selected header values in
-<BR> <TT>       </TT><TT>        </TT>segy seismic data files.<BR>
-<BR> <B>mbset</B>:  Create and modify <B>mbprocess</B>
-<BR> <TT>       </TT><TT>        </TT>parameter files.<BR>
-<BR> <B>mbsvplist</B>*:  List water sound velocity profiles in swath
-<BR> <TT>       </TT><TT>        </TT>sonar data files.<BR>
-<BR> <B>mbswath</B>*:  Generate GMT compatible Postscript
-<BR> <TT>       </TT><TT>        </TT>color and color shaded relief swath plots.<BR>
-<BR> <B>mbvelocitytool</B>*:  Interactive program for
-<BR> <TT>       </TT><TT>        </TT>modeling the affect of the water<BR>
-<BR> <TT>       </TT><TT>        </TT>velocity profile on swath sonar<BR>
-<BR> <TT>       </TT><TT>        </TT>bathymetry calculations.<BR>
-<P>
-The following are MB-system programs which are not used in the
-version 5 parallel processing scheme. These programs are
-included in the version 5 releases for backward compatibility
-with the old serial processing scheme:
-<BR> <B>mbhsdump</B>:  Lists contents of the various sorts of
-<BR> <TT>       </TT><TT>        </TT>data records in Hydrosweep DS data.<BR>
-<BR> <B>mbanglecorrect</B>:  Apply a grazing angle correction
-<BR> <TT>       </TT><TT>        </TT>to beam amplitude or sidescan data.<BR>
-<BR> <B>mbbackangle</B>:  Generates a table of the average
-<BR> <TT>       </TT><TT>        </TT>amplitude or sidescan values as a<BR>
-<BR> <TT>       </TT><TT>        </TT>function of the grazing angle with<BR>
-<BR> <TT>       </TT><TT>        </TT>the seafloor.<BR>
-<BR> <B>mbbath</B>:  Generates bathymetry from travel times
-<BR> <TT>       </TT><TT>        </TT>in swath sonar data.<BR>
-<BR> <B>mbcleanold</B>:  Old tool that utomatically
-<BR> <TT>       </TT><TT>        </TT>identifies and flags bad beams<BR>
-<BR> <TT>       </TT><TT>        </TT>in swath sonar bathymetry data.<BR>
-<BR> <B>mbcut</B>:  Removes data from portions of swath
-<BR> <TT>       </TT><TT>        </TT>as specified by the user.<BR>
-<BR> <B>mbeditold</B>:  Old interactive editor used to flag bad
-<BR> <TT>       </TT><TT>        </TT>beams in swath sonar bathymetry data.<BR>
-<BR> <B>mbfilter</B>:   Apply some simple filter functions
-<BR> <TT>       </TT><TT>        </TT>to sidescan, beam amplitude, or<BR>
-<BR> <TT>       </TT><TT>        </TT>bathymetry data.<BR>
-<BR> <B>mbgetmask</B>:  Extract list of flagged or edited
-<BR> <TT>       </TT><TT>        </TT>beams from a swath sonar data file.<BR>
-<BR> <B>mbmask</B>:  Apply editing information obtained
-<BR> <TT>       </TT><TT>        </TT>from one file with <B>mbgetmask</B><BR>
-<BR> <TT>       </TT><TT>        </TT>to another file.<BR>
-<BR> <B>mbmerge</B>:  Merge swath sonar data with new
-<BR> <TT>       </TT><TT>        </TT>navigation.<BR>
-<BR> <B>mbnaveditold</B>:  Old interactive editor used to fix
-<BR> <TT>       </TT><TT>        </TT>problems with navigation in<BR>
-<BR> <TT>       </TT><TT>        </TT>swath sonar data files.<BR>
-<BR> <B>mbrollbias</B>:  Evaluate the roll bias of a
-<BR> <TT>       </TT><TT>        </TT>swath sonar system using two pieces<BR>
-<BR> <TT>       </TT><TT>        </TT>of coincident bathymetry data<BR>
-<BR> <TT>       </TT><TT>        </TT>collected with opposing ship headings.<BR>
-<BR> <B>mbsimradmakess</B>:  Regenerate sidescan imagery
-<BR> <TT>       </TT><TT>        </TT>from the raw amplitude samples contained<BR>
-<BR> <TT>       </TT><TT>        </TT>in data from Simrad EM300 and EM3000 sonars.<BR>
-<BR> <B>mbtide</B>:  Corrects swath sonar bathymetry
-<BR> <TT>       </TT><TT>        </TT>for tide data.<BR>
-<BR> <B>mbunclean</B>:  Unflags edited beams in swath sonar
-<BR> <TT>       </TT><TT>        </TT>bathymetry data.<BR>
-<P>
-Macros are programs or shellscripts which make use of programs
-from the MB-system and other software packages to accomplish common
-tasks easily.  These are the current MB-system macros:
-<BR> <B>mbm_arc2grd</B>:  Convert an ESRI ArcView ASCII grid file
-<BR> <TT>       </TT><TT>        </TT>to a GMT grid file.<BR>
-<BR> <B>mbm_copy</B>:  Translate groups of swath data files
-<BR> <TT>       </TT><TT>        </TT>between formats<BR>
-<BR> <B>mbm_dslnavfix</B>:  Reads a WHOI DSL AMS-120 processed
-<BR> <TT>       </TT><TT>        </TT>navigation file containing UTM northings<BR>
-<BR> <TT>       </TT><TT>        </TT>and eastings and outputs a navigation file<BR>
-<BR> <TT>       </TT><TT>        </TT>containing longitude and latitude which is<BR>
-<BR> <TT>       </TT><TT>        </TT>suitable for use with <B>mbmerge</B>.<BR>
-<BR> <B>mbm_fmtvel</B>:  Scans a Hydrosweep DS data file
-<BR> <TT>       </TT><TT>        </TT>and outputs a formatted table of<BR>
-<BR> <TT>       </TT><TT>        </TT>the mean water velocity and surface<BR>
-<BR> <TT>       </TT><TT>        </TT>water velocity values used in<BR>
-<BR> <TT>       </TT><TT>        </TT>processing that data.<BR>
-<BR> <B>mbm_grd2arc</B>:  Converts a GMT grid file to an ESRI ArcView
-<BR> <TT>       </TT><TT>        </TT>ASCII grid file.<BR>
-<BR> <B>mbm_grd2geovrml</B>:  Create and execute commands which
-<BR>  <TT>      </TT><TT>        </TT>generate a TerraVision tileset and GeoVRML<BR>
-<BR> <TT>       </TT><TT>        </TT>set  of  files  that can  be combined with<BR>
-<BR> <TT>       </TT><TT>        </TT>other data and viewed in a web browser.<BR>
-<BR> <B>mbm_grd3dplot</B>:  Reads a GMT GRD grid file and
-<BR> <TT>       </TT><TT>        </TT>writes a shellscript which will<BR>
-<BR> <TT>       </TT><TT>        </TT>generate a GMT 3D perspective view<BR>
-<BR> <TT>       </TT><TT>        </TT>of the data.<BR>
-<BR> <B>mbm_grdcut</B>:  Extracts a subarea of a GMT grid file.
-<BR> <B>mbm_grdplot</B>:  Reads a GMT GRD grid file and
-<BR> <TT>       </TT><TT>        </TT>writes a shellscript which will<BR>
-<BR> <TT>       </TT><TT>        </TT>generate a GMT map of the data.<BR>
-<BR> <B>mbm_grdtiff</B>:  Reads a GMT GRD grid file and writes a
-<BR> <TT>       </TT><TT>        </TT>shellscript which will generate a TIFF image<BR>
-<BR> <TT>       </TT><TT>        </TT>of the data.<BR>
-<BR> <B>mbm_grid</B>:  Reads a swath sonar data file and writes a
-<BR> <TT>       </TT><TT>        </TT>shellscript which will grid bathymetry data or<BR>
-<BR> <TT>       </TT><TT>        </TT>mosaic sidescan (or amplitude) data using<BR>
-<BR> <TT>       </TT><TT>        </TT>reasonable guesses at the appropriate grid<BR>
-<BR> <TT>       </TT><TT>        </TT>bounds and bin size.<BR>
-<BR> <B>mbm_makedatalist</B>: Generates an MB-System datalist
-<BR> <TT>       </TT><TT>        </TT>file referencing  all identifiable swath<BR>
-<BR> <TT>       </TT><TT>        </TT>files in the specified target directory.<BR>
-<BR> <B>mbm_plot</B>:  Reads a swath sonar data file and
-<BR> <TT>       </TT><TT>        </TT>writes a shellscript which will<BR>
-<BR> <TT>       </TT><TT>        </TT>generate a swath and/or contour<BR>
-<BR> <TT>       </TT><TT>        </TT>plot of the data.<BR>
-<BR> <B>mbm_rollerror</B>:  Reads a swath sonar data file,
-<BR> <TT>       </TT><TT>        </TT>calculates the noise in the vertical reference<BR>
-<BR> <TT>       </TT><TT>        </TT>used by the sonar, and generates a file<BR>
-<BR> <TT>       </TT><TT>        </TT>containing roll corrections which<BR>
-<BR> <TT>       </TT><TT>        </TT>can be applied to the data.<BR>
-<BR> <B>mbm_route2mission</B>:  Translate an mbgrdviz survey route
-<BR> <TT>       </TT><TT>        </TT>file into an MBARI AUV mission script.<BR>
-<BR> <B>mbm_stat</B>:  Runs <B>mbinfo</B> on a swath sonar data
-<BR> <TT>       </TT><TT>        </TT>file and extracts beam statistics from<BR>
-<BR> <TT>       </TT><TT>        </TT>the output of <B>mbinfo</B>.<BR>
-<BR> <B>mbm_utm</B>: Performs forward and inverse UTM projections
-<BR> <TT>       </TT><TT>        </TT>of ASCII data triples.<BR>
-<BR> <B>mbm_vrefcheck</B>:  Generates a plot of high pass
-<BR> <TT>       </TT><TT>        </TT>filtered apparent crosstrack seafloor slope.<BR>
-<BR> <B>mbm_xbt</B>:  Processes a Sparton XBT data file
-<BR> <TT>       </TT><TT>        </TT>and outputs a sound velocity profile<BR>
-<BR> <TT>       </TT><TT>        </TT>file which can be used to process<BR>
-<BR> <TT>       </TT><TT>        </TT>swath sonar data.<BR>
-<BR> <B>mbm_xyplot</B>:  Reads one or more ASCII "X-Y"
-<BR> <TT>       </TT><TT>        </TT>data files and writes a shellscript<BR>
-<BR> <TT>       </TT><TT>        </TT>which will generate an XY plot of the data.<BR>
-<P>
-<A NAME="lbAT"> </A>
-<H2>EXAMPLE PROCESSING APPROACH</H2>
-
-<P>
-An example processing stream for swath sonar data
-which uses the new, parallel processing
-scheme is provided here. Note that a '' character at
-the end of a line indicates
-that the command line should actually continue with the
-text on the next line. Refer to individual program manual
-pages for detailed information on the command arguments and
-functionality of the various programs.
-<P>
-<A NAME="lbAU"> </A>
-<H2>PROCESSING SEABEAM 2100 DATA</H2>
-
-<P>
-The following data processing stream is recommended for
-data obtained with SeaBeam 2100 series multibeam sonars.
-A number of SeaBeam 2112 sonars were installed on academic
-research vessels during the 1990's, including the R/V Knorr
-and R/V Atlantis operated by the Woods Hole Oceanographic
-Institution, the R/V Revelle operated by the Scripps Institution
-of Oceanography, the R/V Ronald Brown operated by NOAA,
-R/V Mirai and R/V Kairai operated by JAMSTEC and other vessels.
-This same approach is appropriate for data from all other
-multibeam sonars, with small variations. The issues and
-differences associated with data from certain other types
-of sonars are discussed in the following sections.
-<P>
-Consider a data file "sb199411211212.rec"
-containing one hour's worth of
-SeaBeam 2112 data in the vendor format (format 41).
-This file contains bathymetry, beam amplitude, and
-sidescan data. The following commands
-are typical for processing such data and generating
-preliminary maps.
-<P>
-<B>Step 1</B>: What's in the data file?
-<P>
-First we run <B>mbinfo</B> to obtain statistics about the contents
-of the data file:
-<P>
-<BR> <TT>       </TT>mbinfo -I sb199411211212.mb41<BR>
-<BR>
-
-Seeing reasonable output assures us that we in fact know what
-kind of data we are processing.
-<P>
-<B>Step 2</B>: Generate ancillary files.
-<P>
-Next, we run <B>mbdatalist</B> to generate the statistics (".inf"),
-quickly read bathymetry (".fbt"), and quickly read navigation
-(".fnv") files that make many tasks run faster:
-<P>
-<BR> <TT>       </TT>mbdatalist -I sb199411211212.mb41 \<BR>
-<BR> <TT>       </TT><TT>        </TT>-N -V<BR>
-<P>
-Running this program generates three output files, which we
-call ancillary files:
-<BR> <TT>       </TT>sb199411211212.mb41.inf<BR>
-<BR> <TT>       </TT>sb199411211212.mb41.fbt<BR>
-<BR> <TT>       </TT>sb199411211212.mb41.fnv<BR>
-<P>
-<B>Step 3</B>: Generate first cut plota.
-<P>
-We are now set up to process the data. However, first
-we visually check the data by generating a swath plot
-of color filled bathymetry overlaid with contours and
-navigation. This is easily accomplished with <B>mbm_plot</B>:
-<BR> <TT>       </TT>mbm_plot -I sb199411211212.mb41 \<BR>
-<BR> <TT>       </TT><TT>        </TT>-G1 -C -N -V \<BR>
-<BR> <TT>       </TT><TT>        </TT>-O ZSwathBathCont<BR>
-<TT>        </TT>ZSwathBathCont.cmd<BR>
-<BR>
-
-Here the ZSwathBathCont represents the plot name, and multiple
-files will be generated with names constructed by adding
-different suffixes to this name. The <B>mbm_plot</B> command
-generates a shellscript called ZSwathBathCont.cmd. Running
-this shellscript in turn generates a Postscript plot called
-ZSwathBathCont.ps, and then displays the plot to the screen
-using the Postscript viewer previously specified by the user with
-<B>mbdefaults</B>. The name ZSwathBathCont is descriptive but
-arbitrary. Users may specify any name they wish.
-<P>
-The types of swath plots produced by <B>mbm_plot</B> include:
-<BR>     - color fill bathymetry with contours
-<BR>     - shaded relief color fill bathymetry
-<BR>     - color fill bathymetry overlaid with amplitude
-<BR>     - grayscale amplitude
-<BR>     - grayscale sidescan
-<P>
-We have already generated the first type of plot. We now
-generate the other four as well:
-<BR> <TT>       </TT>mbm_plot -I sb199411211212.mb41 \<BR>
-<BR> <TT>       </TT><TT>        </TT>-G2 -N -V \<BR>
-<BR> <TT>       </TT><TT>        </TT>-O ZSwathBathShade<BR>
-<BR> <TT>       </TT>ZSwathBathShade.cmd<BR>
-<BR> <TT>       </TT>mbm_plot -I sb199411211212.mb41 \<BR>
-<BR> <TT>       </TT><TT>        </TT>-G3 -S0/1 -N -V \<BR>
-<BR> <TT>       </TT><TT>        </TT>-O ZSwathBathAmp<BR>
-<BR> <TT>       </TT>ZSwathBathAmp.cmd<BR>
-<BR> <TT>       </TT>mbm_plot -I sb199411211212.mb41 \<BR>
-<BR> <TT>       </TT><TT>        </TT>-G4 -S -N -V \<BR>
-<BR> <TT>       </TT><TT>        </TT>-O ZSwathAmp<BR>
-<BR> <TT>       </TT>ZSwathAmp.cmd<BR>
-<BR> <TT>       </TT>mbm_plot -I sb199411211212.mb41 \<BR>
-<BR> <TT>       </TT><TT>        </TT>-G5 -S -N -V \<BR>
-<BR> <TT>       </TT><TT>        </TT>-O ZSwathSS<BR>
-<BR> <TT>       </TT>ZSwathSS.cmd<BR>
-<BR>
-
-We use the -S option to apply histogram equalization to
-sidescan and amplitude data; note that for the bathymetry
-overlaid with amplitude map we use -S0/1 so that the
-the amplitude data used for shading is histogram
-equalized but the bathymetry is not.
-<P>
-<B>Step 3</B>: Apply Analysis Tools
-<P>
-We now have a reasonable idea of the data quality.
-There are several data analysis and editing tools that
-may be used to fix problems (or just to further investigate
-the data). These may be used in any order, at any time.
-<P>
-<B>Analysis Option A</B>: Automatic Bathymetry Editing.
-<P>
-The program <B>mbclean</B> applies some simple artifact
-detection algorithms to the bathymetry, effectively
-providing a means of automatically editing the bathymetry.
-We generally recommend that users edit the bathymetry
-interactively (see option B below) because
-no automated filter yet approaches
-(in our opinion) the ability of the human eye and brain
-to discern the difference between interesting seafloor
-morphology and sonar artifact. In particular, none of the
-filters available in <B>mbclean</B> come remotely close to
-performing satisfactorily in general. However, many users do
-find it useful to preprocess the data with <B>mbclean</B>
-before editing in the hope that many or most of the artifacts can flagged
-automatically. Again, we emphasize the importance of not
-depending solely on automatic filters. <B>If you care about
-your data, look at it.</B>
-<P>
-When we apply <B>mbclean</B>, we usually use a filter that flags all
-soundings that deviate more than a specified fraction of
-the local median depth from that median depth (the <B>-G</B>
-option). The choice of the filter or filters and the
-filter parameters used depends very much on the nature of the
-bathymetry data being processed:
-<BR> <TT>       </TT>mbclean -I sb199411211212.mb41 -G0.9/1.1 -V<BR>
-<BR>
-
-If an "edit save file" named sb199411211212.mb41.esf already
-exists, <B>mbclean</B> reads this file and applies the
-pre-existing edits prior to beginning its filtering.
-All pre-existing edit events and all newly generated flags
-by <B>mbclean</B> are output to a new
-"edit save file", again called sb199411211212.mb41.esf.
-Since this is the first
-of the analyis programs to be run on this data file, <B>mbclean</B>
-also creates an <B>mbprocess</B> parameter file called
-sb199411211212.mb41.par which contains all of the parameters
-and settings to be used by <B>mbprocess</B> in generating a
-processed swath file. If the parameter file already existed,
-<B>mbclean</B> would modify it so that the bathymetry edits
-would be applied when <B>mbprocess</B> is run.
-<P>
-<B>Analysis Option B</B>: Interactive Bathymetry Editing.
-<P>
-We use the interactive graphical tool <B>mbedit</B> to check
-the quality of the bathymetry
-and to flag artifacts as necessary. We can start <B>mbedit</B> with
-the simple command:
-<BR> <TT>       </TT>mbedit<BR>
-<BR>
-
-and then open a swath file using the pull down menus and dialogs.
-Alternatively, we can specify the swath file on the command
-line:
-<BR> <TT>       </TT>mbedit -I sb199411211212.mb41<BR>
-<BR>
-
-While we are editing the bathymetry, all edit
-events, both flag and unflag, are
-written to an "edit save file" called sb199411211212.mb41.esf. This
-file is closed when the <Done> or <Quit> button is clicked.
-In turn, this file of edit events will be read and these events
-applied if we run <B>mbclean</B>, or <B>mbprocess</B>, or if
-we choose to run <B>mbedit</B> again. If this is the first
-of the analyis programs to be run on this data file, <B>mbedit</B>
-also creates an <B>mbprocess</B> parameter file called
-sb199411211212.mb41.par which contains all of the parameters
-and settings to be used by <B>mbprocess</B> in generating a
-processed swath file. If the parameter file already existed,
-<B>mbedit</B> would modify it so that the bathymetry edits
-would be applied when <B>mbprocess</B> is run.
-<P>
-<B>Analysis Option C</B>: Editing the navigation.
-<P>
-We use the interactive graphical tool <B>mbnavedit</B> to check
-the quality of the navigation
-and to fix problems as necessary. We can start <B>mbnavedit</B> with
-the simple command:
-<BR> <TT>       </TT>mbnavedit<BR>
-<BR>
-
-and then open a swath file using the pull down menus and dialogs.
-Alternatively, we can specify the swath file on the command
-line:
-<BR> <TT>       </TT>mbnavedit -I sb199411211212.mb41<BR>
-<BR>
-
-When we have completed editing the navigation, we click the
-<Done> or <Quit> button. The program then writes the final
-navigation to an "edited navigation" file called sb199411211212.mb41.nve.
-The program <B>mbnavedit</B>
-also modifies (or creates if needed) an <B>mbprocess</B> parameter file
-and sets it so that the edited navigation is read and merged with the
-swath data when <B>mbprocess</B> is run.
-<P>
-<B>Analysis Option D</B>: Modeling sound velocity profiles.
-<P>
-We use the interactive graphical tool <B>mbvelocitytool</B> to model
-the effect of altering the sound velocity profile (SVP) used to
-calculate bathymetry from the raw travel times and angles stored
-in the swath data. We can start <B>mbvelocitytool</B> with
-the simple command:
-<BR> <TT>       </TT>mbvelocitytool<BR>
-<BR>
-
-and then open a swath file using the pull down menus and dialogs.
-Alternatively, we can specify the swath file on the command
-line:
-<BR> <TT>       </TT>mbvelocitytool -I sb199411211212.mb41<BR>
-<BR>
-
-If the <B>Levitus</B> database has been installed, <B>mbvelocitytool</B>
-will attempt to run <B>mblevitus</B> to extract a reference sound velocity
-profile for the approximate location of the swath data file. This SVP
-will be displayed along with the editable SVP used for modeling. See
-the <B>mbvelocitytool</B> manual page for details on its operation.
-If we conclude that the bathymetry data include artifacts associated with
-having been calculated using an incorrect SVP, and we arrive through
-modeling at an SVP which is more likely correct, we save this SVP
-using the <File->Save swath svp file> menu button. Then <B>mbvelocitytool</B>
-saves the edited SVP in a file named sb199411211212.mb41.svp, and
-also sets (or creates if needed)  the parameter file sb199411211212.mb41.par
-so that <B>mbprocess</B> will recalculate
-the bathymetry by raytracing through this SVP.
-<P>
-<B>Analysis Option E</B>: Correcting sidescan data.
-<P>
-We often find that sidescan imagery, despite the best efforts
-of sonar manufacturers, is dominated by a systematic variation
-in amplitude across the swath. Most commonly, the center or nadir
-region of the swath is characterized by high amplitudes, and the
-outer swath exhibits much lower amplitudes. This effect can be
-corrected by <B>mbprocess</B> provided that an appropriate model
-for the variation in amplitude with grazing angle is available.
-Since the amplitude vs grazing angle function varies with the
-type of seafloor, we need to construct separate amplitude vs grazing angle
-correction tables at regular intervals through each swath data file.
-We use the program <B>mbbackangle</B> to construct the amplitude vs.
-grazing angle tables:
-<BR> <TT>       </TT>mbbackangle -I sb199411211212.mb41 \<BR>
-<BR> <TT>       </TT><TT>        </TT>-P25 -N161/80 -V<BR>
-<BR>
-
-Here a new table is constructed every 25 pings, and the tables
-will consist of 161 angle bins ranging from -80 degrees to +80 degress
-grazing angles. The tables are written by <B>mbbackangle</B> to an
-amplitude vs. grazing angle file called sb199411211212.mb41.sga.
-Of course, the program also sets (or creates if needed)
-the parameter file sb199411211212.mb41.par
-so that <B>mbprocess</B> will correct the sidescan.
-<P>
-<B>Step 4</B>: Process the data.
-<P>
-The program that actually takes the input, raw swath data
-and produces processed swath data is <B>mbprocess</B>. This
-program operates using the parameters listed in the
-parameter file sb199411211212.mb41.par. To process the
-data, we run
-<BR> <TT>       </TT>mbprocess -I sb199411211212.mb41<BR>
-<BR>
-
-The program produces an output processed swath file called
-sb199411211212p.mb41 (a 'p' character is inserted in the
-filename just before the <B>MB-System</B> suffix. The program
-<B>mbprocess</B> also automatically generates the three basic
-ancillary data
-files for the processed swath file:
-<BR> <TT>       </TT>sb199411211212.mb41.inf<BR>
-<BR> <TT>       </TT>sb199411211212.mb41.fbt<BR>
-<BR> <TT>       </TT>sb199411211212.mb41.fnv<BR>
-<P>
-<B>Step 5</B>: Grid the bathymetry.
-<P>
-Now use <B>mbgrid</B> to grid the bathymetry. The greatest
-depth in the file is 4502 meters (from the mbinfo output).
-The 120 degree swath is 3.4 times the water depth wide, or
-15.3 km wide. This translates to an average acrosstrack
-spacing of 15300 m / 120 = 127.5 m. If a region of a grid
-has more than one data point in each grid cell or bin, we
-say that this region is "oversampled". If some bins in a
-region have no data points, we say that this region is
-"undersampled". We choose a grid cell spacing of 150 m,
-which will cause the grid to be oversampled towards
-the center of the swath, but undersampled towards the
-edges of the swath.
-<P>
-The program <B>mbgrid</B> takes a datalist as input, so we first
-construct that file:
-<BR> <TT>       </TT>echo sb199411211212p.mb41 41 > datalist_grid<BR>
-<P>
-Now run <B>mbgrid</B> using the gaussian weighted mean algorithm
-(-F1) and longitude and latitude grid cell spacings of
-150 m (-E150/150/m) to grid bathymetry (-A1). We use
-spline interpolation to fill in small gaps in the data
-no larger than two grid cells (-C2), and we set regions
-with no data to Nan values for compatibility with
-GMT programs (-N). We also specify -M so that grids of
-data density and data standard deviation will be
-generated:
-<BR> <TT>       </TT>mbgrid -Idatalist_grid -E150/150/m \<BR>
-<BR> <TT>       </TT><TT>        </TT>-R114.2208/114.4209/-31.9001/-31.6377 \<BR>
-<BR> <TT>       </TT><TT>        </TT>-OZGridBath -A1 -N -C2 -M -V<BR>
-<P>
-The program <B>mbgrid</B> creates a shellscript which, when
-executed, will generate a color fill plot overlaid with
-contours of the gridded bathymetry. Now run that shellscript:
-<BR> <TT>       </TT>ZGridBath.cmd<BR>
-<P>
-Shellscripts have also been created to generate plots of
-the data density and standard deviation grids:
-<BR> <TT>       </TT>ZGridBath_bath_num.cmd<BR>
-<BR> <TT>       </TT>ZGridBath_bath_sd.cmd<BR>
-<P>
-<B>Step 6</B>: Mosaic the corrected sidescan data.
-<P>
-The program <B>mbmosaic</B> operates in a fashion similar to
-<B>mbgrid</B>, but has special capabilities allowing users
-to prioritize which parts of the swath are used in the
-mosaic that are useful for sidescan data. In particular,
-it is possible to create mosaics which do not use the
-nadir region of the swath except where no other data is
-available, or to create mosaics of sidescan data with
-particular look azimuths. The sidescan data has a higher
-resolution than the bathymetry so a smaller grid size
-can be appropriate. However, we wish to overlay the
-sidescan on the bathymetry, so we use the same grid
-cell spacing of 150 m.
-<P>
-In order to give the nadir region a lower priority than
-the outer parts of the sidescan swath, create a file
-of data priorities (priorities range from 0 to 1) as
-a function of apparent grazing angle (negative angles
-are on the port side of the swath, zero is at nadir,
-and positive angles are on the starboard side of the
-swath):
-<BR> <TT>       </TT>-60.0 0.2<BR>
-<BR> <TT>       </TT>-45.0 1.0<BR>
-<BR> <TT>       </TT>-15.0 0.8<BR>
-<BR> <TT>       </TT>-14.9 0.1<BR>
-<BR> <TT>       </TT>14.9 0.1<BR>
-<BR> <TT>       </TT>15.0 0.8<BR>
-<BR> <TT>       </TT>45.0 1.0<BR>
-<BR> <TT>       </TT>60.0 0.2<BR>
-<P>
-Here the nadir region has been set to a low priority and
-the highest priority has been given to data from an
-apparent grazing angle of 45 degrees.
-<P>
-Now run <B>mbmosaic</B> to mosaic the bathymetry corrected sidescan
-data (-A4):
-<BR> <TT>       </TT>mbmosaic -Idatalist_grid -E150/150/m \<BR>
-<BR> <TT>       </TT><TT>        </TT>-R114.2208/114.4209/-31.9001/-31.6377 \<BR>
-<BR> <TT>       </TT><TT>        </TT>-Wangle_priority.dat -F0.10 \<BR>
-<BR> <TT>       </TT><TT>        </TT>-OZMosaicSS -A4 -N -C2 -M -V<BR>
-<P>
-Now run the plot shellscripts to view the gridded sidescan
-data in grayscale and the ancillary data density and
-standard deviation plots:
-<BR> <TT>       </TT>ZMosaicSS.cmd<BR>
-<BR> <TT>       </TT>ZMosaicSS_num.cmd<BR>
-<BR> <TT>       </TT>ZMosaicSS_sd.cmd<BR>
-<P>
-<B>Step 7</B>: Generate additional maps of the gridded data.
-<P>
-First, we use <B>mbm_grdplot</B> to generate a color shaded
-relief view of the bathymetry. We choose to illuminate
-the bathymetry from the northeast (azimuth of 45 degrees)
-and to use a shading magnitude of 0.4 (-A0.4/45).
-Because the data has been gridded as bathymetry (positive
-down) rather than as topography (positive up), the default
-plot will have "hot" colors for deep regions and "cold"
-colors for shallow regions; this is the opposite of the
-convention we usually use. In order to fix the colors, we have
-to either rescale the data by multiplying the bathymetry
-by -1 (accomplished with -MGS-1), or flip the color
-palette (accomplished with -D). We use the latter approach.
-Finally, because this grid is so small, the default shaded
-relief image is likely to be grainy. To fix this problem, we
-specify a dots per inch resolution of 72 (-MGQ72); this
-will take longer and generate a larger plotfile, but the
-plot will look better. We also use the -L option to specify
-the title and color scale label for the plot. Here is the
-command:
-<BR> <TT>       </TT>mbm_grdplot -IZGridBath.grd \<BR>
-<BR> <TT>       </TT><TT>        </TT>-G2 -A0.4/45 -D -MGQ72 -V \<BR>
-<BR> <TT>       </TT><TT>        </TT>-L"Shaded Relief Bathymetry":"Depth (meters)" \<BR>
-<BR> <TT>       </TT><TT>        </TT>-Osb199411211212_bathshade<BR>
-<BR> <TT>       </TT>ZGridBathShade.cmd<BR>
-<P>
-Second, we use <B>mbm_grdplot</B> to generate a color fill
-view of the bathymetry overlaid with the gridded sidescan.
-The sidescan overlay is specified using the -K option.
-We want the colors for the bathymetry to be chosen without
-histogram equalization, but we also want histogram
-equalization to be applied to the sidescan data used for
-shading. To do this, we use -S0/1, where the first number
-(0) specifies no histogram equalization of the color
-scale and the second number (1) causes histogram
-equalization of the shading sidescan data to be
-implemented. In order to maintain the convention that
-high sidescan amplitudes are black, we flip both the
-color palette (as in the previous example) and the
-shading scale with -D1/1. We could also flip the shading
-by specifying a negative shading magnitude (-A-0.4).
-In this case, we forgo specifying the image resolution,
-resulting in a grainy plot:
-<BR> <TT>       </TT>mbm_grdplot -IZGridBath.grd \<BR>
-<BR> <TT>       </TT><TT>        </TT>-G3 -KZMosaicSS.grd \<BR>
-<BR> <TT>       </TT><TT>        </TT>-S0/1 -D1/1 -A0.4 -V \<BR>
-<BR> <TT>       </TT><TT>        </TT>-L"Bathymetry Overlaid With Sidescan":"Depth (meters)" \<BR>
-<BR> <TT>       </TT><TT>        </TT>-OZGridBathSS<BR>
-<BR> <TT>       </TT>ZGridBathSS.cmd<BR>
-<P>
-<B>Step 8</B>: Generate 3D perspective views of the gridded data.
-<P>
-Now, generate a 3D perspective view of the gridded
-bathymetry with shading through synthetic illumination (-G2)
-using the macro <B>mbm_grd3dplot</B>. The grid file is in
-bathymetry (positive down) rather in topography (positive
-up), so the bathymetry needs to be rescaled by multiplying
-by -1 (-MGS-1). We choose an illumination magnitude of 0.4
-and an illumination azimuth of 45 degrees (-A0.4/45). We
-also choose a perspective azimuth of 250 degrees and an
-elevation of 30 degrees (-E240/30):
-<BR> <TT>       </TT>mbm_grd3dplot -IZGridBath.grd \<BR>
-<BR> <TT>       </TT><TT>        </TT>-G2 -A0.4/45 -E250/30 -MGS-1 -V \<BR>
-<BR> <TT>       </TT><TT>        </TT>-OZGridBath3D<BR>
-<BR> <TT>       </TT>ZGridBath3D.cmd<BR>
-<P>
-Now, generate a 3D perspective view of the gridded
-bathymetry shaded using the gridded sidescan data
-(-KZMosaicSS.grd). We want the sidescan data to
-be histogram equalized, so we use -S0/1. We also want
-the shading to be more prominent than the default
-shading magnitude of 0.2 would produce, so we use -A0.5:
-<BR> <TT>       </TT>mbm_grd3dplot -IZGridBath.grd \<BR>
-<BR> <TT>       </TT><TT>        </TT>-KZMosaicSS.grd \<BR>
-<BR> <TT>       </TT><TT>        </TT>-G3 -A0.5 -E250/30 -D0/1 -S0/1 -MGS-1 -V \<BR>
-<BR> <TT>       </TT><TT>        </TT>-Osb199411211212_bathss3d<BR>
-<BR> <TT>       </TT>ZGridBathSS3D.cmd<BR>
-<P>
-<A NAME="lbAV"> </A>
-<H2>PROCESSING THIRD GENERATION KONGSBERG MULTIBEAM DATA</H2>
-
-<P>
-The current generation of Kongsberg multibeam sonars (EM122, EM302, EM710)
-record data in files typically named with a *.all suffix. These binary
-files consist of many different data records, most of which are
-similarly structure but distinct from the records output by the
-earlier generations of Kongsberg (formerly Simrad) multibeams described
-in a later section. The raw Kongsberg format is supported in <B>MB-System</B>
-as format 58. However, format 58 lacks places to store some information
-that is important to processing. In particular, the raw Kongsberg format
-does not store beam flags, so the only to apply bathymetry edits is
-to null the flagged beams. This is not recommended, as it precludes
-unflagging flagged beams later determined to be good.
-<P>
-Also, the raw Kongsberg format stores the initial sidescan samples derived from subsampling
-the bottom returns in each of the formed beams. The locations of these
-samples on the seafloor are irregular, and the number of samples varies
-greatly from ping to ping. This raw sidescan is not well suited for
-mapmaking or processing because of the irregular locations. <B>MB-System</B>
-automatically bins and averages the available sidescan samples into
-a regularly spaced 1024 pixels with pixel sizes that vary only slightly
-from ping to ping. This resampled sidescan is what appears in swath plots
-and in the statistics reported by <B>mbinfo</B>. The raw format has no
-space to store the rebinned sidescan, so any corrections or other
-processing applied to the sidescan in formats 58 is lost.
-<P>
-We have defined a processing format (59) for Kongsberg multibeam that stores
-beam flags and rebinned sidescan in addition to all of the information
-in the raw file format 58. We strongly recommend that third generation
-Kongsberg multibeam data be translated into format 59 before processing. This can
-be accomplished, albeit unsatisfactorily, with mbcopy. For example, given a raw EM122 file called
-0006_20111219_201329_METEOR_EM122.all, we can translate it to format 59 using:
-<BR> <TT>       </TT>mbcopy -F58/59 -I 0006_20111219_201329_METEOR_EM122.all \<BR>
-<BR> <TT>       </TT><TT>        </TT>-O 0006_20111219_201329_METEOR_EM122.mb59<BR>
-<BR>
-
-If we have a number of EM122 files referenced through a datalist file called
-datalist_raw.mb-1, we can translate all of them using the macro <B>mbm_copy</B>:
-<BR> <TT>       </TT>mbm_copy -F59 -I datalist_raw.mb-1<BR>
-<BR>
-
-This macro simply executes <B>mbcopy</B> for each of the data referenced in
-the input datalist structure.
-<P>
-The problem with using <B>mbcopy</B> for translation
-between formats 58 and 59 is that the navigation, heading, and attitude
-contained in format 58 files are purely asynchronous, which means these values
-are defined according to their own time stamps and not the time stamps
-of the multibeam sonar pings. When format 58 data are read, the navigation,
-heading and attitude values must be read from their own data records and
-interpolated (or extrapolated) onto the time stamps of the multibeam pings
-for each survey record. This works fine if the relevant asynchronous navigation
-and attitude data are always found in the data files before the survey data
-from the same time, but that advantageious timing is neither assured nor common.
-A better approach is to use the tool <B>mbkongsbergpreprocess</B> to preprocess
-the Kongsberg multibeam data. This program makes two passes through reading
-each input file, the first to read and store the navigation and attitude data,
-and the second to properly interpolate the navigation and attitude values onto the
-multibeam survey pings. The usage is of the form:
-<BR> <TT>       </TT>mbkongsbergpreprocess -I datalist_raw.mb-1 -V<BR>
-<P>
-One further feature of Simrad multibeam data processing should be noted.
-Given that the raw sidescan samples are derived directly from the
-bottom returns identified by the sonar for each beam, it follows that
-whenever a bottom return pick is erroneous, the sidescan samples
-associated with that beam are also erroneous. Consequently, the binned
-sidescan shoulde be reprocessed following the application of beam flags
-to exclude the incorrect sidescan samples from the final imagery.
-Recalculating the Simrad sidescan is an <B>mbprocess</B> option which
-can set using <B>mbset</B>. To turn on sidescan calculation, we use:
-<BR> <TT>       </TT>mbset -I 0006_20111219_201329_METEOR_EM122.mb59 \<BR>
-<BR> <TT>       </TT><TT>        </TT>=PSSRECALCMOD:1 -V<BR>
-<BR>
-
-We can also turn off sidescan recalculation using:
-<BR> <TT>       </TT>mbset -I 0006_20111219_201329_METEOR_EM122.mb59 \<BR>
-<BR> <TT>       </TT><TT>        </TT>=PSSRECALCMOD:0 -V<BR>
-<P>
-In practice, <B>mbedit</B>, <B>mbeditviz</B> and <B>mbclean</B> automatically set the
-parameter file to turn on sidescan recalculation when writing an
-"edit save file" for format 59 data, so users should not have
-to set this parameter manually.
-<P>
-<A NAME="lbAW"> </A>
-<H2>PROCESSING OLDER KONGSBERG (FORMERLY SIMRAD) MULTIBEAM DATA</H2>
-
-<P>
-The older series of Simrad multibeam sonars (EM100, EM950, EM1000, EM12,
-EM12D, EM121A) recorded raw data
-in files typically named with an "_raw.all" suffix. These older data
-are supported in <B>MB-System</B> using format 51. The data
-from the second generation Simrad (Kongsberg) multibeams (EM3000, EM2000, EM1002, EM300,
-EM120) also come in files with the "_raw.all" suffix, but the
-format is different, and is supported by <B>MB-System</B> as format
-56. <B>MB-System</B> programs can automatically discern the difference
-between the two formats, and so the initial identification of the
-data type is easy with <B>mbinfo</B>.
-<P>
-However, both formats 51 and 56 lack places to store some information
-that is important to processing. In particular, the raw Simrad formats
-do not store beam flags, so the only to apply bathymetry edits is
-to null the flagged beams. This is not recommended, as it precludes
-unflagging flagged beams later determined to be good.
-<P>
-Also, the raw
-Simrad formats store the initial sidescan samples derived from subsampling
-the bottom returns in each of the formed beams. The locations of these
-samples on the seafloor are irregular, and the number of samples varies
-greatly from ping to ping. This raw sidescan is not well suited for
-mapmaking or processing because of the irregular locations. <B>MB-System</B>
-automatically bins and averages the available sidescan samples into
-a regularly spaced 1024 pixels with pixel sizes that vary only slightly
-from ping to ping. This resampled sidescan is what appears in swath plots
-and in the statistics reported by <B>mbinfo</B>. The raw formats have no
-space to store the rebinned sidescan, so any corrections or other
-processing applied to the sidescan in formats 51 and 56 is lost.
-<P>
-We have defined a processing format (57) for Simrad multibeam that stores
-beam flags and rebinned sidescan in addition to all of the information
-in either of the raw file formats (51 and 56).
-We strongly recommend that Simrad multibeam data from both old and
-newer sonars be translated into format 57 before processing. This is
-accomplished with mbcopy. For example, given a raw EM1000 file called
-0021_19960714_123418_raw.all, we translate it to format 57 using:
-<BR> <TT>       </TT>mbcopy -F51/57 -I 0021_19960714_123418_raw.all \<BR>
-<BR> <TT>       </TT><TT>        </TT>-O 0021_19960714_123418_raw.mb57<BR>
-<BR>
-
-Similarly, given a raw EM300 file called
-0005_20020425_034057_raw.all, we translate it to format 57 using:
-<BR> <TT>       </TT>mbcopy -F56/57 -I 0005_20020425_034057_raw.all \<BR>
-<BR> <TT>       </TT><TT>        </TT>-O 0005_20020425_034057.mb57<BR>
-<P>
-One further feature of Simrad multibeam data processing should be noted.
-Given that the raw sidescan samples are derived directly from the
-bottom returns identified by the sonar for each beam, it follows that
-whenever a bottom return pick is erroneous, the sidescan samples
-associated with that beam are also erroneous. Consequently, the binned
-sidescan shoulde be reprocessed following the application of beam flags
-to exclude the incorrect sidescan samples from the final imagery.
-Recalculating the Simrad sidescan is an <B>mbprocess</B> option which
-can set using <B>mbset</B>. To turn on sidescan calculation, we use:
-<BR> <TT>       </TT>mbset -I 0005_20020425_034057.mb57 \<BR>
-<BR> <TT>       </TT><TT>        </TT>=PSSRECALCMOD:1 -V<BR>
-<BR>
-
-We can also turn off sidescan recalculation using:
-<BR> <TT>       </TT>mbset -I 0005_20020425_034057.mb57 \<BR>
-<BR> <TT>       </TT><TT>        </TT>=PSSRECALCMOD:0 -V<BR>
-<P>
-In practice, <B>mbedit</B> and <B>mbclean</B> automatically set the
-parameter file to turn on sidescan recalculation when writing an
-"edit save file" for format 57 data, so users should not have
-to set this parameter manually.
-<P>
-<A NAME="lbAX"> </A>
-<H2>PROCESSING HYDROSWEEP DS DATA</H2>
-
-<P>
-Hydrosweep DS sonars were used on the R/V Maurice
-Ewing (operated by the Lamont-Doherty Earth Observatory
-and the R/V Thomas Thompson (operated by the University of
-Washington) from the early 1990's until 2001. The raw data
-was logged in a text format (21) that is slow to read and write.
-We recommend that users confronted with format 21 data translate
-it to format 24 before processing. Format 24 is a binary data
-format that contains all of the information in the raw file,
-but is on the order of 15 times faster to read and write.
-We accomplish the translation using <B>mbcopy</B>:
-<BR>  <TT>      </TT>mbcopy -F21/24 -Ihs_ew9204_134.mb21 \<BR>
-<BR> <TT>       </TT><TT>        </TT>-Ohsih_ew9204_134.mb24<BR>
-<BR>
-
-We also strongly recommend that users of Hydrosweep DS data
-recalculate the bathymetry using raytracing through an
-appropriate SVP, whether obtained using <B>mblevitus</B>,
-<B>mbvelocitytool</B>, or from other sources. The sonar
-calculates the raw bathymetry using a homogeneous water
-velocity model, and the results are almost always inferior
-to those obtained by doing the full raytracing calculations
-with a correct SVP.
-<P>
-Hydrosweep DS data do not contain sidescan, but they do
-contain per beam amplitude data. The amplitude data may
-be corrected in the same fashion as the sidescan. We
-run <B>mbbackangle</B> with the <B>-A</B><I>1</I> option
-to operate on the amplitude data:
-<BR> <TT>       </TT>mbbackangle -I sb199411211212.mb41 \<BR>
-<BR> <TT>       </TT><TT>        </TT>-A1 -P25 -N161/80 -V<BR>
-<BR>
-
-and then run <B>mbprocess</B> as usual.
-<P>
-<A NAME="lbAY"> </A>
-<H2>PROCESSING HYDROSWEEP MD DATA</H2>
-
-<P>
-Processing Hydrosweep MD data is similar to processing
-Hydrosweep DS data. In particular, recalculating
-bathymetry from the travel times is necessary because
-the sonar uses a homogeneous water velocity model.
-The difference is simply in the data formats used.
-The raw Hydrosweep MD data files (typically named
-with a ".R" suffix) contain only the travel times; the
-sonar calculated bathymetry is contained in parallel
-files (typically named with a ".P" suffix). The
-".R" files are supported as format 101. Format 102
-data files contain bathymetry in addition to the travel
-times. To translate the data from format 101 to 102 we
-use:
-<BR>  <TT>      </TT>mbcopy -F101/102 -Iys9409040607.R \<BR>
-<BR> <TT>       </TT><TT>        </TT>-Oys9409040607.mb102<BR>
-<BR>
-
-Bathymetry equivalent to that generated by the sonar
-will automatically be calculated in the copy process
-(the data stream includes the mean water velocity used
-by the sonar).
-<P>
-Hydrosweep MD data do not contain sidescan, but they do
-contain per beam amplitude data. The amplitude data may
-be corrected in the same fashion as the sidescan. We
-run <B>mbbackangle</B> with the <B>-A</B><I>1</I> option
-to operate on the amplitude data:
-<BR> <TT>       </TT>mbbackangle -I sb199411211212.mb41 \<BR>
-<BR> <TT>       </TT><TT>        </TT>-A1 -P25 -N161/80 -V<BR>
-<BR>
-
-and then run <B>mbprocess</B> as usual.
-<P>
-<A NAME="lbAZ"> </A>
-<H2>SEE ALSO</H2>
-
-<B><A HREF="mbio.html">mbio</A></B>(1)
-<P>
-<A NAME="lbBA"> </A>
-<H2>BUGS</H2>
-
-It doesn't do everything we want it to yet, it doesn't work with
-every kind of swath data ever collected, and sometimes it
-breaks.
-<P>
-
-<HR>
-<A NAME="index"> </A><H2>Index</H2>
-<DL>
-<DT><A HREF="#lbAB">NAME</A><DD>
-<DT><A HREF="#lbAC">VERSION</A><DD>
-<DT><A HREF="#lbAD">AUTHORSHIP</A><DD>
-<DT><A HREF="#lbAE">INTRODUCTION</A><DD>
-<DT><A HREF="#lbAF">COPYRIGHT AND LICENSING</A><DD>
-<DT><A HREF="#lbAG">HISTORY</A><DD>
-<DT><A HREF="#lbAH">WHAT'S NEW ABOUT VERSION 5</A><DD>
-<DL>
-<DT><A HREF="#lbAI">A new approach to managing data processing.</A><DD>
-<DT><A HREF="#lbAJ">New tools.</A><DD>
-<DT><A HREF="#lbAK">Support for Projected Coordinate Systems.</A><DD>
-<DT><A HREF="#lbAL">Restructuring the code.</A><DD>
-<DT><A HREF="#lbAM">Handling of old Simrad multibeam data.</A><DD>
-<DT><A HREF="#lbAN">Streamlining of MB-System Default Parameters.</A><DD>
-<DT><A HREF="#lbAO">New Data Formats.</A><DD>
-</DL>
-<DT><A HREF="#lbAP">THE NEW VERSION 5 DATA PROCESSING STRUCTURE</A><DD>
-<DT><A HREF="#lbAQ">THE NEW VERSION 5 DATALIST FILES</A><DD>
-<DT><A HREF="#lbAR">VERSION 5 FILE NAMING CONVENTIONS</A><DD>
-<DT><A HREF="#lbAS">LIST OF MB-SYSTEM PROGRAMS AND MACROS</A><DD>
-<DT><A HREF="#lbAT">EXAMPLE PROCESSING APPROACH</A><DD>
-<DT><A HREF="#lbAU">PROCESSING SEABEAM 2100 DATA</A><DD>
-<DT><A HREF="#lbAV">PROCESSING THIRD GENERATION KONGSBERG MULTIBEAM DATA</A><DD>
-<DT><A HREF="#lbAW">PROCESSING OLDER KONGSBERG (FORMERLY SIMRAD) MULTIBEAM DATA</A><DD>
-<DT><A HREF="#lbAX">PROCESSING HYDROSWEEP DS DATA</A><DD>
-<DT><A HREF="#lbAY">PROCESSING HYDROSWEEP MD DATA</A><DD>
-<DT><A HREF="#lbAZ">SEE ALSO</A><DD>
-<DT><A HREF="#lbBA">BUGS</A><DD>
-</DL>
-<HR>
-</PRE>
-
-<CENTER><P><BR>
-Last Updated: 26 January 2015</P></CENTER>
-
-<HR>
-<P><A HREF="mbsystem_man_list.html">Return to list of MB-System manual pages...</A></P>
-<P><A HREF="mbsystem_home.html"><IMG SRC="mbsystem_logo_small.gif" BORDER=0 HEIGHT=55 WIDTH=158 ALIGN=BOTTOM></A><A HREF="mbsystem_home.html">Back
-to MB-System Home Page...</A></P>
-
-</BODY>
-</HTML>
diff --git a/src/html/mbsystem_capabilities.html b/src/html/mbsystem_capabilities.html
deleted file mode 100644
index fb41b5e..0000000
--- a/src/html/mbsystem_capabilities.html
+++ /dev/null
@@ -1,254 +0,0 @@
-<!DOCTYPE html PUBLIC "-//w3c//dtd html 4.0 transitional//en">
-<html>
-<head>
-  <title>MB-System Capabilities</title>
-  <meta content="text/html" http-equiv="Content-Type">
-  <meta content="MB-System: Mapping the Seafloor" name="Title">
-  <meta content="David Caress, Dale Chayes" name="Author">
-  <meta
- content="open source software for processing bathymetry and backscatter data from multibeam and sidescan sonar"
- name="Description">
-  <meta
- content="seafloor,mapping,multibeam,sonar,bathymetry,sidescan,swath processing,open,source,software"
- name="Keywords">
-</head>
-<body alink="#cc9900" bgcolor="#ffffff" link="#336699" text="#000000"
- vlink="#997040">
-<center>
-<h4><u>Short List of MB-System Capabilities:</u></h4>
-</center>
-<ul>
-  <li>General Documentation</li>
-  <ul>
-    <li>MB-System manual page: <a href="mbsystem.html">mbsystem</a></li>
-    <li>MB-System I/O library manual page: <a href="mbio.html">mbio</a></li>
-  </ul>
-</ul>
-<ul>
-  <li>Version 5 Programs and Macros:</li>
-These are the programs and macros that are used in the version 5
-parallel processing
-scheme. Those programs that are also relevant to the older serial
-processing
-scheme are marked with an *.
-  <ul>
-    <li>General Functions</li>
-    <ul>
-      <li>List swath data formats supported by MB-System: <a
- href="mbformat.html">mbformat</a>*</li>
-      <li>Get swath data file information and statistics: <a
- href="mbinfo.html">mbinfo</a>*</li>
-      <li>Produce arbitrary ascii tables from swath data: <a
- href="mblist.html">mblist</a>*</li>
-      <li>Copy swath data with optional time/space windowing and format
-change: <a href="mbcopy.html">mbcopy</a>*</li>
-      <li>Translate groups of swath data files between formats: <a
- href="mbm_copy.html">mbm_copy</a></li>
-      <li>Translate groups of swath data files between formats using parallel processes: <a
- href="mbm_multicopy.html">mbm_multicopy</a></li>
-      <li>Set MB-System default parameters: <a href="mbdefaults.html">mbdefaults</a>*</li>
-      <li>List files referenced in a recursive datalist file tree: <a
- href="mbdatalist.html">mbdatalist</a></li>
-      <li>Generate ancilliary files used in data managment: <a
- href="mbdatalist.html">mbdatalist</a></li>
-      <li>Generate ancilliary files used in data managment using parallel processes: <a
- href="mbm_multidatalist.html">mbm_multidatalist</a></li>
-      <li>Generate an MB-System datalist file referencing all
-identifiable swath files in the specified target directory.: <a
- href="mbm_makedatalist.html">mbm_makedatalist</a></li>
-      <li>Create or modify parameter files used to control mbprocess: <a
- href="mbset.html">mbset</a></li>
-      <li>Apply specified processing tasks to a swath data file: <a
- href="mbprocess.html">mbprocess</a></li>
-      <li>Apply specified processing tasks to a swath data file using parallel processes: <a
- href="mbm_multiprocess.html">mbm_multiprocess</a></li>
-      <li>Convert between calendar time and unix time: <a href="mbtime.html">mbtime</a></li>
-    </ul>
-    <li>Water Properties Utilities</li>
-    <ul>
-      <li>Obtain reference water sound velocity profile (SVP): <a
- href="mblevitus.html">mblevitus</a>*</li>
-      <li>Calculate water sound absorption from water properties: <a href="mbabsorption.html">mbabsorption</a></li>
-      <li>List CTD data in swath sonar data files: <a href="mbctdlist.html">mbctdlist</a></li>
-      <li>Process data from a Seabird SBE53 pressure sensor into a tidal model for
-       use by mbprocess: <a href="mbm_bpr.html">mbm_bpr</a></li>
-      <li>Generate a sound velocity profile model from sound speed and depth values in swath files: <a href="mbm_makesvp.html">mbm_makesvp</a></li>
-      <li>Extract water sound velocity profiles
-(SVPs) from swath data files: <a href="mbsvplist.html">mbsvplist</a></li>
-  	  <li>Select the best
-available sound speed model for each swath file in a survey according to 
-user specified criteria: <a href="mbsvpselect.html">mbsvpselect</a></li>
-    </ul>
-    <li>Navigation Data Processing</li>
-    <ul>
-      <li>Interactive navigation editor: <a href="mbnavedit.html">mbnavedit</a></li>
-      <li>List navigation from ping records in a swath data file: <a
- href="mblist.html">mblist</a></li>
-      <li>List navigation from navigation records in a swath data file:
-        <a href="mbnavlist.html">mbnavlist</a></li>
-      <li>Create or modify parameter files used to control mbprocess: <a
- href="mbset.html">mbset</a></li>
-      <li>Merge navigation with swath data file (among other tasks): <a
- href="mbprocess.html">mbprocess</a></li>
-      <li>Adjust navigation to match bathymetric features in
-overlapping swathes: <a href="mbnavadjust.html">mbnavadjust</a></li>
-      <li>Merge two MBnavadjust projects: <a href="mbnavadjustmerge.html">mbnavadjustmerge</a></li>
-      <li> Merge inertial
-and surface tracking navigation for
-submerged sonar platforms (e.g. ROVs and AUVs): <a
- href="mbauvnavusbl.html">mbauvnavusbl</a></li>
-  <li> Output a list of the times when a survey passes the waypoints of a planned survey route: <a href="mbroutetime.html">mbroutetime</a></li>
-    </ul>
-
-    <li>Patch Test Analyis
-      <ul>
-        <li>Interactive 3D visualization data cleaning and attitude bias patch test: <a href="mbeditviz.html">mbeditviz</a></li>
-      </ul>
-    </li>
-    <li>Bathymetry Data Processing</li>
-    <ul>
-      <li>Automatic bathymetry data cleaning: <a
- href="mbareaclean.html">mbareaclean</a></li>
-      <li>Automatic bathymetry data cleaning: <a href="mbclean.html">mbclean</a></li>
-      <li>Interactive bathymetry data cleaning: <a href="mbedit.html">mbedit</a></li>
-      <li>Interactive 3D visualization data cleaning and attitude bias patch test: <a href="mbeditviz.html">mbeditviz</a></li>
-      <li>Extract bathymetry edits in edit save file format: <a
- href="mbgetesf.html">mbgetesf</a></li>
-      <li>Extract bathymetry edits from Simrad Neptune software into
-edit save file format: <a href="mbneptune2esf.html">mbneptune2esf</a></li>
-      <li>Obtain reference water sound velocity profile (SVP): <a
- href="mblevitus.html">mblevitus</a>*</li>
-      <li>Interactive modeling of SVP effects on bathymetry: <a
- href="mbvelocitytool.html">mbvelocitytool</a>*</li>
-      <li>Extract water sound velocity profiles
-(SVPs) from swath data files: <a href="mbsvplist.html">mbsvplist</a></li>
-  	  <li>Select the best
-available sound speed model for each swath file in a survey according to 
-user specified criteria: <a href="mbsvpselect.html">mbsvpselect</a></li>
-      <li>Create or modify parameter files used to control mbprocess: <a
- href="mbset.html">mbset</a></li>
-      <li>Recalculate or correct swath bathymetry and apply bathymetry
-edits from
-mbedit and mbclean: <a href="mbprocess.html">mbprocess</a></li>
-      <li>Obtain histogram of bathymetry data: <a
- href="mbhistogram.html">mbhistogram</a>*</li>
-      <li>Automatically grid bathymetry data: <a href="mbm_grid.html">mbm_grid</a>*</li>
-      <li>Grid bathymetry data: <a href="mbgrid.html">mbgrid</a>*</li>
-      <li>Extract subarea of GMT grid file: <a href="mbm_grdcut.html">mbm_grdcut</a>*</li>
-      <li>Perform forward and inverse UTM projections of ASCII data
-triples: <a href="mbm_utm.html">mbm_utm</a>*</li>
-      <li>Estimate attitude time lag by cross correlation of apparent
-bottom slope with the roll time series: <a href="mbrolltimelag.html">mbrolltimelag</a></li>
-    </ul>
-    <li>Sidescan and Amplitude Data Processing</li>
-    <ul>
-      <li>Obtain grazing angle correction tables from
-sidescan/amplitude data for
-use by mbprocess: <a href="mbbackangle.html">mbbackangle</a></li>
-      <li>Create or modify parameter files used to control mbprocess: <a
- href="mbset.html">mbset</a></li>
-      <li>Correct sidescan/amplitude data using tables generated by
-mbbackangle: <a href="mbprocess.html">mbprocess</a></li>
-      <li>Automatically mosaic sidescan/amplitude data: <a
- href="mbm_grid.html">mbm_grid</a>*</li>
-      <li>Mosaic sidescan/amplitude data: <a href="mbmosaic.html">mbmosaic</a>*</li>
-      <li>Grid sidescan/amplitude data: <a href="mbgrid.html">mbgrid</a>*</li>
-      <li>Extract subarea of GMT grid file: <a href="mbm_grdcut.html">mbm_grdcut</a>*</li>
-    </ul>
-    <li>Grid Vizualization</li>
-    <ul>
-      <li>GMT grid vizualization and survey planning: <a
- href="mbgrdviz.html">mbgrdviz</a>*</li>
-    </ul>
-    <li>Survey planning</li>
-    <ul>
-      <li>GMT grid vizualization and survey planning: <a
- href="mbgrdviz.html">mbgrdviz</a>*</li>
-      <li>Translate an mbgrdviz survey route file into an MBARI AUV
-mission script: <a href="mbm_route2mission.html">mbm_route2mission</a>*</li>
-    </ul>
-    <li>Postscript Graphics</li>
-    <ul>
-      <li>GMT compatible swath contouring: <a href="mbcontour.html">mbcontour</a>*</li>
-      <li>GMT compatible swath color fill plotting: <a
- href="mbswath.html">mbswath</a>*</li>
-      <li>Macro to generate GMT map of swath data:<a
- href="mbm_plot.html">
-mbm_plot</a>*</li>
-      <li>Macro to generate GMT map of gridded data: <a
- href="mbm_grdplot.html">mbm_grdplot</a>*</li>
-      <li>Macro to generate GMT perspective view of gridded data: <a
- href="mbm_grd3dplot.html">mbm_grd3dplot</a>*</li>
-      <li>Macro to generate GMT plot of xy data: <a
- href="mbm_xyplot.html">mbm_xyplot</a>*</li>
-      <li>Macro to generate GMT histogram plot of data: <a
- href="mbm_histplot.html">mbm_histplot</a>*</li>
-    </ul>
-    <li>Exporting Data Products to GIS and Visualization Packages</li>
-    <ul>
-      <li>Generate GeoTIFF image from GMT grid files: <a
- href="mbgrdtiff.html">mbgrdtiff</a>*</li>
-      <li>Macro to generate GeoTIFF image of gridded data: <a
- href="mbm_grdtiff.html">mbm_grdtiff</a>*</li>
-      <li>Convert GMT grid file to ArcView ASCII grid file: <a
- href="mbm_grd2arc.html">mbm_grd2arc</a>*</li>
-      <li>Convert ArcView ASCII grid file to GMT grid file: <a
- href="mbm_arc2grd.html">mbm_arc2grd</a>*</li>
-      <li>Convert GMT grid file to a set of tiled GeoVRML files: <a
- href="mbm_arc2grd.html">mbm_grd2geovrml</a>*</li>
-    </ul>
-    <li>Subbottom profiler (and center beam reflection) data processing</li>
-    <ul>
-      <li>Extract subbottom profiler data to segy files: <a
- href="mbextractsegy.html">mbextractsegy</a></li>
-      <li>Get segy data file information and statistics: <a
- href="mbsegyinfo.html">mbsegyinfo</a></li>
-      <li>Produce arbitrary ascii tables from segy data files: <a
- href="mbsegylist.html">mbsegylist</a></li>
-      <li>Grid seismic data from segy data files: <a
- href="mbsegygrid.html">mbsegygrid</a></li>
-      <li>Generate Power Spectral Density (PSD) estimates from segy data files: <a href="mbsegypsd.html">mbsegypsd</a></li>
-    </ul>
-    <li>Tide modeling and correction</li>
-    <ul>
-      <li>Generate open ocean tidal model using the Oregon State Ocean Tide Prediction Software (OTPSnc) package: <a href="mbotps.html">mbotps</a><br>
-      </li>
-    </ul>
-    <li>Format-specific processing, extraction, or translation</li>
-    <ul>
-      <li>Preprocess Reson 7k data (format 88), including applying time
-        lag and biases to attitude and navigation data: <a
- href="mb7kpreprocess.html">mb7kpreprocess</a></li>
-      <li> Preprocess data from third generation Kongsberg
-    multibeam sonars (e.g. EM122, EM302, EM710): <a href="mbkongsbergpreprocess.html">mbkongsbergpreprocess</a></li>
-      <li>List raw information contained in Hydrosweep DS data files (formats 21 and 24): <a href="mbhsdump.html">mbhsdump</a></li>
-      <li>Preprocess HYSWEEP HSX data (format 201), including applying time
-        lag and biases to attitude and navigation data: <a
- href="mbhysweeppreprocess.html">mbhysweeppreprocess</a></li>
-      <li>Preprocess SwathPlus SXP data (format 222), including applying time
-        lag and biases to attitude and navigation data: <a
- href="mbswplspreprocess.html">mbswplspreprocess</a></li>
-  <li>Scan a Hydrosweep swath sonar data file using the  program  mbhsdump  and generate a list in columnar format with time, date, latitude, longitude, C-mean, and C-keel entrys: <a href="mbm_fmtvel.html">mbm_fmtvel</a></li>
-      <li>Extract Jstar format (format 132) sidescan and subbottom data
-      from Reson 7k (format 88) data files: <a href="mb7k2jstar.html">mb7k2jstar</a>      </li>
-  <li> Extract Edgetech sidescan sonar data from Reson 7k format data, bin and lay the sidescan
-onto the seafloor, and output data in the MBF_MBLDEOIH formst (MBIO
-format id 71): <a href="mb7k2ss.html">mb7k2ss</a></li>
-  <li> <a href="mbauvloglist.html">mbauvloglist</a>: Generate
-    arbitrary text lists of values from MBARI AUV mission log files.<br>
-  </li>
-  </ul>
-  </ul>
-</ul>
-<center>
-  Last Updated: $Id: mbsystem_capabilities.html 2187 2014-05-28 23:56:32Z caress $
-</center>
-<ul>
-  <hr width="100%">
-  <p><a href="mbsystem_home.html"><img src="mbsystem_logo_small.gif"
- align="bottom" border="0" height="55" width="158"></a><a
- href="mbsystem_home.html">Back
-    to MB-System Home Page...</a> </p>
-</ul>
-</body>
-</html>
diff --git a/src/html/mbsystem_copyright.html b/src/html/mbsystem_copyright.html
deleted file mode 100644
index 00fd824..0000000
--- a/src/html/mbsystem_copyright.html
+++ /dev/null
@@ -1,123 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
-<HTML>
-<HEAD>
-   <TITLE>MB-System Copyright</TITLE>
-  <meta http-equiv="Content-Type" content="text/html">
-  <meta name="Title" content="MB-System: Mapping the Seafloor">
-  <meta name="Author" content="David Caress, Dale Chayes">
-  <meta name="Description" content="open source software for processing bathymetry and backscatter data from multibeam and sidescan sonar">
-  <meta name="Keywords" content="seafloor,mapping,multibeam,sonar,bathymetry,sidescan,swath processing,open,source,software">
-</HEAD>
-<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#336699" VLINK="#997040" ALINK="#CC9900">
-<BODY>
-
-<CENTER><P><B><FONT SIZE=+2>MB-System Copyright</FONT></B></P></CENTER>
-
-<CENTER>
-  <DT>MB-System Copyright © 1993-2015</DT>
-</CENTER>
-
-<CENTER><DT>by David W. Caress and Dale N. Chayes</DT></CENTER>
-
-<CENTER><DT>All Rights Reserved.</DT></CENTER>
-
-<CENTER><DT>All Wrongs Remembered.</DT></CENTER>
-
-<CENTER><P>
-<HR WIDTH="67%"></P></CENTER>
-
-<CENTER><P><B><FONT SIZE=+2>MB-System Licensing</FONT></B></P></CENTER>
-
-<P>The MB-System source code is distributed under the <A HREF="gpl.html">GNU
-General Public License (version 3)</A> as formulated by the
-<A HREF="http://fsf.org/">Free Software Foundation.</A>
-Early MB-System distributions were described as "public domain",
-which meant there was no restriction whatsoever on the use of the code.
-For over a decade we have adopted the more restrictive GNU GPL license in order
-to insure that anyone who distributes software based in whole or in part
-on MB-System also distributes the modified MB-System source code and any
-additional source code. </P>
-
-<P>The GNU GPL also prohibits the distribution of proprietary
-executables linked with MB-System libraries unless the source code is also
-distributed. We waive this restriction on distributing proprietary compiled
-programs for specific software products if and only if those software products
-meet the following two conditions:</P>
-
-<UL>
-<LI>The software product was created, sold, and delivered to customers
-using source code derived from MB-System release 4.6 distributions.</LI>
-
-<LI>The software product was sold and delivered to customers prior to January
-1, 2001.</LI>
-</UL>
-
-<CENTER><P>
-<HR WIDTH="67%"></P></CENTER>
-
-<CENTER><P><B><FONT SIZE=+2>Acknowledgment of Source Code Derived From Other Sources</FONT></B></P></CENTER>
-
-<P>The MB-System distribution includes some source code derived from packages
-that are distributed separately and have been authored by programmers other
-than the MB-System team. This includes:</P>
-
-<UL>
-<LI>The <A HREF="https://www.leidos.com/maritime/gsf">Generic Sensor Format</A> (GSF) library source located in mbsystem/src/gsf.
-The GSF package is distributed by the
-<A HREF="https://www.leidos.com/maritime"> Leidos Maritime</A>
-under contract to the
-<A HREF="http://www.usno.navy.mil/NAVO">Naval Oceanographic Office</A>.</LI>
-
-<LI>The SURF API (SAPI) library source located in mbsystem/src/surf.
-The SAPI package has been released under the <A HREF="gpl.html">GNU
-General Public License</A> by <A HREF="http://www.atlashydro.com/">Atlas
-Hydrographic</A>.</LI>
-
-<LI>The MR1PR library source located in mbsystem/src/mr1pr. This package
-has been openly released by the
-<A HREF="http://www.soest.hawaii.edu/HMRG/">
-Hawaii Mapping Research Group</A>.</LI>
-
-<LI>The <A HREF="http://trac.osgeo.org/proj/">PROJ.4 library source</A> located in mbsystem/src/proj. This package
-was originally developed by Gerald Evenden of the
-<A HREF="http://www.usgs.gov/">United States
-Geological Survey</A>, and is now maintained and distributed under an MIT
-license (that is very close to public domain)
-by Frank Warmerdam in association with the <A HREF="http://www.osgeo.org/">
-Open Source Geospational Foundation</A></LI>
-
-<LI>The mb_beaudoin() function found in mbsystem/src/mbio/mb_angle.c was contributed by Jonathan Beaudoin of <A HREF="http://ccom.unh.edu"> CCOM/JHC University of New Hampshire</A> and John Hughes Clarke of the <A HREF="http://www.omg.unb.ca">Ocean Mapping Group, University of New Brunswick</A>. This code is licensed as part of MB-System under the <A HREF="gpl.html">GNU General Public License (version 3)</A>.</LI>
-
-<LI>The mb_mergesort() function found in mbsystem/src/mbio/mb_esf.c
-derives from the <A HREF="http://www.gnu-darwin.org/">GNU-Darwin Distribution</A>.
-This code is released under both the
-Apple Public Source License Version 1.1 and the BSD license, with
-original copyright by the Regents of the University of California.
-</LI>
-</UL>
-
-<CENTER><P>
-<HR WIDTH="67%"></P></CENTER>
-
-<CENTER><P><B><FONT SIZE=+2>MB-System Caveat</FONT></B></P></CENTER>
-
-<P>The MB-System software package does not come with any warranties, nor
-is it guarenteed to work on your computer or to do anything useful. The
-user assumes full responsibility for the use of this software. In particular,
-David W. Caress, Dale N. Chayes, the Lamont-Doherty Earth Observatory of
-Columbia University, the Monterey Bay Aquarium Research Institute, or any
-other individuals or organizations involved in the design and maintenance
-of the MB-System software package are NOT responsible for any damage that
-may follow from correct or incorrect use of these programs. </P>
-
-<CENTER><P><BR>
-Last Updated: $Id: mbsystem_copyright.html 2224 2015-02-04 19:14:05Z caress $</P></CENTER>
-
-<CENTER><P>
-<HR WIDTH="100%"></P></CENTER>
-
-<P><A HREF="mbsystem_home.html"><IMG SRC="mbsystem_logo_small.gif" BORDER=0 HEIGHT=55 WIDTH=158></A><A HREF="mbsystem_home.html">Back
-to MB-System Home Page...</A></P>
-
-</BODY>
-</HTML>
diff --git a/src/html/mbsystem_faq.html b/src/html/mbsystem_faq.html
deleted file mode 100644
index 2aaeff0..0000000
--- a/src/html/mbsystem_faq.html
+++ /dev/null
@@ -1,433 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
-<html>
-<head>
-  <title>MB-System Frequently Asked Questions</title>
-  <meta content="text/html" http-equiv="Content-Type">
-  <meta content="MB-System: Mapping the Seafloor" name="Title">
-  <meta content="David Caress, Dale Chayes" name="Author">
-  <meta
- content="open source software for processing bathymetry and backscatter data from multibeam and sidescan sonar"
- name="Description">
-  <meta
- content="seafloor,mapping,multibeam,sonar,bathymetry,sidescan,swath processing,open,source,software"
- name="Keywords">
-</head>
-<body alink="#cc9900" vlink="#997040" link="#336699" bgcolor="#ffffff"
- text="#000000">
-<center>
-<p><b><font size="+2">Frequently Asked Questions About MB-System</font></b></p>
-</center>
-<ul>
-  <li><b><a href="#MB-FAQ-whatis">What is MB-System?</a></b></li>
-  <li><b><a href="#MB-FAQ-cost">How much does MB-System cost?</a></b></li>
-  <li><b><a href="#MB-FAQ-creators">Who created MB-System?</a></b></li>
-  <li><b><a href="#MB-FAQ-computers">On which computers will MB-System
-work?</a></b></li>
-  <li><b><a href="#MB-FAQ-formats">What data formats are supported by 
-MB-System?</a></b></li>
-  <li><b><a href="mbsystem_faq.html#MB-FAQ-formatdoc">Where do I find
-data format documentation?</a></b></li>
-  <li><b><a href="#MB-FAQ-obtain">How do I obtain the MB-System source
-code?</a></b></li>
-  <li><b><a href="#MB-FAQ-licensing">How is the MB-System software
-licensed?</a></b></li>
-  <li><b><a href="#MB-FAQ-required">What other software is required for
-MB-System
-to work?</a></b></li>
-  <li><b><a href="#MB-FAQ-install">How do I install MB-System on my
-computer?</a></b></li>
-  <li><b><a href="#MB-FAQ-problems">How do I report problems with
-MB-System?</a></b></li>
-  <li><b><a href="#MB-FAQ-newformats">How do I arrange to have new data
-formats
-supported by MB-System?</a></b></li>
-  <li><b><a href="#MB-FAQ-updates">How are MB-System updates handled?</a></b></li>
-  <li><b><a href="#MB-FAQ-discussionlist">Is there an MB-System
-discussion list?</a></b></li>
-  <li><b><a href="#MB-FAQ-announcementlist">Is there an MB-System
-announcement list?</a></b></li>
-  <li><b><a href="#MB-FAQ-examples">Where can I find examples of how to
-use
-MB-System?</a></b></li>
-  <li><b><a href="#MB-FAQ-references">Are there any MB-System
-References?</a></b></li>
-  <li><b><a href="#MB-FAQ-future">What are the plans for future
-MB-System
-Development?</a></b></li>
-   <li><b><a href="#MB-FAQ-whopays">Who pays for MB-System development?</a></b></li>
-  <li><b><a href="#MB-FAQ-seamount">What seamount is shown in the
-MB-System
-logo?</a></b></li>
-  <li><b><a href="#MB-FAQ-history">What is the history of MB-System?</a></b></li>
-  <li><b><a href="#MB-FAQ-credit">Who else deserves credit for
-contributions
-to MB-System?</a></b></li>
- <li><b><a href="#MB-FAQ-y2k">Is MB-System Y2K compliant?</a></b></li>
-</ul>
-<p>
-</p>
-<hr width="67%">
-<p></p>
-<center>
-<p><b><font size="+2">Answers to Frequently Asked Questions</font></b></p>
-</center>
-<ul>
-  <li><a name="MB-FAQ-whatis"></a><b>What is MB-System?</b></li>
-  <p>MB-System is a software package consisting of programs which
-manipulate,
-process, list, or display swath sonar bathymetry, amplitude, and
-sidescan
-data. This software is distributed freely (and for free) in the form of
-source code for Unix platforms. The heart of the system is an
-input/output
-library called MBIO which allows programs to work transparently with
-any
-of a number of supported swath sonar data formats. This approach has
-allowed
-the creation of "generic" utilities which can be applied in a
-uniform manner to sonar data from a variety of sources.</p>
-  <li><a name="MB-FAQ-cost"></a><b>How much does MB-System cost?</b></li>
-  <p>The source code is freely available for free. The package can
-  also be installed via package managers for free on MacOSX, Ubuntu Linux,
-  Red Hat/CentOs Linux, and Debian Linux.</p>
-  <li><a name="MB-FAQ-creators"></a><b>Who created and maintains
-MB-System?</b></li>
-  <p>The originators and primary developers of MB-System are David W. Caress of the Monterey Bay
-Aquarium Research Institute (MBARI) and
-Dale N. Chayes of the Lamont-Doherty Earth Observatory (L-DEO) of
-Columbia
-University. The core MB-System development team also includes Christian dos Santos Ferreira of the Center for Marine Environmental Sciences (MARUM) at the University of Bremen. Krystle Anderson of MBARI is currently assisting the team in writing MB-System documentation. Val
-    Schmidt, formerly an engineer at L-DEO,and now now a research engineer at the <a href="http://ccom.unh.edu/">Center for Coastal and Ocean Mapping at the University of New Hampshire</a>, was the primary author of the first version of the MB-System Cookbook. See the home
-  page for <a href="mbsystem_home.html#MB-authors">pictures and addresses</a>.</p>
-  <li><a name="MB-FAQ-computers"></a><b>On which computers will
-    MB-System
-  work?</b></li>
-  <p>The source code for MB-System is written in ANSI C and Perl and should
-be
-portable to all unix-like platforms.  MB-System has been
-successfully
-installed on PC's and Macintoshes running Linux, Macintoshes running
-MacOS X,
-Sun workstations running
-under SunOS4.1 and Solaris, Silicon Graphics (SGI) workstations running
-under IRIX, Hewlett Packard workstations, Dec Alpha workstations, and
-PC's
-running under the Lynx realtime operating system.</p>
-  <li><a name="MB-FAQ-formats"></a><b>What data formats are supported
-by
-MB-System?</b></li>
-  <p><a href="mbsystem_formats.html">Click here </a>for a list of
-supported
-sonars and data formats.</p>
-  <li><b><a name="MB-FAQ-formatdoc"></a>Where do I find data format
-documentation?</b></li>
-</ul>
-<p style="margin-left: 40px;">Some of the swath mapping data formats
-supported by MB-System are documented on the main MB-System websites:<br>
-</p>
-<div style="margin-left: 80px;"><a
- href="http://www.mbari.org/data/mbsystem/formatdoc/">http://www.mbari.org/data/mbsystem/formatdoc/</a><br>
-<a href="http://www.ldeo.columbia.edu/MB-System/formatdoc/">http://www.ldeo.columbia.edu/MB-System/formatdoc/</a><br>
-</div>
-<ul>
-  <li><a name="MB-FAQ-obtain"></a><b>How do I obtain the MB-System
-source
-code?</b></li>
-  <p><a href="mbsystem_how_to_get.html#MB-get">Click here</a> for
-instructions
-on obtaining the MB-System source code distribution.</p>
-  <li><a name="MB-FAQ-licensing"></a><b>How is the MB-System software
-licensed?</b></li>
-  <p><a href="mbsystem_copyright.html">Click here</a> for information
-on
-MB-System copyright and licensing.</p>
-  <li><a name="MB-FAQ-required"></a><b>What other software is required
-for
-MB-System to work?</b></li>
-  <p><a href="mbsystem_how_to_get.html#MB-required">Click here</a> for
-information
-on other software required for an MB-System installation.</p>
-  <li><a name="MB-FAQ-install"></a><b>How do I install MB-System on my
-computer?</b></li>
-  <p><a href="mbsystem_how_to_get.html#MB-install">Click here</a> for
-MB-System
-installation information.</p>
-  <li><a name="MB-FAQ-problems"></a><b>How do I report problems with
-MB-System?</b></li>
-  <p>Although we make no promises about how rapidly problems will be
-fixed,
-we strongly encourage users to notify us of bugs (and fixes!).</p>
-  <p>Problems should be reported by posts to the <a
- href="#MB-FAQ-discussionlist">MB-System discussion list</a>.
-You will have to subscribe to the list in order to post to it (one can
-always unsubscribe at any time).
-If you are unable to access the MB-System Discussion List, you can
-email <a href="mailto:caress at mbari.org,dale at ldeo.columbia.edu">both
-David W, Caress and Dale N. Chayes</a> directly. However, due to our
-frequent travel, using the discussion list
-makes timely responses more likely.</p>
-  <li><a name="MB-FAQ-newformats"></a><b>How do I arrange to have new
-data
-formats supported by MB-System</b></li>
-  <p>In order to support a new data format, we will require a data
-format
-specification document and a data sample. We make no promises about how
-rapidly
-new formats can be supported. Format support requests by NSF-funded
-scientists
-are given priority. </p>
-  <p>We encourage users with data in unsupported formats to write the
-input/output
-modules themselves, and contribute the code to the MB-System project. </p>
-  <li><a name="MB-FAQ-updates"></a><b>How are MB-System updates handled?</b></li>
-  <p>Incremental bug fixes and code changes often occur between the
-    source code releases. These updates to individual source files are reflected in the source code archive, which can be accessed at:</p>
-  <dd><a href="http://svn.ilab.ldeo.columbia.edu/listing.php?repname=MB-System">http://svn.ilab.ldeo.columbia.edu/listing.php?repname=MB-System</a></dd>
-  <p>Periodically, we construct full source code distributions and make them available on the ftp site:</p>
-    <dd><a href="ftp://ftp.ldeo.columbia.edu/pub/MB-System/">ftp.ldeo.columbia.edu/pub/MB-System/</a></dd>
-  <p>These source code distributions consist of gzipped tarfiles with names of the form "MB-System5.3.1906.tar.gz", 
-  where 5.3 indicates the incrementing major and minor release id's, and
-  the third number indicates the corresponding revision level in the source code archive.</p>
-  <li><a name="MB-FAQ-discussionlist"></a><b>Is there an MB-System
-discussion list?</b></li>
-  <dt><br>
-We maintain an MB-System discussion email list to facillitate
-communication
-among MB-System developers and users. We encourage users with questions
-and/or problems
-to use this list rather than emailing the developers directly.
-One must subscribe to the list in order
-to post messages, but the message archive is publically viewable and
-searchable
-over a web interface. The maximum message size in this list is 100K.
-Please do not attempt to attach data samples
-to discussion list posts.</dt>
-  <br>
-  <dt>To read the archives go to:</dt>
-  <ul>
-    <dt><a href="http://listserver.mbari.org/sympa/arc/mbsystem">http://listserver.mbari.org/sympa/arc/mbsystem</a></dt>
-  </ul>
-  <dt>To subscribe go to:</dt>
-  <ul>
-    <dt><a
- href="http://listserver.mbari.org/sympa/subscribe/mbsystem">http://listserver.mbari.org/sympa/subscribe/mbsystem</a></dt>
-  </ul>
-  <br>
-  <li><a name="MB-FAQ-announcementlist"></a><b>Is there an MB-System
-announcement list?</b></li>
-  <dt><br>
-We maintain a second, very low traffic list of email addresses which is
-used solely for providing notification
-of major updates. If you would like to be notified when new releases
-are available, but do not
-wish to join the discussion list described above,
-please send an email message to:</dt>
-  <ul>
-    <dt>majordomo at ldeo.columbia.edu</dt>
-  </ul>
-  <dt>with a single line in the body of the message that says:</dt>
-  <ul>
-    <dt>subscribe mbsystem-l</dt>
-  </ul>
-  <dt>to be automatically added to the announcement list. <br>
-    <br>
-  </dt>
-  <li><a name="MB-FAQ-examples"></a><b>Where can I find examples of how
-to
-use MB-System?</b></li>
-  <dt><br>
-The MB-System Cookbook tutorial documentation by Val Schmidt,
-Dale N. Chayes,
-and David W. Caress is available from the Lamont-Doherty web site both
-as web pages and as a downloadable pdf document: </dt>
-  <ul>
-    <dt><a
- href="http://www.ldeo.columbia.edu/MB-System/mb-cookbook/index.html">MB-System
-5.0 Cookbook web pages</a></dt>
-  
-    <dt><a
- href="http://www.ldeo.columbia.edu/MB-System/mbcookbook.pdf">MB-System
-    5.0 Cookbook pdf file</a></dt>
-  </ul>
-  <br>
-  <li><a name="MB-FAQ-references"></a><b>Are there any MB-System
-References?</b></li>
-  <p>Papers specifically about MB-System:</p>
-  <blockquote>
-    <p><a href="http://ieeexplore.ieee.org/xpl/articleDetails.jsp?arnumber=528558">Caress, D. W., and D. N. Chayes, New software for processing
-      sidescan
-      data from sidescan-capable multibeam sonars, <i>Proceedings of the
-        IEEE
-        Oceans 95 Conference</i>, 997-1000, 1995.</a></p>
-    <p><a href="http://link.springer.com/article/10.1007/BF00313878">Caress, D. W., and D. N. Chayes, Improved processing of Hydrosweep
-      DS
-      multibeam data on the R/V Maurice Ewing, <i>Mar. Geophys. Res.</i>,
-      18,
-      631-650, 1996.</a></p>
-  </blockquote>
-  <p>This paper on high-resolution autonomous mapping features some of the more recent MB-System capabilities:</p>
-  <blockquote>
-    <p><a href="http://doc.nprb.org/web/research/research%20pubs/615_habitat_mapping_workshop/Individual%20Chapters%20High-Res/Ch4%20Caress%20et%20al.pdf">Caress, D.W., H. Thomas, W. J. Kirkwood, R. McEwen, R. Henthorn, E. A. Clague, C. K. Paull,  J. Paduan, and K. L. Maier, "High-Resolution Multibeam, Sidescan, and Subbottom Surveys Using the MBARI AUV D. Allan B.",  <em>Marine Habitat Mapping Technology for Alaska</em>, J.R. Reynolds and H.G. Greene (eds.) Alaska Sea Grant College Prog [...]
-  </blockquote>
-  <p>References to the software distributions:</p>
-  <blockquote>
-    <p>Caress, D. W., and D. N. Chayes, MB-System: Mapping the Seafloor, <a href="http://www.mbari.org/data/mbsystem/"> http://www.mbari.org/data/mbsystem</a> and <a href="http://www.ldeo.columbia.edu/res/pi/MB-System/"> http://www.ldeo.columbia.edu/res/pi/MB-System</a>, 2014.</p>
-  </blockquote>
-  <li><a name="MB-FAQ-future"></a><b>What are the plans for future
-    MB-System
-  Development?</b></li>
-  <p><a href="mbsystem_future.html">Click here</a> for some notions
-regarding
-future MB-System development.</p>
-  <li><a name="MB-FAQ-whopays"></a><b>Who pays for MB-System
-development?</b></li>
-  <p>MB-System is primarily supported by the Packard Foundation and the National Science Foundation. The Marine Geology and Geophysics program of the Ocean
-Sciences Division of NSF provides support through active grants (2013-2017) to the Monterey Bay Aquarium Research Institute (principal
-investigator
-David W. Caress) and the Lamont-Doherty Earth Observatory of Columbia
-University
-(principal investigator Dale N. Chayes). The Monterey Bay Aquarium
-Research
-Institute, funded by the Packard Foundation, matches 
-the NSF support for David W. Caress as part of its
-seafloor
-mapping program, and provides additional support as part of internal MBARI development projects and operations. Additional support also occasionally comes in the form
-of contract work for various government agencies and companies.</p>
-  <li><a name="MB-FAQ-seamount"></a><b>What seamount is shown in the
-MB-System
-logo?</b></li>
-  <p>The seamount shown in illuminated color 3D perspective in the
-MB-System
-logo is the northern Urville Seamount (or Dumont d'Urville du Nord, as
-it appears on French charts). This seamount is located in the Marquesas
-Islands at 9 35'S, 139 47'W. It was surveyed in 1991 and 1992 using the
-Hydrosweep DS multibeam sonar on the R/V Maurice Ewing.</p>
-  <li><a name="MB-FAQ-history"></a><b>What is the history of MB-System?</b></li>
-  <p>The development of MB-System began in 1990 as part of ongoing
-research
-at L-DEO involving swath bathymetry data collected with SeaBeam
-multibeam
-sonars. Development was accelerated in 1991 as part of the effort to
-support
-the STN-Atlas Hydrosweep DS multibeam sonar on L-DEO's ship, the R/V
-Maurice
-Ewing. The Marine Geology and Geophysics Program (Ocean Sciences Division) of the National Science Foundation (NSF) provided support in 1993 and
-1994
-to improve and extend MB-System. The intent of this initial grant was
-to
-provide a standard "generic" set of tools for processing and
-display of swath sonar data that could be used by the U.S. academic
-community.
-The first generally released version of MB-System (3.0) was made
-available
-in the Spring of 1993. This was followed by versions 3.1 and 3.2 in
-July,
-1993, version 3.3 in November, 1993, and version 3.4 in December 1993.
-All of these early releases supported only SeaBeam and Hydrosweep data.</p>
-  <p>SeaBeam Instruments and Antarctic Support Associates provided
-additional
-support in 1994 for the development of MB-System, with particular
-emphasis
-on capabilities related to the new SeaBeam 2100 series of sonars. A
-considerably
-enhanced MB-System version 4.0 was released on October 22, 1994; this
-release
-followed an almost complete rewrite of the underlying source code. The
-new capabilities included support for sidescan as well as bathymetry
-data
-and support for data from a number of very different sonars. </p>
-  <p>The NSF funded a five year effort begun in
-1995
-to maintain and further develop MB-System. From 1994 to 1997, SeaBeam
-Instruments
-(a major multibeam sonar manufacturer and, at the time, the principal
-employer
-of David W. Caress) provided significant support for MB-System
-development
-and maintenance. Similarly, the Newport, RI office of the Science
-Applications
-International Corporation (SAIC) supported some MB-System development
-during
-1997-1998, when David W. Caress worked there. Version 4.1 was released
-in November, 1994, followed by 4.2 in February 1995, 4.3 on March 12,
-1996,
-4.4 on August 27, 1996, and 4.5 on September 23, 1997.</p>
-  <p>David W. Caress joined the Monterey Bay Aquarium Research
-Institute
-(MBARI) in September, 1998. Version 4.6 was released on April 16, 1999.
-The final update to version 4.6 (4.6.10) was announced on March 8,
-2000.
-The primary innovations during this period included support for the new
-generation of Simrad multibeam sonars and tools for generating data
-products
-that could be imported directly into GIS software packages.</p>
-  <p>The NSF has funded additional five year grants
-to MBARI and L-DEO which have supported the MB-System project from 2001-2006, 2006-2011, and now from 2013-2017. The Packard Foundation, through its support of MBARI, has matched the NSF support and provided considerable additional support as part of MBARI's efforts to achieve high resolution seafloor mapping in the deep ocean using autonomous underwater vehicles (AUVs).The version 5.0 release incorporated
-a substantial rewrite of the underlying code as well as
-providing
-significant new capabilities
-The initial version 5.0 development took nearly three years. A first
-"beta" release was made on April 6, 2001, followed by thirty more beta
-releases, the last on April 29, 2003. Version 5.0.0 was finally 
-released on December 5, 2003. 
-The software has evolved considerably since that time, and now includes tools for 2D/3D visualization, 3D interactive data editing, navigation adjustment of surveys from submerged platforms, processing and display of subbottom profiler data, and many other features.
-
-Version 5.1 was released on November 26, 2006, version 5.2 on December 30, 2010, and version 5.3 on September 28, 2011. Dozens of incremental releases have been made before and since 5.3, and public access to the code archive allows users to be up to date with respect to development and maintenance regardless of the release schedule.</p>
-  <p>In January 2012 an <a href="http://www.mbari.org/data/mbsystem/2012NSFProposal/20120117MBPlanning.html">MB-System planning meeting</a> was held at the Lamont-Doherty Earth Observatory to lay out long range plans for MB-System development. With the renewal of NSF support in 2013, the MB-System team is now working to implement the <a href="http://www.mbari.org/data/mbsystem/2012NSFProposal/20120117MBPlanning.pdf">priorities from the planning meeting </a>as part of a major code rewrite [...]
-
-  <li><a name="MB-FAQ-credit"></a><b>Who else deserves credit for
-contributions
-to MB-System?</b></li>
-  <p>In addition to the core team (David Caress, Dale Chayes, Christian dos Santos Ferreira), a number of people have made contributions to the code included in
-MB-System.
-These include: </p>
-  <ul>
-    <li>Val Schmidt (University of New Hampshire, formerly Lamont-Doherty Earth Observatory) </li>
-    <li>Gordon Keith (CSIRO Marine and Atmospheric Research, Australia)</li>
-    <li>Kurt Schwehr (Google, formerly University of New Hampshire)</li>
-    <li>Suzanne O'Hara (Lamont-Doherty Earth Observatory) </li>
-    <li>Bob Covill (Tekmap Consulting, Nova Scotia)</li>
-    <li>Peter Lemmond (Woods Hole Oceanographic Institution)</li>
-    <li>Jonathan Beaudoin (CCOM/JHC, University of New Hamphsire)</li>
-    <li>John Hughes Clarke (OMG, University of New Brunswick)</li>
-    <li>Hamish Bowman (University of Otago, New Zealand)</li>
-    <li>Roger Davis (University of Hawaii) </li>
-    <li>Ammar Aljuhne (MARUM, University of Bremen, Germany)</li>
-    <li>Mike McCann (MBARI) </li>
-    <li>Hans Thomas (MBARI) </li>
-    <li>Daniel Scheirer (USGS, formerly Brown University)</li>
-    <li>Paul Cohen (formerly at SeaBeam Instruments)</li>
-    <li>Steve Dzurenko (formerly at SeaBeam Instruments, more recently at University of Texas)</li>
-    <li>David Brock (formerly with Antarctic Support Associates) </li>
-    <li>Alberto Malinverno (Lamont-Doherty Earth Observatory, later at
-    Schlumberger-Doll, now back at Lamont) </li>
-    <li>Russ Alexander (formerly with UCSB) </li>
-  </ul>
-  <p>Numerous users and vendors have provided information regarding
-data
-file formats and sonar system specific characteristics.</p>
-<li><a name="MB-FAQ-y2k"></a><b>Is MB-System Y2K compliant?</b></li>
-  <p>Remember when Y2K was a buzz word? If so, you are old like us. Not that it matters anymore, but MB-System became fully Y2K 
-compliant as of the final release of version 4.6. Surprisingly,
-a number of data formats associated with current commercial products
-still use two digits to represent the year. MB-System treats two digit year
-values as being in the 1900's if the year value is greater than or equal to
-62,
-and in the 2000's if the year value is less than 62. The use of 1962
-derives
-from the invention of the multibeam sonar in that year - there are no
-digital
-swath mapping data available from an earlier time.</p></ul>
-<center>
-<p><br>
-Last Updated: $Id: mbsystem_faq.html 2208 2014-10-29 08:18:46Z caress $</p>
-</center>
-<p>
-</p>
-<hr width="67%">
-<p></p>
-<p><a href="mbsystem_home.html"><img width="158" height="55" border="0"
- src="mbsystem_logo_small.gif"></a><a href="mbsystem_home.html">Back
-to MB-System Home Page...</a></p>
-</body>
-</html>
diff --git a/src/html/mbsystem_formats.html b/src/html/mbsystem_formats.html
deleted file mode 100644
index 848a2e6..0000000
--- a/src/html/mbsystem_formats.html
+++ /dev/null
@@ -1,1141 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
-<HTML>
-<HEAD>
-   <TITLE>MB-System Supported Data Formats</TITLE>
-</HEAD>
-<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#336699" VLINK="#997040" ALINK="#CC9900">
-
-<CENTER><P><B><FONT SIZE=+2>MB-System Supported Swath Data Formats</FONT></B></P></CENTER>
-
-<P>Each swath mapping sonar system outputs a data stream which includes
-some values or parameters unique to that system. In general, a number of
-different data formats have come into use for data from each of the sonar
-systems; many of these formats include only a subset of the original data
-stream. Internally, MBIO recognizes which sonar system each data format
-is associated with and uses a data structure including the complete data
-stream for that sonar. At present, formats associated with the following
-sonars are supported: </P>
-
-<UL>
-<LI>Sea Beam "classic" multibeam sonar </LI>
-
-<LI>Hydrosweep DS multibeam sonar </LI>
-
-<LI>Hydrosweep DS2 multibeam sonar </LI>
-
-<LI>Hydrosweep MD multibeam sonar </LI>
-
-<LI>Sea Beam 2000 multibeam sonar </LI>
-
-<LI>Sea Beam 2112 and 2136 multibeam sonars </LI>
-
-<LI>Sea Beam 2120 multibeam sonars </LI>
-
-<LI>Simrad EM12, EM121, EM950, and EM1000 multibeam sonars </LI>
-
-<LI>Simrad EM120, EM300, and EM3000 multibeam sonars</LI>
-
-<LI>Simrad EM122, EM302, EM710, and EM3002 multibeam sonars</LI>
-
-<LI>Simrad Mesotech SM2000 multibeam sonar</LI>
-
-<LI>Hawaii MR-1 shallow tow interferometric sonar </LI>
-
-<LI>ELAC Bottomchart and Bottomchart MkII shallow water multibeam sonars</LI>
-
-<LI>Reson Seabat multibeam sonars (e.g. 9001, 8081, 7125)</LI>
-
-<LI>WHOI DSL AMS-120 deep tow interferometric sonar </LI>
-
-<LI>Sea Scan sidescan sonar</LI>
-
-<LI>Furuno HS-1 multibeam sonar</LI>
-
-<LI>Edgetech sidescan and subbottom profiler sonars</LI>
-
-<LI>Imagenex DeltaT multibeam sonars</LI>
-
-<LI>Odom ES3 multibeam sonar</LI>
-
-</UL>
-
-<P>The following swath mapping sonar data formats are currently supported by MB-System:</P>
-
-
-<UL>
-<LI>MBIO Data Format ID:  11 </LI>
-
-<UL>
-<LI>Format name:          MBF_SBSIOMRG</LI>
-
-<LI>Informal Description: SIO merge Sea Beam</LI>
-
-<LI>Attributes:           Sea Beam, bathymetry, 16 beams, binary, uncentered,
-                      SIO.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  12 </LI>
-
-<UL>
-<LI>Format name:          MBF_SBSIOCEN</LI>
-
-<LI>Informal Description: SIO centered Sea Beam</LI>
-
-<LI>Attributes:           Sea Beam, bathymetry, 19 beams, binary, centered,
-                      SIO.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  13 </LI>
-
-<UL>
-<LI>Format name:          MBF_SBSIOLSI</LI>
-
-<LI>Informal Description: SIO LSI Sea Beam</LI>
-
-<LI>Attributes:           Sea Beam, bathymetry, 19 beams, binary, centered, 
-                      obsolete, SIO.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  14 </LI>
-
-<UL>
-<LI>Format name:          MBF_SBURICEN</LI>
-
-<LI>Informal Description: URI Sea Beam</LI>
-
-<LI>Attributes:           Sea Beam, bathymetry, 19 beams, binary, centered,
-                      URI.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  15 </LI>
-
-<UL>
-<LI>Format name:          MBF_SBURIVAX</LI>
-
-<LI>Informal Description: URI Sea Beam from VAX</LI>
-
-<LI>Attributes:           Sea Beam, bathymetry, 19 beams, binary, centered,
-                      VAX byte order, URI.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  16 </LI>
-
-<UL>
-<LI>Format name:          MBF_SBSIOSWB</LI>
-
-<LI>Informal Description: SIO Swath-bathy SeaBeam</LI>
-
-<LI>Attributes:           Sea Beam, bathymetry, 19 beams, binary, centered,
-                      SIO.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  17 </LI>
-
-<UL>
-<LI>Format name:          MBF_SBIFREMR</LI>
-
-<LI>Informal Description: IFREMER Archive SeaBeam</LI>
-
-<LI>Attributes:           Sea Beam, bathymetry, 19 beams, ascii, centered,
-                      IFREMER.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  21 </LI>
-
-<UL>
-<LI>Format name:          MBF_HSATLRAW</LI>
-
-<LI>Informal Description: Raw Hydrosweep</LI>
-
-<LI>Attributes:           Hydrosweep DS, bathymetry and amplitude, 59 beams,
-                      ascii, Atlas Electronik.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  22 </LI>
-
-<UL>
-<LI>Format name:          MBF_HSLDEDMB</LI>
-
-<LI>Informal Description: EDMB Hydrosweep</LI>
-
-<LI>Attributes:           Hydrosweep DS, bathymetry, 59 beams, binary, NRL.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  23 </LI>
-
-<UL>
-<LI>Format name:          MBF_HSURICEN</LI>
-
-<LI>Informal Description: URI Hydrosweep</LI>
-
-<LI>Attributes:           Hydrosweep DS, 59 beams, bathymetry, binary, URI.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  24 </LI>
-
-<UL>
-<LI>Format name:          MBF_HSLDEOIH</LI>
-
-<LI>Informal Description: L-DEO in-house binary Hydrosweep</LI>
-
-<LI>Attributes:           Hydrosweep DS, 59 beams, bathymetry and amplitude, 
-                      binary, centered, L-DEO.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  25 </LI>
-
-<UL>
-<LI>Format name:          MBF_HSURIVAX</LI>
-
-<LI>Informal Description: URI Hydrosweep from VAX</LI>
-
-<LI>Attributes:           Hydrosweep DS, 59 beams, bathymetry, binary,
-                      VAX byte order, URI.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  26 </LI>
-
-<UL>
-<LI>Format name:          MBF_HSUNKNWN</LI>
-
-<LI>Informal Description: Unknown Hydrosweep</LI>
-
-<LI>Attributes:           Hydrosweep DS, bathymetry, 59 beams, ascii, unknown origin, SOPAC.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  32 </LI>
-
-<UL>
-<LI>Format name:          MBF_SB2000SB</LI>
-
-<LI>Informal Description: SIO Swath-bathy SeaBeam 2000 format</LI>
-
-<LI>Attributes:           SeaBeam 2000, bathymetry, 121 beams, 
-                      binary,  SIO.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  33 </LI>
-
-<UL>
-<LI>Format name:          MBF_SB2000SS</LI>
-
-<LI>Informal Description: SIO Swath-bathy SeaBeam 2000 format</LI>
-
-<LI>Attributes:           SeaBeam 2000, sidescan,
-                      1000 pixels for 4-bit sidescan,
-                      2000 pixels for 12+-bit sidescan,
-                      binary,  SIO.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  41 </LI>
-
-<UL>
-<LI>Format name:          MBF_SB2100RW</LI>
-
-<LI>Informal Description: SeaBeam 2100 series vender format</LI>
-
-<LI>Attributes:           SeaBeam 2100, bathymetry, amplitude 
-                      and sidescan, 151 beams and 2000 pixels, ascii 
-                      with binary sidescan, SeaBeam Instruments.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  42 </LI>
-
-<UL>
-<LI>Format name:          MBF_SB2100B1</LI>
-
-<LI>Informal Description: SeaBeam 2100 series vender format</LI>
-
-<LI>Attributes:           SeaBeam 2100, bathymetry, amplitude 
-                      and sidescan, 151 beams bathymetry,
-                      2000 pixels sidescan, binary,
-                      SeaBeam Instruments and L-DEO.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  43 </LI>
-
-<UL>
-<LI>Format name:          MBF_SB2100B2</LI>
-
-<LI>Informal Description: SeaBeam 2100 series vender format</LI>
-
-<LI>Attributes:           SeaBeam 2100, bathymetry and amplitude,  
-                      151 beams bathymetry,
-                      binary,
-                      SeaBeam Instruments and L-DEO.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  51 </LI>
-
-<UL>
-<LI>Format name:          MBF_EMOLDRAW</LI>
-
-<LI>Informal Description: Old Simrad vendor multibeam format</LI>
-
-<LI>Attributes:           Simrad EM1000, EM12S, EM12D, 
-                      and EM121 multibeam sonars,
-                      bathymetry, amplitude, and sidescan,
-                      60 beams for EM1000, 81 beams for EM12S/D,
-		      121 beams for EM121, variable pixels,
-		      ascii + binary, Simrad.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  53 </LI>
-
-<UL>
-<LI>Format name:          MBF_EM12IFRM</LI>
-
-<LI>Informal Description: IFREMER TRISMUS format for Simrad EM12</LI>
-
-<LI>Attributes:           Simrad EM12S and EM12D,
-                     bathymetry, amplitude, and sidescan
-                      81 beams, variable pixels, binary,
-                      read-only, IFREMER.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  54 </LI>
-
-<UL>
-<LI>Format name:          MBF_EM12DARW</LI>
-
-<LI>Informal Description: Simrad EM12S RRS Darwin processed format</LI>
-
-<LI>Attributes:           Simrad EM12S, bathymetry and amplitude,
-                      81 beams, binary, Oxford University.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  56 </LI>
-
-<UL>
-<LI>Format name:          MBF_EM300RAW</LI>
-
-<LI>Informal Description: Simrad current multibeam vendor format</LI>
-
-<LI>Attributes:           Simrad EM120, EM300, EM1002, EM3000, 
-                      bathymetry, amplitude, and sidescan,
-                      up to 254 beams, variable pixels, ascii + binary, Simrad.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  57 </LI>
-
-<UL>
-<LI>Format name:          MBF_EM300MBA</LI>
-
-<LI>Informal Description: Simrad multibeam processing format</LI>
-
-<LI>Attributes:           Old and new Simrad multibeams, 
-                      EM12S, EM12D, EM121, EM120, EM300, 
-                      EM100, EM1000, EM950, EM1002, EM3000, 
-                      bathymetry, amplitude, and sidescan,
-                      up to 254 beams, variable pixels, ascii + binary, MBARI.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  58 </LI>
-
-<UL>
-<LI>Format name:          MBF_EM710RAW</LI>
-
-<LI>Informal Description: Kongsberg current multibeam vendor format</LI>
-
-<LI>Attributes:           Kongsberg EM122, EM302, EM710,
-                      bathymetry, amplitude, and sidescan,
-                      up to 400 beams, variable pixels, binary, Kongsberg.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  59 </LI>
-
-<UL>
-<LI>Format name:          MBF_EM710MBA</LI>
-
-<LI>Informal Description: Kongsberg current multibeam vendor format</LI>
-
-<LI>Attributes:           Kongsberg EM122, EM302, EM710,
-                      bathymetry, amplitude, and sidescan,
-                      up to 400 beams, variable pixels, binary, Kongsberg.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  61 </LI>
-
-<UL>
-<LI>Format name:      MBF_MR1PRHIG</LI>
-
-<LI>Informal Description: Obsolete SOEST MR1 post processed format</LI>
-
-<LI>Attributes:           SOEST MR1, bathymetry and sidescan,
-                      variable beams and pixels, xdr binary, 
-                      SOEST, University of Hawaii.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  62 </LI>
-
-<UL>
-<LI>Format name:          MBF_MR1ALDEO</LI>
-
-<LI>Informal Description: L-DEO MR1 post processed format with travel times</LI>
-
-<LI>Attributes:           L-DEO MR1, bathymetry and sidescan,
-                      variable beams and pixels, xdr binary, 
-                      L-DEO.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  63 </LI>
-
-<UL>
-<LI>Format name:          MBF_MR1BLDEO</LI>
-
-<LI>Informal Description: L-DEO small MR1 post processed format with travel times</LI>
-
-<LI>Attributes:           L-DEO MR1, bathymetry and sidescan,
-                      variable beams and pixels, xdr binary, 
-                      L-DEO.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  64 </LI>
-
-<UL>
-<LI>Format name:          MBF_MR1PRVR2</LI>
-
-<LI>Informal Description: SOEST MR1 post processed format</LI>
-
-<LI>Attributes:           SOEST MR1, bathymetry and sidescan,
-                      variable beams and pixels, xdr binary, 
-                      SOEST, University of Hawaii.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  71 </LI>
-
-<UL>
-<LI>Format name:          MBF_MBLDEOIH</LI>
-
-<LI>Informal Description: L-DEO in-house generic multibeam</LI>
-
-<LI>Attributes:           Data from all sonar systems, bathymetry, 
-                      amplitude and sidescan, variable beams and pixels, 
-                      binary, centered, L-DEO.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  75 </LI>
-
-<UL>
-<LI>Format name:          MBF_MBNETCDF</LI>
-
-<LI>Informal Description: CARAIBES CDF multibeam</LI>
-
-<LI>Attributes:           Data from all sonar systems, bathymetry only, 
-                      variable beams, netCDF, IFREMER.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  76 </LI>
-
-<UL>
-<LI>Format name:          MBF_MBNCDFXT</LI>
-
-<LI>Informal Description: CARAIBES CDF multibeam extended</LI>
-
-<LI>Attributes:           Superset of MBF_MBNETCDF, includes (at least SIMRAD EM12) amplitude, 
-                      variable beams, netCDF, IFREMER.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  81 </LI>
-
-<UL>
-<LI>Format name:          MBF_CBAT9001</LI>
-
-<LI>Informal Description: Reson SeaBat 9001 shallow water multibeam</LI>
-
-<LI>Attributes:           60 beam bathymetry and amplitude,
-                      binary, University of New Brunswick.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  82 </LI>
-
-<UL>
-<LI>Format name:          MBF_CBAT8101</LI>
-
-<LI>Informal Description: Reson SeaBat 8101 shallow water multibeam</LI>
-
-<LI>Attributes:           101 beam bathymetry and amplitude,
-                      binary, SeaBeam Instruments.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  83 </LI>
-
-<UL>
-<LI>Format name:          MBF_HYPC8101</LI>
-
-<LI>Informal Description: Reson SeaBat 8101 shallow water multibeam</LI>
-
-<LI>Attributes:           101 beam bathymetry,
-                      ASCII, read-only, Coastal Oceanographics.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  84 </LI>
-
-<UL>
-<LI>Format name:          MBF_XTFR8101</LI>
-
-<LI>Informal Description: XTF format Reson SeaBat 81XX</LI>
-
-<LI>Attributes:           240 beam bathymetry and amplitude,
-		      1024 pixel sidescan
-                      binary, read-only,
-                      Triton-Elics.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  88 </LI>
-
-<UL>
-<LI>Format name:          MBF_RESON7KR</LI>
-
-<LI>Informal Description: Reson 7K multibeam vendor format</LI>
-
-<LI>Attributes:           Reson 7K series multibeam sonars, 
-                      bathymetry, amplitude, three channels sidescan, and subbottom
-                      up to 254 beams, variable pixels, binary, Reson.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  91 </LI>
-
-<UL>
-<LI>Format name:          MBF_BCHRTUNB</LI>
-
-<LI>Informal Description: Elac BottomChart shallow water multibeam</LI>
-
-<LI>Attributes:           56 beam bathymetry and amplitude,
-                      binary, University of New Brunswick.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  92 </LI>
-
-<UL>
-<LI>Format name:          MBF_ELMK2UNB</LI>
-
-<LI>Informal Description: Elac BottomChart MkII shallow water multibeam</LI>
-
-<LI>Attributes:           126 beam bathymetry and amplitude,
-                      binary, University of New Brunswick.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  93 </LI>
-
-<UL>
-<LI>Format name:          MBF_BCHRXUNB</LI>
-
-<LI>Informal Description: Elac BottomChart shallow water multibeam</LI>
-
-<LI>Attributes:           56 beam bathymetry and amplitude,
-                      binary, University of New Brunswick.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  94 </LI>
-
-<UL>
-<LI>Format name:          MBF_L3XSERAW</LI>
-
-<LI>Informal Description: ELAC/SeaBeam XSE vendor format</LI>
-
-<LI>Attributes:           Bottomchart MkII 50 kHz and 180 kHz multibeam, 
-                      SeaBeam 2120 20 KHz multibeam,
-                      bathymetry, amplitude and sidescan,
-                      variable beams and pixels, binary, 
-                      L3 Communications (Elac Nautik 
-                      and SeaBeam Instruments).</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  101 </LI>
-
-<UL>
-<LI>Format name:          MBF_HSMDARAW</LI>
-
-<LI>Informal Description: Atlas HSMD medium depth multibeam raw format</LI>
-
-<LI>Attributes:           40 beam bathymetry, 160 pixel sidescan,
-                      XDR (binary), STN Atlas Elektronik.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  102 </LI>
-
-<UL>
-<LI>Format name:          MBF_HSMDLDIH</LI>
-
-<LI>Informal Description: Atlas HSMD medium depth multibeam processed format</LI>
-
-<LI>Attributes:           40 beam bathymetry, 160 pixel sidescan,
-                      XDR (binary), L-DEO.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  111 </LI>
-
-<UL>
-<LI>Format name:          MBF_DSL120PF</LI>
-
-<LI>Informal Description: WHOI DSL AMS-120 processed format</LI>
-
-<LI>Attributes:           2048 beam bathymetry, 8192 pixel sidescan,
-                      binary, parallel bathymetry and amplitude files, WHOI DSL.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  112 </LI>
-
-<UL>
-<LI>Format name:          MBF_DSL120SF</LI>
-
-<LI>Informal Description: WHOI DSL AMS-120 processed format</LI>
-
-<LI>Attributes:           2048 beam bathymetry, 8192 pixel sidescan,
-                      binary, single files, WHOI DSL.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  121 </LI>
-
-<UL>
-<LI>Format name:          MBF_GSFGENMB</LI>
-
-<LI>Informal Description: SAIC Generic Sensor Format (GSF)</LI>
-
-<LI>Attributes:           variable beams,  bathymetry and amplitude,
-                      binary, single files, SAIC. </LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  131 </LI>
-
-<UL>
-<LI>Format name:          MBF_MSTIFFSS</LI>
-
-<LI>Informal Description: MSTIFF sidescan format</LI>
-
-<LI>Attributes:           variable pixels,  sidescan,
-                      binary TIFF variant, single files, Sea Scan. </LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  132 </LI>
-
-<UL>
-<LI>Format name:          MBF_EDGJSTAR</LI>
-
-<LI>Informal Description: Edgetech Jstar format</LI>
-
-<LI>Attributes:           variable pixels, dual frequency sidescan and subbottom,
-                      binary SEGY variant, single files,
-                      low frequency sidescan returned as
-                      survey data, Edgetech. </LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  133 </LI>
-
-<UL>
-<LI>Format name:          MBF_EDGJSTR2</LI>
-
-<LI>Informal Description: Edgetech Jstar format</LI>
-
-<LI>Attributes:           variable pixels, dual frequency sidescan and subbottom,
-                      binary SEGY variant, single files,
-                      high frequency sidescan returned as
-                      survey data, Edgetech. </LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  141 </LI>
-
-<UL>
-<LI>Format name:          MBF_OICGEODA</LI>
-
-<LI>Informal Description: OIC swath sonar format</LI>
-
-<LI>Attributes:           variable beam bathymetry and
-                      amplitude, variable pixel sidescan, binary,
-		      Oceanic Imaging Consultants</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  142 </LI>
-
-<UL>
-<LI>Format name:          MBF_OICMBARI</LI>
-
-<LI>Informal Description: OIC-style extended swath sonar format</LI>
-
-<LI>Attributes:           variable beam bathymetry and
-                      amplitude, variable pixel sidescan, binary,
-		      MBARI</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  151 </LI>
-
-<UL>
-<LI>Format name:          MBF_OMGHDCSJ</LI>
-
-<LI>Informal Description: UNB OMG HDCS format (the John Hughes Clarke format)</LI>
-
-<LI>Attributes:           variable beam bathymetry and
-                      amplitude, variable pixel sidescan, binary,
-		      UNB</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  160 </LI>
-
-<UL>
-<LI>Format name:          MBF_SEGYSEGY</LI>
-
-<LI>Informal Description: SEGY seismic data format</LI>
-
-<LI>Attributes:           seismic or subbottom trace data,
-                      single beam bathymetry, nav,
-                      binary, SEG (SIOSEIS variant)</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  161 </LI>
-
-<UL>
-<LI>Format name:          MBF_MGD77DAT</LI>
-
-<LI>Informal Description: NGDC MGD77 underway geophysics format</LI>
-
-<LI>Attributes:           single beam bathymetry, nav, magnetics,
-                      gravity, ascii, NOAA NGDC</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  162 </LI>
-
-<UL>
-<LI>Format name:          MBF_ASCIIXYZ</LI>
-
-<LI>Informal Description: Generic XYZ sounding format</LI>
-
-<LI>Attributes:           XYZ (lon lat depth) ASCII soundings, generic</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  163 </LI>
-
-<UL>
-<LI>Format name:          MBF_ASCIIYXZ</LI>
-
-<LI>Informal Description: Generic YXZ sounding format</LI>
-
-<LI>Attributes:           YXZ (lat lon depth) ASCII soundings, generic</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  164 </LI>
-
-<UL>
-<LI>Format name:         MBF_HYDROB93</LI>
-
-<LI>Informal Description: NGDC binary hydrographic sounding format</LI>
-
-<LI>Attributes:           XYZ (lon lat depth) binary soundings</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  165 </LI>
-
-<UL>
-<LI>Format name:          MBF_MBARIROV</LI>
-
-<LI>Informal Description: MBARI ROV navigation format</LI>
-
-<LI>Attributes:           ROV navigation, MBARI</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  166 </LI>
-
-<UL>
-<LI>Format name:          MBF_MBPRONAV</LI>
-
-<LI>Informal Description: MB-System simple navigation format</LI>
-
-<LI>Attributes:           navigation, MBARI</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  167 </LI>
-
-<UL>
-<LI>Format name:          MBF_NVNETCDF</LI>
-
-<LI>Informal Description: CARAIBES CDF navigation</LI>
-
-<LI>Attributes:           netCDF, IFREMER.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  168 </LI>
-
-<UL>
-<LI>Format name:          MBF_ASCIIXYT</LI>
-
-<LI>Informal Description: Generic XYT sounding format</LI>
-
-<LI>Attributes:           XYT (lon lat topography) ASCII soundings, generic</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  169 </LI>
-
-<UL>
-<LI>Format name:          MBF_ASCIIYXT</LI>
-
-<LI>Informal Description: Generic YXT sounding format</LI>
-
-<LI>Attributes:           YXT (lat lon topograpy) ASCII soundings, generic</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  170 </LI>
-
-<UL>
-<LI>Format name:          MBF_MBARROV2</LI>
-
-<LI>Informal Description: MBARI ROV navigation format</LI>
-
-<LI>Attributes:           ROV navigation, MBARI</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  171 </LI>
-
-<UL>
-<LI>Format name:          MBF_HS10JAMS</LI>
-
-<LI>Informal Description: Furuno HS-10 multibeam format,</LI>
-
-<LI>Attributes:           45 beams bathymetry and amplitude,
-                      ascii, JAMSTEC</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  172 </LI>
-
-<UL>
-<LI>Format name:          MBF_HIR2RNAV</LI>
-
-<LI>Informal Description: SIO GDC R2R navigation format</LI>
-
-<LI>Attributes:           R2R navigation, ascii, SIO</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  173 </LI>
-
-<UL>
-<LI>Format name:          MBF_MGD77TXT</LI>
-
-<LI>Informal Description: NGDC MGD77 underway geophysics format</LI>
-
-<LI>Attributes:           single beam bathymetry, nav, magnetics, gravity,
-                      122 byte ascii records with CRLF line breaks, NOAA NGDC</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  174 </LI>
-
-<UL>
-<LI>Format name:          MBF_MGD77TAB</LI>
-
-<LI>Informal Description: NGDC MGD77 underway geophysics format</LI>
-
-<LI>Attributes:           single beam bathymetry, nav, magnetics, gravity,
-                      122 byte ascii records with CRLF line breaks, NOAA NGDC</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  181 </LI>
-
-<UL>
-<LI>Format name:          MBF_SAMESURF</LI>
-
-<LI>Informal Description: SAM Electronics SURF format.</LI>
-
-<LI>Attributes:           variable beams,  bathymetry, amplitude,  and sidescan,
-                      binary, single files, SAM Electronics (formerly Krupp-Atlas Electronik). </LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  182 </LI>
-
-<UL>
-<LI>Format name:          MBF_HSDS2RAW</LI>
-
-<LI>Informal Description: STN Atlas raw multibeam format</LI>
-
-<LI>Attributes:           STN Atlas multibeam sonars, 
-                      Hydrosweep DS2, Hydrosweep MD, 
-                      Fansweep 10, Fansweep 20, 
-                      bathymetry, amplitude, and sidescan,
-                      up to 1440 beams and 4096 pixels,
-                      XDR binary, STN Atlas.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  183 </LI>
-
-<UL>
-<LI>Format name:          MBF_HSDS2LAM</LI>
-
-<LI>Informal Description: L-DEO HSDS2 processing format</LI>
-
-<LI>Attributes:           STN Atlas multibeam sonars, 
-                      Hydrosweep DS2, Hydrosweep MD, 
-                      Fansweep 10, Fansweep 20, 
-                      bathymetry, amplitude, and sidescan,
-                      up to 1440 beams and 4096 pixels,
-                      XDR binary, L-DEO.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  191 </LI>
-
-<UL>
-<LI>Format name:          MBF_IMAGE83P</LI>
-
-<LI>Informal Description: Imagenex DeltaT Multibeam</LI>
-
-<LI>Attributes:           Multibeam, bathymetry, 480 beams, ascii + binary, Imagenex.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  192 </LI>
-
-<UL>
-<LI>Format name:          MBF_IMAGEMBA</LI>
-
-<LI>Informal Description: MBARI DeltaT Multibeam</LI>
-
-<LI>Attributes:           Multibeam, bathymetry, 480 beams, ascii + binary, MBARI.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  201 </LI>
-
-<UL>
-<LI>Format name:          MBF_HYSWEEP1</LI>
-
-<LI>Informal Description: HYSWEEP multibeam data format</LI>
-
-<LI>Attributes:           Many multibeam sonars, 
-                      bathymetry, amplitude
-                      variable beams, ascii, HYPACK.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  211 </LI>
-
-<UL>
-<LI>Format name:          MBF_XTFB1624</LI>
-
-<LI>Informal Description: XTF format Benthos Sidescan SIS1624</LI>
-
-<LI>Attributes:           variable pixels, dual frequency sidescan and subbottom,
-                      xtf variant, single files,
-                      low frequency sidescan returned as
-                      survey data, Benthos. </LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  221 </LI>
-
-<UL>
-<LI>Format name:          MBF_SWPLSSXI</LI>
-
-<LI>Informal Description: SEA interferometric sonar vendor intermediate format</LI>
-
-<LI>Attributes:           SEA SWATHplus,
-                      bathymetry and amplitude,
-                      variable beams, binary, SEA.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  222 </LI>
-
-<UL>
-<LI>Format name:          MBF_SWPLSSXP</LI>
-
-<LI>Informal Description: SEA interferometric sonar vendor processed data format</LI>
-
-<LI>Attributes:           SEA SWATHplus,
-                      bathymetry and amplitude,
-                      variable beams, binary, SEA.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  231 </LI>
-
-<UL>
-<LI>Format name:          MBF_3DDEPTHP</LI>
-
-<LI>Informal Description: 3DatDepth prototype binary swath mapping LIDAR format</LI>
-
-<LI>Attributes:           3DatDepth LIDAR, variable pulses, bathymetry and amplitude, 
-                      binary, 3DatDepth.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  241 </LI>
-
-<UL>
-<LI>Format name:          MBF_WASSPENL</LI>
-
-<LI>Informal Description: WASSP Multibeam Vendor Format</LI>
-
-<LI>Attributes:           WASSP multibeams, 
-                      bathymetry and amplitude,
-		      122 or 244 beams, binary, Electronic Navigation Ltd.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>MBIO Data Format ID:  251 </LI>
-
-<UL>
-<LI>Format name:          MBF_PHOTGRAM</LI>
-
-<LI>Informal Description: Example format</LI>
-
-<LI>Attributes:           Name the relevant sensor(s), 
-                      what data types are supported
-                      how many beams and pixels, file type (ascii, binary, netCDF), Organization that defined this format.</LI>
-</UL>
-</UL>
-
-<CENTER><P><BR>
-Last Updated: $Id: mb_format.h 2224 2015-02-04 19:14:05Z caress $ $Revision: $</P></CENTER>
-
-<P>
-<HR WIDTH="100%"></P>
-
-<P><IMG SRC="mbsystem_logo_small.gif" HEIGHT=55 WIDTH=158><A HREF="mbsystem_home.html">Back
-to MB-System Home Page...</A></P>
-
-</BODY>
-</HTML>
diff --git a/src/html/mbsystem_future.html b/src/html/mbsystem_future.html
deleted file mode 100644
index edefb40..0000000
--- a/src/html/mbsystem_future.html
+++ /dev/null
@@ -1,122 +0,0 @@
-<!DOCTYPE html PUBLIC "-//w3c//dtd html 4.0 transitional//en">
-<html>
-<head>
-  <title>MB-System Development Plan</title>
-  <meta content="text/html" http-equiv="Content-Type">
-  <meta content="MB-System: Mapping the Seafloor" name="Title">
-  <meta content="David Caress, Dale Chayes" name="Author">
-  <meta
- content="open source software for processing bathymetry and backscatter data from multibeam and sidescan sonar"
- name="Description">
-  <meta
- content="seafloor,mapping,multibeam,sonar,bathymetry,sidescan,swath processing,open,source,software"
- name="Keywords">
-</head>
-<body alink="#cc9900" vlink="#997040" link="#336699" bgcolor="#ffffff"
- text="#000000">
-<center>
-<h1>MB-System Development Plan</h1>
-</center>
-<p>On January 17-18, 2012, an MB-System planning meeting was held at the Lamont-Doherty Earth Observatory to define the priorities for the next five years of MB-System development. This meeting brought together  a small group composed of the core MB-System developers, users that have substantially contributed to the project over the past few years, and representatives of organizations that have expressed interest in parallel development efforts contributing to MB-System.The priorities id [...]
-<p>Full notes from this meeting have been posted <a href="http://www.mbari.org/data/mbsystem/2012NSFProposal/20120117MBPlanning.html">here</a> and <a href="http://www.ldeo.columbia.edu/res/pi/MB-System/2012NSFProposal/20120117MBPlanning.html">here</a>.
-<br>The proposal has been posted <a href="http://www.mbari.org/data/mbsystem/2012NSFProposal/20120815MB-SystemNSFProposal.pdf">here</a> and <a href="http://www.ldeo.columbia.edu/res/pi/MB-System/2012NSFProposal/20120815MB-SystemNSFProposal.pdf">here</a>.</p>
-<p>The focus of the NSF-funded software development efforts at MBARI and L-DEO will be:</p>
-<ul>
-  <li><strong>Re-architect underlying MBIO library</strong><br>The scope of requested new capabilities require substantially recasting the MBIO application programming interface (API) and the associated functions:</li>
-  <ul>
-    <li>Store and pass beam quality information needed for determining if soundings meet IHO (International Hydrographic Organization) quality standards.</li>
-    <li>Recast the internal coordinate systems consistently through the code.</li>
-    <li>Handle corrections to sensor offsets and biases for all sensors.</li>
-  </ul>
-</ul>
-<ul>
-  <li><strong>Support new and important data formats</strong></li>
-  <ul>
-    <li>Keep up to date with data from Kongsberg multibeam installations on UNOLS vessels</li>
-    <li>Keep up to date ith data from Reson multibeam installations on WHOI NSDF platforms (Sentry, Jason, Alvin)</li>
-    <li>Support input from Bathymetry Attributed Grid (BAG) files</li>
-    <li>Support other data formats associated with NSF-supported projects as they become relevant.</li>
-  </ul>
-</ul>
-<ul>
-  <li><strong>Improve performance of common tasks</strong>
-<br>Several straightforward improvements have been identified that can substantially reduce the time required for analysis and processing:</li>
-  <ul>
-    <li>Augmenting the datalist scheme so that surveys as well as individual files have .inf metadata files, and thus data trees outside bounds of interest can be skipped.</li>
-    <li>Recasting ancillary files (esp. fbt) for improved read performance.</li>
-    <li>Allow raw files and processed files to be located on different filesystems to improve processing performance.</li>
-  </ul>
-</ul>
-<ul>
-  <li><strong>Fix existing problems with support of current generation Kongsberg data</strong>
-  <br>The beam angles for current generation Kongsberg multibeam sonar data are not calculated correctly, and an iterative method used to estimate these angles in an optional pre-processing stage is slow. Fixing this issue is high priority.<strong></strong></li>
-</ul>
-<ul>
-  <li><strong>Improve <em>mbeditivz</em></strong>
-<br>Improve patch test calibration capability of <em>mbeditviz</em> by allowing the soundings to be colored according to a variety of parameters.</li>
-</ul>
-<ul>
-  <li><strong>Add capability to generate additional data products:</strong></li>
-  <ul>
-    <li>Shapefiles for ESRI and other GIS</li>
-    <li>KML file for Google Earth</li>
-    <li>Bathymetry Attributed Grid (BAG) files</li>
-  </ul>
-</ul>
-<ul>
-  <li><strong>Support reading from compressed files in gzip format.</strong>
-<br>This will reduce data storage requirements, and is a priority of NGDC, MGDS, and R2R.</li>
-</ul>
-<ul>
-  <li><strong>Rewrite the graphical utilities to use Qt graphics </strong>
-  <br>The interactive programs currently use obsolete Motif/X11 graphics. In addition to improving performance and moving MB to a modern graphics context, switching to Qt will enable true cross-platform portability, including to Windows computers. </li>
-</ul>
-<ul>
-  <li><strong>Develop tools for working with multibeam water column data</strong>
-  <br>The use of recorded beamformed time series data from multibeam sonars to image biological and other water column targets is of great interest to many users. This issue was the highest ranked desired capability at the MB-System planning meeting. Water column data are also an asset in troubleshooting interference in multibeam sonar systems. We will develop a new MB-System tool to display water column data and to identify and display targets. <strong><u></u></strong></li>
-</ul>
-<ul>
-  <li><strong>Implement the CHRT algorithm as an MB-System tool. </strong>
-  <br>CUBE is an algorithm developed by Brian Calder [Calder and Mayer, 2003] that automatically processes swath bathymetry soundings and provides depth estimates and uncertainties at defined points and identifies soundings inconsistent with the best estimates. Thus, CUBE can be used both to identify bad (or suspect) soundings and to generate gridded bathymetry models. This is a particularly useful feature in shallow water data sets with very large numbers of tracks and soundings. The CU [...]
-</ul>
-<ul>
-  <li><strong>Develop real-time display tool</strong>
-  <br>We will implement a display tool that reads swath data from real-time streams, updates a gridded representation of the bathymetry, and displays the current grid and tracklines in a 2D/3D view using the new, Qt-based <em>mbview</em> visualization library.</li>
-</ul>
-<ul>
-  <li><strong>Develop a “test suite” to allow automatic determination that an MB-System installation is successful. </strong>
-  <br>As MB-System has become more complex it has become clear that we need an automated method to verify new builds. Using our existing example data set, we will develop a test procedure implemented in a script that will exercise a new build of MB-System and compare the results against a pre-defined set of results. </li>
-</ul>
-<p>The participants of the MB-System planning meeting also identified updating documentation and improving training resources for both users and developers as significant priorities. We plan to:</p>
-<ul>
-  <li><strong>Rewrite the MB-System Cookbook to reflect the current software. </strong>
-  <br>We will rewrite the cookbook to reflect the current state of the software.<strong></strong></li>
-</ul>
-<ul>
-  <li><strong>Create an MB-System Wiki to store and disseminate user-created documentation and training materials. </strong>
-  <br>A number of users have created their own MB-System presentations, how-to documents, and even some quite good how-to videos. </li>
-</ul>
-<ul>
-  <li><strong>Hold MB-System workshops to assist groups that want to develop data format modules and applications and for user training. </strong>
-    <br>
-    We proposed to hold annual workshops intended for 10-20 participants each. During years 1, 3, and 5 we intended to hold developer workshops at MBARI. During years 2 and 4 we intended to hold user workshops at LDEO.
-    <ul>
-      <li>NSF was unable to fund these workshops</li>
-      <li>We are looking for alternative support for at least some workshops.</li>
-    </ul>
-  </li>
-</ul>
-<center>
-  <p><br>
-Last Updated: $Id: mbsystem_future.html 2135 2013-08-07 23:29:13Z caress $</p>
-</center>
-<p>
-</p>
-<hr width="67%">
-<p><a href="mbsystem_home.html"><img align="bottom" width="158"
- height="55" border="0" src="mbsystem_logo_small.gif"></a><a
- href="mbsystem_home.html">Back
-to MB-System Home Page...</a>
-</p>
-</body>
-</html>
diff --git a/src/html/mbsystem_home.html b/src/html/mbsystem_home.html
deleted file mode 100644
index e1c1169..0000000
--- a/src/html/mbsystem_home.html
+++ /dev/null
@@ -1,312 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
-<html>
-<head>
-  <title>MB-System Documentation</title>
-  <meta http-equiv="Content-Type" content="text/html">
-  <meta name="Title" content="MB-System: Mapping the Seafloor">
-  <meta name="Author" content="David Caress, Dale Chayes">
-  <meta name="Description"
- content="open source software for processing bathymetry and backscatter data from multibeam and sidescan sonar">
-  <meta name="Keywords"
- content="seafloor,mapping,multibeam,sonar,bathymetry,sidescan,swath processing,open,source,software">
-</head>
-<body alink="#cc9900" bgcolor="#ffffff" link="#336699" text="#000000"
- vlink="#997040">
-<h2 align="center"><img src="mbsystem_logo.gif" height="207" width="616"></h2>
-<center>
-<dl>
-  <dt><b><font size="+2">Seafloor Mapping Software:</font></b></dt>
-</dl>
-</center>
-<center>
-<dl>
-  <dt><b><font size="+2">Processing and Display</font></b></dt>
-</dl>
-</center>
-<center>
-<dl>
-  <dt><b><font size="+2">of Swath Sonar Data</font></b></dt>
-</dl>
-</center>
-<center>
-<dl>
-  <dt><b> </b></dt>
-</dl>
-</center>
-<center>
-<dl>
-  <dt><b><font size="+1"><a href="http://www.mbari.org/staff/caress">David
-W. Caress</a> (1) and <a href="http://www.ldeo.columbia.edu/%7Edale">Dale
-N. Chayes</a> (2)</font></b></dt>
-</dl>
-</center>
-<center>
-<dl>
-  <dt><b>1. <a href="http://www.mbari.org/">Monterey Bay Aquarium
-Research Institute</a></b></dt>
-</dl>
-</center>
-<center>
-<dl>
-  <dt><b>2. <a href="http://www.ldeo.columbia.edu/">Lamont-Doherty
-Earth Observatory</a></b></dt>
-</dl>
-</center>
-<center>
-<dl>
-  <dt><b>of <a href="http://www.columbia.edu/">Columbia University</a></b></dt>
-</dl>
-</center>
-<center>
-<p></p>
-<hr width="67%">
-<p></p>
-</center>
-<center>
-<dl>
-  <dt><b><font size="+1">Introduction</font></b></dt>
-</dl>
-</center>
-<p>MB-System is an open source software package for the processing and
-display of bathymetry and backscatter imagery data derived from
-multibeam,
-interferometry, and sidescan sonars. This software is distributed
-freely (and
-for free) in the form of source code for Unix platforms. The heart of
-the
-system is an input/output library called MBIO which allows programs to
-work
-transparently with any of a number of supported swath sonar data
-formats.
-This approach has allowed the creation of "generic" utilities which can
-be
-applied in a uniform manner to sonar data from a variety of sources.
-Most of
-the programs are command-line tools, but the package does include
-graphical
-tools for editing swath bathymetry, editing navigation, modeling
-bathymetry
-calculation, and adjusting survey navigation.</p>
-<p>The acronym MB stands for MultiBeam; this reflects the fact that the
-early
-development of MB-System focused on processing data from deep sea multibeam sonars (which were the only kind around back then). However, MB-System now supports several data formats from
-sidescan
-and interferometric sonars and works with data from all depth ranges.</p>
-<p>The <a href="http://www.nsf.gov">National Science Foundation</a>
-(NSF) has
-been the primary supporter of MB-System development. NSF initially
-provided
-grants to the authors at the <a href="http://www.ldeo.columbia.edu">
-Lamont-Doherty Earth Observatory</a> in 1993 (two years), and 1995
-(five
-years). <a href="http://www.seabeam.com/"> SeaBeam Instruments</a>
-also
-contributed significant effort from 1994 to 1999. This support has been
-renewed
-through successive parallel five year grants (2001-2006, 2006-2011, 2013-2017) to Caress at the <a
- href="http://www.mbari.org"> Monterey Bay Aquarium Research Institute</a>
-(MBARI) and to Chayes at Lamont. Since 2001, MBARI, with support from the Packard Foundation, has matched 
-the NSF support as part of its seafloor mapping program. </p>
-<p>The original NSF mandate was to create a set of generic tools which
-would
-work with all of the sonar data used in NSF-supported projects. Not
-surprisingly, the core of the MB-System user community consists of
-NSF-supported researchers at U.S. institutions such as the
-Lamont-Doherty
-Earth Observatory, the Scripps Institution of Oceanography, and the
-Woods
-Hole Oceanographic Institution. However, MB-System has also come to be
-used
-widely in the international marine geological community.</p>
-<p>The MB-System source code is distributed under the <a
- href="gpl.html"> GNU
-General Public License</a> as formulated by the <a
- href="http://www.gnu.org/">GNU Project.</a> MB-System
-installation depends on
-some other software packages (e.g. <a
- href="http://gmt.soest.hawaii.edu/"> GMT</a> and <a
- href="http://www.unidata.ucar.edu/software/netcdf/">netCDF</a> ), all of
-which are freely available as source code.</p>
-<p>This documention is distributed with and refers to the MB-System release
-with <a href="mbsystem_version.txt">this version</a>.</p>
-<center>
-<p></p>
-<hr width="67%">
-<p></p>
-</center>
-<center>
-<dl>
-  <dt><b><font size="+1">Information About MB-System:</font></b></dt>
-</dl>
-</center>
-<ul>
-  <li><a href="mbsystem_whatsnew.html">What's new in MB-System version 5</a></li>
-  <li><a href="mbsystem_capabilities.html">Short list of capabilities</a></li>
-  <li><a href="mbsystem_man_list.html">List of MB-System programs and
-links to manual pages</a></li>
-  <li><a href="mbsystem_formats.html">List of supported swath data
-formats</a></li>
-  <li><a href="mbsystem_how_to_get.html">How to get and install
-MB-System</a></li>
-  <li><a href="mbsystem_faq.html">Frequently Asked Questions (and
-answers)</a></li>
-  <li><a href="mbsystem_future.html">Future MB-System development plans</a></li>
-  <li><a href="mbsystem_copyright.html">Copyright and Caveat</a></li>
-</ul>
-<center>
-<p></p>
-<hr width="67%">
-<p></p>
-</center>
-<center>
-<center>
-<dl>
-  <dt><b><font size="+1">Contacting the MB-System Team:</font></b></dt>
-</dl>
-</center>
-<div style="text-align: justify;">
-Although the MB-System authors' personal email addresses are listed
-below, we
-greatly prefer that all inquiries, requests, and problem reports
-regarding
-MB-System be directed to the <a
- href="http://listserver.mbari.org/sympa/arc/mbsystem">MB-System
-Discussion list</a>.<br>
-<br>
-<span style="text-decoration: underline;"></span></div>
-<center>
-<hr width="67%"></center>
-<dl>
-  <dt><a name="MB-authors"></a> <b><font size="+1">The MB-System Core Team</font><font size="+1">:
-    </font></b></dt>
-</dl>
-</center>
-<center>
-<table cellpadding="0" cellspacing="0" width="100%">
-  <tbody>
-    <tr>
-      <td align="center" valign="top">
-      <dt><img alt="David W. Caress 2001" src="caress2001.gif" width="120"></dt>
-        <dt><b><a href="http://www.mbari.org/staff/caress">David W. Caress</a></b></dt>
-        <dt><a href="mailto:caress at mbari.org">caress at mbari.org</a></dt>
-        <dt>Software Engineer</dt>
-        <dt><a href="http://www.mbari.org">Monterey Bay Aquarium Research Institute</a></dt>
-        <dt>7700 Sandholdt Road</dt>
-        <dt>Moss Landing, CA 95039</dt>
-        <dt> </dt>
-      </td>
-    </tr>
-    <tr>
-      <td align="center" valign="top">
-      <dl>
-     <dt><img alt="Dale N. Chayes 2003" src="ChayesJul2003.gif" width="120"></dt>
-      <dt><b><a href="http://www.ldeo.columbia.edu/%7Edale">Dale N. Chayes</a></b></dt>
-        <dt><a href="mailto:dale at ldeo.columbia.edu">dale at ldeo.columbia.edu</a></dt>
-        <dt>Research Engineer</dt>
-        <dt><a href="http://www.ldeo.columbia.edu">Lamont-Doherty
-Earth Observatory</a> of <a href="http://www.columbia.edu">Columbia
-University</a></dt>
-        <dt>Palisades, NY 10964</dt>
-        <dd> </dd>
-      </dl>
-      </td>
-    </tr>
-    <tr>
-      <td align="center" valign="top">
-      <dt><img src="Christina_d_S_Ferreira_crop.jpg" width="120" alt="Christian dos Santos Ferreira 2014"></dt>
-      <dt><b><a href="https://www.marum.de/en/Christian_dos_Santos_Ferreira.html">Christian dos Santos Ferreira</a></b></dt>
-        <dt><a href="mailto:cferreira at marum.de">cferreira at marum.de</a></dt>
-        <dt>Seafloor Imaging Specialist<br>
-          <a href="http://www.marum.de">MARUM - Center for Marine Environmental Sciences</a><br>
-          <a href="http://www.uni-bremen.de">University of Bremen</a>, </dt>
-        <dt>Bremen, Germany</dt>
-        <dt> </dt>
-      </td>
-    </tr>
-  </tbody>
-</table>
-</center>
-<dd><br>
-</dd>
-<center>
-<p></p>
-<hr width="67%">
-<p></p>
-</center>
-<center>
-<dl>
-  <dt><a name="MB-documentors"></a> <b><font size="+1"> Documentation:</font></b></dt>
-</dl>
-</center>
-<center>
-
-<table cellpadding="0" cellspacing="0" width="100%">
-  <tbody>
-    <tr>
-      <td height="384" align="center" valign="top">
-      <div align="center">
-      <dt><img alt="Krystle Anderson 2013" src="KrystleAnderson2013.gif" width="120"></dt>
-        <dt><b>Krystle Anderson</b></dt>
-        <dt><a href="mailto:krystle at mbari.org">krystle at mbari.org</a></dt>
-        <dt>Research Technician</dt>
-        <dt><a href="http://www.mbari.org">Monterey Bay Aquarium Research Institute</a></dt>
-        <dt>7700 Sandholdt Road</dt>
-        <dt>Moss Landing, CA 95039</dt>
-        <dt> </dt>
-        <dt></dt>
-      </div>
-      <div align="center">
-      <dt><img alt="Val Schmidt at LDEO in July 2003" src="ValJul2003.gif" width="120"></dt>
-        <dt><b>Val Schmidt</b></dt>
-        <dt>(Emeritus)</dt>
-        <dt><a href="mailto:vschmidt at ccom.unh.edu">vschmidt at ccom.unh.edu</a></dt>
-        <dt>Research Engineer</dt>
-        <dt><a href="http://www.ccom.unh.edu">Center of Coastal and Ocean Mapping</a></dt>
-        <dt><a href="http://www.ccom.unh.edu">Joint Hydrographic Center</a> of</dt>
-        <dt><a href="http://www.unh.edu">University of New Hampshire</a></dt>
-        <dt>Durham, NH 03824</dt>
-      </div>
-      </td>
-    </tr>
-  </tbody>
-</table>
-</center>
-<center>
-<hr width="67%">
-<p></p>
-</center>
-<center>
-<dl>
-  <dt><a name="MB-team"></a> <b><font size="+1">The MB-System Team 2014:</font></b></dt>
-</dl>
-</center>
-<center>
-<dl>
-  <dt><b><font size="+1"><img alt="Ferreira, Caress, Chayes at MBARI February 2014" src="caress_chayes_ferreira_Feb2014.jpg"> </font></b></dt>
-</dl>
-</center>
-<center>
-<dl>
-  <dt><a name="MB-team"></a> <b><font size="+1">The MB-System Team circa 2003:</font></b></dt>
-</dl>
-</center>
-<center>
-<dl>
-  <dt><b><font size="+1"><img alt="July 2003 at IRI Building, LDEO" src="MBTeamJul2003.jpg"> </font></b></dt>
-</dl>
-</center>
-<dl>
-  <dt><br>
-  </dt>
-</dl>
-<center>
-<p>Last Updated: $Id: mbsystem_home.html 2180 2014-04-02 20:58:34Z caress $</p>
-</center>
-<p></p>
-<div align="center">
-<hr width="67%"></div>
-<br>
- 
-<p></p>
-</body>
-</html>
diff --git a/src/html/mbsystem_how_to_get.html b/src/html/mbsystem_how_to_get.html
deleted file mode 100644
index 84314eb..0000000
--- a/src/html/mbsystem_how_to_get.html
+++ /dev/null
@@ -1,492 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
-<html>
-<head>
-  <title>How to Get and Install MB-System</title>
-  <meta content="text/html" http-equiv="Content-Type">
-  <meta content="MB-System: Mapping the Seafloor" name="Title">
-  <meta content="David Caress, Dale Chayes" name="Author">
-  <meta
- content="open source software for processing bathymetry and backscatter data from multibeam and sidescan sonar"
- name="Description">
-  <meta
- content="seafloor,mapping,multibeam,sonar,bathymetry,sidescan,swath processing,open,source,software"
- name="Keywords">
-</head>
-<body alink="#cc9900" vlink="#997040" link="#336699" bgcolor="#ffffff"
- text="#000000">
-<center>
-  <dd><a name="MB-get-and-install"></a><b><font size="+2">How to Get and Install MB-System</font></b></dd>
-</center>
-<ul>
-  <ul>
-<ul>
-    <li><a href="#MB-get">How to get the MB-System source distribution</a></li>
-    <li><a href="#Subversion">Access MB-System source version control system</a></li>
-    <li><a href="#MB-dist">Packaged MB-System distributions</a></li>
-    <li><a href="#MB-required">Other required and suggested software and data</a></li>
-    <li><a href="#MB-unpack">How to unpack an MB-System source code distribution</a></li>
-    <li><a href="#MB-install">How to install MB-System using the configure script</a></li>
-</li>
-</ul>
-</ul>
-</ul>
-<center>
-<p></p>
-<hr width="67%">
-<p></p>
-</center>
-<center>
-  <dd><a name="MB-get"></a><b><font size="+2">How to Get The MB-System Source Distribution</font></b></dd>
-</center>
-<p>The source code for MB-System is available as a compressed tar
-archive
-by anonymous ftp to the Lamont-Doherty Earth Observatory of Columbia
-University.
-This archive file is about 3 megabytes in size and, depending on the
-speed of your internet connection, may take a few minutes to transfer.</p>
-<p>Click<a
- href="ftp://ftp.ldeo.columbia.edu/pub/MB-System/MB-System.tar.gz"> here to ftp</a> the current MB-System release as a compressed tar archive.</p>
-<p>Click <a href="ftp://ftp.ldeo.columbia.edu/pub/MB-System/">here to
-get point-and-click ftp access</a> to all of the MB-System related
-files
-available from Lamont (these may include data examples and beta
-distributions
-of MB-System ).</p>
-<p>If access through the above links fails, try running ftp from a
-terminal shell.
-The following commands represent a typical anonymous ftp session (note
-that
-your at email.address literally means to enter your email address, and that many modern ftp clients do not require the "binary" command).</p>
-<ul>
-  % ftp ftp.ldeo.columbia.edu<br>
-Name: anonymous<br>
-Password: your at email.address<br>
-> cd pub/MB-System<br>
-> binary<br>
-> get MB-System.tar.gz<br>
-> quit<br>
-</ul>
-If anonymous ftp fails with an error message like: "Sorry no DNS entry"
-after the email address is entered as the anonymous password, this
-means that the internet address (also called IP address) of the
-computer in use is
-not known to the Lamont network to be legitimate. As a security
-measure,
-illegitimate IP addresses are not allowed to connect to the Lamont
-network.
-The Lamont ftp server attempts to look up or resolve IP addresses using
-the primary Domain Name Service (DNS) servers associated with the
-internet as a whole. So, this problem arises when computers use IP
-addresses are not properly registered with the global DNS servers. This
-situation sometimes
-exists for computers connecting through improperly configured firewalls
-or Network Address Translation (NAT) devices. Users facing this issue
-can often
-succeed by running ftp from a "better connected" server in their
-organization. Otherwise, they will need to contact their internet
-service
-provider or their network/computing support staff.
-
-<center>
-<p></p>
-<hr width="67%">
-<p></p>
-</center>
-<center>
-  <dt><b><font size="+2"><a name="Subversion" id="Subversion"></a>Access MB-System Source Version Control System</font></b></dt>
-</center>
-<dl>
-  <dt>
-The MB-System source code is archived and managed using  <a href="http://subversion.tigris.org/">Subversion</a>, an open source version control system. The MB-System and MB-Cookbook Subversion repositories can be browsed through a web interface at: </dt>
-  <dd><a href="http://svn.ilab.ldeo.columbia.edu/">http://svn.ilab.ldeo.columbia.edu/</a></dd>
-  <dt> </dt>
-  <dt>The MB-System repository is at:</dt>
-  <dd><a href="http://svn.ilab.ldeo.columbia.edu/listing.php?repname=MB-System">http://svn.ilab.ldeo.columbia.edu/listing.php?repname=MB-System</a></dd>
-  <dt>The entire repository, or individual files, can be downloaded through this web interface. Clicking the the link above to bring up the WebSVN interface showing the most recent revision to the MB-System code base, along with a list of paths including "branches", "tags", and "trunk". To download the entire code base, click on the "Download" link to the right of  "trunk". To browse the structure and download individual files, click on the "trunk" link. Users can build MB-System using t [...]
-</dl>
-
-
-<center>
-  <p></p>
-  <hr width="67%">
-  <p></p>
-</center>
-<center><a name="MB-dist"></a><b><font size="+2">Packaged MB-System Distributions</font></b></dd>
-</center>
-<p>MB-System is included in <a href="http://sites.google.com/site/poseidonlinux/">Poseidon Linux</a>, the "Scientific GNU/Linux". Poseidon is an Ubuntu Linux based distribution including a selection of open source software packages intended to support scientific research. In particular, it offers several specific tools in the areas of GIS, 3D Visualization, Mathematics, Statistics and several other fields of research.</p>
-  <p>MB-System has been packaged for MacOS X as part of the <a href="http://www.finkproject.org/">Fink Project</a>. The MB-System Fink package can be found at:</p>
-<dd><a href="http://pdb.finkproject.org/pdb/package.php/mbsystem">http://pdb.finkproject.org/pdb/package.php/mbsystem</a></dd>
-  <p>MB-System has also been packaged for MacOs X as part of <a href="http://brew.sh">Homebrew</a>.
- If you have Homebrew installed, then MB-System and its prerequisites can be installed using these two commands:</p>
-<dd>brew tap homebrew/science</dd>
-<dd>brew install mbsystem</dd>
-<p>The <a href="http://live.osgeo.org/">OSGeo-Live</a>
-  distribution includes MB-System. OSGeo-Live is a self-contained bootable DVD, USB thumb drive or Virtual Machine based on <a href="http://xubuntu.org">Xubuntu</a> that includes a wide variety of open source geospatial software.
-<p>The <a href="http://www.sio.ucsd.edu/">Scripps Institution of Oceanography</a>'s <a href="https://scripps.ucsd.edu/ships/shipboard-technical-support/">Shipboard Technical Support</a> group maintains a repository of open source software RPM distributions for Red Hat Enterprise Linux and CentOS Linux. This repository includes both source and binary distributions of MB-System, GMT, and netCDF that can be accessed using the yum utility. The MB-System RPMs require the GMT and netCDF RPMs,  [...]
-  This repository can be found at:
-<ul>
-    <a href="http://sts.ucsd.edu/repos/centos-5/local">http://sts.ucsd.edu/repos/centos-5/local</a>
-</ul>
-  The SIO-STS gpg signing key is
-  <ul>
-    <a href="http://sts.ucsd.edu/repos/centos-5/local/RPM-GPG-KEY-STS">http://sts.ucsd.edu/repos/centos-5/local/RPM-GPG-KEY-STS</a>
-  </ul>
-<p>Thanks to Christian Ferreira for creating and distributing Poseidon Linux, to Kurt Schwehr for maintaing the Fink MB-System package, to Anthony Lukach for maintaining the Homebrew MB-System package, to Hamish Bowman for maintaining the OSGeo-Live MB-System package, and to Frank Delahoyde for maintaining the CentOS MB-System RPM distribution.</p>
-<center>
-  <p></p>
-  <hr width="67%">
-  <p></p>
-</center>
-
-<center><dd><a name="MB-required"></a><b><font size="+2">Other Required
-and
-Suggested Software and Data</font></b></dd>
-</center>
-<p>MB-System requires a number of other software packages and databases
-to be fully functional. These are:</p>
-<ul>
-  <li><b>GMT</b> version 4.5 or later: MB-System makes use of the
-Generic
-Mapping Tools (GMT) libraries and programs for much of its graphics.
-GMT
-also includes a detailed global coastline database. GMT has been
-developed
-by Professor Paul Wessel of SOEST (School of Ocean and Earth Science
-and
-Technology at the Univeristy of Hawaii) and Dr. Walter H. F. Smith of
-NOAA.
-The GMT source code is available from the <a
- href="http://gmt.soest.hawaii.edu/">GMT
-web page</a>.</li>
-  <li><b>NetCDF</b> version 3.5.1 or later: Both GMT and MB-System
-require
-the <a href="http://www.unidata.ucar.edu/software/netcdf/">NCAR
-netCDF
-library</a>.</li>
-  <li><b>Perl</b> version 5.0 or later: Perl is a fast, well
-documented
-scripting language used widely in the Linux/Unix world. MB-System contains a
-number of perl scripts used both for installation and to ease common
-tasks. Most of the current Unix operating systems include perl. If
-you need to obtain the perl source code, first check with your local
-system administrator - you will probably find perl already available
-locally. The perl source code can be obtained from the
-<a href="http://www.gnu.org/directory">GNU
-software archives</a> of the <a href="http://www.gnu.org">Free
-Software Foundation</a>.</li>
-  <li><b>Perl</b> Parallel-Forkmanager module: this Perl module is required for the
-  parallel processing macros mbm_multicopy, mbm_multidatalist, and mbm_multiprocess
-  to work. An easily installed package is available from from www.cpan.org.</li>
-  <li><b>X11</b>: The interactive graphical utilities in MB-System (MBedit, MBnavedit, MBvelocitytool, MBgrdviz, MBeditviz) use and require the X11 windowing system. </li>
-  <li><b>Motif</b>: The interactive graphical utilities in MB-System (MBedit, MBnavedit, MBvelocitytool, MBgrdviz, MBeditviz) use version 2 of the Motif widget set, and Motif libraries
-    are required for these utilities to be built and to run.
-    Most current Unix/Linux operating systems include the required Motif
-    libraries, either in the original proprietary form (Motif), or the not-quite-open-source form (OpenMotif). If you do not have these libraries, the OpenMotif 2 source is available through
-    <a href="http://www.openmotif.org/">Motifzone</a>. An old alternative open source Motif-compatible
-    distribution called LessTif does not work with the current OpenGL based MB-System programs (MBgrdviz, MBeditviz) and should be avoided. </li>
-  <li><strong>FFTW</strong>: The "Fastest Fourier Transform in the West" package is used by the sonagram calculation program MBbsegypsd to calculate, well, Fast Fourier Transforms. <a href="http://www.fftw.org/">FFTW</a> is commonly used and thus available on or for most current Unix operating systems.</li>
-  <li><strong>OTPSnc</strong>: The Oregon State Ocean Tide Prediction Software package is required for the tidal modeling program MBotps (which in fact is just a convenient front end for the old-style-batch interface of OTPS). The OTPSnc package can be obtained from the<a href="http://www.oce.orst.edu/research/po/research/tide/"> tidal modeling group</a> at <a href="http://www.oce.orst.edu/">Oregon State University</a>.</li>
-</ul>
-<p>MB-System produces Postscript based graphics. Most current Unix
-operating
-systems provide a program which serves as a screen-based Postscript
-viewer.
-If you do not have a Postscript viewer, one option is to obtain one of
-several Ghostscript-based
-packages from the Free Software Foundation.</p>
-<ul>
-  <li><b>ghostview</b>: Open source screen Postscript viewer. The
-source code can be obtained from the <a
- href="http://www.gnu.org/directory">GNU
-software archives</a> of the <a href="http://www.gnu.org">Free
-Software
-Foundation</a>.</li>
-</ul>
-<ul>
-  <li><b>gv</b>: Open source screen Postscript viewer. This
-package is a bit more sophisticated than ghostview and can handle
-poster-sized plots. The
-source code can be obtained from the <a
- href="http://www.gnu.org/directory">GNU
-software archives</a> of the <a href="http://www.gnu.org">Free
-Software
-Foundation</a>.</li></ul>
-<p>Users of MacOs X should note that many of the above packages can be
-painlessly installed using the fink package available from the
-<a href="http://fink.sourceforge.net/">Fink Project</a>.</p>
-<center>
-<p></p>
-<hr width="67%">
-</center>
-<center>
-<p><a name="MB-unpack"></a><b><font size="+2">How to Unpack an MB-System Source Code Distribution</font></b></p>
-</center>
-<p>The MB-System source code is extracted from the distribution using the tar utility:</p>
-<ul>
-  <pre>tar xvzf MB-System.tar.gz</pre>
-</ul>
-<p>or for some older systems with feature-limited versions of tar, a combination of gunzip and tar:</p>
-<ul>
-  <pre>gunzip MB-System.tar.gz
-tar xvf MB-System.tar</pre>
-</ul>
-<p>This will create a directory called (for the 5.4.2035 distribution): </p>
-<ul>
-  <pre>mbsystem-5.4.2136</pre>
-</ul>
-<p>In order to build and install MB-System from an interactive shell, you need to change your current directory to the distribution:</p>
-<ul>
-  <pre>cd mbsystem-5.4.2136</pre>
-</ul>
-<center>
-<p></p>
-<hr width="67%">
-</center>
-<center>
-<p><a name="MB-install"></a><b><font size="+2">How to Install MB-System Using the Configure Script</font></b></p>
-</center>
-<p>The configure script has been generated using the autoconf package. The current configure script does not resolve all of the flags and locations needed to build MB-System on all platforms, but does allow for flexible installation and generation and use of shared libraries without requiring interactive editing. These improvements make MB-System distributions much more amenable to inclusion in package manager systems like Debian and Fink. We hope to improve the configure script so that  [...]
-<p>The basic steps for building MB-System using the configure script are:</p>
-<p>1. Move to the top of the MB-System distribution directory:</p>
-<ul>
-        cd mbsystem-5.4.2176
-</ul>
-
-<p>2. Run the configure script to generate the Makefile files throughout the
-    distribution directory structure. The command line options for configure
-    are discussed below.</p>
-<ul>
-        [...pre-options...]./configure [...options...]
-</ul>
-
-    3. Run the make utility to build the software within the source distribution.
-<ul>
-        make
-</ul>
-
-    4. Run the make utility with the install option to install the software
-    within the target location that was specified while running configure. This step copies the libraries, programs, scripts, manual pages, and web pages to the target destinations.
-    <ul>
-        make install
-</ul>
-<p>The configure script is intended to discern the enviroment, locate prerequisite
-packages, and construct the makefiles with a minimum of user intervention. In
-practice, users generally need to set at least some options when using the
-configure script in order to successfully build, install, and run MB-System.
-If NetCDF and GMT installations cannot be located, MB-System cannot be built. If
-FFTW3, Motif, or OpenGL cannot be found MB-System will be built, but without
-the applications that depend on these packages.</p>
-<p>Depending on how user permissions are set on your system and where the package is to be installed, it may be necessary to execute some or all of the above commands with superuser privileges. On older styles of Unix and Linux, this was typically accomplished by using the su command to become root, or superuser, a step that requires knowing the root password for the system. Following a successful invocation of su in a command shell, all commands have superuser privileges. On MacOsX and  [...]
-<ul>
-  <pre>sudo ./configure
-sudo make
-sudo make install</pre>
-</ul>
-<p>The default destination is /usr/local, and so one should find the MB-System executable programs and scripts in /usr/local/bin, the shared libraries in /usr/local/lib, the manual pages in /usr/local/man, and the projection and Levitus databases accessed by MB-System in /usr/local/share/mbsystem. However, one can control the installation destination of the configure script on the command line by using a "--prefix" argument. For example, to install MB-System into /Users/caress/sandbox/mb [...]
-<ul>
-  <pre>sudo ./configure \
---prefix=/Users/caress/sandbox/mbsystem
-</pre>
-</ul>
-<p>The complete list of configure's installation location options is:</p>
-<ul>
-<pre>
---prefix 				This is the common installation prefix for all files.
- 						If exec_prefix is defined to a different value, prefix
- 						is used only for architecture-independent files.
- 						[Default: /usr/local]
---exec_prefix 			The installation prefix for architecture-dependent files.
-						By default it's the same as prefix. You should avoid
-						installing anything directly to exec_prefix. However,
-						the default value for directories containing
-						architecture-dependent files should be relative to
-						exec_prefix.
-						[Default: ${prefix} ==> /usr/local]
---datarootdir 			The root of the directory tree for read-only architecture
-						-independent data files.
-						[Default: ${exec_prefix}/share ==> /usr/local/share]
---bindir 				The directory for installing executables that users run.
-						[Default: ${exec_prefix}/bin ==> /usr/local/bin]
---libdir 				The directory for installing object code libraries.
-						[Default: ${exec_prefix}/lib ==> /usr/local/lib]
---includedir 			The directory for installing C header files.
-						[Default: ${exec_prefix}/include ==> /usr/local/include]
-</pre>
-</ul>
-<p>MB-System depends on librarys from a number of different packages, including NetCDF, GMT, FFTW3, X11, and Motif. Sometimes a user will have more than one installation of a package available, and specifying which is used is desirable. Also, unfortunately the configure script does not always successfully find all needed packages. Consequently, the configure script allows users to set the locations on the command line when necessary. 
-The configure command line options controlling the locations of prerequisites are:</p>
-<ul>
-<pre>
---with-netcdf-lib 		Location of NetCDF libs
---with-netcdf-include 	Location of NetCDF headers
---with-gmt-lib 		Location of GMT libs
---with-gmt-include 	Location of GMT headers
---with-fftw-lib 		Location of FFTW3 libs (optional)
---with-fftw-include 	Location of FFTW3 headers (optional)
---with-motif-lib 		Location of Motif libs (optional)
---with-motif-include 	Location of Motif headers (optional)
---with-opengl-lib 		Location of OpenGL libs (optional)
---with-opengl-include 	Location of OpenGL headers (optional)
---with-otps-dir		Location of OTPS installation (optional)
-</pre>
-</ul>
-<p>The MB-System distribution includes the source code for the PROJ4 package. By default, the configure script seeks to link with a libproj built external to MB-System. Configure accepts the command --enable-bundledproj to build MB-System using the included PROJ4 source.</p>
-<ul>
-<pre>
---enable-bundledproj	Build using bundled proj package - the
-						default is to link with libproj
-</pre>
-</ul>
-<p>Note that specification of FFTW3, Motif, and OpenGL is optional. If the configure script does not find these packages and the user does not specify their locations, then some MB-System programs will not be built. Lack of FFTW3 means that mbsegypsd is not built. No OpenGL results in the visualization programs mbgrdviz and mbeditviz not being built. Lack of Motif means that no graphical programs of any type are built. </p>
-<p>Regardless of where the MB-System programs are installed, users must have that location included in their path environment variable in order to execute the programs from a command line. If MB-System has been installed using a package manager or installed manually into a common location (e.g. /usr/local/bin), the user path probably already references the needed location. If altering the user path variable is required, it can be accomplished by editing the initialization files hidden in [...]
-executable
-<em>perl</em> must also be available in the user's path for most of the macros
-to
-work.</p>
-<p>The GMT version 5 plug-in modules mbcontour, mbswath, and mbgrdtiff are invoked as
-modules of the program gmt:
-<ul>
-<pre>
-gmt mbcontour (....various arguments.....)
-gmt mbswath (....various arguments.....)
-gmt mbgrdtiff (....various arguments.....)
-</pre>
-</ul>
-In order for GMT to successfully execute the MB-System modules, the
-location of the shared library containing these modules must be known to
-GMT. This can be accomplished by either setting the GMT_CUSTOM_LIBS parameter
-in the file gmt.conf that is part of the GMT installation, by setting
-this parameter in the file gmt.conf in the user's home directory, or by using
-the GMT module gmtset to modify this parameter in the current working directory. If, for instance, the mbgmt shared library has been installed in the file /usr/lib/libmbgmt.dylib, then the GMT_CUSTOM_LIBS parameter in a gmt.conf file can be set to:
-<ul><pre>GMT_CUSTOM_LIBS = /usr/lib/libmbgmt.dylib</pre></ul></p>
-<p>Most users will also wish to specify which program they generally
-use to view Postscript plots on their screen. This parameter is set
-with the mbdefaults program (see the mbdefaults manual page for
-details).
-Popular open source options for Postscript display include ghostview and gv (gv is recommended). The postscript plots can also be imported into proprietary tools like Adobe Illustrator, Adobe Acrobat, or Preview on MacOs X. If one is working in a Unix museum, pageview works well on Sun workstations running Solaris, and xpsview is great on on Silicon Graphics machines running Irix.</p>
-
-<strong>Mac OS X</strong>
-<p>Many MacOsX users have their NetCDF, GMT5, FFTW3, and OpenMotif installations through the Fink package manager, which installs packages in /sw. The configure script fails to find packages in /sw, and so the user must explicitly specify those packages. The OTPS tide modeling software used by mbotps is not packaged in Fink, and so must be manually installed by a user if mbotps is to work correctly. Installation of MB-System on a Mac running MacOsX 10.9 or 10.10 will likely use a configu [...]
-<ul>
-<pre>
-sudo CFLAGS="-I/opt/X11/include -L/opt/X11/lib" \
-./configure \
-    --with-netcdf-include=/sw/include \
-    --with-netcdf-lib=/sw/lib \
-    --with-gmt-include=/sw/include/gmt5 \
-    --with-gmt-lib=/sw/lib \
-    --with-proj-include=/sw/include \
-    --with-proj-lib=/sw/lib \
-    --with-fftw-include=/sw/include \
-    --with-fftw-lib=/sw/lib \
-    --with-motif-include=/sw/include \
-    --with-motif-lib=/sw/lib \
-    --with-otps-dir=/usr/local/OTPS2
-</pre>
-</ul>
-<p>As shown here, one can also add to the commands seen by the compiler ("CFLAGS") and linker ("LDFLAGS") if desired or necessary by prefacing the configure command with arguments setting the environment variables CFLAGS and LDFLAGS. Here the current location of X11 header files and libraries must be specified because the new (to MacOsX) location of X11 in /opt is not known to the configure script. Another example is that in order to compile MB-System for user with a debugger, all compil [...]
-<ul>
-<pre>
-sudo CFLAGS="-g -I/opt/X11/include -L/opt/X11/lib" \
-./configure \
-    --with-netcdf-include=/sw/include \
-    --with-netcdf-lib=/sw/lib \
-    --with-gmt-include=/sw/include/gmt5 \
-    --with-gmt-lib=/sw/lib \
-    --with-proj-include=/sw/include \
-    --with-proj-lib=/sw/lib \
-    --with-fftw-include=/sw/include \
-    --with-fftw-lib=/sw/lib \
-    --with-motif-include=/sw/include \
-    --with-motif-lib=/sw/lib \
-    --with-otps-dir=/usr/local/OTPS2
-</pre>
-</ul>
-
-<strong>Ubuntu Linux</strong>
-<p>For Ubuntu Linux 12.04.02LTS, the following use of the apt-get utility will install 
-all of the MB-System prerequisites excepting OTPS:</p>
-<ul>
-<pre>
-sudo apt-get install xorg-dev libmotif-dev libmotif4 libxp-dev mesa-common-dev \
-    libsdl1.2-dev libsdl-image1.2-dev build-essential gfortran \
-    nautilus-open-terminal libfftw3-3 libfftw3-dev \
-    libnetcdf-dev netcdf-bin gdal-bin gdal1-dev gmt libgmt-dev gv
-</pre>
-</ul>
-<p>Because GMT is installed in an unusual way on Ubuntu, it is necessary to augment 
-the PATH and LD_LIBRARY_PATH environment variables by adding the following two
-lines to each user's ~/.bashrc file:</p>
-<ul>
-<pre>
-export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
-export PATH=/usr/lib/gmt/bin:$PATH
-</pre>
-</ul>
-
-<p>By default, the Ubuntu GMT installation is not known to pkg-config, and the installation
-points of the libraries and the header files must be specified:</p>
-<ul>
-  <pre>
-sudo ./configure --prefix=/usr/local \
-    --with-gmt-include=/usr/include/gmt \
-    --with-gmt-lib=/usr/lib
-</pre></ul>
-<p> Although the GMT installation does not include a pkg-config *.pc file, 
-it is simple to construct one. On Ubuntu pkg-config looks in /usr/lib/pkgconfig,
-so one can put a file there called gmt.pc with the contents:
-<ul><pre>
-# start gmt.pc
-prefix=/usr
-exec_prefix=${prefix}
-libdir=${exec_prefix}/lib
-includedir=${prefix}/include/gmt
-ccompiler=gcc
-cppcompiler=g++
-
-Name: gmt
-Description: GMT Libraries
-Version: 4.5.6
-Libs: -L${libdir} -lgmt -lgmtps -lpsl
-Cflags: -I${includedir}
-# end gmt.pc
-</pre></ul>
-
-<p>
-If the GMT installation has been augmented with a /usr/lib/pkgconfig/gmt.pc
-file so that pkg-config knows about GMT, then the configure call to install
-in /usr/local is just: </p>
-<ul>
-  <pre>
-sudo ./configure
-</pre></ul>
-
-<strong>CentOs or Red Hat Linux</strong> 
-
-<p>The package manager usually used on CentOs or Red Hat Linux systems is yum. To install 
-all of the MB-System prerequisites use the command:</p>
-<ul><pre>
-sudo yum install openmotif openmotif-devel fftw fftw-devel netcdf netcdf-devel \
-		proj proj-devel gdal-devel gmt gmt-devel gv nedit
-</pre></ul>
-
-<p>If the prerequisites have all been installed with yum and it is desired to
-install MB-System in /usr/local, then only a simple call to configure is required:</p>
-<ul>
-  <pre>
-sudo ./configure
-</pre></ul>
-
-<center>
-<p><br>
-Last Updated: $Id: mbsystem_how_to_get.html 2225 2015-02-05 07:31:48Z caress $</p>
-</center>
-<p>
-</p>
-<hr width="67%">
-<p></p>
-<p><a href="mbsystem_home.html"><img width="158" height="55" border="0"
- src="mbsystem_logo_small.gif"></a><a href="mbsystem_home.html">Back
-to MB-System Home Page...</a></p>
-</body>
-</html>
diff --git a/src/html/mbsystem_logo.gif b/src/html/mbsystem_logo.gif
deleted file mode 100644
index d07c130..0000000
Binary files a/src/html/mbsystem_logo.gif and /dev/null differ
diff --git a/src/html/mbsystem_logo_small.gif b/src/html/mbsystem_logo_small.gif
deleted file mode 100644
index 780b161..0000000
Binary files a/src/html/mbsystem_logo_small.gif and /dev/null differ
diff --git a/src/html/mbsystem_man_ftr.frag b/src/html/mbsystem_man_ftr.frag
deleted file mode 100644
index 26766ac..0000000
--- a/src/html/mbsystem_man_ftr.frag
+++ /dev/null
@@ -1,7 +0,0 @@
-<HR>
-<P><A HREF="mbsystem_man_list.html">Return to list of MB-System manual pages...</A></P>
-<P><A HREF="mbsystem_home.html"><IMG SRC="mbsystem_logo_small.gif" BORDER=0 HEIGHT=55 WIDTH=158 ALIGN=BOTTOM></A><A HREF="mbsystem_home.html">Back
-to MB-System Home Page...</A></P>
-
-</BODY>
-</HTML>
diff --git a/src/html/mbsystem_man_hdr.frag b/src/html/mbsystem_man_hdr.frag
deleted file mode 100644
index 9e898f1..0000000
--- a/src/html/mbsystem_man_hdr.frag
+++ /dev/null
@@ -1,3 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<HTML VERSION="2.0">
-<HEAD>
diff --git a/src/html/mbsystem_man_hdr2.frag b/src/html/mbsystem_man_hdr2.frag
deleted file mode 100644
index 712b56d..0000000
--- a/src/html/mbsystem_man_hdr2.frag
+++ /dev/null
@@ -1,8 +0,0 @@
-<!-- WEBMAGIC VERSION NUMBER="2.0.2" -->
-<!-- WEBMAGIC TRANSLATION NAME="ServerRoot" SRC="/var/www/htdocs/" DST="/" -->
-<!-- WEBMAGIC TRANSLATION NAME="ProjectRoot" SRC="./" DST="" -->
-</HEAD>
-<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#336699" VLINK="#997040" ALINK="#CC9900">
-<BODY>
-<CENTER><H3><U>MB-System Unix Manual Page</U></H3></CENTER>
-<PRE>
diff --git a/src/html/mbsystem_man_list.html b/src/html/mbsystem_man_list.html
deleted file mode 100644
index 12c82ed..0000000
--- a/src/html/mbsystem_man_list.html
+++ /dev/null
@@ -1,267 +0,0 @@
-<!DOCTYPE html PUBLIC "-//w3c//dtd html 4.0 transitional//en">
-<html>
-<head>
-  <title>List of MB-System Programs</title>
-  <meta http-equiv="Content-Type" content="text/html">
-  <meta name="Title" content="MB-System: Mapping the Seafloor">
-  <meta name="Author" content="David Caress, Dale Chayes">
-  <meta name="Description"
- content="open source software for processing bathymetry and backscatter data from multibeam and sidescan sonar">
-  <meta name="Keywords"
- content="seafloor,mapping,multibeam,sonar,bathymetry,sidescan,swath processing,open,source,software">
-</head>
-<body alink="#cc9900" bgcolor="#ffffff" link="#336699" text="#000000"
- vlink="#997040">
-<center>
-<h4><u>List of MB-System Programs:</u></h4>
-</center>
-Manual Page for the MB-System package:
-<ul>
-  <li> <a href="mbsystem.html">mbsystem</a></li>
-</ul>
-Manual Page for the MB-System i/o library:
-<ul>
-  <li> <a href="mbio.html">mbio</a></li>
-</ul>
-These are the current MB-system programs with links to the Unix manual
-pages:
-<ul>
-  <li><a href="mbabsorption.html">mbabsorption</a>: Calculates water sound absorption as a function of water properties.</li>
-  <li> <a href="mbareaclean.html">mbareaclean</a>: Identifies and
-flags
-bad beams in swath
-sonar bathymetry data within a specified area.</li>
-  <li> <a href="mbauvloglist.html">mbauvloglist</a>: Generate
-arbitrary text lists of values from MBARI AUV mission log files.</li>
-  <li> <a href="mbauvnavusbl.html">mbauvnavusbl</a>: Merge inertial
-and surface tracking navigation for
-submerged sonar platforms (e.g. ROVs and AUVs).</li>
-  <li> <a href="mbbackangle.html">mbbackangle</a>: Generates corrections
-for sidescan and/or amplitude data by calculating average amplitudes
-as a function of the seafloor
-grazing angle.</li>
-  <li> <a href="mbclean.html">mbclean</a>: Identifies and flags bad
-beams in swath sonar bathymetry data.</li>
-  <li> <a href="mbcopy.html">mbcopy</a>: Copy swath sonar data files.</li>
-  <li> <a href="mbctdlist.html">mbctdlist</a>: List CTD data in swath sonar data files.</li>
-  <li> <a href="mbdatalist.html">mbdatalist</a>: Parses recursive
-datalist
-files and outputs the
-complete list of data files and formats.</li>
-  <li> <a href="mbdefaults.html">mbdefaults</a>: Set or list default
-mbio
-parameters
-for reading and writing swath sonar data</li>
-  <li><a href="mbdumpesf.html">mbdumpesf</a>: mbdumpesf reads an MB-System edit save file and dumps the contents as an ascii table to stdout.</li>
-  <li> <a href="mbedit.html">mbedit</a>: Interactive editor used to
-flag
-bad beams
-in swath sonar bathymetry data.</li>
-  <li><a href="mbeditviz.html">mbeditviz</a>: Interactive 3D visualization bathymetry editing and attitude bias patch test.</li>
-  <li><a href="mbextractsegy.html">mbextractsegy</a>:
-    Extract subbottom profiler or center beam reflection data to segy files.</li>
-  <li><a href="mbfilter.html">mbfilter</a>:
-    Apply  one or more simple filters to sidescan and/or beam amplitude data.</li>
-  <li><a href="mbformat.html">mbformat</a>: List information about
-    swath
-    sonar
-  data formats supported by the MBIO library.</li>
-  <li> <a href="mbgetesf.html">mbgetesf</a>: Extract bathymetry edits
-in edit save file format.</li>
-  <li> <a href="mbgrdviz.html">mbgrdviz</a>: Vizualize GMT grids.</li>
-  <li> <a href="mbgrid.html">mbgrid</a>: Grid bathymetry, amplitude,
-and
-sidescan
-data from swath sonar data files.</li>
-  <li> <a href="mbhistogram.html">mbhistogram</a>: Obtain histogram of
-bathymetry,
-amplitude, or sidescan data from swath sonar data files.</li>
-  <li> <a href="mbhsdump.html">mbhsdump</a>: List raw information contained 
-  in Hydrosweep DS data files (formats 21 and 24).</li>
-  <li><a href="mbhysweeppreprocess.html">mbhysweeppreprocess</a>: Preprocess
-Hysweep HSX data (format 201), including applying time lag and biases to
-attitude and navigation data.</li>
-  <li> <a href="mbinfo.html">mbinfo</a>: Output some basic statistics
-    of
-    swath
-  sonar data files.</li>
-  <li> <a href="mbkongsbergpreprocess.html">mbkongsbergpreprocess</a>: performs
-    preprocessing of data from third generation Kongsberg
-    multibeam sonars (e.g. EM122, EM302, EM710).</li>
-  <li> <a href="mblevitus.html">mblevitus</a>: Create a water velocity
-profile
-which is representative of the mean annual water column for a specified
-1 degree by 1 degree region.</li>
-  <li> <a href="mblist.html">mblist</a>: List data in swath sonar data
-files.</li>
-  <li> <a href="mbmosaic.html">mbmosaic</a>: Mosaic sidescan and
-amplitude
-data.</li>
-  <li> <a href="mbnavadjust.html">mbnavadjust</a>: Package  that solves for optimal navigation by matching bathymetry of overlapping swathes.</li>
-  <li> <a href="mbnavadjustmerge.html">mbnavadjustmerge</a>: Merge two mbnavadjust projects.</li>
-  <li><a href="mbnavedit.html">mbnavedit</a>: Interactive editor used
-    to
-    fix
-  problems with navigation in swath sonar data files.</li>
-  <li><a href="mbnavlist.html">mbnavlist</a>: List navigation data in
-    swath sonar
-  data files.</li>
-  <li> <a href="mbneptune2esf.html">mbneptune2esf</a>: Extract
-    bathymetry edits from Simrad Neptune software into edit save file
-  format.</li>
-  <li><a href="mbotps.html">mbotps</a>: Generate open ocean tidal model for specified time and location using the Oregon State Tidal Prediction Software (OTPS) package.</li>
-  <li> <a href="mbprocess.html">mbprocess</a>: Process swath sonar
-data
-files, including
-merging navigation, applying bathymetry edits, recalculating
-bathymetry by raytracing, and applying a variety of other corrections.</li>
-  <li> <a href="mbps.html">mbps</a>: Simple perspective views of swath
-bathymetry
-in Postscript.</li>
-  <li> <a href="mbrollbias.html">mbrollbias</a>: Evaluate the roll bias of a
-swath sonar system using two pieces of coincident bathymetry data
-collected with opposing ship headings.</li>
-  <li><a href="mbrolltimelag.html">mbrolltimelag</a> Estimate attitude
-    time lag by cross correlation of apparent bottom slope with the roll
-    time series: </li>
-  <li><a href="mbroutetime.html">mbroutetime</a> Outputs a list of the times when a survey passes the waypoints of a planned survey route.</li>
-  <li><a href="mbsegygrid.html">mbsegygrid</a>:
-    Generate time vs. trace number grids of seismic data from segy files.<br>
-  </li>
-  <li><a href="mbsegyinfo.html">mbsegyinfo</a>:
-Output some basic statistics of segy seismic data files.</li>
-  <li><a href="mbsegylist.html">mbsegylist</a>:
-    List selected header values in segy seismic data files.</li>
-  <li><a href="mbsegypsd.html">mbsegypsd</a>:
-    Calculates the power spectral density function of each trace in a segy data file, outputting the results as a GMT grid file..</li>
-  <li><a href="mbset.html">mbset</a>:
-    Create and modify parameter files used
-  to control mbprocess.</li>
-  <li> <a href="mbstripnan.html">mbstripnan</a>: Filter to remove NaN
-nodes.</li>
-  <li> <a href="mbsvplist.html">mbsvplist</a>: Extract water sound
-velocity profiles
-(SVPs) from swath data files.</li>
-  <li> <a href="mbsvpselect.html">mbsvpselect</a>: Select the best
-available sound speed model for each swath file in a survey according to 
-user specified criteria.</li>
-  <li> <a href="mbswplspreprocess.html">mbswplspreprocess</a>: Preprocess
-SwathPlus SXP data (format 222), including applying time lag and biases to
-attitude and navigation data.</li>
-  <li> <a href="mbtime.html">mbtime</a>: Converts between calendar time
-and unix time.</li>
-  <li> <a href="mbvelocitytool.html">mbvelocitytool</a>: Interactive
-program for
-modeling the affect of the water velocity profile on swath sonar
-bathymetry
-calculations.</li>
-  <li> <a href="mb7k2jstar.html">mb7k2jstar</a>: Extract Jstar format
-(format 132) sidescan and subbottom data from Reson 7k (format 88) data
-files.</li>
-  <li> <a href="mb7k2ss.html">mb7k2ss</a>: mb7k2ss extracts Edgetech
-sidescan sonar data from Reson 7k format data, bins and lays the sidescan
-onto the seafloor, and outputs files in the MBF_MBLDEOIH formst (MBIO
-format id 71).</li>
-  <li> <a href="mb7kpreprocess.html">mb7kpreprocess</a>: Preprocess
-Reson 7k data (format 88), including applying time lag and biases to
-attitude and navigation data.</li>
-</ul>
-MB-system also includes three plug-in modules for the GMT software package that are built as a shared library that can be called by GMT. Here are links to the Unix manual
-pages:
-<ul>
-  <li> <a href="mbcontour.html">mbcontour</a>: Generate GMT compatible
-Postscript
-color swath contour plots.</li>
-  <li> <a href="mbgrdtiff.html">mbgrdtiff</a>: Generate TIFF image
-from gridded data.</li>
-  <li> <a href="mbswath.html">mbswath</a>: Generate GMT compatible
-Postscript
-color and color shaded relief swath plots.</li>
-</ul>
-Macros are programs or shellscripts which make use of programs from the
-MB-System and other software packages to accomplish common tasks
-easily.
-These are the current MB-System macros:
-<ul>
-  <li> <a href="mbm_arc2grd.html">mbm_arc2grd</a>: Convert an ArcView
-ASCII grid
-file to a GMT grid file.</li>
-  <li> <a href="mbm_copy.html">mbm_copy</a>: Translate groups of swath
-data files between formats</li>
-  <li> <a href="mbm_bpr.html">mbm_bpr</a>: Process data from a Seabird SBE53 pressure sensor into a tidal model for
-       use by mbprocess.</li>
-  <li> <a href="mbm_fmtvel.html">mbm_fmtvel</a>: Scans a Hydrosweep swath sonar data file using the  program  mbhsdump  and generates  a list in columnar format with time, date, latitude, longitude, C-mean, and C-keel entrys.</li>
-  <li> <a href="mbm_grd2arc.html">mbm_grd2arc</a>: Convert a GMT grid
-    file to an ArcView ASCII grid file.</li>
-  <li> <a href="mbm_grd2geovrml.html">mbm_grd2geovrml</a>: Create and
-    execute commands which generate a TerraVision tileset and GeoVRML set
-    of files that can be combined with other data and viewed in a web
-  browser.</li>
-  <li> <a href="mbm_grd3dplot.html">mbm_grd3dplot</a>: Reads a GMT GRD
-    grid file
-    and writes a shellscript which will generate a GMT 3D perspective view
-    of the data.</li>
-  <li> <a href="mbm_grdcut.html">mbm_grdcut</a>: Extract a subarea of
-    a
-    GMT grid
-  file.</li>
-  <li><a href="mbm_grdinfo.html">mbm_grdinfo</a>: Get information
-regarding a GMT grd file when the region of interest is a
-subset of the area covered in the input file. </li>
-  <li> <a href="mbm_grdplot.html">mbm_grdplot</a>: Reads a GMT GRD
-grid file and writes a shellscript which will generate a GMT map of the data.</li>
-  <li> <a href="mbm_grdtiff.html">mbm_grdtiff</a>: Reads a GMT GRD
-grid file and writes a shellscript which will generate a TIFF image of the data.</li>
-  <li><a href="mbm_grid.html">mbm_grid</a>: Reads a swath sonar data
-    file and writes a shellscript which will grid bathymetry data or mosaic
-    sidescan (or amplitude) data using reasonable guesses at the appropriate
-  grid bounds and bin size.</li>
-  <li><a href="mbm_histplot.html">mbm_histplot</a>: Create an executable
-    shellscript which will generate a GMT histogram plot of a dataset.</li>
-  <li><a href="mbm_makedatalist.html">mbm_makedatalist</a>: Generates
-    an MB-System datalist file referencing all identifiable swath files in
-  the specified target directory.</li>
-  <li><a href="mbm_makesvp.html">mbm_makesvp</a>: Generate a sound velocity profile model from sound speed and depth values in swath files.</li>
-  <li> <a href="mbm_multicopy.html">mbm_multicopy</a>: Translate groups of swath
-data files between formats using parallel processes.</li>
-  <li><a href="mbm_multidatalist.html">mbm_multidatalist</a>: Generates
-  ancilliary files used in data managment using parallel processes.</li>
-  <li><a href="mbm_multiprocess.html">mbm_multiprocess</a>: Apply specified
-  processing tasks to a swath data file using parallel processes.</li>
-  <li> <a href="mbm_plot.html">mbm_plot</a>: Reads a swath sonar data
-file
-and
-writes a shellscript which will generate a swath and/or contour plot of
-the data.</li>
-  <li> <a href="mbm_route2mission.html">mbm_route2mission</a>:
-Translate an mbgrdviz survey route file into an MBARI AUV mission
-script.</li>
-  <li> <a href="mbm_stat.html">mbm_stat</a>: Runs mbinfo on a swath
-sonar data file and extracts beam statistics from the output of mbinfo.</li>
-  <li> <a href="mbm_utm.html">mbm_utm</a>: Performs forward and
-inverse
-UTM projections
-of ASCII data triples. </li>
-  <li> <a href="mbm_xbt.html">mbm_xbt</a>: Processes a Sparton XBT
-data
-file and
-outputs a sound velocity profile file which can be used to process
-swath
-sonar data.</li>
-  <li> <a href="mbm_xyplot.html">mbm_xyplot</a>: Reads one or more xy
-data
-files
-and writes a shellscript which will generate GMT plot of the data.</li>
-</ul>
-<center>Last Updated: $Id: mbsystem_man_list.html 2224 2015-02-04 19:14:05Z caress $
-</center>
-<p>
-</p>
-<hr width="67%">
-<p><a href="mbsystem_home.html"><img src="mbsystem_logo_small.gif"
- align="bottom" border="0" height="51" width="154"></a><a
- href="mbsystem_home.html">Back
-to MB-System Home Page...</a>
-</p>
-</body>
-</html>
diff --git a/src/html/mbsystem_version.txt b/src/html/mbsystem_version.txt
deleted file mode 100644
index e3da06c..0000000
--- a/src/html/mbsystem_version.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-MB-System Version:  "5.5.2252"
-MB-System Release Date:  "1 July 2015"
diff --git a/src/html/mbsystem_whatsnew.html b/src/html/mbsystem_whatsnew.html
deleted file mode 100644
index c5517b0..0000000
--- a/src/html/mbsystem_whatsnew.html
+++ /dev/null
@@ -1,409 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
-<HTML>
-<HEAD>
-   <TITLE>What's New in MB-System</TITLE>
-  <meta http-equiv="Content-Type" content="text/html">
-  <meta name="Title" content="MB-System: Mapping the Seafloor">
-  <meta name="Author" content="David Caress, Dale Chayes">
-  <meta name="Description" content="open source software for processing bathymetry and backscatter data from multibeam and sidescan sonar">
-  <meta name="Keywords" content="seafloor,mapping,multibeam,sonar,bathymetry,sidescan,swath processing,open,source,software">
-</HEAD>
-<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#336699" VLINK="#997040" ALINK="#CC9900">
-
-<H1 ALIGN=CENTER>What's New in MB-System Version 5.5</H1>
-
-<P>The version 5.5.x releases of MB-System includes a number of changes and
-improvements relative to the earlier version 5 releases. The most significant change is integration with GMT 5 in place of the deprecated GMT versions. A detailed listing of bug fixes and other changes is found in the <a href="ChangeLog.txt">ChangeLog</a> file. The most prominent particulars follow: </P>
-
-<UL>
-  <LI>Integration with GMT 5</LI>
-  
-  <UL>
-  <LI>The GMT-compatible MB-System programs mbcontour, mbswath, and mbgrdtiff are now plug-in GMT modules built as a shared library rather than stand-alone MB-System programs.</LI>
-  <LI>The MB-System plot macros mbm_plot, mbm_grdplot, mbm_grd3dplot, mbm_xyplot, and mbm_histplot now generate plotting scripts that work with GMT5 but will not work with GMT 4.</LI>
-  <LI>There is no backward compatibility with GMT 4.</LI>
-  <LI>The old "install_makefiles" build system has been removed; the configure script introduced with the 5.4 versions is now the only option for building MB-System.</LI>
-  </UL>
-</UL>  
-<H1 ALIGN=CENTER>What's New in MB-System Version 5.4</H1>
-
-<P>The version 5.4.x releases of MB-System includes a number of changes and
-improvements relative to the earlier version 5 releases. The most significant change is the addition of an autoconf-based build system including a configure script. A detailed listing of bug fixes and other changes is found in the <a href="ChangeLog.txt">ChangeLog</a> file. The most prominent particulars follow: </P>
-
-<UL>
-  <LI>New autoconf based build system.</LI>
-  
-  <UL>
-  <LI>The MB-System distribution now comes with a configure script that can be used to build the software without editing any files.</LI>
-  <LI>The configure script generates Makefiles that support installing the executables, libraries, header files, and man pages in locations outside the MB-System source directories (e.g. in /usr/local).</LI>
-  <LI>The configure script generated Makefiles build shared libraries.</LI>
-  <LI>The older "install_makefiles" build system is still included in the distribution, and can be used to build MB-System.</LI>
-  </UL>
-</UL>  
-<UL>
-  <LI>Support for several new data formats.</LI>
-  <UL>
-  <LI>SEA Swathplus interferometric sonar SXP data format is supported as format 222 (MBF_SWPLSSXP).</LI>
-  <LI>3DatDepth lidar data format is supported as format 231 (MBF_3DDEPTHP).</LI>
-  <LI>Electronic Navigation Ltd. WASSP multibeam sonar data format supported as format 241 (MBF_WASSPENL).</LI>
-  <LI>NGDC MGD77T data format for tab delimited underway marine geophysical data is supported as format 174 (MBF_MGD77TAB).</LI>
-  <LI>Photogrammetric topography from stereo pair photography supported as format 251 (MBF_PHOTGRAM).</LI>
-  </UL>
-</UL>
-<UL>
-  <LI>New programs:</LI>
-  <UL>
-  <LI>MBsvpselect: This program chooses and implements the best available sound speed model for each swath file in a survey according to user specified criteria.</LI>
-  </UL>
-</UL>
-
-<H1 ALIGN=CENTER>What Was New in MB-System Version 5.3</H1>
-
-<P>The version 5.3.x releases of MB-System included a number of changes and
-improvements relative to the earlier version 5 releases. Two of these changes, a new "fast bathymetry" or fbt file format, and the implementation of file locking, will generate files that older versions of MB-System cannot read. Consequently, we recommend that any MB-System users that work together on common datasets upgrade simultaneously to release 5.3.1887 or higher. The particulars follow: </P>
-
-<UL>
-  <LI>Changes to the "fbt" or "fast bathymetry" files in the MB-System processing environment.</LI>
-  
-  <UL>
-  <LI>We updated the definition of swath format MBF_LDEOIH (format 71),
-which is used for the "fast bathymetry" or *.fbt files in MB-System
-processing environments. </LI>
-  <LI>The previous form of *.fbt files had a
-    serious limitation in that bathymetry from multibeams operated
-    near the seafloor in deep water did not represent the full
-    numerical resolution of those data. </LI>
-  <LI>The updated format allows for
-    depth and distance resolution to 0.001 m even in the deep ocean.    </LI>
-  <LI>Old *.fbt files are read transparently, but newly written files
-    will not be readable by older versions of MB-System.. </LI>
-  </UL>
-</UL>
-
-
-<UL>
-  <LI>File locking by data editing tools MBedit, MBeditvia, MBnavedit, MBclean, and the processing program MBprocess.</LI>
-  
-  <UL>
-  <LI>A file locking mechanism has been implemented to allow multiple users to work on the same projects without interfering. The intent is for this mechansim to work on heterogeneous networks, which means that the data can be on non-Posix filesystems mounted on multiple computers running different operating systems.</LI>
-    
-  <LI>The file locking is implemented in a crude fashion involving the creation and deletion of "lock files". These are text files with a ".lck" suffix that are created in parallel with the associated "raw" swath files. If a lock file exists, the swath file has been locked by a program and cannot be opened for editing or processing by any other program. When a program completes its work on or with a swath file, it removes the lock by deleting the file.</LI>
-    
-  <LI>The lock files include text indicating the program that generated the lock, the time the lock was created, the purpose (e.g. bathymetry editing), which user generated the lock, and what machine that user was logged into.</LI>
-    
-  <LI>File locking is implemented for MBedit, MBeditviz, MBnavedit, and MBprocess.</LI>
-  <LI>An example of the contents of a lock file is:<br>
-             # File /Volumes/MappingAUVOps2011/20110525m1/20110525_202216.mb88 <br>
-             # Locked by user <caress> on cpu <diebold.shore.mbari.org> at <Fri May 27 09:45:42 2011><br>
-             Locking Program: MBedit<br>
-             Locking User: caress<br>
-             Locking CPU: diebold.shore.mbari.org<br>
-             Locking Time: Fri May 27 09:45:42 2011<br>
-             Locking Purpose ID: 2<br>
-             Locking Purpose Description: Edit Bathymetry<BR>
-  </LI>
-  <LI>The primary negative consequence of file locking is the potential creation of orphaned lock files if a locking program crashes or is interrupted. The mbdatalist tool can now be used to detect lock files (-S option) in any of the files references through a datalist, or to remove any lock files (-Y option).</LI>
-  </UL>
-</UL>
-
-<UL>
-  <LI>MBedit and MBnavedit can now operate on datalists.</LI>
-  
-  <UL>
-  <LI>Previously, these two editing tools opened one file at a time, specified from a file opening dialog accessed by clicking the <File> button.</LI>
-  <LI>Now, <File> is a pull down menu with two options: <Open> and <File Selection List>. The first brings up the same file opening dialog as before. The second brings up a list dialog showing all of the files available for editing.</LI>
-  <LI>If a user opens a single file for editing, that file will be added to an internal list of files available for editing, and then loaded.</LI>
-  <LI>If a user opens a datalist, then all of the files referenced through the recursive datalist structure will be added to the internal list of files available for editing, and the first file will be loaded.</LI>
-  <LI>The user can, by selecting the <File->File Selection List> menu item, display the internal list of available files. Selecting a file in this list will cause that file to be loaded for editing. If another file was already loaded, it will be closed out gracefully before the new file is loaded.</LI>
-  <LI>The list of available files also indicates which files have been previously edited (so that ".esf" or ".nve" files exist) and which are currently locked by other programs and users.</LI>
-  </UL>
-</UL>
-
-<UL>
-  <LI>Pseudo-Parallel Processing With MBprocess</LI>
-  
-  <UL>
-  <LI>Updating the processing of one or more surveys with MBprocess can be time consuming because each swath file must be processed in turn.</LI>
-  <LI>Since the processing of each file depends only on the parameter and ancilliary files parallel to that file, the use of MBprocess is inherently parallelizable.</LI>
-  <LI>The file locking mechanism described above allows users to simultaneously run multiple instances of MBprocess on the same datalist structure.</LI>
-  <LI>Each MBprocess instance will parse through the datalist structure and attempt to process each swath file in turn.</LI>
-  <LI>Swath files will be skipped if they are up-to-date, or if they are locked.</LI>
-  <LI>The MBprocess instances can be on different computers, as long as the same filesystems are mounted.</LI>
-  <LI>The benefit of this pseudo-parallel processing tends to be limited by the network throughput. For instance, at MBARI the swath data are served on CIFS or Samba filesystems over Gigabet ethernet. We find that processing runs go faster with up to six MBprocess instances running on up to three different computers, but that adding more  than six processes causes the entire run to take longer.    </LI>
-  </UL>
-</UL>
-
-<UL>
-  <li>New data formats:
-    <ul>
-      <li>HYSWEEP HSX multibeam data format (format id 201)</li>
-    </ul>
-  </li>
-</UL>
-<H1 ALIGN=CENTER>What Was New in MB-System Versions 5.1 and 5.2</H1>
-
-<P>The version 5.1.x and 5.2.z releases of MB-System included a number of changes and
-improvements relative to the version 4 releases. The most significant changes
-included: </P>
-
-<UL>
-  <LI>A new approach to managing data processing.</LI>
-  
-  <UL>
-  <LI>Many tools - one output file. In previous versions of MB-System, each
-    processing program read an input swath data file and produced an output
-    swath data file. This "serial" processing scheme generally produced
-    a large number of intermediate data files. MB-System version 5.0 features
-    the integration of the editing and analysis tools with a single program,
-    mbprocess, that outputs processed data files. The new "parallel"
-    processing scheme covers bathymetry data processing, but does not yet incorporate
-    the sidescan processing capabilities. All of the old tools and capabilities
-    are still part of the distribution.</LI>
-    
-  <LI>Recursive datalists. The lists of data files used by gridding and plotting
-    programs can now be recursive, making it simpler to manage data from many
-    different surveys.</LI>
-    
-  <LI>Automatic format identification. MB-System programs will now attempt
-    to automatically identify the swath data format based on the filename suffix.</LI>
-    
-  <LI>Extended inf files. Users can generate inf files by directing the output
-    of mbinfo to a file named by adding an ".inf" suffix to the swath
-    data file name. Several programs can parse inf files, if they exist, to
-    quickly obtain data locations or ranges. This feature speeds operations
-    such as gridding, mosaicing, and automated plotting.<BR>
-  <BR>
-  </LI>
-  </UL>
-  
-  <LI>New command line tools.</LI>
-  
-  <UL>
-  <LI>MBprocess. This new tool performs a variety of processing tasks and
-    produces a single output processed swath data file. The program mbprocess
-    can apply bathymetry edits from mbedit and mbclean, navigation edits from
-    mbnavedit, sound velocity profile changes from mbvelocitytool, and a variety
-    of other corrections.</LI>
-    
-  <LI>MBset. This new tool allows users to create and modify the parameter
-    files used to control the operation of mbprocess.</LI>
-    
-  <LI>MBdatalist. This new tool allows users to list the files referenced by
-    a recursive datalist structure. It can also be used to create the ancillary ".inf",
-  ".fbt", and ".fnv" files for all of the data files referenced in a recursive datalist
-    structure. </LI>
-    
-  <LI>MBsvplist. This new tool lists water sound velocity profiles embedded
-    in swath data files, creating secondary files that 
-    can be read into MBvelocitytool.</LI>
-    
-  <LI>MBareaclean. This new tool identifies and flags artifacts in swath sonar
-    bathymetry data within a specified area of interest. The
-    area is divided into a grid with square cells or bins, and the
-    data are grouped according to these bins. Once all
-    of  data  are read, statistical tests are applied 
-    to the soundings within each bin.</LI>
-  <LI>MBotps. This new tool uses the Oregon State Tidal Prediction Software (OTPSnc) package to calculate open ocean tidal models for bathymetry correction.</LI>
-    
-  <LI>MBextractsegy. This new tool extracts subbottom profiler data
-    from swath files to SEGY format files.</LI>
-    
-  <LI>MBsegyinfo. This new tool extracts SEGY data file information and statistics.
-    
-  <LI>MBsegylist. This new tool produces arbitrary ascii tables from SEGY data files.
-    
-  <LI>MBsegygrid. This new tool grids seismic and subbottom data from SEGY data files.
-  <LI>MBsegypsd. This new tool calculates sonograms from SEGY data files.<BR>
-    <BR>
-  </UL>
-  
-  <LI>Improved bathymetry and navigation editors.</LI>
-  
-  <UL>
-  <LI>MBedit and MBnavedit now swallow data files whole rather than reading
-    in limited size buffers.</LI>
-    
-  <LI>MBedit now outputs beam edit events rather than an entire swath file.
-    The edits are applied by MBprocess.</LI>
-    
-  <LI>MBnavedit now outputs the edited navigation rather than an entire swath
-    file. The edited navigation is merged using MBprocess.</LI>
-    
-  <LI>Both editors show the position of the currently displayed data within
-    the entire data file.</LI>
-  <LI>MBnavedit has two navigation modeling modes relevant to swath data
-    collected using poorly navigated ROVs and towfishes. One mode applies a
-    dead reckoning model with interactively set drifts, and the other involves
-    inverting for an optimally smooth navigation by penalizing speed and acceleration.<BR>
-  </LI>
-  <LI>MBnavadjust. This new tool allows users to adjust poorly navigated
-    surveys by matching features in overlapping swathes. It is particularly
-    useful for processing surveys conducted from submerged platforms.</LI>
-  </UL>
-</UL>
-<UL>
-  <li>New Visualization Based Tools
-  </li>
-  <ul>
-    <li>MBgrdviz is a  GMT grid 2D/3D visualization utility. MBgrdviz also allows the display of sonar navigation, sites, and routes, and interactive survey planning.</li>
-  </ul>
-  <UL>
-    <LI>MBeditviz is an interactive 3D visualization bathymetry editor and patch test tool.</LI>
-  </UL>
-</UL>
-<UL>
-  <li>Support for Projected Coordinate Systems
-  </li>
-  <ul>
-    <li>MB-System now incorporates the  source  code  for  the
-      PROJ.4  Cartographic  Projections  library,  providing
-      support for (apparently) all  commonly  used  geodetic
-      coordinate  systems.   PROJ.4  was developed by Gerald
-      Evenden (then of the USGS), and was obtained from  the
-      www.remotesensing.org website.</li>
-  </ul>
-  <UL>
-    
-    <LI>A  large  number of commonly used projected coordinate
-      systems (e.g. UTM)  are  defined  in  a  file  
-      (mbsystem/share/projections.dat) distributed with MB-System.
-      These include all of the standard UTM  zones,  all  of
-      the  standard state plate coordinate systems, and most
-      of the European Petroleum Survey Group (EPSG)  coordinate 
-    systems (also including UTM).</LI>
-    
-    <LI>MB-System  can now handle swath data that is navigated
-      in a supported projected coordinate system. In particular, 
-      data files that are navigated with UTM eastings
-      and northings instead of longitude  and  latitude  can
-    now be plotted and processed with MB-System.</LI>
-    
-    <LI>The  programs mbgrid and mbmosaic can now output grids
-      and mosaics in any of the projected coordinate systems
-    specified in mbsystem/share/projections.dat.</LI>
-    
-    <LI>The   TIFF   images  generated  with  mbm_grdtiff  and
-      mbgrdtiff now fully conform to  the  GeoTIFF  standard,
-      providing that the source grids or mosaics were generated 
-      using mbgrid or  mbmosaic  in  either  Geographic
-      coordinates, UTM coordinates, or any of the EPSG coordinate 
-      systems specified in the projections.dat  file.
-      This  means,  for instance, that GeoTIFF images generated 
-      with mbgrdtiff  will  be  properly  georeferenced
-      when  they  are imported into ESRI ArcGIS or other GIS
-      packages.<BR>
-      <BR>
-    </LI>
-  </UL>
-  
-  <LI>Restructuring the code.</LI>
-  
-  <UL>
-    <LI>All of the C code now conforms to the ANSI C standard.</LI>
-    
-    <LI>The underlying input/output library (MBIO) has been substantially rewritten.
-      The structure has been streamlined, simplifying both future development
-    and support of the existing code. The MBIO API has been greatly modified.</LI>
-  </UL>
-</UL>
-<UL>
-  <LI>Handling of old Simrad multibeam data.</LI>
-  
-  <UL>
-  <LI>Vendor format data from the old Simrad multibeams (pre-1997 sonars)
-    are now supported by a single format id (51) rather than a separate format
-    id for each sonar model. The old format id's are automatically aliased
-    to 51, so existing shellscripts will continue to work.</LI>
-    
-  <LI>MB-System no longer supports beam flagging in format 51 data. The
-    use of mbedit and mbclean on format 51 data will cause the flagged
-    beams to be irrevocably nulled. Previous versions of MB-System used
-    the highest bit in the depth values to represent beam flags because
-    no Simrad data seemed to use that bit. We have not obtained data 
-    with depth values using the full bit-range, conflicting with the
-    old beam flagging scheme. We recommend that old Simrad data be translated
-    to the extended processing format (57) which contains proper beam
-    flags and supports all processing functions. Format 57 is also used for processing data from
-    the current Simrad multibeam sonars.
-    
-  <LI>Sidescan data from old Simrad multibeams (pre-1997 sonars) are now
-    handled in the same manner as data from the newer sonars (e.g. EM3000,
-    EM3000, EM120). The raw samples in the vendor data format are binned, averaged,
-    and interpolated into a 1024 pixel sidescan swath. This binned sidescan
-    is not saved in the vendor format, so (as above) it is recommended that the data be
-    translated to an extended format (57) that stores both bathymetry beam flags
-    and processed sidescan. </LI>
-  </UL>
-</UL>
-
-<UL>
-<LI>Streamlining of MB-System Default Parameters.</LI>
-
-<UL>
-<LI>Prior to version 5.0, the MB-System defaults
-set by mbdefaults included the format id, a control for
-ping averaging, longitude and latitude bounds for windowing
-by area, and begin and end times for windowing in time. These
-values are no longer set in the .mbio_defaults file or controlled
-by mbdefaults. As noted above, the format id is automatically
-identified from the filename when possible. When filenames do not
-match one of the recognized structures, users must specify the
-format using the relevant programs -Fformat option.
-The controls for ping averaging and windowing in time and space
-are rarely used, and must now be explicitly set in command
-line arguments.</LI>
-</UL>
-</UL>
-
-<UL>
-<LI>New Data Formats</LI>
-
-<UL>
-<LI>Furuno HS10 multibeam bathymetry is supported as format 171.</LI>
-
-<LI>SeaBeam 2120 multibeam data in the L3 Communications XSE format are
-supported as format 94 (already used to support Elac Bottomchart MkII XSE
-data).</LI>
-
-<LI>Raw STN Atlas multibeam data generated by the upgraded Hydrosweep DS2
-multibeam on the R/V Ewing are supported by read-only format 182.
-Processing is supported using the augmented read-write format 183.</LI>
-
-<LI>The IFREMER netCDF multibeam archiving data format is supported
-as format 75. Similarly, the IFREMER netCDF navigation 
-archiving data format is supported
-as format 167.</LI>
-
-<LI>The STN Atlas processing data format SURF is supported as format 181. At
-present, SURF is supported as a read-only format. This allows plotting and gridding
-of the SURF data, but not processing. Writing or translating the SURF data to
-allow processing will be supported in a later version.
-</LI>
-
-<LI>The Hawaii Mapping Research Group's  MR1 format is supported as
-format 64. This format is used to disseminate data from both the
-HMRG interferometric sonars (e.g. MR1) and the WHOI DSL 120 deep-towed
-inteferometric sonar. This format has been supported by including
-the code for the HMRG library libmr1pr in the MB-System library. Thanks
-to Roger Davis and HMRG for making the code available under the GPL.</LI>
-
-<LI>The Reson 7k format produced by the 7000 series Reson SeaBat multibeams
-and the Reson 6046 datalogger is now supported as format 88. This format
-can incoporate sidescan sonar and subbottom profiler data as well as the
-multibeam data.</LI>
-<LI>Third generation Simrad multibeams (EM122, EM302, EM710) are supported by formats 58 and 59.</LI>
-<LI>Imagenex and Odom DeltaT multibeams are supported by formats 191 and 192.</LI>
-</UL>
-</UL>
-
-<CENTER><P><BR>
-Last Updated: $Id: mbsystem_whatsnew.html 2224 2015-02-04 19:14:05Z caress $ </P></CENTER>
-
-<P>
-<HR WIDTH="67%"></P>
-
-<P><A HREF="mbsystem_home.html"><IMG SRC="mbsystem_logo_small.gif" BORDER=0 HEIGHT=55 WIDTH=158 ALIGN=BOTTOM></A><A HREF="mbsystem_home.html">Back
-to MB-System Home Page...</A> </P>
-
-</BODY>
-</HTML>
diff --git a/src/html/mbtime.html b/src/html/mbtime.html
deleted file mode 100644
index 8487630..0000000
--- a/src/html/mbtime.html
+++ /dev/null
@@ -1,152 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<HTML VERSION="2.0">
-<HEAD>
-   <TITLE>MB-System Unix Manual Page: mbtime</TITLE>
-<!-- WEBMAGIC VERSION NUMBER="2.0.2" -->
-<!-- WEBMAGIC TRANSLATION NAME="ServerRoot" SRC="/var/www/htdocs/" DST="/" -->
-<!-- WEBMAGIC TRANSLATION NAME="ProjectRoot" SRC="./" DST="" -->
-</HEAD>
-<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#336699" VLINK="#997040" ALINK="#CC9900">
-<BODY>
-<CENTER><H3><U>MB-System Unix Manual Page</U></H3></CENTER>
-<PRE>
-<H1>mbtime</H1>
-Section:  MB-System 5.0  (1)<BR>Updated:  3 June 2013 <BR><A HREF="#index">Index</A>
-<HR>
-
-<A NAME="lbAB"> </A>
-<H2>NAME</H2>
-
-<B>mbtime</B> - Translate between calendar time values and unix time.
-<P>
-<A NAME="lbAC"> </A>
-<H2>VERSION</H2>
-
-Version 5.0
-<P>
-<A NAME="lbAD"> </A>
-<H2>SYNOPSIS</H2>
-
-<B>mbtime</B> [<B>-M</B><I>time_d</I> <B>-T</B><I>year/month/day/hour/minute/second</I> <B>-V -H</B>]
-<P>
-<A NAME="lbAE"> </A>
-<H2>DESCRIPTION</H2>
-
-The program <B>mbtime</B> converts time values between unix time (seconds since
-1970/01/01 00:00:00.000000) and calendar time (e.g. 2008/006/05/17/24/32.000000).
-Unix time is also known as POSIX time or epoch time, and are typically represented
-in <B>MB-System</B> documentation (and source code) as "time_d" values.
-The input time is set using the command line arguments <B>-M</B><I>time_d</I> for
-epoch seconds and <B>-T</B><I>year/month/day/hour/minute/second</I> for
-calendar time. The output time (in the form not specified as input) is
-written to stdout.
-<P>
-<A NAME="lbAF"> </A>
-<H2>AUTHORSHIP</H2>
-
-David W. Caress (<A HREF="mailto:caress at mbari.org">caress at mbari.org</A>)
-<BR>
-
-<BR>  Monterey Bay Aquarium Research Institute
-<BR>
-
-Dale N. Chayes (<A HREF="mailto:dale at ldeo.columbia.edu">dale at ldeo.columbia.edu</A>)
-<BR>
-
-<BR>  Lamont-Doherty Earth Observatory
-<P>
-<A NAME="lbAG"> </A>
-<H2>OPTIONS</H2>
-
-<DL COMPACT>
-<DT><B>-H</B>
-
-<DD>
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-<DT><B>-M</B>
-
-<DD>
-<I>time_d</I>
-<BR>
-
-Sets the input time to be <I>time_d</I> in unix time, which
-is defined as seconds since 00:00:00.000000 01 January 1970. If <B>-M</B> is
-specified, this time will be converted to calendar time and output
-to stdout in the form
-<BR> <TT>       </TT>yyyy/mm/dd/hh/mm/ss.ssssss<BR>
-<DT><B>-T</B>
-
-<DD>
-<I>year/month/day/hour/minute/second</I>
-<BR>
-
-Sets the input time to be <I>year/month/day/hour/minute/second</I>.
-If <B>-T</B> is specified, this time will be converted to
-<I>time_d</I> in epoch (Unix) seconds, which
-are seconds since 00:00:00.000000 01 January 1970.
-The <I>time_d</I> value will be output to stdout.
-<DT><B>-V</B>
-
-<DD>
-Normally, <B>mbtime</B> only prints out the converted time.  If the
-<B>-V</B> flag is given, then <B>mbtime</B> works in a "verbose" mode and
-also outputs the program version being used.
-<P>
-</DL>
-<A NAME="lbAH"> </A>
-<H2>EXAMPLES</H2>
-
-Suppose one wishes to convert the current time (06 June 2008 18:37:14.000000)
-to unix seconds. The following command:
-<BR> <TT>       </TT>mbtime -T2008/06/06/18/37/14.0<BR>
-<BR>
-
-yields the following result:
-<BR> <TT>       </TT>1212777434.000000<BR>
-<P>
-Suppose on wishes to convert the unix time 1212777434.0 to calendar time.
-The following command:
-<BR> <TT>       </TT>mbtime -M1212777434.0<BR>
-<BR>
-
-yields the following result:
-<BR> <TT>       </TT>2008/06/06/18/37/14.000000<BR>
-<P>
-<A NAME="lbAI"> </A>
-<H2>SEE ALSO</H2>
-
-<B><A HREF="mbsystem.html">mbsystem</A></B>(1), <B><A HREF="mbio.html">mbio</A></B>(1)
-<P>
-<A NAME="lbAJ"> </A>
-<H2>BUGS</H2>
-
-Never bugs, but perhaps our good friends, the terrestrial isopods.
-<P>
-
-<HR>
-<A NAME="index"> </A><H2>Index</H2>
-<DL>
-<DT><A HREF="#lbAB">NAME</A><DD>
-<DT><A HREF="#lbAC">VERSION</A><DD>
-<DT><A HREF="#lbAD">SYNOPSIS</A><DD>
-<DT><A HREF="#lbAE">DESCRIPTION</A><DD>
-<DT><A HREF="#lbAF">AUTHORSHIP</A><DD>
-<DT><A HREF="#lbAG">OPTIONS</A><DD>
-<DT><A HREF="#lbAH">EXAMPLES</A><DD>
-<DT><A HREF="#lbAI">SEE ALSO</A><DD>
-<DT><A HREF="#lbAJ">BUGS</A><DD>
-</DL>
-<HR>
-</PRE>
-
-<CENTER><P><BR>
-Last Updated: 3 June 2013</P></CENTER>
-
-<HR>
-<P><A HREF="mbsystem_man_list.html">Return to list of MB-System manual pages...</A></P>
-<P><A HREF="mbsystem_home.html"><IMG SRC="mbsystem_logo_small.gif" BORDER=0 HEIGHT=55 WIDTH=158 ALIGN=BOTTOM></A><A HREF="mbsystem_home.html">Back
-to MB-System Home Page...</A></P>
-
-</BODY>
-</HTML>
diff --git a/src/html/mbvelocitytool.html b/src/html/mbvelocitytool.html
deleted file mode 100644
index f80e9dc..0000000
--- a/src/html/mbvelocitytool.html
+++ /dev/null
@@ -1,459 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<HTML VERSION="2.0">
-<HEAD>
-   <TITLE>MB-System Unix Manual Page: mbvelocitytool</TITLE>
-<!-- WEBMAGIC VERSION NUMBER="2.0.2" -->
-<!-- WEBMAGIC TRANSLATION NAME="ServerRoot" SRC="/var/www/htdocs/" DST="/" -->
-<!-- WEBMAGIC TRANSLATION NAME="ProjectRoot" SRC="./" DST="" -->
-</HEAD>
-<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#336699" VLINK="#997040" ALINK="#CC9900">
-<BODY>
-<CENTER><H3><U>MB-System Unix Manual Page</U></H3></CENTER>
-<PRE>
-<H1>mbvelocitytool</H1>
-Section:  MB-System 5.0  (1)<BR>Updated:  10 November 2014 <BR><A HREF="#index">Index</A>
-<HR>
-
-<A NAME="lbAB"> </A>
-<H2>NAME</H2>
-
-<B>mbvelocitytool</B> - Interactive water sound velocity profile editor.
-<P>
-<A NAME="lbAC"> </A>
-<H2>VERSION</H2>
-
-Version 5.0
-<P>
-<A NAME="lbAD"> </A>
-<H2>SYNOPSIS</H2>
-
-<B>mbvelocitytool</B> [<B>-B</B><I>yr/mo/da/hr/mn/sc</I>
-<B>-E</B><I>yr/mo/da/hr/mn/sc</I>
-<B>-F</B><I>format </I><B>-I</B><I>file </I><B>-S</B><I>svpfile </I><B>-W</B><I>svpfile </I><B>-V -H</B>]
-<P>
-<A NAME="lbAE"> </A>
-<H2>DESCRIPTION</H2>
-
-<B>MBvelocitytool</B> is an interactive water sound velocity profile
-(SVP) editor used to examine multiple SVPs, to create
-new SVPs, and to model the impact of SVP modification on swath bathymetry
-data. SVPs created using <B>MBvelocitytool</B> can be used by the program
-<B>mbprocess</B> to recalculate swath bathymetry from raw travel time
-and angle data.
-<P>
-In general, <B>MBvelocitytool</B> is used to examine SVPs obtained from
-swath data files (see <B>mbsvplist</B> manual page), XBTs, CTDs, or
-databases, and to construct new profiles consistent with these various
-sources of information. The SVPs are represented by a set of paired
-depth and velocity values which are connected by linear interpolation.
-Users may load a number of SVPs for display. Users may load or create
-a single editable SVP and then interactively modify this profile.
-<P>
-When users load swath bathymetry data containing raw travel time and
-angle data (many but not all swath data format include this information),
-<B>MBvelocitytool</B>  recalculates the bathymetry by raytracing through
-the current SVP model. If the bathymetry in the input swath file has
-been edited (e.g. with <B>mbedit</B>), then the associated edit save
-file (*.esf file) will be loaded as well, and the beams flagged as
-bad will not be used by <B>MBvelocitytool</B>.
-The bathymetry of each ping is fit with a line,
-and bathymetry residuals are calculated for each good beam relative
-to the linear fit.  The average of the bathymetry residuals is displayed
-along with "error bars" indicating the standard deviations of the
-residuals. Anomalously shallow  bathymetry maps into negative residuals
-and deep bathymetry into positive residuals; the residuals are displayed
-so that shallow is up and deep is down. If the seafloor is reasonably
-smooth so that a linear fit is appropriate, then the residuals will
-accurately reflect any problems with the water velocity profile.  If
-the water velocity profile is correct, then the residual plot will be
-roughly flat.  If the water velocity profile is significantly in error,
-then the outer beam depths may anomalously shallow (edge curl up) or
-deep (edge curl down).  In practice, the editable velocity profile is
-altered interactively until a reasonably residual pattern is achieved.
-<P>
-In order to calculate bathymetry values from travel time observations,
-geometrical raypaths are traced through the SVP for each beam. Because
-the sound velocity gradients are uniform between the depth-velocity
-nodes (linear interpolation), the raypaths are be calculated
-analytically as pieces of circular arcs. This raytracing algorithm
-is the same used in the program <B>mbprocess</B>.
-<P>
-One important aspect of the raytracing is the handling of the initial
-takeoff angles associated with each beam or sounding. In general, the
-raytracing will begin at a point in the sound speed model that has a
-sound velocity different than the surface sound velocity (SSV) used by
-the mapping sonar for the original beamforming. The usual approach is to
-use Snell's law to adjust the starting angle for this change in sound
-velocity. This amounts to an assumption that the original SSV was correct
-and that  the rays pass through an insignificantly thick layer in which the
-sound speed equals the SSV before transitioning to the sound speed implied
-by the SVP. This is the default setting for raytracing in <B>MB-System</B>.
-Alternatively, one can proceed with raytracing using the original angle
-but this is rarely useful or correct. Finally, if the SSV used by the sonar is
-judged to have been incorrect, then the takeoff angle must be corrected for
-the erroneous beamforming as well as for the difference between the SSV
-and the initial raytracing sound velocity. This correction must take the
-sonar geometry into account because the impact of changing the SSV on a beam
-angle from a flat receive array is very different from a V-shaped or curved
-array. All three of these angle correction modes are available in <B>mbvelocitytool</B>.
-<P>
-<B>MBvelocitytool</B> can be used in conjunction with <B>mbprocess</B>.
-If the user uses the <B>Save swath svp file</B> option to save an SVP model
-developed through the analysis of a particular swath data file,
-<B>MBvelocitytool</B> also sets the associated <B>mbprocess</B> parameter file
-so that <B>mbprocess</B> recalculates the bathymetry using the new SVP model.
-The program <B>mbset</B> may be used to set the SVP file in the parameter
-file for any swath data file. Users may also save SVP models without setting
-any <B>mbprocess</B> parameters by using the <B>Save editable profile</B>
-option.
-<P>
-Sometimes the bathymetry residuals show structure indicative of
-persistent artifacts in the bathymetry (e.g. certain parts of
-the swath may be persistently shallower or deeper than the
-rest of the swath). In this situation, it is possible to export
-the residuals and to then apply them in <B>mbprocess</B>
-as static corrections to the bathymetry. This is accomplished by
-using the <B>Save residuals as offsets</B> option under the <B>File</B>
-menu.
-<P>
-If a user attempts to read in swath bathymetry that does not
-contain the travel time and beam angle data required for bathymetry
-recalculation, <B>MBvelocitytool</B> will estimate the travel times
-and angles from the bathymetry by assuming a 1500 m/s half-space
-(and then post a warning dialog). Although the user can proceed
-to model bathymetry recalculation by modifying the active SVP just
-as with proper data, the travel times and angles are not in general
-correct and so the modeling and any results it gives are, well, bogus.
-A more useful approach is to leave the SVP alone and simply export
-the residuals to be applied as static corrections in mbprocess.
-This approach allows users a practical means of correcting
-older multibeam bathymetry that was originally calculated with
-an incorrect SVP but which contains no travel time or angle data.
-<P>
-<A NAME="lbAF"> </A>
-<H2>AUTHORSHIP</H2>
-
-David W. Caress (<A HREF="mailto:caress at mbari.org">caress at mbari.org</A>)
-<BR>
-
-<BR>  Monterey Bay Aquarium Research Institute
-<BR>
-
-Dale N. Chayes (<A HREF="mailto:dale at ldeo.columbia.edu">dale at ldeo.columbia.edu</A>)
-<BR>
-
-<BR>  Lamont-Doherty Earth Observatory
-<P>
-<A NAME="lbAG"> </A>
-<H2>OPTIONS</H2>
-
-<DL COMPACT>
-<DT><B>-B</B>
-
-<DD>
-<I>yr/mo/da/hr/mn/sc</I>
-<BR>
-
-Sets the starting time for data allowed in the input data; pings
-with times before the starting time will be ignored.
-Default: <I>yr/mo/da/hr/mn/sc</I> = 1962/2/21/10/30/0.
-<DT><B>-E</B>
-
-<DD>
-<I>yr/mo/da/hr/mn/sc</I>
-<BR>
-
-Sets the ending time for data allowed in the input data; pings
-with times after the ending time will be ignored.
-Default: <I>yr/mo/da/hr/mn/sc</I> = 2062/2/21/10/30/0.
-<DT><B>-F</B>
-
-<DD>
-<I>format</I>
-<BR>
-
-Sets the format at startup for the input and output swath sonar data using
-<B>MBIO</B> integer format identifiers. This value can also be set
-interactively when specifying the input file.
-This program uses the <B>MBIO</B> library and will read any swath sonar
-format supported by <B>MBIO</B>. A list of the swath sonar data formats
-currently supported by <B>MBIO</B> and their identifier values
-is given in the <B>MBIO</B> manual page.
-Default: <I>format</I> = 11.
-<DT><B>-H</B>
-
-<DD>
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-<DT><B>-I</B>
-
-<DD>
-<I>file</I>
-<BR>
-
-Sets the data file from which the input swath data will be read at startup.
-This value can also be set interactively. See below.
-<DT><B>-S</B>
-
-<DD>
-<I>svpfile</I>
-<BR>
-
-Sets the data file from which an input display sound velocity
-profile will be read at startup. See below.
-This value can also be set interactively.
-<DT><B>-W</B>
-
-<DD>
-<I>svpfile</I>
-<BR>
-
-Sets the data file from which an input editable sound velocity
-profile will be read at startup.
-This value can also be set interactively. See below.
-<DT><B>-V</B>
-
-<DD>
-Normally, <B>mbvelocitytool</B> works "silently" without outputting
-anything to the stderr stream.  If the
-<B>-V</B> flag is given, then <B>mbvelocitytool</B> works in a "verbose" mode and
-outputs the program version being used, all error status messages,
-and a large amount of other information.
-<P>
-</DL>
-<A NAME="lbAH"> </A>
-<H2>INTERACTIVE CONTROLS</H2>
-
-<DL COMPACT>
-<DT><B>File</B>
-
-<DD>
-This button brings up a menu containing the commands listed below:
-<DT><B>File->Open Display Profile</B>
-
-<DD>
-Selecting this menu item brings up a popup window which allows the
-user to select an input water velocity profile file. The profile
-will be displayed in a depth vs velocity plot along with other
-display profiles and the edit velocity profile, if one has been
-opened.  Up to ten display velocity profiles may be loaded; the
-color of the display profiles cycles through red, green, blue, and
-black in the order that they are loaded.
-<DT><B>File->Open Editable Profile</B>
-
-<DD>
-Selecting this menu item brings up a popup window which allows the
-user to select an input water velocity profile file to be edited.
-The profile
-will be displayed in a depth vs velocity plot along with any
-display profiles that have been opened.  This profile will be plotted
-as black lines with small black squares at the velocity depth points.
-The velocity depth points may be selected and dragged using the mouse
-to change the editable velocity profile.
-<DT><B>File->New Editable Profile</B>
-
-<DD>
-Selecting this menu item creates a default editable velocity profile
-consisting of 14 velocity-depth points with a velocity of 1500 m/s.
-Any previously defined editable velocity profile will disappear. The profile
-will be displayed in a depth vs velocity plot along with any
-display profiles that have been opened.  This profile will be plotted
-as black lines with small black squares at the velocity depth points.
-The velocity depth points may be selected and dragged using the left mouse button
-to change the editable velocity profile. The center mouse button adds new
-velocity-depth points, and the right mouse button removes velocity-depth
-points.
-<DT><B>File->Save Editable Profile</B>
-
-<DD>
-Selecting this menu item brings up a popup window which allows the
-user to save the current editable velocity profile as a file.
-<DT><B>File->Open Swath Sonar Data</B>
-
-<DD>
-Selecting this menu item brings up a popup window which allows the
-user to select an input swath sonar data file to be processed
-in conjunction with the current editable velocity profile.
-The format id for the data file must be set appropriately
-in the editable text widget labeled "MBIO Format ID:"; this
-program uses the <B>MBIO</B> library and will read or write any swath sonar
-format supported by <B>MBIO</B>. A list of the swath sonar data
-formats currently supported by <B>MBIO</B> and their
-identifier values is given in the <B>MBIO</B> manual page.
-If the swath sonar data file is named using the <B>MB-System</B>
-suffix convention (format 11 files end with ".mb11", format
-41 files end with ".mb41", etc.), then the program will
-automatically use the appropriate format id.
-The swath sonar data file must be in one of the formats which store
-travel time data for each beam. Up to 25000 data records
-will be read into a buffer for processing.
-If there is no current editable velocity profile, then a
-default profile consisting of 14 velocity-depth points
-with a velocity of 1500 m/s will be created. A display profile
-generated by the <B>mblevitus</B> program will also be
-automatically generated and loaded into <B>mbvelocitytool</B>;
-this Levitus profile will serve as an average reference for
-the water sound velocity structure at the location of the
-swath data being analyzed. The travel time
-data will then be processed and displayed in the manner described
-below for the <B>Reprocess</B> button.
-<DT><B>File->Save Swath SVP File</B>
-
-<DD>
-Selecting this menu item saves the current editable velocity
-profile as a file. The SVP filename is that of the current
-swath data input file with a ".svp" suffix added. <B>MBvelocitytool</B>
-also sets the swath data file's <B>mbprocess</B> parameter file
-to recalculate bathymetry using the new SVP file and using the same
-angle mode setting applied in the interactive modeling (see the Angle
-Mode dialog description below).
-<DT><B>File->Save Residuals As Offsets</B>
-
-<DD>
-Selecting this menu item saves the current bathymetry residuals
-as a "static bathymetry offset" file.
-The filename is that of the current
-swath data input file with a ".sbo" suffix added. <B>MBvelocitytool</B>
-also sets the swath data file's <B>mbprocess</B> parameter file
-to apply these residuals as static corrections to the bathymetry.
-<DT><B>Plot Scaling</B>
-
-<DD>
-This button brings up a dialog containing the three controls
-discussed immediately below.
-<DT><B>Plot Scaling->Maximum Depth</B>
-
-<DD>
-This slider sets the maximum depth in meters of both the velocity profile
-display and the raypath display. The minimum depths of these
-displays are always zero. The acrosstrack distance axis of the raypath
-display automatically adjusts so that the rays are plotted with
-no vertical exageration.
-<DT><B>Plot Scaling->Velocity Range</B>
-
-<DD>
-This slider sets the minimum and maximum velocity values of the velocity
-profile display.  The minimum value is the velocity center minus the velocity range;
-the maximum value is the velocity center plus the velocity range.
-<DT><B>Plot Scaling->Velocity Center</B>
-
-<DD>
-This slider sets the center velocity value of the velocity
-profile display.  The minimum value is the velocity center minus the velocity range;
-the maximum value is the velocity center plus the velocity range.
-<DT><B>Plot Scaling->Residual Range</B>
-
-<DD>
-This slider sets the minimum and maximum bathymetry residual values
-of the bathymetry residual display.  The residual plot has a minimum
-value of -range and a maximum value of +range.
-<DT><B>Angle Mode</B>
-
-<DD>
-This button brings up a dialog containing three choices for how the starting
-beam angles are corrected during raytracing. The selected angle mode is
-used by <B>mbvelocitytool</B> in the interactive modeling, and is also passed
-on to the <B>mbprocess</B> parameter file created or modified when an SVP
-file is saved.
-<DT><B>Angle Mode->Do Not Change Beam Angles</B>
-
-<DD>
-This button sets the angle mode so that the starting beam angles are not
-corrected before raytracing for the difference between the surface sound
-velocity (SSV) and the sound velocity of the starting depth in the SVP.
-<DT><B>Angle Mode->Adjust Angles Using Snell's Law</B>
-
-<DD>
-This button sets the angle mode so that the starting beam angles are
-corrected before raytracing, using Snell's Law, for the difference between the
-surface sound velocity (SSV) and the sound velocity of the starting depth in
-the SVP. This amounts to an assumption that the original SSV was correct
-and that  the rays pass through an insignificantly thick layer in which the
-sound speed equals the SSV before transitioning to the sound speed implied
-by the SVP. This is the default setting for raytracing in <B>mbvelocitytool</B>
-and in <B>MB-System</B> in general.
-<DT><B>Angle Mode->Adjust Angles Using Sonar Geometry</B>
-
-<DD>
-This button sets the angle mode so that the starting beam angles are
-corrected before raytracing, using Snell's Law and the sonar geometry, for
-the difference between the surface sound velocity (SSV) and the sound velocity
-of the starting depth in the SVP. This option is relevant to situations where
-the SSV used by the sonar for beamforming was incorrect, and so the initial
-angles themselves must be adjusted. This mode is indistinguishable from
-that of "Adjust Angles Using Snell's Law" for multibeam sonars with flat,
-horizontal receive arrays, but deviates strongly for sonars with tilted,
-V-shaped, or curved receive arrays.
-<DT><B>Reprocess</B>
-
-<DD>
-Selecting this button causes the swath sonar travel time data to be processed
-into bathymetry using the current editable velocity profile. The processing
-involves full raytracing through the water velocity model. The bathymetry of
-each ping is fit with a line, and bathymetry residuals are calculated for each
-good beam relative to the linear fit.  The average of the bathymetry residuals
-is displayed in the upper right part of the window as a function of beam number,
-along with "error bars" indicating the standard deviations of the residuals.
-Raypaths are displayed without vertical exageration in the lower part of the
-window; these represent the first raypath calculated for each beam while
-processing the current data (most will be from the first ping). Anomalously
-shallow bathymetry maps into negative residuals and deep bathymetry into positive
-residuals; the residuals are displayed so that shallow is up and deep is down.
-If the seafloor is reasonably smooth so that a linear fit is appropriate, then
-the residuals will accurately reflect any problems with the water velocity profile.
-If the water velocity profile is correct, then the residual plot will be roughly
-flat.  If the water velocity profile is significantly in error, then the outer
-beam depths may anomalously shallow (edge curl up) or deep (edge curl down).
-In practice, the editable velocity profile is altered interactively until a
-reasonably residual pattern is achieved; reference velocity profiles obtained from
-CTD casts, XBT's, or data bases (see manual page for program <B>mblevitus</B>)
-may be read in as display profiles to guide the editing process.
-<DT><B>Quit</B>
-
-<DD>
-This button causes the program to exit gracefully, but without asking
-any questions.  If you haven't already saved your edited velocity profile
-it will be lost when you quit.
-<P>
-</DL>
-<A NAME="lbAI"> </A>
-<H2>SEE ALSO</H2>
-
-<B><A HREF="mbsystem.html">mbsystem</A></B>(1), <B><A HREF="mbprocess.html">mbprocess</A></B>(1), <B>mbset</B>, <B>mbsvplist</B>,
-<B>mbbath</B>, <B><A HREF="mblevitus.html">mblevitus</A></B>(1),
-<B><A HREF="mbm_xbt.html">mbm_xbt</A></B>(1), <B><A HREF="mbm_xbt.html">mbm_xbt</A></B>(1)
-<P>
-<A NAME="lbAJ"> </A>
-<H2>BUGS</H2>
-
-Users cannot remove display sound velocity profiles from the screen
-once they are read in. The main window for mbvelocitytool
-is too large for use on screens smaller than 1024 X 768 pixels.
-<P>
-
-<HR>
-<A NAME="index"> </A><H2>Index</H2>
-<DL>
-<DT><A HREF="#lbAB">NAME</A><DD>
-<DT><A HREF="#lbAC">VERSION</A><DD>
-<DT><A HREF="#lbAD">SYNOPSIS</A><DD>
-<DT><A HREF="#lbAE">DESCRIPTION</A><DD>
-<DT><A HREF="#lbAF">AUTHORSHIP</A><DD>
-<DT><A HREF="#lbAG">OPTIONS</A><DD>
-<DT><A HREF="#lbAH">INTERACTIVE CONTROLS</A><DD>
-<DT><A HREF="#lbAI">SEE ALSO</A><DD>
-<DT><A HREF="#lbAJ">BUGS</A><DD>
-</DL>
-<HR>
-</PRE>
-
-<CENTER><P><BR>
-Last Updated: 10 November 2014</P></CENTER>
-
-<HR>
-<P><A HREF="mbsystem_man_list.html">Return to list of MB-System manual pages...</A></P>
-<P><A HREF="mbsystem_home.html"><IMG SRC="mbsystem_logo_small.gif" BORDER=0 HEIGHT=55 WIDTH=158 ALIGN=BOTTOM></A><A HREF="mbsystem_home.html">Back
-to MB-System Home Page...</A></P>
-
-</BODY>
-</HTML>
diff --git a/src/html/schmidt.gif b/src/html/schmidt.gif
deleted file mode 100644
index ada3f97..0000000
Binary files a/src/html/schmidt.gif and /dev/null differ
diff --git a/src/macros/Makefile.am b/src/macros/Makefile.am
deleted file mode 100644
index 4189143..0000000
--- a/src/macros/Makefile.am
+++ /dev/null
@@ -1,24 +0,0 @@
-bin_SCRIPTS = mbm_xbt \
-	mbm_plot \
-	mbm_grdplot \
-	mbm_grd3dplot \
-	mbm_xyplot \
-	mbm_stat \
-	mbm_grid \
-	mbm_grd2arc \
-	mbm_arc2grd \
-	mbm_grdcut \
-	mbm_grdinfo \
-	mbm_grdtiff \
-	mbm_utm \
-	mbm_grd2geovrml \
-	mbm_copy \
-	mbm_route2mission \
-	mbm_makedatalist \
-	mbm_histplot \
-	mbm_multiprocess \
-	mbm_multidatalist \
-	mbm_multicopy \
-	mbm_bpr \
-	mbm_makesvp
-	
diff --git a/src/macros/Makefile.in b/src/macros/Makefile.in
deleted file mode 100644
index 736186d..0000000
--- a/src/macros/Makefile.in
+++ /dev/null
@@ -1,553 +0,0 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
-
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-
-VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
-am__make_running_with_option = \
-  case $${target_option-} in \
-      ?) ;; \
-      *) echo "am__make_running_with_option: internal error: invalid" \
-              "target option '$${target_option-}' specified" >&2; \
-         exit 1;; \
-  esac; \
-  has_opt=no; \
-  sane_makeflags=$$MAKEFLAGS; \
-  if $(am__is_gnu_make); then \
-    sane_makeflags=$$MFLAGS; \
-  else \
-    case $$MAKEFLAGS in \
-      *\\[\ \	]*) \
-        bs=\\; \
-        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
-          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
-    esac; \
-  fi; \
-  skip_next=no; \
-  strip_trailopt () \
-  { \
-    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
-  }; \
-  for flg in $$sane_makeflags; do \
-    test $$skip_next = yes && { skip_next=no; continue; }; \
-    case $$flg in \
-      *=*|--*) continue;; \
-        -*I) strip_trailopt 'I'; skip_next=yes;; \
-      -*I?*) strip_trailopt 'I';; \
-        -*O) strip_trailopt 'O'; skip_next=yes;; \
-      -*O?*) strip_trailopt 'O';; \
-        -*l) strip_trailopt 'l'; skip_next=yes;; \
-      -*l?*) strip_trailopt 'l';; \
-      -[dEDm]) skip_next=yes;; \
-      -[JT]) skip_next=yes;; \
-    esac; \
-    case $$flg in \
-      *$$target_option*) has_opt=yes; break;; \
-    esac; \
-  done; \
-  test $$has_opt = yes
-am__make_dryrun = (target_option=n; $(am__make_running_with_option))
-am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-subdir = src/macros
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
-	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
-	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
-	$(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-	$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/src/mbio/mb_config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
-am__vpath_adj = case $$p in \
-    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
-    *) f=$$p;; \
-  esac;
-am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
-am__install_max = 40
-am__nobase_strip_setup = \
-  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
-am__nobase_strip = \
-  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
-am__nobase_list = $(am__nobase_strip_setup); \
-  for p in $$list; do echo "$$p $$p"; done | \
-  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
-  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
-    if (++n[$$2] == $(am__install_max)) \
-      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
-    END { for (dir in files) print dir, files[dir] }'
-am__base_list = \
-  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
-  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
-am__uninstall_files_from_dir = { \
-  test -z "$$files" \
-    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
-    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
-         $(am__cd) "$$dir" && rm -f $$files; }; \
-  }
-am__installdirs = "$(DESTDIR)$(bindir)"
-SCRIPTS = $(bin_SCRIPTS)
-AM_V_P = $(am__v_P_ at AM_V@)
-am__v_P_ = $(am__v_P_ at AM_DEFAULT_V@)
-am__v_P_0 = false
-am__v_P_1 = :
-AM_V_GEN = $(am__v_GEN_ at AM_V@)
-am__v_GEN_ = $(am__v_GEN_ at AM_DEFAULT_V@)
-am__v_GEN_0 = @echo "  GEN     " $@;
-am__v_GEN_1 = 
-AM_V_at = $(am__v_at_ at AM_V@)
-am__v_at_ = $(am__v_at_ at AM_DEFAULT_V@)
-am__v_at_0 = @
-am__v_at_1 = 
-SOURCES =
-DIST_SOURCES =
-am__can_run_installinfo = \
-  case $$AM_UPDATE_INFO_DIR in \
-    n|no|NO) false;; \
-    *) (install-info --version) >/dev/null 2>&1;; \
-  esac
-am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-CC = @CC@
-CCAS = @CCAS@
-CCASDEPMODE = @CCASDEPMODE@
-CCASFLAGS = @CCASFLAGS@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DLLTOOL = @DLLTOOL@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GREP = @GREP@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBM = @LIBM@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIBTOOL_DEPS = @LIBTOOL_DEPS@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LTLIBOBJS = @LTLIBOBJS@
-LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
-MAINT = @MAINT@
-MAKEINFO = @MAKEINFO@
-MANIFEST_TOOL = @MANIFEST_TOOL@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-OTPS_DIR = @OTPS_DIR@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_URL = @PACKAGE_URL@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PKG_CONFIG = @PKG_CONFIG@
-PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
-PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-VERSION = @VERSION@
-XDR_LIB = @XDR_LIB@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_AR = @ac_ct_AR@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-fftw_app = @fftw_app@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libGLU_CFLAGS = @libGLU_CFLAGS@
-libGLU_LIBS = @libGLU_LIBS@
-libXm_CFLAGS = @libXm_CFLAGS@
-libXm_LIBS = @libXm_LIBS@
-libdir = @libdir@
-libexecdir = @libexecdir@
-libfftw3_CFLAGS = @libfftw3_CFLAGS@
-libfftw3_LIBS = @libfftw3_LIBS@
-libfftw_CPPFLAGS = @libfftw_CPPFLAGS@
-libfftw_LIBS = @libfftw_LIBS@
-libgmt_CFLAGS = @libgmt_CFLAGS@
-libgmt_CPPFLAGS = @libgmt_CPPFLAGS@
-libgmt_LIBS = @libgmt_LIBS@
-libmotif_CPPFLAGS = @libmotif_CPPFLAGS@
-libmotif_LIBS = @libmotif_LIBS@
-libnetcdf_CFLAGS = @libnetcdf_CFLAGS@
-libnetcdf_CPPFLAGS = @libnetcdf_CPPFLAGS@
-libnetcdf_LIBS = @libnetcdf_LIBS@
-libopengl_CPPFLAGS = @libopengl_CPPFLAGS@
-libopengl_LIBS = @libopengl_LIBS@
-libproj_CFLAGS = @libproj_CFLAGS@
-libproj_CPPFLAGS = @libproj_CPPFLAGS@
-libproj_LIBS = @libproj_LIBS@
-libpsl_CFLAGS = @libpsl_CFLAGS@
-libpsl_LIBS = @libpsl_LIBS@
-localedir = @localedir@
-localstatedir = @localstatedir@
-mandir = @mandir@
-mbsystemdatadir = @mbsystemdatadir@
-mbsystemhtmldir = @mbsystemhtmldir@
-mbsystempsdir = @mbsystempsdir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-bin_SCRIPTS = mbm_xbt \
-	mbm_plot \
-	mbm_grdplot \
-	mbm_grd3dplot \
-	mbm_xyplot \
-	mbm_stat \
-	mbm_grid \
-	mbm_grd2arc \
-	mbm_arc2grd \
-	mbm_grdcut \
-	mbm_grdinfo \
-	mbm_grdtiff \
-	mbm_utm \
-	mbm_grd2geovrml \
-	mbm_copy \
-	mbm_route2mission \
-	mbm_makedatalist \
-	mbm_histplot \
-	mbm_multiprocess \
-	mbm_multidatalist \
-	mbm_multicopy \
-	mbm_bpr \
-	mbm_makesvp
-
-all: all-am
-
-.SUFFIXES:
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
-	@for dep in $?; do \
-	  case '$(am__configure_deps)' in \
-	    *$$dep*) \
-	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-	        && { if test -f $@; then exit 0; else break; fi; }; \
-	      exit 1;; \
-	  esac; \
-	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/macros/Makefile'; \
-	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --gnu src/macros/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	@case '$?' in \
-	  *config.status*) \
-	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-	esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-install-binSCRIPTS: $(bin_SCRIPTS)
-	@$(NORMAL_INSTALL)
-	@list='$(bin_SCRIPTS)'; test -n "$(bindir)" || list=; \
-	if test -n "$$list"; then \
-	  echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
-	  $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
-	fi; \
-	for p in $$list; do \
-	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
-	  if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \
-	done | \
-	sed -e 'p;s,.*/,,;n' \
-	    -e 'h;s|.*|.|' \
-	    -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \
-	$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \
-	  { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
-	    if ($$2 == $$4) { files[d] = files[d] " " $$1; \
-	      if (++n[d] == $(am__install_max)) { \
-		print "f", d, files[d]; n[d] = 0; files[d] = "" } } \
-	    else { print "f", d "/" $$4, $$1 } } \
-	  END { for (d in files) print "f", d, files[d] }' | \
-	while read type dir files; do \
-	     if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
-	     test -z "$$files" || { \
-	       echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(bindir)$$dir'"; \
-	       $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
-	     } \
-	; done
-
-uninstall-binSCRIPTS:
-	@$(NORMAL_UNINSTALL)
-	@list='$(bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \
-	files=`for p in $$list; do echo "$$p"; done | \
-	       sed -e 's,.*/,,;$(transform)'`; \
-	dir='$(DESTDIR)$(bindir)'; $(am__uninstall_files_from_dir)
-
-mostlyclean-libtool:
-	-rm -f *.lo
-
-clean-libtool:
-	-rm -rf .libs _libs
-tags TAGS:
-
-ctags CTAGS:
-
-cscope cscopelist:
-
-
-distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	list='$(DISTFILES)'; \
-	  dist_files=`for file in $$list; do echo $$file; done | \
-	  sed -e "s|^$$srcdirstrip/||;t" \
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
-	case $$dist_files in \
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
-			   sort -u` ;; \
-	esac; \
-	for file in $$dist_files; do \
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  if test -d $$d/$$file; then \
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
-	    if test -d "$(distdir)/$$file"; then \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
-	  else \
-	    test -f "$(distdir)/$$file" \
-	    || cp -p $$d/$$file "$(distdir)/$$file" \
-	    || exit 1; \
-	  fi; \
-	done
-check-am: all-am
-check: check-am
-all-am: Makefile $(SCRIPTS)
-installdirs:
-	for dir in "$(DESTDIR)$(bindir)"; do \
-	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
-	done
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
-	if test -z '$(STRIP)'; then \
-	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	      install; \
-	else \
-	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
-	fi
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
-	@echo "This command is intended for maintainers to use"
-	@echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-generic clean-libtool mostlyclean-am
-
-distclean: distclean-am
-	-rm -f Makefile
-distclean-am: clean-am distclean-generic
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am: install-binSCRIPTS
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
-	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-generic mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am: uninstall-binSCRIPTS
-
-.MAKE: install-am install-strip
-
-.PHONY: all all-am check check-am clean clean-generic clean-libtool \
-	cscopelist-am ctags-am distclean distclean-generic \
-	distclean-libtool distdir dvi dvi-am html html-am info info-am \
-	install install-am install-binSCRIPTS install-data \
-	install-data-am install-dvi install-dvi-am install-exec \
-	install-exec-am install-html install-html-am install-info \
-	install-info-am install-man install-pdf install-pdf-am \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-generic \
-	mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \
-	uninstall-am uninstall-binSCRIPTS
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/macros/mbm_arc2grd b/src/macros/mbm_arc2grd
deleted file mode 100755
index 55b10da..0000000
--- a/src/macros/mbm_arc2grd
+++ /dev/null
@@ -1,230 +0,0 @@
-#!/usr/bin/env perl
-#--------------------------------------------------------------------
-#    The MB-system:	mbm_arc2grd.perl	4/21/01
-#    $Id: mbm_arc2grd 2227 2015-02-05 21:12:31Z caress $
-#
-#    Copyright (c) 2001-2015 by
-#    D. W. Caress (caress at mbari.org)
-#      Monterey Bay Aquarium Research Institute
-#      Moss Landing, CA
-#    and D. N. Chayes (dale at lamont.ldgo.columbia.edu)
-#      Lamont-Doherty Earth Observatory
-#      Palisades, NY  10964
-#
-#    See README file for copying and redistribution conditions.
-#--------------------------------------------------------------------
-#
-# Command:
-#   mbm_arc2grd
-#
-# Purpose:
-#   Macro to convert a ArcView ASCII grid to an GMT grid file in the
-#   GMT NetCDF grid format. This allows users to import the grid
-#   into GMT. The grid will have the same grid interval in both
-#   longitude and latitude.
-#
-# Basic Usage:
-#   mbm_arc2grd -Iarcfile -Ogrdfile [-H -V]
-#
-# Author:
-#   David W. Caress
-#   Monterey Bay Aquarium Research Institute
-#   Moss Landing, CA 95039
-#   April 21, 2001
-#   (at sea on the R/V Western Flyer about
-#    10 km off the windward side of Oahu)
-#
-# Version:
-#   $Id: mbm_arc2grd 2227 2015-02-05 21:12:31Z caress $
-#
-# Revisions:
-#   $Log: mbm_arc2grd.perl,v $
-#   Revision 5.7  2009/01/15 17:37:28  caress
-#   Update on 15 Jan 2009 - fix to mbm_grd2arc and mbm_arc2grd
-#
-#   Revision 5.6  2005/06/04 04:25:57  caress
-#   Macros now handles both upper case and lower case characters in Arc grid headers.
-#
-#   Revision 5.5  2003/09/23 21:13:51  caress
-#   Fixed bug in applying xyz2grd to temporary file of xyz triples.
-#
-#   Revision 5.4  2003/08/28 18:39:37  caress
-#   Fixed problems parsing Arc grid files on MBARI CD's..
-#
-#   Revision 5.3  2003/08/24 23:57:14  caress
-#   *** empty log message ***
-#
-#   Revision 5.2  2003/04/17 20:42:48  caress
-#   Release 5.0.beta30
-#
-#   Revision 5.1  2001/06/03 06:59:24  caress
-#   Release 5.0.beta01
-#
-#   Revision 5.0  2001/04/23 21:22:45  caress
-#   Initial revision
-#
-#
-#
-#
-
-$program_name = "mbm_arc2grd";
-
-# Deal with command line arguments
-&Getopts('I:i:N:n:O:o:VvHh');
-$ifile =    ($opt_I || $opt_i);
-$ofile =    ($opt_O || $opt_o);
-$help =     ($opt_H || $opt_h);
-$verbose =  ($opt_V || $opt_v);
-
-#--------------------------------------------------------------------
-
-# print out help message if required
-if ($help)
-	{
-	print "\n$program_name:\n";
-	print "\nVersion: $Id: mbm_arc2grd 2227 2015-02-05 21:12:31Z caress $\n";
-	print "\nMacro to convert a ArcView ASCII grid to an GMT grid file in the \n";
-	print "GMT NetCDF grid format. This allows users to import the grid\n";
-	print "into GMT. The grid will have the same grid interval in both \n";
-	print "longitude and latitude.\n";
-	print "\nBasic Usage: \n";
-	print "\t$program_name -Igrdfile -Oarcfile [-H -Nnodata -V]\n";
-	exit 0;
-	}
-
-# check for input file
-if (!$ifile)
-	{
-	print "\a";
-	die "No input file specified\nMacro $program_name aborted\n";
-	}
-elsif (!open(INP,"<$ifile"))
-	{
-	print "\a";
-	die "Specified input file $ifile cannot be opened\nMacro $program_name aborted\n";
-	}
-if (!$ofile)
-	{
-	print "\a";
-	die "No output file specified\nMacro $program_name aborted\n";
-	}
-$tmpfile = $program_name . "_tmp_" . "$$";
-if (!open(TMP,">$tmpfile"))
-	{
-	print "\a";
-	die "Cannot open temporary file $tmpfile\nMacro $program_name aborted.\n";
-	}
-
-# read header of ascii Arc grid file
-$cnt = 0;
-$nodata = "NaN";
-while (<INP>) {
-	$cnt++;
-	$line = lc($_);
-	if ($cnt == 1) {
-		($ncols) = $line =~ /ncols\s+(\S+)/;
-	}
-	elsif ($cnt == 2) {
-		($nrows) = $line =~ /nrows\s+(\S+)/;
-	}
-	elsif ($cnt == 3) {
-		($xllcorner) = $line =~ /xllcorner\s+(\S+)/;
-	}
-	elsif ($cnt == 4) {
-		($yllcorner) = $line =~ /yllcorner\s+(\S+)/;
-	}
-	elsif ($cnt == 5) {
-		($cellsize) = $line =~ /cellsize\s+(\S+)/;
-	}
-	elsif ($cnt == 6) {
-		($nodata) = $line =~ /nodata_value\s+(\S+)/i;
-		$xmin_f = $xllcorner + 0.5 * $cellsize;
-		$xmax_f = $xllcorner + $cellsize * ($ncols - 0.5);
-		$ymin_f = $yllcorner + 0.5 * $cellsize;
-		$ymax_f = $yllcorner + $cellsize * ($nrows - 0.5);
-	}
-	elsif ($cnt > 6) {
-		chop($_);
-		@values = split(/\s+/, $_);
-		foreach $value (@values) {
-			$ndata++;
-			print TMP "$value\n";
-		}
-	}
-}
-close(INP);
-close(TMP);
-
-# tell the world we got started
-if ($verbose)
-	{
-	print "\nProgram $program_name status:\n";
-	print "\tInput ArcView ASCII  file: $ifile\n";
-	print "\tOutput GRD file:           $ofile\n";
-	print "\tGrid dimensions:  $ncols  $nrows\n";
-	print "\tGrid cell sizes:  $cellsize  $cellsize\n";
-	print "\tGrid bounds:      $xmin_f  $xmax_f    $ymin_f  $ymax_f\n";
-	}
-
-# run xyz2grd
-$cmd = "xyz2grd $tmpfile -G$ofile -H0 -I$cellsize/$cellsize -R$xmin_f/$xmax_f/$ymin_f/$ymax_f -N$nodata -ZTLa -V";
-if ($verbose)
-	{
-	print "\nRunning xyz2grd...\n$cmd\n";
-	}
-`$cmd`;
-#`rm -f $tmpfile`;
-
-exit 0;
-
-#-----------------------------------------------------------------------
-# This should be loaded from the library but its safer to
-# just include it....
-#
-;# getopts.pl - a better getopt.pl
-
-;# Usage:
-;#      do Getopts('a:bc');  # -a takes arg. -b & -c not. Sets opt_* as a
-;#                           #  side effect.
-
-sub Getopts {
-    local($argumentative) = @_;
-    local(@args,$_,$first,$rest);
-    local($errs) = 0;
-
-    @args = split( / */, $argumentative );
-    while(@ARGV && ($_ = $ARGV[0]) =~ /^-(.)(.*)/) {
-     ($first,$rest) = ($1,$2);
-     $pos = index($argumentative,$first);
-     if($pos >= $[) {
-         if($args[$pos+1] eq ':') {
-          shift(@ARGV);
-          if($rest eq '') {
-              ++$errs unless @ARGV;
-              $rest = shift(@ARGV);
-          }
-          eval "\$opt_$first = \$rest;";
-         }
-         else {
-          eval "\$opt_$first = 1";
-          if($rest eq '') {
-              shift(@ARGV);
-          }
-          else {
-              $ARGV[0] = "-$rest";
-          }
-         }
-     }
-     else {
-         print STDERR "Unknown option: $first\n";
-         ++$errs;
-         if($rest ne '') {
-          $ARGV[0] = "-$rest";
-         }
-         else {
-          shift(@ARGV);
-         }
-     }
-    }
-    $errs == 0;
-}
diff --git a/src/macros/mbm_bpr b/src/macros/mbm_bpr
deleted file mode 100755
index 3ec9877..0000000
--- a/src/macros/mbm_bpr
+++ /dev/null
@@ -1,279 +0,0 @@
-#!/usr/bin/env perl
-#--------------------------------------------------------------------
-#    The MB-system:	mbm_bpr.perl	5/13/2002
-#    $Id: mbm_bpr 2231 2015-02-21 01:46:02Z caress $
-#
-#    Copyright (c) 2012-2015 by
-#    D. W. Caress (caress at mbari.org)
-#      Monterey Bay Aquarium Research Institute
-#      Moss Landing, CA
-#    and D. N. Chayes (dale at lamont.ldgo.columbia.edu)
-#      Lamont-Doherty Earth Observatory
-#      Palisades, NY  10964
-#
-#    See README file for copying and redistribution conditions.
-#--------------------------------------------------------------------
-#
-# Command:
-#   mbm_bpr
-#
-# Purpose:
-#   MB-System macro to process data from a Seabird SBE53 pressure
-#   sensor into a tidal model for use by mbprocess
-#
-# Basic Usage:
-#   mbm_bpr -Ifile -Zzone -Dellipsoid [-F -Q -H -V]
-#
-# Author:
-#   David W. Caress
-#   Monterey Bay Aquarium Research Institute
-#   Moss Landing, CA 95039
-#   May 13, 2002
-#
-# Version:
-#   $Id: mbm_bpr 2231 2015-02-21 01:46:02Z caress $
-#
-#
-use Getopt::Std;
-
-my $ProgramName = "mbm_bpr";
-
-# some default values
-$tmode = 0;
-$surfacepressure = 14.0;
-$tidemin = 0.0;
-$tidemax = 0.0;
-$PI = 3.1415926;
-
-# Deal with command line arguments using the "standard" perl library
-if ( ! (getopts('D:d:HhI:i:O:o:R:r:TtVv'))) {
-  print "$0: error on input\n";
-  useage();
-  exit 0;
-}
-
-my $help     = ($opt_H || $opt_h);
-my $offset   = ($opt_D || $opt_d);
-my $ifile    = ($opt_I || $opt_i);
-my $ofile    = ($opt_O || $opt_o);
-my $location = ($opt_R || $opt_r);
-my $tmode    = ($opt_T || $opt_t);
-my $verbose  = ($opt_V || $opt_v);
-
-# print out help message if required
-if ($help)
-	{
-	print "\n$ProgramName:\n";
-	print "\nVersion: $Id: mbm_bpr 2231 2015-02-21 01:46:02Z caress $\n";
-	print "\nMB-System macro to process data from a Seabird SBE53 pressure\n";
-	print "sensor into a tidal model for use by mbprocess\n";
-	print "\nUsage: \n";
-	print "\t$Program_name -Ibprfile -Otidefile [-Doffset -Rbprlon/bprlat -T -H -V]\n";
-	exit 0;
-	}
-
-# Get position if that has been specified
-if ($location && $location =~ /^(\S+)\/(\S+)/) {
-    ($longitude, $latitude) = $location =~ /^(\S+)\/(\S+)/;
-}
-else {
-    $latitude = 0.0;
-}
-
-# Open the input and output files. Failure on either is fatal.
-open(FI,$ifile) || die "Cannot open input file: $ifile\n$ProgramName aborted.\n";
-open(FO,">".$ofile) || die "Cannot open output file: $ofile\n$ProgramName aborted.\n";
-
-# Loop over the input records
-$count = 0;
-while ($line=<FI>) {		# reading from the input
-  ($tcount, $month, $day, $year, $hour, $minute, $second, $pressure, $temperature)
-  	= $line =~ /(\S+)\s+(\S+)\/(\S+)\/(\S+)\s+(\S+):(\S+):(\S+)\s+(\S+)\s+(\S+)/;
-
-  # Use the first value as the surface pressure provided it is valid
-  if ($tcount == 1 && $pressure < 99999.0) {
-    $surfacepressure = $pressure;
-  }
-
-  # only use valid pressure values
-  if ($pressure < 99999.0) {
-    $time_d = `mbtime -T$year/$month/$day/$hour/$minute/$second`;
-    chop($time_d);
-    push (@time_ds, $time_d);
-
-    push (@years, $year);
-    push (@months, $month);
-    push (@days, $day);
-    push (@hours, $hour);
-    push (@minutes, $minute);
-    push (@seconds, $second);
-
-    # Calculate the depth from pressure
-    #
-    # The following derives from Sea-Bird Electronics
-    # Application Note number 69: Conversion of Pressure to Depth
-    #	http://www.seabird.com/application_notes/AN69.htm
-    #
-    # Sea-Bird uses the formula in UNESCO Technical Papers in Marine Science No. 44.
-    # This is an empirical formula that takes compressibility (that is, density) into account.
-    # An ocean water column at 0 �C (t = 0) and 35 PSU (s = 35) is assumed.
-    #
-    # The gravity variation with latitude and pressure is computed as:
-    #
-    # g (m/sec2) = 9.780318 * [ 1.0 + ( 5.2788x10 -3  + 2.36x10 -5  * x) * x ] + 1.092x10 -6  * p
-    #
-    # where
-    # x = [sin (latitude / 57.29578) ] 2
-    # p = pressure (decibars)
-    #
-    # Then, depth is calculated from pressure:
-    #
-    # depth (meters) = [(((-1.82x10 -15  * p + 2.279x10 -10 ) * p - 2.2512x10 -5 ) * p + 9.72659) * p] / g
-    #
-    # where
-    # p = pressure (decibars)
-    # g = gravity (m/sec2)
-    #
-    # N. P. Fofonoff and R. C. Millard, Jr., ��Algorithms for computation of fundamental properties of seawater,�� Unesco Tech. Papers in Mar. Sci., No. 44 1983.
-    #
-    $pressuredbar = 0.6894757293 * ($pressure - $surfacepressure);
-    $x = (sin($latitude * $PI / 180.0))**2;
-    $g = 9.780318 * ( 1.0 + ( 5.2788e-3  + 2.36e-5  * $x) * $x ) + 1.092e-6  * $pressuredbar;
-    $depth = ((((-1.82e-15  * $pressuredbar + 2.279e-10 ) * $pressuredbar - 2.2512e-5 ) * $pressuredbar + 9.72659) * $pressuredbar) / $g;
-
-    push (@depths, $depth);
-    $count++;
- }
-}
-
-close(FI);
-
-# tell program status
-if ($verbose) {
-    print "\nProgram $program_name Status:\n";
-    print "  $count pressure values read from $ifile\n";
-    if ($offset) {
-      print "  Depth offset: $offset m\n";
-    }
-    if ($location) {
-      print "  Vertical reference to tidal model for position $longitude $latitude\n";
-    } else {
-      print "  Vertical reference will be the mean of the middle half of the data\n";
-    }
-    if ($tmode == 0) {
-      print "  Tide will be output as <time_d tide> values\n";
-      print "  A plot will be generated\n";
-    }
-   else {
-      print "  Tide will be output as <yr mo da hr mi sc tide> values\n";
-      print "  No plot will be generated\n";
-    }
-}
-
-# If location specified then use mbotps to get a tidal model
-# and then correct the bpr data to a tidal signal by
-# subtracting the mean difference between the tidal model and
-# the middle half of the data
-if ($location && $count > 10) {
-    # Execut mbotps to get tidal model for the specified location
-    $i = $count / 4;
-    $j = 3 * $count / 4;
-    $interval = 20 * int(($time_ds[$j] - $time_ds[$i]) / ($j - $i));
-    $start = "$years[0]/$months[0]/$days[0]/$hours[0]/$minutes[0]/$seconds[0]";
-    $end = "$years[$count-1]/$months[$count-1]/$days[$count-1]/$hours[$count-1]/$minutes[$count-1]/$seconds[$count-1]";
-    $modelfile = $ifile . "_tidemodel.txt";
-    $cmd = "mbotps -A1 -D$interval -R$location -B$start -E$end -O$modelfile";
-    if ($verbose) {
-      print "  Executing: $cmd\n";
-    }
-    `$cmd`;
-
-    $nmean = 0;
-    $ntide = 0;
-    $mean = 0.0;
-    open(FI,$modelfile) || die "Cannot open temporary file: $modelfile\n$ProgramName aborted.\n";
-    while ($line=<FI>) {		# reading from the input
-      if ($line =~ /^\#.+/) {
-      }
-      else {
-	($time_d, $tide) = $line =~ /(\S+)\s+(\S+)/;
-	if ($ntide > $count / 80 && $ntide < 3 * $count / 80) {
-	  $mean += $depths[$i + 20 * $nmean] - $tide;
-	  $nmean++;
-	}
-	if ($tide < $tidemin) {
-	  $tidemin = $tide;
-	}
-	if ($tide > $tidemax) {
-	  $tidemax = $tide;
-	}
-	$ntide++;
-      }
-    }
-    close(FI);
-    $mean /= $nmean;
-}
-
-# Else if no location specified then correct to a tidal signal by
-# subtracting the mean depth of the middle half of the data
-# Calculate the mean depth for the middle half of the data
-else {
-    $nmean = 0;
-    $mean = 0.0;
-    for ($i = $count / 4; $i < 3 * $count / 4; $i++) {
-	$mean += $depths[$i];
-	$nmean++;
-    }
-    $mean /= $nmean;
-}
-
-# Output the tidal data corrected for the mean (or referenced to a model)
-$ocount = 0;
-for ($i = 0; $i < $count; $i++) {
-  $tide = $depths[$i] - $mean + $offset;
-  if (abs($tide) < 2.5) {
-    if ($tmode == 0) {
-      printf FO "$time_ds[$i] $tide\n";
-    }
-    else {
-      printf FO "%4.4d %2.2d %2.2d %2.2d %2.2d %2.2d %f\n",
-    		$years[$i], $months[$i], $days[$i], $hours[$i],
-		$minutes[$i], $seconds[$i], $tide;
-    }
-  $ocount++;
-  if ($tide < $tidemin) {
-    $tidemin = $tide;
-  }
-  if ($tide > $tidemax) {
-    $tidemax = $tide;
-  }
-  }
-}
-
-close(FO);
-
-# tell program status
-if ($verbose) {
-    print "  $ocount pressure values output to $ofile\n";
-    print "  Vertical reference: $mean m\n";
-    }
-
-# generate plot of tide observations (and model if location specified)
-if ($tmode == 0) {
-  $plotfile = $ofile . "_tideplot";
-  if (abs($tidemin) > $tidemax) {
-    $tidemax = abs($tidemin);
-  }
-  $tidemax *= 1.1;
-  if ($ntide > 0) {
-    $cmd = "mbm_xyplot -R$time_ds[0]/$time_ds[$count-1]/-$tidemax/$tidemax -IWblack:$ofile -IWred:$modelfile -O$plotfile -L\"Tide Data from BPR <$ofile> (black) & Tide Model (red):Seconds:Tide (meters)\" -V";
-  }
-  else {
-    $cmd = "mbm_xyplot -R$time_ds[0]/$time_ds[$count-1]/-$tidemax/$tidemax -IWblack:$ofile -O$plotfile -L\"Tide Data from BPR <$ofile>:Seconds:Tide (meters)\" -V";
-  }
-  print "  Executing $cmd\n\n";
-  $line = `$cmd`;
-  print $line;
-}
-
-#-----------------------------------------------------------------------
diff --git a/src/macros/mbm_copy b/src/macros/mbm_copy
deleted file mode 100755
index 7416b59..0000000
--- a/src/macros/mbm_copy
+++ /dev/null
@@ -1,243 +0,0 @@
-#!/usr/bin/env perl
-#--------------------------------------------------------------------
-#    The MB-system:	mbm_plot.perl	1/17/2003
-#    $Id: mbm_copy 2227 2015-02-05 21:12:31Z caress $
-#
-#    Copyright (c) 2003-2015 by
-#    D. W. Caress (caress at mbari.org)
-#      Monterey Bay Aquarium Research Institute
-#      Moss Landing, CA
-#    and D. N. Chayes (dale at lamont.ldgo.columbia.edu)
-#      Lamont-Doherty Earth Observatory
-#      Palisades, NY  10964
-#
-#    See README file for copying and redistribution conditions.
-#--------------------------------------------------------------------
-#
-# Command:
-#   mbm_copy
-#
-# Purpose:
-#   Macro to apply mbcopy to all files referenced through
-#   a datalist, using the MB-System file suffix convention
-#   to name the output files.
-#
-# Basic Usage:
-#   mbm_copy -Foutputformat -Idatalist [-H -V -C -T]
-#
-# Author:
-#   David W. Caress
-#   Lamont-Doherty Earth Observatory
-#   Palisades, NY  10964
-#   January 17, 2003
-#
-# Version:
-#   $Id: mbm_copy 2227 2015-02-05 21:12:31Z caress $
-#
-# Revisions:
-#   $Log: mbm_copy.perl,v $
-#   Revision 5.2  2006/09/11 18:55:52  caress
-#   Changes during Western Flyer and Thomas Thompson cruises, August-September
-#   2006.
-#
-#   Revision 5.1  2005/11/05 01:34:20  caress
-#   Much work over the past two months.
-#
-#   Revision 5.0  2003/03/10 19:54:43  caress
-#   Initial version.
-#
-#
-#
-$program_name = "mbm_copy";
-
-# Deal with command line arguments
-$command_line = "@ARGV";
-&MBGetopts('CcF:f:HhI:i:TtVv');
-$oformat = 		($opt_F || $opt_f);
-$help =    		($opt_H || $opt_h);
-$datalist =    		($opt_I || $opt_i);
-$check =    		($opt_C || $opt_c);
-$test =    		($opt_T || $opt_t);
-$verbose = 		($opt_V || $opt_v);
-
-# print out help message if required
-if ($help)
-	{
-	print "\n$program_name:\n";
-	print "\nVersion: $Id: mbm_copy 2227 2015-02-05 21:12:31Z caress $\n";
-	print "\nMacro to apply mbcopy to all files referenced through\n";
-	print "a datalist, using the MB-System file suffix convention\n";
-	print "to name the output files.\n";
-	print "\nBasic Usage: \n";
-	print "\t$program_name -Foutputformat -Idatalist [-H -V -T]\n";
-	exit 0;
-	}
-
-# check for input file
-if (!$datalist)
-	{
-	print "\a";
-	die "No input datalist specified - $program_name aborted\n";
-	}
-elsif (! -e $datalist)
-	{
-	print "\a";
-	die "Specified input datalist cannot be opened - $program_name aborted\n";
-	}
-
-# tell the world we got started
-if ($verbose)
-	{
-	print "\nRunning $program_name...\n";
-	}
-
-# loop over all files referenced in datalist
-if ($verbose)
-	{
-	print "\nGetting file list using mbdatalist...\n\n";
-	}
- at mbdatalist = `mbdatalist -F-1 -I$datalist`;
-while (@mbdatalist)
-	{
-	$line = shift @mbdatalist;
-	if ($line =~ /(\S+)\s+(\S+)/)
-		{
-		($file_mb,$format_mb) =
-			$line =~ /(\S+)\s+(\S+)/;
-		push(@files_data, $file_mb);
-		push(@formats, $format_mb);
-		}
-	}
-
-# copy each of the files using mbcopy
-$cnt = 0;
-foreach $file_mb (@files_data)
-	{
-	# get file root
-	$line = `mbformat -K -I$file_mb`;
-	($root,$format_mb) = $line =~ /(\S+)\s+(\S+)/;
-	$iformat = $formats[$cnt];
-	if ($oformat)
-		{
-		$outformat = $oformat;
-		}
-	else
-		{
-		$outformat = $format_mb;
-		}
-	$ofile_mb = "$root.mb$outformat";
-	if ($ofile_mb eq $file_mb)
-		{
-		$root = $root . "c";
-		$ofile_mb = "$root.mb$oformat";
-		}
-
-	# copy to output format using mbcopy
-	if (!$check || !(-e $ofile_mb))
-		{
-		$mbcopy = "mbcopy -F$iformat/$outformat -I$file_mb -O$root.mb$outformat";
-		if (!$test)
-			{
-			print "Running: $mbcopy\n";
-			`$mbcopy`;
-			}
-		else
-			{
-			print "Testing: $mbcopy\n";
-			}
-		}
-
-	# increment counter
-	$cnt++;
-	}
-
-# exit
-exit 0;
-
-#-----------------------------------------------------------------------
-# This version of Getopts has been augmented to support multiple
-# calls to the same option. If an arg in argumentative is followed
-# by "+" rather than ":",  then the corresponding scalar will
-# be concatenated rather than overwritten by multiple calls to
-# the same arg.
-#
-# Usage:
-#      do Getopts('a:b+c'); # -a takes arg, -b concatenates args,
-#			    # -c does not take arg. Sets opt_* as a
-#                           # side effect.
-
-sub MBGetopts {
-    local($argumentative) = @_;
-    local(@args,$_,$first,$rest);
-    local($errs) = 0;
-
-    @args = split( / */, $argumentative );
-    while(@ARGV && ($_ = $ARGV[0]) =~ /^-(.)(.*)/) {
-	($first,$rest) = ($1,$2);
-	$pos = index($argumentative,$first);
-	if($pos >= $[) {
-	    if($args[$pos+1] eq ':') {
-		shift(@ARGV);
-		if($rest eq '') {
-		    ++$errs unless @ARGV;
-		    $rest = shift(@ARGV);
-		}
-		eval "\$opt_$first = \$rest;";
-		eval "\$flg_$first = 1;";
-	    }
-	    elsif($args[$pos+1] eq '+') {
-		shift(@ARGV);
-		if($rest eq '') {
-		    ++$errs unless @ARGV;
-		    $rest = shift(@ARGV);
-		}
-		if (eval "\$opt_$first") {
-		    eval "\$opt_$first = \$opt_$first
-				. \":\" . \$rest;";
-		}
-		else {
-		    eval "\$opt_$first = \$rest;";
-		}
-		eval "\$flg_$first = 1;";
-	    }
-	    elsif($args[$pos+1] eq '%') {
-		shift(@ARGV);
-		if($rest ne '') {
-		    eval "\$opt_$first = \$rest;";
-		}
-		else {
-		    $rest = $ARGV[0];
-		    ($one) = $rest =~ /^-(.).*/;
-		    $pos = index($argumentative,$one);
-		    if(!$one || $pos < $[) {
-			eval "\$opt_$first = \$rest;";
-			shift(@ARGV);
-		    }
-		}
-		eval "\$flg_$first = 1;";
-	    }
-	    else {
-		eval "\$opt_$first = 1";
-		eval "\$flg_$first = 1;";
-		if($rest eq '') {
-		    shift(@ARGV);
-		}
-		else {
-		    $ARGV[0] = "-$rest";
-		}
-	    }
-	}
-	else {
-	    print STDERR "Unknown option: $first\n";
-	    ++$errs;
-	    if($rest ne '') {
-		$ARGV[0] = "-$rest";
-	    }
-	    else {
-		shift(@ARGV);
-	    }
-	}
-    }
-    $errs == 0;
-}
-#-----------------------------------------------------------------------
diff --git a/src/macros/mbm_dslnavfix b/src/macros/mbm_dslnavfix
deleted file mode 100755
index 46d6c8f..0000000
--- a/src/macros/mbm_dslnavfix
+++ /dev/null
@@ -1,642 +0,0 @@
-#!/usr/bin/env perl
-#--------------------------------------------------------------------
-#    The MB-system:	mbm_dslnavfix.perl	8/9/96
-#    $Id: mbm_dslnavfix 2227 2015-02-05 21:12:31Z caress $
-#
-#    Copyright (c) 1996-2015 by
-#    D. W. Caress (caress at mbari.org)
-#      Monterey Bay Aquarium Research Institute
-#      Moss Landing, CA
-#    and D. N. Chayes (dale at lamont.ldgo.columbia.edu)
-#      Lamont-Doherty Earth Observatory
-#      Palisades, NY  10964
-#
-#    See README file for copying and redistribution conditions.
-#--------------------------------------------------------------------
-#
-# Command:
-#   mbm_dslnavfix
-#
-# Purpose:
-#   Macro to take WHOI DSL AMS-120 processed navigation
-#   in UTM projected eastings and northings and produce
-#   navigation in longitude and latitude. The output navigation
-#   can be merged with the DSL AMS-120 bathymetry and sidescan
-#   data using mbmerge (use the -M2 option of mbmerge).
-#
-# Basic Usage:
-#   mbm_dslnavfix -Iinfile -Ooutfile -Jutm_zone [-Ddecimate -V -H]
-#
-# Author:
-#   David W. Caress
-#   Lamont-Doherty Earth Observatory
-#   Palisades, NY  10964
-#   August 9, 1996
-#
-# Version:
-#   $Id: mbm_dslnavfix 2227 2015-02-05 21:12:31Z caress $
-#
-# Revisions:
-#   $Log: mbm_dslnavfix.perl,v $
-#   Revision 5.2  2003/04/17 20:42:48  caress
-#   Release 5.0.beta30
-#
-#   Revision 5.1  2001/03/22 21:05:45  caress
-#   Trying to make release 5.0.beta0
-#
-# Revision 5.0  2000/12/01  22:58:01  caress
-# First cut at Version 5.0.
-#
-# Revision 4.6  2000/10/03  21:42:17  caress
-# Snapshot for Dale.
-#
-# Revision 4.5  1999/12/29  00:17:55  caress
-# Release 4.6.8
-#
-# Revision 4.4  1999/10/21  20:42:32  caress
-# Added nav format to mbm_dslnavfix.
-#
-# Revision 4.3  1999/03/31  18:09:36  caress
-# MB-System 4.6beta7
-#
-# Revision 4.2  1997/07/25  13:50:21  caress
-# Added ellipsoid option.
-#
-# Revision 4.1  1997/04/21  16:54:41  caress
-# MB-System 4.5 Beta Release.
-#
-# Revision 4.1  1997/03/26  15:27:16  caress
-# Fixed handling of UTM zone as per Del Bohnenstiehl.
-#
-# Revision 4.0  1996/08/12  21:14:19  caress
-# Initial revision.
-#
-#
-#
-$program_name = "mbm_dslnavfix";
-
-# Deal with command line arguments
-$command_line = "@ARGV";
-&MBGetopts('D:d:E:e:F:f:HhI:i:J:j:O:o:Vv');
-$decimate = 		($opt_D || $opt_d || 1);
-$ellipsoid_use = 	($opt_E || $opt_e || "WGS-84");
-$format =    		($opt_F || $opt_f || 2);
-$help =    		($opt_H || $opt_h);
-$infile =    		($opt_I || $opt_i);
-$map_scale =    	($opt_J || $opt_j);
-$outfile =    		($opt_O || $opt_o);
-$verbose =    		($opt_V || $opt_v);
-
-# print out help message if required
-if ($help)
-	{
-	print "\n$program_name:\n";
-	print "\nVersion: $Id: mbm_dslnavfix 2227 2015-02-05 21:12:31Z caress $\n";
-	print "\nMacro to take WHOI DSL AMS-120 processed navigation \n";
-	print "in UTM projected eastings and northings and produce \n";
-	print "navigation in longitude and latitude. The output navigation \n";
-	print "can be merged with the DSL AMS-120 bathymetry and sidescan \n";
-	print "data using mbmerge (use the -M2 option of mbmerge). \n";
-        print "\nBasic Usage:  \n";
-        print "mbm_dslnavfix -Iinfile -Ooutfile -Jutm_zone -F1 [-Ddecimate -V -H] \n\n";
-	exit 0;
-	}
-
-# check for input and output files
-if (!$infile)
-	{
-	print "\a";
-	die "No input file specified - $program_name aborted\n";
-	}
-elsif (! -e $infile)
-	{
-	print "\a";
-	die "Specified input file cannot be opened - $program_name aborted\n";
-	}
-if (!$outfile)
-	{
-	print "\a";
-	die "No output file specified - $program_name aborted\n";
-	}
-
-# check for projection
-if (!$map_scale)
-	{
-	print "\a";
-	die "No UTM zone specified - $program_name aborted\n";
-	}
-
-# tell the world we got started
-if ($verbose)
-	{
-	print "\nRunning $program_name...\n";
-	}
-
-# make the temporary filenames
-$tmp_proj_navfile = "tmp_proj_$$.nav";
-$tmp_geo_navfile = "tmp_geo_$$.nav";
-
-# get projection
-$projection = "u" . "$map_scale" . "/1:1000000";
-$projection_id = "UTM Zone $map_scale";
-
-# set units of eastings and northings
-$projection_units = "M";
-$units_meters = 1;
-
-# now set the other projection parameters
-if ($map_scale > 0)
-	{
-	$org_lon_n = -183 + 6 * $map_scale;
-	}
-else
-	{
-	$org_lon_n = -183 - 6 * $map_scale;
-	}
-$org_lon = "$org_lon_n:0";
-$org_lat = "0:0";
-$org_lon_n = $org_lon_n + 1;
-$org_lon_plus1 = "$org_lon_n:0";
-$org_lat_plus1 = "1:0";
-if ($map_scale > 0)
-	{
-	$org_x_ft = 1640416.66667;
-	$org_x_m = 500000.0;
-	$org_y_ft = 0.0;
-	$org_y_m = 0.0;
-	}
-else
-	{
-	$org_x_ft = 1640416.66667;
-	$org_x_m = 500000.0;
-	$org_y_ft = 32808399.0;
-	$org_y_m = 100000000.0;
-	}
-
-$bounds = "$org_lon" . "/" . "$org_lat"
-		. "/" . "$org_lon_plus1"
-		. "/" . "$org_lat_plus1" . "r";
-
-# set gmt defaults
-($d_format) = `gmtdefaults -L | grep D_FORMAT` =~ /\S+\s+\S+\s+(\S+)/;
-($ellipsoid_save) = `gmtdefaults -L | grep ELLIPSOID` =~ /\S+\s+\S+\s+(\S+)/;
-`gmtset D_FORMAT %.10lg ELLIPSOID $ellipsoid_use`;
-
-# print out info
-if ($verbose)
-	{
-	print "\nProgram Status:\n";
-	print "--------------\n\n";
-	print "  Input DSL navigation format:   $format\n";
-	print "  Input DSL navigation file:     $infile\n";
-	print "  Output navigation file:        $outfile\n";
-	print "  Temporary projected nav file:  $tmp_proj_navfile\n";
-	print "  Temporary geographic nav file: $tmp_geo_navfile\n";
-	if ($decimate)
-		{
-		print "  Decimation factor:             $decimate\n";
-		}
-	print "\n  ------------\n\n";
-	print "  Projection:                    $projection_id\n";
-	if ($units_feet == 1)
-		{
-		print "  Projection units:              feet\n";
-		}
-	else
-		{
-		print "  Projection units:              meters\n";
-		}
-	print "\n  ------------\n\n";
-	}
-
-# get number of lines
-$linecountcom = "cat $infile | wc -l";
-$numberlines = `$linecountcom`;
-
-# now open the raw DSL navigation data
-if (!open(INP,"<$infile"))
-	{
-	die "\nInput file $infile cannot be opened!\n$program_name aborted\n";
-	}
-
-# now open the tmp projected navigation file
-if (!open(OTMP,">$tmp_proj_navfile"))
-	{
-	die "\nTmp file $tmp_proj_navfile cannot be opened!\n$program_name aborted\n";
-	}
-
-# now read the raw DSL navigation data
-$daysec_old = -9999;
-$count = $decimate - 1;
-$lastcount = $count + $numberlines - 1;
-while ($line = <INP>)
-	{
-	if ($format == 1)
-		{
-		if (($date, $time, $easting, $northing)
-			= $line =~ /^\S+\s+(\S+)\s+(\S+)\s+\S+\s+\S+\s+\S+\s+(\S+)\s+(\S+)/)
-			{
-			# get time stamp
-			($year, $month, $day)
-				= $date =~ /^(.{2}).{1}(.{2}).{1}(.{2})/;
-			($hour, $minute, $second)
-				= $time =~ /^(.{2}).{1}(.{2}).{1}(.{5})/;
-			if ($year > 61)
-				{
-				$year = $year + 1900;
-				}
-			else
-				{
-				$year = $year + 2000;
-				}
-			$daysec = $second + 60 * ($minute + 60 * $hour);
-			if ($daysec != $daysec_old)
-				{
-				$count++;
-				}
-			if ($daysec != $daysec_old &&
-				($count >= $decimate || $count == $lastcount))
-				{
-				$count = 0;
-
-				push(@nyear, $year);
-				push(@nmonth, $month);
-				push(@nday, $day);
-				push(@nhour, $hour);
-				push(@nminute, $minute);
-				push(@nsecond, $second);
-
-				# get projected values in desired units
-				if ($units_feet)
-					{
-					$xx = 12.0 / 1000000 *($easting - $org_x_ft);
-					$yy = 12.0 / 1000000 *($northing - $org_y_ft);
-					}
-				elsif ($units_meters)
-					{
-					$xx = ($easting - $org_x_m) / (0.0254 * 1000000);
-					$yy = ($northing - $org_y_m) / (0.0254 * 1000000);
-					}
-
-				#print "$year $month $day $hour:$minute:$second $easting $northing\n";
-				print OTMP "$xx $yy\n";
-				}
-			$daysec_old = $daysec;
-			}
-		else
-			{
-			print "Unable to parse navigation from line:\n$line\n";
-			}
-		}
-	elsif ($format == 2)
-		{
-		if (($date, $time, $easting, $northing)
-			= $line =~ /^(\S+),(\S+),\S+,\S+,\S+,(\S+),(\S+)/)
-			{
-			# get time stamp
-			($year, $month, $day)
-				= $date =~ /^(.{2}).{1}(.{2}).{1}(.{2})/;
-			($hour, $minute, $second)
-				= $time =~ /^(.{2}).{1}(.{2}).{1}(.{2})/;
-			if ($year > 61)
-				{
-				$year = $year + 1900;
-				}
-			else
-				{
-				$year = $year + 2000;
-				}
-			$daysec = $second + 60 * ($minute + 60 * $hour);
-			if ($daysec != $daysec_old)
-				{
-				$count++;
-				}
-			if ($daysec != $daysec_old &&
-				($count >= $decimate || $count == $lastcount))
-				{
-				$count = 0;
-
-				push(@nyear, $year);
-				push(@nmonth, $month);
-				push(@nday, $day);
-				push(@nhour, $hour);
-				push(@nminute, $minute);
-				push(@nsecond, $second);
-
-				# get projected values in desired units
-				if ($units_feet)
-					{
-					$xx = 12.0 / 1000000 *($easting - $org_x_ft);
-					$yy = 12.0 / 1000000 *($northing - $org_y_ft);
-					}
-				elsif ($units_meters)
-					{
-					$xx = ($easting - $org_x_m) / (0.0254 * 1000000);
-					$yy = ($northing - $org_y_m) / (0.0254 * 1000000);
-					}
-
-				#print "$year $month $day $hour:$minute:$second $easting $northing\n";
-				print OTMP "$xx $yy\n";
-				}
-			$daysec_old = $daysec;
-			}
-		else
-			{
-			print "Unable to parse navigation from line:\n$line\n";
-			}
-		}
-	elsif ($format == 3)
-		{
-		if (($date, $time, $easting, $northing)
-			= $line =~ /^(\S+)-(\S+) \S+ \S+ \S+ (\S+) (\S+)/)
-			{
-			# get time stamp
-			($year, $month, $day)
-				= $date =~ /^(.{2}).{1}(.{2}).{1}(.{2})/;
-			($hour, $minute, $second)
-				= $time =~ /^(.{2}).{1}(.{2}).{1}(.{2})/;
-			if ($year > 61)
-				{
-				$year = $year + 1900;
-				}
-			else
-				{
-				$year = $year + 2000;
-				}
-			$daysec = $second + 60 * ($minute + 60 * $hour);
-			if ($daysec != $daysec_old)
-				{
-				$count++;
-				}
-			if ($daysec != $daysec_old &&
-				($count >= $decimate || $count == $lastcount))
-				{
-				$count = 0;
-
-				push(@nyear, $year);
-				push(@nmonth, $month);
-				push(@nday, $day);
-				push(@nhour, $hour);
-				push(@nminute, $minute);
-				push(@nsecond, $second);
-
-				# get projected values in desired units
-				if ($units_feet)
-					{
-					$xx = 12.0 / 1000000 *($easting - $org_x_ft);
-					$yy = 12.0 / 1000000 *($northing - $org_y_ft);
-					}
-				elsif ($units_meters)
-					{
-					$xx = ($easting - $org_x_m) / (0.0254 * 1000000);
-					$yy = ($northing - $org_y_m) / (0.0254 * 1000000);
-					}
-
-				#print "$year $month $day $hour:$minute:$second $easting $northing\n";
-				print OTMP "$xx $yy\n";
-				}
-			$daysec_old = $daysec;
-			}
-		else
-			{
-			print "Unable to parse navigation from line:\n$line\n";
-			}
-		}
-	elsif ($format == 4)
-		{
-		if (($year, $month, $day, $hour, $minute, $second, $easting, $northing)
-			= $line =~ /^(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)/)
-			{
-			$daysec = $second + 60 * ($minute + 60 * $hour);
-			if ($daysec != $daysec_old)
-				{
-				$count++;
-				}
-			if ($daysec != $daysec_old &&
-				($count >= $decimate || $count == $lastcount))
-				{
-				$count = 0;
-
-				push(@nyear, $year);
-				push(@nmonth, $month);
-				push(@nday, $day);
-				push(@nhour, $hour);
-				push(@nminute, $minute);
-				push(@nsecond, $second);
-
-				# get projected values in desired units
-				if ($units_feet)
-					{
-					$xx = 12.0 / 1000000 *($easting - $org_x_ft);
-					$yy = 12.0 / 1000000 *($northing - $org_y_ft);
-					}
-				elsif ($units_meters)
-					{
-					$xx = ($easting - $org_x_m) / (0.0254 * 1000000);
-					$yy = ($northing - $org_y_m) / (0.0254 * 1000000);
-					}
-
-				#print "$year $month $day $hour:$minute:$second $easting $northing\n";
-				print OTMP "$xx $yy\n";
-				}
-			$daysec_old = $daysec;
-			}
-		else
-			{
-			print "Unable to parse navigation from line:\n$line\n";
-			}
-		}
-	}
-
-# close files
-close INP;
-close OTMP;
-
-# get number of time stamps
-$ntime = @nyear;
-
-# print out info
-if ($verbose)
-	{
-	print "\n$ntime navigation records read...\n";
-	}
-
-# unproject the eastings and northings into longitude and latitude
-if ($verbose)
-	{
-	print "\nRunning mapproject...\n";
-	print "mapproject $tmp_proj_navfile -J$projection -I -R$bounds > $tmp_geo_navfile\n";
-	}
- at line = `mapproject $tmp_proj_navfile -J$projection -I -R$bounds > $tmp_geo_navfile`;
-if ($verbose)
-	{
-	foreach $line (@line) {
-		print "$line";
-		}
-	}
-
-# reset the gmt defaults
-`gmtset D_FORMAT $d_format ELLIPSOID $ellipsoid_save`;
-
-# now open the unprojected navigation data
-if (!open(INP,"<$tmp_geo_navfile"))
-	{
-	die "\nTmp file $tmp_geo_navfile cannot be opened!\n$program_name aborted\n";
-	}
-
-# now read the unprojected navigation data
-while ($line = <INP>)
-	{
-	if (($lon, $lat)
-		= $line =~ /^(\S+)\s+(\S+)/)
-		{
-		# put lon in -180 to 180 range
-		if ($lon < -180.0)
-			{
-			$lon = $lon + 360.0;
-			}
-		elsif ($lon > 180.0)
-			{
-			$lon = $lon - 360.0;
-			}
-
-		# add to list
-		push(@nlon, $lon);
-		push(@nlat, $lat);
-		}
-	else
-		{
-		die "\nUnable to parse navigation from line:\n$line\n$program_name aborted\n";
-		}
-	}
-
-# close file
-close INP;
-
-# get number of unprojected nav points
-$nnav = @nlon;
-
-# check that numbers of data match
-if ($ntime != $nnav)
-	{
-	die "\nNumber of time stamps ($ntime) disagrees with number of nav points ($nnav)!\n$program_name aborted\n";
-	}
-
-# now open the final navigation file
-if (!open(OTMP,">$outfile"))
-	{
-	die "\nTmp file $outfile cannot be opened!\n$program_name aborted\n";
-	}
-
-# now write the final navigation to the file
-for ($i = 0; $i < $ntime; $i ++)
-	{
-	print OTMP "$nyear[$i] $nmonth[$i] $nday[$i] $nhour[$i] $nminute[$i] $nsecond[$i] $nlon[$i] $nlat[$i]\n";
-	}
-
-# close file
-close OTMP;
-
-# remove the temporary files
-if ($verbose)
-	{
-	print "\nDeleting $tmp_proj_navfile, $tmp_geo_navfile...\n";
-	}
-`rm -f $tmp_proj_navfile $tmp_geo_navfile`;
-
-# done
-if ($verbose)
-	{
-	print "\nDone...\n";
-	}
-
-exit 0;
-
-
-#-----------------------------------------------------------------------
-# This version of Getopts has been augmented to support multiple
-# calls to the same option. If an arg in argumentative is followed
-# by "+" rather than ":",  then the corresponding scalar will
-# be concatenated rather than overwritten by multiple calls to
-# the same arg.
-#
-# Usage:
-#      do Getopts('a:b+c'); # -a takes arg, -b concatenates args,
-#			    # -c does not take arg. Sets opt_* as a
-#                           # side effect.
-
-sub MBGetopts {
-    local($argumentative) = @_;
-    local(@args,$_,$first,$rest);
-    local($errs) = 0;
-
-    @args = split( / */, $argumentative );
-    while(@ARGV && ($_ = $ARGV[0]) =~ /^-(.)(.*)/) {
-	($first,$rest) = ($1,$2);
-	$pos = index($argumentative,$first);
-	if($pos >= $[) {
-	    if($args[$pos+1] eq ':') {
-		shift(@ARGV);
-		if($rest eq '') {
-		    ++$errs unless @ARGV;
-		    $rest = shift(@ARGV);
-		}
-		eval "\$opt_$first = \$rest;";
-		eval "\$flg_$first = 1;";
-	    }
-	    elsif($args[$pos+1] eq '+') {
-		shift(@ARGV);
-		if($rest eq '') {
-		    ++$errs unless @ARGV;
-		    $rest = shift(@ARGV);
-		}
-		if (eval "\$opt_$first") {
-		    eval "\$opt_$first = \$opt_$first
-				. \":\" . \$rest;";
-		}
-		else {
-		    eval "\$opt_$first = \$rest;";
-		}
-		eval "\$flg_$first = 1;";
-	    }
-	    elsif($args[$pos+1] eq '%') {
-		shift(@ARGV);
-		if($rest ne '') {
-		    eval "\$opt_$first = \$rest;";
-		}
-		else {
-		    $rest = $ARGV[0];
-		    ($one) = $rest =~ /^-(.).*/;
-		    $pos = index($argumentative,$one);
-		    if(!$one || $pos < $[) {
-			eval "\$opt_$first = \$rest;";
-			shift(@ARGV);
-		    }
-		}
-		eval "\$flg_$first = 1;";
-	    }
-	    else {
-		eval "\$opt_$first = 1";
-		eval "\$flg_$first = 1;";
-		if($rest eq '') {
-		    shift(@ARGV);
-		}
-		else {
-		    $ARGV[0] = "-$rest";
-		}
-	    }
-	}
-	else {
-	    print STDERR "Unknown option: $first\n";
-	    ++$errs;
-	    if($rest ne '') {
-		$ARGV[0] = "-$rest";
-	    }
-	    else {
-		shift(@ARGV);
-	    }
-	}
-    }
-    $errs == 0;
-}
-#-----------------------------------------------------------------------
diff --git a/src/macros/mbm_fmtvel b/src/macros/mbm_fmtvel
deleted file mode 100755
index 8324432..0000000
--- a/src/macros/mbm_fmtvel
+++ /dev/null
@@ -1,274 +0,0 @@
-#!/usr/bin/env perl
-#--------------------------------------------------------------------
-#    The MB-system:	mbm_fmtvel.perl	6/18/93
-#    $Id: mbm_fmtvel 2227 2015-02-05 21:12:31Z caress $
-#
-#    Copyright (c) 1993-2015 by
-#    D. W. Caress (caress at mbari.org)
-#      Monterey Bay Aquarium Research Institute
-#      Moss Landing, CA
-#    and D. N. Chayes (dale at lamont.ldgo.columbia.edu)
-#      Lamont-Doherty Earth Observatory
-#      Palisades, NY  10964
-#
-#    See README file for copying and redistribution conditions.
-#--------------------------------------------------------------------
-#
-# Command:
-#   mbm_fmtvel
-#
-# Purpose:
-#   Perl shellscript to generate a list of the cmean (mean water
-#   velocity) and ckeel (surface water velocity) used by Hydrosweep
-#   in its internal processing.  This macro executes the program
-#   hsdump and then scans the output for the desired values.
-#   The only allowed formats are 21 (raw Hydrosweep data) and 24
-#   (L-DEO in-house binary Hydrosweep data).
-#
-# Usage:
-#   mbm_fmtvel -Fformat -Ifile
-#
-# Author:
-#   Dale N. Chayes
-#   David W. Caress
-#   Lamont-Doherty Earth Observatory
-#   Palisades, NY  10964
-#   May 19, 1993
-#
-# Version:
-#   $Id: mbm_fmtvel 2227 2015-02-05 21:12:31Z caress $
-#
-# Revisions:
-#   $Log: mbm_fmtvel.perl,v $
-#   Revision 5.1  2003/04/17 20:42:48  caress
-#   Release 5.0.beta30
-#
-#   Revision 5.0  2000/12/01 22:58:01  caress
-#   First cut at Version 5.0.
-#
-# Revision 4.4  2000/10/03  21:42:17  caress
-# Snapshot for Dale.
-#
-# Revision 4.3  1997/04/21  16:54:41  caress
-# MB-System 4.5 Beta Release.
-#
-# Revision 4.2  1995/05/12  17:43:23  caress
-# Made exit status values consistent with Unix convention.
-# 0: ok  nonzero: error
-#
-# Revision 4.2  1995/05/12  17:43:23  caress
-# Made exit status values consistent with Unix convention.
-# 0: ok  nonzero: error
-#
-# Revision 4.1  1994/10/21  11:36:58  caress
-# Release V4.0
-#
-# Revision 4.0  1994/03/05  23:52:40  caress
-# First cut at version 4.0
-#
-# Revision 4.1  1994/03/03  04:11:13  caress
-# Fixed copyright message.
-#
-# Revision 4.0  1994/02/26  19:37:57  caress
-# First cut at new version.
-#
-# Revision 1.4  1993/08/17  16:58:36  caress
-# Set location of perl to /usr/local/bin/perl
-#
-# Revision 1.3  1993/08/16  23:03:15  caress
-# I'm not sure what the changes are - I'm just checking in the
-# current version.
-#
-# Revision 1.2  1993/06/19  15:53:55  caress
-# Streamlined the Perl code. Now uses hsdump to scan the
-# Hydrosweep file, parses the output without using a
-# temporary file, and writes the output to stdout.
-#
-#
-# Revision 1.1  1993/05/20  04:03:13  dale
-# Initial revision
-#
-#
-###################################################
-$program_name = "mbm_fmtvel";
-
-# Deal with command line arguments
-&Getopts('F:f:I:i:');
-$file =    ($opt_I || $opt_i);
-$format =  ($opt_F || $opt_f);
-
-# print out help message if required
-if ($help)
-	{
-	print "\n$program_name:\n";
-	print "\nVersion: $Id: mbm_fmtvel 2227 2015-02-05 21:12:31Z caress $\n";
-	print "\nPerl shellscript to generate a list of the C-mean (mean water velocity) \nand C-keel (surface water velocity) used by Hydrosweepin its internal \nprocessing.  This macro executes the programhsdump and then scans the \noutput for the desired values.The only allowed formats are 5 (raw \nHydrosweep data) and 8(L-DEO in-house binary Hydrosweep data).\n";
-	print "\nUsage: $program_name -Fformat -Ifile\n";
-	exit 0;
-	}
-
-# check for defined parameters
-if (!$file)
-	{
-	die "No input file specified - $program_name aborted\n";
-	}
-if (!$format)
-	{
-	$format = "24";
-	}
-
-# get user id and time
-$me = `/usr/bin/id`;
- at me = split(' ',$me);
-$now = &ctime(time);
-
-# print output header
-print "\n# Hydrosweep C-mean and C-keel values extracted using \n# macro $program_name\n";
-print "# Run by user @me[0] on $now";
-print "#\n# Date\t\t  Time\t\t Longitude\t Latitude\tC-mean\tC-keel\n";
-
-# Run hsdump
- at hsdump = `hsdump -F$format -I$file -O4`;
-while (@hsdump)
-	{
-	$line = shift @hsdump;
-	if ($line =~ /^  Time: (.*)/)
-		{
-		@result = split(' ',$line);
-		print  @result[1],"\t", @result[2],"\t" ;
-		}
-	if ($line =~ /Longitude: (.*)/)
-		{
-		@result = split(' ',$line);
-		print  @result[1],"\t";
-		}
-	if ($line =~ /Latitude: (.*)/)
-		{
-		@result = split(' ',$line);
-		print  @result[1],"\t";
-		}
-	if ($line =~ /Mean velocity: (.*)/)
-		{
-		@result = split(' ',$line);
-		printf  "%6.1f\t", @result[2];
-		}
-	if ($line =~ /Keel velocity: (.*)/)
-		{
-		@result = split(' ',$line);
-		printf  "%6.1f\n", @result[2];
-		}
- 	}
-
-# end it all
-exit 0;
-
-#-----------------------------------------------------------------------
-# This should be loaded from the library but the shipboard installation
-# of Perl is screwed up so....
-#
-;# getopts.pl - a better getopt.pl
-
-;# Usage:
-;#      do Getopts('a:bc');  # -a takes arg. -b & -c not. Sets opt_* as a
-;#                           #  side effect.
-
-sub Getopts {
-    local($argumentative) = @_;
-    local(@args,$_,$first,$rest);
-    local($errs) = 0;
-
-    @args = split( / */, $argumentative );
-    while(@ARGV && ($_ = $ARGV[0]) =~ /^-(.)(.*)/) {
-	($first,$rest) = ($1,$2);
-	$pos = index($argumentative,$first);
-	if($pos >= $[) {
-	    if($args[$pos+1] eq ':') {
-		shift(@ARGV);
-		if($rest eq '') {
-		    ++$errs unless @ARGV;
-		    $rest = shift(@ARGV);
-		}
-		eval "\$opt_$first = \$rest;";
-	    }
-	    else {
-		eval "\$opt_$first = 1";
-		if($rest eq '') {
-		    shift(@ARGV);
-		}
-		else {
-		    $ARGV[0] = "-$rest";
-		}
-	    }
-	}
-	else {
-	    print STDERR "Unknown option: $first\n";
-	    ++$errs;
-	    if($rest ne '') {
-		$ARGV[0] = "-$rest";
-	    }
-	    else {
-		shift(@ARGV);
-	    }
-	}
-    }
-    $errs == 0;
-}
-
-1;
-
-#-----------------------------------------------------------------------
-# This should be loaded from the library but the shipboard installation
-# of Perl is screwed up so....
-#
-
-;# ctime.pl is a simple Perl emulation for the well known ctime(3C) function.
-;#
-;# Waldemar Kebsch, Federal Republic of Germany, November 1988
-;# kebsch.pad at nixpbe.UUCP
-;# Modified March 1990, Feb 1991 to properly handle timezones
-;#  $RCSfile: mbm_fmtvel.perl,v $$Revision: 5.1 $$Date: 2003/04/17 20:42:48 $
-;#   Marion Hakanson (hakanson at cse.ogi.edu)
-;#   Oregon Graduate Institute of Science and Technology
-;#
-;# usage:
-;#
-;#     #include <ctime.pl>          # see the -P and -I option in perl.man
-;#     $Date = &ctime(time);
-
-CONFIG: {
-    package ctime;
-
-    @DoW = ('Sun','Mon','Tue','Wed','Thu','Fri','Sat');
-    @MoY = ('Jan','Feb','Mar','Apr','May','Jun',
-	    'Jul','Aug','Sep','Oct','Nov','Dec');
-}
-
-sub ctime {
-    package ctime;
-
-    local($time) = @_;
-    local($[) = 0;
-    local($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst);
-
-    # Determine what time zone is in effect.
-    # Use GMT if TZ is defined as null, local time if TZ undefined.
-    # There's no portable way to find the system default timezone.
-
-    $TZ = defined($ENV{'TZ'}) ? ( $ENV{'TZ'} ? $ENV{'TZ'} : 'GMT' ) : '';
-    ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) =
-        ($TZ eq 'GMT') ? gmtime($time) : localtime($time);
-
-    # Hack to deal with 'PST8PDT' format of TZ
-    # Note that this can't deal with all the esoteric forms, but it
-    # does recognize the most common: [:]STDoff[DST[off][,rule]]
-
-    if($TZ=~/^([^:\d+\-,]{3,})([+-]?\d{1,2}(:\d{1,2}){0,2})([^\d+\-,]{3,})?/){
-        $TZ = $isdst ? $4 : $1;
-    }
-    $TZ .= ' ' unless $TZ eq '';
-
-    $year += ($year < 70) ? 2000 : 1900;
-    sprintf("%s %s %2d %2d:%02d:%02d %s%4d\n",
-      $DoW[$wday], $MoY[$mon], $mday, $hour, $min, $sec, $TZ, $year);
-}
-1;
diff --git a/src/macros/mbm_grd2arc b/src/macros/mbm_grd2arc
deleted file mode 100755
index 291d140..0000000
--- a/src/macros/mbm_grd2arc
+++ /dev/null
@@ -1,346 +0,0 @@
-#!/usr/bin/env perl
-#--------------------------------------------------------------------
-#    The MB-system:	mbm_grd2arc.perl	6/11/99
-#    $Id: mbm_grd2arc 2227 2015-02-05 21:12:31Z caress $
-#
-#    Copyright (c) 1999-2015 by
-#    D. W. Caress (caress at mbari.org)
-#      Monterey Bay Aquarium Research Institute
-#      Moss Landing, CA
-#    and D. N. Chayes (dale at lamont.ldgo.columbia.edu)
-#      Lamont-Doherty Earth Observatory
-#      Palisades, NY  10964
-#
-#    See README file for copying and redistribution conditions.
-#--------------------------------------------------------------------
-#
-# Command:
-#   mbm_grd2arc
-#
-# Purpose:
-#   Macro to convert a GMT grid file in the GMT NetCDF grid format
-#   to an ArcView ASCII grid. This allows users to import the grid
-#   into Arc/Info and ArcView. The grids must have the same grid
-#   interval in both longitude and latitude. If the grid was created
-#   using mbgrid or mbmosaic, the -E option must have been used
-#   with both dy = 0 and "!" appended (see the mbgrid and mbmosaic
-#   manual pages).
-#
-# Basic Usage:
-#   mbm_grd2arc -Igrdfile -Oarcfile [-H -Nnodata -V]
-#
-# Author:
-#   David W. Caress
-#   Monterey Bay Aquarium Research Institute
-#   Moss Landing, CA 95039
-#   October 5, 1999
-#
-# Version:
-#   $Id: mbm_grd2arc 2227 2015-02-05 21:12:31Z caress $
-#
-# Revisions:
-#   $Log: mbm_grd2arc.perl,v $
-#   Revision 5.4  2009/01/15 17:37:28  caress
-#   Update on 15 Jan 2009 - fix to mbm_grd2arc and mbm_arc2grd
-#
-#   Revision 5.3  2006/02/10 01:27:40  caress
-#   Fixed parsing of grdinfo output to handle changes to GMT4.1.
-#
-#   Revision 5.2  2003/04/17 20:42:48  caress
-#   Release 5.0.beta30
-#
-#   Revision 5.1  2001/06/03 06:59:24  caress
-#   Release 5.0.beta01
-#
-#   Revision 5.0  2000/12/01 22:58:01  caress
-#   First cut at Version 5.0.
-#
-# Revision 4.1  2000/10/03  21:42:17  caress
-# Snapshot for Dale.
-#
-# Revision 4.0  1999/10/06  20:43:21  caress
-# Initial version.
-#
-#
-#
-
-$program_name = "mbm_grd2arc";
-
-# Deal with command line arguments
-&Getopts('I:i:N:n:O:o:VvHh');
-$ifile =    ($opt_I || $opt_i);
-$ofile =    ($opt_O || $opt_o);
-$nodata =   ($opt_N || $opt_n || -99999);
-$help =     ($opt_H || $opt_h);
-$verbose =  ($opt_V || $opt_v);
-
-#--------------------------------------------------------------------
-
-# print out help message if required
-if ($help)
-	{
-	print "\n$program_name:\n";
-	print "\nVersion: $Id: mbm_grd2arc 2227 2015-02-05 21:12:31Z caress $\n";
-	print "\nMacro to convert a GMT grid file in the GMT NetCDF grid format \n";
-	print "to an ArcView ASCII grid. This allows users to import the grid\n";
-	print "into Arc/Info and ArcView. The grids must have the same grid \n";
-	print "interval in both longitude and latitude. If the grid was created\n";
-	print "using mbgrid or mbmosaic, the -E option must have been used \n";
-	print "with both dy = 0 and \"!\" appended (see the mbgrid and mbmosaic\n";
-	print "manual pages).\n";
-	print "\nBasic Usage: \n";
-	print "\t$program_name -Igrdfile -Oarcfile [-H -Nnodata -V]\n";
-	exit 0;
-	}
-
-# check for input file
-if (!$ifile)
-	{
-	print "\a";
-	die "No input file specified\nMacro $program_name aborted\n";
-	}
-elsif (! -e $ifile)
-	{
-	print "\a";
-	die "Specified input file $ifile cannot be opened\nMacro $program_name aborted\n";
-	}
-if (!$ofile)
-	{
-	print "\a";
-	die "No output file specified\nMacro $program_name aborted\n";
-	}
-elsif (!open(OUT,">$ofile"))
-	{
-	print "\a";
-	die "Cannot open output file $ofile\nMacro $program_name aborted.\n";
-	}
-
-# Save old GMT default double format and set new format
-$line = `gmtdefaults -L | grep D_FORMAT`;
-($dformatsave) = $line =~ /D_FORMAT\s+=\s+(\S+)/;
-`gmtset D_FORMAT %.10lg`;
-
-# Get info using grdinfo
- at grdinfo = `grdinfo $ifile`;
-while (@grdinfo)
-	{
-	$line = shift @grdinfo;
-	if ($line =~
-		/\S+\s+x_min:\s+\S+\s+x_max:\s+\S+\s+x_inc:\s+\S+\s+units:\s+.+\s+nx:\s+\S+/)
-		{
-		($xmin_f,$xmax_f,$xinc_f,$xunits,$xnx_d) = $line =~
-			/\S+\s+x_min:\s+(\S+)\s+x_max:\s+(\S+)\s+x_inc:\s+(\S+)\s+units:\s+(.+)\s+nx:\s+(\S+)/;
-		}
-	elsif ($line =~
-		/\S+\s+x_min:\s+\S+\s+x_max:\s+\S+\s+x_inc:\s+\S+\s+name:\s+.+\s+nx:\s+\S+/)
-		{
-		($xmin_f,$xmax_f,$xinc_f,$xunits,$xnx_d) = $line =~
-			/\S+\s+x_min:\s+(\S+)\s+x_max:\s+(\S+)\s+x_inc:\s+(\S+)\s+name:\s+(.+)\s+nx:\s+(\S+)/;
-		}
-	elsif ($line =~
-		/\S+\s+x_min:\s+(\S+)\s+x_max:\s+(\S+)\s+x_inc:/)
-		{
-		($xmin_f,$xmax_f) = $line =~
-			/\S+\s+x_min:\s+(\S+)\s+x_max:\s+(\S+)\s+x_inc:/;
-		}
-	if ($line =~ /\S+\s+y_min:\s+\S+\s+y_max:\s+\S+\s+y_inc:\s+\S+\s+units:\s+.+\s+ny:\s+\S+/)
-		{
-		($ymin_f,$ymax_f,$yinc_f,$yunits,$yny_d) = $line =~
-			/\S+\s+y_min:\s+(\S+)\s+y_max:\s+(\S+)\s+y_inc:\s+(\S+)\s+units:\s+(.+)\s+ny:\s+(\S+)/;
-		}
-	elsif ($line =~ /\S+\s+y_min:\s+\S+\s+y_max:\s+\S+\s+y_inc:\s+\S+\s+name:\s+.+\s+ny:\s+\S+/)
-		{
-		($ymin_f,$ymax_f,$yinc_f,$yunits,$yny_d) = $line =~
-			/\S+\s+y_min:\s+(\S+)\s+y_max:\s+(\S+)\s+y_inc:\s+(\S+)\s+name:\s+(.+)\s+ny:\s+(\S+)/;
-		}
-	elsif ($line =~ /\S+\s+y_min:\s+\S+\s+y_max:\s+\S+\s+y_inc:/)
-		{
-		($ymin_f,$ymax_f) = $line =~
-			/\S+\s+y_min:\s+(\S+)\s+y_max:\s+(\S+)\s+y_inc:/;
-		}
-	if ($line =~ /\S+\s+zmin:\s+\S+\s+zmax:\s+\S+\s+units:\s+\S+/)
-		{
-		($zmin_f,$zmax_f) = $line =~
-			/\S+\s+zmin:\s+(\S+)\s+zmax:\s+(\S+)\s+units:\s+\S+/;
-		}
-	elsif ($line =~ /\S+\s+zmin:\s+\S+\s+zmax:\s+\S+\s+name:\s+\S+/)
-		{
-		($zmin_f,$zmax_f) = $line =~
-			/\S+\s+zmin:\s+(\S+)\s+zmax:\s+(\S+)\s+name:\s+\S+/;
-		}
-	if ($line =~ /\S+\s+z_min:\s+\S+\s+z_max:\s+\S+\s+units:/)
-		{
-		($zmin_f,$zmax_f,$zunits_s) = $line =~
-			/\S+\s+z_min:\s+(\S+)\s+z_max:\s+(\S+)\s+units:\s+(.+)/;
-		}
-	elsif ($line =~ /\S+\s+z_min:\s+\S+\s+z_max:\s+\S+\s+name:/)
-		{
-		($zmin_f,$zmax_f,$zunits_s) = $line =~
-			/\S+\s+z_min:\s+(\S+)\s+z_max:\s+(\S+)\s+name:\s+(.+)/;
-		}
-	elsif ($line =~ /\S+\s+Normal node registration used/)
-		{
-		$node_normal = 1;
-		}
-	}
-
-# reset the GMT default double format
-`gmtset D_FORMAT $dformatsave`;
-
-# deal with translating grid bounds
-if ($node_normal)
-	{
-	$xmin_a = $xmin_f - 0.5 * $xinc_f;
-	$xmax_a = $xmax_f + 0.5 * $xinc_f;
-	$ymin_a = $ymin_f - 0.5 * $yinc_f;
-	$ymax_a = $ymax_f + 0.5 * $yinc_f;
-	}
-else
-	{
-	$xmin_a = $xmin_f;
-	$xmax_a = $xmax_f;
-	$ymin_a = $ymin_f;
-	$ymax_a = $ymax_f;
-	}
-
-# tell the world we got started
-if ($verbose)
-	{
-	print "\nProgram $program_name status:\n";
-	print "\tInput GRD file:            $ifile\n";
-	print "\tOutput ArcView ASCII file: $ofile\n";
-	print "\tGrid dimensions:    $xnx_d  $yny_d\n";
-	print "\tGrid cell sizes:    $xinc_f  $yinc_f\n";
-	print "\tGrid bounds (GMT):  $xmin_f  $xmax_f    $ymin_f  $ymax_f\n";
-	print "\tGrid bounds (Arc):  $xmin_a  $xmax_a    $ymin_a  $ymax_a\n";
-	}
-
-# Check for equal dx and dy
-if ($xinc_f != $yinc_f)
-	{
-	print "\a";
-	die "Grid x and y cell sizes differ: $x_inc $y_inc\nMacro $program_name aborted\n";
-	}
-
-# output header of Arcview ascii file
-printf OUT "ncols $xnx_d\n";
-printf OUT "nrows $yny_d\n";
-printf OUT "xllcorner $xmin_a\n";
-printf OUT "yllcorner $ymin_a\n";
-printf OUT "cellsize $xinc_f\n";
-printf OUT "nodata_value $nodata\n";
-
-# Get data using grd2xyz
-if ($verbose > 0)
-	{
-	print "\nGenerating temporary file...\n";
-	}
-$tmpfile = $program_name . "_tmp_" . "$$";
- at grd2xyz = `grd2xyz $ifile -ZTLa > $tmpfile`;
-if (!open(TMP,"<$tmpfile"))
-	{
-	print "\a";
-	die "Cannot open temporary file $tmpfilefile\nMacro $program_name aborted.\n";
-	}
-$cnt = 0;
-$cnttot = 0;
-$target = 0.1;
-if ($verbose > 0)
-	{
-	print "Parsing temporary file...\n";
-	}
-while (<TMP>)
-	{
-	$line = $_;
-	if ($line =~ /NaN/)
-		{
-		$cnt = $cnt + 1;
-		$cnttot = $cnttot + 1;
-		if ($cnt == $xnx_d)
-			{
-			print OUT "$nodata\n";
-			$cnt = 0;
-			}
-		else
-			{
-			print OUT "$nodata ";
-			}
-		}
-	elsif ($line =~ /(\S+)/)
-		{
-		$cnt = $cnt + 1;
-		$cnttot = $cnttot + 1;
-		($value) = $line =~ /(\S+)/;
-		if ($cnt == $xnx_d)
-			{
-			print OUT "$value\n";
-			$cnt = 0;
-			}
-		else
-			{
-			print OUT "$value ";
-			}
-		}
-	if ($verbose > 0 && $cnttot / $xnx_d / $yny_d > $target)
-		{
-		$value = 100.0 * $target;
-		print "$value% complete\n";
-		$target = $target + 0.1;
-		}
-	}
-close OUT;
-`rm -f $tmpfile`;
-
-exit 0;
-
-#-----------------------------------------------------------------------
-# This should be loaded from the library but its safer to
-# just include it....
-#
-;# getopts.pl - a better getopt.pl
-
-;# Usage:
-;#      do Getopts('a:bc');  # -a takes arg. -b & -c not. Sets opt_* as a
-;#                           #  side effect.
-
-sub Getopts {
-    local($argumentative) = @_;
-    local(@args,$_,$first,$rest);
-    local($errs) = 0;
-
-    @args = split( / */, $argumentative );
-    while(@ARGV && ($_ = $ARGV[0]) =~ /^-(.)(.*)/) {
-     ($first,$rest) = ($1,$2);
-     $pos = index($argumentative,$first);
-     if($pos >= $[) {
-         if($args[$pos+1] eq ':') {
-          shift(@ARGV);
-          if($rest eq '') {
-              ++$errs unless @ARGV;
-              $rest = shift(@ARGV);
-          }
-          eval "\$opt_$first = \$rest;";
-         }
-         else {
-          eval "\$opt_$first = 1";
-          if($rest eq '') {
-              shift(@ARGV);
-          }
-          else {
-              $ARGV[0] = "-$rest";
-          }
-         }
-     }
-     else {
-         print STDERR "Unknown option: $first\n";
-         ++$errs;
-         if($rest ne '') {
-          $ARGV[0] = "-$rest";
-         }
-         else {
-          shift(@ARGV);
-         }
-     }
-    }
-    $errs == 0;
-}
diff --git a/src/macros/mbm_grd2geovrml b/src/macros/mbm_grd2geovrml
deleted file mode 100755
index 6469647..0000000
--- a/src/macros/mbm_grd2geovrml
+++ /dev/null
@@ -1,693 +0,0 @@
-#!/usr/bin/env perl
-#--------------------------------------------------------------------
-#    The MB-system:     mbm_grd2geovrml.perl              11/7/2001
-$ver = '$Id: mbm_grd2geovrml 2227 2015-02-05 21:12:31Z caress $';
-#
-#    Copyright (c) 2003-2015 by
-#    Mike McCann (mccann at mbari.org)
-#      Monterey Bay Aquarium Research Institute
-#      Moss Landing, CA
-#
-#    See README file for copying and redistribution conditions.
-#--------------------------------------------------------------------
-#
-# Command:
-#   mbm_grd2geovrml
-#
-# Purpose:
-#
-# Script to convert GMT grid to TerraVision and geoVRML tiles
-#
-# Stuff this script does:
-# - pad out the no data areas (by regridding a sample of original grid)
-# - create tiff with black background from original data (unless exists)
-# - store as TerraVision data sets (.dem & .oi)
-# - convert and store as geoVRML tiles
-#
-# Requires:
-# - GMT version 3.1 or higher
-# - TsmApi version 2.2 or higher.  http://www.tsmapi.com
-# - ImageMagick 3.7.7 or higher. http://www.imagemagick.org/
-#
-# Basic Usage:
-#  mbm_grd2geovrml <base_name> --tvdir <dir> --vrmldir <dir>
-#                  -olat <latitude> -olon <longitude>
-#
-#   Where <base_name> is the bathymetry grid filename without the .grd.gz
-#    or .grd extensions.
-#
-#   E.G.:
-#
-#   mbm_grd2geovrml /hosts/menard/vol2/EM300_GRIDS/hawaii/PapauA_bath \
-#   --tvdir ~/TileSets/Pyramids/hawaii \
-#   --vrmldir ~/TileSets/geoVRML/hawaii \
-#   --olat 21 --olon -157
-#
-# Additional Options:
-#  [ --nowrz --pallette <pal> --newimage [<type>] --white
-#    --zmax <maxclip> --zmin <minclip>
-#    --elevscale <vert_exag> --noview --vrmlurl <base_addr> ]
-#
-# Author:
-#   Mike McCann
-#   Monterey Bay Aquarium Research Institute
-#   Moss Landing, CA
-#   November 7, 2001
-#
-# Version:
-#   $Id: mbm_grd2geovrml 2227 2015-02-05 21:12:31Z caress $
-#
-# Revisions:
-#
-# $Log: mbm_grd2geovrml.perl,v $
-# Revision 5.1  2003/03/19 22:29:29  caress
-# New version from Mike McCann.
-#
-# Revision 1.12  2003/03/18 20:31:57  mccann
-# Added -newimage <type> and -basename options.  Can now drape other images
-# over the bathymetry.
-#
-# Revision 1.11  2002/08/08 21:09:36  mccann
-# Change to using the make_geovrml in the search path, not mccann's.
-#
-# Revision 1.10  2002/08/08 21:05:37  mccann
-# Changed name from mbm_grd2geovrml to mbm_grd2geovrml.perl
-# Use mbstripNaN instead of removeNaN; mbstripNaN is now a part of MB-System.
-#
-# Revision 1.9  2002/04/04 18:36:50  mccann
-# Added '-interlace none' to mogrify because make_oi wants chunky (RGBRGB...)
-#
-# Revision 1.8  2002/01/10 20:07:29  mccann
-# Fixed bugs in grid clipping command setup.
-#
-# Revision 1.7  2002/01/09 21:14:18  mccann
-# Removed customizations for MBARI data coverages (hawaii, cencal, etc.)
-#
-# Revision 1.6  2002/01/03 19:33:59  mccann
-# *** empty log message ***
-#
-# Revision 1.5  2001/12/05 18:15:42  mccann
-# Added comment for ImageMagick requirement.  Version sent to Dave for
-# testing and initial inclusion in MB-System.
-#
-# Revision 1.4  2001/11/28 23:22:14  mccann
-# Added options for color pallette and grid clipping.
-#
-# Revision 1.3  2001/11/14 17:42:40  mccann
-# Full command line written to out file.  -wrz option added to make_geovrml.
-#
-# Revision 1.2  2001/11/07 20:01:16  mccann
-# Added check in execute() for existence of commands in search path.
-#
-# Revision 1.1  2001/11/07 19:34:10  mccann
-# Initial revision
-#
-#
-
-
-use File::Basename;
-use Getopt::Long;
-
-
-#
-# Constants. These may need to be changed to suit your needs
-#
-$| = 1; 			# unbuffered stdout
-$tmpDir = $ENV{'TMPDIR'} || die "\nPlease set your TMPDIR environment variable.\n";
-$scale = 1000;		# To Multiple for bitmap
-$offset = 10000;	# To add for bitmap
-$grdResampFac = 10;	# Subsampling factor
-$radFrac = 1.0;		# Fraction of longest grid dimension for resampling
-$make_geovrml = "make_geovrml";
-##$make_geovrml = "/u/mccann/Pkgs/tsmApi/tsmApi-2.2a/irix6.5n32/tsmUtils/make_geovrml";
-
-#
-# Usage note
-#
-sub usage {
-	print <<EOF;
-
-    Usage: $0 <grd_file> --tvdir <tvdir> --vrmldir <vrmldir>
-           --olat <lat> --olon <lon> --vrmlurl <base_addr>
-           [ --nowrz --pallette <pal> --newimage [<type>] --basename <string>
-             --white --zmax <maxclip> --zmin <minclip>
-             --elevscale <vert_exag> --noview ]
-
-    Where: <grd_file>:  the full name of the GMT grd file to be converted
-           <tvdir>:     the location of TerraVision tile set to be created
-           <vrmldir>:   the location of geoVRML tile set to be created
-           <lat>:       latitude of geoOrigin in decimal degrees
-           <lon>:       longitude of geoOrigin in decimal degrees
-           <base_addr>: explicit base web address for childurls & images
-           (A directory that is the base name of the grd file will be created
-            in <tvdir> and <vrmldir>.  <tvdir> and <vrmldir> will be created
-            if they do not exist.  Specifiy --basename to override this and
-            give it your own name, useful with the --newimage <type> option.)
-
-    Optional mbm_grd2geovrml parameters:
-      --nowrz:      Write geoVRML .wrl files instead of gzipped .wrz
-      --pallette:   Number of Color Lookup Table (1:Haxby,2:High,3:Low,4:Gray)
-           <pal>:
-      --newimage    Force creation of new image, otherwise uses one in $TMPDIR.
-          <type>:   <type> may be a number 1..5 to pass on to the mbm_grdtiff
-                    -G option.  The default is 2: synthetic illumination, use
-                    5 for slope shaded.  If <type> is an image file name then
-                    that image is assumed to be orthorectified and coincident
-                    with the DEM.  This can be used to drape a side-scan image
-                    over the terrain model.
-      --basename    Append <string> to <grd_file> for the directories that
-      <string>:     will be created in <tvdir> and <vrmldir>.  Should use
-                    if a <type> option is given to --newimage, e.g. _ss.
-      --white:      Create image with white background instead of black
-      --zmax        Clip grid at this maximum elevation - adjusts the
-      <maxclip>:    color lookup table.
-      --zmin        Clip grid at this minumum elevation - adjusts the
-      <minclip>:    color lookup table.
-
-    Optional make_geovrml(1) parameters:
-      --elevscale   Vertical exaggeration for geoVRML (default is 1)
-      <vert_exag>:
-      --noview:     Do not include viewpoints for each tile in geoVRML
-
-  Examples:
-
-   default synthetic illumination:
-
-    $0 /hosts/menard/vol2/EM300_GRIDS/hawaii/PapauA_bath \\
-      --olat 21 --olon -157 \\
-      --tvdir ~/TileSets/Pyramids/hawaii \\
-      --vrmldir ~/TileSets/geoVRML/hawaii \\
-      --vrmlurl http://menard.mbari.org/vrml/terrain/hawaii/PapauA_bath
-
-   drape the side-scan tif file over the elevation data:
-
-    $0 /hosts/menard/vol2/EM300_GRIDS/hawaii/PapauA_bath \\
-      --olat 21 --olon -157 \\
-      --tvdir ~/TileSets/Pyramids/hawaii \\
-      --vrmldir ~/TileSets/geoVRML/hawaii \\
-      --vrmlurl http://menard.mbari.org/vrml/terrain/hawaii/PapauA_ssdtl \\
-      --newimage /hosts/menard/vol2/EM300_GRIDS/hawaii/PapauA_ssdtl.tif \\
-      --basename PapauA_ssdtl
-
-   slope-shaded:
-
-    $0 /hosts/menard/vol2/EM300_GRIDS/hawaii/PapauA_bath \\
-      --olat 21 --olon -157 \\
-      --tvdir ~/TileSets/Pyramids/hawaii \\
-      --vrmldir ~/TileSets/geoVRML/hawaii \\
-      --vrmlurl http://menard.mbari.org/vrml/terrain/hawaii/PapauA_slope \\
-      --newimage 5 \\
-      --basename PapauA_slope
-
-EOF
-	exit(1);
-}
-
-# -----------------------------------------------------------------------
-
-#
-# Get options and test for input/output directories
-#
-my $allArgs = join(" ", @ARGV);		# GetOptions slurps up, so save in advance
-
-#
-# Default options
-#
-$elevscale = 1;
-$nowrzFlag = 0;
-$noviewFlag = 0;
-$newimageFlag = 0;
-$whiteFlag = 0;
-$pallette = 1;		# See mbm_grdtiff 1:Haxby, 2:High, 3: Low, 4:gray, ...
-$vrmlurl = '';
-if ( ! GetOptions ( 'tvdir=s' => \$tvdir, 'vrmldir=s' => \$vrmldir,
-					'olat=f' => \$olat, 'olon=f' => \$olon,
-                    'elevscale=f' => \$elevscale, 'nowrz' => \$nowrzFlag,
-                    'noview' => \$noviewFlag, 'pallette=i' => \$pallette,
-					'newimage=s' => \$newimage, 'white' => \$whiteFlag,
-					'zmax=f' => \$clipmax, 'zmin=f' => \$clipmin,
-					'vrmlurl=s' => \$vrmlurl,'basename=s' => \$basename ) ) {
-	print "\nFailed to read options.\n\n";
-	usage;
-}
-if ( ! $tvdir ) {
-	print "\n*** Must specify <tvdir>.\n\n";
-	usage;
-}
-if ( ! -d $tvdir ) {
-	print "\nCreating $tvdir \n\n";
-	mkdir ($tvdir,0755) || die "Cannot mkdir $tvdir: $!\n";
-}
-if ( ! $vrmldir ) {
-	print "\n*** Must specify <vrmldir>.\n\n";
-	usage;
-}
-if ( ! -d $vrmldir ) {
-	print "\nCreating $vrmldir \n\n";
-	mkdir ($vrmldir,0755) || die "Cannot mkdir $vrmldir: $!\n";
-}
-if ( ! $olat ) {
-	print "\n*** Must specify <olat> for geoOrigin.\n\n";
-	usage;
-}
-if ( ! $olon ) {
-	print "\n*** Must specify <olon> for geoOrigin.\n\n";
-	usage;
-}
-
-#
-# Set color mbm_grdtiff color_mode or image file name if --newimage specified
-#
-if ( $newimage eq '' ) {
-	$color_mode = 2;
-	$newimageFlag = 1;
-}
-elsif ( $newimage =~ /[1-2,4-5]/ ) {
-	$color_mode = $newimage;
-	$newimageFlag = 1;
-}
-elsif ( $newimage =~ /\.tif/ && -f $newimage ) {
-	$newimageFlag = 1;
-}
-else {
-	print "\n*** Option '$newimage' not valid for --newimage.\n\n";
-    usage;
-}
-
-
-#
-# Check that $zmin < $zmax ( I wasted 40 minutes with this user mistake!)
-#
-if ( $clipmin > $clipmax ) {
-	print "\n*** minclip must be less than maxclip.  Below sea level is < 0.\n\n";
-	die;
-}
-
-#
-# Set up file names
-#
-($baseFile, $origPath, undef) = fileparse($ARGV[0]);
-$baseFile =~ s/\.grd//;				# Remove '.grd' if supplied
-$baseFile =~ s/\.grd.gz//;			# Remove '.grd.gz' if supplied
-$origPath =~ s#\/$##;				# Remove trailing slash
-
-if ( $origPath eq "." ) {	# If short name then set to current dir
-	$origPath = `pwd`;
-	chop($origPath);
-}
-
-$gzGrdFile = "$baseFile.grd.gz";
-$grdFile = $gzGrdFile;
-$grdFile =~ s/\.gz$//;
-
-#
-# Now that we got grd file name, replace $baseFile with $basename if specified
-#
-$baseFile = $basename if $basename;
-
-#
-# Temporary grid files (get removed upon successful completion)
-#
-$sampGrdFile = "Samp_$grdFile";
-$tmpGrdFile = "Tmp_$grdFile";
-$fillGrdFile = "Fill_$grdFile";
-$fixGrdFile = "Fix_$grdFile";
- at tmpFiles = ($grdFile, $sampGrdFile,
-			 $tmpGrdFile, $fillGrdFile,
-			 $fixGrdFile, "${baseFile}_tiff.cmd");
-
-#
-# Deal with grd file (either gzipped or not), make it local to $tmpDir
-#
-if ( ! -f "$origPath/$gzGrdFile" ) {
-	print "\nFile $origPath/$gzGrdFile not found.\n\n";
-	if ( ! -f "$origPath/$grdFile" ) {
-		print "\nFile $origPath/$grdFile not found.\n\n";
-    	usage;
-	}
-}
-
-#
-# Go to temp work area and start the work...
-#
-chdir($tmpDir) || die "Can't chdir to $tmpDir: $!\n";
-print "Working in " . `pwd`;
-unlink "$baseFile.out" || die "Can't remove $baseFile.out\n";
-
-#
-# Start output file, give a litle info
-#
-open(OUT, ">>$baseFile.out");
-print OUT "\n#----------------------------------------------------------\n";
-print OUT "# Starting $0 on " . scalar localtime() . "\n";
-print OUT "# $ver\n";
-print OUT "# \n";
-print OUT "# Command line that generated this file and its results:\n";
-print OUT "#   $0 $allArgs \n";
-print OUT "# \n";
-print OUT "# \n";
-close OUT;
-
-
-#
-# Unzip grid file to local file, check that file may be unzipped already
-#
-if ( -f "$origPath/$gzGrdFile" ) {
-	$cmd = "gunzip -c $origPath/$gzGrdFile > $grdFile";
-	execute($cmd, "Unzip grid file to local file");
-}
-elsif ( -f "$origPath/$grdFile" ) {
-	$cmd = "cp $origPath/$grdFile $grdFile";
-	execute($cmd, "Copy file to local area");
-}
-else {
-	die "Can't find $origPath/$gzGrdFile or $origPath/$grdFile\n";
-}
-
-#
-# Clip the grid if specified on command line
-#
-if ( defined $clipmax || defined $clipmin ) {
-	$cmd = "mv $grdFile tmp_${grdFile}";
-	execute($cmd, "Clipping grid file, rename original in prep for grdclip");
-}
-if ( defined $clipmax && ! defined $clipmin ) {
-	$cmd = "grdclip tmp_${grdFile} -G$grdFile -Sa$clipmax/NaN";
-}
-elsif ( defined $clipmin && ! defined $clipmax ) {
-	$cmd = "grdclip tmp_${grdFile} -G$grdFile -Sb$clipmin/NaN";
-}
-elsif ( defined $clipmax && defined $clipmin ) {
-	$cmd = "grdclip tmp_${grdFile} -G$grdFile -Sa$clipmax/NaN -Sb$clipmin/NaN";
-}
-if ( defined $clipmax || defined $clipmin ) {
-	execute($cmd, "Clip grid at min = $clipmin, max = $clipmax");
-}
-
-#
-# Parse out grid information for use by make_dem & make_oi
-#
-execute("/bin/ls -l $grdFile", "Size of original grid file");
-$grdInfo = `grdinfo $grdFile`;
-foreach ( split('\n', $grdInfo) ) {
-	if ( /x_min: (\S+)/ ) {
-		$x_min = $1;
-	}
-	if ( /x_max: (\S+)/ ) {
-		$x_max = $1;
-	}
-	if ( /x_inc: (\S+)/ ) {
-		$x_inc = $1;
-	}
-	if ( /y_min: (\S+)/ ) {
-		$y_min = $1;
-	}
-	if ( /y_max: (\S+)/ ) {
-		$y_max = $1;
-	}
-	if ( /y_inc: (\S+)/ ) {
-		$y_inc = $1;
-	}
-	if ( /nx: (\S+)/ ) {
-		$nx = $1;
-	}
-	if ( /ny: (\S+)/ ) {
-		$ny = $1;
-	}
-}
-print "x_min= $x_min, x_max= $x_max, x_inc= $x_inc\n";
-print "y_min= $y_min, y_max= $y_max, y_inc= $y_inc\n";
-print "nx= $nx, ny= $ny\n";
-die "*** Can't continue without grid dimensions." unless
-	($x_min && $x_max && $x_inc && $y_min && $y_max && $y_inc && $nx && $ny);
-execute("grdinfo $grdFile", "Get grid dimensions & resolution");	# For the log output file
-
-#
-# Compute dimensions of grid for the course resampling
-#
-$dimen = ( $nx > $ny ) ? $nx : $ny; 		# Use larger dimension
-$rad = $x_inc * $dimen * $radFrac; 				# Some fraction of grid dimension
-#
-# To avoid GMT ERROR: x_inc incompatible with (x_max-x_min), see grdedit -A.
-# See http://op.gfz-potsdam.de/GMT-Help/Archive/msg03955.html
-# Calculate my own $myXinc & $myYinc
-#
-$myXinc = ($x_max - $x_min) / ($nx - 1);
-$myYinc = ($y_max - $y_min) / ($ny - 1);
-$surfXinc = ($x_max - $x_min) / (100 - 1);
-$surfYinc = ($y_max - $y_min) / (100 - 1);
-
-#
-# Subsample grid
-#
-$xSampInc = $grdResampFac * $myXinc;
-$cmd = "grdsample $grdFile -I${xSampInc} -Q -G${sampGrdFile}";
-execute($cmd, "Subsample grid");
-
-#
-# 1. Convert grid to xyz format for filling in blank areas
-# 2. preprocess w/blockmean
-# 3. use surface to extrapolate to no data areas
-#
-$cmd = "grd2xyz -bo $sampGrdFile | ";
-$cmd .= "blockmean -bi -bo -V -I${surfXinc}/${surfYinc} -R$x_min/$x_max/$y_min/$y_max | ";
-$cmd .= "mbstripNaN | ";
-$cmd .= "surface -bi -I${surfXinc}/${surfYinc} -S${rad} -T0.35 -G${tmpGrdFile} ";
-$cmd .= "-V -R$x_min/$x_max/$y_min/$y_max ";
-execute($cmd, "Convert grid to xyz format for filling in blank areas, preprocess w/blockmean, use surface to extrapolate to no data areas");
-
-
-#
-# Resample to original grid dimenensions
-#
-$cmd = "grdsample $tmpGrdFile -I${myXinc}/${myYinc} -Q -G${fillGrdFile}";
-execute($cmd, "Resample to original grid dimenensions");
-
-
-#
-# Give proper units to Filled Grid file
-#
-$cmd = "grdedit ${fillGrdFile} -DLongitude/Latitude/\"Topography (m)\"";
-$cmd .= "/1/0/\"Topography Grid\"";
-execute($cmd, "Give proper units to Filled Grid file");
-
-#
-# Repair the dx/dy for the original grid
-#
-$cmd = "grdedit -A -R$x_min/$x_max/$y_min/$y_max ${grdFile} ";
-execute($cmd, "Repair the dx/dy for the original grid");
-
-#
-#  1. Paste (ADD) original grid on top of this large-search-radius grid
-#
-#  2. Scale and offset the grid in preparation for make_geoVRML (preserves
-#     accuracy to 1 mm in Z, also make_geovrml can't handle elevations < 0)
-#
-$cmd = "grdmath $grdFile $fillGrdFile AND $offset ADD $scale MUL = $fixGrdFile";
-execute($cmd, "Paste (ADD) original grid on top of this large-search-radius grid, Scale and offset the grid in preparation for make_geoVRML");
-
-
-#
-# Extract bitmap from fixed grid for use by tsmApi,
-#
-$cmd = "grd2xyz -Zl $fixGrdFile > $baseFile.raw && ls -l $baseFile.raw";
-execute($cmd, "Extract bitmap from fixed grid for use by tsmApi");
-
-
-#
-# Image generation takes a real long time, if .tif exists skip, unless flag
-#
-if ( -s "$baseFile.tif" && ! $newimageFlag ) {
-	print "Found\n" . `/bin/ls -l "$baseFile.tif"` . "\n";
-	print "Skipping image generation\n";
-	goto TerraVision;
-}
-if ( $newimageFlag && -f $newimage ) {
-	print "Image $newimage provided.\n";
-	print "Copying to $baseFile.tif\n";
-    execute("cp $newimage $baseFile.tif", "Copying provided image");
-    print "Skipping image generation\n";
-    goto mogrify;
-}
-
-
-image:
-#========================= Image generation ========================
-#
-# Create command file for creating shaded tiff from original grid file
-# - edit in place the .cmd file to set black NAN
-# - execute the script
-#
-$DOption = '';
-if ( $color_mode == 1 ) { $imgType = "Color/gray fill"; }
-elsif ( $color_mode == 2 ) { $imgType = "synthetic illumination shaded"; }
-elsif ( $color_mode == 4 ) { $imgType = "fill of slope magnitude"; }
-elsif ( $color_mode == 5 ) {
-	$imgType = "shaded by slope magnitude";
-	$DOption = "-D0/1";		# Flips shaping
-}
-$cmd = "mbm_grdtiff -I $grdFile -O$baseFile -W1/${pallette} -G${color_mode} -A0.25/280/15 ${DOption} -Q -V";
-execute($cmd, "Create script to create black NANed $imgType tiff from original grid file");
-
-if ( ! $whiteFlag ) {
-	# Create black NANed shaded tiff from original grid file
-	#
-	# Used sed(1) to edit .cmd file
-	#
-	@ARGV = ("${baseFile}_tiff.cmd");
-	$cmd = "mv ${baseFile}_tiff.cmd ${baseFile}_tiff.cmd.bak";
-	execute($cmd, "Rename command file ");
-
-	$cmd = "sed 's#gmtset COLOR_NAN 255/255/255#gmtset COLOR_NAN 0/0/0#' ${baseFile}_tiff.cmd.bak > ${baseFile}_tiff.cmd && chmod +x ${baseFile}_tiff.cmd && /bin/rm ${baseFile}_tiff.cmd.bak";
-	execute($cmd, "Set COLOR_NAN to 0/0/0 in .cmd file for black background");
-}
-
-#
-# Run the commands to create the tiff image
-#
-execute("csh ./${baseFile}_tiff.cmd && ls -l $baseFile.tif", "Run the script to create the .tiff");
-unlink "${baseFile}.grd.int";
-
-mogrify:
-#
-# Increase image size to get more geometry, needs lots of swap & time for this!
-#
-if ( $newimageFlag && -f $newimage ) {
-
-	#
-	# Get dimensions of newimage to be draped
-	#
-	$identImage = `identify "$baseFile.tif"`;
-	# File.tif TIFF 2188x2918 PseudoClass 256c 8-bit 6235kb 3.3u 0:17
-	foreach ( split('\n', $identImage) ) {
-		if ( /(\d+)x(\d+)/ ) {
-			$x_dim = $1;
-			$y_dim = $2;
-			last;
-		}
-	}
-	print "Image $baseFile.tif: x_dim = $x_dim, y_dim = $y_dim\n";
-
-	#
-	# Many EM300 coverages have side scanned data moasiced to twice the bath res
-	# mogrify is faster with a 200% -geometry than with a large forced res
-	#
-	if ( abs(2 * $nx - $x_dim) < 5 || abs(2 * $ny - $y_dim) < 5 ) {
-		execute("identify $baseFile.tif", "Original image size is about twice bathy grid size in at least one dimension.");
-		$geomStr = ${nx} * 2 . "x" . $ny * 2 . "!";
-		execute("mogrify -interlace none -geometry $geomStr $baseFile.tif && identify $baseFile.tif", "Make _ss.tif exactly twice size of _bath.tif");
-		execute("mogrify -interlace none -geometry 200% $baseFile.tif && identify $baseFile.tif", "Double image size (for most _ss.tif files?)");
-	}
-	elsif ( $x_dim != $nx || $y_dim != $ny ) {
-		execute("identify $baseFile.tif", "Original image size is not the same size as the bathy grid.");
-        $geomStr = ${nx}  . "x" . $ny  . "!";
-        execute("mogrify -interlace none -geometry $geomStr $baseFile.tif && identify $baseFile.tif", "Make $baseFile.tif exactly the size of _bath.tif");
-        execute("mogrify -interlace none -geometry 400% $baseFile.tif && identify $baseFile.tif", "Quadruple image size");
-	}
-	else {
-		execute("identify $baseFile.tif", "Original image size is the same size as the bathy grid.");
-		execute("mogrify -interlace none -geometry 400% $baseFile.tif && identify $baseFile.tif", "Quadruple image size");
-	}
-}
-else {
-	execute("mogrify -interlace none -geometry 400% $baseFile.tif && identify $baseFile.tif", "Quadruple image size");
-}
-
-TerraVision:
-#=================== TerraVision Pyramid generation ====================
-#
-# Make TerraVision DEM tile set
-#
-$cmd = "make_dem $tvdir/$baseFile $baseFile.raw ";
-$cmd .= "-startres $x_inc -geoname $baseFile ";
-$cmd .= "-width $nx -height $ny -ll_lat $y_min -ll_long $x_min ";
-$cmd .= "-offset -$offset -scale " . 1/$scale;
-execute("$cmd && /bin/rm -f $baseFile.raw", "Make TerraVision DEM tile set");
-
-#
-# Make TerraVision OI tile set from file in local directory
-#
-$cmd = "make_oi $tvdir/$baseFile $baseFile.tif ";
-$cmd .= "-startres " . $x_inc / 4 . " -geoname $baseFile ";
-$cmd .= "-width " . $nx * 4 . " -height " . $ny * 4 . " -ll_lat $y_min -ll_long $x_min ";
-execute("$cmd", "Make TerraVision OI tile set");
-
-geoVRML:
-#======================= geoVRML generation ========================
-#
-# Create geoVRML parent dir for this coverage and make geoVRML tiles
-#
-$cmd = "$make_geovrml \\\n";
-$cmd .= "-dem $tvdir/$baseFile.dem \\\n";
-$cmd .= "-oi $tvdir/$baseFile.oi \\\n";
-$cmd .= "-vrmldir $vrmldir/$baseFile \\\n";
-$cmd .= "-olat $olat -olon $olon \\\n";
-$cmd .= "-vrmlurl $vrmlurl \\\n";
-$cmd .= "-touch 2,4,6 -hud -maxrange -onesided -numpolys 16 ";
-$cmd .= "-elevscale $elevscale ";
-$cmd .= "-wrz " unless $nowrzFlag;
-$cmd .= "-whitebg " if  $whiteFlag;
-$cmd .= "-noview " if $noviewFlag;	# Don't have viewpoints if using a basemap
-execute($cmd, "Create geoVRML parent dir for this coverage and make geoVRML tiles");
-execute("/bin/ls -l $vrmldir/$baseFile/trees", "All finished");
-
-#
-# Remove temp files
-#
-foreach ( @tmpFiles ) {
-	print "removing $_\n";
-	unlink $_;
-}
-
-#
-# Save commands that created the geoVRML
-#
-execute("cp $baseFile.out $vrmldir/$baseFile", "Save commands that created all this");
-
-#
-# Parse geoVRML trees and collect data for database load
-#
-##parse_geoVRML();
-##load_database();
-
-
-exit(0);
-
-# ----------------------------------------------------------------
-
-sub execute {
-	local ($cmd, $comment) = @_;
-
-	#
-	# Check that command is found in users search path
-	#
-	my @item = split('\s+', $cmd);
-	my $which = `which $item[0]`;
-	chop $which;
-	die "\nCan't find $item[0] in your search path:\n$which" unless -f $which;
-
-	#
-	# Write comments & commands to output file
-	#
-	open(OUT, ">>$baseFile.out");
-	print OUT "\n#----------------------------------------------------------\n";
-	print OUT "# $comment\n";
-	print OUT "# ", scalar localtime, ":\n";
-	print OUT "$cmd\n\n";			# Record command to out file
-
-	print "\n#---------------------------------------------------------------\n";
-	print "# $comment\n";
-	print "$cmd\n\n";
-
-	##my $ret = system($cmd);
-	# Capture output & put comments in front
-	open (CMD, "$cmd 2>&1 |") or die "Can't run $cmd : $!\n";
-	while (<CMD>) {
-		print "# ", $_;
-		print OUT "# ", $_;
-	}
-	close OUT;
-
-	##$ret = $ret / 256 / 255;
-	##die "\nReturn value > 0. See above for any error message.\n" unless $ret <= 0;
-}
diff --git a/src/macros/mbm_grd3dplot b/src/macros/mbm_grd3dplot
deleted file mode 100755
index daa4198..0000000
--- a/src/macros/mbm_grd3dplot
+++ /dev/null
@@ -1,3171 +0,0 @@
-#!/usr/bin/env perl
-#--------------------------------------------------------------------
-#    The MB-system:	mbm_grd3dplot.perl	8/6/95
-#    $Id: mbm_grd3dplot 2234 2015-03-05 07:41:54Z caress $
-#
-#    Copyright (c) 1993-2015 by
-#    D. W. Caress (caress at mbari.org)
-#      Monterey Bay Aquarium Research Institute
-#      Moss Landing, CA
-#    and D. N. Chayes (dale at lamont.ldgo.columbia.edu)
-#      Lamont-Doherty Earth Observatory
-#      Palisades, NY  10964
-#
-#    See README file for copying and redistribution conditions.
-#--------------------------------------------------------------------
-#
-# Command:
-#   mbm_grd3dplot
-#
-# Purpose:
-#   Macro to generate a shellscript of GMT commands which, when
-#   executed, will generate a 3D perspective Postscript plot of
-#   gridded data.  Several styles of plots can be generated,
-#   including color fill views, color shaded relief views, mesh
-#   plot views, and text labels. Five different color schemes are
-#   included. The plot will be scaled to fit on the specified page
-#   size or, if the scale is user defined, the page size will be
-#   chosen in accordance with the plot size. The primary purpose
-#   of this macro is to allow the simple, semi-automated
-#   production of nice looking plots with a few command line
-#   arguments. For users seeking more control over the plot
-#   appearance, a number of additional optional arguments are
-#   provided. Truly ambitious users may edit the plot shellscript
-#   to take advantage of GMT capabilites not supported by this
-#   macro.
-#
-# Basic Usage:
-#   mbm_grd3dplot -Ifile [-A[magnitude/azimuth/elevation]
-#            -C[contour_control] -Dflipcolor/flipshade
-#            -Eview_az/view_el
-#            -Gcolor_mode -H -Kintensity_file
-#            -Ndrape_file -Oroot -Ppagesize
-#            -S[color/shade] -Uorientation -V
-#            -Wcolor_style[/pallette] ]
-#
-# Additional Options:
-#            [-Btickinfo
-#            -Jprojection[/scale | width] -Ltitle[:scale_label]
-#            -Mmisc -Q -Rw/e/s/n -X -Y -Zmin/max]
-#
-# Miscellaneous Options:
-#            [-MGDgmtdef/value -FMGscale_loc
-#            -MGL[f][x]lon0/lat0/slat/length[units][+llabel]
-#            -MGQdpi -MGSscalefactor -MGTx/y/size/angle/font/just/text
-#            -MGU[/dx/dy/][label] -MVMmesh_pen -MVNnull -MVZzlevel ]
-#
-# Author:
-#   David W. Caress
-#   Lamont-Doherty Earth Observatory
-#   Palisades, NY  10964
-#   August 8, 1994
-#
-# Version:
-#   $Id: mbm_grd3dplot 2234 2015-03-05 07:41:54Z caress $
-#
-#
-$program_name = "mbm_grd3dplot";
-
-# set degree to radians conversion
-$DTR = 3.1415926 / 180.0;
-
-# set page size database
- at page_size_names = (
-	"a", "b", "c", "d", "e", "f", "e1",
-	"a0", "a1", "a2", "a3", "a4", "a5", "a6", "a7", "a8", "a9", "a10",
-	"b0", "b1", "b2", "b3", "b4", "b5", "b6", "b7", "b8", "b9", "b10",
-	"c0", "c1", "c2", "c3", "c4", "c5", "c6", "c7",
-	"m1", "m2", "m3", "m4", "m5", "m6");
-%page_width_in = (
-	"a",     8.50,   "b",    11.00,   "c",    17.00,   "d",    22.00,
-	"e",    34.00,   "f",    28.00,   "e1",   44.00,   "a0",   33.11,
-	"a1",   23.39,   "a2",   16.54,   "a3",   11.69,   "a4",    8.27,
-	"a5",    5.83,   "a6",    4.13,   "a7",    2.91,   "a8",    2.05,
-	"a9",    1.46,   "a10",   1.02,   "b0",   39.37,   "b1",   27.83,
-	"b2",   19.68,   "b3",   13.90,   "b4",    9.84,   "b5",    6.93,
-	"b6",    4.92,   "b7",    3.46,   "b8",    2.44,   "b9",    1.73,
-	"b10",   1.22,   "c0",   36.00,   "c1",   25.60,   "c2",   18.00,
-	"c3",   12.80,   "c4",    9.00,   "c5",    6.40,   "c6",    4.50,
-	"c7",    3.20,   "m1",   54.00,   "m2",   54.00,   "m3",   54.00,
-	"m4",   60.00,   "m5",   60.00,   "m6",   60.00);
-%page_height_in = (
-	"a",    11.00,   "b",    17.00,   "c",    22.00,   "d",    34.00,
-	"e",    44.00,   "f",    40.00,   "e1",   68.00,   "a0",   46.81,
-	"a1",   33.11,   "a2",   23.39,   "a3",   16.54,   "a4",   11.69,
-	"a5",    8.27,   "a6",    5.83,   "a7",    4.13,   "a8",    2.91,
-	"a9",    2.05,   "a10",   1.46,   "b0",   56.67,   "b1",   39.37,
-	"b2",   27.83,   "b3",   19.68,   "b4",   13.90,   "b5",    9.84,
-	"b6",    6.93,   "b7",    4.92,   "b8",    3.46,   "b9",    2.44,
-	"b10",   1.73,   "c0",   51.20,   "c1",   36.00,   "c2",   25.60,
-	"c3",   18.00,   "c4",   12.80,   "c5",    9.00,   "c6",    6.40,
-	"c7",    4.50,   "m1",   72.00,   "m2",   84.00,   "m3",   96.00,
-	"m4",   72.00,   "m5",   84.00,   "m6",   96.00);
-%page_anot_font = (
-	"a",     8,   "b",    12,   "c",    16,   "d",    24,
-	"e",    24,   "f",    24,   "e1",   24,   "a0",   24,
-	"a1",   24,   "a2",   16,   "a3",   12,   "a4",    8,
-	"a5",    6,   "a6",    6,   "a7",    6,   "a8",    4,
-	"a9",    4,   "a10",   4,   "b0",   24,   "b1",   24,
-	"b2",   16,   "b3",   16,   "b4",   12,   "b5",    8,
-	"b6",    6,   "b7",    4,   "b8",    4,   "b9",    4,
-	"b10",   4,   "c0",   24,   "c1",   24,   "c2",   16,
-	"c3",   12,   "c4",    8,   "c5",    6,   "c6",    6,
-	"c7",    6,   "m1",   24,   "m2",   24,   "m3",   24,
-	"m4",   24,   "m5",   24,   "m6",   24);
-%page_header_font =(
-	"a",    10,   "b",    15,   "c",    20,   "d",    30,
-	"e",    30,   "f",    30,   "e1",   30,   "a0",   30,
-	"a1",   30,   "a2",   20,   "a3",   15,   "a4",   10,
-	"a5",    8,   "a6",    8,   "a7",    8,   "a8",    5,
-	"a9",    5,   "a10",   5,   "b0",   30,   "b1",   30,
-	"b2",   20,   "b3",   20,   "b4",   15,   "b5",   10,
-	"b6",    8,   "b7",    5,   "b8",    5,   "b9",    5,
-	"b10",   5,   "c0",   30,   "c1",   30,   "c2",   20,
-	"c3",   15,   "c4",   10,   "c5",    8,   "c6",    8,
-	"c7",    8,   "m1",   30,   "m2",   30,   "m3",   30,
-	"m4",   30,   "m5",   30,   "m6",   30);
-%page_gmt_name =     (
-	"a",     "archA",   "b",     "archB",   "c",     "archC",   "d",     "archD",
-	"e",     "archE",   "f",     "B0",      "e1",    "B0",      "a0",    "A0",
-	"a1",    "A1",      "a2",    "A2",      "a3",    "A3",      "a4",    "A4",
-	"a5",    "A5",      "a6",    "A6",      "a7",    "A7",      "a8",    "A8",
-	"a9",    "A9",      "a10",   "A10",     "b0",    "B0",      "b1",    "B1",
-	"b2",    "B2",      "b3",    "B3",      "b4",    "B4",      "b5",    "B5",
-	"b6",    "A6",      "b7",    "A7",      "b8",    "A8",      "b9",    "A9",
-	"b10",   "A10",     "c0",    "B0",      "c1",    "B1",      "c2",    "B2",
-	"c3",    "B3",      "c4",    "B4",      "c5",    "B5",      "c6",    "B6",
-	"c7",    "B7",      "m1", "Custom_4241x5655",    "m2",   "Custom_4241x6578",
-	"m3",   "Custom_4241x7540",  "m4",   "Custom_4712x5655",
-	"m5",   "Custom_4712x6578",  "m6",   "Custom_4712x7540");
-%xpsview_mem =     (
-	"a",     "4m",   "b",     "6m",   "c",     "8m",   "d",    "12m",
-	"e",    "16m",   "f",    "16m",   "e1",   "16m",   "a0",   "16m",
-	"a1",   "12m",   "a2",    "8m",   "a3",    "6m",   "a4",    "4m",
-	"a5",    "4m",   "a6",    "4m",   "a7",    "4m",   "a8",    "4m",
-	"a9",    "4m",   "a10",   "4m",   "b0",   "16m",   "b1",   "12m",
-	"b2",    "8m",   "b3",    "8m",   "b4",    "6m",   "b5",    "4m",
-	"b6",    "4m",   "b7",    "4m",   "b8",    "4m",   "b9",    "4m",
-	"b10",   "4m",   "c0",   "16m",   "c1",   "12m",   "c2",    "8m",
-	"c3",    "6m",   "c4",    "4m",   "c5",    "4m",   "c6",    "4m",
-	"c7",    "4m",   "m1",   "16m",   "m2",   "16m",   "m3",   "16m",
-	"m4",   "16m",   "m5",   "16m",   "m6",   "16m");
-
-# set default number of colors
-$ncpt = 11;
-
-# define color pallettes
-
- at color_pallette_names = (   "Haxby Colors",
-			    "High Intensity Colors",
-			    "Low Intensity Colors",
-			    "Grayscale",
-			    "Uniform Gray",
-			    "Uniform Black",
-			    "Uniform White");
-
-# original Haxby color pallette
-#	$ncolors = 15;
-#	@cptbr = (255, 255, 255, 255, 255, 240, 205, 138, 106,  87,  50,   0,  40,  21,  37);
-#	@cptbg = (255, 221, 186, 161, 189, 236, 255, 236, 235, 215, 190, 160, 127,  92,  57);
-#	@cptbb = (255, 171, 133,  68,  87, 121, 162, 174, 255, 255, 255, 255, 251, 236, 175);
-#                 use       use  use  use  use  use  use  use       use       use       use
-
-# color pallette 1 - Haxby Color Table
-	@cptbr1 = (255, 255, 255, 255, 240, 205, 138, 106,  50,  40,  37);
-	@cptbg1 = (255, 186, 161, 189, 236, 255, 236, 235, 190, 127,  57);
-	@cptbb1 = (255, 133,  68,  87, 121, 162, 174, 255, 255, 251, 175);
-
-# color pallette 2 - High Intensity Colors
-	@cptbr2 = (255, 255, 255, 255, 128,   0,   0,   0,   0, 128, 255);
-	@cptbg2 = (  0,  64, 128, 255, 255, 255, 255, 128,   0,   0,   0);
-	@cptbb2 = (  0,   0,   0,   0,   0,   0, 255, 255, 255, 255, 255);
-
-# color pallette 3 - Low Intensity Colors
-	@cptbr3 = (200, 194, 179, 141,  90,   0,   0,   0,   0,  90, 141);
-	@cptbg3 = (  0,  49,  90, 141, 179, 200, 141,  90,   0,   0,   0);
-	@cptbb3 = (  0,   0,   0,   0,   0,   0, 141, 179, 200, 179, 141);
-
-# color pallette 4 - Grayscale
-	@cptbr4 = (255, 230, 204, 179, 153, 128, 102,  77,  51,  26,   0);
-	@cptbg4 = (255, 230, 204, 179, 153, 128, 102,  77,  51,  26,   0);
-	@cptbb4 = (255, 230, 204, 179, 153, 128, 102,  77,  51,  26,   0);
-
-# color pallette 5 - Uniform Grayscale
-	@cptbr5 = (128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128);
-	@cptbg5 = (128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128);
-	@cptbb5 = (128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128);
-
-# color pallette 6 - Uniform Black
-	@cptbr6 = (  0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0);
-	@cptbg6 = (  0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0);
-	@cptbb6 = (  0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0);
-
-# color pallette 7 - Uniform White
-	@cptbr7 = (255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255);
-	@cptbg7 = (255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255);
-	@cptbb7 = (255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255);
-
-# define degrees to radians conversion
-$PI = 3.1415926;
-$DTR = $PI / 180.0;
-
-# Determine the GMT version
- at grdinfo = `grdinfo 2>&1`;
-while (@grdinfo)
-	{
-	$line = shift @grdinfo;
-	if ($line =~
-		/^grdinfo\s+(\S+)\s+\S+/)
-		{
-		($gmt_version) = $line =~
-			/^grdinfo\s+(\S+)\s+\S+/;
-		}
-	}
-
-# Deal with command line arguments
-$command_line = "@ARGV";
-&MBGetopts('A:a:B:b:C%c%D%d%E:e:e:F:f:G%g%HhI:i:J+j+K:k:L:l:M+m+N:n:O:o:P:p:QqR:r:S%s%TtU:u:VvW:w:XxYyZ:z:');
-$shade_control = 	($opt_A || $opt_a);
-$tick_info = 		($opt_B || $opt_b);
-$contour_mode = 	($flg_C || $flg_c);
-$contour_control = 	($opt_C || $opt_c);
-$color_flip_mode = 	($flg_D || $flg_d);
-$color_flip_control = 	($opt_D || $opt_d);
-$view_control = 	($opt_E || $opt_e);
-$exaggeration =		($opt_F || $opt_f);
-$color_mode =   	($opt_G || $opt_g || $flg_G || $flg_g);
-$help =    		($opt_H || $opt_h);
-$file_data =    	($opt_I || $opt_i);
-$map_scale =    	($opt_J || $opt_j);
-$file_intensity =    	($opt_K || $opt_k);
-$labels =    		($opt_L || $opt_l);
-$misc = 		($opt_M || $opt_m);
-$file_drape =    	($opt_N || $opt_n);
-$root =    		($opt_O || $opt_o);
-$pagesize = 		($opt_P || $opt_p);
-$no_view_ps = 		($opt_Q || $opt_q);
-$bounds = 		($opt_R || $opt_r);
-$stretch_mode = 	($flg_S || $flg_s);
-$stretch_control = 	($opt_S || $opt_s);
-$coastline_control = 	($opt_T || $opt_t);
-$orientation = 		($opt_U || $opt_u);
-$verbose = 		($opt_V || $opt_v);
-$color_control = 	($opt_W || $opt_w);
-$execute = 		($opt_X || $opt_x);
-$no_nice_color_int = 	($opt_Y || $opt_y);
-$zbounds = 		($opt_Z || $opt_z);
-
-# print out help message if required
-if ($help)
-	{
-	print "\n$program_name:\n";
-	print "\nVersion: $Id: mbm_grd3dplot 2234 2015-03-05 07:41:54Z caress $\n";
-	print "\nMacro to generate a shellscript of GMT commands which, when \n";
-	print "executed, will generate a 3D perspective Postscript plot of  \n";
-	print "gridded data.  Several styles of plots can be generated, \n";
-	print "including color fill views, color shaded relief views, mesh  \n";
-	print "plot views, and text labels. Five different color schemes are \n";
-	print "included. The plot will be scaled to fit on the specified page  \n";
-	print "size or, if the scale is user defined, the page size will be  \n";
-	print "chosen in accordance with the plot size. The primary purpose \n";
-	print "of this macro is to allow the simple, semi-automated \n";
-	print "production of nice looking maps with a few command line \n";
-	print "arguments. For users seeking more control over the plot \n";
-	print "appearance, a number of additional optional arguments are \n";
-	print "provided. Truly ambitious users may edit the plot shellscript \n";
-	print "to take advantage of GMT capabilites not supported by this \n";
-	print "macro.\n";
-	print "\nBasic Usage: \n";
-	print "\t$program_name -Ifile [-Amagnitude[/azimuth/elevation] \n";
-	print "\t\t-C[contour_control] -Eview_az/view_el \n";
-	print "\t\t-Fexaggeration -Gcolor_mode -H -Kintensity_file \n";
-	print "\t\t-Ndrape_file -Oroot -Ppagesize \n";
-	print "\t\t-S[color/shade] -Uorientation -V\n";
-	print "\t\t-Wcolor_style[/pallette] ]\n";
-	print "Additional Options:\n";
-	print "\t\t[-Btickinfo -Dflipcolor/flipshade\n";
-	print "\t\t-Jprojection[/scale | width] -Ltitle[:scale_label] \n";
-	print "\t\t-Mmisc -Q -Rw/e/s/n -X -Y -Zmin/max]\n";
-	print "Miscellaneous Options:\n";
-	print "\t\t[-MGDgmtdef/value -MGFscale_loc\n";
-	print "\t\t-MGL[f][x]lon0/lat0/slat/length[m]\n";
-	print "\t\t-MGQdpi -MGSscalefactor -MGTx/y/size/angle/font/just/text\n";
-	print "\t\t-MGU[/dx/dy/][label] -MVMmesh_pen -MVNnull -MVZzlevel ]\n";
-	exit 0;
-	}
-
-# check for input file
-if (!$file_data)
-	{
-	print "\a";
-	die "\nNo input file specified!\n$program_name aborted\n";
-	}
-else
-	{
-	if ($file_data =~ /\S+=.+/)
-		{
-		($file_check) = $file_data =~ /(\S+)=.+/;
-		}
-	else
-		{
-		$file_check = $file_data;
-		}
-	if (! -r $file_check)
-		{
-		print "\a";
-		die "\nSpecified input file $file_check cannot be opened!\n$program_name aborted\n";
-		}
-	}
-if ($file_intensity)
-	{
-	if ($file_intensity =~ /\S+=.+/)
-		{
-		($file_check) = $file_intensity =~ /(\S+)=.+/;
-		}
-	else
-		{
-		$file_check = $file_intensity;
-		}
-	if (! -r $file_check)
-		{
-		print "\a";
-		die "\nSpecified intensity input file $file_check cannot be opened!\n$program_name aborted\n";
-		}
-	}
-if ($file_drape)
-	{
-	if ($file_drape =~ /\S+=.+/)
-		{
-		($file_check) = $file_drape =~ /(\S+)=.+/;
-		}
-	else
-		{
-		$file_check = $file_drape;
-		}
-	if (! -r $file_check)
-		{
-		print "\a";
-		die "\nSpecified drape input file $file_check cannot be opened!\n$program_name aborted\n";
-		}
-	}
-
-# parse misc commands
-if ($misc)
-	{
-	@misc_cmd = split(/:::::::/, $misc);
-	foreach $cmd (@misc_cmd) {
-
-		# deal with general options
-		##############################
-
-		# set GMT default values
-		if ($cmd =~ /^[Gg][Dd]./)
-			{
-			($gmt_def) = $cmd =~
-				/^[Gg][Dd](\S+)/;
-			push(@gmt_defs, $gmt_def);
-			}
-
-		# set color scale location
-		if ($cmd =~ /^[Gg][Ff]./)
-			{
-			($scale_loc) = $cmd =~
-				/^[Gg][Ff](\S+)/;
-			}
-
-		# set map scale
-		if ($cmd =~ /^[Gg][Ll]./)
-			{
-			($length_scale) = $cmd =~
-				/^[Gg][Ll](\S+)/;
-			}
-
-		# set dpi for color image output
-		if ($cmd =~ /^[GG][Qq]./)
-			{
-			($dpi) = $cmd =~ /^[GG][Qq](.+)/;
-			}
-
-		# set data scaling
-		if ($cmd =~ /^[Gg][Ss]./)
-			{
-			($data_scale) = $cmd =~
-				/^[Gg][Ss](\S+)/;
-			}
-
-		# set text labels
-		if ($cmd =~ /^[Gg][Tt]./)
-			{
-			($tx, $ty, $tsize, $tangle, $font, $just, $txt)
-			    = $cmd
-			    =~ /^[Gg][Pp](\S+)\/(\S+)\/(\S+)\/(\S+)\/(\S+)\/(\S+)\/(.+)/;
-			if ($txt)
-			    {
-			    ($text_info) = $cmd =~
-				/^[Gg][Tt](.*)/;
-			    push(@text, $text_info);
-			    }
-			else
-			    {
-			    print "\nInvalid text label ignored: $cmd\n";
-			    }
-			}
-
-		# set unix time stamp
-		if ($cmd =~ /^[Gg][Uu]./)
-			{
-			($unix_stamp) = $cmd =~ /^[Gg][Uu](\S+)/;
-			$unix_stamp_on = 1;
-			}
-		elsif ($cmd =~ /^[Gg][Uu]/)
-			{
-			$unix_stamp_on = 1;
-			}
-
-		# deal with pscoast options
-		##############################
-
-		# set pscoast lake fill
-		if ($cmd =~ /^[Tt][Cc]./)
-			{
-			($coast_lakefill) = $cmd =~ /^[Tt][Cc](.+)/;
-			$coast_control = 1;
-			}
-
-		# set pscoast resolution
-		if ($cmd =~ /^[Tt][Dd]./)
-			{
-			($coast_resolution) = $cmd =~ /^[Tt][Dd](.+)/;
-			}
-
-		# set pscoast dry fill
-		if ($cmd =~ /^[Tt][Gg]./)
-			{
-			($coast_dryfill) = $cmd =~ /^[Tt][Gg](.+)/;
-			$coast_control = 1;
-			}
-
-		# set pscoast rivers
-		if ($cmd =~ /^[Tt][Ii]./)
-			{
-			($coast_river) = $cmd =~ /^[Tt][Ii](.+)/;
-			$coast_control = 1;
-			}
-
-		# set pscoast national boundaries
-		if ($cmd =~ /^[Tt][Nn]./)
-			{
-			($coast_boundary) = $cmd =~ /^[Tt][Nn](.+)/;
-			push(@coast_boundaries, $coast_boundary);
-			$coast_control = 1;
-			}
-
-		# set pscoast wet fill
-		if ($cmd =~ /^[Tt][Ss]./)
-			{
-			($coast_wetfill) = $cmd =~ /^[Tt][Ss](.+)/;
-			$coast_control = 1;
-			}
-
-		# set pscoast coastline pen
-		if ($cmd =~ /^[Tt][Ww]./)
-			{
-			($coast_pen) = $cmd =~ /^[Tt][Ww](.+)/;
-			$coast_control = 1;
-			}
-
-		# deal with grdview options
-		##############################
-
-		# set grdview mesh pen attributes
-		if ($cmd =~ /^[Vv][Mm]./)
-			{
-			($grdview_mesh_pen) = $cmd =~
-				/^[Vv][Mm](\S+)/;
-			}
-
-		# set grdview null plane level and color
-		if ($cmd =~ /^[Vv][Nn]./)
-			{
-			if ($cmd =~ /^[Vv][Nn]\S+/)
-				{
-				($grdview_null) = $cmd =~
-					/^[Vv][Nn](\S+)/;
-				}
-			}
-		elsif ($cmd =~ /^[Vv][Nn]/)
-			{
-			$grdview_null_set = 1;
-			}
-
-		# set grdview contour pen attributes
-		if ($cmd =~ /^[Vv][Ww]./)
-			{
-			($grdview_contour_pen) = $cmd =~
-				/^[Vv][Ww](\S+)/;
-			}
-
-		# set grdview z level
-		if ($cmd =~ /^[Vv][Zz]./)
-			{
-			($grdview_zlevel) = $cmd =~
-				/^[Vv][Zz](\S+)/;
-			}
-		}
-	}
-
-# set plot mode
-if (!$root)
-	{
-	if ($file_data =~ /.=./)
-		{
-		($root) = $file_data =~ /^(\S+)=./;
-		}
-	else
-		{
-		$root = $file_data;
-		}
-	}
-if (!$color_mode && !$contour_mode)
-	{
-	$color_mode = 1;
-	}
-if ($shade_control)
-	{
-	if ($shade_control =~ /^(\S+)\/(\S+)\/(\S+)/)
-		{
-		($magnitude, $azimuth, $elevation) =
-			$shade_control =~ /^(\S+)\/(\S+)\/(\S+)/;
-		}
-	elsif ($shade_control =~ /^(\S+)\/(\S+)/)
-		{
-		($magnitude, $azimuth) =
-			$shade_control =~ /^(\S+)\/(\S+)/;
-		}
-	elsif ($shade_control =~ /^(\S+).*/)
-		{
-		($magnitude) =
-			$shade_control =~ /^(\S+).*/;
-		}
-	}
-if ($file_intensity && !$color_mode)
-	{
-	$color_mode = 3;
-	}
-if ($color_mode == 2 && !$azimuth)
-	{
-	$azimuth = 0;
-	}
-if ($color_mode == 2 && !$magnitude)
-	{
-	$magnitude = 0.2;
-	}
-elsif ($color_mode == 3 && !$magnitude)
-	{
-	$magnitude = -0.4;
-	}
-if ($color_mode == 2 && !$elevation)
-	{
-	$elevation = 30.0;
-	}
-if ($color_mode >= 4 && !$magnitude)
-	{
-	$magnitude = 1.0;
-	}
-if (!$view_control)
-	{
-	$view_control = "240/30";
-	($view_azimuth, $view_elevation) = $view_control
-		=~ /(\S+)\/(\S+)/;
-	$view_azimuth = "240";
-	$view_elevation = "30";
-	}
-else
-	{
-	($view_azimuth, $view_elevation) = $view_control
-		=~ /(\S+)\/(\S+)/;
-	}
-if ($color_control)
-	{
-	if (-e $color_control)
-		{
-		$file_cpt = $color_control;
-		$color_style = 1;
-		$color_pallette = 1;
-		$ncolors = $ncpt;
-		}
-	elsif ($color_control =~ /\S+\/\S+\/\S+/)
-		{
-		($color_style, $color_pallette, $ncolors)
-			= $color_control =~  /(\S+)\/(\S+)\/(\S+)/;
-		if ($color_pallette < 1
-			|| $color_pallette > 7)
-			{
-			$color_pallette = 1;
-			}
-		if ($ncolors < 2)
-			{
-			$ncolors = 2;
-			}
-		}
-	elsif ($color_control =~ /\S+\/\S+/)
-		{
-		($color_style, $color_pallette) = $color_control
-			=~  /(\S+)\/(\S+)/;
-		if ($color_pallette < 1
-			|| $color_pallette > 7)
-			{
-			$color_pallette = 1;
-			}
-		$ncolors = $ncpt;
-		}
-	else
-		{
-		$color_style = $color_control;
-		$color_pallette = 1;
-		$ncolors = $ncpt;
-		}
-	}
-else
-	{
-	$color_style = 1;
-	$color_pallette = 1;
-	$ncolors = $ncpt;
-	}
-if ($color_flip_control)
-	{
-	if ($color_flip_control =~ /^\S+\/\S+/)
-		{
-		($color_flip, $shade_flip) = $color_flip_control
-			=~ /^(\S+)\/(\S+)/;
-		}
-	elsif ($color_flip_control =~ /^\S+/)
-		{
-		($color_flip) = $color_flip_control
-			=~ /^(\S+)/;
-		}
-	}
-elsif ($color_flip_mode)
-	{
-	$color_flip = 1;
-	}
-if ($color_mode && $shade_flip)
-	{
-	$magnitude = -1 * $magnitude;
-	}
-if ($stretch_control)
-	{
-	if ($stretch_control =~ /^\S+\/\S+/)
-		{
-		($stretch_color, $stretch_shade) = $stretch_control
-			=~ /^(\S+)\/(\S+)/;
-		}
-	elsif ($stretch_control =~ /^\S+/)
-		{
-		($stretch_color) = $stretch_control
-			=~ /^(\S+)/;
-		}
-	}
-elsif ($stretch_mode)
-	{
-	$stretch_color = 1;
-	}
-
-# set page size
-if (!$pagesize)
-	{
-	$pagesize = "a";
-	}
-else
-	{
-	$pagesize =~ tr/A-Z/a-z/;
-	if (!$page_width_in{$pagesize})
-		{
-		$pagesize = "a";
-		}
-	}
-
-# use mbdefaults to get the current system default postscript viewer
-$ps_viewer = "ghostview";
- at mbdefaults = `mbdefaults`;
-while (@mbdefaults)
-        {
-        $line = shift @mbdefaults;
-        if ($line =~ /ps viewer:\s+(\S+)/)
-                {
-                ($ps_viewer) = $line =~ /ps viewer:\s+(\S+)/;
-                 }
-        }
-
-# check environment variable
-if ($ENV{"MB_PS_VIEWER"})
-	{
-	$ps_viewer = $ENV{"MB_PS_VIEWER"};
-	}
-
-# get limits of data file using grdinfo
-if (!$bounds || !$zbounds)
-	{
-	if ($bounds)
-		{
-		@grdinfo = `mbm_grdinfo -I$file_data -R$bounds`;
-		}
-	else
-		{
-		@grdinfo = `grdinfo $file_data`;
-		}
-	while (@grdinfo)
-		{
-		$line = shift @grdinfo;
-		if ($line =~
-			/\s+Projection: UTM Zone \S+/)
-			{
-			($utm_zone) = $line =~
-				/\s+Projection: UTM Zone (\S+)/;
-			$gridprojected = 1;
-			}
-		if ($line =~
-			/\s+Projection: Geographic/)
-			{
-			$gridprojected = 0;
-			}
-		if ($line =~
-			/\S+\s+x_min:\s+\S+\s+x_max:\s+\S+\s+x_inc:\s+\S+\s+units:\s+.+\s+nx:\s+\S+/)
-			{
-			($xmin,$xmax,$xinc,$xunits,$xnx_d) = $line =~
-				/\S+\s+x_min:\s+(\S+)\s+x_max:\s+(\S+)\s+x_inc:\s+(\S+)\s+units:\s+(.+)\s+nx:\s+(\S+)/;
-			}
-		elsif ($line =~
-			/\S+\s+x_min:\s+\S+\s+x_max:\s+\S+\s+x_inc:\s+\S+\s+name:\s+.+\s+nx:\s+\S+/)
-			{
-			($xmin,$xmax,$xinc,$xunits,$xnx_d) = $line =~
-				/\S+\s+x_min:\s+(\S+)\s+x_max:\s+(\S+)\s+x_inc:\s+(\S+)\s+name:\s+(.+)\s+nx:\s+(\S+)/;
-			}
-		elsif ($line =~
-			/\S+\s+x_min:\s+(\S+)\s+x_max:\s+(\S+)\s+x_inc:/)
-			{
-			($xmin,$xmax) = $line =~
-				/\S+\s+x_min:\s+(\S+)\s+x_max:\s+(\S+)\s+x_inc:/;
-			}
-		if ($line =~ /\S+\s+y_min:\s+\S+\s+y_max:\s+\S+\s+y_inc:\s+\S+\s+units:\s+.+\s+ny:\s+\S+/)
-			{
-			($ymin,$ymax,$yinc,$yunits,$yny_d) = $line =~
-				/\S+\s+y_min:\s+(\S+)\s+y_max:\s+(\S+)\s+y_inc:\s+(\S+)\s+units:\s+(.+)\s+ny:\s+(\S+)/;
-			}
-		elsif ($line =~ /\S+\s+y_min:\s+\S+\s+y_max:\s+\S+\s+y_inc:\s+\S+\s+name:\s+.+\s+ny:\s+\S+/)
-			{
-			($ymin,$ymax,$yinc,$yunits,$yny_d) = $line =~
-				/\S+\s+y_min:\s+(\S+)\s+y_max:\s+(\S+)\s+y_inc:\s+(\S+)\s+name:\s+(.+)\s+ny:\s+(\S+)/;
-			}
-		elsif ($line =~ /\S+\s+y_min:\s+\S+\s+y_max:\s+\S+\s+y_inc:/)
-			{
-			($ymin,$ymax) = $line =~
-				/\S+\s+y_min:\s+(\S+)\s+y_max:\s+(\S+)\s+y_inc:/;
-			}
-		if ($line =~ /\S+\s+zmin:\s+\S+\s+zmax:\s+\S+\s+units:\s+\S+/)
-			{
-			($zmin,$zmax) = $line =~
-				/\S+\s+zmin:\s+(\S+)\s+zmax:\s+(\S+)\s+units:\s+\S+/;
-			}
-		elsif ($line =~ /\S+\s+zmin:\s+\S+\s+zmax:\s+\S+\s+name:\s+\S+/)
-			{
-			($zmin,$zmax) = $line =~
-				/\S+\s+zmin:\s+(\S+)\s+zmax:\s+(\S+)\s+name:\s+\S+/;
-			}
-		if ($line =~ /\S+\s+z_min:\s+\S+\s+z_max:\s+\S+\s+units:/)
-			{
-			($zmin,$zmax,$zunits_s) = $line =~
-				/\S+\s+z_min:\s+(\S+)\s+z_max:\s+(\S+)\s+units:\s+(.+)/;
-			}
-		elsif ($line =~ /\S+\s+z_min:\s+\S+\s+z_max:\s+\S+\s+name:/)
-			{
-			($zmin,$zmax,$zunits_s) = $line =~
-				/\S+\s+z_min:\s+(\S+)\s+z_max:\s+(\S+)\s+name:\s+(.+)/;
-			}
-		}
-
-	# check that there is data
-	if ($xmin >= $xmax || $ymin >= $ymax
-		|| ($zmin >= $zmax && !$zbounds))
-		{
-		print "\a";
-		die "The program grdinfo does not appear to have worked properly!\n$program_name aborted.\n"
-		}
-	}
-
-# get limits of drape data file using grdinfo
-if ($file_drape && !$zbounds)
-	{
-	@grdinfo = `grdinfo $file_drape`;
-	while (@grdinfo)
-		{
-		$line = shift @grdinfo;
-		if ($line =~ /\S+\s+zmin:\s+(\S+)\s+zmax:\s+(\S+)\s+units:/)
-			{
-			($zmin,$zmax) = $line =~
-				/\S+\s+zmin:\s+(\S+)\s+zmax:\s+(\S+)\s+units:/;
-			}
-		if ($line =~ /\S+\s+z_min:\s+(\S+)\s+z_max:\s+(\S+)\s+units:/)
-			{
-			($zmin,$zmax) = $line =~
-				/\S+\s+z_min:\s+(\S+)\s+z_max:\s+(\S+)\s+units:/;
-			}
-		}
-
-	# check that there is data
-	if ($zmin >= $zmax)
-		{
-		print "\a";
-		die "The program grdinfo does not appear to have worked properly!\n$program_name aborted.\n"
-		}
-	}
-
-# use user defined geographic limits
-if ($bounds)
-	{
-	if ($bounds =~ /^\S+\/\S+\/\S+\/\S+r$/)
-		{
-		($xmin_raw,$ymin_raw,$xmax_raw,$ymax_raw) = $bounds =~
-			/^(\S+)\/(\S+)\/(\S+)\/(\S+)r$/;
-		$xmin = &GetDecimalDegrees($xmin_raw);
-		$xmax = &GetDecimalDegrees($xmax_raw);
-		$ymin = &GetDecimalDegrees($ymin_raw);
-		$ymax = &GetDecimalDegrees($ymax_raw);
-		$use_corner_points = 1;
-		$bounds_plot = $bounds;
-		}
-	elsif ($bounds =~ /^\S+\/\S+\/\S+\/\S+$/)
-		{
-		($xmin_raw,$xmax_raw,$ymin_raw,$ymax_raw) = $bounds =~
-			/(\S+)\/(\S+)\/(\S+)\/(\S+)/;
-		$xmin = &GetDecimalDegrees($xmin_raw);
-		$xmax = &GetDecimalDegrees($xmax_raw);
-		$ymin = &GetDecimalDegrees($ymin_raw);
-		$ymax = &GetDecimalDegrees($ymax_raw);
-		$bounds_plot = $bounds;
-		}
-	elsif ($bounds =~ /^r$/)
-		{
-		$use_corner_points = 1;
-		$bounds_plot = sprintf ("%1.8g/%1.8g/%1.8g/%1.8gr",
-			$xmin, $ymin, $xmax, $ymax);
-		}
-	}
-
-# set grid to projected if outside geographic bounds
-if ($xmin < -360.0 || $xmax > 360.0
-	|| $ymin < -90.0 || $ymax > 90.0)
-	{
-	$gridprojected = 1;
-	}
-
-# set bounds string for plotting if not already set
-if (!$bounds_plot)
-	{
-	$bounds_plot = sprintf ("%1.8g/%1.8g/%1.8g/%1.8g",
-		$xmin, $xmax, $ymin, $ymax);
-	}
-
-# use user defined data limits
-if ($zbounds)
-	{
-	($zmin,$zmax) = $zbounds =~ /(\S+)\/(\S+)/;
-	}
-
-# check that there is data
-if ((!$use_corner_points && ($xmin >= $xmax || $ymin >= $ymax))
-	|| $zmin >= $zmax)
-	{
-	print "\a";
-	die "Improper data limits: x: $xmin $xmax  y: $ymin $ymax  z: $zmin $zmax\n$program_name aborted.\n"
-	}
-
-# apply rescaling to zmin and zmax if needed
-if ($data_scale)
-	{
-	$zmin = $data_scale * $zmin;
-	$zmax = $data_scale * $zmax;
-	if ($zmin > $zmax)
-		{
-		$tmp = $zmin;
-		$zmin = $zmax;
-		$zmax = $tmp;
-		}
-	}
-
-# set the relevent page width and height
-&GetPageSize;
-
-# get user constraints on map scale
-if ($map_scale)
-	{
-	# break up map_scale into -Jz and -Jproj
-	@J = split(/:::::::/, $map_scale);
-	if (scalar(@J) == 2 && $J[0] =~ /^z.*/)
-		{
-		($map_zscale) = $J[0] =~ /^z.(\S+)/;
-		$map_scale = $J[1];
-
-		# sets $plot_scale or $plot_width if possible
-		&GetProjection;
-		}
-	elsif (scalar(@J) == 2)
-		{
-		($map_zscale) = $J[1] =~ /^z.(\S+)/;
-		$map_scale = $J[0];
-
-		# sets $plot_scale or $plot_width if possible
-		&GetProjection;
-		}
-	elsif (scalar(@J) == 1 && $J[0] =~ /^z.*/)
-		{
-		($map_zscale) = $J[0] =~ /^z.(\S+)/;
-		}
-	else
-		{
-		# sets $plot_scale or $plot_width if possible
-		&GetProjection;
-		}
-	}
-
-# set up for mapproject
-if (($use_scale && $plot_scale) || ($use_width && $plot_width))
-	{
-	($projection) = $map_scale =~ /^(\w)/;
-	($projection_pars) = $map_scale =~ /^$projection(\S+)/;
-	}
-elsif ($use_scale || $use_width)
-	{
-	($projection) = $map_scale =~ /^(\w)/;
-	($projection_pars) = $map_scale =~ /^$projection(\S+)/;
-	$projection_pars = "$projection_pars" . "$separator" . "$trial_value";
-	}
-elsif ($gridprojected)
-	{
-	$projection = "x";
-	$projection_pars = "1.0";
-	$use_scale = 1;
-	$linear = 1;
-	}
-else
-	{
-	$projection = "m";
-	$projection_pars = "1.0";
-	$use_scale = 1;
-	}
-
-# now find out the apparent size of the plot
-`echo $xmin $ymin > tmp$$.dat`;
-`echo $xmax $ymin >> tmp$$.dat`;
-`echo $xmax $ymax >> tmp$$.dat`;
-`echo $xmin $ymax >> tmp$$.dat`;
- at projected = `mapproject tmp$$.dat -J$projection$projection_pars -R$bounds_plot 2>&1 `;
-`/bin/rm -f tmp$$.dat`;
-while (@projected)
-	{
-	$line = shift @projected;
-	if (!$xxmin)
-		{
-		($xxmin,$yymin) = $line =~ /(\S+)\s+(\S+)/;
-		$xxmax = $xxmin;
-		$yymax = $yymin;
-		}
-	else
-		{
-		($xx,$yy) = $line =~ /(\S+)\s+(\S+)/;
-		$xxmin = ($xx < $xxmin ? $xx : $xxmin);
-		$xxmax = ($xx > $xxmax ? $xx : $xxmax);
-		$yymin = ($yy < $yymin ? $yy : $yymin);
-		$yymax = ($yy > $yymax ? $yy : $yymax);
-		}
-	}
-$dxx = $xxmax - $xxmin;
-$dyy = $yymax - $yymin;
-
-# check for valid scaling
-if ($dxx == 0.0 && $dyy == 0.0)
-	{
-	print "\a";
-	die "Invalid projection specified - $program_name aborted\n";
-	}
-
-# figure out scaling issues
-if (($use_scale && $plot_scale) || ($use_width && $plot_width))
-	{
-	# set axis lengths
-	$plot_width_xaxis = $dxx;
-	$plot_height_yaxis = $dyy;
-
-	# adjust plotscale for 3D
-	$x_axis_rot = &abs($dxx * cos($DTR * $view_azimuth));
-	$y_axis_rot = &abs($dyy * sin($DTR * $view_azimuth));
-	$plot_width_factor = ($x_axis_rot + $y_axis_rot) / $dxx;
-	$plot_width = $plot_width_factor * $plot_width_xaxis;
-	$plot_height = $plot_width_factor * $plot_height_yaxis;
-
-	# decide which plot orientation to use
-	if ($orientation == 1)
-		{
-		$portrait = 1;
-		$width = $page_width_in{$pagesize};
-		$height = $page_height_in{$pagesize};
-		$width_max = $width_max_portrait;
-		$height_max = $height_max_portrait;
-		}
-	elsif ($orientation == 2)
-		{
-		$landscape = 1;
-		$width = $page_height_in{$pagesize};
-		$height = $page_width_in{$pagesize};
-		$width_max = $width_max_landscape;
-		$height_max = $height_max_landscape;
-		}
-	elsif ($dxx > $dyy)
-		{
-		$landscape = 1;
-		$width = $page_height_in{$pagesize};
-		$height = $page_width_in{$pagesize};
-		$width_max = $width_max_landscape;
-		$height_max = $height_max_landscape;
-		}
-	else
-		{
-		$portrait = 1;
-		$width = $page_width_in{$pagesize};
-		$height = $page_height_in{$pagesize};
-		$width_max = $width_max_portrait;
-		$height_max = $height_max_portrait;
-		}
-
-	# check if plot fits on page
-	if ($plot_width > $width_max || $plot_height > $height_max)
-		{
-		# try to find a sufficiently large pagesize
-		$pagesize_save = $pagesize;
-		foreach $elem (@page_size_names) {
-			$pagesize = "$elem";
-			&GetPageSize;
-			if ($portrait)
-				{
-				$width_max = $width_max_portrait;
-				$height_max = $height_max_portrait;
-				}
-			else
-				{
-				$width_max = $width_max_landscape;
-				$height_max = $height_max_landscape;
-				}
-			if (!$good_page &&
-				$plot_width <= $width_max
-				&& $plot_height <= $height_max)
-				{
-				$good_page = 1;
-				$pagesize_save = $pagesize;
-				}
-			}
-
-		# print out warning
-		if ($pagesize eq $pagesize_save)
-			{
-			print "\nWarning: Unable to fit plot on any available page size!\n";
-			print "\tThis plot will not be particularly useful!\n";
-			print "\tTry using a different scale or allow the program to set the scale!\n";
-			}
-
-		# reset the page size
-		$pagesize = $pagesize_save;
-		&GetPageSize;
-		if ($portrait)
-			{
-			$width = $page_width_in{$pagesize};
-			$height = $page_height_in{$pagesize};
-			}
-		else
-			{
-			$width = $page_height_in{$pagesize};
-			$height = $page_width_in{$pagesize};
-			}
-		}
-	}
-elsif ($use_scale)
-	{
-	# get landscape and portrait scales
-	$plot_scale_landscape = $width_max_landscape/$dxx;
-	if ($plot_scale_landscape*$dyy > $height_max_landscape)
-		{
-		$plot_scale_landscape = $height_max_landscape/$dyy;
-		}
-	$plot_scale_portrait = $width_max_portrait/$dxx;
-	if ($plot_scale_portrait*$dyy > $height_max_portrait)
-		{
-		$plot_scale_portrait = $height_max_portrait/$dyy;
-		}
-
-	# decide which plot orientation to use
-	if ($orientation == 1)
-		{
-		$portrait = 1;
-		$plot_scale = $plot_scale_portrait;
-		$width = $page_width_in{$pagesize};
-		$height = $page_height_in{$pagesize};
-		}
-	elsif ($orientation == 2)
-		{
-		$landscape = 1;
-		$plot_scale = $plot_scale_landscape;
-		$width = $page_height_in{$pagesize};
-		$height = $page_width_in{$pagesize};
-		}
-	elsif ($plot_scale_landscape > $plot_scale_portrait)
-		{
-		$landscape = 1;
-		$plot_scale = $plot_scale_landscape;
-		$width = $page_height_in{$pagesize};
-		$height = $page_width_in{$pagesize};
-		}
-	else
-		{
-		$portrait = 1;
-		$plot_scale = $plot_scale_portrait;
-		$width = $page_width_in{$pagesize};
-		$height = $page_height_in{$pagesize};
-		}
-
-	# set raw plot width
-	$plot_width = $dxx * $plot_scale;
-	$plot_height = $dyy * $plot_scale;
-
-	# adjust plotscale for 3D
-	$x_axis_rot = &abs($dxx * cos($DTR * $view_azimuth));
-	$y_axis_rot = &abs($dyy * sin($DTR * $view_azimuth));
-	$plot_scale_factor = $dxx / ($x_axis_rot + $y_axis_rot);
-	$plot_scale = $plot_scale_factor * $plot_scale;
-
-	# set plot width
-	$plot_width_xaxis = $plot_scale_factor * $plot_width;
-	$plot_height_yaxis = $plot_scale_factor * $plot_height;
-
-	# reset plot_scale if ratio required
-	if ($use_ratio)
-		{
-		$top = int(1 / $plot_scale);
-		$plot_scale = "1:" . "$top";
-		}
-
-	# construct plot scale parameters
-	($projection_pars) = $map_scale =~ /^$projection(\S+)/;
-	$projection_pars = sprintf ("$projection_pars$separator%1.5g", $plot_scale);
-
-	# handle special case for linear projections
-	if ($linear && !$gridprojected)
-		{
-		$projection_pars = "$projection_pars" . "d";
-		}
-	}
-elsif ($use_width)
-	{
-	# get landscape and portrait heights
-	$plot_width_landscape = $height_max_landscape * $dxx / $dyy;
-	if ($plot_width_landscape > $width_max_landscape)
-		{
-		$plot_width_landscape = $width_max_landscape;
-		}
-	$plot_width_portrait = $height_max_portrait * $dxx / $dyy;
-	if ($plot_width_portrait > $width_max_portrait)
-		{
-		$plot_width_portrait = $width_max_portrait;
-		}
-
-	# decide which plot orientation to use
-	if ($orientation == 1)
-		{
-		$portrait = 1;
-		$plot_width = $plot_width_portrait;
-		$plot_height = $plot_width * $dyy / $dxx;
-		$width = $page_width_in{$pagesize};
-		$height = $page_height_in{$pagesize};
-		}
-	elsif ($orientation == 2)
-		{
-		$landscape = 1;
-		$plot_width = $plot_width_landscape;
-		$plot_height = $plot_width * $dyy / $dxx;
-		$width = $page_height_in{$pagesize};
-		$height = $page_width_in{$pagesize};
-		}
-	elsif ($plot_width_landscape > $plot_width_portrait)
-		{
-		$landscape = 1;
-		$plot_width = $plot_width_landscape;
-		$plot_height = $plot_width * $dyy / $dxx;
-		$width = $page_height_in{$pagesize};
-		$height = $page_width_in{$pagesize};
-		}
-	else
-		{
-		$portrait = 1;
-		$plot_width = $plot_width_portrait;
-		$plot_height = $plot_width * $dyy / $dxx;
-		$width = $page_width_in{$pagesize};
-		$height = $page_height_in{$pagesize};
-		}
-
-	# adjust plotwidth for 3D (kluge)
-	$x_axis_rot = &abs($dxx * cos($DTR * $view_azimuth));
-	$y_axis_rot = &abs($dyy * sin($DTR * $view_azimuth));
-	$plots_width_factor = $dxx / ($x_axis_rot + $y_axis_rot);
-	$plot_width_xaxis = $plot_width_factor * $plot_width;
-	$plot_height_yaxis = $plot_width_factor * $plot_height;
-
-	# construct plot scale parameters
-	($projection_pars) = $map_scale =~ /^$projection(\S+)/;
-	$projection_pars = sprintf ("$projection_pars$separator%1.5g", $plot_width_xaxis);
-
-	# handle special case for linear projections
-	if ($linear && !$gridprojected)
-		{
-		$projection_pars = "$projection_pars" . "d";
-		}
-	}
-
-# set zscale and/or exaggeration
-$C1 = 111412.84;
-$C2 = -93.5;
-$C3 = 0.118;
-$C4 = 111132.92;
-$C5 = -559.82;
-$C6 = 1.175;
-$C7 = 0.0023;
-$DTR = 3.14159265358979323846 / 180.0;
-$radlat = 0.5 * ($ymax + $ymin) * $DTR;
-$mtodeglat = 1./abs($C4 + $C5*cos(2*$radlat)
-			+ $C6*cos(4*$radlat) + $C7*cos(6*$radlat));
-$mtodeglon = 1./abs($C1*cos($radlat) + $C2*cos(3*$radlat)
-			+ $C3*cos(5*$radlat));
-if (!$map_zscale && $exaggeration)
-	{
-	if ($gridprojected)
-		{
-		$map_zscale =  $exaggeration * $plot_width
-				/ ($xmax - $xmin);
-		}
-	else
-		{
-		$map_zscale =  $exaggeration * $plot_width * $mtodeglon
-				/ ($xmax - $xmin);
-		}
-	}
-elsif (!$map_zscale)
-	{
-	$map_zscale = 2.0/($zmax - $zmin);
-	}
-if (!$exaggeration)
-	{
-	if ($gridprojected)
-		{
-		$exaggeration = $map_zscale * ($xmax - $xmin)
-					/ $plot_width;
-		}
-	else
-		{
-		$exaggeration = $map_zscale * ($xmax - $xmin)
-					/ $plot_width / $mtodeglon;
-		}
-	}
-
-# place the origin so plot is more or less centered
-$xoffset = ($width - $plot_width
-	- $space_left - $space_right) / 2 + $space_left;
-$yoffset = ($height - $plot_height
-	- $space_bottom - $space_top) / 2 + $space_bottom;
-
-# get plot degree annotation for geographic maps
-$degree_format = "ddd:mm";
-if (!$gridprojected)
-	{
-	$xsize = ($xmax - $xmin) / 3;
-	$ysize = ($ymax - $ymin) / 3;
-	if ($xsize < $ysize)
-		{
-		$size = $xsize;
-		}
-	else
-		{
-		$size = $ysize;
-		}
-	if ($size > 1.0)
-		{
-		$degree_format = "ddd";
-		}
-	elsif ($size > (1.0 / 60.0))
-		{
-		$degree_format = "ddd:mm";
-		}
-	else
-		{
-		$degree_format = "ddd:mm:ss";
-		}
-	}
-
-# figure out where to place the color scale
-$scale_loc =~ tr/A-Z/a-z/;
-if ($scale_loc eq "l")
-	{
-	$colorscale_length = $plot_height;
-	$colorscale_thick = 0.013636364 * $page_height_in{$pagesize};
-	$colorscale_offx = -0.13636 * $page_height_in{$pagesize};
-	$colorscale_offy = 0.5*$plot_height;
-	$colorscale_vh = "v";
-	}
-elsif ($scale_loc eq "r")
-	{
-	$colorscale_length = $plot_height;
-	$colorscale_thick = 0.013636364 * $page_height_in{$pagesize};
-	$colorscale_offx = $plot_width
-		+ 0.0909 * $page_height_in{$pagesize};
-	$colorscale_offy = 0.5*$plot_height;
-	$colorscale_vh = "v";
-	}
-elsif ($scale_loc eq "t")
-	{
-	$colorscale_length = $plot_width;
-	$colorscale_thick = 0.013636364 * $page_height_in{$pagesize};
-	$colorscale_offx = 0.5*$plot_width;
-	$colorscale_offy = $plot_height
-		+ 0.15 * $page_height_in{$pagesize};
-	$colorscale_vh = "h";
-	}
-else
-	{
-	$colorscale_length = $plot_width;
-	$colorscale_thick = 0.013636364 * $page_height_in{$pagesize};
-	$colorscale_offx = 0.5*$plot_width;
-	$colorscale_offy = -0.045454545 * $page_height_in{$pagesize};
-	$colorscale_vh = "h";
-	}
-
-# figure out reasonable color and contour intervals
-$dzz = ($zmax - $zmin);
-$contour_int = 0.0;
-if ($dzz > 0)
-	{
-	$base = int((log($dzz) / log(10.)) + 0.5);
-	$contour_int = (10 ** $base) / 10.0;
-	if ($dzz / $contour_int < 10)
-		{
-		$contour_int = $contour_int / 4;
-		}
-	elsif ($dzz / $contour_int < 20)
-		{
-		$contour_int = $contour_int / 2;
-		}
-	}
-if ($color_mode && $color_style == 1)
-	{
-	$ncolors_use = $ncolors;
-	}
-elsif ($color_mode)
-	{
-	$ncolors_use = $ncolors + 1;
-	}
-if ($color_mode && !$no_nice_color_int && $dzz > 0)
-	{
-	$start_int = $contour_int / 2;
-	$multiplier = int($dzz / ($ncolors_use - 1) / $start_int) + 1;
-	$color_int = $multiplier * $start_int;
-	if ($zmin < 0.0)
-		{
-		$color_start = $color_int * (int($zmin / $color_int) - 1);
-		}
-	else
-		{
-		$color_start = $color_int * int($zmin / $color_int);
-		}
-	$color_end = $color_start + $color_int * ($ncolors_use - 1);
-	if ($color_end < $zmax)
-		{
-		$multiplier = $multiplier + 1;
-		$color_int = $multiplier * $start_int;
-		}
-	if ($zmin < 0.0)
-		{
-		$color_start = $color_int * (int($zmin / $color_int) - 1);
-		}
-	else
-		{
-		$color_start = $color_int * int($zmin / $color_int);
-		}
-	$color_end = $color_start + $color_int * ($ncolors_use - 1);
-	}
-elsif ($color_mode)
-	{
-	$color_int = 1.02 * ($zmax - $zmin)/($ncolors_use - 1);
-	$color_start = $zmin - 0.01*($zmax - $zmin);
-	$color_end = $color_start + $color_int * ($ncolors_use - 1);
-	}
-
-# get null plane level
-if (!$grdview_null && $grdview_null_set)
-	{
-	$grdview_null = "$zmin/200/200/200";
-	}
-
-# get colors to use by interpolating defined color pallette
-if ($color_mode)
-	{
-	# set selected color pallette
-	eval "\@cptbr = \@cptbr$color_pallette;";
-	eval "\@cptbg = \@cptbg$color_pallette;";
-	eval "\@cptbb = \@cptbb$color_pallette;";
-
-	# interpolate colors
-	for ($i = 0; $i < $ncolors; $i++)
-		{
-		$xx = ($ncpt - 1) * $i / ($ncolors - 1);
-		$i1 = int($xx);
-		$i2 = $i1 + 1;
-		$red = $cptbr[$i1]
-			+ ($cptbr[$i2] - $cptbr[$i1])
-			* ($xx - $i1) / ($i2 - $i1);
-		$green = $cptbg[$i1]
-			+ ($cptbg[$i2] - $cptbg[$i1])
-			* ($xx - $i1) / ($i2 - $i1);
-		$blue = $cptbb[$i1]
-			+ ($cptbb[$i2] - $cptbb[$i1])
-			* ($xx - $i1) / ($i2 - $i1);
-		push (@cptr, $red);
-		push (@cptg, $green);
-		push (@cptb, $blue);
-		}
-	}
-
-# set contour control
-if (!$contour_control && $contour_mode)
-	{
-	$contour_control = $contour_int;
-	}
-
-# set pscoast control
-if ($coast_control
-	&& !$coast_wetfill
-	&& !$coast_dryfill
-	&& !$coast_pen
-	&& !$coast_boundary
-	&& !$coast_river)
-	{
-	$coast_dryfill = "200";
-	$coast_pen = "1p";
-	}
-if ($coast_control
-	&& !$coast_resolution)
-	{
-	$coast_resolution = "f";
-	}
-
-# if length scale bar requested check to see if map center needs to be defined
-if ($length_scale && $length_scale =~ /\S+center\S+/)
-        {
-        # add map lon lat (or x y) center to the length scale argument
-        ($a, $c) = $length_scale =~ /(\S+)center(\S+)/;
-        $xcen = 0.5 * ($xmin + $xmax);
-        $ycen = 0.5 * ($ymin + $ymax);
-        $b = "$xcen/$ycen";
-        $length_scale = "$a$b$c";
-        }
-
-# come up with the filenames
-$cmdfile = "$root.cmd";
-$psfile = "$root.ps";
-if ($color_mode && $file_cpt)
-	{
-	$cptfile = $file_cpt;
-	}
-else
-	{
-	$cptfile = "$root.cpt";
-	}
-$gmtfile = "gmt.conf\$\$";
-
-# set some gmtisms
-$first_gmt = 1;
-$first = "-X\$X_OFFSET -Y\$Y_OFFSET -K -V >! \$PS_FILE";
-$middle = "-K -O -V >> \$PS_FILE";
-$end = "-O -V >> \$PS_FILE";
-
-# set macro gmt default settings
-$gmt_def = "PROJ_LENGTH_UNIT/inch";
-push(@gmt_macro_defs, $gmt_def);
-$gmt_def = "PS_MEDIA/$page_gmt_name{$pagesize}";
-push(@gmt_macro_defs, $gmt_def);
-$gmt_def = "FONT_ANNOT_PRIMARY/$page_anot_font{$pagesize},Helvetica,black";
-push(@gmt_macro_defs, $gmt_def);
-$gmt_def = "FONT_ANNOT_SECONDARY/$page_anot_font{$pagesize},Helvetica,black";
-push(@gmt_macro_defs, $gmt_def);
-$gmt_def = "FONT_LABEL/$page_anot_font{$pagesize},Helvetica,black";
-push(@gmt_macro_defs, $gmt_def);
-$gmt_def = "FONT_TITLE/$page_header_font{$pagesize},Helvetica,black";
-push(@gmt_macro_defs, $gmt_def);
-$gmt_def = "PS_PAGE_ORIENTATION/LANDSCAPE";
-push(@gmt_macro_defs, $gmt_def);
-$gmt_def = "COLOR_BACKGROUND/black";
-push(@gmt_macro_defs, $gmt_def);
-$gmt_def = "COLOR_FOREGROUND/white";
-push(@gmt_macro_defs, $gmt_def);
-$gmt_def = "COLOR_NAN/white";
-push(@gmt_macro_defs, $gmt_def);
-$gmt_def = "FORMAT_GEO_MAP/$degree_format";
-push(@gmt_macro_defs, $gmt_def);
-
-# open the shellscript file
-if (!open(FCMD,">$cmdfile"))
-	{
-	print "\a";
-	die "Cannot open output file $cmdfile\nMacro $program_name aborted.\n";
-	}
-
-# write the shellscript header
-print FCMD "#! /bin/csh -f\n";
-print FCMD "#\n# Shellscript to create Postscript plot of data in grd file\n";
-print FCMD "# Created by macro $program_name\n";
-print FCMD "#\n# This shellscript created by following command line:\n";
-print FCMD "# $program_name $command_line\n";
-
-# Define shell variables
-print FCMD "#\n# Define shell variables used in this script:\n";
-print FCMD "set PS_FILE         = $psfile\n";
-print FCMD "set CPT_FILE        = $cptfile\n";
-print FCMD "set MAP_PROJECTION  = $projection\n";
-print FCMD "set MAP_SCALE       = $projection_pars\n";
-printf FCMD "set MAP_ZSCALE      = %1.5g\n", $map_zscale;
-print FCMD "set MAP_REGION      = $bounds_plot/$zmin/$zmax\n";
-printf FCMD "set X_OFFSET        = %1.5g\n", $xoffset;
-printf FCMD "set Y_OFFSET        = %1.5g\n", $yoffset;
-print FCMD "set DATA_FILE       = $file_data\n";
-print FCMD "set INTENSITY_FILE  = $file_intensity\n";
-
-# Set temporary GMT defaults
-print FCMD "#\n# Delete any existing gmt.conf file\n";
-print FCMD "if (-e gmt.conf) then\n";
-print FCMD "echo Deleting gmt.conf...\n";
-print FCMD "/bin/rm gmt.conf\n";
-print FCMD "endif\n";
-print FCMD "#\n# Set temporary GMT defaults\n";
-print FCMD "echo Setting temporary GMT defaults...\n";
-foreach $gmt_def (@gmt_macro_defs) {
-	($gmt_par, $gmt_var) = $gmt_def =~ /^([^\/]+)\/(.+)/;
-	print FCMD "gmt gmtset $gmt_par $gmt_var\n";
-	}
-
-# Reset GMT defaults as per user commands
-if (@gmt_defs)
-	{
-	print FCMD "#\n# Set user defined GMT defaults\n";
-	print FCMD "echo Setting user defined GMT defaults...\n";
-	foreach $gmt_def (@gmt_defs) {
-		($gmt_par, $gmt_var) = $gmt_def =~ /^([^\/]+)\/(.+)/;
-		print FCMD "gmt gmtset $gmt_par $gmt_var\n";
-		}
-	}
-
-# generate color pallette table file if needed
-if ($color_mode && !$file_cpt)
-	{
-	# set slope cpt
-	if ($color_mode == 4)
-		{
-		foreach $i (0 .. $ncolors - 1) {
-			$d1 = $magnitude * $i / ($ncolors - 1);
-			push(@hist, $d1);
-			}
-		}
-
-	# break data distribution up into equal size
-	# regions using grdhisteq on first data file
-	if ($stretch_color)
-		{
-		if ($verbose)
-			{
-			print "Running gmt module grdhisteq...\n";
-			}
-		$ncolors_minus = $ncolors - 1;
-		@grdhisteq = `grdhisteq $files_data[0] -C$ncolors_minus -D`;
-		foreach $d (@grdhisteq) {
-			($d1, $d2) = $d =~ /(\S+)\s+(\S+).*/;
-			if ($d2 > $d1)
-				{
-				push(@hist, $d1);
-				}
-			}
-		if ($d2 > $d1)
-			{
-			push(@hist, $d2);
-			}
-
-		# reset number of colors if grdhisteq returned fewer intervals
-		if (scalar(@hist) < $ncolors)
-			{
-			$ncolors = scalar(@hist);
-			}
-
-		# rescale hist values if needed
-		if ($data_scale)
-			{
-			foreach $i (0 .. $ncolors - 1) {
-				$hist[$i] = $data_scale * $hist[$i];
-				}
-			}
-
-		# make sure hist encompasses all data
-		if ($zmin < $hist[0])
-			{
-			$hist[0] = $zmin;
-			}
-		if ($zmax > $hist[scalar(@hist)-1])
-			{
-			$hist[scalar(@hist)-1] = $zmax;
-			}
-		$hist[0] = $hist[0] - 0.01*$dzz;
-		$hist[scalar(@hist)-1] =
-			$hist[scalar(@hist)-1] + 0.01*$dzz;
-		}
-
-	# generate cpt file
-	print FCMD "#\n# Make color pallette table file\n";
-	print FCMD "echo Making color pallette table file...\n";
-	if ($color_mode == 4 || $stretch_color)
-		{
-		$d1 = shift @hist;
-		}
-	else
-		{
-		$d1 = $color_start;
-		}
-	if ($color_style == 1 && $color_flip)
-		{
-		foreach $i (0 .. $ncolors - 2)
-			{
-			if ($color_mode == 4 || $stretch_color)
-				{
-				$d2 = shift @hist;
-				}
-			else
-				{
-				$d2 = $d1 + $color_int;
-				}
-			printf FCMD "echo %6g %3d %3d %3d %6g %3d %3d %3d",
-				$d1, at cptr[$i], at cptg[$i], at cptb[$i],
-				$d2, at cptr[$i+1], at cptg[$i+1], at cptb[$i+1];
-			if ($i == 0)
-				{
-				print FCMD " >";
-				}
-			else
-				{
-				print FCMD " >>";
-				}
-			print FCMD " \$CPT_FILE\n";
-			$d1 = $d2
-			}
-		}
-	elsif ($color_style == 1)
-		{
-		for ($i = $ncolors - 2; $i >= 0; $i--)
-			{
-			if ($color_mode == 4 || $stretch_color)
-				{
-				$d2 = shift @hist;
-				}
-			else
-				{
-				$d2 = $d1 + $color_int;
-				}
-			printf FCMD "echo %6g %3d %3d %3d %6g %3d %3d %3d",
-				$d1, at cptr[$i+1], at cptg[$i+1], at cptb[$i+1],
-				$d2, at cptr[$i], at cptg[$i], at cptb[$i];
-			if ($i == ($ncolors - 2))
-				{
-				print FCMD " >";
-				}
-			else
-				{
-				print FCMD " >>";
-				}
-			print FCMD " \$CPT_FILE\n";
-			$d1 = $d2
-			}
-		}
-	elsif ($color_flip)
-		{
-		foreach $i (0 .. $ncolors - 1)
-			{
-			if ($color_mode == 4 || $stretch_color)
-				{
-				$d2 = shift @hist;
-				}
-			else
-				{
-				$d2 = $d1 + $color_int;
-				}
-			printf FCMD "echo %6g %3d %3d %3d %6g %3d %3d %3d",
-				$d1, at cptr[$i], at cptg[$i], at cptb[$i],
-				$d2, at cptr[$i], at cptg[$i], at cptb[$i];
-			if ($i == 0)
-				{
-				print FCMD " >";
-				}
-			else
-				{
-				print FCMD " >>";
-				}
-			print FCMD " \$CPT_FILE\n";
-			$d1 = $d2
-			}
-		}
-	else
-		{
-		for ($i = $ncolors - 1; $i >= 0; $i--)
-			{
-			if ($color_mode == 4 || $stretch_color)
-				{
-				$d2 = shift @hist;
-				}
-			else
-				{
-				$d2 = $d1 + $color_int;
-				}
-			printf FCMD "echo %6g %3d %3d %3d %6g %3d %3d %3d",
-				$d1, at cptr[$i], at cptg[$i], at cptb[$i],
-				$d2, at cptr[$i], at cptg[$i], at cptb[$i];
-			if ($i == ($ncolors - 2))
-				{
-				print FCMD " >";
-				}
-			else
-				{
-				print FCMD " >>";
-				}
-			print FCMD " \$CPT_FILE\n";
-			$d1 = $d2
-			}
-		}
-	}
-
-# scale data if needed
-$file_use = "\$DATA_FILE";
-if ($data_scale)
-	{
-	printf FCMD "#\n# Rescale data\n";
-	printf FCMD "echo Rescaling data by $data_scale...\n";
-	printf FCMD "echo Running gmt module grdmath...\n";
-	printf FCMD "gmt grdmath \$DATA_FILE $data_scale x = \$DATA_FILE.scale\n";
-	$file_use = "\$DATA_FILE.scale";
-	}
-
-# get shading by illumination if needed
-# if ($color_mode == 2)
-# 	{
-# 	printf FCMD "#\n# Get shading array\n";
-# 	printf FCMD "echo Getting shading array...\n";
-# 	printf FCMD "echo Running gmt module grdgradient...\n";
-#	printf FCMD "gmt grdgradient $file_use -A$azimuth -G\$DATA_FILE.grad -N";
-#	if (!$gridprojected)
-#		{
-#		printf FCMD " -fg";
-#		}
-#	printf FCMD "\n";
-# 	printf FCMD "echo Running gmt module grdhisteq...\n";
-# 	printf FCMD "gmt grdhisteq \$DATA_FILE.grad -G\$DATA_FILE.eq -N\n";
-# 	printf FCMD "echo Running gmt module grdmath...\n";
-# 	printf FCMD "gmt grdmath \$DATA_FILE.eq $magnitude x = \$DATA_FILE.int\n";
-# 	printf FCMD "/bin/rm -f \$DATA_FILE.grad \$DATA_FILE.eq\n";
-# 	$file_shade = "\$DATA_FILE.int";
-# 	}
-
-# get shading by illumination if needed
-if ($color_mode == 2)
-	{
-	# Compute lighting vector from sun azimuth and elevation
-	$light_x = sin($DTR * $azimuth) * cos($DTR * $elevation);
-	$light_y = cos($DTR * $azimuth) * cos($DTR * $elevation);
-	$light_z = sin($DTR * $elevation);
-
-	printf FCMD "#\n# Get shading array\n";
-	printf FCMD "echo Getting shading array...\n";
-	printf FCMD "echo Running gmt module grdgradient to get x component of the gradient...\n";
-	printf FCMD "gmt grdgradient $file_use -A90 -G\$DATA_FILE.drvx";
-	if (!$gridprojected)
-		{
-		printf FCMD " -fg";
-		}
-	printf FCMD "\n";
-	printf FCMD "echo Running gmt module grdgradient to get y component of the gradient...\n";
-	printf FCMD "gmt grdgradient $file_use -A0 -G\$DATA_FILE.drvy";
-	if (!$gridprojected)
-		{
-		printf FCMD " -fg";
-		}
-	printf FCMD "\n";
-
-	printf FCMD "echo Running gmt module grdmath to get adjusted x gradient...\n";
-	printf FCMD "gmt grdmath \$DATA_FILE.drvx $magnitude MUL 10 MUL = \$DATA_FILE.magx\n";
-	printf FCMD "echo Running gmt module grdmath to get adjusted y gradient...\n";
-	printf FCMD "gmt grdmath \$DATA_FILE.drvy $magnitude MUL 10 MUL = \$DATA_FILE.magy\n";
-
-	printf FCMD "echo Running gmt module grdmath to get normalization factor...\n";
-	printf FCMD "gmt grdmath \$DATA_FILE.magx 2.0 POW \\\n";
-		printf FCMD "\t\$DATA_FILE.magy 2.0 POW ADD \\\n";
-		printf FCMD "\t1.0 ADD SQRT = \$DATA_FILE.denom\n";
-
-	printf FCMD "echo Running gmt module grdmath to get normalized x gradient...\n";
-	printf FCMD "gmt grdmath \$DATA_FILE.magx \$DATA_FILE.denom DIV = \$DATA_FILE.normx\n";
-	printf FCMD "echo Running gmt module grdmath to get normalized y gradient...\n";
-	printf FCMD "gmt grdmath \$DATA_FILE.magy \$DATA_FILE.denom DIV = \$DATA_FILE.normy\n";
-	printf FCMD "echo Running gmt module grdmath to get normalized z gradient...\n";
-	printf FCMD "gmt grdmath 1.0 \$DATA_FILE.denom DIV = \$DATA_FILE.normz\n";
-
-	printf FCMD "echo Running gmt module grdmath to apply lighting vector to normalized gradient...\n";
-	printf FCMD "gmt grdmath \$DATA_FILE.normx $light_x MUL \\\n";
-		printf FCMD "\t\$DATA_FILE.normy $light_y MUL ADD \\\n";
-		printf FCMD "\t\$DATA_FILE.normz $light_z MUL ADD -0.5 ADD = \$DATA_FILE.int\n";
-
-	printf FCMD "/bin/rm -f \$DATA_FILE.drvx \$DATA_FILE.drvy \\\n";
-	printf FCMD "\t\$DATA_FILE.magx \$DATA_FILE.magy \\\n";
-	printf FCMD "\t\$DATA_FILE.denom \$DATA_FILE.normx \\\n";
-	printf FCMD "\t\$DATA_FILE.normy \$DATA_FILE.normz\n";
-	$file_shade = "\$DATA_FILE.int";
-	}
-
-# get equalized shading by intensity file if needed
-if ($color_mode == 3 && $file_intensity && $stretch_shade)
-	{
-	printf FCMD "#\n# Get shading array\n";
-	printf FCMD "echo Getting shading array...\n";
-	printf FCMD "echo Running gmt module grdhisteq...\n";
-	printf FCMD "gmt grdhisteq \$INTENSITY_FILE -G\$INTENSITY_FILE.eq -N\n";
-	printf FCMD "echo Running gmt module grdmath...\n";
-	printf FCMD "gmt grdmath \$INTENSITY_FILE.eq $magnitude x = \$INTENSITY_FILE.int\n";
-	printf FCMD "/bin/rm -f \$INTENSITY_FILE.eq\n";
-	$file_shade = "\$INTENSITY_FILE.int";
-	}
-
-# get shading by unaltered intensity file
-elsif ($color_mode == 3 && $file_intensity)
-	{
-	$file_shade = "\$INTENSITY_FILE";
-	}
-
-# get color by slope magnitude if needed
-elsif ($color_mode >= 4)
-	{
-	printf FCMD "#\n# Get slope array\n";
-	printf FCMD "echo Getting slope array...\n";
-	printf FCMD "echo Running gmt module grdgradient to get x component of the gradient...\n";
-	printf FCMD "gmt grdgradient $file_use -A90 -G\$DATA_FILE.drvx";
-	if (!$gridprojected)
-		{
-		printf FCMD " -fg";
-		}
-	printf FCMD "\n";
-	printf FCMD "echo Running gmt module grdgradient to get y component of the gradient...\n";
-	printf FCMD "gmt grdgradient $file_use -A0 -G\$DATA_FILE.drvy";
-	if (!$gridprojected)
-		{
-		printf FCMD " -fg";
-		}
-	printf FCMD "\n";
-
-	printf FCMD "echo Running gmt module grdmath to get slope magnitude...\n";
-	printf FCMD "gmt grdmath \$DATA_FILE.drvx 2.0 POW \\\n";
-	printf FCMD "\t\$DATA_FILE.drvy 2.0 POW ADD SQRT \\\n";
-	if ($color_mode == 5)
-		{
-		printf FCMD "\t$magnitude MUL \\\n";
-		}
-	printf FCMD "\t= \$DATA_FILE.slope\n";
-
-	printf FCMD "/bin/rm -f \$DATA_FILE.drvx \$DATA_FILE.drvy \n";
-	$file_slope = "\$DATA_FILE.slope";
-	}
-
-# figure out labels
-$nlabels = 0;
-if ($labels)
-	{
-	@labels_split = split(/:/, $labels);
-	$nlabels = @labels_split;
-	if ($nlabels > 0)
-		{
-		$tlabel = shift(@labels_split);
-		$tlabel =~ s/\\/\//g;
-		}
-	if ($nlabels > 1)
-		{
-		$slabel = shift(@labels_split);
-		$slabel =~ s/\\/\//g;
-		}
-	}
-if ($nlabels < 1)
-	{
-	$tlabel = "Data File \$DATA_FILE";
-	}
-if ($nlabels < 2 && $zunits_s)
-	{
-	$slabel = "$zunits_s";
-	}
-elsif ($nlabels < 2)
-	{
-	$slabel = "Data Values";
-	}
-
-# set basemap axes annotation
-if ($tick_info)
-	{
-	$axes = "-B$tick_info";
-	}
-else
-	{
-	# figure out some reasonable tick intervals for the basemap
-	&GetBaseTick;
-        $axes = "-Bxy$base_tick -Bz$base_tick_z"
-	}
-if ($view_azimuth >= 0.0 && $view_azimuth < 90.0)
-        {
-        $axes = "$axes -BNEZ";
-        }
-elsif ($view_azimuth >= 90.0 && $view_azimuth < 180.0)
-        {
-        $axes = "$axes -BSEZ";
-        }
-elsif ($view_azimuth >= 180.0 && $view_azimuth < 270.0)
-        {
-        $axes = "$axes -BWSZ";
-        }
-elsif ($view_azimuth >= 270.0 && $view_azimuth < 360.0)
-        {
-        $axes = "$axes -BWNZ";
-        }
-if ($tlabel)
-	{
-        $axes = "$axes+t\"$tlabel\"";
-	}
-
-# do grdview plot
-if ($color_mode)
-	{
-	printf FCMD "#\n# Make 3D view\n";
-	printf FCMD "echo Running gmt module grdview...\n";
-	if ($color_mode == 4)
-		{
-		printf FCMD "gmt grdview $file_slope \\\n\t";
-		}
-	else
-		{
-		printf FCMD "gmt grdview $file_use \\\n\t";
-		}
-	printf FCMD "-J\$MAP_PROJECTION\$MAP_SCALE -Jz\$MAP_ZSCALE \\\n\t";
-	printf FCMD "-E$view_control \\\n\t";
-	printf FCMD "-R\$MAP_REGION \\\n\t";
-	if ($color_mode != 6)
-		{
-		printf FCMD "-C\$CPT_FILE \\\n\t";
-		}
-	if ($grdview_null)
-		{
-		printf FCMD "-N$grdview_null \\\n\t";
-		}
-	if ($grdview_zlevel)
-		{
-		printf FCMD "-Z$grdview_zlevel \\\n\t";
-		}
-	if ($color_mode == 2 || $color_mode == 3)
-		{
-		printf FCMD "-I$file_shade \\\n\t";
-		}
-	elsif ($color_mode == 5)
-		{
-		printf FCMD "-I$file_slope \\\n\t";
-		}
-	if ($file_drape)
-		{
-		printf FCMD "-G$file_drape \\\n\t";
-		}
-	if ($color_mode <= 5)
-		{
-		printf FCMD "-Qi$dpi \\\n\t";
-		}
-	elsif ($color_mode >= 6)
-		{
-		printf FCMD "-Qm \\\n\t";
-		}
-	if ($color_mode == 7)
-		{
-		printf FCMD "-W$grdview_contour_pen \\\n\t";
-		}
-	if ($portrait)
-	    {
-	    printf FCMD "-P ";
-	    }
-	if ($first_gmt == 1)
-		{
-		$first_gmt = 0;
-		printf FCMD "$first\n";
-		}
-	else
-		{
-		printf FCMD "$middle\n";
-		}
-	}
-
-# do coastline plots
-if ($coast_control)
-	{
-	printf FCMD "#\n# Make coastline data plot\n";
-	printf FCMD "echo Running gmt module pscoast...\n";
-	printf FCMD "gmt pscoast \\\n\t";
-	printf FCMD "-J\$MAP_PROJECTION\$MAP_SCALE -Jz\$MAP_ZSCALE \\\n\t";
-	printf FCMD "-E$view_control \\\n\t";
-	printf FCMD "-R\$MAP_REGION \\\n\t";
-	if ($coast_lakefill)
-		{
-		printf FCMD "-C$coast_lakefill \\\n\t";
-		}
-	if ($coast_resolution)
-		{
-		printf FCMD "-D$coast_resolution \\\n\t";
-		}
-	if ($coast_dryfill)
-		{
-		printf FCMD "-G$coast_dryfill \\\n\t";
-		}
-	if ($coast_river)
-		{
-		printf FCMD "-I$coast_river \\\n\t";
-		}
-	for ($i = 0; $i < scalar(@coast_boundaries); $i++)
-		{
-		printf FCMD "-N$coast_boundaries[$i] \\\n\t";
-		}
-	if ($coast_wetfill)
-		{
-		printf FCMD "-S$coast_wetfill \\\n\t";
-		}
-	if ($coast_pen)
-		{
-		printf FCMD "-W$coast_pen \\\n\t";
-		}
-	if ($portrait)
-		{
-		printf FCMD "-P ";
-		}
-	if ($first_gmt == 1)
-		{
-		$first_gmt = 0;
-		printf FCMD "$first\n";
-		}
-	else
-		{
-		printf FCMD "$middle\n";
-		}
-	}
-
-# do psscale plot
-if ($color_mode && $color_mode < 7 && $color_pallette < 5)
-	{
-	printf FCMD "#\n# Make color scale\n";
-	printf FCMD "echo Running gmt module psscale...\n";
-	printf FCMD "gmt psscale -C\$CPT_FILE \\\n\t";
-	printf FCMD "-D%.4f/%.4f/%.4f/%.4f%s \\\n\t",
-		$colorscale_offx,$colorscale_offy,
-		$colorscale_length,$colorscale_thick,
-		$colorscale_vh;
-	print FCMD "-B+l\"$slabel\" \\\n\t";
-#	if ($stretch_color)
-#		{
-#		print FCMD "-L \\\n\t";
-#		}
-	if ($portrait)
-		{
-		printf FCMD "-P ";
-		}
-	printf FCMD "$middle\n";
-	}
-
-# do pstext plot
-if (@text)
-	{
-	printf FCMD "#\n# Make text labels\n";
-	printf FCMD "echo Running gmt module pstext...\n";
-	printf FCMD "gmt pstext -J\$MAP_PROJECTION\$MAP_SCALE -Jz\$MAP_ZSCALE \\\n\t";
-	printf FCMD "-E$view_control \\\n\t";
-	printf FCMD "-R\$MAP_REGION \\\n\t";
-	printf FCMD "$middle <<EOT\n";
-	foreach $text_info (@text) {
-	    ($tx, $ty, $tsize, $tangle, $font, $just, $txt) = $text_info
-		=~ /^(\S+)\/(\S+)\/(\S+)\/(\S+)\/(\S+)\/(\S+)\/(.+)/;
-	    print "text_info:$text_info\n";
-	    print "txt:$txt\n";
-	    print FCMD "$tx $ty $tsize $tangle $font $just $txt\n";
-	    }
-	print FCMD "EOT\n";
-	}
-
-# do psbasemap plot
-printf FCMD "#\n# Make basemap\n";
-printf FCMD "echo Running gmt module psbasemap...\n";
-printf FCMD "gmt psbasemap -J\$MAP_PROJECTION\$MAP_SCALE -Jz\$MAP_ZSCALE \\\n\t";
-	printf FCMD "-E$view_control \\\n\t";
-printf FCMD "-R\$MAP_REGION \\\n\t";
-printf FCMD "-B$axes \\\n\t";
-if ($grdview_zlevel)
-	{
-	printf FCMD "-Z$grdview_zlevel \\\n\t";
-	}
-if ($length_scale)
-	{
-	printf FCMD "-L$length_scale \\\n\t";
-	}
-if ($unix_stamp_on && $unix_stamp)
-	{
-	printf FCMD "-U$unix_stamp \\\n\t";
-	}
-elsif ($unix_stamp_on)
-	{
-	printf FCMD "-U \\\n\t";
-	}
-if ($portrait)
-	{
-	printf FCMD "-P ";
-	}
-printf FCMD "$end\n";
-
-# delete surplus files
-print FCMD "#\n# Delete surplus files\n";
-print FCMD "echo Deleting surplus files...\n";
-print FCMD "/bin/rm -f gmt.conf\n";
-if (!$file_cpt)
-	{
-	print FCMD "/bin/rm -f \$CPT_FILE\n";
-	}
-if ($data_scale)
-	{
-	printf FCMD "/bin/rm -f $file_use\n";
-	}
-if ($file_slope)
-	{
-	printf FCMD "/bin/rm -f $file_slope\n";
-	}
-
-# display image on screen if desired
-print FCMD "#\n# Run $ps_viewer\n";
-if ($ps_viewer eq "xpsview")
-	{
-	if ($portrait)
-		{
-		$view_pageflag = "-ps $pagesize -maxp $xpsview_mem{$pagesize}";
-		}
-	elsif ($landscape)
-		{
-		$view_pageflag = "-ps $pagesize -or landscape -maxp $xpsview_mem{$pagesize}";
-		}
-	}
-elsif ($ps_viewer eq "pageview")
-	{
-	if ($portrait)
-		{
-		$view_pageflag = "-w $page_width_in{$pagesize} -h $page_height_in{$pagesize}";
-		}
-	elsif ($landscape)
-		{
-		$view_pageflag = "-w $page_height_in{$pagesize} -h $page_width_in{$pagesize}";
-		}
-	}
-elsif ($ps_viewer eq "ghostview")
-	{
-	if ($portrait)
-		{
-		$view_pageflag = "-portrait -media BBox";
-		}
-	elsif ($landscape)
-		{
-		$view_pageflag = "-landscape -media BBox";
-		}
-	}
-elsif ($ps_viewer eq "gv")
-	{
-	if ($portrait)
-		{
-		$pagescale = 11.0 / $page_height_in{$pagesize};
-		if ($pagescale > 1.0)
-			{
-			$pagescale = 1.0;
-			}
-		$view_pageflag = "--orientation=portrait --media=BBox -scale=$pagescale";
-		}
-	elsif ($landscape)
-		{
-		$pagescale = 11.0 / $page_width_in{$pagesize};
-		if ($pagescale > 1.0)
-			{
-			$pagescale = 1.0;
-			}
-		$view_pageflag = "--orientation=landscape --media=BBox -scale=$pagescale";
-		}
-	}
-elsif ($ps_viewer eq "ggv")
-	{
-	if ($portrait)
-		{
-		$view_pageflag = "--geometry=portrait";
-		}
-	elsif ($landscape)
-		{
-		$view_pageflag = "--geometry=landscape";
-		}
-	}
-elsif ($ps_viewer eq "evince")
-	{
-	$view_pageflag = " ";
-	}
-if ($no_view_ps)
-	{
-        print FCMD "#if (!(\$#argv > 0 && (\"\$1\" == \"-N\" || \"\$1\" == \"-n\"))) then\n";
-	print FCMD "#echo Running $ps_viewer in background...\n";
-	print FCMD "#$ps_viewer $view_pageflag \$PS_FILE &\n";
-        print FCMD "#endif\n";
-	}
-else
-	{
-        print FCMD "if (!(\$#argv > 0 && (\"\$1\" == \"-N\" || \"\$1\" == \"-n\"))) then\n";
-	print FCMD "echo Running $ps_viewer in background...\n";
-	print FCMD "$ps_viewer $view_pageflag \$PS_FILE &\n";
-        print FCMD "endif\n";
-	}
-
-# claim it's all over
-print FCMD "#\n# All done!\n";
-print FCMD "echo All done!\n";
-
-# now close the shellscript and make it executable
-close FCMD;
-chmod 0775, $cmdfile;
-
-# tell program status
-if ($verbose)
-	{
-	print "\nProgram Status:\n";
-	print "--------------\n";
-	print "\n  GMT Version:\n";
-	print "    Version $gmt_version\n";
-	print "\n  Plot Style:\n";
-	if ($color_mode == 1)
-		{
-		print "    3D Color Fill\n";
-		}
-	elsif ($color_mode == 2)
-		{
-		print "    3D Color Shaded Relief\n";
-		}
-	elsif ($color_mode == 3 && $file_intensity
-		&& $stretch_shade)
-		{
-		print "    3D Color Shaded by Equalized Intensity File\n";
-		}
-	elsif ($color_mode == 3 && $file_intensity)
-		{
-		print "    3D Color Shaded by Unaltered Intensity File\n";
-		}
-	elsif ($color_mode == 4)
-		{
-		print "    3D Color Fill of Slope Magnitude\n";
-		}
-	elsif ($color_mode == 5)
-		{
-		print "    3D Color Shaded by Slope Magnitude\n";
-		}
-	elsif ($color_mode == 6)
-		{
-		print "    3D Mesh\n";
-		}
-	elsif ($color_mode == 7)
-		{
-		print "    3D Mesh with Contours\n";
-		}
-	if ($contour_mode)
-		{
-		print "    Contour Plot\n";
-		}
-	if ($coast_control)
-		{
-		print "    Coastline\n";
-		}
-	if ($color_mode && $color_pallette < 5)
-		{
-		if ($colorscale_vh eq "v")
-			{
-			print "    Vertical Color Scale\n";
-			}
-		else
-			{
-			print "    Horizontal Color Scale\n";
-			}
-		}
-	if (@text)
-		{
-		print "    ", scalar(@text), " Text labels\n";
-		}
-	if ($length_scale)
-		{
-		print "    Map distance scale\n";
-		}
-	if ($unix_stamp_on && $unix_stamp)
-		{
-		print "    Unix time stamp: $unix_stamp\n";
-		}
-	elsif ($unix_stamp_on)
-		{
-		print "    Unix time stamp\n";
-		}
-	print "\n  Input Files:\n";
-	print "    Data GRD File:            $file_data\n";
-	if ($file_intensity)
-		{
-		print "    Intensity GRD File:       $file_intensity\n";
-		}
-	if ($file_drape)
-		{
-		print "    Drape GRD File:           $file_drape\n";
-		}
-	print "\n  Output Files:\n";
-	print "    Output plot name root:    $root\n";
-	print "    Color pallette table:     $cptfile\n";
-	print "    Plotting shellscript:     $cmdfile\n";
-	print "    Plot file:                $psfile\n";
-	print "\n  Plot Attributes:\n";
-	printf "    Plot width:               %.4f\n", $plot_width;
-	printf "    Plot height:              %.4f\n", $plot_height;
-	printf "    X-axis length:            %.4f\n", $plot_width_xaxis;
-	printf "    Y-axis length:            %.4f\n", $plot_height_yaxis;
-	print "    Page size:                $pagesize\n";
-	print "    Page width:               $width\n";
-	print "    Page height:              $height\n";
-	print "    Projection:               -J$projection$projection_pars\n";
-	print "    Z Projection:             -Jz$map_zscale\n";
-	print "    Vertical Exaggeration:    $exaggeration\n";
-	print "    Axes annotation:          $axes\n";
-	if ($portrait)
-		{
-		print "    Orientation:              portrait\n";
-		}
-	else
-		{
-		print "    Orientation:              landscape\n";
-		}
-	if ($color_mode)
-		{
-		print "    Number of colors:         $ncolors\n";
-		print "    Color Pallette:           ",
-			"@color_pallette_names[$color_pallette - 1]\n";
-		}
-	print "\n  Grid Data Attributes:\n";
-	if ($data_down)
-		{
-		print "    Data treated as positive downward\n";
-		}
-	if ($data_scale)
-		{
-		print "    Data scale factor:        $data_scale\n";
-		}
-	printf "    Longitude min max:        %9.4f  %9.4f\n",
-		$xmin, $xmax;
-	printf "    Latitude min max:         %9.4f  %9.4f\n",
-		$ymin, $ymax;
-	printf "    Data min max:             %9.4g  %9.4g\n",
-		$zmin, $zmax;
-	print "\n  Primary Grid Plotting Controls:\n";
-	if ($contour_mode)
-		{
-		print "    Contour control:          $contour_control\n";
-		}
-	if ($color_mode && $stretch_color)
-		{
-		printf "    Color start datum:        %f\n", $color_start;
-		printf "    Color end datum:          %f\n", $color_end;
-		printf "    Histogram stretch applied to color pallette\n";
-		}
-	elsif ($color_mode)
-		{
-		printf "    Color start datum:        %f\n", $color_start;
-		printf "    Color end datum:          %f\n", $color_end;
-		printf "    Color datum interval:     %f\n", $color_int;
-		}
-	if ($dpi && $color_mode)
-		{
-		printf "    Image dots-per-inch:      $dpi\n";
-		}
-	if ($color_mode == 3 && !$file_intensity)
-		{
-		printf "    Shading Magnitude:        %f\n", $magnitude;
-		}
-	elsif ($color_mode == 2)
-		{
-		printf "    Illumination Azimuth:     %f\n", $azimuth;
-		printf "    Illumination Elevation:   %f\n", $elevation;
-		printf "    Illumination Magnitude:   %f\n", $magnitude;
-		}
-	elsif ($color_mode == 4)
-		{
-		printf "    Slope Magnitude Magnitude:%f\n", $magnitude;
-		}
-	if ($coast_control)
-		{
-		print "\n  Coastline Plotting Controls:\n";
-		}
-	if ($coast_control && $coast_resolution)
-		{
-		printf "    Coastline resolution:     $coast_resolution\n";
-		}
-	if ($coast_control && $coast_pen)
-		{
-		printf "    Coastline pen:            $coast_pen\n";
-		}
-	if ($coast_control && $coast_wetfill)
-		{
-		printf "    Ocean fill:               $coast_wetfill\n";
-		}
-	if ($coast_control && $coast_lakefill)
-		{
-		printf "    Lake fill:                $coast_lakefill\n";
-		}
-	if ($coast_control && $coast_dryfill)
-		{
-		printf "    Land fill:                $coast_dryfill\n";
-		}
-	if ($coast_control && $coast_river)
-		{
-		printf "    Rivers:                   $coast_river\n";
-		}
-
-	if ($coast_control && $coast_boundaries)
-		{
-		for ($i = 0; $i < scalar(@coast_boundaries); $i++)
-			{
-			printf "    National Boundaries:      $coast_boundaries[$i]\n";
-			}
-		}
-	if ($length_scale || $grdview_null
-		|| $grdview_mesh_pen || $grdview_contour_pen)
-		{
-		print "\n  Miscellaneous Plotting Controls:\n";
-		}
-	if ($length_scale)
-		{
-		printf "    Length scale:             $length_scale\n";
-		}
-	if ($grdview_null)
-		{
-		printf "    Null plane level:         $grdview_null\n";
-		}
-	if ($grdview_mesh_pen)
-		{
-		printf "    Mesh pen attributes:      $grdview_mesh_pen\n";
-		}
-	if ($grdview_contour_pen)
-		{
-		printf "    Contour pen attributes:   $grdview_contour_pen\n";
-		}
-	if ($grdview_zlevel)
-		{
-		printf "    Z level:                  $grdview_zlevel\n";
-		}
-
-	print "\n  GMT Default Values Reset in Script:\n";
-	foreach $gmt_def (@gmt_macro_defs) {
-		($gmt_par, $gmt_var) = $gmt_def =~ /^([^\/]+)\/(.+)/;
-		printf "    %-25s %s\n", $gmt_par, $gmt_var;
-		}
-	foreach $gmt_def (@gmt_defs) {
-		($gmt_par, $gmt_var) = $gmt_def =~ /^([^\/]+)\/(.+)/;
-		printf "    $gmt_par : $gmt_var\n";
-		}
-	print "\n--------------\n";
-	}
-
-# print out final notes
-print "\nPlot generation shellscript <$cmdfile> created.\n";
-print "\nInstructions:\n";
-print "  Execute <$cmdfile> to generate Postscript plot <$psfile>.\n";
-if (!$no_view_ps)
-	{
-	print "  Executing <$cmdfile> also invokes $ps_viewer ";
-	print "to view the plot on the screen.\n";
-	}
-if ($verbose)
-	{
-	print "\n--------------\n\n";
-	}
-
-# execute shellscript if desired
-if ($execute)
-	{
-	if ($verbose)
-		{
-		print "Executing shellscript $cmdfile...\n";
-		}
-	system "$cmdfile &";
-	}
-
-exit 0;
-
-#-----------------------------------------------------------------------
-sub abs {
-
-	# make local variables
-	local ($abs);
-
-	# get the absolute value of the argument
-	if ($_[0] <= 0.0)
-		{
-		$abs = -$_[0];
-		}
-	else
-		{
-		$abs = $_[0];
-		}
-}
-
-#-----------------------------------------------------------------------
-sub min {
-
-	# make local variables
-	local ($min);
-
-	# get the minimum of the arguments
-	if ($_[0] < $_[1])
-		{
-		$min = $_[0];
-		}
-	else
-		{
-		$min = $_[1];
-		}
-	$min;
-}
-#-----------------------------------------------------------------------
-sub max {
-
-	# make local variables
-	local ($max);
-
-	# get the minimum of the arguments
-	if ($_[0] > $_[1])
-		{
-		$max = $_[0];
-		}
-	else
-		{
-		$max = $_[1];
-		}
-	$max;
-}
-#-----------------------------------------------------------------------
-sub GetDecimalDegrees {
-
-	# make local variables
-	local ($dec_degrees, $degrees, $minutes, $seconds);
-
-	# deal with dd:mm:ss format
-	if ($_[0] =~ /^\S+:\S+:\S+$/)
-		{
-		($degrees, $minutes, $seconds)
-			= $_[0] =~ /^(\S+):(\S+):(\S+)$/;
-		if ($degrees =~ /^-\S+/)
-			{
-			$dec_degrees = $degrees
-				- $minutes / 60.0
-				- $seconds / 3600.0;
-			}
-		else
-			{
-			$dec_degrees = $degrees
-				+ $minutes / 60.0
-				+ $seconds / 3600.0;
-			}
-		}
-	# deal with dd:mm format
-	elsif ($_[0] =~ /^\S+:\S+$/)
-		{
-		($degrees, $minutes)
-			= $_[0] =~ /^(\S+):(\S+)$/;
-		if ($degrees =~ /^-\S+/)
-			{
-			$dec_degrees = $degrees - $minutes / 60.0;
-			}
-		else
-			{
-			$dec_degrees = $degrees + $minutes / 60.0;
-			}
-		}
-
-	# value already in decimal degrees
-	else
-		{
-		$dec_degrees = $_[0];
-		}
-
-	# return decimal degrees;
-	$dec_degrees;
-}
-#-----------------------------------------------------------------------
-sub GetPageSize {
-
-# deal with location of color scale
-if ($scale_loc eq "l")
-	{
-	$space_top =    1.50 * $page_height_in{$pagesize}
-			    / $page_height_in{"a"};
-	$space_bottom = 0.75 * $page_height_in{$pagesize}
-			    / $page_height_in{"a"};
-	$space_left =   2.50 * $page_height_in{$pagesize}
-			    / $page_height_in{"a"};
-	$space_right =  1.00 * $page_height_in{$pagesize}
-			    / $page_height_in{"a"};
-	}
-elsif ($scale_loc eq "r")
-	{
-	$space_top =    1.50 * $page_height_in{$pagesize}
-			    / $page_height_in{"a"};
-	$space_bottom = 0.75 * $page_height_in{$pagesize}
-			    / $page_height_in{"a"};
-	$space_left =   1.00 * $page_height_in{$pagesize}
-			    / $page_height_in{"a"};
-	$space_right =  2.50 * $page_height_in{$pagesize}
-			    / $page_height_in{"a"};
-	}
-elsif ($scale_loc eq "t")
-	{
-	$space_top =    2.75 * $page_height_in{$pagesize}
-			    / $page_height_in{"a"};
-	$space_bottom = 0.75 * $page_height_in{$pagesize}
-			    / $page_height_in{"a"};
-	$space_left =   1.00 * $page_height_in{$pagesize}
-			    / $page_height_in{"a"};
-	$space_right =  1.00 * $page_height_in{$pagesize}
-			    / $page_height_in{"a"};
-	}
-else
-	{
-	$space_top =    1.50 * $page_height_in{$pagesize}
-			    / $page_height_in{"a"};
-	$space_bottom = 2.00 * $page_height_in{$pagesize}
-			    / $page_height_in{"a"};
-	$space_left =   1.00 * $page_height_in{$pagesize}
-			    / $page_height_in{"a"};
-	$space_right =  1.00 * $page_height_in{$pagesize}
-			    / $page_height_in{"a"};
-	}
-
-# set the relevent page width and height
-$width_max_landscape = $page_height_in{$pagesize}
-		- $space_left - $space_right;
-$height_max_landscape = $page_width_in{$pagesize}
-		- $space_bottom - $space_top;
-$width_max_portrait = $page_width_in{$pagesize}
-		- $space_left - $space_right;
-$height_max_portrait = $page_height_in{$pagesize}
-		- $space_bottom - $space_top;
-}
-#-----------------------------------------------------------------------
-sub GetProjection {
-
-	# get the map projection flag
-	($projection) = $map_scale =~ /^(\w)/;
-	($projection_pars) = $map_scale =~ /^$projection(\S+)/;
-
-	# see if plot scale or plot width defined
-	$use_scale = 0;
-	$use_width = 0;
-	$separator = "/";
-	$trial_value = 1.0;
-
-	# Cassini Projection
-	if ($projection eq "c")
-		{
-		($plot_scale) = $map_scale =~ /^c\S+\/\S+\/(\S+)$/;
-		$use_scale = 1;
-		}
-	elsif ($projection eq "C")
-		{
-		($plot_width) = $map_scale =~ /^C\S+\/\S+\/(\S+)$/;
-		$use_width = 1;
-		}
-
-	# Mercator Projection
-	elsif ($projection eq "m")
-		{
-		($plot_scale) = $map_scale =~ /^m(\S+)$/;
-		$use_scale = 1;
-		$separator = "";
-		}
-	elsif ($projection eq "M")
-		{
-		($plot_width) = $map_scale =~ /^M(\S+)$/;
-		$use_width = 1;
-		$separator = "";
-		}
-
-	# Oblique Mercator Projection
-	elsif ($projection eq "o")
-		{
-		if ($map_scale =~ /^oa\S+/)
-			{
-			($plot_scale) = $map_scale =~ /^oa\S+\/\S+\/\S+\/(\S+)$/;
-			}
-		elsif ($map_scale =~ /^ob\S+/)
-			{
-			($plot_scale) = $map_scale =~ /^ob\S+\/\S+\/\S+\/\S+\/(\S+)$/;
-			}
-		elsif ($map_scale =~ /^oc\S+/)
-			{
-			($plot_scale) = $map_scale =~ /^oc\S+\/\S+\/\S+\/\S+\/(\S+)$/;
-			}
-		$use_scale = 1;
-		}
-	elsif ($projection eq "O")
-		{
-		if ($map_scale =~ /^Oa\S+/)
-			{
-			($plot_width) = $map_scale =~ /^Oa\S+\/\S+\/\S+\/(\S+)$/;
-			}
-		elsif ($map_scale =~ /^Ob\S+/)
-			{
-			($plot_width) = $map_scale =~ /^Ob\S+\/\S+\/\S+\/\S+\/(\S+)$/;
-			}
-		elsif ($map_scale =~ /^Oc\S+/)
-			{
-			($plot_width) = $map_scale =~ /^Oc\S+\/\S+\/\S+\/\S+\/(\S+)$/;
-			}
-		$use_width = 1;
-		}
-
-	# Equidistant Cylindrical Projection
-	elsif ($projection eq "q")
-		{
-		($plot_scale) = $map_scale =~ /^q\S+\/(\S+)$/;
-		$use_scale = 1;
-		}
-	elsif ($projection eq "Q")
-		{
-		($plot_width) = $map_scale =~ /^Q\S+\/(\S+)$/;
-		$use_width = 1;
-		}
-
-	# Transverse Mercator Projection
-	elsif ($projection eq "t")
-		{
-		($plot_scale) = $map_scale =~ /^t\S+\/(\S+)$/;
-		$use_scale = 1;
-		}
-	elsif ($projection eq "T")
-		{
-		($plot_width) = $map_scale =~ /^T\S+\/(\S+)$/;
-		$use_width = 1;
-		}
-
-	# Universal Transverse Mercator Projection
-	elsif ($projection eq "u")
-		{
-		($plot_scale) = $map_scale =~ /^u\S+\/(\S+)$/;
-		$use_scale = 1;
-		}
-	elsif ($projection eq "U")
-		{
-		($plot_width) = $map_scale =~ /^U\S+\/(\S+)$/;
-		$use_width = 1;
-		}
-
-	# Basic Cylindrical Projection
-	elsif ($projection eq "y")
-		{
-		($plot_scale) = $map_scale =~ /^y\S+\/\S+\/(\S+)$/;
-		$use_scale = 1;
-		}
-	elsif ($projection eq "Y")
-		{
-		($plot_width) = $map_scale =~ /^Y\S+\/\S+\/(\S+)$/;
-		$use_width = 1;
-		}
-
-	# Lambert Azimuthal Projection
-	elsif ($projection eq "a")
-		{
-		($plot_scale) = $map_scale =~ /^a\S+\/\S+\/(\S+)$/;
-		$use_scale = 1;
-		$trial_value = "1:1";
-		$use_ratio = 1;
-		}
-	elsif ($projection eq "A")
-		{
-		($plot_width) = $map_scale =~ /^A\S+\/\S+\/(\S+)$/;
-		$use_width = 1;
-		}
-
-	# Equidistant Projection
-	elsif ($projection eq "e")
-		{
-		($plot_scale) = $map_scale =~ /^e\S+\/\S+\/(\S+)$/;
-		$use_scale = 1;
-		$trial_value = "1:1";
-		$use_ratio = 1;
-		}
-	elsif ($projection eq "E")
-		{
-		($plot_width) = $map_scale =~ /^E\S+\/\S+\/(\S+)$/;
-		$use_width = 1;
-		}
-
-	# Orthographic Projection
-	elsif ($projection eq "g")
-		{
-		($plot_scale) = $map_scale =~ /^g\S+\/\S+\/(\S+)$/;
-		$use_scale = 1;
-		$trial_value = "1:1";
-		$use_ratio = 1;
-		}
-	elsif ($projection eq "G")
-		{
-		($plot_width) = $map_scale =~ /^G\S+\/\S+\/(\S+)$/;
-		$use_width = 1;
-		}
-
-	# General Sterographic Projection
-	elsif ($projection eq "s")
-		{
-		($plot_scale) = $map_scale =~ /^s\S+\/\S+\/(\S+)$/;
-		$use_scale = 1;
-		$trial_value = "1:1";
-		$use_ratio = 1;
-		}
-	elsif ($projection eq "S")
-		{
-		($plot_width) = $map_scale =~ /^S\S+\/\S+\/(\S+)$/;
-		$use_width = 1;
-		}
-
-	# Albers Projection
-	elsif ($projection eq "b")
-		{
-		($plot_scale) = $map_scale =~ /^b\S+\/\S+\/\S+\/\S+\/(\S+)$/;
-		$use_scale = 1;
-		}
-	elsif ($projection eq "B")
-		{
-		($plot_width) = $map_scale =~ /^B\S+\/\S+\/\S+\/\S+\/(\S+)$/;
-		$use_width = 1;
-		}
-
-	# Lambert Conic Projection
-	elsif ($projection eq "l")
-		{
-		($plot_scale) = $map_scale =~ /^l\S+\/\S+\/\S+\/\S+\/(\S+)$/;
-		$use_scale = 1;
-		}
-	elsif ($projection eq "L")
-		{
-		($plot_width) = $map_scale =~ /^L\S+\/\S+\/\S+\/\S+\/(\S+)$/;
-		$use_width = 1;
-		}
-
-	# Hammer Projection
-	elsif ($projection eq "h")
-		{
-		($plot_scale) = $map_scale =~ /^h\S+\/(\S+)$/;
-		$use_scale = 1;
-		}
-	elsif ($projection eq "H")
-		{
-		($plot_width) = $map_scale =~ /^H\S+\/(\S+)$/;
-		$use_width = 1;
-		}
-
-	# Sinusoidal Projection
-	elsif ($projection eq "i")
-		{
-		($plot_scale) = $map_scale =~ /^i\S+\/(\S+)$/;
-		$use_scale = 1;
-		}
-	elsif ($projection eq "I")
-		{
-		($plot_width) = $map_scale =~ /^I\S+\/(\S+)$/;
-		$use_width = 1;
-		}
-
-	# Eckert VI Projection
-	elsif ($projection eq "k")
-		{
-		($plot_scale) = $map_scale =~ /^k\S+\/(\S+)$/;
-		$use_scale = 1;
-		}
-	elsif ($projection eq "K")
-		{
-		($plot_width) = $map_scale =~ /^K\S+\/(\S+)$/;
-		$use_width = 1;
-		}
-
-	# Robinson Projection
-	elsif ($projection eq "n")
-		{
-		($plot_scale) = $map_scale =~ /^n\S+\/(\S+)$/;
-		$use_scale = 1;
-		}
-	elsif ($projection eq "N")
-		{
-		($plot_width) = $map_scale =~ /^N\S+\/(\S+)$/;
-		$use_width = 1;
-		}
-
-	# Winkel Tripel Projection
-	elsif ($projection eq "r")
-		{
-		($plot_scale) = $map_scale =~ /^r\S+\/(\S+)$/;
-		$use_scale = 1;
-		}
-	elsif ($projection eq "R")
-		{
-		($plot_width) = $map_scale =~ /^R\S+\/(\S+)$/;
-		$use_width = 1;
-		}
-
-	# Mollweide Projection
-	elsif ($projection eq "w")
-		{
-		($plot_scale) = $map_scale =~ /^w\S+\/(\S+)$/;
-		$use_scale = 1;
-		}
-	elsif ($projection eq "W")
-		{
-		($plot_width) = $map_scale =~ /^W\S+\/(\S+)$/;
-		$use_width = 1;
-		}
-
-	# Linear Polar Projection
-	elsif ($projection eq "p")
-		{
-		($plot_scale) = $map_scale =~ /^p(\S+)$/;
-		$use_scale = 1;
-		$separator = "";
-		}
-	elsif ($projection eq "P")
-		{
-		($plot_width) = $map_scale =~ /^P(\S+)$/;
-		$use_width = 1;
-		$separator = "";
-		}
-
-	# Linear Projection
-	elsif ($projection eq "x")
-		{
-		if ($map_scale =~ /^xd$/)
-			{
-			$linear = 1;
-			chop($map_scale);
-			}
-		else
-			{
-			($plot_scale) = $map_scale =~ /^x(\S+)$/;
-			}
-		$use_scale = 1;
-		$separator = "";
-		}
-	elsif ($projection eq "X")
-		{
-		if ($map_scale =~ /^Xd$/)
-			{
-			$linear = 1;
-			chop($map_scale);
-			}
-		else
-			{
-			($plot_width) = $map_scale =~ /^X(\S+)$/;
-			}
-		$use_width = 1;
-		$separator = "";
-		}
-}
-#-----------------------------------------------------------------------
-sub GetBaseTick {
-
-	# figure out some reasonable tick intervals for the basemap
-	$base_tick_x = ($xmax - $xmin) / 3;
-	$base_tick_y = ($ymax - $ymin) / 3;
-	$base_tick = &min($base_tick_x, $base_tick_y);
-	if ($base_tick < 0.0002777777)
-		{
-		$base_tick = "1s";
-		}
-	elsif ($base_tick < 0.0005555555)
-		{
-		$base_tick = "2s";
-		}
-	elsif ($base_tick < 0.0013888889)
-		{
-		$base_tick = "5s";
-		}
-	elsif ($base_tick < 0.0027777778)
-		{
-		$base_tick = "10s";
-		}
-	elsif ($base_tick < 0.0041666667)
-		{
-		$base_tick = "15s";
-		}
-	elsif ($base_tick < 0.0083333333)
-		{
-		$base_tick = "30s";
-		}
-	elsif ($base_tick < 0.0166667)
-		{
-		$base_tick = "1m";
-		}
-	elsif ($base_tick < 0.0333333)
-		{
-		$base_tick = "2m";
-		}
-	elsif ($base_tick < 0.0833333)
-		{
-		$base_tick = "5m";
-		}
-	elsif ($base_tick < 0.1666667)
-		{
-		$base_tick = "10m";
-		}
-	elsif ($base_tick < 0.25)
-		{
-		$base_tick = "15m";
-		}
-	elsif ($base_tick < 0.5)
-		{
-		$base_tick = "30m";
-		}
-	elsif ($base_tick < 1.0)
-		{
-		$base_tick = "1";
-		}
-	elsif ($base_tick < 2.0)
-		{
-		$base_tick = "2";
-		}
-	elsif ($base_tick < 5.0)
-		{
-		$base_tick = "5";
-		}
-	elsif ($base_tick < 10.0)
-		{
-		$base_tick = "10";
-		}
-	elsif ($base_tick < 15.0)
-		{
-		$base_tick = "15";
-		}
-	elsif ($base_tick < 30.0)
-		{
-		$base_tick = "30";
-		}
-	elsif ($base_tick < 30.0)
-		{
-		$base_tick = "30";
-		}
-	elsif ($base_tick < 360.0)
-		{
-		$base_tick = "60";
-		}
-
-	# figure out some reasonable tick intervals for the basemap z axis
-	$base_tick_z = ($zmax - $zmin) / 5;
-}
-#-----------------------------------------------------------------------
-# This version of Getopts has been augmented to support multiple
-# calls to the same option. If an arg in argumentative is followed
-# by "+" rather than ":",  then the corresponding scalar will
-# be concatenated rather than overwritten by multiple calls to
-# the same arg.
-#
-# Usage:
-#      do Getopts('a:b+c'); # -a takes arg, -b concatenates args,
-#			    # -c does not take arg. Sets opt_* as a
-#                           # side effect.
-
-sub MBGetopts {
-    local($argumentative) = @_;
-    local(@args,$_,$first,$rest);
-    local($errs) = 0;
-
-    @args = split( / */, $argumentative );
-    while(@ARGV && ($_ = $ARGV[0]) =~ /^-(.)(.*)/) {
-	($first,$rest) = ($1,$2);
-	$pos = index($argumentative,$first);
-	if($pos >= $[) {
-	    if($args[$pos+1] eq ':') {
-		shift(@ARGV);
-		if($rest eq '') {
-		    ++$errs unless @ARGV;
-		    $rest = shift(@ARGV);
-		}
-		eval "\$opt_$first = \$rest;";
-		eval "\$flg_$first = 1;";
-	    }
-	    elsif($args[$pos+1] eq '+') {
-		shift(@ARGV);
-		if($rest eq '') {
-		    ++$errs unless @ARGV;
-		    $rest = shift(@ARGV);
-		}
-		if (eval "\$opt_$first") {
-		    eval "\$opt_$first = \$opt_$first
-				. \":::::::\" . \$rest;";
-		}
-		else {
-		    eval "\$opt_$first = \$rest;";
-		}
-		eval "\$flg_$first = 1;";
-	    }
-	    elsif($args[$pos+1] eq '%') {
-		shift(@ARGV);
-		if($rest ne '') {
-		    eval "\$opt_$first = \$rest;";
-		}
-		else {
-		    $rest = $ARGV[0];
-		    ($one) = $rest =~ /^-(.).*/;
-		    $pos = index($argumentative,$one);
-		    if(!$one || $pos < $[) {
-			eval "\$opt_$first = \$rest;";
-			shift(@ARGV);
-		    }
-		}
-		eval "\$flg_$first = 1;";
-	    }
-	    else {
-		eval "\$opt_$first = 1";
-		eval "\$flg_$first = 1;";
-		if($rest eq '') {
-		    shift(@ARGV);
-		}
-		else {
-		    $ARGV[0] = "-$rest";
-		}
-	    }
-	}
-	else {
-	    print STDERR "Unknown option: $first\n";
-	    ++$errs;
-	    if($rest ne '') {
-		$ARGV[0] = "-$rest";
-	    }
-	    else {
-		shift(@ARGV);
-	    }
-	}
-    }
-    $errs == 0;
-}
-#-----------------------------------------------------------------------
diff --git a/src/macros/mbm_grdcut b/src/macros/mbm_grdcut
deleted file mode 100755
index bb0fce1..0000000
--- a/src/macros/mbm_grdcut
+++ /dev/null
@@ -1,355 +0,0 @@
-#!/usr/bin/env perl
-#--------------------------------------------------------------------
-#    The MB-system:	mbm_arc2grd.perl	4/23/01
-#    $Id: mbm_grdcut 2227 2015-02-05 21:12:31Z caress $
-#
-#    Copyright (c) 2001-2015 by
-#    D. W. Caress (caress at mbari.org)
-#      Monterey Bay Aquarium Research Institute
-#      Moss Landing, CA
-#    and D. N. Chayes (dale at lamont.ldgo.columbia.edu)
-#      Lamont-Doherty Earth Observatory
-#      Palisades, NY  10964
-#
-#    See README file for copying and redistribution conditions.
-#--------------------------------------------------------------------
-#
-# Command:
-#   mbm_grdcut
-#
-# Purpose:
-#   Macro to painlessly cut out a region from a GMT grd grid file.
-#   The GMT program grdcut requires that one specify bounds which
-#   exactly match grid cell boundaries. Frequently, one just wants
-#   to extract an approximate region quickly, without calculating
-#   grid cell sizes and boundary locations. This macro does the
-#   the calculations and extracts the subregion closest to that
-#   specified by the user.
-#
-# Basic Usage:
-#   mbm_grdcut -Iarcfile -Ogrdfile [-H -V]
-#
-# Author:
-#   David W. Caress
-#   Monterey Bay Aquarium Research Institute
-#   Moss Landing, CA 95039
-#   April 23, 2001
-#   (at sea on the R/V Western Flyer about
-#    10 km off the Kohala coast of Hawaii)
-#
-# Version:
-#   $Id: mbm_grdcut 2227 2015-02-05 21:12:31Z caress $
-#
-# Revisions:
-#   $Log: mbm_grdcut.perl,v $
-#   Revision 5.6  2006/11/26 09:42:01  caress
-#   Making distribution 5.1.0.
-#
-#   Revision 5.5  2006/09/11 18:55:52  caress
-#   Changes during Western Flyer and Thomas Thompson cruises, August-September
-#   2006.
-#
-#   Revision 5.4  2006/02/10 01:27:40  caress
-#   Fixed parsing of grdinfo output to handle changes to GMT4.1.
-#
-#   Revision 5.3  2003/07/02 18:12:33  caress
-#   Release 5.0.0
-#
-#   Revision 5.2  2003/04/17 20:42:48  caress
-#   Release 5.0.beta30
-#
-#   Revision 5.1  2001/06/03 06:59:24  caress
-#   Release 5.0.beta01
-#
-#   Revision 5.0  2001/04/24 23:29:35  caress
-#   Initital revision.
-#
-#
-#
-
-$program_name = "mbm_grdcut";
-
-# Determine the GMT version
- at grdinfo = `grdinfo 2>&1`;
-while (@grdinfo)
-	{
-	$line = shift @grdinfo;
-	if ($line =~
-		/^grdinfo\s+(\S+)\s+\S+/)
-		{
-		($gmt_version) = $line =~
-			/^grdinfo\s+(\S+)\s+\S+/;
-		}
-	}
-
-# Deal with command line arguments
-&Getopts('I:i:O:o:R:r:VvHh');
-$ifile =    ($opt_I || $opt_i);
-$ofile =    ($opt_O || $opt_o);
-$help =     ($opt_H || $opt_h);
-$bounds =   ($opt_R || $opt_r);
-$verbose =  ($opt_V || $opt_v);
-$verbose += 1;
-
-#--------------------------------------------------------------------
-
-# print out help message if required
-if ($help)
-	{
-	print "\n$program_name:\n";
-	print "\nVersion: $Id: mbm_grdcut 2227 2015-02-05 21:12:31Z caress $\n";
- 	print "Macro to painlessly cut out a region from a GMT grd grid file.\n";
-	print "The GMT program grdcut requires that one specify bounds which\n";
-	print "exactly match grid cell boundaries. Frequently, one just wants\n";
-	print "to extract an approximate region quickly, without calculating\n";
-	print "grid cell sizes and boundary locations. This macro does the\n";
-	print "the calculations and extracts the subregion closest to that\n";
-	print "specified by the user.\n";
-	print "\t$program_name -Iinputfile -Ooutputfile  -Rw/e/s/n [-H -V]\n";
-	exit 0;
-	}
-
-# check for input file
-if (!$ifile)
-	{
-	print "\a";
-	die "No input file specified\nMacro $program_name aborted\n";
-	}
-elsif (!open(INP,"<$ifile"))
-	{
-	print "\a";
-	die "Specified input file $ifile cannot be opened\nMacro $program_name aborted\n";
-	}
-if (!$ofile)
-	{
-	print "\a";
-	die "No output file specified\nMacro $program_name aborted\n";
-	}
-if (!$bounds)
-	{
-	print "\a";
-	die "No output bounds specified\nMacro $program_name aborted\n";
-	}
-
-# get specified output bounds
-if ($bounds =~ /^\S+\/\S+\/\S+\/\S+$/)
-	{
-	($xmin_raw,$xmax_raw,$ymin_raw,$ymax_raw) = $bounds =~
-			/(\S+)\/(\S+)\/(\S+)\/(\S+)/;
-	$xminr = &GetDecimalDegrees($xmin_raw);
-	$xmaxr = &GetDecimalDegrees($xmax_raw);
-	$yminr = &GetDecimalDegrees($ymin_raw);
-	$ymaxr = &GetDecimalDegrees($ymax_raw);
-	}
-
-# Save old GMT default double format and set new format
-$line = `gmtdefaults -L | grep D_FORMAT`;
-($dformatsave) = $line =~ /D_FORMAT\s+=\s+(\S+)/;
-`gmtset D_FORMAT %.15lg`;
-
-# get limits of files using grdinfo
- at grdinfo = `grdinfo $ifile 2>&1`;
-while (@grdinfo)
-	{
-	$line = shift @grdinfo;
-	if ($line =~
-		/\S+\s+x_min:\s+\S+\s+x_max:\s+\S+\s+x_inc:\s+\S+\s+units:\s+.+\s+nx:\s+\S+/)
-		{
-		($xmin_f,$xmax_f,$xinc_f,$xunits,$xnx_d) = $line =~
-			/\S+\s+x_min:\s+(\S+)\s+x_max:\s+(\S+)\s+x_inc:\s+(\S+)\s+units:\s+(.+)\s+nx:\s+(\S+)/;
-		}
-	elsif ($line =~
-		/\S+\s+x_min:\s+\S+\s+x_max:\s+\S+\s+x_inc:\s+\S+\s+name:\s+.+\s+nx:\s+\S+/)
-		{
-		($xmin_f,$xmax_f,$xinc_f,$xunits,$xnx_d) = $line =~
-			/\S+\s+x_min:\s+(\S+)\s+x_max:\s+(\S+)\s+x_inc:\s+(\S+)\s+name:\s+(.+)\s+nx:\s+(\S+)/;
-		}
-	elsif ($line =~
-		/\S+\s+x_min:\s+(\S+)\s+x_max:\s+(\S+)\s+x_inc:/)
-		{
-		($xmin_f,$xmax_f) = $line =~
-			/\S+\s+x_min:\s+(\S+)\s+x_max:\s+(\S+)\s+x_inc:/;
-		}
-	if ($line =~ /\S+\s+y_min:\s+\S+\s+y_max:\s+\S+\s+y_inc:\s+\S+\s+units:\s+.+\s+ny:\s+\S+/)
-		{
-		($ymin_f,$ymax_f,$yinc_f,$yunits,$yny_d) = $line =~
-			/\S+\s+y_min:\s+(\S+)\s+y_max:\s+(\S+)\s+y_inc:\s+(\S+)\s+units:\s+(.+)\s+ny:\s+(\S+)/;
-		}
-	elsif ($line =~ /\S+\s+y_min:\s+\S+\s+y_max:\s+\S+\s+y_inc:\s+\S+\s+name:\s+.+\s+ny:\s+\S+/)
-		{
-		($ymin_f,$ymax_f,$yinc_f,$yunits,$yny_d) = $line =~
-			/\S+\s+y_min:\s+(\S+)\s+y_max:\s+(\S+)\s+y_inc:\s+(\S+)\s+name:\s+(.+)\s+ny:\s+(\S+)/;
-		}
-	elsif ($line =~ /\S+\s+y_min:\s+\S+\s+y_max:\s+\S+\s+y_inc:/)
-		{
-		($ymin_f,$ymax_f) = $line =~
-			/\S+\s+y_min:\s+(\S+)\s+y_max:\s+(\S+)\s+y_inc:/;
-		}
-	if ($line =~ /\S+\s+zmin:\s+\S+\s+zmax:\s+\S+\s+units:\s+\S+/)
-		{
-		($zmin_f,$zmax_f) = $line =~
-			/\S+\s+zmin:\s+(\S+)\s+zmax:\s+(\S+)\s+units:\s+\S+/;
-		}
-	elsif ($line =~ /\S+\s+zmin:\s+\S+\s+zmax:\s+\S+\s+name:\s+\S+/)
-		{
-		($zmin_f,$zmax_f) = $line =~
-			/\S+\s+zmin:\s+(\S+)\s+zmax:\s+(\S+)\s+name:\s+\S+/;
-		}
-	if ($line =~ /\S+\s+z_min:\s+\S+\s+z_max:\s+\S+\s+units:/)
-		{
-		($zmin_f,$zmax_f,$zunits_s) = $line =~
-			/\S+\s+z_min:\s+(\S+)\s+z_max:\s+(\S+)\s+units:\s+(.+)/;
-		}
-	elsif ($line =~ /\S+\s+z_min:\s+\S+\s+z_max:\s+\S+\s+name:/)
-		{
-		($zmin_f,$zmax_f,$zunits_s) = $line =~
-			/\S+\s+z_min:\s+(\S+)\s+z_max:\s+(\S+)\s+name:\s+(.+)/;
-		}
-	}
-
-# calculate acceptable output bounds
-$diffx = ($xminr - $xmin_f) / $xinc_f;
-$diffxn = int(($xminr - $xmin_f) / $xinc_f);
-print "diffx: $diffx $diffxn\n";
-$xminout = $xmin_f + $xinc_f * int(($xminr - $xmin_f) / $xinc_f);
-$xmaxout = $xmin_f + $xinc_f * int(($xmaxr - $xmin_f) / $xinc_f + 0.5);
-$yminout = $ymin_f + $yinc_f * int(($yminr - $ymin_f) / $yinc_f);
-$ymaxout = $ymin_f + $yinc_f * int(($ymaxr - $ymin_f) / $yinc_f + 0.5);
-$nxout = int((($xmaxout - $xminout) / $xinc_f) + 0.5) + 1;
-$nyout = int((($ymaxout - $yminout) / $yinc_f) + 0.5) + 1;
-
-# tell the world we got started
-if ($verbose)
-	{
-	print "\nProgram $program_name status:\n";
-	print "\tInput GRD file:         $ifile\n";
-	print "\tOutput GRD file:        $ofile\n";
-	print "\tInput Grid bounds:      $xmin_f $xmax_f  $ymin_f $ymax_f\n";
-	print "\tInput grid dimensions:  $nx  $ny\n";
-	print "\tGrid cell sizes:        $xinc_f  $yinc_f\n";
-	print "\tRequested Grid bounds:  $xminr $xmaxr  $yminr $ymaxr\n";
-	print "\tOutput Grid bounds:     $xminout $xmaxout  $yminout $ymaxout\n";
-	print "\tOutput grid dimensions: $nxout  $nyout\n";
-	}
-
-# run grdcut
-$cmd = "grdcut $ifile -G$ofile -R$xminout/$xmaxout/$yminout/$ymaxout -V";
-if ($verbose)
-	{
-	print "\tCommand: $cmd\n";
-	}
- at grdcut = `$cmd 2>&1`;
-if ($verbose)
-	{
-	while (@grdcut)
-		{
-		$line = shift @grdcut;
-		print "\tgrdcut output: $line";
-		}
-	}
-
-# reset the GMT default double format
-`gmtset D_FORMAT $dformatsave`;
-
-exit 0;
-
-#-----------------------------------------------------------------------
-sub GetDecimalDegrees {
-
-	# make local variables
-	local ($dec_degrees, $degrees, $minutes, $seconds);
-
-	# deal with dd:mm:ss format
-	if ($_[0] =~ /^\S+:\S+:\S+$/)
-		{
-		($degrees, $minutes, $seconds)
-			= $_[0] =~ /^(\S+):(\S+):(\S+)$/;
-		if ($degrees =~ /^-\S+/)
-			{
-			$dec_degrees = $degrees
-				- $minutes / 60.0
-				- $seconds / 3600.0;
-			}
-		else
-			{
-			$dec_degrees = $degrees
-				+ $minutes / 60.0
-				+ $seconds / 3600.0;
-			}
-		}
-	# deal with dd:mm format
-	elsif ($_[0] =~ /^\S+:\S+$/)
-		{
-		($degrees, $minutes)
-			= $_[0] =~ /^(\S+):(\S+)$/;
-		if ($degrees =~ /^-\S+/)
-			{
-			$dec_degrees = $degrees - $minutes / 60.0;
-			}
-		else
-			{
-			$dec_degrees = $degrees + $minutes / 60.0;
-			}
-		}
-
-	# value already in decimal degrees
-	else
-		{
-		$dec_degrees = $_[0];
-		}
-
-	# return decimal degrees;
-	$dec_degrees;
-}
-#-----------------------------------------------------------------------
-# This should be loaded from the library but its safer to
-# just include it....
-#
-;# getopts.pl - a better getopt.pl
-
-;# Usage:
-;#      do Getopts('a:bc');  # -a takes arg. -b & -c not. Sets opt_* as a
-;#                           #  side effect.
-
-sub Getopts {
-    local($argumentative) = @_;
-    local(@args,$_,$first,$rest);
-    local($errs) = 0;
-
-    @args = split( / */, $argumentative );
-    while(@ARGV && ($_ = $ARGV[0]) =~ /^-(.)(.*)/) {
-     ($first,$rest) = ($1,$2);
-     $pos = index($argumentative,$first);
-     if($pos >= $[) {
-         if($args[$pos+1] eq ':') {
-          shift(@ARGV);
-          if($rest eq '') {
-              ++$errs unless @ARGV;
-              $rest = shift(@ARGV);
-          }
-          eval "\$opt_$first = \$rest;";
-         }
-         else {
-          eval "\$opt_$first = 1";
-          if($rest eq '') {
-              shift(@ARGV);
-          }
-          else {
-              $ARGV[0] = "-$rest";
-          }
-         }
-     }
-     else {
-         print STDERR "Unknown option: $first\n";
-         ++$errs;
-         if($rest ne '') {
-          $ARGV[0] = "-$rest";
-         }
-         else {
-          shift(@ARGV);
-         }
-     }
-    }
-    $errs == 0;
-}
-#-----------------------------------------------------------------------
diff --git a/src/macros/mbm_grdinfo b/src/macros/mbm_grdinfo
deleted file mode 100755
index 6a3ac06..0000000
--- a/src/macros/mbm_grdinfo
+++ /dev/null
@@ -1,405 +0,0 @@
-#!/usr/bin/env perl
-#--------------------------------------------------------------------
-#    The MB-system:	mbm_grdinfo.perl	4/26/01
-#    $Id: mbm_grdinfo 2227 2015-02-05 21:12:31Z caress $
-#
-#    Copyright (c) 2001-2015 by
-#    D. W. Caress (caress at mbari.org)
-#      Monterey Bay Aquarium Research Institute
-#      Moss Landing, CA
-#    and D. N. Chayes (dale at lamont.ldgo.columbia.edu)
-#      Lamont-Doherty Earth Observatory
-#      Palisades, NY  10964
-#
-#    See README file for copying and redistribution conditions.
-#--------------------------------------------------------------------
-#
-# Command:
-#   mbm_grdinfo
-#
-# Purpose:
-#   Macro to get information regarding a GMT grd file when the
-#   region of interest is a subset of the area covered in the
-#   input file. If no bounds are specified, the program grdinfo
-#   is called directly.  If longitude and latitude bounds are
-#   specified, then the specified region is cut from the input
-#   file using the macro mbm_grdcut, and the information is
-#   obtained from the subset temporary grd file using grdinfo.
-#
-# Basic Usage:
-#   mbm_grdinfo -Igrdfile -H -V -Rw/e/s/n
-#
-# Author:
-#   David W. Caress
-#   Monterey Bay Aquarium Research Institute
-#   Moss Landing, CA 95039
-#   April 23, 2001
-#   (at sea on the R/V Western Flyer about
-#    10 km off the windward coast of Oahu)
-##
-# Version:
-#   $Id: mbm_grdinfo 2227 2015-02-05 21:12:31Z caress $
-#
-# Revisions:
-#   $Log: mbm_grdinfo.perl,v $
-#   Revision 1.6  2006/11/26 09:42:01  caress
-#   Making distribution 5.1.0.
-#
-#   Revision 1.5  2006/09/11 18:55:52  caress
-#   Changes during Western Flyer and Thomas Thompson cruises, August-September
-#   2006.
-#
-#   Revision 1.4  2006/02/10 01:27:40  caress
-#   Fixed parsing of grdinfo output to handle changes to GMT4.1.
-#
-#   Revision 1.3  2003/07/02 18:12:33  caress
-#   Release 5.0.0
-#
-#   Revision 1.2  2003/04/17 20:42:48  caress
-#   Release 5.0.beta30
-#
-#   Revision 1.1  2001/06/03 06:59:24  caress
-#   Initial revision
-#
-#   Revision 5.1  2001/03/22 21:05:45  caress
-#   Trying to make release 5.0.beta0
-#
-#
-#
-#
-$program_name = "mbm_grdinfo";
-
-# Determine the GMT version
- at grdinfo = `grdinfo 2>&1`;
-while (@grdinfo)
-	{
-	$line = shift @grdinfo;
-	if ($line =~
-		/^grdinfo\s+(\S+)\s+\S+/)
-		{
-		($gmt_version) = $line =~
-			/^grdinfo\s+(\S+)\s+\S+/;
-		}
-	}
-
-# Deal with command line arguments
-$command_line = "@ARGV";
-&MBGetopts('HhI:i:R:r:Vv');
-$help =    		($opt_H || $opt_h);
-$file_input =    	($opt_I || $opt_i);
-$bounds = 		($opt_R || $opt_r);
-$verbose = 		($opt_V || $opt_v);
-
-# print out help message if required
-if ($help)
-	{
-	print "\n$program_name:\n";
-	print "\nVersion: $Id: mbm_grdinfo 2227 2015-02-05 21:12:31Z caress $\n";
-	print "\nMacro to get information regarding a GMT grd file when the\n";
-	print "region of interest is a subset of the area covered in the\n";
-	print "input file. If no bounds are specified, the program grdinfo \n";
-	print "is called directly.  If longitude and latitude bounds are \n";
-	print "specified, then the specified region is cut from the input \n";
-	print "file using the macro mbm_grdcut, and the information is \n";
-	print "obtained from the subset temporary grd file using grdinfo.\n";
-	print "\nBasic Usage: \n";
-	print "\t$program_name mbm_grdinfo -Igrdfile [-H -V -Rw/e/s/n]\n";
-	exit 0;
-	}
-
-# check for input file
-if (!$file_input)
-	{
-	print "\a";
-	die "\nNo input file specified!\n$program_name aborted\n";
-	}
-elsif (! -r $file_input)
-	{
-	print "\a";
-	die "\nSpecified input file $file_data cannot be opened!\n$program_name aborted\n";
-	}
-
-# Save old GMT default double format and set new format
-$line = `gmtdefaults -L | grep D_FORMAT`;
-($dformatsave) = $line =~ /D_FORMAT\s+=\s+(\S+)/;
-`gmtset D_FORMAT %.15lg`;
-
-# get limits of file using grdinfo
-if ($bounds)
-	{
-	# get specified bounds
-	($xmin_raw,$xmax_raw,$ymin_raw,$ymax_raw) = $bounds =~
-			/(\S+)\/(\S+)\/(\S+)\/(\S+)/;
-	$xmin = &GetDecimalDegrees($xmin_raw);
-	$xmax = &GetDecimalDegrees($xmax_raw);
-	$ymin = &GetDecimalDegrees($ymin_raw);
-	$ymax = &GetDecimalDegrees($ymax_raw);
-
-	# get bounds from file
-	@rawgrdinfo = `grdinfo $file_input`;
-	while (@rawgrdinfo)
-		{
-		$line = shift @rawgrdinfo;
-		if ($line =~
-			/\S+\s+x_min:\s+\S+\s+x_max:\s+\S+\s+x_inc:\s+\S+\s+units:\s+.+\s+nx:\s+\S+/)
-			{
-			($xmin_f,$xmax_f,$xinc_f,$xunits,$xnx_d) = $line =~
-				/\S+\s+x_min:\s+(\S+)\s+x_max:\s+(\S+)\s+x_inc:\s+(\S+)\s+units:\s+(.+)\s+nx:\s+(\S+)/;
-			}
-		elsif ($line =~
-			/\S+\s+x_min:\s+\S+\s+x_max:\s+\S+\s+x_inc:\s+\S+\s+name:\s+.+\s+nx:\s+\S+/)
-			{
-			($xmin_f,$xmax_f,$xinc_f,$xunits,$xnx_d) = $line =~
-				/\S+\s+x_min:\s+(\S+)\s+x_max:\s+(\S+)\s+x_inc:\s+(\S+)\s+name:\s+(.+)\s+nx:\s+(\S+)/;
-			}
-		elsif ($line =~
-			/\S+\s+x_min:\s+(\S+)\s+x_max:\s+(\S+)\s+x_inc:/)
-			{
-			($xmin_f,$xmax_f) = $line =~
-				/\S+\s+x_min:\s+(\S+)\s+x_max:\s+(\S+)\s+x_inc:/;
-			}
-		if ($line =~ /\S+\s+y_min:\s+\S+\s+y_max:\s+\S+\s+y_inc:\s+\S+\s+units:\s+.+\s+ny:\s+\S+/)
-			{
-			($ymin_f,$ymax_f,$yinc_f,$yunits,$yny_d) = $line =~
-				/\S+\s+y_min:\s+(\S+)\s+y_max:\s+(\S+)\s+y_inc:\s+(\S+)\s+units:\s+(.+)\s+ny:\s+(\S+)/;
-			}
-		elsif ($line =~ /\S+\s+y_min:\s+\S+\s+y_max:\s+\S+\s+y_inc:\s+\S+\s+name:\s+.+\s+ny:\s+\S+/)
-			{
-			($ymin_f,$ymax_f,$yinc_f,$yunits,$yny_d) = $line =~
-				/\S+\s+y_min:\s+(\S+)\s+y_max:\s+(\S+)\s+y_inc:\s+(\S+)\s+name:\s+(.+)\s+ny:\s+(\S+)/;
-			}
-		elsif ($line =~ /\S+\s+y_min:\s+\S+\s+y_max:\s+\S+\s+y_inc:/)
-			{
-			($ymin_f,$ymax_f) = $line =~
-				/\S+\s+y_min:\s+(\S+)\s+y_max:\s+(\S+)\s+y_inc:/;
-			}
-		if ($line =~ /\S+\s+zmin:\s+\S+\s+zmax:\s+\S+\s+units:\s+\S+/)
-			{
-			($zmin_f,$zmax_f) = $line =~
-				/\S+\s+zmin:\s+(\S+)\s+zmax:\s+(\S+)\s+units:\s+\S+/;
-			}
-		elsif ($line =~ /\S+\s+zmin:\s+\S+\s+zmax:\s+\S+\s+name:\s+\S+/)
-			{
-			($zmin_f,$zmax_f) = $line =~
-				/\S+\s+zmin:\s+(\S+)\s+zmax:\s+(\S+)\s+name:\s+\S+/;
-			}
-		if ($line =~ /\S+\s+z_min:\s+\S+\s+z_max:\s+\S+\s+units:/)
-			{
-			($zmin_f,$zmax_f,$zunits_s) = $line =~
-				/\S+\s+z_min:\s+(\S+)\s+z_max:\s+(\S+)\s+units:\s+(.+)/;
-			}
-		elsif ($line =~ /\S+\s+z_min:\s+\S+\s+z_max:\s+\S+\s+name:/)
-			{
-			($zmin_f,$zmax_f,$zunits_s) = $line =~
-				/\S+\s+z_min:\s+(\S+)\s+z_max:\s+(\S+)\s+name:\s+(.+)/;
-			}
-		}
-
-	# check file bounds vs specified bounds
-	if ($xmin < $xmin_f)
-		{
-		$xmin = $xmin_f;
-		}
-	if ($xmax > $xmax_f)
-		{
-		$xmax = $xmax_f;
-		}
-	if ($ymin < $ymin_f)
-		{
-		$ymin = $ymin_f;
-		}
-	if ($ymax > $ymax_f)
-		{
-		$ymax = $ymax_f;
-		}
-	if ($xmin >= $xmin_f && $xmax <= $xmax_f
-		&& $ymin >= $ymin_f && $ymax <= $ymax_f
-		&& $xmax > $xmin && $ymax > $ymin)
-		{print "xmin: $xmin $xmin_f  xmax: $xmax $xmax_f  ymin: $ymin $ymin_f  ymax: $ymax $ymax_f";
-
-		# cut out desired file
-		$pid = getppid();
-		$file_grd = "$file_input" ."_grdcut_$pid";
-		if ($verbose > 0)
-			{
-			print "\nRunning mbm_grdcut...\n";
-			print "\tmbm_grdcut -I$file_input -O$file_grd -R$xmin/$xmax/$ymin/$ymax -V\n";
-			}
-		@grdcut = `mbm_grdcut -I$file_input -O$file_grd -R$xmin/$xmax/$ymin/$ymax -V 2>&1`;
-
-		if ($verbose > 0)
-			{
-			while (@grdcut)
-				{
-				$line = shift @grdcut;
-				print "mbm_grdcut output: $line";
-				}
-			}
-
-		@grdinfo = `grdinfo $file_grd 2>&1`;
-		@rminfo = `rm -f $file_grd`;
-
-		# if it doesn't work just grdinfo the whole file
-		if (!@grdinfo)
-			{
-			@grdinfo = `grdinfo $file_input 2>&1`;
-			}
-		}
-	else
-		{
-		@grdinfo = `grdinfo $file_input 2>&1`;
- 		}
-
- 	}
-else
-	{
-	@grdinfo = `grdinfo $file_input 2>&1`;
- 	}
-
-# now spit out grdinfo results
-while (@grdinfo)
-	{
-	$line = shift @grdinfo;
-	print $line;
-	}
-
-# reset the GMT default double format
-`gmtset D_FORMAT $dformatsave`;
-
-exit 0;
-
-#-----------------------------------------------------------------------
-sub GetDecimalDegrees {
-
-	# make local variables
-	local ($dec_degrees, $degrees, $minutes, $seconds);
-
-	# deal with dd:mm:ss format
-	if ($_[0] =~ /^\S+:\S+:\S+$/)
-		{
-		($degrees, $minutes, $seconds)
-			= $_[0] =~ /^(\S+):(\S+):(\S+)$/;
-		if ($degrees =~ /^-\S+/)
-			{
-			$dec_degrees = $degrees
-				- $minutes / 60.0
-				- $seconds / 3600.0;
-			}
-		else
-			{
-			$dec_degrees = $degrees
-				+ $minutes / 60.0
-				+ $seconds / 3600.0;
-			}
-		}
-	# deal with dd:mm format
-	elsif ($_[0] =~ /^\S+:\S+$/)
-		{
-		($degrees, $minutes)
-			= $_[0] =~ /^(\S+):(\S+)$/;
-		if ($degrees =~ /^-\S+/)
-			{
-			$dec_degrees = $degrees - $minutes / 60.0;
-			}
-		else
-			{
-			$dec_degrees = $degrees + $minutes / 60.0;
-			}
-		}
-
-	# value already in decimal degrees
-	else
-		{
-		$dec_degrees = $_[0];
-		}
-
-	# return decimal degrees;
-	$dec_degrees;
-}
-#-----------------------------------------------------------------------
-# This version of Getopts has been augmented to support multiple
-# calls to the same option. If an arg in argumentative is followed
-# by "+" rather than ":",  then the corresponding scalar will
-# be concatenated rather than overwritten by multiple calls to
-# the same arg.
-#
-# Usage:
-#      do Getopts('a:b+c'); # -a takes arg, -b concatenates args,
-#			    # -c does not take arg. Sets opt_* as a
-#                           # side effect.
-
-sub MBGetopts {
-    local($argumentative) = @_;
-    local(@args,$_,$first,$rest);
-    local($errs) = 0;
-
-    @args = split( / */, $argumentative );
-    while(@ARGV && ($_ = $ARGV[0]) =~ /^-(.)(.*)/) {
-	($first,$rest) = ($1,$2);
-	$pos = index($argumentative,$first);
-	if($pos >= $[) {
-	    if($args[$pos+1] eq ':') {
-		shift(@ARGV);
-		if($rest eq '') {
-		    ++$errs unless @ARGV;
-		    $rest = shift(@ARGV);
-		}
-		eval "\$opt_$first = \$rest;";
-		eval "\$flg_$first = 1;";
-	    }
-	    elsif($args[$pos+1] eq '+') {
-		shift(@ARGV);
-		if($rest eq '') {
-		    ++$errs unless @ARGV;
-		    $rest = shift(@ARGV);
-		}
-		if (eval "\$opt_$first") {
-		    eval "\$opt_$first = \$opt_$first
-				. \":\" . \$rest;";
-		}
-		else {
-		    eval "\$opt_$first = \$rest;";
-		}
-		eval "\$flg_$first = 1;";
-	    }
-	    elsif($args[$pos+1] eq '%') {
-		shift(@ARGV);
-		if($rest ne '') {
-		    eval "\$opt_$first = \$rest;";
-		}
-		else {
-		    $rest = $ARGV[0];
-		    ($one) = $rest =~ /^-(.).*/;
-		    $pos = index($argumentative,$one);
-		    if(!$one || $pos < $[) {
-			eval "\$opt_$first = \$rest;";
-			shift(@ARGV);
-		    }
-		}
-		eval "\$flg_$first = 1;";
-	    }
-	    else {
-		eval "\$opt_$first = 1";
-		eval "\$flg_$first = 1;";
-		if($rest eq '') {
-		    shift(@ARGV);
-		}
-		else {
-		    $ARGV[0] = "-$rest";
-		}
-	    }
-	}
-	else {
-	    print STDERR "Unknown option: $first\n";
-	    ++$errs;
-	    if($rest ne '') {
-		$ARGV[0] = "-$rest";
-	    }
-	    else {
-		shift(@ARGV);
-	    }
-	}
-    }
-    $errs == 0;
-}
-#-----------------------------------------------------------------------
diff --git a/src/macros/mbm_grdplot b/src/macros/mbm_grdplot
deleted file mode 100755
index 33908be..0000000
--- a/src/macros/mbm_grdplot
+++ /dev/null
@@ -1,4049 +0,0 @@
-#!/usr/bin/env perl
-#--------------------------------------------------------------------
-#    The MB-system:	mbm_grdplot.perl	8/6/95
-#    $Id: mbm_grdplot 2238 2015-04-15 06:00:52Z caress $
-#
-#    Copyright (c) 1993-2015 by
-#    D. W. Caress (caress at mbari.org)
-#      Monterey Bay Aquarium Research Institute
-#      Moss Landing, CA
-#    and D. N. Chayes (dale at lamont.ldgo.columbia.edu)
-#      Lamont-Doherty Earth Observatory
-#      Palisades, NY  10964
-#
-#    See README file for copying and redistribution conditions.
-#--------------------------------------------------------------------
-#
-# Command:
-#   mbm_grdplot
-#
-# Purpose:
-#   Macro to generate a shellscript of GMT commands which,
-#   when executed, will generate a Postscript plot of gridded
-#   data.  Several styles of plots can be generated, including
-#   color fill maps, contour maps, color fill maps overlaid with
-#   contours, shaded relief color maps, slope magnitude maps,
-#   coastline maps, text labels, and xy data
-#   in lines or symbols. Five different color schemes are included.
-#   The plot will be scaled to fit on the specified page size
-#   or, if the scale is user defined, the page size will be
-#   chosen in accordance with the plot size. The primary purpose
-#   of this macro is to allow the simple, semi-automated
-#   production of nice looking maps with a few command line
-#   arguments. For users seeking more control over the plot
-#   appearance, a number of additional optional arguments are
-#   provided. Truly ambitious users may edit the plot shellscript
-#   to take advantage of GMT capabilites not supported by this
-#   macro.
-#
-# Basic Usage:
-#   mbm_grdplot -Ifile [-Amagnitude[/azimuth/elevation] -C[contour_control]
-#            -Gcolor_mode -H -Kintensity_file -Oroot -Ppagesize
-#            -S[color/shade] -T -Uorientation -V
-#            -Wcolor_style[/pallette[/ncolors]] ]
-#
-# Additional Options:
-#            [-Btickinfo -Dflipcolor/flipshade -Fcontour_file
-#            -Jprojection[/scale | width] -Ltitle[:scale_label]
-#            -Mmisc -Q -Rw/e/s/n -X -Y -Zmin/max[/mode]]
-#
-# Miscellaneous Options:
-#            [-MGDgmtdef/value -MGFscale_loc";
-#            -MGL[f][x]lon0/lat0/slat/length[units][+llabel]
-#            -MGQdpi -MGSscalefactor -MGTx/y/size/angle/font/just/text
-#            -MGU[/dx/dy/][label] -MCAanot_int/[ffont_size][aangle][/r/g/b][o]]
-#            -MCGgap/width -MCQcut -MCT[+|-][gap/length][:LH] -MCWtype[pen]
-#            -MNFformat -MNIdatalist
-#            -MMM[pingnumber_tick/pingnumber_annot/pingnumber_tick_len]
-#            -MNN[time_tick/time_annot/date_annot/time_tick_len[/name_hgt] | F | FP]
-#            -MTCfill -MTDresolution -MTGfill -MTIriver[/pen]
-#            -MTNborder[/pen] -MTSfill -MTWpen
-#            -MXGfill -MXIxy_file -MXSsymbol/size -MXWpen]
-#
-# Author:
-#   David W. Caress
-#   Lamont-Doherty Earth Observatory
-#   Palisades, NY  10964
-#   October 19, 1994
-#
-# Version:
-#   $Id: mbm_grdplot 2238 2015-04-15 06:00:52Z caress $
-#
-#
-$program_name = "mbm_grdplot";
-
-# use the Posix module
-use POSIX;
-
-# set degree to radians conversion
-$DTR = 3.1415926 / 180.0;
-
-# set page size database
- at page_size_names = (
-	"a", "b", "c", "d", "e", "f", "e1",
-	"a0", "a1", "a2", "a3", "a4", "a5", "a6", "a7", "a8", "a9", "a10",
-	"b0", "b1", "b2", "b3", "b4", "b5", "b6", "b7", "b8", "b9", "b10",
-	"c0", "c1", "c2", "c3", "c4", "c5", "c6", "c7",
-	"m1", "m2", "m3", "m4", "m5", "m6");
-%page_width_in = (
-	"a",     8.50,   "b",    11.00,   "c",    17.00,   "d",    22.00,
-	"e",    34.00,   "f",    28.00,   "e1",   44.00,   "a0",   33.11,
-	"a1",   23.39,   "a2",   16.54,   "a3",   11.69,   "a4",    8.27,
-	"a5",    5.83,   "a6",    4.13,   "a7",    2.91,   "a8",    2.05,
-	"a9",    1.46,   "a10",   1.02,   "b0",   39.37,   "b1",   27.83,
-	"b2",   19.68,   "b3",   13.90,   "b4",    9.84,   "b5",    6.93,
-	"b6",    4.92,   "b7",    3.46,   "b8",    2.44,   "b9",    1.73,
-	"b10",   1.22,   "c0",   36.00,   "c1",   25.60,   "c2",   18.00,
-	"c3",   12.80,   "c4",    9.00,   "c5",    6.40,   "c6",    4.50,
-	"c7",    3.20,   "m1",   54.00,   "m2",   54.00,   "m3",   54.00,
-	"m4",   60.00,   "m5",   60.00,   "m6",   60.00);
-%page_height_in = (
-	"a",    11.00,   "b",    17.00,   "c",    22.00,   "d",    34.00,
-	"e",    44.00,   "f",    40.00,   "e1",   68.00,   "a0",   46.81,
-	"a1",   33.11,   "a2",   23.39,   "a3",   16.54,   "a4",   11.69,
-	"a5",    8.27,   "a6",    5.83,   "a7",    4.13,   "a8",    2.91,
-	"a9",    2.05,   "a10",   1.46,   "b0",   56.67,   "b1",   39.37,
-	"b2",   27.83,   "b3",   19.68,   "b4",   13.90,   "b5",    9.84,
-	"b6",    6.93,   "b7",    4.92,   "b8",    3.46,   "b9",    2.44,
-	"b10",   1.73,   "c0",   51.20,   "c1",   36.00,   "c2",   25.60,
-	"c3",   18.00,   "c4",   12.80,   "c5",    9.00,   "c6",    6.40,
-	"c7",    4.50,   "m1",   72.00,   "m2",   84.00,   "m3",   96.00,
-	"m4",   72.00,   "m5",   84.00,   "m6",   96.00);
-%page_anot_font = (
-	"a",     8,   "b",    12,   "c",    16,   "d",    24,
-	"e",    24,   "f",    24,   "e1",   24,   "a0",   24,
-	"a1",   24,   "a2",   16,   "a3",   12,   "a4",    8,
-	"a5",    6,   "a6",    6,   "a7",    6,   "a8",    4,
-	"a9",    4,   "a10",   4,   "b0",   24,   "b1",   24,
-	"b2",   16,   "b3",   16,   "b4",   12,   "b5",    8,
-	"b6",    6,   "b7",    4,   "b8",    4,   "b9",    4,
-	"b10",   4,   "c0",   24,   "c1",   24,   "c2",   16,
-	"c3",   12,   "c4",    8,   "c5",    6,   "c6",    6,
-	"c7",    6,   "m1",   24,   "m2",   24,   "m3",   24,
-	"m4",   24,   "m5",   24,   "m6",   24);
-%page_header_font =(
-	"a",    10,   "b",    15,   "c",    20,   "d",    30,
-	"e",    30,   "f",    30,   "e1",   30,   "a0",   30,
-	"a1",   30,   "a2",   20,   "a3",   15,   "a4",   10,
-	"a5",    8,   "a6",    8,   "a7",    8,   "a8",    5,
-	"a9",    5,   "a10",   5,   "b0",   30,   "b1",   30,
-	"b2",   20,   "b3",   20,   "b4",   15,   "b5",   10,
-	"b6",    8,   "b7",    5,   "b8",    5,   "b9",    5,
-	"b10",   5,   "c0",   30,   "c1",   30,   "c2",   20,
-	"c3",   15,   "c4",   10,   "c5",    8,   "c6",    8,
-	"c7",    8,   "m1",   30,   "m2",   30,   "m3",   30,
-	"m4",   30,   "m5",   30,   "m6",   30);
-%page_gmt_name =     (
-	"a",     "archA",   "b",     "archB",   "c",     "archC",   "d",     "archD",
-	"e",     "archE",   "f",     "B0",      "e1",    "B0",      "a0",    "A0",
-	"a1",    "A1",      "a2",    "A2",      "a3",    "A3",      "a4",    "A4",
-	"a5",    "A5",      "a6",    "A6",      "a7",    "A7",      "a8",    "A8",
-	"a9",    "A9",      "a10",   "A10",     "b0",    "B0",      "b1",    "B1",
-	"b2",    "B2",      "b3",    "B3",      "b4",    "B4",      "b5",    "B5",
-	"b6",    "A6",      "b7",    "A7",      "b8",    "A8",      "b9",    "A9",
-	"b10",   "A10",     "c0",    "B0",      "c1",    "B1",      "c2",    "B2",
-	"c3",    "B3",      "c4",    "B4",      "c5",    "B5",      "c6",    "B6",
-	"c7",    "B7",      "m1", "Custom_4241x5655",    "m2",   "Custom_4241x6578",
-	"m3",   "Custom_4241x7540",  "m4",   "Custom_4712x5655",
-	"m5",   "Custom_4712x6578",  "m6",   "Custom_4712x7540");
-%xpsview_mem =     (
-	"a",     "4m",   "b",     "6m",   "c",     "8m",   "d",    "12m",
-	"e",    "16m",   "f",    "16m",   "e1",   "16m",   "a0",   "16m",
-	"a1",   "12m",   "a2",    "8m",   "a3",    "6m",   "a4",    "4m",
-	"a5",    "4m",   "a6",    "4m",   "a7",    "4m",   "a8",    "4m",
-	"a9",    "4m",   "a10",   "4m",   "b0",   "16m",   "b1",   "12m",
-	"b2",    "8m",   "b3",    "8m",   "b4",    "6m",   "b5",    "4m",
-	"b6",    "4m",   "b7",    "4m",   "b8",    "4m",   "b9",    "4m",
-	"b10",   "4m",   "c0",   "16m",   "c1",   "12m",   "c2",    "8m",
-	"c3",    "6m",   "c4",    "4m",   "c5",    "4m",   "c6",    "4m",
-	"c7",    "4m",   "m1",   "16m",   "m2",   "16m",   "m3",   "16m",
-	"m4",   "16m",   "m5",   "16m",   "m6",   "16m");
-
-# set default number of colors
-$ncpt = 11;
-
-# define color pallettes
-
- at color_pallette_names = (   "Haxby Colors",
-			    "High Intensity Colors",
-			    "Low Intensity Colors",
-			    "Grayscale",
-			    "Uniform Gray",
-			    "Uniform Black",
-			    "Uniform White",
-			    "Sealevel");
-
-# original Haxby color pallette
-#	$ncolors = 15;
-#	@cptbr = (255, 255, 255, 255, 255, 240, 205, 138, 106,  87,  50,   0,  40,  21,  37);
-#	@cptbg = (255, 221, 186, 161, 189, 236, 255, 236, 235, 215, 190, 160, 127,  92,  57);
-#	@cptbb = (255, 171, 133,  68,  87, 121, 162, 174, 255, 255, 255, 255, 251, 236, 175);
-#                 use       use  use  use  use  use  use  use       use       use       use
-
-# color pallette 1 - Haxby Color Table
-	@cptbr1 = (255, 255, 255, 255, 240, 205, 138, 106,  50,  40,  37);
-	@cptbg1 = (255, 186, 161, 189, 236, 255, 236, 235, 190, 127,  57);
-	@cptbb1 = (255, 133,  68,  87, 121, 162, 174, 255, 255, 251, 175);
-
-# color pallette 2 - High Intensity Colors
-	@cptbr2 = (255, 255, 255, 255, 128,   0,   0,   0,   0, 128, 255);
-	@cptbg2 = (  0,  64, 128, 255, 255, 255, 255, 128,   0,   0,   0);
-	@cptbb2 = (  0,   0,   0,   0,   0,   0, 255, 255, 255, 255, 255);
-
-# color pallette 3 - Low Intensity Colors
-	@cptbr3 = (200, 194, 179, 141,  90,   0,   0,   0,   0,  90, 141);
-	@cptbg3 = (  0,  49,  90, 141, 179, 200, 141,  90,   0,   0,   0);
-	@cptbb3 = (  0,   0,   0,   0,   0,   0, 141, 179, 200, 179, 141);
-
-# color pallette 4 - Grayscale
-	@cptbr4 = (255, 230, 204, 179, 153, 128, 102,  77,  51,  26,   0);
-	@cptbg4 = (255, 230, 204, 179, 153, 128, 102,  77,  51,  26,   0);
-	@cptbb4 = (255, 230, 204, 179, 153, 128, 102,  77,  51,  26,   0);
-
-# color pallette 5 - Uniform Grayscale
-	@cptbr5 = (128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128);
-	@cptbg5 = (128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128);
-	@cptbb5 = (128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128);
-
-# color pallette 6 - Uniform Black
-	@cptbr6 = (  0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0);
-	@cptbg6 = (  0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0);
-	@cptbb6 = (  0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0);
-
-# color pallette 7 - Uniform White
-	@cptbr7 = (255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255);
-	@cptbg7 = (255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255);
-	@cptbb7 = (255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255);
-
-# color pallette 8 - Sealevel 1 (Haxby colors used below sealevel, browns above)
-	@cptbr8 = (250, 245, 240, 235, 230, 221, 212, 211, 210, 205, 200);
-	@cptbg8 = (250, 240, 230, 221, 212, 201, 190, 180, 170, 160, 150);
-	@cptbb8 = (120, 112, 104,  96,  88,  80,  72,  64,  56,  48,  40);
-
-# color pallette 9 - Sealevel 1 (Haxby colors used below sealevel, greens to browns above)
-	@cptbr9 = (255, 210, 170, 145, 120, 120, 104,  67,  33,   0,   0);
-	@cptbg9 = (255, 200, 160, 145, 130, 100, 107, 123, 140, 160, 230);
-	@cptbb9 = (100,  75,  50,  45,  40,  30,  24,   7,   0,   0,   0);
-
-# Determine the GMT version
- at grdinfo = `grdinfo 2>&1`;
-while (@grdinfo)
-	{
-	$line = shift @grdinfo;
-	if ($line =~
-		/^grdinfo\s+(\S+)\s+\S+/)
-		{
-		($gmt_version) = $line =~
-			/^grdinfo\s+(\S+)\s+\S+/;
-		}
-	}
-
-# Deal with command line arguments
-$command_line = "@ARGV";
-&MBGetopts('A:a:B:b:C%c%D%d%F:f:G%g%HhI:i:J:j:K:k:L:l:M+m+O:o:P:p:QqR:r:S%s%TtU:u:VvW:w:XxYyZ:z:');
-$shade_control = 	($opt_A || $opt_a);
-$tick_info = 		($opt_B || $opt_b);
-$contour_mode = 	($flg_C || $flg_c);
-$contour_control = 	($opt_C || $opt_c);
-$color_flip_mode = 	($flg_D || $flg_d);
-$color_flip_control = 	($opt_D || $opt_d);
-$contour_file=		($opt_F || $opt_f);
-$color_mode =   	($opt_G || $opt_g || $flg_G || $flg_g);
-$help =    		($opt_H || $opt_h);
-$file_data =    	($opt_I || $opt_i);
-$map_scale =    	($opt_J || $opt_j);
-$file_intensity =    	($opt_K || $opt_k);
-$labels =    		($opt_L || $opt_l);
-$misc = 		($opt_M || $opt_m);
-$root =    		($opt_O || $opt_o);
-$pagesize = 		($opt_P || $opt_p);
-$no_view_ps = 		($opt_Q || $opt_q);
-$bounds = 		($opt_R || $opt_r);
-$stretch_mode = 	($flg_S || $flg_s);
-$stretch_control = 	($opt_S || $opt_s);
-$coast_control = 	($opt_T || $opt_t);
-$orientation = 		($opt_U || $opt_u);
-$verbose = 		($opt_V || $opt_v);
-$color_control = 	($opt_W || $opt_w);
-$execute = 		($opt_X || $opt_x);
-$no_nice_color_int = 	($opt_Y || $opt_y);
-$zbounds = 		($opt_Z || $opt_z);
-
-# print out help message if required
-if ($help)
-	{
-	print "\n$program_name:\n";
-	print "\nVersion: $Id: mbm_grdplot 2238 2015-04-15 06:00:52Z caress $\n";
-	print "\nMacro to generate a shellscript of GMT commands which, \n";
-	print "when executed, will generate a Postscript plot of gridded \n";
-	print "data.  Several styles of plots can be generated, including \n";
-	print "color fill maps, contour maps, color fill maps overlaid with\n";
-	print "contours, shaded relief color maps, text labels, and xy data\n";
-	print "in lines or symbols. Five different color schemes are included.\n";
-	print "The plot will be scaled to fit on the specified page size \n";
-	print "or, if the scale is user defined, the page size will be \n";
-	print "chosen in accordance with the plot size. The primary purpose \n";
-	print "of this macro is to allow the simple, semi-automated \n";
-	print "production of nice looking maps with a few command line \n";
-	print "arguments. For users seeking more control over the plot \n";
-	print "appearance, a number of additional optional arguments are \n";
-	print "provided. Truly ambitious users may edit the plot shellscript \n";
-	print "to take advantage of GMT capabilites not supported by this \n";
-	print "macro.\n";
-	print "\nBasic Usage: \n";
-	print "\t$program_name -Ifile [-Amagnitude[/azimuth/elevation] -C[contour_control] \n";
-	print "\t\t-Gcolor_mode -H -Kintensity_file -Oroot -Ppagesize -S[color/shade] -T\n";
-	print "\t\t-Uorientation -V -Wcolor_style[/pallette[/ncolors]] ]\n";
-	print "Additional Options:\n";
-	print "\t\t[-Btickinfo -Dflipcolor/flipshade -Fcontour_file\n";
-	print "\t\t-Jprojection[/scale | width] -Ltitle[:scale_label]\n";
-	print "\t\t-Mmisc -Q -Rw/e/s/n -X -Y -Zmin/max[/mode] ]\n";
-	print "Miscellaneous Options:\n";
-	print "\t\t[-MGDgmtdef/value  -MGFscale_loc\n";
-	print "\t\t-MGL[f][x]lon0/lat0/slat/length[m]\n";
-	print "\t\t-MGQdpi -MGSscalefactor -MGTx/y/size/angle/font/just/text\n";
-	print "\t\t-MGU[/dx/dy/][label] -MCAanot_int/[ffont_size][aangle][/r/g/b][o]]\n";
-	print "\t\t-MCGgap/width -MCQcut -MCT[+|-][gap/length][:LH] -MCWtype[pen]\n";
-	print "\t\t-MNA[name_hgt[/P] | P] -MNFformat -MNIdatalist\n";
-	print "\t\t-MNN[time_tick/time_annot/date_annot/time_tick_len[/name_hgt] | F | FP]\n";
-	print "\t\t-MNP[pingnumber_tick/pingnumber_annot/pingnumber_tick_len]\n";
-	print "\t\t-MTCfill -MTDresolution -MTGfill -MTIriver[/pen]\n";
-	print "\t\t-MTNborder[/pen] -MTSfill -MTWpen\n";
-	print "\t\t-MXGfill -MXIxy_file -MXM -MXSsymbol/size -MXWpen]\n";
-	exit 0;
-	}
-
-# check for input file
-if (!$file_data)
-	{
-	print "\a";
-	die "\nNo input file specified!\n$program_name aborted\n";
-	}
-else
-	{
-	if ($file_data =~ /\S+=.+/)
-		{
-		($file_check) = $file_data =~ /(\S+)=.+/;
-		}
-	else
-		{
-		$file_check = $file_data;
-		}
-	if (! -r $file_check)
-		{
-		print "\a";
-		die "\nSpecified input file $file_check cannot be opened!\n$program_name aborted\n";
-		}
-	}
-if ($file_intensity)
-	{
-	if ($file_intensity =~ /\S+=.+/)
-		{
-		($file_check) = $file_intensity =~ /(\S+)=.+/;
-		}
-	else
-		{
-		$file_check = $file_intensity;
-		}
-	if (! -r $file_check)
-		{
-		print "\a";
-		die "\nSpecified intensity input file $file_check cannot be opened!\n$program_name aborted\n";
-		}
-	}
-if ($color_mode == 3 && !$file_intensity)
-	{
-	print "\a";
-	die "\nShading with intensity file set but no intensity input file specified!\n$program_name aborted\n";
-	}
-if ($contour_file)
-        {
-        if ($contour_file =~ /\S+=.+/)
-                {
-                ($file_check) = $contour_file =~ /(\S+)=.+/;
-                }
-        else
-                {
-                $file_check = $contour_file;
-                }
-        if (! -r $file_check)
-                {
-                print "\a";
-                die "\nSpecified contour input file $file_check cannot be opened!\n$program_name aborted\n";
-                }
-        }
-
-# parse misc commands
-if ($misc)
-	{
-	@misc_cmd = split(/:/, $misc);
-	foreach $cmd (@misc_cmd) {
-
-		# deal with general options
-		##############################
-
-		# set GMT default values
-		if ($cmd =~ /^[Gg][Dd]./)
-			{
-			($gmt_def) = $cmd =~
-				/^[Gg][Dd](\S+)/;
-			push(@gmt_defs, $gmt_def);
-			}
-
-		# set color scale location
-		if ($cmd =~ /^[Gg][Ff]./)
-			{
-			($scale_loc) = $cmd =~
-				/^[Gg][Ff](\S+)/;
-			}
-
-		# set map scale
-		if ($cmd =~ /^[Gg][Ll]./)
-			{
-			($length_scale) = $cmd =~
-				/^[Gg][Ll](\S+)/;
-			}
-
-		# set dpi for color image output
-		if ($cmd =~ /^[GG][Qq]./)
-			{
-			($dpi) = $cmd =~ /^[GG][Qq](.+)/;
-			}
-
-		# set data scaling
-		if ($cmd =~ /^[Gg][Ss]./)
-			{
-			($data_scale) = $cmd =~
-				/^[Gg][Ss](\S+)/;
-			}
-
-		# set text labels
-		if ($cmd =~ /^[Gg][Tt]./)
-			{
-			($tx, $ty, $tsize, $tangle, $font, $just, $txt)
-			    = $cmd
-			    =~ /^[Gg][Tt](\S+)\/(\S+)\/(\S+)\/(\S+)\/(\S+)\/(\S+)\/(.+)/;
-			if ($txt)
-			    {
-			    ($text_info) = $cmd =~
-				/^[Gg][Tt](.*)/;
-			    push(@text, $text_info);
-			    }
-			else
-			    {
-			    print "\nInvalid text label ignored: $cmd\n";
-			    }
-			}
-
-		# set unix time stamp
-		if ($cmd =~ /^[Gg][Uu]./)
-			{
-			($unix_stamp) = $cmd =~ /^[Gg][Uu](\S+)/;
-			$unix_stamp_on = 1;
-			}
-		elsif ($cmd =~ /^[Gg][Uu]/)
-			{
-			$unix_stamp_on = 1;
-			}
-
-		# deal with grdcontour options
-		##############################
-
-		# set contour annotation interval
-		if ($cmd =~ /^[Cc][Aa]./)
-			{
-			($contour_anot_int) = $cmd =~
-				/^[Cc][Aa](\S+)/;
-			}
-
-		# set contour gap specs
-		if ($cmd =~ /^[Cc][Gg]./)
-			{
-			($contour_gap) = $cmd =~
-				/^[Cc][Gg](\S+)/;
-			}
-
-		# set contour point lower limit
-		if ($cmd =~ /^[Cc][Qq]./)
-			{
-			($contour_cut) = $cmd =~
-				/^[Cc][Qq](\S+)/;
-			}
-
-		# set contour ticks
-		if ($cmd =~ /^[Cc][Tt]/)
-			{
-			$contour_tick_on = 1;
-			}
-		elsif ($cmd =~ /^[Cc][Tt]./)
-			{
-			($contour_tick) = $cmd =~
-				/^[Cc][Tt](\S+)/;
-			$contour_tick_on = 1;
-			}
-
-		# set contour pen attributes
-		if ($cmd =~ /^[Cc][Ww]./)
-			{
-			($contour_pen) = $cmd =~
-				/^[Cc][Ww](\S+)/;
-			}
-
-		# deal with swath navigation options
-		##############################
-
-		# set filename annotation
-		if ($cmd =~ /^[Nn][Aa]\S+\/P/)
-			{
-			($nav_name_hgt) = $cmd =~ /^[Nn][Aa](\S+)\/P/;
-			$name_mode = 1;
-			$name_perp = 1;
-			}
-		elsif ($cmd =~ /^[Nn][Aa]P/)
-			{
-			$name_mode = 1;
-			$name_perp = 1;
-			$nav_name_hgt = 0.15;
-			}
-		elsif ($cmd =~ /^[Nn][Aa]\S+/)
-			{
-			($nav_name_hgt) = $cmd =~ /^[Nn][Aa](\S+)/;
-			$name_mode = 1;
-			$name_perp = 0;
-			}
-		elsif ($cmd =~ /^[Nn][Aa]/)
-			{
-			$name_mode = 1;
-			$name_perp = 0;
-			$nav_name_hgt = 0.15;
-			}
-
-		# set swath file format id
-		if ($cmd =~ /^[Nn][Ff]./)
-			{
-			($swathformat) = $cmd =~
-				/^[Nn][Ff](\S+)/;
-			}
-
-		# set swath file datalist of which to plot navigation
-		if ($cmd =~ /^[Nn][Ii]./)
-			{
-			($swathnavdatalist) = $cmd =~
-				/^[Nn][Ii](\S+)/;
-			}
-
-		# set swath navigation parameters
-		if ($cmd =~ /^[Nn][Nn]./)
-			{
-			($navigation_control) = $cmd =~
-				/^[Nn][Nn](\S+)/;
-			$navigation_mode = 1;
-			}
-		elsif ($cmd =~ /^[Nn][Nn]/)
-			{
-			$navigation_mode = 1;
-			}
-
-		# set pingnumber annotation
-		if ($cmd =~ /^[Nn][Pp]./)
-			{
-			($pingnumber_control) = $cmd =~ /^[Nn][Pp](.+)/;
-			$pingnumber_mode = 1;
-			if ($pingnumber_control =~ /\S+\/\S+\/\S+/)
-				{
-				($pingnumber_tick, $pingnumber_annot, $pingnumber_tick_len)
-						= $pingnumber_control =~  /(\S+)\/(\S+)\/(\S+)/;
-				}
-			elsif ($pingnumber_control =~ /\S+\/\S+/)
-				{
-				($pingnumber_tick, $pingnumber_annot)
-						= $pingnumber_control =~  /(\S+)\/(\S+)/;
-				$pingnumber_tick_len = 0.10;
-				}
-			elsif ($pingnumber_control =~ /\S+/)
-				{
-				($pingnumber_tick) = $pingnumber_control =~  /(\S+)/;
-				$pingnumber_tick_len = 0.10;
-				$pingnumber_annot = 100;
-				}
-			}
-		elsif ($cmd =~ /^[Nn][Pp]/)
-			{
-			$pingnumber_mode = 1;
-			$pingnumber_tick_len = 0.10;
-			$pingnumber_annot = 100;
-			$pingnumber_tick = 50;
-			}
-
-		# deal with pscoast options
-		##############################
-
-		# set pscoast lake fill
-		if ($cmd =~ /^[Tt][Cc]./)
-			{
-			($coast_lakefill) = $cmd =~ /^[Tt][Cc](.+)/;
-			$coast_control = 1;
-			}
-
-		# set pscoast resolution
-		if ($cmd =~ /^[Tt][Dd]./)
-			{
-			($coast_resolution) = $cmd =~ /^[Tt][Dd](.+)/;
-			$coast_control = 1;
-			}
-
-		# set pscoast dry fill
-		if ($cmd =~ /^[Tt][Gg]./)
-			{
-			($coast_dryfill) = $cmd =~ /^[Tt][Gg](.+)/;
-			$coast_control = 1;
-			}
-
-		# set pscoast rivers
-		if ($cmd =~ /^[Tt][Ii]./)
-			{
-			($coast_river) = $cmd =~ /^[Tt][Ii](.+)/;
-			$coast_control = 1;
-			}
-
-		# set pscoast national boundaries
-		if ($cmd =~ /^[Tt][Nn]./)
-			{
-			($coast_boundary) = $cmd =~ /^[Tt][Nn](.+)/;
-			push(@coast_boundaries, $coast_boundary);
-			$coast_control = 1;
-			}
-
-		# set pscoast wet fill
-		if ($cmd =~ /^[Tt][Ss]./)
-			{
-			($coast_wetfill) = $cmd =~ /^[Tt][Ss](.+)/;
-			$coast_control = 1;
-			}
-
-		# set pscoast coastline pen
-		if ($cmd =~ /^[Tt][Ww]./)
-			{
-			($coast_pen) = $cmd =~ /^[Tt][Ww](.+)/;
-			$coast_control = 1;
-			}
-
-		# deal with psxy options
-		##############################
-
-		# set xy symbol fill
-		if ($cmd =~ /^[Xx][Gg]./)
-			{
-			($xyfill) = $cmd =~ /^[Xx][Gg](.+)/;
-			}
-
-		# set xy data to be plotted
-		if ($cmd =~ /^[Xx][Ii]./)
-			{
-			($xyfile) = $cmd =~ /^[Xx][Ii](.+)/;
-			push(@xyfiles, $xyfile);
-			if (!$xysymbol)
-				{
-				$xysymbol = "N";
-				}
-			if (!$xyfill)
-				{
-				$xyfill = "N";
-				}
-			if (!$xysegment)
-				{
-				$xysegment = "N";
-				}
-			if (!$xysegchar)
-				{
-				$xysegchar = ">";
-				}
-			if (!$xypen)
-				{
-				$xypen = "N";
-				}
-			push(@xysymbols, $xysymbol);
-			push(@xyfills, $xyfill);
-			push(@xysegments, $xysegment);
-			push(@xysegchars, $xysegchar);
-			push(@xypens, $xypen);
-			}
-
-		# set xy segment
-		if ($cmd =~ /^[Xx][Mm]/)
-			{
-			if ($cmd =~ /^[Xx][Mm]\S/)
-				{
-				($xysegchar) = $cmd =~ /^[Xx][Mm](\S)/
-				}
-			else
-				{
-				$xysegchar = ">";
-				}
-			if (!$xysegment)
-				{
-				$xysegment = "Y";
-				}
-			elsif ($xysegment ne "N")
-				{
-				$xysegment = "N";
-				}
-			else
-				{
-				$xysegment = "Y";
-				}
-			}
-
-		# set xy symbol
-		if ($cmd =~ /^[Xx][Ss]./)
-			{
-			($xysymbol) = $cmd =~ /^[Xx][Ss](.+)/;
-			}
-
-		# set xy pen
-		if ($cmd =~ /^[Xx][Ww]./)
-			{
-			($xypen) = $cmd =~ /^[Xx][Ww](.+)/;
-			}
-		}
-	}
-
-# set plot mode
-if (!$root)
-	{
-	if ($file_data =~ /.=./)
-		{
-		($root) = $file_data =~ /^(\S+)=./;
-		}
-	else
-		{
-		$root = $file_data;
-		}
-	}
-if (!$color_mode && !$contour_mode)
-	{
-	$color_mode = 1;
-	}
-if ($shade_control)
-	{
-	if ($shade_control =~ /^(\S+)\/(\S+)\/(\S+)/)
-		{
-		($magnitude, $azimuth, $elevation) =
-			$shade_control =~ /^(\S+)\/(\S+)\/(\S+)/;
-		}
-	elsif ($shade_control =~ /^(\S+)\/(\S+)/)
-		{
-		($magnitude, $azimuth) =
-			$shade_control =~ /^(\S+)\/(\S+)/;
-		}
-	elsif ($shade_control =~ /^(\S+).*/)
-		{
-		($magnitude) =
-			$shade_control =~ /^(\S+).*/;
-		}
-	}
-if ($file_intensity && !$color_mode)
-	{
-	$color_mode = 3;
-	}
-if ($color_mode == 2 && !$azimuth)
-	{
-	$azimuth = 0;
-	}
-if ($color_mode == 2 && !$magnitude)
-	{
-	$magnitude = 1.0;
-	}
-elsif ($color_mode == 3 && !$magnitude)
-	{
-	$magnitude = -0.4;
-	}
-if ($color_mode == 2 && !$elevation)
-	{
-	$elevation = 30.0;
-	}
-if ($color_mode >= 4 && !$magnitude)
-	{
-	$magnitude = 1.0;
-	}
-if ($color_control)
-	{
-	if (-e $color_control)
-		{
-		$file_cpt = $color_control;
-		$color_style = 1;
-		$color_pallette = 1;
-		$ncolors = $ncpt;
-		}
-	elsif ($color_control =~ /\S+\/\S+\/\S+/)
-		{
-		($color_style, $color_pallette, $ncolors)
-			= $color_control =~  /(\S+)\/(\S+)\/(\S+)/;
-		if ($color_pallette < 1
-			|| $color_pallette > 9)
-			{
-			$color_pallette = 1;
-			}
-		if ($ncolors < 2)
-			{
-			$ncolors = 2;
-			}
-		}
-	elsif ($color_control =~ /\S+\/\S+/)
-		{
-		($color_style, $color_pallette) = $color_control
-			=~  /(\S+)\/(\S+)/;
-		if ($color_pallette < 1
-			|| $color_pallette > 9)
-			{
-			$color_pallette = 1;
-			}
-		$ncolors = $ncpt;
-		}
-	else
-		{
-		$color_style = $color_control;
-		$color_pallette = 1;
-		$ncolors = $ncpt;
-		}
-	}
-else
-	{
-	$color_style = 1;
-	$color_pallette = 1;
-	$ncolors = $ncpt;
-	}
-if ($color_flip_control)
-	{
-	if ($color_flip_control =~ /^\S+\/\S+/)
-		{
-		($color_flip, $shade_flip) = $color_flip_control
-			=~ /^(\S+)\/(\S+)/;
-		}
-	elsif ($color_flip_control =~ /^\S+/)
-		{
-		($color_flip) = $color_flip_control
-			=~ /^(\S+)/;
-		}
-	}
-elsif ($color_flip_mode)
-	{
-	$color_flip = 1;
-	}
-if ($color_mode && $shade_flip)
-	{
-	$magnitude = -1 * $magnitude;
-	}
-if ($stretch_control)
-	{
-	if ($stretch_control =~ /^\S+\/\S+/)
-		{
-		($stretch_color, $stretch_shade) = $stretch_control
-			=~ /^(\S+)\/(\S+)/;
-		}
-	elsif ($stretch_control =~ /^\S+/)
-		{
-		($stretch_color) = $stretch_control
-			=~ /^(\S+)/;
-		}
-	}
-elsif ($stretch_mode)
-	{
-	$stretch_color = 1;
-	}
-if ($contour_file && !$contour_mode)
-	{
-	$contour_mode = 1;
-	}
-
-# set page size
-if (!$pagesize)
-	{
-	$pagesize = "a";
-	}
-else
-	{
-	$pagesize =~ tr/A-Z/a-z/;
-	if (!$page_width_in{$pagesize})
-		{
-		$pagesize = "a";
-		}
-	}
-
-# use mbdefaults to get the current system default postscript viewer
-$ps_viewer = "ghostview";
- at mbdefaults = `mbdefaults`;
-while (@mbdefaults)
-        {
-        $line = shift @mbdefaults;
-        if ($line =~ /ps viewer:\s+(\S+)/)
-                {
-                ($ps_viewer) = $line =~ /ps viewer:\s+(\S+)/;
-                 }
-        }
-
-# check environment variable
-if ($ENV{"MB_PS_VIEWER"})
-	{
-	$ps_viewer = $ENV{"MB_PS_VIEWER"};
-	}
-
-# see if data file is a grd file or a list of grdfiles
- at grdinfo = `grdinfo $file_data 2>&1`;
-if ($? != 0)
-	{
-	print "ERROR: 'grdinfo $file_data' failed.\n$program_name aborted\n";
-	exit 1;
-	}
-while (@grdinfo)
-	{
-	$line = shift @grdinfo;
-	if ($line =~ /\S+\s+x_min:\s+(\S+)\s+x_max:\s+(\S+)\s+x_inc:/)
-		{
-		$file_data_no_list = 1;
-		}
-	}
-if ($file_data_no_list)
-	{
-	push(@files_data, $file_data);
-	}
-else
-	{
-	if (open(FILEDATA,"<$file_data"))
-		{
-		while (<FILEDATA>)
-			{
-			chop($_);
-			push(@files_data, $_);
-			}
-		close FILEDATA;
-		}
-	}
-
-# see if intensity file is a grd file or a list of grdfiles
-if ($file_intensity)
-	{
-	@grdinfo = `grdinfo $file_intensity 2>&1`;
-	while (@grdinfo)
-		{
-		$line = shift @grdinfo;
-		if ($line =~ /\S+\s+x_min:\s+(\S+)\s+x_max:\s+(\S+)\s+x_inc:/)
-			{
-			$file_intensity_no_list = 1;
-			}
-		}
-	if ($file_intensity_no_list)
-		{
-		push(@files_intensity, $file_intensity);
-		}
-	else
-		{
-		if (open(FILEDATA,"<$file_intensity"))
-			{
-			while (<FILEDATA>)
-				{
-				chop($_);
-				push(@files_intensity, $_);
-				}
-			close FILEDATA;
-			}
-		}
-	}
-
-# parse $zbounds to get zmode
-if ($zbounds =~ /(\S+)\/(\S+)\/(\S+)/)
-	{
-	($zmin,$zmax,$zmode) = $zbounds =~ /(\S+)\/(\S+)\/(\S+)/;
-	}
-elsif ($zbounds =~ /(\S+)\/(\S+)/)
-	{
-	($zmin,$zmax) = $zbounds =~ /(\S+)\/(\S+)/;
-	$zmode = 0;
-	}
-else
-	{
-	$zmode = 0;
-	}
-
-# get limits of files using grdinfo
-if (!$bounds || !$zbounds || $zmode == 1)
-	{
-	if ($verbose > 0)
-		{
-		print "\nRunning gmt module grdinfo to get file bounds and min max...\n";
-		}
-
-	foreach $file_grd (@files_data) {
-
-	if ($bounds)
-		{
-		if ($verbose > 0)
-			{
-			print "\tmbm_grdinfo -I$file_grd -R$bounds -V\n";
-			}
-		if ($verbose > 0)
-			{
-			@grdinfo = `mbm_grdinfo -I$file_grd -R$bounds -V`;
-			}
-		else
-			{
-			@grdinfo = `mbm_grdinfo -I$file_grd -R$bounds`;
-			}
-		}
-	else
-		{
-		@grdinfo = `grdinfo $file_grd 2>&1`;
-		if ($verbose > 0)
-			{
-			print "\tgrdinfo -I$file_grd\n";
-			}
-		}
-	while (@grdinfo)
-		{
-		$line = shift @grdinfo;
-
-		if ($verbose > 0)
-			{
-			print "\tgrdinfo output: $line";
-			}
-
-		if ($line =~
-			/\s+Projection: UTM Zone \S+/)
-			{
-			($utm_zone) = $line =~
-				/\s+Projection: UTM Zone (\S+)/;
-			$gridprojected = 1;
-			}
-		if ($line =~
-			/\s+Projection: SeismicProfile/)
-			{
-			$gridprojected = 2;
-			}
-		if ($line =~
-			/\s+Projection: GenericLinear/)
-			{
-			$gridprojected = 3;
-			}
-		if ($line =~
-			/\s+Projection: Geographic/)
-			{
-			$gridprojected = 0;
-			}
-		if ($line =~
-			/\S+\s+x_min:\s+\S+\s+x_max:\s+\S+\s+x_inc:\s+\S+\s+units:\s+.+\s+nx:\s+\S+/)
-			{
-			($xmin_f,$xmax_f,$xinc_f,$xunits,$xnx_d) = $line =~
-				/\S+\s+x_min:\s+(\S+)\s+x_max:\s+(\S+)\s+x_inc:\s+(\S+)\s+units:\s+(.+)\s+nx:\s+(\S+)/;
-			}
-		elsif ($line =~
-			/\S+\s+x_min:\s+\S+\s+x_max:\s+\S+\s+x_inc:\s+\S+\s+name:\s+.+\s+nx:\s+\S+/)
-			{
-			($xmin_f,$xmax_f,$xinc_f,$xunits,$xnx_d) = $line =~
-				/\S+\s+x_min:\s+(\S+)\s+x_max:\s+(\S+)\s+x_inc:\s+(\S+)\s+name:\s+(.+)\s+nx:\s+(\S+)/;
-			}
-		elsif ($line =~
-			/\S+\s+x_min:\s+(\S+)\s+x_max:\s+(\S+)\s+x_inc:/)
-			{
-			($xmin_f,$xmax_f) = $line =~
-				/\S+\s+x_min:\s+(\S+)\s+x_max:\s+(\S+)\s+x_inc:/;
-			}
-		if ($line =~ /\S+\s+y_min:\s+\S+\s+y_max:\s+\S+\s+y_inc:\s+\S+\s+units:\s+.+\s+ny:\s+\S+/)
-			{
-			($ymin_f,$ymax_f,$yinc_f,$yunits,$yny_d) = $line =~
-				/\S+\s+y_min:\s+(\S+)\s+y_max:\s+(\S+)\s+y_inc:\s+(\S+)\s+units:\s+(.+)\s+ny:\s+(\S+)/;
-			}
-		elsif ($line =~ /\S+\s+y_min:\s+\S+\s+y_max:\s+\S+\s+y_inc:\s+\S+\s+name:\s+.+\s+ny:\s+\S+/)
-			{
-			($ymin_f,$ymax_f,$yinc_f,$yunits,$yny_d) = $line =~
-				/\S+\s+y_min:\s+(\S+)\s+y_max:\s+(\S+)\s+y_inc:\s+(\S+)\s+name:\s+(.+)\s+ny:\s+(\S+)/;
-			}
-		elsif ($line =~ /\S+\s+y_min:\s+\S+\s+y_max:\s+\S+\s+y_inc:/)
-			{
-			($ymin_f,$ymax_f) = $line =~
-				/\S+\s+y_min:\s+(\S+)\s+y_max:\s+(\S+)\s+y_inc:/;
-			}
-		if ($line =~ /\S+\s+zmin:\s+\S+\s+zmax:\s+\S+\s+units:\s+\S+/)
-			{
-			($zmin_f,$zmax_f) = $line =~
-				/\S+\s+zmin:\s+(\S+)\s+zmax:\s+(\S+)\s+units:\s+\S+/;
-			}
-		elsif ($line =~ /\S+\s+zmin:\s+\S+\s+zmax:\s+\S+\s+name:\s+\S+/)
-			{
-			($zmin_f,$zmax_f) = $line =~
-				/\S+\s+zmin:\s+(\S+)\s+zmax:\s+(\S+)\s+name:\s+\S+/;
-			}
-		if ($line =~ /\S+\s+z_min:\s+\S+\s+z_max:\s+\S+\s+units:/)
-			{
-			($zmin_f,$zmax_f,$zunits_s) = $line =~
-				/\S+\s+z_min:\s+(\S+)\s+z_max:\s+(\S+)\s+units:\s+(.+)/;
-			}
-		elsif ($line =~ /\S+\s+z_min:\s+\S+\s+z_max:\s+\S+\s+name:/)
-			{
-			($zmin_f,$zmax_f,$zunits_s) = $line =~
-				/\S+\s+z_min:\s+(\S+)\s+z_max:\s+(\S+)\s+name:\s+(.+)/;
-			}
-		}
-
-	if (!$first_grd)
-		{
-		$first_grd = 1;
-		$xmin = $xmin_f;
-		$xmax = $xmax_f;
-		$ymin = $ymin_f;
-		$ymax = $ymax_f;
-		$zmin_t = $zmin_f;
-		$zmax_t = $zmax_f;
-		}
-	else
-		{
-		$xmin = &min($xmin, $xmin_f);
-		$xmax = &max($xmax, $xmax_f);
-		$ymin = &min($ymin, $ymin_f);
-		$ymax = &max($ymax, $ymax_f);
-		$zmin_t = &min($zmin_t, $zmin_f);
-		$zmax_t = &max($zmax_t, $zmax_f);
-		}
-
-	# check that there are data
-	if ($xmin_f >= $xmax_f || $ymin_f >= $ymax_f
-		|| ($zmin_f >= $zmax_f && !$zbounds))
-		{
-		print "\a";
-		print "$xmin_f $xmax_f $ymin_f $ymax_f $zmin_f $zmax_f\n";
-		die "The program grdinfo does not appear to have worked \nproperly with file $file_grd!\n$program_name aborted.\n"
-		}
-	}
-	}
-
-# use user defined geographic limits
-if ($bounds)
-	{
-	if ($bounds =~ /^\S+\/\S+\/\S+\/\S+r$/)
-		{
-		($xmin_raw,$ymin_raw,$xmax_raw,$ymax_raw) = $bounds =~
-			/^(\S+)\/(\S+)\/(\S+)\/(\S+)r$/;
-		$xmin = &GetDecimalDegrees($xmin_raw);
-		$xmax = &GetDecimalDegrees($xmax_raw);
-		$ymin = &GetDecimalDegrees($ymin_raw);
-		$ymax = &GetDecimalDegrees($ymax_raw);
-		$use_corner_points = 1;
-		$bounds_plot = $bounds;
-		}
-	elsif ($bounds =~ /^\S+\/\S+\/\S+\/\S+$/)
-		{
-		($xmin_raw,$xmax_raw,$ymin_raw,$ymax_raw) = $bounds =~
-			/(\S+)\/(\S+)\/(\S+)\/(\S+)/;
-		$xmin = &GetDecimalDegrees($xmin_raw);
-		$xmax = &GetDecimalDegrees($xmax_raw);
-		$ymin = &GetDecimalDegrees($ymin_raw);
-		$ymax = &GetDecimalDegrees($ymax_raw);
-		$bounds_plot = $bounds;
-		}
-	elsif ($bounds =~ /^r$/)
-		{
-		$use_corner_points = 1;
-		$bounds_plot = sprintf ("%1.8g/%1.8g/%1.8g/%1.8gr",
-			$xmin, $ymin, $xmax, $ymax);
-		}
-	}
-
-# set grid to projected if outside geographic bounds
-if ($gridprojected == 0
-	&& ($xmin < -360.0 || $xmax > 360.0
-		|| $ymin < -90.0 || $ymax > 90.0))
-	{
-	$gridprojected = 1;
-	}
-
-# set bounds string for plotting if not already set
-if (!$bounds_plot)
-	{
-	$bounds_plot = sprintf ("%1.11g/%1.11g/%1.11g/%1.11g",
-		$xmin, $xmax, $ymin, $ymax);
-	}
-
-# set $zmin and $zmax from data if $zbounds not available
-if (!$zbounds)
-	{
-	$zmode = 0;
-	$zmin = $zmin_t;
-	$zmax = $zmax_t;
-	}
-
-# check that there are data
-if ((!$use_corner_points && ($xmin >= $xmax || $ymin >= $ymax))
-	|| $zmin >= $zmax)
-	{
-	print "\a";
-	die "Improper data limits: x: $xmin $xmax  y: $ymin $ymax  z: $zmin $zmax\n$program_name aborted.\n"
-	}
-
-# apply rescaling to zmin and zmax if needed
-if ($data_scale)
-	{
-	$zmin = $data_scale * $zmin;
-	$zmax = $data_scale * $zmax;
-	$zmin_t = $data_scale * $zmin_t;
-	$zmax_t = $data_scale * $zmax_t;
-	if ($zmin > $zmax)
-		{
-		$tmp = $zmin;
-		$zmin = $zmax;
-		$zmax = $tmp;
-		}
-	if ($zmin_t > $zmax_t)
-		{
-		$tmp = $zmin_t;
-		$zmin_t = $zmax_t;
-		$zmax_t = $tmp;
-		}
-	}
-
-# set the relevent page width and height
-&GetPageSize;
-
-# get user constraints on map scale
-if ($map_scale)
-	{
-	# sets $plot_scale or $plot_width if possible
-	&GetProjection;
-	}
-
-# set up for mapproject
-if (($use_scale && $plot_scale) || ($use_width && $plot_width))
-	{
-	($projection) = $map_scale =~ /^(\w)/;
-	($projection_pars) = $map_scale =~ /^$projection(\S+)/;
-	}
-elsif ($use_scale || $use_width)
-	{
-	($projection) = $map_scale =~ /^(\w)/;
-	($projection_pars) = $map_scale =~ /^$projection(\S+)/;
-	$projection_pars = "$projection_pars" . "$separator" . "$trial_value";
-	}
-elsif ($gridprojected > 0)
-	{
-	$projection = "x";
-	$projection_pars = "1.0";
-	$use_scale = 1;
-	$linear = 1;
-	}
-else
-	{
-	$projection = "m";
-	$projection_pars = "1.0";
-	$use_scale = 1;
-	}
-
-# now find out the apparent size of the plot
-`echo $xmin $ymin > tmp$$.dat`;
-`echo $xmax $ymin >> tmp$$.dat`;
-`echo $xmax $ymax >> tmp$$.dat`;
-`echo $xmin $ymax >> tmp$$.dat`;
- at projected = `mapproject tmp$$.dat -J$projection$projection_pars -R$bounds_plot 2>&1`;
-#
-if ($verbose > 0)
-	{
-	print "\nCalling GMT program mapproject...\n\tmapproject tmp$$.dat -J$projection$projection_pars -R$bounds_plot \n";
-	}
-`/bin/rm -f tmp$$.dat`;
-$cnt = 0;
-while (@projected)
-	{
-	$line = shift @projected;
-	$cnt++;
-
-	if ($verbose > 0)
-		{
-		print "mapproject output: $line";
-		}
-
-	if ($cnt == 1)
-		{
-		($xxmin,$yymin) = $line =~ /(\S+)\s+(\S+)/;
-		$xxmax = $xxmin;
-		$yymax = $yymin;
-		}
-	else
-		{
-		($xx,$yy) = $line =~ /(\S+)\s+(\S+)/;
-		$xxmin = ($xx < $xxmin ? $xx : $xxmin);
-		$xxmax = ($xx > $xxmax ? $xx : $xxmax);
-		$yymin = ($yy < $yymin ? $yy : $yymin);
-		$yymax = ($yy > $yymax ? $yy : $yymax);
-		}
-	}
-$dxx = $xxmax - $xxmin;
-$dyy = $yymax - $yymin;
-
-# check for valid scaling
-if ($dxx == 0.0 && $dyy == 0.0)
-	{
-	print "\a";
-	print "GMT program mapproject failed...\n";
-	print "\tMapproject invocation:\n";
-	print "\t\tmapproject tmp$$.dat -J$projection$projection_pars -R$bounds_plot\n";
-	print "\tInput bounds:\n";
-	print "\t\txmin:$xmin xmax:$xmax ymax:$ymin ymax:$ymax\n";
-	if ($cnt < 4)
-		{
-		print "\tmapproject seems to have failed to generate output\n";
-		}
-	else
-		{
-		print "\tOutput bounds:\n";
-		print "\t\txmin:$xxmin xmax:$xxmax ymax:$yymin ymax:$yymax\n";
-		}
-	die "Program $program_name aborted\n";
-	}
-
-# figure out scaling issues
-if (($use_scale && $plot_scale) || ($use_width && $plot_width))
-	{
-	$plot_width = $dxx;
-	$plot_height = $dyy;
-
-	# decide which plot orientation to use
-	if ($orientation == 1)
-		{
-		$portrait = 1;
-		$width = $page_width_in{$pagesize};
-		$height = $page_height_in{$pagesize};
-		$width_max = $width_max_portrait;
-		$height_max = $height_max_portrait;
-		}
-	elsif ($orientation == 2)
-		{
-		$landscape = 1;
-		$width = $page_height_in{$pagesize};
-		$height = $page_width_in{$pagesize};
-		$width_max = $width_max_landscape;
-		$height_max = $height_max_landscape;
-		}
-	elsif ($dxx > $dyy)
-		{
-		$landscape = 1;
-		$width = $page_height_in{$pagesize};
-		$height = $page_width_in{$pagesize};
-		$width_max = $width_max_landscape;
-		$height_max = $height_max_landscape;
-		}
-	else
-		{
-		$portrait = 1;
-		$width = $page_width_in{$pagesize};
-		$height = $page_height_in{$pagesize};
-		$width_max = $width_max_portrait;
-		$height_max = $height_max_portrait;
-		}
-
-	# check if plot fits on page
-	if ($plot_width > $width_max || $plot_height > $height_max)
-		{
-		# try to find a sufficiently large pagesize
-		$pagesize_save = $pagesize;
-		$good_page = 0;
-		foreach $elem (@page_size_names) {
-			if (!$good_page)
-				{
-				$pagesize = "$elem";
-				&GetPageSize;
-				if ($portrait)
-					{
-					$width_max = $width_max_portrait;
-					$height_max = $height_max_portrait;
-					}
-				else
-					{
-					$width_max = $width_max_landscape;
-					$height_max = $height_max_landscape;
-					}
-				if ($plot_width <= $width_max
-					&& $plot_height <= $height_max)
-					{
-					$good_page = 1;
-					$pagesize_save = $pagesize;
-					}
-				}
-			}
-
-		# print out warning
-		if (!$good_page)
-			{
-			print "\nWarning: Unable to fit plot on any available page size!\n";
-			print "\tThis plot will not be particularly useful!\n";
-			print "\tTry using a different scale or allow the program to set the scale!\n";
-			}
-
-		# reset the page size
-		$pagesize = $pagesize_save;
-		&GetPageSize;
-		if ($portrait)
-			{
-			$width = $page_width_in{$pagesize};
-			$height = $page_height_in{$pagesize};
-			}
-		else
-			{
-			$width = $page_height_in{$pagesize};
-			$height = $page_width_in{$pagesize};
-			}
-		}
-	}
-elsif ($use_scale)
-	{
-	# get landscape and portrait scales
-	$plot_scale_landscape = $width_max_landscape/$dxx;
-	if ($plot_scale_landscape*$dyy > $height_max_landscape)
-		{
-		$plot_scale_landscape = $height_max_landscape/$dyy;
-		}
-	$plot_scale_portrait = $width_max_portrait/$dxx;
-	if ($plot_scale_portrait*$dyy > $height_max_portrait)
-		{
-		$plot_scale_portrait = $height_max_portrait/$dyy;
-		}
-
-	# decide which plot orientation to use
-	if ($orientation == 1)
-		{
-		$portrait = 1;
-		$plot_scale = $plot_scale_portrait;
-		$width = $page_width_in{$pagesize};
-		$height = $page_height_in{$pagesize};
-		}
-	elsif ($orientation == 2)
-		{
-		$landscape = 1;
-		$plot_scale = $plot_scale_landscape;
-		$width = $page_height_in{$pagesize};
-		$height = $page_width_in{$pagesize};
-		}
-	elsif ($plot_scale_landscape > $plot_scale_portrait)
-		{
-		$landscape = 1;
-		$plot_scale = $plot_scale_landscape;
-		$width = $page_height_in{$pagesize};
-		$height = $page_width_in{$pagesize};
-		}
-	else
-		{
-		$portrait = 1;
-		$plot_scale = $plot_scale_portrait;
-		$width = $page_width_in{$pagesize};
-		$height = $page_height_in{$pagesize};
-		}
-
-	# set plot width
-	$plot_width = $dxx * $plot_scale;
-	$plot_height = $dyy * $plot_scale;
-
-	# reset plot_scale if ratio required
-	if ($use_ratio)
-		{
-		$top = int(1 / $plot_scale);
-		$plot_scale = "1:" . "$top";
-		}
-
-	# construct plot scale parameters
-	($projection_pars) = $map_scale =~ /^$projection(\S+)/;
-	$projection_pars = sprintf ("$projection_pars$separator%1.5g", $plot_scale);
-
-	# handle special case for linear projections
-	if ($linear && $gridprojected == 0)
-		{
-		$projection_pars = "$projection_pars" . "d";
-		}
-	}
-elsif ($use_width)
-	{
-	# get landscape and portrait heights
-	$plot_width_landscape = $height_max_landscape * $dxx / $dyy;
-	if ($plot_width_landscape > $width_max_landscape)
-		{
-		$plot_width_landscape = $width_max_landscape;
-		}
-	$plot_width_portrait = $height_max_portrait * $dxx / $dyy;
-	if ($plot_width_portrait > $width_max_portrait)
-		{
-		$plot_width_portrait = $width_max_portrait;
-		}
-
-	# decide which plot orientation to use
-	if ($orientation == 1)
-		{
-		$portrait = 1;
-		$plot_width = $plot_width_portrait;
-		$plot_height = $plot_width * $dyy / $dxx;
-		$width = $page_width_in{$pagesize};
-		$height = $page_height_in{$pagesize};
-		}
-	elsif ($orientation == 2)
-		{
-		$landscape = 1;
-		$plot_width = $plot_width_landscape;
-		$plot_height = $plot_width * $dyy / $dxx;
-		$width = $page_height_in{$pagesize};
-		$height = $page_width_in{$pagesize};
-		}
-	elsif ($plot_width_landscape > $plot_width_portrait)
-		{
-		$landscape = 1;
-		$plot_width = $plot_width_landscape;
-		$plot_height = $plot_width * $dyy / $dxx;
-		$width = $page_height_in{$pagesize};
-		$height = $page_width_in{$pagesize};
-		}
-	else
-		{
-		$portrait = 1;
-		$plot_width = $plot_width_portrait;
-		$plot_height = $plot_width * $dyy / $dxx;
-		$width = $page_width_in{$pagesize};
-		$height = $page_height_in{$pagesize};
-		}
-
-	# construct plot scale parameters
-	($projection_pars) = $map_scale =~ /^$projection(\S+)/;
-	$projection_pars = sprintf ("$projection_pars$separator%1.5g", $plot_width);
-
-	# handle special case for linear projections
-	if ($linear && $gridprojected == 0)
-		{
-		$projection_pars = "$projection_pars" . "d";
-		}
-	}
-
-# place the origin so plot is more or less centered
-$xoffset = ($width - $plot_width
-	- $space_left - $space_right) / 2 + $space_left;
-$yoffset = ($height - $plot_height
-	- $space_bottom - $space_top) / 2 + $space_bottom;
-
-# get plot degree annotation for geographic maps
-$degree_format = "ddd:mm";
-if (!$gridprojected)
-	{
-	$xsize = ($xmax - $xmin) / 3;
-	$ysize = ($ymax - $ymin) / 3;
-	if ($xsize < $ysize)
-		{
-		$size = $xsize;
-		}
-	else
-		{
-		$size = $ysize;
-		}
-	if ($size > 4.0)
-		{
-		$degree_format = "ddd";
-		}
-	elsif ($size > (1.0 / 60.0))
-		{
-		$degree_format = "ddd:mm";
-		}
-	else
-		{
-		$degree_format = "ddd:mm:ss";
-		}
-	}
-
-# figure out where to place the color scale
-$scale_loc =~ tr/A-Z/a-z/;
-if ($scale_loc eq "l")
-	{
-	$colorscale_length = $plot_height;
-	$colorscale_thick = 0.013636364 * $page_height_in{$pagesize};
-	$colorscale_offx = -0.13636 * $page_height_in{$pagesize};
-	$colorscale_offy = 0.5*$plot_height;
-	$colorscale_vh = "v";
-	}
-elsif ($scale_loc eq "r")
-	{
-	$colorscale_length = $plot_height;
-	$colorscale_thick = 0.013636364 * $page_height_in{$pagesize};
-	$colorscale_offx = $plot_width
-		+ 0.0909 * $page_height_in{$pagesize};
-	$colorscale_offy = 0.5*$plot_height;
-	$colorscale_vh = "v";
-	}
-elsif ($scale_loc eq "t")
-	{
-	$colorscale_length = $plot_width;
-	$colorscale_thick = 0.013636364 * $page_height_in{$pagesize};
-	$colorscale_offx = 0.5*$plot_width;
-	$colorscale_offy = $plot_height
-		+ 0.15 * $page_height_in{$pagesize};
-	$colorscale_vh = "h";
-	}
-else
-	{
-	$colorscale_length = $plot_width;
-	$colorscale_thick = 0.013636364 * $page_height_in{$pagesize};
-	$colorscale_offx = 0.5*$plot_width;
-	$colorscale_offy = -0.045454545 * $page_height_in{$pagesize};
-	$colorscale_vh = "h";
-	}
-if ($colorscale_length < 3.0)
-	{
-	$colorscale_length = 3.0;
-	}
-
-# figure out reasonable color and contour intervals
-$dzz = ($zmax - $zmin);
-$contour_int = 0.0;
-if ($dzz > 0)
-	{
-	$base = int((log($dzz) / log(10.)) + 0.5);
-	$contour_int = (10 ** $base) / 10.0;
-	if ($dzz / $contour_int < 10)
-		{
-		$contour_int = $contour_int / 4;
-		}
-	elsif ($dzz / $contour_int < 20)
-		{
-		$contour_int = $contour_int / 2;
-		}
-	}
-if ($color_mode && $color_style == 1)
-	{
-	$ncolors_use = $ncolors;
-	}
-elsif ($color_mode)
-	{
-	$ncolors_use = $ncolors + 1;
-	}
-if ($color_mode && !$no_nice_color_int && $dzz > 0)
-	{
-	$start_int = $contour_int / 2;
-	$multiplier = int($dzz / ($ncolors_use - 1) / $start_int) + 1;
-	$color_int = $multiplier * $start_int;
-	if ($zmin < 0.0)
-		{
-		$color_start = $color_int * (int($zmin / $color_int) - 1);
-		}
-	else
-		{
-		$color_start = $color_int * int($zmin / $color_int);
-		}
-	$color_end = $color_start + $color_int * ($ncolors_use - 1);
-	if ($color_end < $zmax)
-		{
-		$multiplier = $multiplier + 1;
-		$color_int = $multiplier * $start_int;
-		}
-	if ($zmin < 0.0)
-		{
-		$color_start = $color_int * (int($zmin / $color_int) - 1);
-		}
-	else
-		{
-		$color_start = $color_int * int($zmin / $color_int);
-		}
-	$color_end = $color_start + $color_int * ($ncolors_use - 1);
-	}
-elsif ($color_mode)
-	{
-	$color_int = ($zmax - $zmin)/($ncolors_use - 1);
-	$color_start = $zmin;
-	$color_end = $color_start + $color_int * ($ncolors_use - 1);
-	}
-
-# get colors to use by interpolating defined color pallette
-if ($color_mode)
-	{
-	# deal with single colormap (not sealevel)
-	if ($color_pallette < 8)
-		{
-		# set selected color pallette
-		eval "\@cptbr = \@cptbr$color_pallette;";
-		eval "\@cptbg = \@cptbg$color_pallette;";
-		eval "\@cptbb = \@cptbb$color_pallette;";
-
-		# interpolate colors
-		for ($i = 0; $i < $ncolors; $i++)
-			{
-			$xx = ($ncpt - 1) * $i / ($ncolors - 1);
-			$i1 = int($xx);
-			$i2 = $i1 + 1;
-			$red = $cptbr[$i1]
-				+ ($cptbr[$i2] - $cptbr[$i1])
-				* ($xx - $i1) / ($i2 - $i1);
-			$green = $cptbg[$i1]
-				+ ($cptbg[$i2] - $cptbg[$i1])
-				* ($xx - $i1) / ($i2 - $i1);
-			$blue = $cptbb[$i1]
-				+ ($cptbb[$i2] - $cptbb[$i1])
-				* ($xx - $i1) / ($i2 - $i1);
-			if ($i < $ncolors - 1)
-                            {
-                            push (@cptubr, $red);
-                            push (@cptubg, $green);
-                            push (@cptubb, $blue);
-                            }
-                        if ($i > 0)
-                            {
-                            push (@cptuer, $red);
-                            push (@cptueg, $green);
-                            push (@cptueb, $blue);
-                            }
-			}
-		}
-
-	# if doing sealevel colors (different colormaps above and below sealevel
-	# then generate first Haxby colormap below sealevel and second brown
-	# colormap above sealevel
-	else
-		{
-		# set selected color pallette
-		eval "\@cptbr = \@cptbr$color_pallette;";
-		eval "\@cptbg = \@cptbg$color_pallette;";
-		eval "\@cptbb = \@cptbb$color_pallette;";
-
-                if ($color_flip)
-                    {
-                    $izero = $ncolors - int($color_end / $color_int);
-                    }
-                else
-                    {
-                    $izero = $ncolors - int(-$color_start / $color_int);
-                    }
-                if ($iszero < 0)
-                    {
-                    $iszero = 0;
-                    }
-                
-		# interpolate brown colors above sealevel
-		for ($i = 0; $i <= $izero - 1; $i++)
-			{
-			$xx = ($ncpt - 1) * $i / ($izero - 1);
-			$i1 = int($xx);
-			$i2 = $i1 + 1;
-			$red = $cptbr[$i1]
-				+ ($cptbr[$i2] - $cptbr[$i1])
-				* ($xx - $i1) / ($i2 - $i1);
-			$green = $cptbg[$i1]
-				+ ($cptbg[$i2] - $cptbg[$i1])
-				* ($xx - $i1) / ($i2 - $i1);
-			$blue = $cptbb[$i1]
-				+ ($cptbb[$i2] - $cptbb[$i1])
-				* ($xx - $i1) / ($i2 - $i1);
-			if ($i < $izero - 1)
-                            {
-                            push (@cptubr, $red);
-                            push (@cptubg, $green);
-                            push (@cptubb, $blue);
-                            }
-                        if ($i > 0)
-                            {
-                            push (@cptuer, $red);
-                            push (@cptueg, $green);
-                            push (@cptueb, $blue);
-                            }
-			}
-
-		# interpolate haxby colors below sealevel
-		for ($i = $izero - 1; $i < $ncolors; $i++)
-			{
-			$xx = ($ncpt - 2) * ($i - $izero + 1) / ($ncolors - $izero) + 1;
-			$i1 = int($xx);
-			$i2 = $i1 + 1;
-			$red = $cptbr1[$i1]
-				+ ($cptbr1[$i2] - $cptbr1[$i1])
-				* ($xx - $i1) / ($i2 - $i1);
-			$green = $cptbg1[$i1]
-				+ ($cptbg1[$i2] - $cptbg1[$i1])
-				* ($xx - $i1) / ($i2 - $i1);
-			$blue = $cptbb1[$i1]
-				+ ($cptbb1[$i2] - $cptbb1[$i1])
-				* ($xx - $i1) / ($i2 - $i1);
-			if ($i < $ncolors - 1)
-                            {
-                            push (@cptubr, $red);
-                            push (@cptubg, $green);
-                            push (@cptubb, $blue);
-                            }
-                        if ($i > $izero - 1)
-                            {
-                            push (@cptuer, $red);
-                            push (@cptueg, $green);
-                            push (@cptueb, $blue);
-                            }
-			}
-		}
-	}
-
-# get info from contour_file
-if ($contour_file)
-	{
-	if ($bounds)
-		{
-		@grdinfo = `mbm_grdinfo -I$contour_file -R$bounds 2>&1`;
-		}
-	else
-		{
-		@grdinfo = `grdinfo $contour_file 2>&1`;
-		}
-	while (@grdinfo)
-		{
-		$line = shift @grdinfo;
-		if ($line =~ /\S+\s+zmin:\s+(\S+)\s+zmax:\s+(\S+)\s+units:/)
-			{
-			($czmin,$czmax) = $line =~
-				/\S+\s+zmin:\s+(\S+)\s+zmax:\s+(\S+)\s+units:/;
-			}
-		if ($line =~ /\S+\s+z_min:\s+(\S+)\s+z_max:\s+(\S+)\s+units:/)
-			{
-			($czmin,$czmax,$czunits) = $line =~
-				/\S+\s+z_min:\s+(\S+)\s+z_max:\s+(\S+)\s+units:\s+(\S+)/;
-			}
-		}
-	$cdzz = ($czmax - $czmin);
-	$contour_int = 0.0;
-		if ($cdzz > 0)
-		{
-		$cbase = int((log($cdzz) / log(10.)) + 0.5);
-		$contour_int = (10 ** $cbase) / 10.0;
-		if ($cdzz / $contour_int < 10)
-			{
-			$contour_int = $contour_int / 4;
-			}
-		elsif ($cdzz / $contour_int < 20)
-			{
-			$contour_int = $contour_int / 2;
-			}
-		}
-	}
-else
-	{
-	$czmin = $zmin;
-	$czmax = $zmax;
-	}
-
-# set contour control
-if (!$contour_control && $contour_mode)
-	{
-	$contour_control = $contour_int;
-	}
-
-# set pscoast control
-if ($coast_control
-	&& !$coast_wetfill
-	&& !$coast_dryfill
-	&& !$coast_pen
-	&& !$coast_boundary
-	&& !$coast_river)
-	{
-	$coast_pen = "1";
-	}
-if ($coast_control
-	&& !$coast_resolution)
-	{
-	$coast_resolution = "f";
-	}
-
-# set swath navigation controls
-if ($swathnavdatalist && !$navigation_control && !$navigation_mode)
-	{
-	$navigation_mode = 1;
-	$navigation_control = "100000/100000/100000/0.15";
-	}
-
-if ($navigation_control && $navigation_control =~ /\S+\/\S+\/\S+\/\S+/)
-	{
-	$navigation_mode = 1;
-	}
-elsif ($navigation_control && ($navigation_control =~ /FP/
-				|| $navigation_control =~ /fp/))
-	{
-	$navigation_mode = 1;
-	$name_mode = 1;
-	$name_perp = 1;
-	$navigation_control = "0.25/1/4/0.15";
-	$nav_name_hgt = "0.15";
-	}
-elsif ($navigation_control && ($navigation_control =~ /F/
-				|| $navigation_control =~ /f/))
-	{
-	$navigation_mode = 1;
-	$name_mode = 1;
-	$name_perp = 0;
-	$navigation_control = "0.25/1/4/0.15";
-	$nav_name_hgt = "0.15";
-	}
-elsif ($navigation_control)
-	{
-	if ($navigation_control =~ /\S+\/\S+\/\S+\/\S+\/\S+\/\S+/)
-		{
-		$navigation_mode = 1;
-		$name_mode = 1;
-		($nav_time_tick, $nav_time_annot,
-				$nav_date_annot, $nav_tick_size, $nav_name_hgt, $name_perp)
-				= $navigation_control =~  /(\S+)\/(\S+)\/(\S+)\/(\S+)\/(\S+)/;
-		}
-	elsif ($navigation_control =~ /\S+\/\S+\/\S+\/\S+\/\S+/)
-		{
-		$navigation_mode = 1;
-		$name_mode = 1;
-		$name_perp = 0;
-		($nav_time_tick, $nav_time_annot,
-				$nav_date_annot, $nav_tick_size, $nav_name_hgt)
-				= $navigation_control =~  /(\S+)\/(\S+)\/(\S+)\/(\S+)\/(\S+)/;
-		}
-	elsif ($navigation_control =~ /\S+\/\S+\/\S+/)
-		{
-		($nav_time_tick, $nav_time_annot,
-			$nav_date_annot)
-			= $navigation_control =~  /(\S+)\/(\S+)\/(\S+)/;
-		$nav_tick_size = 0.15;
-		}
-	elsif ($navigation_control =~ /\S+\/\S+/)
-		{
-		($nav_time_tick, $nav_time_annot)
-			= $navigation_control =~  /(\S+)\/(\S+)/;
-		$nav_date_annot = 100000;
-		$nav_tick_size = 0.15;
-		}
-	else
-		{
-		$nav_time_tick = $navigation_control;
-		$nav_time_annot = 100000;
-		$nav_date_annot = 100000;
-		$nav_tick_size = 0.15;
-		}
-	$navigation_mode = 1;
-	$navigation_control = "$nav_time_tick"
-			. "/" . "$nav_time_annot"
-			. "/" . "$nav_date_annot"
-			. "/" . "$nav_tick_size";
-	}
-elsif ($navigation_mode)
-	{
-	$navigation_control = "0.25/1/4/0.15";
-	}
-if ($pingnumber_mode)
-	{
-	$pingnumber_control = "$pingnumber_tick"
-			. "/" . "$pingnumber_annot"
-			. "/" . "$pingnumber_tick_len";
-	}
-
-# if length scale bar requested check to see if map center needs to be defined
-if ($length_scale && $length_scale =~ /\S+center\S+/)
-        {
-        # add map lon lat (or x y) center to the length scale argument
-        ($a, $c) = $length_scale =~ /(\S+)center(\S+)/;
-        $xcen = 0.5 * ($xmin + $xmax);
-        $ycen = 0.5 * ($ymin + $ymax);
-        $b = "$xcen/$ycen";
-        $length_scale = "$a$b$c";
-        }
-
-# come up with the filenames
-$cmdfile = "$root.cmd";
-$psfile = "$root.ps";
-if ($color_mode && $file_cpt)
-	{
-	$cptfile = $file_cpt;
-	}
-else
-	{
-	$cptfile = "$root.cpt";
-	}
-$gmtfile = "gmt.conf\$\$";
-
-# set some gmtisms
-$first_gmt = 1;
-$first = "-X\$X_OFFSET -Y\$Y_OFFSET -K -V >! \$PS_FILE";
-$middle = "-K -O -V >> \$PS_FILE";
-$end = "-O -V >> \$PS_FILE";
-
-# set macro gmt default settings
-$gmt_def = "PROJ_LENGTH_UNIT/inch";
-push(@gmt_macro_defs, $gmt_def);
-$gmt_def = "PS_MEDIA/$page_gmt_name{$pagesize}";
-push(@gmt_macro_defs, $gmt_def);
-$gmt_def = "FONT_ANNOT_PRIMARY/$page_anot_font{$pagesize},Helvetica,black";
-push(@gmt_macro_defs, $gmt_def);
-$gmt_def = "FONT_ANNOT_SECONDARY/$page_anot_font{$pagesize},Helvetica,black";
-push(@gmt_macro_defs, $gmt_def);
-$gmt_def = "FONT_LABEL/$page_anot_font{$pagesize},Helvetica,black";
-push(@gmt_macro_defs, $gmt_def);
-$gmt_def = "FONT_TITLE/$page_header_font{$pagesize},Helvetica,black";
-push(@gmt_macro_defs, $gmt_def);
-$gmt_def = "PS_PAGE_ORIENTATION/LANDSCAPE";
-push(@gmt_macro_defs, $gmt_def);
-if ($color_flip)
-    {
-    $gmt_def = "COLOR_BACKGROUND/white";
-    push(@gmt_macro_defs, $gmt_def);
-    $gmt_def = "COLOR_FOREGROUND/black";
-    push(@gmt_macro_defs, $gmt_def);
-    }
-else
-    {
-    $gmt_def = "COLOR_BACKGROUND/black";
-    push(@gmt_macro_defs, $gmt_def);
-    $gmt_def = "COLOR_FOREGROUND/white";
-    push(@gmt_macro_defs, $gmt_def);
-    }
-$gmt_def = "COLOR_NAN/white";
-push(@gmt_macro_defs, $gmt_def);
-$gmt_def = "FORMAT_GEO_MAP/$degree_format";
-push(@gmt_macro_defs, $gmt_def);
-
-# open the shellscript file
-if (!open(FCMD,">$cmdfile"))
-	{
-	print "\a";
-	die "Cannot open output file $cmdfile\nMacro $program_name aborted.\n";
-	}
-
-# write the shellscript header
-print FCMD "#! /bin/csh -f\n";
-print FCMD "#\n# Shellscript to create Postscript plot of data in grd file\n";
-print FCMD "# Created by macro $program_name\n";
-print FCMD "#\n# This shellscript created by following command line:\n";
-print FCMD "# $program_name $command_line\n";
-
-# Define shell variables
-print FCMD "#\n# Define shell variables used in this script:\n";
-print FCMD "set PS_FILE         = $psfile\n";
-print FCMD "set CPT_FILE        = $cptfile\n";
-print FCMD "set MAP_PROJECTION  = $projection\n";
-print FCMD "set MAP_SCALE       = $projection_pars\n";
-print FCMD "set MAP_REGION      = $bounds_plot\n";
-printf FCMD "set X_OFFSET        = %1.5g\n", $xoffset;
-printf FCMD "set Y_OFFSET        = %1.5g\n", $yoffset;
-
-# Set temporary GMT defaults
-print FCMD "#\n# Delete any existing gmt.conf file\n";
-print FCMD "if (-e gmt.conf) then\n";
-print FCMD "echo Deleting gmt.conf...\n";
-print FCMD "/bin/rm gmt.conf\n";
-print FCMD "endif\n";
-print FCMD "#\n# Set temporary GMT defaults\n";
-print FCMD "echo Setting temporary GMT defaults...\n";
-foreach $gmt_def (@gmt_macro_defs) {
-	($gmt_par, $gmt_var) = $gmt_def =~ /^([^\/]+)\/(.+)/;
-	print FCMD "gmt gmtset $gmt_par $gmt_var\n";
-	}
-
-# Reset GMT defaults as per user commands
-if (@gmt_defs)
-	{
-	print FCMD "#\n# Set user defined GMT defaults\n";
-	print FCMD "echo Setting user defined GMT defaults...\n";
-	foreach $gmt_def (@gmt_defs) {
-		($gmt_par, $gmt_var) = $gmt_def =~ /^([^\/]+)\/(.+)/;
-		print FCMD "gmt gmtset $gmt_par $gmt_var\n";
-		}
-	}
-
-# generate color pallette table file if needed
-if ($color_mode && !$file_cpt)
-	{
-	# set slope cpt
-	if ($color_mode == 4)
-                {
-                if ($color_style == 1)
-                        {
-                        foreach $i (0 .. $ncolors - 1) {
-                                $d1 = $magnitude * $i / ($ncolors - 1);
-                                push(@hist, $d1);
-                       }
-                        }
-                else
-                        {
-                        foreach $i (0 .. $ncolors) {
-                                $d1 = $magnitude * $i / $ncolors;
-                                push(@hist, $d1);
-                        }
-			}
-		}
-
-	# break data distribution up into equal size
-	# regions using grdhisteq on first data file
-	elsif ($stretch_color)
-		{
-		if ($verbose)
-			{
-			print "Running gmt module grdhisteq:\n";
-                        print "\tgmt grdhisteq $files_data[0] -C$ncolors -D\n";
-			}
-		@grdhisteq = `gmt grdhisteq $files_data[0] -C$ncolors -D`;
-		foreach $d (@grdhisteq) {
-			($d1, $d2) = $d =~ /(\S+)\s+(\S+).*/;
-			if ($d2 > $d1)
-				{
-				push(@hist, $d1);
-				}
-			}
-		if ($d2 > $d1)
-			{
-			push(@hist, $d2);
-			}
-
-		# reset number of colors if grdhisteq returned fewer intervals
-		if (scalar(@hist) < $ncolors + 1)
-			{
-			$ncolors = scalar(@hist) - 1;
-			}
-
-		# rescale hist values if needed
-		if ($data_scale)
-			{
-			foreach $i (0 .. $ncolors) {
-				$hist[$i] = $data_scale * $hist[$i];
-				}
-			}
-
-		# make sure hist encompasses all data
-		if ($zmin < $hist[0])
-			{
-			$hist[0] = $zmin;
-			}
-		if ($zmax > $hist[$ncolors])
-			{
-			$hist[$ncolors] = $zmax;
-			}
-		$hist[0] = $hist[0] - 0.01*$dzz;
-		$hist[$ncolors] =
-			$hist[$ncolors] + 0.01*$dzz;
-		}
-
-	# generate cpt file
-	print FCMD "#\n# Make color pallette table file\n";
-	print FCMD "echo Making color pallette table file...\n";
-	if ($color_mode == 4 || $stretch_color)
-		{
-		$d1 = shift @hist;
-		}
-	else
-		{
-		$d1 = $color_start;
-		}
-	if ($color_style == 1 && $color_flip)
-		{
-		foreach $i (0 .. $ncolors - 2)
-			{
-			if ($color_mode == 4 || $stretch_color)
-				{
-				$d2 = shift @hist;
-				}
-			else
-				{
-				$d2 = $d1 + $color_int;
-				}
-			if ($zmode == 1)
-				{
-				if ($i == 0)
-					{
-					if ($color_mode == 4 && $d1 > 0.0)
-						{
-						$d1 = 0.0;
-						}
-					elsif ($color_mode != 4 && $zmin_t < $d1)
-						{
-						$d1 = $zmin_t;
-						}
-					}
-				if ($i == $ncolors - 2 && $zmax_t > $d2)
-					{
-					$d2 = $zmax_t;
-					}
-				}
-			printf FCMD "echo %6g %3d %3d %3d %6g %3d %3d %3d",
-				$d1, at cptubr[$i], at cptubg[$i], at cptubb[$i],
-				$d2, at cptuer[$i], at cptueg[$i], at cptueb[$i];
-			if ($zmode == 1 && $i == 0)
-				{
-				print FCMD " >";
-				}
-			else
-				{
-				print FCMD " >>";
-				}
-			print FCMD " \$CPT_FILE\n";
-			$d1 = $d2
-			}
-		}
-	elsif ($color_style == 1)
-		{
-		for ($i = $ncolors - 2; $i >= 0; $i--)
-			{
-			if ($color_mode == 4 || $stretch_color)
-				{
-				$d2 = shift @hist;
-				}
-			else
-				{
-				$d2 = $d1 + $color_int;
-				}
-			if ($zmode == 1)
-				{
-				if ($i == $ncolors - 2)
-					{
-					if ($color_mode == 4 && $d1 > 0.0)
-						{
-						$d1 = 0.0;
-						}
-					elsif ($color_mode != 4 && $zmin_t < $d1)
-						{
-						$d1 = $zmin_t;
-						}
-					}
-				if ($i == 0 && $zmax_t > $d2)
-					{
-					$d2 = $zmax_t;
-					}
-				}
-			printf FCMD "echo %6g %3d %3d %3d %6g %3d %3d %3d",
-				$d1, at cptuer[$i], at cptueg[$i], at cptueb[$i],
-				$d2, at cptubr[$i], at cptubg[$i], at cptubb[$i];
-			if ($i == ($ncolors - 2))
-				{
-				print FCMD " >";
-				}
-			else
-				{
-				print FCMD " >>";
-				}
-			print FCMD " \$CPT_FILE\n";
-			$d1 = $d2
-			}
-		}
-	elsif ($color_flip)
-		{
-		foreach $i (0 .. $ncolors - 1)
-			{
-			if ($color_mode == 4 || $stretch_color)
-				{
-				$d2 = shift @hist;
-				}
-			else
-				{
-				$d2 = $d1 + $color_int;
-				}
-			if ($zmode == 1)
-				{
-				if ($i == 0)
-					{
-					if ($color_mode == 4 && $d1 > 0.0)
-						{
-						$d1 = 0.0;
-						}
-					elsif ($color_mode != 4 && $zmin_t < $d1)
-						{
-						$d1 = $zmin_t;
-						}
-					}
-				if ($i == $ncolors - 1 && $zmax_t > $d2)
-					{
-					$d2 = $zmax_t;
-					}
-				}
-print "COLOR STYLE 2 WITH FLIP: $i $d1 $d2\n";
-			printf FCMD "echo %6g %3d %3d %3d %6g %3d %3d %3d",
-				$d1, at cptubr[$i], at cptubg[$i], at cptubb[$i],
-				$d2, at cptuer[$i], at cptueg[$i], at cptueb[$i];
-			if ($i == 0)
-				{
-				print FCMD " >";
-				}
-			else
-				{
-				print FCMD " >>";
-				}
-			print FCMD " \$CPT_FILE\n";
-			$d1 = $d2
-			}
-		}
-	else
-		{
-		for ($i = $ncolors - 1; $i >= 0; $i--)
-			{
-			if ($color_mode == 4 || $stretch_color)
-				{
-				$d2 = shift @hist;
-				}
-			else
-				{
-				$d2 = $d1 + $color_int;
-				}
-			if ($zmode == 1)
-				{
-				if ($i == $ncolors - 1)
-					{
-					if ($color_mode == 4 && $d1 > 0.0)
-						{
-						$d1 = 0.0;
-						}
-					elsif ($color_mode != 4 && $zmin_t < $d1)
-						{
-						$d1 = $zmin_t;
-						}
-					}
-				if ($i == 0 && $zmax_t > $d2)
-					{
-					$d2 = $zmax_t;
-					}
-				}
-print "COLOR STYLE 2 WITHOUT FLIP: $i $d1 $d2\n";
-			printf FCMD "echo %6g %3d %3d %3d %6g %3d %3d %3d",
-				$d1, at cptuer[$i], at cptueg[$i], at cptueb[$i],
-				$d2, at cptubr[$i], at cptubg[$i], at cptubb[$i];
-			if ($i == ($ncolors - 1))
-				{
-				print FCMD " >";
-				}
-			else
-				{
-				print FCMD " >>";
-				}
-			print FCMD " \$CPT_FILE\n";
-			$d1 = $d2
-			}
-		}
-	}
-
-# now loop over all of the grid files
-foreach $file_grd (@files_data) {
-
-# get intensity file
-if (@files_intensity)
-	{
-	$file_int = shift @files_intensity;
-	}
-
-# Define shell variables
-print FCMD "#\n# Define data files to be plotted:\n";
-print FCMD "set DATA_FILE        = $file_grd\n";
-print FCMD "set INTENSITY_FILE   = $file_int\n";
-
-# scale data if needed
-$file_use = "\$DATA_FILE";
-if ($data_scale)
-	{
-	printf FCMD "#\n# Rescale data\n";
-	printf FCMD "echo Rescaling data by $data_scale...\n";
-	printf FCMD "echo Running gmt module grdmath...\n";
-	printf FCMD "gmt grdmath \$DATA_FILE $data_scale x = \$DATA_FILE.scale\n";
-	$file_use = "\$DATA_FILE.scale";
-	}
-
-# get shading by illumination if needed
-#if ($color_mode == 2)
-#	{
-#	printf FCMD "#\n# Get shading array\n";
-#	printf FCMD "echo Getting shading array...\n";
-#	printf FCMD "echo Running gmt module grdgradient...\n";
-#	printf FCMD "gmt grdgradient $file_use -A$azimuth -G\$DATA_FILE.grad -N";
-#	if ($gridprojected == 0)
-#		{
-#		printf FCMD " -fg";
-#		}
-#	printf FCMD "\n";
-#	printf FCMD "echo Running gmt module grdhisteq...\n";
-#	printf FCMD "grdhisteq \$DATA_FILE.grad -G\$DATA_FILE.eq -N\n";
-#	printf FCMD "echo Running gmt module grdmath...\n";
-#	printf FCMD "grdmath \$DATA_FILE.eq $magnitude x = \$DATA_FILE.int\n";
-#	printf FCMD "/bin/rm -f \$DATA_FILE.grad \$DATA_FILE.eq\n";
-#	$file_shade = "\$DATA_FILE.int";
-#	}
-
-# get shading by illumination if needed
-if ($color_mode == 2)
-	{
-	# Compute lighting vector from sun azimuth and elevation
-	$light_x = sin($DTR * $azimuth) * cos($DTR * $elevation);
-	$light_y = cos($DTR * $azimuth) * cos($DTR * $elevation);
-	$light_z = sin($DTR * $elevation);
-
-	printf FCMD "#\n# Get shading array\n";
-	printf FCMD "echo Getting shading array...\n";
-	printf FCMD "echo Running gmt module grdgradient to get x component of the gradient...\n";
-	printf FCMD "gmt grdgradient $file_use -A90 -G\$DATA_FILE.drvx";
-	if ($gridprojected == 0)
-		{
-		printf FCMD " -fg";
-		}
-	printf FCMD "\n";
-	printf FCMD "echo Running gmt module grdgradient to get y component of the gradient...\n";
-	printf FCMD "gmt grdgradient $file_use -A0 -G\$DATA_FILE.drvy";
-	if ($gridprojected == 0)
-		{
-		printf FCMD " -fg";
-		}
-	printf FCMD "\n";
-
-	printf FCMD "echo Running gmt module grdmath to get adjusted x gradient...\n";
-	printf FCMD "gmt grdmath \$DATA_FILE.drvx $magnitude MUL 10 MUL = \$DATA_FILE.magx\n";
-	printf FCMD "echo Running gmt module grdmath to get adjusted y gradient...\n";
-	printf FCMD "gmt grdmath \$DATA_FILE.drvy $magnitude MUL 10 MUL = \$DATA_FILE.magy\n";
-
-	printf FCMD "echo Running gmt module grdmath to get normalization factor...\n";
-	printf FCMD "gmt grdmath \$DATA_FILE.magx 2.0 POW \\\n";
-	printf FCMD "\t\$DATA_FILE.magy 2.0 POW ADD \\\n";
-	printf FCMD "\t1.0 ADD SQRT = \$DATA_FILE.denom\n";
-
-	printf FCMD "echo Running gmt module grdmath to get normalized x gradient...\n";
-	printf FCMD "gmt grdmath \$DATA_FILE.magx \$DATA_FILE.denom DIV = \$DATA_FILE.normx\n";
-	printf FCMD "echo Running gmt module grdmath to get normalized y gradient...\n";
-	printf FCMD "gmt grdmath \$DATA_FILE.magy \$DATA_FILE.denom DIV = \$DATA_FILE.normy\n";
-	printf FCMD "echo Running gmt module grdmath to get normalized z gradient...\n";
-	printf FCMD "gmt grdmath 1.0 \$DATA_FILE.denom DIV = \$DATA_FILE.normz\n";
-
-	printf FCMD "echo Running gmt module grdmath to apply lighting vector to normalized gradient...\n";
-	printf FCMD "gmt grdmath \$DATA_FILE.normx $light_x MUL \\\n";
-	printf FCMD "\t\$DATA_FILE.normy $light_y MUL ADD \\\n";
-	printf FCMD "\t\$DATA_FILE.normz $light_z MUL ADD -0.5 ADD = \$DATA_FILE.int\n";
-
-	printf FCMD "/bin/rm -f \$DATA_FILE.drvx \$DATA_FILE.drvy \\\n";
-	printf FCMD "\t\$DATA_FILE.magx \$DATA_FILE.magy \\\n";
-	printf FCMD "\t\$DATA_FILE.denom \$DATA_FILE.normx \\\n";
-	printf FCMD "\t\$DATA_FILE.normy \$DATA_FILE.normz\n";
-	$file_shade = "\$DATA_FILE.int";
-	}
-
-# get equalized shading by intensity file if needed
-elsif ($color_mode == 3 && $file_int && $stretch_shade)
-	{
-	printf FCMD "#\n# Get shading array\n";
-	printf FCMD "echo Getting shading array...\n";
-	printf FCMD "echo Running gmt module grdhisteq...\n";
-	printf FCMD "gmt grdhisteq \$INTENSITY_FILE -G\$INTENSITY_FILE.eq -N\n";
-	printf FCMD "echo Running gmt module grdmath...\n";
-	printf FCMD "gmt grdmath \$INTENSITY_FILE.eq $magnitude MUL = \$INTENSITY_FILE.int\n";
-	printf FCMD "/bin/rm -f \$INTENSITY_FILE.eq\n";
-	$file_shade = "\$INTENSITY_FILE.int";
-	}
-
-# get shading by unaltered intensity file
-elsif ($color_mode == 3 && $file_int)
-	{
-	$file_shade = "\$INTENSITY_FILE";
-	}
-
-# get color by slope magnitude if needed
-elsif ($color_mode >= 4)
-	{
-	printf FCMD "#\n# Get slope array\n";
-	printf FCMD "echo Getting slope array...\n";
-	printf FCMD "echo Running gmt module grdgradient to get x component of the gradient...\n";
-	printf FCMD "gmt grdgradient $file_use -A90 -G\$DATA_FILE.drvx";
-	if ($gridprojected == 0)
-		{
-		printf FCMD " -fg";
-		}
-	printf FCMD "\n";
-	printf FCMD "echo Running gmt module grdgradient to get y component of the gradient...\n";
-	printf FCMD "gmt grdgradient $file_use -A0 -G\$DATA_FILE.drvy";
-	if ($gridprojected == 0)
-		{
-		printf FCMD " -fg";
-		}
-	printf FCMD "\n";
-
-	printf FCMD "echo Running gmt module grdmath to get slope magnitude...\n";
-	printf FCMD "gmt grdmath \$DATA_FILE.drvx 2.0 POW \\\n";
-	printf FCMD "\t\$DATA_FILE.drvy 2.0 POW ADD SQRT \\\n";
-	if ($color_mode == 5)
-		{
-		printf FCMD "\t$magnitude MUL \\\n";
-		}
-	printf FCMD "\t= \$DATA_FILE.slope\n";
-
-	printf FCMD "/bin/rm -f \$DATA_FILE.drvx \$DATA_FILE.drvy \n";
-	$file_slope = "\$DATA_FILE.slope";
-	}
-
-# do grdimage plot
-if ($color_mode)
-	{
-	printf FCMD "#\n# Make color image\n";
-	printf FCMD "echo Running gmt module grdimage...\n";
-	if ($color_mode == 4)
-		{
-		printf FCMD "gmt grdimage $file_slope -J\$MAP_PROJECTION\$MAP_SCALE \\\n\t";
-		}
-	else
-		{
-		printf FCMD "gmt grdimage $file_use -J\$MAP_PROJECTION\$MAP_SCALE \\\n\t";
-		}
-	printf FCMD "-R\$MAP_REGION -C\$CPT_FILE \\\n\t";
-	if ($color_mode == 2 || $color_mode == 3)
-		{
-		printf FCMD "-I$file_shade \\\n\t";
-		}
-	elsif ($color_mode == 5)
-		{
-		printf FCMD "-I$file_slope \\\n\t";
-		}
-	if ($dpi)
-		{
-		printf FCMD "-E$dpi \\\n\t";
-		}
-	if ($portrait)
-	    {
-	    printf FCMD "-P ";
-	    }
-	if ($first_gmt == 1)
-		{
-		$first_gmt = 0;
-		printf FCMD "$first\n";
-		}
-	else
-		{
-		printf FCMD "$middle\n";
-		}
-	}
-
-# do grdcontour plot
-if ($contour_mode)
-	{
-	if (!$contour_file)
-		{
-		$contour_file = $file_use
-		}
-	printf FCMD "#\n# Make contour plot\n";
-	printf FCMD "echo Running gmt module grdcontour...\n";
-	printf FCMD "gmt grdcontour $contour_file -J\$MAP_PROJECTION\$MAP_SCALE \\\n\t";
-	printf FCMD "-R\$MAP_REGION \\\n\t";
-	printf FCMD "-C$contour_control \\\n\t";
-	if (!$contour_pen)
-		{
-		$contour_pen = "c1p";
-		}
-	printf FCMD "-L$czmin/$czmax -W$contour_pen\\\n\t";
-	if ($contour_anot_int)
-		{
-		printf FCMD "-A$contour_anot_int \\\n\t";
-		}
-	if ($contour_gap)
-		{
-		printf FCMD "-G$contour_gap \\\n\t";
-		}
-	if ($contour_cut)
-		{
-		printf FCMD "-Q$contour_cut \\\n\t";
-		}
-	if ($contour_tick_on && $contour_tick)
-		{
-		printf FCMD "-T$contour_tick \\\n\t";
-		}
-	elsif ($contour_tick_on)
-		{
-		printf FCMD "-T \\\n\t";
-		}
-	if ($portrait)
-		{
-		printf FCMD "-P ";
-		}
-	if ($first_gmt == 1)
-		{
-		$first_gmt = 0;
-		printf FCMD "$first\n";
-		}
-	else
-		{
-		printf FCMD "$middle\n";
-		}
-	}
-} # end loop over grd data files
-
-# figure out labels
-$nlabels = 0;
-if ($labels)
-	{
-	@labels_split = split(/:/, $labels);
-	$nlabels = @labels_split;
-	if ($nlabels > 0)
-		{
-		$tlabel = shift(@labels_split);
-		$tlabel =~ s/\\/\//g;
-		}
-	if ($nlabels > 1)
-		{
-		$slabel = shift(@labels_split);
-		$slabel =~ s/\\/\//g;
-		}
-	}
-if ($nlabels < 1)
-	{
-	$tlabel = "Data File $file_data";
-	}
-if ($nlabels < 2 && $zunits_s)
-	{
-	$slabel = "$zunits_s";
-	}
-elsif ($nlabels < 2)
-	{
-	$slabel = "Data Values";
-	}
-
-# set basemap axes annotation
-if ($gridprojected == 2 && $tick_info && $tick_info =~ /\S+\/\S+/)
-	{
-	($base_tick_x, $base_tick_y) = $tick_info =~ /(\S+)\/(\S+)/;
-        if ($xunits)
-                {
-                $axes = "-Bx$base_tick_x+l\"$xunits\"";
-                }
-        else
-                {
-                $axes = "-Bx$base_tick_x";
-                }
-        if ($yunits)
-                {
-                $axes = "$axes -By$base_tick_y+l\"$yunits\"";
-                }
-        else
-                {
-                $axes = "$axes -By$base_tick_y";
-                }
-	}
-elsif ($tick_info)
-	{
-	$axes = "-B$tick_info";
-	}
-else
-	{
-	# figure out some reasonable tick intervals for the basemap
-	&GetBaseTick;
-        if ($base_tick_x == $base_tick_y)
-                {
-                $axes = "-B$base_tick"
-                }
-        else
-                {
-                if ($xunits)
-                        {
-                        $axes = "-Bx$base_tick_x+l\"$xunits\"";
-                        }
-                else
-                        {
-                        $axes = "-Bx$base_tick_x";
-                        }
-                if ($yunits)
-                        {
-                        $axes = "$axes -By$base_tick_y+l\"$yunits\"";
-                        }
-                else
-                        {
-                        $axes = "$axes -By$base_tick_y";
-                        }
-                }
-	}
-if ($tlabel)
-	{
-	$axes = "$axes -B+t\"$tlabel\"";
-	}
-
-# do coastline plots
-if ($coast_control)
-	{
-	printf FCMD "#\n# Make coastline data plot\n";
-	printf FCMD "echo Running gmt module pscoast...\n";
-	printf FCMD "gmt pscoast \\\n\t";
-	printf FCMD "-J\$MAP_PROJECTION\$MAP_SCALE \\\n\t";
-	printf FCMD "-R\$MAP_REGION \\\n\t";
-	if ($coast_lakefill)
-		{
-		printf FCMD "-C$coast_lakefill \\\n\t";
-		}
-	if ($coast_resolution)
-		{
-		printf FCMD "-D$coast_resolution \\\n\t";
-		}
-	if ($coast_dryfill)
-		{
-		printf FCMD "-G$coast_dryfill \\\n\t";
-		}
-	if ($coast_river)
-		{
-		printf FCMD "-I$coast_river \\\n\t";
-		}
-	for ($i = 0; $i < scalar(@coast_boundaries); $i++)
-		{
-		printf FCMD "-N$coast_boundaries[$i] \\\n\t";
-		}
-	if ($coast_wetfill)
-		{
-		printf FCMD "-S$coast_wetfill \\\n\t";
-		}
-	if ($coast_pen)
-		{
-		printf FCMD "-W$coast_pen \\\n\t";
-		}
-	if ($portrait)
-		{
-		printf FCMD "-P ";
-		}
-	if ($first_gmt == 1)
-		{
-		$first_gmt = 0;
-		printf FCMD "$first\n";
-		}
-	else
-		{
-		printf FCMD "$middle\n";
-		}
-	}
-
-# do xy plots
-for ($i = 0; $i < scalar(@xyfiles); $i++)
-	{
-	printf FCMD "#\n# Make xy data plot\n";
-	printf FCMD "echo Running gmt module psxy...\n";
-	printf FCMD "gmt psxy $xyfiles[$i] \\\n\t";
-	printf FCMD "-J\$MAP_PROJECTION\$MAP_SCALE \\\n\t";
-	printf FCMD "-R\$MAP_REGION \\\n\t";
-	if ($xyfills[$i] ne "N")
-		{
-		printf FCMD "-G$xyfills[$i] \\\n\t";
-		}
-	if ($xysymbols[$i] ne "N")
-		{
-		printf FCMD "-S$xysymbols[$i] \\\n\t";
-		}
-	if ($xysegments[$i] ne "N")
-		{
-		if ($xysegchars[$i] eq "#")
-			{
-			printf FCMD "-M\\# \\\n\t";
-			}
-		else
-			{
-			printf FCMD "-M\'$xysegchars[$i]\' \\\n\t";
-			}
-		}
-	if ($xypens[$i] ne "N")
-		{
-		printf FCMD "-W$xypens[$i] \\\n\t";
-		}
-	if ($portrait)
-		{
-		printf FCMD "-P ";
-		}
-	if ($first_gmt == 1)
-		{
-		$first_gmt = 0;
-		printf FCMD "$first\n";
-		}
-	else
-		{
-		printf FCMD "$middle\n";
-		}
-	}
-
-# do swath nav plots
-if ($swathnavdatalist)
-	{
-	if (!$swathformat)
-		{
-		$swathformatline = `mbformat -I $swathnavdatalist -L`;
-		($swathformat) = $swathformatline =~ /(\S+)/;
-		if ($swathformat == 0)
-			{
-			$swathformat = -1;
-			}
-		}
-
-	printf FCMD "#\n# Make swath nav plot\n";
-	printf FCMD "echo Running gmt module mbcontour...\n";
-	printf FCMD "gmt mbcontour -F$swathformat -I$swathnavdatalist \\\n\t";
-	printf FCMD "-J\$MAP_PROJECTION\$MAP_SCALE \\\n\t";
-	printf FCMD "-R\$MAP_REGION \\\n\t";
-	if ($navigation_mode)
-		{
-		printf FCMD "-D$navigation_control \\\n\t";
-		}
-	if ($name_mode && $name_perp != 0)
-		{
-		printf FCMD "-G$nav_name_hgt/1 \\\n\t";
-		}
-	elsif ($name_mode)
-		{
-		printf FCMD "-G$nav_name_hgt \\\n\t";
-		}
-	if ($pingnumber_mode)
-		{
-		printf FCMD "-M$pingnumber_control \\\n\t";
-		}
-	if ($portrait)
-		{
-		printf FCMD "-P ";
-		}
-	if ($first_gmt == 1)
-		{
-		$first_gmt = 0;
-		printf FCMD "$first\n";
-		}
-	else
-		{
-		printf FCMD "$middle\n";
-		}
-	}
-
-# do psscale plot
-if ($color_mode && ($color_pallette < 5 || $color_pallette >= 8) && $gridprojected != 2)
-	{
-	printf FCMD "#\n# Make color scale\n";
-	printf FCMD "echo Running gmt module psscale...\n";
-	printf FCMD "gmt psscale -C\$CPT_FILE \\\n\t";
-	printf FCMD "-D%.4f/%.4f/%.4f/%.4f%s \\\n\t",
-		$colorscale_offx,$colorscale_offy,
-		$colorscale_length,$colorscale_thick,
-		$colorscale_vh;
-	print FCMD "-B+l\"$slabel\" \\\n\t";
-#	if ($stretch_color)
-#		{
-#		print FCMD "-L \\\n\t";
-#		}
-	if ($portrait)
-		{
-		printf FCMD "-P ";
-		}
-	printf FCMD "$middle\n";
-	}
-
-# do pstext plot
-if (@text)
-	{
-	printf FCMD "#\n# Make text labels\n";
-	printf FCMD "echo Running gmt module pstext...\n";
-	printf FCMD "gmt pstext -J\$MAP_PROJECTION\$MAP_SCALE \\\n\t";
-	printf FCMD "-R\$MAP_REGION \\\n\t";
-	printf FCMD "$middle <<EOT\n";
-	foreach $text_info (@text) {
-	    ($tx, $ty, $tsize, $tangle, $font, $just, $txt) = $text_info
-		=~ /^(\S+)\/(\S+)\/(\S+)\/(\S+)\/(\S+)\/(\S+)\/(.+)/;
-	    print "text_info:$text_info\n";
-	    print "txt:$txt\n";
-	    print FCMD "$tx $ty $tsize $tangle $font $just $txt\n";
-	    }
-	print FCMD "EOT\n";
-	}
-
-# do psbasemap plot
-printf FCMD "#\n# Make basemap\n";
-printf FCMD "echo Running gmt module psbasemap...\n";
-printf FCMD "gmt psbasemap -J\$MAP_PROJECTION\$MAP_SCALE \\\n\t";
-printf FCMD "-R\$MAP_REGION \\\n\t";
-printf FCMD "$axes \\\n\t";
-if ($length_scale)
-	{
-	printf FCMD "-L$length_scale \\\n\t";
-	}
-if ($unix_stamp_on && $unix_stamp)
-	{
-	printf FCMD "-U$unix_stamp \\\n\t";
-	}
-elsif ($unix_stamp_on)
-	{
-	printf FCMD "-U \\\n\t";
-	}
-if ($portrait)
-	{
-	printf FCMD "-P ";
-	}
-printf FCMD "$end\n";
-
-# delete surplus files
-print FCMD "#\n# Delete surplus files\n";
-print FCMD "echo Deleting surplus files...\n";
-print FCMD "/bin/rm -f gmt.conf\n";
-if (!$file_cpt)
-	{
-	print FCMD "/bin/rm -f \$CPT_FILE\n";
-	}
-if ($data_scale)
-	{
-	printf FCMD "/bin/rm -f $file_use\n";
-	}
-if ($file_slope)
-	{
-	printf FCMD "/bin/rm -f $file_slope\n";
-	}
-
-# display image on screen if desired
-print FCMD "#\n# Run $ps_viewer\n";
-if ($ps_viewer eq "xpsview")
-	{
-	if ($portrait)
-		{
-		$view_pageflag = "-ps $pagesize -maxp $xpsview_mem{$pagesize}";
-		}
-	elsif ($landscape)
-		{
-		$view_pageflag = "-ps $pagesize -or landscape -maxp $xpsview_mem{$pagesize}";
-		}
-	}
-elsif ($ps_viewer eq "pageview")
-	{
-	if ($portrait)
-		{
-		$view_pageflag = "-w $page_width_in{$pagesize} -h $page_height_in{$pagesize}";
-		}
-	elsif ($landscape)
-		{
-		$view_pageflag = "-w $page_height_in{$pagesize} -h $page_width_in{$pagesize}";
-		}
-	}
-elsif ($ps_viewer eq "ghostview")
-	{
-	if ($portrait)
-		{
-		$view_pageflag = "-portrait -media BBox";
-		}
-	elsif ($landscape)
-		{
-		$view_pageflag = "-landscape -media BBox";
-		}
-	}
-elsif ($ps_viewer eq "gv")
-	{
-	if ($portrait)
-		{
-		$pagescale = 11.0 / $page_height_in{$pagesize};
-		if ($pagescale > 1.0)
-			{
-			$pagescale = 1.0;
-			}
-		$view_pageflag = "--orientation=portrait --media=BBox -scale=$pagescale -page=$psfile";
-		}
-	elsif ($landscape)
-		{
-		$pagescale = 11.0 / $page_width_in{$pagesize};
-		if ($pagescale > 1.0)
-			{
-			$pagescale = 1.0;
-			}
-		$view_pageflag = "--orientation=landscape --media=BBox -scale=$pagescale -page=$psfile";
-		}
-	}
-elsif ($ps_viewer eq "ggv")
-	{
-	if ($portrait)
-		{
-		$view_pageflag = "--geometry=portrait";
-		}
-	elsif ($landscape)
-		{
-		$view_pageflag = "--geometry=landscape";
-		}
-	}
-elsif ($ps_viewer eq "evince")
-	{
-	$view_pageflag = " ";
-	}
-if ($no_view_ps)
-	{
-        print FCMD "#if (!(\$#argv > 0 && (\"\$1\" == \"-N\" || \"\$1\" == \"-n\"))) then\n";
-	print FCMD "#echo Running $ps_viewer in background...\n";
-	print FCMD "#$ps_viewer $view_pageflag $psfile &\n";
-        print FCMD "#endif\n";
-	}
-else
-	{
-        print FCMD "if (!(\$#argv > 0 && (\"\$1\" == \"-N\" || \"\$1\" == \"-n\"))) then\n";
-	print FCMD "echo Running $ps_viewer in background...\n";
-	print FCMD "$ps_viewer $view_pageflag $psfile &\n";
-        print FCMD "endif\n";
-	}
-
-# claim it's all over
-print FCMD "#\n# All done!\n";
-print FCMD "echo All done!\n";
-
-# now close the shellscript and make it executable
-close FCMD;
-chmod 0775, $cmdfile;
-
-# tell program status
-if ($verbose)
-	{
-	print "\nProgram Status:\n";
-	print "--------------\n";
-	print "\n  GMT Version:\n";
-	print "    Version $gmt_version\n";
-	print "\n  Plot Style:\n";
-	if ($color_mode == 1)
-		{
-		print "    Color Fill\n";
-		}
-	elsif ($color_mode == 2)
-		{
-		print "    Color Shaded Relief\n";
-		}
-	elsif ($color_mode == 3 && $file_intensity && $stretch_shade)
-		{
-		print "    Color Shaded by Equalized Intensity File\n";
-		}
-	elsif ($color_mode == 3 && $file_intensity)
-		{
-		print "    Color Shaded by Unaltered Intensity File\n";
-		}
-	elsif ($color_mode == 4)
-		{
-		print "    Color Fill of Slope Magnitude\n";
-		}
-	elsif ($color_mode == 5)
-		{
-		print "    Color Shaded by Slope Magnitude\n";
-		}
-	if ($contour_mode)
-		{
-		print "    Contours\n";
-		}
-	if ($coast_control)
-		{
-		print "    Coastline\n";
-		}
-	if (@xyfiles)
-		{
-		print "    XY Plots of ", scalar(@xyfiles), " Datasets\n";
-		}
-	if ($color_mode && ($color_pallette < 5 || $color_pallette == 8))
-		{
-		if ($colorscale_vh eq "v")
-			{
-			print "    Vertical Color Scale\n";
-			}
-		else
-			{
-			print "    Horizontal Color Scale\n";
-			}
-		}
-	if (@text)
-		{
-		print "    ", scalar(@text), " Text labels\n";
-		}
-	if ($length_scale)
-		{
-		print "    Map distance scale\n";
-		}
-	if ($unix_stamp_on && $unix_stamp)
-		{
-		print "    Unix time stamp: $unix_stamp\n";
-		}
-	elsif ($unix_stamp_on)
-		{
-		print "    Unix time stamp\n";
-		}
-	print "\n  Input Files:\n";
-	if ($file_data_no_list)
-		{
-		print "    Data GRD File:            $file_data\n";
-		}
-	else
-		{
-		print "    Data GRD List File:       $file_data\n";
-		foreach $file_data (@files_data) {
-			print "    Data GRD File:            $file_data\n";
-		}
-		}
-	if ($file_intensity_no_list)
-		{
-		print "    Intensity GRD File:       $file_intensity\n";
-		}
-	else
-		{
-		print "    Intensity GRD List File:   $file_intensity\n";
-		foreach $file_int (@files_intensity) {
-			print "    Data GRD File:            $file_int\n";
-		}
-		}
-	if ($swathnavdatalist)
-		{
-		print "    Swath Nav Datalist:        $swathnavdatalist\n";
-		}
-	foreach $xyfile (@xyfiles) {
-		print "    XY Data File:             $xyfile\n";
-	}
-	print "\n  Output Files:\n";
-	print "    Output plot name root:    $root\n";
-	print "    Color pallette table:     $cptfile\n";
-	print "    Plotting shellscript:     $cmdfile\n";
-	print "    Plot file:                $psfile\n";
-	print "\n  Plot Attributes:\n";
-	printf "    Plot width:               %.4f\n", $plot_width;
-	printf "    Plot height:              %.4f\n", $plot_height;
-	print "    Page size:                $pagesize\n";
-	print "    Page width:               $width\n";
-	print "    Page height:              $height\n";
-	print "    Projection:               -J$projection$projection_pars\n";
-	print "    Axes annotation:          $axes\n";
-	if ($portrait)
-		{
-		print "    Orientation:              portrait\n";
-		}
-	else
-		{
-		print "    Orientation:              landscape\n";
-		}
-	if ($color_mode)
-		{
-		print "    Number of colors:         $ncolors\n";
-		print "    Color Pallette:           ",
-			"@color_pallette_names[$color_pallette - 1]\n";
-		if ($color_flip && color_pallette < 4)
-			{
-			print "    Colors reversed\n";
-			}
-		elsif ($color_flip)
-			{
-			print "    Grayscale reversed\n";
-			}
-		if ($shade_flip)
-			{
-			print "    Shading reversed\n";
-			}
-		}
-	print "\n  Grid Data Attributes:\n";
-	if ($data_scale)
-		{
-		print "    Data scale factor:        $data_scale\n";
-		}
-	printf "    Longitude min max:        %14.9f  %14.9f\n",
-		$xmin, $xmax;
-	printf "    Latitude min max:         %14.9f  %14.9f\n",
-		$ymin, $ymax;
-	printf "    Data min max:             %9.4g  %9.4g\n",
-		$zmin, $zmax;
-	print "\n  Primary Grid Plotting Controls:\n";
-	if ($contour_mode)
-		{
-		print "    Contour control:          $contour_control\n";
-		}
-	if ($color_mode && $stretch_color)
-		{
-		printf "    Color start datum:        %f\n", $color_start;
-		printf "    Color end datum:          %f\n", $color_end;
-		printf "    Histogram stretch applied to color pallette\n";
-		}
-	elsif ($color_mode)
-		{
-		printf "    Color start datum:        %f\n", $color_start;
-		printf "    Color end datum:          %f\n", $color_end;
-		printf "    Color datum interval:     %f\n", $color_int;
-		}
-	if ($dpi && $color_mode)
-		{
-		printf "    Image dots-per-inch:      $dpi\n";
-		}
-	if ($color_mode == 3 && !$file_intensity)
-		{
-		printf "    Shading Magnitude:        %f\n", $magnitude;
-		}
-	elsif ($color_mode == 2)
-		{
-		printf "    Illumination Azimuth:     %f\n", $azimuth;
-		printf "    Illumination Elevation:   %f\n", $elevation;
-		printf "    Illumination Magnitude:   %f\n", $magnitude;
-		}
-	elsif ($color_mode == 4)
-		{
-		printf "    Slope Magnitude Magnitude:%f\n", $magnitude;
-		}
-	if ($coast_control)
-		{
-		print "\n  Coastline Plotting Controls:\n";
-		}
-	if ($coast_control && $coast_resolution)
-		{
-		printf "    Coastline resolution:     $coast_resolution\n";
-		}
-	if ($coast_control && $coast_pen)
-		{
-		printf "    Coastline pen:            $coast_pen\n";
-		}
-	if ($coast_control && $coast_wetfill)
-		{
-		printf "    Ocean fill:               $coast_wetfill\n";
-		}
-	if ($coast_control && $coast_lakefill)
-		{
-		printf "    Lake fill:                $coast_lakefill\n";
-		}
-	if ($coast_control && $coast_dryfill)
-		{
-		printf "    Land fill:                $coast_dryfill\n";
-		}
-	if ($coast_control && $coast_river)
-		{
-		printf "    Rivers:                   $coast_river\n";
-		}
-
-	if ($coast_control && $coast_boundaries)
-		{
-		for ($i = 0; $i < scalar(@coast_boundaries); $i++)
-			{
-			printf "    National Boundaries:      $coast_boundaries[$i]\n";
-			}
-		}
-	if ($swathnavdatalist)
-		{
-		print "\n  Swath Navigation Plotting Controls:\n";
-		if ($navigation_mode)
-			{
-			print "    Navigation control:       $navigation_control\n";
-			}
-		if ($pingnumber_mode)
-			{
-			print "    Ping annotation control:  $pingnumber_control\n";
-			}
-		if ($name_mode)
-			{
-			print "    Name annotation height:   $nav_name_hgt\n";
-			if ($name_perp)
-				{
-				print "    Name annotation style:    Perpendicular\n";
-				}
-			else
-				{
-				print "    Name annotation style:    Parallel\n";
-				}
-			}
-		}
-	if (@xyfiles)
-		{
-		print "\n  Primary XY Plotting Controls:\n";
-		printf "    symbol     pen        fill      segment      file\n";
-		printf "    ------     ---        ----      -------      ----\n";
-		for ($i = 0; $i < scalar(@xyfiles); $i++)
-			{
-			printf "    %-10s %-10s %-10s %s%-9s %s\n",
-				$xysymbols[$i], $xypens[$i],
-				$xyfills[$i], $xysegments[$i], $xysegchars[$i],
-				$xyfiles[$i];
-			}
-		}
-	if ($length_scale || $contour_anot_int
-		|| $contour_anot_int || $contour_cut
-		|| $contour_gap || $contour_tick
-		|| $contour_pen)
-		{
-		print "\n  Miscellaneous Plotting Controls:\n";
-		}
-	if ($length_scale)
-		{
-		printf "    Length scale:             $length_scale\n";
-		}
-	if ($contour_anot_int)
-		{
-		printf "    Contour annotation:       $contour_anot_int\n";
-		}
-	if ($contour_anot_int)
-		{
-		printf "    Contour Annotation:       $contour_anot_int\n";
-		}
-	if ($contour_cut)
-		{
-		printf "    Contour cut threshold:    $contour_cut\n";
-		}
-	if ($contour_gap)
-		{
-		printf "    Contour gap control:      $contour_gap\n";
-		}
-	if ($contour_tick)
-		{
-		printf "    Contour tick control:     $contour_tick\n";
-		}
-	if ($contour_pen)
-		{
-		printf "    Contour pen attributes:   $contour_pen\n";
-		}
-	print "\n  GMT Default Values Reset in Script:\n";
-	foreach $gmt_def (@gmt_macro_defs) {
-		($gmt_par, $gmt_var) = $gmt_def =~ /^([^\/]+)\/(.+)/;
-		printf "    %-25s %s\n", $gmt_par, $gmt_var;
-		}
-	foreach $gmt_def (@gmt_defs) {
-		($gmt_par, $gmt_var) = $gmt_def =~ /^([^\/]+)\/(.+)/;
-		printf "    $gmt_par : $gmt_var\n";
-		}
-	print "\n--------------\n";
-	}
-
-# print out final notes
-print "\nPlot generation shellscript <$cmdfile> created.\n";
-print "\nInstructions:\n";
-print "  Execute <$cmdfile> to generate Postscript plot <$psfile>.\n";
-if (!$no_view_ps)
-	{
-	print "  Executing <$cmdfile> also invokes $ps_viewer ";
-	print "to view the plot on the screen.\n";
-	}
-if ($verbose)
-	{
-	print "\n--------------\n\n";
-	}
-
-# execute shellscript if desired
-if ($execute)
-	{
-	if ($verbose)
-		{
-		print "Executing shellscript $cmdfile...\n";
-		}
-	system "$cmdfile &";
-	}
-
-exit 0;
-
-#-----------------------------------------------------------------------
-sub min {
-
-	# make local variables
-	local ($min);
-
-	# get the minimum of the arguments
-	if ($_[0] < $_[1])
-		{
-		$min = $_[0];
-		}
-	else
-		{
-		$min = $_[1];
-		}
-	$min;
-}
-#-----------------------------------------------------------------------
-sub max {
-
-	# make local variables
-	local ($max);
-
-	# get the minimum of the arguments
-	if ($_[0] > $_[1])
-		{
-		$max = $_[0];
-		}
-	else
-		{
-		$max = $_[1];
-		}
-	$max;
-}
-#-----------------------------------------------------------------------
-sub GetDecimalDegrees {
-
-	# make local variables
-	local ($dec_degrees, $degrees, $minutes, $seconds);
-
-	# deal with dd:mm:ss format
-	if ($_[0] =~ /^\S+:\S+:\S+$/)
-		{
-		($degrees, $minutes, $seconds)
-			= $_[0] =~ /^(\S+):(\S+):(\S+)$/;
-		if ($degrees =~ /^-\S+/)
-			{
-			$dec_degrees = $degrees
-				- $minutes / 60.0
-				- $seconds / 3600.0;
-			}
-		else
-			{
-			$dec_degrees = $degrees
-				+ $minutes / 60.0
-				+ $seconds / 3600.0;
-			}
-		}
-	# deal with dd:mm format
-	elsif ($_[0] =~ /^\S+:\S+$/)
-		{
-		($degrees, $minutes)
-			= $_[0] =~ /^(\S+):(\S+)$/;
-		if ($degrees =~ /^-\S+/)
-			{
-			$dec_degrees = $degrees - $minutes / 60.0;
-			}
-		else
-			{
-			$dec_degrees = $degrees + $minutes / 60.0;
-			}
-		}
-
-	# value already in decimal degrees
-	else
-		{
-		$dec_degrees = $_[0];
-		}
-
-	# return decimal degrees;
-	$dec_degrees;
-}
-#-----------------------------------------------------------------------
-sub GetPageSize {
-
-# deal with location of color scale
-if ($scale_loc eq "l")
-	{
-	$space_top =    1.50 * $page_height_in{$pagesize}
-			    / $page_height_in{"a"};
-	$space_bottom = 0.75 * $page_height_in{$pagesize}
-			    / $page_height_in{"a"};
-	$space_left =   2.50 * $page_height_in{$pagesize}
-			    / $page_height_in{"a"};
-	$space_right =  1.00 * $page_height_in{$pagesize}
-			    / $page_height_in{"a"};
-	if ($space_top > 4.50)
-		{
-		$space_top = 4.50;
-		}
-	if ($space_bottom > 2.25)
-		{
-		$space_bottom = 2.25;
-		}
-	if ($space_left > 7.50)
-		{
-		$space_left = 7.50;
-		}
-	if ($space_right > 3.00)
-		{
-		$space_right = 3.00;
-		}
-	}
-elsif ($scale_loc eq "r")
-	{
-	$space_top =    1.50 * $page_height_in{$pagesize}
-			    / $page_height_in{"a"};
-	$space_bottom = 0.75 * $page_height_in{$pagesize}
-			    / $page_height_in{"a"};
-	$space_left =   1.00 * $page_height_in{$pagesize}
-			    / $page_height_in{"a"};
-	$space_right =  2.50 * $page_height_in{$pagesize}
-			    / $page_height_in{"a"};
-	if ($space_top > 4.50)
-		{
-		$space_top = 4.50;
-		}
-	if ($space_bottom > 2.25)
-		{
-		$space_bottom = 2.25;
-		}
-	if ($space_left > 3.00)
-		{
-		$space_left = 3.00;
-		}
-	if ($space_right > 7.50)
-		{
-		$space_right = 7.50;
-		}
-	}
-elsif ($scale_loc eq "t")
-	{
-	$space_top =    2.75 * $page_height_in{$pagesize}
-			    / $page_height_in{"a"};
-	$space_bottom = 0.75 * $page_height_in{$pagesize}
-			    / $page_height_in{"a"};
-	$space_left =   1.00 * $page_height_in{$pagesize}
-			    / $page_height_in{"a"};
-	$space_right =  1.00 * $page_height_in{$pagesize}
-			    / $page_height_in{"a"};
-	if ($space_top > 8.25)
-		{
-		$space_top = 8.25;
-		}
-	if ($space_bottom > 2.25)
-		{
-		$space_bottom = 2.25;
-		}
-	if ($space_left > 3.00)
-		{
-		$space_left = 3.00;
-		}
-	if ($space_right > 3.00)
-		{
-		$space_right = 3.00;
-		}
-	}
-else
-	{
-	$space_top =    1.50 * $page_height_in{$pagesize}
-			    / $page_height_in{"a"};
-	$space_bottom = 2.00 * $page_height_in{$pagesize}
-			    / $page_height_in{"a"};
-	$space_left =   1.00 * $page_height_in{$pagesize}
-			    / $page_height_in{"a"};
-	$space_right =  1.00 * $page_height_in{$pagesize}
-			    / $page_height_in{"a"};
-	if ($space_top > 4.50)
-		{
-		$space_top = 4.50;
-		}
-	if ($space_bottom > 6.00)
-		{
-		$space_bottom = 6.00;
-		}
-	if ($space_left > 3.00)
-		{
-		$space_left = 3.00;
-		}
-	if ($space_right > 3.00)
-		{
-		$space_right = 3.00;
-		}
-	}
-
-# set the relevent page width and height
-$width_max_landscape = $page_height_in{$pagesize}
-		- $space_left - $space_right;
-$height_max_landscape = $page_width_in{$pagesize}
-		- $space_bottom - $space_top;
-$width_max_portrait = $page_width_in{$pagesize}
-		- $space_left - $space_right;
-$height_max_portrait = $page_height_in{$pagesize}
-		- $space_bottom - $space_top;
-}
-#-----------------------------------------------------------------------
-sub GetProjection {
-
-	# get the map projection flag
-	($projection) = $map_scale =~ /^(\w)/;
-	($projection_pars) = $map_scale =~ /^$projection(\S+)/;
-
-	# see if plot scale or plot width defined
-	$use_scale = 0;
-	$use_width = 0;
-	$separator = "/";
-	$trial_value = 1.0;
-
-	# Cassini Projection
-	if ($projection eq "c")
-		{
-		($plot_scale) = $map_scale =~ /^c\S+\/\S+\/(\S+)$/;
-		$use_scale = 1;
-		}
-	elsif ($projection eq "C")
-		{
-		($plot_width) = $map_scale =~ /^C\S+\/\S+\/(\S+)$/;
-		$use_width = 1;
-		}
-
-	# Mercator Projection
-	elsif ($projection eq "m")
-		{
-		($plot_scale) = $map_scale =~ /^m(\S+)$/;
-		$use_scale = 1;
-		$separator = "";
-		}
-	elsif ($projection eq "M")
-		{
-		($plot_width) = $map_scale =~ /^M(\S+)$/;
-		$use_width = 1;
-		$separator = "";
-		}
-
-	# Oblique Mercator Projection
-	elsif ($projection eq "o")
-		{
-		if ($map_scale =~ /^oa\S+/)
-			{
-			($plot_scale) = $map_scale =~ /^oa\S+\/\S+\/\S+\/(\S+)$/;
-			}
-		elsif ($map_scale =~ /^ob\S+/)
-			{
-			($plot_scale) = $map_scale =~ /^ob\S+\/\S+\/\S+\/\S+\/(\S+)$/;
-			}
-		elsif ($map_scale =~ /^oc\S+/)
-			{
-			($plot_scale) = $map_scale =~ /^oc\S+\/\S+\/\S+\/\S+\/(\S+)$/;
-			}
-		$use_scale = 1;
-		}
-	elsif ($projection eq "O")
-		{
-		if ($map_scale =~ /^Oa\S+/)
-			{
-			($plot_width) = $map_scale =~ /^Oa\S+\/\S+\/\S+\/(\S+)$/;
-			}
-		elsif ($map_scale =~ /^Ob\S+/)
-			{
-			($plot_width) = $map_scale =~ /^Ob\S+\/\S+\/\S+\/\S+\/(\S+)$/;
-			}
-		elsif ($map_scale =~ /^Oc\S+/)
-			{
-			($plot_width) = $map_scale =~ /^Oc\S+\/\S+\/\S+\/\S+\/(\S+)$/;
-			}
-		$use_width = 1;
-		}
-
-	# Equidistant Cylindrical Projection
-	elsif ($projection eq "q")
-		{
-		($plot_scale) = $map_scale =~ /^q\S+\/(\S+)$/;
-		$use_scale = 1;
-		}
-	elsif ($projection eq "Q")
-		{
-		($plot_width) = $map_scale =~ /^Q\S+\/(\S+)$/;
-		$use_width = 1;
-		}
-
-	# Transverse Mercator Projection
-	elsif ($projection eq "t")
-		{
-		($plot_scale) = $map_scale =~ /^t\S+\/(\S+)$/;
-		$use_scale = 1;
-		}
-	elsif ($projection eq "T")
-		{
-		($plot_width) = $map_scale =~ /^T\S+\/(\S+)$/;
-		$use_width = 1;
-		}
-
-	# Universal Transverse Mercator Projection
-	elsif ($projection eq "u")
-		{
-		($plot_scale) = $map_scale =~ /^u\S+\/(\S+)$/;
-		$use_scale = 1;
-		}
-	elsif ($projection eq "U")
-		{
-		($plot_width) = $map_scale =~ /^U\S+\/(\S+)$/;
-		$use_width = 1;
-		}
-
-	# Basic Cylindrical Projection
-	elsif ($projection eq "y")
-		{
-		($plot_scale) = $map_scale =~ /^y\S+\/\S+\/(\S+)$/;
-		$use_scale = 1;
-		}
-	elsif ($projection eq "Y")
-		{
-		($plot_width) = $map_scale =~ /^Y\S+\/\S+\/(\S+)$/;
-		$use_width = 1;
-		}
-
-	# Lambert Azimuthal Projection
-	elsif ($projection eq "a")
-		{
-		($plot_scale) = $map_scale =~ /^a\S+\/\S+\/(\S+)$/;
-		$use_scale = 1;
-		$trial_value = "1:1";
-		$use_ratio = 1;
-		}
-	elsif ($projection eq "A")
-		{
-		($plot_width) = $map_scale =~ /^A\S+\/\S+\/(\S+)$/;
-		$use_width = 1;
-		}
-
-	# Equidistant Projection
-	elsif ($projection eq "e")
-		{
-		($plot_scale) = $map_scale =~ /^e\S+\/\S+\/(\S+)$/;
-		$use_scale = 1;
-		$trial_value = "1:1";
-		$use_ratio = 1;
-		}
-	elsif ($projection eq "E")
-		{
-		($plot_width) = $map_scale =~ /^E\S+\/\S+\/(\S+)$/;
-		$use_width = 1;
-		}
-
-	# Orthographic Projection
-	elsif ($projection eq "g")
-		{
-		($plot_scale) = $map_scale =~ /^g\S+\/\S+\/(\S+)$/;
-		$use_scale = 1;
-		$trial_value = "1:1";
-		$use_ratio = 1;
-		}
-	elsif ($projection eq "G")
-		{
-		($plot_width) = $map_scale =~ /^G\S+\/\S+\/(\S+)$/;
-		$use_width = 1;
-		}
-
-	# General Sterographic Projection
-	elsif ($projection eq "s")
-		{
-		($plot_scale) = $map_scale =~ /^s\S+\/\S+\/(\S+)$/;
-		$use_scale = 1;
-		$trial_value = "1:1";
-		$use_ratio = 1;
-		}
-	elsif ($projection eq "S")
-		{
-		($plot_width) = $map_scale =~ /^S\S+\/\S+\/(\S+)$/;
-		$use_width = 1;
-		}
-
-	# Albers Projection
-	elsif ($projection eq "b")
-		{
-		($plot_scale) = $map_scale =~ /^b\S+\/\S+\/\S+\/\S+\/(\S+)$/;
-		$use_scale = 1;
-		}
-	elsif ($projection eq "B")
-		{
-		($plot_width) = $map_scale =~ /^B\S+\/\S+\/\S+\/\S+\/(\S+)$/;
-		$use_width = 1;
-		}
-
-	# Lambert Conic Projection
-	elsif ($projection eq "l")
-		{
-		($plot_scale) = $map_scale =~ /^l\S+\/\S+\/\S+\/\S+\/(\S+)$/;
-		$use_scale = 1;
-		}
-	elsif ($projection eq "L")
-		{
-		($plot_width) = $map_scale =~ /^L\S+\/\S+\/\S+\/\S+\/(\S+)$/;
-		$use_width = 1;
-		}
-
-	# Hammer Projection
-	elsif ($projection eq "h")
-		{
-		($plot_scale) = $map_scale =~ /^h\S+\/(\S+)$/;
-		$use_scale = 1;
-		}
-	elsif ($projection eq "H")
-		{
-		($plot_width) = $map_scale =~ /^H\S+\/(\S+)$/;
-		$use_width = 1;
-		}
-
-	# Sinusoidal Projection
-	elsif ($projection eq "i")
-		{
-		($plot_scale) = $map_scale =~ /^i\S+\/(\S+)$/;
-		$use_scale = 1;
-		}
-	elsif ($projection eq "I")
-		{
-		($plot_width) = $map_scale =~ /^I\S+\/(\S+)$/;
-		$use_width = 1;
-		}
-
-	# Eckert VI Projection
-	elsif ($projection eq "k")
-		{
-		($plot_scale) = $map_scale =~ /^k\S+\/(\S+)$/;
-		$use_scale = 1;
-		}
-	elsif ($projection eq "K")
-		{
-		($plot_width) = $map_scale =~ /^K\S+\/(\S+)$/;
-		$use_width = 1;
-		}
-
-	# Robinson Projection
-	elsif ($projection eq "n")
-		{
-		($plot_scale) = $map_scale =~ /^n\S+\/(\S+)$/;
-		$use_scale = 1;
-		}
-	elsif ($projection eq "N")
-		{
-		($plot_width) = $map_scale =~ /^N\S+\/(\S+)$/;
-		$use_width = 1;
-		}
-
-	# Winkel Tripel Projection
-	elsif ($projection eq "r")
-		{
-		($plot_scale) = $map_scale =~ /^r\S+\/(\S+)$/;
-		$use_scale = 1;
-		}
-	elsif ($projection eq "R")
-		{
-		($plot_width) = $map_scale =~ /^R\S+\/(\S+)$/;
-		$use_width = 1;
-		}
-
-	# Mollweide Projection
-	elsif ($projection eq "w")
-		{
-		($plot_scale) = $map_scale =~ /^w\S+\/(\S+)$/;
-		$use_scale = 1;
-		}
-	elsif ($projection eq "W")
-		{
-		($plot_width) = $map_scale =~ /^W\S+\/(\S+)$/;
-		$use_width = 1;
-		}
-
-	# Linear Polar Projection
-	elsif ($projection eq "p")
-		{
-		($plot_scale) = $map_scale =~ /^p(\S+)$/;
-		$use_scale = 1;
-		$separator = "";
-		}
-	elsif ($projection eq "P")
-		{
-		($plot_width) = $map_scale =~ /^P(\S+)$/;
-		$use_width = 1;
-		$separator = "";
-		}
-
-	# Linear Projection
-	elsif ($projection eq "x")
-		{
-		if ($map_scale =~ /^xd$/)
-			{
-			$linear = 1;
-			chop($map_scale);
-			}
-		else
-			{
-			$linear = 1;
-			($plot_scale) = $map_scale =~ /^x(\S+)$/;
-			}
-		$use_scale = 1;
-		$separator = "";
-		}
-	elsif ($projection eq "X")
-		{
-		if ($map_scale =~ /^Xd$/)
-			{
-			$linear = 1;
-			chop($map_scale);
-			}
-		else
-			{
-			$linear = 1;
-			($plot_width) = $map_scale =~ /^X(\S+)$/;
-			}
-		$use_width = 1;
-		$separator = "";
-		}
-}
-#-----------------------------------------------------------------------
-sub GetBaseTick {
-
-	# figure out some reasonable tick intervals for the basemap
-	if ($gridprojected == 2)
-		{
-		if ($xmax - $xmin > 200)
-			{
-			$base_tick_x = 200;
-			}
-		else
-			{
-			$base_tick_x = $xmax - $xmin;
-			}
-		$base_tick_y = 10.0**(floor(log(abs($ymax - $ymin) / 5) / log (10)));
-		}
-	else
-		{
-		$base_tick_x = ($xmax - $xmin) / 3;
-		$base_tick_y = ($ymax - $ymin) / 3;
-		}
-
-	# deal with seismic grids (time vs trace number)
-	if ($gridprojected == 2)
-		{
-		$base_gridline_y = $base_tick_y / 2;
-		$base_tick_y = "a$base_tick_y" . "g$base_gridline_y";
-                $base_tick_xlabel = "\"Trace Number\"";
-                $base_tick_ylabel = "\"Time (sec)\"";
-		}
-
-	# deal with generic linear grids
-	elsif ($gridprojected == 3)
-		{
-		$base_tick_xlabel = "\"$xunits\"";
-		$base_tick_ylabel = "\"$yunits\"";
-		}
-
-	# deal with linear plot of projected grid
-	elsif ($gridprojected == 1)
-		{
-		$base_tick = &min($base_tick_x, $base_tick_y);
-		$base_tick_x = $base_tick;
-		$base_tick_y = $base_tick;
-		}
-
-	# deal with geographic grid
-	elsif ($gridprojected == 0)
-		{
-		$base_tick = &min($base_tick_x, $base_tick_y);
-		if ($base_tick < 0.00006944444445)
-			{
-			$base_tick = "0.25s";
-			}
-		elsif ($base_tick < 0.00013888888889)
-			{
-			$base_tick = "0.5s";
-			}
-		elsif ($base_tick < 0.0002777777)
-			{
-			$base_tick = "1s";
-			}
-		elsif ($base_tick < 0.0005555555)
-			{
-			$base_tick = "2s";
-			}
-		elsif ($base_tick < 0.0013888889)
-			{
-			$base_tick = "5s";
-			}
-		elsif ($base_tick < 0.0027777778)
-			{
-			$base_tick = "10s";
-			}
-		elsif ($base_tick < 0.0041666667)
-			{
-			$base_tick = "15s";
-			}
-		elsif ($base_tick < 0.0083333333)
-			{
-			$base_tick = "30s";
-			}
-		elsif ($base_tick < 0.0166667)
-			{
-			$base_tick = "1m";
-			}
-		elsif ($base_tick < 0.0333333)
-			{
-			$base_tick = "2m";
-			}
-		elsif ($base_tick < 0.0833333)
-			{
-			$base_tick = "5m";
-			}
-		elsif ($base_tick < 0.1666667)
-			{
-			$base_tick = "10m";
-			}
-		elsif ($base_tick < 0.25)
-			{
-			$base_tick = "15m";
-			}
-		elsif ($base_tick < 0.5)
-			{
-			$base_tick = "30m";
-			}
-		elsif ($base_tick < 1.0)
-			{
-			$base_tick = "1";
-			}
-		elsif ($base_tick < 2.0)
-			{
-			$base_tick = "2";
-			}
-		elsif ($base_tick < 5.0)
-			{
-			$base_tick = "5";
-			}
-		elsif ($base_tick < 10.0)
-			{
-			$base_tick = "10";
-			}
-		elsif ($base_tick < 15.0)
-			{
-			$base_tick = "15";
-			}
-		elsif ($base_tick < 30.0)
-			{
-			$base_tick = "30";
-			}
-		elsif ($base_tick < 30.0)
-			{
-			$base_tick = "30";
-			}
-		elsif ($base_tick < 360.0)
-			{
-			$base_tick = "60";
-			}
-		$base_tick_x = $base_tick;
-		$base_tick_y = $base_tick;
-		}
-
-}
-#-----------------------------------------------------------------------
-# This version of Getopts has been augmented to support multiple
-# calls to the same option. If an arg in argumentative is followed
-# by "+" rather than ":",  then the corresponding scalar will
-# be concatenated rather than overwritten by multiple calls to
-# the same arg.
-#
-# Usage:
-#      do Getopts('a:b+c'); # -a takes arg, -b concatenates args,
-#			    # -c does not take arg. Sets opt_* as a
-#                           # side effect.
-
-sub MBGetopts {
-    local($argumentative) = @_;
-    local(@args,$_,$first,$rest);
-    local($errs) = 0;
-
-    @args = split( / */, $argumentative );
-    while(@ARGV && ($_ = $ARGV[0]) =~ /^-(.)(.*)/) {
-	($first,$rest) = ($1,$2);
-	$pos = index($argumentative,$first);
-	if($pos >= $[) {
-	    if($args[$pos+1] eq ':') {
-		shift(@ARGV);
-		if($rest eq '') {
-		    ++$errs unless @ARGV;
-		    $rest = shift(@ARGV);
-		}
-		eval "\$opt_$first = \$rest;";
-		eval "\$flg_$first = 1;";
-	    }
-	    elsif($args[$pos+1] eq '+') {
-		shift(@ARGV);
-		if($rest eq '') {
-		    ++$errs unless @ARGV;
-		    $rest = shift(@ARGV);
-		}
-		if (eval "\$opt_$first") {
-		    eval "\$opt_$first = \$opt_$first
-				. \":\" . \$rest;";
-		}
-		else {
-		    eval "\$opt_$first = \$rest;";
-		}
-		eval "\$flg_$first = 1;";
-	    }
-	    elsif($args[$pos+1] eq '%') {
-		shift(@ARGV);
-		if($rest ne '') {
-		    eval "\$opt_$first = \$rest;";
-		}
-		else {
-		    $rest = $ARGV[0];
-		    ($one) = $rest =~ /^-(.).*/;
-		    $pos = index($argumentative,$one);
-		    if(!$one || $pos < $[) {
-			eval "\$opt_$first = \$rest;";
-			shift(@ARGV);
-		    }
-		}
-		eval "\$flg_$first = 1;";
-	    }
-	    else {
-		eval "\$opt_$first = 1";
-		eval "\$flg_$first = 1;";
-		if($rest eq '') {
-		    shift(@ARGV);
-		}
-		else {
-		    $ARGV[0] = "-$rest";
-		}
-	    }
-	}
-	else {
-	    print STDERR "Unknown option: $first\n";
-	    ++$errs;
-	    if($rest ne '') {
-		$ARGV[0] = "-$rest";
-	    }
-	    else {
-		shift(@ARGV);
-	    }
-	}
-    }
-    $errs == 0;
-}
-#-----------------------------------------------------------------------
diff --git a/src/macros/mbm_grdtiff b/src/macros/mbm_grdtiff
deleted file mode 100755
index 8e9b588..0000000
--- a/src/macros/mbm_grdtiff
+++ /dev/null
@@ -1,2149 +0,0 @@
-#!/usr/bin/env perl
-#--------------------------------------------------------------------
-#    The MB-system:	mbm_grdtiff.perl	11/3/1999
-#    $Id: mbm_grdtiff 2234 2015-03-05 07:41:54Z caress $
-#
-#    Copyright (c) 1999-2015 by
-#    D. W. Caress (caress at mbari.org)
-#      Monterey Bay Aquarium Research Institute
-#      Moss Landing, CA
-#    and D. N. Chayes (dale at lamont.ldgo.columbia.edu)
-#      Lamont-Doherty Earth Observatory
-#      Palisades, NY  10964
-#
-#    See README file for copying and redistribution conditions.
-#--------------------------------------------------------------------
-#
-# Command:
-#   mbm_grdtiff
-#
-# Purpose:
-#   Macro to generate a shellscript which, when executed, will
-#   generate a geographically located TIFF image of gridded
-#   data. The primary purpose of this macro is to allow the simple,
-#   semi-automated production of a nice looking image with a few
-#   command line arguments. This image can be loaded into the
-#   ArcInfo and ArcView GIS packages as geographically located
-#   coverages. Several styles of images can be generated, including
-#   color fill and shaded relief maps. The available options mirror
-#   a subset of the options in mbm_grdplot, allowing users to easily
-#   generate equivalent Postscript plots and TIFF images of gridded
-#   data.
-#
-# Basic Usage:
-#   mbm_grdtiff -Ifile [-Amagnitude[/azimuth/elevation]
-#            -Gcolor_mode -H -Kintensity_file -Oroot
-#            -S[color/shade] -V
-#            -Wcolor_style[/pallette[/ncolors]] ]
-#
-# Additional Options:
-#            [-Dflipcolor/flipshade -MGSscalefactor
-#            -Q -Rw/e/s/n -X -Y -Zmin/max[/mode]]
-#
-# Author:
-#   David W. Caress
-#   Lamont-Doherty Earth Observatory
-#   Palisades, NY  10964
-#   October 19, 1994
-#
-# Version:
-#   $Id: mbm_grdtiff 2234 2015-03-05 07:41:54Z caress $
-#
-#
-#
-$program_name = "mbm_grdtiff";
-
-# set degree to radians conversion
-$DTR = 3.1415926 / 180.0;
-
-# set default number of colors
-$ncpt = 11;
-
-# define color pallettes
-
- at color_pallette_names = (   "Haxby Colors",
-			    "High Intensity Colors",
-			    "Low Intensity Colors",
-			    "Grayscale",
-			    "Uniform Gray",
-			    "Uniform Black",
-			    "Uniform White");
-
-# original Haxby color pallette
-#	$ncolors = 15;
-#	@cptbr = (255, 255, 255, 255, 255, 240, 205, 138, 106,  87,  50,   0,  40,  21,  37);
-#	@cptbg = (255, 221, 186, 161, 189, 236, 255, 236, 235, 215, 190, 160, 127,  92,  57);
-#	@cptbb = (255, 171, 133,  68,  87, 121, 162, 174, 255, 255, 255, 255, 251, 236, 175);
-#                 use       use  use  use  use  use  use  use       use       use       use
-
-# color pallette 1 - Haxby Color Table
-	@cptbr1 = (255, 255, 255, 255, 240, 205, 138, 106,  50,  40,  37);
-	@cptbg1 = (255, 186, 161, 189, 236, 255, 236, 235, 190, 127,  57);
-	@cptbb1 = (255, 133,  68,  87, 121, 162, 174, 255, 255, 251, 175);
-
-# color pallette 2 - High Intensity Colors
-	@cptbr2 = (255, 255, 255, 255, 128,   0,   0,   0,   0, 128, 255);
-	@cptbg2 = (  0,  64, 128, 255, 255, 255, 255, 128,   0,   0,   0);
-	@cptbb2 = (  0,   0,   0,   0,   0,   0, 255, 255, 255, 255, 255);
-
-# color pallette 3 - Low Intensity Colors
-	@cptbr3 = (200, 194, 179, 141,  90,   0,   0,   0,   0,  90, 141);
-	@cptbg3 = (  0,  49,  90, 141, 179, 200, 141,  90,   0,   0,   0);
-	@cptbb3 = (  0,   0,   0,   0,   0,   0, 141, 179, 200, 179, 141);
-
-# color pallette 4 - Grayscale
-	@cptbr4 = (255, 230, 204, 179, 153, 128, 102,  77,  51,  26,   0);
-	@cptbg4 = (255, 230, 204, 179, 153, 128, 102,  77,  51,  26,   0);
-	@cptbb4 = (255, 230, 204, 179, 153, 128, 102,  77,  51,  26,   0);
-
-# color pallette 5 - Uniform Grayscale
-	@cptbr5 = (128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128);
-	@cptbg5 = (128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128);
-	@cptbb5 = (128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128);
-
-# color pallette 6 - Uniform Black
-	@cptbr6 = (  0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0);
-	@cptbg6 = (  0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0);
-	@cptbb6 = (  0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0);
-
-# color pallette 7 - Uniform White
-	@cptbr7 = (255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255);
-	@cptbg7 = (255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255);
-	@cptbb7 = (255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255);
-
-# Determine the GMT version
- at grdinfo = `grdinfo 2>&1`;
-while (@grdinfo)
-	{
-	$line = shift @grdinfo;
-	if ($line =~
-		/^grdinfo\s+(\S+)\s+\S+/)
-		{
-		($gmt_version) = $line =~
-			/^grdinfo\s+(\S+)\s+\S+/;
-		}
-	}
-
-# Deal with command line arguments (accept but do not necessarily use any argument
-# accepted by mbm_grdplot)
-$command_line = "@ARGV";
-&MBGetopts('A:a:D%d%G%g%HhI:i:J:j:K:k:L:l:M+m+O:o:P:p:QqR:r:S%s%TtU:u:VvW:w:XxYyZ:z:');
-$shade_control = 	($opt_A || $opt_a);
-$color_flip_mode = 	($flg_D || $flg_d);
-$color_flip_control = 	($opt_D || $opt_d);
-$color_mode =   	($opt_G || $opt_g || $flg_G || $flg_g);
-$help =    		($opt_H || $opt_h);
-$file_data =    	($opt_I || $opt_i);
-$file_intensity =    	($opt_K || $opt_k);
-$misc = 		($opt_M || $opt_m);
-$root =    		($opt_O || $opt_o);
-$no_view_tiff = 	($opt_Q || $opt_q);
-$bounds = 		($opt_R || $opt_r);
-$stretch_mode = 	($flg_S || $flg_s);
-$stretch_control = 	($opt_S || $opt_s);
-$verbose = 		($opt_V || $opt_v);
-$color_control = 	($opt_W || $opt_w);
-$execute = 		($opt_X || $opt_x);
-$no_nice_color_int = 	($opt_Y || $opt_y);
-$zbounds = 		($opt_Z || $opt_z);
-
-# print out help message if required
-if ($help)
-	{
-	print "\n$program_name:\n";
-	print "\nVersion: $Id: mbm_grdtiff 2234 2015-03-05 07:41:54Z caress $\n";
-        print "\nMacro to generate a shellscript which, when executed, will \n";
-        print "generate a geographically located TIFF image of gridded \n";
-        print "data. The primary purpose of this macro is to allow the simple, \n";
-        print "semi-automated production of a nice looking image with a few \n";
-        print "command line arguments. This image can be loaded into the \n";
-        print "ArcInfo and ArcView GIS packages as geographically located \n";
-        print "coverages. Several styles of images can be generated, including \n";
-        print "color fill and shaded relief maps. The available options mirror \n";
-        print "a subset of the options in mbm_grdplot, allowing users to easily \n";
-        print "generate equivalent Postscript plots and TIFF images of gridded \n";
-        print "data. \n";
-	print "\nBasic Usage: \n";
-	print "\t$program_name -Ifile [-Amagnitude[/azimuth/elevation] \n";
-	print "\t\t-Gcolor_mode -H -Kintensity_file -Oroot -S[color/shade]\n";
-	print "\t\t-V -Wcolor_style[/pallette[/ncolors]] ]\n";
-	print "Additional Options:\n";
-	print "\t\t[-Dflipcolor/flipshade\n";
-	print "\t\t-MGSscalefactor -MGW -Q -Rw/e/s/n -X -Y -Zmin/max[/mode]]\n";
-	exit 0;
-	}
-
-# check for input file
-if (!$file_data)
-	{
-	print "\a";
-	die "\nNo input file specified!\n$program_name aborted\n";
-	}
-elsif (! -r $file_data)
-	{
-	print "\a";
-	die "\nSpecified input file $file_data cannot be opened!\n$program_name aborted\n";
-	}
-if ($file_intensity && ! -r $file_intensity)
-	{
-	print "\a";
-	die "\nSpecified intensity input file $file_intensity cannot be opened!\n$program_name aborted\n";
-	}
-if ($color_mode == 3 && !$file_intensity)
-	{
-	print "\a";
-	die "\nShading with intensity file set but no intensity input file specified!\n$program_name aborted\n";
-	}
-
-# parse misc commands
-if ($misc)
-	{
-	@misc_cmd = split(/:/, $misc);
-	foreach $cmd (@misc_cmd) {
-
-		# deal with general options
-		##############################
-
-		# set GMT default values
-		if ($cmd =~ /^[Gg][Dd]./)
-			{
-			($gmt_def) = $cmd =~
-				/^[Gg][Dd](\S+)/;
-			push(@gmt_defs, $gmt_def);
-			}
-
-		# set data scaling
-		if ($cmd =~ /^[Gg][Ss]./)
-			{
-			($data_scale) = $cmd =~
-				/^[Gg][Ss](\S+)/;
-			}
-
-		# turn on world file generation
-		if ($cmd =~ /^[Gg][Ww]/)
-			{
-			$make_worldfile = 1;
-			}
-		}
-	}
-
-# set plot mode
-if (!$root)
-	{
-	if ($file_data =~ /.=./)
-		{
-		($root) = $file_data =~ /^(\S+)=./;
-		}
-	else
-		{
-		$root = $file_data;
-		}
-	}
-if (!$color_mode)
-	{
-	$color_mode = 1;
-	}
-if ($shade_control)
-	{
-	if ($shade_control =~ /^(\S+)\/(\S+)\/(\S+)/)
-		{
-		($magnitude, $azimuth, $elevation) =
-			$shade_control =~ /^(\S+)\/(\S+)\/(\S+)/;
-		}
-	elsif ($shade_control =~ /^(\S+)\/(\S+)/)
-		{
-		($magnitude, $azimuth) =
-			$shade_control =~ /^(\S+)\/(\S+)/;
-		}
-	elsif ($shade_control =~ /^(\S+).*/)
-		{
-		($magnitude) =
-			$shade_control =~ /^(\S+).*/;
-		}
-	}
-if ($file_intensity && !$color_mode)
-	{
-	$color_mode = 3;
-	}
-if ($color_mode == 2 && !$azimuth)
-	{
-	$azimuth = 0;
-	}
-if ($color_mode == 2 && !$magnitude)
-	{
-	$magnitude = 1.0;
-	}
-elsif ($color_mode == 3 && !$magnitude)
-	{
-	$magnitude = -0.4;
-	}
-if ($color_mode == 2 && !$elevation)
-	{
-	$elevation = 30.0;
-	}
-if ($color_mode >= 4 && !$magnitude)
-	{
-	$magnitude = 1.0;
-	}
-if ($color_control)
-	{
-	if (-e $color_control)
-		{
-		$file_cpt = $color_control;
-		$color_style = 1;
-		$color_pallette = 1;
-		$ncolors = $ncpt;
-		}
-	elsif ($color_control =~ /\S+\/\S+\/\S+/)
-		{
-		($color_style, $color_pallette, $ncolors)
-			= $color_control =~  /(\S+)\/(\S+)\/(\S+)/;
-		if ($color_pallette < 1
-			|| $color_pallette > 7)
-			{
-			$color_pallette = 1;
-			}
-		if ($ncolors < 2)
-			{
-			$ncolors = 2;
-			}
-		}
-	elsif ($color_control =~ /\S+\/\S+/)
-		{
-		($color_style, $color_pallette) = $color_control
-			=~  /(\S+)\/(\S+)/;
-		if ($color_pallette < 1
-			|| $color_pallette > 7)
-			{
-			$color_pallette = 1;
-			}
-		$ncolors = $ncpt;
-		}
-	else
-		{
-		$color_style = $color_control;
-		$color_pallette = 1;
-		$ncolors = $ncpt;
-		}
-	}
-else
-	{
-	$color_style = 1;
-	$color_pallette = 1;
-	$ncolors = $ncpt;
-	}
-if ($color_flip_control)
-	{
-	if ($color_flip_control =~ /^\S+\/\S+/)
-		{
-		($color_flip, $shade_flip) = $color_flip_control
-			=~ /^(\S+)\/(\S+)/;
-		}
-	elsif ($color_flip_control =~ /^\S+/)
-		{
-		($color_flip) = $color_flip_control
-			=~ /^(\S+)/;
-		}
-	}
-elsif ($color_flip_mode)
-	{
-	$color_flip = 1;
-	}
-if ($color_mode && $shade_flip)
-	{
-	$magnitude = -1 * $magnitude;
-	}
-if ($stretch_control)
-	{
-	if ($stretch_control =~ /^\S+\/\S+/)
-		{
-		($stretch_color, $stretch_shade) = $stretch_control
-			=~ /^(\S+)\/(\S+)/;
-		}
-	elsif ($stretch_control =~ /^\S+/)
-		{
-		($stretch_color) = $stretch_control
-			=~ /^(\S+)/;
-		}
-	}
-elsif ($stretch_mode)
-	{
-	$stretch_color = 1;
-	}
-
-# set page size
-if (!$pagesize)
-	{
-	$pagesize = "a";
-	}
-else
-	{
-	$pagesize =~ tr/A-Z/a-z/;
-	if (!$page_width_in{$pagesize})
-		{
-		$pagesize = "a";
-		}
-	}
-
-# use mbdefaults to get the current system default image viewer
-$img_viewer = "xv";
- at mbdefaults = `mbdefaults`;
-while (@mbdefaults)
-        {
-        $line = shift @mbdefaults;
-        if ($line =~ /img viewer:\s+(\S+)/)
-                {
-                ($img_viewer) = $line =~ /img viewer:\s+(\S+)/;
-                 }
-        }
-
-# check environment variable
-if ($ENV{"MB_IMG_VIEWER"})
-	{
-	$img_viewer = $ENV{"MB_IMG_VIEWER"};
-	}
-
-# see if data file is a grd file or a list of grdfiles
- at grdinfo = `grdinfo $file_data 2>&1`;
-while (@grdinfo)
-	{
-	$line = shift @grdinfo;
-	if ($line =~ /\S+\s+x_min:\s+(\S+)\s+x_max:\s+(\S+)\s+x_inc:/)
-		{
-		$file_data_no_list = 1;
-		}
-	}
-if ($file_data_no_list)
-	{
-	push(@files_data, $file_data);
-	}
-else
-	{
-	if (open(FILEDATA,"<$file_data"))
-		{
-		while (<FILEDATA>)
-			{
-			chop($_);
-			push(@files_data, $_);
-			}
-		close FILEDATA;
-		}
-	}
-
-# see if intensity file is a grd file or a list of grdfiles
-if ($file_intensity)
-	{
-	@grdinfo = `grdinfo $file_intensity 2>&1`;
-	while (@grdinfo)
-		{
-		$line = shift @grdinfo;
-		if ($line =~ /\S+\s+x_min:\s+(\S+)\s+x_max:\s+(\S+)\s+x_inc:/)
-			{
-			$file_intensity_no_list = 1;
-			}
-		}
-	if ($file_intensity_no_list)
-		{
-		push(@files_intensity, $file_intensity);
-		}
-	else
-		{
-		if (open(FILEDATA,"<$file_intensity"))
-			{
-			while (<FILEDATA>)
-				{
-				chop($_);
-				push(@files_intensity, $_);
-				}
-			close FILEDATA;
-			}
-		}
-	}
-
-# parse $zbounds to get zmode
-if ($zbounds =~ /(\S+)\/(\S+)\/(\S+)/)
-	{
-	($zmin,$zmax,$zmode) = $zbounds =~ /(\S+)\/(\S+)\/(\S+)/;
-	}
-elsif ($zbounds =~ /(\S+)\/(\S+)/)
-	{
-	($zmin,$zmax) = $zbounds =~ /(\S+)\/(\S+)/;
-	$zmode = 0;
-	}
-else
-	{
-	$zmode = 0;
-	}
-
-# get limits of files using grdinfo
-if (!$bounds || !$zbounds || $zmode == 1)
-	{
-	if ($verbose > 0)
-		{
-		print "\nRunning gmt module grdinfo to get file bounds and min max...\n";
-		}
-
-	foreach $file_grd (@files_data) {
-
-	if ($bounds)
-		{
-		if ($verbose > 0)
-			{
-			print "\tmbm_grdinfo -I$file_grd -R$bounds -V\n";
-			}
-		if ($verbose > 0)
-			{
-			@grdinfo = `mbm_grdinfo -I$file_grd -R$bounds -V`;
-			}
-		else
-			{
-			@grdinfo = `mbm_grdinfo -I$file_grd -R$bounds`;
-			}
-		}
-	else
-		{
-		@grdinfo = `grdinfo $file_grd 2>&1`;
-		if ($verbose > 0)
-			{
-			print "\tgrdinfo -I$file_grd\n";
-			}
-		}
-	while (@grdinfo)
-		{
-		$line = shift @grdinfo;
-		if ($line =~
-			/\s+Projection: UTM Zone \S+/)
-			{
-			($utm_zone) = $line =~
-				/\s+Projection: UTM Zone (\S+)/;
-			$gridprojected = 1;
-			}
-		if ($line =~
-			/\s+Projection: Geographic/)
-			{
-			$gridprojected = 0;
-			}
-
-		if ($line =~
-			/\s+Projection: UTM Zone \S+/)
-			{
-			($utm_zone) = $line =~
-				/\s+Projection: UTM Zone (\S+)/;
-			$gridprojected = 1;
-			}
-		if ($line =~
-			/\s+Projection: SeismicProfile/)
-			{
-			$gridprojected = 2;
-			}
-		if ($line =~
-			/\s+Projection: GenericLinear/)
-			{
-			$gridprojected = 3;
-			}
-		if ($line =~
-			/\s+Projection: Geographic/)
-			{
-			$gridprojected = 0;
-			}
-		if ($line =~
-			/\S+\s+x_min:\s+\S+\s+x_max:\s+\S+\s+x_inc:\s+\S+\s+units:\s+.+\s+nx:\s+\S+/)
-			{
-			($xmin_f,$xmax_f,$xinc_f,$xunits,$xnx_d) = $line =~
-				/\S+\s+x_min:\s+(\S+)\s+x_max:\s+(\S+)\s+x_inc:\s+(\S+)\s+units:\s+(.+)\s+nx:\s+(\S+)/;
-			}
-		elsif ($line =~
-			/\S+\s+x_min:\s+\S+\s+x_max:\s+\S+\s+x_inc:\s+\S+\s+name:\s+.+\s+nx:\s+\S+/)
-			{
-			($xmin_f,$xmax_f,$xinc_f,$xunits,$xnx_d) = $line =~
-				/\S+\s+x_min:\s+(\S+)\s+x_max:\s+(\S+)\s+x_inc:\s+(\S+)\s+name:\s+(.+)\s+nx:\s+(\S+)/;
-			}
-		elsif ($line =~
-			/\S+\s+x_min:\s+(\S+)\s+x_max:\s+(\S+)\s+x_inc:/)
-			{
-			($xmin_f,$xmax_f) = $line =~
-				/\S+\s+x_min:\s+(\S+)\s+x_max:\s+(\S+)\s+x_inc:/;
-			}
-		if ($line =~ /\S+\s+y_min:\s+\S+\s+y_max:\s+\S+\s+y_inc:\s+\S+\s+units:\s+.+\s+ny:\s+\S+/)
-			{
-			($ymin_f,$ymax_f,$yinc_f,$yunits,$yny_d) = $line =~
-				/\S+\s+y_min:\s+(\S+)\s+y_max:\s+(\S+)\s+y_inc:\s+(\S+)\s+units:\s+(.+)\s+ny:\s+(\S+)/;
-			}
-		elsif ($line =~ /\S+\s+y_min:\s+\S+\s+y_max:\s+\S+\s+y_inc:\s+\S+\s+name:\s+.+\s+ny:\s+\S+/)
-			{
-			($ymin_f,$ymax_f,$yinc_f,$yunits,$yny_d) = $line =~
-				/\S+\s+y_min:\s+(\S+)\s+y_max:\s+(\S+)\s+y_inc:\s+(\S+)\s+name:\s+(.+)\s+ny:\s+(\S+)/;
-			}
-		elsif ($line =~ /\S+\s+y_min:\s+\S+\s+y_max:\s+\S+\s+y_inc:/)
-			{
-			($ymin_f,$ymax_f) = $line =~
-				/\S+\s+y_min:\s+(\S+)\s+y_max:\s+(\S+)\s+y_inc:/;
-			}
-		if ($line =~ /\S+\s+zmin:\s+\S+\s+zmax:\s+\S+\s+units:\s+\S+/)
-			{
-			($zmin_f,$zmax_f) = $line =~
-				/\S+\s+zmin:\s+(\S+)\s+zmax:\s+(\S+)\s+units:\s+\S+/;
-			}
-		elsif ($line =~ /\S+\s+zmin:\s+\S+\s+zmax:\s+\S+\s+name:\s+\S+/)
-			{
-			($zmin_f,$zmax_f) = $line =~
-				/\S+\s+zmin:\s+(\S+)\s+zmax:\s+(\S+)\s+name:\s+\S+/;
-			}
-		if ($line =~ /\S+\s+z_min:\s+\S+\s+z_max:\s+\S+\s+units:/)
-			{
-			($zmin_f,$zmax_f,$zunits_s) = $line =~
-				/\S+\s+z_min:\s+(\S+)\s+z_max:\s+(\S+)\s+units:\s+(.+)/;
-			}
-		elsif ($line =~ /\S+\s+z_min:\s+\S+\s+z_max:\s+\S+\s+name:/)
-			{
-			($zmin_f,$zmax_f,$zunits_s) = $line =~
-				/\S+\s+z_min:\s+(\S+)\s+z_max:\s+(\S+)\s+name:\s+(.+)/;
-			}
-		}
-
-	if (!$first_grd)
-		{
-		$first_grd = 1;
-		$xmin = $xmin_f;
-		$xmax = $xmax_f;
-		$ymin = $ymin_f;
-		$ymax = $ymax_f;
-		$zmin_t = $zmin_f;
-		$zmax_t = $zmax_f;
-		}
-	else
-		{
-		$xmin = &min($xmin, $xmin_f);
-		$xmax = &max($xmax, $xmax_f);
-		$ymin = &min($ymin, $ymin_f);
-		$ymax = &max($ymax, $ymax_f);
-		$zmin_t = &min($zmin_t, $zmin_f);
-		$zmax_t = &max($zmax_t, $zmax_f);
-		}
-
-	# check that there are data
-	if ($xmin_f >= $xmax_f || $ymin_f >= $ymax_f
-		|| ($zmin_f >= $zmax_f && !$zbounds))
-		{
-		print "\a";
-		die "The program grdinfo does not appear to have worked \nproperly with file $file_grd!\n$program_name aborted.\n"
-		}
-	}
-	}
-
-# use user defined geographic limits
-if ($bounds)
-	{
-	if ($bounds =~ /^\S+\/\S+\/\S+\/\S+r$/)
-		{
-		($xmin_raw,$ymin_raw,$xmax_raw,$ymax_raw) = $bounds =~
-			/^(\S+)\/(\S+)\/(\S+)\/(\S+)r$/;
-		$xmin = &GetDecimalDegrees($xmin_raw);
-		$xmax = &GetDecimalDegrees($xmax_raw);
-		$ymin = &GetDecimalDegrees($ymin_raw);
-		$ymax = &GetDecimalDegrees($ymax_raw);
-		$use_corner_points = 1;
-		$bounds_plot = $bounds;
-		}
-	elsif ($bounds =~ /^\S+\/\S+\/\S+\/\S+$/)
-		{
-		($xmin_raw,$xmax_raw,$ymin_raw,$ymax_raw) = $bounds =~
-			/(\S+)\/(\S+)\/(\S+)\/(\S+)/;
-		$xmin = &GetDecimalDegrees($xmin_raw);
-		$xmax = &GetDecimalDegrees($xmax_raw);
-		$ymin = &GetDecimalDegrees($ymin_raw);
-		$ymax = &GetDecimalDegrees($ymax_raw);
-		$bounds_plot = $bounds;
-		}
-	elsif ($bounds =~ /^r$/)
-		{
-		$use_corner_points = 1;
-		$xmin = $xmin;
-		$xmax = $xmax;
-		$ymin = $ymin;
-		$ymax = $ymax;
-		$bounds_plot = sprintf ("%1.8g/%1.8g/%1.8g/%1.8gr",
-			$xmin, $ymin, $xmax, $ymax);
-		}
-	}
-
-# set grid to projected if outside geographic bounds
-if ($xmin < -360.0 || $xmax > 360.0
-	|| $ymin < -90.0 || $ymax > 90.0)
-	{
-	$gridprojected = 1;
-	}
-
-# set bounds string for plotting if not already set
-if (!$bounds_plot)
-	{
-	$bounds_plot = sprintf ("%1.8g/%1.8g/%1.8g/%1.8g",
-		$xmin, $xmax, $ymin, $ymax);
-	}
-
-# set $zmin and $zmax from data if $zbounds not available
-if (!$zbounds)
-	{
-	$zmode = 0;
-	$zmin = $zmin_t;
-	$zmax = $zmax_t;
-	}
-
-# check again that there are data
-if ((!$use_corner_points && ($xmin >= $xmax || $ymin >= $ymax))
-	|| $zmin >= $zmax)
-	{
-	print "\a";
-	die "Improper data limits: x: $xmin $xmax  y: $ymin $ymax  z: $zmin $zmax\n$program_name aborted.\n"
-	}
-
-# apply rescaling to zmin and zmax if needed
-if ($data_scale)
-	{
-	$zmin = $data_scale * $zmin;
-	$zmax = $data_scale * $zmax;
-	$zmin_t = $data_scale * $zmin_t;
-	$zmax_t = $data_scale * $zmax_t;
-	if ($zmin > $zmax)
-		{
-		$tmp = $zmin;
-		$zmin = $zmax;
-		$zmax = $tmp;
-		}
-	if ($zmin_t > $zmax_t)
-		{
-		$tmp = $zmin_t;
-		$zmin_t = $zmax_t;
-		$zmax_t = $tmp;
-		}
-	}
-
-# figure out reasonable color intervals
-$dzz = ($zmax - $zmin);
-$contour_int = 0.0;
-if ($dzz > 0)
-	{
-	$base = int((log($dzz) / log(10.)) + 0.5);
-	$contour_int = (10 ** $base) / 10.0;
-	if ($dzz / $contour_int < 10)
-		{
-		$contour_int = $contour_int / 4;
-		}
-	elsif ($dzz / $contour_int < 20)
-		{
-		$contour_int = $contour_int / 2;
-		}
-	}
-if ($color_mode && $color_style == 1)
-	{
-	$ncolors_use = $ncolors;
-	}
-elsif ($color_mode)
-	{
-	$ncolors_use = $ncolors + 1;
-	}
-if ($color_mode && !$no_nice_color_int && $dzz > 0)
-	{
-	$start_int = $contour_int / 2;
-	$multiplier = int($dzz / ($ncolors_use - 1) / $start_int) + 1;
-	$color_int = $multiplier * $start_int;
-	if ($zmin < 0.0)
-		{
-		$color_start = $color_int * (int($zmin / $color_int) - 1);
-		}
-	else
-		{
-		$color_start = $color_int * int($zmin / $color_int);
-		}
-	$color_end = $color_start + $color_int * ($ncolors_use - 1);
-	if ($color_end < $zmax)
-		{
-		$multiplier = $multiplier + 1;
-		$color_int = $multiplier * $start_int;
-		}
-	if ($zmin < 0.0)
-		{
-		$color_start = $color_int * (int($zmin / $color_int) - 1);
-		}
-	else
-		{
-		$color_start = $color_int * int($zmin / $color_int);
-		}
-	$color_end = $color_start + $color_int * ($ncolors_use - 1);
-	}
-elsif ($color_mode)
-	{
-	$color_int = ($zmax - $zmin)/($ncolors_use - 1);
-	$color_start = $zmin;
-	$color_end = $color_start + $color_int * ($ncolors_use - 1);
-	}
-
-# get colors to use by interpolating defined color pallette
-if ($color_mode)
-	{
-	# set selected color pallette
-	eval "\@cptbr = \@cptbr$color_pallette;";
-	eval "\@cptbg = \@cptbg$color_pallette;";
-	eval "\@cptbb = \@cptbb$color_pallette;";
-
-	# interpolate colors
-	for ($i = 0; $i < $ncolors; $i++)
-		{
-		$xx = ($ncpt - 1) * $i / ($ncolors - 1);
-		$i1 = int($xx);
-		$i2 = $i1 + 1;
-		$red = $cptbr[$i1]
-			+ ($cptbr[$i2] - $cptbr[$i1])
-			* ($xx - $i1) / ($i2 - $i1);
-		$green = $cptbg[$i1]
-			+ ($cptbg[$i2] - $cptbg[$i1])
-			* ($xx - $i1) / ($i2 - $i1);
-		$blue = $cptbb[$i1]
-			+ ($cptbb[$i2] - $cptbb[$i1])
-			* ($xx - $i1) / ($i2 - $i1);
-		push (@cptr, $red);
-		push (@cptg, $green);
-		push (@cptb, $blue);
-		}
-	}
-
-# come up with the filenames
-$cmdfile = "$root" . "_tiff.cmd";
-$tiffile = "$root.tif";
-if ($color_mode && $file_cpt)
-	{
-	$cptfile = $file_cpt;
-	}
-else
-	{
-	$cptfile = "$root.cpt";
-	}
-$gmtfile = "gmt.conf\$\$";
-
-# set macro gmt default settings
-if ($color_flip)
-    {
-    $gmt_def = "COLOR_BACKGROUND/white";
-    push(@gmt_macro_defs, $gmt_def);
-    $gmt_def = "COLOR_FOREGROUND/black";
-    push(@gmt_macro_defs, $gmt_def);
-    }
-else
-    {
-    $gmt_def = "COLOR_BACKGROUND/black";
-    push(@gmt_macro_defs, $gmt_def);
-    $gmt_def = "COLOR_FOREGROUND/white";
-    push(@gmt_macro_defs, $gmt_def);
-    }
-$gmt_def = "COLOR_NAN/white";
-push(@gmt_macro_defs, $gmt_def);
-
-# open the shellscript file
-if (!open(FCMD,">$cmdfile"))
-	{
-	print "\a";
-	die "Cannot open output file $cmdfile\nMacro $program_name aborted.\n";
-	}
-
-# write the shellscript header
-print FCMD "#! /bin/csh -f\n";
-print FCMD "#\n# Shellscript to create TIFF image of data in grd file\n";
-print FCMD "# Created by macro $program_name\n";
-print FCMD "#\n# This shellscript created by following command line:\n";
-print FCMD "# $program_name $command_line\n";
-
-# Define shell variables
-print FCMD "#\n# Define shell variables used in this script:\n";
-print FCMD "set TIFF_FILE       = $tiffile\n";
-print FCMD "set CPT_FILE        = $cptfile\n";
-print FCMD "set MAP_REGION      = $bounds_plot\n";
-
-# Reset GMT defaults, saving old defaults
-print FCMD "#\n# Save existing GMT defaults\n";
-print FCMD "echo Saving GMT defaults...\n";
-print FCMD "gmtdefaults > $gmtfile\n";
-print FCMD "#\n# Set new GMT defaults\n";
-print FCMD "echo Setting new GMT defaults...\n";
-foreach $gmt_def (@gmt_macro_defs) {
-	($gmt_par, $gmt_var) = $gmt_def =~ /^([^\/]+)\/(.+)/;
-	print FCMD "gmtset $gmt_par $gmt_var\n";
-	}
-
-# Reset GMT defaults as per user commands
-if (@gmt_defs)
-	{
-	print FCMD "#\n# Set user defined GMT defaults\n";
-	print FCMD "echo Setting user defined GMT defaults...\n";
-	foreach $gmt_def (@gmt_defs) {
-		($gmt_par, $gmt_var) = $gmt_def =~ /^([^\/]+)\/(.+)/;
-		print FCMD "gmtset $gmt_par $gmt_var\n";
-		}
-	}
-
-# generate color pallette table file if needed
-if ($color_mode && !$file_cpt)
-	{
-	# set slope cpt
-	if ($color_mode == 4)
-		{
-		foreach $i (0 .. $ncolors - 1) {
-			$d1 = $magnitude * $i / ($ncolors - 1);
-			push(@hist, $d1);
-			}
-		}
-
-	# break data distribution up into equal size
-	# regions using grdhisteq on first data file
-	if ($stretch_color)
-		{
-		if ($verbose)
-			{
-			print "Running gmt module grdhisteq...\n";
-			}
-		$ncolors_minus = $ncolors - 1;
-		@grdhisteq = `grdhisteq $files_data[0] -C$ncolors_minus -D`;
-		foreach $d (@grdhisteq) {
-			($d1, $d2) = $d =~ /(\S+)\s+(\S+).*/;
-			push(@hist, $d1);
-			}
-		push(@hist, $d2);
-
-		# rescale hist values if needed
-		if ($data_scale)
-			{
-			foreach $i (0 .. $ncolors - 1) {
-				$hist[$i] = $data_scale * $hist[$i];
-				}
-			}
-
-		# make sure hist encompasses all data
-		if ($zmin < $hist[0])
-			{
-			$hist[0] = $zmin;
-			}
-		if ($zmax > $hist[scalar(@hist)-1])
-			{
-			$hist[scalar(@hist)-1] = $zmax;
-			}
-		$hist[0] = $hist[0] - 0.01*$dzz;
-		$hist[scalar(@hist)-1] =
-			$hist[scalar(@hist)-1] + 0.01*$dzz;
-		}
-
-	# generate cpt file
-	print FCMD "#\n# Make color pallette table file\n";
-	print FCMD "echo Making color pallette table file...\n";
-	if ($color_mode == 4 || $stretch_color)
-		{
-		$d1 = shift @hist;
-		}
-	else
-		{
-		$d1 = $color_start;
-		}
-	if ($color_style == 1 && $color_flip)
-		{
-		foreach $i (0 .. $ncolors - 2)
-			{
-			if ($color_mode == 4 || $stretch_color)
-				{
-				$d2 = shift @hist;
-				}
-			else
-				{
-				$d2 = $d1 + $color_int;
-				}
-			if ($zmode == 1)
-				{
-				if ($i == 0)
-					{
-					if ($color_mode == 4 && $d1 > 0.0)
-						{
-						$d1 = 0.0;
-						}
-					elsif ($color_mode != 4 && $zmin_t < $d1)
-						{
-						$d1 = $zmin_t;
-						}
-					}
-				if ($i == $ncolors - 2 && $zmax_t > $d2)
-					{
-					$d2 = $zmax_t;
-					}
-				}
-			printf FCMD "echo %6g %3d %3d %3d %6g %3d %3d %3d",
-				$d1, at cptr[$i], at cptg[$i], at cptb[$i],
-				$d2, at cptr[$i+1], at cptg[$i+1], at cptb[$i+1];
-			if ($zmode == 1 && $i == 0)
-				{
-				print FCMD " >";
-				}
-			else
-				{
-				print FCMD " >>";
-				}
-			print FCMD " \$CPT_FILE\n";
-			$d1 = $d2
-			}
-		}
-	elsif ($color_style == 1)
-		{
-		for ($i = $ncolors - 2; $i >= 0; $i--)
-			{
-			if ($color_mode == 4 || $stretch_color)
-				{
-				$d2 = shift @hist;
-				}
-			else
-				{
-				$d2 = $d1 + $color_int;
-				}
-			if ($zmode == 1)
-				{
-				if ($i == $ncolors - 2)
-					{
-					if ($color_mode == 4 && $d1 > 0.0)
-						{
-						$d1 = 0.0;
-						}
-					elsif ($color_mode != 4 && $zmin_t < $d1)
-						{
-						$d1 = $zmin_t;
-						}
-					}
-				if ($i == 0 && $zmax_t > $d2)
-					{
-					$d2 = $zmax_t;
-					}
-				}
-			printf FCMD "echo %6g %3d %3d %3d %6g %3d %3d %3d",
-				$d1, at cptr[$i+1], at cptg[$i+1], at cptb[$i+1],
-				$d2, at cptr[$i], at cptg[$i], at cptb[$i];
-			if ($i == ($ncolors - 2))
-				{
-				print FCMD " >";
-				}
-			else
-				{
-				print FCMD " >>";
-				}
-			print FCMD " \$CPT_FILE\n";
-			$d1 = $d2
-			}
-		}
-	elsif ($color_flip)
-		{
-		foreach $i (0 .. $ncolors - 1)
-			{
-			if ($color_mode == 4 || $stretch_color)
-				{
-				$d2 = shift @hist;
-				}
-			else
-				{
-				$d2 = $d1 + $color_int;
-				}
-			if ($zmode == 1)
-				{
-				if ($i == 0)
-					{
-					if ($color_mode == 4 && $d1 > 0.0)
-						{
-						$d1 = 0.0;
-						}
-					elsif ($color_mode != 4 && $zmin_t < $d1)
-						{
-						$d1 = $zmin_t;
-						}
-					}
-				if ($i == $ncolors - 1 && $zmax_t > $d2)
-					{
-					$d2 = $zmax_t;
-					}
-				}
-			printf FCMD "echo %6g %3d %3d %3d %6g %3d %3d %3d",
-				$d1, at cptr[$i], at cptg[$i], at cptb[$i],
-				$d2, at cptr[$i], at cptg[$i], at cptb[$i];
-			if ($i == 0)
-				{
-				print FCMD " >";
-				}
-			else
-				{
-				print FCMD " >>";
-				}
-			print FCMD " \$CPT_FILE\n";
-			$d1 = $d2
-			}
-		}
-	else
-		{
-		for ($i = $ncolors - 1; $i >= 0; $i--)
-			{
-			if ($color_mode == 4 || $stretch_color)
-				{
-				$d2 = shift @hist;
-				}
-			else
-				{
-				$d2 = $d1 + $color_int;
-				}
-			if ($zmode == 1)
-				{
-				if ($i == $ncolors - 1)
-					{
-					if ($color_mode == 4 && $d1 > 0.0)
-						{
-						$d1 = 0.0;
-						}
-					elsif ($color_mode != 4 && $zmin_t < $d1)
-						{
-						$d1 = $zmin_t;
-						}
-					}
-				if ($i == 0 && $zmax_t > $d2)
-					{
-					$d2 = $zmax_t;
-					}
-				}
-			printf FCMD "echo %6g %3d %3d %3d %6g %3d %3d %3d",
-				$d1, at cptr[$i], at cptg[$i], at cptb[$i],
-				$d2, at cptr[$i], at cptg[$i], at cptb[$i];
-			if ($i == ($ncolors - 1))
-				{
-				print FCMD " >";
-				}
-			else
-				{
-				print FCMD " >>";
-				}
-			print FCMD " \$CPT_FILE\n";
-			$d1 = $d2
-			}
-		}
-	}
-
-# now loop over all of the grid files
-foreach $file_grd (@files_data) {
-
-# get intensity file
-if (@files_intensity)
-	{
-	$file_int = shift @files_intensity;
-	}
-
-# Define shell variables
-print FCMD "#\n# Define data files to be plotted:\n";
-print FCMD "set DATA_FILE        = $file_grd\n";
-print FCMD "set INTENSITY_FILE   = $file_int\n";
-
-# scale data if needed
-$file_use = "\$DATA_FILE";
-if ($data_scale)
-	{
-	printf FCMD "#\n# Rescale data\n";
-	printf FCMD "echo Rescaling data by $data_scale...\n";
-	printf FCMD "echo Running gmt module grdmath...\n";
-	printf FCMD "grdmath \$DATA_FILE $data_scale x = \$DATA_FILE.scale\n";
-	$file_use = "\$DATA_FILE.scale";
-	}
-
-# get shading by illumination if needed
-#if ($color_mode == 2)
-#	{
-#	printf FCMD "#\n# Get shading array\n";
-#	printf FCMD "echo Getting shading array...\n";
-#	printf FCMD "echo Running gmt module grdgradient...\n";
-#	printf FCMD "grdgradient $file_use -A$azimuth -G\$DATA_FILE.grad -N";
-#	if (!$gridprojected)
-#		{
-#		printf FCMD " -fg";
-#		}
-#	printf FCMD "\n";
-#	printf FCMD "echo Running gmt module grdhisteq...\n";
-#	printf FCMD "grdhisteq \$DATA_FILE.grad -G\$DATA_FILE.eq -N\n";
-#	printf FCMD "echo Running gmt module grdmath...\n";
-#	printf FCMD "grdmath \$DATA_FILE.eq $magnitude x = \$DATA_FILE.int\n";
-#	printf FCMD "/bin/rm -f \$DATA_FILE.grad \$DATA_FILE.eq\n";
-#	$file_shade = "\$DATA_FILE.int";
-#	}
-
-# get shading by illumination if needed
-if ($color_mode == 2)
-	{
-	# Compute lighting vector from sun azimuth and elevation
-	$light_x = sin($DTR * $azimuth) * cos($DTR * $elevation);
-	$light_y = cos($DTR * $azimuth) * cos($DTR * $elevation);
-	$light_z = sin($DTR * $elevation);
-
-	printf FCMD "#\n# Get shading array\n";
-	printf FCMD "echo Getting shading array...\n";
-	printf FCMD "echo Running gmt module grdgradient to get x component of the gradient...\n";
-	printf FCMD "grdgradient $file_use -A90 -G\$DATA_FILE.drvx";
-	if (!$gridprojected)
-		{
-		printf FCMD " -fg";
-		}
-	printf FCMD "\n";
-	printf FCMD "echo Running gmt module grdgradient to get y component of the gradient...\n";
-	printf FCMD "grdgradient $file_use -A0 -G\$DATA_FILE.drvy";
-	if (!$gridprojected)
-		{
-		printf FCMD " -fg";
-		}
-	printf FCMD "\n";
-
-	printf FCMD "echo Running gmt module grdmath to get adjusted x gradient...\n";
-	printf FCMD "grdmath \$DATA_FILE.drvx $magnitude MUL 10 MUL = \$DATA_FILE.magx\n";
-	printf FCMD "echo Running gmt module grdmath to get adjusted y gradient...\n";
-	printf FCMD "grdmath \$DATA_FILE.drvy $magnitude MUL 10 MUL = \$DATA_FILE.magy\n";
-
-	printf FCMD "echo Running gmt module grdmath to get normalization factor...\n";
-	printf FCMD "grdmath \$DATA_FILE.magx 2.0 POW \\\n";
-		printf FCMD "\t\$DATA_FILE.magy 2.0 POW ADD \\\n";
-		printf FCMD "\t1.0 ADD SQRT = \$DATA_FILE.denom\n";
-
-	printf FCMD "echo Running gmt module grdmath to get normalized x gradient...\n";
-	printf FCMD "grdmath \$DATA_FILE.magx \$DATA_FILE.denom DIV = \$DATA_FILE.normx\n";
-	printf FCMD "echo Running gmt module grdmath to get normalized y gradient...\n";
-	printf FCMD "grdmath \$DATA_FILE.magy \$DATA_FILE.denom DIV = \$DATA_FILE.normy\n";
-	printf FCMD "echo Running gmt module grdmath to get normalized z gradient...\n";
-	printf FCMD "grdmath 1.0 \$DATA_FILE.denom DIV = \$DATA_FILE.normz\n";
-
-	printf FCMD "echo Running gmt module grdmath to apply lighting vector to normalized gradient...\n";
-	printf FCMD "grdmath \$DATA_FILE.normx $light_x MUL \\\n";
-		printf FCMD "\t\$DATA_FILE.normy $light_y MUL ADD \\\n";
-		printf FCMD "\t\$DATA_FILE.normz $light_z MUL ADD -0.5 ADD = \$DATA_FILE.int\n";
-
-	printf FCMD "/bin/rm -f \$DATA_FILE.drvx \$DATA_FILE.drvy \\\n";
-	printf FCMD "\t\$DATA_FILE.magx \$DATA_FILE.magy \\\n";
-	printf FCMD "\t\$DATA_FILE.denom \$DATA_FILE.normx \\\n";
-	printf FCMD "\t\$DATA_FILE.normy \$DATA_FILE.normz\n";
-	$file_shade = "\$DATA_FILE.int";
-	}
-
-# get equalized shading by intensity file if needed
-if ($color_mode == 3 && $file_int && $stretch_shade)
-	{
-	printf FCMD "#\n# Get shading array\n";
-	printf FCMD "echo Getting shading array...\n";
-	printf FCMD "echo Running gmt module grdhisteq...\n";
-	printf FCMD "grdhisteq \$INTENSITY_FILE -G\$INTENSITY_FILE.eq -N\n";
-	printf FCMD "echo Running gmt module grdmath...\n";
-	printf FCMD "grdmath \$INTENSITY_FILE.eq $magnitude x = \$INTENSITY_FILE.int\n";
-	printf FCMD "/bin/rm -f \$INTENSITY_FILE.eq\n";
-	$file_shade = "\$INTENSITY_FILE.int";
-	}
-
-# get shading by unaltered intensity file
-elsif ($color_mode == 3 && $file_int)
-	{
-	$file_shade = "\$INTENSITY_FILE";
-	}
-
-# get color by slope magnitude if needed
-elsif ($color_mode >= 4)
-	{
-	printf FCMD "#\n# Get slope array\n";
-	printf FCMD "echo Getting slope array...\n";
-	printf FCMD "echo Running gmt module grdgradient to get x component of the gradient...\n";
-	printf FCMD "grdgradient $file_use -A90 -G\$DATA_FILE.drvx";
-	if (!$gridprojected)
-		{
-		printf FCMD " -fg";
-		}
-	printf FCMD "\n";
-	printf FCMD "echo Running gmt module grdgradient to get y component of the gradient...\n";
-	printf FCMD "grdgradient $file_use -A0 -G\$DATA_FILE.drvy";
-	if (!$gridprojected)
-		{
-		printf FCMD " -fg";
-		}
-	printf FCMD "\n";
-
-	printf FCMD "echo Running gmt module grdmath to get slope magnitude...\n";
-	printf FCMD "grdmath \$DATA_FILE.drvx 2.0 POW \\\n";
-	printf FCMD "\t\$DATA_FILE.drvy 2.0 POW ADD SQRT \\\n";
-	if ($color_mode == 5)
-		{
-		printf FCMD "\t$magnitude MUL \\\n";
-		}
-	printf FCMD "\t= \$DATA_FILE.slope\n";
-
-	printf FCMD "/bin/rm -f \$DATA_FILE.drvx \$DATA_FILE.drvy \n";
-	$file_slope = "\$DATA_FILE.slope";
-	}
-
-# do grdtiff image
-if ($color_mode)
-	{
-	printf FCMD "#\n# Make tiff image\n";
-	printf FCMD "echo Running gmt module mbgrdtiff...\n";
-	if ($color_mode == 4)
-		{
-		printf FCMD "gmt mbgrdtiff -I$file_slope \\\n\t";
-		}
-	else
-		{
-		printf FCMD "gmt mbgrdtiff -I$file_use \\\n\t";
-		}
-	printf FCMD "-O\$TIFF_FILE \\\n\t";
-	printf FCMD "-R\$MAP_REGION -Jx1.0 \\\n\t";
-	printf FCMD "-C\$CPT_FILE \\\n\t";
-	if ($color_mode == 2 || $color_mode == 3)
-		{
-		printf FCMD "-I$file_shade \\\n\t";
-		}
-	elsif ($color_mode == 5)
-		{
-		printf FCMD "-I$file_slope \\\n\t";
-		}
-	if ($make_worldfile == 1)
-		{
-		printf FCMD "-W \\\n\t";
-		}
-	printf FCMD "-V \n";
-	}
-} # end loop over grd data files
-
-# delete surplus files
-print FCMD "#\n# Delete surplus files\n";
-print FCMD "echo Deleting surplus files...\n";
-print FCMD "/bin/rm -f gmt.conf\n";
-if (!$file_cpt)
-	{
-	print FCMD "/bin/rm -f \$CPT_FILE\n";
-	}
-if ($data_scale)
-	{
-	printf FCMD "/bin/rm -f $file_use\n";
-	}
-if ($file_slope)
-	{
-	printf FCMD "/bin/rm -f $file_slope\n";
-	}
-
-# display image on screen if desired
-print FCMD "#\n# Run $img_viewer\n";
-if ($no_view_tiff)
-	{
-        print FCMD "#if (!(\$#argv > 0 && (\"\$1\" == \"-N\" || \"\$1\" == \"-n\"))) then\n";
-	print FCMD "#echo Running $img_viewer in background...\n";
-	print FCMD "#$img_viewer $tiffile &\n";
-        print FCMD "#endif\n";
-	}
-else
-	{
-        print FCMD "if (!(\$#argv > 0 && (\"\$1\" == \"-N\" || \"\$1\" == \"-n\"))) then\n";
-	print FCMD "echo Running $img_viewer in background...\n";
-	print FCMD "$img_viewer $tiffile &\n";
-        print FCMD "endif\n";
-	}
-
-# claim it's all over
-print FCMD "#\n# All done!\n";
-print FCMD "echo All done!\n";
-
-# now close the shellscript and make it executable
-close FCMD;
-chmod 0775, $cmdfile;
-
-# tell program status
-if ($verbose)
-	{
-	print "\nProgram Status:\n";
-	print "--------------\n";
-	print "\n  GMT Version:\n";
-	print "    Version $gmt_version\n";
-	print "\n  Plot Style:\n";
-	if ($color_mode == 1)
-		{
-		print "    Color Fill\n";
-		}
-	elsif ($color_mode == 2)
-		{
-		print "    Color Shaded Relief\n";
-		}
-	elsif ($color_mode == 3 && $file_intensity && $stretch_shade)
-		{
-		print "    Color Shaded by Equalized Intensity File\n";
-		}
-	elsif ($color_mode == 3 && $file_intensity)
-		{
-		print "    Color Shaded by Unaltered Intensity File\n";
-		}
-	elsif ($color_mode == 4)
-		{
-		print "    Color Fill of Slope Magnitude\n";
-		}
-	elsif ($color_mode == 5)
-		{
-		print "    Color Shaded by Slope Magnitude\n";
-		}
-	print "\n  Input Files:\n";
-	if ($file_data_no_list)
-		{
-		print "    Data GRD File:            $file_data\n";
-		}
-	else
-		{
-		print "    Data GRD List File:       $file_data\n";
-		foreach $file_data (@files_data) {
-			print "    Data GRD File:            $file_data\n";
-		}
-		}
-	if ($file_intensity_no_list)
-		{
-		print "    Intensity GRD File:       $file_intensity\n";
-		}
-	else
-		{
-		print "    Intensity GRD List File:   $file_intensity\n";
-		foreach $file_int (@files_intensity) {
-			print "    Data GRD File:            $file_int\n";
-		}
-		}
-	print "\n  Output Files:\n";
-	print "    Output plot name root:    $root\n";
-	print "    Color pallette table:     $cptfile\n";
-	print "    Plotting shellscript:     $cmdfile\n";
-	print "    Image file:               $tiffile\n";
-	print "\n  Image Attributes:\n";
-	if ($color_mode)
-		{
-		print "    Number of colors:         $ncolors\n";
-		print "    Color Pallette:           ",
-			"@color_pallette_names[$color_pallette - 1]\n";
-		if ($color_flip && color_pallette < 4)
-			{
-			print "    Colors reversed\n";
-			}
-		elsif ($color_flip)
-			{
-			print "    Grayscale reversed\n";
-			}
-		if ($shade_flip)
-			{
-			print "    Shading reversed\n";
-			}
-		}
-	print "\n  Grid Data Attributes:\n";
-	if ($data_scale)
-		{
-		print "    Data scale factor:        $data_scale\n";
-		}
-	printf "    Longitude min max:        %9.4f  %9.4f\n",
-		$xmin, $xmax;
-	printf "    Latitude min max:         %9.4f  %9.4f\n",
-		$ymin, $ymax;
-	printf "    Data min max:             %9.4g  %9.4g\n",
-		$zmin, $zmax;
-	print "\n  Primary Grid Plotting Controls:\n";
-	if ($color_mode && $stretch_color)
-		{
-		printf "    Color start datum:        %f\n", $color_start;
-		printf "    Color end datum:          %f\n", $color_end;
-		printf "    Histogram stretch applied to color pallette\n";
-		}
-	elsif ($color_mode)
-		{
-		printf "    Color start datum:        %f\n", $color_start;
-		printf "    Color end datum:          %f\n", $color_end;
-		printf "    Color datum interval:     %f\n", $color_int;
-		}
-	if ($color_mode == 3 && !$file_intensity)
-		{
-		printf "    Shading Magnitude:        %f\n", $magnitude;
-		}
-	elsif ($color_mode == 2)
-		{
-		printf "    Illumination Azimuth:     %f\n", $azimuth;
-		printf "    Illumination Elevation:   %f\n", $elevation;
-		printf "    Illumination Magnitude:   %f\n", $magnitude;
-		}
-	elsif ($color_mode == 4)
-		{
-		printf "    Slope Magnitude Magnitude:%f\n", $magnitude;
-		}
-	print "\n  GMT Default Values Reset in Script:\n";
-	foreach $gmt_def (@gmt_macro_defs) {
-		($gmt_par, $gmt_var) = $gmt_def =~ /^([^\/]+)\/(.+)/;
-		printf "    %-25s %s\n", $gmt_par, $gmt_var;
-		}
-	foreach $gmt_def (@gmt_defs) {
-		($gmt_par, $gmt_var) = $gmt_def =~ /^([^\/]+)\/(.+)/;
-		printf "    $gmt_par : $gmt_var\n";
-		}
-	print "\n--------------\n";
-	}
-
-# print out final notes
-print "\nImage generation shellscript <$cmdfile> created.\n";
-print "\nInstructions:\n";
-print "  Execute <$cmdfile> to generate TIFF image <$tiffile>.\n";
-if (!$no_view_ps)
-	{
-	print "  Executing <$cmdfile> also invokes $img_viewer ";
-	print "to view the plot on the screen.\n";
-	}
-if ($verbose)
-	{
-	print "\n--------------\n\n";
-	}
-
-# execute shellscript if desired
-if ($execute)
-	{
-	if ($verbose)
-		{
-		print "Executing shellscript $cmdfile...\n";
-		}
-	system "$cmdfile &";
-	}
-
-exit 0;
-
-#-----------------------------------------------------------------------
-sub min {
-
-	# make local variables
-	local ($min);
-
-	# get the minimum of the arguments
-	if ($_[0] < $_[1])
-		{
-		$min = $_[0];
-		}
-	else
-		{
-		$min = $_[1];
-		}
-	$min;
-}
-#-----------------------------------------------------------------------
-sub max {
-
-	# make local variables
-	local ($max);
-
-	# get the minimum of the arguments
-	if ($_[0] > $_[1])
-		{
-		$max = $_[0];
-		}
-	else
-		{
-		$max = $_[1];
-		}
-	$max;
-}
-#-----------------------------------------------------------------------
-sub GetDecimalDegrees {
-
-	# make local variables
-	local ($dec_degrees, $degrees, $minutes, $seconds);
-
-	# deal with dd:mm:ss format
-	if ($_[0] =~ /^\S+:\S+:\S+$/)
-		{
-		($degrees, $minutes, $seconds)
-			= $_[0] =~ /^(\S+):(\S+):(\S+)$/;
-		if ($degrees =~ /^-\S+/)
-			{
-			$dec_degrees = $degrees
-				- $minutes / 60.0
-				- $seconds / 3600.0;
-			}
-		else
-			{
-			$dec_degrees = $degrees
-				+ $minutes / 60.0
-				+ $seconds / 3600.0;
-			}
-		}
-	# deal with dd:mm format
-	elsif ($_[0] =~ /^\S+:\S+$/)
-		{
-		($degrees, $minutes)
-			= $_[0] =~ /^(\S+):(\S+)$/;
-		if ($degrees =~ /^-\S+/)
-			{
-			$dec_degrees = $degrees - $minutes / 60.0;
-			}
-		else
-			{
-			$dec_degrees = $degrees + $minutes / 60.0;
-			}
-		}
-
-	# value already in decimal degrees
-	else
-		{
-		$dec_degrees = $_[0];
-		}
-
-	# return decimal degrees;
-	$dec_degrees;
-}
-#-----------------------------------------------------------------------
-sub GetPageSize {
-
-# deal with location of color scale
-if ($scale_loc eq "l")
-	{
-	$space_top =    1.50 * $page_height_in{$pagesize}
-			    / $page_height_in{"a"};
-	$space_bottom = 0.75 * $page_height_in{$pagesize}
-			    / $page_height_in{"a"};
-	$space_left =   2.50 * $page_height_in{$pagesize}
-			    / $page_height_in{"a"};
-	$space_right =  1.00 * $page_height_in{$pagesize}
-			    / $page_height_in{"a"};
-	}
-elsif ($scale_loc eq "r")
-	{
-	$space_top =    1.50 * $page_height_in{$pagesize}
-			    / $page_height_in{"a"};
-	$space_bottom = 0.75 * $page_height_in{$pagesize}
-			    / $page_height_in{"a"};
-	$space_left =   1.00 * $page_height_in{$pagesize}
-			    / $page_height_in{"a"};
-	$space_right =  2.50 * $page_height_in{$pagesize}
-			    / $page_height_in{"a"};
-	}
-elsif ($scale_loc eq "t")
-	{
-	$space_top =    2.75 * $page_height_in{$pagesize}
-			    / $page_height_in{"a"};
-	$space_bottom = 0.75 * $page_height_in{$pagesize}
-			    / $page_height_in{"a"};
-	$space_left =   1.00 * $page_height_in{$pagesize}
-			    / $page_height_in{"a"};
-	$space_right =  1.00 * $page_height_in{$pagesize}
-			    / $page_height_in{"a"};
-	}
-else
-	{
-	$space_top =    1.50 * $page_height_in{$pagesize}
-			    / $page_height_in{"a"};
-	$space_bottom = 2.00 * $page_height_in{$pagesize}
-			    / $page_height_in{"a"};
-	$space_left =   1.00 * $page_height_in{$pagesize}
-			    / $page_height_in{"a"};
-	$space_right =  1.00 * $page_height_in{$pagesize}
-			    / $page_height_in{"a"};
-	}
-
-# set the relevent page width and height
-$width_max_landscape = $page_height_in{$pagesize}
-		- $space_left - $space_right;
-$height_max_landscape = $page_width_in{$pagesize}
-		- $space_bottom - $space_top;
-$width_max_portrait = $page_width_in{$pagesize}
-		- $space_left - $space_right;
-$height_max_portrait = $page_height_in{$pagesize}
-		- $space_bottom - $space_top;
-$frame_size = 0.075;
-if (($frame_size / $height_max_portrait) > 0.01)
-	{
-	$frame_size = 0.01 * $height_max_portrait;
-	}
-$tick_size = 0.075;
-if (($tick_size / $height_max_portrait) > 0.01)
-	{
-	$tick_size = 0.01 * $height_max_portrait;
-	}
-}
-#-----------------------------------------------------------------------
-sub GetProjection {
-
-	# get the map projection flag
-	($projection) = $map_scale =~ /^(\w)/;
-	($projection_pars) = $map_scale =~ /^$projection(\S+)/;
-
-	# see if plot scale or plot width defined
-	$use_scale = 0;
-	$use_width = 0;
-	$separator = "/";
-	$trial_value = 1.0;
-
-	# Cassini Projection
-	if ($projection eq "c")
-		{
-		($plot_scale) = $map_scale =~ /^c\S+\/\S+\/(\S+)$/;
-		$use_scale = 1;
-		}
-	elsif ($projection eq "C")
-		{
-		($plot_width) = $map_scale =~ /^C\S+\/\S+\/(\S+)$/;
-		$use_width = 1;
-		}
-
-	# Mercator Projection
-	elsif ($projection eq "m")
-		{
-		($plot_scale) = $map_scale =~ /^m(\S+)$/;
-		$use_scale = 1;
-		$separator = "";
-		}
-	elsif ($projection eq "M")
-		{
-		($plot_width) = $map_scale =~ /^M(\S+)$/;
-		$use_width = 1;
-		$separator = "";
-		}
-
-	# Oblique Mercator Projection
-	elsif ($projection eq "o")
-		{
-		if ($map_scale =~ /^oa\S+/)
-			{
-			($plot_scale) = $map_scale =~ /^oa\S+\/\S+\/\S+\/(\S+)$/;
-			}
-		elsif ($map_scale =~ /^ob\S+/)
-			{
-			($plot_scale) = $map_scale =~ /^ob\S+\/\S+\/\S+\/\S+\/(\S+)$/;
-			}
-		elsif ($map_scale =~ /^oc\S+/)
-			{
-			($plot_scale) = $map_scale =~ /^oc\S+\/\S+\/\S+\/\S+\/(\S+)$/;
-			}
-		$use_scale = 1;
-		}
-	elsif ($projection eq "O")
-		{
-		if ($map_scale =~ /^Oa\S+/)
-			{
-			($plot_width) = $map_scale =~ /^Oa\S+\/\S+\/\S+\/(\S+)$/;
-			}
-		elsif ($map_scale =~ /^Ob\S+/)
-			{
-			($plot_width) = $map_scale =~ /^Ob\S+\/\S+\/\S+\/\S+\/(\S+)$/;
-			}
-		elsif ($map_scale =~ /^Oc\S+/)
-			{
-			($plot_width) = $map_scale =~ /^Oc\S+\/\S+\/\S+\/\S+\/(\S+)$/;
-			}
-		$use_width = 1;
-		}
-
-	# Equidistant Cylindrical Projection
-	elsif ($projection eq "q")
-		{
-		($plot_scale) = $map_scale =~ /^q\S+\/(\S+)$/;
-		$use_scale = 1;
-		}
-	elsif ($projection eq "Q")
-		{
-		($plot_width) = $map_scale =~ /^Q\S+\/(\S+)$/;
-		$use_width = 1;
-		}
-
-	# Transverse Mercator Projection
-	elsif ($projection eq "t")
-		{
-		($plot_scale) = $map_scale =~ /^t\S+\/(\S+)$/;
-		$use_scale = 1;
-		}
-	elsif ($projection eq "T")
-		{
-		($plot_width) = $map_scale =~ /^T\S+\/(\S+)$/;
-		$use_width = 1;
-		}
-
-	# Universal Transverse Mercator Projection
-	elsif ($projection eq "u")
-		{
-		($plot_scale) = $map_scale =~ /^u\S+\/(\S+)$/;
-		$use_scale = 1;
-		}
-	elsif ($projection eq "U")
-		{
-		($plot_width) = $map_scale =~ /^U\S+\/(\S+)$/;
-		$use_width = 1;
-		}
-
-	# Basic Cylindrical Projection
-	elsif ($projection eq "y")
-		{
-		($plot_scale) = $map_scale =~ /^y\S+\/\S+\/(\S+)$/;
-		$use_scale = 1;
-		}
-	elsif ($projection eq "Y")
-		{
-		($plot_width) = $map_scale =~ /^Y\S+\/\S+\/(\S+)$/;
-		$use_width = 1;
-		}
-
-	# Lambert Azimuthal Projection
-	elsif ($projection eq "a")
-		{
-		($plot_scale) = $map_scale =~ /^a\S+\/\S+\/(\S+)$/;
-		$use_scale = 1;
-		$trial_value = "1:1";
-		$use_ratio = 1;
-		}
-	elsif ($projection eq "A")
-		{
-		($plot_width) = $map_scale =~ /^A\S+\/\S+\/(\S+)$/;
-		$use_width = 1;
-		}
-
-	# Equidistant Projection
-	elsif ($projection eq "e")
-		{
-		($plot_scale) = $map_scale =~ /^e\S+\/\S+\/(\S+)$/;
-		$use_scale = 1;
-		$trial_value = "1:1";
-		$use_ratio = 1;
-		}
-	elsif ($projection eq "E")
-		{
-		($plot_width) = $map_scale =~ /^E\S+\/\S+\/(\S+)$/;
-		$use_width = 1;
-		}
-
-	# Orthographic Projection
-	elsif ($projection eq "g")
-		{
-		($plot_scale) = $map_scale =~ /^g\S+\/\S+\/(\S+)$/;
-		$use_scale = 1;
-		$trial_value = "1:1";
-		$use_ratio = 1;
-		}
-	elsif ($projection eq "G")
-		{
-		($plot_width) = $map_scale =~ /^G\S+\/\S+\/(\S+)$/;
-		$use_width = 1;
-		}
-
-	# General Sterographic Projection
-	elsif ($projection eq "s")
-		{
-		($plot_scale) = $map_scale =~ /^s\S+\/\S+\/(\S+)$/;
-		$use_scale = 1;
-		$trial_value = "1:1";
-		$use_ratio = 1;
-		}
-	elsif ($projection eq "S")
-		{
-		($plot_width) = $map_scale =~ /^S\S+\/\S+\/(\S+)$/;
-		$use_width = 1;
-		}
-
-	# Albers Projection
-	elsif ($projection eq "b")
-		{
-		($plot_scale) = $map_scale =~ /^b\S+\/\S+\/\S+\/\S+\/(\S+)$/;
-		$use_scale = 1;
-		}
-	elsif ($projection eq "B")
-		{
-		($plot_width) = $map_scale =~ /^B\S+\/\S+\/\S+\/\S+\/(\S+)$/;
-		$use_width = 1;
-		}
-
-	# Lambert Conic Projection
-	elsif ($projection eq "l")
-		{
-		($plot_scale) = $map_scale =~ /^l\S+\/\S+\/\S+\/\S+\/(\S+)$/;
-		$use_scale = 1;
-		}
-	elsif ($projection eq "L")
-		{
-		($plot_width) = $map_scale =~ /^L\S+\/\S+\/\S+\/\S+\/(\S+)$/;
-		$use_width = 1;
-		}
-
-	# Hammer Projection
-	elsif ($projection eq "h")
-		{
-		($plot_scale) = $map_scale =~ /^h\S+\/(\S+)$/;
-		$use_scale = 1;
-		}
-	elsif ($projection eq "H")
-		{
-		($plot_width) = $map_scale =~ /^H\S+\/(\S+)$/;
-		$use_width = 1;
-		}
-
-	# Sinusoidal Projection
-	elsif ($projection eq "i")
-		{
-		($plot_scale) = $map_scale =~ /^i\S+\/(\S+)$/;
-		$use_scale = 1;
-		}
-	elsif ($projection eq "I")
-		{
-		($plot_width) = $map_scale =~ /^I\S+\/(\S+)$/;
-		$use_width = 1;
-		}
-
-	# Eckert VI Projection
-	elsif ($projection eq "k")
-		{
-		($plot_scale) = $map_scale =~ /^k\S+\/(\S+)$/;
-		$use_scale = 1;
-		}
-	elsif ($projection eq "K")
-		{
-		($plot_width) = $map_scale =~ /^K\S+\/(\S+)$/;
-		$use_width = 1;
-		}
-
-	# Robinson Projection
-	elsif ($projection eq "n")
-		{
-		($plot_scale) = $map_scale =~ /^n\S+\/(\S+)$/;
-		$use_scale = 1;
-		}
-	elsif ($projection eq "N")
-		{
-		($plot_width) = $map_scale =~ /^N\S+\/(\S+)$/;
-		$use_width = 1;
-		}
-
-	# Winkel Tripel Projection
-	elsif ($projection eq "r")
-		{
-		($plot_scale) = $map_scale =~ /^r\S+\/(\S+)$/;
-		$use_scale = 1;
-		}
-	elsif ($projection eq "R")
-		{
-		($plot_width) = $map_scale =~ /^R\S+\/(\S+)$/;
-		$use_width = 1;
-		}
-
-	# Mollweide Projection
-	elsif ($projection eq "w")
-		{
-		($plot_scale) = $map_scale =~ /^w\S+\/(\S+)$/;
-		$use_scale = 1;
-		}
-	elsif ($projection eq "W")
-		{
-		($plot_width) = $map_scale =~ /^W\S+\/(\S+)$/;
-		$use_width = 1;
-		}
-
-	# Linear Polar Projection
-	elsif ($projection eq "p")
-		{
-		($plot_scale) = $map_scale =~ /^p(\S+)$/;
-		$use_scale = 1;
-		$separator = "";
-		}
-	elsif ($projection eq "P")
-		{
-		($plot_width) = $map_scale =~ /^P(\S+)$/;
-		$use_width = 1;
-		$separator = "";
-		}
-
-	# Linear Projection
-	elsif ($projection eq "x")
-		{
-		if ($map_scale =~ /^xd$/)
-			{
-			$linear = 1;
-			chop($map_scale);
-			}
-		else
-			{
-			($plot_scale) = $map_scale =~ /^x(\S+)$/;
-			}
-		$use_scale = 1;
-		$separator = "";
-		}
-	elsif ($projection eq "X")
-		{
-		if ($map_scale =~ /^Xd$/)
-			{
-			$linear = 1;
-			chop($map_scale);
-			}
-		else
-			{
-			($plot_width) = $map_scale =~ /^X(\S+)$/;
-			}
-		$use_width = 1;
-		$separator = "";
-		}
-}
-#-----------------------------------------------------------------------
-sub GetBaseTick {
-
-	# figure out some reasonable tick intervals for the basemap
-	$base_tick_x = ($xmax - $xmin) / 5;
-	$base_tick_y = ($ymax - $ymin) / 5;
-	$base_tick = &min($base_tick_x, $base_tick_y);
-	if ($base_tick < 0.0002777777)
-		{
-		$base_tick = "1c";
-		}
-	elsif ($base_tick < 0.0005555555)
-		{
-		$base_tick = "2c";
-		}
-	elsif ($base_tick < 0.0013888889)
-		{
-		$base_tick = "5c";
-		}
-	elsif ($base_tick < 0.0027777778)
-		{
-		$base_tick = "10c";
-		}
-	elsif ($base_tick < 0.0041666667)
-		{
-		$base_tick = "15c";
-		}
-	elsif ($base_tick < 0.0083333333)
-		{
-		$base_tick = "30c";
-		}
-	elsif ($base_tick < 0.0166667)
-		{
-		$base_tick = "1m";
-		}
-	elsif ($base_tick < 0.0333333)
-		{
-		$base_tick = "2m";
-		}
-	elsif ($base_tick < 0.0833333)
-		{
-		$base_tick = "5m";
-		}
-	elsif ($base_tick < 0.1666667)
-		{
-		$base_tick = "10m";
-		}
-	elsif ($base_tick < 0.25)
-		{
-		$base_tick = "15m";
-		}
-	elsif ($base_tick < 0.5)
-		{
-		$base_tick = "30m";
-		}
-	elsif ($base_tick < 1.0)
-		{
-		$base_tick = "1";
-		}
-	elsif ($base_tick < 2.0)
-		{
-		$base_tick = "2";
-		}
-	elsif ($base_tick < 5.0)
-		{
-		$base_tick = "5";
-		}
-	elsif ($base_tick < 10.0)
-		{
-		$base_tick = "10";
-		}
-	elsif ($base_tick < 15.0)
-		{
-		$base_tick = "15";
-		}
-	elsif ($base_tick < 30.0)
-		{
-		$base_tick = "30";
-		}
-	elsif ($base_tick < 30.0)
-		{
-		$base_tick = "30";
-		}
-	elsif ($base_tick < 360.0)
-		{
-		$base_tick = "60";
-		}
-
-}
-#-----------------------------------------------------------------------
-# This version of Getopts has been augmented to support multiple
-# calls to the same option. If an arg in argumentative is followed
-# by "+" rather than ":",  then the corresponding scalar will
-# be concatenated rather than overwritten by multiple calls to
-# the same arg.
-#
-# Usage:
-#      do Getopts('a:b+c'); # -a takes arg, -b concatenates args,
-#			    # -c does not take arg. Sets opt_* as a
-#                           # side effect.
-
-sub MBGetopts {
-    local($argumentative) = @_;
-    local(@args,$_,$first,$rest);
-    local($errs) = 0;
-
-    @args = split( / */, $argumentative );
-    while(@ARGV && ($_ = $ARGV[0]) =~ /^-(.)(.*)/) {
-	($first,$rest) = ($1,$2);
-	$pos = index($argumentative,$first);
-	if($pos >= $[) {
-	    if($args[$pos+1] eq ':') {
-		shift(@ARGV);
-		if($rest eq '') {
-		    ++$errs unless @ARGV;
-		    $rest = shift(@ARGV);
-		}
-		eval "\$opt_$first = \$rest;";
-		eval "\$flg_$first = 1;";
-	    }
-	    elsif($args[$pos+1] eq '+') {
-		shift(@ARGV);
-		if($rest eq '') {
-		    ++$errs unless @ARGV;
-		    $rest = shift(@ARGV);
-		}
-		if (eval "\$opt_$first") {
-		    eval "\$opt_$first = \$opt_$first
-				. \":\" . \$rest;";
-		}
-		else {
-		    eval "\$opt_$first = \$rest;";
-		}
-		eval "\$flg_$first = 1;";
-	    }
-	    elsif($args[$pos+1] eq '%') {
-		shift(@ARGV);
-		if($rest ne '') {
-		    eval "\$opt_$first = \$rest;";
-		}
-		else {
-		    $rest = $ARGV[0];
-		    ($one) = $rest =~ /^-(.).*/;
-		    $pos = index($argumentative,$one);
-		    if(!$one || $pos < $[) {
-			eval "\$opt_$first = \$rest;";
-			shift(@ARGV);
-		    }
-		}
-		eval "\$flg_$first = 1;";
-	    }
-	    else {
-		eval "\$opt_$first = 1";
-		eval "\$flg_$first = 1;";
-		if($rest eq '') {
-		    shift(@ARGV);
-		}
-		else {
-		    $ARGV[0] = "-$rest";
-		}
-	    }
-	}
-	else {
-	    print STDERR "Unknown option: $first\n";
-	    ++$errs;
-	    if($rest ne '') {
-		$ARGV[0] = "-$rest";
-	    }
-	    else {
-		shift(@ARGV);
-	    }
-	}
-    }
-    $errs == 0;
-}
-#-----------------------------------------------------------------------
diff --git a/src/macros/mbm_grid b/src/macros/mbm_grid
deleted file mode 100755
index 3cd4267..0000000
--- a/src/macros/mbm_grid
+++ /dev/null
@@ -1,960 +0,0 @@
-#!/usr/bin/env perl
-#--------------------------------------------------------------------
-#    The MB-system:	mbm_grid.perl	6/11/99
-#    $Id: mbm_grid 2227 2015-02-05 21:12:31Z caress $
-#
-#    Copyright (c) 1999-2015 by
-#    D. W. Caress (caress at mbari.org)
-#      Monterey Bay Aquarium Research Institute
-#      Moss Landing, CA
-#    and D. N. Chayes (dale at lamont.ldgo.columbia.edu)
-#      Lamont-Doherty Earth Observatory
-#      Palisades, NY  10964
-#
-#    See README file for copying and redistribution conditions.
-#--------------------------------------------------------------------
-#
-# Command:
-#   mbm_grid
-#
-# Purpose:
-#   Macro to generate a shellscript of MB-System commands
-#   which, when executed, will generate a grid or mosaic of the
-#   specified swath sonar data. The grid or mosaic may be of
-#   bathymetry, (positive down), topography (positive up),
-#   amplitude, or sidescan data. The primary purpose of this
-#   macro is to allow the simple, semi-automated production of
-#   grids and mosaics with a few command line arguments. The macro
-#   can determine the area covered by the swath data and set the
-#   grid bounds and dimensions accordingly. For users
-#   seeking more control over the grid and mosaic parameters,
-#   the full suite of mbgrid and mbmosaic commands are supported.
-#   Truly ambitious users may edit the grid shellscript to take
-#   advantage of MB-System and GMT capabilites not supported by
-#   this macro.
-#
-# Basic Usage:
-#   mbm_grid {-Ifilelist | -Ifile -Fformat} -Oroot
-#             -Rwest/east/south/north -V
-#
-# Additional Options:
-#            [-Adatatype -Bborder -Cclip[/mode[/tension]] -Dxdim/ydim -Edx/dy/units
-#            -Fpriority_range -Ggridkind -H -Llonflip -Jprojection
-#            -M -N -Ppings
-#            -Sspeed -U{azimuth/factor | time}
-#            -V -Wscale -Xextend
-#            -Ypriority_file -Zbathdef]
-#
-# Author:
-#   David W. Caress
-#   Monterey Bay Aquarium Research Institute
-#   Moss Landing, CA 95039
-#   June 11, 1999
-#
-# Version:
-#   $Id: mbm_grid 2227 2015-02-05 21:12:31Z caress $
-#
-# Revisions:
-#   $Log: mbm_grid.perl,v $
-#   Revision 5.9  2003/09/25 16:59:52  caress
-#   Fixed bug with -X option found by Val Schmidt.
-#
-#   Revision 5.8  2003/04/17 20:42:48  caress
-#   Release 5.0.beta30
-#
-#   Revision 5.7  2003/03/16 18:05:01  caress
-#   Added -K option for underlaying background data on grids.
-#
-#   Revision 5.6  2002/10/02 23:53:13  caress
-#   Release 5.0.beta24
-#
-#   Revision 5.5  2002/08/21 00:54:20  caress
-#   Release 5.0.beta22
-#
-#   Revision 5.4  2001/12/18 04:26:12  caress
-#   Version 5.0.beta11.
-#
-# Revision 5.3  2001/11/20  00:36:45  caress
-# Now reads inf files with -R option first and runs mbinfo
-# only if really needed (if file bounds not completely
-# inside specified bounds).
-#
-# Revision 5.2  2001/10/30  00:17:55  caress
-# Fixed end of script generated by mbm_grid.
-#
-# Revision 5.1  2001/03/22  21:05:45  caress
-# Trying to make release 5.0.beta0
-#
-# Revision 5.0  2000/12/01  22:58:01  caress
-# First cut at Version 5.0.
-#
-# Revision 4.3  2000/10/03  21:42:17  caress
-# Snapshot for Dale.
-#
-# Revision 4.2  2000/09/11  21:54:49  caress
-# Added support for recursive and commented datalists.
-#
-# Revision 4.1  1999/10/21  20:42:32  caress
-# Fixed verbosity.
-#
-# Revision 4.0  1999/06/25  17:53:53  caress
-# Initial version.
-#
-#
-$program_name = "mbm_grid";
-
-# Deal with command line arguments
-$command_line = "@ARGV";
-&MBGetopts('A:a:B:b:C:c:D:d:E:e:F:f:G:g:HhI:i:J:j:K:k:L:l:MmO:o:P:p:R:r:S:s:T:t:U:u:VvW:w:X:x:Y:y:Z:z:');
-
-$datatype = 		($opt_A || $opt_a || 1);
-$border = 		($opt_B || $opt_b);
-$clip = 		($opt_C || $opt_c);
-$xdimydim = 		($opt_D || $opt_d);
-$xintyint = 		($opt_E || $opt_e);
-$format = 		($opt_F);
-$priority_range = 	($opt_f);
-$gridkind = 		($opt_G || $opt_g);
-$help =    		($opt_H || $opt_h);
-$file_data = 		($opt_I || $opt_i || "datalist.mb-1");
-$projection = 		($opt_J || $opt_j);
-$background = 		($opt_K || $opt_k);
-$lonflip =    		($opt_L || $opt_l);
-$more = 		($opt_M || $opt_m);
-$root =    		($opt_O || $opt_o);
-$pings = 		($opt_P || $opt_p);
-$bounds = 		($opt_R || $opt_r);
-$speed = 		($opt_S || $opt_s);
-$topofile = 		($opt_T || $opt_t);
-$azimuthfactortime = 	($opt_U || $opt_u);
-$verbose = 		($opt_V || $opt_v);
-$scale = 		($opt_W || $opt_w);
-$extend = 		($opt_X || $opt_x);
-$priority_file = 	($opt_Y || $opt_y);
-$bathdef = 		($opt_Z || $opt_z);
-
-# print out help message if required
-if ($help)
-	{
-	print "\n$program_name:\n";
-	print "\nVersion: $Id: mbm_grid 2227 2015-02-05 21:12:31Z caress $\n";
-        print "Macro to generate a shellscript of MB-System commands \n";
-        print "which, when executed, will generate a grid or mosaic of the \n";
-        print "specified swath sonar data. The grid or mosaic may be of \n";
-        print "bathymetry, (positive down), topography (positive up), \n";
-        print "amplitude, or sidescan data. The primary purpose of this  \n";
-        print "macro is to allow the simple, semi-automated production of \n";
-        print "grids and mosaics with a few command line arguments. The macro \n";
-        print "can determine the area covered by the swath data and set the  \n";
-        print "grid bounds and dimensions accordingly. For users \n";
-        print "seeking more control over the grid and mosaic parameters, \n";
-        print "the full suite of mbgrid and mbmosaic commands are supported. \n";
-        print "Truly ambitious users may edit the grid shellscript to take  \n";
-        print "advantage of MB-System and GMT capabilites not supported by  \n";
-        print "this macro. \n";
-        print "\nBasic Usage:\n\tmbm_grid {-Ifilelist | -Fformat -IFile} -Oroot -V  \n";
-        print "\nAdditional Options:\n\t-Rwest/east/south/north \n";
-        print "         [-Adatatype -Bborder -Cclip[/mode[/tension]] -Dxdim/ydim \n";
-        print "         -Edx/dy/units -fpriority_range -Ggridkind -H -Llonflip \n";
-        print "         -M -N -Ppings -Sspeed -Ttension -U{azimuth/factor | time}  \n";
-        print "         -V -Wscale -Xextend  \n";
-        print "         -Ypriority_file -Zbathdef]  \n";
-	exit 0;
-	}
-
-# check for input file
-if (!$file_data)
-	{
-	print "\a";
-	die "No input file specified - $program_name aborted\n";
-	}
-elsif (! -e $file_data)
-	{
-	print "\a";
-	die "Specified input file cannot be opened - $program_name aborted\n";
-	}
-
-# tell the world we got started
-if ($verbose)
-	{
-	print "\nRunning $program_name...\n";
-	}
-
-# set up user defined geographic limits
-if ($bounds =~ /^\S+\/\S+\/\S+\/\S+$/)
-       	{
-       	($xmin_raw,$xmax_raw,$ymin_raw,$ymax_raw) = $bounds =~
-       		/(\S+)\/(\S+)\/(\S+)\/(\S+)/;
-       	$xmin = &GetDecimalDegrees($xmin_raw);
-       	$xmax = &GetDecimalDegrees($xmax_raw);
-       	$ymin = &GetDecimalDegrees($ymin_raw);
-       	$ymax = &GetDecimalDegrees($ymax_raw);
-       	}
-
-# set root name if needed
-if (!$root)
-	{
-	$root = $file_data;
-	}
-
-# get format if needed
-if (!$format)
-	{
-	$line = `mbformat -I $file_data -L`;
-	($format) = $line =~ /(\S+)/;
-	if ($format == 0)
-		{
-		$format = -1;
-		}
-	}
-
-# get limits of file using mbinfo
-if ($format > 0)
-	{
-	push(@files_data, $file_data);
-	push(@formats, $format);
-	}
-else
-	{
-	# we used to use this perl function
-	# 	MBparsedatalist($file_data);
-	# but now we use the program mbdatalist
-	@mbdatalist = `mbdatalist -F-1 -I$file_data`;
-	while (@mbdatalist)
-		{
-		$line = shift @mbdatalist;
-		if ($line =~ /(\S+)\s+(\S+)/)
-			{
-			($file_mb,$format_mb) =
-				$line =~ /(\S+)\s+(\S+)/;
-			push(@files_data, $file_mb);
-			push(@formats, $format_mb);
-			}
-		}
-	}
-
-$cnt = -1;
-foreach $file_mb (@files_data)
-	{
-	# use .inf file if it exists and no time or space bounds applied
-	$use_inf = 0;
-	$file_inf = $file_mb . ".inf";
-	@mbinfo = 0;
-	if (-r $file_inf)
-		{
-		if ($verbose && !$bounds)
-			{
-			print "Reading mbinfo output from file $file_inf...\n";
-			}
-		if (open(FILEINF,"<$file_inf"))
-			{
-			while ($line = <FILEINF>)
-				{
-				push(@mbinfo, $line);
-				if ($line =~ /^Number of Records:\s+(\S+)/)
-					{
-					($nrec_f) =
-						$line =~ /^Number of Records:\s+(\S+)/;
-					}
-				if ($line =~ /^Minimum Longitude:\s+(\S+)\s+Maximum Longitude:\s+(\S+)/)
-					{
-					($xmin_f,$xmax_f) =
-						$line =~ /^Minimum Longitude:\s+(\S+)\s+Maximum Longitude:\s+(\S+)/;
-					}
-				if ($line =~ /^Minimum Latitude:\s+(\S+)\s+Maximum Latitude:\s+(\S+)/)
-					{
-					($ymin_f,$ymax_f) =
-						$line =~ /^Minimum Latitude:\s+(\S+)\s+Maximum Latitude:\s+(\S+)/;
-					}
-				}
-			close FILEINF;
-
-			if (!$bounds)
-			    {
-			    $use_inf = 1;
-			    }
-			elsif ($nrec_f > 0 &&
-			    $xmin_f >= $xmin && $xmin_f <= $xmax
-				&& $xmax_f >= $xmin && $xmax_f <= $xmax
-			    && $ymin_f >= $ymin && $ymin_f <= $ymax
-				&& $ymax_f >= $ymin && $ymax_f <= $ymax)
-			    {
-			    $use_inf = 1;
-			    }
-			elsif ($nrec_f > 0 &&
-			    ($xmin_f < $xmin
-				|| $xmax_f > $xmax
-				|| $ymin_f < $ymin
-				|| $ymax_f > $ymax))
-				    {
-			    $use_inf = 0;
-			    }
-			elsif ($nrec_f > 0)
-			    {
-			    $use_inf = 1;
-			    }
-			}
-		}
-
-	# if .inf file not accessible or suitable run mbinfo directly
-	if (!$use_inf)
-		{
-		if ($verbose)
-			{
-			print "Running mbinfo on file $file_mb...\n";
-			}
-		$cnt++;
-		if (!$bounds)
-			{
-			@mbinfo = `mbinfo -F$formats[$cnt] -I$file_mb -G`;
-			}
-		else
-			{
-			@mbinfo = `mbinfo -F$formats[$cnt] -I$file_mb -R$bounds -G`;
-			}
-		}
-
-	# now parse the mbinfo output
-	$nrec_f = 0;
-	while (@mbinfo)
-		{
-		$line = shift @mbinfo;
-		if ($line =~ /^Number of Records:\s+(\S+)/)
-			{
-			($nrec_f) =
-				$line =~ /^Number of Records:\s+(\S+)/;
-			}
-		if ($line =~ /^Minimum Longitude:\s+(\S+)\s+Maximum Longitude:\s+(\S+)/)
-			{
-			($xmin_f,$xmax_f) =
-				$line =~ /^Minimum Longitude:\s+(\S+)\s+Maximum Longitude:\s+(\S+)/;
-			}
-		if ($line =~ /^Minimum Latitude:\s+(\S+)\s+Maximum Latitude:\s+(\S+)/)
-			{
-			($ymin_f,$ymax_f) =
-				$line =~ /^Minimum Latitude:\s+(\S+)\s+Maximum Latitude:\s+(\S+)/;
-			}
-		if ($line =~ /^Minimum Altitude:\s+(\S+)\s+Maximum Altitude:\s+(\S+)/)
-			{
-			($altmin_f,$altmax_f) =
-				$line =~ /^Minimum Altitude:\s+(\S+)\s+Maximum Altitude:\s+(\S+)/;
-			}
-		if ($line =~ /^Minimum Depth:\s+(\S+)\s+Maximum Depth:\s+(\S+)/)
-			{
-			($zmin_f,$zmax_f) =
-			$line =~ /^Minimum Depth:\s+(\S+)\s+Maximum Depth:\s+(\S+)/;
-			}
-		if ($line =~ /^Minimum Amplitude:\s+(\S+)\s+Maximum Amplitude:\s+(\S+)/)
-			{
-			($amin_f,$amax_f) =
-			$line =~ /^Minimum Amplitude:\s+(\S+)\s+Maximum Amplitude:\s+(\S+)/;
-			}
-		if ($line =~ /^Minimum Sidescan:\s+(\S+)\s+Maximum Sidescan:\s+(\S+)/)
-			{
-			($smin_f,$smax_f) =
-			$line =~ /^Minimum Sidescan:\s+(\S+)\s+Maximum Sidescan:\s+(\S+)/;
-			}
-		}
-
-	if (!$first_mb && $nrec_f > 0)
-		{
-		$first_mb = 1;
-		$xmin_data = $xmin_f;
-		$xmax_data = $xmax_f;
-		$ymin_data = $ymin_f;
-		$ymax_data = $ymax_f;
-		$zmin_data = $zmin_f;
-		$zmax_data = $zmax_f;
-		$amin_data = $amin_f;
-		$amax_data = $amax_f;
-		$smin_data = $smin_f;
-		$smax_data = $smax_f;
-		}
-	elsif ($nrec_f > 0)
-		{
-		$xmin_data = &min($xmin_data, $xmin_f);
-		$xmax_data = &max($xmax_data, $xmax_f);
-		$ymin_data = &min($ymin_data, $ymin_f);
-		$ymax_data = &max($ymax_data, $ymax_f);
-		$zmin_data = &min($zmin_data, $zmin_f);
-		$zmax_data = &max($zmax_data, $zmax_f);
-		$amin_data = &min($amin_data, $amin_f);
-		$amax_data = &max($amax_data, $amax_f);
-		$smin_data = &min($smin_data, $smin_f);
-		$smax_data = &max($smax_data, $smax_f);
-		}
-	}
-
-# check that there is data
-if ($xmin_data >= $xmax_data || $ymin_data >= $ymax_data)
-	{
-	die "$xmin_data $xmax_data $ymin_data $ymax_data \nDoes not appear to be any data in the input!\n$program_name aborted.\n";
-	}
-if (($datatype == 1 || $datatype == 2) && ($zmin_data >= $zmax_data))
-	{
-	die "Does not appear to be any bathymetry data in the input!\n$program_name aborted.\n";
-	}
-if (($datatype == 3) && ($amin_data >= $amax_data))
-	{
-	die "Does not appear to be any amplitude data in the input!\n$program_name aborted.\n";
-	}
-if (($datatype == 4) && ($smin_data >= $smax_data))
-	{
-	die "Does not appear to be any sidescan data in the input!\n$program_name aborted.\n";
-	}
-
-# either use user defined geographic limits
-if ($bounds =~ /^\S+\/\S+\/\S+\/\S+$/)
-       	{
-       	$bounds_grid = $bounds;
-       	}
-
-# or expand the data limits a bit and ensure a reasonable aspect ratio
-else
-	{
-	$delx = 0.05 * ($xmax_data - $xmin_data);
-	$dely = 0.05 * ($ymax_data - $ymin_data);
-	$xmin = $xmin_data - $delx;
-	$xmax = $xmax_data + $delx;
-	$ymin = $ymin_data - $dely;
-	$ymax = $ymax_data + $dely;
-	$dx = $xmax - $xmin;
-	$dy = $ymax - $ymin;
-	if ($dy/$dx > 2.0)
-		{
-		$delx = 0.5 * (0.5 * $dy - $dx);
-		$xmin = $xmin - $delx;
-		$xmax = $xmax + $delx;
-		}
-	elsif ($dx/$dy > 2.0)
-		{
-		$dely = 0.5 * (0.5 * $dx - $dy);
-		$ymin = $ymin - $dely;
-		$ymax = $ymax + $dely;
-		}
-	$bounds_grid = sprintf ("%1.8g/%1.8g/%1.8g/%1.8g",
-		$xmin, $xmax, $ymin, $ymax);
-	}
-
-# get grid interval
-if (!$xintyint && !$xdimydim)
-	{
-	if (!$altmax_f && $bathdef)
-		{
-		$zmax_data = $altmax_f;
-		}
-	elsif (!$zmax_data && $bathdef)
-		{
-		$zmax_data = $bathdef;
-		}
-	elsif (!$zmax_data)
-		{
-		$bathdef = 1000.0;
-		$zmax_data = $bathdef;
-		}
-	$xinterval = 0.025 * $zmax_data;
-	$xdim = ($xmax - $xmin) * 110000.0 / $xinterval;
-	$ydim = ($ymax - $ymin) * 110000.0 / $xinterval;
-	if ($xdim > 1001 && $xdim > $ydim)
-		{
-		$xinterval = ($xmax - $xmin) * 110000.0 / 1001;
-		}
-	elsif ($ydim > 1001)
-		{
-		$xinterval = ($ymax - $ymin) * 110000.0 / 1001;
-		}
-	$xintyint = "$xinterval/$xinterval/meters";
-	}
-
-# come up with the filenames
-if ($datatype < 3)
-	{
-	$cmdfile = "$root"."_mbgrid.cmd";
-	}
-else
-	{
-	$cmdfile = "$root"."_mbmosaic.cmd";
-	}
-if ($format == -1)
-	{
-	$file_list = "\$INPUT_FILE";
-	}
-else
-	{
-	$file_list = "datalist\$\$";
-	}
-
-# open the shellscript file
-if (!open(FCMD,">$cmdfile"))
-	{
-	print "\a";
-	die "Cannot open output file $cmdfile\nMacro $program_name aborted.\n";
-	}
-
-# write the shellscript header
-print FCMD "#! /bin/csh -f\n";
-if ($datatype < 3)
-	{
-	print FCMD "#\n# Shellscript to grid or mosaic swath sonar data\n";
-	}
-else
-	{
-	}
-print FCMD "# Created by macro $program_name\n";
-print FCMD "#\n# This shellscript created by following command line:\n";
-print FCMD "# $program_name $command_line\n";
-
-# Define shell variables
-print FCMD "#\n# Define shell variables used in this script:\n";
-print FCMD "set REGION          = $bounds_grid\n";
-print FCMD "set INPUT_FILE      = $file_data\n";
-print FCMD "set INPUT_FORMAT    = $format\n";
-print FCMD "set ROOT       	= $root\n";
-
-# generate datalist file if needed
-if ($format && $format != -1)
-	{
-	print FCMD "#\n# Make datalist file \n";
-	print FCMD "echo Making datalist file...\n";
-	print FCMD "echo \$INPUT_FILE \$INPUT_FORMAT >! $file_list\n";
-	}
-
-# do mbgrid if bathymetry or topography needed
-if ($datatype < 3)
-	{
-	print FCMD "#\n# Run mbgrid\n";
-	print FCMD "echo Running mbgrid...\n";
-	printf FCMD "mbgrid -I$file_list \\\n";
-	}
-# do mbmosaic if sidescan or amplitude needed
-else
-	{
-	print FCMD "#\n# Run mbmosaic\n";
-	print FCMD "echo Running mbmosaic...\n";
-	printf FCMD "mbmosaic -I$file_list \\\n";
-	}
-printf FCMD "\t-R\$REGION \\\n";
-printf FCMD "\t-O\$ROOT \\\n";
-printf FCMD "\t-A$datatype -N \\\n";
-if ($xdimydim)
-	{
-	printf FCMD "\t-D$xdimydim \\\n";
-	}
-elsif ($xintyint)
-	{
-	printf FCMD "\t-E$xintyint \\\n";
-	}
-if ($border)
-	{
-	printf FCMD "\t-B \\\n";
-	}
-if ($clip)
-	{
-	printf FCMD "\t-C$clip \\\n";
-	}
-if ($gridkind)
-	{
-	printf FCMD "\t-G$gridkind \\\n";
-	}
-if ($lonflip)
-	{
-	printf FCMD "\t-L$lonflip \\\n";
-	}
-if ($projection)
-	{
-	printf FCMD "\t-J$projection \\\n";
-	}
-if ($more)
-	{
-	printf FCMD "\t-M \\\n";
-	}
-if ($speed)
-	{
-	printf FCMD "\t-S$speed \\\n";
-	}
-if ($topofile && $datatype > 2)
-	{
-	printf FCMD "\t-T$topofile \\\n";
-	}
-if ($azimuthfactortime)
-	{
-	printf FCMD "\t-U$azimuthfactortime \\\n";
-	}
-if ($scale)
-	{
-	printf FCMD "\t-W$scale \\\n";
-	}
-if ($extend)
-	{
-	printf FCMD "\t-X$extend \\\n";
-	}
-# mbgrid only options
-if ($datatype <= 2)
-	{
-	# this is really gridding algorithm mode
-	if ($priority_range)
-		{
-		printf FCMD "\t-f$priority_range \\\n";
-		}
-	if ($background)
-		{
-		printf FCMD "\t-K$background \\\n";
-		}
-	}
-# mbmosaic only options
-if ($datatype > 2)
-	{
- 	if ($priority_file)
- 		{
- 		printf FCMD "\t-Y$priority_file \\\n";
- 		}
-	if ($priority_range)
-		{
-		printf FCMD "\t-F$priority_range \\\n";
-		}
- 	if ($bathdef)
- 		{
- 		printf FCMD "\t-Z$bathdef \\\n";
- 		}
-	}
-if ($verbose)
-	{
-	printf FCMD "\t-V \n";
-	}
-else
-	{
-	printf FCMD "\n";
-	}
-
-# claim it's all over
-print FCMD "#\n# All done!\n";
-print FCMD "echo All done!\n";
-
-# now close the shellscript and make it executable
-close FCMD;
-chmod 0775, $cmdfile;
-
-# tell program status
-if ($verbose)
-	{
-	print "\nProgram Status:\n";
-	print "--------------\n";
-	print "Define shell variables used in this script:\n";
-	print "  Grid region:  $bounds_grid\n";
-	print "  Input file:   $file_data\n";
-	print "  Input format: $format\n";
-	print "  Output root:  $root\n";
-	if ($datatype == 1)
-		{
-		print "  Data type:    Bathymetry\n";
-		}
-	elsif ($datatype == 2)
-		{
-		print "  Data type:    Topography\n";
-		}
-	elsif ($datatype == 3)
-		{
-		print "  Data type:    Amplitude\n";
-		}
-	elsif ($datatype == 4)
-		{
-		print "  Data type:    Sidescan\n";
-		}
-	if ($xdimydim)
-		{
-		print "  Dimensions:   $xdimydim\n";
-		}
-	elsif ($xintyint)
-		{
-		print "  Cell size:    $xintyint\n";
-		}
-	if ($border)
-		{
-		print "  Border:       On\n";
-		}
-	if ($clip)
-		{
-		print "  Clip:         $clip\n";
-		}
-	if ($background && $datatype <= 2)
-		{
-		print "  Background:   $background\n";
-		}
-	if ($priority_range && $datatype <= 2)
-		{
-		print "  Gridding Algorithm: $priority_range\n";
-		}
-	elsif ($priority_range && $datatype > 2)
-		{
-		print "  Priority Range: $priority_range\n";
-		}
-	if ($gridkind)
-		{
-		print "  Grid Kind:    $gridkind\n";
-		}
-	if ($lonflip)
-		{
-		print "  Lonflip:      $lonflip\n";
-		}
-	if ($more)
-		{
-		print "  More:         On\n";
-		}
-	if ($speed)
-		{
-		print "  Speed Limit:  $speed\n";
-		}
-	if ($topofile && $datatype > 2)
-		{
-		print "  Topo file:    $topofile\n";
-		}
-	if ($azimuthfactortime)
-		{
-		print "  Azimuth Factor: $azimuthfactortime\n";
-		}
-	if ($scale)
-		{
-		print "  Scale:          $scale\n";
-		}
-	if ($extend)
-		{
-		print "  Extend:         On\n";
-		}
-	# mbmosaic only options
-	if ($datatype > 2)
-		{
-		if ($priority_file)
-			{
-			print "  Priority File:  $priority_file\n";
-			}
-		if ($bathdef)
-			{
-			print "  Default Depth:  $bathdef\n";
-			}
-		}
-	print "\n--------------\n";
-	}
-
-# print out final notes
-print "\nGrid generation shellscript <$cmdfile> created.\n";
-print "\nInstructions:\n";
-print "  Execute <$cmdfile> to generate grid file <$root.grd>.\n";
-if ($verbose)
-	{
-	print "\n--------------\n\n";
-	}
-
-# execute shellscript if desired
-if ($execute)
-	{
-	if ($verbose)
-		{
-		print "Executing shellscript $cmdfile...\n";
-		}
-	system "$cmdfile &";
-	}
-exit 0;
-
-#-----------------------------------------------------------------------
-sub min {
-
-	# make local variables
-	local ($min);
-
-	# get the minimum of the arguments
-	if ($_[0] < $_[1])
-		{
-		$min = $_[0];
-		}
-	else
-		{
-		$min = $_[1];
-		}
-	$min;
-}
-#-----------------------------------------------------------------------
-sub max {
-
-	# make local variables
-	local ($max);
-
-	# get the minimum of the arguments
-	if ($_[0] > $_[1])
-		{
-		$max = $_[0];
-		}
-	else
-		{
-		$max = $_[1];
-		}
-	$max;
-}
-#-----------------------------------------------------------------------
-sub MBparsedatalist {
-	local ($FILEDATA, $line, $file_tmp, $format_tmp, @datalists, $datalist);
-
- 	if (open(FILEDATA,"<$_[0]"))
-        	{
-        	while ($line = <FILEDATA>)
-        		{
-			if (!($line =~ /^#/)
-			    && $line =~ /\S+\s+\S+/)
-			    {
-        		    ($file_tmp, $format_tmp) = $line =~ /(\S+)\s+(\S+)/;
-        		    if ($file_tmp && $format_tmp >= 0)
-        		 	{
-        			push(@files_data, $file_tmp);
-        			push(@formats, $format_tmp);
-        			}
-			    elsif ($file_tmp && $format_tmp == -1)
-				{
-        			push(@datalists, $file_tmp);
-				}
-			    }
-        		}
-        	close FILEDATA;
-        	}
-
-	# loop over datalists
-	foreach $datalist (@datalists)
-		{
-		MBparsedatalist($datalist);
-		}
-
-}
-#-----------------------------------------------------------------------
-sub GetDecimalDegrees {
-
-	# make local variables
-	local ($dec_degrees, $degrees, $minutes, $seconds);
-
-	# deal with dd:mm:ss format
-	if ($_[0] =~ /^\S+:\S+:\S+$/)
-		{
-		($degrees, $minutes, $seconds)
-			= $_[0] =~ /^(\S+):(\S+):(\S+)$/;
-		if ($degrees =~ /^-\S+/)
-			{
-			$dec_degrees = $degrees
-				- $minutes / 60.0
-				- $seconds / 3600.0;
-			}
-		else
-			{
-			$dec_degrees = $degrees
-				+ $minutes / 60.0
-				+ $seconds / 3600.0;
-			}
-		}
-	# deal with dd:mm format
-	elsif ($_[0] =~ /^\S+:\S+$/)
-		{
-		($degrees, $minutes)
-			= $_[0] =~ /^(\S+):(\S+)$/;
-		if ($degrees =~ /^-\S+/)
-			{
-			$dec_degrees = $degrees - $minutes / 60.0;
-			}
-		else
-			{
-			$dec_degrees = $degrees + $minutes / 60.0;
-			}
-		}
-
-	# value already in decimal degrees
-	else
-		{
-		$dec_degrees = $_[0];
-		}
-
-	# return decimal degrees;
-	$dec_degrees;
-}
-
-#-----------------------------------------------------------------------
-# This version of Getopts has been augmented to support multiple
-# calls to the same option. If an arg in argumentative is followed
-# by "+" rather than ":",  then the corresponding scalar will
-# be concatenated rather than overwritten by multiple calls to
-# the same arg.
-#
-# Usage:
-#      do Getopts('a:b+c'); # -a takes arg, -b concatenates args,
-#			    # -c does not take arg. Sets opt_* as a
-#                           # side effect.
-
-sub MBGetopts {
-    local($argumentative) = @_;
-    local(@args,$_,$first,$rest);
-    local($errs) = 0;
-
-    @args = split( / */, $argumentative );
-    while(@ARGV && ($_ = $ARGV[0]) =~ /^-(.)(.*)/) {
-	($first,$rest) = ($1,$2);
-	$pos = index($argumentative,$first);
-	if($pos >= $[) {
-	    if($args[$pos+1] eq ':') {
-		shift(@ARGV);
-		if($rest eq '') {
-		    ++$errs unless @ARGV;
-		    $rest = shift(@ARGV);
-		}
-		eval "\$opt_$first = \$rest;";
-		eval "\$flg_$first = 1;";
-	    }
-	    elsif($args[$pos+1] eq '+') {
-		shift(@ARGV);
-		if($rest eq '') {
-		    ++$errs unless @ARGV;
-		    $rest = shift(@ARGV);
-		}
-		if (eval "\$opt_$first") {
-		    eval "\$opt_$first = \$opt_$first
-				. \":\" . \$rest;";
-		}
-		else {
-		    eval "\$opt_$first = \$rest;";
-		}
-		eval "\$flg_$first = 1;";
-	    }
-	    elsif($args[$pos+1] eq '%') {
-		shift(@ARGV);
-		if($rest ne '') {
-		    eval "\$opt_$first = \$rest;";
-		}
-		else {
-		    $rest = $ARGV[0];
-		    ($one) = $rest =~ /^-(.).*/;
-		    $pos = index($argumentative,$one);
-		    if(!$one || $pos < $[) {
-			eval "\$opt_$first = \$rest;";
-			shift(@ARGV);
-		    }
-		}
-		eval "\$flg_$first = 1;";
-	    }
-	    else {
-		eval "\$opt_$first = 1";
-		eval "\$flg_$first = 1;";
-		if($rest eq '') {
-		    shift(@ARGV);
-		}
-		else {
-		    $ARGV[0] = "-$rest";
-		}
-	    }
-	}
-	else {
-	    print STDERR "Unknown option: $first\n";
-	    ++$errs;
-	    if($rest ne '') {
-		$ARGV[0] = "-$rest";
-	    }
-	    else {
-		shift(@ARGV);
-	    }
-	}
-    }
-    $errs == 0;
-}
-#-----------------------------------------------------------------------
diff --git a/src/macros/mbm_histplot b/src/macros/mbm_histplot
deleted file mode 100755
index d440d76..0000000
--- a/src/macros/mbm_histplot
+++ /dev/null
@@ -1,1736 +0,0 @@
-#!/usr/bin/env perl
-#--------------------------------------------------------------------
-#    The MB-system:	mbm_histplot.perl	3/20/2006
-#    $Id: mbm_histplot 2234 2015-03-05 07:41:54Z caress $
-#
-#    Copyright (c) 2006-2015 by
-#    D. W. Caress (caress at mbari.org)
-#      Monterey Bay Aquarium Research Institute
-#      Moss Landing, CA
-#    and D. N. Chayes (dale at lamont.ldgo.columbia.edu)
-#      Lamont-Doherty Earth Observatory
-#      Palisades, NY  10964
-#
-#    See README file for copying and redistribution conditions.
-#--------------------------------------------------------------------
-#
-# Command:
-#   mbm_histplot
-#
-# Purpose:
-#   Macro to generate a shellscript of GMT commands which,
-#   when executed, will generate a Postscript histogram plot
-#   of a set of data values.
-#   The plot will be scaled to fit on the specified page size
-#   or, if the scale is user defined, the page size will be
-#   chosen in accordance with the plot size. The primary purpose
-#   of this macro is to allow the simple, semi-automated
-#   production of nice looking plots with a few command line
-#   arguments. For users seeking more control over the plot
-#   appearance, a number of additional optional arguments are
-#   provided. Truly ambitious users may edit the plot shellscript
-#   to take advantage of GMT capabilites not supported by this
-#   macro.
-#
-# Basic Usage:
-#   mbm_histplot -Ifile [-Btickinfo -Gfill -H
-#            -Jprojection[/scale | width]
-#            -Ltitle -Oroot
-#            -Ppagesize -Uorientation -Q
-#            -Rw/e/s/n -V -Wpen -X]
-#
-# Author:
-#   David W. Caress
-#   Monterey Bay Aquarium Research Institute
-#   Moss Landing CA
-#   March 20, 2006
-#
-# Version:
-#   $Id: mbm_histplot 2234 2015-03-05 07:41:54Z caress $
-#
-# Revisions:
-#   $Log: mbm_histplot.perl,v $
-#   Revision 5.1  2007/10/08 05:43:09  caress
-#   Added some large page definitions.
-#
-#   Revision 5.0  2006/11/10 22:01:56  caress
-#   New macro for simple histogram plots.
-#
-#
-#
-$program_name = "mbm_histplot";
-
-# use the Posix module
-use POSIX;
-
-# set page size database
- at page_size_names = (
-	"a", "b", "c", "d", "e", "f", "e1",
-	"a0", "a1", "a2", "a3", "a4", "a5", "a6", "a7", "a8", "a9", "a10",
-	"b0", "b1", "b2", "b3", "b4", "b5", "b6", "b7", "b8", "b9", "b10",
-	"c0", "c1", "c2", "c3", "c4", "c5", "c6", "c7",
-	"m1", "m2", "m3", "m4", "m5", "m6");
-%page_width_in = (
-	"a",     8.50,   "b",    11.00,   "c",    17.00,   "d",    22.00,
-	"e",    34.00,   "f",    28.00,   "e1",   44.00,   "a0",   33.11,
-	"a1",   23.39,   "a2",   16.54,   "a3",   11.69,   "a4",    8.27,
-	"a5",    5.83,   "a6",    4.13,   "a7",    2.91,   "a8",    2.05,
-	"a9",    1.46,   "a10",   1.02,   "b0",   39.37,   "b1",   27.83,
-	"b2",   19.68,   "b3",   13.90,   "b4",    9.84,   "b5",    6.93,
-	"b6",    4.92,   "b7",    3.46,   "b8",    2.44,   "b9",    1.73,
-	"b10",   1.22,   "c0",   36.00,   "c1",   25.60,   "c2",   18.00,
-	"c3",   12.80,   "c4",    9.00,   "c5",    6.40,   "c6",    4.50,
-	"c7",    3.20,   "m1",   54.00,   "m2",   54.00,   "m3",   54.00,
-	"m4",   60.00,   "m5",   60.00,   "m6",   60.00);
-%page_height_in = (
-	"a",    11.00,   "b",    17.00,   "c",    22.00,   "d",    34.00,
-	"e",    44.00,   "f",    40.00,   "e1",   68.00,   "a0",   46.81,
-	"a1",   33.11,   "a2",   23.39,   "a3",   16.54,   "a4",   11.69,
-	"a5",    8.27,   "a6",    5.83,   "a7",    4.13,   "a8",    2.91,
-	"a9",    2.05,   "a10",   1.46,   "b0",   56.67,   "b1",   39.37,
-	"b2",   27.83,   "b3",   19.68,   "b4",   13.90,   "b5",    9.84,
-	"b6",    6.93,   "b7",    4.92,   "b8",    3.46,   "b9",    2.44,
-	"b10",   1.73,   "c0",   51.20,   "c1",   36.00,   "c2",   25.60,
-	"c3",   18.00,   "c4",   12.80,   "c5",    9.00,   "c6",    6.40,
-	"c7",    4.50,   "m1",   72.00,   "m2",   84.00,   "m3",   96.00,
-	"m4",   72.00,   "m5",   84.00,   "m6",   96.00);
-%page_anot_font = (
-	"a",     8,   "b",    12,   "c",    16,   "d",    24,
-	"e",    24,   "f",    24,   "e1",   24,   "a0",   24,
-	"a1",   24,   "a2",   16,   "a3",   12,   "a4",    8,
-	"a5",    6,   "a6",    6,   "a7",    6,   "a8",    4,
-	"a9",    4,   "a10",   4,   "b0",   24,   "b1",   24,
-	"b2",   16,   "b3",   16,   "b4",   12,   "b5",    8,
-	"b6",    6,   "b7",    4,   "b8",    4,   "b9",    4,
-	"b10",   4,   "c0",   24,   "c1",   24,   "c2",   16,
-	"c3",   12,   "c4",    8,   "c5",    6,   "c6",    6,
-	"c7",    6,   "m1",   24,   "m2",   24,   "m3",   24,
-	"m4",   24,   "m5",   24,   "m6",   24);
-%page_header_font =(
-	"a",    10,   "b",    15,   "c",    20,   "d",    30,
-	"e",    30,   "f",    30,   "e1",   30,   "a0",   30,
-	"a1",   30,   "a2",   20,   "a3",   15,   "a4",   10,
-	"a5",    8,   "a6",    8,   "a7",    8,   "a8",    5,
-	"a9",    5,   "a10",   5,   "b0",   30,   "b1",   30,
-	"b2",   20,   "b3",   20,   "b4",   15,   "b5",   10,
-	"b6",    8,   "b7",    5,   "b8",    5,   "b9",    5,
-	"b10",   5,   "c0",   30,   "c1",   30,   "c2",   20,
-	"c3",   15,   "c4",   10,   "c5",    8,   "c6",    8,
-	"c7",    8,   "m1",   30,   "m2",   30,   "m3",   30,
-	"m4",   30,   "m5",   30,   "m6",   30);
-%page_gmt_name =     (
-	"a",     "archA",   "b",     "archB",   "c",     "archC",   "d",     "archD",
-	"e",     "archE",   "f",     "B0",      "e1",    "B0",      "a0",    "A0",
-	"a1",    "A1",      "a2",    "A2",      "a3",    "A3",      "a4",    "A4",
-	"a5",    "A5",      "a6",    "A6",      "a7",    "A7",      "a8",    "A8",
-	"a9",    "A9",      "a10",   "A10",     "b0",    "B0",      "b1",    "B1",
-	"b2",    "B2",      "b3",    "B3",      "b4",    "B4",      "b5",    "B5",
-	"b6",    "A6",      "b7",    "A7",      "b8",    "A8",      "b9",    "A9",
-	"b10",   "A10",     "c0",    "B0",      "c1",    "B1",      "c2",    "B2",
-	"c3",    "B3",      "c4",    "B4",      "c5",    "B5",      "c6",    "B6",
-	"c7",    "B7",      "m1", "Custom_4241x5655",    "m2",   "Custom_4241x6578",
-	"m3",   "Custom_4241x7540",  "m4",   "Custom_4712x5655",
-	"m5",   "Custom_4712x6578",  "m6",   "Custom_4712x7540");
-%xpsview_mem =     (
-	"a",     "4m",   "b",     "6m",   "c",     "8m",   "d",    "12m",
-	"e",    "16m",   "f",    "16m",   "e1",   "16m",   "a0",   "16m",
-	"a1",   "12m",   "a2",    "8m",   "a3",    "6m",   "a4",    "4m",
-	"a5",    "4m",   "a6",    "4m",   "a7",    "4m",   "a8",    "4m",
-	"a9",    "4m",   "a10",   "4m",   "b0",   "16m",   "b1",   "12m",
-	"b2",    "8m",   "b3",    "8m",   "b4",    "6m",   "b5",    "4m",
-	"b6",    "4m",   "b7",    "4m",   "b8",    "4m",   "b9",    "4m",
-	"b10",   "4m",   "c0",   "16m",   "c1",   "12m",   "c2",    "8m",
-	"c3",    "6m",   "c4",    "4m",   "c5",    "4m",   "c6",    "4m",
-	"c7",    "4m",   "m1",   "16m",   "m2",   "16m",   "m3",   "16m",
-	"m4",   "16m",   "m5",   "16m",   "m6",   "16m");
-
-# Determine the GMT version
- at grdinfo = `grdinfo 2>&1`;
-while (@grdinfo)
-	{
-	$line = shift @grdinfo;
-	if ($line =~
-		/^grdinfo\s+(\S+)\s+\S+/)
-		{
-		($gmt_version) = $line =~
-			/^grdinfo\s+(\S+)\s+\S+/;
-		}
-	}
-
-# Get the current working directory.
-$current_working_dir = `pwd`;
-
-# Deal with command line arguments
-$command_line = "@ARGV";
-&MBGetopts('B:b:C:c:G:g:HhI:i:J:j:L:l:O:o:P:p:QqR:r:U:u:VvW:w:Xx:');
-$tick_info = 		($opt_B || $opt_b);
-$cellwidth = 		($opt_C || $opt_c);
-$fill = 		($opt_G || $opt_g || "gray");
-$help =    		($opt_H || $opt_h);
-$file_data =    	($opt_I || $opt_i);
-$map_scale =    	($opt_J || $opt_j || "x");
-$labels =    		($opt_L || $opt_l);
-$root =    		($opt_O || $opt_o);
-$pagesize = 		($opt_P || $opt_p);
-$no_view_ps = 		($opt_Q || $opt_q);
-$bounds = 		($opt_R || $opt_r);
-$orientation = 		($opt_U || $opt_u);
-$verbose = 		($opt_V || $opt_v);
-$pen = 			($opt_W || $opt_w || "1p");
-$execute = 		($opt_X || $opt_x);
-
-# print out help message if required
-if ($help)
-	{
-	print "\n$program_name:\n";
-	print "\nVersion: $Id: mbm_histplot 2234 2015-03-05 07:41:54Z caress $\n";
-	print "\nMacro to generate a shellscript of GMT commands which, \n";
-	print "when executed, will generate a Postscript histogram plot\n";
-	print "of a set of data values.\n";
-	print "The plot will be scaled to fit on the specified page size \n";
-	print "or, if the scale is user defined, the page size will be \n";
-	print "chosen in accordance with the plot size. The primary purpose \n";
-	print "of this macro is to allow the simple, semi-automated\n";
-	print "production of nice looking plots with a few command line\n";
-	print "arguments. For users seeking more control over the plot\n";
-	print "appearance, a number of additional optional arguments are\n";
-	print "provided. Truly ambitious users may edit the plot shellscript \n";
-	print "to take advantage of GMT capabilites not supported by this \n";
-	print "macro.\n";
-	print "\nBasic Usage: \n";
-	print "\tmbm_histplot -Ifile [-Btickinfo -Gfill -H  \n";
-	print "\t\t-Jprojection[/scale | width] \n";
-	print "\t\t-Ltitle -Oroot \n";
-	print "\t\t-Ppagesize -Uorientation -Q \n";
-	print "\t\t-Rw/e/s/n -V -Wpen -X]\n";
-	exit 0;
-	}
-
-# check for input file
-if (!$file_data)
-	{
-	print "\a";
-	die "\nNo input file specified!\n$program_name aborted\n";
-	}
-
-# set page size
-if (!$pagesize)
-{
-    $pagesize = "a";
-}
-else
-{
-    $pagesize =~ tr/A-Z/a-z/;
-    if (!$page_width_in{$pagesize})
-    {
-	$pagesize = "a";
-    }
-}
-
-# use mbdefaults to get the current system default postscript viewer
-$ps_viewer = "ghostview";
- at mbdefaults = `mbdefaults`;
-while (@mbdefaults)
-        {
-        $line = shift @mbdefaults;
-        if ($line =~ /ps viewer:\s+(\S+)/)
-                {
-                ($ps_viewer) = $line =~ /ps viewer:\s+(\S+)/;
-                 }
-        }
-
-# check environment variable
-if ($ENV{"MB_PS_VIEWER"})
-	{
-	$ps_viewer = $ENV{"MB_PS_VIEWER"};
-	}
-
-# check that file is ok
-if (! -e $file_data)
-	{
-	    print "\a";
-	die "\nInput file $file_data cannot be opened!\n$program_name aborted\n";
-	}
-
-# set output root if needed
-if (!$root)
-{
-    $root = $file_data;
-}
-
-# use user defined bounds
-if ($bounds)
-	{
-	if ($bounds =~ /^\S+\/\S+\/\S+\/\S+$/)
-		{
-		($xmin,$xmax,$ymin,$ymax) = $bounds =~
-			/(\S+)\/(\S+)\/(\S+)\/(\S+)/;
-		$bounds_plot = $bounds;
-		}
-	}
-
-# get limits of file.
-if (!$bounds)
-	{
-	# open and read the file for xmin xmax
-	open(F,$file_data) || die "Cannot open input file: $file_data\n$program_name aborted.\n";
-	$count = 0;
-	while ($data=<F>) {
-		if ($data < $xmin || $count == 0)
-			{
-			$xmin = $data;
-			}
-		if ($data > $xmax || $count == 0)
-			{
-			$xmax = $data;
-			}
-  		$count++;
-		}
-	close(F);
-	if ($count <= 0)
-		{
-		die "Input file: $file_data appears to contain no data.\n$program_name aborted.\n";
-		}
-
-	# if needed set cell bounds
-	if (!$cellwidth)
-		{
-		$cellwidth = ($xmax - $xmin) / 10;
-		}
-
-	# make cells
-	$ncell = floor(($xmax - $xmin) / $cellwidth) + 5;
-	$nxmin = floor($xmin / $cellwidth) - 1;
-	$xmin = ($nxmin - 0.5) * $cellwidth;
-	$xmax = $xmin + $cellwidth * $ncell;
-	for ($i=0;$i<$ncell;$i++)
-		{
-		push(@cellcount, 0);
-		}
-
-	# open and read the file for ymin ymax
-	open(F,$file_data) || die "Cannot open input file: $file_data\n$program_name aborted.\n";
-	while ($data=<F>) {
-		$i = floor(($data - $xmin) / $cellwidth);
-		@cellcount[$i]++;
-		}
-	close(F);
-	$ymin = 0.0;
-	$ymax = 0.0;
-	for ($i=0;$i<$ncell;$i++)
-		{
-		@cellcount[$i] = 100 * @cellcount[$i] / $count;
-		if (@cellcount[$i] > $ymax)
-			{
-			$ymax = @cellcount[$i];
-			}
-		}
-	if ($ymax <= 0.0)
-		{
-		$ymax = 50.0;
-		}
-	else
-		{
-		$ymax = 1.1 * $ymax;
-		}
-	}
-
-# set bounds string for plotting if not already set
-if (!$bounds_plot)
-	{
-	$bounds_plot = sprintf ("%1.8g/%1.8g/%1.8g/%1.8g",
-		$xmin, $xmax, $ymin, $ymax);
-	}
-
-# set the relevent page width and height
-&GetPageSize;
-
-# get user constraints on map scale
-if ($map_scale)
-	{
-	# sets $plot_scale or $plot_width if possible
-	&GetProjection;
-	}
-
-# set up for mapproject
-if (($use_scale && $plot_scale) || ($use_width && $plot_width))
-	{
-	($projection) = $map_scale =~ /^(\w)/;
-	($projection_pars) = $map_scale =~ /^$projection(\S+)/;
-	}
-elsif ($use_scale || $use_width)
-	{
-	($projection) = $map_scale =~ /^(\w)/;
-	($projection_pars) = $map_scale =~ /^$projection(\S+)/;
-	$projection_pars = "$projection_pars" . "$separator" . "$trial_value";
-	}
-else
-	{
-	$projection = "x";
-	$projection_pars = "1/1";
-	$use_scale = 1;
-	}
-
-# now find out the apparent size of the plot
-`echo $xmin $ymin > tmp$$.dat`;
-`echo $xmax $ymin >> tmp$$.dat`;
-`echo $xmax $ymax >> tmp$$.dat`;
-`echo $xmin $ymax >> tmp$$.dat`;
- at projected = `mapproject tmp$$.dat -J$projection$projection_pars -R$bounds_plot 2>&1 `;
-`/bin/rm -f tmp$$.dat`;
-print "mapproject tmp$$.dat -J$projection$projection_pars -R$bounds_plot\n";
-
-while (@projected)
-{
-    $line = shift @projected;
-print $line;
-    if(!$xxmin){
-	($xxmin,$yymin) = $line =~ /(\S+)\s+(\S+)/;
-	$xxmax = $xxmin;
-	$yymax = $yymin;
-    }
-    else
-    {
-	($xx,$yy) = $line =~ /(\S+)\s+(\S+)/;
-	$xxmin = ($xx < $xxmin ? $xx : $xxmin);
-	$xxmax = ($xx > $xxmax ? $xx : $xxmax);
-	$yymin = ($yy < $yymin ? $yy : $yymin);
-	$yymax = ($yy > $yymax ? $yy : $yymax);
-    }
-}
-$dxx = $xxmax - $xxmin;
-$dyy = $yymax - $yymin;
-
-
-# check for valid scaling
-if ($dxx == 0.0 && $dyy == 0.0)
-	{
-	print "\a";
-	die "Invalid projection specified - $program_name aborted\n";
-	}
-
-# figure out scaling issues
-
-if (($use_scale && $plot_scale) || ($use_width && $plot_width))
-	{
-	$plot_width = $dxx;
-	$plot_height = $dyy;
-
-	# decide which plot orientation to use
-	if ($orientation == 1)
-		{
-		$portrait = 1;
-		$width = $page_width_in{$pagesize};
-		$height = $page_height_in{$pagesize};
-		$width_max = $width_max_portrait;
-		$height_max = $height_max_portrait;
-		}
-	elsif ($orientation == 2)
-		{
-		$landscape = 1;
-		$width = $page_height_in{$pagesize};
-		$height = $page_width_in{$pagesize};
-		$width_max = $width_max_landscape;
-		$height_max = $height_max_landscape;
-		}
-	elsif ($dxx > $dyy)
-		{
-		$landscape = 1;
-		$width = $page_height_in{$pagesize};
-		$height = $page_width_in{$pagesize};
-		$width_max = $width_max_landscape;
-		$height_max = $height_max_landscape;
-		}
-	else
-		{
-		$portrait = 1;
-		$width = $page_width_in{$pagesize};
-		$height = $page_height_in{$pagesize};
-		$width_max = $width_max_portrait;
-		$height_max = $height_max_portrait;
-		}
-
-	# check if plot fits on page
-	if ($plot_width > $width_max || $plot_height > $height_max)
-		{
-		# try to find a sufficiently large pagesize
-		$pagesize_save = $pagesize;
-		foreach $elem (@page_size_names) {
-			$pagesize = "$elem";
-			&GetPageSize;
-			if ($portrait)
-				{
-				$width_max = $width_max_portrait;
-				$height_max = $height_max_portrait;
-				}
-			else
-				{
-				$width_max = $width_max_landscape;
-				$height_max = $height_max_landscape;
-				}
-			if (!$good_page &&
-				$plot_width <= $width_max
-				&& $plot_height <= $height_max)
-				{
-				$good_page = 1;
-				$pagesize_save = $pagesize;
-				}
-			}
-
-		# print out warning
-		if ($pagesize eq $pagesize_save)
-			{
-			print "\nWarning: Unable to fit plot on any available page size!\n";
-			print "\tThis plot will not be particularly useful!\n";
-			print "\tTry using a different scale or allow the program to set the scale!\n";
-			}
-
-		# reset the page size
-		$pagesize = $pagesize_save;
-		&GetPageSize;
-		if ($portrait)
-			{
-			$width = $page_width_in{$pagesize};
-			$height = $page_height_in{$pagesize};
-			}
-		else
-			{
-			$width = $page_height_in{$pagesize};
-			$height = $page_width_in{$pagesize};
-			}
-		}
-	}
-elsif ($use_scale && $projection =~ /^x.*/ && !$geographic)
-	{
-	# set size of plot according to orientation
-	if ($orientation == 1)
-		{
-		$portrait = 1;
-		$plot_scale_x = $width_max_portrait/$dxx;
-		$plot_scale_y = $height_max_portrait/$dyy;
-		$plot_scale = "$plot_scale_x/$plot_scale_y";
-		$width = $page_width_in{$pagesize};
-		$height = $page_height_in{$pagesize};
-		}
-	else
-		{
-		$landscape = 1;
-		$plot_scale_x = $width_max_landscape/$dxx;
-		$plot_scale_y = $height_max_landscape/$dyy;
-		$plot_scale = "$plot_scale_x/$plot_scale_y";
-		$width = $page_height_in{$pagesize};
-		$height = $page_width_in{$pagesize};
-		}
-
-	# set plot width
-	$plot_width = $dxx * $plot_scale_x;
-	$plot_height = $dyy * $plot_scale_y;
-
-	# construct plot scale parameters
-
-	## These lines break things. $projection_pars was already properly
-	## defined and $map_scale may not yet be defined. Moreover,
-	## $projection_pars should now contain JUST the scale values
-	## with no leading projection type.  The single line added
-	## is all that is required.
-	## Val Schmidt LDEO/Columbia OCTOBER 2003
-
-
-	#($projection_pars) = $map_scale =~ /^$projection(\S+)/;
-	#    $projection_pars = sprintf ("$projection_pars$separator%1.5g",
-	#				$plot_scale);
-	$projection_pars="$plot_scale";
-
-	}
-elsif ($use_width && $projection =~ /^X.*/ && !$geographic)
-	{
-	# set size of plot according to orientation
-	if ($orientation == 1)
-		{
-		$portrait = 1;
-		$plot_width_x = $width_max_portrait;
-		$plot_width_y = $height_max_portrait;
-		$plot_width = "$plot_width_x/$plot_width_y";
-		$width = $page_width_in{$pagesize};
-		$height = $page_height_in{$pagesize};
-		}
-	else
-		{
-		$landscape = 1;
-		$plot_width_x = $width_max_landscape;
-		$plot_width_y = $height_max_landscape;
-		$plot_width = "$plot_width_x/$plot_width_y";
-		$width = $page_height_in{$pagesize};
-		$height = $page_width_in{$pagesize};
-		}
-
-	# set plot width
-	$plot_scale_x = $plot_width / $dxx;
-	$plot_scale_y = $plot_height / $dyy;
-
-	# construct plot scale parameters
-
-	## These lines break things. $projection_pars was already properly
-	## defined and $map_scale may not yet be defined. Moreover,
-	## $projection_pars should now contain JUST the scale values
-	## with no leading projection type.  The single line added
-	## is all that is required.
-	## Val Schmidt LDEO/Columbia OCTOBER 2003
-
-	#($projection_pars) = $map_scale =~ /^$projection(\S+)/;
-	#$projection_pars = sprintf ("$projection_pars$separator%1.5g",
-	#				$plot_width);
-	$projection_pars="$plot_width";
-	}
-elsif ($use_scale)
-	{
-	# get landscape and portrait scales
-	$plot_scale_landscape = $width_max_landscape/$dxx;
-	if ($plot_scale_landscape*$dyy > $height_max_landscape)
-		{
-		$plot_scale_landscape = $height_max_landscape/$dyy;
-		}
-	$plot_scale_portrait = $width_max_portrait/$dxx;
-	if ($plot_scale_portrait*$dyy > $height_max_portrait)
-		{
-		$plot_scale_portrait = $height_max_portrait/$dyy;
-		}
-
-	# decide which plot orientation to use
-	if ($orientation == 1)
-		{
-		$portrait = 1;
-		$plot_scale = $plot_scale_portrait;
-		$width = $page_width_in{$pagesize};
-		$height = $page_height_in{$pagesize};
-		}
-	elsif ($orientation == 2)
-		{
-		$landscape = 1;
-		$plot_scale = $plot_scale_landscape;
-		$width = $page_height_in{$pagesize};
-		$height = $page_width_in{$pagesize};
-		}
-	elsif ($plot_scale_landscape > $plot_scale_portrait)
-		{
-		$landscape = 1;
-		$plot_scale = $plot_scale_landscape;
-		$width = $page_height_in{$pagesize};
-		$height = $page_width_in{$pagesize};
-		}
-	else
-		{
-		$portrait = 1;
-		$plot_scale = $plot_scale_portrait;
-		$width = $page_width_in{$pagesize};
-		$height = $page_height_in{$pagesize};
-		}
-
-	# set plot width
-	$plot_width = $dxx * $plot_scale;
-	$plot_height = $dyy * $plot_scale;
-
-	# reset plot_scale if ratio required
-	if ($use_ratio)
-		{
-		$top = int(1 / $plot_scale);
-		$plot_scale = "1:" . "$top";
-		}
-
-	# construct plot scale parameters
-	($projection_pars) = $map_scale =~ /^$projection(\S+)/;
-	$projection_pars = sprintf ("$projection_pars$separator%1.5g",
-					$plot_scale);
-
-	# handle special case for linear projections
-	if ($geographic)
-		{
-		$projection_pars = "$projection_pars" . "d";
-		}
-	}
-elsif ($use_width)
-	{
-	# get landscape and portrait heights
-	$plot_width_landscape = $height_max_landscape * $dxx / $dyy;
-	if ($plot_width_landscape > $width_max_landscape)
-		{
-		$plot_width_landscape = $width_max_landscape;
-		}
-	$plot_width_portrait = $height_max_portrait * $dxx / $dyy;
-	if ($plot_width_portrait > $width_max_portrait)
-		{
-		$plot_width_portrait = $width_max_portrait;
-		}
-
-	# decide which plot orientation to use
-	if ($orientation == 1)
-		{
-		$portrait = 1;
-		$plot_width = $plot_width_portrait;
-		$plot_height = $plot_width * $dyy / $dxx;
-		$width = $page_width_in{$pagesize};
-		$height = $page_height_in{$pagesize};
-		}
-	elsif ($orientation == 2)
-		{
-		$landscape = 1;
-		$plot_width = $plot_width_landscape;
-		$plot_height = $plot_width * $dyy / $dxx;
-		$width = $page_height_in{$pagesize};
-		$height = $page_width_in{$pagesize};
-		}
-	elsif ($plot_width_landscape > $plot_width_portrait)
-		{
-		$landscape = 1;
-		$plot_width = $plot_width_landscape;
-		$plot_height = $plot_width * $dyy / $dxx;
-		$width = $page_height_in{$pagesize};
-		$height = $page_width_in{$pagesize};
-		}
-	else
-		{
-		$portrait = 1;
-		$plot_width = $plot_width_portrait;
-		$plot_height = $plot_width * $dyy / $dxx;
-		$width = $page_width_in{$pagesize};
-		$height = $page_height_in{$pagesize};
-		}
-
-	# construct plot scale parameters
-	($projection_pars) = $map_scale =~ /^$projection(\S+)/;
-	$projection_pars = sprintf ("$projection_pars$separator%1.5g",
-					$plot_width);
-
-	# handle special case for linear projections
-	if ($geographic)
-		{
-		$projection_pars = "$projection_pars" . "d";
-		}
-	}
-
-# place the origin so plot is more or less centered
-$xoffset = ($width - $plot_width
-	- $space_left - $space_right) / 2 + $space_left;
-$yoffset = ($height - $plot_height
-	- $space_bottom - $space_top) / 2 + $space_bottom;
-
-# if length scale bar requested check to see if map center needs to be defined
-if ($length_scale && $length_scale =~ /\S+center\S+/)
-        {
-        # add map lon lat (or x y) center to the length scale argument
-        ($a, $c) = $length_scale =~ /(\S+)center(\S+)/;
-        $xcen = 0.5 * ($xmin + $xmax);
-        $ycen = 0.5 * ($ymin + $ymax);
-        $b = "$xcen/$ycen";
-        $length_scale = "$a$b$c";
-        }
-
-# come up with the filenames
-$cmdfile = "$root.cmd";
-$psfile = "$root.ps";
-
-# set some gmtisms
-$first = "-X\$X_OFFSET -Y\$Y_OFFSET -V >! \$PS_FILE";
-
-# set macro gmt default settings
-$gmt_def = "PROJ_LENGTH_UNIT/inch";
-push(@gmt_macro_defs, $gmt_def);
-$gmt_def = "PS_MEDIA/$page_gmt_name{$pagesize}";
-push(@gmt_macro_defs, $gmt_def);
-$gmt_def = "FONT_ANNOT_PRIMARY/$page_anot_font{$pagesize},Helvetica,black";
-push(@gmt_macro_defs, $gmt_def);
-$gmt_def = "FONT_ANNOT_SECONDARY/$page_anot_font{$pagesize},Helvetica,black";
-push(@gmt_macro_defs, $gmt_def);
-$gmt_def = "FONT_LABEL/$page_anot_font{$pagesize},Helvetica,black";
-push(@gmt_macro_defs, $gmt_def);
-$gmt_def = "FONT_TITLE/$page_header_font{$pagesize},Helvetica,black";
-push(@gmt_macro_defs, $gmt_def);
-$gmt_def = "PS_PAGE_ORIENTATION/LANDSCAPE";
-push(@gmt_macro_defs, $gmt_def);
-$gmt_def = "COLOR_BACKGROUND/black";
-push(@gmt_macro_defs, $gmt_def);
-$gmt_def = "COLOR_FOREGROUND/white";
-push(@gmt_macro_defs, $gmt_def);
-$gmt_def = "COLOR_NAN/white";
-push(@gmt_macro_defs, $gmt_def);
-$gmt_def = "FORMAT_GEO_MAP/$degree_format";
-push(@gmt_macro_defs, $gmt_def);
-
-# open the shellscript file
-if (!open(FCMD,">$cmdfile"))
-	{
-	print "\a";
-	die "Cannot open output file $cmdfile\nMacro $program_name aborted.\n";
-	}
-
-# write the shellscript header
-print FCMD "#! /bin/csh -f\n";
-print FCMD "#\n# Shellscript to create Postscript plot of data in grd file\n";
-print FCMD "# Created by macro $program_name\n";
-print FCMD "#\n# This shellscript created by following command line:\n";
-print FCMD "# $program_name $command_line\n";
-
-# Define shell variables
-print FCMD "#\n# Define shell variables used in this script:\n";
-print FCMD "set PS_FILE         = $psfile\n";
-print FCMD "set CPT_FILE        = $cptfile\n";
-print FCMD "set MAP_PROJECTION  = $projection\n";
-print FCMD "set MAP_SCALE       = $projection_pars\n";
-print FCMD "set MAP_REGION      = $bounds_plot\n";
-printf FCMD "set X_OFFSET        = %1.5g\n", $xoffset;
-printf FCMD "set Y_OFFSET        = %1.5g\n", $yoffset;
-
-# Set temporary GMT defaults
-print FCMD "#\n# Delete any existing gmt.conf file\n";
-print FCMD "if (-e gmt.conf) then\n";
-print FCMD "echo Deleting gmt.conf...\n";
-print FCMD "/bin/rm gmt.conf\n";
-print FCMD "endif\n";
-print FCMD "#\n# Set temporary GMT defaults\n";
-print FCMD "echo Setting temporary GMT defaults...\n";
-foreach $gmt_def (@gmt_macro_defs) {
-	($gmt_par, $gmt_var) = $gmt_def =~ /^([^\/]+)\/(.+)/;
-	print FCMD "gmt gmtset $gmt_par $gmt_var\n";
-	}
-
-# Reset GMT defaults as per user commands
-if (@gmt_defs)
-	{
-	print FCMD "#\n# Set user defined GMT defaults\n";
-	print FCMD "echo Setting user defined GMT defaults...\n";
-	foreach $gmt_def (@gmt_defs) {
-		($gmt_par, $gmt_var) = $gmt_def =~ /^([^\/]+)\/(.+)/;
-		print FCMD "gmt gmtset $gmt_par $gmt_var\n";
-		}
-	}
-
-# figure out labels
-$nlabels = 0;
-if ($labels)
-	{
-	@labels_split = split(/:/, $labels);
-	$nlabels = @labels_split;
-	if ($nlabels > 0)
-		{
-		$tlabel = shift(@labels_split);
-		$tlabel =~ s/\\/\//g;
-		}
-	if ($nlabels > 1)
-		{
-		$xlabel = shift(@labels_split);
-		$xlabel =~ s/\\/\//g;
-		}
-	if ($nlabels > 2)
-		{
-		$ylabel = shift(@labels_split);
-		$ylabel =~ s/\\/\//g;
-		}
-	}
-if ($nlabels < 1)
-	{
-	$tlabel = "Frequency Histogram of $file_data";
-	}
-if ($nlabels < 2)
-	{
-	$xlabel = " ";
-	}
-if ($nlabels < 3)
-	{
-	$ylabel = "Frequency %";
-	}
-
-# set basemap axes annotation
-if ($tick_info)
-	{
-	$axes = "-B$tick_info";
-	}
-elsif ($projection =~ /^[Xx].*/ && !$geographic)
-	{
-	# figure out some reasonable tick intervals for the basemap
-	&GetBaseTickLinear;
-	$axes = "-Bx$base_tick_x+l\"$xlabel\" -By$base_tick_y+l\"$ylabel\"";
-	}
-else
-	{
-	# figure out some reasonable tick intervals for the basemap
-	&GetBaseTick;
-	$axes = "-B$base_tick";
-	}
-if ($tlabel)
-	{
-	$axes = "$axes -B+t\"$tlabel\"";
-	}
-
-# do histogram plot
-printf FCMD "#\n# Make histogram\n";
-printf FCMD "echo Running pshistogram...\n";
-printf FCMD "gmt pshistogram $file_data \\\n\t";
-printf FCMD "-J\$MAP_PROJECTION\$MAP_SCALE \\\n\t";
-printf FCMD "-R\$MAP_REGION \\\n\t";
-printf FCMD "$axes \\\n\t";
-printf FCMD "-W$cellwidth -Z1 \\\n\t";
-if ($pen)
-	{
-	printf FCMD "-L$pen \\\n\t";
-	}
-if ($fill && $fill ne "N")
-	{
-	printf FCMD "-G$fill \\\n\t";
-	}
-if ($unix_stamp_on && $unix_stamp)
-	{
-	printf FCMD "-U$unix_stamp \\\n\t";
-	}
-elsif ($unix_stamp_on)
-	{
-	printf FCMD "-U \\\n\t";
-	}
-if ($portrait)
-	{
-	printf FCMD "-P ";
-	}
-printf FCMD "$first\n";
-
-# delete surplus files
-print FCMD "#\n# Delete surplus files\n";
-print FCMD "echo Deleting surplus files...\n";
-print FCMD "/bin/rm -f gmt.conf\n";
-if (!$file_cpt)
-	{
-	print FCMD "/bin/rm -f \$CPT_FILE\n";
-	}
-if ($data_scale)
-	{
-	printf FCMD "/bin/rm -f $file_use\n";
-	}
-
-if (! $save_temp_files) {
-    foreach $file (@xyfiles) {
-	printf FCMD "/bin/rm -f $file \n";
-    }
-}
-
-# display image on screen if desired
-print FCMD "#\n# Run $ps_viewer\n";
-if ($ps_viewer eq "xpsview")
-	{
-	if ($portrait)
-		{
-		$view_pageflag = "-ps $pagesize -maxp $xpsview_mem{$pagesize}";
-		}
-	elsif ($landscape)
-		{
-		$view_pageflag = "-ps $pagesize -or landscape -maxp $xpsview_mem{$pagesize}";
-		}
-	}
-elsif ($ps_viewer eq "pageview")
-	{
-	if ($portrait)
-		{
-		$view_pageflag = "-w $page_width_in{$pagesize} -h $page_height_in{$pagesize}";
-		}
-	elsif ($landscape)
-		{
-		$view_pageflag = "-w $page_height_in{$pagesize} -h $page_width_in{$pagesize}";
-		}
-	}
-elsif ($ps_viewer eq "ghostview")
-	{
-	if ($portrait)
-		{
-		$view_pageflag = "-portrait -media BBox";
-		}
-	elsif ($landscape)
-		{
-		$view_pageflag = "-landscape -media BBox";
-		}
-	}
-elsif ($ps_viewer eq "gv")
-	{
-	if ($portrait)
-		{
-		$pagescale = 11.0 / $page_height_in{$pagesize};
-		if ($pagescale > 1.0)
-			{
-			$pagescale = 1.0;
-			}
-		$view_pageflag = "--orientation=portrait --media=BBox -scale=$pagescale";
-		}
-	elsif ($landscape)
-		{
-		$pagescale = 11.0 / $page_width_in{$pagesize};
-		if ($pagescale > 1.0)
-			{
-			$pagescale = 1.0;
-			}
-		$view_pageflag = "--orientation=landscape --media=BBox -scale=$pagescale";
-		}
-	}
-elsif ($ps_viewer eq "ggv")
-	{
-	if ($portrait)
-		{
-		$view_pageflag = "--geometry=portrait";
-		}
-	elsif ($landscape)
-		{
-		$view_pageflag = "--geometry=landscape";
-		}
-	}
-elsif ($ps_viewer eq "evince")
-	{
-	$view_pageflag = " ";
-	}
-if ($no_view_ps)
-	{
-        print FCMD "#if (!(\$#argv > 0 && (\"\$1\" == \"-N\" || \"\$1\" == \"-n\"))) then\n";
-	print FCMD "#echo Running $ps_viewer in background...\n";
-	print FCMD "#$ps_viewer $view_pageflag \$PS_FILE &\n";
-        print FCMD "#endif\n";
-	}
-else
-	{
-        print FCMD "if (!(\$#argv > 0 && (\"\$1\" == \"-N\" || \"\$1\" == \"-n\"))) then\n";
-	print FCMD "echo Running $ps_viewer in background...\n";
-	print FCMD "$ps_viewer $view_pageflag \$PS_FILE &\n";
-        print FCMD "endif\n";
-	}
-
-# claim it's all over
-print FCMD "#\n# All done!\n";
-print FCMD "echo All done!\n";
-
-# now close the shellscript and make it executable
-close FCMD;
-chmod 0775, $cmdfile;
-
-# tell program status
-if ($verbose)
-	{
-	print "\nProgram Status:\n";
-	print "--------------\n";
-	print "\n  GMT Version:\n";
-	print "    Version $gmt_version\n";
-	print "\n  Plot Style:\n";
-	if (@xyfiles)
-		{
-		print "    XY Plots of ", scalar(@xyfiles), " Datasets\n";
-		}
-	if ($coast_control)
-		{
-		print "    Coastline\n";
-		}
-	if (@text)
-		{
-		print "    ", scalar(@text), " Text labels\n";
-		}
-	if ($length_scale)
-		{
-		print "    Map distance scale\n";
-		}
-	if ($unix_stamp_on && $unix_stamp)
-		{
-		print "    Unix time stamp: $unix_stamp\n";
-		}
-	elsif ($unix_stamp_on)
-		{
-		print "    Unix time stamp\n";
-		}
-	print "\n  Input Files:\n";
-	foreach $xyfile (@xyfiles) {
-		print "    XY Data File:             $xyfile\n";
-	}
-	print "\n  Output Files:\n";
-	print "    Output plot name root:    $root\n";
-	print "    Plotting shellscript:     $cmdfile\n";
-	print "    Plot file:                $psfile\n";
-	print "\n  Plot Attributes:\n";
-	printf "    Plot width:               %.4f\n", $plot_width;
-	printf "    Plot height:              %.4f\n", $plot_height;
-	print "    Page size:                $pagesize\n";
-	print "    Page width:               $width\n";
-	print "    Page height:              $height\n";
-	print "    Projection:               -J$projection$projection_pars\n";
-	print "    Axes annotation:          $axes\n";
-	if ($portrait)
-		{
-		print "    Orientation:              portrait\n";
-		}
-	else
-		{
-		print "    Orientation:              landscape\n";
-		}
-	print "\n  XY Data Attributes:\n";
-	printf "    X min max:                %9.4g  %9.4g\n",
-		$xmin, $xmax;
-	printf "    Y min max:                %9.4g  %9.4g\n",
-		$ymin, $ymax;
-	print "\n  GMT Default Values Reset in Script:\n";
-	foreach $gmt_def (@gmt_macro_defs) {
-		($gmt_par, $gmt_var) = $gmt_def =~ /^([^\/]+)\/(.+)/;
-		printf "    %-25s %s\n", $gmt_par, $gmt_var;
-		}
-	foreach $gmt_def (@gmt_defs) {
-		($gmt_par, $gmt_var) = $gmt_def =~ /^([^\/]+)\/(.+)/;
-		printf "    $gmt_par : $gmt_var\n";
-		}
-	print "\n--------------\n";
-	}
-
-# print out final notes
-print "\nPlot generation shellscript <$cmdfile> created.\n";
-print "\nInstructions:\n";
-print "  Execute <$cmdfile> to generate Postscript plot <$psfile>.\n";
-if (!$no_view_ps)
-	{
-	print "  Executing <$cmdfile> also invokes $ps_viewer ";
-	print "to view the plot on the screen.\n";
-	}
-if ($verbose)
-	{
-	print "\n--------------\n\n";
-	}
-
-# execute shellscript if desired
-if ($execute)
-	{
-	if ($verbose)
-		{
-		print "Executing shellscript $cmdfile...\n";
-		}
-	system "$cmdfile &";
-	}
-
-exit 0;
-
-#-----------------------------------------------------------------------
-sub min {
-
-	# make local variables
-	local ($min);
-
-	# get the minimum of the arguments
-	if ($_[0] < $_[1])
-		{
-		$min = $_[0];
-		}
-	else
-		{
-		$min = $_[1];
-		}
-	$min;
-}
-#-----------------------------------------------------------------------
-sub max {
-
-	# make local variables
-	local ($max);
-
-	# get the minimum of the arguments
-	if ($_[0] > $_[1])
-		{
-		$max = $_[0];
-		}
-	else
-		{
-		$max = $_[1];
-		}
-	$max;
-}
-#-----------------------------------------------------------------------
-sub GetDecimalDegrees {
-
-	# make local variables
-	local ($dec_degrees, $degrees, $minutes, $seconds);
-
-	# deal with dd:mm:ss format
-	if ($_[0] =~ /^\S+:\S+:\S+$/)
-		{
-		($degrees, $minutes, $seconds)
-			= $_[0] =~ /^(\S+):(\S+):(\S+)$/;
-		if ($degrees =~ /^-\S+/)
-			{
-			$dec_degrees = $degrees
-				- $minutes / 60.0
-				- $seconds / 3600.0;
-			}
-		else
-			{
-			$dec_degrees = $degrees
-				+ $minutes / 60.0
-				+ $seconds / 3600.0;
-			}
-		}
-	# deal with dd:mm format
-	elsif ($_[0] =~ /^\S+:\S+$/)
-		{
-		($degrees, $minutes)
-			= $_[0] =~ /^(\S+):(\S+)$/;
-		if ($degrees =~ /^-\S+/)
-			{
-			$dec_degrees = $degrees - $minutes / 60.0;
-			}
-		else
-			{
-			$dec_degrees = $degrees + $minutes / 60.0;
-			}		}
-
-	# value already in decimal units of some sort
-	else
-		{
-		$dec_degrees = $_[0];
-		}
-
-	# return decimal degrees;
-	$dec_degrees;
-}
-#-----------------------------------------------------------------------
-sub GetPageSize {
-
-# get space around edge of plot
-	$space_top =    1.25 * $page_height_in{$pagesize}
-			    / $page_height_in{"a"};
-	$space_bottom = 1.50 * $page_height_in{$pagesize}
-			    / $page_height_in{"a"};
-	$space_left =   1.00 * $page_height_in{$pagesize}
-			    / $page_height_in{"a"};
-	$space_right =  1.00 * $page_height_in{$pagesize}
-			    / $page_height_in{"a"};
-
-# set the relevent page width and height
-$width_max_landscape = $page_height_in{$pagesize}
-		- $space_left - $space_right;
-$height_max_landscape = $page_width_in{$pagesize}
-		- $space_bottom - $space_top;
-$width_max_portrait = $page_width_in{$pagesize}
-		- $space_left - $space_right;
-$height_max_portrait = $page_height_in{$pagesize}
-		- $space_bottom - $space_top;
-}
-#-----------------------------------------------------------------------
-sub GetProjection {
-
-	# get the map projection flag
-	($projection) = $map_scale =~ /^(\w)/;
-	($projection_pars) = $map_scale =~ /^$projection(\S+)/;
-
-	# see if plot scale or plot width defined
-	$use_scale = 0;
-	$use_width = 0;
-	$separator = "/";
-	$trial_value = 1.0;
-
-	# Cassini Projection
-	if ($projection eq "c")
-		{
-		($plot_scale) = $map_scale =~ /^c\S+\/\S+\/(\S+)$/;
-		$use_scale = 1;
-		}
-	elsif ($projection eq "C")
-		{
-		($plot_width) = $map_scale =~ /^C\S+\/\S+\/(\S+)$/;
-		$use_width = 1;
-		}
-
-	# Mercator Projection
-	elsif ($projection eq "m")
-		{
-		($plot_scale) = $map_scale =~ /^m(\S+)$/;
-		$use_scale = 1;
-		$separator = "";
-		}
-	elsif ($projection eq "M")
-		{
-		($plot_width) = $map_scale =~ /^M(\S+)$/;
-		$use_width = 1;
-		$separator = "";
-		}
-
-	# Oblique Mercator Projection
-	elsif ($projection eq "o")
-		{
-		if ($map_scale =~ /^oa\S+/)
-			{
-			($plot_scale) = $map_scale =~ /^oa\S+\/\S+\/\S+\/(\S+)$/;
-			}
-		elsif ($map_scale =~ /^ob\S+/)
-			{
-			($plot_scale) = $map_scale =~ /^ob\S+\/\S+\/\S+\/\S+\/(\S+)$/;
-			}
-		elsif ($map_scale =~ /^oc\S+/)
-			{
-			($plot_scale) = $map_scale =~ /^oc\S+\/\S+\/\S+\/\S+\/(\S+)$/;
-			}
-		$use_scale = 1;
-		}
-	elsif ($projection eq "O")
-		{
-		if ($map_scale =~ /^Oa\S+/)
-			{
-			($plot_width) = $map_scale =~ /^Oa\S+\/\S+\/\S+\/(\S+)$/;
-			}
-		elsif ($map_scale =~ /^Ob\S+/)
-			{
-			($plot_width) = $map_scale =~ /^Ob\S+\/\S+\/\S+\/\S+\/(\S+)$/;
-			}
-		elsif ($map_scale =~ /^Oc\S+/)
-			{
-			($plot_width) = $map_scale =~ /^Oc\S+\/\S+\/\S+\/\S+\/(\S+)$/;
-			}
-		$use_width = 1;
-		}
-
-	# Equidistant Cylindrical Projection
-	elsif ($projection eq "q")
-		{
-		($plot_scale) = $map_scale =~ /^q\S+\/(\S+)$/;
-		$use_scale = 1;
-		}
-	elsif ($projection eq "Q")
-		{
-		($plot_width) = $map_scale =~ /^Q\S+\/(\S+)$/;
-		$use_width = 1;
-		}
-
-	# Transverse Mercator Projection
-	elsif ($projection eq "t")
-		{
-		($plot_scale) = $map_scale =~ /^t\S+\/(\S+)$/;
-		$use_scale = 1;
-		}
-	elsif ($projection eq "T")
-		{
-		($plot_width) = $map_scale =~ /^T\S+\/(\S+)$/;
-		$use_width = 1;
-		}
-
-	# Universal Transverse Mercator Projection
-	elsif ($projection eq "u")
-		{
-		($plot_scale) = $map_scale =~ /^u\S+\/(\S+)$/;
-		$use_scale = 1;
-		}
-	elsif ($projection eq "U")
-		{
-		($plot_width) = $map_scale =~ /^U\S+\/(\S+)$/;
-		$use_width = 1;
-		}
-
-	# Basic Cylindrical Projection
-	elsif ($projection eq "y")
-		{
-		($plot_scale) = $map_scale =~ /^y\S+\/\S+\/(\S+)$/;
-		$use_scale = 1;
-		}
-	elsif ($projection eq "Y")
-		{
-		($plot_width) = $map_scale =~ /^Y\S+\/\S+\/(\S+)$/;
-		$use_width = 1;
-		}
-
-	# Lambert Azimuthal Projection
-	elsif ($projection eq "a")
-		{
-		($plot_scale) = $map_scale =~ /^a\S+\/\S+\/(\S+)$/;
-		$use_scale = 1;
-		$trial_value = "1:1";
-		$use_ratio = 1;
-		}
-	elsif ($projection eq "A")
-		{
-		($plot_width) = $map_scale =~ /^A\S+\/\S+\/(\S+)$/;
-		$use_width = 1;
-		}
-
-	# Equidistant Projection
-	elsif ($projection eq "e")
-		{
-		($plot_scale) = $map_scale =~ /^e\S+\/\S+\/(\S+)$/;
-		$use_scale = 1;
-		$trial_value = "1:1";
-		$use_ratio = 1;
-		}
-	elsif ($projection eq "E")
-		{
-		($plot_width) = $map_scale =~ /^E\S+\/\S+\/(\S+)$/;
-		$use_width = 1;
-		}
-
-	# Orthographic Projection
-	elsif ($projection eq "g")
-		{
-		($plot_scale) = $map_scale =~ /^g\S+\/\S+\/(\S+)$/;
-		$use_scale = 1;
-		$trial_value = "1:1";
-		$use_ratio = 1;
-		}
-	elsif ($projection eq "G")
-		{
-		($plot_width) = $map_scale =~ /^G\S+\/\S+\/(\S+)$/;
-		$use_width = 1;
-		}
-
-	# General Sterographic Projection
-	elsif ($projection eq "s")
-		{
-		($plot_scale) = $map_scale =~ /^s\S+\/\S+\/(\S+)$/;
-		$use_scale = 1;
-		$trial_value = "1:1";
-		$use_ratio = 1;
-		}
-	elsif ($projection eq "S")
-		{
-		($plot_width) = $map_scale =~ /^S\S+\/\S+\/(\S+)$/;
-		$use_width = 1;
-		}
-
-	# Albers Projection
-	elsif ($projection eq "b")
-		{
-		($plot_scale) = $map_scale =~ /^b\S+\/\S+\/\S+\/\S+\/(\S+)$/;
-		$use_scale = 1;
-		}
-	elsif ($projection eq "B")
-		{
-		($plot_width) = $map_scale =~ /^B\S+\/\S+\/\S+\/\S+\/(\S+)$/;
-		$use_width = 1;
-		}
-
-	# Lambert Conic Projection
-	elsif ($projection eq "l")
-		{
-		($plot_scale) = $map_scale =~ /^l\S+\/\S+\/\S+\/\S+\/(\S+)$/;
-		$use_scale = 1;
-		}
-	elsif ($projection eq "L")
-		{
-		($plot_width) = $map_scale =~ /^L\S+\/\S+\/\S+\/\S+\/(\S+)$/;
-		$use_width = 1;
-		}
-
-	# Hammer Projection
-	elsif ($projection eq "h")
-		{
-		($plot_scale) = $map_scale =~ /^h\S+\/(\S+)$/;
-		$use_scale = 1;
-		}
-	elsif ($projection eq "H")
-		{
-		($plot_width) = $map_scale =~ /^H\S+\/(\S+)$/;
-		$use_width = 1;
-		}
-
-	# Sinusoidal Projection
-	elsif ($projection eq "i")
-		{
-		($plot_scale) = $map_scale =~ /^i\S+\/(\S+)$/;
-		$use_scale = 1;
-		}
-	elsif ($projection eq "I")
-		{
-		($plot_width) = $map_scale =~ /^I\S+\/(\S+)$/;
-		$use_width = 1;
-		}
-
-	# Eckert VI Projection
-	elsif ($projection eq "k")
-		{
-		($plot_scale) = $map_scale =~ /^k\S+\/(\S+)$/;
-		$use_scale = 1;
-		}
-	elsif ($projection eq "K")
-		{
-		($plot_width) = $map_scale =~ /^K\S+\/(\S+)$/;
-		$use_width = 1;
-		}
-
-	# Robinson Projection
-	elsif ($projection eq "n")
-		{
-		($plot_scale) = $map_scale =~ /^n\S+\/(\S+)$/;
-		$use_scale = 1;
-		}
-	elsif ($projection eq "N")
-		{
-		($plot_width) = $map_scale =~ /^N\S+\/(\S+)$/;
-		$use_width = 1;
-		}
-
-	# Winkel Tripel Projection
-	elsif ($projection eq "r")
-		{
-		($plot_scale) = $map_scale =~ /^r\S+\/(\S+)$/;
-		$use_scale = 1;
-		}
-	elsif ($projection eq "R")
-		{
-		($plot_width) = $map_scale =~ /^R\S+\/(\S+)$/;
-		$use_width = 1;
-		}
-
-	# Mollweide Projection
-	elsif ($projection eq "w")
-		{
-		($plot_scale) = $map_scale =~ /^w\S+\/(\S+)$/;
-		$use_scale = 1;
-		}
-	elsif ($projection eq "W")
-		{
-		($plot_width) = $map_scale =~ /^W\S+\/(\S+)$/;
-		$use_width = 1;
-		}
-
-	# Linear Polar Projection
-	elsif ($projection eq "p")
-		{
-		($plot_scale) = $map_scale =~ /^p(\S+)$/;
-		$use_scale = 1;
-		$separator = "";
-		}
-	elsif ($projection eq "P")
-		{
-		($plot_width) = $map_scale =~ /^P(\S+)$/;
-		$use_width = 1;
-		$separator = "";
-		}
-
-	# Linear Projection
-	elsif ($projection eq "x")
-		{
-		if ($map_scale =~ /^xd$/)
-			{
-			$geographic = 1;
-			chop($map_scale);
-			}
-		else
-			{
-			($plot_scale) = $map_scale =~ /^x(\S+)$/;
-			}
-		$use_scale = 1;
-		$separator = "";
-		}
-	elsif ($projection eq "X")
-		{
-		if ($map_scale =~ /^Xd$/)
-			{
-			$geographic = 1;
-			chop($map_scale);
-			}
-		else
-			{
-			($plot_width) = $map_scale =~ /^X(\S+)$/;
-			}
-		$use_width = 1;
-		$separator = "";
-		}
-}
-#-----------------------------------------------------------------------
-sub GetBaseTickLinear {
-
-	# figure out some reasonable tick intervals for the basemap
-	$dxxx = $xmax - $xmin;
-	if ($dxxx > 0)
-		{
-		$base = int((log($dxxx) / log(10.)) + 0.5);
-		$base_tick_x = (10 ** $base) / 5;
-		if ($dxxx / $base_tick_x < 5)
-			{
-			$base_tick_x = $base_tick_x / 4;
-			}
-		elsif ($dxxx / $base_tick_x < 10)
-			{
-			$base_tick_x = $base_tick_x / 2;
-			}
-		}
-	$dyyy = $ymax - $ymin;
-	if ($dyyy > 0)
-		{
-		$base = int((log($dyyy) / log(10.)) + 0.5);
-		$base_tick_y = (10 ** $base) / 5;
-		if ($dyyy / $base_tick_y < 5)
-			{
-			$base_tick_y = $base_tick_y / 4;
-			}
-		elsif ($dyyy / $base_tick_y < 10)
-			{
-			$base_tick_y = $base_tick_y / 2;
-			}
-		}
-
-}
-#-----------------------------------------------------------------------
-sub GetBaseTick {
-
-	# figure out some reasonable tick intervals for the basemap
-	$base_tick_x = ($xmax - $xmin) / 5;
-	$base_tick_y = ($ymax - $ymin) / 5;
-	$base_tick = &min($base_tick_x, $base_tick_y);
-	if ($base_tick < 0.0002777777)
-		{
-		$base_tick = "1s";
-		}
-	elsif ($base_tick < 0.0005555555)
-		{
-		$base_tick = "2s";
-		}
-	elsif ($base_tick < 0.0013888889)
-		{
-		$base_tick = "5s";
-		}
-	elsif ($base_tick < 0.0027777778)
-		{
-		$base_tick = "10s";
-		}
-	elsif ($base_tick < 0.0041666667)
-		{
-		$base_tick = "15s";
-		}
-	elsif ($base_tick < 0.0083333333)
-		{
-		$base_tick = "30s";
-		}
-	elsif ($base_tick < 0.0166667)
-		{
-		$base_tick = "1m";
-		}
-	elsif ($base_tick < 0.0333333)
-		{
-		$base_tick = "2m";
-		}
-	elsif ($base_tick < 0.0833333)
-		{
-		$base_tick = "5m";
-		}
-	elsif ($base_tick < 0.1666667)
-		{
-		$base_tick = "10m";
-		}
-	elsif ($base_tick < 0.25)
-		{
-		$base_tick = "15m";
-		}
-	elsif ($base_tick < 0.5)
-		{
-		$base_tick = "30m";
-		}
-	elsif ($base_tick < 1.0)
-		{
-		$base_tick = "1";
-		}
-	elsif ($base_tick < 2.0)
-		{
-		$base_tick = "2";
-		}
-	elsif ($base_tick < 5.0)
-		{
-		$base_tick = "5";
-		}
-	elsif ($base_tick < 10.0)
-		{
-		$base_tick = "10";
-		}
-	elsif ($base_tick < 15.0)
-		{
-		$base_tick = "15";
-		}
-	elsif ($base_tick < 30.0)
-		{
-		$base_tick = "30";
-		}
-	elsif ($base_tick < 30.0)
-		{
-		$base_tick = "30";
-		}
-	elsif ($base_tick < 360.0)
-		{
-		$base_tick = "60";
-		}
-
-}
-#-----------------------------------------------------------------------
-# This version of Getopts has been augmented to support multiple
-# calls to the same option. If an arg in argumentative is followed
-# by "+" rather than ":",  then the corresponding scalar will
-# be concatenated rather than overwritten by multiple calls to
-# the same arg.
-#
-# Usage:
-#      do Getopts('a:b+c'); # -a takes arg, -b concatenates args,
-#			    # -c does not take arg. Sets opt_* as a
-#                           # side effect.
-
-sub MBGetopts {
-    local($argumentative) = @_;
-    local(@args,$_,$first,$rest);
-    local($errs) = 0;
-
-    @args = split( / */, $argumentative );
-    while(@ARGV && ($_ = $ARGV[0]) =~ /^-(.)(.*)/) {
-	($first,$rest) = ($1,$2);
-	$pos = index($argumentative,$first);
-	if($pos >= $[) {
-	    if($args[$pos+1] eq ':') {
-		shift(@ARGV);
-		if($rest eq '') {
-		    ++$errs unless @ARGV;
-		    $rest = shift(@ARGV);
-		}
-		eval "\$opt_$first = \$rest;";
-		eval "\$flg_$first = 1;";
-	    }
-	    elsif($args[$pos+1] eq '+') {
-		shift(@ARGV);
-		if($rest eq '') {
-		    ++$errs unless @ARGV;
-		    $rest = shift(@ARGV);
-		}
-		if (eval "\$opt_$first") {
-		    eval "\$opt_$first = \$opt_$first
-				. \":::::::\" . \$rest;";
-		}
-		else {
-		    eval "\$opt_$first = \$rest;";
-		}
-		eval "\$flg_$first = 1;";
-	    }
-	    elsif($args[$pos+1] eq '%') {
-		shift(@ARGV);
-		if($rest ne '') {
-		    eval "\$opt_$first = \$rest;";
-		}
-		else {
-		    $rest = $ARGV[0];
-		    ($one) = $rest =~ /^-(.).*/;
-		    $pos = index($argumentative,$one);
-		    if(!$one || $pos < $[) {
-			eval "\$opt_$first = \$rest;";
-			shift(@ARGV);
-		    }
-		}
-		eval "\$flg_$first = 1;";
-	    }
-	    else {
-		eval "\$opt_$first = 1";
-		eval "\$flg_$first = 1;";
-		if($rest eq '') {
-		    shift(@ARGV);
-		}
-		else {
-		    $ARGV[0] = "-$rest";
-		}
-	    }
-	}
-	else {
-	    print STDERR "Unknown option: $first\n";
-	    ++$errs;
-	    if($rest ne '') {
-		$ARGV[0] = "-$rest";
-	    }
-	    else {
-		shift(@ARGV);
-	    }
-	}
-    }
-    $errs == 0;
-}
-#-----------------------------------------------------------------------
diff --git a/src/macros/mbm_makedatalist b/src/macros/mbm_makedatalist
deleted file mode 100755
index c2b61ea..0000000
--- a/src/macros/mbm_makedatalist
+++ /dev/null
@@ -1,213 +0,0 @@
-#!/usr/bin/env perl
-#--------------------------------------------------------------------
-#    The MB-system:	mbm_makedatalist.perl	27/1/2006
-#    $Id: mbm_makedatalist 2227 2015-02-05 21:12:31Z caress $
-#
-#    Copyright (c) 2006-2015 by
-#    D. W. Caress (caress at mbari.org)
-#      Monterey Bay Aquarium Research Institute
-#      Moss Landing, CA
-#    and D. N. Chayes (dale at lamont.ldgo.columbia.edu)
-#      Lamont-Doherty Earth Observatory
-#      Palisades, NY  10964
-#
-#    See README file for copying and redistribution conditions.
-#--------------------------------------------------------------------
-#
-# Command:
-#   mbm_makedatalist
-#
-# Purpose:
-#   Macro to generate an MB-System datalist file referencing all
-#   identifiable swath files in the specified directory. If no directory
-#   is specified with the -I option, then the current directory is used.
-#   The resulting datalist will be named datalist.mb-1 by default.
-#
-# Basic Usage:
-#   mbm_makedatalist [-Idirectory -Odatalist -H -V]
-#
-# Author:
-#   David W. Caress
-#   Monterey Bay Aquarium Research Institute
-#   Moss Landing, CA 95039
-#   January 27, 2006
-#
-# Version:
-#   $Id: mbm_makedatalist 2227 2015-02-05 21:12:31Z caress $
-#
-# Revisions:
-#   $Log: mbm_makedatalist.perl,v $
-#   Revision 5.1  2006/04/11 19:12:06  caress
-#   Macro now handles data in remote directories.
-#
-#   Revision 5.0  2006/02/03 21:06:18  caress
-#   Initial version of macro to generate a datalist of all recognizable swath files in a directory.
-#
-#
-#
-$program_name = "mbm_makedatalist";
-
-# Deal with command line arguments
-$command_line = "@ARGV";
-&MBGetopts('HhI:i:O:o:Vv');
-
-$help =    		($opt_H || $opt_h);
-$directory = 		($opt_I || $opt_i || ".");
-$datalist =    		($opt_O || $opt_o || "datalist.mb-1");
-$verbose = 		($opt_V || $opt_v);
-
-# print out help message if required
-if ($help)
-	{
-	print "\n$program_name:\n";
-	print "\nVersion: $Id: mbm_makedatalist 2227 2015-02-05 21:12:31Z caress $\n";
-        print "Macro to generate an MB-System datalist file referencing all\n";
-        print "identifiable swath files in the specified directory. If no directory\n";
-        print "is specified with the -I option, then the current directory is used.\n";
-        print "The resulting datalist will be named datalist.mb-1 by default.\n";
-
-        print "\nBasic Usage:\n\tmbm_makedatalist [-Idirectory -Odatalist -H -V]\n";
-	exit 0;
-	}
-
-# tell the world we got started
-if ($verbose)
-	{
-	print "\nRunning $program_name...\n";
-	}
-
-# get list of files in specified directory
- at filelist = `ls -1 $directory`;
-
-# loop over the list of files counting identifiable swath files
-$count = 0;
-foreach $file (@filelist)
-	{
-	chop $file;
-	$format = `mbformat -L -I $file`;
-	chop $format;
-	if ($format != 0 && ($file ne $datalist || $directory ne "."))
-		{
-		$count++;
-		if ($directory ne ".")
-			{
-			$path = "$directory/$file";
-			}
-		else
-			{
-			$path = $file;
-			}
-		push(@outfilelist, $path);
-		push(@outformatlist, $format);
-		}
-	}
-
-# open output datalist
-if ($count > 0)
-	{
-	if (!open(DATALIST,">$datalist"))
-		{
-		die "\n$program_name:\nUnable to output output datalist file $datalist\nExiting...\n";
-		}
-
-	# loop over the list of files
-	for ($i = 0; $i < scalar(@outfilelist); $i++)
-		{
-		print DATALIST "$outfilelist[$i] $outformatlist[$i]\n";
-		$count++;
-		}
-
-	# close datalist
-	close DATALIST;
-	}
-
-# done
-exit 0;
-
-#-----------------------------------------------------------------------
-# This version of Getopts has been augmented to support multiple
-# calls to the same option. If an arg in argumentative is followed
-# by "+" rather than ":",  then the corresponding scalar will
-# be concatenated rather than overwritten by multiple calls to
-# the same arg.
-#
-# Usage:
-#      do Getopts('a:b+c'); # -a takes arg, -b concatenates args,
-#			    # -c does not take arg. Sets opt_* as a
-#                           # side effect.
-
-sub MBGetopts {
-    local($argumentative) = @_;
-    local(@args,$_,$first,$rest);
-    local($errs) = 0;
-
-    @args = split( / */, $argumentative );
-    while(@ARGV && ($_ = $ARGV[0]) =~ /^-(.)(.*)/) {
-	($first,$rest) = ($1,$2);
-	$pos = index($argumentative,$first);
-	if($pos >= $[) {
-	    if($args[$pos+1] eq ':') {
-		shift(@ARGV);
-		if($rest eq '') {
-		    ++$errs unless @ARGV;
-		    $rest = shift(@ARGV);
-		}
-		eval "\$opt_$first = \$rest;";
-		eval "\$flg_$first = 1;";
-	    }
-	    elsif($args[$pos+1] eq '+') {
-		shift(@ARGV);
-		if($rest eq '') {
-		    ++$errs unless @ARGV;
-		    $rest = shift(@ARGV);
-		}
-		if (eval "\$opt_$first") {
-		    eval "\$opt_$first = \$opt_$first
-				. \":\" . \$rest;";
-		}
-		else {
-		    eval "\$opt_$first = \$rest;";
-		}
-		eval "\$flg_$first = 1;";
-	    }
-	    elsif($args[$pos+1] eq '%') {
-		shift(@ARGV);
-		if($rest ne '') {
-		    eval "\$opt_$first = \$rest;";
-		}
-		else {
-		    $rest = $ARGV[0];
-		    ($one) = $rest =~ /^-(.).*/;
-		    $pos = index($argumentative,$one);
-		    if(!$one || $pos < $[) {
-			eval "\$opt_$first = \$rest;";
-			shift(@ARGV);
-		    }
-		}
-		eval "\$flg_$first = 1;";
-	    }
-	    else {
-		eval "\$opt_$first = 1";
-		eval "\$flg_$first = 1;";
-		if($rest eq '') {
-		    shift(@ARGV);
-		}
-		else {
-		    $ARGV[0] = "-$rest";
-		}
-	    }
-	}
-	else {
-	    print STDERR "Unknown option: $first\n";
-	    ++$errs;
-	    if($rest ne '') {
-		$ARGV[0] = "-$rest";
-	    }
-	    else {
-		shift(@ARGV);
-	    }
-	}
-    }
-    $errs == 0;
-}
-#-----------------------------------------------------------------------
diff --git a/src/macros/mbm_makesvp b/src/macros/mbm_makesvp
deleted file mode 100755
index 155076e..0000000
--- a/src/macros/mbm_makesvp
+++ /dev/null
@@ -1,285 +0,0 @@
-#!/usr/bin/env perl
-#--------------------------------------------------------------------
-#    The MB-system:	mbm_plot.perl	10/5/2013
-#    $Id: mbm_makesvp 2227 2015-02-05 21:12:31Z caress $
-#
-#    Copyright (c) 2013-2015 by
-#    D. W. Caress (caress at mbari.org)
-#      Monterey Bay Aquarium Research Institute
-#      Moss Landing, CA
-#    and D. N. Chayes (dale at lamont.ldgo.columbia.edu)
-#      Lamont-Doherty Earth Observatory
-#      Palisades, NY  10964
-#
-#    See README file for copying and redistribution conditions.
-#--------------------------------------------------------------------
-#
-# Command:
-#   mbm_makesvp
-#
-# Purpose:
-#   Macro to extract sound speed and depth data from a datalist of swath files,
-#   and generate a sound velocity profile model from averages of the sound
-#   speed values in regular depth ranges. This macro is intended for use
-#   with mapping data from submerged platforms (e.g. ROVs and AUVs) carrying
-#   CTD or SSV sensors.
-#
-# Basic Usage:
-#   mbm_makesvp -Idatalist [-H -V -Ddepthinterval]
-#
-# Author:
-#   David W. Caress
-#   Lamont-Doherty Earth Observatory
-#   Palisades, NY  10964
-#   October 5, 2013
-#
-# Version:
-#   $Id: mbm_makesvp 2227 2015-02-05 21:12:31Z caress $
-#
-# Revisions:
-#   $Log: mbm_makesvp.perl,v $
-#
-$program_name = "mbm_makesvp";
-
-# Deal with command line arguments
-$command_line = "@ARGV";
-&MBGetopts('D:d:F:f:HhI:i:O:o:Vv');
-$help =    		($opt_H || $opt_h);
-$depthinterval =    	($opt_D || $opt_d || 25);
-$format =    		($opt_F || $opt_f);
-$inputfile =    	($opt_I || $opt_i | "datalist.mb-1");
-$output =    		($opt_O || $opt_o);
-$verbose = 		($opt_V || $opt_v);
-
-# print out help message if required
-if ($help)
-	{
-	print "\n$program_name:\n";
-	print "Version: $Id: mbm_makesvp 2227 2015-02-05 21:12:31Z caress $\n";
-	print "Macro to extract sound speed and depth data from a datalist of swath files,\n";
-	print "and generate a sound velocity profile model from averages of the sound\n";
-	print "speed values in regular depth ranges. This macro is intended for use\n";
-	print "with mapping data from submerged platforms (e.g. ROVs and AUVs) carrying\n";
-	print "CTD or SSV sensors.\n";
-	print "Basic Usage: \n";
-	print "\t$program_name -Iinputfile [-H -V -Ddepthinterval]\n";
-	exit 0;
-	}
-
-# check for input file
-if (!$inputfile)
-	{
-	print "\a";
-	die "No input datalist specified - $program_name aborted\n";
-	}
-elsif (! -e $inputfile)
-	{
-	print "\a";
-	die "Specified input datalist cannot be opened - $program_name aborted\n";
-	}
-
-# tell the world we got started
-if ($verbose)
-	{
-	print "\nRunning $program_name...\n";
-	}
-
-# loop over all files referenced in datalist
-if ($verbose)
-	{
-	print "\nGetting depth and sound speed data using mbctdlist...\n\n";
-	}
-if (!$format)
-    {
-    $mbformat = `mbformat -K -I$inputfile`;
-    ($format) = $mbformat =~ /\S+\s+(\S+)/;
-    }
-
- at mbctdlist = `mbctdlist -F$format -I$inputfile  -O^cs`;
-$nsoundspeed = 0;
-$depthmin = 999999999.99;
-$depthmax = 0.0;
-$depthmin = 999999999.99;
-$depthmax = 0.0;
-while (@mbctdlist)
-	{
-	$line = shift @mbctdlist;
-	if ($line =~ /(\S+)\s+(\S+)/)
-		{
-		($depth,$soundspeed) = $line =~ /(\S+)\s+(\S+)/;
-		push(@depths, $depth);
-		push(@soundspeeds, $soundspeed);
-		$nsoundspeed++;
-		if ($nsoundspeed == 1)
-		    {
-		    $depthmin = $depth;
-		    $depthmax = $depth;
-		    $soundspeedmin = $soundspeed;
-		    $soundspeedmax = $soundspeed;
-		    }
-		if ($depth < $depthmin)
-		    {
-		    $depthmin = $depth;
-		    }
-		if ($depth > $depthmax)
-		    {
-		    $depthmax = $depth;
-		    }
-		if ($soundspeed < $soundspeedmin)
-		    {
-		    $soundspeedmin = $soundspeed;
-		    }
-		if ($soundspeed > $soundspeed)
-		    {
-		    $soundspeedmax = $soundspeedmax;
-		    }
-		}
-	}
-if ($verbose)
-	{
-	print "\nRead $nsoundspeed depth & sound speed values...\n";
-	print "     Depth range:       $depthmin $depthmax\n";
-	print "     Sound speed range: $soundspeedmin $soundspeedmax\n";
-	}
-
-# Check that data have been successfully read
-if ($nsoundspeed <= 0)
-	{
-	die "Failed to read any depth & sound speed values - $program_name aborted\n";
-	}
-
-# Construct the depth bins for averaging
-$depthminuse = $depthinterval * (int ($depthmin / $depthinterval));
-$depthmaxuse = $depthinterval * (1 + int ($depthmax / $depthinterval));
-$ndepthbin = int(($depthmaxuse - $depthminuse) / $depthinterval);
-for ($i=0; $i < $ndepthbin; $i++)
-	{
-	push(@depthbinsum, 0.0);
-	push(@depthbincount, 0);
-	}
-for ($j=0; $j < $nsoundspeed; $j++)
-	{
-	$ibin = int(($depths[$j] - $depthminuse) / $depthinterval);
-	$depthbinsum[$ibin] += $soundspeeds[$j];
-	$depthbincount[$ibin]++;
-	}
-
-# Output the binned sound speed values
-if ($output)
-	{
-	open(F,">$output") || die "Cannot open output file: $output\n$program_name aborted.\n";
-	}
-
-for ($i=0; $i < $ndepthbin; $i++)
-	{
-	if ($depthbincount[$i] > 0)
-		{
-		$depth = $depthminuse + $i * $depthinterval + 0.5 * $depthinterval;
-		$soundspeed = $depthbinsum[$i] / $depthbincount[$i];
-		print "$depth $soundspeed\n";
-		if ($output)
-			{
-			print F "$depth $soundspeed\n";
-			}
-		else
-			{
-			print "$depth $soundspeed\n";
-			}
-		}
-	}
-if ($output)
-	{
-	close(F);
-	}
-
-
-# exit
-exit 0;
-
-#-----------------------------------------------------------------------
-# This version of Getopts has been augmented to support multiple
-# calls to the same option. If an arg in argumentative is followed
-# by "+" rather than ":",  then the corresponding scalar will
-# be concatenated rather than overwritten by multiple calls to
-# the same arg.
-#
-# Usage:
-#      do Getopts('a:b+c'); # -a takes arg, -b concatenates args,
-#			    # -c does not take arg. Sets opt_* as a
-#                           # side effect.
-
-sub MBGetopts {
-    local($argumentative) = @_;
-    local(@args,$_,$first,$rest);
-    local($errs) = 0;
-
-    @args = split( / */, $argumentative );
-    while(@ARGV && ($_ = $ARGV[0]) =~ /^-(.)(.*)/) {
-	($first,$rest) = ($1,$2);
-	$pos = index($argumentative,$first);
-	if($pos >= $[) {
-	    if($args[$pos+1] eq ':') {
-		shift(@ARGV);
-		if($rest eq '') {
-		    ++$errs unless @ARGV;
-		    $rest = shift(@ARGV);
-		}
-		eval "\$opt_$first = \$rest;";
-		eval "\$flg_$first = 1;";
-	    }
-	    elsif($args[$pos+1] eq '+') {
-		shift(@ARGV);
-		if($rest eq '') {
-		    ++$errs unless @ARGV;
-		    $rest = shift(@ARGV);
-		}
-		if (eval "\$opt_$first") {
-		    eval "\$opt_$first = \$opt_$first
-				. \":\" . \$rest;";
-		}
-		else {
-		    eval "\$opt_$first = \$rest;";
-		}
-		eval "\$flg_$first = 1;";
-	    }
-	    elsif($args[$pos+1] eq '%') {
-		shift(@ARGV);
-		if($rest ne '') {
-		    eval "\$opt_$first = \$rest;";
-		}
-		else {
-		    $rest = $ARGV[0];
-		    ($one) = $rest =~ /^-(.).*/;
-		    $pos = index($argumentative,$one);
-		    if(!$one || $pos < $[) {
-			eval "\$opt_$first = \$rest;";
-			shift(@ARGV);
-		    }
-		}
-		eval "\$flg_$first = 1;";
-	    }
-	    else {
-		eval "\$opt_$first = 1";
-		eval "\$flg_$first = 1;";
-		if($rest eq '') {
-		    shift(@ARGV);
-		}
-		else {
-		    $ARGV[0] = "-$rest";
-		}
-	    }
-	}
-	else {
-	    print STDERR "Unknown option: $first\n";
-	    ++$errs;
-	    if($rest ne '') {
-		$ARGV[0] = "-$rest";
-	    }
-	    else {
-		shift(@ARGV);
-	    }
-	}
-    }
-    $errs == 0;
-}
-#-----------------------------------------------------------------------
diff --git a/src/macros/mbm_multicopy b/src/macros/mbm_multicopy
deleted file mode 100755
index 7bae4bd..0000000
--- a/src/macros/mbm_multicopy
+++ /dev/null
@@ -1,258 +0,0 @@
-#!/usr/bin/env perl
-#--------------------------------------------------------------------
-#    The MB-system:	mbm_multicopy.perl	7/17/2011
-#   $Id: mbm_multi7kprocess.pl 19XX 2011-07-17 15:15:00Z ferreira $
-#
-#    Copyright (c) 2011-2015 by
-#    D. W. Caress (caress at mbari.org)
-#      Monterey Bay Aquarium Research Institute
-#      Moss Landing, CA
-#    and D. N. Chayes (dale at lamont.ldgo.columbia.edu)
-#      Lamont-Doherty Earth Observatory
-#      Palisades, NY  10964
-#
-#    See README file for copying and redistribution conditions.
-#--------------------------------------------------------------------
-#
-# Command:
-#   mbm_multicopy
-#
-# Purpose:
-#   Macro to apply mbcopy to all files referenced through
-#   a datalist, using the MB-System file suffix convention
-#   to name the output files.
-#
-# Basic Usage:
-#   mbm_multicopy -Foutputformat -Idatalist [-H -V -C -T]
-#
-# Authors:
-#   Christian Ferreira
-#   MARUM - Center for Marine Environmental Sciences
-#   Klagenfurter Str. 2, GEO Building
-#   28359, Bremen, Germany
-#   July 17, 2011
-#
-#   David W. Caress
-#   Lamont-Doherty Earth Observatory
-#   Palisades, NY  10964
-#   January 17, 2003
-#
-# Version:
-#   $Id: mbm_multiprocess.pl 19XX 2011-07-17 15:15:00Z ferreira $
-#
-# Revisions:
-#
-#  Revision 1.0		2011-07-17 15:15:00	cferreira
-#  Initial version with full implementation of mbcopy flags
-#
-
-$program_name = "mbm_multicopy";
-
-# Deal with command line arguments
-$command_line = "@ARGV";
-&MBGetopts('CcF:f:HhI:i:X:x:TtVv');
-$oformat = 		($opt_F || $opt_f);
-$help =    		($opt_H || $opt_h);
-$datalist =    		($opt_I || $opt_i || datalist.mb-1);
-$check =    		($opt_C || $opt_c);
-$test =    		($opt_T || $opt_t);
-$verbose = 		($opt_V || $opt_v);
-$nprocesses =        	($opt_X || $opt_x || 4);
-
-# print out help message if required
-if ($help)
-	{
-	print "\n$program_name:\n";
-	print "\nVersion: $Id: mbm_multicopy.pl 1891 2011-05-04 23:46:30Z caress $\n";
-	print "\nMacro to apply mbcopy to all files referenced through\n";
-	print "a datalist, using the MB-System file suffix convention\n";
-	print "to name the output files, and using parallel processes.\n";
-	print "\nBasic Usage: \n";
-	print "\t$program_name -Foutputformat -Idatalist [-H -V -T]\n";
-	exit 0;
-	}
-
-# exiting if CPU number is lower than 1
-if ($cpu < 1)
-	{
-	print "\nExiting $program_name, CPU(s) number(s) should be\n equal or bigger than one...\n\n";
-	exit 0;
-	}
-	
-# make sure that the input file exists
-if (! -f $datalist)
-	{
-	print "\nExiting $program_name, Input file $datalist does not exist...\n\n";
-	exit 0;
-	}
-
-# tell the world we got started
-if ($verbose)
-	{
-	print "\nRunning $program_name...\n";
-	}
-
-# loop over all files referenced in datalist
-if ($verbose)
-	{
-	print "Getting file list using mbdatalist...\n";
-	}
- at mbdatalist = `mbdatalist -F-1 -I$datalist`;
-while (@mbdatalist)
-	{
-	$line = shift @mbdatalist;
-	if ($line =~ /(\S+)\s+(\S+)/)
-		{
-		($file_mb,$format_mb) =
-			$line =~ /(\S+)\s+(\S+)/;
-		push(@files_data, $file_mb);
-		push(@formats, $format_mb);
-		}
-	}
-
-# start parellel computing
-use Parallel::ForkManager;
-use LWP::Simple;
-if ($verbose)
-	{
-	print "Initializing parallel processing with as many as $nprocesses processes\n\n";
-	}
-my $pm=new Parallel::ForkManager($nprocesses);
-
-# copy each of the files using mbcopy
-$cnt = 0;
-foreach $file_mb (@files_data)
-	{
-	my $pid = $pm->start and next;
-
-	# get file root
-	$line = `mbformat -K -I$file_mb`;
-	($root,$format_mb) = $line =~ /(\S+)\s+(\S+)/;
-	$iformat = $formats[$cnt];
-	if ($oformat)
-		{
-		$outformat = $oformat;
-		}
-	else
-		{
-		$outformat = $format_mb;
-		}
-	$ofile_mb = "$root.mb$outformat";
-	if ($ofile_mb eq $file_mb)
-		{
-		$root = $root . "c";
-		$ofile_mb = "$root.mb$oformat";
-		}
-
-	# copy to output format using mbcopy
-	if (!$check || !(-e $ofile_mb))
-		{
-		$mbcopy = "mbcopy -F$iformat/$outformat -I$file_mb -O$root.mb$outformat";
-		if (!$test)
-			{
-			print "Running: $mbcopy\n";
-			`$mbcopy`;
-			}
-		else
-			{
-			print "Testing: $mbcopy\n";
-			}
-		}
-
-	# increment counter
-	$cnt++;
-	$pm->finish;
-	}
-
-$pm->wait_all_children;
-
-# exit
-exit 0;
-
-#-----------------------------------------------------------------------
-# This version of Getopts has been augmented to support multiple
-# calls to the same option. If an arg in argumentative is followed
-# by "+" rather than ":",  then the corresponding scalar will
-# be concatenated rather than overwritten by multiple calls to
-# the same arg.
-#
-# Usage:
-#      do Getopts('a:b+c'); # -a takes arg, -b concatenates args,
-#			    # -c does not take arg. Sets opt_* as a
-#                           # side effect.
-
-sub MBGetopts {
-    local($argumentative) = @_;
-    local(@args,$_,$first,$rest);
-    local($errs) = 0;
-
-    @args = split( / */, $argumentative );
-    while(@ARGV && ($_ = $ARGV[0]) =~ /^-(.)(.*)/) {
-	($first,$rest) = ($1,$2);
-	$pos = index($argumentative,$first);
-	if($pos >= $[) {
-	    if($args[$pos+1] eq ':') {
-		shift(@ARGV);
-		if($rest eq '') {
-		    ++$errs unless @ARGV;
-		    $rest = shift(@ARGV);
-		}
-		eval "\$opt_$first = \$rest;";
-		eval "\$flg_$first = 1;";
-	    }
-	    elsif($args[$pos+1] eq '+') {
-		shift(@ARGV);
-		if($rest eq '') {
-		    ++$errs unless @ARGV;
-		    $rest = shift(@ARGV);
-		}
-		if (eval "\$opt_$first") {
-		    eval "\$opt_$first = \$opt_$first
-				. \":\" . \$rest;";
-		}
-		else {
-		    eval "\$opt_$first = \$rest;";
-		}
-		eval "\$flg_$first = 1;";
-	    }
-	    elsif($args[$pos+1] eq '%') {
-		shift(@ARGV);
-		if($rest ne '') {
-		    eval "\$opt_$first = \$rest;";
-		}
-		else {
-		    $rest = $ARGV[0];
-		    ($one) = $rest =~ /^-(.).*/;
-		    $pos = index($argumentative,$one);
-		    if(!$one || $pos < $[) {
-			eval "\$opt_$first = \$rest;";
-			shift(@ARGV);
-		    }
-		}
-		eval "\$flg_$first = 1;";
-	    }
-	    else {
-		eval "\$opt_$first = 1";
-		eval "\$flg_$first = 1;";
-		if($rest eq '') {
-		    shift(@ARGV);
-		}
-		else {
-		    $ARGV[0] = "-$rest";
-		}
-	    }
-	}
-	else {
-	    print STDERR "Unknown option: $first\n";
-	    ++$errs;
-	    if($rest ne '') {
-		$ARGV[0] = "-$rest";
-	    }
-	    else {
-		shift(@ARGV);
-	    }
-	}
-    }
-    $errs == 0;
-}
-#-----------------------------------------------------------------------
diff --git a/src/macros/mbm_multidatalist b/src/macros/mbm_multidatalist
deleted file mode 100755
index 854c1b6..0000000
--- a/src/macros/mbm_multidatalist
+++ /dev/null
@@ -1,185 +0,0 @@
-#!/usr/bin/env perl
-#--------------------------------------------------------------------
-#    The MB-system:	mbm_multidatalist.perl	7/18/2011
-#   $Id: mbm_multidatalisz.pl 19XX 2011-07-18 15:40:00Z ferreira $
-#
-#    Copyright (c) 2011-2015 by
-#    D. W. Caress (caress at mbari.org)
-#      Monterey Bay Aquarium Research Institute
-#      Moss Landing, CA
-#    and D. N. Chayes (dale at lamont.ldgo.columbia.edu)
-#      Lamont-Doherty Earth Observatory
-#      Palisades, NY  10964
-#
-#    See README file for copying and redistribution conditions.
-#--------------------------------------------------------------------
-#
-# Command:
-#   mbm_multidatalist
-#
-# Purpose:
-#   Perl shellscript to generate standard ancilliary files using
-#   parallel mbdatalist -O processes
-#
-# Usage:
-#   mbm_multidatalist -Xcpu -Idatalist
-#
-# Author:
-#   Christian Ferreira
-#   MARUM - Center for Marine Environmental Sciences
-#   Klagenfurter Str. 2, GEO Building
-#   28359, Bremen, Germany
-#   July 17, 2011
-#
-# Version:
-#   $Id: mbm_multidatalist.pl 19XX 2011-07-18 15:40:00Z ferreira $
-#
-# Revisions:
-#
-#  Revision 1.0		2011-07-18 15:40:00	cferreira
-#  Initial version with partial implementation of mbdatalist flags
-#
-
-$program_name = "mbm_multidatalist";
-
-# Deal with command line arguments
-$command_line = "@ARGV";
-&Getopts('I:i:NnX:x:HhVv');
-$help =    		($opt_H || $opt_h);
-$datalist =    		($opt_I || $opt_i || "datalist.mb-1");
-$regenerate =    	($opt_N || $opt_n);
-$verbose = 		($opt_V || $opt_v);
-$cpu =        		($opt_X || $opt_x || 4);
-
-# print out help message if required
-if ($help)
-	{
-	print "\n$program_name:\n";
-	print "\nVersion: mbm_multidatalist.pl 19XX 2011-07-18 15:40:00Z ferreira\n";
-	print "\nMacro to use mbdatalist with the -O option to generate standard ancilliary files, using parallel processes\n";
-	print "\n";
-	print "\nBasic Usage: \n\n";
-	print "\t$program_name -Idatalist -Xnprocesses [-N -H -V]\n\n";
-	exit 0;
-	}
-
-# tell the world we got started
-if ($verbose)
-	{
-	print "\nRunning $program_name...\n";
-	}
-
-# exiting if CPU number is lower than 1
-if ($cpu < 1)
-	{
-	print "\nExiting $program_name, CPU(s) number(s) should be\n equal or bigger than one...\n\n";
-	exit 0;
-	}
-	
-# make sure that the input file exists
-if !(-f $datalist)
-	{
-	print "\nExiting $program_name, Input file $datalist does not exist...\n\n";
-	exit 0;
-	}
-
-# set the mbdatalist control option
-if ($regenerate)
-	{
-	$option = "-N";
-	}
-else
-	{
-	$option = "-O";
-	}
-
-# loop over all files referenced in datalist
- at mbdatalist = `mbdatalist -F-1 -I$datalist`;
-while (@mbdatalist)
-	{
-	$line = shift @mbdatalist;
-	if ($line =~ /(\S+)\s+(\S+)/)
-		{
-		($file_mb,$format_mb) =
-			$line =~ /(\S+)\s+(\S+)/;
-		push(@files_data, $file_mb);
-		push(@formats, $format_mb);
-		}
-	}
-
-# start parellel computing
-use Parallel::ForkManager;
-use LWP::Simple;
-my $pm=new Parallel::ForkManager($cpu);
-
-foreach $file_mb (@files_data)
-	{
-	my $pid = $pm->start and next;
-	if ($verbose)
-		{
-		$command = "mbdatalist -I$file_mb $option -V";
-		print "Executing $command\n";
-		}
-	else
-		{
-		$command = "mbdatalist -I$file_mb $option";
-		}
-	system $command;
-	$pm->finish;
-	}
-
-$pm->wait_all_children;
-
-exit 0;
-
-#-----------------------------------------------------------------------
-# This should be loaded from the library but its safer to
-# just include it....
-#
-;# getopts.pl - a better getopt.pl
-
-;# Usage:
-;#      do Getopts('a:bc');  # -a takes arg. -b & -c not. Sets opt_* as a
-;#                           #  side effect.
-
-sub Getopts {
-    local($argumentative) = @_;
-    local(@args,$_,$first,$rest);
-    local($errs) = 0;
-
-    @args = split( / */, $argumentative );
-    while(@ARGV && ($_ = $ARGV[0]) =~ /^-(.)(.*)/) {
-     ($first,$rest) = ($1,$2);
-     $pos = index($argumentative,$first);
-     if($pos >= $[) {
-         if($args[$pos+1] eq ':') {
-          shift(@ARGV);
-          if($rest eq '') {
-              ++$errs unless @ARGV;
-              $rest = shift(@ARGV);
-          }
-          eval "\$opt_$first = \$rest;";
-         }
-         else {
-          eval "\$opt_$first = 1";
-          if($rest eq '') {
-              shift(@ARGV);
-          }
-          else {
-              $ARGV[0] = "-$rest";
-          }
-         }
-     }
-     else {
-         print STDERR "Unknown option: $first\n";
-         ++$errs;
-         if($rest ne '') {
-          $ARGV[0] = "-$rest";
-         }
-         else {
-          shift(@ARGV);
-         }
-     }
-    }
-    $errs == 0;
-}
diff --git a/src/macros/mbm_multiprocess b/src/macros/mbm_multiprocess
deleted file mode 100755
index 248f7a1..0000000
--- a/src/macros/mbm_multiprocess
+++ /dev/null
@@ -1,174 +0,0 @@
-#!/usr/bin/env perl
-#--------------------------------------------------------------------
-#    The MB-system:	mbm_multiprocess.perl	7/01/2011
-#   $Id: mbm_multiprocess 2234 2015-03-05 07:41:54Z caress $
-#
-#    Copyright (c) 2011-2015 by
-#    D. W. Caress (caress at mbari.org)
-#      Monterey Bay Aquarium Research Institute
-#      Moss Landing, CA
-#    and D. N. Chayes (dale at lamont.ldgo.columbia.edu)
-#      Lamont-Doherty Earth Observatory
-#      Palisades, NY  10964
-#
-#    See README file for copying and redistribution conditions.
-#--------------------------------------------------------------------
-#
-# Command:
-#   mbm_multiprocess
-#
-# Purpose:
-#   Perl shellscript to run parallel mbprocess jobs and use modern
-#   CPUs with several processors
-#
-# Usage:
-#   mbm_multiprocess -Xcpu
-#
-# Author:
-#   Christian Ferreira
-#   MARUM - Center for Marine Environmental Sciences
-#   Klagenfurter Str. 2, GEO Building
-#   28359, Bremen, Germany
-#   July 01, 2011
-#
-# Version:
-#   $Id: mbm_multiprocess 2234 2015-03-05 07:41:54Z caress $
-#
-# Revisions:
-#
-#  Revision 2		2011-07-23 12:51:00	cferreira
-#  Major rewrite to avoid that files are processed twice since the
-#  locking may not be fast enough, now running with sequential files
-#  using a datalist.
-#
-#  Revision 1.1		2011-07-05 20:26:00	cferreira
-#  Minor changes.
-#
-#  Revision 1.0		2011-07-01 22:20:00	cferreira
-#  Initial version.
-
-
-$program_name = "mbm_multiprocess";
-
-# Deal with command line arguments
-$command_line = "@ARGV";
-&Getopts('I:i:X:x:HhVv');
-$help =    		($opt_H || $opt_h);
-$datalist =    		($opt_I || $opt_i || "datalist.mb-1");
-$verbose = 		($opt_V || $opt_v);
-$cpu =        		($opt_X || $opt_x || 4);
-
-# print out help message if required
-if ($help)
-	{
-	print "\n$program_name:\n";
-	print "\nVersion: mbm_multiprocess.pl 19XX 2011-07-23 12:51:00Z ferreira\n";
-	print "\nMacro to run mbprocess on the swath files referenced by a datalist using parallel processes.\n";
-	print "\n";
-	print "\nBasic Usage: \n\n";
-	print "\t$program_name -Xnumbercpus [-H -V]\n\n";
-	exit 0;
-	}
-
-# tell the world we got started
-if ($verbose)
-	{
-	print "\nRunning $program_name...\n";
-	}
-
-# exiting if CPU number is lower than 1
-if ($cpu < 1)
-	{
-	print "\nExiting $program_name, CPU(s) number(s) should be\n equal or bigger than one...\n\n";
-	exit 0;
-	}
-	
-# make sure that the input file exists
-if (! -f $datalist)
-	{
-	print "\nExiting $program_name, Input file $datalist does not exist...\n\n";
-	exit 0;
-	}
-
-# loop over all files referenced in datalist
- at mbdatalist = `mbdatalist -F-1 -I$datalist`;
-while (@mbdatalist)
-	{
-	$line = shift @mbdatalist;
-	if ($line =~ /(\S+)\s+(\S+)/)
-		{
-		($file_mb,$format_mb) =
-			$line =~ /(\S+)\s+(\S+)/;
-		push(@files_data, $file_mb);
-		push(@formats, $format_mb);
-		}
-	}
-
-use Parallel::ForkManager;
-use LWP::Simple;
-my $pm=new Parallel::ForkManager($cpu);
-
-foreach $file_mb (@files_data)
-	{
-	my $pid = $pm->start and next;
-	system "mbprocess -I$file_mb";
-	$pm->finish;
-	}
-
-$pm->wait_all_children;
-
-exit 0;
-
-
-
-#-----------------------------------------------------------------------
-# This should be loaded from the library but its safer to
-# just include it....
-#
-;# getopts.pl - a better getopt.pl
-
-;# Usage:
-;#      do Getopts('a:bc');  # -a takes arg. -b & -c not. Sets opt_* as a
-;#                           #  side effect.
-
-sub Getopts {
-    local($argumentative) = @_;
-    local(@args,$_,$first,$rest);
-    local($errs) = 0;
-
-    @args = split( / */, $argumentative );
-    while(@ARGV && ($_ = $ARGV[0]) =~ /^-(.)(.*)/) {
-     ($first,$rest) = ($1,$2);
-     $pos = index($argumentative,$first);
-     if($pos >= $[) {
-         if($args[$pos+1] eq ':') {
-          shift(@ARGV);
-          if($rest eq '') {
-              ++$errs unless @ARGV;
-              $rest = shift(@ARGV);
-          }
-          eval "\$opt_$first = \$rest;";
-         }
-         else {
-          eval "\$opt_$first = 1";
-          if($rest eq '') {
-              shift(@ARGV);
-          }
-          else {
-              $ARGV[0] = "-$rest";
-          }
-         }
-     }
-     else {
-         print STDERR "Unknown option: $first\n";
-         ++$errs;
-         if($rest ne '') {
-          $ARGV[0] = "-$rest";
-         }
-         else {
-          shift(@ARGV);
-         }
-     }
-    }
-    $errs == 0;
-}
diff --git a/src/macros/mbm_plot b/src/macros/mbm_plot
deleted file mode 100755
index f11ec63..0000000
--- a/src/macros/mbm_plot
+++ /dev/null
@@ -1,3708 +0,0 @@
-#!/usr/bin/env perl
-#--------------------------------------------------------------------
-#    The MB-system:	mbm_plot.perl	6/18/93
-#    $Id: mbm_plot 2234 2015-03-05 07:41:54Z caress $
-#
-#    Copyright (c) 1993-2015 by
-#    D. W. Caress (caress at mbari.org)
-#      Monterey Bay Aquarium Research Institute
-#      Moss Landing, CA
-#    and D. N. Chayes (dale at lamont.ldgo.columbia.edu)
-#      Lamont-Doherty Earth Observatory
-#      Palisades, NY  10964
-#
-#    See README file for copying and redistribution conditions.
-#--------------------------------------------------------------------
-#
-# Command:
-#   mbm_plot
-#
-# Purpose:
-#   Macro to generate a shellscript of MB-System and GMT commands
-#   which, when executed, will generate a Postscript plot of the
-#   specified swath sonar data. The plot may include bathymetry color
-#   fill (-G1), bathymetry color shaded relief (-G2), bathymetry
-#   shaded with amplitudes (-G3), greyshade fill amplitude (-G4),
-#   greyshade fill sidescan (-G5), contoured bathymetry (-C),
-#   or annotated navigation. The plot may also include text
-#   labels and xy data in lines or symbols. Five different color
-#   schemes are included. The plot will be scaled to fit on
-#   the specified page size or, if the scale is user defined,
-#   the page size will be chosen in accordance with the plot
-#   size. The primary purpose of this macro is to allow the
-#   simple, semi-automated production of nice looking maps with
-#   a few command line arguments. For users seeking more control
-#   over the plot appearance, a number of additional optional
-#   arguments are provided. Truly ambitious users may edit the
-#   plot shellscript to take advantage of MB-System and GMT
-#   capabilites not supported by this macro.
-#
-# Basic Usage:
-#   mbm_plot -Fformat -Ifile [-Amagnitude[/azimuth | zero_level]
-#            -C[cont_int/col_int/tic_int/lab_int/tic_len/lab_hgt]
-#            -Gcolor_mode -H
-#            -N[time_tick/time_annot/date_annot/time_tick_len[/name_hgt]  |  F | FP]
-#            -Oroot -Ppagesize -S[color/shade] -T -Uorientation -V
-#            -Wcolor_style[/pallette] ]
-#
-# Additional Options:
-#            [-Btickinfo -Dflipcolor/flipshade
-#            -Jprojection[/scale | width] -Ltitle[:scale_label]
-#            -Mmisc -Q -Rw/e/s/n -X -Y -Zmin/max\]n
-#
-# Miscellaneous Options:
-#            [-MGDgmtdef/value -MGFscale_loc
-#            -MGL[f][x]lon0/lat0/slat/length[units][+llabel]
-#            -MGTx/y/size/angle/font/just/text
-#            -MGQdpi -MGU[/dx/dy/][label]
-#            -MMAfactor/mode/depth -MMByr/mo/da/hr/mn/sc
-#            -MMDmode/scale[/min/max] -MMEyr/mo/da/hr/mn/sc
-#            -MMNnplot -MMPpings -MMSspeedmin
-#            -MMTtimegap -MMZalgorithm
-#            -MNA[name_hgt[/P] | P]
-#            -MNP[pingnumber_tick/pingnumber_annot/pingnumber_tick_len]
-#            -MTCfill -MTDresolution -MTGfill -MTIriver[/pen]
-#            -MTNborder[/pen] -MTSfill -MTWpen
-#            -MXGfill -MXIxy_file -MXSsymbol/size -MXWpen]
-#
-# Author:
-#   David W. Caress
-#   Lamont-Doherty Earth Observatory
-#   Palisades, NY  10964
-#   June 17, 1993
-#
-# Version:
-#   $Id: mbm_plot 2234 2015-03-05 07:41:54Z caress $
-#
-#
-$program_name = "mbm_plot";
-
-# set page size database
- at page_size_names = (
-	"a", "b", "c", "d", "e", "f", "e1",
-	"a0", "a1", "a2", "a3", "a4", "a5", "a6", "a7", "a8", "a9", "a10",
-	"b0", "b1", "b2", "b3", "b4", "b5", "b6", "b7", "b8", "b9", "b10",
-	"c0", "c1", "c2", "c3", "c4", "c5", "c6", "c7",
-	"m1", "m2", "m3", "m4", "m5", "m6");
-%page_width_in = (
-	"a",     8.50,   "b",    11.00,   "c",    17.00,   "d",    22.00,
-	"e",    34.00,   "f",    28.00,   "e1",   44.00,   "a0",   33.11,
-	"a1",   23.39,   "a2",   16.54,   "a3",   11.69,   "a4",    8.27,
-	"a5",    5.83,   "a6",    4.13,   "a7",    2.91,   "a8",    2.05,
-	"a9",    1.46,   "a10",   1.02,   "b0",   39.37,   "b1",   27.83,
-	"b2",   19.68,   "b3",   13.90,   "b4",    9.84,   "b5",    6.93,
-	"b6",    4.92,   "b7",    3.46,   "b8",    2.44,   "b9",    1.73,
-	"b10",   1.22,   "c0",   36.00,   "c1",   25.60,   "c2",   18.00,
-	"c3",   12.80,   "c4",    9.00,   "c5",    6.40,   "c6",    4.50,
-	"c7",    3.20,   "m1",   54.00,   "m2",   54.00,   "m3",   54.00,
-	"m4",   60.00,   "m5",   60.00,   "m6",   60.00);
-%page_height_in = (
-	"a",    11.00,   "b",    17.00,   "c",    22.00,   "d",    34.00,
-	"e",    44.00,   "f",    40.00,   "e1",   68.00,   "a0",   46.81,
-	"a1",   33.11,   "a2",   23.39,   "a3",   16.54,   "a4",   11.69,
-	"a5",    8.27,   "a6",    5.83,   "a7",    4.13,   "a8",    2.91,
-	"a9",    2.05,   "a10",   1.46,   "b0",   56.67,   "b1",   39.37,
-	"b2",   27.83,   "b3",   19.68,   "b4",   13.90,   "b5",    9.84,
-	"b6",    6.93,   "b7",    4.92,   "b8",    3.46,   "b9",    2.44,
-	"b10",   1.73,   "c0",   51.20,   "c1",   36.00,   "c2",   25.60,
-	"c3",   18.00,   "c4",   12.80,   "c5",    9.00,   "c6",    6.40,
-	"c7",    4.50,   "m1",   72.00,   "m2",   84.00,   "m3",   96.00,
-	"m4",   72.00,   "m5",   84.00,   "m6",   96.00);
-%page_anot_font = (
-	"a",     8,   "b",    12,   "c",    16,   "d",    24,
-	"e",    24,   "f",    24,   "e1",   24,   "a0",   24,
-	"a1",   24,   "a2",   16,   "a3",   12,   "a4",    8,
-	"a5",    6,   "a6",    6,   "a7",    6,   "a8",    4,
-	"a9",    4,   "a10",   4,   "b0",   24,   "b1",   24,
-	"b2",   16,   "b3",   16,   "b4",   12,   "b5",    8,
-	"b6",    6,   "b7",    4,   "b8",    4,   "b9",    4,
-	"b10",   4,   "c0",   24,   "c1",   24,   "c2",   16,
-	"c3",   12,   "c4",    8,   "c5",    6,   "c6",    6,
-	"c7",    6,   "m1",   24,   "m2",   24,   "m3",   24,
-	"m4",   24,   "m5",   24,   "m6",   24);
-%page_header_font =(
-	"a",    10,   "b",    15,   "c",    20,   "d",    30,
-	"e",    30,   "f",    30,   "e1",   30,   "a0",   30,
-	"a1",   30,   "a2",   20,   "a3",   15,   "a4",   10,
-	"a5",    8,   "a6",    8,   "a7",    8,   "a8",    5,
-	"a9",    5,   "a10",   5,   "b0",   30,   "b1",   30,
-	"b2",   20,   "b3",   20,   "b4",   15,   "b5",   10,
-	"b6",    8,   "b7",    5,   "b8",    5,   "b9",    5,
-	"b10",   5,   "c0",   30,   "c1",   30,   "c2",   20,
-	"c3",   15,   "c4",   10,   "c5",    8,   "c6",    8,
-	"c7",    8,   "m1",   30,   "m2",   30,   "m3",   30,
-	"m4",   30,   "m5",   30,   "m6",   30);
-%page_gmt_name =     (
-	"a",     "archA",   "b",     "archB",   "c",     "archC",   "d",     "archD",
-	"e",     "archE",   "f",     "B0",      "e1",    "B0",      "a0",    "A0",
-	"a1",    "A1",      "a2",    "A2",      "a3",    "A3",      "a4",    "A4",
-	"a5",    "A5",      "a6",    "A6",      "a7",    "A7",      "a8",    "A8",
-	"a9",    "A9",      "a10",   "A10",     "b0",    "B0",      "b1",    "B1",
-	"b2",    "B2",      "b3",    "B3",      "b4",    "B4",      "b5",    "B5",
-	"b6",    "A6",      "b7",    "A7",      "b8",    "A8",      "b9",    "A9",
-	"b10",   "A10",     "c0",    "B0",      "c1",    "B1",      "c2",    "B2",
-	"c3",    "B3",      "c4",    "B4",      "c5",    "B5",      "c6",    "B6",
-	"c7",    "B7",      "m1", "Custom_4241x5655",    "m2",   "Custom_4241x6578",
-	"m3",   "Custom_4241x7540",  "m4",   "Custom_4712x5655",
-	"m5",   "Custom_4712x6578",  "m6",   "Custom_4712x7540");
-%xpsview_mem =     (
-	"a",     "4m",   "b",     "6m",   "c",     "8m",   "d",    "12m",
-	"e",    "16m",   "f",    "16m",   "e1",   "16m",   "a0",   "16m",
-	"a1",   "12m",   "a2",    "8m",   "a3",    "6m",   "a4",    "4m",
-	"a5",    "4m",   "a6",    "4m",   "a7",    "4m",   "a8",    "4m",
-	"a9",    "4m",   "a10",   "4m",   "b0",   "16m",   "b1",   "12m",
-	"b2",    "8m",   "b3",    "8m",   "b4",    "6m",   "b5",    "4m",
-	"b6",    "4m",   "b7",    "4m",   "b8",    "4m",   "b9",    "4m",
-	"b10",   "4m",   "c0",   "16m",   "c1",   "12m",   "c2",    "8m",
-	"c3",    "6m",   "c4",    "4m",   "c5",    "4m",   "c6",    "4m",
-	"c7",    "4m",   "m1",   "16m",   "m2",   "16m",   "m3",   "16m",
-	"m4",   "16m",   "m5",   "16m",   "m6",   "16m");
-
-# set default number of colors
-$ncpt = 11;
-
-# define color pallettes
-
- at color_pallette_names = (   "Haxby Colors",
-			    "High Intensity Colors",
-			    "Low Intensity Colors",
-			    "Grayscale",
-			    "Uniform Gray",
-			    "Uniform Black",
-			    "Uniform White");
-
-# original Haxby color pallette
-#	$ncolors = 15;
-#	@cptbr = (255, 255, 255, 255, 255, 240, 205, 138, 106,  87,  50,   0,  40,  21,  37);
-#	@cptbg = (255, 221, 186, 161, 189, 236, 255, 236, 235, 215, 190, 160, 127,  92,  57);
-#	@cptbb = (255, 171, 133,  68,  87, 121, 162, 174, 255, 255, 255, 255, 251, 236, 175);
-#                 use       use  use  use  use  use  use  use       use       use       use
-
-# color pallette 1 - Haxby Color Table
-	@cptbr1 = (255, 255, 255, 255, 240, 205, 138, 106,  50,  40,  37);
-	@cptbg1 = (255, 186, 161, 189, 236, 255, 236, 235, 190, 127,  57);
-	@cptbb1 = (255, 133,  68,  87, 121, 162, 174, 255, 255, 251, 175);
-
-# color pallette 2 - High Intensity Colors
-	@cptbr2 = (255, 255, 255, 255, 128,   0,   0,   0,   0, 128, 255);
-	@cptbg2 = (  0,  64, 128, 255, 255, 255, 255, 128,   0,   0,   0);
-	@cptbb2 = (  0,   0,   0,   0,   0,   0, 255, 255, 255, 255, 255);
-
-# color pallette 3 - Low Intensity Colors
-	@cptbr3 = (200, 194, 179, 141,  90,   0,   0,   0,   0,  90, 141);
-	@cptbg3 = (  0,  49,  90, 141, 179, 200, 141,  90,   0,   0,   0);
-	@cptbb3 = (  0,   0,   0,   0,   0,   0, 141, 179, 200, 179, 141);
-
-# color pallette 4 - Grayscale
-	@cptbr4 = (255, 230, 204, 179, 153, 128, 102,  77,  51,  26,   0);
-	@cptbg4 = (255, 230, 204, 179, 153, 128, 102,  77,  51,  26,   0);
-	@cptbb4 = (255, 230, 204, 179, 153, 128, 102,  77,  51,  26,   0);
-
-# color pallette 5 - Uniform Grayscale
-	@cptbr5 = (128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128);
-	@cptbg5 = (128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128);
-	@cptbb5 = (128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128);
-
-# color pallette 6 - Uniform Black
-	@cptbr6 = (  0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0);
-	@cptbg6 = (  0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0);
-	@cptbb6 = (  0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0);
-
-# color pallette 7 - Uniform White
-	@cptbr7 = (255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255);
-	@cptbg7 = (255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255);
-	@cptbb7 = (255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255);
-
-# Determine the GMT version
- at grdinfo = `grdinfo 2>&1`;
-while (@grdinfo)
-	{
-	$line = shift @grdinfo;
-	if ($line =~
-		/^grdinfo\s+(\S+)\s+\S+/)
-		{
-		($gmt_version) = $line =~
-			/^grdinfo\s+(\S+)\s+\S+/;
-		}
-	}
-
-# Deal with command line arguments
-$command_line = "@ARGV";
-&MBGetopts('A:a:B:b:C%c%D%d%F:f:G%g%HhI:i:J:j:L:l:M+m+N%n%O:o:P:p:QqR:r:S%s%TtU:u:VvW:w:XxYyZ:z:');
-$shade_control = 	($opt_A || $opt_a);
-$tick_info = 		($opt_B || $opt_b);
-$contour_mode = 	($flg_C || $flg_c);
-$contour_control = 	($opt_C || $opt_c);
-$color_flip_mode = 	($flg_D || $flg_d);
-$color_flip_control = 	($opt_D || $opt_d);
-$format = 		($opt_F || $opt_f);
-$color_mode =   	($opt_G || $opt_g || $flg_G || $flg_g);
-$help =    		($opt_H || $opt_h);
-$file_data =    	($opt_I || $opt_i);
-$map_scale =    	($opt_J || $opt_j);
-$labels =    		($opt_L || $opt_l);
-$misc = 		($opt_M || $opt_m);
-$navigation_mode = 	($flg_N || $flg_n);
-$navigation_control = 	($opt_N || $opt_n);
-$root =    		($opt_O || $opt_o);
-$pagesize = 		($opt_P || $opt_p);
-$no_view_ps = 		($opt_Q || $opt_q);
-$bounds = 		($opt_R || $opt_r);
-$stretch_mode = 	($flg_S || $flg_s);
-$stretch_control = 	($opt_S || $opt_s);
-$coast_control = 	($opt_T || $opt_t);
-$orientation = 		($opt_U || $opt_u);
-$verbose = 		($opt_V || $opt_v);
-$color_control = 	($opt_W || $opt_w);
-$execute = 		($opt_X || $opt_x);
-$no_nice_color_int = 	($opt_Y || $opt_y);
-$zbounds = 		($opt_Z || $opt_z);
-
-# print out help message if required
-if ($help)
-	{
-	print "\n$program_name:\n";
-	print "\nVersion: $Id: mbm_plot 2234 2015-03-05 07:41:54Z caress $\n";
-	print "\nMacro to generate a shellscript of MB-System and GMT commands \n";
-	print "which, when executed, will generate a Postscript plot of the \n";
-	print "specified swath sonar data. The plot may include bathymetry color \n";
-	print "fill (-G1), bathymetry color shaded relief (-G2), bathymetry \n";
-	print "shaded with amplitudes (-G3), greyshade fill amplitude (-G4), \n";
-	print "greyshade fill sidescan (-G5), contoured bathymetry (-C), or\n";
-	print "annotated navigation. The plot may also include navigation tracks,\n";
-	print "text labels and xy data in lines or symbols. Five different color \n";
-	print "schemes are included. The plot will be scaled to fit on \n";
-	print "the specified page size or, if the scale is user defined, \n";
-	print "the page size will be chosen in accordance with the plot \n";
-	print "size. The primary purpose of this macro is to allow the \n";
-	print "simple, semi-automated production of nice looking maps with \n";
-	print "a few command line arguments. For users seeking more control \n";
-	print "over the plot appearance, a number of additional optional \n";
-	print "arguments are provided. Truly ambitious users may edit the \n";
-	print "plot shellscript to take advantage of MB-System and GMT \n";
-	print "capabilites not supported by this macro.\n";
-	print "\nBasic Usage: \n";
-	print "\t$program_name -Fformat -Ifile [-Amagnitude[/azimuth | zero_level]\n";
-	print "\t\t-C[cont_int/col_int/tic_int/lab_int/tic_len/lab_hgt]\n";
-	print "\t\t-Gcolor_mode[F] -H\n";
-	print "\t\t-N[time_tick/time_annot/date_annot/time_tick_len[/name_hgt[/name_perp]] | F | FP]\n";
-	print "\t\t-Oroot -Ppagesize -S[color/shade] -T -Uorientation -V \n";
-	print "\t\t-Wcolor_style[/pallette] ]\n";
-	print "Additional Options:\n";
-	print "\t\t[-Btickinfo -Dflipcolor/flipshade\n";
-	print "\t\t-Jprojection[/scale | width] -Ltitle[:scale_label] \n";
-	print "\t\t-Mmisc -Q -Rw/e/s/n -X -Y -Zmin/max\]\n";
-	print "Miscellaneous Options:\n";
-	print "\t\t[-MGDgmtdef/value -MGFscale_loc\n";
-	print "\t\t-MGL[f][x]lon0/lat0/slat/length[m]\n";
-	print "\t\t-MGTx/y/size/angle/font/just/text\n";
-	print "\t\t-MGQdpi -MGU[/dx/dy/][label]\n";
-	print "\t\t-MMAfactor/mode/depth -MMByr/mo/da/hr/mn/sc\n";
-	print "\t\t-MMDmode/scale[/min/max] -MMEyr/mo/da/hr/mn/sc\n";
-	print "\t\t-MMLlonflip -MMNnplot -MMPpings -MMSspeedmin\n";
-	print "\t\t-MMTtimegap -MMZalgorithm\n";
-	print "\t\t-MNA[name_hgt[/P] | P]\n";
-	print "\t\t-MNP[pingnumber_tick/pingnumber_annot/pingnumber_tick_len]\n";
-	print "\t\t-MTCfill -MTDresolution -MTGfill -MTIriver[/pen]\n";
-	print "\t\t-MTNborder[/pen] -MTSfill -MTWpen\n";
-	print "\t\t-MXGfill -MXIxy_file -MXM -MXSsymbol/size -MXWpen]\n";
-	exit 0;
-	}
-
-# check for input file
-if (!$file_data)
-	{
-	$file_data = "datalist.mb-1";
-	if (! -e $file_data)
-		{
-		print "\a";
-		die "No input file specified and default $file_data cannot be opened...\n$program_name aborted\n";
-		}
-	}
-elsif (! -e $file_data)
-	{
-	print "\a";
-	die "Specified input file $file_data cannot be opened...\n$program_name aborted\n";
-	}
-
-# tell the world we got started
-if ($verbose)
-	{
-	print "\nRunning $program_name...\n";
-	}
-
-# parse color mode
-if ($color_mode)
-	{
-	if ($color_mode =~ /^\Sf/)
-		{
-		($color_mode) = $color_mode =~/^(\S)f/;
-		$use_filtered_data = 1;
-print "Filtering turned on: color_mode:$color_mode\n";
-		}
-	elsif ($color_mode =~ /^\SF/)
-		{
-		($color_mode) = $color_mode =~/^(\S)F/;
-		$use_filtered_data = 1;
-print "Filtering turned on: color_mode:$color_mode\n";
-		}
-	}
-
-# set up user defined geographic limits
-if ($bounds =~ /^\S+\/\S+\/\S+\/\S+$/)
-       	{
-       	($xmin_raw,$xmax_raw,$ymin_raw,$ymax_raw) = $bounds =~
-       		/(\S+)\/(\S+)\/(\S+)\/(\S+)/;
-       	$xmin = &GetDecimalDegrees($xmin_raw);
-       	$xmax = &GetDecimalDegrees($xmax_raw);
-       	$ymin = &GetDecimalDegrees($ymin_raw);
-       	$ymax = &GetDecimalDegrees($ymax_raw);
-       	}
-
-# parse misc commands
-if ($misc)
-	{
-	@misc_cmd = split(/:/, $misc);
-	foreach $cmd (@misc_cmd) {
-
-		# deal with general options
-		##############################
-
-		# set GMT default values
-		if ($cmd =~ /^[Gg][Dd]./)
-			{
-			($gmt_def) = $cmd =~
-				/^[Gg][Dd](\S+)/;
-			push(@gmt_defs, $gmt_def);
-			}
-
-		# set color scale location
-		if ($cmd =~ /^[Gg][Ff]./)
-			{
-			($scale_loc) = $cmd =~
-				/^[Gg][Ff](\S+)/;
-			}
-
-		# set map scale
-		if ($cmd =~ /^[Gg][Ll]./)
-			{
-			($length_scale) = $cmd =~
-				/^[Gg][Ll](\S+)/;
-			}
-
-		# set dpi for color image output
-		if ($cmd =~ /^[Gg][Qq]./)
-			{
-			($dpi) = $cmd =~ /^[Gg][Qq](.+)/;
-			}
-
-		# set text labels
-		if ($cmd =~ /^[Gg][Tt]./)
-			{
-			($tx, $ty, $tsize, $tangle, $font, $just, $txt)
-			    = $cmd
-			    =~ /^[Gg][Tt](\S+)\/(\S+)\/(\S+)\/(\S+)\/(\S+)\/(\S+)\/(.+)/;
-			if ($txt)
-			    {
-			    ($text_info) = $cmd =~
-				/^[Gg][Tt](.*)/;
-			    push(@text, $text_info);
-			    }
-			else
-			    {
-			    print "\nInvalid text label ignored: $cmd\n";
-			    }
-			}
-
-		# set unix time stamp
-		if ($cmd =~ /^[Gg][Uu]./)
-			{
-			($unix_stamp) = $cmd =~ /^[Gg][Uu](\S+)/;
-			$unix_stamp_on = 1;
-			}
-		elsif ($cmd =~ /^[Gg][Uu]/)
-			{
-			$unix_stamp_on = 1;
-			}
-
-		# deal with MB-System options
-		##############################
-
-		# set beam footprint parameters
-		if ($cmd =~ /^[Mm][Aa]./)
-			{
-			($swath_footprint) = $cmd =~ /^[Mm][Aa](.+)/;
-			}
-
-		# set begin time for acceptable swath sonar data
-		if ($cmd =~ /^[Mm][Bb]./)
-			{
-			($mb_btime) = $cmd =~ /^[Mm][Bb](.+)/;
-			}
-
-		# set swath sonar data scaling parameters
-		if ($cmd =~ /^[Mm][Dd]./)
-			{
-			($swath_scale) = $cmd =~ /^[Mm][Dd](.+)/;
-			}
-
-		# set end time for acceptable swath sonar data
-		if ($cmd =~ /^[Mm][Ee]./)
-			{
-			($mb_etime) = $cmd =~ /^[Mm][Ee](.+)/;
-			}
-
-		# set number of pings to be contoured at a time
-		if ($cmd =~ /^[Mm][Nn]./)
-			{
-			($contour_nplot) = $cmd =~ /^[Mm][Nn](.+)/;
-			}
-
-		# set lonflip
-		if ($cmd =~ /^[Mm][Ll]./)
-			{
-			($lonflip) = $cmd =~ /^[Mm][Ll](.+)/;
-			}
-
-		# set minimum ship speed
-		if ($cmd =~ /^[Mm][Ss]./)
-			{
-			($mb_speedmin) = $cmd =~ /^[Mm][Ss](.+)/;
-			}
-
-		# set time gap threshold
-		if ($cmd =~ /^[Mm][Tt]./)
-			{
-			($mb_timegap) = $cmd =~ /^[Mm][Tt](.+)/;
-			}
-
-		# set contour algorithm
-		if ($cmd =~ /^[Mm][Zz]./)
-			{
-			($contour_algorithm) = $cmd =~ /^[Mm][Zz](.+)/;
-			}
-
-		# deal with MB-System navigation annotation options
-		##############################
-
-		# set filename annotation
-		if ($cmd =~ /^[Nn][Aa]\S+\/P/)
-			{
-			($nav_name_hgt) = $cmd =~ /^[Nn][Aa](\S+)\/P/;
-			$name_mode = 1;
-			$name_perp = 1;
-			}
-		elsif ($cmd =~ /^[Nn][Aa]P/)
-			{
-			$name_mode = 1;
-			$name_perp = 1;
-			$nav_name_hgt = 0.15;
-			}
-		elsif ($cmd =~ /^[Nn][Aa]\S+/)
-			{
-			($nav_name_hgt) = $cmd =~ /^[Nn][Aa](\S+)/;
-			$name_mode = 1;
-			$name_perp = 0;
-			}
-		elsif ($cmd =~ /^[Nn][Aa]/)
-			{
-			$name_mode = 1;
-			$name_perp = 0;
-			$nav_name_hgt = 0.15;
-			}
-
-		# set pingnumber annotation
-		if ($cmd =~ /^[Nn][Pp]./)
-			{
-			($pingnumber_control) = $cmd =~ /^[Nn][Pp](.+)/;
-			$pingnumber_mode = 1;
-			if ($pingnumber_control =~ /\S+\/\S+\/\S+/)
-				{
-				($pingnumber_tick, $pingnumber_annot, $pingnumber_tick_len)
-						= $pingnumber_control =~  /(\S+)\/(\S+)\/(\S+)/;
-				}
-			elsif ($pingnumber_control =~ /\S+\/\S+/)
-				{
-				($pingnumber_tick, $pingnumber_annot)
-						= $pingnumber_control =~  /(\S+)\/(\S+)/;
-				$pingnumber_tick_len = 0.10;
-				}
-			elsif ($pingnumber_control =~ /\S+/)
-				{
-				($pingnumber_tick) = $pingnumber_control =~  /(\S+)/;
-				$pingnumber_tick_len = 0.10;
-				$pingnumber_annot = 100;
-				}
-			}
-		elsif ($cmd =~ /^[Nn][Pp]/)
-			{
-			$pingnumber_mode = 1;
-			$pingnumber_tick_len = 0.10;
-			$pingnumber_annot = 100;
-			$pingnumber_tick = 50;
-			}
-
-		# deal with pscoast options
-		##############################
-
-
-		# set pscoast lake fill
-		if ($cmd =~ /^[Tt][Cc]./)
-			{
-			($coast_lakefill) = $cmd =~ /^[Tt][Cc](.+)/;
-			$coast_control = 1;
-			}
-
-		# set pscoast resolution
-		if ($cmd =~ /^[Tt][Dd]./)
-			{
-			($coast_resolution) = $cmd =~ /^[Tt][Dd](.+)/;
-			}
-
-		# set pscoast dry fill
-		if ($cmd =~ /^[Tt][Gg]./)
-			{
-			($coast_dryfill) = $cmd =~ /^[Tt][Gg](.+)/;
-			$coast_control = 1;
-			}
-
-		# set pscoast rivers
-		if ($cmd =~ /^[Tt][Ii]./)
-			{
-			($coast_river) = $cmd =~ /^[Tt][Ii](.+)/;
-			$coast_control = 1;
-			}
-
-		# set pscoast national boundaries
-		if ($cmd =~ /^[Tt][Nn]./)
-			{
-			($coast_boundary) = $cmd =~ /^[Tt][Nn](.+)/;
-			push(@coast_boundaries, $coast_boundary);
-			$coast_control = 1;
-			}
-
-		# set pscoast wet fill
-		if ($cmd =~ /^[Tt][Ss]./)
-			{
-			($coast_wetfill) = $cmd =~ /^[Tt][Ss](.+)/;
-			$coast_control = 1;
-			}
-
-		# set pscoast coastline pen
-		if ($cmd =~ /^[Tt][Ww]./)
-			{
-			($coast_pen) = $cmd =~ /^[Tt][Ww](.+)/;
-			$coast_control = 1;
-			}
-
-		# deal with psxy options
-		##############################
-
-		# set xy symbol fill
-		if ($cmd =~ /^[Xx][Gg]./)
-			{
-			($xyfill) = $cmd =~ /^[Xx][Gg](.+)/;
-			}
-
-		# set xy data to be plotted
-		if ($cmd =~ /^[Xx][Ii]./)
-			{
-			($xyfile) = $cmd =~ /^[Xx][Ii](.+)/;
-			push(@xyfiles, $xyfile);
-			if (!$xysymbol)
-				{
-				$xysymbol = "N";
-				}
-			if (!$xyfill)
-				{
-				$xyfill = "N";
-				}
-			if (!$xysegment)
-				{
-				$xysegment = "N";
-				}
-			if (!$xypen)
-				{
-				$xypen = "N";
-				}
-			push(@xysymbols, $xysymbol);
-			push(@xyfills, $xyfill);
-			push(@xysegments, $xysegment);
-			push(@xypens, $xypen);
-			}
-
-		# set xy segment
-		if ($cmd =~ /^[Xx][Mm]/)
-			{
-			if (!$xysegment)
-				{
-				$xysegment = "Y";
-				}
-			elsif ($xysegment ne "N")
-				{
-				$xysegment = "N";
-				}
-			else
-				{
-				$xysegment = "Y";
-				}
-			}
-
-		# set xy symbol
-		if ($cmd =~ /^[Xx][Ss]./)
-			{
-			($xysymbol) = $cmd =~ /^[Xx][Ss](.+)/;
-			}
-
-		# set xy pen
-		if ($cmd =~ /^[Xx][Ww]./)
-			{
-			($xypen) = $cmd =~ /^[Xx][Ww](.+)/;
-			}
-		}
-	}
-
-# set root name if needed
-if (!$root)
-	{
-	$root = $file_data;
-	}
-
-# get format if needed
-if (!$format)
-	{
-	$line = `mbformat -I $file_data -L`;
-	($format) = $line =~ /(\S+)/;
-	if ($format == 0)
-		{
-		$format = -1;
-		}
-	}
-
-# set plot mode if needed
-if (!$color_mode && !$contour_mode && !$navigation_mode)
-	{
-	$navigation_mode = 1;
-	}
-if ($shade_control && $color_mode == 3)
-	{
-	($magnitude, $zero_level) = $shade_control =~ /^(\S+)\/(\S+)/;
-	}
-elsif ($shade_control)
-	{
-	($magnitude, $azimuth) = $shade_control =~ /^(\S+)\/(\S+)/;
-	}
-if ($color_control)
-	{
-	if (-e $color_control)
-		{
-		$file_cpt = $color_control;
-		}
-	elsif ($color_control =~ /\S+\/\S+\/\S+/)
-		{
-		($color_style, $color_pallette, $ncolors)
-			= $color_control =~  /(\S+)\/(\S+)\/(\S+)/;
-		if ($color_pallette < 1
-			|| $color_pallette > 7)
-			{
-			$color_pallette = 1;
-			}
-		if ($ncolors < 2)
-			{
-			$ncolors = 2;
-			}
-		}
-	elsif ($color_control =~ /\S+\/\S+/)
-		{
-		($color_style, $color_pallette) = $color_control
-			=~  /(\S+)\/(\S+)/;
-		if ($color_pallette < 1
-			|| $color_pallette > 7)
-			{
-			$color_pallette = 1;
-			}
-		$ncolors = $ncpt;
-		}
-	else
-		{
-		$color_style = $color_control;
-		$color_pallette = 1;
-		$ncolors = $ncpt;
-		}
-	}
-else
-	{
-	$color_style = 1;
-	$ncolors = $ncpt;
-	if ($color_mode == 4 || $color_mode == 5)
-		{
-		$color_pallette = 4;
-		}
-	else
-		{
-		$color_pallette = 1;
-		}
-	}
-if ($navigation_control && $navigation_control =~ /\S+\/\S+\/\S+\/\S+/)
-	{
-	$navigation_mode = 1;
-	}
-elsif ($navigation_control && ($navigation_control =~ /FP/
-				|| $navigation_control =~ /fp/))
-	{
-	$navigation_mode = 1;
-	$name_mode = 1;
-	$name_perp = 1;
-	$navigation_control = "0.25/1/4/0.15";
-	$nav_name_hgt = "0.15";
-	}
-elsif ($navigation_control && ($navigation_control =~ /F/
-				|| $navigation_control =~ /f/))
-	{
-	$navigation_mode = 1;
-	$name_mode = 1;
-	$name_perp = 0;
-	$navigation_control = "0.25/1/4/0.15";
-	$nav_name_hgt = "0.15";
-	}
-elsif ($navigation_control)
-	{
-	if ($navigation_control =~ /\S+\/\S+\/\S+\/\S+\/\S+\/\S+/)
-		{
-		$navigation_mode = 1;
-		$name_mode = 1;
-		($nav_time_tick, $nav_time_annot,
-				$nav_date_annot, $nav_tick_size, $nav_name_hgt, $name_perp)
-				= $navigation_control =~  /(\S+)\/(\S+)\/(\S+)\/(\S+)\/(\S+)/;
-		}
-	elsif ($navigation_control =~ /\S+\/\S+\/\S+\/\S+\/\S+/)
-		{
-		$navigation_mode = 1;
-		$name_mode = 1;
-		$name_perp = 0;
-		($nav_time_tick, $nav_time_annot,
-				$nav_date_annot, $nav_tick_size, $nav_name_hgt)
-				= $navigation_control =~  /(\S+)\/(\S+)\/(\S+)\/(\S+)\/(\S+)/;
-		}
-	elsif ($navigation_control =~ /\S+\/\S+\/\S+/)
-		{
-		($nav_time_tick, $nav_time_annot,
-			$nav_date_annot)
-			= $navigation_control =~  /(\S+)\/(\S+)\/(\S+)/;
-		$nav_tick_size = 0.15;
-		}
-	elsif ($navigation_control =~ /\S+\/\S+/)
-		{
-		($nav_time_tick, $nav_time_annot)
-			= $navigation_control =~  /(\S+)\/(\S+)/;
-		$nav_date_annot = 100000;
-		$nav_tick_size = 0.15;
-		}
-	else
-		{
-		$nav_time_tick = $navigation_control;
-		$nav_time_annot = 100000;
-		$nav_date_annot = 100000;
-		$nav_tick_size = 0.15;
-		}
-	$navigation_mode = 1;
-	$navigation_control = "$nav_time_tick"
-			. "/" . "$nav_time_annot"
-			. "/" . "$nav_date_annot"
-			. "/" . "$nav_tick_size";
-	}
-elsif ($navigation_mode)
-	{
-	$navigation_control = "100000/100000/100000/0.15";
-	}
-if ($pingnumber_mode)
-	{
-	$pingnumber_control = "$pingnumber_tick"
-			. "/" . "$pingnumber_annot"
-			. "/" . "$pingnumber_tick_len";
-	}
-if ($color_flip_control)
-	{
-	if ($color_flip_control =~ /^\S+\/\S+/)
-		{
-		($color_flip, $shade_flip) = $color_flip_control
-			=~ /^(\S+)\/(\S+)/;
-		}
-	elsif ($color_flip_control =~ /^\S+/)
-		{
-		($color_flip) = $color_flip_control
-			=~ /^(\S+)/;
-		}
-	}
-elsif ($color_flip_mode)
-	{
-	$color_flip = 1;
-	}
-if ($color_mode == 2 && $shade_flip)
-	{
-	if ($azimuth > 180)
-		{
-		$azimuth = $azimuth - 180;
-		}
-	else
-		{
-		$azimuth = $azimuth + 180;
-		}
-	}
-if ($stretch_control)
-	{
-	if ($stretch_control =~ /^\S+\/\S+/)
-		{
-		($stretch_color, $stretch_shade) = $stretch_control
-			=~ /^(\S+)\/(\S+)/;
-		}
-	elsif ($stretch_control =~ /^\S+/)
-		{
-		($stretch_color) = $stretch_control
-			=~ /^(\S+)/;
-		}
-	}
-elsif ($stretch_mode)
-	{
-	$stretch_color = 1;
-	}
-
-# set page size
-if (!$pagesize)
-	{
-	$pagesize = "a";
-	}
-else
-	{
-	$pagesize =~ tr/A-Z/a-z/;
-	if (!$page_width_in{$pagesize})
-		{
-		$pagesize = "a";
-		}
-	}
-
-# use mbdefaults to get the current system default postscript viewer
-$ps_viewer = "ghostview";
-$lonflip = 0;
- at mbdefaults = `mbdefaults`;
-while (@mbdefaults)
-        {
-        $line = shift @mbdefaults;
-        if ($line =~ /ps viewer:\s+(\S+)/)
-                {
-                ($ps_viewer) = $line =~ /ps viewer:\s+(\S+)/;
-                 }
-        elsif ($line =~ /lonflip:\s+(\S+)/)
-                {
-                ($lonflip) = $line =~ /lonflip:\s+(\S+)/;
-                 }
-        }
-
-# check environment variable
-if ($ENV{"MB_PS_VIEWER"})
-	{
-	$ps_viewer = $ENV{"MB_PS_VIEWER"};
-	}
-
-# Look for mapproject
-$mapproject = `which mapproject`;
-if (! $mapproject) {
-    print "\n*** ERROR ***\n";
-    print "The GMT command 'mapproject' is not in your path.\n";
-    print "Check your settings for the PATH environment variable.\n";
-    print "in your .bash_profile, .cshrc, or other appropriate file for your shell.\n";
-    print "\n";
-    exit 0;
-}
-
-# get limits of file using mbinfo
-if ($bounds)
-	{
-	$bounds_info = "-R$bounds";
-	}
-else
-	{
-	$bounds_info = " ";
-	}
-if ($format >= 0)
-	{
-	push(@files_data, $file_data);
-	push(@formats, $format);
-	}
-else
-	{
-	# we used to use this perl function
-	# 	MBparsedatalist($file_data);
-	# but now we use the program mbdatalist
-	@mbdatalist = `mbdatalist -F-1 -I$file_data $bounds_info`;
-	while (@mbdatalist)
-		{
-		$line = shift @mbdatalist;
-		if ($line =~ /(\S+)\s+(\S+)/)
-			{
-			($file_mb,$format_mb) =
-				$line =~ /(\S+)\s+(\S+)/;
-			push(@files_data, $file_mb);
-			push(@formats, $format_mb);
-			}
-		}
-	}
-$cnt = 0;
-foreach $file_mb (@files_data)
-	{
-	# use .inf file if it exists and no time or space bounds applied
-	@mbinfo = 0;
-	$use_inf = 0;
-	$file_inf = $file_mb . ".inf";
-	if (-r $file_inf && !$mb_btime && !$mb_etime)
-		{
-		if ($verbose)
-			{
-			print "Reading mbinfo output from file $file_inf...\n";
-			}
-		if (open(FILEINF,"<$file_inf"))
-			{
-			while ($line = <FILEINF>)
-				{
-				push(@mbinfo, $line);
-				if ($line =~ /^Number of Records:\s+(\S+)/)
-					{
-					($nrec_f) =
-						$line =~ /^Number of Records:\s+(\S+)/;
-					}
-				if ($line =~ /^Minimum Longitude:\s+(\S+)\s+Maximum Longitude:\s+(\S+)/)
-					{
-					($xmin_f,$xmax_f) =
-						$line =~ /^Minimum Longitude:\s+(\S+)\s+Maximum Longitude:\s+(\S+)/;
-					}
-				if ($line =~ /^Minimum Latitude:\s+(\S+)\s+Maximum Latitude:\s+(\S+)/)
-					{
-					($ymin_f,$ymax_f) =
-						$line =~ /^Minimum Latitude:\s+(\S+)\s+Maximum Latitude:\s+(\S+)/;
-					}
-				}
-			close FILEINF;
-
-			if (!$bounds)
-			    {
-			    $use_inf = 1;
-			    }
-			elsif ($nrec_f > 0 &&
-			    $xmin_f >= $xmin && $xmin_f <= $xmax
-				&& $xmax_f >= $xmin && $xmax_f <= $xmax
-			    && $ymin_f >= $ymin && $ymin_f <= $ymax
-				&& $ymax_f >= $ymin && $ymax_f <= $ymax)
-			    {
-			    $use_inf = 1;
-			    }
-			elsif ($nrec_f > 0 &&
-			    $xmax_f < $xmin || $xmin_f > $xmax
-			    || $ymin_f <= $ymin || $ymin_f > $ymax)
-			    {
-			    $use_inf = 1;
-			    }
-			elsif ($nrec_f > 0 &&
-			    ($xmin_f < $xmin
-				|| $xmax_f > $xmax
-				|| $ymin_f < $ymin
-				|| $ymax_f > $ymax)
-			    && $color_mode)
-			    {
-			    $use_inf = 0;
-			    }
-			elsif ($nrec_f > 0)
-			    {
-			    $use_inf = 1;
-			    }
-			}
-		}
-
-	# if .inf file not accessible or suitable run mbinfo directly
-	if (!$use_inf)
-		{
-		if ($verbose)
-			{
-			print "Running mbinfo on file $file_mb...\n";
-			}
-		if ($mb_btime)
-			{
-			$time_info = "-B$mb_btime";
-			}
-		if ($mb_etime)
-			{
-			$time_info = $time_info . " -E$mb_etime";
-			}
-		@mbinfo = `mbinfo -F$formats[$cnt] -I$file_mb $time_info $bounds_info -G`;
-		}
-
-	# now parse the mbinfo input
-	$nrec_f = 0;
-	while (@mbinfo)
-		{
-		$line = shift @mbinfo;
-		if ($line =~ /^Number of Records:\s+(\S+)/)
-			{
-			($nrec_f) =
-				$line =~ /^Number of Records:\s+(\S+)/;
-			}
-		if ($line =~ /^Minimum Longitude:\s+(\S+)\s+Maximum Longitude:\s+(\S+)/)
-			{
-			($xmin_f,$xmax_f) =
-				$line =~ /^Minimum Longitude:\s+(\S+)\s+Maximum Longitude:\s+(\S+)/;
-			}
-		if ($line =~ /^Minimum Latitude:\s+(\S+)\s+Maximum Latitude:\s+(\S+)/)
-			{
-			($ymin_f,$ymax_f) =
-				$line =~ /^Minimum Latitude:\s+(\S+)\s+Maximum Latitude:\s+(\S+)/;
-			}
-		if ($line =~ /^Minimum Depth:\s+(\S+)\s+Maximum Depth:\s+(\S+)/)
-			{
-			($zmin_f,$zmax_f) =
-			$line =~ /^Minimum Depth:\s+(\S+)\s+Maximum Depth:\s+(\S+)/;
-			}
-		if ($line =~ /^Minimum Amplitude:\s+(\S+)\s+Maximum Amplitude:\s+(\S+)/)
-			{
-			($amin_f,$amax_f) =
-			$line =~ /^Minimum Amplitude:\s+(\S+)\s+Maximum Amplitude:\s+(\S+)/;
-			}
-		if ($line =~ /^Minimum Sidescan:\s+(\S+)\s+Maximum Sidescan:\s+(\S+)/)
-			{
-			($smin_f,$smax_f) =
-			$line =~ /^Minimum Sidescan:\s+(\S+)\s+Maximum Sidescan:\s+(\S+)/;
-			}
-		}
-
-	# reset longitude min max if they conflict with $lonflip
-	if ($lonflip == 0
-		&& (($xmin_f < -180.0 && $xmax_f > -180.0)
-			|| ($xmin_f < 180.0 && $xmax_f > 180.0)))
-		{
-		$xmin_f = -180.0;
-		$xmax_f = 180.0;
-		}
-	elsif ($lonflip == 0
-		&& $xmin_f < -180.0)
-		{
-		$xmin_f = $xmin_f + 360.0;
-		$xmax_f = $xmax_f + 360.0;
-		}
-	elsif ($lonflip == 0
-		&& $xmax_f > 180.0)
-		{
-		$xmin_f = $xmin_f - 360.0;
-		$xmax_f = $xmax_f - 360.0;
-		}
-	elsif ($lonflip == -1
-		&& $xmin_f < 0.0 && $xmax_f > 0.0)
-		{
-		$xmin_f = -360.0;
-		$xmax_f = 0.0;
-		}
-	elsif ($lonflip == -1
-		&& $xmax_f > 0.0)
-		{
-		$xmin_f = $xmin_f - 360.0;
-		$xmax_f = $xmax_f - 360.0;
-		}
-	elsif ($lonflip == 1
-		&& $xmin_f < 0.0 && $xmax_f > 0.0)
-		{
-		$xmin_f = 0.0;
-		$xmax_f = 360.0;
-		}
-	elsif ($lonflip == 1
-		&& $xmin_f < 0.0)
-		{
-		$xmin_f = $xmin_f + 360.0;
-		$xmax_f = $xmax_f + 360.0;
-		}
-
-	if (!$first_mb && $nrec_f > 0)
-		{
-		$first_mb = 1;
-		$xmin_data = $xmin_f;
-		$xmax_data = $xmax_f;
-		$ymin_data = $ymin_f;
-		$ymax_data = $ymax_f;
-		$zmin_data = $zmin_f;
-		$zmax_data = $zmax_f;
-		$amin_data = $amin_f;
-		$amax_data = $amax_f;
-		$smin_data = $smin_f;
-		$smax_data = $smax_f;
-		}
-	elsif ($nrec_f > 0)
-		{
-		$xmin_data = &min($xmin_data, $xmin_f);
-		$xmax_data = &max($xmax_data, $xmax_f);
-		$ymin_data = &min($ymin_data, $ymin_f);
-		$ymax_data = &max($ymax_data, $ymax_f);
-		$zmin_data = &min($zmin_data, $zmin_f);
-		$zmax_data = &max($zmax_data, $zmax_f);
-		$amin_data = &min($amin_data, $amin_f);
-		$amax_data = &max($amax_data, $amax_f);
-		$smin_data = &min($smin_data, $smin_f);
-		$smax_data = &max($smax_data, $smax_f);
-		}
-	$cnt++;
-	}
-
-# use user defined data limits for bathymetry if supplied
-if ($zbounds)
-	{
-	if ($color_mode == 4)
-		{
-		($amin_data,$amax_data) = $zbounds =~ /(\S+)\/(\S+)/;
-		}
-	elsif ($color_mode == 5)
-		{
-		($smin_data,$smax_data) = $zbounds =~ /(\S+)\/(\S+)/;
-		}
-	else
-		{
-		($zmin,$zmax) = $zbounds =~ /(\S+)\/(\S+)/;
-		}
-	}
-else
-	{
-	$zmin = $zmin_data;
-	$zmax = $zmax_data;
-	}
-
-# check that there is data
-if ($xmin_data >= $xmax_data || $ymin_data >= $ymax_data)
-	{
-	die "$xmin_data $xmax_data $ymin_data $ymax_data \nDoes not appear to be any data in the input!\n$program_name aborted.\n";
-	}
-if (($color == 1 || $color == 2 || $color == 3) && ($zmin_data >= $zmax_data))
-	{
-	die "Does not appear to be any bathymetry data in the input!\n$program_name aborted.\n";
-	}
-if (($color == 3 || $color == 4) && ($amin_data >= $amax_data))
-	{
-	die "Does not appear to be any amplitude data in the input!\n$program_name aborted.\n";
-	}
-if (($color == 5) && ($smin_data >= $smax_data))
-	{
-	die "Does not appear to be any sidescan data in the input!\n$program_name aborted.\n";
-	}
-
-# either use user defined geographic limits
-if ($bounds)
-	{
-	if ($bounds =~ /^\S+\/\S+\/\S+\/\S+r$/)
-		{
-		($xmin_raw,$ymin_raw,$xmax_raw,$ymax_raw) = $bounds =~
-			/^(\S+)\/(\S+)\/(\S+)\/(\S+)r$/;
-		$xmin = &GetDecimalDegrees($xmin_raw);
-		$xmax = &GetDecimalDegrees($xmax_raw);
-		$ymin = &GetDecimalDegrees($ymin_raw);
-		$ymax = &GetDecimalDegrees($ymax_raw);
-		$use_corner_points = 1;
-		$bounds_plot = $bounds;
-		}
-	elsif ($bounds =~ /^\S+\/\S+\/\S+\/\S+$/)
-		{
-		($xmin_raw,$xmax_raw,$ymin_raw,$ymax_raw) = $bounds =~
-			/(\S+)\/(\S+)\/(\S+)\/(\S+)/;
-		$xmin = &GetDecimalDegrees($xmin_raw);
-		$xmax = &GetDecimalDegrees($xmax_raw);
-		$ymin = &GetDecimalDegrees($ymin_raw);
-		$ymax = &GetDecimalDegrees($ymax_raw);
-		$bounds_plot = $bounds;
-		}
-	elsif ($bounds =~ /^r$/)
-		{
-		$use_corner_points = 1;
-		$bounds_plot = sprintf ("%1.8g/%1.8g/%1.8g/%1.8gr",
-			$xmin, $ymin, $xmax, $ymax);
-		}
-	}
-
-# or expand the data limits a bit and ensure a reasonable aspect ratio
-else
-	{
-	# get first cut bounds
-	$delx = 0.05 * ($xmax_data - $xmin_data);
-	$dely = 0.05 * ($ymax_data - $ymin_data);
-	if (($xmax_data - $xmin_data) < (0.95 * 360.0))
-		{
-		$xmin = $xmin_data - $delx;
-		$xmax = $xmax_data + $delx;
-		}
-	else
-		{
-		$xmin = $xmin_data;
-		$xmax = $xmax_data;
-		}
-	$ymin = $ymin_data - $dely;
-	$ymax = $ymax_data + $dely;
-	if ($ymin < -89.0)
-		{
-		$ymin = -89.0;
-		}
-	if ($ymax > 89.0)
-		{
-		$ymax = 89.0;
-		}
-
-	# get aspect ratio in approximate real distances
-	$C1 = 111412.84;
-	$C2 = -93.5;
-	$C3 = 0.118;
-	$C4 = 111132.92;
-	$C5 = -559.82;
-	$C6 = 1.175;
-	$C7 = 0.0023;
-	$DTR = 3.14159265358979323846 / 180.0;
-	$radlat = 0.5 * ($ymax + $ymin) * $DTR;
-	$mtodeglat = 1./abs($C4 + $C5*cos(2*$radlat)
-				+ $C6*cos(4*$radlat) + $C7*cos(6*$radlat));
-	$mtodeglon = 1./abs($C1*cos($radlat) + $C2*cos(3*$radlat)
-				+ $C3*cos(5*$radlat));
-	$dx = ($xmax - $xmin) / $mtodeglon;
-	$dy = ($ymax - $ymin) / $mtodeglat;
-
-	if ($dy/$dx > 2.0)
-		{
-		$delx = (0.5 * (0.5 * $dy - $dx)) * $mtodeglon;
-		$xmin = $xmin - $delx;
-		$xmax = $xmax + $delx;
-		}
-	elsif ($dx/$dy > 2.0)
-		{
-		$dely = (0.5 * (0.5 * $dx - $dy)) * $mtodeglat;
-		$ymin = $ymin - $dely;
-		$ymax = $ymax + $dely;
-		if ($ymin < -89.0)
-			{
-			$ymin = -89.0;
-			}
-		if ($ymax > 89.0)
-			{
-			$ymax = 89.0;
-			}
-		}
-	$bounds_plot = sprintf ("%1.8g/%1.8g/%1.8g/%1.8g",
-		$xmin, $xmax, $ymin, $ymax);
-	}
-
-# set the relevent page width and height
-&GetPageSize;
-
-# get user constraints on map scale
-if ($map_scale)
-	{
-	# sets $plot_scale or $plot_width if possible
-	&GetProjection;
-	}
-
-# set up for mapproject
-if (($use_scale && $plot_scale) || ($use_width && $plot_width))
-	{
-	($projection) = $map_scale =~ /^(\w)/;
-	($projection_pars) = $map_scale =~ /^$projection(\S+)/;
-	}
-elsif ($use_scale || $use_width)
-	{
-	($projection) = $map_scale =~ /^(\w)/;
-	($projection_pars) = $map_scale =~ /^$projection(\S+)/;
-	$projection_pars = "$projection_pars" . "$separator" . "$trial_value";
-	}
-else
-	{
-	$projection = "m";
-	$projection_pars = "1.0";
-	$use_scale = 1;
-	}
-
-# now find out the apparent size of the plot
-`echo $xmin $ymin > tmp$$.dat`;
-`echo $xmax $ymin >> tmp$$.dat`;
-`echo $xmax $ymax >> tmp$$.dat`;
-`echo $xmin $ymax >> tmp$$.dat`;
- at projected = `mapproject tmp$$.dat -J$projection$projection_pars -R$bounds_plot 2>&1 `;
-`/bin/rm -f tmp$$.dat`;
-while (@projected)
-	{
-	$line = shift @projected;
-	if (!$xxmin)
-		{
-		($xxmin,$yymin) = $line =~ /(\S+)\s+(\S+)/;
-		$xxmax = $xxmin;
-		$yymax = $yymin;
-		}
-	else
-		{
-		($xx,$yy) = $line =~ /(\S+)\s+(\S+)/;
-		$xxmin = ($xx < $xxmin ? $xx : $xxmin);
-		$xxmax = ($xx > $xxmax ? $xx : $xxmax);
-		$yymin = ($yy < $yymin ? $yy : $yymin);
-		$yymax = ($yy > $yymax ? $yy : $yymax);
-		}
-	}
-$dxx = $xxmax - $xxmin;
-$dyy = $yymax - $yymin;
-
-# check for valid scaling
-if ($dxx == 0.0 && $dyy == 0.0)
-	{
-	print "\a";
-	print "ERROR!\n";
-	print "  The projection and bounds specified (or automatically determined bounds\n";
-	print "  if none were specified) have resulted in a plot with either.\n";
-	print "  zero height, zero width or both. This can happen for several reasons:\n";
-	print "  mbinfo may have failed to read and interpret the file, the PLOT_DEGREE_FORMAT\n";
-	print "  GMT variable may have too few significant digits for the size of the\n";
-	print "  plot, the GMT command mapproject may have failed for some reason or you may have\n";
-	print "  specified improper bounds. Each of these things should be checked.\n";
-	print "  The file containing the bounds in Latitude and Longitude that was passed\n";
-	print "  to mapproject held these values:\n";
-	print "\t$xmin $ymin\n";
-	print "\t$xmax $ymin\n";
-	print "\t$xmax $ymax\n";
-	print "\t$xmin $ymax\n";
-	die "$program_name aborted\n";
-	}
-
-# figure out scaling issues
-if (($use_scale && $plot_scale) || ($use_width && $plot_width))
-	{
-	$plot_width = $dxx;
-	$plot_height = $dyy;
-
-	# decide which plot orientation to use
-	if ($orientation == 1)
-		{
-		$portrait = 1;
-		$width = $page_width_in{$pagesize};
-		$height = $page_height_in{$pagesize};
-		$width_max = $width_max_portrait;
-		$height_max = $height_max_portrait;
-		}
-	elsif ($orientation == 2)
-		{
-		$landscape = 1;
-		$width = $page_height_in{$pagesize};
-		$height = $page_width_in{$pagesize};
-		$width_max = $width_max_landscape;
-		$height_max = $height_max_landscape;
-		}
-	elsif ($dxx > $dyy)
-		{
-		$landscape = 1;
-		$width = $page_height_in{$pagesize};
-		$height = $page_width_in{$pagesize};
-		$width_max = $width_max_landscape;
-		$height_max = $height_max_landscape;
-		}
-	else
-		{
-		$portrait = 1;
-		$width = $page_width_in{$pagesize};
-		$height = $page_height_in{$pagesize};
-		$width_max = $width_max_portrait;
-		$height_max = $height_max_portrait;
-		}
-
-	# check if plot fits on page
-	if ($plot_width > $width_max || $plot_height > $height_max)
-		{
-		# try to find a sufficiently large pagesize
-		$pagesize_save = $pagesize;
-		foreach $elem (@page_size_names) {
-			$pagesize = "$elem";
-			&GetPageSize;
-			if ($portrait)
-				{
-				$width_max = $width_max_portrait;
-				$height_max = $height_max_portrait;
-				}
-			else
-				{
-				$width_max = $width_max_landscape;
-				$height_max = $height_max_landscape;
-				}
-			if (!$good_page &&
-				$plot_width <= $width_max
-				&& $plot_height <= $height_max)
-				{
-				$good_page = 1;
-				$pagesize_save = $pagesize;
-				}
-			}
-
-		# print out warning
-		if ($pagesize eq $pagesize_save)
-			{
-			print "\nWarning: Unable to fit plot on any available page size!\n";
-			print "\tThis plot will not be particularly useful!\n";
-			print "\tTry using a different scale or allow the program to set the scale!\n";
-			}
-
-		# reset the page size
-		$pagesize = $pagesize_save;
-		&GetPageSize;
-		if ($portrait)
-			{
-			$width = $page_width_in{$pagesize};
-			$height = $page_height_in{$pagesize};
-			}
-		else
-			{
-			$width = $page_height_in{$pagesize};
-			$height = $page_width_in{$pagesize};
-			}
-		}
-	}
-elsif ($use_scale)
-	{
-	# get landscape and portrait scales
-	$plot_scale_landscape = $width_max_landscape/$dxx;
-	if ($plot_scale_landscape*$dyy > $height_max_landscape)
-		{
-		$plot_scale_landscape = $height_max_landscape/$dyy;
-		}
-	$plot_scale_portrait = $width_max_portrait/$dxx;
-	if ($plot_scale_portrait*$dyy > $height_max_portrait)
-		{
-		$plot_scale_portrait = $height_max_portrait/$dyy;
-		}
-
-	# decide which plot orientation to use
-	if ($orientation == 1)
-		{
-		$portrait = 1;
-		$plot_scale = $plot_scale_portrait;
-		$width = $page_width_in{$pagesize};
-		$height = $page_height_in{$pagesize};
-		}
-	elsif ($orientation == 2)
-		{
-		$landscape = 1;
-		$plot_scale = $plot_scale_landscape;
-		$width = $page_height_in{$pagesize};
-		$height = $page_width_in{$pagesize};
-		}
-	elsif ($plot_scale_landscape > $plot_scale_portrait)
-		{
-		$landscape = 1;
-		$plot_scale = $plot_scale_landscape;
-		$width = $page_height_in{$pagesize};
-		$height = $page_width_in{$pagesize};
-		}
-	else
-		{
-		$portrait = 1;
-		$plot_scale = $plot_scale_portrait;
-		$width = $page_width_in{$pagesize};
-		$height = $page_height_in{$pagesize};
-		}
-
-	# set plot width
-	$plot_width = $dxx * $plot_scale;
-	$plot_height = $dyy * $plot_scale;
-
-	# reset plot_scale if ratio required
-	if ($use_ratio)
-		{
-		$top = int(1 / $plot_scale);
-		$plot_scale = "1:" . "$top";
-		}
-
-	# construct plot scale parameters
-	($projection_pars) = $map_scale =~ /^$projection(\S+)/;
-	$projection_pars = sprintf ("$projection_pars$separator%1.5g", $plot_scale);
-
-	# handle special case for linear projections
-	if ($geographic)
-		{
-		$projection_pars = "$projection_pars" . "d";
-		}
-	}
-elsif ($use_width)
-	{
-	# get landscape and portrait heights
-	$plot_width_landscape = $height_max_landscape * $dxx / $dyy;
-	if ($plot_width_landscape > $width_max_landscape)
-		{
-		$plot_width_landscape = $width_max_landscape;
-		}
-	$plot_width_portrait = $height_max_portrait * $dxx / $dyy;
-	if ($plot_width_portrait > $width_max_portrait)
-		{
-		$plot_width_portrait = $width_max_portrait;
-		}
-
-	# decide which plot orientation to use
-	if ($orientation == 1)
-		{
-		$portrait = 1;
-		$plot_width = $plot_width_portrait;
-		$plot_height = $plot_width * $dyy / $dxx;
-		$width = $page_width_in{$pagesize};
-		$height = $page_height_in{$pagesize};
-		}
-	elsif ($orientation == 2)
-		{
-		$landscape = 1;
-		$plot_width = $plot_width_landscape;
-		$plot_height = $plot_width * $dyy / $dxx;
-		$width = $page_height_in{$pagesize};
-		$height = $page_width_in{$pagesize};
-		}
-	elsif ($plot_width_landscape > $plot_width_portrait)
-		{
-		$landscape = 1;
-		$plot_width = $plot_width_landscape;
-		$plot_height = $plot_width * $dyy / $dxx;
-		$width = $page_height_in{$pagesize};
-		$height = $page_width_in{$pagesize};
-		}
-	else
-		{
-		$portrait = 1;
-		$plot_width = $plot_width_portrait;
-		$plot_height = $plot_width * $dyy / $dxx;
-		$width = $page_width_in{$pagesize};
-		$height = $page_height_in{$pagesize};
-		}
-
-	# construct plot scale parameters
-	($projection_pars) = $map_scale =~ /^$projection(\S+)/;
-	$projection_pars = sprintf ("$projection_pars$separator%1.5g", $plot_width);
-
-	# handle special case for linear projections
-	if ($geographic)
-		{
-		$projection_pars = "$projection_pars" . "d";
-		}
-	}
-
-# place the origin so plot is more or less centered
-$xoffset = ($width - $plot_width
-	- $space_left - $space_right) / 2 + $space_left;
-$yoffset = ($height - $plot_height
-	- $space_bottom - $space_top) / 2 + $space_bottom;
-
-# get plot degree annotation for geographic maps
-$degree_format = "ddd:mm";
-if (!$gridprojected)
-	{
-	$xsize = ($xmax - $xmin) / 3;
-	$ysize = ($ymax - $ymin) / 3;
-	if ($xsize < $ysize)
-		{
-		$size = $xsize;
-		}
-	else
-		{
-		$size = $ysize;
-		}
-	if ($size > 1.0)
-		{
-		$degree_format = "ddd";
-		}
-	elsif ($size > (1.0 / 60.0))
-		{
-		$degree_format = "ddd:mm";
-		}
-	else
-		{
-		$degree_format = "ddd:mm:ss";
-		}
-	}
-
-# figure out where to place the color scale
-$scale_loc =~ tr/A-Z/a-z/;
-if ($scale_loc eq "l")
-	{
-	$colorscale_length = $plot_height;
-	$colorscale_thick = 0.013636364 * $page_height_in{$pagesize};
-	$colorscale_offx = -0.13636 * $page_height_in{$pagesize};
-	$colorscale_offy = 0.5*$plot_height;
-	$colorscale_vh = "v";
-	}
-elsif ($scale_loc eq "r")
-	{
-	$colorscale_length = $plot_height;
-	$colorscale_thick = 0.013636364 * $page_height_in{$pagesize};
-	$colorscale_offx = $plot_width
-		+ 0.0909 * $page_height_in{$pagesize};
-	$colorscale_offy = 0.5*$plot_height;
-	$colorscale_vh = "v";
-	}
-elsif ($scale_loc eq "t")
-	{
-	$colorscale_length = $plot_width;
-	$colorscale_thick = 0.013636364 * $page_height_in{$pagesize};
-	$colorscale_offx = 0.5*$plot_width;
-	$colorscale_offy = $plot_height
-		+ 0.15 * $page_height_in{$pagesize};
-	$colorscale_vh = "h";
-	}
-else
-	{
-	$colorscale_length = $plot_width;
-	$colorscale_thick = 0.013636364 * $page_height_in{$pagesize};
-	$colorscale_offx = 0.5*$plot_width;
-	$colorscale_offy = -0.045454545 * $page_height_in{$pagesize};
-	$colorscale_vh = "h";
-	}
-
-# figure out reasonable bathymetry contour intervals
-$dmin = $zmin;
-$dmax = $zmax;
-$dd = ($dmax - $dmin);
-$contour_int = 0.0;
-if ($dd > 0)
-	{
-	$base = int((log($dd) / log(10.)) + 0.5);
-	$contour_int = (10 ** $base) / 10.0;
-	if ($dd / $contour_int < 10)
-		{
-		$contour_int = $contour_int / 4;
-		}
-	elsif ($dd / $contour_int < 20)
-		{
-		$contour_int = $contour_int / 2;
-		}
-	}
-
-# figure out reasonable color intervals
-if ($color_mode >= 1 && $color_mode <= 3)
-	{
-	$dmin = $zmin;
-	$dmax = $zmax;
-	}
-elsif ($color_mode == 4)
-	{
-	$dmin = $amin_data;
-	$dmax = $amax_data;
-	}
-elsif ($color_mode == 5)
-	{
-	$dmin = $smin_data;
-	$dmax = $smax_data;
-	}
-$dd = ($dmax - $dmin);
-$color_int = 0.0;
-if ($dd > 0)
-	{
-	$base = int((log($dd) / log(10.)) + 0.5);
-	$color_int = (10 ** $base) / 10.0;
-	if ($dd / $color_int < 10)
-		{
-		$color_int = $color_int / 4;
-		}
-	elsif ($dd / $color_int < 20)
-		{
-		$color_int = $color_int / 2;
-		}
-	}
-if ($color_mode && $color_style == 1)
-	{
-	$ncolors_use = $ncolors;
-	}
-elsif ($color_mode)
-	{
-	$ncolors_use = $ncolors + 1;
-	}
-if ($color_mode && !$no_nice_color_int && $dd > 0)
-	{
-	$start_int = $color_int / 2;
-	$multiplier = int($dd / ($ncolors_use - 1) / $start_int) + 1;
-	$color_int = $multiplier * $start_int;
-	if (($color_int * int($dmin / $color_int)
-		+ $color_int * ($ncolors_use - 1))
-		< $zmax)
-		{
-		$multiplier = $multiplier + 1;
-		$color_int = $multiplier * $start_int;
-		}
-	$color_start = $color_int * int($dmin / $color_int);
-	$color_end = $color_start + $color_int * ($ncolors_use - 1);
-	}
-elsif ($color_mode)
-	{
-	$color_int = 1.02 * ($dmax - $dmin)/($ncolors_use - 1);
-	$color_start = $dmin - 0.01*($dmax - $dmin);
-	$color_end = $color_start + $color_int * ($ncolors_use - 1);
-	}
-
-# get colors to use by interpolating defined color pallette
-if ($color_mode)
-	{
-	# set selected color pallette
-	eval "\@cptbr = \@cptbr$color_pallette;";
-	eval "\@cptbg = \@cptbg$color_pallette;";
-	eval "\@cptbb = \@cptbb$color_pallette;";
-
-	# interpolate colors
-	for ($i = 0; $i < $ncolors; $i++)
-		{
-		$xx = ($ncpt - 1) * $i / ($ncolors - 1);
-		$i1 = int($xx);
-		$i2 = $i1 + 1;
-		$red = $cptbr[$i1]
-			+ ($cptbr[$i2] - $cptbr[$i1])
-			* ($xx - $i1) / ($i2 - $i1);
-		$green = $cptbg[$i1]
-			+ ($cptbg[$i2] - $cptbg[$i1])
-			* ($xx - $i1) / ($i2 - $i1);
-		$blue = $cptbb[$i1]
-			+ ($cptbb[$i2] - $cptbb[$i1])
-			* ($xx - $i1) / ($i2 - $i1);
-		push (@cptr, $red);
-		push (@cptg, $green);
-		push (@cptb, $blue);
-		}
-	}
-
-# set contour control
-if (!$contour_control && $contour_mode)
-	{
-	if ($color_mode)
-		{
-		$contour_color_int = 100000;
-		}
-	else
-		{
-		$contour_color_int = 4 * $contour_int;
-		}
-	$contour_tick_int = $contour_color_int;
-	$contour_label_int = $contour_tick_int;
-	$contour_tick_len = 0.001 * $page_height_in{$pagesize};
-	$contour_label_hgt = 0.01 * $page_height_in{$pagesize};
-	if ($contour_tick_len < 0.01 || $contour_label_hgt < 0.1)
-		{
-		$contour_tick_len = 0.01;
-		$contour_label_hgt = 0.1;
-		}
-	}
-elsif ($contour_control =~ /\S+\/\S+\/\S+\/\S+\/\S+\/\S+/)
-	{
-	($contour_int, $contour_color_int, $contour_tick_int,
-		$contour_label_int, $contour_tick_len,
-		$contour_label_hgt)
-		= $contour_control
-		=~ /(\S+)\/(\S+)\/(\S+)\/(\S+)\/(\S+)\/(\S+)/;
-	$contour_label_hgt = 0.1;
-	}
-elsif ($contour_control =~ /\S+\/\S+\/\S+\/\S+\/\S+/)
-	{
-	($contour_int, $contour_color_int, $contour_tick_int,
-		$contour_label_int, $contour_tick_len)
-		= $contour_control
-		=~ /(\S+)\/(\S+)\/(\S+)\/(\S+)\/(\S+)/;
-	$contour_label_hgt = 0.1;
-	}
-elsif ($contour_control =~ /\S+\/\S+\/\S+\/\S+/)
-	{
-	($contour_int, $contour_color_int, $contour_tick_int,
-		$contour_label_int)
-		= $contour_control
-		=~ /(\S+)\/(\S+)\/(\S+)\/(\S+)/;
-	$contour_tick_len = 0.01;
-	$contour_label_hgt = 0.1;
-	}
-elsif ($contour_control =~ /\S+\/\S+\/\S+/)
-	{
-	($contour_int, $contour_color_int, $contour_tick_int)
-		= $contour_control =~ /(\S+)\/(\S+)\/(\S+)/;
-	$contour_label_int = $contour_color_int;
-	$contour_tick_len = 0.01;
-	$contour_label_hgt = 0.1;
-	}
-elsif ($contour_control =~ /\S+\/\S+/)
-	{
-	($contour_int, $contour_color_int)
-		 = $contour_control =~ /(\S+)\/(\S+)/;
-	$contour_tick_int = $contour_color_int;
-	$contour_label_int = $contour_color_int;
-	$contour_tick_len = 0.01;
-	$contour_label_hgt = 0.1;
-	}
-elsif ($contour_control =~ /\S+/)
-	{
-	($contour_int) = $contour_control =~ /(\S+)/;
-	if ($color_mode)
-		{
-		$contour_color_int = 100000;
-		}
-	else
-		{
-		$contour_color_int = 4*$contour_int;
-		}
-	$contour_tick_int = $contour_color_int;
-	$contour_label_int = $contour_color_int;
-	$contour_tick_len = 0.01;
-	$contour_label_hgt = 0.1;
-	}
-if ($contour_mode)
-	{
-	$contour_control = "$contour_int" . "/" . "$contour_color_int"
-			. "/" . "$contour_tick_int" . "/" . "$contour_label_int"
-			. "/" . "$contour_tick_len" . "/" . "$contour_label_hgt";
-	}
-
-# set pscoast control
-if ($coast_control
-	&& !$coast_wetfill
-	&& !$coast_dryfill
-	&& !$coast_pen
-	&& !$coast_boundary
-	&& !$coast_river)
-	{
-	$coast_dryfill = "200";
-	$coast_pen = "1p";
-	}
-if ($coast_control
-	&& !$coast_resolution)
-	{
-	$coast_resolution = "f";
-	}
-
-# if length scale bar requested check to see if map center needs to be defined
-if ($length_scale && $length_scale =~ /\S+center\S+/)
-        {
-        # add map lon lat (or x y) center to the length scale argument
-        ($a, $c) = $length_scale =~ /(\S+)center(\S+)/;
-        $xcen = 0.5 * ($xmin + $xmax);
-        $ycen = 0.5 * ($ymin + $ymax);
-        $b = "$xcen/$ycen";
-        $length_scale = "$a$b$s";
-        }
-
-# come up with the filenames
-$cmdfile = "$root.cmd";
-$psfile = "$root.ps";
-if ($format == -1)
-	{
-	$file_list = "\$INPUT_FILE";
-	}
-else
-	{
-	$file_list = "datalist\$\$";
-	}
-$cptfile = "$root.cpt";
-$cptshadefile = "$root.shade.cpt";
-
-# set some gmtisms
-$first_gmt = 1;
-$first = "-X\$X_OFFSET -Y\$Y_OFFSET -K -V >! \$PS_FILE";
-$middle = "-K -O -V >> \$PS_FILE";
-$end = "-O -V >> \$PS_FILE";
-
-# set macro gmt default settings
-$gmt_def = "PROJ_LENGTH_UNIT/inch";
-push(@gmt_macro_defs, $gmt_def);
-$gmt_def = "PS_MEDIA/$page_gmt_name{$pagesize}";
-push(@gmt_macro_defs, $gmt_def);
-$gmt_def = "FONT_ANNOT_PRIMARY/$page_anot_font{$pagesize},Helvetica,black";
-push(@gmt_macro_defs, $gmt_def);
-$gmt_def = "FONT_ANNOT_SECONDARY/$page_anot_font{$pagesize},Helvetica,black";
-push(@gmt_macro_defs, $gmt_def);
-$gmt_def = "FONT_LABEL/$page_anot_font{$pagesize},Helvetica,black";
-push(@gmt_macro_defs, $gmt_def);
-$gmt_def = "FONT_TITLE/$page_header_font{$pagesize},Helvetica,black";
-push(@gmt_macro_defs, $gmt_def);
-$gmt_def = "PS_PAGE_ORIENTATION/LANDSCAPE";
-push(@gmt_macro_defs, $gmt_def);
-$gmt_def = "COLOR_BACKGROUND/black";
-push(@gmt_macro_defs, $gmt_def);
-$gmt_def = "COLOR_FOREGROUND/white";
-push(@gmt_macro_defs, $gmt_def);
-$gmt_def = "COLOR_NAN/white";
-push(@gmt_macro_defs, $gmt_def);
-$gmt_def = "FORMAT_GEO_MAP/$degree_format";
-push(@gmt_macro_defs, $gmt_def);
-
-# set shade control if not set by user
-if (!$shade_control && $color_mode == 3 && !stretch_shade)
-	{
-	$magnitude = 2.0/($amax_data - $amin_data);
-	$zero_level = $amin_data + 0.2 * ($amax_data - $amin_data);
-	$shade_control = sprintf("%.4g/%.4g",$magnitude,$zero_level);
-	}
-elsif (!$shade_control && $color_mode == 3)
-	{
-	$magnitude = 1;
-	$zero_level = 191;
-	$shade_control = sprintf("%.4g/%.4g",$magnitude,$zero_level);
-	}
-elsif (!$shade_control)
-	{
-	$azimuth = 0;
-	$magnitude = 2.5;
-	$shade_control = "2.5/0";
-	}
-elsif ($color_mode == 3)
-	{
-	$shade_control = "$magnitude/$zero_level";
-	}
-else
-	{
-	$shade_control = "$magnitude/$azimuth";
-	}
-
-# figure out labels
-$nlabels = 0;
-if ($labels)
-	{
-	@labels_split = split(/:/, $labels);
-	$nlabels = @labels_split;
-	if ($nlabels > 0)
-		{
-		$tlabel = shift(@labels_split);
-		$tlabel =~ s/\\/\//g;
-		}
-	if ($nlabels > 1)
-		{
-		$slabel = shift(@labels_split);
-		$slabel =~ s/\\/\//g;
-		}
-	}
-if ($nlabels < 1 && $format < 0)
-	{
-	$tlabel = "Data List File $file_list";
-	}
-elsif ($nlabels < 1)
-	{
-	$tlabel = "Data File \$INPUT_FILE";
-	}
-if ($nlabels < 2)
-	{
-	if ($color_mode == 5)
-		{
-		$slabel = "Sidescan Pixel Values";
-		}
-	elsif ($color_mode == 4)
-		{
-		$slabel = "Beam Amplitude Values";
-		}
-	else
-		{
-		$slabel = "Depth (meters)";
-		}
-	}
-
-# set basemap axes annotation
-if ($tick_info)
-	{
-	$axes = "-B$tick_info";
-	}
-else
-	{
-	# figure out some reasonable tick intervals for the basemap
-	&GetBaseTick;
-        $axes = "-B$base_tick"
- 	}
-if ($tlabel)
-	{
-	$axes = "$axes -B+t\"$tlabel\"";
-	}
-
-# open the shellscript file
-if (!open(FCMD,">$cmdfile"))
-	{
-	print "\a";
-	die "Cannot open output file $cmdfile\nMacro $program_name aborted.\n";
-	}
-
-# write the shellscript header
-print FCMD "#! /bin/csh -f\n";
-print FCMD "#\n# Shellscript to create Postscript plot of swath sonar data\n";
-print FCMD "# Created by macro $program_name\n";
-print FCMD "#\n# This shellscript created by following command line:\n";
-print FCMD "# $program_name $command_line\n";
-
-# Define shell variables
-print FCMD "#\n# Define shell variables used in this script:\n";
-print FCMD "set PS_FILE         = $psfile\n";
-print FCMD "set CPT_FILE        = $cptfile\n";
-print FCMD "set MAP_PROJECTION  = $projection\n";
-print FCMD "set MAP_SCALE       = $projection_pars\n";
-print FCMD "set MAP_REGION      = $bounds_plot\n";
-printf FCMD "set X_OFFSET        = %1.5g\n", $xoffset;
-printf FCMD "set Y_OFFSET        = %1.5g\n", $yoffset;
-print FCMD "set INPUT_FILE      = $file_data\n";
-print FCMD "set INPUT_FORMAT    = $format\n";
-
-# Set temporary GMT defaults
-print FCMD "#\n# Delete any existing gmt.conf file\n";
-print FCMD "if (-e gmt.conf) then\n";
-print FCMD "echo Deleting gmt.conf...\n";
-print FCMD "/bin/rm gmt.conf\n";
-print FCMD "endif\n";
-print FCMD "#\n# Set temporary GMT defaults\n";
-print FCMD "echo Setting temporary GMT defaults...\n";
-foreach $gmt_def (@gmt_macro_defs) {
-	($gmt_par, $gmt_var) = $gmt_def =~ /^([^\/]+)\/(.+)/;
-	print FCMD "gmt gmtset $gmt_par $gmt_var\n";
-	}
-
-# Reset GMT defaults as per user commands
-if (@gmt_defs)
-	{
-	print FCMD "#\n# Set user defined GMT defaults\n";
-	print FCMD "echo Setting user defined GMT defaults...\n";
-	foreach $gmt_def (@gmt_defs) {
-		($gmt_par, $gmt_var) = $gmt_def =~ /^([^\/]+)\/(.+)/;
-		print FCMD "gmt gmtset $gmt_par $gmt_var\n";
-		}
-	}
-
-# generate datalist file if needed
-if ($format != -1)
-	{
-	print FCMD "#\n# Make datalist file \n";
-	print FCMD "echo Making datalist file...\n";
-	print FCMD "echo \$INPUT_FILE \$INPUT_FORMAT >! $file_list\n";
-	}
-
-# generate color pallette table file if needed
-if ($color_mode && $file_cpt)
-	{
-	$cptfile = $file_cpt;
-	}
-elsif ($color_mode)
-	{
-	# break data distribution up into equal size
-	# regions using mbhistogram
-	if ($stretch_color)
-		{
-		if ($verbose)
-			{
-			print "Running mbhistogram...\n";
-			}
-		if ($color_mode == 4)
-			{
-			$data_type = 1;
-			}
-		elsif ($color_mode == 5)
-			{
-			$data_type = 2;
-			}
-		else
-			{
-			$data_type = 0;
-			}
-		@mbhistogram = `mbhistogram -F$format -I$file_data -A$data_type -D$dmin/$dmax -M$ncolors -N1000`;
-		}
-
-	# generate cpt file for primary data
-	print FCMD "#\n# Make color pallette table file\n";
-	print FCMD "echo Making color pallette table file...\n";
-	if ($stretch_color)
-		{
-		$d1 = shift @mbhistogram;
-		}
-	else
-		{
-		$d1 = $color_start;
-		}
-	if ($color_style == 1 && !$color_flip)
-		{
-		foreach $i (0 .. $ncolors - 2)
-			{
-			if ($stretch_color)
-				{
-				$d2 = shift @mbhistogram;
-				}
-			else
-				{
-				$d2 = $d1 + $color_int;
-				}
-			printf FCMD "echo %6g %3d %3d %3d %6g %3d %3d %3d",
-				$d1, at cptr[$i], at cptg[$i], at cptb[$i],
-				$d2, at cptr[$i+1], at cptg[$i+1], at cptb[$i+1];
-			if ($i == 0)
-				{
-				print FCMD " >!";
-				}
-			else
-				{
-				print FCMD " >>";
-				}
-			print FCMD " \$CPT_FILE\n";
-			$d1 = $d2
-			}
-		}
-	elsif ($color_style == 1)
-		{
-		for ($i = $ncolors - 2; $i >= 0; $i--)
-			{
-			if ($stretch_color)
-				{
-				$d2 = shift @mbhistogram;
-				}
-			else
-				{
-				$d2 = $d1 + $color_int;
-				}
-			printf FCMD "echo %6g %3d %3d %3d %6g %3d %3d %3d",
-				$d1, at cptr[$i+1], at cptg[$i+1], at cptb[$i+1],
-				$d2, at cptr[$i], at cptg[$i], at cptb[$i];
-			if ($i == ($ncolors - 2))
-				{
-				print FCMD " >!";
-				}
-			else
-				{
-				print FCMD " >>";
-				}
-			print FCMD " \$CPT_FILE\n";
-			$d1 = $d2
-			}
-		}
-	elsif (!$color_flip)
-		{
-		foreach $i (0 .. $ncolors - 1)
-			{
-			if ($stretch_color)
-				{
-				$d2 = shift @mbhistogram;
-				}
-			else
-				{
-				$d2 = $d1 + $color_int;
-				}
-			printf FCMD "echo %6g %3d %3d %3d %6g %3d %3d %3d",
-				$d1, at cptr[$i], at cptg[$i], at cptb[$i],
-				$d2, at cptr[$i], at cptg[$i], at cptb[$i];
-			if ($i == 0)
-				{
-				print FCMD " >!";
-				}
-			else
-				{
-				print FCMD " >>";
-				}
-			print FCMD " \$CPT_FILE\n";
-			$d1 = $d2
-			}
-		}
-	else
-		{
-		for ($i = $ncolors - 1; $i >= 0; $i--)
-			{
-			if ($stretch_color)
-				{
-				$d2 = shift @mbhistogram;
-				}
-			else
-				{
-				$d2 = $d1 + $color_int;
-				}
-			printf FCMD "echo %6g %3d %3d %3d %6g %3d %3d %3d",
-				$d1, at cptr[$i], at cptg[$i], at cptb[$i],
-				$d2, at cptr[$i], at cptg[$i], at cptb[$i];
-			if ($i == ($ncolors - 2))
-				{
-				print FCMD " >!";
-				}
-			else
-				{
-				print FCMD " >>";
-				}
-			print FCMD " \$CPT_FILE\n";
-			$d1 = $d2
-			}
-		}
-	}
-
-# generate cpt file for amplitude shading
-if ($color_mode == 3 && $stretch_shade)
-	{
-	# break data distribution up into equal size
-	# regions of Gaussian distribution using mbhistogram
-	if ($verbose)
-		{
-		print "Running mbhistogram...\n";
-		}
-	$data_type = 1;
-	@mbhistogram = `mbhistogram -F$format -I$file_data -A$data_type -D$amin_data/$amax_data -M$ncpt -N1000 -G`;
-
-	print FCMD "#\n# Make shading control table file\n";
-	print FCMD "echo Making shading control table file...\n";
-	$d1 = shift @mbhistogram;
-	if (!$shade_flip)
-		{
-		foreach $i (0 .. $ncolors - 2)
-			{
-			$d2 = shift @mbhistogram;
-			printf FCMD "echo %6g %3d %3d %3d %6g %3d %3d %3d",
-				$d1, at cptbr4[$i], at cptbg4[$i], at cptbb4[$i],
-				$d2, at cptbr4[$i+1], at cptbg4[$i+1], at cptbb4[$i+1];
-			if ($i == 0)
-				{
-				print FCMD " >";
-				}
-			else
-				{
-				print FCMD " >>";
-				}
-			print FCMD " $cptshadefile\n";
-			$d1 = $d2
-			}
-		}
-	else
-		{
-		for ($i = $ncolors - 2; $i >= 0; $i--)
-			{
-			$d2 = shift @mbhistogram;
-			printf FCMD "echo %6g %3d %3d %3d %6g %3d %3d %3d",
-				$d1, at cptbr4[$i+1], at cptbg4[$i+1], at cptbb4[$i+1],
-				$d2, at cptbr4[$i], at cptbg4[$i], at cptbb4[$i];
-			if ($i == ($ncolors - 2))
-				{
-				print FCMD " >";
-				}
-			else
-				{
-				print FCMD " >>";
-				}
-			print FCMD " $cptshadefile\n";
-			$d1 = $d2
-			}
-		}
-	} # end of making amplitude shading file
-
-# do swath plot if needed
-if ($color_mode)
-	{
-	print FCMD "#\n# Run mbswath\n";
-	print FCMD "echo Running mbswath...\n";
-	printf FCMD "gmt mbswath -F-1 -I$file_list \\\n\t";
-	printf FCMD "-J\$MAP_PROJECTION\$MAP_SCALE \\\n\t";
-	printf FCMD "-R\$MAP_REGION \\\n\t";
-	printf FCMD "-C\$CPT_FILE \\\n\t";
-	if ($use_filtered_data)
-		{
-		print FCMD "-Z$color_mode"."F \\\n\t";
-		}
-	else
-		{
-		print FCMD "-Z$color_mode \\\n\t";
-		}
-	if ($swath_footprint)
-		{
-		printf FCMD "-A$swath_footprint \\\n\t";
-		}
-	else
-		{
-		printf FCMD "-A1 \\\n\t";
-		}
-	if ($color_mode == 2 || $color_mode == 3)
-		{
-		print FCMD "-G$shade_control \\\n\t";
-		}
-	if ($color_mode == 3 && $stretch_shade)
-		{
-		print FCMD "-N$cptshadefile \\\n\t";
-		}
-	if ($dpi)
-		{
-		printf FCMD "-Q$dpi \\\n\t";
-		}
-	if ($mb_btime)
-		{
-		printf FCMD "-b$mb_btime \\\n\t";
-		}
-	if ($mb_etime)
-		{
-		printf FCMD "-E$mb_etime \\\n\t";
-		}
-	if ($mb_speedmin)
-		{
-		printf FCMD "-S$mb_speedmin \\\n\t";
-		}
-	if ($mb_timegap)
-		{
-		printf FCMD "-T$mb_timegap \\\n\t";
-		}
-	if ($swath_scale)
-		{
-		printf FCMD "-D$swath_scale \\\n\t";
-		}
-	if ($portrait)
-		{
-		printf FCMD "-P ";
-		}
-	if ($first_gmt == 1)
-		{
-		$first_gmt = 0;
-		printf FCMD "$first\n";
-		}
-	else
-		{
-		printf FCMD "$middle\n";
-		}
-	}
-
-# do contour plot if needed
-if ($contour_mode || $navigation_mode)
-	{
-	print FCMD "#\n# Run mbcontour\n";
-	print FCMD "echo Running mbcontour...\n";
-	printf FCMD "gmt mbcontour -F-1 -I$file_list \\\n\t";
-	printf FCMD "-J\$MAP_PROJECTION\$MAP_SCALE \\\n\t";
-	printf FCMD "-R\$MAP_REGION \\\n\t";
-	if ($contour_mode && $contour_algorithm)
-		{
-		printf FCMD "-Z$contour_algorithm \\\n\t";
-		}
-	elsif ($contour_mode &&
-		($format == 41 || $format == 101
-		|| $format == 102))
-		{
-		print FCMD "-Z1 ";
-		}
-	if ($contour_mode)
-		{
-		printf FCMD "-A$contour_control \\\n\t";
-		}
-	if ($navigation_mode)
-		{
-		printf FCMD "-D$navigation_control \\\n\t";
-		}
-	if ($name_mode && $name_perp != 0)
-		{
-		printf FCMD "-G$nav_name_hgt/1 \\\n\t";
-		}
-	elsif ($name_mode)
-		{
-		printf FCMD "-G$nav_name_hgt \\\n\t";
-		}
-	if ($pingnumber_mode)
-		{
-		printf FCMD "-M$pingnumber_control \\\n\t";
-		}
-	if ($mb_btime)
-		{
-		printf FCMD "-b$mb_btime \\\n\t";
-		}
-	if ($mb_etime)
-		{
-		printf FCMD "-E$mb_etime \\\n\t";
-		}
-	if ($mb_speedmin)
-		{
-		printf FCMD "-S$mb_speedmin \\\n\t";
-		}
-	if ($mb_timegap)
-		{
-		printf FCMD "-T$mb_timegap \\\n\t";
-		}
-	if ($contour_nplot)
-		{
-		printf FCMD "-N$contour_nplot \\\n\t";
-		}
-	if ($portrait)
-		{
-		printf FCMD "-P ";
-		}
-	if ($first_gmt == 1)
-		{
-		$first_gmt = 0;
-		printf FCMD "$first\n";
-		}
-	else
-		{
-		printf FCMD "$middle\n";
-		}
-	}
-
-# do coastline plots
-if ($coast_control)
-	{
-	printf FCMD "#\n# Make coastline data plot\n";
-	printf FCMD "echo Running pscoast...\n";
-	printf FCMD "gmt pscoast \\\n\t";
-	printf FCMD "-J\$MAP_PROJECTION\$MAP_SCALE \\\n\t";
-	printf FCMD "-R\$MAP_REGION \\\n\t";
-	if ($coast_lakefill)
-		{
-		printf FCMD "-C$coast_lakefill \\\n\t";
-		}
-	if ($coast_resolution)
-		{
-		printf FCMD "-D$coast_resolution \\\n\t";
-		}
-	if ($coast_dryfill)
-		{
-		printf FCMD "-G$coast_dryfill \\\n\t";
-		}
-	if ($coast_river)
-		{
-		printf FCMD "-I$coast_river \\\n\t";
-		}
-	for ($i = 0; $i < scalar(@coast_boundaries); $i++)
-		{
-		printf FCMD "-N$coast_boundaries[$i] \\\n\t";
-		}
-	if ($coast_wetfill)
-		{
-		printf FCMD "-S$coast_wetfill \\\n\t";
-		}
-	if ($coast_pen)
-		{
-		printf FCMD "-W$coast_pen \\\n\t";
-		}
-	if ($portrait)
-		{
-		printf FCMD "-P ";
-		}
-	if ($first_gmt == 1)
-		{
-		$first_gmt = 0;
-		printf FCMD "$first\n";
-		}
-	else
-		{
-		printf FCMD "$middle\n";
-		}
-	}
-
-# do xy plots
-for ($i = 0; $i < scalar(@xyfiles); $i++)
-	{
-	printf FCMD "#\n# Make xy data plot\n";
-	printf FCMD "echo Running psxy...\n";
-	printf FCMD "gmt psxy $xyfiles[$i] \\\n\t";
-	printf FCMD "-J\$MAP_PROJECTION\$MAP_SCALE \\\n\t";
-	printf FCMD "-R\$MAP_REGION \\\n\t";
-	if ($xyfills[$i] ne "N")
-		{
-		printf FCMD "-G$xyfills[$i] \\\n\t";
-		}
-	if ($xysymbols[$i] ne "N")
-		{
-		printf FCMD "-S$xysymbols[$i] \\\n\t";
-		}
-	if ($xysegments[$i] ne "N")
-		{
-		printf FCMD "-M \\\n\t";
-		}
-	if ($xypens[$i] ne "N")
-		{
-		printf FCMD "-W$xypens[$i] \\\n\t";
-		}
-	if ($portrait)
-		{
-		printf FCMD "-P ";
-		}
-	if ($first_gmt == 1)
-		{
-		$first_gmt = 0;
-		printf FCMD "$first\n";
-		}
-	else
-		{
-		printf FCMD "$middle\n";
-		}
-	}
-
-# do psscale plot
-if ($color_mode && $color_pallette < 5)
-	{
-	printf FCMD "#\n# Make color scale\n";
-	printf FCMD "echo Running psscale...\n";
-	printf FCMD "gmt psscale -C\$CPT_FILE \\\n\t";
-	printf FCMD "-D%.4f/%.4f/%.4f/%.4f%s \\\n\t",
-		$colorscale_offx,$colorscale_offy,
-		$colorscale_length,$colorscale_thick,
-		$colorscale_vh;
-	print FCMD "-B+l\"$slabel\" \\\n\t";
-#	if ($stretch_color)
-#		{
-#		print FCMD "-L \\\n\t";
-#		}
-	if ($portrait)
-		{
-		printf FCMD "-P ";
-		}
-	printf FCMD "$middle\n";
-	}
-
-# do pstext plot
-if (@text)
-	{
-	printf FCMD "#\n# Make text labels\n";
-	printf FCMD "echo Running pstext...\n";
-	printf FCMD "gmt pstext -J\$MAP_PROJECTION\$MAP_SCALE \\\n\t";
-	printf FCMD "-R\$MAP_REGION \\\n\t";
-	printf FCMD "$middle <<EOT\n";
-	foreach $text_info (@text) {
-	    ($tx, $ty, $tsize, $tangle, $font, $just, $txt) = $text_info
-		=~ /^(\S+)\/(\S+)\/(\S+)\/(\S+)\/(\S+)\/(\S+)\/(.+)/;
-	    print "text_info:$text_info\n";
-	    print "txt:$txt\n";
-	    print FCMD "$tx $ty $tsize $tangle $font $just $txt\n";
-	    }
-	print FCMD "EOT\n";
-	}
-
-# do psbasemap plot
-printf FCMD "#\n# Make basemap\n";
-printf FCMD "echo Running psbasemap...\n";
-printf FCMD "gmt psbasemap -J\$MAP_PROJECTION\$MAP_SCALE \\\n\t";
-printf FCMD "-R\$MAP_REGION \\\n\t";
-printf FCMD "$axes \\\n\t";
-if ($length_scale)
-	{
-	printf FCMD "-L$length_scale \\\n\t";
-	}
-if ($unix_stamp_on && $unix_stamp)
-	{
-	printf FCMD "-U$unix_stamp \\\n\t";
-	}
-elsif ($unix_stamp_on)
-	{
-	printf FCMD "-U \\\n\t";
-	}
-if ($portrait)
-	{
-	printf FCMD "-P ";
-	}
-printf FCMD "$end\n";
-
-# delete surplus files
-print FCMD "#\n# Delete surplus files\n";
-print FCMD "echo Deleting surplus files...\n";
-print FCMD "/bin/rm -f gmt.conf\n";
-print FCMD "/bin/rm -f \$CPT_FILE\n";
-if ($format > -1)
-	{
-	print FCMD "/bin/rm -f $file_list\n";
-	}
-
-# display image on screen if desired
-print FCMD "#\n# Run $ps_viewer\n";
-if ($ps_viewer eq "xpsview")
-	{
-	if ($portrait)
-		{
-		$view_pageflag = "-ps $pagesize -maxp $xpsview_mem{$pagesize}";
-		}
-	elsif ($landscape)
-		{
-		$view_pageflag = "-ps $pagesize -or landscape -maxp $xpsview_mem{$pagesize}";
-		}
-	}
-elsif ($ps_viewer eq "pageview")
-	{
-	if ($portrait)
-		{
-		$view_pageflag = "-w $page_width_in{$pagesize} -h $page_height_in{$pagesize}";
-		}
-	elsif ($landscape)
-		{
-		$view_pageflag = "-w $page_height_in{$pagesize} -h $page_width_in{$pagesize}";
-		}
-	}
-elsif ($ps_viewer eq "ghostview")
-	{
-	if ($portrait)
-		{
-		$view_pageflag = "-portrait -media BBox";
-		}
-	elsif ($landscape)
-		{
-		$view_pageflag = "-landscape -media BBox";
-		}
-	}
-elsif ($ps_viewer eq "gv")
-	{
-	if ($portrait)
-		{
-		$pagescale = 11.0 / $page_height_in{$pagesize};
-		if ($pagescale > 1.0)
-			{
-			$pagescale = 1.0;
-			}
-		$view_pageflag = "--orientation=portrait --media=BBox -scale=$pagescale";
-		}
-	elsif ($landscape)
-		{
-		$pagescale = 11.0 / $page_width_in{$pagesize};
-		if ($pagescale > 1.0)
-			{
-			$pagescale = 1.0;
-			}
-		$view_pageflag = "--orientation=landscape --media=BBox -scale=$pagescale";
-		}
-	}
-elsif ($ps_viewer eq "ggv")
-	{
-	if ($portrait)
-		{
-		$view_pageflag = "--geometry=portrait";
-		}
-	elsif ($landscape)
-		{
-		$view_pageflag = "--geometry=landscape";
-		}
-	}
-elsif ($ps_viewer eq "evince")
-	{
-	$view_pageflag = " ";
-	}
-if ($no_view_ps)
-	{
-        print FCMD "#if (!(\$#argv > 0 && (\"\$1\" == \"-N\" || \"\$1\" == \"-n\"))) then\n";
-	print FCMD "#echo Running $ps_viewer in background...\n";
-	print FCMD "#$ps_viewer $view_pageflag \$PS_FILE &\n";
-        print FCMD "#endif\n";
-	}
-else
-	{
-        print FCMD "if (!(\$#argv > 0 && (\"\$1\" == \"-N\" || \"\$1\" == \"-n\"))) then\n";
-	print FCMD "echo Running $ps_viewer in background...\n";
-	print FCMD "$ps_viewer $view_pageflag \$PS_FILE &\n";
-        print FCMD "endif\n";
-	}
-
-# claim it's all over
-print FCMD "#\n# All done!\n";
-print FCMD "echo All done!\n";
-
-# now close the shellscript and make it executable
-close FCMD;
-chmod 0775, $cmdfile;
-
-# tell program status
-if ($verbose)
-	{
-	print "\nProgram Status:\n";
-	print "--------------\n";
-	print "\n  GMT Version:\n";
-	print "    Version $gmt_version\n";
-	print "\n  Plot Style:\n";
-	if ($color_mode == 1)
-		{
-		print "    Color Fill Bathymetry\n";
-		}
-	elsif ($color_mode == 2)
-		{
-		print "    Color Shaded Relief Bathymetry\n";
-		}
-	elsif ($color_mode == 3 && $use_filtered_data)
-		{
-		print "    Color Bathymetry Shaded with Filtered Amplitude\n";
-		}
-	elsif ($color_mode == 3)
-		{
-		print "    Color Bathymetry Shaded with Unfiltered Amplitude\n";
-		}
-	elsif ($color_mode == 4 && $use_filtered_data)
-		{
-		print "    Grayscale Filtered Amplitude\n";
-		}
-	elsif ($color_mode == 4)
-		{
-		print "    Grayscale Unfiltered Amplitude\n";
-		}
-	elsif ($color_mode == 5 && $use_filtered_data)
-		{
-		print "    Grayscale Filtered Sidescan\n";
-		}
-	elsif ($color_mode == 5)
-		{
-		print "    Grayscale Unfiltered Sidescan\n";
-		}
-	if ($contour_mode)
-		{
-		print "    Contoured Bathymetry\n";
-		}
-	if ($navigation_mode)
-		{
-		print "    Navigation\n";
-		}
-	if ($coast_control)
-		{
-		print "    Coastline\n";
-		}
-	if (@xyfiles)
-		{
-		print "    XY Plots of ", scalar(@xyfiles), " Datasets\n";
-		}
-	if ($color_mode && $color_pallette != 5)
-		{
-		if ($colorscale_vh eq "v")
-			{
-			print "    Vertical Color Scale\n";
-			}
-		else
-			{
-			print "    Horizontal Color Scale\n";
-			}
-		}
-	if (@text)
-		{
-		print "    ", scalar(@text), " Text labels\n";
-		}
-	if ($length_scale)
-		{
-		print "    Map distance scale\n";
-		}
-	if ($unix_stamp_on && $unix_stamp)
-		{
-		print "    Unix time stamp: $unix_stamp\n";
-		}
-	elsif ($unix_stamp_on)
-		{
-		print "    Unix time stamp\n";
-		}
-	print "\n  Input Files:\n";
-	if ($format < 0)
-		{
-		print "    Data list file:           $file_data\n";
-		}
-	else
-		{
-		print "    Multibeam data file:      $file_data\n";
-		print "    Data format id:           $format\n";
-		}
-	foreach $xyfile (@xyfiles) {
-		print "    XY Data File:             $xyfile\n";
-	}
-	print "\n  Output Files:\n";
-	print "    Output plot name root:    $root\n";
-	print "    Color pallette table:     $cptfile\n";
-	if ($color_mode == 3 && $stretch_shade)
-		{
-		print "    Shade control table:      $cptshadefile\n";
-		}
-	print "    Plotting shellscript:     $cmdfile\n";
-	print "    Plot file:                $psfile\n";
-	print "\n  Plot Attributes:\n";
-	printf "    Plot width:               %.4f\n", $plot_width;
-	printf "    Plot height:              %.4f\n", $plot_height;
-	print "    Page size:                $pagesize\n";
-	print "    Page width:               $width\n";
-	print "    Page height:              $height\n";
-	print "    Projection:               -J$projection$projection_pars\n";
-	printf "    Longitude min max:        %9.4f  %9.4f\n",
-		$xmin, $xmax;
-	printf "    Latitude min max:         %9.4f  %9.4f\n",
-		$ymin, $ymax;
-	print "    Axes annotation:          $axes\n";
-	if ($portrait)
-		{
-		print "    Orientation:              portrait\n";
-		}
-	else
-		{
-		print "    Orientation:              landscape\n";
-		}
-	if ($color_mode)
-		{
-		print "    Number of colors:         $ncolors\n";
-		print "    Color pallette:           ",
-			"@color_pallette_names[$color_pallette - 1]\n";
-		if ($color_style == 1)
-			{
-			print "    Color style:              continuous\n";
-			}
-		else
-			{
-			print "    Color style:              stepped\n";
-			}
-		if ($color_flip && color_pallette < 4)
-			{
-			print "    Colors reversed\n";
-			}
-		elsif ($color_flip)
-			{
-			print "    Grayscale reversed\n";
-			}
-		if ($shade_flip)
-			{
-			print "    Shading reversed\n";
-			}
-		}
-	print "\n  Sonar Data Attributes:\n";
-	if ($data_scale)
-		{
-		print "    Data scale factor:        $data_scale\n";
-		}
-	printf "    Longitude min max:        %9.4f  %9.4f\n",
-		$xmin_data, $xmax_data;
-	printf "    Latitude min max:         %9.4f  %9.4f\n",
-		$ymin_data, $ymax_data;
-	printf "    Bathymetry min max:       %9.4g  %9.4g\n",
-		$zmin_data, $zmax_data;
-	printf "    Amplitude min max:        %9.4g  %9.4g\n",
-		$amin_data, $amax_data;
-	printf "    Sidescan min max:         %9.4g  %9.4g\n",
-		$smin_data, $smax_data;
-	print "\n  Primary Plotting Controls:\n";
-	if ($contour_mode)
-		{
-		print "    Contour control:          $contour_control\n";
-		}
-	if ($navigation_mode)
-		{
-		print "    Navigation control:       $navigation_control\n";
-		}
-	if ($pingnumber_mode)
-		{
-		print "    Ping annotation control:  $pingnumber_control\n";
-		}
-	if ($name_mode)
-		{
-		print "    Name annotation height:   $nav_name_hgt\n";
-		if ($name_perp)
-			{
-			print "    Name annotation style:    Perpendicular\n";
-			}
-		else
-			{
-			print "    Name annotation style:    Parallel\n";
-			}
-		}
-	if ($color_mode)
-		{
-		printf "    Color start datum:        %f\n", $color_start;
-		printf "    Color end datum:          %f\n", $color_end;
-		}
-	if ($color_mode && !$stretch_color)
-		{
-		printf "    Color datum interval:     %f\n", $color_int;
-		}
-	elsif ($color_mode && $stretch_color)
-		{
-		printf "    Histogram stretch applied to color pallette\n";
-		}
-	if ($dpi && $color_mode)
-		{
-		printf "    Image dots-per-inch:      $dpi\n";
-		}
-	if ($color_mode == 2)
-		{
-		printf "    Illumination Azimuth:     %f\n", $azimuth;
-		printf "    Illumination Magnitude:   %f\n", $magnitude;
-		}
-	elsif ($color_mode == 3)
-		{
-		printf "    Amplitude zero level:     %f\n", $zero_level;
-		printf "    Amplitude shade magnitude:%f\n", $magnitude;
-		}
-	if ($color_mode == 3  && $stretch_shade)
-		{
-		printf "    Histogram stretch applied to amplitude shading\n";
-		}
-	if ($mb_btime || $mb_etime
-		|| $mb_speedmin
-		|| $mb_timegap)
-		{
-		print "\n  General MB-System Controls:\n";
-		}
-	if ($mb_btime)
-		{
-		print "    Begin time:               $mb_btime\n";
-		}
-	if ($mb_etime)
-		{
-		print "    End time:                 $mb_etime\n";
-		}
-	if ($mb_speedmin)
-		{
-		print "    Minimum speed:            $mb_speedmin\n";
-		}
-	if ($mb_timegap)
-		{
-		print "    Time gap:                 $mb_timegap\n";
-		}
-	if ($swath_footprint || $swath_scale
-		|| $contour_nplot || $contour_algorithm)
-		{
-		print "\n  Miscellaneous Plotting Controls:\n";
-		}
-	if ($swath_footprint)
-		{
-		print "    Beam footprint control:   $swath_footprint\n";
-		}
-	if ($swath_scale)
-		{
-		print "    Multibeam data scaling:   $swath_scale\n";
-		}
-	if ($contour_nplot)
-		{
-		print "    Pings to contour:         $contour_nplot\n";
-		}
-	if ($contour_mode && $contour_algorithm == 0)
-		{
-		print "    Contour algorithm:        ping-to-ping\n";
-		}
-	elsif ($contour_algorithm == 1)
-		{
-		print "    Contour algorithm:        triangle network\n";
-		}
-	if ($coast_control)
-		{
-		print "\n  Coastline Plotting Controls:\n";
-		}
-	if ($coast_control && $coast_resolution)
-		{
-		printf "    Coastline resolution:     $coast_resolution\n";
-		}
-	if ($coast_control && $coast_pen)
-		{
-		printf "    Coastline pen:            $coast_pen\n";
-		}
-	if ($coast_control && $coast_wetfill)
-		{
-		printf "    Ocean fill:               $coast_wetfill\n";
-		}
-	if ($coast_control && $coast_lakefill)
-		{
-		printf "    Lake fill:                $coast_lakefill\n";
-		}
-	if ($coast_control && $coast_dryfill)
-		{
-		printf "    Land fill:                $coast_dryfill\n";
-		}
-	if ($coast_control && $coast_river)
-		{
-		printf "    Rivers:                   $coast_river\n";
-		}
-
-	if ($coast_control && $coast_boundaries)
-		{
-		for ($i = 0; $i < scalar(@coast_boundaries); $i++)
-			{
-			printf "    National Boundaries:      $coast_boundaries[$i]\n";
-			}
-		}
-	if (@xyfiles)
-		{
-		print "\n  Primary XY Plotting Controls:\n";
-		printf "    symbol     pen        fill      segment      file\n";
-		printf "    ------     ---        ----      -------      ----\n";
-		for ($i = 0; $i < scalar(@xyfiles); $i++)
-			{
-			printf "    %-10s %-10s %-10s %-10s %s\n",
-				$xysymbols[$i], $xypens[$i],
-				$xyfills[$i], $xysegments[$i],
-				$xyfiles[$i];
-			}
-		}
-	if ($length_scale || $contour_anot_int
-		|| $contour_anot_int || $contour_cut
-		|| $contour_gap || $contour_tick
-		|| $contour_pen)
-		{
-		print "\n  Miscellaneous Plotting Controls:\n";
-		}
-	if ($length_scale)
-		{
-		printf "    Length scale:             $length_scale\n";
-		}
-	print "\n  GMT Default Values Reset in Script:\n";
-	foreach $gmt_def (@gmt_macro_defs) {
-		($gmt_par, $gmt_var) = $gmt_def =~ /^([^\/]+)\/(.+)/;
-		printf "    %-25s %s\n", $gmt_par, $gmt_var;
-		}
-	foreach $gmt_def (@gmt_defs) {
-		($gmt_par, $gmt_var) = $gmt_def =~ /^([^\/]+)\/(.+)/;
-		printf "    $gmt_par : $gmt_var\n";
-		}
-	print "\n--------------\n";
-	}
-
-# print out final notes
-print "\nPlot generation shellscript <$cmdfile> created.\n";
-print "\nInstructions:\n";
-print "  Execute <$cmdfile> to generate Postscript plot <$psfile>.\n";
-if (!$no_view_ps)
-	{
-	print "  Executing <$cmdfile> also invokes $ps_viewer ";
-	print "to view the plot on the screen.\n";
-	}
-if ($verbose)
-	{
-	print "\n--------------\n\n";
-	}
-
-# execute shellscript if desired
-if ($execute)
-	{
-	if ($verbose)
-		{
-		print "Executing shellscript $cmdfile...\n";
-		}
-	system "$cmdfile &";
-	}
-exit 0;
-
-#-----------------------------------------------------------------------
-sub min {
-
-	# make local variables
-	local ($min);
-
-	# get the minimum of the arguments
-	if ($_[0] < $_[1])
-		{
-		$min = $_[0];
-		}
-	else
-		{
-		$min = $_[1];
-		}
-	$min;
-}
-#-----------------------------------------------------------------------
-sub max {
-
-	# make local variables
-	local ($max);
-
-	# get the minimum of the arguments
-	if ($_[0] > $_[1])
-		{
-		$max = $_[0];
-		}
-	else
-		{
-		$max = $_[1];
-		}
-	$max;
-}
-#-----------------------------------------------------------------------
-sub MBparsedatalist {
-	local ($FILEDATA, $line, $file_tmp, $format_tmp, @datalists);
-
- 	if (open(FILEDATA,"<$_[0]"))
-        	{
-        	while ($line = <FILEDATA>)
-        		{
-			if (!($line =~ /^#/)
-			    && $line =~ /\S+\s+\S+/)
-			    {
-        		    ($file_tmp, $format_tmp) = $line =~ /(\S+)\s+(\S+)/;
-        		    if ($file_tmp && $format_tmp >= 0)
-        		 	{
-        			push(@files_data, $file_tmp);
-        			push(@formats, $format_tmp);
-        			}
-			    elsif ($file_tmp && $format_tmp == -1)
-				{
-        			push(@datalists, $file_tmp);
-				}
-			    }
-        		}
-        	close FILEDATA;
-        	}
-
-	# loop over datalists
-	foreach $datalist (@datalists)
-		{
-		MBparsedatalist($datalist);
-		}
-
-}
-#-----------------------------------------------------------------------
-sub GetDecimalDegrees {
-
-	# make local variables
-	local ($dec_degrees, $degrees, $minutes, $seconds);
-
-	# deal with dd:mm:ss format
-	if ($_[0] =~ /^\S+:\S+:\S+$/)
-		{
-		($degrees, $minutes, $seconds)
-			= $_[0] =~ /^(\S+):(\S+):(\S+)$/;
-		if ($degrees =~ /^-\S+/)
-			{
-			$dec_degrees = $degrees
-				- $minutes / 60.0
-				- $seconds / 3600.0;
-			}
-		else
-			{
-			$dec_degrees = $degrees
-				+ $minutes / 60.0
-				+ $seconds / 3600.0;
-			}
-		}
-	# deal with dd:mm format
-	elsif ($_[0] =~ /^\S+:\S+$/)
-		{
-		($degrees, $minutes)
-			= $_[0] =~ /^(\S+):(\S+)$/;
-		if ($degrees =~ /^-\S+/)
-			{
-			$dec_degrees = $degrees - $minutes / 60.0;
-			}
-		else
-			{
-			$dec_degrees = $degrees + $minutes / 60.0;
-			}
-		}
-
-	# value already in decimal degrees
-	else
-		{
-		$dec_degrees = $_[0];
-		}
-
-	# return decimal degrees;
-	$dec_degrees;
-}
-#-----------------------------------------------------------------------
-sub GetPageSize {
-
-# deal with location of color scale
-if ($scale_loc eq "l")
-	{
-	$space_top =    1.50 * $page_height_in{$pagesize}
-			    / $page_height_in{"a"};
-	$space_bottom = 0.75 * $page_height_in{$pagesize}
-			    / $page_height_in{"a"};
-	$space_left =   2.50 * $page_height_in{$pagesize}
-			    / $page_height_in{"a"};
-	$space_right =  1.00 * $page_height_in{$pagesize}
-			    / $page_height_in{"a"};
-	}
-elsif ($scale_loc eq "r")
-	{
-	$space_top =    1.50 * $page_height_in{$pagesize}
-			    / $page_height_in{"a"};
-	$space_bottom = 0.75 * $page_height_in{$pagesize}
-			    / $page_height_in{"a"};
-	$space_left =   1.00 * $page_height_in{$pagesize}
-			    / $page_height_in{"a"};
-	$space_right =  2.50 * $page_height_in{$pagesize}
-			    / $page_height_in{"a"};
-	}
-elsif ($scale_loc eq "t")
-	{
-	$space_top =    2.75 * $page_height_in{$pagesize}
-			    / $page_height_in{"a"};
-	$space_bottom = 0.75 * $page_height_in{$pagesize}
-			    / $page_height_in{"a"};
-	$space_left =   1.00 * $page_height_in{$pagesize}
-			    / $page_height_in{"a"};
-	$space_right =  1.00 * $page_height_in{$pagesize}
-			    / $page_height_in{"a"};
-	}
-else
-	{
-	$space_top =    1.50 * $page_height_in{$pagesize}
-			    / $page_height_in{"a"};
-	$space_bottom = 2.00 * $page_height_in{$pagesize}
-			    / $page_height_in{"a"};
-	$space_left =   1.00 * $page_height_in{$pagesize}
-			    / $page_height_in{"a"};
-	$space_right =  1.00 * $page_height_in{$pagesize}
-			    / $page_height_in{"a"};
-	}
-
-# set the relevent page width and height
-$width_max_landscape = $page_height_in{$pagesize}
-		- $space_left - $space_right;
-$height_max_landscape = $page_width_in{$pagesize}
-		- $space_bottom - $space_top;
-$width_max_portrait = $page_width_in{$pagesize}
-		- $space_left - $space_right;
-$height_max_portrait = $page_height_in{$pagesize}
-		- $space_bottom - $space_top;
-}
-#-----------------------------------------------------------------------
-sub GetProjection {
-
-	# get the map projection flag
-	($projection) = $map_scale =~ /^(\w)/;
-	($projection_pars) = $map_scale =~ /^$projection(\S+)/;
-
-	# see if plot scale or plot width defined
-	$use_scale = 0;
-	$use_width = 0;
-	$separator = "/";
-	$trial_value = 1.0;
-
-	# Cassini Projection
-	if ($projection eq "c")
-		{
-		($plot_scale) = $map_scale =~ /^c\S+\/\S+\/(\S+)$/;
-		$use_scale = 1;
-		}
-	elsif ($projection eq "C")
-		{
-		($plot_width) = $map_scale =~ /^C\S+\/\S+\/(\S+)$/;
-		$use_width = 1;
-		}
-
-	# Mercator Projection
-	elsif ($projection eq "m")
-		{
-		($plot_scale) = $map_scale =~ /^m(\S+)$/;
-		$use_scale = 1;
-		$separator = "";
-		}
-	elsif ($projection eq "M")
-		{
-		($plot_width) = $map_scale =~ /^M(\S+)$/;
-		$use_width = 1;
-		$separator = "";
-		}
-
-	# Oblique Mercator Projection
-	elsif ($projection eq "o")
-		{
-		if ($map_scale =~ /^oa\S+/)
-			{
-			($plot_scale) = $map_scale =~ /^oa\S+\/\S+\/\S+\/(\S+)$/;
-			}
-		elsif ($map_scale =~ /^ob\S+/)
-			{
-			($plot_scale) = $map_scale =~ /^ob\S+\/\S+\/\S+\/\S+\/(\S+)$/;
-			}
-		elsif ($map_scale =~ /^oc\S+/)
-			{
-			($plot_scale) = $map_scale =~ /^oc\S+\/\S+\/\S+\/\S+\/(\S+)$/;
-			}
-		$use_scale = 1;
-		}
-	elsif ($projection eq "O")
-		{
-		if ($map_scale =~ /^Oa\S+/)
-			{
-			($plot_width) = $map_scale =~ /^Oa\S+\/\S+\/\S+\/(\S+)$/;
-			}
-		elsif ($map_scale =~ /^Ob\S+/)
-			{
-			($plot_width) = $map_scale =~ /^Ob\S+\/\S+\/\S+\/\S+\/(\S+)$/;
-			}
-		elsif ($map_scale =~ /^Oc\S+/)
-			{
-			($plot_width) = $map_scale =~ /^Oc\S+\/\S+\/\S+\/\S+\/(\S+)$/;
-			}
-		$use_width = 1;
-		}
-
-	# Equidistant Cylindrical Projection
-	elsif ($projection eq "q")
-		{
-		($plot_scale) = $map_scale =~ /^q\S+\/(\S+)$/;
-		$use_scale = 1;
-		}
-	elsif ($projection eq "Q")
-		{
-		($plot_width) = $map_scale =~ /^Q\S+\/(\S+)$/;
-		$use_width = 1;
-		}
-
-	# Transverse Mercator Projection
-	elsif ($projection eq "t")
-		{
-		($plot_scale) = $map_scale =~ /^t\S+\/(\S+)$/;
-		$use_scale = 1;
-		}
-	elsif ($projection eq "T")
-		{
-		($plot_width) = $map_scale =~ /^T\S+\/(\S+)$/;
-		$use_width = 1;
-		}
-
-	# Universal Transverse Mercator Projection
-	elsif ($projection eq "u")
-		{
-		($plot_scale) = $map_scale =~ /^u\S+\/(\S+)$/;
-		$use_scale = 1;
-		}
-	elsif ($projection eq "U")
-		{
-		($plot_width) = $map_scale =~ /^U\S+\/(\S+)$/;
-		$use_width = 1;
-		}
-
-	# Basic Cylindrical Projection
-	elsif ($projection eq "y")
-		{
-		($plot_scale) = $map_scale =~ /^y\S+\/\S+\/(\S+)$/;
-		$use_scale = 1;
-		}
-	elsif ($projection eq "Y")
-		{
-		($plot_width) = $map_scale =~ /^Y\S+\/\S+\/(\S+)$/;
-		$use_width = 1;
-		}
-
-	# Lambert Azimuthal Projection
-	elsif ($projection eq "a")
-		{
-		($plot_scale) = $map_scale =~ /^a\S+\/\S+\/(\S+)$/;
-		$use_scale = 1;
-		$trial_value = "1:1";
-		$use_ratio = 1;
-		}
-	elsif ($projection eq "A")
-		{
-		($plot_width) = $map_scale =~ /^A\S+\/\S+\/(\S+)$/;
-		$use_width = 1;
-		}
-
-	# Equidistant Projection
-	elsif ($projection eq "e")
-		{
-		($plot_scale) = $map_scale =~ /^e\S+\/\S+\/(\S+)$/;
-		$use_scale = 1;
-		$trial_value = "1:1";
-		$use_ratio = 1;
-		}
-	elsif ($projection eq "E")
-		{
-		($plot_width) = $map_scale =~ /^E\S+\/\S+\/(\S+)$/;
-		$use_width = 1;
-		}
-
-	# Orthographic Projection
-	elsif ($projection eq "g")
-		{
-		($plot_scale) = $map_scale =~ /^g\S+\/\S+\/(\S+)$/;
-		$use_scale = 1;
-		$trial_value = "1:1";
-		$use_ratio = 1;
-		}
-	elsif ($projection eq "G")
-		{
-		($plot_width) = $map_scale =~ /^G\S+\/\S+\/(\S+)$/;
-		$use_width = 1;
-		}
-
-	# General Sterographic Projection
-	elsif ($projection eq "s")
-		{
-		($plot_scale) = $map_scale =~ /^s\S+\/\S+\/(\S+)$/;
-		$use_scale = 1;
-		$trial_value = "1:1";
-		$use_ratio = 1;
-		}
-	elsif ($projection eq "S")
-		{
-		($plot_width) = $map_scale =~ /^S\S+\/\S+\/(\S+)$/;
-		$use_width = 1;
-		}
-
-	# Albers Projection
-	elsif ($projection eq "b")
-		{
-		($plot_scale) = $map_scale =~ /^b\S+\/\S+\/\S+\/\S+\/(\S+)$/;
-		$use_scale = 1;
-		}
-	elsif ($projection eq "B")
-		{
-		($plot_width) = $map_scale =~ /^B\S+\/\S+\/\S+\/\S+\/(\S+)$/;
-		$use_width = 1;
-		}
-
-	# Lambert Conic Projection
-	elsif ($projection eq "l")
-		{
-		($plot_scale) = $map_scale =~ /^l\S+\/\S+\/\S+\/\S+\/(\S+)$/;
-		$use_scale = 1;
-		}
-	elsif ($projection eq "L")
-		{
-		($plot_width) = $map_scale =~ /^L\S+\/\S+\/\S+\/\S+\/(\S+)$/;
-		$use_width = 1;
-		}
-
-	# Hammer Projection
-	elsif ($projection eq "h")
-		{
-		($plot_scale) = $map_scale =~ /^h\S+\/(\S+)$/;
-		$use_scale = 1;
-		}
-	elsif ($projection eq "H")
-		{
-		($plot_width) = $map_scale =~ /^H\S+\/(\S+)$/;
-		$use_width = 1;
-		}
-
-	# Sinusoidal Projection
-	elsif ($projection eq "i")
-		{
-		($plot_scale) = $map_scale =~ /^i\S+\/(\S+)$/;
-		$use_scale = 1;
-		}
-	elsif ($projection eq "I")
-		{
-		($plot_width) = $map_scale =~ /^I\S+\/(\S+)$/;
-		$use_width = 1;
-		}
-
-	# Eckert VI Projection
-	elsif ($projection eq "k")
-		{
-		($plot_scale) = $map_scale =~ /^k\S+\/(\S+)$/;
-		$use_scale = 1;
-		}
-	elsif ($projection eq "K")
-		{
-		($plot_width) = $map_scale =~ /^K\S+\/(\S+)$/;
-		$use_width = 1;
-		}
-
-	# Robinson Projection
-	elsif ($projection eq "n")
-		{
-		($plot_scale) = $map_scale =~ /^n\S+\/(\S+)$/;
-		$use_scale = 1;
-		}
-	elsif ($projection eq "N")
-		{
-		($plot_width) = $map_scale =~ /^N\S+\/(\S+)$/;
-		$use_width = 1;
-		}
-
-	# Winkel Tripel Projection
-	elsif ($projection eq "r")
-		{
-		($plot_scale) = $map_scale =~ /^r\S+\/(\S+)$/;
-		$use_scale = 1;
-		}
-	elsif ($projection eq "R")
-		{
-		($plot_width) = $map_scale =~ /^R\S+\/(\S+)$/;
-		$use_width = 1;
-		}
-
-	# Mollweide Projection
-	elsif ($projection eq "w")
-		{
-		($plot_scale) = $map_scale =~ /^w\S+\/(\S+)$/;
-		$use_scale = 1;
-		}
-	elsif ($projection eq "W")
-		{
-		($plot_width) = $map_scale =~ /^W\S+\/(\S+)$/;
-		$use_width = 1;
-		}
-
-	# Linear Polar Projection
-	elsif ($projection eq "p")
-		{
-		($plot_scale) = $map_scale =~ /^p(\S+)$/;
-		$use_scale = 1;
-		$separator = "";
-		}
-	elsif ($projection eq "P")
-		{
-		($plot_width) = $map_scale =~ /^P(\S+)$/;
-		$use_width = 1;
-		$separator = "";
-		}
-
-	# Linear Projection
-	elsif ($projection eq "x")
-		{
-		if ($map_scale =~ /^xd$/)
-			{
-			$geographic = 1;
-			chop($map_scale);
-			}
-		else
-			{
-			($plot_scale) = $map_scale =~ /^x(\S+)$/;
-			}
-		$use_scale = 1;
-		$separator = "";
-		}
-	elsif ($projection eq "X")
-		{
-		if ($map_scale =~ /^Xd$/)
-			{
-			$geographic = 1;
-			chop($map_scale);
-			}
-		else
-			{
-			($plot_width) = $map_scale =~ /^X(\S+)$/;
-			}
-		$use_width = 1;
-		$separator = "";
-		}
-
-}
-#-----------------------------------------------------------------------
-sub GetBaseTick {
-
-	# figure out some reasonable tick intervals for the basemap
-	$base_tick_x = ($xmax - $xmin) / 3;
-	$base_tick_y = ($ymax - $ymin) / 3;
-	$base_tick = &min($base_tick_x, $base_tick_y);
-	if ($base_tick < 0.0002777777)
-		{
-		$base_tick = "1s";
-		}
-	elsif ($base_tick < 0.0005555555)
-		{
-		$base_tick = "2s";
-		}
-	elsif ($base_tick < 0.0013888889)
-		{
-		$base_tick = "5s";
-		}
-	elsif ($base_tick < 0.0027777778)
-		{
-		$base_tick = "10s";
-		}
-	elsif ($base_tick < 0.0041666667)
-		{
-		$base_tick = "15s";
-		}
-	elsif ($base_tick < 0.0083333333)
-		{
-		$base_tick = "30s";
-		}
-	elsif ($base_tick < 0.0166667)
-		{
-		$base_tick = "1m";
-		}
-	elsif ($base_tick < 0.0333333)
-		{
-		$base_tick = "2m";
-		}
-	elsif ($base_tick < 0.0833333)
-		{
-		$base_tick = "5m";
-		}
-	elsif ($base_tick < 0.1666667)
-		{
-		$base_tick = "10m";
-		}
-	elsif ($base_tick < 0.25)
-		{
-		$base_tick = "15m";
-		}
-	elsif ($base_tick < 0.5)
-		{
-		$base_tick = "30m";
-		}
-	elsif ($base_tick < 1.0)
-		{
-		$base_tick = "1";
-		}
-	elsif ($base_tick < 2.0)
-		{
-		$base_tick = "2";
-		}
-	elsif ($base_tick < 5.0)
-		{
-		$base_tick = "5";
-		}
-	elsif ($base_tick < 10.0)
-		{
-		$base_tick = "10";
-		}
-	elsif ($base_tick < 15.0)
-		{
-		$base_tick = "15";
-		}
-	elsif ($base_tick < 30.0)
-		{
-		$base_tick = "30";
-		}
-	elsif ($base_tick < 30.0)
-		{
-		$base_tick = "30";
-		}
-	elsif ($base_tick < 360.0)
-		{
-		$base_tick = "60";
-		}
-
-}
-#-----------------------------------------------------------------------
-# This version of Getopts has been augmented to support multiple
-# calls to the same option. If an arg in argumentative is followed
-# by "+" rather than ":",  then the corresponding scalar will
-# be concatenated rather than overwritten by multiple calls to
-# the same arg.
-#
-# Usage:
-#      do Getopts('a:b+c'); # -a takes arg, -b concatenates args,
-#			    # -c does not take arg. Sets opt_* as a
-#                           # side effect.
-
-sub MBGetopts {
-    local($argumentative) = @_;
-    local(@args,$_,$first,$rest);
-    local($errs) = 0;
-
-    @args = split( / */, $argumentative );
-    while(@ARGV && ($_ = $ARGV[0]) =~ /^-(.)(.*)/) {
-	($first,$rest) = ($1,$2);
-	$pos = index($argumentative,$first);
-	if($pos >= $[) {
-	    if($args[$pos+1] eq ':') {
-		shift(@ARGV);
-		if($rest eq '') {
-		    ++$errs unless @ARGV;
-		    $rest = shift(@ARGV);
-		}
-		eval "\$opt_$first = \$rest;";
-		eval "\$flg_$first = 1;";
-	    }
-	    elsif($args[$pos+1] eq '+') {
-		shift(@ARGV);
-		if($rest eq '') {
-		    ++$errs unless @ARGV;
-		    $rest = shift(@ARGV);
-		}
-		if (eval "\$opt_$first") {
-		    eval "\$opt_$first = \$opt_$first
-				. \":\" . \$rest;";
-		}
-		else {
-		    eval "\$opt_$first = \$rest;";
-		}
-		eval "\$flg_$first = 1;";
-	    }
-	    elsif($args[$pos+1] eq '%') {
-		shift(@ARGV);
-		if($rest ne '') {
-		    eval "\$opt_$first = \$rest;";
-		}
-		else {
-		    $rest = $ARGV[0];
-		    ($one) = $rest =~ /^-(.).*/;
-		    $pos = index($argumentative,$one);
-		    if(!$one || $pos < $[) {
-			eval "\$opt_$first = \$rest;";
-			shift(@ARGV);
-		    }
-		}
-		eval "\$flg_$first = 1;";
-	    }
-	    else {
-		eval "\$opt_$first = 1";
-		eval "\$flg_$first = 1;";
-		if($rest eq '') {
-		    shift(@ARGV);
-		}
-		else {
-		    $ARGV[0] = "-$rest";
-		}
-	    }
-	}
-	else {
-	    print STDERR "Unknown option: $first\n";
-	    ++$errs;
-	    if($rest ne '') {
-		$ARGV[0] = "-$rest";
-	    }
-	    else {
-		shift(@ARGV);
-	    }
-	}
-    }
-    $errs == 0;
-}
-#-----------------------------------------------------------------------
diff --git a/src/macros/mbm_rollerror b/src/macros/mbm_rollerror
deleted file mode 100755
index 56ab53e..0000000
--- a/src/macros/mbm_rollerror
+++ /dev/null
@@ -1,205 +0,0 @@
-#!/usr/bin/env perl
-#--------------------------------------------------------------------
-#    The MB-system:	mbm_rollover.perl	6/18/93
-#    $Id: mbm_rollerror 2227 2015-02-05 21:12:31Z caress $
-#
-#    Copyright (c) 1993-2015 by
-#    D. W. Caress (caress at mbari.org)
-#      Monterey Bay Aquarium Research Institute
-#      Moss Landing, CA
-#    and D. N. Chayes (dale at lamont.ldgo.columbia.edu)
-#      Lamont-Doherty Earth Observatory
-#      Palisades, NY  10964
-#
-#    See README file for copying and redistribution conditions.
-#--------------------------------------------------------------------
-#
-# Command:
-#   mbm_rollover
-#
-# Purpose:
-#   Perl shellscript to read a multibeam bathymetry file, calculate the
-#   noise in the vertical reference used by the sonar, and generate
-#   a file containing roll corrections which can be applied to the
-#   data.
-#
-# Usage:
-#   mbm_rollover -Fformat -Wfilterwidth -Ifile
-#
-# Author:
-#   David W. Caress
-#   Lamont-Doherty Earth Observatory
-#   Palisades, NY  10964
-#   June 13, 1993
-#
-# Version:
-#   $Id: mbm_rollerror 2227 2015-02-05 21:12:31Z caress $
-#
-# Revisions:
-#   $Log: mbm_rollerror.perl,v $
-#   Revision 5.2  2003/04/17 20:42:48  caress
-#   Release 5.0.beta30
-#
-#   Revision 5.1  2001/03/22 21:05:45  caress
-#   Trying to make release 5.0.beta0
-#
-# Revision 5.0  2000/12/01  22:58:01  caress
-# First cut at Version 5.0.
-#
-# Revision 4.6  2000/10/03  21:42:17  caress
-# Snapshot for Dale.
-#
-# Revision 4.5  1997/04/21  16:54:41  caress
-# MB-System 4.5 Beta Release.
-#
-# Revision 4.4  1995/09/28  18:05:43  caress
-# Various bug fixes working toward release 4.3.
-#
-# Revision 4.4  1995/09/28  18:05:43  caress
-# Various bug fixes working toward release 4.3.
-#
-# Revision 4.3  1995/08/17  14:52:53  caress
-# Revision for release 4.3.
-#
-# Revision 4.2  1995/05/12  17:43:23  caress
-# Made exit status values consistent with Unix convention.
-# 0: ok  nonzero: error
-#
-# Revision 4.1  1994/10/21  11:36:58  caress
-# Release V4.0
-#
-# Revision 4.0  1994/03/05  23:52:40  caress
-# First cut at version 4.0
-#
-# Revision 4.1  1994/03/03  04:11:13  caress
-# Fixed copyright message.
-#
-# Revision 4.0  1994/02/26  19:37:57  caress
-# First cut at new version.
-#
-# Revision 3.3  1993/08/17  16:58:36  caress
-# Set location of perl to /usr/local/bin/perl
-#
-# Revision 3.2  1993/08/17  01:52:17  caress
-# Added MB-system header.
-#
-#
-# Deal with command line arguments
-&Getopts('I:i:F:f:W:w:');
-$file =        ($opt_I || $opt_i);
-$format =      ($opt_F || $opt_f);
-$filterwidth = ($opt_W || $opt_w);
-
-# get format if needed
-if (!$format)
-	{
-	$line = `mbformat -I $file -L`;
-	($format) = $line =~ /(\S+)/;
-	if ($format == 0)
-		{
-		$format = -1;
-		}
-	}
-
-# set filterwidth if needed
-if (!$filterwidth)
-	{
-	$filterwidth = 60;
-	}
-
-print "file: ",$file,"\n";
-print "format: ",$format,"\n";
-$file || die "Input file not specified...\nMBM_ROLLERROR aborted.\n";
-
-# Get filenames in order...
-$datfile = "mbm_rollerror$$.dat";
-$fltfile = "mbm_rollerror$$.flt";
-$corfile = "$file.cor";
-
-# Get going.
-print "Macro mbm_rollerror running...\n\n";
-print "Running mblist...\n";
-`mblist -F$format -I$file -OMA > $datfile`;
-
-# Filter the seafloor slope data.
-print "Running filter1d...\n";
-`filter1d $datfile -Fc$filterwidth -E -V > $fltfile`;
-
-# Read the data and filtered data files,
-# subtracting to get the high-passed signal.
-print "Processing raw and filtered data to get residual...\n";
-open(F1,"$datfile");
-open(F2,"$fltfile");
-open(FOUT,"> $corfile");
-while ($line1 = <F1>)
-	{
-	($time1, $dat) = $line1 =~ /(\S+)\s(\S+)/;
-	$line2 = <F2>;
-	($time2, $flt) = $line2 =~ /(\S+)\s(\S+)/;
-	$res = $dat - $flt;
-	print FOUT $time1,"\t",$res,"\n";
-	}
-close(F1);
-close(F2);
-close(FOUT);
-
-# remove excess files
-`rm -f $datfile $fltfile`;
-
-# Announce success whether it is deserved or not.
-print "All done!\n";
-exit 0;
-
-#-----------------------------------------------------------------------
-# This should be loaded from the library but the shipboard installation
-# of Perl is screwed up so....
-#
-;# getopts.pl - a better getopt.pl
-
-;# Usage:
-;#      do Getopts('a:bc');  # -a takes arg. -b & -c not. Sets opt_* as a
-;#                           #  side effect.
-
-sub Getopts {
-    local($argumentative) = @_;
-    local(@args,$_,$first,$rest);
-    local($errs) = 0;
-
-    @args = split( / */, $argumentative );
-    while(@ARGV && ($_ = $ARGV[0]) =~ /^-(.)(.*)/) {
-	($first,$rest) = ($1,$2);
-	$pos = index($argumentative,$first);
-	if($pos >= $[) {
-	    if($args[$pos+1] eq ':') {
-		shift(@ARGV);
-		if($rest eq '') {
-		    ++$errs unless @ARGV;
-		    $rest = shift(@ARGV);
-		}
-		eval "\$opt_$first = \$rest;";
-	    }
-	    else {
-		eval "\$opt_$first = 1";
-		if($rest eq '') {
-		    shift(@ARGV);
-		}
-		else {
-		    $ARGV[0] = "-$rest";
-		}
-	    }
-	}
-	else {
-	    print STDERR "Unknown option: $first\n";
-	    ++$errs;
-	    if($rest ne '') {
-		$ARGV[0] = "-$rest";
-	    }
-	    else {
-		shift(@ARGV);
-	    }
-	}
-    }
-    $errs == 0;
-}
-
-1;
diff --git a/src/macros/mbm_route2mission b/src/macros/mbm_route2mission
deleted file mode 100755
index e4b309f..0000000
--- a/src/macros/mbm_route2mission
+++ /dev/null
@@ -1,2711 +0,0 @@
-#!/usr/bin/env perl
-#--------------------------------------------------------------------
-#    The MB-system: mbm_route2mission.perl   7/18/2004
-#    $Id: mbm_route2mission 2238 2015-04-15 06:00:52Z caress $
-#
-#    Copyright (c) 2004-2015 by
-#    D. W. Caress (caress at mbari.org)
-#      Monterey Bay Aquarium Research Institute
-#      Moss Landing, CA
-#    and D. N. Chayes (dale at lamont.ldgo.columbia.edu)
-#      Lamont-Doherty Earth Observatory
-#      Palisades, NY  10964
-#
-#    See README file for copying and redistribution conditions.
-#--------------------------------------------------------------------
-#
-# Command:
-#   mbm_route2mission
-#
-# Purpose:
-#   Perl shellscript to translate survey route file derived from
-#   MBgrdviz into an MBARI AUV mission script. Developed for use
-#   in survey planning for the MBARI Mapping AUV.
-#
-# Usage:
-#   mbm_route2mission -Iroutefile [-Aaltitudemin/altitudeabort[/altitudedesired]
-#                     -Bbehavior1/behavior2/behavior3/behavior4
-#                     -Ddepthmax/depthabort[/depthdescent]
-#                     -Fforwarddistance -Ggpsmode -M[sensors] -Omissionfile
-#                     -P[startdistance | startlon/startlat] -Sspeed -Tstarttime -Wwaypointspacing -V -H]
-#
-#
-# Author:
-#   David W. Caress
-#      Monterey Bay Aquarium Research Institute
-#      Moss Landing, CA
-#
-# Version:
-# $Id: mbm_route2mission 2238 2015-04-15 06:00:52Z caress $
-#
-# Revisions:
-#
-#
-$program_name = "mbm_route2mission";
-
-# Definition of waypoint values:
-#     0 = NONE (not a waypoint, just an interpolated point along a line between waypoints)
-#     1 = SIMPLE
-#     2 = TRANSIT
-#     3 = STARTLINE
-#     4 = ENDLINE
-#     5 = STARTLINE2
-#     6 = ENDLINE2
-#     7 = STARTLINE3
-#     8 = ENDLINE3
-#     9 = STARTLINE4
-#     10 = ENDLINE4
-#     11 = STARTLINE5
-#     12 = ENDLINE5
-
-# Definition of gps modes:
-#     0 = Do GPS fix at surface at start and end of missions only
-#     1 = Also do GPS fix at surface at each line start (waypoint = 3)
-#     2 = Also do GPS fix at surface at each line end (waypoint = 4)
-#     3 = Also do GPS fix at surface at each line start and end (waypoint = 3 || 4)
-
-# Derivation of timeout duration values
-#     Use 3.0 * expected duration for waypoint behaviors
-#     Use 1.3 * expected duration the mission as a whole
-#     Abort time must not be greater than battery life of 8 hours = 28800 seconds
-$durationfactorwaypoint = 3.0;
-$durationfactormission = 1.3;
-$durationmax = 28800;
-$batterylife = 64800; # 18 hours
-$safetymargin = 1800;
-
-# set defaults
-
-# route name
-$routename = "Survey";
-
-# altitude controls
-$altitudemin = 50.0;
-$altitudeabort = 25.0;
-$altitudedesired = $altitudemin;
-$altitudedesired2 = $altitudemin;
-$altitudedesired3 = $altitudemin;
-$deltadepthrestart = $altitudemin - $altitudeabort;
-
-# constant depth controls
-$depthconstant = 50.0;
-$depthconstant2 = 50.0;
-
-# speed
-$ascentdescent_speed = 1.5;
-$survey_speed = 1.5;
-$transit_speed = 1.5;
-
-# behavior gps
-$gpsminhits = 10; # used to be 30, but vehicle started to time out and abort 3/20/2008
-$gpsduration = 600;
-$gpsmode = 0;
-
-# behavior setpoint
-$setpointtime = 30;
-
-# behavior descend
-$descendpitch = -35;
-$descendrudder = 2;
-$descentdepth = 3.0;
-$initialdescendtime = 300;
-
-# behavior ascend
-$ascendrudder = 3;
-$ascendpitch = 45;
-$ascendenddepth = 2;
-
-# behavior reson
-$resonduration = 6;
-$sonaraltitudemax = 100.0;
-$mb_pingrate = 3.0;
-$mb_transmitgain = 220.0;
-$mb_receivegain = 75.0;
-$mb_minrangefraction = 0.2;
-$mb_maxrangefraction = 3.5;
-$mb_pulsewidth = 0.000060;
-$resongainsetcount = 0;
-$mb_snippetmode = 1;
-
-# behavior delta_t
-$deltat_duration  = RESON_DURATION;
-$deltat_receiveGain = 10;  # Range is 1 to 20dB
-$deltat_gainEq = 0;   # Gain equalization (0=Off, 1=On)
-$deltat_range = 100;  # Set sonar range (1 to 150m)
-$deltat_nBeams = 120;  # Number of sonar beams (120, 240, or 480)
-$deltat_beamWidth = 1;   # Beam width (0=Wide, 1=Normal, 2=Narrow, 3=NarrowMixed)
-$deltat_sectorSize = 120;  # Size of wedge around nadir (30, 60, 90, 120degrees)
-$deltat_averaging = 0;  # Number of shots to average (0,1=>Off, 3, 5, or 7 shots)
-
-# camera control - each sample period = 0.2 seconds so ($nsampleperiods = 10) == 2 seconds
-$nsampleperiods = 10;
-
-# behavior waypoint, waypoint_depth and waypoint_wall
-
-# Behavior defines
-$behaviorarg = -1;
-$behaviorWaypointID = 0;
-$behaviorWaypointDepthID = 1;
-$behaviorWaypointWallID = 2;
- at behaviorNames = ("Waypoint", "WaypointDepth", "WaypointWall");
- at behaviorIDs = ($behaviorWaypointDepthID, $behaviorWaypointDepthID, $behaviorWaypointDepthID, $behaviorWaypointDepthID, $behaviorWaypointDepthID);
-$depthmax = 5900.0;
-$depthabort = 6000.0;
-$maxclimbslope = 0.5734;
-
-# spiral descent approach depth
-$approachdepth = 50.0;
-
-# assumed ascent and descent rate
-$ascendrate = 1.0; # m/s
-$descendrate = 0.417; # m/s
-
-#$forwarddist = 0;
-$waypointdist = 200.0;
-$maxclimbrate = 25;
-$DTR  = 3.1415926 / 180.0;
-$maxslope = sin($DTR * $maxclimbrate) / cos($DTR * $maxclimbrate);
-
-# Deal with command line arguments
-&MBGetopts('A:a:B:b:C:c:D:d:F:f:G:g:HhI:i:J:j:L%l%M%mN%n%O:o:P:p:R:r:S:s:T:t:U:u:W:w:V*v*Zz');
-$altitudearg =		($opt_A || $opt_a);
-$behaviorarg =		($opt_B || $opt_b);
-$aborttime = 		($opt_C || $opt_c);
-$deptharg =		($opt_D || $opt_d);
-$forwarddist =		($opt_F || $opt_f);
-$gpsmode =		($opt_G || $opt_g || $gpsmode);
-$help =			($opt_H || $opt_h);
-$routefile =		($opt_I || $opt_i);
-$depthprofilefile =	($opt_J || $opt_j);
-$approachdepth =	($opt_L || $opt_l || $approachdepth);
-$sensor =		($flg_M || $flg_m);
-$sensorarg =		($opt_M || $opt_m);
-$spiraldescent =	($flg_N || $flg_n);
-$spiraldescentarg =	($opt_N || $opt_n);
-$missionfile =		($opt_O || $opt_o);
-$startposition =	($opt_P || $opt_p);
-$multibeamsettings =	($opt_R || $opt_r);
-$speedarg =		($opt_S || $opt_s);
-$starttime =		($opt_T || $opt_t);
-$maxclimbrate =		($opt_U || $opt_u || $maxclimbrate);
-$waypointdist =		($opt_W || $opt_w || $waypointdist);
-$verbose =		($opt_V || $opt_v);
-$outputoff =		($opt_Z || $opt_z);
-
-# print out help message if required
-if ($help) {
-    print "\r\n$program_name:\r\n";
-    print "\nVersion: $Id: mbm_route2mission 2238 2015-04-15 06:00:52Z caress $\r\n";
-    print "\r\nPerl shellscript to translate survey route file derived from \r\n";
-    print "MBgrdviz into an MBARI AUV mission script. Developed for use\r\n";
-    print "in survey planning for the MBARI Mapping AUV.\r\n";
-    print "Usage: mbm_route2mission -Iroutefile \r\n";
-    print "\t\t[-Aaltitudemin/altitudeabort[/altitudedesired1[/altitudedesired2[/altitudedesired3]]] \r\n";
-    print "\t\t-Bbehavior1[/behavior2[/behavior3[/behavior4[/behavior5]]]] \r\n";
-    print "\t\t-Caborttime -Ddepthconstant[/depthconstant2] -Fforwarddistance -Ggpsmode \r\n";
-    print "\t\t-Jdepthprofilefile -Lapproachdepth -M[sonarlist] -N \r\n";
-    print "\t\t-Omissionfile -P[startlon/startlat | startdistance] \r\n";
-    print "\t\t-Rtransmitpower/receivegain[/rangeminfraction[/pulsewidth]] \r\n";
-    print "\t\t-Tstarttime -Umaxclimbrate -Wwaypointspacing -Z -V -H]\r\n";
-    exit 0;
-}
-
-# set debug mode
-if ($verbose > 1)
-	{
-	$debug = 1;
-	}
-
-# get user info
-$user = `whoami`;
-$date = `date`;
-$host = `hostname -s`;
-chop $user;
-chop $date;
-chop $host;
-
-# deal with command line values
-if ($behaviorarg != -1)
-	{
-	if ($behaviorarg =~ /^\S+\/\S+\/\S+\/\S+\/\S+/)
-		{
-		($behaviorIDs[0],$behaviorIDs[1],$behaviorIDs[2],$behaviorIDs[3],$behaviorIDs[4])
-                    = $behaviorarg =~ /^(\S+)\/(\S+)\/(\S+)\/(\S+)\/(\S+)/;
-		}
-	elsif ($behaviorarg =~ /^\S+\/\S+\/\S+\/\S+/)
-		{
-		($behaviorIDs[0],$behaviorIDs[1],$behaviorIDs[2],$behaviorIDs[3])
-                    = $behaviorarg =~ /^(\S+)\/(\S+)\/(\S+)\/(\S+)/;
-                $behaviorIDs[4] = $behaviorIDs[3];
-		}
-	elsif ($behaviorarg =~ /^\S+\/\S+\/\S+/)
-		{
-		($behaviorIDs[0],$behaviorIDs[1],$behaviorIDs[2])
-                    = $behaviorarg =~ /^(\S+)\/(\S+)\/(\S+)/;
-                $behaviorIDs[3] = $behaviorIDs[2];
-                $behaviorIDs[4] = $behaviorIDs[3];
-		}
-	elsif ($behaviorarg =~ /^\S+\/\S+/)
-		{
-		($behaviorIDs[0],$behaviorIDs[1])
-                    = $behaviorarg =~ /^(\S+)\/(\S+)/;
-                $behaviorIDs[2] = $behaviorIDs[1];
-                $behaviorIDs[3] = $behaviorIDs[2];
-                $behaviorIDs[4] = $behaviorIDs[3];
-		}
-	elsif ($behaviorarg =~ /^\S+/)
-		{
-		($behaviorIDs[0])
-                    = $behaviorarg =~ /^(\S+)/;
-                $behaviorIDs[1] = $behaviorIDs[0];
-                $behaviorIDs[2] = $behaviorIDs[1];
-                $behaviorIDs[3] = $behaviorIDs[2];
-                $behaviorIDs[4] = $behaviorIDs[3];
-		}
-        for ($i = 0; $i < 5; $i++)
-                {
-                if ($behaviorIDs[$i] < behaviorWaypointID
-                    || $behaviorIDs[$i] > $behaviorWaypointWallID)
-                    {
-                    $behaviorIDs[$i] = $behaviorWaypointDepthID;
-                    }
-               }
-	}
-if ($altitudearg)
-	{
-	if ($altitudearg =~ /^\S+\/\S+\/\S+\/\S+\/\S+/)
-		{
-		($altitudemin, $altitudeabort, $altitudedesired, $altitudedesired2, $altitudedesired3)
-			= $altitudearg =~ /^(\S+)\/(\S+)\/(\S+)\/(\S+)\/(\S+)/;
-		$deltadepthrestart = $altitudemin - $altitudeabort;
-		}
-	elsif ($altitudearg =~ /^\S+\/\S+\/\S+\/\S+/)
-		{
-		($altitudemin, $altitudeabort, $altitudedesired, $altitudedesired2)
-			= $altitudearg =~ /^(\S+)\/(\S+)\/(\S+)\/(\S+)/;
-		$deltadepthrestart = $altitudemin - $altitudeabort;
-		$altitudedesired3 = $altitudedesired;
-		}
-	elsif ($altitudearg =~ /^\S+\/\S+\/\S+/)
-		{
-		($altitudemin, $altitudeabort, $altitudedesired)
-			= $altitudearg =~ /^(\S+)\/(\S+)\/(\S+)/;
-		$deltadepthrestart = $altitudemin - $altitudeabort;
-		$altitudedesired2 = $altitudedesired;
-		$altitudedesired3 = $altitudedesired;
-		}
-	elsif ($altitudearg =~ /^\S+\/\S+/)
-		{
-		($altitudemin, $altitudeabort)
-			= $altitudearg =~ /^(\S+)\/(\S+)/;
-		$altitudedesired = $altitudemin;
-		$deltadepthrestart = $altitudemin - $altitudeabort;
-		$altitudedesired2 = $altitudedesired;
-		$altitudedesired3 = $altitudedesired;
-		}
-	else
-		{
-		($altitudemin)
-			= $altitudearg =~ /^(\S+)/;
-		$altitudeabort = $altitudemin / 2;
-		$altitudedesired = $altitudemin;
-		$deltadepthrestart = $altitudemin - $altitudeabort;
-		$altitudedesired2 = $altitudedesired;
-		$altitudedesired3 = $altitudedesired;
-		}
-	}
-if ($speedarg)
-	{
-	if ($speedarg =~ /^\S+\/\S+\/\S+/)
-		{
-		($survey_speed, $ascentdescent_speed, $transit_speed)
-			= $speedarg =~ /^(\S+)\/(\S+)\/(\S+)/;
-		}
-	elsif ($speedarg =~ /^\S+\/\S+/)
-		{
-		($survey_speed, $ascentdescent_speed)
-			= $speedarg =~ /^(\S+)\/(\S+)/;
-		}
-	else
-		{
-		($survey_speed)
-			= $speedarg =~ /^(\S+)/;
-		}
-	}
-
-if ($deptharg)
-	{
-	if ($deptharg =~ /^(\S+)\/(\S+)/)
-		{
-		($depthconstant, $depthconstant2)
-			= $deptharg =~ /^(\S+)\/(\S+)/;
-		}
-	elsif ($deptharg =~ /^(\S+)/)
-		{
-		($depthconstant)
-			= $deptharg =~ /^(\S+)/;
-		}
-	}
-
-if ($startposition && $startposition =~ /^(\S+)\/(\S+)/)
-	{
-	($startlon, $startlat)
-		= $startposition =~ /^(\S+)\/(\S+)/;
-	}
-elsif ($startposition)
-	{
-	($startdistance) = $startposition;
-	}
-
-# Set mapping sonar status
-if ($sensorarg =~ /\S*M\S*/)
-	{
-	$mappingsonar = 1;
-	}
-if ($sensorarg =~ /\S*S\S*/)
-	{
-	$mappingsonar = 1;
-	$subbottom = 1;
-	}
-if ($sensorarg =~ /\S*L\S*/)
-	{
-	$mappingsonar = 1;
-	$sidescanlo = 1;
-	}
-if ($sensorarg =~ /\S*H\S*/)
-	{
-	$mappingsonar = 1;
-	$sidescanhi = 1;
-	}
-if ($sensorarg =~ /\S*C\S*/)
-	{
-	$camera = 1;
-	}
-if ($sensorarg =~ /\S*B\S*/)
-	{
-	$mappingsonar = 1;
-	$beamdata = 1;
-	}
-if ($sensorarg =~ /\S*I\S*/)
-	{
-	$deltat = 1;
-	}
-if ($sensor && !$sensorarg)
-	{
-	$mappingsonar = 1;
-	$subbottom = 1;
-	$sidescanlo = 1;
-	$sidescanhi = 1;
-	}
-if ($mappingsonar && $beamdata)
-	{
-	$logmode = 2;
-	}
-elsif ($mappingsonar)
-	{
-	$logmode = 2;
-	}
-elsif ($deltat)
-	{
-	$logmode = 1;
-	}
-if ($spiraldescentarg =~ /\S+/)
-	{
-	($spiraldescentaltitude) = $spiraldescentarg =~ /(\S+)/;
-	}
-elsif ($spiraldescent)
-	{
-	$spiraldescentaltitude = $altitudedesired;
-	}
-if ($multibeamsettings =~ /\S+\/\S+\/\S+\/\S+/)
-	{
-	($mb_transmitgain,$mb_receivegain,$mb_minrangefraction,$mb_maxrangefraction,$pulsewidth)
-			= $multibeamsettings =~ /(\S+)\/(\S+)\/(\S+)\/(\S+)\/(\S+)/;
-	$mb_pulsewidth = $pulsewidth / 1000000.0;
-	}
-elsif ($multibeamsettings =~ /\S+\/\S+\/\S+\/\S+/)
-	{
-	($mb_transmitgain,$mb_receivegain,$mb_minrangefraction,$mb_maxrangefraction)
-			= $multibeamsettings =~ /(\S+)\/(\S+)\/(\S+)\/(\S+)/;
-	}
-elsif ($multibeamsettings =~ /\S+\/\S+\/\S+/)
-	{
-	($mb_transmitgain,$mb_receivegain,$mb_minrangefraction) = $multibeamsettings =~ /(\S+)\/(\S+)\/(\S+)/;
-	}
-elsif ($multibeamsettings =~ /\S+\/\S+/)
-	{
-	($mb_transmitgain,$mb_receivegain) = $multibeamsettings =~ /(\S+)\/(\S+)/;
-	}
-if ($mappingsonar && $beamdata)
-	{
-	$mb_snippetmode = 0;
-	}
-
-# Open the input file
-open(RFILE,"$routefile") || die "Cannot open input route file: $routefile\r\n$program_name aborted.\r\n";
-if ($routefile =~ /\S+.rte/)
-	{
-	($root) = $routefile =~ /(\S+).rte/;
-	}
-else
-	{
-	$root = $routefile;
-	}
-if (!$missionfile)
-	{
-	$missionfile = "$root.cfg";
-	}
-$waypointfile = "$root" . "_wpt.ste";
-
-# Read in the initial route data
-$cnt = 0;
-while ($line = <RFILE>)
-	{
-	if ($line =~ /^## ROUTENAME/)
-		{
-		($routename) = $line
-			=~ /^## ROUTENAME\s+(\S+)/;
-		}
-	elsif ($line =~ /^## /)
-		{
-#		printf "Comment: $line";
-		}
-	elsif ($line =~ /^> ## STARTROUTE/)
-		{
-#		printf "Route: $line";
-		}
-	elsif ($line =~ /^> ## ENDROUTE/)
-		{
-#		printf "Route: $line";
-		}
-	elsif ($line =~ /(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)/)
-		{
-		#extract route data
-		($lon, $lat, $topo, $waypoint, $bearing, $distance, $distonbottom, $slope)
-			= $line
-			=~ /(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)/;
-		$output = 0;
-		$length = 0;
-		push(@lons, $lon);
-		push(@lats, $lat);
-		push(@topos, $topo);
-		push(@waypoints, $waypoint);
-		push(@bearings, $bearing);
-		push(@distances, $distance);
-		push(@lengths, $length);
-		push(@distonbottoms, $distonbottom);
-		push(@slopes, $slope);
-		push(@outputs, $output);
-
-		# increment counter
-		$cnt++;
-		}
-	}
-$npoints = $cnt;
-close(RFILE);
-
-# Count waypoints and gps events
-$cnt = 0;
-$nwaypoints = 0;
-$ngpsevents = 0;
-foreach $lon (@lons)
-	{
-
-	# count waypoints
-	if ($waypoints[$cnt] != 0)
-		{
-		$nwaypoints++;
-		}
-
-	# count surface GPS events
-	if (($cnt == 0 || $cnt == $npoints - 1)
-		|| ($waypoints[$cnt] == 3 && $gpsmode == 1)
-		|| ($waypoints[$cnt] == 4 && $gpsmode == 2)
-		|| ($waypoints[$cnt] >= 3 && $gpsmode == 3))
-		{
-		$ngpsevents++;
-		}
-
-	# increment counter
-	$cnt++;
-	}
-
-# Write out the input route data
-if ($debug)
-	{
-	$cnt = 0;
-	foreach $lon (@lons)
-		{
-		# print route data
-		print "$waypoints[$cnt] $lons[$cnt] $lats[$cnt] $topos[$cnt] $bearings[$cnt] $distances[$cnt] $distonbottoms[$cnt] $slopes[$cnt]\r\n";
-
-		# increment counter
-		$cnt++;
-		}
-	}
-
-# calculate the spiral descent depth from first waypoint and desired altitude if needed
-if ($spiraldescent)
-	{
-	$spiraldescentdepth = -$topos[0] - $spiraldescentaltitude - 10.0;
-	}
-
-# Process the route data to generate AUV waypoints that have
-# the desired spacing.
-$distancelastmpoint = 0.0;
-$ilast = 0;
-for ($i = 0; $i < $npoints; $i++)
-	{
-	# first figure out if this is a point to be output
-	$outputs[$i] = 0;
-	if ($waypoints[$i] != 0)
-		{
-		$outputs[$i] = 1;
-		$lengths[$i] = $distances[$i] - $distancelastmpoint;
-
-		if ($i > 0 && $waypoints[$ilast] == 0
-			&& ($distances[$i] - $distancelastmpoint) < 0.75 * $waypointdist)
-			{
-			$outputs[$ilast] = 0;
-			$lengths[$i] += $lengths[$ilast];
-			$lengths[$ilast] = 0.0;
-			}
-		}
-	elsif (($distances[$i] - $distancelastmpoint) >= $waypointdist)
-		{
-		$outputs[$i] = 1;
-		$lengths[$i] = $distances[$i] - $distancelastmpoint;
-		}
-
-	# process points of interest
-	if ($outputs[$i] == 1)
-		{
-
-		# reset distance from last mission point
-		$distancelastmpoint = $distances[$i];
-		$ilast = $i;
-		}
-	}
-
-# Write out the intermediate waypoint data
-if ($debug)
-	{
-	print "\nWaypoint List:\r\n";
-	printf "%d %10.2f %d %d\n",0,$distances[0],$waypoints[0],$outputs[0];
-	$ilast = 0;
-	for ($i = 1; $i < $npoints; $i++)
-		{
-		#print "$i $distances[$i] $waypoints[$i] $outputs[$i]\r\n";
-		printf "%d %10.2f %d %d  %10.2f %10.2f %10.2f",$i,$distances[$i],$waypoints[$i],$outputs[$i],
-		$distances[$i]-$distances[$i-1],$distances[$i]-$distances[$ilast],$lengths[$i];
-		if ($outputs[$i] == 1)
-			{
-			$ilast = $i;
-			print " *****\r\n";
-			}
-		else
-			{
-			print "\r\n";
-			}
-		}
-	}
-
-# Process the route data to generate AUV waypoints that keep the
-# vehicle a safe distance above the bottom.
-$nmissionpoints = 0;
-$lastmode = 0;
-$maxslope = sin($DTR * $maxclimbrate) / cos($DTR * $maxclimbrate);
-for ($i = 0; $i < $npoints; $i++)
-	{
-	# process points of interest
-	if ($outputs[$i] == 1)
-		{
-		# insert points into arrays so they can be printed out last to first
-		# to follow the MBARI AUV mission file convention
-		push(@mwaypoints, $waypoints[$i]);
-		if ($waypoints[$i] == 3 || $waypoints[$i] == 5 || $waypoints[$i] == 7 || $waypoints[$i] == 9)
-			{
-			push(@mstartstops, 1);
-			}
-		elsif ($waypoints[$i] == 4 || $waypoints[$i] == 6 || $waypoints[$i] == 8 || $waypoints[$i] == 10)
-			{
-			push(@mstartstops, 2);
-			}
-		else
-			{
-			push(@mstartstops, 0);
-			}
-		if ($waypoints[$i] == 3 || $waypoints[$i] == 4)
-			{
-			$lastmode = 1;
-			}
-		elsif ($waypoints[$i] == 5 || $waypoints[$i] == 6)
-			{
-			$lastmode = 2;
-			}
-		elsif ($waypoints[$i] == 7 || $waypoints[$i] == 8)
-			{
-			$lastmode = 3;
-			}
-		elsif ($waypoints[$i] == 9 || $waypoints[$i] == 10)
-			{
-			$lastmode = 4;
-			}
-		elsif ($waypoints[$i] == 11 || $waypoints[$i] == 12)
-			{
-			$lastmode = 5;
-			}
-		push(@mmodes, $lastmode);
-
-		push(@mlons, $lons[$i]);
-		push(@mlats, $lats[$i]);
-		push(@mtopos, $topos[$i]);
-		push(@mbearings, $bearings[$i]);
-		push(@mdistances, $distances[$i]);
-		push(@mlengths, $lengths[$i]);
-		$nmissionpoints++;
-
-		# print it out
-		if ($debug)
-			{
-			print "$i $waypoints[$i] $mstartstops[$i] $mmodes[$i] $lons[$i] $lats[$i] $topos[$i] $distances[$i] $bearings[$i]\r\n";
-			}
-#print "$nmissionpoints $waypoints[$i] $lons[$i] $lats[$i] $topos[$i] $distances[$i] $bearings[$i]\r\n";
-		}
-	}
-
-# get local scaling of lon lat to distance
-$C1 = 111412.84;
-$C2 = -93.5;
-$C3 = 0.118;
-$C4 = 111132.92;
-$C5 = -559.82;
-$C6 = 1.175;
-$C7 = 0.0023;
-$DTR = 3.14159265358979323846 / 180.0;
-$radlat = $mlats[0] * DTR;
-$mtodeglat = 1./abs($C4 + $C5*cos(2*$radlat)
-			+ $C6*cos(4*$radlat) + $C7*cos(6*$radlat));
-$mtodeglon = 1./abs($C1*cos($radlat) + $C2*cos(3*$radlat)
-			+ $C3*cos(5*$radlat));
-
-# read depth profile data if specified
-$ndppoints = 0;
-if ($depthprofilefile)
-	{
-	# Open the input file
-	open(RFILE,"$depthprofilefile") || die "Cannot open input depth profile file: $depthprofilefile\r\n$program_name aborted.\r\n";
-
-	# Read in the depth profile data
-	$line = <RFILE>;
-	$line = <RFILE>;
-	while ($line = <RFILE>)
-		{
-		if ($line =~ /(\S+)\s+(\S+)\s+(\S+)\s+(\S+)/)
-			{
-			#extract route data
-			($depth, $altitude, $lon, $lat, $distance)
-				= $line
-				=~ /(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)/;
-			push(@dpdeps, $depth);
-			push(@dpalts, $altitude);
-			push(@dplons, $lon);
-			push(@dplats, $lat);
-			push(@dpdsts, $distance);
-#printf "DEPTH PROFILE: $ndppoints $dplons[$ndppoints] $dplats[$ndppoints] $dpdeps[$ndppoints] $dpalts[$ndppoints] $dpdsts[$ndppoints]\r\n";
-
-			# increment counter
-			$ndppoints++;
-			}
-		}
-	close(RFILE);
-	}
-
-# get safe depth for each mission segment
-for ($i = 0; $i < $nmissionpoints; $i++)
-	{
-	# find shallowest point in look ahead distance
-	$topomax = $mtopos[$i];
-	$topomin = $mtopos[$i];
-# print "TOPO $i $mtopos[$i]\r\n";
-	if ($forwarddist)
-		{
-		for ($j = 0; $j < $npoints; $j++)
-			{
-			$ii = $i - 1;
-			if ($ii < 0)
-				{
-				$ii = 0;
-				}
-			$ddist = $distances[$j] - $mdistances[$ii];
-			if ($ddist > 0.0
-				&& $ddist <= $forwarddist)
-				{
-				if ($topos[$j] > $topomax)
-					{
-					$topomax = $topos[$j];
-					}
-				if ($topos[$j] < $topomin)
-					{
-					$topomin = $topos[$j];
-					}
-				}
-			}
-		}
-	push(@mtopomaxs, $topomax);
-	push(@mtopomins, $topomin);
-# print "topo $topomin $topomax\r\n";
-
-	# if optimal depth profile is available get value
-	if ($ndppoints > 0)
-		{
-		$optimaldepth = 0.0;
-		for ($j = 0; $j < $ndppoints; $j++)
-			{
-			if ($dpdsts[$j] <= $mdistances[$i])
-				{
-				$optimaldepth = $dpdeps[$j];
-				}
-			}
-		push(@moptimaldepths, $optimaldepth);
-		}
-
-	push(@mmissiondepths, $topomax);
-	$ascendtime = -1.2 * $topomax / $ascendrate;
-	$descendtime = -1.2 * $topomax / $descendrate;
-	if ($ascendtime < 300)
-		{
-		$ascendtime = 300;
-		}
-	if ($descendtime < 300)
-		{
-		$descendtime = 300;
-		}
-	push(@ascendtimes, $ascendtime);
-	push(@descendtimes, $descendtime);
-	}
-
-# Calculate time to first waypoint
-if ($startlon && $startlat)
-	{
-	# calculate distance to first point
-	$dx = ($mlons[0] - $startlon) / $mtodeglon;
-	$dy = ($mlats[0] - $startlat) / $mtodeglat;
-	$startdistance = sqrt($dx * $dx + $dy * $dy);
-	}
-elsif ($starttime)
-	{
-	$startdistance = $starttime * $ascentdescent_speed;
-	}
-else
-	{
-	$startdistance = 500.0;
-	}
-
-# calculate first cut depths and abort depth
-$depthabort = 0.0;
-for ($i = 0; $i < $nmissionpoints; $i++)
-	{
-	if ($ndppoints > 0)
-		{
-		$mmissiondepths[$i] = $moptimaldepths[$i];
-#printf "DEPTHS optimal:%f regular:%f\n", $moptimaldepths[$i], -$mtopomaxs[$i] - $altitudedesired;
-		}
-	elsif ($mmodes[$i] == 1)
-		{
-		$mmissiondepths[$i] = -$mtopomaxs[$i] - $altitudedesired;
-#printf "DEPTHS 1 %f\n", $mmissiondepths[$i];
-		}
-	elsif ($mmodes[$i] == 2)
-		{
-		$mmissiondepths[$i] = -$mtopomaxs[$i] - $altitudedesired2;
-#printf "DEPTHS 2 %f\n", $mmissiondepths[$i];
-		}
-	elsif ($mmodes[$i] == 3)
-		{
-		$mmissiondepths[$i] = -$mtopomaxs[$i] - $altitudedesired3;
-#printf "DEPTHS 2 %f\n", $mmissiondepths[$i];
-		}
-	elsif ($mmodes[$i] == 4)
-		{
-		$mmissiondepths[$i] = $depthconstant;
-#printf "DEPTHS 3 %f\n", $mmissiondepths[$i];
-		}
-	elsif ($mmodes[$i] == 5)
-		{
-		$mmissiondepths[$i] = $depthconstant2;
-#printf "DEPTHS 4 %f\n", $mmissiondepths[$i];
-		}
-	else
-		{
-		$mmissiondepths[$i] = -$mtopomaxs[$i] - $altitudedesired;
-#printf "DEPTHS 0 %f\n", $mmissiondepths[$i];
-		}
-	if ($mmissiondepths[$i] < $descentdepth)
-		{
-		$mmissiondepths[$i] = $descentdepth;
-		if (-$mtopomaxs[$i] - $mmissiondepths[$i] <= $altitudeabort)
-			{
-			die "Mission will fail due to altitude abort at mission point $i\r\n\tTopo:$mtopomaxs[$i]\r\nAbort Altitude:$altitudeabort\r\n";
-			}
-		}
-	if ($mmissiondepths[$i] > $depthabort)
-		{
-		$depthabort = $mmissiondepths[$i];
-		}
-	}
-$depthabort = $depthabort + $altitudedesired;
-$depthmax = $depthabort - 0.5 * $altitudemin;
-
-# calculate slopes
-for ($i = $nmissionpoints-1; $i > 0; $i--)
-	{
-	if ($i == 0)
-		{
-		$distance = $startdistance;
-		$slope = 0.0;
-		}
-	else
-		{
-		$distance = $mdistances[$i] - $mdistances[$i-1];
-		$slope = -($mmissiondepths[$i] - $mmissiondepths[$i-1])/$distance;
-		}
-	if ($slope > $maxslope)
-		{
-# print "EXCESSIVE SLOPE: $i $slope Change vehicle depth from $mmissiondepths[$i-1] to ";
-		$mmissiondepths[$i-1] = $mmissiondepths[$i] + $maxslope * $distance;
-# print "$mmissiondepths[$i-1]\r\n";
-		$slope = -($mmissiondepths[$i] - $mmissiondepths[$i-1])/$distance;
-		}
-	}
-
-# Calculate estimated time of mission
-$missiontime = 0.0;
-
-# time from running lines
-$missiontime += $distancelastmpoint / $survey_speed;
-#printf "MISSIONTIME: distance:%f speed:%f time:%f  tottime:%f\n",
-#$distancelastmpoint,$survey_speed,$distancelastmpoint / $survey_speed, $missiontime;
-
-# add time to get to first waypoint
-$missiontime += $startdistance / $ascentdescent_speed;
-#printf "MISSIONTIME: first waypoint distance:%f speed:%f time:%f  tottime:%f\n",
-#$startdistance,$ascentdescent_speed,$startdistance / $ascentdescent_speed, $missiontime;
-
-# add time for initial gps and descent
-#$missiontime += $gpsduration + $initialdescendtime;
-#printf "MISSIONTIME: descent tinme:%f  tottime:%f\n",$initialdescendtime, $missiontime;
-
-# add time for each ascent, gps, descent event
-for ($i = 1; $i < $nmissionpoints - 1; $i++)
-	{
-	if (($gpsmode == 1 && ($mstartstops[$i] == 1))
-			|| ($gpsmode == 2 && ($mstartstops[$i] == 2))
-			|| ($gpsmode == 3 && $mstartstops[$i] > 0))
-		{
-		$missiontime += (-$mmissiondepths[$i] / $ascendrate)
-				+ (-$mmissiondepths[$i] / $descendrate)
-				+ $gpsduration + $initialdescendtime;
-		}
-	}
-
-# add time for final ascent and gps
-$missiontime += ($mmissiondepths[$nmissionpoints - 1] / $ascendrate)
-		+ $gpsduration;
-#printf "MISSIONTIME: ascent time:%f  tottime:%f\n",
-#($mmissiondepths[$nmissionpoints - 1] / $ascendrate)+ $gpsduration, $missiontime;
-
-# if not specified calculate abort time using safety factor of $durationfactormission
-if (!$aborttime)
-	{
-	$aborttime = $durationfactormission * $missiontime;
-	}
-
-# shorten abort time if unsafe
-$ascendtime = $ascendtimes[$nmissionpoints - 1];
-if ($aborttime > $batterylife - $safetymargin - $ascendtime)
-	{
-	$aborttime = $batterylife - $safetymargin - $ascendtime;
-	}
-
-# Print out program info
-if ($outputoff)
-	{
-	printf "Route: $routefile\r\n";
-	printf "Distance: %.0f (m)\r\n", $distancelastmpoint;
-	printf "Time: %d (s)\r\n", $missiontime;
-	}
-elsif ($verbose)
-	{
-	printf "MB-System program $program_name run by\r\n";
-	printf "user <$user> on cpu <$host> at <$date>\r\n";
-	printf "\r\n";
-	printf "Mission Summary:\r\n";
-	printf "    Route File:               $routefile\r\n";
-	if ($depthprofilefile)
-		{
-		printf "    Depth Profile File:       $depthprofilefile\r\n";
-		}
-	printf "    Mission File:             $missionfile\r\n";
-	printf "    Distance:                 %.0f (m)  %.3f (km)\r\n", $distancelastmpoint, 0.001 * $distancelastmpoint;
-	printf "    Estimated Time:           %d (s)  %.3f (hr)\r\n", $missiontime, $missiontime / 3600.0;
-	printf "    Abort Time:               %d (s)\r\n", $aborttime;
-	printf "    Max battery life:         %d (s)\r\n", $batterylife;
-	printf "    Safety margin:            %d (s)\r\n", $safetymargin;
-	printf "    Ascend time:              %d (s)\r\n", $ascendtime;
-	printf "    Way Points:               $nwaypoints\r\n";
-	printf "    Route Points:             $nmissionpoints\r\n";
-	printf "    Survey Behaviors:\r\n";
-        for ($i = 0; $i < 5; $i++)
-                {
-                printf "         Behavior for waypoint mode $i:   $behaviorNames[$behaviorIDs[$i]]\r\n";
-                }
- 	if ($spiraldescent)
-		{
-		printf "    Descent style:            Spiral descent\r\n";
-		}
-	else
-		{
-		printf "    Descent style:            Waypoint descent\r\n";
-		}
-	if ($mappingsonar)
-		{
-		printf "    Mapping sonar control enabled:          \r\n";
-		printf "                               Multibeam enabled\r\n";
-		printf "                                 Multibeam receive gain:           $mb_receivegain dB\r\n";
-		printf "                                 Multibeam transmit gain:          $mb_transmitgain dB\r\n";
-		printf "                                 Multibeam pulse width:            $mb_pulsewidth usec\r\n";
-		printf "                                 Multibeam minimum range fraction: $mb_minrangefraction\r\n";
-		printf "                                 Multibeam maximum range fraction: $mb_maxrangefraction\r\n";
-		if ($beamdata)
-			{
-			printf "                               Multibeam beam data collection enabled (100 m range)\r\n";
-			}
-		if ($subbottom)
-			{
-			printf "                               Subbottom enabled\r\n";
-			}
-		else
-			{
-			printf "                               Subbottom disabled\r\n";
-			}
-		if ($sidescanlo)
-			{
-			printf "                               Low sidescan enabled\r\n";
-			}
-		else
-			{
-			printf "                               Low sidescan disabled\r\n";
-			}
-		if ($sidescanhi)
-			{
-			printf "                               High sidescan enabled\r\n";
-			}
-		else
-			{
-			printf "                               High sidescan disabled\r\n";
-			}
-		}
-	else
-		{
-		printf "    Mapping sonar control disabled:          \r\n";
-		}
-	if ($camera)
-		{
-		printf "    Benthic imaging camera control enabled:  \r\n";
-		}
-	else
-		{
-		printf "    Benthic imaging camera control disabled: \r\n";
-		}
-	printf "\r\n";
-	printf "Mission Parameters:\r\n";
-	printf "    Vehicle Survey Speed:       %f (m/s) %f (knots)\r\n", $survey_speed, 1.943846 * $survey_speed;
-	printf "    Vehicle Ascent Speed:       %f (m/s) %f (knots)\r\n", $ascentdescent_speed, 1.943846 * $ascentdescent_speed;
-	printf "    Vehicle Transit Speed:      %f (m/s) %f (knots)\r\n", $transit_speed, 1.943846 * $transit_speed;
-	printf "    Minimum Vehicle Altitude 1: $altitudemin (m)\r\n";
-	printf "    Abort Vehicle Altitude 1:   $altitudeabort (m)\r\n";
-	printf "    Delta Depth Restart 1:      $deltadepthrestart (m)\r\n";
-	printf "    Desired Vehicle Altitude 1: $altitudedesired (m)\r\n";
-	printf "    Desired Vehicle Altitude 2: $altitudedesired2 (m)\r\n";
-	printf "    Desired Vehicle Altitude 3: $altitudedesired3 (m)\r\n";
-	printf "    Constant Vehicle Depth 1:   $depthconstant (m)\r\n";
-	printf "    Constant Vehicle Depth 2:   $depthconstant2 (m)\r\n";
-	printf "    Maximum Vehicle Depth:      $depthmax (m)\r\n";
-	printf "    Abort Vehicle Depth:        $depthabort (m)\r\n";
-	printf "    Descent Vehicle Depth:      $descentdepth (m)\r\n";
-	if ($spiraldescent)
-		{
-		printf "    Spiral descent depth:     $spiraldescentdepth m\r\n";
-		printf "    Spiral descent altitude:  $spiraldescentaltitude m\r\n";
-		}
-	if ($forwarddist)
-		{
-		printf "    Forward Looking Distance: $forwarddist (m)\r\n";
-		}
-	printf "    Waypoint Spacing:         $waypointdist (m)\r\n";
-	printf "    Maximum climb rate:       %f degrees  %f ratio\r\n", $maxclimbrate, $maxslope;
-	if ($starttime)
-		{
-		printf "    Time to First Waypoint:   %d (s)\r\n", $starttime;
-		}
-	if ($startposition)
-		{
-		printf "    Start Longitude:          $startlon (deg)\r\n";
-		printf "    Start Latitude:           $startlat (deg)\r\n";
-		}
-	printf "    GPS Duration:             %d (s)\r\n", $gpsduration;
-	printf "    Descend Rate:             $descendrate (m/s)\r\n";
-	printf "    Ascend Rate:              $ascendrate (m/s)\r\n";
-	printf "    Initial descend Duration: %d (s)\r\n", $initialdescendtime;
-	printf "    Setpoint Duration:        %d (s)\r\n", $setpointtime;
-	printf "\r\n";
-	printf "The primary waypoints and selected section points from the route file are:\r\n";
-	printf "  <number> <longitude (deg)> <latitude (deg)> <topography (m)> <distance (m)> <length (m)> <type>\r\n";
-	$cnt = 0;
-	for ($i = 0; $i < $nmissionpoints; $i++)
- 		{
- 		printf "  %4d %11.6f %10.6f %8.3f %8.2f %8.2f %d\r\n",
- 			$i,$mlons[$i],$mlats[$i],$mtopos[$i],$mdistances[$i],$mlengths[$i],$mwaypoints[$i];
- 		}
-	}
-else
-	{
-	printf "MB-System program $program_name run by\r\n";
-	printf "user <$user> on cpu <$host> at <$date>\r\n";
-	printf "\r\n";
-	printf "Mission Summary:\r\n";
-	printf "    Route File:               $routefile\r\n";
-	printf "    Mission File:             $missionfile\r\n";
-	printf "    Distance:                 %.0f (m)  %.3f (km) \r\n", $distancelastmpoint, 0.001 * $distancelastmpoint;
-	printf "    Estimated Time:           %d (s)  %.3f (hr) \r\n", $missiontime, $missiontime / 3600.0;
-	printf "    Abort Time:               %d (s)\r\n", $aborttime;
-	printf "    Max battery life:         %d (s)\r\n", $batterylife;
-	printf "    Safety margin:            %d (s)\r\n", $safetymargin;
-	printf "    Ascend time:              %d (s)\r\n", $ascendtime;
-	printf "    Way Points:               $nwaypoints\r\n";
-	printf "    Route Points:             $nmissionpoints\r\n";
-	}
-
-# output mission file unless outputoff option selected
-if (!$outputoff)
-	{
-	# open the output file
-	open(MFILE,">$missionfile") || die "Cannot open output mission file: $missionfile\r\n$program_name aborted.\r\n";
-	open(WFILE,">$waypointfile") || die "Cannot open output waypoint file: $waypointfile\r\n$program_name aborted.\r\n";
-
-	# output mission file comments
-	printf MFILE "# This MBARI Mapping AUV mission file has been generated\r\n";
-	printf MFILE "# by the MB-System program $program_name run by\r\n";
-	printf MFILE "# user <$user> on cpu <$host> at <$date>\r\n";
-	printf MFILE "# \r\n";
-	printf MFILE "# Program mbm_route2mission version:\r\n";
-	printf MFILE "#     $Id: mbm_route2mission 2238 2015-04-15 06:00:52Z caress $\r\n";
-	printf MFILE "# \r\n";
-	printf MFILE "# Mission Summary:\r\n";
-	printf MFILE "#     Route File:               $routefile\r\n";
-	printf MFILE "#     Mission File:             $missionfile\r\n";
-	printf MFILE "#     Distance:                 $distancelastmpoint (m)\r\n";
-	printf MFILE "#     Estimated Time:           %d (s)  %.3f (hr)\r\n", $missiontime, $missiontime / 3600.0;
-	printf MFILE "#     Abort Time:               %d (s)\r\n", $aborttime;
-	printf MFILE "#     Max battery life:         %d (s)\r\n", $batterylife;
-	printf MFILE "#     Safety margin:            %d (s)\r\n", $safetymargin;
-	printf MFILE "#     Ascend time:              %d (s)\r\n", $ascendtime;
-	printf MFILE "#     Way Points:               $nwaypoints\r\n";
-	printf MFILE "#     Route Points:             $nmissionpoints\r\n";
-	printf MFILE "#     Survey Behaviors:\r\n";
-        for ($i = 0; $i < 5; $i++)
-                {
-                printf MFILE "#          Behavior for waypoint mode $i:   $behaviorNames[$behaviorIDs[$i]]\r\n";
-                }
-	if ($spiraldescent)
-		{
-		printf MFILE "#     Descent style:            Spiral descent\r\n";
-		}
-	else
-		{
-		printf MFILE "#     Descent style:            Waypoint descent\r\n";
-		}
-	if ($mappingsonar)
-		{
-		printf MFILE "#     Mapping sonar control enabled:          \r\n";
-		printf MFILE "#                               Multibeam enabled\r\n";
-		printf MFILE "#                                 Multibeam receive gain:           $mb_receivegain dB\r\n";
-		printf MFILE "#                                 Multibeam transmit gain:          $mb_transmitgain dB\r\n";
-		printf MFILE "#                                 Multibeam pulse width:            $mb_pulsewidth usec\r\n";
-		printf MFILE "#                                 Multibeam minimum range fraction: $mb_minrangefraction\r\n";
-		printf MFILE "#                                 Multibeam maximum range fraction: $mb_maxrangefraction\r\n";
-		if ($beamdata)
-			{
-			printf MFILE "#                               Multibeam beam data collection enabled (100 m range)\r\n";
-			}
-		if ($subbottom)
-			{
-			printf MFILE "#                               Subbottom enabled\r\n";
-			}
-		else
-			{
-			printf MFILE "#                               Subbottom disabled\r\n";
-			}
-		if ($sidescanlo)
-			{
-			printf MFILE "#                               Low sidescan enabled\r\n";
-			}
-		else
-			{
-			printf MFILE "#                               Low sidescan disabled\r\n";
-			}
-		if ($sidescanhi)
-			{
-			printf MFILE "#                               High sidescan enabled\r\n";
-			}
-		else
-			{
-			printf MFILE "#                               High sidescan disabled\r\n";
-			}
-		}
-	else
-		{
-		printf MFILE "#     Mapping sonar control disabled:          \r\n";
-		}
-	if ($camera)
-		{
-		printf MFILE "#     Benthic imaging camera control enabled:  \r\n";
-		}
-	else
-		{
-		printf MFILE "#     Benthic imaging camera control disabled: \r\n";
-		}
-	printf MFILE "# \r\n";
-	printf MFILE "# Mission Parameters:\r\n";
-	printf MFILE "#     Vehicle Survey Speed:       %f (m/s) %f (knots)\r\n", $survey_speed, 1.943846 * $survey_speed;
-	printf MFILE "#     Vehicle Ascent Speed:       %f (m/s) %f (knots)\r\n", $ascentdescent_speed, 1.943846 * $ascentdescent_speed;
-	printf MFILE "#     Vehicle Transit Speed:      %f (m/s) %f (knots)\r\n", $transit_speed, 1.943846 * $transit_speed;
-	printf MFILE "#     Minimum Vehicle Altitude 1: $altitudemin (m)\r\n";
-	printf MFILE "#     Abort Vehicle Altitude 1:   $altitudeabort (m)\r\n";
-	printf MFILE "#     Delta Depth Restart 1:      $deltadepthrestart (m)\r\n";
-	printf MFILE "#     Desired Vehicle Altitude 1: $altitudedesired (m)\r\n";
-	printf MFILE "#     Desired Vehicle Altitude 2: $altitudedesired2 (m)\r\n";
-	printf MFILE "#     Desired Vehicle Altitude 3: $altitudedesired3 (m)\r\n";
-	printf MFILE "#     Constant Vehicle Depth 1:   $depthconstant (m)\r\n";
-	printf MFILE "#     Constant Vehicle Depth 2:   $depthconstant2 (m)\r\n";
-	printf MFILE "#     Maximum Vehicle Depth:      $depthmax (m)\r\n";
-	printf MFILE "#     Abort Vehicle Depth:        $depthabort (m)\r\n";
-	printf MFILE "#     Descent Vehicle Depth:      $descentdepth (m)\r\n";
-	if ($spiraldescent)
-		{
-		printf MFILE "#     Spiral descent depth:       $spiraldescentdepth m\r\n";
-		printf MFILE "#     Spiral descent altitude:    $spiraldescentaltitude m\r\n";
-		}
-	if ($forwarddist)
-		{
-		printf MFILE "#     Forward Looking Distance:   $forwarddist (m)\r\n";
-		}
-	printf MFILE "#     Waypoint Spacing:           $waypointdist (m)\r\n";
-	printf MFILE "#     Maximum climb rate:         $maxclimbrate (degrees)\r\n";
-	if ($starttime)
-		{
-		printf MFILE "#     Time to First Waypoint:     %d (s)\r\n", $starttime;
-		}
-	if ($startposition)
-		{
-		printf MFILE "#     Start Longitude:            $startlon (deg)\r\n";
-		printf MFILE "#     Start Latitude:             $startlat (deg)\r\n";
-		}
-	printf MFILE "#     GPS Duration:               %d (s)\r\n", $gpsduration;
-	printf MFILE "#     Descend Rate:               $descendrate (m/s)\r\n";
-	printf MFILE "#     Ascend Rate:                $ascendrate (m/s)\r\n";
-	printf MFILE "#     Initial descend Duration:   %d (s)\r\n", $initialdescendtime;
-	printf MFILE "#     Setpoint Duration:          %d (s)\r\n", $setpointtime;
-	printf MFILE "# \r\n";
-	printf MFILE "# The primary waypoints from the route file are:\r\n";
-	printf MFILE "#   <number> <longitude (deg)> <latitude (deg)> <topography (m)> <distance (m)> <type>\r\n";
-	$cnt = 0;
-	for ($i = 0; $i < $npoints; $i++)
- 		{
-		if ($waypoints[$i] != 0)
-			{
- 			printf MFILE "#   $cnt $lons[$i] $lats[$i] $topos[$i] $distances[$i] $waypoints[$i]\r\n";
-			$cnt++;
-			}
- 		}
-	printf MFILE "# \r\n";
-	printf MFILE "# A total of %d mission points have been defined.\r\n", $nmissionpoints;
-	printf MFILE "# \r\n";
-	printf MFILE "# Define Mission parameters:\r\n";
-	printf MFILE "#define SURVEY_SPEED               %f\r\n", $survey_speed;
-	printf MFILE "#define ASCENTDESCENT_SPEED        %f\r\n", $ascentdescent_speed;
-	printf MFILE "#define TRANSIT_SPEED              %f\r\n", $transit_speed;
-	printf MFILE "#define MISSION_DISTANCE           %f\r\n", $distancelastmpoint;
-	printf MFILE "#define MISSION_TIMEOUT            %d\r\n", $aborttime;
-	printf MFILE "#define DEPTH_MAX                  %f\r\n", $depthmax;
-	printf MFILE "#define DEPTH_ABORT                %f\r\n", $depthabort;
-	printf MFILE "#define ALTITUDE_DESIRED           %f\r\n", $altitudedesired;
-	printf MFILE "#define ALTITUDE_MIN               %f\r\n", $altitudemin;
-	printf MFILE "#define ALTITUDE_ABORT             %f\r\n", $altitudeabort;
-	printf MFILE "#define DELTA_DEPTH_RESTART        %f\r\n", $deltadepthrestart;
-	printf MFILE "#define ALTITUDE_DESIRED2          %f\r\n", $altitudedesired2;
-	printf MFILE "#define ALTITUDE_DESIRED3          %f\r\n", $altitudedesired3;
-	printf MFILE "#define DEPTH_CONSTANT             %f\r\n", $depthconstant;
-	printf MFILE "#define DEPTH_CONSTANT2            %f\r\n", $depthconstant2;
-	printf MFILE "#define GPS_DURATION               %d\r\n", $gpsduration;
-	printf MFILE "#define DESCENT_DEPTH              %f\r\n", $descentdepth;
-	printf MFILE "#define SPIRAL_DESCENT_DEPTH       %f\r\n", $spiraldescentdepth;
-	printf MFILE "#define SPIRAL_DESCENT_ALTITUDE    %f\r\n", $spiraldescentaltitude;
-	printf MFILE "#define DESCEND_DURATION           %d\r\n", $initialdescendtime;
-	printf MFILE "#define SETPOINT_DURATION          %d\r\n", $setpointtime;
-	printf MFILE "#define GPSMINHITS                 %d\r\n", $gpsminhits;
-	printf MFILE "#define ASCENDRUDDER               %f\r\n", $ascendrudder;
-	printf MFILE "#define ASCENDPITCH                %f\r\n", $ascendpitch;
-	printf MFILE "#define ASCENDENDDEPTH             %f\r\n", $ascendenddepth;
-	printf MFILE "#define DESCENDRUDDER              %f\r\n", $descendrudder;
-	printf MFILE "#define DESCENDPITCH               %f\r\n", $descendpitch;
-	printf MFILE "#define RESON_DURATION             %d\r\n", $resonduration;
-	print MFILE "# \r\n";
-	print MFILE "#######################################################\r\n";
-	print MFILE "# Set Mission Behaviors\r\n";
-	print MFILE "# \r\n";
-	print MFILE "# mission timer set to 120% of estimated time of mission\r\n";
-	print MFILE "behavior missionTimer \r\n";
-	print MFILE "{\r\n";
-	print MFILE "timeOut = MISSION_TIMEOUT;\r\n";
-	print MFILE "}\r\n";
-	print MFILE "# \r\n";
-	print MFILE "# depth envelope\r\n";
-	print MFILE "behavior depthEnvelope \r\n";
-	print MFILE "{\r\n";
-	print MFILE "minDepth      = 0;\r\n";
-	print MFILE "maxDepth      = DEPTH_MAX;\r\n";
-	print MFILE "abortDepth    = DEPTH_ABORT;\r\n";
-	print MFILE "minAltitude   = ALTITUDE_MIN;\r\n";
-	print MFILE "abortAltitude = ALTITUDE_ABORT;\r\n";
-	print MFILE "deltaDepthRestart = DELTA_DEPTH_RESTART;\r\n";
-	print MFILE "}\r\n";
-	print MFILE "#######################################################\r\n";
-	print MFILE "# Set End-of-Mission Behaviors\r\n";
-	print MFILE "# \r\n";
-	print MFILE "# \r\n";
-	print MFILE "# acquire gps fix \r\n";
-	print MFILE "behavior getgps  \r\n";
-	print MFILE "{ \r\n";
-	print MFILE "duration = GPS_DURATION; \r\n";
-	print MFILE "minHits = GPSMINHITS; \r\n";
-	print MFILE "abortOnTimeout = True; \r\n";
-	print MFILE "} \r\n";
-print "Behavior: gps\r\n";
-	print MFILE "# \r\n";
-	print MFILE "# ascend behavior \r\n";
-	print MFILE "behavior ascend  \r\n";
-	print MFILE "{ \r\n";
-	$i = $nmissionpoints - 1;
-	printf MFILE "duration  = %d; \r\n", $ascendtimes[$i];
-	print MFILE "horizontalMode   = rudder; \r\n";
-	print MFILE "horizontal       = ASCENDRUDDER; \r\n";
-	print MFILE "pitch            = ASCENDPITCH; \r\n";
-	print MFILE "speed            = ASCENTDESCENT_SPEED; \r\n";
-	print MFILE "endDepth         = ASCENDENDDEPTH; \r\n";
-	print MFILE "} \r\n";
-print "Behavior: ascend\r\n";
-	print MFILE "# \r\n";
-	print MFILE "# Acoustic update 1 - sent status ping after end of survey \r\n";
-	print MFILE "# \r\n";
-	print MFILE "behavior acousticUpdate \r\n";
-	print MFILE "{ \r\n";
-	print MFILE "duration  = 2; \r\n";
-	print MFILE "dummy  = 1; \r\n";
-	print MFILE "} \r\n";
-	print MFILE "# \r\n";
-print "Behavior: acousticUpdate\r\n";
-	if ($mappingsonar)
-		{
-		print MFILE "# Turn off power to sonars and stop logging on the PLC \r\n";
-		print MFILE "# by setting the value of the mode attribute to 0 (used to be False). \r\n";
-		print MFILE "behavior reson \r\n";
-		print MFILE "{ \r\n";
-		print MFILE "duration  = RESON_DURATION; \r\n";
-		print MFILE "MB_Power = 0; \r\n";
-		print MFILE "SBP_Mode  = 0; \r\n";
-		print MFILE "LoSS_Mode = 0; \r\n";
-		print MFILE "HiSS_Mode = 0; \r\n";
-		print MFILE "Log_Mode  = 0; \r\n";
-		print MFILE "} \r\n";
-print "Behavior: reson (stop, Log_Mode = 0)\r\n";
-		}
-	if ($deltat)
-		{
-		print MFILE "# Turn off power to sonars and stop logging on the PLC \r\n";
-		print MFILE "# by setting the value of the mode attribute to 0 (used to be False). \r\n";
-		print MFILE "behavior delta_t \r\n";
-		print MFILE "{ \r\n";
-		print MFILE "duration  = RESON_DURATION; \r\n";
-		print MFILE "logMode  = 0; \r\n";
-		print MFILE "} \r\n";
-print "Behavior: delta_t (stop, logMode = 0)\r\n";
-		}
-	if ($camera)
-		{
-		$cameraenddistance = $mdistances[$nmissionpoints-1];
-		print MFILE "# Turn off camera imaging \r\n";
-		print MFILE "#   Distance along survey: $mdistances[$nmissionpoints-1]\r\n";
-		print MFILE "behavior stopCamera \r\n";
-		print MFILE "{ \r\n";
-		print MFILE "duration  = 1; \r\n";
-		print MFILE "} \r\n";
-printf "Behavior: stopCamera (distance:%.2f m\n",$mdistances[$nmissionpoints-1];
-		}
-
-	# output mission points in reverse order
-	$iwaypoint = $nwaypoints;
-	for ($i = $nmissionpoints - 1; $i >= 0; $i--)
-		{
-		# figure out which waypoint this is
-		if ($mwaypoints[$i] != 0)
-			{
-			$iwaypoint--;
-			}
-
-		# put comment break in at waypoint
-		if ($mwaypoints[$i] != 0)
-			{
-			print MFILE "#######################################################\r\n";
-			}
-
-		# check depth
-		$maxdepthapplied = 0;
-		if ($mmissiondepths[$i] > $depthmax)
-			{
-			$mmissiondepths[$i] = $depthmax;
-			$maxdepthapplied = 1;
-			}
-		elsif ($mmissiondepths[$i] < $descentdepth)
-			{
-			$mmissiondepths[$i] = $descentdepth;
-			$maxdepthapplied = 0;
-			}
-
-		# get altitude for mapping sonar parameters
-		$sonaraltitude = -$mmissiondepths[$i] - $mtopos[$i];
-		if ($i < $nmissionpoints - 1
-			&& (-$mmissiondepths[$i+1] - $mtopos[$i+1]) > $sonaraltitude)
-			{
-			$sonaraltitude = -$mmissiondepths[$i+1] - $mtopos[$i+1];
-			}
-		if ($sonaraltitude > $sonaraltitudemax)
-			{
-			$sonaraltitudeuse = $sonaraltitudemax;
-			}
-		elsif ($sonaraltitude < $altitudemin)
-			{
-			$sonaraltitudeuse = $altitudemin;
-			}
-		else
-			{
-			$sonaraltitudeuse = $sonaraltitude;
-			}
-
-		# if $mb_maxrangefraction = 3.5 then sonar range allows for 150 degree swath on flat bottom
-		# sonar range cut off at 100 m for recorded full beamformed data
-		$mb_range = $mb_maxrangefraction * $sonaraltitudeuse;
-		if ($mb_range > 200.0)
-			{
-			$mb_range = 200.0;
-			}
-		if ($beamdata && $mb_range > 100.0)
-			{
-			$mb_range = 100.0;
-			}
-		$mb_minrange = $mb_minrangefraction * $sonaraltitudeuse;
-		$mb_maxrange = $mb_range;
-		$mb_mindepth = 0.0;
-		$mb_maxdepth = $mb_range;
-		$sslo_range = 0.9 * 750.0 / $mb_pingrate;
-		if ($sslo_range > 200.0)
-			{
-			$sslo_range = 200.0;
-			}
-		$sbp_duration = 1000.0 * 0.9 / $mb_pingrate;
-		if ($sbp_duration > 300.0)
-			{
-			$sbp_duration = 300.0;
-			}
-
-		# do ascend, gps, descend at line starts and ends if specified
-		if (($iwaypoint != $nwaypoints - 1)
-			&& (($gpsmode == 1 && ($mstartstops[$i] == 1))
-				|| ($gpsmode == 2 && ($mstartstops[$i] == 2))
-				|| ($gpsmode == 3 && ($mstartstops[$i] > 0))))
-			{
-			print MFILE "# \r\n";
-			printf MFILE "# Ascend, gps, descend after reaching waypoint %d at end of line %d\r\n", $iwaypoint, $iwaypoint;
-			if ($mappingsonar)
-				{
-				print MFILE "#######################################################\r\n";
-				print MFILE "# Turn on power to sonars and restart logging on the PLC \r\n";
-				print MFILE "behavior reson \r\n";
-				print MFILE "{ \r\n";
-				print MFILE "Log_Mode  = $logmode; \r\n";
-				print MFILE "duration  = RESON_DURATION; \r\n";
-				print MFILE "MB_Power = $mb_transmitgain; \r\n";
-				if ($subbottom && $mstartstops[$i] == 2)
-					{
-					print MFILE "SBP_Mode = 1; \r\n";
-					print MFILE "SBP_Power = 100.0; \r\n";
-					}
-				elsif ($subbottom && $mstartstops[$i] == 1)
-					{
-					print MFILE "SBP_Mode = 1; \r\n";
-					print MFILE "SBP_Power = 100.0; \r\n";
-					}
-				if ($sidescanlo)
-					{
-					print MFILE "LoSS_Power = 100.0; \r\n";
-					}
-				if ($sidescanhi)
-					{
-					print MFILE "HiSS_Power = 100.0; \r\n";
-					}
-				print MFILE "} \r\n";
-				print MFILE "#######################################################\r\n";
-print "Behavior: reson (start, Log_Mode = $logmode)\r\n";
-				}
-			if ($deltat)
-				{
-				print MFILE "#######################################################\r\n";
-				print MFILE "# Turn on power to sonars and restart logging on the PLC \r\n";
-				print MFILE "behavior delta_t \r\n";
-				print MFILE "{ \r\n";
-				print MFILE "logMode  = $logmode; \r\n";
-				print MFILE "duration  = RESON_DURATION; \r\n";
-				print MFILE "} \r\n";
-				print MFILE "#######################################################\r\n";
-print "Behavior: delta_t (start, logMode = $logmode)\r\n";
-				}
-			if ($camera)
-				{
-				if ($mstartstops[$i] == 1)
-					{
-					$camerarunlength = $cameraenddistance - $mdistances[$i];
-					$nphotos = int (($camerarunlength / $survey_speed) / ($nsampleperiods * 0.2));
-					$nphotos = 0;
-					print MFILE "#######################################################\r\n";
-					print MFILE "# Start taking pictures with camera.\r\n";
-					print MFILE "#   Distance along survey: $mdistances[$i-1]\r\n";
-					print MFILE "#   Length of camera run: $camerarunlength\r\n";
-					print MFILE "#   Number of photos: $nphotos\r\n";
-					print MFILE "behavior startCamera \r\n";
-					print MFILE "{ \r\n";
-					print MFILE "duration  = 1; \r\n";
-					#print MFILE "nPhotos = $nphotos; \r\n";
-					print MFILE "nSamplePeriods = 10; \r\n";
-					print MFILE "} \r\n";
-					print MFILE "# \r\n";
-					print MFILE "#######################################################\r\n";
-printf "Behavior: startCamera (distance:%.2f m, run length:%.2f m, nphotos:%d)\n",
-		$mdistances[$i],$camerarunlength,$nphotos;
-					}
-				else
-					{
-					$cameraenddistance = $mdistances[$i];
-					print MFILE "# Turn off camera imaging \r\n";
-					print MFILE "#   Distance along survey: $mdistances[$i]\r\n";
-					print MFILE "behavior stopCamera \r\n";
-					print MFILE "{ \r\n";
-					print MFILE "duration  = 1; \r\n";
-					print MFILE "} \r\n";
-printf "Behavior: stopCamera (distance:%.2f m\n",$mdistances[$i];
-					}
-				}
-			print MFILE "# Acoustic update 2 - sent status ping before resuming logging \r\n";
-			print MFILE "# \r\n";
-			print MFILE "behavior acousticUpdate \r\n";
-			print MFILE "{ \r\n";
-			print MFILE "duration  = 2; \r\n";
-			print MFILE "dummy  = 1; \r\n";
-			print MFILE "} \r\n";
-			print MFILE "# \r\n";
-print "Behavior: acousticUpdate\r\n";
-			print MFILE "# \r\n";
-			print MFILE "# Descend behavior \r\n";
-			print MFILE "behavior descend  \r\n";
-			print MFILE "{ \r\n";
-			print MFILE "horizontalMode = heading; \r\n";
-			printf MFILE "horizontal      = %f; \r\n", $mbearings[$i];
-			print MFILE "pitch           = DESCENDPITCH; \r\n";
-			print MFILE "speed           = ASCENTDESCENT_SPEED; \r\n";
-			print MFILE "maxDepth        = DESCENT_DEPTH; \r\n";
-			print MFILE "minAltitude     = ALTITUDE_MIN; \r\n";
-			print MFILE "duration        = DESCEND_DURATION; \r\n";
-			print MFILE "} \r\n";
-print "Behavior: descend\r\n";
-			print MFILE "# \r\n";
-			print MFILE "# setpoint on surface to gather momentum \r\n";
-			print MFILE "behavior setpoint \r\n";
-			print MFILE "{ \r\n";
-			print MFILE "duration        = SETPOINT_DURATION; \r\n";
-			printf MFILE "heading         = %f; \r\n", $mbearings[$i];
-			print MFILE "speed           = ASCENTDESCENT_SPEED; \r\n";
-			print MFILE "verticalMode    = pitch; \r\n";
-			print MFILE "pitch           = 0; \r\n";
-			print MFILE "} \r\n";
-print "Behavior: setpoint\r\n";
-			print MFILE "# \r\n";
-			print MFILE "# acquire gps fix \r\n";
-			print MFILE "behavior getgps  \r\n";
-			print MFILE "{ \r\n";
-			print MFILE "duration = GPS_DURATION; \r\n";
-			print MFILE "minHits = GPSMINHITS; \r\n";
-			print MFILE "abortOnTimeout = True; \r\n";
-			print MFILE "} \r\n";
-print "Behavior: gps\r\n";
-			print MFILE "# \r\n";
-			print MFILE "# ascend behavior \r\n";
-			print MFILE "behavior ascend  \r\n";
-			print MFILE "{ \r\n";
-			printf MFILE "duration  = %d; \r\n", $ascendtimes[$i];
-			print MFILE "horizontalMode   = rudder; \r\n";
-			print MFILE "horizontal       = ASCENDRUDDER; \r\n";
-			print MFILE "pitch            = ASCENDPITCH; \r\n";
-			print MFILE "speed            = ASCENTDESCENT_SPEED; \r\n";
-			print MFILE "endDepth         = ASCENDENDDEPTH; \r\n";
-			print MFILE "} \r\n";
-print "Behavior: ascend\r\n";
-			print MFILE "# Acoustic update 3 - sent status ping before ascent \r\n";
-			print MFILE "# \r\n";
-			print MFILE "behavior acousticUpdate \r\n";
-			print MFILE "{ \r\n";
-			print MFILE "duration  = 2; \r\n";
-			print MFILE "dummy  = 1; \r\n";
-			print MFILE "} \r\n";
-			print MFILE "# \r\n";
-print "Behavior: acousticUpdate\r\n";
-
-			print MFILE "# \r\n";
-			if ($mappingsonar)
-				{
-				print MFILE "#######################################################\r\n";
-				print MFILE "# Turn off power to sonars and stop logging on the PLC \r\n";
-				print MFILE "# by setting the value of the mode attribute to 0 (used to be False). \r\n";
-				print MFILE "behavior reson \r\n";
-				print MFILE "{ \r\n";
-				print MFILE "duration  = RESON_DURATION; \r\n";
-				print MFILE "Log_Mode  = 0; \r\n";
-				print MFILE "MB_Power = 0.0; \r\n";
-				if ($subbottom)
-					{
-					print MFILE "SBP_Power = 0.0; \r\n";
-					}
-				if ($sidescanlo)
-					{
-					print MFILE "LoSS_Power = 0.0; \r\n";
-					}
-				if ($sidescanhi)
-					{
-					print MFILE "HiSS_Power = 0.0; \r\n";
-					}
-				print MFILE "} \r\n";
-				print MFILE "#######################################################\r\n";
-print "Behavior: reson (stop, Log_Mode = 0)\r\n";
-				}
-			if ($deltat)
-				{
-				print MFILE "#######################################################\r\n";
-				print MFILE "# Turn off power to sonars and stop logging on the PLC \r\n";
-				print MFILE "# by setting the value of the mode attribute to 0 (used to be False). \r\n";
-				print MFILE "behavior delta_t \r\n";
-				print MFILE "{ \r\n";
-				print MFILE "duration  = RESON_DURATION; \r\n";
-				print MFILE "logMode  = 0; \r\n";
-				print MFILE "} \r\n";
-				print MFILE "#######################################################\r\n";
-print "Behavior: delta_t (stop, logMode = 0)\r\n";
-				}
-			if ($camera)
-				{
-				$cameraenddistance = $mdistances[$i];
-				print MFILE "# Turn off camera imaging \r\n";
-				print MFILE "#   Distance along survey: $mdistances[$i]\r\n";
-				print MFILE "behavior stopCamera \r\n";
-				print MFILE "{ \r\n";
-				print MFILE "duration  = 1; \r\n";
-				print MFILE "} \r\n";
-printf "Behavior: stopCamera (distance:%.2f m\n",$mdistances[$i];
-				}
-			}
-
-		# reset sonar parameters and start logging
-		print MFILE "# \r\n";
-if ($mappingsonar)
-{
-print "mappingsonar:$mappingsonar i:$i mwaypoints[$i]:$mwaypoints[$i] iwaypoint:$iwaypoint\r\n";
-}
-if ($deltat)
-{
-print "deltat:$deltat i:$i mwaypoints[$i]:$mwaypoints[$i] iwaypoint:$iwaypoint\r\n";
-}
-		if ($mappingsonar && $mwaypoints[$i] != 0 && $iwaypoint == 0)
-			{
-			print MFILE "#######################################################\r\n";
-			print MFILE "# Turn Mapping sonars on and start logging.\r\n";
-			print MFILE "# \r\n";
-			print MFILE "behavior reson \r\n";
-			print MFILE "{ \r\n";
-			print MFILE "duration  = RESON_DURATION; \r\n";
-			print MFILE "Log_Mode  = $logmode; \r\n";
-			print MFILE "} \r\n";
-print "Behavior: reson (startup, Log_Mode = $logmode)\r\n";
-			print MFILE "# Set sonar parameters \r\n";
-			print MFILE "#   Waypoint type:            $mwaypoints[$i]\r\n";
-			print MFILE "#   Commanded altitude:       $sonaraltitude\r\n";
-			print MFILE "#   Sonar parameter altitude: $sonaraltitudeuse\r\n";
-			print MFILE "#   Commanded vehicle depth:  $mmissiondepths[$i] \r\n";
-			print MFILE "#   Seafloor depth:           $mtopos[$i]\r\n";
-			print MFILE "# \r\n";
-			print MFILE "behavior reson \r\n";
-			print MFILE "{ \r\n";
-			print MFILE "duration  = RESON_DURATION; \r\n";
-			if ($subbottom && $mstartstops[$i] == 2)
-				{
-				print MFILE "SBP_Mode = 1; \r\n";
-				print MFILE "SBP_Power = 100.0; \r\n";
-print "Behavior: reson (reset, Log_Mode = 0, line  = $iwaypoint, waypoint($i) type = $mwaypoints[$i], SBP off, MBrange:$mb_range MBaltitude:$sonaraltitudeuse)\r\n";
-				}
-			elsif ($subbottom && $mstartstops[$i] == 1)
-				{
-				print MFILE "SBP_Mode = 1; \r\n";
-				print MFILE "SBP_Power = 100.0; \r\n";
-print "Behavior: reson (reset, Log_Mode = 0, line  = $iwaypoint, waypoint($i) type = $mwaypoints[$i], SBP on, MBrange:$mb_range MBaltitude:$sonaraltitudeuse)\r\n";
-				}
-			if ($subbottom)
-				{
-				print MFILE "SBP_Gain = 128.0; \r\n";
-				printf MFILE "SBP_Duration = %.3f; \r\n", $sbp_duration;
-				}
-			if ($sidescanlo)
-				{
-				print MFILE "LoSS_Mode = 1; \r\n";
-				print MFILE "LoSS_Power = 100.0; \r\n";
-				printf MFILE "LoSS_Range = %.2f; \r\n", $sslo_range;
-				}
-			if ($sidescanhi)
-				{
-				print MFILE "HiSS_Mode = 1; \r\n";
-				print MFILE "HiSS_Power = 100.0; \r\n";
-				print MFILE "HiSS_Range = $sslo_range; \r\n";
-				}
-			print MFILE "MB_Power = $mb_transmitgain; \r\n";
-			printf MFILE "MB_Range = %.2f; \r\n", $mb_range;
-			print MFILE "MB_Rate = $mb_pingrate; \r\n";
-			print MFILE "MB_Gain = $mb_receivegain; \r\n";
-			print MFILE "MB_Sound_Velocity = 0.0; \r\n";
-			printf MFILE "MB_Pulse_Width = %f; \r\n", $mb_pulsewidth;
-			printf MFILE "MB_Bottom_Detect_Filter_Min_Range = %.2f; \r\n", $mb_minrange;
-			printf MFILE "MB_Bottom_Detect_Filter_Max_Range = %.2f; \r\n", $mb_maxrange;
-			printf MFILE "MB_Bottom_Detect_Filter_Min_Depth = %.2f; \r\n", $mb_mindepth;
-			printf MFILE "MB_Bottom_Detect_Filter_Max_Depth = %.2f; \r\n", $mb_maxdepth;
-			print MFILE "MB_Bottom_Detect_Range_Mode = 1; \r\n";
-			print MFILE "MB_Bottom_Detect_Depth_Mode = 0; \r\n";
-			print MFILE "Snippet_Mode = $mb_snippetmode; \r\n";
-			print MFILE "Window_Size = 200; \r\n";
-			print MFILE "Log_Mode = 0; \r\n";
-			print MFILE "} \r\n";
-			print MFILE "# \r\n";
-			print MFILE "#######################################################\r\n";
-			}
-		if ($deltat && $mwaypoints[$i] != 0 && $iwaypoint == 0)
-			{
-			print MFILE "#######################################################\r\n";
-			print MFILE "# Turn DeltaT on and start logging.\r\n";
-			print MFILE "# \r\n";
-			print MFILE "behavior delta_t \r\n";
-			print MFILE "{ \r\n";
-			print MFILE "duration  = RESON_DURATION; \r\n";
-			print MFILE "logMode  = $logmode; \r\n";
-			print MFILE "} \r\n";
-print "Behavior: delta_t (startup, logMode = $logmode)\r\n";
-			print MFILE "# Set sonar parameters \r\n";
-			print MFILE "#   Waypoint type:            $mwaypoints[$i]\r\n";
-			print MFILE "#   Commanded altitude:       $sonaraltitude\r\n";
-			print MFILE "#   Sonar parameter altitude: $sonaraltitudeuse\r\n";
-			print MFILE "#   Commanded vehicle depth:  $mmissiondepths[$i] \r\n";
-			print MFILE "#   Seafloor depth:           $mtopos[$i]\r\n";
-			print MFILE "# \r\n";
-			print MFILE "behavior delta_t \r\n";
-			print MFILE "{ \r\n";
-			print MFILE "duration  = RESON_DURATION; \r\n";
-			print MFILE "logMode = 0; \r\n";
-			print MFILE "receiveGain = 10; \r\n";  # Range is 1 to 20dB
-			print MFILE "gainEq = 0; \r\n";   # Gain equalization (0=Off, 1=On)
-			print MFILE "range = 100; \r\n";  # Set sonar range (1 to 150m)
-			print MFILE "nBeams = 120; \r\n";  # Number of sonar beams (120, 240, or 480)
-			print MFILE "beamWidth = 1; \r\n";   # Beam width (0=Wide, 1=Normal, 2=Narrow, 3=NarrowMixed)
-			print MFILE "sectorSize = 120; \r\n";  # Size of wedge around nadir (30, 60, 90, 120degrees)
-			print MFILE "averaging = 0; \r\n";  # Number of shots to average (0,1=>Off, 3, 5, or 7 shots)
-			print MFILE "} \r\n";
-			print MFILE "# \r\n";
-			print MFILE "#######################################################\r\n";
-                        }
-
-                # get behavior for this waypoint
-                if ($i == 0)
-                        {
-                        $behavior = $behaviorWaypointID;
-                        }
-                else
-                        {
-                        $behavior = $behaviorIDs[$mmodes[$i-1] - 1];
-                        }
-
-		# special case of spiral descent at first waypoint
-		if ($spiraldescent && $i == 0)
-			{
-			print MFILE "#######################################################\r\n";
-			print MFILE "# \r\n";
-			print MFILE "# \r\n";
-			print MFILE "# Waypoint behavior to get back to start of line 1\r\n";
-			printf MFILE "#   Segment length %f meters\r\n", $distance;
-			printf MFILE "#   Minimum depth: %f meters looking forward %f meters along route\r\n", -$mtopomaxs[$i], $forwarddist;
-			printf MFILE "#   Maximum depth: %f meters looking forward %f meters along route\r\n", -$mtopomins[$i], $forwarddist;
-			printf MFILE "#   Vehicle depth: %f meters\r\n", $mmissiondepths[$i];
-			print MFILE "behavior waypoint  \r\n";
-			print MFILE "{ \r\n";
-			printf MFILE "latitude     = %f; \r\n", $mlats[$i];
-			printf MFILE "longitude    = %f; \r\n", $mlons[$i];
-			printf MFILE "duration     = %d; \r\n", ($durationfactorwaypoint * (0.5 * $mmissiondepths[$i]) / $ascentdescent_speed);
-			printf MFILE "depth        = %f; \r\n", $mmissiondepths[$i];
-			print MFILE "speed        = ASCENTDESCENT_SPEED; \r\n";
-			print MFILE "} \r\n";
-print "Behavior: waypoint\r\n";
-			print MFILE "# \r\n";
-			print MFILE "# Zero speed hang to allow final nav updates over acoustic modem\r\n";
-			print MFILE "# - must get start survey command over acoustic modem or mission aborts\r\n";
-			print MFILE "behavior StartSurvey  \r\n";
-			print MFILE "{ \r\n";
-			print MFILE "duration     = 300; \r\n";
-			print MFILE "} \r\n";
-print "Behavior: startsurvey\r\n";
-			print MFILE "# \r\n";
-			print MFILE "# Acoustic update 4 - sent status ping at beginning of StartSurvey behavior \r\n";
-			print MFILE "# \r\n";
-			print MFILE "behavior acousticUpdate \r\n";
-			print MFILE "{ \r\n";
-			print MFILE "duration  = 2; \r\n";
-			print MFILE "dummy  = 1; \r\n";
-			print MFILE "} \r\n";
-print "Behavior: acousticUpdate\r\n";
-			print MFILE "# \r\n";
-			print MFILE "# Spiral descend behavior to get to proper depth at start of line 1 \r\n";
-			if ($maxdepthapplied == 0)
-				{
-				printf MFILE "#   Behavior depth of %f meters set by local depth and desired altitude\r\n", $mmissiondepths[$i];
-				}
-			else
-				{
-				printf MFILE "#   Behavior depth of %f meters set to maximum vehicle depth\r\n", $mmissiondepths[$i];
-				}
-			print MFILE "behavior descend  \r\n";
-			print MFILE "{ \r\n";
-			printf MFILE "duration        = %d; \r\n", $descendtimes[$i];
-			print MFILE "horizontalMode   = rudder; \r\n";
-			print MFILE "horizontal       = DESCENDRUDDER; \r\n";
-			print MFILE "pitch            = DESCENDPITCH; \r\n";
-			print MFILE "speed            = ASCENTDESCENT_SPEED; \r\n";
-			print MFILE "maxDepth         = SPIRAL_DESCENT_DEPTH; \r\n";
-			print MFILE "minAltitude      = SPIRAL_DESCENT_ALTITUDE; \r\n";
-			print MFILE "} \r\n";
-			print MFILE "# \r\n";
-print "Behavior: spiral descend\r\n";
-			print MFILE "# Acoustic update 5 - sent status ping after end of line \r\n";
-			print MFILE "# \r\n";
-			print MFILE "behavior acousticUpdate \r\n";
-			print MFILE "{ \r\n";
-			print MFILE "duration  = 2; \r\n";
-			print MFILE "dummy  = 1; \r\n";
-			print MFILE "} \r\n";
-print "Behavior: acousticUpdate\r\n";
-			print MFILE "# \r\n";
-			print MFILE "# Waypoint behavior to get to start of line 1\r\n";
-			printf MFILE "#   Segment length %f meters\r\n", $distance;
-			printf MFILE "#   Minimum depth: %f meters looking forward %f meters along route\r\n", -$mtopomaxs[$i], $forwarddist;
-			printf MFILE "#   Maximum depth: %f meters looking forward %f meters along route\r\n", -$mtopomins[$i], $forwarddist;
-			printf MFILE "#   Vehicle depth: %f meters\r\n", $approachdepth;
-			print MFILE "behavior waypoint  \r\n";
-			print MFILE "{ \r\n";
-			printf MFILE "latitude     = %f; \r\n", $mlats[$i];
-			printf MFILE "longitude    = %f; \r\n", $mlons[$i];
-			printf MFILE "duration     = %d; \r\n", ($durationfactorwaypoint * 500 / $ascentdescent_speed);
-			printf MFILE "depth        = %f; \r\n", $approachdepth;
-			print MFILE "speed        = ASCENTDESCENT_SPEED; \r\n";
-			print MFILE "} \r\n";
-print "Behavior: waypoint\r\n";
-			print WFILE "$mlons[$i] $mlats[$i]\r\n";
-			}
-
-		# output $behaviorWaypointID mission point behavior
-		elsif ($behavior == $behaviorWaypointID)
-			{
-			print MFILE "# \r\n";
-			if ($mwaypoints[$i] != 0 && $iwaypoint == 0)
-				{
-				print MFILE "# Waypoint behavior to get to start of line 1\r\n";
-print "Behavior: waypoint (to start line 1) ";
-				}
-			elsif ($mwaypoints[$i] != 0)
-				{
-				printf MFILE "# Waypoint behavior to get to end of line %d\r\n", $iwaypoint;
-print "Behavior: waypoint (to end line $iwaypoint) ";
-				}
-			else
-				{
-				printf MFILE "# Waypoint behavior during line %d\r\n", $iwaypoint;
-print "Behavior: waypoint (during line $iwaypoint) ";
-				}
-			printf MFILE "#   Segment length %f meters\r\n", $mlengths[$i];
-			printf MFILE "#   Minimum depth: %f meters looking forward %f meters along route\r\n", -$mtopomaxs[$i], $forwarddist;
-			printf MFILE "#   Maximum depth: %f meters looking forward %f meters along route\r\n", -$mtopomins[$i], $forwarddist;
-			printf MFILE "#   Maximum vehicle depth: %f meters\r\n", $depthmax;
-			if ($mmodes[$i] == 1)
-				{
-				printf MFILE "#   Desired vehicle altitude: %f meters\r\n", $altitudedesired;
-				printf MFILE "#   Minimum vehicle altitude: %f meters\r\n", $altitudemin;
-				}
-			elsif ($mmodes[$i] == 2)
-				{
-				printf MFILE "#   Desired vehicle altitude: %f meters\r\n", $altitudedesired2;
-				printf MFILE "#   Minimum vehicle altitude: %f meters\r\n", $altitudemin;
-				}
-			elsif ($mmodes[$i] == 3)
-				{
-				printf MFILE "#   Desired vehicle altitude: %f meters\r\n", $altitudedesired3;
-				printf MFILE "#   Minimum vehicle altitude: %f meters\r\n", $altitudemin;
-				}
-			elsif ($mmodes[$i] == 4)
-				{
-				printf MFILE "#   Constant vehicle depth:   %f meters\r\n", $depthconstant;
-				printf MFILE "#   Minimum vehicle altitude: %f meters\r\n", $altitudemin;
-				}
-			elsif ($mmodes[$i] == 5)
-				{
-				printf MFILE "#   Constant vehicle depth:   %f meters\r\n", $depthconstant2;
-				printf MFILE "#   Minimum vehicle altitude: %f meters\r\n", $altitudemin;
-				}
-			if ($maxdepthapplied == 0)
-				{
-				printf MFILE "#   Behavior depth of %f meters set by local depth and desired altitude\r\n", $mmissiondepths[$i];
-				}
-			else
-				{
-				printf MFILE "#   Behavior depth of %f meters set to maximum vehicle depth\r\n", $mmissiondepths[$i];
-				}
-			if ($i > 0 && $mstartstops[$i-1] == 2)
-				{
-				printf MFILE "#   Vehicle transit speed:    %f m/s\r\n", $transit_speed;
-				}
-			else
-				{
-				printf MFILE "#   Vehicle survey speed:     %f m/s\r\n", $survey_speed;
-				}
-			print MFILE "behavior waypoint  \r\n";
-			print MFILE "{ \r\n";
-			printf MFILE "latitude     = %f; \r\n", $mlats[$i];
-			printf MFILE "longitude    = %f; \r\n", $mlons[$i];
-			if ($mwaypoints[$i] != 0 && $iwaypoint == 0)
-				{
-				printf MFILE "duration           = %d; \r\n", 600;
-				}
-			else
-				{
-				printf MFILE "duration           = %d; \r\n", ($durationfactorwaypoint * $mlengths[$i] / $survey_speed);
-				}
-			if ($mwaypoints[$i] != 0 && $iwaypoint != 0)
-				{
-				printf MFILE "# abortOnTimeout    = True; \r\n";
-				}
-			printf MFILE "depth        = %f; \r\n", $mmissiondepths[$i];
-			if ($i > 0 && $mmodels[$i-1] == 2)
-				{
-				print MFILE "speed              = TRANSIT_SPEED; \r\n";
-				}
-			else
-				{
-				print MFILE "speed              = SURVEY_SPEED; \r\n";
-				}
-			print MFILE "} \r\n";
-print " Depth: $mmissiondepths[$i]\r\n";
-			print WFILE "$mlons[$i] $mlats[$i]\r\n";
-			}
-
-		# output $behaviorWaypointDepthID mission point behavior
-		elsif ($behavior == $behaviorWaypointDepthID)
-			{
-			print MFILE "# \r\n";
-			if ($mwaypoints[$i] != 0 && $iwaypoint == 0)
-				{
-				print MFILE "# Waypoint_depth behavior to get to start of line 1\r\n";
-print "Behavior: waypoint_depth (to start line 1) ";
-				}
-			elsif ($mwaypoints[$i] != 0)
-				{
-				printf MFILE "# Waypoint_depth behavior to get to end of line %d\r\n", $iwaypoint;
-print "Behavior: waypoint_depth (to end line $iwaypoint) ";
-				}
-			else
-				{
-				printf MFILE "# Waypoint_depth behavior during line %d\r\n", $iwaypoint;
-print "Behavior: waypoint_depth (during line $iwaypoint) ";
-				}
-printf " Segment length: %.2f m ",$mlengths[$i];
-			printf MFILE "#   Segment length %f meters\r\n", $mlengths[$i];
-			printf MFILE "#   Minimum depth: %f meters looking forward %f meters along route\r\n", -$mtopomaxs[$i], $forwarddist;
-			printf MFILE "#   Maximum depth: %f meters looking forward %f meters along route\r\n", -$mtopomins[$i], $forwarddist;
-			printf MFILE "#   Maximum vehicle depth: %f meters\r\n", $depthmax;
-			if ($mmodes[$i] == 1)
-				{
-				printf MFILE "#   Desired vehicle altitude: %f meters\r\n", $altitudedesired;
-				printf MFILE "#   Minimum vehicle altitude: %f meters\r\n", $altitudemin;
-				}
-			elsif ($mmodes[$i] == 2)
-				{
-				printf MFILE "#   Desired vehicle altitude: %f meters\r\n", $altitudedesired2;
-				printf MFILE "#   Minimum vehicle altitude: %f meters\r\n", $altitudemin;
-				}
-			elsif ($mmodes[$i] == 3)
-				{
-				printf MFILE "#   Desired vehicle altitude: %f meters\r\n", $altitudedesired3;
-				printf MFILE "#   Minimum vehicle altitude: %f meters\r\n", $altitudemin;
-				}
-			elsif ($mmodes[$i] == 4)
-				{
-				printf MFILE "#   Constant vehicle depth:   %f meters\r\n", $depthconstant;
-				printf MFILE "#   Minimum vehicle altitude: %f meters\r\n", $altitudemin;
-				}
-			elsif ($mmodes[$i] == 5)
-				{
-				printf MFILE "#   Constant vehicle depth:   %f meters\r\n", $depthconstant2;
-				printf MFILE "#   Minimum vehicle altitude: %f meters\r\n", $altitudemin;
-				}
-			if ($maxdepthapplied == 0)
-				{
-				printf MFILE "#   Behavior depth of %f meters set by local depth and desired altitude\r\n", $mmissiondepths[$i];
-				}
-			else
-				{
-				printf MFILE "#   Behavior depth of %f meters set to maximum vehicle depth\r\n", $mmissiondepths[$i];
-				}
-			if ($i > 0 && $mstartstops[$i-1] == 2)
-				{
-				printf MFILE "#   Vehicle transit speed:    %f m/s\r\n", $transit_speed;
-				}
-			else
-				{
-				printf MFILE "#   Vehicle survey speed:     %f m/s\r\n", $survey_speed;
-				}
-			print MFILE "behavior waypoint_depth  \r\n";
-			print MFILE "{ \r\n";
-			printf MFILE "latitude           = %f; \r\n", $mlats[$i];
-			printf MFILE "longitude          = %f; \r\n", $mlons[$i];
-			if ($mwaypoints[$i] != 0 && $iwaypoint == 0)
-				{
-				printf MFILE "duration           = %d; \r\n", 600;
-				}
-			else
-				{
-				printf MFILE "duration           = %d; \r\n", ($durationfactorwaypoint * $mlengths[$i] / $survey_speed);
-				}
-			if ($mwaypoints[$i] != 0 && $iwaypoint != 0)
-				{
-				printf MFILE "# abortOnTimeout    = True; \r\n";
-				}
-print " Depths: ";
-			if ($i > 0)
-				{
-				printf MFILE "initialDepth       = %f; \r\n", $mmissiondepths[$i-1];
-printf " %.2f",$mmissiondepths[$i-1];
-				}
-			else
-				{
-				printf MFILE "initialDepth       = %f; \r\n", $mmissiondepths[$i];
-printf " %.2f",$mmissiondepths[$i];
-				}
-			printf MFILE "finalDepth         = %f; \r\n", $mmissiondepths[$i];
-printf " %.2f m\n",$mmissiondepths[$i];
-			if ($i > 0 && $mstartstops[$i-1] == 2)
-				{
-				print MFILE "speed              = TRANSIT_SPEED; \r\n";
-				}
-			else
-				{
-				print MFILE "speed              = SURVEY_SPEED; \r\n";
-				}
-			print MFILE "} \r\n";
-			print WFILE "$mlons[$i] $mlats[$i]\r\n";
-			}
-
-		# output $behaviorWaypointWallID mission point behavior
-		elsif ($behavior == $behaviorWaypointWallID)
-			{
-			print MFILE "# \r\n";
-			if ($mwaypoints[$i] != 0 && $iwaypoint == 0)
-				{
-				print MFILE "# Waypoint_wall behavior to get to start of line 1\r\n";
-print "Behavior: waypoint_wall (to start line 1) ";
-				}
-			elsif ($mwaypoints[$i] != 0)
-				{
-				printf MFILE "# Waypoint_wall behavior to get to end of line %d\r\n", $iwaypoint;
-print "Behavior: waypoint_wall (to end line $iwaypoint) ";
-				}
-			else
-				{
-				printf MFILE "# Waypoint_wall behavior during line %d\r\n", $iwaypoint;
-print "Behavior: waypoint_wall (during line $iwaypoint) ";
-				}
-printf " Segment length: %.2f m ",$mlengths[$i];
-			printf MFILE "#   Segment length %f meters\r\n", $mlengths[$i];
-			printf MFILE "#   Minimum depth: %f meters looking forward %f meters along route\r\n", -$mtopomaxs[$i], $forwarddist;
-			printf MFILE "#   Maximum depth: %f meters looking forward %f meters along route\r\n", -$mtopomins[$i], $forwarddist;
-			printf MFILE "#   Maximum vehicle depth: %f meters\r\n", $depthmax;
-			if ($mmodes[$i] == 1)
-				{
-				printf MFILE "#   Desired vehicle altitude: %f meters\r\n", $altitudedesired;
-				printf MFILE "#   Minimum vehicle altitude: %f meters\r\n", $altitudemin;
-				}
-			elsif ($mmodes[$i] == 2)
-				{
-				printf MFILE "#   Desired vehicle altitude: %f meters\r\n", $altitudedesired2;
-				printf MFILE "#   Minimum vehicle altitude: %f meters\r\n", $altitudemin;
-				}
-			elsif ($mmodes[$i] == 3)
-				{
-				printf MFILE "#   Desired vehicle altitude: %f meters\r\n", $altitudedesired3;
-				printf MFILE "#   Minimum vehicle altitude: %f meters\r\n", $altitudemin;
-				}
-			elsif ($mmodes[$i] == 4)
-				{
-				printf MFILE "#   Constant vehicle depth:   %f meters\r\n", $depthconstant;
-				printf MFILE "#   Minimum vehicle altitude: %f meters\r\n", $altitudemin;
-				}
-			elsif ($mmodes[$i] == 5)
-				{
-				printf MFILE "#   Constant vehicle depth:   %f meters\r\n", $depthconstant2;
-				printf MFILE "#   Minimum vehicle altitude: %f meters\r\n", $altitudemin;
-				}
-			if ($maxdepthapplied == 0)
-				{
-				printf MFILE "#   Behavior depth of %f meters set by local depth and desired altitude\r\n", $mmissiondepths[$i];
-				}
-			else
-				{
-				printf MFILE "#   Behavior depth of %f meters set to maximum vehicle depth\r\n", $mmissiondepths[$i];
-				}
-			if ($i > 0 && $mstartstops[$i-1] == 2)
-				{
-				printf MFILE "#   Vehicle transit speed:    %f m/s\r\n", $transit_speed;
-				}
-			else
-				{
-				printf MFILE "#   Vehicle survey speed:     %f m/s\r\n", $survey_speed;
-				}
-			print MFILE "behavior waypoint_wall  \r\n";
-			print MFILE "{ \r\n";
-			printf MFILE "latitude           = %f; \r\n", $mlats[$i];
-			printf MFILE "longitude          = %f; \r\n", $mlons[$i];
-			printf MFILE "lastLatitude       = %f; \r\n", $mlats[$i-1];
-			printf MFILE "lastLongitude      = %f; \r\n", $mlons[$i-1];
-			if ($mwaypoints[$i] != 0 && $iwaypoint == 0)
-				{
-				printf MFILE "duration           = %d; \r\n", 600;
-				}
-			else
-				{
-				printf MFILE "duration           = %d; \r\n", ($durationfactorwaypoint * $mlengths[$i] / $survey_speed);
-				}
-			if ($mwaypoints[$i] != 0 && $iwaypoint != 0)
-				{
-				printf MFILE "# abortOnTimeout    = True; \r\n";
-				}
-print " Depths: ";
-			if ($i > 0)
-				{
-				printf MFILE "initialDepth       = %f; \r\n", $mmissiondepths[$i-1];
-printf " %.2f",$mmissiondepths[$i-1];
-				}
-			else
-				{
-				printf MFILE "initialDepth       = %f; \r\n", $mmissiondepths[$i];
-printf " %.2f",$mmissiondepths[$i];
-				}
-			printf MFILE "finalDepth         = %f; \r\n", $mmissiondepths[$i];
-printf " %.2f m\n",$mmissiondepths[$i];
-			if ($i > 0 && $mstartstops[$i-1] == 2)
-				{
-				print MFILE "speed              = TRANSIT_SPEED; \r\n";
-				}
-			else
-				{
-				print MFILE "speed              = SURVEY_SPEED; \r\n";
-				}
-			print MFILE "maxCrossTrackError = 10; \r\n";             #Meters; Maximum cross-track displacement
-			print MFILE "starboardMaxCrossTrackError = 40; \r\n";    #Meters; Maximum starboard cross-track displacement
-			print MFILE "standOff           = 60; \r\n";             #Meters; Stand off from the wall
-			print MFILE "sonarTimeOut       = 2; \r\n";             #Seconds;
-			print MFILE "windowLen          = 1; \r\n";
-			print MFILE "useWallEstimator   = True; \r\n";
-			print MFILE "wallFeedForward    = True; \r\n";
-			print MFILE "} \r\n";
-			print WFILE "$mlons[$i] $mlats[$i]\r\n";
-			}
-
-		# insert acoustic update after end of line
-		if ($mstartstops[$i-1] == 2)
-			{
-			print MFILE "#######################################################\r\n";
-			print MFILE "# Acoustic update 6 - sent status ping after end of line \r\n";
-			print MFILE "# \r\n";
-			print MFILE "behavior acousticUpdate \r\n";
-			print MFILE "{ \r\n";
-			print MFILE "duration  = 2; \r\n";
-			print MFILE "dummy  = 1; \r\n";
-			print MFILE "} \r\n";
-			print MFILE "# \r\n";
-print "Behavior: acousticUpdate\r\n";
-			}
-
-		# reset sonar parameters
-		if ($mappingsonar && $iwaypoint > 0)
-			{
-			print MFILE "#######################################################\r\n";
-			print MFILE "# Reset sonar parameters \r\n";
-			print MFILE "#   Waypoint type:            $mwaypoints[$i-1]\r\n";
-			print MFILE "#   Commanded altitude:       $sonaraltitude\r\n";
-			print MFILE "#   Actual altitude:          $sonaraltitudeuse\r\n";
-			print MFILE "#   Commanded vehicle depth:  $mmissiondepths[$i] \r\n";
-			print MFILE "#   Seafloor depth:           $mtopos[$i]\r\n";
-			print MFILE "# \r\n";
-			print MFILE "behavior reson \r\n";
-			print MFILE "{ \r\n";
-			print MFILE "duration  = RESON_DURATION; \r\n";
-			if ($subbottom && $mstartstops[$i-1] == 2)
-				{
-				print MFILE "SBP_Mode = 1; \r\n";
-				print MFILE "SBP_Power = 100.0; \r\n";
-print "Behavior: reson (reset, Log_Mode = $logmode, line  = $iwaypoint, waypoint($i-1) type = $mwaypoints[$i-1] mstartstops = $mstartstops[$i-1], SBP off, MBrange:$mb_range MBaltitude:$sonaraltitudeuse)\r\n";
-				}
-			elsif ($subbottom && $mstartstops[$i-1] == 1)
-				{
-				print MFILE "SBP_Mode = 1; \r\n";
-				print MFILE "SBP_Power = 100.0; \r\n";
-print "Behavior: reson (reset, Log_Mode = $logmode, line  = $iwaypoint, waypoint($i-1) type = $mwaypoints[$i-1] mstartstops = $mstartstops[$i-1], SBP on, MBrange:$mb_range MBaltitude:$sonaraltitudeuse)\r\n";
-				}
-			elsif ($subbottom)
-				{
-print "Behavior: reson (reset, Log_Mode = $logmode, line  = $iwaypoint, waypoint($i-1) type = $mwaypoints[$i-1] mstartstops = $mstartstops[$i-1], SBP no change, MBrange:$mb_range MBaltitude:$sonaraltitudeuse)\r\n";
-				}
-			if ($subbottom)
-				{
-				printf MFILE "SBP_Duration = %.3f; \r\n", $sbp_duration;
-				}
-			if ($sidescanlo)
-				{
-				printf MFILE "LoSS_Range = %.2f; \r\n", $sslo_range;
-				}
-			if ($sidescanhi)
-				{
-				print MFILE "HiSS_Range = $sslo_range; \r\n";
-				}
-			printf MFILE "MB_Range = %.2f; \r\n", $mb_range;
-			print MFILE "MB_Rate = $mb_pingrate; \r\n";
-			print MFILE "MB_Gain = $mb_receivegain; \r\n";
-			print MFILE "MB_Sound_Velocity = 0.0; \r\n";
-			printf MFILE "MB_Pulse_Width = %f; \r\n", $mb_pulsewidth;
-			printf MFILE "MB_Bottom_Detect_Filter_Min_Range = %.2f; \r\n", $mb_minrange;
-			printf MFILE "MB_Bottom_Detect_Filter_Max_Range = %.2f; \r\n", $mb_maxrange;
-			printf MFILE "MB_Bottom_Detect_Filter_Min_Depth = %.2f; \r\n", $mb_mindepth;
-			printf MFILE "MB_Bottom_Detect_Filter_Max_Depth = %.2f; \r\n", $mb_maxdepth;
-			print MFILE "MB_Bottom_Detect_Range_Mode = 1; \r\n";
-			print MFILE "MB_Bottom_Detect_Depth_Mode = 0; \r\n";
-			print MFILE "} \r\n";
-			print MFILE "# \r\n";
-			print MFILE "#######################################################\r\n";
-			}
-
-		if ($deltat && $iwaypoint > 0)
-			{
-			print MFILE "#######################################################\r\n";
-			print MFILE "# Reset sonar parameters \r\n";
-			print MFILE "#   Waypoint type:            $mwaypoints[$i-1]\r\n";
-			print MFILE "#   Commanded altitude:       $sonaraltitude\r\n";
-			print MFILE "#   Actual altitude:          $sonaraltitudeuse\r\n";
-			print MFILE "#   Commanded vehicle depth:  $mmissiondepths[$i] \r\n";
-			print MFILE "#   Seafloor depth:           $mtopos[$i]\r\n";
-			print MFILE "# \r\n";
-			print MFILE "behavior delta_t \r\n";
-			print MFILE "{ \r\n";
-			print MFILE "duration  = RESON_DURATION; \r\n";
-			print MFILE "receiveGain = 10; \r\n";  # Range is 1 to 20dB
-			print MFILE "gainEq = 0; \r\n";   # Gain equalization (0=Off, 1=On)
-			print MFILE "range = 100; \r\n";  # Set sonar range (1 to 150m)
-			print MFILE "nBeams = 120; \r\n";  # Number of sonar beams (120, 240, or 480)
-			print MFILE "beamWidth = 1; \r\n";   # Beam width (0=Wide, 1=Normal, 2=Narrow, 3=NarrowMixed)
-			print MFILE "sectorSize = 120; \r\n";  # Size of wedge around nadir (30, 60, 90, 120degrees)
-			print MFILE "averaging = 0; \r\n";  # Number of shots to average (0,1=>Off, 3, 5, or 7 shots)
-			print MFILE "} \r\n";
-			print MFILE "# \r\n";
-			print MFILE "#######################################################\r\n";
-			}
-
-		# turn on or off camera
-		print MFILE "# \r\n";
-		if ($camera && $i > 0 && $mstartstops[$i-1] == 1)
-			{
-			$camerarunlength = $cameraenddistance - $mdistances[$i-1];
-			$nphotos = int (($camerarunlength / $survey_speed) / ($nsampleperiods * 0.2));
-			# $nphotos = 0;
-			print MFILE "#######################################################\r\n";
-			print MFILE "# Start taking pictures with camera.\r\n";
-			print MFILE "#   Distance along survey: $mdistances[$i-1]\r\n";
-			print MFILE "#   Length of camera run: $camerarunlength\r\n";
-			print MFILE "#   Number of photos: $nphotos\r\n";
-			print MFILE "behavior startCamera \r\n";
-			print MFILE "{ \r\n";
-			print MFILE "duration  = 1; \r\n";
-			#print MFILE "nPhotos = $nphotos; \r\n";
-			print MFILE "nSamplePeriods = $nsampleperiods; \r\n";
-			print MFILE "} \r\n";
-			print MFILE "# \r\n";
-			print MFILE "#######################################################\r\n";
-printf "Behavior: startCamera (distance:%.2f m, run length:%.2f m, nphotos:%d)\n",
-		$mdistances[$i-1],$camerarunlength,$nphotos;
-			}
-		elsif ($camera && $i > 0 && $mstartstops[$i-1] == 2)
-			{
-			$cameraenddistance = $mdistances[$i-1];
-			print MFILE "#######################################################\r\n";
-			print MFILE "# Stop taking pictures with camera.\r\n";
-			print MFILE "#   Distance along survey: $mdistances[$i-1]\r\n";
-			print MFILE "behavior stopCamera \r\n";
-			print MFILE "{ \r\n";
-			print MFILE "duration  = 1; \r\n";
-			print MFILE "} \r\n";
-			print MFILE "# \r\n";
-			print MFILE "#######################################################\r\n";
-printf "Behavior: stopCamera (distance:%.2f m\n",$mdistances[$i-1];
-			}
-
-		# insert acoustic update before start of line
-		if ($mstartstops[$i-1] == 1)
-			{
-			print MFILE "# Acoustic update 7 - sent status ping before start of line \r\n";
-			print MFILE "# \r\n";
-			print MFILE "behavior acousticUpdate \r\n";
-			print MFILE "{ \r\n";
-			print MFILE "duration  = 2; \r\n";
-			print MFILE "dummy  = 1; \r\n";
-			print MFILE "} \r\n";
-			print MFILE "# \r\n";
-			print MFILE "#######################################################\r\n";
-print "Behavior: acousticUpdate\r\n";
-			}
-
-		# put comment break in at waypoint
-		if ($mwaypoints[$i] != 0)
-			{
-			print MFILE "#######################################################\r\n";
-			}
-		}
-
-	# output beginning of mission
-	print MFILE "#######################################################\r\n";
-	print MFILE "# \r\n";
-#	print MFILE "# \r\n";
-#	print MFILE "# Acoustic update - sent status ping before start of line \r\n";
-#	print MFILE "# \r\n";
-#	print MFILE "behavior acousticUpdate \r\n";
-#	print MFILE "{ \r\n";
-#	print MFILE "duration  = 2; \r\n";
-#	print MFILE "dummy  = 1; \r\n";
-#	print MFILE "} \r\n";
-#print "Behavior: acousticUpdate\r\n";
-	print MFILE "# \r\n";
-	print MFILE "# Descend behavior \r\n";
-	print MFILE "behavior descend  \r\n";
-	print MFILE "{ \r\n";
-	print MFILE "horizontalMode   = heading; \r\n";
-	printf MFILE "horizontal   = %f; \r\n", $mbearings[0];
-	print MFILE "pitch        = DESCENDPITCH; \r\n";
-	print MFILE "speed        = ASCENTDESCENT_SPEED; \r\n";
-	print MFILE "maxDepth     = DESCENT_DEPTH; \r\n";
-	print MFILE "minAltitude  = ALTITUDE_MIN; \r\n";
-	print MFILE "duration     = DESCEND_DURATION; \r\n";
-	print MFILE "} \r\n";
-print "Behavior: descend\r\n";
-	print MFILE "# \r\n";
-	print MFILE "# setpoint on surface to gather momentum \r\n";
-	print MFILE "behavior setpoint \r\n";
-	print MFILE "{ \r\n";
-	print MFILE "duration     = SETPOINT_DURATION; \r\n";
-	printf MFILE "heading      = %f; \r\n", $mbearings[0];
-	print MFILE "speed        = ASCENTDESCENT_SPEED; \r\n";
-	print MFILE "verticalMode = pitch; \r\n";
-	print MFILE "pitch        = 0; \r\n";
-	print MFILE "} \r\n";
-print "Behavior: setpoint\r\n";
-	print MFILE "# \r\n";
-	print MFILE "# acquire gps fix \r\n";
-	print MFILE "behavior getgps  \r\n";
-	print MFILE "{ \r\n";
-	print MFILE "duration = GPS_DURATION; \r\n";
-	print MFILE "minHits = GPSMINHITS; \r\n";
-	print MFILE "abortOnTimeout = True; \r\n";
-	print MFILE "} \r\n";
-print "Behavior: gps\r\n";
-
-	# output starting sonar parameters
-	if ($mappingsonar)
-		{
-		# get starting sonar parameters assuming $altitudedesired altitude
-		#  $sslo_range & $sbp_duration calculated near start of program
-		# from ping rate
-		$sonaraltitudeuse = $altitudedesired;
-		$mb_range = $mb_maxrangefraction * $sonaraltitudeuse;
-		if ($mb_range > 200.0)
-			{
-			$mb_range = 200.0;
-			}
-		if ($beamdata && $mb_range > 100.0)
-			{
-			$mb_range = 100.0;
-			}
-		$mb_minrange = $mb_minrangefraction * $sonaraltitudeuse;
-		$mb_maxrange = $mb_range;
-		$mb_mindepth = 0.0;
-		$mb_maxdepth = $mb_range;
-
-		print MFILE "#######################################################\r\n";
-		print MFILE "# Set sonar parameters, turn pinging on, power zero and logging off \r\n";
-		print MFILE "# \r\n";
-		print MFILE "behavior reson \r\n";
-		print MFILE "{ \r\n";
-		print MFILE "duration  = RESON_DURATION; \r\n";
-		print MFILE "MB_Mode  = 1; \r\n";
-		print MFILE "Log_Mode  = 0; \r\n";
-		print MFILE "SBP_Mode = 0; \r\n";
-		print MFILE "SBP_Power = 0.0; \r\n";
-		print MFILE "SBP_Gain = 128.0; \r\n";
-		printf MFILE "SBP_Duration = %.3f; \r\n", $sbp_duration;
-		print MFILE "LoSS_Mode = 0; \r\n";
-		print MFILE "LoSS_Power = 0.0; \r\n";
-		printf MFILE "LoSS_Range = %.2f; \r\n", $sslo_range;
-		print MFILE "HiSS_Mode = 0; \r\n";
-		print MFILE "HiSS_Power = 0.0; \r\n";
-		print MFILE "HiSS_Range = $sslo_range; \r\n";
-		print MFILE "MB_Power = 0; \r\n";
-		printf MFILE "MB_Range = %.2f; \r\n", $mb_range;
-		print MFILE "MB_Rate = $mb_pingrate; \r\n";
-		print MFILE "MB_Gain = $mb_receivegain; \r\n";
-		print MFILE "MB_Sound_Velocity = 0.0; \r\n";
-		printf MFILE "MB_Pulse_Width = %f; \r\n", $mb_pulsewidth;
-		printf MFILE "MB_Bottom_Detect_Filter_Min_Range = %.2f; \r\n", $mb_minrange;
-		printf MFILE "MB_Bottom_Detect_Filter_Max_Range = %.2f; \r\n", $mb_maxrange;
-		printf MFILE "MB_Bottom_Detect_Filter_Min_Depth = %.2f; \r\n", $mb_mindepth;
-		printf MFILE "MB_Bottom_Detect_Filter_Max_Depth = %.2f; \r\n", $mb_maxdepth;
-		print MFILE "MB_Bottom_Detect_Range_Mode = 1; \r\n";
-		print MFILE "MB_Bottom_Detect_Depth_Mode = 0; \r\n";
-		print MFILE "Snippet_Mode = $mb_snippetmode; \r\n";
-		print MFILE "Window_Size = 200; \r\n";
-		print MFILE "} \r\n";
-		print MFILE "# \r\n";
-		print MFILE "#######################################################\r\n";
-print "Behavior: reson (start, reset, Log_Mode = 0)\r\n";
-		print MFILE "#######################################################\r\n";
-		}
-
-	# output starting sonar parameters
-	if ($deltat)
-		{
-		# get starting sonar parameters assuming $altitudedesired altitude
-		#  $sslo_range & $sbp_duration calculated near start of program
-		# from ping rate
-		$sonaraltitudeuse = $altitudedesired;
-		$mb_range = 4.0 * $sonaraltitudeuse;
-		if ($mb_range > 350.0)
-			{
-			$mb_range = 350.0;
-			}
-		if ($beamdata && $mb_range > 100.0)
-			{
-			$mb_range = 100.0;
-			}
-		$mb_minrange = $mb_minrangefraction * $sonaraltitudeuse;
-		$mb_maxrange = $mb_range;
-		$mb_mindepth = 0.0;
-		$mb_maxdepth = $mb_range;
-
-		print MFILE "#######################################################\r\n";
-		print MFILE "# Set sonar parameters, turn pinging on, power zero and logging off \r\n";
-		print MFILE "# \r\n";
-		print MFILE "behavior delta_t \r\n";
-		print MFILE "{ \r\n";
-		print MFILE "duration  = RESON_DURATION; \r\n";
-		print MFILE "logMode  = 0; \r\n";
-		print MFILE "receiveGain = 10; \r\n";  # Range is 1 to 20dB
-		print MFILE "gainEq = 0; \r\n";   # Gain equalization (0=Off, 1=On)
-		print MFILE "range = 100; \r\n";  # Set sonar range (1 to 150m)
-		print MFILE "nBeams = 120; \r\n";  # Number of sonar beams (120, 240, or 480)
-		print MFILE "beamWidth = 1; \r\n";   # Beam width (0=Wide, 1=Normal, 2=Narrow, 3=NarrowMixed)
-		print MFILE "sectorSize = 120; \r\n";  # Size of wedge around nadir (30, 60, 90, 120degrees)
-		print MFILE "averaging = 0; \r\n";  # Number of shots to average (0,1=>Off, 3, 5, or 7 shots)
-		print MFILE "} \r\n";
-		print MFILE "# \r\n";
-		print MFILE "#######################################################\r\n";
-print "Behavior: delta_t (start, reset, logMode = 0)\r\n";
-		print MFILE "#######################################################\r\n";
-		}
-
-	# Close the output file
-	print MFILE "#######################################################\r\n";
-	print MFILE "#######################################################\r\n";
-	close(MFILE);
-	close(WFILE);
-
-	# output winfrog waypoint file unless outputoff option selected
-	$winfrogfile = "$root.pts";
-	open(WFILE,">$winfrogfile") || die "Cannot open output winfrog file: $winfrogfile\r\n$program_name aborted.\r\n";
-	printf WFILE "0,$routename,0,0.000,0.000,1,2,65280,0,0.200,0,0,1.000\r\n";
-	for ($i = 0; $i < $npoints; $i++)
- 		{
-		if ($waypoints[$i] != 0)
-			{
- 			printf WFILE "1,%.10f,%.10f,0.00m,0.00m,0.00,0.00,%.3f\r\n", $lats[$i], $lons[$i], $distances[$i];
-			}
- 		}
-	close(WFILE);
-
-# 	# output Capn Voyager WPL waypoint file unless outputoff option selected
-# 	$winfrogfile = "$root" . "_capnwpt.rut";
-# 	open(WFILE,">$winfrogfile") || die "Cannot open output Capn Voyager file: $winfrogfile\r\n$program_name aborted.\r\n";
-# 	$cnt = 0;
-# 	for ($i = 0; $i < $npoints; $i++)
-#  		{
-# 		if ($waypoints[$i] != 0)
-# 			{
-# 			$cnt++;
-# 			if ($lats[$i] > 0.0)
-# 				{
-# 				$NorS = "N";
-# 				$latdeg = int($lats[$i]);
-# 				$latmin = ($lats[$i] - $latdeg) * 60.0;
-# 				$latminb = int($latmin);
-# 				$latmins = int(($latmin - $latminb) * 1000 + 0.5);
-# 				}
-# 			else
-# 				{
-# 				$NorS = 'S';
-# 				$latdeg = int(-$lats[$i]);
-# 				$latmin = (-$lats[$i] - $latdeg) * 60.0;
-# 				$latminb = int($latmin);
-# 				$latmins = int(($latmin - $latminb) * 1000 + 0.5);
-# 				}
-# 			if ($lons[$i] > 0.0)
-# 				{
-# 				$EorW = "E";
-# 				$londeg = int($lons[$i]);
-# 				$lonmin = ($lons[$i] - $londeg) * 60.0;
-# 				$lonminb = int($lonmin);
-# 				$lonmins = int(($lonmin - $lonminb) * 1000 + 0.5);
-# 				}
-# 			else
-# 				{
-# 				$EorW = 'W';
-# 				$londeg = int(-$lons[$i]);
-# 				$lonmin = (-$lons[$i] - $londeg) * 60.0;
-# 				$lonminb = int($lonmin);
-# 				$lonmins = int(($lonmin - $lonminb) * 1000 + 0.5);
-# 				}
-#  			printf WFILE "\$IIWPL,%2.2d%2.2d.%3.3d,%s,%3.3d%2.2d.%3.3d,%s,AUV %d\r\n", $latdeg, $latminb, $latmins, $NorS,, $londeg, $lonminb, $lonmins, $EorW, $cnt;
-# 			}
-#  		}
-# 	close(WFILE);
-
-	# generate data for plots
-	$topodatafile = "$root" . "_topo.xy";
-	open(TFILE,">$topodatafile") || die "Cannot open output distance vs topo file: $topodatafile\r\n$program_name aborted.\r\n";
-	for ($i = 0; $i < $npoints; $i++)
-		{
-		printf TFILE "%f %f\r\n", $distances[$i], $topos[$i];
-		}
-	close(TFILE);
-	$topodatafile = "$root" . "_mission.xy";
-	open(TFILE,">$topodatafile") || die "Cannot open output distance vs auv depth file: $topodatafile\r\n$program_name aborted.\r\n";
-	for ($i = 0; $i < $nmissionpoints-1; $i++)
-		{
-		printf TFILE "%f %f\r\n", $mdistances[$i], -$mmissiondepths[$i];
-		}
-	close(TFILE);
-	$topodatafile = "$root" . "_altitude.xy";
-	open(TFILE,">$topodatafile") || die "Cannot open output distance vs altitude file: $topodatafile\r\n$program_name aborted.\r\n";
-	for ($i = 0; $i < $nmissionpoints-1; $i++)
-		{
-		$altitude = -$mmissiondepths[$i] - $mtopos[$i];
-		printf TFILE "%f %f\r\n", $mdistances[$i], $altitude;
-		}
-	close(TFILE);
-	}
-
-# End it all
-if ($verbose)
-	{
-	print "\r\nAll done!\r\n";
-	}
-exit 0;
-
-#-----------------------------------------------------------------------
-# This should be loaded from the library but its safer to
-# just include it....
-#
-;# getopts.pl - a better getopt.pl
-
-;# Usage:
-;#      do Getopts('a:b*c');  # -a takes arg. -b & -c not. Sets opt_* as a
-;#                           #  side effect.
-
-sub Getopts {
-    local($argumentative) = @_;
-    local(@args,$_,$first,$rest);
-    local($errs) = 0;
-    local($[) = 0;
-
-    @args = split( / */, $argumentative );
-    while(@ARGV && ($_ = $ARGV[0]) =~ /^-(.)(.*)/) {
-     ($first,$rest) = ($1,$2);
-     $pos = index($argumentative,$first);
-     if($pos >= $[) {
-         if($args[$pos+1] eq ':') {
-          shift(@ARGV);
-          if($rest eq '') {
-              ++$errs unless @ARGV;
-              $rest = shift(@ARGV);
-          }
-          eval "\$opt_$first = \$rest;";
-         }
-         elsif($args[$pos+1] eq '*') {
-          eval "\$opt_$first += 1";
-          if($rest eq '') {
-              shift(@ARGV);
-          }
-          else {
-              $ARGV[0] = "-$rest";
-          }
-         }
-	 else {
-          eval "\$opt_$first = 1";
-          if($rest eq '') {
-              shift(@ARGV);
-          }
-          else {
-              $ARGV[0] = "-$rest";
-          }
-         }
-     }
-     else {
-         print STDERR "Unknown option: $first\r\n";
-         ++$errs;
-         if($rest ne '') {
-          $ARGV[0] = "-$rest";
-         }
-         else {
-          shift(@ARGV);
-         }
-     }
-    }
-    $errs == 0;
-}
-
-
-#-----------------------------------------------------------------------
-#-----------------------------------------------------------------------
-# This version of Getopts has been augmented to support multiple
-# calls to the same option. If an arg in argumentative is followed
-# by "+" rather than ":",  then the corresponding scalar will
-# be concatenated rather than overwritten by multiple calls to
-# the same arg.
-#
-# Usage:
-#      do Getopts('a:b+c'); # -a takes arg, -b concatenates args,
-#			    # -c does not take arg. Sets opt_* as a
-#                           # side effect.
-
-sub MBGetopts {
-    local($argumentative) = @_;
-    local(@args,$_,$first,$rest);
-    local($errs) = 0;
-
-    @args = split( / */, $argumentative );
-    while(@ARGV && ($_ = $ARGV[0]) =~ /^-(.)(.*)/) {
-	($first,$rest) = ($1,$2);
-	$pos = index($argumentative,$first);
-	if($pos >= $[) {
-	    if($args[$pos+1] eq ':') {
-		shift(@ARGV);
-		if($rest eq '') {
-		    ++$errs unless @ARGV;
-		    $rest = shift(@ARGV);
-		}
-		eval "\$opt_$first = \$rest;";
-		eval "\$flg_$first = 1;";
-	    }
-	    elsif($args[$pos+1] eq '+') {
-		shift(@ARGV);
-		if($rest eq '') {
-		    ++$errs unless @ARGV;
-		    $rest = shift(@ARGV);
-		}
-		if (eval "\$opt_$first") {
-		    eval "\$opt_$first = \$opt_$first
-				. \":\" . \$rest;";
-		}
-		else {
-		    eval "\$opt_$first = \$rest;";
-		}
-		eval "\$flg_$first = 1;";
-	    }
-	    elsif($args[$pos+1] eq '%') {
-		shift(@ARGV);
-		if($rest ne '') {
-		    eval "\$opt_$first = \$rest;";
-		}
-		else {
-		    $rest = $ARGV[0];
-		    ($one) = $rest =~ /^-(.).*/;
-		    $pos = index($argumentative,$one);
-		    if(!$one || $pos < $[) {
-			eval "\$opt_$first = \$rest;";
-			shift(@ARGV);
-		    }
-		}
-		eval "\$flg_$first = 1;";
-	    }
-	    else {
-		eval "\$opt_$first = 1";
-		eval "\$flg_$first = 1;";
-		if($rest eq '') {
-		    shift(@ARGV);
-		}
-		else {
-		    $ARGV[0] = "-$rest";
-		}
-	    }
-	}
-	else {
-	    print STDERR "Unknown option: $first\r\n";
-	    ++$errs;
-	    if($rest ne '') {
-		$ARGV[0] = "-$rest";
-	    }
-	    else {
-		shift(@ARGV);
-	    }
-	}
-    }
-    $errs == 0;
-}
-#-----------------------------------------------------------------------
diff --git a/src/macros/mbm_stat b/src/macros/mbm_stat
deleted file mode 100755
index b287ea0..0000000
--- a/src/macros/mbm_stat
+++ /dev/null
@@ -1,211 +0,0 @@
-#!/usr/bin/env perl
-#--------------------------------------------------------------------
-#    The MB-system:	mbm_stat.perl	8/14/93
-#    $Id: mbm_stat 2227 2015-02-05 21:12:31Z caress $
-#
-#    Copyright (c) 1993-2015 by
-#    D. W. Caress (caress at mbari.org)
-#      Monterey Bay Aquarium Research Institute
-#      Moss Landing, CA
-#    and D. N. Chayes (dale at lamont.ldgo.columbia.edu)
-#      Lamont-Doherty Earth Observatory
-#      Palisades, NY  10964
-#
-#    See README file for copying and redistribution conditions.
-#--------------------------------------------------------------------
-#
-# Command:
-#   mbm_stat
-#
-# Purpose:
-#   Perl shellscript to extract beam statistics from mbinfo output.
-#
-# Usage:
-#   mbm_stat -Ifile [-V -H]
-#
-# Author:
-#   David W. Caress
-#   Lamont-Doherty Earth Observatory
-#   Palisades, NY  10964
-#   August 14, 1993
-#
-# Version:
-#   $Id: mbm_stat 2227 2015-02-05 21:12:31Z caress $
-#
-# Revisions:
-#   $Log: mbm_stat.perl,v $
-#   Revision 5.1  2003/04/17 20:42:48  caress
-#   Release 5.0.beta30
-#
-#   Revision 5.0  2000/12/01 22:58:01  caress
-#   First cut at Version 5.0.
-#
-# Revision 4.3  2000/10/03  21:42:17  caress
-# Snapshot for Dale.
-#
-# Revision 4.2  1997/04/21  16:54:41  caress
-# MB-System 4.5 Beta Release.
-#
-# Revision 4.1  1995/05/12  17:43:23  caress
-# Made exit status values consistent with Unix convention.
-# 0: ok  nonzero: error
-#
-# Revision 4.1  1995/05/12  17:43:23  caress
-# Made exit status values consistent with Unix convention.
-# 0: ok  nonzero: error
-#
-# Revision 4.0  1994/10/21  11:47:31  caress
-# Release V4.0
-#
-# Revision 1.1  1993/08/19  16:39:20  dale
-# Initial revision
-#
-#
-#
-$program_name = "mbm_stat";
-
-# Deal with command line arguments
-&Getopts('I:i:VvHh');
-$file =    ($opt_I || $opt_i);
-$help =    ($opt_H || $opt_h);
-$verbose = ($opt_V || $opt_v);
-
-# print out help message if required
-if ($help)
-	{
-	print "\n$program_name:\n";
-	print "\nVersion: $Id: mbm_stat 2227 2015-02-05 21:12:31Z caress $\n";
-	print "\nPerl shellscript to extract beam statistics from the ouput of mbinfo.\n";
-	print "\nUsage: $program_name -Ifile [-V -H]\n";
-	exit 0;
-	}
-
-# check for defined parameters
-if (!$file)
-	{
-	die "No input file specified - $program_name aborted\n";
-	}
-
-# Read and deal with the data
-open(F1,"$file") || die "$program_name: Can't find input file $file \n";
-$count = 0;
-
-if ($verbose)
-	{
-	print "\nProgram ",$program_name,"\n";
-	print "\nInput File: ",$file,"\n";
-	}
-printf("File\t\t\tHours\t  Drops\t  Flags\n");
-$done = 0;
-
-while (<F1>)
-	{
-		$count++;
-		if (/^Multibeam Data File:  (.*)/) {
-			$data_file = $1;
-			@parts=split(/\//,$data_file);
-			$file = @parts[scalar(@parts)-1];
-			$done = 0;
-			}
-
-
-		elsif (/^  Number of Beams:(.*)/) {
-			if ( $done == 0 ) {
-				$beams = $1;
-				}
-			}
-
-		elsif (/^  Number of Zero Beams:(.*)/) {
-			if ( $done == 0)
-				{
-				$zeros = $1;
-				}
-			}
-		elsif (/^  Number of flagged beams:(.*)/) {
-			if ( $done == 0)
-				{
-				$flags = $1;
-				$done = 1;
-				}
-			}
-		elsif (/^Total Time: (.*)/) {
-				$duration = $1;
-				printf("%s\t%7.4f\t%6.2f\t%6.2f\n", $file,
-				$duration, $zeros/$beams*100.,
-				$flags/$beams*100.);
-			}
-
-#	if ($done == 1) {
-#		printf("%s\t%7.4f\t%6.2f\t%6.2f\n", $file, $duration,
-#			$zeros/$beams*100., $flags/$beams*100.);
-#	$done = 0;
-#	}
-
-	if ( $verbose )
-		{
-		printf("%4d\tData file:\t%s\n",$count,$data_file);
-		printf("%6d\t%6d\t%6d\n", $beams, $zeros, $flags);
-		}
-
-}
-
-
-close(F1);
-
-# Announce success whether it is deserved or not.
-print "\nAll done\n";
-exit 0;
-
-#-----------------------------------------------------------------------
-# This should be loaded from the library but the shipboard installation
-# of Perl is screwed up so....
-#
-;# getopts.pl - a better getopt.pl
-
-;# Usage:
-;#      do Getopts('a:bc');  # -a takes arg. -b & -c not. Sets opt_* as a
-;#                           #  side effect.
-
-sub Getopts {
-    local($argumentative) = @_;
-    local(@args,$_,$first,$rest);
-    local($errs) = 0;
-
-    @args = split( / */, $argumentative );
-    while(@ARGV && ($_ = $ARGV[0]) =~ /^-(.)(.*)/) {
-	($first,$rest) = ($1,$2);
-	$pos = index($argumentative,$first);
-	if($pos >= $[) {
-	    if($args[$pos+1] eq ':') {
-		shift(@ARGV);
-		if($rest eq '') {
-		    ++$errs unless @ARGV;
-		    $rest = shift(@ARGV);
-		}
-		eval "\$opt_$first = \$rest;";
-	    }
-	    else {
-		eval "\$opt_$first = 1";
-		if($rest eq '') {
-		    shift(@ARGV);
-		}
-		else {
-		    $ARGV[0] = "-$rest";
-		}
-	    }
-	}
-	else {
-	    print STDERR "Unknown option: $first\n";
-	    ++$errs;
-	    if($rest ne '') {
-		$ARGV[0] = "-$rest";
-	    }
-	    else {
-		shift(@ARGV);
-	    }
-	}
-    }
-    $errs == 0;
-}
-
-1;
diff --git a/src/macros/mbm_utm b/src/macros/mbm_utm
deleted file mode 100755
index f11c447..0000000
--- a/src/macros/mbm_utm
+++ /dev/null
@@ -1,522 +0,0 @@
-#!/usr/bin/env perl
-#--------------------------------------------------------------------
-#    The MB-system:	mbm_utm.perl	5/13/2002
-#    $Id: mbm_utm 2227 2015-02-05 21:12:31Z caress $
-#
-#    Copyright (c) 2002-2015 by
-#    D. W. Caress (caress at mbari.org)
-#      Monterey Bay Aquarium Research Institute
-#      Moss Landing, CA
-#    and D. N. Chayes (dale at lamont.ldgo.columbia.edu)
-#      Lamont-Doherty Earth Observatory
-#      Palisades, NY  10964
-#
-#    See README file for copying and redistribution conditions.
-#--------------------------------------------------------------------
-#
-# Command:
-#   mbm_utm
-#
-# Purpose:
-#   MB-System macro to perform forward and inverse UTM projections
-#   of ASCII data triples using the GMT program mapproject.
-#   Forward projections translate from geographic data
-#   (lon, lat, value) to UTM eastings and northings (x, y, value).
-#   Inverse projections translate from (x, y, z) to (lon, lat, z).
-#
-# Basic Usage:
-#   mbm_utm -Ifile -Zzone -Dellipsoid [-F -Q -H -V]
-#
-# Author:
-#   David W. Caress
-#   Monterey Bay Aquarium Research Institute
-#   Moss Landing, CA 95039
-#   May 13, 2002
-#
-# Version:
-#   $Id: mbm_utm 2227 2015-02-05 21:12:31Z caress $
-#
-# Revisions:
-#   $Log: mbm_utm.perl,v $
-#   Revision 5.4  2007/10/08 04:27:20  caress
-#   Now handles comma delimited xyz data along with white space delimited data.
-#
-#   Revision 5.3  2003/04/17 20:42:48  caress
-#   Release 5.0.beta30
-#
-#   Revision 5.2  2003/03/27 07:58:11  caress
-#   This macro now sets MEASURE_UNIT to inches and then resets it to the original value.
-#
-#   Revision 5.1  2002/05/29 23:35:57  caress
-#   Release 5.0.beta18
-#
-#   Revision 5.0  2002/05/14 18:53:03  caress
-#   Initial revision.
-#
-#
-#
-$program_name = "mbm_utm";
-
-# Deal with command line arguments
-$command_line = "@ARGV";
-&MBGetopts('HHE:e:FfI:i:L:l:O:o:QqZ:z:Vv');
-$help =    		($opt_H || $opt_h);
-$file_data =    	($opt_I || $opt_i);
-$file_out =    		($opt_O || $opt_o);
-$zone =    		($opt_Z || $opt_z || 10);
-$ellipsoid =    	($opt_E || $opt_e || "WGS-84");
-$usefeet = 		($opt_F || $opt_f);
-$lonflip = 		($opt_L || $opt_l || 0);
-$inverse = 		($opt_Q || $opt_q);
-$verbose = 		($opt_V || $opt_v);
-
-# print out help message if required
-if ($help)
-	{
-	print "\n$program_name:\n";
-	print "\nVersion: $Id: mbm_utm 2227 2015-02-05 21:12:31Z caress $\n";
-	print "\nMB-System macro to perform forward and inverse UTM projections";
-	print "of ASCII data triples using the GMT program mapproject. ";
-	print "Forward projections translate from geographic data ";
-	print "(lon, lat, value) to UTM eastings and northings (x, y, value). ";
-	print "Inverse projections translate from (x, y, z) to (lon, lat, z).";
-	print "\nUsage: \n";
-	print "\t$program_name -Eellipsoid -Ifile -Llonflip -Ooutput -Zzone [-F -Q -H -V]\n";
-	exit 0;
-	}
-
-# check for input file
-if (!$file_data)
-	{
-	print "\a";
-	die "No input file specified - $program_name aborted\n";
-	}
-elsif (! -e $file_data)
-	{
-	print "\a";
-	die "Specified input file cannot be opened - $program_name aborted\n";
-	}
-
-# check for ouput file
-if (!$file_out)
-	{
-	print "\a";
-	die "No output file specified - $program_name aborted\n";
-	}
-
-# get projection
-$projection = "u" . "$zone" . "/1:1000000";
-
-# now set the other projection parameters
-$org_lon = -183.0 + $zone * 6.0;
-$org_lat = 0.0;
-$org_lon_plus1 = $org_lon + 1.0;
-$org_lat_plus1 = $org_lat + 1.0;
-$org_x_ft = 1640416.66667;
-$org_x_m = 500000.0;
-$org_y_ft = 0.0;
-$org_y_m = 0.0;
-
-$bounds = "$org_lon" . "/" . "$org_lat"
-		. "/" . "$org_lon_plus1"
-		. "/" . "$org_lat_plus1" . "r";
-
-# set gmt defaults
-($d_format) = `gmtdefaults -L | grep D_FORMAT` =~ /\S+\s+\S+\s+(\S+)/;
-($ellipsoid) = `gmtdefaults -L | grep ELLIPSOID` =~ /\S+\s+\S+\s+(\S+)/;
-($measure_unit) = `gmtdefaults -L | grep MEASURE_UNIT` =~ /\S+\s+\S+\s+(\S+)/;
-if ($ellipsoid eq "Clarke-1866")
-	{
-	`gmtset D_FORMAT %.10lg ELLIPSOID Clarke-1866 MEASURE_UNIT inch`;
-	}
-else
-	{
-	`gmtset D_FORMAT %.10lg ELLIPSOID WGS-84 MEASURE_UNIT inch`;
-	}
-
-# set temporary file name
-$filetmpa = "$file_data" . "$$" . "a.tmp";
-$filetmpb = "$file_data" . "$$" . "b.tmp";
-
-# Do forward projection from lon lat to UTM easting northing
-if (!$inverse)
-	{
-	# open input file
-	if (!open(INP1,"<$file_data"))
-		{
-		die "\nInput file $file_data cannot be opened!\n$program_name aborted\n";
-		}
-
-	# open temporary file
-	if (!open(OUT1,">$filetmpa"))
-		{
-		die "\nTemporary file $filetmpa cannot be opened!\n$program_name aborted\n";
-		}
-
-	# read temporary file, looping over input lines
-	if ($verbose)
-		{
-		print "Preprocessing input...\n";
-		}
-	$ndata = 0;
-	while ($line = <INP1>)
-		{
-		$ok = 0;
-
-		# replace any commas with tabs
-		$line =~ s/,/\t/g;
-
-		if ($line =~ /[^\s\d\-\.]/)
-			{
-			}
-		elsif ($line =~ /(\S+)\s+(\S+)\s+(.*)/)
-			{
-			($xx,$yy,$val) = $line =~ /(\S+)\s+(\S+)\s+(.*)/;
-			$ok = 1;
-			}
-		elsif ($line =~ /(\S+)\s+(\S+)/)
-			{
-			($xx,$yy) = $line =~ /(\S+)\s+(\S+)/;
-			$val = "";
-			$ok = 1;
-			}
-
-		# only use good lines
-		if ($ok == 1)
-			{
-			# print out result
-			print OUT1 "$xx\t$yy\t$val\n";
-
-			$ndata = $ndata + 1;
-			}
-		}
-
-	# close input file
-	close INP1;
-
-	# close temporary file
-	close OUT1;
-
-	# run mapproject
-	if ($verbose)
-		{
-		print "Doing forward projection using mapproject...\n";
-		}
-	`mapproject $filetmpa -J$projection -R$bounds > $filetmpb`;
-
-	# open temporary file
-	if (!open(INP2,"<$filetmpb"))
-		{
-		die "\nTemporary file $filetmpb cannot be opened!\n$program_name aborted\n";
-		}
-
-	# open output file
-	if (!open(OUT2,">$file_out"))
-		{
-		die "\nOutput file $file_out cannot be opened!\n$program_name aborted\n";
-		}
-
-	# read temporary file, looping over input lines
-	if ($verbose)
-		{
-		print "Processing output from mapproject...\n";
-		}
-	$ndata = 0;
-	while ($line = <INP2>)
-		{
-		if ($line =~ /(\S+)\s+(\S+)\s+(.*)/)
-			{
-			($xx,$yy,$val) = $line =~ /(\S+)\s+(\S+)\s+(.*)/;
-			}
-		else
-			{
-			($xx,$yy) = $line =~ /(\S+)\s+(\S+)/;
-			$val = "";
-			}
-
-		# get projected values in desired units
-		if ($usefeet)
-			{
-			$xx = 1000000 * $xx / 12.0 + $org_x_ft;
-			$yy = 1000000 * $yy / 12.0 + $org_y_ft;
-			}
-		else
-			{
-			$xx = 1000000 * 0.0254 * $xx + $org_x_m;
-			$yy = 1000000 * 0.0254 * $yy + $org_y_m;
-			}
-
-		# print out result
-		print OUT2 "$xx\t$yy\t$val\n";
-
-		$ndata = $ndata + 1;
-		}
-	if ($verbose)
-		{
-		print "Processed $ndata data points...\n";
-		}
-
-	# close temporary file
-	close INP2;
-
-	# close output file
-	close OUT2;
-	}
-
-# Do inverse projection from UTM easting northing to lon lat
-else
-	{
-	# open input file
-	if (!open(INP1,"<$file_data"))
-		{
-		die "\nInput file $file_data cannot be opened!\n$program_name aborted\n";
-		}
-
-	# open temporary file
-	if (!open(OUT1,">$filetmpa"))
-		{
-		die "\nTemporary file $filetmpa cannot be opened!\n$program_name aborted\n";
-		}
-
-	# read temporary file, looping over input lines
-	if ($verbose)
-		{
-		print "Preprocessing input...\n";
-		}
-	$ndata = 0;
-	while ($line = <INP1>)
-		{
-		$ok = 0;
-
-		# replace any commas with tabs
-		$line =~ s/,/\t/g;
-
-		if ($line =~ /[^\s\d\-\.]/)
-			{
-			}
-		elsif ($line =~ /(\S+)\s+(\S+)\s+(.*)/)
-			{
-			($xx,$yy,$val) = $line =~ /(\S+)\s+(\S+)\s+(.*)/;
-			$ok = 1;
-			}
-		elsif ($line =~ /(\S+)\s+(\S+)/)
-			{
-			($xx,$yy) = $line =~ /(\S+)\s+(\S+)/;
-			$val = "";
-			$ok = 1;
-			}
-
-		# only use good lines
-		if ($ok == 1)
-			{
-			# get projected values in desired units
-			if ($usefeet)
-				{
-				$xx = 12.0 / 1000000 *($xx - $org_x_ft);
-				$yy = 12.0 / 1000000 *($yy - $org_y_ft);
-				}
-			else
-				{
-				$xx = ($xx - $org_x_m) / (0.0254 * 1000000);
-				$yy = ($yy - $org_y_m) / (0.0254 * 1000000);
-				}
-
-			# print out result
-			print OUT1 "$xx\t$yy\t$val\n";
-
-			$ndata = $ndata + 1;
-			}
-		}
-
-	# close input file
-	close INP1;
-
-	# close temporary file
-	close OUT1;
-
-	# run mapproject
-	if ($verbose)
-		{
-		print "Doing inverse projection using mapproject...\n";
-		}
-	`mapproject $filetmpa -J$projection -I -R$bounds > $filetmpb`;
-
-	# open temporary file
-	if (!open(INP2,"<$filetmpb"))
-		{
-		die "\nTemporary file $filetmpb cannot be opened!\n$program_name aborted\n";
-		}
-
-	# open output file
-	if (!open(OUT2,">$file_out"))
-		{
-		die "\nOutput file $file_out cannot be opened!\n$program_name aborted\n";
-		}
-
-	# read temporary file, looping over input lines
-	if ($verbose)
-		{
-		print "Processing output from mapproject...\n";
-		}
-	$ndata = 0;
-	while ($line = <INP2>)
-		{
-		if ($line =~ /(\S+)\s+(\S+)\s+(.*)/)
-			{
-			($xx,$yy,$val) = $line =~ /(\S+)\s+(\S+)\s+(.*)/;
-			}
-		else
-			{
-			($xx,$yy) = $line =~ /(\S+)\s+(\S+)/;
-			$val = "";
-			}
-
-		# apply lonflip
-		if ($lonflip == -1)
-			{
-			if ($xx < -360.0)
-				{
-				$xx += 360.0;
-				}
-			elsif ($xx > 0.0)
-				{
-				$xx -= 360.0;
-				}
-			}
-		elsif ($lonflip == 0)
-			{
-			if ($xx < -180.0)
-				{
-				$xx += 360.0;
-				}
-			elsif ($xx > 180.0)
-				{
-				$xx -= 360.0;
-				}
-			}
-		elsif ($lonflip == 1)
-			{
-			if ($xx < 0.0)
-				{
-				$xx += 360.0;
-				}
-			elsif ($xx > 360.0)
-				{
-				$xx -= 360.0;
-				}
-			}
-
-		# print out result
-		print OUT2 "$xx\t$yy\t$val\n";
-
-		$ndata = $ndata + 1;
-		}
-	if ($verbose)
-		{
-		print "Processed $ndata data points...\n";
-		}
-
-	# close temporary file
-	close INP2;
-
-	# close output file
-	close OUT2;
-	}
-
-# remove temporary files
-unlink($filetmpa);
-unlink($filetmpb);
-
-# reset the gmt defaults
-`gmtset D_FORMAT $d_format ELLIPSOID $ellipsoid MEASURE_UNIT $measure_unit`;
-
-exit 0;
-
-
-#-----------------------------------------------------------------------
-# This version of Getopts has been augmented to support multiple
-# calls to the same option. If an arg in argumentative is followed
-# by "+" rather than ":",  then the corresponding scalar will
-# be concatenated rather than overwritten by multiple calls to
-# the same arg.
-#
-# Usage:
-#      do Getopts('a:b+c'); # -a takes arg, -b concatenates args,
-#			    # -c does not take arg. Sets opt_* as a
-#                           # side effect.
-
-sub MBGetopts {
-    local($argumentative) = @_;
-    local(@args,$_,$first,$rest);
-    local($errs) = 0;
-
-    @args = split( / */, $argumentative );
-    while(@ARGV && ($_ = $ARGV[0]) =~ /^-(.)(.*)/) {
-	($first,$rest) = ($1,$2);
-	$pos = index($argumentative,$first);
-	if($pos >= $[) {
-	    if($args[$pos+1] eq ':') {
-		shift(@ARGV);
-		if($rest eq '') {
-		    ++$errs unless @ARGV;
-		    $rest = shift(@ARGV);
-		}
-		eval "\$opt_$first = \$rest;";
-		eval "\$flg_$first = 1;";
-	    }
-	    elsif($args[$pos+1] eq '+') {
-		shift(@ARGV);
-		if($rest eq '') {
-		    ++$errs unless @ARGV;
-		    $rest = shift(@ARGV);
-		}
-		if (eval "\$opt_$first") {
-		    eval "\$opt_$first = \$opt_$first
-				. \":\" . \$rest;";
-		}
-		else {
-		    eval "\$opt_$first = \$rest;";
-		}
-		eval "\$flg_$first = 1;";
-	    }
-	    elsif($args[$pos+1] eq '%') {
-		shift(@ARGV);
-		if($rest ne '') {
-		    eval "\$opt_$first = \$rest;";
-		}
-		else {
-		    $rest = $ARGV[0];
-		    ($one) = $rest =~ /^-(.).*/;
-		    $pos = index($argumentative,$one);
-		    if(!$one || $pos < $[) {
-			eval "\$opt_$first = \$rest;";
-			shift(@ARGV);
-		    }
-		}
-		eval "\$flg_$first = 1;";
-	    }
-	    else {
-		eval "\$opt_$first = 1";
-		eval "\$flg_$first = 1;";
-		if($rest eq '') {
-		    shift(@ARGV);
-		}
-		else {
-		    $ARGV[0] = "-$rest";
-		}
-	    }
-	}
-	else {
-	    print STDERR "Unknown option: $first\n";
-	    ++$errs;
-	    if($rest ne '') {
-		$ARGV[0] = "-$rest";
-	    }
-	    else {
-		shift(@ARGV);
-	    }
-	}
-    }
-    $errs == 0;
-}
-#-----------------------------------------------------------------------
diff --git a/src/macros/mbm_vrefcheck b/src/macros/mbm_vrefcheck
deleted file mode 100755
index 1d7a25e..0000000
--- a/src/macros/mbm_vrefcheck
+++ /dev/null
@@ -1,240 +0,0 @@
-#!/usr/bin/env perl
-#--------------------------------------------------------------------
-#    The MB-system:	mbm_vrefcheck.perl	6/18/93
-#    $Id: mbm_vrefcheck 2227 2015-02-05 21:12:31Z caress $
-#
-#    Copyright (c) 1993-2015 by
-#    D. W. Caress (caress at mbari.org)
-#      Monterey Bay Aquarium Research Institute
-#      Moss Landing, CA
-#    and D. N. Chayes (dale at lamont.ldgo.columbia.edu)
-#      Lamont-Doherty Earth Observatory
-#      Palisades, NY  10964
-#
-#    See README file for copying and redistribution conditions.
-#--------------------------------------------------------------------
-#
-# Command:
-#   mbm_vrefcheck
-#
-# Purpose:
-#   Perl shellscript to generate plot of crosstrack seafloor slope
-#   from a multibeam file.  The noise in this time series largely
-#   reflects noise in the vertical reference used by the sonar.
-#
-# Usage:
-#   mbm_vrefcheck -Fformat -Ifile [-Axmin -Bxmax -Sxscale -Xxaxis]
-#
-# Author:
-#   David W. Caress
-#   Lamont-Doherty Earth Observatory
-#   Palisades, NY  10964
-#   June 13, 1993
-#
-# Version:
-#   $Id: mbm_vrefcheck 2227 2015-02-05 21:12:31Z caress $
-#
-# Revisions:
-#   $Log: mbm_vrefcheck.perl,v $
-#   Revision 5.2  2003/04/17 20:42:48  caress
-#   Release 5.0.beta30
-#
-#   Revision 5.1  2001/03/22 21:05:45  caress
-#   Trying to make release 5.0.beta0
-#
-# Revision 5.0  2000/12/01  22:58:01  caress
-# First cut at Version 5.0.
-#
-# Revision 4.4  2000/10/03  21:42:17  caress
-# Snapshot for Dale.
-#
-# Revision 4.3  1997/04/21  16:54:41  caress
-# MB-System 4.5 Beta Release.
-#
-# Revision 4.2  1995/05/12  17:43:23  caress
-# Made exit status values consistent with Unix convention.
-# 0: ok  nonzero: error
-#
-# Revision 4.2  1995/05/12  17:43:23  caress
-# Made exit status values consistent with Unix convention.
-# 0: ok  nonzero: error
-#
-# Revision 4.1  1994/10/21  11:36:58  caress
-# Release V4.0
-#
-# Revision 4.0  1994/03/05  23:52:40  caress
-# First cut at version 4.0
-#
-# Revision 4.1  1994/03/03  04:11:13  caress
-# Fixed copyright message.
-#
-# Revision 4.0  1994/02/26  19:37:57  caress
-# First cut at new version.
-#
-# Revision 3.3  1993/08/17  16:58:36  caress
-# Set location of perl to /usr/local/bin/perl
-#
-# Revision 3.2  1993/08/17  01:52:17  caress
-# Added MB-system header.
-#
-#
-# Deal with command line arguments
-&Getopts('I:i:F:f:S:s:X:x:A:a:B:b:');
-$file = ($opt_I || $opt_i);
-$format = ($opt_F || $opt_f);
-$xscale = ($opt_S || $opt_s);
-$xaxis = ($opt_X || $opt_x);
-$xmin = ($opt_A || $opt_a);
-$xmax = ($opt_B || $opt_b);
-
-# get format if needed
-if (!$format)
-	{
-	$line = `mbformat -I $file -L`;
-	($format) = $line =~ /(\S+)/;
-	if ($format == 0)
-		{
-		$format = -1;
-		}
-	}
-
-# if needed set defaults
-if (!$xscale)
-	{
-	$xscale = "1.2";
-	}
-$file || die "Input file not specified...\nMBM_VREFCHECK aborted.\n";
-
-# Get filenames in order...
-$datfile = "vrefcheck_$$.dat";
-$fltfile = "vrefcheck_$$.flt";
-$resfile = "vrefcheck_$$.res";
-$psfile = "vrefcheck_$$.ps";
-
-# Get going.
-print "\nMacro mbm_vrefcheck running...\n";
-print "Running mblist...\n";
-`mblist -F$format -I$file -OmA > $datfile`;
-
-# Filter the seafloor slope data.
-print "Running filter1d...\n";
-`filter1d $datfile -Fm5 -E -V > $fltfile`;
-
-# Read the data and filtered data files,
-# subtracting to get the high-passed signal.
-print "Processing raw and filtered data to get residual...\n";
-open(F1,"$datfile");
-open(F2,"$fltfile");
-open(FOUT,"> $resfile");
-$min_in_hour = "60.0";
-while ($line1 = <F1>)
-	{
-	($time1, $dat) = $line1 =~ /(\S+)\s(\S+)/;
-#	print "time1:",$time1," dat:",$dat,"\n";
-	$line2 = <F2>;
-	($time2, $flt) = $line2 =~ /(\S+)\s(\S+)/;
-	$res = $dat - $flt;
-	$hour = $time1 / $min_in_hour;
-#	print "time1:",$time1," dat:",$dat," time2:",$time2," flt:",$flt," res:",$res,"\n";
-	print FOUT $hour,"\t",$res,"\n";
-	}
-close(F1);
-close(F2);
-close(FOUT);
-
-# Get x limits of plot and page.
-if (!$xmin || !$xmax)
-	{
-	print "Running minmax...\n";
-	$minmax = `minmax $resfile`;
-	($resfile, $n, $xmin, $xmax, $ymin, $ymax) = $minmax
-		=~ /(\S+): N = (\S+)\s<(\S+)\/(\S+)>\s<(\S+)\/(\S+)>/;
-	}
-if (!$xaxis)
-	{
-	$xaxis = ($xmax - $xmin) * $xscale;
-	}
-$pagex = $xaxis + 2.0;
-
-# Generate the postscript plot.
-print "Running psxy...\n";
-`psxy $resfile -JX$xaxis/9 -R$xmin/$xmax/-2/2 -B1g0.25:"Time From Beginning of File (hours)":/0.25g0.25:"Apparent Vertical Reference Noise (degrees)"::."Multibeam Data File - $file": -P > $psfile`;
-`rm -f $datfile $fltfile $resfile`;
-
-# use mbdefaults to get the current system default postscript viewer
-$ps_viewer = "ghostview";
- at mbdefaults = `mbdefaults`;
-while (@mbdefaults)
-        {
-        $line = shift @mbdefaults;
-        if ($line =~ /ps viewer:\s+(\S+)/)
-                {
-                ($ps_viewer) = $line =~ /ps viewer:\s+(\S+)/;
-                 }
-        }
-
-# check environment variable
-if ($ENV{"MB_PS_VIEWER"})
-	{
-	$ps_viewer = $ENV{"MB_PS_VIEWER"};
-	}
-
-`$ps_viewer $psfile &`;
-
-# Announce success whether it is deserved or not.
-print "All done!\n";
-exit 0;
-
-#-----------------------------------------------------------------------
-# This should be loaded from the library but the shipboard installation
-# of Perl is screwed up so....
-#
-;# getopts.pl - a better getopt.pl
-
-;# Usage:
-;#      do Getopts('a:bc');  # -a takes arg. -b & -c not. Sets opt_* as a
-;#                           #  side effect.
-
-sub Getopts {
-    local($argumentative) = @_;
-    local(@args,$_,$first,$rest);
-    local($errs) = 0;
-
-    @args = split( / */, $argumentative );
-    while(@ARGV && ($_ = $ARGV[0]) =~ /^-(.)(.*)/) {
-	($first,$rest) = ($1,$2);
-	$pos = index($argumentative,$first);
-	if($pos >= $[) {
-	    if($args[$pos+1] eq ':') {
-		shift(@ARGV);
-		if($rest eq '') {
-		    ++$errs unless @ARGV;
-		    $rest = shift(@ARGV);
-		}
-		eval "\$opt_$first = \$rest;";
-	    }
-	    else {
-		eval "\$opt_$first = 1";
-		if($rest eq '') {
-		    shift(@ARGV);
-		}
-		else {
-		    $ARGV[0] = "-$rest";
-		}
-	    }
-	}
-	else {
-	    print STDERR "Unknown option: $first\n";
-	    ++$errs;
-	    if($rest ne '') {
-		$ARGV[0] = "-$rest";
-	    }
-	    else {
-		shift(@ARGV);
-	    }
-	}
-    }
-    $errs == 0;
-}
-
-1;
diff --git a/src/macros/mbm_xbt b/src/macros/mbm_xbt
deleted file mode 100755
index 24aba00..0000000
--- a/src/macros/mbm_xbt
+++ /dev/null
@@ -1,520 +0,0 @@
-#!/usr/bin/env perl
-#--------------------------------------------------------------------
-#    The MB-system: mbm_xbt.perl   6/18/93
-#    $Id: mbm_xbt 2227 2015-02-05 21:12:31Z caress $
-#
-#    Copyright (c) 1993-2015 by
-#    D. W. Caress (caress at mbari.org)
-#      Monterey Bay Aquarium Research Institute
-#      Moss Landing, CA
-#    and D. N. Chayes (dale at lamont.ldgo.columbia.edu)
-#      Lamont-Doherty Earth Observatory of Columbia University
-#      Palisades, NY  10964
-#
-#    See README file in the top level of the MB-System distribution
-#    directory for copying and redistribution conditions.
-#--------------------------------------------------------------------
-#
-# Command:
-#   mbm_xbt
-#
-# Purpose:
-#   Perl code to translate Sparton XBT data or Sippican (MK12 or MK21)
-#   XBT data from depth and temperature into depth and sound speed.
-#   Sound speed is computed according to DelGrosso's equations.
-#
-#   We use the DelGrosso equation because of the results presented in
-#   Dusha, Brian D. Worcester, Peter F., Cornuelle, Bruce D., Howe, Bruce. M.
-#   "On equations for the speed of sound in seawater", J. Acoust. Soc. Am.
-#   Vol 93, No 1, January 1993, pp 255-275.
-#
-#   Header lines are turned into comments beginning with '#' characters.
-#   The output filename consists of the input filename with the
-#   suffix ".sv".
-#
-# Usage:
-#   mbm_xbt -Iinfile [-Fformat -Llatitude -Ssalinity -V -H -C]
-#
-# Known XBT formats:
-#   Sparton        =  1
-#   Sippican MK12  =  2
-#   Sippican MK21  = 3
-#
-# Assumptions:
-#   In the absence of salinity data, a salinity value of 35 ppt is
-#   is assumed.  This will be significantly in error in some areas.
-#   Latitude and depth (pressure) corrections are not applied.
-#
-#   The first column (after the header) is water depth (meters)
-#   The second column (after the header) is temperature (Celcius)
-#
-#   Perl program to convert Sparton XBT data and MK12 XBT data into depth
-#   and Sound Speed
-#
-# Authors:
-#   Dale N. Chayes <dale at ldeo.columbia.edu>
-#   David W. Caress
-#   Lamont-Doherty Earth Observatory of Columbia University
-#   Palisades, NY  10964
-#
-#   David Brock while working for Antarctic Support Associates (ASA)
-#    when ASA was the contractor for the US Antarctic Research Program
-#    added the Sippican MK12 header parsing code and switch at the time
-#    (1993 or so?) when the SeaBeam 2112 was instaled on the Nathaniel
-#    B. Palmer.
-#
-# Notes:
-#    Major re-write by Dale started in early August,2003, completed in
-#    September 2004 including:
-#      - adding explicit filehandle passing for header parsing
-#      - restructure for clearer header parsing
-#      - explicit input variable naming
-#      - clean up formatting
-#      - improve test for below zero (C) temperature handling
-#      - add support for Sippican MK21 header format
-#      - expanded mbm_xbt header info
-#      - copy all source header info into the output file
-#      - convert to use "standard" perl getopts
-#      - move useage message to function
-#
-#
-# Version:
-# $Id: mbm_xbt 2227 2015-02-05 21:12:31Z caress $
-#
-# Revisions:
-#   $Log: mbm_xbt.perl,v $
-#   Revision 5.5  2004/09/18 00:36:10  dale
-#   Update copyright date, add CU to LDEO and change one more instance of velocity.
-#
-#   Revision 5.3  2004/09/17 19:47:44  dale
-#   This is a major revision to mbm_xbt. It adds new functionality for Sippican MK21 file format, addresses sub-zero temperatures better and is significantly cleaned up. See the comments.
-#
-#   Revision 1.1.1.1  2003/07/27 17:17:35  dale
-#   mb import from 5b31
-#
-#   Revision 5.1  2003/04/17 20:42:48  caress
-#   Release 5.0.beta30
-#
-#   Revision 5.0  2000/12/01 22:58:01  caress
-#   First cut at Version 5.0.
-#
-# Revision 4.4  2000/10/03  21:42:17  caress
-# Snapshot for Dale.
-#
-# Revision 4.3  1997/04/21  16:54:41  caress
-# MB-System 4.5 Beta Release.
-#
-# Revision 4.3  1997/03/26  17:50:15  caress
-# Fixed handling of MK12 xbt file when the first temperature
-# value is less than zero.
-#
-# Revision 4.2  1995/05/12  17:43:23  caress
-# Made exit status values consistent with Unix convention.
-# 0: ok  nonzero: error
-#
-# Revision 4.1  1995/02/14  19:50:31  caress
-# Version 4.2
-#
-# Revision 4.3  1995/01/23  10:20:14  dale
-#    Move the latitude calculation out of the loop, we only need to
-# do it once. Its now in the if/else test for the existance of a user
-# supplied latitude. If a negative lat is provided, its converted to be
-# positive.
-#
-# Revision 4.2  1995/01/23  10:16:10  dale
-#    Corrected the output statement to only put out one velocity
-# (instead of both.)
-#
-# Revision 4.1  1995/01/23  10:14:54  dale
-#    Implemented SV calculation with DelGrosso's equation. Added
-# argument for Latitude input. Buried code for Lovett's equation. Canned
-# the old and not correct SV calculation code.
-#
-#    The DelGrosso code is the same as used in the Thermoalinograph
-# code (r_tsg) on the Thompson and is based upon code from the Scripp's
-# Ocean Data Facility (ODF).
-#
-#    This code does latitude density correction. The conversion of
-# depth in meters to pressure (decibars) is done according to the
-# equation presented in Coates.
-#
-# Revision 4.0  1995/01/23  03:21:58  dale
-# This was the version that was distrubuted with MB 4.1
-# It is known to have a number of problems and does not produce t
-# either at the surface or at depth.
-#
-# Revision 4.0  1994/03/05  23:52:40  caress
-# First cut at version 4.0
-#
-# Revision 4.1  1994/03/03  04:11:13  caress
-# Fixed copyright message.
-#
-# Revision 4.0  1994/02/26  19:37:57  caress
-# First cut at new version.
-#
-# Revision 1.7  1993/08/24  17:01:32  caress
-# Fixed problems solved once earlier but not checked in.
-#
-# Revision 1.6  1993/08/17  16:58:36  caress
-# Set location of perl to /usr/local/bin/perl
-#
-# Revision 1.5  1993/08/17  00:26:07  caress
-# Version current as of 16 August 1993.
-#
-# Revision 1.4  1993/06/19  01:02:24  caress
-# Combined functions of mbm_xbt and xbt2sv into a single
-# Perl script.
-#
-#   Revision 1.3  1993/06/10  01:14:12  caress
-#   Fixed bug in last improvement.
-#
-#   Revision 1.2  1993/06/10  01:08:40  caress
-#   Now writes a more informative header.
-#
-#   Revision 1.1  1993/05/25  05:43:54  caress
-#   Initial revision
-#
-#   Revision 3.1  1993/05/20  05:13:20  dale
-#   Clean up the comments, fix the execution of xbt2sv
-#
-#   Revision 3.0  1993/05/20  03:49:35  dale
-#   Initial version
-#
-#
-
-# use strict;
-use Getopt::Std;		# break from the old MB-System included version
-
-
-
-my $ProgramName = "mbm_xbt";
-my $Version ="\$Id\$";
-
-my $PI = 3.1415926;	 # (probably) good enough definition fo Pi
-my $DTR = $PI/180.;     # Degree/radians conversion factor
-
-my $ColdLimit = -2.0;		# Normal water can't get colder without freezing
-
-# indicates that we are still searching for end of header
-my $searchForMaker = "NO";
-
-# indicates that we are still reading header records
-my $foundData = "NO";
-
-# Currently supported input file formats
-my $SPARTON = 1;
-my $MK12    = 2;
-my $MK21    = 3;
-
-
-# Deal with command line arguments using the "standard" perl library
-
-if ( ! (getopts('I:i:S:s:F:f:L:l:VvHh'))) {
-  print "$0: error on input\n";
-  useage();
-  exit 0;
-}
-
-my $file =     ($opt_I || $opt_i);
-my $sal = ($opt_S || $opt_s);
-my $XBTtype =  ($opt_F || $opt_f || $MK12);
-my $help =     ($opt_H || $opt_h);
-my $verbose =  ($opt_V || $opt_v);
-my $latitude = ($opt_L || $opt_l); # Latitude for pressure conversion
-
-
-# print out help message if requested
-if ($help) {
-  useage();
-  exit 0;
-}
-
-if (!$sal) {	# set salinity if it was defaulted
-  $sal = 35;
-}
-
-if (!$latitude) {        # if Lat not provided, use the equator
-  $latitude = 0;
-}
-else {
-  $latitude = $latitude * $DTR; # Lat comes in in degrees, but we need
-}                   # radians for the sin() function.
-
-if ($latitude < 0 ) {         # make sure the latitude is positive
-  $latitude = $latitude * -1.;
-}
-
-# Filenames: there are two: input and output
-my $suffix = ".sv";
-my $OUTFILE = $file.$suffix;
-my $count=0;
-my $temp;		 # Temperature (Celcius)
-my $depth;		 # Water depth (meters)
-
-# Open the input and output files. Failure on either is fatal.
-open(F,$file) || die "Cannot open input file: $file\n$ProgramName
-aborted.\n";
-
-open(Out,"+>".$OUTFILE) || die "Cannot open temporary file:
-$TMPFILE\n$ProgramName aborted.\n";
-
-# Put leading comment in output file, depending on format selected
-if ($XBTtype == $SPARTON) {
-    print Out "# Sparton XBT data processed using program $ProgramName\n";
-}
-elsif ($XBTtype == $MK12) {
-    print Out "# Sippican MK12  XBT data processed using program $ProgramName\n";
-}
-
-elsif ($XBTtype == $MK21) {
-  print Out "# Sippican MK21 XBT data processed using program $ProgramName\n";
-}
-
-else {
-    printf("mbm_xbt: failed on unknown input file format.\n");
-    printf("\t If you have a new kind of XBT file, please let us know.\n");
-    exit;
-}
-
-# Add some content to the output header
-#
-
-printf (Out "# %s version: %s\n",$ProgramName, $Version );
-printf (Out "# %s assumed %.2f PSU salinity \n",$ProgramName, $sal);
-printf (Out "# --end of mbm_xbt header info -----\n");
-
-# Deal with the data set header depending on the format
-# specified on the command line.  The headder reading processes returns when
-# it has consumed all the header data. All of the input header info is
-# inserted into the output file as comments.
-
-if ($XBTtype == $SPARTON) {    	# We've gotten rid of _@ passing!
-    SpartonHeader(F, Out);
-}
-elsif ($XBTtype == $MK21) {
-    printf ("Invoking MK21header\n");
-    MK21header(F, Out);
-}
-else {				# make into an elseif and add a failure case
-    MK12header(F, Out);
-}
-
-# Now that the header stuff is out of the way, loop over the input records
-while ($In=<F>) {		# reading from the input
-  ++$count;
-  if (length($In) >= 7) {
-                  # Some folks create "edf" files with additional columns so
-                  # we just take the first two and assume that depth is in
-                  # the first column and temperature is in the second,
-                  # ignore all after that.
-
-    ($depth, $temp, $junk) = split (" ", $In, 3);
-
-#	if ($XBTtype == $MK21) {
-#	    ($depth, $temp) = split (/\s+/, $In, 2);
-#	}
-#	elsif ($XBTtype == $MK12) {
-#	    ($depth, $temp) = split (" ", $In, 2);
-#	}
-
-
-# First calculate the Pressure term (P) in decibars from depth in meters
-# This conversion is from Coates, 1989, Page 4.
-
-    my $P=1.0052405
-      * ( 1+ 5.28E-3 * ((sin ($latitude)) * (sin($latitude))))
-	* $depth + 2.36E-6 * ($depth * $depth);
-
-# Then calculate SV according to DelGrosso
-
-    my $P1      = $P * 0.1019716;   # to pressure in kg/cm**2 gauge
-    my $c0      = 1402.392;
-    my $dltact  = $temp
-      *( 0.501109398873E1 + $temp*(-0.550946843172E-1+ $temp
-				   *  0.221535969240E-3));
-
-    my $dltacs  = $sal*(0.132952290781E1
-			+ $sal* 0.128955756844E-3);
-    my $dltacp  = $P1
-      *( 0.156059257041E0 +  $P1*( 0.24499868841E-4
-				   + $P1*(-0.883392332513E-8)));
-
-    my $dcstp   =  $temp*(-0.127562783426E-1*$sal
-			  + $P1*( 0.635191613389E-2
-				  + $P1*( 0.265484716608E-7*$temp +
-					  -0.159349479045E-5        +
-					  0.522116437235E-9*$P1)     +
-				  (-0.438031096213E-6)*$temp*$temp)) +
-				    $sal*((-0.161674495909E-8)*$sal*$P1*$P1 +
-					  $temp*( 0.968403156410E-4*$temp +
-						  $P1*( 0.485639620015E-5*$sal +
-							(-0.340597039004E-3))));
-
-    my $velocity = $c0 + $dltact + $dltacs + $dltacp + $dcstp;
-
-				# Output the result if it's "okay"
-    if ($temp > $ColdLimit)   {
-      printf Out "%.2f %.2f\n", $depth, $velocity;
-    }
-  }				# end of (too) simple input length check
-}
-
-#
-print STDERR "Processed ", $count," lines of XBT data\n";
-
-# Close the input and output files
-close(F);
-close(Out);
-
-# End it all
-print "\nAll done!\n";
-exit 0;
-
-
-#----------------------------
-# useage();
-sub useage {
-
-
-    print "\nUsage: $ProgramName -Ifile \n";
-    print "\nVersion: $Id: mbm_xbt 2227 2015-02-05 21:12:31Z caress $\n";
-    print "\t[-C -Ssalinity -Fformat -Llatitude -V -H -C]\n\n";
-
-    print "\tPerl shellscript to translate various XBT (with -F option) \n";
-    print "\tdata from depth and temperature into depth and sound speed.\n";
-    print "\tHeader lines are turned into comments (#) characters.\n";
-    print "\tThe output filename consists of the input filename \n";
-    print "\twith the suffix .sv\n";
-    print "\tIF you have a decent AVERAGE saliity, use -S salinity...\n\n";
-    print "   Currently supported input formats:\n";
-    print "      XBT       Format Number\n";
-    print "   --------------------------------------------------\n";
-    print "    Sparton                                       1\n";
-    print "    Sippican MK12 export data format              2\n";
-    print "    Sippican MK21 (edf)                           3\n";
-    print "\n";
-}				# End of useage()
-
-
-
-#-----------------------------------------------------------------------
-# SpartonHeader - deals with the Sparton Header, which is made up of
-# 12 records
-#
-# Usage:
-#      SpartonHeader(FileHandleIn, FileHandleOUt);
-#
-
-sub SpartonHeader (*$*$;) {
-   my $InFileHandle = shift;	# get the input file handle
-   my $Out = shift;	#  and the output file handle
-   my $Done=0;
-   my $count=0;
-   while  ( $Done == 0) {
-       $In=<$InFileHandle>;
-       chomp($In);			# dump the end of line stuff
-       $count++;
-
-       if (( $count == 1 ) && ( $In !=~ "SOC BT/SV PROCESSOR")) {
-	   die "This is does not look like a SPARTON BT/SV data file $F: $!";
-       }
-
-   # Step one, insert comments in front of the output data
-       if ( $count == 1 ) {
-	   printf ( $Out "# SOURCE:   %s\n", $In);
-       }
-       if ( $count == 2 ) {
-	   printf ($Out "# DATE:      %s\n", $In);
-       }
-       if ( $count == 3 ) {
-	   printf ($Out "# TIME:      %s\n ", $In);
-       }
-       if ( $count == 4 ) {
-	   printf ($Out "# UNKNOWN:   %s\n ", $In);
-       }
-       if ( $count == 5 ) {
-	   printf ($Out "# UNKNOWN:   %s\n", $In);
-       }
-       if ( $count == 6 ) {
-	   printf ($Out "# SHIP:      %s\n", $In);
-       }
-       if ( $count == 7 ) {
-	   printf ($Out "# CRUISE:    %s\n", $In);
-       }
-       if ( $count == 8 ) {
-	   printf ($Out "# LATITUDE:  %s\n", $In);
-       }
-       if ( $count == 9 ) {
-	   printf ($Out "# LONGITUDE: %s\n", $In);
-       }
-       if ( $count == 10 ) {
-	   printf ($Out "# DEPTH:     %s\n ", $In);
-       }
-       if ( $count == 11 ) {
-	   printf ($Out "# SPEED:     %s\n", $In);
-       }
-       if ( $count == 12 ) {
-	   printf ($Out "# SURF TEMP: %s\n", $In);
-       }
-       if ( $count == 13 )  {
-	   $Done=1;
-       }
-   }
-
-
-#-----------------------------------------------------------------------
-# MK12header - deals with the MK12 XBT Header, which is of variable
-# length. This routine parses the incomming data and watches for a
-# numeric pattern of ##### ###### to indicate the start of data.
-#
-# Usage:
-#      MK12header(InFileHandler, OutFileHandler);
-#
-sub MK12header(*$*$;) {
-  my $InFileHandle = shift;	# get the input file handle
-  my $OutFileHandle = shift;	#  and the output file handle
-  my $Done=0;
-  while  ( $Done == 0) {
-    $In=<$InFileHandle>;
-    chomp($In);			# dump the end of line stuff
-    printf $OutFileHandle "# %s\n", $In; # copy header info to output file
-
-    if (substr($In,0,1) eq "\t"
-        || $In =~' \(m\)  \(C\)') {
-      $Done=1;
-    }
-  }
-}			 # End of MK12header()
-
-
-#---------------------------------------------------------------
-# MK21header
-# Code to parse a Sippican Mark 21 headder of and EDF file. This header
-# seems to be a bit more organized than the MK12 version.....
-# It assumes that:
-#     1) the last line of the header starts with "Depth"
-#     2) the first column of data is depth in meters
-#     3) the next column is temperature in degress
-#     4) There may be other columns
-#
-#
-sub MK21header(*$*$;) {		# Two HANDLES required
-    my $InFileHandle = shift;	# get the input file handle
-    my $OutFileHandle = shift;	#  and the output file handle
-    my $Done=0;
-    while  ( $Done == 0) {
-      $In=<$InFileHandle>;	# get one line from the file
-      chomp($In);		# clean up the end of line
-
-                                # copy header info to output file as comment
-      printf $OutFileHandle "# %s\n", $In;
-
-	if ($In =~ 'Depth \(m\)') {
-#	if ($In =~ 'Depth (m)') {
-#	    printf("End of header\n\n");
-	    $Done=1;
-	}
-    }
-}		# end of MK21header
-
-}				# End of this file
diff --git a/src/macros/mbm_xyplot b/src/macros/mbm_xyplot
deleted file mode 100755
index 6ea157f..0000000
--- a/src/macros/mbm_xyplot
+++ /dev/null
@@ -1,2250 +0,0 @@
-#!/usr/bin/env perl
-#--------------------------------------------------------------------
-#    The MB-system:	mbm_xyplot.perl	8/6/95
-#    $Id: mbm_xyplot 2234 2015-03-05 07:41:54Z caress $
-#
-#    Copyright (c) 1993-2015 by
-#    D. W. Caress (caress at mbari.org)
-#      Monterey Bay Aquarium Research Institute
-#      Moss Landing, CA
-#    and D. N. Chayes (dale at lamont.ldgo.columbia.edu)
-#      Lamont-Doherty Earth Observatory
-#      Palisades, NY  10964
-#
-#    See README file for copying and redistribution conditions.
-#--------------------------------------------------------------------
-#
-# Command:
-#   mbm_xyplot
-#
-# Purpose:
-#   Macro to generate a shellscript of GMT commands which,
-#   when executed, will generate a Postscript plot of xy data.
-#   Axes may be linear, log,  or any of several geographic
-#   projections. Data may be plotted as symbols or lines.
-#   The plot will be scaled to fit on the specified page size
-#   or, if the scale is user defined, the page size will be
-#   chosen in accordance with the plot size. The primary purpose
-#   of this macro is to allow the simple, semi-automated
-#   production of nice looking plots with a few command line
-#   arguments. For users seeking more control over the plot
-#   appearance, a number of additional optional arguments are
-#   provided. Truly ambitious users may edit the plot shellscript
-#   to take advantage of GMT capabilites not supported by this
-#   macro.
-#
-# Basic Usage:
-#   mbm_xyplot -I[filepars:]file [ -Gfill -H -Oroot
-#            -Ppagesize -Ssymbol/size -Uorientation
-#            -V -Wpen ]
-#
-# Additional Options:
-#            [-Btickinfo -Jprojection[/scale | width]
-#            -Ltitle[:scale_label] -Mmisc -Q -Rw/e/s/n -X]
-#
-# Miscellaneous Options:
-#            [-MGDgmtdef/value -MGL[f][x]lon0/lat0/slat/length[units][+llabel]
-#            -MGTx/y/size/angle/font/just/text
-#            -MGU[/dx/dy/][label] ]
-#
-# Author:
-#   David W. Caress
-#   Lamont-Doherty Earth Observatory
-#   Palisades, NY  10964
-#   August 9, 1995
-#
-# Version:
-#   $Id: mbm_xyplot 2234 2015-03-05 07:41:54Z caress $
-#
-#
-$program_name = "mbm_xyplot";
-
-# set page size database
- at page_size_names = (
-	"a", "b", "c", "d", "e", "f", "e1",
-	"a0", "a1", "a2", "a3", "a4", "a5", "a6", "a7", "a8", "a9", "a10",
-	"b0", "b1", "b2", "b3", "b4", "b5", "b6", "b7", "b8", "b9", "b10",
-	"c0", "c1", "c2", "c3", "c4", "c5", "c6", "c7",
-	"m1", "m2", "m3", "m4", "m5", "m6");
-%page_width_in = (
-	"a",     8.50,   "b",    11.00,   "c",    17.00,   "d",    22.00,
-	"e",    34.00,   "f",    28.00,   "e1",   44.00,   "a0",   33.11,
-	"a1",   23.39,   "a2",   16.54,   "a3",   11.69,   "a4",    8.27,
-	"a5",    5.83,   "a6",    4.13,   "a7",    2.91,   "a8",    2.05,
-	"a9",    1.46,   "a10",   1.02,   "b0",   39.37,   "b1",   27.83,
-	"b2",   19.68,   "b3",   13.90,   "b4",    9.84,   "b5",    6.93,
-	"b6",    4.92,   "b7",    3.46,   "b8",    2.44,   "b9",    1.73,
-	"b10",   1.22,   "c0",   36.00,   "c1",   25.60,   "c2",   18.00,
-	"c3",   12.80,   "c4",    9.00,   "c5",    6.40,   "c6",    4.50,
-	"c7",    3.20,   "m1",   54.00,   "m2",   54.00,   "m3",   54.00,
-	"m4",   60.00,   "m5",   60.00,   "m6",   60.00);
-%page_height_in = (
-	"a",    11.00,   "b",    17.00,   "c",    22.00,   "d",    34.00,
-	"e",    44.00,   "f",    40.00,   "e1",   68.00,   "a0",   46.81,
-	"a1",   33.11,   "a2",   23.39,   "a3",   16.54,   "a4",   11.69,
-	"a5",    8.27,   "a6",    5.83,   "a7",    4.13,   "a8",    2.91,
-	"a9",    2.05,   "a10",   1.46,   "b0",   56.67,   "b1",   39.37,
-	"b2",   27.83,   "b3",   19.68,   "b4",   13.90,   "b5",    9.84,
-	"b6",    6.93,   "b7",    4.92,   "b8",    3.46,   "b9",    2.44,
-	"b10",   1.73,   "c0",   51.20,   "c1",   36.00,   "c2",   25.60,
-	"c3",   18.00,   "c4",   12.80,   "c5",    9.00,   "c6",    6.40,
-	"c7",    4.50,   "m1",   72.00,   "m2",   84.00,   "m3",   96.00,
-	"m4",   72.00,   "m5",   84.00,   "m6",   96.00);
-%page_anot_font = (
-	"a",     8,   "b",    12,   "c",    16,   "d",    24,
-	"e",    24,   "f",    24,   "e1",   24,   "a0",   24,
-	"a1",   24,   "a2",   16,   "a3",   12,   "a4",    8,
-	"a5",    6,   "a6",    6,   "a7",    6,   "a8",    4,
-	"a9",    4,   "a10",   4,   "b0",   24,   "b1",   24,
-	"b2",   16,   "b3",   16,   "b4",   12,   "b5",    8,
-	"b6",    6,   "b7",    4,   "b8",    4,   "b9",    4,
-	"b10",   4,   "c0",   24,   "c1",   24,   "c2",   16,
-	"c3",   12,   "c4",    8,   "c5",    6,   "c6",    6,
-	"c7",    6,   "m1",   24,   "m2",   24,   "m3",   24,
-	"m4",   24,   "m5",   24,   "m6",   24);
-%page_header_font =(
-	"a",    10,   "b",    15,   "c",    20,   "d",    30,
-	"e",    30,   "f",    30,   "e1",   30,   "a0",   30,
-	"a1",   30,   "a2",   20,   "a3",   15,   "a4",   10,
-	"a5",    8,   "a6",    8,   "a7",    8,   "a8",    5,
-	"a9",    5,   "a10",   5,   "b0",   30,   "b1",   30,
-	"b2",   20,   "b3",   20,   "b4",   15,   "b5",   10,
-	"b6",    8,   "b7",    5,   "b8",    5,   "b9",    5,
-	"b10",   5,   "c0",   30,   "c1",   30,   "c2",   20,
-	"c3",   15,   "c4",   10,   "c5",    8,   "c6",    8,
-	"c7",    8,   "m1",   30,   "m2",   30,   "m3",   30,
-	"m4",   30,   "m5",   30,   "m6",   30);
-%page_gmt_name =     (
-	"a",     "archA",   "b",     "archB",   "c",     "archC",   "d",     "archD",
-	"e",     "archE",   "f",     "B0",      "e1",    "B0",      "a0",    "A0",
-	"a1",    "A1",      "a2",    "A2",      "a3",    "A3",      "a4",    "A4",
-	"a5",    "A5",      "a6",    "A6",      "a7",    "A7",      "a8",    "A8",
-	"a9",    "A9",      "a10",   "A10",     "b0",    "B0",      "b1",    "B1",
-	"b2",    "B2",      "b3",    "B3",      "b4",    "B4",      "b5",    "B5",
-	"b6",    "A6",      "b7",    "A7",      "b8",    "A8",      "b9",    "A9",
-	"b10",   "A10",     "c0",    "B0",      "c1",    "B1",      "c2",    "B2",
-	"c3",    "B3",      "c4",    "B4",      "c5",    "B5",      "c6",    "B6",
-	"c7",    "B7",      "m1", "Custom_4241x5655",    "m2",   "Custom_4241x6578",
-	"m3",   "Custom_4241x7540",  "m4",   "Custom_4712x5655",
-	"m5",   "Custom_4712x6578",  "m6",   "Custom_4712x7540");
-%xpsview_mem =     (
-	"a",     "4m",   "b",     "6m",   "c",     "8m",   "d",    "12m",
-	"e",    "16m",   "f",    "16m",   "e1",   "16m",   "a0",   "16m",
-	"a1",   "12m",   "a2",    "8m",   "a3",    "6m",   "a4",    "4m",
-	"a5",    "4m",   "a6",    "4m",   "a7",    "4m",   "a8",    "4m",
-	"a9",    "4m",   "a10",   "4m",   "b0",   "16m",   "b1",   "12m",
-	"b2",    "8m",   "b3",    "8m",   "b4",    "6m",   "b5",    "4m",
-	"b6",    "4m",   "b7",    "4m",   "b8",    "4m",   "b9",    "4m",
-	"b10",   "4m",   "c0",   "16m",   "c1",   "12m",   "c2",    "8m",
-	"c3",    "6m",   "c4",    "4m",   "c5",    "4m",   "c6",    "4m",
-	"c7",    "4m",   "m1",   "16m",   "m2",   "16m",   "m3",   "16m",
-	"m4",   "16m",   "m5",   "16m",   "m6",   "16m");
-
-# Determine the GMT version
- at grdinfo = `grdinfo 2>&1`;
-while (@grdinfo)
-	{
-	$line = shift @grdinfo;
-	if ($line =~
-		/^grdinfo\s+(\S+)\s+\S+/)
-		{
-		($gmt_version) = $line =~
-			/^grdinfo\s+(\S+)\s+\S+/;
-		}
-	}
-
-# Get the current working directory.
-$current_working_dir = `pwd`;
-
-# Deal with command line arguments
-$command_line = "@ARGV";
-&MBGetopts('B:b:G:g:HhI+i+J:j:L:l:M+m+NnO:o:P:p:QqR:r:S:s:TtU:u:VvW:w:Xx:Zz');
-$tick_info = 		($opt_B || $opt_b);
-$xyfill = 		($opt_G || $opt_g);
-$help =    		($opt_H || $opt_h);
-$file_data =    	($opt_I || $opt_i);
-$map_scale =    	($opt_J || $opt_j);
-$labels =    		($opt_L || $opt_l);
-$misc = 		($opt_M || $opt_m);
-$xysegment = 		($opt_N || $opt_n);
-$root =    		($opt_O || $opt_o);
-$pagesize = 		($opt_P || $opt_p);
-$no_view_ps = 		($opt_Q || $opt_q);
-$bounds = 		($opt_R || $opt_r);
-$xysymbol = 		($opt_S || $opt_s);
-$coast_control = 	($opt_T || $opt_t);
-$orientation = 		($opt_U || $opt_u);
-$verbose = 		($opt_V || $opt_v);
-$xypen = 		($opt_W || $opt_w);
-$execute = 		($opt_X || $opt_x);
-$delete_temp_files = 	($opt_Z || $opt_z);
-
-# print out help message if required
-if ($help)
-	{
-	print "\n$program_name:\n";
-	print "\nVersion: $Id: mbm_xyplot 2234 2015-03-05 07:41:54Z caress $\n";
-	print "\nMacro to generate a shellscript of GMT commands which,  \n";
-	print "when executed, will generate a Postscript plot of xy data. \n";
-	print "Axes may be linear, log,  or any of several geographic  \n";
-	print "projections. Data may be plotted as symbols or lines. \n";
-	print "The plot will be scaled to fit on the specified page size  \n";
-	print "or, if the scale is user defined, the page size will be  \n";
-	print "chosen in accordance with the plot size. The primary purpose  \n";
-	print "of this macro is to allow the simple, semi-automated \n";
-	print "production of nice looking plots with a few command line \n";
-	print "arguments. For users seeking more control over the plot \n";
-	print "appearance, a number of additional optional arguments are \n";
-	print "provided. Truly ambitious users may edit the plot shellscript  \n";
-	print "to take advantage of GMT capabilites not supported by this  \n";
-	print "macro. \n";
-	print "\nBasic Usage: \n";
-	print "\t$program_name -I[filepars:]file [ -Gfill -H -Oroot \n";
-	print "\t\t-Ppagesize -Ssymbol/size -Uorientation  \n";
-	print "\t\t-V -Wpen ]\n";
-	print "Additional Options:\n";
-	print "\t\t[-Btickinfo -Jprojection[/scale | width]\n";
-	print "\t\t-Ltitle[:scale_label] -Mmisc -Q -Rw/e/s/n -X]\n";
-	print "Miscellaneous Options:\n";
-	print "\t\t[-MGDgmtdef/value -MGL[f][x]lon0/lat0/slat/length[m]\n";
-	print "\t\t-MGTx/y/size/angle/font/just/text\n";
-	print "\t\t-MGU[/dx/dy/][label] ]\n";
-	exit 0;
-	}
-
-# check for input file
-if (!$file_data)
-	{
-	print "\a";
-	die "\nNo input file specified!\n$program_name aborted\n";
-	}
-
-# parse misc commands
-if ($misc)
-	{
-	@misc_cmd = split(/:::::::/, $misc);
-	foreach $cmd (@misc_cmd) {
-
-		# deal with general options
-		##############################
-
-		# set GMT default values
-		if ($cmd =~ /^[Gg][Dd]./)
-			{
-			($gmt_def) = $cmd =~
-				/^[Gg][Dd](\S+)/;
-			push(@gmt_defs, $gmt_def);
-			}
-
-		# set map scale
-		if ($cmd =~ /^[Gg][Ll]./)
-			{
-			($length_scale) = $cmd =~
-				/^[Gg][Ll](\S+)/;
-			}
-
-		# set text labels
-		if ($cmd =~ /^[Gg][Tt]./)
-			{
-			($tx, $ty, $tsize, $tangle, $font, $just, $txt)
-			    = $cmd
-			    =~ /^[Gg][Pp](\S+)\/(\S+)\/(\S+)\/(\S+)\/(\S+)\/(\S+)\/(.+)/;
-			if ($txt)
-			    {
-			    ($text_info) = $cmd =~
-				/^[Gg][Tt](.*)/;
-			    push(@text, $text_info);
-			    }
-			else
-			    {
-			    print "\nInvalid text label ignored: $cmd\n";
-			    }
-			}
-
-		# set unix time stamp
-		if ($cmd =~ /^[Gg][Uu]./)
-			{
-			($unix_stamp) = $cmd =~ /^[Gg][Uu](\S+)/;
-			$unix_stamp_on = 1;
-			}
-		elsif ($cmd =~ /^[Gg][Uu]/)
-			{
-			$unix_stamp_on = 1;
-			}
-
-		# deal with pscoast options
-		##############################
-
-		# set pscoast lake fill
-		if ($cmd =~ /^[Tt][Cc]./)
-			{
-			($coast_lakefill) = $cmd =~ /^[Tt][Cc](.+)/;
-			$coast_control = 1;
-			}
-
-		# set pscoast resolution
-		if ($cmd =~ /^[Tt][Dd]./)
-			{
-			($coast_resolution) = $cmd =~ /^[Tt][Dd](.+)/;
-			}
-
-		# set pscoast dry fill
-		if ($cmd =~ /^[Tt][Gg]./)
-			{
-			($coast_dryfill) = $cmd =~ /^[Tt][Gg](.+)/;
-			$coast_control = 1;
-			}
-
-		# set pscoast rivers
-		if ($cmd =~ /^[Tt][Ii]./)
-			{
-			($coast_river) = $cmd =~ /^[Tt][Ii](.+)/;
-			$coast_control = 1;
-			}
-
-		# set pscoast national boundaries
-		if ($cmd =~ /^[Tt][Nn]./)
-			{
-			($coast_boundary) = $cmd =~ /^[Tt][Nn](.+)/;
-			push(@coast_boundaries, $coast_boundary);
-			$coast_control = 1;
-			}
-
-		# set pscoast wet fill
-		if ($cmd =~ /^[Tt][Ss]./)
-			{
-			($coast_wetfill) = $cmd =~ /^[Tt][Ss](.+)/;
-			$coast_control = 1;
-			}
-
-		# set pscoast coastline pen
-		if ($cmd =~ /^[Tt][Ww]./)
-			{
-			($coast_pen) = $cmd =~ /^[Tt][Ww](.+)/;
-			$coast_control = 1;
-			}
-		}
-	}
-
-# set page size
-if (!$pagesize)
-{
-    $pagesize = "a";
-}
-else
-{
-    $pagesize =~ tr/A-Z/a-z/;
-    if (!$page_width_in{$pagesize})
-    {
-	$pagesize = "a";
-    }
-}
-
-# use mbdefaults to get the current system default postscript viewer
-$ps_viewer = "ghostview";
- at mbdefaults = `mbdefaults`;
-while (@mbdefaults)
-        {
-        $line = shift @mbdefaults;
-        if ($line =~ /ps viewer:\s+(\S+)/)
-                {
-                ($ps_viewer) = $line =~ /ps viewer:\s+(\S+)/;
-                 }
-        }
-
-# check environment variable
-if ($ENV{"MB_PS_VIEWER"})
-	{
-	$ps_viewer = $ENV{"MB_PS_VIEWER"};
-	}
-
-# set default xy control values
-if (!$xysymbol)
-{
-    $xysymbol = "N";
-}
-if (!$xyfill)
-{
-    $xyfill = "N";
-}
-if (!$xypen)
-{
-    $xypen = "N";
-}
-if (!$xysegment)
-{
-    $xysegment = "N";
-}
-else
-{
-    $xysegment = "Y";
-}
-
-# Some notes about how data files are processed:
-
-# mbm_xyplot will plot multiple data sets on a single plot using
-# either of two mechanisms. The first method is to specify multiple
-# input file flags and associated arguments ( e.g. mbm_xyplot
-# -i[fileargs]:file -i[fileargs]:file ...). The second method is to
-# use the utilize the multi-segemnt feature psxy. The program allows
-# multiple "segments" of x,y pairs to be listed in a single file each
-# separated by a single line having a special character. The default
-# character is ">", and indeed that is the ONLY character supported
-# here.
-
-# When multiple flags are specified as described above, MBGetopts will
-# return their arguments concatinated by ":::::::". The first line
-# below splits those arguments so they may be processed separately for
-# each file.
-
-# Each file may have any of several optional arguments. Most are quite
-# straightforward, however the column flag (C) warrents some
-# explaination. The column flag allows the user to specify the columns
-# to be plotted by utilizing a simple syntax in which a column is
-# specified by c[N] where N deones the column number. The full syntax
-# is then c#[xcol]_c#[ycol] where the underbar delimits the syntax for
-# the x column and y columns respectively.
-
- at data_file_list = split(/:::::::/, $file_data);
-foreach $xyfile_raw (@data_file_list) {
-    # set default parameters
-    $xysymbol_f = $xysymbol;
-    $xyfill_f = $xyfill;
-    $xypen_f = $xypen;
-    $xysegment_f = $xysegment;
-    $delimiter_f = '\s+';
-    $xmath_f='$line[0]';
-    $ymath_f='$line[1]';
-
-    # figure out how many parameters to set for each file
-    @filearg = split(/:/, $xyfile_raw);
-	for ($i = 0; $i < $#filearg; $i++) {
-	    if ($filearg[$i] =~ /S(\S+)/)
-	    {
-		($xysymbol_f) = $filearg[$i] =~ /S(\S+)/;
-	    }
-	    if ($filearg[$i] =~ /G(\S+)/)
-	    {
-		($xyfill_f) = $filearg[$i] =~ /G(\S+)/;
-	    }
-	    if ($filearg[$i] =~ /W(\S+)/)
-			{
-			    ($xypen_f) = $filearg[$i] =~ /W(\S+)/;
-			}
-	    if ($filearg[$i] =~ /M/)
-	    {
-		$xysegment_f = "Y";
-			}
-	    if ($filearg[$i]=~ /D/)
-	    {
-		($delimiter_f) = $filearg[$i] =~ /D(\S+)/;
-	    }
-	    if ($filearg[$i]=~ /C/)
-	    {
-		($xmath_f,$ymath_f) = $filearg[$i] =~ /C(\S+)_(\S+)/;
-
-		# Turn the c[] expresssions used in the command line
-		# arguments to ones that perl can evaluate, by
-		# substituing '$line' for c and subtracting one from
-		# the column number.
-
-		$xmath_f =~ s/c\[(\d+)\]/\$line[$1-1]/g;
-		$ymath_f =~ s/c\[(\d+)\]/\$line[$1-1]/g;
-		$xmath_f =~ s/\#/\$linecnt/g;
-		$ymath_f =~ s/\#/\$linecnt/g;
-
-
-	    }
-
-	}
-
-    # Push each argument into parallel arrays.
-    push(@xysymbols, $xysymbol_f);
-    push(@xyfills, $xyfill_f);
-    push(@xypens, $xypen_f);
-    push(@xysegments, $xysegment_f);
-    push(@xyfiles, $filearg[$#filearg]);
-    push(@delimiters, $delimiter_f);
-    push(@xmath, $xmath_f);
-    push(@ymath, $ymath_f);
-
-}
-
-# check that files are ok
-if (scalar(@xyfiles) <= 0)
-	{
-	    print "\a";
-	    die "\nNo input file specified!\n$program_name aborted\n";
-	}
-
-foreach $xyfile (@xyfiles) {
-    if (! -e $xyfile)
-    {
-	print "\a";
-	die "\nInput file $xyfile cannot be opened!\n$program_name aborted\n";
-    }
-}
-
-# set output root if needed
-if (!$root)
-{
-    $root = $xyfiles[0];
-}
-
-# Manually extract the data from a larger file.
-$i=0;
-foreach $xyfile(@xyfiles){
-    $INFILE="<$xyfile";
-
-    $OUTFILE=">$xyfile$i.$$";
-    # Strip off the leading path and substitute the current working directory.
-    $OUTFILE =~ s/^\>\//.*\/\>$current_working_dir/g;
-
-
-    open INFILE or die "Cannot open $xyfile: $'";
-    open OUTFILE or die "Cannot open temporary file: $'";
-    $linecnt=1;
-
-
-    while (<INFILE>) {
-	chomp;
-
-
-	# Here we check to see if a line has the standard psxy segment
-	# separater. If it does, we print print it out directly to the
-	# output file, and continue processing lines.
-
-	if ( $_ =~ m/\>/ ) {
-	    print(OUTFILE "$_\n");
-	}else{
-
-	    # Here we check to see if the line starts with a
-	    # delimiter.  If it does, all the first column will be
-	    # empty. For files with white-space delimiters, this is
-	    # counter intuitive. So we remove the leading delimiter
-	    # when it occurs by substituting nothing for it.
-
-	    if ( $_ =~ /^$delimiters[$i]/ ) {
-		$_ =~ s/^$delimiters[$i]//;
-	    }
-
-
-	@line = split /$delimiters[$i]/, $_;
-
-
-        $ok2use = 1;
-
-        # Evaluate the perl/math expressions. If there's an error, don't quit
-	# but warn to STDERR. Divide-by-zero errors will be caught by this.
-	my $xval = eval $xmath[$i];
-	if ($@) {
-            $ok2use = 0;
-        }
-
-	my $yval = eval $ymath[$i];
-	if ($@) {
-            $ok2use = 0;
-        }
-
-	# Verify that we got numbers...
-	if (! ($xval =~ m/-?\d*\.?\d*|-?\.\d+/ &&
-	       $yval =~ m/-?\d*\.?\d*|-?\.\d+/)  ) {
-            $ok2use = 0;
-        }
-
-	# Verify that we do not have a NaN...
-	if ($xval =~ /nan/ || $yval =~ /nan/ || $xval =~ /nan/ || $yval =~ /nan/) {
-            $ok2use = 0;
-	}
-
-
-        if ($ok2use == 1) {
-            push(@xvalues, $xval);
-            push(@yvalues, $yval);
-            print(OUTFILE "$xval\t$yval\n");
-        } else {
- 	    print STDERR "WARNING!!! NON-NUMERIC RESULT DETECTED! X: $xval Y: $yval Skipping...\n";
-        }
-
-    }
-	$linecnt+=1;
-    }
-    $i+=1;
-    close INFILE;
-    close OUTFILE;
-
-    # Reset the file names to the new temporarily files.
-    $OUTFILE =~ s/^>//;
-    $xyfile="$OUTFILE";
-}
-
-
-# get limits of files by sorting all the data.
-if (!$bounds)
-	{
-	    @sorted_xvalues = sort {$a <=> $b} @xvalues;
-	    $xmin = $sorted_xvalues[0];
-	    $xmax = $sorted_xvalues[$#sorted_xvalues];
-	    @sorted_yvalues = sort {$a <=> $b} @yvalues;
-	    $ymin = $sorted_yvalues[0];
-	    $ymax = $sorted_yvalues[$#sorted_yvalues];
-	}
-
-# use user defined bounds
-if ($bounds)
-	{
-	if ($bounds =~ /^\S+\/\S+\/\S+\/\S+r$/)
-		{
-		($xmin_raw,$ymin_raw,$xmax_raw,$ymax_raw) = $bounds =~
-			/^(\S+)\/(\S+)\/(\S+)\/(\S+)r$/;
-		$xmin = &GetDecimalDegrees($xmin_raw);
-		$xmax = &GetDecimalDegrees($xmax_raw);
-		$ymin = &GetDecimalDegrees($ymin_raw);
-		$ymax = &GetDecimalDegrees($ymax_raw);
-		$use_corner_points = 1;
-		$bounds_plot = $bounds;
-		}
-	elsif ($bounds =~ /^\S+\/\S+\/\S+\/\S+$/)
-		{
-		($xmin_raw,$xmax_raw,$ymin_raw,$ymax_raw) = $bounds =~
-			/(\S+)\/(\S+)\/(\S+)\/(\S+)/;
-		$xmin = &GetDecimalDegrees($xmin_raw);
-		$xmax = &GetDecimalDegrees($xmax_raw);
-		$ymin = &GetDecimalDegrees($ymin_raw);
-		$ymax = &GetDecimalDegrees($ymax_raw);
-		$bounds_plot = $bounds;
-		}
-	elsif ($bounds =~ /^r$/)
-		{
-		$use_corner_points = 1;
-		$bounds_plot = sprintf ("%1.8g/%1.8g/%1.8g/%1.8gr",
-			$xmin, $ymin, $xmax, $ymax);
-		}
-	}
-
-# set bounds string for plotting if not already set
-if (!$bounds_plot)
-	{
-	$bounds_plot = sprintf ("%1.8g/%1.8g/%1.8g/%1.8g",
-		$xmin, $xmax, $ymin, $ymax);
-	}
-
-## This checking no longer makes sense when the data could be for an xy plot
-## with one variable not changing. ie min=max.
-# check that there is data
-#if ($xmin >= $xmax || $ymin >= $ymax)
-#	{
-#	print "\a";
-#	die "Improper data limits: x: $xmin $xmax  y: $ymin $ymax\n$program_name aborted.\n"
-#	}
-
-# set the relevent page width and height
-&GetPageSize;
-
-# get user constraints on map scale
-if ($map_scale)
-	{
-	# sets $plot_scale or $plot_width if possible
-	&GetProjection;
-	}
-
-# set up for mapproject
-if (($use_scale && $plot_scale) || ($use_width && $plot_width))
-	{
-	($projection) = $map_scale =~ /^(\w)/;
-	($projection_pars) = $map_scale =~ /^$projection(\S+)/;
-	}
-elsif ($use_scale || $use_width)
-	{
-	($projection) = $map_scale =~ /^(\w)/;
-	($projection_pars) = $map_scale =~ /^$projection(\S+)/;
-	$projection_pars = "$projection_pars" . "$separator" . "$trial_value";
-	}
-else
-	{
-	$projection = "x";
-	$projection_pars = "1/1";
-	$use_scale = 1;
-	}
-
-# now find out the apparent size of the plot
-`echo $xmin $ymin > tmp$$.dat`;
-`echo $xmax $ymin >> tmp$$.dat`;
-`echo $xmax $ymax >> tmp$$.dat`;
-`echo $xmin $ymax >> tmp$$.dat`;
- at projected = `mapproject tmp$$.dat -J$projection$projection_pars -R$bounds_plot 2>&1 `;
-`/bin/rm -f tmp$$.dat`;
-print "mapproject tmp$$.dat -J$projection$projection_pars -R$bounds_plot\n";
-
-while (@projected)
-{
-    $line = shift @projected;
-print $line;
-    if(!$xxmin){
-	($xxmin,$yymin) = $line =~ /(\S+)\s+(\S+)/;
-	$xxmax = $xxmin;
-	$yymax = $yymin;
-    }
-    else
-    {
-	($xx,$yy) = $line =~ /(\S+)\s+(\S+)/;
-	$xxmin = ($xx < $xxmin ? $xx : $xxmin);
-	$xxmax = ($xx > $xxmax ? $xx : $xxmax);
-	$yymin = ($yy < $yymin ? $yy : $yymin);
-	$yymax = ($yy > $yymax ? $yy : $yymax);
-    }
-}
-$dxx = $xxmax - $xxmin;
-$dyy = $yymax - $yymin;
-
-
-# check for valid scaling
-if ($dxx == 0.0 && $dyy == 0.0)
-	{
-	print "\a";
-	die "Invalid projection specified - $program_name aborted\n";
-	}
-
-# figure out scaling issues
-
-if (($use_scale && $plot_scale) || ($use_width && $plot_width))
-	{
-	$plot_width = $dxx;
-	$plot_height = $dyy;
-
-	# decide which plot orientation to use
-	if ($orientation == 1)
-		{
-		$portrait = 1;
-		$width = $page_width_in{$pagesize};
-		$height = $page_height_in{$pagesize};
-		$width_max = $width_max_portrait;
-		$height_max = $height_max_portrait;
-		}
-	elsif ($orientation == 2)
-		{
-		$landscape = 1;
-		$width = $page_height_in{$pagesize};
-		$height = $page_width_in{$pagesize};
-		$width_max = $width_max_landscape;
-		$height_max = $height_max_landscape;
-		}
-	elsif ($dxx > $dyy)
-		{
-		$landscape = 1;
-		$width = $page_height_in{$pagesize};
-		$height = $page_width_in{$pagesize};
-		$width_max = $width_max_landscape;
-		$height_max = $height_max_landscape;
-		}
-	else
-		{
-		$portrait = 1;
-		$width = $page_width_in{$pagesize};
-		$height = $page_height_in{$pagesize};
-		$width_max = $width_max_portrait;
-		$height_max = $height_max_portrait;
-		}
-
-	# check if plot fits on page
-	if ($plot_width > $width_max || $plot_height > $height_max)
-		{
-		# try to find a sufficiently large pagesize
-		$pagesize_save = $pagesize;
-		foreach $elem (@page_size_names) {
-			$pagesize = "$elem";
-			&GetPageSize;
-			if ($portrait)
-				{
-				$width_max = $width_max_portrait;
-				$height_max = $height_max_portrait;
-				}
-			else
-				{
-				$width_max = $width_max_landscape;
-				$height_max = $height_max_landscape;
-				}
-			if (!$good_page &&
-				$plot_width <= $width_max
-				&& $plot_height <= $height_max)
-				{
-				$good_page = 1;
-				$pagesize_save = $pagesize;
-				}
-			}
-
-		# print out warning
-		if ($pagesize eq $pagesize_save)
-			{
-			print "\nWarning: Unable to fit plot on any available page size!\n";
-			print "\tThis plot will not be particularly useful!\n";
-			print "\tTry using a different scale or allow the program to set the scale!\n";
-			}
-
-		# reset the page size
-		$pagesize = $pagesize_save;
-		&GetPageSize;
-		if ($portrait)
-			{
-			$width = $page_width_in{$pagesize};
-			$height = $page_height_in{$pagesize};
-			}
-		else
-			{
-			$width = $page_height_in{$pagesize};
-			$height = $page_width_in{$pagesize};
-			}
-		}
-	}
-elsif ($use_scale && $projection =~ /^x.*/ && !$geographic)
-	{
-	# set size of plot according to orientation
-	if ($orientation == 1)
-		{
-		$portrait = 1;
-		$plot_scale_x = $width_max_portrait/$dxx;
-		$plot_scale_y = $height_max_portrait/$dyy;
-		$plot_scale = "$plot_scale_x/$plot_scale_y";
-		$width = $page_width_in{$pagesize};
-		$height = $page_height_in{$pagesize};
-		}
-	else
-		{
-		$landscape = 1;
-		$plot_scale_x = $width_max_landscape/$dxx;
-		$plot_scale_y = $height_max_landscape/$dyy;
-		$plot_scale = "$plot_scale_x/$plot_scale_y";
-		$width = $page_height_in{$pagesize};
-		$height = $page_width_in{$pagesize};
-		}
-
-	# set plot width
-	$plot_width = $dxx * $plot_scale_x;
-	$plot_height = $dyy * $plot_scale_y;
-
-	# construct plot scale parameters
-
-	## These lines break things. $projection_pars was already properly
-	## defined and $map_scale may not yet be defined. Moreover,
-	## $projection_pars should now contain JUST the scale values
-	## with no leading projection type.  The single line added
-	## is all that is required.
-	## Val Schmidt LDEO/Columbia OCTOBER 2003
-
-
-	#($projection_pars) = $map_scale =~ /^$projection(\S+)/;
-	#    $projection_pars = sprintf ("$projection_pars$separator%1.5g",
-	#				$plot_scale);
-	$projection_pars="$plot_scale";
-
-	}
-elsif ($use_width && $projection =~ /^X.*/ && !$geographic)
-	{
-	# set size of plot according to orientation
-	if ($orientation == 1)
-		{
-		$portrait = 1;
-		$plot_width_x = $width_max_portrait;
-		$plot_width_y = $height_max_portrait;
-		$plot_width = "$plot_width_x/$plot_width_y";
-		$width = $page_width_in{$pagesize};
-		$height = $page_height_in{$pagesize};
-		}
-	else
-		{
-		$landscape = 1;
-		$plot_width_x = $width_max_landscape;
-		$plot_width_y = $height_max_landscape;
-		$plot_width = "$plot_width_x/$plot_width_y";
-		$width = $page_height_in{$pagesize};
-		$height = $page_width_in{$pagesize};
-		}
-
-	# set plot width
-	$plot_scale_x = $plot_width / $dxx;
-	$plot_scale_y = $plot_height / $dyy;
-
-	# construct plot scale parameters
-
-	## These lines break things. $projection_pars was already properly
-	## defined and $map_scale may not yet be defined. Moreover,
-	## $projection_pars should now contain JUST the scale values
-	## with no leading projection type.  The single line added
-	## is all that is required.
-	## Val Schmidt LDEO/Columbia OCTOBER 2003
-
-	#($projection_pars) = $map_scale =~ /^$projection(\S+)/;
-	#$projection_pars = sprintf ("$projection_pars$separator%1.5g",
-	#				$plot_width);
-	$projection_pars="$plot_width";
-	}
-elsif ($use_scale)
-	{
-	# get landscape and portrait scales
-	$plot_scale_landscape = $width_max_landscape/$dxx;
-	if ($plot_scale_landscape*$dyy > $height_max_landscape)
-		{
-		$plot_scale_landscape = $height_max_landscape/$dyy;
-		}
-	$plot_scale_portrait = $width_max_portrait/$dxx;
-	if ($plot_scale_portrait*$dyy > $height_max_portrait)
-		{
-		$plot_scale_portrait = $height_max_portrait/$dyy;
-		}
-
-	# decide which plot orientation to use
-	if ($orientation == 1)
-		{
-		$portrait = 1;
-		$plot_scale = $plot_scale_portrait;
-		$width = $page_width_in{$pagesize};
-		$height = $page_height_in{$pagesize};
-		}
-	elsif ($orientation == 2)
-		{
-		$landscape = 1;
-		$plot_scale = $plot_scale_landscape;
-		$width = $page_height_in{$pagesize};
-		$height = $page_width_in{$pagesize};
-		}
-	elsif ($plot_scale_landscape > $plot_scale_portrait)
-		{
-		$landscape = 1;
-		$plot_scale = $plot_scale_landscape;
-		$width = $page_height_in{$pagesize};
-		$height = $page_width_in{$pagesize};
-		}
-	else
-		{
-		$portrait = 1;
-		$plot_scale = $plot_scale_portrait;
-		$width = $page_width_in{$pagesize};
-		$height = $page_height_in{$pagesize};
-		}
-
-	# set plot width
-	$plot_width = $dxx * $plot_scale;
-	$plot_height = $dyy * $plot_scale;
-
-	# reset plot_scale if ratio required
-	if ($use_ratio)
-		{
-		$top = int(1 / $plot_scale);
-		$plot_scale = "1:" . "$top";
-		}
-
-	# construct plot scale parameters
-	($projection_pars) = $map_scale =~ /^$projection(\S+)/;
-	$projection_pars = sprintf ("$projection_pars$separator%1.5g",
-					$plot_scale);
-
-	# handle special case for linear projections
-	if ($geographic)
-		{
-		$projection_pars = "$projection_pars" . "d";
-		}
-	}
-elsif ($use_width)
-	{
-	# get landscape and portrait heights
-	$plot_width_landscape = $height_max_landscape * $dxx / $dyy;
-	if ($plot_width_landscape > $width_max_landscape)
-		{
-		$plot_width_landscape = $width_max_landscape;
-		}
-	$plot_width_portrait = $height_max_portrait * $dxx / $dyy;
-	if ($plot_width_portrait > $width_max_portrait)
-		{
-		$plot_width_portrait = $width_max_portrait;
-		}
-
-	# decide which plot orientation to use
-	if ($orientation == 1)
-		{
-		$portrait = 1;
-		$plot_width = $plot_width_portrait;
-		$plot_height = $plot_width * $dyy / $dxx;
-		$width = $page_width_in{$pagesize};
-		$height = $page_height_in{$pagesize};
-		}
-	elsif ($orientation == 2)
-		{
-		$landscape = 1;
-		$plot_width = $plot_width_landscape;
-		$plot_height = $plot_width * $dyy / $dxx;
-		$width = $page_height_in{$pagesize};
-		$height = $page_width_in{$pagesize};
-		}
-	elsif ($plot_width_landscape > $plot_width_portrait)
-		{
-		$landscape = 1;
-		$plot_width = $plot_width_landscape;
-		$plot_height = $plot_width * $dyy / $dxx;
-		$width = $page_height_in{$pagesize};
-		$height = $page_width_in{$pagesize};
-		}
-	else
-		{
-		$portrait = 1;
-		$plot_width = $plot_width_portrait;
-		$plot_height = $plot_width * $dyy / $dxx;
-		$width = $page_width_in{$pagesize};
-		$height = $page_height_in{$pagesize};
-		}
-
-	# construct plot scale parameters
-	($projection_pars) = $map_scale =~ /^$projection(\S+)/;
-	$projection_pars = sprintf ("$projection_pars$separator%1.5g",
-					$plot_width);
-
-	# handle special case for linear projections
-	if ($geographic)
-		{
-		$projection_pars = "$projection_pars" . "d";
-		}
-	}
-
-# place the origin so plot is more or less centered
-$xoffset = ($width - $plot_width
-	- $space_left - $space_right) / 2 + $space_left;
-$yoffset = ($height - $plot_height
-	- $space_bottom - $space_top) / 2 + $space_bottom;
-
-# get plot degree annotation for geographic maps
-$degree_format = "ddd:mm";
-if (!$gridprojected)
-	{
-	$xsize = $xmax - $xmin;
-	$ysize = $ymax - $ymin;
-	if ($xsize < $ysize)
-		{
-		$size = $xsize;
-		}
-	else
-		{
-		$size = $ysize;
-		}
-	if ($size > 1.0)
-		{
-		$degree_format = "ddd";
-		}
-	elsif ($size > (1.0 / 60.0))
-		{
-		$degree_format = "ddd:mm";
-		}
-	else
-		{
-		$degree_format = "ddd:mm:ss";
-		}
-	}
-
-# set pscoast control
-if ($coast_control
-	&& !$coast_wetfill
-	&& !$coast_dryfill
-	&& !$coast_pen
-	&& !$coast_boundary
-	&& !$coast_river)
-	{
-	$coast_dryfill = "200";
-	$coast_pen = "1p";
-	}
-if ($coast_control
-	&& !$coast_resolution)
-	{
-	$coast_resolution = "f";
-	}
-
-# if length scale bar requested check to see if map center needs to be defined
-if ($length_scale && $length_scale =~ /\S+center\S+/)
-        {
-        # add map lon lat (or x y) center to the length scale argument
-        ($a, $c) = $length_scale =~ /(\S+)center(\S+)/;
-        $xcen = 0.5 * ($xmin + $xmax);
-        $ycen = 0.5 * ($ymin + $ymax);
-        $b = "$xcen/$ycen";
-        $length_scale = "$a$b$c";
-        }
-
-# come up with the filenames
-$cmdfile = "$root.cmd";
-$psfile = "$root.ps";
-$gmtfile = "gmt.conf\$\$";
-
-# set some gmtisms
-$first_gmt = 1;
-$first = "-X\$X_OFFSET -Y\$Y_OFFSET -K -V >! \$PS_FILE";
-$middle = "-K -O -V >> \$PS_FILE";
-$end = "-O -V >> \$PS_FILE";
-
-# set macro gmt default settings
-$gmt_def = "PROJ_LENGTH_UNIT/inch";
-push(@gmt_macro_defs, $gmt_def);
-$gmt_def = "PS_MEDIA/$page_gmt_name{$pagesize}";
-push(@gmt_macro_defs, $gmt_def);
-$gmt_def = "FONT_ANNOT_PRIMARY/$page_anot_font{$pagesize},Helvetica,black";
-push(@gmt_macro_defs, $gmt_def);
-$gmt_def = "FONT_ANNOT_SECONDARY/$page_anot_font{$pagesize},Helvetica,black";
-push(@gmt_macro_defs, $gmt_def);
-$gmt_def = "FONT_LABEL/$page_anot_font{$pagesize},Helvetica,black";
-push(@gmt_macro_defs, $gmt_def);
-$gmt_def = "FONT_TITLE/$page_header_font{$pagesize},Helvetica,black";
-push(@gmt_macro_defs, $gmt_def);
-$gmt_def = "PS_PAGE_ORIENTATION/LANDSCAPE";
-push(@gmt_macro_defs, $gmt_def);
-$gmt_def = "COLOR_BACKGROUND/black";
-push(@gmt_macro_defs, $gmt_def);
-$gmt_def = "COLOR_FOREGROUND/white";
-push(@gmt_macro_defs, $gmt_def);
-$gmt_def = "COLOR_NAN/white";
-push(@gmt_macro_defs, $gmt_def);
-$gmt_def = "FORMAT_GEO_MAP/$degree_format";
-push(@gmt_macro_defs, $gmt_def);
-
-# open the shellscript file
-if (!open(FCMD,">$cmdfile"))
-	{
-	print "\a";
-	die "Cannot open output file $cmdfile\nMacro $program_name aborted.\n";
-	}
-
-# write the shellscript header
-print FCMD "#! /bin/csh -f\n";
-print FCMD "#\n# Shellscript to create Postscript plot of data in grd file\n";
-print FCMD "# Created by macro $program_name\n";
-print FCMD "#\n# This shellscript created by following command line:\n";
-print FCMD "# $program_name $command_line\n";
-
-# Define shell variables
-print FCMD "#\n# Define shell variables used in this script:\n";
-print FCMD "set PS_FILE         = $psfile\n";
-print FCMD "set CPT_FILE        = $cptfile\n";
-print FCMD "set MAP_PROJECTION  = $projection\n";
-print FCMD "set MAP_SCALE       = $projection_pars\n";
-print FCMD "set MAP_REGION      = $bounds_plot\n";
-printf FCMD "set X_OFFSET        = %1.5g\n", $xoffset;
-printf FCMD "set Y_OFFSET        = %1.5g\n", $yoffset;
-
-# Set temporary GMT defaults
-print FCMD "#\n# Delete any existing gmt.conf file\n";
-print FCMD "if (-e gmt.conf) then\n";
-print FCMD "echo Deleting gmt.conf...\n";
-print FCMD "/bin/rm gmt.conf\n";
-print FCMD "endif\n";
-print FCMD "#\n# Set temporary GMT defaults\n";
-print FCMD "echo Setting temporary GMT defaults...\n";
-foreach $gmt_def (@gmt_macro_defs) {
-	($gmt_par, $gmt_var) = $gmt_def =~ /^([^\/]+)\/(.+)/;
-	print FCMD "gmt gmtset $gmt_par $gmt_var\n";
-	}
-
-# Reset GMT defaults as per user commands
-if (@gmt_defs)
-	{
-	print FCMD "#\n# Set user defined GMT defaults\n";
-	print FCMD "echo Setting user defined GMT defaults...\n";
-	foreach $gmt_def (@gmt_defs) {
-		($gmt_par, $gmt_var) = $gmt_def =~ /^([^\/]+)\/(.+)/;
-		print FCMD "gmtset $gmt_par $gmt_var\n";
-		}
-	}
-
-# figure out labels
-$nlabels = 0;
-if ($labels)
-	{
-	@labels_split = split(/:/, $labels);
-	$nlabels = @labels_split;
-	if ($nlabels > 0)
-		{
-		$tlabel = shift(@labels_split);
-		$tlabel =~ s/\\/\//g;
-		}
-	if ($nlabels > 1)
-		{
-		$xlabel = shift(@labels_split);
-		$xlabel =~ s/\\/\//g;
-		}
-	if ($nlabels > 2)
-		{
-		$ylabel = shift(@labels_split);
-		$ylabel =~ s/\\/\//g;
-		}
-	}
-if ($nlabels < 1)
-	{
-	if ($#xyfiles == 0)
-		{
-		$tlabel = "Data File $xyfiles[0]";
-		}
-	else
-		{
-		$tlabel = "Data Files";
-		foreach $xyfile (@xyfiles) {
-			$tlabel = $tlabel . " $xyfile";
-			}
-		}
-	}
-if ($nlabels < 2)
-	{
-	$xlabel = " ";
-	}
-if ($nlabels < 3)
-	{
-	$ylabel = " ";
-	}
-
-# set basemap axes annotation
-if ($tick_info)
-	{
-	$axes = "-B$tick_info";
-	}
-elsif ($projection =~ /^[Xx].*/ && !$geographic)
-	{
-	# figure out some reasonable tick intervals for the basemap
-	&GetBaseTickLinear;
-	$axes = "-Bx$base_tick_x+l\"$xlabel\" -By$base_tick_y+l\"$ylabel\"";
-	}
-else
-	{
-	# figure out some reasonable tick intervals for the basemap
-	&GetBaseTick;
-	$axes = "-B$base_tick";
-	}
-if ($tlabel)
-	{
-	$axes = "$axes -B+t\"$tlabel\"";
-	}
-
-# do xy plots
-for ($i = 0; $i < scalar(@xyfiles); $i++)
-	{
-	printf FCMD "#\n# Make xy data plot\n";
-	printf FCMD "echo Running psxy...\n";
-	printf FCMD "psxy $xyfiles[$i] \\\n\t";
-	printf FCMD "-J\$MAP_PROJECTION\$MAP_SCALE \\\n\t";
-	printf FCMD "-R\$MAP_REGION \\\n\t";
-	if ($xysymbols[$i] ne "N")
-		{
-		printf FCMD "-S$xysymbols[$i] \\\n\t";
-		}
-	if ($xypens[$i] ne "N")
-		{
-		printf FCMD "-W$xypens[$i] \\\n\t";
-		}
-	if ($xyfills[$i] ne "N")
-		{
-		printf FCMD "-G$xyfills[$i] \\\n\t";
-		}
-#	if ($xysegments[$i] ne "N")
-#		{
-#		printf FCMD "-M \\\n\t";
-#		}
-	if ($portrait)
-		{
-		printf FCMD "-P ";
-		}
-	if ($first_gmt == 1)
-		{
-		$first_gmt = 0;
-		printf FCMD "$first\n";
-		}
-	else
-		{
-		printf FCMD "$middle\n";
-		}
-	}
-
-# do coastline plots
-if ($coast_control)
-	{
-	printf FCMD "#\n# Make coastline data plot\n";
-	printf FCMD "echo Running pscoast...\n";
-	printf FCMD "pscoast \\\n\t";
-	printf FCMD "-J\$MAP_PROJECTION\$MAP_SCALE \\\n\t";
-	printf FCMD "-R\$MAP_REGION \\\n\t";
-	if ($coast_lakefill)
-		{
-		printf FCMD "-C$coast_lakefill \\\n\t";
-		}
-	if ($coast_resolution)
-		{
-		printf FCMD "-D$coast_resolution \\\n\t";
-		}
-	if ($coast_dryfill)
-		{
-		printf FCMD "-G$coast_dryfill \\\n\t";
-		}
-	if ($coast_river)
-		{
-		printf FCMD "-I$coast_river \\\n\t";
-		}
-	for ($i = 0; $i < scalar(@coast_boundaries); $i++)
-		{
-		printf FCMD "-N$coast_boundaries[$i] \\\n\t";
-		}
-	if ($coast_wetfill)
-		{
-		printf FCMD "-S$coast_wetfill \\\n\t";
-		}
-	if ($coast_pen)
-		{
-		printf FCMD "-W$coast_pen \\\n\t";
-		}
-	if ($portrait)
-		{
-		printf FCMD "-P ";
-		}
-	if ($first_gmt == 1)
-		{
-		$first_gmt = 0;
-		printf FCMD "$first\n";
-		}
-	else
-		{
-		printf FCMD "$middle\n";
-		}
-	}
-
-# do pstext plot
-if (@text)
-	{
-	printf FCMD "#\n# Make text labels\n";
-	printf FCMD "echo Running pstext...\n";
-	printf FCMD "pstext -J\$MAP_PROJECTION\$MAP_SCALE \\\n\t";
-	printf FCMD "-R\$MAP_REGION \\\n\t";
-	printf FCMD "$middle <<EOT\n";
-	foreach $text_info (@text) {
-	    ($tx, $ty, $tsize, $tangle, $font, $just, $txt) = $text_info
-		=~ /^(\S+)\/(\S+)\/(\S+)\/(\S+)\/(\S+)\/(\S+)\/(.+)/;
-	    print "text_info:$text_info\n";
-	    print "txt:$txt\n";
-	    print FCMD "$tx $ty $tsize $tangle $font $just $txt\n";
-	    }
-	print FCMD "EOT\n";
-	}
-
-# do psbasemap plot
-printf FCMD "#\n# Make basemap\n";
-printf FCMD "echo Running psbasemap...\n";
-printf FCMD "psbasemap -J\$MAP_PROJECTION\$MAP_SCALE \\\n\t";
-printf FCMD "-R\$MAP_REGION \\\n\t";
-printf FCMD "$axes \\\n\t";
-if ($length_scale)
-	{
-	printf FCMD "-L$length_scale \\\n\t";
-	}
-if ($unix_stamp_on && $unix_stamp)
-	{
-	printf FCMD "-U$unix_stamp \\\n\t";
-	}
-elsif ($unix_stamp_on)
-	{
-	printf FCMD "-U \\\n\t";
-	}
-if ($portrait)
-	{
-	printf FCMD "-P ";
-	}
-printf FCMD "$end\n";
-
-# delete surplus files
-print FCMD "#\n# Delete surplus files\n";
-print FCMD "echo Deleting surplus files...\n";
-print FCMD "/bin/rm -f gmt.conf\n";
-if (!$file_cpt)
-	{
-	print FCMD "/bin/rm -f \$CPT_FILE\n";
-	}
-if ($data_scale)
-	{
-	printf FCMD "/bin/rm -f $file_use\n";
-	}
-
-if ($delete_temp_files) {
-    foreach $file (@xyfiles) {
-	printf FCMD "/bin/rm -f $file \n";
-    }
-}
-
-# display image on screen if desired
-print FCMD "#\n# Run $ps_viewer\n";
-if ($ps_viewer eq "xpsview")
-	{
-	if ($portrait)
-		{
-		$view_pageflag = "-ps $pagesize -maxp $xpsview_mem{$pagesize}";
-		}
-	elsif ($landscape)
-		{
-		$view_pageflag = "-ps $pagesize -or landscape -maxp $xpsview_mem{$pagesize}";
-		}
-	}
-elsif ($ps_viewer eq "pageview")
-	{
-	if ($portrait)
-		{
-		$view_pageflag = "-w $page_width_in{$pagesize} -h $page_height_in{$pagesize}";
-		}
-	elsif ($landscape)
-		{
-		$view_pageflag = "-w $page_height_in{$pagesize} -h $page_width_in{$pagesize}";
-		}
-	}
-elsif ($ps_viewer eq "ghostview")
-	{
-	if ($portrait)
-		{
-		$view_pageflag = "-portrait -media BBox";
-		}
-	elsif ($landscape)
-		{
-		$view_pageflag = "-landscape -media BBox";
-		}
-	}
-elsif ($ps_viewer eq "gv")
-	{
-	if ($portrait)
-		{
-		$pagescale = 11.0 / $page_height_in{$pagesize};
-		if ($pagescale > 1.0)
-			{
-			$pagescale = 1.0;
-			}
-		$view_pageflag = "--orientation=portrait --media=BBox -scale=$pagescale";
-		}
-	elsif ($landscape)
-		{
-		$pagescale = 11.0 / $page_width_in{$pagesize};
-		if ($pagescale > 1.0)
-			{
-			$pagescale = 1.0;
-			}
-		$view_pageflag = "--orientation=landscape --media=BBox -scale=$pagescale";
-		}
-	}
-elsif ($ps_viewer eq "ggv")
-	{
-	if ($portrait)
-		{
-		$view_pageflag = "--geometry=portrait";
-		}
-	elsif ($landscape)
-		{
-		$view_pageflag = "--geometry=landscape";
-		}
-	}
-elsif ($ps_viewer eq "evince")
-	{
-	$view_pageflag = " ";
-	}
-if ($no_view_ps)
-	{
-        print FCMD "#if (!($#argv > 0 && (\"$1\" == \"-N\" || \"$1\" == \"-n\"))) then\n";
-	print FCMD "#echo Running $ps_viewer in background...\n";
-	print FCMD "#$ps_viewer $view_pageflag \$PS_FILE &\n";
-        print FCMD "#endif\n";
-	}
-else
-	{
-        print FCMD "if (!($#argv > 0 && (\"$1\" == \"-N\" || \"$1\" == \"-n\"))) then\n";
-	print FCMD "echo Running $ps_viewer in background...\n";
-	print FCMD "$ps_viewer $view_pageflag \$PS_FILE &\n";
-        print FCMD "endif\n";
-	}
-
-# claim it's all over
-print FCMD "#\n# All done!\n";
-print FCMD "echo All done!\n";
-
-# now close the shellscript and make it executable
-close FCMD;
-chmod 0775, $cmdfile;
-
-# tell program status
-if ($verbose)
-	{
-	print "\nProgram Status:\n";
-	print "--------------\n";
-	print "\n  GMT Version:\n";
-	print "    Version $gmt_version\n";
-	print "\n  Plot Style:\n";
-	if (@xyfiles)
-		{
-		print "    XY Plots of ", scalar(@xyfiles), " Datasets\n";
-		}
-	if ($coast_control)
-		{
-		print "    Coastline\n";
-		}
-	if (@text)
-		{
-		print "    ", scalar(@text), " Text labels\n";
-		}
-	if ($length_scale)
-		{
-		print "    Map distance scale\n";
-		}
-	if ($unix_stamp_on && $unix_stamp)
-		{
-		print "    Unix time stamp: $unix_stamp\n";
-		}
-	elsif ($unix_stamp_on)
-		{
-		print "    Unix time stamp\n";
-		}
-	print "\n  Input Files:\n";
-	foreach $xyfile (@xyfiles) {
-		print "    XY Data File:             $xyfile\n";
-	}
-	print "\n  Output Files:\n";
-	print "    Output plot name root:    $root\n";
-	print "    Plotting shellscript:     $cmdfile\n";
-	print "    Plot file:                $psfile\n";
-	print "\n  Plot Attributes:\n";
-	printf "    Plot width:               %.4f\n", $plot_width;
-	printf "    Plot height:              %.4f\n", $plot_height;
-	print "    Page size:                $pagesize\n";
-	print "    Page width:               $width\n";
-	print "    Page height:              $height\n";
-	print "    Projection:               -J$projection$projection_pars\n";
-	print "    Axes annotation:          $axes\n";
-	if ($portrait)
-		{
-		print "    Orientation:              portrait\n";
-		}
-	else
-		{
-		print "    Orientation:              landscape\n";
-		}
-	print "\n  XY Data Attributes:\n";
-	printf "    X min max:                %9.4g  %9.4g\n",
-		$xmin, $xmax;
-	printf "    Y min max:                %9.4g  %9.4g\n",
-		$ymin, $ymax;
-	if (@xyfiles)
-		{
-		print "\n  Primary XY Plotting Controls:\n";
-		printf "    symbol     pen        fill       segment    file\n";
-		printf "    ------     ---        ----       -------    ----\n";
-		for ($i = 0; $i < scalar(@xyfiles); $i++)
-			{
-			printf "    %-10s %-10s %-10s %-10s %s\n",
-				$xysymbols[$i], $xypens[$i],
-				$xyfills[$i], $xysegments[$i],
-				$xyfiles[$i];
-			}
-		}
-	if ($coast_control)
-		{
-		print "\n  Coastline Plotting Controls:\n";
-		}
-	if ($coast_control && $coast_resolution)
-		{
-		printf "    Coastline resolution:     $coast_resolution\n";
-		}
-	if ($coast_control && $coast_pen)
-		{
-		printf "    Coastline pen:            $coast_pen\n";
-		}
-	if ($coast_control && $coast_wetfill)
-		{
-		printf "    Ocean fill:               $coast_wetfill\n";
-		}
-	if ($coast_control && $coast_lakefill)
-		{
-		printf "    Lake fill:                $coast_lakefill\n";
-		}
-	if ($coast_control && $coast_dryfill)
-		{
-		printf "    Land fill:                $coast_dryfill\n";
-		}
-	if ($coast_control && $coast_river)
-		{
-		printf "    Rivers:                   $coast_river\n";
-		}
-
-	if ($coast_control && $coast_boundaries)
-		{
-		for ($i = 0; $i < scalar(@coast_boundaries); $i++)
-			{
-			printf "    National Boundaries:      $coast_boundaries[$i]\n";
-			}
-		}
-	if ($length_scale)
-		{
-		print "\n  Miscellaneous Plotting Controls:\n";
-		}
-	if ($length_scale)
-		{
-		printf "    Length scale:             $length_scale\n";
-		}
-	print "\n  GMT Default Values Reset in Script:\n";
-	foreach $gmt_def (@gmt_macro_defs) {
-		($gmt_par, $gmt_var) = $gmt_def =~ /^([^\/]+)\/(.+)/;
-		printf "    %-25s %s\n", $gmt_par, $gmt_var;
-		}
-	foreach $gmt_def (@gmt_defs) {
-		($gmt_par, $gmt_var) = $gmt_def =~ /^([^\/]+)\/(.+)/;
-		printf "    $gmt_par : $gmt_var\n";
-		}
-	print "\n--------------\n";
-	}
-
-# print out final notes
-print "\nPlot generation shellscript <$cmdfile> created.\n";
-print "\nInstructions:\n";
-print "  Execute <$cmdfile> to generate Postscript plot <$psfile>.\n";
-if (!$no_view_ps)
-	{
-	print "  Executing <$cmdfile> also invokes $ps_viewer ";
-	print "to view the plot on the screen.\n";
-	}
-if ($verbose)
-	{
-	print "\n--------------\n\n";
-	}
-
-# execute shellscript if desired
-if ($execute)
-	{
-	if ($verbose)
-		{
-		print "Executing shellscript $cmdfile...\n";
-		}
-	system "$cmdfile &";
-	}
-
-exit 0;
-
-#-----------------------------------------------------------------------
-sub min {
-
-	# make local variables
-	local ($min);
-
-	# get the minimum of the arguments
-	if ($_[0] < $_[1])
-		{
-		$min = $_[0];
-		}
-	else
-		{
-		$min = $_[1];
-		}
-	$min;
-}
-#-----------------------------------------------------------------------
-sub max {
-
-	# make local variables
-	local ($max);
-
-	# get the minimum of the arguments
-	if ($_[0] > $_[1])
-		{
-		$max = $_[0];
-		}
-	else
-		{
-		$max = $_[1];
-		}
-	$max;
-}
-#-----------------------------------------------------------------------
-sub GetDecimalDegrees {
-
-	# make local variables
-	local ($dec_degrees, $degrees, $minutes, $seconds);
-
-	# deal with dd:mm:ss format
-	if ($_[0] =~ /^\S+:\S+:\S+$/)
-		{
-		($degrees, $minutes, $seconds)
-			= $_[0] =~ /^(\S+):(\S+):(\S+)$/;
-		if ($degrees =~ /^-\S+/)
-			{
-			$dec_degrees = $degrees
-				- $minutes / 60.0
-				- $seconds / 3600.0;
-			}
-		else
-			{
-			$dec_degrees = $degrees
-				+ $minutes / 60.0
-				+ $seconds / 3600.0;
-			}
-		}
-	# deal with dd:mm format
-	elsif ($_[0] =~ /^\S+:\S+$/)
-		{
-		($degrees, $minutes)
-			= $_[0] =~ /^(\S+):(\S+)$/;
-		if ($degrees =~ /^-\S+/)
-			{
-			$dec_degrees = $degrees - $minutes / 60.0;
-			}
-		else
-			{
-			$dec_degrees = $degrees + $minutes / 60.0;
-			}		}
-
-	# value already in decimal units of some sort
-	else
-		{
-		$dec_degrees = $_[0];
-		}
-
-	# return decimal degrees;
-	$dec_degrees;
-}
-#-----------------------------------------------------------------------
-sub GetPageSize {
-
-# get space around edge of plot
-	$space_top =    1.25 * $page_height_in{$pagesize}
-			    / $page_height_in{"a"};
-	$space_bottom = 1.50 * $page_height_in{$pagesize}
-			    / $page_height_in{"a"};
-	$space_left =   1.00 * $page_height_in{$pagesize}
-			    / $page_height_in{"a"};
-	$space_right =  1.00 * $page_height_in{$pagesize}
-			    / $page_height_in{"a"};
-
-# set the relevent page width and height
-$width_max_landscape = $page_height_in{$pagesize}
-		- $space_left - $space_right;
-$height_max_landscape = $page_width_in{$pagesize}
-		- $space_bottom - $space_top;
-$width_max_portrait = $page_width_in{$pagesize}
-		- $space_left - $space_right;
-$height_max_portrait = $page_height_in{$pagesize}
-		- $space_bottom - $space_top;
-}
-#-----------------------------------------------------------------------
-sub GetProjection {
-
-	# get the map projection flag
-	($projection) = $map_scale =~ /^(\w)/;
-	($projection_pars) = $map_scale =~ /^$projection(\S+)/;
-
-	# see if plot scale or plot width defined
-	$use_scale = 0;
-	$use_width = 0;
-	$separator = "/";
-	$trial_value = 1.0;
-
-	# Cassini Projection
-	if ($projection eq "c")
-		{
-		($plot_scale) = $map_scale =~ /^c\S+\/\S+\/(\S+)$/;
-		$use_scale = 1;
-		}
-	elsif ($projection eq "C")
-		{
-		($plot_width) = $map_scale =~ /^C\S+\/\S+\/(\S+)$/;
-		$use_width = 1;
-		}
-
-	# Mercator Projection
-	elsif ($projection eq "m")
-		{
-		($plot_scale) = $map_scale =~ /^m(\S+)$/;
-		$use_scale = 1;
-		$separator = "";
-		}
-	elsif ($projection eq "M")
-		{
-		($plot_width) = $map_scale =~ /^M(\S+)$/;
-		$use_width = 1;
-		$separator = "";
-		}
-
-	# Oblique Mercator Projection
-	elsif ($projection eq "o")
-		{
-		if ($map_scale =~ /^oa\S+/)
-			{
-			($plot_scale) = $map_scale =~ /^oa\S+\/\S+\/\S+\/(\S+)$/;
-			}
-		elsif ($map_scale =~ /^ob\S+/)
-			{
-			($plot_scale) = $map_scale =~ /^ob\S+\/\S+\/\S+\/\S+\/(\S+)$/;
-			}
-		elsif ($map_scale =~ /^oc\S+/)
-			{
-			($plot_scale) = $map_scale =~ /^oc\S+\/\S+\/\S+\/\S+\/(\S+)$/;
-			}
-		$use_scale = 1;
-		}
-	elsif ($projection eq "O")
-		{
-		if ($map_scale =~ /^Oa\S+/)
-			{
-			($plot_width) = $map_scale =~ /^Oa\S+\/\S+\/\S+\/(\S+)$/;
-			}
-		elsif ($map_scale =~ /^Ob\S+/)
-			{
-			($plot_width) = $map_scale =~ /^Ob\S+\/\S+\/\S+\/\S+\/(\S+)$/;
-			}
-		elsif ($map_scale =~ /^Oc\S+/)
-			{
-			($plot_width) = $map_scale =~ /^Oc\S+\/\S+\/\S+\/\S+\/(\S+)$/;
-			}
-		$use_width = 1;
-		}
-
-	# Equidistant Cylindrical Projection
-	elsif ($projection eq "q")
-		{
-		($plot_scale) = $map_scale =~ /^q\S+\/(\S+)$/;
-		$use_scale = 1;
-		}
-	elsif ($projection eq "Q")
-		{
-		($plot_width) = $map_scale =~ /^Q\S+\/(\S+)$/;
-		$use_width = 1;
-		}
-
-	# Transverse Mercator Projection
-	elsif ($projection eq "t")
-		{
-		($plot_scale) = $map_scale =~ /^t\S+\/(\S+)$/;
-		$use_scale = 1;
-		}
-	elsif ($projection eq "T")
-		{
-		($plot_width) = $map_scale =~ /^T\S+\/(\S+)$/;
-		$use_width = 1;
-		}
-
-	# Universal Transverse Mercator Projection
-	elsif ($projection eq "u")
-		{
-		($plot_scale) = $map_scale =~ /^u\S+\/(\S+)$/;
-		$use_scale = 1;
-		}
-	elsif ($projection eq "U")
-		{
-		($plot_width) = $map_scale =~ /^U\S+\/(\S+)$/;
-		$use_width = 1;
-		}
-
-	# Basic Cylindrical Projection
-	elsif ($projection eq "y")
-		{
-		($plot_scale) = $map_scale =~ /^y\S+\/\S+\/(\S+)$/;
-		$use_scale = 1;
-		}
-	elsif ($projection eq "Y")
-		{
-		($plot_width) = $map_scale =~ /^Y\S+\/\S+\/(\S+)$/;
-		$use_width = 1;
-		}
-
-	# Lambert Azimuthal Projection
-	elsif ($projection eq "a")
-		{
-		($plot_scale) = $map_scale =~ /^a\S+\/\S+\/(\S+)$/;
-		$use_scale = 1;
-		$trial_value = "1:1";
-		$use_ratio = 1;
-		}
-	elsif ($projection eq "A")
-		{
-		($plot_width) = $map_scale =~ /^A\S+\/\S+\/(\S+)$/;
-		$use_width = 1;
-		}
-
-	# Equidistant Projection
-	elsif ($projection eq "e")
-		{
-		($plot_scale) = $map_scale =~ /^e\S+\/\S+\/(\S+)$/;
-		$use_scale = 1;
-		$trial_value = "1:1";
-		$use_ratio = 1;
-		}
-	elsif ($projection eq "E")
-		{
-		($plot_width) = $map_scale =~ /^E\S+\/\S+\/(\S+)$/;
-		$use_width = 1;
-		}
-
-	# Orthographic Projection
-	elsif ($projection eq "g")
-		{
-		($plot_scale) = $map_scale =~ /^g\S+\/\S+\/(\S+)$/;
-		$use_scale = 1;
-		$trial_value = "1:1";
-		$use_ratio = 1;
-		}
-	elsif ($projection eq "G")
-		{
-		($plot_width) = $map_scale =~ /^G\S+\/\S+\/(\S+)$/;
-		$use_width = 1;
-		}
-
-	# General Sterographic Projection
-	elsif ($projection eq "s")
-		{
-		($plot_scale) = $map_scale =~ /^s\S+\/\S+\/(\S+)$/;
-		$use_scale = 1;
-		$trial_value = "1:1";
-		$use_ratio = 1;
-		}
-	elsif ($projection eq "S")
-		{
-		($plot_width) = $map_scale =~ /^S\S+\/\S+\/(\S+)$/;
-		$use_width = 1;
-		}
-
-	# Albers Projection
-	elsif ($projection eq "b")
-		{
-		($plot_scale) = $map_scale =~ /^b\S+\/\S+\/\S+\/\S+\/(\S+)$/;
-		$use_scale = 1;
-		}
-	elsif ($projection eq "B")
-		{
-		($plot_width) = $map_scale =~ /^B\S+\/\S+\/\S+\/\S+\/(\S+)$/;
-		$use_width = 1;
-		}
-
-	# Lambert Conic Projection
-	elsif ($projection eq "l")
-		{
-		($plot_scale) = $map_scale =~ /^l\S+\/\S+\/\S+\/\S+\/(\S+)$/;
-		$use_scale = 1;
-		}
-	elsif ($projection eq "L")
-		{
-		($plot_width) = $map_scale =~ /^L\S+\/\S+\/\S+\/\S+\/(\S+)$/;
-		$use_width = 1;
-		}
-
-	# Hammer Projection
-	elsif ($projection eq "h")
-		{
-		($plot_scale) = $map_scale =~ /^h\S+\/(\S+)$/;
-		$use_scale = 1;
-		}
-	elsif ($projection eq "H")
-		{
-		($plot_width) = $map_scale =~ /^H\S+\/(\S+)$/;
-		$use_width = 1;
-		}
-
-	# Sinusoidal Projection
-	elsif ($projection eq "i")
-		{
-		($plot_scale) = $map_scale =~ /^i\S+\/(\S+)$/;
-		$use_scale = 1;
-		}
-	elsif ($projection eq "I")
-		{
-		($plot_width) = $map_scale =~ /^I\S+\/(\S+)$/;
-		$use_width = 1;
-		}
-
-	# Eckert VI Projection
-	elsif ($projection eq "k")
-		{
-		($plot_scale) = $map_scale =~ /^k\S+\/(\S+)$/;
-		$use_scale = 1;
-		}
-	elsif ($projection eq "K")
-		{
-		($plot_width) = $map_scale =~ /^K\S+\/(\S+)$/;
-		$use_width = 1;
-		}
-
-	# Robinson Projection
-	elsif ($projection eq "n")
-		{
-		($plot_scale) = $map_scale =~ /^n\S+\/(\S+)$/;
-		$use_scale = 1;
-		}
-	elsif ($projection eq "N")
-		{
-		($plot_width) = $map_scale =~ /^N\S+\/(\S+)$/;
-		$use_width = 1;
-		}
-
-	# Winkel Tripel Projection
-	elsif ($projection eq "r")
-		{
-		($plot_scale) = $map_scale =~ /^r\S+\/(\S+)$/;
-		$use_scale = 1;
-		}
-	elsif ($projection eq "R")
-		{
-		($plot_width) = $map_scale =~ /^R\S+\/(\S+)$/;
-		$use_width = 1;
-		}
-
-	# Mollweide Projection
-	elsif ($projection eq "w")
-		{
-		($plot_scale) = $map_scale =~ /^w\S+\/(\S+)$/;
-		$use_scale = 1;
-		}
-	elsif ($projection eq "W")
-		{
-		($plot_width) = $map_scale =~ /^W\S+\/(\S+)$/;
-		$use_width = 1;
-		}
-
-	# Linear Polar Projection
-	elsif ($projection eq "p")
-		{
-		($plot_scale) = $map_scale =~ /^p(\S+)$/;
-		$use_scale = 1;
-		$separator = "";
-		}
-	elsif ($projection eq "P")
-		{
-		($plot_width) = $map_scale =~ /^P(\S+)$/;
-		$use_width = 1;
-		$separator = "";
-		}
-
-	# Linear Projection
-	elsif ($projection eq "x")
-		{
-		if ($map_scale =~ /^xd$/)
-			{
-			$geographic = 1;
-			chop($map_scale);
-			}
-		else
-			{
-			($plot_scale) = $map_scale =~ /^x(\S+)$/;
-			}
-		$use_scale = 1;
-		$separator = "";
-		}
-	elsif ($projection eq "X")
-		{
-		if ($map_scale =~ /^Xd$/)
-			{
-			$geographic = 1;
-			chop($map_scale);
-			}
-		else
-			{
-			($plot_width) = $map_scale =~ /^X(\S+)$/;
-			}
-		$use_width = 1;
-		$separator = "";
-		}
-}
-#-----------------------------------------------------------------------
-sub GetBaseTickLinear {
-
-	# figure out some reasonable tick intervals for the basemap
-	$dxxx = $xmax - $xmin;
-	if ($dxxx > 0)
-		{
-		$base = int((log($dxxx) / log(10.)) + 0.5);
-		$base_tick_x = (10 ** $base) / 5;
-		if ($dxxx / $base_tick_x < 5)
-			{
-			$base_tick_x = $base_tick_x / 4;
-			}
-		elsif ($dxxx / $base_tick_x < 10)
-			{
-			$base_tick_x = $base_tick_x / 2;
-			}
-		}
-	$dyyy = $ymax - $ymin;
-	if ($dyyy > 0)
-		{
-		$base = int((log($dyyy) / log(10.)) + 0.5);
-		$base_tick_y = (10 ** $base) / 5;
-		if ($dyyy / $base_tick_y < 5)
-			{
-			$base_tick_y = $base_tick_y / 4;
-			}
-		elsif ($dyyy / $base_tick_y < 10)
-			{
-			$base_tick_y = $base_tick_y / 2;
-			}
-		}
-
-}
-#-----------------------------------------------------------------------
-sub GetBaseTick {
-
-	# figure out some reasonable tick intervals for the basemap
-	$base_tick_x = ($xmax - $xmin) / 5;
-	$base_tick_y = ($ymax - $ymin) / 5;
-	$base_tick = &min($base_tick_x, $base_tick_y);
-	if ($base_tick < 0.0002777777)
-		{
-		$base_tick = "1s";
-		}
-	elsif ($base_tick < 0.0005555555)
-		{
-		$base_tick = "2s";
-		}
-	elsif ($base_tick < 0.0013888889)
-		{
-		$base_tick = "5s";
-		}
-	elsif ($base_tick < 0.0027777778)
-		{
-		$base_tick = "10s";
-		}
-	elsif ($base_tick < 0.0041666667)
-		{
-		$base_tick = "15s";
-		}
-	elsif ($base_tick < 0.0083333333)
-		{
-		$base_tick = "30s";
-		}
-	elsif ($base_tick < 0.0166667)
-		{
-		$base_tick = "1m";
-		}
-	elsif ($base_tick < 0.0333333)
-		{
-		$base_tick = "2m";
-		}
-	elsif ($base_tick < 0.0833333)
-		{
-		$base_tick = "5m";
-		}
-	elsif ($base_tick < 0.1666667)
-		{
-		$base_tick = "10m";
-		}
-	elsif ($base_tick < 0.25)
-		{
-		$base_tick = "15m";
-		}
-	elsif ($base_tick < 0.5)
-		{
-		$base_tick = "30m";
-		}
-	elsif ($base_tick < 1.0)
-		{
-		$base_tick = "1";
-		}
-	elsif ($base_tick < 2.0)
-		{
-		$base_tick = "2";
-		}
-	elsif ($base_tick < 5.0)
-		{
-		$base_tick = "5";
-		}
-	elsif ($base_tick < 10.0)
-		{
-		$base_tick = "10";
-		}
-	elsif ($base_tick < 15.0)
-		{
-		$base_tick = "15";
-		}
-	elsif ($base_tick < 30.0)
-		{
-		$base_tick = "30";
-		}
-	elsif ($base_tick < 30.0)
-		{
-		$base_tick = "30";
-		}
-	elsif ($base_tick < 360.0)
-		{
-		$base_tick = "60";
-		}
-
-}
-#-----------------------------------------------------------------------
-# This version of Getopts has been augmented to support multiple
-# calls to the same option. If an arg in argumentative is followed
-# by "+" rather than ":",  then the corresponding scalar will
-# be concatenated rather than overwritten by multiple calls to
-# the same arg.
-#
-# Usage:
-#      do Getopts('a:b+c'); # -a takes arg, -b concatenates args,
-#			    # -c does not take arg. Sets opt_* as a
-#                           # side effect.
-
-sub MBGetopts {
-    local($argumentative) = @_;
-    local(@args,$_,$first,$rest);
-    local($errs) = 0;
-
-    @args = split( / */, $argumentative );
-    while(@ARGV && ($_ = $ARGV[0]) =~ /^-(.)(.*)/) {
-	($first,$rest) = ($1,$2);
-	$pos = index($argumentative,$first);
-	if($pos >= $[) {
-	    if($args[$pos+1] eq ':') {
-		shift(@ARGV);
-		if($rest eq '') {
-		    ++$errs unless @ARGV;
-		    $rest = shift(@ARGV);
-		}
-		eval "\$opt_$first = \$rest;";
-		eval "\$flg_$first = 1;";
-	    }
-	    elsif($args[$pos+1] eq '+') {
-		shift(@ARGV);
-		if($rest eq '') {
-		    ++$errs unless @ARGV;
-		    $rest = shift(@ARGV);
-		}
-		if (eval "\$opt_$first") {
-		    eval "\$opt_$first = \$opt_$first
-				. \":::::::\" . \$rest;";
-		}
-		else {
-		    eval "\$opt_$first = \$rest;";
-		}
-		eval "\$flg_$first = 1;";
-	    }
-	    elsif($args[$pos+1] eq '%') {
-		shift(@ARGV);
-		if($rest ne '') {
-		    eval "\$opt_$first = \$rest;";
-		}
-		else {
-		    $rest = $ARGV[0];
-		    ($one) = $rest =~ /^-(.).*/;
-		    $pos = index($argumentative,$one);
-		    if(!$one || $pos < $[) {
-			eval "\$opt_$first = \$rest;";
-			shift(@ARGV);
-		    }
-		}
-		eval "\$flg_$first = 1;";
-	    }
-	    else {
-		eval "\$opt_$first = 1";
-		eval "\$flg_$first = 1;";
-		if($rest eq '') {
-		    shift(@ARGV);
-		}
-		else {
-		    $ARGV[0] = "-$rest";
-		}
-	    }
-	}
-	else {
-	    print STDERR "Unknown option: $first\n";
-	    ++$errs;
-	    if($rest ne '') {
-		$ARGV[0] = "-$rest";
-	    }
-	    else {
-		shift(@ARGV);
-	    }
-	}
-    }
-    $errs == 0;
-}
-#-----------------------------------------------------------------------
diff --git a/src/man/Makefile.am b/src/man/Makefile.am
deleted file mode 100644
index 5b69c6a..0000000
--- a/src/man/Makefile.am
+++ /dev/null
@@ -1 +0,0 @@
-SUBDIRS = man1 man3
diff --git a/src/man/Makefile.in b/src/man/Makefile.in
deleted file mode 100644
index cc94646..0000000
--- a/src/man/Makefile.in
+++ /dev/null
@@ -1,641 +0,0 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
-
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
-am__make_running_with_option = \
-  case $${target_option-} in \
-      ?) ;; \
-      *) echo "am__make_running_with_option: internal error: invalid" \
-              "target option '$${target_option-}' specified" >&2; \
-         exit 1;; \
-  esac; \
-  has_opt=no; \
-  sane_makeflags=$$MAKEFLAGS; \
-  if $(am__is_gnu_make); then \
-    sane_makeflags=$$MFLAGS; \
-  else \
-    case $$MAKEFLAGS in \
-      *\\[\ \	]*) \
-        bs=\\; \
-        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
-          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
-    esac; \
-  fi; \
-  skip_next=no; \
-  strip_trailopt () \
-  { \
-    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
-  }; \
-  for flg in $$sane_makeflags; do \
-    test $$skip_next = yes && { skip_next=no; continue; }; \
-    case $$flg in \
-      *=*|--*) continue;; \
-        -*I) strip_trailopt 'I'; skip_next=yes;; \
-      -*I?*) strip_trailopt 'I';; \
-        -*O) strip_trailopt 'O'; skip_next=yes;; \
-      -*O?*) strip_trailopt 'O';; \
-        -*l) strip_trailopt 'l'; skip_next=yes;; \
-      -*l?*) strip_trailopt 'l';; \
-      -[dEDm]) skip_next=yes;; \
-      -[JT]) skip_next=yes;; \
-    esac; \
-    case $$flg in \
-      *$$target_option*) has_opt=yes; break;; \
-    esac; \
-  done; \
-  test $$has_opt = yes
-am__make_dryrun = (target_option=n; $(am__make_running_with_option))
-am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-subdir = src/man
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
-	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
-	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
-	$(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-	$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/src/mbio/mb_config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-AM_V_P = $(am__v_P_ at AM_V@)
-am__v_P_ = $(am__v_P_ at AM_DEFAULT_V@)
-am__v_P_0 = false
-am__v_P_1 = :
-AM_V_GEN = $(am__v_GEN_ at AM_V@)
-am__v_GEN_ = $(am__v_GEN_ at AM_DEFAULT_V@)
-am__v_GEN_0 = @echo "  GEN     " $@;
-am__v_GEN_1 = 
-AM_V_at = $(am__v_at_ at AM_V@)
-am__v_at_ = $(am__v_at_ at AM_DEFAULT_V@)
-am__v_at_0 = @
-am__v_at_1 = 
-SOURCES =
-DIST_SOURCES =
-RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
-	ctags-recursive dvi-recursive html-recursive info-recursive \
-	install-data-recursive install-dvi-recursive \
-	install-exec-recursive install-html-recursive \
-	install-info-recursive install-pdf-recursive \
-	install-ps-recursive install-recursive installcheck-recursive \
-	installdirs-recursive pdf-recursive ps-recursive \
-	tags-recursive uninstall-recursive
-am__can_run_installinfo = \
-  case $$AM_UPDATE_INFO_DIR in \
-    n|no|NO) false;; \
-    *) (install-info --version) >/dev/null 2>&1;; \
-  esac
-RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
-  distclean-recursive maintainer-clean-recursive
-am__recursive_targets = \
-  $(RECURSIVE_TARGETS) \
-  $(RECURSIVE_CLEAN_TARGETS) \
-  $(am__extra_recursive_targets)
-AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
-	distdir
-am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
-# Read a list of newline-separated strings from the standard input,
-# and print each of them once, without duplicates.  Input order is
-# *not* preserved.
-am__uniquify_input = $(AWK) '\
-  BEGIN { nonempty = 0; } \
-  { items[$$0] = 1; nonempty = 1; } \
-  END { if (nonempty) { for (i in items) print i; }; } \
-'
-# Make sure the list of sources is unique.  This is necessary because,
-# e.g., the same source file might be shared among _SOURCES variables
-# for different programs/libraries.
-am__define_uniq_tagged_files = \
-  list='$(am__tagged_files)'; \
-  unique=`for i in $$list; do \
-    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-  done | $(am__uniquify_input)`
-ETAGS = etags
-CTAGS = ctags
-DIST_SUBDIRS = $(SUBDIRS)
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-am__relativize = \
-  dir0=`pwd`; \
-  sed_first='s,^\([^/]*\)/.*$$,\1,'; \
-  sed_rest='s,^[^/]*/*,,'; \
-  sed_last='s,^.*/\([^/]*\)$$,\1,'; \
-  sed_butlast='s,/*[^/]*$$,,'; \
-  while test -n "$$dir1"; do \
-    first=`echo "$$dir1" | sed -e "$$sed_first"`; \
-    if test "$$first" != "."; then \
-      if test "$$first" = ".."; then \
-        dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
-        dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
-      else \
-        first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
-        if test "$$first2" = "$$first"; then \
-          dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
-        else \
-          dir2="../$$dir2"; \
-        fi; \
-        dir0="$$dir0"/"$$first"; \
-      fi; \
-    fi; \
-    dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
-  done; \
-  reldir="$$dir2"
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-CC = @CC@
-CCAS = @CCAS@
-CCASDEPMODE = @CCASDEPMODE@
-CCASFLAGS = @CCASFLAGS@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DLLTOOL = @DLLTOOL@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GREP = @GREP@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBM = @LIBM@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIBTOOL_DEPS = @LIBTOOL_DEPS@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LTLIBOBJS = @LTLIBOBJS@
-LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
-MAINT = @MAINT@
-MAKEINFO = @MAKEINFO@
-MANIFEST_TOOL = @MANIFEST_TOOL@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-OTPS_DIR = @OTPS_DIR@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_URL = @PACKAGE_URL@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PKG_CONFIG = @PKG_CONFIG@
-PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
-PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-VERSION = @VERSION@
-XDR_LIB = @XDR_LIB@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_AR = @ac_ct_AR@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-fftw_app = @fftw_app@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libGLU_CFLAGS = @libGLU_CFLAGS@
-libGLU_LIBS = @libGLU_LIBS@
-libXm_CFLAGS = @libXm_CFLAGS@
-libXm_LIBS = @libXm_LIBS@
-libdir = @libdir@
-libexecdir = @libexecdir@
-libfftw3_CFLAGS = @libfftw3_CFLAGS@
-libfftw3_LIBS = @libfftw3_LIBS@
-libfftw_CPPFLAGS = @libfftw_CPPFLAGS@
-libfftw_LIBS = @libfftw_LIBS@
-libgmt_CFLAGS = @libgmt_CFLAGS@
-libgmt_CPPFLAGS = @libgmt_CPPFLAGS@
-libgmt_LIBS = @libgmt_LIBS@
-libmotif_CPPFLAGS = @libmotif_CPPFLAGS@
-libmotif_LIBS = @libmotif_LIBS@
-libnetcdf_CFLAGS = @libnetcdf_CFLAGS@
-libnetcdf_CPPFLAGS = @libnetcdf_CPPFLAGS@
-libnetcdf_LIBS = @libnetcdf_LIBS@
-libopengl_CPPFLAGS = @libopengl_CPPFLAGS@
-libopengl_LIBS = @libopengl_LIBS@
-libproj_CFLAGS = @libproj_CFLAGS@
-libproj_CPPFLAGS = @libproj_CPPFLAGS@
-libproj_LIBS = @libproj_LIBS@
-libpsl_CFLAGS = @libpsl_CFLAGS@
-libpsl_LIBS = @libpsl_LIBS@
-localedir = @localedir@
-localstatedir = @localstatedir@
-mandir = @mandir@
-mbsystemdatadir = @mbsystemdatadir@
-mbsystemhtmldir = @mbsystemhtmldir@
-mbsystempsdir = @mbsystempsdir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-SUBDIRS = man1 man3
-all: all-recursive
-
-.SUFFIXES:
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
-	@for dep in $?; do \
-	  case '$(am__configure_deps)' in \
-	    *$$dep*) \
-	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-	        && { if test -f $@; then exit 0; else break; fi; }; \
-	      exit 1;; \
-	  esac; \
-	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/man/Makefile'; \
-	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --gnu src/man/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	@case '$?' in \
-	  *config.status*) \
-	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-	esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-
-mostlyclean-libtool:
-	-rm -f *.lo
-
-clean-libtool:
-	-rm -rf .libs _libs
-
-# This directory's subdirectories are mostly independent; you can cd
-# into them and run 'make' without going through this Makefile.
-# To change the values of 'make' variables: instead of editing Makefiles,
-# (1) if the variable is set in 'config.status', edit 'config.status'
-#     (which will cause the Makefiles to be regenerated when you run 'make');
-# (2) otherwise, pass the desired values on the 'make' command line.
-$(am__recursive_targets):
-	@fail=; \
-	if $(am__make_keepgoing); then \
-	  failcom='fail=yes'; \
-	else \
-	  failcom='exit 1'; \
-	fi; \
-	dot_seen=no; \
-	target=`echo $@ | sed s/-recursive//`; \
-	case "$@" in \
-	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
-	  *) list='$(SUBDIRS)' ;; \
-	esac; \
-	for subdir in $$list; do \
-	  echo "Making $$target in $$subdir"; \
-	  if test "$$subdir" = "."; then \
-	    dot_seen=yes; \
-	    local_target="$$target-am"; \
-	  else \
-	    local_target="$$target"; \
-	  fi; \
-	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
-	  || eval $$failcom; \
-	done; \
-	if test "$$dot_seen" = "no"; then \
-	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
-	fi; test -z "$$fail"
-
-ID: $(am__tagged_files)
-	$(am__define_uniq_tagged_files); mkid -fID $$unique
-tags: tags-recursive
-TAGS: tags
-
-tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
-	set x; \
-	here=`pwd`; \
-	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
-	  include_option=--etags-include; \
-	  empty_fix=.; \
-	else \
-	  include_option=--include; \
-	  empty_fix=; \
-	fi; \
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
-	    test ! -f $$subdir/TAGS || \
-	      set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
-	  fi; \
-	done; \
-	$(am__define_uniq_tagged_files); \
-	shift; \
-	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
-	  test -n "$$unique" || unique=$$empty_fix; \
-	  if test $$# -gt 0; then \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      "$$@" $$unique; \
-	  else \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      $$unique; \
-	  fi; \
-	fi
-ctags: ctags-recursive
-
-CTAGS: ctags
-ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
-	$(am__define_uniq_tagged_files); \
-	test -z "$(CTAGS_ARGS)$$unique" \
-	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$unique
-
-GTAGS:
-	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && $(am__cd) $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) "$$here"
-cscopelist: cscopelist-recursive
-
-cscopelist-am: $(am__tagged_files)
-	list='$(am__tagged_files)'; \
-	case "$(srcdir)" in \
-	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
-	  *) sdir=$(subdir)/$(srcdir) ;; \
-	esac; \
-	for i in $$list; do \
-	  if test -f "$$i"; then \
-	    echo "$(subdir)/$$i"; \
-	  else \
-	    echo "$$sdir/$$i"; \
-	  fi; \
-	done >> $(top_builddir)/cscope.files
-
-distclean-tags:
-	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	list='$(DISTFILES)'; \
-	  dist_files=`for file in $$list; do echo $$file; done | \
-	  sed -e "s|^$$srcdirstrip/||;t" \
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
-	case $$dist_files in \
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
-			   sort -u` ;; \
-	esac; \
-	for file in $$dist_files; do \
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  if test -d $$d/$$file; then \
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
-	    if test -d "$(distdir)/$$file"; then \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
-	  else \
-	    test -f "$(distdir)/$$file" \
-	    || cp -p $$d/$$file "$(distdir)/$$file" \
-	    || exit 1; \
-	  fi; \
-	done
-	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
-	    $(am__make_dryrun) \
-	      || test -d "$(distdir)/$$subdir" \
-	      || $(MKDIR_P) "$(distdir)/$$subdir" \
-	      || exit 1; \
-	    dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
-	    $(am__relativize); \
-	    new_distdir=$$reldir; \
-	    dir1=$$subdir; dir2="$(top_distdir)"; \
-	    $(am__relativize); \
-	    new_top_distdir=$$reldir; \
-	    echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
-	    echo "     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
-	    ($(am__cd) $$subdir && \
-	      $(MAKE) $(AM_MAKEFLAGS) \
-	        top_distdir="$$new_top_distdir" \
-	        distdir="$$new_distdir" \
-		am__remove_distdir=: \
-		am__skip_length_check=: \
-		am__skip_mode_fix=: \
-	        distdir) \
-	      || exit 1; \
-	  fi; \
-	done
-check-am: all-am
-check: check-recursive
-all-am: Makefile
-installdirs: installdirs-recursive
-installdirs-am:
-install: install-recursive
-install-exec: install-exec-recursive
-install-data: install-data-recursive
-uninstall: uninstall-recursive
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-recursive
-install-strip:
-	if test -z '$(STRIP)'; then \
-	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	      install; \
-	else \
-	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
-	fi
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
-	@echo "This command is intended for maintainers to use"
-	@echo "it deletes files that may require special tools to rebuild."
-clean: clean-recursive
-
-clean-am: clean-generic clean-libtool mostlyclean-am
-
-distclean: distclean-recursive
-	-rm -f Makefile
-distclean-am: clean-am distclean-generic distclean-tags
-
-dvi: dvi-recursive
-
-dvi-am:
-
-html: html-recursive
-
-html-am:
-
-info: info-recursive
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-recursive
-
-install-dvi-am:
-
-install-exec-am:
-
-install-html: install-html-recursive
-
-install-html-am:
-
-install-info: install-info-recursive
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-recursive
-
-install-pdf-am:
-
-install-ps: install-ps-recursive
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-recursive
-	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-recursive
-
-mostlyclean-am: mostlyclean-generic mostlyclean-libtool
-
-pdf: pdf-recursive
-
-pdf-am:
-
-ps: ps-recursive
-
-ps-am:
-
-uninstall-am:
-
-.MAKE: $(am__recursive_targets) install-am install-strip
-
-.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \
-	check-am clean clean-generic clean-libtool cscopelist-am ctags \
-	ctags-am distclean distclean-generic distclean-libtool \
-	distclean-tags distdir dvi dvi-am html html-am info info-am \
-	install install-am install-data install-data-am install-dvi \
-	install-dvi-am install-exec install-exec-am install-html \
-	install-html-am install-info install-info-am install-man \
-	install-pdf install-pdf-am install-ps install-ps-am \
-	install-strip installcheck installcheck-am installdirs \
-	installdirs-am maintainer-clean maintainer-clean-generic \
-	mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
-	ps ps-am tags tags-am uninstall uninstall-am
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/man/man1/Makefile b/src/man/man1/Makefile
deleted file mode 100644
index 9ccab27..0000000
--- a/src/man/man1/Makefile
+++ /dev/null
@@ -1,627 +0,0 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
-# src/man/man1/Makefile.  Generated from Makefile.in by configure.
-
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
-
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
-
-
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
-am__make_running_with_option = \
-  case $${target_option-} in \
-      ?) ;; \
-      *) echo "am__make_running_with_option: internal error: invalid" \
-              "target option '$${target_option-}' specified" >&2; \
-         exit 1;; \
-  esac; \
-  has_opt=no; \
-  sane_makeflags=$$MAKEFLAGS; \
-  if $(am__is_gnu_make); then \
-    sane_makeflags=$$MFLAGS; \
-  else \
-    case $$MAKEFLAGS in \
-      *\\[\ \	]*) \
-        bs=\\; \
-        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
-          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
-    esac; \
-  fi; \
-  skip_next=no; \
-  strip_trailopt () \
-  { \
-    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
-  }; \
-  for flg in $$sane_makeflags; do \
-    test $$skip_next = yes && { skip_next=no; continue; }; \
-    case $$flg in \
-      *=*|--*) continue;; \
-        -*I) strip_trailopt 'I'; skip_next=yes;; \
-      -*I?*) strip_trailopt 'I';; \
-        -*O) strip_trailopt 'O'; skip_next=yes;; \
-      -*O?*) strip_trailopt 'O';; \
-        -*l) strip_trailopt 'l'; skip_next=yes;; \
-      -*l?*) strip_trailopt 'l';; \
-      -[dEDm]) skip_next=yes;; \
-      -[JT]) skip_next=yes;; \
-    esac; \
-    case $$flg in \
-      *$$target_option*) has_opt=yes; break;; \
-    esac; \
-  done; \
-  test $$has_opt = yes
-am__make_dryrun = (target_option=n; $(am__make_running_with_option))
-am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
-pkgdatadir = $(datadir)/mbsystem
-pkgincludedir = $(includedir)/mbsystem
-pkglibdir = $(libdir)/mbsystem
-pkglibexecdir = $(libexecdir)/mbsystem
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = x86_64-apple-darwin13.4.0
-host_triplet = x86_64-apple-darwin13.4.0
-subdir = src/man/man1
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
-	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
-	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
-	$(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-	$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/src/mbio/mb_config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-AM_V_P = $(am__v_P_$(V))
-am__v_P_ = $(am__v_P_$(AM_DEFAULT_VERBOSITY))
-am__v_P_0 = false
-am__v_P_1 = :
-AM_V_GEN = $(am__v_GEN_$(V))
-am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
-am__v_GEN_0 = @echo "  GEN     " $@;
-am__v_GEN_1 = 
-AM_V_at = $(am__v_at_$(V))
-am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
-am__v_at_0 = @
-am__v_at_1 = 
-SOURCES =
-DIST_SOURCES =
-am__can_run_installinfo = \
-  case $$AM_UPDATE_INFO_DIR in \
-    n|no|NO) false;; \
-    *) (install-info --version) >/dev/null 2>&1;; \
-  esac
-am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
-am__vpath_adj = case $$p in \
-    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
-    *) f=$$p;; \
-  esac;
-am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
-am__install_max = 40
-am__nobase_strip_setup = \
-  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
-am__nobase_strip = \
-  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
-am__nobase_list = $(am__nobase_strip_setup); \
-  for p in $$list; do echo "$$p $$p"; done | \
-  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
-  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
-    if (++n[$$2] == $(am__install_max)) \
-      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
-    END { for (dir in files) print dir, files[dir] }'
-am__base_list = \
-  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
-  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
-am__uninstall_files_from_dir = { \
-  test -z "$$files" \
-    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
-    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
-         $(am__cd) "$$dir" && rm -f $$files; }; \
-  }
-man1dir = $(mandir)/man1
-am__installdirs = "$(DESTDIR)$(man1dir)"
-NROFF = nroff
-MANS = $(man_MANS)
-am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = ${SHELL} /Users/caress/sandbox/mbsystem/missing aclocal-1.14
-AMTAR = $${TAR-tar}
-AM_DEFAULT_VERBOSITY = 1
-AR = ar
-AUTOCONF = ${SHELL} /Users/caress/sandbox/mbsystem/missing autoconf
-AUTOHEADER = ${SHELL} /Users/caress/sandbox/mbsystem/missing autoheader
-AUTOMAKE = ${SHELL} /Users/caress/sandbox/mbsystem/missing automake-1.14
-AWK = awk
-CC = gcc
-CCAS = gcc
-CCASDEPMODE = depmode=gcc3
-CCASFLAGS = -g -Wall -Wmissing-prototypes -I/opt/X11/include 
-CCDEPMODE = depmode=gcc3
-CFLAGS = -g -Wall -Wmissing-prototypes -I/opt/X11/include 
-CPP = gcc -E
-CPPFLAGS = 
-CYGPATH_W = echo
-DEFS = -DHAVE_CONFIG_H
-DEPDIR = .deps
-DLLTOOL = false
-DSYMUTIL = dsymutil
-DUMPBIN = 
-ECHO_C = \c
-ECHO_N = 
-ECHO_T = 
-EGREP = /sw/bin/grep -E
-EXEEXT = 
-FGREP = /sw/bin/grep -F
-GREP = /sw/bin/grep
-INSTALL = /usr/bin/install -c
-INSTALL_DATA = ${INSTALL} -m 644
-INSTALL_PROGRAM = ${INSTALL}
-INSTALL_SCRIPT = ${INSTALL}
-INSTALL_STRIP_PROGRAM = $(install_sh) -c -s
-LD = /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld
-LDFLAGS = -L/opt/X11/lib
-LIBM = 
-LIBOBJS = 
-LIBS = -lm 
-LIBTOOL = $(SHELL) $(top_builddir)/libtool
-LIBTOOL_DEPS = ./ltmain.sh
-LIPO = lipo
-LN_S = ln -s
-LTLIBOBJS = 
-LT_SYS_LIBRARY_PATH = 
-MAINT = #
-MAKEINFO = ${SHELL} /Users/caress/sandbox/mbsystem/missing makeinfo
-MANIFEST_TOOL = :
-MKDIR_P = ../../.././install-sh -c -d
-NM = /usr/bin/nm
-NMEDIT = nmedit
-OBJDUMP = false
-OBJEXT = o
-OTOOL = otool
-OTOOL64 = :
-OTPS_DIR = /usr/local/OTPS2
-PACKAGE = mbsystem
-PACKAGE_BUGREPORT = http://listserver.mbari.org/sympa/arc/mbsystem
-PACKAGE_NAME = mbsystem
-PACKAGE_STRING = mbsystem 5.5.2252
-PACKAGE_TARNAME = mbsystem
-PACKAGE_URL = http://www.mbari.org/data/mbsystem/
-PACKAGE_VERSION = 5.5.2252
-PATH_SEPARATOR = :
-PKG_CONFIG = 
-PKG_CONFIG_LIBDIR = 
-PKG_CONFIG_PATH = 
-RANLIB = ranlib
-SED = /sw/bin/sed
-SET_MAKE = 
-SHELL = /bin/sh
-STRIP = strip
-VERSION = 5.5.2252
-XDR_LIB = 
-abs_builddir = /Users/caress/sandbox/mbsystem/src/man/man1
-abs_srcdir = /Users/caress/sandbox/mbsystem/src/man/man1
-abs_top_builddir = /Users/caress/sandbox/mbsystem
-abs_top_srcdir = /Users/caress/sandbox/mbsystem
-ac_ct_AR = ar
-ac_ct_CC = gcc
-ac_ct_DUMPBIN = 
-am__include = include
-am__leading_dot = .
-am__quote = 
-am__tar = $${TAR-tar} chof - "$$tardir"
-am__untar = $${TAR-tar} xf -
-bindir = ${exec_prefix}/bin
-build = x86_64-apple-darwin13.4.0
-build_alias = 
-build_cpu = x86_64
-build_os = darwin13.4.0
-build_vendor = apple
-builddir = .
-datadir = ${datarootdir}
-datarootdir = ${prefix}/share
-docdir = ${datarootdir}/doc/${PACKAGE_TARNAME}
-dvidir = ${docdir}
-exec_prefix = ${prefix}
-fftw_app = 
-host = x86_64-apple-darwin13.4.0
-host_alias = 
-host_cpu = x86_64
-host_os = darwin13.4.0
-host_vendor = apple
-htmldir = ${docdir}
-includedir = ${prefix}/include
-infodir = ${datarootdir}/info
-install_sh = ${SHELL} /Users/caress/sandbox/mbsystem/install-sh
-libGLU_CFLAGS = 
-libGLU_LIBS = 
-libXm_CFLAGS = 
-libXm_LIBS = 
-libdir = ${exec_prefix}/lib
-libexecdir = ${exec_prefix}/libexec
-libfftw3_CFLAGS = 
-libfftw3_LIBS = 
-libfftw_CPPFLAGS = -I/sw/include
-libfftw_LIBS = -L/sw/lib -R /sw/lib -lfftw3
-libgmt_CFLAGS = 
-libgmt_CPPFLAGS = -I/sw/include/gmt
-libgmt_LIBS = -L/sw/lib -R /sw/lib -lgmt -lpsl
-libmotif_CPPFLAGS = -I/sw/include
-libmotif_LIBS = -L/sw/lib -R /sw/lib -lXm -lXt -lX11
-libnetcdf_CFLAGS = 
-libnetcdf_CPPFLAGS = -I/sw/include
-libnetcdf_LIBS = -L/sw/lib -R /sw/lib -lnetcdf
-libopengl_CPPFLAGS = 
-libopengl_LIBS = -lGL -lGLU
-libproj_CFLAGS = 
-libproj_CPPFLAGS = -I/sw/include
-libproj_LIBS = -L/sw/lib -R /sw/lib -lproj
-libpsl_CFLAGS = 
-libpsl_LIBS = 
-localedir = ${datarootdir}/locale
-localstatedir = ${prefix}/var
-mandir = ${datarootdir}/man
-mbsystemdatadir = ${datarootdir}/mbsystem
-mbsystemhtmldir = ${datarootdir}/doc/${PACKAGE_TARNAME}/html
-mbsystempsdir = ${datarootdir}/doc/${PACKAGE_TARNAME}/ps
-mkdir_p = $(MKDIR_P)
-oldincludedir = /usr/include
-pdfdir = ${docdir}
-prefix = /Users/caress/sandbox/mbsystem
-program_transform_name = s,x,x,
-psdir = ${docdir}
-sbindir = ${exec_prefix}/sbin
-sharedstatedir = ${prefix}/com
-srcdir = .
-sysconfdir = ${prefix}/etc
-target_alias = 
-top_build_prefix = ../../../
-top_builddir = ../../..
-top_srcdir = ../../..
-man_MANS = \
-mbhsdump.1 \
-mb7k2jstar.1 \
-mb7k2ss.1 \
-mb7kpreprocess.1 \
-mbabsorption.1 \
-mbareaclean.1 \
-mbauvloglist.1 \
-mbauvnavusbl.1 \
-mbbackangle.1 \
-mbclean.1 \
-mbcontour.1 \
-mbcopy.1 \
-mbctdlist.1 \
-mbdatalist.1 \
-mbdefaults.1 \
-mbdumpesf.1 \
-mbedit.1 \
-mbeditviz.1 \
-mbextractsegy.1 \
-mbfilter.1 \
-mbformat.1 \
-mbgetesf.1 \
-mbgrdtiff.1 \
-mbgrdviz.1 \
-mbgrid.1 \
-mbhistogram.1 \
-mbhysweeppreprocess.1 \
-mbinfo.1 \
-mbkongsbergpreprocess.1 \
-mblevitus.1 \
-mblist.1 \
-mbm_arc2grd.1 \
-mbm_bpr.1 \
-mbm_copy.1 \
-mbm_dslnavfix.1 \
-mbm_fmtvel.1 \
-mbm_grd2arc.1 \
-mbm_grd2geovrml.1 \
-mbm_grd3dplot.1 \
-mbm_grdcut.1 \
-mbm_grdinfo.1 \
-mbm_grdplot.1 \
-mbm_grdtiff.1 \
-mbm_grid.1 \
-mbm_histplot.1 \
-mbm_makedatalist.1 \
-mbm_makesvp.1 \
-mbm_multicopy.1 \
-mbm_multidatalist.1 \
-mbm_multiprocess.1 \
-mbmosaic.1 \
-mbm_plot.1 \
-mbm_route2mission.1 \
-mbm_stat.1 \
-mbm_utm.1 \
-mbm_vrefcheck.1 \
-mbm_xbt.1 \
-mbm_xyplot.1 \
-mbnavadjust.1 \
-mbnavadjustmerge.1 \
-mbnavedit.1 \
-mbnavlist.1 \
-mbneptune2esf.1 \
-mbotps.1 \
-mbpreprocess.1 \
-mbprocess.1 \
-mbps.1 \
-mbrollbias.1 \
-mbrolltimelag.1 \
-mbroutetime.1 \
-mbsegygrid.1 \
-mbsegyinfo.1 \
-mbsegylist.1 \
-mbsegypsd.1 \
-mbset.1 \
-mbstripnan.1 \
-mbsvplist.1 \
-mbsvpselect.1 \
-mbswath.1 \
-mbswplspreprocess.1 \
-mbsystem.1 \
-mbtime.1 \
-mbvelocitytool.1
-
-#man_PROJ = proj.1 geod.1 
-EXTRA_DIST = $(man_MANS) $(man_PROJ)
-all: all-am
-
-.SUFFIXES:
-$(srcdir)/Makefile.in: # $(srcdir)/Makefile.am  $(am__configure_deps)
-	@for dep in $?; do \
-	  case '$(am__configure_deps)' in \
-	    *$$dep*) \
-	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-	        && { if test -f $@; then exit 0; else break; fi; }; \
-	      exit 1;; \
-	  esac; \
-	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/man/man1/Makefile'; \
-	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --gnu src/man/man1/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	@case '$?' in \
-	  *config.status*) \
-	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-	esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure: # $(am__configure_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): # $(am__aclocal_m4_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-
-mostlyclean-libtool:
-	-rm -f *.lo
-
-clean-libtool:
-	-rm -rf .libs _libs
-install-man1: $(man_MANS)
-	@$(NORMAL_INSTALL)
-	@list1=''; \
-	list2='$(man_MANS)'; \
-	test -n "$(man1dir)" \
-	  && test -n "`echo $$list1$$list2`" \
-	  || exit 0; \
-	echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \
-	$(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \
-	{ for i in $$list1; do echo "$$i"; done;  \
-	if test -n "$$list2"; then \
-	  for i in $$list2; do echo "$$i"; done \
-	    | sed -n '/\.1[a-z]*$$/p'; \
-	fi; \
-	} | while read p; do \
-	  if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
-	  echo "$$d$$p"; echo "$$p"; \
-	done | \
-	sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
-	      -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
-	sed 'N;N;s,\n, ,g' | { \
-	list=; while read file base inst; do \
-	  if test "$$base" = "$$inst"; then list="$$list $$file"; else \
-	    echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \
-	    $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \
-	  fi; \
-	done; \
-	for i in $$list; do echo "$$i"; done | $(am__base_list) | \
-	while read files; do \
-	  test -z "$$files" || { \
-	    echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \
-	    $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \
-	done; }
-
-uninstall-man1:
-	@$(NORMAL_UNINSTALL)
-	@list=''; test -n "$(man1dir)" || exit 0; \
-	files=`{ for i in $$list; do echo "$$i"; done; \
-	l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
-	  sed -n '/\.1[a-z]*$$/p'; \
-	} | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
-	      -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
-	dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir)
-tags TAGS:
-
-ctags CTAGS:
-
-cscope cscopelist:
-
-
-distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	list='$(DISTFILES)'; \
-	  dist_files=`for file in $$list; do echo $$file; done | \
-	  sed -e "s|^$$srcdirstrip/||;t" \
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
-	case $$dist_files in \
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
-			   sort -u` ;; \
-	esac; \
-	for file in $$dist_files; do \
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  if test -d $$d/$$file; then \
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
-	    if test -d "$(distdir)/$$file"; then \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
-	  else \
-	    test -f "$(distdir)/$$file" \
-	    || cp -p $$d/$$file "$(distdir)/$$file" \
-	    || exit 1; \
-	  fi; \
-	done
-check-am: all-am
-check: check-am
-all-am: Makefile $(MANS)
-installdirs:
-	for dir in "$(DESTDIR)$(man1dir)"; do \
-	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
-	done
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
-	if test -z '$(STRIP)'; then \
-	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	      install; \
-	else \
-	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
-	fi
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
-	@echo "This command is intended for maintainers to use"
-	@echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-generic clean-libtool mostlyclean-am
-
-distclean: distclean-am
-	-rm -f Makefile
-distclean-am: clean-am distclean-generic
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am: install-man
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am:
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man: install-man1
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
-	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-generic mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am: uninstall-man
-
-uninstall-man: uninstall-man1
-
-.MAKE: install-am install-strip
-
-.PHONY: all all-am check check-am clean clean-generic clean-libtool \
-	cscopelist-am ctags-am distclean distclean-generic \
-	distclean-libtool distdir dvi dvi-am html html-am info info-am \
-	install install-am install-data install-data-am install-dvi \
-	install-dvi-am install-exec install-exec-am install-html \
-	install-html-am install-info install-info-am install-man \
-	install-man1 install-pdf install-pdf-am install-ps \
-	install-ps-am install-strip installcheck installcheck-am \
-	installdirs maintainer-clean maintainer-clean-generic \
-	mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
-	ps ps-am tags-am uninstall uninstall-am uninstall-man \
-	uninstall-man1
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/man/man1/Makefile.am b/src/man/man1/Makefile.am
deleted file mode 100644
index 52606ce..0000000
--- a/src/man/man1/Makefile.am
+++ /dev/null
@@ -1,93 +0,0 @@
-man_MANS =  \
-mbhsdump.1 \
-mb7k2jstar.1 \
-mb7k2ss.1 \
-mb7kpreprocess.1 \
-mbabsorption.1 \
-mbareaclean.1 \
-mbauvloglist.1 \
-mbauvnavusbl.1 \
-mbbackangle.1 \
-mbclean.1 \
-mbcontour.1 \
-mbcopy.1 \
-mbctdlist.1 \
-mbdatalist.1 \
-mbdefaults.1 \
-mbdumpesf.1 \
-mbedit.1 \
-mbeditviz.1 \
-mbextractsegy.1 \
-mbfilter.1 \
-mbformat.1 \
-mbgetesf.1 \
-mbgrdtiff.1 \
-mbgrdviz.1 \
-mbgrid.1 \
-mbhistogram.1 \
-mbhysweeppreprocess.1 \
-mbinfo.1 \
-mbkongsbergpreprocess.1 \
-mblevitus.1 \
-mblist.1 \
-mbm_arc2grd.1 \
-mbm_bpr.1 \
-mbm_copy.1 \
-mbm_dslnavfix.1 \
-mbm_fmtvel.1 \
-mbm_grd2arc.1 \
-mbm_grd2geovrml.1 \
-mbm_grd3dplot.1 \
-mbm_grdcut.1 \
-mbm_grdinfo.1 \
-mbm_grdplot.1 \
-mbm_grdtiff.1 \
-mbm_grid.1 \
-mbm_histplot.1 \
-mbm_makedatalist.1 \
-mbm_makesvp.1 \
-mbm_multicopy.1 \
-mbm_multidatalist.1 \
-mbm_multiprocess.1 \
-mbmosaic.1 \
-mbm_plot.1 \
-mbm_route2mission.1 \
-mbm_stat.1 \
-mbm_utm.1 \
-mbm_vrefcheck.1 \
-mbm_xbt.1 \
-mbm_xyplot.1 \
-mbnavadjust.1 \
-mbnavadjustmerge.1 \
-mbnavedit.1 \
-mbnavlist.1 \
-mbneptune2esf.1 \
-mbotps.1 \
-mbpreprocess.1 \
-mbprocess.1 \
-mbps.1 \
-mbrollbias.1 \
-mbrolltimelag.1 \
-mbroutetime.1 \
-mbsegygrid.1 \
-mbsegyinfo.1 \
-mbsegylist.1 \
-mbsegypsd.1 \
-mbset.1 \
-mbstripnan.1 \
-mbsvplist.1 \
-mbsvpselect.1 \
-mbswath.1 \
-mbswplspreprocess.1 \
-mbsystem.1 \
-mbtime.1 \
-mbvelocitytool.1
-
-if BUILD_PROJ
-  man_PROJ = proj.1 geod.1 
-endif
-
-
-
-
-EXTRA_DIST = $(man_MANS) $(man_PROJ)
diff --git a/src/man/man1/Makefile.in b/src/man/man1/Makefile.in
deleted file mode 100644
index e9f0651..0000000
--- a/src/man/man1/Makefile.in
+++ /dev/null
@@ -1,627 +0,0 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
-
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
-am__make_running_with_option = \
-  case $${target_option-} in \
-      ?) ;; \
-      *) echo "am__make_running_with_option: internal error: invalid" \
-              "target option '$${target_option-}' specified" >&2; \
-         exit 1;; \
-  esac; \
-  has_opt=no; \
-  sane_makeflags=$$MAKEFLAGS; \
-  if $(am__is_gnu_make); then \
-    sane_makeflags=$$MFLAGS; \
-  else \
-    case $$MAKEFLAGS in \
-      *\\[\ \	]*) \
-        bs=\\; \
-        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
-          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
-    esac; \
-  fi; \
-  skip_next=no; \
-  strip_trailopt () \
-  { \
-    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
-  }; \
-  for flg in $$sane_makeflags; do \
-    test $$skip_next = yes && { skip_next=no; continue; }; \
-    case $$flg in \
-      *=*|--*) continue;; \
-        -*I) strip_trailopt 'I'; skip_next=yes;; \
-      -*I?*) strip_trailopt 'I';; \
-        -*O) strip_trailopt 'O'; skip_next=yes;; \
-      -*O?*) strip_trailopt 'O';; \
-        -*l) strip_trailopt 'l'; skip_next=yes;; \
-      -*l?*) strip_trailopt 'l';; \
-      -[dEDm]) skip_next=yes;; \
-      -[JT]) skip_next=yes;; \
-    esac; \
-    case $$flg in \
-      *$$target_option*) has_opt=yes; break;; \
-    esac; \
-  done; \
-  test $$has_opt = yes
-am__make_dryrun = (target_option=n; $(am__make_running_with_option))
-am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-subdir = src/man/man1
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
-	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
-	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
-	$(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-	$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/src/mbio/mb_config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-AM_V_P = $(am__v_P_ at AM_V@)
-am__v_P_ = $(am__v_P_ at AM_DEFAULT_V@)
-am__v_P_0 = false
-am__v_P_1 = :
-AM_V_GEN = $(am__v_GEN_ at AM_V@)
-am__v_GEN_ = $(am__v_GEN_ at AM_DEFAULT_V@)
-am__v_GEN_0 = @echo "  GEN     " $@;
-am__v_GEN_1 = 
-AM_V_at = $(am__v_at_ at AM_V@)
-am__v_at_ = $(am__v_at_ at AM_DEFAULT_V@)
-am__v_at_0 = @
-am__v_at_1 = 
-SOURCES =
-DIST_SOURCES =
-am__can_run_installinfo = \
-  case $$AM_UPDATE_INFO_DIR in \
-    n|no|NO) false;; \
-    *) (install-info --version) >/dev/null 2>&1;; \
-  esac
-am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
-am__vpath_adj = case $$p in \
-    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
-    *) f=$$p;; \
-  esac;
-am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
-am__install_max = 40
-am__nobase_strip_setup = \
-  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
-am__nobase_strip = \
-  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
-am__nobase_list = $(am__nobase_strip_setup); \
-  for p in $$list; do echo "$$p $$p"; done | \
-  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
-  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
-    if (++n[$$2] == $(am__install_max)) \
-      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
-    END { for (dir in files) print dir, files[dir] }'
-am__base_list = \
-  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
-  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
-am__uninstall_files_from_dir = { \
-  test -z "$$files" \
-    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
-    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
-         $(am__cd) "$$dir" && rm -f $$files; }; \
-  }
-man1dir = $(mandir)/man1
-am__installdirs = "$(DESTDIR)$(man1dir)"
-NROFF = nroff
-MANS = $(man_MANS)
-am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-CC = @CC@
-CCAS = @CCAS@
-CCASDEPMODE = @CCASDEPMODE@
-CCASFLAGS = @CCASFLAGS@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DLLTOOL = @DLLTOOL@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GREP = @GREP@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBM = @LIBM@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIBTOOL_DEPS = @LIBTOOL_DEPS@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LTLIBOBJS = @LTLIBOBJS@
-LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
-MAINT = @MAINT@
-MAKEINFO = @MAKEINFO@
-MANIFEST_TOOL = @MANIFEST_TOOL@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-OTPS_DIR = @OTPS_DIR@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_URL = @PACKAGE_URL@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PKG_CONFIG = @PKG_CONFIG@
-PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
-PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-VERSION = @VERSION@
-XDR_LIB = @XDR_LIB@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_AR = @ac_ct_AR@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-fftw_app = @fftw_app@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libGLU_CFLAGS = @libGLU_CFLAGS@
-libGLU_LIBS = @libGLU_LIBS@
-libXm_CFLAGS = @libXm_CFLAGS@
-libXm_LIBS = @libXm_LIBS@
-libdir = @libdir@
-libexecdir = @libexecdir@
-libfftw3_CFLAGS = @libfftw3_CFLAGS@
-libfftw3_LIBS = @libfftw3_LIBS@
-libfftw_CPPFLAGS = @libfftw_CPPFLAGS@
-libfftw_LIBS = @libfftw_LIBS@
-libgmt_CFLAGS = @libgmt_CFLAGS@
-libgmt_CPPFLAGS = @libgmt_CPPFLAGS@
-libgmt_LIBS = @libgmt_LIBS@
-libmotif_CPPFLAGS = @libmotif_CPPFLAGS@
-libmotif_LIBS = @libmotif_LIBS@
-libnetcdf_CFLAGS = @libnetcdf_CFLAGS@
-libnetcdf_CPPFLAGS = @libnetcdf_CPPFLAGS@
-libnetcdf_LIBS = @libnetcdf_LIBS@
-libopengl_CPPFLAGS = @libopengl_CPPFLAGS@
-libopengl_LIBS = @libopengl_LIBS@
-libproj_CFLAGS = @libproj_CFLAGS@
-libproj_CPPFLAGS = @libproj_CPPFLAGS@
-libproj_LIBS = @libproj_LIBS@
-libpsl_CFLAGS = @libpsl_CFLAGS@
-libpsl_LIBS = @libpsl_LIBS@
-localedir = @localedir@
-localstatedir = @localstatedir@
-mandir = @mandir@
-mbsystemdatadir = @mbsystemdatadir@
-mbsystemhtmldir = @mbsystemhtmldir@
-mbsystempsdir = @mbsystempsdir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-man_MANS = \
-mbhsdump.1 \
-mb7k2jstar.1 \
-mb7k2ss.1 \
-mb7kpreprocess.1 \
-mbabsorption.1 \
-mbareaclean.1 \
-mbauvloglist.1 \
-mbauvnavusbl.1 \
-mbbackangle.1 \
-mbclean.1 \
-mbcontour.1 \
-mbcopy.1 \
-mbctdlist.1 \
-mbdatalist.1 \
-mbdefaults.1 \
-mbdumpesf.1 \
-mbedit.1 \
-mbeditviz.1 \
-mbextractsegy.1 \
-mbfilter.1 \
-mbformat.1 \
-mbgetesf.1 \
-mbgrdtiff.1 \
-mbgrdviz.1 \
-mbgrid.1 \
-mbhistogram.1 \
-mbhysweeppreprocess.1 \
-mbinfo.1 \
-mbkongsbergpreprocess.1 \
-mblevitus.1 \
-mblist.1 \
-mbm_arc2grd.1 \
-mbm_bpr.1 \
-mbm_copy.1 \
-mbm_dslnavfix.1 \
-mbm_fmtvel.1 \
-mbm_grd2arc.1 \
-mbm_grd2geovrml.1 \
-mbm_grd3dplot.1 \
-mbm_grdcut.1 \
-mbm_grdinfo.1 \
-mbm_grdplot.1 \
-mbm_grdtiff.1 \
-mbm_grid.1 \
-mbm_histplot.1 \
-mbm_makedatalist.1 \
-mbm_makesvp.1 \
-mbm_multicopy.1 \
-mbm_multidatalist.1 \
-mbm_multiprocess.1 \
-mbmosaic.1 \
-mbm_plot.1 \
-mbm_route2mission.1 \
-mbm_stat.1 \
-mbm_utm.1 \
-mbm_vrefcheck.1 \
-mbm_xbt.1 \
-mbm_xyplot.1 \
-mbnavadjust.1 \
-mbnavadjustmerge.1 \
-mbnavedit.1 \
-mbnavlist.1 \
-mbneptune2esf.1 \
-mbotps.1 \
-mbpreprocess.1 \
-mbprocess.1 \
-mbps.1 \
-mbrollbias.1 \
-mbrolltimelag.1 \
-mbroutetime.1 \
-mbsegygrid.1 \
-mbsegyinfo.1 \
-mbsegylist.1 \
-mbsegypsd.1 \
-mbset.1 \
-mbstripnan.1 \
-mbsvplist.1 \
-mbsvpselect.1 \
-mbswath.1 \
-mbswplspreprocess.1 \
-mbsystem.1 \
-mbtime.1 \
-mbvelocitytool.1
-
- at BUILD_PROJ_TRUE@man_PROJ = proj.1 geod.1 
-EXTRA_DIST = $(man_MANS) $(man_PROJ)
-all: all-am
-
-.SUFFIXES:
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
-	@for dep in $?; do \
-	  case '$(am__configure_deps)' in \
-	    *$$dep*) \
-	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-	        && { if test -f $@; then exit 0; else break; fi; }; \
-	      exit 1;; \
-	  esac; \
-	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/man/man1/Makefile'; \
-	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --gnu src/man/man1/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	@case '$?' in \
-	  *config.status*) \
-	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-	esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-
-mostlyclean-libtool:
-	-rm -f *.lo
-
-clean-libtool:
-	-rm -rf .libs _libs
-install-man1: $(man_MANS)
-	@$(NORMAL_INSTALL)
-	@list1=''; \
-	list2='$(man_MANS)'; \
-	test -n "$(man1dir)" \
-	  && test -n "`echo $$list1$$list2`" \
-	  || exit 0; \
-	echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \
-	$(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \
-	{ for i in $$list1; do echo "$$i"; done;  \
-	if test -n "$$list2"; then \
-	  for i in $$list2; do echo "$$i"; done \
-	    | sed -n '/\.1[a-z]*$$/p'; \
-	fi; \
-	} | while read p; do \
-	  if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
-	  echo "$$d$$p"; echo "$$p"; \
-	done | \
-	sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
-	      -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
-	sed 'N;N;s,\n, ,g' | { \
-	list=; while read file base inst; do \
-	  if test "$$base" = "$$inst"; then list="$$list $$file"; else \
-	    echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \
-	    $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \
-	  fi; \
-	done; \
-	for i in $$list; do echo "$$i"; done | $(am__base_list) | \
-	while read files; do \
-	  test -z "$$files" || { \
-	    echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \
-	    $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \
-	done; }
-
-uninstall-man1:
-	@$(NORMAL_UNINSTALL)
-	@list=''; test -n "$(man1dir)" || exit 0; \
-	files=`{ for i in $$list; do echo "$$i"; done; \
-	l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
-	  sed -n '/\.1[a-z]*$$/p'; \
-	} | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
-	      -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
-	dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir)
-tags TAGS:
-
-ctags CTAGS:
-
-cscope cscopelist:
-
-
-distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	list='$(DISTFILES)'; \
-	  dist_files=`for file in $$list; do echo $$file; done | \
-	  sed -e "s|^$$srcdirstrip/||;t" \
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
-	case $$dist_files in \
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
-			   sort -u` ;; \
-	esac; \
-	for file in $$dist_files; do \
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  if test -d $$d/$$file; then \
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
-	    if test -d "$(distdir)/$$file"; then \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
-	  else \
-	    test -f "$(distdir)/$$file" \
-	    || cp -p $$d/$$file "$(distdir)/$$file" \
-	    || exit 1; \
-	  fi; \
-	done
-check-am: all-am
-check: check-am
-all-am: Makefile $(MANS)
-installdirs:
-	for dir in "$(DESTDIR)$(man1dir)"; do \
-	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
-	done
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
-	if test -z '$(STRIP)'; then \
-	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	      install; \
-	else \
-	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
-	fi
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
-	@echo "This command is intended for maintainers to use"
-	@echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-generic clean-libtool mostlyclean-am
-
-distclean: distclean-am
-	-rm -f Makefile
-distclean-am: clean-am distclean-generic
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am: install-man
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am:
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man: install-man1
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
-	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-generic mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am: uninstall-man
-
-uninstall-man: uninstall-man1
-
-.MAKE: install-am install-strip
-
-.PHONY: all all-am check check-am clean clean-generic clean-libtool \
-	cscopelist-am ctags-am distclean distclean-generic \
-	distclean-libtool distdir dvi dvi-am html html-am info info-am \
-	install install-am install-data install-data-am install-dvi \
-	install-dvi-am install-exec install-exec-am install-html \
-	install-html-am install-info install-info-am install-man \
-	install-man1 install-pdf install-pdf-am install-ps \
-	install-ps-am install-strip installcheck installcheck-am \
-	installdirs maintainer-clean maintainer-clean-generic \
-	mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
-	ps ps-am tags-am uninstall uninstall-am uninstall-man \
-	uninstall-man1
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/man/man1/geod.1 b/src/man/man1/geod.1
deleted file mode 100644
index 3676172..0000000
--- a/src/man/man1/geod.1
+++ /dev/null
@@ -1,206 +0,0 @@
-.\" @(#)geod.1 \- 1.1
-.nr LL 5.5i
-.ad b
-.hy 1
-.TH GEOD 1 "2000/03/21 Rel. 4.4"
-.SH NAME
-geod \- direct geodesic computations
-.br
-invgeod \- inverse geodesic computations
-.SH SYNOPSIS
-.B geod
-.B +ellps=<ellipse>
-[
-.B \-afFIlptwW
-[
-.I args
-] ] [
-.B +args
-]
-file[s]
-.br
-.B invgeod
-.B +ellps=<ellipse>
-[
-.B \-afFIlptwW
-[
-.I args
-] ] [
-.B +args
-]
-file[s]
-.SH DESCRIPTION
-.I Geod
-(direct) and
-.I invgeod
-(inverse)
-perform geodesic (Great Circle) computations for determining
-latitude, longitude and back azimuth of a terminus point
-given a initial point latitude, longitude, azimuth and distance (direct) or
-the forward and back azimuths and distance between an initial and
-terminus point latitudes and longitudes (inverse).
-.PP
-The following runline control parameters can appear in any order:
-.TP
-.B \-I
-Specifies that the inverse geodesic computation is to be performed.
-May be used with execution of
-.B goed
-as an alternative to
-.B invgeod
-execution.
-.TP
-.B \-a
-Latitude and longitudes of the initial and terminal points,
-forward and back azimuths and distance are output.
-.TP
-.BI \-t "a"
-.I A
-specifies a character employed as the first character to denote
-a control line to be passed through without processing.
-.TP
-.BI \-le
-Gives a listing of all the ellipsoids that may be selected with the
-.B +ellps=
-option.
-.TP
-.BI \-lu
-Gives a listing of all the units that may be selected with the
-.B +units=
-option.
-.TP
-.BI \-[f|F] " format"
-.I Format
-is a
-.I printf
-format string to control the output form of the geographic coordinate values
-(\fBf\fR) or distance value (\fBF\fR).
-The default mode is DMS for geographic coordinates and "%.3f" for distance.
-.TP
-.BI \-[w|W] n
-.I N
-is the number of significant fractional digits to employ for
-seconds output (when the option is not specified,
-.B \-w3
-is assumed).
-When
-.B \-W
-is employed the fields will be constant width with leading zeroes.
-.TP
-.B \-p
-This option causes the azimuthal values to be output as unsigned
-DMS numbers between 0 and 360 degrees.  Also note \-f.
-.PP
-The
-.B +args
-run-line arguments are associated with geodetic parameters
-for specifying the ellipsoidal or sphere to use.
-See
-.B proj
-documentation for full list of these parameters and controls.
-The options are processed in left to right order
-from the run line.
-Reentry of an option is ignored with the first occurrence assumed to
-be the desired value.
-.PP
-One or more
-.I files
-(processed in left to right order)
-specify the source of data to be transformed.
-A \- will specify the location of processing standard input.
-If no files are specified, the input is assumed to be from
-.I stdin.
-.PP
-For direct determinations input data must be in latitude,
-longitude, azimuth and distance order and output will be
-latitude, longitude and back azimuth of the terminus point.
-Latitude, longitude of the initial and terminus point are
-input for the inverse mode and respective forward and back
-azimuth from the initial and terminus points are output along
-with the distance between the points.
-.PP
-Input geographic coordinates
-(latitude and longitude) and azimuthal data must be in DMS format and input
-distance data must be in units consistent with the ellipsoid
-major axis or sphere radius units.
-Output geographic coordinates will be in DMS
-(if the
-.B \-f
-switch is not employed) to 0.001"
-with trailing, zero-valued minute-second fields deleted.
-Output distance data will be in the same units as the ellipsoid or
-sphere radius.
-.PP
-The Earth's ellipsoidal figure may be selected in the same
-manner as program
-.B proj
-by using
-.B "+ellps=, +a=, +es=,"
-etc.
-.PP
-.I Geod
-may also be used to determine intermediate points along either
-a geodesic line between two points or along an arc of specified distance
-from a geographic point.
-In both cases an initial point must be specified with
-.BI +lat_1= lat
-and
-.BI +lon_1= lon
-parameters and either a terminus point
-.BI +lat_2= lat
-and
-.BI +lon_2= lon
-or a distance and azimuth from the initial point with
-.BI +S= distance
-and
-.BI +A= azimuth
-must be specified.
-.PP
-If points along a geodesic are to be determined then either
-.BI +n_S= integer
-specifying the number of intermediate points and/or
-.BI +del_S= distance
-specifying the incremental distance between points must be specified.
-.PP
-To determine points along an arc equidistant from the initial point both
-.BI +del_A= angle
-and
-.BI +n_A= integer
-must be specified which determine the respective angular increments
-and number of points to be determined.
-.RE
-.SH EXAMPLE
-The following script determines the geodesic azimuths and distance in
-U.S. stature miles from Boston, MA, to Portland, OR:
-.RS 5
- \f(CWgeod +ellps=clrk66 <<EOF \-I +units=us-mi
- 42d15'N 71d07'W 45d31'N 123d41'W
- EOF\fR
-.RE
-which gives the results:
-.RS 5
- \f(CW-66d31'50.141"   75d39'13.083"   2587.504
-.RE
-where the first two values are the
-azimuth from Boston to Portland, the back azimuth from Portland to
-Boston followed by the distance.
-.PP
-An example of forward geodesic use is to use the Boston location and determine
-Portland's location by azimuth and distance:
-.RS 5
- \f(CWgeod +ellps=clrk66 <<EOF +units=us-mi
- 42d15'N 71d07'W \-66d31'50.141" 2587.504
- EOF\fR
-.RE
-which gives:
-.RS 5
- \f(CW45d31'0.003"N   123d40'59.985"W 75d39'13.094"\fR
-.RE
-Note: lack of precision in the distance value compromises
-the precision of the Portland location.
-.SH SEE ALSO
-Thomas, P.D., 1970,
-.I "Spheroidal Geodesics, Reference Systems & Local Geometry:"
-U.S. Naval Oceanographic  Office, S-138.
-.SH HOME PAGE
-http://www.remotesensing.org/proj
diff --git a/src/man/man1/mb7k2jstar.1 b/src/man/man1/mb7k2jstar.1
deleted file mode 100644
index 8e0cb81..0000000
--- a/src/man/man1/mb7k2jstar.1
+++ /dev/null
@@ -1,291 +0,0 @@
-.TH mb7k2jstar 1 "3 June 2013" "MB-System 5.0" "MB-System 5.0"
-.SH NAME
-\fBmb7k2jstar\fP \- extracts subbottom profiler and/or sidescan sonar
-data from Reson 7k format data files into Edgetech Jstar format data files.
-
-.SH VERSION
-Version 5.0
-
-.SH SYNOPSIS
-\fBmb7k2jstar\fP [\fB\-I\fIfile \fB\-A\fItype\fP
-\fB\-B\fIbottompickmode/bottompickthreshold\fP \fB\-C\fP
-\fB\-F\fIformat\fP \fB\-L\fP\fIstartline/lineroot\fP
-\fB\-M \-O\fIoutfile\fP \fB\-R\fIroutefile\fP \fB\-X \-H \-V\fP]
-
-.SH DESCRIPTION
-\fBMB7k2jstar\fP is a utility that extracts Edgetech subbottom
-profiler and sidescan data from Reson 7k format (MBIO format 88) data and
-outputs in the Edgetech Jstar format (MBIO formats 132 and 133).
-By default, \fBmb7k2jstar\fP extracts all channels of
-sonar data from the Reson 7k file to the Edgetech Jstar file.
-Edgetech sonar systems may include dual frequency sidescans and a
-subbottom profiler. Users may use the \fB\-A\fP option to specify
-which channels are extracted. \fBMB7k2jstar\fP operates on single
-input files or on datalists. By default there will be a separate
-output file for every input file, but if the \fB\-O\fP option
-is used to specify an output file, data from all input files will
-be directed to that single output file.
-
-The extracted Jstar data file(s) can be organized three ways. If the \fB\-O\fP
-option is used to specify a single Jstar output file, then all of the
-Jstar data will be output to that single file. If the \fB\-R\fP option is
-used to specify a survey route file that includes the waypoints covered
-while collecting the data file(s) referenced by \fB\-I\fP\fIfile\fP, then
-the output Jstar data will be broken up by the sequential lines defined by
-the waypoints. In this case each output Jstar file will be named using the
-line root name specified by \fB\-L\fP\fIstartline/lineroot\fP with a sequential line
-number starting from \fIstartline\fP. If neither the \fB\-O\fP or \fB\-L\fP
-options are used, each input swath file will have a corresponding Jstar output
-file.
-
-When the user specifies that all Edgetech sidescan and subbottom
-data be extracted but does not specify the output file name, the
-output files will have the "*.jsf" suffix recognized by Edgetech
-software. If the \fB\-A\fP\fI1\fP option is used to specify that only
-low frequency sidescan be extracted, the output files will have
-an "*.mb132" suffix. If the \fB\-A\fP\fI1\fP option is used to specify that only
-high frequency sidescan be extracted, the output files will have
-an "*.mb133" suffix.
-
-.SH AUTHORSHIP
-David W. Caress (caress at mbari.org)
-.br
-  Monterey Bay Aquarium Research Institute
-.br
-Dale N. Chayes (dale at ldeo.columbia.edu)
-.br
-  Lamont-Doherty Earth Observatory
-
-.SH OPTIONS
-.TP
-.B \-A
-\fImode\fP
-.br
-This option sets the types of data to be extracted and output.
-If \fB\-A\fP\fI1\fP is given, then any low frequency sidescan
-in the input will be extracted to the output. If \fB\-A\fP\fI2\fP
-is given, then any high frequency sidescan records are extracted.
-The \fB\-A\fP\fI3\fP option causes subbottom profiler records to
-be extracted. Default: All Edgetech sidescan and subbottom
-profiler records are extracted.
-.TP
-.B \-B
-\fIbottompickmode/bottompickthreshold\fP
-.br
-This option sets the source of the sonar first arrival time embedded into
-the Jstar format trace headers. This value can be used for
-laying out sidescan on the seafloor. If \fIbottompickmode\fP = 1,
-then \fBmb7k2jstar\fP will use the altitude value associated with
-platform navigation. If \fIbottompickmode\fP = 2, then \fBmb7k2jstar\fP
-will extract the first arrival time from multibeam bathymetry in the
-7k data stream. If \fIbottompickmode\fP = 3, then \fBmb7k2jstar\fP
-will pick the first arrival time in the sidescan sonar data by looking
-for the first sample with an amplitude > \fIbottompickthreshold\fP times the
-maximum amplitude in the trace.
-Default: \fIbottompickmode\fP = 1.
-.TP
-.B \-C
-.br
-This option causes  \fBmb7k2jstar\fP to print out any comment records
-encountered in the input Reson 7k data.
-.TP
-.B \-F
-\fIformat\fP
-.br
-Sets the data format used if the input is read from stdin
-or from a file. If \fIformat\fP < 0, then the input file specified
-with the \fB\-I\fP option will actually contain a list of input swath sonar
-data files. This program only reads Reson 7k format data files (\fBMBIO\fP
-format 88).
-.TP
-.B \-H
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-.TP
-.B \-I
-\fIinfile\fP
-.br
-Sets the input file path. If \fIformat\fP > 0 (set with the
-\fB\-f\fP option or \fBmbdefaults\fP) then the swath sonar data contained in \fIinfile\fP
-is read and processed. If \fIformat\fP < 0, then \fIinfile\fP
-is assumed to be an ascii file containing a list of the input swath sonar
-data files to be processed and their formats.  The program will read
-the data in each one of these files.
-In the \fIinfile\fP file, each
-data file should be followed by a data format identifier, e.g.:
- 	datafile1 88
- 	datafile2 88
-.br
-This program only reads Reson 7k format data files (\fBMBIO\fP
-format 88).
-.TP
-.B \-L
-\fIstartline/lineroot\fP
-.br
-This option sets the starting line number and the output filename root
-used when \fB\-R\fP is specified so that data are output according
-to planned survey lines. Default: \fIstartline\fP = 1; \fIlineroot\fP = "jstar".
-.TP
-.B \-M
-.br
-This option causes \fBmb7k2jstar\fP to omit data during turns when
-extracting into line files according to a specified set of waypoints
-(\fB\-R\fP option). The traces will not be output until the heading is
-within 15 degrees of the next survey line's bearing.
-.TP
-.B \-O
-.br
-This option sets the output Edgetech Jstar (\fBMBIO\fP format 132/133) format file path.
-If \fB\-O\fP is not invoked,
-the output jstar filename (or files if a datalist is being processed) will
-be the input swath filename with the ".s7k" or ".mb88" suffix replaced by a new suffix.
-An ".jsf" suffix is used when all Edgetech record types are extracted
-to the output, ".mb132" is used when the low frequency sidescan records are extracted,
-and ".mb133" is used when the high frequency sidescan records are extracted. The record
-types to be extracted are set using the \fB\-A\fP option.
-.TP
-.B \-R
-\fIroutefile\fP
-.br
-This option specifies an \fBmbgrdviz\fP route file containing the intended
-waypoints of the survey. If \fIroutefile\fP is specified, \fBmb7k2jstar\fP
-will output Jstar data in files corresponding to the planned survey lines.
-The output Jstar file names will be based on \fIlineroot\fP and will include
-the line number starting with \fIstarline\fP, both of which are specified
-using the \fB\-L\fP options.  If neither \fB\-O\fP nore \fB\-R\fP are invoked,
-the output Jstar filename (or files if a datalist is being processed) will
-be the input swath filename with an appropriate suffix appended (".jsf" for
-mixed Jstar files, ".mb132" for low frequency sidescan only files, and ".mb133"
-for high frequency sidescan only files).
-.TP
-.B \-V
-This option increases the verbosity of \fBmb7k2jstar\fP, causing it
-to print out messages regarding its progress to stdout.
-.TP
-.B \-X
-This option switches port and starboard sidescan channels.
-
-.SH EXAMPLES
-Suppose that one has collected a Reson 7k datafile incorporating
-multibeam sonar data, sidescan data, and subbottom profiler data, and
-that the filename is:
- 	20050418_150155.s7k
-.br
-
-In order to extract all of the Edgetech sonar data into a Jstar file, one can use
-\fBmb7k2jstar\fP with no special arguments:
- 	mb7k2jstar \-I 20040722_152111.s7k
-.br
-which yields the following output:
-
- 	Data records read from: 20050418_150155.s7k
- 	     Survey:        990
- 	     File Header:   1
- 	     Bluefin CTD:   989
- 	     Bluefin Nav:   760
- 	     Subbottom:     989
- 	     Low Sidescan:  990
- 	     High Sidescan: 989
- 	Data records written to: 20050418_150155.jsf
- 	     Subbottom:     989
- 	     Low Sidescan:  990
- 	     High Sidescan: 989
-
-One may also extract just the low frequency sidescan by using the \fB\-A\fP\fI1\fP option:
- 	mb7k2jstar \-I 20040722_152111.s7k \-A1
-.br
-which yields the following output:
-
- 	Data records read from: 20050418_150155.s7k
- 	     Survey:        990
- 	     File Header:   1
- 	     Bluefin CTD:   989
- 	     Bluefin Nav:   760
- 	     Subbottom:     989
- 	     Low Sidescan:  990
- 	     High Sidescan: 989
- 	Data records written to: 20050418_150155.mb132
- 	     Subbottom:     0
- 	     Low Sidescan:  990
- 	     High Sidescan: 0
-
-One may also extract just the high frequency sidescan by using the \fB\-A\fP\fI2\fP option:
- 	mb7k2jstar \-I 20040722_152111.s7k \-A2
-.br
-which yields the following output:
-
- 	Data records read from: 20050418_150155.s7k
- 	     Survey:        990
- 	     File Header:   1
- 	     Bluefin CTD:   989
- 	     Bluefin Nav:   760
- 	     Subbottom:     989
- 	     Low Sidescan:  990
- 	     High Sidescan: 989
- 	Data records written to: 20050418_150155.mb132
- 	     Subbottom:     0
- 	     Low Sidescan:  990
- 	     High Sidescan: 0
-
- 	2527 records output to segy file 20040722_154429.s7k.segy
-.br
-
-Users may process multiple Reson 7k files by inputting a datalist, or list of
-swath data files. All of the extracted data records can be output to a single
-file by specifying the output file with the \fB\-O\fP option. For example, if
-one has a datalist file called datalistp.mb-1 that references three Reson 7k files:
- 	20050418_150155p.mb88 88
- 	20050418_151812p.mb88 88
-.br
-and one wants all the low frequency sidescan data collated into a single
-Jstar data file called 20050418_sslow.mb132, then use the following command:
- 	mb7k2jstar \-A1 \-I datalistp.mb-1 \-O 20050418_sslow.mb132
-.br
-which yields the following output:
- 	Data records to extract:
- 	     Low Sidescan
-
- 	Data records read from: 20050418_150155p.mb88
- 	     Survey:        990
- 	     File Header:   2
- 	     Bluefin CTD:   989
- 	     Bluefin Nav:   760
- 	     Subbottom:     989
- 	     Low Sidescan:  990
- 	     High Sidescan: 989
- 	Data records written to: 20050418_sslow.mb132
- 	     Subbottom:     0
- 	     Low Sidescan:  990
- 	     High Sidescan: 0
-
- 	Data records read from: 20050418_151812p.mb88
- 	     Survey:        741
- 	     File Header:   2
- 	     Bluefin CTD:   741
- 	     Bluefin Nav:   563
- 	     Subbottom:     741
- 	     Low Sidescan:  742
- 	     High Sidescan: 741
- 	Data records written to: 20050418_sslow.mb132
- 	     Subbottom:     0
- 	     Low Sidescan:  742
- 	     High Sidescan: 0
-
- 	Total data records read from: 20050418_151812p.mb88
- 	     Survey:        1731
- 	     File Header:   4
- 	     Bluefin CTD:   1730
- 	     Bluefin Nav:   1323
- 	     Subbottom:     1730
- 	     Low Sidescan:  1732
- 	     High Sidescan: 1730
- 	Total data records written to: 20050418_sslow.mb132
- 	     Subbottom:     0
- 	     Low Sidescan:  1732
- 	     High Sidescan: 0
-
-.SH SEE ALSO
-\fBmbsystem\fP(1), \fBmbformat\fP(1), \fBmbinfo\fP(1)
-
-.SH BUGS
-No doubt.
diff --git a/src/man/man1/mb7k2ss.1 b/src/man/man1/mb7k2ss.1
deleted file mode 100644
index 2c19109..0000000
--- a/src/man/man1/mb7k2ss.1
+++ /dev/null
@@ -1,354 +0,0 @@
-.TH mb7k2ss 1 "3 June 2013" "MB-System 5.0" "MB-System 5.0"
-.SH NAME
-\fBmb7k2ss\fP \- extracts sidescan sonar
-data from Reson 7k format data, bins and lays the sidescan
-onto the seafloor, and outputs files in the MBF_MBLDEOIH
-formst (MBIO format id 71).
-
-.SH VERSION
-Version 5.0
-
-.SH SYNOPSIS
-\fBmb7k2ss\fP [\fB\-A\fItype\fP
-\fB\-B\fP\fIbottompickmode/bottompickthreshold\fP \fB\-C\fP \fB\-D\fP\fIinterpbins\fP
-\fB\-F\fP\fIformat\fP \fB\-I\fP\fIfile\fP \fB\-L\fP\fIstartline/lineroot\fP
-\fB\-M \-O\fP\fIoutfile\fP \fB\-Q\fP\fIroutetimefile\fP \fB\-R\fP\fIroutefile\fP
-\fB\-T\fP\fItopogridfile\fP \fB\-U\fP\fIrangethreshold\fP \fB\-X \-H \-V\fP]
-
-.SH DESCRIPTION
-\fBmb7k2ss\fP is a utility that extracts Edgetech sidescan data from
-Reson 7k format (MBIO format 88) data and outputs in the MBF_MBLDEOIH
-format (MBIO format 71). Edgetech sonar systems may include dual
-frequency sidescans and a subbottom profiler. Users may use the \fB\-A\fP
-option to specify whether low frequency or high frequency sidescan data
-are extracted. By default, low frequency sidescan is extracted.
-\fBMB7k2ss\fP can operate on a single input file or on a datalist
-referencing many input files.
-
-The raw sidescan consists of port and starboard channels, each with
-thousands of samples ordered uniformly in time from the sonar ping.
-\fBMB7k2ss\fP outputs a lower resolution single sidescan swath laid
-out onto the seafloor and ordered in pixels with uniform spacing in
-acrosstrack distance. Typically the output swath will have 4001
-sidescan pixels, each representing an average of several raw samples.
-To achieve this result, the program calculates the location
-of each raw sample, and bins the samples into the output swath.
-By default, the program uses the sonar altitude and a flat bottom
-assumption to calculate the sample positions. If a topography grid
-covering the survey area is input using the \fB\-T\fP option, then
-the sample positions will be calculated using that topography and
-the resulting sidescan will be properly located on the seafloor
-(that is, if the topography is accurate...).
-
-The method used to determine the sonar altitude is controlled using the
-\fB\-B\fP option. By default, the program will use the altitude value
-recorded in the vehicle navigation records. Users may also specify use
-of nadir bathymetry from co-recorded multibeam bathymetry, or the
-altitude can be picked from the first arrival observed in the sidescan
-data itself.
-
-The extracted sidescan data file(s) can be organized three ways.By
-default there will be a separate output file for every input file.
-If the \fB\-O\fP option is used to specify a single output file, then
-all of the specified sidescan data will be output to that file. If
-the \fB\-Q\fP or \fB\-R\fP option is used to specify a survey route file
-that includes the waypoints covered while collecting the data file(s)
-referenced by \fB\-I\fP\fIfile\fP, then the output sidescan data will
-be broken up by the sequential lines defined by the waypoints. The
-\fB\-R\fP option requires a route file of the form exported by \fBMBgrdviz\fP.
-The \fB\-Q\fP option requires a route file that includes the time
-at which each waypoint is reached in the data; this can be generated
-from a regular route file using \fBmbroutetime\fP. In either of these
-cases each output file will be named using the  line root name
-specified by \fB\-L\fP\fIstartline/lineroot\fP with a sequential line
-number starting from \fIstartline\fP. All output files will have a
-".mb71" suffix.
-
-The program \fBmbextractsegy\fP is available to extract subbottom profiler
-data from Reson 7k data.
-
-.SH AUTHORSHIP
-David W. Caress (caress at mbari.org)
-.br
-  Monterey Bay Aquarium Research Institute
-.br
-Dale N. Chayes (dale at ldeo.columbia.edu)
-.br
-  Lamont-Doherty Earth Observatory
-
-.SH OPTIONS
-.TP
-.B \-A
-\fImode\fP
-.br
-This option sets the types of data to be extracted and output.
-If \fB\-A\fP\fI1\fP is given, then any low frequency sidescan
-in the input will be extracted to the output. If \fB\-A\fP\fI2\fP
-is given, then any high frequency sidescan records are extracted.
-Default: Low frequency sidescan records are extracted.
-.TP
-.B \-B
-\fIbottompickmode/bottompickthreshold\fP
-.br
-This option sets the source of the sonar first arrival time used for
-laying out sidescan on the seafloor. If \fIbottompickmode\fP = 1,
-then \fBmb7k2ss\fP will use the altitude value associated with
-platform navigation. If \fIbottompickmode\fP = 2, then \fBmb7k2ss\fP
-will extract the first arrival time from multibeam bathymetry in the
-7k data stream. If \fIbottompickmode\fP = 3, then \fBmb7k2ss\fP
-will pick the first arrival time in the sidescan sonar data by looking
-for the first sample with an amplitude > \fIbottompickthreshold\fP times the
-maximum amplitude in the trace. The altitude used will be the average of
-the first arrival times calculated for the port and starboard channels.
-Default: fIbottompickmode\fP = 1.
-.TP
-.B \-C
-.br
-This option causes  \fBmb7k2ss\fP to print out any comment records
-encountered in the input Reson 7k data.
-.TP
-.B \-D
-\fIinterpbins\fP
-.br
-Causes interpolation over gaps in the output sidescan resulting from draping
-the sidescan on topography. The \fIinterpbins\fP values sets the maximum
-gap size over which interpolation will be applied.
-.TP
-.B \-F
-\fIformat\fP
-.br
-Sets the data format used if the input is read from stdin
-or from a file. If \fIformat\fP < 0, then the input file specified
-with the \fB\-I\fP option will actually contain a list of input swath sonar
-data files. This program only reads Reson 7k format data files (\fBMBIO\fP
-format 88).
-.TP
-.B \-H
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-.TP
-.B \-I
-\fIinfile\fP
-.br
-Sets the input file path. If \fIformat\fP > 0 (set with the
-\fB\-f\fP option or \fBmbdefaults\fP) then the swath sonar data contained in \fIinfile\fP
-is read and processed. If \fIformat\fP < 0, then \fIinfile\fP
-is assumed to be an ascii file containing a list of the input swath sonar
-data files to be processed and their formats.  The program will read
-the data in each one of these files.
-In the \fIinfile\fP file, each
-data file should be followed by a data format identifier, e.g.:
- 	datafile1 88
- 	datafile2 88
-.br
-This program only reads Reson 7k format data files (\fBMBIO\fP
-format 88).
-.TP
-.B \-L
-\fIstartline/lineroot\fP
-.br
-This option sets the starting line number and the output filename root
-used when \fB\-R\fP is specified so that data are output according
-to planned survey lines. Default: \fIstartline\fP = 1; \fIlineroot\fP = "jstar".
-.TP
-.B \-M
-.br
-This option causes \fBmb7k2ss\fP to omit data during turns when
-extracting into line files according to a specified set of waypoints
-(\fB\-R\fP option). The traces will not be output until the heading is
-within 15 degrees of the next survey line's bearing.
-.TP
-.B \-O
-.br
-This option sets the output MBF_LDEOIH (\fBMBIO\fP format 71) format file path.
-If \fB\-O\fP is not invoked, the output filename (or filenames if a datalist
-is being processed) will be the input swath filename with the ".s7k" or ".mb88"
-suffix replaced by a ".mb71) suffix. The record types to be extracted are set
-using the \fB\-A\fP option.
-.TP
-.B \-Q
-\fIroutetimefile\fP
-.br
-This option specifies a file containing the times that the survey reached
-the intended waypoints. This text file consists of lines of the form:
- 	count waypoint longitude latitude heading time_d
-.br
-where count is just an integer counter starting at 0, waypoint is the waypoint
-number starting at 0, longitude and latitude are the waypoint position in
-decimal degrees, heading is the heading in decimal degrees, and time_d is
-the unix or epoch time (time since 00:00:00 January 1, 1970) in decimal
-seconds that the survey reached this waypoint. This file can be generated from
-an \fBmbgrdviz\fP route file and survey data using the program \fBmbroutetime\fP.
-If \fIroutetimefile\fP is specified, \fBmb7k2ss\fP
-will output data in files corresponding to the planned survey lines.
-The output file names will be based on \fIlineroot\fP and will include
-the line number starting with \fIstarline\fP, both of which are specified
-using the \fB\-L\fP options.  If none of \fB\-O\fP, \fB\-Q\fP, or \fB\-R\fP are
-invoked, the output filename (or files if a datalist is being processed) will
-be the input swath filename with an ".mb71" suffix appended.
-.TP
-.B \-R
-\fIroutefile\fP
-.br
-This option specifies an \fBmbgrdviz\fP route file containing the intended
-waypoints of the survey. If \fIroutefile\fP is specified, \fBmb7k2ss\fP
-will output sidescan data in files corresponding to the planned survey lines.
-The output file names will be based on \fIlineroot\fP and will include
-the line number starting with \fIstarline\fP, both of which are specified
-using the \fB\-L\fP options.  If none of \fB\-O\fP, \fB\-Q\fP, or \fB\-R\fP are
-invoked, the output filename (or files if a datalist is being processed) will
-be the input swath filename with an ".mb71" suffix appended.
-.TP
-.B \-T
-\fItopogridfile\fP
-.br
-This option specifies a GMT grid file containing a topography model of the
-survey area. When available, \fBmb7k2ss\fP, uses the topography to calculate
-the position of each raw sidescan sample on the seafloor prior to binning
-the sample into the swath data. This method is considerable improvement over the
-flat bottom assumption used when topography is unavailable. The grid file
-must contain topography (positive up) rather than bathymetry (positive down).
-.TP
-.B \-U
-\fIrangethreshold\fP
-.br
-If the \fB\-R\fP option is specified, \fBmb7k2ss\fP breaks up the
-output into files corresponding to survey lines specified in a route file.
-This option sets the threshold distance in meters used to determine when
-a waypoint along the route has been reached; the program considers the
-next waypoint reached when the range to the waypoint becomes smaller
-than \fIrangethreshold\fP and then ceases to decrease.
-Default: \fIrangethreshold\fP = 50 m.
-.TP
-.B \-V
-This option increases the verbosity of \fBmb7k2ss\fP, causing it
-to print out messages regarding its progress to stdout.
-.TP
-.B \-W
-\fIswathwidth\fP
-This option sets the output sidescan swath width in meters. By default
-\fBmb7k2ss\fP calculates the swath width to use all of the samples available
-in the original data.
-.TP
-.B \-X
-This option switches port and starboard sidescan channels.
-
-.SH EXAMPLES
-Suppose that we have collected two Reson 7k datafiles incorporating
-multibeam sonar data, sidescan data, and subbottom profiler data, and
-that the filenames are:
-        20070809_173212.s7k
-        20070809_175133.s7k
-After running \fBmb7kpreprocess\fP on these files to fix issues and
-prepare the data for processing, we will have two additional files named:
-        20070809_173212.mb88
-        20070809_175133.mb88
-After editing the bathymetry in the ".mb88" files with \fBmbedit\fP,
-and running \fBmbprocess\fP to apply the edits, we will have two processed
-files that are, among other uses, suitable for sidescan extraction:
-        20070809_173212p.mb88
-        20070809_175133p.mb88
-If we have two datalist files, one called datalist.mb-1 referencing the ".mb88"
-files with the following contents:
-        20070809_173212p.mb88 88
-        20070809_175133p.mb88 88
-and another called datalistp.mb-1 referencing the first datalist with a
-$PROCESSED tag:
-        $PROCESSED
-        datalist.mb-1 \-1
-then we can extract the Edgetech sidescan from the processed files using:
-        mb7k2ss \-v \-A1 \-B2 \-I datalistp.mb-1 \\
-        	-M \-X \-R MAUV_Axial_1v4.rte \-L1/Axial07SS \\
-        	-T AxialCalderaMBARIAllTopo.grd
-Here the \fB\-R\fP option specifies an \fBMBgrdviz\fP route file that was
-followed in collecting the data. By using this option, the output sidescan
-files will be broken into lines defined by the route waypoints, and the
-output filenames will be sequentially numbered. The \fB\-T\fP option specifies a
-topography grid that is used by \fBmb7k2ss\fP to lay out the sidescan on
-the seafloor. The output appears as follows:
-        Program mb7k2ss
- 	Version $Id: mb7k2ss.1 2096 2013-06-04 08:17:22Z caress $
- 	MB-system Version 5.1.1beta5
-
- 	Data records to extract:
- 	     Low Sidescan
- 	     Sidescan port and starboard exchanged
-
- 	Imported 45 waypoints from route file: MAUV_Axial_1v4.rte
- 	Grid read:
- 	  Dimensions: 2072 3558
- 	  Geographic Coordinate System Name: Geographic WGS84
- 	  Geographic Coordinate System ID:   4326
- 	  Longitude:  229.926767 230.060367  0.000065
- 	  Latitude:   45.866667 46.026700  0.000045
- 	  Internal Grid Projection Mode:         0
- 	  Internal Grid Projection ID:           epsg4326
- 	Data Read:
- 	  grid_projection_mode:     0
- 	  grid_projection_id:       epsg4326
- 	  nodatavalue:              \-10000000.000000
- 	  nx:                       2072
- 	  ny:                       3558
- 	  min:                      \-2302.588135
- 	  max:                      \-1382.877319
- 	  xmin:                     229.926767
- 	  xmax:                     230.060367
- 	  ymin:                     45.866667
- 	  ymax:                     46.026700
- 	  dx:                       0.000065
- 	  dy:                       0.000045
- 	  data:                     71467008
-
- 	Data records read from: 20070809_173212p.mb88
- 	     Survey:        2330
- 	     File Header:   2
- 	     Bluefin CTD:   1152
- 	     Bluefin Nav:   942
- 	     Subbottom:     0
- 	     Low Sidescan:  2328
- 	     High Sidescan: 0
-
- 	Generating inf file for Axial07SS_0001_sslo.mb71
- 	Generating fnv file for Axial07SS_0001_sslo.mb71
-
- 	Data records written to: Axial07SS_0001_sslo.mb71
- 	     Low Sidescan:  2759
- 	     High Sidescan: 0
-
- 	Generating inf file for Axial07SS_0002_sslo.mb71
- 	Generating fnv file for Axial07SS_0002_sslo.mb71
-
- 	Data records written to: Axial07SS_0002_sslo.mb71
- 	     Low Sidescan:  369
- 	     High Sidescan: 0
-
- 	Data records read from: 20070809_175133p.mb88
- 	     Survey:        2367
- 	     File Header:   2
- 	     Bluefin CTD:   1158
- 	     Bluefin Nav:   942
- 	     Subbottom:     0
- 	     Low Sidescan:  2367
- 	     High Sidescan: 0
-
- 	Generating inf file for Axial07SS_0003_sslo.mb71
- 	Generating fnv file for Axial07SS_0003_sslo.mb71
-
- 	Total data records read:
- 	     Survey:        4697
- 	     File Header:   4
- 	     Bluefin CTD:   2310
- 	     Bluefin Nav:   1884
- 	     Subbottom:     0
- 	     Low Sidescan:  4695
- 	     High Sidescan: 0
- 	 Total data records written:
- 	      Low Sidescan:  4160
- 	      High Sidescan: 0
-
-.SH SEE ALSO
-\fBmbsystem\fP(1), \fBmbformat\fP(1), \fBmbinfo\fP(1), \fBmb7kpreprocess\fP(1),
-\fBmb7k2jstar\fP(1), \fBmbextractsegy\fP(1), \fBmbbackangle\fP(1), \fBmbprocess\fP(1)
-
-.SH BUGS
-No doubt.
diff --git a/src/man/man1/mb7kpreprocess.1 b/src/man/man1/mb7kpreprocess.1
deleted file mode 100644
index 8b5be97..0000000
--- a/src/man/man1/mb7kpreprocess.1
+++ /dev/null
@@ -1,243 +0,0 @@
-.TH mb7kpreprocess 1 "12 November 2014" "MB-System 5.0" "MB-System 5.0"
-.SH NAME
-\fBmb7kpreprocess\fP \- performs preprocessing of Reson 7k multibeam data
-in the 7k format (\fBMBIO\fP format 88).
-
-.SH VERSION
-Version 5.0
-
-.SH SYNOPSIS
-\fBmb7kpreprocess\fP [\fB\-A\fP \fB\-B\fP \fB\-C\fP\fIrollbias/pitchbias\fP
-\fB\-D\fP\fIoffx/offy[/offdepth]\fP \fB\-F\fP\fIformat\fP
-\fB\-I\fIfile \fB\-K\fP\fIklugemode\fP \fB\-L\fP \fB\-M\fP\fIrockfile\fP \fB\-N\fP\fIinsfile\fP \fB\-O\fP\fIoutfile\fP
-\fB\-P\fP\fIsonardepthfile\fP \fB\-PF\fP\fIfilterlength/filterdepth\fP
-\fB\-T\fP\fItimelag\fP \fB\-W\fP\fIdslfile\fP \fB\-H \-V\fP]
-
-.SH DESCRIPTION
-\fBmb7kpreprocess\fP reads a Reson 7k (format 88) file, interpolates the
-asynchronous navigation and attitude onto the multibeam data,
-and writes a new 7k file with that information correctly embedded
-in the multibeam data. This program can also fix various problems
-with 7k data (early generations of the 6046 datalogger failed to
-to meet the data format specification exactly).
-
-.SH AUTHORSHIP
-David W. Caress (caress at mbari.org)
-.br
-  Monterey Bay Aquarium Research Institute
-.br
-Dale N. Chayes (dale at ldeo.columbia.edu)
-.br
-  Lamont-Doherty Earth Observatory
-
-.SH OPTIONS
-.TP
-.B \-A
-.br
-This option causes the program to output multibeam records occuring before the first
-available navigation and attitude data. Normally, these records are ignored.
-.TP
-.B \-B
-\fImode\fP
-.br
-This option is only relevant to MBARI Mapping AUV data that includes Edgetech sidescan
-and subbottom profiler data with multibeam data in a Reson 7k format file, and where the
-sonars are all synchronized to ping simulataneously. If \fB\-B\fP is specified with
-\fImode\fP=1, then the multibeam time stamps will be reset to the time stamp values of
-the Edgetech data records. If \fB\-B\fP is given with \fImode\fP=2, then the Edgetech
-data time stamps will be reset to the values of the multibeam data records. Although the
-sonar computer clocks are supposed to be synchronized, this clock discipline sometimes fails.
-.TP
-.B \-C
-\fIrollbias/pitchbias\fP
-.br
-This option sets the roll and pitch bias of the sonar with respect to the attitude sensor
-in degrees. If specified, these parameters are applied to the sonar attitude data prior to
-the calculation of bathymetry from travel times and angles.
-.TP
-.B \-D
-\fIoffx/offz[/offdepth]\fP
-.br
-This option sets horizontal and vertical.distance offsets between the vehicle's
-depth sensor and the multibeam receive head. If specified, these values are used
-in a lever-arm calculation to determine the sonar depth change  associated with
-vehicle pitch. The \fIoffdepth\fP value, if specified, is a static depth offset to be
-applied to the vehicle depth data.
-.TP
-.B \-F
-\fIformat\fP
-.br
-Sets the data format used if the input is read from stdin
-or from a file. If \fIformat\fP < 0, then the input file specified
-with the \fB\-I\fP option will actually contain a list of input swath sonar
-data files. This program only reads Reson 7k format data files (\fBMBIO\fP
-format 88).
-.TP
-.B \-H
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-.TP
-.B \-I
-\fIinfile\fP
-.br
-Sets the input file path. If \fIformat\fP > 0 (set with the
-\fB\-f\fP option or \fBmbdefaults\fP) then the swath sonar data contained in \fIinfile\fP
-is read and processed. If \fIformat\fP < 0, then \fIinfile\fP
-is assumed to be an ascii file containing a list of the input swath sonar
-data files to be processed and their formats.  The program will read
-the data in each one of these files.
-In the \fIinfile\fP file, each
-data file should be followed by a data format identifier, e.g.:
- 	datafile1 88
- 	datafile2 88
-.br
-This program only reads Reson 7k format data files (\fBMBIO\fP
-format 88).
-.TP
-.B \-K
-\fIklugemode\fP
-.br
-This option causes the program to implement one of the available
-processing "kluge" fixes. This are unusual steps required to fix
-data with particular, unusual problems. Kluge 1 forces \fBmb7kpreprocess\fP
-to replace the sonar depth value with values from vertical
-depth data records. Kuge 2 forces \fBmb7kpreprocess\fP to zero the initial
-beam alongtrack distance values.
-.TP
-.B \-L
-.br
-This option causes the program to list the timetags of bathymetry,
-sidescan, subbottom, navigation, and attitude data records.
-.TP
-.B \-M
-\fIrockfile\fP
-.br
-The program will read navigation and attitude from the Steve Rock navigation
-and attitude file \fIrockfile\fP and merge those data with the multibeam, sidescan,
-and subbtottom data in the 7k file.If a timelag model is specified using
-\fB\-T\fP\fItimelag\fP, the time lag will be applied to the navigation and
-attitude data before merging with the sonar data. The navigation and attitude
-data from \fIrockfile\fP will also be embedded in asynchronous data records
-in the output 7k format data. Any pre-existing navigation data records will
-be replaced. The similar \fB\-N\fP\fIinsfile\fP and \fB\-W\fP\fIdslfile\fP options
-cause merging of data from MBARI AUV logfiles and WHOI DSL navigation files,
-respectively. The Steve Rock navigation and attitude file is a text file with
-seven space delimited columns:
- 	time_d longitude latitude sonardepth heading roll pitch
-.br
-where time_d is decimal seconds since the start of 1970, longitude, latitude,
-heading, roll, and pitch are in decimal degrees, and sonardepth is in meters.
-.TP
-.B \-N
-\fIinsfile\fP
-.br
-The program will read navigation and attitude from the MBARI AUV navigation
-log file \fIinsfile\fP and merge those data with the multibeam, sidescan,
-and subbtottom data in the 7k file. If a timelag model is specified using
-\fB\-T\fP\fItimelag\fP, the time lag will be applied to the navigation and
-attitude data before merging with the sonar data. The navigation and attitude
-data from \fIinsfile\fP will also be embedded in asynchronous data records
-in the output 7k format data. Any pre-existing navigation data records will
-be replaced. MBARI AUV navigation files are binary and specific to MBARI.
-.TP
-.B \-O
-\fIoutfile\fP
-.br
-This option causes \fBmb7kpreprocess\fP to output all data to a single file
-specified as \fIoutfile\fP. By default, the program creates output files for
-each input file.
-.TP
-.B \-P
-\fIsonardepthfile\fP
-.br
-The program will read sonar depth data from \fIsonardepthfile\fP and merge
-those data with the multibeam, sidescan, and subbtottom data in the 7k file.
-The \fIsonardepthfile\fP is a text data file containing two space delimited columns:
- 	time_d sonardepth
-.br
-where:
- 	time_d \- decimal epoch seconds (since start of 1970)
- 	sonardepth \- sonar depth in meters, positive down
-.TP
-.B \-PF
-\fB\-PF\fP\fIfilterlength/filterdepth\fP
-This option specifies Gaussian tapered time domain filtering of the
-sonar depth data to be merged with the survey data, regardless of source.
-The \fIfilterlength\fP value specifies
-the filter window length in seconds, and the \fIfilterdepth\fP value controls
-the depths to which filtering is applied. The filtered sonar depth is used
-to depths up to twice the \fIfilterdepth\fP value. Below that threshold, the
-value used transitions to unfiltered with an exponential taper. This filtering
-is used in two ways. First, one can apply short period smoothing of noisy
-sonar depth at all by specifying a small \fIfilterlength\fP (e.g. 2 seconds)
-and a \fIfilterdepth\fP value deeper than the vehicle's track. Second, when
-an AUV or ROV is operated at shallow depths, the pressure
-values used to determine depth are affected by waves at the sea surface. In this
-case, a longer period \fIfilterlength\fP (e.g. 10 seconds) and a shallower
-\fIfilterdepth\fP (e.g. 50 meters) may be used to lessen the artifacts due to
-surface swell.
-.TP
-.B \-S
-\fIsidescansource\fP
-.br
-This option specifies the data record type source of the backscatter data
-used to generate pseudo-sidescan data from Reson multibeam sonars. If
-\fIsidescansource\fP = 'C' then the sidescan will be derived from calibrated
-"snippet" records, if the \fIsidescansource\fP = 'S' then the sidescan will be derived from "snippet" records. If \fIsidescansource\fP = 'B' then the sidescan will be derived from "backscatter"
-records. The difference is that the "backscatter" records contain port and
-starboard time series derived from beams formed with a large acrosstrack
-beamwidth, and the "snippet" records contain short sections of beamformed
-time series centered on the bottom return times in each of the valid bathymetry
-beams.
-.TP
-.B \-T
-\fItimelag\fP
-.br
-This option specifies a \fItimelag\fP value in seconds to be applied
-to the navigation and attitude data prior to it being merged with the
-bathymetry. If \fItimelag\fP is a valid path to a file containing time
-stamp and time lag pairs, then these data will be read and the time lag
-applied to particular records will be interpolated by time.
-.TP
-.B \-W
-\fIdslfile\fP
-.br
-The program will read navigation and attitude from the WHOI DSL navigation
-and attitude file \fIdslfile\fP and merge those data with the multibeam, sidescan,
-and subbtottom data in the 7k file.If a timelag model is specified using
-\fB\-T\fP\fItimelag\fP, the time lag will be applied to the navigation and
-attitude data before merging with the sonar data. Any pre-existing navigation data
-records will be replaced. The similar \fB\-N\fP\fIinsfile\fP and \fB\-W\fP\fIdslfile\fP
-options cause merging of data from MBARI AUV logfiles and WHOI DSL navigation files,
-respectively. The WHOI DSL navigation and attitude file is a text file with
-eleven space delimited columns:
- 	PPL date time vehicle latitude longitude depth heading pitch roll id
-.br
-where:
- 	PPL \- tag indicating processed navigation and attitude
- 	date \- yyyy/mm/dd
- 	time \- hh:mm:ss.sss
- 	vehicle \- SEN for Sentry
- 	latitude \- decimal degrees
- 	longitude \- decimal degrees
- 	depth \- sonar depth in meters
- 	pitch \- decimal degrees
- 	roll \- decimal degrees
- 	id \- seems to be 1.00
-
-.SH EXAMPLES
-Suppose that one has collected a Reson 7k datafile incorporating
-multibeam sonar data, sidescan data, and subbottom profiler data, and
-that the filename is:
- 	20050418_150155.s7k
-.br
-
-In order to preprocess the data in a 7k data file, one can use
-\fBmb7kpreprocess\fP with no special arguments:
- 	mb7kpreprocess \-I 20040722_152111.s7k
-
-.SH SEE ALSO
-\fBmbsystem\fP(1), \fBmbformat\fP(1), \fBmbinfo\fP(1)
-
-.SH BUGS
-Oh yeah.
diff --git a/src/man/man1/mbabsorption.1 b/src/man/man1/mbabsorption.1
deleted file mode 100644
index 4008ac0..0000000
--- a/src/man/man1/mbabsorption.1
+++ /dev/null
@@ -1,183 +0,0 @@
-.TH mblevitus 1 "3 June 2013" "MB-System 5.0" "MB-System 5.0"
-.SH NAME
-\fBmbabsorption\fP \- calculates the absorption of sound in sea water in dB/km
-as a function of frequency, temperature, salinity, sound speed, and depth.
-
-
-.SH VERSION
-Version 5.0
-
-.SH SYNOPSIS
-\fBmbabsorption\fP [\fB\-C\fP\fIsoundspeed\fP \fB\-D\fP\fIdepth\fP 
-\fB\-F\fP\fIfrequency\fP \fB\-P\fP\fIph\fP \fB\-S\fP\fIsalinity\fP \fB\-T\fP\fItemperature\fP \fB\-V \-H\fP]
-
-.SH DESCRIPTION
-\fBmbabsorption\fP \- calculates the absorption of sound in sea water in dB/km
- as a function of frequency (kHz), temperature (degrees C), salinity (per mil), 
-depth (m), pH, and water sound speed (m/sec). 
-
- We use the Francois and Garrison equations from:
-    Francois, R.E., Garrison, G.R., "Sound absorption based
-      on ocean measurements: Part I: Pure water and magnesium
-      sulfate contributions", J. Acoust. Soc. Am., 72(3), 
-      896-907, 1982.
-    Francois, R.E., Garrison, G.R., "Sound absorption based
-      on ocean measurements: Part II: Boric acid contribution
-      and equation for total absorption", J. Acoust. Soc. Am., 
-      72(6), 1879-1890, 1982.
-
-Francois and Garrison [1982] model the sound absorption in
-sea water as resulting from contributions from pure water,
-magnesium sulfate, and boric acid. The boric acid contribution
-is significant below 10 kHz. The equations are:
-
- 	absorption = Boric Acid Contribution
- 			+ MbSO4 Contribution
- 			+ Pure Water Contribution
- 	
-.br
-Boric Acid Contribution:
- 	AlphaB = Ab * Pb * Fb * f**2
- 	         \-------------------
- 	            f**2 + Fb**2
- 	    
- 	Ab = 8.86 / c * 10**(0.78 * pH \- 5) (dB/km/kHz)
- 	Pb = 1
- 	Fb = 2.8 * (S / 35)**0.5 * 10**(4 \- 1245 / Tk) (kHz)
- 		
-.br
-MgSO4 Contribution:
- 	AlphaM = Am * Pm * Fm * f**2
- 	         \-------------------
- 	            f**2 + Fm**2
-		
- 	Am = 21.44 * S * (1 + 0.025 * T) / c (dB/km/kHZ)
- 	Pm = 1 \- 0.000137 * D + 0.0000000062 * D**2
- 	Fm = (8.17 * 10**(8 \- 1990 / Tk)) / (1 + 0.0018 * (S \- 35))  (kHz)
- 
-.br
-Pure Water Contribution:
- 	AlphaW = Aw * Pw * f**2
-  
- 	For T <= 20 deg C
- 	  Aw = 0.0004397 \- 0.0000259 * T
- 	          + 0.000000911 * T**2 \- 0.000000015 * T**3 (dB/km/kHz) 
- 	For T > 20 deg C
- 	  Aw = 0.0003964 \- 0.00001146 * T
- 	          + 0.000000145 * T**2 \- 0.00000000049 * T**3 (dB/km/kHz) 
- 	Pw = 1 \- 0.0000383 * D + 0.00000000049 * D**2 
- 
-.br
-Parameters:
- 	f = sound frequency (kHz)
- 	c = speed of sound (m/s)
- 	T = temperature (deg C)
- 	Tk = temperature (deg K) = T + 273 (deg K)
- 	S = salinity (per mil)
- 	D = depth (m)
-
-.br
-If the speed of sound is not specified by the user, it will be
-calculated from temperature, salinity, and depth using:
-.br
- 	c =~ 1412 + 3.21 * T + 1.19 * S + 0.0167 * D
-
-.br
-Normally, \fBmbabsorption\fP simply prints the resulting absorption
-value to stdout. If the \fB\-V\fP option is specified, the output will
-include a listing of the parameters used in calculating the absorption.
- 
-.SH AUTHORSHIP
-David W. Caress (caress at mbari.org)
-.br
-  Monterey Bay Aquarium Research Institute
-.br
-Dale N. Chayes (dale at ldeo.columbia.edu)
-.br
-  Lamont-Doherty Earth Observatory
-
-.SH OPTIONS
-.TP
-.B \-H
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-.TP
-.B \-C
-\fIsoundspeed\fP
-.br
-Specifies the water sound speed in m/sec. If the option is
-not used, the water sound speed will be calculated from the
-temperature, salinity, and depth. 
-.TP
-.B \-D
-\fIdepth\fP
-.br
-Sets the depth in meters at which the sound absorption should be calculated.
-Default: \fIdepth\fP = 0.0 m (i.e. the sea surface).
-.TP
-.B \-F
-\fIfrequency\fP
-.br
-Sets the sound frequency in kHz at which the sound absorption should be calculated.
-Default: \fIfrequency\fP = 200 kHz.
-.TP
-.B \-P
-\fIph\fP
-.br
-Sets the pH value at which the sound absorption should be calculated.
-Default: \fIph\fP = 8.
-.TP
-.B \-S
-\fIsalinity\fP
-.br
-Sets the salinity in per mil at which the sound absorption should be calculated.
-Default: \fIsalinity\fP = 35 per mil.
-.TP
-.B \-T
-\fItemperature\fP
-.br
-Sets the temperature in degrees C at which the sound absorption should be calculated.
-Default: \fItemperature\fP = 10.0 degrees C.
-.TP
-.B \-V
-Normally, \fBmbabsorption\fP outputs only a single absorption value 
-to the stdout stream.  If the
-\fB\-V\fP flag is given, then \fBmbabsorption\fP works in a "verbose" mode and
-also outputs the parameters used to calculate the absorption.
-
-.SH EXAMPLES
-Suppose that one wishes to obtain the water sound absorption for
-a 200 kHz multibeam sonar operating at a depth of 1000 meters (on
-an AUV, for instance) in water with a salinity of 35 per mil, a pH
-of 8, and a temperature of 4 degrees C. The following will suffice:
-.br
- 	mbabsorption \-D1000 \-F200 \-P8 \-S35 \-T4
-.br
-The output will be:
- 37.692561
- 
-.br
-In order to obtain a more readable result, use the \fB\-V\fP option:
-.br
- 	mbabsorption \-D1000 \-F200 \-P8 \-S35 \-T4 \-V
-.br
-The output will be:
-.br
- Program MBabsorption
- Version $Id: mbabsorption.1 2096 2013-06-04 08:17:22Z caress $
- MB-system Version 5.1.1beta15
- 
- Input Parameters:
-      Frequency:        200.000000 kHz
-      Temperature:      4.000000 deg C
-      Salinity:         35.000000 per mil
-      Depth:            1000.000000 m
-      pH:               8.000000
- Result:
-      Sound absorption: 37.692561 dB/km
-
-.SH SEE ALSO
-\fBmbsystem\fP(1)
-
-.SH BUGS
-None known.
diff --git a/src/man/man1/mbareaclean.1 b/src/man/man1/mbareaclean.1
deleted file mode 100644
index 74d497d..0000000
--- a/src/man/man1/mbareaclean.1
+++ /dev/null
@@ -1,289 +0,0 @@
-.TH mbareaclean 1 "29 September 2013" "MB-System 5.0" "MB-System 5.0"
-.SH NAME
-\fBmbareaclean\fP \- Tool to automatically flag bad beams in swath
-sonar bathymetry data within a specified area.
-
-.SH VERSION
-Version 5.0
-
-.SH SYNOPSIS
-\fBmbareaclean\fP  \fB\-R\fP\fIwest/east/south/north\fP  \fB\-S\fP\fIbinsize\fP
-[\fB\-D\fP\fIthreshold\fP \fB\-F\fP\fIformat\fP \fB\-I\fP\fIinfile\fP
-\fB\-B \-G \-H \-M\fP\fIthreshold\fP[\fI/nmin\fP[\fI/nmax\fP]]
-\fB\-N\fP[-]\fImin_beam\fP[\fI/maxbeam\fP] \fB\-T\fP\fItype\fP \-V\fP]
-
-.SH DESCRIPTION
-\fBmbareaclean\fP identifies and flags artifacts in swath sonar
-bathymetry data within a specified area of interest.
-The input data are one swath file or a datalist referencing multiple
-swath files. The user may specify the work area in longitude and latitude
-bounds, along with a bin size in meters. If these are not specified, the
-program will attempt to set useful values. The area is divided into a grid with
-square cells of the specified bin size. As the data are read, each of
-the soundings that fall within one of the bins is stored. Once all of
-data are read, one or more statistical tests are performed on the soundings
-within each bin, providing there are a sufficient number of soundings.
-
-The user may specify one or both of the following actions:
-  1) Previously unflagged soundings that fail a test are
-flagged as bad
-  2) Previously flagged soundings that pass all tests are
-unflagged (the \fB\-G\fP option)..
-
-The edit events are output to edit save files which can be applied
-to the data by the program \fBmbprocess\fP. These are the same edit save
-files created and/or modified by \fBmbclean\fP and \fBmbedit\fP.
-If a sounding's flag status is changed, that flagging action is output
-to the edit save file of the swath file containing that sounding. This
-program will create edit save files if necessary, or append to those that
-already exist.
-
-At present only two algorithms for identifying good and bad beams is
-implemented. The first is a simple median filter controlled by the
-\fB\-M\fP\fIthreshold/nmin[/nmax]\fP option. Soundings that differ from the
-median depth by a value greater than \fIthreshold\fP times the sonar
-altitude will be considered "bad". So, if \fIthreshold\fP = 0.05, then
-any sounding that is 5% greater or less than the median depth will be
-considered bad. The \fInmin\fP parameter sets the minimum number of
-soundings required to use the median filter. The \fInmax\fP parameter
-sets the maximum number of soundings allowed within a cell. If the number
-of initially good beams in a cell exceeds \fInmax\fP, then only the \fInmax\fP
-soundings nearest the median value remain unflagged, and the rest are
-flagged even if they meet the threshold test. The default values are
-\fIthreshold\fP = 0.25, \fInmin\fP = 10, and \fInmax\fP = infinite.
-
-The second algorithm is a simple standard deviation filter controlled by the
-\fB\-D\fP\fIthreshold/nmin\fP option. Soundings that differ from the
-mean depth by a value greater than \fIthreshold\fP times the standard deviation
-of the bin will be considered "bad". So, if \fIthreshold\fP = 2, then
-any sounding that is more than 2 standard deviations greater or less than the mean depth will be
-considered bad. The \fInmin\fP parameter sets the minimum number of
-soundings required to use the filter, The default values are
-\fIthreshold\fP = 2.0 and \fInmin\fP = 10.
-
-Two options allow limiting the soundings that may be flagged.
-\fB\-N\fP[-]\fImin_beam/maxbeam\fP limits flagging to only those beams in
-(or out) of the given range.
-\fB\-T\fP\fItype\fP limits flagging to soundings using the specified bottom
-detection algorithm.
-Many sounders use amplitude detection algorithms for the central beams
-and phase detection algorithms for the outer beams, falling back to
-amplitude detection when phase detection fails.
-Amplitude detections in the outer beams are second rate soundings and
-frequently have a higher range of errors than other soundings.
-Using \fB\-N\fP and \fB\-T\fP together allows stricter cleaning algorithms
-to be applied to these lower quality data. For example to flag bad all
-amplitude detections in the outer thirty beams which are more than one standard deviation
-from the mean: \fB\-N-30 \-T1 \-D1\fP.
-
-.SH AUTHORSHIP
-David W. Caress (caress at mbari.org)
-.br
-  Monterey Bay Aquarium Research Institute
-.br
-Dale N. Chayes (dale at ldeo.columbia.edu)
-.br
-  Lamont-Doherty Earth Observatory
-.br
-
-.SH OPTIONS
-.TP
-.B \-B
-.br
-This option causes \fBmbareaclean\fP to flag as bad any previously unflagged
-soundings that fail one of the specified statistical tests. If neither \fB\-B\fP
-or \fB\-G\fP are specified, then the program will by default use this option.
-.TP
-.B \-D
-\fIthreshold\fP[\fI/nmin\fP]
-.br
-Turns on use of a standard deviation filter test for the soundings.
-Soundings that differ from the
-mean depth by a value greater than \fIthreshold\fP times the standard deviation
-will be considered "bad". So, if \fIthreshold\fP = 2.0, then
-any sounding that is twice the standard deviation from the mean depth will be
-considered bad. The \fInmin\fP parameter sets the minimum number of
-soundings required to use the standard deviation filter. The default values are
-\fIthreshold\fP = 2.0 and \fInmin\fP = 10.
-.TP
-.B \-F
-\fIformat\fP
-.br
-Sets the data format used to read \fIinfile\fP.
-If \fIformat\fP < 0, then the input file specified
-with the \fB\-I\fP option will actually contain a list of input swath sonar
-data files. This program uses the \fBMBIO\fP library
-and will read or write any swath sonar
-format supported by \fBMBIO\fP. A list of the swath sonar data formats
-currently supported by \fBMBIO\fP and their identifier values
-is given in the \fBMBIO\fP manual page. Default: \fIformat\fP = 11.
-.TP
-.B \-G
-This option cause \fBmbarealcean\fP to unflag (set good) any previously flagged
-soundings that pass all of the specified statistical tests. If neither \fB\-B\fP
-or \fB\-G\fP are specified, then the program will by default apply the  \fB\-B\fP
-option.
-.TP
-.B \-H
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-.TP
-.B \-I
-\fIinfile\fP
-.br
-Sets the input filename. If \fIformat\fP > 0 (set with the
-\fB\-F\fP option) then the swath sonar data contained in \fIinfile\fP
-is read and processed. If \fIformat\fP < 0, then \fIinfile\fP
-is assumed to be an ascii file containing a list of the input swath sonar
-data files to be processed and their formats.  The program will read
-and process the data in all of these files. Each input file will
-have an associated output file with either the ".esf" suffix.
-In the \fIinfile\fP file, each
-data file should be followed by a data format identifier, e.g.:
- 	datafile1 11
- 	datafile2 24
-.br
-This program uses the \fBMBIO\fP library and will read or write any swath sonar
-format supported by \fBMBIO\fP. A list of the swath sonar data formats
-currently supported by \fBMBIO\fP and their identifier values
-is given in the \fBMBIO\fP manual page. Default: \fIinfile\fP = "datalist.mb-1".
-.TP
-.B \-M
-\fIthreshold\fP[\fI/nmin\fP]
-.br
-Turns on use of a median filter test for the soundings. If no other test is
-specified, the median filter test is used by default. Soundings that differ from the
-median depth by a value greater than \fIthreshold\fP times the sonar
-altitude will be considered "bad". So, if \fIthreshold\fP = 0.05, then
-any sounding that is 5% greater or less than the median depth will be
-considered bad. The \fInmin\fP parameter sets the minimum number of
-soundings required to use the median filter, The default values are
-\fIthreshold\fP = 0.25 and \fInmin\fP = 10.
-.TP
-.B \-N
-[-]\fImin_beam\fP[\fI/max_beam\fP]
-.br
-Limits the beams to which flagging will be applied.
-Only soundings for beams from \fImin_beam\fP to \fImax_beam\fP, inclusive, will have flags applied.
-If \fImin_beam\fP is preceded by a \fB\-\fP then only beams outside the range will be flagged.
-If \fImax_beam\fP is not given it will be set so that an equal number of beams lay above it as
-lay below \fImin_beam\fP. So for a Simrad EM1002 sounder with 111 beams \fB\-N-30\fP will only flag
-beam numbers 1 to 29 and 82 to 111.
-All good soundings, regardless of beam, will be included in the calculations of median, mean
-and standard deviation for the bin.
-.TP
-.B \-R
-\fIwest/east/south/north\fP
-.br
-Sets the longitude and latitude bounds within which swath sonar
-data will be read, binned, and tested. Soundings lying outside these
-bounds will be ignored.
-.br
-Default: The program will determine and use a square area encompassing
-all of the data contained in the input files.
-.TP
-.B \-S
-\fIbinsize\fP
-.br
-Sets the size of the bins to be used in meters. The area specified
-with the \fB\-R\fP option will be broken into a grid with cells that
-are roughly \fIbinsize\fP meters east-west and north-south.
-.br
-Default: A binsize equal to 0.2 times the maximum sonar altitude
-will be used.
-.TP
-.B \-T
-\fIdetect_type\fP
-.br
-Limits the soundings to which flagging will be applied to only those which
-use the specified bottom detection algorithm.
-\fIdetect_type\fP must be one of:
-      0 \- unknown algorithm
-      1 \- amplitude detection
-      2 \- phase detection
-.TP
-.B \-V
-Normally, \fBmbareaclean\fP works "silently" without outputting
-anything to the stderr stream.  If the
-\fB\-V\fP flag is given, then \fBmbareaclean\fP works in a "verbose" mode and
-outputs the program version being used, all error status messages,
-and the number of beams flagged as bad.
-
-.SH EXAMPLES
-Suppose we are working with a set of 5 Reson 8101 multibeam data files comprising a
-shallow water survey. One of these files has previously been edited with \fBmbedit\fP,
-so an esf file exists and contains a number of pre-existing edits.
-If we know that this survey is contained in the area specified
-by \-R-122.42556/-122.41974/47.67111/47.67529, then we can invoke \fBmbareaclean\fP
-using:
- 	mbareaclean \-Idatalist.mb-1 \\
-  		-B \-M0.1/10 \-S2.5 \\
- 		-R-122.42556/-122.41974/47.67111/47.67529  \\
- 		-V
-.br
-where the bin size is 2.5 meters, the median filter threshold is 0.1 (or 10%)
-of the sonar altitude, and the minimum number of sounding required for
-filtering is 10. The results look like:
-
- Program MBAREACLEAN
- Version $Id: mbareaclean.1 2155 2013-10-13 20:55:57Z caress $
- MB-system Version 5.0.beta29
- Area of interest:
-      Minimum Longitude: \-122.425560 Maximum Longitude: \-122.419740
-      Minimum Latitude:  47.671110 Maximum Latitude:  47.675290
-      Bin Size:   2.500000
-      Dimensions: 175 186
- Cleaning algorithms:
-      Median filter: ON
-      Plane fit:     OFF
- Output:
-      Flag unflagged soundings identified as bad:  ON
-      Unflag flagged soundings identified as good: OFF
-
- Processing 001_1730.fbt
- Sorting 41580 old edits...
- 10000 of 41580 old edits sorted...
- 20000 of 41580 old edits sorted...
- 30000 of 41580 old edits sorted...
- 40000 of 41580 old edits sorted...
- pings:1169  beams:   20233 good   41686 flagged   56150 null
-
- Processing 003_1733.fbt
- pings: 991  beams:   52439 good     159 flagged   47493 null
-
- Processing 005_1736.fbt
- pings:1011  beams:   53080 good     588 flagged   48443 null
-
- Processing 007_1739.fbt
- pings: 922  beams:   48854 good     212 flagged   44056 null
-
- Processing 009_1741.fbt
- pings:1017  beams:   53416 good     586 flagged   48715 null
-
- MBareaclean Processing Totals:
- \-------------------------
- 5 total swath data files processed
- 5110 total pings processed
- 271253 total soundings processed
- \-------------------------
-   0 soundings:  61919 flagged:      0 unflagged:      0  file:001_1730
-   1 soundings:  52598 flagged:      0 unflagged:      0  file:003_1733
-   2 soundings:  53668 flagged:      0 unflagged:      0  file:005_1736
-   3 soundings:  49066 flagged:      0 unflagged:      0  file:007_1739
-   4 soundings:  54002 flagged:      0 unflagged:      0  file:009_1741
-
-
-.SH SEE ALSO
-\fBmbsystem\fP(1), \fBmbclean\fP(1), \fBmbedit\fP(1),
-\fBmbinfo\fP(1) \fBmbprocess\fP(1),
-
-.SH BUGS
-The algorithms implemented in \fBmbareaclean\fP simply
-don't detect all bathymetric artifacts that
-are obvious to the eye on contour charts.  Although
-the autofiltering tools \fBmbareaclean\fP and \fBmbclean\fP
-often do a credible first pass at
-flagging obvious artifacts, we strongly recommend that
-any swath bathymetry processing stream include
-interactive editing of the
-bathymetry data (e.g. \fBmbedit\fP).
diff --git a/src/man/man1/mbauvloglist.1 b/src/man/man1/mbauvloglist.1
deleted file mode 100644
index 89f9971..0000000
--- a/src/man/man1/mbauvloglist.1
+++ /dev/null
@@ -1,394 +0,0 @@
-.TH mbauvloglist 1 "18 February 2015" "MB-System 5.0" "MB-System 5.0"
-.SH NAME
-\fBmbauvloglist\fP \- Lists table data from an MBARI AUV mission log file.
-
-.SH VERSION
-Version 5.0
-
-.SH SYNOPSIS
-\fBmbauvloglist\fP \fB\-I\fP\fIfile\fP [\fB\-F\fP\fIprintformat\fP \fB\-L\fP\fIlonflip\fP
-\fB\-M\fP\fImode\fP \fB\-N\fP\fInavfile\fP \fB\-O\fP\fIlist\fP \fB\-P \-S\fP \fB\-V \-H\fP ]
-
-.SH DESCRIPTION
-MBauvloglist reads an MBARI AUV mission log file and lists specified
-fields in tab-delimited text output. MBARI AUV mission logs  are binary
-files with an ascii header describing the units, name, and binary size
-of each value in a single record. An example of a log file header is:
-
-# binary fastcatlog
-.br
-# timeTag time %8.8e ,time ,UNKNOWN
-.br
-# double conductivity %8.8e ,Calculated conductivity ,Siemens/meter
-.br
-# double temperature %8.8e ,Calculated temperature ,Celsius
-.br
-# double pressure %8.8e ,Calculated pressure ,Decibars
-.br
-# double calculated_salinity %8.8e ,Calculated salinity ,Volts
-.br
-# double cond_frequency %8.8e ,Raw Conductivity frequency ,Hertz
-.br
-# double temp_counts %8.8e ,Raw Pressure A/D counts ,Unitless
-.br
-# double pressure_counts %8.8e ,pressure_counts ,Unitless
-.br
-# double pressure_temp_comp_voltage_reading %8.8e ,Raw pressure temp compensation voltage reading ,Volts
-.br
-# double calculated_sound_velocity %8.8e ,Calculated sound velocity ,M/s
-.br
-# begin
-
-Users can extract arbitrary text lists of values in the AUV log files by using the \fB\-O\fP
-option repeatedly to specify fields by name (e.g. calculated_sound_velocity)
-in the order desired. The print formatting statements (e.g. %8.8e) included in the log
-header is used by default. However, users can use the \fB\-F\fP option to specify
-optional formatting for fields specified in following \fB\-O\fP commands.
-
-To find out the values contained in any particular log file, use the \fB\-P\fP option alone
-to print out a list of the contents. Then run \fBmbauvloglist\fP again using the \fB\-O\fP option
-to specify each of the desired values in the desired order of columns. The \fB\-F\fP option
-can be used to set the printing format. Otherwise, the default format specified in the
-log header will be used.
-
-The \fB-M\fP\fImode\fP option sets the output mode. By default, the output will be ASCII
-text with tab characters between fields, which is equivalent to \fB-M\fP\fI0\fP. If
-f\Imode\fP = 1, then the output will be ASCII text with comma delimiters. If \fImode\fP = 1,
-then the output will binary values (8-btye double or 4-byte int values) with nothing between
-the desired fields.
-
-For log files that do not include navigation, an external navigation file in the "fnv"
-format may be specified using the \fB-N\fP option. 
-
-As of August 2009, the contents of the MBARI Mapping AUV missions logs are:
-
-DropWeight.log Contents:
- timeTag time %8.8e ,time ,UNKNOWN
- short WDTimer %d ,Count Down Timer ,Seconds
- short BWTimer %d ,Burn Wire Timer ,Seconds
- short WDClear %d ,Watch Dog Clear ,Unitless
- short AcommsDN %d ,Acoustic Comms Drop Now ,Unitless
- short WDStatus %d ,Watch Dog Status ,Unknown
- short DWout %d ,Drop Weight Active ,Unitless
- short GulperProxIn %d ,Gulper Proximity Sensor ,Unitless
-
-adam6017.log Contents:
- timeTag time %8.8e ,time ,UNKNOWN
- double chan0 %8.8e ,chan0 ,UNKNOWN
- double chan1 %8.8e ,chan1 ,UNKNOWN
- double chan2 %8.8e ,chan2 ,UNKNOWN
- double chan3 %8.8e ,chan3 ,UNKNOWN
- double chan4 %8.8e ,chan4 ,UNKNOWN
- double chan5 %8.8e ,chan5 ,UNKNOWN
- double chan6 %8.8e ,chan6 ,UNKNOWN
- double chan7 %8.8e ,chan7 ,UNKNOWN
-
-ats.log Contents:
- timeTag time %8.8e ,time ,UNKNOWN
- double AtsDelta %8.8e ,Last ms drift bt Reson and Auv clocks: drift = delta0 \- (tReson-tAuv) ,seconds
- double AtsDrift %8.8e ,AtsDrift ,seconds
-
-dvl.log Contents:
- timeTag time %8.8e ,time ,UNKNOWN
- double dvlBotVelx %8.8e ,dvlBotVelx ,UNKNOWN
- double dvlBotVely %8.8e ,dvlBotVely ,UNKNOWN
- double dvlBotVelz %8.8e ,dvlBotVelz ,UNKNOWN
- double dvlBotVele %8.8e ,dvlBotVele ,UNKNOWN
- short dvlBotVelStat %d ,dvlBotVelStat ,UNKNOWN
- double dvlWatVelx %8.8e ,dvlWatVelx ,UNKNOWN
- double dvlWatVely %8.8e ,dvlWatVely ,UNKNOWN
- double dvlWatVelz %8.8e ,dvlWatVelz ,UNKNOWN
- double dvlWatVele %8.8e ,dvlWatVele ,UNKNOWN
- short dvlWatVelStat %d ,dvlWatVelStat ,UNKNOWN
- double dvlTemp %8.8e ,dvlTemp ,UNKNOWN
- double dvlPitch %8.8e ,dvlPitch ,UNKNOWN
- double dvlRoll %8.8e ,dvlRoll ,UNKNOWN
- double dvlHeading %8.8e ,dvlHeading ,UNKNOWN
- double dvlBeam1 %4.6f ,dvlBeam1 ,UNKNOWN
- double dvlBeam2 %4.6f ,dvlBeam2 ,UNKNOWN
- double dvlBeam3 %4.6f ,dvlBeam3 ,UNKNOWN
- double dvlBeam4 %8.8e ,dvlBeam4 ,UNKNOWN
- double dvlRange %8.8e ,dvlRange ,UNKNOWN
- double dvlToping %20.4f ,dvlToping ,UNKNOWN
- double dvlSpdSnd %12.4f ,dvlSpdSnd ,UNKNOWN
-
-dynamicControl.log Contents:
- timeTag time %8.8e ,time ,UNKNOWN
- double myTime %.2f ,myTime ,UNKNOWN
- double xTrackError %8.8e ,xTrackError ,UNKNOWN
- double cPsi %8.8e ,cPsi ,UNKNOWN
- double cDeltaR %8.8e ,cDeltaR ,UNKNOWN
- double tPsi %8.8e ,tPsi ,UNKNOWN
- double psiProp %8.8e ,psiProp ,UNKNOWN
- double psiInt %8.8e ,psiInt ,UNKNOWN
- double psiRate %8.8e ,psiRate ,UNKNOWN
- double xteIntegral %8.8e ,xteIntegral ,UNKNOWN
- double kxte %8.8e ,kxte ,UNKNOWN
- double dPsi %8.8e ,dPsi ,UNKNOWN
- double speedCmd %8.8e ,speedCmd ,UNKNOWN
- double omegaCmd %8.8e ,omegaCmd ,UNKNOWN
- double cDepth %8.8e ,cDepth ,UNKNOWN
- double tDepth %8.8e ,tDepth ,UNKNOWN
- double DepthError %8.8e ,DepthError ,UNKNOWN
- double dIntegral %8.8e ,dIntegral ,UNKNOWN
- double mDepthRateTerm %8.8e ,mDepthRateTerm ,UNKNOWN
- double cTheta %8.8e ,cTheta ,UNKNOWN
- double pitchProp %8.8e ,pitchProp ,UNKNOWN
- double pitchInt %8.8e ,pitchInt ,UNKNOWN
- double pitchRate %8.8e ,pitchRate ,UNKNOWN
- double pitchIntInp %8.8e ,pitchIntInp ,UNKNOWN
- double cDeltaEBL %8.8e ,cDeltaEBL ,UNKNOWN
- double cDeltaE %8.8e ,cDeltaE ,UNKNOWN
- double targetNorthing %13.2f ,targetNorthing ,UNKNOWN
- double targetEasting %13.2f ,targetEasting ,UNKNOWN
- double newBearing %8.8e ,newBearing ,UNKNOWN
- double newNorthing %13.2f ,newNorthing ,UNKNOWN
- double newEasting %13.2f ,newEasting ,UNKNOWN
- short first %d ,first ,UNKNOWN
-
-fastcatlog.log Contents:
- timeTag time %8.8e ,time ,UNKNOWN
- double conductivity %8.8e ,Calculated conductivity ,Siemens/meter
- double temperature %8.8e ,Calculated temperature ,Celsius
- double pressure %8.8e ,Calculated pressure ,Decibars
- double calculated_salinity %8.8e ,Calculated salinity ,Volts
- double cond_frequency %8.8e ,Raw Conductivity frequency ,Hertz
- double temp_counts %8.8e ,Raw Pressure A/D counts ,Unitless
- double pressure_counts %8.8e ,pressure_counts ,Unitless
- double pressure_temp_comp_voltage_reading %8.8e ,Raw pressure temp compensation voltage reading ,Volts
- double calculated_sound_velocity %8.8e ,Calculated sound velocity ,M/s
-
-gps.log Contents:
- timeTag time %8.8e ,time ,UNKNOWN
- integer hours %d ,Hours ,Hours
- integer minutes %d ,Minutes ,Minutes
- integer seconds %d ,Seconds ,Seconds
- integer centiSeconds %d ,CentiSeconds ,CentiSeconds
- angle latitude %8.8e ,Vehicle latitude ,Degrees
- angle longitude %8.8e ,Vehicle longitude ,Degrees
- short quality %d ,GPS quality code ,Unitless
- short numberOfSatellites %d ,Number of satellites visible ,Unitless
- double hdop %8.8e ,Horizontal dilution of precision ,Unitless
- double antennaHeight %8.8e ,Altitude of GPS antenna above mean sea level ,meters
- double geoHeight %8.8e ,Geoidal separation ,meters
- short dgpsDataAge %d ,Age of differential GPS correction ,seconds
- short dgpsRSID %d ,Differential reference station ID ,Unitless
-
-kearfott.log Contents:
- timeTag time %8.8e ,time ,UNKNOWN
- integer mCyclesK %d ,mCyclesK ,UNKNOWN
- integer mModeK %d ,mModeK ,UNKNOWN
- integer mMonK %d ,mMonK ,UNKNOWN
- double mLatK %3.8f ,mLatK ,UNKNOWN
- double mLonK %3.8f ,mLonK ,UNKNOWN
- double mNorthK %13.2f ,mNorthK ,UNKNOWN
- double mEastK %13.2f ,mEastK ,UNKNOWN
- double mDepthK %8.8e ,mDepthK ,UNKNOWN
- double mRollK %8.8e ,mRollK ,UNKNOWN
- double mPitchK %8.8e ,mPitchK ,UNKNOWN
- double mHeadK %8.8e ,mHeadK ,UNKNOWN
- double mVbodyxK %8.8e ,mVbodyxK ,UNKNOWN
- double mVbodyyK %8.8e ,mVbodyyK ,UNKNOWN
- double mVbodyzK %8.8e ,mVbodyzK ,UNKNOWN
- double mAccelxK %8.8e ,mAccelxK ,UNKNOWN
- double mAccelyK %8.8e ,mAccelyK ,UNKNOWN
- double mAccelzK %8.8e ,mAccelzK ,UNKNOWN
- double mPrateK %8.8e ,mPrateK ,UNKNOWN
- double mQrateK %8.8e ,mQrateK ,UNKNOWN
- double mRrateK %8.8e ,mRrateK ,UNKNOWN
- double utcTime %8.8e ,utcTime ,UNKNOWN
-
-m3dmgx1.log Contents:
- timeTag time %8.8e ,time ,UNKNOWN
- angle mRollCB %8.8e ,Roll ,Degrees
- angle mOmega_xCB %8.8e ,Roll rate ,Degrees/second
- angle mPitchCB %8.8e ,Pitch ,Degrees
- angle mOmega_yCB %8.8e ,Pitch rate ,Degrees/second
- angle mYawCB %8.8e ,Yaw ,Degrees
- angle mOmega_zCB %8.8e ,Yaw rate ,Degrees/second
- double mAccel_xCB %8.8e ,Acceleration along vehicle x-axis ,G
- double mAccel_yCB %8.8e ,Acceleration along vehicle y-axis ,G
- double mAccel_zCB %8.8e ,Acceleration along vehicle z-axis ,G
- double mMag_xCB %8.8e ,Magnetic field along vehicle x-axis ,Gauss
- double mMag_yCB %8.8e ,Magnetic field along vehicle y-axis ,Gauss
- double mMag_zCB %8.8e ,Magnetic field along vehicle z-axis ,Gauss
- double mTempCB %8.8e ,Crossbow internal temperature ,Celsius
-
-navigation.log Contents:
- timeTag time %8.8e ,time ,UNKNOWN
- double mPos_x %13.2f ,Vehicle Northing (WGS 84 Zone 10S) ,Meters
- double mPos_y %13.2f ,Vehicle Easting (WGS 84 Zone 10S) ,Meters
- double mDepth %8.8e ,Vehicle Depth ,Meters
- double mGpsNorth %13.2f ,Northing (WGS 84 Zone 10S) based upon GPS fix ,Meters
- double mGpsEast %13.2f ,Easting (WGS 84 Zone 10S) based upon GPS fix ,Meters
- integer mGpsValid %d ,GPS fix Status code ,Unitless
- double mPhi %8.8e ,Vehicle roll ,Degrees
- double mTheta %8.8e ,Vehicle pitch ,Degrees
- double mPsi %8.8e ,Vehicle yaw ,Degrees
- double mOmega_x %8.8e ,Vehicle roll rate ,Degrees/second
- double mOmega_y %8.8e ,Vehicle pitch rate ,Degrees/second
- double mOmega_z %8.8e ,Vehicle yaw rate ,Degrees/second
- double mPsaRange %8.8e ,Altimeter range ,Meters
- double mAltitude %8.8e ,Vehicle altitude above bottom ,Meters
- double mDvlAltitude %8.8e ,mDvlAltitude ,UNKNOWN
- double mWaterSpeed %8.8e ,Current speed based upon DVL data ,Meters/second
- integer mDvlValid %d ,Dvl valid flag in Navigation ,UNKNOWN
- integer mDvlNewData %d ,Navigation thinks the Dvl has new data ,UNKNOWN
- double mDeltaT %8.8e ,Time between Dvl updates ,Seconds
- double nfix %13.2f ,Northing (WGS 84 Zone 10S) based upon baseline fix ,Meters
- double efix %13.2f ,Easting (WGS 84 Zone 10S) based upon baseline fix ,Meters
- double filter_north %13.2f ,Kalman filter northing (WGS 84 Zone 10S) ,Meters
- double filter_east %13.2f ,Kalman filter easting (WGS 84 Zone 10S) ,Meters
- double filter_depth %8.8e ,Kalman filter depth ,Meters
- double north_current %8.8e ,Northward flowing current estimate ,Meters/second
- double east_current %8.8e ,Eastward flowing current estimate ,Meters/second
- double speed_bias %8.8e ,Speed bias based upon long baseline fixes ,Meters/second
- double heading_bias %8.8e ,Heading bias based upon long baseline fixes ,Degrees
- double latitude %5.8f ,latitude ,UNKNOWN
- double longitude %5.8f ,longitude ,UNKNOWN
-
-parosci.log Contents:
- timeTag time %8.8e ,time ,UNKNOWN
- double depth %8.3lf ,Depth ,Meters
- double temp %8.8e ,Pressure Sensor Internal Temp ,Celsius
- double pressure %8.8lf ,Pressure ,Bars
- double temp_period %8.8lf ,Temperature Period ,Microseconds
- double pres_period %8.8lf ,Pressure Period ,Microseconds
-
-tailCone.log Contents:
- timeTag time %8.8e ,time ,UNKNOWN
- integer status %d ,status ,UNKNOWN
- integer elevatorCurrent %d ,elevatorCurrent ,UNKNOWN
- integer rudderCurrent %d ,rudderCurrent ,UNKNOWN
- float propCurrent1 %f ,propCurrent1 ,UNKNOWN
- integer propCurrent2 %d ,propCurrent2 ,UNKNOWN
- integer propRpm %d ,propRpm ,UNKNOWN
- float elevatorAngle %f ,elevatorAngle ,UNKNOWN
- float rudderAngle %f ,rudderAngle ,UNKNOWN
- integer propPwm %d ,propPwm ,UNKNOWN
- integer propTemp %d ,propTemp ,UNKNOWN
-
-.SH AUTHORSHIP
-David W. Caress (caress at mbari.org)
-.br
-  Monterey Bay Aquarium Research Institute
-.br
-Dale N. Chayes (dale at ldeo.columbia.edu)
-.br
-  Lamont-Doherty Earth Observatory
-
-.SH OPTIONS
-.TP
-.B \-H
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-.TP
-.B \-F
-\fIprintformat\fP
-.br
-Sets the printing format (in fprintf() style) of the next value specified using
-the \fB\-O\fP option. By default, \fBmbauvloglist\fP uses the print format specified
-in the log file header. If the \fB-F\fP option has been used, using it again with
-\fIprintformat\fP equal to "default" will reset the print format to that specified
-in the log file header.
-.TP
-.B \-I
-\fIifile\fP
-.br
-Sets the input MBARI AUV mission log  filename.
-.TP
-.B \-L
-\fIlonflip\fP
-.br
-Sets the range of the longitude values output.
-If \fIlonflip\fP=\-1 then the longitude values will be in
-the range from \-360 to 0 degrees. If \fIlonflip\fP=0
-then the longitude values will be in
-the range from \-180 to 180 degrees. If \fIlonflip\fP=1
-then the longitude values will be in
-the range from 0 to 360 degrees.
-Default: \fBmbauvloglist\fP uses the user default \fIlonflip\fP set using
-\fBmbdefaults\fP.
-.TP
-.B \-M
-\fImode\fP
-.br
-Specifies the output mode. If \fImode\fP = 0, then the output is
-ASCII text with tab delimiters between fields. If \fImode\fP = 1,
-then the output is ASCII text with comma delimiters between fields.
-If \fImode\fP = 2, then the output is binary with no values or breaks
-between fields. Default: ASCII text with tab delimiters.
-.TP
-.B \-N
-\fInavfile\fP
-.br
-Specifies a navigation file in the "fnv" format that contains position,
-heading, sensor depth, and attitude data. Values merged (interpolated)
-from these data can be specified for output using the
-     mergeLon
-     mergeLat
-     mergeHeading
-     mergeSpeed
-     mergeDraft
-     mergeSensordepth
-     mergeRoll
-     mergePitch
-     mergeHeave
-.br
-valuenames in the \fB-O\fP option.
-.TP
-.B \-O
-\fIvaluename\fP
-.br
-Causes \fBmbauvloglist\fP to output the specified value. This option can be
-given multiple times, and the values will be output in the order specified.
-The valid valuename strings consist of those defined in the header of the
-log file being parsed, plus the following:
-     zero
-     timeTag
-     mergeLon
-     mergeLat
-     mergeHeading
-     mergeSpeed
-     mergeDraft
-     mergeSensordepth
-     mergeRoll
-     mergePitch
-     mergeHeave
-.br
-All of the special values are double values. Those beginning with "merge"
-derive from interpolation of data from an external navigation file
-specified using the \fB-N\fP option.
-.TP
-.B \-P
-.br
-Prints out the log file header.
-.TP
-.B \-S
-.br
-Scales angular values to be in degrees instead of radians.
-.TP
-.B \-V
-The \fB\-V\fP option causes the program to be verbose.
-.SH EXAMPLE
-To extract a list of pressure and water sound speed from the CTD log of an
-AUV mission, use:
- 	mbauvloglist \-I mvc_logs/2006.224.00/fastcatlog.log \\
- 		-F%f \-O pressure \-O calculated_sound_velocity
-.br
-This simple list is ordered as the data were collected, following the ups
-and downs of the AUV mission. In order to construct a model of the water
-sound speed as a function of depth, one can sort the output of \fBmbauvloglist\fP
-(using the program \fBsort\fP) to be ordered with increasing pressure (depth),
-and then resampled into uniform increments of pressure using the \fBGMT\fP
-program \fBsample1d\fP.
- 	mbauvloglist \-I mvc_logs/2006.224.00/fastcatlog.log \\
- 		-F%f \-O pressure \-O calculated_sound_velocity \\
- 		| sort \-n \-u > auv_ssv.txt
- 	sample1d auv_ssv.txt \-Fl \-H1 \-S0.0 \-I10.0 > auv_ssv_bin.txt
-
-.SH SEE ALSO
-\fBmbsystem\fP(1), \fBsample1d\fP, \fBsort\fP.
-
-.SH BUGS
-Indubitably.
diff --git a/src/man/man1/mbauvnavusbl.1 b/src/man/man1/mbauvnavusbl.1
deleted file mode 100644
index a372247..0000000
--- a/src/man/man1/mbauvnavusbl.1
+++ /dev/null
@@ -1,78 +0,0 @@
-.TH mbauvnavusbl 1 "3 June 2013" "MB-System 5.0" "MB-System 5.0"
-.SH NAME
-\fBmbauvnavusbl\fP \- Adjusts inertial navigation of a submerged platform/vehicle
-to be consistent with more accurate but less precise surface tracking (USBL) navigation. 
-
-.SH VERSION
-Version 5.0
-
-.SH SYNOPSIS
-\fBmbauvnavusbl\fP \fB\-I\fP\fIinavfile\fP [\fB\-L\fP
-\fB\-O\fP\fIonavfile\fP  \fB\-U\fP\fIusblfile\fP\fB\-V \-H\fP ]
-
-.SH DESCRIPTION
-MBauvnavusbl reads a primary navigation file (usually from a submerged platform
-swath survey) and also reads secondary navigation (e.g. USBL fixes). 
-The program calculates position offsets between the raw survey navigation
-and the secondary navigation every 3600 seconds (10 minutes), and then 
-linearly interpolates and applies this adjustment vector for each 
-primary navigation position. 
-
-The inertial navigation is read in format 166 and the USBL navigation is 
-read from format 165 files. The adjusted navigation is output in format 166.
-
-.SH AUTHORSHIP
-David W. Caress (caress at mbari.org)
-.br
-  Monterey Bay Aquarium Research Institute
-.br
-Dale N. Chayes (dale at ldeo.columbia.edu)
-.br
-  Lamont-Doherty Earth Observatory
-
-.SH OPTIONS
-.TP
-.B \-H
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-.TP
-.B \-I
-\fIinavfile\fP
-.br
-Sets the input navigation filename. The navigation data must be
-in format 166.
-.B \-L
-\fIlonflip\fP
-.br
-Sets the range of the longitude values used.
-If \fIlonflip\fP=\-1 then the longitude values will be in
-the range from \-360 to 0 degrees. If \fIlonflip\fP=0 
-then the longitude values will be in
-the range from \-180 to 180 degrees. If \fIlonflip\fP=1 
-then the longitude values will be in
-the range from 0 to 360 degrees.
-Default: \fBmbauvnavusbl\fP uses the user default \fIlonflip\fP set using
-\fBmbdefaults\fP.
-.TP
-.B \-O
-\fIonavfile\fP
-.br
-Sets the output navigation filename. The navigation data will be
-in format 166.
-.TP
-.B \-U
-\fIusblfile\fP
-.br
-Sets the input usbl navigation filename. The usbl navigation data must be
-in format 165.
-.TP
-.B \-V
-The \fB\-V\fP option causes the program to be verbose.
-.SH EXAMPLE
-Coming...
-
-.SH SEE ALSO
-\fBmbsystem\fP(1)
-
-.SH BUGS
-Da.
diff --git a/src/man/man1/mbbackangle.1 b/src/man/man1/mbbackangle.1
deleted file mode 100644
index f5334b2..0000000
--- a/src/man/man1/mbbackangle.1
+++ /dev/null
@@ -1,387 +0,0 @@
-.TH mbbackangle 1 "3 June 2013" "MB-System 5.0" "MB-System 5.0"
-.SH NAME
-\fBmbbackangle\fP \- Generates tables of the average amplitude or
-sidescan values in swath sonar data as a function of
-the grazing angle with the seafloor.
-
-.SH VERSION
-Version 5.0
-
-.SH SYNOPSIS
-\fBmbbackangle\fP [\fB\-A\fIkind\fP
-\fB\-C\fP \fB\-D\fP \fB\-F\fIformat\fP
-\fB\-G\fIkind/angle/max/nx/ny\fP
-\fB\-I\fIfile\fP
-\fB\-N\fInangle/anglemax\fP \fB\-P\fIpings\fP \fB\-Q\fP
-\fB\-R\fIrefangle\fP \fB\-T\fItopogridfile\fP \fB\-Z\fIaltitude\fP \fB\-V \-H\fP]
-
-.SH DESCRIPTION
-The program \fBmbbackangle\fP reads a swath sonar data file
-containing beam amplitude and/or sidescan data and generates tables
-of the average amplitude and/or sidescan values as a function of
-the grazing angle with the seafloor. These tables can be used
-by the program \fBmbprocess\fP to correct the sidescan or
-amplitude data for the variation with grazing angle. No assumption
-is made about the nature of the data or the sonar used to
-collect it.
-
-The user specifies the angular width
-of the swath considered and the number of angular bins in that
-swath; the average amplitude or sidescan value within each bin
-form the output data. By default, the grazing angle is calculated simply using the
-acrosstrack distance and depth at the beam or pixel location.
-If bathymetry is not available, the seafloor is assumed to be flat
-with a sonar altitude specified by the \fB\-Z\fP option.
-If the \fB\-Q\fP option is used, then the acrosstrack bottom slope
-at the beam or pixel location is factored into the grazing angle
-values. For bins outside the nadir region (angles > 15.0 degrees
-from vertical), the averaging extends over the neighboring bins (three bins
-averaged for each value). The user also specifies the number of pings
-to be read to generate each table; the default is 50 pings.
-
-The results are written to a file named by
-adding a ".sga" suffix to the swath filename for sidescan and
-".aga" for amplitude. These files contain a series of amplitude vs.
-grazing angle tables, each time tagged according to the average time
-of the pings used to generate that table. The swath file's
-\fBmbprocess\fP parameter file is also modified (or created if necessary)
-so that sidescan or amplitude correction is enabled.
-
-The correction tables are read and interpolated according to ping time
-by \fBmbprocess\fP. The correction value for each amplitude or sidescan
-sample is also interpolated using the samples apparent grazing angle.
-The grazing angle is calculated using a flat bottom assumption
-by default but, if the \fB\-Q\fP option is used, will instead be
-calculated using the acrosstrack slope in the bathymetry (if available) .
-If the \fB\-T\fP option is used to specify a topography grid of the area
-of interest, then the grazing angle is calculated using that grid rather
-than any bathymetry data within the file being processed.
-
-If the values are in dB, and therefore log scaled, then the corrections
-are subtracted from the raw values and then the value of the correction
-table at the reference angle (specified with the \fB\-R\fP option) is
-added back in. In the case of linear data, the correction operation is
-to divide by the correction value and then multiply by the reference
-value. At present, only SeaBeam 2100 sidescan values are linear; all
-other amplitude and sidescan data supported by \fBMB-System\fP are
-in dB.
-
-If the \fB\-G\fP option is used, then \fBmbbackangle\fP also generates
-gridded histograms of the amplitude versus grazing angle values for
-each swath data file processed. The user specifies the bounds and dimensions
-of the grids; the \fB\-G\fP option must be given twice to produce grids
-of both amplitude and sidescan histograms. In addition to outputting the
-grids, \fBmbbackangle\fP uses \fBmbm_grdplot\fP to generate \fBGMT\fP
-shellscripts that, when executed, will generate plots of the gridded
-histograms overlain with the amplitude versus grazing angle tables in
-the ".aga" and ".sga" files.
-
-.SH AUTHORSHIP
-David W. Caress (caress at mbari.org)
-.br
-  Monterey Bay Aquarium Research Institute
-.br
-Dale N. Chayes (dale at ldeo.columbia.edu)
-.br
-  Lamont-Doherty Earth Observatory
-
-.SH OPTIONS
-.TP
-.B \-A
-\fIkind\fP
-.br
-Determines if beam amplitude (\fIkind\fP = 1)
-and/or sidescan (\fIkind\fP = 2) data will be processed.
-Default: both amplitude and sidescan data are processed.
-.TP
-.B \-C
-Normally, \fBmbbackangle\fP produces a table of amplitude vs
-grazing angle values which is asymmetric about the vertical
-(zero angle) axis. If \fB\-C\fP is specified, the amplitude
-vs grazing angle function will be forced to be symmetric.
-Generally, it is better to not use this option in \fBmbbackangle\fP,
-and to instead use \fBmbset\fP to set symmetric or asymmetric
-sidescan correction in the \fBmbprocess\fP parameter file.
-.TP
-.B \-D
-This option causes \fBmbbackangle\fP to dump the output to
-stdout rather than to ".sga" or ".aga" files..
-.TP
-.B \-F
-\fIformat\fP
-.br
-Sets the \fBMBIO\fP integer format identifier
-for the input file specified with the
-\fB\-I\fP option. By default, \fBmbbackangle\fP
-infers the format from the "*.mbXX" \fBMB-System\fP suffix
-convention.
-.TP
-.B \-G
-\fIkind/angle/max/nx/ny\fP
-.br
-This option causes \fBmbbackangle\fP to output gridded histograms
-of the amplitude versus grazing angle data for each swath file
-processed. The program also generates a shellscript to produce a
-first-cut \fBGMT\fP postscript plot of the histogram overlain by
-the amplitude versus grazing angle tables used by \fBmbprocess\fP.
-The \fIkind\fP parameter indicates whether an amplitude (\fIkind\fP = 1)
-or sidescan (\fIkind\fP = 2) histogram is desired; the \fB\-G\fP command
-must be given twice (once with \fIkind\fP = 1 and once with \fIkind\fP = 2)
-to generate both amplitude and sidescan histograms. The histogram grid
-consists of \fInx\fP bins extending from \-\fIangle\fP to +\fIangle\fP degrees in the
-x-dimension, and \fIny\fP bins extending from 0.0 to \fImax\fP in the
-y-dimension. The values of the histogram are normalized so that they sum
-to 1000.0 within each angle bin.
-.TP
-.B \-H
-This "help" flag causes the program to print out a description
-of its operation and then exit immediately.
-.TP
-.B \-I
-\fIfilename\fP
-.br
-Sets the input filename. If \fIformat\fP > 0 (set with the
-\fB\-F\fP option) then the swath sonar data contained in \fIinfile\fP
-is read and processed. If \fIformat\fP < 0, then \fIinfile\fP
-is assumed to be an ascii file containing a list of the input swath sonar
-data files to be processed and their formats.  The program will read
-and process the data in each one of these files. Each input file will
-have an associated output file with either the ".sga" or ".aga" suffix.
-In the \fIinfile\fP file, each
-data file should be followed by a data format identifier, e.g.:
- 	datafile1 11
- 	datafile2 24
-.br
-This program uses the \fBMBIO\fP library and will read any swath sonar
-format supported by \fBMBIO\fP. A list of the swath sonar data formats
-currently supported by \fBMBIO\fP and their identifier values
-is given in the \fBMBIO\fP manual page. Default: \fIinfile\fP = "datalist.mb-1".
-.TP
-.B \-N
-\fInangle/angle\fP
-.br
-The amplitude vs grazing angle table is calculated by binning the
-amplitude values according to their grazing angles and averaging
-the amplitudes within each bin. This option sets the number of
-grazing angle bins (\fInangle\fP) and the maximum angle considered
-(\fIangle\fP). The grazing angle function will be defined at
-\fInangle\fP points spaced equally from \-\fIangle\fP to
-+\fIangle\fP. The \fInangle\fP value should be an odd integer
-so that the middle bin is centered on the angle 0.0.
-Default: \fInangle\fP = 81, \fIangle\fP = 80.0.
-.TP
-.B \-P
-\fIpings\fP
-.br
-Sets the number of pings to be read and averaged for each
-amplitude vs grazing angle table. The output "*.sga" or ".aga" files
-will generally contain many tables, each with a timestamp
-corresponding to the average of the ping times used for
-each table. A table may be output averaged over a lesser number
-of beams if a time gap is encountered in the data, and also at
-the end of the file. Default: \fIpings\fP = 50.
-.TP
-.B \-Q
-By default, \fBmbbackangle\fP does not use seafloor slopes in
-calculating the grazing angles for each amplitude beam and sidescan
-pixel. This option causes the program to calculate acrosstrack slopes
-from swath bathymetry, if available, and to factor these slopes
-into the grazing angle calculation for each data point.
-.TP
-.B \-R
-\fIrefangle\fP
-Sets the reference angle that will be used by \fBmbprocess\fP in
-applying the amplitude and/or sidescan correction tables generated
-by \fBmbbackangle\fP. Default: \fIrefangle\fP = 30.0 degrees.
-.TP
-.B \-T
-\fItopogridfile\fP
-By default, \fBmbbackangle\fP does not use seafloor slopes in
-calculating the grazing angles for each amplitude beam and sidescan
-pixel. This option causes the program to calculate acrosstrack slopes
-using the topography grid \fItopogridfile\fP, and to factor these slopes
-into the grazing angle calculation for each data point.
-.TP
-.B \-V
-Normally, \fBmbbackangle\fP works "silently" without outputting
-anything to the stderr stream.  If the
-\fB\-V\fP flag is given, then \fBmbmask\fP works in a "verbose" mode and
-outputs the program version being used and all error status messages.
-.TP
-.B \-Z
-\fIdepth\fP
-.br
-This option specifies a default sonar altitude value in meters to be
-used whenever bathymetry values are unavailable. A flat seafloor
-(zero slope) will be assumed wherever the default depth needs
-to be used (e.g. data files with sidescan but no bathymetry, or
-the outer parts of swaths where the sidescan may extend further
-than the bathymetry). If this option is not specified, any
-amplitude or sidescan values without associated bathymetry
-information will not be used in calculating the amplitude
-vs grazing angle table.
-
-.SH EXAMPLE
-Suppose one has a Simrad EM300 data file called
-       0003_20020425_022926.mb57
-which contains 131 pings. In order to correct the beam amplitude and sidescan
-with mbprocess, first use \fBmbbackangle\fP to generate the
-amplitude vs grazing angle tables:
- 	mbbackangle \-I mbari_1998_988_msn.mb57 \\
- 			-N81/80.0 \-P50 \\
- 			-G1/80/60/81/121 \\
- 			-G2/80/60/81/121 \\
- 			-V
-.br
-Here the angle bins will be 2.0 degree wide, the table
-will extend from \-80.0 degees (port) to +80.0 (starboard),
-and each table will represent the averages over up to 50
-pings. The output looks like:
-
- 	Program mbbackangle
- 	Version $Id: mbbackangle.1 2096 2013-06-04 08:17:22Z caress $
- 	MB-system Version 5.0.4
-
- 	Pings to average:    50
- 	Number of angle bins: 81
- 	Maximum angle:         80.000000
- 	Default altitude:      0.000000
- 	Working on beam amplitude data...
- 	Working on sidescan data...
- 	Using flat bottom assumption in calculating correction tables...
- 	Outputting gridded histograms of beam amplitude vs grazing angle...
- 	Outputting gridded histograms of sidescan amplitude vs grazing angle...
-
- 	processing swath file: mbari_1998_988_msn.mb57 57
-
- 	7274 records processed
- 	805564 amplitude data processed
- 	146 tables written to mbari_1998_988_msn.mb57.aga
- 	5371412 sidescan data processed
- 	146 tables written to mbari_1998_988_msn.mb57.sga
-
- 	Plot generation shellscript <mbari_1998_988_msn.mb57_aga.grd.cmd> created.
- 	Plot generation shellscript <mbari_1998_988_msn.mb57_sga.grd.cmd> created.
-
- 	7274 total records processed
- 	805564 total amplitude data processed
- 	146 total aga tables written
- 	5371412 total sidescan data processed
- 	146 total sga tables written
-
-The output files include the amplitude versus grazing angle tables in
-mbari_1998_988_msn.mb57.aga and mbari_1998_988_msn.mb57.sga, the
-gridded histogram files mbari_1998_988_msn.mb57_aga.grd and
-mbari_1998_988_msn.mb57_sga.grd, and the plotting shellscripts
-mbari_1998_988_msn.mb57_aga.grd.cmd and
-mbari_1998_988_msn.mb57_sga.grd.cmd. The \fBmbprocess\fP parameter file
-mbari_1998_988_msn.mb57.par has also been either
-created (if necessary) or modified to enable sidescan
-correction using the ".sga" tables. The first of the six tables
-in mbari_1998_988_msn.mb57.sga looks like:
- 	## Sidescan correction table files generated by program mbbackangle
- 	## Version $Id: mbbackangle.1 2096 2013-06-04 08:17:22Z caress $
- 	## MB-system Version 5.0.4
- 	## Table file format: 1.0.0
- 	## Run by user <caress> on cpu <hess> at <Fri Oct  1 11:18:30 2004>
- 	## Input swath file:      mbari_1998_988_msn.mb57
- 	## Input swath format:    57
- 	## Output table file:     mbari_1998_988_msn.mb57.sga
- 	## Pings to average:      50
- 	## Number of angle bins:  81
- 	## Maximum angle:         80.000000
- 	## Default altitude:      0.000000
- 	## Data type:             sidescan
- 	# table: 0
- 	# nping: 50
- 	# time:  1998/06/10 14:55:24.979779    897490524.979780
- 	# nangles: 81
- 	-80.0000       0.0000       0.0000
- 	-78.0000       0.0000       0.0000
- 	-76.0000       0.0000       0.0000
- 	-74.0000       0.0000       0.0000
- 	-72.0000       0.0000       0.0000
- 	-70.0000       0.0000       0.0000
- 	-68.0000       0.0000       0.0000
- 	-66.0000       0.0000       0.0000
- 	-64.0000      33.4828       7.5915
- 	-62.0000      32.4068       5.4016
- 	-60.0000      31.9667       5.3320
- 	-58.0000      31.7880       5.1880
- 	-56.0000      31.6249       5.0681
- 	-54.0000      31.6362       4.9521
- 	-52.0000      31.5590       5.0482
- 	-50.0000      31.3955       5.1242
- 	-48.0000      31.0372       5.2364
- 	-46.0000      30.9569       5.1092
- 	-44.0000      30.8126       4.9848
- 	-42.0000      30.3497       4.9611
- 	-40.0000      29.7660       4.9479
- 	-38.0000      29.2746       4.9727
- 	-36.0000      29.1929       4.9734
- 	-34.0000      29.1729       4.9893
- 	-32.0000      28.7375       5.0295
- 	-30.0000      28.6560       5.0031
- 	-28.0000      28.0609       5.1757
- 	-26.0000      27.3652       5.2692
- 	-24.0000      26.2536       5.1193
- 	-22.0000      25.2113       4.8437
- 	-20.0000      24.9033       4.5717
- 	-18.0000      24.4118       4.5952
- 	-16.0000      24.4341       4.5824
- 	-14.0000      24.3251       4.7864
- 	-12.0000      23.6965       4.1409
- 	-10.0000      24.1326       3.7653
- 	-8.0000      26.1912       4.2246
- 	-6.0000      27.9516       4.5724
- 	-4.0000      31.1992       5.6401
- 	-2.0000      29.2624       5.8076
- 	 0.0000      27.4466       4.3310
- 	 2.0000      24.9780       4.1345
- 	 4.0000      24.2328       4.0980
- 	 6.0000      23.3917       4.6856
- 	 8.0000      24.0867       4.5882
- 	10.0000      23.2293       4.6383
- 	12.0000      24.1375       4.5005
- 	14.0000      25.1402       4.6843
- 	16.0000      25.1948       4.9131
- 	18.0000      25.0986       5.0503
- 	20.0000      25.0798       5.0769
- 	22.0000      25.0582       5.1801
- 	24.0000      25.6108       5.1108
- 	26.0000      25.8393       5.0068
- 	28.0000      26.3232       4.9469
- 	30.0000      26.4346       5.0686
- 	32.0000      26.6474       5.1690
- 	34.0000      27.0092       5.2098
- 	36.0000      27.1987       5.1664
- 	38.0000      27.3710       5.2504
- 	40.0000      27.1160       5.1788
- 	42.0000      27.0691       5.1418
- 	44.0000      27.2547       4.8907
- 	46.0000      27.7406       4.9654
- 	48.0000      28.1568       4.9277
- 	50.0000      28.4015       4.9687
- 	52.0000      28.4042       4.9034
- 	54.0000      28.3741       4.9500
- 	56.0000      28.5195       4.9799
- 	58.0000      28.6455       5.0142
- 	60.0000      28.9284       4.9876
- 	62.0000      28.9028       5.0380
- 	64.0000       0.0000       0.0000
- 	66.0000       0.0000       0.0000
- 	68.0000       0.0000       0.0000
- 	70.0000       0.0000       0.0000
- 	72.0000       0.0000       0.0000
- 	74.0000       0.0000       0.0000
- 	76.0000       0.0000       0.0000
- 	78.0000       0.0000       0.0000
- 	80.0000       0.0000       0.0000
- 	#
- 	#
-
-.SH SEE ALSO
-\fBmbsystem\fP(1), \fBmbprocess\fP(1), \fBmbset\fP(1), \fBmbfilter\fP(1)
-
-.SH BUGS
-None worth bragging about.
diff --git a/src/man/man1/mbclean.1 b/src/man/man1/mbclean.1
deleted file mode 100644
index eadd29e..0000000
--- a/src/man/man1/mbclean.1
+++ /dev/null
@@ -1,475 +0,0 @@
-.TH mbclean 1 "14 April 2015" "MB-System 5.0" "MB-System 5.0"
-.SH NAME
-\fBmbclean\fP \- Tool to automatically flag bad beams in swath sonar bathymetry data.
-
-.SH VERSION
-Version 5.0
-
-.SH SYNOPSIS
-\fBmbclean\fP [\fB\-A\fImax\fP \fB\-B\fIlow/high\fP \fB\-C\fIslope/units\fP
-\fB\-D\fImin/max\fP \fB\-F\fIformat\fP
-\fB\-G\fIfraction_low/fraction_high\fP
-\fB\-I\fIinfile\fP \fB\-K\fIrange_min\fP \fB\-L\fIlonflip\fP
-\fB\-M\fImode\fP \fB\-O\fIoutfile\fP \fB\-P\fImin_speed/max_speed\fP \fB\-Q\fIbackup\fP
-\fB\-R\fImaxheadingrate\fP \fB\-S\fIslope/mode/units\fP
-\fB\-T\fItolerance\fP \fB\-U\fInmin\fP \fB\-W\fIwest/east/south/north\fP \fB\-X\fIbeamsleft/beamsright\fP
-\fB\-Y\fIdistanceleft/distanceright\fP \fB\-Z \-V \-H\fP]
-
-.SH DESCRIPTION
-\fBmbclean\fP identifies and flags artifacts in swath sonar bathymetry data.
-Several algorithms are available for identifying artifacts; multiple
-algorithms can be applied in a single pass.
-The most commonly used approach is to identify artifacts
-based on excessive bathymetric slopes.
-Spikes where an excessive slope occurs before and reverses after a beam
-can also be removed.
-If desired, \fBmbclean\fP will also flag beams
-associated with "rails" where
-outer beams have smaller acrosstrack distances
-than more inner beams (\fB\-Q\fP option).
-Low and high bounds on acceptable depth values can be set; depth values
-outside the acceptable range will be flagged. The acceptable depth
-ranges can either be absolute (\fB\-B\fP option), relative to
-the local median depth (\fB\-A\fP option) or defined by low
-and high fractions of the local median depth (\fB\-G\fP option).
-A set number of outer beams can also be flagged.
-
-The order in which the flagging algorithms are applied is
-as follows:
-.br
- 	1. Flag specified numbers of outer beams
- 		(\fB\-X\fP option).
- 	2. Flag outer beams by acrosstrack distance
- 		(\fB\-Y\fP option).
-	3. Flag all beams in pings outside specified
-		acceptable speed range (\fB\-P\fP option).
-	4. Flag all beams in pings outside specified
-		acceptable position bounds (\fB\-W\fP option).
-	5. Flag all beams in pings with zero
-		longitude and latitude values (\fB\-Z\fP option).
- 	6. Flag soundings outside specified acceptable
- 		depth range (\fB\-B\fP option).
- 	7. Flag soundings with ranges less than
- 		specified minimum value (\fB\-B\fP option).
- 	8. Flag pings with excessive heading change rate
-	        (\fB\-R\fP option).
- 	9. Zap "rails" (\fB\-Q\fP option).
- 	10. Flag soundings with acrosstrack distances 
- 		greater than specified maximum value
- 		(\fB\-B\fP option).
- 	11. Flag soundings outside acceptable depth range
- 		using fractions of local median depth
- 		(\fB\-G\fP option).
- 	12. Flag soundings outside acceptable depth range
- 		using deviation from local median depth
- 		(\fB\-A\fP option).
- 	13. Flag soundings associated with spikes (\fB\-S\fP option).
- 	14. Flag soundings associated with excessive slopes
- 		(\fB\-C\fP option or default).
- 	15. Flag all soundings in pings with too few
- 		good soundings (\fB\-U\fP option).
-
-This program flags beams by outputting the flags as
-edit events to an "edit save file", like that produced
-by \fBmbedit\fP. If an "edit save file" (named by adding
-a ".esf" suffix to the input swath filename) already
-exists, the edits are read in and applied before the
-\fBmbclean\fP flagging algorithms are used.
-Once generated, the edit events can be applied
-to the data using the program \fBmbprocess\fP, which
-outputs a processed swath data file.
-The \fBmbprocess\fP program is also used to merge
-edited navigation, recalculate bathymetry, and apply
-other corrections to swath bathymetry data.
-
-.SH AUTHORSHIP
-David W. Caress (caress at mbari.org)
-.br
-  Monterey Bay Aquarium Research Institute
-.br
-Dale N. Chayes (dale at ldeo.columbia.edu)
-.br
-  Lamont-Doherty Earth Observatory
-.br
-Alberto Malinverno
-.br
-  Schlumberger-Doll
-
-.SH OPTIONS
-.TP
-.B \-A
-\fImax\fP
-.br
-This option sets the range of acceptable depth values relative to
-the local median depth. The median depth is obtained from the
-current ping and the pings immediately before and after that
-ping.  If a depth value deviates from the median depth by more
-than \fImax\fP, then it
-will be flagged. No deviation from the median depth checking is
-done if the \fB\-A\fP option
-is not used.
-.TP
-.B \-B
-\fIlow/high\fP
-.br
-This option sets the range of acceptable depth values.  If a depth
-value is less than \fIlow\fP or more than \fIhigh\fP then it
-will be flagged. No depth range checking is done if the \fB\-B\fP option
-is not used.
-.TP
-.B \-C
-\fIslope/unit\fP
-.br
-The value \fIslope\fP is the maximum acceptable slope. Beams associated
-with excessive slopes will be flagged or removed according to the
-operational mode specified using the \fB\-M\fP option. This method will
-be used if no other algorithms are specified; if other algorithms are
-specified but \fB\-C\fP is not used then no slope checking will occur.
-\fIunit\fP is optional and specifies the unit of \fIslope\fP,
-0 (default) indicates the slope is in tangents, 1 slope is in radians,
-2 slope is in degrees.
-Default: \fIslope\fP = 1.0
-.TP
-.B \-D
-\fImin/max\fP
-.br
-Sets the minimum and maximum allowed distances between beams used for
-some of the flagging algorithms.  Both values are expressed in terms
-of fractions of the local median depth. Thus, \fB\-D\fP\fI0.01/0.25\fP
-will translate, if the local median depth is 1000 meters, to a minimum
-distance of 10 meters and a maximum distance of 250 meters.
-The \fImin\fP value sets the minimum distance
-between beams required for an excessive slope to be used
-to flag bad beams.
-The navigation and heading of the ship are used to calculate the locations
-of beams.  Ship turns often cause beams of adjacent pings to overlap, causing
-the distances between these beams to become quite small.  This can, in turn,
-magnify noise in the bathymetry data to produce slope estimates which
-are excessively large. The \fImax\fP value sets the maximum distance
-between the current beam and other beams for those beams to be used
-in evaluating the current beam. For instance, only beams within the
-maximum distance are used to calculate the local median depth, and only
-beams within the maximum distance are used to check for excessive slopes.
-Default: \fImin/max\fP = 0.01/0.25.
-.TP
-.B \-F
-\fIformat\fP
-.br
-Sets the data format used if the input is read from stdin
-or from a file. If \fIformat\fP < 0, then the input file specified
-with the \fB\-I\fP option will actually contain a list of input swath sonar
-data files. This program uses the \fBMBIO\fP library
-and will read or write any swath sonar
-format supported by \fBMBIO\fP. A list of the swath sonar data formats
-currently supported by \fBMBIO\fP and their identifier values
-is given in the \fBMBIO\fP manual page. Default: \fIformat\fP = 11.
-.TP
-.B \-G
-\fIfraction_low/fraction_high\fP
-.br
-This option sets the range of acceptable depth values relative to
-low and high fractions of the local median depth.
-The median depth is obtained from the
-current ping and the pings immediately before and after that
-ping.  If a depth
-value is less than \fIfraction_low\fP times the median depth
-(e.g. \fIfraction_low\fP = 0.5 means one half the median
-depth) or more than \fIfraction_high\fP times the median depth then it
-will be flagged. No fractional depth range checking is
-done if the \fB\-G\fP option
-is not used.
-.TP
-.B \-H
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-.TP
-.B \-I
-\fIinfile\fP
-.br
-Sets the input filename. If \fIformat\fP > 0 (set with the
-\fB\-F\fP option) then the swath sonar data contained in \fIinfile\fP
-is read and processed. If \fIformat\fP < 0, then \fIinfile\fP
-is assumed to be an ascii file containing a list of the input swath sonar
-data files to be processed and their formats.  The program will read
-and process the data in each one of these files. Each input file will
-have an associated output file with either the ".sga" or ".aga" suffix.
-In the \fIinfile\fP file, each
-data file should be followed by a data format identifier, e.g.:
- 	datafile1 11
- 	datafile2 24
-.br
-This program uses the \fBMBIO\fP library and will read or write any swath sonar
-format supported by \fBMBIO\fP. A list of the swath sonar data formats
-currently supported by \fBMBIO\fP and their identifier values
-is given in the \fBMBIO\fP manual page. Default: \fIinfile\fP = "datalist.mb-1".
-.TP
-.B \-K
-\fIrange_min\fP
-.br
-This option causes all unflagged beams with ranges less than
-\fIrange_min\fP to be flagged as bad. The value \fIrange_min\fP
-is specified in meters.
-.TP
-.B \-L
-\fIlonflip\fP
-.br
-Sets the range of the longitude values used.
-If \fIlonflip\fP=\-1 then the longitude values will be in
-the range from \-360 to 0 degrees. If \fIlonflip\fP=0
-then the longitude values will be in
-the range from \-180 to 180 degrees. If \fIlonflip\fP=1
-then the longitude values will be in
-the range from 0 to 360 degrees.
-Default: \fIlonflip\fP = 0.
-.TP
-.B \-M
-\fImode\fP
-.br
-Sets the manner in which bad beams identified by excessive slope
-are handled.
- 	\fImode\fP = 1:	Flags one beam associated with each outlier slope.
- 			The flagged beam is the one furthest from the local
- 			median depth.
- 	\fImode\fP = 2:	Flags both beams associated with each outlier slope.
-Default: \fImode\fP = 1.
-.TP
-.B \-P
-\fIspeed_low/speed_high\fP
-.br
-This option causes \fBmbclean\fP to flag as bad all beams in pings
-associated with platform speed outside the acceptable range from
-\fIspeed_low\fP to \fIspeed_high\fP. The speed values are specified
-in km/hour.
-.TP
-.B \-Q
-\fIbackup\fP
-.br
-This flag causes \fBmbclean\fP to search for bad "rails" in the
-swath sonar swath; the "rails" refer to groups of outer beams which
-have crosstrack distances (and depths) much less than they should
-have.  These are identified when one or more outer beams lies
-more than \fIbackup\fP meters inboard of a more inner beam; all beams
-meeting this criteria are flagged.
-.TP
-.B \-R
-\fImaxheadingrate\fP
-.br
-The value \fImaxheadingrate\fP is the maximum acceptable rate of change in
-heading in degrees/second. All soundings associated with pings for which the
-heading was changing at a greater rate will be flagged.
-.TP
-.B \-S
-\fIslope/mode/unit\fP
-.br
-The value \fIslope\fP is the maximum acceptable spike slope.
-If the slope from the preceding beam to this beam exceeds this value,
-and the slope from this beam to subsequent beam exceeds this value but
-with an opposite sign this beam is considered a spike and
-will be flagged or removed according to the
-operational mode specified using the \fB\-M\fP option.
-Acrosstrack slopes are determined by the preceding and subsequent beams
-in the same ping. Alongtrack slopes are
-determined from the same beam in the previous and subsequent pings.
-Alongtrack are fairly sensitive to the minimum distance \fB\-D\fP option,
-which will normally need to be set less to a very small value for alongtrack slopes
-to be detected. There is no test that alongtrack distances are all in the same direction.
-
-If \fImode\fP is 1 (default) only acrosstrack spikes are detected.
-If \fImode\fP is 2 only alongtrack spikes are detected.
-If \fImode\fP is 3 both along track and across track slopes are checked.
-
-\fIunit\fP is optional and specifies the unit of \fIslope\fP,
-0 (default) indicates the slope is in tangents, 1 slope is in radians,
-2 slope is in degrees.
-A beam is not considered a spike if either the preceding or subsequent beam
-has already been flagged.
-Default: \fIslope\fP = 1.0
-.TP
-.B \-T
-\fItolerance\fP
-.br
-If requested this option will reset the timestamps of edit events from an
-existing esf file to exactly match the timestamps of the survey pings. The
-/fItolerance/fP value sets how close timestamps must be in seconds to be
-considered a match. This option handles the case where survey data have been
-processed using non-\fBMB-System\fP software and a user is extracting the
-edits from one set of files with \fBmbgetesf\fP and then applying them to
-another using \fBmbprocess\fP.
-.TP
-.B \-U
-\fInmin\fP
-.br
-This flag causes \fBmbclean\fP to search for port or starboard
-halves of pings which contain fewer than \fInmin\fP good bathymetry
-values. All bathymetry values in the affected half-pings are
-flagged.
-.TP
-.B \-V
-Normally, \fBmbclean\fP works "silently" without outputting
-anything to the stderr stream.  If the
-\fB\-V\fP flag is given, then \fBmbclean\fP works in a "verbose" mode and
-outputs the program version being used, all error status messages,
-and the number of beams flagged as bad.
-.TP
-.B \-W
-\fIwest/east/south/north\fP
-.br
-This option causes \fBmbclean\fP to flag as bad all beams in pings
-with navigation outside the specified acceptable bounds. 
-.TP
-.B \-X
-\fIzap_beams\fP
-.br
-If this option is used, the outermost \fIzap_beams\fP at both ends
-of the swath are flagged as bad; this is useful if the outer beams
-are known to be unreliable. Default: \fIzap_beams\fP = 0.
-.TP
-.B \-Y
-\fIdistanceleft/distanceright\fP
-.br
-This option causes \fBmbclean\fP to flag as bad all beams with
-acrosstrack distances more to port than \fIdistanceleft\fP
-and more to starboard than \fIdistanceright\fP. The distances
-are defined in meters, and distances to port of nadir are
-negative.
-.TP
-.B \-Z
-.br
-This option causes \fBmbclean\fP to flag as bad all beams in pings
-with zero longitude and latitude values. 
-
-.SH EXAMPLES
-Suppose one wishes to do a first pass edit of
-six Simrad EM300 files in
-the processing format (format 57). A datalist referencing these
-six files exists as the file datalist.mb-1 and has the contents:
- 	0001_20020424_212920.mb57 57
- 	0002_20020425_011607.mb57 57
- 	0003_20020425_022926.mb57 57
- 	0004_20020425_024336.mb57 57
- 	0005_20020425_034057.mb57 57
- 	0006_20020425_045013.mb57 57
-.br
-Use the following to flag any
-beams which deviate by more than 20% from the local median
-depth or which produce a slope greater than 3.5 (74 degrees):
-
- 	mbclean \-Idatalist.mb-1 \\
- 		-M1 \-C3.5 \-D0.01/0.20 \\
- 		-G0.80/1.20
-
-The program will output flagging statistics for each file and
-give totals at the end. If the \fB\-V\fP option is specified,
-\fBmbclean\fP will also output information for each beam that
-is flagged. Here is an example of the nonverbose output:
-.br
-.br
- 	Processing 0001_20020424_212920.mb57
- 	908 bathymetry data records processed
- 	0 outer beams zapped
- 	0 beams zapped for too few good beams in ping
- 	0 beams out of acceptable depth range
- 	64 beams out of acceptable fractional depth range
- 	0 beams exceed acceptable deviation from median depth
- 	0 bad rail beams identified
- 	1601 excessive slopes identified
-	0 excessive spikes identified
- 	1665 beams flagged
- 	0 beams unflagged
-
- 	Processing 0002_20020425_011607.mb57
- 	259 bathymetry data records processed
- 	0 outer beams zapped
- 	0 beams zapped for too few good beams in ping
- 	0 beams out of acceptable depth range
- 	0 beams out of acceptable fractional depth range
- 	0 beams exceed acceptable deviation from median depth
- 	0 bad rail beams identified
- 	242 excessive slopes identified
-	0 excessive spikes identified
- 	242 beams flagged
- 	0 beams unflagged
-
- 	Processing 0003_20020425_022926.mb57
- 	65 bathymetry data records processed
- 	0 outer beams zapped
- 	0 beams zapped for too few good beams in ping
- 	0 beams out of acceptable depth range
- 	9 beams out of acceptable fractional depth range
- 	0 beams exceed acceptable deviation from median depth
- 	0 bad rail beams identified
- 	497 excessive slopes identified
-	0 excessive spikes identified
- 	506 beams flagged
- 	0 beams unflagged
-
- 	Processing 0004_20020425_024336.mb57
- 	410 bathymetry data records processed
- 	0 outer beams zapped
- 	0 beams zapped for too few good beams in ping
- 	0 beams out of acceptable depth range
- 	0 beams out of acceptable fractional depth range
- 	0 beams exceed acceptable deviation from median depth
- 	0 bad rail beams identified
- 	148 excessive slopes identified
-	0 excessive spikes identified
- 	148 beams flagged
- 	0 beams unflagged
-
- 	Processing 0005_20020425_034057.mb57
- 	252 bathymetry data records processed
- 	0 outer beams zapped
- 	0 beams zapped for too few good beams in ping
- 	0 beams out of acceptable depth range
- 	0 beams out of acceptable fractional depth range
- 	0 beams exceed acceptable deviation from median depth
- 	0 bad rail beams identified
- 	100 excessive slopes identified
-	0 excessive spikes identified
- 	100 beams flagged
- 	0 beams unflagged
-
- 	Processing 0006_20020425_045013.mb57
- 	562 bathymetry data records processed
- 	0 outer beams zapped
- 	0 beams zapped for too few good beams in ping
- 	0 beams out of acceptable depth range
- 	0 beams out of acceptable fractional depth range
- 	0 beams exceed acceptable deviation from median depth
- 	0 bad rail beams identified
- 	41 excessive slopes identified
-	0 excessive spikes identified
- 	41 beams flagged
- 	0 beams unflagged
-
- 	MBclean Processing Totals:
- 	-------------------------
- 	6 total swath data files processed
- 	2456 total bathymetry data records processed
- 	0 total beams flagged in old esf files
- 	0 total beams unflagged in old esf files
- 	0 total beams zeroed in old esf files
- 	0 total outer beams zapped
- 	0 total beams zapped for too few good beams in ping
- 	0 total beams out of acceptable depth range
- 	73 total beams out of acceptable fractional depth range
- 	0 total beams exceed acceptable deviation from median depth
- 	0 total bad rail beams identified
- 	2629 total excessive slopes identified
-	0 total excessive spikes identified
- 	2702 total beams flagged
- 	0 total beams unflagged
-
-.SH SEE ALSO
-\fBmbsystem\fP(1), \fBmbedit\fP(1),
-\fBmbinfo\fP(1) \fBmbprocess\fP(1),
-
-.SH BUGS
-The algorithms implemented in \fBmbclean\fP simply
-don't detect all bathymetric artifacts that
-are obvious to the eye on contour charts.  Although
-\fBmbclean\fP often does a credible first pass at
-flagging obvious artifacts, we strongly recommend that
-any swath bathymetry processing stream include
-interactive editing of the
-bathymetry data (e.g. \fBmbedit\fP).
diff --git a/src/man/man1/mbcontour.1 b/src/man/man1/mbcontour.1
deleted file mode 100644
index c67da53..0000000
--- a/src/man/man1/mbcontour.1
+++ /dev/null
@@ -1,452 +0,0 @@
-.TH mbcontour 1 "5 February 2015" "MB-System 5.0" "MB-System 5.0"
-.SH NAME
-\fBmbcontour\fP \- \fBGMT\fP plug-in module for color fill or color shaded relief
-swath plots of swath sonar data using Postscript.
-
-.SH VERSION
-Version 5.0
-
-.SH SYNOPSIS
-\fBgmt mbcontour\fP \fB\-J\fIparameters\fP \fB\-R\fIwest/east/south/north
-\fP[\fB\-A\fIcont_int/col_int/tic_int/lab_int/tic_int/lab_hgt/lab_spacing\fP
-\fB\-B\fItickinfo\fP \fB\-b\fIyr/mo/da/hr/mn/sc\fP
-\fB\-C\fIcontourfile\fP \fB\-c\fIcopies\fP
-\fB\-D\fItime_tick/time_annot/date_annot/time_tick_len\fP
-\fB\-E\fIyr/mo/da/hr/mn/sc\fP
-\fB\-f\fIformat\fP \fB\-F\fIred/green/blue\fP \fB\-G\fIname_hgt[/name_perp]\fP
-\fB\-I\fIinfile\fP \fB\-K\fP \fB\-L\fIlonflip\fP
-\fB\-M\fIpingnumber_tick/pingnumber_annot/pingnumber_tick_len\fP
-\fB\-N\fInplot\fP \fB\-O\fP \fB\-P\fP \fB\-p\fIpings\fP
-\fB\-Q\fP \fB\-S\fIspeed \fB\-T\fItimegap\fP \fB\-U\fP \fB\-W\fP \fB\-X\fIx-shift\fP
-\fB\-Y\fIy-shift\fP \fB\-Z\fIalgorithm\fP
-\fB\-V \-H\fP]
-
-.SH DESCRIPTION
-\fBmbcontour\fP is a plug-in module for plotting bathymetry contours
-from swath sonar data using \fBGMT\fP (Generic Mapping Tools). Like
-\fBmbswath\fP, \fBmbcontour\fP is fully compatible with the \fBGMT\fP
-package version 5. Two contouring
-algorithms are available; the \fB\-Z\fP option specifies which is used.
-The first, default approach draws contours between successive pings;
-this algorithm is simple and therefore fast but produces poor
-looking contours when beams from one ping lie "behind" beams from a
-previous ping (this happens for sonars that ping at nonnull pitch
-angles or for the "inside" beams when ships make sharp turns). The
-second algorithm constructs a triangular network from the available
-soundings and contours the network; this approach is complicated
-and therefore slow but produces good looking contours under most
-conditions. The contour levels  and colors can be controlled
-directly or set implicitly using contour and color change intervals.
-Contours can also be set to have ticks pointing downhill.
-
-Shiptracks can also be plotted using the \fB\-D\fP, \fB\-G\fP, and
-\fB\-M\fP options. The \fB\-D\fP option controls the basic track
-plotting, including time annotation. The \fB\-G\fP
-option causes the start of each swath data file to be annotated with
-the filename. The \fB\-M\fP option controls ping number annotation,
-or shot number annotation in the case of segy format seismic data.
-
-Before opening an input swath data file, \fBmbcontour\fP checks for
-an ascii file in the same directory having the same name except
-that ".inf" is appended to the end. The program assumes that this
-ascii file contains the output of the program \fBmbinfo\fP run on
-the input data file. If the ".inf" file exists, \fBmbcontour\fP reads
-the minimum and maximum longitude and latitude bounds from the
-\fBmbinfo\fP output and compares those to the bounds
-for the plot. If the ".inf" file indicates that none of the data
-in the input file lies inside the plot bounds, that input
-file is skipped. This allows users to maintain a single master list
-of data files for use in all plotting without the performance penalty
-of \fBmbcontour\fP reading through all the data files, even those
-with no relevent data. We recommend that users maintain a ".inf"
-file for each swath data file used for gridding or plotting. The
-\fBGMT\fP modules \fBmbswath\fP and \fBmbgrid\fP also use ".inf" files
-in the same fashion.
-
-In order for \fBGMT\fP to successfully execute \fBmbcontour\fP, the
-location of the shared library \fIlibmbgmt\fP containing this module must be known to \fBGMT\fP.
-This can be accomplished by either setting the GMT_CUSTOM_LIBS parameter
-in the file gmt.conf that is part of the GMT installation, by setting
-this parameter in the file gmt.conf in the user's home directory, or by
-using the GMT module \fBgmtset\fP to modify this parameter in the
-current working directory. If, for instance, the \fIlibmbgmt\fP shared library
-has been installed in the file /usr/lib/libmbgmt.dylib, then the
-GMT_CUSTOM_LIBS parameter in a gmt.conf file can be set to:
-        GMT_CUSTOM_LIBS = /usr/lib/libmbgmt.dylib
-
-.SH AUTHORSHIP
-David W. Caress (caress at mbari.org)
-.br
-  Monterey Bay Aquarium Research Institute
-.br
-Dale N. Chayes (dale at ldeo.columbia.edu)
-.br
-  Lamont-Doherty Earth Observatory
-
-.SH OPTIONS
-.TP
-.B \-A
-\fIcont_int/col_int/tic_int/lab_int/tic_len/lab_hgt/lab_spacing\fP
-.br
-If specific contour levels are not specified with the \fI-C\fP option,
-then contours will be
-generated in four colors (black, red, green, and blue) with intervals,
-annotations, and tickmarks controlled by these parameters.  Contours will be
-generated at invervals of \fIcont_int\fP meters.  Color changes
-will occur at intervals of \fIcol_int\fP meters.  Contours will have
-downhill facing tickmarks \fItic_int\fP inches long every \fItic_int\fP
-meters. Contours will have annotations
-\fIlabel_len\fP inches high every \fIlab_int\fP meters. The origins of
-contour labels will be separated by at least \fIlab_spacing\fP
-inches (potentially overlapping labels will be omitted);
-if \fIlab_spacing\fP = 0.0 then the spacing will be defined by
-\fIlab_hgt\fP. If fewer than seven parameters are specified, the
-default values are used for the  missing parameters.
-Defaults: \fIcont_int\fP = 25; \fIcol_int\fP = 100;
-\fItic_int\fP = 100; \fIlab_int\fP = 100; \fItic_int\fP = 0.1;
-\fIlab_hgt\fP = 0.05; \fIlab_spacing\fP = 0.0.
-.TP
-.B \-B
-\fItickinfo\fP
-.br
-Sets map boundary tickmark intervals. See \fBpsbasemap\fP for details.
-.TP
-.B \-b
-\fIyr/mo/da/hr/mn/sc\fP
-.br
-Sets the starting time for data allowed in the input data; pings
-with times before the starting time will be ignored.
-Default: \fIyr/mo/da/hr/mn/sc\fP = 1962/2/21/10/30/0.
-.TP
-.B \-C
-\fIcontourfile\fP
-.br
-Sets the file from which the contour levels and their
-style and color are read.
-This file consists of lines in the format:
-    \fIlevel label tick red green blue\fP
-.br
-where \fIlevel\fP is the depth value to be contoured
-in meters, \fIlabel\fP
-is either 'a' for annotated or 'n' for not annotated,
-\fItick\fP is either 't' for tick marks or 'n' for no
-tick marks, and \fIred\fP, \fIgreen\fP,
-and \fIblue\fP set the color of the contour lines (these values can
-range from 0 to 255). If a GMT cpt file is given as the \fIcontourfile\fP,
-the color boundaries specified in the cpt file will be interpreted as
-contour levels to be plotted with unannotated, unticked, black contours.
-If contours are specified using the \fB\-C\fP option, then any use
-of the \fB\-A\fP option will be ignored.
-.TP
-.B \-D
-\fItime_tick/time_annot/date_annot/time_tick_len\fP
-.br
-Sets the parameters governing the annotation of the shiptrack.
-Time marks are made with "X" marks along the shiptrack; annotated
-time marks show the time in HH:MM format next to the time mark
-and annotated date marks show the time and julian day in
-HH:MM/DDD format.  The "X" marks are
-\fItime_tick_len\fP inches high for normal time marks and
-1.5 times \fItime_tick_len\fP inches high for annotated time or date
-marks.  The interval of time ticks, annotated time ticks, and
-annotated date ticks are given in hours by
-\fItime_tick\fP, \fItime_annot\fP, and \fIdate_annot\fP, respectively.
-Defaults: \fItime_tick\fP = 0.25; \fItime_annot\fP = 1.0;
-\fIdate_annot\fP = 4.0; \fItime_tick_len\fP = 0.1.
-.TP
-.B \-E
-\fIyr/mo/da/hr/mn/sc\fP
-.br
-Sets the ending time for data allowed in the input data; pings
-with times after the ending time will be ignored.
-Default: \fIyr/mo/da/hr/mn/sc\fP = 2062/2/21/10/30/0.
-.TP
-.B \-f
-\fIformat\fP
-.br
-Sets the data format used if the input is read from stdin
-or from a file. If \fIformat\fP < 0, then the input file specified
-with the \fB\-I\fP option will actually contain a list of input swath sonar
-data files. This program uses the \fBMBIO\fP library
-and will read or write any swath sonar
-format supported by \fBMBIO\fP. A list of the swath sonar data formats
-currently supported by \fBMBIO\fP and their identifier values
-is given in the \fBMBIO\fP manual page. Default: \fIformat\fP = \-1.
-.TP
-.B \-F
-\fIred/green/blue\fP
-.br
-Sets the color used for Frame and annotation. [Default is black]
-.TP
-.B \-G
-\fIname_hgt[/name_perp]\fP
-.br
-Turns on swath file name annotation. The \fIname_hgt\fP parameter
-sets the height of the lettering in inches. By default, the file
-name will be plotted along the shiptrack. If the \fIname_perp\fP
-parameter is given as 1, then the file name will be plotted
-perpendicular to the shiptrack. The \fB\-G\fP option implies
-track plotting, so if the \fB\-D\fP option is not also specified, then
-track plotting will be turned on with default parameters.
-Default: \fIname_hgt\fP = 0.1.
-.TP
-.B \-H
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-.TP
-.B \-I
-\fIinfile\fP
-.br
-Sets the input filename. If \fIformat\fP > 0 (set with the
-\fB\-f\fP option) then the swath sonar data contained in \fIinfile\fP
-is read and processed. If \fIformat\fP < 0, then \fIinfile\fP
-is assumed to be an ascii file containing a list of the input swath sonar
-data files to be processed and their formats.  The program will read
-and plot the data in each one of these files.
-In the \fIinfile\fP file, each
-data file should be followed by a data format identifier, e.g.:
-    datafile1 11
-    datafile2 24
-.br
-This program uses the \fBMBIO\fP library and will read any swath sonar
-format supported by \fBMBIO\fP. A list of the swath sonar data formats
-currently supported by \fBMBIO\fP and their identifier values
-is given in the \fBMBIO\fP manual page.
-.br
-An input datafile may be accompanied by a "fast bathymetry" or "fbt" file
-and by a "fast navigation" or "fnv" file. The "fbt" and "fnv" file naming
-convention is to add the
-".fbt" or ".fbt" suffix to the original swath
-data filename.
-An "fbt" file contains only swath bathymetry information
-in a compact format (format 71),
-and is thus quick to read. In the
-event that bathymetry contours
-is being generated, \fBmbcontour\fP
-will attempt to read an "fbt" file in lieu of the original data.
-An "fnv" file contains only navigation information in a compact
-ASCII format (format 166), and is thus even quicker to read.
-When \fBmbcontour\fP is only generating a shiptrack plot, it will
-attempt to read an "fnv" file in lieu of the original data.
-
-.TP
-.B \-J
-Selects the map projection. Scale is inch/degree, 1:xxxxx.
-or width in inches (upper case modifier).
-.br
-.sp
-\fBCYLINDRICAL PROJECTIONS:\fP
-.br
-.sp
-\fB\-Jc\fP\fIlon0/lat0/scale\fP (Cassini)
-.br
-\fB\-Jm\fP\fIscale\fP (Mercator)
-.br
-\fB\-Joa\fP\fIlon0/lat0/azimuth/scale\fP (Oblique Mercator \- point and azimuth)
-.br
-\fB\-Job\fP\fIlon0/lat0/lon1/lat1/scale\fP (Oblique Mercator \- two points)
-.br
-\fB\-Joc\fP\fIlon0/lat0/lonp/latp/scale\fP (Oblique Mercator \- point and pole)
-.br
-\fB\-Jq\fP\fIlon0/scale\fP (Equidistant Cylindrical Projection (Plate Carree))
-.br
-\fB\-Jt\fP\fIlon0/scale\fP (TM \- Transverse Mercator)
-.br
-\fB\-Ju\fP\fIzone/scale\fP (UTM \- Universal Transverse Mercator)
-.br
-\fB\-Jy\fP\fIlon0/lats/scale\fP (Basic Cylindrical Projection)
-.br
-.sp
-\fBAZIMUTHAL PROJECTIONS:\fP
-.br
-.sp
-\fB\-Ja\fP\fIlon0/lat0/scale\fP (Lambert).
-.br
-\fB\-Je\fP\fIlon0/lat0/scale\fP (Equidistant).
-.br
-\fB\-Jg\fP\fIlon0/lat0/scale\fP (Orthographic).
-.br
-\fB\-Js\fP\fIlon0/lat0/scale\fP (General Stereographic)
-.br
-.sp
-\fBCONIC PROJECTIONS:\fP
-.br
-.sp
-\fB\-Jb\fP\fIlon0/lat0/lat1/lat2/scale\fP (Albers)
-.br
-\fB\-Jl\fP\fIlon0/lat0/lat1/lat2/scale\fP (Lambert)
-.br
-.sp
-\fBMISCELLANEOUS PROJECTIONS:\fP
-.br
-.sp
-\fB\-Jh\fP\fIlon0/scale\fP (Hammer)
-.br
-\fB\-Ji\fP\fIlon0/scale\fP (Sinusoidal)
-.br
-\fB\-Jk\fP\fIlon0/scale\fP (Eckert VI)
-.br
-\fB\-Jn\fP\fIlon0/scale\fP (Robinson)
-.br
-\fB\-Jr\fP\fIlon0/scale\fP (Winkel Tripel)
-.br
-\fB\-Jw\fP\fIlon0/scale\fP (Mollweide)
-.br
-.sp
-\fBNON-GEOGRAPHICAL PROJECTIONS:\fP
-.br
-.sp
-\fB\-Jp\fP\fIscale\fP (Linear projection for polar (theta,r) coordinates)
-.br
-\fB\-Jx\fP\fIx-scale\fP[\fBl|p\fP\fIpow\fP][\fI/y-scale\fP[\fBl|p\fP\fIpow\fP]] (Linear, log, and power scaling)
-.br
-More details can be found in the \fBpsbasemap\fP manpages.
-.br
-.TP
-.B \-K
-More \fIPostScript\fP code will be appended later [Default terminates the plot system].
-.TP
-.B \-L
-\fIlonflip\fP
-.br
-Sets the range of the longitude values returned by the swath sonar i/o routines.
-If \fIlonflip\fP=\-1 then the longitude values will be in
-the range from \-360 to 0 degrees. If \fIlonflip\fP=0
-then the longitude values will be in
-the range from \-180 to 180 degrees. If \fIlonflip\fP=1
-then the longitude values will be in
-the range from 0 to 360 degrees.
-Default: \fIlonflip\fP = 0.
-.TP
-.B \-M
-\fIpingnumber_tick/pingnumber_annot/pingnumber_tick_len\fP
-.br
-Sets the parameters governing the pingnumber annotation of the shiptrack.
-Tick marks are made along the shiptrack at \fIpingnumber_tick\fP intervals; these
-are \fItime_tick_len\fP inches long. Longer tick marks are made along the
-shiptrack at \fIpingnumber_annot\fP intervals; these are 1.5 times \fItime_tick_len\fP
-inches long.
-Defaults: \fIpingnumber_tick\fP = 50; \fIpingnumber_annot\fP = 100;
-\fIpingnumber_tick_len\fP = 0.1.
-.TP
-.B \-N
-\fInplot\fP
-Sets the number of pings to be read in before each contouring
-episode. See the description of the \fB\-Z\fP\fIalgorithm\fP option
-for advice on reasonable values
-Default: \fInplot\fP = 50 unless \fB\-Z\fP\fI1\fP is specified,
-in which case the default is \fInplot\fP = 5.
-.TP
-.B \-O
-Selects Overlay plot mode [Default initializes a new plot system].
-.TP
-.B \-P
-Selects Portrait plotting mode [GMT Default is Landscape, see gmtdefaults to change this].
-.TP
-.B \-p
-\fIpings\fP
-.br
-Sets the ping averaging of the input data. If \fIpings\fP = 1, then
-no ping averaging is performed. If \fIpings\fP > 0, then
-that number of input pings will be averaged to produce one output
-ping.  If \fIpings\fP = 0, then the ping averaging will automatically
-be done so that the along-track ping spacing is equal to the across-track
-beam spacing.
-Default: \fIpings\fP = 1 (no ping averaging).
-.TP
-.B \-Q
-Causes the program to plot the triangles constructed as part of the
-contouring if the "triangle algorithm" is specified using the
-\fB\-Z\fP\fI1\fP option. This allows the data distribution to be
-directly viewed.
-.TP
-.B \-R
-\fIwest/east/south/north\fP
-.br
-Sets the longitude and latitude bounds within which swath sonar
-data will be read and plotted. Only the data which lies within
-these bounds will be read.
-Default: \fIwest\fP=\-360, east\fI=360\fP, \fIsouth\fP=\-90, \fInorth\fP=90.
-.TP
-.B \-S
-\fIspeed\fP
-.br
-Sets the minimum speed in km/hr (5.5 kts ~ 10 km/hr) allowed in
-the input data; pings associated with a smaller ship speed will not be
-processed. Default: \fIspeed\fP = 0.
-.TP
-.B \-T
-\fItimegap\fP
-.br
-Sets the maximum time gap in minutes between adjacent pings allowed before
-the data is considered to have a gap. Default: \fItimegap\fP = 1.
-.TP
-.B \-U
-Draw Unix System time stamp on plot.  Optionally, append a label, or 'c' which will plot
-the command string.
-.TP
-.B \-V
-Selects verbose mode, which will send progress reports to stderr [Default runs "silently"].
-.TP
-.B \-W
-Normally, \fBmbcontour\fP works with bathymetry values in meters.  If the
-\fB\-W\fP flag is given, then \fBmbcontour\fP will contour the bathymetry
-values in feet.
-.TP
-.B \-X \-Y
-Shift origin of plot by (\fIx-shift,y-shift\fP) inches  [Default is (1,1) for new plots, (0,0) for overlays].
-.TP
-.B \-Z
-\fIalgorithm\fP
-.br
-Sets the contouring algorithm to be used. If \fIalgorithm\fP=0,
-a simple ping to ping contouring approach is used; this algorithm
-is fast but produces poor looking contours when used with data
-where beams from one ping may lie "behind" beams from previous
-pings (this happens for sonars that ping at nonnull pitch
-angles or for the "inside" beams when ships make sharp turns).
-If \fIalgorithm\fP=1 then a triangular network is constructed from
-the available soundings and this network is in turn contoured;
-this algorithm is slow but produces good looking contours in
-most cases. It is important to note that the time required for
-"triangle" algorithm increases with the square of the number
-of beams to be contoured; thus it is sensible to keep the number
-of pings contoured at a time small (e.g. use \fB\-N\fP\fI5\fP).
-The time required for the "ping to ping" algorithm varies linearly
-with the number of pings contoured; thus larger numbers of pings
-may be reasonably contoured at a time (e.g. use \fB\-N\fP\fI50\fP).
-Default: \fIalgorithm\fP = 0.
-.TP
-.B \-#
-Specifies the number of plot copies. [Default is 1]
-.SH EXAMPLES
-Suppose the user has a Hydrosweep data file in the L-DEO in-house
-binary format (\fBMBIO\fP format id 24) called hs_ew9302_161_mn.mb24
-which lies in the region w/s/e/n = \-32.1874/-26.6236/54.6349/56.7536.
-The following will suffice to generate a traditional four-color contour plot:
-    gmt mbcontour \-Idatalist \-Jm2.44652 \
-        -R-25.7252/-23.0683/59.7415/61.0699
-        -Ba0.5314g0.5314 \
-        -A50.0/250.0/250.0/250.0/0.01/0.1 \
-        -p1 \-P \-X1 \-Y1 \-K \-V > mbcontour.ps
-.br
-where the file datalist contains:
-    hs_ew9302_161_mn.mb24 24
-.br
-A plot including a navigation track can also be created using
-\fBmbcontour\fP.  Here the \fB\-D\fP flag is used to add a plot
-of the ship track annotated with time marks every 0.25 hours,
-annotated time marks every hour, and day annotations every four hours:
-    gmt mbcontour \-Idatalist \-Jm2.44652 \
-        -R-25.7252/-23.0683/59.7415/61.0699 \
-        -Ba0.5314g0.5314":.File hs_ew9302_161_bmn.mb24:" \
-        -D0.25/1/4/0.1 \
-        -A50.0/250.0/250.0/250.0/0.01/0.1 \
-        -p1 \-P \-X1 \-Y1 \-K \-V > hs_ew9302_161_bmn.mb24.ps
-
-.SH SEE ALSO
-\fBmbsystem\fP(1), \fBmbm_plot\fP(1), \fBmbswath\fP(1),
-\fBgmtsystem\fP(1), \fBpsbasemap\fP(1), \fBpsto24\fP(1)
-
-.SH BUGS
-Please let us know.
diff --git a/src/man/man1/mbcopy.1 b/src/man/man1/mbcopy.1
deleted file mode 100644
index c053c4c..0000000
--- a/src/man/man1/mbcopy.1
+++ /dev/null
@@ -1,220 +0,0 @@
-.TH mbcopy 1 "3 June 2013" "MB-System 5.0" "MB-System 5.0"
-.SH NAME
-\fBmbcopy\fP \- Copy swath sonar bathymetry data files.
-
-.SH VERSION
-Version 5.0
-
-.SH SYNOPSIS
-\fBmbcopy\fP [\fB\-B\fIyr/mo/da/hr/mn/sc\fP \fB\-C\fIcommentfile\fP \fB\-D\fP
-\fB\-E\fIyr/mo/da/hr/mn/sc\fP \fB\-F\fIinformat[/outformat[/mergeformat]]\fP 
-\fB\-H\fP \fB\-I\fIinfilename\fP 
-\fB\-L\fIlonflip\fP \fB\-M\fImergefilename\fP \fB\-N\fP \fB\-O\fIoutfilename\fP 
-\fB\-P\fIpings\fP \fB\-Q\fIsleep_factor\fP \fB\-R\fIwest/east/south/north\fP 
-\fB\-S\fIspeed\fP \fB\-V\fP]
-
-.SH DESCRIPTION
-\fBmbcopy\fP is a utility for copying swath sonar data files which
-may be used to change formats, average pings, or window
-in time and space. \fBmbcopy\fP can be used as a filter from
-stdin to stdout, or it may do i/o to and from files.
-
-.SH AUTHORSHIP
-David W. Caress (caress at mbari.org)
-.br
-  Monterey Bay Aquarium Research Institute
-.br
-Dale N. Chayes (dale at ldeo.columbia.edu)
-.br
-  Lamont-Doherty Earth Observatory
-
-.SH OPTIONS
-.TP
-.B \-B
-\fIyr/mo/da/hr/mn/sc\fP
-.br
-This option sets the starting time for data allowed in the input data.
-The \fB\-E\fP option sets the ending time for data. If the 
-starting time is before the ending time, then any data
-with a time stamp before the starting time or after the
-ending time is ignored. If instead the starting time is
-after the ending time, then any data between the ending
-and starting time will be ignored. This scheme allows time
-windowing both inside and outside a specified interval.
-Default: \fIyr/mo/da/hr/mn/sc\fP = 1962/2/21/10/30/0.
-.TP
-.B \-C
-\fIcommentfile\fP
-.br
-Text file containing comments which are inserted into the
-beginning of the output data stream.  This option is typically
-used to insert a data pedigree statement at the beginning of
-data processing.
-.TP
-.B \-D
-This option only works when the output format is MBLDEOIH (format 71).
-When \fB\-D\fP is invoked, \fBmbcopy\fP only outputs swath bathymetry
-data (any amplitude and sidescan data found in the input are ignored).
-The \fBMB-System\fP program \fBmbdatalist\fP uses this option to 
-generate "fast bathymetry" or "fbt" files. See the \fBMB-System\fP
-manual page for information on the use and utility of "fbt" files.
-.TP
-.B \-E
-\fIyr/mo/da/hr/mn/sc\fP
-.br
-This option sets the ending time for data allowed in the input data.
-The \fB\-B\fP option sets the starting time for data. If the 
-starting time is before the ending time, then any data
-with a time stamp before the starting time or after the
-ending time is ignored. If instead the starting time is
-after the ending time, then any data between the ending
-and starting time will be ignored. This scheme allows time
-windowing both inside and outside a specified interval.
-Default: \fIyr/mo/da/hr/mn/sc\fP = 2062/2/21/10/30/0.
-.TP
-.B \-F
-\fIinformat[/outformat[/mergeformat]]\fP
-.br
-Sets the format for the input and output swath sonar data using 
-\fBMBIO\fP integer format identifiers. If only \fIinformat\fP is specified,
-then \fIoutformat\fP is assumed to be the same. If bathymetry merging is
-specified with the \fB\-M\fP option, then the optional \fImergeformat\fP 
-specifies the format of the merge file.
-This program uses the \fBMBIO\fP library and will read or write any swath sonar
-format supported by \fBMBIO\fP. A list of the swath sonar data formats
-currently supported by \fBMBIO\fP and their identifier values
-is given in the \fBMBIO\fP manual page. When the \fIinformat\fP and
-\fIoutformat\fP values are both associated with the same swath sonar
-sonar system (e.g. the Atlas Hydrosweep DS system), then the complete
-data stream contained in the input file can be copied to the output
-file.  If the two formats are associated with two different swath sonar
-systems, then only the time stamp, navigation, and beam values will
-be copied.  The use of ping averaging also causes a partial data stream
-to be passed, even when compatible or identical input and output formats
-are specified (see the \fB\-P\fP option).
-Default: \fIinformat\fP = 11; \fIoutformat\fP = 11.
-.TP
-.B \-H
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-.TP
-.B \-I
-\fIinfilename\fP
-.br
-Data file from which the input data will be read. If
-no input file is specified, the input will be read
-from stdin. Default: \fIinfilename\fP = stdin.
-.TP
-.B \-L
-\fIlonflip\fP
-.br
-Sets the range of the longitude values returned.
-If \fIlonflip\fP=\-1 then the longitude values will be in
-the range from \-360 to 0 degrees. If \fIlonflip\fP=0 
-then the longitude values will be in
-the range from \-180 to 180 degrees. If \fIlonflip\fP=1 
-then the longitude values will be in
-the range from 0 to 360 degrees.
-Default: \fIlonflip\fP = 0.
-.TP
-.B \-M
-\fImergefilename\fP
-.br
-If a merge file is specified then the bathymetry data and flags
-from the merge file will be written to the output file along with 
-the remaining data from the input file.
-This can be used to merge two processing streams, one for bathymetry
-data and the other for other data sets. The input file and merge file 
-must both be based on the same raw data.
-.TP
-.B \-N
-Normally, \fBmbcopy\fP generates a set of comment records at
-the beginning of the output stream which record when, how,
-and by whom \fBmbcopy\fP was run.  If the
-\fB\-N\fP flag is given, these comments are not included in 
-the output stream, and, in addition, any preexisting comment records
-in the input data stream are not passed to the output data stream.
-However, the \fB\-N\fP option does not affect the insertion of
-comments from a text file if specified using the \fB\-C\fP option.
-.TP
-.B \-O
-\fIoutfilename\fP
-.br
-Data file to which the output data will be written. If
-no output file is specified, the output will be written to
-stdout. Default: \fIoutfilename\fP = stdout.
-.TP
-.B \-P
-\fIpings\fP
-.br
-Sets the ping averaging of the input data. If \fIpings\fP = 1, then
-no ping averaging is performed. If \fIpings\fP > 0, then
-that number of input pings will be averaged to produce one output
-ping.  If \fIpings\fP = 0, then the ping averaging will automatically
-be done so that the along-track ping spacing is equal to the across-track
-beam spacing. If ping averaging is used (\fIpings\fP != 1), then
-only a partial data stream can be copied (see the \fB\-F\fP option).
-Default: \fIpings\fP = 1 (no ping averaging).
-.TP
-.B \-Q
-\fIsleep_factor\fP
-.br
-Causes the program to sleep before writing each data record, thus simulating
-a simple data logger. The amount of time slept is the time between the
-previous and current pings times the value \fIsleep_factor\fP.
-Default: \fIsleep_factor\fP = 1.0
-.TP
-.B \-R
-\fIwest/east/south/north\fP
-.br
-Sets the longitude and latitude bounds within which swath sonar 
-data will be read. Only the data which lies within these bounds will
-be copied. 
-Default: \fIwest\fP=\-360, east\fI=360\fP, \fIsouth\fP=\-90, \fInorth\fP=90.
-.TP
-.B \-S
-\fIspeed\fP
-.br
-Sets the minimum speed in km/hr (5.5 kts ~ 10 km/hr) allowed in 
-the input data; pings associated with a smaller ship speed will not be
-copied. Default: \fIspeed\fP = 0.
-.TP
-.B \-T
-\fItimegap\fP
-.br
-Sets the maximum time gap in minutes between adjacent pings allowed before
-the data is considered to have a gap. Default: \fItimegap\fP = 1.
-.TP
-.B \-V
-Normally, \fBmbcopy\fP works "silently" without outputting
-anything to the stderr stream.  If the
-\fB\-V\fP flag is given, then \fBmbcopy\fP works in a "verbose" mode and
-outputs the program version being used, all error status messages, 
-and the number of records input and output.
-
-.SH EXAMPLES
-Suppose one wishes to copy a raw Hydrosweep file (format 21) called hs_raw into a
-L-DEO binary Hydrosweep file (format 24) called hs_binary while windowing the data
-into a region between 145W and 140W longitude and between 10S and 5S
-longitude. The following will suffice:
- 	mbcopy \-P1 \-F21/24 \-R-145/-140/-10/-5 \-Ihs_raw \-Ohs_binary
-
-Suppose one has a program called thrash_prog which requires Hydrosweep
-data to be input in the URI format (format 23) to stdin, but the existing
-data is in a raw Hydrosweep file (format 21).  The following will work:
- 	mbcopy \-P1 \-F21/23 | thrash_prog
-
-where a pipe (|) has been used to direct the stdout stream from \fBmbcopy\fP
-to the stdin stream of thrash_prog.
-
-Suppose one has some raw data from a Simrad EM300 that has been cleaned and processed
-by a third party using other software and exported as a GSF file, but one wants to 
-access the original Simrad attitude and backscatter data with the corrected bathymetry 
-data.  The following will work:
- 	mbcopy \-F56/57/121 \-I0015_20040212_052714_raw.all \-M20040212_052714.gsf \-O20040212_052714.mb57
-
-.SH SEE ALSO
-\fBmbsystem\fP(1), \fBmbio\fP(1)
-
-.SH BUGS
-Certainly.
diff --git a/src/man/man1/mbctdlist.1 b/src/man/man1/mbctdlist.1
deleted file mode 100644
index 3c10b65..0000000
--- a/src/man/man1/mbctdlist.1
+++ /dev/null
@@ -1,195 +0,0 @@
-.TH mbctdlist 1 "3 June 2013" "MB-System 5.0" "MB-System 5.0"
-.SH NAME
-\fBmbctdlist\fP \- List CTD data in swath sonar data files.
-
-.SH VERSION
-Version 5.0
-
-.SH SYNOPSIS
-\fBmbctdlist\fP [\fB\-A\fP \fB\-D\fP\fIdecimate\fP \fB\-F\fP\fIformat\fP
-\fB\-G\fP\fIdelimeter\fP \fB\-H\fP \fB\-I\fP\fIfile \fP
-\fB\-O\fP\fIoutput_format\fP \fB\-V\fP \fB\-Z\fP\fIsegment\fP]
-
-.SH DESCRIPTION
-\fBMBctdlist\fP prints the specified contents of CTD records
-in a swath sonar data file to stdout. CTD stands for conductivity,
-temperature, and depth (pressure). Some seafoor mapping sonar platforms
-(e.g. ROVs or AUVs) carry CTDs. The CTD data may be included in the
-sonar data stream to enable calculation of water sound speed for use
-in sonar settings and/or data processing. In addition to the raw
-conductivity (S/m), temperature (degree C), and pressure (dBar) data,
-salinity (ppu), depth (m), and water sound speed (m/s) are typically
-available by calculation.\fBMBctdlist\fP can also output navigation
-and time stamp values. By default, \fBmbctdlist\fP  produces ASCII files in
-spreadsheet style, with data columns separated by tabs. Alternatively,
-other column delimiters can be used (\fB\-G\fP option), or
-the output can be binary, with each field represented
-as a double precision float (\fB\-A\fP option). The
-option \fB\-O\fP\fIoutput_format\fP is
-used to control the data types that are sent to stdout. The output stream can
-be decimated using the \fB\-D\fP option. The output of
-\fBmbctdlist\fP can be piped to plotting and data analysis programs.
-
-.SH AUTHORSHIP
-David W. Caress (caress at mbari.org)
-.br
-  Monterey Bay Aquarium Research Institute
-.br
-Dale N. Chayes (dale at ldeo.columbia.edu)
-.br
-  Lamont-Doherty Earth Observatory
-.br
-
-.SH OPTIONS
-.TP
-.B \-A
-.br
-Causes the output to be binary (native double precision floating
-point) rather than ASCII. Some
-output options cannot be represented as single binary floats (e.g.
-time strings and longitude or latitude broken into degrees
-and minutes. These values are output as multiple fields as
-appropriate.
-Default: ASCII output with fields separated by tabs.
-.TP
-.B \-D
-\fIdecimate\fP
-.br
-Sets the decimation of the output data. By default (i.e. \fIdecimate\fP=1),
-every available data record is output. If \fIdecimate\fP>1, then only
-every "\fIdecimate\fP"th record will be output. Default: \fIdecimate\fP=1.
-.TP
-.B \-F
-\fIformat\fP
-.br
-Sets the format for the input swath sonar data using
-\fBMBIO\fP integer format identifiers.
-This program uses the \fBMBIO\fP library and will read any swath sonar
-format supported by \fBMBIO\fP. A list of the swath sonar data formats
-currently supported by \fBMBIO\fP and their identifier values
-is given in the \fBMBIO\fP manual page. Default: \fIformat\fP = 11.
-.TP
-.B \-G
-\fIdelimiter\fP
-.br
-Sets the character(s) used to separate output fields when ascii
-columns are output. Default: tabs are used as delimiters.
-.TP
-.B \-H
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-.TP
-.B \-I
-\fIfile\fP
-.br
-Sets the input filename. If \fIformat\fP > 0 (set with the
-\fB\-F\fP option) then the swath sonar data contained in \fIfile\fP
-is read and processed. If \fIformat\fP < 0, then \fIfile\fP
-is assumed to be an ascii file containing a list of the input swath sonar
-data files to be processed and their formats.  The program will read
-the data in each one of these files.
-In the \fIfile\fP file, each
-data file should be followed by a data format identifier, e.g.:
- 	datafile.mb88 88
- 	datafile.mb88 88
-.br
-This program uses the \fBMBIO\fP library and will read any swath sonar
-format supported by \fBMBIO\fP. However, only files in formats supporting
-CTD data will contain relevant data and produce an output.
-A list of the swath sonar data formats
-currently supported by \fBMBIO\fP and their identifier values
-is given in the \fBMBIO\fP manual page.
-Default: \fIfile\fP = "datalist.mb-1".
-.TP
-.B \-L
-\fIlonflip\fP
-.br
-Sets the range of the longitude values returned.
-If \fIlonflip\fP=\-1 then the longitude values will be in
-the range from \-360 to 0 degrees. If \fIlonflip\fP=0
-then the longitude values will be in
-the range from \-180 to 180 degrees. If \fIlonflip\fP=1
-then the longitude values will be in
-the range from 0 to 360 degrees.
-Default: \fIlonflip\fP = 0.
-.TP
-.B \-O
-\fIoutput_format\fP
-.br
-Determines the form of the output. \fIOutput_format\fP is a string composed
-of one or more of the following characters:
-
- 	\fBC\fP  for conductivity (S/m)
- 	\fB^C\fP for sonar altitude (meters)
- 	\fBc\fP  for temperature (degree C)
- 	\fB^c\fP for sonar depth (meters)
- 	\fBH\fP  for heading (degrees)
- 	\fBh\fP  for course made good (degrees)
-  	\fBJ\fP  for a time string (yyyy jd hh mm ss.ssssss)
-                 where jd is the julian day of the year
-  	\fBj\fP  for a time string (yyyy jd dm ss.ssssss)
-                 where jd is the julian day of the year
-                 and dm is the minute of the day
- 	\fBL\fP  for cumulative along-track distance (km)
- 	\fBl\fP  for cumulative along-track distance (m)
- 	\fBM\fP  for unix time in decimal seconds since 1/1/70 00:00:00
- 	\fBm\fP  for time in decimal seconds since first record
-  	\fBP\fP  for potential temperature (degree)
-  	\fBS\fP  for salinity (ppu)
-  	\fB^S\fP for speed (km/hr)
-  	\fBs\fP  for water sound speed (m/s)
-  	\fB^s\fP for speed made good (km/hr)
-  	\fBT\fP  for a time string (yyyy/mm/dd/hh/mm/ss)
- 	\fBt\fP  for a time string (yyyy mm dd hh mm ss)
- 	\fBU\fP  for unix time in integer seconds since 1/1/70 00:00:00
- 	\fBu\fP  for time in integer seconds since first record
- 	\fBV\fP  for ping interval (decimal seconds)
- 	\fBX\fP  for longitude (decimal degrees)
- 	\fBx\fP  for longitude (degrees + decimal minutes + E/W)
- 	\fBY\fP  for latitude (decimal degrees)
- 	\fBy\fP  for latitude (degrees + decimal minutes + N/S)
-
-Default \fIoutput_format\fP = \fBTXYCc^cSs\fP (Time, lon, lat, conductivity,
-temperature, depth, salinity, sound speed).
-.TP
-.B \-V
-Normally, \fBmbctdlist\fP works "silently" without outputting
-anything to the stderr stream.  If the
-\fB\-V\fP flag is given, then \fBmbctdlist\fP works in a "verbose" mode and
-outputs the program version being used and all error status messages.
-.TP
-.B \-Z
-\fIsegment\fP
-.br
-Causes the ascii output of different input swath files
-(e.g. when a datalist is specified with the \fB\-I\fP option)
-to be separated by lines with \fIsegment\fP. If \fIsegment\fP
-is a single character, then the output is a multiple segment
-file of the sort accepted by the \fBGMT\fP program \fBpsxy\fP.
-This option only works with ascii output, and is thus disabled
-when the \fB\-A\fP option is specified. The most common usage
-is \fB\-Z\fP\I>\fP.
-
-.SH EXAMPLES
-Suppose one wishes to obtain a ctd list from a Reson 7125 data file
-in the 7k format (MBIO id 88) called 20080904_231809p.mb88. To
-obtain a listing with time in unix second forms followed
-by longitude, latitude, and salinity, the following will suffice:
-
- 	mbctdlist \-i 20080904_231809p.mb88 \-OMXYS | more
-
-The output will be as follows:
-
- 	1220570288.486000       \-129.066699       47.997246     34.305
- 	1220570288.685999       \-129.066702       47.997245     34.304
- 	1220570288.885999       \-129.066706       47.997244     34.305
- 	1220570289.086000       \-129.066710       47.997243     34.305
- 	1220570289.286000       \-129.066713       47.997242     34.304
- 	.....
-
-.SH SEE ALSO
-\fBmbsystem\fP(1), \fBmbinfo\fP(1)
-
-.SH BUGS
-\fBmbctdlist\fP initially only works with data in the MBF_RESON7KR format (MBIO format id 88)
-supporting Reson 7k series multibeam sonars.
diff --git a/src/man/man1/mbdatalist.1 b/src/man/man1/mbdatalist.1
deleted file mode 100644
index 3a47d0f..0000000
--- a/src/man/man1/mbdatalist.1
+++ /dev/null
@@ -1,381 +0,0 @@
-.TH mbdatalist 1 "3 June 2013" "MB-System 5.0" "MB-System 5.0"
-.SH NAME
-\fBmbdatalist\fP \- parses recursive datalist files and outputs the
-complete list of data files, formats, and file weights.
-
-.SH VERSION
-Version 5.0
-
-.SH SYNOPSIS
-\fBmbdatalist\fP [\fB\-C\fP \fB\-F\fP\fIformat\fP \fB\-I\fP\fIfilename\fP \fB\-N \-O \-P \-Q \-R \-S \-U \-Y \-Z \-V \-H\fP]
-
-.SH DESCRIPTION
-\fBMBdatalist\fP is a utility for parsing datalist files.
-Datalist files, or lists of swath data files and their format ids,
-are used by a number
-of \fBMB-System\fP programs. These lists may contain references
-to other datalists, making them recursive. See the \fBMB-System\fP
-manual page for details on the format and structure of datalists.
-The program \fBmbdatalist\fP outputs each
-swath data filename, format id, and file
-weight encountered as it descends through the input datalist tree. If a
-swath data file rather than a datalist is provided as input, the
-same swath data filename and format will be the sole output.
-
-This program
-can be used in shellscripts to read datalists in the same fashion
-as \fBMB-System\fP programs like \fBmbgrid\fP and \fBmbprocess\fP.
-This program can also be used to check and debug complex recursive
-datalist structures.
-
-The program \fBmbprocess\fP operates on "raw" swath data files,
-producing a "processed" swath data file (see the \fBmbprocess\fP man
-page for explanation).
-The \fBMB-System\fP algorithm for reading datalists will,
-if a flag is set, replace a swath file name with the associated
-"processed" file name when that "processed" file exists. This
-flag may be set by embedding "$PROCESSED" as a line in a datalist
-or it may be set first by the calling program. The flag may also
-be set to preclude reporting "processed" file names (embedding "$RAW"
-in a datalist accomplishes this). When setting this flag within
-datalists, the first encounter of a $PROCESSED or $RAW tag will
-prevail over later instances of either tag. The \fB\-P\fP and \fB\-U\fP
-options force \fBmbdatalist\fP to output processed file names
-when they exist (\fB\-P\fP) or to only output unprocessed
-(raw) file names (\fB\-U\fP).
-
-Programs such as \fBmbgrid\fP try to check statistics or "inf"
-files to see if the corresponding data files include data within
-the specified geographic bounds. Other programs look for
-"fast bathymetry" or "fast navigation" ("fbt" or "fnv") files
-in order to read the data more quickly. The \fB\-N\fP option causes
-\fBmbdatalist\fP to create these three types of ancillary files
-for each swath data file. The \fB\-O\fP option causes \fBmbdatalist\fP
-to create the "inf", "fbt", and "fnv" files only when they don't
-already exist or are out of date (older than the data file).
-
-Datalists may also contain a third value, called the grid
-weight, which is used by \fBmbgrid\fP to priortize data.
-The larger the grid weight, the more importance \fBmbgrid\fP
-attaches to the related bathymetry data. Grid weights can
-be applied to datalist entries which are themselves datalist
-files, causing these weights to be associated with all of
-files referenced therein. However, the default behavior is
-for any grid weight in a particular datalist entry to override
-values derived from higher levels in the recursive structure.
-This behavior can be reversed if a $NOLOCALWEIGHT tag is placed
-in the datalist, or in a datalist higher up in the structure.
-See the \fBMB-System\fP manual page for a more complete
-description.
-
-The \fB\-R\fP\fIw/e/s/n\fP option causes the program to check each
-data file with an "inf" file for overlap with the desired bounds,
-and only report those files with data in the desired area (or no
-"inf" file to check). This behavior mimics that of \fBmbgrid\fP,
-allowing users to check what data files will contribute to gridding
-some particular area.
-
-The \fB\-Q\fP option causes the program to check each data file for
-the existence of any ancillary files (e.g. navigation files, edit
-save files, etc.) referenced in its mbprocess parameter file
-(if the parameter file exists). The program will list any problem
-found with the processing parameters, and will also list any
-data problem noted in the "inf" files. The possible data problems
-include:
-        No survey data found
-        Zero longitude or latitude in survey data
-        Instantaneous speed exceeds 25 km/hr
-        Average speed exceeds 25 km/hr
-        Sounding depth exceeds 11000 m
-        Unsupported Simrad datagram
-
-The \fB\-Z\fP option causes the program to generate a datalist file
-named "datalistp.mb-1" and then exit. This datalist has the following form:
-.br
- 	$PROCESSED
- 	datalist.mb-1 \-1
-.br
-This file is a commonly used convenience because it allows users to easily
-reference the swath files listed (directly or recursively) through
-the datalist "datalist.mb-1" with the $PROCESSED flag on. So, in order to
-grid the processed bathymetry rather than the raw bathymetry, run \fBmbgrid\fP
-with "datalistp.mb-1" as the input rather than "datalist.mb-1".
-
-The \fB\-S\fP option causes \fBmbdatalist\fP to report the status of the files
-it lists, including whether the file is up to date or needs reprocessing,
-and if the file is locked. \fBMBprocess\fP sets locks while operating on
-a swath file to prevent other instances of \fBmbprocess\fP from simultaneously
-operating on that same file. This allows one to run \fBmbprocess\fP multiple
-times simultaneously on a single datalist, either on a single multiprocessor
-machine or on multiple computers mounting the same filesystem.
-The consists of creating a small text file
-named by appending ".lck" to the swath filename; while this file exists
-other programs will not modify the locked file. The locking program deletes
-the lock file when it is done. Orphaned lock files may be left if \fBmbprocess\fP
-crashes or is interrupted. These will prevent reprocessing by \fBmbprocess\fP,
-but can be both detected with the \fB\-S\fP option and removed using the \fB\-Y\fP option.
-
-Finally, this program can be used to copy the swath files referenced in a
-datalist structure to a single directory and to create a datalist there
-(names "datalist.mb-1") that references those swath files. This is
-accomplished using the \fI-C\fP option. The \fI-C\fP copy function will
-not be done if the \fI-N\fP, \fI-O\fP, or \fI-Q\fP options are specified,
-but is compatible with the \fI-P\fP, \fI-R\fP, and \fI-U\fP options.
-
-.SH AUTHORSHIP
-David W. Caress (caress at mbari.org)
-.br
-  Monterey Bay Aquarium Research Institute
-.br
-Dale N. Chayes (dale at ldeo.columbia.edu)
-.br
-  Lamont-Doherty Earth Observatory
-
-.SH OPTIONS
-.TP
-.B \-C
-.br
-Causes the swath files referenced in the input datalist structure to be
-copied to the current directory and creates a datalist
-(names "datalist.mb-1") that references the copied swath files.
-The copy function will not be done if the \fI-N\fP, \fI-O\fP, or \fI-Q\fP options are specified.
-If the \fI-P\fP, \fI-R\fP, and \fI-U\fP options are specified these
-functions will modify which swath files are copied. Any ancilliary files
-(e.g. *inf metadata files) will also be copied, but processed data
-files derived from the target copied files will not be copied.
-.TP
-.B \-F
-\fIformat\fP
-.br
-Sets the data format associated with the datalist or swath data
-file specified with the \fB\-I\fP option. By default, this program
-will attempt to determine the format from the input file suffix
-(e.g. a file ending in .mb57 has a format id of 57, and a file
-ending in .mb-1 has a format id of \-1). A datalist has a format id
-of \-1.
-.TP
-.B \-H
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-.TP
-.B \-I
-\fIfilename\fP
-.br
-Sets the input filename. If \fIformat\fP > 0 (set with the
-\fB\-f\fP option) then the swath data filename specified by \fIinfile\fP
-is output along with its format and a file weight of 1.0.
-If \fIformat\fP < 0, then \fIinfile\fP
-is treated as a datalist file containing a list of the input swath sonar
-data files to be processed and their formats.  The program will parse
-the datalist (recursively, if necessary) and output each swath filename
-and the associated format and file weight.
-.TP
-.B \-N
-This argument causes \fBMBdatalist\fP to generate three types of ancillary
-data files ("inf", "fbt", and "fnv").
-In all cases,
-the ancillary filenames are just the original filename with
-".inf", ".fbt", or ".fnv" appended on the end.
-\fBMB-System\fP makes use of ancillary data files in a number
-of instances. The most prominent ancillary files are metadata or
-"inf" files (created from the output of \fBmbinfo\fP).
-Programs such as \fBmbgrid\fP and \fBmbm_plot\fP try to check "inf"
-files to see if the corresponding data files include data within
-desired areas. Additional ancillary files are used to speed
-plotting and gridding functions. The "fast bath" or "fbt" files
-are generated by copying the swath bathymetry to a sparse,
-quickly read format (format 71). The "fast nav" or "fnv" files
-are just ASCII lists of navigation generated using \fBmblist\fP
-with a \fB\-O\fP\fItMXYHSc\fP option. Programs such as \fBmbgrid\fP,
-\fBmbswath\fP, and \fBmbcontour\fP will try to read "fbt" and "fnv" files
-instead of the full data files whenever only bathymetry or
-navigation information are required.
-.TP
-.B \-O
-This argument causes \fBMBdatalist\fP to generate the three ancillary
-data files ("inf", "fbt", and "fnv") if
-these files don't already exist or are out of date.
-.TP
-.B \-P
-Normally, \fBmbdatalist\fP allows $PROCESSED and $RAW tags within
-the datalist files to determine whether processed file names are
-reported when available ($PROCESSED) or only raw file names are
-reported ($RAW). The \fB\-P\fP option forces \fBmbdatalist\fP
-to output processed file names when they exist.
-.TP
-.B \-Q
-This option causes the program to check each
-data file for the existence of any ancillary files
-referenced in its mbprocess parameter file
-(if the parameter file exists). The relevant ancillary
-files include edit save files generated by \fBmbedit\fP
-or \fBmbclean\fP, navigation files generated by \fBmbnavedit\fP
-or \fBmbnavadjust\fP, tide files, and svp files. An error message
-is output for each missing ancillary file.
-.TP
-.B \-R
-\fIw/e/s/n\fP
-.br
-The bounds of the desired area are set in longitude
-and latitude using w=west, e=east, s=south, and n=north.
-This option causes the program to check each
-data file with an "inf" file for overlap with
-the desired bounds, and only report those
-files with data in the desired area (or no
-"inf" file to check). This behavior mimics that of
-\fBmbgrid\fP, allowing users to check what data files will
-contribute to gridding some particular area.
-.TP
-.B \-S
-This option causes \fBmbdatalist\fP to report the status of the files
-it lists, including whether the file is up to date or needs reprocessing,
-and if the file is locked. \fBMBprocess\fP sets locks while operating on
-a swath file to prevent other instances of \fBmbprocess\fP from simultaneously
-operating on that same file. Locking consists of creating a small text file
-named by appending ".lck" to the swath filename; while this file exists
-other programs will not modify the locked file. The locking program deletes
-the lock file when it is done. Orphaned lock files may be left if \fBmbprocess\fP
-crashes or is interrupted. These will prevent reprocessing by \fBmbprocess\fP,
-but can be both detected and removed using \fBmbdatalist\fP.
-.TP
-.B \-U
-Normally, \fBmbdatalist\fP allows $PROCESSED and $RAW tags within
-the datalist files to determine whether processed file names are
-reported when available ($PROCESSED) or
-only (raw) unprocessed file names are
-reported ($RAW). The \fB\-U\fP option forces \fBmbdatalist\fP
-to only output raw file names.
-.TP
-.B \-V
-Normally, \fBmbdatalist\fP only prints out the filenames and formats.
-If the \fB\-V\fP flag is given, then \fBmbinfo\fP works in a "verbose" mode and
-outputs the program version being used.
-.TP
-.B \-Y
-This option causes \fBmbdatalist\fP to remove any processing locks on files
-it parses. \fBMBprocess\fP and other programs may set locks while
-operating on a swath file to prevent other programs from simultaneously
-operating on that same file.The consists of creating a small text file
-named by appending ".lck" to the swath filename; while this file exists
-other programs will not modify the locked file. The locking program deletes
-the lock file when it is done. Orphaned lock files may be left if \fBMB-System\fP
-programs crash or are interrupted. These can be detected using the \fB\-S\fP
-option of \fBmbdatalist\fP.
-.TP
-.B \-Z
-The \fB\-Z\fP option causes the program to generate a datalist file that
-will first set a $PROCESSED flag and then reference the input
-file specified using the \fB\-I\fP\fIfilename\fP option.
-The output datalist is named
-by adding a "p.mb-1" suffix to the root of the input file (the root is
-the portion before any \fBMB-System\fP suffix).
-.br
-By default, the input is assumed to be a datalist named datalist.mb-1, resulting
-in an output datalist named datalistp.mb-1 with the following contents:
-.br
- 	$PROCESSED
- 	datalist.mb-1 \-1
-.br
-If the input file is specified as a datalist like
-datalist_sslo.mb-1, then the output datalist
-datalist_sslop.mb-1
-will have the following contents:
-.br
- 	$PROCESSED
- 	datalist_sslo.mb-1 \-1
-.br
-If the input file is specified as a swath file like
-20050916122920.mb57, then the output datalist 20050916122920p.mb-1
-will have the following contents:
-.br
- 	$PROCESSED
- 	20050916122920.mb57 57
-
-.SH EXAMPLES
-Suppose we have two swath data files from an EM3000 multibeam
-and another two from an Hydrosweep MD multibeam. We might
-construct two datalist files. For the EM3000 we might
-have a file dlst_em3000.mb-1 containing:
- 	0004_20010705_165004_raw.mb57 57
- 	0005_20010705_172010_raw.mb57 57
-.br
-For the Hydrosweep MD data we might have a file dlst_hsmd.mb-1
-containing:
- 	al10107051649.mb102 102
- 	al10107051719.mb102 102
-
-Further suppose that we have found it necessary to edit
-the bathymetry in 0005_20010705_172010_raw.mb57 and
-al10107051719.mb102 using \fBmbedit\fP, and that \fBmbprocess\fP
-has been run on both files to generate processed files
-called 0005_20010705_172010_rawp.mb57 and
-al10107051719p.mb102.
-
-If we run:
- 	mbdatalist \-I dlst_em3000.mb-1
-.br
-the output is:
- 	0004_20010705_165004_raw.mb57 57 1.000000
- 	0005_20010705_172010_raw.mb57 57 1.000000
-.br
-Here the file name is followed by the format and then
-by a third column containing the default file weight of 1.0.
-
-Similarly, if we run:
- 	mbdatalist \-I dlst_hsmd.mb-1
-.br
-the output is:
- 	al10107051649.mb102 102 1.000000
- 	al10107051719.mb102 102 1.000000
-
-If we insert a line
- 	$PROCESSED
-.br
-at the top of both dlst_hsmd.mb-1 and dlst_em3000.mb-1,
-then the output of \fBmbdatalist\fP changes so that:
- 	mbdatalist \-I dlst_em3000.mb-1
-.br
-yields:
- 	0004_20010705_165004_raw.mb57 57 1.000000
- 	0005_20010705_172010_rawp.mb57 57 1.000000
-and:
- 	mbdatalist \-I dlst_hsmd.mb-1
-.br
-yields:
- 	al10107051649.mb102 102 1.000000
- 	al10107051719p.mb102 102 1.000000
-
-Now suppose we create a datalist file called dlst_all.mb-1
-that refers to the two datalists shown above (without the
-$PROCESSED tags). If the contents of dlst_all.mb-1 are:
- 	dlst_em3000.mb-1 \-1 100.0
- 	dlst_hsmd.mb-1   \-1   1.0
-.br
-where we have specified different file weights for the
-two datalists, then:
- 	mbdatalist \-I dlst_all.mb-1
-.br
-yields:
- 	0004_20010705_165004_raw.mb57 57 100.000000
- 	0005_20010705_172010_raw.mb57 57 100.000000
- 	al10107051649.mb102 102 1.000000
- 	al10107051719.mb102 102 1.000000
-
-Now, if we use the \fB\-P\fP option to force \fBmbdatalist\fP
-to output processed data file names when possible, then:
- 	mbdatalist \-I dlst_all.mb-1 \-P
-.br
-yields:
- 	0004_20010705_165004_raw.mb57 57 100.000000
- 	0005_20010705_172010_rawp.mb57 57 100.000000
- 	al10107051649.mb102 102 1.000000
- 	al10107051719p.mb102 102 1.000000
-
-.SH SEE ALSO
-\fBmbsystem\fP(1)
-
-.SH BUGS
-No true bugs here, only distantly related arthropods... Yum.
-Seriously, it would be better if the copy function preserved
-the modification times of the copied swath files and ancilliary
-files. Copying of processed files should also be an option.
diff --git a/src/man/man1/mbdefaults.1 b/src/man/man1/mbdefaults.1
deleted file mode 100644
index af2d019..0000000
--- a/src/man/man1/mbdefaults.1
+++ /dev/null
@@ -1,234 +0,0 @@
-.TH mbdefaults 1 "5 September 2014" "MB-System 5.0" "MB-System 5.0"
-.SH NAME
-\fBmbdefaults\fP \- Set or list default mbio parameters for
-reading and writing swath sonar data
-
-.SH VERSION
-Version 5.0
-
-.SH SYNOPSIS
-\fBmbdefaults\fP [\fB\-B\fP\fIfileiobuffer\fP \fB\-D\fP\fIpsdisplay\fP \fB\-F\fP\fIfbtversion\fP  \fB\-I\fP\fIimagedisplay\fP
-\fB\-L\fP\fIlonflip\fP \fB\-M\fP\fImbviewsettings\fP \fB\-T\fP\fItimegap\fP \fB\-U\fP\fIuselockfiles\fP
-\fB\-W\fP\fIproject\fP \fB\-V \-H\fP]
-
-.SH DESCRIPTION
-\fBmbdefaults\fP is a utility for setting or listing the default read
-parameters used by some \fBMBIO\fP utilities such as \fBMBcopy\fP or \fBMBgrdviz\fP.
-If a user wishes to set default
-parameters different from those set by the \fBMBIO\fP library, then
-these specialized default values must be stored
-in the file .mbio_defaults in the users home directory.  If any option
-flag is given in invoking \fBmbdefaults\fP, then a new .mbio_defaults
-file will be written incorporating the newly set parameters along with
-any old parameters which have not been reset. If no option flag
-is given, then \fBmbdefaults\fP will list the current default values
-(set by \fBmbio\fP if no .mbio_defaults file exists).
-
-.SH CHANGES FROM VERSION 4.6
-Note that prior to version 5.0, the \fBMB-System\fP defaults
-set by \fBmbdefaults\fP included the format id, a control for
-ping averaging, longitude and latitude bounds for windowing
-by area, and begin and end times for windowing in time. These
-values are no longer set in the .mbio_defaults file or controlled
-by \fBmbdefaults\fP.
-
-.SH AUTHORSHIP
-David W. Caress (caress at mbari.org)
-.br
-  Monterey Bay Aquarium Research Institute
-.br
-Dale N. Chayes (dale at ldeo.columbia.edu)
-.br
-  Lamont-Doherty Earth Observatory
-
-.SH OPTIONS
-.TP
-.B \-B
-\fIfileiobuffer\fP
-.br
-Sets the file i/o block buffer size for certain formats (currently formats 88 and 58).
-The \fIfileiobuffer\fP value is in kilobytes, so \fIfileiobuffer\fP = 1000 corresponds
-rougly to a one megabyte buffer.
-This option allows users to optimize i/o speed of certain large and complex data formats
-(e.g Reson 7k and current generation Kongsberg multibeam) by increasing the block buffer
-size from the system default. Making the buffer size larger generally has benefit only
-when reading over a network; this option has little impact for filesystems mounted from
-locally attached hard drives. At MBARI, where our primary data storage is accessed over
-a gigabit ethernet network, setting \fIfileiobuffer\fP = 10000 achieves an 8% run time reduction
-for \fBmbprocess\fP. Default: \fIfileiobuffer\fP = 0, which corresponds to the system
-default.
-.TP
-.B \-D
-\fIpsdisplay\fP
-.br
-Sets the program used for displaying Postscript graphics files
-on a screen; this facility is used by shellscripts created through
-macros like \fBmbm_plot\fP. The default Postscript display
-utility is \fBgv\fP. Another common Postscript display utilities
-is \fBghostview\fP; past postscript viewers included \fBpageview\fP
-(for Sun workstations) and \fBxpsview\fP (for Silicon Graphics workstations).
-.TP
-.B \-F
-\fIfbtversion\fP
-.br
-Set the version of fbt files created by \fBmbdatalist\fP and \fBmbprocess\fP.
-If \fIfbtversion\fP = 2, "old", or "OLD", then the pre-5.3.1897 version of
-format 71 will be used to write the "fast bathymetry" or "*.fbt" files.
-If \fIfbtversion\fP = 3, "new", or "NEW", then the new, 5.3.1897-or-later version of
-format 71 will be used to write the "fast bathymetry" or "*.fbt" files.
-
-.TP
-.B \-H
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-.TP
-.B \-I
-\fIimagedisplay\fP
-.br
-Sets the program used for displaying Tiff image files
-on a screen; this facility is used by shellscripts created through
-macros like \fBmbm_grdtiff\fP. The default image display
-utility is \fBxv\fP. Other common image display utilities
-are \fBgimp\fP (GNU image processing) and \fBgqview\fP.
-.TP
-.B \-L
-\fIlonflip\fP
-.br
-Sets the range of the longitude values returned.
-If \fIlonflip\fP=\-1 then the longitude values will be in
-the range from \-360 to 0 degrees. If \fIlonflip\fP=0
-then the longitude values will be in
-the range from \-180 to 180 degrees. If \fIlonflip\fP=1
-then the longitude values will be in
-the range from 0 to 360 degrees.
-Default: \fIlonflip\fP = 0.
-.TP
-.B \-MP
-\fIcolortable/colortable_mode/shade_mode\fP
-.br
-Sets the default colortable, colortable mode, and shading mode for
-the programs \fBMBgrdviz\fP and \fBMBeditviz\fP. The \fIcolortable\fP identifiers are
-similar to those used for \fBmbm_grdplot\fP:
-        0 = Haxby colortable
-        1 = Bright colortable
-        2 = Muted colortable
-        3 = Grayscale colortable
-        4 = Flat Gray colortable
-        5 = Sealevel 1 colortable
-        6 = Sealevel 2 colortable
-.br
-The \fIcolortable_mode\fP refers to whether low values
-are represented by "cool" colors (e.g. blue) and high values
-by "hot" colors (e.g. red), which corresponds to \fIcolortable_mode\fP = 0,
-or the opposite, which corresponds to \fIcolortable_mode\fP = 1.
-
-The \fIshade_mode\fP value determines whether shading is off
-(\fIshade_mode\fP = 0), done by illumination(\fIshade_mode\fP = 1),
-or done using slope magnitude (\fIshade_mode\fP = 2). Shading by overlay
-cannot be a default because overlay data are not always defined.
-.TP
-.B \-MG
-\fIslope_colortable/slope_colortable_mode\fP
-.br
-Sets the default colortable and colortable mode for displays of slope
-using the programs \fBMBgrdviz\fP and \fBMBeditviz\fP.
-The colortable and colortable mode identifiers are the same as given
-above for \fB-MP\fP.
-.TP
-.B \-MO
-\fIsecondary_colortable/secondary_colortable_mode\fP
-.br
-Sets the default colortable and colortable mode for displays of 
-overlay data using the programs \fBMBgrdviz\fP and \fBMBeditviz\fP.
-The colortable and colortable mode identifiers are the same as given
-above for \fB-MP\fP.
-.TP
-.B \-MI
-\fImagnitude/elevation/azimuth\fP
-.br
-Sets the default parameters for shading by illumination using the
-programs \fBMBgrdviz\fP and \fBMBeditviz\fP.
-The \fIelevation\fP and \fIazimuth\fP values are in degrees.
-.TP
-.B \-MS
-\fImagnitude\fP
-.br
-Sets the default parameter for shading by slope magnitude using the
-programs \fBMBgrdviz\fP and \fBMBeditviz\fP.
-.TP
-.B \-T
-\fItimegap\fP
-.br
-Sets the maximum time gap in minutes between adjacent pings allowed before
-the data is considered to have a gap. Default: \fItimegap\fP = 1.
-.TP
-.B \-U
-\fIuselockfiles\fP
-.br
-Sets whether \fBMB-System\fP uses the file locking mechanism to insure that
-a swath file is only processed or edited by a single program at a time.
-To revert to pre-lockfile behavior for \fBmbedit\fP, \fBmbeditviz\fP,
-\fBmbclean\fP, \fBmbareaclean\fP, \fBmbnavedit\fP, and \fBmbprocess\fP,
-use \fB\-U\fP\fI0\fP or  \fB\-U\fP\fIno\fP. To reinstate use of lock files,
-use \fB\-U\fP\fI1\fP or  \fB\-U\fP\fIyes\fP.
-.TP
-.B \-V
-Normally, \fBmbdefaults\fP outputs only a list of the default values
-to the stdout stream.  If the
-\fB\-V\fP flag is given, then \fBmbdefaults\fP works in a "verbose" mode and
-also outputs the program version being used.
-.TP
-.B \-W
-\fIproject\fP
-.br
-Sets the name of the default project. This will be used by
-MB-System database management utilities yet to be created.
-Default: \fIproject\fP = "none".
-
-.SH EXAMPLES
-Suppose that one wishes the default Postscript viewer to
-be xpsview rather than gv.
-The following will suffice to create (or rewrite)
-a .mbio_defaults file in the users home directory:
-	mbdefaults \-Dxpsview
-
-The output will be:
-
- New MBIO Default Control Parameters:
- lonflip:  0
- timegap:  1.000000
- ps viewer:  xspsview
- img viewer: xv
- project:    none
- fbtversion: 3 (new)
- uselockfiles: 1
- fileiobuffer: 10000 (use 10000 kB buffer for fread() & fwrite())
-
-Suppose that one just wishes to see what the current default
-parameters are.  The following will suffice:
-	mbdefaults
-
-The output will be
-
- Current MBIO Default Control Parameters:
- lonflip:    0
- timegap:    1.000000
- ps viewer:  ghostview
- img viewer: xv
- project:    none
- fbtversion: 3 (new)
- uselockfiles: 1
- fileiobuffer: 10000 (use 10000 kB buffer for fread() & fwrite())
-
-.SH SEE ALSO
-\fBmbsystem\fP(1), \fBmbio\fP(1), \fBmbcontour\fP(1),
-\fBmbswath\fP(1), \fBmbgrdtiff\fP(1),
-\fBmbm_plot\fP(1), \fBmbm_grdplot\fP(1),
-\fBmbm_grd3dplot\fP(1), \fBmbm_xyplot\fP(1), \fBmbm_grdtiff\fP(1)
-
-.SH BUGS
-Too simple to have any really interesting bugs.
-
-Well, ok, this program occassionally runs wild, destroying filesystems
-and eating young children. But don't worry, it could never
-happen to you...
diff --git a/src/man/man1/mbdumpesf.1 b/src/man/man1/mbdumpesf.1
deleted file mode 100644
index f9efba2..0000000
--- a/src/man/man1/mbdumpesf.1
+++ /dev/null
@@ -1,118 +0,0 @@
-.TH mbdumpesf 1 "3 May 2015" "MB-System 5.0" "MB-System 5.0"
-.SH NAME
-\fBmbdumpesf\fP \- Output beam edits from a binary edit save file, either in the binary form or as an ASCII text dump.
-
-.SH VERSION
-Version 5.0
-
-.SH SYNOPSIS
-\fBmbdumpesf\fP \fB\-\-input=\fP\fIfile\fP
-[\fB\-\-output=\fP\fIfile\fP \fB\-\-ignore-unflag\fP \fB\-\-ignore-flag\fP
-\fB\-\-ignore-filter\fP \fB\-\-ignore-zero\fP \fB\-\-verbose\fP \fB\-\-help\fP]
-
-.SH DESCRIPTION
-Swath bathymetry data is typically edited either with interactive
-tools such as \fBmbedit\fP or automatic filters such as \fBmbclean\fP.
-In \fBMB-System\fP, the beam flags are stored in binary "edit save files"
-(file suffix ".esf"). The program \fBmbdumpesf\fP reads and outputs esf files. If
-no output file is specified, then each of the edit events is written in ASCII text
-as a single line to stdout. If an output file is specified with the \fB\-\-output=\fP\fIfile\fP
-option, then the edit save data will be written to that file in binary form.
-
-The four types of edit events supported by esf files are:
-.br
- 	action=1: flag manually
- 	action=2: unflag
- 	action=3: zero \- make beam null
- 	action=4: flag by autofilter
-.br
-This program can be forced to ignore (exclude from the output) any of the event
-types using the options \fB\-\-ignore-unflag\fP, \fB\-\-ignore-flag\fP,
-\fB\-\-ignore-filter\fP, and \fB\-\-ignore-zero\fP.
-
-.SH AUTHORSHIP
-David W. Caress (caress at mbari.org)
-.br
-  Monterey Bay Aquarium Research Institute
-.br
-Dale N. Chayes (dale at ldeo.columbia.edu)
-.br
-  Lamont-Doherty Earth Observatory
-
-.SH MBDUMPESF OPTIONS
-.TP
-\fB\-\-input=\fP\fIfile\fP
-"Edit save file" (esf file) from which the edit events will be read.
-.TP
-\fB\-\-output=\fP\fIfile\fP
-Specifies output esf file. If this option is not used, then the edit
-event stream will be output to stdout as a sequence of ASCII text lines.
-.TP
-\fB\-\-ignore-unflag\fP
-Causes \fBmbdumpesf\fP to not output any unflag edit events read from
-the input.
-.TP
-\fB\-\-ignore-flag\fP
-Causes \fBmbdumpesf\fP to not output any flag edit events read from
-the input.
-.TP
-\fB\-\-ignore-filter\fP
-Causes \fBmbdumpesf\fP to not output any filter edit events read from
-the input.
-.TP
-\fB\-\-ignore-zero\fP
-Causes \fBmbdumpesf\fP to not output any zero edit events read from
-the input.
-.TP
-\fB\-\-verbose\fP
-Normally, \fBmbdumpesf\fP outputs one line for each edit event in
-the input esf file.  If the
-\-\-verbose flag is given, then \fBmbdumpesf\fP also outputs the
-total number of each type of edit event at the end of the listing.
-.TP
-\fB\-\-help\fP
-This "help" flag causes the program to print out a description
-of its operation and then exit immediately.
-
-.SH EXAMPLES
-Suppose one has edited a swath file 20080422_222636.mb88, resulting
-in an esf file named 20080422_222636.mb88.esf. To dump the edit events
-as a text stream, use \fBmbdumpesf\fP:
-.br
- 	mbdumpesf \-I 20080422_222636.mb88.esf
-.br
-The output will look something like:
-.br
-
-.br
-EDITS READ: i:0 time: 947562291.799000 2008/04/22 22:26:36.799000 beam:21 action:1
-.br
-EDITS READ: i:1 time: 947562291.799000 2008/04/22 22:26:36.799000 beam:22 action:1
-.br
-EDITS READ: i:2 time: 947562291.799000 2008/04/22 22:26:36.799000 beam:23 action:1
-.br
-EDITS READ: i:3 time: 947562291.799000 2008/04/22 22:26:36.799000 beam:24 action:1
-.br
-EDITS READ: i:4 time: 947562291.799000 2008/04/22 22:26:36.799000 beam:25 action:1
-.br
-EDITS READ: i:5 time: 947562291.799000 2008/04/22 22:26:36.799000 beam:26 action:1
-.br
-EDITS READ: i:6 time: 947562291.799000 2008/04/22 22:26:36.799000 beam:27 action:1
-.br
-EDITS READ: i:7 time: 947562291.799000 2008/04/22 22:26:36.799000 beam:28 action:1
-.br
-
-.br
-Here the large time value is epoch seconds (seconds since 1/1/1970), and the
-edit event action values are:
-.br
- 	action=1: flag manually
- 	action=2: unflag
- 	action=3: zero \- make beam null
- 	action=4: flag by autofilter
-
-.SH SEE ALSO
-\fBmbsystem\fP(1), \fBmbedit\fP(1), \fBmbeditviz\fP(1), fBmbclean\fP(1), \fBmbunclean\fP(1)
-
-.SH BUGS
-Too simple to have any interesting problems.
diff --git a/src/man/man1/mbedit.1 b/src/man/man1/mbedit.1
deleted file mode 100644
index c89bc33..0000000
--- a/src/man/man1/mbedit.1
+++ /dev/null
@@ -1,873 +0,0 @@
-.TH mbedit 1 "3 June 2013" "MB-System 5.0" "MB-System 5.0"
-.SH NAME
-\fBmbedit\fP \- Interactive editor used to flag bad bathymetry values in swath sonar bathymetry data.
-
-.SH VERSION
-Version 5.0
-
-.SH SYNOPSIS
-\fBmbedit\fP [\fB\-B\fIyr/mo/da/hr/mn/sc\fP
-\fB\-D\fP \fB\-E\fIyr/mo/da/hr/mn/sc\fP
-\fB\-F\fIformat\fP \fB \-G \-I\fIinfile\fP \fB\-X \-V \-H\fP]
-
-.SH DESCRIPTION
-\fBMBedit\fP is an interactive editor
-used to identify and flag artifacts in swath sonar
-bathymetry data. Once a file has been
-read in, \fBMBedit\fP displays the bathymetry profiles
-from several pings, allowing the user to identify and flag anomalous
-beams. In extreme circumstances,
-entire pings may be nulled (see "KEYBOARD ACTIONS").
-
-In the default mode the edit events are output to
-an "edit save" file. The program can also be operated
-in a "browse" mode where no edit events are output.
-If saved, the edit events can be applied
-to the data using the program \fBmbprocess\fP, which
-outputs a processed swath data file.
-The \fBmbprocess\fP program is also used to merge
-edited navigation, recalculate bathymetry, and apply
-other corrections to swath bathymetry data. Users
-may cause \fBmbprocess\fP to be run automatically by
-specifying the \fB\-X\fP option when starting \fBmbedit\fP.
-
-In previous  versions of \fBMB-System\fP
-(version 4.6.10 or earlier), \fBmbedit\fP
-produced output swath data files directly by reading and
-storing all of the swath data information in memory (including
-non-survey data records). This approach limited the
-amount of data that could be handled
-at once, frequently requiring users to process files in
-small pieces. The current version only stores the bathymetry
-data and only outputs changes to the beam flag status
-(good data or bad data) of bathymetry soundings.
-
-The default \fBmbedit\fP display consists of several
-bathymetry acrosstrack profiles plotted with vertical
-offsets between each profile (in waterfall fashion). The
-profiles are plotted within
-a box with annotation showing the scaling of the x
-(acrosstrack distance) and y (depth) axes. Alternatively, the
-display can show the profiles without the waterfall offsets,
-with the view being either in the alongtrack direction, or in
-the acrosstrack dimension.
-
-The number of pings displayed,
-and the width, vertical exageration, and annotation of the plot
-are all set by the user. Unflagged bathymetry points
-are shown as small filled black squares, and flagged bathymtetry points
-are shown as small unfilled red or blue squares. Soundings
-flagged manually are shown in red, and those flagged by filter
-algorithms are shown in green. When a sounding is selected in the
-info mode, it is displayed as a large, filled, blue square.
-The unflagged or good bathymetry
-points are connected by black line segments to show the acrosstrack
-bathymetry profiles for each ping. If the \fBShow Flagged Profile\fP
-toggle is set on, then red line segments connect the flagged depth
-values in the acrosstrack bathymetry profile.
-Each of the displayed pings has a label giving the record number
-in the data file, the ping time, and the center beam depth.
-
-The editing is driven by the left mouse button and
-involves four basic edit modes and one information mode. In toggle
-mode each mouse pick toggles the nearest bathymetry point between
-flagged and unflagged states. In pick mode each mouse pick flags
-the nearest bathymetry point. In erase mode the left mouse button
-is held down as the cursor is dragged over the data; all bathymetry
-points touched by the mouse are flagged. Restore mode is just like
-erase mode, except that the affected bathymetry values are unflagged.
-In grab mode, a red rectangle is drawn as the mouse is dragged
-with the left button down. When the button is released, all
-unflagged soundings within the rectangle are flagged. Finally,
-info mode acts like pick mode, except that instead of flagging
-the nearest sounding, the program displays information about the
-selected ping and sounding above the bathymetry profile box.
-A few keyboard macros described below add additional flexibility
-to the editing process.
-
-\fBMBedit\fP has some limited automatic flagging and unflagging
-options. The \fBUnflag View\fP button allows users to unflag all of
-the currently visible soundings, and the \fBUnflag Forward\fP
-button unflags all soundings from the current position forward
-to the end of the data held in memory. The \fBControls\fP menu
-includes a \fBFilters...\fP button that brings up a dialog
-which sets the automatic flagging functions. At present, these
-include a median filter algorithm, a "wrong side filter", "data
-cutting" by beam number, and "data cutting" by acrosstrack
-distance. The "wrong side" filter flags soundings positioned on
-the "wrong" side of the swath (port soundings incorrectly located
-on the starboard side, or vice versa). The two "data cutting"
-algorithms flag beams inside or outside of specified beam number
-ranges or acrosstrack distance ranges, respectively.  Additional
-automatic filters will be added in later versions.
-
-If the ping includes flagged depths outside the plotting box, the ping label
-is underlain by a green box. If
-the ping includes unflagged depths outside the plotting box, the label
-is underlain by a red box, and a small black box appears to the left
-of the label. These colored labels help users identify
-bad bathymetry points which lie outside the box defined by the current
-vertical exageration and plot width values. In the case where unflagged
-depths lie outside the plotting box (red label), clicking on the small
-black box to the left of the ping label automatically flags all of the
-depth values outside the plotting box. Alternatively,
-users can decrease the
-vertical exageration and/or increase the plot width to bring the
-offending bathymetry points into view. Users should be aware that
-extreme bathymetric slopes or the use of high vertical exagerations
-may cause good depth values to lie outside the plotting box for
-the first and last pings in view.
-
-The middle and right mouse buttons allow the user to step forward
-and backward, respectively, through the data file. The \fBForward\fP
-and \fBReverse\fP buttons provide a duplicate stepping capability.
-Left-handed users may reverse the right and left mouse button functions by pulling down
-the \fBReverse Mouse Buttons\fP menu item from the \fBControls\fP button.
-
-\fBMBedit\fP can hold up to 25000 swath bathymetry
-profiles at a time in memory. In the case that
-a data file contains more survey data records than can be held in memory,
-users will find it necessary to step through multiple buffers of
-data. The \fBNext Buffer\fP button will cause \fBMBedit\fP to
-dump the current buffer contents and read in a new set of data.
-The handling of buffered data is set
-using the \fBBuffer Controls\fP dialog accessed by pulling down the
-\fBBuffer Controls...\fP menu item from the \fBControls\fP button.
-The \fBBuffer Controls\fP dialog includes two slider controls, one
-entitled \fBData Buffer Size\fP and the other \fBBuffer Retain Size\fP.
-Users on memory limited machines may find it necessary to set the
-maximum buffer size to a smaller number using the
-\fBData Buffer Size\fP slider.  The \fBBuffer Retain Size\fP
-slider sets the number of data records
-retained from the old buffer when more data are loaded.
-
-The user can bring up a \fBGo To Specified Time\fP dialog
-by pulling down the \fBGo to a specified time...\fP menu item from the
-\fBControls\fP button. This dialog
-allows the user to specify the time of a particular ping to be viewed.
-The first ping with a time tag later than or equal to the specified time
-is then displayed, providing such a ping is available. If an appropriate
-ping is not available in the current buffer, \fBMBedit\fP will dump
-and load buffers of data until such a ping is found or the end of the
-file is reached. Thus, specifying an incorrect "go to" time may cause
-\fBMBedit\fP to close the file. Caution is advised in using this feature.
-
-\fBMBedit\fP creates "edit save" files containing a list of each
-edit command executed during an editing session. These files are
-given names consisting of the input filename appended with ".esf".
-The program also modifies the \fBmbprocess\fP parameter file
-for the input file by specifying the edit save file and setting
-the \fBmbprocess\fP mode to apply the edits when generating a
-processed swath output file. If no parameter file named "ifile.par"
-exists, \fBmbedit\fP creates one.
-
-If a user seeks to open a swath sonar data
-file and an associated edit save file already exists, the user is
-given an option to apply the saved edits to the data as it is loaded.
-If the user chooses not to apply the saved edits, those edits will
-be lost as a new edit save file is created.
-If (as is usually the case) the saved edits are to be
-applied, \fBMBedit\fP copies the edit
-save file to a file named "mbedit_tmp.esf" and reads the saved
-edits from that second file. In this way, the use of
-edit save files and \fBmbprocess\fP allows users
-to edit a swath data file multiple times without generating
-multiple output files. Subsequent editing sessions serve to
-update the processed data rather than generate additional
-edited data files.
-
-.SH AUTHORSHIP
-David W. Caress (caress at mbari.org)
-.br
-  Monterey Bay Aquarium Research Institute
-.br
-Dale N. Chayes (dale at ldeo.columbia.edu)
-.br
-  Lamont-Doherty Earth Observatory
-
-.SH OPTIONS
-.TP
-.B \-B
-\fIyr/mo/da/hr/mn/sc\fP
-.br
-Sets the starting time for data allowed in the input data; pings
-with times before the starting time will be ignored.
-Default: \fIyr/mo/da/hr/mn/sc\fP = 1962/2/21/10/30/0.
-.TP
-.B \-D
-Starts up the program in "browse" mode. If a file is opened
-in browse mode (either at startup or later), none
-of the edited data will be output to a file. The default
-is to output the edited data to a file.
-.TP
-.B \-E
-\fIyr/mo/da/hr/mn/sc\fP
-.br
-Sets the ending time for data allowed in the input data; pings
-with times after the ending time will be ignored.
-Default: \fIyr/mo/da/hr/mn/sc\fP = 2062/2/21/10/30/0.
-.TP
-.B \-F
-\fIformat\fP
-.br
-Sets the format at startup for the input and output swath sonar data using
-\fBMBIO\fP integer format identifiers. This value can also be set
-interactively when specifying the input file.
-This program uses the \fBMBIO\fP library and will read any swath sonar
-format supported by \fBMBIO\fP. A list of the swath sonar data formats
-currently supported by \fBMBIO\fP and their identifier values
-is given in the \fBMBIO\fP manual page.
-Default: \fIformat\fP = 11.
-.TP
-.B \-G
-This flag causes the program to treat the \fBDone\fP button as
-equivalent to the \fBQuit\fP button. This option is used when
-\fBMBedit\fP is started automatically by some other process and
-only a single file is to edited.
-.TP
-.B \-H
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-.TP
-.B \-I
-\fIinfile\fP
-.br
-Sets the data file from which the input data will be read at startup.
-This option is usually used only when \fBMBedit\fP is started
-automatically from some other process. The \fB\-F\fP option should
-also be used to set the data format id. If the \fB\-B\fP option is
-not used to specify browse mode, then the edit save output file is
-automatically set as \fIinfile\fP with ".esf" appended.
-.TP
-.B \-X
-This option causes \fBmbprocess\fP to run automatically
-on an input swath data file when the \fBmbedit\fP editing session
-is completed. The \fB\-X\fP option effectively means that the
-corresponding processed swath data is generated or updated immediately.
-The program \fBmbprocess\fP will not be invoked if the
-editing session is in the browse mode.
-.TP
-.B \-V
-Normally, \fBMBedit\fP outputs information to the stderr stream
-regarding the number of records loaded and dumped.  If the
-\fB\-V\fP flag is given, then \fBMBedit\fP works in a "verbose" mode and
-outputs the program version being used, all error status messages,
-and a large amount of other information including all of the
-beams flagged or zeroed.
-
-.SH INTERACTIVE CONTROLS
-.TP
-.B File
-This button accesses a pulldown menu with two push buttons:
-\fBOpen\fP and \fBFile Selection List\fP,
-.TP
-.B File->Open
-This button brings up a popup window which allows the user to
-specify an input swath sonar bathymetry data file, its \fBMBIO\fP
-format id, and  the output mode.
-This program uses the \fBMBIO\fP library and
-will read or write any swath sonar
-format supported by \fBMBIO\fP. A list of the swath sonar data
-formats currently supported by \fBMBIO\fP and their
-identifier values is given in the \fBMBIO\fP manual page.
-If the swath sonar data file is named using the \fBMB-System\fP
-suffix convention (format 11 files end with ".mb11", format
-41 files end with ".mb41", etc.), then the program will
-automatically use the appropriate format id; otherwise the
-format must be set by the user.
-The popup window also allows the output mode to be set to "browse"
-so that no edit events are output.
-When a valid file is specified and the \fBOK\fP button
-is clicked, file will be added to an internal list of swath files
-available for editing, and then that file will be loaded into
-memory for editing (if another file was already loaded, that file
-is closed out gracefully before the new file is loaded).
-If the specified input is a datalist (format
-id = \-1), then all of the files referenced through that datalist
-will be added to the internal list, and the first of those files
-loaded. When a file is loaded for editing, \fBMBedit\fP reads
-as much data as will fit into the data buffer (typically 25000 records)
-and several pings are displayed as stacked bathymetry profiles.
-.TP
-.B File->File Selection List
-This button brings up a popup window displaying the internal list of
-swath files available for editing. The list has four columns.
-The first (left-most) column is either blank or shows "<locked>" or "<loaded>".
-If a file is loaded for editing by this program, it shows as "<loaded>".
-If a file is being edited or processed by another program, it shows as
-"<locked>". Locked files cannot be opened for editing, and any file
-loaded for editing by \fBMBedit\fP will show as "locked" to other
-programs. The second column is either blank or shows "<esf>". This indicates if
-a file has been previously edited so that an edit save file already
-exists. The third and fourth columns show the filename path and the \fBMBIO\fP
-format id, respectively.
-Users can select one of the files in the available list. If the "Edit Selected File"
-button is clicked, the selected file will be opened for editing (and any
-file already loaded will be closed first). If the "Remove Selected File"
-button is selected, then the selected file will be removed from the available
-list.
-.TP
-.B View
-This button accesses a pulldown menu with several toggle buttons:
-\fBWaterfall View\fP,
-\fBAlongtrack View\fP,
-\fBAcrosstrack View\fP,
-\fBShow Flagged Profile\fP,
-\fBShow Bottom Detect Algorithms\fP,
-\fBWide Bathymetry Profiles\fP,
-\fBPlot Time Stamps\fP,
-\fBPlot Ping Interval\fP,
-\fBPlot Longitude\fP,
-\fBPlot Latitude\fP,
-\fBPlot Heading\fP,
-\fBPlot Speed\fP,
-\fBPlot Center Beam Depth\fP,
-\fBPlot Sonar Altitude\fP,
-\fBPlot Sonar Depth\fP,
-\fBPlot Roll\fP,
-\fBPlot Pitch\fP, and
-\fBPlot Heave\fP.
-.br
-The first three toggle buttons set the view mode, which may
-be a waterfall view, an alongtrack view, or an acrosstrack
-view. The next two toggle buttons set simple display options
-and may be set or unset individually.
-The remaining toggle buttons control the display plot
-modes; only one mode and therefore one of these toggle buttons may
-be set at any time.
-.TP
-.B View->Waterfall View
-Sets the \fBmbedit\fP display so that the
-bathymetry acrosstrack profiles are plotted with vertical
-offsets between each profile (in waterfall fashion).
-.TP
-.B View->Alongtrack View
-Sets the \fBmbedit\fP display so that the
-bathymetry acrosstrack profiles are viewed in the alongtrack
-direction without vertical offsets between the pings.
-.TP
-.B View->Acrosstrack View
-Sets the \fBmbedit\fP display so that the
-bathymetry acrosstrack profiles are viewed in the acrosstrack
-direction without vertical offsets between the pings.
-.TP
-.B View->Show Flagged Profile
-This toggle allows the user to specify whether the acrosstrack
-bathymetry profile includes only the unflagged or "good" bathymetry
-(toggle set to "Off") or
-whether the profile also includes the flagged or "bad" bathymetry
-(toggle set to "On"). In
-the latter case, red line segments show the portion of the profile
-associated with the flagged depth points.
-.TP
-.B View->Show Bottom Detect Algorithms
-This toggle allows the user to specify whether the beams are
-colored according to their flagging status (toggle set to "Off"
-or according to the bottom detect algorithm used by the sonar
-(toggle set to "On"). The default is to color each sounding
-according to its flagging status \- unflagged beams are black,
-manually flagged beams are red, and filter flagged beams are
-green. If the beams are colored according to bottom detect
-algorithm, then amplitude detects are shown in black, phase
-detects are shown in red, and beams for which the bottom
-detection algorithm is unknown are shown in green. Users should
-be aware that many swath data formats do not include bottom
-detection algorithm information.
-.TP
-.B View->Wide Bathymetry Profiles
-This toggle, when set, causes \fBmbedit\fP to display the widest
-possible plots of the bathymetry profiles. All of the other options
-discussed immediately below narrow the primary plot in order to
-present additional information on the left side of the window.
-.TP
-.B View->Plot Time Stamps
-This toggle, when set, causes \fBmbedit\fP to display time stamp
-information to the left of the bathymetry profiles.
-.TP
-.B View->Plot Ping Interval
-This toggle, when set, causes \fBmbedit\fP to display an
-automatically scaled vertical time series plot of the time between pings.
- This plot appears to the left of the bathymetry profiles.
-.TP
-.B View->Plot Longitude
-This toggle, when set, causes \fBmbedit\fP to display an
-automatically scaled vertical time series plot of the
-navigation longitude associated with each ping.
- This plot appears to the left of the bathymetry profiles.
-.TP
-.B View->Plot Latitude
-This toggle, when set, causes \fBmbedit\fP to display an
-automatically scaled vertical time series plot of the
-navigation latitude associated with each ping.
- This plot appears to the left of the bathymetry profiles.
-.TP
-.B View->Plot Heading
-This toggle, when set, causes \fBmbedit\fP to display an
-automatically scaled vertical time series plot of the
-heading associated with each ping.
- This plot appears to the left of the bathymetry profiles.
-.TP
-.B View->Plot Speed
-This toggle, when set, causes \fBmbedit\fP to display an
-automatically scaled vertical time series plot of the
-speed associated with each ping.
- This plot appears to the left of the bathymetry profiles.
-.TP
-.B View->Plot Center Beam Depth
-This toggle, when set, causes \fBmbedit\fP to display an
-automatically scaled vertical time series plot of the
-speed associated with each ping.
- This plot appears to the left of the bathymetry profiles.
-.TP
-.B View->Plot Sonar Depth
-This toggle, when set, causes \fBmbedit\fP to display an
-automatically scaled vertical time series plot of the
-sonar depth associated with each ping.
- This plot appears to the left of the bathymetry profiles.
-.TP
-.B View->Plot Sonar Altitude
-This toggle, when set, causes \fBmbedit\fP to display an
-automatically scaled vertical time series plot of the
-sonar altitude associated with each ping.
- This plot appears to the left of the bathymetry profiles.
-.TP
-.B View->Plot Roll
-This toggle, when set, causes \fBmbedit\fP to display an
-automatically scaled vertical time series plot of the
-roll associated with each ping. In addition to the roll
-time series shown in black, an estimate of the acrosstrack
-seafloor slope is shown in red (calculated by linear
-regression of the unflagged soundings for each ping), and
-the difference between the roll and apparent slope is shown
-in blue. If the sonar roll has been correctly applied, the
-roll and seafloor slope should be uncorrelated. If there is
-a timing error in the roll correction, then the apparent
-seafloor slope may correlate strongly with the roll.
- This plot appears to the left of the bathymetry profiles.
-.TP
-.B View->Plot Pitch
-This toggle, when set, causes \fBmbedit\fP to display an
-automatically scaled vertical time series plot of the
-pitch associated with each ping.
- This plot appears to the left of the bathymetry profiles.
-.TP
-.B View->Plot Heave
-This toggle, when set, causes \fBmbedit\fP to display an
-automatically scaled vertical time series plot of the
-heave associated with each ping.
- This plot appears to the left of the bathymetry profiles.
-.TP
-.B Controls
-This button accesses a pulldown menu with six items:
-\fBGo To Specified Time...\fP, \fBBuffer Controls...\fP,
-\fBAnnotation...\fP, \fBFilters...\fP,
-\fBReverse Right/Left Key Macros\fP, and
-\fBReverse Mouse Buttons\fP.
-The first (top) four items bring up a dialog of
-the same name. These dialogs are discussed below.
-The last two items are toggle buttons which set mouse button
-and key macro behaviors.
-.TP
-.B Controls->Go To Specified Time...
-This menu item brings up a dialog which allows the user to
-specify the time of a particular ping to be displayed.  Once the
-year, month, day, hour, minute, and second values are entered, clicking
-the \fBApply\fP button causes \fBmbedit\fP to seek the specified
-target time.  If the current data buffer begins after the target
-time, an error is returned.  If the target time is later than the
-end of the current data buffer, then \fBmbedit\fP will dump and
-load buffers until the target time is reached or the data file ends.
-If the end of the file is reached during the search, the file will
-be closed.
-.TP
-.B Controls->Buffer Controls...
-This menu item brings up a dialog which allows the user
-to set the data buffer handling
-through two sliders discussed immediately below.
-.TP
-.B Controls->Buffer Controls->Data Buffer Size
-This slider on the \fBBuffer Controls\fP dialog
-sets the number of data records which can be held
-in the data buffer.  Any change becomes effective the next time
-that a data file is read in.
-.TP
-.B Controls->Buffer Controls->Buffer Retain Size
-This slider on the \fBBuffer Controls\fP dialog
-sets the number of data records which are held over in
-the buffer each time the old buffer is written out.
-.TP
-.B Controls->Annotation...
-This menu item brings up a dialog which
-allows the user to set the annotation intervals for
-the across track distance and depth axes through the two sliders
-discussed immediately below.
-.TP
-.B Controls->Annotation->X Axis Tick Interval
-This slider on the \fBAnnotation\fP dialog
-sets the tick interval in m for the across track
-distance axis.
-If a particular value is desired which cannot be
-obtained by dragging the slider, the slider
-can be changed by increments of 1 by clicking with the left button
-inside the slider area, but not on the slider itself.
-.TP
-.B Controls->Annotation->Y Axis Tick Interval
-This slider on the \fBAnnotation\fP dialog
-sets the tick interval in m for the depth axis.
-If a particular value is desired which cannot be
-obtained by dragging the slider, the slider
-can be changed by increments of 1 by clicking with the left button
-inside the slider area, but not on the slider itself.
-.TP
-.B Controls->Filters
-This menu item brings up a dialog which
-allows the user to turn automatic bathymetry filtering algorithms
-on and off and to set the filter parameters
-through the widgets discussed immediately below.
-Clicking on the \fBApply\fP button first removes any previous
-automatic filter flags and then applies the current
-filter settings to the swath bathymetry data. These actions
-are applied only from the current position
-to the end of the data currently
-in memory. The filtering is not applied (or unapplied) to
-pings earlier in the data file than the current position.
-The \fBReset\fP button restores the filter settings that
-were applied last.
-.TP
-.B Controls->Filters->Median Spike Fllter
-This toggle button turns automatic median filtering of
-bathymetry profiles on and off.
-When median filtering is enabled, the median depth is
-calculated for each bathymetry ping. Each sounding in the
-ping is compared with the median value; any sounding that
-differs from the median by a percentage
-greater than a threshold percentage
-is flagged as bad data.
-.TP
-.B Controls->Filters->% Median Depth Threshold
-This slider sets the threshold of the median depth
-filter in units of percentage of the median depth.
-.TP
-.B Controls->Filters->Wrong Side Fllter
-This toggle button turns automatic wrong side filtering of
-bathymetry profiles on and off. This filter expects
-bathymetry beams to be numbered from port to
-starboard. Any beam numbered less than the
-center beam with a positive
-(starboard) acrosstrack distance is considered to
-be on the "wrong side", and any beam numbered higher than
-the center beam with a negative (port) acrosstrack distance
-is similarly regarded. For most swath data, the center
-beam occurs near the midway point in the beam list. This
-algorithm ignores apparent wrong side beams close to
-the midway beam, where close is defined as being within
-a threshold number of the midway beam.
-.TP
-.B Controls->Filters->Beams from Center Threshold
-This slider sets the threshold of beam locations
-checked by the wrong side filter.
-.TP
-.B Controls->Filters->Flag by Beam Number
-This toggle button turns automatic beam flagging by
-beam number on and off. The flagging is controlled by
-start and end beam number values (set by the two
-sliders discussed immediately below). If the start beam
-number is less than or equal to the end beam number, then
-all beams between and including the start and end are
-flagged, producing a flagged zone within the swath. If
-the start beam number is greater than the end beam number,
-then all beams before and including the end beam are flagged,
-and all beams including and after the start beam are flagged.
-This produces flagging of both swath edges.
-.TP
-.B Controls->Filters->Start Flagging Beam Number
-This slider sets the beam number at which flagging by beam number starts.
-.TP
-.B Controls->Filters->End Flagging Beam Number
-This slider sets the beam number at which flagging by beam number ends.
-.TP
-.B Controls->Filters->Flag by Distance
-This toggle button turns automatic beam flagging by
-acrosstrack distance on and off. The flagging is controlled by
-start and end distance values (set by the two
-sliders discussed immediately below). If the start distance
-is less than or equal to the end distance, then
-all beams with acrosstrack distances between
-the start and end distances are
-flagged, producing a flagged zone within the swath. If
-the start distance is greater than the end distance,
-then all beams with acrosstrack distance less than
-the end distance are flagged,
-and all beams with acrosstrack distance greater than
-the start distance are flagged.
-This produces flagging of both swath edges.
-.TP
-.B Controls->Filters->Start Flagging Distance
-This slider sets the beam number at which flagging
-by acrosstrack distance starts.
-.TP
-.B Controls->Filters->End Flagging Distance
-This slider sets the beam number at which flagging
-by acrosstrack distance ends.
-.TP
-.B Controls->Reverse Right/Left Key Macros
-This toggle button, when set, reverses the
-key macros associated with flagging all beams
-to the left or right of the last picked beam. This
-means that the 'A', 'a', 'J', and 'j' keys will
-flag to the right rather than to the left. Similarly,
-the  'D', 'd', 'L', and 'l' keys will flag to the
-left rather than to the right. This option allows users
-to conveniently handle swath bathymetry in which the
-beams are mistakenly ordered starboard to port instead
-of the usual port to starboard.
-.TP
-.B Controls->Reverse Mouse Buttons
-This toggle button, when set, reverses the meaning of
-the right and left mouse buttons. This option is for
-the convenience of left-handed users.
-.TP
-.B Start
-This button causes the set of displayed pings to step backward to the
-beginning of the current buffer. The middle mouse button causes
-the same action if the 'G' or 'g' key is down.
-.TP
-.B Reverse
-This button causes the set of displayed pings to step \fInstep\fP
-pings backward in the current buffer.  The middle mouse button causes
-the same action.
-.TP
-.B Forward
-This button causes the set of displayed pings to step \fInstep\fP
-pings forward in the current buffer.  The right mouse button causes
-the same action.
-.TP
-.B End
-This button causes the set of displayed pings to step forward to the
-end of the current buffer. The right mouse button causes
-the same action if the 'G' or 'g' key is down.
-.TP
-.B Next Buffer
-This button causes the program to write out the data from the
-current buffer and then read in and display the next buffer.
-If there is no more data to be read in after the current buffer
-has been written out, then the input and output files are closed.
-.TP
-.B Done | Next File
-When the last file in the list of files available for editing has been loaded,
-this button shows as "Done". Otherwise, it shows as "Next File". In either
-case, this button causes the program to write out all of the edited navigation
-data and then close the current file. If the current file is not the last
-one in the available list, then the next unlocked file will be loaded for editing.
-.TP
-.B Quit
-This button causes the program to exit gracefully.  If a data file
-has been loaded, all of the edited navigation will be written to the output file
-before exiting.
-.TP
-.B About
-This button causes the program to bring up a dialog showing the
-program's name, version, and authors.
-.TP
-.B Acrosstrack Width
-This slider sets the width of the plot in meters; in general this
-value should be slightly larger than the swath width of the data
-being edited. If a particular value is desired which cannot be
-obtained by dragging the slider (e.g., the user wants a plot
-width of 10 meters but the slider jumps from 1 to 47), the slider
-can be changed by increments of 1 by clicking with the left button
-inside the slider area, but not on the slider itself.
-.TP
-.B Vertical Exageration
-This slider sets the depth scale in terms of vertical exageration.
-The depth scale will change as the cross track distance scale is
-changed to maintain the same vertical exageration.
-If a particular value is desired which cannot be
-obtained by dragging the slider, the slider
-can be changed by increments of 0.01 by clicking with the left button
-inside the slider area, but not on the slider itself.
-.TP
-.B Mode
-This set of radio buttons allows the user to specify the edit mode. If
-mode is set to \fIToggle\fP, then clicking the left mouse button will
-cause the nearest beam to toggle between flagged and unflagged.  If mode
-is set to \fIPick\fP, then clicking the left mouse button will cause
-the nearest unflagged beam to be flagged.  If mode
-is set to \fIErase\fP, then the cursor will change to an erasor and
-any beam with the cursor while the left mouse button is held down
-will be flagged.  If mode is set to \fIRestore\fP, the behavior will
-be the same as for \fIErase\fP except that the affected beams will be
-unflagged instead of flagged. In \fIGrab\fP mode, a red rectangle is drawn
-as the mouse is dragged with the left button down. When the button is
-released, all unflagged soundings within the rectangle are flagged.
-\fIInfo\fP mode acts like pick mode, except that instead of flagging
-the nearest sounding, the program displays information about the
-selected ping and sounding above the bathymetry profile box.
-The edit mode can also be set using key macros (see the keyboard
-action section):
-.br
- 	Toggle:		'Q', 'q', 'U', 'u'
- 	Pick:		'W', 'w', 'I', 'i'
- 	Erase:		'E', 'e', 'O', 'o'
- 	Restore:	'R', 'r', 'P', 'p'
- 	Grab:		'Y', 'y', '}, ']'
- 	Info:		'T', 't', '{', '['
-.TP
-.B Unflag View
-This button flags all unflagged beams among the currently
-displayed pings. Pings in the buffer before or after the current
-display are unaffected.
-.TP
-.B Unflag View
-This button unflags all flagged beams among the currently
-displayed pings. Pings in the buffer before or after the current
-display are unaffected.
-.TP
-.B Unflag Forward
-This button  unflags all flagged beams among all pings from
-the start of the current display to the end of the current
-data buffer. Pings before the start of the current display are
-unaffected.
-.TP
-.B Number of pings shown
-This slider sets the number of pings shown at a time.
-.TP
-.B Number of pings to step
-This slider sets the number of pings to step when the \fBForward\fP
-or \fBReverse\fP buttons are pushed.
-
-.SH MOUSE ACTIONS
-.TP
-.B Left Mouse Button
-The left mouse button is used to pick beams.  Good beams are
-shown as filled black squares and bad (flagged) beams as unfilled red
-or green squares.  The
-result of picking a particular beam depends on the current edit mode,
-as set by the \fBMode\fP button or keyboard macros defined below. The
-last picked beam (and ping) is remembered for use with
-some of the keyboard actions described below.
-.TP
-.B Middle Mouse Button
-The middle mouse button causes the set of displayed pings to step \fInstep\fP
-pings backward in the current buffer.  The control button \fBReverse\fP causes
-the same action. If the 'G' or 'g' key is depressed, the display will jump
-to the beginning of the current buffer.
-.TP
-.B Right Mouse Button
-The right mouse button causes the set of displayed pings to step \fInstep\fP
-pings forward in the current buffer.  The control button \fBForward\fP causes
-the same action. If the 'G' or 'g' key is depressed, the display will jump
-to the end of the current buffer.
-
-.SH KEYBOARD ACTIONS
-.TP
-.B 'G' or 'g'
-.B Big Jump:
-Scolling forward while pressing one of these keys jumps to the end
-of the current buffer, and scrolling backward jumps to the beginning of the buffer.
-.TP
-.B 'Z', 'z', 'M', or 'm'
-.B Bad Ping:
-Pressing one of these keys causes all of the beams in the last picked
-ping to be flagged as bad.
-.TP
-.B 'X', 'x', '<', or ','
-.B Right:
-Pressing one of these keys causes all of the unflagged beams
-in the current display to to be flagged as bad. This is equivalent
-to the CFlag View\fP button.
-.TP
-.B 'C', 'c', '>', or '.'
-.B Right:
-Pressing one of these keys causes all of the flagged beams
-in the current display to to be unflagged. This is equivalent
-to the \fBUnflag View\fP button.
-.TP
-.B 'S', 's', 'K', or 'k'
-.B Good Ping:
-Pressing one of these keys causes all of the beams in the last picked
-ping to be unflagged as good.
-.TP
-.B 'A', 'a', 'J', or 'j'
-.B Left:
-Pressing one of these keys causes all of the beams including and to
-the left of the last picked beam to be flagged as bad.
-.TP
-.B 'D', 'd', 'L', or 'l'
-.B Right:
-Pressing one of these keys causes all of the beams including and to
-the right of the last picked beam to be flagged as bad.
-.TP
-.B '!'
-.B Zero Ping:
-Pressing this key causes all of the beams in the ping
-associated with the last picked beam to be zeroed. This
-should be used only for completely ridiculous values, as
-the values are not recoverable.
-.TP
-.B 'Q', 'q', 'U', or 'u'
-.B Toggle Mode:
-Pressing one of these keys sets the edit mode to "toggle" so that
-clicking the left mouse button will cause
-the nearest beam to toggle between flagged and unflagged.
-The edit mode can also be set using the \fBMode\fP toggle buttons.
-.TP
-.B 'W', 'w', 'I', or 'i'
-.B Pick Mode:
-Pressing one of these keys sets the edit mode to "pick" so that
-clicking the left mouse button will cause
-the nearest unflagged beam to be flagged.
-The edit mode can also be set using the \fBMode\fP toggle buttons.
-.TP
-.B 'E', 'e', 'O', or 'o'
-.B Erase Mode:
-Pressing one of these keys sets the edit mode to "erase" so that
-clicking the left mouse button will cause
-any beam under the cursor while the left mouse button is held down
-to be flagged.
-The edit mode can also be set using the \fBMode\fP toggle buttons.
-.TP
-.B 'R', 'r', 'P', or 'p'
-.B Restore Mode:
-Pressing one of these keys sets the edit mode to "restore" so that
-clicking the left mouse button will cause any beam under the cursor
-while the left mouse button is held down to be unflagged.
-The edit mode can also be set using the \fBMode\fP toggle buttons.
-.TP
-.B 'T', 't', '{', or '['
-.B Grab Mode:
-Pressing one of these keys sets the edit mode to "grab" so that
-dragging the left mouse button will draw a red rectangle. Any beams
-inside the rectangle when the left mouse button is released will
-be flagged. The edit mode can also be set using the \fBMode\fP
-toggle buttons.
-.TP
-.B 'Y', 'y', '}', or ']'
-.B Info Mode:
-Pressing one of these keys sets the edit mode to "info" so that
-clicking the left mouse button will cause information about the
-nearest beam to be displayed above the bathymetry profile box.
-The edit mode can also be set using the \fBMode\fP toggle buttons.
-.TP
-.B '2'
-Sets the \fBmbedit\fP display so that the
-bathymetry acrosstrack profiles are plotted with vertical
-offsets between each profile (in waterfall fashion).
-.TP
-.B '3'
-Sets the \fBmbedit\fP display so that the
-bathymetry acrosstrack profiles are viewed in the alongtrack
-direction without vertical offsets between the pings.
-.TP
-.B '4'
-Sets the \fBmbedit\fP display so that the
-bathymetry acrosstrack profiles are viewed in the acrosstrack
-direction without vertical offsets between the pings.
-
-.SH SEE ALSO
-\fBmbsystem\fP(1), \fBmbprocess\fP(1), \fBmbset\fP(1),
-\fBmbclean\fP(1), \fBmbeditviz\fP(1), \fBmbinfo\fP(1)
-
-.SH BUGS
-This program is only fun when the data are good. The main
-window for \fBmbedit\fP is not resizable.
diff --git a/src/man/man1/mbeditviz.1 b/src/man/man1/mbeditviz.1
deleted file mode 100644
index 9a2cee7..0000000
--- a/src/man/man1/mbeditviz.1
+++ /dev/null
@@ -1,153 +0,0 @@
-.TH MBeditviz 1 "2 June 2014" "MB-System 5.0" "MB-System 5.0"
-.SH NAME
-\fBMBeditviz\fP \- 3D visualization-based editing of swath bathymetry soundings.
-
-.SH VERSION
-Version 5.0
-
-.SH SYNOPSIS
-\fBMBeditviz\fP [-I\fIdatalist\fP \fB\-V \-H\fP]
-
-.SH DESCRIPTION
-
-\fIOverview\fP
-
-\fBMBeditviz\fP is an interactive 2D/3D visualization-based tool for editing swath
-bathymetry data. The bathymetry data from selected files are read into memory, gridded,
-and displayed in the same 2D/3D visualization environment used by \fBMBgrdviz\fP. In
-this environment, users can select arbitrary areas or regions. All of the soundings in
-the selected areas are displayed in a 3D "cloud" that can be rotated, zoomed, and exaggerated.
-These soundings can also be edited using the same edit mouse modes as in \fBMBedit\fP.
-\fBMBeditviz\fP operates with "edit save files" (*.esf) in the same fashion as \fBMBedit\fP,
-\fBmbclean\fP, and \fBmbareaclean\fP. To apply the edits in processing, simply run \fBmbprocess\fP
-on a datalist referencing the relevant files.
-
-\fIStarting Up\fP
-
-The initial MBeditviz display shows a list of the swath files you have identified by using
-the "File->Open Swath File" menu item. The list has four columns.
-The first (left-most) column is either blank or shows "<locked>" or "<loaded>".
-If a file is loaded for gridding and editing by this program, it shows as "<loaded>".
-If a file is being edited or processed by another program, it shows as
-"<locked>". Locked files cannot be opened for editing, and any file
-loaded for editing by \fBMBeditviz\fP will show as "locked" to other
-programs. The second column is either blank or shows "<esf>". This indicates if
-a file has been previously edited so that an edit save file already
-exists. The third column indicates, if the file is loaded, whether asynchronous heading ("H"),
-sonar depth ("S"), and attitude ("A") time series data have been loaded along with the
-swath bathymetry data. These asynchronous data are required in order to use \fBMBeditviz\fP
-to assess time lag issues, but are not available for all datasets.
-The fourth and fifth columns show the filename and the \fBMBIO\fP
-format id, respectively.
-Users can select one of the files in the available list. If the "Edit Selected File"
-button is clicked, the selected file will be opened for editing (and any
-file already loaded will be closed first). If the "Remove Selected File"
-button is selected, then the selected file will be removed from the available
-list.
-
-
-You can select some or all of the files in the list.
-When you click on the "View All Files" or the "View Selected Files", MBeditviz reads the
-specified files, loading all of the soundings into memory. The program then brings up a
-"Grid Parameters" dialog which suggests a grid cell size and shows the implied dimensions
-of a grid enclosing all of the data. The two issues to keep in mind are that you want the
-grid to be reasonably sized (dimensions <2500 or so on my laptop) and that no interpolation
-is applied in the gridding, so too small a grid cell size will leave gaps between soundings
-in the map view. When you click "Apply", MBeditviz grids the soundings, and then displays
-the grid using the same 2D/3D interface as MBgrdviz, including the navigation associated with
-the selected swath files.
-
-The navigation associated with the selected swath files will be displayed as well, and can
-be selected or queried by setting the mouse mode to
-
-Data files that have been previously edited with \fBMBeditviz\fP, \fBMBedit\fP, \fBmbclean\fP,
-or \fBmbareaclean\fP will have two related ancilliary files with suffixes ".esf" and ".par".
-The "*.esf" file is the edit save file containing all of the flag and unflag edit events
-generated for soundings in a data file. The "*.par" file is the processing parameter file
-that contains all of the processing parameters and instructions to be applied by the program
-\fBmbprocess\fP. \fBMBeditviz\fP will read and apply the pre-existing edit events as files
-are read into memory. The initial gridded view of the bathymetry will reflect all of the
-pre-existing edit events.
-
-\fIDisplaying a "Sounding Cloud"\fP
-
-Once you have an MBeditviz survey display, set the mouse mode to "Pick Area" and either use
-the left button to drag a square "region", or use the middle button to drag an arbitrarily
-oriented "area" (also, if an area is defined the right button decreases/increases the width
-of the area). Each time you define or change a picked region or area, MBeditviz will display
-the point cloud of soundings located in the region or area. Since \fBMBeditviz\fP also displays
-the swath file navigation, users can also change the mouse mode to "Pick Nav" or "Pick Nav File"
-and select portions of the navigation. In this case the sounding cloud will encompass all of
-the data associated with the selected navigation. The 3Dsoundings view is manipulated
-using the middle and right mouse buttons in either rotation mode or zoom/exagerate mode.
-
-You can edit the soundings in the point cloud context using the left mouse button. The
-editing mouse modes work just like MBedit. The View menu in the
-point cloud display lets you show, or not show, the flagged soundings (which are displayed in red).
-
-\fIChanging Sounding Colors\fP
-
-The [3D Soundings]:<Action> pulldown menu has seven buttons that allow the user to change the
-display color of all currently selected unflagged soundings. Each of these options
-(black, red, yellow, green, bluegreen, blue, purple) acts on the soundings  displayed in
-the 3D Soundings window, and these color settings are saved when the 3D Soundings window is
-dismissed or redisplayed. This feature can aid in using \fBMBeditviz\fP for patch test
-(bias parameter) analysis. For instance, if a survey includes reciprocal lines (two coincident
-survey lines collected in opposite directions), one can use a narrow strip of soundings across
-the swaths to assess the roll bias value. This analysis is easier if the soundings from the
-two reciprocal swaths can be differentiated. To accomplish this, a user can select one line using the
-[MBview]:<Pick Nav> mode, bringing those associated soundings up in the 3D Soundings window,
-and then set all those soundings to be colored green. The soundings of the opposite line
-can be similarly colored purple. Then, selecting a narrow area across the reciprocal lines
-will select and display soundings from both lines, and those soundings will be green or
-purple depending on which line they are part of.
-
-\fIApplying the Bathyemtry Edits\fP
-
-When you dismiss the gridded view, the esf files of the affected files will be updated just
-as they are with MBedit. The program also modifies the \fBmbprocess\fP parameter file
-for the input file by specifying the edit save file and setting the \fBmbprocess\fP mode to
-apply the edits when generating a processed swath output file. If no parameter file exists,
-\fBmbeditviz\fP creates one.
-
-.SH AUTHORSHIP
-David W. Caress (caress at mbari.org)
-.br
-  Monterey Bay Aquarium Research Institute
-.br
-Dale N. Chayes (dale at ldeo.columbia.edu)
-.br
-  Lamont-Doherty Earth Observatory
-
-.SH OPTIONS
-.TP
-.B \-H
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-.TP
-.B \-I
-\fIdatalist\fP
-.br
-Sets an \fBMB-System\fP datalist file to be parsed on input for swath data files
-to list as available for editing.
-This option is usually used when \fBMBeditviz\fP is started
-automatically from some other process, such as \fBMBgrdviz\fP.
-.TP
-.B \-V
-Normally, \fBMBeditviz\fP outputs limited information to the stderr stream.
-If the \fB\-V\fP flag is given, then \fBMBeditviz\fP works in a "verbose" mode and
-outputs the program version being used, all error status messages,
-and a large amount of other information including all of the
-beams flagged or zeroed.
-
-.SH INTERACTIVE CONTROLS
-
-.SH MOUSE ACTIONS
-
-.SH KEYBOARD ACTIONS
-
-.SH SEE ALSO
-\fBmbsystem\fP(1), \fBmbedit\fP(1), \fBmbprocess\fP(1) \fBmbset\fP(1)
-
-.SH BUGS
-This program is not done, nor is it adequately documented.
diff --git a/src/man/man1/mbextractsegy.1 b/src/man/man1/mbextractsegy.1
deleted file mode 100644
index 1f54907..0000000
--- a/src/man/man1/mbextractsegy.1
+++ /dev/null
@@ -1,335 +0,0 @@
-.TH mbextractsegy 1 "3 June 2013" "MB-System 5.0" "MB-System 5.0"
-.SH NAME
-\fBmbextractsegy\fP \- extracts subbottom profiler, center beam reflection,
-or seismic reflection data from swath data supported by MB-System and
-rewrites it as a SEGY file.
-
-.SH VERSION
-Version 5.0
-
-.SH SYNOPSIS
-\fBmbextractsegy\fP [\fB\-B\fP\fIyr/mo/da/hr/mn/sc\fP \fB\-E\fP\fIyr/mo/da/hr/mn/sc\fP
-\fB\-F\fP\fIformat\fP \fB\-I\fP\fIfile\fP \fB\-J\fP\fIxscale/yscale/maxwidth\fP
-\fB\-L\fP\fIstartline/lineroot\fP \fB\-M \-O\fP\fIsegyfile\fP \fB\-Q\fP\fIroutetimefile\fP
-\fB\-R\fP\fIroutefile\fP \fB\-S\fP\fIsampleformat\fP
-\fB\-T\fP\fItimeshift\fP \fB\-U\fP\fIrangethreshold\fP \fB\-Z\fP\fIplotmax\fP \fB\-V \-H\fP]
-
-.SH DESCRIPTION
-\fBMBextractsegy\fP is a utility for reading a swath sonar data file
-or files, extracting subbottom profiler, center beam reflection,
-or seismic reflection data, and outputting that selected data
-as a SEGY file. Parameters such as sonar depth, seafloor depth, and
-position are embedded into the SEGY data. The SEGY files are
-output in a form used by the seismic reflection processing package
-\fBSIOSEIS\fP. A "sinf" file containing statistics about the content
-of the SEGY file is created automatically by \fBMBextractsegy\fP; this
-file is named by adding a ".sinf" suffix to the SEGY filename.
-
-At present, the only swath data formats from which subbottom data
-can be extracted are format 88 (Reson 7k format), format 132
-(Edgetech Jstar format), and format 133 (Edgetech Jstar format).
-
-The extracted segy data file(s) can be organized three ways. If the \fB\-O\fP
-option is used to specify a single segy output file, then all of the
-segy data will be output to that single file. If either the \fB\-Q\fP or
-\fB\-R\fP options are used to specify a survey route file that includes
-the waypoints covered while collecting the data file(s) referenced by
-\fB\-I\fP\fIfile\fP, then the output segy data will be broken up by the
-sequential lines defined by the waypoints. The \fB\-Q\fP option specifies a
-route file that includes the time at which each waypoint is reached in the
-data, and the \fB\-R\fP option specifies a route file of the form exported by
-\fBMBgrdviz\fP. In the waypoint-driven case each output segy file will be named
-using the line root name specified by \fB\-L\fP\fIstartline/lineroot\fP with a
-sequential line number starting from \fIstartline\fP. If neither the \fB\-O\fP or
-\fB\-L\fP options are used, each input swath file will have a corresponding
-segy output file with the ".segy" suffix added to the original filename.
-
-\fBMBextractsegy\fP also generates a "first cut plot" script that will generate
-grayscale section plots in Postscript of each segy file using the programs
-\fBMBsegygrid\fP and \fBmbm_grdplot\fP. The \fB\-Z\fP sets the trace value
-corresponding to the maximum grayscale (black) in the section plots.
-
-.SH AUTHORSHIP
-David W. Caress (caress at mbari.org)
-.br
-  Monterey Bay Aquarium Research Institute
-.br
-Dale N. Chayes (dale at ldeo.columbia.edu)
-.br
-  Lamont-Doherty Earth Observatory
-
-.SH OPTIONS
-.TP
-.B \-B
-\fIyr/mo/da/hr/mn/sc\fP
-.br
-This option sets the starting time for data allowed in the input data.
-The \fB\-E\fP option sets the ending time for data. If the
-starting time is before the ending time, then any data
-with a time stamp before the starting time or after the
-ending time is ignored. If instead the starting time is
-after the ending time, then any data between the ending
-and starting time will be ignored. This scheme allows time
-windowing both inside and outside a specified interval.
-Default: \fIyr/mo/da/hr/mn/sc\fP = 1962/2/21/10/30/0.
-.B \-E
-\fIyr/mo/da/hr/mn/sc\fP
-.br
-This option sets the ending time for data allowed in the input data.
-The \fB\-B\fP option sets the starting time for data. If the
-starting time is before the ending time, then any data
-with a time stamp before the starting time or after the
-ending time is ignored. If instead the starting time is
-after the ending time, then any data between the ending
-and starting time will be ignored. This scheme allows time
-windowing both inside and outside a specified interval.
-Default: \fIyr/mo/da/hr/mn/sc\fP = 2062/2/21/10/30/0.
-.TP
-.B \-F
-\fIformat\fP
-.br
-Sets the data format used if the input is read from stdin
-or from a file. If \fIformat\fP < 0, then the input file specified
-with the \fB\-I\fP option will actually contain a list of input swath sonar
-data files. This program uses the \fBMBIO\fP library
-and will read or write any swath sonar
-format supported by \fBMBIO\fP. A list of the swath sonar data formats
-currently supported by \fBMBIO\fP and their identifier values
-is given in the \fBMBIO\fP manual page. The default format is set
-using the program \fBmbdefaults\fP..
-.TP
-.B \-H
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-.TP
-.B \-I
-\fIinfile\fP
-.br
-Sets the input file path. If \fIformat\fP > 0 (set with the
-\fB\-f\fP option or \fBmbdefaults\fP) then the swath sonar data contained in \fIinfile\fP
-is read and processed. If \fIformat\fP < 0, then \fIinfile\fP
-is assumed to be an ascii file containing a list of the input swath sonar
-data files to be processed and their formats.  The program will read
-the data in each one of these files.
-In the \fIinfile\fP file, each
-data file should be followed by a data format identifier, e.g.:
- 	datafile1 11
- 	datafile2 24
-.br
-This program uses the \fBMBIO\fP library and will read or write any swath sonar
-format supported by \fBMBIO\fP. A list of the swath sonar data formats
-currently supported by \fBMBIO\fP and their identifier values
-is given in the \fBMBIO\fP manual page. Default: \fIinfile\fP = "stdin".
-.TP
-.B \-J
-\fIxscale/yscale/maxwidth\fP
-.br
-Sets the scale of the default section plots. The \fIxscale\fP value is
-in inches per shot, and the \fIyscale\fP value is in inches per second.
-The \fImaxwidth\fP value sets the maximum plot width in inches. If
-\fIxscale\fP and the shot range imply a width greater than \fImaxwidth\fP,
-then the section will be broken up into multiple plots.
-Default: \fIxscale\fP = 0.01; \fIyscale\fP = 75; \fImaxwidth\fP = 45.0
-.TP
-.B \-L
-\fIstartline/lineroot\fP
-.br
-This option sets the starting line number and the output filename root
-used when \fB\-R\fP is specified so that data are output according
-to planned survey lines. Default: \fIstartline\fP = 1; \fIlineroot\fP = "sbp".
-.TP
-.B \-M
-.br
-This option causes \fBmbextractsegy\fP to omit data during turns when
-extracting into line files according to a specified set of waypoints
-(\fB\-R\fP option). The traces will not be output until the heading is
-within 15 degrees of the next survey line's bearing.
-.TP
-.B \-O
-.br
-This option sets the output SEGY file path. If neither \fB\-O\fP nore \fB\-R\fP are invoked,
-the output SEGY filename (or files if a datalist is being processed) will
-be the input swath filename with ".segy" appended.
-.TP
-.B \-Q
-\fIroutetimefile\fP
-.br
-This option specifies route file containing the times that the survey reached
-the intended waypoints. This text file consists of lines of the form:
- 	count waypoint longitude latitude heading time_d
-.br
-where count is just an integer counter starting at 0, waypoint is the waypoint
-number starting at 0, longitude and latitude are the waypoint position in
-decimal degrees, heading is the heading in decimal degrees, and time_d is
-the unix or epoch time (time since 00:00:00 January 1, 1970) in decimal
-seconds that the survey reached this waypoint. This file can be generated from
-an \fBmbgrdviz\fP route file and survey data using the program \fBmbroutetime\fP.
-If \fIroutetimefile\fP is specified, \fBmbextractsegy\fP
-will output SEGY data in files corresponding to the planned survey lines.
-The output SEGY file names will be based on \fIlineroot\fP and will include
-the line number starting with \fIstarline\fP, both of which are specified
-using the \fB\-L\fP options.  If neither \fB\-O\fP nore \fB\-R\fP are invoked,
-the output SEGY filename (or files if a datalist is being processed) will
-be the input swath filename with ".segy" appended.
-.TP
-.B \-R
-\fIroutefile\fP
-.br
-This option specifies an \fBmbgrdviz\fP route file containing the intended
-waypoints of the survey. If \fIroutefile\fP is specified, \fBmbextractsegy\fP
-will output SEGY data in files corresponding to the planned survey lines.
-The output SEGY file names will be based on \fIlineroot\fP and will include
-the line number starting with \fIstarline\fP, both of which are specified
-using the \fB\-L\fP options.  If neither \fB\-O\fP nore \fB\-R\fP are invoked,
-the output SEGY filename (or files if a datalist is being processed) will
-be the input swath filename with ".segy" appended.
-.TP
-.B \-S
-\fIsampleformat\fP
-.br
-Sets the sample format desired for use in the output SEGY file. Options include:
- 	MB_SEGY_SAMPLEFORMAT_NONE           1
- 	MB_SEGY_SAMPLEFORMAT_TRACE          2
- 	MB_SEGY_SAMPLEFORMAT_ENVELOPE       3
- 	MB_SEGY_SAMPLEFORMAT_ANALYTIC       4
-.br
-MB_SEGY_SAMPLEFORMAT_TRACE implies that the seismic trace is in the original,
-most raw form with both positive and negative values.
-MB_SEGY_SAMPLEFORMAT_ANALYTIC implies that the trace has been
-been transformed from the original time series to an analytic signal containing
-both real and imaginary parts. Both the real and imaginary signals
-are stored in the SEGY file. MB_SEGY_SAMPLEFORMAT_ENVELOPE implies that the
-analytic signal has been reduced back to a single real, positive-only envelope
-signal by taking the magnitude of the real and imaginary parts at every sample.
-It is important to note that this option only sets the desired sample format, and
-the program may find it necessary to store the data in an alternate form. For
-instance, if the user specifies MB_SEGY_SAMPLEFORMAT_TRACE or
-MB_SEGY_SAMPLEFORMAT_ANALYTIC but the swath file only contains envelope data,
-the data will be written in the envelope form. The default value of
-MB_SEGY_SAMPLEFORMAT_NONE allows the program to choose the most appropriate
-sample format.
-.TP
-.B \-U
-\fIrangethreshold\fP
-.br
-If the \fB\-R\fP option is specified, \fBmbextractsegy\fP breaks up the
-output into files corresponding to survey lines specified in a route file.
-This option sets the threshold distance in meters used to determine when
-a waypoint along the route has been reached; the program considers the
-next waypoint reached when the range to the waypoint becomes smaller
-than \fIrangethreshold\fP and then ceases to decrease.
-Default: \fIrangethreshold\fP = 25 m.
-.TP
-.B \-Z
-\fIplotmax\fP
-.br
-Specifies the trace value corresponding to the maximum grayscale (black)
-in the section plots. Default: \fIplotmax\fP = 50.
-.TP
-.B \-V
-This option increases the verbosity of \fBmbextractsegy\fP, causing it
-to print out messages regarding its progress to stdout.
-
-.SH EXAMPLES
-Suppose that one has collected a set of Reson 7k datafiles incorporating
-multibeam sonar data, sidescan data, and subbottom profiler data, and
-that the filenames are:
- 	20040722_152111.s7k
- 	20040722_154429.s7k
- 	20040722_160809.s7k
-.br
-
-In order to extract the subbottom data into segy files, one can use
-\fBmbextractsegy\fP on each file in turn, for example:
- 	mbextractsegy \-I 20040722_152111.s7k
-.br
-which yields the following output:
- 	2527 records output to segy file 20040722_154429.s7k.segy
-.br
-In this command the 7k file format id of 88 is inferred from the
-".7k" filename suffix.
-
-One may also input a datalist file referencing all of the 7k files. The
-contents of a datalist file (typically named datalist.mb-1) would look like:
- 	20040722_152111.s7k 88
- 	20040722_154429.s7k 88
- 	20040722_160809.s7k 88
-.br
-where the second column is the data format id (see the \fBmbsystem\fP man page
-for a discussion of datalist files). To operate on all the files in
-a single command, use:
- 	mbextractsegy \-I datalist.mb-1
- which yields the following output:
- 	2527 records output to segy file 20040722_154429.s7k.segy
- 	2568 records output to segy file 20040722_160809.s7k.segy
- 	2569 records output to segy file 20040722_163148.s7k.segy
-.br
-In this command the datalist format id of \-1 is inferred from the
-".mb-1" filename suffix.
-
-Use of the \fB\-V\fP option causes \fBmbextractsegy\fP to output information
-about every tenth record written to a segy file. So:
- 	mbextractsegy \-I 20040722_152111.s7k \-V
-.br
-which yields the following output:
- 	2527 records output to segy file 20040722_154429.s7k.segy
-.br
- 	Outputting subbottom data to segy file 20040722_152111.s7k.segy
- 	file:20040722_152111.s7k record:10 shot:65  2004/204 15:20:42.083 samples:8330 interval:64 usec  minmax: 0.000000 17487.244141
- 	file:20040722_152111.s7k record:20 shot:75  2004/204 15:20:47.698 samples:8330 interval:64 usec  minmax: 0.000000 16525.875000
- 	......... lines omitted ..........
- 	file:20040722_152111.s7k record:2510 shot:2565  2004/204 15:44:05.893 samples:8330 interval:64 usec  minmax: 0.000000 17616.189453
- 	file:20040722_152111.s7k record:2520 shot:2575  2004/204 15:44:11.507 samples:8330 interval:64 usec  minmax: 0.000000 31888.093750
- 	2527 records output to segy file 20040722_152111.s7k.segy
-.br
-\fBMBextractsegy\fP also generates a "sinf" file containing statistics about the data in the segy
-file 20040722_152111.s7k.segy. The contents of the sinf file 20040722_152111.s7k.segy.sinf are:
- 	SEGY Data File:      20040722_152111.s7k.segy
-
- 	File Header Info:
- 	  Channels:                          1
- 	  Auxiliary Channels:                0
- 	  Sample Interval (usec):           64
- 	  Number of Samples in Trace:     8330
- 	  Trace length (sec):         0.533120
- 	  Data Format:                IEEE 32 bit integer
- 	  CDP Fold:                          0
-
- 	Data Totals:
- 	  Number of Traces:               2527
- 	  Min Max Delta:
- 	    Shot number:                    56     2582     2527
- 	    Shot trace:                      1        1        1
- 	    RP number:                      56     2582     2527
- 	    RP trace:                        1        1        1
- 	    Delay (sec):              0.000000 0.000000 0.000000
- 	    Range (m):                0.000000 0.000000 0.000000
- 	    Receiver Elevation (m):   \-224.030000 \-2.860000 \-221.170000
- 	    Source Elevation (m):     \-224.030000 \-2.860000 \-221.170000
- 	    Source Depth (m):         2.860000 224.030000 \-221.170000
- 	    Receiver Water Depth (m): 51.510000 487.670000 \-436.160000
- 	    Source Water Depth (m):   51.510000 487.670000 \-436.160000
-
- 	Navigation Totals:
-
- 	  Start of Data:
- 	    Time:  07 22 2004 15:20:37.029000  JD204
- 	    Lon: \-121.8573     Lat:   36.7755
-
- 	  End of Data:
- 	    Time:  07 22 2004 15:44:15.438000  JD204
- 	    Lon: \-121.8572     Lat:   36.7952
-
- 	Limits:
- 	  Minimum Longitude:    \-121.8574   Maximum Longitude:    \-121.8572
- 	  Minimum Latitude:       36.7755   Maximum Latitude:       36.7952
-
-
-
-.SH SEE ALSO
-\fBmbsystem\fP(1), \fBmbsegyinfo\fP(1), \fBmbsegylist\fP(1), \fBmbsegygrid\fP(1),
-\fBSIOSEIS\fP(http://sioseis.ucsd.edu/ )
-
-.SH BUGS
-Doesn't support all of the data formats containing subbottom or center beam
-reflection data..
diff --git a/src/man/man1/mbfilter.1 b/src/man/man1/mbfilter.1
deleted file mode 100644
index 4224eb0..0000000
--- a/src/man/man1/mbfilter.1
+++ /dev/null
@@ -1,344 +0,0 @@
-.TH mbfilter 1 "3 June 2013" "MB-System 5.0" "MB-System 5.0"
-.SH NAME
-\fBmbfilter\fP \- Apply some simple filter functions to sidescan or beam
-amplitude data from swath sonar data files.
-
-.SH VERSION
-Version 5.0
-
-.SH SYNOPSIS
-\fBmbfilter\fP [\fB\-A\fIkind\fP
-\fB\-B\fIyr/mo/da/hr/mn/sc
-\fB\-C\fImode/xdim/ldim/iteration\fP
-\fB\-D\fImode/xdim/ldim/iteration[/offset]\fP
-\fB\-E\fIyr/mo/da/hr/mn/sc
-\fB\-F\fIformat\fP \fB\-I\fIinfile\fP \fB\-N\fIbuffersize\fP
-\fB\-R\fIwest/east/south/north\fP
-\fB\-S\fImode/xdim/ldim/iteration[/threshold_lo/threshold_hi]\fP
-\fB\-V \-H\fP]
-
-.SH DESCRIPTION
-\fBmbfilter\fP applies one or more simple filters to the specified
-sidescan or beam amplitude data. The filters
-include:
-  \-S1: boxcar mean for low-pass filtering
-  \-S2: gaussian mean for low-pass filtering
-  \-S3: boxcar median for low-pass filtering
-  \-S4: inverse gradient for low-pass filtering
-  \-D1: boxcar mean subtraction for high-pass filtering
-  \-D2: gaussian mean subtraction for high-pass filtering
-  \-D3: boxcar median subtraction for high-pass filtering
-  \-C1: edge detection for contrast enhancement
-  \-C2: gradient magnitude subtraction for contrast enhancement
-
-These filters are mostly intended for use with sidescan
-data. In particular, the low-pass or smoothing filters
-can be used for first-order speckle reduction in sidescan
-data, and the high-pass filters can be used to emphasize
-fine scale structure in the data. A combination of
-low-pass and high-pass filtering can effectively perform
-band-pass filtering. The contrast enhancing
-filters can, under certain circumstances, sharpen sidescan
-images of the seafloor. The low-pass and contrast
-enhancement filters are described
-in the paper by Sauter and Parson (1994) listed below.
-
-The filtering used here is designed and applied in the
-same manner as spatial filters are applied to images.
-The swath data is treated as an image, with the x and
-y coordinates corresponding to pixel (or beam) number and
-ping number, respectively. The filters consist of M x N
-matrices which are convolved with the swath data image
-(M is the filter dimension in the acrosstrack direction
-and N is the filter dimension in the alongtrack direction).
-Missing or flagged data are ignored in the filtering
-process.
-
-Low-pass filters are specified with the \fB\-S\fP option,
-high-pass filters with the \fB\-D\fP option, and contrast
-enhancement with the \fB\-C\fP option. Users can apply up
-to ten filters in any order; the filters are applied
-in the order in which they are specified on the command line.
-Users can apply as many iterations of each filter as
-desired. The user specifies the window size
-used by the filters (3x3 or 5x5 are typical for using smoothing
-filters iteratively to reduce speckle; larger windows like 3x20
-are typical for high-pass filtering).
-
-The boxcar mean, gaussian mean, and median filter all
-achieve similar results in uniformly smoothing the data;
-the boxcar mean is faster to apply, the gaussian mean preserves
-the frequency content of the data better, and the median filter
-is least sensitive to spikes in the data. The inverse
-gradient filter applies averaging weights which depend on the
-inverse gradient of the data. This approach causes the filter
-to smooth regions without distinct edges much more than regions
-with edges, thus tending to preserve the sharpness of features
-more than the simpler smoothing filters.
-
-The median smoothing filter can be set by the \fB\-T\fP
-option to operate with low and high
-ratio thresholds (the value is changed only if the original
-value divided by the median value is less than the low
-threshold or greater than the high threshold). This allows the
-filter to preferentially despike the data. In particular, this
-approach is useful for suppressing "stripes" or "bad"
-pings which have amplitude or sidescan values differing significantly
-from surrounding pings.
-
-The high-pass filters are constructed by calculating a low-pass
-filtered version of the data and then subtracting that from
-the original data. An offset value is added to the high-passed
-data so that it is positive (negative values are considered
-flagged as bad in some formats and not allowed in others).
-The high-pass filters can be used to remove
-long-wavelength variations in seafloor reflectivity in order
-to emphasize fine-scale structure.
-
-The contrast enhancement filters are generally only successful
-when applied after smoothing because of their tendency to
-amplify noise. The edge detection filter enhances contrast by
-tending to shift values on either side of a boundary away
-from the average value across the boundary. A 5 X 5 filter or
-larger is generally required for success with the edge detection
-algorithm. The gradient filter increases contrast by subtracting
-twice the local gradient magnitude from each value.
-
-The filtered amplitude or sidescan data are written to ancilliary
-files located parallel to the input swath data files. Filtered
-amplitude data will be in files named by adding ".ffa" to the input
-file name, and sidescan data will be in files with an ".ffs" suffix.
-Filtered amplitude or sidescan data can be plotted with \fBmbm_plot\fP by
-appending "F" to that macro's mode argument (e.g. \fB\-G\fP\fI4F\fP for filtered
-amplitude data, and  \fB\-G\fP\fI5F\fP for filtered sidescan data).
-If accessing \fBmbswath\fP directly rather than through \fBmbm_plot\fP,
-plot the filtered data by appending "F" to the program's mode argument
-(e.g. \fB\-Z\fP\fI4F\fP for filtered
-amplitude data, and  \fB\-Z\fP\fI5F\fP for filtered sidescan data).
-When using \fBmbmosaic\fP to generate mosaics of amplitude or sidescan data,
-the filtered data can be accessed by appending "F" to the data kind argument
-(e.g. \fB\-A\fP\fI3F\fP for amplitude and  \fB\-A\fP\fI4F\fP for sidescan data.
-
-.SH AUTHORSHIP
-David W. Caress (caress at mbari.org)
-.br
-  Monterey Bay Aquarium Research Institute
-.br
-Dale N. Chayes (dale at ldeo.columbia.edu)
-.br
-  Lamont-Doherty Earth Observatory
-
-.SH OPTIONS
-.TP
-.B \-A
-\fIkind\fP
-.br
-Determines whether beam amplitude (\fIkind\fP = 1),
-or sidescan (\fIkind\fP = 2) data will be processed.
-Default: \fIkind\fP = 2.
-.TP
-.B \-B
-\fIyr/mo/da/hr/mn/sc\fP
-.br
-This option sets the starting time for data allowed in the input data.
-The \fB\-E\fP option sets the ending time for data. If the
-starting time is before the ending time, then any data
-with a time stamp before the starting time or after the
-ending time is ignored. If instead the starting time is
-after the ending time, then any data between the ending
-and starting time will be ignored. This scheme allows time
-windowing both inside and outside a specified interval.
-Default: \fIyr/mo/da/hr/mn/sc\fP = 1962/2/21/10/30/0.
-.TP
-.B \-C
-\fImode/xdim/ldim/iteration\fP
-.br
-.br
-Turns on contrast enhancement filtering and sets the
-filter parameters to be
-used. Here \fImode\fP specifies the filter type:
- 	\fImode\fP = 1 : Edge Detection Filter
- 	\fImode\fP = 2 : Gradient Magnitude Subtraction Filter
-.br
-The dimensions of the data window used are set using \fIxdim\fP
-(acrosstrack dimension) and \fIldim\fP (alongtrack dimension).
-Values of \fIxdim\fP = 5 and \fIldim\fP = 5 are typical, but
-larger or smaller dimensions can be used.
-The \fIiteration\fP value specifies
-the number of times the filter is applied; there is no limit to
-this value.
-Default: contrast enhancement off, \fIxdim\fP = 5, \fIldim\fP = 5,
-\fIiteration\fP = 1.
-.TP
-.B \-D
-\fImode/xdim/ldim/iteration/offset\fP
-.br
-Turns on high-pass filtering and sets the filter parameters to be
-used. Here \fImode\fP specifies the filter type:
- 	\fImode\fP = 1 : Boxcar Mean Subtraction Filter
- 	\fImode\fP = 2 : Gaussian Mean Subtraction Filter
- 	\fImode\fP = 3 : Boxcar Median Subtraction Filter
-.br
-The dimensions of the data window used are set using \fIxdim\fP
-(acrosstrack dimension) and \fIldim\fP (alongtrack dimension).
-Values of \fIxdim\fP = 3 and \fIldim\fP = 3 are typical, but
-larger dimensions can be used. The \fIiteration\fP value specifies
-the number of times the filter is applied; there is no limit to
-this value, but high-pass filters are generally only applied
-once. The \fIoffset\fP value is added to each high-pass filtered
-value to force the results to be positive; this value should be
-chosen according to the range of values allowed in the
-data type and data formats being used (e.g. for SeaBeam 2100
-sidescan as represented in format 41, the sidescan values
-can range from 1 to 65535, so an \fIoffset\fP = 1000 is appropriate).
-Default: high-pass filtering off, \fIxdim\fP = 3, \fIldim\fP = 10,
-\fIiteration\fP = 1, \fIoffset\fP = 1000.
-.TP
-.B \-E
-\fIyr/mo/da/hr/mn/sc\fP
-.br
-This option sets the ending time for data allowed in the input data.
-The \fB\-B\fP option sets the starting time for data. If the
-starting time is before the ending time, then any data
-with a time stamp before the starting time or after the
-ending time is ignored. If instead the starting time is
-after the ending time, then any data between the ending
-and starting time will be ignored. This scheme allows time
-windowing both inside and outside a specified interval.
-Default: \fIyr/mo/da/hr/mn/sc\fP = 2062/2/21/10/30/0.
-.TP
-.B \-F
-\fIformat\fP
-.br
-Sets the MBIO integer format identifier for the input file  specified  with
-the  \-I option. By default, mbfilter derives the format id from the mbpro-
-cess parameter file associated with the input file (-I option) or, if  nec-
-essary, infers the format from the "*.mbXX" MB-System suffix convention.
-.TP
-.B \-H
-This "help" flag causes the program to print out a description
-of its operation and then exit immediately.
-.TP
-.B \-I
-\fIinfile\fP
-.br
-Swath data file from which the input data will be read, or a datalist  file
-containing a list of input swath data files and/or other datalist files. If
-infile is a datalist file, then mbprocess will attempt to process all  data
-files identified by recursively reading infile.
-Default: \fIinfile\fP = "datalist.mb-1"
-.TP
-.B \-N
-\fIbuffersize\fP
-.br
-Sets the maximum number of data records which can be
-read into the buffer. In general, data records may be
-of several different types (e.g. parameter, position,
-comment) in addition to survey data records. Many data
-formats include many more position data records than
-survey data records. Thus, a large buffer may be required
-to access a reasonable number of survey data records.
-However, on memory limited machines large buffer sizes
-can lead to poor performance due to memory swapping.
-The default value of \fIbuffersize\fP = 500 is appropriate
-for most cases, but users can set the buffer size as required.
-The absolute maximum buffer size is 5000.
-Default: \fIbuffersize\fP = 500.
-.TP
-.B \-R
-\fIwest/east/south/north\fP
-.br
-Sets the longitude and latitude bounds within which swath sonar
-data will be read. Only the data which lies within these bounds will
-be copied.
-Default: \fIwest\fP=\-360, east\fI=360\fP, \fIsouth\fP=\-90, \fInorth\fP=90.
-.TP
-.B \-S
-\fImode/xdim/ldim/iteration\fP
-.br
-Turns on low-pass smoothing filtering and sets the filter
-parameters to be used to
-smooth the data. Here \fImode\fP specifies the filter type:
- 	\fImode\fP = 1 : Boxcar Mean Filter
- 	\fImode\fP = 2 : Gaussian Mean Filter
- 	\fImode\fP = 3 : Boxcar Median Filter
- 	\fImode\fP = 4 : Boxcar Inverse Gradient Filter
-.br
-The dimensions of the data window used are set using \fIxdim\fP
-(acrosstrack dimension) and \fIldim\fP (alongtrack dimension).
-Values of \fIxdim\fP = 3 and \fIldim\fP = 3 are typical, but
-larger dimensions can be used. The \fIiteration\fP value specifies
-the number of times the filter is applied; there is no limit to
-this value.
-Default: \fImode\fP = 1, \fIxdim\fP = 3, \fIldim\fP = 3,
-\fIiteration\fP = 1.
-.TP
-.B \-T
-\fIthreshold_lo/threshold_hi\fP
-.br
-This option causes the boxcar median smoothing filter to
-operate with low and high
-ratio thresholds (the value is changed only if the original
-value divided by the median value is less than \fIthreshold_lo\fP
-or greater than \fIthreshold_hi\fP). This allows the
-filter to preferentially despike the data. In particular, this
-approach is useful for suppressing "stripes" or "bad"
-pings which have amplitude or sidescan values differing significantly
-from surrounding pings. This option only works with the median
-smoothing filter.
-.TP
-.B \-V
-Normally, \fBmbfilter\fP works "silently" without outputting
-anything to the stderr stream.  If the
-\fB\-V\fP flag is given, then \fBmbfilter\fP works in a "verbose"
-mode and outputs the program version being used, the values
-of some important control parameters, and
-all error status messages.
-
-.SH EXAMPLES
-Suppose one has a SeaBeam 2100 data file called test.mb41
-which contains bathymetry (121 beams in a 120 degree swath),
-beam amplitude (121 beams coincident with bathymetry),
-and sidescan data (2000 pixels, roughly a 150 degree swath)
-which has been corrected for the amplitude vs grazing angle
-variation using the program \fBmbanglecorrect\fP.
-Plots of the corrected sidescan often show a large amount
-of speckle that was suppressed in plots of the raw data
-by the large contrast between the specular and non-specular
-regions of the swath. To reduce the speckle and make coherent
-features of the data clearer, the user can apply any of
-the smoothing filters available in \fBmbfilter\fP. One iteration
-of the boxcar mean filter can be applied as follows:
- 	mbfilter \-F41 \-Itest.mb41 \-Otest_mean.mb41 \
- 		-S1/3/3/1
-.br
-Five iterations of the inverse gradient filter can be applied as follows:
- 	mbfilter \-F41 \-Itest.mb41 \-Otest_igrad.mb41 \
- 		-S4/3/3/5
-.br
-To remove large scale variations in seafloor reflectivity, one can
-apply a high-pass filter to the data:
- 	mbfilter \-F41 \-Itest.mb41 \-Otest_hipass.mb41 \
- 		-D1/3/10/1/10000
-.br
-To first apply a high-pass filter to emphasize fine-scale structure
-and then apply a low-pass filter to reduce speckle:
- 	mbfilter \-F41 \-Itest.mb41 \-Otest_hipass.mb41 \
- 		-D1/3/10/1/10000 \-S4/3/3/5
-.br
-To first reduce speckle by smoothing the data with Gaussian
-mean filter and apply an edge detection contrast enhancement
-filter:
- 	mbfilter \-F41 \-Itest.mb41 \-Otest_hipass.mb41 \
- 		-S3/7/7/1 \-C1/5/5/1
-
-.SH SEE ALSO
-\fBmbsystem\fP(1), \fBmbmosaic\fP(1), \fBmbm_plot\fP(1), \fBmbbackangle\fP(1), \fBmbanglecorrect\fP(1)
-
-.SH REFERENCES
-Sauter, D., and L. Parson, Spatial filtering for speckle reduction,
-contrast enchancement, and texture analysis of GLORIA images,
-\fIIEEE J. Ocean. Eng.\fP, \fB19\fP, 563-576, 1994.
-
-.SH BUGS
-All the filtering in the world won't make bad data good.
diff --git a/src/man/man1/mbformat.1 b/src/man/man1/mbformat.1
deleted file mode 100644
index 11c724f..0000000
--- a/src/man/man1/mbformat.1
+++ /dev/null
@@ -1,126 +0,0 @@
-.TH mbformat 1 "3 June 2013" "MB-System 5.0" "MB-System 5.0"
-.SH NAME
-\fBmbformat\fP \-  List information about swath sonar data formats
-supported by the \fBMBIO\fP library.
-
-.SH VERSION
-Version 5.0
-
-.SH SYNOPSIS\fBmbformat\fP [\fB \-F\fP\fIformat\fP \fB\-I\fP\fIfile\fP \fB\-L \-K \-V \-H\fP]
-
-.SH DESCRIPTION
-\fBmbformat\fP is a utility which identifies the swath sonar data formats
-associated with \fBmbio\fP format id's.  If no format id or input filename
-is specified, \fBmbformat\fP lists all of the currently supported formats 
-along with short descriptions. If a format id is specified using the 
-\fB\-F\fP option, then \fBmbformat\fP prints a short description of that 
-format. If a filename is specified using the \fB\-I\fP option, then 
-\fBmbformat\fP attempts to identify a valid format id for that file using 
-swath data filename prefix and suffix conventions embedded in \fBMB-System\fP. 
-The program also determines the filename "root", which is the filename minus 
-whatever format-specific prefix or suffix has been recognized. In no prefix
-or suffix is recognized, then the root is simply the entire filename.
-
-Normally, \fBmbformat\fP
-prints out a brief description of each identified format. If the \fB\-L\fP
-option is used, \fBmbformat\fP simply prints out the valid format id number,
-or 0 if a file or format has been specified but no valid id can be identified.
-If the \fB\-K\fP option is used, \fBmbformat\fP will print out the filename
-"root" followed by the format id number.
-
-.SH AUTHORSHIP
-David W. Caress (caress at mbari.org)
-.br
-  Monterey Bay Aquarium Research Institute
-.br
-Dale N. Chayes (dale at ldeo.columbia.edu)
-.br
-  Lamont-Doherty Earth Observatory
-
-.SH OPTIONS
-.TP
-.B \-F
-\fIformat\fP
-.br
-Sets the format id to be listed.  If no format is given, all of the 
-currently supported formats will be listed. A list of the swath sonar data formats
-currently supported by \fBMBIO\fP and their identifier values
-is given in the \fBMBIO\fP manual page.
-.TP
-.B \-H
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-.TP
-.B \-I
-\fIfile\fP
-.br
-Sets the filename to be tested against known filename prefix and
-suffix conventions in order to identify the format id.
-.TP
-.B \-K
-Causes the fileroot and the format id to be output. The fileroot
-is the filename with any format specific suffix removed.
-.TP
-.B \-L
-Causes the format descriptions to be omitted 
-so that only the \fBMBIO\fP format id numbers are listed.
-.TP
-.B \-V
-Normally, \fBmbformat\fP only prints out format descriptions.  If the
-\fB\-V\fP flag is given, then \fBmbformat\fP works in a "verbose" mode and
-also outputs the program version being used.
-
-.SH EXAMPLES
-Suppose one wishes to identify the swath sonar data format associated
-with a format id of 11.  The following will suffice:
-.br
- 	mbformat \-F11
-.br
-and the result will be this output:
-  MBIO data format id: 11
-  Format name:          MBF_SBSIOMRG
-  Informal Description: SIO merge Sea Beam
-  Attributes:           Sea Beam, bathymetry, 16 beams, binary, uncentered,
-                        SIO.
-
-Suppose one wishes to list all of the currently supported data formats.
-The following will suffice:
-.br
- 	mbformat
-
-Suppose one wants to find out what format is associated with a raw
-SeaBeam 2112 file named sb199811231045.rec:
-.br
- 	mbformat \-I sb199811231045.rec
-.br
-This results in the output:
-  MBIO data format id: 41
-  Format name:          MBF_SB2100RW
-  Informal Description: SeaBeam 2100 series vender format
-  Attributes:           SeaBeam 2100, bathymetry, amplitude 
-                        and sidescan, 151 beams and 2000 pixels, ascii 
-                        with binary sidescan, SeaBeam Instruments.
-
-Using the \-K option:
-.br
- 	mbformat \-K \-I sb199811231045.rec
-.br
-will produce the following output:
-.br
-  sb199811231045 41
-.br
-where the format id has been identified as 41 because of the ".rec"
-file suffix and the fileroot has been identified as "sb199811231045"
-by removing the suffix. Use of the \-L option:
-.br
- 	mbformat \-L \-I sb199811231045.rec
-.br
-will produce output with just format id:
-.br
-  41
-
-.SH SEE ALSO
-\fBmbsystem\fP(1), \fBmbio\fP(1)
-
-.SH BUGS
-No known bugs.
diff --git a/src/man/man1/mbgetesf.1 b/src/man/man1/mbgetesf.1
deleted file mode 100644
index 61926a3..0000000
--- a/src/man/man1/mbgetesf.1
+++ /dev/null
@@ -1,139 +0,0 @@
-.TH mbgetesf 1 "3 June 2013" "MB-System 5.0" "MB-System 5.0"
-.SH NAME
-\fBmbgetesf\fP \- Extract swath bathymetry data flags into an edit save file.
-
-.SH VERSION
-Version 5.0
-
-.SH SYNOPSIS
-\fBmbgetesf\fP [\fB\-F\fPformat \fB\-I\fPinfile \fB\-M\fPmode \fB\-O\fPesffile \fB\-V \-H\fP]
-
-.SH DESCRIPTION
-Swath bathymetry data is typically edited either with interactive
-tools such as \fBmbedit\fP or automatic filters such as \fBmbclean\fP.
-The beams which are deemed "bad" are flagged, and the flags are
-output to an "edit save file", which can be applied to data
-later by \fBmbprocess\fP.
-Occasionally, the need arises to translate data
-flagging information from one file to another which represents a
-different version of the same dataset.  In particular, it may happen
-that editing has been done on a data format which does not support
-all of the original data stream (e.g. the edmb Hydrosweep format 22,
-which does not contain travel times or amplitudes), but the user now
-wishes to work with the complete data stream without having to redo
-the editing process.
-
-The utility \fBmbgetesf\fP allows the user to extract
-the flagging information in the form of an
-"edit save file" like those generated by \fBmbedit\fP and
-\fBmbclean\fP. These edits can be applied to data later
-using \fBmbprocess\fP. If the edit save file is named
-properly (an ".esf" suffix added to the input swath file
-name), the edits can automatically be loaded into \fBmbedit\fP or
-\fBmbclean\fP.
-
-The user can extract edit events from only the flagged beams (\fB\-M\fP\fI1\fP),
-or can extract edit events specifying null and flagged beams (\fB\-M\fP\fI2\fP)
-and all (good, flagged, and null) beams (\fB\-M\fP\fI3\fP). The latter cases are necessary only if
-previous editing has involved nulling beams that were
-originally classified as good or unflagging beams that were
-originally flagged.
-
-The default input is from stdin, and the default output is
-to standard out.
-
-.SH AUTHORSHIP
-David W. Caress (caress at mbari.org)
-.br
-  Monterey Bay Aquarium Research Institute
-.br
-Dale N. Chayes (dale at ldeo.columbia.edu)
-.br
-  Lamont-Doherty Earth Observatory
-
-.SH OPTIONS
-.TP
-.B \-F
-\fIformat\fP
-.br
-Sets the format for the input and output swath data using
-\fBMBIO\fP integer format identifiers.
-These utilities uses the \fBMBIO\fP library and will read any swath data
-format supported by \fBMBIO\fP. A list of the swath data formats
-currently supported by \fBMBIO\fP and their identifier values
-is given in the \fBMBIO\fP manual page.
-.TP
-.B \-H
-This "help" flag causes the program to print out a description
-of its operation and then exit immediately.
-.TP
-.B \-I
-\fIinfile\fP
-.br
-Data file from which the input data will be read. If
-no input file is specified, the input will be read
-from stdin. Default: \fIinfile\fP = stdin.
-.TP
-.B \-M
-\fImode\fP
-.br
-Specifies which beam flag values are output as edit events.
-If \fImode\fP = 1, then only flagged beams are output. If
-\fImode\fP = 2, then flagged and null beams are output. If
-\fImode\fP = 3, then an edit event will be output for every
-beam, including those that are "good" (neither flagged nor
-null). Default: \fImode\fP = 1.
-.TP
-.B \-O
-\fIesffile\fP
-.br
-Specifies output edit save file to which the
-edit events will be written. If
-no edit save file is specified, the output will be written
-to stdout. Default: \fIesffile\fP = stdout.
-.TP
-.B \-V
-Normally, \fBmbgetesf\fP works "silently" without outputting
-anything to the stderr stream.  If the
-\fB\-V\fP flag is given, then \fBmbgetesf\fP works in a "verbose" mode and
-outputs the program version being used and all error status messages.
-
-.SH EXAMPLES
-Suppose one has an edmb format (\fBMBIO\fP format id 22) Hydrosweep
-file called hs_ew9103_143.mb22 which has been edited using older
-versions of \fBmbedit\fP so that no edit save file was generated.
-Further suppose that one's thesis advisor
-suggests that the bathymetry would be better if it were recalculated
-from travel times using a new water velocity model, requiring that
-the raw Hydrosweep data (originally collected in format 21 but
-recently translated to format 24) in the file hs_ew9103_143.mb24
-be used. First extract the edit events in the form of
-a edit save file from the edited edmb file:
- 	mbgetesf \-F22 \-Ihs_ew9103_143.mb22 \
- 		-Ohs_ew9103_143.mb24.esf \-V
-.br
-Note that the edit save file has been given the name of the
-second swath file with ".esf" appended. This naming convention
-is the same as if \fBmbedit\fP or \fBmbclean\fP had been
-run on hs_ew9103_143.mb24. Now, running either \fBmbedit\fP or \fBmbclean\fP
-will automatically load the edit events as a starting point
-for editing or filtering.
-To simply apply the extracted edit events to the swath bathymetry,
-first use \fBmbset\fP to enable applying the edits in the
-\fBmbprocess\fP parameter file, and then run \fBmbprocess\fP
-to actually apply the edits and generate a processed output
-swath file:
- 	mbset \-Ihs_ew9103_143.mb24 \
- 		-PEDITSAVEMODE:1 \
- 		-PEDITSAVEFILE:hs_ew9103_143.mb24.esf \
- 		-V
- 	mbprocess \-Ihs_ew9103_143.mb24 \-V
-.br
-The output swath file will be named hs_ew9103_143p.mb24.
-
-.SH SEE ALSO
-\fBmbsystem\fP(1), \fBmbedit\fP(1), \fBmbclean\fP(1),
-\fBmbset\fP(1), \fBmbprocess\fP(1).
-
-.SH BUGS
-Let us know.
diff --git a/src/man/man1/mbgrdtiff.1 b/src/man/man1/mbgrdtiff.1
deleted file mode 100644
index 2ef2e13..0000000
--- a/src/man/man1/mbgrdtiff.1
+++ /dev/null
@@ -1,169 +0,0 @@
-.TH mbgrdtiff 1 "5 February 2015" "MB-System 5.0" "MB-System 5.0"
-.SH NAME
-\fBmbgrdtiff\fP \- \fBGMT\fP plug-in module for generating a geographically
-located GeoTIFF image from a GMT grid file.
-
-.SH VERSION
-Version 5.0
-
-.SH SYNOPSIS
-\fBgmt mbgrdtiff\fP \fB\-C\fIcptfile\fP \fB\-I\fIgrdfile\fP
-\fB\-O\fItiff_file\fP [\fB\-H\fP \fB\-K\fIintensfile\fP \fB\-V -W\fP]
-
-.SH DESCRIPTION
-\fBmbgrdtiff\fP is a plug-in module to generate a Geographically located
-GeoTiff image from a \fBGMT\fP grid file using \fBGMT\fP (Generic Mapping Tools).
-Like \fBmbcontour\fP and \fBmbswath\fP, \fBmbgrdtiff\fP
-is fully compatible with the \fBGMT\fP package version 5.
-A GeoTIFF image file includes location, projection and scaling information.
-The image generation used by \fBmbgrdtiff\fP is identical to
-that of the Postscript-producing \fBGMT\fP program
-\fBgrdimage\fP. In particular, the color map is applied from
-a \fBGMT\fP CPT file, and shading overlay grids may be applied.
-The image is 8 bits
-per pixel if the color map is a grayscale, and 24 bits
-per pixel otherwise. In order to automatically generate a
-reasonable image of a grid, use the macro \fBmbm_grdtiff\fP.
-The program \fBmbgrdtiff\fP recognizes the coordinate system
-used by \fBmbgrid\fP or \fBmbmosaic\fP to generate a grid file, and
-then embeds the projection and grid bounds information into the TIFF
-image in accordance with the GeoTIFF standard. A number of GIS software
-packages recognize the georeferencing information in GeoTIFF images.
-In particular, images generated by \fBmbgrdtiff\fP from grids created
-using \fBmbgrid\fP or \fBmbmosaic\fP can be loaded into the
-GRASS, ArcInfo, ArcView, and ArcGIS GIS packages as geographically located
-coverages.  The \fBmbgrid\fP and \fBmbmosaic\fP manual pages each contain
-an appendix with a complete list of the projected coordinate systems that
-may used in grid generation. Some software packages (e.g. Winfrog) do not
-recognize the embedded coordinate system information, and install require
-a parallel "world" file to specify the bounds and resolution. The \fB-W\fP
-option causes a world file to be generated with a ".tfw" suffix.
-
-In order for \fBGMT\fP to successfully execute \fBmbgrdtiff\fP, the
-location of the shared library \fIlibmbgmt\fP containing this module must be known to \fBGMT\fP.
-This can be accomplished by either setting the GMT_CUSTOM_LIBS parameter
-in the file gmt.conf that is part of the GMT installation, by setting
-this parameter in the file gmt.conf in the user's home directory, or by
-using the GMT module \fBgmtset\fP to modify this parameter in the
-current working directory. If, for instance, the \fIlibmbgmt\fP shared library
-has been installed in the file /usr/lib/libmbgmt.dylib, then the
-GMT_CUSTOM_LIBS parameter in a gmt.conf file can be set to:
-        GMT_CUSTOM_LIBS = /usr/lib/libmbgmt.dylib
-
-.SH AUTHORSHIP
-David W. Caress (caress at mbari.org)
-.br
-  Monterey Bay Aquarium Research Institute
-.br
-Dale N. Chayes (dale at ldeo.columbia.edu)
-.br
-  Lamont-Doherty Earth Observatory
-
-.SH OPTIONS
-.TP
-.B \-C
-Sets the color palette (CPT) file which controls the color of the plot.
-See documentation of the GMT package for a complete description
-of cpt files. If the R, G, and B values in the CPT file are all
-equal for each data level (i.e. R=G=B), the the output TIFF
-image will be 8 bits per pixel. Otherwise, the output TIFF image
-will be 24 bits per pixel.
-.TP
-.B \-H
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-.TP
-.B \-I
-\fIgrdfile\fP
-.br
-The first invocation of the \fB-I\fP\fIgrdfile\fP option sets
-the name of the gridded data file to be plotted.
-The data must be in a form acceptable to \fBGMT\fP version 3
-programs (see the \fBGMT\fP Cookbook & Technical Reference).
-.TP
-.B \-I
-\fIintensity_file\fP
-.br
-The second invocation of the \fB-I\fP\fIgrdfile\fP option sets
-the name of a gridded data file containing
-intensity values to be used for shading the map.
-Alternatively, \fIgrdfile\fP may be a list of grid files
-(one filename on each line) to be used together. If a
-list of files is supplied, the intensity files must
-conform in order to the list of data grid files they will shade.
-.TP
-.B \-O
-\fIroot\fP
-.br
-Sets the root used to construct the filename of the output shellscript
-(\fIroot\fP.cmd) and names of files created when the shellscript is
-run.  Normally the
-name of the input grid file or grid file list is
-used as the \fIroot\fP.
-.TP
-.B \-V
-Selects verbose mode [Default runs "silently"].
-.TP
-.B \-W
-The \fB-W\fP option causes a "world" file to be generated parallel to the
-GeoTiff image with a ".tfw" suffix. Some software packages (e.g. Winfrog) do
-not recognize the coordinate information embedded in the GeoTiff file, and
-look for a world file.
-.SH EXAMPLES
-Suppose we have obtained two GRD files called PunaA_bath.grd
-and PunaA_ss.grd, both with dimensions
-1162 x 1068. The file PunaA_bath.grd contains seafloor
-topography (depth values are negative, ranging
-from \-5035 m to \-1619 m), and the file PunaA_ss.grd
-contains a sidescan mosaic (reflectivity values
-ranging from 0 to 128 dB). In order to generate
-a 24 bit color TIFF image of the seafloor topography, we use:
-.br
- 	gmt mbgrdtiff \-I PunaA_bath.grd \
- 		-O PunaA_bath.tif \
- 		-C bath.cpt \-V
-.br
-where the color is controlled by a GMT cpt file bath.cpt
-containing:
-.br
- 	-5250  37  57 175 \-4875  40 127 251
- 	-4875  40 127 251 \-4500  50 190 255
- 	-4500  50 190 255 \-4125 106 235 255
- 	-4125 106 235 255 \-3750 138 236 174
- 	-3750 138 236 174 \-3375 205 255 162
- 	-3375 205 255 162 \-3000 240 236 121
- 	-3000 240 236 121 \-2625 255 189  87
- 	-2625 255 189  87 \-2250 255 161  68
- 	-2250 255 161  68 \-1875 255 186 133
- 	-1875 255 186 133 \-1500 255 255 255
-.br
-In order to generate
-an 8 bit grayscale TIFF image of the sidescan mosaic, we use:
-.br
- 	gmt mbgrdtiff \-I PunaA_ss.grd \
- 		-O PunaA_ss.tif \
- 		-C ss.cpt \-V
-.br
-where the grayscale is controlled by a GMT cpt file ss.cpt
-containing:
-.br
- 	 0.00   0   0   0   16.50  26  26  26
- 	16.50  26  26  26   22.87  51  51  51
- 	22.87  51  51  51   27.00  77  77  77
- 	27.00  77  77  77   30.00 102 102 102
- 	30.00 102 102 102   32.25 128 128 128
- 	32.25 128 128 128   34.25 153 153 153
- 	34.25 153 153 153   36.25 179 179 179
- 	36.25 179 179 179   38.50 204 204 204
- 	38.50 204 204 204   41.23 230 230 230
- 	41.23 230 230 230  128.00 255 255 255
-.br
-Here greater reflectivity amplitudes are represented by
-light grayscales.
-
-.SH SEE ALSO
-\fBmbsystem\fP(1), \fBmbm_grdplot\fP(1), \fBmbgrid\fP(1), \fBmbmosaic\fP(1),
-\fBmbm_grid\fP(1), \fBmbm_grdtiff\fP(1), \fBgmt\fP(1), \fBgrdimage\fP(1)
-
-.SH BUGS
-Let us know.
diff --git a/src/man/man1/mbgrdviz.1 b/src/man/man1/mbgrdviz.1
deleted file mode 100644
index 98886cf..0000000
--- a/src/man/man1/mbgrdviz.1
+++ /dev/null
@@ -1,457 +0,0 @@
-.TH mbgrdviz 1 "16 August 2013" "MB-System 5.0" "MB-System 5.0"
-.SH NAME
-\fBMBgrdviz\fP \- Simple interactive 2D/3D visualization of GMT grids.
-
-.SH VERSION
-Version 5.0
-
-.SH SYNOPSIS
-\fBMBgrdviz\fP [-I\fIgridfile\fP \fB\-T \-V \-H\fP]
-
-.SH DESCRIPTION
-
-\fIOverview\fP
-
-\fBMBgrdviz\fP is an interactive 2D/3D visualization tool for \fBGMT\fP topography
-grid files. \fBMBgrdviz\fP can be used for general data visualization and also has features
-integrating it with swath mapping data processing and swath survey planning.
-
-Once a topographic grid has been read, it may be displayed either as a 2D map or as
-a 3D model. The 2D view can be panned and zoomed; the 3D view also allows arbitrary
-rotations of both the topography model and the viewpoint.
-
-In addition to the primary topography, other data sets (e.g. sidescan sonar
-mosaics) can be read and displayed as overlays on the topography. Navigation
-of ships or underwater vehicles can be read and displayed; if associated with
-swath data the extent of mapping coverage can be displayed. Site data (individual
-point locations) can be read, displayed, interactively created and modified, and
-saved. Route data (collections of waypoints) can also be read, displayed,
-interactively created and modified, and saved.
-
-The topography data can be shown using a number of colortables. The colortables can
-be linearly stretched between minimum and maximum values, or applied using
-a histogram equalization. The display may also be shaded using an
-illumination model, slope magnitude, or overlay grid data. Overlay data
-can be displayed draped on the topography. Topographic
-contours can be displayed using a user defined contour interval.
-
-In addition to modifying the view, users can interact with the display in
-several ways. Users can pick single points on the surface to determine position
-and topography values, or pick and drag to determine range and bearing between
-two locations. Arbitrary rectangular regions with north-south and east-west boundaries or
-arbitrarily oriented rectangular areas can be defined by picking and dragging.
-The data within a region can be opened as a new display; areas can be used
-for survey planning.
-
-Topographic profiles associated with two-point picks, selected navigation, or
-selected routes can be displayed in a separate window and saved.
-
-\fBMBgrdviz\fP can be used to select swath data files for editing or analysis
-using other \fBMB-System\fP tools. If survey navigation has been read and
-displayed, a user may interactively select files of interest, and then start up
-the interactive waterfall bathymetry editor \fBMBedit\fP to work on those files.
-Also available are the interactive, visualization based bathymetry editor
-\fBMBeditviz\fP, the navigation editor \fBMBnavedit\fP, and the water sound
-speed modeling tool \fBMBvelocitytool\fP.
-
-\fBMBgrdviz\fP supports as many as ten displays deriving either from reading
-topography grids or extracting user defined regions from existing displays.
-
-\fIStarting Up\fP
-
-When \fBMBgrdviz\fP is invoked on the command line, a single window comes up with
-the title \fBMBgrdviz\fP and two menus: \fBFile\fP and \fBHelp\fP. The \fBHelp\fP
-menu contains a single item named \fBAbout\fP, which brings up a simple
-information window including the MB-System release version identifier.
-The \fBFile\fP menu contains several items, but initially only the \fBOpen Primary
-Grid\fP and \fBQuit\fP items are enabled. Selecting \fBOpen Primary Grid\fP brings
-up a filesystem browser window that allows users to find and select the desired
-\fBGMT\fP topography grid. By default, the browser filter is set to display only
-files ending with a ".grd" suffix. Users can change this filter (e.g. setting it
-to "*" will display all files) and then hit the \fBFilter\fP button to relist the
-files as desired. Once the desired topography grid file has been located and
-selected so that its full path appears in the \fBSelection\fP text item, clicking
-the \fBOK\fP button will cause \fBMBgrdviz\fP to read the grid and open an \fBMBview\fP
-display window. Initially, the topography will be displayed in 2D, or map view mode.
-The default color table will be "Haxby", and the topography will be shaded using slope magnitude.
-
-\fIPicking, Zooming, Panning in 2D View\fP
-
-\fBMBgrdviz\fP will initially be in the "pan and zoom" mouse mode.
-
-In this mode, if the cursor is over
-topography when the left button is clicked, a red X will appear at the
-pick point and an info window on the left side of the \fBMBview\fP display window
-will show the longitude, latitude, and topography value of the pick point.
-If the left button is used to drag the cursor from one location to another, both
-the pick and release points will be shown as red Xs and a red line will be displayed
-in between. The info window will show both the start and end positions and also the
-range and bearing between the two locations.
-
-The middle button can be used to pan by clicking, holding down, and moving the cursor.
-
-The right button can be used to zoom the display by clicking, holding down,
-and moving the cursor up to zoom in or down to zoom out.
-
-\fIManipulating a 3D View\fP
-
-The user can switch from 2D map view to 3D view mode using the <View->3D Display> menu item
-(and can switch back using the<View->Map Display> menu item). In the 3D view mode, picking,
-panning, and zooming are done in the same fashion as in the map view. However, the
-display is a perspective view that includes both rotation of the topographic model and
-of the viewpoint. To rotate the model, select the "Rotate Model" button (or the <Mouse->Rotate Model>
-menu item). The left button can be used to pick topography, the middle button will rotate the model
-when clicked and dragged, and the right button will change the vertical exageration when
-clicked and moved up (more exageration) or down (less exageration). To rotate the viewpoint,
-select the "Rotate View" button (or the <Mouse->Rotate View>
-menu item). The left button can be used to pick topography, the middle button will rotate the model
-when clicked and dragged, and the right button will change the vertical exageration when
-clicked and moved up (more exageration) or down (less exageration).
-
-.SH AUTHORSHIP
-David W. Caress (caress at mbari.org)
-.br
-  Monterey Bay Aquarium Research Institute
-.br
-Dale N. Chayes (dale at ldeo.columbia.edu)
-.br
-  Lamont-Doherty Earth Observatory
-
-.SH OPTIONS
-.TP
-.B \-H
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-.TP
-.B \-I
-\fIgridfile\fP
-.br
-Sets a GMT grid file to be read and displayed at startup.
-This option is usually used only when \fBMBgrdviz\fP is started
-automatically from some other process.
-.TP
-.B \-T
-Sets a test grid to be calculated and displayed at startup.This
-allows the program to be tested even when a grid file is
-unavailable.
-.TP
-.B \-V
-Normally, \fBMBgrdviz\fP outputs limited information to the stderr stream.
-If the \fB\-V\fP flag is given, then \fBMBgrdviz\fP works in a "verbose" mode and
-outputs the program version being used, all error status messages,
-and a large amount of other information including all of the
-beams flagged or zeroed.
-
-.SH INTERACTIVE CONTROLS: MBgrdviz Startup Window
-.TP
-.B [MBgrdviz]:<File->Open Primary Grid>
-This menu button pops up a file browser that allows the user to
-select an input \fBGMT\fP grid file. If the OK button is clicked, \fBMBgrdviz\fP will
-attempt to read a topography grid from the specified file. If successful,
-a new \fBMBview\fP window will appear displaying the topography.
-.TP
-.B [MBgrdviz]:<File->Open Site>
-This menu button pops up a file browser that allows the user to
-select an input site file. A site file specifies one or more
-individual locations that can be displayed and interactively moved.
-Site files are text with each line delineating a single site with
-white space delimited columns
-.TP
-.B [MBgrdviz]:<File->Open Route>
-.TP
-.B [MBgrdviz]:<File->Open Navigation>
-.TP
-.B [MBgrdviz]:<File->Open Swath>
-.TP
-.B [MBgrdviz]:<File->Save Site>
-.TP
-.B [MBgrdviz]:<File->Save Route>
-.TP
-.B [MBgrdviz]:<File->Quit>
-This button causes the program to exit (mostly) gracefully.
-.TP
-.B [MBgrdviz]:<Help->About>
-This button causes the program to bring up a dialog showing the
-program's name, version, and authors.
-
-.SH INTERACTIVE CONTROLS: MBview Main Window
-.TP
-.B [MBview]:<View->Map Display>
-.TP
-.B [MBview]:<View->3D Display>
-.TP
-.B [MBview]:<View->Topography>
-.TP
-.B [MBview]:<View->Topography Slope>
-.TP
-.B [MBview]:<View->Overlay>
-.TP
-.B [MBview]:<View->No Shading>
-.TP
-.B [MBview]:<View->Shading by Illumination>
-.TP
-.B [MBview]:<View->Shading by Slope>
-.TP
-.B [MBview]:<View->Shading by Overlay>
-.TP
-.B [MBview]:<View->Topography Contours>
-.TP
-.B [MBview]:<View->Sites>
-.TP
-.B [MBview]:<View->Routes>
-.TP
-.B [MBview]:<View->Navigation>
-.TP
-.B [MBview]:<View->Draped Navigation>
-.TP
-.B [MBview]:<View->Haxby Colortable>
-.TP
-.B [MBview]:<View->Bright Rainbow Colortable>
-.TP
-.B [MBview]:<View->Muted Rainbow Colortable>
-.TP
-.B [MBview]:<View->Grayscale Colortable>
-.TP
-.B [MBview]:<View->Flat Gray Colortable>
-.TP
-.B [MBview]:<View->Sealevel Colortable>
-.TP
-.B [MBview]:<Controls->Colors and Contours>
-.TP
-.B [MBview]:<Controls->2D Controls>
-.TP
-.B [MBview]:<Controls->3D Controls>
-.TP
-.B [MBview]:<Controls->Shading>
-.TP
-.B [MBview]:<Controls->Resolution>
-.TP
-.B [MBview]:<Controls->Projections>
-.TP
-.B [MBview]:<Controls->Site List>
-.TP
-.B [MBview]:<Controls->Route List>
-.TP
-.B [MBview]:<Controls->Navigation List>
-.TP
-.B [MBview]:<Mouse->Full>
-.TP
-.B [MBview]:<Mouse->Reset>
-.TP
-.B [MBview]:<Mouse->Clear>
-.TP
-.B [MBview]:<Mouse->Pan and Zoom>
-.TP
-.B [MBview]:<Mouse->Rotate Model>
-.TP
-.B [MBview]:<Mouse->Rotate View>
-.TP
-.B [MBview]:<Mouse->Shading>
-.TP
-.B [MBview]:<Mouse->Pick Area>
-.TP
-.B [MBview]:<Mouse->Edit Sites>
-.TP
-.B [MBview]:<Mouse->Edit Routes>
-.TP
-.B [MBview]:<Mouse->Pick Nav>
-.TP
-.B [MBview]:<Action->About MBview...>
-.TP
-.B [MBview]:<Action->Open Overlay Grid>
-.TP
-.B [MBview]:<Action->Open Site File>
-.TP
-.B [MBview]:<Action->Open Route File>
-.TP
-.B [MBview]:<Action->Open Navigation>
-.TP
-.B [MBview]:<Action->Open Swath File>
-.TP
-.B [MBview]:<Action->Save Site File>
-.TP
-.B [MBview]:<Action->Save Route File>
-.TP
-.B [MBview]:<Action->Save Route as Winfrog PTS File>
-.TP
-.B [MBview]:<Action->Save Route as Winfrog WPT File>
-.TP
-.B [MBview]:<Action->Save Route as Degrees + Decimal Minutes File>
-.TP
-.B [MBview]:<Action->Save Route as Hypack LNW File>
-.TP
-.B [MBview]:<Action->Save Profile File>
-.TP
-.B [MBview]:<Action->Open Selected Nav in MBedit>
-.TP
-B [MBview]:<Action->Open Selected Nav in MBeditviz>
-.TP
-B [MBview]:<Action->Open Selected Nav in MBnavedit>
-.TP
-B [MBview]:<Action->Open Selected Nav in MBvelocitytool>
-.TP
-.B [MBview]:<Action->Open Region as New View>
-.TP
-.B [MBview]:<Action->Generate Survey Route from Area>
-.TP
-.B [MBview]:<Dismiss->Dismiss>
-.TP
-.B [MBview]:<Full>
-.TP
-.B [MBview]:<Reset>
-.TP
-.B [MBview]:<Clear>
-.TP
-.B [MBview]:<Pan and Zoom>
-.TP
-.B [MBview]:<Rotate Model>
-.TP
-.B [MBview]:<Rotate View>
-.TP
-.B [MBview]:<Shading>
-.TP
-.B [MBview]:<Pick Area>
-.TP
-.B [MBview]:<Edit Sites>
-.TP
-.B [MBview]:<Edit Routes>
-.TP
-.B [MBview]:<Pick Nav>
-
-.SH INTERACTIVE CONTROLS: MBview Colors and Contours Window
-.TP
-.B [Colors and Contours]:{Data Color Bounds}"Minimum"
-.TP
-.B [Colors and Contours]:{Data Color Bounds}"Maximum"
-.TP
-.B [Colors and Contours]:{Data Color Bounds}<<Cold-to-Hot><Hot-to-Cold>>
-.TP
-.B [Colors and Contours]:"Data Contour Interval"
-.TP
-.B [Colors and Contours]:{Data Slope Color Bounds}"Minimum"
-.TP
-.B [Colors and Contours]:{Data Slope Color Bounds}"Maximum"
-.TP
-.B [Colors and Contours]:{Data Slope Color Bounds}<<Cold-to-Hot><Hot-to-Cold>>
-.TP
-.B [Colors and Contours]:{Overlay Color Bounds}"Minimum"
-.TP
-.B [Colors and Contours]:{Overlay Color Bounds}"Maximum"
-.TP
-.B [Colors and Contours]:{Overlay Color Bounds}<<Cold-to-Hot><Hot-to-Cold>>
-.TP
-.B [Colors and Contours]:<Apply>
-.TP
-.B [Colors and Contours]:<Dismiss>
-
-.SH INTERACTIVE CONTROLS: MBview Colors and Contours Window
-.TP
-.B [2D Parameters]:{View Offset}"X"
-.TP
-.B [2D Parameters]:{View Offset}"Y"
-.TP
-.B [2D Parameters]:{View Offset}"Zoom"
-.TP
-.B [2D Parameters]:<Apply>
-.TP
-.B [2D Parameters]:<Dismiss>
-
-.SH INTERACTIVE CONTROLS: MBview Colors and Contours Window
-.TP
-.B [3D Parameters]:{Model Orientation & Zoom}"Azimuth"
-.TP
-.B [3D Parameters]:{Model Orientation & Zoom}"Elevation"
-.TP
-.B [3D Parameters]:{Model Orientation & Zoom}"Zoom"
-.TP
-.B [3D Parameters]:{View Orientation & Zoom}"Azimuth"
-.TP
-.B [3D Parameters]:{View Orientation & Zoom}"Elevation"
-.B [3D Parameters]:{View Orientation & Zoom}"Zoom"
-.TP
-.B [3D Parameters]:"Vertical Exageration"
-.TP
-.B [3D Parameters]:{Pan}"X"
-.TP
-.B [3D Parameters]:{Pan}"Y"
-.TP
-.B [3D Parameters]:<Apply>
-.TP
-.B [2D Parameters]:<Dismiss>
-
-.SH INTERACTIVE CONTROLS: MBview Colors and Contours Window
-.TP
-.B [Shading Parameters]:{Shading by Illumination}"Amplitude"
-.TP
-.B [Shading Parameters]:{Shading by Illumination}"Azimuth"
-.TP
-.B [Shading Parameters]:{Shading by Illumination}"Elevation"
-.TP
-.B [Shading Parameters]:{Shading by Slope}"Amplitude"
-.TP
-.B [Shading Parameters]:{Shading by Overlay}"Amplitude"
-.TP
-.B [Shading Parameters]:{Shading by Overlay}"Center"
-.TP
-.B [Shading Parameters]:{Shading by Overlay}<<Cold-to-Hot><Hot-to-Cold>>
-.TP
-.B [Shading Parameters]:<Apply>
-.TP
-.B [Shading Parameters]:<Dismiss>
-
-.SH INTERACTIVE CONTROLS: MBview Colors and Contours Window
-.TP
-.B [Rendering Resolution]:<Dismiss>
-.TP
-.B [Rendering Resolution]:==Low Resolution Dimension==
-.TP
-.B [Rendering Resolution]:==High Resolution Dimension==
-.TP
-.B [Rendering Resolution]:<Dismiss>
-.TP
-.B [Rendering Resolution]:<Dismiss>
-
-.SH INTERACTIVE CONTROLS: MBview Colors and Contours Window
-.TP
-.B [Projections]:{Display Projection}<<Geographic><UTM><Spheroid>>
-.TP
-.B [Projections]:<Dismiss>
-
-.SH INTERACTIVE CONTROLS: MBview Colors and Contours Window
-.TP
-.B [Site List]:|Site List|
-.TP
-.B [Site List]:<Delete Selected Sites>
-.TP
-.B [Site List]:<Dismiss>
-
-.SH INTERACTIVE CONTROLS: MBview Colors and Contours Window
-.TP
-.B [Route List]:|Route List|
-.TP
-.B [Route List]:<Delete Selected Routes>
-.TP
-.B [Route List]:<Dismiss>
-
-.SH INTERACTIVE CONTROLS: MBview Colors and Contours Window
-.TP
-.B [Navigation List]:|Navigation List|
-.TP
-.B [Navigation List]:<Delete Selected Navigation>
-.TP
-.B [Navigation List]:<Dismiss>
-
-.SH MOUSE ACTIONS
-
-.SH KEYBOARD ACTIONS
-
-.SH MBGRDVIZ ROUTE FILES
-
-.SH MBGRDVIZ SITE FILES
-
-.SH SEE ALSO
-\fBmbsystem\fP(1)
-
-.SH BUGS
-This program is not done, nor is it adequately documented.
-
diff --git a/src/man/man1/mbgrid.1 b/src/man/man1/mbgrid.1
deleted file mode 100644
index 59aa320..0000000
--- a/src/man/man1/mbgrid.1
+++ /dev/null
@@ -1,8302 +0,0 @@
-.TH mbgrid 1 "29 November 2014" "MB-System 5.0" "MB-System 5.0"
-.SH NAME
-\fBmbgrid\fP \- Grid bathymetry, amplitude, or sidescan data
-from swath sonar data files.
-
-.SH VERSION
-Version 5.0
-
-.SH SYNOPSIS
-\fBmbgrid\fP \fB\-I\fIfilelist\fP \fB\-O\fIroot\fP
-[\fB\-A\fIdatatype\fP
-\fB\-B\fIborder\fP \-C\fIclip\fP[\fI/mode\fP] \fB\-D\fIxdim/ydim\fP
-\fB\-E\fIdx/dy/units[!]\fP \fB\-F\fImode\fP
-\fB\-G\fIgridkind\fP \fB\-J\fIprojection\fP \fB\-K\fIbackground\fP
-\fB\-L\fIlonflip\fP \fB\-M \-N \-P\fIpings\fP \fB\-Q\fP
-\fB\-R\fIwest/east/south/north\fP \fB\-R\fIfactor\fP
-\fB\-S\fIspeed\fP \fB\-T\fItension\fP \fB\-U\fItime\fP
-\fB\-V\fP \-W\fIscale\fP \fB\-X\fIextend\fP]
-
-.SH DESCRIPTION
-\fBmbgrid\fP is a utility used to grid bathymetry, amplitude, or sidescan
-data contained in a set of swath sonar data files. This program uses
-one of four algorithms to grid regions covered by swath sonar
-swaths and then can fill in gaps between the swaths (to the degree
-specified by the user) using a thin plate spline interpolation.
-The gridding algorithms include gaussian weighted average,
-median filter, minimum filter (use minimum value in grid bin), and
-maximum filter (use maximum value in grid bin).
-
-The user must specify a file containing a list of the data files to
-be used and their data formats (\fB\-I\fP), and a character string
-to be used as the root of the output filenames (\fB\-O\fP). The user
-may specify the bounds of the region to be gridded
-(\fB\-R\fP\fIwest/east/south/north\fP), and
-either the dimensions (\fB\-D\fP) or node spacing \fB\-E\fP of the grid,
-If the bounds and grid dimensions (or spacing) are not specified, the
-program will select the region encompassing all of the data in the
-input files and a grid spacing equivalent to 0.02 times the maximum
-sonar altitude. The automatically calculated grid bounds will exactly
-correspond to the smallest rectangular region including the data unless
-the user specifies a larger region using \fB\-R\fP\fIfactor\fP. The value
-\fIfactor\fP must be greater than one; if \fIfactor\fP = 1.1 then the
-grid bounds will be expanded to the east and west by an amount 0.05 times
-the data bounds east-west extend and to the north and south by an amount
-0.05 times the data bounds north-south extent. The user can also specify
-the type of the input data (\fB\-A\fP), the width of the gaussian filter
-used for weighted average gridding (\fB\-W\fP), the maximum distance from
-data points that the spline interpolation is used (\fB\-C\fP), the
-format of the output files, and other parameters.
-
-By default, \fBmbgrid\fP generates grids in Geographic coordinates,
-meaning that position is defined in longitude and latitude using
-the WGS84 horizontal datum. The \fB\-J\fP option can be used to specify
-an alternate, projected coordinate system (PCS). When a PCS is used,
-position will be defined in eastings and northings (meters) relative
-to the origin of the particular PCS. Universal Transverse Mercator
-is the most commonly used PCS in the oceanographic community, but
-\fBmbgrid\fP supports a large number of other PCS as well. A list of
-the supported PCS's is provided at the end of this manual page.
-
-Before opening an input swath data file, \fBmbgrid\fP checks for
-an ascii file in the same directory having the same name except
-that ".inf" is appended to the end. The program assumes that this
-ascii file contains the output of the program \fBmbinfo\fP run on
-the input data file. If the ".inf" file exists, \fBmbgrid\fP reads
-the minimum and maximum longitude and latitude bounds from the
-\fBmbinfo\fP output and compares those to the working bounds
-for the grid. If the ".inf" file indicates that none of the data
-in the input file lies inside the working grid bounds, that input
-file is skipped. This allows users to maintain a single master list
-of data files for use in all gridding without the performance penalty
-of \fBmbgrid\fP reading through all the data files, even those
-with no relevent data. We recommend that users maintain a ".inf"
-file for each swath data file used for gridding or plotting. The
-programs \fBmbswath\fP and \fBmbcontour\fP also use ".inf" files
-in the same fashion.
-
-Usually, the internal working grid has the same boundaries as the
-output grid. However, the \fB\-X\fP option
-allows the size of the internal grid to be increased so that data outside
-the grid can be used to guide the spline interpolation of data gaps which
-happen to lie at the the edge of the grid.  This is particularly important
-when adjacent grids are created which should match along the edges.
-The data input bounds are set to a region three times as large as
-the working grid in both longitude and latitude.  The program reads all
-pings which lie within the data input bounds, and accepts all beam
-values with locations within the working grid. In addition to swath sonar
-data in formats supported by \fBMB-System\fP (see the \fBMB-System\fP manual
-page), \fBmbgrid\fP can also read data from ASCII text files in
-longitude, latitude, value triples. This allows one to incorporate
-conventional echosounder bathymetry data into the gridding.
-
-The available gridding algorithms specified with the \fB-F\fP option are:
-.br
-     1. Gaussian weighted mean filter
-     2. Median filter
-     3. Minimum filter
-     4. Maximum filter
-     5. Beam footprint with slope
-     6. Beam footprint
-.br
-Algorithms 5 and 6 can only be used to grid bathymetry data, and are
-not available for gridding amplitude or sidescan data.
-
-If the default weighted average gridding scheme (\fB\-F\fP\fI1\fP) 
-is being used, each data point's contribution to a Gaussian weighted
-average for each nearby grid cell is calculated as the point is read
-and added to the grid cell sums.  The weighting function is given by:
- 	W(r) = Aexp(-r**2/a**2)
-.br
-where r is the distance from the center of the grid point to the data point,
-a is the distance at which the weighting function falls to 1/e of its
-maximum value, and A is a normalizing factor set so that the sum of all
-the weights adds to a value of 1.  Normally, the distance a is set to be
-half the average grid point spacing, but this can be varied using the \fB\-W\fP
-option.
-
-If the \fB\-F\fP\fI2\fP option is used, the gridding is performed with a
-median filter scheme instead of a Gaussian weighted average. In this
-approach, all of the values for each bin are held in memory until
-all of the data has been read. Then, the median value for each bin
-is assigned as the gridded value for that bin.  The advantage of a
-median filter approach is that it is relatively insensitive to
-isolated artifacts in the data, provided that several samples
-exist for each bin.  The disadvantage to the median filter is
-that in the absence of artifacts, the weighted average scheme
-does a better job of representing the gridded field, particularly
-if the spectral characteristics of the gridded field are important.
-The median filter approach also requires much more memory than
-a weighted average. In general, edited bathymetry should be gridded
-using the Gaussian weighted average, while unedited bathymetry,
-beam amplitude, and sidescan data should be gridded using the
-median filter.
-
-The minimum filter (\fB\-F\fP\fI3\fP) and maximum filter
-(\fB\-F\fP\fI4\fP) gridding schemes work like the median filter,
-except that the minimum or maximum bin values are reported
-instead of the median. These algorithms can be useful for
-producing grids which strongly reflect outliers in the
-data. Hydrographers often prefer to grid bathymetry using a minimum
-depth scheme because they are most interested in the
-shallowest (most dangerous) soundings in their data.
-
-If the \fB\-F\fP\fI5\fP option is used, gridding of multibeam bathymetry
-is performed using beam footprints rather than a weighting function tied to
-the grid cell spacing. In this algorithm, the beam footprints are calculated
-using the angular beamwidths and the sonar altitude above the seafloor.
-A weighting value is calculated for each grid cell which fully or
-parially lies within the beam footprint; these weighting values
-represent the fraction of the beam contained within the cell. Each
-footprint is tilted according to the local slope; the slope is estimated
-from a low resolution, first pass grid created by simple mean filtering
-the soundings. The slope grid is generated using a cell size twice that
-of the final grid. This approach allows one to sensibly grid data using
-a resolution greater than that of the raw data. Thus, if one has data
-with a large depth variation, one can generate a grid with a cell spacing
-appropriate for the high resolution, shallow data and still get
-sensible results in deep regions where the grid cells may be
-much smaller than the beam footprints. Bathymetry data derived from
-sources other than multibeam data (e.g. xyz, lidar, photogrammetry)
-are treated as points rather than soundings with footprints; the
-full weight of each sounding is applied to the grid cell in which it
-is located.
-
-The \fB\-F\fP\fI6\fP option results in beam footprint gridding of multibeam
-data without application of a local slope estimate.
-
-Normally, all of the data which falls into the region of interest
-is used to construct the gridded data set. This means that the
-data from overlapping swaths will be "averaged" in the region of
-overlap. Averaging bathymetry data from overlapping swaths is
-usually fine, but averaging imagery data (beam amplitude or sidescan)
-derived from different swaths is usually undesirable. The \fB\-U\fP
-option allows the user to force \fBmbgrid\fP to ignore data which
-overlies regions already covered by previous data (as defined by
-a time lag criterea). Alternatively, the user can force the program
-to use only the last data in a region, again as defined by a time
-lag. This option works best with the median filter scheme.
-
-The gridding can be augmented by interpolation using a 2D thin plate
-spline algorithm with optional tension. The use of interpolation is
-set with the \fB\-C\fP\fIclip[/mode]\fP option, and is only used to fill
-in grid cells left undefined after all of the swath data have been
-processed. The \fIclip\fP value sets the distance from swath data to
-which the interpolation is applied (this distance is specified as
-an integer number of grid cells, so the physical distance is
-\fIclip\fP times the grid cell interval). If
-\fImode\fP = 1 (the default), undefined cells will be filled with interpolation
-only if cells filled with swath data are found within
-\fIclip\fP cells in two opposite directions
-(e.g east and west, or northeast and southwest). This approach serves
-to fill in data gaps while avoiding adding an interpolated band around
-the edges of a survey. A caution: a large value of \fIclip\fP
-combined with \fImode\fP = 1 will be VERY slow. If \fImode\fP = 2, then
-undefined cells will be filled with the interpolation if they are within
-\fIclip\fP cells of swath data in any direction. This approach is faster,
-but can make a survey look larger and more complete than in reality.
-If \fImode\fP = 3 or \fIclip\fP is
-set to a value greater than both dimensions of the output grid, then
-all grid cells not set by swath data will be filled by interpolation.
-The \fB\-T\fP\fItension\fP option modulates the thin plate spline algorithm.
-Using the default \fItension\fP = 0.0 corresponds to a minimum curvature,
-pure Laplacian solution. If \fItension\fP is made large, the solution
-tends toward a thin plate spline and is effectively flattened.
-
-The \fB\-K\fP\fIbackground\fP option is used to underlay a bathymetry or topography
-grid with a global or regional topography model. The background data
-model can be read from a GMT grid file or from a database accessed by the \fBGMT\fP program \fBgrdraster\fP.
-In the former case \fIbackground\fP is just the file path for the
-background grid. In the latter case \fIbackground\fP is an
-identifier number used to specify which
-dataset to extract using \fBgrdraster\fP. These identifiers are user
-defined and vary with \fBGMT\fP installations. When the \fB\-K\fP\fIbackground\fP
-option is invoked, \fBgrd2xyz\fP or \fBgrdraster\fP is used to extract all of the longitude,
-latitude, and topography values within the specified database that lie
-within the desired grid. These values are interpolated onto the desired
-grid locations using the thin plate spline algorithm, and then mapped onto
-the grid wherever the values are undefined by either swath data or the
-spline interpolation invoked with the \fB\-C\fP option.
-
-For magnetic inversions it is useful to have a bathymetry grid which
-tails off to a constant value at the border.  To facilitate this, the
-\fB\-B\fP option allows the user to set the border of a smoothly
-interpolated grid to a constant value wherever no data are present.
-This is useful only if the data are confined to the central region
-of the grid and a smooth interpolation is done with a large \fIclip\fP
-so that the entire grid is filled.
-
-The output grid will by default contain values of 99999.9 at cells
-containing no data; if the \fB\-N\fP option is used then the flagging
-value used is NaN, or not-a-number.
-
-The names of the output files are based on the root character string
-specified using the \fB\-O\fP option. A number of grid formats are
-supported, including all of the grid formats supported by \fBGMT\fP.
-See the \fB\-G\fP option below for a list of the available formats.
-If the grid is output in any of the \fBGMT\fP grid formats,
-then its filename is "root.grd", and a shellscript
-which will allow the contents of the grid to be viewed using \fBGMT\fP programs
-is also output with the filename "root.grd.cmd".  If the
-\fB\-G\fP\fI1\fP option is used to specify an ascii format grid, then the
-output grid filename will be "root.asc", but no plotting shellscript
-will be created.
-
-A datalist file containing references to all of the swath files actually
-contibuting to the grid is also created. This file is named by adding
-a ".mb-1" suffix to the root string.
-
-The \fB\-M\fP option causes \fBmbgrid\fP to output two additional
-grids, the first ("root_num.grd") being the number of data
-points located within each bin, and the second ("root_sd.grd")
-being the standard deviation of the
-data points located within each bin.  Plotting shellscripts
-called "root_num.grd.cmd" and "root_sd.grd.cmd" are also output
-if the grids are in a \fBGMT\fP grid format. The \fB\-M\fP
-option is ignored when the minimum or maximum filter gridding
-algorithms are used.
-
-.SH AUTHORSHIP
-David W. Caress (caress at mbari.org)
-.br
-  Monterey Bay Aquarium Research Institute
-.br
-Dale N. Chayes (dale at ldeo.columbia.edu)
-.br
-  Lamont-Doherty Earth Observatory
-
-.SH OPTIONS
-.TP
-.B \-A
-\fIdatatype\fP
-.br
-Sets the type of data to be read and gridded. If \fIdatatype\fP = 1,
-bathymetry data will be gridded (positive downwards). If \fIdatatype\fP = 2,
-bathymetry data will be gridded as topography (positive upwards).
-If \fIdatatype\fP = 3,
-amplitude data will be gridded.  If \fIdatatype\fP = 4,
-sidescan data will be gridded. Default: \fIdatatype\fP = 1 (bathymetry).
-.TP
-.B \-B
-\fIborder\fP
-.br
-Sets the border of a smoothly interpolated grid to the value \fIborder\fP
-wherever no data exist, provided \fIborder\fP > 0.0.
-Default: \fIborder\fP = 0.0
-.TP
-.B \-C
-\fIclip[/mode]\fP
-.br
-Controls the use of spline interpolation to fill grid cells not
-filled by swath data. The \fIclip\fP value sets the distance from
-swath data (in grid cells) that the spline interpolation may be
-applied. If \fIclip\fP=0 no spline interpolation will be done.
-If \fImode\fP=1 (the default), then the interpolation will fill
-data gaps up to two times \fIclip\fP grid cells in size. If \fImode\fP=2
-then the spline interpolation will fill all undefined cells within
-a distance of \fIclip\fP cells from data. If \fImode\fP = 3 or \fIclip\fP is
-set to a value greater than both dimensions of the output grid, then
-all grid cells not set by swath data will be filled by interpolation.
-Default: \fIclip\fP = 0 and \fImode\fP = 1.
-.TP
-.B \-D
-\fIxdim/ydim\fP
-.br
-Sets the dimensions of the output grid.  This option is superceded
-if the user specifies the grid spacing with the \fB\-E\fP option.
-Default:  \fIxdim\fP = \fIydim\fP = 101.
-.TP
-.B \-E
-\fIdx/dy/units[!]\fP
-.br
-Sets the grid cell spacing to \fIdx\fP in longitude and \fIdy\fP
-in latitude. If \fIunits\fP is not specified, the \fIdx\fP
-and \fIdy\fP values are assumed to be in meters. Valid values
-for \fIunits\fP include "km", "meters", and "degrees".
-If not in degrees, the grid cell spacing values are converted to
-degrees using the central latitude of the grid. If
-\fIdy\fP = 0.0, then the latitude cell spacing will be set
-equal to the longitude cell spacing (after conversion to
-degrees, if necessary).
-By default, the grid spacing is calculated from
-the grid bounds and the grid dimensions. When the user
-uses the \fB\-E\fP option to set the cell spacings, the
-grid dimensions are calculated using the grid bounds and
-grid cell spacings. However, slight adjustments to the
-grid cell spacings are usually required to keep
-the grid bounds as specified. Appending an ! to the end of
-the \fB\-E\fP arguments forces \fBmbgrid\fP to use the
-exact grid cell spacing values specified by adjusting the
-grid bounds.
-Default: If neither the \fB\-E\fP or \fB\-D\P options are specified,
-the program sets the grid cell spacing to be 0.02 times the maximum
-sonar altitude in the input files.
-.TP
-.B \-F
-\fImode\fP
-.br
-Sets the gridding algorithm to be used.
- 	\fImode\fP = 1:         Gaussian Weighted Mean
- 	\fImode\fP = 2:         Median Filter
- 	\fImode\fP = 3:         Minimum Filter
- 	\fImode\fP = 4:         Maximum Filter
- 	\fImode\fP = 5:         Weighted Sonar Footprint with slope
- 	\fImode\fP = 6:         Weighted Sonar Footprint
-The default is \fImode\fP = 1 (Gaussian Weighted Mean).
-.TP
-.B \-G
-\fIgridkind\fP
-.br
-This option sets the format of the output grid file.
-The default is to output a GMT netCDF 4-byte float grid.
-The user may specify the grid format either by using an
-identifier number, or by using the \fBGMT\fP grid format
-syntax, which allows for scaling and offsets of the data.
-
-First, the simple grid format identifiers are:
- 	\fIgridkind\fP = 1:	ASCII table
- 	\fIgridkind\fP = 2:	binary file (\fBGMT\fP version 1 GRD file)
- 	\fIgridkind\fP = 3:	netCDF file (\fBGMT\fP version 2 GRD file)
- 	\fIgridkind\fP = 4:	Arc/Info and ArcView ASCII grid
- 	\fIgridkind\fP = 100:	GMT netCDF 4-byte float format [Default]
- 	\fIgridkind\fP = 101:	Native binary single precision floats in scanlines with leading grd header
- 	\fIgridkind\fP = 102:	Native binary short integers in scanlines with leading grd header
- 	\fIgridkind\fP = 103:	8-bit standard Sun rasterfile (colormap ignored)
- 	\fIgridkind\fP = 104:	Native binary unsigned char in scanlines with leading grd header
- 	\fIgridkind\fP = 105:	Native binary bits in scanlines with leading grd header
- 	\fIgridkind\fP = 106:	Native binary ``surfer'' grid files
- 	\fIgridkind\fP = 107:	netCDF 1-byte byte format
- 	\fIgridkind\fP = 108:	netCDF 1-byte char format
- 	\fIgridkind\fP = 109:	netCDF 2-byte int format
- 	\fIgridkind\fP = 110:	netCDF 4-byte int format
- 	\fIgridkind\fP = 111:	netCDF 8-byte double format
-.br
-
-Second, a \fBGMT\fP grid format string has the form:
-.br
- 	=id[/scale/offset[/nan]]
-.br
-where id is the \fBGMT\fP format id, and the other values
-are optional. If \fIscale\fP and \fIoffset\fP are given, the
-data will be multiplied by \fIscale\fP and offset by \fIoffset\fP
-prior to being output. The \fInan\fP value sets the value used for
-"not-a-number". The \fBGMT\fP format id's for these format strings are:
- 	\fIid\fP = 0:	GMT netCDF 4-byte float format [Default]
- 	\fIid\fP = 1:	Native binary single precision floats in scanlines with leading grd header
- 	\fIid\fP = 2:	Native binary short integers in scanlines with leading grd header
- 	\fIid\fP = 3:	8-bit standard Sun rasterfile (colormap ignored)
- 	\fIid\fP = 4:	Native binary unsigned char in scanlines with leading grd header
- 	\fIid\fP = 5:	Native binary bits in scanlines with leading grd header
- 	\fIid\fP = 6:	Native binary ``surfer'' grid files
- 	\fIid\fP = 7:	netCDF 1-byte byte format
- 	\fIid\fP = 8:	netCDF 1-byte char format
- 	\fIid\fP = 9:	netCDF 2-byte int format
- 	\fIid\fP = 10:	netCDF 4-byte int format
- 	\fIid\fP = 11:	netCDF 8-byte double format
-.br
-Note that the following arguments are equivalent because they
-all produce a standard \fBGMT\fP netCDF 4-byte float grid:
- 	\fB\-G\fP\fI3\fP
- 	\fB\-G\fP\fI100\fP
- 	\fB\-G\fP\fI=0\fP
-.br
-Should the user wish to produce a grid in native binary floats,
-then the following two arguments will work:
- 	\fB\-G\fP\fI101\fP
- 	\fB\-G\fP\fI=1\fP
-.br
-Should the user wish to produce a grid in native short int format
-with a scaling factor of 10, an offset of 32000, and a NaN value
-of 32767, then the following arguments will suffice:
-.br
- 	\fB\-G\fP\fI=2/10/32000/32767\fP
-
-If \fIgridkind\fP = 3 or \fIgridkind\fP >= 100,
-\fBmbgrid\fP also outputs shellscripts
-which run \fBGMT\fP programs to provide preliminary color
-fill maps of the gridded data. These shellscripts are
-generated using the \fBmbm_grdplot\fP macro.
-
-If \fIgridkind\fP = 4, the output grids will be in the Arc/Info ASCII
-grid format.  Arc/Info ASCII grids use "square" bins,
-meaning that the longitude and latitude grid cell spacings must
-be identical. Thus, whenever the \fIgridkind\fP = 4 option is
-used, the \fB\-E\fP option must also be used in a way which
-ensures equal grid cell spacings (see the \fB\-E\fP documentation
-above).
-Default: \fIgridkind\fP = 100.
-.TP
-.B \-H
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-.TP
-.B \-I
-\fIdatalist\fP
-.br
-Sets the filename of the file containing a list of the input swath sonar
-data files and their formats.  In the \fIdatalist\fP file, each
-data file should be followed by a data format identifier, e.g.:
- 	datafile1 11
- 	datafile2 24
-.br
-This program uses the \fBMBIO\fP library and will read any swath sonar
-format supported by \fBMBIO\fP. A list of the swath sonar data formats
-currently supported by \fBMBIO\fP and their identifier values
-is given in the \fBMBIO\fP manual page.  A format identifier of 0 indicates
-that the file contains lines of (lon, lat, depth) triples which can be read
-in free format.
-.br
-An input datafile may be accompanied by a "fast bathymetry" or "fbt" file.
-An "fbt" file contains only swath bathymetry information in a compact format (format 71),
-and is thus quick to read. The "fbt" fine naming convention is to add the
-".fbt" suffix to the original swath
-data filename. In the
-event that a bathymetry or topography grid is being generated, \fBmbgrid\fP
-will attempt to read an "fbt" file in lieu of the original data.
-Default: \fIdatalist\fP = datalist.mb-1
-.TP
-.B \-J
-\fIprojection\fP
-By default, \fBmbgrid\fP generates grids in Geographic coordinates,
-meaning that position is defined in longitude and latitude using
-the WGS84 geographic coordinate system.
-The \fB\-J\fP option can be used to specify
-an alternate, projected coordinate system (PCS). When a PCS is used,
-position will be defined in eastings and northings (meters) relative
-to the origin of the particular PCS. Universal Transverse Mercator
-is the most commonly used PCS in the oceanographic community, but
-\fBmbgrid\fP supports a large number of other PCS's as well.
-The underlying projection functions derive from the \fBPROJ.4\fP library
-written by Gerald Evenden, then of the U.S. Geological Survey.
-
-The \fIprojection\fP argument for the \fB\-J\fP option can be either
-a PCS identifier from the projection definition list provided at the
-end of this manual page, or simply \fB\-J\fP\fIU\fP to specify using
-UTM in whatever zone is appropriate for the grid bounds specified
-with the \fB\-R\fP option.
-
-For instance, to fully specify a particular northern UTM
-zone, set \fIprojection\fP = UTMXXN where XX gives
-the UTM zone (defined from 01 to 60). As an example, a northern UTM
-zone 12 projection can be specified using \fB\-J\fP\fIUTM12N\fP.
-Southern UTM zones are specified as UTMXXS. The European Petroleum
-Survey Group (EPSG) has defined a large number of PCS's used worldwide
-and assigned number id's to each; one can also specify the northern
-UTM zone 12 projection using its EPSG designation,
-or \fB\-J\fP\fIepsg32612\fP.
-When the projected coordinate system is fully specified
-by the \fB\-J\fP option, then the grid bounds may be specified using
-\fB\-R\fP in either longitude and latitude or in eastings and northings.
-
-Alternatively, one may indicate a UTM projection without specifying the
-zone by using \fB\-J\fP\fIU\fP. In this case, the
-UTM zone will be inferred from the midpoint of the
-specified longitude and latitude bounds, and then the
-longitude and latitude bounds given with the
-\fB\-fR\fP option are translated to UTM eastings and northings.
-
-All grids and mosaics produced by \fBMB-System\fP
-programs contain identifiers that are recognized
-by the plotting macros \fBmbm_grdplot\fP,
-\fBmbm_grd3dplot\fP, and \fBmbm_grdtiff\fP.
-These plotting macros automatically use a
-linear map projection whenever they
-encounter grids and mosaics that are already
-in a projected coordinate system. Also, the program \fBmbgrdtiff\fP
-automatically inserts the appropriate projection information into
-the GeoTIFF images it generates. As a result, images generated by
-\fBmbgrdtiff\fP will be properly georeferenced when they are imported
-into GIS software.
-
-.TP
-.B \-K
-\fIbackground\fP
-.br
-Enables filling in all undefined grid cells with bathymetry or topography
-from a global or regional database. If raster data have been locally made
-available through the \fBGMT\fP program \fBgrdraster\fP, these can be
-accessed by specifying \fIbackground\fP as the \fBgrdraster\fP dataset id number
-(e.g. \fB\-K\fP\fI4\fP \- note that \fBgrdraster\fP
-datasets are numbered starting at 1).
-Users can also use data in GMT grids as a background (including grids
-generated by \fBmbgrid\fP) by specifying \fIbackground\fP as the file path
-to the desired grid (e.g. \fB\-K\fP\fI/usr/local/share/globaltopo.grd\fP).
-
-.TP
-.B \-L
-\fIlonflip\fP
-.br
-Sets the range of the longitude values returned.
-If \fIlonflip\fP=\-1 then the longitude values will be in
-the range from \-360 to 0 degrees. If \fIlonflip\fP=0
-then the longitude values will be in
-the range from \-180 to 180 degrees. If \fIlonflip\fP=1
-then the longitude values will be in
-the range from 0 to 360 degrees.
-Default: \fIlonflip\fP = 0.
-.TP
-.B \-M
-Causes two additional grids to be output. One is a grid containing
-the standard deviation of the data within each grid cell relative
-to the grid value, the other contains the number of data
-points in each grid cell. This option is ignored when the minimum
-or maximum filter gridding algorithms are used (see the \fP-F\fP option).
-.TP
-.B \-N
-Causes grid cells with no data and no interpolation to be set to a
-value of NaN instead of the default value of 99999.9.  The NaN value
-is expected by \fBGMT\fP programs such \fBgrdview\fP.
-.TP
-.B \-O
-\fIroot\fP
-.br
-Sets the character string to be used as the root of the
-output filenames. For example, if the grid is output as a \fBGMT\fP
-version 2 GRD format (netCDF) file (the default),
-then its filename is "root.grd". If the
-\fB\-G\fP\fI1\fP option is used to specify an ascii format grid, then the
-output grid filename will be "root.asc". If the
-\fB\-G\fP\fI2\fP option is used to specify a version 1 GRD
-format (binary) grid, then the
-output grid filename will be "root.grd1". If the output grid is
-in the \fBGMT\fP version 2 GRD format, a shellscript
-which will allow the contents of the grid to viewed using \fBGMT\fP programs
-is also output with the filename "root.grd.cmd".
-.TP
-.B \-P
-\fIpings\fP
-Sets the ping averaging of the input data. If \fIpings\fP > 0, then
-that number of input pings will be averaged to produce one output
-ping.  If \fIpings\fP = 0, then the ping averaging will automatically
-be done so that the along-track ping spacing is equal to the across-track
-beam spacing. Default: \fIpings\fP = 1.
-.TP
-.B \-Q
-Normally, bathymetry or topography data is gridded in meters. If
-this option is used, bathymetry or topography data is gridded
-in feet.
-.TP
-.B \-R
-\fIwest/east/south/north\fP
-.br
-\fIfactor\fP
-.br
-The first form sets the longitude and latitude bounds of the output grid.
-By default (if the \fB\-R\fP\fIwest/east/south/north\fP
-option is not specified) the program will set
-the grid bounds to be the area encompassing all of the data in the
-input files. The second form (\fB\-R\fP\fIfactor\fP) expands the automatically
-calculated bounds by the multiplicative \fIfactor\fP.The value
-\fIfactor\fP must be greater than one; if \fIfactor\fP = 1.1 then the
-grid bounds will be expanded to the east and west by an amount 0.05 times
-the data bounds east-west extend and to the north and south by an amount
-0.05 times the data bounds north-south extent.
-If the user uses the \fB\-E\fP option to set the grid spacing, then the dimensions
-will be calculated from the grid bounds and spacing. In these
-circumstances rounding errors will usually require that the eastern
-and northern bounds be adjusted to fit exactly with the
-grid dimensions and spacing.
-Default: If the \fB\-R\fP\fIwest/east/south/north\fP
-option is not specified, the program will set
-the grid bounds to be the area encompassing all of the data in the
-input files.
-.TP
-.B \-S
-\fIspeed\fP
-.br
-Sets the minimum speed in km/hr (5.5 kts ~ 10 km/hr) allowed in
-the input data; pings associated with a smaller ship speed will not be
-output. Default: \fIspeed\fP = 0.
-.TP
-.B \-T
-\fItension\fP
-.br
-Sets the \fItension\fP value used in the thin plate spline interpolation.
-
-A \fItension\fP of 0 gives a minimum curvature surface with free edges;
-this is a pure Laplacian solution. A nonzero \fItension\fP tends to
-suppress spurious oscillations and flatten
-the interpolation toward the edges; a \fItension\fP of infinity
-yields a pure thin plate spline solution. The \fItension\fP must be zero or
-greater.
-Default: \fItension\fP = 0.0 (minimum curvature solution).
-.TP
-.B \-U
-\fItime\fP
-.br
-Forces \fBmbgrid\fP to avoid averaging overlapping swaths by
-ignoring the data from later swaths. "Later" data is identified
-using the \fItime\fP value. The time of the first data point
-is saved for each bin in the grid; any other data points which
-are more than \fItime\fP minutes before or after the initial
-data point in the relevent bin are ignored. If \fItime\fP is
-negative, the last data in a bin (within the time lag criterea)
-will be saved and used instead of the first data.
-.TP
-.B \-V-
-Normally, \fBmbgrid\fP prints out information regarding its
-controlling parameters during execution; the
-\fB\-V\fP option causes the program to also print out statements
-indicating its progress.
-.TP
-.B \-W
-\fIscale\fP
-.br
-Sets the width of the gaussian weighting function in terms of
-the grid spacing.  The distance to the 1/e point of the weighting
-function is given by half of the grid spacing times \fIscale\fP.
-Default: \fIscale\fP = 1.0
-.TP
-.B \-X
-\fIextend\fP
-.br
-Extends the size of the internal grid so that the output grid is a
-subset from the center of a larger grid.   This allows data outside
-the output grid to guide the spline interpolation of data gaps which
-happen to lie at the the edge of the output grid.  The amount of
-extension is \fIextend\fP times the grid width/height to each side.
-Thus, if \fIextend\fP=1.0, then the internal grid will have dimensions
-three times the output grid.
-Default: \fIextend\fP = 0.0
-.SH EXAMPLES
-Suppose you want to grid some Hydrosweep data in six data files over
-a region with longitude bounds of 139.9W to 139.65W and latitude bounds
-of 9.7S to 9.45S.  To get a 110 m grid spacing, you need a grid dimensions
-of 251 (x or longitude) and 251 (y or latitude). First,
-create a datalist file using a text editor which contains the
-data filenames followed by the appropriate format identifier:
-
- 	d123e.mb24 24
- 	d126e.mb24 24
- 	d128e.mb24 24
- 	d129e.mb24 24
- 	d130e.mb24 24
- 	d131e.mb24 24
-
-Then, run \fBmbgrid\fP as follows:
- 	mbgrid \-R220.1/220.35/-9.7/-9.45 \-D251/251 \\
- 		-L1 \-C251  \-N \\
- 		-Idatalist \-Ourville_int \-V
-
-By specifying a clipping dimension of 251 we insure that the grid
-will be filled in through spine interpolation even in the areas
-not covered by data. The output looks like:
-
- Program MBGRID
- Version $Id: mbgrid.1 2215 2014-11-29 22:21:19Z caress $
- MB-system Version 4.5
-
- MBGRID Parameters:
- List of input files: datalist
- Output fileroot:     urville_int
- Input Data Type:     Bathymetry
- Gridding algorithm:  Gaussian Weighted Mean
- Grid dimensions: 251 251
- Grid bounds:
-   Longitude:  220.1000  220.3500
-   Latitude:    \-9.7000   \-9.4500
- Working grid dimensions: 251 251
- Working Grid bounds:
-   Longitude:  220.1000  220.3500
-   Latitude:    \-9.7000   \-9.4500
- Input data bounds:
-   Longitude:  219.8500  220.6000
-   Latitude:    \-9.9500   \-9.2000
- Longitude interval: 0.001000 degrees or 109.778801 m
- Latitude interval:  0.001000 degrees or 110.605002 m
- Gaussian filter 1/e length: 0.055096 km
- Spline interpolation applied with clipping dimension: 251
- Spline tension (range 0.0 to 1.0): 10000000000.000000
- Grid format 3:  GMT version 2 grd (netCDF)
- NaN values used to flag regions with no data
- MBIO parameters:
-   Ping averaging:       1
-   Longitude flipping:   1
-   Speed minimum:       0.0 km/hr
-
- 29075 data points processed in d123e.mb8
- 0 data points processed in d125e.mb8
- 98175 data points processed in d126e.mb8
- 68637 data points processed in d128e.mb8
- 20703 data points processed in d129e.mb8
- 80372 data points processed in d130e.mb8
- 55620 data points processed in d131e.mb8
-
- 352582 total data points processed
-
- Making raw grid...
-
- Doing spline interpolation with 53513 data points...
-
- Total number of bins:            63001
- Bins set using data:             53513
- Bins set using interpolation:    9488
- Bins not set:                    0
- Maximum number of data in a bin: 65
- Minimum value:     504.93   Maximum value:    3405.75
- Minimum sigma:    0.14060   Maximum sigma:  275.53399
-
- Outputting results...
-
- executing mbm_grdplot...
- mbm_grdplot \-Iurville_int.grd \-G1 \-C \-D \-V \-L"File urville_int.grd \- Bathymetry Grid:Depth (m)"
-
- Program Status:
- \--------------
-
-   Plot Style:
-     Color Fill
-     Contours
-     Horizontal Color Scale
-
-   Input Files:
-     Data GRD File:            urville_int.grd
-     Intensity GRD List File:
-
-   Output Files:
-     Output plot name root:    urville_int.grd
-     Color palette table:      urville_int.grd.cpt
-     Plotting shellscript:     urville_int.grd.cmd
-     Plot file:                urville_int.grd.ps
-
-   Plot Attributes:
-     Plot width:               6.5000
-     Plot height:              6.5489
-     Page size:                a
-     Page width:               8.5
-     Page height:              11
-     Projection:           \-Jm26
-     Axes annotation:          5m/5m:."File urville_int.grd \- Bathymetry Grid":
-     Orientation:              portrait
-     Number of colors:         11
-     Color Palette:            Haxby Colors
-     Colors reversed
-
-   Grid Data Attributes:
-     Longitude min max:         220.1000   220.3500
-     Latitude min max:       \-9.7000    \-9.4500
-     Data min max:                 504.9       3406
-
-   Primary Grid Plotting Controls:
-     Contour control:          100
-     Color start datum:        350.000000
-     Color end datum:          3850.000000
-     Color datum interval:     350.000000
-
-   GMT Default Values Reset in Script:
-     PAPER_WIDTH               8.5
-     ANOT_FONT                 Helvetica
-     LABEL_FONT                Helvetica
-     HEADER_FONT               Helvetica
-     ANOT_FONT_SIZE            8
-     LABEL_FONT_SIZE           8
-     HEADER_FONT_SIZE          10
-     FRAME_WIDTH               0.074999999999999997
-     TICK_LENGTH               0.074999999999999997
-     PAGE_ORIENTATION          LANDSCAPE
-     COLOR_BACKGROUND          0/0/0
-     COLOR_FOREGROUND          255/255/255
-     COLOR_NAN                 255/255/255
-
- \--------------
-
- Plot generation shellscript <urville_int.grd.cmd> created.
-
- Instructions:
-   Execute <urville_int.grd.cmd> to generate Postscript plot <urville_int.grd.ps>.
-   Executing <urville_int.grd.cmd> also invokes xpsview to view the plot on the screen.
-
- \--------------
-
-
- Done.
-
-The names of the output files are based on the root character string
-specified using the \fB\-O\fP option.  Since the grid is output as a netCDF
-GRD format file, its filename is "urville_int.grd"; a shellscript
-which will allow the contents of the grid to viewed using \fBGMT\fP programs
-is also output with the filename "urville_int.grd.cmd".
-
-Suppose that one wants to grid the same data considered above using
-the median filtering scheme instead of the default Gaussian weighted
-mean scheme and also outputting grids of the data density and
-standard deviation values. The following will suffice:
- 	mbgrid \-R220.1/220.35/-9.7/-9.45 \-D251/251 \\
- 		-L1 \-C251 \-N \\
- 		-Idatalist \-Ourville_int \-F2 \-M \-V
-
-.SH SEE ALSO
-\fBmbsystem\fP(1), \fBmbmosaic\fP(1), \fBmbm_grid\fP(1), \fBmbm_grd2arc\fP(1)
-
-.SH BUGS
-The options for this program have grown a bit complicated.
-If you have other problems, please let us know.
-
-.SH APPENDIX 1: PROJECTED COORDINATE SYSTEM IDENTIFIERS
-The following is a list of the projected coordinate systems (PCS's)
-that are supported by MB-System. The full PCS definitions are
-found in the file mbsystem/share/Projections.dat. These definitions
-are in the \fBPROJ.4\fP format and derive from the \fBPROJ.4\fP
-4.6.1 distribution obtained from http://trac.osgeo.org/proj/
-in September 2008. The proj library source code has been
-incorporated unchanged into the MB-System package.
-
-The first item on each line is the PCS identifier inside brackets, such
-as <UTM10N> or <epsg32749>. To specify using one of these PCS's, use
-the \fB\-J\fP option, e.g. \fB\-J\fP\fIUTM10N\fP or \fB\-J\fP\fIepsg32749\fP.
-
- \---------------------------------------------------------
- Standard Universal Transverse Mercator (UTM)
-     and Universal Polar Stereographic (UPS)
-     projected coordinate systems for MB-System
- \---------------------------------------------------------
-
- <UTM01N> : WGS 84 / UTM zone 1N
- <UTM02N> : WGS 84 / UTM zone 2N
- <UTM03N> : WGS 84 / UTM zone 3N
- <UTM04N> : WGS 84 / UTM zone 4N
- <UTM05N> : WGS 84 / UTM zone 5N
- <UTM06N> : WGS 84 / UTM zone 6N
- <UTM07N> : WGS 84 / UTM zone 7N
- <UTM08N> : WGS 84 / UTM zone 8N
- <UTM09N> : WGS 84 / UTM zone 9N
- <UTM10N> : WGS 84 / UTM zone 10N
- <UTM11N> : WGS 84 / UTM zone 11N
- <UTM12N> : WGS 84 / UTM zone 12N
- <UTM13N> : WGS 84 / UTM zone 13N
- <UTM14N> : WGS 84 / UTM zone 14N
- <UTM15N> : WGS 84 / UTM zone 15N
- <UTM16N> : WGS 84 / UTM zone 16N
- <UTM17N> : WGS 84 / UTM zone 17N
- <UTM18N> : WGS 84 / UTM zone 18N
- <UTM19N> : WGS 84 / UTM zone 19N
- <UTM20N> : WGS 84 / UTM zone 20N
- <UTM21N> : WGS 84 / UTM zone 21N
- <UTM22N> : WGS 84 / UTM zone 22N
- <UTM23N> : WGS 84 / UTM zone 23N
- <UTM24N> : WGS 84 / UTM zone 24N
- <UTM25N> : WGS 84 / UTM zone 25N
- <UTM26N> : WGS 84 / UTM zone 26N
- <UTM27N> : WGS 84 / UTM zone 27N
- <UTM28N> : WGS 84 / UTM zone 28N
- <UTM29N> : WGS 84 / UTM zone 29N
- <UTM30N> : WGS 84 / UTM zone 30N
- <UTM31N> : WGS 84 / UTM zone 31N
- <UTM32N> : WGS 84 / UTM zone 32N
- <UTM33N> : WGS 84 / UTM zone 33N
- <UTM34N> : WGS 84 / UTM zone 34N
- <UTM35N> : WGS 84 / UTM zone 35N
- <UTM36N> : WGS 84 / UTM zone 36N
- <UTM37N> : WGS 84 / UTM zone 37N
- <UTM38N> : WGS 84 / UTM zone 38N
- <UTM39N> : WGS 84 / UTM zone 39N
- <UTM40N> : WGS 84 / UTM zone 40N
- <UTM41N> : WGS 84 / UTM zone 41N
- <UTM42N> : WGS 84 / UTM zone 42N
- <UTM43N> : WGS 84 / UTM zone 43N
- <UTM44N> : WGS 84 / UTM zone 44N
- <UTM45N> : WGS 84 / UTM zone 45N
- <UTM46N> : WGS 84 / UTM zone 46N
- <UTM47N> : WGS 84 / UTM zone 47N
- <UTM48N> : WGS 84 / UTM zone 48N
- <UTM49N> : WGS 84 / UTM zone 49N
- <UTM50N> : WGS 84 / UTM zone 50N
- <UTM51N> : WGS 84 / UTM zone 51N
- <UTM52N> : WGS 84 / UTM zone 52N
- <UTM53N> : WGS 84 / UTM zone 53N
- <UTM54N> : WGS 84 / UTM zone 54N
- <UTM55N> : WGS 84 / UTM zone 55N
- <UTM56N> : WGS 84 / UTM zone 56N
- <UTM57N> : WGS 84 / UTM zone 57N
- <UTM58N> : WGS 84 / UTM zone 58N
- <UTM59N> : WGS 84 / UTM zone 59N
- <UTM60N> : WGS 84 / UTM zone 60N
- <UTM01S> : WGS 84 / UTM zone 1S
- <UTM02S> : WGS 84 / UTM zone 2S
- <UTM03S> : WGS 84 / UTM zone 3S
- <UTM04S> : WGS 84 / UTM zone 4S
- <UTM05S> : WGS 84 / UTM zone 5S
- <UTM06S> : WGS 84 / UTM zone 6S
- <UTM07S> : WGS 84 / UTM zone 7S
- <UTM08S> : WGS 84 / UTM zone 8S
- <UTM09S> : WGS 84 / UTM zone 9S
- <UTM10S> : WGS 84 / UTM zone 10S
- <UTM11S> : WGS 84 / UTM zone 11S
- <UTM12S> : WGS 84 / UTM zone 12S
- <UTM13S> : WGS 84 / UTM zone 13S
- <UTM14S> : WGS 84 / UTM zone 14S
- <UTM15S> : WGS 84 / UTM zone 15S
- <UTM16S> : WGS 84 / UTM zone 16S
- <UTM17S> : WGS 84 / UTM zone 17S
- <UTM18S> : WGS 84 / UTM zone 18S
- <UTM19S> : WGS 84 / UTM zone 19S
- <UTM20S> : WGS 84 / UTM zone 20S
- <UTM21S> : WGS 84 / UTM zone 21S
- <UTM22S> : WGS 84 / UTM zone 22S
- <UTM23S> : WGS 84 / UTM zone 23S
- <UTM24S> : WGS 84 / UTM zone 24S
- <UTM25S> : WGS 84 / UTM zone 25S
- <UTM26S> : WGS 84 / UTM zone 26S
- <UTM27S> : WGS 84 / UTM zone 27S
- <UTM28S> : WGS 84 / UTM zone 28S
- <UTM29S> : WGS 84 / UTM zone 29S
- <UTM30S> : WGS 84 / UTM zone 30S
- <UTM31S> : WGS 84 / UTM zone 31S
- <UTM32S> : WGS 84 / UTM zone 32S
- <UTM33S> : WGS 84 / UTM zone 33S
- <UTM34S> : WGS 84 / UTM zone 34S
- <UTM35S> : WGS 84 / UTM zone 35S
- <UTM36S> : WGS 84 / UTM zone 36S
- <UTM37S> : WGS 84 / UTM zone 37S
- <UTM38S> : WGS 84 / UTM zone 38S
- <UTM39S> : WGS 84 / UTM zone 39S
- <UTM40S> : WGS 84 / UTM zone 40S
- <UTM41S> : WGS 84 / UTM zone 41S
- <UTM42S> : WGS 84 / UTM zone 42S
- <UTM43S> : WGS 84 / UTM zone 43S
- <UTM44S> : WGS 84 / UTM zone 44S
- <UTM45S> : WGS 84 / UTM zone 45S
- <UTM46S> : WGS 84 / UTM zone 46S
- <UTM47S> : WGS 84 / UTM zone 47S
- <UTM48S> : WGS 84 / UTM zone 48S
- <UTM49S> : WGS 84 / UTM zone 49S
- <UTM50S> : WGS 84 / UTM zone 50S
- <UTM51S> : WGS 84 / UTM zone 51S
- <UTM52S> : WGS 84 / UTM zone 52S
- <UTM53S> : WGS 84 / UTM zone 53S
- <UTM54S> : WGS 84 / UTM zone 54S
- <UTM55S> : WGS 84 / UTM zone 55S
- <UTM56S> : WGS 84 / UTM zone 56S
- <UTM57S> : WGS 84 / UTM zone 57S
- <UTM58S> : WGS 84 / UTM zone 58S
- <UTM59S> : WGS 84 / UTM zone 59S
- <UTM60S> : WGS 84 / UTM zone 60S
- <UPSN> : WGS 84 / UPS North
- <UPSS> : WGS 84 / UPS South
-
- \---------------------------------------------------------
- Listing of State Plane North American Datum Zones
- \---------------------------------------------------------
-   MB-System projection ids are the zone number
-   prefixed by either "nad27sp" or "nad83sp"
- \----------------------------------------------
-                                NGS zone number
- State and zone                  1927     1983
- \----------------------------------------------
- Alabama east ..................  101      101
- Alabama west ..................  102      102
- Alaska zone no. 1 ............. 5001     5001
- Alaska zone no. 2 ............. 5002     5002
- Alaska zone no. 3 ............. 5003     5003
- Alaska zone no. 4 ............. 5004     5004
- Alaska zone no. 5 ............. 5005     5005
- Alaska zone no. 6 ............. 5006     5006
- Alaska zone no. 7 ............. 5007     5007
- Alaska zone no. 8 ............. 5008     5008
- Alaska zone no. 9 ............. 5009     5009
- Alaska zone no. 10 ............ 5010     5010
- American Samoa ................ 5300
- Arizona central ...............  202      202
- Arizona east ..................  201      201
- Arizona west ..................  203      203
- Arkansas north ................  301      301
- Arkansas south ................  302      302
- California I ..................  401      401
- California II .................  402      402
- California III ................  403      403
- California IV .................  404      404
- California V ..................  405      405
- California VI .................  406      406
- California VII ................  407
- Colorado central ..............  502      502
- Colorado north ................  501      501
- Colorado south ................  503      503
- Connecticut ...................  600      600
- Delaware ......................  700      700
- Florida east ..................  901      901
- Florida north .................  903      903
- Florida west ..................  902      902
- Georgia east .................. 1001     1001
- Georgia west .................. 1002     1002
- Guam Island ................... 5400
- Hawaii 1 ...................... 5101     5101
- Hawaii 2 ...................... 5102     5102
- Hawaii 3 ...................... 5103     5103
- Hawaii 4 ...................... 5104     5104
- Hawaii 5 ...................... 5105     5105
- Idaho central ................. 1102     1102
- Idaho east .................... 1101     1101
- Idaho west .................... 1103     1103
- Illinois east ................. 1201     1201
- Illinois west ................. 1202     1202
- Indiana east .................. 1301     1301
- Indiana west .................. 1302     1302
- Iowa north .................... 1401     1401
- Iowa south .................... 1402     1402
- Kansas north .................. 1501     1501
- Kansas south .................. 1502     1502
- Kentucky north ................ 1601     1601
- Kentucky south ................ 1602     1602
- Louisiana north ............... 1701     1701
- Louisiana offshore ............ 1703     1703
- Louisiana south ............... 1702     1702
- Maine east .................... 1801     1801
- Maine west .................... 1802     1802
- Maryland ...................... 1900     1900
- Massachusetts island .......... 2002     2002
- Massachusetts mainland ........ 2001     2001
- Michigan central/l ............ 2112     2112 current
- Michigan central/m ............ 2102          old
- Michigan east ................. 2101          old
- Michigan north ................ 2111     2111 current
- Michigan south ................ 2113     2113 current
- Michigan west ................. 2103          old
- Minnesota central ............. 2202     2202
- Minnesota north ............... 2201     2201
- Minnesota south ............... 2203     2203
- Mississippi east .............. 2301     2301
- Mississippi west .............. 2302     2302
- Missouri central .............. 2402     2402
- Missouri east ................. 2401     2401
- Missouri west ................. 2403     2403
- Montana .......................          2500
- Montana central ............... 2502
- Montana north ................. 2501
- Montana south ................. 2503
- Nebraska ......................          2600
- Nebraska north ................ 2601
- Nebraska south ................ 2602
- Nevada central ................ 2702     2702
- Nevada east ................... 2701     2701
- Nevada west ................... 2703     2703
- New hampshire ................. 2800     2800
- New jersey .................... 2900     2900
- New mexico central ............ 3002     3002
- New mexico east ............... 3001     3001
- New mexico west ............... 3003     3003
- New york central .............. 3102     3102
- New york east ................. 3101     3101
- New york long island .......... 3104     3104
- New york west ................. 3103     3103
- North carolina ................ 3200     3200
- North dakota north ............ 3301     3301
- North dakota south ............ 3302     3302
- Ohio north .................... 3401     3401
- Ohio south .................... 3402     3402
- Oklahoma north ................ 3501     3501
- Oklahoma south ................ 3502     3502
- Oregon north .................. 3601     3601
- Oregon south .................. 3602     3602
- Pennsylvania north ............ 3701     3701
- Pennsylvania south ............ 3702     3702
- Puerto Rico, Virgin Islands ... 5201     5200
- Rhode Island .................. 3800     3800
- South Carolina ................          3900
- South Carolina north .......... 3901
- South Carolina south .......... 3902
- South Dakota north ............ 4001     4001
- South Dakota south ............ 4002     4002
- Tennessee ..................... 4100     4100
- Texas central ................. 4203     4203
- Texas north ................... 4201     4201
- Texas north central ........... 4202     4202
- Texas south ................... 4205     4205
- Texas south central ........... 4204     4204
- Utah central .................. 4302     4302
- Utah north .................... 4301     4301
- Utah south .................... 4303     4303
- Vermont ....................... 4400     4400
- Virgin Islands, St. Croix ..... 5202
- Virginia north ................ 4501     4501
- Virginia south ................ 4502     4502
- Washington north .............. 4601     4601
- Washington south .............. 4602     4602
- West Virginia north ........... 4701     4701
- West Virginia south ........... 4702     4702
- Wisconsin central ............. 4802     4802
- Wisconsin north ............... 4801     4801
- Wisconsin south ............... 4803     4803
- Wyoming east .................. 4901     4901
- Wyoming east central .......... 4902     4902
- Wyoming west .................. 4904     4904
- Wyoming west central .......... 4903     4903
- \----------------------------------------------
-
- \---------------------------------------------------------
- State Plane Coordinate Systems
- North American Datum 1927
- \---------------------------------------------------------
- <nad27sp101> : alabama east> : nad27sp
- <nad27sp102> : alabama west> : nad27sp
- <nad27sp5010> : alaska zone no. 10> : nad27sp
- <nad27sp5300> : american samoa> : nad27sp
- <nad27sp201> : arizona east> : nad27sp
- <nad27sp202> : arizona central> : nad27sp
- <nad27sp203> : arizona west> : nad27sp
- <nad27sp301> : arkansas north> : nad27sp
- <nad27sp302> : arkansas south> : nad27sp
- <nad27sp401> : california i> : nad27sp
- <nad27sp402> : california ii> : nad27sp
- <nad27sp403> : california iii> : nad27sp
- <nad27sp404> : california iv> : nad27sp
- <nad27sp405> : california v> : nad27sp
- <nad27sp406> : california vi> : nad27sp
- <nad27sp407> : california vii> : nad27sp
- <nad27sp501> : colorado north> : nad27sp
- <nad27sp502> : colorado central> : nad27sp
- <nad27sp503> : colorado south> : nad27sp
- <nad27sp600> : connecticut \---> : nad27sp
- <nad27sp700> : delaware \---> : nad27sp
- <nad27sp901> : florida east> : nad27sp
- <nad27sp902> : florida west> : nad27sp
- <nad27sp903> : florida north> : nad27sp
- <nad27sp1001> : georgia east> : nad27sp
- <nad27sp1002> : georgia west> : nad27sp
- <nad27sp5101> : hawaii 1> : nad27sp
- <nad27sp5102> : hawaii 2> : nad27sp
- <nad27sp5103> : hawaii 3> : nad27sp
- <nad27sp5104> : hawaii 4> : nad27sp
- <nad27sp5105> : hawaii 5> : nad27sp
- <nad27sp1101> : idaho east> : nad27sp
- <nad27sp1102> : idaho central> : nad27sp
- <nad27sp1103> : idaho west> : nad27sp
- <nad27sp1201> : illinois east> : nad27sp
- <nad27sp1202> : illinois west> : nad27sp
- <nad27sp1301> : indiana east> : nad27sp
- <nad27sp1302> : indiana west> : nad27sp
- <nad27sp1401> : iowa north> : nad27sp
- <nad27sp1402> : iowa south> : nad27sp
- <nad27sp1501> : kansas north> : nad27sp
- <nad27sp1502> : kansas south> : nad27sp
- <nad27sp1601> : kentucky north> : nad27sp
- <nad27sp1602> : kentucky south> : nad27sp
- <nad27sp1701> : louisiana north> : nad27sp
- <nad27sp1702> : louisiana south> : nad27sp
- <nad27sp1703> : louisiana offshore> : nad27sp
- <nad27sp1801> : maine east> : nad27sp
- <nad27sp1802> : maine west> : nad27sp
- <nad27sp1900> : maryland \---> : nad27sp
- <nad27sp2001> : massachusetts mainland> : nad27sp
- <nad27sp2002> : massachusetts island> : nad27sp
- <nad27sp2101> : michigan east> : nad27sp
- <nad27sp2102> : michigan central/m> : nad27sp
- <nad27sp2103> : michigan west> : nad27sp
- <nad27sp2111> : michigan north> : nad27sp
- <nad27sp2112> : michigan central/l> : nad27sp
- <nad27sp2113> : michigan south> : nad27sp
- <nad27sp2201> : minnesota north> : nad27sp
- <nad27sp2202> : minnesota central> : nad27sp
- <nad27sp2203> : minnesota south> : nad27sp
- <nad27sp2301> : mississippi east> : nad27sp
- <nad27sp2302> : mississippi west> : nad27sp
- <nad27sp2401> : missouri east> : nad27sp
- <nad27sp2402> : missouri central> : nad27sp
- <nad27sp2403> : missouri west> : nad27sp
- <nad27sp2501> : montana north> : nad27sp
- <nad27sp2502> : montana central> : nad27sp
- <nad27sp2503> : montana south> : nad27sp
- <nad27sp2601> : nebraska north> : nad27sp
- <nad27sp2602> : nebraska south> : nad27sp
- <nad27sp2701> : nevada east> : nad27sp
- <nad27sp2702> : nevada central> : nad27sp
- <nad27sp2703> : nevada west> : nad27sp
- <nad27sp2800> : new hampshire \---> : nad27sp
- <nad27sp2900> : new jersey \---> : nad27sp
- <nad27sp3001> : new mexico east> : nad27sp
- <nad27sp3002> : new mexico central> : nad27sp
- <nad27sp3003> : new mexico west> : nad27sp
- <nad27sp3101> : new york east> : nad27sp
- <nad27sp3102> : new york central> : nad27sp
- <nad27sp3103> : new york west> : nad27sp
- <nad27sp3104> : new york long island> : nad27sp
- <nad27sp3200> : north carolina \---> : nad27sp
- <nad27sp3301> : north dakota north> : nad27sp
- <nad27sp3302> : north dakota south> : nad27sp
- <nad27sp3401> : ohio north> : nad27sp
- <nad27sp3402> : ohio south> : nad27sp
- <nad27sp3501> : oklahoma north> : nad27sp
- <nad27sp3502> : oklahoma south> : nad27sp
- <nad27sp3601> : oregon north> : nad27sp
- <nad27sp3602> : oregon south> : nad27sp
- <nad27sp3701> : pennsylvania north> : nad27sp
- <nad27sp3702> : pennsylvania south> : nad27sp
- <nad27sp3800> : rhode island \---> : nad27sp
- <nad27sp3901> : south carolina north> : nad27sp
- <nad27sp3902> : south carolina south> : nad27sp
- <nad27sp4001> : south dakota north> : nad27sp
- <nad27sp4002> : south dakota south> : nad27sp
- <nad27sp4100> : tennessee \---> : nad27sp
- <nad27sp4201> : texas north> : nad27sp
- <nad27sp4202> : texas north central> : nad27sp
- <nad27sp4203> : texas central> : nad27sp
- <nad27sp4204> : texas south central> : nad27sp
- <nad27sp4205> : texas south> : nad27sp
- <nad27sp4301> : utah north> : nad27sp
- <nad27sp4302> : utah central> : nad27sp
- <nad27sp4303> : utah south> : nad27sp
- <nad27sp4400> : vermont \---> : nad27sp
- <nad27sp4501> : virginia north> : nad27sp
- <nad27sp4502> : virginia south> : nad27sp
- <nad27sp4601> : washington north> : nad27sp
- <nad27sp4602> : washington south> : nad27sp
- <nad27sp4701> : west virginia north> : nad27sp
- <nad27sp4702> : west virginia south> : nad27sp
- <nad27sp4801> : wisconsin north> : nad27sp
- <nad27sp4802> : wisconsin central> : nad27sp
- <nad27sp4803> : wisconsin south> : nad27sp
- <nad27sp4901> : wyoming east> : nad27sp
- <nad27sp4902> : wyoming east central> : nad27sp
- <nad27sp4903> : wyoming west central> : nad27sp
- <nad27sp4904> : wyoming west> : nad27sp
- <nad27sp5001> : alaska zone no. 1> : nad27sp
- <nad27sp5002> : alaska zone no. 2> : nad27sp
- <nad27sp5003> : alaska zone no. 3> : nad27sp
- <nad27sp5004> : alaska zone no. 4> : nad27sp
- <nad27sp5005> : alaska zone no. 5> : nad27sp
- <nad27sp5006> : alaska zone no. 6> : nad27sp
- <nad27sp5007> : alaska zone no. 7> : nad27sp
- <nad27sp5008> : alaska zone no. 8> : nad27sp
- <nad27sp5009> : alaska zone no. 9> : nad27sp
- <nad27sp5201> : puerto rico and virgin islands> : nad27sp
- <nad27sp5202> : virgin islands st. croix> : nad27sp
- <nad27sp5400> : guam island> : nad27sp
-
- \---------------------------------------------------------
- State Plane Coordinate Systems
- North American Datum 1983
- \---------------------------------------------------------
- <nad83sp101> : alabama east> : nad83
- <nad83sp102> : alabama west> : nad83
- <nad83sp5010> : alaska zone no. 10> : nad83
- <nad83sp201> : arizona east> : nad83
- <nad83sp202> : arizona central> : nad83
- <nad83sp203> : arizona west> : nad83
- <nad83sp301> : arkansas north> : nad83
- <nad83sp302> : arkansas south> : nad83
- <nad83sp401> : california i> : nad83
- <nad83sp402> : california ii> : nad83
- <nad83sp403> : california iii> : nad83
- <nad83sp404> : california iv> : nad83
- <nad83sp405> : california v> : nad83
- <nad83sp406> : california vi> : nad83
- <nad83sp501> : colorado north> : nad83
- <nad83sp502> : colorado central> : nad83
- <nad83sp503> : colorado south> : nad83
- <nad83sp600> : connecticut \---> : nad83
- <nad83sp700> : delaware \---> : nad83
- <nad83sp901> : florida east> : nad83
- <nad83sp902> : florida west> : nad83
- <nad83sp903> : florida north> : nad83
- <nad83sp1001> : georgia east> : nad83
- <nad83sp1002> : georgia west> : nad83
- <nad83sp5101> : hawaii 1> : nad83
- <nad83sp5102> : hawaii 2> : nad83
- <nad83sp5103> : hawaii 3> : nad83
- <nad83sp5104> : hawaii 4> : nad83
- <nad83sp5105> : hawaii 5> : nad83
- <nad83sp1101> : idaho east> : nad83
- <nad83sp1102> : idaho central> : nad83
- <nad83sp1103> : idaho west> : nad83
- <nad83sp1201> : illinois east> : nad83
- <nad83sp1202> : illinois west> : nad83
- <nad83sp1301> : indiana east> : nad83
- <nad83sp1302> : indiana west> : nad83
- <nad83sp1401> : iowa north> : nad83
- <nad83sp1402> : iowa south> : nad83
- <nad83sp1501> : kansas north> : nad83
- <nad83sp1502> : kansas south> : nad83
- <nad83sp1601> : kentucky north> : nad83
- <nad83sp1602> : kentucky south> : nad83
- <nad83sp1701> : louisiana north> : nad83
- <nad83sp1702> : louisiana south> : nad83
- <nad83sp1703> : louisiana offshore> : nad83
- <nad83sp1801> : maine east> : nad83
- <nad83sp1802> : maine west> : nad83
- <nad83sp1900> : maryland \---> : nad83
- <nad83sp2001> : massachusetts mainland> : nad83
- <nad83sp2002> : massachusetts island> : nad83
- <nad83sp2111> : michigan north> : nad83
- <nad83sp2112> : michigan central/l> : nad83
- <nad83sp2113> : michigan south> : nad83
- <nad83sp2201> : minnesota north> : nad83
- <nad83sp2202> : minnesota central> : nad83
- <nad83sp2203> : minnesota south> : nad83
- <nad83sp2301> : mississippi east> : nad83
- <nad83sp2302> : mississippi west> : nad83
- <nad83sp2401> : missouri east> : nad83
- <nad83sp2402> : missouri central> : nad83
- <nad83sp2403> : missouri west> : nad83
- <nad83sp2500> : montana> : nad83
- <nad83sp2600> : nebraska> : nad83
- <nad83sp2701> : nevada east> : nad83
- <nad83sp2702> : nevada central> : nad83
- <nad83sp2703> : nevada west> : nad83
- <nad83sp2800> : new hampshire \---> : nad83
- <nad83sp2900> : new jersey \---> : nad83
- <nad83sp3001> : new mexico east> : nad83
- <nad83sp3002> : new mexico central> : nad83
- <nad83sp3003> : new mexico west> : nad83
- <nad83sp3101> : new york east> : nad83
- <nad83sp3102> : new york central> : nad83
- <nad83sp3103> : new york west> : nad83
- <nad83sp3104> : new york long island> : nad83
- <nad83sp3200> : north carolina \---> : nad83
- <nad83sp3301> : north dakota north> : nad83
- <nad83sp3302> : north dakota south> : nad83
- <nad83sp3401> : ohio north> : nad83
- <nad83sp3402> : ohio south> : nad83
- <nad83sp3501> : oklahoma north> : nad83
- <nad83sp3502> : oklahoma south> : nad83
- <nad83sp3601> : oregon north> : nad83
- <nad83sp3602> : oregon south> : nad83
- <nad83sp3701> : pennsylvania north> : nad83
- <nad83sp3702> : pennsylvania south> : nad83
- <nad83sp3800> : rhode island \---> : nad83
- <nad83sp3900> : south carolina> : nad83
- <nad83sp4001> : south dakota north> : nad83
- <nad83sp4002> : south dakota south> : nad83
- <nad83sp4100> : tennessee \---> : nad83
- <nad83sp4201> : texas north> : nad83
- <nad83sp4202> : texas north central> : nad83
- <nad83sp4203> : texas central> : nad83
- <nad83sp4204> : texas south central> : nad83
- <nad83sp4205> : texas south> : nad83
- <nad83sp4301> : utah north> : nad83
- <nad83sp4302> : utah central> : nad83
- <nad83sp4303> : utah south> : nad83
- <nad83sp4400> : vermont \---> : nad83
- <nad83sp4501> : virginia north> : nad83
- <nad83sp4502> : virginia south> : nad83
- <nad83sp4601> : washington north> : nad83
- <nad83sp4602> : washington south> : nad83
- <nad83sp4701> : west virginia north> : nad83
- <nad83sp4702> : west virginia south> : nad83
- <nad83sp4801> : wisconsin north> : nad83
- <nad83sp4802> : wisconsin central> : nad83
- <nad83sp4803> : wisconsin south> : nad83
- <nad83sp4901> : wyoming east> : nad83
- <nad83sp4902> : wyoming east central> : nad83
- <nad83sp4903> : wyoming west central> : nad83
- <nad83sp4904> : wyoming west> : nad83
- <nad83sp5001> : alaska zone no. 1> : nad83
- <nad83sp5002> : alaska zone no. 2> : nad83
- <nad83sp5003> : alaska zone no. 3> : nad83
- <nad83sp5004> : alaska zone no. 4> : nad83
- <nad83sp5005> : alaska zone no. 5> : nad83
- <nad83sp5006> : alaska zone no. 6> : nad83
- <nad83sp5007> : alaska zone no. 7> : nad83
- <nad83sp5008> : alaska zone no. 8> : nad83
- <nad83sp5009> : alaska zone no. 9> : nad83
- <nad83sp5200> : puerto rico and virgin islands> : nad83
-
- \---------------------------------------------------------
- Great Lakes Grids using Clarke 1866 ellipsoid
- \---------------------------------------------------------
- <erie-etal> : Lake Erie, Ontario and St. Lawrence River.
- <huron> : Lake Huron
- <michigan> : Lake Michigan
- <superior> : Lake Superior, Lake of the Woods
-
- \---------------------------------------------------------
- EPSG projection definitions
- \---------------------------------------------------------
- <epsg4001> : Unknown datum based upon the Airy 1830 ellipsoid
- <epsg4002> : Unknown datum based upon the Airy Modified 1849 ellipsoid
- <epsg4003> : Unknown datum based upon the Australian National Spheroid
- <epsg4004> : Unknown datum based upon the Bessel 1841 ellipsoid
- <epsg4005> : Unknown datum based upon the Bessel Modified ellipsoid
- <epsg4006> : Unknown datum based upon the Bessel Namibia ellipsoid
- <epsg4007> : Unknown datum based upon the Clarke 1858 ellipsoid
- <epsg4008> : Unknown datum based upon the Clarke 1866 ellipsoid
- <epsg4009> : Unknown datum based upon the Clarke 1866 Michigan ellipsoid
- <epsg4010> : Unknown datum based upon the Clarke 1880 (Benoit) ellipsoid
- <epsg4011> : Unknown datum based upon the Clarke 1880 (IGN) ellipsoid
- <epsg4012> : Unknown datum based upon the Clarke 1880 (RGS) ellipsoid
- <epsg4013> : Unknown datum based upon the Clarke 1880 (Arc) ellipsoid
- <epsg4014> : Unknown datum based upon the Clarke 1880 (SGA 1922) ellipsoid
- <epsg4015> : Unknown datum based upon the Everest 1830 (1937 Adjustment) ellipsoid
- <epsg4016> : Unknown datum based upon the Everest 1830 (1967 Definition) ellipsoid
- <epsg4018> : Unknown datum based upon the Everest 1830 Modified ellipsoid
- <epsg4019> : Unknown datum based upon the GRS 1980 ellipsoid
- <epsg4020> : Unknown datum based upon the Helmert 1906 ellipsoid
- <epsg4021> : Unknown datum based upon the Indonesian National Spheroid
- <epsg4022> : Unknown datum based upon the International 1924 ellipsoid
- <epsg4024> : Unknown datum based upon the Krassowsky 1940 ellipsoid
- <epsg4025> : Unknown datum based upon the NWL 9D ellipsoid
- <epsg4027> : Unknown datum based upon the Plessis 1817 ellipsoid
- <epsg4028> : Unknown datum based upon the Struve 1860 ellipsoid
- <epsg4029> : Unknown datum based upon the War Office ellipsoid
- <epsg4030> : Unknown datum based upon the WGS 84 ellipsoid
- <epsg4031> : Unknown datum based upon the GEM 10C ellipsoid
- <epsg4032> : Unknown datum based upon the OSU86F ellipsoid
- <epsg4033> : Unknown datum based upon the OSU91A ellipsoid
- <epsg4034> : Unknown datum based upon the Clarke 1880 ellipsoid
- <epsg4035> : Unknown datum based upon the Authalic Sphere
- <epsg4036> : Unknown datum based upon the GRS 1967 ellipsoid
- <epsg4041> : Unknown datum based upon the Average Terrestrial System 1977 ellipsoid
- <epsg4042> : Unknown datum based upon the Everest (1830 Definition) ellipsoid
- <epsg4043> : Unknown datum based upon the WGS 72 ellipsoid
- <epsg4044> : Unknown datum based upon the Everest 1830 (1962 Definition) ellipsoid
- <epsg4045> : Unknown datum based upon the Everest 1830 (1975 Definition) ellipsoid
- <epsg4047> : Unspecified datum based upon the GRS 1980 Authalic Sphere
- <epsg4052> : Unspecified datum based upon the Clarke 1866 Authalic Sphere
- <epsg4053> : Unspecified datum based upon the International 1924 Authalic Sphere
- <epsg4054> : Unspecified datum based upon the Hughes 1980 ellipsoid
- <epsg4120> : Greek
- <epsg4121> : GGRS87
- <epsg4122> : ATS77
- <epsg4123> : KKJ
- <epsg4124> : RT90
- <epsg4125> : Samboja
- <epsg4126> : LKS94 (ETRS89)
- <epsg4127> : Tete
- <epsg4128> : Madzansua
- <epsg4129> : Observatario
- <epsg4130> : Moznet
- <epsg4131> : Indian 1960
- <epsg4132> : FD58
- <epsg4133> : EST92
- <epsg4134> : PDO Survey Datum 1993
- <epsg4135> : Old Hawaiian
- <epsg4136> : St. Lawrence Island
- <epsg4137> : St. Paul Island
- <epsg4138> : St. George Island
- <epsg4139> : Puerto Rico
- <epsg4140> : NAD83(CSRS98)
- <epsg4141> : Israel
- <epsg4142> : Locodjo 1965
- <epsg4143> : Abidjan 1987
- <epsg4144> : Kalianpur 1937
- <epsg4145> : Kalianpur 1962
- <epsg4146> : Kalianpur 1975
- <epsg4147> : Hanoi 1972
- <epsg4148> : Hartebeesthoek94
- <epsg4149> : CH1903
- <epsg4150> : CH1903+
- <epsg4151> : CHTRF95
- <epsg4152> : NAD83(HARN)
- <epsg4153> : Rassadiran
- <epsg4154> : ED50(ED77)
- <epsg4155> : Dabola 1981
- <epsg4156> : S-JTSK
- <epsg4157> : Mount Dillon
- <epsg4158> : Naparima 1955
- <epsg4159> : ELD79
- <epsg4160> : Chos Malal 1914
- <epsg4161> : Pampa del Castillo
- <epsg4162> : Korean 1985
- <epsg4163> : Yemen NGN96
- <epsg4164> : South Yemen
- <epsg4165> : Bissau
- <epsg4166> : Korean 1995
- <epsg4167> : NZGD2000
- <epsg4168> : Accra
- <epsg4169> : American Samoa 1962
- <epsg4170> : SIRGAS
- <epsg4171> : RGF93
- <epsg4172> : POSGAR
- <epsg4173> : IRENET95
- <epsg4174> : Sierra Leone 1924
- <epsg4175> : Sierra Leone 1968
- <epsg4176> : Australian Antarctic
- <epsg4178> : Pulkovo 1942(83)
- <epsg4179> : Pulkovo 1942(58)
- <epsg4180> : EST97
- <epsg4181> : Luxembourg 1930
- <epsg4182> : Azores Occidental 1939
- <epsg4183> : Azores Central 1948
- <epsg4184> : Azores Oriental 1940
- <epsg4185> : Madeira 1936
- <epsg4188> : OSNI 1952
- <epsg4189> : REGVEN
- <epsg4190> : POSGAR 98
- <epsg4191> : Albanian 1987
- <epsg4192> : Douala 1948
- <epsg4193> : Manoca 1962
- <epsg4194> : Qornoq 1927
- <epsg4195> : Scoresbysund 1952
- <epsg4196> : Ammassalik 1958
- <epsg4197> : Garoua
- <epsg4198> : Kousseri
- <epsg4199> : Egypt 1930
- <epsg4200> : Pulkovo 1995
- <epsg4201> : Adindan
- <epsg4202> : AGD66
- <epsg4203> : AGD84
- <epsg4204> : Ain el Abd
- <epsg4205> : Afgooye
- <epsg4206> : Agadez
- <epsg4207> : Lisbon
- <epsg4208> : Aratu
- <epsg4209> : Arc 1950
- <epsg4210> : Arc 1960
- <epsg4211> : Batavia
- <epsg4212> : Barbados 1938
- <epsg4213> : Beduaram
- <epsg4214> : Beijing 1954
- <epsg4215> : Belge 1950
- <epsg4216> : Bermuda 1957
- <epsg4218> : Bogota 1975
- <epsg4219> : Bukit Rimpah
- <epsg4220> : Camacupa
- <epsg4221> : Campo Inchauspe
- <epsg4222> : Cape
- <epsg4223> : Carthage
- <epsg4224> : Chua
- <epsg4225> : Corrego Alegre
- <epsg4226> : Cote d'Ivoire
- <epsg4227> : Deir ez Zor
- <epsg4228> : Douala
- <epsg4229> : Egypt 1907
- <epsg4230> : ED50
- <epsg4231> : ED87
- <epsg4232> : Fahud
- <epsg4233> : Gandajika 1970
- <epsg4234> : Garoua
- <epsg4235> : Guyane Francaise
- <epsg4236> : Hu Tzu Shan
- <epsg4237> : HD72
- <epsg4238> : ID74
- <epsg4239> : Indian 1954
- <epsg4240> : Indian 1975
- <epsg4241> : Jamaica 1875
- <epsg4242> : JAD69
- <epsg4243> : Kalianpur 1880
- <epsg4244> : Kandawala
- <epsg4245> : Kertau 1968
- <epsg4246> : KOC
- <epsg4247> : La Canoa
- <epsg4248> : PSAD56
- <epsg4249> : Lake
- <epsg4250> : Leigon
- <epsg4251> : Liberia 1964
- <epsg4252> : Lome
- <epsg4253> : Luzon 1911
- <epsg4254> : Hito XVIII 1963
- <epsg4255> : Herat North
- <epsg4256> : Mahe 1971
- <epsg4257> : Makassar
- <epsg4258> : ETRS89
- <epsg4259> : Malongo 1987
- <epsg4260> : Manoca
- <epsg4261> : Merchich
- <epsg4262> : Massawa
- <epsg4263> : Minna
- <epsg4264> : Mhast
- <epsg4265> : Monte Mario
- <epsg4266> : M'poraloko
- <epsg4267> : NAD27
- <epsg4268> : NAD27 Michigan
- <epsg4269> : NAD83
- <epsg4270> : Nahrwan 1967
- <epsg4271> : Naparima 1972
- <epsg4272> : NZGD49
- <epsg4273> : NGO 1948
- <epsg4274> : Datum 73
- <epsg4275> : NTF
- <epsg4276> : NSWC 9Z-2
- <epsg4277> : OSGB 1936
- <epsg4278> : OSGB70
- <epsg4279> : OS(SN)80
- <epsg4280> : Padang
- <epsg4281> : Palestine 1923
- <epsg4282> : Pointe Noire
- <epsg4283> : GDA94
- <epsg4284> : Pulkovo 1942
- <epsg4285> : Qatar 1974
- <epsg4286> : Qatar 1948
- <epsg4287> : Qornoq
- <epsg4288> : Loma Quintana
- <epsg4289> : Amersfoort
- <epsg4291> : SAD69
- <epsg4292> : Sapper Hill 1943
- <epsg4293> : Schwarzeck
- <epsg4294> : Segora
- <epsg4295> : Serindung
- <epsg4296> : Sudan
- <epsg4297> : Tananarive
- <epsg4298> : Timbalai 1948
- <epsg4299> : TM65
- <epsg4300> : TM75
- <epsg4301> : Tokyo
- <epsg4302> : Trinidad 1903
- <epsg4303> : TC(1948)
- <epsg4304> : Voirol 1875
- <epsg4306> : Bern 1938
- <epsg4307> : Nord Sahara 1959
- <epsg4308> : RT38
- <epsg4309> : Yacare
- <epsg4310> : Yoff
- <epsg4311> : Zanderij
- <epsg4312> : MGI
- <epsg4313> : Belge 1972
- <epsg4314> : DHDN
- <epsg4315> : Conakry 1905
- <epsg4316> : Dealul Piscului 1933
- <epsg4317> : Dealul Piscului 1970
- <epsg4318> : NGN
- <epsg4319> : KUDAMS
- <epsg4322> : WGS 72
- <epsg4324> : WGS 72BE
- <epsg4326> : WGS 84
- <epsg4600> : Anguilla 1957
- <epsg4601> : Antigua 1943
- <epsg4602> : Dominica 1945
- <epsg4603> : Grenada 1953
- <epsg4604> : Montserrat 1958
- <epsg4605> : St. Kitts 1955
- <epsg4606> : St. Lucia 1955
- <epsg4607> : St. Vincent 1945
- <epsg4608> : NAD27(76)
- <epsg4609> : NAD27(CGQ77)
- <epsg4610> : Xian 1980
- <epsg4611> : Hong Kong 1980
- <epsg4612> : JGD2000
- <epsg4613> : Segara
- <epsg4614> : QND95
- <epsg4615> : Porto Santo
- <epsg4616> : Selvagem Grande
- <epsg4617> : NAD83(CSRS)
- <epsg4618> : SAD69
- <epsg4619> : SWEREF99
- <epsg4620> : Point 58
- <epsg4621> : Fort Marigot
- <epsg4622> : Guadeloupe 1948
- <epsg4623> : CSG67
- <epsg4624> : RGFG95
- <epsg4625> : Martinique 1938
- <epsg4626> : Reunion 1947
- <epsg4627> : RGR92
- <epsg4628> : Tahiti 52
- <epsg4629> : Tahaa 54
- <epsg4630> : IGN72 Nuku Hiva
- <epsg4631> : K0 1949
- <epsg4632> : Combani 1950
- <epsg4633> : IGN56 Lifou
- <epsg4634> : IGN72 Grand Terre
- <epsg4635> : ST87 Ouvea
- <epsg4636> : Petrels 1972
- <epsg4637> : Perroud 1950
- <epsg4638> : Saint Pierre et Miquelon 1950
- <epsg4639> : MOP78
- <epsg4640> : RRAF 1991
- <epsg4641> : IGN53 Mare
- <epsg4642> : ST84 Ile des Pins
- <epsg4643> : ST71 Belep
- <epsg4644> : NEA74 Noumea
- <epsg4645> : RGNC 1991
- <epsg4646> : Grand Comoros
- <epsg4657> : Reykjavik 1900
- <epsg4658> : Hjorsey 1955
- <epsg4659> : ISN93
- <epsg4660> : Helle 1954
- <epsg4661> : LKS92
- <epsg4662> : IGN72 Grande Terre
- <epsg4663> : Porto Santo 1995
- <epsg4664> : Azores Oriental 1995
- <epsg4665> : Azores Central 1995
- <epsg4666> : Lisbon 1890
- <epsg4667> : IKBD-92
- <epsg4668> : ED79
- <epsg4669> : LKS94
- <epsg4670> : IGM95
- <epsg4671> : Voirol 1879
- <epsg4672> : CI1971
- <epsg4673> : CI1979
- <epsg4674> : SIRGAS 2000
- <epsg4675> : Guam 1963
- <epsg4676> : Vientiane 1982
- <epsg4677> : Lao 1993
- <epsg4678> : Lao 1997
- <epsg4679> : Jouik 1961
- <epsg4680> : Nouakchott 1965
- <epsg4681> : Mauritania 1999
- <epsg4682> : Gulshan 303
- <epsg4683> : PRS92
- <epsg4684> : Gan 1970
- <epsg4685> : Gandajika
- <epsg4686> : MAGNA-SIRGAS
- <epsg4687> : RGPF
- <epsg4688> : Fatu Iva 72
- <epsg4689> : IGN63 Hiva Oa
- <epsg4690> : Tahiti 79
- <epsg4691> : Moorea 87
- <epsg4692> : Maupiti 83
- <epsg4693> : Nakhl-e Ghanem
- <epsg4694> : POSGAR 94
- <epsg4695> : Katanga 1955
- <epsg4696> : Kasai 1953
- <epsg4697> : IGC 1962 6th Parallel South
- <epsg4698> : IGN 1962 Kerguelen
- <epsg4699> : Le Pouce 1934
- <epsg4700> : IGN Astro 1960
- <epsg4701> : IGCB 1955
- <epsg4702> : Mauritania 1999
- <epsg4703> : Mhast 1951
- <epsg4704> : Mhast (onshore)
- <epsg4705> : Mhast (offshore)
- <epsg4706> : Egypt Gulf of Suez S-650 TL
- <epsg4707> : Tern Island 1961
- <epsg4708> : Cocos Islands 1965
- <epsg4709> : Iwo Jima 1945
- <epsg4710> : St. Helena 1971
- <epsg4711> : Marcus Island 1952
- <epsg4712> : Ascension Island 1958
- <epsg4713> : Ayabelle Lighthouse
- <epsg4714> : Bellevue
- <epsg4715> : Camp Area Astro
- <epsg4716> : Phoenix Islands 1966
- <epsg4717> : Cape Canaveral
- <epsg4718> : Solomon 1968
- <epsg4719> : Easter Island 1967
- <epsg4720> : Fiji 1986
- <epsg4721> : Fiji 1956
- <epsg4722> : South Georgia 1968
- <epsg4723> : Grand Cayman 1959
- <epsg4724> : Diego Garcia 1969
- <epsg4725> : Johnston Island 1961
- <epsg4726> : Little Cayman 1961
- <epsg4727> : Midway 1961
- <epsg4728> : Pico de la Nieves
- <epsg4729> : Pitcairn 1967
- <epsg4730> : Santo 1965
- <epsg4731> : Viti Levu 1916
- <epsg4732> : Marshall Islands 1960
- <epsg4733> : Wake Island 1952
- <epsg4734> : Tristan 1968
- <epsg4735> : Kusaie 1951
- <epsg4736> : Deception Island
- <epsg4737> : Korea 2000
- <epsg4738> : Hong Kong 1963
- <epsg4739> : Hong Kong 1963(67)
- <epsg4740> : PZ-90
- <epsg4741> : FD54
- <epsg4742> : GDM2000
- <epsg4743> : Karbala 1979 (Polservice)
- <epsg4744> : Nahrwan 1934
- <epsg4745> : RD/83
- <epsg4746> : PD/83
- <epsg4747> : GR96
- <epsg4748> : Vanua Levu 1915
- <epsg4749> : RGNC91-93
- <epsg4750> : ST87 Ouvea
- <epsg4751> : Kertau (RSO)
- <epsg4752> : Viti Levu 1912
- <epsg4753> : fk89
- <epsg4754> : LGD2006
- <epsg4755> : DGN95
- <epsg4756> : VN-2000
- <epsg4757> : SVY21
- <epsg4758> : JAD2001
- <epsg4759> : NAD83(NSRS2007)
- <epsg4760> : WGS 66
- <epsg4801> : Bern 1898 (Bern)
- <epsg4802> : Bogota 1975 (Bogota)
- <epsg4803> : Lisbon (Lisbon)
- <epsg4804> : Makassar (Jakarta)
- <epsg4805> : MGI (Ferro)
- <epsg4806> : Monte Mario (Rome)
- <epsg4807> : NTF (Paris)
- <epsg4808> : Padang (Jakarta)
- <epsg4809> : Belge 1950 (Brussels)
- <epsg4810> : Tananarive (Paris)
- <epsg4811> : Voirol 1875 (Paris)
- <epsg4813> : Batavia (Jakarta)
- <epsg4814> : RT38 (Stockholm)
- <epsg4815> : Greek (Athens)
- <epsg4816> : Carthage (Paris)
- <epsg4817> : NGO 1948 (Oslo)
- <epsg4818> : S-JTSK (Ferro)
- <epsg4819> : Nord Sahara 1959 (Paris)
- <epsg4820> : Segara (Jakarta)
- <epsg4821> : Voirol 1879 (Paris)
- <epsg4901> : ATF (Paris)
- <epsg4902> : NDG (Paris)
- <epsg4903> : Madrid 1870 (Madrid)
- <epsg4904> : Lisbon 1890 (Lisbon)
- <epsg2000> : Anguilla 1957 / British West Indies Grid
- <epsg2001> : Antigua 1943 / British West Indies Grid
- <epsg2002> : Dominica 1945 / British West Indies Grid
- <epsg2003> : Grenada 1953 / British West Indies Grid
- <epsg2004> : Montserrat 1958 / British West Indies Grid
- <epsg2005> : St. Kitts 1955 / British West Indies Grid
- <epsg2006> : St. Lucia 1955 / British West Indies Grid
- <epsg2007> : St. Vincent 45 / British West Indies Grid
- <epsg2008> : NAD27(CGQ77) / SCoPQ zone 2
- <epsg2009> : NAD27(CGQ77) / SCoPQ zone 3
- <epsg2010> : NAD27(CGQ77) / SCoPQ zone 4
- <epsg2011> : NAD27(CGQ77) / SCoPQ zone 5
- <epsg2012> : NAD27(CGQ77) / SCoPQ zone 6
- <epsg2013> : NAD27(CGQ77) / SCoPQ zone 7
- <epsg2014> : NAD27(CGQ77) / SCoPQ zone 8
- <epsg2015> : NAD27(CGQ77) / SCoPQ zone 9
- <epsg2016> : NAD27(CGQ77) / SCoPQ zone 10
- <epsg2017> : NAD27(76) / MTM zone 8
- <epsg2018> : NAD27(76) / MTM zone 9
- <epsg2019> : NAD27(76) / MTM zone 10
- <epsg2020> : NAD27(76) / MTM zone 11
- <epsg2021> : NAD27(76) / MTM zone 12
- <epsg2022> : NAD27(76) / MTM zone 13
- <epsg2023> : NAD27(76) / MTM zone 14
- <epsg2024> : NAD27(76) / MTM zone 15
- <epsg2025> : NAD27(76) / MTM zone 16
- <epsg2026> : NAD27(76) / MTM zone 17
- <epsg2027> : NAD27(76) / UTM zone 15N
- <epsg2028> : NAD27(76) / UTM zone 16N
- <epsg2029> : NAD27(76) / UTM zone 17N
- <epsg2030> : NAD27(76) / UTM zone 18N
- <epsg2031> : NAD27(CGQ77) / UTM zone 17N
- <epsg2032> : NAD27(CGQ77) / UTM zone 18N
- <epsg2033> : NAD27(CGQ77) / UTM zone 19N
- <epsg2034> : NAD27(CGQ77) / UTM zone 20N
- <epsg2035> : NAD27(CGQ77) / UTM zone 21N
- <epsg2036> : NAD83(CSRS98) / New Brunswick Stereo (deprecated)
- <epsg2037> : NAD83(CSRS98) / UTM zone 19N (deprecated)
- <epsg2038> : NAD83(CSRS98) / UTM zone 20N (deprecated)
- <epsg2039> : Israel / Israeli TM Grid
- <epsg2040> : Locodjo 1965 / UTM zone 30N
- <epsg2041> : Abidjan 1987 / UTM zone 30N
- <epsg2042> : Locodjo 1965 / UTM zone 29N
- <epsg2043> : Abidjan 1987 / UTM zone 29N
- <epsg2044> : Hanoi 1972 / Gauss-Kruger zone 18
- <epsg2045> : Hanoi 1972 / Gauss-Kruger zone 19
- <epsg2056> : CH1903+ / LV95
- <epsg2057> : Rassadiran / Nakhl e Taqi
- <epsg2058> : ED50(ED77) / UTM zone 38N
- <epsg2059> : ED50(ED77) / UTM zone 39N
- <epsg2060> : ED50(ED77) / UTM zone 40N
- <epsg2061> : ED50(ED77) / UTM zone 41N
- <epsg2062> : Madrid 1870 (Madrid) / Spain
- <epsg2063> : Dabola 1981 / UTM zone 28N (deprecated)
- <epsg2064> : Dabola 1981 / UTM zone 29N (deprecated)
- <epsg2065> : S-JTSK (Ferro) / Krovak
- <epsg2066> : Mount Dillon / Tobago Grid
- <epsg2067> : Naparima 1955 / UTM zone 20N
- <epsg2068> : ELD79 / Libya zone 5
- <epsg2069> : ELD79 / Libya zone 6
- <epsg2070> : ELD79 / Libya zone 7
- <epsg2071> : ELD79 / Libya zone 8
- <epsg2072> : ELD79 / Libya zone 9
- <epsg2073> : ELD79 / Libya zone 10
- <epsg2074> : ELD79 / Libya zone 11
- <epsg2075> : ELD79 / Libya zone 12
- <epsg2076> : ELD79 / Libya zone 13
- <epsg2077> : ELD79 / UTM zone 32N
- <epsg2078> : ELD79 / UTM zone 33N
- <epsg2079> : ELD79 / UTM zone 34N
- <epsg2080> : ELD79 / UTM zone 35N
- <epsg2081> : Chos Malal 1914 / Argentina zone 2
- <epsg2082> : Pampa del Castillo / Argentina zone 2
- <epsg2083> : Hito XVIII 1963 / Argentina zone 2
- <epsg2084> : Hito XVIII 1963 / UTM zone 19S
- <epsg2085> : NAD27 / Cuba Norte
- <epsg2086> : NAD27 / Cuba Sur
- <epsg2087> : ELD79 / TM 12 NE
- <epsg2088> : Carthage / TM 11 NE
- <epsg2089> : Yemen NGN96 / UTM zone 38N
- <epsg2090> : Yemen NGN96 / UTM zone 39N
- <epsg2091> : South Yemen / Gauss Kruger zone 8 (deprecated)
- <epsg2092> : South Yemen / Gauss Kruger zone 9 (deprecated)
- <epsg2093> : Hanoi 1972 / GK 106 NE
- <epsg2094> : WGS 72BE / TM 106 NE
- <epsg2095> : Bissau / UTM zone 28N
- <epsg2096> : Korean 1985 / Korea East Belt
- <epsg2097> : Korean 1985 / Korea Central Belt
- <epsg2098> : Korean 1985 / Korea West Belt
- <epsg2099> : Qatar 1948 / Qatar Grid
- <epsg2100> : GGRS87 / Greek Grid
- <epsg2101> : Lake / Maracaibo Grid M1
- <epsg2102> : Lake / Maracaibo Grid
- <epsg2103> : Lake / Maracaibo Grid M3
- <epsg2104> : Lake / Maracaibo La Rosa Grid
- <epsg2105> : NZGD2000 / Mount Eden Circuit 2000
- <epsg2106> : NZGD2000 / Bay of Plenty Circuit 2000
- <epsg2107> : NZGD2000 / Poverty Bay Circuit 2000
- <epsg2108> : NZGD2000 / Hawkes Bay Circuit 2000
- <epsg2109> : NZGD2000 / Taranaki Circuit 2000
- <epsg2110> : NZGD2000 / Tuhirangi Circuit 2000
- <epsg2111> : NZGD2000 / Wanganui Circuit 2000
- <epsg2112> : NZGD2000 / Wairarapa Circuit 2000
- <epsg2113> : NZGD2000 / Wellington Circuit 2000
- <epsg2114> : NZGD2000 / Collingwood Circuit 2000
- <epsg2115> : NZGD2000 / Nelson Circuit 2000
- <epsg2116> : NZGD2000 / Karamea Circuit 2000
- <epsg2117> : NZGD2000 / Buller Circuit 2000
- <epsg2118> : NZGD2000 / Grey Circuit 2000
- <epsg2119> : NZGD2000 / Amuri Circuit 2000
- <epsg2120> : NZGD2000 / Marlborough Circuit 2000
- <epsg2121> : NZGD2000 / Hokitika Circuit 2000
- <epsg2122> : NZGD2000 / Okarito Circuit 2000
- <epsg2123> : NZGD2000 / Jacksons Bay Circuit 2000
- <epsg2124> : NZGD2000 / Mount Pleasant Circuit 2000
- <epsg2125> : NZGD2000 / Gawler Circuit 2000
- <epsg2126> : NZGD2000 / Timaru Circuit 2000
- <epsg2127> : NZGD2000 / Lindis Peak Circuit 2000
- <epsg2128> : NZGD2000 / Mount Nicholas Circuit 2000
- <epsg2129> : NZGD2000 / Mount York Circuit 2000
- <epsg2130> : NZGD2000 / Observation Point Circuit 2000
- <epsg2131> : NZGD2000 / North Taieri Circuit 2000
- <epsg2132> : NZGD2000 / Bluff Circuit 2000
- <epsg2133> : NZGD2000 / UTM zone 58S
- <epsg2134> : NZGD2000 / UTM zone 59S
- <epsg2135> : NZGD2000 / UTM zone 60S
- <epsg2136> : Accra / Ghana National Grid
- <epsg2137> : Accra / TM 1 NW
- <epsg2138> : NAD27(CGQ77) / Quebec Lambert
- <epsg2139> : NAD83(CSRS98) / SCoPQ zone 2 (deprecated)
- <epsg2140> : NAD83(CSRS98) / MTM zone 3 (deprecated)
- <epsg2141> : NAD83(CSRS98) / MTM zone 4 (deprecated)
- <epsg2142> : NAD83(CSRS98) / MTM zone 5 (deprecated)
- <epsg2143> : NAD83(CSRS98) / MTM zone 6 (deprecated)
- <epsg2144> : NAD83(CSRS98) / MTM zone 7 (deprecated)
- <epsg2145> : NAD83(CSRS98) / MTM zone 8 (deprecated)
- <epsg2146> : NAD83(CSRS98) / MTM zone 9 (deprecated)
- <epsg2147> : NAD83(CSRS98) / MTM zone 10 (deprecated)
- <epsg2148> : NAD83(CSRS98) / UTM zone 21N (deprecated)
- <epsg2149> : NAD83(CSRS98) / UTM zone 18N (deprecated)
- <epsg2150> : NAD83(CSRS98) / UTM zone 17N (deprecated)
- <epsg2151> : NAD83(CSRS98) / UTM zone 13N (deprecated)
- <epsg2152> : NAD83(CSRS98) / UTM zone 12N (deprecated)
- <epsg2153> : NAD83(CSRS98) / UTM zone 11N (deprecated)
- <epsg2154> : RGF93 / Lambert-93
- <epsg2155> : American Samoa 1962 / American Samoa Lambert (deprecated)
- <epsg2156> : NAD83(HARN) / UTM zone 59S (deprecated)
- <epsg2157> : IRENET95 / Irish Transverse Mercator
- <epsg2158> : IRENET95 / UTM zone 29N
- <epsg2159> : Sierra Leone 1924 / New Colony Grid
- <epsg2160> : Sierra Leone 1924 / New War Office Grid
- <epsg2161> : Sierra Leone 1968 / UTM zone 28N
- <epsg2162> : Sierra Leone 1968 / UTM zone 29N
- <epsg2163> : US National Atlas Equal Area
- <epsg2164> : Locodjo 1965 / TM 5 NW
- <epsg2165> : Abidjan 1987 / TM 5 NW
- <epsg2166> : Pulkovo 1942(83) / Gauss Kruger zone 3 (deprecated)
- <epsg2167> : Pulkovo 1942(83) / Gauss Kruger zone 4 (deprecated)
- <epsg2168> : Pulkovo 1942(83) / Gauss Kruger zone 5 (deprecated)
- <epsg2169> : Luxembourg 1930 / Gauss
- <epsg2170> : MGI / Slovenia Grid
- <epsg2171> : Pulkovo 1942(58) / Poland zone I (deprecated)
- <epsg2172> : Pulkovo 1942(58) / Poland zone II
- <epsg2173> : Pulkovo 1942(58) / Poland zone III
- <epsg2174> : Pulkovo 1942(58) / Poland zone IV
- <epsg2175> : Pulkovo 1942(58) / Poland zone V
- <epsg2176> : ETRS89 / Poland CS2000 zone 5
- <epsg2177> : ETRS89 / Poland CS2000 zone 6
- <epsg2178> : ETRS89 / Poland CS2000 zone 7
- <epsg2179> : ETRS89 / Poland CS2000 zone 8
- <epsg2180> : ETRS89 / Poland CS92
- <epsg2188> : Azores Occidental 1939 / UTM zone 25N
- <epsg2189> : Azores Central 1948 / UTM zone 26N
- <epsg2190> : Azores Oriental 1940 / UTM zone 26N
- <epsg2191> : Madeira 1936 / UTM zone 28N (deprecated)
- <epsg2192> : ED50 / France EuroLambert
- <epsg2193> : NZGD2000 / New Zealand Transverse Mercator
- <epsg2194> : American Samoa 1962 / American Samoa Lambert (deprecated)
- <epsg2195> : NAD83(HARN) / UTM zone 2S
- <epsg2196> : ETRS89 / Kp2000 Jutland
- <epsg2197> : ETRS89 / Kp2000 Zealand
- <epsg2198> : ETRS89 / Kp2000 Bornholm
- <epsg2199> : Albanian 1987 / Gauss Kruger zone 4 (deprecated)
- <epsg2200> : ATS77 / New Brunswick Stereographic (ATS77)
- <epsg2201> : REGVEN / UTM zone 18N
- <epsg2202> : REGVEN / UTM zone 19N
- <epsg2203> : REGVEN / UTM zone 20N
- <epsg2204> : NAD27 / Tennessee
- <epsg2205> : NAD83 / Kentucky North
- <epsg2206> : ED50 / 3-degree Gauss-Kruger zone 9
- <epsg2207> : ED50 / 3-degree Gauss-Kruger zone 10
- <epsg2208> : ED50 / 3-degree Gauss-Kruger zone 11
- <epsg2209> : ED50 / 3-degree Gauss-Kruger zone 12
- <epsg2210> : ED50 / 3-degree Gauss-Kruger zone 13
- <epsg2211> : ED50 / 3-degree Gauss-Kruger zone 14
- <epsg2212> : ED50 / 3-degree Gauss-Kruger zone 15
- <epsg2213> : ETRS89 / TM 30 NE
- <epsg2214> : Douala 1948 / AOF west (deprecated)
- <epsg2215> : Manoca 1962 / UTM zone 32N
- <epsg2216> : Qornoq 1927 / UTM zone 22N
- <epsg2217> : Qornoq 1927 / UTM zone 23N
- <epsg2219> : ATS77 / UTM zone 19N
- <epsg2220> : ATS77 / UTM zone 20N
- <epsg2222> : NAD83 / Arizona East (ft)
- <epsg2223> : NAD83 / Arizona Central (ft)
- <epsg2224> : NAD83 / Arizona West (ft)
- <epsg2225> : NAD83 / California zone 1 (ftUS)
- <epsg2226> : NAD83 / California zone 2 (ftUS)
- <epsg2227> : NAD83 / California zone 3 (ftUS)
- <epsg2228> : NAD83 / California zone 4 (ftUS)
- <epsg2229> : NAD83 / California zone 5 (ftUS)
- <epsg2230> : NAD83 / California zone 6 (ftUS)
- <epsg2231> : NAD83 / Colorado North (ftUS)
- <epsg2232> : NAD83 / Colorado Central (ftUS)
- <epsg2233> : NAD83 / Colorado South (ftUS)
- <epsg2234> : NAD83 / Connecticut (ftUS)
- <epsg2235> : NAD83 / Delaware (ftUS)
- <epsg2236> : NAD83 / Florida East (ftUS)
- <epsg2237> : NAD83 / Florida West (ftUS)
- <epsg2238> : NAD83 / Florida North (ftUS)
- <epsg2239> : NAD83 / Georgia East (ftUS)
- <epsg2240> : NAD83 / Georgia West (ftUS)
- <epsg2241> : NAD83 / Idaho East (ftUS)
- <epsg2242> : NAD83 / Idaho Central (ftUS)
- <epsg2243> : NAD83 / Idaho West (ftUS)
- <epsg2244> : NAD83 / Indiana East (ftUS) (deprecated)
- <epsg2245> : NAD83 / Indiana West (ftUS) (deprecated)
- <epsg2246> : NAD83 / Kentucky North (ftUS)
- <epsg2247> : NAD83 / Kentucky South (ftUS)
- <epsg2248> : NAD83 / Maryland (ftUS)
- <epsg2249> : NAD83 / Massachusetts Mainland (ftUS)
- <epsg2250> : NAD83 / Massachusetts Island (ftUS)
- <epsg2251> : NAD83 / Michigan North (ft)
- <epsg2252> : NAD83 / Michigan Central (ft)
- <epsg2253> : NAD83 / Michigan South (ft)
- <epsg2254> : NAD83 / Mississippi East (ftUS)
- <epsg2255> : NAD83 / Mississippi West (ftUS)
- <epsg2256> : NAD83 / Montana (ft)
- <epsg2257> : NAD83 / New Mexico East (ftUS)
- <epsg2258> : NAD83 / New Mexico Central (ftUS)
- <epsg2259> : NAD83 / New Mexico West (ftUS)
- <epsg2260> : NAD83 / New York East (ftUS)
- <epsg2261> : NAD83 / New York Central (ftUS)
- <epsg2262> : NAD83 / New York West (ftUS)
- <epsg2263> : NAD83 / New York Long Island (ftUS)
- <epsg2264> : NAD83 / North Carolina (ftUS)
- <epsg2265> : NAD83 / North Dakota North (ft)
- <epsg2266> : NAD83 / North Dakota South (ft)
- <epsg2267> : NAD83 / Oklahoma North (ftUS)
- <epsg2268> : NAD83 / Oklahoma South (ftUS)
- <epsg2269> : NAD83 / Oregon North (ft)
- <epsg2270> : NAD83 / Oregon South (ft)
- <epsg2271> : NAD83 / Pennsylvania North (ftUS)
- <epsg2272> : NAD83 / Pennsylvania South (ftUS)
- <epsg2273> : NAD83 / South Carolina (ft)
- <epsg2274> : NAD83 / Tennessee (ftUS)
- <epsg2275> : NAD83 / Texas North (ftUS)
- <epsg2276> : NAD83 / Texas North Central (ftUS)
- <epsg2277> : NAD83 / Texas Central (ftUS)
- <epsg2278> : NAD83 / Texas South Central (ftUS)
- <epsg2279> : NAD83 / Texas South (ftUS)
- <epsg2280> : NAD83 / Utah North (ft)
- <epsg2281> : NAD83 / Utah Central (ft)
- <epsg2282> : NAD83 / Utah South (ft)
- <epsg2283> : NAD83 / Virginia North (ftUS)
- <epsg2284> : NAD83 / Virginia South (ftUS)
- <epsg2285> : NAD83 / Washington North (ftUS)
- <epsg2286> : NAD83 / Washington South (ftUS)
- <epsg2287> : NAD83 / Wisconsin North (ftUS)
- <epsg2288> : NAD83 / Wisconsin Central (ftUS)
- <epsg2289> : NAD83 / Wisconsin South (ftUS)
- <epsg2290> : ATS77 / Prince Edward Isl. Stereographic (ATS77)
- <epsg2291> : NAD83(CSRS98) / Prince Edward Isl. Stereographic (NAD83) (deprecated)
- <epsg2292> : NAD83(CSRS98) / Prince Edward Isl. Stereographic (NAD83) (deprecated)
- <epsg2294> : ATS77 / MTM Nova Scotia zone 4
- <epsg2295> : ATS77 / MTM Nova Scotia zone 5
- <epsg2308> : Batavia / TM 109 SE
- <epsg2309> : WGS 84 / TM 116 SE
- <epsg2310> : WGS 84 / TM 132 SE
- <epsg2311> : WGS 84 / TM 6 NE
- <epsg2312> : Garoua / UTM zone 33N
- <epsg2313> : Kousseri / UTM zone 33N
- <epsg2314> : Trinidad 1903 / Trinidad Grid (ftCla)
- <epsg2315> : Campo Inchauspe / UTM zone 19S
- <epsg2316> : Campo Inchauspe / UTM zone 20S
- <epsg2317> : PSAD56 / ICN Regional
- <epsg2318> : Ain el Abd / Aramco Lambert
- <epsg2319> : ED50 / TM27
- <epsg2320> : ED50 / TM30
- <epsg2321> : ED50 / TM33
- <epsg2322> : ED50 / TM36
- <epsg2323> : ED50 / TM39
- <epsg2324> : ED50 / TM42
- <epsg2325> : ED50 / TM45
- <epsg2326> : Hong Kong 1980 Grid System
- <epsg2327> : Xian 1980 / Gauss-Kruger zone 13
- <epsg2328> : Xian 1980 / Gauss-Kruger zone 14
- <epsg2329> : Xian 1980 / Gauss-Kruger zone 15
- <epsg2330> : Xian 1980 / Gauss-Kruger zone 16
- <epsg2331> : Xian 1980 / Gauss-Kruger zone 17
- <epsg2332> : Xian 1980 / Gauss-Kruger zone 18
- <epsg2333> : Xian 1980 / Gauss-Kruger zone 19
- <epsg2334> : Xian 1980 / Gauss-Kruger zone 20
- <epsg2335> : Xian 1980 / Gauss-Kruger zone 21
- <epsg2336> : Xian 1980 / Gauss-Kruger zone 22
- <epsg2337> : Xian 1980 / Gauss-Kruger zone 23
- <epsg2338> : Xian 1980 / Gauss-Kruger CM 75E
- <epsg2339> : Xian 1980 / Gauss-Kruger CM 81E
- <epsg2340> : Xian 1980 / Gauss-Kruger CM 87E
- <epsg2341> : Xian 1980 / Gauss-Kruger CM 93E
- <epsg2342> : Xian 1980 / Gauss-Kruger CM 99E
- <epsg2343> : Xian 1980 / Gauss-Kruger CM 105E
- <epsg2344> : Xian 1980 / Gauss-Kruger CM 111E
- <epsg2345> : Xian 1980 / Gauss-Kruger CM 117E
- <epsg2346> : Xian 1980 / Gauss-Kruger CM 123E
- <epsg2347> : Xian 1980 / Gauss-Kruger CM 129E
- <epsg2348> : Xian 1980 / Gauss-Kruger CM 135E
- <epsg2349> : Xian 1980 / 3-degree Gauss-Kruger zone 25
- <epsg2350> : Xian 1980 / 3-degree Gauss-Kruger zone 26
- <epsg2351> : Xian 1980 / 3-degree Gauss-Kruger zone 27
- <epsg2352> : Xian 1980 / 3-degree Gauss-Kruger zone 28
- <epsg2353> : Xian 1980 / 3-degree Gauss-Kruger zone 29
- <epsg2354> : Xian 1980 / 3-degree Gauss-Kruger zone 30
- <epsg2355> : Xian 1980 / 3-degree Gauss-Kruger zone 31
- <epsg2356> : Xian 1980 / 3-degree Gauss-Kruger zone 32
- <epsg2357> : Xian 1980 / 3-degree Gauss-Kruger zone 33
- <epsg2358> : Xian 1980 / 3-degree Gauss-Kruger zone 34
- <epsg2359> : Xian 1980 / 3-degree Gauss-Kruger zone 35
- <epsg2360> : Xian 1980 / 3-degree Gauss-Kruger zone 36
- <epsg2361> : Xian 1980 / 3-degree Gauss-Kruger zone 37
- <epsg2362> : Xian 1980 / 3-degree Gauss-Kruger zone 38
- <epsg2363> : Xian 1980 / 3-degree Gauss-Kruger zone 39
- <epsg2364> : Xian 1980 / 3-degree Gauss-Kruger zone 40
- <epsg2365> : Xian 1980 / 3-degree Gauss-Kruger zone 41
- <epsg2366> : Xian 1980 / 3-degree Gauss-Kruger zone 42
- <epsg2367> : Xian 1980 / 3-degree Gauss-Kruger zone 43
- <epsg2368> : Xian 1980 / 3-degree Gauss-Kruger zone 44
- <epsg2369> : Xian 1980 / 3-degree Gauss-Kruger zone 45
- <epsg2370> : Xian 1980 / 3-degree Gauss-Kruger CM 75E
- <epsg2371> : Xian 1980 / 3-degree Gauss-Kruger CM 78E
- <epsg2372> : Xian 1980 / 3-degree Gauss-Kruger CM 81E
- <epsg2373> : Xian 1980 / 3-degree Gauss-Kruger CM 84E
- <epsg2374> : Xian 1980 / 3-degree Gauss-Kruger CM 87E
- <epsg2375> : Xian 1980 / 3-degree Gauss-Kruger CM 90E
- <epsg2376> : Xian 1980 / 3-degree Gauss-Kruger CM 93E
- <epsg2377> : Xian 1980 / 3-degree Gauss-Kruger CM 96E
- <epsg2378> : Xian 1980 / 3-degree Gauss-Kruger CM 99E
- <epsg2379> : Xian 1980 / 3-degree Gauss-Kruger CM 102E
- <epsg2380> : Xian 1980 / 3-degree Gauss-Kruger CM 105E
- <epsg2381> : Xian 1980 / 3-degree Gauss-Kruger CM 108E
- <epsg2382> : Xian 1980 / 3-degree Gauss-Kruger CM 111E
- <epsg2383> : Xian 1980 / 3-degree Gauss-Kruger CM 114E
- <epsg2384> : Xian 1980 / 3-degree Gauss-Kruger CM 117E
- <epsg2385> : Xian 1980 / 3-degree Gauss-Kruger CM 120E
- <epsg2386> : Xian 1980 / 3-degree Gauss-Kruger CM 123E
- <epsg2387> : Xian 1980 / 3-degree Gauss-Kruger CM 126E
- <epsg2388> : Xian 1980 / 3-degree Gauss-Kruger CM 129E
- <epsg2389> : Xian 1980 / 3-degree Gauss-Kruger CM 132E
- <epsg2390> : Xian 1980 / 3-degree Gauss-Kruger CM 135E
- <epsg2391> : KKJ / Finland zone 1
- <epsg2392> : KKJ / Finland zone 2
- <epsg2393> : KKJ / Finland Uniform Coordinate System
- <epsg2394> : KKJ / Finland zone 4
- <epsg2395> : South Yemen / Gauss-Kruger zone 8
- <epsg2396> : South Yemen / Gauss-Kruger zone 9
- <epsg2397> : Pulkovo 1942(83) / Gauss-Kruger zone 3
- <epsg2398> : Pulkovo 1942(83) / Gauss-Kruger zone 4
- <epsg2399> : Pulkovo 1942(83) / Gauss-Kruger zone 5
- <epsg2400> : RT90 2.5 gon W (deprecated)
- <epsg2401> : Beijing 1954 / 3-degree Gauss-Kruger zone 25
- <epsg2402> : Beijing 1954 / 3-degree Gauss-Kruger zone 26
- <epsg2403> : Beijing 1954 / 3-degree Gauss-Kruger zone 27
- <epsg2404> : Beijing 1954 / 3-degree Gauss-Kruger zone 28
- <epsg2405> : Beijing 1954 / 3-degree Gauss-Kruger zone 29
- <epsg2406> : Beijing 1954 / 3-degree Gauss-Kruger zone 30
- <epsg2407> : Beijing 1954 / 3-degree Gauss-Kruger zone 31
- <epsg2408> : Beijing 1954 / 3-degree Gauss-Kruger zone 32
- <epsg2409> : Beijing 1954 / 3-degree Gauss-Kruger zone 33
- <epsg2410> : Beijing 1954 / 3-degree Gauss-Kruger zone 34
- <epsg2411> : Beijing 1954 / 3-degree Gauss-Kruger zone 35
- <epsg2412> : Beijing 1954 / 3-degree Gauss-Kruger zone 36
- <epsg2413> : Beijing 1954 / 3-degree Gauss-Kruger zone 37
- <epsg2414> : Beijing 1954 / 3-degree Gauss-Kruger zone 38
- <epsg2415> : Beijing 1954 / 3-degree Gauss-Kruger zone 39
- <epsg2416> : Beijing 1954 / 3-degree Gauss-Kruger zone 40
- <epsg2417> : Beijing 1954 / 3-degree Gauss-Kruger zone 41
- <epsg2418> : Beijing 1954 / 3-degree Gauss-Kruger zone 42
- <epsg2419> : Beijing 1954 / 3-degree Gauss-Kruger zone 43
- <epsg2420> : Beijing 1954 / 3-degree Gauss-Kruger zone 44
- <epsg2421> : Beijing 1954 / 3-degree Gauss-Kruger zone 45
- <epsg2422> : Beijing 1954 / 3-degree Gauss-Kruger CM 75E
- <epsg2423> : Beijing 1954 / 3-degree Gauss-Kruger CM 78E
- <epsg2424> : Beijing 1954 / 3-degree Gauss-Kruger CM 81E
- <epsg2425> : Beijing 1954 / 3-degree Gauss-Kruger CM 84E
- <epsg2426> : Beijing 1954 / 3-degree Gauss-Kruger CM 87E
- <epsg2427> : Beijing 1954 / 3-degree Gauss-Kruger CM 90E
- <epsg2428> : Beijing 1954 / 3-degree Gauss-Kruger CM 93E
- <epsg2429> : Beijing 1954 / 3-degree Gauss-Kruger CM 96E
- <epsg2430> : Beijing 1954 / 3-degree Gauss-Kruger CM 99E
- <epsg2431> : Beijing 1954 / 3-degree Gauss-Kruger CM 102E
- <epsg2432> : Beijing 1954 / 3-degree Gauss-Kruger CM 105E
- <epsg2433> : Beijing 1954 / 3-degree Gauss-Kruger CM 108E
- <epsg2434> : Beijing 1954 / 3-degree Gauss-Kruger CM 111E
- <epsg2435> : Beijing 1954 / 3-degree Gauss-Kruger CM 114E
- <epsg2436> : Beijing 1954 / 3-degree Gauss-Kruger CM 117E
- <epsg2437> : Beijing 1954 / 3-degree Gauss-Kruger CM 120E
- <epsg2438> : Beijing 1954 / 3-degree Gauss-Kruger CM 123E
- <epsg2439> : Beijing 1954 / 3-degree Gauss-Kruger CM 126E
- <epsg2440> : Beijing 1954 / 3-degree Gauss-Kruger CM 129E
- <epsg2441> : Beijing 1954 / 3-degree Gauss-Kruger CM 132E
- <epsg2442> : Beijing 1954 / 3-degree Gauss-Kruger CM 135E
- <epsg2443> : JGD2000 / Japan Plane Rectangular CS I
- <epsg2444> : JGD2000 / Japan Plane Rectangular CS II
- <epsg2445> : JGD2000 / Japan Plane Rectangular CS III
- <epsg2446> : JGD2000 / Japan Plane Rectangular CS IV
- <epsg2447> : JGD2000 / Japan Plane Rectangular CS V
- <epsg2448> : JGD2000 / Japan Plane Rectangular CS VI
- <epsg2449> : JGD2000 / Japan Plane Rectangular CS VII
- <epsg2450> : JGD2000 / Japan Plane Rectangular CS VIII
- <epsg2451> : JGD2000 / Japan Plane Rectangular CS IX
- <epsg2452> : JGD2000 / Japan Plane Rectangular CS X
- <epsg2453> : JGD2000 / Japan Plane Rectangular CS XI
- <epsg2454> : JGD2000 / Japan Plane Rectangular CS XII
- <epsg2455> : JGD2000 / Japan Plane Rectangular CS XIII
- <epsg2456> : JGD2000 / Japan Plane Rectangular CS XIV
- <epsg2457> : JGD2000 / Japan Plane Rectangular CS XV
- <epsg2458> : JGD2000 / Japan Plane Rectangular CS XVI
- <epsg2459> : JGD2000 / Japan Plane Rectangular CS XVII
- <epsg2460> : JGD2000 / Japan Plane Rectangular CS XVIII
- <epsg2461> : JGD2000 / Japan Plane Rectangular CS XIX
- <epsg2462> : Albanian 1987 / Gauss-Kruger zone 4
- <epsg2463> : Pulkovo 1995 / Gauss-Kruger CM 21E
- <epsg2464> : Pulkovo 1995 / Gauss-Kruger CM 27E
- <epsg2465> : Pulkovo 1995 / Gauss-Kruger CM 33E
- <epsg2466> : Pulkovo 1995 / Gauss-Kruger CM 39E
- <epsg2467> : Pulkovo 1995 / Gauss-Kruger CM 45E
- <epsg2468> : Pulkovo 1995 / Gauss-Kruger CM 51E
- <epsg2469> : Pulkovo 1995 / Gauss-Kruger CM 57E
- <epsg2470> : Pulkovo 1995 / Gauss-Kruger CM 63E
- <epsg2471> : Pulkovo 1995 / Gauss-Kruger CM 69E
- <epsg2472> : Pulkovo 1995 / Gauss-Kruger CM 75E
- <epsg2473> : Pulkovo 1995 / Gauss-Kruger CM 81E
- <epsg2474> : Pulkovo 1995 / Gauss-Kruger CM 87E
- <epsg2475> : Pulkovo 1995 / Gauss-Kruger CM 93E
- <epsg2476> : Pulkovo 1995 / Gauss-Kruger CM 99E
- <epsg2477> : Pulkovo 1995 / Gauss-Kruger CM 105E
- <epsg2478> : Pulkovo 1995 / Gauss-Kruger CM 111E
- <epsg2479> : Pulkovo 1995 / Gauss-Kruger CM 117E
- <epsg2480> : Pulkovo 1995 / Gauss-Kruger CM 123E
- <epsg2481> : Pulkovo 1995 / Gauss-Kruger CM 129E
- <epsg2482> : Pulkovo 1995 / Gauss-Kruger CM 135E
- <epsg2483> : Pulkovo 1995 / Gauss-Kruger CM 141E
- <epsg2484> : Pulkovo 1995 / Gauss-Kruger CM 147E
- <epsg2485> : Pulkovo 1995 / Gauss-Kruger CM 153E
- <epsg2486> : Pulkovo 1995 / Gauss-Kruger CM 159E
- <epsg2487> : Pulkovo 1995 / Gauss-Kruger CM 165E
- <epsg2488> : Pulkovo 1995 / Gauss-Kruger CM 171E
- <epsg2489> : Pulkovo 1995 / Gauss-Kruger CM 177E
- <epsg2490> : Pulkovo 1995 / Gauss-Kruger CM 177W
- <epsg2491> : Pulkovo 1995 / Gauss-Kruger CM 171W
- <epsg2492> : Pulkovo 1942 / Gauss-Kruger CM 9E
- <epsg2493> : Pulkovo 1942 / Gauss-Kruger CM 15E
- <epsg2494> : Pulkovo 1942 / Gauss-Kruger CM 21E
- <epsg2495> : Pulkovo 1942 / Gauss-Kruger CM 27E
- <epsg2496> : Pulkovo 1942 / Gauss-Kruger CM 33E
- <epsg2497> : Pulkovo 1942 / Gauss-Kruger CM 39E
- <epsg2498> : Pulkovo 1942 / Gauss-Kruger CM 45E
- <epsg2499> : Pulkovo 1942 / Gauss-Kruger CM 51E
- <epsg2500> : Pulkovo 1942 / Gauss-Kruger CM 57E
- <epsg2501> : Pulkovo 1942 / Gauss-Kruger CM 63E
- <epsg2502> : Pulkovo 1942 / Gauss-Kruger CM 69E
- <epsg2503> : Pulkovo 1942 / Gauss-Kruger CM 75E
- <epsg2504> : Pulkovo 1942 / Gauss-Kruger CM 81E
- <epsg2505> : Pulkovo 1942 / Gauss-Kruger CM 87E
- <epsg2506> : Pulkovo 1942 / Gauss-Kruger CM 93E
- <epsg2507> : Pulkovo 1942 / Gauss-Kruger CM 99E
- <epsg2508> : Pulkovo 1942 / Gauss-Kruger CM 105E
- <epsg2509> : Pulkovo 1942 / Gauss-Kruger CM 111E
- <epsg2510> : Pulkovo 1942 / Gauss-Kruger CM 117E
- <epsg2511> : Pulkovo 1942 / Gauss-Kruger CM 123E
- <epsg2512> : Pulkovo 1942 / Gauss-Kruger CM 129E
- <epsg2513> : Pulkovo 1942 / Gauss-Kruger CM 135E
- <epsg2514> : Pulkovo 1942 / Gauss-Kruger CM 141E
- <epsg2515> : Pulkovo 1942 / Gauss-Kruger CM 147E
- <epsg2516> : Pulkovo 1942 / Gauss-Kruger CM 153E
- <epsg2517> : Pulkovo 1942 / Gauss-Kruger CM 159E
- <epsg2518> : Pulkovo 1942 / Gauss-Kruger CM 165E
- <epsg2519> : Pulkovo 1942 / Gauss-Kruger CM 171E
- <epsg2520> : Pulkovo 1942 / Gauss-Kruger CM 177E
- <epsg2521> : Pulkovo 1942 / Gauss-Kruger CM 177W
- <epsg2522> : Pulkovo 1942 / Gauss-Kruger CM 171W
- <epsg2523> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 7
- <epsg2524> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 8
- <epsg2525> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 9
- <epsg2526> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 10
- <epsg2527> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 11
- <epsg2528> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 12
- <epsg2529> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 13
- <epsg2530> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 14
- <epsg2531> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 15
- <epsg2532> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 16
- <epsg2533> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 17
- <epsg2534> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 18
- <epsg2535> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 19
- <epsg2536> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 20
- <epsg2537> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 21
- <epsg2538> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 22
- <epsg2539> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 23
- <epsg2540> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 24
- <epsg2541> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 25
- <epsg2542> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 26
- <epsg2543> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 27
- <epsg2544> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 28
- <epsg2545> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 29
- <epsg2546> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 30
- <epsg2547> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 31
- <epsg2548> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 32
- <epsg2549> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 33
- <epsg2550> : Samboja / UTM zone 50S (deprecated)
- <epsg2551> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 34
- <epsg2552> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 35
- <epsg2553> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 36
- <epsg2554> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 37
- <epsg2555> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 38
- <epsg2556> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 39
- <epsg2557> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 40
- <epsg2558> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 41
- <epsg2559> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 42
- <epsg2560> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 43
- <epsg2561> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 44
- <epsg2562> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 45
- <epsg2563> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 46
- <epsg2564> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 47
- <epsg2565> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 48
- <epsg2566> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 49
- <epsg2567> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 50
- <epsg2568> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 51
- <epsg2569> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 52
- <epsg2570> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 53
- <epsg2571> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 54
- <epsg2572> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 55
- <epsg2573> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 56
- <epsg2574> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 57
- <epsg2575> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 58
- <epsg2576> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 59
- <epsg2577> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 60 (deprecated)
- <epsg2578> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 61
- <epsg2579> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 62
- <epsg2580> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 63
- <epsg2581> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 64
- <epsg2582> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 21E
- <epsg2583> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 24E
- <epsg2584> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 27E
- <epsg2585> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 30E
- <epsg2586> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 33E
- <epsg2587> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 36E
- <epsg2588> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 39E
- <epsg2589> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 42E
- <epsg2590> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 45E
- <epsg2591> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 48E
- <epsg2592> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 51E
- <epsg2593> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 54E
- <epsg2594> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 57E
- <epsg2595> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 60E
- <epsg2596> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 63E
- <epsg2597> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 66E
- <epsg2598> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 69E
- <epsg2599> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 72E
- <epsg2600> : Lietuvos Koordinoei Sistema 1994 (deprecated)
- <epsg2601> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 75E
- <epsg2602> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 78E
- <epsg2603> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 81E
- <epsg2604> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 84E
- <epsg2605> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 87E
- <epsg2606> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 90E
- <epsg2607> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 93E
- <epsg2608> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 96E
- <epsg2609> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 99E
- <epsg2610> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 102E
- <epsg2611> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 105E
- <epsg2612> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 108E
- <epsg2613> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 111E
- <epsg2614> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 114E
- <epsg2615> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 117E
- <epsg2616> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 120E
- <epsg2617> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 123E
- <epsg2618> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 126E
- <epsg2619> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 129E
- <epsg2620> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 132E
- <epsg2621> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 135E
- <epsg2622> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 138E
- <epsg2623> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 141E
- <epsg2624> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 144E
- <epsg2625> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 147E
- <epsg2626> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 150E
- <epsg2627> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 153E
- <epsg2628> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 156E
- <epsg2629> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 159E
- <epsg2630> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 162E
- <epsg2631> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 165E
- <epsg2632> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 168E
- <epsg2633> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 171E
- <epsg2634> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 174E
- <epsg2635> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 177E
- <epsg2636> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 180E
- <epsg2637> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 177W
- <epsg2638> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 174W
- <epsg2639> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 171W
- <epsg2640> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 168W
- <epsg2641> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 7
- <epsg2642> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 8
- <epsg2643> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 9
- <epsg2644> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 10
- <epsg2645> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 11
- <epsg2646> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 12
- <epsg2647> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 13
- <epsg2648> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 14
- <epsg2649> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 15
- <epsg2650> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 16
- <epsg2651> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 17
- <epsg2652> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 18
- <epsg2653> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 19
- <epsg2654> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 20
- <epsg2655> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 21
- <epsg2656> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 22
- <epsg2657> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 23
- <epsg2658> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 24
- <epsg2659> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 25
- <epsg2660> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 26
- <epsg2661> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 27
- <epsg2662> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 28
- <epsg2663> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 29
- <epsg2664> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 30
- <epsg2665> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 31
- <epsg2666> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 32
- <epsg2667> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 33
- <epsg2668> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 34
- <epsg2669> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 35
- <epsg2670> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 36
- <epsg2671> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 37
- <epsg2672> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 38
- <epsg2673> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 39
- <epsg2674> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 40
- <epsg2675> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 41
- <epsg2676> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 42
- <epsg2677> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 43
- <epsg2678> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 44
- <epsg2679> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 45
- <epsg2680> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 46
- <epsg2681> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 47
- <epsg2682> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 48
- <epsg2683> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 49
- <epsg2684> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 50
- <epsg2685> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 51
- <epsg2686> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 52
- <epsg2687> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 53
- <epsg2688> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 54
- <epsg2689> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 55
- <epsg2690> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 56
- <epsg2691> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 57
- <epsg2692> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 58
- <epsg2693> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 59
- <epsg2694> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 60 (deprecated)
- <epsg2695> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 61
- <epsg2696> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 62
- <epsg2697> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 63
- <epsg2698> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 64
- <epsg2699> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 21E
- <epsg2700> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 24E
- <epsg2701> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 27E
- <epsg2702> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 30E
- <epsg2703> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 33E
- <epsg2704> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 36E
- <epsg2705> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 39E
- <epsg2706> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 42E
- <epsg2707> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 45E
- <epsg2708> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 48E
- <epsg2709> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 51E
- <epsg2710> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 54E
- <epsg2711> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 57E
- <epsg2712> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 60E
- <epsg2713> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 63E
- <epsg2714> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 66E
- <epsg2715> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 69E
- <epsg2716> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 72E
- <epsg2717> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 75E
- <epsg2718> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 78E
- <epsg2719> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 81E
- <epsg2720> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 84E
- <epsg2721> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 87E
- <epsg2722> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 90E
- <epsg2723> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 93E
- <epsg2724> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 96E
- <epsg2725> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 99E
- <epsg2726> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 102E
- <epsg2727> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 105E
- <epsg2728> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 108E
- <epsg2729> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 111E
- <epsg2730> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 114E
- <epsg2731> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 117E
- <epsg2732> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 120E
- <epsg2733> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 123E
- <epsg2734> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 126E
- <epsg2735> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 129E
- <epsg2736> : Tete / UTM zone 36S
- <epsg2737> : Tete / UTM zone 37S
- <epsg2738> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 132E
- <epsg2739> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 135E
- <epsg2740> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 138E
- <epsg2741> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 141E
- <epsg2742> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 144E
- <epsg2743> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 147E
- <epsg2744> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 150E
- <epsg2745> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 153E
- <epsg2746> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 156E
- <epsg2747> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 159E
- <epsg2748> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 162E
- <epsg2749> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 165E
- <epsg2750> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 168E
- <epsg2751> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 171E
- <epsg2752> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 174E
- <epsg2753> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 177E
- <epsg2754> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 180E
- <epsg2755> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 177W
- <epsg2756> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 174W
- <epsg2757> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 171W
- <epsg2758> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 168W
- <epsg2759> : NAD83(HARN) / Alabama East
- <epsg2760> : NAD83(HARN) / Alabama West
- <epsg2761> : NAD83(HARN) / Arizona East
- <epsg2762> : NAD83(HARN) / Arizona Central
- <epsg2763> : NAD83(HARN) / Arizona West
- <epsg2764> : NAD83(HARN) / Arkansas North
- <epsg2765> : NAD83(HARN) / Arkansas South
- <epsg2766> : NAD83(HARN) / California zone 1
- <epsg2767> : NAD83(HARN) / California zone 2
- <epsg2768> : NAD83(HARN) / California zone 3
- <epsg2769> : NAD83(HARN) / California zone 4
- <epsg2770> : NAD83(HARN) / California zone 5
- <epsg2771> : NAD83(HARN) / California zone 6
- <epsg2772> : NAD83(HARN) / Colorado North
- <epsg2773> : NAD83(HARN) / Colorado Central
- <epsg2774> : NAD83(HARN) / Colorado South
- <epsg2775> : NAD83(HARN) / Connecticut
- <epsg2776> : NAD83(HARN) / Delaware
- <epsg2777> : NAD83(HARN) / Florida East
- <epsg2778> : NAD83(HARN) / Florida West
- <epsg2779> : NAD83(HARN) / Florida North
- <epsg2780> : NAD83(HARN) / Georgia East
- <epsg2781> : NAD83(HARN) / Georgia West
- <epsg2782> : NAD83(HARN) / Hawaii zone 1
- <epsg2783> : NAD83(HARN) / Hawaii zone 2
- <epsg2784> : NAD83(HARN) / Hawaii zone 3
- <epsg2785> : NAD83(HARN) / Hawaii zone 4
- <epsg2786> : NAD83(HARN) / Hawaii zone 5
- <epsg2787> : NAD83(HARN) / Idaho East
- <epsg2788> : NAD83(HARN) / Idaho Central
- <epsg2789> : NAD83(HARN) / Idaho West
- <epsg2790> : NAD83(HARN) / Illinois East
- <epsg2791> : NAD83(HARN) / Illinois West
- <epsg2792> : NAD83(HARN) / Indiana East
- <epsg2793> : NAD83(HARN) / Indiana West
- <epsg2794> : NAD83(HARN) / Iowa North
- <epsg2795> : NAD83(HARN) / Iowa South
- <epsg2796> : NAD83(HARN) / Kansas North
- <epsg2797> : NAD83(HARN) / Kansas South
- <epsg2798> : NAD83(HARN) / Kentucky North
- <epsg2799> : NAD83(HARN) / Kentucky South
- <epsg2800> : NAD83(HARN) / Louisiana North
- <epsg2801> : NAD83(HARN) / Louisiana South
- <epsg2802> : NAD83(HARN) / Maine East
- <epsg2803> : NAD83(HARN) / Maine West
- <epsg2804> : NAD83(HARN) / Maryland
- <epsg2805> : NAD83(HARN) / Massachusetts Mainland
- <epsg2806> : NAD83(HARN) / Massachusetts Island
- <epsg2807> : NAD83(HARN) / Michigan North
- <epsg2808> : NAD83(HARN) / Michigan Central
- <epsg2809> : NAD83(HARN) / Michigan South
- <epsg2810> : NAD83(HARN) / Minnesota North
- <epsg2811> : NAD83(HARN) / Minnesota Central
- <epsg2812> : NAD83(HARN) / Minnesota South
- <epsg2813> : NAD83(HARN) / Mississippi East
- <epsg2814> : NAD83(HARN) / Mississippi West
- <epsg2815> : NAD83(HARN) / Missouri East
- <epsg2816> : NAD83(HARN) / Missouri Central
- <epsg2817> : NAD83(HARN) / Missouri West
- <epsg2818> : NAD83(HARN) / Montana
- <epsg2819> : NAD83(HARN) / Nebraska
- <epsg2820> : NAD83(HARN) / Nevada East
- <epsg2821> : NAD83(HARN) / Nevada Central
- <epsg2822> : NAD83(HARN) / Nevada West
- <epsg2823> : NAD83(HARN) / New Hampshire
- <epsg2824> : NAD83(HARN) / New Jersey
- <epsg2825> : NAD83(HARN) / New Mexico East
- <epsg2826> : NAD83(HARN) / New Mexico Central
- <epsg2827> : NAD83(HARN) / New Mexico West
- <epsg2828> : NAD83(HARN) / New York East
- <epsg2829> : NAD83(HARN) / New York Central
- <epsg2830> : NAD83(HARN) / New York West
- <epsg2831> : NAD83(HARN) / New York Long Island
- <epsg2832> : NAD83(HARN) / North Dakota North
- <epsg2833> : NAD83(HARN) / North Dakota South
- <epsg2834> : NAD83(HARN) / Ohio North
- <epsg2835> : NAD83(HARN) / Ohio South
- <epsg2836> : NAD83(HARN) / Oklahoma North
- <epsg2837> : NAD83(HARN) / Oklahoma South
- <epsg2838> : NAD83(HARN) / Oregon North
- <epsg2839> : NAD83(HARN) / Oregon South
- <epsg2840> : NAD83(HARN) / Rhode Island
- <epsg2841> : NAD83(HARN) / South Dakota North
- <epsg2842> : NAD83(HARN) / South Dakota South
- <epsg2843> : NAD83(HARN) / Tennessee
- <epsg2844> : NAD83(HARN) / Texas North
- <epsg2845> : NAD83(HARN) / Texas North Central
- <epsg2846> : NAD83(HARN) / Texas Central
- <epsg2847> : NAD83(HARN) / Texas South Central
- <epsg2848> : NAD83(HARN) / Texas South
- <epsg2849> : NAD83(HARN) / Utah North
- <epsg2850> : NAD83(HARN) / Utah Central
- <epsg2851> : NAD83(HARN) / Utah South
- <epsg2852> : NAD83(HARN) / Vermont
- <epsg2853> : NAD83(HARN) / Virginia North
- <epsg2854> : NAD83(HARN) / Virginia South
- <epsg2855> : NAD83(HARN) / Washington North
- <epsg2856> : NAD83(HARN) / Washington South
- <epsg2857> : NAD83(HARN) / West Virginia North
- <epsg2858> : NAD83(HARN) / West Virginia South
- <epsg2859> : NAD83(HARN) / Wisconsin North
- <epsg2860> : NAD83(HARN) / Wisconsin Central
- <epsg2861> : NAD83(HARN) / Wisconsin South
- <epsg2862> : NAD83(HARN) / Wyoming East
- <epsg2863> : NAD83(HARN) / Wyoming East Central
- <epsg2864> : NAD83(HARN) / Wyoming West Central
- <epsg2865> : NAD83(HARN) / Wyoming West
- <epsg2866> : NAD83(HARN) / Puerto Rico & Virgin Is.
- <epsg2867> : NAD83(HARN) / Arizona East (ft)
- <epsg2868> : NAD83(HARN) / Arizona Central (ft)
- <epsg2869> : NAD83(HARN) / Arizona West (ft)
- <epsg2870> : NAD83(HARN) / California zone 1 (ftUS)
- <epsg2871> : NAD83(HARN) / California zone 2 (ftUS)
- <epsg2872> : NAD83(HARN) / California zone 3 (ftUS)
- <epsg2873> : NAD83(HARN) / California zone 4 (ftUS)
- <epsg2874> : NAD83(HARN) / California zone 5 (ftUS)
- <epsg2875> : NAD83(HARN) / California zone 6 (ftUS)
- <epsg2876> : NAD83(HARN) / Colorado North (ftUS)
- <epsg2877> : NAD83(HARN) / Colorado Central (ftUS)
- <epsg2878> : NAD83(HARN) / Colorado South (ftUS)
- <epsg2879> : NAD83(HARN) / Connecticut (ftUS)
- <epsg2880> : NAD83(HARN) / Delaware (ftUS)
- <epsg2881> : NAD83(HARN) / Florida East (ftUS)
- <epsg2882> : NAD83(HARN) / Florida West (ftUS)
- <epsg2883> : NAD83(HARN) / Florida North (ftUS)
- <epsg2884> : NAD83(HARN) / Georgia East (ftUS)
- <epsg2885> : NAD83(HARN) / Georgia West (ftUS)
- <epsg2886> : NAD83(HARN) / Idaho East (ftUS)
- <epsg2887> : NAD83(HARN) / Idaho Central (ftUS)
- <epsg2888> : NAD83(HARN) / Idaho West (ftUS)
- <epsg2889> : NAD83(HARN) / Indiana East (ftUS) (deprecated)
- <epsg2890> : NAD83(HARN) / Indiana West (ftUS) (deprecated)
- <epsg2891> : NAD83(HARN) / Kentucky North (ftUS)
- <epsg2892> : NAD83(HARN) / Kentucky South (ftUS)
- <epsg2893> : NAD83(HARN) / Maryland (ftUS)
- <epsg2894> : NAD83(HARN) / Massachusetts Mainland (ftUS)
- <epsg2895> : NAD83(HARN) / Massachusetts Island (ftUS)
- <epsg2896> : NAD83(HARN) / Michigan North (ft)
- <epsg2897> : NAD83(HARN) / Michigan Central (ft)
- <epsg2898> : NAD83(HARN) / Michigan South (ft)
- <epsg2899> : NAD83(HARN) / Mississippi East (ftUS)
- <epsg2900> : NAD83(HARN) / Mississippi West (ftUS)
- <epsg2901> : NAD83(HARN) / Montana (ft)
- <epsg2902> : NAD83(HARN) / New Mexico East (ftUS)
- <epsg2903> : NAD83(HARN) / New Mexico Central (ftUS)
- <epsg2904> : NAD83(HARN) / New Mexico West (ftUS)
- <epsg2905> : NAD83(HARN) / New York East (ftUS)
- <epsg2906> : NAD83(HARN) / New York Central (ftUS)
- <epsg2907> : NAD83(HARN) / New York West (ftUS)
- <epsg2908> : NAD83(HARN) / New York Long Island (ftUS)
- <epsg2909> : NAD83(HARN) / North Dakota North (ft)
- <epsg2910> : NAD83(HARN) / North Dakota South (ft)
- <epsg2911> : NAD83(HARN) / Oklahoma North (ftUS)
- <epsg2912> : NAD83(HARN) / Oklahoma South (ftUS)
- <epsg2913> : NAD83(HARN) / Oregon North (ft)
- <epsg2914> : NAD83(HARN) / Oregon South (ft)
- <epsg2915> : NAD83(HARN) / Tennessee (ftUS)
- <epsg2916> : NAD83(HARN) / Texas North (ftUS)
- <epsg2917> : NAD83(HARN) / Texas North Central (ftUS)
- <epsg2918> : NAD83(HARN) / Texas Central (ftUS)
- <epsg2919> : NAD83(HARN) / Texas South Central (ftUS)
- <epsg2920> : NAD83(HARN) / Texas South (ftUS)
- <epsg2921> : NAD83(HARN) / Utah North (ft)
- <epsg2922> : NAD83(HARN) / Utah Central (ft)
- <epsg2923> : NAD83(HARN) / Utah South (ft)
- <epsg2924> : NAD83(HARN) / Virginia North (ftUS)
- <epsg2925> : NAD83(HARN) / Virginia South (ftUS)
- <epsg2926> : NAD83(HARN) / Washington North (ftUS)
- <epsg2927> : NAD83(HARN) / Washington South (ftUS)
- <epsg2928> : NAD83(HARN) / Wisconsin North (ftUS)
- <epsg2929> : NAD83(HARN) / Wisconsin Central (ftUS)
- <epsg2930> : NAD83(HARN) / Wisconsin South (ftUS)
- <epsg2931> : Beduaram / TM 13 NE
- <epsg2932> : QND95 / Qatar National Grid
- <epsg2933> : Segara / UTM zone 50S
- <epsg2934> : Segara (Jakarta) / NEIEZ (deprecated)
- <epsg2935> : Pulkovo 1942 / CS63 zone A1
- <epsg2936> : Pulkovo 1942 / CS63 zone A2
- <epsg2937> : Pulkovo 1942 / CS63 zone A3
- <epsg2938> : Pulkovo 1942 / CS63 zone A4
- <epsg2939> : Pulkovo 1942 / CS63 zone K2
- <epsg2940> : Pulkovo 1942 / CS63 zone K3
- <epsg2941> : Pulkovo 1942 / CS63 zone K4
- <epsg2942> : Porto Santo / UTM zone 28N
- <epsg2943> : Selvagem Grande / UTM zone 28N
- <epsg2944> : NAD83(CSRS) / SCoPQ zone 2
- <epsg2945> : NAD83(CSRS) / MTM zone 3
- <epsg2946> : NAD83(CSRS) / MTM zone 4
- <epsg2947> : NAD83(CSRS) / MTM zone 5
- <epsg2948> : NAD83(CSRS) / MTM zone 6
- <epsg2949> : NAD83(CSRS) / MTM zone 7
- <epsg2950> : NAD83(CSRS) / MTM zone 8
- <epsg2951> : NAD83(CSRS) / MTM zone 9
- <epsg2952> : NAD83(CSRS) / MTM zone 10
- <epsg2953> : NAD83(CSRS) / New Brunswick Stereo
- <epsg2954> : NAD83(CSRS) / Prince Edward Isl. Stereographic (NAD83)
- <epsg2955> : NAD83(CSRS) / UTM zone 11N
- <epsg2956> : NAD83(CSRS) / UTM zone 12N
- <epsg2957> : NAD83(CSRS) / UTM zone 13N
- <epsg2958> : NAD83(CSRS) / UTM zone 17N
- <epsg2959> : NAD83(CSRS) / UTM zone 18N
- <epsg2960> : NAD83(CSRS) / UTM zone 19N
- <epsg2961> : NAD83(CSRS) / UTM zone 20N
- <epsg2962> : NAD83(CSRS) / UTM zone 21N
- <epsg2964> : NAD27 / Alaska Albers
- <epsg2965> : NAD83 / Indiana East (ftUS)
- <epsg2966> : NAD83 / Indiana West (ftUS)
- <epsg2967> : NAD83(HARN) / Indiana East (ftUS)
- <epsg2968> : NAD83(HARN) / Indiana West (ftUS)
- <epsg2969> : Fort Marigot / UTM zone 20N
- <epsg2970> : Guadeloupe 1948 / UTM zone 20N
- <epsg2971> : CSG67 / UTM zone 22N
- <epsg2972> : RGFG95 / UTM zone 22N
- <epsg2973> : Martinique 1938 / UTM zone 20N
- <epsg2975> : RGR92 / UTM zone 40S
- <epsg2976> : Tahiti 52 / UTM zone 6S
- <epsg2977> : Tahaa 54 / UTM zone 5S
- <epsg2978> : IGN72 Nuku Hiva / UTM zone 7S
- <epsg2979> : K0 1949 / UTM zone 42S (deprecated)
- <epsg2980> : Combani 1950 / UTM zone 38S
- <epsg2981> : IGN56 Lifou / UTM zone 58S
- <epsg2982> : IGN72 Grand Terre / UTM zone 58S (deprecated)
- <epsg2983> : ST87 Ouvea / UTM zone 58S (deprecated)
- <epsg2984> : RGNC 1991 / Lambert New Caledonia (deprecated)
- <epsg2987> : Saint Pierre et Miquelon 1950 / UTM zone 21N
- <epsg2988> : MOP78 / UTM zone 1S
- <epsg2989> : RRAF 1991 / UTM zone 20N
- <epsg2990> : Reunion 1947 / TM Reunion (deprecated)
- <epsg2991> : NAD83 / Oregon Lambert
- <epsg2992> : NAD83 / Oregon Lambert (ft)
- <epsg2993> : NAD83(HARN) / Oregon Lambert
- <epsg2994> : NAD83(HARN) / Oregon Lambert (ft)
- <epsg2995> : IGN53 Mare / UTM zone 58S
- <epsg2996> : ST84 Ile des Pins / UTM zone 58S
- <epsg2997> : ST71 Belep / UTM zone 58S
- <epsg2998> : NEA74 Noumea / UTM zone 58S
- <epsg2999> : Grand Comoros / UTM zone 38S
- <epsg3000> : Segara / NEIEZ
- <epsg3001> : Batavia / NEIEZ
- <epsg3002> : Makassar / NEIEZ
- <epsg3003> : Monte Mario / Italy zone 1
- <epsg3004> : Monte Mario / Italy zone 2
- <epsg3005> : NAD83 / BC Albers
- <epsg3006> : SWEREF99 TM
- <epsg3007> : SWEREF99 12 00
- <epsg3008> : SWEREF99 13 30
- <epsg3009> : SWEREF99 15 00
- <epsg3010> : SWEREF99 16 30
- <epsg3011> : SWEREF99 18 00
- <epsg3012> : SWEREF99 14 15
- <epsg3013> : SWEREF99 15 45
- <epsg3014> : SWEREF99 17 15
- <epsg3015> : SWEREF99 18 45
- <epsg3016> : SWEREF99 20 15
- <epsg3017> : SWEREF99 21 45
- <epsg3018> : SWEREF99 23 15
- <epsg3019> : RT90 7.5 gon V
- <epsg3020> : RT90 5 gon V
- <epsg3021> : RT90 2.5 gon V
- <epsg3022> : RT90 0 gon
- <epsg3023> : RT90 2.5 gon O
- <epsg3024> : RT90 5 gon O
- <epsg3025> : RT38 7.5 gon V
- <epsg3026> : RT38 5 gon V
- <epsg3027> : RT38 2.5 gon V
- <epsg3028> : RT38 0 gon
- <epsg3029> : RT38 2.5 gon O
- <epsg3030> : RT38 5 gon O
- <epsg3031> : WGS 84 / Antarctic Polar Stereographic
- <epsg3032> : WGS 84 / Australian Antarctic Polar Stereographic
- <epsg3033> : WGS 84 / Australian Antarctic Lambert
- <epsg3034> : ETRS89 / ETRS-LCC
- <epsg3035> : ETRS89 / ETRS-LAEA
- <epsg3036> : Moznet / UTM zone 36S
- <epsg3037> : Moznet / UTM zone 37S
- <epsg3038> : ETRS89 / ETRS-TM26
- <epsg3039> : ETRS89 / ETRS-TM27
- <epsg3040> : ETRS89 / ETRS-TM28
- <epsg3041> : ETRS89 / ETRS-TM29
- <epsg3042> : ETRS89 / ETRS-TM30
- <epsg3043> : ETRS89 / ETRS-TM31
- <epsg3044> : ETRS89 / ETRS-TM32
- <epsg3045> : ETRS89 / ETRS-TM33
- <epsg3046> : ETRS89 / ETRS-TM34
- <epsg3047> : ETRS89 / ETRS-TM35
- <epsg3048> : ETRS89 / ETRS-TM36
- <epsg3049> : ETRS89 / ETRS-TM37
- <epsg3050> : ETRS89 / ETRS-TM38
- <epsg3051> : ETRS89 / ETRS-TM39
- <epsg3054> : Hjorsey 1955 / UTM zone 26N
- <epsg3055> : Hjorsey 1955 / UTM zone 27N
- <epsg3056> : Hjorsey 1955 / UTM zone 28N
- <epsg3057> : ISN93 / Lambert 1993
- <epsg3058> : Helle 1954 / Jan Mayen Grid
- <epsg3059> : LKS92 / Latvia TM
- <epsg3060> : IGN72 Grande Terre / UTM zone 58S
- <epsg3061> : Porto Santo 1995 / UTM zone 28N
- <epsg3062> : Azores Oriental 1995 / UTM zone 26N
- <epsg3063> : Azores Central 1995 / UTM zone 26N
- <epsg3064> : IGM95 / UTM zone 32N
- <epsg3065> : IGM95 / UTM zone 33N
- <epsg3066> : ED50 / Jordan TM
- <epsg3067> : ETRS89 / ETRS-TM35FIN
- <epsg3068> : DHDN / Soldner Berlin
- <epsg3069> : NAD27 / Wisconsin Transverse Mercator
- <epsg3070> : NAD83 / Wisconsin Transverse Mercator
- <epsg3071> : NAD83(HARN) / Wisconsin Transverse Mercator
- <epsg3072> : NAD83 / Maine CS2000 East
- <epsg3073> : NAD83 / Maine CS2000 Central (deprecated)
- <epsg3074> : NAD83 / Maine CS2000 West
- <epsg3075> : NAD83(HARN) / Maine CS2000 East
- <epsg3076> : NAD83(HARN) / Maine CS2000 Central (deprecated)
- <epsg3077> : NAD83(HARN) / Maine CS2000 West
- <epsg3078> : NAD83 / Michigan Oblique Mercator
- <epsg3079> : NAD83(HARN) / Michigan Oblique Mercator
- <epsg3080> : NAD27 / Shackleford
- <epsg3081> : NAD83 / Texas State Mapping System
- <epsg3082> : NAD83 / Texas Centric Lambert Conformal
- <epsg3083> : NAD83 / Texas Centric Albers Equal Area
- <epsg3084> : NAD83(HARN) / Texas Centric Lambert Conformal
- <epsg3085> : NAD83(HARN) / Texas Centric Albers Equal Area
- <epsg3086> : NAD83 / Florida GDL Albers
- <epsg3087> : NAD83(HARN) / Florida GDL Albers
- <epsg3088> : NAD83 / Kentucky Single Zone
- <epsg3089> : NAD83 / Kentucky Single Zone (ftUS)
- <epsg3090> : NAD83(HARN) / Kentucky Single Zone
- <epsg3091> : NAD83(HARN) / Kentucky Single Zone (ftUS)
- <epsg3092> : Tokyo / UTM zone 51N
- <epsg3093> : Tokyo / UTM zone 52N
- <epsg3094> : Tokyo / UTM zone 53N
- <epsg3095> : Tokyo / UTM zone 54N
- <epsg3096> : Tokyo / UTM zone 55N
- <epsg3097> : JGD2000 / UTM zone 51N
- <epsg3098> : JGD2000 / UTM zone 52N
- <epsg3099> : JGD2000 / UTM zone 53N
- <epsg3100> : JGD2000 / UTM zone 54N
- <epsg3101> : JGD2000 / UTM zone 55N
- <epsg3102> : American Samoa 1962 / American Samoa Lambert
- <epsg3103> : Mauritania 1999 / UTM zone 28N (deprecated)
- <epsg3104> : Mauritania 1999 / UTM zone 29N (deprecated)
- <epsg3105> : Mauritania 1999 / UTM zone 30N (deprecated)
- <epsg3106> : Gulshan 303 / Bangladesh Transverse Mercator
- <epsg3107> : GDA94 / SA Lambert
- <epsg3108> : ETRS89 / Guernsey Grid
- <epsg3109> : ETRS89 / Jersey Transverse Mercator
- <epsg3110> : AGD66 / Vicgrid66
- <epsg3111> : GDA94 / Vicgrid94
- <epsg3112> : GDA94 / Geoscience Australia Lambert
- <epsg3113> : GDA94 / BCSG02
- <epsg3114> : MAGNA-SIRGAS / Colombia Far West zone
- <epsg3115> : MAGNA-SIRGAS / Colombia West zone
- <epsg3116> : MAGNA-SIRGAS / Colombia Bogota zone
- <epsg3117> : MAGNA-SIRGAS / Colombia East Central zone
- <epsg3118> : MAGNA-SIRGAS / Colombia East zone
- <epsg3119> : Douala 1948 / AEF west
- <epsg3120> : Pulkovo 1942(58) / Poland zone I
- <epsg3121> : PRS92 / Philippines zone 1
- <epsg3122> : PRS92 / Philippines zone 2
- <epsg3123> : PRS92 / Philippines zone 3
- <epsg3124> : PRS92 / Philippines zone 4
- <epsg3125> : PRS92 / Philippines zone 5
- <epsg3126> : ETRS89 / ETRS-GK19FIN
- <epsg3127> : ETRS89 / ETRS-GK20FIN
- <epsg3128> : ETRS89 / ETRS-GK21FIN
- <epsg3129> : ETRS89 / ETRS-GK22FIN
- <epsg3130> : ETRS89 / ETRS-GK23FIN
- <epsg3131> : ETRS89 / ETRS-GK24FIN
- <epsg3132> : ETRS89 / ETRS-GK25FIN
- <epsg3133> : ETRS89 / ETRS-GK26FIN
- <epsg3134> : ETRS89 / ETRS-GK27FIN
- <epsg3135> : ETRS89 / ETRS-GK28FIN
- <epsg3136> : ETRS89 / ETRS-GK29FIN
- <epsg3137> : ETRS89 / ETRS-GK30FIN
- <epsg3138> : ETRS89 / ETRS-GK31FIN
- <epsg3140> : Viti Levu 1912 / Viti Levu Grid
- <epsg3141> : Fiji 1956 / UTM zone 60S
- <epsg3142> : Fiji 1956 / UTM zone 1S
- <epsg3143> : Fiji 1986 / Fiji Map Grid (deprecated)
- <epsg3146> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 6
- <epsg3147> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 18E
- <epsg3148> : Indian 1960 / UTM zone 48N
- <epsg3149> : Indian 1960 / UTM zone 49N
- <epsg3150> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 6
- <epsg3151> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 18E
- <epsg3152> : ST74
- <epsg3153> : NAD83(CSRS) / BC Albers
- <epsg3154> : NAD83(CSRS) / UTM zone 7N
- <epsg3155> : NAD83(CSRS) / UTM zone 8N
- <epsg3156> : NAD83(CSRS) / UTM zone 9N
- <epsg3157> : NAD83(CSRS) / UTM zone 10N
- <epsg3158> : NAD83(CSRS) / UTM zone 14N
- <epsg3159> : NAD83(CSRS) / UTM zone 15N
- <epsg3160> : NAD83(CSRS) / UTM zone 16N
- <epsg3161> : NAD83 / Ontario MNR Lambert
- <epsg3162> : NAD83(CSRS) / Ontario MNR Lambert
- <epsg3163> : RGNC91-93 / Lambert New Caledonia
- <epsg3164> : ST87 Ouvea / UTM zone 58S
- <epsg3165> : NEA74 Noumea / Noumea Lambert
- <epsg3166> : NEA74 Noumea / Noumea Lambert 2
- <epsg3167> : Kertau (RSO) / RSO Malaya (ch)
- <epsg3168> : Kertau (RSO) / RSO Malaya (m)
- <epsg3169> : RGNC91-93 / UTM zone 57S
- <epsg3170> : RGNC91-93 / UTM zone 58S
- <epsg3171> : RGNC91-93 / UTM zone 59S
- <epsg3172> : IGN53 Mare / UTM zone 59S
- <epsg3174> : NAD83 / Great Lakes Albers
- <epsg3175> : NAD83 / Great Lakes and St Lawrence Albers
- <epsg3176> : Indian 1960 / TM 106 NE
- <epsg3177> : LGD2006 / Libya TM
- <epsg3178> : GR96 / UTM zone 18N
- <epsg3179> : GR96 / UTM zone 19N
- <epsg3180> : GR96 / UTM zone 20N
- <epsg3181> : GR96 / UTM zone 21N
- <epsg3182> : GR96 / UTM zone 22N
- <epsg3183> : GR96 / UTM zone 23N
- <epsg3184> : GR96 / UTM zone 24N
- <epsg3185> : GR96 / UTM zone 25N
- <epsg3186> : GR96 / UTM zone 26N
- <epsg3187> : GR96 / UTM zone 27N
- <epsg3188> : GR96 / UTM zone 28N
- <epsg3189> : GR96 / UTM zone 29N
- <epsg3190> : LGD2006 / Libya TM zone 5
- <epsg3191> : LGD2006 / Libya TM zone 6
- <epsg3192> : LGD2006 / Libya TM zone 7
- <epsg3193> : LGD2006 / Libya TM zone 8
- <epsg3194> : LGD2006 / Libya TM zone 9
- <epsg3195> : LGD2006 / Libya TM zone 10
- <epsg3196> : LGD2006 / Libya TM zone 11
- <epsg3197> : LGD2006 / Libya TM zone 12
- <epsg3198> : LGD2006 / Libya TM zone 13
- <epsg3199> : LGD2006 / UTM zone 32N
- <epsg3200> : FD58 / Iraq zone
- <epsg3201> : LGD2006 / UTM zone 33N
- <epsg3202> : LGD2006 / UTM zone 34N
- <epsg3203> : LGD2006 / UTM zone 35N
- <epsg3204> : WGS 84 / SCAR IMW SP19-20
- <epsg3205> : WGS 84 / SCAR IMW SP21-22
- <epsg3206> : WGS 84 / SCAR IMW SP23-24
- <epsg3207> : WGS 84 / SCAR IMW SQ01-02
- <epsg3208> : WGS 84 / SCAR IMW SQ19-20
- <epsg3209> : WGS 84 / SCAR IMW SQ21-22
- <epsg3210> : WGS 84 / SCAR IMW SQ37-38
- <epsg3211> : WGS 84 / SCAR IMW SQ39-40
- <epsg3212> : WGS 84 / SCAR IMW SQ41-42
- <epsg3213> : WGS 84 / SCAR IMW SQ43-44
- <epsg3214> : WGS 84 / SCAR IMW SQ45-46
- <epsg3215> : WGS 84 / SCAR IMW SQ47-48
- <epsg3216> : WGS 84 / SCAR IMW SQ49-50
- <epsg3217> : WGS 84 / SCAR IMW SQ51-52
- <epsg3218> : WGS 84 / SCAR IMW SQ53-54
- <epsg3219> : WGS 84 / SCAR IMW SQ55-56
- <epsg3220> : WGS 84 / SCAR IMW SQ57-58
- <epsg3221> : WGS 84 / SCAR IMW SR13-14
- <epsg3222> : WGS 84 / SCAR IMW SR15-16
- <epsg3223> : WGS 84 / SCAR IMW SR17-18
- <epsg3224> : WGS 84 / SCAR IMW SR19-20
- <epsg3225> : WGS 84 / SCAR IMW SR27-28
- <epsg3226> : WGS 84 / SCAR IMW SR29-30
- <epsg3227> : WGS 84 / SCAR IMW SR31-32
- <epsg3228> : WGS 84 / SCAR IMW SR33-34
- <epsg3229> : WGS 84 / SCAR IMW SR35-36
- <epsg3230> : WGS 84 / SCAR IMW SR37-38
- <epsg3231> : WGS 84 / SCAR IMW SR39-40
- <epsg3232> : WGS 84 / SCAR IMW SR41-42
- <epsg3233> : WGS 84 / SCAR IMW SR43-44
- <epsg3234> : WGS 84 / SCAR IMW SR45-46
- <epsg3235> : WGS 84 / SCAR IMW SR47-48
- <epsg3236> : WGS 84 / SCAR IMW SR49-50
- <epsg3237> : WGS 84 / SCAR IMW SR51-52
- <epsg3238> : WGS 84 / SCAR IMW SR53-54
- <epsg3239> : WGS 84 / SCAR IMW SR55-56
- <epsg3240> : WGS 84 / SCAR IMW SR57-58
- <epsg3241> : WGS 84 / SCAR IMW SR59-60
- <epsg3242> : WGS 84 / SCAR IMW SS04-06
- <epsg3243> : WGS 84 / SCAR IMW SS07-09
- <epsg3244> : WGS 84 / SCAR IMW SS10-12
- <epsg3245> : WGS 84 / SCAR IMW SS13-15
- <epsg3246> : WGS 84 / SCAR IMW SS16-18
- <epsg3247> : WGS 84 / SCAR IMW SS19-21
- <epsg3248> : WGS 84 / SCAR IMW SS25-27
- <epsg3249> : WGS 84 / SCAR IMW SS28-30
- <epsg3250> : WGS 84 / SCAR IMW SS31-33
- <epsg3251> : WGS 84 / SCAR IMW SS34-36
- <epsg3252> : WGS 84 / SCAR IMW SS37-39
- <epsg3253> : WGS 84 / SCAR IMW SS40-42
- <epsg3254> : WGS 84 / SCAR IMW SS43-45
- <epsg3255> : WGS 84 / SCAR IMW SS46-48
- <epsg3256> : WGS 84 / SCAR IMW SS49-51
- <epsg3257> : WGS 84 / SCAR IMW SS52-54
- <epsg3258> : WGS 84 / SCAR IMW SS55-57
- <epsg3259> : WGS 84 / SCAR IMW SS58-60
- <epsg3260> : WGS 84 / SCAR IMW ST01-04
- <epsg3261> : WGS 84 / SCAR IMW ST05-08
- <epsg3262> : WGS 84 / SCAR IMW ST09-12
- <epsg3263> : WGS 84 / SCAR IMW ST13-16
- <epsg3264> : WGS 84 / SCAR IMW ST17-20
- <epsg3265> : WGS 84 / SCAR IMW ST21-24
- <epsg3266> : WGS 84 / SCAR IMW ST25-28
- <epsg3267> : WGS 84 / SCAR IMW ST29-32
- <epsg3268> : WGS 84 / SCAR IMW ST33-36
- <epsg3269> : WGS 84 / SCAR IMW ST37-40
- <epsg3270> : WGS 84 / SCAR IMW ST41-44
- <epsg3271> : WGS 84 / SCAR IMW ST45-48
- <epsg3272> : WGS 84 / SCAR IMW ST49-52
- <epsg3273> : WGS 84 / SCAR IMW ST53-56
- <epsg3274> : WGS 84 / SCAR IMW ST57-60
- <epsg3275> : WGS 84 / SCAR IMW SU01-05
- <epsg3276> : WGS 84 / SCAR IMW SU06-10
- <epsg3277> : WGS 84 / SCAR IMW SU11-15
- <epsg3278> : WGS 84 / SCAR IMW SU16-20
- <epsg3279> : WGS 84 / SCAR IMW SU21-25
- <epsg3280> : WGS 84 / SCAR IMW SU26-30
- <epsg3281> : WGS 84 / SCAR IMW SU31-35
- <epsg3282> : WGS 84 / SCAR IMW SU36-40
- <epsg3283> : WGS 84 / SCAR IMW SU41-45
- <epsg3284> : WGS 84 / SCAR IMW SU46-50
- <epsg3285> : WGS 84 / SCAR IMW SU51-55
- <epsg3286> : WGS 84 / SCAR IMW SU56-60
- <epsg3287> : WGS 84 / SCAR IMW SV01-10
- <epsg3288> : WGS 84 / SCAR IMW SV11-20
- <epsg3289> : WGS 84 / SCAR IMW SV21-30
- <epsg3290> : WGS 84 / SCAR IMW SV31-40
- <epsg3291> : WGS 84 / SCAR IMW SV41-50
- <epsg3292> : WGS 84 / SCAR IMW SV51-60
- <epsg3293> : WGS 84 / SCAR IMW SW01-60
- <epsg3294> : WGS 84 / USGS Transantarctic Mountains
- <epsg3296> : RGPF / UTM zone 5S
- <epsg3297> : RGPF / UTM zone 6S
- <epsg3298> : RGPF / UTM zone 7S
- <epsg3299> : RGPF / UTM zone 8S
- <epsg3300> : Estonian Coordinate System of 1992
- <epsg3301> : Estonian Coordinate System of 1997
- <epsg3302> : IGN63 Hiva Oa / UTM zone 7S
- <epsg3303> : Fatu Iva 72 / UTM zone 7S
- <epsg3304> : Tahiti 79 / UTM zone 6S
- <epsg3305> : Moorea 87 / UTM zone 6S
- <epsg3306> : Maupiti 83 / UTM zone 5S
- <epsg3307> : Nakhl-e Ghanem / UTM zone 39N
- <epsg3308> : GDA94 / NSW Lambert
- <epsg3309> : NAD27 / California Albers
- <epsg3310> : NAD83 / California Albers
- <epsg3311> : NAD83(HARN) / California Albers
- <epsg3312> : CSG67 / UTM zone 21N
- <epsg3313> : RGFG95 / UTM zone 21N
- <epsg3314> : Katanga 1955 / Katanga Lambert
- <epsg3315> : Katanga 1955 / Katanga TM
- <epsg3316> : Kasai 1953 / Congo TM zone 22
- <epsg3317> : Kasai 1953 / Congo TM zone 24
- <epsg3318> : IGC 1962 / Congo TM zone 12
- <epsg3319> : IGC 1962 / Congo TM zone 14
- <epsg3320> : IGC 1962 / Congo TM zone 16
- <epsg3321> : IGC 1962 / Congo TM zone 18
- <epsg3322> : IGC 1962 / Congo TM zone 20
- <epsg3323> : IGC 1962 / Congo TM zone 22
- <epsg3324> : IGC 1962 / Congo TM zone 24
- <epsg3325> : IGC 1962 / Congo TM zone 26
- <epsg3326> : IGC 1962 / Congo TM zone 28
- <epsg3327> : IGC 1962 / Congo TM zone 30
- <epsg3328> : Pulkovo 1942(58) / GUGiK-80
- <epsg3329> : Pulkovo 1942(58) / 3-degree Gauss-Kruger zone 5
- <epsg3330> : Pulkovo 1942(58) / 3-degree Gauss-Kruger zone 6
- <epsg3331> : Pulkovo 1942(58) / 3-degree Gauss-Kruger zone 7
- <epsg3332> : Pulkovo 1942(58) / 3-degree Gauss-Kruger zone 8
- <epsg3333> : Pulkovo 1942(58) / Gauss-Kruger zone 3
- <epsg3334> : Pulkovo 1942(58) / Gauss-Kruger zone 4
- <epsg3335> : Pulkovo 1942(58) / Gauss-Kruger zone 5
- <epsg3336> : IGN 1962 Kerguelen / UTM zone 42S
- <epsg3337> : Le Pouce 1934 / Mauritius Grid
- <epsg3338> : NAD83 / Alaska Albers
- <epsg3339> : IGCB 1955 / Congo TM zone 12
- <epsg3340> : IGCB 1955 / Congo TM zone 14
- <epsg3341> : IGCB 1955 / Congo TM zone 16
- <epsg3342> : IGCB 1955 / UTM zone 33S
- <epsg3343> : Mauritania 1999 / UTM zone 28N
- <epsg3344> : Mauritania 1999 / UTM zone 29N
- <epsg3345> : Mauritania 1999 / UTM zone 30N
- <epsg3346> : LKS94 / Lithuania TM
- <epsg3347> : NAD83 / Statistics Canada Lambert
- <epsg3348> : NAD83(CSRS) / Statistics Canada Lambert
- <epsg3349> : WGS 84 / PDC Mercator
- <epsg3350> : Pulkovo 1942 / CS63 zone C0
- <epsg3351> : Pulkovo 1942 / CS63 zone C1
- <epsg3352> : Pulkovo 1942 / CS63 zone C2
- <epsg3353> : Mhast (onshore) / UTM zone 32S
- <epsg3354> : Mhast (offshore) / UTM zone 32S
- <epsg3355> : Egypt Gulf of Suez S-650 TL / Red Belt
- <epsg3356> : Grand Cayman 1959 / UTM zone 17N
- <epsg3357> : Little Cayman 1961 / UTM zone 17N
- <epsg3358> : NAD83(HARN) / North Carolina
- <epsg3359> : NAD83(HARN) / North Carolina (ftUS) (deprecated)
- <epsg3360> : NAD83(HARN) / South Carolina
- <epsg3361> : NAD83(HARN) / South Carolina (ft)
- <epsg3362> : NAD83(HARN) / Pennsylvania North
- <epsg3363> : NAD83(HARN) / Pennsylvania North (ftUS)
- <epsg3364> : NAD83(HARN) / Pennsylvania South
- <epsg3365> : NAD83(HARN) / Pennsylvania South (ftUS)
- <epsg3366> : Hong Kong 1963 Grid System (deprecated)
- <epsg3367> : IGN Astro 1960 / UTM zone 28N
- <epsg3368> : IGN Astro 1960 / UTM zone 29N
- <epsg3369> : IGN Astro 1960 / UTM zone 30N
- <epsg3370> : NAD27 / UTM zone 59N
- <epsg3371> : NAD27 / UTM zone 60N
- <epsg3372> : NAD83 / UTM zone 59N
- <epsg3373> : NAD83 / UTM zone 60N
- <epsg3374> : FD54 / UTM zone 29N
- <epsg3375> : GDM2000 / Peninsula RSO
- <epsg3376> : GDM2000 / East Malaysia BRSO
- <epsg3377> : GDM2000 / Johor Grid
- <epsg3378> : GDM2000 / Sembilan and Melaka Grid
- <epsg3379> : GDM2000 / PahangGrid
- <epsg3380> : GDM2000 / Selangor Grid
- <epsg3381> : GDM2000 / Terengganu Grid
- <epsg3382> : GDM2000 / Pinang Grid
- <epsg3383> : GDM2000 / Kedah and Perlis Grid
- <epsg3384> : GDM2000 / Perak Grid
- <epsg3385> : GDM2000 / Kelantan Grid
- <epsg3386> : KKJ / Finland zone 0
- <epsg3387> : KKJ / Finland zone 5
- <epsg3388> : Pulkovo 1942 / Caspian Sea Mercator
- <epsg3389> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 60
- <epsg3390> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 60
- <epsg3391> : Karbala 1979 (Polservice) / UTM zone 37N
- <epsg3392> : Karbala 1979 (Polservice) / UTM zone 38N
- <epsg3393> : Karbala 1979 (Polservice) / UTM zone 39N
- <epsg3394> : Nahrwan 1934 / Iraq zone
- <epsg3395> : WGS 84 / World Mercator
- <epsg3396> : PD/83 / Gauss-Kruger zone 3
- <epsg3397> : PD/83 / Gauss-Kruger zone 4
- <epsg3398> : RD/83 / Gauss-Kruger zone 4
- <epsg3399> : RD/83 / Gauss-Kruger zone 5
- <epsg3400> : NAD83 / Alberta 10-TM (Forest)
- <epsg3401> : NAD83 / Alberta 10-TM (Resource)
- <epsg3402> : NAD83(CSRS) / Alberta 10-TM (Forest)
- <epsg3403> : NAD83(CSRS) / Alberta 10-TM (Resource)
- <epsg3404> : NAD83(HARN) / North Carolina (ftUS)
- <epsg3405> : VN-2000 / UTM zone 48N
- <epsg3406> : VN-2000 / UTM zone 49N
- <epsg3407> : Hong Kong 1963 Grid System
- <epsg3408> : NSIDC EASE-Grid North
- <epsg3409> : NSIDC EASE-Grid South
- <epsg3411> : NSIDC Sea Ice Polar Stereographic North
- <epsg3412> : NSIDC Sea Ice Polar Stereographic South
- <epsg3413> : WGS 84 / NSIDC Sea Ice Polar Stereographic North
- <epsg3414> : SVY21 / Singapore TM
- <epsg3415> : WGS 72BE / South China Sea Lambert
- <epsg3416> : ETRS89 / Austria Lambert
- <epsg3417> : NAD83 / Iowa North (ft US)
- <epsg3418> : NAD83 / Iowa South (ft US)
- <epsg3419> : NAD83 / Kansas North (ft US)
- <epsg3420> : NAD83 / Kansas South (ft US)
- <epsg3421> : NAD83 / Nevada East (ft US)
- <epsg3422> : NAD83 / Nevada Central (ft US)
- <epsg3423> : NAD83 / Nevada West (ft US)
- <epsg3424> : NAD83 / New Jersey (ft US)
- <epsg3425> : NAD83(HARN) / Iowa North (ft US)
- <epsg3426> : NAD83(HARN) / Iowa South (ft US)
- <epsg3427> : NAD83(HARN) / Kansas North (ft US)
- <epsg3428> : NAD83(HARN) / Kansas South (ft US)
- <epsg3429> : NAD83(HARN) / Nevada East (ft US)
- <epsg3430> : NAD83(HARN) / Nevada Central (ft US)
- <epsg3431> : NAD83(HARN) / Nevada West (ft US)
- <epsg3432> : NAD83(HARN) / New Jersey (ft US)
- <epsg3433> : NAD83 / Arkansas North (ftUS)
- <epsg3434> : NAD83 / Arkansas South (ftUS)
- <epsg3435> : NAD83 / Illinois East (ftUS)
- <epsg3436> : NAD83 / Illinois West (ftUS)
- <epsg3437> : NAD83 / New Hampshire (ftUS)
- <epsg3438> : NAD83 / Rhode Island (ftUS)
- <epsg3439> : PSD93 / UTM zone 39N
- <epsg3440> : PSD93 / UTM zone 40N
- <epsg3441> : NAD83(HARN) / Arkansas North (ftUS)
- <epsg3442> : NAD83(HARN) / Arkansas South (ftUS)
- <epsg3443> : NAD83(HARN) / Illinois East (ftUS)
- <epsg3444> : NAD83(HARN) / Illinois West (ftUS)
- <epsg3445> : NAD83(HARN) / New Hampshire (ftUS)
- <epsg3446> : NAD83(HARN) / Rhode Island (ftUS)
- <epsg3447> : ETRS89 / Belgian Lambert 2005
- <epsg3448> : JAD2001 / Jamaica Metric Grid
- <epsg3449> : JAD2001 / UTM zone 17N
- <epsg3450> : JAD2001 / UTM zone 18N
- <epsg3451> : NAD83 / Louisiana North (ftUS)
- <epsg3452> : NAD83 / Louisiana South (ftUS)
- <epsg3453> : NAD83 / Louisiana Offshore (ftUS)
- <epsg3454> : NAD83 / South Dakota North (ftUS)
- <epsg3455> : NAD83 / South Dakota South (ftUS)
- <epsg3456> : NAD83(HARN) / Louisiana North (ftUS)
- <epsg3457> : NAD83(HARN) / Louisiana South (ftUS)
- <epsg3458> : NAD83(HARN) / South Dakota North (ftUS)
- <epsg3459> : NAD83(HARN) / South Dakota South (ftUS)
- <epsg3460> : Fiji 1986 / Fiji Map Grid
- <epsg3461> : Dabola 1981 / UTM zone 28N
- <epsg3462> : Dabola 1981 / UTM zone 29N
- <epsg3463> : NAD83 / Maine CS2000 Central
- <epsg3464> : NAD83(HARN) / Maine CS2000 Central
- <epsg3465> : NAD83(NSRS2007) / Alabama East
- <epsg3466> : NAD83(NSRS2007) / Alabama West
- <epsg3467> : NAD83(NSRS2007) / Alaska Albers
- <epsg3468> : NAD83(NSRS2007) / Alaska zone 1
- <epsg3469> : NAD83(NSRS2007) / Alaska zone 2
- <epsg3470> : NAD83(NSRS2007) / Alaska zone 3
- <epsg3471> : NAD83(NSRS2007) / Alaska zone 4
- <epsg3472> : NAD83(NSRS2007) / Alaska zone 5
- <epsg3473> : NAD83(NSRS2007) / Alaska zone 6
- <epsg3474> : NAD83(NSRS2007) / Alaska zone 7
- <epsg3475> : NAD83(NSRS2007) / Alaska zone 8
- <epsg3476> : NAD83(NSRS2007) / Alaska zone 9
- <epsg3477> : NAD83(NSRS2007) / Alaska zone 10
- <epsg3478> : NAD83(NSRS2007) / Arizona Central
- <epsg3479> : NAD83(NSRS2007) / Arizona Central (ft)
- <epsg3480> : NAD83(NSRS2007) / Arizona East
- <epsg3481> : NAD83(NSRS2007) / Arizona East (ft)
- <epsg3482> : NAD83(NSRS2007) / Arizona West
- <epsg3483> : NAD83(NSRS2007) / Arizona West (ft)
- <epsg3484> : NAD83(NSRS2007) / Arkansas North
- <epsg3485> : NAD83(NSRS2007) / Arkansas North (ftUS)
- <epsg3486> : NAD83(NSRS2007) / Arkansas South
- <epsg3487> : NAD83(NSRS2007) / Arkansas South (ftUS)
- <epsg3488> : NAD83(NSRS2007) / California Albers
- <epsg3489> : NAD83(NSRS2007) / California zone 1
- <epsg3490> : NAD83(NSRS2007) / California zone 1 (ftUS)
- <epsg3491> : NAD83(NSRS2007) / California zone 2
- <epsg3492> : NAD83(NSRS2007) / California zone 2 (ftUS)
- <epsg3493> : NAD83(NSRS2007) / California zone 3
- <epsg3494> : NAD83(NSRS2007) / California zone 3 (ftUS)
- <epsg3495> : NAD83(NSRS2007) / California zone 4
- <epsg3496> : NAD83(NSRS2007) / California zone 4 (ftUS)
- <epsg3497> : NAD83(NSRS2007) / California zone 5
- <epsg3498> : NAD83(NSRS2007) / California zone 5 (ftUS)
- <epsg3499> : NAD83(NSRS2007) / California zone 6
- <epsg3500> : NAD83(NSRS2007) / California zone 6 (ftUS)
- <epsg3501> : NAD83(NSRS2007) / Colorado Central
- <epsg3502> : NAD83(NSRS2007) / Colorado Central (ftUS)
- <epsg3503> : NAD83(NSRS2007) / Colorado North
- <epsg3504> : NAD83(NSRS2007) / Colorado North (ftUS)
- <epsg3505> : NAD83(NSRS2007) / Colorado South
- <epsg3506> : NAD83(NSRS2007) / Colorado South (ftUS)
- <epsg3507> : NAD83(NSRS2007) / Connecticut
- <epsg3508> : NAD83(NSRS2007) / Connecticut (ftUS)
- <epsg3509> : NAD83(NSRS2007) / Delaware
- <epsg3510> : NAD83(NSRS2007) / Delaware (ftUS)
- <epsg3511> : NAD83(NSRS2007) / Florida East
- <epsg3512> : NAD83(NSRS2007) / Florida East (ftUS)
- <epsg3513> : NAD83(NSRS2007) / Florida GDL Albers
- <epsg3514> : NAD83(NSRS2007) / Florida North
- <epsg3515> : NAD83(NSRS2007) / Florida North (ftUS)
- <epsg3516> : NAD83(NSRS2007) / Florida West
- <epsg3517> : NAD83(NSRS2007) / Florida West (ftUS)
- <epsg3518> : NAD83(NSRS2007) / Georgia East
- <epsg3519> : NAD83(NSRS2007) / Georgia East (ftUS)
- <epsg3520> : NAD83(NSRS2007) / Georgia West
- <epsg3521> : NAD83(NSRS2007) / Georgia West (ftUS)
- <epsg3522> : NAD83(NSRS2007) / Idaho Central
- <epsg3523> : NAD83(NSRS2007) / Idaho Central (ftUS)
- <epsg3524> : NAD83(NSRS2007) / Idaho East
- <epsg3525> : NAD83(NSRS2007) / Idaho East (ftUS)
- <epsg3526> : NAD83(NSRS2007) / Idaho West
- <epsg3527> : NAD83(NSRS2007) / Idaho West (ftUS)
- <epsg3528> : NAD83(NSRS2007) / Illinois East
- <epsg3529> : NAD83(NSRS2007) / Illinois East (ftUS)
- <epsg3530> : NAD83(NSRS2007) / Illinois West
- <epsg3531> : NAD83(NSRS2007) / Illinois West (ftUS)
- <epsg3532> : NAD83(NSRS2007) / Indiana East
- <epsg3533> : NAD83(NSRS2007) / Indiana East (ftUS)
- <epsg3534> : NAD83(NSRS2007) / Indiana West
- <epsg3535> : NAD83(NSRS2007) / Indiana West (ftUS)
- <epsg3536> : NAD83(NSRS2007) / Iowa North
- <epsg3537> : NAD83(NSRS2007) / Iowa North (ft US)
- <epsg3538> : NAD83(NSRS2007) / Iowa South
- <epsg3539> : NAD83(NSRS2007) / Iowa South (ft US)
- <epsg3540> : NAD83(NSRS2007) / Kansas North
- <epsg3541> : NAD83(NSRS2007) / Kansas North (ft US)
- <epsg3542> : NAD83(NSRS2007) / Kansas South
- <epsg3543> : NAD83(NSRS2007) / Kansas South (ft US)
- <epsg3544> : NAD83(NSRS2007) / Kentucky North
- <epsg3545> : NAD83(NSRS2007) / Kentucky North (ftUS)
- <epsg3546> : NAD83(NSRS2007) / Kentucky Single Zone
- <epsg3547> : NAD83(NSRS2007) / Kentucky Single Zone (ftUS)
- <epsg3548> : NAD83(NSRS2007) / Kentucky South
- <epsg3549> : NAD83(NSRS2007) / Kentucky South (ftUS)
- <epsg3550> : NAD83(NSRS2007) / Louisiana North
- <epsg3551> : NAD83(NSRS2007) / Louisiana North (ftUS)
- <epsg3552> : NAD83(NSRS2007) / Louisiana South
- <epsg3553> : NAD83(NSRS2007) / Louisiana South (ftUS)
- <epsg3554> : NAD83(NSRS2007) / Maine CS2000 Central
- <epsg3555> : NAD83(NSRS2007) / Maine CS2000 East
- <epsg3556> : NAD83(NSRS2007) / Maine CS2000 West
- <epsg3557> : NAD83(NSRS2007) / Maine East
- <epsg3558> : NAD83(NSRS2007) / Maine West
- <epsg3559> : NAD83(NSRS2007) / Maryland
- <epsg3560> : NAD83 / Utah North (ftUS)
- <epsg3561> : Old Hawaiian / Hawaii zone 1
- <epsg3562> : Old Hawaiian / Hawaii zone 2
- <epsg3563> : Old Hawaiian / Hawaii zone 3
- <epsg3564> : Old Hawaiian / Hawaii zone 4
- <epsg3565> : Old Hawaiian / Hawaii zone 5
- <epsg3566> : NAD83 / Utah Central (ftUS)
- <epsg3567> : NAD83 / Utah South (ftUS)
- <epsg3568> : NAD83(HARN) / Utah North (ftUS)
- <epsg3569> : NAD83(HARN) / Utah Central (ftUS)
- <epsg3570> : NAD83(HARN) / Utah South (ftUS)
- <epsg3571> : WGS 84 / North Pole LAEA Bering Sea
- <epsg3572> : WGS 84 / North Pole LAEA Alaska
- <epsg3573> : WGS 84 / North Pole LAEA Canada
- <epsg3574> : WGS 84 / North Pole LAEA Atlantic
- <epsg3575> : WGS 84 / North Pole LAEA Europe
- <epsg3576> : WGS 84 / North Pole LAEA Russia
- <epsg3577> : GDA94 / Australian Albers
- <epsg3578> : NAD83 / Yukon Albers
- <epsg3579> : NAD83(CSRS) / Yukon Albers
- <epsg3580> : NAD83 / NWT Lambert
- <epsg3581> : NAD83(CSRS) / NWT Lambert
- <epsg3582> : NAD83(NSRS2007) / Maryland (ftUS)
- <epsg3583> : NAD83(NSRS2007) / Massachusetts Island
- <epsg3584> : NAD83(NSRS2007) / Massachusetts Island (ftUS)
- <epsg3585> : NAD83(NSRS2007) / Massachusetts Mainland
- <epsg3586> : NAD83(NSRS2007) / Massachusetts Mainland (ftUS)
- <epsg3587> : NAD83(NSRS2007) / Michigan Central
- <epsg3588> : NAD83(NSRS2007) / Michigan Central (ft)
- <epsg3589> : NAD83(NSRS2007) / Michigan North
- <epsg3590> : NAD83(NSRS2007) / Michigan North (ft)
- <epsg3591> : NAD83(NSRS2007) / Michigan Oblique Mercator
- <epsg3592> : NAD83(NSRS2007) / Michigan South
- <epsg3593> : NAD83(NSRS2007) / Michigan South (ft)
- <epsg3594> : NAD83(NSRS2007) / Minnesota Central
- <epsg3595> : NAD83(NSRS2007) / Minnesota North
- <epsg3596> : NAD83(NSRS2007) / Minnesota South
- <epsg3597> : NAD83(NSRS2007) / Mississippi East
- <epsg3598> : NAD83(NSRS2007) / Mississippi East (ftUS)
- <epsg3599> : NAD83(NSRS2007) / Mississippi West
- <epsg3600> : NAD83(NSRS2007) / Mississippi West (ftUS)
- <epsg3601> : NAD83(NSRS2007) / Missouri Central
- <epsg3602> : NAD83(NSRS2007) / Missouri East
- <epsg3603> : NAD83(NSRS2007) / Missouri West
- <epsg3604> : NAD83(NSRS2007) / Montana
- <epsg3605> : NAD83(NSRS2007) / Montana (ft)
- <epsg3606> : NAD83(NSRS2007) / Nebraska
- <epsg3607> : NAD83(NSRS2007) / Nevada Central
- <epsg3608> : NAD83(NSRS2007) / Nevada Central (ft US)
- <epsg3609> : NAD83(NSRS2007) / Nevada East
- <epsg3610> : NAD83(NSRS2007) / Nevada East (ft US)
- <epsg3611> : NAD83(NSRS2007) / Nevada West
- <epsg3612> : NAD83(NSRS2007) / Nevada West (ft US)
- <epsg3613> : NAD83(NSRS2007) / New Hampshire
- <epsg3614> : NAD83(NSRS2007) / New Hampshire (ftUS)
- <epsg3615> : NAD83(NSRS2007) / New Jersey
- <epsg3616> : NAD83(NSRS2007) / New Jersey (ft US)
- <epsg3617> : NAD83(NSRS2007) / New Mexico Central
- <epsg3618> : NAD83(NSRS2007) / New Mexico Central (ftUS)
- <epsg3619> : NAD83(NSRS2007) / New Mexico East
- <epsg3620> : NAD83(NSRS2007) / New Mexico East (ftUS)
- <epsg3621> : NAD83(NSRS2007) / New Mexico West
- <epsg3622> : NAD83(NSRS2007) / New Mexico West (ftUS)
- <epsg3623> : NAD83(NSRS2007) / New York Central
- <epsg3624> : NAD83(NSRS2007) / New York Central (ftUS)
- <epsg3625> : NAD83(NSRS2007) / New York East
- <epsg3626> : NAD83(NSRS2007) / New York East (ftUS)
- <epsg3627> : NAD83(NSRS2007) / New York Long Island
- <epsg3628> : NAD83(NSRS2007) / New York Long Island (ftUS)
- <epsg3629> : NAD83(NSRS2007) / New York West
- <epsg3630> : NAD83(NSRS2007) / New York West (ftUS)
- <epsg3631> : NAD83(NSRS2007) / North Carolina
- <epsg3632> : NAD83(NSRS2007) / North Carolina (ftUS)
- <epsg3633> : NAD83(NSRS2007) / North Dakota North
- <epsg3634> : NAD83(NSRS2007) / North Dakota North (ft)
- <epsg3635> : NAD83(NSRS2007) / North Dakota South
- <epsg3636> : NAD83(NSRS2007) / North Dakota South (ft)
- <epsg3637> : NAD83(NSRS2007) / Ohio North
- <epsg3638> : NAD83(NSRS2007) / Ohio South
- <epsg3639> : NAD83(NSRS2007) / Oklahoma North
- <epsg3640> : NAD83(NSRS2007) / Oklahoma North (ftUS)
- <epsg3641> : NAD83(NSRS2007) / Oklahoma South
- <epsg3642> : NAD83(NSRS2007) / Oklahoma South (ftUS)
- <epsg3643> : NAD83(NSRS2007) / Oregon Lambert
- <epsg3644> : NAD83(NSRS2007) / Oregon Lambert (ft)
- <epsg3645> : NAD83(NSRS2007) / Oregon North
- <epsg3646> : NAD83(NSRS2007) / Oregon North (ft)
- <epsg3647> : NAD83(NSRS2007) / Oregon South
- <epsg3648> : NAD83(NSRS2007) / Oregon South (ft)
- <epsg3649> : NAD83(NSRS2007) / Pennsylvania North
- <epsg3650> : NAD83(NSRS2007) / Pennsylvania North (ftUS)
- <epsg3651> : NAD83(NSRS2007) / Pennsylvania South
- <epsg3652> : NAD83(NSRS2007) / Pennsylvania South (ftUS)
- <epsg3653> : NAD83(NSRS2007) / Rhode Island
- <epsg3654> : NAD83(NSRS2007) / Rhode Island (ftUS)
- <epsg3655> : NAD83(NSRS2007) / South Carolina
- <epsg3656> : NAD83(NSRS2007) / South Carolina (ft)
- <epsg3657> : NAD83(NSRS2007) / South Dakota North
- <epsg3658> : NAD83(NSRS2007) / South Dakota North (ftUS)
- <epsg3659> : NAD83(NSRS2007) / South Dakota South
- <epsg3660> : NAD83(NSRS2007) / South Dakota South (ftUS)
- <epsg3661> : NAD83(NSRS2007) / Tennessee
- <epsg3662> : NAD83(NSRS2007) / Tennessee (ftUS)
- <epsg3663> : NAD83(NSRS2007) / Texas Central
- <epsg3664> : NAD83(NSRS2007) / Texas Central (ftUS)
- <epsg3665> : NAD83(NSRS2007) / Texas Centric Albers Equal Area
- <epsg3666> : NAD83(NSRS2007) / Texas Centric Lambert Conformal
- <epsg3667> : NAD83(NSRS2007) / Texas North
- <epsg3668> : NAD83(NSRS2007) / Texas North (ftUS)
- <epsg3669> : NAD83(NSRS2007) / Texas North Central
- <epsg3670> : NAD83(NSRS2007) / Texas North Central (ftUS)
- <epsg3671> : NAD83(NSRS2007) / Texas South
- <epsg3672> : NAD83(NSRS2007) / Texas South (ftUS)
- <epsg3673> : NAD83(NSRS2007) / Texas South Central
- <epsg3674> : NAD83(NSRS2007) / Texas South Central (ftUS)
- <epsg3675> : NAD83(NSRS2007) / Utah Central
- <epsg3676> : NAD83(NSRS2007) / Utah Central (ft)
- <epsg3677> : NAD83(NSRS2007) / Utah Central (ftUS)
- <epsg3678> : NAD83(NSRS2007) / Utah North
- <epsg3679> : NAD83(NSRS2007) / Utah North (ft)
- <epsg3680> : NAD83(NSRS2007) / Utah North (ftUS)
- <epsg3681> : NAD83(NSRS2007) / Utah South
- <epsg3682> : NAD83(NSRS2007) / Utah South (ft)
- <epsg3683> : NAD83(NSRS2007) / Utah South (ftUS)
- <epsg3684> : NAD83(NSRS2007) / Vermont
- <epsg3685> : NAD83(NSRS2007) / Virginia North
- <epsg3686> : NAD83(NSRS2007) / Virginia North (ftUS)
- <epsg3687> : NAD83(NSRS2007) / Virginia South
- <epsg3688> : NAD83(NSRS2007) / Virginia South (ftUS)
- <epsg3689> : NAD83(NSRS2007) / Washington North
- <epsg3690> : NAD83(NSRS2007) / Washington North (ftUS)
- <epsg3691> : NAD83(NSRS2007) / Washington South
- <epsg3692> : NAD83(NSRS2007) / Washington South (ftUS)
- <epsg3693> : NAD83(NSRS2007) / West Virginia North
- <epsg3694> : NAD83(NSRS2007) / West Virginia South
- <epsg3695> : NAD83(NSRS2007) / Wisconsin Central
- <epsg3696> : NAD83(NSRS2007) / Wisconsin Central (ftUS)
- <epsg3697> : NAD83(NSRS2007) / Wisconsin North
- <epsg3698> : NAD83(NSRS2007) / Wisconsin North (ftUS)
- <epsg3699> : NAD83(NSRS2007) / Wisconsin South
- <epsg3700> : NAD83(NSRS2007) / Wisconsin South (ftUS)
- <epsg3701> : NAD83(NSRS2007) / Wisconsin Transverse Mercator
- <epsg3702> : NAD83(NSRS2007) / Wyoming East
- <epsg3703> : NAD83(NSRS2007) / Wyoming East Central
- <epsg3704> : NAD83(NSRS2007) / Wyoming West Central
- <epsg3705> : NAD83(NSRS2007) / Wyoming West
- <epsg3706> : NAD83(NSRS2007) / UTM zone 59N
- <epsg3707> : NAD83(NSRS2007) / UTM zone 60N
- <epsg3708> : NAD83(NSRS2007) / UTM zone 1N
- <epsg3709> : NAD83(NSRS2007) / UTM zone 2N
- <epsg3710> : NAD83(NSRS2007) / UTM zone 3N
- <epsg3711> : NAD83(NSRS2007) / UTM zone 4N
- <epsg3712> : NAD83(NSRS2007) / UTM zone 5N
- <epsg3713> : NAD83(NSRS2007) / UTM zone 6N
- <epsg3714> : NAD83(NSRS2007) / UTM zone 7N
- <epsg3715> : NAD83(NSRS2007) / UTM zone 8N
- <epsg3716> : NAD83(NSRS2007) / UTM zone 9N
- <epsg3717> : NAD83(NSRS2007) / UTM zone 10N
- <epsg3718> : NAD83(NSRS2007) / UTM zone 11N
- <epsg3719> : NAD83(NSRS2007) / UTM zone 12N
- <epsg3720> : NAD83(NSRS2007) / UTM zone 13N
- <epsg3721> : NAD83(NSRS2007) / UTM zone 14N
- <epsg3722> : NAD83(NSRS2007) / UTM zone 15N
- <epsg3723> : NAD83(NSRS2007) / UTM zone 16N
- <epsg3724> : NAD83(NSRS2007) / UTM zone 17N
- <epsg3725> : NAD83(NSRS2007) / UTM zone 18N
- <epsg3726> : NAD83(NSRS2007) / UTM zone 19N
- <epsg3727> : Reunion 1947 / TM Reunion
- <epsg3728> : NAD83(NSRS2007) / Ohio North (ftUS)
- <epsg3729> : NAD83(NSRS2007) / Ohio South (ftUS)
- <epsg3730> : NAD83(NSRS2007) / Wyoming East (ftUS)
- <epsg3731> : NAD83(NSRS2007) / Wyoming East Central (ftUS)
- <epsg3732> : NAD83(NSRS2007) / Wyoming West Central (ftUS)
- <epsg3733> : NAD83(NSRS2007) / Wyoming West (ftUS)
- <epsg3734> : NAD83 / Ohio North (ftUS)
- <epsg3735> : NAD83 / Ohio South (ftUS)
- <epsg3736> : NAD83 / Wyoming East (ftUS)
- <epsg3737> : NAD83 / Wyoming East Central (ftUS)
- <epsg3738> : NAD83 / Wyoming West Central (ftUS)
- <epsg3739> : NAD83 / Wyoming West (ftUS)
- <epsg3740> : NAD83(HARN) / UTM zone 10N
- <epsg3741> : NAD83(HARN) / UTM zone 11N
- <epsg3742> : NAD83(HARN) / UTM zone 12N
- <epsg3743> : NAD83(HARN) / UTM zone 13N
- <epsg3744> : NAD83(HARN) / UTM zone 14N
- <epsg3745> : NAD83(HARN) / UTM zone 15N
- <epsg3746> : NAD83(HARN) / UTM zone 16N
- <epsg3747> : NAD83(HARN) / UTM zone 17N
- <epsg3748> : NAD83(HARN) / UTM zone 18N
- <epsg3749> : NAD83(HARN) / UTM zone 19N
- <epsg3750> : NAD83(HARN) / UTM zone 4N
- <epsg3751> : NAD83(HARN) / UTM zone 5N
- <epsg3752> : WGS 84 / Mercator 41
- <epsg3753> : NAD83(HARN) / Ohio North (ftUS)
- <epsg3754> : NAD83(HARN) / Ohio South (ftUS)
- <epsg3755> : NAD83(HARN) / Wyoming East (ftUS)
- <epsg3756> : NAD83(HARN) / Wyoming East Central (ftUS)
- <epsg3757> : NAD83(HARN) / Wyoming West Central (ftUS)
- <epsg3758> : NAD83(HARN) / Wyoming West (ftUS)
- <epsg3759> : NAD83 / Hawaii zone 3 (ftUS)
- <epsg3760> : NAD83(HARN) / Hawaii zone 3 (ftUS)
- <epsg3761> : NAD83(CSRS) / UTM zone 22N
- <epsg3762> : WGS 84 / South Georgia Lambert
- <epsg3920> : Puerto Rico / UTM zone 20N
- <epsg3991> : Puerto Rico State Plane CS of 1927
- <epsg3992> : Puerto Rico / St. Croix
- <epsg20004> : Pulkovo 1995 / Gauss-Kruger zone 4
- <epsg20005> : Pulkovo 1995 / Gauss-Kruger zone 5
- <epsg20006> : Pulkovo 1995 / Gauss-Kruger zone 6
- <epsg20007> : Pulkovo 1995 / Gauss-Kruger zone 7
- <epsg20008> : Pulkovo 1995 / Gauss-Kruger zone 8
- <epsg20009> : Pulkovo 1995 / Gauss-Kruger zone 9
- <epsg20010> : Pulkovo 1995 / Gauss-Kruger zone 10
- <epsg20011> : Pulkovo 1995 / Gauss-Kruger zone 11
- <epsg20012> : Pulkovo 1995 / Gauss-Kruger zone 12
- <epsg20013> : Pulkovo 1995 / Gauss-Kruger zone 13
- <epsg20014> : Pulkovo 1995 / Gauss-Kruger zone 14
- <epsg20015> : Pulkovo 1995 / Gauss-Kruger zone 15
- <epsg20016> : Pulkovo 1995 / Gauss-Kruger zone 16
- <epsg20017> : Pulkovo 1995 / Gauss-Kruger zone 17
- <epsg20018> : Pulkovo 1995 / Gauss-Kruger zone 18
- <epsg20019> : Pulkovo 1995 / Gauss-Kruger zone 19
- <epsg20020> : Pulkovo 1995 / Gauss-Kruger zone 20
- <epsg20021> : Pulkovo 1995 / Gauss-Kruger zone 21
- <epsg20022> : Pulkovo 1995 / Gauss-Kruger zone 22
- <epsg20023> : Pulkovo 1995 / Gauss-Kruger zone 23
- <epsg20024> : Pulkovo 1995 / Gauss-Kruger zone 24
- <epsg20025> : Pulkovo 1995 / Gauss-Kruger zone 25
- <epsg20026> : Pulkovo 1995 / Gauss-Kruger zone 26
- <epsg20027> : Pulkovo 1995 / Gauss-Kruger zone 27
- <epsg20028> : Pulkovo 1995 / Gauss-Kruger zone 28
- <epsg20029> : Pulkovo 1995 / Gauss-Kruger zone 29
- <epsg20030> : Pulkovo 1995 / Gauss-Kruger zone 30
- <epsg20031> : Pulkovo 1995 / Gauss-Kruger zone 31
- <epsg20032> : Pulkovo 1995 / Gauss-Kruger zone 32
- <epsg20064> : Pulkovo 1995 / Gauss-Kruger 4N (deprecated)
- <epsg20065> : Pulkovo 1995 / Gauss-Kruger 5N (deprecated)
- <epsg20066> : Pulkovo 1995 / Gauss-Kruger 6N (deprecated)
- <epsg20067> : Pulkovo 1995 / Gauss-Kruger 7N (deprecated)
- <epsg20068> : Pulkovo 1995 / Gauss-Kruger 8N (deprecated)
- <epsg20069> : Pulkovo 1995 / Gauss-Kruger 9N (deprecated)
- <epsg20070> : Pulkovo 1995 / Gauss-Kruger 10N (deprecated)
- <epsg20071> : Pulkovo 1995 / Gauss-Kruger 11N (deprecated)
- <epsg20072> : Pulkovo 1995 / Gauss-Kruger 12N (deprecated)
- <epsg20073> : Pulkovo 1995 / Gauss-Kruger 13N (deprecated)
- <epsg20074> : Pulkovo 1995 / Gauss-Kruger 14N (deprecated)
- <epsg20075> : Pulkovo 1995 / Gauss-Kruger 15N (deprecated)
- <epsg20076> : Pulkovo 1995 / Gauss-Kruger 16N (deprecated)
- <epsg20077> : Pulkovo 1995 / Gauss-Kruger 17N (deprecated)
- <epsg20078> : Pulkovo 1995 / Gauss-Kruger 18N (deprecated)
- <epsg20079> : Pulkovo 1995 / Gauss-Kruger 19N (deprecated)
- <epsg20080> : Pulkovo 1995 / Gauss-Kruger 20N (deprecated)
- <epsg20081> : Pulkovo 1995 / Gauss-Kruger 21N (deprecated)
- <epsg20082> : Pulkovo 1995 / Gauss-Kruger 22N (deprecated)
- <epsg20083> : Pulkovo 1995 / Gauss-Kruger 23N (deprecated)
- <epsg20084> : Pulkovo 1995 / Gauss-Kruger 24N (deprecated)
- <epsg20085> : Pulkovo 1995 / Gauss-Kruger 25N (deprecated)
- <epsg20086> : Pulkovo 1995 / Gauss-Kruger 26N (deprecated)
- <epsg20087> : Pulkovo 1995 / Gauss-Kruger 27N (deprecated)
- <epsg20088> : Pulkovo 1995 / Gauss-Kruger 28N (deprecated)
- <epsg20089> : Pulkovo 1995 / Gauss-Kruger 29N (deprecated)
- <epsg20090> : Pulkovo 1995 / Gauss-Kruger 30N (deprecated)
- <epsg20091> : Pulkovo 1995 / Gauss-Kruger 31N (deprecated)
- <epsg20092> : Pulkovo 1995 / Gauss-Kruger 32N (deprecated)
- <epsg20135> : Adindan / UTM zone 35N
- <epsg20136> : Adindan / UTM zone 36N
- <epsg20137> : Adindan / UTM zone 37N
- <epsg20138> : Adindan / UTM zone 38N
- <epsg20248> : AGD66 / AMG zone 48
- <epsg20249> : AGD66 / AMG zone 49
- <epsg20250> : AGD66 / AMG zone 50
- <epsg20251> : AGD66 / AMG zone 51
- <epsg20252> : AGD66 / AMG zone 52
- <epsg20253> : AGD66 / AMG zone 53
- <epsg20254> : AGD66 / AMG zone 54
- <epsg20255> : AGD66 / AMG zone 55
- <epsg20256> : AGD66 / AMG zone 56
- <epsg20257> : AGD66 / AMG zone 57
- <epsg20258> : AGD66 / AMG zone 58
- <epsg20348> : AGD84 / AMG zone 48
- <epsg20349> : AGD84 / AMG zone 49
- <epsg20350> : AGD84 / AMG zone 50
- <epsg20351> : AGD84 / AMG zone 51
- <epsg20352> : AGD84 / AMG zone 52
- <epsg20353> : AGD84 / AMG zone 53
- <epsg20354> : AGD84 / AMG zone 54
- <epsg20355> : AGD84 / AMG zone 55
- <epsg20356> : AGD84 / AMG zone 56
- <epsg20357> : AGD84 / AMG zone 57
- <epsg20358> : AGD84 / AMG zone 58
- <epsg20436> : Ain el Abd / UTM zone 36N
- <epsg20437> : Ain el Abd / UTM zone 37N
- <epsg20438> : Ain el Abd / UTM zone 38N
- <epsg20439> : Ain el Abd / UTM zone 39N
- <epsg20440> : Ain el Abd / UTM zone 40N
- <epsg20499> : Ain el Abd / Bahrain Grid
- <epsg20538> : Afgooye / UTM zone 38N
- <epsg20539> : Afgooye / UTM zone 39N
- <epsg20790> : Lisbon (Lisbon)/Portuguese National Grid
- <epsg20791> : Lisbon (Lisbon)/Portuguese Grid
- <epsg20822> : Aratu / UTM zone 22S
- <epsg20823> : Aratu / UTM zone 23S
- <epsg20824> : Aratu / UTM zone 24S
- <epsg20934> : Arc 1950 / UTM zone 34S
- <epsg20935> : Arc 1950 / UTM zone 35S
- <epsg20936> : Arc 1950 / UTM zone 36S
- <epsg21035> : Arc 1960 / UTM zone 35S
- <epsg21036> : Arc 1960 / UTM zone 36S
- <epsg21037> : Arc 1960 / UTM zone 37S
- <epsg21095> : Arc 1960 / UTM zone 35N
- <epsg21096> : Arc 1960 / UTM zone 36N
- <epsg21097> : Arc 1960 / UTM zone 37N
- <epsg21100> : Batavia (Jakarta) / NEIEZ (deprecated)
- <epsg21148> : Batavia / UTM zone 48S
- <epsg21149> : Batavia / UTM zone 49S
- <epsg21150> : Batavia / UTM zone 50S
- <epsg21291> : Barbados 1938 / British West Indies Grid
- <epsg21292> : Barbados 1938 / Barbados National Grid
- <epsg21413> : Beijing 1954 / Gauss-Kruger zone 13
- <epsg21414> : Beijing 1954 / Gauss-Kruger zone 14
- <epsg21415> : Beijing 1954 / Gauss-Kruger zone 15
- <epsg21416> : Beijing 1954 / Gauss-Kruger zone 16
- <epsg21417> : Beijing 1954 / Gauss-Kruger zone 17
- <epsg21418> : Beijing 1954 / Gauss-Kruger zone 18
- <epsg21419> : Beijing 1954 / Gauss-Kruger zone 19
- <epsg21420> : Beijing 1954 / Gauss-Kruger zone 20
- <epsg21421> : Beijing 1954 / Gauss-Kruger zone 21
- <epsg21422> : Beijing 1954 / Gauss-Kruger zone 22
- <epsg21423> : Beijing 1954 / Gauss-Kruger zone 23
- <epsg21453> : Beijing 1954 / Gauss-Kruger CM 75E
- <epsg21454> : Beijing 1954 / Gauss-Kruger CM 81E
- <epsg21455> : Beijing 1954 / Gauss-Kruger CM 87E
- <epsg21456> : Beijing 1954 / Gauss-Kruger CM 93E
- <epsg21457> : Beijing 1954 / Gauss-Kruger CM 99E
- <epsg21458> : Beijing 1954 / Gauss-Kruger CM 105E
- <epsg21459> : Beijing 1954 / Gauss-Kruger CM 111E
- <epsg21460> : Beijing 1954 / Gauss-Kruger CM 117E
- <epsg21461> : Beijing 1954 / Gauss-Kruger CM 123E
- <epsg21462> : Beijing 1954 / Gauss-Kruger CM 129E
- <epsg21463> : Beijing 1954 / Gauss-Kruger CM 135E
- <epsg21473> : Beijing 1954 / Gauss-Kruger 13N (deprecated)
- <epsg21474> : Beijing 1954 / Gauss-Kruger 14N (deprecated)
- <epsg21475> : Beijing 1954 / Gauss-Kruger 15N (deprecated)
- <epsg21476> : Beijing 1954 / Gauss-Kruger 16N (deprecated)
- <epsg21477> : Beijing 1954 / Gauss-Kruger 17N (deprecated)
- <epsg21478> : Beijing 1954 / Gauss-Kruger 18N (deprecated)
- <epsg21479> : Beijing 1954 / Gauss-Kruger 19N (deprecated)
- <epsg21480> : Beijing 1954 / Gauss-Kruger 20N (deprecated)
- <epsg21481> : Beijing 1954 / Gauss-Kruger 21N (deprecated)
- <epsg21482> : Beijing 1954 / Gauss-Kruger 22N (deprecated)
- <epsg21483> : Beijing 1954 / Gauss-Kruger 23N (deprecated)
- <epsg21500> : Belge 1950 (Brussels) / Belge Lambert 50
- <epsg21780> : Bern 1898 (Bern) / LV03C
- <epsg21781> : CH1903 / LV03
- <epsg21817> : Bogota 1975 / UTM zone 17N (deprecated)
- <epsg21818> : Bogota 1975 / UTM zone 18N
- <epsg21891> : Bogota 1975 / Colombia West zone (deprecated)
- <epsg21892> : Bogota 1975 / Colombia Bogota zone (deprecated)
- <epsg21893> : Bogota 1975 / Colombia East Central zone (deprecated)
- <epsg21894> : Bogota 1975 / Colombia East (deprecated)
- <epsg21896> : Bogota 1975 / Colombia West zone
- <epsg21897> : Bogota 1975 / Colombia Bogota zone
- <epsg21898> : Bogota 1975 / Colombia East Central zone
- <epsg21899> : Bogota 1975 / Colombia East
- <epsg22032> : Camacupa / UTM zone 32S
- <epsg22033> : Camacupa / UTM zone 33S
- <epsg22091> : Camacupa / TM 11.30 SE
- <epsg22092> : Camacupa / TM 12 SE
- <epsg22171> : POSGAR 98 / Argentina 1
- <epsg22172> : POSGAR 98 / Argentina 2
- <epsg22173> : POSGAR 98 / Argentina 3
- <epsg22174> : POSGAR 98 / Argentina 4
- <epsg22175> : POSGAR 98 / Argentina 5
- <epsg22176> : POSGAR 98 / Argentina 6
- <epsg22177> : POSGAR 98 / Argentina 7
- <epsg22181> : POSGAR 94 / Argentina 1
- <epsg22182> : POSGAR 94 / Argentina 2
- <epsg22183> : POSGAR 94 / Argentina 3
- <epsg22184> : POSGAR 94 / Argentina 4
- <epsg22185> : POSGAR 94 / Argentina 5
- <epsg22186> : POSGAR 94 / Argentina 6
- <epsg22187> : POSGAR 94 / Argentina 7
- <epsg22191> : Campo Inchauspe / Argentina 1
- <epsg22192> : Campo Inchauspe / Argentina 2
- <epsg22193> : Campo Inchauspe / Argentina 3
- <epsg22194> : Campo Inchauspe / Argentina 4
- <epsg22195> : Campo Inchauspe / Argentina 5
- <epsg22196> : Campo Inchauspe / Argentina 6
- <epsg22197> : Campo Inchauspe / Argentina 7
- <epsg22234> : Cape / UTM zone 34S
- <epsg22235> : Cape / UTM zone 35S
- <epsg22236> : Cape / UTM zone 36S
- <epsg22332> : Carthage / UTM zone 32N
- <epsg22391> : Carthage / Nord Tunisie
- <epsg22392> : Carthage / Sud Tunisie
- <epsg22521> : Corrego Alegre / UTM zone 21S
- <epsg22522> : Corrego Alegre / UTM zone 22S
- <epsg22523> : Corrego Alegre / UTM zone 23S
- <epsg22524> : Corrego Alegre / UTM zone 24S
- <epsg22525> : Corrego Alegre / UTM zone 25S
- <epsg22700> : Deir ez Zor / Levant Zone
- <epsg22770> : Deir ez Zor / Syria Lambert
- <epsg22780> : Deir ez Zor / Levant Stereographic
- <epsg22832> : Douala / UTM zone 32N (deprecated)
- <epsg22991> : Egypt 1907 / Blue Belt
- <epsg22992> : Egypt 1907 / Red Belt
- <epsg22993> : Egypt 1907 / Purple Belt
- <epsg22994> : Egypt 1907 / Extended Purple Belt
- <epsg23028> : ED50 / UTM zone 28N
- <epsg23029> : ED50 / UTM zone 29N
- <epsg23030> : ED50 / UTM zone 30N
- <epsg23031> : ED50 / UTM zone 31N
- <epsg23032> : ED50 / UTM zone 32N
- <epsg23033> : ED50 / UTM zone 33N
- <epsg23034> : ED50 / UTM zone 34N
- <epsg23035> : ED50 / UTM zone 35N
- <epsg23036> : ED50 / UTM zone 36N
- <epsg23037> : ED50 / UTM zone 37N
- <epsg23038> : ED50 / UTM zone 38N
- <epsg23090> : ED50 / TM 0 N
- <epsg23095> : ED50 / TM 5 NE
- <epsg23239> : Fahud / UTM zone 39N
- <epsg23240> : Fahud / UTM zone 40N
- <epsg23433> : Garoua / UTM zone 33N (deprecated)
- <epsg23700> : HD72 / EOV
- <epsg23830> : DGN95 / Indonesia TM-3 zone 46.2
- <epsg23831> : DGN95 / Indonesia TM-3 zone 47.1
- <epsg23832> : DGN95 / Indonesia TM-3 zone 47.2
- <epsg23833> : DGN95 / Indonesia TM-3 zone 48.1
- <epsg23834> : DGN95 / Indonesia TM-3 zone 48.2
- <epsg23835> : DGN95 / Indonesia TM-3 zone 49.1
- <epsg23836> : DGN95 / Indonesia TM-3 zone 49.2
- <epsg23837> : DGN95 / Indonesia TM-3 zone 50.1
- <epsg23838> : DGN95 / Indonesia TM-3 zone 50.2
- <epsg23839> : DGN95 / Indonesia TM-3 zone 51.1
- <epsg23840> : DGN95 / Indonesia TM-3 zone 51.2
- <epsg23841> : DGN95 / Indonesia TM-3 zone 52.1
- <epsg23842> : DGN95 / Indonesia TM-3 zone 52.2
- <epsg23843> : DGN95 / Indonesia TM-3 zone 53.1
- <epsg23844> : DGN95 / Indonesia TM-3 zone 53.2
- <epsg23845> : DGN95 / Indonesia TM-3 zone 54.1
- <epsg23846> : ID74 / UTM zone 46N
- <epsg23847> : ID74 / UTM zone 47N
- <epsg23848> : ID74 / UTM zone 48N
- <epsg23849> : ID74 / UTM zone 49N
- <epsg23850> : ID74 / UTM zone 50N
- <epsg23851> : ID74 / UTM zone 51N
- <epsg23852> : ID74 / UTM zone 52N
- <epsg23853> : ID74 / UTM zone 53N (deprecated)
- <epsg23866> : DGN95 / UTM zone 46N
- <epsg23867> : DGN95 / UTM zone 47N
- <epsg23868> : DGN95 / UTM zone 48N
- <epsg23869> : DGN95 / UTM zone 49N
- <epsg23870> : DGN95 / UTM zone 50N
- <epsg23871> : DGN95 / UTM zone 51N
- <epsg23872> : DGN95 / UTM zone 52N
- <epsg23877> : DGN95 / UTM zone 47S
- <epsg23878> : DGN95 / UTM zone 48S
- <epsg23879> : DGN95 / UTM zone 49S
- <epsg23880> : DGN95 / UTM zone 50S
- <epsg23881> : DGN95 / UTM zone 51S
- <epsg23882> : DGN95 / UTM zone 52S
- <epsg23883> : DGN95 / UTM zone 53S
- <epsg23884> : DGN95 / UTM zone 54S
- <epsg23886> : ID74 / UTM zone 46S (deprecated)
- <epsg23887> : ID74 / UTM zone 47S
- <epsg23888> : ID74 / UTM zone 48S
- <epsg23889> : ID74 / UTM zone 49S
- <epsg23890> : ID74 / UTM zone 50S
- <epsg23891> : ID74 / UTM zone 51S
- <epsg23892> : ID74 / UTM zone 52S
- <epsg23893> : ID74 / UTM zone 53S
- <epsg23894> : ID74 / UTM zone 54S
- <epsg23946> : Indian 1954 / UTM zone 46N
- <epsg23947> : Indian 1954 / UTM zone 47N
- <epsg23948> : Indian 1954 / UTM zone 48N
- <epsg24047> : Indian 1975 / UTM zone 47N
- <epsg24048> : Indian 1975 / UTM zone 48N
- <epsg24100> : Jamaica 1875 / Jamaica (Old Grid)
- <epsg24200> : JAD69 / Jamaica National Grid
- <epsg24305> : Kalianpur 1937 / UTM zone 45N
- <epsg24306> : Kalianpur 1937 / UTM zone 46N
- <epsg24311> : Kalianpur 1962 / UTM zone 41N
- <epsg24312> : Kalianpur 1962 / UTM zone 42N
- <epsg24313> : Kalianpur 1962 / UTM zone 43N
- <epsg24342> : Kalianpur 1975 / UTM zone 42N
- <epsg24343> : Kalianpur 1975 / UTM zone 43N
- <epsg24344> : Kalianpur 1975 / UTM zone 44N
- <epsg24345> : Kalianpur 1975 / UTM zone 45N
- <epsg24346> : Kalianpur 1975 / UTM zone 46N
- <epsg24347> : Kalianpur 1975 / UTM zone 47N
- <epsg24370> : Kalianpur 1880 / India zone 0
- <epsg24371> : Kalianpur 1880 / India zone I
- <epsg24372> : Kalianpur 1880 / India zone IIa
- <epsg24373> : Kalianpur 1880 / India zone III
- <epsg24374> : Kalianpur 1880 / India zone IV
- <epsg24375> : Kalianpur 1937 / India zone IIb
- <epsg24376> : Kalianpur 1962 / India zone I
- <epsg24377> : Kalianpur 1962 / India zone IIa
- <epsg24378> : Kalianpur 1975 / India zone I
- <epsg24379> : Kalianpur 1975 / India zone IIa
- <epsg24380> : Kalianpur 1975 / India zone IIb
- <epsg24381> : Kalianpur 1975 / India zone III
- <epsg24382> : Kalianpur 1880 / India zone IIb
- <epsg24383> : Kalianpur 1975 / India zone IV
- <epsg24500> : Kertau 1968 / Singapore Grid
- <epsg24547> : Kertau 1968 / UTM zone 47N
- <epsg24548> : Kertau 1968 / UTM zone 48N
- <epsg24571> : Kertau / R.S.O. Malaya (ch) (deprecated)
- <epsg24600> : KOC Lambert
- <epsg24718> : La Canoa / UTM zone 18N
- <epsg24719> : La Canoa / UTM zone 19N
- <epsg24720> : La Canoa / UTM zone 20N
- <epsg24817> : PSAD56 / UTM zone 17N
- <epsg24818> : PSAD56 / UTM zone 18N
- <epsg24819> : PSAD56 / UTM zone 19N
- <epsg24820> : PSAD56 / UTM zone 20N
- <epsg24821> : PSAD56 / UTM zone 21N
- <epsg24877> : PSAD56 / UTM zone 17S
- <epsg24878> : PSAD56 / UTM zone 18S
- <epsg24879> : PSAD56 / UTM zone 19S
- <epsg24880> : PSAD56 / UTM zone 20S
- <epsg24881> : PSAD56 / UTM zone 21S
- <epsg24882> : PSAD56 / UTM zone 22S
- <epsg24891> : PSAD56 / Peru west zone
- <epsg24892> : PSAD56 / Peru central zone
- <epsg24893> : PSAD56 / Peru east zone
- <epsg25000> : Leigon / Ghana Metre Grid
- <epsg25231> : Lome / UTM zone 31N
- <epsg25391> : Luzon 1911 / Philippines zone I
- <epsg25392> : Luzon 1911 / Philippines zone II
- <epsg25393> : Luzon 1911 / Philippines zone III
- <epsg25394> : Luzon 1911 / Philippines zone IV
- <epsg25395> : Luzon 1911 / Philippines zone V
- <epsg25700> : Makassar (Jakarta) / NEIEZ (deprecated)
- <epsg25828> : ETRS89 / UTM zone 28N
- <epsg25829> : ETRS89 / UTM zone 29N
- <epsg25830> : ETRS89 / UTM zone 30N
- <epsg25831> : ETRS89 / UTM zone 31N
- <epsg25832> : ETRS89 / UTM zone 32N
- <epsg25833> : ETRS89 / UTM zone 33N
- <epsg25834> : ETRS89 / UTM zone 34N
- <epsg25835> : ETRS89 / UTM zone 35N
- <epsg25836> : ETRS89 / UTM zone 36N
- <epsg25837> : ETRS89 / UTM zone 37N
- <epsg25838> : ETRS89 / UTM zone 38N
- <epsg25884> : ETRS89 / TM Baltic93
- <epsg25932> : Malongo 1987 / UTM zone 32S
- <epsg26191> : Merchich / Nord Maroc
- <epsg26192> : Merchich / Sud Maroc
- <epsg26193> : Merchich / Sahara (deprecated)
- <epsg26194> : Merchich / Sahara Nord
- <epsg26195> : Merchich / Sahara Sud
- <epsg26237> : Massawa / UTM zone 37N
- <epsg26331> : Minna / UTM zone 31N
- <epsg26332> : Minna / UTM zone 32N
- <epsg26391> : Minna / Nigeria West Belt
- <epsg26392> : Minna / Nigeria Mid Belt
- <epsg26393> : Minna / Nigeria East Belt
- <epsg26432> : Mhast / UTM zone 32S (deprecated)
- <epsg26591> : Monte Mario (Rome) / Italy zone 1 (deprecated)
- <epsg26592> : Monte Mario (Rome) / Italy zone 2 (deprecated)
- <epsg26632> : M'poraloko / UTM zone 32N
- <epsg26692> : M'poraloko / UTM zone 32S
- <epsg26701> : NAD27 / UTM zone 1N
- <epsg26702> : NAD27 / UTM zone 2N
- <epsg26703> : NAD27 / UTM zone 3N
- <epsg26704> : NAD27 / UTM zone 4N
- <epsg26705> : NAD27 / UTM zone 5N
- <epsg26706> : NAD27 / UTM zone 6N
- <epsg26707> : NAD27 / UTM zone 7N
- <epsg26708> : NAD27 / UTM zone 8N
- <epsg26709> : NAD27 / UTM zone 9N
- <epsg26710> : NAD27 / UTM zone 10N
- <epsg26711> : NAD27 / UTM zone 11N
- <epsg26712> : NAD27 / UTM zone 12N
- <epsg26713> : NAD27 / UTM zone 13N
- <epsg26714> : NAD27 / UTM zone 14N
- <epsg26715> : NAD27 / UTM zone 15N
- <epsg26716> : NAD27 / UTM zone 16N
- <epsg26717> : NAD27 / UTM zone 17N
- <epsg26718> : NAD27 / UTM zone 18N
- <epsg26719> : NAD27 / UTM zone 19N
- <epsg26720> : NAD27 / UTM zone 20N
- <epsg26721> : NAD27 / UTM zone 21N
- <epsg26722> : NAD27 / UTM zone 22N
- <epsg26729> : NAD27 / Alabama East
- <epsg26730> : NAD27 / Alabama West
- <epsg26731> : NAD27 / Alaska zone 1
- <epsg26732> : NAD27 / Alaska zone 2
- <epsg26733> : NAD27 / Alaska zone 3
- <epsg26734> : NAD27 / Alaska zone 4
- <epsg26735> : NAD27 / Alaska zone 5
- <epsg26736> : NAD27 / Alaska zone 6
- <epsg26737> : NAD27 / Alaska zone 7
- <epsg26738> : NAD27 / Alaska zone 8
- <epsg26739> : NAD27 / Alaska zone 9
- <epsg26740> : NAD27 / Alaska zone 10
- <epsg26741> : NAD27 / California zone I
- <epsg26742> : NAD27 / California zone II
- <epsg26743> : NAD27 / California zone III
- <epsg26744> : NAD27 / California zone IV
- <epsg26745> : NAD27 / California zone V
- <epsg26746> : NAD27 / California zone VI
- <epsg26747> : NAD27 / California zone VII (deprecated)
- <epsg26748> : NAD27 / Arizona East
- <epsg26749> : NAD27 / Arizona Central
- <epsg26750> : NAD27 / Arizona West
- <epsg26751> : NAD27 / Arkansas North
- <epsg26752> : NAD27 / Arkansas South
- <epsg26753> : NAD27 / Colorado North
- <epsg26754> : NAD27 / Colorado Central
- <epsg26755> : NAD27 / Colorado South
- <epsg26756> : NAD27 / Connecticut
- <epsg26757> : NAD27 / Delaware
- <epsg26758> : NAD27 / Florida East
- <epsg26759> : NAD27 / Florida West
- <epsg26760> : NAD27 / Florida North
- <epsg26766> : NAD27 / Georgia East
- <epsg26767> : NAD27 / Georgia West
- <epsg26768> : NAD27 / Idaho East
- <epsg26769> : NAD27 / Idaho Central
- <epsg26770> : NAD27 / Idaho West
- <epsg26771> : NAD27 / Illinois East
- <epsg26772> : NAD27 / Illinois West
- <epsg26773> : NAD27 / Indiana East
- <epsg26774> : NAD27 / Indiana West
- <epsg26775> : NAD27 / Iowa North
- <epsg26776> : NAD27 / Iowa South
- <epsg26777> : NAD27 / Kansas North
- <epsg26778> : NAD27 / Kansas South
- <epsg26779> : NAD27 / Kentucky North
- <epsg26780> : NAD27 / Kentucky South
- <epsg26781> : NAD27 / Louisiana North
- <epsg26782> : NAD27 / Louisiana South
- <epsg26783> : NAD27 / Maine East
- <epsg26784> : NAD27 / Maine West
- <epsg26785> : NAD27 / Maryland
- <epsg26786> : NAD27 / Massachusetts Mainland
- <epsg26787> : NAD27 / Massachusetts Island
- <epsg26791> : NAD27 / Minnesota North
- <epsg26792> : NAD27 / Minnesota Central
- <epsg26793> : NAD27 / Minnesota South
- <epsg26794> : NAD27 / Mississippi East
- <epsg26795> : NAD27 / Mississippi West
- <epsg26796> : NAD27 / Missouri East
- <epsg26797> : NAD27 / Missouri Central
- <epsg26798> : NAD27 / Missouri West
- <epsg26799> : NAD27 / California zone VII
- <epsg26801> : NAD Michigan / Michigan East
- <epsg26802> : NAD Michigan / Michigan Old Central
- <epsg26803> : NAD Michigan / Michigan West
- <epsg26811> : NAD Michigan / Michigan North
- <epsg26812> : NAD Michigan / Michigan Central
- <epsg26813> : NAD Michigan / Michigan South
- <epsg26901> : NAD83 / UTM zone 1N
- <epsg26902> : NAD83 / UTM zone 2N
- <epsg26903> : NAD83 / UTM zone 3N
- <epsg26904> : NAD83 / UTM zone 4N
- <epsg26905> : NAD83 / UTM zone 5N
- <epsg26906> : NAD83 / UTM zone 6N
- <epsg26907> : NAD83 / UTM zone 7N
- <epsg26908> : NAD83 / UTM zone 8N
- <epsg26909> : NAD83 / UTM zone 9N
- <epsg26910> : NAD83 / UTM zone 10N
- <epsg26911> : NAD83 / UTM zone 11N
- <epsg26912> : NAD83 / UTM zone 12N
- <epsg26913> : NAD83 / UTM zone 13N
- <epsg26914> : NAD83 / UTM zone 14N
- <epsg26915> : NAD83 / UTM zone 15N
- <epsg26916> : NAD83 / UTM zone 16N
- <epsg26917> : NAD83 / UTM zone 17N
- <epsg26918> : NAD83 / UTM zone 18N
- <epsg26919> : NAD83 / UTM zone 19N
- <epsg26920> : NAD83 / UTM zone 20N
- <epsg26921> : NAD83 / UTM zone 21N
- <epsg26922> : NAD83 / UTM zone 22N
- <epsg26923> : NAD83 / UTM zone 23N
- <epsg26929> : NAD83 / Alabama East
- <epsg26930> : NAD83 / Alabama West
- <epsg26931> : NAD83 / Alaska zone 1
- <epsg26932> : NAD83 / Alaska zone 2
- <epsg26933> : NAD83 / Alaska zone 3
- <epsg26934> : NAD83 / Alaska zone 4
- <epsg26935> : NAD83 / Alaska zone 5
- <epsg26936> : NAD83 / Alaska zone 6
- <epsg26937> : NAD83 / Alaska zone 7
- <epsg26938> : NAD83 / Alaska zone 8
- <epsg26939> : NAD83 / Alaska zone 9
- <epsg26940> : NAD83 / Alaska zone 10
- <epsg26941> : NAD83 / California zone 1
- <epsg26942> : NAD83 / California zone 2
- <epsg26943> : NAD83 / California zone 3
- <epsg26944> : NAD83 / California zone 4
- <epsg26945> : NAD83 / California zone 5
- <epsg26946> : NAD83 / California zone 6
- <epsg26948> : NAD83 / Arizona East
- <epsg26949> : NAD83 / Arizona Central
- <epsg26950> : NAD83 / Arizona West
- <epsg26951> : NAD83 / Arkansas North
- <epsg26952> : NAD83 / Arkansas South
- <epsg26953> : NAD83 / Colorado North
- <epsg26954> : NAD83 / Colorado Central
- <epsg26955> : NAD83 / Colorado South
- <epsg26956> : NAD83 / Connecticut
- <epsg26957> : NAD83 / Delaware
- <epsg26958> : NAD83 / Florida East
- <epsg26959> : NAD83 / Florida West
- <epsg26960> : NAD83 / Florida North
- <epsg26961> : NAD83 / Hawaii zone 1
- <epsg26962> : NAD83 / Hawaii zone 2
- <epsg26963> : NAD83 / Hawaii zone 3
- <epsg26964> : NAD83 / Hawaii zone 4
- <epsg26965> : NAD83 / Hawaii zone 5
- <epsg26966> : NAD83 / Georgia East
- <epsg26967> : NAD83 / Georgia West
- <epsg26968> : NAD83 / Idaho East
- <epsg26969> : NAD83 / Idaho Central
- <epsg26970> : NAD83 / Idaho West
- <epsg26971> : NAD83 / Illinois East
- <epsg26972> : NAD83 / Illinois West
- <epsg26973> : NAD83 / Indiana East
- <epsg26974> : NAD83 / Indiana West
- <epsg26975> : NAD83 / Iowa North
- <epsg26976> : NAD83 / Iowa South
- <epsg26977> : NAD83 / Kansas North
- <epsg26978> : NAD83 / Kansas South
- <epsg26979> : NAD83 / Kentucky North (deprecated)
- <epsg26980> : NAD83 / Kentucky South
- <epsg26981> : NAD83 / Louisiana North
- <epsg26982> : NAD83 / Louisiana South
- <epsg26983> : NAD83 / Maine East
- <epsg26984> : NAD83 / Maine West
- <epsg26985> : NAD83 / Maryland
- <epsg26986> : NAD83 / Massachusetts Mainland
- <epsg26987> : NAD83 / Massachusetts Island
- <epsg26988> : NAD83 / Michigan North
- <epsg26989> : NAD83 / Michigan Central
- <epsg26990> : NAD83 / Michigan South
- <epsg26991> : NAD83 / Minnesota North
- <epsg26992> : NAD83 / Minnesota Central
- <epsg26993> : NAD83 / Minnesota South
- <epsg26994> : NAD83 / Mississippi East
- <epsg26995> : NAD83 / Mississippi West
- <epsg26996> : NAD83 / Missouri East
- <epsg26997> : NAD83 / Missouri Central
- <epsg26998> : NAD83 / Missouri West
- <epsg27037> : Nahrwan 1967 / UTM zone 37N
- <epsg27038> : Nahrwan 1967 / UTM zone 38N
- <epsg27039> : Nahrwan 1967 / UTM zone 39N
- <epsg27040> : Nahrwan 1967 / UTM zone 40N
- <epsg27120> : Naparima 1972 / UTM zone 20N
- <epsg27200> : NZGD49 / New Zealand Map Grid
- <epsg27205> : NZGD49 / Mount Eden Circuit
- <epsg27206> : NZGD49 / Bay of Plenty Circuit
- <epsg27207> : NZGD49 / Poverty Bay Circuit
- <epsg27208> : NZGD49 / Hawkes Bay Circuit
- <epsg27209> : NZGD49 / Taranaki Circuit
- <epsg27210> : NZGD49 / Tuhirangi Circuit
- <epsg27211> : NZGD49 / Wanganui Circuit
- <epsg27212> : NZGD49 / Wairarapa Circuit
- <epsg27213> : NZGD49 / Wellington Circuit
- <epsg27214> : NZGD49 / Collingwood Circuit
- <epsg27215> : NZGD49 / Nelson Circuit
- <epsg27216> : NZGD49 / Karamea Circuit
- <epsg27217> : NZGD49 / Buller Circuit
- <epsg27218> : NZGD49 / Grey Circuit
- <epsg27219> : NZGD49 / Amuri Circuit
- <epsg27220> : NZGD49 / Marlborough Circuit
- <epsg27221> : NZGD49 / Hokitika Circuit
- <epsg27222> : NZGD49 / Okarito Circuit
- <epsg27223> : NZGD49 / Jacksons Bay Circuit
- <epsg27224> : NZGD49 / Mount Pleasant Circuit
- <epsg27225> : NZGD49 / Gawler Circuit
- <epsg27226> : NZGD49 / Timaru Circuit
- <epsg27227> : NZGD49 / Lindis Peak Circuit
- <epsg27228> : NZGD49 / Mount Nicholas Circuit
- <epsg27229> : NZGD49 / Mount York Circuit
- <epsg27230> : NZGD49 / Observation Point Circuit
- <epsg27231> : NZGD49 / North Taieri Circuit
- <epsg27232> : NZGD49 / Bluff Circuit
- <epsg27258> : NZGD49 / UTM zone 58S
- <epsg27259> : NZGD49 / UTM zone 59S
- <epsg27260> : NZGD49 / UTM zone 60S
- <epsg27291> : NZGD49 / North Island Grid
- <epsg27292> : NZGD49 / South Island Grid
- <epsg27391> : NGO 1948 (Oslo) / NGO zone I
- <epsg27392> : NGO 1948 (Oslo) / NGO zone II
- <epsg27393> : NGO 1948 (Oslo) / NGO zone III
- <epsg27394> : NGO 1948 (Oslo) / NGO zone IV
- <epsg27395> : NGO 1948 (Oslo) / NGO zone V
- <epsg27396> : NGO 1948 (Oslo) / NGO zone VI
- <epsg27397> : NGO 1948 (Oslo) / NGO zone VII
- <epsg27398> : NGO 1948 (Oslo) / NGO zone VIII
- <epsg27429> : Datum 73 / UTM zone 29N
- <epsg27492> : Datum 73 / Modified Portuguese Grid
- <epsg27500> : ATF (Paris) / Nord de Guerre
- <epsg27561> : NTF (Paris) / Lambert Nord France
- <epsg27562> : NTF (Paris) / Lambert Centre France
- <epsg27563> : NTF (Paris) / Lambert Sud France
- <epsg27564> : NTF (Paris) / Lambert Corse
- <epsg27571> : NTF (Paris) / Lambert zone I
- <epsg27572> : NTF (Paris) / Lambert zone II
- <epsg27573> : NTF (Paris) / Lambert zone III
- <epsg27574> : NTF (Paris) / Lambert zone IV
- <epsg27581> : NTF (Paris) / France I (deprecated)
- <epsg27582> : NTF (Paris) / France II (deprecated)
- <epsg27583> : NTF (Paris) / France III (deprecated)
- <epsg27584> : NTF (Paris) / France IV (deprecated)
- <epsg27591> : NTF (Paris) / Nord France (deprecated)
- <epsg27592> : NTF (Paris) / Centre France (deprecated)
- <epsg27593> : NTF (Paris) / Sud France (deprecated)
- <epsg27594> : NTF (Paris) / Corse (deprecated)
- <epsg27700> : OSGB 1936 / British National Grid
- <epsg28191> : Palestine 1923 / Palestine Grid
- <epsg28192> : Palestine 1923 / Palestine Belt
- <epsg28193> : Palestine 1923 / Israeli CS Grid
- <epsg28232> : Pointe Noire / UTM zone 32S
- <epsg28348> : GDA94 / MGA zone 48
- <epsg28349> : GDA94 / MGA zone 49
- <epsg28350> : GDA94 / MGA zone 50
- <epsg28351> : GDA94 / MGA zone 51
- <epsg28352> : GDA94 / MGA zone 52
- <epsg28353> : GDA94 / MGA zone 53
- <epsg28354> : GDA94 / MGA zone 54
- <epsg28355> : GDA94 / MGA zone 55
- <epsg28356> : GDA94 / MGA zone 56
- <epsg28357> : GDA94 / MGA zone 57
- <epsg28358> : GDA94 / MGA zone 58
- <epsg28402> : Pulkovo 1942 / Gauss-Kruger zone 2
- <epsg28403> : Pulkovo 1942 / Gauss-Kruger zone 3
- <epsg28404> : Pulkovo 1942 / Gauss-Kruger zone 4
- <epsg28405> : Pulkovo 1942 / Gauss-Kruger zone 5
- <epsg28406> : Pulkovo 1942 / Gauss-Kruger zone 6
- <epsg28407> : Pulkovo 1942 / Gauss-Kruger zone 7
- <epsg28408> : Pulkovo 1942 / Gauss-Kruger zone 8
- <epsg28409> : Pulkovo 1942 / Gauss-Kruger zone 9
- <epsg28410> : Pulkovo 1942 / Gauss-Kruger zone 10
- <epsg28411> : Pulkovo 1942 / Gauss-Kruger zone 11
- <epsg28412> : Pulkovo 1942 / Gauss-Kruger zone 12
- <epsg28413> : Pulkovo 1942 / Gauss-Kruger zone 13
- <epsg28414> : Pulkovo 1942 / Gauss-Kruger zone 14
- <epsg28415> : Pulkovo 1942 / Gauss-Kruger zone 15
- <epsg28416> : Pulkovo 1942 / Gauss-Kruger zone 16
- <epsg28417> : Pulkovo 1942 / Gauss-Kruger zone 17
- <epsg28418> : Pulkovo 1942 / Gauss-Kruger zone 18
- <epsg28419> : Pulkovo 1942 / Gauss-Kruger zone 19
- <epsg28420> : Pulkovo 1942 / Gauss-Kruger zone 20
- <epsg28421> : Pulkovo 1942 / Gauss-Kruger zone 21
- <epsg28422> : Pulkovo 1942 / Gauss-Kruger zone 22
- <epsg28423> : Pulkovo 1942 / Gauss-Kruger zone 23
- <epsg28424> : Pulkovo 1942 / Gauss-Kruger zone 24
- <epsg28425> : Pulkovo 1942 / Gauss-Kruger zone 25
- <epsg28426> : Pulkovo 1942 / Gauss-Kruger zone 26
- <epsg28427> : Pulkovo 1942 / Gauss-Kruger zone 27
- <epsg28428> : Pulkovo 1942 / Gauss-Kruger zone 28
- <epsg28429> : Pulkovo 1942 / Gauss-Kruger zone 29
- <epsg28430> : Pulkovo 1942 / Gauss-Kruger zone 30
- <epsg28431> : Pulkovo 1942 / Gauss-Kruger zone 31
- <epsg28432> : Pulkovo 1942 / Gauss-Kruger zone 32
- <epsg28462> : Pulkovo 1942 / Gauss-Kruger 2N (deprecated)
- <epsg28463> : Pulkovo 1942 / Gauss-Kruger 3N (deprecated)
- <epsg28464> : Pulkovo 1942 / Gauss-Kruger 4N (deprecated)
- <epsg28465> : Pulkovo 1942 / Gauss-Kruger 5N (deprecated)
- <epsg28466> : Pulkovo 1942 / Gauss-Kruger 6N (deprecated)
- <epsg28467> : Pulkovo 1942 / Gauss-Kruger 7N (deprecated)
- <epsg28468> : Pulkovo 1942 / Gauss-Kruger 8N (deprecated)
- <epsg28469> : Pulkovo 1942 / Gauss-Kruger 9N (deprecated)
- <epsg28470> : Pulkovo 1942 / Gauss-Kruger 10N (deprecated)
- <epsg28471> : Pulkovo 1942 / Gauss-Kruger 11N (deprecated)
- <epsg28472> : Pulkovo 1942 / Gauss-Kruger 12N (deprecated)
- <epsg28473> : Pulkovo 1942 / Gauss-Kruger 13N (deprecated)
- <epsg28474> : Pulkovo 1942 / Gauss-Kruger 14N (deprecated)
- <epsg28475> : Pulkovo 1942 / Gauss-Kruger 15N (deprecated)
- <epsg28476> : Pulkovo 1942 / Gauss-Kruger 16N (deprecated)
- <epsg28477> : Pulkovo 1942 / Gauss-Kruger 17N (deprecated)
- <epsg28478> : Pulkovo 1942 / Gauss-Kruger 18N (deprecated)
- <epsg28479> : Pulkovo 1942 / Gauss-Kruger 19N (deprecated)
- <epsg28480> : Pulkovo 1942 / Gauss-Kruger 20N (deprecated)
- <epsg28481> : Pulkovo 1942 / Gauss-Kruger 21N (deprecated)
- <epsg28482> : Pulkovo 1942 / Gauss-Kruger 22N (deprecated)
- <epsg28483> : Pulkovo 1942 / Gauss-Kruger 23N (deprecated)
- <epsg28484> : Pulkovo 1942 / Gauss-Kruger 24N (deprecated)
- <epsg28485> : Pulkovo 1942 / Gauss-Kruger 25N (deprecated)
- <epsg28486> : Pulkovo 1942 / Gauss-Kruger 26N (deprecated)
- <epsg28487> : Pulkovo 1942 / Gauss-Kruger 27N (deprecated)
- <epsg28488> : Pulkovo 1942 / Gauss-Kruger 28N (deprecated)
- <epsg28489> : Pulkovo 1942 / Gauss-Kruger 29N (deprecated)
- <epsg28490> : Pulkovo 1942 / Gauss-Kruger 30N (deprecated)
- <epsg28491> : Pulkovo 1942 / Gauss-Kruger 31N (deprecated)
- <epsg28492> : Pulkovo 1942 / Gauss-Kruger 32N (deprecated)
- <epsg28600> : Qatar 1974 / Qatar National Grid
- <epsg28991> : Amersfoort / RD Old
- <epsg28992> : Amersfoort / RD New
- <epsg29100> : SAD69 / Brazil Polyconic (deprecated)
- <epsg29101> : SAD69 / Brazil Polyconic
- <epsg29118> : SAD69 / UTM zone 18N (deprecated)
- <epsg29119> : SAD69 / UTM zone 19N (deprecated)
- <epsg29120> : SAD69 / UTM zone 20N (deprecated)
- <epsg29121> : SAD69 / UTM zone 21N (deprecated)
- <epsg29122> : SAD69 / UTM zone 22N (deprecated)
- <epsg29168> : SAD69 / UTM zone 18N
- <epsg29169> : SAD69 / UTM zone 19N
- <epsg29170> : SAD69 / UTM zone 20N
- <epsg29171> : SAD69 / UTM zone 21N
- <epsg29172> : SAD69 / UTM zone 22N
- <epsg29177> : SAD69 / UTM zone 17S (deprecated)
- <epsg29178> : SAD69 / UTM zone 18S (deprecated)
- <epsg29179> : SAD69 / UTM zone 19S (deprecated)
- <epsg29180> : SAD69 / UTM zone 20S (deprecated)
- <epsg29181> : SAD69 / UTM zone 21S (deprecated)
- <epsg29182> : SAD69 / UTM zone 22S (deprecated)
- <epsg29183> : SAD69 / UTM zone 23S (deprecated)
- <epsg29184> : SAD69 / UTM zone 24S (deprecated)
- <epsg29185> : SAD69 / UTM zone 25S (deprecated)
- <epsg29187> : SAD69 / UTM zone 17S
- <epsg29188> : SAD69 / UTM zone 18S
- <epsg29189> : SAD69 / UTM zone 19S
- <epsg29190> : SAD69 / UTM zone 20S
- <epsg29191> : SAD69 / UTM zone 21S
- <epsg29192> : SAD69 / UTM zone 22S
- <epsg29193> : SAD69 / UTM zone 23S
- <epsg29194> : SAD69 / UTM zone 24S
- <epsg29195> : SAD69 / UTM zone 25S
- <epsg29220> : Sapper Hill 1943 / UTM zone 20S
- <epsg29221> : Sapper Hill 1943 / UTM zone 21S
- <epsg29333> : Schwarzeck / UTM zone 33S
- <epsg29635> : Sudan / UTM zone 35N (deprecated)
- <epsg29636> : Sudan / UTM zone 36N (deprecated)
- <epsg29700> : Tananarive (Paris) / Laborde Grid (deprecated)
- <epsg29702> : Tananarive (Paris) / Laborde Grid approximation
- <epsg29738> : Tananarive / UTM zone 38S
- <epsg29739> : Tananarive / UTM zone 39S
- <epsg29849> : Timbalai 1948 / UTM zone 49N
- <epsg29850> : Timbalai 1948 / UTM zone 50N
- <epsg29871> : Timbalai 1948 / RSO Borneo (ch)
- <epsg29872> : Timbalai 1948 / RSO Borneo (ft)
- <epsg29873> : Timbalai 1948 / RSO Borneo (m)
- <epsg29900> : TM65 / Irish National Grid (deprecated)
- <epsg29901> : OSNI 1952 / Irish National Grid
- <epsg29902> : TM65 / Irish Grid
- <epsg29903> : TM75 / Irish Grid
- <epsg30161> : Tokyo / Japan Plane Rectangular CS I
- <epsg30162> : Tokyo / Japan Plane Rectangular CS II
- <epsg30163> : Tokyo / Japan Plane Rectangular CS III
- <epsg30164> : Tokyo / Japan Plane Rectangular CS IV
- <epsg30165> : Tokyo / Japan Plane Rectangular CS V
- <epsg30166> : Tokyo / Japan Plane Rectangular CS VI
- <epsg30167> : Tokyo / Japan Plane Rectangular CS VII
- <epsg30168> : Tokyo / Japan Plane Rectangular CS VIII
- <epsg30169> : Tokyo / Japan Plane Rectangular CS IX
- <epsg30170> : Tokyo / Japan Plane Rectangular CS X
- <epsg30171> : Tokyo / Japan Plane Rectangular CS XI
- <epsg30172> : Tokyo / Japan Plane Rectangular CS XII
- <epsg30173> : Tokyo / Japan Plane Rectangular CS XIII
- <epsg30174> : Tokyo / Japan Plane Rectangular CS XIV
- <epsg30175> : Tokyo / Japan Plane Rectangular CS XV
- <epsg30176> : Tokyo / Japan Plane Rectangular CS XVI
- <epsg30177> : Tokyo / Japan Plane Rectangular CS XVII
- <epsg30178> : Tokyo / Japan Plane Rectangular CS XVIII
- <epsg30179> : Tokyo / Japan Plane Rectangular CS XIX
- <epsg30200> : Trinidad 1903 / Trinidad Grid
- <epsg30339> : TC(1948) / UTM zone 39N
- <epsg30340> : TC(1948) / UTM zone 40N
- <epsg30491> : Voirol 1875 / Nord Algerie (ancienne)
- <epsg30492> : Voirol 1875 / Sud Algerie (ancienne)
- <epsg30493> : Voirol 1879 / Nord Algerie (ancienne)
- <epsg30494> : Voirol 1879 / Sud Algerie (ancienne)
- <epsg30729> : Nord Sahara 1959 / UTM zone 29N
- <epsg30730> : Nord Sahara 1959 / UTM zone 30N
- <epsg30731> : Nord Sahara 1959 / UTM zone 31N
- <epsg30732> : Nord Sahara 1959 / UTM zone 32N
- <epsg30791> : Nord Sahara 1959 / Voirol Unifie Nord
- <epsg30792> : Nord Sahara 1959 / Voirol Unifie Sud
- <epsg30800> : RT38 2.5 gon W (deprecated)
- <epsg31028> : Yoff / UTM zone 28N
- <epsg31121> : Zanderij / UTM zone 21N
- <epsg31154> : Zanderij / TM 54 NW
- <epsg31170> : Zanderij / Suriname Old TM
- <epsg31171> : Zanderij / Suriname TM
- <epsg31251> : MGI (Ferro) / Austria GK West Zone
- <epsg31252> : MGI (Ferro) / Austria GK Central Zone
- <epsg31253> : MGI (Ferro) / Austria GK East Zone
- <epsg31254> : MGI / Austria GK West
- <epsg31255> : MGI / Austria GK Central
- <epsg31256> : MGI / Austria GK East
- <epsg31257> : MGI / Austria GK M28
- <epsg31258> : MGI / Austria GK M31
- <epsg31259> : MGI / Austria GK M34
- <epsg31265> : MGI / 3-degree Gauss zone 5 (deprecated)
- <epsg31266> : MGI / 3-degree Gauss zone 6 (deprecated)
- <epsg31267> : MGI / 3-degree Gauss zone 7 (deprecated)
- <epsg31268> : MGI / 3-degree Gauss zone 8 (deprecated)
- <epsg31275> : MGI / Balkans zone 5
- <epsg31276> : MGI / Balkans zone 6
- <epsg31277> : MGI / Balkans zone 7
- <epsg31278> : MGI / Balkans zone 8 (deprecated)
- <epsg31279> : MGI / Balkans zone 8
- <epsg31281> : MGI (Ferro) / Austria West Zone
- <epsg31282> : MGI (Ferro) / Austria Central Zone
- <epsg31283> : MGI (Ferro) / Austria East Zone
- <epsg31284> : MGI / Austria M28
- <epsg31285> : MGI / Austria M31
- <epsg31286> : MGI / Austria M34
- <epsg31287> : MGI / Austria Lambert
- <epsg31288> : MGI (Ferro) / M28
- <epsg31289> : MGI (Ferro) / M31
- <epsg31290> : MGI (Ferro) / M34
- <epsg31291> : MGI (Ferro) / Austria West Zone (deprecated)
- <epsg31292> : MGI (Ferro) / Austria Central Zone (deprecated)
- <epsg31293> : MGI (Ferro) / Austria East Zone (deprecated)
- <epsg31294> : MGI / M28 (deprecated)
- <epsg31295> : MGI / M31 (deprecated)
- <epsg31296> : MGI / M34 (deprecated)
- <epsg31297> : MGI / Austria Lambert (deprecated)
- <epsg31300> : Belge 1972 / Belge Lambert 72
- <epsg31370> : Belge 1972 / Belgian Lambert 72
- <epsg31461> : DHDN / 3-degree Gauss zone 1 (deprecated)
- <epsg31462> : DHDN / 3-degree Gauss zone 2 (deprecated)
- <epsg31463> : DHDN / 3-degree Gauss zone 3 (deprecated)
- <epsg31464> : DHDN / 3-degree Gauss zone 4 (deprecated)
- <epsg31465> : DHDN / 3-degree Gauss zone 5 (deprecated)
- <epsg31466> : DHDN / Gauss-Kruger zone 2
- <epsg31467> : DHDN / Gauss-Kruger zone 3
- <epsg31468> : DHDN / Gauss-Kruger zone 4
- <epsg31469> : DHDN / Gauss-Kruger zone 5
- <epsg31528> : Conakry 1905 / UTM zone 28N
- <epsg31529> : Conakry 1905 / UTM zone 29N
- <epsg31600> : Dealul Piscului 1933/ Stereo 33
- <epsg31700> : Dealul Piscului 1970/ Stereo 70
- <epsg31838> : NGN / UTM zone 38N
- <epsg31839> : NGN / UTM zone 39N
- <epsg31900> : KUDAMS / KTM (deprecated)
- <epsg31901> : KUDAMS / KTM
- <epsg31965> : SIRGAS 2000 / UTM zone 11N
- <epsg31966> : SIRGAS 2000 / UTM zone 12N
- <epsg31967> : SIRGAS 2000 / UTM zone 13N
- <epsg31968> : SIRGAS 2000 / UTM zone 14N
- <epsg31969> : SIRGAS 2000 / UTM zone 15N
- <epsg31970> : SIRGAS 2000 / UTM zone 16N
- <epsg31971> : SIRGAS 2000 / UTM zone 17N
- <epsg31972> : SIRGAS 2000 / UTM zone 18N
- <epsg31973> : SIRGAS 2000 / UTM zone 19N
- <epsg31974> : SIRGAS 2000 / UTM zone 20N
- <epsg31975> : SIRGAS 2000 / UTM zone 21N
- <epsg31976> : SIRGAS 2000 / UTM zone 22N
- <epsg31977> : SIRGAS 2000 / UTM zone 17S
- <epsg31978> : SIRGAS 2000 / UTM zone 18S
- <epsg31979> : SIRGAS 2000 / UTM zone 19S
- <epsg31980> : SIRGAS 2000 / UTM zone 20S
- <epsg31981> : SIRGAS 2000 / UTM zone 21S
- <epsg31982> : SIRGAS 2000 / UTM zone 22S
- <epsg31983> : SIRGAS 2000 / UTM zone 23S
- <epsg31984> : SIRGAS 2000 / UTM zone 24S
- <epsg31985> : SIRGAS 2000 / UTM zone 25S
- <epsg31986> : SIRGAS / UTM zone 17N
- <epsg31987> : SIRGAS / UTM zone 18N
- <epsg31988> : SIRGAS / UTM zone 19N
- <epsg31989> : SIRGAS / UTM zone 20N
- <epsg31990> : SIRGAS / UTM zone 21N
- <epsg31991> : SIRGAS / UTM zone 22N
- <epsg31992> : SIRGAS / UTM zone 17S
- <epsg31993> : SIRGAS / UTM zone 18S
- <epsg31994> : SIRGAS / UTM zone 19S
- <epsg31995> : SIRGAS / UTM zone 20S
- <epsg31996> : SIRGAS / UTM zone 21S
- <epsg31997> : SIRGAS / UTM zone 22S
- <epsg31998> : SIRGAS / UTM zone 23S
- <epsg31999> : SIRGAS / UTM zone 24S
- <epsg32000> : SIRGAS / UTM zone 25S
- <epsg32001> : NAD27 / Montana North
- <epsg32002> : NAD27 / Montana Central
- <epsg32003> : NAD27 / Montana South
- <epsg32005> : NAD27 / Nebraska North
- <epsg32006> : NAD27 / Nebraska South
- <epsg32007> : NAD27 / Nevada East
- <epsg32008> : NAD27 / Nevada Central
- <epsg32009> : NAD27 / Nevada West
- <epsg32010> : NAD27 / New Hampshire
- <epsg32011> : NAD27 / New Jersey
- <epsg32012> : NAD27 / New Mexico East
- <epsg32013> : NAD27 / New Mexico Central
- <epsg32014> : NAD27 / New Mexico West
- <epsg32015> : NAD27 / New York East
- <epsg32016> : NAD27 / New York Central
- <epsg32017> : NAD27 / New York West
- <epsg32018> : NAD27 / New York Long Island
- <epsg32019> : NAD27 / North Carolina
- <epsg32020> : NAD27 / North Dakota North
- <epsg32021> : NAD27 / North Dakota South
- <epsg32022> : NAD27 / Ohio North
- <epsg32023> : NAD27 / Ohio South
- <epsg32024> : NAD27 / Oklahoma North
- <epsg32025> : NAD27 / Oklahoma South
- <epsg32026> : NAD27 / Oregon North
- <epsg32027> : NAD27 / Oregon South
- <epsg32028> : NAD27 / Pennsylvania North
- <epsg32029> : NAD27 / Pennsylvania South
- <epsg32030> : NAD27 / Rhode Island
- <epsg32031> : NAD27 / South Carolina North
- <epsg32033> : NAD27 / South Carolina South
- <epsg32034> : NAD27 / South Dakota North
- <epsg32035> : NAD27 / South Dakota South
- <epsg32036> : NAD27 / Tennessee (deprecated)
- <epsg32037> : NAD27 / Texas North
- <epsg32038> : NAD27 / Texas North Central
- <epsg32039> : NAD27 / Texas Central
- <epsg32040> : NAD27 / Texas South Central
- <epsg32041> : NAD27 / Texas South
- <epsg32042> : NAD27 / Utah North
- <epsg32043> : NAD27 / Utah Central
- <epsg32044> : NAD27 / Utah South
- <epsg32045> : NAD27 / Vermont
- <epsg32046> : NAD27 / Virginia North
- <epsg32047> : NAD27 / Virginia South
- <epsg32048> : NAD27 / Washington North
- <epsg32049> : NAD27 / Washington South
- <epsg32050> : NAD27 / West Virginia North
- <epsg32051> : NAD27 / West Virginia South
- <epsg32052> : NAD27 / Wisconsin North
- <epsg32053> : NAD27 / Wisconsin Central
- <epsg32054> : NAD27 / Wisconsin South
- <epsg32055> : NAD27 / Wyoming East
- <epsg32056> : NAD27 / Wyoming East Central
- <epsg32057> : NAD27 / Wyoming West Central
- <epsg32058> : NAD27 / Wyoming West
- <epsg32061> : NAD27 / Guatemala Norte
- <epsg32062> : NAD27 / Guatemala Sur
- <epsg32064> : NAD27 / BLM 14N (ftUS)
- <epsg32065> : NAD27 / BLM 15N (ftUS)
- <epsg32066> : NAD27 / BLM 16N (ftUS)
- <epsg32067> : NAD27 / BLM 17N (ftUS)
- <epsg32074> : NAD27 / BLM 14N (feet) (deprecated)
- <epsg32075> : NAD27 / BLM 15N (feet) (deprecated)
- <epsg32076> : NAD27 / BLM 16N (feet) (deprecated)
- <epsg32077> : NAD27 / BLM 17N (feet) (deprecated)
- <epsg32081> : NAD27 / MTM zone 1
- <epsg32082> : NAD27 / MTM zone 2
- <epsg32083> : NAD27 / MTM zone 3
- <epsg32084> : NAD27 / MTM zone 4
- <epsg32085> : NAD27 / MTM zone 5
- <epsg32086> : NAD27 / MTM zone 6
- <epsg32098> : NAD27 / Quebec Lambert
- <epsg32099> : NAD27 / Louisiana Offshore
- <epsg32100> : NAD83 / Montana
- <epsg32104> : NAD83 / Nebraska
- <epsg32107> : NAD83 / Nevada East
- <epsg32108> : NAD83 / Nevada Central
- <epsg32109> : NAD83 / Nevada West
- <epsg32110> : NAD83 / New Hampshire
- <epsg32111> : NAD83 / New Jersey
- <epsg32112> : NAD83 / New Mexico East
- <epsg32113> : NAD83 / New Mexico Central
- <epsg32114> : NAD83 / New Mexico West
- <epsg32115> : NAD83 / New York East
- <epsg32116> : NAD83 / New York Central
- <epsg32117> : NAD83 / New York West
- <epsg32118> : NAD83 / New York Long Island
- <epsg32119> : NAD83 / North Carolina
- <epsg32120> : NAD83 / North Dakota North
- <epsg32121> : NAD83 / North Dakota South
- <epsg32122> : NAD83 / Ohio North
- <epsg32123> : NAD83 / Ohio South
- <epsg32124> : NAD83 / Oklahoma North
- <epsg32125> : NAD83 / Oklahoma South
- <epsg32126> : NAD83 / Oregon North
- <epsg32127> : NAD83 / Oregon South
- <epsg32128> : NAD83 / Pennsylvania North
- <epsg32129> : NAD83 / Pennsylvania South
- <epsg32130> : NAD83 / Rhode Island
- <epsg32133> : NAD83 / South Carolina
- <epsg32134> : NAD83 / South Dakota North
- <epsg32135> : NAD83 / South Dakota South
- <epsg32136> : NAD83 / Tennessee
- <epsg32137> : NAD83 / Texas North
- <epsg32138> : NAD83 / Texas North Central
- <epsg32139> : NAD83 / Texas Central
- <epsg32140> : NAD83 / Texas South Central
- <epsg32141> : NAD83 / Texas South
- <epsg32142> : NAD83 / Utah North
- <epsg32143> : NAD83 / Utah Central
- <epsg32144> : NAD83 / Utah South
- <epsg32145> : NAD83 / Vermont
- <epsg32146> : NAD83 / Virginia North
- <epsg32147> : NAD83 / Virginia South
- <epsg32148> : NAD83 / Washington North
- <epsg32149> : NAD83 / Washington South
- <epsg32150> : NAD83 / West Virginia North
- <epsg32151> : NAD83 / West Virginia South
- <epsg32152> : NAD83 / Wisconsin North
- <epsg32153> : NAD83 / Wisconsin Central
- <epsg32154> : NAD83 / Wisconsin South
- <epsg32155> : NAD83 / Wyoming East
- <epsg32156> : NAD83 / Wyoming East Central
- <epsg32157> : NAD83 / Wyoming West Central
- <epsg32158> : NAD83 / Wyoming West
- <epsg32161> : NAD83 / Puerto Rico & Virgin Is.
- <epsg32164> : NAD83 / BLM 14N (ftUS)
- <epsg32165> : NAD83 / BLM 15N (ftUS)
- <epsg32166> : NAD83 / BLM 16N (ftUS)
- <epsg32167> : NAD83 / BLM 17N (ftUS)
- <epsg32180> : NAD83 / SCoPQ zone 2
- <epsg32181> : NAD83 / MTM zone 1
- <epsg32182> : NAD83 / MTM zone 2
- <epsg32183> : NAD83 / MTM zone 3
- <epsg32184> : NAD83 / MTM zone 4
- <epsg32185> : NAD83 / MTM zone 5
- <epsg32186> : NAD83 / MTM zone 6
- <epsg32187> : NAD83 / MTM zone 7
- <epsg32188> : NAD83 / MTM zone 8
- <epsg32189> : NAD83 / MTM zone 9
- <epsg32190> : NAD83 / MTM zone 10
- <epsg32191> : NAD83 / MTM zone 11
- <epsg32192> : NAD83 / MTM zone 12
- <epsg32193> : NAD83 / MTM zone 13
- <epsg32194> : NAD83 / MTM zone 14
- <epsg32195> : NAD83 / MTM zone 15
- <epsg32196> : NAD83 / MTM zone 16
- <epsg32197> : NAD83 / MTM zone 17
- <epsg32198> : NAD83 / Quebec Lambert
- <epsg32199> : NAD83 / Louisiana Offshore
- <epsg32201> : WGS 72 / UTM zone 1N
- <epsg32202> : WGS 72 / UTM zone 2N
- <epsg32203> : WGS 72 / UTM zone 3N
- <epsg32204> : WGS 72 / UTM zone 4N
- <epsg32205> : WGS 72 / UTM zone 5N
- <epsg32206> : WGS 72 / UTM zone 6N
- <epsg32207> : WGS 72 / UTM zone 7N
- <epsg32208> : WGS 72 / UTM zone 8N
- <epsg32209> : WGS 72 / UTM zone 9N
- <epsg32210> : WGS 72 / UTM zone 10N
- <epsg32211> : WGS 72 / UTM zone 11N
- <epsg32212> : WGS 72 / UTM zone 12N
- <epsg32213> : WGS 72 / UTM zone 13N
- <epsg32214> : WGS 72 / UTM zone 14N
- <epsg32215> : WGS 72 / UTM zone 15N
- <epsg32216> : WGS 72 / UTM zone 16N
- <epsg32217> : WGS 72 / UTM zone 17N
- <epsg32218> : WGS 72 / UTM zone 18N
- <epsg32219> : WGS 72 / UTM zone 19N
- <epsg32220> : WGS 72 / UTM zone 20N
- <epsg32221> : WGS 72 / UTM zone 21N
- <epsg32222> : WGS 72 / UTM zone 22N
- <epsg32223> : WGS 72 / UTM zone 23N
- <epsg32224> : WGS 72 / UTM zone 24N
- <epsg32225> : WGS 72 / UTM zone 25N
- <epsg32226> : WGS 72 / UTM zone 26N
- <epsg32227> : WGS 72 / UTM zone 27N
- <epsg32228> : WGS 72 / UTM zone 28N
- <epsg32229> : WGS 72 / UTM zone 29N
- <epsg32230> : WGS 72 / UTM zone 30N
- <epsg32231> : WGS 72 / UTM zone 31N
- <epsg32232> : WGS 72 / UTM zone 32N
- <epsg32233> : WGS 72 / UTM zone 33N
- <epsg32234> : WGS 72 / UTM zone 34N
- <epsg32235> : WGS 72 / UTM zone 35N
- <epsg32236> : WGS 72 / UTM zone 36N
- <epsg32237> : WGS 72 / UTM zone 37N
- <epsg32238> : WGS 72 / UTM zone 38N
- <epsg32239> : WGS 72 / UTM zone 39N
- <epsg32240> : WGS 72 / UTM zone 40N
- <epsg32241> : WGS 72 / UTM zone 41N
- <epsg32242> : WGS 72 / UTM zone 42N
- <epsg32243> : WGS 72 / UTM zone 43N
- <epsg32244> : WGS 72 / UTM zone 44N
- <epsg32245> : WGS 72 / UTM zone 45N
- <epsg32246> : WGS 72 / UTM zone 46N
- <epsg32247> : WGS 72 / UTM zone 47N
- <epsg32248> : WGS 72 / UTM zone 48N
- <epsg32249> : WGS 72 / UTM zone 49N
- <epsg32250> : WGS 72 / UTM zone 50N
- <epsg32251> : WGS 72 / UTM zone 51N
- <epsg32252> : WGS 72 / UTM zone 52N
- <epsg32253> : WGS 72 / UTM zone 53N
- <epsg32254> : WGS 72 / UTM zone 54N
- <epsg32255> : WGS 72 / UTM zone 55N
- <epsg32256> : WGS 72 / UTM zone 56N
- <epsg32257> : WGS 72 / UTM zone 57N
- <epsg32258> : WGS 72 / UTM zone 58N
- <epsg32259> : WGS 72 / UTM zone 59N
- <epsg32260> : WGS 72 / UTM zone 60N
- <epsg32301> : WGS 72 / UTM zone 1S
- <epsg32302> : WGS 72 / UTM zone 2S
- <epsg32303> : WGS 72 / UTM zone 3S
- <epsg32304> : WGS 72 / UTM zone 4S
- <epsg32305> : WGS 72 / UTM zone 5S
- <epsg32306> : WGS 72 / UTM zone 6S
- <epsg32307> : WGS 72 / UTM zone 7S
- <epsg32308> : WGS 72 / UTM zone 8S
- <epsg32309> : WGS 72 / UTM zone 9S
- <epsg32310> : WGS 72 / UTM zone 10S
- <epsg32311> : WGS 72 / UTM zone 11S
- <epsg32312> : WGS 72 / UTM zone 12S
- <epsg32313> : WGS 72 / UTM zone 13S
- <epsg32314> : WGS 72 / UTM zone 14S
- <epsg32315> : WGS 72 / UTM zone 15S
- <epsg32316> : WGS 72 / UTM zone 16S
- <epsg32317> : WGS 72 / UTM zone 17S
- <epsg32318> : WGS 72 / UTM zone 18S
- <epsg32319> : WGS 72 / UTM zone 19S
- <epsg32320> : WGS 72 / UTM zone 20S
- <epsg32321> : WGS 72 / UTM zone 21S
- <epsg32322> : WGS 72 / UTM zone 22S
- <epsg32323> : WGS 72 / UTM zone 23S
- <epsg32324> : WGS 72 / UTM zone 24S
- <epsg32325> : WGS 72 / UTM zone 25S
- <epsg32326> : WGS 72 / UTM zone 26S
- <epsg32327> : WGS 72 / UTM zone 27S
- <epsg32328> : WGS 72 / UTM zone 28S
- <epsg32329> : WGS 72 / UTM zone 29S
- <epsg32330> : WGS 72 / UTM zone 30S
- <epsg32331> : WGS 72 / UTM zone 31S
- <epsg32332> : WGS 72 / UTM zone 32S
- <epsg32333> : WGS 72 / UTM zone 33S
- <epsg32334> : WGS 72 / UTM zone 34S
- <epsg32335> : WGS 72 / UTM zone 35S
- <epsg32336> : WGS 72 / UTM zone 36S
- <epsg32337> : WGS 72 / UTM zone 37S
- <epsg32338> : WGS 72 / UTM zone 38S
- <epsg32339> : WGS 72 / UTM zone 39S
- <epsg32340> : WGS 72 / UTM zone 40S
- <epsg32341> : WGS 72 / UTM zone 41S
- <epsg32342> : WGS 72 / UTM zone 42S
- <epsg32343> : WGS 72 / UTM zone 43S
- <epsg32344> : WGS 72 / UTM zone 44S
- <epsg32345> : WGS 72 / UTM zone 45S
- <epsg32346> : WGS 72 / UTM zone 46S
- <epsg32347> : WGS 72 / UTM zone 47S
- <epsg32348> : WGS 72 / UTM zone 48S
- <epsg32349> : WGS 72 / UTM zone 49S
- <epsg32350> : WGS 72 / UTM zone 50S
- <epsg32351> : WGS 72 / UTM zone 51S
- <epsg32352> : WGS 72 / UTM zone 52S
- <epsg32353> : WGS 72 / UTM zone 53S
- <epsg32354> : WGS 72 / UTM zone 54S
- <epsg32355> : WGS 72 / UTM zone 55S
- <epsg32356> : WGS 72 / UTM zone 56S
- <epsg32357> : WGS 72 / UTM zone 57S
- <epsg32358> : WGS 72 / UTM zone 58S
- <epsg32359> : WGS 72 / UTM zone 59S
- <epsg32360> : WGS 72 / UTM zone 60S
- <epsg32401> : WGS 72BE / UTM zone 1N
- <epsg32402> : WGS 72BE / UTM zone 2N
- <epsg32403> : WGS 72BE / UTM zone 3N
- <epsg32404> : WGS 72BE / UTM zone 4N
- <epsg32405> : WGS 72BE / UTM zone 5N
- <epsg32406> : WGS 72BE / UTM zone 6N
- <epsg32407> : WGS 72BE / UTM zone 7N
- <epsg32408> : WGS 72BE / UTM zone 8N
- <epsg32409> : WGS 72BE / UTM zone 9N
- <epsg32410> : WGS 72BE / UTM zone 10N
- <epsg32411> : WGS 72BE / UTM zone 11N
- <epsg32412> : WGS 72BE / UTM zone 12N
- <epsg32413> : WGS 72BE / UTM zone 13N
- <epsg32414> : WGS 72BE / UTM zone 14N
- <epsg32415> : WGS 72BE / UTM zone 15N
- <epsg32416> : WGS 72BE / UTM zone 16N
- <epsg32417> : WGS 72BE / UTM zone 17N
- <epsg32418> : WGS 72BE / UTM zone 18N
- <epsg32419> : WGS 72BE / UTM zone 19N
- <epsg32420> : WGS 72BE / UTM zone 20N
- <epsg32421> : WGS 72BE / UTM zone 21N
- <epsg32422> : WGS 72BE / UTM zone 22N
- <epsg32423> : WGS 72BE / UTM zone 23N
- <epsg32424> : WGS 72BE / UTM zone 24N
- <epsg32425> : WGS 72BE / UTM zone 25N
- <epsg32426> : WGS 72BE / UTM zone 26N
- <epsg32427> : WGS 72BE / UTM zone 27N
- <epsg32428> : WGS 72BE / UTM zone 28N
- <epsg32429> : WGS 72BE / UTM zone 29N
- <epsg32430> : WGS 72BE / UTM zone 30N
- <epsg32431> : WGS 72BE / UTM zone 31N
- <epsg32432> : WGS 72BE / UTM zone 32N
- <epsg32433> : WGS 72BE / UTM zone 33N
- <epsg32434> : WGS 72BE / UTM zone 34N
- <epsg32435> : WGS 72BE / UTM zone 35N
- <epsg32436> : WGS 72BE / UTM zone 36N
- <epsg32437> : WGS 72BE / UTM zone 37N
- <epsg32438> : WGS 72BE / UTM zone 38N
- <epsg32439> : WGS 72BE / UTM zone 39N
- <epsg32440> : WGS 72BE / UTM zone 40N
- <epsg32441> : WGS 72BE / UTM zone 41N
- <epsg32442> : WGS 72BE / UTM zone 42N
- <epsg32443> : WGS 72BE / UTM zone 43N
- <epsg32444> : WGS 72BE / UTM zone 44N
- <epsg32445> : WGS 72BE / UTM zone 45N
- <epsg32446> : WGS 72BE / UTM zone 46N
- <epsg32447> : WGS 72BE / UTM zone 47N
- <epsg32448> : WGS 72BE / UTM zone 48N
- <epsg32449> : WGS 72BE / UTM zone 49N
- <epsg32450> : WGS 72BE / UTM zone 50N
- <epsg32451> : WGS 72BE / UTM zone 51N
- <epsg32452> : WGS 72BE / UTM zone 52N
- <epsg32453> : WGS 72BE / UTM zone 53N
- <epsg32454> : WGS 72BE / UTM zone 54N
- <epsg32455> : WGS 72BE / UTM zone 55N
- <epsg32456> : WGS 72BE / UTM zone 56N
- <epsg32457> : WGS 72BE / UTM zone 57N
- <epsg32458> : WGS 72BE / UTM zone 58N
- <epsg32459> : WGS 72BE / UTM zone 59N
- <epsg32460> : WGS 72BE / UTM zone 60N
- <epsg32501> : WGS 72BE / UTM zone 1S
- <epsg32502> : WGS 72BE / UTM zone 2S
- <epsg32503> : WGS 72BE / UTM zone 3S
- <epsg32504> : WGS 72BE / UTM zone 4S
- <epsg32505> : WGS 72BE / UTM zone 5S
- <epsg32506> : WGS 72BE / UTM zone 6S
- <epsg32507> : WGS 72BE / UTM zone 7S
- <epsg32508> : WGS 72BE / UTM zone 8S
- <epsg32509> : WGS 72BE / UTM zone 9S
- <epsg32510> : WGS 72BE / UTM zone 10S
- <epsg32511> : WGS 72BE / UTM zone 11S
- <epsg32512> : WGS 72BE / UTM zone 12S
- <epsg32513> : WGS 72BE / UTM zone 13S
- <epsg32514> : WGS 72BE / UTM zone 14S
- <epsg32515> : WGS 72BE / UTM zone 15S
- <epsg32516> : WGS 72BE / UTM zone 16S
- <epsg32517> : WGS 72BE / UTM zone 17S
- <epsg32518> : WGS 72BE / UTM zone 18S
- <epsg32519> : WGS 72BE / UTM zone 19S
- <epsg32520> : WGS 72BE / UTM zone 20S
- <epsg32521> : WGS 72BE / UTM zone 21S
- <epsg32522> : WGS 72BE / UTM zone 22S
- <epsg32523> : WGS 72BE / UTM zone 23S
- <epsg32524> : WGS 72BE / UTM zone 24S
- <epsg32525> : WGS 72BE / UTM zone 25S
- <epsg32526> : WGS 72BE / UTM zone 26S
- <epsg32527> : WGS 72BE / UTM zone 27S
- <epsg32528> : WGS 72BE / UTM zone 28S
- <epsg32529> : WGS 72BE / UTM zone 29S
- <epsg32530> : WGS 72BE / UTM zone 30S
- <epsg32531> : WGS 72BE / UTM zone 31S
- <epsg32532> : WGS 72BE / UTM zone 32S
- <epsg32533> : WGS 72BE / UTM zone 33S
- <epsg32534> : WGS 72BE / UTM zone 34S
- <epsg32535> : WGS 72BE / UTM zone 35S
- <epsg32536> : WGS 72BE / UTM zone 36S
- <epsg32537> : WGS 72BE / UTM zone 37S
- <epsg32538> : WGS 72BE / UTM zone 38S
- <epsg32539> : WGS 72BE / UTM zone 39S
- <epsg32540> : WGS 72BE / UTM zone 40S
- <epsg32541> : WGS 72BE / UTM zone 41S
- <epsg32542> : WGS 72BE / UTM zone 42S
- <epsg32543> : WGS 72BE / UTM zone 43S
- <epsg32544> : WGS 72BE / UTM zone 44S
- <epsg32545> : WGS 72BE / UTM zone 45S
- <epsg32546> : WGS 72BE / UTM zone 46S
- <epsg32547> : WGS 72BE / UTM zone 47S
- <epsg32548> : WGS 72BE / UTM zone 48S
- <epsg32549> : WGS 72BE / UTM zone 49S
- <epsg32550> : WGS 72BE / UTM zone 50S
- <epsg32551> : WGS 72BE / UTM zone 51S
- <epsg32552> : WGS 72BE / UTM zone 52S
- <epsg32553> : WGS 72BE / UTM zone 53S
- <epsg32554> : WGS 72BE / UTM zone 54S
- <epsg32555> : WGS 72BE / UTM zone 55S
- <epsg32556> : WGS 72BE / UTM zone 56S
- <epsg32557> : WGS 72BE / UTM zone 57S
- <epsg32558> : WGS 72BE / UTM zone 58S
- <epsg32559> : WGS 72BE / UTM zone 59S
- <epsg32560> : WGS 72BE / UTM zone 60S
- <epsg32601> : WGS 84 / UTM zone 1N
- <epsg32602> : WGS 84 / UTM zone 2N
- <epsg32603> : WGS 84 / UTM zone 3N
- <epsg32604> : WGS 84 / UTM zone 4N
- <epsg32605> : WGS 84 / UTM zone 5N
- <epsg32606> : WGS 84 / UTM zone 6N
- <epsg32607> : WGS 84 / UTM zone 7N
- <epsg32608> : WGS 84 / UTM zone 8N
- <epsg32609> : WGS 84 / UTM zone 9N
- <epsg32610> : WGS 84 / UTM zone 10N
- <epsg32611> : WGS 84 / UTM zone 11N
- <epsg32612> : WGS 84 / UTM zone 12N
- <epsg32613> : WGS 84 / UTM zone 13N
- <epsg32614> : WGS 84 / UTM zone 14N
- <epsg32615> : WGS 84 / UTM zone 15N
- <epsg32616> : WGS 84 / UTM zone 16N
- <epsg32617> : WGS 84 / UTM zone 17N
- <epsg32618> : WGS 84 / UTM zone 18N
- <epsg32619> : WGS 84 / UTM zone 19N
- <epsg32620> : WGS 84 / UTM zone 20N
- <epsg32621> : WGS 84 / UTM zone 21N
- <epsg32622> : WGS 84 / UTM zone 22N
- <epsg32623> : WGS 84 / UTM zone 23N
- <epsg32624> : WGS 84 / UTM zone 24N
- <epsg32625> : WGS 84 / UTM zone 25N
- <epsg32626> : WGS 84 / UTM zone 26N
- <epsg32627> : WGS 84 / UTM zone 27N
- <epsg32628> : WGS 84 / UTM zone 28N
- <epsg32629> : WGS 84 / UTM zone 29N
- <epsg32630> : WGS 84 / UTM zone 30N
- <epsg32631> : WGS 84 / UTM zone 31N
- <epsg32632> : WGS 84 / UTM zone 32N
- <epsg32633> : WGS 84 / UTM zone 33N
- <epsg32634> : WGS 84 / UTM zone 34N
- <epsg32635> : WGS 84 / UTM zone 35N
- <epsg32636> : WGS 84 / UTM zone 36N
- <epsg32637> : WGS 84 / UTM zone 37N
- <epsg32638> : WGS 84 / UTM zone 38N
- <epsg32639> : WGS 84 / UTM zone 39N
- <epsg32640> : WGS 84 / UTM zone 40N
- <epsg32641> : WGS 84 / UTM zone 41N
- <epsg32642> : WGS 84 / UTM zone 42N
- <epsg32643> : WGS 84 / UTM zone 43N
- <epsg32644> : WGS 84 / UTM zone 44N
- <epsg32645> : WGS 84 / UTM zone 45N
- <epsg32646> : WGS 84 / UTM zone 46N
- <epsg32647> : WGS 84 / UTM zone 47N
- <epsg32648> : WGS 84 / UTM zone 48N
- <epsg32649> : WGS 84 / UTM zone 49N
- <epsg32650> : WGS 84 / UTM zone 50N
- <epsg32651> : WGS 84 / UTM zone 51N
- <epsg32652> : WGS 84 / UTM zone 52N
- <epsg32653> : WGS 84 / UTM zone 53N
- <epsg32654> : WGS 84 / UTM zone 54N
- <epsg32655> : WGS 84 / UTM zone 55N
- <epsg32656> : WGS 84 / UTM zone 56N
- <epsg32657> : WGS 84 / UTM zone 57N
- <epsg32658> : WGS 84 / UTM zone 58N
- <epsg32659> : WGS 84 / UTM zone 59N
- <epsg32660> : WGS 84 / UTM zone 60N
- <epsg32661> : WGS 84 / UPS North
- <epsg32662> : WGS 84 / Plate Carree
- <epsg32664> : WGS 84 / BLM 14N (ftUS)
- <epsg32665> : WGS 84 / BLM 15N (ftUS)
- <epsg32666> : WGS 84 / BLM 16N (ftUS)
- <epsg32667> : WGS 84 / BLM 17N (ftUS)
- <epsg32701> : WGS 84 / UTM zone 1S
- <epsg32702> : WGS 84 / UTM zone 2S
- <epsg32703> : WGS 84 / UTM zone 3S
- <epsg32704> : WGS 84 / UTM zone 4S
- <epsg32705> : WGS 84 / UTM zone 5S
- <epsg32706> : WGS 84 / UTM zone 6S
- <epsg32707> : WGS 84 / UTM zone 7S
- <epsg32708> : WGS 84 / UTM zone 8S
- <epsg32709> : WGS 84 / UTM zone 9S
- <epsg32710> : WGS 84 / UTM zone 10S
- <epsg32711> : WGS 84 / UTM zone 11S
- <epsg32712> : WGS 84 / UTM zone 12S
- <epsg32713> : WGS 84 / UTM zone 13S
- <epsg32714> : WGS 84 / UTM zone 14S
- <epsg32715> : WGS 84 / UTM zone 15S
- <epsg32716> : WGS 84 / UTM zone 16S
- <epsg32717> : WGS 84 / UTM zone 17S
- <epsg32718> : WGS 84 / UTM zone 18S
- <epsg32719> : WGS 84 / UTM zone 19S
- <epsg32720> : WGS 84 / UTM zone 20S
- <epsg32721> : WGS 84 / UTM zone 21S
- <epsg32722> : WGS 84 / UTM zone 22S
- <epsg32723> : WGS 84 / UTM zone 23S
- <epsg32724> : WGS 84 / UTM zone 24S
- <epsg32725> : WGS 84 / UTM zone 25S
- <epsg32726> : WGS 84 / UTM zone 26S
- <epsg32727> : WGS 84 / UTM zone 27S
- <epsg32728> : WGS 84 / UTM zone 28S
- <epsg32729> : WGS 84 / UTM zone 29S
- <epsg32730> : WGS 84 / UTM zone 30S
- <epsg32731> : WGS 84 / UTM zone 31S
- <epsg32732> : WGS 84 / UTM zone 32S
- <epsg32733> : WGS 84 / UTM zone 33S
- <epsg32734> : WGS 84 / UTM zone 34S
- <epsg32735> : WGS 84 / UTM zone 35S
- <epsg32736> : WGS 84 / UTM zone 36S
- <epsg32737> : WGS 84 / UTM zone 37S
- <epsg32738> : WGS 84 / UTM zone 38S
- <epsg32739> : WGS 84 / UTM zone 39S
- <epsg32740> : WGS 84 / UTM zone 40S
- <epsg32741> : WGS 84 / UTM zone 41S
- <epsg32742> : WGS 84 / UTM zone 42S
- <epsg32743> : WGS 84 / UTM zone 43S
- <epsg32744> : WGS 84 / UTM zone 44S
- <epsg32745> : WGS 84 / UTM zone 45S
- <epsg32746> : WGS 84 / UTM zone 46S
- <epsg32747> : WGS 84 / UTM zone 47S
- <epsg32748> : WGS 84 / UTM zone 48S
- <epsg32749> : WGS 84 / UTM zone 49S
- <epsg32750> : WGS 84 / UTM zone 50S
- <epsg32751> : WGS 84 / UTM zone 51S
- <epsg32752> : WGS 84 / UTM zone 52S
- <epsg32753> : WGS 84 / UTM zone 53S
- <epsg32754> : WGS 84 / UTM zone 54S
- <epsg32755> : WGS 84 / UTM zone 55S
- <epsg32756> : WGS 84 / UTM zone 56S
- <epsg32757> : WGS 84 / UTM zone 57S
- <epsg32758> : WGS 84 / UTM zone 58S
- <epsg32759> : WGS 84 / UTM zone 59S
- <epsg32760> : WGS 84 / UTM zone 60S
- <epsg32761> : WGS 84 / UPS South
- <epsg32766> : WGS 84 / TM 36 SE
-
- \---------------------------------------------------------
- Additional EPSG-like projection definitions
- \---------------------------------------------------------
- OGC-defined extended codes  (41000--41999) see http://www.digitalearth.gov/wmt/auto.html
- \---------------------------------------------------------
- <epsg41001> : WGS84 / Simple Mercator
-
- \---------------------------------------------------------
- CubeWerx-defined extended codes  (42100--42199)
- \---------------------------------------------------------
- <epsg42101> : WGS 84 / LCC Canada
- <epsg42102> : NAD83 / BC Albers (this has been superceeded but is kept for compatibility)
- <epsg42103> : WGS 84 / LCC USA
- <epsg42103> : NAD83 / MTM zone 8 Québec
- <epsg42105> : WGS84 / Merc NorthAm
- <epsg42106> : WGS84 / Lambert Azim Mozambique
-
- \---------------------------------------------------------
- CubeWerx-customer definitions  (42300--42399)
- \---------------------------------------------------------
- <epsg42301> : NAD27 / Polar Stereographic / CM=\-98
- <epsg42302>JapanOrtho.09 09
- <epsg42303> : NAD83 / Albers NorthAm
- <epsg42304> : NAD83 / NRCan LCC Canada
- <epsg42305> : France_II
- <epsg42306> : NAD83/QC_LCC
- <epsg42307> : NAD83 / Texas Central \- feet
- <epsg42308> : NAD27 / California Albers
- <epsg42309> : NAD 83 / LCC Canada AVHRR-2
- <epsg42310> : WGS84+GRS80 / Mercator
- <epsg42311> : NAD83 / LCC Statcan
-
- \---------------------------------------------------------
- ESRI projection definitions
- \---------------------------------------------------------
- <esri2000> : Anguilla 1957 / British West Indies Grid
- <esri2001> : Antigua 1943 / British West Indies Grid
- <esri2002> : Dominica 1945 / British West Indies Grid
- <esri2003> : Grenada 1953 / British West Indies Grid
- <esri2004> : Montserrat 58 / British West Indies Grid
- <esri2005> : St Kitts 1955 / British West Indies Grid
- <esri2006> : St Lucia 1955 / British West Indies Grid
- <esri2007> : St Vincent 45 / British West Indies Grid
- <esri2008> : NAD27(CGQ77) / SCoPQ zone 2
- <esri2009> : NAD27(CGQ77) / SCoPQ zone 3
- <esri2010> : NAD27(CGQ77) / SCoPQ zone 4
- <esri2011> : NAD27(CGQ77) / SCoPQ zone 5
- <esri2012> : NAD27(CGQ77) / SCoPQ zone 6
- <esri2013> : NAD27(CGQ77) / SCoPQ zone 7
- <esri2014> : NAD27(CGQ77) / SCoPQ zone 8
- <esri2015> : NAD27(CGQ77) / SCoPQ zone 9
- <esri2016> : NAD27(CGQ77) / SCoPQ zone 10
- <esri2017> : NAD27(76) / MTM zone 8
- <esri2018> : NAD27(76) / MTM zone 9
- <esri2019> : NAD27(76) / MTM zone 10
- <esri2020> : NAD27(76) / MTM zone 11
- <esri2021> : NAD27(76) / MTM zone 12
- <esri2022> : NAD27(76) / MTM zone 13
- <esri2023> : NAD27(76) / MTM zone 14
- <esri2024> : NAD27(76) / MTM zone 15
- <esri2025> : NAD27(76) / MTM zone 16
- <esri2026> : NAD27(76) / MTM zone 17
- <esri2027> : NAD27(76) / UTM zone 15N
- <esri2028> : NAD27(76) / UTM zone 16N
- <esri2029> : NAD27(76) / UTM zone 17N
- <esri2030> : NAD27(76) / UTM zone 18N
- <esri2031> : NAD27(CGQ77) / UTM zone 17N
- <esri2032> : NAD27(CGQ77) / UTM zone 18N
- <esri2033> : NAD27(CGQ77) / UTM zone 19N
- <esri2034> : NAD27(CGQ77) / UTM zone 20N
- <esri2035> : NAD27(CGQ77) / UTM zone 21N
- <esri2036> : NAD83(CSRS98) / New Brunswick Stereo
- <esri2037> : NAD83(CSRS98) / UTM zone 19N
- <esri2038> : NAD83(CSRS98) / UTM zone 20N
- <esri2039> : Israel / Israeli TM Grid
- <esri2040> : Locodjo 1965 / UTM zone 30N
- <esri2041> : Abidjan 1987 / UTM zone 30N
- <esri2042> : Locodjo 1965 / UTM zone 29N
- <esri2043> : Abidjan 1987 / UTM zone 29N
- <esri2044> : Hanoi 1972 / Gauss-Kruger zone 18
- <esri2045> : Hanoi 1972 / Gauss-Kruger zone 19
- <esri2056> : CH1903+ / LV95
- <esri2057> : Rassadiran / Nakhl e Taqi
- <esri2058> : ED50(ED77) / UTM zone 38N
- <esri2059> : ED50(ED77) / UTM zone 39N
- <esri2060> : ED50(ED77) / UTM zone 40N
- <esri2061> : ED50(ED77) / UTM zone 41N
- <esri2062> : Madrid 1870 (Madrid) / Spain
- <esri2063> : Dabola 1981 / UTM zone 28N
- <esri2064> : Dabola 1981 / UTM zone 29N
- <esri2065> : S-JTSK (Ferro) / Krovak
- <esri2066> : Mount Dillon / Tobago Grid
- <esri2067> : Naparima 1955 / UTM zone 20N
- <esri2068> : ELD79 / Libya zone 5
- <esri2069> : ELD79 / Libya zone 6
- <esri2070> : ELD79 / Libya zone 7
- <esri2071> : ELD79 / Libya zone 8
- <esri2072> : ELD79 / Libya zone 9
- <esri2073> : ELD79 / Libya zone 10
- <esri2074> : ELD79 / Libya zone 11
- <esri2075> : ELD79 / Libya zone 12
- <esri2076> : ELD79 / Libya zone 13
- <esri2077> : ELD79 / UTM zone 32N
- <esri2078> : ELD79 / UTM zone 33N
- <esri2079> : ELD79 / UTM zone 34N
- <esri2080> : ELD79 / UTM zone 35N
- <esri2081> : Chos Malal 1914 / Argentina zone 2
- <esri2082> : Pampa del Castillo / Argentina zone 2
- <esri2083> : Hito XVIII 1963 / Argentina zone 2
- <esri2084> : Hito XVIII 1963 / UTM zone 19S
- <esri2085> : NAD27 / Cuba Norte
- <esri2086> : NAD27 / Cuba Sur
- <esri2087> : ELD79 / TM 12 NE
- <esri2088> : Carthage / TM 11 NE
- <esri2089> : Yemen NGN96 / UTM zone 38N
- <esri2090> : Yemen NGN96 / UTM zone 39N
- <esri2091> : South Yemen / Gauss Kruger zone 8
- <esri2092> : South Yemen / Gauss Kruger zone 9
- <esri2093> : Hanoi 1972 / GK 106 NE
- <esri2094> : WGS 72BE / TM 106 NE
- <esri2095> : Bissau / UTM zone 28N
- <esri2096> : Korean 1985 / Korea East Belt
- <esri2097> : Korean 1985 / Korea Central Belt
- <esri2098> : Korean 1985 / Korea West Belt
- <esri2099> : Qatar 1948 / Qatar Grid
- <esri2100> : GGRS87 / Greek Grid
- <esri2101> : Lake / Maracaibo Grid M1
- <esri2102> : Lake / Maracaibo Grid
- <esri2103> : Lake / Maracaibo Grid M3
- <esri2104> : Lake / Maracaibo La Rosa Grid
- <esri2105> : NZGD2000 / Mount Eden Circuit 2000
- <esri2106> : NZGD2000 / Bay of Plenty Circuit 2000
- <esri2107> : NZGD2000 / Poverty Bay Circuit 2000
- <esri2108> : NZGD2000 / Hawkes Bay Circuit 2000
- <esri2109> : NZGD2000 / Taranaki Circuit 2000
- <esri2110> : NZGD2000 / Tuhirangi Circuit 2000
- <esri2111> : NZGD2000 / Wanganui Circuit 2000
- <esri2112> : NZGD2000 / Wairarapa Circuit 2000
- <esri2113> : NZGD2000 / Wellington Circuit 2000
- <esri2114> : NZGD2000 / Collingwood Circuit 2000
- <esri2115> : NZGD2000 / Nelson Circuit 2000
- <esri2116> : NZGD2000 / Karamea Circuit 2000
- <esri2117> : NZGD2000 / Buller Circuit 2000
- <esri2118> : NZGD2000 / Grey Circuit 2000
- <esri2119> : NZGD2000 / Amuri Circuit 2000
- <esri2120> : NZGD2000 / Marlborough Circuit 2000
- <esri2121> : NZGD2000 / Hokitika Circuit 2000
- <esri2122> : NZGD2000 / Okarito Circuit 2000
- <esri2123> : NZGD2000 / Jacksons Bay Circuit 2000
- <esri2124> : NZGD2000 / Mount Pleasant Circuit 2000
- <esri2125> : NZGD2000 / Gawler Circuit 2000
- <esri2126> : NZGD2000 / Timaru Circuit 2000
- <esri2127> : NZGD2000 / Lindis Peak Circuit 2000
- <esri2128> : NZGD2000 / Mount Nicholas Circuit 2000
- <esri2129> : NZGD2000 / Mount York Circuit 2000
- <esri2130> : NZGD2000 / Observation Point Circuit 2000
- <esri2131> : NZGD2000 / North Taieri Circuit 2000
- <esri2132> : NZGD2000 / Bluff Circuit 2000
- <esri2133> : NZGD2000 / UTM zone 58S
- <esri2134> : NZGD2000 / UTM zone 59S
- <esri2135> : NZGD2000 / UTM zone 60S
- <esri2136> : Accra / Ghana National Grid
- <esri2137> : Accra / TM 1 NW
- <esri2138> : NAD27(CGQ77) / Quebec Lambert
- <esri2139> : NAD83(CSRS98) / SCoPQ zone 2
- <esri2140> : NAD83(CSRS98) / MTM zone 3
- <esri2141> : NAD83(CSRS98) / MTM zone 4
- <esri2142> : NAD83(CSRS98) / MTM zone 5
- <esri2143> : NAD83(CSRS98) / MTM zone 6
- <esri2144> : NAD83(CSRS98) / MTM zone 7
- <esri2145> : NAD83(CSRS98) / MTM zone 8
- <esri2146> : NAD83(CSRS98) / MTM zone 9
- <esri2147> : NAD83(CSRS98) / MTM zone 10
- <esri2148> : NAD83(CSRS98) / UTM zone 21N
- <esri2149> : NAD83(CSRS98) / UTM zone 18N
- <esri2150> : NAD83(CSRS98) / UTM zone 17N
- <esri2151> : NAD83(CSRS98) / UTM zone 13N
- <esri2152> : NAD83(CSRS98) / UTM zone 12N
- <esri2153> : NAD83(CSRS98) / UTM zone 11N
- <esri2154> : RGF93 / Lambert-93
- <esri2155> : American Samoa 1962 / American Samoa Lambert
- <esri2156> : NAD83(HARN) / UTM zone 59S
- <esri2157> : IRENET95 / Irish Transverse Mercator
- <esri2158> : IRENET95 / UTM zone 29N
- <esri2159> : Sierra Leone 1924 / New Colony Grid
- <esri2160> : Sierra Leone 1924 / New War Office Grid
- <esri2161> : Sierra Leone 1968 / UTM zone 28N
- <esri2162> : Sierra Leone 1968 / UTM zone 29N
- <esri2163> : US National Atlas Equal Area
- <esri2164> : Locodjo 1965 / TM 5 NW
- <esri2165> : Abidjan 1987 / TM 5 NW
- <esri2166> : Pulkovo 1942(83) / Gauss Kruger zone 3
- <esri2167> : Pulkovo 1942(83) / Gauss Kruger zone 4
- <esri2168> : Pulkovo 1942(83) / Gauss Kruger zone 5
- <esri2169> : Luxembourg 1930 / Gauss
- <esri2170> : MGI / Slovenia Grid
- <esri2171> : Pulkovo 1942(58) / Poland zone I
- <esri2172> : Pulkovo 1942(58) / Poland zone II
- <esri2173> : Pulkovo 1942(58) / Poland zone III
- <esri2174> : Pulkovo 1942(58) / Poland zone IV
- <esri2175> : Pulkovo 1942(58) / Poland zone V
- <esri2176> : ETRS89 / Poland CS2000 zone 5
- <esri2177> : ETRS89 / Poland CS2000 zone 6
- <esri2178> : ETRS89 / Poland CS2000 zone 7
- <esri2179> : ETRS89 / Poland CS2000 zone 8
- <esri2180> : ETRS89 / Poland CS92
- <esri2188> : Azores Occidental 1939 / UTM zone 25N
- <esri2189> : Azores Central 1948 / UTM zone 26N
- <esri2190> : Azores Oriental 1940 / UTM zone 26N
- <esri2191> : Madeira 1936 / UTM zone 28N
- <esri2192> : ED50 / France EuroLambert
- <esri2193> : NZGD2000 / New Zealand Transverse Mercator
- <esri2194> : American Samoa 1962 / American Samoa Lambert
- <esri2195> : NAD83(HARN) / UTM zone 2S
- <esri2196> : ETRS89 / Kp2000 Jutland
- <esri2197> : ETRS89 / Kp2000 Zealand
- <esri2198> : ETRS89 / Kp2000 Bornholm
- <esri2199> : Albanian 1987 / Gauss Kruger zone 4
- <esri2200> : ATS77 / New Brunswick Stereographic (ATS77)
- <esri2201> : REGVEN / UTM zone 18N
- <esri2202> : REGVEN / UTM zone 19N
- <esri2203> : REGVEN / UTM zone 20N
- <esri2204> : NAD27 / Tennessee
- <esri2205> : NAD83 / Kentucky North
- <esri2206> : ED50 / 3-degree Gauss-Kruger zone 9
- <esri2207> : ED50 / 3-degree Gauss-Kruger zone 10
- <esri2208> : ED50 / 3-degree Gauss-Kruger zone 11
- <esri2209> : ED50 / 3-degree Gauss-Kruger zone 12
- <esri2210> : ED50 / 3-degree Gauss-Kruger zone 13
- <esri2211> : ED50 / 3-degree Gauss-Kruger zone 14
- <esri2212> : ED50 / 3-degree Gauss-Kruger zone 15
- <esri2213> : ETRS89 / TM 30 NE
- <esri2214> : Douala 1948 / AOF west
- <esri2215> : Manoca 1962 / UTM zone 32N
- <esri2216> : Qornoq 1927 / UTM zone 22N
- <esri2217> : Qornoq 1927 / UTM zone 23N
- <esri2219> : ATS77 / UTM zone 19N
- <esri2220> : ATS77 / UTM zone 20N
- <esri2222> : NAD83 / Arizona East (ft)
- <esri2223> : NAD83 / Arizona Central (ft)
- <esri2224> : NAD83 / Arizona West (ft)
- <esri2225> : NAD83 / California zone 1 (ftUS)
- <esri2226> : NAD83 / California zone 2 (ftUS)
- <esri2227> : NAD83 / California zone 3 (ftUS)
- <esri2228> : NAD83 / California zone 4 (ftUS)
- <esri2229> : NAD83 / California zone 5 (ftUS)
- <esri2230> : NAD83 / California zone 6 (ftUS)
- <esri2231> : NAD83 / Colorado North (ftUS)
- <esri2232> : NAD83 / Colorado Central (ftUS)
- <esri2233> : NAD83 / Colorado South (ftUS)
- <esri2234> : NAD83 / Connecticut (ftUS)
- <esri2235> : NAD83 / Delaware (ftUS)
- <esri2236> : NAD83 / Florida East (ftUS)
- <esri2237> : NAD83 / Florida West (ftUS)
- <esri2238> : NAD83 / Florida North (ftUS)
- <esri2239> : NAD83 / Georgia East (ftUS)
- <esri2240> : NAD83 / Georgia West (ftUS)
- <esri2241> : NAD83 / Idaho East (ftUS)
- <esri2242> : NAD83 / Idaho Central (ftUS)
- <esri2243> : NAD83 / Idaho West (ftUS)
- <esri2244> : NAD83 / Indiana East (ftUS)
- <esri2245> : NAD83 / Indiana West (ftUS)
- <esri2246> : NAD83 / Kentucky North (ftUS)
- <esri2247> : NAD83 / Kentucky South (ftUS)
- <esri2248> : NAD83 / Maryland (ftUS)
- <esri2249> : NAD83 / Massachusetts Mainland (ftUS)
- <esri2250> : NAD83 / Massachusetts Island (ftUS)
- <esri2251> : NAD83 / Michigan North (ft)
- <esri2252> : NAD83 / Michigan Central (ft)
- <esri2253> : NAD83 / Michigan South (ft)
- <esri2254> : NAD83 / Mississippi East (ftUS)
- <esri2255> : NAD83 / Mississippi West (ftUS)
- <esri2256> : NAD83 / Montana (ft)
- <esri2257> : NAD83 / New Mexico East (ftUS)
- <esri2258> : NAD83 / New Mexico Central (ftUS)
- <esri2259> : NAD83 / New Mexico West (ftUS)
- <esri2260> : NAD83 / New York East (ftUS)
- <esri2261> : NAD83 / New York Central (ftUS)
- <esri2262> : NAD83 / New York West (ftUS)
- <esri2263> : NAD83 / New York Long Island (ftUS)
- <esri2264> : NAD83 / North Carolina (ftUS)
- <esri2265> : NAD83 / North Dakota North (ft)
- <esri2266> : NAD83 / North Dakota South (ft)
- <esri2267> : NAD83 / Oklahoma North (ftUS)
- <esri2268> : NAD83 / Oklahoma South (ftUS)
- <esri2269> : NAD83 / Oregon North (ft)
- <esri2270> : NAD83 / Oregon South (ft)
- <esri2271> : NAD83 / Pennsylvania North (ftUS)
- <esri2272> : NAD83 / Pennsylvania South (ftUS)
- <esri2273> : NAD83 / South Carolina (ft)
- <esri2274> : NAD83 / Tennessee (ftUS)
- <esri2275> : NAD83 / Texas North (ftUS)
- <esri2276> : NAD83 / Texas North Central (ftUS)
- <esri2277> : NAD83 / Texas Central (ftUS)
- <esri2278> : NAD83 / Texas South Central (ftUS)
- <esri2279> : NAD83 / Texas South (ftUS)
- <esri2280> : NAD83 / Utah North (ft)
- <esri2281> : NAD83 / Utah Central (ft)
- <esri2282> : NAD83 / Utah South (ft)
- <esri2283> : NAD83 / Virginia North (ftUS)
- <esri2284> : NAD83 / Virginia South (ftUS)
- <esri2285> : NAD83 / Washington North (ftUS)
- <esri2286> : NAD83 / Washington South (ftUS)
- <esri2287> : NAD83 / Wisconsin North (ftUS)
- <esri2288> : NAD83 / Wisconsin Central (ftUS)
- <esri2289> : NAD83 / Wisconsin South (ftUS)
- <esri2290> : ATS77 / Prince Edward Isl. Stereographic (ATS77)
- <esri2291> : NAD83(CSRS98) / Prince Edward Isl. Stereographic (NAD83)
- <esri2292> : NAD83(CSRS98) / Prince Edward Isl. Stereographic (NAD83)
- <esri2294> : ATS77 / MTM Nova Scotia zone 4
- <esri2295> : ATS77 / MTM Nova Scotia zone 5
- <esri2308> : Batavia / TM 109 SE
- <esri2309> : WGS 84 / TM 116 SE
- <esri2310> : WGS 84 / TM 132 SE
- <esri2311> : WGS 84 / TM 6 NE
- <esri2312> : Garoua / UTM zone 33N
- <esri2313> : Kousseri / UTM zone 33N
- <esri2314> : Trinidad 1903 / Trinidad Grid (ftCla)
- <esri2315> : Campo Inchauspe / UTM zone 19S
- <esri2316> : Campo Inchauspe / UTM zone 20S
- <esri2317> : PSAD56 / ICN Regional
- <esri2318> : Ain el Abd / Aramco Lambert
- <esri2319> : ED50 / TM27
- <esri2320> : ED50 / TM30
- <esri2321> : ED50 / TM33
- <esri2322> : ED50 / TM36
- <esri2323> : ED50 / TM39
- <esri2324> : ED50 / TM42
- <esri2325> : ED50 / TM45
- <esri2326> : Hong Kong 1980 Grid System
- <esri2327> : Xian 1980 / Gauss-Kruger zone 13
- <esri2328> : Xian 1980 / Gauss-Kruger zone 14
- <esri2329> : Xian 1980 / Gauss-Kruger zone 15
- <esri2330> : Xian 1980 / Gauss-Kruger zone 16
- <esri2331> : Xian 1980 / Gauss-Kruger zone 17
- <esri2332> : Xian 1980 / Gauss-Kruger zone 18
- <esri2333> : Xian 1980 / Gauss-Kruger zone 19
- <esri2334> : Xian 1980 / Gauss-Kruger zone 20
- <esri2335> : Xian 1980 / Gauss-Kruger zone 21
- <esri2336> : Xian 1980 / Gauss-Kruger zone 22
- <esri2337> : Xian 1980 / Gauss-Kruger zone 23
- <esri2338> : Xian 1980 / Gauss-Kruger CM 75E
- <esri2339> : Xian 1980 / Gauss-Kruger CM 81E
- <esri2340> : Xian 1980 / Gauss-Kruger CM 87E
- <esri2341> : Xian 1980 / Gauss-Kruger CM 93E
- <esri2342> : Xian 1980 / Gauss-Kruger CM 99E
- <esri2343> : Xian 1980 / Gauss-Kruger CM 105E
- <esri2344> : Xian 1980 / Gauss-Kruger CM 111E
- <esri2345> : Xian 1980 / Gauss-Kruger CM 117E
- <esri2346> : Xian 1980 / Gauss-Kruger CM 123E
- <esri2347> : Xian 1980 / Gauss-Kruger CM 129E
- <esri2348> : Xian 1980 / Gauss-Kruger CM 135E
- <esri2349> : Xian 1980 / 3-degree Gauss-Kruger zone 25
- <esri2350> : Xian 1980 / 3-degree Gauss-Kruger zone 26
- <esri2351> : Xian 1980 / 3-degree Gauss-Kruger zone 27
- <esri2352> : Xian 1980 / 3-degree Gauss-Kruger zone 28
- <esri2353> : Xian 1980 / 3-degree Gauss-Kruger zone 29
- <esri2354> : Xian 1980 / 3-degree Gauss-Kruger zone 30
- <esri2355> : Xian 1980 / 3-degree Gauss-Kruger zone 31
- <esri2356> : Xian 1980 / 3-degree Gauss-Kruger zone 32
- <esri2357> : Xian 1980 / 3-degree Gauss-Kruger zone 33
- <esri2358> : Xian 1980 / 3-degree Gauss-Kruger zone 34
- <esri2359> : Xian 1980 / 3-degree Gauss-Kruger zone 35
- <esri2360> : Xian 1980 / 3-degree Gauss-Kruger zone 36
- <esri2361> : Xian 1980 / 3-degree Gauss-Kruger zone 37
- <esri2362> : Xian 1980 / 3-degree Gauss-Kruger zone 38
- <esri2363> : Xian 1980 / 3-degree Gauss-Kruger zone 39
- <esri2364> : Xian 1980 / 3-degree Gauss-Kruger zone 40
- <esri2365> : Xian 1980 / 3-degree Gauss-Kruger zone 41
- <esri2366> : Xian 1980 / 3-degree Gauss-Kruger zone 42
- <esri2367> : Xian 1980 / 3-degree Gauss-Kruger zone 43
- <esri2368> : Xian 1980 / 3-degree Gauss-Kruger zone 44
- <esri2369> : Xian 1980 / 3-degree Gauss-Kruger zone 45
- <esri2370> : Xian 1980 / 3-degree Gauss-Kruger CM 75E
- <esri2371> : Xian 1980 / 3-degree Gauss-Kruger CM 78E
- <esri2372> : Xian 1980 / 3-degree Gauss-Kruger CM 81E
- <esri2373> : Xian 1980 / 3-degree Gauss-Kruger CM 84E
- <esri2374> : Xian 1980 / 3-degree Gauss-Kruger CM 87E
- <esri2375> : Xian 1980 / 3-degree Gauss-Kruger CM 90E
- <esri2376> : Xian 1980 / 3-degree Gauss-Kruger CM 93E
- <esri2377> : Xian 1980 / 3-degree Gauss-Kruger CM 96E
- <esri2378> : Xian 1980 / 3-degree Gauss-Kruger CM 99E
- <esri2379> : Xian 1980 / 3-degree Gauss-Kruger CM 102E
- <esri2380> : Xian 1980 / 3-degree Gauss-Kruger CM 105E
- <esri2381> : Xian 1980 / 3-degree Gauss-Kruger CM 108E
- <esri2382> : Xian 1980 / 3-degree Gauss-Kruger CM 111E
- <esri2383> : Xian 1980 / 3-degree Gauss-Kruger CM 114E
- <esri2384> : Xian 1980 / 3-degree Gauss-Kruger CM 117E
- <esri2385> : Xian 1980 / 3-degree Gauss-Kruger CM 120E
- <esri2386> : Xian 1980 / 3-degree Gauss-Kruger CM 123E
- <esri2387> : Xian 1980 / 3-degree Gauss-Kruger CM 126E
- <esri2388> : Xian 1980 / 3-degree Gauss-Kruger CM 129E
- <esri2389> : Xian 1980 / 3-degree Gauss-Kruger CM 132E
- <esri2390> : Xian 1980 / 3-degree Gauss-Kruger CM 135E
- <esri2391> : KKJ / Finland zone 1
- <esri2392> : KKJ / Finland zone 2
- <esri2393> : KKJ / Finland Uniform Coordinate System
- <esri2394> : KKJ / Finland zone 4
- <esri2395> : South Yemen / Gauss-Kruger zone 8
- <esri2396> : South Yemen / Gauss-Kruger zone 9
- <esri2397> : Pulkovo 1942(83) / Gauss-Kruger zone 3
- <esri2398> : Pulkovo 1942(83) / Gauss-Kruger zone 4
- <esri2399> : Pulkovo 1942(83) / Gauss-Kruger zone 5
- <esri2400> : RT90 2.5 gon W
- <esri2401> : Beijing 1954 / 3-degree Gauss-Kruger zone 25
- <esri2402> : Beijing 1954 / 3-degree Gauss-Kruger zone 26
- <esri2403> : Beijing 1954 / 3-degree Gauss-Kruger zone 27
- <esri2404> : Beijing 1954 / 3-degree Gauss-Kruger zone 28
- <esri2405> : Beijing 1954 / 3-degree Gauss-Kruger zone 29
- <esri2406> : Beijing 1954 / 3-degree Gauss-Kruger zone 30
- <esri2407> : Beijing 1954 / 3-degree Gauss-Kruger zone 31
- <esri2408> : Beijing 1954 / 3-degree Gauss-Kruger zone 32
- <esri2409> : Beijing 1954 / 3-degree Gauss-Kruger zone 33
- <esri2410> : Beijing 1954 / 3-degree Gauss-Kruger zone 34
- <esri2411> : Beijing 1954 / 3-degree Gauss-Kruger zone 35
- <esri2412> : Beijing 1954 / 3-degree Gauss-Kruger zone 36
- <esri2413> : Beijing 1954 / 3-degree Gauss-Kruger zone 37
- <esri2414> : Beijing 1954 / 3-degree Gauss-Kruger zone 38
- <esri2415> : Beijing 1954 / 3-degree Gauss-Kruger zone 39
- <esri2416> : Beijing 1954 / 3-degree Gauss-Kruger zone 40
- <esri2417> : Beijing 1954 / 3-degree Gauss-Kruger zone 41
- <esri2418> : Beijing 1954 / 3-degree Gauss-Kruger zone 42
- <esri2419> : Beijing 1954 / 3-degree Gauss-Kruger zone 43
- <esri2420> : Beijing 1954 / 3-degree Gauss-Kruger zone 44
- <esri2421> : Beijing 1954 / 3-degree Gauss-Kruger zone 45
- <esri2422> : Beijing 1954 / 3-degree Gauss-Kruger CM 75E
- <esri2423> : Beijing 1954 / 3-degree Gauss-Kruger CM 78E
- <esri2424> : Beijing 1954 / 3-degree Gauss-Kruger CM 81E
- <esri2425> : Beijing 1954 / 3-degree Gauss-Kruger CM 84E
- <esri2426> : Beijing 1954 / 3-degree Gauss-Kruger CM 87E
- <esri2427> : Beijing 1954 / 3-degree Gauss-Kruger CM 90E
- <esri2428> : Beijing 1954 / 3-degree Gauss-Kruger CM 93E
- <esri2429> : Beijing 1954 / 3-degree Gauss-Kruger CM 96E
- <esri2430> : Beijing 1954 / 3-degree Gauss-Kruger CM 99E
- <esri2431> : Beijing 1954 / 3-degree Gauss-Kruger CM 102E
- <esri2432> : Beijing 1954 / 3-degree Gauss-Kruger CM 105E
- <esri2433> : Beijing 1954 / 3-degree Gauss-Kruger CM 108E
- <esri2434> : Beijing 1954 / 3-degree Gauss-Kruger CM 111E
- <esri2435> : Beijing 1954 / 3-degree Gauss-Kruger CM 114E
- <esri2436> : Beijing 1954 / 3-degree Gauss-Kruger CM 117E
- <esri2437> : Beijing 1954 / 3-degree Gauss-Kruger CM 120E
- <esri2438> : Beijing 1954 / 3-degree Gauss-Kruger CM 123E
- <esri2439> : Beijing 1954 / 3-degree Gauss-Kruger CM 126E
- <esri2440> : Beijing 1954 / 3-degree Gauss-Kruger CM 129E
- <esri2441> : Beijing 1954 / 3-degree Gauss-Kruger CM 132E
- <esri2442> : Beijing 1954 / 3-degree Gauss-Kruger CM 135E
- <esri2443> : JGD2000 / Japan Plane Rectangular CS I
- <esri2444> : JGD2000 / Japan Plane Rectangular CS II
- <esri2445> : JGD2000 / Japan Plane Rectangular CS III
- <esri2446> : JGD2000 / Japan Plane Rectangular CS IV
- <esri2447> : JGD2000 / Japan Plane Rectangular CS V
- <esri2448> : JGD2000 / Japan Plane Rectangular CS VI
- <esri2449> : JGD2000 / Japan Plane Rectangular CS VII
- <esri2450> : JGD2000 / Japan Plane Rectangular CS VIII
- <esri2451> : JGD2000 / Japan Plane Rectangular CS IX
- <esri2452> : JGD2000 / Japan Plane Rectangular CS X
- <esri2453> : JGD2000 / Japan Plane Rectangular CS XI
- <esri2454> : JGD2000 / Japan Plane Rectangular CS XII
- <esri2455> : JGD2000 / Japan Plane Rectangular CS XIII
- <esri2456> : JGD2000 / Japan Plane Rectangular CS XIV
- <esri2457> : JGD2000 / Japan Plane Rectangular CS XV
- <esri2458> : JGD2000 / Japan Plane Rectangular CS XVI
- <esri2459> : JGD2000 / Japan Plane Rectangular CS XVII
- <esri2460> : JGD2000 / Japan Plane Rectangular CS XVIII
- <esri2461> : JGD2000 / Japan Plane Rectangular CS XIX
- <esri2462> : Albanian 1987 / Gauss-Kruger zone 4
- <esri2463> : Pulkovo 1995 / Gauss-Kruger CM 21E
- <esri2464> : Pulkovo 1995 / Gauss-Kruger CM 27E
- <esri2465> : Pulkovo 1995 / Gauss-Kruger CM 33E
- <esri2466> : Pulkovo 1995 / Gauss-Kruger CM 39E
- <esri2467> : Pulkovo 1995 / Gauss-Kruger CM 45E
- <esri2468> : Pulkovo 1995 / Gauss-Kruger CM 51E
- <esri2469> : Pulkovo 1995 / Gauss-Kruger CM 57E
- <esri2470> : Pulkovo 1995 / Gauss-Kruger CM 63E
- <esri2471> : Pulkovo 1995 / Gauss-Kruger CM 69E
- <esri2472> : Pulkovo 1995 / Gauss-Kruger CM 75E
- <esri2473> : Pulkovo 1995 / Gauss-Kruger CM 81E
- <esri2474> : Pulkovo 1995 / Gauss-Kruger CM 87E
- <esri2475> : Pulkovo 1995 / Gauss-Kruger CM 93E
- <esri2476> : Pulkovo 1995 / Gauss-Kruger CM 99E
- <esri2477> : Pulkovo 1995 / Gauss-Kruger CM 105E
- <esri2478> : Pulkovo 1995 / Gauss-Kruger CM 111E
- <esri2479> : Pulkovo 1995 / Gauss-Kruger CM 117E
- <esri2480> : Pulkovo 1995 / Gauss-Kruger CM 123E
- <esri2481> : Pulkovo 1995 / Gauss-Kruger CM 129E
- <esri2482> : Pulkovo 1995 / Gauss-Kruger CM 135E
- <esri2483> : Pulkovo 1995 / Gauss-Kruger CM 141E
- <esri2484> : Pulkovo 1995 / Gauss-Kruger CM 147E
- <esri2485> : Pulkovo 1995 / Gauss-Kruger CM 153E
- <esri2486> : Pulkovo 1995 / Gauss-Kruger CM 159E
- <esri2487> : Pulkovo 1995 / Gauss-Kruger CM 165E
- <esri2488> : Pulkovo 1995 / Gauss-Kruger CM 171E
- <esri2489> : Pulkovo 1995 / Gauss-Kruger CM 177E
- <esri2490> : Pulkovo 1995 / Gauss-Kruger CM 177W
- <esri2491> : Pulkovo 1995 / Gauss-Kruger CM 171W
- <esri2492> : Pulkovo 1942 / Gauss-Kruger CM 9E
- <esri2493> : Pulkovo 1942 / Gauss-Kruger CM 15E
- <esri2494> : Pulkovo 1942 / Gauss-Kruger CM 21E
- <esri2495> : Pulkovo 1942 / Gauss-Kruger CM 27E
- <esri2496> : Pulkovo 1942 / Gauss-Kruger CM 33E
- <esri2497> : Pulkovo 1942 / Gauss-Kruger CM 39E
- <esri2498> : Pulkovo 1942 / Gauss-Kruger CM 45E
- <esri2499> : Pulkovo 1942 / Gauss-Kruger CM 51E
- <esri2500> : Pulkovo 1942 / Gauss-Kruger CM 57E
- <esri2501> : Pulkovo 1942 / Gauss-Kruger CM 63E
- <esri2502> : Pulkovo 1942 / Gauss-Kruger CM 69E
- <esri2503> : Pulkovo 1942 / Gauss-Kruger CM 75E
- <esri2504> : Pulkovo 1942 / Gauss-Kruger CM 81E
- <esri2505> : Pulkovo 1942 / Gauss-Kruger CM 87E
- <esri2506> : Pulkovo 1942 / Gauss-Kruger CM 93E
- <esri2507> : Pulkovo 1942 / Gauss-Kruger CM 99E
- <esri2508> : Pulkovo 1942 / Gauss-Kruger CM 105E
- <esri2509> : Pulkovo 1942 / Gauss-Kruger CM 111E
- <esri2510> : Pulkovo 1942 / Gauss-Kruger CM 117E
- <esri2511> : Pulkovo 1942 / Gauss-Kruger CM 123E
- <esri2512> : Pulkovo 1942 / Gauss-Kruger CM 129E
- <esri2513> : Pulkovo 1942 / Gauss-Kruger CM 135E
- <esri2514> : Pulkovo 1942 / Gauss-Kruger CM 141E
- <esri2515> : Pulkovo 1942 / Gauss-Kruger CM 147E
- <esri2516> : Pulkovo 1942 / Gauss-Kruger CM 153E
- <esri2517> : Pulkovo 1942 / Gauss-Kruger CM 159E
- <esri2518> : Pulkovo 1942 / Gauss-Kruger CM 165E
- <esri2519> : Pulkovo 1942 / Gauss-Kruger CM 171E
- <esri2520> : Pulkovo 1942 / Gauss-Kruger CM 177E
- <esri2521> : Pulkovo 1942 / Gauss-Kruger CM 177W
- <esri2522> : Pulkovo 1942 / Gauss-Kruger CM 171W
- <esri2523> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 7
- <esri2524> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 8
- <esri2525> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 9
- <esri2526> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 10
- <esri2527> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 11
- <esri2528> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 12
- <esri2529> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 13
- <esri2530> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 14
- <esri2531> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 15
- <esri2532> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 16
- <esri2533> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 17
- <esri2534> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 18
- <esri2535> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 19
- <esri2536> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 20
- <esri2537> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 21
- <esri2538> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 22
- <esri2539> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 23
- <esri2540> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 24
- <esri2541> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 25
- <esri2542> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 26
- <esri2543> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 27
- <esri2544> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 28
- <esri2545> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 29
- <esri2546> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 30
- <esri2547> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 31
- <esri2548> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 32
- <esri2549> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 33
- <esri2550> : Samboja / UTM zone 50S
- <esri2551> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 34
- <esri2552> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 35
- <esri2553> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 36
- <esri2554> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 37
- <esri2555> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 38
- <esri2556> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 39
- <esri2557> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 40
- <esri2558> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 41
- <esri2559> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 42
- <esri2560> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 43
- <esri2561> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 44
- <esri2562> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 45
- <esri2563> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 46
- <esri2564> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 47
- <esri2565> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 48
- <esri2566> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 49
- <esri2567> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 50
- <esri2568> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 51
- <esri2569> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 52
- <esri2570> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 53
- <esri2571> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 54
- <esri2572> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 55
- <esri2573> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 56
- <esri2574> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 57
- <esri2575> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 58
- <esri2576> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 59
- <esri2577> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 60
- <esri2578> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 61
- <esri2579> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 62
- <esri2580> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 63
- <esri2581> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 64
- <esri2582> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 21E
- <esri2583> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 24E
- <esri2584> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 27E
- <esri2585> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 30E
- <esri2586> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 33E
- <esri2587> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 36E
- <esri2588> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 39E
- <esri2589> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 42E
- <esri2590> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 45E
- <esri2591> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 48E
- <esri2592> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 51E
- <esri2593> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 54E
- <esri2594> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 57E
- <esri2595> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 60E
- <esri2596> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 63E
- <esri2597> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 66E
- <esri2598> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 69E
- <esri2599> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 72E
- <esri2600> : Lietuvos Koordinoei Sistema 1994
- <esri2601> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 75E
- <esri2602> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 78E
- <esri2603> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 81E
- <esri2604> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 84E
- <esri2605> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 87E
- <esri2606> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 90E
- <esri2607> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 93E
- <esri2608> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 96E
- <esri2609> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 99E
- <esri2610> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 102E
- <esri2611> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 105E
- <esri2612> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 108E
- <esri2613> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 111E
- <esri2614> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 114E
- <esri2615> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 117E
- <esri2616> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 120E
- <esri2617> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 123E
- <esri2618> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 126E
- <esri2619> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 129E
- <esri2620> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 132E
- <esri2621> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 135E
- <esri2622> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 138E
- <esri2623> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 141E
- <esri2624> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 144E
- <esri2625> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 147E
- <esri2626> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 150E
- <esri2627> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 153E
- <esri2628> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 156E
- <esri2629> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 159E
- <esri2630> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 162E
- <esri2631> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 165E
- <esri2632> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 168E
- <esri2633> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 171E
- <esri2634> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 174E
- <esri2635> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 177E
- <esri2636> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 180E
- <esri2637> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 177W
- <esri2638> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 174W
- <esri2639> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 171W
- <esri2640> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 168W
- <esri2641> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 7
- <esri2642> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 8
- <esri2643> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 9
- <esri2644> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 10
- <esri2645> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 11
- <esri2646> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 12
- <esri2647> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 13
- <esri2648> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 14
- <esri2649> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 15
- <esri2650> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 16
- <esri2651> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 17
- <esri2652> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 18
- <esri2653> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 19
- <esri2654> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 20
- <esri2655> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 21
- <esri2656> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 22
- <esri2657> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 23
- <esri2658> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 24
- <esri2659> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 25
- <esri2660> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 26
- <esri2661> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 27
- <esri2662> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 28
- <esri2663> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 29
- <esri2664> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 30
- <esri2665> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 31
- <esri2666> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 32
- <esri2667> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 33
- <esri2668> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 34
- <esri2669> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 35
- <esri2670> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 36
- <esri2671> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 37
- <esri2672> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 38
- <esri2673> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 39
- <esri2674> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 40
- <esri2675> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 41
- <esri2676> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 42
- <esri2677> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 43
- <esri2678> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 44
- <esri2679> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 45
- <esri2680> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 46
- <esri2681> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 47
- <esri2682> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 48
- <esri2683> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 49
- <esri2684> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 50
- <esri2685> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 51
- <esri2686> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 52
- <esri2687> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 53
- <esri2688> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 54
- <esri2689> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 55
- <esri2690> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 56
- <esri2691> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 57
- <esri2692> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 58
- <esri2693> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 59
- <esri2694> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 60
- <esri2695> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 61
- <esri2696> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 62
- <esri2697> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 63
- <esri2698> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 64
- <esri2699> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 21E
- <esri2700> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 24E
- <esri2701> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 27E
- <esri2702> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 30E
- <esri2703> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 33E
- <esri2704> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 36E
- <esri2705> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 39E
- <esri2706> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 42E
- <esri2707> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 45E
- <esri2708> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 48E
- <esri2709> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 51E
- <esri2710> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 54E
- <esri2711> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 57E
- <esri2712> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 60E
- <esri2713> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 63E
- <esri2714> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 66E
- <esri2715> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 69E
- <esri2716> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 72E
- <esri2717> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 75E
- <esri2718> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 78E
- <esri2719> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 81E
- <esri2720> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 84E
- <esri2721> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 87E
- <esri2722> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 90E
- <esri2723> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 93E
- <esri2724> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 96E
- <esri2725> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 99E
- <esri2726> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 102E
- <esri2727> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 105E
- <esri2728> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 108E
- <esri2729> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 111E
- <esri2730> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 114E
- <esri2731> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 117E
- <esri2732> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 120E
- <esri2733> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 123E
- <esri2734> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 126E
- <esri2735> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 129E
- <esri2736> : Tete / UTM zone 36S
- <esri2737> : Tete / UTM zone 37S
- <esri2738> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 132E
- <esri2739> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 135E
- <esri2740> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 138E
- <esri2741> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 141E
- <esri2742> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 144E
- <esri2743> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 147E
- <esri2744> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 150E
- <esri2745> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 153E
- <esri2746> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 156E
- <esri2747> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 159E
- <esri2748> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 162E
- <esri2749> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 165E
- <esri2750> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 168E
- <esri2751> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 171E
- <esri2752> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 174E
- <esri2753> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 177E
- <esri2754> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 180E
- <esri2755> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 177W
- <esri2756> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 174W
- <esri2757> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 171W
- <esri2758> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 168W
- <esri2759> : NAD83(HARN) / Alabama East
- <esri2760> : NAD83(HARN) / Alabama West
- <esri2761> : NAD83(HARN) / Arizona East
- <esri2762> : NAD83(HARN) / Arizona Central
- <esri2763> : NAD83(HARN) / Arizona West
- <esri2764> : NAD83(HARN) / Arkansas North
- <esri2765> : NAD83(HARN) / Arkansas South
- <esri2766> : NAD83(HARN) / California zone 1
- <esri2767> : NAD83(HARN) / California zone 2
- <esri2768> : NAD83(HARN) / California zone 3
- <esri2769> : NAD83(HARN) / California zone 4
- <esri2770> : NAD83(HARN) / California zone 5
- <esri2771> : NAD83(HARN) / California zone 6
- <esri2772> : NAD83(HARN) / Colorado North
- <esri2773> : NAD83(HARN) / Colorado Central
- <esri2774> : NAD83(HARN) / Colorado South
- <esri2775> : NAD83(HARN) / Connecticut
- <esri2776> : NAD83(HARN) / Delaware
- <esri2777> : NAD83(HARN) / Florida East
- <esri2778> : NAD83(HARN) / Florida West
- <esri2779> : NAD83(HARN) / Florida North
- <esri2780> : NAD83(HARN) / Georgia East
- <esri2781> : NAD83(HARN) / Georgia West
- <esri2782> : NAD83(HARN) / Hawaii zone 1
- <esri2783> : NAD83(HARN) / Hawaii zone 2
- <esri2784> : NAD83(HARN) / Hawaii zone 3
- <esri2785> : NAD83(HARN) / Hawaii zone 4
- <esri2786> : NAD83(HARN) / Hawaii zone 5
- <esri2787> : NAD83(HARN) / Idaho East
- <esri2788> : NAD83(HARN) / Idaho Central
- <esri2789> : NAD83(HARN) / Idaho West
- <esri2790> : NAD83(HARN) / Illinois East
- <esri2791> : NAD83(HARN) / Illinois West
- <esri2792> : NAD83(HARN) / Indiana East
- <esri2793> : NAD83(HARN) / Indiana West
- <esri2794> : NAD83(HARN) / Iowa North
- <esri2795> : NAD83(HARN) / Iowa South
- <esri2796> : NAD83(HARN) / Kansas North
- <esri2797> : NAD83(HARN) / Kansas South
- <esri2798> : NAD83(HARN) / Kentucky North
- <esri2799> : NAD83(HARN) / Kentucky South
- <esri2800> : NAD83(HARN) / Louisiana North
- <esri2801> : NAD83(HARN) / Louisiana South
- <esri2802> : NAD83(HARN) / Maine East
- <esri2803> : NAD83(HARN) / Maine West
- <esri2804> : NAD83(HARN) / Maryland
- <esri2805> : NAD83(HARN) / Massachusetts Mainland
- <esri2806> : NAD83(HARN) / Massachusetts Island
- <esri2807> : NAD83(HARN) / Michigan North
- <esri2808> : NAD83(HARN) / Michigan Central
- <esri2809> : NAD83(HARN) / Michigan South
- <esri2810> : NAD83(HARN) / Minnesota North
- <esri2811> : NAD83(HARN) / Minnesota Central
- <esri2812> : NAD83(HARN) / Minnesota South
- <esri2813> : NAD83(HARN) / Mississippi East
- <esri2814> : NAD83(HARN) / Mississippi West
- <esri2815> : NAD83(HARN) / Missouri East
- <esri2816> : NAD83(HARN) / Missouri Central
- <esri2817> : NAD83(HARN) / Missouri West
- <esri2818> : NAD83(HARN) / Montana
- <esri2819> : NAD83(HARN) / Nebraska
- <esri2820> : NAD83(HARN) / Nevada East
- <esri2821> : NAD83(HARN) / Nevada Central
- <esri2822> : NAD83(HARN) / Nevada West
- <esri2823> : NAD83(HARN) / New Hampshire
- <esri2824> : NAD83(HARN) / New Jersey
- <esri2825> : NAD83(HARN) / New Mexico East
- <esri2826> : NAD83(HARN) / New Mexico Central
- <esri2827> : NAD83(HARN) / New Mexico West
- <esri2828> : NAD83(HARN) / New York East
- <esri2829> : NAD83(HARN) / New York Central
- <esri2830> : NAD83(HARN) / New York West
- <esri2831> : NAD83(HARN) / New York Long Island
- <esri2832> : NAD83(HARN) / North Dakota North
- <esri2833> : NAD83(HARN) / North Dakota South
- <esri2834> : NAD83(HARN) / Ohio North
- <esri2835> : NAD83(HARN) / Ohio South
- <esri2836> : NAD83(HARN) / Oklahoma North
- <esri2837> : NAD83(HARN) / Oklahoma South
- <esri2838> : NAD83(HARN) / Oregon North
- <esri2839> : NAD83(HARN) / Oregon South
- <esri2840> : NAD83(HARN) / Rhode Island
- <esri2841> : NAD83(HARN) / South Dakota North
- <esri2842> : NAD83(HARN) / South Dakota South
- <esri2843> : NAD83(HARN) / Tennessee
- <esri2844> : NAD83(HARN) / Texas North
- <esri2845> : NAD83(HARN) / Texas North Central
- <esri2846> : NAD83(HARN) / Texas Central
- <esri2847> : NAD83(HARN) / Texas South Central
- <esri2848> : NAD83(HARN) / Texas South
- <esri2849> : NAD83(HARN) / Utah North
- <esri2850> : NAD83(HARN) / Utah Central
- <esri2851> : NAD83(HARN) / Utah South
- <esri2852> : NAD83(HARN) / Vermont
- <esri2853> : NAD83(HARN) / Virginia North
- <esri2854> : NAD83(HARN) / Virginia South
- <esri2855> : NAD83(HARN) / Washington North
- <esri2856> : NAD83(HARN) / Washington South
- <esri2857> : NAD83(HARN) / West Virginia North
- <esri2858> : NAD83(HARN) / West Virginia South
- <esri2859> : NAD83(HARN) / Wisconsin North
- <esri2860> : NAD83(HARN) / Wisconsin Central
- <esri2861> : NAD83(HARN) / Wisconsin South
- <esri2862> : NAD83(HARN) / Wyoming East
- <esri2863> : NAD83(HARN) / Wyoming East Central
- <esri2864> : NAD83(HARN) / Wyoming West Central
- <esri2865> : NAD83(HARN) / Wyoming West
- <esri2866> : NAD83(HARN) / Puerto Rico & Virgin Is.
- <esri2867> : NAD83(HARN) / Arizona East (ft)
- <esri2868> : NAD83(HARN) / Arizona Central (ft)
- <esri2869> : NAD83(HARN) / Arizona West (ft)
- <esri2870> : NAD83(HARN) / California zone 1 (ftUS)
- <esri2871> : NAD83(HARN) / California zone 2 (ftUS)
- <esri2872> : NAD83(HARN) / California zone 3 (ftUS)
- <esri2873> : NAD83(HARN) / California zone 4 (ftUS)
- <esri2874> : NAD83(HARN) / California zone 5 (ftUS)
- <esri2875> : NAD83(HARN) / California zone 6 (ftUS)
- <esri2876> : NAD83(HARN) / Colorado North (ftUS)
- <esri2877> : NAD83(HARN) / Colorado Central (ftUS)
- <esri2878> : NAD83(HARN) / Colorado South (ftUS)
- <esri2879> : NAD83(HARN) / Connecticut (ftUS)
- <esri2880> : NAD83(HARN) / Delaware (ftUS)
- <esri2881> : NAD83(HARN) / Florida East (ftUS)
- <esri2882> : NAD83(HARN) / Florida West (ftUS)
- <esri2883> : NAD83(HARN) / Florida North (ftUS)
- <esri2884> : NAD83(HARN) / Georgia East (ftUS)
- <esri2885> : NAD83(HARN) / Georgia West (ftUS)
- <esri2886> : NAD83(HARN) / Idaho East (ftUS)
- <esri2887> : NAD83(HARN) / Idaho Central (ftUS)
- <esri2888> : NAD83(HARN) / Idaho West (ftUS)
- <esri2889> : NAD83(HARN) / Indiana East (ftUS)
- <esri2890> : NAD83(HARN) / Indiana West (ftUS)
- <esri2891> : NAD83(HARN) / Kentucky North (ftUS)
- <esri2892> : NAD83(HARN) / Kentucky South (ftUS)
- <esri2893> : NAD83(HARN) / Maryland (ftUS)
- <esri2894> : NAD83(HARN) / Massachusetts Mainland (ftUS)
- <esri2895> : NAD83(HARN) / Massachusetts Island (ftUS)
- <esri2896> : NAD83(HARN) / Michigan North (ft)
- <esri2897> : NAD83(HARN) / Michigan Central (ft)
- <esri2898> : NAD83(HARN) / Michigan South (ft)
- <esri2899> : NAD83(HARN) / Mississippi East (ftUS)
- <esri2900> : NAD83(HARN) / Mississippi West (ftUS)
- <esri2901> : NAD83(HARN) / Montana (ft)
- <esri2902> : NAD83(HARN) / New Mexico East (ftUS)
- <esri2903> : NAD83(HARN) / New Mexico Central (ftUS)
- <esri2904> : NAD83(HARN) / New Mexico West (ftUS)
- <esri2905> : NAD83(HARN) / New York East (ftUS)
- <esri2906> : NAD83(HARN) / New York Central (ftUS)
- <esri2907> : NAD83(HARN) / New York West (ftUS)
- <esri2908> : NAD83(HARN) / New York Long Island (ftUS)
- <esri2909> : NAD83(HARN) / North Dakota North (ft)
- <esri2910> : NAD83(HARN) / North Dakota South (ft)
- <esri2911> : NAD83(HARN) / Oklahoma North (ftUS)
- <esri2912> : NAD83(HARN) / Oklahoma South (ftUS)
- <esri2913> : NAD83(HARN) / Oregon North (ft)
- <esri2914> : NAD83(HARN) / Oregon South (ft)
- <esri2915> : NAD83(HARN) / Tennessee (ftUS)
- <esri2916> : NAD83(HARN) / Texas North (ftUS)
- <esri2917> : NAD83(HARN) / Texas North Central (ftUS)
- <esri2918> : NAD83(HARN) / Texas Central (ftUS)
- <esri2919> : NAD83(HARN) / Texas South Central (ftUS)
- <esri2920> : NAD83(HARN) / Texas South (ftUS)
- <esri2921> : NAD83(HARN) / Utah North (ft)
- <esri2922> : NAD83(HARN) / Utah Central (ft)
- <esri2923> : NAD83(HARN) / Utah South (ft)
- <esri2924> : NAD83(HARN) / Virginia North (ftUS)
- <esri2925> : NAD83(HARN) / Virginia South (ftUS)
- <esri2926> : NAD83(HARN) / Washington North (ftUS)
- <esri2927> : NAD83(HARN) / Washington South (ftUS)
- <esri2928> : NAD83(HARN) / Wisconsin North (ftUS)
- <esri2929> : NAD83(HARN) / Wisconsin Central (ftUS)
- <esri2930> : NAD83(HARN) / Wisconsin South (ftUS)
- <esri2931> : Beduaram / TM 13 NE
- <esri2932> : QND95 / Qatar National Grid
- <esri2933> : Segara / UTM zone 50S
- <esri2934> : Segara (Jakarta) / NEIEZ
- <esri2935> : Pulkovo 1942 / CS63 zone A1
- <esri2936> : Pulkovo 1942 / CS63 zone A2
- <esri2937> : Pulkovo 1942 / CS63 zone A3
- <esri2938> : Pulkovo 1942 / CS63 zone A4
- <esri2939> : Pulkovo 1942 / CS63 zone K2
- <esri2940> : Pulkovo 1942 / CS63 zone K3
- <esri2941> : Pulkovo 1942 / CS63 zone K4
- <esri2942> : Porto Santo / UTM zone 28N
- <esri2943> : Selvagem Grande / UTM zone 28N
- <esri2944> : NAD83(CSRS) / SCoPQ zone 2
- <esri2945> : NAD83(CSRS) / MTM zone 3
- <esri2946> : NAD83(CSRS) / MTM zone 4
- <esri2947> : NAD83(CSRS) / MTM zone 5
- <esri2948> : NAD83(CSRS) / MTM zone 6
- <esri2949> : NAD83(CSRS) / MTM zone 7
- <esri2950> : NAD83(CSRS) / MTM zone 8
- <esri2951> : NAD83(CSRS) / MTM zone 9
- <esri2952> : NAD83(CSRS) / MTM zone 10
- <esri2953> : NAD83(CSRS) / New Brunswick Stereo
- <esri2954> : NAD83(CSRS) / Prince Edward Isl. Stereographic (NAD83)
- <esri2955> : NAD83(CSRS) / UTM zone 11N
- <esri2956> : NAD83(CSRS) / UTM zone 12N
- <esri2957> : NAD83(CSRS) / UTM zone 13N
- <esri2958> : NAD83(CSRS) / UTM zone 17N
- <esri2959> : NAD83(CSRS) / UTM zone 18N
- <esri2960> : NAD83(CSRS) / UTM zone 19N
- <esri2961> : NAD83(CSRS) / UTM zone 20N
- <esri2962> : NAD83(CSRS) / UTM zone 21N
- <esri3036> : Moznet / UTM zone 36S
- <esri3037> : Moznet / UTM zone 37S
- <esri3148> : Indian 1960 / UTM zone 48N
- <esri3149> : Indian 1960 / UTM zone 49N
- <esri3176> : Indian 1960 / TM 106 NE
- <esri3200> : FD58 / Iraq zone
- <esri3300> : Estonian Coordinate System of 1992
- <esri3301> : Estonian Coordinate System of 1997
- <esri3439> : PSD93 / UTM zone 39N
- <esri3440> : PSD93 / UTM zone 40N
- <esri3561> : Old Hawaiian / Hawaii zone 1
- <esri3562> : Old Hawaiian / Hawaii zone 2
- <esri3563> : Old Hawaiian / Hawaii zone 3
- <esri3564> : Old Hawaiian / Hawaii zone 4
- <esri3565> : Old Hawaiian / Hawaii zone 5
- <esri3920> : Puerto Rico / UTM zone 20N
- <esri3991> : Puerto Rico State Plane CS of 1927
- <esri3992> : Puerto Rico / St. Croix
- <esri4001> : Unknown datum based upon the Airy 1830 ellipsoid
- <esri4002> : Unknown datum based upon the Airy Modified 1849 ellipsoid
- <esri4003> : Unknown datum based upon the Australian National Spheroid
- <esri4004> : Unknown datum based upon the Bessel 1841 ellipsoid
- <esri4005> : Unknown datum based upon the Bessel Modified ellipsoid
- <esri4006> : Unknown datum based upon the Bessel Namibia ellipsoid
- <esri4007> : Unknown datum based upon the Clarke 1858 ellipsoid
- <esri4008> : Unknown datum based upon the Clarke 1866 ellipsoid
- <esri4009> : Unknown datum based upon the Clarke 1866 Michigan ellipsoid
- <esri4010> : Unknown datum based upon the Clarke 1880 (Benoit) ellipsoid
- <esri4011> : Unknown datum based upon the Clarke 1880 (IGN) ellipsoid
- <esri4012> : Unknown datum based upon the Clarke 1880 (RGS) ellipsoid
- <esri4013> : Unknown datum based upon the Clarke 1880 (Arc) ellipsoid
- <esri4014> : Unknown datum based upon the Clarke 1880 (SGA 1922) ellipsoid
- <esri4015> : Unknown datum based upon the Everest 1830 (1937 Adjustment) ellipsoid
- <esri4016> : Unknown datum based upon the Everest 1830 (1967 Definition) ellipsoid
- <esri4018> : Unknown datum based upon the Everest 1830 Modified ellipsoid
- <esri4019> : Unknown datum based upon the GRS 1980 ellipsoid
- <esri4020> : Unknown datum based upon the Helmert 1906 ellipsoid
- <esri4021> : Unknown datum based upon the Indonesian National Spheroid
- <esri4022> : Unknown datum based upon the International 1924 ellipsoid
- <esri4024> : Unknown datum based upon the Krassowsky 1940 ellipsoid
- <esri4025> : Unknown datum based upon the NWL 9D ellipsoid
- <esri4027> : Unknown datum based upon the Plessis 1817 ellipsoid
- <esri4028> : Unknown datum based upon the Struve 1860 ellipsoid
- <esri4029> : Unknown datum based upon the War Office ellipsoid
- <esri4030> : Unknown datum based upon the WGS 84 ellipsoid
- <esri4031> : Unknown datum based upon the GEM 10C ellipsoid
- <esri4032> : Unknown datum based upon the OSU86F ellipsoid
- <esri4033> : Unknown datum based upon the OSU91A ellipsoid
- <esri4034> : Unknown datum based upon the Clarke 1880 ellipsoid
- <esri4035> : Unknown datum based upon the Authalic Sphere
- <esri4036> : Unknown datum based upon the GRS 1967 ellipsoid
- <esri4041> : Unknown datum based upon the Average Terrestrial System 1977 ellipsoid
- <esri4042> : Unknown datum based upon the Everest (1830 Definition) ellipsoid
- <esri4043> : Unknown datum based upon the WGS 72 ellipsoid
- <esri4044> : Unknown datum based upon the Everest 1830 (1962 Definition) ellipsoid
- <esri4045> : Unknown datum based upon the Everest 1830 (1975 Definition) ellipsoid
- <esri4047> : Unspecified based upon the GRS 1980 Authalic Sphere
- <esri4120> : Greek
- <esri4121> : GGRS87
- <esri4122> : ATS77
- <esri4123> : KKJ
- <esri4124> : RT90
- <esri4125> : Samboja
- <esri4126> : LKS94 (ETRS89)
- <esri4127> : Tete
- <esri4128> : Madzansua
- <esri4129> : Observatario
- <esri4130> : Moznet
- <esri4131> : Indian 1960
- <esri4132> : FD58
- <esri4133> : EST92
- <esri4134> : PDO Survey Datum 1993
- <esri4135> : Old Hawaiian
- <esri4136> : St. Lawrence Island
- <esri4137> : St. Paul Island
- <esri4138> : St. George Island
- <esri4139> : Puerto Rico
- <esri4140> : NAD83(CSRS98)
- <esri4141> : Israel
- <esri4142> : Locodjo 1965
- <esri4143> : Abidjan 1987
- <esri4144> : Kalianpur 1937
- <esri4145> : Kalianpur 1962
- <esri4146> : Kalianpur 1975
- <esri4147> : Hanoi 1972
- <esri4148> : Hartebeesthoek94
- <esri4149> : CH1903
- <esri4150> : CH1903+
- <esri4151> : CHTRF95
- <esri4152> : NAD83(HARN)
- <esri4153> : Rassadiran
- <esri4154> : ED50(ED77)
- <esri4155> : Dabola 1981
- <esri4156> : S-JTSK
- <esri4157> : Mount Dillon
- <esri4158> : Naparima 1955
- <esri4159> : ELD79
- <esri4160> : Chos Malal 1914
- <esri4161> : Pampa del Castillo
- <esri4162> : Korean 1985
- <esri4163> : Yemen NGN96
- <esri4164> : South Yemen
- <esri4165> : Bissau
- <esri4166> : Korean 1995
- <esri4167> : NZGD2000
- <esri4168> : Accra
- <esri4169> : American Samoa 1962
- <esri4170> : SIRGAS
- <esri4171> : RGF93
- <esri4172> : POSGAR
- <esri4173> : IRENET95
- <esri4174> : Sierra Leone 1924
- <esri4175> : Sierra Leone 1968
- <esri4176> : Australian Antarctic
- <esri4178> : Pulkovo 1942(83)
- <esri4179> : Pulkovo 1942(58)
- <esri4180> : EST97
- <esri4181> : Luxembourg 1930
- <esri4182> : Azores Occidental 1939
- <esri4183> : Azores Central 1948
- <esri4184> : Azores Oriental 1940
- <esri4185> : Madeira 1936
- <esri4188> : OSNI 1952
- <esri4189> : REGVEN
- <esri4190> : POSGAR 98
- <esri4191> : Albanian 1987
- <esri4192> : Douala 1948
- <esri4193> : Manoca 1962
- <esri4194> : Qornoq 1927
- <esri4195> : Scoresbysund 1952
- <esri4196> : Ammassalik 1958
- <esri4197> : Garoua
- <esri4198> : Kousseri
- <esri4199> : Egypt 1930
- <esri4200> : Pulkovo 1995
- <esri4201> : Adindan
- <esri4202> : AGD66
- <esri4203> : AGD84
- <esri4204> : Ain el Abd
- <esri4205> : Afgooye
- <esri4206> : Agadez
- <esri4207> : Lisbon
- <esri4208> : Aratu
- <esri4209> : Arc 1950
- <esri4210> : Arc 1960
- <esri4211> : Batavia
- <esri4212> : Barbados 1938
- <esri4213> : Beduaram
- <esri4214> : Beijing 1954
- <esri4215> : Belge 1950
- <esri4216> : Bermuda 1957
- <esri4218> : Bogota 1975
- <esri4219> : Bukit Rimpah
- <esri4220> : Camacupa
- <esri4221> : Campo Inchauspe
- <esri4222> : Cape
- <esri4223> : Carthage
- <esri4224> : Chua
- <esri4225> : Corrego Alegre
- <esri4226> : Cote d'Ivoire
- <esri4227> : Deir ez Zor
- <esri4228> : Douala
- <esri4229> : Egypt 1907
- <esri4230> : ED50
- <esri4231> : ED87
- <esri4232> : Fahud
- <esri4233> : Gandajika 1970
- <esri4234> : Garoua
- <esri4235> : Guyane Francaise
- <esri4236> : Hu Tzu Shan
- <esri4237> : HD72
- <esri4238> : ID74
- <esri4239> : Indian 1954
- <esri4240> : Indian 1975
- <esri4241> : Jamaica 1875
- <esri4242> : JAD69
- <esri4243> : Kalianpur 1880
- <esri4244> : Kandawala
- <esri4245> : Kertau
- <esri4246> : KOC
- <esri4247> : La Canoa
- <esri4248> : PSAD56
- <esri4249> : Lake
- <esri4250> : Leigon
- <esri4251> : Liberia 1964
- <esri4252> : Lome
- <esri4253> : Luzon 1911
- <esri4254> : Hito XVIII 1963
- <esri4255> : Herat North
- <esri4256> : Mahe 1971
- <esri4257> : Makassar
- <esri4258> : ETRS89
- <esri4259> : Malongo 1987
- <esri4260> : Manoca
- <esri4261> : Merchich
- <esri4262> : Massawa
- <esri4263> : Minna
- <esri4264> : Mhast
- <esri4265> : Monte Mario
- <esri4266> : M'poraloko
- <esri4267> : NAD27
- <esri4268> : NAD27 Michigan
- <esri4269> : NAD83
- <esri4270> : Nahrwan 1967
- <esri4271> : Naparima 1972
- <esri4272> : NZGD49
- <esri4273> : NGO 1948
- <esri4274> : Datum 73
- <esri4275> : NTF
- <esri4276> : NSWC 9Z-2
- <esri4277> : OSGB 1936
- <esri4278> : OSGB70
- <esri4279> : OS(SN)80
- <esri4280> : Padang
- <esri4281> : Palestine 1923
- <esri4282> : Pointe Noire
- <esri4283> : GDA94
- <esri4284> : Pulkovo 1942
- <esri4285> : Qatar 1974
- <esri4286> : Qatar 1948
- <esri4287> : Qornoq
- <esri4288> : Loma Quintana
- <esri4289> : Amersfoort
- <esri4291> : SAD69
- <esri4292> : Sapper Hill 1943
- <esri4293> : Schwarzeck
- <esri4294> : Segora
- <esri4295> : Serindung
- <esri4296> : Sudan
- <esri4297> : Tananarive
- <esri4298> : Timbalai 1948
- <esri4299> : TM65
- <esri4300> : TM75
- <esri4301> : Tokyo
- <esri4302> : Trinidad 1903
- <esri4303> : TC(1948)
- <esri4304> : Voirol 1875
- <esri4306> : Bern 1938
- <esri4307> : Nord Sahara 1959
- <esri4308> : RT38
- <esri4309> : Yacare
- <esri4310> : Yoff
- <esri4311> : Zanderij
- <esri4312> : MGI
- <esri4313> : Belge 1972
- <esri4314> : DHDN
- <esri4315> : Conakry 1905
- <esri4316> : Dealul Piscului 1933
- <esri4317> : Dealul Piscului 1970
- <esri4318> : NGN
- <esri4319> : KUDAMS
- <esri4322> : WGS 72
- <esri4324> : WGS 72BE
- <esri4326> : WGS 84
- <esri4600> : Anguilla 1957
- <esri4601> : Antigua 1943
- <esri4602> : Dominica 1945
- <esri4603> : Grenada 1953
- <esri4604> : Montserrat 1958
- <esri4605> : St. Kitts 1955
- <esri4606> : St. Lucia 1955
- <esri4607> : St. Vincent 1945
- <esri4608> : NAD27(76)
- <esri4609> : NAD27(CGQ77)
- <esri4610> : Xian 1980
- <esri4611> : Hong Kong 1980
- <esri4612> : JGD2000
- <esri4613> : Segara
- <esri4614> : QND95
- <esri4615> : Porto Santo
- <esri4616> : Selvagem Grande
- <esri4617> : NAD83(CSRS)
- <esri4801> : Bern 1898 (Bern)
- <esri4802> : Bogota 1975 (Bogota)
- <esri4803> : Lisbon (Lisbon)
- <esri4804> : Makassar (Jakarta)
- <esri4805> : MGI (Ferro)
- <esri4806> : Monte Mario (Rome)
- <esri4807> : NTF (Paris)
- <esri4808> : Padang (Jakarta)
- <esri4809> : Belge 1950 (Brussels)
- <esri4810> : Tananarive (Paris)
- <esri4811> : Voirol 1875 (Paris)
- <esri4813> : Batavia (Jakarta)
- <esri4814> : RT38 (Stockholm)
- <esri4815> : Greek (Athens)
- <esri4816> : Carthage (Paris)
- <esri4817> : NGO 1948 (Oslo)
- <esri4818> : S-JTSK (Ferro)
- <esri4819> : Nord Sahara 1959 (Paris)
- <esri4820> : Segara (Jakarta)
- <esri4901> : ATF (Paris)
- <esri4902> : NDG (Paris)
- <esri4903> : Madrid 1870 (Madrid)
- <esri4904> : Lisbon 1890 (Lisbon)
- <esri20004> : Pulkovo 1995 / Gauss-Kruger zone 4
- <esri20005> : Pulkovo 1995 / Gauss-Kruger zone 5
- <esri20006> : Pulkovo 1995 / Gauss-Kruger zone 6
- <esri20007> : Pulkovo 1995 / Gauss-Kruger zone 7
- <esri20008> : Pulkovo 1995 / Gauss-Kruger zone 8
- <esri20009> : Pulkovo 1995 / Gauss-Kruger zone 9
- <esri20010> : Pulkovo 1995 / Gauss-Kruger zone 10
- <esri20011> : Pulkovo 1995 / Gauss-Kruger zone 11
- <esri20012> : Pulkovo 1995 / Gauss-Kruger zone 12
- <esri20013> : Pulkovo 1995 / Gauss-Kruger zone 13
- <esri20014> : Pulkovo 1995 / Gauss-Kruger zone 14
- <esri20015> : Pulkovo 1995 / Gauss-Kruger zone 15
- <esri20016> : Pulkovo 1995 / Gauss-Kruger zone 16
- <esri20017> : Pulkovo 1995 / Gauss-Kruger zone 17
- <esri20018> : Pulkovo 1995 / Gauss-Kruger zone 18
- <esri20019> : Pulkovo 1995 / Gauss-Kruger zone 19
- <esri20020> : Pulkovo 1995 / Gauss-Kruger zone 20
- <esri20021> : Pulkovo 1995 / Gauss-Kruger zone 21
- <esri20022> : Pulkovo 1995 / Gauss-Kruger zone 22
- <esri20023> : Pulkovo 1995 / Gauss-Kruger zone 23
- <esri20024> : Pulkovo 1995 / Gauss-Kruger zone 24
- <esri20025> : Pulkovo 1995 / Gauss-Kruger zone 25
- <esri20026> : Pulkovo 1995 / Gauss-Kruger zone 26
- <esri20027> : Pulkovo 1995 / Gauss-Kruger zone 27
- <esri20028> : Pulkovo 1995 / Gauss-Kruger zone 28
- <esri20029> : Pulkovo 1995 / Gauss-Kruger zone 29
- <esri20030> : Pulkovo 1995 / Gauss-Kruger zone 30
- <esri20031> : Pulkovo 1995 / Gauss-Kruger zone 31
- <esri20032> : Pulkovo 1995 / Gauss-Kruger zone 32
- <esri20064> : Pulkovo 1995 / Gauss-Kruger 4N
- <esri20065> : Pulkovo 1995 / Gauss-Kruger 5N
- <esri20066> : Pulkovo 1995 / Gauss-Kruger 6N
- <esri20067> : Pulkovo 1995 / Gauss-Kruger 7N
- <esri20068> : Pulkovo 1995 / Gauss-Kruger 8N
- <esri20069> : Pulkovo 1995 / Gauss-Kruger 9N
- <esri20070> : Pulkovo 1995 / Gauss-Kruger 10N
- <esri20071> : Pulkovo 1995 / Gauss-Kruger 11N
- <esri20072> : Pulkovo 1995 / Gauss-Kruger 12N
- <esri20073> : Pulkovo 1995 / Gauss-Kruger 13N
- <esri20074> : Pulkovo 1995 / Gauss-Kruger 14N
- <esri20075> : Pulkovo 1995 / Gauss-Kruger 15N
- <esri20076> : Pulkovo 1995 / Gauss-Kruger 16N
- <esri20077> : Pulkovo 1995 / Gauss-Kruger 17N
- <esri20078> : Pulkovo 1995 / Gauss-Kruger 18N
- <esri20079> : Pulkovo 1995 / Gauss-Kruger 19N
- <esri20080> : Pulkovo 1995 / Gauss-Kruger 20N
- <esri20081> : Pulkovo 1995 / Gauss-Kruger 21N
- <esri20082> : Pulkovo 1995 / Gauss-Kruger 22N
- <esri20083> : Pulkovo 1995 / Gauss-Kruger 23N
- <esri20084> : Pulkovo 1995 / Gauss-Kruger 24N
- <esri20085> : Pulkovo 1995 / Gauss-Kruger 25N
- <esri20086> : Pulkovo 1995 / Gauss-Kruger 26N
- <esri20087> : Pulkovo 1995 / Gauss-Kruger 27N
- <esri20088> : Pulkovo 1995 / Gauss-Kruger 28N
- <esri20089> : Pulkovo 1995 / Gauss-Kruger 29N
- <esri20090> : Pulkovo 1995 / Gauss-Kruger 30N
- <esri20091> : Pulkovo 1995 / Gauss-Kruger 31N
- <esri20092> : Pulkovo 1995 / Gauss-Kruger 32N
- <esri20137> : Adindan / UTM zone 37N
- <esri20138> : Adindan / UTM zone 38N
- <esri20248> : AGD66 / AMG zone 48
- <esri20249> : AGD66 / AMG zone 49
- <esri20250> : AGD66 / AMG zone 50
- <esri20251> : AGD66 / AMG zone 51
- <esri20252> : AGD66 / AMG zone 52
- <esri20253> : AGD66 / AMG zone 53
- <esri20254> : AGD66 / AMG zone 54
- <esri20255> : AGD66 / AMG zone 55
- <esri20256> : AGD66 / AMG zone 56
- <esri20257> : AGD66 / AMG zone 57
- <esri20258> : AGD66 / AMG zone 58
- <esri20348> : AGD84 / AMG zone 48
- <esri20349> : AGD84 / AMG zone 49
- <esri20350> : AGD84 / AMG zone 50
- <esri20351> : AGD84 / AMG zone 51
- <esri20352> : AGD84 / AMG zone 52
- <esri20353> : AGD84 / AMG zone 53
- <esri20354> : AGD84 / AMG zone 54
- <esri20355> : AGD84 / AMG zone 55
- <esri20356> : AGD84 / AMG zone 56
- <esri20357> : AGD84 / AMG zone 57
- <esri20358> : AGD84 / AMG zone 58
- <esri20437> : Ain el Abd / UTM zone 37N
- <esri20438> : Ain el Abd / UTM zone 38N
- <esri20439> : Ain el Abd / UTM zone 39N
- <esri20499> : Ain el Abd / Bahrain Grid
- <esri20538> : Afgooye / UTM zone 38N
- <esri20539> : Afgooye / UTM zone 39N
- <esri20790> : Lisbon (Lisbon)/Portuguese National Grid
- <esri20791> : Lisbon (Lisbon)/Portuguese Grid
- <esri20822> : Aratu / UTM zone 22S
- <esri20823> : Aratu / UTM zone 23S
- <esri20824> : Aratu / UTM zone 24S
- <esri20934> : Arc 1950 / UTM zone 34S
- <esri20935> : Arc 1950 / UTM zone 35S
- <esri20936> : Arc 1950 / UTM zone 36S
- <esri21035> : Arc 1960 / UTM zone 35S
- <esri21036> : Arc 1960 / UTM zone 36S
- <esri21037> : Arc 1960 / UTM zone 37S
- <esri21095> : Arc 1960 / UTM zone 35N
- <esri21096> : Arc 1960 / UTM zone 36N
- <esri21097> : Arc 1960 / UTM zone 37N
- <esri21100> : Batavia (Jakarta) / NEIEZ
- <esri21148> : Batavia / UTM zone 48S
- <esri21149> : Batavia / UTM zone 49S
- <esri21150> : Batavia / UTM zone 50S
- <esri21291> : Barbados 1938 / British West Indies Grid
- <esri21292> : Barbados 1938 / Barbados National Grid
- <esri21413> : Beijing 1954 / Gauss-Kruger zone 13
- <esri21414> : Beijing 1954 / Gauss-Kruger zone 14
- <esri21415> : Beijing 1954 / Gauss-Kruger zone 15
- <esri21416> : Beijing 1954 / Gauss-Kruger zone 16
- <esri21417> : Beijing 1954 / Gauss-Kruger zone 17
- <esri21418> : Beijing 1954 / Gauss-Kruger zone 18
- <esri21419> : Beijing 1954 / Gauss-Kruger zone 19
- <esri21420> : Beijing 1954 / Gauss-Kruger zone 20
- <esri21421> : Beijing 1954 / Gauss-Kruger zone 21
- <esri21422> : Beijing 1954 / Gauss-Kruger zone 22
- <esri21423> : Beijing 1954 / Gauss-Kruger zone 23
- <esri21453> : Beijing 1954 / Gauss-Kruger CM 75E
- <esri21454> : Beijing 1954 / Gauss-Kruger CM 81E
- <esri21455> : Beijing 1954 / Gauss-Kruger CM 87E
- <esri21456> : Beijing 1954 / Gauss-Kruger CM 93E
- <esri21457> : Beijing 1954 / Gauss-Kruger CM 99E
- <esri21458> : Beijing 1954 / Gauss-Kruger CM 105E
- <esri21459> : Beijing 1954 / Gauss-Kruger CM 111E
- <esri21460> : Beijing 1954 / Gauss-Kruger CM 117E
- <esri21461> : Beijing 1954 / Gauss-Kruger CM 123E
- <esri21462> : Beijing 1954 / Gauss-Kruger CM 129E
- <esri21463> : Beijing 1954 / Gauss-Kruger CM 135E
- <esri21473> : Beijing 1954 / Gauss-Kruger 13N
- <esri21474> : Beijing 1954 / Gauss-Kruger 14N
- <esri21475> : Beijing 1954 / Gauss-Kruger 15N
- <esri21476> : Beijing 1954 / Gauss-Kruger 16N
- <esri21477> : Beijing 1954 / Gauss-Kruger 17N
- <esri21478> : Beijing 1954 / Gauss-Kruger 18N
- <esri21479> : Beijing 1954 / Gauss-Kruger 19N
- <esri21480> : Beijing 1954 / Gauss-Kruger 20N
- <esri21481> : Beijing 1954 / Gauss-Kruger 21N
- <esri21482> : Beijing 1954 / Gauss-Kruger 22N
- <esri21483> : Beijing 1954 / Gauss-Kruger 23N
- <esri21500> : Belge 1950 (Brussels) / Belge Lambert 50
- <esri21780> : Bern 1898 (Bern) / LV03C
- <esri21781> : CH1903 / LV03
- <esri21817> : Bogota 1975 / UTM zone 17N
- <esri21818> : Bogota 1975 / UTM zone 18N
- <esri21891> : Bogota 1975 / Colombia West zone
- <esri21892> : Bogota 1975 / Colombia Bogota zone
- <esri21893> : Bogota 1975 / Colombia East Central zone
- <esri21894> : Bogota 1975 / Colombia East
- <esri22032> : Camacupa / UTM zone 32S
- <esri22033> : Camacupa / UTM zone 33S
- <esri22091> : Camacupa / TM 11.30 SE
- <esri22092> : Camacupa / TM 12 SE
- <esri22191> : Campo Inchauspe / Argentina 1
- <esri22192> : Campo Inchauspe / Argentina 2
- <esri22193> : Campo Inchauspe / Argentina 3
- <esri22194> : Campo Inchauspe / Argentina 4
- <esri22195> : Campo Inchauspe / Argentina 5
- <esri22196> : Campo Inchauspe / Argentina 6
- <esri22197> : Campo Inchauspe / Argentina 7
- <esri22234> : Cape / UTM zone 34S
- <esri22235> : Cape / UTM zone 35S
- <esri22236> : Cape / UTM zone 36S
- <esri22332> : Carthage / UTM zone 32N
- <esri22391> : Carthage / Nord Tunisie
- <esri22392> : Carthage / Sud Tunisie
- <esri22523> : Corrego Alegre / UTM zone 23S
- <esri22524> : Corrego Alegre / UTM zone 24S
- <esri22700> : Deir ez Zor / Levant Zone
- <esri22770> : Deir ez Zor / Syria Lambert
- <esri22780> : Deir ez Zor / Levant Stereographic
- <esri22832> : Douala / UTM zone 32N
- <esri22991> : Egypt 1907 / Blue Belt
- <esri22992> : Egypt 1907 / Red Belt
- <esri22993> : Egypt 1907 / Purple Belt
- <esri22994> : Egypt 1907 / Extended Purple Belt
- <esri23028> : ED50 / UTM zone 28N
- <esri23029> : ED50 / UTM zone 29N
- <esri23030> : ED50 / UTM zone 30N
- <esri23031> : ED50 / UTM zone 31N
- <esri23032> : ED50 / UTM zone 32N
- <esri23033> : ED50 / UTM zone 33N
- <esri23034> : ED50 / UTM zone 34N
- <esri23035> : ED50 / UTM zone 35N
- <esri23036> : ED50 / UTM zone 36N
- <esri23037> : ED50 / UTM zone 37N
- <esri23038> : ED50 / UTM zone 38N
- <esri23090> : ED50 / TM 0 N
- <esri23095> : ED50 / TM 5 NE
- <esri23239> : Fahud / UTM zone 39N
- <esri23240> : Fahud / UTM zone 40N
- <esri23433> : Garoua / UTM zone 33N
- <esri23700> : HD72 / EOV
- <esri23846> : ID74 / UTM zone 46N
- <esri23847> : ID74 / UTM zone 47N
- <esri23848> : ID74 / UTM zone 48N
- <esri23849> : ID74 / UTM zone 49N
- <esri23850> : ID74 / UTM zone 50N
- <esri23851> : ID74 / UTM zone 51N
- <esri23852> : ID74 / UTM zone 52N
- <esri23853> : ID74 / UTM zone 53N
- <esri23886> : ID74 / UTM zone 46S
- <esri23887> : ID74 / UTM zone 47S
- <esri23888> : ID74 / UTM zone 48S
- <esri23889> : ID74 / UTM zone 49S
- <esri23890> : ID74 / UTM zone 50S
- <esri23891> : ID74 / UTM zone 51S
- <esri23892> : ID74 / UTM zone 52S
- <esri23893> : ID74 / UTM zone 53S
- <esri23894> : ID74 / UTM zone 54S
- <esri23946> : Indian 1954 / UTM zone 46N
- <esri23947> : Indian 1954 / UTM zone 47N
- <esri23948> : Indian 1954 / UTM zone 48N
- <esri24047> : Indian 1975 / UTM zone 47N
- <esri24048> : Indian 1975 / UTM zone 48N
- <esri24100> : Jamaica 1875 / Jamaica (Old Grid)
- <esri24200> : JAD69 / Jamaica National Grid
- <esri24305> : Kalianpur 1937 / UTM zone 45N
- <esri24306> : Kalianpur 1937 / UTM zone 46N
- <esri24311> : Kalianpur 1962 / UTM zone 41N
- <esri24312> : Kalianpur 1962 / UTM zone 42N
- <esri24313> : Kalianpur 1962 / UTM zone 43N
- <esri24342> : Kalianpur 1975 / UTM zone 42N
- <esri24343> : Kalianpur 1975 / UTM zone 43N
- <esri24344> : Kalianpur 1975 / UTM zone 44N
- <esri24345> : Kalianpur 1975 / UTM zone 45N
- <esri24346> : Kalianpur 1975 / UTM zone 46N
- <esri24347> : Kalianpur 1975 / UTM zone 47N
- <esri24370> : Kalianpur 1880 / India zone 0
- <esri24371> : Kalianpur 1880 / India zone I
- <esri24372> : Kalianpur 1880 / India zone IIa
- <esri24373> : Kalianpur 1880 / India zone III
- <esri24374> : Kalianpur 1880 / India zone IV
- <esri24375> : Kalianpur 1937 / India zone IIb
- <esri24376> : Kalianpur 1962 / India zone I
- <esri24377> : Kalianpur 1962 / India zone IIa
- <esri24378> : Kalianpur 1975 / India zone I
- <esri24379> : Kalianpur 1975 / India zone IIa
- <esri24380> : Kalianpur 1975 / India zone IIb
- <esri24381> : Kalianpur 1975 / India zone III
- <esri24382> : Kalianpur 1880 / India zone IIb
- <esri24383> : Kalianpur 1975 / India zone IV
- <esri24500> : Kertau / Singapore Grid
- <esri24547> : Kertau / UTM zone 47N
- <esri24548> : Kertau / UTM zone 48N
- <esri24571> : Kertau / R.S.O. Malaya (ch)
- <esri24600> : KOC Lambert
- <esri24718> : La Canoa / UTM zone 18N
- <esri24719> : La Canoa / UTM zone 19N
- <esri24720> : La Canoa / UTM zone 20N
- <esri24818> : PSAD56 / UTM zone 18N
- <esri24819> : PSAD56 / UTM zone 19N
- <esri24820> : PSAD56 / UTM zone 20N
- <esri24821> : PSAD56 / UTM zone 21N
- <esri24877> : PSAD56 / UTM zone 17S
- <esri24878> : PSAD56 / UTM zone 18S
- <esri24879> : PSAD56 / UTM zone 19S
- <esri24880> : PSAD56 / UTM zone 20S
- <esri24882> : PSAD56 / UTM zone 22S
- <esri24891> : PSAD56 / Peru west zone
- <esri24892> : PSAD56 / Peru central zone
- <esri24893> : PSAD56 / Peru east zone
- <esri25000> : Leigon / Ghana Metre Grid
- <esri25231> : Lome / UTM zone 31N
- <esri25391> : Luzon 1911 / Philippines zone I
- <esri25392> : Luzon 1911 / Philippines zone II
- <esri25393> : Luzon 1911 / Philippines zone III
- <esri25394> : Luzon 1911 / Philippines zone IV
- <esri25395> : Luzon 1911 / Philippines zone V
- <esri25700> : Makassar (Jakarta) / NEIEZ
- <esri25828> : ETRS89 / UTM zone 28N
- <esri25829> : ETRS89 / UTM zone 29N
- <esri25830> : ETRS89 / UTM zone 30N
- <esri25831> : ETRS89 / UTM zone 31N
- <esri25832> : ETRS89 / UTM zone 32N
- <esri25833> : ETRS89 / UTM zone 33N
- <esri25834> : ETRS89 / UTM zone 34N
- <esri25835> : ETRS89 / UTM zone 35N
- <esri25836> : ETRS89 / UTM zone 36N
- <esri25837> : ETRS89 / UTM zone 37N
- <esri25838> : ETRS89 / UTM zone 38N
- <esri25884> : ETRS89 / TM Baltic93
- <esri25932> : Malongo 1987 / UTM zone 32S
- <esri26191> : Merchich / Nord Maroc
- <esri26192> : Merchich / Sud Maroc
- <esri26193> : Merchich / Sahara
- <esri26237> : Massawa / UTM zone 37N
- <esri26331> : Minna / UTM zone 31N
- <esri26332> : Minna / UTM zone 32N
- <esri26391> : Minna / Nigeria West Belt
- <esri26392> : Minna / Nigeria Mid Belt
- <esri26393> : Minna / Nigeria East Belt
- <esri26432> : Mhast / UTM zone 32S
- <esri26591> : Monte Mario (Rome) / Italy zone 1
- <esri26592> : Monte Mario (Rome) / Italy zone 2
- <esri26632> : M'poraloko / UTM zone 32N
- <esri26692> : M'poraloko / UTM zone 32S
- <esri26703> : NAD27 / UTM zone 3N
- <esri26704> : NAD27 / UTM zone 4N
- <esri26705> : NAD27 / UTM zone 5N
- <esri26706> : NAD27 / UTM zone 6N
- <esri26707> : NAD27 / UTM zone 7N
- <esri26708> : NAD27 / UTM zone 8N
- <esri26709> : NAD27 / UTM zone 9N
- <esri26710> : NAD27 / UTM zone 10N
- <esri26711> : NAD27 / UTM zone 11N
- <esri26712> : NAD27 / UTM zone 12N
- <esri26713> : NAD27 / UTM zone 13N
- <esri26714> : NAD27 / UTM zone 14N
- <esri26715> : NAD27 / UTM zone 15N
- <esri26716> : NAD27 / UTM zone 16N
- <esri26717> : NAD27 / UTM zone 17N
- <esri26718> : NAD27 / UTM zone 18N
- <esri26719> : NAD27 / UTM zone 19N
- <esri26720> : NAD27 / UTM zone 20N
- <esri26721> : NAD27 / UTM zone 21N
- <esri26722> : NAD27 / UTM zone 22N
- <esri26729> : NAD27 / Alabama East
- <esri26730> : NAD27 / Alabama West
- <esri26731> : NAD27 / Alaska zone 1
- <esri26732> : NAD27 / Alaska zone 2
- <esri26733> : NAD27 / Alaska zone 3
- <esri26734> : NAD27 / Alaska zone 4
- <esri26735> : NAD27 / Alaska zone 5
- <esri26736> : NAD27 / Alaska zone 6
- <esri26737> : NAD27 / Alaska zone 7
- <esri26738> : NAD27 / Alaska zone 8
- <esri26739> : NAD27 / Alaska zone 9
- <esri26740> : NAD27 / Alaska zone 10
- <esri26741> : NAD27 / California zone I
- <esri26742> : NAD27 / California zone II
- <esri26743> : NAD27 / California zone III
- <esri26744> : NAD27 / California zone IV
- <esri26745> : NAD27 / California zone V
- <esri26746> : NAD27 / California zone VI
- <esri26747> : NAD27 / California zone VII
- <esri26748> : NAD27 / Arizona East
- <esri26749> : NAD27 / Arizona Central
- <esri26750> : NAD27 / Arizona West
- <esri26751> : NAD27 / Arkansas North
- <esri26752> : NAD27 / Arkansas South
- <esri26753> : NAD27 / Colorado North
- <esri26754> : NAD27 / Colorado Central
- <esri26755> : NAD27 / Colorado South
- <esri26756> : NAD27 / Connecticut
- <esri26757> : NAD27 / Delaware
- <esri26758> : NAD27 / Florida East
- <esri26759> : NAD27 / Florida West
- <esri26760> : NAD27 / Florida North
- <esri26766> : NAD27 / Georgia East
- <esri26767> : NAD27 / Georgia West
- <esri26768> : NAD27 / Idaho East
- <esri26769> : NAD27 / Idaho Central
- <esri26770> : NAD27 / Idaho West
- <esri26771> : NAD27 / Illinois East
- <esri26772> : NAD27 / Illinois West
- <esri26773> : NAD27 / Indiana East
- <esri26774> : NAD27 / Indiana West
- <esri26775> : NAD27 / Iowa North
- <esri26776> : NAD27 / Iowa South
- <esri26777> : NAD27 / Kansas North
- <esri26778> : NAD27 / Kansas South
- <esri26779> : NAD27 / Kentucky North
- <esri26780> : NAD27 / Kentucky South
- <esri26781> : NAD27 / Louisiana North
- <esri26782> : NAD27 / Louisiana South
- <esri26783> : NAD27 / Maine East
- <esri26784> : NAD27 / Maine West
- <esri26785> : NAD27 / Maryland
- <esri26786> : NAD27 / Massachusetts Mainland
- <esri26787> : NAD27 / Massachusetts Island
- <esri26791> : NAD27 / Minnesota North
- <esri26792> : NAD27 / Minnesota Central
- <esri26793> : NAD27 / Minnesota South
- <esri26794> : NAD27 / Mississippi East
- <esri26795> : NAD27 / Mississippi West
- <esri26796> : NAD27 / Missouri East
- <esri26797> : NAD27 / Missouri Central
- <esri26798> : NAD27 / Missouri West
- <esri26801> : NAD Michigan / Michigan East
- <esri26802> : NAD Michigan / Michigan Old Central
- <esri26803> : NAD Michigan / Michigan West
- <esri26811> : NAD Michigan / Michigan North
- <esri26812> : NAD Michigan / Michigan Central
- <esri26813> : NAD Michigan / Michigan South
- <esri26903> : NAD83 / UTM zone 3N
- <esri26904> : NAD83 / UTM zone 4N
- <esri26905> : NAD83 / UTM zone 5N
- <esri26906> : NAD83 / UTM zone 6N
- <esri26907> : NAD83 / UTM zone 7N
- <esri26908> : NAD83 / UTM zone 8N
- <esri26909> : NAD83 / UTM zone 9N
- <esri26910> : NAD83 / UTM zone 10N
- <esri26911> : NAD83 / UTM zone 11N
- <esri26912> : NAD83 / UTM zone 12N
- <esri26913> : NAD83 / UTM zone 13N
- <esri26914> : NAD83 / UTM zone 14N
- <esri26915> : NAD83 / UTM zone 15N
- <esri26916> : NAD83 / UTM zone 16N
- <esri26917> : NAD83 / UTM zone 17N
- <esri26918> : NAD83 / UTM zone 18N
- <esri26919> : NAD83 / UTM zone 19N
- <esri26920> : NAD83 / UTM zone 20N
- <esri26921> : NAD83 / UTM zone 21N
- <esri26922> : NAD83 / UTM zone 22N
- <esri26923> : NAD83 / UTM zone 23N
- <esri26929> : NAD83 / Alabama East
- <esri26930> : NAD83 / Alabama West
- <esri26931> : NAD83 / Alaska zone 1
- <esri26932> : NAD83 / Alaska zone 2
- <esri26933> : NAD83 / Alaska zone 3
- <esri26934> : NAD83 / Alaska zone 4
- <esri26935> : NAD83 / Alaska zone 5
- <esri26936> : NAD83 / Alaska zone 6
- <esri26937> : NAD83 / Alaska zone 7
- <esri26938> : NAD83 / Alaska zone 8
- <esri26939> : NAD83 / Alaska zone 9
- <esri26940> : NAD83 / Alaska zone 10
- <esri26941> : NAD83 / California zone 1
- <esri26942> : NAD83 / California zone 2
- <esri26943> : NAD83 / California zone 3
- <esri26944> : NAD83 / California zone 4
- <esri26945> : NAD83 / California zone 5
- <esri26946> : NAD83 / California zone 6
- <esri26948> : NAD83 / Arizona East
- <esri26949> : NAD83 / Arizona Central
- <esri26950> : NAD83 / Arizona West
- <esri26951> : NAD83 / Arkansas North
- <esri26952> : NAD83 / Arkansas South
- <esri26953> : NAD83 / Colorado North
- <esri26954> : NAD83 / Colorado Central
- <esri26955> : NAD83 / Colorado South
- <esri26956> : NAD83 / Connecticut
- <esri26957> : NAD83 / Delaware
- <esri26958> : NAD83 / Florida East
- <esri26959> : NAD83 / Florida West
- <esri26960> : NAD83 / Florida North
- <esri26961> : NAD83 / Hawaii zone 1
- <esri26962> : NAD83 / Hawaii zone 2
- <esri26963> : NAD83 / Hawaii zone 3
- <esri26964> : NAD83 / Hawaii zone 4
- <esri26965> : NAD83 / Hawaii zone 5
- <esri26966> : NAD83 / Georgia East
- <esri26967> : NAD83 / Georgia West
- <esri26968> : NAD83 / Idaho East
- <esri26969> : NAD83 / Idaho Central
- <esri26970> : NAD83 / Idaho West
- <esri26971> : NAD83 / Illinois East
- <esri26972> : NAD83 / Illinois West
- <esri26973> : NAD83 / Indiana East
- <esri26974> : NAD83 / Indiana West
- <esri26975> : NAD83 / Iowa North
- <esri26976> : NAD83 / Iowa South
- <esri26977> : NAD83 / Kansas North
- <esri26978> : NAD83 / Kansas South
- <esri26979> : NAD83 / Kentucky North
- <esri26980> : NAD83 / Kentucky South
- <esri26981> : NAD83 / Louisiana North
- <esri26982> : NAD83 / Louisiana South
- <esri26983> : NAD83 / Maine East
- <esri26984> : NAD83 / Maine West
- <esri26985> : NAD83 / Maryland
- <esri26986> : NAD83 / Massachusetts Mainland
- <esri26987> : NAD83 / Massachusetts Island
- <esri26988> : NAD83 / Michigan North
- <esri26989> : NAD83 / Michigan Central
- <esri26990> : NAD83 / Michigan South
- <esri26991> : NAD83 / Minnesota North
- <esri26992> : NAD83 / Minnesota Central
- <esri26993> : NAD83 / Minnesota South
- <esri26994> : NAD83 / Mississippi East
- <esri26995> : NAD83 / Mississippi West
- <esri26996> : NAD83 / Missouri East
- <esri26997> : NAD83 / Missouri Central
- <esri26998> : NAD83 / Missouri West
- <esri27038> : Nahrwan 1967 / UTM zone 38N
- <esri27039> : Nahrwan 1967 / UTM zone 39N
- <esri27040> : Nahrwan 1967 / UTM zone 40N
- <esri27120> : Naparima 1972 / UTM zone 20N
- <esri27200> : NZGD49 / New Zealand Map Grid
- <esri27205> : NZGD49 / Mount Eden Circuit
- <esri27206> : NZGD49 / Bay of Plenty Circuit
- <esri27207> : NZGD49 / Poverty Bay Circuit
- <esri27208> : NZGD49 / Hawkes Bay Circuit
- <esri27209> : NZGD49 / Taranaki Circuit
- <esri27210> : NZGD49 / Tuhirangi Circuit
- <esri27211> : NZGD49 / Wanganui Circuit
- <esri27212> : NZGD49 / Wairarapa Circuit
- <esri27213> : NZGD49 / Wellington Circuit
- <esri27214> : NZGD49 / Collingwood Circuit
- <esri27215> : NZGD49 / Nelson Circuit
- <esri27216> : NZGD49 / Karamea Circuit
- <esri27217> : NZGD49 / Buller Circuit
- <esri27218> : NZGD49 / Grey Circuit
- <esri27219> : NZGD49 / Amuri Circuit
- <esri27220> : NZGD49 / Marlborough Circuit
- <esri27221> : NZGD49 / Hokitika Circuit
- <esri27222> : NZGD49 / Okarito Circuit
- <esri27223> : NZGD49 / Jacksons Bay Circuit
- <esri27224> : NZGD49 / Mount Pleasant Circuit
- <esri27225> : NZGD49 / Gawler Circuit
- <esri27226> : NZGD49 / Timaru Circuit
- <esri27227> : NZGD49 / Lindis Peak Circuit
- <esri27228> : NZGD49 / Mount Nicholas Circuit
- <esri27229> : NZGD49 / Mount York Circuit
- <esri27230> : NZGD49 / Observation Point Circuit
- <esri27231> : NZGD49 / North Taieri Circuit
- <esri27232> : NZGD49 / Bluff Circuit
- <esri27258> : NZGD49 / UTM zone 58S
- <esri27259> : NZGD49 / UTM zone 59S
- <esri27260> : NZGD49 / UTM zone 60S
- <esri27291> : NZGD49 / North Island Grid
- <esri27292> : NZGD49 / South Island Grid
- <esri27391> : NGO 1948 (Oslo) / NGO zone I
- <esri27392> : NGO 1948 (Oslo) / NGO zone II
- <esri27393> : NGO 1948 (Oslo) / NGO zone III
- <esri27394> : NGO 1948 (Oslo) / NGO zone IV
- <esri27395> : NGO 1948 (Oslo) / NGO zone V
- <esri27396> : NGO 1948 (Oslo) / NGO zone VI
- <esri27397> : NGO 1948 (Oslo) / NGO zone VII
- <esri27398> : NGO 1948 (Oslo) / NGO zone VIII
- <esri27429> : Datum 73 / UTM zone 29N
- <esri27492> : Datum 73 / Modified Portuguese Grid
- <esri27500> : ATF (Paris) / Nord de Guerre
- <esri27561> : NTF (Paris) / Lambert Nord France
- <esri27562> : NTF (Paris) / Lambert Centre France
- <esri27563> : NTF (Paris) / Lambert Sud France
- <esri27564> : NTF (Paris) / Lambert Corse
- <esri27571> : NTF (Paris) / Lambert zone I
- <esri27572> : NTF (Paris) / Lambert zone II
- <esri27573> : NTF (Paris) / Lambert zone III
- <esri27574> : NTF (Paris) / Lambert zone IV
- <esri27581> : NTF (Paris) / France I
- <esri27582> : NTF (Paris) / France II
- <esri27583> : NTF (Paris) / France III
- <esri27584> : NTF (Paris) / France IV
- <esri27591> : NTF (Paris) / Nord France
- <esri27592> : NTF (Paris) / Centre France
- <esri27593> : NTF (Paris) / Sud France
- <esri27594> : NTF (Paris) / Corse
- <esri27700> : OSGB 1936 / British National Grid
- <esri28191> : Palestine 1923 / Palestine Grid
- <esri28192> : Palestine 1923 / Palestine Belt
- <esri28193> : Palestine 1923 / Israeli CS Grid
- <esri28232> : Pointe Noire / UTM zone 32S
- <esri28348> : GDA94 / MGA zone 48
- <esri28349> : GDA94 / MGA zone 49
- <esri28350> : GDA94 / MGA zone 50
- <esri28351> : GDA94 / MGA zone 51
- <esri28352> : GDA94 / MGA zone 52
- <esri28353> : GDA94 / MGA zone 53
- <esri28354> : GDA94 / MGA zone 54
- <esri28355> : GDA94 / MGA zone 55
- <esri28356> : GDA94 / MGA zone 56
- <esri28357> : GDA94 / MGA zone 57
- <esri28358> : GDA94 / MGA zone 58
- <esri28402> : Pulkovo 1942 / Gauss-Kruger zone 2
- <esri28403> : Pulkovo 1942 / Gauss-Kruger zone 3
- <esri28404> : Pulkovo 1942 / Gauss-Kruger zone 4
- <esri28405> : Pulkovo 1942 / Gauss-Kruger zone 5
- <esri28406> : Pulkovo 1942 / Gauss-Kruger zone 6
- <esri28407> : Pulkovo 1942 / Gauss-Kruger zone 7
- <esri28408> : Pulkovo 1942 / Gauss-Kruger zone 8
- <esri28409> : Pulkovo 1942 / Gauss-Kruger zone 9
- <esri28410> : Pulkovo 1942 / Gauss-Kruger zone 10
- <esri28411> : Pulkovo 1942 / Gauss-Kruger zone 11
- <esri28412> : Pulkovo 1942 / Gauss-Kruger zone 12
- <esri28413> : Pulkovo 1942 / Gauss-Kruger zone 13
- <esri28414> : Pulkovo 1942 / Gauss-Kruger zone 14
- <esri28415> : Pulkovo 1942 / Gauss-Kruger zone 15
- <esri28416> : Pulkovo 1942 / Gauss-Kruger zone 16
- <esri28417> : Pulkovo 1942 / Gauss-Kruger zone 17
- <esri28418> : Pulkovo 1942 / Gauss-Kruger zone 18
- <esri28419> : Pulkovo 1942 / Gauss-Kruger zone 19
- <esri28420> : Pulkovo 1942 / Gauss-Kruger zone 20
- <esri28421> : Pulkovo 1942 / Gauss-Kruger zone 21
- <esri28422> : Pulkovo 1942 / Gauss-Kruger zone 22
- <esri28423> : Pulkovo 1942 / Gauss-Kruger zone 23
- <esri28424> : Pulkovo 1942 / Gauss-Kruger zone 24
- <esri28425> : Pulkovo 1942 / Gauss-Kruger zone 25
- <esri28426> : Pulkovo 1942 / Gauss-Kruger zone 26
- <esri28427> : Pulkovo 1942 / Gauss-Kruger zone 27
- <esri28428> : Pulkovo 1942 / Gauss-Kruger zone 28
- <esri28429> : Pulkovo 1942 / Gauss-Kruger zone 29
- <esri28430> : Pulkovo 1942 / Gauss-Kruger zone 30
- <esri28431> : Pulkovo 1942 / Gauss-Kruger zone 31
- <esri28432> : Pulkovo 1942 / Gauss-Kruger zone 32
- <esri28462> : Pulkovo 1942 / Gauss-Kruger 2N
- <esri28463> : Pulkovo 1942 / Gauss-Kruger 3N
- <esri28464> : Pulkovo 1942 / Gauss-Kruger 4N
- <esri28465> : Pulkovo 1942 / Gauss-Kruger 5N
- <esri28466> : Pulkovo 1942 / Gauss-Kruger 6N
- <esri28467> : Pulkovo 1942 / Gauss-Kruger 7N
- <esri28468> : Pulkovo 1942 / Gauss-Kruger 8N
- <esri28469> : Pulkovo 1942 / Gauss-Kruger 9N
- <esri28470> : Pulkovo 1942 / Gauss-Kruger 10N
- <esri28471> : Pulkovo 1942 / Gauss-Kruger 11N
- <esri28472> : Pulkovo 1942 / Gauss-Kruger 12N
- <esri28473> : Pulkovo 1942 / Gauss-Kruger 13N
- <esri28474> : Pulkovo 1942 / Gauss-Kruger 14N
- <esri28475> : Pulkovo 1942 / Gauss-Kruger 15N
- <esri28476> : Pulkovo 1942 / Gauss-Kruger 16N
- <esri28477> : Pulkovo 1942 / Gauss-Kruger 17N
- <esri28478> : Pulkovo 1942 / Gauss-Kruger 18N
- <esri28479> : Pulkovo 1942 / Gauss-Kruger 19N
- <esri28480> : Pulkovo 1942 / Gauss-Kruger 20N
- <esri28481> : Pulkovo 1942 / Gauss-Kruger 21N
- <esri28482> : Pulkovo 1942 / Gauss-Kruger 22N
- <esri28483> : Pulkovo 1942 / Gauss-Kruger 23N
- <esri28484> : Pulkovo 1942 / Gauss-Kruger 24N
- <esri28485> : Pulkovo 1942 / Gauss-Kruger 25N
- <esri28486> : Pulkovo 1942 / Gauss-Kruger 26N
- <esri28487> : Pulkovo 1942 / Gauss-Kruger 27N
- <esri28488> : Pulkovo 1942 / Gauss-Kruger 28N
- <esri28489> : Pulkovo 1942 / Gauss-Kruger 29N
- <esri28490> : Pulkovo 1942 / Gauss-Kruger 30N
- <esri28491> : Pulkovo 1942 / Gauss-Kruger 31N
- <esri28492> : Pulkovo 1942 / Gauss-Kruger 32N
- <esri28600> : Qatar 1974 / Qatar National Grid
- <esri28991> : Amersfoort / RD Old
- <esri28992> : Amersfoort / RD New
- <esri29100> : SAD69 / Brazil Polyconic
- <esri29118> : SAD69 / UTM zone 18N
- <esri29119> : SAD69 / UTM zone 19N
- <esri29120> : SAD69 / UTM zone 20N
- <esri29121> : SAD69 / UTM zone 21N
- <esri29122> : SAD69 / UTM zone 22N
- <esri29177> : SAD69 / UTM zone 17S
- <esri29178> : SAD69 / UTM zone 18S
- <esri29179> : SAD69 / UTM zone 19S
- <esri29180> : SAD69 / UTM zone 20S
- <esri29181> : SAD69 / UTM zone 21S
- <esri29182> : SAD69 / UTM zone 22S
- <esri29183> : SAD69 / UTM zone 23S
- <esri29184> : SAD69 / UTM zone 24S
- <esri29185> : SAD69 / UTM zone 25S
- <esri29220> : Sapper Hill 1943 / UTM zone 20S
- <esri29221> : Sapper Hill 1943 / UTM zone 21S
- <esri29333> : Schwarzeck / UTM zone 33S
- <esri29635> : Sudan / UTM zone 35N
- <esri29636> : Sudan / UTM zone 36N
- <esri29700> : Tananarive (Paris) / Laborde Grid
- <esri29738> : Tananarive / UTM zone 38S
- <esri29739> : Tananarive / UTM zone 39S
- <esri29849> : Timbalai 1948 / UTM zone 49N
- <esri29850> : Timbalai 1948 / UTM zone 50N
- <esri29871> : Timbalai 1948 / R.S.O. Borneo (ch)
- <esri29872> : Timbalai 1948 / R.S.O. Borneo (ft)
- <esri29873> : Timbalai 1948 / R.S.O. Borneo (m)
- <esri29900> : TM65 / Irish National Grid
- <esri29901> : OSNI 1952 / Irish National Grid
- <esri29902> : TM65 / Irish Grid
- <esri29903> : TM75 / Irish Grid
- <esri30161> : Tokyo / Japan Plane Rectangular CS I
- <esri30162> : Tokyo / Japan Plane Rectangular CS II
- <esri30163> : Tokyo / Japan Plane Rectangular CS III
- <esri30164> : Tokyo / Japan Plane Rectangular CS IV
- <esri30165> : Tokyo / Japan Plane Rectangular CS V
- <esri30166> : Tokyo / Japan Plane Rectangular CS VI
- <esri30167> : Tokyo / Japan Plane Rectangular CS VII
- <esri30168> : Tokyo / Japan Plane Rectangular CS VIII
- <esri30169> : Tokyo / Japan Plane Rectangular CS IX
- <esri30170> : Tokyo / Japan Plane Rectangular CS X
- <esri30171> : Tokyo / Japan Plane Rectangular CS XI
- <esri30172> : Tokyo / Japan Plane Rectangular CS XII
- <esri30173> : Tokyo / Japan Plane Rectangular CS XIII
- <esri30174> : Tokyo / Japan Plane Rectangular CS XIV
- <esri30175> : Tokyo / Japan Plane Rectangular CS XV
- <esri30176> : Tokyo / Japan Plane Rectangular CS XVI
- <esri30177> : Tokyo / Japan Plane Rectangular CS XVII
- <esri30178> : Tokyo / Japan Plane Rectangular CS XVIII
- <esri30179> : Tokyo / Japan Plane Rectangular CS XIX
- <esri30200> : Trinidad 1903 / Trinidad Grid
- <esri30339> : TC(1948) / UTM zone 39N
- <esri30340> : TC(1948) / UTM zone 40N
- <esri30491> : Voirol 1875 / Nord Algerie (ancienne)
- <esri30492> : Voirol 1875 / Sud Algerie (ancienne)
- <esri30729> : Nord Sahara 1959 / UTM zone 29N
- <esri30730> : Nord Sahara 1959 / UTM zone 30N
- <esri30731> : Nord Sahara 1959 / UTM zone 31N
- <esri30732> : Nord Sahara 1959 / UTM zone 32N
- <esri30791> : Nord Sahara 1959 / Voirol Unifie Nord
- <esri30792> : Nord Sahara 1959 / Voirol Unifie Sud
- <esri30800> : RT38 2.5 gon W
- <esri31028> : Yoff / UTM zone 28N
- <esri31121> : Zanderij / UTM zone 21N
- <esri31154> : Zanderij / TM 54 NW
- <esri31170> : Zanderij / Suriname Old TM
- <esri31171> : Zanderij / Suriname TM
- <esri31265> : MGI / 3-degree Gauss zone 5
- <esri31266> : MGI / 3-degree Gauss zone 6
- <esri31267> : MGI / 3-degree Gauss zone 7
- <esri31268> : MGI / 3-degree Gauss zone 8
- <esri31275> : MGI / Balkans zone 5
- <esri31276> : MGI / Balkans zone 6
- <esri31277> : MGI / Balkans zone 7
- <esri31278> : MGI / Balkans zone 8
- <esri31279> : MGI / Balkans zone 8
- <esri31281> : MGI (Ferro) / Austria West Zone
- <esri31282> : MGI (Ferro) / Austria Central Zone
- <esri31283> : MGI (Ferro) / Austria East Zone
- <esri31284> : MGI / M28
- <esri31285> : MGI / M31
- <esri31286> : MGI / M34
- <esri31287> : MGI / Austria Lambert
- <esri31291> : MGI (Ferro) / Austria West Zone
- <esri31292> : MGI (Ferro) / Austria Central Zone
- <esri31293> : MGI (Ferro) / Austria East Zone
- <esri31294> : MGI / M28
- <esri31295> : MGI / M31
- <esri31296> : MGI / M34
- <esri31297> : MGI / Austria Lambert
- <esri31300> : Belge 1972 / Belge Lambert 72
- <esri31370> : Belge 1972 / Belgian Lambert 72
- <esri31461> : DHDN / 3-degree Gauss zone 1
- <esri31462> : DHDN / 3-degree Gauss zone 2
- <esri31463> : DHDN / 3-degree Gauss zone 3
- <esri31464> : DHDN / 3-degree Gauss zone 4
- <esri31465> : DHDN / 3-degree Gauss zone 5
- <esri31466> : DHDN / Gauss-Kruger zone 2
- <esri31467> : DHDN / Gauss-Kruger zone 3
- <esri31468> : DHDN / Gauss-Kruger zone 4
- <esri31469> : DHDN / Gauss-Kruger zone 5
- <esri31528> : Conakry 1905 / UTM zone 28N
- <esri31529> : Conakry 1905 / UTM zone 29N
- <esri31600> : Dealul Piscului 1933/ Stereo 33
- <esri31700> : Dealul Piscului 1970/ Stereo 70
- <esri31838> : NGN / UTM zone 38N
- <esri31839> : NGN / UTM zone 39N
- <esri31900> : KUDAMS / KTM
- <esri31986> : SIRGAS / UTM zone 17N
- <esri31987> : SIRGAS / UTM zone 18N
- <esri31988> : SIRGAS / UTM zone 19N
- <esri31989> : SIRGAS / UTM zone 20N
- <esri31990> : SIRGAS / UTM zone 21N
- <esri31991> : SIRGAS / UTM zone 22N
- <esri31992> : SIRGAS / UTM zone 17S
- <esri31993> : SIRGAS / UTM zone 18S
- <esri31994> : SIRGAS / UTM zone 19S
- <esri31995> : SIRGAS / UTM zone 20S
- <esri31996> : SIRGAS / UTM zone 21S
- <esri31997> : SIRGAS / UTM zone 22S
- <esri31998> : SIRGAS / UTM zone 23S
- <esri31999> : SIRGAS / UTM zone 24S
- <esri32000> : SIRGAS / UTM zone 25S
- <esri32001> : NAD27 / Montana North
- <esri32002> : NAD27 / Montana Central
- <esri32003> : NAD27 / Montana South
- <esri32005> : NAD27 / Nebraska North
- <esri32006> : NAD27 / Nebraska South
- <esri32007> : NAD27 / Nevada East
- <esri32008> : NAD27 / Nevada Central
- <esri32009> : NAD27 / Nevada West
- <esri32010> : NAD27 / New Hampshire
- <esri32011> : NAD27 / New Jersey
- <esri32012> : NAD27 / New Mexico East
- <esri32013> : NAD27 / New Mexico Central
- <esri32014> : NAD27 / New Mexico West
- <esri32015> : NAD27 / New York East
- <esri32016> : NAD27 / New York Central
- <esri32017> : NAD27 / New York West
- <esri32018> : NAD27 / New York Long Island
- <esri32019> : NAD27 / North Carolina
- <esri32020> : NAD27 / North Dakota North
- <esri32021> : NAD27 / North Dakota South
- <esri32022> : NAD27 / Ohio North
- <esri32023> : NAD27 / Ohio South
- <esri32024> : NAD27 / Oklahoma North
- <esri32025> : NAD27 / Oklahoma South
- <esri32026> : NAD27 / Oregon North
- <esri32027> : NAD27 / Oregon South
- <esri32028> : NAD27 / Pennsylvania North
- <esri32029> : NAD27 / Pennsylvania South
- <esri32030> : NAD27 / Rhode Island
- <esri32031> : NAD27 / South Carolina North
- <esri32033> : NAD27 / South Carolina South
- <esri32034> : NAD27 / South Dakota North
- <esri32035> : NAD27 / South Dakota South
- <esri32036> : NAD27 / Tennessee
- <esri32037> : NAD27 / Texas North
- <esri32038> : NAD27 / Texas North Central
- <esri32039> : NAD27 / Texas Central
- <esri32040> : NAD27 / Texas South Central
- <esri32041> : NAD27 / Texas South
- <esri32042> : NAD27 / Utah North
- <esri32043> : NAD27 / Utah Central
- <esri32044> : NAD27 / Utah South
- <esri32045> : NAD27 / Vermont
- <esri32046> : NAD27 / Virginia North
- <esri32047> : NAD27 / Virginia South
- <esri32048> : NAD27 / Washington North
- <esri32049> : NAD27 / Washington South
- <esri32050> : NAD27 / West Virginia North
- <esri32051> : NAD27 / West Virginia South
- <esri32052> : NAD27 / Wisconsin North
- <esri32053> : NAD27 / Wisconsin Central
- <esri32054> : NAD27 / Wisconsin South
- <esri32055> : NAD27 / Wyoming East
- <esri32056> : NAD27 / Wyoming East Central
- <esri32057> : NAD27 / Wyoming West Central
- <esri32058> : NAD27 / Wyoming West
- <esri32061> : NAD27 / Guatemala Norte
- <esri32062> : NAD27 / Guatemala Sur
- <esri32064> : NAD27 / BLM 14N (ftUS)
- <esri32065> : NAD27 / BLM 15N (ftUS)
- <esri32066> : NAD27 / BLM 16N (ftUS)
- <esri32067> : NAD27 / BLM 17N (ftUS)
- <esri32074> : NAD27 / BLM 14N (feet)
- <esri32075> : NAD27 / BLM 15N (feet)
- <esri32076> : NAD27 / BLM 16N (feet)
- <esri32077> : NAD27 / BLM 17N (feet)
- <esri32081> : NAD27 / MTM zone 1
- <esri32082> : NAD27 / MTM zone 2
- <esri32083> : NAD27 / MTM zone 3
- <esri32084> : NAD27 / MTM zone 4
- <esri32085> : NAD27 / MTM zone 5
- <esri32086> : NAD27 / MTM zone 6
- <esri32098> : NAD27 / Quebec Lambert
- <esri32100> : NAD83 / Montana
- <esri32104> : NAD83 / Nebraska
- <esri32107> : NAD83 / Nevada East
- <esri32108> : NAD83 / Nevada Central
- <esri32109> : NAD83 / Nevada West
- <esri32110> : NAD83 / New Hampshire
- <esri32111> : NAD83 / New Jersey
- <esri32112> : NAD83 / New Mexico East
- <esri32113> : NAD83 / New Mexico Central
- <esri32114> : NAD83 / New Mexico West
- <esri32115> : NAD83 / New York East
- <esri32116> : NAD83 / New York Central
- <esri32117> : NAD83 / New York West
- <esri32118> : NAD83 / New York Long Island
- <esri32119> : NAD83 / North Carolina
- <esri32120> : NAD83 / North Dakota North
- <esri32121> : NAD83 / North Dakota South
- <esri32122> : NAD83 / Ohio North
- <esri32123> : NAD83 / Ohio South
- <esri32124> : NAD83 / Oklahoma North
- <esri32125> : NAD83 / Oklahoma South
- <esri32126> : NAD83 / Oregon North
- <esri32127> : NAD83 / Oregon South
- <esri32128> : NAD83 / Pennsylvania North
- <esri32129> : NAD83 / Pennsylvania South
- <esri32130> : NAD83 / Rhode Island
- <esri32133> : NAD83 / South Carolina
- <esri32134> : NAD83 / South Dakota North
- <esri32135> : NAD83 / South Dakota South
- <esri32136> : NAD83 / Tennessee
- <esri32137> : NAD83 / Texas North
- <esri32138> : NAD83 / Texas North Central
- <esri32139> : NAD83 / Texas Central
- <esri32140> : NAD83 / Texas South Central
- <esri32141> : NAD83 / Texas South
- <esri32142> : NAD83 / Utah North
- <esri32143> : NAD83 / Utah Central
- <esri32144> : NAD83 / Utah South
- <esri32145> : NAD83 / Vermont
- <esri32146> : NAD83 / Virginia North
- <esri32147> : NAD83 / Virginia South
- <esri32148> : NAD83 / Washington North
- <esri32149> : NAD83 / Washington South
- <esri32150> : NAD83 / West Virginia North
- <esri32151> : NAD83 / West Virginia South
- <esri32152> : NAD83 / Wisconsin North
- <esri32153> : NAD83 / Wisconsin Central
- <esri32154> : NAD83 / Wisconsin South
- <esri32155> : NAD83 / Wyoming East
- <esri32156> : NAD83 / Wyoming East Central
- <esri32157> : NAD83 / Wyoming West Central
- <esri32158> : NAD83 / Wyoming West
- <esri32161> : NAD83 / Puerto Rico & Virgin Is.
- <esri32180> : NAD83 / SCoPQ zone 2
- <esri32181> : NAD83 / MTM zone 1
- <esri32182> : NAD83 / MTM zone 2
- <esri32183> : NAD83 / MTM zone 3
- <esri32184> : NAD83 / MTM zone 4
- <esri32185> : NAD83 / MTM zone 5
- <esri32186> : NAD83 / MTM zone 6
- <esri32187> : NAD83 / MTM zone 7
- <esri32188> : NAD83 / MTM zone 8
- <esri32189> : NAD83 / MTM zone 9
- <esri32190> : NAD83 / MTM zone 10
- <esri32191> : NAD83 / MTM zone 11
- <esri32192> : NAD83 / MTM zone 12
- <esri32193> : NAD83 / MTM zone 13
- <esri32194> : NAD83 / MTM zone 14
- <esri32195> : NAD83 / MTM zone 15
- <esri32196> : NAD83 / MTM zone 16
- <esri32197> : NAD83 / MTM zone 17
- <esri32198> : NAD83 / Quebec Lambert
- <esri32201> : WGS 72 / UTM zone 1N
- <esri32202> : WGS 72 / UTM zone 2N
- <esri32203> : WGS 72 / UTM zone 3N
- <esri32204> : WGS 72 / UTM zone 4N
- <esri32205> : WGS 72 / UTM zone 5N
- <esri32206> : WGS 72 / UTM zone 6N
- <esri32207> : WGS 72 / UTM zone 7N
- <esri32208> : WGS 72 / UTM zone 8N
- <esri32209> : WGS 72 / UTM zone 9N
- <esri32210> : WGS 72 / UTM zone 10N
- <esri32211> : WGS 72 / UTM zone 11N
- <esri32212> : WGS 72 / UTM zone 12N
- <esri32213> : WGS 72 / UTM zone 13N
- <esri32214> : WGS 72 / UTM zone 14N
- <esri32215> : WGS 72 / UTM zone 15N
- <esri32216> : WGS 72 / UTM zone 16N
- <esri32217> : WGS 72 / UTM zone 17N
- <esri32218> : WGS 72 / UTM zone 18N
- <esri32219> : WGS 72 / UTM zone 19N
- <esri32220> : WGS 72 / UTM zone 20N
- <esri32221> : WGS 72 / UTM zone 21N
- <esri32222> : WGS 72 / UTM zone 22N
- <esri32223> : WGS 72 / UTM zone 23N
- <esri32224> : WGS 72 / UTM zone 24N
- <esri32225> : WGS 72 / UTM zone 25N
- <esri32226> : WGS 72 / UTM zone 26N
- <esri32227> : WGS 72 / UTM zone 27N
- <esri32228> : WGS 72 / UTM zone 28N
- <esri32229> : WGS 72 / UTM zone 29N
- <esri32230> : WGS 72 / UTM zone 30N
- <esri32231> : WGS 72 / UTM zone 31N
- <esri32232> : WGS 72 / UTM zone 32N
- <esri32233> : WGS 72 / UTM zone 33N
- <esri32234> : WGS 72 / UTM zone 34N
- <esri32235> : WGS 72 / UTM zone 35N
- <esri32236> : WGS 72 / UTM zone 36N
- <esri32237> : WGS 72 / UTM zone 37N
- <esri32238> : WGS 72 / UTM zone 38N
- <esri32239> : WGS 72 / UTM zone 39N
- <esri32240> : WGS 72 / UTM zone 40N
- <esri32241> : WGS 72 / UTM zone 41N
- <esri32242> : WGS 72 / UTM zone 42N
- <esri32243> : WGS 72 / UTM zone 43N
- <esri32244> : WGS 72 / UTM zone 44N
- <esri32245> : WGS 72 / UTM zone 45N
- <esri32246> : WGS 72 / UTM zone 46N
- <esri32247> : WGS 72 / UTM zone 47N
- <esri32248> : WGS 72 / UTM zone 48N
- <esri32249> : WGS 72 / UTM zone 49N
- <esri32250> : WGS 72 / UTM zone 50N
- <esri32251> : WGS 72 / UTM zone 51N
- <esri32252> : WGS 72 / UTM zone 52N
- <esri32253> : WGS 72 / UTM zone 53N
- <esri32254> : WGS 72 / UTM zone 54N
- <esri32255> : WGS 72 / UTM zone 55N
- <esri32256> : WGS 72 / UTM zone 56N
- <esri32257> : WGS 72 / UTM zone 57N
- <esri32258> : WGS 72 / UTM zone 58N
- <esri32259> : WGS 72 / UTM zone 59N
- <esri32260> : WGS 72 / UTM zone 60N
- <esri32301> : WGS 72 / UTM zone 1S
- <esri32302> : WGS 72 / UTM zone 2S
- <esri32303> : WGS 72 / UTM zone 3S
- <esri32304> : WGS 72 / UTM zone 4S
- <esri32305> : WGS 72 / UTM zone 5S
- <esri32306> : WGS 72 / UTM zone 6S
- <esri32307> : WGS 72 / UTM zone 7S
- <esri32308> : WGS 72 / UTM zone 8S
- <esri32309> : WGS 72 / UTM zone 9S
- <esri32310> : WGS 72 / UTM zone 10S
- <esri32311> : WGS 72 / UTM zone 11S
- <esri32312> : WGS 72 / UTM zone 12S
- <esri32313> : WGS 72 / UTM zone 13S
- <esri32314> : WGS 72 / UTM zone 14S
- <esri32315> : WGS 72 / UTM zone 15S
- <esri32316> : WGS 72 / UTM zone 16S
- <esri32317> : WGS 72 / UTM zone 17S
- <esri32318> : WGS 72 / UTM zone 18S
- <esri32319> : WGS 72 / UTM zone 19S
- <esri32320> : WGS 72 / UTM zone 20S
- <esri32321> : WGS 72 / UTM zone 21S
- <esri32322> : WGS 72 / UTM zone 22S
- <esri32323> : WGS 72 / UTM zone 23S
- <esri32324> : WGS 72 / UTM zone 24S
- <esri32325> : WGS 72 / UTM zone 25S
- <esri32326> : WGS 72 / UTM zone 26S
- <esri32327> : WGS 72 / UTM zone 27S
- <esri32328> : WGS 72 / UTM zone 28S
- <esri32329> : WGS 72 / UTM zone 29S
- <esri32330> : WGS 72 / UTM zone 30S
- <esri32331> : WGS 72 / UTM zone 31S
- <esri32332> : WGS 72 / UTM zone 32S
- <esri32333> : WGS 72 / UTM zone 33S
- <esri32334> : WGS 72 / UTM zone 34S
- <esri32335> : WGS 72 / UTM zone 35S
- <esri32336> : WGS 72 / UTM zone 36S
- <esri32337> : WGS 72 / UTM zone 37S
- <esri32338> : WGS 72 / UTM zone 38S
- <esri32339> : WGS 72 / UTM zone 39S
- <esri32340> : WGS 72 / UTM zone 40S
- <esri32341> : WGS 72 / UTM zone 41S
- <esri32342> : WGS 72 / UTM zone 42S
- <esri32343> : WGS 72 / UTM zone 43S
- <esri32344> : WGS 72 / UTM zone 44S
- <esri32345> : WGS 72 / UTM zone 45S
- <esri32346> : WGS 72 / UTM zone 46S
- <esri32347> : WGS 72 / UTM zone 47S
- <esri32348> : WGS 72 / UTM zone 48S
- <esri32349> : WGS 72 / UTM zone 49S
- <esri32350> : WGS 72 / UTM zone 50S
- <esri32351> : WGS 72 / UTM zone 51S
- <esri32352> : WGS 72 / UTM zone 52S
- <esri32353> : WGS 72 / UTM zone 53S
- <esri32354> : WGS 72 / UTM zone 54S
- <esri32355> : WGS 72 / UTM zone 55S
- <esri32356> : WGS 72 / UTM zone 56S
- <esri32357> : WGS 72 / UTM zone 57S
- <esri32358> : WGS 72 / UTM zone 58S
- <esri32359> : WGS 72 / UTM zone 59S
- <esri32360> : WGS 72 / UTM zone 60S
- <esri32401> : WGS 72BE / UTM zone 1N
- <esri32402> : WGS 72BE / UTM zone 2N
- <esri32403> : WGS 72BE / UTM zone 3N
- <esri32404> : WGS 72BE / UTM zone 4N
- <esri32405> : WGS 72BE / UTM zone 5N
- <esri32406> : WGS 72BE / UTM zone 6N
- <esri32407> : WGS 72BE / UTM zone 7N
- <esri32408> : WGS 72BE / UTM zone 8N
- <esri32409> : WGS 72BE / UTM zone 9N
- <esri32410> : WGS 72BE / UTM zone 10N
- <esri32411> : WGS 72BE / UTM zone 11N
- <esri32412> : WGS 72BE / UTM zone 12N
- <esri32413> : WGS 72BE / UTM zone 13N
- <esri32414> : WGS 72BE / UTM zone 14N
- <esri32415> : WGS 72BE / UTM zone 15N
- <esri32416> : WGS 72BE / UTM zone 16N
- <esri32417> : WGS 72BE / UTM zone 17N
- <esri32418> : WGS 72BE / UTM zone 18N
- <esri32419> : WGS 72BE / UTM zone 19N
- <esri32420> : WGS 72BE / UTM zone 20N
- <esri32421> : WGS 72BE / UTM zone 21N
- <esri32422> : WGS 72BE / UTM zone 22N
- <esri32423> : WGS 72BE / UTM zone 23N
- <esri32424> : WGS 72BE / UTM zone 24N
- <esri32425> : WGS 72BE / UTM zone 25N
- <esri32426> : WGS 72BE / UTM zone 26N
- <esri32427> : WGS 72BE / UTM zone 27N
- <esri32428> : WGS 72BE / UTM zone 28N
- <esri32429> : WGS 72BE / UTM zone 29N
- <esri32430> : WGS 72BE / UTM zone 30N
- <esri32431> : WGS 72BE / UTM zone 31N
- <esri32432> : WGS 72BE / UTM zone 32N
- <esri32433> : WGS 72BE / UTM zone 33N
- <esri32434> : WGS 72BE / UTM zone 34N
- <esri32435> : WGS 72BE / UTM zone 35N
- <esri32436> : WGS 72BE / UTM zone 36N
- <esri32437> : WGS 72BE / UTM zone 37N
- <esri32438> : WGS 72BE / UTM zone 38N
- <esri32439> : WGS 72BE / UTM zone 39N
- <esri32440> : WGS 72BE / UTM zone 40N
- <esri32441> : WGS 72BE / UTM zone 41N
- <esri32442> : WGS 72BE / UTM zone 42N
- <esri32443> : WGS 72BE / UTM zone 43N
- <esri32444> : WGS 72BE / UTM zone 44N
- <esri32445> : WGS 72BE / UTM zone 45N
- <esri32446> : WGS 72BE / UTM zone 46N
- <esri32447> : WGS 72BE / UTM zone 47N
- <esri32448> : WGS 72BE / UTM zone 48N
- <esri32449> : WGS 72BE / UTM zone 49N
- <esri32450> : WGS 72BE / UTM zone 50N
- <esri32451> : WGS 72BE / UTM zone 51N
- <esri32452> : WGS 72BE / UTM zone 52N
- <esri32453> : WGS 72BE / UTM zone 53N
- <esri32454> : WGS 72BE / UTM zone 54N
- <esri32455> : WGS 72BE / UTM zone 55N
- <esri32456> : WGS 72BE / UTM zone 56N
- <esri32457> : WGS 72BE / UTM zone 57N
- <esri32458> : WGS 72BE / UTM zone 58N
- <esri32459> : WGS 72BE / UTM zone 59N
- <esri32460> : WGS 72BE / UTM zone 60N
- <esri32501> : WGS 72BE / UTM zone 1S
- <esri32502> : WGS 72BE / UTM zone 2S
- <esri32503> : WGS 72BE / UTM zone 3S
- <esri32504> : WGS 72BE / UTM zone 4S
- <esri32505> : WGS 72BE / UTM zone 5S
- <esri32506> : WGS 72BE / UTM zone 6S
- <esri32507> : WGS 72BE / UTM zone 7S
- <esri32508> : WGS 72BE / UTM zone 8S
- <esri32509> : WGS 72BE / UTM zone 9S
- <esri32510> : WGS 72BE / UTM zone 10S
- <esri32511> : WGS 72BE / UTM zone 11S
- <esri32512> : WGS 72BE / UTM zone 12S
- <esri32513> : WGS 72BE / UTM zone 13S
- <esri32514> : WGS 72BE / UTM zone 14S
- <esri32515> : WGS 72BE / UTM zone 15S
- <esri32516> : WGS 72BE / UTM zone 16S
- <esri32517> : WGS 72BE / UTM zone 17S
- <esri32518> : WGS 72BE / UTM zone 18S
- <esri32519> : WGS 72BE / UTM zone 19S
- <esri32520> : WGS 72BE / UTM zone 20S
- <esri32521> : WGS 72BE / UTM zone 21S
- <esri32522> : WGS 72BE / UTM zone 22S
- <esri32523> : WGS 72BE / UTM zone 23S
- <esri32524> : WGS 72BE / UTM zone 24S
- <esri32525> : WGS 72BE / UTM zone 25S
- <esri32526> : WGS 72BE / UTM zone 26S
- <esri32527> : WGS 72BE / UTM zone 27S
- <esri32528> : WGS 72BE / UTM zone 28S
- <esri32529> : WGS 72BE / UTM zone 29S
- <esri32530> : WGS 72BE / UTM zone 30S
- <esri32531> : WGS 72BE / UTM zone 31S
- <esri32532> : WGS 72BE / UTM zone 32S
- <esri32533> : WGS 72BE / UTM zone 33S
- <esri32534> : WGS 72BE / UTM zone 34S
- <esri32535> : WGS 72BE / UTM zone 35S
- <esri32536> : WGS 72BE / UTM zone 36S
- <esri32537> : WGS 72BE / UTM zone 37S
- <esri32538> : WGS 72BE / UTM zone 38S
- <esri32539> : WGS 72BE / UTM zone 39S
- <esri32540> : WGS 72BE / UTM zone 40S
- <esri32541> : WGS 72BE / UTM zone 41S
- <esri32542> : WGS 72BE / UTM zone 42S
- <esri32543> : WGS 72BE / UTM zone 43S
- <esri32544> : WGS 72BE / UTM zone 44S
- <esri32545> : WGS 72BE / UTM zone 45S
- <esri32546> : WGS 72BE / UTM zone 46S
- <esri32547> : WGS 72BE / UTM zone 47S
- <esri32548> : WGS 72BE / UTM zone 48S
- <esri32549> : WGS 72BE / UTM zone 49S
- <esri32550> : WGS 72BE / UTM zone 50S
- <esri32551> : WGS 72BE / UTM zone 51S
- <esri32552> : WGS 72BE / UTM zone 52S
- <esri32553> : WGS 72BE / UTM zone 53S
- <esri32554> : WGS 72BE / UTM zone 54S
- <esri32555> : WGS 72BE / UTM zone 55S
- <esri32556> : WGS 72BE / UTM zone 56S
- <esri32557> : WGS 72BE / UTM zone 57S
- <esri32558> : WGS 72BE / UTM zone 58S
- <esri32559> : WGS 72BE / UTM zone 59S
- <esri32560> : WGS 72BE / UTM zone 60S
- <esri32601> : WGS 84 / UTM zone 1N
- <esri32602> : WGS 84 / UTM zone 2N
- <esri32603> : WGS 84 / UTM zone 3N
- <esri32604> : WGS 84 / UTM zone 4N
- <esri32605> : WGS 84 / UTM zone 5N
- <esri32606> : WGS 84 / UTM zone 6N
- <esri32607> : WGS 84 / UTM zone 7N
- <esri32608> : WGS 84 / UTM zone 8N
- <esri32609> : WGS 84 / UTM zone 9N
- <esri32610> : WGS 84 / UTM zone 10N
- <esri32611> : WGS 84 / UTM zone 11N
- <esri32612> : WGS 84 / UTM zone 12N
- <esri32613> : WGS 84 / UTM zone 13N
- <esri32614> : WGS 84 / UTM zone 14N
- <esri32615> : WGS 84 / UTM zone 15N
- <esri32616> : WGS 84 / UTM zone 16N
- <esri32617> : WGS 84 / UTM zone 17N
- <esri32618> : WGS 84 / UTM zone 18N
- <esri32619> : WGS 84 / UTM zone 19N
- <esri32620> : WGS 84 / UTM zone 20N
- <esri32621> : WGS 84 / UTM zone 21N
- <esri32622> : WGS 84 / UTM zone 22N
- <esri32623> : WGS 84 / UTM zone 23N
- <esri32624> : WGS 84 / UTM zone 24N
- <esri32625> : WGS 84 / UTM zone 25N
- <esri32626> : WGS 84 / UTM zone 26N
- <esri32627> : WGS 84 / UTM zone 27N
- <esri32628> : WGS 84 / UTM zone 28N
- <esri32629> : WGS 84 / UTM zone 29N
- <esri32630> : WGS 84 / UTM zone 30N
- <esri32631> : WGS 84 / UTM zone 31N
- <esri32632> : WGS 84 / UTM zone 32N
- <esri32633> : WGS 84 / UTM zone 33N
- <esri32634> : WGS 84 / UTM zone 34N
- <esri32635> : WGS 84 / UTM zone 35N
- <esri32636> : WGS 84 / UTM zone 36N
- <esri32637> : WGS 84 / UTM zone 37N
- <esri32638> : WGS 84 / UTM zone 38N
- <esri32639> : WGS 84 / UTM zone 39N
- <esri32640> : WGS 84 / UTM zone 40N
- <esri32641> : WGS 84 / UTM zone 41N
- <esri32642> : WGS 84 / UTM zone 42N
- <esri32643> : WGS 84 / UTM zone 43N
- <esri32644> : WGS 84 / UTM zone 44N
- <esri32645> : WGS 84 / UTM zone 45N
- <esri32646> : WGS 84 / UTM zone 46N
- <esri32647> : WGS 84 / UTM zone 47N
- <esri32648> : WGS 84 / UTM zone 48N
- <esri32649> : WGS 84 / UTM zone 49N
- <esri32650> : WGS 84 / UTM zone 50N
- <esri32651> : WGS 84 / UTM zone 51N
- <esri32652> : WGS 84 / UTM zone 52N
- <esri32653> : WGS 84 / UTM zone 53N
- <esri32654> : WGS 84 / UTM zone 54N
- <esri32655> : WGS 84 / UTM zone 55N
- <esri32656> : WGS 84 / UTM zone 56N
- <esri32657> : WGS 84 / UTM zone 57N
- <esri32658> : WGS 84 / UTM zone 58N
- <esri32659> : WGS 84 / UTM zone 59N
- <esri32660> : WGS 84 / UTM zone 60N
- <esri32661> : WGS 84 / UPS North
- <esri32701> : WGS 84 / UTM zone 1S
- <esri32702> : WGS 84 / UTM zone 2S
- <esri32703> : WGS 84 / UTM zone 3S
- <esri32704> : WGS 84 / UTM zone 4S
- <esri32705> : WGS 84 / UTM zone 5S
- <esri32706> : WGS 84 / UTM zone 6S
- <esri32707> : WGS 84 / UTM zone 7S
- <esri32708> : WGS 84 / UTM zone 8S
- <esri32709> : WGS 84 / UTM zone 9S
- <esri32710> : WGS 84 / UTM zone 10S
- <esri32711> : WGS 84 / UTM zone 11S
- <esri32712> : WGS 84 / UTM zone 12S
- <esri32713> : WGS 84 / UTM zone 13S
- <esri32714> : WGS 84 / UTM zone 14S
- <esri32715> : WGS 84 / UTM zone 15S
- <esri32716> : WGS 84 / UTM zone 16S
- <esri32717> : WGS 84 / UTM zone 17S
- <esri32718> : WGS 84 / UTM zone 18S
- <esri32719> : WGS 84 / UTM zone 19S
- <esri32720> : WGS 84 / UTM zone 20S
- <esri32721> : WGS 84 / UTM zone 21S
- <esri32722> : WGS 84 / UTM zone 22S
- <esri32723> : WGS 84 / UTM zone 23S
- <esri32724> : WGS 84 / UTM zone 24S
- <esri32725> : WGS 84 / UTM zone 25S
- <esri32726> : WGS 84 / UTM zone 26S
- <esri32727> : WGS 84 / UTM zone 27S
- <esri32728> : WGS 84 / UTM zone 28S
- <esri32729> : WGS 84 / UTM zone 29S
- <esri32730> : WGS 84 / UTM zone 30S
- <esri32731> : WGS 84 / UTM zone 31S
- <esri32732> : WGS 84 / UTM zone 32S
- <esri32733> : WGS 84 / UTM zone 33S
- <esri32734> : WGS 84 / UTM zone 34S
- <esri32735> : WGS 84 / UTM zone 35S
- <esri32736> : WGS 84 / UTM zone 36S
- <esri32737> : WGS 84 / UTM zone 37S
- <esri32738> : WGS 84 / UTM zone 38S
- <esri32739> : WGS 84 / UTM zone 39S
- <esri32740> : WGS 84 / UTM zone 40S
- <esri32741> : WGS 84 / UTM zone 41S
- <esri32742> : WGS 84 / UTM zone 42S
- <esri32743> : WGS 84 / UTM zone 43S
- <esri32744> : WGS 84 / UTM zone 44S
- <esri32745> : WGS 84 / UTM zone 45S
- <esri32746> : WGS 84 / UTM zone 46S
- <esri32747> : WGS 84 / UTM zone 47S
- <esri32748> : WGS 84 / UTM zone 48S
- <esri32749> : WGS 84 / UTM zone 49S
- <esri32750> : WGS 84 / UTM zone 50S
- <esri32751> : WGS 84 / UTM zone 51S
- <esri32752> : WGS 84 / UTM zone 52S
- <esri32753> : WGS 84 / UTM zone 53S
- <esri32754> : WGS 84 / UTM zone 54S
- <esri32755> : WGS 84 / UTM zone 55S
- <esri32756> : WGS 84 / UTM zone 56S
- <esri32757> : WGS 84 / UTM zone 57S
- <esri32758> : WGS 84 / UTM zone 58S
- <esri32759> : WGS 84 / UTM zone 59S
- <esri32760> : WGS 84 / UTM zone 60S
- <esri32761> : WGS 84 / UPS South
- <esri32766> : WGS 84 / TM 36 SE
- <esri20002> : Pulkovo 1995 GK Zone 2
- <esri20003> : Pulkovo 1995 GK Zone 3
- <esri20062> : Pulkovo 1995 GK Zone 2N
- <esri20063> : Pulkovo 1995 GK Zone 3N
- <esri24721> : La Canoa UTM Zone 21N
- <esri26761> : NAD 1927 StatePlane Hawaii 1 FIPS 5101
- <esri26762> : NAD 1927 StatePlane Hawaii 2 FIPS 5102
- <esri26763> : NAD 1927 StatePlane Hawaii 3 FIPS 5103
- <esri26764> : NAD 1927 StatePlane Hawaii 4 FIPS 5104
- <esri26765> : NAD 1927 StatePlane Hawaii 5 FIPS 5105
- <esri26788> : NAD 1927 StatePlane Michigan North FIPS 2111
- <esri26789> : NAD 1927 StatePlane Michigan Central FIPS 2112
- <esri26790> : NAD 1927 StatePlane Michigan South FIPS 2113
- <esri30591> : Nord Algerie
- <esri30592> : Sud Algerie
- <esri31491> : Germany Zone 1
- <esri31492> : Germany Zone 2
- <esri31493> : Germany Zone 3
- <esri31494> : Germany Zone 4
- <esri31495> : Germany Zone 5
- <esri32059> : NAD 1927 StatePlane Puerto Rico FIPS 5201
- <esri32060> : NAD 1927 StatePlane Virgin Islands St Croix FIPS 5202
- <esri53001> : Sphere Plate Carree
- <esri53002> : Sphere Equidistant Cylindrical
- <esri53003> : Sphere Miller Cylindrical
- <esri53004> : Sphere Mercator
- <esri53008> : Sphere Sinusoidal
- <esri53009> : Sphere Mollweide
- <esri53010> : Sphere Eckert VI
- <esri53011> : Sphere Eckert V
- <esri53012> : Sphere Eckert IV
- <esri53013> : Sphere Eckert III
- <esri53014> : Sphere Eckert II
- <esri53015> : Sphere Eckert I
- <esri53016> : Sphere Gall Stereographic
- <esri53017> : Sphere Behrmann
- <esri53018> : Sphere Winkel I
- <esri53019> : Sphere Winkel II
- <esri53021> : Sphere Polyconic
- <esri53022> : Sphere Quartic Authalic
- <esri53023> : Sphere Loximuthal
- <esri53024> : Sphere Bonne
- <esri53025> : Sphere Hotine
- <esri53026> : Sphere Stereographic
- <esri53027> : Sphere Equidistant Conic
- <esri53028> : Sphere Cassini
- <esri53029> : Sphere Van der Grinten I
- <esri53030> : Sphere Robinson
- <esri53031> : Sphere Two Point Equidistant
- <esri53032> : Sphere Azimuthal Equidistant
- <esri54001> : World Plate Carree
- <esri54002> : World Equidistant Cylindrical
- <esri54003> : World Miller Cylindrical
- <esri54004> : World Mercator
- <esri54008> : World Sinusoidal
- <esri54009> : World Mollweide
- <esri54010> : World Eckert VI
- <esri54011> : World Eckert V
- <esri54012> : World Eckert IV
- <esri54013> : World Eckert III
- <esri54014> : World Eckert II
- <esri54015> : World Eckert I
- <esri54016> : World Gall Stereographic
- <esri54017> : World Behrmann
- <esri54018> : World Winkel I
- <esri54019> : World Winkel II
- <esri54021> : World Polyconic
- <esri54022> : World Quartic Authalic
- <esri54023> : World Loximuthal
- <esri54024> : World Bonne
- <esri54025> : World Hotine
- <esri54026> : World Stereographic
- <esri54027> : World Equidistant Conic
- <esri54028> : World Cassini
- <esri54029> : World Van der Grinten I
- <esri54030> : World Robinson
- <esri54031> : World Two Point Equidistant
- <esri54032> : World Azimuthal Equidistant
- <esri65061> : NAD 1927 StatePlane Guam FIPS 5400
- <esri65161> : NAD 1983 StatePlane Guam FIPS 5400
- <esri102001> : Canada Albers Equal Area Conic
- <esri102002> : Canada Lambert Conformal Conic
- <esri102003> : USA Contiguous Albers Equal Area Conic
- <esri102004> : USA Contiguous Lambert Conformal Conic
- <esri102005> : USA Contiguous Equidistant Conic
- <esri102006> : Alaska Albers Equal Area Conic
- <esri102007> : Hawaii Albers Equal Area Conic
- <esri102008> : North America Albers Equal Area Conic
- <esri102009> : North America Lambert Conformal Conic
- <esri102010> : North America Equidistant Conic
- <esri102011> : Africa Sinusoidal
- <esri102012> : Asia Lambert Conformal Conic
- <esri102013> : Europe Albers Equal Area Conic
- <esri102014> : Europe Lambert Conformal Conic
- <esri102015> : South America Lambert Conformal Conic
- <esri102016> : North Pole Azimuthal Equidistant
- <esri102017> : North Pole Lambert Azimuthal Equal Area
- <esri102018> : North Pole Stereographic
- <esri102019> : South Pole Azimuthal Equidistant
- <esri102020> : South Pole Lambert Azimuthal Equal Area
- <esri102021> : South Pole Stereographic
- <esri102022> : Africa Albers Equal Area Conic
- <esri102023> : Africa Equidistant Conic
- <esri102024> : Africa Lambert Conformal Conic
- <esri102025> : Asia North Albers Equal Area Conic
- <esri102026> : Asia North Equidistant Conic
- <esri102027> : Asia North Lambert Conformal Conic
- <esri102028> : Asia South Albers Equal Area Conic
- <esri102029> : Asia South Equidistant Conic
- <esri102030> : Asia South Lambert Conformal Conic
- <esri102031> : Europe Equidistant Conic
- <esri102032> : South America Equidistant Conic
- <esri102033> : South America Albers Equal Area Conic
- <esri102065> : S-JTSK Krovak
- <esri102066> : S-JTSK Ferro Krovak East North
- <esri102067> : S-JTSK Krovak East North
- <esri102091> : Monte Mario Italy 1
- <esri102092> : Monte Mario Italy 2
- <esri102101> : NGO 1948 Norway Zone 1
- <esri102102> : NGO 1948 Norway Zone 2
- <esri102103> : NGO 1948 Norway Zone 3
- <esri102104> : NGO 1948 Norway Zone 4
- <esri102105> : NGO 1948 Norway Zone 5
- <esri102106> : NGO 1948 Norway Zone 6
- <esri102107> : NGO 1948 Norway Zone 7
- <esri102108> : NGO 1948 Norway Zone 8
- <esri102110> : RGF 1993 Lambert 93
- <esri102114> : Old Hawaiian UTM Zone 4N
- <esri102115> : Old Hawaiian UTM Zone 5N
- <esri102120> : NAD 1927 Michigan GeoRef Feet US
- <esri102121> : NAD 1983 Michigan GeoRef Feet US
- <esri102122> : NAD 1927 Michigan GeoRef Meters
- <esri102123> : NAD 1983 Michigan GeoRef Meters
- <esri102132> : NGO 1948 UTM Zone 32N
- <esri102133> : NGO 1948 UTM Zone 33N
- <esri102134> : NGO 1948 UTM Zone 34N
- <esri102135> : NGO 1948 UTM Zone 35N
- <esri102140> : Hong Kong 1980 Grid
- <esri102141> : Hong Kong 1980 UTM Zone 49N
- <esri102142> : Hong Kong 1980 UTM Zone 50N
- <esri102151> : Tokyo UTM Zone 51N
- <esri102152> : Tokyo UTM Zone 52N
- <esri102153> : Tokyo UTM Zone 53N
- <esri102154> : Tokyo UTM Zone 54N
- <esri102155> : Tokyo UTM Zone 55N
- <esri102156> : Tokyo UTM Zone 56N
- <esri102160> : Datum 73 Hayford Gauss IGeoE
- <esri102161> : Datum 73 Hayford Gauss IPCC
- <esri102162> : Graciosa Base SW 1948 UTM Zone 26N
- <esri102163> : Lisboa Bessel Bonne
- <esri102164> : Lisboa Hayford Gauss IGeoE
- <esri102165> : Lisboa Hayford Gauss IPCC
- <esri102166> : Observ Meteorologico 1939 UTM Zone 25N
- <esri102167> : Porto Santo 1936 UTM Zone 28N
- <esri102168> : Sao Braz UTM Zone 26N
- <esri102169> : Selvagem Grande 1938 UTM Zone 28N
- <esri102191> : Nord Maroc Degree
- <esri102192> : Sud Maroc Degree
- <esri102193> : Sahara Degree
- <esri102229> : NAD 1983 HARN StatePlane Alabama East FIPS 0101
- <esri102230> : NAD 1983 HARN StatePlane Alabama West FIPS 0102
- <esri102241> : NAD 1983 HARN StatePlane California I FIPS 0401
- <esri102242> : NAD 1983 HARN StatePlane California II FIPS 0402
- <esri102243> : NAD 1983 HARN StatePlane California III FIPS 0403
- <esri102244> : NAD 1983 HARN StatePlane California IV FIPS 0404
- <esri102245> : NAD 1983 HARN StatePlane California V FIPS 0405
- <esri102246> : NAD 1983 HARN StatePlane California VI FIPS 0406
- <esri102248> : NAD 1983 HARN StatePlane Arizona East FIPS 0201
- <esri102249> : NAD 1983 HARN StatePlane Arizona Central FIPS 0202
- <esri102250> : NAD 1983 HARN StatePlane Arizona West FIPS 0203
- <esri102251> : NAD 1983 HARN StatePlane Arkansas North FIPS 0301
- <esri102252> : NAD 1983 HARN StatePlane Arkansas South FIPS 0302
- <esri102253> : NAD 1983 HARN StatePlane Colorado North FIPS 0501
- <esri102254> : NAD 1983 HARN StatePlane Colorado Central FIPS 0502
- <esri102255> : NAD 1983 HARN StatePlane Colorado South FIPS 0503
- <esri102256> : NAD 1983 HARN StatePlane Connecticut FIPS 0600
- <esri102257> : NAD 1983 HARN StatePlane Delaware FIPS 0700
- <esri102258> : NAD 1983 HARN StatePlane Florida East FIPS 0901
- <esri102259> : NAD 1983 HARN StatePlane Florida West FIPS 0902
- <esri102260> : NAD 1983 HARN StatePlane Florida North FIPS 0903
- <esri102261> : NAD 1983 HARN StatePlane Hawaii 1 FIPS 5101
- <esri102262> : NAD 1983 HARN StatePlane Hawaii 2 FIPS 5102
- <esri102263> : NAD 1983 HARN StatePlane Hawaii 3 FIPS 5103
- <esri102264> : NAD 1983 HARN StatePlane Hawaii 4 FIPS 5104
- <esri102265> : NAD 1983 HARN StatePlane Hawaii 5 FIPS 5105
- <esri102266> : NAD 1983 HARN StatePlane Georgia East FIPS 1001
- <esri102267> : NAD 1983 HARN StatePlane Georgia West FIPS 1002
- <esri102268> : NAD 1983 HARN StatePlane Idaho East FIPS 1101
- <esri102269> : NAD 1983 HARN StatePlane Idaho Central FIPS 1102
- <esri102270> : NAD 1983 HARN StatePlane Idaho West FIPS 1103
- <esri102271> : NAD 1983 HARN StatePlane Illinois East FIPS 1201
- <esri102272> : NAD 1983 HARN StatePlane Illinois West FIPS 1202
- <esri102273> : NAD 1983 HARN StatePlane Indiana East FIPS 1301
- <esri102274> : NAD 1983 HARN StatePlane Indiana West FIPS 1302
- <esri102277> : NAD 1983 HARN StatePlane Kansas North FIPS 1501
- <esri102278> : NAD 1983 HARN StatePlane Kansas South FIPS 1502
- <esri102279> : NAD 1983 HARN StatePlane Kentucky North FIPS 1601
- <esri102280> : NAD 1983 HARN StatePlane Kentucky South FIPS 1602
- <esri102281> : NAD 1983 HARN StatePlane Louisiana North FIPS 1701
- <esri102282> : NAD 1983 HARN StatePlane Louisiana South FIPS 1702
- <esri102283> : NAD 1983 HARN StatePlane Maine East FIPS 1801
- <esri102284> : NAD 1983 HARN StatePlane Maine West FIPS 1802
- <esri102285> : NAD 1983 HARN StatePlane Maryland FIPS 1900
- <esri102286> : NAD 1983 HARN StatePlane Massachusetts Mainland FIPS 2001
- <esri102287> : NAD 1983 HARN StatePlane Massachusetts Island FIPS 2002
- <esri102288> : NAD 1983 HARN StatePlane Michigan North FIPS 2111
- <esri102289> : NAD 1983 HARN StatePlane Michigan Central FIPS 2112
- <esri102290> : NAD 1983 HARN StatePlane Michigan South FIPS 2113
- <esri102291> : NAD 1983 HARN StatePlane Minnesota North FIPS 2201
- <esri102292> : NAD 1983 HARN StatePlane Minnesota Central FIPS 2202
- <esri102293> : NAD 1983 HARN StatePlane Minnesota South FIPS 2203
- <esri102294> : NAD 1983 HARN StatePlane Mississippi East FIPS 2301
- <esri102295> : NAD 1983 HARN StatePlane Mississippi West FIPS 2302
- <esri102296> : NAD 1983 HARN StatePlane Missouri East FIPS 2401
- <esri102297> : NAD 1983 HARN StatePlane Missouri Central FIPS 2402
- <esri102298> : NAD 1983 HARN StatePlane Missouri West FIPS 2403
- <esri102300> : NAD 1983 HARN StatePlane Montana FIPS 2500
- <esri102304> : NAD 1983 HARN StatePlane Nebraska FIPS 2600
- <esri102307> : NAD 1983 HARN StatePlane Nevada East FIPS 2701
- <esri102308> : NAD 1983 HARN StatePlane Nevada Central FIPS 2702
- <esri102309> : NAD 1983 HARN StatePlane Nevada West FIPS 2703
- <esri102310> : NAD 1983 HARN StatePlane New Hampshire FIPS 2800
- <esri102311> : NAD 1983 HARN StatePlane New Jersey FIPS 2900
- <esri102312> : NAD 1983 HARN StatePlane New Mexico East FIPS 3001
- <esri102313> : NAD 1983 HARN StatePlane New Mexico Central FIPS 3002
- <esri102314> : NAD 1983 HARN StatePlane New Mexico West FIPS 3003
- <esri102315> : NAD 1983 HARN StatePlane New York East FIPS 3101
- <esri102316> : NAD 1983 HARN StatePlane New York Central FIPS 3102
- <esri102317> : NAD 1983 HARN StatePlane New York West FIPS 3103
- <esri102318> : NAD 1983 HARN StatePlane New York Long Island FIPS 3104
- <esri102320> : NAD 1983 HARN StatePlane North Dakota North FIPS 3301
- <esri102321> : NAD 1983 HARN StatePlane North Dakota South FIPS 3302
- <esri102322> : NAD 1983 HARN StatePlane Ohio North FIPS 3401
- <esri102323> : NAD 1983 HARN StatePlane Ohio South FIPS 3402
- <esri102324> : NAD 1983 HARN StatePlane Oklahoma North FIPS 3501
- <esri102325> : NAD 1983 HARN StatePlane Oklahoma South FIPS 3502
- <esri102326> : NAD 1983 HARN StatePlane Oregon North FIPS 3601
- <esri102327> : NAD 1983 HARN StatePlane Oregon South FIPS 3602
- <esri102330> : NAD 1983 HARN StatePlane Rhode Island FIPS 3800
- <esri102334> : NAD 1983 HARN StatePlane South Dakota North FIPS 4001
- <esri102335> : NAD 1983 HARN StatePlane South Dakota South FIPS 4002
- <esri102336> : NAD 1983 HARN StatePlane Tennessee FIPS 4100
- <esri102337> : NAD 1983 HARN StatePlane Texas North FIPS 4201
- <esri102338> : NAD 1983 HARN StatePlane Texas North Central FIPS 4202
- <esri102339> : NAD 1983 HARN StatePlane Texas Central FIPS 4203
- <esri102340> : NAD 1983 HARN StatePlane Texas South Central FIPS 4204
- <esri102341> : NAD 1983 HARN StatePlane Texas South FIPS 4205
- <esri102342> : NAD 1983 HARN StatePlane Utah North FIPS 4301
- <esri102343> : NAD 1983 HARN StatePlane Utah Central FIPS 4302
- <esri102344> : NAD 1983 HARN StatePlane Utah South FIPS 4303
- <esri102345> : NAD 1983 HARN StatePlane Vermont FIPS 4400
- <esri102346> : NAD 1983 HARN StatePlane Virginia North FIPS 4501
- <esri102347> : NAD 1983 HARN StatePlane Virginia South FIPS 4502
- <esri102348> : NAD 1983 HARN StatePlane Washington North FIPS 4601
- <esri102349> : NAD 1983 HARN StatePlane Washington South FIPS 4602
- <esri102350> : NAD 1983 HARN StatePlane West Virginia North FIPS 4701
- <esri102351> : NAD 1983 HARN StatePlane West Virginia South FIPS 4702
- <esri102352> : NAD 1983 HARN StatePlane Wisconsin North FIPS 4801
- <esri102353> : NAD 1983 HARN StatePlane Wisconsin Central FIPS 4802
- <esri102354> : NAD 1983 HARN StatePlane Wisconsin South FIPS 4803
- <esri102355> : NAD 1983 HARN StatePlane Wyoming East FIPS 4901
- <esri102356> : NAD 1983 HARN StatePlane Wyoming East Central FIPS 4902
- <esri102357> : NAD 1983 HARN StatePlane Wyoming West Central FIPS 4903
- <esri102358> : NAD 1983 HARN StatePlane Wyoming West FIPS 4904
- <esri102361> : NAD 1983 HARN StatePlane Puerto Rico Virgin Islands FIPS 5200
- <esri102491> : Nord Algerie Ancienne Degree
- <esri102492> : Sud Algerie Ancienne Degree
- <esri102581> : NTF France I degrees
- <esri102582> : NTF France II degrees
- <esri102583> : NTF France III degrees
- <esri102584> : NTF France IV degrees
- <esri102591> : Nord Algerie Degree
- <esri102592> : Sud Algerie Degree
- <esri102629> : NAD 1983 StatePlane Alabama East FIPS 0101 Feet
- <esri102630> : NAD 1983 StatePlane Alabama West FIPS 0102 Feet
- <esri102631> : NAD 1983 StatePlane Alaska 1 FIPS 5001 Feet
- <esri102632> : NAD 1983 StatePlane Alaska 2 FIPS 5002 Feet
- <esri102633> : NAD 1983 StatePlane Alaska 3 FIPS 5003 Feet
- <esri102634> : NAD 1983 StatePlane Alaska 4 FIPS 5004 Feet
- <esri102635> : NAD 1983 StatePlane Alaska 5 FIPS 5005 Feet
- <esri102636> : NAD 1983 StatePlane Alaska 6 FIPS 5006 Feet
- <esri102637> : NAD 1983 StatePlane Alaska 7 FIPS 5007 Feet
- <esri102638> : NAD 1983 StatePlane Alaska 8 FIPS 5008 Feet
- <esri102639> : NAD 1983 StatePlane Alaska 9 FIPS 5009 Feet
- <esri102640> : NAD 1983 StatePlane Alaska 10 FIPS 5010 Feet
- <esri102641> : NAD 1983 StatePlane California I FIPS 0401 Feet
- <esri102642> : NAD 1983 StatePlane California II FIPS 0402 Feet
- <esri102643> : NAD 1983 StatePlane California III FIPS 0403 Feet
- <esri102644> : NAD 1983 StatePlane California IV FIPS 0404 Feet
- <esri102645> : NAD 1983 StatePlane California V FIPS 0405 Feet
- <esri102646> : NAD 1983 StatePlane California VI FIPS 0406 Feet
- <esri102648> : NAD 1983 StatePlane Arizona East FIPS 0201 Feet
- <esri102649> : NAD 1983 StatePlane Arizona Central FIPS 0202 Feet
- <esri102650> : NAD 1983 StatePlane Arizona West FIPS 0203 Feet
- <esri102651> : NAD 1983 StatePlane Arkansas North FIPS 0301 Feet
- <esri102652> : NAD 1983 StatePlane Arkansas South FIPS 0302 Feet
- <esri102653> : NAD 1983 StatePlane Colorado North FIPS 0501 Feet
- <esri102654> : NAD 1983 StatePlane Colorado Central FIPS 0502 Feet
- <esri102655> : NAD 1983 StatePlane Colorado South FIPS 0503 Feet
- <esri102656> : NAD 1983 StatePlane Connecticut FIPS 0600 Feet
- <esri102657> : NAD 1983 StatePlane Delaware FIPS 0700 Feet
- <esri102658> : NAD 1983 StatePlane Florida East FIPS 0901 Feet
- <esri102659> : NAD 1983 StatePlane Florida West FIPS 0902 Feet
- <esri102660> : NAD 1983 StatePlane Florida North FIPS 0903 Feet
- <esri102661> : NAD 1983 StatePlane Hawaii 1 FIPS 5101 Feet
- <esri102662> : NAD 1983 StatePlane Hawaii 2 FIPS 5102 Feet
- <esri102663> : NAD 1983 StatePlane Hawaii 3 FIPS 5103 Feet
- <esri102664> : NAD 1983 StatePlane Hawaii 4 FIPS 5104 Feet
- <esri102665> : NAD 1983 StatePlane Hawaii 5 FIPS 5105 Feet
- <esri102666> : NAD 1983 StatePlane Georgia East FIPS 1001 Feet
- <esri102667> : NAD 1983 StatePlane Georgia West FIPS 1002 Feet
- <esri102668> : NAD 1983 StatePlane Idaho East FIPS 1101 Feet
- <esri102669> : NAD 1983 StatePlane Idaho Central FIPS 1102 Feet
- <esri102670> : NAD 1983 StatePlane Idaho West FIPS 1103 Feet
- <esri102671> : NAD 1983 StatePlane Illinois East FIPS 1201 Feet
- <esri102672> : NAD 1983 StatePlane Illinois West FIPS 1202 Feet
- <esri102673> : NAD 1983 StatePlane Indiana East FIPS 1301 Feet
- <esri102674> : NAD 1983 StatePlane Indiana West FIPS 1302 Feet
- <esri102675> : NAD 1983 StatePlane Iowa North FIPS 1401 Feet
- <esri102676> : NAD 1983 StatePlane Iowa South FIPS 1402 Feet
- <esri102677> : NAD 1983 StatePlane Kansas North FIPS 1501 Feet
- <esri102678> : NAD 1983 StatePlane Kansas South FIPS 1502 Feet
- <esri102679> : NAD 1983 StatePlane Kentucky North FIPS 1601 Feet
- <esri102680> : NAD 1983 StatePlane Kentucky South FIPS 1602 Feet
- <esri102681> : NAD 1983 StatePlane Louisiana North FIPS 1701 Feet
- <esri102682> : NAD 1983 StatePlane Louisiana South FIPS 1702 Feet
- <esri102683> : NAD 1983 StatePlane Maine East FIPS 1801 Feet
- <esri102684> : NAD 1983 StatePlane Maine West FIPS 1802 Feet
- <esri102685> : NAD 1983 StatePlane Maryland FIPS 1900 Feet
- <esri102686> : NAD 1983 StatePlane Massachusetts Mainland FIPS 2001 Feet
- <esri102687> : NAD 1983 StatePlane Massachusetts Island FIPS 2002 Feet
- <esri102688> : NAD 1983 StatePlane Michigan North FIPS 2111 Feet
- <esri102689> : NAD 1983 StatePlane Michigan Central FIPS 2112 Feet
- <esri102690> : NAD 1983 StatePlane Michigan South FIPS 2113 Feet
- <esri102691> : NAD 1983 StatePlane Minnesota North FIPS 2201 Feet
- <esri102692> : NAD 1983 StatePlane Minnesota Central FIPS 2202 Feet
- <esri102693> : NAD 1983 StatePlane Minnesota South FIPS 2203 Feet
- <esri102694> : NAD 1983 StatePlane Mississippi East FIPS 2301 Feet
- <esri102695> : NAD 1983 StatePlane Mississippi West FIPS 2302 Feet
- <esri102696> : NAD 1983 StatePlane Missouri East FIPS 2401 Feet
- <esri102697> : NAD 1983 StatePlane Missouri Central FIPS 2402 Feet
- <esri102698> : NAD 1983 StatePlane Missouri West FIPS 2403 Feet
- <esri102700> : NAD 1983 StatePlane Montana FIPS 2500 Feet
- <esri102704> : NAD 1983 StatePlane Nebraska FIPS 2600 Feet
- <esri102707> : NAD 1983 StatePlane Nevada East FIPS 2701 Feet
- <esri102708> : NAD 1983 StatePlane Nevada Central FIPS 2702 Feet
- <esri102709> : NAD 1983 StatePlane Nevada West FIPS 2703 Feet
- <esri102710> : NAD 1983 StatePlane New Hampshire FIPS 2800 Feet
- <esri102711> : NAD 1983 StatePlane New Jersey FIPS 2900 Feet
- <esri102712> : NAD 1983 StatePlane New Mexico East FIPS 3001 Feet
- <esri102713> : NAD 1983 StatePlane New Mexico Central FIPS 3002 Feet
- <esri102714> : NAD 1983 StatePlane New Mexico West FIPS 3003 Feet
- <esri102715> : NAD 1983 StatePlane New York East FIPS 3101 Feet
- <esri102716> : NAD 1983 StatePlane New York Central FIPS 3102 Feet
- <esri102717> : NAD 1983 StatePlane New York West FIPS 3103 Feet
- <esri102718> : NAD 1983 StatePlane New York Long Island FIPS 3104 Feet
- <esri102719> : NAD 1983 StatePlane North Carolina FIPS 3200 Feet
- <esri102720> : NAD 1983 StatePlane North Dakota North FIPS 3301 Feet
- <esri102721> : NAD 1983 StatePlane North Dakota South FIPS 3302 Feet
- <esri102722> : NAD 1983 StatePlane Ohio North FIPS 3401 Feet
- <esri102723> : NAD 1983 StatePlane Ohio South FIPS 3402 Feet
- <esri102724> : NAD 1983 StatePlane Oklahoma North FIPS 3501 Feet
- <esri102725> : NAD 1983 StatePlane Oklahoma South FIPS 3502 Feet
- <esri102726> : NAD 1983 StatePlane Oregon North FIPS 3601 Feet
- <esri102727> : NAD 1983 StatePlane Oregon South FIPS 3602 Feet
- <esri102728> : NAD 1983 StatePlane Pennsylvania North FIPS 3701 Feet
- <esri102729> : NAD 1983 StatePlane Pennsylvania South FIPS 3702 Feet
- <esri102730> : NAD 1983 StatePlane Rhode Island FIPS 3800 Feet
- <esri102733> : NAD 1983 StatePlane South Carolina FIPS 3900 Feet
- <esri102734> : NAD 1983 StatePlane South Dakota North FIPS 4001 Feet
- <esri102735> : NAD 1983 StatePlane South Dakota South FIPS 4002 Feet
- <esri102736> : NAD 1983 StatePlane Tennessee FIPS 4100 Feet
- <esri102737> : NAD 1983 StatePlane Texas North FIPS 4201 Feet
- <esri102738> : NAD 1983 StatePlane Texas North Central FIPS 4202 Feet
- <esri102739> : NAD 1983 StatePlane Texas Central FIPS 4203 Feet
- <esri102740> : NAD 1983 StatePlane Texas South Central FIPS 4204 Feet
- <esri102741> : NAD 1983 StatePlane Texas South FIPS 4205 Feet
- <esri102742> : NAD 1983 StatePlane Utah North FIPS 4301 Feet
- <esri102743> : NAD 1983 StatePlane Utah Central FIPS 4302 Feet
- <esri102744> : NAD 1983 StatePlane Utah South FIPS 4303 Feet
- <esri102745> : NAD 1983 StatePlane Vermont FIPS 4400 Feet
- <esri102746> : NAD 1983 StatePlane Virginia North FIPS 4501 Feet
- <esri102747> : NAD 1983 StatePlane Virginia South FIPS 4502 Feet
- <esri102748> : NAD 1983 StatePlane Washington North FIPS 4601 Feet
- <esri102749> : NAD 1983 StatePlane Washington South FIPS 4602 Feet
- <esri102750> : NAD 1983 StatePlane West Virginia North FIPS 4701 Feet
- <esri102751> : NAD 1983 StatePlane West Virginia South FIPS 4702 Feet
- <esri102752> : NAD 1983 StatePlane Wisconsin North FIPS 4801 Feet
- <esri102753> : NAD 1983 StatePlane Wisconsin Central FIPS 4802 Feet
- <esri102754> : NAD 1983 StatePlane Wisconsin South FIPS 4803 Feet
- <esri102755> : NAD 1983 StatePlane Wyoming East FIPS 4901 Feet
- <esri102756> : NAD 1983 StatePlane Wyoming East Central FIPS 4902 Feet
- <esri102757> : NAD 1983 StatePlane Wyoming West Central FIPS 4903 Feet
- <esri102758> : NAD 1983 StatePlane Wyoming West FIPS 4904 Feet
- <esri102761> : NAD 1983 StatePlane Puerto Rico Virgin Islands FIPS 5200 Feet
- <esri102766> : NAD 1983 StatePlane Guam FIPS 5400 Feet
- <esri103300> : Belge Lambert 1972
- <esri4023> : GCS International 1967
- <esri4217> : GCS Bern 1898
- <esri4305> : GCS Voirol Unifie 1960
- <esri4404> : GCS Montserrat 1958
- <esri4812> : GCS Voirol Unifie 1960 Paris
- <esri37001> : GCS WGS 1966
- <esri37002> : GCS Fischer 1960
- <esri37003> : GCS Fischer 1968
- <esri37004> : GCS Fischer Modified
- <esri37005> : GCS Hough 1960
- <esri37006> : GCS Everest Modified 1969
- <esri37007> : GCS Walbeck
- <esri37008> : GCS Sphere ARC INFO
- <esri37201> : GCS European 1979
- <esri37202> : GCS Everest Bangladesh
- <esri37203> : GCS Everest India Nepal
- <esri37204> : GCS Hjorsey 1955
- <esri37205> : GCS Hong Kong 1963
- <esri37206> : GCS Oman
- <esri37207> : GCS South Asia Singapore
- <esri37208> : GCS Ayabelle
- <esri37211> : GCS Point 58
- <esri37212> : GCS Beacon E 1945
- <esri37213> : GCS Tern Island 1961
- <esri37214> : GCS Astro 1952
- <esri37215> : GCS Bellevue IGN
- <esri37216> : GCS Canton 1966
- <esri37217> : GCS Chatham Island 1971
- <esri37218> : GCS DOS 1968
- <esri37219> : GCS Easter Island 1967
- <esri37220> : GCS Guam 1963
- <esri37221> : GCS GUX 1
- <esri37222> : GCS Johnston Island 1961
- <esri37223> : GCS Carthage Degree
- <esri37224> : GCS Midway 1961
- <esri37226> : GCS Pitcairn 1967
- <esri37227> : GCS Santo DOS 1965
- <esri37228> : GCS Viti Levu 1916
- <esri37229> : GCS Wake Eniwetok 1960
- <esri37230> : GCS Wake Island 1952
- <esri37231> : GCS Anna 1 1965
- <esri37232> : GCS Gan 1970
- <esri37233> : GCS ISTS 073 1969
- <esri37234> : GCS Kerguelen Island 1949
- <esri37235> : GCS Reunion
- <esri37237> : GCS Ascension Island 1958
- <esri37238> : GCS DOS 71 4
- <esri37239> : GCS Cape Canaveral
- <esri37240> : GCS Fort Thomas 1955
- <esri37241> : GCS Graciosa Base SW 1948
- <esri37242> : GCS ISTS 061 1968
- <esri37243> : GCS LC5 1961
- <esri37245> : GCS Observ Meteorologico 1939
- <esri37246> : GCS Pico de Las Nieves
- <esri37247> : GCS Porto Santo 1936
- <esri37249> : GCS Sao Braz
- <esri37250> : GCS Selvagem Grande 1938
- <esri37251> : GCS Tristan 1968
- <esri37252> : GCS Samoa 1962
- <esri37253> : GCS Camp Area
- <esri37254> : GCS Deception Island
- <esri37255> : GCS Gunung Segara
- <esri37257> : GCS S42 Hungary
- <esri37259> : GCS Kusaie 1951
- <esri37260> : GCS Alaskan Islands
- <esri104000> : GCS Assumed Geographic 1
- <esri104101> : GCS Estonia 1937
- <esri104102> : GCS Hermannskogel
- <esri104103> : GCS Sierra Leone 1960
- <esri104104> : GCS Hong Kong 1980
- <esri104105> : GCS Datum Lisboa Bessel
- <esri104106> : GCS Datum Lisboa Hayford
- <esri104107> : GCS RGF 1993
- <esri104108> : GCS NZGD 2000
- <esri104261> : GCS Merchich Degree
- <esri104304> : GCS Voirol 1875 Degree
- <esri104305> : GCS Voirol Unifie 1960 Degree
-
- \---------------------------------------------------------
- Google mercator
- \---------------------------------------------------------
- <900913> Chris' funny epsgish code for the google mercator
-
- \---------------------------------------------------------
- IGNF (French Mapping Agency) projection definitions
- \---------------------------------------------------------
- <ANAA92> : MOP92 (Anaa) Tuamotu
- <APAT86> : MOP86 (Apataki, Rapa, Hao) Tuamotu
- <ATI> : Ancienne Triangulation des Ingenieurs
- <CAD97> : Cadastre 1997
- <CIOBIH> : CIO-BIH
- <CROZ63> : Crozet 1963
- <CSG67> : Guyane CSG67
- <ED50> : ED50
- <EFATE57> : EFATE-IGN 1957
- <FANGA84> : MOP84 (Fangataufa 1984)
- <GUAD48> : Guadeloupe Ste Anne
- <GUADFM49> : Guadeloupe Fort Marigot
- <IGN63> : IGN 1963 (Hiva Oa, Tahuata, Mohotani)
- <IGN72> : IGN 1972 Grande-Terre / Ile des Pins
- <KAUE70> : MHPF70 (Kauehi) Tuamotu
- <KERG62CAR> : Kerguelen \- K0
- <LIFOU56> : Lifou \- Iles Loyaute (IGN56)
- <LUREF> : Nouvelle Triangulation du Grand Duche du Luxembourg
- <MARE53> : Mare \- Iles Loyaute (IGN53)
- <MARQUI72> : IGN 1972 (Eiao, Hiva Oa, Mohotani) Marquises
- <MART38> : Martinique Fort-Desaix
- <MAYO50> : Mayotte Combani
- <MHEFO55F> : MHEFO 1955 (Fatu Huku)
- <MHPF67> : MHPF67 (Mangareva, Agakauitai, Aukena, Mekiro) Gambiers (Iles)
- <MOOREA87> : Moorea 1987
- <MOP90> : MOP90 (Tetiaroa) Iles de la Societe
- <NTF> : Nouvelle Triangulation Francaise
- <NUKU72> : IGN 1972 Nuku Hiva
- <NUKU94> : SAT94 (Nukutavake) Tuamotu
- <OUVEA72CAR> : Ouvea \- Iles Loyaute (MHNC 1972 \- OUVEA)
- <PETRELS72> : Petrels \- IGN 1972
- <RAIA53> : IGN53 (IGN Raiatea-Tahaa) Raiatea-Tahaa-Bora Bora-Huahine
- <REUN47> : Reunion 1947
- <RGF93> : Reseau geodesique francais 1993
- <RGFG95> : Reseau geodesique francais de Guyane 1995
- <RGM04> : RGM04 (Reseau Geodesique de Mayotte 2004)
- <RGNC> : Reseau Geodesique de Nouvelle-Caledonie
- <RGPF> : RGPF (Reseau Geodesique de Polynesie Francaise)
- <RGR92> : Reseau geodesique Reunion 1992
- <RGSPM06> : Reseau Geodesique Saint-Pierre-et-Miquelon (2006)
- <RRAF91> : RRAF 1991 (Reseau de Reference des Antilles Francaises)
- <SAT84> : SAT84 (Rurutu) Iles Australes
- <SHOM84> : SHOM 1984 Martinique Montagne Du Vauclin
- <STPM50> : St Pierre et Miquelon 1950
- <TAHAA> : Raiatea \- Tahaa 51-54 (Tahaa, Base Terme Est)
- <TAHI51> : Tahiti-Terme Nord 1951
- <TAHI79> : IGN79 (Tahiti) Iles de la Societe
- <TANNA> : Tanna Bloc Sud
- <TERA50> : Pointe Geologie \- Perroud 1950
- <TUBU69> : MHPF 1969 (Tubuai) Iles Australes
- <WALL78> : Wallis-Uvea 1978 (MOP78)
- <WGS72> : World Geodetic System 1972
- <WGS84> : World Geodetic System 1984
- <ANAA92GEO> : MOP92 (Anaa) Tuamotu
- <APAT86GEO> : MOP86 (Apataki, Rapa, Hao) Tuamotu
- <ATIGEO> : Ancienne Triangulation des Ingenieurs
- <CAD97GEO> : Cadastre 1997
- <CROZ63GEO> : Crozet 1963
- <CSG67GEO> : Guyane CSG67 UTM fuseau 21
- <ED50G> : ED50
- <EFATE57GEO> : EFATE-IGN 1957
- <FANGA84GEO> : MOP84 (Fangataufa 1984)
- <GUAD48GEO> : Guadeloupe Ste Anne
- <GUADFM49GEO> : Guadeloupe Fort Marigot
- <IGN63GEO> : IGN 1963 (Hiva Oa, Tahuata, Mohotani)
- <IGN72GEO> : IGN 1972 Grande-Terre / Ile des Pins
- <KAUE70GEO> : MHPF70 (Kauehi) Tuamotu
- <KERG62GEO> : Kerguelen \- K0
- <LIFOU56GEO> : Lifou \- Iles Loyaute (IGN56)
- <LUXGEO> : Nouvelle Triangulation du Grand Duche du Luxembourg
- <MARE53GEO> : Mare \- Iles Loyaute (IGN53)
- <MARQUI72GEO> : IGN 1972 (Eiao, Hiva Oa, Mohotani) Marquises
- <MART38GEO> : Martinique Fort-Desaix
- <MAYO50GEO> : Mayotte Combani
- <MHEFO55FGEO> : MHEFO 1955 (Fatu Huku)
- <MHPF67GEO> : MHPF67 (Mangareva, Agakauitai, Aukena, Mekiro) Gambiers (Iles)
- <MOOREA87GEO> : Moorea 1987
- <MOP90GEO> : MOP90 (Tetiaroa) Iles de la Societe
- <NTFG> : Nouvelle Triangulation Francaise Greenwich degres sexagesimaux
- <NTFP> : Nouvelle Triangulation Francaise Paris grades
- <NUKU72GEO> : IGN 1972 Nuku Hiva
- <NUKU94GEO> : SAT94 (Nukutavake) Tuamotu
- <OUVEA72GEO> : Ouvea \- Iles Loyaute (MHNC 1972 \- OUVEA)
- <RAIA53GEO> : IGN53 (IGN Raiatea-Tahaa) Raiatea-Tahaa-Bora Bora-Huahine
- <REUN47GEO> : Reunion 1947
- <RGF93G> : Reseau geodesique francais 1993
- <RGFG95GEO> : Reseau geodesique francais de Guyane 1995
- <RGM04GEO> : RGM04 (Reseau Geodesique de Mayotte 2004)
- <RGNCGEO> : Reseau Geodesique de Nouvelle-Caledonie
- <RGPFGEO> : RGPF (Reseau Geodesique de Polynesie Francaise)
- <RGR92GEO> : Reseau geodesique de la Reunion 1992
- <RGSPM06GEO> : Saint-Pierre-et-Miquelon (2006)
- <SAT84GEO> : SAT84 (Rurutu) Iles Australes
- <SHOM84GEO> : SHOM 1984 Martinique Montagne Du Vauclin
- <STPM50GEO> : St Pierre et Miquelon 1950
- <TAHAAGEO> : Raiatea \- Tahaa 51-54 (Tahaa, Base Terme Est)
- <TAHI51GEO> : Tahiti-Terme Nord 1951
- <TAHI79GEO> : IGN79 (Tahiti) Iles de la Societe
- <TANNAGEO> : Tanna Bloc Sud
- <TERA50GEO> : Pointe Geologie \- Perroud 1950
- <TUBU69GEO> : MHPF 1969 (Tubuai) Iles Australes
- <WALL78GEO> : Wallis \- Uvea 1978 (MOP78)
- <WGS72G> : WGS72
- <WGS84G> : World Geodetic System 1984
- <WGS84RRAFGEO> : Reseau de reference des Antilles francaises (1988-1991)
- <XGEO> : Systeme CIO-BIH
- <ANAA92UTM6S> : MOP92 (Anaa) Tuamotu \- UTM fuseau 6 Sud
- <APAT86UTM6S> : MOP86 (Apataki, Rapa, Hao) Tuamotu \- UTM fuseau 6 Sud
- <APAT86UTM7S> : MOP86 (Apataki, Rapa, Hao) Tuamotu \- UTM fuseau 7 Sud
- <CAD97UTM38S> : Cadastre 1997 \- UTM fuseau 38 Sud
- <CROZ63UTM39S> : Crozet 1963
- <CSG67UTM21> : Guyane CSG67 UTM fuseau 21
- <CSG67UTM22> : Guyane CSG67 UTM fuseau 22
- <EFATE57UT59S> : EFATE-IGN 1957 \- UTM fuseau 59 Sud
- <FANGA84UTM7S> : Fangataufa 1984 \- UTM fuseau 7 Sud
- <GEOPORTALANF> : Geoportail \- Antilles francaises
- <GEOPORTALCRZ> : Geoportail \- Crozet
- <GEOPORTALFXX> : Geoportail \- France metropolitaine
- <GEOPORTALGUF> : Geoportail \- Guyane
- <GEOPORTALKER> : Geoportail \- Kerguelen
- <GEOPORTALMYT> : Geoportail \- Mayotte
- <GEOPORTALNCL> : Geoportail \- Nouvelle-Caledonie
- <GEOPORTALPYF> : Geoportail \- Polynesie francaise
- <GEOPORTALREU> : Geoportail \- Reunion et dependances
- <GEOPORTALSPM> : Geoportail \- Saint-Pierre et Miquelon
- <GEOPORTALWLF> : Geoportail \- Wallis et Futuna
- <GUAD48UTM20> : Guadeloupe Ste Anne
- <GUADFM49U20> : Guadeloupe Fort Marigot
- <IGN63UTM7S> : IGN 1963 \- Hiva Oa, Tahuata, Mohotani \- UTM fuseau 7 Sud
- <IGN72LAM> : IGN 1972 \- Lambert Nouvelle Caledonie
- <IGN72UTM58S> : IGN 1972 \- UTM fuseau 58 Sud
- <KAUE70UTM6S> : MHPF70 (Kauehi) Tuamotu \- UTM fuseau 6 Sud
- <KERG62UTM42S> : Kerguelen 1962
- <LAMB1> : Lambert I
- <LAMB1C> : Lambert I Carto
- <LAMB2> : Lambert II
- <LAMB2C> : Lambert II Carto
- <LAMB3> : Lambert III
- <LAMB3C> : Lambert III Carto
- <LAMB4> : Lambert IV
- <LAMB4C> : Lambert IV Carto
- <LAMB93> : Lambert 93
- <LAMBE> : Lambert II etendu
- <LAMBGC> : Lambert grand champ
- <LUXGAUSSK> : Luxembourg 1929
- <MARE53UTM58S> : Mare \- Iles Loyaute \- UTM fuseau 58 Sud
- <MART38UTM20> : Martinique Fort-Desaix
- <MAYO50UTM38S> : Mayotte Combani
- <MHPF67UTM8S> : MHPF67 (Mangareva, Agakauitai, Aukena, Mekiro) Gambiers (Iles) \- UTM 8 S
- <MILLER> : Geoportail \- Monde
- <MOOREA87U6S> : Moorea 1987 \- UTM fuseau 6 Sud
- <MOP90UTM6S> : MOP90 (Tetiaroa) Iles de la Societe \- UTM fuseau 6 Sud
- <NUKU72U7S> : IGN 1972 Nuku Hiva \- UTM fuseau 7 Sud
- <NUKU94UTM7S> : IGN 1994 Nuku Hiva \- UTM fuseau 7 Sud
- <OUVEA72U58S> : Ouvea \- Iles Loyaute \- UTM fuseau 58 Sud
- <RAIA53UTM5S> : IGN53 (IGN Raiatea-Tahaa) Raiatea-Tahaa-Bora Bora-Huahine \- UTM fuseau 5
- <REUN47GAUSSL> : Reunion Gauss Laborde
- <RGF93CC42> : Projection conique conforme Zone 1
- <RGF93CC43> : Projection conique conforme Zone 2
- <RGF93CC44> : Projection conique conforme Zone 3
- <RGF93CC45> : Projection conique conforme Zone 4
- <RGF93CC46> : Projection conique conforme Zone 5
- <RGF93CC47> : Projection conique conforme Zone 6
- <RGF93CC48> : Projection conique conforme Zone 7
- <RGF93CC49> : Projection conique conforme Zone 8
- <RGF93CC50> : Projection conique conforme Zone 9
- <RGM04UTM38S> : UTM fuseau 38 Sud (Reseau Geodesique de Mayotte 2004)
- <RGNCLAM> : Reseau Geodesique de Nouvelle-Caledonie \- Lambert Nouvelle Caledonie
- <RGNCUTM57S> : Reseau Geodesique de Nouvelle-Caledonie \- UTM fuseau 57 Sud
- <RGNCUTM58S> : Reseau Geodesique de Nouvelle-Caledonie \- UTM fuseau 58 Sud
- <RGNCUTM59S> : Reseau Geodesique de Nouvelle-Caledonie \- UTM fuseau 59 Sud
- <RGPFUTM5S> : RGPF \- UTM fuseau 5 Sud
- <RGPFUTM6S> : RGPF \- UTM fuseau 6 Sud
- <RGPFUTM7S> : RGPF \- UTM fuseau 7 Sud
- <RGR92UTM40S> : RGR92 UTM fuseau 40 Sud
- <RGSPM06U21> : Saint-Pierre-et-Miquelon (2006) UTM Fuseau 21 Nord
- <SAT84UTM5S> : SAT84 (Rurutu) Iles Australes \- UTM fuseau 5 Sud
- <STEREOSX> : Stereographique polaire Sud
- <STPM50UTM21> : St Pierre et Miquelon 1950
- <TAHAAUTM05S> : Tahaa 1951
- <TAHI51UTM06S> : Tahiti-Terme Nord UTM fuseau 6 Sud
- <TAHI79UTM6S> : Tahiti 1979
- <TANNAUTM59S> : Tanna Bloc Sud \- UTM fuseau 59 Sud
- <TERA50SPTA> : Terre Adelie Stereo polaire Terre Adelie
- <TERA50STEREO> : Terre Adelie 1950
- <TUBU69UTM6S> : Tubuai \- Iles Australes \- UTM fuseau 6 Sud
- <UTM01SW72> : World Geodetic System 1972 UTM fuseau 01 Sud
- <UTM01SW84> : World Geodetic System 1984 UTM fuseau 01 Sud
- <UTM01W84> : World Geodetic System 1984 UTM fuseau 01
- <UTM02SW84> : World Geodetic System 1984 UTM fuseau 02 Sud
- <UTM02W84> : World Geodetic System 1984 UTM fuseau 02
- <UTM03SW84> : World Geodetic System 1984 UTM fuseau 03 Sud
- <UTM03W84> : World Geodetic System 1984 UTM fuseau 03
- <UTM04SW84> : World Geodetic System 1984 UTM fuseau 04 Sud
- <UTM04W84> : World Geodetic System 1984 UTM fuseau 04
- <UTM05SW84> : World Geodetic System 1984 UTM fuseau 05 Sud
- <UTM05W84> : World Geodetic System 1984 UTM fuseau 05
- <UTM06SW84> : World Geodetic System 1984 UTM fuseau 06 Sud
- <UTM06W84> : World Geodetic System 1984 UTM fuseau 06
- <UTM07SW84> : World Geodetic System 1984 UTM fuseau 07 Sud
- <UTM07W84> : World Geodetic System 1984 UTM fuseau 07
- <UTM08SW84> : World Geodetic System 1984 UTM fuseau 08 Sud
- <UTM08W84> : World Geodetic System 1984 UTM fuseau 08
- <UTM09SW84> : World Geodetic System 1984 UTM fuseau 09 Sud
- <UTM09W84> : World Geodetic System 1984 UTM fuseau 09
- <UTM10SW84> : World Geodetic System 1984 UTM fuseau 10 Sud
- <UTM10W84> : World Geodetic System 1984 UTM fuseau 10
- <UTM11SW84> : World Geodetic System 1984 UTM fuseau 11 Sud
- <UTM11W84> : World Geodetic System 1984 UTM fuseau 11
- <UTM12SW84> : World Geodetic System 1984 UTM fuseau 12 Sud
- <UTM12W84> : World Geodetic System 1984 UTM fuseau 12
- <UTM13SW84> : World Geodetic System 1984 UTM fuseau 13 Sud
- <UTM13W84> : World Geodetic System 1984 UTM fuseau 13
- <UTM14SW84> : World Geodetic System 1984 UTM fuseau 14 Sud
- <UTM14W84> : World Geodetic System 1984 UTM fuseau 14
- <UTM15SW84> : World Geodetic System 1984 UTM fuseau 15 Sud
- <UTM15W84> : World Geodetic System 1984 UTM fuseau 15
- <UTM16SW84> : World Geodetic System 1984 UTM fuseau 16 Sud
- <UTM16W84> : World Geodetic System 1984 UTM fuseau 16
- <UTM17SW84> : World Geodetic System 1984 UTM fuseau 17 Sud
- <UTM17W84> : World Geodetic System 1984 UTM fuseau 17
- <UTM18SW84> : World Geodetic System 1984 UTM fuseau 18 Sud
- <UTM18W84> : World Geodetic System 1984 UTM fuseau 18
- <UTM19SW84> : World Geodetic System 1984 UTM fuseau 19 Sud
- <UTM19W84> : World Geodetic System 1984 UTM fuseau 19
- <UTM20SW84> : World Geodetic System 1984 UTM fuseau 20 Sud
- <UTM20W84> : World Geodetic System 1984 UTM fuseau 20
- <UTM20W84GUAD> : World Geodetic System 1984 UTM fuseau 20 Nord-Guadeloupe
- <UTM20W84MART> : World Geodetic System 1984 UTM fuseau 20 Nord-Martinique
- <UTM21SW84> : World Geodetic System 1984 UTM fuseau 21 Sud
- <UTM21W84> : World Geodetic System 1984 UTM fuseau 21
- <UTM22RGFG95> : RGFG95 UTM fuseau 22 Nord-Guyane
- <UTM22SW84> : World Geodetic System 1984 UTM fuseau 22 Sud
- <UTM22W84> : World Geodetic System 1984 UTM fuseau 22
- <UTM23SW84> : World Geodetic System 1984 UTM fuseau 23 Sud
- <UTM23W84> : World Geodetic System 1984 UTM fuseau 23
- <UTM24SW84> : World Geodetic System 1984 UTM fuseau 24 Sud
- <UTM24W84> : World Geodetic System 1984 UTM fuseau 24
- <UTM25SW84> : World Geodetic System 1984 UTM fuseau 25 Sud
- <UTM25W84> : World Geodetic System 1984 UTM fuseau 25
- <UTM26SW84> : World Geodetic System 1984 UTM fuseau 26 Sud
- <UTM26W84> : World Geodetic System 1984 UTM fuseau 26
- <UTM27SW84> : World Geodetic System 1984 UTM fuseau 27 Sud
- <UTM27W84> : World Geodetic System 1984 UTM fuseau 27
- <UTM28SW84> : World Geodetic System 1984 UTM fuseau 28 Sud
- <UTM28W84> : World Geodetic System 1984 UTM fuseau 28
- <UTM29SW84> : World Geodetic System 1984 UTM fuseau 29 Sud
- <UTM29W84> : World Geodetic System 1984 UTM fuseau 29
- <UTM30> : European Datum 1950 UTM fuseau 30
- <UTM30RGF93> : RGF93 UTM fuseau 30
- <UTM30SW84> : World Geodetic System 1984 UTM fuseau 30 Sud
- <UTM30W72> : World Geodetic System 1972 UTM fuseau 30
- <UTM30W84> : World Geodetic System 1984 UTM fuseau 30
- <UTM31> : European Datum 1950 UTM fuseau 31
- <UTM31RGF93> : RGF93 UTM fuseau 31
- <UTM31SW84> : World Geodetic System 1984 UTM fuseau 31 Sud
- <UTM31W72> : World Geodetic System 1972 UTM fuseau 31
- <UTM31W84> : World Geodetic System 1984 UTM fuseau 31
- <UTM32> : European Datum 1950 UTM fuseau 32
- <UTM32RGF93> : RGF93 UTM fuseau 32
- <UTM32SW84> : World Geodetic System 1984 UTM fuseau 32 Sud
- <UTM32W72> : World Geodetic System 1972 UTM fuseau 32
- <UTM32W84> : World Geodetic System 1984 UTM fuseau 32
- <UTM33SW84> : World Geodetic System 1984 UTM fuseau 33 Sud
- <UTM33W84> : World Geodetic System 1984 UTM fuseau 33
- <UTM34SW84> : World Geodetic System 1984 UTM fuseau 34 Sud
- <UTM34W84> : World Geodetic System 1984 UTM fuseau 34
- <UTM35SW84> : World Geodetic System 1984 UTM fuseau 35 Sud
- <UTM35W84> : World Geodetic System 1984 UTM fuseau 35
- <UTM36SW84> : World Geodetic System 1984 UTM fuseau 36 Sud
- <UTM36W84> : World Geodetic System 1984 UTM fuseau 36
- <UTM37SW84> : World Geodetic System 1984 UTM fuseau 37 Sud
- <UTM37W84> : World Geodetic System 1984 UTM fuseau 37
- <UTM38SW84> : World Geodetic System 1984 UTM fuseau 38 Sud
- <UTM38W84> : World Geodetic System 1984 UTM fuseau 38
- <UTM39SW84> : World Geodetic System 1984 UTM fuseau 39 Sud
- <UTM39W84> : World Geodetic System 1984 UTM fuseau 39
- <UTM40SW84> : World Geodetic System 1984 UTM fuseau 40 Sud
- <UTM40W84> : World Geodetic System 1984 UTM fuseau 40
- <UTM41SW84> : World Geodetic System 1984 UTM fuseau 41 Sud
- <UTM41W84> : World Geodetic System 1984 UTM fuseau 41
- <UTM42SW84> : World Geodetic System 1984 UTM fuseau 42 Sud
- <UTM42W84> : World Geodetic System 1984 UTM fuseau 42
- <UTM43SW84> : World Geodetic System 1984 UTM fuseau 43 Sud
- <UTM43W84> : World Geodetic System 1984 UTM fuseau 43
- <UTM44SW84> : World Geodetic System 1984 UTM fuseau 44 Sud
- <UTM44W84> : World Geodetic System 1984 UTM fuseau 44
- <UTM45SW84> : World Geodetic System 1984 UTM fuseau 45 Sud
- <UTM45W84> : World Geodetic System 1984 UTM fuseau 45
- <UTM46SW84> : World Geodetic System 1984 UTM fuseau 46 Sud
- <UTM46W84> : World Geodetic System 1984 UTM fuseau 46
- <UTM47SW84> : World Geodetic System 1984 UTM fuseau 47 Sud
- <UTM47W84> : World Geodetic System 1984 UTM fuseau 47
- <UTM48SW84> : World Geodetic System 1984 UTM fuseau 48 Sud
- <UTM48W84> : World Geodetic System 1984 UTM fuseau 48
- <UTM49SW84> : World Geodetic System 1984 UTM fuseau 49 Sud
- <UTM49W84> : World Geodetic System 1984 UTM fuseau 49
- <UTM50SW84> : World Geodetic System 1984 UTM fuseau 50 Sud
- <UTM50W84> : World Geodetic System 1984 UTM fuseau 50
- <UTM51SW84> : World Geodetic System 1984 UTM fuseau 51 Sud
- <UTM51W84> : World Geodetic System 1984 UTM fuseau 51
- <UTM52SW84> : World Geodetic System 1984 UTM fuseau 52 Sud
- <UTM52W84> : World Geodetic System 1984 UTM fuseau 52
- <UTM53SW84> : World Geodetic System 1984 UTM fuseau 53 Sud
- <UTM53W84> : World Geodetic System 1984 UTM fuseau 53
- <UTM54SW84> : World Geodetic System 1984 UTM fuseau 54 Sud
- <UTM54W84> : World Geodetic System 1984 UTM fuseau 54
- <UTM55SW84> : World Geodetic System 1984 UTM fuseau 55 Sud
- <UTM55W84> : World Geodetic System 1984 UTM fuseau 55
- <UTM56SW84> : World Geodetic System 1984 UTM fuseau 56 Sud
- <UTM56W84> : World Geodetic System 1984 UTM fuseau 56
- <UTM57SW84> : World Geodetic System 1984 UTM fuseau 57 Sud
- <UTM57W84> : World Geodetic System 1984 UTM fuseau 57
- <UTM58SW84> : World Geodetic System 1984 UTM fuseau 58 Sud
- <UTM58W84> : World Geodetic System 1984 UTM fuseau 58
- <UTM59SW84> : World Geodetic System 1984 UTM fuseau 59 Sud
- <UTM59W84> : World Geodetic System 1984 UTM fuseau 59
- <UTM60SW84> : World Geodetic System 1984 UTM fuseau 60 Sud
- <UTM60W84> : World Geodetic System 1984 UTM fuseau 60
- <WALL78UTM1S> : Wallis-Uvea 1978 (MOP78) UTM 1 SUD
-
- \---------------------------------------------------------
- Various Non-U.S. Coordinate Systems,
- \---------------------------------------------------------
- <CH1903> : Swiss Coordinate System
- <madagascar> : Laborde grid for Madagascar
- <new_zealand> : New Zealand Map Grid (NZMG) \- Projection unique to N.Z. so all factors fixed
- \---------------------------------------------------------
- Secondary grids DMA TM8358.1, p. 4.3
- \---------------------------------------------------------
- <bwi> : British West Indies
- <costa-n> : Costa Rica Norte
- <costa-s> : Costa Rica Sud
- <cuba-n> : Cuba Norte
- <cuba-s> : Cuba Sud
- <domin_rep> : Dominican Republic
- <egypt-1> : Egypt
- <egypt-2> : Egypt
- <egypt-3> : Egypt
- <egypt-4> : Egypt
- <egypt-5> : Egypt
- <el_sal> : El Salvador
- <guat-n> : Guatemala Norte
- <guat-s> : Guatemala Sud
- <haiti> : Haiti
- <hond-n> : Honduras Norte
- <hond-s> : Honduras Sud
- <levant> : Levant
- <nica-n> : Nicaragua Norte
- <nica-s> : Nicaragua Sud
- <nw-africa> : Northwest Africa
- <palestine> : Palestine
- <panama> : Panama
-
- \---------------------------------------------------------
- other grids in DMA TM8358.1
- \---------------------------------------------------------
- <bng> : British National Grid
- <malay> : West Malaysian RSO Grid
- <india-I> : India Zone I
- <india-IIA> : India Zone IIA
- <india-IIB> : India Zone IIB
- <india-IIIA> : India Zone IIIA
- <india-IIIB> : India Zone IIIB
- <india-IVA> : India Zone IVA
- <india-IVB> : India Zone IVB
- <ceylon> : Ceylon Belt
- <irish> : Irish Transverse Mercator Grid
- <neiez> : Netherlands East Indies Equitorial Zone
- <n-alger> : Nord Algerie Grid
- <n-maroc> : Nord Maroc Grid
- <n-tunis> : Nord Tunisie Grid
- <s-alger> : Sud Algerie Grid
- <s-maroc> : Sud Maroc Grid
- <s-tunis> : Sud Tunisie Grid
-
- \---------------------------------------------------------
- Gauss Krueger Grids for Germany
- \---------------------------------------------------------
- <gk2-d> : Gauss Krueger Grid for Germany
- <gk3-d> : Gauss Krueger Grid for Germany
- <gk4-d> : Gauss Krueger Grid for Germany
diff --git a/src/man/man1/mbhistogram.1 b/src/man/man1/mbhistogram.1
deleted file mode 100644
index 6dd7d1a..0000000
--- a/src/man/man1/mbhistogram.1
+++ /dev/null
@@ -1,256 +0,0 @@
-.TH mbhistogram 1 "3 June 2013" "MB-System 5.0" "MB-System 5.0"
-.SH NAME
-\fBmbhistogram\fP \- Generate a histogram of bathymetry, amplitude, or sidescan values
-from swath sonar data files.
-
-.SH VERSION
-Version 5.0
-
-.SH SYNOPSIS
-\fBmbhistogram\fP [\fB\-A\fIkind\fP \fB\-B\fIyr/mo/da/hr/mn/sc\fP 
-\fB\-C\fP \fB\-D\fImin/max\fP \fB\-E\fIyr/mo/da/hr/mn/sc\fP 
-\fB\-F\fIformat\fP \fB\-G\fP \fB\-I\fIfilename\fP \fB\-L\fIlonflip\fP 
-\fB\-M\fInintervals\fP \fB\-N\fInbins\fP \fB\-P\fIping\fP 
-\fB\-R\fIwest/east/south/north\fP \fB\-S\fIspeed\fP \fB\-V \-H\fP]
-
-.SH DESCRIPTION
-\fBmbhistogram\fP reads a swath sonar data file and generates a histogram
-of the bathymetry,  amplitude,  or sidescan values. Alternatively, 
-mbhistogram can output a list of values which break up the
-distribution into equal sized regions. These values can be
-used to construct a color table, producing an image which
-is histogram equalized. If desired, the histogram
-can be recast into a Gaussian distribution before output or
-the calculation of the histrogram equalization This feature
-is similar to the Gaussian option of \fBgrdhisteq\fP. The linear
-histogram equalization is most appropriate for use with 
-grayscale images, such as those produced from amplitude
-or sidescan data, and is used by the macro \fBmbm_plot\fP
-for that purpose. The Gaussian histogram equalization is
-well suited for shading of images, and is used by
-\fBmbm_plot\fP for shading of color bathymetry with
-amplitude data.
-The results are dumped to stdout.
-
-.SH AUTHORSHIP
-David W. Caress (caress at mbari.org)
-.br
-  Monterey Bay Aquarium Research Institute
-.br
-Dale N. Chayes (dale at ldeo.columbia.edu)
-.br
-  Lamont-Doherty Earth Observatory
-
-.SH OPTIONS
-.TP
-.B \-A
-\fIkind\fP
-.br
-Sets the kind of data to be processed, where 
- 	\fIkind\fP = 0 : histogram of bathymetry data
- 	\fIkind\fP = 1 : histogram of beam amplitude data
- 	\fIkind\fP = 2 : histogram of sidescan data
-Default: \fIkind\fP = 2.
-.TP
-.B \-B
-\fIyr/mo/da/hr/mn/sc\fP
-.br
-This option sets the starting time for data allowed in the input data.
-The \fB\-E\fP option sets the ending time for data. If the 
-starting time is before the ending time, then any data
-with a time stamp before the starting time or after the
-ending time is ignored. If instead the starting time is
-after the ending time, then any data between the ending
-and starting time will be ignored. This scheme allows time
-windowing both inside and outside a specified interval.
-Default: \fIyr/mo/da/hr/mn/sc\fP = 1962/2/21/10/30/0.
-.TP
-.B \-D
-\fImin/max\fP
-.br
-Specifies the minimum and maximum data values used for
-constructing the histogram. 
-The width of the bins is determined by (\fImax\fP \- \fImin\fP)
-divided by \fInbins\fP (see the \fB\-N\fP option).
-The \fImin\fP value is the
-center of the first histogram bin, and the \fImax\fP value is the
-center of the last histogram bin.
-Data values falling outside the range of the bins are ignored.
-.TP
-.B \-E
-\fIyr/mo/da/hr/mn/sc\fP
-.br
-This option sets the ending time for data allowed in the input data.
-The \fB\-B\fP option sets the starting time for data. If the 
-starting time is before the ending time, then any data
-with a time stamp before the starting time or after the
-ending time is ignored. If instead the starting time is
-after the ending time, then any data between the ending
-and starting time will be ignored. This scheme allows time
-windowing both inside and outside a specified interval.
-Default: \fIyr/mo/da/hr/mn/sc\fP = 2062/2/21/10/30/0.
-.TP
-.B \-F
-\fIformat\fP
-.br
-Sets the data format used if the input is read from stdin
-or from a file. If \fIformat\fP < 0, then the input file specified
-with the \fB\-I\fP option will actually contain a list of input swath sonar
-data files. This program uses the \fBMBIO\fP library 
-and will read or write any swath sonar
-format supported by \fBMBIO\fP. A list of the swath sonar data formats
-currently supported by \fBMBIO\fP and their identifier values
-is given in the \fBMBIO\fP manual page. Default: \fIformat\fP = 11.
-.TP
-.B \-G
-This option causes the data histogram to be recast into a
-Gaussian distribution.
-.TP
-.B \-I
-\fIfilename\fP
-.br
-Sets the input filename. If \fIformat\fP > 0 (set with the 
-\fB\-f\fP option) then the swath sonar data contained in \fIinfile\fP 
-is read and processed. If \fIformat\fP < 0, then \fIinfile\fP
-is assumed to be an ascii file containing a list of the input swath sonar
-data files to be processed and their formats.  The program will read 
-the data in each one of these files.
-In the \fIinfile\fP file, each
-data file should be followed by a data format identifier, e.g.:
- 	datafile1 11
- 	datafile2 24
-.br
-This program uses the \fBMBIO\fP library and will read or write any swath sonar
-format supported by \fBMBIO\fP. A list of the swath sonar data formats
-currently supported by \fBMBIO\fP and their identifier values
-is given in the \fBMBIO\fP manual page. Default: \fIinfile\fP = "stdin".
-.TP
-.B \-L
-\fIlonflip\fP
-.br
-Sets the range of the longitude values returned.
-If \fIlonflip\fP=\-1 then the longitude values will be in
-the range from \-360 to 0 degrees. If \fIlonflip\fP=0 
-then the longitude values will be in
-the range from \-180 to 180 degrees. If \fIlonflip\fP=1 
-then the longitude values will be in
-the range from 0 to 360 degrees.
-Default: \fIlonflip\fP = 0.
-.TP
-.B \-M
-\fInintervals\fP
-.br
-If \fInintervals\fP > 0 then \fBmbhistogram\fP will 
-calculate and output a list of values which break up
-the data distribution into equal sized regions.  This can
-be useful for constructing color tables which accentuate
-features in amplitude and sidescan data (the macro \fBmbm_plot\fP
-makes use of this feature). If this option is enabled, then the
-raw histogram is not output.
-.TP
-.B \-N
-\fInbins\fP
-.br
-Sets the number of bins used to calculate the histogram.
-.TP
-.B \-P
-\fIpings\fP
-.br
-Sets the ping averaging of the input data. If \fIpings\fP = 1, then
-no ping averaging is performed. If \fIpings\fP > 0, then
-that number of input pings will be averaged to produce one output
-ping.  If \fIpings\fP = 0, then the ping averaging will automatically
-be done so that the along-track ping spacing is equal to the across-track
-beam spacing.
-Default: \fIpings\fP = 1 (no ping averaging).
-.TP
-.B \-R
-\fIwest/east/south/north\fP
-.br
-Sets the longitude and latitude bounds within which swath sonar 
-data will be read. Only the data which lies within these bounds will
-be read. 
-Default: \fIwest\fP=\-360, east\fI=360\fP, \fIsouth\fP=\-90, \fInorth\fP=90.
-.TP
-.B \-S
-\fIspeed\fP
-.br
-Sets the minimum speed in km/hr (5.5 kts ~ 10 km/hr) allowed in 
-the input data; pings associated with a smaller ship speed will not be
-copied. Default: \fIspeed\fP = 0.
-.TP
-.B \-T
-\fItimegap\fP
-.br
-Sets the maximum time gap in minutes between adjacent pings allowed before
-the data is considered to have a gap. Default: \fItimegap\fP = 1.
-.TP
-.B \-V
-Normally, \fBmbhistogram\fP only prints out the statistics obtained
-by reading all of the data.  If the
-\fB\-V\fP flag is given, then \fBMBCOPY\fP works in a "verbose" mode and
-outputs the program version being used and all read error status messages.
-.TP
-.B \-H
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-
-.SH EXAMPLES
-Suppose one wishes to obtain a histogram of the sidescan data
-in a file called mbexample.mb41 containing raw data from a SeaBeam
-2112 sonar (format 41). The following will suffice:
- mbhistogram \-F41 \-I sb199411211212.rec \-D0.0/45000 \-N25
-.br
-to yield the following histogram:
- 0.000000 183814
- 1875.000000 30845
- 3750.000000 5365
- 5625.000000 1918
- 7500.000000 951
- 9375.000000 591
- 11250.000000 403
- 13125.000000 232
- 15000.000000 189
- 16875.000000 127
- 18750.000000 108
- 20625.000000 75
- 22500.000000 85
- 24375.000000 48
- 26250.000000 30
- 28125.000000 31
- 30000.000000 28
- 31875.000000 21
- 33750.000000 10
- 35625.000000 9
- 37500.000000 4
- 39375.000000 2
- 41250.000000 2
- 43125.000000 2
- 45000.000000 1
-.br
-In order to obtain 16 values breaking up the distribution into
-equal sized regions, use the \fB\-M\fP option:
- mbhistogram \-F41 \-I sb199411211212.rec \-D0.0/45000 \-N45000 \-M25
-.br
-giving:
-  \-0.500011
- 110.657221
- 137.446811
- 165.916284
- 199.635469
- 239.900007
- 287.726270
- 345.615610
- 418.142114
- 513.487776
- 639.986551
- 824.475879
- 1140.372280
- 1994.280032
- 44803.495633
-
-.SH SEE ALSO
-\fBmbsystem\fP(1), \fBmbm_plot\fP(1), grdhisteq(1)
-
-.SH BUGS
-You find em, we fix 'em...
diff --git a/src/man/man1/mbhsdump.1 b/src/man/man1/mbhsdump.1
deleted file mode 100644
index a83b344..0000000
--- a/src/man/man1/mbhsdump.1
+++ /dev/null
@@ -1,85 +0,0 @@
-.TH mbhsdump 1 "7 June 2013" "MB-System 5.0" "MB-System 5.0"
-.SH NAME
-\fBmbhsdump\fP \- lists the information contained in Hydrosweep DS data files.
-
-.SH VERSION
-Version 5.0
-
-.SH SYNOPSIS
-\fBmbhsdump\fP [\fB\-F\fIformat \fB\-I\fIinfile \fB\-O\fIkind \fB\-V \-H\fP]
-
-.SH DESCRIPTION
-\fBmbhsdump\fP lists the information contained in data records on
-Hydrosweep DS data files, including survey, calibrate, water velocity
-and comment records. The default input stream is stdin. Prior to version 5.4
-this program was named hsdump.
-
-.SH AUTHORSHIP
-David W. Caress (caress at mbari.org)
-.br
-  Monterey Bay Aquarium Research Institute
-.br
-Dale N. Chayes (dale at ldeo.columbia.edu)
-.br
-  Lamont-Doherty Earth Observatory
-
-.SH OPTIONS
-.TP
-.B \-F
-\fIformat\fP
-.br
-Sets the format for the input and output swath sonar data using
-\fBMBIO\fP integer format identifiers.
-This program is specific to Hydrosweep DS data, and cannot be used
-with data from any other swath sonar system or with data in a Hydrosweep
-format that does not include water velocity records. Currently, the two formats
-which can be used are the raw Hydrosweep DS format (\fBMBIO\fP id 21)
-and the L-DEO in-house binary Hydrosweep format (\fBMBIO\fP id 24).
-Default: \fIformat\fP = 5.
-.TP
-.B \-H
-This "help" flag causes the program to print out a description
-of its operation and then exit immediately.
-.TP
-.B \-I
-\fIinfile\fP
-.br
-Data file from which the input data will be read. If
-no input file is specified, the input will be read
-from stdin. Default: \fIinfile\fP = stdin.
-.TP
-.B \-O
-\fIkind\fP
-.br
-Sets the kind of data record which will be listed, where the choices
-for kind include:
- 	1:	Survey data record
- 	2:	Comment record
- 	3:	Calibrate data record
- 	4:	Mean velocity data record
- 	5:	Velocity profile data record
- 	6:	Standby data record
- 	7:	Navigation source data record
-.br
-This option can be given multiple times to set more than one
-kind of data record for listing.
-.TP
-.B \-V
-Normally, \fBmbhsdump\fP lists only the contents of the data records
-which are specified with the \fB\-O\fP option.  If the
-\fB\-V\fP flag is given, then \fBmbhsdump\fP works in a "verbose" mode and
-outputs the program version being used, any comment records encountered
-in the data stream, and all error status messages.
-
-.SH EXAMPLES
-Suppose one wishes to list out the water velocity records
-contained in the raw Hydrosweep (format 21) file hsraw.
-The following will suffice:
- 	mbhsdump \-F21 \-O4 \-O5 \-Ihsraw
-
-.SH SEE ALSO
-\fBmbsystem\fP(1), \fBmbinfo\fP(1), \fBmblist\fP(1)
-
-.SH BUGS
-Other than the name change, this program hasn't been altered in this century.
-It is probably stale.
diff --git a/src/man/man1/mbhysweeppreprocess.1 b/src/man/man1/mbhysweeppreprocess.1
deleted file mode 100644
index 932a419..0000000
--- a/src/man/man1/mbhysweeppreprocess.1
+++ /dev/null
@@ -1,322 +0,0 @@
-.TH mbhysweeppreprocess 1 "3 June 2013" "MB-System 5.0" "MB-System 5.0"
-.SH NAME
-\fBmbhysweeppreprocess\fP \- performs preprocessing of multibeam data
-in the Hysweep HSX format (\fBMBIO\fP format 201).
-
-.SH VERSION
-Version 5.0
-
-.SH SYNOPSIS
-\fBmbhysweeppreprocess\fP
-[\fB\-A\fP\fIoffsettype/x/y/z/t\fP \fB\-B\fP\fIrollbias/pitchbias/headingbias\fP
-\fB\-D\fP\fIsonardepthfile\fP \fB\-I\fP\fIdatalist\fP
-\fB\-J\fP\fIprojection\fP  \fB\-L\fP
-\fB\-M\fP\fInavformat\fP \fB\-N\fP\fInavfile\fP
-\fB\-T\fP\fItimelag\fP
-\fB\-H\fP \fB\-V\fP]
-
-.SH DESCRIPTION
-\fBmbhysweeppreprocess\fP reads a Hysweep HSX (format 201) file, interpolates the
-asynchronous navigation and attitude onto the multibeam data,
-and writes a new HSX file with that information correctly embedded
-in the multibeam data. The user must specify a projection for the easting-northing
-navigation used in HSX files. This program can also fix various problems
-with multibeam data, and allows for lever arm correction of offsets between the
-sonar, the motion sensor, and the positioning sensor (provided the navigation
-and attitude data included in the HSX file are uncorrected for sensor offsets)..
-
-.SH AUTHORSHIP
-David W. Caress (caress at mbari.org)
-.br
-  Monterey Bay Aquarium Research Institute
-.br
-Dale N. Chayes (dale at ldeo.columbia.edu)
-.br
-  Lamont-Doherty Earth Observatory
-
-.SH OPTIONS
-.TP
-.B \-A
-\fItype/offsetx/offsety/offsetz/offsett\fP
-.br
-This option sets the spatial and time offset for a sensor relative to a reference
-point on the survey platform (by convention usually close to the center of mass and rotation).
-If \fItype\fP = 1, the offsets pertain to the survey sonar. If \fItype\fP = 2, the offsets
-pertain to the source of the attitude data, usually an MRU or INS. If \fItype\fP = 3, the
-offsets pertain to the source of the position or navigation data. The time offsets are
-referenced against the sonar data, thus the sonar time offset will usually be zero. If any
-of these offsets are defined, then \fBmbhysweeppreprocess\fP will use lever arm calculations
-to determine the x, y, and z offsets associated with the platform attitude for each ping, and
-add those to the sonar navigation and depth values.
-.TP
-.B \-B
-\fIrollbias/pitchbias/headingbias\fP
-.br
-This option sets roll, pitch, and heading bias values to be applied before merging the attitude
-and heading data with the sonar data while calculating bathymetry.
-.TP
-.B \-D
-\fIsonardepthfile\fP
-.br
-This option causes \fBmbhysweeppreprocess\fP to read a sonar depth time series from the specified
-file and use that data in place of any sonar depth (DFT) records present in the HSX file. The
-sonar depth data must be in an ascii format of the form:
-    yyyy:mm:dd:hh:mm:ss.sss zzzz.zzz
-.br
-where yyyy=year, mm=month, dd=day, hh=hour, mm=minute, ss.sss = seconds, and zzzz.zzz = sonar depth in meters.
-.TP
-.B \-F
-\fIformat\fP
-.br
-Sets the format of the input file specified with the \fB\-I\fP option. This is normally omitted unless
-the input filename does not conform to the \fBMB-System\fP file naming conventions. For this
-program, the only relevant options are \fIformat\fP = 201 for an HSX format file, or
-\fIformat\fP= \-1 for a datalist referencing multiple format 201 files.
-.TP
-.B \-H
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-.TP
-.B \-I
-\fIinfile\fP
-.br
-Sets the input file path. If \fIformat\fP > 0 (set with the
-\fB\-f\fP option or \fBmbdefaults\fP) then the swath sonar data contained in \fIinfile\fP
-is read and processed. If \fIformat\fP < 0, then \fIinfile\fP
-is assumed to be an ascii file containing a list of the input swath sonar
-data files to be processed and their formats.  The program will read
-the data in each one of these files.
-In the \fIinfile\fP file, each
-data file should be followed by a data format identifier, e.g.:
-    datafile1 201
-    datafile2 201
-.br
-This program only reads Hysweep HSX format data files (\fBMBIO\fP
-format 201).
-.TP
-.B \-J
-\fIprojection\fP
-.br
-The Hypack and Hysweep software packages operate with navigation in a user-defined
-projected coordinate system. Resultantly, HSX format files contain positions in a
-projected coordinate system rather than longitude and latitude in geographic
-coordinates. Generally, the HSX files do not contain any description of the projection
-used to obtain the eastings and northings in those files. This option allows a
-user to specifiy the projection used to translate the eastings and northings back
-into longitude and latitude. If this option is not specified, \fBMB-System\fP will
-assume the data are associated with UTM zone 1 north. The projection identifier must
-conform to the same usage as with projections specified for \fBmbgrid\fP.
-For  instance, to fully specify a particular northern UTM zone, set projection = UTMXXN
-where XX gives the UTM zone (defined from 01 to 60). As an example, a northern UTM
-zone 12 projection can be specified using \-JUTM12N.  Southern UTM zones are specified as
-UTMXXS. The European Petroleum Survey Group (EPSG) has defined a large number of PCS's
-used worldwide and assigned number id's to each; one can also specify the northern
-UTM zone 12 projection using its EPSG designation, or \-Jepsg32612. The complete list
-of projected coordinate systems supported by \fBMB-System\fP is given in the \fBmbgrid\fP
-manual page.
-.TP
-.B \-L
-.br
-This option causes the program to list the timetags of bathymetry,
-navigation, attitude, and other data records.
-.TP
-.B \-M
-\fInavformat\fP
-.br
-Sets the input navigation file format used by the file specified with the
-\fB\-N\fP option.
- At present, the only option for the navigation file format is \fInavformat\fP=1:
-    yyyy:mm:dd:hh:mm:ss.sss sssss.sss eeeeeeee.eee nnnnnnnn.nnn zzzz.zzz aaa.aaa hhh.hhh
-.br
-where yyyy=year, mm=month, dd=day, hh=hour, mm=minute, ss.sss = seconds, sssss.sss = seconds
-from the start of the year, eeeeeeee.eee = easting in meters, nnnnnnnnn.nnn = northing in
-meters, zzzz.zzz = sonar depth in meters, and hhh.hhh = heading in degrees.
-Default: \fInavformat\fP=1.
-.TP
-.B \-N
-\fInavfile\fP
-.br
-The program will read navigation from the file \fInavfile\fP
-and merge those data with the multibeam data in the HSX file.
-If a timelag model is specified using
-\fB\-T\fP\fItimelag\fP, the time lag will be applied to the navigation and
-attitude data before merging with the sonar data. The navigation and attitude
-data from \fInavfile\fP will also be embedded in asynchronous data records
-in the output format 201 data. Any pre-existing navigation data records will
-remain unchanged in the data stream. However, the HSX file header will be altered
-to show the newly merged data as "enabled" and the original, asynchronous data
-as not enabled.
-.TP
-.B \-T
-\fItimelag\fP
-.br
-This option specifies a \fItimelag\fP value in seconds to be applied
-to the navigation and attitude data prior to it being merged with the
-bathymetry. If \fItimelag\fP is a valid path to a file containing time
-stamp and time lag pairs, then these data will be read and the time lag
-applied to particular records will be interpolated by time.
-.TP
-.B \-V
-This option increases the verbosity of \fBmbhysweeppreprocess\fP with
-respect to informational output to the shell.
-
-.SH EXAMPLES
-Suppose that one has logged a set of five HSX files incorporating
-multibeam sonar data, navigation, attitude, heading, and altitude data,
-but not sonar depth data, all from an ROV platform. Further suppose
-that a datalist file named datalist_hsx.mb-1 references those
-files, and that a separate text file named  ROVnav.txt includes
-an improved vehicle navigation, including the sonar depth. Finally,
-suppose that the existing sensor offsets are known, but have not
-been applied to any of the existing data
-.br
-In order to merge the better navigation and sonar depth before
-starting MB-System processing, do something like:
-.br
-    mbhysweeppreprocess \-I datalist_hsx.mb-1 \
-            \-A1/0.42/2.005/-1.34/0.0 \
-            \-A2/0.46/0.22/0.55/0.0 \
-            \-A3/0.46/0.22/0.55/0.0 \
-            \-JUTM01N \-NROVnav.txt
-.br
-The program will output something like the following:
-    Data available for merging:
-        Navigation (northing easting sonardepth altitude heading): 120959
-        Sonar depth (sonardepth):                                  0
-        Time lag:                                                  0
-
-    Offsets to be applied:
-           X (m)   Y (m)   Z (m)   T (sec)
-         Roll bias:       0.000
-         Pitch bias:      0.000
-         Heading bias:    0.000
-         Sonar:    0.420    2.005   \-1.340    0.000
-         MRU:      0.420    2.005   \-1.340    0.000
-         Nav:      0.420    2.005   \-1.340    0.000
-
-    Data records read from: 000_2004.HSX
-         Positions (POS):                   2651
-         Positions ignored (POS):           0
-         Heading (GYR):                     19486
-         Attitude (HCP):                    15752
-         Echosounder (altitude) (EC1):      2651
-         Dynamic draft (DFT):               0
-         Raw multibeam (RMB):               24438
-         Other:                             64978
-
-    Data records read from: 000_2048.HSX
-         Positions (POS):                   2967
-         Positions ignored (POS):           0
-         Heading (GYR):                     21942
-         Attitude (HCP):                    17771
-         Echosounder (altitude) (EC1):      2967
-         Dynamic draft (DFT):               0
-         Raw multibeam (RMB):               25363
-         Other:                             71010
-
-    Data records read from: 000_2138.HSX
-         Positions (POS):                   2573
-         Positions ignored (POS):           0
-         Heading (GYR):                     18936
-         Attitude (HCP):                    15307
-         Echosounder (altitude) (EC1):      2573
-         Dynamic draft (DFT):               0
-         Raw multibeam (RMB):               23398
-         Other:                             62787
-
-    Data records read from: 000_2221.HSX
-         Positions (POS):                   2824
-         Positions ignored (POS):           0
-         Heading (GYR):                     20863
-         Attitude (HCP):                    16907
-         Echosounder (altitude) (EC1):      2824
-         Dynamic draft (DFT):               0
-         Raw multibeam (RMB):               23993
-         Other:                             67411
-
-    Data records read from: 000_2308.HSX
-         Positions (POS):                   2657
-         Positions ignored (POS):           0
-         Heading (GYR):                     19571
-         Attitude (HCP):                    15818
-         Echosounder (altitude) (EC1):      2657
-         Dynamic draft (DFT):               0
-         Raw multibeam (RMB):               24009
-         Other:                             64712
-
-    Total data records read from: datalist_hsx.mb-1
-         Positions (POS):                   13672
-         Positions ignored (POS):           0
-         Heading (GYR):                     100798
-         Attitude (HCP):                    81555
-         Echosounder (altitude) (EC1):      13672
-         Dynamic draft (DFT):               0
-         Raw multibeam (RMB):               121201
-         Other:                             330898
-
-    Data records written to: 000_2004.mb201
-         Positions (POS):                   2651
-         Positions ignored (POS):           0
-         Heading (GYR):                     19486
-         Attitude (HCP):                    15752
-         Echosounder (altitude) (EC1):      2651
-         Dynamic draft (DFT):               0
-         Raw multibeam (RMB):               24438
-         Other:                             0
-
-    Data records written to: 000_2048.mb201
-         Positions (POS):                   2967
-         Positions ignored (POS):           0
-         Heading (GYR):                     21942
-         Attitude (HCP):                    17771
-         Echosounder (altitude) (EC1):      2967
-         Dynamic draft (DFT):               0
-         Raw multibeam (RMB):               25363
-         Other:                             0
-
-    Data records written to: 000_2138.mb201
-         Positions (POS):                   2573
-         Positions ignored (POS):           0
-         Heading (GYR):                     18936
-         Attitude (HCP):                    15307
-         Echosounder (altitude) (EC1):      2573
-         Dynamic draft (DFT):               0
-         Raw multibeam (RMB):               23398
-         Other:                             0
-
-    Data records written to: 000_2221.mb201
-         Positions (POS):                   2824
-         Positions ignored (POS):           0
-         Heading (GYR):                     20863
-         Attitude (HCP):                    16907
-         Echosounder (altitude) (EC1):      2824
-         Dynamic draft (DFT):               0
-         Raw multibeam (RMB):               23993
-         Other:                             0
-
-    Data records written to: 000_2308.mb201
-         Positions (POS):                   2657
-         Positions ignored (POS):           0
-         Heading (GYR):                     19571
-         Attitude (HCP):                    15818
-         Echosounder (altitude) (EC1):      2657
-         Dynamic draft (DFT):               0
-         Raw multibeam (RMB):               24009
-         Other:                             0
-
-    Total data records written from: datalist_hsx.mb-1
-         Positions (POS):                   13672
-         Positions ignored (POS):           0
-         Heading (GYR):                     100798
-         Attitude (HCP):                    81555
-         Echosounder (altitude) (EC1):      13672
-         Dynamic draft (DFT):               0
-         Raw multibeam (RMB):               121201
-         Other:                             0
-
-.SH SEE ALSO
-\fBmbsystem\fP(1), \fBmbformat\fP(1), \fBmbinfo\fP(1)
-
-.SH BUGS
-At this point, the HSX i/o module and preprocessor are only tested with a single
-survey of R2Sonic data.
diff --git a/src/man/man1/mbinfo.1 b/src/man/man1/mbinfo.1
deleted file mode 100644
index 4335fd1..0000000
--- a/src/man/man1/mbinfo.1
+++ /dev/null
@@ -1,466 +0,0 @@
-.TH mbinfo 1 "3 June 2013" "MB-System 5.0" "MB-System 5.0"
-.SH NAME
-\fBmbinfo\fP \- Output some basic statistics of swath sonar data files.
-
-.SH VERSION
-Version 5.0
-
-.SH SYNOPSIS
-\fBmbinfo\fP [\fB\-B\fIyr/mo/da/hr/mn/sc\fP \fB\-C \-E\fIyr/mo/da/hr/mn/sc\fP
-\fB\-F\fIformat\fP \fB\-G\fP \fB\-I\fIfilename\fP
-\fB\-L\fIlonflip\fP \fB\-M\fIlondim/latdim\fP
-\fB\-N\fP \fB\-O\fP \fB\-P\fIping\fP
-\fB\-R\fIwest/east/south/north\fP \fB\-S\fIspeed\fP \fB\-W\fP
-\fB\-X\fIoutputformat\fP \fB\-V \-H\fP]
-
-.SH DESCRIPTION
-\fBMBinfo\fP is a utility for reading a swath sonar data file
-or files and outputting some basic statistics.  The table generated
-shows the filename, the data format id, a brief description of
-the format, any metadata that have been inserted into the data,
-data counts, navigation totals, time and navigation
-of the first and last data records, minimum and maximum
-data values, and the geographic bounding box of the data.
-The data counts include the total number of bathymetry,
-amplitude, and sidescan values read. These totals may be less
-than the maximum possible (number of data records times the
-maximum number of data supported for the particular data format)
-for formats supporting variable numbers of beams or pixels.
-Also reported are the numbers and percentages of good, zero,
-and flagged data values (good values are those which are neither
-zero nor flagged as bad).
-
-An important function  of \fBmbinfo\fP is to generate ".inf"
-files that may be parsed by other \fBMB-System\fP programs
-and macros. Programs such as \fBmbgrid\fP and \fBmbmosaic\fP,
-read ".inf" files, when available, to
-determine whether input swath data files actually contain
-any data in the area of interest. The efficiency of these
-programs is enhanced by their ability to avoid reading files
-with no data in the area to be gridded or mosaiced. Programs
-such as \fBmbm_plot\fP and \fBmbm_grid\fP run \fBmbinfo\fP on
-input files to determine the data bounds. The availability
-of ".inf" files allows this information to be determined without
-having to read through each swath file.To create an ".inf" file, simply direct the
-output of \fBmbinfo\fP to a file named by adding the
-suffix ".inf" to the input swath
-data filename. This can also be accomplished using the \fB\-O\fP
-option of \fBmbinfo\fP, or the \fB\-N\fP and \fB\-O\fP options of
-\fBmbdatalist\fP.
-
-Data archives use metadata harvesting tools that often work better with
-information structured for machine parsing rather than for easy
-reading by humans. To output a variant of "*.inf" files in the JSON
-format (with "_inf.json" suffixes), use the \fB\-X\fP\fI1\fP option.
-Similarly, specifying the \fB\-X\fP\fI2\fP option will result in XML
-output in files with "_xml.inf" suffixes.
-
-The program \fBmbprocess\fP can insert metadata recognized
-and printed by \fBmbinfo\fP. These metadata include items
-such as the sonar model, the vessel name, and bias parameters.
-See the \fBmbprocess\fP and
-\fBmbset\fP manual pages for details.
-
-The data input may be averaged over several pings
-and/or windowed in time and space.  Comments in the data
-stream may also be printed out.
-The results are dumped to stdout.
-
-If pings are averaged (\fIpings\fP > 2)
-\fBmbinfo\fP estimates the variance for each of the bathymetry beams
-and sidescan pixels
-by reading a set number of pings and then finding the
-variance of the values for each beam.  The bathymetry values are
-detrended before variances are calculated.
-
-The program output can also be extended to include a coarse
-mask representing where data lies within the file's bounding
-box. This mask is shown as a table of 0's and 1's, where
-the 1's indicate bins with data. The dimensions of the mask
-are specified with the \fB\-M\fP\fIlondim/latdim\fP option.
-For instance, if the user specifies \fB\-M\fP\fI10/10\fP, then
-\fBmbinfo\fP will read through the data once to establish the
-usual statistics, including the data bounding box. Then, the
-program will initialize a 10 X 10 grid with the minimum and
-maximum longitude and latitude of the bounding box, and
-read the data a second time. Each bin in which a sounding or
-pixel falls will be set to 1. After the second reading pass,
-the data location mask will be output at the end of the
-\fBmbinfo\fP output.
-
-.SH AUTHORSHIP
-David W. Caress (caress at mbari.org)
-.br
-  Monterey Bay Aquarium Research Institute
-.br
-Dale N. Chayes (dale at ldeo.columbia.edu)
-.br
-  Lamont-Doherty Earth Observatory
-
-.SH OPTIONS
-.TP
-.B \-B
-\fIyr/mo/da/hr/mn/sc\fP
-.br
-This option sets the starting time for data allowed in the input data.
-The \fB\-E\fP option sets the ending time for data. If the
-starting time is before the ending time, then any data
-with a time stamp before the starting time or after the
-ending time is ignored. If instead the starting time is
-after the ending time, then any data between the ending
-and starting time will be ignored. This scheme allows time
-windowing both inside and outside a specified interval.
-Default: \fIyr/mo/da/hr/mn/sc\fP = 1962/2/21/10/30/0.
-.TP
-.B \-C
-Normally, \fBmbinfo\fP ignores comments encountered in the
-data file.  If the \fB\-C\fP flag is given, all of the comments will be
-printed out.
-.TP
-.B \-E
-\fIyr/mo/da/hr/mn/sc\fP
-.br
-This option sets the ending time for data allowed in the input data.
-The \fB\-B\fP option sets the starting time for data. If the
-starting time is before the ending time, then any data
-with a time stamp before the starting time or after the
-ending time is ignored. If instead the starting time is
-after the ending time, then any data between the ending
-and starting time will be ignored. This scheme allows time
-windowing both inside and outside a specified interval.
-Default: \fIyr/mo/da/hr/mn/sc\fP = 2062/2/21/10/30/0.
-.TP
-.B \-F
-\fIformat\fP
-.br
-Sets the data format used if the input is read from stdin
-or from a file. If \fIformat\fP < 0, then the input file specified
-with the \fB\-I\fP option will actually contain a list of input swath sonar
-data files. This program uses the \fBMBIO\fP library
-and will read or write any swath sonar
-format supported by \fBMBIO\fP. A list of the swath sonar data formats
-currently supported by \fBMBIO\fP and their identifier values
-is given in the \fBMBIO\fP manual page. The default format is
-set using \fBmbdefaults\fP.
-.TP
-.B \-G
-Enables checking for reasonable navigation to be used in
-calculating the minimum and maximum longitude and latitude values.
-This mode excludes longitude and latitude values of 0.0 or
-those values associated with very large apparent speeds
-between pings (calculated using distance and time differences
-between adjacent pings). This option is particularly useful
-when one is trying to obtain reasonable bounds for a plot.
-.TP
-.B \-H
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-.TP
-.B \-I
-\fIfilename\fP
-.br
-Sets the input filename. If \fIformat\fP > 0 (set with the
-\fB\-f\fP option) then the swath sonar data contained in \fIinfile\fP
-is read and processed. If \fIformat\fP < 0, then \fIinfile\fP
-is assumed to be an ascii file containing a list of the input swath sonar
-data files to be processed and their formats.  The program will read
-the data in each one of these files.
-In the \fIinfile\fP file, each
-data file should be followed by a data format identifier, e.g.:
- 	datafile1 11
- 	datafile2 24
-.br
-This program uses the \fBMBIO\fP library and will read or write any swath sonar
-format supported by \fBMBIO\fP. A list of the swath sonar data formats
-currently supported by \fBMBIO\fP and their identifier values
-is given in the \fBMBIO\fP manual page. Default: \fIinfile\fP = "stdin".
-.TP
-.B \-L
-\fIlonflip\fP
-.br
-Sets the range of the longitude values returned.
-If \fIlonflip\fP=\-1 then the longitude values will be in
-the range from \-360 to 0 degrees. If \fIlonflip\fP=0
-then the longitude values will be in
-the range from \-180 to 180 degrees. If \fIlonflip\fP=1
-then the longitude values will be in
-the range from 0 to 360 degrees.
-Default: \fBmbinfo\fP selects the bext longitude range based
-on the first data.
-.TP
-.B \-M
-\fIlondim/latdim\fP
-.br
-The program output can be extended to include a coarse
-mask representing where data lies within the file's bounding
-box. This mask is shown as a table of 0's and 1's, where
-the 1's indicate bins with data. The dimensions of the mask
-are specified with the \fB\-M\fP\fIlondim/latdim\fP option.
-.TP
-.B \-N
-.br
-Extends the program output to include notices. These notices
-include three sections. The first is a list of all of the
-data record types (e.g. survey, comment, navigation, parameter)
-encountered while reading the file. Some formats are quite simple
-and only include survey records and comments. Other formats
-are complex and may contain many different sorts of data
-records, including some that only derive from a particular
-sonar model. The second section lists any nonfatal error messages
-(e.g. unintelligible record) generated while reading the
-file. Finally, the third section of notices lists any
-particular problems with the data that have been identified
-(e.g. some navigation is zero or some depths are too large
-to be correct).
-.TP
-.B \-O
-.br
-This option causes the program output to be directed to
-"inf" files rather than to stdout. Each "inf" file is named
-using the original data file path with an ".inf" suffix appended.
-.TP
-.B \-P
-\fIpings\fP
-.br
-Turns on variance calculations for the bathymetry, amplitude,
-and sidescan data (as available in the data stream).  If
-\fIpings\fP = 1, then no variance calculations are made.  If
-\fIpings\fP > 1, then variances are calculated for each beam
-and pixel using groups of \fIpings\fP values.  The bathymetry
-values are detrended before the variances are calculated;
-the amplitude and sidescan values are not detrended.  The
-variance calculations can provide crude measures of noise
-and/or signal as a function of beam and pixel number.
-Default: \fIpings\fP = 1 (no variance calculations).
-.TP
-.B \-R
-\fIwest/east/south/north\fP
-.br
-Sets the longitude and latitude bounds within which swath sonar
-data will be read. Only the data which lies within these bounds will
-be read.
-Default: \fIwest\fP=\-360, east\fI=360\fP, \fIsouth\fP=\-90, \fInorth\fP=90.
-.TP
-.B \-S
-\fIspeed\fP
-.br
-Sets the minimum speed in km/hr (5.5 kts ~ 10 km/hr) allowed in
-the input data; pings associated with a smaller ship speed will not be
-copied. Default: \fIspeed\fP = 0.
-.TP
-.B \-T
-\fItimegap\fP
-.br
-Sets the maximum time gap in minutes between adjacent pings allowed before
-the data is considered to have a gap. Default: \fItimegap\fP = 1.
-.TP
-.B \-V
-Normally, \fBmbinfo\fP only prints out the statistics obtained
-by reading all of the data.  If the
-\fB\-V\fP flag is given, then \fBmbinfo\fP works in a "verbose" mode and
-outputs the program version being used and all read error status messages.
-.TP
-.B \-W
-Normally, \fBmbinfo\fP reports depth values in meters. If the
-\fB\-W\fP flag is given, then \fBmbinfo\fP reports these values
-in feet.
-.TP
-.B \-X
-\fIoutputformat\fP
-.br
-Normally, \fBmbinfo\fP reports information as text formatted for easy
-reading. If this option is given with \fIoutputformat\fP=1, then the
-output will be in the JSON format. If the \fB\-O\fP option is used to
-explicitly make "*.inf" files, then the output will be JSON and the output
-filenames will be named using the original data file path with an "_inf.json"
-suffix appended. If this option is given with \fIoutputformat\fP=2, then the
-output will be in the XML format. If the \fB\-O\fP option is used to
-explicitly make "*.inf" files, then the output will be XML and the output
-filenames will be named using the original data file path with an "_inf.xml"
-suffix appended.
-
-.SH EXAMPLES
-Suppose one wishes to know something about the contents of
-a Hydrosweep file (format 24) called example_hs.mb24.
-The following will suffice:
- 	mbinfo \-F24 \-Iexample_hs.mb24
-
-The following output is produced:
-
-
- Swath Data File:      example_hs.mb24
- MBIO Data Format ID:  24
- Format name:          MBF_HSLDEOIH
- Informal Description: L-DEO in-house binary Hydrosweep
- Attributes:           Hydrosweep DS, 59 beams, bathymetry and amplitude,
-                       binary, centered, L-DEO.
-
- Data Totals:
- Number of Records:              263
- Bathymetry Data (59 beams):
-   Number of Beams:            15517
-   Number of Good Beams:       13661     88.04%
-   Number of Zero Beams:         868      5.59%
-   Number of Flagged Beams:      988      6.37%
- Amplitude Data (59 beams):
-   Number of Beams:            15517
-   Number of Good Beams:       13661     88.04%
-   Number of Zero Beams:         868      5.59%
-   Number of Flagged Beams:      988      6.37%
- Sidescan Data (0 pixels):
-   Number of Pixels:               0
-   Number of Good Pixels:          0      0.00%
-   Number of Zero Pixels:          0      0.00%
-   Number of Flagged Pixels:       0      0.00%
-
- Navigation Totals:
- Total Time:             1.2425 hours
- Total Track Length:    20.9421 km
- Average Speed:         16.8548 km/hr ( 9.1107 knots)
-
- Start of Data:
- Time:  08 14 1993 18:00:25.000000  JD226
- Lon:  \-49.3011     Lat:   12.1444     Depth:  4920.0000 meters
- Speed: 18.3600 km/hr ( 9.9243 knots)  Heading:  97.2000 degrees
- Sonar Depth:    0.0000 m  Sonar Altitude: 4920.0000 m
-
- End of Data:
- Time:  08 14 1993 19:14:58.000000  JD226
- Lon:  \-49.1111     Lat:   12.1149     Depth:  5021.0000 meters
- Speed: 17.2800 km/hr ( 9.3405 knots)  Heading:  97.0000 degrees
- Sonar Depth:    0.0000 m  Sonar Altitude: 5021.0000 m
-
- Limits:
- Minimum Longitude:     \-49.3061   Maximum Longitude:     \-49.1064
- Minimum Latitude:       12.0750   Maximum Latitude:       12.1806
- Minimum Sonar Depth:     0.0000   Maximum Sonar Depth:     0.0000
- Minimum Altitude:     4087.0000   Maximum Altitude:     5034.0000
- Minimum Depth:        3726.0000   Maximum Depth:        5190.0000
- Minimum Amplitude:     100.0000   Maximum Amplitude:    6380.0000
-
-
-Suppose we wanted to know how noisy the outer beams are relative
-to the inner beams.  We might try:
- 	mbinfo \-F24 \-P5 \-Iexample_hs.mb24
-
-obtaining:
-
- Swath Data File:      example_hs.mb24
- MBIO Data Format ID:  24
- Format name:          MBF_HSLDEOIH
- Informal Description: L-DEO in-house binary Hydrosweep
- Attributes:           Hydrosweep DS, 59 beams, bathymetry and amplitude,
-                       binary, centered, L-DEO.
-
- Data Totals:
- Number of Records:              263
- Bathymetry Data (59 beams):
-   Number of Beams:            15517
-   Number of Good Beams:       13661     88.04%
-   Number of Zero Beams:         868      5.59%
-   Number of Flagged Beams:      988      6.37%
- Amplitude Data (59 beams):
-   Number of Beams:            15517
-   Number of Good Beams:       13661     88.04%
-   Number of Zero Beams:         868      5.59%
-   Number of Flagged Beams:      988      6.37%
- Sidescan Data (0 pixels):
-   Number of Pixels:               0
-   Number of Good Pixels:          0      0.00%
-   Number of Zero Pixels:          0      0.00%
-   Number of Flagged Pixels:       0      0.00%
-
- Navigation Totals:
- Total Time:             1.2425 hours
- Total Track Length:    20.9421 km
- Average Speed:         16.8548 km/hr ( 9.1107 knots)
-
- Start of Data:
- Time:  08 14 1993 18:00:25.000000  JD226
- Lon:  \-49.3011     Lat:   12.1444     Depth:  4920.0000 meters
- Speed: 18.3600 km/hr ( 9.9243 knots)  Heading:  97.2000 degrees
- Sonar Depth:    0.0000 m  Sonar Altitude: 4920.0000 m
-
- End of Data:
- Time:  08 14 1993 19:14:58.000000  JD226
- Lon:  \-49.1111     Lat:   12.1149     Depth:  5021.0000 meters
- Speed: 17.2800 km/hr ( 9.3405 knots)  Heading:  97.0000 degrees
- Sonar Depth:    0.0000 m  Sonar Altitude: 5021.0000 m
-
- Limits:
- Minimum Longitude:     \-49.3061   Maximum Longitude:     \-49.1064
- Minimum Latitude:       12.0750   Maximum Latitude:       12.1806
- Minimum Sonar Depth:     0.0000   Maximum Sonar Depth:     0.0000
- Minimum Altitude:     4087.0000   Maximum Altitude:     5034.0000
- Minimum Depth:        3726.0000   Maximum Depth:        5190.0000
- Minimum Amplitude:     100.0000   Maximum Amplitude:    6380.0000
-
- Beam Bathymetry Variances:
- Pings Averaged: 5
-  Beam     N      Mean     Variance    Sigma
-  \----     \-      \----     \--------    \-----
-    0      0       0.00       0.00      0.00
-    1      0       0.00       0.00      0.00
-    2    110    4719.59     342.69     18.51
-    3    105    4779.49     399.15     19.98
-    4    155    4748.81     280.18     16.74
-    5    155    4817.12     194.62     13.95
-    6    150    4826.44     197.76     14.06
-    7    160    4863.82     155.50     12.47
-    8    215    4806.08     229.11     15.14
-    9    235    4807.09     220.23     14.84
-   10    240    4766.29     158.83     12.60
-   11    250    4764.34     221.09     14.87
-   12    245    4765.35     146.24     12.09
-   13    250    4782.02     167.34     12.94
-   14    240    4798.38      92.98      9.64
-   15    245    4775.16      98.27      9.91
-   16    225    4782.35     136.30     11.67
-   17    210    4820.37      80.70      8.98
-   18    215    4821.15      80.97      9.00
-   19    215    4827.71      76.20      8.73
-   20    195    4842.65      84.22      9.18
-   21    190    4843.02     155.87     12.48
-   22    185    4884.28      73.69      8.58
-   23    175    4885.21      69.88      8.36
-   24    175    4871.47      52.01      7.21
-   25    180    4871.92      34.71      5.89
-   26    200    4830.80      36.83      6.07
-   27    205    4835.16      33.47      5.79
-   28    210    4809.96      43.07      6.56
-   29    190    4850.77      40.97      6.40
-   30    240    4768.69      64.23      8.01
-   31    240    4772.90      74.44      8.63
-   32    245    4760.11      57.97      7.61
-   33    255    4734.01      81.72      9.04
-   34    255    4728.19      82.21      9.07
-   35    260    4722.94      83.45      9.14
-   36    260    4721.95     102.02     10.10
-   37    260    4713.48      83.85      9.16
-   38    250    4715.40     101.33     10.07
-   39    255    4722.56     118.20     10.87
-   40    250    4727.48     109.13     10.45
-   41    255    4734.96     127.97     11.31
-   42    255    4724.53     124.06     11.14
-   43    230    4744.74     122.96     11.09
-   44    225    4752.16      98.22      9.91
-   45    230    4692.27     107.96     10.39
-   46    240    4696.93      95.93      9.79
-   47    230    4699.80     129.08     11.36
-   48    225    4696.32     145.20     12.05
-   49    220    4681.50     140.29     11.84
-   50    210    4676.16     103.35     10.17
-   51    180    4627.31     105.22     10.26
-   52    200    4654.55     207.85     14.42
-   53    130    4665.82     250.97     15.84
-   54    185    4704.29     300.80     17.34
-   55    135    4731.13     218.16     14.77
-   56    150    4736.29     178.16     13.35
-   57    115    4691.45     217.31     14.74
-   58      0       0.00       0.00      0.00
-
-.SH SEE ALSO
-\fBmbsystem\fP(1)
-
-.SH BUGS
-No bugs, only features. Maybe too many features...
diff --git a/src/man/man1/mbkongsbergpreprocess.1 b/src/man/man1/mbkongsbergpreprocess.1
deleted file mode 100644
index feea02e..0000000
--- a/src/man/man1/mbkongsbergpreprocess.1
+++ /dev/null
@@ -1,311 +0,0 @@
-.TH mbkongsbergpreprocess 1 "12 November 2014" "MB-System 5.0" "MB-System 5.0"
-.SH NAME
-\fBmbkongsbergpreprocess\fP \- performs preprocessing of data from third generation
-Kongsberg multibeam sonars (e.g. EM122, EM302, EM710, EM2040, M3).
-
-.SH VERSION
-Version 5.0
-
-.SH SYNOPSIS
-\fBmbkongsbergpreprocess\fP [\fB\-C\fP \fB\-D\fP\fIoutputdirectory\fP
-\fB\-E\fP\fIoffx/offy[/offdepth]\fP
-\fB\-F\fP\fIformat\fP
-\fB\-I\fIfile \fB\-O\fP\fIoutfile\fP \
-\fB\-P\fP\fIfilterlength/filterdepth\fP
-\fB\-S\fP\fIdatatype/source\fP
-\fB\-T\fP\fItimelag\fP \fB\-W \-H \-V\fP]
-
-.SH DESCRIPTION
-\fBmbkongsbergpreprocess\fP reads data from a third generation
-Kongsberg multibeam sonar (e.g. EM122, EM302, EM710, EM2040, M3), interpolates the
-asynchronous navigation, heading, and attitude onto the multibeam data,
-and writes a new file with that information correctly embedded
-in the multibeam survey data. The input files may be in the vendor format
-MBF_EM710RAW (format id 58) or the \fBMB-System\fP extended format
-MBF_EM710MBA (format id 59); the output files will always be in
-the \fBMB-System\fP extended format MBF_EM710MBA (format id 59).
-
-Like most modern swath survey data streams, Kongsberg multibeam data
-includes navigation, attitude, and heading data logged in separate
-data records as output by the respective sensors. Since each of these
-values is time stamped according to its origin rather than synced with
-multibeam pings, these values are asynchronous relative to the survey
-ping data. When multiple sources
-of navigation, heading, and/or attitude have been recorded in
-a data stream, \fBmbkongsbergpreprocess\fP allows the user to specify
-which asynchronous data are extracted and interpolated onto the
-survey data using the \fB\-S\fP option.
-
-This program allows the correction of a time latency
-(or time lag)  error between the sonar data and the attitude and
-navigation data using the \fB\-T\fP option.
-
-The format 58 files This program also creates four ancilliary files containing the full
-asynchronous attitude, sonar depth, and heading data and the synchronous
-attitude data in parallel with each output format 59 file.
-These files are used,
-when present, by \fBmbeditviz\fP to facillitate interactive analysis
-of time lag issues. Each of these are
-text files with white-space delimited columns; the first column
-is always time in decimal unix seconds. These have the following
-suffixes:
-    asynchronous attitude (roll and pitch):	*.ata
-    asynchronous heading:			*.ath
-    asynchronous sonar depth:			*.ats
-    synchronous attitude (roll and pitch):	*.sta
-    
-By default, \fBmbkongsbergpreprocess\fP ignores water column records and does
-not pass these large records into the output format 59 files. The \fB-W\fP\fI1\fP
-option causes the water column records to be written in the output files.
-
-.SH AUTHORSHIP
-David W. Caress (caress at mbari.org)
-.br
-  Monterey Bay Aquarium Research Institute
-.br
-Dale N. Chayes (dale at ldeo.columbia.edu)
-.br
-  Lamont-Doherty Earth Observatory
-
-.SH OPTIONS
-.TP
-.B \-C
-.br
-This option causes \fBmbkongsbergpreprocess\fP to print counts of the many
-different data record types compising a Kongsberg data stream. The data record
-counts are output for each file and as totals from all files processed.
-.TP
-.B \-D
-\fIoutputdirectory\fP
-.br
-This option causes all format 59 output files to be placed in the specified directory
-\fIoutputdirectory\fP rather than parallel to the original "raw" files.
-.TP
-.B \-E
-\fIoffx/offz[/offdepth]\fP
-.br
-This option is for data from submerged platforms such as ROVs or AUVs.
-This sets horizontal and vertical.distance offsets between the vehicle's
-depth sensor and the multibeam receive head. If specified, these values are used
-in a lever-arm calculation to determine the sonar depth change  associated with
-vehicle pitch. The \fIoffdepth\fP value, if specified, is a static depth offset to be
-applied to the vehicle depth data.
-.TP
-.B \-F
-\fIformat\fP
-.br
-Sets the data format used if the input is read from stdin
-or from a file. If \fIformat\fP < 0, then the input file specified
-with the \fB\-I\fP option will actually contain a list of input swath sonar
-data files. This program only reads third generation Kongsberg multibeam
-format data files (\fBMBIO\fP formats 58 and 59).
-.TP
-.B \-H
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-.TP
-.B \-I
-\fIinfile\fP
-.br
-Sets the input file path. If \fIformat\fP > 0 (set with the
-\fB\-f\fP option or \fBmbdefaults\fP) then the swath sonar data contained in \fIinfile\fP
-is read and processed. If \fIformat\fP < 0, then \fIinfile\fP
-is assumed to be an ascii file containing a list of the input swath sonar
-data files to be processed and their formats.  The program will read
-the data in each one of these files.
-In the \fIinfile\fP file, each
-data file should be followed by a data format identifier, e.g.:
- 	datafile.all 58
- 	datafile.all 58
-.br
-This program only reads third generation Kongsberg multibeam
-format data files (\fBMBIO\fP formats 58 and 59).
-.TP
-.B \-O
-\fIoutfile\fP
-.br
-This option causes \fBmbkongsbergpreprocess\fP to output all data to a single file
-specified as \fIoutfile\fP. By default, the program creates output files for
-each input file. If the \fB\-D\fP\fIoutputdirectory\fP option is also used, then
-the output file \fIoutfile\fP will be in \fIoutputdirectory\fP.
-.TP
-.B \-P
-\fIfilterlength/filterdepth\fP
-This option specifies Gaussian tapered time domain filtering of the
-sonar depth data to be merged with the survey data, regardless of source.
-The \fIfilterlength\fP value specifies
-the filter window length in seconds, and the \fIfilterdepth\fP value controls
-the depths to which filtering is applied. The filtered sonar depth is used
-to depths up to twice the \fIfilterdepth\fP value. Below that threshold, the
-value used transitions to unfiltered with an exponential taper. This filtering
-is used in two ways. First, one can apply short period smoothing of noisy
-sonar depth at all by specifying a small \fIfilterlength\fP (e.g. 2 seconds)
-and a \fIfilterdepth\fP value deeper than the vehicle's track. Second, when
-an AUV or ROV is operated at shallow depths, the pressure
-values used to determine depth are affected by waves at the sea surface. In this
-case, a longer period \fIfilterlength\fP (e.g. 10 seconds) and a shallower
-\fIfilterdepth\fP (e.g. 50 meters) may be used to lessen the artifacts due to
-surface swell.
-.TP
-.B \-S
-\fIdatatype/source\fP
-.br
-This option specifies which data records should be the source of the
-navigation (\fIdatatype\fP = 1), heading (\fIdatatype\fP = 2), 
-attitude (\fIdatatype\fP = 3), and sonar depth  (\fIdatatype\fP = 4)
-data that are interpolated onto the
-survey ping times. In each case the \fIsource\fP value specifies
-a data record type. The possibilities for Kongsberg data include:
-     MB_DATA_DATA		1
-     MB_DATA_NAV		12
-     MB_DATA_HEIGHT		16
-     MB_DATA_HEADING		17
-     MB_DATA_ATTITUDE		18
-     MB_DATA_NAV1		28
-     MB_DATA_NAV2		29
-     MB_DATA_NAV3		30
-     MB_DATA_ATTITUDE1		55
-     MB_DATA_ATTITUDE2		56
-     MB_DATA_ATTITUDE3		57
-.br
-The default values are:
-     nav_source = MB_DATA_NAV
-     attitude_source = MB_DATA_ATTITUDE
-     heading_source = MB_DATA_NAV
-     sonardepth_source = MB_DATA_DATA
-.br
-.TP
-.B \-T
-\fItimelag\fP
-.br
-This option specifies a \fItimelag\fP value in seconds to be applied
-to the navigation and attitude data prior to it being merged with the
-bathymetry. If \fItimelag\fP is a valid path to a file containing time
-stamp and time lag pairs, then these data will be read and the time lag
-applied to particular records will be interpolated by time.
-.TP
-.B \-W
-\fImode\fP
-.br
-By default, \fBmbkongsbergpreprocess\fP ignores water column records and does
-not pass these large records into the output format 59 files. If \fB-W\fP\fI1\fP
-is specified, then the water column records will be written to the output files.
-
-.SH EXAMPLES
-Suppose that one has collected a set of three Kongsberg EM122 data files named:
-    0000_20111219_154640_METEOR_EM122.all
-    0001_20111219_163703_METEOR_EM122.all
-    0002_20111219_175708_METEOR_EM122.all
-.br
-First, we want to generate a "datalist" file referencing the raw survey files. The
-following will suffice:
-    /bin/ls \-1 *all | awk '{print $1" 58"}' > datalist_raw.mb-1
-.br
-We want to use \fBmbkongsbergpreprocess\fP to gracefully interpolate the
-asynchronous navigation, heading and attitude data onto the survey data and
-to generate data files in the extended format (MBF_EM710MBA = 59). To learn
-which potential sources of navigation, heading and attitude are available, use
-\fBmbinfo\fP with the \fB\-N\fP option:
-    $ mbinfo \-I 0000_20111219_154640_METEOR_EM122.all \-N
-
-The \fB\-N\fP option causes \fBmbinfo\fP to generate a list of the data record
-types read in the file at the end of the file statistics:
-.br
-    Swath Data File:      0000_20111219_154640_METEOR_EM122.all
-    MBIO Data Format ID:  58
-    Format name:          MBF_EM710RAW
-    Informal Description: Kongsberg current multibeam vendor format
-    Attributes:           Kongsberg EM122, EM302, EM710,
- 			  bathymetry, amplitude, and sidescan,
- 			  up to 400 beams, variable pixels, binary, Kongsberg.
-
-    Data Totals:
-    Number of Records:                         334
-    Bathymetry Data (432 beams):
-      Number of Beams:           144288
-      Number of Good Beams:      129951     90.06%
-      Number of Zero Beams:           0      0.00%
-      Number of Flagged Beams:    14337      9.94%
-    Amplitude Data (432 beams):
-      Number of Beams:           144288
-      Number of Good Beams:      129951     90.06%
-      Number of Zero Beams:           0      0.00%
-      Number of Flagged Beams:    14337      9.94%
-    Sidescan Data (1024 pixels):
-      Number of Pixels:          342016
-      Number of Good Pixels:     289910     84.77%
-      Number of Zero Pixels:          0      0.00%
-      Number of Flagged Pixels:   52106     15.23%
-
-    Navigation Totals:
-    Total Time:             0.8327 hours
-    Total Track Length:    13.6418 km
-    Average Speed:         16.3823 km/hr ( 8.8553 knots)
-
-    Start of Data:
-    Time:  12 19 2011 15:46:27.537000  JD353 (2011-12-19T15:46:27.537000)
-    Lon:   \-11.562232000     Lat:    36.848179850     Depth:  4931.4829 meters
-    Speed: 17.6040 km/hr ( 9.5157 knots)  Heading: 129.1900 degrees
-    Sonar Depth:    5.6975 m  Sonar Altitude: 5025.2964 m
-
-    End of Data:
-    Time:  12 19 2011 16:36:25.308000  JD353 (2011-12-19T16:36:25.308000)
-    Lon:   \-11.489473500     Lat:    36.771997400     Depth:  3242.5244 meters
-    Speed: 12.7800 km/hr ( 6.9081 knots)  Heading: 274.9200 degrees
-    Sonar Depth:    6.4334 m  Sonar Altitude: 3236.0911 m
-
-    Limits:
-    Minimum Longitude:     \-11.635798757   Maximum Longitude:     \-11.391532562
-    Minimum Latitude:       36.723994163   Maximum Latitude:       36.919907119
-    Minimum Sonar Depth:     5.0135   Maximum Sonar Depth:     6.9798
-    Minimum Altitude:     3175.1121   Maximum Altitude:     5027.8770
-    Minimum Depth:        2391.9229   Maximum Depth:        5121.0713
-    Minimum Amplitude:     \-59.2000   Maximum Amplitude:      \-9.1000
-    Minimum Sidescan:      \-90.1300   Maximum Sidescan:       \-0.4700
-
-    Data Record Type Notices:
-    DN: 334 MB_DATA_DATA (ID=1): survey data
-    DN: 1 MB_DATA_VELOCITY_PROFILE (ID=6): SVP
-    DN: 1 MB_DATA_START (ID=10): Simrad start datagram
-    DN: 1 MB_DATA_STOP (ID=11): Simrad stop datagram
-    DN: 3023 MB_DATA_NAV (ID=12): Navigation record
-    DN: 287 MB_DATA_RUN_PARAMETER (ID=13): Simrad runtime parameter datagram
-    DN: 3022 MB_DATA_CLOCK (ID=14): Simrad clock datagram
-    DN: 2964 MB_DATA_ATTITUDE (ID=18): Attitude record
-    DN: 731 MB_DATA_SSV (ID=19): Surface sound speed record
-    DN: 3022 MB_DATA_NAV3 (ID=30): Auxiliary nav system 3
-    DN: 3023 MB_DATA_STATUS (ID=46): Status record
-    DN: 2964 MB_DATA_ATTITUDE1 (55): ancillary attitude system 1
-    DN: 1512 MB_DATA_ATTITUDE2 (56): ancillary attitude system 2
-
-    Nonfatal Error Notices:
-    EN: 20551 MB_ERROR_NO_DATA_REQUESTED (ID=\-11): No data requested for buffer load
-
-    Problem Notices:
-
-This listing shows that the format 58 file includes
-MB_DATA_NAV (\fIsource\fP = 12) and MB_DATA_NAV3 (\fIsource\fP = 30) records,
-both of which include both position and heading data. Also included are three
-sources of attitude data: MB_DATA_ATTITUDE (\fIsource\fP = 18),
-MB_DATA_ATTITUDE1 (\fIsource\fP = 55), and MB_DATA_ATTITUDE2 (\fIsource\fP = 56).
-
-To extract and use the default navigation, heading, and attitude data, the
-following will suffice:
-    mbkongsbergpreprocess \-I datalist_raw.mb-1 \-V
-
-An equivalent command that explicitly specifies the default asynchronous data
-sources using \fB\-S\fP\fI1/source\fP for navigation, \fB\-S\fP\fI2/source\fP for
-heading, and \fB\-S\fP\fI3/source\fP for attitude is:
-    mbkongsbergpreprocess \-I datalist_raw.mb-1 \-V \fB\-S\fP\fI1/12\fP \fB\-S\fP\fI2/12\fP \fB\-S\fP\fI3/18\fP
-
-To interpolate navigation and heading from the secondary navigation source, use
-    \fB\-S\fP\fI1/30\fP \fB\-S\fP\fI2/30\fP
-
-To interpolate attitude from ancillary attitude system 2, use:
-    \fB\-S\fP\fI3/56\fP
-
-.SH SEE ALSO
-\fBmbsystem\fP(1), \fBmbformat\fP(1), \fBmbinfo\fP(1)
-
-.SH BUGS
-Not true bugs. More like arachnids.
diff --git a/src/man/man1/mblevitus.1 b/src/man/man1/mblevitus.1
deleted file mode 100644
index 8a6d78c..0000000
--- a/src/man/man1/mblevitus.1
+++ /dev/null
@@ -1,224 +0,0 @@
-.TH mblevitus 1 "3 June 2013" "MB-System 5.0" "MB-System 5.0"
-.SH NAME
-\fBmblevitus\fP \- Create a water velocity profile which is representative
-of the mean annual water column for a specified 1 degree by 1 degree
-region.
-
-.SH VERSION
-Version 5.0
-
-.SH SYNOPSIS
-\fBmblevitus\fP [\fB\-R\fIlon/lat \fB\-O\fIoutfile \fB\-V \-H\fP]
-
-.SH DESCRIPTION
-\fBmblevitus\fP generates a mean water sound velocity profile for a 
-specified location using temperature and salinity data
-from the 1982 Climatological Atlas of the World Ocean [Levitus, 1982].
-The water velocity profile is representative of the mean annual
-water column structure for a specified 1 degree by 1 degree region.
-The profile is output to a specified file which can be read and
-used by programs (e.g. \fBmbbath\fP or \fBmbvelocitytool\fP) 
-which calculate swath sonar sonar
-bathymetry from travel times by raytracing through a water velocity
-model.  
-
-The Levitus [1982] reference is:
-     Levitus, S, Climatological Atlas of the World Ocean, 
-     NOAA Professional Paper 13, U.S. Government Printing Office, 
-     Washington D.C., 173pp, 1982.
-.br
-The water sound velocity values are calculated using
-the DelGrosso equations, following:
-     Dusha, B. D., P. F. Worcester, B. D. Cornuelle, 
-       B. M. Howe, "On equations for the speed of 
-       sound in seawater", J. Acoust. Soc. Am., 93, 
-       255-275, 1993
-.br
-The implementation of these equations follows code written
-at the Ocean Data Facility of the Scripps Institution of
-Oceanography.
-The depth to which the Levitus database defines the water
-column reflects regional water depths which may be exceeded in
-places.  \fBmblevitus\fP extends the water sound velocity profiles
-to a depth of 12000 meters using the deepest salinity and
-temperature values available in the database.
-If the specified location is
-subaerial, then no water velocity profile is calculated.
-
-.SH AUTHORSHIP
-David W. Caress (caress at mbari.org)
-.br
-  Monterey Bay Aquarium Research Institute
-.br
-Dale N. Chayes (dale at ldeo.columbia.edu)
-.br
-  Lamont-Doherty Earth Observatory
-
-.SH OPTIONS
-.TP
-.B \-H
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-.TP
-.B \-O
-\fIoutfile\fP
-.br
-Sets the output file for the water velocity profile. 
-Default: \fIoutfile\fP = "velocity".
-.TP
-.B \-R
-\fIlon/lat\fP
-.br
-Sets the longitude and latitude of the location of the water
-velocity profile.  Whole degrees should be used, as the database
-has a 1 degree by 1 degree resolution.
-Default: \fIlon\fP=0, \fIlat\fP=0.
-.TP
-.B \-V
-Normally, \fBmblevitus\fP outputs only a minor bit of information 
-to the stdout stream.  If the
-\fB\-V\fP flag is given, then \fBmblevitus\fP works in a "verbose" mode and
-also outputs the program version being used and the complete
-water column structure used to calculate the water velocity profile.
-
-.SH EXAMPLES
-Suppose that one wishes to obtain a mean annual water velocity profile
-for processing Hydrosweep DS bathymetry data collected on the 
-Cocos-Nazca spreading center at 95W longitude and 2N latitude.
-The following will suffice:
-.br
- 	mblevitus \-R-95/2 \-Ovelocity_profile \-V
-.br
-The output will be:
-
- Program MBLEVITUS
- MB-system Version 4.5
-
- Location for mean annual water velocity profile:
-   Requested:  \-95.0000 longitude   2.0000 latitude
-   Used:       265.5000 longitude   2.5000 latitude
- Values defined directly by Levitus database:      27
- Values assuming deepest salinity and temperature: 19
- Velocity points written:                          46
- Output file: velocity_profile
-
- Mean annual water column profile:
-      Depth Temperature Salinity   Velocity
-     0.0000   25.6560   33.8830   1534.6998
-    10.0000   25.4080   33.8230   1534.2112
-    20.0000   24.5410   34.0190   1532.5010
-    30.0000   23.3290   34.2400   1529.9032
-    50.0000   19.7940   34.7450   1521.4298
-    75.0000   15.9700   34.9210   1510.8373
-   100.0000   14.5630   34.9400   1506.8495
-   125.0000   13.9500   34.9320   1505.2728
-   150.0000   13.5920   34.9270   1504.5077
-   200.0000   13.0430   34.9100   1503.4935
-   250.0000   12.4510   34.8780   1502.2893
-   300.0000   11.4720   34.8190   1499.6840
-   400.0000    9.4060   34.6990   1493.8119
-   500.0000    8.0400   34.6390   1490.2903
-   600.0000    7.0330   34.5950   1488.0126
-   700.0000    6.2200   34.5740   1486.4380
-   800.0000    5.5640   34.5620   1485.4464
-   900.0000    5.0280   34.5620   1484.9211
-  1000.0000    4.5840   34.5650   1484.7546
-  1100.0000    4.1950   34.5730   1484.8076
-  1200.0000    3.8570   34.5820   1485.0649
-  1300.0000    3.5860   34.5970   1485.6061
-  1400.0000    3.3320   34.6090   1486.2123
-  1500.0000    3.1020   34.6140   1486.9097
-  1750.0000    2.6290   34.6280   1489.0920
-  2000.0000    2.3010   34.6440   1491.9139
-  2500.0000    1.8770   34.6670   1498.6154
-  3000.0000    0.0000    0.0000   1507.2345
-  3500.0000    0.0000    0.0000   1515.9406
-  4000.0000    0.0000    0.0000   1524.7273
-  4500.0000    0.0000    0.0000   1533.5883
-  5000.0000    0.0000    0.0000   1542.5173
-  5500.0000    0.0000    0.0000   1551.5078
-  6000.0000    0.0000    0.0000   1560.5533
-  6500.0000    0.0000    0.0000   1569.6471
-  7000.0000    0.0000    0.0000   1578.7823
-  7500.0000    0.0000    0.0000   1587.9523
-  8000.0000    0.0000    0.0000   1597.1499
-  8500.0000    0.0000    0.0000   1606.3682
-  9000.0000    0.0000    0.0000   1615.6001
-  9500.0000    0.0000    0.0000   1624.8383
- 10000.0000    0.0000    0.0000   1634.0754
- 10500.0000    0.0000    0.0000   1643.3042
- 11000.0000    0.0000    0.0000   1652.5171
- 11500.0000    0.0000    0.0000   1661.7062
- 12000.0000    0.0000    0.0000   1670.8641
-
-The contents of the output file velocity_profile are:
- # Water velocity profile created by program MBLEVITUS 
- # MB-system Version 4.5
- # Run by user <caress> on cpu <menard> at <Wed Mar 26 15:43:53 1997>
- # Water velocity profile derived from Levitus
- # temperature and salinity database.  This profile
- # represents the annual average water velocity
- # structure for a 1 degree X 1 degree area centered
- # at 265.5000 longitude and 2.5000 latitude.
- # This water velocity profile is in the form
- # of discrete (depth, velocity) points where
- # the depth is in meters and the velocity in
- # meters/second.
- # The first 27 velocity values are defined using the
- # salinity and temperature values available in the
- # Levitus database; the remaining 19 velocity values are
- # calculated using the deepest temperature
- # and salinity value available.
- 0.000000 1534.699829
- 10.000000 1534.211182
- 20.000000 1532.500977
- 30.000000 1529.903198
- 50.000000 1521.429810
- 75.000000 1510.837280
- 100.000000 1506.849487
- 125.000000 1505.272827
- 150.000000 1504.507690
- 200.000000 1503.493530
- 250.000000 1502.289307
- 300.000000 1499.683960
- 400.000000 1493.811890
- 500.000000 1490.290283
- 600.000000 1488.012573
- 700.000000 1486.437988
- 800.000000 1485.446411
- 900.000000 1484.921143
- 1000.000000 1484.754639
- 1100.000000 1484.807617
- 1200.000000 1485.064941
- 1300.000000 1485.606079
- 1400.000000 1486.212280
- 1500.000000 1486.909668
- 1750.000000 1489.092041
- 2000.000000 1491.913940
- 2500.000000 1498.615356
- 3000.000000 1507.234497
- 3500.000000 1515.940552
- 4000.000000 1524.727295
- 4500.000000 1533.588257
- 5000.000000 1542.517334
- 5500.000000 1551.507812
- 6000.000000 1560.553345
- 6500.000000 1569.647095
- 7000.000000 1578.782349
- 7500.000000 1587.952271
- 8000.000000 1597.149902
- 8500.000000 1606.368164
- 9000.000000 1615.600098
- 9500.000000 1624.838257
- 10000.000000 1634.075439
- 10500.000000 1643.304199
- 11000.000000 1652.517090
- 11500.000000 1661.706177
- 12000.000000 1670.864136
-
-.SH SEE ALSO
-\fBmbsystem\fP(1), \fBmbvelocitytool\fP(1), \fBmbprocess\fP(1), \fBmbset\fP(1), 
-\fBmbm_xbt\fP(1)
-
-.SH BUGS
-None known.
diff --git a/src/man/man1/mblist.1 b/src/man/man1/mblist.1
deleted file mode 100644
index d699529..0000000
--- a/src/man/man1/mblist.1
+++ /dev/null
@@ -1,731 +0,0 @@
-.TH mblist 1 "17 May 2014" "MB-System 5.0" "MB-System 5.0"
-.SH NAME
-\fBmblist\fP \- List data in swath data files.
-
-.SH VERSION
-Version 5.0
-
-.SH SYNOPSIS
-\fBmblist\fP [\fB\-A\fP \fB\-B\fP\fIyr/mo/da/hr/mn/sc\fP
-\fB\-C\fP
-\fB\-D\fP\fIdumpmode\fP
-\fB\-E\fP\fIyr/mo/da/hr/mn/sc\fP \fB\-F\fP\fIformat\fP \fB\-G\fP\fIdelimiter\fP
-\fB\-H\fP \fB\-I\fP\fIinfilename\fP \fB\-K\fP\fIdecimate\fP
-\fB\-L\fP\fIlonflip\fP \fB\-M\fP[\fIstart_beam/end_beam\fP | \fBA\fP | \fBX\fP\fIpercentage\fP]
-\fB\-N\fP\fIstart_pixel/end_pixel\fP
-\fB\-O\fP\fIoutput_format\fP \fB\-P\fP\fIpings\fP \fB\-Q\fP
-\fB\-R\fP\fIwest/east/south/north\fP
-\fB\-S\fP\fIspeed\fP \fB\-T\fP\fItimegap\fP
-\fB\-U\fP\fIcheck\fP \fB\-V\fP \fB\-W\fP
-\fB\-X\fP\fIoutfile\fP
-\fB\-Z\fP\fIsegment\fP]
-
-.SH DESCRIPTION
-\fBmblist\fP is a utility to list the contents of a swath
-data file or files to stdout. By default, \fBmblist\fP
-produces ASCII files in
-spreadsheet style, with data columns separated by tabs. Alternatively,
-other column delimiters can be used (\fB\-G\fP option), or
-the output can be binary, with each field represented
-as a double precision float (\fB\-A\fP option).
-Output can also be in netCDF CDL (\fB\-C\fP option) format,
-or as a binary netCDF file (\fB\-C \-A\fP).
-The output of
-\fBmblist\fP can be piped to plotting and data analysis programs. The
-option \fB\-O\fP\fIoutput_format\fP can be
-used to control the data types that
-are sent to stdout. The default is to output a single record for
-each survey ping, and for any output navigation values to reflect
-the sonar or ship navigation. In this mode, any output depth,
-amplitude, or sidescan values are derived from the beam and pixel
-located closest to the navigation (the most vertical position under
-the sonar). If the \fB\-M\fP or \fB\-N\fP options
-are used to set specific ranges of beams or pixels to be used,
-then records are output for each of the specified beams or
-pixels and any navigation, depth or sidescan values output reflect
-the positions and values of the specified beams or pixels.
-The data input may be averaged or windowed in time
-and space before it is listed.  Complete dumps of bathymetry,
-amplitude, or sidescan data are possible as well.
-
-.SH AUTHORSHIP
-David W. Caress (caress at mbari.org)
-.br
-  Monterey Bay Aquarium Research Institute
-.br
-Dale N. Chayes (dale at ldeo.columbia.edu)
-.br
-  Lamont-Doherty Earth Observatory
-.br
-Alberto Malinverno
-.br
-  Schlumberger-Doll
-
-.SH OPTIONS
-.TP
-.B \-A
-.br
-Causes the output to be binary (native double precision floating
-point) rather than ASCII. Some
-output options cannot be represented as single binary floats (e.g.
-time strings and longitude or latitude broken into degrees
-and minutes. These values are output as multiple fields as
-appropriate.
-Default: ASCII output with fields separated by tabs, or by another
-delimiter specified with the \fB\-G\fP option.
-.TP
-.B \-B
-\fIyr/mo/da/hr/mn/sc\fP
-.br
-This option sets the starting time for data allowed in the input data.
-The \fB\-E\fP option sets the ending time for data. If the
-starting time is before the ending time, then any data
-with a time stamp before the starting time or after the
-ending time is ignored. If instead the starting time is
-after the ending time, then any data between the ending
-and starting time will be ignored. This scheme allows time
-windowing both inside and outside a specified interval.
-Default: \fIyr/mo/da/hr/mn/sc\fP = 1962/2/21/10/30/0.
-.TP
-.B \-C
-.br
-Causes netCDF CDL format output to be generated (see \fBncgen\fP).
-When the \fB\-A\fP (binary) option is also set \fBmblist\fP will call \fBncgen\fP to
-convert the CDL file to a binary netCDF file (default name is \fImblist.nc\fP),
-if successful the CDL file will be removed.
-.TP
-.B \-D
-\fIdumpmode\fP
-.br
-Normally, the output format is controlled by the \fB\-O\fP option and
-the number of beams or pixels which are output is controlled by
-the \fB\-M\fP and \fB\-N\fP options.  The \fB\-D\fP option provides
-a short cut for producing complete dumps of the longtitude and
-latitude locations of all beams or pixels along with the
-associated bathymetry, topography, amplitude, or sidescan values.
-The "lon lat value" triples are often useful for input into
-gridding programs (e.g. the \fBGMT\fP program \fBsurface\fP) or
-other utilities. All valid (positive) values will be output, unless
-the \fB\-Q\fP option is used to disable value checking.
-The \fIdumpmode\fP options are:
-.IP
-\fIdumpmode\fP = 1:  format controlled by \fB\-O\fP option
-.IP
-\fIdumpmode\fP = 2:  longitude latitude depth
-.IP
-\fIdumpmode\fP = 3:  longitude latitude topography
-.IP
-\fIdumpmode\fP = 4:  longitude latitude amplitude
-.IP
-\fIdumpmode\fP = 5:  longitude latitude sidescan
-.br
-Use of the \fB\-D\fP option supercedes the \fB\-O\fP, \fB\-M\fP,
-and \fB\-N\fP options.
-Default: \fImode\fP = 1.
-.TP
-.B \-E
-\fIyr/mo/da/hr/mn/sc\fP
-.br
-This option sets the ending time for data allowed in the input data.
-The \fB\-B\fP option sets the starting time for data. If the
-starting time is before the ending time, then any data
-with a time stamp before the starting time or after the
-ending time is ignored. If instead the starting time is
-after the ending time, then any data between the ending
-and starting time will be ignored. This scheme allows time
-windowing both inside and outside a specified interval.
-Default: \fIyr/mo/da/hr/mn/sc\fP = 2062/2/21/10/30/0.
-.TP
-.B \-F
-\fIformat\fP
-.br
-Sets the format for the input swath data using
-\fBMBIO\fP integer format identifiers.
-This program uses the \fBMBIO\fP library and will read any swath
-format supported by \fBMBIO\fP. A list of the swath data formats
-currently supported by \fBMBIO\fP and their identifier values
-is given in the \fBMBIO\fP manual page. Default: \fIformat\fP = 11.
-.TP
-.B \-G
-\fIdelimiter\fP
-.br
-Sets the character(s) used to separate output fields when ascii
-columns are output. Default: tabs are used as delimiters.
-.TP
-.B \-H
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-.TP
-.B \-I
-\fIfilename\fP
-.br
-Sets the input filename. If \fIformat\fP > 0 (set with the
-\fB\-F\fP option) then the swath data contained in \fIinfile\fP
-is read and processed. If \fIformat\fP < 0, then \fIinfile\fP
-is assumed to be an ascii file containing a list of the input swath
-data files to be processed and their formats.  The program will read
-the data in each one of these files.
-In the \fIinfile\fP file, each
-data file should be followed by a data format identifier, e.g.:
- 	datafile1 11
- 	datafile2 24
-.br
-This program uses the \fBMBIO\fP library and will read any swath
-format supported by \fBMBIO\fP. A list of the swath data formats
-currently supported by \fBMBIO\fP and their identifier values
-is given in the \fBMBIO\fP manual page.
-Default: \fIinfile\fP = "datalist.mb-1".
-.TP
-.B \-K
-\fIdecimate\fP
-.br
-Sets the decimation of the output data. By default (i.e. \fIdecimate\fP=1),
-every available data record is output. If \fIdecimate\fP>1, then only
-every "\fIdecimate\fP"th record will be output. Default: \fIdecimate\fP=1.
-.TP
-.B \-L
-\fIlonflip\fP
-.br
-Sets the range of the longitude values returned.
-If \fIlonflip\fP=\-1 then the longitude values will be in
-the range from \-360 to 0 degrees. If \fIlonflip\fP=0
-then the longitude values will be in
-the range from \-180 to 180 degrees. If \fIlonflip\fP=1
-then the longitude values will be in
-the range from 0 to 360 degrees.
-Default: \fIlonflip\fP = 0.
-.TP
-.B \-M
-\fIstart_beam/end_beam\fP or \fBA\fP or \fBX\fP\fIexcludepercent\fP
-.br
-Determines the range of bathymetry beams for which records will be output.
-If this option is used, then any longitude and latitude values output
-will reflect the positions of individual beams on the seafloor.
-If \fB\-MA\fP is given, then a record
-will be output for each valid beam. If \fIstart_beam/end_beam\fP
-is specified, then records will be output only for beams in this
-range. Beam numbers start with zero on the port side.
-If \fB\-MX\fP\fIexcludepercent\fP is given, then records will be output
-for each valid, non-excluded beam where the outer \fIexcludepercent\fP
-percentage of beams are excluded.
-The default is to output a single record for each ping
-in which longitude and latitude values reflect
-the sonar navigation, the depth,
-topography, and amplitude values reflect the valid beam
-nearest to vertical, and the sidescan value reflects the pixel
-nearest to vertical.
-.TP
-.B \-N
-\fIstart_pixel/end_pixel\fP or \fIA\fP
-.br
-Determines the range of sidescan pixels for which records will be output.
-If \fIstart_pixel/end_pixel\fP
-is specified, then records will be output only for pixels in this
-range. Pixel numbers start with zero on the port side. The default is
-to not output records associated with sidescan pixels. Instead,
-the default is to output a single record for each ping
-in which longitude and latitude values reflect
-the sonar navigation, the depth,
-topography, and amplitude values reflect the valid beam
-nearest to vertical, and the sidescan value reflects the pixel
-nearest to vertical. If \fB\-N\fP\fIA\fP is given, then a record
-will be output for all sidescan pixels.
-.TP
-.B \-O
-\fIoutput_format\fP
-.br
-Determines the form of the output. \fIOutput_format\fP is a string composed
-of one or more of the following characters:
-.IP
-\fB/\fP
-special character: this causes the value
-indicated by the next character to be  inverted. This applies only to simple
-numeric values such as depth and
-heading and not to values like time
-strings or positions with hemisphere
-characters.
-.IP
-\fB\-\fP
-special character: this causes the value
-indicated by the next character to be
-multiplied by \-1. This applies only
-to simple numeric values such as
-depth and heading and not to values
-like time strings or positions with
-hemisphere characters.
-.IP
-\fB=\fP
-special character: this causes the value
-indicated by the next character to
-derive from the port-most non-null
-beam or pixel. This applies only
-to numeric values associated with
-beams or pixels such as depth, longitude,
-or latitude.
-.IP
-\fB+\fP
-special character: this causes the value
-indicated by the next character to
-derive from the starboard-most non-null
-beam or pixel. This applies only
-to numeric values associated with
-beams or pixels such as depth, longitude,
-or latitude.
-.IP
-\fBA\fP
-for apparent seafloor crosstrack slope
-(degrees from horizontal with positive
-slopes dipping toward port.) Calculated
-by fitting a line to the the
-bathymetry data of each ping.
-.IP
-\fBa\fP
-for apparent seafloor crosstrack slope
-(degrees from horizontal with positive
-slopes dipping toward port.) Calculated
-by interpolation for each beam or pixel.
-.IP
-\fBB\fP
-for amplitude
-.IP
-\fBb\fP
-for sidescan
-.IP
-\fBC\fP
-for sonar altitude above the bottom (m)
-.IP
-\fBc\fP
-for sonar tranducer depth (m)
-.IP
-\fBD\fP
-for bathymetry acrosstrack distance (m)
-.IP
-\fBd\fP
-for sidescan acrosstrack distance (m)
-.IP
-\fBE\fP
-for bathymetry alongtrack distance (m)
-.IP
-\fBe\fP
-for sidescan alongtrack distance (m)
-.IP
-\fBF\fP
-for beamflag numeric value (1=null, 0=good, 5=manual, 9=filter, 129=sonar).
-.IP
-\fBf\fP
-for beamflag character value ('-'=null, 'G'=good, 'M'=manual, 'F'=filter, 'S'=sonar).
-.IP
-\fBG\fP
-for flat bottom grazing angle (degrees)
-.IP
-\fBg\fP
-for grazing angle using seafloor slope (degrees)
-.IP
-\fBH\fP
-for heading (degrees)
-.IP
-\fBh\fP
-for course made good (degrees)
-.IP
-\fBJ\fP
-for a time string (yyyy jd hh mm ss.ssssss)
-where jd is the day of the year
-.IP
-\fBj\fP
-for a time string (yyyy jd dm ss.ssssss)
-where jd is the day of the year
-and dm is the minute of the day
-.IP
-\fBL\fP
-for cumulative along-track distance (km)
-.IP
-\fBl\fP
-for cumulative along-track distance (m)
-.IP
-\fBM\fP
-for unix (epoch) time in decimal seconds since 1/1/70 00:00:00
-.IP
-\fBm\fP
-for time in decimal seconds since first record
-.IP
-\fBN\fP
-for ping count
-.IP
-\fBP\fP  for pitch in degrees
-.IP
-\fBp\fP  for draft in meters
-.IP
-\fBQ\fP  for bottom detection type as letter (A=amplitude, P=phase, U=unknown)
-.IP
-\fBq\fP  for bottom detection type as number (1=amplitude, 2=phase, 0=unknown)
-.IP
-\fBR\fP  for roll in degrees
-.IP
-\fBr\fP  for heave in meters
-.IP
-\fBS\fP  for speed (km/hr)
-.IP
-\fBs\fP  for speed made good (km/hr)
-.IP
-\fBT\fP  for a time string (yyyy/mm/dd/hh/mm/ss)
-.IP
-\fBt\fP  for a time string (yyyy mm dd hh mm ss)
-.IP
-\fBU\fP  for unix time in integer seconds since 1/1/70 00:00:00
-.IP
-\fBu\fP  for time in integer seconds since first record
-.IP
-\fBV\fP  for ping interval (decimal seconds)
-.IP
-\fBX\fP  for longitude (decimal degrees)
-.IP
-\fBx\fP  for longitude (degrees + decimal minutes + E/W)
-.IP
-\fBY\fP  for latitude (decimal degrees)
-.IP
-\fBy\fP  for latitude (degrees + decimal minutes + N/S)
-.IP
-\fBZ\fP  for topography (positive upwards) (m)
-.IP
-\fBz\fP  for depth (positive downwards) (m)
-.IP
-\fB#\fP  for beam or pixel number
-.IP
-\fB .\fP
-special character: this causes the next character to be
-interpretted from the following list rather than the above list.
-These allow access to raw values in format specific form and may
-not be supported by all formats.
-.IP
-\fB .A\fP  Amplitude (backscatter) in dB (formats 56 & 67 \- Simrad multibeam only)
-.IP
-\fB .a\fP  Mean absorption coefficient in dB/km (formats 56 & 67 \- Simrad multibeam some versions only)
-.IP
-\fB .B\fP  Normal incidence backscatter in dB (formats 56 & 67 \- Simrad multibeam only)
-.IP
-\fB .b\fP  Oblique backscatter in dB (formats 56 & 67 \- Simrad multibeam only)
-.IP
-\fB .c\fP  Mean backscatter, one value per ping (formats 56 & 67 \- Simrad multibeam only)
-.IP
-\fB .d\fP  Beam depression angle (formats 56 & 67 \- Simrad multibeam only)
-.IP
-\fB .F\fP  Filename
-.IP
-\fB .f\fP  File format
-.IP
-\fB .G\fP  Start of TVG ramp in samples (formats 56 & 67 \- Simrad multibeam only)
-.IP
-\fB .g\fP  Stop of TVG ramp in samples (formats 56 & 67 \- Simrad multibeam only)
-.IP
-\fB .L\fP  Transmit pulse length (usec) (formats 56 & 67 \- Simrad multibeam only)
-.IP
-\fB .l\fP  Transmit pulse length (sec)
-.IP
-\fB .M\fP  Sounder mode (formats 56 & 67 \- Simrad multibeam only)
-.IP
-\fB .N\fP  Ping number according to sounder (formats 56 & 67 \- Simrad multibeam only)
-.IP
-\fB .p\fP  Raw sidescan pixels in dB (formats 56 & 67 \- Simrad multibeam only).
-May be preceded by a number to give the first n pixels (NaN padded) of the beam,
-for example\fB .30p\fP will give the first 30 sidescan pixels of each beam.
-.IP
-\fB .R\fP  Range in samples (formats 56 & 67 \- Simrad multibeam only)
-.IP
-\fB .r\fP  Sampling rate in Hz (formats 56 & 67 \- Simrad multibeam only)
-.IP
-\fB .S\fP  Number of raw sidescan pixels per ping (formats 56 & 67 \- Simrad multibeam only)
-.IP
-\fB .s\fP  Number of raw sidescan pixels per beam (formats 56 & 67 \- Simrad multibeam only)
-.IP
-\fB .T\fP  Transmit gain (dB)
-.IP
-\fB .t\fP  Receive gain (dB)
-
-.br
-Default \fIoutput_format\fP = \fBYXLZ\fP (latitude, longitude, cumulative
-along-track distance, and depth).
-.TP
-.B \-P
-\fIpings\fP
-.br
-Sets the ping averaging of the input data. If \fIpings\fP = 1, then
-no ping averaging is performed. If \fIpings\fP > 0, then
-that number of input pings will be averaged to produce one output
-ping.  If \fIpings\fP = 0, then the ping averaging will automatically
-be done so that the along-track ping spacing is equal to the across-track
-beam spacing.
-Default: \fIpings\fP = 1 (no ping averaging).
-.TP
-.B \-Q
-Disables value checking for validity (only positive bathymetry,
-amplitude, and sidescan values are valid).  This allows dumps
-of all of the data, including null or flagged beams and pixels.
-The flagged values are output without change. Null values are
-output as zero. This option is equivalent to \fB\-U\fP\fI2\fP.
-.TP
-.B \-R
-\fIwest/east/south/north\fP
-.br
-Sets the longitude and latitude bounds within which swath
-data will be read. Only the data which lies within these bounds will
-be read.
-Default: \fIwest\fP=\-360, east\fI=360\fP, \fIsouth\fP=\-90, \fInorth\fP=90.
-.TP
-.B \-S
-\fIspeed\fP
-.br
-Sets the minimum speed in km/hr (5.5 kts ~ 10 km/hr) allowed in
-the input data; pings associated with a smaller ship speed will not be
-copied. Default: \fIspeed\fP = 0.
-.TP
-.B \-T
-\fItimegap\fP
-.br
-Sets the maximum time gap in minutes between adjacent pings allowed before
-the data is considered to have a gap. Default: \fItimegap\fP = 1.
-.TP
-.B \-U
-\fIcheck\fP
-.br
-Sets the manner in which \fBmblist\fP handles flagged and null
-bathymetry, amplitude, and sidescan values. By default, \fBmblist\fP
-omits lines of output if they contain flagged or null values. This
-default corresponds to \fIcheck\fP = 0.
-If \fIcheck\fP = 1, then flagged values will be output
-unchanged and null values will be ignored.
-If \fIcheck\fP = 2,
-then flagged values will be output unchanged and null values
-will be output as zero (This corresponds to the \fB\-Q\fP option).
-If \fIcheck\fP = 3, then flagged values will be output unchanged
-and null values will be output as "NaN".
-If \fIcheck\fP = 4, then flagged values and null values
-will be output as "NaN".
-.TP
-.B \-V
-Normally, \fBmblist\fP works "silently" without outputting
-anything to the stderr stream.  If the
-\fB\-V\fP flag is given, then \fBmblist\fP works in a "verbose" mode and
-outputs the program version being used and all error status messages.
-.TP
-.B \-W
-Normally, \fBmblist\fP outputs bathymetry and across and along
-track distances in meters.  If the
-\fB\-W\fP flag is given, then \fBmblist\fP outputs these values
-in feet.
-.TP
-.B \-X
-\fIoutfile\fP
-.br
-Normally, \fBmblist\fP outputs to stdout.
-If the \fB\-X\fP flag is given, then \fBmblist\fP creates a new file
-\fIoutfile\fP and outputs to it.
-An output file must be specified if a netCDF file (\fB\-C \-A\fP) is required.
-.TP
-.B \-Z
-\fIsegment\fP
-.br
-Causes the ascii output of different input swath files
-(e.g. when a datalist is specified with the \fB\-I\fP option)
-to be separated by lines with \fIsegment\fP. If \fIsegment\fP
-is a single character, then the output is a multiple segment
-file of the sort accepted by the \fBGMT\fP program \fBpsxy\fP.
-This option only works with ascii output, and is thus disabled
-when the \fB\-A\fP option is specified. The most common usage
-is \fB\-Z\fP\I>\fP.
-
-.SH EXAMPLES
-Suppose one wishes to obtain a centerbeam profile
-from a raw Hydrosweep file
-(format 21) in a region between 105W and 103W
-longitude and between 10S and 8S latitude. The following will suffice:
-
-	mblist \-Iinfile.mb21 \-F21 \-R-105/-103/-10/-8 \-OLz
-
-The output will be as follows:
-
- 	0.000  4378
- 	0.085  4370
- 	0.166  4370
- 	0.247  4351
- 	0.330  4353
- 	0.407  4337
- 	0.492  4334
- 	0.571  4323
- 	0.651  4316
- 	0.737  4307
- 	.....
-
-Here the depth values will correspond to the beam in each
-ping which is located closest to vertical under the ship.
-
-Suppose one wishes instead to obtain time, heading and speed data
-in the same file from 8AM to 9AM on August 10 1991. The following
-is appropriate:
-
- 	mblist \-Iinfile.mb21 \-F21 \-B1991/8/10/8/0/0
- 	-E1991/8/10/9/0/0 \-OTHS
-
-The output will be as follows:
-
- 	1991/08/10/08/00/05     283.9   41.29
- 	1991/08/10/08/00/19     283.4   20.36
- 	1991/08/10/08/00/33     285.1   20.36
- 	1991/08/10/08/00/48     286.7   20.09
- 	1991/08/10/08/01/02     284.9   20.08
- 	1991/08/10/08/01/16     285.2   20.02
- 	1991/08/10/08/01/44     284.2   20.20
- 	1991/08/10/08/02/12     283.7   20.50
- 	1991/08/10/08/02/41     283.6   20.75
- 	1991/08/10/08/03/09     285.1   21.19
- 	.....
-
-Suppose one wishes a data series with along-track distance,
-topography and across-track distance of beam number 15 for the same file
-and time limits as above:
-
- 	mblist \-Iinfile.mb21 \-F21 \-B1991/8/10/7/0/0
- 	-E1991/8/10/9/0/0 \-OLZD \-M15/15
-
-The output will be as follows:
-
- 	  0.000  4510   \-1704
- 	  0.172  4494   \-1692
- 	  0.260  4486   \-1689
- 	  0.343  4471   \-1683
- 	  0.427  4491   \-1691
- 	  0.506  4490   \-1690
- 	  0.591  4478   \-1686
- 	  0.676  4505   \-1697
- 	  0.763  4488   \-1695
- 	  0.849  4495   \-1699
- 	  .....
-
-Supppose one wishes to obtain longitude, latitude, and
-depth at the centerbeam as x-y-z data for the same region as in the
-first example:
-
- 	mblist \-Iinfile.mb21 \-F21 \-R-105/-103/-10/-8 \-OXYz
-
-The output will be as follows:
-
- 	-103.000236      \-9.577439       4378
- 	-103.000943      \-9.577229       4370
- 	-103.001651      \-9.577020       4370
- 	-103.002372      \-9.576794       4351
- 	-103.003041      \-9.576584       4353
- 	-103.003771      \-9.576338       4337
- 	-103.004456      \-9.576105       4334
- 	-103.005153      \-9.575895       4323
- 	-103.005903      \-9.575679       4316
- 	-103.006586      \-9.575449       4307
- 	.....
-
-Suppose one wishes to obtain a dump of longitude, latitude, and
-depth for all good beams in a Hydrosweep data file. There are two ways to
-obtain this output. One can explicitly specify the output format as
-\fB\-O\fP\fIXYz\fP and the output beams as \fB\-M\fP\fI0/58\fP:
-
- 	mblist \-Iinfile.mb21 \-F21 \-OXYz \-M0/58
-
-or one can use the equivalent \fB\-D\fP\fI2\fP shortcut:
-
-	mblist \-Iinfile.mb21 \-F21 \-D2
-
-Either way, the output is as follows:
-
- 	-49.296454	  12.180552	  4866
- 	-49.296695	  12.178668	  4858
- 	-49.296923	  12.176893	  4855
- 	-49.297123	  12.175341	  4877
- 	-49.297319	  12.173808	  4895
- 	-49.297536	  12.172122	  4879
- 	-49.297744	  12.170498	  4865
- 	-49.297909	  12.169216	  4904
- 	-49.298100	  12.167727	  4899
- 	-49.298299	  12.166175	  4871
- 	-49.298476	  12.164803	  4873
- 	-49.298639	  12.163530	  4891
- 	.....
-
-Suppose one wishes to obtain a dump of longitude, latitude, and
-depth for all beams, valid or not, in a Hydrosweep data file.
-The approach is the same as the preceding example, except that
-the \fB\-Q\fP option is used to disable validity checking of
-beam values. One can explicitly specify the output format as
-\fB\-O\fP\fIXYz\fP and the output beams as \fB\-M\fP\fI0/58\fP:
-
- 	mblist \-Iinfile.mb21 \-F21 \-OXYz \-M0/58 \-Q
-
-or one can use the equivalent \fB\-D\fP\fI2\fP shortcut:
-
-	mblist \-Iinfile.mb21 \-F21 \-D2 \-Q
-
-Either way, the output includes both zero beams (no data) and
-beams with negative depths (flagged as bad data):
-
- 	-49.301094	  12.144409	     0
- 	-49.301094	  12.144409	     0
- 	-49.296454	  12.180552	  4866
- 	-49.296695	  12.178668	  4858
- 	-49.296923	  12.176893	  4855
- 	-49.297123	  12.175341	  4877
- 	-49.297319	  12.173808	  4895
- 	-49.297536	  12.172122	  4879
- 	-49.297744	  12.170498	  4865
- 	-49.297909	  12.169216	  4904
- 	-49.298100	  12.167727	  4899
- 	-49.298100	  12.167727	 \-4144
- 	-49.298299	  12.166175	  4871
- 	-49.298476	  12.164803	  4873
- 	-49.298639	  12.163530	  4891
- 	.....
-
-Finally, suppose one wishes to obtain a dump of longitude, latitude, and
-amplitude for all good beams in a Hydrosweep data file. There are two ways to
-obtain this output. One can explicitly specify the output format as
-\fB\-O\fP\fIXYB\fP and the output beams as \fB\-M\fP\fI0/58\fP:
-
- 	mblist \-Iinfile.mb21 \-F21 \-OXYB \-M0/58
-
-or one can use the equivalent \fB\-D\fP\fI4\fP shortcut:
-
-	mblist \-Iinfile.mb21 \-F21 \-D4
-
-Either way, the output is as follows:
-
- 	-49.296454	  12.180552	    13
- 	-49.296695	  12.178668	    17
- 	-49.296923	  12.176893	    16
- 	-49.297123	  12.175341	    14
- 	-49.297319	  12.173808	    17
- 	-49.297536	  12.172122	     9
- 	-49.297744	  12.170498	    14
- 	-49.297909	  12.169216	    15
- 	-49.298100	  12.167727	    12
- 	-49.298299	  12.166175	    12
- 	-49.298476	  12.164803	    28
- 	-49.298639	  12.163530	    14
- 	.....
-
-Suppose one wishes to examine the number of raw sidescan pixels in Simrad EM1002 data file
-and the first 5 pixels of each beam:
-
-	mblist \-i 0044_20000425_093808.mb57 \-MA \-ON#.S.s.5p
-
-The output will be as follows:
-
-     1       0           11278     286      \-31.5   \-32.0   \-32.0   \-32.5   \-33.0
-     1       1           11278     133      \-34.5   \-34.5   \-34.5   \-34.5   \-33.5
-     1       2           11278     142      \-40.0   \-40.0   \-40.0   \-40.0   \-40.0
-     1       3           11278     139      \-40.0   \-40.5   \-40.5   \-40.5   \-40.5
-     1       4           11278     159      \-39.5   \-38.5   \-38.5   \-39.0   \-38.5
-     ...
-     1      54           11278     1        \-27.00  NaN     NaN     NaN     NaN
-     .....
-
-.SH SEE ALSO
-\fBmbsystem\fP(1), \fBmbinfo\fP(1)
-
-.SH BUGS
-\fBmblist\fP is not able to list all of the information available in some
-swath data formats.
diff --git a/src/man/man1/mbm_arc2grd.1 b/src/man/man1/mbm_arc2grd.1
deleted file mode 100644
index 97afd76..0000000
--- a/src/man/man1/mbm_arc2grd.1
+++ /dev/null
@@ -1,79 +0,0 @@
-.TH mbm_arc2grd 1 "3 June 2013" "MB-System 5.0" "MB-System 5.0"
-.SH NAME
-\fBmbm_arc2grd\fP \- Macro to convert an ArcView ASCII grid 
-to a GMT  grid file in the GMT NetCDF grid format. 
-
-.SH VERSION
-Version 5.0
-
-.SH SYNOPSIS
-mbm_arc2grd \fB\-I\fP\fIarcfile\fP \fB\-O\fP\fIgrdfile\fP [\fB\-H \-V\fP]
-
-.SH DESCRIPTION
-\fBmbm_arc2grd\fP is a macro to convert a ArcView 
-ASCII grid to an GMT grid file in the 
-GMT NetCDF grid format. This allows users to import the grid
-into GMT. The grid will have the same grid interval in both 
-longitude and latitude.
-The macro first obtains the bounds, dimensions, and grid
-cell size of the grid by parsing the six line header.
-The macro then reformats the gridded data as xyz data,
-writing it to a temporary file. This temporary file is 
-processed using the GMT program \fBxyz2grd\fP,
-yielding a GMT GRD format grid file.
-
-.SH AUTHORSHIP
-David W. Caress (caress at mbari.org)
-.br
-  Monterey Bay Aquarium Research Institute
-.br
-Dale N. Chayes (dale at ldeo.columbia.edu)
-.br
-  Lamont-Doherty Earth Observatory
-
-.SH OPTIONS
-.TP
-.B \-H
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-.TP
-.B \-I
-\fIarcfile\fP
-.br
-Sets the filename of the input ArcView ASCII grid.
-.TP
-.B \-O
-\fIgrdname\fP
-.br
-Sets the filename of the output GMT grid file. This file will be
-in the GMT NetCDF GRD format. 
-.TP
-.B \-V
-The \fB\-V\fP option causes \fBmbm_arc2grd\fP to print out status messages.
-
-.SH EXAMPLES
-Suppose that we have obtained an ascii ArcView grid called
-kohalab.asc. To translate this file to a GMT grd file,
-the following will suffice:
-.br
-  	mbm_arc2grd \-I kohalab.asc \-O kohalab.grd \-V
-.br
-Running the example above produced the following output:
- 	Program mbm_arc2grd status:
- 		Input ArcView ASCII  file: kohalab.asc
- 		Output GRD file:           kohalab.grd
- 		Grid dimensions:  1597  1431
- 		Grid cell sizes:  0.0001914456033  0.0001914456033
-  		Grid bounds:      \-155.72855  \-155.423002817133    20.1318  20.405567212719
-
- 	Running xyz2grd...
- 	xyz2grd: nx = 1597  ny = 1431
-
-.SH SEE ALSO
-\fBmbsystem\fP(1), \fBmbm_grd2arc\fP(1),
-\fBmbm_grid\fP(1)
-
-.SH BUGS
-Perhaps.
-
-
diff --git a/src/man/man1/mbm_bpr.1 b/src/man/man1/mbm_bpr.1
deleted file mode 100644
index 1692a0a..0000000
--- a/src/man/man1/mbm_bpr.1
+++ /dev/null
@@ -1,218 +0,0 @@
-.TH mbm_bpr 1 "3 June 2013" "MB\-System 5.0" "MB\-System 5.0"
-.SH NAME
-\fBmbm_bpr\fP \- MB\-System macro to process data from a Seabird SBE53 pressure
-sensor into a tidal model for use by mbprocess.
-
-.SH VERSION
-Version 5.0
-
-.SH SYNOPSIS
-\fBmbm_bpr\fP \fB\-I\fP\fIbprfile\fP \fB\-O\fP\fItidefile\fP [\fB\-D\fP\fIoffset\fI \fBR\fP\fIlon/lat\fP \fB\-T \-H \-V\fP]
-
-.SH DESCRIPTION
-\fBmbm_bpr\fP is a perl shellscript used to translate pressure data from a Seabird SBE53 pressure
-sensor used as a Bottom Pressure Recorder (BPR) into tidal data that can be used to correct
-swath bathymetry data. The user specifies an input BPR data file in the *.tid format produced
-by Seabird software and the output path for the resulting tidefile.
-
-By default, the output
-tidefile will be in the form of a text file with two columns:
-      time_d tide.
-.br
-Here time_d are time values in decimal epoch seconds (seconds since 1970 Jan 1 00:00:00) and the tide values
-are in meters. In this case, the tidefile is in format 1 as supported by \fBmbprocess\fP, so to make use of this
-tide data to correct swath bathymetry, use \fBmbset\fP as follows:
-      mbset \-Idatalist.mb\-1 \-PTIDEFILE:tidefilename \-PTIDEFORMAT:1
-.br
-where datalist.mb\-1 is the datalist referring to the data files to be processed. After using \fBmbset\fP to
-turn on tide correction, run \fBmbprocess\fP:
-      mbprocess \-Idatalist.mb\-1
-.br
-
-If the \fB\-T\fP option is specified, then the output file will have the form of:
-      year month day hour min sec tide
-.br
-In this case, the tidefile is in format 2 as supported by \fBmbprocess\fP, so to make use of this
-tide data to correct swath bathymetry, use \fBmbset\fP as follows:
-      mbset \-Idatalist.mb\-1 \-PTIDEFILE:tidefilename \-PTIDEFORMAT:2
-.br
-where datalist.mb\-1 is the datalist referring to the data files to be processed. After using \fBmbset\fP to
-turn on tide correction, run \fBmbprocess\fP.
-
-The macro \fBmbm_bpr\fP calculates depth from pressure and latitude using the empirical formula for seawater in:
-.br
-        N. P. Fofonoff and R. C. Millard, Jr., Algorithms for computation of fundamental
-        properties of seawater, Unesco Tech. Papers in Mar. Sci., No. 44 1983.
-.br
-and then calculates tidal data as the difference between the observed depth and a vertical
-reference depth. If a location is supplied using the \fB\-R\fP option,
-\fBmbm_bpr\fP uses the latitude in the depth calculation and also extracts a tidal model
-corresponding the to BPR deployment site and timespan using the program \fBmbotps\fP. The vertical
-reference is then the average difference between the tidal model and the observed depths.
-If the user does not supply a location using the \fB\-R\fP option,
-a location on the equator is assumed for the depth calculation and the vertical reference is
-the mean depth of the middle half of the depth time series (i.e. depths from 1/4 to 3/4 of the total time span).
-The user can specify an additional offset to apply to the tide data using the \fB\-D\fP\fIoffset\fP option.
-
-If the \fB\-T\fP option is not used, then \fBmbm_bpr\fP will also output a shellscript that will, if
-executed, generate a GMT postscript plot of the tide data output. If a location has been specified so that
-a tidal model was also generated, the model will be plotted with the tide data.
-
-.SH AUTHORSHIP
-David W. Caress (caress at mbari.org)
-.br
-  Monterey Bay Aquarium Research Institute
-.br
-Dale N. Chayes (dale at ldeo.columbia.edu)
-.br
-  Lamont\-Doherty Earth Observatory
-.br
-Suzanne H. O'Hara (sohara at ldeo.columbia.edu)
-.br
-  Lamont\-Doherty Earth Observatory
-
-.SH OPTIONS
-.TP
-.B \-D
-\fIoffset\fP
-.br
-An offset to be added to the calculated tidal data, in meters. Default: \fIoffset\fP=0.
-.TP
-.B \-H
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-.TP
-.B \-I
-\fIbprfile\fP
-.br
-Input pressure data from the SBE53 pressure sensor in the Sea\-Bird *.tid format.
-.TP
-.B \-O
-\fItidefile\fP
-.br
-Output tide data file path. The format of the tide data controlled by the use (or not) of the \fB\-T\fP option.
-.TP
-.B \-R
-\fIlongitude/latitude\fP
-.br
-Sets the location of the BPR deployment. Here \fIlongitude\fP and \fIlatitude\fP are in decimal
-degrees.
-.TP
-.B \-T
-Changes the tide data format output. The format of the tide data are normally
-in the form of a text file with two columns:
-      time_d tide
-.br
-where time_d are time values in decimal epoch seconds (seconds since 1970 Jan 1 00:00:00) and the tide values
-are in meters.
-If the \fB\-T\fP option is specified, then the output file will instead have the form of:
-      year month day hour min sec tide
-.TP
-.B \-V
-Causes \fBmbm_bpr\fP to operate in "verbose" mode so that it outputs
-more information than usual.
-
-.SH Examples
-Suppose one has deployed an SBE53 at 110 deg 40.92220'W 26deg 27.18960'N at about 1200 m depth.
-The Sea\-Bird processing software outputs data in *.tid files with output something like:
-     1   03/14/2012 16:27:21 99999.9999    20.2731
-     2   03/14/2012 16:28:21 99999.9999    20.2696
-     3   03/14/2012 16:29:21 99999.9999    20.2589
-     4   03/14/2012 16:30:21 99999.9999    20.2537
-     5   03/14/2012 16:31:21 99999.9999    20.2448
-     6   03/14/2012 16:32:21 99999.9999    20.2322
-     7   03/14/2012 16:33:21 99999.9999    20.2188
-     8   03/14/2012 16:34:21 99999.9999    20.2656
-     9   03/14/2012 16:35:21 99999.9999    20.3567
-    10   03/14/2012 16:36:21 99999.9999    20.4316
-    11   03/14/2012 16:37:21 99999.9999    20.4929
-    12   03/14/2012 16:38:21 99999.9999    20.5661
-    13   03/14/2012 16:39:21 99999.9999    20.6242
-    14   03/14/2012 16:40:21 99999.9999    20.6891
-    15   03/14/2012 16:41:21 99999.9999    20.7590
-    16   03/14/2012 16:42:21 99999.9999    19.8901
-    17   03/14/2012 16:43:21 99999.9999    18.1037
-    18   03/14/2012 16:44:21 99999.9999    17.2487
-    19   03/14/2012 16:45:21 99999.9999    15.9275
-    20   03/14/2012 16:46:21 99999.9999    14.7406
-    21   03/14/2012 16:47:21 99999.9999    13.7798
-    22   03/14/2012 16:48:21 99999.9999    13.0540
-    23   03/14/2012 16:49:21 99999.9999    12.3869
-    24   03/14/2012 16:50:21 99999.9999    11.8464
-    25   03/14/2012 16:51:21 99999.9999    11.1999
-    26   03/14/2012 16:52:21   528.8065    10.5061
-    27   03/14/2012 16:53:21   583.2633     9.9686
-    28   03/14/2012 16:54:21   637.7951     9.3547
-    29   03/14/2012 16:55:21   693.5947     8.8287
-    30   03/14/2012 16:56:21   748.5921     8.3998
-    31   03/14/2012 16:57:21   804.0302     8.0251
-    32   03/14/2012 16:58:21   859.5471     7.6560
-    33   03/14/2012 16:59:21   914.8043     7.3006
-    34   03/14/2012 17:00:21   969.7692     7.0322
-    35   03/14/2012 17:01:21  1023.0636     6.6673
-    36   03/14/2012 17:02:21  1077.7238     6.3327
-    37   03/14/2012 17:03:21  1132.0991     6.0528
-    38   03/14/2012 17:04:21  1186.9391     5.8203
-    39   03/14/2012 17:05:21  1241.4040     5.6089
-    40   03/14/2012 17:06:21  1295.6002     5.4167
-    41   03/14/2012 17:07:21  1350.1353     5.2188
-    42   03/14/2012 17:08:21  1404.8882     5.0195
-    43   03/14/2012 17:09:21  1460.2095     4.9215
-    44   03/14/2012 17:10:21  1514.6683     4.7630
-    45   03/14/2012 17:11:21  1568.9270     4.5651
-    46   03/14/2012 17:12:21  1623.3903     4.4452
-    47   03/14/2012 17:13:21  1678.6771     4.3075
-    48   03/14/2012 17:14:21  1733.7411     4.1910
-    49   03/14/2012 17:15:21  1789.1549     4.0284
-    50   03/14/2012 17:16:21  1844.5557     3.8760
-    51   03/14/2012 17:17:21  1869.8892     3.7976
-    52   03/14/2012 17:18:21  1869.8176     3.7534
-    53   03/14/2012 17:19:21  1869.8197     3.7088
-    54   03/14/2012 17:20:21  1869.8224     3.6828
-    55   03/14/2012 17:21:21  1869.8241     3.6682
-.br
-where the third column is the pressure in dbar and the fourth column is temperature in degrees C.
-The pressure increases and the temperature decreases as the sensor sinks to the seafloor following
-deployment off a ship. Once the sensor is on the seafloor, pressure variations reflect the tides.
-
-To extract a tidal model, use \fBmbm_bpr\fP as follows:
-    mbm_bpr \-I BPR.tid \-OBPR.tde \-R\-110.682037/27.453160 \-V
-.br
-The output to the shell looks like:
-    Program  Status:
-      1771 pressure values read from BPR.tid
-      Vertical reference to tidal model for position \-110.682037 27.453160
-      Tide will be output as <time_d tide> values
-      A plot will be generated
-      Executing: mbotps \-A1 \-D1200 \-R\-110.682037/27.453160 \-B2012/03/14/16/52/21 \-E2012/03/15/22/22/21 \-OBPR.tid_tidemodel.txt
-      Results are really in BPR.tid_tidemodel.txt
-      1690 pressure values output to BPR.tde
-      Vertical reference: 1267.31678290355 m
-      Executing mbm_xyplot \-R1331743941.000000/1331850141.000000/\-0.5071/0.5071 \-IW0/0/0:BPR.tde \-IW255/0/0:BPR.tid_tidemodel.txt \-OBPR.tde_tideplot \-L"Tide Data from BPR <BPR.tde> (black) & Tide Model (red):Seconds:Tide (meters)" \-V
-      Executing <BPR.tde_tideplot.cmd> also invokes gv to view the plot on the screen.
-.br
-The output tidal data file BPR.tde has the form:
-    1331745441.000000 \-0.0803109226781089
-    1331745501.000000 \-0.129052283649798
-    1331745561.000000 \-0.127622718432121
-    1331745621.000000 \-0.125784706023751
-    1331745681.000000 \-0.124627438960488
-    1331745741.000000 \-0.123334022838208
-    1331745801.000000 \-0.12285750111073
-    1331745861.000000 \-0.121768308595847
-.br
-where the first column is time in seconds since January 1, 1970 (epoch seconds, aka unix
-seconds, aka time_d values within \fBMB\-System\fP), and the second column is the tidal signal
-in meters. In this case the reference tidal model is provided by \fBmbotps\fP, and the
-plot created by running the output shellscript BPR.tde_tideplot.cmd plots both the tidal data
-calculated by \fBmbm_bpr\fP and the tidal model extracted using \fBmbotps\fP.
-
-.SH SEE ALSO
-\fBmbsystem\fP(1), \fBmbprocess\fP(1), \fBmbset\fP(1)
-
-.SH REFERENCES
-N. P. Fofonoff and R. C. Millard, Jr., Algorithms for computation of fundamental
-properties of seawater, Unesco Tech. Papers in Mar. Sci., No. 44 1983.
-
-.SH BUGS
-Lobsters, really.
diff --git a/src/man/man1/mbm_copy.1 b/src/man/man1/mbm_copy.1
deleted file mode 100644
index 60be98a..0000000
--- a/src/man/man1/mbm_copy.1
+++ /dev/null
@@ -1,130 +0,0 @@
-.TH mbm_copy 1 "3 June 2013" "MB-System 5.0" "MB-System 5.0"
-.SH NAME
-\fBmbm_copy\fP \- Apply mbcopy to all files referenced through
-a datalist, using the MB-System file suffix convention
-to name the output files
-
-.SH VERSION
-Version 5.0
-
-.SH SYNOPSIS
-\fBmbm_copy\fP \fB\-F\fP\fIoutputformat\fP \fB\-I\fP\fIdatalist\fP
-[\fB\-H\fP \fB\-C \-T\fP \fB\-V\fP]
-
-.SH DESCRIPTION
-
-\fBmbm_copy\fP is a macro used to copy large numbers of swath data files
-from one data format to another using the program \fBmbcopy\fP.
-The input is a datalist file referencing
-all of the target swath files. The output swath file format is specified
-with the \fB\-F\fP option. If the output swath file format is not specified,
-the output format will be the same as the input format.
-
-The macro identifies a filename root for each input swath file. For files
-with recognized filename suffixes (e.g. ".mb61" for a format 61 file), the
-filename root is the part of the filename that comes before the suffix. For
-files without a recognized suffix, the filename root is the entire filename.
-So, for a format 57 data file called "0007_20020425_060531.mb57", the filename root
-is "0007_20020425_060531". For a format 121 file named "009_1659", the filename
-root "009_1659".
-
-The output filenames are automatically constructed by adding the standard
-MB-System file suffix to the filename root. This suffix is ".mbXXX" where
-XXX is the two or three digit format id number. In the event that the output
-filename is the same as the input filename (likely only if the \fB\-F\fP option
-is not used to set the output format), a "c" will be placed at the beginning
-of the output file suffix, making it "c.mbXXX".
-
-The \fB\-T\fP option causes this macro to print out the \fBmbcopy\fP commands
-it will execute without actually executing them. This test option allows
-users to check the consequences of their command before actually running it.
-
-.SH AUTHORSHIP
-David W. Caress (caress at mbari.org)
-.br
-  Monterey Bay Aquarium Research Institute
-.br
-Dale N. Chayes (dale at ldeo.columbia.edu)
-.br
-  Lamont-Doherty Earth Observatory
-
-.SH SIMPLE DESCRIPTION OF BASIC OPTIONS
-.TP
-.B \-H
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-.TP
-.B \-C
-.br
-This option causes the program to check if each output file
-already exists, and to forgo copying those that do exist.
-.TP
-.B \-F
-\fIoutputformat\fP
-.br
-This option sets the output swath format. All of the swath data
-files referenced in the datalist specified with the \fB\-I\fP option
-will be copied to format \fIoutputformat\fP using \fBmbcopy\fP. If
-the \fB\-F\fP option is not given, then the input files will be copied
-to their input formats.
-.TP
-.B \-I
-\fIdatalist\fP
-.br
-Sets the input datalist filename. A datalist is an ascii
-file containing a list of the input swath sonar
-data files to be copied and their formats.
-In the \fIdatalist\fP file, each
-swath data file should be followed by a data format identifier, e.g.:
- 	datafile1 11
- 	datafile2 24
-.br
-As discussed in the \fBMB-System\fP manual page, datalists may reference
-other datalists, allowing users to construct recursive datalist structures.
-This program uses the \fBMBIO\fP library and will read or write any swath sonar
-format supported by \fBMBIO\fP. A list of the swath sonar data formats
-currently supported by \fBMBIO\fP and their identifier values
-is given in the \fBMBIO\fP manual page.
-.TP
-.B \-T
-.br
-This option causes \fBmbm_copy\fP to print out the \fBmbcopy\fP commands
-it will execute without actually executing them. This test option allows
-users to check the consequences of their command before actually running it.
-.TP
-.B \-V
-Causes \fBmbm_copy\fP to operate in "verbose" mode
-so that it outputs
-more information than usual.
-
-.SH EXAMPLES
-Suppose one has three raw (format 56) Simrad EM300 data files:
- 	0001_20020424_212920_raw.all
- 	0002_20020425_011607_raw.all
- 	0003_20020425_022926_raw.all
-.br
-One can generate a datalist called datalistr.mb-1 referencing these
-three swath files using a text editor or by using \fBawk\fP:
- 	ls \-1 *all | awk '{print $1" 56"}' > datalistr.mb-1
-.br
-In order to translate all three files in the processing format for
-Simrad multibeam data (format 57), use the \fBmbm_copy\fP macro:
- 	mbm_copy \-I datalistr.mb-1 \-F 57 \-T \-V
-.br
-The macro prints out the following as it translates the swath data:
-  	Running: mbcopy \-F56/57
- 		-I0001_20020424_212920_raw.all
- 		-O0001_20020424_212920.mb57
-  	Running: mbcopy \-F56/57
- 		-I0002_20020425_011607_raw.all
- 		-O0002_20020425_011607.mb57
-  	Running: mbcopy \-F56/57
- 		-I0003_20020425_022926_raw.all
- 		-O0003_20020425_022926.mb57
-
-.SH SEE ALSO
-\fBmbsystem\fP(1), \fBmbcopy\fP(1),
-\fBmbdatalist\fP(1)
-
-.SH BUGS
-Perhaps.
diff --git a/src/man/man1/mbm_dslnavfix.1 b/src/man/man1/mbm_dslnavfix.1
deleted file mode 100644
index f4efd24..0000000
--- a/src/man/man1/mbm_dslnavfix.1
+++ /dev/null
@@ -1,184 +0,0 @@
-.TH mbm_dslnavfix 1 "3 June 2013" "MB-System 5.0" "MB-System 5.0"
-.SH NAME
-\fBmbm_dslnavfix\fP \- Translate WHOI DSL AMS-120 navigation from
-UTM eastings and northings to longitude and latitude.
-
-.SH VERSION
-Version 5.0
-
-.SH SYNOPSIS
-\fBmbm_dslnavfix\fP \fB\-F\fP\fInavformat\fP
-\fB\-I\fP\fIinfile\fP \fB\-J\fP\fIutm_zone\fP
-\fB\-O\fP\fIoutfile\fP
-[\fB\-D\fP\fIdecimate\fP \fB\-E\fP\fIellipsoid\fP \fB\-H\fP \fB\-V\fP]
-
-.SH DESCRIPTION
-\fBmbm_dslnavfix\fP is a macro to translate
-WHOI DSL AMS-120 navigation from
-UTM eastings and northings to longitude and latitude.
-The WHOI DSL group typically provides processed AMS-120
-navigation is files separate from the bathymetry and
-sidescan data. Moreover, the navigation is generally
-sampled less frequently than the sonar
-pings, and is reported in UTM easting and northing meters.
-The \fBmbm_dslnavfix\fP macro is used to translate the
-eastings and northings into the geographic coordinates
-(longitude and latitude) used by MB-System programs. The
-program \fBmbprocess\fP can be used to merge the translated
-navigation in with the bathymetry and sidescan.
-
-The DSL AMS-120 bathymetry and sidescan are provided in
-either a set of parallel files supported as \fBMB-System\fP
-format 111 (the old scheme) or in the OIC single file format
-supported as \fBMB-System\fP format 141 (the new scheme).
-In either case, we recommend translating the data to similar
-but enhanced formats 112 and 142, respectively, to ease
-processing.
-
-We recommend the following procedure when
-processing WHOI DSL AMS-120 data with MB-System:
-.br
- 	1) Concatenate all of the processed navigation
- 	   files into a single file.
- 		cat *.nav > cruise.rnav
- 	2) Translate the DSL UTM navigation into geographic
- 	   coordinates. In the "old" case the navigation is
-           in a format designated by \fB\-F\fP\fI1\fP and
-           in the new case by \fB\-F\fP\fI2\fP. Note that
-           you must know the UTM zone used \- here we assume
-           the zone is +27.
- 		mbm_dslnavfix \-Icruise.rnav \\
- 			-Ocruise.mrg2 \-F1 \-J27 \-V
- 	3) Copy the bathymetry and sidescan data in each
- 	   file from format 111 to format 112 or from
-           format 141 to 142.
- 		mbcopy \-F111/112 \\
- 			-IDSL120.940630_1100.bat.dat \\
- 			-ODSL120.940630_1100.mb112
- 	4) Set the translated navigation to be merged with
-           each of the format 112 or 142 files using
-           \fBmbset\fP:
- 		mbset \-I DSL120.940630_1100.mb112 \\
- 			-P NAVFORMAT:2 \\
- 			-P NAVFILE:cruise.mrg2 \\
- 			-V
- 	4) Process the data using \fBmbprocess\fP,
-           producing a processed file called
-           DSL120.940630_1100p.mb112 with longitude and
-           latitude navigation.
- 		mbprocess \-I DSL120.940630_1100.mb112
-
-.SH AUTHORSHIP
-David W. Caress (caress at mbari.org)
-.br
-  Monterey Bay Aquarium Research Institute
-.br
-Dale N. Chayes (dale at ldeo.columbia.edu)
-.br
-  Lamont-Doherty Earth Observatory
-
-.SH OPTIONS
-.TP
-.B \-D
-\fIdecimate\fP
-.br
-This option allows the user to decimate the input navigation.
-The \fIdecimate\fP value represents the decimation factor.
-The default is \fIdecimate\fP = 1, or no decimation.
-.TP
-.B \-E
-\fIellipsoid\fP
-.br
-This option sets the ellipsoid used in the UTM projection.
-The choices are:
- 	WGS-84		1984 World Geodetic System
- 	GRS-80		1980 International Geodetic Reference System
- 	WGS-72		1972 World Geodetic System
- 	Australian	1965 Used down under
- 	Krasovsky	1940 Used in the Soviet Union
- 	International	1924 Worldwide use
- 	Hayford-1909	1909 Same as the International 1924
- 	Clarke-1880	1880 Most of Africa, France
- 	Clarke-1866	1866 North America, the Phillipines
- 	Airy		1830 Great Britain
- 	Bessel		1841 Central Europe, Chile, Indonesia
- 	Everest		1830 India, Burma, Pakistan,  etc.
- 	Sphere		1980 The mean radius in GRS-80
-.br
-Default: Clarke-1866 as per USGS standard.
-.TP
-.B \-F
-\fInavformat\fP
-.br
-Sets the input navigation format. The available formats
-include the old, pre-OIC format (\fB\-F\fP\fI1\fP), the new, OIC
-associated formats (\fB\-F\fP\fI2\fP), and navigation obtained
-using \fBmblist\fP with the \fB\-OtXY\fP option.
-.TP
-.B \-H
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-.TP
-.B \-I
-\fIfilename\fP
-.br
-Sets the input WHOI DSL AMS-120 navigation filename.
-.TP
-.B \-J
-\fIutm_zone\fP
-.br
-Sets the UTM zone used for the translation. The UTM zones
-are 6 degrees wide in longitude and begin with zone 1 extending
-from 180 W to 174 W, zone 2 extending from 174 W to 168 W, and
-so on through zone 60. Negative zone
-values are used for the Southern Hemisphere.
-.TP
-.B \-O
-\fIoutfile\fP
-.br
-Sets the output filename for the translated navigation.
-.TP
-.B \-V
-Causes \fBmbm_plot\fP to operate in "verbose" mode
-so that it outputs
-more information than usual.
-
-.SH EXAMPLES
-Suppose we have obtained a WHOI DSL navigation file
-as outlined above and execute the macro as suggested:
-.br
- 		mbm_dslnavfix \-Icruise.rnav \\
- 			-Ocruise.mrg2 \-F1 \-J27 \-V
-.br
-The output will appear as follows:
-
- Running mbm_dslnavfix...
-
- Program Status:
- \--------------
-
-   Input DSL navigation format:   1
-   Input DSL navigation file:     dsl.nav
-   Output navigation file:        dsl.mrg2
-   Temporary projected nav file:  tmp_proj_8044.nav
-   Temporary geographic nav file: tmp_geo_8044.nav
-
-   \------------
-
-   Projection:                    UTM Zone 27
-   Projection units:              meters
-
-   \------------
-
- 586 navigation records read...
-
- Running mapproject...
- mapproject tmp_proj_8044.nav \-Ju27/1:1000000 \-I \\
- 	-R-20:0/0:0/-19:0/1:0r > tmp_geo_8044.nav
-
- Deleting tmp_proj_8044.nav, tmp_geo_8044.nav...
-
- Done...
-
-.SH BUGS
-Let us know...
diff --git a/src/man/man1/mbm_fmtvel.1 b/src/man/man1/mbm_fmtvel.1
deleted file mode 100644
index 338de0f..0000000
--- a/src/man/man1/mbm_fmtvel.1
+++ /dev/null
@@ -1,52 +0,0 @@
-.TH mbm_fmtvel 1 "7 June 2013" "MB-System 5.0" "MB-System 5.0"
-.SH NAME
-\fBmbm_fmtvel\fP \- Extract sound velocity info from Hydrosweep data
-files and create output in tabular format.
-
-.SH VERSION
-Version 5.0
-
-.SH SYNOPSIS
-\fBmbm_fmtvel\fP [\fB\-F\fIformat \fB\-I\fIinfilename \fP]
-
-.SH DESCRIPTION
-\fBmbm_fmtvel\fP is a macro that scans a Hydrosweep swath sonar data file
-using the program \fBmbhsdump\fP and generates a list in columnar
-format with time, date, latitude, longitude, C-mean, and C-keel
-entrys. Comment records (lines) at the top of the output begin with '#'.
-The columns are tab-delimited. The only allowed formats are 21 (raw
-Hydrosweep data) and 24 (L-DEO in-house binary Hydrosweep data).
-
-.SH AUTHORSHIP
-David W. Caress (caress at mbari.org)
-.br
-  Monterey Bay Aquarium Research Institute
-.br
-Dale N. Chayes (dale at ldeo.columbia.edu)
-.br
-  Lamont-Doherty Earth Observatory
-.br
-Suzanne H. O'Hara (sohara at ldeo.columbia.edu)
-.br
-  Lamont-Doherty Earth Observatory
-
-.SH OPTIONS
-.TP
-.B \-F
-\fIformat\fP
-.br
-Sets the format for the input swath sonar data using
-\fBMBIO\fP integer format identifiers. The only allowed
-formats are 21 (raw
-Hydrosweep data) and 24 (L-DEO in-house binary Hydrosweep data).
-.TP
-.B \-I
-\fIinfilename\fP
-.br
-Data file from which the input data will be read.
-
-.SH SEE ALSO
-\fBmbsystem\fP(1)
-
-.SH BUGS
-Only one output format is currently supported.
diff --git a/src/man/man1/mbm_grd2arc.1 b/src/man/man1/mbm_grd2arc.1
deleted file mode 100644
index 749a8f1..0000000
--- a/src/man/man1/mbm_grd2arc.1
+++ /dev/null
@@ -1,119 +0,0 @@
-.TH mbm_grd2arc 1 "3 June 2013" "MB-System 5.0" "MB-System 5.0"
-.SH NAME
-\fBmbm_grd2arc\fP \- Macro to convert a GMT
-grid file in the GMT NetCDF grid format
-to an ArcView ASCII grid.
-
-.SH VERSION
-Version 5.0
-
-.SH SYNOPSIS
-mbm_grd2arc \fB\-I\fP\fIgrdfile\fP \fB\-O\fP\fIarcfile\fP [\fB\-H\fP \fB\-N\fP\fInodata\fP \fB\-V\fP]
-
-.SH DESCRIPTION
-\fBmbm_grd2arc\fP is a macro to convert a GMT
-grid file in the GMT NetCDF grid format
-to an ArcView ASCII grid. This allows users to import the grid
-into Arc/Info and ArcView. The grids must have the same grid
-interval in both longitude and latitude. If the grid was created
-using \fBmbgrid\fP or \fBmbmosaic\fP, the \fB\-E\fP option
-must have been used in that program
-to set the grid cell sizes equal (see the mbgrid and mbmosaic
-manual pages).
-.br
-The macro first obtains the bounds, dimensions, and grid
-cell size of the grid using the GMT program \fBgrdinfo\fP.
-The grid dimensions, the lower left position, and the
-grid cell size are written to the header of the output
-ArcView ASCII grid file.
-The macro then uses the GMT program \fBgrd2xyz\fP to
-dump each of the grid values to a temporary ASCII file.
-This temporary file is read and parsed one value at
-a time.  Any NaN values are
-replaced by the \fInodata\fP value specified with the \fB\-N\fP
-option. Each final value is printed to the output file.
-
-.SH AUTHORSHIP
-David W. Caress (caress at mbari.org)
-.br
-  Monterey Bay Aquarium Research Institute
-.br
-Dale N. Chayes (dale at ldeo.columbia.edu)
-.br
-  Lamont-Doherty Earth Observatory
-
-.SH OPTIONS
-.TP
-.B \-H
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-.TP
-.B \-I
-\fIgrdname\fP
-.br
-Sets the filename of the input GMT grid file. This file must be
-in the GMT NetCDF GRD format.
-.TP
-.B \-N
-\fInodata\fP
-.br
-Sets the "no data" value used in the output ASCII file.
-Default: \fInodata\fP = \-99999.
-.TP
-.B \-O
-\fIarcfile\fP
-.br
-Sets the filename of the output ArcView ASCII grid.
-.TP
-.B \-V
-The \fB\-V\fP option causes \fBmbm_grd2arc\fP to print out status messages.
-
-.SH EXAMPLES
-Suppose that we have used \fBmbgrid\fP to obtain a
-topography grid file called KohalaA_bath.grd in the GMT NetCDF
-GRD format:
- 	mbgrid \-Idatalist \\
- 		-OKohalaA_bath \\
- 		-R-155.72855/-155.31928/20.09488/20.47645 \\
- 		-E30.0/0m! \-A2 \-N \-G3 \-C1 \-V
-.br
-In this case, the \fB\-E\fP option was used
-to force \fBmbgrid\fP to use equal longitude and latitude
-grid cell sizes. See the \fBmbgrid\fP or \fBmbmosaic\fP manual pages for
-details on the usage of the \fB\-E\fP option in those
-programs.
-
-In order to convert KohalaA_bath.grd to an ArcView ASCII grid
-so that the data can be imported into the Arc/Info or ArcView
-GIS packages, we use the \fBmbm_grd2arc\fP macro:
- 	mbm_grd2arc \-IKohalaA_bath.grd \\
- 		-OKohalaA_bath.asc \-V
-.br
-Running the example above produced the following output:
-
- 	Program mbm_grd2arc status:
- 	        Input GRD file:            KohalaA_bath.grd
- 	        Output ArcView ASCII file: KohalaA_bath.asc
- 	        Grid dimensions:  1426  1329
- 	        Grid cell sizes:  0.0002871995719  0.0002871995719
- 	        Grid bounds:      \-155.72855  \-155.3192906    20.09488  20.47628103
-
- 	Generating temporary file...
- 	Parsing temporary file...
- 	10% complete
- 	20% complete
- 	30% complete
- 	40% complete
- 	50% complete
- 	60% complete
- 	70% complete
- 	80% complete
- 	90% complete
- 	100% complete
-
-.SH SEE ALSO
-\fBmbsystem\fP(1), \fBmbgrid\fP(1),
-\fBmbmosaic\fP(1), \fBmbm_arc2grd\fP(1), \fBmbm_grid\fP(1)
-
-.SH BUGS
-Maybe. Maybe not.
diff --git a/src/man/man1/mbm_grd2geovrml.1 b/src/man/man1/mbm_grd2geovrml.1
deleted file mode 100644
index 65c0f54..0000000
--- a/src/man/man1/mbm_grd2geovrml.1
+++ /dev/null
@@ -1,408 +0,0 @@
-.TH mbm_grd2geovrml 1 "3 June 2013" "MB-System 5.0" "MB-System 5.0"
-.SH NAME
-\fBmbm_grd2geovrml\fP \- Create and execute commands which generate
-a TerraVision tileset and GeoVRML terrain set that can be combined
-with other geospatial data for viewing in a web browser.
-
-.SH VERSION
-Version 5.0
-
-.SH SYNOPSIS
-\fBmbm_grd2geovrml\fP \fIbath_file\fP
-\fB\-tvdir\fP \fItvparent\fP
-\fB\-vrmldir\fP \fIvrmlparent\fP
-\fB\-olat\fP \fIlat\fP
-\fB\-olon\fP \fIlon\fP
-\fB\-vrmlurl\fP \fIurl\fP
-
-
-Additional Options:
-
-\fB\-elevscale\fP \fIvert_exag\fP
-\fB\-nowrz\fP
-\fB\-noview\fP
-\fB\-pallette\fP \fIpal\fP
-\fB\-newimage\fP \fItype|file\fP
-\fB\-white\fP
-\fB\-zmax\fP \fImaxclip\fP
-\fB\-zmin\fP \fIminclip\fP
-\fB\-basename\fP \fIbasename\fP
-
-.SH DESCRIPTION
-\fBmbm_grd2geovrml\fP is a macro that takes as input a GMT
-geographic-coordinate bathymetry grid file (\fIbath_file\fP) and
-produces a terrain tile set that may be viewed in a web browser
-with an appropriate plugin.  The bathymetry (geometry) is paired with
-imagery (texture) to produce artificially illuminated terrain or slope
-shaded terrain. Alternatively, a co-registered image may be provided
-as a substitute to the latter imagery which is generated from the
-bathymetry data.  This may be used to, for instance, draping a side
-scan sonar image over the bathymetry.
-
-Before the geoVRML files can be created an intermediate TerraVision
-tile set must be created from the input GMT bathymetry file and a
-TIFF image that is either generated from the bathymetry or specified
-from an existing file with the \fI-newimage\fP option.
-
-This tileset is then used to
-generate a GeoVRML quadtree multi-resolution set of files.  The resulting
-set of files will be created in \fIvrmlparent\fP/<basename>, where
-<basename> is the same as \fIbath_file\fP without the usual '.grd' extension.
-This behavior may be overridded with the \fB\-basename\fP option.  This
-is useful if an existing image file is specified with the \fB\-newimage\fP
-\fIfile\fP option, in which case the image file base name should be used with
-\fB\-basename\fP (see second example below).
-
-The index.html file produced in this directory can be
-loaded into Netscape 4.7 on a PC (properly configured with CosmoPlayer
-and GeoVRML 1.1) for interactive visualization. The resulting
-terrain can be used as a 3D basemap for use in visualizing
-other georeferenced data that has also been placed in GeoVRML
-using the same \fB\-olat\fP and \fB\-olon\fP settings.
-
-GeoVRML (and TerraVision) expects rectangular gridded elevation data
-and browsers render all terrain data within the rectangle.  This presents a
-problem for ocean bathymetric data which often have irregular (not rectangular)
-boundaries.  Before converting a grid file to TerraVision format
-\fBmbm_grd2geovrml\fP replaces all no-data elevation values with a coarse
-resolution spline-filled extrapolation from the data in the irregular
-area. This results in a rectangular grid
-with smooth transitions from areas of elevation data to areas of no data.
-In the resulting GeoVRML the no data areas are colored black
-(or white if \fB\-white\fP is specified).  If \fB\-newimage\fP
-\fIfile\fP is specified then the outer boundaries will stay the same
-color as in the image.
-
-.SH AUTHORSHIP
-Mike McCann (mccann at mbari.org)
-.br
-  Monterey Bay Aquarium Research Institute
-.br
-
-.SH SIMPLE DESCRIPTION OF BASIC OPTIONS
-.TP
-.B \
-\fIbath_file\fP
-.br
-A GMT gridded bathymetry file in geographic (lat/lon) coordinates.
-The file can be expressed with just the base name without the .grd
-extension, in which case the macro will append '.grd.gz' to \fIbath_file\fP
-and uncompress the data upon input. If the compressed data file does not
-exist then '.grd' will be appended to \fIbath_file\fP and it will be
-used, if it exists.
-
-.TP
-.B \-tvdir
-\fItvparent\fP
-
-The TerraVision tileset destination directory.
-A subdirectory named \fIbath_file\fP (without the .grd extension)
-will be created here.
-.TP
-.B \-vrmldir
-\fIvrmlparent\fP
-.br
-The GeoVRML tileset destination directory.
-A subdirectory named \fIbath_file\fP (without the .grd extension)
-will be created here.
-
-.TP
-.B \-olat
-\fIlat\fP
-.TP
-.B \-olon
-\fIlon\fP
-
-.br
-The geoOrigin latitude and longitude in decimal degrees. Because of single
-precision arithmetic in VRML97 it is necessary to define
-a geoOrigin from which offsets are computed before coordinates
-are passed into the visualization pipeline.  The geoOrigin should
-be within 5 degrees of the extent of the grid file in order to
-have submeter precision in the location of objects within the
-resulting GeoVRML output.  See the GeoVRML spec for more details.
-.br
-
-.br
-The GeoOrigin of the terrain must be the same as the GeoOrigin
-of any other GeoVRML content (e.g. navigation tracks, sample
-locations) that you wish to combine with the terrain.
-
-.TP
-.B \-vrmlurl
-\fIurl\fP
-.br
-All default URLs that are placed in the VRML files will be relative.
-However, you should use the \fB\-vrmlurl\fP option to specify an absolute URL
-for the set of tiles.
-Then all of the URLs that are used in the VRML files (image
-texture links and childUrls in the GeoLOD node) will use this as
-their base URL.
-This is generally not desirable because hardcoding absolute URLs
-into your datasets means that the dataset is nonportable to another
-server, or
-different location on the same server. However, it may be necessary
-to write absolute URLs in your tile files, especially if you have
-many levels because
-some VRML browsers have problems with relative links, resulting
-in tiles and images that will not load.
-
-.SH DESCRIPTION OF OPTIONAL OPTIONS
-
-.TP
-.B \-elevscale
-\fIvert_exag\fP
-.br
-Factor with which to multiply elevations resulting in a vertical
-exaggeration of the terrain.  The default value is 1.0. Factors
-greater than 1.0 increase vertical exaggeration.
-
-.TP
-.B \-nowrz
-.br
-By default vrml output files are gzipped and saved with the .wrz
-extension.  Specify \-nowrz to override this and save the files
-uncompressed with the .wrl extension.
-
-.TP
-.B \-noview
-.br
-By default a GeoViewpoint node with description 'home' is included
-with each GeoVRML tile file.  These viewpoints are helpful for
-creating terrain-only visualizations, but they also quickly fill up
-the viewpoint list when many tiles are loaded.  If you are
-creating GeoVRML tilesets
-to combine with other GeoVRML content that contain viewpoints
-then you may want to not have these 'home' viewpoints.
-Specify \-noview to not include a GeoViewpoint with each tile.
-
-.TP
-.B \-newimage
-\fItype|file\fP
-.br
-By default an orthorectified image for the bathymetry is created by running
-mbm_grdtiff(1) and then quadrupling the image size using ImageMagick
-mogrify(1). (The quadrupling together with the '-numpixels 16'
-argument in the make_geovrml(1) command results in identical resolution
-of the highest level GeoVRML tiles and the original bathymetric
-data.)  Making this image can be a time consuming process.  By default,
-if a file with '.tif' appended to \fIbath_file\fP (without the .grd
-extension) or appended to \fIbasename\fP (if \fI-basename\fP option
-is specified) exists in $TMPDIR then
-a new image is not created.  To override this either remove the .tif
-file or specify the \-newimage option.
-
-.br
-\fItype|file\fP is the type used in the \-G option of mbm_grdtiff(1)
-or the name of a TIFF file that you wish draped over the bathymetry.
-
-The default type value is 2 for synthetic illumination with Haxby color
-map (this may be modified with the \fB\-pallette\fP option). Use 5 to shade
-the image by slope value.
-If <type|file> is an image file name then that file is assumed to be
-orthorectified TIFF image (ending in .tif) that is co-registered
-with the bathymetry file.
-This can be used to for example drape a side-scan sonar image
-over the elevation data.
-It is up to the user to confirm the co-registration between the terrain
-data and the image data.
-
-.TP
-.B \-white
-.br
-By default a black background is generated for the orthorectified
-image.  If a white background is desired (for example, for printing purposes)
-then use this option.  Typically, for computer visual display a black
-background works best.
-
-.TP
-.B \-zmax
-\fImaxclip\fP
-.TP
-.B \-zmin
-\fIminclip\fP
-
-Maxclip and minclip may be used clip the elevation data at set
-values.  For instance, to clip the elevation data at sealevel
-and tile only bathymetry use \fB\-zmax 0\fP.  To force a color map
-of the standard Haxby colors between 4000 and 3000 meters
-depth use \fB\-zmin \-4000 \-zmax \-3000\fP.
-
-.TP
-.B \-pallette
-\fIpal\fP
-
-The number of Color Lookup Table
-that is passed on to the \-W1/ option of mbm_grdtiff(1).
-The default value is 1 \- the Haxby color map.  For reference, the
-color tables values are:
-        \fIpallette\fP = 1:     Haxby colors [default]
-        \fIpallette\fP = 2:     high Intensity colors
-        \fIpallette\fP = 3:     low Intensity colors
-        \fIpallette\fP = 4:     grayscale
-        \fIpallette\fP = 5:     uniform grayscale
-.br
-
-
-.SH ENVIRONMENT VARIABLE AND LOG FILE
-
-The environment variable TMPDIR must be defined.  It specifies the
-directory in which \fBmbm_grd2geovrml\fP does its work.  $TMPDIR should
-have sufficient space to hold the temporary grid and image
-files that get created.  The resulting 4 times magnified tiff
-images are left in $TMPDIR.  These large image files are reused unless
-the \fB\-newimage\fP option is specified.
-
-A log file is saved at the end of processing in the \fIvrmlparent\fP
-directory.  It includes all the commands and their output.  This
-file may be edited and executed again in order to produce customized
-output.
-
-.SH EXAMPLES
-This example creates a GeoVRML set of terrain tiles from the bathymetry
-data in file PapauA_bath.grd.  The geometry
-files will not be compressed and viewpoints will be included with each
-tile.
-.br
-
-.br
-  mbm_grd2geovrml PapauA_bath \\
-    \-olat 21 \-olon \-157 \\
-    \-tvdir ~/TileSets/Pyramids/hawaii \\
-    \-vrmldir ~/TileSets/geoVRML/hawaii \\
-    \-nowrz \-vrmlurl \\
-    http://menard/vrml/terrain/hawaii/PapauA_bath
-.br
-
-.br
-
-.br
-This example creates a grid file of the Northeast Pacific
-at one minute resolution and creates the GeoVRML tiles of it
-with the elevations clipped at sea level.  A new synthetic
-illuminated Haxby-colored image is generated from the elevation data.
-.br
-
-.br
-  # Extract 1 minute data for Northeastern Pacific Ocean
-  # and convert it to GeoVRML terrain
-  #
-  grdraster 4 \-R-165/-105/15/50\\
-        \-GNEPacific.grd \\
-        \-I1m \-V
-
-  mbm_grd2geovrml NEPacific.grd \\
-    \-tvdir ~/TileSets/Pyramids/pacific \\
-    \-vrmldir ~/TileSets/geoVRML/pacific  \\
-    \-vrmlurl \\
-    http://menard/vrml/terrain/hawaii/NEPacific \\
-    \-zmax 0 \-olat 35 \-olon \-135 \-newimage
-.br
-
-.br
-
-.br
-This example generates a slope-shaded image from the bathymetry
-data in PapauA_bath.grd and saves the geoVRML file in the directory
-~/TileSets/geoVRML/hawaii/PapauA_slope.  No viewpoints are specified.
-.br
-
-.br
-
-  mbm_grd2geovrml PapauA_bath \\
-      \-olat 21 \-olon \-157 \\
-      \-tvdir ~/TileSets/Pyramids/hawaii \\
-      \-vrmldir ~/TileSets/geoVRML/hawaii \\
-      \-vrmlurl \\
-      http://menard/vrml/terrain/hawaii/PapauA_slope \\
-      \-noview \\
-      \-newimage 5 \\
-      \-basename PapauA_slope
-
-.br
-
-.br
-
-.br
-This example uses a pre-generated side-scan sonar TIFF image and drapes
-it over the bathymetry data in PapauA_bath.grd.  Viewpoints are excluded.
-Ouptut is written to ~/TileSets/geoVRML/hawaii/PapauA_ssdtl.
-.br
-
-.br
-
-  mbm_grd2geovrml PapauA_bath \\
-      \-olat 21 \-olon \-157 \\
-      \-tvdir ~/TileSets/Pyramids/hawaii \\
-      \-vrmldir ~/TileSets/geoVRML/hawaii \\
-      \-vrmlurl \\
-      http://menard/vrml/terrain/hawaii/PapauA_ssdtl \\
-      \-noview \\
-      \-newimage PapauA_ssdtl.tif \\
-      \-basename PapauA_ssdtl
-
-
-
-
-.SH SEE ALSO
-
-This macro is built upon some pretty strong shoulders.  It uses
-all of these programs which must be installed on your system.
-
-GMT programs:
-\fBgrdclip\fP(1),
-\fBgrdsample\fP(1),
-\fBgrd2xyz\fP(1),
-\fBblockmean\fP(1),
-\fBsurface\fP(1),
-\fBgrdedit\fP(1),
-\fBgrdmath\fP(1),
-\fBgrdclip\fP(1),
-
-mb-system macro:
-\fBmbm_grdtiff\fP(1)
-
-mb-system utility:
-\fBmbstripNaN\fP(1)
-
-tsmApi-2.3 (http://www.tsmapi.com) programs:
-\fBmake_dem\fP(1),
-\fBmake_oi\fP(1)
-\fBmake_geovrml\fP(1)
-
-Note that after you've created the TerraVision tile sets with this
-macro you may rerun make_geovrml(1) with different options, for
-instance to make files for a different server or with a different
-vertical exaggeration or background color.  This can save a lot
-of processing time if you don't need to generate a new image
-from the bathymetric data.
-
-ImageMagick (http://www.imagemagick.org) program:
-\fBmogrify\fP(1)
-
-.br
-Please see http://www.mbari.org/~mccann/vrml/ROVDataVis
-for example content and more information on the project that developed this
-macro.
-.SH BUGS
-
-You need to manually clean up the leftover files that get created in $TMPDIR.
-.br
-
-.br
-The \fB\-vrmlurl\fP option must be specified.  As of 19 March 2003 there is a
-bug in \fBmake_geovrml\fP(1) where if the \fB\-vrmlurl\fP option  is not
-specified invalid VRML is
-generated.  This is generally not a problem.  Because of bugs in VRML browsers
-all URLs must be absolute anyway.
-.br
-
-.br
-The GeoVRML content produced by this macro may be
-viewed using Internet Explorer
-with the Cortona 4.0 VRML plugin or in Netscape 4.7 with the CosmoPlayer
-plugin.  Both browsers have problems with loading a second world after
-you have viewed one.  Netscape 4.7 often must be closed by killing it
-with Windows Task Manager.  Sometimes the CosmoPlayer plugin will refuse
-to load at all.  If this happens try removing all cp* files in %TEMP% or
-logging in with another Windows account so that a different profile is used.
diff --git a/src/man/man1/mbm_grd3dplot.1 b/src/man/man1/mbm_grd3dplot.1
deleted file mode 100644
index b5b842e..0000000
--- a/src/man/man1/mbm_grd3dplot.1
+++ /dev/null
@@ -1,952 +0,0 @@
-.TH mbm_grd3dplot 1 "9 January 2015" "MB-System 5.0" "MB-System 5.0"
-.SH NAME
-\fBmbm_grd3dplot\fP \- Create an executable shellscript which will generate
-a GMT 3D perspective plot of gridded data in a GMT grd file.
-
-.SH VERSION
-Version 5.0
-
-.SH SYNOPSIS
-\fBmbm_grd3dplot\fP \fB\-I\fP\fIfile\fP
-[\fB\-A\fP[\fImagnitude\fP[\fI/azimuth/elevation\fP]
-\fB\-D\fP[\fIflipcolor/flipshade\fP]
-\fB\-E\fP[\fIview_az/view_el\fP] \fB\-F\fP\fIexaggeration\fP
-\fB\-G\fP\fIcolor_mode\fP \fB\-H\fP \fB\-K\fP\fIintensity_file \fP
-\fB\-N\fP\fIdrape_file\fP
-\fB\-O\fP\fIroot\fP \fB\-P\fP\fIpagesize \fP
-\fB\-S\fP\fI[color/shade]\fP \fB\-U\fP\fIorientation\fP \fB\-V\fP
-\fB\-W\fP[\fIcolor_style\fP[\fI/palette\fP[\fIncolors\fP]] | \fIcptfile\fP] ]
-
-Additional Options:
-.br
-[\fB\-B\fP\fItickinfo\fP
-\fB\-J\fP\fIprojection\fP[\fI/scale | width\fP]
-\fB\-L\fP\fItitle\fP[\fI:scale_label\fP] \fB\-M\fP\fImisc\fP
-\fB\-Q\fP \fB\-R\fP\fIw/e/s/n\fP \fB\-X\fP \fB\-Y\fP
-\fB\-Z\fP\fImin/max\fP ]
-
-Miscellaneous Options:
-.br
-[\fB\-MGD\fP\fIgmtdef/value\fP  \fB\-MGF\fP\fIscale_loc\fP
-\fB\-MGL\fP[\fIf\fP][\fIx\fP]\fIlon0/lat0/slat/length\fP[\fIunits\fP][\fI+llabel\fP]
-\fB\-MGQ\fP\fIdpi\fP \fB\-MGS\fP\fIscalefactor\fP
-\fB\-MGT\fP\fIx/y/size/angle/font/just/text\fP
-\fB\-MGU\fP\fP[\fI/dx/dy/\fP][\fIlabel\fP]
-\fB\-MVM\fP\fImesh_pen\fP \fB\-MVN\fP[\fInull[/r/g/b]\fP] ]
-
-.SH DESCRIPTION
-\fBmbm_grd3dplot\fP is a macro to generate a shellscript of GMT commands which, when
-executed, will generate a 3D perspective Postscript plot of
-gridded data.  Several styles of plots can be generated,
-including color fill views, color shaded relief views, mesh
-plot views, and text labels. Five different color schemes are
-included. The plot will be scaled to fit on the specified page
-size or, if the scale is user defined, the page size will be
-chosen in accordance with the plot size. The vertical exaggeration
-may be specified. The primary purpose
-of this macro is to allow the simple, semi-automated
-production of nice looking maps with a few command line
-arguments. For users seeking more control over the plot
-appearance, a number of additional optional arguments are
-provided. Truly ambitious users may edit the plot shellscript
-to take advantage of GMT capabilities not supported by this
-macro.
-
-By default the output plot generation shellscript
-includes lines which execute a program to display the Postscript
-image on the screen. The program to be used to display the Postscript
-is set using \fBmbdefaults\fP; the default value can be overridden
-by setting the environment variable $MB_PS_VIEWER.
-Invoking the plot generation shellscript with
-a \fB-N\fP command line argument suppresses the screen
-display of the plot.
-
-The plot scripts generated by this macro will work with
-GMT version 5.0 and later, and are not compatible with
-earlier versions of GMT.
-
-.SH AUTHORSHIP
-David W. Caress (caress at mbari.org)
-.br
-  Monterey Bay Aquarium Research Institute
-.br
-Dale N. Chayes (dale at ldeo.columbia.edu)
-.br
-  Lamont-Doherty Earth Observatory
-
-.SH SIMPLE DESCRIPTION OF BASIC OPTIONS
-.TP
-.B \-A
-\fImagnitude[/azimuth/elevation]\fP
-.br
-Sets the parameters which control the
-synthetic illumination of the gridded data (shaded relief).
-The value \fImagnitude\fP
-is an effective vertical exageration which modulates the intensity of
-the shading; typical values are in the 0.1 to 10 range.
-The value \fIazimuth\fP
-is the azimuth in degrees from north from which the data is illuminated.
-The value \fIelevation\fP is the elevation of the illumination
-in degrees from horizontal.
-Defaults: \fImagnitude\fP = 0.2; \fIazimuth\fP = 0.0;
-\fIelevation\fP = 30.0;
-.TP
-.B \-D
-\fI[flipcolor/flipshade]\fP
-.br
-Normally, the color or grayscale tables used for color maps run from
-cool colors (or dark grays) for low grid values
-to hot colors (or light grays) for high grid values.
-This option reverses the color table so that cool colors (dark grays)
-correspond to high values and hot colors (light grays) to low values.
-If \fB\-D\fP is given alone, it applies to the color table used
-for color or gray fill plots,  shaded or unshaded. If the plot
-is to be shaded,  either by synthetic illumination (\fB\-G\fP\fI2\fP)
-or using an intensity file (\fB\-K\fP and \fB\-G\fP\fI3\fP options), then
-setting \fIflipshade\fP = 1 will cause the shading convention
-to be reversed (e.g. high intensities overlaid as light shading).
-Using \fB\-D\fP\fI0/1\fP will flip the shading convention
-but leave the default color convention.
-.TP
-.B \-E
-[\fIview_az/view_el\fP]
-.br
-Sets the azimuth and elevation in degrees of the
-viewpoint for 3D perspective views.  An \fIview_az\fP of 0
-represents a view from the north, and \fIview_az\fP = 90
-represents a view from the east.  An \fIview_el\fP of 0
-represents a horizontal view.  Default: \fIview_az\fP = 200.;
-elevation = 40.
-.TP
-.B \-F
-[\fIexaggeration\fP]
-.br
-Sets the vertical exaggeration of the perspective plot.
-By default the vertical exaggeration is chosen so that the
-plot fits nicely on the page. This option works only if the
-data are in geographic coordinates (longitude and latitude).
-.TP
-.B \-G
-\fIcolor_mode\fP
-.br
-Turns on color fill plot and sets the style of the plot.
-.br
-        \fIcolor_mode\fP = 1: 3D color/gray fill.
-        \fIcolor_mode\fP = 2: 3D color/gray fill shaded by
-                        synthetic illumination.
-        \fIcolor_mode\fP = 3: 3D color/gray fill shaded by
-                        an intensity file. The \fB\-K\fP
-                        option must be used to specify
- 			the intensity file.
-        \fIcolor_mode\fP = 4: 3D Color/gray fill of slope
- 			magnitude.
-        \fIcolor_mode\fP = 5: 3D Color/gray fill shaded by
-                        slope magnitude.
-        \fIcolor_mode\fP = 6: 3D mesh plot.
-        \fIcolor_mode\fP = 7: 3D mesh plot with contours.
-.TP
-.B \-H
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-.TP
-.B \-I
-\fIgrdfile\fP
-.br
-Sets the name of the gridded data file to be plotted.
-Alternatively, \fIgrdfile\fP may be a list of grid files
-(one filename on each line) to be plotted together.
-.TP
-.B \-K
-\fIintensity_file\fP
-.br
-Sets the name of the gridded data file containing
-instensity values to be used for shading the map.
-.TP
-.B \-N
-\fIdrape_file\fP
-.br
-Sets the name of the gridded data file to be draped on
-the relief provided by the file specified with the \fB\-I\fP
-option. If \fB\-N\fP\fIdrape_file\fP is specified, then
-all color control options will apply to the data in
-\\fIdrape_file\fP.
-.TP
-.B \-O
-\fIroot\fP
-.br
-Sets the root used to construct the filename of the output shellscript
-(\fIroot\fP.cmd) and names of files created when the shellscript is
-run.  Normally the
-name of the input grid file or grid file list is
-used as the \fIroot\fP.
-.TP
-.B \-P
-\fIpagesize\fP
-.br
-This option sets the size of the page the plot will be centered
-on. If the user does not set the plot scale, the plot will be
-sized as large as will fit on the designated page. If the user
-sets the plot scale such that the plot will not fit on the
-designated page, a larger page will be used.
-The supported page sizes include ANSI A, B, C, D, E,
-F, and E1, as well as most metric page sizes. See the
-COMPLETE DESCRIPTION OF OPTIONS section
-below for a complete list of
-the supported page sizes. The default page size is A.
-.TP
-.B \-S
-\fI[color/shade]\fP
-.br
-This option enables effective histogram equalization of the
-color and/or shading of the gridded data. The equalization is
-not achieved by changing the data values, but rather by
-constructing the color or shading tables so that
-the boundaries in the tables encompass equal fractions of
-the datapoints. This serves to focus color or shading contrasts
-in value ranges corresponding to the bulk of the data values.
-If \fB\-S\fP is given alone or with \fIcolor\fP = 1,
-it enables equalization of the color table used
-for color or gray fill plots,  shaded or unshaded. If the plot
-is to be shaded,  either by synthetic illumination (\fB\-G\fP\fI2\fP)
-or using an intensity file (\fB\-K\fP and \fB\-G\fP\fI3\fP options), then
-setting \fIshade\fP = 1 will cause the shading to be equalized.
-Using \fB\-S\fP\fI0/1\fP will equalize the shading without
-equalizing the color table.
-.TP
-.B \-U
-\fIorientation\fP
-.br
-Normally the orientation of the plot (portrait or landscape)
-is selected automatically so as to maximize the plot scale.
-The \fB\-U\fP option allows the user to set the plot orientation. If
-\fIorientation\fP = 1, a portrait plot will be produced; if
-\fIorientation\fP = 2, a landscape plot will be produced.
-.TP
-.B \-V
-Causes \fBmbm_grd3dplot\fP to operate in "verbose" mode
-so that it outputs
-more information than usual.
-.TP
-.B \-W
-\fI[color_style\fP[\fI/palette\fP[\fIncolors\fP]] | cptfile]
-.br
-This option controls the color scheme used for color
-fill plots.
-
-If \fIcolor_style\fP = 1 [default], then
-the color scheme used will be a continuous grading
-of colors. If \fIcolor_style\fP = 2, the color scheme
-will be a set of discrete color intervals. The color
-palette used is set using \fIpalette\fP. Five palettes
-are available:
- 	\fIpalette\fP = 1:	Haxby colors [default]
- 	\fIpalette\fP = 2:	high Intensity colors
- 	\fIpalette\fP = 3:	low Intensity colors
- 	\fIpalette\fP = 4:	grayscale
- 	\fIpalette\fP = 5:	uniform grayscale
-.br
-A complete description of the color palettes is given
-in the COMPLETE DESCRIPTION OF OPTIONS section below.
-.br
-The \fIncolors\fP parameter sets the number of color
-values used in plotting, whether the colors are
-represented in a continuous color scale or a
-stepped, discrete color scale [default is 11].
-
-If the option argument is the path to an existing \fBGMT\fP
-color palette (CPT) file, then that CPT file and its
-color scheme will be used for the plot
-
-.SH COMPLETE DESCRIPTION OF OPTIONS
-.TP
-.B \-A
-\fImagnitude[/azimuth]\fP
-.br
-Sets the parameters which control the
-synthetic illumination of the gridded data (shaded relief).
-The value \fImagnitude\fP
-is an effective vertical exageration which modulates the intensity of
-the shading; typical values are in the 0.1 to 0.5 range.
-The value \fIazimuth\fP
-is the azimuth from which the data is illuminated.
-Defaults: \fImagnitude\fP = 0.2; \fIazimuth\fP = 0.0;
-.TP
-.B \-B
-\fItickinfo\fP
-.br
-Sets map boundary tickmark intervals. See the \fBpsbasemap\fP
-manual page for details. By default the program chooses
-basemap annotations based on the map boundaries.
-.TP
-.B \-D
-\fI[flipcolor/flipshade]\fP
-.br
-Normally, the color or grayscale tables used for color maps run from
-cool colors (or dark grays) for low grid values
-to hot colors (or light grays) for high grid values.
-This option reverses the color table so that cool colors (dark grays)
-correspond to high values and hot colors (light grays) to low values.
-If \fB\-D\fP is given alone, it applies to the color table used
-for color or gray fill plots,  shaded or unshaded. If the plot
-is to be shaded,  either by synthetic illumination (\fB\-G\fP\fI2\fP)
-or using an intensity file (\fB\-K\fP and \fB\-G\fP\fI3\fP options), then
-setting \fIflipshade\fP = 1 will cause the shading convention
-to be reversed (e.g. high intensities overlaid as light shading).
-Using \fB\-D\fP\fI0/1\fP will flip the shading convention
-but leave the default color convention.
-.TP
-.B \-E
-[\fIview_az/view_el\fP]
-.br
-Sets the azimuth and elevation in degrees of the
-viewpoint for 3D perspective views.  An \fIview_az\fP of 0
-represents a view from the north, and \fIview_az\fP = 90
-represents a view from the east.  An \fIview_el\fP of 0
-represents a horizontal view.  Default: \fIview_az\fP = 200.;
-elevation = 40.
-.TP
-.B \-G
-\fIcolor_mode\fP
-.br
-Turns on color fill plot and sets the style of the plot.
-.br
-        \fIcolor_mode\fP = 1: 3D color/gray fill.
-        \fIcolor_mode\fP = 2: 3D color/gray fill shaded by
-                        synthetic illumination.
-        \fIcolor_mode\fP = 3: 3D color/gray fill shaded by
-                        an intensity file. The \fB\-K\fP
-                        option must be used to specify
- 			the intensity file.
-        \fIcolor_mode\fP = 4: 3D Color/gray fill of slope
- 			magnitude.
-        \fIcolor_mode\fP = 5: 3D Color/gray fill shaded by
-                        slope magnitude.
-        \fIcolor_mode\fP = 6: 3D mesh plot.
-        \fIcolor_mode\fP = 7: 3D mesh plot with contours.
-.br
-See the \fBgrdimage\fP manual page for information on shading
-with intensity files
-.TP
-.B \-H
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-.TP
-.B \-I
-\fIgrdfile\fP
-.br
-Sets the name of the gridded data file to be plotted.
-The data must be in a form acceptable to \fBGMT\fP version 3
-programs (see the \fBGMT\fP Cookbook & Technical Reference).
-.TP
-.B \-J
-\fIprojection\fP[\fI/scale | /width\fP]
-.br
-Selects the map projection. By default the map projection is
-Mercator and the plot scale is chosen to fit on the selected
-page size (see \fB\-P\fP option). The user may specify a
-different projection to be used, in which case the plot scale
-is still automatically chosen to fit the page. The user may
-also specify both the projection and the plot scale. If
-the projection specifying character is upper case, a plot
-width rather than a plot scale is used.
-The scale values are specified in inch/degree or in 1:xxxxx
-ratios. Plot widths are specified in inches. If the user
-specifies a plot scale such that the plot will not fit
-on the default A size page, a appropriately larger page
-size will be chosen.
-.br
-.sp
-\fBCYLINDRICAL PROJECTIONS:\fP
-.br
-.sp
-\fB\-Jc\fP\fIlon0/lat0/scale\fP (Cassini)
-.br
-\fB\-Jm\fP\fIscale\fP (Mercator)
-.br
-\fB\-Joa\fP\fIlon0/lat0/azimuth/scale\fP (Oblique Mercator \- point and azimuth)
-.br
-\fB\-Job\fP\fIlon0/lat0/lon1/lat1/scale\fP (Oblique Mercator \- two points)
-.br
-\fB\-Joc\fP\fIlon0/lat0/lonp/latp/scale\fP (Oblique Mercator \- point and pole)
-.br
-\fB\-Jq\fP\fIlon0/scale\fP (Equidistant Cylindrical Projection (Plate Carree))
-.br
-\fB\-Jt\fP\fIlon0/scale\fP (TM \- Transverse Mercator)
-.br
-\fB\-Ju\fP\fIzone/scale\fP (UTM \- Universal Transverse Mercator)
-.br
-\fB\-Jy\fP\fIlon0/lats/scale\fP (Basic Cylindrical Projection)
-.br
-.sp
-\fBAZIMUTHAL PROJECTIONS:\fP
-.br
-.sp
-\fB\-Ja\fP\fIlon0/lat0/scale\fP (Lambert).
-.br
-\fB\-Je\fP\fIlon0/lat0/scale\fP (Equidistant).
-.br
-\fB\-Jg\fP\fIlon0/lat0/scale\fP (Orthographic).
-.br
-\fB\-Js\fP\fIlon0/lat0/scale\fP (General Stereographic)
-.br
-.sp
-\fBCONIC PROJECTIONS:\fP
-.br
-.sp
-\fB\-Jb\fP\fIlon0/lat0/lat1/lat2/scale\fP (Albers)
-.br
-\fB\-Jl\fP\fIlon0/lat0/lat1/lat2/scale\fP (Lambert)
-.br
-.sp
-\fBMISCELLANEOUS PROJECTIONS:\fP
-.br
-.sp
-\fB\-Jh\fP\fIlon0/scale\fP (Hammer)
-.br
-\fB\-Ji\fP\fIlon0/scale\fP (Sinusoidal)
-.br
-\fB\-Jk\fP\fIlon0/scale\fP (Eckert VI)
-.br
-\fB\-Jn\fP\fIlon0/scale\fP (Robinson)
-.br
-\fB\-Jr\fP\fIlon0/scale\fP (Winkel Tripel)
-.br
-\fB\-Jw\fP\fIlon0/scale\fP (Mollweide)
-.br
-.sp
-\fBNON-GEOGRAPHICAL PROJECTIONS:\fP
-.br
-.sp
-\fB\-Jp\fP\fIscale\fP (Linear projection for polar (theta,r) coordinates)
-.br
-\fB\-Jx\fP\fIx-scale\fP[\fBl|p\fP\fIpow\fP][\fI/y-scale\fP[\fBl|p\fP\fIpow\fP]] (Linear, log, and power scaling)
-.br
-More details can be found in the \fBpsbasemap\fP manpages.
-.TP
-.B \-K
-\fIintensity_file\fP
-.br
-Sets the name of the gridded data file containing
-instensity values to be used for shading the map.
-.TP
-.B \-L
-\fItitle:scalelabel\fP
-.br
-Sets the title and the label for the colorscale (if used) of
-the plot. Note that a colon (:) rather than a slash (/) is
-used to separate the labels. Colons cannot be used in the
-labels themselves. If this option is not used, then a default title
-and colorscale label are provided. If the title is supplied
-alone, a default colorscale label will be provided. To force
-no title use \fB\-L\fP" "; to force no title or colorscale
-label use \fB\-L\fP" : ".
-.TP
-.B \-M
-A series of "miscellaneous" options are provided which are
-given as \fB\-M\fP followed by a two character identifier, followed
-by any other parameters associated with that option.
-The \fB\-M\fP options may be strung together separated by
-colons, e.g. "-MGQ100:GU", which is equivalent to
-"-MGQ \-MGU".
-.TP
-.B \-N
-\fIdrape_file\fP
-.br
-Sets the name of the gridded data file to be draped on
-the relief provided by the file specified with the \fB\-I\fP
-option. If \fB\-N\fP\fIdrape_file\fP is specified, then
-all color control options will apply to the data in
-\\fIdrape_file\fP.
-.TP
-.B \-MGD
-\fIgmtdef/value\fP
-.br
-Allows the user to set the \fBGMT\fP default values used as
-the plot is constructed. This command may be given repeatedly
-to set as many \fBGMT\fP defaults as required. For example, to
-set the basemap annotation font to Courier, use
-"-MGDANOT_FONT/Courier".
-.TP
-.B \-MGF
-\fIscale_loc\fP
-.br
-Sets the location of the color scale. The possible values
-of \fIscale_loc\fP are:
- 	\fIscale_loc\fP = b:	bottom of plot
- 	\fIscale_loc\fP = t:	top of plot
- 	\fIscale_loc\fP = l:	left of plot
- 	\fIscale_loc\fP = r:	right of plot
-.br
-[Default \fIscale_loc\fP = b]
-.TP
-.B \-MGL
-[\fIf\fP][\fIx\fP]\fIlon0/lat0/slat/length\fP[\fIunits\fP][\fI+llabel\fP]
-.br
-Draws a simple map scale centered on \fIlon0/lat0\fP.
-Use \fB\-Lf\fP to get a "fancy" scale [Default is plain].
-Use \fB\-Lx\fP to specify the position in inches instead of map units.
-The scale is calculated at latitude \fIslat\fP; if the string "center" is used
-instead of a numerical value for \fIslat\fP, then the macro will set
-the scaling according to the center of the plot bounds.
-The scale length value \fIlength\fP is in km 
-by default, but the units can be specified as one of e|f|k|M|n|u, where
-e = meters, f = feet, k = kilometers, M = statue miles, n = nautical miles,
-and u = US survey feet. Append \fI+l\fP to label the scale with the
-relevant units, or append \fI+l"label"\fP to set a different label string.
-.TP
-.B \-MGQ
-\fIdpi\fP
-.br
-Sets the resolution in dots per inch of the raster image used
-for color fill maps. Larger values of \fIdpi\fP produce larger
-Postscript plot files. [Default is 100].
-.TP
-.B \-MGS
-\fIscalefactor\fP
-.br
-The gridded data is multiplied by \fIscalefactor\fP.
-This option is most often used flip the sign of the
-data (\fIscalefactor\fP = \-1). [Default no scaling]
-.TP
-.B \-MGT
-\fIx/y/size/angle/font/just/text\fP
-.br
-Causes a text label to plotted on the map.
-\fIsize\fP is text size in points, \fIangle\fP is
-measured in degrees counter-clockwise from horizontal,
-\fIfontno\fP sets the font type, \fIjustify\fP sets the alignment.
-If \fIfontno\fP starts with a leading hyphen, then
-the remainder of \fIfontno\fP is taken to be a
-textstring with the desired fontname.  See the
-\fBgmtdefaults\fP man page for names and numbers of available fonts
-(or run \fBpstext \-L\fP).  The alignment
-number refers to the part of the textstring that will be mapped
-onto the (\fIx,y\fP) point: 1 = Lower Left corner,
-2 = Lower Center, 3 = Lower Right, 5 = Mid Left, 6 = Mid Center,
-7 = Mid Right, 9 = Upper Left, 10 = Upper Center,
-11 = Upper Right. This option may be given as many times as
-needed.
-.TP
-.B \-MGU
-\fP[\fI/dx/dy/\fP][\fIlabel\fP]
-.br
-Draw Unix System time stamp on plot.  User may specify where the lower left corner
-of the stamp should fall on the page relative to lower left corner of plot in inch [Default is (-0.75,-0.75)].  Optionally,
-append a label, or \fBc\fP (which will plot the command string.)
-.TP
-.B \-MVM
-\fImesh_pen\fP
-.br
-Set pen attributes for mesh plot.  The mesh plot must be specified
-with the \fB\-G\fP option. See chapter 4.12 in the
-GMT Technical reference for a discussion of GMT pen values.
-[Defaults: width = 1, color = 0/0/0,
-texture = solid].
-.TP
-.B \-MVN
-[\fInull[/r/g/b]\fP]
-.br
-Draws a plane at the level of the \fInull\fP value (with
-respect to the data in the grid file specified with the \fB\-I\fP
-option. If the optional r/g/b is provided,
-the frontal facade between the plane and the data perimeter is
-filled with this color. If \fB\-MVN\fP is given by
-itself, then \fBmbm_grd3dplot\fP causes
-the null plane to be drawn at the minimum z-level and the facade
-to be colored a light gray (r=g=b=200).
-.TP
-.B \-O
-\fIroot\fP
-.br
-Sets the root used to construct the filename of the output shellscript
-(\fIroot\fP.cmd) and names of files created when the shellscript is
-run.  Normally the
-name of the input grid file or grid file list is
-used as the \fIroot\fP.
-.TP
-.B \-P
-\fIpagesize\fP
-.br
-This option sets the size of the page the plot will be centered
-on. If the user does not set the plot scale, the plot will be
-sized as large as will fit on the designated page. If the user
-sets the plot scale such that the plot will not fit on the
-designated page, a larger page will be used.
-The supported page sizes are:
-
-          American ANSI sizes:
-          A     8.5 x 11.0 in.    ( 215.9 x  279.4 mm)
-          B    11.0 x 17.0 in.    ( 279.4 x  431.8 mm)
-          C    17.0 x 22.0 in.    ( 431.8 x  558.8 mm)
-          D    22.0 x 34.0 in.    ( 558.8 x  863.6 mm)
-          E    34.0 x 44.0 in.    ( 863.6 x 1117.6 mm)
-          F    28.0 x 40.0 in.    ( 711.2 x 1016.0 mm)
-          E1   44.0 x 68.0 in.    (1117.6 x 1727.2 mm)
-
-          Metric ISO A sizes:
-          A0   841.0 x 1189.0 mm  (33.11 x 46.81 in.)
-          A1   594.0 x  841.0 mm  (23.39 x 33.11 in.)
-          A2   420.0 x  594.0 mm  (16.54 x 23.39 in.)
-          A3   297.0 x  420.0 mm  (11.69 x 16.54 in.)
-          A4   210.0 x  297.0 mm  ( 8.27 x 11.69 in.)
-          A5   148.0 x  210.0 mm  ( 5.83 x  8.27 in.)
-          A6   105.0 x  148.0 mm  ( 4.13 x  5.83 in.)
-          A7    74.0 x  105.0 mm  ( 2.91 x  4.13 in.)
-          A8    52.0 x   74.0 mm  ( 2.05 x  2.91 in.)
-          A9    37.0 x   52.0 mm  ( 1.46 x  2.05 in.)
-          A10   26.0 x   37.0 mm  ( 1.02 x  1.46 in.)
-
-          Metric ISO B sizes:
-          B0   1000.0x 1414.0 mm  (39.37 x 55.67 in.)
-          B1   707.0 x 1000.0 mm  (27.83 x 39.37 in.)
-          B2   500.0 x  707.0 mm  (19.68 x 27.83 in.)
-          B3   353.0 x  500.0 mm  (13.90 x 19.68 in.)
-          B4   250.0 x  353.0 mm  ( 9.84 x 13.90 in.)
-          B5   176.0 x  250.0 mm  ( 6.93 x  9.84 in.)
-          B6   125.0 x  176.0 mm  ( 4.92 x  6.93 in.)
-          B7    88.0 x  125.0 mm  ( 3.46 x  4.92 in.)
-          B8    62.0 x   88.0 mm  ( 2.44 x  3.46 in.)
-          B9    44.0 x   62.0 mm  ( 1.73 x  2.44 in.)
-          B10   31.0 x   44.0 mm  ( 1.22 x  1.73 in.)
-
-          Metric ISO C sizes:
-          C0   914.4 x 1300.5 mm  (36.00 x 51.20 in.)
-          C1   650.2 x  914.4 mm  (25.60 x 36.00 in.)
-          C2   457.2 x  650.2 mm  (18.00 x 25.60 in.)
-          C3   325.1 x  457.2 mm  (12.80 x 18.00 in.)
-          C4   228.6 x  325.1 mm  ( 9.00 x 12.80 in.)
-          C5   162.6 x  228.6 mm  ( 6.40 x  9.00 in.)
-          C6   114.3 x  162.6 mm  ( 4.50 x  6.40 in.)
-          C7    81.3 x  114.3 mm  ( 3.20 x  4.50 in.)
-
-	  MB-System large format sizes:
-          m1  1371.6 x 1828.8 mm  (54.00 x 72.00 in.)
-          m2  1371.6 x 2133.6 mm  (54.00 x 84.00 in.)
-          m3  1371.6 x 2438.4 mm  (54.00 x 96.00 in.)
-          m4  1524.0 x 1828.8 mm  (60.00 x 72.00 in.)
-          m5  1524.0 x 2133.6 mm  (60.00 x 84.00 in.)
-          m6  1524.0 x 2438.4 mm  (60.00 x 96.00 in.)
-
-The default page size is A.
-.TP
-.B \-Q
-Normally, the output plot generation shellscript
-includes lines which execute
-a program to display the Postscript image on the screen.
-This option causes those lines to be commented out so
-that executing the shellscript produces a Postscript plot
-but does not attempt to display it on the screen.
-Alternatively, invoking the plot generation shellscript with
-a \fB-N\fP command line argument also suppresses the screen
-display of the plot. The program
-to be used to display the Postscript is set
-using \fBmbdefaults\fP;
-the default value can be overridden by setting the environment
-variable $MB_PS_VIEWER.
-.TP
-.B \-R
-\fIwest/east/south/north\fP
-.br
-\fIwest, east, south,\fP and \fInorth\fP specify the Region of interest.  To specify boundaries
-in degrees and minutes [and seconds], use the dd:mm[:ss] format.  Append \fBr\fP if lower left and upper right
-map coordinates are given instead of wesn.
-You may ask for a larger \fIw/e/s/n\fP region to have more room between the image and the axes.
-A smaller region than specified in the grdfile will result in a subset of the grid [Default is
-region given by the grdfile].
-.TP
-.B \-S
-\fI[color/shade]\fP
-.br
-This option enables effective histogram equalization of the
-color and/or shading of the gridded data. The equalization is
-not achieved by changing the data values, but rather by
-constructing the color or shading tables so that
-the boundaries in the tables encompass equal fractions of
-the datapoints. This serves to focus color or shading contrasts
-in value ranges corresponding to the bulk of the data values.
-If \fB\-S\fP is given alone or with \fIcolor\fP = 1,
-it enables equalization of the color table used
-for color or gray fill plots,  shaded or unshaded. If the plot
-is to be shaded,  either by synthetic illumination (\fB\-G\fP\fI2\fP)
-or using an intensity file (\fB\-K\fP and \fB\-G\fP\fI3\fP options), then
-setting \fIshade\fP = 1 will cause the shading to be equalized.
-Using \fB\-S\fP\fI0/1\fP will equalize the shading without
-equalizing the color table.
-.TP
-.B \-U
-\fIorientation\fP
-.br
-Normally the orientation of the plot (portrait or landscape)
-is selected automatically so as to maximize the plot scale.
-The \fB\-U\fP option allows the user to set the plot orientation. If
-\fIorientation\fP = 1, a portrait plot will be produced; if
-\fIorientation\fP = 2, a landscape plot will be produced.
-.TP
-.B \-W
-\fI[color_style\fP[\fI/palette\fP[\fIncolors\fP]] | cptfile]
-.br
-This option controls the color scheme used for color
-fill plots.
-
-If \fIcolor_style\fP = 1 [default], then
-the color scheme used will be a continuous grading
-of colors. If \fIcolor_style\fP = 2, the color scheme
-will be a set of discrete color intervals. The color
-palette used is set using \fIpalette\fP. Seven palettes
-are available:
- 	\fIpalette\fP = 1:	Haxby colors [default]
- 	\fIpalette\fP = 2:	high Intensity colors
- 	\fIpalette\fP = 3:	low Intensity colors
- 	\fIpalette\fP = 4:	grayscale
- 	\fIpalette\fP = 5:	uniform grayscale
- 	\fIpalette\fP = 6:	uniform black
- 	\fIpalette\fP = 7:	uniform white
-
-The RGB definitions of the color palettes are:
-
-color palette 1 \- Haxby Color Table
-  red:   255 255 255 255 240 205 138 106  50  40  37
-  green: 255 186 161 189 236 255 236 235 190 127  57
-  blue:  255 133  68  87 121 162 174 255 255 251 175
-
-color palette 2 \- High Intensity Colors
-  red:   255 255 255 255 128   0   0   0   0 128 255
-  green:   0  64 128 255 255 255 255 128   0   0   0
-  blue:    0   0   0   0   0   0 255 255 255 255 255
-
-color palette 3 \- Low Intensity Colors
-  red:   200 194 179 141  90   0   0   0   0  90 141
-  green:   0  49  90 141 179 200 141  90   0   0   0
-  blue:    0   0   0   0   0   0 141 179 200 179 141
-
-color palette 4 \- Grayscale
-  red:   255 230 204 179 153 128 102  77  51  26   0
-  green: 255 230 204 179 153 128 102  77  51  26   0
-  blue:  255 230 204 179 153 128 102  77  51  26   0
-
-color palette 5 \- Uniform Grayscale
-  red:   128 128 128 128 128 128 128 128 128 128 128
-  green: 128 128 128 128 128 128 128 128 128 128 128
-  blue:  128 128 128 128 128 128 128 128 128 128 128
-
-color palette 6 \- Uniform Black
-  red:     0   0   0   0   0   0   0   0   0   0   0
-  green:   0   0   0   0   0   0   0   0   0   0   0
-  blue:    0   0   0   0   0   0   0   0   0   0   0
-
-color palette 7 \- Uniform White
-  red:   255 255 255 255 255 255 255 255 255 255 255
-  green: 255 255 255 255 255 255 255 255 255 255 255
-  blue:  255 255 255 255 255 255 255 255 255 255 255
-
-The Haxby colors have been adapted from a palette
-developed by Dr. William Haxby of the Lamont-Doherty
-Earth Observatory; this palette is pleasing to the
-eye and well suited for shading. The high intensity
-colors describe linear paths through RGB space from
-red to blue to green to purple; because the colors are high
-intensity they are not well suited to shading.
-The low intensity colors are similar to the high
-intensity, but muted and thus well suited to shading.
-The grayscale palette runs linearly from white to
-black and is commonly used for plots of sidescan and amplitude
-data. The uniform grayscale is useful for non-color
-shaded relief plots.
-
-The \fIncolors\fP parameter sets the number of color
-values used in plotting, whether the colors are
-represented in a continuous color scale or a
-stepped, discrete color scale [default is 11].
-
-If the option argument is the path to an existing \fBGMT\fP
-color palette (CPT) file, then that CPT file and its
-color scheme will be used for the plot
-.TP
-.B \-V
-Causes \fBmbm_grd3dplot\fP to operate in "verbose" mode
-so that it outputs
-more information than usual.
-.TP
-.B \-X
-Normally, \fBmbm_grd3dplot\fP creates an executable shellscript and
-then exits.  This option will cause the shellscript to be executed
-in the background before \fBmbm_grd3dplot\fP exits.
-.TP
-.B \-Y
-Normally, \fBmbm_grd3dplot\fP generates nicely rounded numbers
-for the boundaries of the color palette. Often, the resulting
-color bounds extend well outside the range of the gridded data.
-This option causes
-the color boundaries to be uniformly distributed between the
-minimum and maximum values of the grid.
-.TP
-.B \-Z
-\fImin/max\fP
-.br
-This option overrides the minimum and maximum values of
-the gridded data, affecting the color palette and the
-contour interval if those parameters are not specified
-by the user.
-
-.SH EXAMPLES
-Suppose we have obtained two GRD files with dimensions of
-127 by 194, one containing gridded bathymetry
-(grd_sb2112_example_bath) and the other gridded sidescan
-(grd_sb2112_example_ss). In order to generate a shellscript
-which will in turn generate a 3D color shaded relief
-view of the bathymetry, we use the \fB\-G\fP\fI2\fP option.
-The grid file is in
-bathymetry (positive down) rather in topography (positive
-up), so the bathymetry needs to be rescaled by multiplying
-by \-1 (\fB\-MGS\fP\fI-1\fP). We choose an illumination magnitude of 0.4
-and an illumination azimuth of 45 degrees (\fB\-A\fP\fI0.4/45\fP). We
-also choose a perspective azimuth of 250 degrees and an
-elevation of 30 degrees (\fB\-E\fP\fI240/30\fP):
-
-  	mbm_grd3dplot \-Igrd_sb2112_example_bath \\
-  	    \-G2 \-A0.4/45 \-E250/30 \-MGS-1 \-X \-V \\
-  	    \-Osb2112_example_bath3d
-
-Now, to generate a 3D perspective view of the gridded
-bathymetry shaded using the gridded sidescan data, we
-use the \fB\-G\fP\fI3\fP and \fB\-K\fP options.
-We want the sidescan data to
-be histogram equalized, so we use \fB\-S\fP\fI0/1\fP. We also want
-the shading to be more prominent than the default
-shading magnitude of 0.2 would produce, so we use \fB\-A\fP\fI0.5\fP:
-
-  	mbm_grd3dplot \-Igrd_sb2112_example_bath \\
-  	    \-Kgrd_sb2112_example_ss \\
-  	    \-G3 \-A0.5 \-E250/30 \-D0/1 \\
-  	    \-S0/1 \-MGS-1 \-X \-V \\
-  	    \-Osb2112_example_bathss3d
-
-The first example produces and executes a plot generation
-shellscript called sb2112_example_bath3d.cmd and the second
-produces a shellscript called sb2112_example_bathss3d.cmd.
-As an example, the contents of the plotting shellscript
-"sb2112_example_bathss3d.cmd" are:
-
- #
- # Shellscript to create Postscript plot of data in grd file
- # Created by macro mbm_grd3dplot
- #
- # This shellscript created by following command line:
- # mbm_grd3dplot \-Igrd_sb2112_example_bath \\
- #      \-Kgrd_sb2112_example_ss \-G3 \-A0.5 \\
- #      \-E250/30 \-D0/1 \-S0/1 \-MGS-1 \-X \-V \\
- #      \-Osb2112_example_bathss3d
- #
- # Save existing GMT defaults
- echo Saving GMT defaults...
- gmtdefaults \-L > gmtdefaults$$
- #
- # Set new GMT defaults
- echo Setting new GMT defaults...
- gmtset ANOT_FONT Helvetica
- gmtset LABEL_FONT Helvetica
- gmtset HEADER_FONT Helvetica
- gmtset ANOT_FONT_SIZE 8
- gmtset LABEL_FONT_SIZE 8
- gmtset HEADER_FONT_SIZE 10
- gmtset FRAME_WIDTH 0.074999999999999997
- gmtset TICK_LENGTH 0.074999999999999997
- gmtset PAGE_ORIENTATION LANDSCAPE
- gmtset COLOR_BACKGROUND 0/0/0
- gmtset COLOR_FOREGROUND 255/255/255
- gmtset COLOR_NAN 255/255/255
- #
- # Make color palette table file
- echo Making color palette table file...
- echo  \-4500  37  57 175  \-4350  40 127 251 > \\
- 	sb2112_example_bathss3d.cpt
- echo  \-4350  40 127 251  \-4200  50 190 255 >> \\
- 	sb2112_example_bathss3d.cpt
- echo  \-4200  50 190 255  \-4050 106 235 255 >> \\
- 	sb2112_example_bathss3d.cpt
- echo  \-4050 106 235 255  \-3900 138 236 174 >> \\
- 	sb2112_example_bathss3d.cpt
- echo  \-3900 138 236 174  \-3750 205 255 162 >> \\
- 	sb2112_example_bathss3d.cpt
- echo  \-3750 205 255 162  \-3600 240 236 121 >> \\
- 	sb2112_example_bathss3d.cpt
- echo  \-3600 240 236 121  \-3450 255 189  87 >> \\
- 	sb2112_example_bathss3d.cpt
- echo  \-3450 255 189  87  \-3300 255 161  68 >> \\
- 	sb2112_example_bathss3d.cpt
- echo  \-3300 255 161  68  \-3150 255 186 133 >> \\
- 	sb2112_example_bathss3d.cpt
- echo  \-3150 255 186 133  \-3000 255 255 255 >> \\
- 	sb2112_example_bathss3d.cpt
- #
- # Rescale data
- echo Rescaling data by \-1...
- echo Running grdmath...
- grdmath grd_sb2112_example_bath \-1 x = \\
- 	grd_sb2112_example_bath.scale
- #
- # Get shading array
- echo Getting shading array...
- echo Running grdhisteq...
- grdhisteq grd_sb2112_example_ss \\
- 	-Ggrd_sb2112_example_ss.eq \-N
- echo Running grdmath...
- grdmath grd_sb2112_example_ss.eq \-0.5 x \\
- 	= grd_sb2112_example_ss.int
- rm \-f grd_sb2112_example_ss.eq
- #
- # Make 3D view
- echo Running grdview...
- grdview grd_sb2112_example_bath.scale \\
- 	-Jm13.678801784792578 \\
- 	-Jz0.0014760910157720331 \\
- 	-E250/30 \\
- 	-R114.221/114.421/-31.9001/-31.6377 \\
- 	-Csb2112_example_bathss3d.cpt \\
- 	-N-4499.4399999999996/200/200/200 \\
- 	-Igrd_sb2112_example_ss.int \\
- 	-Qi \\
- 	-P \-X1.8081565710006675 \-Y2 \-K \-V \\
- 	> sb2112_example_bathss3d.ps
- #
- # Make color scale
- echo Running psscale...
- psscale \-Csb2112_example_bathss3d.cpt \\
- 	-D2.4418/-0.5000/4.8837/0.1500h \\
-  	-B":.Data Values:" \\
- 	-P \-K \-O \-V >> sb2112_example_bathss3d.ps
- #
- # Make basemap
- echo Running psbasemap...
- psbasemap \-Jm13.678801784792578 \\
- 	-Jz0.0014760910157720331 \\
- 	-E250/30 \\
- 	-R114.221/114.421/-31.9001/-31.6377 \\
- 	-B5m/5m:."Data File grd_sb2112_example_bath":WSZ \\
- 	-P \-O \-V >> sb2112_example_bathss3d.ps
- #
- # Delete surplus files
- echo Deleting surplus files...
- rm \-f sb2112_example_bathss3d.cpt
- rm \-f grd_sb2112_example_bath.scale
- #
- # Reset GMT default fonts
- echo Resetting GMT fonts...
- mv gmtdefaults$$ .gmtdefaults
- #
- # Run xpsview
- echo Running xpsview in background...
- xpsview \-ps a \-maxp 4m sb2112_example_bathss3d.ps &
- #
- # All done!
- echo All done!
-
-.SH SEE ALSO
-\fBgrdimage\fP(1), \fBgrdcontour\fP(1),
-\fBmbdefaults\fP(1), \fBmbgrid\fP(1), \fBmbsystem\fP(1),
-\fBmbm_grd3dplot\fP(1), \fBmbm_plot\fP(1),
-\fBpsbasemap\fP(1), \fBpstext\fP(1), \fBpsxy\fP(1)
-
-.SH BUGS
-By making this macro more useful, we have also made it
-more complex.
diff --git a/src/man/man1/mbm_grdcut.1 b/src/man/man1/mbm_grdcut.1
deleted file mode 100644
index f4e0a35..0000000
--- a/src/man/man1/mbm_grdcut.1
+++ /dev/null
@@ -1,106 +0,0 @@
-.TH mbm_grdcut 1 "9 November 2014" "MB-System 5.0" "MB-System 5.0"
-.SH NAME
-\fBmbm_grdcut\fP \- Macro to extract a specified subarea of a
-GMT GRD grid file as another GRD file.
-
-.SH VERSION
-Version 5.0
-
-.SH SYNOPSIS
-mbm_grdcut \fB\-I\fP\fIinfile\fP \fB\-O\fP\fIoutfile\fP \fB\-R\fP\fIw/e/s/n\fP [\fB\-H\fP \fB\-V\fP]
-
-.SH DESCRIPTION
-\fBmbm_grdcut\fP is a macro to painlessly cut out a region from a
-GMT GRD grid file.
-The GMT program grdcut requires that one specify bounds which
-exactly match grid cell boundaries. Frequently, one just wants
-to extract an approximate region quickly, without calculating
-grid cell sizes and boundary locations. This macro does the
-the calculations and extracts the subregion closest to that
-specified by the user.
-
-.SH AUTHORSHIP
-David W. Caress (caress at mbari.org)
-.br
-  Monterey Bay Aquarium Research Institute
-.br
-Dale N. Chayes (dale at ldeo.columbia.edu)
-.br
-  Lamont-Doherty Earth Observatory
-
-.SH OPTIONS
-.TP
-.B \-H
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-.TP
-.B \-I
-\fIinfile\fP
-.br
-Sets the filename of the input GMT grid file. This file must be
-in the GMT NetCDF GRD format.
-.TP
-.B \-O
-\fIoutfile\fP
-.br
-Sets the filename of the output GMT grid file. This file will be
-in the GMT NetCDF GRD format.
-.TP
-.B \-R
-\fIw/e/s/n\fP
-.br
-Sets the bounds of the area to be extracted from the input grid file.
-.TP
-.B \-V
-The \fB\-V\fP option causes \fBmbm_grdcut\fP to print out status messages.
-
-.SH EXAMPLES
-Suppose that we have used \fBmbgrid\fP to obtain a
-topography grid file called KohalaA_bath.grd in the GMT NetCDF
-GRD format:
-    mbgrid \-Idatalist \\
-        \-OKohalaA_bath \\
-        \-R-155.72855/-155.31928/20.09488/20.47645 \\
-        \-E30.0/0m! \-A2 \-N \-G3 \-C1 \-V
-.br
-Further suppose that one wishes to extract a smaller grid with
-bounds of 155 degrees 31 minutes W to 155 degrees 26 minutes W
-in longitude and 20 degrees 13 minutes N to 20 degrees 18 minutes N
-in latitude. This can be done using the \fBGMT\fP program
-\fBgrdcut\fP, but \fBgrdcut\fP requires that the user specify
-bounds that exactly match the grid cell boundaries in the file.
-The \fBmbm_grdcut\fP macros allows one to specify approximate
-desired bounds, calculates the exact, nearest bounds
-that \fBgrdcut\fP will accept, and then executes \fBgrdcut\fP.
-
-To obtain the desired sub-grid, the following will suffice:
-    mbm_grdcut \-I KohalaA_bath.grd \
-        \-O Kohala_plunge.grd \
-        \-R-155:31/-155:26/20:13/20:18 \
-        \-V
-.br
-The resulting output is:
-.br
-    Program mbm_grdcut status:
-        Input GRD file:         KohalaA_bath.grd
-        Output GRD file:        Kohala_plunge.grd
-        Input Grid bounds:      \-155.72855 \-155.3192906  20.09488 20.47628103
-        Input grid dimensions:  1426  1329
-        Grid cell sizes:        0.0002871995719  0.0002871995719
-        Requested Grid bounds:  \-155.516667 \-155.433333  20.216667 20.3
-        Output Grid bounds:     \-155.516884 \-155.433596  20.216653 20.299940
-        Output grid dimensions: 291  291
-
-    Running grdcut...
-    grdcut KohalaA_bath.grd \-GKohala_plunge.grd \-R-155.516884/-155.433596/20.216653/20.299940 \-V
-    grdcut: File spec:    W E S N dx dy nx ny:
-    grdcut: Old: \-155.729 \-155.319 20.0949 20.4763 0.0002872 0.0002872 1426 1329
-    grdcut: New: \-155.517 \-155.434 20.2167 20.2999 0.0002872 0.0002872  291  291
-
-
-.SH SEE ALSO
-\fBmbsystem\fP(1), \fBmbgrid\fP(1),
-\fBmbmosaic\fP(1), \fBmbm_grid\fP(1), \fBmbm_grdplot\fP(1)
-
-.SH BUGS
-Probably.
diff --git a/src/man/man1/mbm_grdinfo.1 b/src/man/man1/mbm_grdinfo.1
deleted file mode 100644
index 11e4a6d..0000000
--- a/src/man/man1/mbm_grdinfo.1
+++ /dev/null
@@ -1,77 +0,0 @@
-.TH mbm_grdinfo 1 "3 June 2013" "MB-System 5.0" "MB-System 5.0"
-.SH NAME
-\fBmbm_grdinfo\fP \- Macro to get information regarding a GMT grd file when the
-region of interest is a subset of the area covered in the
-input file.
-
-.SH VERSION
-Version 5.0
-
-.SH SYNOPSIS
-mbm_grdinfo \fB\-I\fP\fIinfile\fP [\fB\-R\fP\fIw/e/s/n\fP \fB\-H\fP \fB\-V\fP]
-
-.SH DESCRIPTION
-\fBmbm_grdinfo\fP is a macro to get information
-regarding a GMT grd file when the
-region of interest is a subset of the area covered in the
-input file. If no bounds are specified, the program grdinfo
-is called directly.  If longitude and latitude bounds are
-specified, then the specified region is cut from the input
-file using the macro mbm_grdinfo, and the information is
-obtained from the subset temporary grd file using grdinfo.
-
-.SH AUTHORSHIP
-David W. Caress (caress at mbari.org)
-.br
-  Monterey Bay Aquarium Research Institute
-.br
-Dale N. Chayes (dale at ldeo.columbia.edu)
-.br
-  Lamont-Doherty Earth Observatory
-
-.SH OPTIONS
-.TP
-.B \-H
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-.TP
-.B \-I
-\fIinfile\fP
-.br
-Sets the filename of the input GMT grid file. This file must be
-in the GMT NetCDF GRD format.
-.TP
-.B \-R
-\fIw/e/s/n\fP
-.br
-Sets the bounds of the area of interest in the grid file. The
-information reported will pertain to this area only.
-.TP
-.B \-V
-The \fB\-V\fP option causes \fBmbm_grdinfo\fP to print out status messages.
-
-.SH EXAMPLES
-Suppose that we have used \fBmbgrid\fP to obtain a
-topography grid file called KohalaA_bath.grd in the GMT NetCDF
-GRD format:
- 	mbgrid \-Idatalist \\
- 		-OKohalaA_bath \\
- 		-R-155.72855/-155.31928/20.09488/20.47645 \\
- 		-E30.0/0m! \-A2 \-N \-G3 \-C1 \-V
-.br
-Further suppose that one wishes to determine the
-depth range in a smaller area with
-bounds of 155 degrees 31 minutes W to 155 degrees 26 minutes W
-in longitude and 20 degrees 13 minutes N to 20 degrees 18 minutes N
-in latitude. The following will suffice:
- 	mbm_grdinfo \-I KohalaA_bath.grd \
- 		-R-155:31/-155:26/20:13/20:18 \
-		-V
-
-.SH SEE ALSO
-\fBmbsystem\fP(1), \fBmbm_grdplot\fP(1), \fBmbm_grdinfo\fP(1)
-
-.SH BUGS
-This macro is new and hasn't been tested in serious
-usage yet \- let us know what to fix, add, or
-change!.
diff --git a/src/man/man1/mbm_grdplot.1 b/src/man/man1/mbm_grdplot.1
deleted file mode 100644
index d2ab93e..0000000
--- a/src/man/man1/mbm_grdplot.1
+++ /dev/null
@@ -1,1375 +0,0 @@
-.TH mbm_grdplot 1 "9 January 2015" "MB-System 5.0" "MB-System 5.0"
-.SH NAME
-\fBmbm_grdplot\fP \- Create an executable shellscript which will generate
-a GMT map of gridded data in a GMT grd file.
-
-.SH VERSION
-Version 5.0
-
-.SH SYNOPSIS
-\fBmbm_grdplot\fP \fB\-I\fP\fIfile\fP
-[\fB\-A\fP[\fImagnitude\fP[\fI/azimuth/elevation\fP]
-\fB\-C\fP[\fIcontour_control\fP]
-\fB\-D\fP[\fIflipcolor/flipshade\fP]
-\fB\-G\fP\fIcolor_mode\fP \fB\-H\fP
-\fB\-K\fP\fIintensity_file\fP
-\fB\-O\fP\fIroot\fP \fB\-P\fP\fIpagesize\fP
-\fB\-S\fP\fI[color/shade]\fP \fB\-T\fP
-\fB\-U\fP\fIorientation\fP \fB\-V\fP
-\fB\-W\fP\fI[color_style\fP[\fI/palette\fP[\fIncolors\fP]] | \fIcptfile]\fP ]
-
-Additional Options:
-.br
-[\fB\-B\fP\fItickinfo\fP \fP
-\fB\-F\fP\fIcontour_file\fP
-\fB\-J\fP\fIprojection\fP[\fI/scale | width\fP]
-\fB\-L\fP\fItitle\fP[\fI:scale_label\fP] \fB\-M\fP\fImisc\fP
-\fB\-Q\fP \fB\-R\fP\fIw/e/s/n\fP \fB\-X\fP \fB\-Y\fP
-\fB\-Z\fP\fImin/max[/mode]\fP ]
-
-Miscellaneous Options:
-.br
-[\fB\-MGD\fP\fIgmtdef/value\fP  \fB\-MGF\fP\fIscale_loc\fP
-\fB\-MGL\fP[\fIf\fP][\fIx\fP]\fIlon0/lat0/slat/length\fP[\fIunits\fP][\fI+llabel\fP]
-\fB\-MGQ\fP\fIdpi\fP \fB\-MGS\fP\fIscalefactor\fP
-\fB\-MGT\fP\fIx/y/size/angle/font/just/text\fP
-\fB\-MGU\fP\fP[\fI/dx/dy/\fP][\fIlabel\fP]
-\fB\-MCA\fP\fIanot_int/\fP[\fIffont_size\fP][\fIaangle\fP][\fI/r/g/b\fP][\fIo\fP]]
-\fB\-MCG\fP\fIgap/width\fP \fB\-MCQ\fP\fIcut \fP
-\fB\-MCT\fP[\fI+|-\fP][\fIgap/length\fP][\fI:LH\fP] \fB\-MCW\fP\fItype\fP[\fIpen\fP]
-\fB\-MNA\fP\fI[nhgt[/P] | P]\fP
-\fB\-MNF\fP\fIformat\fP \fB\-MNI\fP\fIswathdata\fP
-\fB\-MNN\fP[\fIttick/tannot/dannot/tlen\fP[\fI/nhgt\fP] | \fIF\fP | \fIFP\fP]
-\fB\-MNP\fP[\fIpingnumber_tick/pingnumber_annot/pingnumber_tick_len\fP]
-\fB\-MTC\fP\fIfill\fP \fB\-MTD\fP\fIresolution\fP
-\fB\-MTG\fP\fIfill\fP \fB\-MTI\fP\fIriver[/pen]\fP
-\fB\-MTN\fP\fIborder[/pen]\fP \fB\-MTS\fP\fIfill\fP
-\fB\-MTW\fP\fIpen\fP
-\fB\-MXG\fP\fIfill\fP \fB\-MXI\fP\fIxy_file \fP
-\fB\-MXM\fP
-\fB\-MXS\fP\fIsymbol/size\fP \fB\-MXW\fP\fIpen\fP]
-
-.SH DESCRIPTION
-\fBmbm_grdplot\fP is a macro that generates a
-shellscript of \fBGMT\fP commands which,
-when executed, will generate a Postscript plot of gridded
-data.  Several styles of plots can be generated, including
-color fill maps, contour maps, color fill maps overlaid with
-contours, shaded relief color maps, slope magnitude maps,
-coastline maps, text labels, and xy data
-in lines or symbols. Five different color schemes are included.
-The plot will be scaled to fit on the specified page size
-or, if the scale is user defined, the page size will be
-chosen in accordance with the plot size. The primary purpose
-of this macro is to allow the simple, semi-automated
-production of nice looking maps with a few command line
-arguments. For users seeking more control over the plot
-appearance, a number of additional optional arguments are
-provided. Truly ambitious users may edit the plot shellscript
-to take advantage of \fBGMT\fP capabilities not supported by this
-macro. A companion macro \fBmbm_grd3dplot\fP can be used
-similarly to generate 3D perspective views of gridded data.
-
-By default the output plot generation shellscript
-includes lines which execute a program to display the Postscript
-image on the screen. The program to be used to display the Postscript
-is set using \fBmbdefaults\fP; the default value can be overridden
-by setting the environment variable $MB_PS_VIEWER.
-Invoking the plot generation shellscript with
-a \fB-N\fP command line argument suppresses the screen
-display of the plot.
-
-The plot scripts generated by this macro will work with
-GMT version 5.0 and later, and are not compatible with
-earlier versions of GMT.
-
-.SH AUTHORSHIP
-David W. Caress (caress at mbari.org)
-.br
-  Monterey Bay Aquarium Research Institute
-.br
-Dale N. Chayes (dale at ldeo.columbia.edu)
-.br
-  Lamont-Doherty Earth Observatory
-
-.SH SIMPLE DESCRIPTION OF BASIC OPTIONS
-.TP
-.B \-A
-\fImagnitude[/azimuth/elevation]\fP
-.br
-Sets the parameters which control the
-synthetic illumination of the gridded data (shaded relief).
-The value \fImagnitude\fP
-is an effective vertical exageration which modulates the intensity of
-the shading; typical values are in the 0.1 to 10 range.
-The value \fIazimuth\fP
-is the azimuth in degrees from north from which the data is illuminated.
-The value \fIelevation\fP is the elevation of the illumination
-in degrees from horizontal.
-Defaults: \fImagnitude\fP = 0.2; \fIazimuth\fP = 0.0;
-\fIelevation\fP = 30.0;
-.TP
-.B \-C
-\fIcontour_control\fP
-.br
-If \fB\-C\fP is given alone, it causes unannotated contours
-to be drawn using a contour interval calculated from the
-data. The user may also use \fIcontour_control\fP
-to specify the contour interval. See the COMPLETE DESCRIPTION OF OPTIONS
-section below for a more complete discussion.
-.TP
-.B \-D
-\fI[flipcolor/flipshade]\fP
-.br
-Normally, the color or grayscale tables used for color maps run from
-cool colors (or dark grays) for low grid values
-to hot colors (or light grays) for high grid values.
-This option reverses the color table so that cool colors (dark grays)
-correspond to high values and hot colors (light grays) to low values.
-If \fB\-D\fP is given alone, it applies to the color table used
-for color or gray fill plots,  shaded or unshaded. If the plot
-is to be shaded,  either by synthetic illumination (\fB\-G\fP\fI2\fP)
-or using an intensity file (\fB\-K\fP and \fB\-G\fP\fI3\fP options), then
-setting \fIflipshade\fP = 1 will cause the shading convention
-to be reversed (e.g. high intensities overlaid as light shading).
-Using \fB\-D\fP\fI0/1\fP will flip the shading convention
-but leave the default color convention.
-.TP
-.B \-G
-\fIcolor_mode\fP
-.br
-Turns on color fill plot and sets the style of the plot.
-.br
-        \fIcolor_mode\fP = 1: Color/gray fill.
-        \fIcolor_mode\fP = 2: Color/gray fill shaded by
-                        synthetic illumination.
-        \fIcolor_mode\fP = 3: Color/gray fill shaded by
-                        an intensity file. The \fB\-K\fP
-                        option must be used to specify
- 			the intensity file.
-        \fIcolor_mode\fP = 4: Color/gray fill of slope
- 			magnitude.
-        \fIcolor_mode\fP = 5: Color/gray fill shaded by
-                        slope magnitude.
-.TP
-.B \-H
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-.TP
-.B \-I
-\fIgrdfile\fP
-.br
-Sets the name of the gridded data file to be plotted.
-Alternatively, \fIgrdfile\fP may be a list of grid files
-(one filename on each line) to be plotted together.
-.TP
-.B \-K
-\fIintensity_file\fP
-.br
-Sets the name of the gridded data file containing
-intensity values to be used for shading the map.
-Alternatively, \fIgrdfile\fP may be a list of grid files
-(one filename on each line) to be used together. If a
-list of file is supplied, the intensity files must
-conform in order to the data grid files they will shade.
-.TP
-.B \-O
-\fIroot\fP
-.br
-Sets the root used to construct the filename of the output shellscript
-(\fIroot\fP.cmd) and names of files created when the shellscript is
-run.  Normally the
-name of the input grid file or grid file list is
-used as the \fIroot\fP.
-.TP
-.B \-P
-\fIpagesize\fP
-.br
-This option sets the size of the page the plot will be centered
-on. If the user does not set the plot scale, the plot will be
-sized as large as will fit on the designated page. If the user
-sets the plot scale such that the plot will not fit on the
-designated page, a larger page will be used.
-The supported page sizes include ANSI A, B, C, D, E,
-F, and E1, as well as most metric page sizes. See the
-COMPLETE DESCRIPTION OF OPTIONS section
-below for a complete list of
-the supported page sizes. The default page size is A.
-.TP
-.B \-S
-\fI[color/shade]\fP
-.br
-This option enables effective histogram equalization of the
-color and/or shading of the gridded data. The equalization is
-not achieved by changing the data values, but rather by
-constructing the color or shading tables so that
-the boundaries in the tables encompass equal fractions of
-the datapoints. This serves to focus color or shading contrasts
-in value ranges corresponding to the bulk of the data values.
-If \fB\-S\fP is given alone or with \fIcolor\fP = 1,
-it enables equalization of the color table used
-for color or gray fill plots,  shaded or unshaded. If the plot
-is to be shaded,  either by synthetic illumination (\fB\-G\fP\fI2\fP)
-or using an intensity file (\fB\-K\fP and \fB\-G\fP\fI3\fP options), then
-setting \fIshade\fP = 1 will cause the shading to be equalized.
-Using \fB\-S\fP\fI0/1\fP will equalize the shading without
-equalizing the color table.
-.TP
-.B \-T
-If \fB\-T\fP is given, it causes a coastline to be drawn
-on the map. The default is to draw the coastline as the thinnest possible
-line. To exercise greater control of
-the coastline plotting, including color fill of "dry" areas and
-display of lakes, rivers, and political boundaries, use the
-\fB\-MTC\fP, \fB\-MTD\fP, \fB\-MTG\fP, \fB\-MTI\fP,
-\fB\-MTN\fP, \fB\-MTS\fP, and \fB\-MTW\fP options described in the
-COMPLETE DESCRIPTION OF OPTIONS section below.
-.TP
-.B \-U
-\fIorientation\fP
-.br
-Normally the orientation of the plot (portrait or landscape)
-is selected automatically so as to maximize the plot scale.
-The \fB\-U\fP option allows the user to set the plot orientation. If
-\fIorientation\fP = 1, a portrait plot will be produced; if
-\fIorientation\fP = 2, a landscape plot will be produced.
-.TP
-.B \-V
-Causes \fBmbm_grdplot\fP to operate in "verbose" mode
-so that it outputs
-more information than usual.
-.TP
-.B \-W
-\fI[color_style\fP[\fI/palette\fP[\fIncolors\fP]] | cptfile]
-.br
-This option controls the color scheme used for color
-fill plots.
-
-If \fIcolor_style\fP = 1 [default], then
-the color scheme used will be a continuous grading
-of colors. If \fIcolor_style\fP = 2, the color scheme
-will be a set of discrete color intervals. The color
-palette used is set using \fIpalette\fP. Five palettes
-are available:
- 	\fIpalette\fP = 1:	Haxby colors [default]
- 	\fIpalette\fP = 2:	high Intensity colors
- 	\fIpalette\fP = 3:	low Intensity colors
- 	\fIpalette\fP = 4:	grayscale
- 	\fIpalette\fP = 5:	uniform grayscale
-.br
-A complete description of the color palettes is given
-in the COMPLETE DESCRIPTION OF OPTIONS section below.
-
-The \fIncolors\fP parameter sets the number of color
-values used in plotting, whether the colors are
-represented in a continuous color scale or a
-stepped, discrete color scale [default is 11].
-
-If the option argument is the path to an existing \fBGMT\fP
-color palette (CPT) file, then that CPT file and its
-color scheme will be used for the plot
-
-.SH COMPLETE DESCRIPTION OF OPTIONS
-.TP
-.B \-A
-\fImagnitude[/azimuth]\fP
-.br
-Sets the parameters which control the
-synthetic illumination of the gridded data (shaded relief).
-The value \fImagnitude\fP
-is an effective vertical exageration which modulates the intensity of
-the shading; typical values are in the 0.1 to 0.5 range.
-The value \fIazimuth\fP
-is the azimuth from which the data is illuminated.
-Defaults: \fImagnitude\fP = 0.2; \fIazimuth\fP = 0.0;
-.TP
-.B \-B
-\fItickinfo\fP
-.br
-Sets map boundary tickmark intervals. See the \fBpsbasemap\fP
-manual page for details. By default the program chooses
-basemap annotations based on the map boundaries.
-.TP
-.B \-C
-\fIcontour_control\fP
-.br
-If \fB\-C\fP is given alone, it causes unannotated contours
-to be drawn using a contour interval calculated from the
-data. If \fIcontour_control\fP is given, it specifies
-the contours to be drawn in one of
-three possible ways:
-
-If \fIcontour_control\fP has the suffix ".cpt" and
-can be opened as a file, it is assumed
-to be a color palette table.  The color boundaries
-are then used as contour levels.
-If the cpt-file has anotation flags in the last
-column then those contours will be
-anotated.  By default no contours are labeled; use
-\fB\-MCA\fP to anotate all contours.
-
-If \fIcontour_control\fP is a file but not a
-cpt-file, it is expected to contain contour levels
-in column 1 and a C(ontour) OR A(nnotate) in col 2.
-The levels marked C (or c) are contoured,
-the levels marked A (or a) are contoured and
-annotated.  Optionally, a third column may be
-present and contain the fixed anotation angle for
-this contour level.
-
-If no file is found, then \fIcontour_control\fP is
-interpreted as a constant contour interval.
-
-If a file is given and \fB\-MCT\fP is set,
-then only contours marked with upper case
-C or A will have tickmarks.
-.TP
-.B \-D
-\fI[flipcolor/flipshade]\fP
-.br
-Normally, the color or grayscale tables used for color maps run from
-cool colors (or dark grays) for low grid values
-to hot colors (or light grays) for high grid values.
-This option reverses the color table so that cool colors (dark grays)
-correspond to high values and hot colors (light grays) to low values.
-If \fB\-D\fP is given alone, it applies to the color table used
-for color or gray fill plots,  shaded or unshaded. If the plot
-is to be shaded,  either by synthetic illumination (\fB\-G\fP\fI2\fP)
-or using an intensity file (\fB\-K\fP and \fB\-G\fP\fI3\fP options), then
-setting \fIflipshade\fP = 1 will cause the shading convention
-to be reversed (e.g. high intensities overlaid as light shading).
-Using \fB\-D\fP\fI0/1\fP will flip the shading convention
-but leave the default color convention.
-.TP
-.B \-F
-\fIcontour_file\fP
-.br
-Sets the name of the file to use for generating contour lines.
-The default is to use the file being plotted, but in some situations,
-it can be useful to specify a separate file for contouring. For example,
-one might wish to overlay a backscatter mosaic with bathymetry contours,
-or a shaded bathymetry map with gravity anomaly contours.
-.TP
-.B \-G
-\fIcolor_mode\fP
-.br
-Turns on color fill plot and sets the style of the plot.
-.br
-        \fIcolor_mode\fP = 1: Color/gray fill.
-        \fIcolor_mode\fP = 2: Color/gray fill shaded by
-                        synthetic illumination.
-        \fIcolor_mode\fP = 3: Color/gray fill shaded by
-                        an intensity file. The \fB\-K\fP
-                        option must be used to specify
- 			the intensity file.
-        \fIcolor_mode\fP = 4: Color/gray fill of slope
- 			magnitude.
-        \fIcolor_mode\fP = 5: Color/gray fill shaded by
-                        slope magnitude.
-.br
-See the \fBgrdimage\fP manual page for information on shading
-with intensity files
-.TP
-.B \-H
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-.TP
-.B \-I
-\fIgrdfile\fP
-.br
-Sets the name of the gridded data file to be plotted.
-The data must be in a form acceptable to \fBGMT\fP version 3
-programs (see the \fBGMT\fP Cookbook & Technical Reference).
-Alternatively, \fIgrdfile\fP may be a list of grid files
-(one filename on each line) to be plotted together. This
-is useful when data from a region is broken up into several
-grid files rather than a single very large grid file.
-.TP
-.B \-J
-\fIprojection\fP[\fI/scale | /width\fP]
-.br
-Selects the map projection. By default the map projection is
-Mercator and the plot scale is chosen to fit on the selected
-page size (see \fB\-P\fP option). The user may specify a
-different projection to be used, in which case the plot scale
-is still automatically chosen to fit the page. The user may
-also specify both the projection and the plot scale. If
-the projection specifying character is upper case, a plot
-width rather than a plot scale is used.
-The scale values are specified in inch/degree or in 1:xxxxx
-ratios. Plot widths are specified in inches. If the user
-specifies a plot scale such that the plot will not fit
-on the default A size page, a appropriately larger page
-size will be chosen.
-.br
-.sp
-\fBCYLINDRICAL PROJECTIONS:\fP
-.br
-.sp
-\fB\-Jc\fP\fIlon0/lat0/scale\fP (Cassini)
-.br
-\fB\-Jm\fP\fIscale\fP (Mercator)
-.br
-\fB\-Joa\fP\fIlon0/lat0/azimuth/scale\fP (Oblique Mercator \- point and azimuth)
-.br
-\fB\-Job\fP\fIlon0/lat0/lon1/lat1/scale\fP (Oblique Mercator \- two points)
-.br
-\fB\-Joc\fP\fIlon0/lat0/lonp/latp/scale\fP (Oblique Mercator \- point and pole)
-.br
-\fB\-Jq\fP\fIlon0/scale\fP (Equidistant Cylindrical Projection (Plate Carree))
-.br
-\fB\-Jt\fP\fIlon0/scale\fP (TM \- Transverse Mercator)
-.br
-\fB\-Ju\fP\fIzone/scale\fP (UTM \- Universal Transverse Mercator)
-.br
-\fB\-Jy\fP\fIlon0/lats/scale\fP (Basic Cylindrical Projection)
-.br
-.sp
-\fBAZIMUTHAL PROJECTIONS:\fP
-.br
-.sp
-\fB\-Ja\fP\fIlon0/lat0/scale\fP (Lambert).
-.br
-\fB\-Je\fP\fIlon0/lat0/scale\fP (Equidistant).
-.br
-\fB\-Jg\fP\fIlon0/lat0/scale\fP (Orthographic).
-.br
-\fB\-Js\fP\fIlon0/lat0/scale\fP (General Stereographic)
-.br
-.sp
-\fBCONIC PROJECTIONS:\fP
-.br
-.sp
-\fB\-Jb\fP\fIlon0/lat0/lat1/lat2/scale\fP (Albers)
-.br
-\fB\-Jl\fP\fIlon0/lat0/lat1/lat2/scale\fP (Lambert)
-.br
-.sp
-\fBMISCELLANEOUS PROJECTIONS:\fP
-.br
-.sp
-\fB\-Jh\fP\fIlon0/scale\fP (Hammer)
-.br
-\fB\-Ji\fP\fIlon0/scale\fP (Sinusoidal)
-.br
-\fB\-Jk\fP\fIlon0/scale\fP (Eckert VI)
-.br
-\fB\-Jn\fP\fIlon0/scale\fP (Robinson)
-.br
-\fB\-Jr\fP\fIlon0/scale\fP (Winkel Tripel)
-.br
-\fB\-Jw\fP\fIlon0/scale\fP (Mollweide)
-.br
-.sp
-\fBNON-GEOGRAPHICAL PROJECTIONS:\fP
-.br
-.sp
-\fB\-Jp\fP\fIscale\fP (Linear projection for polar (theta,r) coordinates)
-.br
-\fB\-Jx\fP\fIx-scale\fP[\fBl|p\fP\fIpow\fP][\fI/y-scale\fP[\fBl|p\fP\fIpow\fP]] (Linear, log, and power scaling)
-.br
-More details can be found in the \fBpsbasemap\fP manpages.
-.TP
-.B \-K
-\fIintensity_file\fP
-.br
-Sets the name of the gridded data file containing
-intensity values to be used for shading the map.
-Alternatively, \fIgrdfile\fP may be a list of grid files
-(one filename on each line) to be used together. If a
-list of files is supplied, the intensity files must
-conform in order to the list of data grid files they will shade.
-.TP
-.B \-L
-\fItitle:scalelabel\fP
-.br
-Sets the title and the label for the colorscale (if used) of
-the plot. Note that a colon (:) rather than a slash (/) is
-used to separate the labels. Colons cannot be used in the
-labels themselves. If this option is not used, then a default title
-and colorscale label are provided. If the title is supplied
-alone, a default colorscale label will be provided. To force
-no title use \fB\-L\fP" "; to force no title or colorscale
-label use \fB\-L\fP" : ".
-.TP
-.B \-M
-A series of "miscellaneous" options are provided which are
-given as \fB\-M\fP followed by a two character identifier, followed
-by any other parameters associated with that option.
-The \fB\-M\fP options may be strung together separated by
-colons, e.g. "-MGQ100:GU:CA200/10", which is equivalent to
-"-MGQ \-MGU \-MCA200/10".
-.TP
-.B \-MGD
-\fIgmtdef/value\fP
-.br
-Allows the user to set the \fBGMT\fP default values used as
-the plot is constructed. This command may be given repeatedly
-to set as many \fBGMT\fP defaults as required. For example, to
-set the basemap annotation font to Courier, use
-"-MGDANOT_FONT/Courier".
-.TP
-.B \-MGF
-\fIscale_loc\fP
-.br
-Sets the location of the color scale. The possible values
-of \fIscale_loc\fP are:
- 	\fIscale_loc\fP = b:	bottom of plot
- 	\fIscale_loc\fP = t:	top of plot
- 	\fIscale_loc\fP = l:	left of plot
- 	\fIscale_loc\fP = r:	right of plot
-.br
-[Default \fIscale_loc\fP = b]
-.TP
-.B \-MGL
-[\fIf\fP][\fIx\fP]\fIlon0/lat0/slat/length\fP[\fIunits\fP][\fI+llabel\fP]
-.br
-Draws a simple map scale centered on \fIlon0/lat0\fP.
-Use \fB\-Lf\fP to get a "fancy" scale [Default is plain].
-Use \fB\-Lx\fP to specify the position in inches instead of map units.
-The scale is calculated at latitude \fIslat\fP; if the string "center" is used
-instead of a numerical value for \fIslat\fP, then the macro will set
-the scaling according to the center of the plot bounds.
-The scale length value \fIlength\fP is in km 
-by default, but the units can be specified as one of e|f|k|M|n|u, where
-e = meters, f = feet, k = kilometers, M = statue miles, n = nautical miles,
-and u = US survey feet. Append \fI+l\fP to label the scale with the
-relevant units, or append \fI+l"label"\fP to set a different label string.
-.TP
-.B \-MGQ
-\fIdpi\fP
-.br
-Sets the resolution in dots per inch of the raster image used
-for color fill maps. Larger values of \fIdpi\fP produce larger
-Postscript plot files. [Default is 100].
-.TP
-.B \-MGS
-\fIscalefactor\fP
-.br
-The gridded data is multiplied by \fIscalefactor\fP.
-This option is most often used flip the sign of the
-data (\fIscalefactor\fP = \-1). [Default no scaling]
-.TP
-.B \-MGT
-\fIx/y/size/angle/font/just/text\fP
-.br
-Causes a text label to plotted on the map.
-\fIsize\fP is text size in points, \fIangle\fP is
-measured in degrees counter-clockwise from horizontal,
-\fIfontno\fP sets the font type, \fIjustify\fP sets the alignment.
-If \fIfontno\fP starts with a leading hyphen, then
-the remainder of \fIfontno\fP is taken to be a
-textstring with the desired fontname.  See the
-\fBgmtdefaults\fP man page for names and numbers of available fonts
-(or run \fBpstext \-L\fP).  The alignment
-number refers to the part of the textstring that will be mapped
-onto the (\fIx,y\fP) point: 1 = Lower Left corner,
-2 = Lower Center, 3 = Lower Right, 5 = Mid Left, 6 = Mid Center,
-7 = Mid Right, 9 = Upper Left, 10 = Upper Center,
-11 = Upper Right. This option may be given as many times as
-needed.
-.TP
-.B \-MGU
-[\fI/dx/dy/\fP][\fIlabel\fP]
-.br
-Draw Unix System time stamp on plot.  User may specify where the lower left corner
-of the stamp should fall on the page relative to lower left corner of plot in inch [Default is (-0.75,-0.75)].  Optionally,
-append a label, or \fBc\fP (which will plot the command string.)
-.TP
-.B \-MCA
-\fIanot_int/\fP[\fIffont_size\fP][\fIaangle\fP][\fI/r/g/b\fP][\fIo\fP]]
-.br
-\fIanot_int\fP is annotation interval in data units.
-Ignored if contour levels are given in a file.
-[Default is no annotations].  Several options
-can be set to modify the form of the annotation.
-Append f\fIfont_size\fP to change font size [9],
-append \fI/r/g/b\fP to change color of text fill box
-[PAGE_COLOR], append a\fIangle\fP to fix
-annotation angle [Default follows contour],
-and append 'o' to draw the outline of the
-surrounding text box [Default is no outline].
-.TP
-.B \-MCG
-\fIgap/width\fP \fB\-MCQ\fP\fIcut \fP
-.br
-\fIgap\fP is distance in inch between each
-annotation along the same contour.
-\fIwidth\fP is number of points over which to
-estimate the best fitting slope
-for contour labels  [Default is 4/10].
-.TP
-.B \-MCQ
-\fIcut\fP
-.br
-Do not draw contours with less than \fIcut\fP number
-of points [Draw all contours].
-.TP
-.B \-MCT
-[\fI+|-\fP][\fIgap/length\fP][\fI:LH\fP]
-.br
-Will draw tickmarks pointing in the downward direction every \fIgap\fP along the innermost closed contours.  Append \fIgap\fP and tickmark length (in inch) or use defaults [0.2/0.05].
-User may choose to tick only local highs or local lows by specifying \fB\-T+\fP or \fB\-T-\fP, respectively.  Appending :LH will plot the characters L and H at the center of closed
-innermost contours (local lows and highs).  L and H can be any single character (e.g., LH, \-+, etc.)
-If a file is given by \fB\-C\fP and \fB\-T\fP is set,
-then only contours marked with upper case C or A will have tickmarks [and anotation].
-.TP
-.B \-MCW
-\fItype\fP[\fIpen\fP]
-.br
-\fItype\fP, if present, can be 'a' for annotated contours or 'c' for regular contours [Default].
-\fIpen\fP sets the attributes for the particular line.  Default values for annotated contours:
-width = 3, color = black, texture = solid.  Regular contours have default width = 1.
-.TP
-.B \-MNA
-\fI[nhgt[/P] | P]\fP
-.br
-Turns on filename annotation of navigation tracks. If \fB\-MNA\fP is given
-without specifying any controlling parameters, then the lettering height
-\fInhgt\fP is 0.15 and the filenames are plotted parallel to the
-navigation track from the start of the track. The lettering height can be
-specified using either \fB\-MNA\fP\fInhgt\fP or \fB\-MNA\fP\fInhgt/P\fP.
-If \fB\-MNA\fP\fIP\fP or \fB\-MNA\fP\fInhgt/P\fP is specified,
-the filename will be plotted perpendicular to the navigation track.
-Filename annotation can also be specified using the \fB\-N\fP option.
-Defaults: Filename annotation off.
-.TP
-.B \-MNF
-\fIformat\fP
-.br
-Sets the data format for the input swath data specified with the \fB\-MNI\fP
-option. If \fIformat\fP < 0, then the input file specified
-with the \fB\-MNI\fP option will actually contain a list of input swath sonar
-data files. This program uses the \fBMBIO\fP library and will read or
-write any swath sonar format supported by \fBMBIO\fP. A list of the
-swath sonar data formats currently supported by \fBMBIO\fP and their
-identifier values is given in the \fBMBIO\fP manual page.
-Default: \fIformat\fP = \-1.
-.TP
-.B \-MNI
-\fIswathdata\fP
-.br
-This option causes the navigation track of swath data to be
-plotted. Here \fIswathdata\fP is the input file, and may be either
-a single swath file or a list of swath files. If \fIformat\fP > 0
-(set with the \fB\-MNF\fP option) then the swath sonar data
-contained in \fIswathdata\fP is read and processed. If \fIformat\fP < 0
-(the default),  then \fIswathdata\fP
-is assumed to be an ascii file containing a list of the input swath sonar
-data files to be processed and their formats.  The program will read
-the data in each one of these files.
-In the \fIswathdata\fP file, each
-data file should be followed by a data format identifier, e.g.:
- 	datafile1 11
- 	datafile2 24
-.br
-This program uses the \fBMBIO\fP library and will read or write any swath sonar
-format supported by \fBMBIO\fP. A list of the swath sonar data formats
-currently supported by \fBMBIO\fP and their identifier values
-is given in the \fBMBIO\fP manual page.
-.TP
-.B \-MNN
-[\fIttick/tannot/dannot/tlen\fP[\fI/nhgt/nperp\fP] | \fIF\fP | \fIFP\fP]
-.br
-This option sets the annotation of the swath file navigation
-plot specified using the \fB\-MNI\fP option.
-Time marks are made with "X" marks along the shiptrack; annotated
-time marks show the time in HH:MM format next to the time mark
-and annotated date marks show the time and julian day in
-HH:MM/DDD format.  The "X" marks are
-\fItlen\fP inches high for normal time marks and
-1.5 times \fItlen\fP inches high for annotated time or date
-marks.  The interval of time ticks, annotated time ticks, and
-annotated date ticks are given in hours by
-\fIttick\fP, \fItannot\fP, and \fIdannot\fP, respectively.
-If the \fInhgt\fP parameter is not given when the other parameters
-are specified, then no filename annotation will be done. If given,
-\fInhgt\fP sets the height in inches of the filename annotation
-and turns that annotation on. If given as 1,
-\fInperp\fP causes the filename annotation to be perpendicular
-to the shiptrack rather than parallel (the default).
-If the \fB\-MNN\fP\fIF\fP is given, then
-a navigation track will be generated using the default parameters
-and also with filename annotation along the shiptrack. If the
-\fB\-MNN\fP\fIFP\fP is given, then a navigation track will be generated
-with the default parameters and also with filename annotation
-perpendicular to the shiptrack.
-Defaults: \fIttick\fP = 0.25; \fItannot\fP = 1.0; \fIdannot\fP = 4.0;
-\fItlen\fP = 0.1; \fInhgt\fP = 0.1; \fInperp\fP = 0.
-.TP
-.B \-MNP
-\fI[pingnumber_tick/pingnumber_annot/pingnumber_tick_len]\fP
-.br
-Turns on ping number (or shot number) annotation of navigation tracks.
-Tick marks are made along the shiptrack at \fIpingnumber_tick\fP intervals; these
-are \fItlen\fP inches long. Longer tick marks are made along the
-shiptrack at \fIpingnumber_annot\fP intervals; these are 1.5 times \fItlen\fP
-inches long.
-Defaults: Pingnumber annotation off. If the \fB\-MNP\fP option is given without
-specifying the controlling parameters, then \fIpingnumber_tick\fP = 50,
-\fIpingnumber_annot\fP = 100, and \fIpingnumber_tick_len\fP = 0.1.
-.TP
-.B \-MTC
-\fIfill\fP
-.br
-Coastline plotting option.
-Set the shade (0-255), color (r/g/b), or pattern
-(p|Pdpi/pattern; see \fB\-MTG\fP) for lakes  [Default is the
-fill chosen for "wet" areas (-S)].
-.TP
-.B \-MTD
-\fIresolution\fP
-.br
-Coastline plotting option.
-Selects the resolution of the coastline data set to use ((f)ull,
-(h)igh, (i)ntermediate, (1)ow, and (c)rude).  The
-resolution drops off by 80% between data sets. [Default
-is l].
-.TP
-.B \-MTG
-\fIfill\fP
-.br
-Coastline plotting option.
-Select painting or clipping of "dry" areas.  Append a
-shade, color, pattern, or c for clipping.  Specify the
-shade (0-255) or color (r/g/b), or \fB\-MTG\fP\fIpdpi/pattern\fP,
-where pattern gives the number of the built-in pattern
-(1-90) OR the name of a Sun 1-, 8-, or 24-bit raster
-file.  dpi sets the resolution of the image.  See \fBGMT\fP
-Cookbook & Technical Reference Appendix E for
-information on individual patterns.
-.TP
-.B \-MTI
-\fIriver[/pen]\fP
-.br
-Coastline plotting option.
-Draw rivers.  Specify the type of rivers and
-[optionally] append pen attributes  [Default pen:
-width = 1, color = 0/0/0, texture = solid].  Choose
-from the list of river types below.  Repeat option \-I
-as often as necessary.
-     1 = Permanent major rivers
-     2 = Additional major rivers
-     3 = Additional rivers
-     4 = Minor rivers
-     5 = Intermittent rivers \- major
-     6 = Intermittent rivers \- additional
-     7 = Intermittent rivers \- minor
-     8 = Major canals
-     9 = Minor canals
-     10 = Irrigation canals
-     a = All rivers and canals (1-10)
-     r = All permanent rivers (1-4)
-     i = All intermittent rivers (5-7)
-     c = All canals (8-10)
-.TP
-.B \-MTN
-\fIborder[/pen]\fP
-.br
-Coastline plotting option.
-Draw political boundaries.  Specify the type of
-boundary and [optionally] append pen attributes
-[Default pen:  width = 1, color = 0/0/0, texture =
-solid].  Choose from the list of boundaries below.
-Repeat option \fB\-MTN\fP as often as necessary.
-     1 = National boundaries
-     2 = State boundaries within the Americas
-     3 = Marine boundaries
-     a = All boundaries (1-3)
-.TP
-.B \-MTS
-\fIfill\fP
-.br
-Coastline plotting option.
-Select painting or clipping of "wet" areas.  Append the
-shade (0-255), color (r/g/b), pattern (see \fB\-MTG\fP), or c
-for clipping.
-.TP
-.B \-MTW
-\fIpen\fP
-.br
-Coastline plotting option.
-Append pen attributes  [Defaults:  width = 1, color = 0/0/0,
-texture = solid].
-.TP
-.B \-MXG
-\fIfill\fP
-.br
-Select filling of symbols for xy plotting.
-Set the shade (0-255) or color
-(r/g/b) [Default is no fill]. To reset no fill,
-use \fIfill\fP = "N".
-For polygons, you may optionally specify
-\fB\-Gp\fP\fIicon_size/pattern\fP, where
-\fIpattern\fP gives the number of the
-image pattern (1-32) OR the name of a
-icon-format file.  \fIicon_size\fP sets
-the unit size in inch.
-To invert black and white pixels, use
-\fB\-GP\fP instead of \fB\-Gp\fP.  See
-\fBGMTs\fP Cookbook & Technical Reference
-Appendix E for information on individual patterns.
-.TP
-.B \-MXI
-\fIxy_file \fP
-.br
-Specifies a file containing (x,y) pairs to be plotted
-as lines or symbols. The line and symbol characteristics
-are set using the last \fB\-MXG\fP, \fB\-MXS\fP, and \fB\-MXW\fP
-options used. All of the \fB\-MX\fP commands can be
-given multiple times, so by stringing series of these
-commands together the user can plot different files
-using different line or symbol characteristics.
-[Default is a solid black line].
-.TP
-.B \-MXM
-.br
-Toggles expectation for xy data files having multiple
-segments, in which each segment is to be plotted
-separately. Segments are separated by a
-record whose first character is '>'. By default,
-unsegmented files are expected. Users may give this
-command multiple times, allowing some input files to
-be handled as segmented and others not.
-.TP
-.B \-MXS
-\fIsymbol/size\fP
-.br
-Selects symbol to be used for plotting the next xy data
-file. Setting \fIsymbol\fP = "N" causes line plotting.
-Choose between:
-.TP
-.B \-MXSa
-st\fBa\fPr.  \fIsize\fP is radius of circumscribing circle.
-.TP
-.B \-MXSb
-\fBb\fPar extending from \fIbase\fP to y.  \fIsize\fP is bar width.  By default,
-\fIbase\fP = 0.  Append /\fIbase\fP to change this value.  Append \fBu\fP if \fIsize\fP
-is in x-units [Default is inch].
-.TP
-.B \-MXSc
-\fBc\fPircle.  \fIsize\fP is diameter of circle.
-.TP
-.B \-MXSd
-\fBd\fPiamond.  \fIsize\fP is side of diamond.
-.TP
-.B \-MXSe
-\fBe\fPllipse.  Direction (in degrees counterclockwise from horizontal), major_axis (in inch), and minor_axis (in inch) must be found in columns 3, 4, and 5.
-.TP
-.B \-MXSf
-\fBf\fPault.  Give distance gap between ticks and ticklength in inch.  If gap is
-negative, it is interpreted to mean number of ticks instead.  Append \fBl\fP or \fBr\fP to draw tick on
-the left or right side of line [Default is centered].  Upper case \fBL\fP or \fBR\fP draws a triangle
-instead of line segment.
-.TP
-.B \-MXSh
-\fBh\fPexagon.  Give side in inch.
-.TP
-.B \-MXSi
-\fBi\fPnverted triangle.  Give side in inch.
-.TP
-.B \-MXSl
-\fBl\fPetter or text string.  Give size in inch, and append /\fIstring\fP after the size.  Note that the size is only approximate; no individual scaling
-is done for different characters.  Remember to escape special characters like *.
-.TP
-.B \-MXSp
-\fBp\fPoint.  No size needs to be specified (1 pixel is used).
-.TP
-.B \-MXSs
-\fBs\fPquare.  Give side in inch.
-.TP
-.B \-MXSt
-\fBt\fPriangle.  Give side in inch.
-.TP
-.B \-MXSv
-\fBv\fPector.  Direction (in degrees counterclockwise from horizontal) and length (in inch) must be found in columns 3 and 4.  \fIsize\fP,
-if present, will be interpreted as arrowwidth/headlength/headwidth (in inch) [Default is 0.03/0.12/0.1 inch].
-By default arrow attributes remains invariant to the length
-of the arrow.  To have the size of the vector scale down with decreasing size,
-append n\fPnorm\fP, where vectors shorter than \fInorm\fP will have their
-attributes scaled by length/\fInorm\fP.
-.TP
-.B \-MXSV
-Same as \fB\-MXSv\fP, except azimuth (in degrees east of north) should be given instead of direction.  The azimuth will
-be mapped into an angle based on the chosen map projection (\fB\-MXSv\fP leaves the directions
-unchanged.)
-.TP
-.B \-MXSx
-cross.  Give length in inch.
-.TP
-.B \-MXW
-\fIpen\fP
-.br
-Set pen attributes for xy plotting. See chapter 4.12 in the
-GMT Technical reference for a discussion of GMT pen values.
-[Defaults: width = 1, color = 0/0/0,
-texture = solid].
-.TP
-.B \-O
-\fIroot\fP
-.br
-Sets the root used to construct the filename of the output shellscript
-(\fIroot\fP.cmd) and names of files created when the shellscript is
-run.  Normally the
-name of the input grid file or grid file list is
-used as the \fIroot\fP.
-.TP
-.B \-P
-\fIpagesize\fP
-.br
-This option sets the size of the page the plot will be centered
-on. If the user does not set the plot scale, the plot will be
-sized as large as will fit on the designated page. If the user
-sets the plot scale such that the plot will not fit on the
-designated page, a larger page will be used.
-The supported page sizes are:
-
-          American ANSI sizes:
-          A     8.5 x 11.0 in.    ( 215.9 x  279.4 mm)
-          B    11.0 x 17.0 in.    ( 279.4 x  431.8 mm)
-          C    17.0 x 22.0 in.    ( 431.8 x  558.8 mm)
-          D    22.0 x 34.0 in.    ( 558.8 x  863.6 mm)
-          E    34.0 x 44.0 in.    ( 863.6 x 1117.6 mm)
-          F    28.0 x 40.0 in.    ( 711.2 x 1016.0 mm)
-          E1   44.0 x 68.0 in.    (1117.6 x 1727.2 mm)
-
-          Metric ISO A sizes:
-          A0   841.0 x 1189.0 mm  (33.11 x 46.81 in.)
-          A1   594.0 x  841.0 mm  (23.39 x 33.11 in.)
-          A2   420.0 x  594.0 mm  (16.54 x 23.39 in.)
-          A3   297.0 x  420.0 mm  (11.69 x 16.54 in.)
-          A4   210.0 x  297.0 mm  ( 8.27 x 11.69 in.)
-          A5   148.0 x  210.0 mm  ( 5.83 x  8.27 in.)
-          A6   105.0 x  148.0 mm  ( 4.13 x  5.83 in.)
-          A7    74.0 x  105.0 mm  ( 2.91 x  4.13 in.)
-          A8    52.0 x   74.0 mm  ( 2.05 x  2.91 in.)
-          A9    37.0 x   52.0 mm  ( 1.46 x  2.05 in.)
-          A10   26.0 x   37.0 mm  ( 1.02 x  1.46 in.)
-
-          Metric ISO B sizes:
-          B0   1000.0x 1414.0 mm  (39.37 x 55.67 in.)
-          B1   707.0 x 1000.0 mm  (27.83 x 39.37 in.)
-          B2   500.0 x  707.0 mm  (19.68 x 27.83 in.)
-          B3   353.0 x  500.0 mm  (13.90 x 19.68 in.)
-          B4   250.0 x  353.0 mm  ( 9.84 x 13.90 in.)
-          B5   176.0 x  250.0 mm  ( 6.93 x  9.84 in.)
-          B6   125.0 x  176.0 mm  ( 4.92 x  6.93 in.)
-          B7    88.0 x  125.0 mm  ( 3.46 x  4.92 in.)
-          B8    62.0 x   88.0 mm  ( 2.44 x  3.46 in.)
-          B9    44.0 x   62.0 mm  ( 1.73 x  2.44 in.)
-          B10   31.0 x   44.0 mm  ( 1.22 x  1.73 in.)
-
-          Metric ISO C sizes:
-          C0   914.4 x 1300.5 mm  (36.00 x 51.20 in.)
-          C1   650.2 x  914.4 mm  (25.60 x 36.00 in.)
-          C2   457.2 x  650.2 mm  (18.00 x 25.60 in.)
-          C3   325.1 x  457.2 mm  (12.80 x 18.00 in.)
-          C4   228.6 x  325.1 mm  ( 9.00 x 12.80 in.)
-          C5   162.6 x  228.6 mm  ( 6.40 x  9.00 in.)
-          C6   114.3 x  162.6 mm  ( 4.50 x  6.40 in.)
-          C7    81.3 x  114.3 mm  ( 3.20 x  4.50 in.)
-
-	  MB-System large format sizes:
-          m1  1371.6 x 1828.8 mm  (54.00 x 72.00 in.)
-          m2  1371.6 x 2133.6 mm  (54.00 x 84.00 in.)
-          m3  1371.6 x 2438.4 mm  (54.00 x 96.00 in.)
-          m4  1524.0 x 1828.8 mm  (60.00 x 72.00 in.)
-          m5  1524.0 x 2133.6 mm  (60.00 x 84.00 in.)
-          m6  1524.0 x 2438.4 mm  (60.00 x 96.00 in.)
-
-The default page size is A.
-.TP
-.B \-Q
-Normally, the output plot generation shellscript
-includes lines which execute
-a program to display the Postscript image on the screen.
-This option causes those lines to be commented out so
-that executing the shellscript produces a Postscript plot
-but does not attempt to display it on the screen.
-Alternatively, invoking the plot generation shellscript with
-a \fB-N\fP command line argument also suppresses the screen
-display of the plot.
-The program
-to be used to display the Postscript is set
-using \fBmbdefaults\fP;
-the default value can be overridden by setting the environment
-variable $MB_PS_VIEWER.
-.TP
-.B \-R
-\fIwest/east/south/north\fP
-.br
-\fIwest, east, south,\fP and \fInorth\fP specify the Region of interest.  To specify boundaries
-in degrees and minutes [and seconds], use the dd:mm[:ss] format.  Append \fBr\fP if lower left and upper right
-map coordinates are given instead of wesn.
-You may ask for a larger \fIw/e/s/n\fP region to have more room between the image and the axes.
-A smaller region than specified in the grdfile will result in a subset of the grid [Default is
-region given by the grdfile].
-.TP
-.B \-S
-\fI[color/shade]\fP
-.br
-This option enables effective histogram equalization of the
-color and/or shading of the gridded data. The equalization is
-not achieved by changing the data values, but rather by
-constructing the color or shading tables so that
-the boundaries in the tables encompass equal fractions of
-the datapoints. This serves to focus color or shading contrasts
-in value ranges corresponding to the bulk of the data values.
-If \fB\-S\fP is given alone or with \fIcolor\fP = 1,
-it enables equalization of the color table used
-for color or gray fill plots,  shaded or unshaded. If the plot
-is to be shaded,  either by synthetic illumination (\fB\-G\fP\fI2\fP)
-or using an intensity file (\fB\-K\fP and \fB\-G\fP\fI3\fP options), then
-setting \fIshade\fP = 1 will cause the shading to be equalized.
-Using \fB\-S\fP\fI0/1\fP will equalize the shading without
-equalizing the color table.
-.TP
-.B \-T
-If \fB\-T\fP is given, it causes a coastline to be drawn
-on the map. The default is to draw the coastline as the thinnest possible
-line. To exercise greater control of
-the coastline plotting, including color fill of "dry" areas and
-display of lakes, rivers, and political boundaries, use the
-\fB\-MTC\fP, \fB\-MTD\fP, \fB\-MTG\fP, \fB\-MTI\fP,
-\fB\-MTN\fP, \fB\-MTS\fP, and \fB\-MTW\fP options.
-.TP
-.B \-U
-\fIorientation\fP
-.br
-Normally the orientation of the plot (portrait or landscape)
-is selected automatically so as to maximize the plot scale.
-The \fB\-U\fP option allows the user to set the plot orientation. If
-\fIorientation\fP = 1, a portrait plot will be produced; if
-\fIorientation\fP = 2, a landscape plot will be produced.
-.TP
-.B \-V
-Causes \fBmbm_grdplot\fP to operate in "verbose" mode
-so that it outputs
-more information than usual.
-.TP
-.B \-W
-\fI[color_style\fP[\fI/palette\fP[\fIncolors\fP]] | cptfile]
-.br
-This option controls the color scheme used for color
-fill plots.
-
-If \fIcolor_style\fP = 1 [default], then
-the color scheme used will be a continuous grading
-of colors. If \fIcolor_style\fP = 2, the color scheme
-will be a set of discrete color intervals. The color
-palette used is set using \fIpalette\fP. Seven palettes
-are available:
- 	\fIpalette\fP = 1:	Haxby colors [default]
- 	\fIpalette\fP = 2:	high Intensity colors
- 	\fIpalette\fP = 3:	low Intensity colors
- 	\fIpalette\fP = 4:	grayscale
- 	\fIpalette\fP = 5:	uniform grayscale
- 	\fIpalette\fP = 6:	uniform black
- 	\fIpalette\fP = 7:	uniform white
- 	\fIpalette\fP = 8:	sealevel 1
- 	\fIpalette\fP = 9:	sealevel 2
-
-The RGB definitions of the color palettes are:
-
-color palette 1 \- Haxby Color Table
-  red:   255 255 255 255 240 205 138 106  50  40  37
-  green: 255 186 161 189 236 255 236 235 190 127  57
-  blue:  255 133  68  87 121 162 174 255 255 251 175
-
-color palette 2 \- High Intensity Colors
-  red:   255 255 255 255 128   0   0   0   0 128 255
-  green:   0  64 128 255 255 255 255 128   0   0   0
-  blue:    0   0   0   0   0   0 255 255 255 255 255
-
-color palette 3 \- Low Intensity Colors
-  red:   200 194 179 141  90   0   0   0   0  90 141
-  green:   0  49  90 141 179 200 141  90   0   0   0
-  blue:    0   0   0   0   0   0 141 179 200 179 141
-
-color palette 4 \- Grayscale
-  red:   255 230 204 179 153 128 102  77  51  26   0
-  green: 255 230 204 179 153 128 102  77  51  26   0
-  blue:  255 230 204 179 153 128 102  77  51  26   0
-
-color palette 5 \- Uniform Grayscale
-  red:   128 128 128 128 128 128 128 128 128 128 128
-  green: 128 128 128 128 128 128 128 128 128 128 128
-  blue:  128 128 128 128 128 128 128 128 128 128 128
-
-color palette 6 \- Uniform Black
-  red:     0   0   0   0   0   0   0   0   0   0   0
-  green:   0   0   0   0   0   0   0   0   0   0   0
-  blue:    0   0   0   0   0   0   0   0   0   0   0
-
-color palette 7 \- Uniform White
-  red:   255 255 255 255 255 255 255 255 255 255 255
-  green: 255 255 255 255 255 255 255 255 255 255 255
-  blue:  255 255 255 255 255 255 255 255 255 255 255
-
-color pallette 8 \- Sealevel 1
-  (colors here used above zero Haxby colors below)
-  red:   250 245 240 235 230 221 212 211 210 205 200
-  green: 250 240 230 221 212 201 190 180 170 160 150
-  blue:  120 112 104  96  88  80  72  64  56  48  40
-
-color pallette 9 \- Sealevel 2
-  (colors here used above zero Haxby colors below)
-  red:   255 210 170 145 120 120 104  67  33   0   0
-  green: 255 200 160 145 130 100 107 123 140 160 230
-  blue:  100  75  50  45  40  30  24   7   0   0   0
-
-The Haxby colors have been adapted from a palette
-developed by Dr. William Haxby of the Lamont-Doherty
-Earth Observatory; this palette is pleasing to the
-eye and well suited for shading. The high intensity
-colors describe linear paths through RGB space from
-red to blue to green to purple; because the colors are high
-intensity they are not well suited to shading.
-The low intensity colors are similar to the high
-intensity, but muted and thus well suited to shading.
-The grayscale palette runs linearly from white to
-black and is commonly used for plots of sidescan and amplitude
-data. The uniform grayscale is useful for non-color
-shaded relief plots.
-
-The \fIncolors\fP parameter sets the number of color
-values used in plotting, whether the colors are
-represented in a continuous color scale or a
-stepped, discrete color scale [default is 11].
-
-If the option argument is the path to an existing \fBGMT\fP
-color palette (CPT) file, then that CPT file and its
-color scheme will be used for the plot
-.TP
-.B \-X
-Normally, \fBmbm_grdplot\fP creates an executable shellscript and
-then exits.  This option will cause the shellscript to be executed
-in the background before \fBmbm_grdplot\fP exits.
-.TP
-.B \-Y
-Normally, \fBmbm_grdplot\fP generates nicely rounded numbers
-for the boundaries of the color palette. Often, the resulting
-color bounds extend well outside the range of the gridded data.
-This option causes the minimum and maximum color boundaries to
-exactly conform to the minimum and maximum values of the grid,
-or, if the \fB\-Z\fP option is used, the minimum and maximum
-values specified by the user.
-.TP
-.B \-Z
-\fImin/max[/mode]\fP
-.br
-This option overrides the minimum and maximum values of
-the gridded data, affecting the color palette and the
-contour interval if those parameters are not specified
-by the user. By default (i.e. \fImode\fP is omitted
-or equal to 0), the macro selects the color palette bounds
-so that they encompass \fImin\fP and \fImax\fP while using
-nicely rounded numbers. If \fImode\fP is omitted or equal
-to 0, then the color palette will end near \fImin\fP and
-\fImax\fP whether it is linear stretched or histogram equalized.
-If \fImode\fP = 1, then the color stretching calculations
-will be done using \fImin\fP and \fImax\fP, but then the
-first and last values in the color palette will be set to
-the actual minimum and maximum values.so that all the data
-are displayed.
-
-.SH EXAMPLES
-Suppose we have obtained two GRD files with dimensions of
-127 by 194, one containing gridded bathymetry
-(grd_sb2112_example_bath) and the other gridded sidescan
-(grd_sb2112_example_ss). In order to generate a shellscript
-which will in turn generate a contour plot of the bathymetry,
-the following will suffice:
-
-  	mbm_grdplot \-Igrd_sb2112_example_bath \-C \\
-  	    \-V \-Ogrd_sb2112_example_bathcont
-
-In order to generate a color fill plot overlaid by
-contours, we use both the \-G1 and \-C options.
-Because the data has been gridded as bathymetry (positive
-down) rather than as topography (positive up), the default
-plot will have "hot" colors for deep regions and "cold"
-colors for shallow regions; this is the opposite of the
-convention we usually use. In order to fix the colors, we have
-to either rescale the data by multiplying the bathymetry
-by \-1 (accomplished with \-MGS-1), or flip the color
-palette (accomplished with \-D). We use the latter approach:
-
-  	mbm_grdplot \-Igrd_sb2112_example_bath \-G1 \-C \-D \\
-  	    \-V \-Ogrd_sb2112_example_bathfill
-
-In order to generate a grayscale plot of the sidescan grid,
-we use \-G1 and \-W1/4. We also use \-D so that high sidescan
-amplitudes are shown as dark.
-
-  	mbm_grdplot \-Igrd_sb2112_example_ss \-G1 \-D \\
-  	    \-V \-Ogrd_sb2112_example_ssfill
-
-Now consider generating a shaded relief view of the
-gridded bathymetry. We choose to illuminate
-the bathymetry from the northeast (azimuth of 45 degrees)
-and to use a shading magnitude of 0.4 (-A0.4/45).
-Because this grid is so small, the default shaded
-relief image is likely to be grainy. To fix this problem, we
-specify a dots per inch resolution of 72 (-MGQ72); this
-will take longer and generate a larger plotfile, but the
-plot will look better. We also use the \-L option to specify
-the title and color scale label for the plot.  We also use
-the \-X flag this so that the plot generation shellscript is
-executed immediately. Here is the command:
-
-  	mbm_grdplot \-Igrd_sb2112_example_bath \\
-  	    \-G2 \-A0.4/45 \-D \-MGQ72 \-X \-V \\
-  	    \-L"Shaded Relief Bathymetry":"Depth (meters)" \\
-  	    \-Osb2112_example_bathshade
-
-Now, consider generating a plot of the bathymetry
-overlaid with the gridded sidescan.
-The sidescan overlay is specified using the \-K option.
-We want the colors for the bathymetry to be chosen without
-histogram equalization, but we also want histogram
-equalization to be applied to the sidescan data used for
-shading. To do this, we use \-S0/1, where the first number
-(0) specifies no histogram equalization of the color
-scale and the second number (1) causes histogram
-equalization of the shading sidescan data to be
-implemented. In order to maintain the convention that
-high sidescan amplitudes are black, we flip both the
-color palette (as in the previous example) and the
-shading scale with \-D1/1. We could also flip the shading
-by specifying a negative shading magnitude (-A-0.4).
-In this case, we forgo specifying the image resolution,
-resulting in a grainy plot:
-
-  	mbm_grdplot \-Igrd_sb2112_example_bath \\
-  	    \-G3 \-Kgrd_sb2112_example_ss \\
-  	    \-S0/1 \-D1/1 \-A0.4 \-X \-V \\
-  	    \-L"Bathymetry Overlaid With Sidescan":"Depth (meters)" \\
-  	    \-Osb2112_example_bathss
-
-As an example, the contents of the plotting shellscript
-"grd_sb2112_example_bathfill.cmd" are:
-
-.br
- #
- # Shellscript to create Postscript plot of data in grd file
- # Created by macro mbm_grdplot
- #
- # This shellscript created by following command line:
- # mbm_grdplot \-Igrd_sb2112_example_bath \-G1 \-C \-D \\
- #	-V \-Ogrd_sb2112_example_bathfill
- #
- # Save existing GMT defaults
- echo Saving GMT defaults...
- gmtdefaults \-L > gmtdefaults$$
- #
- # Set new GMT defaults
- echo Setting new GMT defaults...
- gmtset ANOT_FONT Helvetica
- gmtset LABEL_FONT Helvetica
- gmtset HEADER_FONT Helvetica
- gmtset ANOT_FONT_SIZE 8
- gmtset LABEL_FONT_SIZE 8
- gmtset HEADER_FONT_SIZE 10
- gmtset FRAME_WIDTH 0.074999999999999997
- gmtset TICK_LENGTH 0.074999999999999997
- gmtset PAGE_ORIENTATION LANDSCAPE
- gmtset COLOR_BACKGROUND 0/0/0
- gmtset COLOR_FOREGROUND 255/255/255
- gmtset COLOR_NAN 255/255/255
- #
- # Make color palette table file
- echo Making color palette table file...
- echo   3000 255 255 255   3150 255 186 133 > \\
-		grd_sb2112_example_bathfill.cpt
- echo   3150 255 186 133   3300 255 161  68 >> \\
-		grd_sb2112_example_bathfill.cpt
- echo   3300 255 161  68   3450 255 189  87 >> \\
-		grd_sb2112_example_bathfill.cpt
- echo   3450 255 189  87   3600 240 236 121 >> \\
-		grd_sb2112_example_bathfill.cpt
- echo   3600 240 236 121   3750 205 255 162 >> \\
-		grd_sb2112_example_bathfill.cpt
- echo   3750 205 255 162   3900 138 236 174 >> \\
-		grd_sb2112_example_bathfill.cpt
- echo   3900 138 236 174   4050 106 235 255 >> \\
-		grd_sb2112_example_bathfill.cpt
- echo   4050 106 235 255   4200  50 190 255 >> \\
-		grd_sb2112_example_bathfill.cpt
- echo   4200  50 190 255   4350  40 127 251 >> \\
-		grd_sb2112_example_bathfill.cpt
- echo   4350  40 127 251   4500  37  57 175 >> \\
-		grd_sb2112_example_bathfill.cpt
- #
- # Make color image
- echo Running grdimage...
- grdimage grd_sb2112_example_bath \-Jm24.418434289993325 \\
-.br
-        \-R114.221/114.421/-31.9001/-31.6377 \\
-.br
-        \-Cgrd_sb2112_example_bathfill.cpt \\
-.br
-        \-P \-X1.8081565710006675 \-Y2 \-K \-V \\
-.br
-        > grd_sb2112_example_bathfill.ps
-.br
- #
- # Make contour plot
- echo Running grdcontour...
- grdcontour grd_sb2112_example_bath \-Jm24.418434289993325 \\
-.br
-        \-R114.221/114.421/-31.9001/-31.6377 \\
-.br
-        \-C50 \\
-.br
-        \-L3144.51/4499.44 \-Wc1p \\
-.br
-        \-P \-K \-O \-V >> grd_sb2112_example_bathfill.ps
- #
-.br
- # Make color scale
- echo Running psscale...
- psscale \-Cgrd_sb2112_example_bathfill.cpt \\
-.br
-        \-D2.4418/-0.5000/4.8837/0.1500h \\
-.br
-        \-B":.Data Values:" \\
-.br
-        \-P \-K \-O \-V >> grd_sb2112_example_bathfill.ps
-.br
- #
- # Make basemap
- echo Running psbasemap...
- psbasemap \-Jm24.418434289993325 \\
-.br
-        \-R114.221/114.421/-31.9001/-31.6377 \\
-.br
-        \-B5m/5m:."Data File grd_sb2112_example_bath": \\
-.br
-        \-P \-O \-V >> grd_sb2112_example_bathfill.ps
-.br
- #
- # Delete surplus files
- echo Deleting surplus files...
- rm \-f grd_sb2112_example_bathfill.cpt
- #
- # Reset GMT default fonts
- echo Resetting GMT fonts...
- mv gmtdefaults$$ .gmtdefaults
- #
- # Run xpsview
- echo Running xpsview in background...
- xpsview \-ps a \-maxp 4m grd_sb2112_example_bathfill.ps &
- #
- # All done!
- echo All done!
-
-.SH SEE ALSO
-\fBgrdimage\fP(1), \fBgrdcontour\fP(1),
-\fBmbdefaults\fP(1), \fBmbgrid\fP(1), \fBmbsystem\fP(1),
-\fBmbm_grd3dplot\fP(1), \fBmbm_plot\fP(1),
-\fBpsbasemap\fP(1), \fBpstext\fP(1), \fBpsxy\fP(1)
-
-.SH BUGS
-By making this macro more useful, we have also made it
-more complex.
diff --git a/src/man/man1/mbm_grdtiff.1 b/src/man/man1/mbm_grdtiff.1
deleted file mode 100644
index a392e6d..0000000
--- a/src/man/man1/mbm_grdtiff.1
+++ /dev/null
@@ -1,673 +0,0 @@
-.TH mbm_grdtiff 1 "28 September 2013" "MB-System 5.0" "MB-System 5.0"
-.SH NAME
-\fBmbm_grdtiff\fP \- Create an executable shellscript which will generate
-a TIFF image of gridded data in a GMT grd file.
-
-.SH VERSION
-Version 5.0
-
-.SH SYNOPSIS
-\fBmbm_grdtiff\fP \fB\-I\fP\fIfile\fP
-[\fB\-A\fP\fImagnitude[/azimuth/elevation]\fP
-\fB\-G\fP\fIcolor_mode\fP \fB\-H\fP \fB\-K\fP\fIintensity_file\fP
-\fB\-O\fP\fIroot\fP \fB\-S\fP\fI[color/shade]\fP
-\fB\-V\fP
-\fB\-W\fP\fI[color_style\fP[\fI/palette\fP[\fIncolors\fP]] | \fIcptfile]\fP ]
-
-
-Additional Options:
-.br
-[\fB\-D\fP\fIflipcolor/flipshade\fP
-\fB\-MGS\fP\fIscalefactor\fP \fB\-MGW\fP \fB\-Q\fP \fB\-R\fP\fIw/e/s/n\fP
-\fB\-X\fP \fB\-Y\fP \fB\-Z\fP\fImin/max[/mode]\fP]
-
-.SH DESCRIPTION
-\fBmbm_grdtiff\fP is a macro to generate a shellscript
-which, when executed, will use the program \fBmbgrdtiff\fP to
-generate a geographically located TIFF image of gridded
-data. The primary purpose of this macro is to allow the simple,
-semi-automated production of a nice looking image with a few
-command line arguments. Several styles of images can be generated, including
-color fill and shaded relief maps. The available options mirror
-a subset of the options in \fBmbm_grdplot\fP, allowing users to easily
-generate equivalent Postscript plots and TIFF images of gridded
-data. The program \fBmbgrdtiff\fP recognizes the coordinate system
-used by \fBmbgrid\fP or \fBmbmosaic\fP to generate a grid file, and
-then embeds the projection and grid bounds information into the TIFF
-image in accordance with the GeoTIFF standard. A number of GIS software
-packages recognize the georeferencing information in GeoTIFF images.
-In particular, images generated by \fBmbgrdtiff\fP from grids created
-using \fBmbgrid\fP or \fBmbmosaic\fP can be loaded into the
-GRASS, ArcInfo, ArcView, and ArcGIS GIS packages as geographically located
-coverages. The \fBmbgrid\fP and \fBmbmosaic\fP manual pages each contain
-an appendix with a complete list of the projected coordinate systems that
-may used in grid generation. Some software packages (e.g. Winfrog) do not
-recognize the embedded coordinate system information, and install require
-a parallel "world" file to specify the bounds and resolution. The \fB-MGW\fP
-option causes a world file to be generated with a ".tfw" suffix.
-
-.SH AUTHORSHIP
-David W. Caress (caress at mbari.org)
-.br
-  Monterey Bay Aquarium Research Institute
-.br
-Dale N. Chayes (dale at ldeo.columbia.edu)
-.br
-  Lamont-Doherty Earth Observatory
-
-.SH SIMPLE DESCRIPTION OF BASIC OPTIONS
-.TP
-.B \-A
-\fImagnitude[/azimuth/elevation]\fP
-.br
-Sets the parameters which control the
-synthetic illumination of the gridded data (shaded relief).
-The value \fImagnitude\fP
-is an effective vertical exageration which modulates the intensity of
-the shading; typical values are in the 0.1 to 10 range.
-The value \fIazimuth\fP
-is the azimuth in degrees from north from which the data is illuminated.
-The value \fIelevation\fP is the elevation of the illumination
-in degrees from horizontal.
-Defaults: \fImagnitude\fP = 0.2; \fIazimuth\fP = 0.0;
-\fIelevation\fP = 30.0;
-.TP
-.B \-C
-\fIcontour_control\fP
-.br
-If \fB\-C\fP is given alone, it causes unannotated contours
-to be drawn using a contour interval calculated from the
-data. The user may also use \fIcontour_control\fP
-to specify the contour interval. See the COMPLETE DESCRIPTION OF OPTIONS
-section below for a more complete discussion.
-.TP
-.B \-D
-\fI[flipcolor/flipshade]\fP
-.br
-Normally, the color or grayscale tables used for color maps run from
-cool colors (or dark grays) for low grid values
-to hot colors (or light grays) for high grid values.
-This option reverses the color table so that cool colors (dark grays)
-correspond to high values and hot colors (light grays) to low values.
-If \fB\-D\fP is given alone, it applies to the color table used
-for color or gray fill plots,  shaded or unshaded. If the plot
-is to be shaded,  either by synthetic illumination (\fB\-G\fP\fI2\fP)
-or using an intensity file (\fB\-K\fP and \fB\-G\fP\fI3\fP options), then
-setting \fIflipshade\fP = 1 will cause the shading convention
-to be reversed (e.g. high intensities overlaid as light shading).
-Using \fB\-D\fP\fI0/1\fP will flip the shading convention
-but leave the default color convention.
-.TP
-.B \-G
-\fIcolor_mode\fP
-.br
-Turns on color fill plot and sets the style of the plot.
-.br
-        \fIcolor_mode\fP = 1: Color/gray fill.
-        \fIcolor_mode\fP = 2: Color/gray fill shaded by
-                        synthetic illumination.
-        \fIcolor_mode\fP = 3: Color/gray fill shaded by
-                        an intensity file. The \fB\-K\fP
-                        option must be used to specify
- 			the intensity file.
-        \fIcolor_mode\fP = 4: Color/gray fill of slope
- 			magnitude.
-        \fIcolor_mode\fP = 5: Color/gray fill shaded by
-                        slope magnitude.
-.TP
-.B \-H
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-.TP
-.B \-I
-\fIgrdfile\fP
-.br
-Sets the name of the gridded data file to be plotted.
-Alternatively, \fIgrdfile\fP may be a list of grid files
-(one filename on each line) to be plotted together.
-.TP
-.B \-K
-\fIintensity_file\fP
-.br
-Sets the name of the gridded data file containing
-instensity values to be used for shading the map.
-Alternatively, \fIgrdfile\fP may be a list of grid files
-(one filename on each line) to be used together. If a
-list of file is supplied, the intensity files must
-conform in order to the data grid files they will shade.
-.TP
-.B \-O
-\fIroot\fP
-.br
-Sets the root used to construct the filename of the output shellscript
-(\fIroot\fP.cmd) and names of files created when the shellscript is
-run.  Normally the
-name of the input grid file or grid file list is
-used as the \fIroot\fP.
-.TP
-.B \-S
-\fI[color/shade]\fP
-.br
-This option enables effective histogram equalization of the
-color and/or shading of the gridded data. The equalization is
-not achieved by changing the data values, but rather by
-constructing the color or shading tables so that
-the boundaries in the tables encompass equal fractions of
-the datapoints. This serves to focus color or shading contrasts
-in value ranges corresponding to the bulk of the data values.
-If \fB\-S\fP is given alone or with \fIcolor\fP = 1,
-it enables equalization of the color table used
-for color or gray fill plots,  shaded or unshaded. If the plot
-is to be shaded,  either by synthetic illumination (\fB\-G\fP\fI2\fP)
-or using an intensity file (\fB\-K\fP and \fB\-G\fP\fI3\fP options), then
-setting \fIshade\fP = 1 will cause the shading to be equalized.
-Using \fB\-S\fP\fI0/1\fP will equalize the shading without
-equalizing the color table.
-.TP
-.B \-U
-\fIorientation\fP
-.br
-Normally the orientation of the plot (portrait or landscape)
-is selected automatically so as to maximize the plot scale.
-The \fB\-U\fP option allows the user to set the plot orientation. If
-\fIorientation\fP = 1, a portrait plot will be produced; if
-\fIorientation\fP = 2, a landscape plot will be produced.
-.TP
-.B \-V
-Causes \fBmbm_grdtiff\fP to operate in "verbose" mode
-so that it outputs
-more information than usual.
-.TP
-.B \-W
-\fI[color_style\fP[\fI/palette\fP[\fIncolors\fP]] | cptfile]
-.br
-This option controls the color scheme used for color
-fill plots.
-
-If \fIcolor_style\fP = 1 [default], then
-the color scheme used will be a continuous grading
-of colors. If \fIcolor_style\fP = 2, the color scheme
-will be a set of discrete color intervals. The color
-palette used is set using \fIpalette\fP. Five palettes
-are available:
- 	\fIpalette\fP = 1:	Haxby colors [default]
- 	\fIpalette\fP = 2:	high Intensity colors
- 	\fIpalette\fP = 3:	low Intensity colors
- 	\fIpalette\fP = 4:	grayscale
- 	\fIpalette\fP = 5:	uniform grayscale
-.br
-A complete description of the color palettes is given
-in the COMPLETE DESCRIPTION OF OPTIONS section below.
-
-The \fIncolors\fP parameter sets the number of color
-values used in plotting, whether the colors are
-represented in a continuous color scale or a
-stepped, discrete color scale [default is 11].
-
-If the option argument is the path to an existing \fBGMT\fP
-color palette (CPT) file, then that CPT file and its
-color scheme will be used for the plot
-
-.SH COMPLETE DESCRIPTION OF OPTIONS
-.TP
-.B \-A
-\fImagnitude[/azimuth]\fP
-.br
-Sets the parameters which control the
-synthetic illumination of the gridded data (shaded relief).
-The value \fImagnitude\fP
-is an effective vertical exageration which modulates the intensity of
-the shading; typical values are in the 0.1 to 0.5 range.
-The value \fIazimuth\fP
-is the azimuth from which the data is illuminated.
-Defaults: \fImagnitude\fP = 0.2; \fIazimuth\fP = 0.0;
-.TP
-.B \-D
-\fI[flipcolor/flipshade]\fP
-.br
-Normally, the color or grayscale tables used for color maps run from
-cool colors (or dark grays) for low grid values
-to hot colors (or light grays) for high grid values.
-This option reverses the color table so that cool colors (dark grays)
-correspond to high values and hot colors (light grays) to low values.
-If \fB\-D\fP is given alone, it applies to the color table used
-for color or gray fill plots,  shaded or unshaded. If the plot
-is to be shaded,  either by synthetic illumination (\fB\-G\fP\fI2\fP)
-or using an intensity file (\fB\-K\fP and \fB\-G\fP\fI3\fP options), then
-setting \fIflipshade\fP = 1 will cause the shading convention
-to be reversed (e.g. high intensities overlaid as light shading).
-Using \fB\-D\fP\fI0/1\fP will flip the shading convention
-but leave the default color convention.
-.TP
-.B \-G
-\fIcolor_mode\fP
-.br
-Turns on color fill plot and sets the style of the plot.
-.br
-        \fIcolor_mode\fP = 1: Color/gray fill.
-        \fIcolor_mode\fP = 2: Color/gray fill shaded by
-                        synthetic illumination.
-        \fIcolor_mode\fP = 3: Color/gray fill shaded by
-                        an intensity file. The \fB\-K\fP
-                        option must be used to specify
- 			the intensity file.
-        \fIcolor_mode\fP = 4: Color/gray fill of slope
- 			magnitude.
-        \fIcolor_mode\fP = 5: Color/gray fill shaded by
-                        slope magnitude.
-.br
-See the \fBmbgrdtiff\fP and \fBgrdimage\fP manual pages
-for information on shading with intensity files
-.TP
-.B \-H
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-.TP
-.B \-I
-\fIgrdfile\fP
-.br
-Sets the name of the gridded data file to be plotted.
-The data must be in a form acceptable to \fBGMT\fP version 3
-programs (see the \fBGMT\fP Cookbook & Technical Reference).
-Alternatively, \fIgrdfile\fP may be a list of grid files
-(one filename on each line) to be plotted together. This
-is useful when data from a region is broken up into several
-grid files rather than a single very large grid file.
-.TP
-.B \-K
-\fIintensity_file\fP
-.br
-Sets the name of the gridded data file containing
-instensity values to be used for shading the map.
-Alternatively, \fIgrdfile\fP may be a list of grid files
-(one filename on each line) to be used together. If a
-list of files is supplied, the intensity files must
-conform in order to the list of data grid files they will shade.
-.TP
-.B \-M
-A series of "miscellaneous" options are provided which are
-given as \fB\-M\fP followed by a two character identifier, followed
-by any other parameters associated with that option.
-The \fB\-M\fP options may be strung together separated by
-colons, e.g. "-MGQ100:GU:CA200/10", which is equivalent to
-"-MGQ \-MGU \-MCA200/10".
-.TP
-.B \-MGD
-\fIgmtdef/value\fP
-.br
-Allows the user to set the \fBGMT\fP default values used as
-the plot is constructed. This command may be given repeatedly
-to set as many \fBGMT\fP defaults as required. For example, to
-set the basemap annotation font to Courier, use
-"-MGDANOT_FONT/Courier".
-.TP
-.B \-MGS
-\fIscalefactor\fP
-.br
-The gridded data is multiplied by \fIscalefactor\fP.
-This option is most often used flip the sign of the
-data (\fIscalefactor\fP = \-1). [Default no scaling]
-.TP
-.B \-MGW
-The \fB-MGW\fP option causes a "world" file to be generated parallel to the
-GeoTiff image with a ".tfw" suffix. Some software packages (e.g. Winfrog) do
-not recognize the coordinate information embedded in the GeoTiff file, and
-look for a world file.
-.TP
-.B \-O
-\fIroot\fP
-.br
-Sets the root used to construct the filename of the output shellscript
-(\fIroot\fP.cmd) and names of files created when the shellscript is
-run.  Normally the
-name of the input grid file or grid file list is
-used as the \fIroot\fP.
-.TP
-.B \-Q
-Normally, the output plot generation shellscript
-includes lines which execute
-the program \fBxv\fP to display the TIFF image on the screen.
-This option causes those lines to be commented out so
-that executing the shellscript produces a TIFF image
-but does not attempt to display it on the screen.
-.TP
-.B \-R
-\fIwest/east/south/north\fP
-.br
-\fIwest, east, south,\fP and \fInorth\fP specify the Region of interest.  To specify boundaries
-in degrees and minutes [and seconds], use the dd:mm[:ss] format.  Append \fBr\fP if lower left and upper right
-map coordinates are given instead of wesn.
-You may ask for a larger \fIw/e/s/n\fP region to have more room between the image and the axes.
-A smaller region than specified in the grdfile will result in a subset of the grid [Default is
-region given by the grdfile].
-.TP
-.B \-S
-\fI[color/shade]\fP
-.br
-This option enables effective histogram equalization of the
-color and/or shading of the gridded data. The equalization is
-not achieved by changing the data values, but rather by
-constructing the color or shading tables so that
-the boundaries in the tables encompass equal fractions of
-the datapoints. This serves to focus color or shading contrasts
-in value ranges corresponding to the bulk of the data values.
-If \fB\-S\fP is given alone or with \fIcolor\fP = 1,
-it enables equalization of the color table used
-for color or gray fill plots,  shaded or unshaded. If the plot
-is to be shaded,  either by synthetic illumination (\fB\-G\fP\fI2\fP)
-or using an intensity file (\fB\-K\fP and \fB\-G\fP\fI3\fP options), then
-setting \fIshade\fP = 1 will cause the shading to be equalized.
-Using \fB\-S\fP\fI0/1\fP will equalize the shading without
-equalizing the color table.
-.TP
-.B \-V
-Causes \fBmbm_grdtiff\fP to operate in "verbose" mode
-so that it outputs
-more information than usual.
-.TP
-.B \-W
-\fI[color_style\fP[\fI/palette\fP[\fIncolors\fP]] | cptfile]
-.br
-This option controls the color scheme used for color
-fill plots.
-
-If \fIcolor_style\fP = 1 [default], then
-the color scheme used will be a continuous grading
-of colors. If \fIcolor_style\fP = 2, the color scheme
-will be a set of discrete color intervals. The color
-palette used is set using \fIpalette\fP. Seven palettes
-are available:
- 	\fIpalette\fP = 1:	Haxby colors [default]
- 	\fIpalette\fP = 2:	high Intensity colors
- 	\fIpalette\fP = 3:	low Intensity colors
- 	\fIpalette\fP = 4:	grayscale
- 	\fIpalette\fP = 5:	uniform grayscale
- 	\fIpalette\fP = 6:	uniform black
- 	\fIpalette\fP = 7:	uniform white
-
-The RGB definitions of the color palettes are:
-
-color palette 1 \- Haxby Color Table
-  red:   255 255 255 255 240 205 138 106  50  40  37
-  green: 255 186 161 189 236 255 236 235 190 127  57
-  blue:  255 133  68  87 121 162 174 255 255 251 175
-
-color palette 2 \- High Intensity Colors
-  red:   255 255 255 255 128   0   0   0   0 128 255
-  green:   0  64 128 255 255 255 255 128   0   0   0
-  blue:    0   0   0   0   0   0 255 255 255 255 255
-
-color palette 3 \- Low Intensity Colors
-  red:   200 194 179 141  90   0   0   0   0  90 141
-  green:   0  49  90 141 179 200 141  90   0   0   0
-  blue:    0   0   0   0   0   0 141 179 200 179 141
-
-color palette 4 \- Grayscale
-  red:   255 230 204 179 153 128 102  77  51  26   0
-  green: 255 230 204 179 153 128 102  77  51  26   0
-  blue:  255 230 204 179 153 128 102  77  51  26   0
-
-color palette 5 \- Uniform Grayscale
-  red:   128 128 128 128 128 128 128 128 128 128 128
-  green: 128 128 128 128 128 128 128 128 128 128 128
-  blue:  128 128 128 128 128 128 128 128 128 128 128
-
-color palette 6 \- Uniform Black
-  red:     0   0   0   0   0   0   0   0   0   0   0
-  green:   0   0   0   0   0   0   0   0   0   0   0
-  blue:    0   0   0   0   0   0   0   0   0   0   0
-
-color palette 7 \- Uniform White
-  red:   255 255 255 255 255 255 255 255 255 255 255
-  green: 255 255 255 255 255 255 255 255 255 255 255
-  blue:  255 255 255 255 255 255 255 255 255 255 255
-
-The Haxby colors have been adapted from a palette
-developed by Dr. William Haxby of the Lamont-Doherty
-Earth Observatory; this palette is pleasing to the
-eye and well suited for shading. The high intensity
-colors describe linear paths through RGB space from
-red to blue to green to purple; because the colors are high
-intensity they are not well suited to shading.
-The low intensity colors are similar to the high
-intensity, but muted and thus well suited to shading.
-The grayscale palette runs linearly from white to
-black and is commonly used for plots of sidescan and amplitude
-data. The uniform grayscale is useful for non-color
-shaded relief plots.
-
-The \fIncolors\fP parameter sets the number of color
-values used in plotting, whether the colors are
-represented in a continuous color scale or a
-stepped, discrete color scale [default is 11].
-
-If the option argument is the path to an existing \fBGMT\fP
-color palette (CPT) file, then that CPT file and its
-color scheme will be used for the plot
-.TP
-.B \-X
-Normally, \fBmbm_grdtiff\fP creates an executable shellscript and
-then exits.  This option will cause the shellscript to be executed
-in the background before \fBmbm_grdtiff\fP exits.
-.TP
-.B \-Y
-Normally, \fBmbm_grdplot\fP generates nicely rounded numbers
-for the boundaries of the color palette. Often, the resulting
-color bounds extend well outside the range of the gridded data.
-This option causes the minimum and maximum color boundaries to
-exactly conform to the minimum and maximum values of the grid,
-or, if the \fB\-Z\fP option is used, the minimum and maximum
-values specified by the user.
-.TP
-.B \-Z
-\fImin/max[/mode]\fP
-.br
-This option overrides the minimum and maximum values of
-the gridded data, affecting the color palette and the
-contour interval if those parameters are not specified
-by the user. By default (i.e. \fImode\fP is omitted
-or equal to 0), the macro selects the color palette bounds
-so that they encompass \fImin\fP and \fImax\fP while using
-nicely rounded numbers. If \fImode\fP is omitted or equal
-to 0, then the color palette will end near \fImin\fP and
-\fImax\fP whether it is linear stretched or histogram equalized.
-If \fImode\fP = 1, then the color stretching calculations
-will be done using \fImin\fP and \fImax\fP, but then the
-first and last values in the color palette will be set to
-the actual minimum and maximum values.so that all the data
-are displayed.
-
-.SH EXAMPLES
-Suppose we have obtained two GRD files,
-one containing gridded bathymetry
-(testbath.grd) and the other mosaiced amplitude
-(testamp.grd).
-In order to generate a color fill TIFF image, we use the \-G1 option.
-Because the data has been gridded as bathymetry (positive
-down) rather than as topography (positive up), the default
-plot will have "hot" colors for deep regions and "cold"
-colors for shallow regions; this is the opposite of the
-convention we usually use. In order to fix the colors, we have
-to either rescale the data by multiplying the bathymetry
-by \-1 (accomplished with \-MGS-1), or flip the color
-palette (accomplished with \-D). We use the latter approach:
-
-  	mbm_grdtiff \-Itestbath.grd \-G1 \-D \\
-  	    \-V \-Obath_fill
-
-In order to generate a grayscale plot of the amplitude mosaic,
-we use \-G1 and \-W1/4. We also use \-D so that high amplitude
-amplitudes are shown as dark.
-
-  	mbm_grdtiff \-Itestamp.grd \-G1 \-D \-W1/4 \\
-  	    \-V \-Oamp_fill
-
-Now consider generating a shaded relief view of the
-gridded bathymetry. We choose to illuminate
-the bathymetry from the northeast (azimuth of 45 degrees)
-and to use a shading magnitude of 0.4 (-A0.4/45).
-We also use
-the \-X flag this so that the plot generation shellscript is
-executed immediately. Here is the command:
-
-  	mbm_grdtiff \-Itestbath.grd \\
-  	    \-G2 \-A0.4/45 \-D \-X \-V \\
-  	    \-Obath_shade
-
-Now, consider generating a plot of the bathymetry
-overlaid with the mosaiced amplitude.
-The amplitude overlay is specified using the \-K option.
-We want the colors for the bathymetry to be chosen without
-histogram equalization, but we also want histogram
-equalization to be applied to the amplitude data used for
-shading. To do this, we use \-S0/1, where the first number
-(0) specifies no histogram equalization of the color
-scale and the second number (1) causes histogram
-equalization of the shading amplitude data to be
-implemented. In order to maintain the convention that
-high amplitude amplitudes are black, we flip both the
-color palette (as in the previous example) and the
-shading scale with \-D1/1. We could also flip the shading
-by specifying a negative shading magnitude (-A-0.4).
-
-  	mbm_grdtiff \-Itestbath.grd \\
-  	    \-G3 \-Ktestamp.grd \\
-  	    \-S0/1 \-D1/1 \-A0.4 \-X \-V \\
-  	    \-Obath_amp
-
-As an example, the contents of the plotting shellscript
-"bath_fill_tiff.cmd" are:
-
-.br
-#! /bin/csh \-f
-.br
-#
-.br
-# Shellscript to create TIFF image of data in grd file
-.br
-# Created by macro mbm_grdtiff
-.br
-#
-.br
-# This shellscript created by following command line:
-.br
-# mbm_grdtiff \-Itestbath.grd \-G1 \-D \-V \-Obath_fill
-.br
-#
-.br
-# Define shell variables used in this script:
-.br
-set TIFF_FILE       = bath_fill.tif
-.br
-set CPT_FILE        = bath_fill.cpt
-.br
-set MAP_REGION      = \-49.28/-49.13/12.05/12.2
-.br
-#
-.br
-# Save existing GMT defaults
-.br
-echo Saving GMT defaults...
-.br
-gmtdefaults \-L > gmtdefaults$$
-.br
-#
-.br
-# Set new GMT defaults
-.br
-echo Setting new GMT defaults...
-.br
-gmtset COLOR_BACKGROUND 0/0/0
-.br
-gmtset COLOR_FOREGROUND 255/255/255
-.br
-gmtset COLOR_NAN 255/255/255
-.br
-gmtset DEGREE_FORMAT 3
-.br
-#
-.br
-# Make color palette table file
-.br
-echo Making color palette table file...
-.br
-echo  \-5250 255 255 255  \-5100 255 186 133 > $CPT_FILE
-.br
-echo  \-5100 255 186 133  \-4950 255 161  68 >> $CPT_FILE
-.br
-echo  \-4950 255 161  68  \-4800 255 189  87 >> $CPT_FILE
-.br
-echo  \-4800 255 189  87  \-4650 240 236 121 >> $CPT_FILE
-.br
-echo  \-4650 240 236 121  \-4500 205 255 162 >> $CPT_FILE
-.br
-echo  \-4500 205 255 162  \-4350 138 236 174 >> $CPT_FILE
-.br
-echo  \-4350 138 236 174  \-4200 106 235 255 >> $CPT_FILE
-.br
-echo  \-4200 106 235 255  \-4050  50 190 255 >> $CPT_FILE
-.br
-echo  \-4050  50 190 255  \-3900  40 127 251 >> $CPT_FILE
-.br
-echo  \-3900  40 127 251  \-3750  37  57 175 >> $CPT_FILE
-.br
-#
-.br
-# Define data files to be plotted:
-.br
-set DATA_FILE        = testbath.grd
-.br
-set INTENSITY_FILE   =
-.br
-#
-.br
-# Make tiff image
-.br
-echo Running mbgrdtiff...
-.br
-mbgrdtiff \-I $DATA_FILE \
-.br
-	-O $TIFF_FILE \
-.br
-	-C $CPT_FILE \
-.br
-	-V
-.br
-#
-.br
-# Delete surplus files
-.br
-echo Deleting surplus files...
-.br
-/bin/rm \-f $CPT_FILE
-.br
-#
-.br
-# Reset GMT default fonts
-.br
-echo Resetting GMT fonts...
-.br
-/bin/mv gmtdefaults$$ .gmtdefaults
-.br
-#
-.br
-# Run xv
-.br
-echo Running xv in background...
-.br
-xv bath_fill.tif &
-.br
-#
-.br
-# All done!
-.br
-echo All done!
-.br
-
-.SH SEE ALSO
-\fBmbsystem\fP(1), \fBmbm_grdplot\fP(1), \fBmbgrid\fP(1), \fBmbmosaic\fP(1),
-\fBmbm_grid\fP(1), \fBmbgrdtiff\fP(1), \fBgmt\fP(1)(1), \fBgrdimage\fP(1)
-
-.SH BUGS
-This macro either has too many options, or not enough
-options. You choose.
diff --git a/src/man/man1/mbm_grid.1 b/src/man/man1/mbm_grid.1
deleted file mode 100644
index b2277c4..0000000
--- a/src/man/man1/mbm_grid.1
+++ /dev/null
@@ -1,522 +0,0 @@
-.TH mbm_grid 1 "3 June 2013" "MB-System 5.0" "MB-System 5.0"
-.SH NAME
-\fBmbm_grid\fP \- Create an executable shellscript which will generate
-a grid (bathymetry or topography) or mosaic (amplitude or sidescan)
-of swath sonar swath data.
-
-.SH VERSION
-Version 5.0
-
-.SH SYNOPSIS
-mbm_grid \fB\-I\fP\fIfile\fP
-\fB\-F\fP\fIformat\fP \fB\-O\fP\fIroot\fP
-\fB\-R\fP\fIwest/east/south/north\fP
-[\fB\-A\fP\fIdatatype\fP \fB\-B\fP\fIborder\fP \fB\-C\fP\fIclip\fP
-\fB\-D\fP\fIxdim/ydim\fP \fB\-E\fP\fIdx/dy/units\fP
-{\fB\-f\fP\fIpriority_range\fP | \fB\-f\fP\fImode\fP}
-\fB\-G\fP\fIgridkind\fP \fB\-H\fP
-\fB\-J\fP\fIprojection\fP \fB\-K\fIbackground\fP
-\fB\-L\fP\fIlonflip\fP \fB\-M\fP \fB\-N\fP \fB\-P\fP\fIpings\fP
-\fB\-S\fP\fIspeed\fP \fB\-T\fP\fItension\fP
-\fB\-U\fP\fI{azimuth/factor | time}\fP
-\fB\-V\fP \fB\-W\fP\fIscale\fP \fB\-X\fP\fIextend\fP
-\fB\-Y\fP\fIpriority_file\fP \fB\-Z\fP\fIbathdef\fP]
-
-.SH DESCRIPTION
-\fBmbm_grid\fP is a macro to generate a shellscript of MB-System commands
-which, when executed, will generate a grid or mosaic of the
-specified swath sonar data. The grid or mosaic may be of
-bathymetry (positive down, \fB\-A\fP\fI1\fP),
-topography (positive up, \fB\-A\fP\fI2\fP),
-amplitude (\fB\-A\fP\fI3\fP), or sidescan data (\fB\-A\fP\fI4\fP).
-The primary purpose of this
-macro is to allow the simple, semi-automated production of
-grids and mosaics with a few command line arguments. The macro
-can determine the area covered by the swath data and set the
-grid bounds and dimensions accordingly. For users
-seeking more control over the grid and mosaic parameters,
-almost the full suite of mbgrid and mbmosaic commands are supported.
-See the manual pages for \fBmbgrid\fP and \fBmbmosaic\fP for
-complete explanations of how these programs work.
-
-By default, \fBmbgrid\fP and \fBmbmosaic\fP generate grids in Geographic coordinates,
-meaning that position is defined in longitude and latitude using
-the WGS84 horizontal datum. The \fB\-J\fP option can be used to specify
-an alternate, projected coordinate system (PCS). When a PCS is used,
-position will be defined in eastings and northings (meters) relative
-to the origin of the particular PCS. Universal Transverse Mercator
-is the most commonly used PCS in the oceanographic community, but
-\fBmbgrid\fP supports a large number of other PCS as well. A list of
-the supported PCS's is provided at the end of the \fBmbgrid\fP and
-\fBmbmosaic\fP manual pages.
-
-.SH AUTHORSHIP
-David W. Caress (caress at mbari.org)
-.br
-  Monterey Bay Aquarium Research Institute
-.br
-Dale N. Chayes (dale at ldeo.columbia.edu)
-.br
-  Lamont-Doherty Earth Observatory
-
-.SH OPTIONS
-.TP
-.B \-A
-\fIdatatype\fP
-.br
-Sets the type of data to be read and gridded or mosaiced.
-If \fIdatatype\fP = 1,
-bathymetry data will be gridded (positive downwards).
-If \fIdatatype\fP = 2,
-bathymetry data will be gridded as topography (positive upwards).
-If \fIdatatype\fP = 3,
-amplitude data will be mosaiced.  If \fIdatatype\fP = 4,
-sidescan data will be mosaiced.
-Default: \fIdatatype\fP = 1 (bathymetry).
-.TP
-.B \-B
-\fIborder\fP
-.br
-Sets the border of a smoothly interpolated grid
-to the value \fIborder\fP
-wherever no data exist, provided \fIborder\fP > 0.0.
-Default: \fIborder\fP = 0.0
-.TP
-.B \-C
-\fIclip\fP
-.br
-Sets the clipping dimension for the spline interpolation. If \fIclip\fP=0
-no spline interpolation will be done.  If \fIclip\fP>0
-.TP
-.B \-K
-\fIbackground\fP
-.br
-Enables filling in all undefined grid cells with bathymetry or topography
-from a global or regional database accessed with the \fBGMT\fP program
-\fBgrdraster\fP. The \fIbackground\fP specifies which locally defined
-database is accessed with \fBgrdraster\fP.
- then the spline
-interpolation will fill data gaps to a distance of \fIclip\fP times
-the grid spacing.
-Default: \fIclip\fP = 0.
-.TP
-.B \-D
-\fIxdim/ydim\fP
-.br
-Sets the dimensions of the output grid.
-This option is superceded
-if the user specifies the grid spacing with the \fB\-E\fP option.
-Default:  \fIxdim\fP = \fIydim\fP = 101.
-.TP
-.B \-E
-\fIdx/dy/units\fP
-.br
-Sets the grid cell spacing to \fIdx\fP in longitude and \fIdy\fP
-in latitude. If \fIunits\fP is not specified, the \fIdx\fP
-and \fIdy\fP values are assumed to be in meters. Valid values
-for \fIunits\fP include "km", "meters", and "degrees".
-By default, the grid spacing is calculated from
-the grid bounds and the grid dimensions. When the user
-uses the \fB\-E\fP option to set the grid spacing, the
-grid dimensions are calculated using the grid bounds and
-grid cell spacings. However, slight adjustments to the
-grid cell spacing values are usually required to keep
-the grid bounds as specified.
-.TP
-.B \-F
-\fIformat\fP
-.br
-Sets the data format for the input data.
-If \fIformat\fP < 0, then the input file specified
-with the \fB\-I\fP option will actually contain a list of input swath sonar
-data files. This program uses the \fBMBIO\fP library
-and will read or write any swath sonar
-format supported by \fBMBIO\fP. A list of the swath sonar data formats
-currently supported by \fBMBIO\fP and their identifier values
-is given in the \fBMBIO\fP manual page. Default: \fIformat\fP = \-1.
-.TP
-.B \-f
-\fImode\fP
-.br
-Sets the gridding algorithm to be used by \fBmbgrid\fP for bathymetry
-(\fB\-A\fP\fI1\fP) or topography c data.
- 	\fImode\fP = 1:         Gaussian Weighted Mean
- 	\fImode\fP = 2:         Median Filter
- 	\fImode\fP = 3:         Minimum Filter
- 	\fImode\fP = 4:         Maximum Filter
-The default is \fImode\fP = 1 (Gaussian Weighted Mean).
-.TP
-.B \-f
-\fIpriority_range\fP
-.br
-Turns on Gaussian weighted mean mosaicing in \fBmbmosaic\fP
-for amplitude (\fB\-A\fP\fI3\fP) or sidescan (\fB\-A\fP\fI4\fP) data. The
-\fIpriority_range\fP value determines which data points are
-used in the mosaicing. The minimum priority threshold for
-each bin is the highest priority value found among the
-samples in that bin minus the \fIpriority_range\fP value.
-Only samples with priorities greater than this threshold
-are used in the Gaussian weighted mean mosaicing.
-The default is to simply set each bin's value equal to the
-value of the highest priority sample in that bin.
-.TP
-.B \-G
-\fIgridkind\fP
-.br
-Sets the format of the output grid file.
- 	\fIgridkind\fP = 1:	Ascii table
- 	\fIgridkind\fP = 2:	binary file (GMT version 1 GRD file)
- 	\fIgridkind\fP = 3:	netCDF file (GMT version 2 GRD file)
-.br
-If \fIgridkind\fP = 3, \fBmbgrid\fP also outputs shellscripts
-which run GMT version 3 programs to provide preliminary color
-fill maps of the gridded data. These shellscripts are
-generated using the \fBmbm_grdplot\fP macro.
-Default: \fIgridkind\fP = 3.
-.TP
-.B \-H
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-.TP
-.B \-I
-\fIfilename\fP
-.br
-Sets the input filename. If \fIformat\fP > 0 (set with the
-\fB\-f\fP option) then the swath sonar data contained in \fIinfile\fP
-is read and processed. If \fIformat\fP < 0 (the default),
-then \fIinfile\fP
-is assumed to be an ascii file containing a list of the input swath sonar
-data files to be processed and their formats.  The program will read
-the data in each one of these files.
-In the \fIinfile\fP file, each
-data file should be followed by a data format identifier, e.g.:
- 	datafile1 11
- 	datafile2 24
-.br
-This program uses the \fBMBIO\fP library and will read or write any swath sonar
-format supported by \fBMBIO\fP. A list of the swath sonar data formats
-currently supported by \fBMBIO\fP and their identifier values
-is given in the \fBMBIO\fP manual page.
-.TP
-.B \-J
-\fIprojection\fP
-By default, \fBmbgrid\fP and \fBmbmosaic\fP generate grids in Geographic coordinates,
-meaning that position is defined in longitude and latitude using
-the WGS84 geographic coordinate system.
-The \fB\-J\fP option can be used to specify
-an alternate, projected coordinate system (PCS). When a PCS is used,
-position will be defined in eastings and northings (meters) relative
-to the origin of the particular PCS. Universal Transverse Mercator
-is the most commonly used PCS in the oceanographic community, but
-\fBmbgrid\fP supports a large number of other PCS's as well.
-The underlying projection functions derive from the \fBPROJ.4\fP library
-written by Gerald Evenden, then of the U.S. Geological Survey.
-
-The \fIprojection\fP argument for the \fB\-J\fP option can be either
-a PCS identifier from the projection definition list provided at the
-end of this manual page, or simply \fB\-J\fP\fIU\fP to specify using
-UTM in whatever zone is appropriate for the grid bounds specified
-with the \fB\-R\fP option.
-
-For instance, to fully specify a particular northern UTM
-zone, set \fIprojection\fP = UTMXXN where XX gives
-the UTM zone (defined from 01 to 60). As an example, a northern UTM
-zone 12 projection can be specified using \fB\-J\fP\fIUTM12N\fP.
-Southern UTM zones are specified as UTMXXS. The European Petroleum
-Survey Group (EPSG) has defined a large number of PCS's used worldwide
-and assigned number id's to each; one can also specify the northern
-UTM zone 12 projection using its EPSG designation,
-or \fB\-J\fP\fIepsg32612\fP.
-When the projected coordinate system is fully specified
-by the \fB\-J\fP option, then the grid bounds may be specified using
-\fB\-R\fP in either longitude and latitude or in eastings and northings.
-
-Alternatively, one may indicate a UTM projection without specifying the
-zone by using \fB\-J\fP\fIU\fP. In this case, the
-UTM zone will be inferred from the midpoint of the
-specified longitude and latitude bounds, and then the
-longitude and latitude bounds given with the
-\fB\-fR\fP option are translated to UTM eastings and northings.
-
-All grids and mosaics produced by \fBMB-System\fP
-programs contain identifiers that are recognized
-by the plotting macros \fBmbm_grdplot\fP,
-\fBmbm_grd3dplot\fP, and \fBmbm_grdtiff\fP.
-These plotting macros automatically use a
-linear map projection whenever they
-encounter grids and mosaics that are already
-in a projected coordinate system. Also, the program \fBmbgrdtiff\fP
-automatically inserts the appropriate projection information into
-the GeoTIFF images it generates. As a result, images generated by
-\fBmbgrdtiff\fP will be properly georeferenced when they are imported
-into GIS software.
-.TP
-.B \-K
-\fIbackground\fP
-.br
-The \fB\-K\fP\fIbackground\fP option is used to underlay a bathymetry or topography
-grid with a global or regional topography model. The background data
-model is accessed from a database using the \fBGMT\fP program grdraster.
-The \fIbackground\fP value is an identifier number used to specify which
-dataset to extract using \fBgrdraster\fP. These identifiers are user
-defined and vary with installations. When the \fB\-K\fP\fIbackground\fP
-option is invoked, \fBgrdraster\fP is used to extract all of the longitude,
-latitude, and topography values within the specified database that lie
-within the desired grid. These values are interpolated onto the desired
-grid locations using the thin plate spline algorithm, and then mapped onto
-the grid wherever the values are undefined by either swath data or the
-spline interpolation invoked with the \fB\-C\fP option.
-
-.TP
-.B \-L
-\fIlonflip\fP
-.br
-Sets the range of the longitude values returned.
-If \fIlonflip\fP=\-1 then the longitude values will be in
-the range from \-360 to 0 degrees. If \fIlonflip\fP=0
-then the longitude values will be in
-the range from \-180 to 180 degrees. If \fIlonflip\fP=1
-then the longitude values will be in
-the range from 0 to 360 degrees.
-Default: \fIlonflip\fP = 0.
-.TP
-.B \-M
-Causes two additional grids to be output. One is a grid containing
-the standard deviation of the data within each grid cell relative
-to the grid value, the other contains the number of data
-points in each grid cell. This option is ignored when the minimum
-or maximum filter gridding algorithms are used (see the \fP-F\fP option).
-.TP
-.B \-N
-Causes grid cells with no data and no interpolation to be set to a
-value of NaN instead of the default value of 99999.9.  The NaN value
-is expected by \fBGMT\fP programs such \fBgrdview\fP.
-.TP
-.B \-O
-\fIroot\fP
-.br
-Sets the character string to be used as the root of the
-output filenames. For example, if the grid is output as a GMT
-version 2 GRD format (netCDF) file (the default),
-then its filename is "root.grd". If the
-\fB\-G\fP\fI1\fP option is used to specify an ascii format grid, then the
-output grid filename will be "root.asc". If the
-\fB\-G\fP\fI2\fP option is used to specify a version 1 GRD
-format (binary) grid, then the
-output grid filename will be "root.grd1". If the output grid is
-in the GMT version 2 GRD format, a shellscript
-which will allow the contents of the grid to viewed using GMT programs
-is also output with the filename "root.grd.cmd".
-.TP
-.B \-P
-\fIpings\fP
-Sets the ping averaging of the input data. If \fIpings\fP > 0, then
-that number of input pings will be averaged to produce one output
-ping.  If \fIpings\fP = 0, then the ping averaging will automatically
-be done so that the along-track ping spacing is equal to the across-track
-beam spacing. Default: \fIpings\fP = 1.
-.TP
-.B \-Q
-Normally, bathymetry or topography data is gridded in meters. If
-this option is used, bathymetry or topography data is gridded
-in feet.
-.TP
-.B \-R
-\fIwest/east/south/north\fP
-.br
-Sets the longitude and latitude bounds of the output grid. If the user
-uses the \fB\-E\fP option to set the grid spacing, then the dimensions
-will be calculated from the grid bounds and spacing. In these
-circumstances rounding errors will usually require that the eastern
-and northern bounds be adjusted to fit exactly with the
-grid dimensions and spacing.
-.TP
-.B \-S
-\fIspeed\fP
-.br
-Sets the minimum speed in km/hr (5.5 kts ~ 10 km/hr) allowed in
-the input data; pings associated with a smaller ship speed will not be
-output. Default: \fIspeed\fP = 0.
-.TP
-.B \-T
-\fItension\fP
-.br
-Sets the \fItension\fP value used in the thin plate spline interpolation.
-
-A \fItension\fP of 0 gives a minimum curvature surface with free edges;
-this is a pure Laplacian solution. A nonzero \fItension\fP tends to
-suppress spurious oscillations and flatten
-the interpolation toward the edges; a \fItension\fP of infinity
-yields a pure spline solution. The \fItension\fP must be zero or
-greater.
-Default: \fItension\fP = 1.0e10 (pure spline solution).
-.TP
-.B \-U
-\fItime\fP
-.br
-Forces \fBmbgrid\fP to avoid averaging overlapping swaths by
-ignoring the data from later swaths. "Later" data is identified
-using the \fItime\fP value. The time of the first data point
-is saved for each bin in the grid; any other data points which
-are more than \fItime\fP minutes before or after the initial
-data point in the relevent bin are ignored. If \fItime\fP is
-negative, the last data in a bin (within the time lag criterea)
-will be saved and used instead of the first data.
-.TP
-.B \-U
-\fIazimuth/factor\fP
-.br
-Enables prioritizing data points according to their look azimuth
-(data on the port side of the swath have
-a look azimuth equal to the heading \- 90 degrees, and data on the
-starboard side have a look azimuth equal to the heading + 90 degrees).
-Here \fIazimuth\fP is the preferred look azimuth, and \fIfactor\fP
-modulates how rapidly the priority degrades away from the preferred
-look azimuth. The priority (p) for a data point is assigned as follows:
-        p = cos(f * (Ap \- Al))
-.br
-when \-90 < (f * (Ap \- Al)) < 90 and
-        p = 0
-.br
-otherwise, where f = \fIfactor\fP, Ap = \fIazimuth\fP, and Al is the
-look azimuth of the data point.
-If \fIfactor\fP = 1.0, the priority will be 1.0
-at \fIazimuth\fP and will fall to zero for look
-azimuths more than 90 degrees away from \fIazimuth\fP.
-If \fIfactor\fP > 1.0, the range of nonzero priorities will shrink
-to azimuths closer to \fIazimuth\fP (e.g. if \fIfactor\fP = 2.0,
-nonzero priorities will be restricted to look azimuths within
-45 degrees of \fIazimuth\fP). If \fIfactor\fP < 1.0, the
-range of nonzero priorities will expand (e.g. if \fIfactor\fP = 0.5, only
-look azimuths 180 degrees away from \fIazimuth\fP
-will have a zero priority).
-.TP
-.B \-V
-The \fB\-V\fP option causes \fBmbm_grid\fP to print out statements
-indicating its progress.
-.TP
-.B \-W
-\fIscale\fP
-.br
-Sets the width of the gaussian weighting function in terms of
-the grid spacing.  The distance to the 1/e point of the weighting
-function is given by half of the grid spacing times \fIscale\fP.
-Default: \fIscale\fP = 1.0
-.TP
-.B \-X
-\fIextend\fP
-.br
-Extends the size of the internal grid so that the output grid is a
-subset from the center of a larger grid.   This allows data outside
-the output grid to guide the spline interpolation of data gaps which
-happen to lie at the the edge of the output grid.  The amount of
-extension is \fIextend\fP times the grid width/height to each side.
-Thus, if \fIextend\fP=1.0, then the internal grid will have dimensions
-three times the output grid.
-Default: \fIextend\fP = 0.0
-.TP
-.B \-Y
-\fIpriority_file\fP
-.br
-Enables priortization of data points based on their apparent
-grazing angle (this angle is the
-arctan(x/z) where x is acrosstrack distance and z is depth, so
-that the center of the swath has an apparent grazing angle of
-zero, the port swath edge has a large negative angle, and the
-starboard swath edge has a large positive angle). The file
-\fIpriority_file\fP must contain a list of data priorities
-as a function of apparent grazing angle. The first line of
-the file should contain the minimum, or port-most grazing angle
-followed by the associated priority. The following lines
-should contain increasingly large grazing angles (and associated
-priorities) up to the maximum, or starboard-most, grazing angle.
-The highest priority assigned should be one, and the lowest zero.
-Priorities for grazing angles less than the minimum or greater
-than the maximum will be zero. See the examples below for a
-further explanation of the use of \fIpriority_file\fP.
-.TP
-.B \-Z
-\fIbath_default\fP
-.br
-Sets the default depth used for calculating grazing angles for
-amplitude or sidescan values where depths are not available.
-Default: \fIscale\fP = 1000.0
-
-.SH EXAMPLES
-Suppose we have obtained a swath sonar data file called
-example_hs.mb24 collected using a SeaBeam 2112 sonar.
-This file contains bathymetry, beam amplitude, and
-sidescan data. In order to obtain a first cut bathymetry
-grid and first cut amplitude and sidescan mosaics, we
-use \fBmbm_grid\fP to generate shellscripts which in turn
-run \fBmbgrid\fP or \fBmbmosaic\fP to generate grids and mosaics.
-The following four commands generate gridding shellscripts
-for bathymetry, topography, amplitude, and sidescan,
-respectively:
-
- 	mbm_grid \-F24 \-I example_hs.mb24 \\
-		-A1 \-V \-Obath
- 	mbm_grid \-F24 \-I example_hs.mb24 \\
- 		-A2 \-V \-Otopo
- 	mbm_grid \-F24 \-I example_hs.mb24 \\
- 		-A3 \-V \-Oamp
- 	mbm_grid \-F24 \-I example_hs.mb24 \\
- 		-A4 \-V \-Oss
-
-When the following shellscripts are executed, each will
-generate a both a grid (or mosaic) file and an additional
-shellscript which in turn will (when run) generate and display a
-postscript plot file:
-
- 	bath_mbgrid.cmd
- 	topo_mbgrid.cmd
- 	amp_mbmosaic.cmd
- 	ss_mbmosaic.cmd
-
-The program \fBmbinfo\fP is executed by \fBmbm_grid\fP
-to obtain the file statistics used to determine the grid
-bounds and bin size. The macro \fBmbm_grdplot\fP is executed
-by \fBmbgrid\fP or \fBmbmosaic\fP to generate the initial
-plots of the gridded data.
-
-As an example, the contents of the gridding shellscript
-"bath_mbgrid.cmd" are:
-
- #! /bin/csh \-f
- #
- # Shellscript to grid or mosaic swath sonar data
- # Created by macro mbm_grid
- #
- # This shellscript created by following command line:
- # mbm_grid \-F24 \-I example_hs.mb24 \-A1 \-V \-Obath
- #
- # Define shell variables used in this script:
- set REGION       = \-49.316085/-49.096415/12.06972/12.18588
- set INPUT_FILE   = example_hs.mb24
- set INPUT_FORMAT = 24
- set ROOT         = bath
- #
- # Make datalist file
- echo Making datalist file...
- echo $INPUT_FILE $INPUT_FORMAT >! datalist$$
- #
- # Run mbgrid
- echo Running mbgrid...
- mbgrid \-Idatalist$$ \\
- 	-R$REGION \\
-  	-O$ROOT \\
- 	-A1 \-N \\
-  	-E363.3/363.3/meters \\
- #
- # All done!
- echo All done!
-
-.SH SEE ALSO
-\fBmbsystem\fP(1), \fBmbgrid\fP(1),
-\fBmbmosaic\fP(1), \fBmbinfo\fP(1),
-\fBmbm_grdplot\fP(1)
-
-.SH BUGS
-This macro is new and hasn't been tested in serious
-usage yet \- let us know what to fix, add, or
-change!.
diff --git a/src/man/man1/mbm_histplot.1 b/src/man/man1/mbm_histplot.1
deleted file mode 100644
index 5dae6c9..0000000
--- a/src/man/man1/mbm_histplot.1
+++ /dev/null
@@ -1,329 +0,0 @@
-.TH mbm_histplot 1 "9 January 2015" "MB-System 5.0" "MB-System 5.0"
-.SH NAME
-\fBmbm_histplot\fP \- Create an executable shellscript which will generate
-a GMT histogram plot of a dataset.
-
-.SH VERSION
-Version 5.0
-
-.SH SYNOPSIS
-\fBmbm_histplot\fP \fB\-I\fP\fIfile\fP
-[\fB\-G\fP\fIfill\fP \fB\-H\fP
-\fB\-O\fP\fIroot\fP \fB\-P\fP\fIpagesize\fP
-\fB\-U\fP\fIorientation\fP \fB\-V\fP
-\fB\-W\fP\fIpen\fP ]
-
-Additional Options:
-.br
-[\fB\-B\fP\fItickinfo\fP \fP
-\fB\-J\fP\fIprojection\fP[\fI/scale | width\fP]
-\fB\-L\fP\fItitle\fP[\fI:xlabel:ylabel\fP] \fB\-M\fP\fImisc\fP
-\fB\-Q\fP \fB\-R\fP\fIw/e/s/n\fP \fB\-X\fP \fB\-Z\fP]
-
-.SH DESCRIPTION
-\fBmbm_histplot\fP is a macro to generate a shellscript of
-GMT commands which, when executed, will generate a Postscript
-histogram plot of a set of data values.
-The plot will be scaled to fit on the specified page size
-or, if the scale is user defined, the page size will be
-chosen in accordance with the plot size. The primary purpose
-of this macro is to allow the simple, semi-automated
-production of nice looking plots with a few command line
-arguments. For users seeking more control over the plot
-appearance, a number of additional optional arguments are
-provided. Truly ambitious users may edit the plot shellscript
-to take advantage of GMT capabilities not supported by this
-macro.
-
-By default the output plot generation shellscript
-includes lines which execute a program to display the Postscript
-image on the screen. The program to be used to display the Postscript
-is set using \fBmbdefaults\fP; the default value can be overridden
-by setting the environment variable $MB_PS_VIEWER.
-Invoking the plot generation shellscript with
-a \fB-N\fP command line argument suppresses the screen
-display of the plot.
-
-The plot scripts generated by this macro will work with
-GMT version 5.0 and later, and are not compatible with
-earlier versions of GMT.
-
-.SH AUTHORSHIP
-David W. Caress (caress at mbari.org)
-.br
-  Monterey Bay Aquarium Research Institute
-.br
-Dale N. Chayes (dale at ldeo.columbia.edu)
-.br
-  Lamont-Doherty Earth Observatory
-.br
-Suzanne H. O'Hara (sohara at ldeo.columbia.edu)
-.br
-  Lamont-Doherty Earth Observatory
-
-.SH OPTIONS
-.TP
-.B \-B
-\fItickinfo\fP
-.br
-Sets map boundary tickmark intervals. See the \fBpsbasemap\fP
-manual page for details. By default the program chooses
-basemap annotations based on the map boundaries.
-.TP
-.B \-C
-\fIcellwidth\fP
-.br
-Sets the width of the cells into which the data are binned to form
-the histogram. The default is use a cell width that is 1/10 the
-data range.
-.TP
-.B \-G
-\fIfill\fP
-.br
-Select filling of the histogram.
-Set the shade (0-255) or color
-(r/g/b) [Default is a light gray]. To reset no fill,
-use \fIfill\fP = "N".
-You may optionally specify
-\fB\-Gp\fP\fIicon_size/pattern\fP, where
-\fIpattern\fP gives the number of the
-image pattern (1-32) OR the name of a
-icon-format file.  \fIicon_size\fP sets
-the unit size in inch.
-To invert black and white pixels, use
-\fB\-GP\fP instead of \fB\-Gp\fP.  See
-\fBGMTs\fP Cookbook & Technical Reference
-Appendix E for information on individual patterns.
-.TP
-.B \-H
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-.TP
-.B \-I
-\fI[filepars:]xy_file\fP
-.br
-
-Specifies the file containing the data to be plotted in a
-histogram. A single column of data is expected.
-.TP
-.B \-J
-\fIprojection\fP[\fI/width/height\fP]
-.br
-Sets the plot scale. The projection is linear (\fB\-J\fP\fIX), and
-the user can optionally specify the width and height.
-.TP
-.B \-L
-\fItitle[:xlabel[:ylabel]]\fP
-.br
-Sets the title and the labels for the x and y axes of
-the plot. Note that a colon (:) rather than a slash (/) is
-used to separate the labels. Colons cannot be used in the
-labels themselves. If this option is not used, then a default title
-and colorscale label are provided. If the title is supplied
-alone, no x or y-axis labels will be provided.
-.TP
-.B \-O
-\fIroot\fP
-.br
-Sets the root used to construct the filename of the output shellscript
-(\fIroot\fP.cmd) and names of files created when the shellscript is
-run.  Normally the
-name of the input grid file or grid file list is
-used as the \fIroot\fP.
-.TP
-.B \-P
-\fIpagesize\fP
-.br
-This option sets the size of the page the plot will be centered
-on. If the user does not set the plot scale, the plot will be
-sized as large as will fit on the designated page. If the user
-sets the plot scale such that the plot will not fit on the
-designated page, a larger page will be used.
-The supported page sizes are:
-
-          American ANSI sizes:
-          A     8.5 x 11.0 in.    ( 215.9 x  279.4 mm)
-          B    11.0 x 17.0 in.    ( 279.4 x  431.8 mm)
-          C    17.0 x 22.0 in.    ( 431.8 x  558.8 mm)
-          D    22.0 x 34.0 in.    ( 558.8 x  863.6 mm)
-          E    34.0 x 44.0 in.    ( 863.6 x 1117.6 mm)
-          F    28.0 x 40.0 in.    ( 711.2 x 1016.0 mm)
-          E1   44.0 x 68.0 in.    (1117.6 x 1727.2 mm)
-
-          Metric ISO A sizes:
-          A0   841.0 x 1189.0 mm  (33.11 x 46.81 in.)
-          A1   594.0 x  841.0 mm  (23.39 x 33.11 in.)
-          A2   420.0 x  594.0 mm  (16.54 x 23.39 in.)
-          A3   297.0 x  420.0 mm  (11.69 x 16.54 in.)
-          A4   210.0 x  297.0 mm  ( 8.27 x 11.69 in.)
-          A5   148.0 x  210.0 mm  ( 5.83 x  8.27 in.)
-          A6   105.0 x  148.0 mm  ( 4.13 x  5.83 in.)
-          A7    74.0 x  105.0 mm  ( 2.91 x  4.13 in.)
-          A8    52.0 x   74.0 mm  ( 2.05 x  2.91 in.)
-          A9    37.0 x   52.0 mm  ( 1.46 x  2.05 in.)
-          A10   26.0 x   37.0 mm  ( 1.02 x  1.46 in.)
-
-          Metric ISO B sizes:
-          B0   1000.0x 1414.0 mm  (39.37 x 55.67 in.)
-          B1   707.0 x 1000.0 mm  (27.83 x 39.37 in.)
-          B2   500.0 x  707.0 mm  (19.68 x 27.83 in.)
-          B3   353.0 x  500.0 mm  (13.90 x 19.68 in.)
-          B4   250.0 x  353.0 mm  ( 9.84 x 13.90 in.)
-          B5   176.0 x  250.0 mm  ( 6.93 x  9.84 in.)
-          B6   125.0 x  176.0 mm  ( 4.92 x  6.93 in.)
-          B7    88.0 x  125.0 mm  ( 3.46 x  4.92 in.)
-          B8    62.0 x   88.0 mm  ( 2.44 x  3.46 in.)
-          B9    44.0 x   62.0 mm  ( 1.73 x  2.44 in.)
-          B10   31.0 x   44.0 mm  ( 1.22 x  1.73 in.)
-
-          Metric ISO C sizes:
-          C0   914.4 x 1300.5 mm  (36.00 x 51.20 in.)
-          C1   650.2 x  914.4 mm  (25.60 x 36.00 in.)
-          C2   457.2 x  650.2 mm  (18.00 x 25.60 in.)
-          C3   325.1 x  457.2 mm  (12.80 x 18.00 in.)
-          C4   228.6 x  325.1 mm  ( 9.00 x 12.80 in.)
-          C5   162.6 x  228.6 mm  ( 6.40 x  9.00 in.)
-          C6   114.3 x  162.6 mm  ( 4.50 x  6.40 in.)
-          C7    81.3 x  114.3 mm  ( 3.20 x  4.50 in.)
-
-	  MB-System large format sizes:
-          m1  1371.6 x 1828.8 mm  (54.00 x 72.00 in.)
-          m2  1371.6 x 2133.6 mm  (54.00 x 84.00 in.)
-          m3  1371.6 x 2438.4 mm  (54.00 x 96.00 in.)
-          m4  1524.0 x 1828.8 mm  (60.00 x 72.00 in.)
-          m5  1524.0 x 2133.6 mm  (60.00 x 84.00 in.)
-          m6  1524.0 x 2438.4 mm  (60.00 x 96.00 in.)
-
-The default page size is A.
-.TP
-.B \-Q
-Normally, the output plot generation shellscript
-includes lines which execute
-a program to display the Postscript image on the screen.
-This option causes those lines to be commented out so
-that executing the shellscript produces a Postscript plot
-but does not attempt to display it on the screen.
-Alternatively, invoking the plot generation shellscript with
-a \fB-N\fP command line argument also suppresses the screen
-display of the plot. The program
-to be used to display the Postscript is set
-using \fBmbdefaults\fP;
-the default value can be overridden by setting the environment
-variable $MB_PS_VIEWER.
-.TP
-.B \-R
-\fIwest/east/south/north\fP
-.br
-\fIwest, east, south,\fP and \fInorth\fP specify the Region of interest. [Default is
-the range of the data and the histogram distribution].
-.TP
-.B \-U
-\fIorientation\fP
-.br
-Normally the orientation of the plot (portrait or landscape)
-is selected automatically so as to maximize the plot scale.
-The \fB\-U\fP option allows the user to set the plot orientation. If
-\fIorientation\fP = 1, a portrait plot will be produced; if
-\fIorientation\fP = 2, a landscape plot will be produced.
-.TP
-.B \-V
-Causes \fBmbm_histplot\fP to operate in "verbose" mode
-so that it outputs
-more information than usual.
-.TP
-.B \-W
-\fIpen\fP
-.br
-Set pen attributes for plotting. See chapter 4.12 in the
-GMT Technical reference for a discussion of GMT pen values.
-[Defaults: width = 1, color = 0/0/0,
-texture = solid].
-.TP
-.B \-X
-Normally, \fBmbm_histplot\fP creates an executable shellscript and
-then exits.  This option will cause the shellscript to be executed
-in the background before \fBmbm_histplot\fP exits.
-
-.SH EXAMPLES
-Suppose we have a single column ascii file of time lag estimates called
-timelag.dat. In order to generate a 6 inch wide and 4 inches high
-simple histogram plot of these data, use:
-.br
-	mbm_histplot \-Itimelag.dat \-Otimelaghist \-JX6/4 \-V
-to generate a GMT plot shellscript called timelaghist.cmd.
-
-As an example, the contents of the plotting shellscript
-"timelaghist.cmd" are:
-
-#! /bin/csh \-f
-#
-# Shellscript to create Postscript plot of data in grd file
-# Created by macro mbm_histplot
-#
-# This shellscript created by following command line:
-# mbm_histplot \-Itimelag.dat \-Otimelaghist \-JX6/4 \-V
-#
-# Define shell variables used in this script:
-set PS_FILE         = timelaghist.ps
-set CPT_FILE        =
-set MAP_PROJECTION  = X
-set MAP_SCALE       = 6/4
-set MAP_REGION      = \-0.57/0.12/0/50
-set X_OFFSET        = 2.5
-set Y_OFFSET        = 2.375
-#
-# Save existing GMT defaults
-echo Saving GMT defaults...
-gmtdefaults \-L >! gmtdefaults$$
-#
-# Set new GMT defaults
-echo Setting new GMT defaults...
-gmtset MEASURE_UNIT inch
-gmtset PAPER_MEDIA archA+
-gmtset ANOT_FONT Helvetica
-gmtset LABEL_FONT Helvetica
-gmtset HEADER_FONT Helvetica
-gmtset ANOT_FONT_SIZE 8
-gmtset LABEL_FONT_SIZE 8
-gmtset HEADER_FONT_SIZE 10
-gmtset FRAME_WIDTH 0.075
-gmtset TICK_LENGTH 0.075
-gmtset PAGE_ORIENTATION LANDSCAPE
-gmtset COLOR_BACKGROUND 0/0/0
-gmtset COLOR_FOREGROUND 255/255/255
-gmtset COLOR_NAN 255/255/255
-gmtset DEGREE_FORMAT 3
-#
-# Make histogram
-echo Running pshistogram...
-pshistogram timelag.dat \
-	-J$MAP_PROJECTION$MAP_SCALE \
-	-R$MAP_REGION \
-	-B0.05:" ":/5:"Frequency %"::."Frequency Histogram of timelag.dat": \
-	-W0.069 \-Z1 \
-	-L1p \
-	-Ggray \
-	-X$X_OFFSET \-Y$Y_OFFSET \-V >! $PS_FILE
-#
-# Delete surplus files
-echo Deleting surplus files...
-/bin/rm \-f $CPT_FILE
-#
-# Reset GMT default fonts
-echo Resetting GMT fonts...
-/bin/mv gmtdefaults$$ .gmtdefaults
-#
-# Run gv
-echo Running gv in background...
-gv \--orientation=landscape \--media=BBox $PS_FILE &
-#
-# All done!
-echo All done!
-
-.SH SEE ALSO
-\fBmbsystem\fP(1), \fBmbdefaults\fP(1),
-\fBmbm_grdplot\fP(1), \fBmbm_grd3dplot\fP(1),
-\fBmbm_plot\fP(1)
-
-.SH BUGS
-Please let us know.
diff --git a/src/man/man1/mbm_makedatalist.1 b/src/man/man1/mbm_makedatalist.1
deleted file mode 100644
index d1a8187..0000000
--- a/src/man/man1/mbm_makedatalist.1
+++ /dev/null
@@ -1,85 +0,0 @@
-.TH mbm_makedatalist 1 "3 June 2013" "MB-System 5.0" "MB-System 5.0"
-.SH NAME
-\fBmbm_makedatalist\fP \- Macro to generate a datalist of the swath
-files in a specified directory.
-
-.SH VERSION
-Version 5.0
-
-.SH SYNOPSIS
-\fBmbm_makedatalist\fP [\fB\-I\fP\fIdirectory\fP \fB\-O\fP\fIdatalist\fP \fB\-H \-V\fP]
-
-.SH DESCRIPTION
-\fBMbm_makedatalist\fP is a macro to generate an MB-System
-datalist file referencing all identifiable swath files in
-the specified target directory.
-
-The output datalist will be placed in the current working
-directory. The output datalist is named datalist.mb-1
-by default, but can be specified with the \fB\-O\fP option.
-If no target directory is specified with the \fB\-I\fP
-option, then the current working directory is used. In order
-for swath files to be recognized and included in the datalist,
-they must conform to the MB-System swath file naming convention
-(see the \fBmbsystem\fP manual page for details).
-
-.SH AUTHORSHIP
-David W. Caress (caress at mbari.org)
-.br
-  Monterey Bay Aquarium Research Institute
-.br
-Dale N. Chayes (dale at ldeo.columbia.edu)
-.br
-  Lamont-Doherty Earth Observatory
-
-.SH OPTIONS
-.TP
-.B \-H
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-.TP
-.B \-I
-\fIdirectory\fP
-.br
-Sets the path of the target directory.
-.TP
-.B \-O
-\fIdatalist\fP
-.br
-Sets the name of the output datalist file. Default: datalist.mb-1
-.TP
-.B \-V
-The \fB\-V\fP option causes \fBmbm_makedatalist\fP to print out status messages.
-
-.SH EXAMPLES
-Suppose we have a set of swath files in a directory and we
-want to construct a datalist referring to those files. A simple
-directory listing shows four files:
-.br
- 	20051019_154030.mb88
- 	20051019_162540.mb88
- 	20051019_171756.mb88
- 	junk.txt
-.br
-of which three are identifiable as swath files because of the
-".mb88" file suffix. Running \fBmbm_makedatalist\fP in this
-directory with no arguments other than verbosity:
-.br
- 	mbm_makedatalist \-V
-.br
-produces a datalist file named datalist.mb-1. The contents of
-this file are:
-.br
- 	./20051019_154030.mb88 88
- 	./20051019_162540.mb88 88
- 	./20051019_171756.mb88 88
-.br
-where the file junk.txt has been ignored.
-
-.SH SEE ALSO
-\fBmbsystem\fP(1), \fBmbdatalist\fP(1), \fBmbinfo\fP(1)
-
-.SH BUGS
-This macro doesn't yet recognize when one swath file derives from
-another (e.g. line1p.mb57 can be inferred to be a processed
-version of line1.mb57).
diff --git a/src/man/man1/mbm_makesvp.1 b/src/man/man1/mbm_makesvp.1
deleted file mode 100644
index d71862f..0000000
--- a/src/man/man1/mbm_makesvp.1
+++ /dev/null
@@ -1,106 +0,0 @@
-.TH mbm_makesvp 1 "13 October 2013" "MB-System 5.0" "MB-System 5.0"
-.SH NAME
-\fBmbm_makesvp\fP \- Macro to extract sound speed and depth data from a datalist of swath files,
-and generate a sound velocity profile model from averages of the sound speed values in regular depth ranges.
-
-.SH VERSION
-Version 5.0
-
-.SH SYNOPSIS
-\fBmbm_makesvp\fP \fB\-I\fP\fIinputfile\fP [\fB\-H \-V\fP
-\fB\-D\fP\fIdepthinterval\fP \fB\-O\fP\fIoutputfile\fP]
-
-.SH DESCRIPTION
-\fBmbm_makesvp\fP is a macro to extract sound speed and depth data from a datalist of swath files,
-and generate a sound velocity profile model from averages of the sound
-speed values in regular depth ranges. 
-
-This macro uses \fBmbctdlist\fP to extract the sound speed values embedded in swath data files.
-This macro is intended for use with mapping data from submerged platforms (e.g. ROVs and AUVs) carrying
-CTD or sound speed sensors. Since the sound speed values are generally recorded during the
-entire ROV or AUV survey, these values can be used to construct a model for sound speed as
-a function of depth at the survey location.
-The sound speed and sonar depth value pairs are binned according to the \fIdepthinterval\fP
-value, and average sound speed values are reported for bins with at least one value.
-The \fB\-O\fP option specifies the output filename; by default the model is output to
-the stdout stream.
-
-.SH AUTHORSHIP
-David W. Caress (caress at mbari.org)
-.br
-  Monterey Bay Aquarium Research Institute
-.br
-Dale N. Chayes (dale at ldeo.columbia.edu)
-.br
-  Lamont-Doherty Earth Observatory
-
-.SH OPTIONS
-.TP
-.B \-D
-\fIdepthinterval\fP
-.br
-Sets the size in meters of the depth bins used to calculate an average sound speed
-versus depth model. The default value is 25 meters.
-.TP
-.B \-F
-\fIformat\fP
-.br
-Sets the data format for the input data.
-If \fIformat\fP < 0, then the input file specified
-with the \fB\-I\fP option will actually contain a list of input swath sonar
-data files. This program uses the \fBMBIO\fP library
-and will read or write any swath sonar
-format supported by \fBMBIO\fP. A list of the swath sonar data formats
-currently supported by \fBMBIO\fP and their identifier values
-is given in the \fBMBIO\fP manual page. Default: \fIformat\fP = \-1.
-.TP
-.B \-H
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-.TP
-.B \-I
-\fIinputfile\fP
-.br
-Sets the input filename. If \fIformat\fP > 0 (set with the
-\fB\-f\fP option) then the swath sonar data contained in \fIinfile\fP
-is read and processed. If \fIformat\fP < 0 (the default),
-then \fIinfile\fP
-is assumed to be an ascii file containing a list of the input swath sonar
-data files to be processed and their formats.  The program will read
-the data in each one of these files.
-In the \fIinputfile\fP file, each
-data file should be followed by a data format identifier, e.g.:
- 	datafile1 11
- 	datafile2 24
-.br
-This program uses the \fBMBIO\fP library and will read any swath sonar
-format supported by \fBMBIO\fP. However, not all formats contain
-sound speed or CTD information, and useful results can only be expected
-from data actually including the relevant values.
-A list of the swath sonar data formats
-currently supported by \fBMBIO\fP and their identifier values
-is given in the \fBMBIO\fP manual page. The default input filename is
-"datalist.mb-1".
-.TP
-.B \-O
-\fIoutput\fP
-.br
-Sets the name of the output file for the sound speed versus depth model. By default,
-the model is output to the stdout stream.
-.TP
-.B \-V
-The \fB\-V\fP option causes \fBmbm_makesvp\fP to print out status messages.
-
-.SH EXAMPLES
-Suppose we have a set of swath files from an AUV-based survey in a directory and we
-want to construct an average sound speed versus depth model from these data. The
-command:
-.br
-	mbm_makesvp -Idatalist.mb-1 -D25 -Osvp.txt -V
-will generate a model of sound speed versus depth in the output file "svp.txt".
-
-.SH SEE ALSO
-\fBmbsystem\fP(1), \fBmbctdlist\fP(1)
-
-.SH BUGS
-Likely yes.
diff --git a/src/man/man1/mbm_multicopy.1 b/src/man/man1/mbm_multicopy.1
deleted file mode 100644
index 31461af..0000000
--- a/src/man/man1/mbm_multicopy.1
+++ /dev/null
@@ -1,152 +0,0 @@
-.TH mbm_multicopy 1 "3 June 2013" "MB-System 5.0" "MB-System 5.0"
-.SH NAME
-\fBmbm_multicopy\fP \- Apply mbcopy to all files referenced through
-a datalist using parallel processes. As with mbm_copy, the MB-System
-file suffix convention is used to name the output files.
-
-.SH VERSION
-Version 5.0
-
-.SH SYNOPSIS
-\fBmbm_multicopy\fP \fB\-F\fP\fIoutputformat\fP \fB\-I\fP\fIdatalist\fP
-[\fB\-H\fP \fB\-C \-T\fP \fB\-V\fP \fB\-X\fP\fInprocesses\fP]
-
-.SH DESCRIPTION
-
-\fBmbm_multicopy\fP is a macro used to copy large numbers of swath data files
-from one data format to another using the program \fBmbcopy\fP.
-This macro is the same as \fBmbm_copy\fP except that it can execute more than
-one instance of \fBmbcopy\fP simultaneously.
-
-The input is a datalist file referencing
-all of the target swath files. The output swath file format is specified
-with the \fB\-F\fP option. If the output swath file format is not specified,
-the output format will be the same as the input format.
-
-The macro identifies a filename root for each input swath file. For files
-with recognized filename suffixes (e.g. ".mb61" for a format 61 file), the
-filename root is the part of the filename that comes before the suffix. For
-files without a recognized suffix, the filename root is the entire filename.
-So, for a format 57 data file called "0007_20020425_060531.mb57", the filename root
-is "0007_20020425_060531". For a format 121 file named "009_1659", the filename
-root "009_1659".
-
-The output filenames are automatically constructed by adding the standard
-MB-System file suffix to the filename root. This suffix is ".mbXXX" where
-XXX is the two or three digit format id number. In the event that the output
-filename is the same as the input filename (likely only if the \fB\-F\fP option
-is not used to set the output format), a "c" will be placed at the beginning
-of the output file suffix, making it "c.mbXXX".
-
-The \fB\-X\fP\fInprocesses\fP option sets the number of parallel processes that can be
-started by \fBmbm_multicopy\fP. In general, the most efficient (fastest) execution of
-the overall command will be achieved when \fInprocesses\fP equals the number of
-available CPUs or cores.
-
-The \fB\-T\fP option causes this macro to print out the \fBmbcopy\fP commands
-it will execute without actually executing them. This test option allows
-users to check the consequences of their command before actually running it.
-
-.SH AUTHORSHIP
-Christian Ferreira
-.br
-  MARUM, University of Bremen
-.br
-David W. Caress (caress at mbari.org)
-.br
-  Monterey Bay Aquarium Research Institute
-.br
-Dale N. Chayes (dale at ldeo.columbia.edu)
-.br
-  Lamont-Doherty Earth Observatory
-
-.SH SIMPLE DESCRIPTION OF BASIC OPTIONS
-.TP
-.B \-H
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-.TP
-.B \-C
-.br
-This option causes the program to check if each output file
-already exists, and to forgo copying those that do exist.
-.TP
-.B \-F
-\fIoutputformat\fP
-.br
-This option sets the output swath format. All of the swath data
-files referenced in the datalist specified with the \fB\-I\fP option
-will be copied to format \fIoutputformat\fP using \fBmbcopy\fP. If
-the \fB\-F\fP option is not given, then the input files will be copied
-to their input formats.
-.TP
-.B \-I
-\fIdatalist\fP
-.br
-Sets the input datalist filename. A datalist is an ascii
-file containing a list of the input swath sonar
-data files to be copied and their formats.
-In the \fIdatalist\fP file, each
-swath data file should be followed by a data format identifier, e.g.:
- 	datafile1 11
- 	datafile2 24
-.br
-As discussed in the \fBMB-System\fP manual page, datalists may reference
-other datalists, allowing users to construct recursive datalist structures.
-This program uses the \fBMBIO\fP library and will read or write any swath sonar
-format supported by \fBMBIO\fP. A list of the swath sonar data formats
-currently supported by \fBMBIO\fP and their identifier values
-is given in the \fBMBIO\fP manual page.
-.TP
-.B \-T
-.br
-This option causes \fBmbm_multicopy\fP to print out the \fBmbcopy\fP commands
-it will execute without actually executing them. This test option allows
-users to check the consequences of their command before actually running it.
-.TP
-.B \-V
-Causes \fBmbm_multicopy\fP to operate in "verbose" mode
-so that it outputs
-more information than usual.
-.TP
-.B \-X
-\fInprocesses\fP
-.br
-This option sets the number of parallel, simultaneous \fBmbcopy\fP processes that may be
-run.
-
-.SH EXAMPLES
-Suppose one has three raw (format 56) Simrad EM300 data files:
- 	0001_20020424_212920_raw.all
- 	0002_20020425_011607_raw.all
- 	0003_20020425_022926_raw.all
-.br
-One can generate a datalist called datalistr.mb-1 referencing these
-three swath files using a text editor or by using \fBawk\fP:
- 	ls \-1 *all | awk '{print $1" 56"}' > datalistr.mb-1
-.br
-In order to translate all three files in the processing format for
-Simrad multibeam data (format 57), use the \fBmbm_multicopy\fP macro:
- 	mbm_multicopy \-I datalistr.mb-1 \-F 57 \-T \-X2 \-V
-.br
-The macro prints out the following as it translates the swath data:
- 	Running mbm_multicopy...
- 	Getting file list using mbdatalist...
- 	Initializing parallel processing with as many as 2 processes
-
-  	Running: mbcopy \-F56/57
- 		-I0001_20020424_212920_raw.all
- 		-O0001_20020424_212920.mb57
-  	Running: mbcopy \-F56/57
- 		-I0002_20020425_011607_raw.all
- 		-O0002_20020425_011607.mb57
-  	Running: mbcopy \-F56/57
- 		-I0003_20020425_022926_raw.all
- 		-O0003_20020425_022926.mb57
-
-.SH SEE ALSO
-\fBmbsystem\fP(1), \fBmbm_copy\fP(1), \fBmbcopy\fP(1),
-\fBmbdatalist\fP(1)
-
-.SH BUGS
-Perhaps.
diff --git a/src/man/man1/mbm_multidatalist.1 b/src/man/man1/mbm_multidatalist.1
deleted file mode 100644
index c139275..0000000
--- a/src/man/man1/mbm_multidatalist.1
+++ /dev/null
@@ -1,143 +0,0 @@
-.TH mbm_multidatalist 1 "3 June 2013" "MB-System 5.0" "MB-System 5.0"
-.SH NAME
-\fBmbm_multidatalist\fP \- Macro to use mbdatalist with the \fB\-O\fP option
-to generate standard  ancilliary files, using parallel processes.
-
-.SH VERSION
-Version 5.0
-
-.SH SYNOPSIS
-\fBmbm_multidatalist\fP \fB\-I\fP\fIdatalist\fP
-[\fB\-X\fP\fInprocesses\fP [\fB\-N\fP \fB\-H\fP \fB\-V\fP]
-
-.SH DESCRIPTION
-
-\fBmbm_multidatalist\fP is a macro used to efficiently generate ancilliary files
-for the swath data files referenced in the input datalist file. This is
-accomplished by executing \fBmbdatalist\fP with the \fB\-O\fP or \fB\-N\fP option
-for each swath file.
-
-Programs such as \fBmbgrid\fP try to check statistics or "inf"
-files to see if the corresponding data files include data within
-the specified geographic bounds. Other programs look for
-"fast bathymetry" or "fast navigation" ("fbt" or "fnv") files
-in order to read the data more quickly. The \fB\-N\fP option causes
-\fBmbm_multidatalist\fP to create these three types of ancillary files
-for each swath data file. By default, \fBmbm_multidatalist\fP
-creates the "inf", "fbt", and "fnv" files only when they don't
-already exist or are out of date (older than the data file).
-The \fB\-N\fP option causes \fBmbm_multidatalist\fP to create
-(or recreate) the ancillary files
-for each swath data file.
-
-The \fB\-X\fP\fInprocesses\fP option sets the number of parallel processes that can be
-started by \fBmbm_multidatalist\fP. In general, the most efficient (fastest) execution of
-the overall command will be achieved when \fInprocesses\fP equals the number of
-available CPUs or cores.
-
-.SH AUTHORSHIP
-Christian Ferreira
-.br
-  MARUM, University of Bremen
-.br
-David W. Caress (caress at mbari.org)
-.br
-  Monterey Bay Aquarium Research Institute
-.br
-Dale N. Chayes (dale at ldeo.columbia.edu)
-.br
-  Lamont-Doherty Earth Observatory
-
-.SH SIMPLE DESCRIPTION OF BASIC OPTIONS
-.TP
-.B \-H
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-.TP
-.B \-C
-.br
-This option causes the program to check if each output file
-already exists, and to forgo copying those that do exist.
-.TP
-.B \-I
-\fIdatalist\fP
-.br
-Sets the input datalist filename. A datalist is an ascii
-file containing a list of the input swath sonar
-data files to be copied and their formats.
-In the \fIdatalist\fP file, each
-swath data file should be followed by a data format identifier, e.g.:
- 	datafile1 11
- 	datafile2 24
-.br
-As discussed in the \fBMB-System\fP manual page, datalists may reference
-other datalists, allowing users to construct recursive datalist structures.
-This program uses the \fBMBIO\fP library and will read or write any swath sonar
-format supported by \fBMBIO\fP. A list of the swath sonar data formats
-currently supported by \fBMBIO\fP and their identifier values
-is given in the \fBMBIO\fP manual page.
-.TP
-.B \-N
-This argument causes \fBmbm_multidatalist\fP to generate the three ancillary
-data files ("inf", "fbt", and "fnv") even if they already exist and are up to date.
-.TP
-.B \-V
-Causes \fBmbm_multidatalist\fP to operate in "verbose" mode
-so that it outputs
-more information than usual.
-.TP
-.B \-X
-\fInprocesses\fP
-.br
-This option sets the number of parallel, simultaneous \fBmbdatalist\fP processes that may be
-run.
-
-.SH EXAMPLES
-Suppose one has two format 88 Reson 7125 data files:
- 	20110805_053612.mb88
- 	20110805_054149.mb88
-.br
-One can generate a datalist called datalistr.mb-1 referencing these
-three swath files using a text editor or by using \fBawk\fP:
- 	ls \-1 *.mb88 | awk '{print $1" 88"}' > datalist.mb-1
-.br
-In order to generate the usual ancilliary files (*.inf, *.fbt, and *.fnv files)
-use the \fBmbm_multidatalist\fP macro:
- 	mbm_multidatalist \-I datalist.mb-1 \-X2 \-V
-.br
-The macro prints out the following as it generates the *.inf, *.fbt, and *.fnv
-files for each swath data file:
-
- 	Running mbm_multidatalist...
- 	Executing mbdatalist \-I20110805_053612.mb88 \-O \-V
- 	Executing mbdatalist \-I20110805_054149.mb88 \-O \-V
-
- 	Program mbdatalist
-
- 	Version $Id: mbm_multidatalist.1 2096 2013-06-04 08:17:22Z caress $
- 	Program mbdatalist
- 	MB-system Version 5.3.1904
- 	Version $Id: mbm_multidatalist.1 2096 2013-06-04 08:17:22Z caress $
- 	MB-system Version 5.3.1904
-
- 	Generating inf file for 20110805_054149.mb88
-
- 	Generating inf file for 20110805_053612.mb88
- 	Generating fbt file for 20110805_054149.mb88
- 	Generating fbt file for 20110805_053612.mb88
- 	Generating fnv file for 20110805_054149.mb88
- 	Generating fnv file for 20110805_053612.mb88
-
- 	Total swath files:         1
-
- 	Total swath files:         1
-
-Note that the terminal messages from the two \fBmbdatalist\fP processes are
-mixed because the processes are executed in parallel.
-
-.SH SEE ALSO
-\fBmbsystem\fP(1), \fBmbdatalist\fP(1), \fBmbcopy\fP(1),
-\fBmbdatalist\fP(1)
-
-.SH BUGS
-Perhaps.
diff --git a/src/man/man1/mbm_multiprocess.1 b/src/man/man1/mbm_multiprocess.1
deleted file mode 100644
index 494379f..0000000
--- a/src/man/man1/mbm_multiprocess.1
+++ /dev/null
@@ -1,123 +0,0 @@
-.TH mbm_multiprocess 1 "3 June 2013" "MB-System 5.0" "MB-System 5.0"
-.SH NAME
-\fBmbm_multiprocess\fP \- Macro to run mbprocess on the swath files referenced
-by a datalist using parallel processes.
-
-.SH VERSION
-Version 5.0
-
-.SH SYNOPSIS
-\fBmbm_multiprocess\fP \fB\-I\fP\fIdatalist\fP
-[\fB\-X\fP\fInprocesses\fP \fB\-H\fP \fB\-V\fP]
-
-.SH DESCRIPTION
-
-\fBmbm_multiprocess\fP is a macro used to effeciently process large numbers of swath
-data files by executing parallel instances of the program \fBmbprocess\fP. See the
-\fBmbprocess\fP manual page for a description of its operation.
-
-The \fB\-X\fP\fInprocesses\fP option sets the number of parallel processes that can be
-started by \fBmbm_multiprocess\fP. In general, the most efficient (fastest) execution of
-the overall command will be achieved when \fInprocesses\fP equals the number of
-available CPUs or cores.
-
-.SH AUTHORSHIP
-Christian Ferreira
-.br
-  MARUM, University of Bremen
-.br
-David W. Caress (caress at mbari.org)
-.br
-  Monterey Bay Aquarium Research Institute
-.br
-Dale N. Chayes (dale at ldeo.columbia.edu)
-.br
-  Lamont-Doherty Earth Observatory
-
-.SH SIMPLE DESCRIPTION OF BASIC OPTIONS
-.TP
-.B \-H
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-.TP
-.B \-I
-\fIdatalist\fP
-.br
-Sets the input datalist filename. A datalist is an ascii
-file containing a list of the input swath sonar
-data files to be copied and their formats.
-In the \fIdatalist\fP file, each
-swath data file should be followed by a data format identifier, e.g.:
- 	datafile1 11
- 	datafile2 24
-.br
-As discussed in the \fBMB-System\fP manual page, datalists may reference
-other datalists, allowing users to construct recursive datalist structures.
-This program uses the \fBMBIO\fP library and will read or write any swath sonar
-format supported by \fBMBIO\fP. A list of the swath sonar data formats
-currently supported by \fBMBIO\fP and their identifier values
-is given in the \fBMBIO\fP manual page.
-.TP
-.B \-V
-Causes \fBmbm_multiprocess\fP to operate in "verbose" mode
-so that it outputs
-more information than usual.
-.TP
-.B \-X
-\fInprocesses\fP
-.br
-This option sets the number of parallel, simultaneous \fBmbcopy\fP processes that may be
-run.
-
-.SH EXAMPLES
-Suppose one has two format 88 Reson 7125 data files:
- 	20110805_053612.mb88
- 	20110805_054149.mb88
-.br
-and that these files are ready to be processed with \fBmbprocess\fP.
-In order to execute the processing using multiple, parallel processes,
-use the macro mbm_multiprocess with a datalist file referencing the
-target swath files as input:
- 	mbm_multiprocess \-Idatalist.mb-1 \-V \-X2
-.br
-The macro prints out the following as the processing proceeds:
-
- 	Running mbm_multiprocess...
-
- 	Program <mbprocess>
-
- 	Program <mbprocess>
- 	Version $Id: mbm_multiprocess.1 2096 2013-06-04 08:17:22Z caress $
- 	Version $Id: mbm_multiprocess.1 2096 2013-06-04 08:17:22Z caress $
- 	MB-system Version 5.3.1904
- 	MB-system Version 5.3.1904
-
- 	Program Operation:
-
- 	Program Operation:
- 	  Input file:      20110805_053612.mb88
- 	  Input file:      20110805_054149.mb88
- 	  Format:          88
- 	  Format:          88
- 	  Files processed only if out of date.
- 	  Files processed only if out of date.
- 	  Comments embedded in output.
-
- 	  Comments embedded in output.
-
- 	**: Data processed \- out of date \- unlocked:
- 		Input:  /Volumes/MappingAUVOps2011/test/20110805_054149.mb88
- 		Output: /Volumes/MappingAUVOps2011/test/20110805_054149p.mb88
- 	**: Data processed \- out of date \- unlocked:
- 		Input:  /Volumes/MappingAUVOps2011/test/20110805_053612.mb88
- 		Output: /Volumes/MappingAUVOps2011/test/20110805_053612p.mb88
-
-Note that the terminal messages from the two \fBmbprocess\fP instances are
-mixed because the processes are executed in parallel.
-
-.SH SEE ALSO
-\fBmbsystem\fP(1), \fBmbprocess\fP(1)
-
-.SH BUGS
-In insetos sao permitidos.
-Keine insekten hier gestattet ist.
diff --git a/src/man/man1/mbm_plot.1 b/src/man/man1/mbm_plot.1
deleted file mode 100644
index f36903b..0000000
--- a/src/man/man1/mbm_plot.1
+++ /dev/null
@@ -1,1356 +0,0 @@
-.TH mbm_plot 1 "9 January 2015" "MB-System 5.0" "MB-System 5.0"
-.SH NAME
-\fBmbm_plot\fP \- Create an executable shellscript which will generate
-a GMT plot of swath sonar swath data.
-
-.SH VERSION
-Version 5.0
-
-.SH SYNOPSIS
-\fBmbm_plot\fP \fB\-F\fP\fIformat\fP \fB\-I\fP\fIfile\fP
-[\fB\-A\fP[\fImagnitude\fP[\fI/azimuth\fP]
-\fB\-C\fP\fI[cont_int/col_int/tic_int/lab_int/tic_len/lab_hgt]\fP
-\fB\-D\fP[\fIflipcolor/flipshade\fP]
-\fB\-G\fP\fIcolor_mode[F]\fP \fB\-H\fP
-\fB\-N\fP\fI[ttick/tannot/dannot/tlen[/nhgt] | F | FP]\fP
-\fB\-O\fP\fIroot\fP \fB\-P\fP\fIpagesize \fP
-\fB\-S\fP\fI[color/shade]\fP \fB\-T\fP
-\fB\-U\fP\fIorientation\fP \fB\-V\fP
-\fB\-W\fP\fI[color_style\fP[\fI/palette\fP[\fIncolors\fP]] | \fIcptfile]\fP ]
-
-Additional Options:
-.br
-[\fB\-B\fP\fItickinfo\fP
-\fB\-J\fP\fIprojection\fP[\fI/scale | width\fP]
-\fB\-L\fP\fItitle\fP[\fI:scale_label\fP] \fB\-M\fP\fImisc\fP
-\fB\-Q\fP \fB\-R\fP\fIw/e/s/n\fP \fB\-X\fP \fB\-Y\fP
-\fB\-Z\fP\fImin/max\fP ]
-
-Miscellaneous Options:
-.br
-[\fB\-MGD\fP\fIgmtdef/value\fP
-\fB\-MGF\fP\fIscale_loc\fP
-\fB\-MGL\fP[\fIf\fP][\fIx\fP]\fIlon0/lat0/slat/length\fP[\fIunits\fP][\fI+llabel\fP]
-\fB\-MGQ\fP\fIdpi\fP
-\fB\-MGT\fP\fIx/y/size/angle/font/just/text\fP
-\fB\-MGU\fP\fP[\fI/dx/dy/\fP][\fIlabel\fP]
-\fB\-MMA\fP\fIfactor/mode/depth\fP
-\fB\-MMB\fP\fIyr/mo/da/hr/mn/sc\fP
-\fB\-MMD\fP\fImode/scale[/min/max]\fP
-\fB\-MME\fP\fIyr/mo/da/hr/mn/sc\fP
-\fB\-MML\fP\fIlonflip\fP
-\fB\-MMN\fP\fInplot\fP \fB\-MMP\fP\fIpings \fP
-\fB\-MMS\fP\fIspeedmin\fP
-\fB\-MMT\fP\fItimegap\fP \fB\-MMZ\fP\fIalgorithm\fP
-\fB\-MNA\fP\fI[nhgt[/P] | P]\fP
-\fB\-MNP\fP\fI[pingnumber_tick/pingnumber_annot/pingnumber_tick_len]\fP
-\fB\-MTC\fP\fIfill\fP \fB\-MTD\fP\fIresolution\fP
-\fB\-MTG\fP\fIfill\fP \fB\-MTI\fP\fIriver[/pen]\fP
-\fB\-MTN\fP\fIborder[/pen]\fP \fB\-MTS\fP\fIfill\fP
-\fB\-MTW\fP\fIpen\fP
-\fB\-MXG\fP\fIfill\fP \fB\-MXI\fP\fIxy_file \fP
-\fB\-MXM\fP
-\fB\-MXS\fP\fIsymbol/size\fP \fB\-MXW\fP\fIpen\fP]
-
-.SH DESCRIPTION
-\fBmbm_plot\fP is a macro to generate a shellscript of MB-System and GMT commands
-which, when executed, will generate a Postscript plot of the
-specified swath sonar data. The plot may include bathymetry color
-fill (\fB\-G\fP\fI1\fP), bathymetry color shaded relief (\fB\-G\fP\fI2\fP), bathymetry
-shaded with amplitudes (\fB\-G\fP\fI3\fP), greyshade fill amplitude (\fB\-G\fP\fI4\fP),
-greyshade fill sidescan (\fB\-G\fP\fI5\fP), contoured bathymetry (\fB\-C\fP),
-or annotated navigation. The plot may also include navigation tracks, text
-labels, xy data in lines or symbols, and coastlines.
-Five different color
-schemes are included. The plot will be scaled to fit on
-the specified page size or, if the scale is user defined,
-the page size will be chosen in accordance with the plot
-size. The primary purpose of this macro is to allow the
-simple, semi-automated production of nice looking maps with
-a few command line arguments. For users seeking more control
-over the plot appearance, a number of additional optional
-arguments are provided. Truly ambitious users may edit the
-plot shellscript to take advantage of MB-System and GMT
-capabilities not supported by this macro.
-
-By default the output plot generation shellscript
-includes lines which execute a program to display the Postscript
-image on the screen. The program to be used to display the Postscript
-is set using \fBmbdefaults\fP; the default value can be overridden
-by setting the environment variable $MB_PS_VIEWER.
-Invoking the plot generation shellscript with
-a \fB-N\fP command line argument suppresses the screen
-display of the plot.
-
-The plot scripts generated by this macro will work with
-GMT version 5.0 and later, and are not compatible with
-earlier versions of GMT.
-
-.SH AUTHORSHIP
-David W. Caress (caress at mbari.org)
-.br
-  Monterey Bay Aquarium Research Institute
-.br
-Dale N. Chayes (dale at ldeo.columbia.edu)
-.br
-  Lamont-Doherty Earth Observatory
-.br
-  Suzanne H. O'Hara (sohara at ldeo.columbia.edu)
-.br
-  Lamont-Doherty Earth Observatory
-
-.SH SIMPLE DESCRIPTION OF BASIC OPTIONS
-.TP
-.B \-A
-\fImagnitude/azimuth\fP or \fImagnitude/median\fP
-.br
-Sets the parameters which control how \fBmbswath\fP generates
-simulated illumination of bathymetry, which can be either
-shaded relief bathymetry or bathymetry draped with amplitude data.
-If \fImode\fP is set to 2 (shaded relief bathymetry) using the
-\fB\-G\fP option, then the value \fImagnitude\fP
-is an effective vertical exageration which modulates the intensity of
-the shading; typical values are in the 1-5 range.  The value \fIazimuth\fP
-is the azimuth from which the bathymetry is illuminated.
-If \fImode\fP is set to 3 (bathymetry shaded using amplitudes) using the
-\fB\-G\fP option, then the value \fImagnitude\fP
-modulates the intensity of the shading; the value \fImedian\fP sets the
-amplitude value which serves as the zero or neutral level.
-.TP
-.B \-C
-Given by itself, the \fB\-C\fP option produces a contour plot
-of the bathymetry data with a contour interval chosen according
-to the data in the file or files. If the \fB\-G\fP option is used,
-the default contours will be drawn in black; otherwise, the
-default contours will be drawn in four colors (black, red,
-green, and blue) with color changes, annotations, and tickmarks
-every fourth contour interval. Additional optional parameters are
-described in the COMPLETE DESCRIPTION OF OPTIONS section below.
-.TP
-.B \-D
-\fI[flipcolor/flipshade]\fP
-.br
-This option flips the color and shading conventions used by
-\fBmbm_plot\fP.
-Normally, the color or grayscale tables used for color bathymetry
-maps run from
-cool colors (or dark grays) for large depth values
-to hot colors (or light grays) for small depth values.
-In contrast, sidescan and beam amplitude data is normally plotted
-using light grays (or hot colors) for small amplitudes and
-dark grays (or cool colors) for large amplitudes.
-If \fB\-D\fP is given alone or with \fIflipcolor\fP = 1,
-it applies to the color table used
-for color or gray fill plots,  shaded or unshaded. If the plot
-is to be shaded,  either by synthetic illumination (\fB\-G\fP\fI2\fP)
-or by overlaying amplitude data (\fB\-G\fP\fI3\fP option), then
-setting \fIflipshade\fP = 1 will cause the shading convention
-to be reversed (e.g. high amplitudes overlaid as light shading).
-Using \fB\-D\fP\fI0/1\fP will flip the shading convention
-but leave the default color convention.
-.TP
-.B \-F
-\fIformat\fP
-.br
-Sets the data format for the input data.
-If \fIformat\fP < 0, then the input file specified
-with the \fB\-I\fP option will actually contain a list of input swath sonar
-data files. This program uses the \fBMBIO\fP library
-and will read or write any swath sonar
-format supported by \fBMBIO\fP. A list of the swath sonar data formats
-currently supported by \fBMBIO\fP and their identifier values
-is given in the \fBMBIO\fP manual page. Default: \fIformat\fP = \-1.
-.TP
-.B \-G
-\fImode[F]\fP
-.br
-Turns on color fill swath plot and sets the style of the plot.
- 	\fImode\fP = 1:	Color fill of bathymetry data.
- 	\fImode\fP = 2:	Color shaded relief bathymetry.
- 	\fImode\fP = 3:	Bathymetry shaded using amplitude data.
- 	\fImode\fP = 4:	Grayscale fill of amplitude data.
- 	\fImode\fP = 5:	Grayscale fill of sidescan data.
-.br
-If "F" is appended to \fImode\fP, then \fBmbm_plot\fP will attempt
-to plot amplitude or sidescan data that have been filtered with \fBmbfilter\fP.
-If the desired filtered data files do not exist, then the plotting script
-generated by \fBmbm_plot\fP will fail when
-\fBmbswath\fP exits with an error message. Filtered amplitude
-data are stored in ancilliary files ending with ".ffa", and filtered
-sidescan files end in ".ffs". Filtering of bathymetry data is not supported,
-and so appending "F" to \fImode\fP values of 1 or 2 will have no effect.
-.TP
-.B \-H
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-.TP
-.B \-I
-\fIfilename\fP
-.br
-Sets the input filename. If \fIformat\fP > 0 (set with the
-\fB\-f\fP option) then the swath sonar data contained in \fIinfile\fP
-is read and processed. If \fIformat\fP < 0 (the default),
-then \fIinfile\fP
-is assumed to be an ascii file containing a list of the input swath sonar
-data files to be processed and their formats.  The program will read
-the data in each one of these files.
-In the \fIinfile\fP file, each
-data file should be followed by a data format identifier, e.g.:
- 	datafile1 11
- 	datafile2 24
-.br
-This program uses the \fBMBIO\fP library and will read or write any swath sonar
-format supported by \fBMBIO\fP. A list of the swath sonar data formats
-currently supported by \fBMBIO\fP and their identifier values
-is given in the \fBMBIO\fP manual page. The default input filename is
-"datalist.mb-1".
-.TP
-.B \-N
-Given by itself, this option causes a navigation track plot to be generated.
-Additional optional parameters, including annotation control, are
-described in the COMPLETE DESCRIPTION OF OPTIONS section below.
-.TP
-.B \-O
-\fIroot\fP
-.br
-Sets the root used to construct the filename of the output shellscript
-(\fIroot\fP.cmd) and names of files created when the shellscript is
-run.  By default, the
-name of the input data file or list file is used as the \fIroot\fP.
-.TP
-.B \-P
-\fIpagesize\fP
-.br
-This option sets the size of the page the plot will be centered
-on. If the user does not set the plot scale, the plot will be
-sized as large as will fit on the designated page. If the user
-sets the plot scale such that the plot will not fit on the
-designated page, a larger page will be used.
-The supported page sizes include ANSI A, B, C, D, E,
-F, and E1, as well as most metric page sizes. See the
-COMPLETE DESCRIPTION OF OPTIONS section
-below for a complete list of
-the supported page sizes. The default page size is A.
-.TP
-.B \-S
-\fI[color/shade]\fP
-.br
-This option enables effective histogram equalization of the
-color and/or shading of thedata. The equalization is
-not achieved by changing the data values, but rather by
-constructing the color or shading tables so that
-the boundaries in the tables encompass equal fractions of
-the datapoints. This serves to focus color or shading contrasts
-in value ranges corresponding to the bulk of the data values,
-and is particularly useful for
-enhancing the contrast of sidescan and beam amplitude plots.
-If \fB\-S\fP is given alone or with \fIcolor\fP = 1,
-it enables equalization of the color table used
-for color or gray fill plots,  shaded or unshaded. If the plot
-is to be shaded,  either by synthetic illumination (\fB\-G\fP\fI2\fP)
-or by overlaying amplitude data (\fB\-G\fP\fI3\fP option), then
-setting \fIshade\fP = 1 will cause the shading to be equalized.
-Using \fB\-S\fP\fI0/1\fP will equalize the shading without
-equalizing the color table.
-.TP
-.B \-T
-If \fB\-T\fP is given, it causes a coastline to be drawn
-on the map. The default is to draw the coastline and shade
-all dry land a uniform gray. To exercise greater control of
-the coastline plotting, use the
-\fB\-MTC\fP, \fB\-MTD\fP, \fB\-MTG\fP, \fB\-MTI\fP,
-\fB\-MTN\fP, \fB\-MTS\fP, and \fB\-MTW\fP options described in the
-COMPLETE DESCRIPTION OF OPTIONS section below.
-.TP
-.B \-U
-\fIorientation\fP
-.br
-Normally the orientation of the plot (portrait or landscape)
-is selected automatically so as to maximize the plot scale.
-The \fB\-U\fP option allows the user to set the plot orientation. If
-\fIorientation\fP = 1, a portrait plot will be produced; if
-\fIorientation\fP = 2, a landscape plot will be produced.
-.TP
-.B \-V
-Causes \fBmbm_plot\fP to operate in "verbose" mode
-so that it outputs
-more information than usual.
-.TP
-.B \-W
-\fI[color_style\fP[\fI/palette\fP[\fIncolors\fP]] | cptfile]
-.br
-This option controls the color scheme used for color
-fill plots.
-
-If \fIcolor_style\fP = 1 [default], then
-the color scheme used will be a continuous grading
-of colors. If \fIcolor_style\fP = 2, the color scheme
-will be a set of discrete color intervals. The color
-palette used is set using \fIpalette\fP. Five palettes
-are available:
- 	\fIpalette\fP = 1:	Haxby colors [default]
- 	\fIpalette\fP = 2:	high Intensity colors
- 	\fIpalette\fP = 3:	low Intensity colors
- 	\fIpalette\fP = 4:	grayscale
- 	\fIpalette\fP = 5:	uniform grayscale
-.br
-A complete description of the color palettes is given
-in the COMPLETE DESCRIPTION OF OPTIONS section below.
-
-The \fIncolors\fP parameter sets the number of color
-values used in plotting, whether the colors are
-represented in a continuous color scale or a
-stepped, discrete color scale [default is 11].
-
-If the option argument is the path to an existing \fBGMT\fP
-color palette (CPT) file, then that CPT file and its
-color scheme will be used for the plot
-
-.SH COMPLETE DESCRIPTION OF OPTIONS
-.TP
-.B \-A
-\fImagnitude/azimuth\fP or \fImagnitude/median\fP
-.br
-Sets the parameters which control how \fBmbm_plot\fP generates
-simulated illumination of bathymetry, which can be either
-shaded relief bathymetry or bathymetry draped with amplitude data.
-If \fImode\fP is set to 2 (shaded relief bathymetry) using the
-\fB\-G\fP option, then the value \fImagnitude\fP
-is an effective vertical exageration which modulates the intensity of
-the shading; typical values are in the 1-5 range.  The value \fIazimuth\fP
-is the azimuth from which the bathymetry is illuminated.
-If \fImode\fP is set to 3 (bathymetry shaded using amplitudes) using the
-\fB\-G\fP option, then the value \fImagnitude\fP
-modulates the intensity of the shading; the value \fImedian\fP sets the
-amplitude value which serves as the zero or neutral level.
-.TP
-.B \-B
-\fItickinfo\fP
-.br
-Sets map boundary tickmark intervals. See the \fBpsbasemap\fP
-manual page for details. By default the program chooses
-basemap annotations based on the map boundaries.
-.TP
-.B \-C
-\fI[cont_int/col_int/tic_int/lab_int/tic_len/lab_hgt]\fP
-.br
-Given by itself, the \fB\-C\fP option produces a contour plot
-of the bathymetry data with a contour interval chosen according
-to the data in the file or files. If the \fB\-G\fP option is used,
-the default contours will be drawn in black; otherwise, the
-default contours will be drawn in four colors (black, red,
-green, and blue) with color changes, annotations, and tickmarks
-every fourth contour interval.  If any of the optional
-parameters are appended, these values will control the contour interval
-and other contour characteristics.
-Contours will be
-generated at invervals of \fIcont_int\fP meters.  Color changes
-will occur at intervals of \fIcol_int\fP meters.  Contours will have
-downhill facing tickmarks \fItic_len\fP inches long every \fItic_int\fP
-meters. Contours will have annotations
-\fIlab_hgt\fP inches high every \fIlab_int\fP meters.
-.TP
-.B \-D
-\fI[flipcolor/flipshade]\fP
-.br
-This option flips the color and shading conventions used by
-\fBmbm_plot\fP.
-Normally, the color or grayscale tables used for color bathymetry
-maps run from
-cool colors (or dark grays) for large depth values
-to hot colors (or light grays) for small depth values.
-In contrast, sidescan and beam amplitude data is normally plotted
-using (light grays (or hot colors) for small amplitudes and
-dark grays (or cool colors) for large amplitudes.
-If \fB\-D\fP is given alone or with \fIflipcolor\fP = 1,
-it applies to the color table used
-for color or gray fill plots,  shaded or unshaded. If the plot
-is to be shaded,  either by synthetic illumination (\fB\-G\fP\fI2\fP)
-or by overlaying amplitude data (\fB\-G\fP\fI3\fP option), then
-setting \fIflipshade\fP = 1 will cause the shading convention
-to be reversed (e.g. high amplitudes overlaid as light shading).
-Using \fB\-D\fP\fI0/1\fP will flip the shading convention
-but leave the default color convention.
-.TP
-.B \-F
-\fIformat\fP
-.br
-Sets the data format for the input data.
-If \fIformat\fP < 0, then the input file specified
-with the \fB\-I\fP option will actually contain a list of input swath sonar
-data files. This program uses the \fBMBIO\fP library
-and will read or write any swath sonar
-format supported by \fBMBIO\fP. A list of the swath sonar data formats
-currently supported by \fBMBIO\fP and their identifier values
-is given in the \fBMBIO\fP manual page. Default: \fIformat\fP = \-1.
-.TP
-.B \-G
-\fImode\fP
-.br
-Turns on color fill swath plot and sets the style of the plot.
- 	\fImode\fP = 1:	Color fill of bathymetry data.
- 	\fImode\fP = 2:	Color shaded relief bathymetry.
- 	\fImode\fP = 3:	Bathymetry shaded using amplitude data.
- 	\fImode\fP = 4:	Grayscale fill of amplitude data.
- 	\fImode\fP = 5:	Grayscale fill of sidescan data.
-.TP
-.B \-H
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-.TP
-.B \-I
-\fIfilename\fP
-.br
-Sets the input filename. If \fIformat\fP > 0 (set with the
-\fB\-f\fP option) then the swath sonar data contained in \fIinfile\fP
-is read and processed. If \fIformat\fP < 0 (the default),
-then \fIinfile\fP
-is assumed to be an ascii file containing a list of the input swath sonar
-data files to be processed and their formats.  The program will read
-the data in each one of these files.
-In the \fIinfile\fP file, each
-data file should be followed by a data format identifier, e.g.:
- 	datafile1 11
- 	datafile2 24
-.br
-This program uses the \fBMBIO\fP library and will read or write any swath sonar
-format supported by \fBMBIO\fP. A list of the swath sonar data formats
-currently supported by \fBMBIO\fP and their identifier values
-is given in the \fBMBIO\fP manual page.
-.TP
-.B \-J
-\fIprojection\fP[\fI/scale | /width\fP]
-.br
-Selects the map projection. By default the map projection is
-Mercator and the plot scale is chosen to fit on the selected
-page size (see \fB\-P\fP option). The user may specify a
-different projection to be used, in which case the plot scale
-is still automatically chosen to fit the page. The user may
-also specify both the projection and the plot scale. If
-the projection specifying character is upper case, a plot
-width rather than a plot scale is used.
-The scale values are specified in inch/degree or in 1:xxxxx
-ratios. Plot widths are specified in inches. If the user
-specifies a plot scale such that the plot will not fit
-on the default A size page, a appropriately larger page
-size will be chosen.
-.br
-.sp
-\fBCYLINDRICAL PROJECTIONS:\fP
-.br
-.sp
-\fB\-Jc\fP\fIlon0/lat0/scale\fP (Cassini)
-.br
-\fB\-Jm\fP\fIscale\fP (Mercator)
-.br
-\fB\-Joa\fP\fIlon0/lat0/azimuth/scale\fP (Oblique Mercator \- point and azimuth)
-.br
-\fB\-Job\fP\fIlon0/lat0/lon1/lat1/scale\fP (Oblique Mercator \- two points)
-.br
-\fB\-Joc\fP\fIlon0/lat0/lonp/latp/scale\fP (Oblique Mercator \- point and pole)
-.br
-\fB\-Jq\fP\fIlon0/scale\fP (Equidistant Cylindrical Projection (Plate Carree))
-.br
-\fB\-Jt\fP\fIlon0/scale\fP (TM \- Transverse Mercator)
-.br
-\fB\-Ju\fP\fIzone/scale\fP (UTM \- Universal Transverse Mercator)
-.br
-\fB\-Jy\fP\fIlon0/lats/scale\fP (Basic Cylindrical Projection)
-.br
-.sp
-\fBAZIMUTHAL PROJECTIONS:\fP
-.br
-.sp
-\fB\-Ja\fP\fIlon0/lat0/scale\fP (Lambert).
-.br
-\fB\-Je\fP\fIlon0/lat0/scale\fP (Equidistant).
-.br
-\fB\-Jg\fP\fIlon0/lat0/scale\fP (Orthographic).
-.br
-\fB\-Js\fP\fIlon0/lat0/scale\fP (General Stereographic)
-.br
-.sp
-\fBCONIC PROJECTIONS:\fP
-.br
-.sp
-\fB\-Jb\fP\fIlon0/lat0/lat1/lat2/scale\fP (Albers)
-.br
-\fB\-Jl\fP\fIlon0/lat0/lat1/lat2/scale\fP (Lambert)
-.br
-.sp
-\fBMISCELLANEOUS PROJECTIONS:\fP
-.br
-.sp
-\fB\-Jh\fP\fIlon0/scale\fP (Hammer)
-.br
-\fB\-Ji\fP\fIlon0/scale\fP (Sinusoidal)
-.br
-\fB\-Jk\fP\fIlon0/scale\fP (Eckert VI)
-.br
-\fB\-Jn\fP\fIlon0/scale\fP (Robinson)
-.br
-\fB\-Jr\fP\fIlon0/scale\fP (Winkel Tripel)
-.br
-\fB\-Jw\fP\fIlon0/scale\fP (Mollweide)
-.br
-.sp
-\fBNON-GEOGRAPHICAL PROJECTIONS:\fP
-.br
-.sp
-\fB\-Jp\fP\fIscale\fP (Linear projection for polar (theta,r) coordinates)
-.br
-\fB\-Jx\fP\fIx-scale\fP[\fBl|p\fP\fIpow\fP][\fI/y-scale\fP[\fBl|p\fP\fIpow\fP]] (Linear, log, and power scaling)
-.br
-More details can be found in the \fBpsbasemap\fP manpages.
-.TP
-.B \-L
-\fItitle:scalelabel\fP
-.br
-Sets the title and the label for the colorscale (if used) of
-the plot. Note that a colon (:) rather than a slash (/) is
-used to separate the labels. Colons cannot be used in the
-labels themselves. If this option is not used, then a default title
-and colorscale label are provided. If the title is supplied
-alone, a default colorscale label will be provided. To force
-no title use \fB\-L\fP" "; to force no title or colorscale
-label use \fB\-L\fP" : ".
-.TP
-.B \-M
-A series of "miscellaneous" options are provided which are
-given as \fB\-M\fP followed by a two character identifier, followed
-by any other parameters associated with that option.
-The \fB\-M\fP options may be strung together separated by
-colons, e.g. "-MGQ100:GU", which is equivalent to
-"-MGQ \-MGU".
-.TP
-.B \-MGD
-\fIgmtdef/value\fP
-.br
-Allows the user to set the \fBGMT\fP default values used as
-the plot is constructed. This command may be given repeatedly
-to set as many \fBGMT\fP defaults as required. For example, to
-set the basemap annotation font to Courier, use
-"-MGDANOT_FONT/Courier".
-.TP
-.B \-MGF
-\fIscale_loc\fP
-.br
-Sets the location of the color scale. The possible values
-of \fIscale_loc\fP are:
- 	\fIscale_loc\fP = b:	bottom of plot
- 	\fIscale_loc\fP = t:	top of plot
- 	\fIscale_loc\fP = l:	left of plot
- 	\fIscale_loc\fP = r:	right of plot
-.br
-[Default \fIscale_loc\fP = b]
-.TP
-.B \-MGL
-[\fIf\fP][\fIx\fP]\fIlon0/lat0/slat/length\fP[\fIunits\fP][\fI+llabel\fP]
-.br
-Draws a simple map scale centered on \fIlon0/lat0\fP.
-Use \fB\-Lf\fP to get a "fancy" scale [Default is plain].
-Use \fB\-Lx\fP to specify the position in inches instead of map units.
-The scale is calculated at latitude \fIslat\fP; if the string "center" is used
-instead of a numerical value for \fIslat\fP, then the macro will set
-the scaling according to the center of the plot bounds.
-The scale length value \fIlength\fP is in km 
-by default, but the units can be specified as one of e|f|k|M|n|u, where
-e = meters, f = feet, k = kilometers, M = statue miles, n = nautical miles,
-and u = US survey feet. Append \fI+l\fP to label the scale with the
-relevant units, or append \fI+l"label"\fP to set a different label string.
-.TP
-.B \-MGQ
-\fIdpi\fP
-.br
-Sets the resolution in dots per inch of the raster image used
-for color fill maps. Larger values of \fIdpi\fP produce larger
-Postscript plot files. [Default is 100].
-.TP
-.B \-MGT
-\fIx/y/size/angle/font/just/text\fP
-.br
-Causes a text label to plotted on the map.
-\fIsize\fP is text size in points, \fIangle\fP is
-measured in degrees counter-clockwise from horizontal,
-\fIfontno\fP sets the font type, \fIjustify\fP sets the alignment.
-If \fIfontno\fP starts with a leading hyphen, then
-the remainder of \fIfontno\fP is taken to be a
-textstring with the desired fontname.  See the
-\fBgmtdefaults\fP man page for names and numbers of available fonts
-(or run \fBpstext \-L\fP).  The alignment
-number refers to the part of the textstring that will be mapped
-onto the (\fIx,y\fP) point: 1 = Lower Left corner,
-2 = Lower Center, 3 = Lower Right, 5 = Mid Left, 6 = Mid Center,
-7 = Mid Right, 9 = Upper Left, 10 = Upper Center,
-11 = Upper Right. This option may be given as many times as
-needed.
-.TP
-.B \-MGU
-[\fI/dx/dy/\fP][\fIlabel\fP]
-.br
-Draw Unix System time stamp on plot.  User may specify where the lower left corner
-of the stamp should fall on the page relative to lower left corner of plot in inch [Default is (-0.75,-0.75)].  Optionally,
-append a label, or \fBc\fP (which will plot the command string.)
-.TP
-\fB\-MMA\fP\fIfactor/mode/depth\fP
-This option determines how the along-track dimension of the
-beam or pixel footprints is calculated. If \fImode\fP = 1,
-then the fore-aft beam angle width of the sonar is used so that
-the width increases towards the outer parts of the swath.
-The fore-aft beam angle width (\fBMB-System\fP internally stores
-a value for each format/sonar) is multiplied by the \fIfactor\fP
-value; a \fIfactor\fP < 1.0 can be useful if the data highly
-oversamples the seafloor and a \fIfactor\fP > 1.0 can fill in
-plots of data which undersample the seafloor. If the data
-stream does not include depth values (e.g. one is plotting
-pure sidescan data), then the \fIdepth\fP value sets the
-depth value in meters used in the footprint calculations.
-If \fImode\fP = 2, then the along-track dimension of the beam
-or pixel footprints is just the along-track distance between
-pings multiplied by the \fIfactor\fP value.
-If mode = 3, then each data point is
-plotted as a point, and the factor and depth parameters
-are ignored.
-Default: \fIfactor\fP = 1.0, \fImode\fP = 1, \fIdepth\fP = 3000.0.
-.TP
-\fB\-MMB\fP\fIyr/mo/da/hr/mn/sc\fP
-Sets the starting time for data allowed in the input data; pings
-with times before the starting time will be ignored.
-Default: \fIyr/mo/da/hr/mn/sc\fP = 1962/2/21/10/30/0.
-.TP
-\fB\-MMD\fP\fImode/scale[/min/max]\fP
-Sets scaling of beam amplitude or sidescan pixel values which
-can be applied before plotting. If \fImode\fP = 1 or 2, then
-a linear scaling of the form:
- 	scaled_value = scale * (value \- min) / (max \- min)
-.br
-is applied.  If \fImode\fP = 3 or 4, then a log10 scaling of
-the form:
- 	scaled_value = scale * (20 * log10(value) \- min) / (max \- min)
-.br
-is applied.  If \fImode\fP = 2 or 4, then the value (or 20*log10(value))
-will be clipped to \fImin\fP if it is smaller than \fImin\fP or \fImax\fP
-if it is greater than \fImax\fP; this clipping happens prior to the
-multiplication by \fIscale\fP. Default: \fImode\fP = 1, \fIscale\fP = 1.0,
-\fImin\fP = 0.0, \fImax\fP = 1.0.
-.TP
-\fB\-MME\fP\fIyr/mo/da/hr/mn/sc\fP
-Sets the ending time for data allowed in the input data; pings
-with times after the ending time will be ignored.
-Default: \fIyr/mo/da/hr/mn/sc\fP = 2062/2/21/10/30/0.
-.TP
-\fB\-MML\fP\fIlonflip\fP
-If the \fB\-R\fP option is not used to explicitly set the plot bounds, then
-the \fIlonflip\fP value sets the range of the longitude values used for
-calculating the desired bounds.  If  lonflip=\-1
-then  the  longitude  values will be in the range from \-360 to 0
-degrees. If lonflip=0 then the longitude values will be  in  the
-range  from \-180 to 180 degrees. If lonflip=1 then the longitude
-values will be in the range from 0  to  360  degrees.   Default:
-\fBmbm_plot\fP uses the \fIlonflip\fP value set by \fBmbdefaults\fP.
-.TP
-\fB\-MMN\fP\fInplot\fP
-Sets the number of pings to be read in before each contouring
-episode. See the description of the \fB\-MMZ\fP\fIalgorithm\fP option
-for advice on reasonable values
-Default: \fInplot\fP = 50 unless \fB\-MMZ\fP\fI1\fP is specified,
-in which case the default is \fInplot\fP = 5.
-.TP
-.B \-MMP\
-\fIpings \fP
-.br
-Sets the ping averaging of the input swath sonar data. If \fIpings\fP = 1, then
-no ping averaging is performed. If \fIpings\fP > 0, then
-that number of input pings will be averaged to produce one output
-ping.  If \fIpings\fP = 0, then the ping averaging will automatically
-be done so that the along-track ping spacing is equal to the across-track
-beam spacing.
-Default: \fIpings\fP = 1 (no ping averaging).
-.TP
-\fB\-MMS\fP\fIspeedmin\fP
-Sets the minimum speed in km/hr (5.5 kts ~ 10 km/hr) allowed in
-the input data; pings associated with a smaller ship speed will not be
-processed. Default: \fIspeed\fP = 0.
-.TP
-.B \-MMT
-\fItimegap\fP
-.br
-Sets the maximum time gap in minutes between adjacent pings allowed before
-the data is considered to have a gap. Default: \fItimegap\fP = 1.
-.TP
-.B \-MMZ
-\fIalgorithm\fP
-.br
-Sets the contouring algorithm to be used. If \fIalgorithm\fP=0,
-a simple ping to ping contouring approach is used; this algorithm
-is fast but produces poor looking contours when used with data
-where beams from one ping may lie "behind" beams from previous
-pings (this happens for sonars that ping at nonnull pitch
-angles or for the "inside" beams when ships make sharp turns).
-If \fIalgorithm\fP=1 then a triangular network is constructed from
-the available soundings and this network is in turn contoured;
-this algorithm is slow but produces good looking contours in
-most cases. It is important to note that the time required for
-"triangle" algorithm increases with the square of the number
-of beams to be contoured; thus it is sensible to keep the number
-of pings contoured at a time small (e.g. use \fB\-N\fP\fI5\fP).
-The time required for the "ping to ping" algorithm varies linearly
-with the number of pings contoured; thus larger numbers of pings
-may be reasonably contoured at a time (e.g. use \fB\-N\fP\fI50\fP).
-Default: \fIalgorithm\fP = 0 unless \fIformat\fP = 41.
-.TP
-.B \-MNA
-\fI[nhgt[/P] | P]\fP
-.br
-Turns on filename annotation of navigation tracks. If \fB\-MNA\fP is given
-without specifying any controlling parameters, then the lettering height
-\fInhgt\fP is 0.15 and the filenames are plotted parallel to the
-navigation track from the start of the track. The lettering height can be
-specified using either \fB\-MNA\fP\fInhgt\fP or \fB\-MNA\fP\fInhgt/P\fP.
-If \fB\-MNA\fP\fIP\fP or \fB\-MNA\fP\fInhgt/P\fP is specified,
-the filename will be plotted perpendicular to the navigation track.
-Filename annotation can also be specified using the \fB\-N\fP option.
-Defaults: Filename annotation off.
-.TP
-.B \-MNP
-\fI[pingnumber_tick/pingnumber_annot/pingnumber_tick_len]\fP
-.br
-Turns on ping number (or shot number) annotation of navigation tracks.
-Tick marks are made along the shiptrack at \fIpingnumber_tick\fP intervals; these
-are \fItlen\fP inches long. Longer tick marks are made along the
-shiptrack at \fIpingnumber_annot\fP intervals; these are 1.5 times \fItlen\fP
-inches long.
-Defaults: Pingnumber annotation off. If the \fB\-MNP\fP option is given without
-specifying the controlling parameters, then \fIpingnumber_tick\fP = 50,
-\fIpingnumber_annot\fP = 100, and \fIpingnumber_tick_len\fP = 0.1.
-.TP
-.B \-MTC
-\fIfill\fP
-.br
-Coastline plotting option.
-Set the shade (0-255), color (r/g/b), or pattern
-(p|Pdpi/pattern; see \fB\-MTG\fP) for lakes  [Default is the
-fill chosen for "wet" areas (-S)].
-.TP
-.B \-MTD
-\fIresolution\fP
-.br
-Coastline plotting option.
-Selects the resolution of the coastline data set to use ((f)ull,
-(h)igh, (i)ntermediate, (1)ow, and (c)rude).  The
-resolution drops off by 80% between data sets. [Default
-is l].
-.TP
-.B \-MTG
-\fIfill\fP
-.br
-Coastline plotting option.
-Select painting or clipping of "dry" areas.  Append a
-shade, color, pattern, or c for clipping.  Specify the
-shade (0-255) or color (r/g/b), or \fB\-MTG\fP\fIpdpi/pattern\fP,
-where pattern gives the number of the built-in pattern
-(1-90) OR the name of a Sun 1-, 8-, or 24-bit raster
-file.  dpi sets the resolution of the image.  See \fBGMT\fP
-Cookbook & Technical Reference Appendix E for
-information on individual patterns.
-.TP
-.B \-MTI
-\fIriver[/pen]\fP
-.br
-Coastline plotting option.
-Draw rivers.  Specify the type of rivers and
-[optionally] append pen attributes  [Default pen:
-width = 1, color = 0/0/0, texture = solid].  Choose
-from the list of river types below.  Repeat option \-I
-as often as necessary.
-     1 = Permanent major rivers
-     2 = Additional major rivers
-     3 = Additional rivers
-     4 = Minor rivers
-     5 = Intermittent rivers \- major
-     6 = Intermittent rivers \- additional
-     7 = Intermittent rivers \- minor
-     8 = Major canals
-     9 = Minor canals
-     10 = Irrigation canals
-     a = All rivers and canals (1-10)
-     r = All permanent rivers (1-4)
-     i = All intermittent rivers (5-7)
-     c = All canals (8-10)
-.TP
-.B \-MTN
-\fIborder[/pen]\fP
-.br
-Coastline plotting option.
-Draw political boundaries.  Specify the type of
-boundary and [optionally] append pen attributes
-[Default pen:  width = 1, color = 0/0/0, texture =
-solid].  Choose from the list of boundaries below.
-Repeat option \fB\-MTN\fP as often as necessary.
-     1 = National boundaries
-     2 = State boundaries within the Americas
-     3 = Marine boundaries
-     a = All boundaries (1-3)
-.TP
-.B \-MTS
-\fIfill\fP
-.br
-Coastline plotting option.
-Select painting or clipping of "wet" areas.  Append the
-shade (0-255), color (r/g/b), pattern (see \fB\-MTG\fP), or c
-for clipping.
-.TP
-.B \-MTW
-\fIpen\fP
-.br
-Coastline plotting option.
-Append pen attributes  [Defaults:  width = 1, color = 0/0/0,
-texture = solid].
-.TP
-.B \-MXG
-\fIfill\fP
-.br
-Select filling of symbols for xy plotting.
-Set the shade (0-255) or color
-(r/g/b) [Default is no fill]. To reset no fill,
-use \fIfill\fP = "N".
-For polygons, you may optionally specify
-\fB\-Gp\fP\fIicon_size/pattern\fP, where
-\fIpattern\fP gives the number of the
-image pattern (1-32) OR the name of a
-icon-format file.  \fIicon_size\fP sets
-the unit size in inch.
-To invert black and white pixels, use
-\fB\-GP\fP instead of \fB\-Gp\fP.  See
-\fBGMTs\fP Cookbook & Technical Reference
-Appendix E for information on individual patterns.
-.TP
-.B \-MXI
-\fIxy_file \fP
-.br
-Specifies a file containing (x,y) pairs to be plotted
-as lines or symbols. The line and symbol characteristics
-are set using the last \fB\-MXG\fP, \fB\-MXS\fP, and \fB\-MXW\fP
-options used. All of the \fB\-MX\fP commands can be
-given multiple times, so by stringing series of these
-commands together the user can plot different files
-using different line or symbol characteristics.
-[Default is a solid black line].
-.TP
-.B \-MXM
-.br
-Toggles expectation for xy data files having multiple
-segments, in which each segment is to be plotted
-separately. Segments are separated by a
-record whose first character is '>'. By default,
-unsegmented files are expected. Users may give this
-command multiple times, allowing some input files to
-be handled as segmented and others not.
-.TP
-.B \-MXS
-\fIsymbol/size\fP
-.br
-Selects symbol to be used for plotting the next xy data
-file. Setting \fIsymbol\fP = "N" causes line plotting.
-Choose between:
-.TP
-.B \-MXSa
-st\fBa\fPr.  \fIsize\fP is radius of circumscribing circle.
-.TP
-.B \-MXSb
-\fBb\fPar extending from \fIbase\fP to y.  \fIsize\fP is bar width.  By default,
-\fIbase\fP = 0.  Append /\fIbase\fP to change this value.  Append \fBu\fP if \fIsize\fP
-is in x-units [Default is inch].
-.TP
-.B \-MXSc
-\fBc\fPircle.  \fIsize\fP is diameter of circle.
-.TP
-.B \-MXSd
-\fBd\fPiamond.  \fIsize\fP is side of diamond.
-.TP
-.B \-MXSe
-\fBe\fPllipse.  Direction (in degrees counterclockwise from horizontal), major_axis (in inch), and minor_axis (in inch) must be found in columns 3, 4, and 5.
-.TP
-.B \-MXSf
-\fBf\fPault.  Give distance gap between ticks and ticklength in inch.  If gap is
-negative, it is interpreted to mean number of ticks instead.  Append \fBl\fP or \fBr\fP to draw tick on
-the left or right side of line [Default is centered].  Upper case \fBL\fP or \fBR\fP draws a triangle
-instead of line segment.
-.TP
-.B \-MXSh
-\fBh\fPexagon.  Give side in inch.
-.TP
-.B \-MXSi
-\fBi\fPnverted triangle.  Give side in inch.
-.TP
-.B \-MXSl
-\fBl\fPetter or text string.  Give size in inch, and append /\fIstring\fP after the size.  Note that the size is only approximate; no individual scaling
-is done for different characters.  Remember to escape special characters like *.
-.TP
-.B \-MXSp
-\fBp\fPoint.  No size needs to be specified (1 pixel is used).
-.TP
-.B \-MXSs
-\fBs\fPquare.  Give side in inch.
-.TP
-.B \-MXSt
-\fBt\fPriangle.  Give side in inch.
-.TP
-.B \-MXSv
-\fBv\fPector.  Direction (in degrees counterclockwise from horizontal) and length (in inch) must be found in columns 3 and 4.  \fIsize\fP,
-if present, will be interpreted as arrowwidth/headlength/headwidth (in inch) [Default is 0.03/0.12/0.1 inch].
-By default arrow attributes remains invariant to the length
-of the arrow.  To have the size of the vector scale down with decreasing size,
-append n\fPnorm\fP, where vectors shorter than \fInorm\fP will have their
-attributes scaled by length/\fInorm\fP.
-.TP
-.B \-MXSV
-Same as \fB\-MXSv\fP, except azimuth (in degrees east of north) should be given instead of direction.  The azimuth will
-be mapped into an angle based on the chosen map projection (\fB\-MXSv\fP leaves the directions
-unchanged.)
-.TP
-.B \-MXSx
-cross.  Give length in inch.
-.TP
-.B \-MXW
-\fIpen\fP
-.br
-Set pen attributes for xy plotting. See chapter 4.12 in the
-GMT Technical reference for a discussion of GMT pen values.
-[Defaults: width = 1, color = 0/0/0,
-texture = solid].
-.TP
-.B \-N
-\fI[ttick/tannot/dannot/tlen[/nhgt/nperp]] | F | FP]\fP
-.br
-This option causes a navigation track plot to be generated, and
-can also set the start of each swath file to be annotated with the
-filename. If the \fB\-N\fP option is given alone, then the
-navigation track will be plotted without any annotation,  The optional
-parameters allow users to control the details of the navigation
-track annotation. Time marks are made with "X" marks along the
-shiptrack; annotated time marks show the time in HH:MM format
-next to the time mark and annotated date marks show the time
-and julian day in HH:MM/DDD format.  The "X" marks are
-\fItlen\fP inches high for normal time marks and
-1.5 times \fItlen\fP inches high for annotated time or date
-marks.  The interval of time ticks, annotated time ticks, and
-annotated date ticks are given in hours by \fIttick\fP,
-\fItannot\fP, and \fIdannot\fP, respectively.
-If the \fInhgt\fP parameter is not given when the other parameters
-are specified, then no filename annotation will be done. If given,
-\fInhgt\fP sets the height in inches of the filename annotation
-and turns that annotation on. If given as 1, \fInperp\fP causes
-the filename annotation to be perpendicular to the shiptrack rather
-than parallel (the default). If the \fB\-N\fP\fIF\fP is given, then
-a navigation track will be generated using the default parameters
-and also with filename annotation along the shiptrack. If the
-\fB\-N\fP\fIFP\fP is given, then a navigation track will be generated
-with the default parameters and also with filename annotation
-perpendicular to the shiptrack.
-Defaults if annotation is enabled: \fIttick\fP = 0.25;
-\fItannot\fP = 1.0; \fIdannot\fP = 4.0;
-\fItlen\fP = 0.1; \fInhgt\fP = 0.1; \fInperp\fP = 0.
-.TP
-.B \-O
-\fIroot\fP
-.br
-Sets the root used to construct the filename of the output shellscript
-(\fIroot\fP.cmd) and names of files created when the shellscript is
-run.  By default, the
-name of the input data file or list file is used as the \fIroot\fP.
-.TP
-.B \-P
-\fIpagesize\fP
-.br
-This option sets the size of the page the plot will be centered
-on. If the user does not set the plot scale, the plot will be
-sized as large as will fit on the designated page. If the user
-sets the plot scale such that the plot will not fit on the
-designated page, a larger page will be used.
-The supported page sizes are:
-
-          American ANSI sizes:
-          A     8.5 x 11.0 in.    ( 215.9 x  279.4 mm)
-          B    11.0 x 17.0 in.    ( 279.4 x  431.8 mm)
-          C    17.0 x 22.0 in.    ( 431.8 x  558.8 mm)
-          D    22.0 x 34.0 in.    ( 558.8 x  863.6 mm)
-          E    34.0 x 44.0 in.    ( 863.6 x 1117.6 mm)
-          F    28.0 x 40.0 in.    ( 711.2 x 1016.0 mm)
-          E1   44.0 x 68.0 in.    (1117.6 x 1727.2 mm)
-
-          Metric ISO A sizes:
-          A0   841.0 x 1189.0 mm  (33.11 x 46.81 in.)
-          A1   594.0 x  841.0 mm  (23.39 x 33.11 in.)
-          A2   420.0 x  594.0 mm  (16.54 x 23.39 in.)
-          A3   297.0 x  420.0 mm  (11.69 x 16.54 in.)
-          A4   210.0 x  297.0 mm  ( 8.27 x 11.69 in.)
-          A5   148.0 x  210.0 mm  ( 5.83 x  8.27 in.)
-          A6   105.0 x  148.0 mm  ( 4.13 x  5.83 in.)
-          A7    74.0 x  105.0 mm  ( 2.91 x  4.13 in.)
-          A8    52.0 x   74.0 mm  ( 2.05 x  2.91 in.)
-          A9    37.0 x   52.0 mm  ( 1.46 x  2.05 in.)
-          A10   26.0 x   37.0 mm  ( 1.02 x  1.46 in.)
-
-          Metric ISO B sizes:
-          B0   1000.0x 1414.0 mm  (39.37 x 55.67 in.)
-          B1   707.0 x 1000.0 mm  (27.83 x 39.37 in.)
-          B2   500.0 x  707.0 mm  (19.68 x 27.83 in.)
-          B3   353.0 x  500.0 mm  (13.90 x 19.68 in.)
-          B4   250.0 x  353.0 mm  ( 9.84 x 13.90 in.)
-          B5   176.0 x  250.0 mm  ( 6.93 x  9.84 in.)
-          B6   125.0 x  176.0 mm  ( 4.92 x  6.93 in.)
-          B7    88.0 x  125.0 mm  ( 3.46 x  4.92 in.)
-          B8    62.0 x   88.0 mm  ( 2.44 x  3.46 in.)
-          B9    44.0 x   62.0 mm  ( 1.73 x  2.44 in.)
-          B10   31.0 x   44.0 mm  ( 1.22 x  1.73 in.)
-
-          Metric ISO C sizes:
-          C0   914.4 x 1300.5 mm  (36.00 x 51.20 in.)
-          C1   650.2 x  914.4 mm  (25.60 x 36.00 in.)
-          C2   457.2 x  650.2 mm  (18.00 x 25.60 in.)
-          C3   325.1 x  457.2 mm  (12.80 x 18.00 in.)
-          C4   228.6 x  325.1 mm  ( 9.00 x 12.80 in.)
-          C5   162.6 x  228.6 mm  ( 6.40 x  9.00 in.)
-          C6   114.3 x  162.6 mm  ( 4.50 x  6.40 in.)
-          C7    81.3 x  114.3 mm  ( 3.20 x  4.50 in.)
-
-	  MB-System large format sizes:
-          m1  1371.6 x 1828.8 mm  (54.00 x 72.00 in.)
-          m2  1371.6 x 2133.6 mm  (54.00 x 84.00 in.)
-          m3  1371.6 x 2438.4 mm  (54.00 x 96.00 in.)
-          m4  1524.0 x 1828.8 mm  (60.00 x 72.00 in.)
-          m5  1524.0 x 2133.6 mm  (60.00 x 84.00 in.)
-          m6  1524.0 x 2438.4 mm  (60.00 x 96.00 in.)
-
-The default page size is A.
-.TP
-.B \-Q
-Normally, the output plot generation shellscript
-includes lines which execute
-a program to display the Postscript image on the screen.
-This option causes those lines to be commented out so
-that executing the shellscript produces a Postscript plot
-but does not attempt to display it on the screen.
-Alternatively, invoking the plot generation shellscript with
-a \fB-N\fP command line argument also suppresses the screen
-display of the plot. The program
-to be used to display the Postscript is set
-using \fBmbdefaults\fP;
-the default value can be overridden by setting the environment
-variable $MB_PS_VIEWER.
-.TP
-.B \-R
-\fIwest/east/south/north\fP
-.br
-Sets the longitude and latitude bounds within which swath sonar
-data will be read. Normally the bounds are automatically chosen
-to include all of the input data.
-.TP
-.B \-S
-\fI[color/shade]\fP
-.br
-This option enables effective histogram equalization of the
-color and/or shading of thedata. The equalization is
-not achieved by changing the data values, but rather by
-constructing the color or shading tables so that
-the boundaries in the tables encompass equal fractions of
-the datapoints. This serves to focus color or shading contrasts
-in value ranges corresponding to the bulk of the data values,
-and is particularly useful for
-enhancing the contrast of sidescan and beam amplitude plots.
-If \fB\-S\fP is given alone or with \fIcolor\fP = 1,
-it enables equalization of the color table used
-for color or gray fill plots,  shaded or unshaded. If the plot
-is to be shaded,  either by synthetic illumination (\fB\-G\fP\fI2\fP)
-or by overlaying amplitude data (\fB\-G\fP\fI3\fP option), then
-setting \fIshade\fP = 1 will cause the shading to be equalized.
-Using \fB\-S\fP\fI0/1\fP will equalize the shading without
-equalizing the color table.
-.TP
-.B \-T
-If \fB\-T\fP is given, it causes a coastline to be drawn
-on the map. The default is to draw the coastline and shade
-all dry land a uniform gray. To exercise greater control of
-the coastline plotting, use the
-\fB\-MTC\fP, \fB\-MTD\fP, \fB\-MTG\fP, \fB\-MTI\fP,
-\fB\-MTN\fP, \fB\-MTS\fP, and \fB\-MTW\fP options described in the
-.TP
-.B \-U
-\fIorientation\fP
-.br
-Normally the orientation of the plot (portrait or landscape)
-is selected automatically so as to maximize the plot scale.
-The \fB\-U\fP option allows the user to set the plot orientation. If
-\fIorientation\fP = 1, a portrait plot will be produced; if
-\fIorientation\fP = 2, a landscape plot will be produced.
-.TP
-.B \-V
-Causes \fBmbm_plot\fP to operate in "verbose" mode so that it
-outputs more information than usual.
-.TP
-.B \-W
-\fI[color_style\fP[\fI/palette\fP[\fIncolors\fP]] | cptfile]
-.br
-This option controls the color scheme used for color
-fill plots.
-
-If \fIcolor_style\fP = 1 [default], then
-the color scheme used will be a continuous grading
-of colors. If \fIcolor_style\fP = 2, the color scheme
-will be a set of discrete color intervals. The color
-palette used is set using \fIpalette\fP. Seven palettes
-are available:
- 	\fIpalette\fP = 1:	Haxby colors [default]
- 	\fIpalette\fP = 2:	high Intensity colors
- 	\fIpalette\fP = 3:	low Intensity colors
- 	\fIpalette\fP = 4:	grayscale
- 	\fIpalette\fP = 5:	uniform grayscale
- 	\fIpalette\fP = 6:	uniform black
- 	\fIpalette\fP = 7:	uniform white
-
-The RGB definitions of the color palettes are:
-
-color palette 1 \- Haxby Color Table
-  red:   255 255 255 255 240 205 138 106  50  40  37
-  green: 255 186 161 189 236 255 236 235 190 127  57
-  blue:  255 133  68  87 121 162 174 255 255 251 175
-
-color palette 2 \- High Intensity Colors
-  red:   255 255 255 255 128   0   0   0   0 128 255
-  green:   0  64 128 255 255 255 255 128   0   0   0
-  blue:    0   0   0   0   0   0 255 255 255 255 255
-
-color palette 3 \- Low Intensity Colors
-  red:   200 194 179 141  90   0   0   0   0  90 141
-  green:   0  49  90 141 179 200 141  90   0   0   0
-  blue:    0   0   0   0   0   0 141 179 200 179 141
-
-color palette 4 \- Grayscale
-  red:   255 230 204 179 153 128 102  77  51  26   0
-  green: 255 230 204 179 153 128 102  77  51  26   0
-  blue:  255 230 204 179 153 128 102  77  51  26   0
-
-color palette 5 \- Uniform Grayscale
-  red:   128 128 128 128 128 128 128 128 128 128 128
-  green: 128 128 128 128 128 128 128 128 128 128 128
-  blue:  128 128 128 128 128 128 128 128 128 128 128
-
-color palette 6 \- Uniform Black
-  red:     0   0   0   0   0   0   0   0   0   0   0
-  green:   0   0   0   0   0   0   0   0   0   0   0
-  blue:    0   0   0   0   0   0   0   0   0   0   0
-
-color palette 7 \- Uniform White
-  red:   255 255 255 255 255 255 255 255 255 255 255
-  green: 255 255 255 255 255 255 255 255 255 255 255
-  blue:  255 255 255 255 255 255 255 255 255 255 255
-
-The Haxby colors have been adapted from a palette
-developed by Dr. William Haxby of the Lamont-Doherty
-Earth Observatory; this palette is pleasing to the
-eye and well suited for shading. The high intensity
-colors describe linear paths through RGB space from
-red to blue to green to purple; because the colors are high
-intensity they are not well suited to shading.
-The low intensity colors are similar to the high
-intensity, but muted and thus well suited to shading.
-The grayscale palette runs linearly from white to
-black and is commonly used for plots of sidescan and amplitude
-data. The uniform grayscale is useful for non-color
-shaded relief plots.
-
-The \fIncolors\fP parameter sets the number of color
-values used in plotting, whether the colors are
-represented in a continuous color scale or a
-stepped, discrete color scale [default is 11].
-
-If the option argument is the path to an existing \fBGMT\fP
-color palette (CPT) file, then that CPT file and its
-color scheme will be used for the plot
-.TP
-.B \-X
-Normally, \fBmbm_plot\fP creates an executable shellscript and
-then exits.  This option will cause the shellscript to be executed
-in the background before \fBmbm_plot\fP exits.
-.TP
-.B \-Y
-Normally, \fBmbm_plot\fP generates nicely rounded numbers
-for the boundaries of the color palette. Often, the resulting
-color bounds extend well outside the range of the gridded data.
-This option causes
-the color boundaries to be uniformly distributed between the
-minimum and maximum values of the grid.
-.TP
-.B \-Z
-\fImin/max\fP
-.br
-This option overrides the minimum and maximum values of
-bathymetry data, affecting the color palette and the
-contour interval if those parameters are not specified
-by the user.
-
-.SH EXAMPLES
-Suppose we have obtained a swath sonar data file called
-sb2112_example.mb41 collected using a SeaBeam 2112 sonar.
-This file contains bathymetry, beam amplitude, and
-sidescan data. In order to obtain initial views of the
-data in the file, we use \fBmbm_plot\fP to generate
-shellscripts which in turn generate plots when executed.
-The following five commands generate plotting shellscripts
-for color fill bathymetry overlaid with contours, color shaded
-relief bathymetry, color fill bathymetry overlaid with
-amplitudes, grayscale amplitudes, and grayscale sidescan,
-respectively:
-
- 	mbm_plot \-F41 \-I sb2112_example.mb41 \-G1 \-C    \\
- 		-N \-V \-Obathcont
- 	mbm_plot \-F41 \-I sb2112_example.mb41 \-G2       \\
- 		-N \-V \-Obathshade
- 	mbm_plot \-F41 \-I sb2112_example.mb41 \-G3 \-S0/1 \\
- 		-N \-V \-Obathamp
- 	mbm_plot \-F41 \-I sb2112_example.mb41 \-G4 \-S    \\
- 		-N \-V \-Oamp
- 	mbm_plot \-F41 \-I sb2112_example.mb41 \-G5 \-S    \\
- 		-N \-V \-Oss
-
-When the following shellscripts are executed, each will
-generate a postscript plot file and then display the plot
-on the screen:
-
- 	bathcont.cmd
- 	bathshade.cmd
- 	bathamp.cmd
- 	amp.cmd
- 	ss.cmd
-
-Note that we use the \fB\-S\fP option to apply histogram
-equalization to the amplitude and sidescan data, but not
-the bathymetry data. Also note that by specifying \fB\-N\fP
-we obtain a track plot of the ship's navigation overlaid
-on the color or grayscale file plots.
-
-Now suppose we have a set of SeaBeam 2112 data files
-comprising a short survey and that we want a plot
-of all the data together.  We create an ASCII text file which has
-a list of the filenames, each followed by the appropriate \fBMBIO\fP
-format id number, e.g.:
-
- 	sb2112_example_1.mb41 41
- 	sb2112_example_2.mb41 41
- 	sb2112_example_3.mb41 41
-
-If the name of the data file list is "datalist", then
-using "\fB\-F\fP\fI-1\fP \fB\-I\fP\fIdatalist\fP" will
-cause the macro to operate on all of the files
-together.  We desire a plot including color fill bathymetry
-overlaid with 25 meter contours and the ship's navigation.
-For this plot, we want a very bright colortable and we would like
-the colors to be discretely stepped rather than continuous;
-thus we use \fB\-W\fP\fI2/2\fP. We also choose to use the
-\fB\-X\fP option, which causes \fBmbm_plot\fP to execute
-the shellscript it creates in the background before
-exiting. The \fBmbm_plot\fP command is:
-
- 	mbm_plot \-F-1 \-Idatalist \-G1 \-C25 \-N \\
- 			-X \-V \-Obathtest
-
-As an example, the contents of the plotting shellscript
-"bathtest.cmd" are:
-
- #
- # Shellscript to create Postscript plot of swath sonar data
- # Created by macro mbm_plot
- #
- # This shellscript created by following command line:
- # mbm_plot \-F-1 \-Idatalist \-G1 \-C25 \-N \-V \-Obathtest
- #
- # Save existing GMT defaults
- echo Saving GMT defaults...
- gmtdefaults \-L > gmtdefaults$$
- #
- # Set new GMT defaults
- echo Setting new GMT defaults...
- gmtset ANOT_FONT Helvetica
- gmtset LABEL_FONT Helvetica
- gmtset HEADER_FONT Helvetica
- gmtset ANOT_FONT_SIZE 8
- gmtset LABEL_FONT_SIZE 8
- gmtset HEADER_FONT_SIZE 10
- gmtset FRAME_WIDTH 0.074999999999999997
- gmtset TICK_LENGTH 0.074999999999999997
- gmtset PAGE_ORIENTATION LANDSCAPE
- gmtset COLOR_BACKGROUND 0/0/0
- gmtset COLOR_FOREGROUND 255/255/255
- gmtset COLOR_NAN 255/255/255
- #
- # Make color palette table file
- echo Making color palette table file...
- echo   2975 255 255 255   3150 255 186 133 > bathtest.cpt
- echo   3150 255 186 133   3325 255 161  68 >> bathtest.cpt
- echo   3325 255 161  68   3500 255 189  87 >> bathtest.cpt
- echo   3500 255 189  87   3675 240 236 121 >> bathtest.cpt
- echo   3675 240 236 121   3850 205 255 162 >> bathtest.cpt
- echo   3850 205 255 162   4025 138 236 174 >> bathtest.cpt
- echo   4025 138 236 174   4200 106 235 255 >> bathtest.cpt
- echo   4200 106 235 255   4375  50 190 255 >> bathtest.cpt
- echo   4375  50 190 255   4550  40 127 251 >> bathtest.cpt
- echo   4550  40 127 251   4725  37  57 175 >> bathtest.cpt
- #
- # Run mbswath
- echo Running mbswath...
- mbswath \-f-1 \-Idatalist \\
- 	-Jm22.198543775528325 \\
- 	-R114.210795/114.430905/-31.91322/-31.62458 \\
- 	-Cbathtest.cpt \\
- 	-p1 \-A1 \-Z1 \\
- 	-p1 \\
- 	-P \-X1.8069392647842304 \-Y2 \-K \-V > bathtest.ps
- #
- # Run mbcontour
- echo Running mbcontour...
- mbcontour \-f-1 \-Idatalist \\
- 	-Jm22.198543775528325 \\
- 	-R114.210795/114.430905/-31.91322/-31.62458 \\
- 	-A50/100000/100000/100000/0.01/0.1 \\
- 	-D0.25/1/4/0.15 \\
-  	-p1 \\
- 	-P \-K \-O \-V >> bathtest.ps
- #
- # Make color scale
- echo Running psscale...
- psscale \-Cbathtest.cpt \\
- 	-D2.4431/-0.5000/4.8861/0.1500h \\
- 	-B":.Depth (meters):" \\
- 	-P \-K \-O \-V >> bathtest.ps
- #
- # Make basemap
- echo Running psbasemap...
- psbasemap \-Jm22.198543775528325 \\
- 	-R114.210795/114.430905/-31.91322/-31.62458 \\
- 	-B5m/5m:."Data List File datalist": \\
- 	-P \-O \-V >> bathtest.ps
- #
- # Delete surplus files
- echo Deleting surplus files...
- rm \-f bathtest.cpt
- #
- # Reset GMT default fonts
- echo Resetting GMT fonts...
- mv gmtdefaults$$ .gmtdefaults
- #
- # Run xpsview
- echo Running xpsview in background...
- xpsview \-ps a \-maxp 4m bathtest.ps &
- #
- # All done!
- echo All done!
-
-.SH SEE ALSO
-\fBmbsystem\fP(1), \fBmbcontour\fP(1),
-\fBmbswath\fP(1), \fBmbdefaults\fP(1),
-\fBmbm_grdplot\fP(1), \fBmbm_grd3dplot\fP(1), \fBmbfilter\fP(1)
-
-.SH BUGS
-By making this macro more useful, we have also made it
-more complex.
diff --git a/src/man/man1/mbm_route2mission.1 b/src/man/man1/mbm_route2mission.1
deleted file mode 100644
index 5b9b155..0000000
--- a/src/man/man1/mbm_route2mission.1
+++ /dev/null
@@ -1,427 +0,0 @@
-.TH mbm_route2mission 1 "22 February 2015" "MB-System 5.0" "MB-System 5.0"
-.SH NAME
-\fBmbm_route2mission\fP \- Macro to convert an \fBmbgrdviz\fP route file into an
-MBARI AUV mission script.
-
-.SH VERSION
-Version 5.0\fP
-
-.SH SYNOPSIS
-\fBmbm_route2mission\fP \fB\-I\fP\fIroutefile\fP
-[\fB\-A\fP\fIaltmin/altabort[/altdesired[/altdesired2[/altdesired3]]]\fP
-\fB\-B\fP\fIbehavior\fP \fB\-C\fP\fImissiontime\fP
-\fB\-D\fP\fIdepthconstant[/depthconstant2]\fP
-\fB\-F\fP\fIforwarddistance\fP \fB\-G\fP\fIgpsmode\fP
-\fB\-J\fP\fIdepthprofilefile\fP \fB\-L\fP\fIapproachdepth\fP
-\fB\-M\fP\fI[sensorlist]\fP \fB\-N\fP[\fIspiraldescentaltitude\fP] \fB\-O\fP\fImissionfile\fP
-\fB\-P\fP\fI[startlon/startlat | startdistance]\fP
-\fB\-R\fP\fItransmitpower/receivegain[/rangeminfraction[/pulsewidth]]\fP
-\fB\-S\fP\fIspeed\fP \fB\-T\fP\fIstarttime\fP \fB\-U\fP\fImaxclimbrate\fP
-\fB\-W\fP\fIwaypointspacing\fP \fB\-V\fP \fB\-H\fP]
-
-.SH DESCRIPTION
-\fBmbm_route2mission\fP \- Macro to convert an \fBmbgrdviz\fP route file into an
-MBARI AUV mission script.
-
-MBARI Autonomous Underwater Vehicles, or AUVs, are controlled using a layered
-behavior system that is specified using a mission script. This macro generates
-an MBARI AUV mission script from an \fBMB-System\fP route file such as those
-generated interactively using \fBMBgrdviz\fP. The output MBARI AUV mission script
-is named using a ".cfg" suffix. A Winfrog waypoint file (ending in ".pts") is also
-output which mirrors the waypoints in the input route file.
-
-The output AUV mission script includes safety behaviors that operate throughout
-a mission (e.g. missionTimer sets a mission timeout duration, and depthEnvelope
-sets depth and altitude limits). The script also includes the sequential behaviors
-required to take a vehicle from the start of a mission at the surface, obtaining
-the initial position from GPS, descent to depth, flying to the starting waypoint,
-running the desired survey lines with a desired depth or altitude profile,
-ascent to the surface, and reacquiring positioning from GPS. For seafloor mapping
-surveys, sonar settings and data logging are also controlled through the
-mission script.
-
-The input route file specifies a survey mission as a set of sequential waypoints,
-and also includes the depth profile between those waypoints. Waypoints may be
-ordinary, the start of a survey line, or the end of a survey line (the start and
-end line waypoints are generated using the survey route planning feature of
-\fBMBgrdviz\fP). The spacing  of the depth profile points between the waypoints
-derives from the bathymetric grid used to generate the route.
-
-The output mission specifies a larger number of waypoints than the input route file.
-The mission waypoints are generated every \fIwaypointspacing\fP meters (specified
-with the \fB\-W\fP option), and the AUV is commanded to fly at particular depths (or
-depth profiles) between each waypoint. By default, the AUV will be flown using a control
-behavior called WaypointDepth in which the commanded vehicle depth follows a linearly
-interpolated profile between the depth at the starting waypoint and the depth
-at the ending waypoint. The simpler alternative waypoint behavior specifies a
-single vehicle depth while flying to the next mission; as it begins each segment
-the vehicle will ascend or descend sharply to the desired depth and then fly
-level until the next waypoint is reached.
-
-The \fB\-A\fP option allows the user to set the basic vehicle
-altitude control. The vehicle's vertical position will be simulatneously controlled
-in terms of both altitude above the bottom and depth below the sea surface. The commanded
-depth between each waypoint is calculated by \fBmbm_route2mission\fP (using the bathymetry
-profiles in the input route file) to produce a vehicle altitude that is \fIaltdesired\fP
-meters above the shallowest depth looking \fIforwarddistance\fP meters ahead. The
-forward looking feature allows the vehicle to be commanded to ascend prior to reaching
-large scarps. As the mission commences, the AUV attempts to fly at the commanded depth
-unless that would result in an altitude less than \fIaltmin\fP meters. In that
-circumstance, the vehicle flies in an altitude-following mode. Thus, for consistent
-bottom-following, a common approach is to set \fIaltmin\fP to the desired
-altitude and to set \fIaltdesired\fP to a value slightly smaller than \fIaltmin\fP.
-This strategy allows the look-ahead feature to bring the vehicle safely over steep rises
-while otherwise maintaining a constant altitude.
-
-The \fB\-G\fP option allows the user to specify that the vehicle ascend to the surface
-and reset positioning  with GPS at the beginning and/or end of survey lines.
-
-The \fB\-N\fP option allows the user to specify that the vehicle first move to the
-initial survey waypoint, and then follow a spiral descent to the desired survey depth.
-The \fB\-L\fP\fIapproachdepth\fP option sets the vehicle depth as it approaches the
-first waypoint before the spiral descent. The optional \fIspiraldescentaltitude\fP
-parameter sets the altitude at which the spiral descent is terminated; if \fB\-N\fP
-is given alone then \fIaltdesired\fP from the \fB\-A\fP option is used.
-These options are used for deepwater missions
-in which the vehicle navigation is updated by acoustic modem during the free
-inertial descents.
-
-The mission script must also allow sufficient time for the vehicle to transit from its
-starting point to the first waypoint in the survey mission. The \fB\-T\fP and \fB\-P\fP
-options allow the user specify the AUV starting position, the distance to the first
-waypoint, or the time required to reach the first waypoint.
-
-The MBARI Mapping AUV is equipped with a 200 kHz multibeam sonar, a 2-16 kHz chirp subbottom
-profiler, a 110 kHz chirp sidescan, and a 410 kHz chirp sidescan. The \fB\-M\fP option is
-used to enable these mapping sonars in the AUV mission script. If the route file contains
-waypoints identified as line start and line end points, the subbottom profiler (if enabled) will be
-turned on and off at these points. The waypoint type value can be set interactively within
-\fBmbgrdviz\fP.
-
-The MBARI Benthic Imaging AUV is equipped with dual strobes and a downward pointed camera.
-The \fB\-MC\fP option is used to enable control of the camera in the AUV mission script. If the route file contains
-waypoints identified as line start and line end points, the camera (if enabled) will be
-turned on and off at these points. The waypoint type value can be set interactively within
-\fBmbgrdviz\fP.
-
-.SH AUTHORSHIP
-David W. Caress (caress at mbari.org)
-.br
-  Monterey Bay Aquarium Research Institute
-.br
-Dale N. Chayes (dale at ldeo.columbia.edu)
-.br
-  Lamont-Doherty Earth Observatory
-
-.SH OPTIONS
-.TP
-.B \-A
-\fIaltmin/altabort[/altdesired[/altdesired2[/altdesired3]]]\fP
-.br
-Sets the AUV altitude control parameters. The missions generated by this
-script directly command the AUV's depth. However, the commanded depth
-will be overridden by the minimum altitude, or \fIaltmin\fP value;
-the vehicle will adjust it's depth so that it does not fly any closer
-to the bottom than \fIaltmin\fP meters. If the vehicle reaches an
-altitude equal to or less than \fIaltabort\fP meters, then the
-mission will be aborted. The user may specify a desired altitude
-(\fIaltdesired\fP) that is different than \fIaltmin\fP, so that
-the commanded depths do not directly correspond to the minimum altitude.
-The user can also specify second or third desired altitude
-values \fIaltdesired2\fP \fIaltdesired3\fP
-that are used between waypoints of type START2 and END2, or START3
-and END3, respectively, as defined in
-\fBMBgrdviz\fP routes.
-.TP
-.B \-B
-\fIbehavior\fP
-.br
-Sets the AUV behavior used to fly the mission. If \fIbehavior\fP = 0, then
-the AUV uses the WayPoint behavior in which a single vehicle depth is specified
-for the approach to each waypoint. If \fIbehavior\fP = 1, then the AUV uses
-the WayPointDepth behavior in which each mission segment has both a starting
-and an ending depth specified, and the vehicle is commanded to fly a depth
-profile that is a linear ramp between the two depths. Default: \fIbehavior\fP = 1;
-.TP
-.B \-C
-\fImissiontime\fP
-.br
-Sets the maximum time allowed for the AUV mission. If the \fImissiontime\fP is
-exceeded, the AUV will transition to it's internal abort plan.
-Default: mission abort time calculated from mission parameters.
-.TP
-.B \-D
-\fIdepthconstant[/depthconstant2]\fP
-.br
-Sets constant depth values that will be used between waypoints of
-typ START4 and END4 for \fIdepthconstant\fP and START5 and END5 for
-\fIdepthconstant2\fP. These are the waypoint types defined in
-\fBMBgrdviz\fP routes. While these waypoint types are active, the
-AUV is commanded to the specified constant depth value.
-.TP
-.B \-F
-\fIforwarddistance\fP
-.br
-The program looks \fIforwarddistance\fP m ahead for the shallowest bottom
-depth along the survey route, and then commands the vehicle to
-fly at least \fIaltmin\fP above that depth.
-.TP
-.B \-G
-\fIgpsmode\fP
-.br
-Sets the frequency with which the AUV will surface between survey lines to
-get GPS fixes. By default, the vehicle only get GPS fixes at the surface at
-the beginning and end of the mission, and not surface during the mission.
-If \fIgpsmode\fP = 1, then the vehicle will ascend for gps fixes at
-the start of each survey line. If \fIgpsmode\fP = 2, then the vehicle will
-ascend for gps fixes at the end of each survey line. If \fIgpsmode\fP = 3,
-then the vehicle will  ascend for gps fixes at the start and end of each survey line
-.TP
-.B \-H
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-.TP
-.B \-I
-\fIroutefile\fP
-.br
-Sets the filename of the input \fBmbgrdviz\fP route file.
-A route file specifies a desired survey route as a set of
-lines between waypoints. In addition to the waypoints, the file
-also includes the depth profiles along those lines.
-.TP
-.B \-J
-\fIdepthprofilefile\fP
-.br
-Sets the filename of an input desired depth profile file. This is the depth
-profile that the vehicle should follow when flying the mission (as opposed to
-following the bottom at a particular altitude).
-.TP
-.B \-L
-\fIapproachdepth\fP
-.br
-Sets the vehicle depth during the approach to the first waypoint when a
-spiral descent to depth at the first waypoint is specified  using the \fB\-N\fP option.
-.TP
-.B \-M
-\fI[sensorlist]\fP
-This option enables control of the Mapping AUV's mapping sonars and other possible
-sensors. By default, the AUV mission is generated without turning on the mapping sonars.
-If \fB\-M\fP is given alone, the multibeam, subbottom profiler, and both low and high
-frequency sidescan sonars will be enabled. The \fIsonarlist\fP parameter can
-optionally specify which sonars are enabled in addition to the multibeam (the
-multibeam serves as the ping timing master for all sonars, and thus must be
-enabled if any mapping sonars are enabled). The \fIsonarlist\fP value is
-made up of one or more of the following characters:
- 		M	multibeam sonar
- 		S	subbottom profiler (and multibeam)
- 		L	low frequency sidescan (and multibeam)
- 		H	high frequency sidescan (and multibeam)
- 		B	multibeam beam (water column) data
- 		C	benthic imaging camera and strobes
-.br
-Thus, \fB\-M\fP\fISL\fP will cause the multibeam, the subbottom profiler, and
-the low frequency sidescan to be enabled while leaving the high frequency
-sidescan off.
-.TP
-.B \-N
-\fIspiraldescentaltitude\fP
-Sets the mission to include a shallow transit to the first waypoint followed by a
-spiral descent to depth to start the survey. The descent is terminated at the
-altitude \fIspiraldescentaltitude\fP if specified here. Otherwise, the descent is
-terminated at the altitude \fIaltdesired\fP from the \fB\-A\fP option.
-.TP
-.B \-O
-\fImissionfile\fP
-.br
-Sets the filename of the output MBARI AUV mission script.
-.TP
-.B \-P
-\fIlon/lat\fP
-.br
-This sets the expected starting position (\fIlon\fP longitude
-and \fIlat\fP latitude) of the Mapping AUV so that the
-expected time to run to the first waypoint can be estimated. If neither
-the \fB\-P\fP or \fB\-T\fP options are specified, a distance of 500 meters
-to the first waypoint is assumed.
-.TP
-.B \-R
-\fItransmitpower/receivegain[/rangeminfraction[/pulsewidth]]\fP
-.br
-This sets the key multibeam sonar parameters. Here \fItransmitpower\fP is
-the transmit power of the multibeam in dB, with a range of 0-220 dB. The
-multibeam receive gain has a range of 0-83 dB. The \fIrangeminfraction\fP variable
-sets the minimum range at which the multibeam will make bottom picks; this
-prevents the multibeam from picking on nearfield arrivals usually reflecting
-interference from other sonars. If the sonar is operating with an altitude of
-50 m and \fIrangeminfraction\fP = 0.2, then the range gating minimum range will be
-0.2 * 50 m = 10 m. The \fIpulsewidth\fP variable sets the multibeam sonar
-transmit pulse width in microseconds. Default: \fItransmitpower\fP = 220, \fIreceivegain\fP = 220,
-\fIrangeminfraction\fP = 0.2, \fIpulsewidth\fP = 60.
-.TP
-.B \-S
-\fIspeed\fP
-.br
-This sets the commanded AUV speed in meters/second. Default: \fIspeed\fP = 1.5 m/s.
-.TP
-.B \-T
-\fIstarttime\fP
-.br
-This sets the expected time required for the AUV to reach the first waypoint
-in the survey mission. If neither
-the \fB\-P\fP or \fB\-T\fP options are specified, a distance of 500 meters
-to the first waypoint is assumed.
-.TP
-.B \-U
-\fImaxclimbrate\fP
-.br
-This sets the maximum climb rate in degrees allowed to be planned for the
-AUV mission. If the topography has a greater slope, the AUV will be brought
-up earlier so the planned climb angle never exceed \fImaxclimbrate\fP.
-Default: \fImaxclimbrate\fP = 25 degrees.
-.TP
-.B \-W
-\fIwaypointspacing\fP
-.br
-Sets the spacing in meters of the waypoints output to the mission script.
-.TP
-.B \-V
-The \fB\-V\fP option causes \fBmbm_route2mission\fP to print out status messages.
-
-.SH EXAMPLES
-Suppose you are going to run the MBARI Mapping AUV on the Coaxial Segment of the
-Juan de Fuca Ridge. You have created a route file called Coaxial2009_1v3.rte using
-\fBmbgrdviz\fP. In order to create an MBARI AUV mission script for mission beginning
-with a spiral descent to an altitude of 50 m, followed by a survey run at a 75 m altitude,
-the following will suffice:
- 	mbm_route2mission \-I Coaxial2009_1v3.rte \
- 		-A75/30/75 \-B1 \
- 		-G0 \-MSL \-N50 \-R220/83/0.3 \
- 		-O Coaxial2009_1v3.cfg \
- 		-S1.5 \-L30 \-W100 \-V
-.br
-The resulting mission script has the following header:
-
-     # This MBARI Mapping AUV mission file has been generated
-     # by the MB-System program mbm_route2mission run by
-     # user <caress> on cpu <shepard> at <Thu Jul 30 11:36:47 PDT 2009>
-     #
-     # Mission Summary:
-     #     Route File:               Coaxial2009_1v3.rte
-     #     Mission File:             Coaxial2009_1v3.cfg
-     #     Distance:                 79501.503455 (m)
-     #     Estimated Time:           57203 (s)  15.890 (hr)
-     #     Abort Time:               60067 (s)
-     #     Max battery life:         64800 (s)
-     #     Safety margin:            1800 (s)
-     #     Ascend time:              2932 (s)
-     #     Way Points:               44
-     #     Route Points:             550
-     #     Survey behavior:          WaypointDepth
-     #     Descent style:            Spiral descent
-     #     Mapping sonar control enabled:
-     #                               Multibeam enabled
-     #                                 Multibeam receive gain:           83
-     #                                 Multibeam transmit gain:          220
-     #                                 Multibeam minimum range fraction: 0.3
-     #                               Subbottom enabled
-     #                               Low sidescan enabled
-     #                               High sidescan disabled
-     #
-     # Mission Parameters:
-     #     Vehicle Speed:            1.500000 (m/s) 2.915769 (knots)
-     #     Desired Vehicle Altitude: 75 (m)
-     #     Minimum Vehicle Altitude: 75 (m)
-     #     Abort Vehicle Altitude:   30 (m)
-     #     Maximum Vehicle Depth:    2525.307922 (m)
-     #     Abort Vehicle Depth:      2562.807922 (m)
-     #     Descent Vehicle Depth:    3 (m)
-     #     Spiral descent depth:     2324.917643 m
-     #     Spiral descent altitude:  50 m
-     #     Forward Looking Distance:  (m)
-     #     Waypoint Spacing:         100 (m)
-     #     GPS Duration:             600 (s)
-     #     Descend Rate:             0.417 (m/s)
-     #     Ascend Rate:              1 (m/s)
-     #     Initial descend Duration: 300 (s)
-     #     Setpoint Duration:        30 (s)
-     #
-     # The primary waypoints from the route file are:
-     #   <number> <longitude (deg)> <latitude (deg)> <topography (m)> <distance (m)> <type>
-     #   0 \-129.588618 46.504590 \-2384.917643 0.000000 3
-     #   1 \-129.583151 46.507559 \-2412.977865 533.709482 3
-     #   2 \-129.569223 46.503420 \-2548.389974 1697.143568 1
-     #   3 \-129.566359 46.501080 \-2494.963053 2037.557099 3
-     #   4 \-129.548611 46.529852 \-2539.510864 5512.537193 4
-     #   5 \-129.551250 46.530628 \-2562.807922 5732.537193 3
-     #   6 \-129.568962 46.501924 \-2531.034424 9199.497998 4
-     #   7 \-129.571600 46.502699 \-2519.138489 9419.497998 3
-     #   8 \-129.553889 46.531404 \-2547.114624 12886.458803 4
-     #   9 \-129.556529 46.532180 \-2514.533569 13106.458803 3
-     #   10 \-129.574238 46.503475 \-2470.815735 16573.419607 4
-     #   11 \-129.576876 46.504250 \-2444.596313 16793.419607 3
-     #   12 \-129.559168 46.532956 \-2521.781921 20260.380412 4
-     #   13 \-129.561807 46.533732 \-2537.382141 20480.380412 3
-     #   14 \-129.579514 46.505026 \-2429.459961 23947.341216 4
-     #   15 \-129.582152 46.505801 \-2412.764343 24167.341217 3
-     #   16 \-129.564447 46.534508 \-2545.397705 27634.302021 4
-     #   17 \-129.567086 46.535284 \-2534.068665 27854.302021 3
-     #   18 \-129.584791 46.506576 \-2398.283020 31321.262826 4
-     #   19 \-129.587429 46.507352 \-2390.671509 31541.262826 3
-     #   20 \-129.569726 46.536059 \-2489.889282 35008.223630 4
-     #   21 \-129.572365 46.536835 \-2465.280823 35228.223630 3
-     #   22 \-129.590068 46.508127 \-2389.067017 38695.184435 4
-     #   23 \-129.592706 46.508902 \-2409.290771 38915.184435 3
-     #   24 \-129.575005 46.537610 \-2466.533142 42382.145240 4
-     #   25 \-129.577645 46.538386 \-2491.371094 42602.145240 3
-     #   26 \-129.595345 46.509677 \-2397.609253 46069.106044 4
-     #   27 \-129.597984 46.510452 \-2413.315918 46289.106044 3
-     #   28 \-129.580285 46.539161 \-2499.048889 49756.066849 4
-     #   29 \-129.582925 46.539937 \-2523.030640 49976.066849 3
-     #   30 \-129.600622 46.511227 \-2443.481018 53443.027653 4
-     #   31 \-129.603261 46.512002 \-2419.008240 53663.027653 3
-     #   32 \-129.585565 46.540712 \-2518.522400 57129.988458 4
-     #   33 \-129.588205 46.541487 \-2498.521301 57349.988458 3
-     #   34 \-129.605900 46.512777 \-2450.386536 60816.949263 4
-     #   35 \-129.608539 46.513552 \-2473.623230 61036.949263 3
-     #   36 \-129.590845 46.542262 \-2487.422180 64503.910067 4
-     #   37 \-129.593485 46.543038 \-2491.040466 64723.910067 3
-     #   38 \-129.611178 46.514327 \-2472.610657 68190.870872 3
-     #   39 \-129.606711 46.517999 \-2485.114583 68723.704236 3
-     #   40 \-129.557338 46.509809 \-2488.398743 72619.152031 3
-     #   41 \-129.550415 46.521262 \-2545.285828 73998.189601 3
-     #   42 \-129.600724 46.536447 \-2470.920736 78209.372536 3
-     #   43 \-129.606972 46.525648 \-2443.988281 79501.503455 4
-     #
-     # A total of 550 mission points have been defined.
-     #
-     # Define Mission parameters:
-     #define MISSION_SPEED      1.500000
-     #define MISSION_DISTANCE   79501.503455
-     #define MISSION_TIME       57203
-     #define MISSION_TIMEOUT    60067
-     #define DEPTH_MAX          2525.307922
-     #define DEPTH_ABORT        2562.807922
-     #define ALTITUDE_DESIRED   75.000000
-     #define ALTITUDE_MIN       75.000000
-     #define ALTITUDE_ABORT     30.000000
-     #define GPS_DURATION       600
-     #define DESCENT_DEPTH      3.000000
-     #define SPIRAL_DESCENT_DEPTH      2324.917643
-     #define SPIRAL_DESCENT_ALTITUDE   50.000000
-     #define DESCEND_DURATION   300
-     #define SETPOINT_DURATION  30
-     #define GPSMINHITS         10
-     #define ASCENDRUDDER       3.000000
-     #define ASCENDPITCH        45.000000
-     #define ASCENDENDDEPTH     2.000000
-     #define DESCENDRUDDER      3.000000
-     #define DESCENDPITCH       \-30.000000
-     #define MAXCROSSTRACKERROR 30
-     #define RESON_DURATION     6
-     #q
-
-.SH SEE ALSO
-\fBmbsystem\fP(1), \fBmbgrdviz\fP(1)
-
-.SH BUGS
-Perhaps.
diff --git a/src/man/man1/mbm_stat.1 b/src/man/man1/mbm_stat.1
deleted file mode 100644
index b4f31db..0000000
--- a/src/man/man1/mbm_stat.1
+++ /dev/null
@@ -1,53 +0,0 @@
-.TH mbm_stat 1 "3 June 2013" "MB-System 5.0" "MB-System 5.0"
-.SH NAME
-\fBmbm_stat\fP \- Extract beam statistics from output generated by mbinfo.
-
-.SH VERSION
-Version 5.0
-
-.SH SYNOPSIS
-\fBmbm_stat\fP \fB\-I\fIfile\fP [\fB\-V \-H\fP]
-
-.SH DESCRIPTION
-\fBmbm_stat\fP is a perl shellscript that extracts beam statistics from the
-output of \fBmbinfo\fP. The output of contains the base name of the data file,
-then number of hours of data in the data file, and the percentage of dropped
-and flagged beams. One line of output for each run of \fBmbinfo\fP is
-generated. This allows \fBmbm_stat\fP to be run on accumulated data such as
-might be generated by logging the daily mail statistics. Columns are tab
-delimited.
-
-.SH AUTHORSHIP
-David W. Caress (caress at mbari.org)
-.br
-  Monterey Bay Aquarium Research Institute
-.br
-Dale N. Chayes (dale at ldeo.columbia.edu)
-.br
-  Lamont-Doherty Earth Observatory
-.br
-Suzanne H. O'Hara (sohara at ldeo.columbia.edu)
-.br
-  Lamont-Doherty Earth Observatory
-
-.SH OPTIONS
-.TP
-.B \-H
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-.TP
-.B \-I
-\fIfile\fP
-.br
-Data file to be processed which contains the output of one or
-more executions of \fBmbinfo\fP.
-.TP
-.B \-V
-Causes \fBmbm_stat\fP to operate in "verbose" mode so that it outputs
-more information than usual.
-
-.SH SEE ALSO
-\fBmbsystem\fP(1), \fBmbinfo\fP(1)
-
-.SH BUGS
-Too simple to have any really interesting bugs.
diff --git a/src/man/man1/mbm_utm.1 b/src/man/man1/mbm_utm.1
deleted file mode 100644
index 5d1c7b0..0000000
--- a/src/man/man1/mbm_utm.1
+++ /dev/null
@@ -1,98 +0,0 @@
-.TH mbm_project 1 "3 June 2013" "MB-System 5.0" "MB-System 5.0"
-.SH NAME
-\fBmbm_utm\fP \- Macro to perform forward and inverse UTM projections
-of ASCII data triples.
-
-.SH VERSION
-Version 5.0
-
-.SH SYNOPSIS
-mbm_utm \fB\-I\fP\fIinfile\fP \fB\-O\fP\fIoutfile\fP
-\fB\-Z\fP\fIzone\fP \fB\-E\fP\fIellipsoid\fP [\fB\-F \-Q \-H \-V\fP]
-
-.SH DESCRIPTION
-\fBmbm_utm\fP is a macro to perform forward and inverse UTM projections
-of ASCII data triples using the GMT program mapproject.
-Forward projections translate from geographic data
-(lon, lat, value) to UTM eastings and northings (x, y, value).
-Inverse projections translate from (x, y, z) to (lon, lat, z).
-Both the input and output files must be specified.
-
-.SH AUTHORSHIP
-David W. Caress (caress at mbari.org)
-.br
-  Monterey Bay Aquarium Research Institute
-.br
-Dale N. Chayes (dale at ldeo.columbia.edu)
-.br
-  Lamont-Doherty Earth Observatory
-
-.SH SIMPLE DESCRIPTION OF BASIC OPTIONS
-.TP
-\fB\-H\fP
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-.TP
-\fB\-E\fP\fIellipsoid\fP
-Sets the ellipsoid to be used. The default
-is to use the WGS-84 ellipsoid, in accordance with
-the NAD-83 datum. If ellipsoid = "Clarke-1866",
-then the Clarke-1866 ellipsoid will be used in
-accordance with the NAD-27 datum. Note that this
-macro cannot be used to accomplish a true datum
-shift between NAD-27 and NAD-83 because the 1986
-transition to NAD-83 also involved additional
-adjustments to positions.
-.TP
-\fB\-F\fP
-Causes \fBmbm_utm\fP to use or generate eastings and northings
-in feet rather than meters.
-.TP
-\fB\-I\fP\fIinfile\fP
-Sets the name of the data file to be processed.
-The first two columns of the ASCII input
-data stream must be either longitude and
-latitude values (for geographic to projected
-transformation) or easting and northing values
-(for projected to geographic transformation).
-Any additional columns of data are passed unaltered to the output.
-.TP
-\fB\-O\fP\fIoutfile\fP
-Sets the name of the output data file to be generated.
-The first two columns of the ASCII output
-data stream will be either easting and northing
-values (for geographic to projected
-transformation) or longitude and latitude values
-(for projected to geographic transformation).
-Any additional columns of data are passed unaltered to the output.
-.TP
-\fB\-Q\fP
-This option causes the transformation to be from
-projected coordinates (eastings and northings) to
-geographic coordinates (longitude and latitude).
-The default is to transform from geographic to
-projected coordinates.
-.TP
-\fB\-Z\fP\fIzone\fP
-Sets the UTM zone.
-
-.SH EXAMPLES
-Suppose we have a file containing longitude, latitude,
-and depth triples called llz.dat. To transform the
-coordinates to eastings and northings in the
-UTM Zone 10 projection, use:
-.br
- 	mbm_utm \-Illz.dat \-Z10 \-Oenz.dat
-.br
-The file enz.dat will contain eastings and northings
-instead of longitude and latitude values. To transform
-back to geographic coordinates, use:
-.br
- 	mbm_utm \-Ienz.dat \-Z10 \-Q \-Ollz2.dat
-.br
-
-.SH SEE ALSO
-\fBmbsystem\fP(1), \fBproject\fP
-
-.SH BUGS
-Too new to have bugs.
diff --git a/src/man/man1/mbm_vrefcheck.1 b/src/man/man1/mbm_vrefcheck.1
deleted file mode 100644
index 74fd72e..0000000
--- a/src/man/man1/mbm_vrefcheck.1
+++ /dev/null
@@ -1,100 +0,0 @@
-.TH mbm_vrefcheck 1 "3 June 2013" "MB-System 5.0" "MB-System 5.0"
-.SH NAME
-\fBmbm_vrefcheck\fP \- Macro to generate plot of crosstrack seafloor slope
-from a swath sonar file.  The noise in this time series largely reflects
-noise in the vertical reference used by the sonar.
-
-.SH VERSION
-Version 5.0
-
-.SH SYNOPSIS
-\fBmbm_vrefcheck\fP \fB\-F\fIformat \fB\-I\fIfile \fP[\fB\-S\fIscale \fB\-X\fIxaxis \fB\-A\fIxmin \fB\-B\fIxmax\fP]
-
-.SH DESCRIPTION
-\fBmbm_vrefcheck\fP is a macro which generates a plot of high pass
-filtered apparent crosstrack seafloor slope.  The noise in this signal
-appears to be dominated by noise in the vertical reference data
-used by the sonar system.  The crosstrack slopes are obtained by running
-\fBmblist\fP. The resulting time series is filtered using the \fBGMT\fP
-utility \fBfilter1d\fP, which uses a time domain median filter with
-a time width of 5 minutes.  The filtered signal contains little of
-the actual bathymetric signal, and thus represents a combination of
-noise in the seafloor reflection travel times and the vertical
-reference data stream.  Close inspection of Hydrosweep data collected
-on the R/V Ewing with an interactive editor (\fBmbedit\fP) reveals
-clear variability in the observed crosstrack slope, even when
-surveying essentially flat seafloor.  This suggests that the filtered
-signal is probably dominated by vertical reference noise on the Ewing.
-The plot is automatically rasterized and sent to a Novajet plotter
-(assuming one is on the R/V Ewing).
-
-.SH AUTHORSHIP
-David W. Caress (caress at mbari.org)
-.br
-  Monterey Bay Aquarium Research Institute
-.br
-Dale N. Chayes (dale at ldeo.columbia.edu)
-.br
-  Lamont-Doherty Earth Observatory
-.br
-Suzanne H. O'Hara (sohara at ldeo.columbia.edu)
-.br
-  Lamont-Doherty Earth Observatory
-
-.SH OPTIONS
-.TP
-.B \-A
-\fIxmin\fP
-.br
-Sets the start time of the plot in hours from the beginning of the
-input file. If not specified, the beginning of the input file
-will be used as \fIxmin\fP.
-.TP
-.B \-B
-\fIxmax\fP
-.br
-Sets the end time of the plot in hours from the beginning of the
-input file. If not specified, the end of the input file
-will be used as \fIxmax\fP.
-.TP
-.B \-F
-\fIformat\fP
-.br
-Sets the format for the input swath sonar data using
-\fBMBIO\fP integer format identifiers.
-This macro uses the \fBMBIO\fP library and will read any swath sonar
-format supported by \fBMBIO\fP. A list of the swath sonar data formats
-currently supported by \fBMBIO\fP and their identifier values
-is given in the \fBMBIO\fP manual page.
-Default: \fIformat\fP = 24.
-.TP
-.B \-I
-\fIfile\fP
-.br
-Data file from which the input data will be read.
-.TP
-.B \-S
-\fIxscale\fP
-.br
-Sets the x-axis scale of the plot in inches/hour.
-Default: \fIxscale\fP = 1.2.
-.TP
-.B \-X
-\fIxaxis\fP
-.br
-Sets the length of the x-axis in inches.
-
-.SH EXAMPLES
-Suppose one has obtained a Hydrosweep DS swath sonar data file
-called hs_ew9302_157_bcen.mb24 in the
-L-DEO binary in-house format (format id 24). In order to generate a
-vertical reference noise plot:
-.br
-	mbm_vrefcheck \-F24 \-Ihs_ew9302_157_bcen.mb24
-
-.SH SEE ALSO
-\fBmbsystem\fP(1), \fBmblist\fP(1)
-
-.SH BUGS
-This script is hard wired for the R/V Ewing installation. This will
-have to be fixed for it to be useful elsewhere.
diff --git a/src/man/man1/mbm_xbt.1 b/src/man/man1/mbm_xbt.1
deleted file mode 100644
index ab85fa5..0000000
--- a/src/man/man1/mbm_xbt.1
+++ /dev/null
@@ -1,82 +0,0 @@
-.TH mbm_xbt 1 "3 June 2013" "MB-System 5.0" "MB-System 5.0"
-.SH NAME
-\fBmbm_xbt\fP \- Calculate sound speed from XBT data.
-
-.SH VERSION
-Version 5.0
-
-.SH SYNOPSIS
-\fBmbm_xbt\fP \fB\-I\fIinfile\fP [\fB\-F\fI\fIformat\fP
-\fB\-L\fIlatitude\fP \fB\-S\fIsalinity\fP \fB\-V \-H\fP]
-
-.SH DESCRIPTION
-\fBmbm_xbt\fP is a perl shellscript to translate various XBT data sets
-from depth and temperature into depth and sound speed.  Header
-lines are  turned into comments beginning with '#' characters. The
-output filename consists of the input filename with the suffix ".sv".
-The conversion is done using the DelGrosso equation as referenced
-in Dusha et al. [1993] (reference below).
-
-.SH AUTHORSHIP
-David W. Caress (caress at mbari.org)
-.br
-  Monterey Bay Aquarium Research Institute
-.br
-Dale N. Chayes (dale at ldeo.columbia.edu)
-.br
-  Lamont-Doherty Earth Observatory
-.br
-Suzanne H. O'Hara (sohara at ldeo.columbia.edu)
-.br
-  Lamont-Doherty Earth Observatory
-
-.SH OPTIONS
-.TP
-.B \-F
-\fIformat\fP
-.br
-Allows the user to select the type of XBT data. Currently supported
-formats are: 1 = Sparton XBT, 2 = Sippican MK12 XBT, 3 = Sippican MK21.
-Default: \fIformat\fP = 2.
-.TP
-.B \-H
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-.TP
-.B \-I
-\fIfile\fP
-.br
-Data file from which the input data will be read.
-.TP
-.B \-L
-\fIlatitude\fP
-.br
-Latitude of the XBT cast.
-.TP
-.B \-S
-\fIsalinity\fP
-.br
-Sets the salinity used to calculate sound speed from temperature
-and depth. The default value of 35 ppt may be significantly
-in error in some areas.  Default: \fIsalinity\fP = 35.
-.TP
-.B \-V
-Causes \fBmbm_xbt\fP to operate in "verbose" mode so that it outputs
-more information than usual.
-
-.SH NOTES
-There is a hard limit in the code that prevents temperatures less than
-\-2.0 degrees C from being used. Input lines containing temperatures less
-than \-2.0 will be ignored.
-
-.SH SEE ALSO
-\fBmbsystem\fP(1), \fBmbprocess\fP(1), \fBmbset\fP(1),
-\fBmbvelocitytool\fP(1), \fBmblevitus\fP(1)
-
-.SH REFERENCES
-Dusha, B. D., P. F. Worcester, B. D. Cornuelle, B. M. Howe,
-On equations for the speed of sound in seawater, J. Acoust. Soc. Am.,
-93, 255-275, 1993.
-
-.SH BUGS
-Let us know.
diff --git a/src/man/man1/mbm_xyplot.1 b/src/man/man1/mbm_xyplot.1
deleted file mode 100644
index e07a6ee..0000000
--- a/src/man/man1/mbm_xyplot.1
+++ /dev/null
@@ -1,796 +0,0 @@
-.TH mbm_xyplot 1 "9 January 2015" "MB-System 5.0" "MB-System 5.0"
-.SH NAME
-\fBmbm_xyplot\fP \- Create an executable shellscript which will generate
-a GMT plot of xy data.
-
-.SH VERSION
-Version 5.0
-
-.SH SYNOPSIS
-\fBmbm_xyplot\fP \fB\-I\fP\fI[filepars:]file\fP
-[\fB\-I\fP\fI[filepars:]file\fP \fB\-G\fP\fIfill\fP \fB\-H\fP
-\fB\-O\fP\fIroot\fP \fB\-P\fP\fIpagesize\fP
-\fB\-S\fP\fIsymbol/size\fP
-\fB\-U\fP\fIorientation\fP \fB\-V\fP
-\fB\-W\fP\fIpen\fP ]
-
-Additional Options:
-.br
-[\fB\-B\fP\fItickinfo\fP \fP
-\fB\-J\fP\fIprojection\fP[\fI/scale | width\fP]
-\fB\-L\fP\fItitle\fP[\fI:xlabel:ylabel\fP] \fB\-M\fP\fImisc\fP
-\fB\-Q\fP \fB\-R\fP\fIw/e/s/n\fP \fB\-X\fP \fB\-Z\fP]
-
-Miscellaneous Options:
-.br
-[\fB\-MGD\fP\fIgmtdef/value\fP
-\fB\-MGL\fP[\fIf\fP][\fIx\fP]\fIlon0/lat0/slat/length\fP[\fIunits\fP][\fI+llabel\fP]
-\fB\-MGT\fP\fIx/y/size/angle/font/just/text\fP
-\fB\-MGU\fP\fP[\fI/dx/dy/\fP][\fIlabel\fP] ]
-
-.SH DESCRIPTION
-\fBmbm_xyplot\fP is a macro to generate a shellscript of GMT commands which,
-when executed, will generate a Postscript plot of xy data.
-Axes may be linear, log,  or any of several geographic
-projections. Data may be plotted as symbols or lines.
-The plot will be scaled to fit on the specified page size
-or, if the scale is user defined, the page size will be
-chosen in accordance with the plot size. The primary purpose
-of this macro is to allow the simple, semi-automated
-production of nice looking plots with a few command line
-arguments.
-
-By default \fBmbm_xyplot\fP expects the input data files to have
-values organized in columns separated by white space. However, users
-may optionally specify a non-white-space delimiter for each
-file. Input data files can have an arbitrary number of columns. When
-two or more columns exist the one may specify which two columns to
-plot (the first vs second is the default). In addition, users may
-optionally specify a single column to be plotted versus
-data-point-number.
-
-The standard syntax with which one selects columns to plot may also be
-embedded into a larger Perl expression, which will be evaluated for
-each line of the data file. In this way, one may do on-the-fly
-mathematics or substring extractions as required.  Indeed, one may
-specify most any Perl expression that when evaluated, will be a
-numeric result for plotting. For example, one can multiply the values
-in a column by a constant, add the values of two columns together or
-even extract latitude and longitude degrees and minutes in a file of
-NMEA strings and convert the results to decimal degrees for
-plotting. The macro uses the specified delimter to extract the
-values from each column, evaluate the expressions, and then leaves the
-result in temporary data in files to be read by the plotting
-shellscript. The temporary files are deleted on execution of the shell
-script by default, but can optionally be retained for debugging
-purposes.
-
-For users seeking more control over the plot
-appearance, a number of additional optional arguments are
-provided. Truly ambitious users may edit the plot shellscript
-to take advantage of GMT capabilities not supported by this
-macro.
-
-By default the output plot generation shellscript
-includes lines which execute a program to display the Postscript
-image on the screen. The program to be used to display the Postscript
-is set using \fBmbdefaults\fP; the default value can be overridden
-by setting the environment variable $MB_PS_VIEWER.
-Invoking the plot generation shellscript with
-a \fB-N\fP command line argument suppresses the screen
-display of the plot.
-
-The plot scripts generated by this macro will work with
-GMT version 5.0 and later, and are not compatible with
-earlier versions of GMT.
-
-.SH AUTHORSHIP
-David W. Caress (caress at mbari.org)
-.br
-  Monterey Bay Aquarium Research Institute
-.br
-Dale N. Chayes (dale at ldeo.columbia.edu)
-.br
-  Lamont-Doherty Earth Observatory
-.br
-Suzanne H. O'Hara (sohara at ldeo.columbia.edu)
-.br
-  Lamont-Doherty Earth Observatory
-
-.SH SIMPLE DESCRIPTION OF BASIC OPTIONS
-.TP
-.B \-G
-\fIfill\fP
-.br
-Select filling of symbols for xy plotting.
-Set the shade (0-255) or color
-(r/g/b) [Default is no fill]. To reset no fill,
-use \fIfill\fP = "N".
-For polygons, you may optionally specify
-\fB\-Gp\fP\fIicon_size/pattern\fP, where
-\fIpattern\fP gives the number of the
-image pattern (1-32) OR the name of a
-icon-format file.  \fIicon_size\fP sets
-the unit size in inch.
-To invert black and white pixels, use
-\fB\-GP\fP instead of \fB\-Gp\fP.  See
-\fBGMTs\fP Cookbook & Technical Reference
-Appendix E for information on individual patterns.
-.TP
-.B \-H
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-.TP
-.B \-I
-\fI[filepars:]xy_file \fP
-.br
-Specifies a file containing (x,y) pairs to be plotted as lines or
-symbols. Optional parameters preceed the file name and consist of a
-list of flag-argument pairs, strung together with colons. These
-arguments may include the column delimiter, which columns to plot,
-line and symbol characteristics and a flag to specify when multiple
-data segments are embedded in a single file. The looks like the
-following.:
-
-\fB \-I\fP\fBD\fP\fIdelimiter\fP:\fBC\fP\fIcolumnsexpression\fP:\fBG\fP\fIcolor\fP:\fBS\fP\fIsymbol\fP:\fBW\fP\fIweight\fP:\fBM\fP:\fBxyfile\fR
-
-Default parameters are whitespace [ D(\\s+) ], column 1 vs column 2
-[ Cc[1]_c[2] ], black lines without symbols [ SN ], [ GN ], [ W1 ], and no
-multiple segments (omitted M flag).
-
-Please see the "Complete Description of Options" below for details.
-.TP
-.B \-O
-\fIroot\fP
-.br
-Sets the root used to construct the filename of the output shellscript
-(\fIroot\fP.cmd) and names of files created when the shellscript is
-run.  Normally the
-name of the input grid file or grid file list is
-used as the \fIroot\fP.
-.TP
-.B \-P
-\fIpagesize\fP
-.br
-This option sets the size of the page the plot will be centered
-on. If the user does not set the plot scale, the plot will be
-sized as large as will fit on the designated page. If the user
-sets the plot scale such that the plot will not fit on the
-designated page, a larger page will be used.
-The supported page sizes include ANSI A, B, C, D, E,
-F, and E1, as well as most metric page sizes. See the
-COMPLETE DESCRIPTION OF OPTIONS section
-below for a complete list of
-the supported page sizes. The default page size is A.
-.TP
-.B \-S
-\fIsymbol/size\fP
-.br
-Selects symbol to be used for plotting the next xy data
-file. Setting \fIsymbol\fP = "N" causes line plotting.
-The list of available symbols is given in the
-COMPLETE DESCRIPTION OF OPTIONS section below.
-.TP
-.B \-U
-\fIorientation\fP
-.br
-Normally the orientation of the plot (portrait or landscape)
-is selected automatically so as to maximize the plot scale.
-The \fB\-U\fP option allows the user to set the plot orientation. If
-\fIorientation\fP = 1, a portrait plot will be produced; if
-\fIorientation\fP = 2, a landscape plot will be produced.
-.TP
-.B \-V
-Causes \fBmbm_grdplot\fP to operate in "verbose" mode
-so that it outputs
-more information than usual.
-.TP
-.B \-W
-\fIpen\fP
-.br
-Set pen attributes for xy plotting. See chapter 4.12 in the
-GMT Technical reference for a discussion of GMT pen values.
-[Defaults: width = 1, color = 0/0/0,
-texture = solid].
-
-.SH COMPLETE DESCRIPTION OF OPTIONS
-.TP
-.B \-B
-\fItickinfo\fP
-.br
-Sets map boundary tickmark intervals. See the \fBpsbasemap\fP
-manual page for details. By default the program chooses
-basemap annotations based on the map boundaries.
-.TP
-.B \-G
-\fIfill\fP
-.br
-Select filling of symbols for xy plotting.
-Set the shade (0-255) or color
-(r/g/b) [Default is no fill]. To reset no fill,
-use \fIfill\fP = "N".
-For polygons, you may optionally specify
-\fB\-Gp\fP\fIicon_size/pattern\fP, where
-\fIpattern\fP gives the number of the
-image pattern (1-32) OR the name of a
-icon-format file.  \fIicon_size\fP sets
-the unit size in inch.
-To invert black and white pixels, use
-\fB\-GP\fP instead of \fB\-Gp\fP.  See
-\fBGMTs\fP Cookbook & Technical Reference
-Appendix E for information on individual patterns.
-.TP
-.B \-H
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-.TP
-.B \-I
-\fI[filepars:]xy_file\fP
-.br
-
-Specifies the files containing the data to be plotted, and for each
-file, a list of file parameters which are comprised of the rules used
-by \fBmbm_xyplot\fP to parse and manipulate the x and y values on the
-fly, as well as the line and symbol characters used for plotting the
-results.
-
-The file parameters are an optional list of flags and their arguments
-concatinated and strung together with colons. A full specification has
-the following general syntax although individual flags and their
-arguments need not appear in any particular order as long as argument
-follows corresponding flag.:
-
-
-\fB \-I\fP\fBD\fP\fIdelimiter\fP:\fBC\fP\fIcolumnsexpression\fP:\fBG\fP\fIcolor\fP:\fBS\fP\fIsymbol\fP:\fBW\fP\fIweight\fP:\fBM\fP:\fBxyfile\fR
-
-The delimiter may be any character string. The default delimiter is
-whitespace.
-
-By default, \fBmbm_xyplot\fP uses the first column as the x value and
-the second column as the y value for the plot. However, the \fBC\fP
-flag and column expression allows the user to chose other columns to
-plot. The general syntax is
-
-\fBC\fP \fIc[xcol]_c[ycol]\fR
-
-where 'xcol' and 'ycol' designate the x and y columns
-respectively. Columns are numbered starting at '1' one the left most
-column in the file. In addition, either c[] expression may be replaced
-with a single '#' symbol to plot the other variable vs. line
-number. For example,
-
-\fBC\fP \fI#_c[ycol]\fR
-
-will plot the values in column 'ycol' vs their line number in the file.
-
-Other valid Perl expressions may be substituted for either column
-expression as well. For example, to plot in kilometers, a file whose
-columns contain x and y coordinates in meters, one would specify
-
-\fBC\fP \fIc[0]/1000_c[1]/1000\fP
-
-The line and symbol characteristics are set using the \fBG\fP,
-\fBS\fP, and \fBW\fP options.  For example, the command
-\fB\-IG\fP\fI255/0/0:\fP\fBS\fP\fIa/0.1:xy.dat\fP will plot the (x,y)
-data pairs in the file xy.dat as 0.1 inch diameter red stars.
-[Default is a solid black line]. See the psxy man page for more
-details.
-
-When multiple data files are specified (with multiple \fB\-I\fP
-statements, the last \fBG\fP, \fBS\fP, and \fBW\fP options specified
-are for subsequent files. In order to plot different files using
-different line or symbol characteristics, new sets of commands can be
-specified for each file.
-
-Finally, note that there are two ways in which one may plot multiple
-data sets on the same plot. One may specify multiple sets of file arguments
-[i.e. \fB\-I\fP\fI[filepars:]xy_file\fP], one for each file to be
-plotted. This allows the most flexibility, including different
-one-the-fly manipulations and colors for each xy series.
-
-An alternative is to utilize the "multiple segments" feature of
-\fBpsxy\fP. Specify the \fBM\fP flag in the file argument list to
-invoke this feature. A single file may then contain all the data, one
-series after the next, with lines containing a single ">" and nothing
-more to delineate breaks in data segments. This is the default break
-character for psxy, and currently the only break character supported by
-mbm_xyplot. For example \fB\-IM\fP:xy.dat would plot multiple data
-series in the file xy.dat whose segements were separated as in the
-following snippet:
-
-1.2   3
-.br
-1.3   5
-.br
->
-.br
-0     .1
-.br
-0.1   .4
-.br
-
-.TP
-.B \-J
-\fIprojection\fP[\fI/scale | /width\fP]
-.br
-Selects the map projection. By default the map projection is
-Mercator and the plot scale is chosen to fit on the selected
-page size (see \fB\-P\fP option). The user may specify a
-different projection to be used, in which case the plot scale
-is still automatically chosen to fit the page. The user may
-also specify both the projection and the plot scale. If
-the projection specifying character is upper case, a plot
-width rather than a plot scale is used.
-The scale values are specified in inch/degree or in 1:xxxxx
-ratios. Plot widths are specified in inches. If the user
-specifies a plot scale such that the plot will not fit
-on the default A size page, a appropriately larger page
-size will be chosen.
-.br
-.sp
-\fBCYLINDRICAL PROJECTIONS:\fP
-.br
-.sp
-\fB\-Jc\fP\fIlon0/lat0/scale\fP (Cassini)
-.br
-\fB\-Jm\fP\fIscale\fP (Mercator)
-.br
-\fB\-Joa\fP\fIlon0/lat0/azimuth/scale\fP (Oblique Mercator \- point and azimuth)
-.br
-\fB\-Job\fP\fIlon0/lat0/lon1/lat1/scale\fP (Oblique Mercator \- two points)
-.br
-\fB\-Joc\fP\fIlon0/lat0/lonp/latp/scale\fP (Oblique Mercator \- point and pole)
-.br
-\fB\-Jq\fP\fIlon0/scale\fP (Equidistant Cylindrical Projection (Plate Carree))
-.br
-\fB\-Jt\fP\fIlon0/scale\fP (TM \- Transverse Mercator)
-.br
-\fB\-Ju\fP\fIzone/scale\fP (UTM \- Universal Transverse Mercator)
-.br
-\fB\-Jy\fP\fIlon0/lats/scale\fP (Basic Cylindrical Projection)
-.br
-.sp
-\fBAZIMUTHAL PROJECTIONS:\fP
-.br
-.sp
-\fB\-Ja\fP\fIlon0/lat0/scale\fP (Lambert).
-.br
-\fB\-Je\fP\fIlon0/lat0/scale\fP (Equidistant).
-.br
-\fB\-Jg\fP\fIlon0/lat0/scale\fP (Orthographic).
-.br
-\fB\-Js\fP\fIlon0/lat0/scale\fP (General Stereographic)
-.br
-.sp
-\fBCONIC PROJECTIONS:\fP
-.br
-.sp
-\fB\-Jb\fP\fIlon0/lat0/lat1/lat2/scale\fP (Albers)
-.br
-\fB\-Jl\fP\fIlon0/lat0/lat1/lat2/scale\fP (Lambert)
-.br
-.sp
-\fBMISCELLANEOUS PROJECTIONS:\fP
-.br
-.sp
-\fB\-Jh\fP\fIlon0/scale\fP (Hammer)
-.br
-\fB\-Ji\fP\fIlon0/scale\fP (Sinusoidal)
-.br
-\fB\-Jk\fP\fIlon0/scale\fP (Eckert VI)
-.br
-\fB\-Jn\fP\fIlon0/scale\fP (Robinson)
-.br
-\fB\-Jr\fP\fIlon0/scale\fP (Winkel Tripel)
-.br
-\fB\-Jw\fP\fIlon0/scale\fP (Mollweide)
-.br
-.sp
-\fBNON-GEOGRAPHICAL PROJECTIONS:\fP
-.br
-.sp
-\fB\-Jp\fP\fIscale\fP (Linear projection for polar (theta,r) coordinates)
-.br
-\fB\-Jx\fP\fIx-scale\fP[\fBl|p\fP\fIpow\fP][\fI/y-scale\fP[\fBl|p\fP\fIpow\fP]] (Linear, log, and power scaling)
-.br
-More details can be found in the \fBpsbasemap\fP manpages.
-.TP
-.B \-L
-\fItitle[:xlabel[:ylabel]]\fP
-.br
-Sets the title and the labels for the x and y axes of
-the plot. Note that a colon (:) rather than a slash (/) is
-used to separate the labels. Colons cannot be used in the
-labels themselves. If this option is not used, then a default title
-and colorscale label are provided. If the title is supplied
-alone, no x or y-axis labels will be provided.
-.TP
-.B \-M
-A series of "miscellaneous" options are provided which are
-given as \fB\-M\fP followed by a two character identifier, followed
-by any other parameters associated with that option.
-The \fB\-M\fP options may be strung together separated by
-colons, e.g. "-MGQ100:GU:CA200/10", which is equivalent to
-"-MGQ \-MGU \-MCA200/10".
-.TP
-.B \-MGD
-\fIgmtdef/value\fP
-.br
-Allows the user to set the \fBGMT\fP default values used as
-the plot is constructed. This command may be given repeatedly
-to set as many \fBGMT\fP defaults as required. For example, to
-set the basemap annotation font to Courier, use
-"-MGDANOT_FONT/Courier".
-.TP
-.B \-MGL
-[\fIf\fP][\fIx\fP]\fIlon0/lat0/slat/length\fP[\fIunits\fP][\fI+llabel\fP]
-.br
-Draws a simple map scale centered on \fIlon0/lat0\fP.
-Use \fB\-Lf\fP to get a "fancy" scale [Default is plain].
-Use \fB\-Lx\fP to specify the position in inches instead of map units.
-The scale is calculated at latitude \fIslat\fP; if the string "center" is used
-instead of a numerical value for \fIslat\fP, then the macro will set
-the scaling according to the center of the plot bounds.
-The scale length value \fIlength\fP is in km 
-by default, but the units can be specified as one of e|f|k|M|n|u, where
-e = meters, f = feet, k = kilometers, M = statue miles, n = nautical miles,
-and u = US survey feet. Append \fI+l\fP to label the scale with the
-relevant units, or append \fI+l"label"\fP to set a different label string.
-.TP
-.B \-MGT
-\fIx/y/size/angle/font/just/text\fP
-.br
-Causes a text label to plotted on the map.
-\fIsize\fP is text size in points, \fIangle\fP is
-measured in degrees counter-clockwise from horizontal,
-\fIfontno\fP sets the font type, \fIjustify\fP sets the alignment.
-If \fIfontno\fP starts with a leading hyphen, then
-the remainder of \fIfontno\fP is taken to be a
-textstring with the desired fontname.  See the
-\fBgmtdefaults\fP man page for names and numbers of available fonts
-(or run \fBpstext \-L\fP).  The alignment
-number refers to the part of the textstring that will be mapped
-onto the (\fIx,y\fP) point: 1 = Lower Left corner,
-2 = Lower Center, 3 = Lower Right, 5 = Mid Left, 6 = Mid Center,
-7 = Mid Right, 9 = Upper Left, 10 = Upper Center,
-11 = Upper Right. This option may be given as many times as
-needed.
-.TP
-.B \-MGU
-[\fI/dx/dy/\fP][\fIlabel\fP]
-.br
-Draw Unix System time stamp on plot.  User may specify where the lower left corner
-of the stamp should fall on the page relative to lower left corner of plot in inch [Default is (-0.75,-0.75)].  Optionally,
-append a label, or \fBc\fP (which will plot the command string.)
-.TP
-.B \-O
-\fIroot\fP
-.br
-Sets the root used to construct the filename of the output shellscript
-(\fIroot\fP.cmd) and names of files created when the shellscript is
-run.  Normally the
-name of the input grid file or grid file list is
-used as the \fIroot\fP.
-.TP
-.B \-P
-\fIpagesize\fP
-.br
-This option sets the size of the page the plot will be centered
-on. If the user does not set the plot scale, the plot will be
-sized as large as will fit on the designated page. If the user
-sets the plot scale such that the plot will not fit on the
-designated page, a larger page will be used.
-The supported page sizes are:
-
-          American ANSI sizes:
-          A     8.5 x 11.0 in.    ( 215.9 x  279.4 mm)
-          B    11.0 x 17.0 in.    ( 279.4 x  431.8 mm)
-          C    17.0 x 22.0 in.    ( 431.8 x  558.8 mm)
-          D    22.0 x 34.0 in.    ( 558.8 x  863.6 mm)
-          E    34.0 x 44.0 in.    ( 863.6 x 1117.6 mm)
-          F    28.0 x 40.0 in.    ( 711.2 x 1016.0 mm)
-          E1   44.0 x 68.0 in.    (1117.6 x 1727.2 mm)
-
-          Metric ISO A sizes:
-          A0   841.0 x 1189.0 mm  (33.11 x 46.81 in.)
-          A1   594.0 x  841.0 mm  (23.39 x 33.11 in.)
-          A2   420.0 x  594.0 mm  (16.54 x 23.39 in.)
-          A3   297.0 x  420.0 mm  (11.69 x 16.54 in.)
-          A4   210.0 x  297.0 mm  ( 8.27 x 11.69 in.)
-          A5   148.0 x  210.0 mm  ( 5.83 x  8.27 in.)
-          A6   105.0 x  148.0 mm  ( 4.13 x  5.83 in.)
-          A7    74.0 x  105.0 mm  ( 2.91 x  4.13 in.)
-          A8    52.0 x   74.0 mm  ( 2.05 x  2.91 in.)
-          A9    37.0 x   52.0 mm  ( 1.46 x  2.05 in.)
-          A10   26.0 x   37.0 mm  ( 1.02 x  1.46 in.)
-
-          Metric ISO B sizes:
-          B0   1000.0x 1414.0 mm  (39.37 x 55.67 in.)
-          B1   707.0 x 1000.0 mm  (27.83 x 39.37 in.)
-          B2   500.0 x  707.0 mm  (19.68 x 27.83 in.)
-          B3   353.0 x  500.0 mm  (13.90 x 19.68 in.)
-          B4   250.0 x  353.0 mm  ( 9.84 x 13.90 in.)
-          B5   176.0 x  250.0 mm  ( 6.93 x  9.84 in.)
-          B6   125.0 x  176.0 mm  ( 4.92 x  6.93 in.)
-          B7    88.0 x  125.0 mm  ( 3.46 x  4.92 in.)
-          B8    62.0 x   88.0 mm  ( 2.44 x  3.46 in.)
-          B9    44.0 x   62.0 mm  ( 1.73 x  2.44 in.)
-          B10   31.0 x   44.0 mm  ( 1.22 x  1.73 in.)
-
-          Metric ISO C sizes:
-          C0   914.4 x 1300.5 mm  (36.00 x 51.20 in.)
-          C1   650.2 x  914.4 mm  (25.60 x 36.00 in.)
-          C2   457.2 x  650.2 mm  (18.00 x 25.60 in.)
-          C3   325.1 x  457.2 mm  (12.80 x 18.00 in.)
-          C4   228.6 x  325.1 mm  ( 9.00 x 12.80 in.)
-          C5   162.6 x  228.6 mm  ( 6.40 x  9.00 in.)
-          C6   114.3 x  162.6 mm  ( 4.50 x  6.40 in.)
-          C7    81.3 x  114.3 mm  ( 3.20 x  4.50 in.)
-
-	  MB-System large format sizes:
-          m1  1371.6 x 1828.8 mm  (54.00 x 72.00 in.)
-          m2  1371.6 x 2133.6 mm  (54.00 x 84.00 in.)
-          m3  1371.6 x 2438.4 mm  (54.00 x 96.00 in.)
-          m4  1524.0 x 1828.8 mm  (60.00 x 72.00 in.)
-          m5  1524.0 x 2133.6 mm  (60.00 x 84.00 in.)
-          m6  1524.0 x 2438.4 mm  (60.00 x 96.00 in.)
-
-The default page size is A.
-.TP
-.B \-Q
-Normally, the output plot generation shellscript
-includes lines which execute
-a program to display the Postscript image on the screen.
-This option causes those lines to be commented out so
-that executing the shellscript produces a Postscript plot
-but does not attempt to display it on the screen.
-Alternatively, invoking the plot generation shellscript with
-a \fB-N\fP command line argument also suppresses the screen
-display of the plot.
-The program
-to be used to display the Postscript is set
-using \fBmbdefaults\fP;
-the default value can be overridden by setting the environment
-variable $MB_PS_VIEWER.
-.TP
-.B \-R
-\fIwest/east/south/north\fP
-.br
-\fIwest, east, south,\fP and \fInorth\fP specify the Region of interest.  To specify boundaries
-in degrees and minutes [and seconds], use the dd:mm[:ss] format.  Append \fBr\fP if lower left and upper right
-map coordinates are given instead of wesn.
-You may ask for a larger \fIw/e/s/n\fP region to have more room between the image and the axes.
-A smaller region than specified in the grdfile will result in a subset of the grid [Default is
-region given by the grdfile].
-.TP
-.B \-S
-\fIsymbol/size\fP
-.br
-Selects symbol to be used for plotting the next xy data
-file. Setting \fIsymbol\fP = "N" causes line plotting.
-Choose between:
-.TP
-.B \-Sa
-st\fBa\fPr.  \fIsize\fP is radius of circumscribing circle.
-.TP
-.B \-Sb
-\fBb\fPar extending from \fIbase\fP to y.  \fIsize\fP is bar width.  By default,
-\fIbase\fP = 0.  Append /\fIbase\fP to change this value.  Append \fBu\fP if \fIsize\fP
-is in x-units [Default is inch].
-.TP
-.B \-Sc
-\fBc\fPircle.  \fIsize\fP is diameter of circle.
-.TP
-.B \-Sd
-\fBd\fPiamond.  \fIsize\fP is side of diamond.
-.TP
-.B \-Se
-\fBe\fPllipse.  Direction (in degrees counterclockwise from horizontal), major_axis (in inch), and minor_axis (in inch) must be found in columns 3, 4, and 5.
-.TP
-.B \-Sf
-\fBf\fPault.  Give distance gap between ticks and ticklength in inch.  If gap is
-negative, it is interpreted to mean number of ticks instead.  Append \fBl\fP or \fBr\fP to draw tick on
-the left or right side of line [Default is centered].  Upper case \fBL\fP or \fBR\fP draws a triangle
-instead of line segment.
-.TP
-.B \-Sh
-\fBh\fPexagon.  Give side in inch.
-.TP
-.B \-Si
-\fBi\fPnverted triangle.  Give side in inch.
-.TP
-.B \-Sl
-\fBl\fPetter or text string.  Give size in inch, and append /\fIstring\fP after the size.  Note that the size is only approximate; no individual scaling
-is done for different characters.  Remember to escape special characters like *.
-.TP
-.B \-Sp
-\fBp\fPoint.  No size needs to be specified (1 pixel is used).
-.TP
-.B \-Ss
-\fBs\fPquare.  Give side in inch.
-.TP
-.B \-St
-\fBt\fPriangle.  Give side in inch.
-.TP
-.B \-Sv
-\fBv\fPector.  Direction (in degrees counterclockwise from horizontal) and length (in inch) must be found in columns 3 and 4.  \fIsize\fP,
-if present, will be interpreted as arrowwidth/headlength/headwidth (in inch) [Default is 0.03/0.12/0.1 inch].
-By default arrow attributes remains invariant to the length
-of the arrow.  To have the size of the vector scale down with decreasing size,
-append n\fPnorm\fP, where vectors shorter than \fInorm\fP will have their
-attributes scaled by length/\fInorm\fP.
-.TP
-.B \-SV
-Same as \fB\-Sv\fP, except azimuth (in degrees east of north) should be given instead of direction.  The azimuth will
-be mapped into an angle based on the chosen map projection (\fB\-Sv\fP leaves the directions
-unchanged.)
-.TP
-.B \-Sx
-cross.  Give length in inch.
-.TP
-.B \-U
-\fIorientation\fP
-.br
-Normally the orientation of the plot (portrait or landscape)
-is selected automatically so as to maximize the plot scale.
-The \fB\-U\fP option allows the user to set the plot orientation. If
-\fIorientation\fP = 1, a portrait plot will be produced; if
-\fIorientation\fP = 2, a landscape plot will be produced.
-.TP
-.B \-V
-Causes \fBmbm_xyplot\fP to operate in "verbose" mode
-so that it outputs
-more information than usual.
-.TP
-.B \-W
-\fIpen\fP
-.br
-Set pen attributes for xy plotting. See chapter 4.12 in the
-GMT Technical reference for a discussion of GMT pen values.
-[Defaults: width = 1, color = 0/0/0,
-texture = solid].
-.TP
-.B \-X
-Normally, \fBmbm_xyplot\fP creates an executable shellscript and
-then exits.  This option will cause the shellscript to be executed
-in the background before \fBmbm_xyplot\fP exits.
-.TP
-.B \-Z
-\fBmbm_xyplot\fP extracts the desired columns of the input data
-and creates secondary files with the xy values to be plotted.
-Normally these files are left in place by the plot shellscript
-to be used multiple times. The \fB\-Z\fP option causes the
-shellscript to delete those secondary files.
-
-.SH EXAMPLES
-Suppose we have obtained a swath sonar data file called
-sb2112_example.mb41 collected using a SeaBeam 2112 sonar.
-In order to obtain an xy plot of the center beam depth
-versus time, we first extract the time-depth xy doubles
-from the swath sonar file using \fBmblist\fP:
-
- 	mblist \-F41 \-Isb2112_example.mb41 \-OmZ > mz.dat
-
-Here time is in seconds from the start of the file and the
-depths are in meters, positive upward (topography rather
-than bathymetry).
-Now, we use \fBmbm_xyplot\fP to generate
-shellscripts which in turn generate plots when executed.
-First, we generate a simple black line plot:
-
- 	mbm_xyplot \-Imz.dat \-Omz
-
-The above command generates an executable shellscript
-mz_line.cmd; executing this shellscript will generate a
-Postscript plot and display it on the screen.
-
-Suppose we also have a sparse set of depth estimates
-in a file called sr.dat obtained
-by picking the seafloor on a seismic reflection record, and
-we wish to compare the two sets of depths. We can plot the
-swath sonar derived depths as a black line and the seismic
-derived depths as red stars as follows:
-
- 	mbm_xyplot \-Omz_sr \-Imz.dat \\
- 		-IG255/0/0:Sa/0.1:sr.dat
-
-As an example, the contents of the plotting shellscript
-"mz.cmd" are:
-
- #
- # Shellscript to create Postscript plot of data in grd file
- # Created by macro mbm_xyplot
- #
- # This shellscript created by following command line:
- # mbm_xyplot \-Imz.dat \-Omz
- #
- # Save existing GMT defaults
- echo Saving GMT defaults...
- gmtdefaults \-L > gmtdefaults$$
- #
- # Set new GMT defaults
- echo Setting new GMT defaults...
- gmtset ANOT_FONT Helvetica
- gmtset LABEL_FONT Helvetica
- gmtset HEADER_FONT Helvetica
- gmtset ANOT_FONT_SIZE 8
- gmtset LABEL_FONT_SIZE 8
- gmtset HEADER_FONT_SIZE 10
- gmtset FRAME_WIDTH 0.074999999999999997
- gmtset TICK_LENGTH 0.074999999999999997
- gmtset PAGE_ORIENTATION LANDSCAPE
- gmtset COLOR_BACKGROUND 0/0/0
- gmtset COLOR_FOREGROUND 255/255/255
- gmtset COLOR_NAN 255/255/255
- #
- # Make xy data plot
- echo Running psxy...
- psxy mz.dat \\
- 	-Jx0.0011071486125582637/0.0062732342007434947 \\
- 	-R0/8128.99/-4382/-3306 \\
- 	-X1 \-Y0.5 \-K \-V > mz.ps
- #
-# Make basemap
- echo Running psbasemap...
- psbasemap \-Jx0.0011071486125582637/0.0062732342007434947 \\
- 	-R0/8128.99/-4382/-3306 \\
- 	-B500/100:."Data File mz.dat": \\
- 	-O \-V >> mz.ps
- #
- # Delete surplus files
- echo Deleting surplus files...
- rm \-f
- #
- # Reset GMT default fonts
- echo Resetting GMT fonts...
- mv gmtdefaults$$ .gmtdefaults
- #
- # Run xpsview
- echo Running xpsview in background...
- xpsview \-ps a \-or landscape \-maxp 4m mz.ps &
- #
- # All done!
- echo All done!
-
-.SH ADVANCED EXAMPLES
-
-Suppose we have a file of NMEA GGA strings logged from a GPS receiver
-whose data looks like the following:
-
-filename: gps.raw:
-
- $GPGGA,23.0,5427.89080,N,14600.29458,W,1,10,0.9,19.01,M,6.40,M,,*70
- $GPGGA,24.0,5427.89248,N,14600.30088,W,1,10,0.9,19.39,M,6.40,M,,*7B
- $GPGGA,25.0,5427.89424,N,14600.30713,W,1,10,0.9,19.72,M,6.40,M,,*7C
-
-We can specify a comma delimited file and convert the latitude and
-longitude fields to decimal degrees on the fly with the following:
-
-     mbm_xyplot \-ID,:C'substr(c[5],0,3)+substr(c[5],3,length(c[5]))\
-        /60_substr(c[3],0,2)+substr(c[3],2,length(c[3]))/60':gps.raw
-
-This is about as ugly as it gets. However, it is quite
-straightforward and very handy, so let us pick this apart. The \-I flag
-specifies the file to plot and its parameters. The D subfield followed
-by ',' indicates the file is comma delimited. The C subfield followed
-by the Perl expression extracts fields to plot. There are two
-expressions here, the x values, (longitude) and the x values
-(latitude) separated by an "_". In the longitude expression, the
-degree portion of the longitude, which is the 5th field (c[5]) is
-extracted and added to the minute portion of the longitude divided by
-60. The same is done with the latitude field, (c[3]).
-
-Note the single quotes surrounding the C expression. These are
-required to ensure complex expressions such as these are not
-inadvertently interpreted by the shell.
-
-
-
-.SH SEE ALSO
-\fBmbsystem\fP(1), \fBmbcontour\fP(1),
-\fBmbswath\fP(1), \fBmbdefaults\fP(1),
-\fBmbm_grdplot\fP(1), \fBmbm_grd3dplot\fP(1),
-\fBmbm_plot\fP(1)
-
-.SH BUGS
-Please let us know.
diff --git a/src/man/man1/mbmosaic.1 b/src/man/man1/mbmosaic.1
deleted file mode 100644
index e30d317..0000000
--- a/src/man/man1/mbmosaic.1
+++ /dev/null
@@ -1,8454 +0,0 @@
-.TH mbmosaic 1 "13 March 2014" "MB-System 5.0" "MB-System 5.0"
-.SH NAME
-\fBmbmosaic\fP \- Mosaic amplitude or sidescan data
-from swath mapping sonar data files.
-
-.SH VERSION
-Version 5.0
-
-.SH SYNOPSIS
-\fBmbmosaic\fP \fB\-I\fIfilelist\fP \fB\-O\fIroot\fP
-[\fB\-A\fIdatatype[F]\fP
-\fB\-B\fIborder\fP \-C\fIclip\fP \fB\-D\fIxdim/ydim\fP
-\fB\-E\fIdx/dy/units[!]\fP \fB\-F\fIpriority_range[/weight]\fP
-\fB\-G\fIgridkind\fP  \fB\-J\fIprojection\fP
-\fB\-H \-L\fIlonflip\fP \fB\-M \-N \-P\fIpings\fP
-\fB\-R\fIwest/east/south/north\fP \fB\-R\fIfactor\fP
-\fB\-S\fIspeed\fP \fB\-T\fItension\fP \fB\-U\fIbearing/factor[/mode]\fP
-\fB\-V\fP \-W\fIscale\fP \fB\-X\fIextend\fP
-\fB\-Y\fIpriority_source\fP \fB\-Z\fIbath_default\fP]
-
-.SH DESCRIPTION
-\fBmbmosaic\fP is a utility used to mosaic amplitude or sidescan
-data contained in a set of swath sonar data files. This program
-allows users to prioritize data according to the associated grazing
-angle and according to look azimuth. Individual mosaic bin values
-can be either the value of the highest priority sample in the bin
-or the Gaussian weighted mean of the highest priority samples
-in the neighborhood of the bin (the samples used here are those
-with priorities within a specified range of the highest priority
-sample found). Users can thus construct
-mosaics which are dominantly from a particular part of the swath
-(e.g. prioritize the outer swath higher than the inner swath)
-or which are dominantly from a particular look azimuth
-(e.g. construct an east-looking mosaic by specifying a
-preferred look azimuth of 90 degrees).
-
-The user must specify a file containing a list of the data files to
-be used and their data formats (\fB\-I\fP), and a character string
-to be used as the root of the output filenames (\fB\-O\fP). The user
-may specify the bounds of the region to be gridded (\fB\-R\fP), and
-either the dimensions (\fB\-D\fP) or node spacing \fB\-E\fP of the grid,
-If the bounds and grid dimensions (or spacing) are not specified, the
-program will select the region encompassing all of the data in the
-input files and a grid spacing equivalent to 0.02 times the maximum
-sonar altitude. If the bounds and grid dimensions (or spacing) are not
-specified, the program will select the region encompassing all of the
-data in the input files and a grid spacing equivalent to 0.02 times the maximum
-sonar altitude. The automatically calculated grid bounds will exactly
-correspond to the smallest rectangular region including the data unless
-the user specifies a larger region using \fB\-R\fP\fIfactor\fP. The value
-\fIfactor\fP must be greater than one; if \fIfactor\fP = 1.1 then the
-grid bounds will be expanded to the east and west by an amount 0.05 times
-the data bounds east-west extend and to the north and south by an amount
-0.05 times the data bounds north-south extent.
-The input data type (beam amplitude or sidescan) is specified using
-the \fB\-A\fP option. Depending on the input datalist, the amplitude or
-sidescan data may be raw or corrected for variations in amplitude with
-grazing angle (see \fBmbbackangle\fP and \fBmbprocess\fP), and may be
-unfiltered or have been filtered using \fBmbfilter\fP.
-The user can also specify the range of allowable sample priorities used in
-the mosaicing (\fB\-F\fP), the preferred look azimuth (\fB\-U\fP), the
-maximum distance from data points that the spline interpolation is
-used (\fB\-C\fP), the format of the output files, and other parameters.
-
-By default, \fBmbmosaic\fP generates mosiacs in Geographic coordinates,
-meaning that position is defined in longitude and latitude using
-the WGS84 horizontal datum. The \fB\-J\fP option can be used to specify
-an alternate, projected coordinate system (PCS). When a PCS is used,
-position will be defined in eastings and northings (meters) relative
-to the origin of the particular PCS. Universal Transverse Mercator
-is the most commonly used PCS in the oceanographic community, but
-\fBmbmosaic\fP supports a large number of other PCS as well. A list of
-the supported PCS's is provided at the end of this manual page.
-
-Before opening an input swath data file, \fBmbmosaic\fP checks for
-an ascii file in the same directory having the same name except
-that ".inf" is appended to the end. The program assumes that this
-ascii file contains the output of the program \fBmbinfo\fP run on
-the input data file. If the ".inf" file exists, \fBmbmosaic\fP reads
-the minimum and maximum longitude and latitude bounds from the
-\fBmbinfo\fP output and compares those to the working bounds
-for the grid. If the ".inf" file indicates that none of the data
-in the input file lies inside the working grid bounds, that input
-file is skipped. This allows users to maintain a single master list
-of data files for use in all gridding without the performance penalty
-of \fBmbmosaic\fP reading through all the data files, even those
-with no relevent data. We recommend that users maintain a ".inf"
-file for each swath data file used for gridding or plotting. The
-programs \fBmbgrid\fP, \fBmbswath\fP, and \fBmbcontour\fP
-also use ".inf" files in the same fashion.
-
-Usually, the internal working grid has the same boundaries as the
-output grid. However, the \fB\-X\fP option
-allows the size of the internal grid to be increased so that data outside
-the grid can be used to guide the spline interpolation of data gaps which
-happen to lie at the the edge of the grid.  This is particularly important
-when adjacent grids are created which should match along the edges.
-The data input bounds are set to a region three times as large as
-the working grid in both longitude and latitude.  The program reads all
-pings which lie within the data input bounds, and accepts all data
-values with locations within the working grid.
-
-The sample priorities are set according to three criteria. 
-The first criteria is set by using the \fB\-Y\fP option
-to specify a file containing a list of data priorities
-as a function of apparent grazing angle (this angle is the
-arctan(x/z) where x is acrosstrack distance and z is depth, so
-that the center of the swath has an apparent grazing angle of
-zero, the port swath edge has a large negative angle, and the
-starboard swath edge has a large positive angle). The highest
-priority assigned should be one, and the lowest zero.
-
-The second criteria is set by using the \fB\-U\fP option to specify
-a preferred look azimuth (data on the port side of the swath have
-a look azimuth equal to the heading \- 90 degrees, and data on the
-starboard side have a look azimuth equal to the heading + 90 degrees).
-The second parameter in the \fB\-U\fP option is a factor (f) which
-modulates how rapidly the priority degrades away from the preferred
-look azimuth. The priority (p) is assigned as follows:
-        p = cos( f * (Ap \- Aa))
-.br
-where Ap is the preferred look azimuth and Aa is the actual
-look azimuth. If f = 1.0, the priority will be 1.0
-at the preferred look azimuth and will fall to zero for look
-azimuths more than 90 degrees away from the preferred look
-azimuth. If f > 1.0, the range of nonzero priorities will shrink
-closer to the preferred look azimuth (e.g. if f = 2.0,
-nonzero priorities will be restricted to look azimuths within
-45 degrees of the preferred look azimuth). If f < 1.0, the
-range of nonzero priorities will expand (e.g. if f = 0.5, only
-look azimuths 180 degrees away from the preferred look azimuth
-will have a zero priority).
-
-The third criteria is set by using the \fB\-U\fP option to specify
-a preferred heading.
-The second parameter in the \fB\-U\fP option is a factor (f) which
-modulates how rapidly the priority degrades away from the preferred
-heading. The priority (p) is assigned as follows:
-        p = cos( f * (Hp \- Ha))
-.br
-where Hp is the preferred heading and Ha is the actual
-heading. If f = 1.0, the priority will be 1.0
-at the preferred heading and will fall to zero for heading
-more than 90 degrees away from the heading.
-If f > 1.0, the range of nonzero priorities will shrink
-closer to the preferred heading (e.g. if f = 2.0,
-nonzero priorities will be restricted to headings within
-45 degrees of the preferred heading). If f < 1.0, the
-range of nonzero priorities will expand (e.g. if f = 0.5, only
-headings 180 degrees away from the preferred heading
-will have a zero priority).
-
-The priorities used in the mosaicing are found by multiplying
-the grazing angle, look azimuth, and heading priorities
-together. Of course, the priority associated with a criteria
-that is not used because it has not been specified will be
-simply 1.0.
-
-The default behavior is to set each bin to the value of the highest
-priority sample found in that bin. If more than one sample has
-the same highest priority, the first such sample is used.
-If the \fB\-F\fP option is used to set a range of acceptable
-priorities, then the mosaicing is done using a Gaussian weighted
-mean algorithm. The samples used are those with priorities larger
-than the highest priority found minus the range value.
-In this scheme, each sample's contribution
-to a Gaussian weighted average for each nearby grid cell
-is calculated using this weighting function:
- 	W(r) = Aexp(r**2/a**2)
-.br
-where r is the distance from the center of the bin to the data point,
-a is the distance at which the weighting function falls to 1/e of its
-maximum value, and A is a normalizing factor set so that the sum of all
-the weights adds to a value of 1.  Normally, the distance a is set to be
-half the average grid point spacing, but this can be varied using the \fB\-W\fP
-option.
-
-If the weight parameter is used on the \fB\-F\fP option then
-for weight = 0 [default] the above weight is used,
-for weight = 1 the above weight is multiplied by the sample priority,
-and for weight = 2 the above weight is multiplied by the square of the sample priority.
-Using \fB\-F1/1\fP causes the priorities to be treated as weights rather than priorities.
-
-If the \fB\-C\fP option is used to set clipping to a value > 0, then a
-2D thin plate spline algorithm is applied to the successfully calculated
-grid values to fill in, or interpolate, gaps in the data.  New values
-are assigned only at grid points within a specified distance from
-the nearest data points (this distance is specified in terms of
-grid point spacing using the \fB\-C\fP command).  Thus, small gaps
-in the data can be filled, or the whole grid can be filled in with
-a smooth interpolation.
-
-The output grid will by default contain values of 99999.9 at cells
-containing no data; if the \fB\-N\fP option is used then the flagging
-value used is NaN, or not-a-number.
-
-The names of the output files are based on the root character string
-specified using the \fB\-O\fP option. A number of grid formats are
-supported, including all of the grid formats supported by \fBGMT\fP.
-See the \fB\-G\fP option below for a list of the available formats.
-If the grid is output in any of the \fBGMT\fP grid formats,
-then its filename is "root.grd", and a shellscript
-which will allow the contents of the grid to be viewed using \fBGMT\fP programs
-is also output with the filename "root.grd.cmd".  If the
-\fB\-G\fP\fI1\fP option is used to specify an ascii format grid, then the
-output grid filename will be "root.asc", but no plotting shellscript
-will be created.
-
-A datalist file containing references to all of the swath files actually
-contibuting to the grid is also created. This file is named by adding
-a ".mb-1" suffix to the root string.
-
-The \fB\-M\fP option causes \fBmbmosaic\fP to output two additional
-grids, the first ("root_num.grd") being the number of high priority
-data points used within each bin, and the second ("root_sd.grd")
-being the standard deviation of the data points used within each bin.
-The \fB\-M\fP option can only be used if Gaussian weighted mean
-mosaicing is enabled with the \fB\-F\fP option.
-Plotting shellscripts
-called "root_num.grd.cmd" and "root_sd.grd.cmd" are also output
-if the grids are in a \fBGMT\fP grid format.
-
-The \fB\-J\fP option can be used to specify grids in UTM eastings
-and northings (meters) rather than in geographic coordinates
-(longitude and latitude degrees).
-
-.SH AUTHORSHIP
-David W. Caress (caress at mbari.org)
-.br
-  Monterey Bay Aquarium Research Institute
-.br
-Dale N. Chayes (dale at ldeo.columbia.edu)
-.br
-  Lamont-Doherty Earth Observatory
-
-.SH OPTIONS
-.TP
-.B \-A
-\fIdatatype\fP
-.br
-Sets the type of data to be read and mosaiced.
- 	\fIdatatype\fP = 3, amplitude data will be mosaiced.
- 	\fIdatatype\fP = 4, sidescan data will be mosaiced.
- 	\fIdatatype\fP = 5, flat bottom grazing angle will be mosaiced.
- 	\fIdatatype\fP = 6, acrosstrack grazing angle will be mosaiced.
- 	\fIdatatype\fP = 7, acrosstrack slope will be mosaiced.
-.br
-Mosaicing of bathymetry is not supported, and so \fIdatatype\fP values of 1 (bathymetry)
-and 2 (topography) are not allowed. Bathymetry and topography should be gridded with
-\fBmbgrid\fP.
-If "F" is appended to \fIdatatype\fP, then \fBmbmosaic\fP will attempt
-to mosaic amplitude or sidescan data that have been filtered with \fBmbfilter\fP.
-If the desired filtered data files do not exist, data input will fail and
-\fBmbmosiac\fP will exit with an error message. Filtered amplitude
-data are stored in ancilliary files ending with ".ffa", and filtered
-sidescan files end in ".ffs". Appending "F" to \fImode\fP values of 5-7 will have no effect.
-Default: \fIdatatype\fP = 4 (sidescan).
-.TP
-.B \-B
-\fIborder\fP
-.br
-Sets the border of a smoothly interpolated grid to the value \fIborder\fP
-wherever no data exist, provided \fIborder\fP > 0.0.
-Default: \fIborder\fP = 0.0
-.TP
-.B \-C
-\fIclip\fP
-.br
-Sets the clipping dimension for the spline interpolation. If \fIclip\fP=0
-no spline interpolation will be done.  If \fIclip\fP>0 then the spline
-interpolation will fill data gaps to a distance of \fIclip\fP times
-the grid spacing.
-Default: \fIclip\fP = 0.
-.TP
-.B \-D
-\fIxdim/ydim\fP
-.br
-Sets the dimensions of the output grid.  This option is superceded
-if the user specifies the grid spacing with the \fB\-E\fP option.
-Default:  \fIxdim\fP = \fIydim\fP = 101.
-.TP
-.B \-E
-\fIdx/dy/units[!]\fP
-.br
-Sets the grid cell spacing to \fIdx\fP in longitude and \fIdy\fP
-in latitude. If \fIunits\fP is not specified, the \fIdx\fP
-and \fIdy\fP values are assumed to be in meters. Valid values
-for \fIunits\fP include "km", "meters", and "degrees".
-If not in degrees, the grid cell spacing values are converted to
-degrees using the central latitude of the grid. If
-\fIdy\fP = 0.0, then the latitude cell spacing will be set
-equal to the longitude cell spacing (after conversion to
-degrees, if necessary).
-By default, the grid spacing is calculated from
-the grid bounds and the grid dimensions. When the user
-uses the \fB\-E\fP option to set the cell spacings, the
-grid dimensions are calculated using the grid bounds and
-grid cell spacings. However, slight adjustments to the
-grid cell spacings are usually required to keep
-the grid bounds as specified. Appending an ! to the end of
-the \fB\-E\fP arguments forces \fBmbmosaic\fP to use the
-exact grid cell spacing values specified by adjusting the
-grid bounds.
-Default: If neither the \fB\-E\fP or \fB\-D\fP options are specified,
-the program sets the grid cell spacing to be 0.02 times the maximum
-sonar altitude in the input files.
-.TP
-.B \-F
-\fIpriority_range[/weight]\fP
-.br
-Turns on Gaussian weighted mean mosaicing. The
-\fIpriority_range\fP value determines which data points are
-used in the mosaicing. The minimum priority threshold for
-each bin is the highest priority value found among the
-samples in that bin minus the \fIpriority_range\fP value.
-Only samples with priorities greater than this threshold
-are used in the Gaussian weighted mean mosaicing.
-The default is to simply set each bin's value equal to the
-value of the highest priority sample in that bin.
-The \fIweight\fP value, if present, causes priorities to be
-also used to weight values. A \fIweight\fP of 0 (the default) indicates
-priorities are not used as weights. A \fIweight\fP of 1
-indicates the Gaussian weight of each value is
-multiplied by its priority to get the value weight. A \fIweight\fP of 2
-indicates the Gaussian weight of each value is multiplied by the square of
-its priority to get the value weight.
-.TP
-.B \-G
-\fIgridkind\fP
-.br
-This option sets the format of the output grid file.
-The default is to output a GMT netCDF 4-byte float grid.
-The user may specify the grid format either by using an
-identifier number, or by using the \fBGMT\fP grid format
-syntax, which allows for scaling and offsets of the data.
-
-First, the simple grid format identifiers are:
- 	\fIgridkind\fP = 1:	ASCII table
- 	\fIgridkind\fP = 2:	binary file (\fBGMT\fP version 1 GRD file)
- 	\fIgridkind\fP = 3:	netCDF file (\fBGMT\fP version 2 GRD file)
- 	\fIgridkind\fP = 4:	Arc/Info and ArcView ASCII grid
- 	\fIgridkind\fP = 100:	GMT netCDF 4-byte float format [Default]
- 	\fIgridkind\fP = 101:	Native binary single precision floats in scanlines with leading grd header
- 	\fIgridkind\fP = 102:	Native binary short integers in scanlines with leading grd header
- 	\fIgridkind\fP = 103:	8-bit standard Sun rasterfile (colormap ignored)
- 	\fIgridkind\fP = 104:	Native binary unsigned char in scanlines with leading grd header
- 	\fIgridkind\fP = 105:	Native binary bits in scanlines with leading grd header
- 	\fIgridkind\fP = 106:	Native binary ``surfer'' grid files
- 	\fIgridkind\fP = 107:	netCDF 1-byte byte format
- 	\fIgridkind\fP = 108:	netCDF 1-byte char format
- 	\fIgridkind\fP = 109:	netCDF 2-byte int format
- 	\fIgridkind\fP = 110:	netCDF 4-byte int format
- 	\fIgridkind\fP = 111:	netCDF 8-byte double format
-.br
-
-Second, a \fBGMT\fP grid format string has the form:
-.br
- 	=id[/scale/offset[/nan]]
-.br
-where id is the \fBGMT\fP format id, and the other values
-are optional. If \fIscale\fP and \fIoffset\fP are given, the
-data will be multiplied by \fIscale\fP and offset by \fIoffset\fP
-prior to being output. The \fInan\fP value sets the value used for
-"not-a-number". The \fBGMT\fP format id's for these format strings are:
- 	\fIid\fP = 0:	GMT netCDF 4-byte float format [Default]
- 	\fIid\fP = 1:	Native binary single precision floats in scanlines with leading grd header
- 	\fIid\fP = 2:	Native binary short integers in scanlines with leading grd header
- 	\fIid\fP = 3:	8-bit standard Sun rasterfile (colormap ignored)
- 	\fIid\fP = 4:	Native binary unsigned char in scanlines with leading grd header
- 	\fIid\fP = 5:	Native binary bits in scanlines with leading grd header
- 	\fIid\fP = 6:	Native binary ``surfer'' grid files
- 	\fIid\fP = 7:	netCDF 1-byte byte format
- 	\fIid\fP = 8:	netCDF 1-byte char format
- 	\fIid\fP = 9:	netCDF 2-byte int format
- 	\fIid\fP = 10:	netCDF 4-byte int format
- 	\fIid\fP = 11:	netCDF 8-byte double format
-.br
-Note that the following arguments are equivalent because they
-all produce a standard \fBGMT\fP netCDF 4-byte float grid:
- 	\fB\-G\fP\fI3\fP
- 	\fB\-G\fP\fI100\fP
- 	\fB\-G\fP\fI=0\fP
-.br
-Should the user wish to produce a grid in native binary floats,
-then the following two arguments will work:
- 	\fB\-G\fP\fI101\fP
- 	\fB\-G\fP\fI=1\fP
-.br
-Should the user wish to produce a grid in native short int format
-with a scaling factor of 10, an offset of 32000, and a NaN value
-of 32767, then the following arguments will suffice:
-.br
- 	\fB\-G\fP\fI=2/10/32000/32767\fP
-
-If \fIgridkind\fP = 3 or \fIgridkind\fP >= 100,
-\fBmbgrid\fP also outputs shellscripts
-which run \fBGMT\fP programs to provide preliminary color
-fill maps of the gridded data. These shellscripts are
-generated using the \fBmbm_grdplot\fP macro.
-
-If \fIgridkind\fP = 4, the output grids will be in the Arc/Info ASCII
-grid format.  Arc/Info ASCII grids use "square" bins,
-meaning that the longitude and latitude grid cell spacings must
-be identical. Thus, whenever the \fIgridkind\fP = 4 option is
-used, the \fB\-E\fP option must also be used in a way which
-ensures equal grid cell spacings (see the \fB\-E\fP documentation
-above).
-Default: \fIgridkind\fP = 100.
-.TP
-.B \-H
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-.TP
-.B \-I
-\fIdatalist\fP
-.br
-Sets the filename of the file containing a list of the input swath sonar
-data files and their formats.  In the \fIdatalist\fP file, each
-data file should be followed by a data format identifier, e.g.:
- 	datafile1 11
- 	datafile2 24
-.br
-This program uses the \fBMBIO\fP library and will read or write any swath sonar
-format supported by \fBMBIO\fP. A list of the swath sonar data formats
-currently supported by \fBMBIO\fP and their identifier values
-is given in the \fBMBIO\fP manual page.
-Default: \fIdatalist\fP = datalist.mb-1
-.TP
-.B \-J
-\fIprojection\fP
-By default, \fBmbgrid\fP generates grids in Geographic coordinates,
-meaning that position is defined in longitude and latitude using
-the WGS84 geographic coordinate system.
-The \fB\-J\fP option can be used to specify
-an alternate, projected coordinate system (PCS). When a PCS is used,
-position will be defined in eastings and northings (meters) relative
-to the origin of the particular PCS. Universal Transverse Mercator
-is the most commonly used PCS in the oceanographic community, but
-\fBmbgrid\fP supports a large number of other PCS's as well.
-The underlying projection functions derive from the \fBPROJ.4\fP library
-written by Gerald Evenden, then of the U.S. Geological Survey.
-
-The \fIprojection\fP argument for the \fB\-J\fP option can be either
-a PCS identifier from the projection definition list provided at the
-end of this manual page, or simply \fB\-J\fP\fIU\fP to specify using
-UTM in whatever zone is appropriate for the grid bounds specified
-with the \fB\-R\fP option.
-
-For instance, to fully specify a particular northern UTM
-zone, set \fIprojection\fP = UTMXXN where XX gives
-the UTM zone (defined from 01 to 60). As an example, a northern UTM
-zone 12 projection can be specified using \fB\-J\fP\fIUTM12N\fP.
-Southern UTM zones are specified as UTMXXS. The European Petroleum
-Survey Group (EPSG) has defined a large number of PCS's used worldwide
-and assigned number id's to each; one can also specify the northern
-UTM zone 12 projection using its EPSG designation,
-or \fB\-J\fP\fIepsg32612\fP.
-When the projected coordinate system is fully specified
-by the \fB\-J\fP option, then the grid bounds may be specified using
-\fB\-R\fP in either longitude and latitude or in eastings and northings.
-
-Alternatively, one may indicate a UTM projection without specifying the
-zone by using \fB\-J\fP\fIU\fP. In this case, the
-UTM zone will be inferred from the midpoint of the
-specified longitude and latitude bounds, and then the
-longitude and latitude bounds given with the
-\fB\-fR\fP option are translated to UTM eastings and northings.
-
-All grids and mosaics produced by \fBMB-System\fP
-programs contain identifiers that are recognized
-by the plotting macros \fBmbm_grdplot\fP,
-\fBmbm_grd3dplot\fP, and \fBmbm_grdtiff\fP.
-These plotting macros automatically use a
-linear map projection whenever they
-encounter grids and mosaics that are already
-in a projected coordinate system. Also, the program \fBmbgrdtiff\fP
-automatically inserts the appropriate projection information into
-the GeoTIFF images it generates. As a result, images generated by
-\fBmbgrdtiff\fP will be properly georeferenced when they are imported
-into GIS software.
-.TP
-.B \-L
-\fIlonflip\fP
-.br
-Sets the range of the longitude values returned.
-If \fIlonflip\fP=\-1 then the longitude values will be in
-the range from \-360 to 0 degrees. If \fIlonflip\fP=0
-then the longitude values will be in
-the range from \-180 to 180 degrees. If \fIlonflip\fP=1
-then the longitude values will be in
-the range from 0 to 360 degrees.
-Default: \fIlonflip\fP = 0.
-.TP
-.B \-M
-Causes two additional grids to be output. One is a grid containing
-the standard deviation of the data within each grid cell relative
-to the grid value, the other contains the number of data
-points in each grid cell. This option is ignored unless the
-Gaussian weighted mean mosaicing is enabled with the \fP-F\fP option.
-.TP
-.B \-N
-Causes grid cells with no data and no interpolation to be set to a
-value of NaN instead of the default value of 99999.9.  The NaN value
-is expected by \fBGMT\fP programs such \fBgrdview\fP.
-.TP
-.B \-O
-\fIroot\fP
-.br
-Sets the character string to be used as the root of the
-output filenames. For example, if the grid is output as a \fBGMT\fP
-version 2 GRD format (netCDF) file (the default),
-then its filename is "root.grd". If the
-\fB\-G\fP\fI1\fP option is used to specify an ascii format grid, then the
-output grid filename will be "root.asc". If the
-\fB\-G\fP\fI2\fP option is used to specify a version 1 GRD
-format (binary) grid, then the
-output grid filename will be "root.grd1". If the output grid is
-in the \fBGMT\fP version 2 GRD format, a shellscript
-which will allow the contents of the grid to viewed using \fBGMT\fP programs
-is also output with the filename "root.grd.cmd".
-.TP
-.B \-P
-\fIpings\fP
-.br
-Sets the ping averaging of the input data. If \fIpings\fP > 0, then
-that number of input pings will be averaged to produce one output
-ping.  If \fIpings\fP = 0, then the ping averaging will automatically
-be done so that the along-track ping spacing is equal to the across-track
-beam spacing. Default: \fIpings\fP = 1.
-.TP
-.B \-R
-\fIwest/east/south/north\fP
-.br
-\fIfactor\fP
-.br
-The first form sets the longitude and latitude bounds of the output grid.
-By default (if the \fB\-R\fP\fIwest/east/south/north\fP
-option is not specified) the program will set
-the grid bounds to be the area encompassing all of the data in the
-input files. The second form (\fB\-R\fP\fIfactor\fP) expands the automatically
-calculated bounds by the multiplicative \fIfactor\fP.The value
-\fIfactor\fP must be greater than one; if \fIfactor\fP = 1.1 then the
-grid bounds will be expanded to the east and west by an amount 0.05 times
-the data bounds east-west extend and to the north and south by an amount
-0.05 times the data bounds north-south extent.
-If the user uses the \fB\-E\fP option to set the grid spacing, then the dimensions
-will be calculated from the grid bounds and spacing. In these
-circumstances rounding errors will usually require that the eastern
-and northern bounds be adjusted to fit exactly with the
-grid dimensions and spacing.
-Default: If the \fB\-R\fP\fIwest/east/south/north\fP
-option is not specified, the program will set
-the grid bounds to be the area encompassing all of the data in the
-input files.
-.TP
-.B \-S
-\fIspeed\fP
-.br
-Sets the minimum speed in km/hr (5.5 kts ~ 10 km/hr) allowed in
-the input data; pings associated with a smaller ship speed will not be
-output. Default: \fIspeed\fP = 0.
-.TP
-.B \-T
-\fItension\fP
-.br
-Sets the \fItension\fP value used in the thin plate spline interpolation.
-A \fItension\fP of 0 gives a minimum curvature surface with free edges;
-this is a pure Laplacian solution. A nonzero \fItension\fP tends to
-suppress spurious oscillations and flatten
-the interpolation toward the edges; a \fItension\fP of infinity
-yields a pure spline solution. The \fItension\fP must be zero or
-greater.
-Default: \fItension\fP = 1.0e10 (pure spline solution).
-.TP
-.B \-U
-\fIbearing/factor[/mode]\fP
-.br
-Enables prioritizing data points according to their look azimuth
-or to the platform heading at ping time.
-
-If \fImode\fP = 0 or is
-absent, then the look azimuth criteria is applied, with \fIbearing\fP
-being interpreted as the desired look azimuth. Data on the port side
-of the swath have a look azimuth equal to the heading \- 90 degrees,
-and data on the starboard side have a look azimuth equal to the
-heading + 90 degrees). The \fIfactor\fP value
-modulates how rapidly the priority degrades away from the preferred
-look azimuth. The priority (p) for a data point is assigned as follows:
-        p = cos(f * (Ap \- Aa))
-.br
-when \-90 < (f * (Ap \- Aa)) < 90 and
-        p = 0
-.br
-otherwise, where f = \fIfactor\fP, Ap = \fIbearing\fP, and Aa is the
-actual look azimuth of the data point.
-If \fIfactor\fP = 1.0, the priority will be 1.0
-at \fIbearing\fP and will fall to zero for look
-azimuths more than 90 degrees away from \fIbearing\fP.
-If \fIfactor\fP > 1.0, the range of nonzero priorities will shrink
-closer to \fIbearing\fP (e.g. if \fIfactor\fP = 2.0,
-nonzero priorities will be restricted to look azimuths within
-45 degrees of \fIbearing\fP). If \fIfactor\fP < 1.0, the
-range of nonzero priorities will expand (e.g. if \fIfactor\fP = 0.5, only
-look azimuths 180 degrees away from \fIbearing\fP
-will have a zero priority).
-
-If \fImode\fP = 1 then the heading criteria is applied, with \fIbearing\fP
-being interpreted as the desired heading. The \fIfactor\fP value
-modulates how rapidly the priority degrades away from the preferred
-heading. The priority (p) for a data point is assigned as follows:
-        p = cos(f * (Hp \- Ha))
-.br
-when \-90 < (f * (Hp \- Ha)) < 90 and
-        p = 0
-.br
-otherwise, where f = \fIfactor\fP, Ap = \fIbearing\fP, and Aa is the
-actual heading of the data point.
-If \fIfactor\fP = 1.0, the priority will be 1.0
-at \fIbearing\fP and will fall to zero for headings
-more than 90 degrees away from \fIbearing\fP.
-If \fIfactor\fP > 1.0, the range of nonzero priorities will shrink
-closer to \fIbearing\fP (e.g. if \fIfactor\fP = 2.0,
-nonzero priorities will be restricted to headings within
-45 degrees of \fIbearing\fP). If \fIfactor\fP < 1.0, the
-range of nonzero priorities will expand (e.g. if \fIfactor\fP = 0.5, only
-headings 180 degrees away from \fIbearing\fP
-will have a zero priority).
-.TP
-.B \-V
-Normally, \fBmbmosaic\fP prints out information regarding its
-controlling parameters during execution; the
-\fB\-V\fP option causes the program to also print out statements
-indicating its progress.
-.TP
-.B \-W
-\fIscale\fP
-.br
-Sets the width of the gaussian weighting function in terms of
-the grid spacing.  The distance to the 1/e point of the weighting
-function is given by half of the grid spacing times \fIscale\fP.
-Default: \fIscale\fP = 1.0
-.TP
-.B \-X
-\fIextend\fP
-.br
-Extends the size of the internal grid so that the output grid is a
-subset from the center of a larger grid.   This allows data outside
-the output grid to guide the spline interpolation of data gaps which
-happen to lie at the the edge of the output grid.  The amount of
-extension is \fIextend\fP times the grid width/height to each side.
-Thus, if \fIextend\fP=1.0, then the internal grid will have dimensions
-three times the output grid.
-Default: \fIextend\fP = 0.0
-.TP
-.B \-Y
-\fIpriority_source\fP
-.br
-Enables priortization of data points based on their apparent
-grazing angle (this angle is arctan(x/z) where x is acrosstrack distance
-and z is sonar altitude, so
-that the center of the swath has an apparent grazing angle of
-zero, the port swath edge has a large negative angle, and the
-starboard swath edge has a large positive angle). A number of predefined
-priority tables are available and can be accessed by setting \fIpriority_source\fP
-to a number from 1 to 8. These priority tables include:
-
-
-\fIpriority_source\fP = 1:
-.br
-      Angle (deg)  Priority
-      \---------------------
- 	  \-60          1.0
- 	    0          0.0
- 	   60          1.0
-
-
-\fIpriority_source\fP = 2:
-.br
-      Angle (deg)  Priority
-      \---------------------
- 	  \-67          1.0
- 	    0          0.0
- 	   67          1.0
-
-
-\fIpriority_source\fP = 3:
-.br
-      Angle (deg)  Priority
-      \---------------------
- 	  \-75          1.0
- 	    0          0.0
- 	   75          1.0
-
-
-\fIpriority_source\fP = 4:
-.br
-      Angle (deg)  Priority
-      \---------------------
- 	  \-85          1.0
- 	    0          0.0
- 	   85          1.0
-
-
-\fIpriority_source\fP = 5:
-.br
-      Angle (deg)  Priority
-      \---------------------
- 	  \-60          0.0
- 	    0          1.0
- 	   60          0.0
-
-
-\fIpriority_source\fP = 6:
-.br
-      Angle (deg)  Priority
-      \---------------------
- 	  \-67          0.0
- 	    0          1.0
- 	   67          0.0
-
-
-\fIpriority_source\fP = 7:
-.br
-      Angle (deg)  Priority
-      \---------------------
- 	  \-75          0.0
- 	    0          1.0
- 	   75          0.0
-
-
-\fIpriority_source\fP = 8:
-.br
-      Angle (deg)  Priority
-      \---------------------
- 	  \-85          0.0
- 	    0          1.0
- 	   85          0.0
-
-
-Alternatively, if \fIpriority_source\fP specifies a file name, then the data
-priority table will be read from this file.
-The priority file should contain two columns: apparent grazing angles
-in degrees from vertical followed by data priority values between 0.0
-and 1.0. The first line of
-the file should contain the minimum, or port-most grazing angle
-followed by the associated priority. The following lines
-should contain increasingly large grazing angles (and associated
-priorities) up to the maximum, or starboard-most, grazing angle.
-The highest priority assigned should be one, and the lowest zero.
-Priorities for grazing angles less than the minimum or greater
-than the maximum will be zero. See the examples below for a
-further explanation of the use of \fIpriority_source\fP.
-.TP
-.B \-Z
-\fIbath_default\fP
-.br
-Sets the default depth used for calculating grazing angles for
-amplitude or sidescan values where depths are not available.
-Default: \fIscale\fP = 1000.0
-.SH EXAMPLES
-Suppose you want to mosaic some SeaBeam 2112 sidescan data
-in six data files over a region with longitude
-bounds of 113.4833E to 115.4333E and latitude bounds
-of 32.1166S to 31.5500S, and you would like a 100 m grid spacing.
-First, create a datalist file using a text editor which contains the
-data filenames followed by the appropriate format identifier:
-
- 	kn_perth_01.mb41 41
- 	kn_perth_05.mb41 41
- 	kn_perth_09.mb41 41
- 	kn_perth_13.mb41 41
- 	kn_perth_17.mb41 41
- 	kn_perth_03.mb41 41
-
-The nadir region of the sidescan swath is generally of little
-use because it is dominated by specular reflection rather
-than backscatter. In order to allow \fBmbmosaic\fP to
-preferentially use data from the outer swath, where possible,
-create another file containing a list of data priority as
-a function of apparent grazing angle:
-
- 	-60.0 0.2
- 	-45.0 1.0
- 	-15.0 0.8
- 	-14.9 0.1
- 	14.9 0.1
- 	15.0 0.8
- 	45.0 1.0
- 	60.0 0.2
-
-Here the negative angles denote the port side of the swath and
-the positive angles denote the starboard side of the swath.
-The priorities are linearly interpolated between the discreet
-angle/priority pairs.
-Note that the nadir region (angles less than +/- 15 degrees)
-has low priority, and that the highest priority is given to
-angles of 45 degrees. No data with angle magnitudes greater
-than 60 degrees will be used.
-
-Then, run \fBmbmosaic\fP as follows:
- 	mbmosaic \-Idatalist \\
- 		-R114.1333/114.7833/-32.1166/-31.55 \\
- 		-A4 \-E100/100/meters \-N \\
- 		-Yangle_priority.dat \-F0.10 \-C10 \\
- 		-Operth_ss \-V
-
-The \fB\-E\fP option specifies grid spacings of 100 meters in
-both the longitude and latitude; the dimensions of the output
-grid are calculated according by \fBmbmosaic\fP. The \fB\-F\fP
-option enables Gaussian weighted mean mosaicing and the priority
-range of 0.10 means that for each bin, all data with priorities
-within 0.1 of the highest priority will be used.
-By specifying a clipping dimension of 10 we cause small gaps in
-the mosaic to be filled in through spine interpolation .
-The output looks like:
-
- Program mbmosaic
- Version $Id: mbmosaic.1 2172 2014-03-14 07:28:54Z caress $
- MB-system Version 4.5
-
- MBMOSAIC Parameters:
- List of input files: datalist
- Output fileroot:     perth_ss
- Input Data Type:     Sidescan
- Grid projection: Geographic
- Grid dimensions: 616 629
- Grid bounds:
-   Longitude:  114.1333  114.7833
-   Latitude:   \-32.1166  \-31.5500
- Working grid dimensions: 616 629
- Working Grid bounds:
-   Longitude:  114.1333  114.7833
-   Latitude:   \-32.1166  \-31.5500
- Longitude interval: 0.001057 degrees or 100.051035 m
- Latitude interval:  0.000902 degrees or 100.042679 m
- Specified Longitude interval: 100.000000 meters
- Specified Latitude interval:  100.000000 meters
- Input data bounds:
-   Longitude:  113.4833  115.4333
-   Latitude:   \-32.6832  \-30.9834
- Mosaicing algorithm:
-   Average of highest weighted pixels
-   Pixel weighting range: 0.100000
-   Pixels weighted by look azimuth
-   Preferred look azimuth: 90.000000
-   Look azimuth factor:    2.000000
-   Spline interpolation applied with clipping dimension: 10
-   Spline tension (range 0.0 to infinity): 10000000000.000000
- Grid format 3:  GMT version 2 grd (netCDF)
- NaN values used to flag regions with no data
- MBIO parameters:
-   Ping averaging:       1
-   Longitude flipping:   1
-   Speed minimum:       0.0 km/hr
-
- 330814 data points processed in kn_perth_01.mb41
- 239709 data points processed in kn_perth_05.mb41
- 234034 data points processed in kn_perth_09.mb41
- 310066 data points processed in kn_perth_13.mb41
- 297318 data points processed in kn_perth_17.mb41
- 336504 data points processed in kn_perth_03.mb41
-
- 1748445 total data points processed in highest weight pass
-
- 330814 data points processed in kn_perth_01.mb41
- 239709 data points processed in kn_perth_05.mb41
- 234034 data points processed in kn_perth_09.mb41
- 310066 data points processed in kn_perth_13.mb41
- 297318 data points processed in kn_perth_17.mb41
- 336504 data points processed in kn_perth_03.mb41
-
- 1748445 total data points processed in averaging pass
-
- Making raw grid...
-
- Doing spline interpolation with 86414 data points...
-
- Total number of bins:            387464
- Bins set using data:             86414
- Bins set using interpolation:    58051
- Bins not set:                    242999
- Maximum number of data in a bin: 121
- Minimum value:   \-6573.12   Maximum value:   97704.64
- Minimum sigma:    4.50125   Maximum sigma: 42979.49567
-
- Outputting results...
-
- executing mbm_grdplot...
- Running grdhisteq...
-
- Program Status:
- \--------------
-
-   Plot Style:
-     Color Fill
-     Horizontal Color Scale
-
-   Input Files:
-     Data GRD File:            perth_ss.grd
-     Intensity GRD List File:
-
-   Output Files:
-     Output plot name root:    perth_ss.grd
-     Color palette table:      perth_ss.grd.cpt
-     Plotting shellscript:     perth_ss.grd.cmd
-     Plot file:                perth_ss.grd.ps
-
-   Plot Attributes:
-     Plot width:               6.5000
-     Plot height:              6.6369
-     Page size:                a
-     Page width:               8.5
-     Page height:              11
-     Projection:               \-Jm10
-     Axes annotation:          10m/10m
-     Orientation:              portrait
-     Number of colors:         11
-     Color Palette:            Grayscale
-     Colors reversed
-
-   Grid Data Attributes:
-     Longitude min max:         114.1330   114.7830
-     Latitude min max:          \-32.1166   \-31.5500
-     Data min max:                 \-6573   9.77e+04
-
-   Primary Grid Plotting Controls:
-     Color start datum:        \-12500.000000
-     Color end datum:          112500.000000
-     Histogram stretch applied to color palette
-
-   GMT Default Values Reset in Script:
-     PAPER_WIDTH               8.5
-     ANOT_FONT                 Helvetica
-     LABEL_FONT                Helvetica
-     HEADER_FONT               Helvetica
-     ANOT_FONT_SIZE            8
-     LABEL_FONT_SIZE           8
-     HEADER_FONT_SIZE          10
-     FRAME_WIDTH               0.074999999999999997
-     TICK_LENGTH               0.074999999999999997
-     PAGE_ORIENTATION          LANDSCAPE
-     COLOR_BACKGROUND          0/0/0
-     COLOR_FOREGROUND          255/255/255
-     COLOR_NAN                 255/255/255
-
- \--------------
-
- Plot generation shellscript <perth_ss.grd.cmd> created.
-
- Instructions:
-   Execute <perth_ss.grd.cmd> to generate
-        Postscript plot <perth_ss.grd.ps>.
-   Executing <perth_ss.grd.cmd> also invokes
-        xpsview to view the plot on the screen.
-
- \--------------
-
-
- Done.
-
-The names of the output files are based on the root character string
-specified using the \fB\-O\fP option.  Since the grid is output as a netCDF
-GRD format file, its filename is "perth_ss.grd"; a shellscript
-which will allow the contents of the grid to viewed using \fBGMT\fP programs
-is also output with the filename "perth_ss.grd.cmd".
-
-Suppose that one wants to produce a mosaic composed only of data
-with a more or less eastward look azimuth. Then add the \fB\-U\fP
-option with a preferred azimuth of 90 degrees. A look azimuth
-factor of 2.0 will cause \fBmbmosaic\fP to reject any data with
-look azimuths outside a range of 45 to 135 degrees.
-The following will suffice:
- 	mbmosaic \-Idatalist \\
- 		-R114.1333/114.7833/-32.1166/-31.55 \\
- 		-A4 \-E100/100/meters \-N \\
- 		-Yangle_priority.dat \-F0.10 \-C10 \\
- 		-Operth_ss \-U90/2.0 \-V
-
-.SH SEE ALSO
-\fBmbsystem\fP(1), \fBmbgrid\fP(1), \fBmbm_grid\fP(1), \fBmbm_grd2arc\fP(1)
-
-.SH BUGS
-The options for this program have grown a bit complicated.
-If you have other problems, please let us know.
-
-
-.SH APPENDIX 1: PROJECTED COORDINATE SYSTEM IDENTIFIERS
-The following is a list of the projected coordinate systems (PCS's)
-that are supported by MB-System. The full PCS definitions are
-found in the file mbsystem/share/Projections.dat. These definitions
-are in the \fBPROJ.4\fP format and derive from the \fBPROJ.4\fP
-4.6.1 distribution obtained from http://trac.osgeo.org/proj/
-in September 2008. The proj library source code has been
-incorporated unchanged into the MB-System package.
-
-The first item on each line is the PCS identifier inside brackets, such
-as <UTM10N> or <epsg32749>. To specify using one of these PCS's, use
-the \fB\-J\fP option, e.g. \fB\-J\fP\fIUTM10N\fP or \fB\-J\fP\fIepsg32749\fP.
-
- \---------------------------------------------------------
- Standard Universal Transverse Mercator (UTM)
-     and Universal Polar Stereographic (UPS)
-     projected coordinate systems for MB-System
- \---------------------------------------------------------
-
- <UTM01N> : WGS 84 / UTM zone 1N
- <UTM02N> : WGS 84 / UTM zone 2N
- <UTM03N> : WGS 84 / UTM zone 3N
- <UTM04N> : WGS 84 / UTM zone 4N
- <UTM05N> : WGS 84 / UTM zone 5N
- <UTM06N> : WGS 84 / UTM zone 6N
- <UTM07N> : WGS 84 / UTM zone 7N
- <UTM08N> : WGS 84 / UTM zone 8N
- <UTM09N> : WGS 84 / UTM zone 9N
- <UTM10N> : WGS 84 / UTM zone 10N
- <UTM11N> : WGS 84 / UTM zone 11N
- <UTM12N> : WGS 84 / UTM zone 12N
- <UTM13N> : WGS 84 / UTM zone 13N
- <UTM14N> : WGS 84 / UTM zone 14N
- <UTM15N> : WGS 84 / UTM zone 15N
- <UTM16N> : WGS 84 / UTM zone 16N
- <UTM17N> : WGS 84 / UTM zone 17N
- <UTM18N> : WGS 84 / UTM zone 18N
- <UTM19N> : WGS 84 / UTM zone 19N
- <UTM20N> : WGS 84 / UTM zone 20N
- <UTM21N> : WGS 84 / UTM zone 21N
- <UTM22N> : WGS 84 / UTM zone 22N
- <UTM23N> : WGS 84 / UTM zone 23N
- <UTM24N> : WGS 84 / UTM zone 24N
- <UTM25N> : WGS 84 / UTM zone 25N
- <UTM26N> : WGS 84 / UTM zone 26N
- <UTM27N> : WGS 84 / UTM zone 27N
- <UTM28N> : WGS 84 / UTM zone 28N
- <UTM29N> : WGS 84 / UTM zone 29N
- <UTM30N> : WGS 84 / UTM zone 30N
- <UTM31N> : WGS 84 / UTM zone 31N
- <UTM32N> : WGS 84 / UTM zone 32N
- <UTM33N> : WGS 84 / UTM zone 33N
- <UTM34N> : WGS 84 / UTM zone 34N
- <UTM35N> : WGS 84 / UTM zone 35N
- <UTM36N> : WGS 84 / UTM zone 36N
- <UTM37N> : WGS 84 / UTM zone 37N
- <UTM38N> : WGS 84 / UTM zone 38N
- <UTM39N> : WGS 84 / UTM zone 39N
- <UTM40N> : WGS 84 / UTM zone 40N
- <UTM41N> : WGS 84 / UTM zone 41N
- <UTM42N> : WGS 84 / UTM zone 42N
- <UTM43N> : WGS 84 / UTM zone 43N
- <UTM44N> : WGS 84 / UTM zone 44N
- <UTM45N> : WGS 84 / UTM zone 45N
- <UTM46N> : WGS 84 / UTM zone 46N
- <UTM47N> : WGS 84 / UTM zone 47N
- <UTM48N> : WGS 84 / UTM zone 48N
- <UTM49N> : WGS 84 / UTM zone 49N
- <UTM50N> : WGS 84 / UTM zone 50N
- <UTM51N> : WGS 84 / UTM zone 51N
- <UTM52N> : WGS 84 / UTM zone 52N
- <UTM53N> : WGS 84 / UTM zone 53N
- <UTM54N> : WGS 84 / UTM zone 54N
- <UTM55N> : WGS 84 / UTM zone 55N
- <UTM56N> : WGS 84 / UTM zone 56N
- <UTM57N> : WGS 84 / UTM zone 57N
- <UTM58N> : WGS 84 / UTM zone 58N
- <UTM59N> : WGS 84 / UTM zone 59N
- <UTM60N> : WGS 84 / UTM zone 60N
- <UTM01S> : WGS 84 / UTM zone 1S
- <UTM02S> : WGS 84 / UTM zone 2S
- <UTM03S> : WGS 84 / UTM zone 3S
- <UTM04S> : WGS 84 / UTM zone 4S
- <UTM05S> : WGS 84 / UTM zone 5S
- <UTM06S> : WGS 84 / UTM zone 6S
- <UTM07S> : WGS 84 / UTM zone 7S
- <UTM08S> : WGS 84 / UTM zone 8S
- <UTM09S> : WGS 84 / UTM zone 9S
- <UTM10S> : WGS 84 / UTM zone 10S
- <UTM11S> : WGS 84 / UTM zone 11S
- <UTM12S> : WGS 84 / UTM zone 12S
- <UTM13S> : WGS 84 / UTM zone 13S
- <UTM14S> : WGS 84 / UTM zone 14S
- <UTM15S> : WGS 84 / UTM zone 15S
- <UTM16S> : WGS 84 / UTM zone 16S
- <UTM17S> : WGS 84 / UTM zone 17S
- <UTM18S> : WGS 84 / UTM zone 18S
- <UTM19S> : WGS 84 / UTM zone 19S
- <UTM20S> : WGS 84 / UTM zone 20S
- <UTM21S> : WGS 84 / UTM zone 21S
- <UTM22S> : WGS 84 / UTM zone 22S
- <UTM23S> : WGS 84 / UTM zone 23S
- <UTM24S> : WGS 84 / UTM zone 24S
- <UTM25S> : WGS 84 / UTM zone 25S
- <UTM26S> : WGS 84 / UTM zone 26S
- <UTM27S> : WGS 84 / UTM zone 27S
- <UTM28S> : WGS 84 / UTM zone 28S
- <UTM29S> : WGS 84 / UTM zone 29S
- <UTM30S> : WGS 84 / UTM zone 30S
- <UTM31S> : WGS 84 / UTM zone 31S
- <UTM32S> : WGS 84 / UTM zone 32S
- <UTM33S> : WGS 84 / UTM zone 33S
- <UTM34S> : WGS 84 / UTM zone 34S
- <UTM35S> : WGS 84 / UTM zone 35S
- <UTM36S> : WGS 84 / UTM zone 36S
- <UTM37S> : WGS 84 / UTM zone 37S
- <UTM38S> : WGS 84 / UTM zone 38S
- <UTM39S> : WGS 84 / UTM zone 39S
- <UTM40S> : WGS 84 / UTM zone 40S
- <UTM41S> : WGS 84 / UTM zone 41S
- <UTM42S> : WGS 84 / UTM zone 42S
- <UTM43S> : WGS 84 / UTM zone 43S
- <UTM44S> : WGS 84 / UTM zone 44S
- <UTM45S> : WGS 84 / UTM zone 45S
- <UTM46S> : WGS 84 / UTM zone 46S
- <UTM47S> : WGS 84 / UTM zone 47S
- <UTM48S> : WGS 84 / UTM zone 48S
- <UTM49S> : WGS 84 / UTM zone 49S
- <UTM50S> : WGS 84 / UTM zone 50S
- <UTM51S> : WGS 84 / UTM zone 51S
- <UTM52S> : WGS 84 / UTM zone 52S
- <UTM53S> : WGS 84 / UTM zone 53S
- <UTM54S> : WGS 84 / UTM zone 54S
- <UTM55S> : WGS 84 / UTM zone 55S
- <UTM56S> : WGS 84 / UTM zone 56S
- <UTM57S> : WGS 84 / UTM zone 57S
- <UTM58S> : WGS 84 / UTM zone 58S
- <UTM59S> : WGS 84 / UTM zone 59S
- <UTM60S> : WGS 84 / UTM zone 60S
- <UPSN> : WGS 84 / UPS North
- <UPSS> : WGS 84 / UPS South
-
- \---------------------------------------------------------
- Listing of State Plane North American Datum Zones
- \---------------------------------------------------------
-   MB-System projection ids are the zone number
-   prefixed by either "nad27sp" or "nad83sp"
- \----------------------------------------------
-                                NGS zone number
- State and zone                  1927     1983
- \----------------------------------------------
- Alabama east ..................  101      101
- Alabama west ..................  102      102
- Alaska zone no. 1 ............. 5001     5001
- Alaska zone no. 2 ............. 5002     5002
- Alaska zone no. 3 ............. 5003     5003
- Alaska zone no. 4 ............. 5004     5004
- Alaska zone no. 5 ............. 5005     5005
- Alaska zone no. 6 ............. 5006     5006
- Alaska zone no. 7 ............. 5007     5007
- Alaska zone no. 8 ............. 5008     5008
- Alaska zone no. 9 ............. 5009     5009
- Alaska zone no. 10 ............ 5010     5010
- American Samoa ................ 5300
- Arizona central ...............  202      202
- Arizona east ..................  201      201
- Arizona west ..................  203      203
- Arkansas north ................  301      301
- Arkansas south ................  302      302
- California I ..................  401      401
- California II .................  402      402
- California III ................  403      403
- California IV .................  404      404
- California V ..................  405      405
- California VI .................  406      406
- California VII ................  407
- Colorado central ..............  502      502
- Colorado north ................  501      501
- Colorado south ................  503      503
- Connecticut ...................  600      600
- Delaware ......................  700      700
- Florida east ..................  901      901
- Florida north .................  903      903
- Florida west ..................  902      902
- Georgia east .................. 1001     1001
- Georgia west .................. 1002     1002
- Guam Island ................... 5400
- Hawaii 1 ...................... 5101     5101
- Hawaii 2 ...................... 5102     5102
- Hawaii 3 ...................... 5103     5103
- Hawaii 4 ...................... 5104     5104
- Hawaii 5 ...................... 5105     5105
- Idaho central ................. 1102     1102
- Idaho east .................... 1101     1101
- Idaho west .................... 1103     1103
- Illinois east ................. 1201     1201
- Illinois west ................. 1202     1202
- Indiana east .................. 1301     1301
- Indiana west .................. 1302     1302
- Iowa north .................... 1401     1401
- Iowa south .................... 1402     1402
- Kansas north .................. 1501     1501
- Kansas south .................. 1502     1502
- Kentucky north ................ 1601     1601
- Kentucky south ................ 1602     1602
- Louisiana north ............... 1701     1701
- Louisiana offshore ............ 1703     1703
- Louisiana south ............... 1702     1702
- Maine east .................... 1801     1801
- Maine west .................... 1802     1802
- Maryland ...................... 1900     1900
- Massachusetts island .......... 2002     2002
- Massachusetts mainland ........ 2001     2001
- Michigan central/l ............ 2112     2112 current
- Michigan central/m ............ 2102          old
- Michigan east ................. 2101          old
- Michigan north ................ 2111     2111 current
- Michigan south ................ 2113     2113 current
- Michigan west ................. 2103          old
- Minnesota central ............. 2202     2202
- Minnesota north ............... 2201     2201
- Minnesota south ............... 2203     2203
- Mississippi east .............. 2301     2301
- Mississippi west .............. 2302     2302
- Missouri central .............. 2402     2402
- Missouri east ................. 2401     2401
- Missouri west ................. 2403     2403
- Montana .......................          2500
- Montana central ............... 2502
- Montana north ................. 2501
- Montana south ................. 2503
- Nebraska ......................          2600
- Nebraska north ................ 2601
- Nebraska south ................ 2602
- Nevada central ................ 2702     2702
- Nevada east ................... 2701     2701
- Nevada west ................... 2703     2703
- New hampshire ................. 2800     2800
- New jersey .................... 2900     2900
- New mexico central ............ 3002     3002
- New mexico east ............... 3001     3001
- New mexico west ............... 3003     3003
- New york central .............. 3102     3102
- New york east ................. 3101     3101
- New york long island .......... 3104     3104
- New york west ................. 3103     3103
- North carolina ................ 3200     3200
- North dakota north ............ 3301     3301
- North dakota south ............ 3302     3302
- Ohio north .................... 3401     3401
- Ohio south .................... 3402     3402
- Oklahoma north ................ 3501     3501
- Oklahoma south ................ 3502     3502
- Oregon north .................. 3601     3601
- Oregon south .................. 3602     3602
- Pennsylvania north ............ 3701     3701
- Pennsylvania south ............ 3702     3702
- Puerto Rico, Virgin Islands ... 5201     5200
- Rhode Island .................. 3800     3800
- South Carolina ................          3900
- South Carolina north .......... 3901
- South Carolina south .......... 3902
- South Dakota north ............ 4001     4001
- South Dakota south ............ 4002     4002
- Tennessee ..................... 4100     4100
- Texas central ................. 4203     4203
- Texas north ................... 4201     4201
- Texas north central ........... 4202     4202
- Texas south ................... 4205     4205
- Texas south central ........... 4204     4204
- Utah central .................. 4302     4302
- Utah north .................... 4301     4301
- Utah south .................... 4303     4303
- Vermont ....................... 4400     4400
- Virgin Islands, St. Croix ..... 5202
- Virginia north ................ 4501     4501
- Virginia south ................ 4502     4502
- Washington north .............. 4601     4601
- Washington south .............. 4602     4602
- West Virginia north ........... 4701     4701
- West Virginia south ........... 4702     4702
- Wisconsin central ............. 4802     4802
- Wisconsin north ............... 4801     4801
- Wisconsin south ............... 4803     4803
- Wyoming east .................. 4901     4901
- Wyoming east central .......... 4902     4902
- Wyoming west .................. 4904     4904
- Wyoming west central .......... 4903     4903
- \----------------------------------------------
-
- \---------------------------------------------------------
- State Plane Coordinate Systems
- North American Datum 1927
- \---------------------------------------------------------
- <nad27sp101> : alabama east> : nad27sp
- <nad27sp102> : alabama west> : nad27sp
- <nad27sp5010> : alaska zone no. 10> : nad27sp
- <nad27sp5300> : american samoa> : nad27sp
- <nad27sp201> : arizona east> : nad27sp
- <nad27sp202> : arizona central> : nad27sp
- <nad27sp203> : arizona west> : nad27sp
- <nad27sp301> : arkansas north> : nad27sp
- <nad27sp302> : arkansas south> : nad27sp
- <nad27sp401> : california i> : nad27sp
- <nad27sp402> : california ii> : nad27sp
- <nad27sp403> : california iii> : nad27sp
- <nad27sp404> : california iv> : nad27sp
- <nad27sp405> : california v> : nad27sp
- <nad27sp406> : california vi> : nad27sp
- <nad27sp407> : california vii> : nad27sp
- <nad27sp501> : colorado north> : nad27sp
- <nad27sp502> : colorado central> : nad27sp
- <nad27sp503> : colorado south> : nad27sp
- <nad27sp600> : connecticut \---> : nad27sp
- <nad27sp700> : delaware \---> : nad27sp
- <nad27sp901> : florida east> : nad27sp
- <nad27sp902> : florida west> : nad27sp
- <nad27sp903> : florida north> : nad27sp
- <nad27sp1001> : georgia east> : nad27sp
- <nad27sp1002> : georgia west> : nad27sp
- <nad27sp5101> : hawaii 1> : nad27sp
- <nad27sp5102> : hawaii 2> : nad27sp
- <nad27sp5103> : hawaii 3> : nad27sp
- <nad27sp5104> : hawaii 4> : nad27sp
- <nad27sp5105> : hawaii 5> : nad27sp
- <nad27sp1101> : idaho east> : nad27sp
- <nad27sp1102> : idaho central> : nad27sp
- <nad27sp1103> : idaho west> : nad27sp
- <nad27sp1201> : illinois east> : nad27sp
- <nad27sp1202> : illinois west> : nad27sp
- <nad27sp1301> : indiana east> : nad27sp
- <nad27sp1302> : indiana west> : nad27sp
- <nad27sp1401> : iowa north> : nad27sp
- <nad27sp1402> : iowa south> : nad27sp
- <nad27sp1501> : kansas north> : nad27sp
- <nad27sp1502> : kansas south> : nad27sp
- <nad27sp1601> : kentucky north> : nad27sp
- <nad27sp1602> : kentucky south> : nad27sp
- <nad27sp1701> : louisiana north> : nad27sp
- <nad27sp1702> : louisiana south> : nad27sp
- <nad27sp1703> : louisiana offshore> : nad27sp
- <nad27sp1801> : maine east> : nad27sp
- <nad27sp1802> : maine west> : nad27sp
- <nad27sp1900> : maryland \---> : nad27sp
- <nad27sp2001> : massachusetts mainland> : nad27sp
- <nad27sp2002> : massachusetts island> : nad27sp
- <nad27sp2101> : michigan east> : nad27sp
- <nad27sp2102> : michigan central/m> : nad27sp
- <nad27sp2103> : michigan west> : nad27sp
- <nad27sp2111> : michigan north> : nad27sp
- <nad27sp2112> : michigan central/l> : nad27sp
- <nad27sp2113> : michigan south> : nad27sp
- <nad27sp2201> : minnesota north> : nad27sp
- <nad27sp2202> : minnesota central> : nad27sp
- <nad27sp2203> : minnesota south> : nad27sp
- <nad27sp2301> : mississippi east> : nad27sp
- <nad27sp2302> : mississippi west> : nad27sp
- <nad27sp2401> : missouri east> : nad27sp
- <nad27sp2402> : missouri central> : nad27sp
- <nad27sp2403> : missouri west> : nad27sp
- <nad27sp2501> : montana north> : nad27sp
- <nad27sp2502> : montana central> : nad27sp
- <nad27sp2503> : montana south> : nad27sp
- <nad27sp2601> : nebraska north> : nad27sp
- <nad27sp2602> : nebraska south> : nad27sp
- <nad27sp2701> : nevada east> : nad27sp
- <nad27sp2702> : nevada central> : nad27sp
- <nad27sp2703> : nevada west> : nad27sp
- <nad27sp2800> : new hampshire \---> : nad27sp
- <nad27sp2900> : new jersey \---> : nad27sp
- <nad27sp3001> : new mexico east> : nad27sp
- <nad27sp3002> : new mexico central> : nad27sp
- <nad27sp3003> : new mexico west> : nad27sp
- <nad27sp3101> : new york east> : nad27sp
- <nad27sp3102> : new york central> : nad27sp
- <nad27sp3103> : new york west> : nad27sp
- <nad27sp3104> : new york long island> : nad27sp
- <nad27sp3200> : north carolina \---> : nad27sp
- <nad27sp3301> : north dakota north> : nad27sp
- <nad27sp3302> : north dakota south> : nad27sp
- <nad27sp3401> : ohio north> : nad27sp
- <nad27sp3402> : ohio south> : nad27sp
- <nad27sp3501> : oklahoma north> : nad27sp
- <nad27sp3502> : oklahoma south> : nad27sp
- <nad27sp3601> : oregon north> : nad27sp
- <nad27sp3602> : oregon south> : nad27sp
- <nad27sp3701> : pennsylvania north> : nad27sp
- <nad27sp3702> : pennsylvania south> : nad27sp
- <nad27sp3800> : rhode island \---> : nad27sp
- <nad27sp3901> : south carolina north> : nad27sp
- <nad27sp3902> : south carolina south> : nad27sp
- <nad27sp4001> : south dakota north> : nad27sp
- <nad27sp4002> : south dakota south> : nad27sp
- <nad27sp4100> : tennessee \---> : nad27sp
- <nad27sp4201> : texas north> : nad27sp
- <nad27sp4202> : texas north central> : nad27sp
- <nad27sp4203> : texas central> : nad27sp
- <nad27sp4204> : texas south central> : nad27sp
- <nad27sp4205> : texas south> : nad27sp
- <nad27sp4301> : utah north> : nad27sp
- <nad27sp4302> : utah central> : nad27sp
- <nad27sp4303> : utah south> : nad27sp
- <nad27sp4400> : vermont \---> : nad27sp
- <nad27sp4501> : virginia north> : nad27sp
- <nad27sp4502> : virginia south> : nad27sp
- <nad27sp4601> : washington north> : nad27sp
- <nad27sp4602> : washington south> : nad27sp
- <nad27sp4701> : west virginia north> : nad27sp
- <nad27sp4702> : west virginia south> : nad27sp
- <nad27sp4801> : wisconsin north> : nad27sp
- <nad27sp4802> : wisconsin central> : nad27sp
- <nad27sp4803> : wisconsin south> : nad27sp
- <nad27sp4901> : wyoming east> : nad27sp
- <nad27sp4902> : wyoming east central> : nad27sp
- <nad27sp4903> : wyoming west central> : nad27sp
- <nad27sp4904> : wyoming west> : nad27sp
- <nad27sp5001> : alaska zone no. 1> : nad27sp
- <nad27sp5002> : alaska zone no. 2> : nad27sp
- <nad27sp5003> : alaska zone no. 3> : nad27sp
- <nad27sp5004> : alaska zone no. 4> : nad27sp
- <nad27sp5005> : alaska zone no. 5> : nad27sp
- <nad27sp5006> : alaska zone no. 6> : nad27sp
- <nad27sp5007> : alaska zone no. 7> : nad27sp
- <nad27sp5008> : alaska zone no. 8> : nad27sp
- <nad27sp5009> : alaska zone no. 9> : nad27sp
- <nad27sp5201> : puerto rico and virgin islands> : nad27sp
- <nad27sp5202> : virgin islands st. croix> : nad27sp
- <nad27sp5400> : guam island> : nad27sp
-
- \---------------------------------------------------------
- State Plane Coordinate Systems
- North American Datum 1983
- \---------------------------------------------------------
- <nad83sp101> : alabama east> : nad83
- <nad83sp102> : alabama west> : nad83
- <nad83sp5010> : alaska zone no. 10> : nad83
- <nad83sp201> : arizona east> : nad83
- <nad83sp202> : arizona central> : nad83
- <nad83sp203> : arizona west> : nad83
- <nad83sp301> : arkansas north> : nad83
- <nad83sp302> : arkansas south> : nad83
- <nad83sp401> : california i> : nad83
- <nad83sp402> : california ii> : nad83
- <nad83sp403> : california iii> : nad83
- <nad83sp404> : california iv> : nad83
- <nad83sp405> : california v> : nad83
- <nad83sp406> : california vi> : nad83
- <nad83sp501> : colorado north> : nad83
- <nad83sp502> : colorado central> : nad83
- <nad83sp503> : colorado south> : nad83
- <nad83sp600> : connecticut \---> : nad83
- <nad83sp700> : delaware \---> : nad83
- <nad83sp901> : florida east> : nad83
- <nad83sp902> : florida west> : nad83
- <nad83sp903> : florida north> : nad83
- <nad83sp1001> : georgia east> : nad83
- <nad83sp1002> : georgia west> : nad83
- <nad83sp5101> : hawaii 1> : nad83
- <nad83sp5102> : hawaii 2> : nad83
- <nad83sp5103> : hawaii 3> : nad83
- <nad83sp5104> : hawaii 4> : nad83
- <nad83sp5105> : hawaii 5> : nad83
- <nad83sp1101> : idaho east> : nad83
- <nad83sp1102> : idaho central> : nad83
- <nad83sp1103> : idaho west> : nad83
- <nad83sp1201> : illinois east> : nad83
- <nad83sp1202> : illinois west> : nad83
- <nad83sp1301> : indiana east> : nad83
- <nad83sp1302> : indiana west> : nad83
- <nad83sp1401> : iowa north> : nad83
- <nad83sp1402> : iowa south> : nad83
- <nad83sp1501> : kansas north> : nad83
- <nad83sp1502> : kansas south> : nad83
- <nad83sp1601> : kentucky north> : nad83
- <nad83sp1602> : kentucky south> : nad83
- <nad83sp1701> : louisiana north> : nad83
- <nad83sp1702> : louisiana south> : nad83
- <nad83sp1703> : louisiana offshore> : nad83
- <nad83sp1801> : maine east> : nad83
- <nad83sp1802> : maine west> : nad83
- <nad83sp1900> : maryland \---> : nad83
- <nad83sp2001> : massachusetts mainland> : nad83
- <nad83sp2002> : massachusetts island> : nad83
- <nad83sp2111> : michigan north> : nad83
- <nad83sp2112> : michigan central/l> : nad83
- <nad83sp2113> : michigan south> : nad83
- <nad83sp2201> : minnesota north> : nad83
- <nad83sp2202> : minnesota central> : nad83
- <nad83sp2203> : minnesota south> : nad83
- <nad83sp2301> : mississippi east> : nad83
- <nad83sp2302> : mississippi west> : nad83
- <nad83sp2401> : missouri east> : nad83
- <nad83sp2402> : missouri central> : nad83
- <nad83sp2403> : missouri west> : nad83
- <nad83sp2500> : montana> : nad83
- <nad83sp2600> : nebraska> : nad83
- <nad83sp2701> : nevada east> : nad83
- <nad83sp2702> : nevada central> : nad83
- <nad83sp2703> : nevada west> : nad83
- <nad83sp2800> : new hampshire \---> : nad83
- <nad83sp2900> : new jersey \---> : nad83
- <nad83sp3001> : new mexico east> : nad83
- <nad83sp3002> : new mexico central> : nad83
- <nad83sp3003> : new mexico west> : nad83
- <nad83sp3101> : new york east> : nad83
- <nad83sp3102> : new york central> : nad83
- <nad83sp3103> : new york west> : nad83
- <nad83sp3104> : new york long island> : nad83
- <nad83sp3200> : north carolina \---> : nad83
- <nad83sp3301> : north dakota north> : nad83
- <nad83sp3302> : north dakota south> : nad83
- <nad83sp3401> : ohio north> : nad83
- <nad83sp3402> : ohio south> : nad83
- <nad83sp3501> : oklahoma north> : nad83
- <nad83sp3502> : oklahoma south> : nad83
- <nad83sp3601> : oregon north> : nad83
- <nad83sp3602> : oregon south> : nad83
- <nad83sp3701> : pennsylvania north> : nad83
- <nad83sp3702> : pennsylvania south> : nad83
- <nad83sp3800> : rhode island \---> : nad83
- <nad83sp3900> : south carolina> : nad83
- <nad83sp4001> : south dakota north> : nad83
- <nad83sp4002> : south dakota south> : nad83
- <nad83sp4100> : tennessee \---> : nad83
- <nad83sp4201> : texas north> : nad83
- <nad83sp4202> : texas north central> : nad83
- <nad83sp4203> : texas central> : nad83
- <nad83sp4204> : texas south central> : nad83
- <nad83sp4205> : texas south> : nad83
- <nad83sp4301> : utah north> : nad83
- <nad83sp4302> : utah central> : nad83
- <nad83sp4303> : utah south> : nad83
- <nad83sp4400> : vermont \---> : nad83
- <nad83sp4501> : virginia north> : nad83
- <nad83sp4502> : virginia south> : nad83
- <nad83sp4601> : washington north> : nad83
- <nad83sp4602> : washington south> : nad83
- <nad83sp4701> : west virginia north> : nad83
- <nad83sp4702> : west virginia south> : nad83
- <nad83sp4801> : wisconsin north> : nad83
- <nad83sp4802> : wisconsin central> : nad83
- <nad83sp4803> : wisconsin south> : nad83
- <nad83sp4901> : wyoming east> : nad83
- <nad83sp4902> : wyoming east central> : nad83
- <nad83sp4903> : wyoming west central> : nad83
- <nad83sp4904> : wyoming west> : nad83
- <nad83sp5001> : alaska zone no. 1> : nad83
- <nad83sp5002> : alaska zone no. 2> : nad83
- <nad83sp5003> : alaska zone no. 3> : nad83
- <nad83sp5004> : alaska zone no. 4> : nad83
- <nad83sp5005> : alaska zone no. 5> : nad83
- <nad83sp5006> : alaska zone no. 6> : nad83
- <nad83sp5007> : alaska zone no. 7> : nad83
- <nad83sp5008> : alaska zone no. 8> : nad83
- <nad83sp5009> : alaska zone no. 9> : nad83
- <nad83sp5200> : puerto rico and virgin islands> : nad83
-
- \---------------------------------------------------------
- Great Lakes Grids using Clarke 1866 ellipsoid
- \---------------------------------------------------------
- <erie-etal> : Lake Erie, Ontario and St. Lawrence River.
- <huron> : Lake Huron
- <michigan> : Lake Michigan
- <superior> : Lake Superior, Lake of the Woods
-
- \---------------------------------------------------------
- EPSG projection definitions
- \---------------------------------------------------------
- <epsg4001> : Unknown datum based upon the Airy 1830 ellipsoid
- <epsg4002> : Unknown datum based upon the Airy Modified 1849 ellipsoid
- <epsg4003> : Unknown datum based upon the Australian National Spheroid
- <epsg4004> : Unknown datum based upon the Bessel 1841 ellipsoid
- <epsg4005> : Unknown datum based upon the Bessel Modified ellipsoid
- <epsg4006> : Unknown datum based upon the Bessel Namibia ellipsoid
- <epsg4007> : Unknown datum based upon the Clarke 1858 ellipsoid
- <epsg4008> : Unknown datum based upon the Clarke 1866 ellipsoid
- <epsg4009> : Unknown datum based upon the Clarke 1866 Michigan ellipsoid
- <epsg4010> : Unknown datum based upon the Clarke 1880 (Benoit) ellipsoid
- <epsg4011> : Unknown datum based upon the Clarke 1880 (IGN) ellipsoid
- <epsg4012> : Unknown datum based upon the Clarke 1880 (RGS) ellipsoid
- <epsg4013> : Unknown datum based upon the Clarke 1880 (Arc) ellipsoid
- <epsg4014> : Unknown datum based upon the Clarke 1880 (SGA 1922) ellipsoid
- <epsg4015> : Unknown datum based upon the Everest 1830 (1937 Adjustment) ellipsoid
- <epsg4016> : Unknown datum based upon the Everest 1830 (1967 Definition) ellipsoid
- <epsg4018> : Unknown datum based upon the Everest 1830 Modified ellipsoid
- <epsg4019> : Unknown datum based upon the GRS 1980 ellipsoid
- <epsg4020> : Unknown datum based upon the Helmert 1906 ellipsoid
- <epsg4021> : Unknown datum based upon the Indonesian National Spheroid
- <epsg4022> : Unknown datum based upon the International 1924 ellipsoid
- <epsg4024> : Unknown datum based upon the Krassowsky 1940 ellipsoid
- <epsg4025> : Unknown datum based upon the NWL 9D ellipsoid
- <epsg4027> : Unknown datum based upon the Plessis 1817 ellipsoid
- <epsg4028> : Unknown datum based upon the Struve 1860 ellipsoid
- <epsg4029> : Unknown datum based upon the War Office ellipsoid
- <epsg4030> : Unknown datum based upon the WGS 84 ellipsoid
- <epsg4031> : Unknown datum based upon the GEM 10C ellipsoid
- <epsg4032> : Unknown datum based upon the OSU86F ellipsoid
- <epsg4033> : Unknown datum based upon the OSU91A ellipsoid
- <epsg4034> : Unknown datum based upon the Clarke 1880 ellipsoid
- <epsg4035> : Unknown datum based upon the Authalic Sphere
- <epsg4036> : Unknown datum based upon the GRS 1967 ellipsoid
- <epsg4041> : Unknown datum based upon the Average Terrestrial System 1977 ellipsoid
- <epsg4042> : Unknown datum based upon the Everest (1830 Definition) ellipsoid
- <epsg4043> : Unknown datum based upon the WGS 72 ellipsoid
- <epsg4044> : Unknown datum based upon the Everest 1830 (1962 Definition) ellipsoid
- <epsg4045> : Unknown datum based upon the Everest 1830 (1975 Definition) ellipsoid
- <epsg4047> : Unspecified datum based upon the GRS 1980 Authalic Sphere
- <epsg4052> : Unspecified datum based upon the Clarke 1866 Authalic Sphere
- <epsg4053> : Unspecified datum based upon the International 1924 Authalic Sphere
- <epsg4054> : Unspecified datum based upon the Hughes 1980 ellipsoid
- <epsg4120> : Greek
- <epsg4121> : GGRS87
- <epsg4122> : ATS77
- <epsg4123> : KKJ
- <epsg4124> : RT90
- <epsg4125> : Samboja
- <epsg4126> : LKS94 (ETRS89)
- <epsg4127> : Tete
- <epsg4128> : Madzansua
- <epsg4129> : Observatario
- <epsg4130> : Moznet
- <epsg4131> : Indian 1960
- <epsg4132> : FD58
- <epsg4133> : EST92
- <epsg4134> : PDO Survey Datum 1993
- <epsg4135> : Old Hawaiian
- <epsg4136> : St. Lawrence Island
- <epsg4137> : St. Paul Island
- <epsg4138> : St. George Island
- <epsg4139> : Puerto Rico
- <epsg4140> : NAD83(CSRS98)
- <epsg4141> : Israel
- <epsg4142> : Locodjo 1965
- <epsg4143> : Abidjan 1987
- <epsg4144> : Kalianpur 1937
- <epsg4145> : Kalianpur 1962
- <epsg4146> : Kalianpur 1975
- <epsg4147> : Hanoi 1972
- <epsg4148> : Hartebeesthoek94
- <epsg4149> : CH1903
- <epsg4150> : CH1903+
- <epsg4151> : CHTRF95
- <epsg4152> : NAD83(HARN)
- <epsg4153> : Rassadiran
- <epsg4154> : ED50(ED77)
- <epsg4155> : Dabola 1981
- <epsg4156> : S-JTSK
- <epsg4157> : Mount Dillon
- <epsg4158> : Naparima 1955
- <epsg4159> : ELD79
- <epsg4160> : Chos Malal 1914
- <epsg4161> : Pampa del Castillo
- <epsg4162> : Korean 1985
- <epsg4163> : Yemen NGN96
- <epsg4164> : South Yemen
- <epsg4165> : Bissau
- <epsg4166> : Korean 1995
- <epsg4167> : NZGD2000
- <epsg4168> : Accra
- <epsg4169> : American Samoa 1962
- <epsg4170> : SIRGAS
- <epsg4171> : RGF93
- <epsg4172> : POSGAR
- <epsg4173> : IRENET95
- <epsg4174> : Sierra Leone 1924
- <epsg4175> : Sierra Leone 1968
- <epsg4176> : Australian Antarctic
- <epsg4178> : Pulkovo 1942(83)
- <epsg4179> : Pulkovo 1942(58)
- <epsg4180> : EST97
- <epsg4181> : Luxembourg 1930
- <epsg4182> : Azores Occidental 1939
- <epsg4183> : Azores Central 1948
- <epsg4184> : Azores Oriental 1940
- <epsg4185> : Madeira 1936
- <epsg4188> : OSNI 1952
- <epsg4189> : REGVEN
- <epsg4190> : POSGAR 98
- <epsg4191> : Albanian 1987
- <epsg4192> : Douala 1948
- <epsg4193> : Manoca 1962
- <epsg4194> : Qornoq 1927
- <epsg4195> : Scoresbysund 1952
- <epsg4196> : Ammassalik 1958
- <epsg4197> : Garoua
- <epsg4198> : Kousseri
- <epsg4199> : Egypt 1930
- <epsg4200> : Pulkovo 1995
- <epsg4201> : Adindan
- <epsg4202> : AGD66
- <epsg4203> : AGD84
- <epsg4204> : Ain el Abd
- <epsg4205> : Afgooye
- <epsg4206> : Agadez
- <epsg4207> : Lisbon
- <epsg4208> : Aratu
- <epsg4209> : Arc 1950
- <epsg4210> : Arc 1960
- <epsg4211> : Batavia
- <epsg4212> : Barbados 1938
- <epsg4213> : Beduaram
- <epsg4214> : Beijing 1954
- <epsg4215> : Belge 1950
- <epsg4216> : Bermuda 1957
- <epsg4218> : Bogota 1975
- <epsg4219> : Bukit Rimpah
- <epsg4220> : Camacupa
- <epsg4221> : Campo Inchauspe
- <epsg4222> : Cape
- <epsg4223> : Carthage
- <epsg4224> : Chua
- <epsg4225> : Corrego Alegre
- <epsg4226> : Cote d'Ivoire
- <epsg4227> : Deir ez Zor
- <epsg4228> : Douala
- <epsg4229> : Egypt 1907
- <epsg4230> : ED50
- <epsg4231> : ED87
- <epsg4232> : Fahud
- <epsg4233> : Gandajika 1970
- <epsg4234> : Garoua
- <epsg4235> : Guyane Francaise
- <epsg4236> : Hu Tzu Shan
- <epsg4237> : HD72
- <epsg4238> : ID74
- <epsg4239> : Indian 1954
- <epsg4240> : Indian 1975
- <epsg4241> : Jamaica 1875
- <epsg4242> : JAD69
- <epsg4243> : Kalianpur 1880
- <epsg4244> : Kandawala
- <epsg4245> : Kertau 1968
- <epsg4246> : KOC
- <epsg4247> : La Canoa
- <epsg4248> : PSAD56
- <epsg4249> : Lake
- <epsg4250> : Leigon
- <epsg4251> : Liberia 1964
- <epsg4252> : Lome
- <epsg4253> : Luzon 1911
- <epsg4254> : Hito XVIII 1963
- <epsg4255> : Herat North
- <epsg4256> : Mahe 1971
- <epsg4257> : Makassar
- <epsg4258> : ETRS89
- <epsg4259> : Malongo 1987
- <epsg4260> : Manoca
- <epsg4261> : Merchich
- <epsg4262> : Massawa
- <epsg4263> : Minna
- <epsg4264> : Mhast
- <epsg4265> : Monte Mario
- <epsg4266> : M'poraloko
- <epsg4267> : NAD27
- <epsg4268> : NAD27 Michigan
- <epsg4269> : NAD83
- <epsg4270> : Nahrwan 1967
- <epsg4271> : Naparima 1972
- <epsg4272> : NZGD49
- <epsg4273> : NGO 1948
- <epsg4274> : Datum 73
- <epsg4275> : NTF
- <epsg4276> : NSWC 9Z-2
- <epsg4277> : OSGB 1936
- <epsg4278> : OSGB70
- <epsg4279> : OS(SN)80
- <epsg4280> : Padang
- <epsg4281> : Palestine 1923
- <epsg4282> : Pointe Noire
- <epsg4283> : GDA94
- <epsg4284> : Pulkovo 1942
- <epsg4285> : Qatar 1974
- <epsg4286> : Qatar 1948
- <epsg4287> : Qornoq
- <epsg4288> : Loma Quintana
- <epsg4289> : Amersfoort
- <epsg4291> : SAD69
- <epsg4292> : Sapper Hill 1943
- <epsg4293> : Schwarzeck
- <epsg4294> : Segora
- <epsg4295> : Serindung
- <epsg4296> : Sudan
- <epsg4297> : Tananarive
- <epsg4298> : Timbalai 1948
- <epsg4299> : TM65
- <epsg4300> : TM75
- <epsg4301> : Tokyo
- <epsg4302> : Trinidad 1903
- <epsg4303> : TC(1948)
- <epsg4304> : Voirol 1875
- <epsg4306> : Bern 1938
- <epsg4307> : Nord Sahara 1959
- <epsg4308> : RT38
- <epsg4309> : Yacare
- <epsg4310> : Yoff
- <epsg4311> : Zanderij
- <epsg4312> : MGI
- <epsg4313> : Belge 1972
- <epsg4314> : DHDN
- <epsg4315> : Conakry 1905
- <epsg4316> : Dealul Piscului 1933
- <epsg4317> : Dealul Piscului 1970
- <epsg4318> : NGN
- <epsg4319> : KUDAMS
- <epsg4322> : WGS 72
- <epsg4324> : WGS 72BE
- <epsg4326> : WGS 84
- <epsg4600> : Anguilla 1957
- <epsg4601> : Antigua 1943
- <epsg4602> : Dominica 1945
- <epsg4603> : Grenada 1953
- <epsg4604> : Montserrat 1958
- <epsg4605> : St. Kitts 1955
- <epsg4606> : St. Lucia 1955
- <epsg4607> : St. Vincent 1945
- <epsg4608> : NAD27(76)
- <epsg4609> : NAD27(CGQ77)
- <epsg4610> : Xian 1980
- <epsg4611> : Hong Kong 1980
- <epsg4612> : JGD2000
- <epsg4613> : Segara
- <epsg4614> : QND95
- <epsg4615> : Porto Santo
- <epsg4616> : Selvagem Grande
- <epsg4617> : NAD83(CSRS)
- <epsg4618> : SAD69
- <epsg4619> : SWEREF99
- <epsg4620> : Point 58
- <epsg4621> : Fort Marigot
- <epsg4622> : Guadeloupe 1948
- <epsg4623> : CSG67
- <epsg4624> : RGFG95
- <epsg4625> : Martinique 1938
- <epsg4626> : Reunion 1947
- <epsg4627> : RGR92
- <epsg4628> : Tahiti 52
- <epsg4629> : Tahaa 54
- <epsg4630> : IGN72 Nuku Hiva
- <epsg4631> : K0 1949
- <epsg4632> : Combani 1950
- <epsg4633> : IGN56 Lifou
- <epsg4634> : IGN72 Grand Terre
- <epsg4635> : ST87 Ouvea
- <epsg4636> : Petrels 1972
- <epsg4637> : Perroud 1950
- <epsg4638> : Saint Pierre et Miquelon 1950
- <epsg4639> : MOP78
- <epsg4640> : RRAF 1991
- <epsg4641> : IGN53 Mare
- <epsg4642> : ST84 Ile des Pins
- <epsg4643> : ST71 Belep
- <epsg4644> : NEA74 Noumea
- <epsg4645> : RGNC 1991
- <epsg4646> : Grand Comoros
- <epsg4657> : Reykjavik 1900
- <epsg4658> : Hjorsey 1955
- <epsg4659> : ISN93
- <epsg4660> : Helle 1954
- <epsg4661> : LKS92
- <epsg4662> : IGN72 Grande Terre
- <epsg4663> : Porto Santo 1995
- <epsg4664> : Azores Oriental 1995
- <epsg4665> : Azores Central 1995
- <epsg4666> : Lisbon 1890
- <epsg4667> : IKBD-92
- <epsg4668> : ED79
- <epsg4669> : LKS94
- <epsg4670> : IGM95
- <epsg4671> : Voirol 1879
- <epsg4672> : CI1971
- <epsg4673> : CI1979
- <epsg4674> : SIRGAS 2000
- <epsg4675> : Guam 1963
- <epsg4676> : Vientiane 1982
- <epsg4677> : Lao 1993
- <epsg4678> : Lao 1997
- <epsg4679> : Jouik 1961
- <epsg4680> : Nouakchott 1965
- <epsg4681> : Mauritania 1999
- <epsg4682> : Gulshan 303
- <epsg4683> : PRS92
- <epsg4684> : Gan 1970
- <epsg4685> : Gandajika
- <epsg4686> : MAGNA-SIRGAS
- <epsg4687> : RGPF
- <epsg4688> : Fatu Iva 72
- <epsg4689> : IGN63 Hiva Oa
- <epsg4690> : Tahiti 79
- <epsg4691> : Moorea 87
- <epsg4692> : Maupiti 83
- <epsg4693> : Nakhl-e Ghanem
- <epsg4694> : POSGAR 94
- <epsg4695> : Katanga 1955
- <epsg4696> : Kasai 1953
- <epsg4697> : IGC 1962 6th Parallel South
- <epsg4698> : IGN 1962 Kerguelen
- <epsg4699> : Le Pouce 1934
- <epsg4700> : IGN Astro 1960
- <epsg4701> : IGCB 1955
- <epsg4702> : Mauritania 1999
- <epsg4703> : Mhast 1951
- <epsg4704> : Mhast (onshore)
- <epsg4705> : Mhast (offshore)
- <epsg4706> : Egypt Gulf of Suez S-650 TL
- <epsg4707> : Tern Island 1961
- <epsg4708> : Cocos Islands 1965
- <epsg4709> : Iwo Jima 1945
- <epsg4710> : St. Helena 1971
- <epsg4711> : Marcus Island 1952
- <epsg4712> : Ascension Island 1958
- <epsg4713> : Ayabelle Lighthouse
- <epsg4714> : Bellevue
- <epsg4715> : Camp Area Astro
- <epsg4716> : Phoenix Islands 1966
- <epsg4717> : Cape Canaveral
- <epsg4718> : Solomon 1968
- <epsg4719> : Easter Island 1967
- <epsg4720> : Fiji 1986
- <epsg4721> : Fiji 1956
- <epsg4722> : South Georgia 1968
- <epsg4723> : Grand Cayman 1959
- <epsg4724> : Diego Garcia 1969
- <epsg4725> : Johnston Island 1961
- <epsg4726> : Little Cayman 1961
- <epsg4727> : Midway 1961
- <epsg4728> : Pico de la Nieves
- <epsg4729> : Pitcairn 1967
- <epsg4730> : Santo 1965
- <epsg4731> : Viti Levu 1916
- <epsg4732> : Marshall Islands 1960
- <epsg4733> : Wake Island 1952
- <epsg4734> : Tristan 1968
- <epsg4735> : Kusaie 1951
- <epsg4736> : Deception Island
- <epsg4737> : Korea 2000
- <epsg4738> : Hong Kong 1963
- <epsg4739> : Hong Kong 1963(67)
- <epsg4740> : PZ-90
- <epsg4741> : FD54
- <epsg4742> : GDM2000
- <epsg4743> : Karbala 1979 (Polservice)
- <epsg4744> : Nahrwan 1934
- <epsg4745> : RD/83
- <epsg4746> : PD/83
- <epsg4747> : GR96
- <epsg4748> : Vanua Levu 1915
- <epsg4749> : RGNC91-93
- <epsg4750> : ST87 Ouvea
- <epsg4751> : Kertau (RSO)
- <epsg4752> : Viti Levu 1912
- <epsg4753> : fk89
- <epsg4754> : LGD2006
- <epsg4755> : DGN95
- <epsg4756> : VN-2000
- <epsg4757> : SVY21
- <epsg4758> : JAD2001
- <epsg4759> : NAD83(NSRS2007)
- <epsg4760> : WGS 66
- <epsg4801> : Bern 1898 (Bern)
- <epsg4802> : Bogota 1975 (Bogota)
- <epsg4803> : Lisbon (Lisbon)
- <epsg4804> : Makassar (Jakarta)
- <epsg4805> : MGI (Ferro)
- <epsg4806> : Monte Mario (Rome)
- <epsg4807> : NTF (Paris)
- <epsg4808> : Padang (Jakarta)
- <epsg4809> : Belge 1950 (Brussels)
- <epsg4810> : Tananarive (Paris)
- <epsg4811> : Voirol 1875 (Paris)
- <epsg4813> : Batavia (Jakarta)
- <epsg4814> : RT38 (Stockholm)
- <epsg4815> : Greek (Athens)
- <epsg4816> : Carthage (Paris)
- <epsg4817> : NGO 1948 (Oslo)
- <epsg4818> : S-JTSK (Ferro)
- <epsg4819> : Nord Sahara 1959 (Paris)
- <epsg4820> : Segara (Jakarta)
- <epsg4821> : Voirol 1879 (Paris)
- <epsg4901> : ATF (Paris)
- <epsg4902> : NDG (Paris)
- <epsg4903> : Madrid 1870 (Madrid)
- <epsg4904> : Lisbon 1890 (Lisbon)
- <epsg2000> : Anguilla 1957 / British West Indies Grid
- <epsg2001> : Antigua 1943 / British West Indies Grid
- <epsg2002> : Dominica 1945 / British West Indies Grid
- <epsg2003> : Grenada 1953 / British West Indies Grid
- <epsg2004> : Montserrat 1958 / British West Indies Grid
- <epsg2005> : St. Kitts 1955 / British West Indies Grid
- <epsg2006> : St. Lucia 1955 / British West Indies Grid
- <epsg2007> : St. Vincent 45 / British West Indies Grid
- <epsg2008> : NAD27(CGQ77) / SCoPQ zone 2
- <epsg2009> : NAD27(CGQ77) / SCoPQ zone 3
- <epsg2010> : NAD27(CGQ77) / SCoPQ zone 4
- <epsg2011> : NAD27(CGQ77) / SCoPQ zone 5
- <epsg2012> : NAD27(CGQ77) / SCoPQ zone 6
- <epsg2013> : NAD27(CGQ77) / SCoPQ zone 7
- <epsg2014> : NAD27(CGQ77) / SCoPQ zone 8
- <epsg2015> : NAD27(CGQ77) / SCoPQ zone 9
- <epsg2016> : NAD27(CGQ77) / SCoPQ zone 10
- <epsg2017> : NAD27(76) / MTM zone 8
- <epsg2018> : NAD27(76) / MTM zone 9
- <epsg2019> : NAD27(76) / MTM zone 10
- <epsg2020> : NAD27(76) / MTM zone 11
- <epsg2021> : NAD27(76) / MTM zone 12
- <epsg2022> : NAD27(76) / MTM zone 13
- <epsg2023> : NAD27(76) / MTM zone 14
- <epsg2024> : NAD27(76) / MTM zone 15
- <epsg2025> : NAD27(76) / MTM zone 16
- <epsg2026> : NAD27(76) / MTM zone 17
- <epsg2027> : NAD27(76) / UTM zone 15N
- <epsg2028> : NAD27(76) / UTM zone 16N
- <epsg2029> : NAD27(76) / UTM zone 17N
- <epsg2030> : NAD27(76) / UTM zone 18N
- <epsg2031> : NAD27(CGQ77) / UTM zone 17N
- <epsg2032> : NAD27(CGQ77) / UTM zone 18N
- <epsg2033> : NAD27(CGQ77) / UTM zone 19N
- <epsg2034> : NAD27(CGQ77) / UTM zone 20N
- <epsg2035> : NAD27(CGQ77) / UTM zone 21N
- <epsg2036> : NAD83(CSRS98) / New Brunswick Stereo (deprecated)
- <epsg2037> : NAD83(CSRS98) / UTM zone 19N (deprecated)
- <epsg2038> : NAD83(CSRS98) / UTM zone 20N (deprecated)
- <epsg2039> : Israel / Israeli TM Grid
- <epsg2040> : Locodjo 1965 / UTM zone 30N
- <epsg2041> : Abidjan 1987 / UTM zone 30N
- <epsg2042> : Locodjo 1965 / UTM zone 29N
- <epsg2043> : Abidjan 1987 / UTM zone 29N
- <epsg2044> : Hanoi 1972 / Gauss-Kruger zone 18
- <epsg2045> : Hanoi 1972 / Gauss-Kruger zone 19
- <epsg2056> : CH1903+ / LV95
- <epsg2057> : Rassadiran / Nakhl e Taqi
- <epsg2058> : ED50(ED77) / UTM zone 38N
- <epsg2059> : ED50(ED77) / UTM zone 39N
- <epsg2060> : ED50(ED77) / UTM zone 40N
- <epsg2061> : ED50(ED77) / UTM zone 41N
- <epsg2062> : Madrid 1870 (Madrid) / Spain
- <epsg2063> : Dabola 1981 / UTM zone 28N (deprecated)
- <epsg2064> : Dabola 1981 / UTM zone 29N (deprecated)
- <epsg2065> : S-JTSK (Ferro) / Krovak
- <epsg2066> : Mount Dillon / Tobago Grid
- <epsg2067> : Naparima 1955 / UTM zone 20N
- <epsg2068> : ELD79 / Libya zone 5
- <epsg2069> : ELD79 / Libya zone 6
- <epsg2070> : ELD79 / Libya zone 7
- <epsg2071> : ELD79 / Libya zone 8
- <epsg2072> : ELD79 / Libya zone 9
- <epsg2073> : ELD79 / Libya zone 10
- <epsg2074> : ELD79 / Libya zone 11
- <epsg2075> : ELD79 / Libya zone 12
- <epsg2076> : ELD79 / Libya zone 13
- <epsg2077> : ELD79 / UTM zone 32N
- <epsg2078> : ELD79 / UTM zone 33N
- <epsg2079> : ELD79 / UTM zone 34N
- <epsg2080> : ELD79 / UTM zone 35N
- <epsg2081> : Chos Malal 1914 / Argentina zone 2
- <epsg2082> : Pampa del Castillo / Argentina zone 2
- <epsg2083> : Hito XVIII 1963 / Argentina zone 2
- <epsg2084> : Hito XVIII 1963 / UTM zone 19S
- <epsg2085> : NAD27 / Cuba Norte
- <epsg2086> : NAD27 / Cuba Sur
- <epsg2087> : ELD79 / TM 12 NE
- <epsg2088> : Carthage / TM 11 NE
- <epsg2089> : Yemen NGN96 / UTM zone 38N
- <epsg2090> : Yemen NGN96 / UTM zone 39N
- <epsg2091> : South Yemen / Gauss Kruger zone 8 (deprecated)
- <epsg2092> : South Yemen / Gauss Kruger zone 9 (deprecated)
- <epsg2093> : Hanoi 1972 / GK 106 NE
- <epsg2094> : WGS 72BE / TM 106 NE
- <epsg2095> : Bissau / UTM zone 28N
- <epsg2096> : Korean 1985 / Korea East Belt
- <epsg2097> : Korean 1985 / Korea Central Belt
- <epsg2098> : Korean 1985 / Korea West Belt
- <epsg2099> : Qatar 1948 / Qatar Grid
- <epsg2100> : GGRS87 / Greek Grid
- <epsg2101> : Lake / Maracaibo Grid M1
- <epsg2102> : Lake / Maracaibo Grid
- <epsg2103> : Lake / Maracaibo Grid M3
- <epsg2104> : Lake / Maracaibo La Rosa Grid
- <epsg2105> : NZGD2000 / Mount Eden Circuit 2000
- <epsg2106> : NZGD2000 / Bay of Plenty Circuit 2000
- <epsg2107> : NZGD2000 / Poverty Bay Circuit 2000
- <epsg2108> : NZGD2000 / Hawkes Bay Circuit 2000
- <epsg2109> : NZGD2000 / Taranaki Circuit 2000
- <epsg2110> : NZGD2000 / Tuhirangi Circuit 2000
- <epsg2111> : NZGD2000 / Wanganui Circuit 2000
- <epsg2112> : NZGD2000 / Wairarapa Circuit 2000
- <epsg2113> : NZGD2000 / Wellington Circuit 2000
- <epsg2114> : NZGD2000 / Collingwood Circuit 2000
- <epsg2115> : NZGD2000 / Nelson Circuit 2000
- <epsg2116> : NZGD2000 / Karamea Circuit 2000
- <epsg2117> : NZGD2000 / Buller Circuit 2000
- <epsg2118> : NZGD2000 / Grey Circuit 2000
- <epsg2119> : NZGD2000 / Amuri Circuit 2000
- <epsg2120> : NZGD2000 / Marlborough Circuit 2000
- <epsg2121> : NZGD2000 / Hokitika Circuit 2000
- <epsg2122> : NZGD2000 / Okarito Circuit 2000
- <epsg2123> : NZGD2000 / Jacksons Bay Circuit 2000
- <epsg2124> : NZGD2000 / Mount Pleasant Circuit 2000
- <epsg2125> : NZGD2000 / Gawler Circuit 2000
- <epsg2126> : NZGD2000 / Timaru Circuit 2000
- <epsg2127> : NZGD2000 / Lindis Peak Circuit 2000
- <epsg2128> : NZGD2000 / Mount Nicholas Circuit 2000
- <epsg2129> : NZGD2000 / Mount York Circuit 2000
- <epsg2130> : NZGD2000 / Observation Point Circuit 2000
- <epsg2131> : NZGD2000 / North Taieri Circuit 2000
- <epsg2132> : NZGD2000 / Bluff Circuit 2000
- <epsg2133> : NZGD2000 / UTM zone 58S
- <epsg2134> : NZGD2000 / UTM zone 59S
- <epsg2135> : NZGD2000 / UTM zone 60S
- <epsg2136> : Accra / Ghana National Grid
- <epsg2137> : Accra / TM 1 NW
- <epsg2138> : NAD27(CGQ77) / Quebec Lambert
- <epsg2139> : NAD83(CSRS98) / SCoPQ zone 2 (deprecated)
- <epsg2140> : NAD83(CSRS98) / MTM zone 3 (deprecated)
- <epsg2141> : NAD83(CSRS98) / MTM zone 4 (deprecated)
- <epsg2142> : NAD83(CSRS98) / MTM zone 5 (deprecated)
- <epsg2143> : NAD83(CSRS98) / MTM zone 6 (deprecated)
- <epsg2144> : NAD83(CSRS98) / MTM zone 7 (deprecated)
- <epsg2145> : NAD83(CSRS98) / MTM zone 8 (deprecated)
- <epsg2146> : NAD83(CSRS98) / MTM zone 9 (deprecated)
- <epsg2147> : NAD83(CSRS98) / MTM zone 10 (deprecated)
- <epsg2148> : NAD83(CSRS98) / UTM zone 21N (deprecated)
- <epsg2149> : NAD83(CSRS98) / UTM zone 18N (deprecated)
- <epsg2150> : NAD83(CSRS98) / UTM zone 17N (deprecated)
- <epsg2151> : NAD83(CSRS98) / UTM zone 13N (deprecated)
- <epsg2152> : NAD83(CSRS98) / UTM zone 12N (deprecated)
- <epsg2153> : NAD83(CSRS98) / UTM zone 11N (deprecated)
- <epsg2154> : RGF93 / Lambert-93
- <epsg2155> : American Samoa 1962 / American Samoa Lambert (deprecated)
- <epsg2156> : NAD83(HARN) / UTM zone 59S (deprecated)
- <epsg2157> : IRENET95 / Irish Transverse Mercator
- <epsg2158> : IRENET95 / UTM zone 29N
- <epsg2159> : Sierra Leone 1924 / New Colony Grid
- <epsg2160> : Sierra Leone 1924 / New War Office Grid
- <epsg2161> : Sierra Leone 1968 / UTM zone 28N
- <epsg2162> : Sierra Leone 1968 / UTM zone 29N
- <epsg2163> : US National Atlas Equal Area
- <epsg2164> : Locodjo 1965 / TM 5 NW
- <epsg2165> : Abidjan 1987 / TM 5 NW
- <epsg2166> : Pulkovo 1942(83) / Gauss Kruger zone 3 (deprecated)
- <epsg2167> : Pulkovo 1942(83) / Gauss Kruger zone 4 (deprecated)
- <epsg2168> : Pulkovo 1942(83) / Gauss Kruger zone 5 (deprecated)
- <epsg2169> : Luxembourg 1930 / Gauss
- <epsg2170> : MGI / Slovenia Grid
- <epsg2171> : Pulkovo 1942(58) / Poland zone I (deprecated)
- <epsg2172> : Pulkovo 1942(58) / Poland zone II
- <epsg2173> : Pulkovo 1942(58) / Poland zone III
- <epsg2174> : Pulkovo 1942(58) / Poland zone IV
- <epsg2175> : Pulkovo 1942(58) / Poland zone V
- <epsg2176> : ETRS89 / Poland CS2000 zone 5
- <epsg2177> : ETRS89 / Poland CS2000 zone 6
- <epsg2178> : ETRS89 / Poland CS2000 zone 7
- <epsg2179> : ETRS89 / Poland CS2000 zone 8
- <epsg2180> : ETRS89 / Poland CS92
- <epsg2188> : Azores Occidental 1939 / UTM zone 25N
- <epsg2189> : Azores Central 1948 / UTM zone 26N
- <epsg2190> : Azores Oriental 1940 / UTM zone 26N
- <epsg2191> : Madeira 1936 / UTM zone 28N (deprecated)
- <epsg2192> : ED50 / France EuroLambert
- <epsg2193> : NZGD2000 / New Zealand Transverse Mercator
- <epsg2194> : American Samoa 1962 / American Samoa Lambert (deprecated)
- <epsg2195> : NAD83(HARN) / UTM zone 2S
- <epsg2196> : ETRS89 / Kp2000 Jutland
- <epsg2197> : ETRS89 / Kp2000 Zealand
- <epsg2198> : ETRS89 / Kp2000 Bornholm
- <epsg2199> : Albanian 1987 / Gauss Kruger zone 4 (deprecated)
- <epsg2200> : ATS77 / New Brunswick Stereographic (ATS77)
- <epsg2201> : REGVEN / UTM zone 18N
- <epsg2202> : REGVEN / UTM zone 19N
- <epsg2203> : REGVEN / UTM zone 20N
- <epsg2204> : NAD27 / Tennessee
- <epsg2205> : NAD83 / Kentucky North
- <epsg2206> : ED50 / 3-degree Gauss-Kruger zone 9
- <epsg2207> : ED50 / 3-degree Gauss-Kruger zone 10
- <epsg2208> : ED50 / 3-degree Gauss-Kruger zone 11
- <epsg2209> : ED50 / 3-degree Gauss-Kruger zone 12
- <epsg2210> : ED50 / 3-degree Gauss-Kruger zone 13
- <epsg2211> : ED50 / 3-degree Gauss-Kruger zone 14
- <epsg2212> : ED50 / 3-degree Gauss-Kruger zone 15
- <epsg2213> : ETRS89 / TM 30 NE
- <epsg2214> : Douala 1948 / AOF west (deprecated)
- <epsg2215> : Manoca 1962 / UTM zone 32N
- <epsg2216> : Qornoq 1927 / UTM zone 22N
- <epsg2217> : Qornoq 1927 / UTM zone 23N
- <epsg2219> : ATS77 / UTM zone 19N
- <epsg2220> : ATS77 / UTM zone 20N
- <epsg2222> : NAD83 / Arizona East (ft)
- <epsg2223> : NAD83 / Arizona Central (ft)
- <epsg2224> : NAD83 / Arizona West (ft)
- <epsg2225> : NAD83 / California zone 1 (ftUS)
- <epsg2226> : NAD83 / California zone 2 (ftUS)
- <epsg2227> : NAD83 / California zone 3 (ftUS)
- <epsg2228> : NAD83 / California zone 4 (ftUS)
- <epsg2229> : NAD83 / California zone 5 (ftUS)
- <epsg2230> : NAD83 / California zone 6 (ftUS)
- <epsg2231> : NAD83 / Colorado North (ftUS)
- <epsg2232> : NAD83 / Colorado Central (ftUS)
- <epsg2233> : NAD83 / Colorado South (ftUS)
- <epsg2234> : NAD83 / Connecticut (ftUS)
- <epsg2235> : NAD83 / Delaware (ftUS)
- <epsg2236> : NAD83 / Florida East (ftUS)
- <epsg2237> : NAD83 / Florida West (ftUS)
- <epsg2238> : NAD83 / Florida North (ftUS)
- <epsg2239> : NAD83 / Georgia East (ftUS)
- <epsg2240> : NAD83 / Georgia West (ftUS)
- <epsg2241> : NAD83 / Idaho East (ftUS)
- <epsg2242> : NAD83 / Idaho Central (ftUS)
- <epsg2243> : NAD83 / Idaho West (ftUS)
- <epsg2244> : NAD83 / Indiana East (ftUS) (deprecated)
- <epsg2245> : NAD83 / Indiana West (ftUS) (deprecated)
- <epsg2246> : NAD83 / Kentucky North (ftUS)
- <epsg2247> : NAD83 / Kentucky South (ftUS)
- <epsg2248> : NAD83 / Maryland (ftUS)
- <epsg2249> : NAD83 / Massachusetts Mainland (ftUS)
- <epsg2250> : NAD83 / Massachusetts Island (ftUS)
- <epsg2251> : NAD83 / Michigan North (ft)
- <epsg2252> : NAD83 / Michigan Central (ft)
- <epsg2253> : NAD83 / Michigan South (ft)
- <epsg2254> : NAD83 / Mississippi East (ftUS)
- <epsg2255> : NAD83 / Mississippi West (ftUS)
- <epsg2256> : NAD83 / Montana (ft)
- <epsg2257> : NAD83 / New Mexico East (ftUS)
- <epsg2258> : NAD83 / New Mexico Central (ftUS)
- <epsg2259> : NAD83 / New Mexico West (ftUS)
- <epsg2260> : NAD83 / New York East (ftUS)
- <epsg2261> : NAD83 / New York Central (ftUS)
- <epsg2262> : NAD83 / New York West (ftUS)
- <epsg2263> : NAD83 / New York Long Island (ftUS)
- <epsg2264> : NAD83 / North Carolina (ftUS)
- <epsg2265> : NAD83 / North Dakota North (ft)
- <epsg2266> : NAD83 / North Dakota South (ft)
- <epsg2267> : NAD83 / Oklahoma North (ftUS)
- <epsg2268> : NAD83 / Oklahoma South (ftUS)
- <epsg2269> : NAD83 / Oregon North (ft)
- <epsg2270> : NAD83 / Oregon South (ft)
- <epsg2271> : NAD83 / Pennsylvania North (ftUS)
- <epsg2272> : NAD83 / Pennsylvania South (ftUS)
- <epsg2273> : NAD83 / South Carolina (ft)
- <epsg2274> : NAD83 / Tennessee (ftUS)
- <epsg2275> : NAD83 / Texas North (ftUS)
- <epsg2276> : NAD83 / Texas North Central (ftUS)
- <epsg2277> : NAD83 / Texas Central (ftUS)
- <epsg2278> : NAD83 / Texas South Central (ftUS)
- <epsg2279> : NAD83 / Texas South (ftUS)
- <epsg2280> : NAD83 / Utah North (ft)
- <epsg2281> : NAD83 / Utah Central (ft)
- <epsg2282> : NAD83 / Utah South (ft)
- <epsg2283> : NAD83 / Virginia North (ftUS)
- <epsg2284> : NAD83 / Virginia South (ftUS)
- <epsg2285> : NAD83 / Washington North (ftUS)
- <epsg2286> : NAD83 / Washington South (ftUS)
- <epsg2287> : NAD83 / Wisconsin North (ftUS)
- <epsg2288> : NAD83 / Wisconsin Central (ftUS)
- <epsg2289> : NAD83 / Wisconsin South (ftUS)
- <epsg2290> : ATS77 / Prince Edward Isl. Stereographic (ATS77)
- <epsg2291> : NAD83(CSRS98) / Prince Edward Isl. Stereographic (NAD83) (deprecated)
- <epsg2292> : NAD83(CSRS98) / Prince Edward Isl. Stereographic (NAD83) (deprecated)
- <epsg2294> : ATS77 / MTM Nova Scotia zone 4
- <epsg2295> : ATS77 / MTM Nova Scotia zone 5
- <epsg2308> : Batavia / TM 109 SE
- <epsg2309> : WGS 84 / TM 116 SE
- <epsg2310> : WGS 84 / TM 132 SE
- <epsg2311> : WGS 84 / TM 6 NE
- <epsg2312> : Garoua / UTM zone 33N
- <epsg2313> : Kousseri / UTM zone 33N
- <epsg2314> : Trinidad 1903 / Trinidad Grid (ftCla)
- <epsg2315> : Campo Inchauspe / UTM zone 19S
- <epsg2316> : Campo Inchauspe / UTM zone 20S
- <epsg2317> : PSAD56 / ICN Regional
- <epsg2318> : Ain el Abd / Aramco Lambert
- <epsg2319> : ED50 / TM27
- <epsg2320> : ED50 / TM30
- <epsg2321> : ED50 / TM33
- <epsg2322> : ED50 / TM36
- <epsg2323> : ED50 / TM39
- <epsg2324> : ED50 / TM42
- <epsg2325> : ED50 / TM45
- <epsg2326> : Hong Kong 1980 Grid System
- <epsg2327> : Xian 1980 / Gauss-Kruger zone 13
- <epsg2328> : Xian 1980 / Gauss-Kruger zone 14
- <epsg2329> : Xian 1980 / Gauss-Kruger zone 15
- <epsg2330> : Xian 1980 / Gauss-Kruger zone 16
- <epsg2331> : Xian 1980 / Gauss-Kruger zone 17
- <epsg2332> : Xian 1980 / Gauss-Kruger zone 18
- <epsg2333> : Xian 1980 / Gauss-Kruger zone 19
- <epsg2334> : Xian 1980 / Gauss-Kruger zone 20
- <epsg2335> : Xian 1980 / Gauss-Kruger zone 21
- <epsg2336> : Xian 1980 / Gauss-Kruger zone 22
- <epsg2337> : Xian 1980 / Gauss-Kruger zone 23
- <epsg2338> : Xian 1980 / Gauss-Kruger CM 75E
- <epsg2339> : Xian 1980 / Gauss-Kruger CM 81E
- <epsg2340> : Xian 1980 / Gauss-Kruger CM 87E
- <epsg2341> : Xian 1980 / Gauss-Kruger CM 93E
- <epsg2342> : Xian 1980 / Gauss-Kruger CM 99E
- <epsg2343> : Xian 1980 / Gauss-Kruger CM 105E
- <epsg2344> : Xian 1980 / Gauss-Kruger CM 111E
- <epsg2345> : Xian 1980 / Gauss-Kruger CM 117E
- <epsg2346> : Xian 1980 / Gauss-Kruger CM 123E
- <epsg2347> : Xian 1980 / Gauss-Kruger CM 129E
- <epsg2348> : Xian 1980 / Gauss-Kruger CM 135E
- <epsg2349> : Xian 1980 / 3-degree Gauss-Kruger zone 25
- <epsg2350> : Xian 1980 / 3-degree Gauss-Kruger zone 26
- <epsg2351> : Xian 1980 / 3-degree Gauss-Kruger zone 27
- <epsg2352> : Xian 1980 / 3-degree Gauss-Kruger zone 28
- <epsg2353> : Xian 1980 / 3-degree Gauss-Kruger zone 29
- <epsg2354> : Xian 1980 / 3-degree Gauss-Kruger zone 30
- <epsg2355> : Xian 1980 / 3-degree Gauss-Kruger zone 31
- <epsg2356> : Xian 1980 / 3-degree Gauss-Kruger zone 32
- <epsg2357> : Xian 1980 / 3-degree Gauss-Kruger zone 33
- <epsg2358> : Xian 1980 / 3-degree Gauss-Kruger zone 34
- <epsg2359> : Xian 1980 / 3-degree Gauss-Kruger zone 35
- <epsg2360> : Xian 1980 / 3-degree Gauss-Kruger zone 36
- <epsg2361> : Xian 1980 / 3-degree Gauss-Kruger zone 37
- <epsg2362> : Xian 1980 / 3-degree Gauss-Kruger zone 38
- <epsg2363> : Xian 1980 / 3-degree Gauss-Kruger zone 39
- <epsg2364> : Xian 1980 / 3-degree Gauss-Kruger zone 40
- <epsg2365> : Xian 1980 / 3-degree Gauss-Kruger zone 41
- <epsg2366> : Xian 1980 / 3-degree Gauss-Kruger zone 42
- <epsg2367> : Xian 1980 / 3-degree Gauss-Kruger zone 43
- <epsg2368> : Xian 1980 / 3-degree Gauss-Kruger zone 44
- <epsg2369> : Xian 1980 / 3-degree Gauss-Kruger zone 45
- <epsg2370> : Xian 1980 / 3-degree Gauss-Kruger CM 75E
- <epsg2371> : Xian 1980 / 3-degree Gauss-Kruger CM 78E
- <epsg2372> : Xian 1980 / 3-degree Gauss-Kruger CM 81E
- <epsg2373> : Xian 1980 / 3-degree Gauss-Kruger CM 84E
- <epsg2374> : Xian 1980 / 3-degree Gauss-Kruger CM 87E
- <epsg2375> : Xian 1980 / 3-degree Gauss-Kruger CM 90E
- <epsg2376> : Xian 1980 / 3-degree Gauss-Kruger CM 93E
- <epsg2377> : Xian 1980 / 3-degree Gauss-Kruger CM 96E
- <epsg2378> : Xian 1980 / 3-degree Gauss-Kruger CM 99E
- <epsg2379> : Xian 1980 / 3-degree Gauss-Kruger CM 102E
- <epsg2380> : Xian 1980 / 3-degree Gauss-Kruger CM 105E
- <epsg2381> : Xian 1980 / 3-degree Gauss-Kruger CM 108E
- <epsg2382> : Xian 1980 / 3-degree Gauss-Kruger CM 111E
- <epsg2383> : Xian 1980 / 3-degree Gauss-Kruger CM 114E
- <epsg2384> : Xian 1980 / 3-degree Gauss-Kruger CM 117E
- <epsg2385> : Xian 1980 / 3-degree Gauss-Kruger CM 120E
- <epsg2386> : Xian 1980 / 3-degree Gauss-Kruger CM 123E
- <epsg2387> : Xian 1980 / 3-degree Gauss-Kruger CM 126E
- <epsg2388> : Xian 1980 / 3-degree Gauss-Kruger CM 129E
- <epsg2389> : Xian 1980 / 3-degree Gauss-Kruger CM 132E
- <epsg2390> : Xian 1980 / 3-degree Gauss-Kruger CM 135E
- <epsg2391> : KKJ / Finland zone 1
- <epsg2392> : KKJ / Finland zone 2
- <epsg2393> : KKJ / Finland Uniform Coordinate System
- <epsg2394> : KKJ / Finland zone 4
- <epsg2395> : South Yemen / Gauss-Kruger zone 8
- <epsg2396> : South Yemen / Gauss-Kruger zone 9
- <epsg2397> : Pulkovo 1942(83) / Gauss-Kruger zone 3
- <epsg2398> : Pulkovo 1942(83) / Gauss-Kruger zone 4
- <epsg2399> : Pulkovo 1942(83) / Gauss-Kruger zone 5
- <epsg2400> : RT90 2.5 gon W (deprecated)
- <epsg2401> : Beijing 1954 / 3-degree Gauss-Kruger zone 25
- <epsg2402> : Beijing 1954 / 3-degree Gauss-Kruger zone 26
- <epsg2403> : Beijing 1954 / 3-degree Gauss-Kruger zone 27
- <epsg2404> : Beijing 1954 / 3-degree Gauss-Kruger zone 28
- <epsg2405> : Beijing 1954 / 3-degree Gauss-Kruger zone 29
- <epsg2406> : Beijing 1954 / 3-degree Gauss-Kruger zone 30
- <epsg2407> : Beijing 1954 / 3-degree Gauss-Kruger zone 31
- <epsg2408> : Beijing 1954 / 3-degree Gauss-Kruger zone 32
- <epsg2409> : Beijing 1954 / 3-degree Gauss-Kruger zone 33
- <epsg2410> : Beijing 1954 / 3-degree Gauss-Kruger zone 34
- <epsg2411> : Beijing 1954 / 3-degree Gauss-Kruger zone 35
- <epsg2412> : Beijing 1954 / 3-degree Gauss-Kruger zone 36
- <epsg2413> : Beijing 1954 / 3-degree Gauss-Kruger zone 37
- <epsg2414> : Beijing 1954 / 3-degree Gauss-Kruger zone 38
- <epsg2415> : Beijing 1954 / 3-degree Gauss-Kruger zone 39
- <epsg2416> : Beijing 1954 / 3-degree Gauss-Kruger zone 40
- <epsg2417> : Beijing 1954 / 3-degree Gauss-Kruger zone 41
- <epsg2418> : Beijing 1954 / 3-degree Gauss-Kruger zone 42
- <epsg2419> : Beijing 1954 / 3-degree Gauss-Kruger zone 43
- <epsg2420> : Beijing 1954 / 3-degree Gauss-Kruger zone 44
- <epsg2421> : Beijing 1954 / 3-degree Gauss-Kruger zone 45
- <epsg2422> : Beijing 1954 / 3-degree Gauss-Kruger CM 75E
- <epsg2423> : Beijing 1954 / 3-degree Gauss-Kruger CM 78E
- <epsg2424> : Beijing 1954 / 3-degree Gauss-Kruger CM 81E
- <epsg2425> : Beijing 1954 / 3-degree Gauss-Kruger CM 84E
- <epsg2426> : Beijing 1954 / 3-degree Gauss-Kruger CM 87E
- <epsg2427> : Beijing 1954 / 3-degree Gauss-Kruger CM 90E
- <epsg2428> : Beijing 1954 / 3-degree Gauss-Kruger CM 93E
- <epsg2429> : Beijing 1954 / 3-degree Gauss-Kruger CM 96E
- <epsg2430> : Beijing 1954 / 3-degree Gauss-Kruger CM 99E
- <epsg2431> : Beijing 1954 / 3-degree Gauss-Kruger CM 102E
- <epsg2432> : Beijing 1954 / 3-degree Gauss-Kruger CM 105E
- <epsg2433> : Beijing 1954 / 3-degree Gauss-Kruger CM 108E
- <epsg2434> : Beijing 1954 / 3-degree Gauss-Kruger CM 111E
- <epsg2435> : Beijing 1954 / 3-degree Gauss-Kruger CM 114E
- <epsg2436> : Beijing 1954 / 3-degree Gauss-Kruger CM 117E
- <epsg2437> : Beijing 1954 / 3-degree Gauss-Kruger CM 120E
- <epsg2438> : Beijing 1954 / 3-degree Gauss-Kruger CM 123E
- <epsg2439> : Beijing 1954 / 3-degree Gauss-Kruger CM 126E
- <epsg2440> : Beijing 1954 / 3-degree Gauss-Kruger CM 129E
- <epsg2441> : Beijing 1954 / 3-degree Gauss-Kruger CM 132E
- <epsg2442> : Beijing 1954 / 3-degree Gauss-Kruger CM 135E
- <epsg2443> : JGD2000 / Japan Plane Rectangular CS I
- <epsg2444> : JGD2000 / Japan Plane Rectangular CS II
- <epsg2445> : JGD2000 / Japan Plane Rectangular CS III
- <epsg2446> : JGD2000 / Japan Plane Rectangular CS IV
- <epsg2447> : JGD2000 / Japan Plane Rectangular CS V
- <epsg2448> : JGD2000 / Japan Plane Rectangular CS VI
- <epsg2449> : JGD2000 / Japan Plane Rectangular CS VII
- <epsg2450> : JGD2000 / Japan Plane Rectangular CS VIII
- <epsg2451> : JGD2000 / Japan Plane Rectangular CS IX
- <epsg2452> : JGD2000 / Japan Plane Rectangular CS X
- <epsg2453> : JGD2000 / Japan Plane Rectangular CS XI
- <epsg2454> : JGD2000 / Japan Plane Rectangular CS XII
- <epsg2455> : JGD2000 / Japan Plane Rectangular CS XIII
- <epsg2456> : JGD2000 / Japan Plane Rectangular CS XIV
- <epsg2457> : JGD2000 / Japan Plane Rectangular CS XV
- <epsg2458> : JGD2000 / Japan Plane Rectangular CS XVI
- <epsg2459> : JGD2000 / Japan Plane Rectangular CS XVII
- <epsg2460> : JGD2000 / Japan Plane Rectangular CS XVIII
- <epsg2461> : JGD2000 / Japan Plane Rectangular CS XIX
- <epsg2462> : Albanian 1987 / Gauss-Kruger zone 4
- <epsg2463> : Pulkovo 1995 / Gauss-Kruger CM 21E
- <epsg2464> : Pulkovo 1995 / Gauss-Kruger CM 27E
- <epsg2465> : Pulkovo 1995 / Gauss-Kruger CM 33E
- <epsg2466> : Pulkovo 1995 / Gauss-Kruger CM 39E
- <epsg2467> : Pulkovo 1995 / Gauss-Kruger CM 45E
- <epsg2468> : Pulkovo 1995 / Gauss-Kruger CM 51E
- <epsg2469> : Pulkovo 1995 / Gauss-Kruger CM 57E
- <epsg2470> : Pulkovo 1995 / Gauss-Kruger CM 63E
- <epsg2471> : Pulkovo 1995 / Gauss-Kruger CM 69E
- <epsg2472> : Pulkovo 1995 / Gauss-Kruger CM 75E
- <epsg2473> : Pulkovo 1995 / Gauss-Kruger CM 81E
- <epsg2474> : Pulkovo 1995 / Gauss-Kruger CM 87E
- <epsg2475> : Pulkovo 1995 / Gauss-Kruger CM 93E
- <epsg2476> : Pulkovo 1995 / Gauss-Kruger CM 99E
- <epsg2477> : Pulkovo 1995 / Gauss-Kruger CM 105E
- <epsg2478> : Pulkovo 1995 / Gauss-Kruger CM 111E
- <epsg2479> : Pulkovo 1995 / Gauss-Kruger CM 117E
- <epsg2480> : Pulkovo 1995 / Gauss-Kruger CM 123E
- <epsg2481> : Pulkovo 1995 / Gauss-Kruger CM 129E
- <epsg2482> : Pulkovo 1995 / Gauss-Kruger CM 135E
- <epsg2483> : Pulkovo 1995 / Gauss-Kruger CM 141E
- <epsg2484> : Pulkovo 1995 / Gauss-Kruger CM 147E
- <epsg2485> : Pulkovo 1995 / Gauss-Kruger CM 153E
- <epsg2486> : Pulkovo 1995 / Gauss-Kruger CM 159E
- <epsg2487> : Pulkovo 1995 / Gauss-Kruger CM 165E
- <epsg2488> : Pulkovo 1995 / Gauss-Kruger CM 171E
- <epsg2489> : Pulkovo 1995 / Gauss-Kruger CM 177E
- <epsg2490> : Pulkovo 1995 / Gauss-Kruger CM 177W
- <epsg2491> : Pulkovo 1995 / Gauss-Kruger CM 171W
- <epsg2492> : Pulkovo 1942 / Gauss-Kruger CM 9E
- <epsg2493> : Pulkovo 1942 / Gauss-Kruger CM 15E
- <epsg2494> : Pulkovo 1942 / Gauss-Kruger CM 21E
- <epsg2495> : Pulkovo 1942 / Gauss-Kruger CM 27E
- <epsg2496> : Pulkovo 1942 / Gauss-Kruger CM 33E
- <epsg2497> : Pulkovo 1942 / Gauss-Kruger CM 39E
- <epsg2498> : Pulkovo 1942 / Gauss-Kruger CM 45E
- <epsg2499> : Pulkovo 1942 / Gauss-Kruger CM 51E
- <epsg2500> : Pulkovo 1942 / Gauss-Kruger CM 57E
- <epsg2501> : Pulkovo 1942 / Gauss-Kruger CM 63E
- <epsg2502> : Pulkovo 1942 / Gauss-Kruger CM 69E
- <epsg2503> : Pulkovo 1942 / Gauss-Kruger CM 75E
- <epsg2504> : Pulkovo 1942 / Gauss-Kruger CM 81E
- <epsg2505> : Pulkovo 1942 / Gauss-Kruger CM 87E
- <epsg2506> : Pulkovo 1942 / Gauss-Kruger CM 93E
- <epsg2507> : Pulkovo 1942 / Gauss-Kruger CM 99E
- <epsg2508> : Pulkovo 1942 / Gauss-Kruger CM 105E
- <epsg2509> : Pulkovo 1942 / Gauss-Kruger CM 111E
- <epsg2510> : Pulkovo 1942 / Gauss-Kruger CM 117E
- <epsg2511> : Pulkovo 1942 / Gauss-Kruger CM 123E
- <epsg2512> : Pulkovo 1942 / Gauss-Kruger CM 129E
- <epsg2513> : Pulkovo 1942 / Gauss-Kruger CM 135E
- <epsg2514> : Pulkovo 1942 / Gauss-Kruger CM 141E
- <epsg2515> : Pulkovo 1942 / Gauss-Kruger CM 147E
- <epsg2516> : Pulkovo 1942 / Gauss-Kruger CM 153E
- <epsg2517> : Pulkovo 1942 / Gauss-Kruger CM 159E
- <epsg2518> : Pulkovo 1942 / Gauss-Kruger CM 165E
- <epsg2519> : Pulkovo 1942 / Gauss-Kruger CM 171E
- <epsg2520> : Pulkovo 1942 / Gauss-Kruger CM 177E
- <epsg2521> : Pulkovo 1942 / Gauss-Kruger CM 177W
- <epsg2522> : Pulkovo 1942 / Gauss-Kruger CM 171W
- <epsg2523> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 7
- <epsg2524> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 8
- <epsg2525> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 9
- <epsg2526> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 10
- <epsg2527> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 11
- <epsg2528> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 12
- <epsg2529> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 13
- <epsg2530> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 14
- <epsg2531> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 15
- <epsg2532> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 16
- <epsg2533> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 17
- <epsg2534> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 18
- <epsg2535> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 19
- <epsg2536> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 20
- <epsg2537> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 21
- <epsg2538> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 22
- <epsg2539> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 23
- <epsg2540> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 24
- <epsg2541> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 25
- <epsg2542> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 26
- <epsg2543> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 27
- <epsg2544> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 28
- <epsg2545> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 29
- <epsg2546> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 30
- <epsg2547> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 31
- <epsg2548> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 32
- <epsg2549> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 33
- <epsg2550> : Samboja / UTM zone 50S (deprecated)
- <epsg2551> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 34
- <epsg2552> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 35
- <epsg2553> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 36
- <epsg2554> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 37
- <epsg2555> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 38
- <epsg2556> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 39
- <epsg2557> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 40
- <epsg2558> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 41
- <epsg2559> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 42
- <epsg2560> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 43
- <epsg2561> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 44
- <epsg2562> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 45
- <epsg2563> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 46
- <epsg2564> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 47
- <epsg2565> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 48
- <epsg2566> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 49
- <epsg2567> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 50
- <epsg2568> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 51
- <epsg2569> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 52
- <epsg2570> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 53
- <epsg2571> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 54
- <epsg2572> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 55
- <epsg2573> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 56
- <epsg2574> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 57
- <epsg2575> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 58
- <epsg2576> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 59
- <epsg2577> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 60 (deprecated)
- <epsg2578> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 61
- <epsg2579> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 62
- <epsg2580> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 63
- <epsg2581> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 64
- <epsg2582> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 21E
- <epsg2583> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 24E
- <epsg2584> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 27E
- <epsg2585> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 30E
- <epsg2586> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 33E
- <epsg2587> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 36E
- <epsg2588> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 39E
- <epsg2589> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 42E
- <epsg2590> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 45E
- <epsg2591> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 48E
- <epsg2592> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 51E
- <epsg2593> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 54E
- <epsg2594> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 57E
- <epsg2595> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 60E
- <epsg2596> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 63E
- <epsg2597> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 66E
- <epsg2598> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 69E
- <epsg2599> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 72E
- <epsg2600> : Lietuvos Koordinoei Sistema 1994 (deprecated)
- <epsg2601> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 75E
- <epsg2602> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 78E
- <epsg2603> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 81E
- <epsg2604> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 84E
- <epsg2605> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 87E
- <epsg2606> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 90E
- <epsg2607> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 93E
- <epsg2608> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 96E
- <epsg2609> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 99E
- <epsg2610> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 102E
- <epsg2611> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 105E
- <epsg2612> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 108E
- <epsg2613> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 111E
- <epsg2614> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 114E
- <epsg2615> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 117E
- <epsg2616> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 120E
- <epsg2617> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 123E
- <epsg2618> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 126E
- <epsg2619> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 129E
- <epsg2620> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 132E
- <epsg2621> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 135E
- <epsg2622> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 138E
- <epsg2623> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 141E
- <epsg2624> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 144E
- <epsg2625> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 147E
- <epsg2626> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 150E
- <epsg2627> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 153E
- <epsg2628> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 156E
- <epsg2629> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 159E
- <epsg2630> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 162E
- <epsg2631> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 165E
- <epsg2632> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 168E
- <epsg2633> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 171E
- <epsg2634> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 174E
- <epsg2635> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 177E
- <epsg2636> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 180E
- <epsg2637> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 177W
- <epsg2638> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 174W
- <epsg2639> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 171W
- <epsg2640> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 168W
- <epsg2641> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 7
- <epsg2642> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 8
- <epsg2643> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 9
- <epsg2644> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 10
- <epsg2645> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 11
- <epsg2646> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 12
- <epsg2647> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 13
- <epsg2648> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 14
- <epsg2649> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 15
- <epsg2650> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 16
- <epsg2651> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 17
- <epsg2652> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 18
- <epsg2653> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 19
- <epsg2654> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 20
- <epsg2655> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 21
- <epsg2656> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 22
- <epsg2657> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 23
- <epsg2658> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 24
- <epsg2659> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 25
- <epsg2660> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 26
- <epsg2661> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 27
- <epsg2662> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 28
- <epsg2663> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 29
- <epsg2664> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 30
- <epsg2665> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 31
- <epsg2666> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 32
- <epsg2667> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 33
- <epsg2668> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 34
- <epsg2669> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 35
- <epsg2670> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 36
- <epsg2671> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 37
- <epsg2672> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 38
- <epsg2673> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 39
- <epsg2674> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 40
- <epsg2675> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 41
- <epsg2676> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 42
- <epsg2677> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 43
- <epsg2678> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 44
- <epsg2679> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 45
- <epsg2680> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 46
- <epsg2681> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 47
- <epsg2682> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 48
- <epsg2683> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 49
- <epsg2684> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 50
- <epsg2685> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 51
- <epsg2686> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 52
- <epsg2687> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 53
- <epsg2688> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 54
- <epsg2689> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 55
- <epsg2690> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 56
- <epsg2691> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 57
- <epsg2692> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 58
- <epsg2693> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 59
- <epsg2694> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 60 (deprecated)
- <epsg2695> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 61
- <epsg2696> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 62
- <epsg2697> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 63
- <epsg2698> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 64
- <epsg2699> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 21E
- <epsg2700> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 24E
- <epsg2701> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 27E
- <epsg2702> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 30E
- <epsg2703> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 33E
- <epsg2704> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 36E
- <epsg2705> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 39E
- <epsg2706> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 42E
- <epsg2707> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 45E
- <epsg2708> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 48E
- <epsg2709> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 51E
- <epsg2710> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 54E
- <epsg2711> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 57E
- <epsg2712> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 60E
- <epsg2713> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 63E
- <epsg2714> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 66E
- <epsg2715> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 69E
- <epsg2716> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 72E
- <epsg2717> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 75E
- <epsg2718> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 78E
- <epsg2719> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 81E
- <epsg2720> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 84E
- <epsg2721> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 87E
- <epsg2722> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 90E
- <epsg2723> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 93E
- <epsg2724> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 96E
- <epsg2725> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 99E
- <epsg2726> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 102E
- <epsg2727> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 105E
- <epsg2728> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 108E
- <epsg2729> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 111E
- <epsg2730> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 114E
- <epsg2731> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 117E
- <epsg2732> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 120E
- <epsg2733> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 123E
- <epsg2734> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 126E
- <epsg2735> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 129E
- <epsg2736> : Tete / UTM zone 36S
- <epsg2737> : Tete / UTM zone 37S
- <epsg2738> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 132E
- <epsg2739> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 135E
- <epsg2740> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 138E
- <epsg2741> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 141E
- <epsg2742> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 144E
- <epsg2743> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 147E
- <epsg2744> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 150E
- <epsg2745> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 153E
- <epsg2746> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 156E
- <epsg2747> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 159E
- <epsg2748> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 162E
- <epsg2749> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 165E
- <epsg2750> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 168E
- <epsg2751> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 171E
- <epsg2752> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 174E
- <epsg2753> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 177E
- <epsg2754> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 180E
- <epsg2755> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 177W
- <epsg2756> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 174W
- <epsg2757> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 171W
- <epsg2758> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 168W
- <epsg2759> : NAD83(HARN) / Alabama East
- <epsg2760> : NAD83(HARN) / Alabama West
- <epsg2761> : NAD83(HARN) / Arizona East
- <epsg2762> : NAD83(HARN) / Arizona Central
- <epsg2763> : NAD83(HARN) / Arizona West
- <epsg2764> : NAD83(HARN) / Arkansas North
- <epsg2765> : NAD83(HARN) / Arkansas South
- <epsg2766> : NAD83(HARN) / California zone 1
- <epsg2767> : NAD83(HARN) / California zone 2
- <epsg2768> : NAD83(HARN) / California zone 3
- <epsg2769> : NAD83(HARN) / California zone 4
- <epsg2770> : NAD83(HARN) / California zone 5
- <epsg2771> : NAD83(HARN) / California zone 6
- <epsg2772> : NAD83(HARN) / Colorado North
- <epsg2773> : NAD83(HARN) / Colorado Central
- <epsg2774> : NAD83(HARN) / Colorado South
- <epsg2775> : NAD83(HARN) / Connecticut
- <epsg2776> : NAD83(HARN) / Delaware
- <epsg2777> : NAD83(HARN) / Florida East
- <epsg2778> : NAD83(HARN) / Florida West
- <epsg2779> : NAD83(HARN) / Florida North
- <epsg2780> : NAD83(HARN) / Georgia East
- <epsg2781> : NAD83(HARN) / Georgia West
- <epsg2782> : NAD83(HARN) / Hawaii zone 1
- <epsg2783> : NAD83(HARN) / Hawaii zone 2
- <epsg2784> : NAD83(HARN) / Hawaii zone 3
- <epsg2785> : NAD83(HARN) / Hawaii zone 4
- <epsg2786> : NAD83(HARN) / Hawaii zone 5
- <epsg2787> : NAD83(HARN) / Idaho East
- <epsg2788> : NAD83(HARN) / Idaho Central
- <epsg2789> : NAD83(HARN) / Idaho West
- <epsg2790> : NAD83(HARN) / Illinois East
- <epsg2791> : NAD83(HARN) / Illinois West
- <epsg2792> : NAD83(HARN) / Indiana East
- <epsg2793> : NAD83(HARN) / Indiana West
- <epsg2794> : NAD83(HARN) / Iowa North
- <epsg2795> : NAD83(HARN) / Iowa South
- <epsg2796> : NAD83(HARN) / Kansas North
- <epsg2797> : NAD83(HARN) / Kansas South
- <epsg2798> : NAD83(HARN) / Kentucky North
- <epsg2799> : NAD83(HARN) / Kentucky South
- <epsg2800> : NAD83(HARN) / Louisiana North
- <epsg2801> : NAD83(HARN) / Louisiana South
- <epsg2802> : NAD83(HARN) / Maine East
- <epsg2803> : NAD83(HARN) / Maine West
- <epsg2804> : NAD83(HARN) / Maryland
- <epsg2805> : NAD83(HARN) / Massachusetts Mainland
- <epsg2806> : NAD83(HARN) / Massachusetts Island
- <epsg2807> : NAD83(HARN) / Michigan North
- <epsg2808> : NAD83(HARN) / Michigan Central
- <epsg2809> : NAD83(HARN) / Michigan South
- <epsg2810> : NAD83(HARN) / Minnesota North
- <epsg2811> : NAD83(HARN) / Minnesota Central
- <epsg2812> : NAD83(HARN) / Minnesota South
- <epsg2813> : NAD83(HARN) / Mississippi East
- <epsg2814> : NAD83(HARN) / Mississippi West
- <epsg2815> : NAD83(HARN) / Missouri East
- <epsg2816> : NAD83(HARN) / Missouri Central
- <epsg2817> : NAD83(HARN) / Missouri West
- <epsg2818> : NAD83(HARN) / Montana
- <epsg2819> : NAD83(HARN) / Nebraska
- <epsg2820> : NAD83(HARN) / Nevada East
- <epsg2821> : NAD83(HARN) / Nevada Central
- <epsg2822> : NAD83(HARN) / Nevada West
- <epsg2823> : NAD83(HARN) / New Hampshire
- <epsg2824> : NAD83(HARN) / New Jersey
- <epsg2825> : NAD83(HARN) / New Mexico East
- <epsg2826> : NAD83(HARN) / New Mexico Central
- <epsg2827> : NAD83(HARN) / New Mexico West
- <epsg2828> : NAD83(HARN) / New York East
- <epsg2829> : NAD83(HARN) / New York Central
- <epsg2830> : NAD83(HARN) / New York West
- <epsg2831> : NAD83(HARN) / New York Long Island
- <epsg2832> : NAD83(HARN) / North Dakota North
- <epsg2833> : NAD83(HARN) / North Dakota South
- <epsg2834> : NAD83(HARN) / Ohio North
- <epsg2835> : NAD83(HARN) / Ohio South
- <epsg2836> : NAD83(HARN) / Oklahoma North
- <epsg2837> : NAD83(HARN) / Oklahoma South
- <epsg2838> : NAD83(HARN) / Oregon North
- <epsg2839> : NAD83(HARN) / Oregon South
- <epsg2840> : NAD83(HARN) / Rhode Island
- <epsg2841> : NAD83(HARN) / South Dakota North
- <epsg2842> : NAD83(HARN) / South Dakota South
- <epsg2843> : NAD83(HARN) / Tennessee
- <epsg2844> : NAD83(HARN) / Texas North
- <epsg2845> : NAD83(HARN) / Texas North Central
- <epsg2846> : NAD83(HARN) / Texas Central
- <epsg2847> : NAD83(HARN) / Texas South Central
- <epsg2848> : NAD83(HARN) / Texas South
- <epsg2849> : NAD83(HARN) / Utah North
- <epsg2850> : NAD83(HARN) / Utah Central
- <epsg2851> : NAD83(HARN) / Utah South
- <epsg2852> : NAD83(HARN) / Vermont
- <epsg2853> : NAD83(HARN) / Virginia North
- <epsg2854> : NAD83(HARN) / Virginia South
- <epsg2855> : NAD83(HARN) / Washington North
- <epsg2856> : NAD83(HARN) / Washington South
- <epsg2857> : NAD83(HARN) / West Virginia North
- <epsg2858> : NAD83(HARN) / West Virginia South
- <epsg2859> : NAD83(HARN) / Wisconsin North
- <epsg2860> : NAD83(HARN) / Wisconsin Central
- <epsg2861> : NAD83(HARN) / Wisconsin South
- <epsg2862> : NAD83(HARN) / Wyoming East
- <epsg2863> : NAD83(HARN) / Wyoming East Central
- <epsg2864> : NAD83(HARN) / Wyoming West Central
- <epsg2865> : NAD83(HARN) / Wyoming West
- <epsg2866> : NAD83(HARN) / Puerto Rico & Virgin Is.
- <epsg2867> : NAD83(HARN) / Arizona East (ft)
- <epsg2868> : NAD83(HARN) / Arizona Central (ft)
- <epsg2869> : NAD83(HARN) / Arizona West (ft)
- <epsg2870> : NAD83(HARN) / California zone 1 (ftUS)
- <epsg2871> : NAD83(HARN) / California zone 2 (ftUS)
- <epsg2872> : NAD83(HARN) / California zone 3 (ftUS)
- <epsg2873> : NAD83(HARN) / California zone 4 (ftUS)
- <epsg2874> : NAD83(HARN) / California zone 5 (ftUS)
- <epsg2875> : NAD83(HARN) / California zone 6 (ftUS)
- <epsg2876> : NAD83(HARN) / Colorado North (ftUS)
- <epsg2877> : NAD83(HARN) / Colorado Central (ftUS)
- <epsg2878> : NAD83(HARN) / Colorado South (ftUS)
- <epsg2879> : NAD83(HARN) / Connecticut (ftUS)
- <epsg2880> : NAD83(HARN) / Delaware (ftUS)
- <epsg2881> : NAD83(HARN) / Florida East (ftUS)
- <epsg2882> : NAD83(HARN) / Florida West (ftUS)
- <epsg2883> : NAD83(HARN) / Florida North (ftUS)
- <epsg2884> : NAD83(HARN) / Georgia East (ftUS)
- <epsg2885> : NAD83(HARN) / Georgia West (ftUS)
- <epsg2886> : NAD83(HARN) / Idaho East (ftUS)
- <epsg2887> : NAD83(HARN) / Idaho Central (ftUS)
- <epsg2888> : NAD83(HARN) / Idaho West (ftUS)
- <epsg2889> : NAD83(HARN) / Indiana East (ftUS) (deprecated)
- <epsg2890> : NAD83(HARN) / Indiana West (ftUS) (deprecated)
- <epsg2891> : NAD83(HARN) / Kentucky North (ftUS)
- <epsg2892> : NAD83(HARN) / Kentucky South (ftUS)
- <epsg2893> : NAD83(HARN) / Maryland (ftUS)
- <epsg2894> : NAD83(HARN) / Massachusetts Mainland (ftUS)
- <epsg2895> : NAD83(HARN) / Massachusetts Island (ftUS)
- <epsg2896> : NAD83(HARN) / Michigan North (ft)
- <epsg2897> : NAD83(HARN) / Michigan Central (ft)
- <epsg2898> : NAD83(HARN) / Michigan South (ft)
- <epsg2899> : NAD83(HARN) / Mississippi East (ftUS)
- <epsg2900> : NAD83(HARN) / Mississippi West (ftUS)
- <epsg2901> : NAD83(HARN) / Montana (ft)
- <epsg2902> : NAD83(HARN) / New Mexico East (ftUS)
- <epsg2903> : NAD83(HARN) / New Mexico Central (ftUS)
- <epsg2904> : NAD83(HARN) / New Mexico West (ftUS)
- <epsg2905> : NAD83(HARN) / New York East (ftUS)
- <epsg2906> : NAD83(HARN) / New York Central (ftUS)
- <epsg2907> : NAD83(HARN) / New York West (ftUS)
- <epsg2908> : NAD83(HARN) / New York Long Island (ftUS)
- <epsg2909> : NAD83(HARN) / North Dakota North (ft)
- <epsg2910> : NAD83(HARN) / North Dakota South (ft)
- <epsg2911> : NAD83(HARN) / Oklahoma North (ftUS)
- <epsg2912> : NAD83(HARN) / Oklahoma South (ftUS)
- <epsg2913> : NAD83(HARN) / Oregon North (ft)
- <epsg2914> : NAD83(HARN) / Oregon South (ft)
- <epsg2915> : NAD83(HARN) / Tennessee (ftUS)
- <epsg2916> : NAD83(HARN) / Texas North (ftUS)
- <epsg2917> : NAD83(HARN) / Texas North Central (ftUS)
- <epsg2918> : NAD83(HARN) / Texas Central (ftUS)
- <epsg2919> : NAD83(HARN) / Texas South Central (ftUS)
- <epsg2920> : NAD83(HARN) / Texas South (ftUS)
- <epsg2921> : NAD83(HARN) / Utah North (ft)
- <epsg2922> : NAD83(HARN) / Utah Central (ft)
- <epsg2923> : NAD83(HARN) / Utah South (ft)
- <epsg2924> : NAD83(HARN) / Virginia North (ftUS)
- <epsg2925> : NAD83(HARN) / Virginia South (ftUS)
- <epsg2926> : NAD83(HARN) / Washington North (ftUS)
- <epsg2927> : NAD83(HARN) / Washington South (ftUS)
- <epsg2928> : NAD83(HARN) / Wisconsin North (ftUS)
- <epsg2929> : NAD83(HARN) / Wisconsin Central (ftUS)
- <epsg2930> : NAD83(HARN) / Wisconsin South (ftUS)
- <epsg2931> : Beduaram / TM 13 NE
- <epsg2932> : QND95 / Qatar National Grid
- <epsg2933> : Segara / UTM zone 50S
- <epsg2934> : Segara (Jakarta) / NEIEZ (deprecated)
- <epsg2935> : Pulkovo 1942 / CS63 zone A1
- <epsg2936> : Pulkovo 1942 / CS63 zone A2
- <epsg2937> : Pulkovo 1942 / CS63 zone A3
- <epsg2938> : Pulkovo 1942 / CS63 zone A4
- <epsg2939> : Pulkovo 1942 / CS63 zone K2
- <epsg2940> : Pulkovo 1942 / CS63 zone K3
- <epsg2941> : Pulkovo 1942 / CS63 zone K4
- <epsg2942> : Porto Santo / UTM zone 28N
- <epsg2943> : Selvagem Grande / UTM zone 28N
- <epsg2944> : NAD83(CSRS) / SCoPQ zone 2
- <epsg2945> : NAD83(CSRS) / MTM zone 3
- <epsg2946> : NAD83(CSRS) / MTM zone 4
- <epsg2947> : NAD83(CSRS) / MTM zone 5
- <epsg2948> : NAD83(CSRS) / MTM zone 6
- <epsg2949> : NAD83(CSRS) / MTM zone 7
- <epsg2950> : NAD83(CSRS) / MTM zone 8
- <epsg2951> : NAD83(CSRS) / MTM zone 9
- <epsg2952> : NAD83(CSRS) / MTM zone 10
- <epsg2953> : NAD83(CSRS) / New Brunswick Stereo
- <epsg2954> : NAD83(CSRS) / Prince Edward Isl. Stereographic (NAD83)
- <epsg2955> : NAD83(CSRS) / UTM zone 11N
- <epsg2956> : NAD83(CSRS) / UTM zone 12N
- <epsg2957> : NAD83(CSRS) / UTM zone 13N
- <epsg2958> : NAD83(CSRS) / UTM zone 17N
- <epsg2959> : NAD83(CSRS) / UTM zone 18N
- <epsg2960> : NAD83(CSRS) / UTM zone 19N
- <epsg2961> : NAD83(CSRS) / UTM zone 20N
- <epsg2962> : NAD83(CSRS) / UTM zone 21N
- <epsg2964> : NAD27 / Alaska Albers
- <epsg2965> : NAD83 / Indiana East (ftUS)
- <epsg2966> : NAD83 / Indiana West (ftUS)
- <epsg2967> : NAD83(HARN) / Indiana East (ftUS)
- <epsg2968> : NAD83(HARN) / Indiana West (ftUS)
- <epsg2969> : Fort Marigot / UTM zone 20N
- <epsg2970> : Guadeloupe 1948 / UTM zone 20N
- <epsg2971> : CSG67 / UTM zone 22N
- <epsg2972> : RGFG95 / UTM zone 22N
- <epsg2973> : Martinique 1938 / UTM zone 20N
- <epsg2975> : RGR92 / UTM zone 40S
- <epsg2976> : Tahiti 52 / UTM zone 6S
- <epsg2977> : Tahaa 54 / UTM zone 5S
- <epsg2978> : IGN72 Nuku Hiva / UTM zone 7S
- <epsg2979> : K0 1949 / UTM zone 42S (deprecated)
- <epsg2980> : Combani 1950 / UTM zone 38S
- <epsg2981> : IGN56 Lifou / UTM zone 58S
- <epsg2982> : IGN72 Grand Terre / UTM zone 58S (deprecated)
- <epsg2983> : ST87 Ouvea / UTM zone 58S (deprecated)
- <epsg2984> : RGNC 1991 / Lambert New Caledonia (deprecated)
- <epsg2987> : Saint Pierre et Miquelon 1950 / UTM zone 21N
- <epsg2988> : MOP78 / UTM zone 1S
- <epsg2989> : RRAF 1991 / UTM zone 20N
- <epsg2990> : Reunion 1947 / TM Reunion (deprecated)
- <epsg2991> : NAD83 / Oregon Lambert
- <epsg2992> : NAD83 / Oregon Lambert (ft)
- <epsg2993> : NAD83(HARN) / Oregon Lambert
- <epsg2994> : NAD83(HARN) / Oregon Lambert (ft)
- <epsg2995> : IGN53 Mare / UTM zone 58S
- <epsg2996> : ST84 Ile des Pins / UTM zone 58S
- <epsg2997> : ST71 Belep / UTM zone 58S
- <epsg2998> : NEA74 Noumea / UTM zone 58S
- <epsg2999> : Grand Comoros / UTM zone 38S
- <epsg3000> : Segara / NEIEZ
- <epsg3001> : Batavia / NEIEZ
- <epsg3002> : Makassar / NEIEZ
- <epsg3003> : Monte Mario / Italy zone 1
- <epsg3004> : Monte Mario / Italy zone 2
- <epsg3005> : NAD83 / BC Albers
- <epsg3006> : SWEREF99 TM
- <epsg3007> : SWEREF99 12 00
- <epsg3008> : SWEREF99 13 30
- <epsg3009> : SWEREF99 15 00
- <epsg3010> : SWEREF99 16 30
- <epsg3011> : SWEREF99 18 00
- <epsg3012> : SWEREF99 14 15
- <epsg3013> : SWEREF99 15 45
- <epsg3014> : SWEREF99 17 15
- <epsg3015> : SWEREF99 18 45
- <epsg3016> : SWEREF99 20 15
- <epsg3017> : SWEREF99 21 45
- <epsg3018> : SWEREF99 23 15
- <epsg3019> : RT90 7.5 gon V
- <epsg3020> : RT90 5 gon V
- <epsg3021> : RT90 2.5 gon V
- <epsg3022> : RT90 0 gon
- <epsg3023> : RT90 2.5 gon O
- <epsg3024> : RT90 5 gon O
- <epsg3025> : RT38 7.5 gon V
- <epsg3026> : RT38 5 gon V
- <epsg3027> : RT38 2.5 gon V
- <epsg3028> : RT38 0 gon
- <epsg3029> : RT38 2.5 gon O
- <epsg3030> : RT38 5 gon O
- <epsg3031> : WGS 84 / Antarctic Polar Stereographic
- <epsg3032> : WGS 84 / Australian Antarctic Polar Stereographic
- <epsg3033> : WGS 84 / Australian Antarctic Lambert
- <epsg3034> : ETRS89 / ETRS-LCC
- <epsg3035> : ETRS89 / ETRS-LAEA
- <epsg3036> : Moznet / UTM zone 36S
- <epsg3037> : Moznet / UTM zone 37S
- <epsg3038> : ETRS89 / ETRS-TM26
- <epsg3039> : ETRS89 / ETRS-TM27
- <epsg3040> : ETRS89 / ETRS-TM28
- <epsg3041> : ETRS89 / ETRS-TM29
- <epsg3042> : ETRS89 / ETRS-TM30
- <epsg3043> : ETRS89 / ETRS-TM31
- <epsg3044> : ETRS89 / ETRS-TM32
- <epsg3045> : ETRS89 / ETRS-TM33
- <epsg3046> : ETRS89 / ETRS-TM34
- <epsg3047> : ETRS89 / ETRS-TM35
- <epsg3048> : ETRS89 / ETRS-TM36
- <epsg3049> : ETRS89 / ETRS-TM37
- <epsg3050> : ETRS89 / ETRS-TM38
- <epsg3051> : ETRS89 / ETRS-TM39
- <epsg3054> : Hjorsey 1955 / UTM zone 26N
- <epsg3055> : Hjorsey 1955 / UTM zone 27N
- <epsg3056> : Hjorsey 1955 / UTM zone 28N
- <epsg3057> : ISN93 / Lambert 1993
- <epsg3058> : Helle 1954 / Jan Mayen Grid
- <epsg3059> : LKS92 / Latvia TM
- <epsg3060> : IGN72 Grande Terre / UTM zone 58S
- <epsg3061> : Porto Santo 1995 / UTM zone 28N
- <epsg3062> : Azores Oriental 1995 / UTM zone 26N
- <epsg3063> : Azores Central 1995 / UTM zone 26N
- <epsg3064> : IGM95 / UTM zone 32N
- <epsg3065> : IGM95 / UTM zone 33N
- <epsg3066> : ED50 / Jordan TM
- <epsg3067> : ETRS89 / ETRS-TM35FIN
- <epsg3068> : DHDN / Soldner Berlin
- <epsg3069> : NAD27 / Wisconsin Transverse Mercator
- <epsg3070> : NAD83 / Wisconsin Transverse Mercator
- <epsg3071> : NAD83(HARN) / Wisconsin Transverse Mercator
- <epsg3072> : NAD83 / Maine CS2000 East
- <epsg3073> : NAD83 / Maine CS2000 Central (deprecated)
- <epsg3074> : NAD83 / Maine CS2000 West
- <epsg3075> : NAD83(HARN) / Maine CS2000 East
- <epsg3076> : NAD83(HARN) / Maine CS2000 Central (deprecated)
- <epsg3077> : NAD83(HARN) / Maine CS2000 West
- <epsg3078> : NAD83 / Michigan Oblique Mercator
- <epsg3079> : NAD83(HARN) / Michigan Oblique Mercator
- <epsg3080> : NAD27 / Shackleford
- <epsg3081> : NAD83 / Texas State Mapping System
- <epsg3082> : NAD83 / Texas Centric Lambert Conformal
- <epsg3083> : NAD83 / Texas Centric Albers Equal Area
- <epsg3084> : NAD83(HARN) / Texas Centric Lambert Conformal
- <epsg3085> : NAD83(HARN) / Texas Centric Albers Equal Area
- <epsg3086> : NAD83 / Florida GDL Albers
- <epsg3087> : NAD83(HARN) / Florida GDL Albers
- <epsg3088> : NAD83 / Kentucky Single Zone
- <epsg3089> : NAD83 / Kentucky Single Zone (ftUS)
- <epsg3090> : NAD83(HARN) / Kentucky Single Zone
- <epsg3091> : NAD83(HARN) / Kentucky Single Zone (ftUS)
- <epsg3092> : Tokyo / UTM zone 51N
- <epsg3093> : Tokyo / UTM zone 52N
- <epsg3094> : Tokyo / UTM zone 53N
- <epsg3095> : Tokyo / UTM zone 54N
- <epsg3096> : Tokyo / UTM zone 55N
- <epsg3097> : JGD2000 / UTM zone 51N
- <epsg3098> : JGD2000 / UTM zone 52N
- <epsg3099> : JGD2000 / UTM zone 53N
- <epsg3100> : JGD2000 / UTM zone 54N
- <epsg3101> : JGD2000 / UTM zone 55N
- <epsg3102> : American Samoa 1962 / American Samoa Lambert
- <epsg3103> : Mauritania 1999 / UTM zone 28N (deprecated)
- <epsg3104> : Mauritania 1999 / UTM zone 29N (deprecated)
- <epsg3105> : Mauritania 1999 / UTM zone 30N (deprecated)
- <epsg3106> : Gulshan 303 / Bangladesh Transverse Mercator
- <epsg3107> : GDA94 / SA Lambert
- <epsg3108> : ETRS89 / Guernsey Grid
- <epsg3109> : ETRS89 / Jersey Transverse Mercator
- <epsg3110> : AGD66 / Vicgrid66
- <epsg3111> : GDA94 / Vicgrid94
- <epsg3112> : GDA94 / Geoscience Australia Lambert
- <epsg3113> : GDA94 / BCSG02
- <epsg3114> : MAGNA-SIRGAS / Colombia Far West zone
- <epsg3115> : MAGNA-SIRGAS / Colombia West zone
- <epsg3116> : MAGNA-SIRGAS / Colombia Bogota zone
- <epsg3117> : MAGNA-SIRGAS / Colombia East Central zone
- <epsg3118> : MAGNA-SIRGAS / Colombia East zone
- <epsg3119> : Douala 1948 / AEF west
- <epsg3120> : Pulkovo 1942(58) / Poland zone I
- <epsg3121> : PRS92 / Philippines zone 1
- <epsg3122> : PRS92 / Philippines zone 2
- <epsg3123> : PRS92 / Philippines zone 3
- <epsg3124> : PRS92 / Philippines zone 4
- <epsg3125> : PRS92 / Philippines zone 5
- <epsg3126> : ETRS89 / ETRS-GK19FIN
- <epsg3127> : ETRS89 / ETRS-GK20FIN
- <epsg3128> : ETRS89 / ETRS-GK21FIN
- <epsg3129> : ETRS89 / ETRS-GK22FIN
- <epsg3130> : ETRS89 / ETRS-GK23FIN
- <epsg3131> : ETRS89 / ETRS-GK24FIN
- <epsg3132> : ETRS89 / ETRS-GK25FIN
- <epsg3133> : ETRS89 / ETRS-GK26FIN
- <epsg3134> : ETRS89 / ETRS-GK27FIN
- <epsg3135> : ETRS89 / ETRS-GK28FIN
- <epsg3136> : ETRS89 / ETRS-GK29FIN
- <epsg3137> : ETRS89 / ETRS-GK30FIN
- <epsg3138> : ETRS89 / ETRS-GK31FIN
- <epsg3140> : Viti Levu 1912 / Viti Levu Grid
- <epsg3141> : Fiji 1956 / UTM zone 60S
- <epsg3142> : Fiji 1956 / UTM zone 1S
- <epsg3143> : Fiji 1986 / Fiji Map Grid (deprecated)
- <epsg3146> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 6
- <epsg3147> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 18E
- <epsg3148> : Indian 1960 / UTM zone 48N
- <epsg3149> : Indian 1960 / UTM zone 49N
- <epsg3150> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 6
- <epsg3151> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 18E
- <epsg3152> : ST74
- <epsg3153> : NAD83(CSRS) / BC Albers
- <epsg3154> : NAD83(CSRS) / UTM zone 7N
- <epsg3155> : NAD83(CSRS) / UTM zone 8N
- <epsg3156> : NAD83(CSRS) / UTM zone 9N
- <epsg3157> : NAD83(CSRS) / UTM zone 10N
- <epsg3158> : NAD83(CSRS) / UTM zone 14N
- <epsg3159> : NAD83(CSRS) / UTM zone 15N
- <epsg3160> : NAD83(CSRS) / UTM zone 16N
- <epsg3161> : NAD83 / Ontario MNR Lambert
- <epsg3162> : NAD83(CSRS) / Ontario MNR Lambert
- <epsg3163> : RGNC91-93 / Lambert New Caledonia
- <epsg3164> : ST87 Ouvea / UTM zone 58S
- <epsg3165> : NEA74 Noumea / Noumea Lambert
- <epsg3166> : NEA74 Noumea / Noumea Lambert 2
- <epsg3167> : Kertau (RSO) / RSO Malaya (ch)
- <epsg3168> : Kertau (RSO) / RSO Malaya (m)
- <epsg3169> : RGNC91-93 / UTM zone 57S
- <epsg3170> : RGNC91-93 / UTM zone 58S
- <epsg3171> : RGNC91-93 / UTM zone 59S
- <epsg3172> : IGN53 Mare / UTM zone 59S
- <epsg3174> : NAD83 / Great Lakes Albers
- <epsg3175> : NAD83 / Great Lakes and St Lawrence Albers
- <epsg3176> : Indian 1960 / TM 106 NE
- <epsg3177> : LGD2006 / Libya TM
- <epsg3178> : GR96 / UTM zone 18N
- <epsg3179> : GR96 / UTM zone 19N
- <epsg3180> : GR96 / UTM zone 20N
- <epsg3181> : GR96 / UTM zone 21N
- <epsg3182> : GR96 / UTM zone 22N
- <epsg3183> : GR96 / UTM zone 23N
- <epsg3184> : GR96 / UTM zone 24N
- <epsg3185> : GR96 / UTM zone 25N
- <epsg3186> : GR96 / UTM zone 26N
- <epsg3187> : GR96 / UTM zone 27N
- <epsg3188> : GR96 / UTM zone 28N
- <epsg3189> : GR96 / UTM zone 29N
- <epsg3190> : LGD2006 / Libya TM zone 5
- <epsg3191> : LGD2006 / Libya TM zone 6
- <epsg3192> : LGD2006 / Libya TM zone 7
- <epsg3193> : LGD2006 / Libya TM zone 8
- <epsg3194> : LGD2006 / Libya TM zone 9
- <epsg3195> : LGD2006 / Libya TM zone 10
- <epsg3196> : LGD2006 / Libya TM zone 11
- <epsg3197> : LGD2006 / Libya TM zone 12
- <epsg3198> : LGD2006 / Libya TM zone 13
- <epsg3199> : LGD2006 / UTM zone 32N
- <epsg3200> : FD58 / Iraq zone
- <epsg3201> : LGD2006 / UTM zone 33N
- <epsg3202> : LGD2006 / UTM zone 34N
- <epsg3203> : LGD2006 / UTM zone 35N
- <epsg3204> : WGS 84 / SCAR IMW SP19-20
- <epsg3205> : WGS 84 / SCAR IMW SP21-22
- <epsg3206> : WGS 84 / SCAR IMW SP23-24
- <epsg3207> : WGS 84 / SCAR IMW SQ01-02
- <epsg3208> : WGS 84 / SCAR IMW SQ19-20
- <epsg3209> : WGS 84 / SCAR IMW SQ21-22
- <epsg3210> : WGS 84 / SCAR IMW SQ37-38
- <epsg3211> : WGS 84 / SCAR IMW SQ39-40
- <epsg3212> : WGS 84 / SCAR IMW SQ41-42
- <epsg3213> : WGS 84 / SCAR IMW SQ43-44
- <epsg3214> : WGS 84 / SCAR IMW SQ45-46
- <epsg3215> : WGS 84 / SCAR IMW SQ47-48
- <epsg3216> : WGS 84 / SCAR IMW SQ49-50
- <epsg3217> : WGS 84 / SCAR IMW SQ51-52
- <epsg3218> : WGS 84 / SCAR IMW SQ53-54
- <epsg3219> : WGS 84 / SCAR IMW SQ55-56
- <epsg3220> : WGS 84 / SCAR IMW SQ57-58
- <epsg3221> : WGS 84 / SCAR IMW SR13-14
- <epsg3222> : WGS 84 / SCAR IMW SR15-16
- <epsg3223> : WGS 84 / SCAR IMW SR17-18
- <epsg3224> : WGS 84 / SCAR IMW SR19-20
- <epsg3225> : WGS 84 / SCAR IMW SR27-28
- <epsg3226> : WGS 84 / SCAR IMW SR29-30
- <epsg3227> : WGS 84 / SCAR IMW SR31-32
- <epsg3228> : WGS 84 / SCAR IMW SR33-34
- <epsg3229> : WGS 84 / SCAR IMW SR35-36
- <epsg3230> : WGS 84 / SCAR IMW SR37-38
- <epsg3231> : WGS 84 / SCAR IMW SR39-40
- <epsg3232> : WGS 84 / SCAR IMW SR41-42
- <epsg3233> : WGS 84 / SCAR IMW SR43-44
- <epsg3234> : WGS 84 / SCAR IMW SR45-46
- <epsg3235> : WGS 84 / SCAR IMW SR47-48
- <epsg3236> : WGS 84 / SCAR IMW SR49-50
- <epsg3237> : WGS 84 / SCAR IMW SR51-52
- <epsg3238> : WGS 84 / SCAR IMW SR53-54
- <epsg3239> : WGS 84 / SCAR IMW SR55-56
- <epsg3240> : WGS 84 / SCAR IMW SR57-58
- <epsg3241> : WGS 84 / SCAR IMW SR59-60
- <epsg3242> : WGS 84 / SCAR IMW SS04-06
- <epsg3243> : WGS 84 / SCAR IMW SS07-09
- <epsg3244> : WGS 84 / SCAR IMW SS10-12
- <epsg3245> : WGS 84 / SCAR IMW SS13-15
- <epsg3246> : WGS 84 / SCAR IMW SS16-18
- <epsg3247> : WGS 84 / SCAR IMW SS19-21
- <epsg3248> : WGS 84 / SCAR IMW SS25-27
- <epsg3249> : WGS 84 / SCAR IMW SS28-30
- <epsg3250> : WGS 84 / SCAR IMW SS31-33
- <epsg3251> : WGS 84 / SCAR IMW SS34-36
- <epsg3252> : WGS 84 / SCAR IMW SS37-39
- <epsg3253> : WGS 84 / SCAR IMW SS40-42
- <epsg3254> : WGS 84 / SCAR IMW SS43-45
- <epsg3255> : WGS 84 / SCAR IMW SS46-48
- <epsg3256> : WGS 84 / SCAR IMW SS49-51
- <epsg3257> : WGS 84 / SCAR IMW SS52-54
- <epsg3258> : WGS 84 / SCAR IMW SS55-57
- <epsg3259> : WGS 84 / SCAR IMW SS58-60
- <epsg3260> : WGS 84 / SCAR IMW ST01-04
- <epsg3261> : WGS 84 / SCAR IMW ST05-08
- <epsg3262> : WGS 84 / SCAR IMW ST09-12
- <epsg3263> : WGS 84 / SCAR IMW ST13-16
- <epsg3264> : WGS 84 / SCAR IMW ST17-20
- <epsg3265> : WGS 84 / SCAR IMW ST21-24
- <epsg3266> : WGS 84 / SCAR IMW ST25-28
- <epsg3267> : WGS 84 / SCAR IMW ST29-32
- <epsg3268> : WGS 84 / SCAR IMW ST33-36
- <epsg3269> : WGS 84 / SCAR IMW ST37-40
- <epsg3270> : WGS 84 / SCAR IMW ST41-44
- <epsg3271> : WGS 84 / SCAR IMW ST45-48
- <epsg3272> : WGS 84 / SCAR IMW ST49-52
- <epsg3273> : WGS 84 / SCAR IMW ST53-56
- <epsg3274> : WGS 84 / SCAR IMW ST57-60
- <epsg3275> : WGS 84 / SCAR IMW SU01-05
- <epsg3276> : WGS 84 / SCAR IMW SU06-10
- <epsg3277> : WGS 84 / SCAR IMW SU11-15
- <epsg3278> : WGS 84 / SCAR IMW SU16-20
- <epsg3279> : WGS 84 / SCAR IMW SU21-25
- <epsg3280> : WGS 84 / SCAR IMW SU26-30
- <epsg3281> : WGS 84 / SCAR IMW SU31-35
- <epsg3282> : WGS 84 / SCAR IMW SU36-40
- <epsg3283> : WGS 84 / SCAR IMW SU41-45
- <epsg3284> : WGS 84 / SCAR IMW SU46-50
- <epsg3285> : WGS 84 / SCAR IMW SU51-55
- <epsg3286> : WGS 84 / SCAR IMW SU56-60
- <epsg3287> : WGS 84 / SCAR IMW SV01-10
- <epsg3288> : WGS 84 / SCAR IMW SV11-20
- <epsg3289> : WGS 84 / SCAR IMW SV21-30
- <epsg3290> : WGS 84 / SCAR IMW SV31-40
- <epsg3291> : WGS 84 / SCAR IMW SV41-50
- <epsg3292> : WGS 84 / SCAR IMW SV51-60
- <epsg3293> : WGS 84 / SCAR IMW SW01-60
- <epsg3294> : WGS 84 / USGS Transantarctic Mountains
- <epsg3296> : RGPF / UTM zone 5S
- <epsg3297> : RGPF / UTM zone 6S
- <epsg3298> : RGPF / UTM zone 7S
- <epsg3299> : RGPF / UTM zone 8S
- <epsg3300> : Estonian Coordinate System of 1992
- <epsg3301> : Estonian Coordinate System of 1997
- <epsg3302> : IGN63 Hiva Oa / UTM zone 7S
- <epsg3303> : Fatu Iva 72 / UTM zone 7S
- <epsg3304> : Tahiti 79 / UTM zone 6S
- <epsg3305> : Moorea 87 / UTM zone 6S
- <epsg3306> : Maupiti 83 / UTM zone 5S
- <epsg3307> : Nakhl-e Ghanem / UTM zone 39N
- <epsg3308> : GDA94 / NSW Lambert
- <epsg3309> : NAD27 / California Albers
- <epsg3310> : NAD83 / California Albers
- <epsg3311> : NAD83(HARN) / California Albers
- <epsg3312> : CSG67 / UTM zone 21N
- <epsg3313> : RGFG95 / UTM zone 21N
- <epsg3314> : Katanga 1955 / Katanga Lambert
- <epsg3315> : Katanga 1955 / Katanga TM
- <epsg3316> : Kasai 1953 / Congo TM zone 22
- <epsg3317> : Kasai 1953 / Congo TM zone 24
- <epsg3318> : IGC 1962 / Congo TM zone 12
- <epsg3319> : IGC 1962 / Congo TM zone 14
- <epsg3320> : IGC 1962 / Congo TM zone 16
- <epsg3321> : IGC 1962 / Congo TM zone 18
- <epsg3322> : IGC 1962 / Congo TM zone 20
- <epsg3323> : IGC 1962 / Congo TM zone 22
- <epsg3324> : IGC 1962 / Congo TM zone 24
- <epsg3325> : IGC 1962 / Congo TM zone 26
- <epsg3326> : IGC 1962 / Congo TM zone 28
- <epsg3327> : IGC 1962 / Congo TM zone 30
- <epsg3328> : Pulkovo 1942(58) / GUGiK-80
- <epsg3329> : Pulkovo 1942(58) / 3-degree Gauss-Kruger zone 5
- <epsg3330> : Pulkovo 1942(58) / 3-degree Gauss-Kruger zone 6
- <epsg3331> : Pulkovo 1942(58) / 3-degree Gauss-Kruger zone 7
- <epsg3332> : Pulkovo 1942(58) / 3-degree Gauss-Kruger zone 8
- <epsg3333> : Pulkovo 1942(58) / Gauss-Kruger zone 3
- <epsg3334> : Pulkovo 1942(58) / Gauss-Kruger zone 4
- <epsg3335> : Pulkovo 1942(58) / Gauss-Kruger zone 5
- <epsg3336> : IGN 1962 Kerguelen / UTM zone 42S
- <epsg3337> : Le Pouce 1934 / Mauritius Grid
- <epsg3338> : NAD83 / Alaska Albers
- <epsg3339> : IGCB 1955 / Congo TM zone 12
- <epsg3340> : IGCB 1955 / Congo TM zone 14
- <epsg3341> : IGCB 1955 / Congo TM zone 16
- <epsg3342> : IGCB 1955 / UTM zone 33S
- <epsg3343> : Mauritania 1999 / UTM zone 28N
- <epsg3344> : Mauritania 1999 / UTM zone 29N
- <epsg3345> : Mauritania 1999 / UTM zone 30N
- <epsg3346> : LKS94 / Lithuania TM
- <epsg3347> : NAD83 / Statistics Canada Lambert
- <epsg3348> : NAD83(CSRS) / Statistics Canada Lambert
- <epsg3349> : WGS 84 / PDC Mercator
- <epsg3350> : Pulkovo 1942 / CS63 zone C0
- <epsg3351> : Pulkovo 1942 / CS63 zone C1
- <epsg3352> : Pulkovo 1942 / CS63 zone C2
- <epsg3353> : Mhast (onshore) / UTM zone 32S
- <epsg3354> : Mhast (offshore) / UTM zone 32S
- <epsg3355> : Egypt Gulf of Suez S-650 TL / Red Belt
- <epsg3356> : Grand Cayman 1959 / UTM zone 17N
- <epsg3357> : Little Cayman 1961 / UTM zone 17N
- <epsg3358> : NAD83(HARN) / North Carolina
- <epsg3359> : NAD83(HARN) / North Carolina (ftUS) (deprecated)
- <epsg3360> : NAD83(HARN) / South Carolina
- <epsg3361> : NAD83(HARN) / South Carolina (ft)
- <epsg3362> : NAD83(HARN) / Pennsylvania North
- <epsg3363> : NAD83(HARN) / Pennsylvania North (ftUS)
- <epsg3364> : NAD83(HARN) / Pennsylvania South
- <epsg3365> : NAD83(HARN) / Pennsylvania South (ftUS)
- <epsg3366> : Hong Kong 1963 Grid System (deprecated)
- <epsg3367> : IGN Astro 1960 / UTM zone 28N
- <epsg3368> : IGN Astro 1960 / UTM zone 29N
- <epsg3369> : IGN Astro 1960 / UTM zone 30N
- <epsg3370> : NAD27 / UTM zone 59N
- <epsg3371> : NAD27 / UTM zone 60N
- <epsg3372> : NAD83 / UTM zone 59N
- <epsg3373> : NAD83 / UTM zone 60N
- <epsg3374> : FD54 / UTM zone 29N
- <epsg3375> : GDM2000 / Peninsula RSO
- <epsg3376> : GDM2000 / East Malaysia BRSO
- <epsg3377> : GDM2000 / Johor Grid
- <epsg3378> : GDM2000 / Sembilan and Melaka Grid
- <epsg3379> : GDM2000 / PahangGrid
- <epsg3380> : GDM2000 / Selangor Grid
- <epsg3381> : GDM2000 / Terengganu Grid
- <epsg3382> : GDM2000 / Pinang Grid
- <epsg3383> : GDM2000 / Kedah and Perlis Grid
- <epsg3384> : GDM2000 / Perak Grid
- <epsg3385> : GDM2000 / Kelantan Grid
- <epsg3386> : KKJ / Finland zone 0
- <epsg3387> : KKJ / Finland zone 5
- <epsg3388> : Pulkovo 1942 / Caspian Sea Mercator
- <epsg3389> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 60
- <epsg3390> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 60
- <epsg3391> : Karbala 1979 (Polservice) / UTM zone 37N
- <epsg3392> : Karbala 1979 (Polservice) / UTM zone 38N
- <epsg3393> : Karbala 1979 (Polservice) / UTM zone 39N
- <epsg3394> : Nahrwan 1934 / Iraq zone
- <epsg3395> : WGS 84 / World Mercator
- <epsg3396> : PD/83 / Gauss-Kruger zone 3
- <epsg3397> : PD/83 / Gauss-Kruger zone 4
- <epsg3398> : RD/83 / Gauss-Kruger zone 4
- <epsg3399> : RD/83 / Gauss-Kruger zone 5
- <epsg3400> : NAD83 / Alberta 10-TM (Forest)
- <epsg3401> : NAD83 / Alberta 10-TM (Resource)
- <epsg3402> : NAD83(CSRS) / Alberta 10-TM (Forest)
- <epsg3403> : NAD83(CSRS) / Alberta 10-TM (Resource)
- <epsg3404> : NAD83(HARN) / North Carolina (ftUS)
- <epsg3405> : VN-2000 / UTM zone 48N
- <epsg3406> : VN-2000 / UTM zone 49N
- <epsg3407> : Hong Kong 1963 Grid System
- <epsg3408> : NSIDC EASE-Grid North
- <epsg3409> : NSIDC EASE-Grid South
- <epsg3411> : NSIDC Sea Ice Polar Stereographic North
- <epsg3412> : NSIDC Sea Ice Polar Stereographic South
- <epsg3413> : WGS 84 / NSIDC Sea Ice Polar Stereographic North
- <epsg3414> : SVY21 / Singapore TM
- <epsg3415> : WGS 72BE / South China Sea Lambert
- <epsg3416> : ETRS89 / Austria Lambert
- <epsg3417> : NAD83 / Iowa North (ft US)
- <epsg3418> : NAD83 / Iowa South (ft US)
- <epsg3419> : NAD83 / Kansas North (ft US)
- <epsg3420> : NAD83 / Kansas South (ft US)
- <epsg3421> : NAD83 / Nevada East (ft US)
- <epsg3422> : NAD83 / Nevada Central (ft US)
- <epsg3423> : NAD83 / Nevada West (ft US)
- <epsg3424> : NAD83 / New Jersey (ft US)
- <epsg3425> : NAD83(HARN) / Iowa North (ft US)
- <epsg3426> : NAD83(HARN) / Iowa South (ft US)
- <epsg3427> : NAD83(HARN) / Kansas North (ft US)
- <epsg3428> : NAD83(HARN) / Kansas South (ft US)
- <epsg3429> : NAD83(HARN) / Nevada East (ft US)
- <epsg3430> : NAD83(HARN) / Nevada Central (ft US)
- <epsg3431> : NAD83(HARN) / Nevada West (ft US)
- <epsg3432> : NAD83(HARN) / New Jersey (ft US)
- <epsg3433> : NAD83 / Arkansas North (ftUS)
- <epsg3434> : NAD83 / Arkansas South (ftUS)
- <epsg3435> : NAD83 / Illinois East (ftUS)
- <epsg3436> : NAD83 / Illinois West (ftUS)
- <epsg3437> : NAD83 / New Hampshire (ftUS)
- <epsg3438> : NAD83 / Rhode Island (ftUS)
- <epsg3439> : PSD93 / UTM zone 39N
- <epsg3440> : PSD93 / UTM zone 40N
- <epsg3441> : NAD83(HARN) / Arkansas North (ftUS)
- <epsg3442> : NAD83(HARN) / Arkansas South (ftUS)
- <epsg3443> : NAD83(HARN) / Illinois East (ftUS)
- <epsg3444> : NAD83(HARN) / Illinois West (ftUS)
- <epsg3445> : NAD83(HARN) / New Hampshire (ftUS)
- <epsg3446> : NAD83(HARN) / Rhode Island (ftUS)
- <epsg3447> : ETRS89 / Belgian Lambert 2005
- <epsg3448> : JAD2001 / Jamaica Metric Grid
- <epsg3449> : JAD2001 / UTM zone 17N
- <epsg3450> : JAD2001 / UTM zone 18N
- <epsg3451> : NAD83 / Louisiana North (ftUS)
- <epsg3452> : NAD83 / Louisiana South (ftUS)
- <epsg3453> : NAD83 / Louisiana Offshore (ftUS)
- <epsg3454> : NAD83 / South Dakota North (ftUS)
- <epsg3455> : NAD83 / South Dakota South (ftUS)
- <epsg3456> : NAD83(HARN) / Louisiana North (ftUS)
- <epsg3457> : NAD83(HARN) / Louisiana South (ftUS)
- <epsg3458> : NAD83(HARN) / South Dakota North (ftUS)
- <epsg3459> : NAD83(HARN) / South Dakota South (ftUS)
- <epsg3460> : Fiji 1986 / Fiji Map Grid
- <epsg3461> : Dabola 1981 / UTM zone 28N
- <epsg3462> : Dabola 1981 / UTM zone 29N
- <epsg3463> : NAD83 / Maine CS2000 Central
- <epsg3464> : NAD83(HARN) / Maine CS2000 Central
- <epsg3465> : NAD83(NSRS2007) / Alabama East
- <epsg3466> : NAD83(NSRS2007) / Alabama West
- <epsg3467> : NAD83(NSRS2007) / Alaska Albers
- <epsg3468> : NAD83(NSRS2007) / Alaska zone 1
- <epsg3469> : NAD83(NSRS2007) / Alaska zone 2
- <epsg3470> : NAD83(NSRS2007) / Alaska zone 3
- <epsg3471> : NAD83(NSRS2007) / Alaska zone 4
- <epsg3472> : NAD83(NSRS2007) / Alaska zone 5
- <epsg3473> : NAD83(NSRS2007) / Alaska zone 6
- <epsg3474> : NAD83(NSRS2007) / Alaska zone 7
- <epsg3475> : NAD83(NSRS2007) / Alaska zone 8
- <epsg3476> : NAD83(NSRS2007) / Alaska zone 9
- <epsg3477> : NAD83(NSRS2007) / Alaska zone 10
- <epsg3478> : NAD83(NSRS2007) / Arizona Central
- <epsg3479> : NAD83(NSRS2007) / Arizona Central (ft)
- <epsg3480> : NAD83(NSRS2007) / Arizona East
- <epsg3481> : NAD83(NSRS2007) / Arizona East (ft)
- <epsg3482> : NAD83(NSRS2007) / Arizona West
- <epsg3483> : NAD83(NSRS2007) / Arizona West (ft)
- <epsg3484> : NAD83(NSRS2007) / Arkansas North
- <epsg3485> : NAD83(NSRS2007) / Arkansas North (ftUS)
- <epsg3486> : NAD83(NSRS2007) / Arkansas South
- <epsg3487> : NAD83(NSRS2007) / Arkansas South (ftUS)
- <epsg3488> : NAD83(NSRS2007) / California Albers
- <epsg3489> : NAD83(NSRS2007) / California zone 1
- <epsg3490> : NAD83(NSRS2007) / California zone 1 (ftUS)
- <epsg3491> : NAD83(NSRS2007) / California zone 2
- <epsg3492> : NAD83(NSRS2007) / California zone 2 (ftUS)
- <epsg3493> : NAD83(NSRS2007) / California zone 3
- <epsg3494> : NAD83(NSRS2007) / California zone 3 (ftUS)
- <epsg3495> : NAD83(NSRS2007) / California zone 4
- <epsg3496> : NAD83(NSRS2007) / California zone 4 (ftUS)
- <epsg3497> : NAD83(NSRS2007) / California zone 5
- <epsg3498> : NAD83(NSRS2007) / California zone 5 (ftUS)
- <epsg3499> : NAD83(NSRS2007) / California zone 6
- <epsg3500> : NAD83(NSRS2007) / California zone 6 (ftUS)
- <epsg3501> : NAD83(NSRS2007) / Colorado Central
- <epsg3502> : NAD83(NSRS2007) / Colorado Central (ftUS)
- <epsg3503> : NAD83(NSRS2007) / Colorado North
- <epsg3504> : NAD83(NSRS2007) / Colorado North (ftUS)
- <epsg3505> : NAD83(NSRS2007) / Colorado South
- <epsg3506> : NAD83(NSRS2007) / Colorado South (ftUS)
- <epsg3507> : NAD83(NSRS2007) / Connecticut
- <epsg3508> : NAD83(NSRS2007) / Connecticut (ftUS)
- <epsg3509> : NAD83(NSRS2007) / Delaware
- <epsg3510> : NAD83(NSRS2007) / Delaware (ftUS)
- <epsg3511> : NAD83(NSRS2007) / Florida East
- <epsg3512> : NAD83(NSRS2007) / Florida East (ftUS)
- <epsg3513> : NAD83(NSRS2007) / Florida GDL Albers
- <epsg3514> : NAD83(NSRS2007) / Florida North
- <epsg3515> : NAD83(NSRS2007) / Florida North (ftUS)
- <epsg3516> : NAD83(NSRS2007) / Florida West
- <epsg3517> : NAD83(NSRS2007) / Florida West (ftUS)
- <epsg3518> : NAD83(NSRS2007) / Georgia East
- <epsg3519> : NAD83(NSRS2007) / Georgia East (ftUS)
- <epsg3520> : NAD83(NSRS2007) / Georgia West
- <epsg3521> : NAD83(NSRS2007) / Georgia West (ftUS)
- <epsg3522> : NAD83(NSRS2007) / Idaho Central
- <epsg3523> : NAD83(NSRS2007) / Idaho Central (ftUS)
- <epsg3524> : NAD83(NSRS2007) / Idaho East
- <epsg3525> : NAD83(NSRS2007) / Idaho East (ftUS)
- <epsg3526> : NAD83(NSRS2007) / Idaho West
- <epsg3527> : NAD83(NSRS2007) / Idaho West (ftUS)
- <epsg3528> : NAD83(NSRS2007) / Illinois East
- <epsg3529> : NAD83(NSRS2007) / Illinois East (ftUS)
- <epsg3530> : NAD83(NSRS2007) / Illinois West
- <epsg3531> : NAD83(NSRS2007) / Illinois West (ftUS)
- <epsg3532> : NAD83(NSRS2007) / Indiana East
- <epsg3533> : NAD83(NSRS2007) / Indiana East (ftUS)
- <epsg3534> : NAD83(NSRS2007) / Indiana West
- <epsg3535> : NAD83(NSRS2007) / Indiana West (ftUS)
- <epsg3536> : NAD83(NSRS2007) / Iowa North
- <epsg3537> : NAD83(NSRS2007) / Iowa North (ft US)
- <epsg3538> : NAD83(NSRS2007) / Iowa South
- <epsg3539> : NAD83(NSRS2007) / Iowa South (ft US)
- <epsg3540> : NAD83(NSRS2007) / Kansas North
- <epsg3541> : NAD83(NSRS2007) / Kansas North (ft US)
- <epsg3542> : NAD83(NSRS2007) / Kansas South
- <epsg3543> : NAD83(NSRS2007) / Kansas South (ft US)
- <epsg3544> : NAD83(NSRS2007) / Kentucky North
- <epsg3545> : NAD83(NSRS2007) / Kentucky North (ftUS)
- <epsg3546> : NAD83(NSRS2007) / Kentucky Single Zone
- <epsg3547> : NAD83(NSRS2007) / Kentucky Single Zone (ftUS)
- <epsg3548> : NAD83(NSRS2007) / Kentucky South
- <epsg3549> : NAD83(NSRS2007) / Kentucky South (ftUS)
- <epsg3550> : NAD83(NSRS2007) / Louisiana North
- <epsg3551> : NAD83(NSRS2007) / Louisiana North (ftUS)
- <epsg3552> : NAD83(NSRS2007) / Louisiana South
- <epsg3553> : NAD83(NSRS2007) / Louisiana South (ftUS)
- <epsg3554> : NAD83(NSRS2007) / Maine CS2000 Central
- <epsg3555> : NAD83(NSRS2007) / Maine CS2000 East
- <epsg3556> : NAD83(NSRS2007) / Maine CS2000 West
- <epsg3557> : NAD83(NSRS2007) / Maine East
- <epsg3558> : NAD83(NSRS2007) / Maine West
- <epsg3559> : NAD83(NSRS2007) / Maryland
- <epsg3560> : NAD83 / Utah North (ftUS)
- <epsg3561> : Old Hawaiian / Hawaii zone 1
- <epsg3562> : Old Hawaiian / Hawaii zone 2
- <epsg3563> : Old Hawaiian / Hawaii zone 3
- <epsg3564> : Old Hawaiian / Hawaii zone 4
- <epsg3565> : Old Hawaiian / Hawaii zone 5
- <epsg3566> : NAD83 / Utah Central (ftUS)
- <epsg3567> : NAD83 / Utah South (ftUS)
- <epsg3568> : NAD83(HARN) / Utah North (ftUS)
- <epsg3569> : NAD83(HARN) / Utah Central (ftUS)
- <epsg3570> : NAD83(HARN) / Utah South (ftUS)
- <epsg3571> : WGS 84 / North Pole LAEA Bering Sea
- <epsg3572> : WGS 84 / North Pole LAEA Alaska
- <epsg3573> : WGS 84 / North Pole LAEA Canada
- <epsg3574> : WGS 84 / North Pole LAEA Atlantic
- <epsg3575> : WGS 84 / North Pole LAEA Europe
- <epsg3576> : WGS 84 / North Pole LAEA Russia
- <epsg3577> : GDA94 / Australian Albers
- <epsg3578> : NAD83 / Yukon Albers
- <epsg3579> : NAD83(CSRS) / Yukon Albers
- <epsg3580> : NAD83 / NWT Lambert
- <epsg3581> : NAD83(CSRS) / NWT Lambert
- <epsg3582> : NAD83(NSRS2007) / Maryland (ftUS)
- <epsg3583> : NAD83(NSRS2007) / Massachusetts Island
- <epsg3584> : NAD83(NSRS2007) / Massachusetts Island (ftUS)
- <epsg3585> : NAD83(NSRS2007) / Massachusetts Mainland
- <epsg3586> : NAD83(NSRS2007) / Massachusetts Mainland (ftUS)
- <epsg3587> : NAD83(NSRS2007) / Michigan Central
- <epsg3588> : NAD83(NSRS2007) / Michigan Central (ft)
- <epsg3589> : NAD83(NSRS2007) / Michigan North
- <epsg3590> : NAD83(NSRS2007) / Michigan North (ft)
- <epsg3591> : NAD83(NSRS2007) / Michigan Oblique Mercator
- <epsg3592> : NAD83(NSRS2007) / Michigan South
- <epsg3593> : NAD83(NSRS2007) / Michigan South (ft)
- <epsg3594> : NAD83(NSRS2007) / Minnesota Central
- <epsg3595> : NAD83(NSRS2007) / Minnesota North
- <epsg3596> : NAD83(NSRS2007) / Minnesota South
- <epsg3597> : NAD83(NSRS2007) / Mississippi East
- <epsg3598> : NAD83(NSRS2007) / Mississippi East (ftUS)
- <epsg3599> : NAD83(NSRS2007) / Mississippi West
- <epsg3600> : NAD83(NSRS2007) / Mississippi West (ftUS)
- <epsg3601> : NAD83(NSRS2007) / Missouri Central
- <epsg3602> : NAD83(NSRS2007) / Missouri East
- <epsg3603> : NAD83(NSRS2007) / Missouri West
- <epsg3604> : NAD83(NSRS2007) / Montana
- <epsg3605> : NAD83(NSRS2007) / Montana (ft)
- <epsg3606> : NAD83(NSRS2007) / Nebraska
- <epsg3607> : NAD83(NSRS2007) / Nevada Central
- <epsg3608> : NAD83(NSRS2007) / Nevada Central (ft US)
- <epsg3609> : NAD83(NSRS2007) / Nevada East
- <epsg3610> : NAD83(NSRS2007) / Nevada East (ft US)
- <epsg3611> : NAD83(NSRS2007) / Nevada West
- <epsg3612> : NAD83(NSRS2007) / Nevada West (ft US)
- <epsg3613> : NAD83(NSRS2007) / New Hampshire
- <epsg3614> : NAD83(NSRS2007) / New Hampshire (ftUS)
- <epsg3615> : NAD83(NSRS2007) / New Jersey
- <epsg3616> : NAD83(NSRS2007) / New Jersey (ft US)
- <epsg3617> : NAD83(NSRS2007) / New Mexico Central
- <epsg3618> : NAD83(NSRS2007) / New Mexico Central (ftUS)
- <epsg3619> : NAD83(NSRS2007) / New Mexico East
- <epsg3620> : NAD83(NSRS2007) / New Mexico East (ftUS)
- <epsg3621> : NAD83(NSRS2007) / New Mexico West
- <epsg3622> : NAD83(NSRS2007) / New Mexico West (ftUS)
- <epsg3623> : NAD83(NSRS2007) / New York Central
- <epsg3624> : NAD83(NSRS2007) / New York Central (ftUS)
- <epsg3625> : NAD83(NSRS2007) / New York East
- <epsg3626> : NAD83(NSRS2007) / New York East (ftUS)
- <epsg3627> : NAD83(NSRS2007) / New York Long Island
- <epsg3628> : NAD83(NSRS2007) / New York Long Island (ftUS)
- <epsg3629> : NAD83(NSRS2007) / New York West
- <epsg3630> : NAD83(NSRS2007) / New York West (ftUS)
- <epsg3631> : NAD83(NSRS2007) / North Carolina
- <epsg3632> : NAD83(NSRS2007) / North Carolina (ftUS)
- <epsg3633> : NAD83(NSRS2007) / North Dakota North
- <epsg3634> : NAD83(NSRS2007) / North Dakota North (ft)
- <epsg3635> : NAD83(NSRS2007) / North Dakota South
- <epsg3636> : NAD83(NSRS2007) / North Dakota South (ft)
- <epsg3637> : NAD83(NSRS2007) / Ohio North
- <epsg3638> : NAD83(NSRS2007) / Ohio South
- <epsg3639> : NAD83(NSRS2007) / Oklahoma North
- <epsg3640> : NAD83(NSRS2007) / Oklahoma North (ftUS)
- <epsg3641> : NAD83(NSRS2007) / Oklahoma South
- <epsg3642> : NAD83(NSRS2007) / Oklahoma South (ftUS)
- <epsg3643> : NAD83(NSRS2007) / Oregon Lambert
- <epsg3644> : NAD83(NSRS2007) / Oregon Lambert (ft)
- <epsg3645> : NAD83(NSRS2007) / Oregon North
- <epsg3646> : NAD83(NSRS2007) / Oregon North (ft)
- <epsg3647> : NAD83(NSRS2007) / Oregon South
- <epsg3648> : NAD83(NSRS2007) / Oregon South (ft)
- <epsg3649> : NAD83(NSRS2007) / Pennsylvania North
- <epsg3650> : NAD83(NSRS2007) / Pennsylvania North (ftUS)
- <epsg3651> : NAD83(NSRS2007) / Pennsylvania South
- <epsg3652> : NAD83(NSRS2007) / Pennsylvania South (ftUS)
- <epsg3653> : NAD83(NSRS2007) / Rhode Island
- <epsg3654> : NAD83(NSRS2007) / Rhode Island (ftUS)
- <epsg3655> : NAD83(NSRS2007) / South Carolina
- <epsg3656> : NAD83(NSRS2007) / South Carolina (ft)
- <epsg3657> : NAD83(NSRS2007) / South Dakota North
- <epsg3658> : NAD83(NSRS2007) / South Dakota North (ftUS)
- <epsg3659> : NAD83(NSRS2007) / South Dakota South
- <epsg3660> : NAD83(NSRS2007) / South Dakota South (ftUS)
- <epsg3661> : NAD83(NSRS2007) / Tennessee
- <epsg3662> : NAD83(NSRS2007) / Tennessee (ftUS)
- <epsg3663> : NAD83(NSRS2007) / Texas Central
- <epsg3664> : NAD83(NSRS2007) / Texas Central (ftUS)
- <epsg3665> : NAD83(NSRS2007) / Texas Centric Albers Equal Area
- <epsg3666> : NAD83(NSRS2007) / Texas Centric Lambert Conformal
- <epsg3667> : NAD83(NSRS2007) / Texas North
- <epsg3668> : NAD83(NSRS2007) / Texas North (ftUS)
- <epsg3669> : NAD83(NSRS2007) / Texas North Central
- <epsg3670> : NAD83(NSRS2007) / Texas North Central (ftUS)
- <epsg3671> : NAD83(NSRS2007) / Texas South
- <epsg3672> : NAD83(NSRS2007) / Texas South (ftUS)
- <epsg3673> : NAD83(NSRS2007) / Texas South Central
- <epsg3674> : NAD83(NSRS2007) / Texas South Central (ftUS)
- <epsg3675> : NAD83(NSRS2007) / Utah Central
- <epsg3676> : NAD83(NSRS2007) / Utah Central (ft)
- <epsg3677> : NAD83(NSRS2007) / Utah Central (ftUS)
- <epsg3678> : NAD83(NSRS2007) / Utah North
- <epsg3679> : NAD83(NSRS2007) / Utah North (ft)
- <epsg3680> : NAD83(NSRS2007) / Utah North (ftUS)
- <epsg3681> : NAD83(NSRS2007) / Utah South
- <epsg3682> : NAD83(NSRS2007) / Utah South (ft)
- <epsg3683> : NAD83(NSRS2007) / Utah South (ftUS)
- <epsg3684> : NAD83(NSRS2007) / Vermont
- <epsg3685> : NAD83(NSRS2007) / Virginia North
- <epsg3686> : NAD83(NSRS2007) / Virginia North (ftUS)
- <epsg3687> : NAD83(NSRS2007) / Virginia South
- <epsg3688> : NAD83(NSRS2007) / Virginia South (ftUS)
- <epsg3689> : NAD83(NSRS2007) / Washington North
- <epsg3690> : NAD83(NSRS2007) / Washington North (ftUS)
- <epsg3691> : NAD83(NSRS2007) / Washington South
- <epsg3692> : NAD83(NSRS2007) / Washington South (ftUS)
- <epsg3693> : NAD83(NSRS2007) / West Virginia North
- <epsg3694> : NAD83(NSRS2007) / West Virginia South
- <epsg3695> : NAD83(NSRS2007) / Wisconsin Central
- <epsg3696> : NAD83(NSRS2007) / Wisconsin Central (ftUS)
- <epsg3697> : NAD83(NSRS2007) / Wisconsin North
- <epsg3698> : NAD83(NSRS2007) / Wisconsin North (ftUS)
- <epsg3699> : NAD83(NSRS2007) / Wisconsin South
- <epsg3700> : NAD83(NSRS2007) / Wisconsin South (ftUS)
- <epsg3701> : NAD83(NSRS2007) / Wisconsin Transverse Mercator
- <epsg3702> : NAD83(NSRS2007) / Wyoming East
- <epsg3703> : NAD83(NSRS2007) / Wyoming East Central
- <epsg3704> : NAD83(NSRS2007) / Wyoming West Central
- <epsg3705> : NAD83(NSRS2007) / Wyoming West
- <epsg3706> : NAD83(NSRS2007) / UTM zone 59N
- <epsg3707> : NAD83(NSRS2007) / UTM zone 60N
- <epsg3708> : NAD83(NSRS2007) / UTM zone 1N
- <epsg3709> : NAD83(NSRS2007) / UTM zone 2N
- <epsg3710> : NAD83(NSRS2007) / UTM zone 3N
- <epsg3711> : NAD83(NSRS2007) / UTM zone 4N
- <epsg3712> : NAD83(NSRS2007) / UTM zone 5N
- <epsg3713> : NAD83(NSRS2007) / UTM zone 6N
- <epsg3714> : NAD83(NSRS2007) / UTM zone 7N
- <epsg3715> : NAD83(NSRS2007) / UTM zone 8N
- <epsg3716> : NAD83(NSRS2007) / UTM zone 9N
- <epsg3717> : NAD83(NSRS2007) / UTM zone 10N
- <epsg3718> : NAD83(NSRS2007) / UTM zone 11N
- <epsg3719> : NAD83(NSRS2007) / UTM zone 12N
- <epsg3720> : NAD83(NSRS2007) / UTM zone 13N
- <epsg3721> : NAD83(NSRS2007) / UTM zone 14N
- <epsg3722> : NAD83(NSRS2007) / UTM zone 15N
- <epsg3723> : NAD83(NSRS2007) / UTM zone 16N
- <epsg3724> : NAD83(NSRS2007) / UTM zone 17N
- <epsg3725> : NAD83(NSRS2007) / UTM zone 18N
- <epsg3726> : NAD83(NSRS2007) / UTM zone 19N
- <epsg3727> : Reunion 1947 / TM Reunion
- <epsg3728> : NAD83(NSRS2007) / Ohio North (ftUS)
- <epsg3729> : NAD83(NSRS2007) / Ohio South (ftUS)
- <epsg3730> : NAD83(NSRS2007) / Wyoming East (ftUS)
- <epsg3731> : NAD83(NSRS2007) / Wyoming East Central (ftUS)
- <epsg3732> : NAD83(NSRS2007) / Wyoming West Central (ftUS)
- <epsg3733> : NAD83(NSRS2007) / Wyoming West (ftUS)
- <epsg3734> : NAD83 / Ohio North (ftUS)
- <epsg3735> : NAD83 / Ohio South (ftUS)
- <epsg3736> : NAD83 / Wyoming East (ftUS)
- <epsg3737> : NAD83 / Wyoming East Central (ftUS)
- <epsg3738> : NAD83 / Wyoming West Central (ftUS)
- <epsg3739> : NAD83 / Wyoming West (ftUS)
- <epsg3740> : NAD83(HARN) / UTM zone 10N
- <epsg3741> : NAD83(HARN) / UTM zone 11N
- <epsg3742> : NAD83(HARN) / UTM zone 12N
- <epsg3743> : NAD83(HARN) / UTM zone 13N
- <epsg3744> : NAD83(HARN) / UTM zone 14N
- <epsg3745> : NAD83(HARN) / UTM zone 15N
- <epsg3746> : NAD83(HARN) / UTM zone 16N
- <epsg3747> : NAD83(HARN) / UTM zone 17N
- <epsg3748> : NAD83(HARN) / UTM zone 18N
- <epsg3749> : NAD83(HARN) / UTM zone 19N
- <epsg3750> : NAD83(HARN) / UTM zone 4N
- <epsg3751> : NAD83(HARN) / UTM zone 5N
- <epsg3752> : WGS 84 / Mercator 41
- <epsg3753> : NAD83(HARN) / Ohio North (ftUS)
- <epsg3754> : NAD83(HARN) / Ohio South (ftUS)
- <epsg3755> : NAD83(HARN) / Wyoming East (ftUS)
- <epsg3756> : NAD83(HARN) / Wyoming East Central (ftUS)
- <epsg3757> : NAD83(HARN) / Wyoming West Central (ftUS)
- <epsg3758> : NAD83(HARN) / Wyoming West (ftUS)
- <epsg3759> : NAD83 / Hawaii zone 3 (ftUS)
- <epsg3760> : NAD83(HARN) / Hawaii zone 3 (ftUS)
- <epsg3761> : NAD83(CSRS) / UTM zone 22N
- <epsg3762> : WGS 84 / South Georgia Lambert
- <epsg3920> : Puerto Rico / UTM zone 20N
- <epsg3991> : Puerto Rico State Plane CS of 1927
- <epsg3992> : Puerto Rico / St. Croix
- <epsg20004> : Pulkovo 1995 / Gauss-Kruger zone 4
- <epsg20005> : Pulkovo 1995 / Gauss-Kruger zone 5
- <epsg20006> : Pulkovo 1995 / Gauss-Kruger zone 6
- <epsg20007> : Pulkovo 1995 / Gauss-Kruger zone 7
- <epsg20008> : Pulkovo 1995 / Gauss-Kruger zone 8
- <epsg20009> : Pulkovo 1995 / Gauss-Kruger zone 9
- <epsg20010> : Pulkovo 1995 / Gauss-Kruger zone 10
- <epsg20011> : Pulkovo 1995 / Gauss-Kruger zone 11
- <epsg20012> : Pulkovo 1995 / Gauss-Kruger zone 12
- <epsg20013> : Pulkovo 1995 / Gauss-Kruger zone 13
- <epsg20014> : Pulkovo 1995 / Gauss-Kruger zone 14
- <epsg20015> : Pulkovo 1995 / Gauss-Kruger zone 15
- <epsg20016> : Pulkovo 1995 / Gauss-Kruger zone 16
- <epsg20017> : Pulkovo 1995 / Gauss-Kruger zone 17
- <epsg20018> : Pulkovo 1995 / Gauss-Kruger zone 18
- <epsg20019> : Pulkovo 1995 / Gauss-Kruger zone 19
- <epsg20020> : Pulkovo 1995 / Gauss-Kruger zone 20
- <epsg20021> : Pulkovo 1995 / Gauss-Kruger zone 21
- <epsg20022> : Pulkovo 1995 / Gauss-Kruger zone 22
- <epsg20023> : Pulkovo 1995 / Gauss-Kruger zone 23
- <epsg20024> : Pulkovo 1995 / Gauss-Kruger zone 24
- <epsg20025> : Pulkovo 1995 / Gauss-Kruger zone 25
- <epsg20026> : Pulkovo 1995 / Gauss-Kruger zone 26
- <epsg20027> : Pulkovo 1995 / Gauss-Kruger zone 27
- <epsg20028> : Pulkovo 1995 / Gauss-Kruger zone 28
- <epsg20029> : Pulkovo 1995 / Gauss-Kruger zone 29
- <epsg20030> : Pulkovo 1995 / Gauss-Kruger zone 30
- <epsg20031> : Pulkovo 1995 / Gauss-Kruger zone 31
- <epsg20032> : Pulkovo 1995 / Gauss-Kruger zone 32
- <epsg20064> : Pulkovo 1995 / Gauss-Kruger 4N (deprecated)
- <epsg20065> : Pulkovo 1995 / Gauss-Kruger 5N (deprecated)
- <epsg20066> : Pulkovo 1995 / Gauss-Kruger 6N (deprecated)
- <epsg20067> : Pulkovo 1995 / Gauss-Kruger 7N (deprecated)
- <epsg20068> : Pulkovo 1995 / Gauss-Kruger 8N (deprecated)
- <epsg20069> : Pulkovo 1995 / Gauss-Kruger 9N (deprecated)
- <epsg20070> : Pulkovo 1995 / Gauss-Kruger 10N (deprecated)
- <epsg20071> : Pulkovo 1995 / Gauss-Kruger 11N (deprecated)
- <epsg20072> : Pulkovo 1995 / Gauss-Kruger 12N (deprecated)
- <epsg20073> : Pulkovo 1995 / Gauss-Kruger 13N (deprecated)
- <epsg20074> : Pulkovo 1995 / Gauss-Kruger 14N (deprecated)
- <epsg20075> : Pulkovo 1995 / Gauss-Kruger 15N (deprecated)
- <epsg20076> : Pulkovo 1995 / Gauss-Kruger 16N (deprecated)
- <epsg20077> : Pulkovo 1995 / Gauss-Kruger 17N (deprecated)
- <epsg20078> : Pulkovo 1995 / Gauss-Kruger 18N (deprecated)
- <epsg20079> : Pulkovo 1995 / Gauss-Kruger 19N (deprecated)
- <epsg20080> : Pulkovo 1995 / Gauss-Kruger 20N (deprecated)
- <epsg20081> : Pulkovo 1995 / Gauss-Kruger 21N (deprecated)
- <epsg20082> : Pulkovo 1995 / Gauss-Kruger 22N (deprecated)
- <epsg20083> : Pulkovo 1995 / Gauss-Kruger 23N (deprecated)
- <epsg20084> : Pulkovo 1995 / Gauss-Kruger 24N (deprecated)
- <epsg20085> : Pulkovo 1995 / Gauss-Kruger 25N (deprecated)
- <epsg20086> : Pulkovo 1995 / Gauss-Kruger 26N (deprecated)
- <epsg20087> : Pulkovo 1995 / Gauss-Kruger 27N (deprecated)
- <epsg20088> : Pulkovo 1995 / Gauss-Kruger 28N (deprecated)
- <epsg20089> : Pulkovo 1995 / Gauss-Kruger 29N (deprecated)
- <epsg20090> : Pulkovo 1995 / Gauss-Kruger 30N (deprecated)
- <epsg20091> : Pulkovo 1995 / Gauss-Kruger 31N (deprecated)
- <epsg20092> : Pulkovo 1995 / Gauss-Kruger 32N (deprecated)
- <epsg20135> : Adindan / UTM zone 35N
- <epsg20136> : Adindan / UTM zone 36N
- <epsg20137> : Adindan / UTM zone 37N
- <epsg20138> : Adindan / UTM zone 38N
- <epsg20248> : AGD66 / AMG zone 48
- <epsg20249> : AGD66 / AMG zone 49
- <epsg20250> : AGD66 / AMG zone 50
- <epsg20251> : AGD66 / AMG zone 51
- <epsg20252> : AGD66 / AMG zone 52
- <epsg20253> : AGD66 / AMG zone 53
- <epsg20254> : AGD66 / AMG zone 54
- <epsg20255> : AGD66 / AMG zone 55
- <epsg20256> : AGD66 / AMG zone 56
- <epsg20257> : AGD66 / AMG zone 57
- <epsg20258> : AGD66 / AMG zone 58
- <epsg20348> : AGD84 / AMG zone 48
- <epsg20349> : AGD84 / AMG zone 49
- <epsg20350> : AGD84 / AMG zone 50
- <epsg20351> : AGD84 / AMG zone 51
- <epsg20352> : AGD84 / AMG zone 52
- <epsg20353> : AGD84 / AMG zone 53
- <epsg20354> : AGD84 / AMG zone 54
- <epsg20355> : AGD84 / AMG zone 55
- <epsg20356> : AGD84 / AMG zone 56
- <epsg20357> : AGD84 / AMG zone 57
- <epsg20358> : AGD84 / AMG zone 58
- <epsg20436> : Ain el Abd / UTM zone 36N
- <epsg20437> : Ain el Abd / UTM zone 37N
- <epsg20438> : Ain el Abd / UTM zone 38N
- <epsg20439> : Ain el Abd / UTM zone 39N
- <epsg20440> : Ain el Abd / UTM zone 40N
- <epsg20499> : Ain el Abd / Bahrain Grid
- <epsg20538> : Afgooye / UTM zone 38N
- <epsg20539> : Afgooye / UTM zone 39N
- <epsg20790> : Lisbon (Lisbon)/Portuguese National Grid
- <epsg20791> : Lisbon (Lisbon)/Portuguese Grid
- <epsg20822> : Aratu / UTM zone 22S
- <epsg20823> : Aratu / UTM zone 23S
- <epsg20824> : Aratu / UTM zone 24S
- <epsg20934> : Arc 1950 / UTM zone 34S
- <epsg20935> : Arc 1950 / UTM zone 35S
- <epsg20936> : Arc 1950 / UTM zone 36S
- <epsg21035> : Arc 1960 / UTM zone 35S
- <epsg21036> : Arc 1960 / UTM zone 36S
- <epsg21037> : Arc 1960 / UTM zone 37S
- <epsg21095> : Arc 1960 / UTM zone 35N
- <epsg21096> : Arc 1960 / UTM zone 36N
- <epsg21097> : Arc 1960 / UTM zone 37N
- <epsg21100> : Batavia (Jakarta) / NEIEZ (deprecated)
- <epsg21148> : Batavia / UTM zone 48S
- <epsg21149> : Batavia / UTM zone 49S
- <epsg21150> : Batavia / UTM zone 50S
- <epsg21291> : Barbados 1938 / British West Indies Grid
- <epsg21292> : Barbados 1938 / Barbados National Grid
- <epsg21413> : Beijing 1954 / Gauss-Kruger zone 13
- <epsg21414> : Beijing 1954 / Gauss-Kruger zone 14
- <epsg21415> : Beijing 1954 / Gauss-Kruger zone 15
- <epsg21416> : Beijing 1954 / Gauss-Kruger zone 16
- <epsg21417> : Beijing 1954 / Gauss-Kruger zone 17
- <epsg21418> : Beijing 1954 / Gauss-Kruger zone 18
- <epsg21419> : Beijing 1954 / Gauss-Kruger zone 19
- <epsg21420> : Beijing 1954 / Gauss-Kruger zone 20
- <epsg21421> : Beijing 1954 / Gauss-Kruger zone 21
- <epsg21422> : Beijing 1954 / Gauss-Kruger zone 22
- <epsg21423> : Beijing 1954 / Gauss-Kruger zone 23
- <epsg21453> : Beijing 1954 / Gauss-Kruger CM 75E
- <epsg21454> : Beijing 1954 / Gauss-Kruger CM 81E
- <epsg21455> : Beijing 1954 / Gauss-Kruger CM 87E
- <epsg21456> : Beijing 1954 / Gauss-Kruger CM 93E
- <epsg21457> : Beijing 1954 / Gauss-Kruger CM 99E
- <epsg21458> : Beijing 1954 / Gauss-Kruger CM 105E
- <epsg21459> : Beijing 1954 / Gauss-Kruger CM 111E
- <epsg21460> : Beijing 1954 / Gauss-Kruger CM 117E
- <epsg21461> : Beijing 1954 / Gauss-Kruger CM 123E
- <epsg21462> : Beijing 1954 / Gauss-Kruger CM 129E
- <epsg21463> : Beijing 1954 / Gauss-Kruger CM 135E
- <epsg21473> : Beijing 1954 / Gauss-Kruger 13N (deprecated)
- <epsg21474> : Beijing 1954 / Gauss-Kruger 14N (deprecated)
- <epsg21475> : Beijing 1954 / Gauss-Kruger 15N (deprecated)
- <epsg21476> : Beijing 1954 / Gauss-Kruger 16N (deprecated)
- <epsg21477> : Beijing 1954 / Gauss-Kruger 17N (deprecated)
- <epsg21478> : Beijing 1954 / Gauss-Kruger 18N (deprecated)
- <epsg21479> : Beijing 1954 / Gauss-Kruger 19N (deprecated)
- <epsg21480> : Beijing 1954 / Gauss-Kruger 20N (deprecated)
- <epsg21481> : Beijing 1954 / Gauss-Kruger 21N (deprecated)
- <epsg21482> : Beijing 1954 / Gauss-Kruger 22N (deprecated)
- <epsg21483> : Beijing 1954 / Gauss-Kruger 23N (deprecated)
- <epsg21500> : Belge 1950 (Brussels) / Belge Lambert 50
- <epsg21780> : Bern 1898 (Bern) / LV03C
- <epsg21781> : CH1903 / LV03
- <epsg21817> : Bogota 1975 / UTM zone 17N (deprecated)
- <epsg21818> : Bogota 1975 / UTM zone 18N
- <epsg21891> : Bogota 1975 / Colombia West zone (deprecated)
- <epsg21892> : Bogota 1975 / Colombia Bogota zone (deprecated)
- <epsg21893> : Bogota 1975 / Colombia East Central zone (deprecated)
- <epsg21894> : Bogota 1975 / Colombia East (deprecated)
- <epsg21896> : Bogota 1975 / Colombia West zone
- <epsg21897> : Bogota 1975 / Colombia Bogota zone
- <epsg21898> : Bogota 1975 / Colombia East Central zone
- <epsg21899> : Bogota 1975 / Colombia East
- <epsg22032> : Camacupa / UTM zone 32S
- <epsg22033> : Camacupa / UTM zone 33S
- <epsg22091> : Camacupa / TM 11.30 SE
- <epsg22092> : Camacupa / TM 12 SE
- <epsg22171> : POSGAR 98 / Argentina 1
- <epsg22172> : POSGAR 98 / Argentina 2
- <epsg22173> : POSGAR 98 / Argentina 3
- <epsg22174> : POSGAR 98 / Argentina 4
- <epsg22175> : POSGAR 98 / Argentina 5
- <epsg22176> : POSGAR 98 / Argentina 6
- <epsg22177> : POSGAR 98 / Argentina 7
- <epsg22181> : POSGAR 94 / Argentina 1
- <epsg22182> : POSGAR 94 / Argentina 2
- <epsg22183> : POSGAR 94 / Argentina 3
- <epsg22184> : POSGAR 94 / Argentina 4
- <epsg22185> : POSGAR 94 / Argentina 5
- <epsg22186> : POSGAR 94 / Argentina 6
- <epsg22187> : POSGAR 94 / Argentina 7
- <epsg22191> : Campo Inchauspe / Argentina 1
- <epsg22192> : Campo Inchauspe / Argentina 2
- <epsg22193> : Campo Inchauspe / Argentina 3
- <epsg22194> : Campo Inchauspe / Argentina 4
- <epsg22195> : Campo Inchauspe / Argentina 5
- <epsg22196> : Campo Inchauspe / Argentina 6
- <epsg22197> : Campo Inchauspe / Argentina 7
- <epsg22234> : Cape / UTM zone 34S
- <epsg22235> : Cape / UTM zone 35S
- <epsg22236> : Cape / UTM zone 36S
- <epsg22332> : Carthage / UTM zone 32N
- <epsg22391> : Carthage / Nord Tunisie
- <epsg22392> : Carthage / Sud Tunisie
- <epsg22521> : Corrego Alegre / UTM zone 21S
- <epsg22522> : Corrego Alegre / UTM zone 22S
- <epsg22523> : Corrego Alegre / UTM zone 23S
- <epsg22524> : Corrego Alegre / UTM zone 24S
- <epsg22525> : Corrego Alegre / UTM zone 25S
- <epsg22700> : Deir ez Zor / Levant Zone
- <epsg22770> : Deir ez Zor / Syria Lambert
- <epsg22780> : Deir ez Zor / Levant Stereographic
- <epsg22832> : Douala / UTM zone 32N (deprecated)
- <epsg22991> : Egypt 1907 / Blue Belt
- <epsg22992> : Egypt 1907 / Red Belt
- <epsg22993> : Egypt 1907 / Purple Belt
- <epsg22994> : Egypt 1907 / Extended Purple Belt
- <epsg23028> : ED50 / UTM zone 28N
- <epsg23029> : ED50 / UTM zone 29N
- <epsg23030> : ED50 / UTM zone 30N
- <epsg23031> : ED50 / UTM zone 31N
- <epsg23032> : ED50 / UTM zone 32N
- <epsg23033> : ED50 / UTM zone 33N
- <epsg23034> : ED50 / UTM zone 34N
- <epsg23035> : ED50 / UTM zone 35N
- <epsg23036> : ED50 / UTM zone 36N
- <epsg23037> : ED50 / UTM zone 37N
- <epsg23038> : ED50 / UTM zone 38N
- <epsg23090> : ED50 / TM 0 N
- <epsg23095> : ED50 / TM 5 NE
- <epsg23239> : Fahud / UTM zone 39N
- <epsg23240> : Fahud / UTM zone 40N
- <epsg23433> : Garoua / UTM zone 33N (deprecated)
- <epsg23700> : HD72 / EOV
- <epsg23830> : DGN95 / Indonesia TM-3 zone 46.2
- <epsg23831> : DGN95 / Indonesia TM-3 zone 47.1
- <epsg23832> : DGN95 / Indonesia TM-3 zone 47.2
- <epsg23833> : DGN95 / Indonesia TM-3 zone 48.1
- <epsg23834> : DGN95 / Indonesia TM-3 zone 48.2
- <epsg23835> : DGN95 / Indonesia TM-3 zone 49.1
- <epsg23836> : DGN95 / Indonesia TM-3 zone 49.2
- <epsg23837> : DGN95 / Indonesia TM-3 zone 50.1
- <epsg23838> : DGN95 / Indonesia TM-3 zone 50.2
- <epsg23839> : DGN95 / Indonesia TM-3 zone 51.1
- <epsg23840> : DGN95 / Indonesia TM-3 zone 51.2
- <epsg23841> : DGN95 / Indonesia TM-3 zone 52.1
- <epsg23842> : DGN95 / Indonesia TM-3 zone 52.2
- <epsg23843> : DGN95 / Indonesia TM-3 zone 53.1
- <epsg23844> : DGN95 / Indonesia TM-3 zone 53.2
- <epsg23845> : DGN95 / Indonesia TM-3 zone 54.1
- <epsg23846> : ID74 / UTM zone 46N
- <epsg23847> : ID74 / UTM zone 47N
- <epsg23848> : ID74 / UTM zone 48N
- <epsg23849> : ID74 / UTM zone 49N
- <epsg23850> : ID74 / UTM zone 50N
- <epsg23851> : ID74 / UTM zone 51N
- <epsg23852> : ID74 / UTM zone 52N
- <epsg23853> : ID74 / UTM zone 53N (deprecated)
- <epsg23866> : DGN95 / UTM zone 46N
- <epsg23867> : DGN95 / UTM zone 47N
- <epsg23868> : DGN95 / UTM zone 48N
- <epsg23869> : DGN95 / UTM zone 49N
- <epsg23870> : DGN95 / UTM zone 50N
- <epsg23871> : DGN95 / UTM zone 51N
- <epsg23872> : DGN95 / UTM zone 52N
- <epsg23877> : DGN95 / UTM zone 47S
- <epsg23878> : DGN95 / UTM zone 48S
- <epsg23879> : DGN95 / UTM zone 49S
- <epsg23880> : DGN95 / UTM zone 50S
- <epsg23881> : DGN95 / UTM zone 51S
- <epsg23882> : DGN95 / UTM zone 52S
- <epsg23883> : DGN95 / UTM zone 53S
- <epsg23884> : DGN95 / UTM zone 54S
- <epsg23886> : ID74 / UTM zone 46S (deprecated)
- <epsg23887> : ID74 / UTM zone 47S
- <epsg23888> : ID74 / UTM zone 48S
- <epsg23889> : ID74 / UTM zone 49S
- <epsg23890> : ID74 / UTM zone 50S
- <epsg23891> : ID74 / UTM zone 51S
- <epsg23892> : ID74 / UTM zone 52S
- <epsg23893> : ID74 / UTM zone 53S
- <epsg23894> : ID74 / UTM zone 54S
- <epsg23946> : Indian 1954 / UTM zone 46N
- <epsg23947> : Indian 1954 / UTM zone 47N
- <epsg23948> : Indian 1954 / UTM zone 48N
- <epsg24047> : Indian 1975 / UTM zone 47N
- <epsg24048> : Indian 1975 / UTM zone 48N
- <epsg24100> : Jamaica 1875 / Jamaica (Old Grid)
- <epsg24200> : JAD69 / Jamaica National Grid
- <epsg24305> : Kalianpur 1937 / UTM zone 45N
- <epsg24306> : Kalianpur 1937 / UTM zone 46N
- <epsg24311> : Kalianpur 1962 / UTM zone 41N
- <epsg24312> : Kalianpur 1962 / UTM zone 42N
- <epsg24313> : Kalianpur 1962 / UTM zone 43N
- <epsg24342> : Kalianpur 1975 / UTM zone 42N
- <epsg24343> : Kalianpur 1975 / UTM zone 43N
- <epsg24344> : Kalianpur 1975 / UTM zone 44N
- <epsg24345> : Kalianpur 1975 / UTM zone 45N
- <epsg24346> : Kalianpur 1975 / UTM zone 46N
- <epsg24347> : Kalianpur 1975 / UTM zone 47N
- <epsg24370> : Kalianpur 1880 / India zone 0
- <epsg24371> : Kalianpur 1880 / India zone I
- <epsg24372> : Kalianpur 1880 / India zone IIa
- <epsg24373> : Kalianpur 1880 / India zone III
- <epsg24374> : Kalianpur 1880 / India zone IV
- <epsg24375> : Kalianpur 1937 / India zone IIb
- <epsg24376> : Kalianpur 1962 / India zone I
- <epsg24377> : Kalianpur 1962 / India zone IIa
- <epsg24378> : Kalianpur 1975 / India zone I
- <epsg24379> : Kalianpur 1975 / India zone IIa
- <epsg24380> : Kalianpur 1975 / India zone IIb
- <epsg24381> : Kalianpur 1975 / India zone III
- <epsg24382> : Kalianpur 1880 / India zone IIb
- <epsg24383> : Kalianpur 1975 / India zone IV
- <epsg24500> : Kertau 1968 / Singapore Grid
- <epsg24547> : Kertau 1968 / UTM zone 47N
- <epsg24548> : Kertau 1968 / UTM zone 48N
- <epsg24571> : Kertau / R.S.O. Malaya (ch) (deprecated)
- <epsg24600> : KOC Lambert
- <epsg24718> : La Canoa / UTM zone 18N
- <epsg24719> : La Canoa / UTM zone 19N
- <epsg24720> : La Canoa / UTM zone 20N
- <epsg24817> : PSAD56 / UTM zone 17N
- <epsg24818> : PSAD56 / UTM zone 18N
- <epsg24819> : PSAD56 / UTM zone 19N
- <epsg24820> : PSAD56 / UTM zone 20N
- <epsg24821> : PSAD56 / UTM zone 21N
- <epsg24877> : PSAD56 / UTM zone 17S
- <epsg24878> : PSAD56 / UTM zone 18S
- <epsg24879> : PSAD56 / UTM zone 19S
- <epsg24880> : PSAD56 / UTM zone 20S
- <epsg24881> : PSAD56 / UTM zone 21S
- <epsg24882> : PSAD56 / UTM zone 22S
- <epsg24891> : PSAD56 / Peru west zone
- <epsg24892> : PSAD56 / Peru central zone
- <epsg24893> : PSAD56 / Peru east zone
- <epsg25000> : Leigon / Ghana Metre Grid
- <epsg25231> : Lome / UTM zone 31N
- <epsg25391> : Luzon 1911 / Philippines zone I
- <epsg25392> : Luzon 1911 / Philippines zone II
- <epsg25393> : Luzon 1911 / Philippines zone III
- <epsg25394> : Luzon 1911 / Philippines zone IV
- <epsg25395> : Luzon 1911 / Philippines zone V
- <epsg25700> : Makassar (Jakarta) / NEIEZ (deprecated)
- <epsg25828> : ETRS89 / UTM zone 28N
- <epsg25829> : ETRS89 / UTM zone 29N
- <epsg25830> : ETRS89 / UTM zone 30N
- <epsg25831> : ETRS89 / UTM zone 31N
- <epsg25832> : ETRS89 / UTM zone 32N
- <epsg25833> : ETRS89 / UTM zone 33N
- <epsg25834> : ETRS89 / UTM zone 34N
- <epsg25835> : ETRS89 / UTM zone 35N
- <epsg25836> : ETRS89 / UTM zone 36N
- <epsg25837> : ETRS89 / UTM zone 37N
- <epsg25838> : ETRS89 / UTM zone 38N
- <epsg25884> : ETRS89 / TM Baltic93
- <epsg25932> : Malongo 1987 / UTM zone 32S
- <epsg26191> : Merchich / Nord Maroc
- <epsg26192> : Merchich / Sud Maroc
- <epsg26193> : Merchich / Sahara (deprecated)
- <epsg26194> : Merchich / Sahara Nord
- <epsg26195> : Merchich / Sahara Sud
- <epsg26237> : Massawa / UTM zone 37N
- <epsg26331> : Minna / UTM zone 31N
- <epsg26332> : Minna / UTM zone 32N
- <epsg26391> : Minna / Nigeria West Belt
- <epsg26392> : Minna / Nigeria Mid Belt
- <epsg26393> : Minna / Nigeria East Belt
- <epsg26432> : Mhast / UTM zone 32S (deprecated)
- <epsg26591> : Monte Mario (Rome) / Italy zone 1 (deprecated)
- <epsg26592> : Monte Mario (Rome) / Italy zone 2 (deprecated)
- <epsg26632> : M'poraloko / UTM zone 32N
- <epsg26692> : M'poraloko / UTM zone 32S
- <epsg26701> : NAD27 / UTM zone 1N
- <epsg26702> : NAD27 / UTM zone 2N
- <epsg26703> : NAD27 / UTM zone 3N
- <epsg26704> : NAD27 / UTM zone 4N
- <epsg26705> : NAD27 / UTM zone 5N
- <epsg26706> : NAD27 / UTM zone 6N
- <epsg26707> : NAD27 / UTM zone 7N
- <epsg26708> : NAD27 / UTM zone 8N
- <epsg26709> : NAD27 / UTM zone 9N
- <epsg26710> : NAD27 / UTM zone 10N
- <epsg26711> : NAD27 / UTM zone 11N
- <epsg26712> : NAD27 / UTM zone 12N
- <epsg26713> : NAD27 / UTM zone 13N
- <epsg26714> : NAD27 / UTM zone 14N
- <epsg26715> : NAD27 / UTM zone 15N
- <epsg26716> : NAD27 / UTM zone 16N
- <epsg26717> : NAD27 / UTM zone 17N
- <epsg26718> : NAD27 / UTM zone 18N
- <epsg26719> : NAD27 / UTM zone 19N
- <epsg26720> : NAD27 / UTM zone 20N
- <epsg26721> : NAD27 / UTM zone 21N
- <epsg26722> : NAD27 / UTM zone 22N
- <epsg26729> : NAD27 / Alabama East
- <epsg26730> : NAD27 / Alabama West
- <epsg26731> : NAD27 / Alaska zone 1
- <epsg26732> : NAD27 / Alaska zone 2
- <epsg26733> : NAD27 / Alaska zone 3
- <epsg26734> : NAD27 / Alaska zone 4
- <epsg26735> : NAD27 / Alaska zone 5
- <epsg26736> : NAD27 / Alaska zone 6
- <epsg26737> : NAD27 / Alaska zone 7
- <epsg26738> : NAD27 / Alaska zone 8
- <epsg26739> : NAD27 / Alaska zone 9
- <epsg26740> : NAD27 / Alaska zone 10
- <epsg26741> : NAD27 / California zone I
- <epsg26742> : NAD27 / California zone II
- <epsg26743> : NAD27 / California zone III
- <epsg26744> : NAD27 / California zone IV
- <epsg26745> : NAD27 / California zone V
- <epsg26746> : NAD27 / California zone VI
- <epsg26747> : NAD27 / California zone VII (deprecated)
- <epsg26748> : NAD27 / Arizona East
- <epsg26749> : NAD27 / Arizona Central
- <epsg26750> : NAD27 / Arizona West
- <epsg26751> : NAD27 / Arkansas North
- <epsg26752> : NAD27 / Arkansas South
- <epsg26753> : NAD27 / Colorado North
- <epsg26754> : NAD27 / Colorado Central
- <epsg26755> : NAD27 / Colorado South
- <epsg26756> : NAD27 / Connecticut
- <epsg26757> : NAD27 / Delaware
- <epsg26758> : NAD27 / Florida East
- <epsg26759> : NAD27 / Florida West
- <epsg26760> : NAD27 / Florida North
- <epsg26766> : NAD27 / Georgia East
- <epsg26767> : NAD27 / Georgia West
- <epsg26768> : NAD27 / Idaho East
- <epsg26769> : NAD27 / Idaho Central
- <epsg26770> : NAD27 / Idaho West
- <epsg26771> : NAD27 / Illinois East
- <epsg26772> : NAD27 / Illinois West
- <epsg26773> : NAD27 / Indiana East
- <epsg26774> : NAD27 / Indiana West
- <epsg26775> : NAD27 / Iowa North
- <epsg26776> : NAD27 / Iowa South
- <epsg26777> : NAD27 / Kansas North
- <epsg26778> : NAD27 / Kansas South
- <epsg26779> : NAD27 / Kentucky North
- <epsg26780> : NAD27 / Kentucky South
- <epsg26781> : NAD27 / Louisiana North
- <epsg26782> : NAD27 / Louisiana South
- <epsg26783> : NAD27 / Maine East
- <epsg26784> : NAD27 / Maine West
- <epsg26785> : NAD27 / Maryland
- <epsg26786> : NAD27 / Massachusetts Mainland
- <epsg26787> : NAD27 / Massachusetts Island
- <epsg26791> : NAD27 / Minnesota North
- <epsg26792> : NAD27 / Minnesota Central
- <epsg26793> : NAD27 / Minnesota South
- <epsg26794> : NAD27 / Mississippi East
- <epsg26795> : NAD27 / Mississippi West
- <epsg26796> : NAD27 / Missouri East
- <epsg26797> : NAD27 / Missouri Central
- <epsg26798> : NAD27 / Missouri West
- <epsg26799> : NAD27 / California zone VII
- <epsg26801> : NAD Michigan / Michigan East
- <epsg26802> : NAD Michigan / Michigan Old Central
- <epsg26803> : NAD Michigan / Michigan West
- <epsg26811> : NAD Michigan / Michigan North
- <epsg26812> : NAD Michigan / Michigan Central
- <epsg26813> : NAD Michigan / Michigan South
- <epsg26901> : NAD83 / UTM zone 1N
- <epsg26902> : NAD83 / UTM zone 2N
- <epsg26903> : NAD83 / UTM zone 3N
- <epsg26904> : NAD83 / UTM zone 4N
- <epsg26905> : NAD83 / UTM zone 5N
- <epsg26906> : NAD83 / UTM zone 6N
- <epsg26907> : NAD83 / UTM zone 7N
- <epsg26908> : NAD83 / UTM zone 8N
- <epsg26909> : NAD83 / UTM zone 9N
- <epsg26910> : NAD83 / UTM zone 10N
- <epsg26911> : NAD83 / UTM zone 11N
- <epsg26912> : NAD83 / UTM zone 12N
- <epsg26913> : NAD83 / UTM zone 13N
- <epsg26914> : NAD83 / UTM zone 14N
- <epsg26915> : NAD83 / UTM zone 15N
- <epsg26916> : NAD83 / UTM zone 16N
- <epsg26917> : NAD83 / UTM zone 17N
- <epsg26918> : NAD83 / UTM zone 18N
- <epsg26919> : NAD83 / UTM zone 19N
- <epsg26920> : NAD83 / UTM zone 20N
- <epsg26921> : NAD83 / UTM zone 21N
- <epsg26922> : NAD83 / UTM zone 22N
- <epsg26923> : NAD83 / UTM zone 23N
- <epsg26929> : NAD83 / Alabama East
- <epsg26930> : NAD83 / Alabama West
- <epsg26931> : NAD83 / Alaska zone 1
- <epsg26932> : NAD83 / Alaska zone 2
- <epsg26933> : NAD83 / Alaska zone 3
- <epsg26934> : NAD83 / Alaska zone 4
- <epsg26935> : NAD83 / Alaska zone 5
- <epsg26936> : NAD83 / Alaska zone 6
- <epsg26937> : NAD83 / Alaska zone 7
- <epsg26938> : NAD83 / Alaska zone 8
- <epsg26939> : NAD83 / Alaska zone 9
- <epsg26940> : NAD83 / Alaska zone 10
- <epsg26941> : NAD83 / California zone 1
- <epsg26942> : NAD83 / California zone 2
- <epsg26943> : NAD83 / California zone 3
- <epsg26944> : NAD83 / California zone 4
- <epsg26945> : NAD83 / California zone 5
- <epsg26946> : NAD83 / California zone 6
- <epsg26948> : NAD83 / Arizona East
- <epsg26949> : NAD83 / Arizona Central
- <epsg26950> : NAD83 / Arizona West
- <epsg26951> : NAD83 / Arkansas North
- <epsg26952> : NAD83 / Arkansas South
- <epsg26953> : NAD83 / Colorado North
- <epsg26954> : NAD83 / Colorado Central
- <epsg26955> : NAD83 / Colorado South
- <epsg26956> : NAD83 / Connecticut
- <epsg26957> : NAD83 / Delaware
- <epsg26958> : NAD83 / Florida East
- <epsg26959> : NAD83 / Florida West
- <epsg26960> : NAD83 / Florida North
- <epsg26961> : NAD83 / Hawaii zone 1
- <epsg26962> : NAD83 / Hawaii zone 2
- <epsg26963> : NAD83 / Hawaii zone 3
- <epsg26964> : NAD83 / Hawaii zone 4
- <epsg26965> : NAD83 / Hawaii zone 5
- <epsg26966> : NAD83 / Georgia East
- <epsg26967> : NAD83 / Georgia West
- <epsg26968> : NAD83 / Idaho East
- <epsg26969> : NAD83 / Idaho Central
- <epsg26970> : NAD83 / Idaho West
- <epsg26971> : NAD83 / Illinois East
- <epsg26972> : NAD83 / Illinois West
- <epsg26973> : NAD83 / Indiana East
- <epsg26974> : NAD83 / Indiana West
- <epsg26975> : NAD83 / Iowa North
- <epsg26976> : NAD83 / Iowa South
- <epsg26977> : NAD83 / Kansas North
- <epsg26978> : NAD83 / Kansas South
- <epsg26979> : NAD83 / Kentucky North (deprecated)
- <epsg26980> : NAD83 / Kentucky South
- <epsg26981> : NAD83 / Louisiana North
- <epsg26982> : NAD83 / Louisiana South
- <epsg26983> : NAD83 / Maine East
- <epsg26984> : NAD83 / Maine West
- <epsg26985> : NAD83 / Maryland
- <epsg26986> : NAD83 / Massachusetts Mainland
- <epsg26987> : NAD83 / Massachusetts Island
- <epsg26988> : NAD83 / Michigan North
- <epsg26989> : NAD83 / Michigan Central
- <epsg26990> : NAD83 / Michigan South
- <epsg26991> : NAD83 / Minnesota North
- <epsg26992> : NAD83 / Minnesota Central
- <epsg26993> : NAD83 / Minnesota South
- <epsg26994> : NAD83 / Mississippi East
- <epsg26995> : NAD83 / Mississippi West
- <epsg26996> : NAD83 / Missouri East
- <epsg26997> : NAD83 / Missouri Central
- <epsg26998> : NAD83 / Missouri West
- <epsg27037> : Nahrwan 1967 / UTM zone 37N
- <epsg27038> : Nahrwan 1967 / UTM zone 38N
- <epsg27039> : Nahrwan 1967 / UTM zone 39N
- <epsg27040> : Nahrwan 1967 / UTM zone 40N
- <epsg27120> : Naparima 1972 / UTM zone 20N
- <epsg27200> : NZGD49 / New Zealand Map Grid
- <epsg27205> : NZGD49 / Mount Eden Circuit
- <epsg27206> : NZGD49 / Bay of Plenty Circuit
- <epsg27207> : NZGD49 / Poverty Bay Circuit
- <epsg27208> : NZGD49 / Hawkes Bay Circuit
- <epsg27209> : NZGD49 / Taranaki Circuit
- <epsg27210> : NZGD49 / Tuhirangi Circuit
- <epsg27211> : NZGD49 / Wanganui Circuit
- <epsg27212> : NZGD49 / Wairarapa Circuit
- <epsg27213> : NZGD49 / Wellington Circuit
- <epsg27214> : NZGD49 / Collingwood Circuit
- <epsg27215> : NZGD49 / Nelson Circuit
- <epsg27216> : NZGD49 / Karamea Circuit
- <epsg27217> : NZGD49 / Buller Circuit
- <epsg27218> : NZGD49 / Grey Circuit
- <epsg27219> : NZGD49 / Amuri Circuit
- <epsg27220> : NZGD49 / Marlborough Circuit
- <epsg27221> : NZGD49 / Hokitika Circuit
- <epsg27222> : NZGD49 / Okarito Circuit
- <epsg27223> : NZGD49 / Jacksons Bay Circuit
- <epsg27224> : NZGD49 / Mount Pleasant Circuit
- <epsg27225> : NZGD49 / Gawler Circuit
- <epsg27226> : NZGD49 / Timaru Circuit
- <epsg27227> : NZGD49 / Lindis Peak Circuit
- <epsg27228> : NZGD49 / Mount Nicholas Circuit
- <epsg27229> : NZGD49 / Mount York Circuit
- <epsg27230> : NZGD49 / Observation Point Circuit
- <epsg27231> : NZGD49 / North Taieri Circuit
- <epsg27232> : NZGD49 / Bluff Circuit
- <epsg27258> : NZGD49 / UTM zone 58S
- <epsg27259> : NZGD49 / UTM zone 59S
- <epsg27260> : NZGD49 / UTM zone 60S
- <epsg27291> : NZGD49 / North Island Grid
- <epsg27292> : NZGD49 / South Island Grid
- <epsg27391> : NGO 1948 (Oslo) / NGO zone I
- <epsg27392> : NGO 1948 (Oslo) / NGO zone II
- <epsg27393> : NGO 1948 (Oslo) / NGO zone III
- <epsg27394> : NGO 1948 (Oslo) / NGO zone IV
- <epsg27395> : NGO 1948 (Oslo) / NGO zone V
- <epsg27396> : NGO 1948 (Oslo) / NGO zone VI
- <epsg27397> : NGO 1948 (Oslo) / NGO zone VII
- <epsg27398> : NGO 1948 (Oslo) / NGO zone VIII
- <epsg27429> : Datum 73 / UTM zone 29N
- <epsg27492> : Datum 73 / Modified Portuguese Grid
- <epsg27500> : ATF (Paris) / Nord de Guerre
- <epsg27561> : NTF (Paris) / Lambert Nord France
- <epsg27562> : NTF (Paris) / Lambert Centre France
- <epsg27563> : NTF (Paris) / Lambert Sud France
- <epsg27564> : NTF (Paris) / Lambert Corse
- <epsg27571> : NTF (Paris) / Lambert zone I
- <epsg27572> : NTF (Paris) / Lambert zone II
- <epsg27573> : NTF (Paris) / Lambert zone III
- <epsg27574> : NTF (Paris) / Lambert zone IV
- <epsg27581> : NTF (Paris) / France I (deprecated)
- <epsg27582> : NTF (Paris) / France II (deprecated)
- <epsg27583> : NTF (Paris) / France III (deprecated)
- <epsg27584> : NTF (Paris) / France IV (deprecated)
- <epsg27591> : NTF (Paris) / Nord France (deprecated)
- <epsg27592> : NTF (Paris) / Centre France (deprecated)
- <epsg27593> : NTF (Paris) / Sud France (deprecated)
- <epsg27594> : NTF (Paris) / Corse (deprecated)
- <epsg27700> : OSGB 1936 / British National Grid
- <epsg28191> : Palestine 1923 / Palestine Grid
- <epsg28192> : Palestine 1923 / Palestine Belt
- <epsg28193> : Palestine 1923 / Israeli CS Grid
- <epsg28232> : Pointe Noire / UTM zone 32S
- <epsg28348> : GDA94 / MGA zone 48
- <epsg28349> : GDA94 / MGA zone 49
- <epsg28350> : GDA94 / MGA zone 50
- <epsg28351> : GDA94 / MGA zone 51
- <epsg28352> : GDA94 / MGA zone 52
- <epsg28353> : GDA94 / MGA zone 53
- <epsg28354> : GDA94 / MGA zone 54
- <epsg28355> : GDA94 / MGA zone 55
- <epsg28356> : GDA94 / MGA zone 56
- <epsg28357> : GDA94 / MGA zone 57
- <epsg28358> : GDA94 / MGA zone 58
- <epsg28402> : Pulkovo 1942 / Gauss-Kruger zone 2
- <epsg28403> : Pulkovo 1942 / Gauss-Kruger zone 3
- <epsg28404> : Pulkovo 1942 / Gauss-Kruger zone 4
- <epsg28405> : Pulkovo 1942 / Gauss-Kruger zone 5
- <epsg28406> : Pulkovo 1942 / Gauss-Kruger zone 6
- <epsg28407> : Pulkovo 1942 / Gauss-Kruger zone 7
- <epsg28408> : Pulkovo 1942 / Gauss-Kruger zone 8
- <epsg28409> : Pulkovo 1942 / Gauss-Kruger zone 9
- <epsg28410> : Pulkovo 1942 / Gauss-Kruger zone 10
- <epsg28411> : Pulkovo 1942 / Gauss-Kruger zone 11
- <epsg28412> : Pulkovo 1942 / Gauss-Kruger zone 12
- <epsg28413> : Pulkovo 1942 / Gauss-Kruger zone 13
- <epsg28414> : Pulkovo 1942 / Gauss-Kruger zone 14
- <epsg28415> : Pulkovo 1942 / Gauss-Kruger zone 15
- <epsg28416> : Pulkovo 1942 / Gauss-Kruger zone 16
- <epsg28417> : Pulkovo 1942 / Gauss-Kruger zone 17
- <epsg28418> : Pulkovo 1942 / Gauss-Kruger zone 18
- <epsg28419> : Pulkovo 1942 / Gauss-Kruger zone 19
- <epsg28420> : Pulkovo 1942 / Gauss-Kruger zone 20
- <epsg28421> : Pulkovo 1942 / Gauss-Kruger zone 21
- <epsg28422> : Pulkovo 1942 / Gauss-Kruger zone 22
- <epsg28423> : Pulkovo 1942 / Gauss-Kruger zone 23
- <epsg28424> : Pulkovo 1942 / Gauss-Kruger zone 24
- <epsg28425> : Pulkovo 1942 / Gauss-Kruger zone 25
- <epsg28426> : Pulkovo 1942 / Gauss-Kruger zone 26
- <epsg28427> : Pulkovo 1942 / Gauss-Kruger zone 27
- <epsg28428> : Pulkovo 1942 / Gauss-Kruger zone 28
- <epsg28429> : Pulkovo 1942 / Gauss-Kruger zone 29
- <epsg28430> : Pulkovo 1942 / Gauss-Kruger zone 30
- <epsg28431> : Pulkovo 1942 / Gauss-Kruger zone 31
- <epsg28432> : Pulkovo 1942 / Gauss-Kruger zone 32
- <epsg28462> : Pulkovo 1942 / Gauss-Kruger 2N (deprecated)
- <epsg28463> : Pulkovo 1942 / Gauss-Kruger 3N (deprecated)
- <epsg28464> : Pulkovo 1942 / Gauss-Kruger 4N (deprecated)
- <epsg28465> : Pulkovo 1942 / Gauss-Kruger 5N (deprecated)
- <epsg28466> : Pulkovo 1942 / Gauss-Kruger 6N (deprecated)
- <epsg28467> : Pulkovo 1942 / Gauss-Kruger 7N (deprecated)
- <epsg28468> : Pulkovo 1942 / Gauss-Kruger 8N (deprecated)
- <epsg28469> : Pulkovo 1942 / Gauss-Kruger 9N (deprecated)
- <epsg28470> : Pulkovo 1942 / Gauss-Kruger 10N (deprecated)
- <epsg28471> : Pulkovo 1942 / Gauss-Kruger 11N (deprecated)
- <epsg28472> : Pulkovo 1942 / Gauss-Kruger 12N (deprecated)
- <epsg28473> : Pulkovo 1942 / Gauss-Kruger 13N (deprecated)
- <epsg28474> : Pulkovo 1942 / Gauss-Kruger 14N (deprecated)
- <epsg28475> : Pulkovo 1942 / Gauss-Kruger 15N (deprecated)
- <epsg28476> : Pulkovo 1942 / Gauss-Kruger 16N (deprecated)
- <epsg28477> : Pulkovo 1942 / Gauss-Kruger 17N (deprecated)
- <epsg28478> : Pulkovo 1942 / Gauss-Kruger 18N (deprecated)
- <epsg28479> : Pulkovo 1942 / Gauss-Kruger 19N (deprecated)
- <epsg28480> : Pulkovo 1942 / Gauss-Kruger 20N (deprecated)
- <epsg28481> : Pulkovo 1942 / Gauss-Kruger 21N (deprecated)
- <epsg28482> : Pulkovo 1942 / Gauss-Kruger 22N (deprecated)
- <epsg28483> : Pulkovo 1942 / Gauss-Kruger 23N (deprecated)
- <epsg28484> : Pulkovo 1942 / Gauss-Kruger 24N (deprecated)
- <epsg28485> : Pulkovo 1942 / Gauss-Kruger 25N (deprecated)
- <epsg28486> : Pulkovo 1942 / Gauss-Kruger 26N (deprecated)
- <epsg28487> : Pulkovo 1942 / Gauss-Kruger 27N (deprecated)
- <epsg28488> : Pulkovo 1942 / Gauss-Kruger 28N (deprecated)
- <epsg28489> : Pulkovo 1942 / Gauss-Kruger 29N (deprecated)
- <epsg28490> : Pulkovo 1942 / Gauss-Kruger 30N (deprecated)
- <epsg28491> : Pulkovo 1942 / Gauss-Kruger 31N (deprecated)
- <epsg28492> : Pulkovo 1942 / Gauss-Kruger 32N (deprecated)
- <epsg28600> : Qatar 1974 / Qatar National Grid
- <epsg28991> : Amersfoort / RD Old
- <epsg28992> : Amersfoort / RD New
- <epsg29100> : SAD69 / Brazil Polyconic (deprecated)
- <epsg29101> : SAD69 / Brazil Polyconic
- <epsg29118> : SAD69 / UTM zone 18N (deprecated)
- <epsg29119> : SAD69 / UTM zone 19N (deprecated)
- <epsg29120> : SAD69 / UTM zone 20N (deprecated)
- <epsg29121> : SAD69 / UTM zone 21N (deprecated)
- <epsg29122> : SAD69 / UTM zone 22N (deprecated)
- <epsg29168> : SAD69 / UTM zone 18N
- <epsg29169> : SAD69 / UTM zone 19N
- <epsg29170> : SAD69 / UTM zone 20N
- <epsg29171> : SAD69 / UTM zone 21N
- <epsg29172> : SAD69 / UTM zone 22N
- <epsg29177> : SAD69 / UTM zone 17S (deprecated)
- <epsg29178> : SAD69 / UTM zone 18S (deprecated)
- <epsg29179> : SAD69 / UTM zone 19S (deprecated)
- <epsg29180> : SAD69 / UTM zone 20S (deprecated)
- <epsg29181> : SAD69 / UTM zone 21S (deprecated)
- <epsg29182> : SAD69 / UTM zone 22S (deprecated)
- <epsg29183> : SAD69 / UTM zone 23S (deprecated)
- <epsg29184> : SAD69 / UTM zone 24S (deprecated)
- <epsg29185> : SAD69 / UTM zone 25S (deprecated)
- <epsg29187> : SAD69 / UTM zone 17S
- <epsg29188> : SAD69 / UTM zone 18S
- <epsg29189> : SAD69 / UTM zone 19S
- <epsg29190> : SAD69 / UTM zone 20S
- <epsg29191> : SAD69 / UTM zone 21S
- <epsg29192> : SAD69 / UTM zone 22S
- <epsg29193> : SAD69 / UTM zone 23S
- <epsg29194> : SAD69 / UTM zone 24S
- <epsg29195> : SAD69 / UTM zone 25S
- <epsg29220> : Sapper Hill 1943 / UTM zone 20S
- <epsg29221> : Sapper Hill 1943 / UTM zone 21S
- <epsg29333> : Schwarzeck / UTM zone 33S
- <epsg29635> : Sudan / UTM zone 35N (deprecated)
- <epsg29636> : Sudan / UTM zone 36N (deprecated)
- <epsg29700> : Tananarive (Paris) / Laborde Grid (deprecated)
- <epsg29702> : Tananarive (Paris) / Laborde Grid approximation
- <epsg29738> : Tananarive / UTM zone 38S
- <epsg29739> : Tananarive / UTM zone 39S
- <epsg29849> : Timbalai 1948 / UTM zone 49N
- <epsg29850> : Timbalai 1948 / UTM zone 50N
- <epsg29871> : Timbalai 1948 / RSO Borneo (ch)
- <epsg29872> : Timbalai 1948 / RSO Borneo (ft)
- <epsg29873> : Timbalai 1948 / RSO Borneo (m)
- <epsg29900> : TM65 / Irish National Grid (deprecated)
- <epsg29901> : OSNI 1952 / Irish National Grid
- <epsg29902> : TM65 / Irish Grid
- <epsg29903> : TM75 / Irish Grid
- <epsg30161> : Tokyo / Japan Plane Rectangular CS I
- <epsg30162> : Tokyo / Japan Plane Rectangular CS II
- <epsg30163> : Tokyo / Japan Plane Rectangular CS III
- <epsg30164> : Tokyo / Japan Plane Rectangular CS IV
- <epsg30165> : Tokyo / Japan Plane Rectangular CS V
- <epsg30166> : Tokyo / Japan Plane Rectangular CS VI
- <epsg30167> : Tokyo / Japan Plane Rectangular CS VII
- <epsg30168> : Tokyo / Japan Plane Rectangular CS VIII
- <epsg30169> : Tokyo / Japan Plane Rectangular CS IX
- <epsg30170> : Tokyo / Japan Plane Rectangular CS X
- <epsg30171> : Tokyo / Japan Plane Rectangular CS XI
- <epsg30172> : Tokyo / Japan Plane Rectangular CS XII
- <epsg30173> : Tokyo / Japan Plane Rectangular CS XIII
- <epsg30174> : Tokyo / Japan Plane Rectangular CS XIV
- <epsg30175> : Tokyo / Japan Plane Rectangular CS XV
- <epsg30176> : Tokyo / Japan Plane Rectangular CS XVI
- <epsg30177> : Tokyo / Japan Plane Rectangular CS XVII
- <epsg30178> : Tokyo / Japan Plane Rectangular CS XVIII
- <epsg30179> : Tokyo / Japan Plane Rectangular CS XIX
- <epsg30200> : Trinidad 1903 / Trinidad Grid
- <epsg30339> : TC(1948) / UTM zone 39N
- <epsg30340> : TC(1948) / UTM zone 40N
- <epsg30491> : Voirol 1875 / Nord Algerie (ancienne)
- <epsg30492> : Voirol 1875 / Sud Algerie (ancienne)
- <epsg30493> : Voirol 1879 / Nord Algerie (ancienne)
- <epsg30494> : Voirol 1879 / Sud Algerie (ancienne)
- <epsg30729> : Nord Sahara 1959 / UTM zone 29N
- <epsg30730> : Nord Sahara 1959 / UTM zone 30N
- <epsg30731> : Nord Sahara 1959 / UTM zone 31N
- <epsg30732> : Nord Sahara 1959 / UTM zone 32N
- <epsg30791> : Nord Sahara 1959 / Voirol Unifie Nord
- <epsg30792> : Nord Sahara 1959 / Voirol Unifie Sud
- <epsg30800> : RT38 2.5 gon W (deprecated)
- <epsg31028> : Yoff / UTM zone 28N
- <epsg31121> : Zanderij / UTM zone 21N
- <epsg31154> : Zanderij / TM 54 NW
- <epsg31170> : Zanderij / Suriname Old TM
- <epsg31171> : Zanderij / Suriname TM
- <epsg31251> : MGI (Ferro) / Austria GK West Zone
- <epsg31252> : MGI (Ferro) / Austria GK Central Zone
- <epsg31253> : MGI (Ferro) / Austria GK East Zone
- <epsg31254> : MGI / Austria GK West
- <epsg31255> : MGI / Austria GK Central
- <epsg31256> : MGI / Austria GK East
- <epsg31257> : MGI / Austria GK M28
- <epsg31258> : MGI / Austria GK M31
- <epsg31259> : MGI / Austria GK M34
- <epsg31265> : MGI / 3-degree Gauss zone 5 (deprecated)
- <epsg31266> : MGI / 3-degree Gauss zone 6 (deprecated)
- <epsg31267> : MGI / 3-degree Gauss zone 7 (deprecated)
- <epsg31268> : MGI / 3-degree Gauss zone 8 (deprecated)
- <epsg31275> : MGI / Balkans zone 5
- <epsg31276> : MGI / Balkans zone 6
- <epsg31277> : MGI / Balkans zone 7
- <epsg31278> : MGI / Balkans zone 8 (deprecated)
- <epsg31279> : MGI / Balkans zone 8
- <epsg31281> : MGI (Ferro) / Austria West Zone
- <epsg31282> : MGI (Ferro) / Austria Central Zone
- <epsg31283> : MGI (Ferro) / Austria East Zone
- <epsg31284> : MGI / Austria M28
- <epsg31285> : MGI / Austria M31
- <epsg31286> : MGI / Austria M34
- <epsg31287> : MGI / Austria Lambert
- <epsg31288> : MGI (Ferro) / M28
- <epsg31289> : MGI (Ferro) / M31
- <epsg31290> : MGI (Ferro) / M34
- <epsg31291> : MGI (Ferro) / Austria West Zone (deprecated)
- <epsg31292> : MGI (Ferro) / Austria Central Zone (deprecated)
- <epsg31293> : MGI (Ferro) / Austria East Zone (deprecated)
- <epsg31294> : MGI / M28 (deprecated)
- <epsg31295> : MGI / M31 (deprecated)
- <epsg31296> : MGI / M34 (deprecated)
- <epsg31297> : MGI / Austria Lambert (deprecated)
- <epsg31300> : Belge 1972 / Belge Lambert 72
- <epsg31370> : Belge 1972 / Belgian Lambert 72
- <epsg31461> : DHDN / 3-degree Gauss zone 1 (deprecated)
- <epsg31462> : DHDN / 3-degree Gauss zone 2 (deprecated)
- <epsg31463> : DHDN / 3-degree Gauss zone 3 (deprecated)
- <epsg31464> : DHDN / 3-degree Gauss zone 4 (deprecated)
- <epsg31465> : DHDN / 3-degree Gauss zone 5 (deprecated)
- <epsg31466> : DHDN / Gauss-Kruger zone 2
- <epsg31467> : DHDN / Gauss-Kruger zone 3
- <epsg31468> : DHDN / Gauss-Kruger zone 4
- <epsg31469> : DHDN / Gauss-Kruger zone 5
- <epsg31528> : Conakry 1905 / UTM zone 28N
- <epsg31529> : Conakry 1905 / UTM zone 29N
- <epsg31600> : Dealul Piscului 1933/ Stereo 33
- <epsg31700> : Dealul Piscului 1970/ Stereo 70
- <epsg31838> : NGN / UTM zone 38N
- <epsg31839> : NGN / UTM zone 39N
- <epsg31900> : KUDAMS / KTM (deprecated)
- <epsg31901> : KUDAMS / KTM
- <epsg31965> : SIRGAS 2000 / UTM zone 11N
- <epsg31966> : SIRGAS 2000 / UTM zone 12N
- <epsg31967> : SIRGAS 2000 / UTM zone 13N
- <epsg31968> : SIRGAS 2000 / UTM zone 14N
- <epsg31969> : SIRGAS 2000 / UTM zone 15N
- <epsg31970> : SIRGAS 2000 / UTM zone 16N
- <epsg31971> : SIRGAS 2000 / UTM zone 17N
- <epsg31972> : SIRGAS 2000 / UTM zone 18N
- <epsg31973> : SIRGAS 2000 / UTM zone 19N
- <epsg31974> : SIRGAS 2000 / UTM zone 20N
- <epsg31975> : SIRGAS 2000 / UTM zone 21N
- <epsg31976> : SIRGAS 2000 / UTM zone 22N
- <epsg31977> : SIRGAS 2000 / UTM zone 17S
- <epsg31978> : SIRGAS 2000 / UTM zone 18S
- <epsg31979> : SIRGAS 2000 / UTM zone 19S
- <epsg31980> : SIRGAS 2000 / UTM zone 20S
- <epsg31981> : SIRGAS 2000 / UTM zone 21S
- <epsg31982> : SIRGAS 2000 / UTM zone 22S
- <epsg31983> : SIRGAS 2000 / UTM zone 23S
- <epsg31984> : SIRGAS 2000 / UTM zone 24S
- <epsg31985> : SIRGAS 2000 / UTM zone 25S
- <epsg31986> : SIRGAS / UTM zone 17N
- <epsg31987> : SIRGAS / UTM zone 18N
- <epsg31988> : SIRGAS / UTM zone 19N
- <epsg31989> : SIRGAS / UTM zone 20N
- <epsg31990> : SIRGAS / UTM zone 21N
- <epsg31991> : SIRGAS / UTM zone 22N
- <epsg31992> : SIRGAS / UTM zone 17S
- <epsg31993> : SIRGAS / UTM zone 18S
- <epsg31994> : SIRGAS / UTM zone 19S
- <epsg31995> : SIRGAS / UTM zone 20S
- <epsg31996> : SIRGAS / UTM zone 21S
- <epsg31997> : SIRGAS / UTM zone 22S
- <epsg31998> : SIRGAS / UTM zone 23S
- <epsg31999> : SIRGAS / UTM zone 24S
- <epsg32000> : SIRGAS / UTM zone 25S
- <epsg32001> : NAD27 / Montana North
- <epsg32002> : NAD27 / Montana Central
- <epsg32003> : NAD27 / Montana South
- <epsg32005> : NAD27 / Nebraska North
- <epsg32006> : NAD27 / Nebraska South
- <epsg32007> : NAD27 / Nevada East
- <epsg32008> : NAD27 / Nevada Central
- <epsg32009> : NAD27 / Nevada West
- <epsg32010> : NAD27 / New Hampshire
- <epsg32011> : NAD27 / New Jersey
- <epsg32012> : NAD27 / New Mexico East
- <epsg32013> : NAD27 / New Mexico Central
- <epsg32014> : NAD27 / New Mexico West
- <epsg32015> : NAD27 / New York East
- <epsg32016> : NAD27 / New York Central
- <epsg32017> : NAD27 / New York West
- <epsg32018> : NAD27 / New York Long Island
- <epsg32019> : NAD27 / North Carolina
- <epsg32020> : NAD27 / North Dakota North
- <epsg32021> : NAD27 / North Dakota South
- <epsg32022> : NAD27 / Ohio North
- <epsg32023> : NAD27 / Ohio South
- <epsg32024> : NAD27 / Oklahoma North
- <epsg32025> : NAD27 / Oklahoma South
- <epsg32026> : NAD27 / Oregon North
- <epsg32027> : NAD27 / Oregon South
- <epsg32028> : NAD27 / Pennsylvania North
- <epsg32029> : NAD27 / Pennsylvania South
- <epsg32030> : NAD27 / Rhode Island
- <epsg32031> : NAD27 / South Carolina North
- <epsg32033> : NAD27 / South Carolina South
- <epsg32034> : NAD27 / South Dakota North
- <epsg32035> : NAD27 / South Dakota South
- <epsg32036> : NAD27 / Tennessee (deprecated)
- <epsg32037> : NAD27 / Texas North
- <epsg32038> : NAD27 / Texas North Central
- <epsg32039> : NAD27 / Texas Central
- <epsg32040> : NAD27 / Texas South Central
- <epsg32041> : NAD27 / Texas South
- <epsg32042> : NAD27 / Utah North
- <epsg32043> : NAD27 / Utah Central
- <epsg32044> : NAD27 / Utah South
- <epsg32045> : NAD27 / Vermont
- <epsg32046> : NAD27 / Virginia North
- <epsg32047> : NAD27 / Virginia South
- <epsg32048> : NAD27 / Washington North
- <epsg32049> : NAD27 / Washington South
- <epsg32050> : NAD27 / West Virginia North
- <epsg32051> : NAD27 / West Virginia South
- <epsg32052> : NAD27 / Wisconsin North
- <epsg32053> : NAD27 / Wisconsin Central
- <epsg32054> : NAD27 / Wisconsin South
- <epsg32055> : NAD27 / Wyoming East
- <epsg32056> : NAD27 / Wyoming East Central
- <epsg32057> : NAD27 / Wyoming West Central
- <epsg32058> : NAD27 / Wyoming West
- <epsg32061> : NAD27 / Guatemala Norte
- <epsg32062> : NAD27 / Guatemala Sur
- <epsg32064> : NAD27 / BLM 14N (ftUS)
- <epsg32065> : NAD27 / BLM 15N (ftUS)
- <epsg32066> : NAD27 / BLM 16N (ftUS)
- <epsg32067> : NAD27 / BLM 17N (ftUS)
- <epsg32074> : NAD27 / BLM 14N (feet) (deprecated)
- <epsg32075> : NAD27 / BLM 15N (feet) (deprecated)
- <epsg32076> : NAD27 / BLM 16N (feet) (deprecated)
- <epsg32077> : NAD27 / BLM 17N (feet) (deprecated)
- <epsg32081> : NAD27 / MTM zone 1
- <epsg32082> : NAD27 / MTM zone 2
- <epsg32083> : NAD27 / MTM zone 3
- <epsg32084> : NAD27 / MTM zone 4
- <epsg32085> : NAD27 / MTM zone 5
- <epsg32086> : NAD27 / MTM zone 6
- <epsg32098> : NAD27 / Quebec Lambert
- <epsg32099> : NAD27 / Louisiana Offshore
- <epsg32100> : NAD83 / Montana
- <epsg32104> : NAD83 / Nebraska
- <epsg32107> : NAD83 / Nevada East
- <epsg32108> : NAD83 / Nevada Central
- <epsg32109> : NAD83 / Nevada West
- <epsg32110> : NAD83 / New Hampshire
- <epsg32111> : NAD83 / New Jersey
- <epsg32112> : NAD83 / New Mexico East
- <epsg32113> : NAD83 / New Mexico Central
- <epsg32114> : NAD83 / New Mexico West
- <epsg32115> : NAD83 / New York East
- <epsg32116> : NAD83 / New York Central
- <epsg32117> : NAD83 / New York West
- <epsg32118> : NAD83 / New York Long Island
- <epsg32119> : NAD83 / North Carolina
- <epsg32120> : NAD83 / North Dakota North
- <epsg32121> : NAD83 / North Dakota South
- <epsg32122> : NAD83 / Ohio North
- <epsg32123> : NAD83 / Ohio South
- <epsg32124> : NAD83 / Oklahoma North
- <epsg32125> : NAD83 / Oklahoma South
- <epsg32126> : NAD83 / Oregon North
- <epsg32127> : NAD83 / Oregon South
- <epsg32128> : NAD83 / Pennsylvania North
- <epsg32129> : NAD83 / Pennsylvania South
- <epsg32130> : NAD83 / Rhode Island
- <epsg32133> : NAD83 / South Carolina
- <epsg32134> : NAD83 / South Dakota North
- <epsg32135> : NAD83 / South Dakota South
- <epsg32136> : NAD83 / Tennessee
- <epsg32137> : NAD83 / Texas North
- <epsg32138> : NAD83 / Texas North Central
- <epsg32139> : NAD83 / Texas Central
- <epsg32140> : NAD83 / Texas South Central
- <epsg32141> : NAD83 / Texas South
- <epsg32142> : NAD83 / Utah North
- <epsg32143> : NAD83 / Utah Central
- <epsg32144> : NAD83 / Utah South
- <epsg32145> : NAD83 / Vermont
- <epsg32146> : NAD83 / Virginia North
- <epsg32147> : NAD83 / Virginia South
- <epsg32148> : NAD83 / Washington North
- <epsg32149> : NAD83 / Washington South
- <epsg32150> : NAD83 / West Virginia North
- <epsg32151> : NAD83 / West Virginia South
- <epsg32152> : NAD83 / Wisconsin North
- <epsg32153> : NAD83 / Wisconsin Central
- <epsg32154> : NAD83 / Wisconsin South
- <epsg32155> : NAD83 / Wyoming East
- <epsg32156> : NAD83 / Wyoming East Central
- <epsg32157> : NAD83 / Wyoming West Central
- <epsg32158> : NAD83 / Wyoming West
- <epsg32161> : NAD83 / Puerto Rico & Virgin Is.
- <epsg32164> : NAD83 / BLM 14N (ftUS)
- <epsg32165> : NAD83 / BLM 15N (ftUS)
- <epsg32166> : NAD83 / BLM 16N (ftUS)
- <epsg32167> : NAD83 / BLM 17N (ftUS)
- <epsg32180> : NAD83 / SCoPQ zone 2
- <epsg32181> : NAD83 / MTM zone 1
- <epsg32182> : NAD83 / MTM zone 2
- <epsg32183> : NAD83 / MTM zone 3
- <epsg32184> : NAD83 / MTM zone 4
- <epsg32185> : NAD83 / MTM zone 5
- <epsg32186> : NAD83 / MTM zone 6
- <epsg32187> : NAD83 / MTM zone 7
- <epsg32188> : NAD83 / MTM zone 8
- <epsg32189> : NAD83 / MTM zone 9
- <epsg32190> : NAD83 / MTM zone 10
- <epsg32191> : NAD83 / MTM zone 11
- <epsg32192> : NAD83 / MTM zone 12
- <epsg32193> : NAD83 / MTM zone 13
- <epsg32194> : NAD83 / MTM zone 14
- <epsg32195> : NAD83 / MTM zone 15
- <epsg32196> : NAD83 / MTM zone 16
- <epsg32197> : NAD83 / MTM zone 17
- <epsg32198> : NAD83 / Quebec Lambert
- <epsg32199> : NAD83 / Louisiana Offshore
- <epsg32201> : WGS 72 / UTM zone 1N
- <epsg32202> : WGS 72 / UTM zone 2N
- <epsg32203> : WGS 72 / UTM zone 3N
- <epsg32204> : WGS 72 / UTM zone 4N
- <epsg32205> : WGS 72 / UTM zone 5N
- <epsg32206> : WGS 72 / UTM zone 6N
- <epsg32207> : WGS 72 / UTM zone 7N
- <epsg32208> : WGS 72 / UTM zone 8N
- <epsg32209> : WGS 72 / UTM zone 9N
- <epsg32210> : WGS 72 / UTM zone 10N
- <epsg32211> : WGS 72 / UTM zone 11N
- <epsg32212> : WGS 72 / UTM zone 12N
- <epsg32213> : WGS 72 / UTM zone 13N
- <epsg32214> : WGS 72 / UTM zone 14N
- <epsg32215> : WGS 72 / UTM zone 15N
- <epsg32216> : WGS 72 / UTM zone 16N
- <epsg32217> : WGS 72 / UTM zone 17N
- <epsg32218> : WGS 72 / UTM zone 18N
- <epsg32219> : WGS 72 / UTM zone 19N
- <epsg32220> : WGS 72 / UTM zone 20N
- <epsg32221> : WGS 72 / UTM zone 21N
- <epsg32222> : WGS 72 / UTM zone 22N
- <epsg32223> : WGS 72 / UTM zone 23N
- <epsg32224> : WGS 72 / UTM zone 24N
- <epsg32225> : WGS 72 / UTM zone 25N
- <epsg32226> : WGS 72 / UTM zone 26N
- <epsg32227> : WGS 72 / UTM zone 27N
- <epsg32228> : WGS 72 / UTM zone 28N
- <epsg32229> : WGS 72 / UTM zone 29N
- <epsg32230> : WGS 72 / UTM zone 30N
- <epsg32231> : WGS 72 / UTM zone 31N
- <epsg32232> : WGS 72 / UTM zone 32N
- <epsg32233> : WGS 72 / UTM zone 33N
- <epsg32234> : WGS 72 / UTM zone 34N
- <epsg32235> : WGS 72 / UTM zone 35N
- <epsg32236> : WGS 72 / UTM zone 36N
- <epsg32237> : WGS 72 / UTM zone 37N
- <epsg32238> : WGS 72 / UTM zone 38N
- <epsg32239> : WGS 72 / UTM zone 39N
- <epsg32240> : WGS 72 / UTM zone 40N
- <epsg32241> : WGS 72 / UTM zone 41N
- <epsg32242> : WGS 72 / UTM zone 42N
- <epsg32243> : WGS 72 / UTM zone 43N
- <epsg32244> : WGS 72 / UTM zone 44N
- <epsg32245> : WGS 72 / UTM zone 45N
- <epsg32246> : WGS 72 / UTM zone 46N
- <epsg32247> : WGS 72 / UTM zone 47N
- <epsg32248> : WGS 72 / UTM zone 48N
- <epsg32249> : WGS 72 / UTM zone 49N
- <epsg32250> : WGS 72 / UTM zone 50N
- <epsg32251> : WGS 72 / UTM zone 51N
- <epsg32252> : WGS 72 / UTM zone 52N
- <epsg32253> : WGS 72 / UTM zone 53N
- <epsg32254> : WGS 72 / UTM zone 54N
- <epsg32255> : WGS 72 / UTM zone 55N
- <epsg32256> : WGS 72 / UTM zone 56N
- <epsg32257> : WGS 72 / UTM zone 57N
- <epsg32258> : WGS 72 / UTM zone 58N
- <epsg32259> : WGS 72 / UTM zone 59N
- <epsg32260> : WGS 72 / UTM zone 60N
- <epsg32301> : WGS 72 / UTM zone 1S
- <epsg32302> : WGS 72 / UTM zone 2S
- <epsg32303> : WGS 72 / UTM zone 3S
- <epsg32304> : WGS 72 / UTM zone 4S
- <epsg32305> : WGS 72 / UTM zone 5S
- <epsg32306> : WGS 72 / UTM zone 6S
- <epsg32307> : WGS 72 / UTM zone 7S
- <epsg32308> : WGS 72 / UTM zone 8S
- <epsg32309> : WGS 72 / UTM zone 9S
- <epsg32310> : WGS 72 / UTM zone 10S
- <epsg32311> : WGS 72 / UTM zone 11S
- <epsg32312> : WGS 72 / UTM zone 12S
- <epsg32313> : WGS 72 / UTM zone 13S
- <epsg32314> : WGS 72 / UTM zone 14S
- <epsg32315> : WGS 72 / UTM zone 15S
- <epsg32316> : WGS 72 / UTM zone 16S
- <epsg32317> : WGS 72 / UTM zone 17S
- <epsg32318> : WGS 72 / UTM zone 18S
- <epsg32319> : WGS 72 / UTM zone 19S
- <epsg32320> : WGS 72 / UTM zone 20S
- <epsg32321> : WGS 72 / UTM zone 21S
- <epsg32322> : WGS 72 / UTM zone 22S
- <epsg32323> : WGS 72 / UTM zone 23S
- <epsg32324> : WGS 72 / UTM zone 24S
- <epsg32325> : WGS 72 / UTM zone 25S
- <epsg32326> : WGS 72 / UTM zone 26S
- <epsg32327> : WGS 72 / UTM zone 27S
- <epsg32328> : WGS 72 / UTM zone 28S
- <epsg32329> : WGS 72 / UTM zone 29S
- <epsg32330> : WGS 72 / UTM zone 30S
- <epsg32331> : WGS 72 / UTM zone 31S
- <epsg32332> : WGS 72 / UTM zone 32S
- <epsg32333> : WGS 72 / UTM zone 33S
- <epsg32334> : WGS 72 / UTM zone 34S
- <epsg32335> : WGS 72 / UTM zone 35S
- <epsg32336> : WGS 72 / UTM zone 36S
- <epsg32337> : WGS 72 / UTM zone 37S
- <epsg32338> : WGS 72 / UTM zone 38S
- <epsg32339> : WGS 72 / UTM zone 39S
- <epsg32340> : WGS 72 / UTM zone 40S
- <epsg32341> : WGS 72 / UTM zone 41S
- <epsg32342> : WGS 72 / UTM zone 42S
- <epsg32343> : WGS 72 / UTM zone 43S
- <epsg32344> : WGS 72 / UTM zone 44S
- <epsg32345> : WGS 72 / UTM zone 45S
- <epsg32346> : WGS 72 / UTM zone 46S
- <epsg32347> : WGS 72 / UTM zone 47S
- <epsg32348> : WGS 72 / UTM zone 48S
- <epsg32349> : WGS 72 / UTM zone 49S
- <epsg32350> : WGS 72 / UTM zone 50S
- <epsg32351> : WGS 72 / UTM zone 51S
- <epsg32352> : WGS 72 / UTM zone 52S
- <epsg32353> : WGS 72 / UTM zone 53S
- <epsg32354> : WGS 72 / UTM zone 54S
- <epsg32355> : WGS 72 / UTM zone 55S
- <epsg32356> : WGS 72 / UTM zone 56S
- <epsg32357> : WGS 72 / UTM zone 57S
- <epsg32358> : WGS 72 / UTM zone 58S
- <epsg32359> : WGS 72 / UTM zone 59S
- <epsg32360> : WGS 72 / UTM zone 60S
- <epsg32401> : WGS 72BE / UTM zone 1N
- <epsg32402> : WGS 72BE / UTM zone 2N
- <epsg32403> : WGS 72BE / UTM zone 3N
- <epsg32404> : WGS 72BE / UTM zone 4N
- <epsg32405> : WGS 72BE / UTM zone 5N
- <epsg32406> : WGS 72BE / UTM zone 6N
- <epsg32407> : WGS 72BE / UTM zone 7N
- <epsg32408> : WGS 72BE / UTM zone 8N
- <epsg32409> : WGS 72BE / UTM zone 9N
- <epsg32410> : WGS 72BE / UTM zone 10N
- <epsg32411> : WGS 72BE / UTM zone 11N
- <epsg32412> : WGS 72BE / UTM zone 12N
- <epsg32413> : WGS 72BE / UTM zone 13N
- <epsg32414> : WGS 72BE / UTM zone 14N
- <epsg32415> : WGS 72BE / UTM zone 15N
- <epsg32416> : WGS 72BE / UTM zone 16N
- <epsg32417> : WGS 72BE / UTM zone 17N
- <epsg32418> : WGS 72BE / UTM zone 18N
- <epsg32419> : WGS 72BE / UTM zone 19N
- <epsg32420> : WGS 72BE / UTM zone 20N
- <epsg32421> : WGS 72BE / UTM zone 21N
- <epsg32422> : WGS 72BE / UTM zone 22N
- <epsg32423> : WGS 72BE / UTM zone 23N
- <epsg32424> : WGS 72BE / UTM zone 24N
- <epsg32425> : WGS 72BE / UTM zone 25N
- <epsg32426> : WGS 72BE / UTM zone 26N
- <epsg32427> : WGS 72BE / UTM zone 27N
- <epsg32428> : WGS 72BE / UTM zone 28N
- <epsg32429> : WGS 72BE / UTM zone 29N
- <epsg32430> : WGS 72BE / UTM zone 30N
- <epsg32431> : WGS 72BE / UTM zone 31N
- <epsg32432> : WGS 72BE / UTM zone 32N
- <epsg32433> : WGS 72BE / UTM zone 33N
- <epsg32434> : WGS 72BE / UTM zone 34N
- <epsg32435> : WGS 72BE / UTM zone 35N
- <epsg32436> : WGS 72BE / UTM zone 36N
- <epsg32437> : WGS 72BE / UTM zone 37N
- <epsg32438> : WGS 72BE / UTM zone 38N
- <epsg32439> : WGS 72BE / UTM zone 39N
- <epsg32440> : WGS 72BE / UTM zone 40N
- <epsg32441> : WGS 72BE / UTM zone 41N
- <epsg32442> : WGS 72BE / UTM zone 42N
- <epsg32443> : WGS 72BE / UTM zone 43N
- <epsg32444> : WGS 72BE / UTM zone 44N
- <epsg32445> : WGS 72BE / UTM zone 45N
- <epsg32446> : WGS 72BE / UTM zone 46N
- <epsg32447> : WGS 72BE / UTM zone 47N
- <epsg32448> : WGS 72BE / UTM zone 48N
- <epsg32449> : WGS 72BE / UTM zone 49N
- <epsg32450> : WGS 72BE / UTM zone 50N
- <epsg32451> : WGS 72BE / UTM zone 51N
- <epsg32452> : WGS 72BE / UTM zone 52N
- <epsg32453> : WGS 72BE / UTM zone 53N
- <epsg32454> : WGS 72BE / UTM zone 54N
- <epsg32455> : WGS 72BE / UTM zone 55N
- <epsg32456> : WGS 72BE / UTM zone 56N
- <epsg32457> : WGS 72BE / UTM zone 57N
- <epsg32458> : WGS 72BE / UTM zone 58N
- <epsg32459> : WGS 72BE / UTM zone 59N
- <epsg32460> : WGS 72BE / UTM zone 60N
- <epsg32501> : WGS 72BE / UTM zone 1S
- <epsg32502> : WGS 72BE / UTM zone 2S
- <epsg32503> : WGS 72BE / UTM zone 3S
- <epsg32504> : WGS 72BE / UTM zone 4S
- <epsg32505> : WGS 72BE / UTM zone 5S
- <epsg32506> : WGS 72BE / UTM zone 6S
- <epsg32507> : WGS 72BE / UTM zone 7S
- <epsg32508> : WGS 72BE / UTM zone 8S
- <epsg32509> : WGS 72BE / UTM zone 9S
- <epsg32510> : WGS 72BE / UTM zone 10S
- <epsg32511> : WGS 72BE / UTM zone 11S
- <epsg32512> : WGS 72BE / UTM zone 12S
- <epsg32513> : WGS 72BE / UTM zone 13S
- <epsg32514> : WGS 72BE / UTM zone 14S
- <epsg32515> : WGS 72BE / UTM zone 15S
- <epsg32516> : WGS 72BE / UTM zone 16S
- <epsg32517> : WGS 72BE / UTM zone 17S
- <epsg32518> : WGS 72BE / UTM zone 18S
- <epsg32519> : WGS 72BE / UTM zone 19S
- <epsg32520> : WGS 72BE / UTM zone 20S
- <epsg32521> : WGS 72BE / UTM zone 21S
- <epsg32522> : WGS 72BE / UTM zone 22S
- <epsg32523> : WGS 72BE / UTM zone 23S
- <epsg32524> : WGS 72BE / UTM zone 24S
- <epsg32525> : WGS 72BE / UTM zone 25S
- <epsg32526> : WGS 72BE / UTM zone 26S
- <epsg32527> : WGS 72BE / UTM zone 27S
- <epsg32528> : WGS 72BE / UTM zone 28S
- <epsg32529> : WGS 72BE / UTM zone 29S
- <epsg32530> : WGS 72BE / UTM zone 30S
- <epsg32531> : WGS 72BE / UTM zone 31S
- <epsg32532> : WGS 72BE / UTM zone 32S
- <epsg32533> : WGS 72BE / UTM zone 33S
- <epsg32534> : WGS 72BE / UTM zone 34S
- <epsg32535> : WGS 72BE / UTM zone 35S
- <epsg32536> : WGS 72BE / UTM zone 36S
- <epsg32537> : WGS 72BE / UTM zone 37S
- <epsg32538> : WGS 72BE / UTM zone 38S
- <epsg32539> : WGS 72BE / UTM zone 39S
- <epsg32540> : WGS 72BE / UTM zone 40S
- <epsg32541> : WGS 72BE / UTM zone 41S
- <epsg32542> : WGS 72BE / UTM zone 42S
- <epsg32543> : WGS 72BE / UTM zone 43S
- <epsg32544> : WGS 72BE / UTM zone 44S
- <epsg32545> : WGS 72BE / UTM zone 45S
- <epsg32546> : WGS 72BE / UTM zone 46S
- <epsg32547> : WGS 72BE / UTM zone 47S
- <epsg32548> : WGS 72BE / UTM zone 48S
- <epsg32549> : WGS 72BE / UTM zone 49S
- <epsg32550> : WGS 72BE / UTM zone 50S
- <epsg32551> : WGS 72BE / UTM zone 51S
- <epsg32552> : WGS 72BE / UTM zone 52S
- <epsg32553> : WGS 72BE / UTM zone 53S
- <epsg32554> : WGS 72BE / UTM zone 54S
- <epsg32555> : WGS 72BE / UTM zone 55S
- <epsg32556> : WGS 72BE / UTM zone 56S
- <epsg32557> : WGS 72BE / UTM zone 57S
- <epsg32558> : WGS 72BE / UTM zone 58S
- <epsg32559> : WGS 72BE / UTM zone 59S
- <epsg32560> : WGS 72BE / UTM zone 60S
- <epsg32601> : WGS 84 / UTM zone 1N
- <epsg32602> : WGS 84 / UTM zone 2N
- <epsg32603> : WGS 84 / UTM zone 3N
- <epsg32604> : WGS 84 / UTM zone 4N
- <epsg32605> : WGS 84 / UTM zone 5N
- <epsg32606> : WGS 84 / UTM zone 6N
- <epsg32607> : WGS 84 / UTM zone 7N
- <epsg32608> : WGS 84 / UTM zone 8N
- <epsg32609> : WGS 84 / UTM zone 9N
- <epsg32610> : WGS 84 / UTM zone 10N
- <epsg32611> : WGS 84 / UTM zone 11N
- <epsg32612> : WGS 84 / UTM zone 12N
- <epsg32613> : WGS 84 / UTM zone 13N
- <epsg32614> : WGS 84 / UTM zone 14N
- <epsg32615> : WGS 84 / UTM zone 15N
- <epsg32616> : WGS 84 / UTM zone 16N
- <epsg32617> : WGS 84 / UTM zone 17N
- <epsg32618> : WGS 84 / UTM zone 18N
- <epsg32619> : WGS 84 / UTM zone 19N
- <epsg32620> : WGS 84 / UTM zone 20N
- <epsg32621> : WGS 84 / UTM zone 21N
- <epsg32622> : WGS 84 / UTM zone 22N
- <epsg32623> : WGS 84 / UTM zone 23N
- <epsg32624> : WGS 84 / UTM zone 24N
- <epsg32625> : WGS 84 / UTM zone 25N
- <epsg32626> : WGS 84 / UTM zone 26N
- <epsg32627> : WGS 84 / UTM zone 27N
- <epsg32628> : WGS 84 / UTM zone 28N
- <epsg32629> : WGS 84 / UTM zone 29N
- <epsg32630> : WGS 84 / UTM zone 30N
- <epsg32631> : WGS 84 / UTM zone 31N
- <epsg32632> : WGS 84 / UTM zone 32N
- <epsg32633> : WGS 84 / UTM zone 33N
- <epsg32634> : WGS 84 / UTM zone 34N
- <epsg32635> : WGS 84 / UTM zone 35N
- <epsg32636> : WGS 84 / UTM zone 36N
- <epsg32637> : WGS 84 / UTM zone 37N
- <epsg32638> : WGS 84 / UTM zone 38N
- <epsg32639> : WGS 84 / UTM zone 39N
- <epsg32640> : WGS 84 / UTM zone 40N
- <epsg32641> : WGS 84 / UTM zone 41N
- <epsg32642> : WGS 84 / UTM zone 42N
- <epsg32643> : WGS 84 / UTM zone 43N
- <epsg32644> : WGS 84 / UTM zone 44N
- <epsg32645> : WGS 84 / UTM zone 45N
- <epsg32646> : WGS 84 / UTM zone 46N
- <epsg32647> : WGS 84 / UTM zone 47N
- <epsg32648> : WGS 84 / UTM zone 48N
- <epsg32649> : WGS 84 / UTM zone 49N
- <epsg32650> : WGS 84 / UTM zone 50N
- <epsg32651> : WGS 84 / UTM zone 51N
- <epsg32652> : WGS 84 / UTM zone 52N
- <epsg32653> : WGS 84 / UTM zone 53N
- <epsg32654> : WGS 84 / UTM zone 54N
- <epsg32655> : WGS 84 / UTM zone 55N
- <epsg32656> : WGS 84 / UTM zone 56N
- <epsg32657> : WGS 84 / UTM zone 57N
- <epsg32658> : WGS 84 / UTM zone 58N
- <epsg32659> : WGS 84 / UTM zone 59N
- <epsg32660> : WGS 84 / UTM zone 60N
- <epsg32661> : WGS 84 / UPS North
- <epsg32662> : WGS 84 / Plate Carree
- <epsg32664> : WGS 84 / BLM 14N (ftUS)
- <epsg32665> : WGS 84 / BLM 15N (ftUS)
- <epsg32666> : WGS 84 / BLM 16N (ftUS)
- <epsg32667> : WGS 84 / BLM 17N (ftUS)
- <epsg32701> : WGS 84 / UTM zone 1S
- <epsg32702> : WGS 84 / UTM zone 2S
- <epsg32703> : WGS 84 / UTM zone 3S
- <epsg32704> : WGS 84 / UTM zone 4S
- <epsg32705> : WGS 84 / UTM zone 5S
- <epsg32706> : WGS 84 / UTM zone 6S
- <epsg32707> : WGS 84 / UTM zone 7S
- <epsg32708> : WGS 84 / UTM zone 8S
- <epsg32709> : WGS 84 / UTM zone 9S
- <epsg32710> : WGS 84 / UTM zone 10S
- <epsg32711> : WGS 84 / UTM zone 11S
- <epsg32712> : WGS 84 / UTM zone 12S
- <epsg32713> : WGS 84 / UTM zone 13S
- <epsg32714> : WGS 84 / UTM zone 14S
- <epsg32715> : WGS 84 / UTM zone 15S
- <epsg32716> : WGS 84 / UTM zone 16S
- <epsg32717> : WGS 84 / UTM zone 17S
- <epsg32718> : WGS 84 / UTM zone 18S
- <epsg32719> : WGS 84 / UTM zone 19S
- <epsg32720> : WGS 84 / UTM zone 20S
- <epsg32721> : WGS 84 / UTM zone 21S
- <epsg32722> : WGS 84 / UTM zone 22S
- <epsg32723> : WGS 84 / UTM zone 23S
- <epsg32724> : WGS 84 / UTM zone 24S
- <epsg32725> : WGS 84 / UTM zone 25S
- <epsg32726> : WGS 84 / UTM zone 26S
- <epsg32727> : WGS 84 / UTM zone 27S
- <epsg32728> : WGS 84 / UTM zone 28S
- <epsg32729> : WGS 84 / UTM zone 29S
- <epsg32730> : WGS 84 / UTM zone 30S
- <epsg32731> : WGS 84 / UTM zone 31S
- <epsg32732> : WGS 84 / UTM zone 32S
- <epsg32733> : WGS 84 / UTM zone 33S
- <epsg32734> : WGS 84 / UTM zone 34S
- <epsg32735> : WGS 84 / UTM zone 35S
- <epsg32736> : WGS 84 / UTM zone 36S
- <epsg32737> : WGS 84 / UTM zone 37S
- <epsg32738> : WGS 84 / UTM zone 38S
- <epsg32739> : WGS 84 / UTM zone 39S
- <epsg32740> : WGS 84 / UTM zone 40S
- <epsg32741> : WGS 84 / UTM zone 41S
- <epsg32742> : WGS 84 / UTM zone 42S
- <epsg32743> : WGS 84 / UTM zone 43S
- <epsg32744> : WGS 84 / UTM zone 44S
- <epsg32745> : WGS 84 / UTM zone 45S
- <epsg32746> : WGS 84 / UTM zone 46S
- <epsg32747> : WGS 84 / UTM zone 47S
- <epsg32748> : WGS 84 / UTM zone 48S
- <epsg32749> : WGS 84 / UTM zone 49S
- <epsg32750> : WGS 84 / UTM zone 50S
- <epsg32751> : WGS 84 / UTM zone 51S
- <epsg32752> : WGS 84 / UTM zone 52S
- <epsg32753> : WGS 84 / UTM zone 53S
- <epsg32754> : WGS 84 / UTM zone 54S
- <epsg32755> : WGS 84 / UTM zone 55S
- <epsg32756> : WGS 84 / UTM zone 56S
- <epsg32757> : WGS 84 / UTM zone 57S
- <epsg32758> : WGS 84 / UTM zone 58S
- <epsg32759> : WGS 84 / UTM zone 59S
- <epsg32760> : WGS 84 / UTM zone 60S
- <epsg32761> : WGS 84 / UPS South
- <epsg32766> : WGS 84 / TM 36 SE
-
- \---------------------------------------------------------
- Additional EPSG-like projection definitions
- \---------------------------------------------------------
- OGC-defined extended codes  (41000--41999) see http://www.digitalearth.gov/wmt/auto.html
- \---------------------------------------------------------
- <epsg41001> : WGS84 / Simple Mercator
-
- \---------------------------------------------------------
- CubeWerx-defined extended codes  (42100--42199)
- \---------------------------------------------------------
- <epsg42101> : WGS 84 / LCC Canada
- <epsg42102> : NAD83 / BC Albers (this has been superceeded but is kept for compatibility)
- <epsg42103> : WGS 84 / LCC USA
- <epsg42103> : NAD83 / MTM zone 8 Québec
- <epsg42105> : WGS84 / Merc NorthAm
- <epsg42106> : WGS84 / Lambert Azim Mozambique
-
- \---------------------------------------------------------
- CubeWerx-customer definitions  (42300--42399)
- \---------------------------------------------------------
- <epsg42301> : NAD27 / Polar Stereographic / CM=\-98
- <epsg42302>JapanOrtho.09 09
- <epsg42303> : NAD83 / Albers NorthAm
- <epsg42304> : NAD83 / NRCan LCC Canada
- <epsg42305> : France_II
- <epsg42306> : NAD83/QC_LCC
- <epsg42307> : NAD83 / Texas Central \- feet
- <epsg42308> : NAD27 / California Albers
- <epsg42309> : NAD 83 / LCC Canada AVHRR-2
- <epsg42310> : WGS84+GRS80 / Mercator
- <epsg42311> : NAD83 / LCC Statcan
-
- \---------------------------------------------------------
- ESRI projection definitions
- \---------------------------------------------------------
- <esri2000> : Anguilla 1957 / British West Indies Grid
- <esri2001> : Antigua 1943 / British West Indies Grid
- <esri2002> : Dominica 1945 / British West Indies Grid
- <esri2003> : Grenada 1953 / British West Indies Grid
- <esri2004> : Montserrat 58 / British West Indies Grid
- <esri2005> : St Kitts 1955 / British West Indies Grid
- <esri2006> : St Lucia 1955 / British West Indies Grid
- <esri2007> : St Vincent 45 / British West Indies Grid
- <esri2008> : NAD27(CGQ77) / SCoPQ zone 2
- <esri2009> : NAD27(CGQ77) / SCoPQ zone 3
- <esri2010> : NAD27(CGQ77) / SCoPQ zone 4
- <esri2011> : NAD27(CGQ77) / SCoPQ zone 5
- <esri2012> : NAD27(CGQ77) / SCoPQ zone 6
- <esri2013> : NAD27(CGQ77) / SCoPQ zone 7
- <esri2014> : NAD27(CGQ77) / SCoPQ zone 8
- <esri2015> : NAD27(CGQ77) / SCoPQ zone 9
- <esri2016> : NAD27(CGQ77) / SCoPQ zone 10
- <esri2017> : NAD27(76) / MTM zone 8
- <esri2018> : NAD27(76) / MTM zone 9
- <esri2019> : NAD27(76) / MTM zone 10
- <esri2020> : NAD27(76) / MTM zone 11
- <esri2021> : NAD27(76) / MTM zone 12
- <esri2022> : NAD27(76) / MTM zone 13
- <esri2023> : NAD27(76) / MTM zone 14
- <esri2024> : NAD27(76) / MTM zone 15
- <esri2025> : NAD27(76) / MTM zone 16
- <esri2026> : NAD27(76) / MTM zone 17
- <esri2027> : NAD27(76) / UTM zone 15N
- <esri2028> : NAD27(76) / UTM zone 16N
- <esri2029> : NAD27(76) / UTM zone 17N
- <esri2030> : NAD27(76) / UTM zone 18N
- <esri2031> : NAD27(CGQ77) / UTM zone 17N
- <esri2032> : NAD27(CGQ77) / UTM zone 18N
- <esri2033> : NAD27(CGQ77) / UTM zone 19N
- <esri2034> : NAD27(CGQ77) / UTM zone 20N
- <esri2035> : NAD27(CGQ77) / UTM zone 21N
- <esri2036> : NAD83(CSRS98) / New Brunswick Stereo
- <esri2037> : NAD83(CSRS98) / UTM zone 19N
- <esri2038> : NAD83(CSRS98) / UTM zone 20N
- <esri2039> : Israel / Israeli TM Grid
- <esri2040> : Locodjo 1965 / UTM zone 30N
- <esri2041> : Abidjan 1987 / UTM zone 30N
- <esri2042> : Locodjo 1965 / UTM zone 29N
- <esri2043> : Abidjan 1987 / UTM zone 29N
- <esri2044> : Hanoi 1972 / Gauss-Kruger zone 18
- <esri2045> : Hanoi 1972 / Gauss-Kruger zone 19
- <esri2056> : CH1903+ / LV95
- <esri2057> : Rassadiran / Nakhl e Taqi
- <esri2058> : ED50(ED77) / UTM zone 38N
- <esri2059> : ED50(ED77) / UTM zone 39N
- <esri2060> : ED50(ED77) / UTM zone 40N
- <esri2061> : ED50(ED77) / UTM zone 41N
- <esri2062> : Madrid 1870 (Madrid) / Spain
- <esri2063> : Dabola 1981 / UTM zone 28N
- <esri2064> : Dabola 1981 / UTM zone 29N
- <esri2065> : S-JTSK (Ferro) / Krovak
- <esri2066> : Mount Dillon / Tobago Grid
- <esri2067> : Naparima 1955 / UTM zone 20N
- <esri2068> : ELD79 / Libya zone 5
- <esri2069> : ELD79 / Libya zone 6
- <esri2070> : ELD79 / Libya zone 7
- <esri2071> : ELD79 / Libya zone 8
- <esri2072> : ELD79 / Libya zone 9
- <esri2073> : ELD79 / Libya zone 10
- <esri2074> : ELD79 / Libya zone 11
- <esri2075> : ELD79 / Libya zone 12
- <esri2076> : ELD79 / Libya zone 13
- <esri2077> : ELD79 / UTM zone 32N
- <esri2078> : ELD79 / UTM zone 33N
- <esri2079> : ELD79 / UTM zone 34N
- <esri2080> : ELD79 / UTM zone 35N
- <esri2081> : Chos Malal 1914 / Argentina zone 2
- <esri2082> : Pampa del Castillo / Argentina zone 2
- <esri2083> : Hito XVIII 1963 / Argentina zone 2
- <esri2084> : Hito XVIII 1963 / UTM zone 19S
- <esri2085> : NAD27 / Cuba Norte
- <esri2086> : NAD27 / Cuba Sur
- <esri2087> : ELD79 / TM 12 NE
- <esri2088> : Carthage / TM 11 NE
- <esri2089> : Yemen NGN96 / UTM zone 38N
- <esri2090> : Yemen NGN96 / UTM zone 39N
- <esri2091> : South Yemen / Gauss Kruger zone 8
- <esri2092> : South Yemen / Gauss Kruger zone 9
- <esri2093> : Hanoi 1972 / GK 106 NE
- <esri2094> : WGS 72BE / TM 106 NE
- <esri2095> : Bissau / UTM zone 28N
- <esri2096> : Korean 1985 / Korea East Belt
- <esri2097> : Korean 1985 / Korea Central Belt
- <esri2098> : Korean 1985 / Korea West Belt
- <esri2099> : Qatar 1948 / Qatar Grid
- <esri2100> : GGRS87 / Greek Grid
- <esri2101> : Lake / Maracaibo Grid M1
- <esri2102> : Lake / Maracaibo Grid
- <esri2103> : Lake / Maracaibo Grid M3
- <esri2104> : Lake / Maracaibo La Rosa Grid
- <esri2105> : NZGD2000 / Mount Eden Circuit 2000
- <esri2106> : NZGD2000 / Bay of Plenty Circuit 2000
- <esri2107> : NZGD2000 / Poverty Bay Circuit 2000
- <esri2108> : NZGD2000 / Hawkes Bay Circuit 2000
- <esri2109> : NZGD2000 / Taranaki Circuit 2000
- <esri2110> : NZGD2000 / Tuhirangi Circuit 2000
- <esri2111> : NZGD2000 / Wanganui Circuit 2000
- <esri2112> : NZGD2000 / Wairarapa Circuit 2000
- <esri2113> : NZGD2000 / Wellington Circuit 2000
- <esri2114> : NZGD2000 / Collingwood Circuit 2000
- <esri2115> : NZGD2000 / Nelson Circuit 2000
- <esri2116> : NZGD2000 / Karamea Circuit 2000
- <esri2117> : NZGD2000 / Buller Circuit 2000
- <esri2118> : NZGD2000 / Grey Circuit 2000
- <esri2119> : NZGD2000 / Amuri Circuit 2000
- <esri2120> : NZGD2000 / Marlborough Circuit 2000
- <esri2121> : NZGD2000 / Hokitika Circuit 2000
- <esri2122> : NZGD2000 / Okarito Circuit 2000
- <esri2123> : NZGD2000 / Jacksons Bay Circuit 2000
- <esri2124> : NZGD2000 / Mount Pleasant Circuit 2000
- <esri2125> : NZGD2000 / Gawler Circuit 2000
- <esri2126> : NZGD2000 / Timaru Circuit 2000
- <esri2127> : NZGD2000 / Lindis Peak Circuit 2000
- <esri2128> : NZGD2000 / Mount Nicholas Circuit 2000
- <esri2129> : NZGD2000 / Mount York Circuit 2000
- <esri2130> : NZGD2000 / Observation Point Circuit 2000
- <esri2131> : NZGD2000 / North Taieri Circuit 2000
- <esri2132> : NZGD2000 / Bluff Circuit 2000
- <esri2133> : NZGD2000 / UTM zone 58S
- <esri2134> : NZGD2000 / UTM zone 59S
- <esri2135> : NZGD2000 / UTM zone 60S
- <esri2136> : Accra / Ghana National Grid
- <esri2137> : Accra / TM 1 NW
- <esri2138> : NAD27(CGQ77) / Quebec Lambert
- <esri2139> : NAD83(CSRS98) / SCoPQ zone 2
- <esri2140> : NAD83(CSRS98) / MTM zone 3
- <esri2141> : NAD83(CSRS98) / MTM zone 4
- <esri2142> : NAD83(CSRS98) / MTM zone 5
- <esri2143> : NAD83(CSRS98) / MTM zone 6
- <esri2144> : NAD83(CSRS98) / MTM zone 7
- <esri2145> : NAD83(CSRS98) / MTM zone 8
- <esri2146> : NAD83(CSRS98) / MTM zone 9
- <esri2147> : NAD83(CSRS98) / MTM zone 10
- <esri2148> : NAD83(CSRS98) / UTM zone 21N
- <esri2149> : NAD83(CSRS98) / UTM zone 18N
- <esri2150> : NAD83(CSRS98) / UTM zone 17N
- <esri2151> : NAD83(CSRS98) / UTM zone 13N
- <esri2152> : NAD83(CSRS98) / UTM zone 12N
- <esri2153> : NAD83(CSRS98) / UTM zone 11N
- <esri2154> : RGF93 / Lambert-93
- <esri2155> : American Samoa 1962 / American Samoa Lambert
- <esri2156> : NAD83(HARN) / UTM zone 59S
- <esri2157> : IRENET95 / Irish Transverse Mercator
- <esri2158> : IRENET95 / UTM zone 29N
- <esri2159> : Sierra Leone 1924 / New Colony Grid
- <esri2160> : Sierra Leone 1924 / New War Office Grid
- <esri2161> : Sierra Leone 1968 / UTM zone 28N
- <esri2162> : Sierra Leone 1968 / UTM zone 29N
- <esri2163> : US National Atlas Equal Area
- <esri2164> : Locodjo 1965 / TM 5 NW
- <esri2165> : Abidjan 1987 / TM 5 NW
- <esri2166> : Pulkovo 1942(83) / Gauss Kruger zone 3
- <esri2167> : Pulkovo 1942(83) / Gauss Kruger zone 4
- <esri2168> : Pulkovo 1942(83) / Gauss Kruger zone 5
- <esri2169> : Luxembourg 1930 / Gauss
- <esri2170> : MGI / Slovenia Grid
- <esri2171> : Pulkovo 1942(58) / Poland zone I
- <esri2172> : Pulkovo 1942(58) / Poland zone II
- <esri2173> : Pulkovo 1942(58) / Poland zone III
- <esri2174> : Pulkovo 1942(58) / Poland zone IV
- <esri2175> : Pulkovo 1942(58) / Poland zone V
- <esri2176> : ETRS89 / Poland CS2000 zone 5
- <esri2177> : ETRS89 / Poland CS2000 zone 6
- <esri2178> : ETRS89 / Poland CS2000 zone 7
- <esri2179> : ETRS89 / Poland CS2000 zone 8
- <esri2180> : ETRS89 / Poland CS92
- <esri2188> : Azores Occidental 1939 / UTM zone 25N
- <esri2189> : Azores Central 1948 / UTM zone 26N
- <esri2190> : Azores Oriental 1940 / UTM zone 26N
- <esri2191> : Madeira 1936 / UTM zone 28N
- <esri2192> : ED50 / France EuroLambert
- <esri2193> : NZGD2000 / New Zealand Transverse Mercator
- <esri2194> : American Samoa 1962 / American Samoa Lambert
- <esri2195> : NAD83(HARN) / UTM zone 2S
- <esri2196> : ETRS89 / Kp2000 Jutland
- <esri2197> : ETRS89 / Kp2000 Zealand
- <esri2198> : ETRS89 / Kp2000 Bornholm
- <esri2199> : Albanian 1987 / Gauss Kruger zone 4
- <esri2200> : ATS77 / New Brunswick Stereographic (ATS77)
- <esri2201> : REGVEN / UTM zone 18N
- <esri2202> : REGVEN / UTM zone 19N
- <esri2203> : REGVEN / UTM zone 20N
- <esri2204> : NAD27 / Tennessee
- <esri2205> : NAD83 / Kentucky North
- <esri2206> : ED50 / 3-degree Gauss-Kruger zone 9
- <esri2207> : ED50 / 3-degree Gauss-Kruger zone 10
- <esri2208> : ED50 / 3-degree Gauss-Kruger zone 11
- <esri2209> : ED50 / 3-degree Gauss-Kruger zone 12
- <esri2210> : ED50 / 3-degree Gauss-Kruger zone 13
- <esri2211> : ED50 / 3-degree Gauss-Kruger zone 14
- <esri2212> : ED50 / 3-degree Gauss-Kruger zone 15
- <esri2213> : ETRS89 / TM 30 NE
- <esri2214> : Douala 1948 / AOF west
- <esri2215> : Manoca 1962 / UTM zone 32N
- <esri2216> : Qornoq 1927 / UTM zone 22N
- <esri2217> : Qornoq 1927 / UTM zone 23N
- <esri2219> : ATS77 / UTM zone 19N
- <esri2220> : ATS77 / UTM zone 20N
- <esri2222> : NAD83 / Arizona East (ft)
- <esri2223> : NAD83 / Arizona Central (ft)
- <esri2224> : NAD83 / Arizona West (ft)
- <esri2225> : NAD83 / California zone 1 (ftUS)
- <esri2226> : NAD83 / California zone 2 (ftUS)
- <esri2227> : NAD83 / California zone 3 (ftUS)
- <esri2228> : NAD83 / California zone 4 (ftUS)
- <esri2229> : NAD83 / California zone 5 (ftUS)
- <esri2230> : NAD83 / California zone 6 (ftUS)
- <esri2231> : NAD83 / Colorado North (ftUS)
- <esri2232> : NAD83 / Colorado Central (ftUS)
- <esri2233> : NAD83 / Colorado South (ftUS)
- <esri2234> : NAD83 / Connecticut (ftUS)
- <esri2235> : NAD83 / Delaware (ftUS)
- <esri2236> : NAD83 / Florida East (ftUS)
- <esri2237> : NAD83 / Florida West (ftUS)
- <esri2238> : NAD83 / Florida North (ftUS)
- <esri2239> : NAD83 / Georgia East (ftUS)
- <esri2240> : NAD83 / Georgia West (ftUS)
- <esri2241> : NAD83 / Idaho East (ftUS)
- <esri2242> : NAD83 / Idaho Central (ftUS)
- <esri2243> : NAD83 / Idaho West (ftUS)
- <esri2244> : NAD83 / Indiana East (ftUS)
- <esri2245> : NAD83 / Indiana West (ftUS)
- <esri2246> : NAD83 / Kentucky North (ftUS)
- <esri2247> : NAD83 / Kentucky South (ftUS)
- <esri2248> : NAD83 / Maryland (ftUS)
- <esri2249> : NAD83 / Massachusetts Mainland (ftUS)
- <esri2250> : NAD83 / Massachusetts Island (ftUS)
- <esri2251> : NAD83 / Michigan North (ft)
- <esri2252> : NAD83 / Michigan Central (ft)
- <esri2253> : NAD83 / Michigan South (ft)
- <esri2254> : NAD83 / Mississippi East (ftUS)
- <esri2255> : NAD83 / Mississippi West (ftUS)
- <esri2256> : NAD83 / Montana (ft)
- <esri2257> : NAD83 / New Mexico East (ftUS)
- <esri2258> : NAD83 / New Mexico Central (ftUS)
- <esri2259> : NAD83 / New Mexico West (ftUS)
- <esri2260> : NAD83 / New York East (ftUS)
- <esri2261> : NAD83 / New York Central (ftUS)
- <esri2262> : NAD83 / New York West (ftUS)
- <esri2263> : NAD83 / New York Long Island (ftUS)
- <esri2264> : NAD83 / North Carolina (ftUS)
- <esri2265> : NAD83 / North Dakota North (ft)
- <esri2266> : NAD83 / North Dakota South (ft)
- <esri2267> : NAD83 / Oklahoma North (ftUS)
- <esri2268> : NAD83 / Oklahoma South (ftUS)
- <esri2269> : NAD83 / Oregon North (ft)
- <esri2270> : NAD83 / Oregon South (ft)
- <esri2271> : NAD83 / Pennsylvania North (ftUS)
- <esri2272> : NAD83 / Pennsylvania South (ftUS)
- <esri2273> : NAD83 / South Carolina (ft)
- <esri2274> : NAD83 / Tennessee (ftUS)
- <esri2275> : NAD83 / Texas North (ftUS)
- <esri2276> : NAD83 / Texas North Central (ftUS)
- <esri2277> : NAD83 / Texas Central (ftUS)
- <esri2278> : NAD83 / Texas South Central (ftUS)
- <esri2279> : NAD83 / Texas South (ftUS)
- <esri2280> : NAD83 / Utah North (ft)
- <esri2281> : NAD83 / Utah Central (ft)
- <esri2282> : NAD83 / Utah South (ft)
- <esri2283> : NAD83 / Virginia North (ftUS)
- <esri2284> : NAD83 / Virginia South (ftUS)
- <esri2285> : NAD83 / Washington North (ftUS)
- <esri2286> : NAD83 / Washington South (ftUS)
- <esri2287> : NAD83 / Wisconsin North (ftUS)
- <esri2288> : NAD83 / Wisconsin Central (ftUS)
- <esri2289> : NAD83 / Wisconsin South (ftUS)
- <esri2290> : ATS77 / Prince Edward Isl. Stereographic (ATS77)
- <esri2291> : NAD83(CSRS98) / Prince Edward Isl. Stereographic (NAD83)
- <esri2292> : NAD83(CSRS98) / Prince Edward Isl. Stereographic (NAD83)
- <esri2294> : ATS77 / MTM Nova Scotia zone 4
- <esri2295> : ATS77 / MTM Nova Scotia zone 5
- <esri2308> : Batavia / TM 109 SE
- <esri2309> : WGS 84 / TM 116 SE
- <esri2310> : WGS 84 / TM 132 SE
- <esri2311> : WGS 84 / TM 6 NE
- <esri2312> : Garoua / UTM zone 33N
- <esri2313> : Kousseri / UTM zone 33N
- <esri2314> : Trinidad 1903 / Trinidad Grid (ftCla)
- <esri2315> : Campo Inchauspe / UTM zone 19S
- <esri2316> : Campo Inchauspe / UTM zone 20S
- <esri2317> : PSAD56 / ICN Regional
- <esri2318> : Ain el Abd / Aramco Lambert
- <esri2319> : ED50 / TM27
- <esri2320> : ED50 / TM30
- <esri2321> : ED50 / TM33
- <esri2322> : ED50 / TM36
- <esri2323> : ED50 / TM39
- <esri2324> : ED50 / TM42
- <esri2325> : ED50 / TM45
- <esri2326> : Hong Kong 1980 Grid System
- <esri2327> : Xian 1980 / Gauss-Kruger zone 13
- <esri2328> : Xian 1980 / Gauss-Kruger zone 14
- <esri2329> : Xian 1980 / Gauss-Kruger zone 15
- <esri2330> : Xian 1980 / Gauss-Kruger zone 16
- <esri2331> : Xian 1980 / Gauss-Kruger zone 17
- <esri2332> : Xian 1980 / Gauss-Kruger zone 18
- <esri2333> : Xian 1980 / Gauss-Kruger zone 19
- <esri2334> : Xian 1980 / Gauss-Kruger zone 20
- <esri2335> : Xian 1980 / Gauss-Kruger zone 21
- <esri2336> : Xian 1980 / Gauss-Kruger zone 22
- <esri2337> : Xian 1980 / Gauss-Kruger zone 23
- <esri2338> : Xian 1980 / Gauss-Kruger CM 75E
- <esri2339> : Xian 1980 / Gauss-Kruger CM 81E
- <esri2340> : Xian 1980 / Gauss-Kruger CM 87E
- <esri2341> : Xian 1980 / Gauss-Kruger CM 93E
- <esri2342> : Xian 1980 / Gauss-Kruger CM 99E
- <esri2343> : Xian 1980 / Gauss-Kruger CM 105E
- <esri2344> : Xian 1980 / Gauss-Kruger CM 111E
- <esri2345> : Xian 1980 / Gauss-Kruger CM 117E
- <esri2346> : Xian 1980 / Gauss-Kruger CM 123E
- <esri2347> : Xian 1980 / Gauss-Kruger CM 129E
- <esri2348> : Xian 1980 / Gauss-Kruger CM 135E
- <esri2349> : Xian 1980 / 3-degree Gauss-Kruger zone 25
- <esri2350> : Xian 1980 / 3-degree Gauss-Kruger zone 26
- <esri2351> : Xian 1980 / 3-degree Gauss-Kruger zone 27
- <esri2352> : Xian 1980 / 3-degree Gauss-Kruger zone 28
- <esri2353> : Xian 1980 / 3-degree Gauss-Kruger zone 29
- <esri2354> : Xian 1980 / 3-degree Gauss-Kruger zone 30
- <esri2355> : Xian 1980 / 3-degree Gauss-Kruger zone 31
- <esri2356> : Xian 1980 / 3-degree Gauss-Kruger zone 32
- <esri2357> : Xian 1980 / 3-degree Gauss-Kruger zone 33
- <esri2358> : Xian 1980 / 3-degree Gauss-Kruger zone 34
- <esri2359> : Xian 1980 / 3-degree Gauss-Kruger zone 35
- <esri2360> : Xian 1980 / 3-degree Gauss-Kruger zone 36
- <esri2361> : Xian 1980 / 3-degree Gauss-Kruger zone 37
- <esri2362> : Xian 1980 / 3-degree Gauss-Kruger zone 38
- <esri2363> : Xian 1980 / 3-degree Gauss-Kruger zone 39
- <esri2364> : Xian 1980 / 3-degree Gauss-Kruger zone 40
- <esri2365> : Xian 1980 / 3-degree Gauss-Kruger zone 41
- <esri2366> : Xian 1980 / 3-degree Gauss-Kruger zone 42
- <esri2367> : Xian 1980 / 3-degree Gauss-Kruger zone 43
- <esri2368> : Xian 1980 / 3-degree Gauss-Kruger zone 44
- <esri2369> : Xian 1980 / 3-degree Gauss-Kruger zone 45
- <esri2370> : Xian 1980 / 3-degree Gauss-Kruger CM 75E
- <esri2371> : Xian 1980 / 3-degree Gauss-Kruger CM 78E
- <esri2372> : Xian 1980 / 3-degree Gauss-Kruger CM 81E
- <esri2373> : Xian 1980 / 3-degree Gauss-Kruger CM 84E
- <esri2374> : Xian 1980 / 3-degree Gauss-Kruger CM 87E
- <esri2375> : Xian 1980 / 3-degree Gauss-Kruger CM 90E
- <esri2376> : Xian 1980 / 3-degree Gauss-Kruger CM 93E
- <esri2377> : Xian 1980 / 3-degree Gauss-Kruger CM 96E
- <esri2378> : Xian 1980 / 3-degree Gauss-Kruger CM 99E
- <esri2379> : Xian 1980 / 3-degree Gauss-Kruger CM 102E
- <esri2380> : Xian 1980 / 3-degree Gauss-Kruger CM 105E
- <esri2381> : Xian 1980 / 3-degree Gauss-Kruger CM 108E
- <esri2382> : Xian 1980 / 3-degree Gauss-Kruger CM 111E
- <esri2383> : Xian 1980 / 3-degree Gauss-Kruger CM 114E
- <esri2384> : Xian 1980 / 3-degree Gauss-Kruger CM 117E
- <esri2385> : Xian 1980 / 3-degree Gauss-Kruger CM 120E
- <esri2386> : Xian 1980 / 3-degree Gauss-Kruger CM 123E
- <esri2387> : Xian 1980 / 3-degree Gauss-Kruger CM 126E
- <esri2388> : Xian 1980 / 3-degree Gauss-Kruger CM 129E
- <esri2389> : Xian 1980 / 3-degree Gauss-Kruger CM 132E
- <esri2390> : Xian 1980 / 3-degree Gauss-Kruger CM 135E
- <esri2391> : KKJ / Finland zone 1
- <esri2392> : KKJ / Finland zone 2
- <esri2393> : KKJ / Finland Uniform Coordinate System
- <esri2394> : KKJ / Finland zone 4
- <esri2395> : South Yemen / Gauss-Kruger zone 8
- <esri2396> : South Yemen / Gauss-Kruger zone 9
- <esri2397> : Pulkovo 1942(83) / Gauss-Kruger zone 3
- <esri2398> : Pulkovo 1942(83) / Gauss-Kruger zone 4
- <esri2399> : Pulkovo 1942(83) / Gauss-Kruger zone 5
- <esri2400> : RT90 2.5 gon W
- <esri2401> : Beijing 1954 / 3-degree Gauss-Kruger zone 25
- <esri2402> : Beijing 1954 / 3-degree Gauss-Kruger zone 26
- <esri2403> : Beijing 1954 / 3-degree Gauss-Kruger zone 27
- <esri2404> : Beijing 1954 / 3-degree Gauss-Kruger zone 28
- <esri2405> : Beijing 1954 / 3-degree Gauss-Kruger zone 29
- <esri2406> : Beijing 1954 / 3-degree Gauss-Kruger zone 30
- <esri2407> : Beijing 1954 / 3-degree Gauss-Kruger zone 31
- <esri2408> : Beijing 1954 / 3-degree Gauss-Kruger zone 32
- <esri2409> : Beijing 1954 / 3-degree Gauss-Kruger zone 33
- <esri2410> : Beijing 1954 / 3-degree Gauss-Kruger zone 34
- <esri2411> : Beijing 1954 / 3-degree Gauss-Kruger zone 35
- <esri2412> : Beijing 1954 / 3-degree Gauss-Kruger zone 36
- <esri2413> : Beijing 1954 / 3-degree Gauss-Kruger zone 37
- <esri2414> : Beijing 1954 / 3-degree Gauss-Kruger zone 38
- <esri2415> : Beijing 1954 / 3-degree Gauss-Kruger zone 39
- <esri2416> : Beijing 1954 / 3-degree Gauss-Kruger zone 40
- <esri2417> : Beijing 1954 / 3-degree Gauss-Kruger zone 41
- <esri2418> : Beijing 1954 / 3-degree Gauss-Kruger zone 42
- <esri2419> : Beijing 1954 / 3-degree Gauss-Kruger zone 43
- <esri2420> : Beijing 1954 / 3-degree Gauss-Kruger zone 44
- <esri2421> : Beijing 1954 / 3-degree Gauss-Kruger zone 45
- <esri2422> : Beijing 1954 / 3-degree Gauss-Kruger CM 75E
- <esri2423> : Beijing 1954 / 3-degree Gauss-Kruger CM 78E
- <esri2424> : Beijing 1954 / 3-degree Gauss-Kruger CM 81E
- <esri2425> : Beijing 1954 / 3-degree Gauss-Kruger CM 84E
- <esri2426> : Beijing 1954 / 3-degree Gauss-Kruger CM 87E
- <esri2427> : Beijing 1954 / 3-degree Gauss-Kruger CM 90E
- <esri2428> : Beijing 1954 / 3-degree Gauss-Kruger CM 93E
- <esri2429> : Beijing 1954 / 3-degree Gauss-Kruger CM 96E
- <esri2430> : Beijing 1954 / 3-degree Gauss-Kruger CM 99E
- <esri2431> : Beijing 1954 / 3-degree Gauss-Kruger CM 102E
- <esri2432> : Beijing 1954 / 3-degree Gauss-Kruger CM 105E
- <esri2433> : Beijing 1954 / 3-degree Gauss-Kruger CM 108E
- <esri2434> : Beijing 1954 / 3-degree Gauss-Kruger CM 111E
- <esri2435> : Beijing 1954 / 3-degree Gauss-Kruger CM 114E
- <esri2436> : Beijing 1954 / 3-degree Gauss-Kruger CM 117E
- <esri2437> : Beijing 1954 / 3-degree Gauss-Kruger CM 120E
- <esri2438> : Beijing 1954 / 3-degree Gauss-Kruger CM 123E
- <esri2439> : Beijing 1954 / 3-degree Gauss-Kruger CM 126E
- <esri2440> : Beijing 1954 / 3-degree Gauss-Kruger CM 129E
- <esri2441> : Beijing 1954 / 3-degree Gauss-Kruger CM 132E
- <esri2442> : Beijing 1954 / 3-degree Gauss-Kruger CM 135E
- <esri2443> : JGD2000 / Japan Plane Rectangular CS I
- <esri2444> : JGD2000 / Japan Plane Rectangular CS II
- <esri2445> : JGD2000 / Japan Plane Rectangular CS III
- <esri2446> : JGD2000 / Japan Plane Rectangular CS IV
- <esri2447> : JGD2000 / Japan Plane Rectangular CS V
- <esri2448> : JGD2000 / Japan Plane Rectangular CS VI
- <esri2449> : JGD2000 / Japan Plane Rectangular CS VII
- <esri2450> : JGD2000 / Japan Plane Rectangular CS VIII
- <esri2451> : JGD2000 / Japan Plane Rectangular CS IX
- <esri2452> : JGD2000 / Japan Plane Rectangular CS X
- <esri2453> : JGD2000 / Japan Plane Rectangular CS XI
- <esri2454> : JGD2000 / Japan Plane Rectangular CS XII
- <esri2455> : JGD2000 / Japan Plane Rectangular CS XIII
- <esri2456> : JGD2000 / Japan Plane Rectangular CS XIV
- <esri2457> : JGD2000 / Japan Plane Rectangular CS XV
- <esri2458> : JGD2000 / Japan Plane Rectangular CS XVI
- <esri2459> : JGD2000 / Japan Plane Rectangular CS XVII
- <esri2460> : JGD2000 / Japan Plane Rectangular CS XVIII
- <esri2461> : JGD2000 / Japan Plane Rectangular CS XIX
- <esri2462> : Albanian 1987 / Gauss-Kruger zone 4
- <esri2463> : Pulkovo 1995 / Gauss-Kruger CM 21E
- <esri2464> : Pulkovo 1995 / Gauss-Kruger CM 27E
- <esri2465> : Pulkovo 1995 / Gauss-Kruger CM 33E
- <esri2466> : Pulkovo 1995 / Gauss-Kruger CM 39E
- <esri2467> : Pulkovo 1995 / Gauss-Kruger CM 45E
- <esri2468> : Pulkovo 1995 / Gauss-Kruger CM 51E
- <esri2469> : Pulkovo 1995 / Gauss-Kruger CM 57E
- <esri2470> : Pulkovo 1995 / Gauss-Kruger CM 63E
- <esri2471> : Pulkovo 1995 / Gauss-Kruger CM 69E
- <esri2472> : Pulkovo 1995 / Gauss-Kruger CM 75E
- <esri2473> : Pulkovo 1995 / Gauss-Kruger CM 81E
- <esri2474> : Pulkovo 1995 / Gauss-Kruger CM 87E
- <esri2475> : Pulkovo 1995 / Gauss-Kruger CM 93E
- <esri2476> : Pulkovo 1995 / Gauss-Kruger CM 99E
- <esri2477> : Pulkovo 1995 / Gauss-Kruger CM 105E
- <esri2478> : Pulkovo 1995 / Gauss-Kruger CM 111E
- <esri2479> : Pulkovo 1995 / Gauss-Kruger CM 117E
- <esri2480> : Pulkovo 1995 / Gauss-Kruger CM 123E
- <esri2481> : Pulkovo 1995 / Gauss-Kruger CM 129E
- <esri2482> : Pulkovo 1995 / Gauss-Kruger CM 135E
- <esri2483> : Pulkovo 1995 / Gauss-Kruger CM 141E
- <esri2484> : Pulkovo 1995 / Gauss-Kruger CM 147E
- <esri2485> : Pulkovo 1995 / Gauss-Kruger CM 153E
- <esri2486> : Pulkovo 1995 / Gauss-Kruger CM 159E
- <esri2487> : Pulkovo 1995 / Gauss-Kruger CM 165E
- <esri2488> : Pulkovo 1995 / Gauss-Kruger CM 171E
- <esri2489> : Pulkovo 1995 / Gauss-Kruger CM 177E
- <esri2490> : Pulkovo 1995 / Gauss-Kruger CM 177W
- <esri2491> : Pulkovo 1995 / Gauss-Kruger CM 171W
- <esri2492> : Pulkovo 1942 / Gauss-Kruger CM 9E
- <esri2493> : Pulkovo 1942 / Gauss-Kruger CM 15E
- <esri2494> : Pulkovo 1942 / Gauss-Kruger CM 21E
- <esri2495> : Pulkovo 1942 / Gauss-Kruger CM 27E
- <esri2496> : Pulkovo 1942 / Gauss-Kruger CM 33E
- <esri2497> : Pulkovo 1942 / Gauss-Kruger CM 39E
- <esri2498> : Pulkovo 1942 / Gauss-Kruger CM 45E
- <esri2499> : Pulkovo 1942 / Gauss-Kruger CM 51E
- <esri2500> : Pulkovo 1942 / Gauss-Kruger CM 57E
- <esri2501> : Pulkovo 1942 / Gauss-Kruger CM 63E
- <esri2502> : Pulkovo 1942 / Gauss-Kruger CM 69E
- <esri2503> : Pulkovo 1942 / Gauss-Kruger CM 75E
- <esri2504> : Pulkovo 1942 / Gauss-Kruger CM 81E
- <esri2505> : Pulkovo 1942 / Gauss-Kruger CM 87E
- <esri2506> : Pulkovo 1942 / Gauss-Kruger CM 93E
- <esri2507> : Pulkovo 1942 / Gauss-Kruger CM 99E
- <esri2508> : Pulkovo 1942 / Gauss-Kruger CM 105E
- <esri2509> : Pulkovo 1942 / Gauss-Kruger CM 111E
- <esri2510> : Pulkovo 1942 / Gauss-Kruger CM 117E
- <esri2511> : Pulkovo 1942 / Gauss-Kruger CM 123E
- <esri2512> : Pulkovo 1942 / Gauss-Kruger CM 129E
- <esri2513> : Pulkovo 1942 / Gauss-Kruger CM 135E
- <esri2514> : Pulkovo 1942 / Gauss-Kruger CM 141E
- <esri2515> : Pulkovo 1942 / Gauss-Kruger CM 147E
- <esri2516> : Pulkovo 1942 / Gauss-Kruger CM 153E
- <esri2517> : Pulkovo 1942 / Gauss-Kruger CM 159E
- <esri2518> : Pulkovo 1942 / Gauss-Kruger CM 165E
- <esri2519> : Pulkovo 1942 / Gauss-Kruger CM 171E
- <esri2520> : Pulkovo 1942 / Gauss-Kruger CM 177E
- <esri2521> : Pulkovo 1942 / Gauss-Kruger CM 177W
- <esri2522> : Pulkovo 1942 / Gauss-Kruger CM 171W
- <esri2523> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 7
- <esri2524> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 8
- <esri2525> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 9
- <esri2526> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 10
- <esri2527> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 11
- <esri2528> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 12
- <esri2529> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 13
- <esri2530> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 14
- <esri2531> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 15
- <esri2532> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 16
- <esri2533> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 17
- <esri2534> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 18
- <esri2535> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 19
- <esri2536> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 20
- <esri2537> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 21
- <esri2538> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 22
- <esri2539> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 23
- <esri2540> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 24
- <esri2541> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 25
- <esri2542> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 26
- <esri2543> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 27
- <esri2544> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 28
- <esri2545> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 29
- <esri2546> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 30
- <esri2547> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 31
- <esri2548> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 32
- <esri2549> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 33
- <esri2550> : Samboja / UTM zone 50S
- <esri2551> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 34
- <esri2552> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 35
- <esri2553> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 36
- <esri2554> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 37
- <esri2555> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 38
- <esri2556> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 39
- <esri2557> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 40
- <esri2558> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 41
- <esri2559> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 42
- <esri2560> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 43
- <esri2561> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 44
- <esri2562> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 45
- <esri2563> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 46
- <esri2564> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 47
- <esri2565> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 48
- <esri2566> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 49
- <esri2567> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 50
- <esri2568> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 51
- <esri2569> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 52
- <esri2570> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 53
- <esri2571> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 54
- <esri2572> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 55
- <esri2573> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 56
- <esri2574> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 57
- <esri2575> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 58
- <esri2576> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 59
- <esri2577> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 60
- <esri2578> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 61
- <esri2579> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 62
- <esri2580> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 63
- <esri2581> : Pulkovo 1942 / 3-degree Gauss-Kruger zone 64
- <esri2582> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 21E
- <esri2583> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 24E
- <esri2584> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 27E
- <esri2585> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 30E
- <esri2586> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 33E
- <esri2587> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 36E
- <esri2588> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 39E
- <esri2589> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 42E
- <esri2590> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 45E
- <esri2591> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 48E
- <esri2592> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 51E
- <esri2593> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 54E
- <esri2594> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 57E
- <esri2595> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 60E
- <esri2596> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 63E
- <esri2597> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 66E
- <esri2598> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 69E
- <esri2599> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 72E
- <esri2600> : Lietuvos Koordinoei Sistema 1994
- <esri2601> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 75E
- <esri2602> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 78E
- <esri2603> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 81E
- <esri2604> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 84E
- <esri2605> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 87E
- <esri2606> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 90E
- <esri2607> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 93E
- <esri2608> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 96E
- <esri2609> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 99E
- <esri2610> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 102E
- <esri2611> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 105E
- <esri2612> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 108E
- <esri2613> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 111E
- <esri2614> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 114E
- <esri2615> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 117E
- <esri2616> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 120E
- <esri2617> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 123E
- <esri2618> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 126E
- <esri2619> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 129E
- <esri2620> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 132E
- <esri2621> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 135E
- <esri2622> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 138E
- <esri2623> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 141E
- <esri2624> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 144E
- <esri2625> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 147E
- <esri2626> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 150E
- <esri2627> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 153E
- <esri2628> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 156E
- <esri2629> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 159E
- <esri2630> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 162E
- <esri2631> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 165E
- <esri2632> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 168E
- <esri2633> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 171E
- <esri2634> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 174E
- <esri2635> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 177E
- <esri2636> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 180E
- <esri2637> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 177W
- <esri2638> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 174W
- <esri2639> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 171W
- <esri2640> : Pulkovo 1942 / 3-degree Gauss-Kruger CM 168W
- <esri2641> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 7
- <esri2642> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 8
- <esri2643> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 9
- <esri2644> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 10
- <esri2645> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 11
- <esri2646> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 12
- <esri2647> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 13
- <esri2648> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 14
- <esri2649> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 15
- <esri2650> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 16
- <esri2651> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 17
- <esri2652> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 18
- <esri2653> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 19
- <esri2654> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 20
- <esri2655> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 21
- <esri2656> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 22
- <esri2657> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 23
- <esri2658> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 24
- <esri2659> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 25
- <esri2660> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 26
- <esri2661> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 27
- <esri2662> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 28
- <esri2663> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 29
- <esri2664> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 30
- <esri2665> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 31
- <esri2666> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 32
- <esri2667> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 33
- <esri2668> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 34
- <esri2669> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 35
- <esri2670> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 36
- <esri2671> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 37
- <esri2672> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 38
- <esri2673> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 39
- <esri2674> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 40
- <esri2675> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 41
- <esri2676> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 42
- <esri2677> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 43
- <esri2678> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 44
- <esri2679> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 45
- <esri2680> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 46
- <esri2681> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 47
- <esri2682> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 48
- <esri2683> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 49
- <esri2684> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 50
- <esri2685> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 51
- <esri2686> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 52
- <esri2687> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 53
- <esri2688> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 54
- <esri2689> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 55
- <esri2690> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 56
- <esri2691> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 57
- <esri2692> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 58
- <esri2693> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 59
- <esri2694> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 60
- <esri2695> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 61
- <esri2696> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 62
- <esri2697> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 63
- <esri2698> : Pulkovo 1995 / 3-degree Gauss-Kruger zone 64
- <esri2699> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 21E
- <esri2700> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 24E
- <esri2701> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 27E
- <esri2702> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 30E
- <esri2703> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 33E
- <esri2704> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 36E
- <esri2705> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 39E
- <esri2706> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 42E
- <esri2707> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 45E
- <esri2708> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 48E
- <esri2709> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 51E
- <esri2710> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 54E
- <esri2711> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 57E
- <esri2712> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 60E
- <esri2713> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 63E
- <esri2714> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 66E
- <esri2715> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 69E
- <esri2716> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 72E
- <esri2717> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 75E
- <esri2718> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 78E
- <esri2719> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 81E
- <esri2720> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 84E
- <esri2721> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 87E
- <esri2722> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 90E
- <esri2723> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 93E
- <esri2724> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 96E
- <esri2725> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 99E
- <esri2726> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 102E
- <esri2727> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 105E
- <esri2728> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 108E
- <esri2729> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 111E
- <esri2730> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 114E
- <esri2731> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 117E
- <esri2732> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 120E
- <esri2733> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 123E
- <esri2734> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 126E
- <esri2735> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 129E
- <esri2736> : Tete / UTM zone 36S
- <esri2737> : Tete / UTM zone 37S
- <esri2738> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 132E
- <esri2739> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 135E
- <esri2740> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 138E
- <esri2741> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 141E
- <esri2742> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 144E
- <esri2743> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 147E
- <esri2744> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 150E
- <esri2745> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 153E
- <esri2746> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 156E
- <esri2747> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 159E
- <esri2748> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 162E
- <esri2749> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 165E
- <esri2750> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 168E
- <esri2751> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 171E
- <esri2752> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 174E
- <esri2753> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 177E
- <esri2754> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 180E
- <esri2755> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 177W
- <esri2756> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 174W
- <esri2757> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 171W
- <esri2758> : Pulkovo 1995 / 3-degree Gauss-Kruger CM 168W
- <esri2759> : NAD83(HARN) / Alabama East
- <esri2760> : NAD83(HARN) / Alabama West
- <esri2761> : NAD83(HARN) / Arizona East
- <esri2762> : NAD83(HARN) / Arizona Central
- <esri2763> : NAD83(HARN) / Arizona West
- <esri2764> : NAD83(HARN) / Arkansas North
- <esri2765> : NAD83(HARN) / Arkansas South
- <esri2766> : NAD83(HARN) / California zone 1
- <esri2767> : NAD83(HARN) / California zone 2
- <esri2768> : NAD83(HARN) / California zone 3
- <esri2769> : NAD83(HARN) / California zone 4
- <esri2770> : NAD83(HARN) / California zone 5
- <esri2771> : NAD83(HARN) / California zone 6
- <esri2772> : NAD83(HARN) / Colorado North
- <esri2773> : NAD83(HARN) / Colorado Central
- <esri2774> : NAD83(HARN) / Colorado South
- <esri2775> : NAD83(HARN) / Connecticut
- <esri2776> : NAD83(HARN) / Delaware
- <esri2777> : NAD83(HARN) / Florida East
- <esri2778> : NAD83(HARN) / Florida West
- <esri2779> : NAD83(HARN) / Florida North
- <esri2780> : NAD83(HARN) / Georgia East
- <esri2781> : NAD83(HARN) / Georgia West
- <esri2782> : NAD83(HARN) / Hawaii zone 1
- <esri2783> : NAD83(HARN) / Hawaii zone 2
- <esri2784> : NAD83(HARN) / Hawaii zone 3
- <esri2785> : NAD83(HARN) / Hawaii zone 4
- <esri2786> : NAD83(HARN) / Hawaii zone 5
- <esri2787> : NAD83(HARN) / Idaho East
- <esri2788> : NAD83(HARN) / Idaho Central
- <esri2789> : NAD83(HARN) / Idaho West
- <esri2790> : NAD83(HARN) / Illinois East
- <esri2791> : NAD83(HARN) / Illinois West
- <esri2792> : NAD83(HARN) / Indiana East
- <esri2793> : NAD83(HARN) / Indiana West
- <esri2794> : NAD83(HARN) / Iowa North
- <esri2795> : NAD83(HARN) / Iowa South
- <esri2796> : NAD83(HARN) / Kansas North
- <esri2797> : NAD83(HARN) / Kansas South
- <esri2798> : NAD83(HARN) / Kentucky North
- <esri2799> : NAD83(HARN) / Kentucky South
- <esri2800> : NAD83(HARN) / Louisiana North
- <esri2801> : NAD83(HARN) / Louisiana South
- <esri2802> : NAD83(HARN) / Maine East
- <esri2803> : NAD83(HARN) / Maine West
- <esri2804> : NAD83(HARN) / Maryland
- <esri2805> : NAD83(HARN) / Massachusetts Mainland
- <esri2806> : NAD83(HARN) / Massachusetts Island
- <esri2807> : NAD83(HARN) / Michigan North
- <esri2808> : NAD83(HARN) / Michigan Central
- <esri2809> : NAD83(HARN) / Michigan South
- <esri2810> : NAD83(HARN) / Minnesota North
- <esri2811> : NAD83(HARN) / Minnesota Central
- <esri2812> : NAD83(HARN) / Minnesota South
- <esri2813> : NAD83(HARN) / Mississippi East
- <esri2814> : NAD83(HARN) / Mississippi West
- <esri2815> : NAD83(HARN) / Missouri East
- <esri2816> : NAD83(HARN) / Missouri Central
- <esri2817> : NAD83(HARN) / Missouri West
- <esri2818> : NAD83(HARN) / Montana
- <esri2819> : NAD83(HARN) / Nebraska
- <esri2820> : NAD83(HARN) / Nevada East
- <esri2821> : NAD83(HARN) / Nevada Central
- <esri2822> : NAD83(HARN) / Nevada West
- <esri2823> : NAD83(HARN) / New Hampshire
- <esri2824> : NAD83(HARN) / New Jersey
- <esri2825> : NAD83(HARN) / New Mexico East
- <esri2826> : NAD83(HARN) / New Mexico Central
- <esri2827> : NAD83(HARN) / New Mexico West
- <esri2828> : NAD83(HARN) / New York East
- <esri2829> : NAD83(HARN) / New York Central
- <esri2830> : NAD83(HARN) / New York West
- <esri2831> : NAD83(HARN) / New York Long Island
- <esri2832> : NAD83(HARN) / North Dakota North
- <esri2833> : NAD83(HARN) / North Dakota South
- <esri2834> : NAD83(HARN) / Ohio North
- <esri2835> : NAD83(HARN) / Ohio South
- <esri2836> : NAD83(HARN) / Oklahoma North
- <esri2837> : NAD83(HARN) / Oklahoma South
- <esri2838> : NAD83(HARN) / Oregon North
- <esri2839> : NAD83(HARN) / Oregon South
- <esri2840> : NAD83(HARN) / Rhode Island
- <esri2841> : NAD83(HARN) / South Dakota North
- <esri2842> : NAD83(HARN) / South Dakota South
- <esri2843> : NAD83(HARN) / Tennessee
- <esri2844> : NAD83(HARN) / Texas North
- <esri2845> : NAD83(HARN) / Texas North Central
- <esri2846> : NAD83(HARN) / Texas Central
- <esri2847> : NAD83(HARN) / Texas South Central
- <esri2848> : NAD83(HARN) / Texas South
- <esri2849> : NAD83(HARN) / Utah North
- <esri2850> : NAD83(HARN) / Utah Central
- <esri2851> : NAD83(HARN) / Utah South
- <esri2852> : NAD83(HARN) / Vermont
- <esri2853> : NAD83(HARN) / Virginia North
- <esri2854> : NAD83(HARN) / Virginia South
- <esri2855> : NAD83(HARN) / Washington North
- <esri2856> : NAD83(HARN) / Washington South
- <esri2857> : NAD83(HARN) / West Virginia North
- <esri2858> : NAD83(HARN) / West Virginia South
- <esri2859> : NAD83(HARN) / Wisconsin North
- <esri2860> : NAD83(HARN) / Wisconsin Central
- <esri2861> : NAD83(HARN) / Wisconsin South
- <esri2862> : NAD83(HARN) / Wyoming East
- <esri2863> : NAD83(HARN) / Wyoming East Central
- <esri2864> : NAD83(HARN) / Wyoming West Central
- <esri2865> : NAD83(HARN) / Wyoming West
- <esri2866> : NAD83(HARN) / Puerto Rico & Virgin Is.
- <esri2867> : NAD83(HARN) / Arizona East (ft)
- <esri2868> : NAD83(HARN) / Arizona Central (ft)
- <esri2869> : NAD83(HARN) / Arizona West (ft)
- <esri2870> : NAD83(HARN) / California zone 1 (ftUS)
- <esri2871> : NAD83(HARN) / California zone 2 (ftUS)
- <esri2872> : NAD83(HARN) / California zone 3 (ftUS)
- <esri2873> : NAD83(HARN) / California zone 4 (ftUS)
- <esri2874> : NAD83(HARN) / California zone 5 (ftUS)
- <esri2875> : NAD83(HARN) / California zone 6 (ftUS)
- <esri2876> : NAD83(HARN) / Colorado North (ftUS)
- <esri2877> : NAD83(HARN) / Colorado Central (ftUS)
- <esri2878> : NAD83(HARN) / Colorado South (ftUS)
- <esri2879> : NAD83(HARN) / Connecticut (ftUS)
- <esri2880> : NAD83(HARN) / Delaware (ftUS)
- <esri2881> : NAD83(HARN) / Florida East (ftUS)
- <esri2882> : NAD83(HARN) / Florida West (ftUS)
- <esri2883> : NAD83(HARN) / Florida North (ftUS)
- <esri2884> : NAD83(HARN) / Georgia East (ftUS)
- <esri2885> : NAD83(HARN) / Georgia West (ftUS)
- <esri2886> : NAD83(HARN) / Idaho East (ftUS)
- <esri2887> : NAD83(HARN) / Idaho Central (ftUS)
- <esri2888> : NAD83(HARN) / Idaho West (ftUS)
- <esri2889> : NAD83(HARN) / Indiana East (ftUS)
- <esri2890> : NAD83(HARN) / Indiana West (ftUS)
- <esri2891> : NAD83(HARN) / Kentucky North (ftUS)
- <esri2892> : NAD83(HARN) / Kentucky South (ftUS)
- <esri2893> : NAD83(HARN) / Maryland (ftUS)
- <esri2894> : NAD83(HARN) / Massachusetts Mainland (ftUS)
- <esri2895> : NAD83(HARN) / Massachusetts Island (ftUS)
- <esri2896> : NAD83(HARN) / Michigan North (ft)
- <esri2897> : NAD83(HARN) / Michigan Central (ft)
- <esri2898> : NAD83(HARN) / Michigan South (ft)
- <esri2899> : NAD83(HARN) / Mississippi East (ftUS)
- <esri2900> : NAD83(HARN) / Mississippi West (ftUS)
- <esri2901> : NAD83(HARN) / Montana (ft)
- <esri2902> : NAD83(HARN) / New Mexico East (ftUS)
- <esri2903> : NAD83(HARN) / New Mexico Central (ftUS)
- <esri2904> : NAD83(HARN) / New Mexico West (ftUS)
- <esri2905> : NAD83(HARN) / New York East (ftUS)
- <esri2906> : NAD83(HARN) / New York Central (ftUS)
- <esri2907> : NAD83(HARN) / New York West (ftUS)
- <esri2908> : NAD83(HARN) / New York Long Island (ftUS)
- <esri2909> : NAD83(HARN) / North Dakota North (ft)
- <esri2910> : NAD83(HARN) / North Dakota South (ft)
- <esri2911> : NAD83(HARN) / Oklahoma North (ftUS)
- <esri2912> : NAD83(HARN) / Oklahoma South (ftUS)
- <esri2913> : NAD83(HARN) / Oregon North (ft)
- <esri2914> : NAD83(HARN) / Oregon South (ft)
- <esri2915> : NAD83(HARN) / Tennessee (ftUS)
- <esri2916> : NAD83(HARN) / Texas North (ftUS)
- <esri2917> : NAD83(HARN) / Texas North Central (ftUS)
- <esri2918> : NAD83(HARN) / Texas Central (ftUS)
- <esri2919> : NAD83(HARN) / Texas South Central (ftUS)
- <esri2920> : NAD83(HARN) / Texas South (ftUS)
- <esri2921> : NAD83(HARN) / Utah North (ft)
- <esri2922> : NAD83(HARN) / Utah Central (ft)
- <esri2923> : NAD83(HARN) / Utah South (ft)
- <esri2924> : NAD83(HARN) / Virginia North (ftUS)
- <esri2925> : NAD83(HARN) / Virginia South (ftUS)
- <esri2926> : NAD83(HARN) / Washington North (ftUS)
- <esri2927> : NAD83(HARN) / Washington South (ftUS)
- <esri2928> : NAD83(HARN) / Wisconsin North (ftUS)
- <esri2929> : NAD83(HARN) / Wisconsin Central (ftUS)
- <esri2930> : NAD83(HARN) / Wisconsin South (ftUS)
- <esri2931> : Beduaram / TM 13 NE
- <esri2932> : QND95 / Qatar National Grid
- <esri2933> : Segara / UTM zone 50S
- <esri2934> : Segara (Jakarta) / NEIEZ
- <esri2935> : Pulkovo 1942 / CS63 zone A1
- <esri2936> : Pulkovo 1942 / CS63 zone A2
- <esri2937> : Pulkovo 1942 / CS63 zone A3
- <esri2938> : Pulkovo 1942 / CS63 zone A4
- <esri2939> : Pulkovo 1942 / CS63 zone K2
- <esri2940> : Pulkovo 1942 / CS63 zone K3
- <esri2941> : Pulkovo 1942 / CS63 zone K4
- <esri2942> : Porto Santo / UTM zone 28N
- <esri2943> : Selvagem Grande / UTM zone 28N
- <esri2944> : NAD83(CSRS) / SCoPQ zone 2
- <esri2945> : NAD83(CSRS) / MTM zone 3
- <esri2946> : NAD83(CSRS) / MTM zone 4
- <esri2947> : NAD83(CSRS) / MTM zone 5
- <esri2948> : NAD83(CSRS) / MTM zone 6
- <esri2949> : NAD83(CSRS) / MTM zone 7
- <esri2950> : NAD83(CSRS) / MTM zone 8
- <esri2951> : NAD83(CSRS) / MTM zone 9
- <esri2952> : NAD83(CSRS) / MTM zone 10
- <esri2953> : NAD83(CSRS) / New Brunswick Stereo
- <esri2954> : NAD83(CSRS) / Prince Edward Isl. Stereographic (NAD83)
- <esri2955> : NAD83(CSRS) / UTM zone 11N
- <esri2956> : NAD83(CSRS) / UTM zone 12N
- <esri2957> : NAD83(CSRS) / UTM zone 13N
- <esri2958> : NAD83(CSRS) / UTM zone 17N
- <esri2959> : NAD83(CSRS) / UTM zone 18N
- <esri2960> : NAD83(CSRS) / UTM zone 19N
- <esri2961> : NAD83(CSRS) / UTM zone 20N
- <esri2962> : NAD83(CSRS) / UTM zone 21N
- <esri3036> : Moznet / UTM zone 36S
- <esri3037> : Moznet / UTM zone 37S
- <esri3148> : Indian 1960 / UTM zone 48N
- <esri3149> : Indian 1960 / UTM zone 49N
- <esri3176> : Indian 1960 / TM 106 NE
- <esri3200> : FD58 / Iraq zone
- <esri3300> : Estonian Coordinate System of 1992
- <esri3301> : Estonian Coordinate System of 1997
- <esri3439> : PSD93 / UTM zone 39N
- <esri3440> : PSD93 / UTM zone 40N
- <esri3561> : Old Hawaiian / Hawaii zone 1
- <esri3562> : Old Hawaiian / Hawaii zone 2
- <esri3563> : Old Hawaiian / Hawaii zone 3
- <esri3564> : Old Hawaiian / Hawaii zone 4
- <esri3565> : Old Hawaiian / Hawaii zone 5
- <esri3920> : Puerto Rico / UTM zone 20N
- <esri3991> : Puerto Rico State Plane CS of 1927
- <esri3992> : Puerto Rico / St. Croix
- <esri4001> : Unknown datum based upon the Airy 1830 ellipsoid
- <esri4002> : Unknown datum based upon the Airy Modified 1849 ellipsoid
- <esri4003> : Unknown datum based upon the Australian National Spheroid
- <esri4004> : Unknown datum based upon the Bessel 1841 ellipsoid
- <esri4005> : Unknown datum based upon the Bessel Modified ellipsoid
- <esri4006> : Unknown datum based upon the Bessel Namibia ellipsoid
- <esri4007> : Unknown datum based upon the Clarke 1858 ellipsoid
- <esri4008> : Unknown datum based upon the Clarke 1866 ellipsoid
- <esri4009> : Unknown datum based upon the Clarke 1866 Michigan ellipsoid
- <esri4010> : Unknown datum based upon the Clarke 1880 (Benoit) ellipsoid
- <esri4011> : Unknown datum based upon the Clarke 1880 (IGN) ellipsoid
- <esri4012> : Unknown datum based upon the Clarke 1880 (RGS) ellipsoid
- <esri4013> : Unknown datum based upon the Clarke 1880 (Arc) ellipsoid
- <esri4014> : Unknown datum based upon the Clarke 1880 (SGA 1922) ellipsoid
- <esri4015> : Unknown datum based upon the Everest 1830 (1937 Adjustment) ellipsoid
- <esri4016> : Unknown datum based upon the Everest 1830 (1967 Definition) ellipsoid
- <esri4018> : Unknown datum based upon the Everest 1830 Modified ellipsoid
- <esri4019> : Unknown datum based upon the GRS 1980 ellipsoid
- <esri4020> : Unknown datum based upon the Helmert 1906 ellipsoid
- <esri4021> : Unknown datum based upon the Indonesian National Spheroid
- <esri4022> : Unknown datum based upon the International 1924 ellipsoid
- <esri4024> : Unknown datum based upon the Krassowsky 1940 ellipsoid
- <esri4025> : Unknown datum based upon the NWL 9D ellipsoid
- <esri4027> : Unknown datum based upon the Plessis 1817 ellipsoid
- <esri4028> : Unknown datum based upon the Struve 1860 ellipsoid
- <esri4029> : Unknown datum based upon the War Office ellipsoid
- <esri4030> : Unknown datum based upon the WGS 84 ellipsoid
- <esri4031> : Unknown datum based upon the GEM 10C ellipsoid
- <esri4032> : Unknown datum based upon the OSU86F ellipsoid
- <esri4033> : Unknown datum based upon the OSU91A ellipsoid
- <esri4034> : Unknown datum based upon the Clarke 1880 ellipsoid
- <esri4035> : Unknown datum based upon the Authalic Sphere
- <esri4036> : Unknown datum based upon the GRS 1967 ellipsoid
- <esri4041> : Unknown datum based upon the Average Terrestrial System 1977 ellipsoid
- <esri4042> : Unknown datum based upon the Everest (1830 Definition) ellipsoid
- <esri4043> : Unknown datum based upon the WGS 72 ellipsoid
- <esri4044> : Unknown datum based upon the Everest 1830 (1962 Definition) ellipsoid
- <esri4045> : Unknown datum based upon the Everest 1830 (1975 Definition) ellipsoid
- <esri4047> : Unspecified based upon the GRS 1980 Authalic Sphere
- <esri4120> : Greek
- <esri4121> : GGRS87
- <esri4122> : ATS77
- <esri4123> : KKJ
- <esri4124> : RT90
- <esri4125> : Samboja
- <esri4126> : LKS94 (ETRS89)
- <esri4127> : Tete
- <esri4128> : Madzansua
- <esri4129> : Observatario
- <esri4130> : Moznet
- <esri4131> : Indian 1960
- <esri4132> : FD58
- <esri4133> : EST92
- <esri4134> : PDO Survey Datum 1993
- <esri4135> : Old Hawaiian
- <esri4136> : St. Lawrence Island
- <esri4137> : St. Paul Island
- <esri4138> : St. George Island
- <esri4139> : Puerto Rico
- <esri4140> : NAD83(CSRS98)
- <esri4141> : Israel
- <esri4142> : Locodjo 1965
- <esri4143> : Abidjan 1987
- <esri4144> : Kalianpur 1937
- <esri4145> : Kalianpur 1962
- <esri4146> : Kalianpur 1975
- <esri4147> : Hanoi 1972
- <esri4148> : Hartebeesthoek94
- <esri4149> : CH1903
- <esri4150> : CH1903+
- <esri4151> : CHTRF95
- <esri4152> : NAD83(HARN)
- <esri4153> : Rassadiran
- <esri4154> : ED50(ED77)
- <esri4155> : Dabola 1981
- <esri4156> : S-JTSK
- <esri4157> : Mount Dillon
- <esri4158> : Naparima 1955
- <esri4159> : ELD79
- <esri4160> : Chos Malal 1914
- <esri4161> : Pampa del Castillo
- <esri4162> : Korean 1985
- <esri4163> : Yemen NGN96
- <esri4164> : South Yemen
- <esri4165> : Bissau
- <esri4166> : Korean 1995
- <esri4167> : NZGD2000
- <esri4168> : Accra
- <esri4169> : American Samoa 1962
- <esri4170> : SIRGAS
- <esri4171> : RGF93
- <esri4172> : POSGAR
- <esri4173> : IRENET95
- <esri4174> : Sierra Leone 1924
- <esri4175> : Sierra Leone 1968
- <esri4176> : Australian Antarctic
- <esri4178> : Pulkovo 1942(83)
- <esri4179> : Pulkovo 1942(58)
- <esri4180> : EST97
- <esri4181> : Luxembourg 1930
- <esri4182> : Azores Occidental 1939
- <esri4183> : Azores Central 1948
- <esri4184> : Azores Oriental 1940
- <esri4185> : Madeira 1936
- <esri4188> : OSNI 1952
- <esri4189> : REGVEN
- <esri4190> : POSGAR 98
- <esri4191> : Albanian 1987
- <esri4192> : Douala 1948
- <esri4193> : Manoca 1962
- <esri4194> : Qornoq 1927
- <esri4195> : Scoresbysund 1952
- <esri4196> : Ammassalik 1958
- <esri4197> : Garoua
- <esri4198> : Kousseri
- <esri4199> : Egypt 1930
- <esri4200> : Pulkovo 1995
- <esri4201> : Adindan
- <esri4202> : AGD66
- <esri4203> : AGD84
- <esri4204> : Ain el Abd
- <esri4205> : Afgooye
- <esri4206> : Agadez
- <esri4207> : Lisbon
- <esri4208> : Aratu
- <esri4209> : Arc 1950
- <esri4210> : Arc 1960
- <esri4211> : Batavia
- <esri4212> : Barbados 1938
- <esri4213> : Beduaram
- <esri4214> : Beijing 1954
- <esri4215> : Belge 1950
- <esri4216> : Bermuda 1957
- <esri4218> : Bogota 1975
- <esri4219> : Bukit Rimpah
- <esri4220> : Camacupa
- <esri4221> : Campo Inchauspe
- <esri4222> : Cape
- <esri4223> : Carthage
- <esri4224> : Chua
- <esri4225> : Corrego Alegre
- <esri4226> : Cote d'Ivoire
- <esri4227> : Deir ez Zor
- <esri4228> : Douala
- <esri4229> : Egypt 1907
- <esri4230> : ED50
- <esri4231> : ED87
- <esri4232> : Fahud
- <esri4233> : Gandajika 1970
- <esri4234> : Garoua
- <esri4235> : Guyane Francaise
- <esri4236> : Hu Tzu Shan
- <esri4237> : HD72
- <esri4238> : ID74
- <esri4239> : Indian 1954
- <esri4240> : Indian 1975
- <esri4241> : Jamaica 1875
- <esri4242> : JAD69
- <esri4243> : Kalianpur 1880
- <esri4244> : Kandawala
- <esri4245> : Kertau
- <esri4246> : KOC
- <esri4247> : La Canoa
- <esri4248> : PSAD56
- <esri4249> : Lake
- <esri4250> : Leigon
- <esri4251> : Liberia 1964
- <esri4252> : Lome
- <esri4253> : Luzon 1911
- <esri4254> : Hito XVIII 1963
- <esri4255> : Herat North
- <esri4256> : Mahe 1971
- <esri4257> : Makassar
- <esri4258> : ETRS89
- <esri4259> : Malongo 1987
- <esri4260> : Manoca
- <esri4261> : Merchich
- <esri4262> : Massawa
- <esri4263> : Minna
- <esri4264> : Mhast
- <esri4265> : Monte Mario
- <esri4266> : M'poraloko
- <esri4267> : NAD27
- <esri4268> : NAD27 Michigan
- <esri4269> : NAD83
- <esri4270> : Nahrwan 1967
- <esri4271> : Naparima 1972
- <esri4272> : NZGD49
- <esri4273> : NGO 1948
- <esri4274> : Datum 73
- <esri4275> : NTF
- <esri4276> : NSWC 9Z-2
- <esri4277> : OSGB 1936
- <esri4278> : OSGB70
- <esri4279> : OS(SN)80
- <esri4280> : Padang
- <esri4281> : Palestine 1923
- <esri4282> : Pointe Noire
- <esri4283> : GDA94
- <esri4284> : Pulkovo 1942
- <esri4285> : Qatar 1974
- <esri4286> : Qatar 1948
- <esri4287> : Qornoq
- <esri4288> : Loma Quintana
- <esri4289> : Amersfoort
- <esri4291> : SAD69
- <esri4292> : Sapper Hill 1943
- <esri4293> : Schwarzeck
- <esri4294> : Segora
- <esri4295> : Serindung
- <esri4296> : Sudan
- <esri4297> : Tananarive
- <esri4298> : Timbalai 1948
- <esri4299> : TM65
- <esri4300> : TM75
- <esri4301> : Tokyo
- <esri4302> : Trinidad 1903
- <esri4303> : TC(1948)
- <esri4304> : Voirol 1875
- <esri4306> : Bern 1938
- <esri4307> : Nord Sahara 1959
- <esri4308> : RT38
- <esri4309> : Yacare
- <esri4310> : Yoff
- <esri4311> : Zanderij
- <esri4312> : MGI
- <esri4313> : Belge 1972
- <esri4314> : DHDN
- <esri4315> : Conakry 1905
- <esri4316> : Dealul Piscului 1933
- <esri4317> : Dealul Piscului 1970
- <esri4318> : NGN
- <esri4319> : KUDAMS
- <esri4322> : WGS 72
- <esri4324> : WGS 72BE
- <esri4326> : WGS 84
- <esri4600> : Anguilla 1957
- <esri4601> : Antigua 1943
- <esri4602> : Dominica 1945
- <esri4603> : Grenada 1953
- <esri4604> : Montserrat 1958
- <esri4605> : St. Kitts 1955
- <esri4606> : St. Lucia 1955
- <esri4607> : St. Vincent 1945
- <esri4608> : NAD27(76)
- <esri4609> : NAD27(CGQ77)
- <esri4610> : Xian 1980
- <esri4611> : Hong Kong 1980
- <esri4612> : JGD2000
- <esri4613> : Segara
- <esri4614> : QND95
- <esri4615> : Porto Santo
- <esri4616> : Selvagem Grande
- <esri4617> : NAD83(CSRS)
- <esri4801> : Bern 1898 (Bern)
- <esri4802> : Bogota 1975 (Bogota)
- <esri4803> : Lisbon (Lisbon)
- <esri4804> : Makassar (Jakarta)
- <esri4805> : MGI (Ferro)
- <esri4806> : Monte Mario (Rome)
- <esri4807> : NTF (Paris)
- <esri4808> : Padang (Jakarta)
- <esri4809> : Belge 1950 (Brussels)
- <esri4810> : Tananarive (Paris)
- <esri4811> : Voirol 1875 (Paris)
- <esri4813> : Batavia (Jakarta)
- <esri4814> : RT38 (Stockholm)
- <esri4815> : Greek (Athens)
- <esri4816> : Carthage (Paris)
- <esri4817> : NGO 1948 (Oslo)
- <esri4818> : S-JTSK (Ferro)
- <esri4819> : Nord Sahara 1959 (Paris)
- <esri4820> : Segara (Jakarta)
- <esri4901> : ATF (Paris)
- <esri4902> : NDG (Paris)
- <esri4903> : Madrid 1870 (Madrid)
- <esri4904> : Lisbon 1890 (Lisbon)
- <esri20004> : Pulkovo 1995 / Gauss-Kruger zone 4
- <esri20005> : Pulkovo 1995 / Gauss-Kruger zone 5
- <esri20006> : Pulkovo 1995 / Gauss-Kruger zone 6
- <esri20007> : Pulkovo 1995 / Gauss-Kruger zone 7
- <esri20008> : Pulkovo 1995 / Gauss-Kruger zone 8
- <esri20009> : Pulkovo 1995 / Gauss-Kruger zone 9
- <esri20010> : Pulkovo 1995 / Gauss-Kruger zone 10
- <esri20011> : Pulkovo 1995 / Gauss-Kruger zone 11
- <esri20012> : Pulkovo 1995 / Gauss-Kruger zone 12
- <esri20013> : Pulkovo 1995 / Gauss-Kruger zone 13
- <esri20014> : Pulkovo 1995 / Gauss-Kruger zone 14
- <esri20015> : Pulkovo 1995 / Gauss-Kruger zone 15
- <esri20016> : Pulkovo 1995 / Gauss-Kruger zone 16
- <esri20017> : Pulkovo 1995 / Gauss-Kruger zone 17
- <esri20018> : Pulkovo 1995 / Gauss-Kruger zone 18
- <esri20019> : Pulkovo 1995 / Gauss-Kruger zone 19
- <esri20020> : Pulkovo 1995 / Gauss-Kruger zone 20
- <esri20021> : Pulkovo 1995 / Gauss-Kruger zone 21
- <esri20022> : Pulkovo 1995 / Gauss-Kruger zone 22
- <esri20023> : Pulkovo 1995 / Gauss-Kruger zone 23
- <esri20024> : Pulkovo 1995 / Gauss-Kruger zone 24
- <esri20025> : Pulkovo 1995 / Gauss-Kruger zone 25
- <esri20026> : Pulkovo 1995 / Gauss-Kruger zone 26
- <esri20027> : Pulkovo 1995 / Gauss-Kruger zone 27
- <esri20028> : Pulkovo 1995 / Gauss-Kruger zone 28
- <esri20029> : Pulkovo 1995 / Gauss-Kruger zone 29
- <esri20030> : Pulkovo 1995 / Gauss-Kruger zone 30
- <esri20031> : Pulkovo 1995 / Gauss-Kruger zone 31
- <esri20032> : Pulkovo 1995 / Gauss-Kruger zone 32
- <esri20064> : Pulkovo 1995 / Gauss-Kruger 4N
- <esri20065> : Pulkovo 1995 / Gauss-Kruger 5N
- <esri20066> : Pulkovo 1995 / Gauss-Kruger 6N
- <esri20067> : Pulkovo 1995 / Gauss-Kruger 7N
- <esri20068> : Pulkovo 1995 / Gauss-Kruger 8N
- <esri20069> : Pulkovo 1995 / Gauss-Kruger 9N
- <esri20070> : Pulkovo 1995 / Gauss-Kruger 10N
- <esri20071> : Pulkovo 1995 / Gauss-Kruger 11N
- <esri20072> : Pulkovo 1995 / Gauss-Kruger 12N
- <esri20073> : Pulkovo 1995 / Gauss-Kruger 13N
- <esri20074> : Pulkovo 1995 / Gauss-Kruger 14N
- <esri20075> : Pulkovo 1995 / Gauss-Kruger 15N
- <esri20076> : Pulkovo 1995 / Gauss-Kruger 16N
- <esri20077> : Pulkovo 1995 / Gauss-Kruger 17N
- <esri20078> : Pulkovo 1995 / Gauss-Kruger 18N
- <esri20079> : Pulkovo 1995 / Gauss-Kruger 19N
- <esri20080> : Pulkovo 1995 / Gauss-Kruger 20N
- <esri20081> : Pulkovo 1995 / Gauss-Kruger 21N
- <esri20082> : Pulkovo 1995 / Gauss-Kruger 22N
- <esri20083> : Pulkovo 1995 / Gauss-Kruger 23N
- <esri20084> : Pulkovo 1995 / Gauss-Kruger 24N
- <esri20085> : Pulkovo 1995 / Gauss-Kruger 25N
- <esri20086> : Pulkovo 1995 / Gauss-Kruger 26N
- <esri20087> : Pulkovo 1995 / Gauss-Kruger 27N
- <esri20088> : Pulkovo 1995 / Gauss-Kruger 28N
- <esri20089> : Pulkovo 1995 / Gauss-Kruger 29N
- <esri20090> : Pulkovo 1995 / Gauss-Kruger 30N
- <esri20091> : Pulkovo 1995 / Gauss-Kruger 31N
- <esri20092> : Pulkovo 1995 / Gauss-Kruger 32N
- <esri20137> : Adindan / UTM zone 37N
- <esri20138> : Adindan / UTM zone 38N
- <esri20248> : AGD66 / AMG zone 48
- <esri20249> : AGD66 / AMG zone 49
- <esri20250> : AGD66 / AMG zone 50
- <esri20251> : AGD66 / AMG zone 51
- <esri20252> : AGD66 / AMG zone 52
- <esri20253> : AGD66 / AMG zone 53
- <esri20254> : AGD66 / AMG zone 54
- <esri20255> : AGD66 / AMG zone 55
- <esri20256> : AGD66 / AMG zone 56
- <esri20257> : AGD66 / AMG zone 57
- <esri20258> : AGD66 / AMG zone 58
- <esri20348> : AGD84 / AMG zone 48
- <esri20349> : AGD84 / AMG zone 49
- <esri20350> : AGD84 / AMG zone 50
- <esri20351> : AGD84 / AMG zone 51
- <esri20352> : AGD84 / AMG zone 52
- <esri20353> : AGD84 / AMG zone 53
- <esri20354> : AGD84 / AMG zone 54
- <esri20355> : AGD84 / AMG zone 55
- <esri20356> : AGD84 / AMG zone 56
- <esri20357> : AGD84 / AMG zone 57
- <esri20358> : AGD84 / AMG zone 58
- <esri20437> : Ain el Abd / UTM zone 37N
- <esri20438> : Ain el Abd / UTM zone 38N
- <esri20439> : Ain el Abd / UTM zone 39N
- <esri20499> : Ain el Abd / Bahrain Grid
- <esri20538> : Afgooye / UTM zone 38N
- <esri20539> : Afgooye / UTM zone 39N
- <esri20790> : Lisbon (Lisbon)/Portuguese National Grid
- <esri20791> : Lisbon (Lisbon)/Portuguese Grid
- <esri20822> : Aratu / UTM zone 22S
- <esri20823> : Aratu / UTM zone 23S
- <esri20824> : Aratu / UTM zone 24S
- <esri20934> : Arc 1950 / UTM zone 34S
- <esri20935> : Arc 1950 / UTM zone 35S
- <esri20936> : Arc 1950 / UTM zone 36S
- <esri21035> : Arc 1960 / UTM zone 35S
- <esri21036> : Arc 1960 / UTM zone 36S
- <esri21037> : Arc 1960 / UTM zone 37S
- <esri21095> : Arc 1960 / UTM zone 35N
- <esri21096> : Arc 1960 / UTM zone 36N
- <esri21097> : Arc 1960 / UTM zone 37N
- <esri21100> : Batavia (Jakarta) / NEIEZ
- <esri21148> : Batavia / UTM zone 48S
- <esri21149> : Batavia / UTM zone 49S
- <esri21150> : Batavia / UTM zone 50S
- <esri21291> : Barbados 1938 / British West Indies Grid
- <esri21292> : Barbados 1938 / Barbados National Grid
- <esri21413> : Beijing 1954 / Gauss-Kruger zone 13
- <esri21414> : Beijing 1954 / Gauss-Kruger zone 14
- <esri21415> : Beijing 1954 / Gauss-Kruger zone 15
- <esri21416> : Beijing 1954 / Gauss-Kruger zone 16
- <esri21417> : Beijing 1954 / Gauss-Kruger zone 17
- <esri21418> : Beijing 1954 / Gauss-Kruger zone 18
- <esri21419> : Beijing 1954 / Gauss-Kruger zone 19
- <esri21420> : Beijing 1954 / Gauss-Kruger zone 20
- <esri21421> : Beijing 1954 / Gauss-Kruger zone 21
- <esri21422> : Beijing 1954 / Gauss-Kruger zone 22
- <esri21423> : Beijing 1954 / Gauss-Kruger zone 23
- <esri21453> : Beijing 1954 / Gauss-Kruger CM 75E
- <esri21454> : Beijing 1954 / Gauss-Kruger CM 81E
- <esri21455> : Beijing 1954 / Gauss-Kruger CM 87E
- <esri21456> : Beijing 1954 / Gauss-Kruger CM 93E
- <esri21457> : Beijing 1954 / Gauss-Kruger CM 99E
- <esri21458> : Beijing 1954 / Gauss-Kruger CM 105E
- <esri21459> : Beijing 1954 / Gauss-Kruger CM 111E
- <esri21460> : Beijing 1954 / Gauss-Kruger CM 117E
- <esri21461> : Beijing 1954 / Gauss-Kruger CM 123E
- <esri21462> : Beijing 1954 / Gauss-Kruger CM 129E
- <esri21463> : Beijing 1954 / Gauss-Kruger CM 135E
- <esri21473> : Beijing 1954 / Gauss-Kruger 13N
- <esri21474> : Beijing 1954 / Gauss-Kruger 14N
- <esri21475> : Beijing 1954 / Gauss-Kruger 15N
- <esri21476> : Beijing 1954 / Gauss-Kruger 16N
- <esri21477> : Beijing 1954 / Gauss-Kruger 17N
- <esri21478> : Beijing 1954 / Gauss-Kruger 18N
- <esri21479> : Beijing 1954 / Gauss-Kruger 19N
- <esri21480> : Beijing 1954 / Gauss-Kruger 20N
- <esri21481> : Beijing 1954 / Gauss-Kruger 21N
- <esri21482> : Beijing 1954 / Gauss-Kruger 22N
- <esri21483> : Beijing 1954 / Gauss-Kruger 23N
- <esri21500> : Belge 1950 (Brussels) / Belge Lambert 50
- <esri21780> : Bern 1898 (Bern) / LV03C
- <esri21781> : CH1903 / LV03
- <esri21817> : Bogota 1975 / UTM zone 17N
- <esri21818> : Bogota 1975 / UTM zone 18N
- <esri21891> : Bogota 1975 / Colombia West zone
- <esri21892> : Bogota 1975 / Colombia Bogota zone
- <esri21893> : Bogota 1975 / Colombia East Central zone
- <esri21894> : Bogota 1975 / Colombia East
- <esri22032> : Camacupa / UTM zone 32S
- <esri22033> : Camacupa / UTM zone 33S
- <esri22091> : Camacupa / TM 11.30 SE
- <esri22092> : Camacupa / TM 12 SE
- <esri22191> : Campo Inchauspe / Argentina 1
- <esri22192> : Campo Inchauspe / Argentina 2
- <esri22193> : Campo Inchauspe / Argentina 3
- <esri22194> : Campo Inchauspe / Argentina 4
- <esri22195> : Campo Inchauspe / Argentina 5
- <esri22196> : Campo Inchauspe / Argentina 6
- <esri22197> : Campo Inchauspe / Argentina 7
- <esri22234> : Cape / UTM zone 34S
- <esri22235> : Cape / UTM zone 35S
- <esri22236> : Cape / UTM zone 36S
- <esri22332> : Carthage / UTM zone 32N
- <esri22391> : Carthage / Nord Tunisie
- <esri22392> : Carthage / Sud Tunisie
- <esri22523> : Corrego Alegre / UTM zone 23S
- <esri22524> : Corrego Alegre / UTM zone 24S
- <esri22700> : Deir ez Zor / Levant Zone
- <esri22770> : Deir ez Zor / Syria Lambert
- <esri22780> : Deir ez Zor / Levant Stereographic
- <esri22832> : Douala / UTM zone 32N
- <esri22991> : Egypt 1907 / Blue Belt
- <esri22992> : Egypt 1907 / Red Belt
- <esri22993> : Egypt 1907 / Purple Belt
- <esri22994> : Egypt 1907 / Extended Purple Belt
- <esri23028> : ED50 / UTM zone 28N
- <esri23029> : ED50 / UTM zone 29N
- <esri23030> : ED50 / UTM zone 30N
- <esri23031> : ED50 / UTM zone 31N
- <esri23032> : ED50 / UTM zone 32N
- <esri23033> : ED50 / UTM zone 33N
- <esri23034> : ED50 / UTM zone 34N
- <esri23035> : ED50 / UTM zone 35N
- <esri23036> : ED50 / UTM zone 36N
- <esri23037> : ED50 / UTM zone 37N
- <esri23038> : ED50 / UTM zone 38N
- <esri23090> : ED50 / TM 0 N
- <esri23095> : ED50 / TM 5 NE
- <esri23239> : Fahud / UTM zone 39N
- <esri23240> : Fahud / UTM zone 40N
- <esri23433> : Garoua / UTM zone 33N
- <esri23700> : HD72 / EOV
- <esri23846> : ID74 / UTM zone 46N
- <esri23847> : ID74 / UTM zone 47N
- <esri23848> : ID74 / UTM zone 48N
- <esri23849> : ID74 / UTM zone 49N
- <esri23850> : ID74 / UTM zone 50N
- <esri23851> : ID74 / UTM zone 51N
- <esri23852> : ID74 / UTM zone 52N
- <esri23853> : ID74 / UTM zone 53N
- <esri23886> : ID74 / UTM zone 46S
- <esri23887> : ID74 / UTM zone 47S
- <esri23888> : ID74 / UTM zone 48S
- <esri23889> : ID74 / UTM zone 49S
- <esri23890> : ID74 / UTM zone 50S
- <esri23891> : ID74 / UTM zone 51S
- <esri23892> : ID74 / UTM zone 52S
- <esri23893> : ID74 / UTM zone 53S
- <esri23894> : ID74 / UTM zone 54S
- <esri23946> : Indian 1954 / UTM zone 46N
- <esri23947> : Indian 1954 / UTM zone 47N
- <esri23948> : Indian 1954 / UTM zone 48N
- <esri24047> : Indian 1975 / UTM zone 47N
- <esri24048> : Indian 1975 / UTM zone 48N
- <esri24100> : Jamaica 1875 / Jamaica (Old Grid)
- <esri24200> : JAD69 / Jamaica National Grid
- <esri24305> : Kalianpur 1937 / UTM zone 45N
- <esri24306> : Kalianpur 1937 / UTM zone 46N
- <esri24311> : Kalianpur 1962 / UTM zone 41N
- <esri24312> : Kalianpur 1962 / UTM zone 42N
- <esri24313> : Kalianpur 1962 / UTM zone 43N
- <esri24342> : Kalianpur 1975 / UTM zone 42N
- <esri24343> : Kalianpur 1975 / UTM zone 43N
- <esri24344> : Kalianpur 1975 / UTM zone 44N
- <esri24345> : Kalianpur 1975 / UTM zone 45N
- <esri24346> : Kalianpur 1975 / UTM zone 46N
- <esri24347> : Kalianpur 1975 / UTM zone 47N
- <esri24370> : Kalianpur 1880 / India zone 0
- <esri24371> : Kalianpur 1880 / India zone I
- <esri24372> : Kalianpur 1880 / India zone IIa
- <esri24373> : Kalianpur 1880 / India zone III
- <esri24374> : Kalianpur 1880 / India zone IV
- <esri24375> : Kalianpur 1937 / India zone IIb
- <esri24376> : Kalianpur 1962 / India zone I
- <esri24377> : Kalianpur 1962 / India zone IIa
- <esri24378> : Kalianpur 1975 / India zone I
- <esri24379> : Kalianpur 1975 / India zone IIa
- <esri24380> : Kalianpur 1975 / India zone IIb
- <esri24381> : Kalianpur 1975 / India zone III
- <esri24382> : Kalianpur 1880 / India zone IIb
- <esri24383> : Kalianpur 1975 / India zone IV
- <esri24500> : Kertau / Singapore Grid
- <esri24547> : Kertau / UTM zone 47N
- <esri24548> : Kertau / UTM zone 48N
- <esri24571> : Kertau / R.S.O. Malaya (ch)
- <esri24600> : KOC Lambert
- <esri24718> : La Canoa / UTM zone 18N
- <esri24719> : La Canoa / UTM zone 19N
- <esri24720> : La Canoa / UTM zone 20N
- <esri24818> : PSAD56 / UTM zone 18N
- <esri24819> : PSAD56 / UTM zone 19N
- <esri24820> : PSAD56 / UTM zone 20N
- <esri24821> : PSAD56 / UTM zone 21N
- <esri24877> : PSAD56 / UTM zone 17S
- <esri24878> : PSAD56 / UTM zone 18S
- <esri24879> : PSAD56 / UTM zone 19S
- <esri24880> : PSAD56 / UTM zone 20S
- <esri24882> : PSAD56 / UTM zone 22S
- <esri24891> : PSAD56 / Peru west zone
- <esri24892> : PSAD56 / Peru central zone
- <esri24893> : PSAD56 / Peru east zone
- <esri25000> : Leigon / Ghana Metre Grid
- <esri25231> : Lome / UTM zone 31N
- <esri25391> : Luzon 1911 / Philippines zone I
- <esri25392> : Luzon 1911 / Philippines zone II
- <esri25393> : Luzon 1911 / Philippines zone III
- <esri25394> : Luzon 1911 / Philippines zone IV
- <esri25395> : Luzon 1911 / Philippines zone V
- <esri25700> : Makassar (Jakarta) / NEIEZ
- <esri25828> : ETRS89 / UTM zone 28N
- <esri25829> : ETRS89 / UTM zone 29N
- <esri25830> : ETRS89 / UTM zone 30N
- <esri25831> : ETRS89 / UTM zone 31N
- <esri25832> : ETRS89 / UTM zone 32N
- <esri25833> : ETRS89 / UTM zone 33N
- <esri25834> : ETRS89 / UTM zone 34N
- <esri25835> : ETRS89 / UTM zone 35N
- <esri25836> : ETRS89 / UTM zone 36N
- <esri25837> : ETRS89 / UTM zone 37N
- <esri25838> : ETRS89 / UTM zone 38N
- <esri25884> : ETRS89 / TM Baltic93
- <esri25932> : Malongo 1987 / UTM zone 32S
- <esri26191> : Merchich / Nord Maroc
- <esri26192> : Merchich / Sud Maroc
- <esri26193> : Merchich / Sahara
- <esri26237> : Massawa / UTM zone 37N
- <esri26331> : Minna / UTM zone 31N
- <esri26332> : Minna / UTM zone 32N
- <esri26391> : Minna / Nigeria West Belt
- <esri26392> : Minna / Nigeria Mid Belt
- <esri26393> : Minna / Nigeria East Belt
- <esri26432> : Mhast / UTM zone 32S
- <esri26591> : Monte Mario (Rome) / Italy zone 1
- <esri26592> : Monte Mario (Rome) / Italy zone 2
- <esri26632> : M'poraloko / UTM zone 32N
- <esri26692> : M'poraloko / UTM zone 32S
- <esri26703> : NAD27 / UTM zone 3N
- <esri26704> : NAD27 / UTM zone 4N
- <esri26705> : NAD27 / UTM zone 5N
- <esri26706> : NAD27 / UTM zone 6N
- <esri26707> : NAD27 / UTM zone 7N
- <esri26708> : NAD27 / UTM zone 8N
- <esri26709> : NAD27 / UTM zone 9N
- <esri26710> : NAD27 / UTM zone 10N
- <esri26711> : NAD27 / UTM zone 11N
- <esri26712> : NAD27 / UTM zone 12N
- <esri26713> : NAD27 / UTM zone 13N
- <esri26714> : NAD27 / UTM zone 14N
- <esri26715> : NAD27 / UTM zone 15N
- <esri26716> : NAD27 / UTM zone 16N
- <esri26717> : NAD27 / UTM zone 17N
- <esri26718> : NAD27 / UTM zone 18N
- <esri26719> : NAD27 / UTM zone 19N
- <esri26720> : NAD27 / UTM zone 20N
- <esri26721> : NAD27 / UTM zone 21N
- <esri26722> : NAD27 / UTM zone 22N
- <esri26729> : NAD27 / Alabama East
- <esri26730> : NAD27 / Alabama West
- <esri26731> : NAD27 / Alaska zone 1
- <esri26732> : NAD27 / Alaska zone 2
- <esri26733> : NAD27 / Alaska zone 3
- <esri26734> : NAD27 / Alaska zone 4
- <esri26735> : NAD27 / Alaska zone 5
- <esri26736> : NAD27 / Alaska zone 6
- <esri26737> : NAD27 / Alaska zone 7
- <esri26738> : NAD27 / Alaska zone 8
- <esri26739> : NAD27 / Alaska zone 9
- <esri26740> : NAD27 / Alaska zone 10
- <esri26741> : NAD27 / California zone I
- <esri26742> : NAD27 / California zone II
- <esri26743> : NAD27 / California zone III
- <esri26744> : NAD27 / California zone IV
- <esri26745> : NAD27 / California zone V
- <esri26746> : NAD27 / California zone VI
- <esri26747> : NAD27 / California zone VII
- <esri26748> : NAD27 / Arizona East
- <esri26749> : NAD27 / Arizona Central
- <esri26750> : NAD27 / Arizona West
- <esri26751> : NAD27 / Arkansas North
- <esri26752> : NAD27 / Arkansas South
- <esri26753> : NAD27 / Colorado North
- <esri26754> : NAD27 / Colorado Central
- <esri26755> : NAD27 / Colorado South
- <esri26756> : NAD27 / Connecticut
- <esri26757> : NAD27 / Delaware
- <esri26758> : NAD27 / Florida East
- <esri26759> : NAD27 / Florida West
- <esri26760> : NAD27 / Florida North
- <esri26766> : NAD27 / Georgia East
- <esri26767> : NAD27 / Georgia West
- <esri26768> : NAD27 / Idaho East
- <esri26769> : NAD27 / Idaho Central
- <esri26770> : NAD27 / Idaho West
- <esri26771> : NAD27 / Illinois East
- <esri26772> : NAD27 / Illinois West
- <esri26773> : NAD27 / Indiana East
- <esri26774> : NAD27 / Indiana West
- <esri26775> : NAD27 / Iowa North
- <esri26776> : NAD27 / Iowa South
- <esri26777> : NAD27 / Kansas North
- <esri26778> : NAD27 / Kansas South
- <esri26779> : NAD27 / Kentucky North
- <esri26780> : NAD27 / Kentucky South
- <esri26781> : NAD27 / Louisiana North
- <esri26782> : NAD27 / Louisiana South
- <esri26783> : NAD27 / Maine East
- <esri26784> : NAD27 / Maine West
- <esri26785> : NAD27 / Maryland
- <esri26786> : NAD27 / Massachusetts Mainland
- <esri26787> : NAD27 / Massachusetts Island
- <esri26791> : NAD27 / Minnesota North
- <esri26792> : NAD27 / Minnesota Central
- <esri26793> : NAD27 / Minnesota South
- <esri26794> : NAD27 / Mississippi East
- <esri26795> : NAD27 / Mississippi West
- <esri26796> : NAD27 / Missouri East
- <esri26797> : NAD27 / Missouri Central
- <esri26798> : NAD27 / Missouri West
- <esri26801> : NAD Michigan / Michigan East
- <esri26802> : NAD Michigan / Michigan Old Central
- <esri26803> : NAD Michigan / Michigan West
- <esri26811> : NAD Michigan / Michigan North
- <esri26812> : NAD Michigan / Michigan Central
- <esri26813> : NAD Michigan / Michigan South
- <esri26903> : NAD83 / UTM zone 3N
- <esri26904> : NAD83 / UTM zone 4N
- <esri26905> : NAD83 / UTM zone 5N
- <esri26906> : NAD83 / UTM zone 6N
- <esri26907> : NAD83 / UTM zone 7N
- <esri26908> : NAD83 / UTM zone 8N
- <esri26909> : NAD83 / UTM zone 9N
- <esri26910> : NAD83 / UTM zone 10N
- <esri26911> : NAD83 / UTM zone 11N
- <esri26912> : NAD83 / UTM zone 12N
- <esri26913> : NAD83 / UTM zone 13N
- <esri26914> : NAD83 / UTM zone 14N
- <esri26915> : NAD83 / UTM zone 15N
- <esri26916> : NAD83 / UTM zone 16N
- <esri26917> : NAD83 / UTM zone 17N
- <esri26918> : NAD83 / UTM zone 18N
- <esri26919> : NAD83 / UTM zone 19N
- <esri26920> : NAD83 / UTM zone 20N
- <esri26921> : NAD83 / UTM zone 21N
- <esri26922> : NAD83 / UTM zone 22N
- <esri26923> : NAD83 / UTM zone 23N
- <esri26929> : NAD83 / Alabama East
- <esri26930> : NAD83 / Alabama West
- <esri26931> : NAD83 / Alaska zone 1
- <esri26932> : NAD83 / Alaska zone 2
- <esri26933> : NAD83 / Alaska zone 3
- <esri26934> : NAD83 / Alaska zone 4
- <esri26935> : NAD83 / Alaska zone 5
- <esri26936> : NAD83 / Alaska zone 6
- <esri26937> : NAD83 / Alaska zone 7
- <esri26938> : NAD83 / Alaska zone 8
- <esri26939> : NAD83 / Alaska zone 9
- <esri26940> : NAD83 / Alaska zone 10
- <esri26941> : NAD83 / California zone 1
- <esri26942> : NAD83 / California zone 2
- <esri26943> : NAD83 / California zone 3
- <esri26944> : NAD83 / California zone 4
- <esri26945> : NAD83 / California zone 5
- <esri26946> : NAD83 / California zone 6
- <esri26948> : NAD83 / Arizona East
- <esri26949> : NAD83 / Arizona Central
- <esri26950> : NAD83 / Arizona West
- <esri26951> : NAD83 / Arkansas North
- <esri26952> : NAD83 / Arkansas South
- <esri26953> : NAD83 / Colorado North
- <esri26954> : NAD83 / Colorado Central
- <esri26955> : NAD83 / Colorado South
- <esri26956> : NAD83 / Connecticut
- <esri26957> : NAD83 / Delaware
- <esri26958> : NAD83 / Florida East
- <esri26959> : NAD83 / Florida West
- <esri26960> : NAD83 / Florida North
- <esri26961> : NAD83 / Hawaii zone 1
- <esri26962> : NAD83 / Hawaii zone 2
- <esri26963> : NAD83 / Hawaii zone 3
- <esri26964> : NAD83 / Hawaii zone 4
- <esri26965> : NAD83 / Hawaii zone 5
- <esri26966> : NAD83 / Georgia East
- <esri26967> : NAD83 / Georgia West
- <esri26968> : NAD83 / Idaho East
- <esri26969> : NAD83 / Idaho Central
- <esri26970> : NAD83 / Idaho West
- <esri26971> : NAD83 / Illinois East
- <esri26972> : NAD83 / Illinois West
- <esri26973> : NAD83 / Indiana East
- <esri26974> : NAD83 / Indiana West
- <esri26975> : NAD83 / Iowa North
- <esri26976> : NAD83 / Iowa South
- <esri26977> : NAD83 / Kansas North
- <esri26978> : NAD83 / Kansas South
- <esri26979> : NAD83 / Kentucky North
- <esri26980> : NAD83 / Kentucky South
- <esri26981> : NAD83 / Louisiana North
- <esri26982> : NAD83 / Louisiana South
- <esri26983> : NAD83 / Maine East
- <esri26984> : NAD83 / Maine West
- <esri26985> : NAD83 / Maryland
- <esri26986> : NAD83 / Massachusetts Mainland
- <esri26987> : NAD83 / Massachusetts Island
- <esri26988> : NAD83 / Michigan North
- <esri26989> : NAD83 / Michigan Central
- <esri26990> : NAD83 / Michigan South
- <esri26991> : NAD83 / Minnesota North
- <esri26992> : NAD83 / Minnesota Central
- <esri26993> : NAD83 / Minnesota South
- <esri26994> : NAD83 / Mississippi East
- <esri26995> : NAD83 / Mississippi West
- <esri26996> : NAD83 / Missouri East
- <esri26997> : NAD83 / Missouri Central
- <esri26998> : NAD83 / Missouri West
- <esri27038> : Nahrwan 1967 / UTM zone 38N
- <esri27039> : Nahrwan 1967 / UTM zone 39N
- <esri27040> : Nahrwan 1967 / UTM zone 40N
- <esri27120> : Naparima 1972 / UTM zone 20N
- <esri27200> : NZGD49 / New Zealand Map Grid
- <esri27205> : NZGD49 / Mount Eden Circuit
- <esri27206> : NZGD49 / Bay of Plenty Circuit
- <esri27207> : NZGD49 / Poverty Bay Circuit
- <esri27208> : NZGD49 / Hawkes Bay Circuit
- <esri27209> : NZGD49 / Taranaki Circuit
- <esri27210> : NZGD49 / Tuhirangi Circuit
- <esri27211> : NZGD49 / Wanganui Circuit
- <esri27212> : NZGD49 / Wairarapa Circuit
- <esri27213> : NZGD49 / Wellington Circuit
- <esri27214> : NZGD49 / Collingwood Circuit
- <esri27215> : NZGD49 / Nelson Circuit
- <esri27216> : NZGD49 / Karamea Circuit
- <esri27217> : NZGD49 / Buller Circuit
- <esri27218> : NZGD49 / Grey Circuit
- <esri27219> : NZGD49 / Amuri Circuit
- <esri27220> : NZGD49 / Marlborough Circuit
- <esri27221> : NZGD49 / Hokitika Circuit
- <esri27222> : NZGD49 / Okarito Circuit
- <esri27223> : NZGD49 / Jacksons Bay Circuit
- <esri27224> : NZGD49 / Mount Pleasant Circuit
- <esri27225> : NZGD49 / Gawler Circuit
- <esri27226> : NZGD49 / Timaru Circuit
- <esri27227> : NZGD49 / Lindis Peak Circuit
- <esri27228> : NZGD49 / Mount Nicholas Circuit
- <esri27229> : NZGD49 / Mount York Circuit
- <esri27230> : NZGD49 / Observation Point Circuit
- <esri27231> : NZGD49 / North Taieri Circuit
- <esri27232> : NZGD49 / Bluff Circuit
- <esri27258> : NZGD49 / UTM zone 58S
- <esri27259> : NZGD49 / UTM zone 59S
- <esri27260> : NZGD49 / UTM zone 60S
- <esri27291> : NZGD49 / North Island Grid
- <esri27292> : NZGD49 / South Island Grid
- <esri27391> : NGO 1948 (Oslo) / NGO zone I
- <esri27392> : NGO 1948 (Oslo) / NGO zone II
- <esri27393> : NGO 1948 (Oslo) / NGO zone III
- <esri27394> : NGO 1948 (Oslo) / NGO zone IV
- <esri27395> : NGO 1948 (Oslo) / NGO zone V
- <esri27396> : NGO 1948 (Oslo) / NGO zone VI
- <esri27397> : NGO 1948 (Oslo) / NGO zone VII
- <esri27398> : NGO 1948 (Oslo) / NGO zone VIII
- <esri27429> : Datum 73 / UTM zone 29N
- <esri27492> : Datum 73 / Modified Portuguese Grid
- <esri27500> : ATF (Paris) / Nord de Guerre
- <esri27561> : NTF (Paris) / Lambert Nord France
- <esri27562> : NTF (Paris) / Lambert Centre France
- <esri27563> : NTF (Paris) / Lambert Sud France
- <esri27564> : NTF (Paris) / Lambert Corse
- <esri27571> : NTF (Paris) / Lambert zone I
- <esri27572> : NTF (Paris) / Lambert zone II
- <esri27573> : NTF (Paris) / Lambert zone III
- <esri27574> : NTF (Paris) / Lambert zone IV
- <esri27581> : NTF (Paris) / France I
- <esri27582> : NTF (Paris) / France II
- <esri27583> : NTF (Paris) / France III
- <esri27584> : NTF (Paris) / France IV
- <esri27591> : NTF (Paris) / Nord France
- <esri27592> : NTF (Paris) / Centre France
- <esri27593> : NTF (Paris) / Sud France
- <esri27594> : NTF (Paris) / Corse
- <esri27700> : OSGB 1936 / British National Grid
- <esri28191> : Palestine 1923 / Palestine Grid
- <esri28192> : Palestine 1923 / Palestine Belt
- <esri28193> : Palestine 1923 / Israeli CS Grid
- <esri28232> : Pointe Noire / UTM zone 32S
- <esri28348> : GDA94 / MGA zone 48
- <esri28349> : GDA94 / MGA zone 49
- <esri28350> : GDA94 / MGA zone 50
- <esri28351> : GDA94 / MGA zone 51
- <esri28352> : GDA94 / MGA zone 52
- <esri28353> : GDA94 / MGA zone 53
- <esri28354> : GDA94 / MGA zone 54
- <esri28355> : GDA94 / MGA zone 55
- <esri28356> : GDA94 / MGA zone 56
- <esri28357> : GDA94 / MGA zone 57
- <esri28358> : GDA94 / MGA zone 58
- <esri28402> : Pulkovo 1942 / Gauss-Kruger zone 2
- <esri28403> : Pulkovo 1942 / Gauss-Kruger zone 3
- <esri28404> : Pulkovo 1942 / Gauss-Kruger zone 4
- <esri28405> : Pulkovo 1942 / Gauss-Kruger zone 5
- <esri28406> : Pulkovo 1942 / Gauss-Kruger zone 6
- <esri28407> : Pulkovo 1942 / Gauss-Kruger zone 7
- <esri28408> : Pulkovo 1942 / Gauss-Kruger zone 8
- <esri28409> : Pulkovo 1942 / Gauss-Kruger zone 9
- <esri28410> : Pulkovo 1942 / Gauss-Kruger zone 10
- <esri28411> : Pulkovo 1942 / Gauss-Kruger zone 11
- <esri28412> : Pulkovo 1942 / Gauss-Kruger zone 12
- <esri28413> : Pulkovo 1942 / Gauss-Kruger zone 13
- <esri28414> : Pulkovo 1942 / Gauss-Kruger zone 14
- <esri28415> : Pulkovo 1942 / Gauss-Kruger zone 15
- <esri28416> : Pulkovo 1942 / Gauss-Kruger zone 16
- <esri28417> : Pulkovo 1942 / Gauss-Kruger zone 17
- <esri28418> : Pulkovo 1942 / Gauss-Kruger zone 18
- <esri28419> : Pulkovo 1942 / Gauss-Kruger zone 19
- <esri28420> : Pulkovo 1942 / Gauss-Kruger zone 20
- <esri28421> : Pulkovo 1942 / Gauss-Kruger zone 21
- <esri28422> : Pulkovo 1942 / Gauss-Kruger zone 22
- <esri28423> : Pulkovo 1942 / Gauss-Kruger zone 23
- <esri28424> : Pulkovo 1942 / Gauss-Kruger zone 24
- <esri28425> : Pulkovo 1942 / Gauss-Kruger zone 25
- <esri28426> : Pulkovo 1942 / Gauss-Kruger zone 26
- <esri28427> : Pulkovo 1942 / Gauss-Kruger zone 27
- <esri28428> : Pulkovo 1942 / Gauss-Kruger zone 28
- <esri28429> : Pulkovo 1942 / Gauss-Kruger zone 29
- <esri28430> : Pulkovo 1942 / Gauss-Kruger zone 30
- <esri28431> : Pulkovo 1942 / Gauss-Kruger zone 31
- <esri28432> : Pulkovo 1942 / Gauss-Kruger zone 32
- <esri28462> : Pulkovo 1942 / Gauss-Kruger 2N
- <esri28463> : Pulkovo 1942 / Gauss-Kruger 3N
- <esri28464> : Pulkovo 1942 / Gauss-Kruger 4N
- <esri28465> : Pulkovo 1942 / Gauss-Kruger 5N
- <esri28466> : Pulkovo 1942 / Gauss-Kruger 6N
- <esri28467> : Pulkovo 1942 / Gauss-Kruger 7N
- <esri28468> : Pulkovo 1942 / Gauss-Kruger 8N
- <esri28469> : Pulkovo 1942 / Gauss-Kruger 9N
- <esri28470> : Pulkovo 1942 / Gauss-Kruger 10N
- <esri28471> : Pulkovo 1942 / Gauss-Kruger 11N
- <esri28472> : Pulkovo 1942 / Gauss-Kruger 12N
- <esri28473> : Pulkovo 1942 / Gauss-Kruger 13N
- <esri28474> : Pulkovo 1942 / Gauss-Kruger 14N
- <esri28475> : Pulkovo 1942 / Gauss-Kruger 15N
- <esri28476> : Pulkovo 1942 / Gauss-Kruger 16N
- <esri28477> : Pulkovo 1942 / Gauss-Kruger 17N
- <esri28478> : Pulkovo 1942 / Gauss-Kruger 18N
- <esri28479> : Pulkovo 1942 / Gauss-Kruger 19N
- <esri28480> : Pulkovo 1942 / Gauss-Kruger 20N
- <esri28481> : Pulkovo 1942 / Gauss-Kruger 21N
- <esri28482> : Pulkovo 1942 / Gauss-Kruger 22N
- <esri28483> : Pulkovo 1942 / Gauss-Kruger 23N
- <esri28484> : Pulkovo 1942 / Gauss-Kruger 24N
- <esri28485> : Pulkovo 1942 / Gauss-Kruger 25N
- <esri28486> : Pulkovo 1942 / Gauss-Kruger 26N
- <esri28487> : Pulkovo 1942 / Gauss-Kruger 27N
- <esri28488> : Pulkovo 1942 / Gauss-Kruger 28N
- <esri28489> : Pulkovo 1942 / Gauss-Kruger 29N
- <esri28490> : Pulkovo 1942 / Gauss-Kruger 30N
- <esri28491> : Pulkovo 1942 / Gauss-Kruger 31N
- <esri28492> : Pulkovo 1942 / Gauss-Kruger 32N
- <esri28600> : Qatar 1974 / Qatar National Grid
- <esri28991> : Amersfoort / RD Old
- <esri28992> : Amersfoort / RD New
- <esri29100> : SAD69 / Brazil Polyconic
- <esri29118> : SAD69 / UTM zone 18N
- <esri29119> : SAD69 / UTM zone 19N
- <esri29120> : SAD69 / UTM zone 20N
- <esri29121> : SAD69 / UTM zone 21N
- <esri29122> : SAD69 / UTM zone 22N
- <esri29177> : SAD69 / UTM zone 17S
- <esri29178> : SAD69 / UTM zone 18S
- <esri29179> : SAD69 / UTM zone 19S
- <esri29180> : SAD69 / UTM zone 20S
- <esri29181> : SAD69 / UTM zone 21S
- <esri29182> : SAD69 / UTM zone 22S
- <esri29183> : SAD69 / UTM zone 23S
- <esri29184> : SAD69 / UTM zone 24S
- <esri29185> : SAD69 / UTM zone 25S
- <esri29220> : Sapper Hill 1943 / UTM zone 20S
- <esri29221> : Sapper Hill 1943 / UTM zone 21S
- <esri29333> : Schwarzeck / UTM zone 33S
- <esri29635> : Sudan / UTM zone 35N
- <esri29636> : Sudan / UTM zone 36N
- <esri29700> : Tananarive (Paris) / Laborde Grid
- <esri29738> : Tananarive / UTM zone 38S
- <esri29739> : Tananarive / UTM zone 39S
- <esri29849> : Timbalai 1948 / UTM zone 49N
- <esri29850> : Timbalai 1948 / UTM zone 50N
- <esri29871> : Timbalai 1948 / R.S.O. Borneo (ch)
- <esri29872> : Timbalai 1948 / R.S.O. Borneo (ft)
- <esri29873> : Timbalai 1948 / R.S.O. Borneo (m)
- <esri29900> : TM65 / Irish National Grid
- <esri29901> : OSNI 1952 / Irish National Grid
- <esri29902> : TM65 / Irish Grid
- <esri29903> : TM75 / Irish Grid
- <esri30161> : Tokyo / Japan Plane Rectangular CS I
- <esri30162> : Tokyo / Japan Plane Rectangular CS II
- <esri30163> : Tokyo / Japan Plane Rectangular CS III
- <esri30164> : Tokyo / Japan Plane Rectangular CS IV
- <esri30165> : Tokyo / Japan Plane Rectangular CS V
- <esri30166> : Tokyo / Japan Plane Rectangular CS VI
- <esri30167> : Tokyo / Japan Plane Rectangular CS VII
- <esri30168> : Tokyo / Japan Plane Rectangular CS VIII
- <esri30169> : Tokyo / Japan Plane Rectangular CS IX
- <esri30170> : Tokyo / Japan Plane Rectangular CS X
- <esri30171> : Tokyo / Japan Plane Rectangular CS XI
- <esri30172> : Tokyo / Japan Plane Rectangular CS XII
- <esri30173> : Tokyo / Japan Plane Rectangular CS XIII
- <esri30174> : Tokyo / Japan Plane Rectangular CS XIV
- <esri30175> : Tokyo / Japan Plane Rectangular CS XV
- <esri30176> : Tokyo / Japan Plane Rectangular CS XVI
- <esri30177> : Tokyo / Japan Plane Rectangular CS XVII
- <esri30178> : Tokyo / Japan Plane Rectangular CS XVIII
- <esri30179> : Tokyo / Japan Plane Rectangular CS XIX
- <esri30200> : Trinidad 1903 / Trinidad Grid
- <esri30339> : TC(1948) / UTM zone 39N
- <esri30340> : TC(1948) / UTM zone 40N
- <esri30491> : Voirol 1875 / Nord Algerie (ancienne)
- <esri30492> : Voirol 1875 / Sud Algerie (ancienne)
- <esri30729> : Nord Sahara 1959 / UTM zone 29N
- <esri30730> : Nord Sahara 1959 / UTM zone 30N
- <esri30731> : Nord Sahara 1959 / UTM zone 31N
- <esri30732> : Nord Sahara 1959 / UTM zone 32N
- <esri30791> : Nord Sahara 1959 / Voirol Unifie Nord
- <esri30792> : Nord Sahara 1959 / Voirol Unifie Sud
- <esri30800> : RT38 2.5 gon W
- <esri31028> : Yoff / UTM zone 28N
- <esri31121> : Zanderij / UTM zone 21N
- <esri31154> : Zanderij / TM 54 NW
- <esri31170> : Zanderij / Suriname Old TM
- <esri31171> : Zanderij / Suriname TM
- <esri31265> : MGI / 3-degree Gauss zone 5
- <esri31266> : MGI / 3-degree Gauss zone 6
- <esri31267> : MGI / 3-degree Gauss zone 7
- <esri31268> : MGI / 3-degree Gauss zone 8
- <esri31275> : MGI / Balkans zone 5
- <esri31276> : MGI / Balkans zone 6
- <esri31277> : MGI / Balkans zone 7
- <esri31278> : MGI / Balkans zone 8
- <esri31279> : MGI / Balkans zone 8
- <esri31281> : MGI (Ferro) / Austria West Zone
- <esri31282> : MGI (Ferro) / Austria Central Zone
- <esri31283> : MGI (Ferro) / Austria East Zone
- <esri31284> : MGI / M28
- <esri31285> : MGI / M31
- <esri31286> : MGI / M34
- <esri31287> : MGI / Austria Lambert
- <esri31291> : MGI (Ferro) / Austria West Zone
- <esri31292> : MGI (Ferro) / Austria Central Zone
- <esri31293> : MGI (Ferro) / Austria East Zone
- <esri31294> : MGI / M28
- <esri31295> : MGI / M31
- <esri31296> : MGI / M34
- <esri31297> : MGI / Austria Lambert
- <esri31300> : Belge 1972 / Belge Lambert 72
- <esri31370> : Belge 1972 / Belgian Lambert 72
- <esri31461> : DHDN / 3-degree Gauss zone 1
- <esri31462> : DHDN / 3-degree Gauss zone 2
- <esri31463> : DHDN / 3-degree Gauss zone 3
- <esri31464> : DHDN / 3-degree Gauss zone 4
- <esri31465> : DHDN / 3-degree Gauss zone 5
- <esri31466> : DHDN / Gauss-Kruger zone 2
- <esri31467> : DHDN / Gauss-Kruger zone 3
- <esri31468> : DHDN / Gauss-Kruger zone 4
- <esri31469> : DHDN / Gauss-Kruger zone 5
- <esri31528> : Conakry 1905 / UTM zone 28N
- <esri31529> : Conakry 1905 / UTM zone 29N
- <esri31600> : Dealul Piscului 1933/ Stereo 33
- <esri31700> : Dealul Piscului 1970/ Stereo 70
- <esri31838> : NGN / UTM zone 38N
- <esri31839> : NGN / UTM zone 39N
- <esri31900> : KUDAMS / KTM
- <esri31986> : SIRGAS / UTM zone 17N
- <esri31987> : SIRGAS / UTM zone 18N
- <esri31988> : SIRGAS / UTM zone 19N
- <esri31989> : SIRGAS / UTM zone 20N
- <esri31990> : SIRGAS / UTM zone 21N
- <esri31991> : SIRGAS / UTM zone 22N
- <esri31992> : SIRGAS / UTM zone 17S
- <esri31993> : SIRGAS / UTM zone 18S
- <esri31994> : SIRGAS / UTM zone 19S
- <esri31995> : SIRGAS / UTM zone 20S
- <esri31996> : SIRGAS / UTM zone 21S
- <esri31997> : SIRGAS / UTM zone 22S
- <esri31998> : SIRGAS / UTM zone 23S
- <esri31999> : SIRGAS / UTM zone 24S
- <esri32000> : SIRGAS / UTM zone 25S
- <esri32001> : NAD27 / Montana North
- <esri32002> : NAD27 / Montana Central
- <esri32003> : NAD27 / Montana South
- <esri32005> : NAD27 / Nebraska North
- <esri32006> : NAD27 / Nebraska South
- <esri32007> : NAD27 / Nevada East
- <esri32008> : NAD27 / Nevada Central
- <esri32009> : NAD27 / Nevada West
- <esri32010> : NAD27 / New Hampshire
- <esri32011> : NAD27 / New Jersey
- <esri32012> : NAD27 / New Mexico East
- <esri32013> : NAD27 / New Mexico Central
- <esri32014> : NAD27 / New Mexico West
- <esri32015> : NAD27 / New York East
- <esri32016> : NAD27 / New York Central
- <esri32017> : NAD27 / New York West
- <esri32018> : NAD27 / New York Long Island
- <esri32019> : NAD27 / North Carolina
- <esri32020> : NAD27 / North Dakota North
- <esri32021> : NAD27 / North Dakota South
- <esri32022> : NAD27 / Ohio North
- <esri32023> : NAD27 / Ohio South
- <esri32024> : NAD27 / Oklahoma North
- <esri32025> : NAD27 / Oklahoma South
- <esri32026> : NAD27 / Oregon North
- <esri32027> : NAD27 / Oregon South
- <esri32028> : NAD27 / Pennsylvania North
- <esri32029> : NAD27 / Pennsylvania South
- <esri32030> : NAD27 / Rhode Island
- <esri32031> : NAD27 / South Carolina North
- <esri32033> : NAD27 / South Carolina South
- <esri32034> : NAD27 / South Dakota North
- <esri32035> : NAD27 / South Dakota South
- <esri32036> : NAD27 / Tennessee
- <esri32037> : NAD27 / Texas North
- <esri32038> : NAD27 / Texas North Central
- <esri32039> : NAD27 / Texas Central
- <esri32040> : NAD27 / Texas South Central
- <esri32041> : NAD27 / Texas South
- <esri32042> : NAD27 / Utah North
- <esri32043> : NAD27 / Utah Central
- <esri32044> : NAD27 / Utah South
- <esri32045> : NAD27 / Vermont
- <esri32046> : NAD27 / Virginia North
- <esri32047> : NAD27 / Virginia South
- <esri32048> : NAD27 / Washington North
- <esri32049> : NAD27 / Washington South
- <esri32050> : NAD27 / West Virginia North
- <esri32051> : NAD27 / West Virginia South
- <esri32052> : NAD27 / Wisconsin North
- <esri32053> : NAD27 / Wisconsin Central
- <esri32054> : NAD27 / Wisconsin South
- <esri32055> : NAD27 / Wyoming East
- <esri32056> : NAD27 / Wyoming East Central
- <esri32057> : NAD27 / Wyoming West Central
- <esri32058> : NAD27 / Wyoming West
- <esri32061> : NAD27 / Guatemala Norte
- <esri32062> : NAD27 / Guatemala Sur
- <esri32064> : NAD27 / BLM 14N (ftUS)
- <esri32065> : NAD27 / BLM 15N (ftUS)
- <esri32066> : NAD27 / BLM 16N (ftUS)
- <esri32067> : NAD27 / BLM 17N (ftUS)
- <esri32074> : NAD27 / BLM 14N (feet)
- <esri32075> : NAD27 / BLM 15N (feet)
- <esri32076> : NAD27 / BLM 16N (feet)
- <esri32077> : NAD27 / BLM 17N (feet)
- <esri32081> : NAD27 / MTM zone 1
- <esri32082> : NAD27 / MTM zone 2
- <esri32083> : NAD27 / MTM zone 3
- <esri32084> : NAD27 / MTM zone 4
- <esri32085> : NAD27 / MTM zone 5
- <esri32086> : NAD27 / MTM zone 6
- <esri32098> : NAD27 / Quebec Lambert
- <esri32100> : NAD83 / Montana
- <esri32104> : NAD83 / Nebraska
- <esri32107> : NAD83 / Nevada East
- <esri32108> : NAD83 / Nevada Central
- <esri32109> : NAD83 / Nevada West
- <esri32110> : NAD83 / New Hampshire
- <esri32111> : NAD83 / New Jersey
- <esri32112> : NAD83 / New Mexico East
- <esri32113> : NAD83 / New Mexico Central
- <esri32114> : NAD83 / New Mexico West
- <esri32115> : NAD83 / New York East
- <esri32116> : NAD83 / New York Central
- <esri32117> : NAD83 / New York West
- <esri32118> : NAD83 / New York Long Island
- <esri32119> : NAD83 / North Carolina
- <esri32120> : NAD83 / North Dakota North
- <esri32121> : NAD83 / North Dakota South
- <esri32122> : NAD83 / Ohio North
- <esri32123> : NAD83 / Ohio South
- <esri32124> : NAD83 / Oklahoma North
- <esri32125> : NAD83 / Oklahoma South
- <esri32126> : NAD83 / Oregon North
- <esri32127> : NAD83 / Oregon South
- <esri32128> : NAD83 / Pennsylvania North
- <esri32129> : NAD83 / Pennsylvania South
- <esri32130> : NAD83 / Rhode Island
- <esri32133> : NAD83 / South Carolina
- <esri32134> : NAD83 / South Dakota North
- <esri32135> : NAD83 / South Dakota South
- <esri32136> : NAD83 / Tennessee
- <esri32137> : NAD83 / Texas North
- <esri32138> : NAD83 / Texas North Central
- <esri32139> : NAD83 / Texas Central
- <esri32140> : NAD83 / Texas South Central
- <esri32141> : NAD83 / Texas South
- <esri32142> : NAD83 / Utah North
- <esri32143> : NAD83 / Utah Central
- <esri32144> : NAD83 / Utah South
- <esri32145> : NAD83 / Vermont
- <esri32146> : NAD83 / Virginia North
- <esri32147> : NAD83 / Virginia South
- <esri32148> : NAD83 / Washington North
- <esri32149> : NAD83 / Washington South
- <esri32150> : NAD83 / West Virginia North
- <esri32151> : NAD83 / West Virginia South
- <esri32152> : NAD83 / Wisconsin North
- <esri32153> : NAD83 / Wisconsin Central
- <esri32154> : NAD83 / Wisconsin South
- <esri32155> : NAD83 / Wyoming East
- <esri32156> : NAD83 / Wyoming East Central
- <esri32157> : NAD83 / Wyoming West Central
- <esri32158> : NAD83 / Wyoming West
- <esri32161> : NAD83 / Puerto Rico & Virgin Is.
- <esri32180> : NAD83 / SCoPQ zone 2
- <esri32181> : NAD83 / MTM zone 1
- <esri32182> : NAD83 / MTM zone 2
- <esri32183> : NAD83 / MTM zone 3
- <esri32184> : NAD83 / MTM zone 4
- <esri32185> : NAD83 / MTM zone 5
- <esri32186> : NAD83 / MTM zone 6
- <esri32187> : NAD83 / MTM zone 7
- <esri32188> : NAD83 / MTM zone 8
- <esri32189> : NAD83 / MTM zone 9
- <esri32190> : NAD83 / MTM zone 10
- <esri32191> : NAD83 / MTM zone 11
- <esri32192> : NAD83 / MTM zone 12
- <esri32193> : NAD83 / MTM zone 13
- <esri32194> : NAD83 / MTM zone 14
- <esri32195> : NAD83 / MTM zone 15
- <esri32196> : NAD83 / MTM zone 16
- <esri32197> : NAD83 / MTM zone 17
- <esri32198> : NAD83 / Quebec Lambert
- <esri32201> : WGS 72 / UTM zone 1N
- <esri32202> : WGS 72 / UTM zone 2N
- <esri32203> : WGS 72 / UTM zone 3N
- <esri32204> : WGS 72 / UTM zone 4N
- <esri32205> : WGS 72 / UTM zone 5N
- <esri32206> : WGS 72 / UTM zone 6N
- <esri32207> : WGS 72 / UTM zone 7N
- <esri32208> : WGS 72 / UTM zone 8N
- <esri32209> : WGS 72 / UTM zone 9N
- <esri32210> : WGS 72 / UTM zone 10N
- <esri32211> : WGS 72 / UTM zone 11N
- <esri32212> : WGS 72 / UTM zone 12N
- <esri32213> : WGS 72 / UTM zone 13N
- <esri32214> : WGS 72 / UTM zone 14N
- <esri32215> : WGS 72 / UTM zone 15N
- <esri32216> : WGS 72 / UTM zone 16N
- <esri32217> : WGS 72 / UTM zone 17N
- <esri32218> : WGS 72 / UTM zone 18N
- <esri32219> : WGS 72 / UTM zone 19N
- <esri32220> : WGS 72 / UTM zone 20N
- <esri32221> : WGS 72 / UTM zone 21N
- <esri32222> : WGS 72 / UTM zone 22N
- <esri32223> : WGS 72 / UTM zone 23N
- <esri32224> : WGS 72 / UTM zone 24N
- <esri32225> : WGS 72 / UTM zone 25N
- <esri32226> : WGS 72 / UTM zone 26N
- <esri32227> : WGS 72 / UTM zone 27N
- <esri32228> : WGS 72 / UTM zone 28N
- <esri32229> : WGS 72 / UTM zone 29N
- <esri32230> : WGS 72 / UTM zone 30N
- <esri32231> : WGS 72 / UTM zone 31N
- <esri32232> : WGS 72 / UTM zone 32N
- <esri32233> : WGS 72 / UTM zone 33N
- <esri32234> : WGS 72 / UTM zone 34N
- <esri32235> : WGS 72 / UTM zone 35N
- <esri32236> : WGS 72 / UTM zone 36N
- <esri32237> : WGS 72 / UTM zone 37N
- <esri32238> : WGS 72 / UTM zone 38N
- <esri32239> : WGS 72 / UTM zone 39N
- <esri32240> : WGS 72 / UTM zone 40N
- <esri32241> : WGS 72 / UTM zone 41N
- <esri32242> : WGS 72 / UTM zone 42N
- <esri32243> : WGS 72 / UTM zone 43N
- <esri32244> : WGS 72 / UTM zone 44N
- <esri32245> : WGS 72 / UTM zone 45N
- <esri32246> : WGS 72 / UTM zone 46N
- <esri32247> : WGS 72 / UTM zone 47N
- <esri32248> : WGS 72 / UTM zone 48N
- <esri32249> : WGS 72 / UTM zone 49N
- <esri32250> : WGS 72 / UTM zone 50N
- <esri32251> : WGS 72 / UTM zone 51N
- <esri32252> : WGS 72 / UTM zone 52N
- <esri32253> : WGS 72 / UTM zone 53N
- <esri32254> : WGS 72 / UTM zone 54N
- <esri32255> : WGS 72 / UTM zone 55N
- <esri32256> : WGS 72 / UTM zone 56N
- <esri32257> : WGS 72 / UTM zone 57N
- <esri32258> : WGS 72 / UTM zone 58N
- <esri32259> : WGS 72 / UTM zone 59N
- <esri32260> : WGS 72 / UTM zone 60N
- <esri32301> : WGS 72 / UTM zone 1S
- <esri32302> : WGS 72 / UTM zone 2S
- <esri32303> : WGS 72 / UTM zone 3S
- <esri32304> : WGS 72 / UTM zone 4S
- <esri32305> : WGS 72 / UTM zone 5S
- <esri32306> : WGS 72 / UTM zone 6S
- <esri32307> : WGS 72 / UTM zone 7S
- <esri32308> : WGS 72 / UTM zone 8S
- <esri32309> : WGS 72 / UTM zone 9S
- <esri32310> : WGS 72 / UTM zone 10S
- <esri32311> : WGS 72 / UTM zone 11S
- <esri32312> : WGS 72 / UTM zone 12S
- <esri32313> : WGS 72 / UTM zone 13S
- <esri32314> : WGS 72 / UTM zone 14S
- <esri32315> : WGS 72 / UTM zone 15S
- <esri32316> : WGS 72 / UTM zone 16S
- <esri32317> : WGS 72 / UTM zone 17S
- <esri32318> : WGS 72 / UTM zone 18S
- <esri32319> : WGS 72 / UTM zone 19S
- <esri32320> : WGS 72 / UTM zone 20S
- <esri32321> : WGS 72 / UTM zone 21S
- <esri32322> : WGS 72 / UTM zone 22S
- <esri32323> : WGS 72 / UTM zone 23S
- <esri32324> : WGS 72 / UTM zone 24S
- <esri32325> : WGS 72 / UTM zone 25S
- <esri32326> : WGS 72 / UTM zone 26S
- <esri32327> : WGS 72 / UTM zone 27S
- <esri32328> : WGS 72 / UTM zone 28S
- <esri32329> : WGS 72 / UTM zone 29S
- <esri32330> : WGS 72 / UTM zone 30S
- <esri32331> : WGS 72 / UTM zone 31S
- <esri32332> : WGS 72 / UTM zone 32S
- <esri32333> : WGS 72 / UTM zone 33S
- <esri32334> : WGS 72 / UTM zone 34S
- <esri32335> : WGS 72 / UTM zone 35S
- <esri32336> : WGS 72 / UTM zone 36S
- <esri32337> : WGS 72 / UTM zone 37S
- <esri32338> : WGS 72 / UTM zone 38S
- <esri32339> : WGS 72 / UTM zone 39S
- <esri32340> : WGS 72 / UTM zone 40S
- <esri32341> : WGS 72 / UTM zone 41S
- <esri32342> : WGS 72 / UTM zone 42S
- <esri32343> : WGS 72 / UTM zone 43S
- <esri32344> : WGS 72 / UTM zone 44S
- <esri32345> : WGS 72 / UTM zone 45S
- <esri32346> : WGS 72 / UTM zone 46S
- <esri32347> : WGS 72 / UTM zone 47S
- <esri32348> : WGS 72 / UTM zone 48S
- <esri32349> : WGS 72 / UTM zone 49S
- <esri32350> : WGS 72 / UTM zone 50S
- <esri32351> : WGS 72 / UTM zone 51S
- <esri32352> : WGS 72 / UTM zone 52S
- <esri32353> : WGS 72 / UTM zone 53S
- <esri32354> : WGS 72 / UTM zone 54S
- <esri32355> : WGS 72 / UTM zone 55S
- <esri32356> : WGS 72 / UTM zone 56S
- <esri32357> : WGS 72 / UTM zone 57S
- <esri32358> : WGS 72 / UTM zone 58S
- <esri32359> : WGS 72 / UTM zone 59S
- <esri32360> : WGS 72 / UTM zone 60S
- <esri32401> : WGS 72BE / UTM zone 1N
- <esri32402> : WGS 72BE / UTM zone 2N
- <esri32403> : WGS 72BE / UTM zone 3N
- <esri32404> : WGS 72BE / UTM zone 4N
- <esri32405> : WGS 72BE / UTM zone 5N
- <esri32406> : WGS 72BE / UTM zone 6N
- <esri32407> : WGS 72BE / UTM zone 7N
- <esri32408> : WGS 72BE / UTM zone 8N
- <esri32409> : WGS 72BE / UTM zone 9N
- <esri32410> : WGS 72BE / UTM zone 10N
- <esri32411> : WGS 72BE / UTM zone 11N
- <esri32412> : WGS 72BE / UTM zone 12N
- <esri32413> : WGS 72BE / UTM zone 13N
- <esri32414> : WGS 72BE / UTM zone 14N
- <esri32415> : WGS 72BE / UTM zone 15N
- <esri32416> : WGS 72BE / UTM zone 16N
- <esri32417> : WGS 72BE / UTM zone 17N
- <esri32418> : WGS 72BE / UTM zone 18N
- <esri32419> : WGS 72BE / UTM zone 19N
- <esri32420> : WGS 72BE / UTM zone 20N
- <esri32421> : WGS 72BE / UTM zone 21N
- <esri32422> : WGS 72BE / UTM zone 22N
- <esri32423> : WGS 72BE / UTM zone 23N
- <esri32424> : WGS 72BE / UTM zone 24N
- <esri32425> : WGS 72BE / UTM zone 25N
- <esri32426> : WGS 72BE / UTM zone 26N
- <esri32427> : WGS 72BE / UTM zone 27N
- <esri32428> : WGS 72BE / UTM zone 28N
- <esri32429> : WGS 72BE / UTM zone 29N
- <esri32430> : WGS 72BE / UTM zone 30N
- <esri32431> : WGS 72BE / UTM zone 31N
- <esri32432> : WGS 72BE / UTM zone 32N
- <esri32433> : WGS 72BE / UTM zone 33N
- <esri32434> : WGS 72BE / UTM zone 34N
- <esri32435> : WGS 72BE / UTM zone 35N
- <esri32436> : WGS 72BE / UTM zone 36N
- <esri32437> : WGS 72BE / UTM zone 37N
- <esri32438> : WGS 72BE / UTM zone 38N
- <esri32439> : WGS 72BE / UTM zone 39N
- <esri32440> : WGS 72BE / UTM zone 40N
- <esri32441> : WGS 72BE / UTM zone 41N
- <esri32442> : WGS 72BE / UTM zone 42N
- <esri32443> : WGS 72BE / UTM zone 43N
- <esri32444> : WGS 72BE / UTM zone 44N
- <esri32445> : WGS 72BE / UTM zone 45N
- <esri32446> : WGS 72BE / UTM zone 46N
- <esri32447> : WGS 72BE / UTM zone 47N
- <esri32448> : WGS 72BE / UTM zone 48N
- <esri32449> : WGS 72BE / UTM zone 49N
- <esri32450> : WGS 72BE / UTM zone 50N
- <esri32451> : WGS 72BE / UTM zone 51N
- <esri32452> : WGS 72BE / UTM zone 52N
- <esri32453> : WGS 72BE / UTM zone 53N
- <esri32454> : WGS 72BE / UTM zone 54N
- <esri32455> : WGS 72BE / UTM zone 55N
- <esri32456> : WGS 72BE / UTM zone 56N
- <esri32457> : WGS 72BE / UTM zone 57N
- <esri32458> : WGS 72BE / UTM zone 58N
- <esri32459> : WGS 72BE / UTM zone 59N
- <esri32460> : WGS 72BE / UTM zone 60N
- <esri32501> : WGS 72BE / UTM zone 1S
- <esri32502> : WGS 72BE / UTM zone 2S
- <esri32503> : WGS 72BE / UTM zone 3S
- <esri32504> : WGS 72BE / UTM zone 4S
- <esri32505> : WGS 72BE / UTM zone 5S
- <esri32506> : WGS 72BE / UTM zone 6S
- <esri32507> : WGS 72BE / UTM zone 7S
- <esri32508> : WGS 72BE / UTM zone 8S
- <esri32509> : WGS 72BE / UTM zone 9S
- <esri32510> : WGS 72BE / UTM zone 10S
- <esri32511> : WGS 72BE / UTM zone 11S
- <esri32512> : WGS 72BE / UTM zone 12S
- <esri32513> : WGS 72BE / UTM zone 13S
- <esri32514> : WGS 72BE / UTM zone 14S
- <esri32515> : WGS 72BE / UTM zone 15S
- <esri32516> : WGS 72BE / UTM zone 16S
- <esri32517> : WGS 72BE / UTM zone 17S
- <esri32518> : WGS 72BE / UTM zone 18S
- <esri32519> : WGS 72BE / UTM zone 19S
- <esri32520> : WGS 72BE / UTM zone 20S
- <esri32521> : WGS 72BE / UTM zone 21S
- <esri32522> : WGS 72BE / UTM zone 22S
- <esri32523> : WGS 72BE / UTM zone 23S
- <esri32524> : WGS 72BE / UTM zone 24S
- <esri32525> : WGS 72BE / UTM zone 25S
- <esri32526> : WGS 72BE / UTM zone 26S
- <esri32527> : WGS 72BE / UTM zone 27S
- <esri32528> : WGS 72BE / UTM zone 28S
- <esri32529> : WGS 72BE / UTM zone 29S
- <esri32530> : WGS 72BE / UTM zone 30S
- <esri32531> : WGS 72BE / UTM zone 31S
- <esri32532> : WGS 72BE / UTM zone 32S
- <esri32533> : WGS 72BE / UTM zone 33S
- <esri32534> : WGS 72BE / UTM zone 34S
- <esri32535> : WGS 72BE / UTM zone 35S
- <esri32536> : WGS 72BE / UTM zone 36S
- <esri32537> : WGS 72BE / UTM zone 37S
- <esri32538> : WGS 72BE / UTM zone 38S
- <esri32539> : WGS 72BE / UTM zone 39S
- <esri32540> : WGS 72BE / UTM zone 40S
- <esri32541> : WGS 72BE / UTM zone 41S
- <esri32542> : WGS 72BE / UTM zone 42S
- <esri32543> : WGS 72BE / UTM zone 43S
- <esri32544> : WGS 72BE / UTM zone 44S
- <esri32545> : WGS 72BE / UTM zone 45S
- <esri32546> : WGS 72BE / UTM zone 46S
- <esri32547> : WGS 72BE / UTM zone 47S
- <esri32548> : WGS 72BE / UTM zone 48S
- <esri32549> : WGS 72BE / UTM zone 49S
- <esri32550> : WGS 72BE / UTM zone 50S
- <esri32551> : WGS 72BE / UTM zone 51S
- <esri32552> : WGS 72BE / UTM zone 52S
- <esri32553> : WGS 72BE / UTM zone 53S
- <esri32554> : WGS 72BE / UTM zone 54S
- <esri32555> : WGS 72BE / UTM zone 55S
- <esri32556> : WGS 72BE / UTM zone 56S
- <esri32557> : WGS 72BE / UTM zone 57S
- <esri32558> : WGS 72BE / UTM zone 58S
- <esri32559> : WGS 72BE / UTM zone 59S
- <esri32560> : WGS 72BE / UTM zone 60S
- <esri32601> : WGS 84 / UTM zone 1N
- <esri32602> : WGS 84 / UTM zone 2N
- <esri32603> : WGS 84 / UTM zone 3N
- <esri32604> : WGS 84 / UTM zone 4N
- <esri32605> : WGS 84 / UTM zone 5N
- <esri32606> : WGS 84 / UTM zone 6N
- <esri32607> : WGS 84 / UTM zone 7N
- <esri32608> : WGS 84 / UTM zone 8N
- <esri32609> : WGS 84 / UTM zone 9N
- <esri32610> : WGS 84 / UTM zone 10N
- <esri32611> : WGS 84 / UTM zone 11N
- <esri32612> : WGS 84 / UTM zone 12N
- <esri32613> : WGS 84 / UTM zone 13N
- <esri32614> : WGS 84 / UTM zone 14N
- <esri32615> : WGS 84 / UTM zone 15N
- <esri32616> : WGS 84 / UTM zone 16N
- <esri32617> : WGS 84 / UTM zone 17N
- <esri32618> : WGS 84 / UTM zone 18N
- <esri32619> : WGS 84 / UTM zone 19N
- <esri32620> : WGS 84 / UTM zone 20N
- <esri32621> : WGS 84 / UTM zone 21N
- <esri32622> : WGS 84 / UTM zone 22N
- <esri32623> : WGS 84 / UTM zone 23N
- <esri32624> : WGS 84 / UTM zone 24N
- <esri32625> : WGS 84 / UTM zone 25N
- <esri32626> : WGS 84 / UTM zone 26N
- <esri32627> : WGS 84 / UTM zone 27N
- <esri32628> : WGS 84 / UTM zone 28N
- <esri32629> : WGS 84 / UTM zone 29N
- <esri32630> : WGS 84 / UTM zone 30N
- <esri32631> : WGS 84 / UTM zone 31N
- <esri32632> : WGS 84 / UTM zone 32N
- <esri32633> : WGS 84 / UTM zone 33N
- <esri32634> : WGS 84 / UTM zone 34N
- <esri32635> : WGS 84 / UTM zone 35N
- <esri32636> : WGS 84 / UTM zone 36N
- <esri32637> : WGS 84 / UTM zone 37N
- <esri32638> : WGS 84 / UTM zone 38N
- <esri32639> : WGS 84 / UTM zone 39N
- <esri32640> : WGS 84 / UTM zone 40N
- <esri32641> : WGS 84 / UTM zone 41N
- <esri32642> : WGS 84 / UTM zone 42N
- <esri32643> : WGS 84 / UTM zone 43N
- <esri32644> : WGS 84 / UTM zone 44N
- <esri32645> : WGS 84 / UTM zone 45N
- <esri32646> : WGS 84 / UTM zone 46N
- <esri32647> : WGS 84 / UTM zone 47N
- <esri32648> : WGS 84 / UTM zone 48N
- <esri32649> : WGS 84 / UTM zone 49N
- <esri32650> : WGS 84 / UTM zone 50N
- <esri32651> : WGS 84 / UTM zone 51N
- <esri32652> : WGS 84 / UTM zone 52N
- <esri32653> : WGS 84 / UTM zone 53N
- <esri32654> : WGS 84 / UTM zone 54N
- <esri32655> : WGS 84 / UTM zone 55N
- <esri32656> : WGS 84 / UTM zone 56N
- <esri32657> : WGS 84 / UTM zone 57N
- <esri32658> : WGS 84 / UTM zone 58N
- <esri32659> : WGS 84 / UTM zone 59N
- <esri32660> : WGS 84 / UTM zone 60N
- <esri32661> : WGS 84 / UPS North
- <esri32701> : WGS 84 / UTM zone 1S
- <esri32702> : WGS 84 / UTM zone 2S
- <esri32703> : WGS 84 / UTM zone 3S
- <esri32704> : WGS 84 / UTM zone 4S
- <esri32705> : WGS 84 / UTM zone 5S
- <esri32706> : WGS 84 / UTM zone 6S
- <esri32707> : WGS 84 / UTM zone 7S
- <esri32708> : WGS 84 / UTM zone 8S
- <esri32709> : WGS 84 / UTM zone 9S
- <esri32710> : WGS 84 / UTM zone 10S
- <esri32711> : WGS 84 / UTM zone 11S
- <esri32712> : WGS 84 / UTM zone 12S
- <esri32713> : WGS 84 / UTM zone 13S
- <esri32714> : WGS 84 / UTM zone 14S
- <esri32715> : WGS 84 / UTM zone 15S
- <esri32716> : WGS 84 / UTM zone 16S
- <esri32717> : WGS 84 / UTM zone 17S
- <esri32718> : WGS 84 / UTM zone 18S
- <esri32719> : WGS 84 / UTM zone 19S
- <esri32720> : WGS 84 / UTM zone 20S
- <esri32721> : WGS 84 / UTM zone 21S
- <esri32722> : WGS 84 / UTM zone 22S
- <esri32723> : WGS 84 / UTM zone 23S
- <esri32724> : WGS 84 / UTM zone 24S
- <esri32725> : WGS 84 / UTM zone 25S
- <esri32726> : WGS 84 / UTM zone 26S
- <esri32727> : WGS 84 / UTM zone 27S
- <esri32728> : WGS 84 / UTM zone 28S
- <esri32729> : WGS 84 / UTM zone 29S
- <esri32730> : WGS 84 / UTM zone 30S
- <esri32731> : WGS 84 / UTM zone 31S
- <esri32732> : WGS 84 / UTM zone 32S
- <esri32733> : WGS 84 / UTM zone 33S
- <esri32734> : WGS 84 / UTM zone 34S
- <esri32735> : WGS 84 / UTM zone 35S
- <esri32736> : WGS 84 / UTM zone 36S
- <esri32737> : WGS 84 / UTM zone 37S
- <esri32738> : WGS 84 / UTM zone 38S
- <esri32739> : WGS 84 / UTM zone 39S
- <esri32740> : WGS 84 / UTM zone 40S
- <esri32741> : WGS 84 / UTM zone 41S
- <esri32742> : WGS 84 / UTM zone 42S
- <esri32743> : WGS 84 / UTM zone 43S
- <esri32744> : WGS 84 / UTM zone 44S
- <esri32745> : WGS 84 / UTM zone 45S
- <esri32746> : WGS 84 / UTM zone 46S
- <esri32747> : WGS 84 / UTM zone 47S
- <esri32748> : WGS 84 / UTM zone 48S
- <esri32749> : WGS 84 / UTM zone 49S
- <esri32750> : WGS 84 / UTM zone 50S
- <esri32751> : WGS 84 / UTM zone 51S
- <esri32752> : WGS 84 / UTM zone 52S
- <esri32753> : WGS 84 / UTM zone 53S
- <esri32754> : WGS 84 / UTM zone 54S
- <esri32755> : WGS 84 / UTM zone 55S
- <esri32756> : WGS 84 / UTM zone 56S
- <esri32757> : WGS 84 / UTM zone 57S
- <esri32758> : WGS 84 / UTM zone 58S
- <esri32759> : WGS 84 / UTM zone 59S
- <esri32760> : WGS 84 / UTM zone 60S
- <esri32761> : WGS 84 / UPS South
- <esri32766> : WGS 84 / TM 36 SE
- <esri20002> : Pulkovo 1995 GK Zone 2
- <esri20003> : Pulkovo 1995 GK Zone 3
- <esri20062> : Pulkovo 1995 GK Zone 2N
- <esri20063> : Pulkovo 1995 GK Zone 3N
- <esri24721> : La Canoa UTM Zone 21N
- <esri26761> : NAD 1927 StatePlane Hawaii 1 FIPS 5101
- <esri26762> : NAD 1927 StatePlane Hawaii 2 FIPS 5102
- <esri26763> : NAD 1927 StatePlane Hawaii 3 FIPS 5103
- <esri26764> : NAD 1927 StatePlane Hawaii 4 FIPS 5104
- <esri26765> : NAD 1927 StatePlane Hawaii 5 FIPS 5105
- <esri26788> : NAD 1927 StatePlane Michigan North FIPS 2111
- <esri26789> : NAD 1927 StatePlane Michigan Central FIPS 2112
- <esri26790> : NAD 1927 StatePlane Michigan South FIPS 2113
- <esri30591> : Nord Algerie
- <esri30592> : Sud Algerie
- <esri31491> : Germany Zone 1
- <esri31492> : Germany Zone 2
- <esri31493> : Germany Zone 3
- <esri31494> : Germany Zone 4
- <esri31495> : Germany Zone 5
- <esri32059> : NAD 1927 StatePlane Puerto Rico FIPS 5201
- <esri32060> : NAD 1927 StatePlane Virgin Islands St Croix FIPS 5202
- <esri53001> : Sphere Plate Carree
- <esri53002> : Sphere Equidistant Cylindrical
- <esri53003> : Sphere Miller Cylindrical
- <esri53004> : Sphere Mercator
- <esri53008> : Sphere Sinusoidal
- <esri53009> : Sphere Mollweide
- <esri53010> : Sphere Eckert VI
- <esri53011> : Sphere Eckert V
- <esri53012> : Sphere Eckert IV
- <esri53013> : Sphere Eckert III
- <esri53014> : Sphere Eckert II
- <esri53015> : Sphere Eckert I
- <esri53016> : Sphere Gall Stereographic
- <esri53017> : Sphere Behrmann
- <esri53018> : Sphere Winkel I
- <esri53019> : Sphere Winkel II
- <esri53021> : Sphere Polyconic
- <esri53022> : Sphere Quartic Authalic
- <esri53023> : Sphere Loximuthal
- <esri53024> : Sphere Bonne
- <esri53025> : Sphere Hotine
- <esri53026> : Sphere Stereographic
- <esri53027> : Sphere Equidistant Conic
- <esri53028> : Sphere Cassini
- <esri53029> : Sphere Van der Grinten I
- <esri53030> : Sphere Robinson
- <esri53031> : Sphere Two Point Equidistant
- <esri53032> : Sphere Azimuthal Equidistant
- <esri54001> : World Plate Carree
- <esri54002> : World Equidistant Cylindrical
- <esri54003> : World Miller Cylindrical
- <esri54004> : World Mercator
- <esri54008> : World Sinusoidal
- <esri54009> : World Mollweide
- <esri54010> : World Eckert VI
- <esri54011> : World Eckert V
- <esri54012> : World Eckert IV
- <esri54013> : World Eckert III
- <esri54014> : World Eckert II
- <esri54015> : World Eckert I
- <esri54016> : World Gall Stereographic
- <esri54017> : World Behrmann
- <esri54018> : World Winkel I
- <esri54019> : World Winkel II
- <esri54021> : World Polyconic
- <esri54022> : World Quartic Authalic
- <esri54023> : World Loximuthal
- <esri54024> : World Bonne
- <esri54025> : World Hotine
- <esri54026> : World Stereographic
- <esri54027> : World Equidistant Conic
- <esri54028> : World Cassini
- <esri54029> : World Van der Grinten I
- <esri54030> : World Robinson
- <esri54031> : World Two Point Equidistant
- <esri54032> : World Azimuthal Equidistant
- <esri65061> : NAD 1927 StatePlane Guam FIPS 5400
- <esri65161> : NAD 1983 StatePlane Guam FIPS 5400
- <esri102001> : Canada Albers Equal Area Conic
- <esri102002> : Canada Lambert Conformal Conic
- <esri102003> : USA Contiguous Albers Equal Area Conic
- <esri102004> : USA Contiguous Lambert Conformal Conic
- <esri102005> : USA Contiguous Equidistant Conic
- <esri102006> : Alaska Albers Equal Area Conic
- <esri102007> : Hawaii Albers Equal Area Conic
- <esri102008> : North America Albers Equal Area Conic
- <esri102009> : North America Lambert Conformal Conic
- <esri102010> : North America Equidistant Conic
- <esri102011> : Africa Sinusoidal
- <esri102012> : Asia Lambert Conformal Conic
- <esri102013> : Europe Albers Equal Area Conic
- <esri102014> : Europe Lambert Conformal Conic
- <esri102015> : South America Lambert Conformal Conic
- <esri102016> : North Pole Azimuthal Equidistant
- <esri102017> : North Pole Lambert Azimuthal Equal Area
- <esri102018> : North Pole Stereographic
- <esri102019> : South Pole Azimuthal Equidistant
- <esri102020> : South Pole Lambert Azimuthal Equal Area
- <esri102021> : South Pole Stereographic
- <esri102022> : Africa Albers Equal Area Conic
- <esri102023> : Africa Equidistant Conic
- <esri102024> : Africa Lambert Conformal Conic
- <esri102025> : Asia North Albers Equal Area Conic
- <esri102026> : Asia North Equidistant Conic
- <esri102027> : Asia North Lambert Conformal Conic
- <esri102028> : Asia South Albers Equal Area Conic
- <esri102029> : Asia South Equidistant Conic
- <esri102030> : Asia South Lambert Conformal Conic
- <esri102031> : Europe Equidistant Conic
- <esri102032> : South America Equidistant Conic
- <esri102033> : South America Albers Equal Area Conic
- <esri102065> : S-JTSK Krovak
- <esri102066> : S-JTSK Ferro Krovak East North
- <esri102067> : S-JTSK Krovak East North
- <esri102091> : Monte Mario Italy 1
- <esri102092> : Monte Mario Italy 2
- <esri102101> : NGO 1948 Norway Zone 1
- <esri102102> : NGO 1948 Norway Zone 2
- <esri102103> : NGO 1948 Norway Zone 3
- <esri102104> : NGO 1948 Norway Zone 4
- <esri102105> : NGO 1948 Norway Zone 5
- <esri102106> : NGO 1948 Norway Zone 6
- <esri102107> : NGO 1948 Norway Zone 7
- <esri102108> : NGO 1948 Norway Zone 8
- <esri102110> : RGF 1993 Lambert 93
- <esri102114> : Old Hawaiian UTM Zone 4N
- <esri102115> : Old Hawaiian UTM Zone 5N
- <esri102120> : NAD 1927 Michigan GeoRef Feet US
- <esri102121> : NAD 1983 Michigan GeoRef Feet US
- <esri102122> : NAD 1927 Michigan GeoRef Meters
- <esri102123> : NAD 1983 Michigan GeoRef Meters
- <esri102132> : NGO 1948 UTM Zone 32N
- <esri102133> : NGO 1948 UTM Zone 33N
- <esri102134> : NGO 1948 UTM Zone 34N
- <esri102135> : NGO 1948 UTM Zone 35N
- <esri102140> : Hong Kong 1980 Grid
- <esri102141> : Hong Kong 1980 UTM Zone 49N
- <esri102142> : Hong Kong 1980 UTM Zone 50N
- <esri102151> : Tokyo UTM Zone 51N
- <esri102152> : Tokyo UTM Zone 52N
- <esri102153> : Tokyo UTM Zone 53N
- <esri102154> : Tokyo UTM Zone 54N
- <esri102155> : Tokyo UTM Zone 55N
- <esri102156> : Tokyo UTM Zone 56N
- <esri102160> : Datum 73 Hayford Gauss IGeoE
- <esri102161> : Datum 73 Hayford Gauss IPCC
- <esri102162> : Graciosa Base SW 1948 UTM Zone 26N
- <esri102163> : Lisboa Bessel Bonne
- <esri102164> : Lisboa Hayford Gauss IGeoE
- <esri102165> : Lisboa Hayford Gauss IPCC
- <esri102166> : Observ Meteorologico 1939 UTM Zone 25N
- <esri102167> : Porto Santo 1936 UTM Zone 28N
- <esri102168> : Sao Braz UTM Zone 26N
- <esri102169> : Selvagem Grande 1938 UTM Zone 28N
- <esri102191> : Nord Maroc Degree
- <esri102192> : Sud Maroc Degree
- <esri102193> : Sahara Degree
- <esri102229> : NAD 1983 HARN StatePlane Alabama East FIPS 0101
- <esri102230> : NAD 1983 HARN StatePlane Alabama West FIPS 0102
- <esri102241> : NAD 1983 HARN StatePlane California I FIPS 0401
- <esri102242> : NAD 1983 HARN StatePlane California II FIPS 0402
- <esri102243> : NAD 1983 HARN StatePlane California III FIPS 0403
- <esri102244> : NAD 1983 HARN StatePlane California IV FIPS 0404
- <esri102245> : NAD 1983 HARN StatePlane California V FIPS 0405
- <esri102246> : NAD 1983 HARN StatePlane California VI FIPS 0406
- <esri102248> : NAD 1983 HARN StatePlane Arizona East FIPS 0201
- <esri102249> : NAD 1983 HARN StatePlane Arizona Central FIPS 0202
- <esri102250> : NAD 1983 HARN StatePlane Arizona West FIPS 0203
- <esri102251> : NAD 1983 HARN StatePlane Arkansas North FIPS 0301
- <esri102252> : NAD 1983 HARN StatePlane Arkansas South FIPS 0302
- <esri102253> : NAD 1983 HARN StatePlane Colorado North FIPS 0501
- <esri102254> : NAD 1983 HARN StatePlane Colorado Central FIPS 0502
- <esri102255> : NAD 1983 HARN StatePlane Colorado South FIPS 0503
- <esri102256> : NAD 1983 HARN StatePlane Connecticut FIPS 0600
- <esri102257> : NAD 1983 HARN StatePlane Delaware FIPS 0700
- <esri102258> : NAD 1983 HARN StatePlane Florida East FIPS 0901
- <esri102259> : NAD 1983 HARN StatePlane Florida West FIPS 0902
- <esri102260> : NAD 1983 HARN StatePlane Florida North FIPS 0903
- <esri102261> : NAD 1983 HARN StatePlane Hawaii 1 FIPS 5101
- <esri102262> : NAD 1983 HARN StatePlane Hawaii 2 FIPS 5102
- <esri102263> : NAD 1983 HARN StatePlane Hawaii 3 FIPS 5103
- <esri102264> : NAD 1983 HARN StatePlane Hawaii 4 FIPS 5104
- <esri102265> : NAD 1983 HARN StatePlane Hawaii 5 FIPS 5105
- <esri102266> : NAD 1983 HARN StatePlane Georgia East FIPS 1001
- <esri102267> : NAD 1983 HARN StatePlane Georgia West FIPS 1002
- <esri102268> : NAD 1983 HARN StatePlane Idaho East FIPS 1101
- <esri102269> : NAD 1983 HARN StatePlane Idaho Central FIPS 1102
- <esri102270> : NAD 1983 HARN StatePlane Idaho West FIPS 1103
- <esri102271> : NAD 1983 HARN StatePlane Illinois East FIPS 1201
- <esri102272> : NAD 1983 HARN StatePlane Illinois West FIPS 1202
- <esri102273> : NAD 1983 HARN StatePlane Indiana East FIPS 1301
- <esri102274> : NAD 1983 HARN StatePlane Indiana West FIPS 1302
- <esri102277> : NAD 1983 HARN StatePlane Kansas North FIPS 1501
- <esri102278> : NAD 1983 HARN StatePlane Kansas South FIPS 1502
- <esri102279> : NAD 1983 HARN StatePlane Kentucky North FIPS 1601
- <esri102280> : NAD 1983 HARN StatePlane Kentucky South FIPS 1602
- <esri102281> : NAD 1983 HARN StatePlane Louisiana North FIPS 1701
- <esri102282> : NAD 1983 HARN StatePlane Louisiana South FIPS 1702
- <esri102283> : NAD 1983 HARN StatePlane Maine East FIPS 1801
- <esri102284> : NAD 1983 HARN StatePlane Maine West FIPS 1802
- <esri102285> : NAD 1983 HARN StatePlane Maryland FIPS 1900
- <esri102286> : NAD 1983 HARN StatePlane Massachusetts Mainland FIPS 2001
- <esri102287> : NAD 1983 HARN StatePlane Massachusetts Island FIPS 2002
- <esri102288> : NAD 1983 HARN StatePlane Michigan North FIPS 2111
- <esri102289> : NAD 1983 HARN StatePlane Michigan Central FIPS 2112
- <esri102290> : NAD 1983 HARN StatePlane Michigan South FIPS 2113
- <esri102291> : NAD 1983 HARN StatePlane Minnesota North FIPS 2201
- <esri102292> : NAD 1983 HARN StatePlane Minnesota Central FIPS 2202
- <esri102293> : NAD 1983 HARN StatePlane Minnesota South FIPS 2203
- <esri102294> : NAD 1983 HARN StatePlane Mississippi East FIPS 2301
- <esri102295> : NAD 1983 HARN StatePlane Mississippi West FIPS 2302
- <esri102296> : NAD 1983 HARN StatePlane Missouri East FIPS 2401
- <esri102297> : NAD 1983 HARN StatePlane Missouri Central FIPS 2402
- <esri102298> : NAD 1983 HARN StatePlane Missouri West FIPS 2403
- <esri102300> : NAD 1983 HARN StatePlane Montana FIPS 2500
- <esri102304> : NAD 1983 HARN StatePlane Nebraska FIPS 2600
- <esri102307> : NAD 1983 HARN StatePlane Nevada East FIPS 2701
- <esri102308> : NAD 1983 HARN StatePlane Nevada Central FIPS 2702
- <esri102309> : NAD 1983 HARN StatePlane Nevada West FIPS 2703
- <esri102310> : NAD 1983 HARN StatePlane New Hampshire FIPS 2800
- <esri102311> : NAD 1983 HARN StatePlane New Jersey FIPS 2900
- <esri102312> : NAD 1983 HARN StatePlane New Mexico East FIPS 3001
- <esri102313> : NAD 1983 HARN StatePlane New Mexico Central FIPS 3002
- <esri102314> : NAD 1983 HARN StatePlane New Mexico West FIPS 3003
- <esri102315> : NAD 1983 HARN StatePlane New York East FIPS 3101
- <esri102316> : NAD 1983 HARN StatePlane New York Central FIPS 3102
- <esri102317> : NAD 1983 HARN StatePlane New York West FIPS 3103
- <esri102318> : NAD 1983 HARN StatePlane New York Long Island FIPS 3104
- <esri102320> : NAD 1983 HARN StatePlane North Dakota North FIPS 3301
- <esri102321> : NAD 1983 HARN StatePlane North Dakota South FIPS 3302
- <esri102322> : NAD 1983 HARN StatePlane Ohio North FIPS 3401
- <esri102323> : NAD 1983 HARN StatePlane Ohio South FIPS 3402
- <esri102324> : NAD 1983 HARN StatePlane Oklahoma North FIPS 3501
- <esri102325> : NAD 1983 HARN StatePlane Oklahoma South FIPS 3502
- <esri102326> : NAD 1983 HARN StatePlane Oregon North FIPS 3601
- <esri102327> : NAD 1983 HARN StatePlane Oregon South FIPS 3602
- <esri102330> : NAD 1983 HARN StatePlane Rhode Island FIPS 3800
- <esri102334> : NAD 1983 HARN StatePlane South Dakota North FIPS 4001
- <esri102335> : NAD 1983 HARN StatePlane South Dakota South FIPS 4002
- <esri102336> : NAD 1983 HARN StatePlane Tennessee FIPS 4100
- <esri102337> : NAD 1983 HARN StatePlane Texas North FIPS 4201
- <esri102338> : NAD 1983 HARN StatePlane Texas North Central FIPS 4202
- <esri102339> : NAD 1983 HARN StatePlane Texas Central FIPS 4203
- <esri102340> : NAD 1983 HARN StatePlane Texas South Central FIPS 4204
- <esri102341> : NAD 1983 HARN StatePlane Texas South FIPS 4205
- <esri102342> : NAD 1983 HARN StatePlane Utah North FIPS 4301
- <esri102343> : NAD 1983 HARN StatePlane Utah Central FIPS 4302
- <esri102344> : NAD 1983 HARN StatePlane Utah South FIPS 4303
- <esri102345> : NAD 1983 HARN StatePlane Vermont FIPS 4400
- <esri102346> : NAD 1983 HARN StatePlane Virginia North FIPS 4501
- <esri102347> : NAD 1983 HARN StatePlane Virginia South FIPS 4502
- <esri102348> : NAD 1983 HARN StatePlane Washington North FIPS 4601
- <esri102349> : NAD 1983 HARN StatePlane Washington South FIPS 4602
- <esri102350> : NAD 1983 HARN StatePlane West Virginia North FIPS 4701
- <esri102351> : NAD 1983 HARN StatePlane West Virginia South FIPS 4702
- <esri102352> : NAD 1983 HARN StatePlane Wisconsin North FIPS 4801
- <esri102353> : NAD 1983 HARN StatePlane Wisconsin Central FIPS 4802
- <esri102354> : NAD 1983 HARN StatePlane Wisconsin South FIPS 4803
- <esri102355> : NAD 1983 HARN StatePlane Wyoming East FIPS 4901
- <esri102356> : NAD 1983 HARN StatePlane Wyoming East Central FIPS 4902
- <esri102357> : NAD 1983 HARN StatePlane Wyoming West Central FIPS 4903
- <esri102358> : NAD 1983 HARN StatePlane Wyoming West FIPS 4904
- <esri102361> : NAD 1983 HARN StatePlane Puerto Rico Virgin Islands FIPS 5200
- <esri102491> : Nord Algerie Ancienne Degree
- <esri102492> : Sud Algerie Ancienne Degree
- <esri102581> : NTF France I degrees
- <esri102582> : NTF France II degrees
- <esri102583> : NTF France III degrees
- <esri102584> : NTF France IV degrees
- <esri102591> : Nord Algerie Degree
- <esri102592> : Sud Algerie Degree
- <esri102629> : NAD 1983 StatePlane Alabama East FIPS 0101 Feet
- <esri102630> : NAD 1983 StatePlane Alabama West FIPS 0102 Feet
- <esri102631> : NAD 1983 StatePlane Alaska 1 FIPS 5001 Feet
- <esri102632> : NAD 1983 StatePlane Alaska 2 FIPS 5002 Feet
- <esri102633> : NAD 1983 StatePlane Alaska 3 FIPS 5003 Feet
- <esri102634> : NAD 1983 StatePlane Alaska 4 FIPS 5004 Feet
- <esri102635> : NAD 1983 StatePlane Alaska 5 FIPS 5005 Feet
- <esri102636> : NAD 1983 StatePlane Alaska 6 FIPS 5006 Feet
- <esri102637> : NAD 1983 StatePlane Alaska 7 FIPS 5007 Feet
- <esri102638> : NAD 1983 StatePlane Alaska 8 FIPS 5008 Feet
- <esri102639> : NAD 1983 StatePlane Alaska 9 FIPS 5009 Feet
- <esri102640> : NAD 1983 StatePlane Alaska 10 FIPS 5010 Feet
- <esri102641> : NAD 1983 StatePlane California I FIPS 0401 Feet
- <esri102642> : NAD 1983 StatePlane California II FIPS 0402 Feet
- <esri102643> : NAD 1983 StatePlane California III FIPS 0403 Feet
- <esri102644> : NAD 1983 StatePlane California IV FIPS 0404 Feet
- <esri102645> : NAD 1983 StatePlane California V FIPS 0405 Feet
- <esri102646> : NAD 1983 StatePlane California VI FIPS 0406 Feet
- <esri102648> : NAD 1983 StatePlane Arizona East FIPS 0201 Feet
- <esri102649> : NAD 1983 StatePlane Arizona Central FIPS 0202 Feet
- <esri102650> : NAD 1983 StatePlane Arizona West FIPS 0203 Feet
- <esri102651> : NAD 1983 StatePlane Arkansas North FIPS 0301 Feet
- <esri102652> : NAD 1983 StatePlane Arkansas South FIPS 0302 Feet
- <esri102653> : NAD 1983 StatePlane Colorado North FIPS 0501 Feet
- <esri102654> : NAD 1983 StatePlane Colorado Central FIPS 0502 Feet
- <esri102655> : NAD 1983 StatePlane Colorado South FIPS 0503 Feet
- <esri102656> : NAD 1983 StatePlane Connecticut FIPS 0600 Feet
- <esri102657> : NAD 1983 StatePlane Delaware FIPS 0700 Feet
- <esri102658> : NAD 1983 StatePlane Florida East FIPS 0901 Feet
- <esri102659> : NAD 1983 StatePlane Florida West FIPS 0902 Feet
- <esri102660> : NAD 1983 StatePlane Florida North FIPS 0903 Feet
- <esri102661> : NAD 1983 StatePlane Hawaii 1 FIPS 5101 Feet
- <esri102662> : NAD 1983 StatePlane Hawaii 2 FIPS 5102 Feet
- <esri102663> : NAD 1983 StatePlane Hawaii 3 FIPS 5103 Feet
- <esri102664> : NAD 1983 StatePlane Hawaii 4 FIPS 5104 Feet
- <esri102665> : NAD 1983 StatePlane Hawaii 5 FIPS 5105 Feet
- <esri102666> : NAD 1983 StatePlane Georgia East FIPS 1001 Feet
- <esri102667> : NAD 1983 StatePlane Georgia West FIPS 1002 Feet
- <esri102668> : NAD 1983 StatePlane Idaho East FIPS 1101 Feet
- <esri102669> : NAD 1983 StatePlane Idaho Central FIPS 1102 Feet
- <esri102670> : NAD 1983 StatePlane Idaho West FIPS 1103 Feet
- <esri102671> : NAD 1983 StatePlane Illinois East FIPS 1201 Feet
- <esri102672> : NAD 1983 StatePlane Illinois West FIPS 1202 Feet
- <esri102673> : NAD 1983 StatePlane Indiana East FIPS 1301 Feet
- <esri102674> : NAD 1983 StatePlane Indiana West FIPS 1302 Feet
- <esri102675> : NAD 1983 StatePlane Iowa North FIPS 1401 Feet
- <esri102676> : NAD 1983 StatePlane Iowa South FIPS 1402 Feet
- <esri102677> : NAD 1983 StatePlane Kansas North FIPS 1501 Feet
- <esri102678> : NAD 1983 StatePlane Kansas South FIPS 1502 Feet
- <esri102679> : NAD 1983 StatePlane Kentucky North FIPS 1601 Feet
- <esri102680> : NAD 1983 StatePlane Kentucky South FIPS 1602 Feet
- <esri102681> : NAD 1983 StatePlane Louisiana North FIPS 1701 Feet
- <esri102682> : NAD 1983 StatePlane Louisiana South FIPS 1702 Feet
- <esri102683> : NAD 1983 StatePlane Maine East FIPS 1801 Feet
- <esri102684> : NAD 1983 StatePlane Maine West FIPS 1802 Feet
- <esri102685> : NAD 1983 StatePlane Maryland FIPS 1900 Feet
- <esri102686> : NAD 1983 StatePlane Massachusetts Mainland FIPS 2001 Feet
- <esri102687> : NAD 1983 StatePlane Massachusetts Island FIPS 2002 Feet
- <esri102688> : NAD 1983 StatePlane Michigan North FIPS 2111 Feet
- <esri102689> : NAD 1983 StatePlane Michigan Central FIPS 2112 Feet
- <esri102690> : NAD 1983 StatePlane Michigan South FIPS 2113 Feet
- <esri102691> : NAD 1983 StatePlane Minnesota North FIPS 2201 Feet
- <esri102692> : NAD 1983 StatePlane Minnesota Central FIPS 2202 Feet
- <esri102693> : NAD 1983 StatePlane Minnesota South FIPS 2203 Feet
- <esri102694> : NAD 1983 StatePlane Mississippi East FIPS 2301 Feet
- <esri102695> : NAD 1983 StatePlane Mississippi West FIPS 2302 Feet
- <esri102696> : NAD 1983 StatePlane Missouri East FIPS 2401 Feet
- <esri102697> : NAD 1983 StatePlane Missouri Central FIPS 2402 Feet
- <esri102698> : NAD 1983 StatePlane Missouri West FIPS 2403 Feet
- <esri102700> : NAD 1983 StatePlane Montana FIPS 2500 Feet
- <esri102704> : NAD 1983 StatePlane Nebraska FIPS 2600 Feet
- <esri102707> : NAD 1983 StatePlane Nevada East FIPS 2701 Feet
- <esri102708> : NAD 1983 StatePlane Nevada Central FIPS 2702 Feet
- <esri102709> : NAD 1983 StatePlane Nevada West FIPS 2703 Feet
- <esri102710> : NAD 1983 StatePlane New Hampshire FIPS 2800 Feet
- <esri102711> : NAD 1983 StatePlane New Jersey FIPS 2900 Feet
- <esri102712> : NAD 1983 StatePlane New Mexico East FIPS 3001 Feet
- <esri102713> : NAD 1983 StatePlane New Mexico Central FIPS 3002 Feet
- <esri102714> : NAD 1983 StatePlane New Mexico West FIPS 3003 Feet
- <esri102715> : NAD 1983 StatePlane New York East FIPS 3101 Feet
- <esri102716> : NAD 1983 StatePlane New York Central FIPS 3102 Feet
- <esri102717> : NAD 1983 StatePlane New York West FIPS 3103 Feet
- <esri102718> : NAD 1983 StatePlane New York Long Island FIPS 3104 Feet
- <esri102719> : NAD 1983 StatePlane North Carolina FIPS 3200 Feet
- <esri102720> : NAD 1983 StatePlane North Dakota North FIPS 3301 Feet
- <esri102721> : NAD 1983 StatePlane North Dakota South FIPS 3302 Feet
- <esri102722> : NAD 1983 StatePlane Ohio North FIPS 3401 Feet
- <esri102723> : NAD 1983 StatePlane Ohio South FIPS 3402 Feet
- <esri102724> : NAD 1983 StatePlane Oklahoma North FIPS 3501 Feet
- <esri102725> : NAD 1983 StatePlane Oklahoma South FIPS 3502 Feet
- <esri102726> : NAD 1983 StatePlane Oregon North FIPS 3601 Feet
- <esri102727> : NAD 1983 StatePlane Oregon South FIPS 3602 Feet
- <esri102728> : NAD 1983 StatePlane Pennsylvania North FIPS 3701 Feet
- <esri102729> : NAD 1983 StatePlane Pennsylvania South FIPS 3702 Feet
- <esri102730> : NAD 1983 StatePlane Rhode Island FIPS 3800 Feet
- <esri102733> : NAD 1983 StatePlane South Carolina FIPS 3900 Feet
- <esri102734> : NAD 1983 StatePlane South Dakota North FIPS 4001 Feet
- <esri102735> : NAD 1983 StatePlane South Dakota South FIPS 4002 Feet
- <esri102736> : NAD 1983 StatePlane Tennessee FIPS 4100 Feet
- <esri102737> : NAD 1983 StatePlane Texas North FIPS 4201 Feet
- <esri102738> : NAD 1983 StatePlane Texas North Central FIPS 4202 Feet
- <esri102739> : NAD 1983 StatePlane Texas Central FIPS 4203 Feet
- <esri102740> : NAD 1983 StatePlane Texas South Central FIPS 4204 Feet
- <esri102741> : NAD 1983 StatePlane Texas South FIPS 4205 Feet
- <esri102742> : NAD 1983 StatePlane Utah North FIPS 4301 Feet
- <esri102743> : NAD 1983 StatePlane Utah Central FIPS 4302 Feet
- <esri102744> : NAD 1983 StatePlane Utah South FIPS 4303 Feet
- <esri102745> : NAD 1983 StatePlane Vermont FIPS 4400 Feet
- <esri102746> : NAD 1983 StatePlane Virginia North FIPS 4501 Feet
- <esri102747> : NAD 1983 StatePlane Virginia South FIPS 4502 Feet
- <esri102748> : NAD 1983 StatePlane Washington North FIPS 4601 Feet
- <esri102749> : NAD 1983 StatePlane Washington South FIPS 4602 Feet
- <esri102750> : NAD 1983 StatePlane West Virginia North FIPS 4701 Feet
- <esri102751> : NAD 1983 StatePlane West Virginia South FIPS 4702 Feet
- <esri102752> : NAD 1983 StatePlane Wisconsin North FIPS 4801 Feet
- <esri102753> : NAD 1983 StatePlane Wisconsin Central FIPS 4802 Feet
- <esri102754> : NAD 1983 StatePlane Wisconsin South FIPS 4803 Feet
- <esri102755> : NAD 1983 StatePlane Wyoming East FIPS 4901 Feet
- <esri102756> : NAD 1983 StatePlane Wyoming East Central FIPS 4902 Feet
- <esri102757> : NAD 1983 StatePlane Wyoming West Central FIPS 4903 Feet
- <esri102758> : NAD 1983 StatePlane Wyoming West FIPS 4904 Feet
- <esri102761> : NAD 1983 StatePlane Puerto Rico Virgin Islands FIPS 5200 Feet
- <esri102766> : NAD 1983 StatePlane Guam FIPS 5400 Feet
- <esri103300> : Belge Lambert 1972
- <esri4023> : GCS International 1967
- <esri4217> : GCS Bern 1898
- <esri4305> : GCS Voirol Unifie 1960
- <esri4404> : GCS Montserrat 1958
- <esri4812> : GCS Voirol Unifie 1960 Paris
- <esri37001> : GCS WGS 1966
- <esri37002> : GCS Fischer 1960
- <esri37003> : GCS Fischer 1968
- <esri37004> : GCS Fischer Modified
- <esri37005> : GCS Hough 1960
- <esri37006> : GCS Everest Modified 1969
- <esri37007> : GCS Walbeck
- <esri37008> : GCS Sphere ARC INFO
- <esri37201> : GCS European 1979
- <esri37202> : GCS Everest Bangladesh
- <esri37203> : GCS Everest India Nepal
- <esri37204> : GCS Hjorsey 1955
- <esri37205> : GCS Hong Kong 1963
- <esri37206> : GCS Oman
- <esri37207> : GCS South Asia Singapore
- <esri37208> : GCS Ayabelle
- <esri37211> : GCS Point 58
- <esri37212> : GCS Beacon E 1945
- <esri37213> : GCS Tern Island 1961
- <esri37214> : GCS Astro 1952
- <esri37215> : GCS Bellevue IGN
- <esri37216> : GCS Canton 1966
- <esri37217> : GCS Chatham Island 1971
- <esri37218> : GCS DOS 1968
- <esri37219> : GCS Easter Island 1967
- <esri37220> : GCS Guam 1963
- <esri37221> : GCS GUX 1
- <esri37222> : GCS Johnston Island 1961
- <esri37223> : GCS Carthage Degree
- <esri37224> : GCS Midway 1961
- <esri37226> : GCS Pitcairn 1967
- <esri37227> : GCS Santo DOS 1965
- <esri37228> : GCS Viti Levu 1916
- <esri37229> : GCS Wake Eniwetok 1960
- <esri37230> : GCS Wake Island 1952
- <esri37231> : GCS Anna 1 1965
- <esri37232> : GCS Gan 1970
- <esri37233> : GCS ISTS 073 1969
- <esri37234> : GCS Kerguelen Island 1949
- <esri37235> : GCS Reunion
- <esri37237> : GCS Ascension Island 1958
- <esri37238> : GCS DOS 71 4
- <esri37239> : GCS Cape Canaveral
- <esri37240> : GCS Fort Thomas 1955
- <esri37241> : GCS Graciosa Base SW 1948
- <esri37242> : GCS ISTS 061 1968
- <esri37243> : GCS LC5 1961
- <esri37245> : GCS Observ Meteorologico 1939
- <esri37246> : GCS Pico de Las Nieves
- <esri37247> : GCS Porto Santo 1936
- <esri37249> : GCS Sao Braz
- <esri37250> : GCS Selvagem Grande 1938
- <esri37251> : GCS Tristan 1968
- <esri37252> : GCS Samoa 1962
- <esri37253> : GCS Camp Area
- <esri37254> : GCS Deception Island
- <esri37255> : GCS Gunung Segara
- <esri37257> : GCS S42 Hungary
- <esri37259> : GCS Kusaie 1951
- <esri37260> : GCS Alaskan Islands
- <esri104000> : GCS Assumed Geographic 1
- <esri104101> : GCS Estonia 1937
- <esri104102> : GCS Hermannskogel
- <esri104103> : GCS Sierra Leone 1960
- <esri104104> : GCS Hong Kong 1980
- <esri104105> : GCS Datum Lisboa Bessel
- <esri104106> : GCS Datum Lisboa Hayford
- <esri104107> : GCS RGF 1993
- <esri104108> : GCS NZGD 2000
- <esri104261> : GCS Merchich Degree
- <esri104304> : GCS Voirol 1875 Degree
- <esri104305> : GCS Voirol Unifie 1960 Degree
-
- \---------------------------------------------------------
- Google mercator
- \---------------------------------------------------------
- <900913> Chris' funny epsgish code for the google mercator
-
- \---------------------------------------------------------
- IGNF (French Mapping Agency) projection definitions
- \---------------------------------------------------------
- <ANAA92> : MOP92 (Anaa) Tuamotu
- <APAT86> : MOP86 (Apataki, Rapa, Hao) Tuamotu
- <ATI> : Ancienne Triangulation des Ingenieurs
- <CAD97> : Cadastre 1997
- <CIOBIH> : CIO-BIH
- <CROZ63> : Crozet 1963
- <CSG67> : Guyane CSG67
- <ED50> : ED50
- <EFATE57> : EFATE-IGN 1957
- <FANGA84> : MOP84 (Fangataufa 1984)
- <GUAD48> : Guadeloupe Ste Anne
- <GUADFM49> : Guadeloupe Fort Marigot
- <IGN63> : IGN 1963 (Hiva Oa, Tahuata, Mohotani)
- <IGN72> : IGN 1972 Grande-Terre / Ile des Pins
- <KAUE70> : MHPF70 (Kauehi) Tuamotu
- <KERG62CAR> : Kerguelen \- K0
- <LIFOU56> : Lifou \- Iles Loyaute (IGN56)
- <LUREF> : Nouvelle Triangulation du Grand Duche du Luxembourg
- <MARE53> : Mare \- Iles Loyaute (IGN53)
- <MARQUI72> : IGN 1972 (Eiao, Hiva Oa, Mohotani) Marquises
- <MART38> : Martinique Fort-Desaix
- <MAYO50> : Mayotte Combani
- <MHEFO55F> : MHEFO 1955 (Fatu Huku)
- <MHPF67> : MHPF67 (Mangareva, Agakauitai, Aukena, Mekiro) Gambiers (Iles)
- <MOOREA87> : Moorea 1987
- <MOP90> : MOP90 (Tetiaroa) Iles de la Societe
- <NTF> : Nouvelle Triangulation Francaise
- <NUKU72> : IGN 1972 Nuku Hiva
- <NUKU94> : SAT94 (Nukutavake) Tuamotu
- <OUVEA72CAR> : Ouvea \- Iles Loyaute (MHNC 1972 \- OUVEA)
- <PETRELS72> : Petrels \- IGN 1972
- <RAIA53> : IGN53 (IGN Raiatea-Tahaa) Raiatea-Tahaa-Bora Bora-Huahine
- <REUN47> : Reunion 1947
- <RGF93> : Reseau geodesique francais 1993
- <RGFG95> : Reseau geodesique francais de Guyane 1995
- <RGM04> : RGM04 (Reseau Geodesique de Mayotte 2004)
- <RGNC> : Reseau Geodesique de Nouvelle-Caledonie
- <RGPF> : RGPF (Reseau Geodesique de Polynesie Francaise)
- <RGR92> : Reseau geodesique Reunion 1992
- <RGSPM06> : Reseau Geodesique Saint-Pierre-et-Miquelon (2006)
- <RRAF91> : RRAF 1991 (Reseau de Reference des Antilles Francaises)
- <SAT84> : SAT84 (Rurutu) Iles Australes
- <SHOM84> : SHOM 1984 Martinique Montagne Du Vauclin
- <STPM50> : St Pierre et Miquelon 1950
- <TAHAA> : Raiatea \- Tahaa 51-54 (Tahaa, Base Terme Est)
- <TAHI51> : Tahiti-Terme Nord 1951
- <TAHI79> : IGN79 (Tahiti) Iles de la Societe
- <TANNA> : Tanna Bloc Sud
- <TERA50> : Pointe Geologie \- Perroud 1950
- <TUBU69> : MHPF 1969 (Tubuai) Iles Australes
- <WALL78> : Wallis-Uvea 1978 (MOP78)
- <WGS72> : World Geodetic System 1972
- <WGS84> : World Geodetic System 1984
- <ANAA92GEO> : MOP92 (Anaa) Tuamotu
- <APAT86GEO> : MOP86 (Apataki, Rapa, Hao) Tuamotu
- <ATIGEO> : Ancienne Triangulation des Ingenieurs
- <CAD97GEO> : Cadastre 1997
- <CROZ63GEO> : Crozet 1963
- <CSG67GEO> : Guyane CSG67 UTM fuseau 21
- <ED50G> : ED50
- <EFATE57GEO> : EFATE-IGN 1957
- <FANGA84GEO> : MOP84 (Fangataufa 1984)
- <GUAD48GEO> : Guadeloupe Ste Anne
- <GUADFM49GEO> : Guadeloupe Fort Marigot
- <IGN63GEO> : IGN 1963 (Hiva Oa, Tahuata, Mohotani)
- <IGN72GEO> : IGN 1972 Grande-Terre / Ile des Pins
- <KAUE70GEO> : MHPF70 (Kauehi) Tuamotu
- <KERG62GEO> : Kerguelen \- K0
- <LIFOU56GEO> : Lifou \- Iles Loyaute (IGN56)
- <LUXGEO> : Nouvelle Triangulation du Grand Duche du Luxembourg
- <MARE53GEO> : Mare \- Iles Loyaute (IGN53)
- <MARQUI72GEO> : IGN 1972 (Eiao, Hiva Oa, Mohotani) Marquises
- <MART38GEO> : Martinique Fort-Desaix
- <MAYO50GEO> : Mayotte Combani
- <MHEFO55FGEO> : MHEFO 1955 (Fatu Huku)
- <MHPF67GEO> : MHPF67 (Mangareva, Agakauitai, Aukena, Mekiro) Gambiers (Iles)
- <MOOREA87GEO> : Moorea 1987
- <MOP90GEO> : MOP90 (Tetiaroa) Iles de la Societe
- <NTFG> : Nouvelle Triangulation Francaise Greenwich degres sexagesimaux
- <NTFP> : Nouvelle Triangulation Francaise Paris grades
- <NUKU72GEO> : IGN 1972 Nuku Hiva
- <NUKU94GEO> : SAT94 (Nukutavake) Tuamotu
- <OUVEA72GEO> : Ouvea \- Iles Loyaute (MHNC 1972 \- OUVEA)
- <RAIA53GEO> : IGN53 (IGN Raiatea-Tahaa) Raiatea-Tahaa-Bora Bora-Huahine
- <REUN47GEO> : Reunion 1947
- <RGF93G> : Reseau geodesique francais 1993
- <RGFG95GEO> : Reseau geodesique francais de Guyane 1995
- <RGM04GEO> : RGM04 (Reseau Geodesique de Mayotte 2004)
- <RGNCGEO> : Reseau Geodesique de Nouvelle-Caledonie
- <RGPFGEO> : RGPF (Reseau Geodesique de Polynesie Francaise)
- <RGR92GEO> : Reseau geodesique de la Reunion 1992
- <RGSPM06GEO> : Saint-Pierre-et-Miquelon (2006)
- <SAT84GEO> : SAT84 (Rurutu) Iles Australes
- <SHOM84GEO> : SHOM 1984 Martinique Montagne Du Vauclin
- <STPM50GEO> : St Pierre et Miquelon 1950
- <TAHAAGEO> : Raiatea \- Tahaa 51-54 (Tahaa, Base Terme Est)
- <TAHI51GEO> : Tahiti-Terme Nord 1951
- <TAHI79GEO> : IGN79 (Tahiti) Iles de la Societe
- <TANNAGEO> : Tanna Bloc Sud
- <TERA50GEO> : Pointe Geologie \- Perroud 1950
- <TUBU69GEO> : MHPF 1969 (Tubuai) Iles Australes
- <WALL78GEO> : Wallis \- Uvea 1978 (MOP78)
- <WGS72G> : WGS72
- <WGS84G> : World Geodetic System 1984
- <WGS84RRAFGEO> : Reseau de reference des Antilles francaises (1988-1991)
- <XGEO> : Systeme CIO-BIH
- <ANAA92UTM6S> : MOP92 (Anaa) Tuamotu \- UTM fuseau 6 Sud
- <APAT86UTM6S> : MOP86 (Apataki, Rapa, Hao) Tuamotu \- UTM fuseau 6 Sud
- <APAT86UTM7S> : MOP86 (Apataki, Rapa, Hao) Tuamotu \- UTM fuseau 7 Sud
- <CAD97UTM38S> : Cadastre 1997 \- UTM fuseau 38 Sud
- <CROZ63UTM39S> : Crozet 1963
- <CSG67UTM21> : Guyane CSG67 UTM fuseau 21
- <CSG67UTM22> : Guyane CSG67 UTM fuseau 22
- <EFATE57UT59S> : EFATE-IGN 1957 \- UTM fuseau 59 Sud
- <FANGA84UTM7S> : Fangataufa 1984 \- UTM fuseau 7 Sud
- <GEOPORTALANF> : Geoportail \- Antilles francaises
- <GEOPORTALCRZ> : Geoportail \- Crozet
- <GEOPORTALFXX> : Geoportail \- France metropolitaine
- <GEOPORTALGUF> : Geoportail \- Guyane
- <GEOPORTALKER> : Geoportail \- Kerguelen
- <GEOPORTALMYT> : Geoportail \- Mayotte
- <GEOPORTALNCL> : Geoportail \- Nouvelle-Caledonie
- <GEOPORTALPYF> : Geoportail \- Polynesie francaise
- <GEOPORTALREU> : Geoportail \- Reunion et dependances
- <GEOPORTALSPM> : Geoportail \- Saint-Pierre et Miquelon
- <GEOPORTALWLF> : Geoportail \- Wallis et Futuna
- <GUAD48UTM20> : Guadeloupe Ste Anne
- <GUADFM49U20> : Guadeloupe Fort Marigot
- <IGN63UTM7S> : IGN 1963 \- Hiva Oa, Tahuata, Mohotani \- UTM fuseau 7 Sud
- <IGN72LAM> : IGN 1972 \- Lambert Nouvelle Caledonie
- <IGN72UTM58S> : IGN 1972 \- UTM fuseau 58 Sud
- <KAUE70UTM6S> : MHPF70 (Kauehi) Tuamotu \- UTM fuseau 6 Sud
- <KERG62UTM42S> : Kerguelen 1962
- <LAMB1> : Lambert I
- <LAMB1C> : Lambert I Carto
- <LAMB2> : Lambert II
- <LAMB2C> : Lambert II Carto
- <LAMB3> : Lambert III
- <LAMB3C> : Lambert III Carto
- <LAMB4> : Lambert IV
- <LAMB4C> : Lambert IV Carto
- <LAMB93> : Lambert 93
- <LAMBE> : Lambert II etendu
- <LAMBGC> : Lambert grand champ
- <LUXGAUSSK> : Luxembourg 1929
- <MARE53UTM58S> : Mare \- Iles Loyaute \- UTM fuseau 58 Sud
- <MART38UTM20> : Martinique Fort-Desaix
- <MAYO50UTM38S> : Mayotte Combani
- <MHPF67UTM8S> : MHPF67 (Mangareva, Agakauitai, Aukena, Mekiro) Gambiers (Iles) \- UTM 8 S
- <MILLER> : Geoportail \- Monde
- <MOOREA87U6S> : Moorea 1987 \- UTM fuseau 6 Sud
- <MOP90UTM6S> : MOP90 (Tetiaroa) Iles de la Societe \- UTM fuseau 6 Sud
- <NUKU72U7S> : IGN 1972 Nuku Hiva \- UTM fuseau 7 Sud
- <NUKU94UTM7S> : IGN 1994 Nuku Hiva \- UTM fuseau 7 Sud
- <OUVEA72U58S> : Ouvea \- Iles Loyaute \- UTM fuseau 58 Sud
- <RAIA53UTM5S> : IGN53 (IGN Raiatea-Tahaa) Raiatea-Tahaa-Bora Bora-Huahine \- UTM fuseau 5
- <REUN47GAUSSL> : Reunion Gauss Laborde
- <RGF93CC42> : Projection conique conforme Zone 1
- <RGF93CC43> : Projection conique conforme Zone 2
- <RGF93CC44> : Projection conique conforme Zone 3
- <RGF93CC45> : Projection conique conforme Zone 4
- <RGF93CC46> : Projection conique conforme Zone 5
- <RGF93CC47> : Projection conique conforme Zone 6
- <RGF93CC48> : Projection conique conforme Zone 7
- <RGF93CC49> : Projection conique conforme Zone 8
- <RGF93CC50> : Projection conique conforme Zone 9
- <RGM04UTM38S> : UTM fuseau 38 Sud (Reseau Geodesique de Mayotte 2004)
- <RGNCLAM> : Reseau Geodesique de Nouvelle-Caledonie \- Lambert Nouvelle Caledonie
- <RGNCUTM57S> : Reseau Geodesique de Nouvelle-Caledonie \- UTM fuseau 57 Sud
- <RGNCUTM58S> : Reseau Geodesique de Nouvelle-Caledonie \- UTM fuseau 58 Sud
- <RGNCUTM59S> : Reseau Geodesique de Nouvelle-Caledonie \- UTM fuseau 59 Sud
- <RGPFUTM5S> : RGPF \- UTM fuseau 5 Sud
- <RGPFUTM6S> : RGPF \- UTM fuseau 6 Sud
- <RGPFUTM7S> : RGPF \- UTM fuseau 7 Sud
- <RGR92UTM40S> : RGR92 UTM fuseau 40 Sud
- <RGSPM06U21> : Saint-Pierre-et-Miquelon (2006) UTM Fuseau 21 Nord
- <SAT84UTM5S> : SAT84 (Rurutu) Iles Australes \- UTM fuseau 5 Sud
- <STEREOSX> : Stereographique polaire Sud
- <STPM50UTM21> : St Pierre et Miquelon 1950
- <TAHAAUTM05S> : Tahaa 1951
- <TAHI51UTM06S> : Tahiti-Terme Nord UTM fuseau 6 Sud
- <TAHI79UTM6S> : Tahiti 1979
- <TANNAUTM59S> : Tanna Bloc Sud \- UTM fuseau 59 Sud
- <TERA50SPTA> : Terre Adelie Stereo polaire Terre Adelie
- <TERA50STEREO> : Terre Adelie 1950
- <TUBU69UTM6S> : Tubuai \- Iles Australes \- UTM fuseau 6 Sud
- <UTM01SW72> : World Geodetic System 1972 UTM fuseau 01 Sud
- <UTM01SW84> : World Geodetic System 1984 UTM fuseau 01 Sud
- <UTM01W84> : World Geodetic System 1984 UTM fuseau 01
- <UTM02SW84> : World Geodetic System 1984 UTM fuseau 02 Sud
- <UTM02W84> : World Geodetic System 1984 UTM fuseau 02
- <UTM03SW84> : World Geodetic System 1984 UTM fuseau 03 Sud
- <UTM03W84> : World Geodetic System 1984 UTM fuseau 03
- <UTM04SW84> : World Geodetic System 1984 UTM fuseau 04 Sud
- <UTM04W84> : World Geodetic System 1984 UTM fuseau 04
- <UTM05SW84> : World Geodetic System 1984 UTM fuseau 05 Sud
- <UTM05W84> : World Geodetic System 1984 UTM fuseau 05
- <UTM06SW84> : World Geodetic System 1984 UTM fuseau 06 Sud
- <UTM06W84> : World Geodetic System 1984 UTM fuseau 06
- <UTM07SW84> : World Geodetic System 1984 UTM fuseau 07 Sud
- <UTM07W84> : World Geodetic System 1984 UTM fuseau 07
- <UTM08SW84> : World Geodetic System 1984 UTM fuseau 08 Sud
- <UTM08W84> : World Geodetic System 1984 UTM fuseau 08
- <UTM09SW84> : World Geodetic System 1984 UTM fuseau 09 Sud
- <UTM09W84> : World Geodetic System 1984 UTM fuseau 09
- <UTM10SW84> : World Geodetic System 1984 UTM fuseau 10 Sud
- <UTM10W84> : World Geodetic System 1984 UTM fuseau 10
- <UTM11SW84> : World Geodetic System 1984 UTM fuseau 11 Sud
- <UTM11W84> : World Geodetic System 1984 UTM fuseau 11
- <UTM12SW84> : World Geodetic System 1984 UTM fuseau 12 Sud
- <UTM12W84> : World Geodetic System 1984 UTM fuseau 12
- <UTM13SW84> : World Geodetic System 1984 UTM fuseau 13 Sud
- <UTM13W84> : World Geodetic System 1984 UTM fuseau 13
- <UTM14SW84> : World Geodetic System 1984 UTM fuseau 14 Sud
- <UTM14W84> : World Geodetic System 1984 UTM fuseau 14
- <UTM15SW84> : World Geodetic System 1984 UTM fuseau 15 Sud
- <UTM15W84> : World Geodetic System 1984 UTM fuseau 15
- <UTM16SW84> : World Geodetic System 1984 UTM fuseau 16 Sud
- <UTM16W84> : World Geodetic System 1984 UTM fuseau 16
- <UTM17SW84> : World Geodetic System 1984 UTM fuseau 17 Sud
- <UTM17W84> : World Geodetic System 1984 UTM fuseau 17
- <UTM18SW84> : World Geodetic System 1984 UTM fuseau 18 Sud
- <UTM18W84> : World Geodetic System 1984 UTM fuseau 18
- <UTM19SW84> : World Geodetic System 1984 UTM fuseau 19 Sud
- <UTM19W84> : World Geodetic System 1984 UTM fuseau 19
- <UTM20SW84> : World Geodetic System 1984 UTM fuseau 20 Sud
- <UTM20W84> : World Geodetic System 1984 UTM fuseau 20
- <UTM20W84GUAD> : World Geodetic System 1984 UTM fuseau 20 Nord-Guadeloupe
- <UTM20W84MART> : World Geodetic System 1984 UTM fuseau 20 Nord-Martinique
- <UTM21SW84> : World Geodetic System 1984 UTM fuseau 21 Sud
- <UTM21W84> : World Geodetic System 1984 UTM fuseau 21
- <UTM22RGFG95> : RGFG95 UTM fuseau 22 Nord-Guyane
- <UTM22SW84> : World Geodetic System 1984 UTM fuseau 22 Sud
- <UTM22W84> : World Geodetic System 1984 UTM fuseau 22
- <UTM23SW84> : World Geodetic System 1984 UTM fuseau 23 Sud
- <UTM23W84> : World Geodetic System 1984 UTM fuseau 23
- <UTM24SW84> : World Geodetic System 1984 UTM fuseau 24 Sud
- <UTM24W84> : World Geodetic System 1984 UTM fuseau 24
- <UTM25SW84> : World Geodetic System 1984 UTM fuseau 25 Sud
- <UTM25W84> : World Geodetic System 1984 UTM fuseau 25
- <UTM26SW84> : World Geodetic System 1984 UTM fuseau 26 Sud
- <UTM26W84> : World Geodetic System 1984 UTM fuseau 26
- <UTM27SW84> : World Geodetic System 1984 UTM fuseau 27 Sud
- <UTM27W84> : World Geodetic System 1984 UTM fuseau 27
- <UTM28SW84> : World Geodetic System 1984 UTM fuseau 28 Sud
- <UTM28W84> : World Geodetic System 1984 UTM fuseau 28
- <UTM29SW84> : World Geodetic System 1984 UTM fuseau 29 Sud
- <UTM29W84> : World Geodetic System 1984 UTM fuseau 29
- <UTM30> : European Datum 1950 UTM fuseau 30
- <UTM30RGF93> : RGF93 UTM fuseau 30
- <UTM30SW84> : World Geodetic System 1984 UTM fuseau 30 Sud
- <UTM30W72> : World Geodetic System 1972 UTM fuseau 30
- <UTM30W84> : World Geodetic System 1984 UTM fuseau 30
- <UTM31> : European Datum 1950 UTM fuseau 31
- <UTM31RGF93> : RGF93 UTM fuseau 31
- <UTM31SW84> : World Geodetic System 1984 UTM fuseau 31 Sud
- <UTM31W72> : World Geodetic System 1972 UTM fuseau 31
- <UTM31W84> : World Geodetic System 1984 UTM fuseau 31
- <UTM32> : European Datum 1950 UTM fuseau 32
- <UTM32RGF93> : RGF93 UTM fuseau 32
- <UTM32SW84> : World Geodetic System 1984 UTM fuseau 32 Sud
- <UTM32W72> : World Geodetic System 1972 UTM fuseau 32
- <UTM32W84> : World Geodetic System 1984 UTM fuseau 32
- <UTM33SW84> : World Geodetic System 1984 UTM fuseau 33 Sud
- <UTM33W84> : World Geodetic System 1984 UTM fuseau 33
- <UTM34SW84> : World Geodetic System 1984 UTM fuseau 34 Sud
- <UTM34W84> : World Geodetic System 1984 UTM fuseau 34
- <UTM35SW84> : World Geodetic System 1984 UTM fuseau 35 Sud
- <UTM35W84> : World Geodetic System 1984 UTM fuseau 35
- <UTM36SW84> : World Geodetic System 1984 UTM fuseau 36 Sud
- <UTM36W84> : World Geodetic System 1984 UTM fuseau 36
- <UTM37SW84> : World Geodetic System 1984 UTM fuseau 37 Sud
- <UTM37W84> : World Geodetic System 1984 UTM fuseau 37
- <UTM38SW84> : World Geodetic System 1984 UTM fuseau 38 Sud
- <UTM38W84> : World Geodetic System 1984 UTM fuseau 38
- <UTM39SW84> : World Geodetic System 1984 UTM fuseau 39 Sud
- <UTM39W84> : World Geodetic System 1984 UTM fuseau 39
- <UTM40SW84> : World Geodetic System 1984 UTM fuseau 40 Sud
- <UTM40W84> : World Geodetic System 1984 UTM fuseau 40
- <UTM41SW84> : World Geodetic System 1984 UTM fuseau 41 Sud
- <UTM41W84> : World Geodetic System 1984 UTM fuseau 41
- <UTM42SW84> : World Geodetic System 1984 UTM fuseau 42 Sud
- <UTM42W84> : World Geodetic System 1984 UTM fuseau 42
- <UTM43SW84> : World Geodetic System 1984 UTM fuseau 43 Sud
- <UTM43W84> : World Geodetic System 1984 UTM fuseau 43
- <UTM44SW84> : World Geodetic System 1984 UTM fuseau 44 Sud
- <UTM44W84> : World Geodetic System 1984 UTM fuseau 44
- <UTM45SW84> : World Geodetic System 1984 UTM fuseau 45 Sud
- <UTM45W84> : World Geodetic System 1984 UTM fuseau 45
- <UTM46SW84> : World Geodetic System 1984 UTM fuseau 46 Sud
- <UTM46W84> : World Geodetic System 1984 UTM fuseau 46
- <UTM47SW84> : World Geodetic System 1984 UTM fuseau 47 Sud
- <UTM47W84> : World Geodetic System 1984 UTM fuseau 47
- <UTM48SW84> : World Geodetic System 1984 UTM fuseau 48 Sud
- <UTM48W84> : World Geodetic System 1984 UTM fuseau 48
- <UTM49SW84> : World Geodetic System 1984 UTM fuseau 49 Sud
- <UTM49W84> : World Geodetic System 1984 UTM fuseau 49
- <UTM50SW84> : World Geodetic System 1984 UTM fuseau 50 Sud
- <UTM50W84> : World Geodetic System 1984 UTM fuseau 50
- <UTM51SW84> : World Geodetic System 1984 UTM fuseau 51 Sud
- <UTM51W84> : World Geodetic System 1984 UTM fuseau 51
- <UTM52SW84> : World Geodetic System 1984 UTM fuseau 52 Sud
- <UTM52W84> : World Geodetic System 1984 UTM fuseau 52
- <UTM53SW84> : World Geodetic System 1984 UTM fuseau 53 Sud
- <UTM53W84> : World Geodetic System 1984 UTM fuseau 53
- <UTM54SW84> : World Geodetic System 1984 UTM fuseau 54 Sud
- <UTM54W84> : World Geodetic System 1984 UTM fuseau 54
- <UTM55SW84> : World Geodetic System 1984 UTM fuseau 55 Sud
- <UTM55W84> : World Geodetic System 1984 UTM fuseau 55
- <UTM56SW84> : World Geodetic System 1984 UTM fuseau 56 Sud
- <UTM56W84> : World Geodetic System 1984 UTM fuseau 56
- <UTM57SW84> : World Geodetic System 1984 UTM fuseau 57 Sud
- <UTM57W84> : World Geodetic System 1984 UTM fuseau 57
- <UTM58SW84> : World Geodetic System 1984 UTM fuseau 58 Sud
- <UTM58W84> : World Geodetic System 1984 UTM fuseau 58
- <UTM59SW84> : World Geodetic System 1984 UTM fuseau 59 Sud
- <UTM59W84> : World Geodetic System 1984 UTM fuseau 59
- <UTM60SW84> : World Geodetic System 1984 UTM fuseau 60 Sud
- <UTM60W84> : World Geodetic System 1984 UTM fuseau 60
- <WALL78UTM1S> : Wallis-Uvea 1978 (MOP78) UTM 1 SUD
-
- \---------------------------------------------------------
- Various Non-U.S. Coordinate Systems,
- \---------------------------------------------------------
- <CH1903> : Swiss Coordinate System
- <madagascar> : Laborde grid for Madagascar
- <new_zealand> : New Zealand Map Grid (NZMG) \- Projection unique to N.Z. so all factors fixed
- \---------------------------------------------------------
- Secondary grids DMA TM8358.1, p. 4.3
- \---------------------------------------------------------
- <bwi> : British West Indies
- <costa-n> : Costa Rica Norte
- <costa-s> : Costa Rica Sud
- <cuba-n> : Cuba Norte
- <cuba-s> : Cuba Sud
- <domin_rep> : Dominican Republic
- <egypt-1> : Egypt
- <egypt-2> : Egypt
- <egypt-3> : Egypt
- <egypt-4> : Egypt
- <egypt-5> : Egypt
- <el_sal> : El Salvador
- <guat-n> : Guatemala Norte
- <guat-s> : Guatemala Sud
- <haiti> : Haiti
- <hond-n> : Honduras Norte
- <hond-s> : Honduras Sud
- <levant> : Levant
- <nica-n> : Nicaragua Norte
- <nica-s> : Nicaragua Sud
- <nw-africa> : Northwest Africa
- <palestine> : Palestine
- <panama> : Panama
-
- \---------------------------------------------------------
- other grids in DMA TM8358.1
- \---------------------------------------------------------
- <bng> : British National Grid
- <malay> : West Malaysian RSO Grid
- <india-I> : India Zone I
- <india-IIA> : India Zone IIA
- <india-IIB> : India Zone IIB
- <india-IIIA> : India Zone IIIA
- <india-IIIB> : India Zone IIIB
- <india-IVA> : India Zone IVA
- <india-IVB> : India Zone IVB
- <ceylon> : Ceylon Belt
- <irish> : Irish Transverse Mercator Grid
- <neiez> : Netherlands East Indies Equitorial Zone
- <n-alger> : Nord Algerie Grid
- <n-maroc> : Nord Maroc Grid
- <n-tunis> : Nord Tunisie Grid
- <s-alger> : Sud Algerie Grid
- <s-maroc> : Sud Maroc Grid
- <s-tunis> : Sud Tunisie Grid
-
- \---------------------------------------------------------
- Gauss Krueger Grids for Germany
- \---------------------------------------------------------
- <gk2-d> : Gauss Krueger Grid for Germany
- <gk3-d> : Gauss Krueger Grid for Germany
- <gk4-d> : Gauss Krueger Grid for Germany
diff --git a/src/man/man1/mbnavadjust.1 b/src/man/man1/mbnavadjust.1
deleted file mode 100644
index e8b4495..0000000
--- a/src/man/man1/mbnavadjust.1
+++ /dev/null
@@ -1,1403 +0,0 @@
-.TH mbnavadjust 1 "22 April 2015" "MB-System 5.0" "MB-System 5.0"
-.SH NAME
-\fBmbnavadjust\fP \- Package that solves for optimal navigation by
-matching bathymetry of overlapping swaths.
-
-.SH VERSION
-Version 5.0
-
-.SH SYNOPSIS
-\fBmbnavadjust\fP [\fB\-V \-H \-D \-R\fP]
-
-.SH DESCRIPTION
-\fBMBnavadjust\fP is an interactive graphical program used to
-adjust swath data navigation by matching bathymetric features
-in overlapping and crossing swaths. The primary purpose of
-\fBmbnavadjust\fP is to eliminate relative navigational errors in swath
-data obtained from poorly navigated sonars. Submerged platforms
-such as towed vehicles, remotely operated vehicles (ROVs) and
-autonomous underwater vehicles (AUVs) are frequently not navigated
-with accuracy equivalent to the lateral resolution of
-swath bathymetry obtained with high frequency sonars operated
-close to the seafloor. This is  particularly true for systems
-that depend on ultra-short baseline navigation (USBL) or on
-inertial navigation (as opposed to long baseline (LBL) navigation
-obtained using transponder networks). Many old, pre-GPS surveys with
-hull mounted sonars also suffer from poor navigation relative to the
-resolution of the swath bathymetry, and can thus be improved with
-application of this tool. \fBMBnavadjust\fP also works well to
-co-register surveys at different scales. For instance, our
-initial use of this tool involved co-registering a deep-towed Reson
-8101 multibeam survey of the Loihi Seamount summit (offshore Hawaii)
-with a hull mounted Simrad EM300 multibeam survey.
-
-When swath surveys are poorly navigated, features clearly imaged
-by the sonar may not match in overlapping and crossing swaths.
-However, by systematically determining the positional offsets between
-matching features throughout a survey, it is possible to solve,
-or invert, for a navigation model which is consistent with the
-original navigational constraints, satisfies the requirement
-of reasonableness, and also causes features in overlapping swaths
-to match within the sonar's resolution. The analysis and adjustment
-can be limited to lateral (x and y or longitude and latitude) offsets
-when all vertical offsets have been corrected prior to importation
-into \fBMBnavadjust\fP (e.g. tidal corrections have been made).
-Otherwise, the offset analysis and inversions are three dimensional.
-
-Early attempts to address this problem (e.g. Nishimura et al. [1988])
-focused on automating the identification of matching features
-and their navigational offsets. The automated approach is
-problematic because seafloor features are complex, and the
-cross correlation function of matching features often exhibits
-multiple local minima. Our approach is to automate the identification
-of matching features and the ultimate solution for an optimal
-indentification while depending on interactive determination of
-the navigational offsets. We have not found an automatic algorithm
-that can reliably replace the human eye and brain in correctly
-lining up real seafloor features.
-
-\fBMBnavadjust\fP operates within the context of the \fBmbprocess\fP
-parallel processing scheme, but it should used on data for which
-the initial navigation processing (e.g. \fBmbnavedit\fP is complete.
-When swath data files are imported into \fBmbnavadjust\fP, the data is
-taken from processed files generated by \fBmbprocess\fP whenever
-possible (when those files exist). If no processed file exists,
-the raw data file is used. When the processing with \fBmbnavadjust\fP
-is completed and an optimal navigation solution is achieved, new
-navigation files are generated (".na#" files, see below for full
-description) which supercede the ".nve" files
-generated by \fBmbnavedit\fP. Rerunning \fBmbprocess\fP will merge
-the new navigation into a new set of processed files. Once
-a swath file is processed with \fBmbnavadjust\fP, any further attempts
-to process the navigation with \fBmbnavedit\fP will only produce
-navigation files that are ignored by \fBmbprocess\fP. This behavior
-can be reversed manually using \fBmbset\fP, but then the user will
-unnecessarily complicating his or her efforts.
-
-A companion program \fBmbnavadjustmerge\fP can add \fBmbnavadjust\fP projects
-together or or modify \fBmbnavadjust\fP prooject settings. 
-
-The inversion for an optimal navigation which fits the offsets identified
-at matching features must also be reasonable. This is achieved by
-minimizing perturbations to speed and acceleration in the inversion.
-This approach of penalizing first and second derivatives within
-a linear inverse problem is common within the geophysical
-inverse theory literature (e.g. Parker [1994]).
-
-Users are advised that \fBmbnavadjust\fP is complicated in both
-conception and implementation. We strongly recommend that users
-read all of the documentation provided below prior to attempting
-a first use of this software.
-The meaning and use of the individual widgets and windows employed in
-the graphical interface is provided in the \fBINTERACTIVE CONTROLS\fP
-section. The \fBUSING MBNAVADJUST\fP section provides a more coherent
-discussion of how to use \fBmbnavadjust\fP, how this program interacts
-with the \fBmbprocess\fP parallel processing scheme, and the underlying
-concepts and algorithms.
-
-.SH AUTHORSHIP
-David W. Caress (caress at mbari.org)
-.br
-  Monterey Bay Aquarium Research Institute
-.br
-Dale N. Chayes (dale at ldeo.columbia.edu)
-.br
-  Lamont-Doherty Earth Observatory
-
-.SH OPTIONS
-.TP
-.B \-H
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-.TP
-.B \-D
-Normally, \fBmbnavadjust\fP uses a white background for the
-interactive plots. This option causes the program to use a
-black background for the plots.
-.TP
-.B \-R
-This option causes \fBmbnavadjust\fP to discard all navigation ties,
-set all crossings to "unanalyzed" status, and to save the project
-in this pristine state. Only use this option if you really, really
-want to start over.
-.TP
-.B \-V
-Normally, \fBmbnavadjust\fP outputs nothing to the stderr stream.
-If the \fB\-V\fP flag is given, then \fBmbnavadjust\fP
-works in a "verbose" mode and
-outputs the program version being used, all error status messages,
-and a large amount of other information.
-
-.SH INTERACTIVE CONTROLS
-
-.SS MBnavadjust Window
-This is the primary window of \fBmbnavadjust\fP.
-
-.TP
-.B File
-This button activates a pulldown menu with six items:
-\fBNew\fP, \fBOpen\fP, \fBClose\fP,
-\fBImport Swath Data\fP, and \fBQuit\fP.
-
-.TP
-.B File->New
-This menu item brings up a popup window which allows the user to
-specify a new \fBmbnavadjust\fP project. As part of initializing
-a new project, \fBmbnavadjust\fP creates a file with a ".nvh"
-suffix and a directory with a ".dir" suffix.
-.TP
-.B File->Open
-This menu item brings up a popup window which allows the user to
-open an existing \fBmbnavadjust\fP project.
-.TP
-.B File->Close
-This menu item causes \fBmbnavadjust\fP to close the current project.
-.TP
-.B File->Import Swath Data
-This menu item brings up a popup window which allows the user to
-specify a swath sonar data file or a list of
-swath files to be imported into the current
-\fBmbnavadjust\fP project.
-This program uses the \fBMBIO\fP library and
-will read any swath sonar
-formats supported by \fBMBIO\fP. A list of the swath sonar data
-formats currently supported by \fBMBIO\fP and their
-identifier values is given in the \fBMBIO\fP manual page.
-If the swath sonar data file is named using the \fBMB-System\fP
-suffix convention (format 11 files end with ".mb11", format
-41 files end with ".mb41", etc.), then the program will
-automatically use the appropriate format id; otherwise the
-format must be set by the user in the format text box.
-.TP
-.B File->Quit
-This button causes \fBmbnavadjust\fP to quit. If a project has been
-created or opened, that project will be closed before the program
-quits.
-.TP
-.B Option
-This button brings up a pulldown menu with one item: \fBControls\fP.
-.TP
-.B Option->Controls
-This menu item brings up a dialog window with several slider widgets
-that set parameters controlling how swath data are imported and displayed.
-These widgets are discussed in the \fBControls\fP section below.
- .TP
-.B View
-This button brings up a pulldown menu with fifteen items in three
-groups. This menu controls the contents of the list widget in the lower
-right \fBMBnavadjust Window\fP. If an \fBmbnavadjust\fP project
-has been created or opened, the \fBData Table\fP list
-widget will display a table of items controlled by these menu items,
-and the corresponding menu item will be disabled. Selection of another item
-items will change what is displayed in the \fBData Table\fP list
-widget accordingly.
-
-The first group includes the \fBShow Surveys\fP,
-\fBShow Data Files\fP, \fBShow Data File Sections\fP, \fBShow All Crossings\fP,
-\fBShow All Crossings\fP, \fBShow >25% Crossings\fP, \fBShow >50% Crossings\fP,
-\fBShow True Crossings\fP, and \fBShow Ties\fP items.
-.TP
-.B View->Show Surveys
-This menu item causes the \fBData Table\fP list widget to display a list of the
-surveys in the current \fBmbnavadjust\fP project. Within \fBMBnavadjust\fP, a
-survey is a group of swath files that are contiguous in time.
-.TP
-.B View->Show Data Files
-This menu item causes the \fBData Table\fP list widget to display a list of the swath
-data files in the current \fBmbnavadjust\fP project.
-.TP
-.B View->Show Data File Sections
-This menu item causes the \fBData Table\fP list widget to display a list of the swath
-data sections in the current \fBmbnavadjust\fP project.
-.TP
-.B View->Show All Crossings
-This menu item causes the \fBData Table\fP list widget to display a list of all the swath
-crossings in the current \fBmbnavadjust\fP project.
-When this option is set, selecting a list item causes \fBmbnavadjust\fP to load and display the selected
-selected crossing in the "Nav Err" window.
-.TP
-.B View->Show >25% Crossings
-This menu item causes the \fBData Table\fP list widget to display a list of all the swath
-crossings in the current \fBmbnavadjust\fP project for which the two sections overlap by
-more than 25%.
-When this option is set, selecting a list item causes \fBmbnavadjust\fP to load and display the selected
-selected crossing in the "Nav Err" window.
-.TP
-.B View->Show >50% Crossings
-This menu item causes the \fBData Table\fP list widget to display a list of all the swath
-crossings in the current \fBmbnavadjust\fP project for which the two sections overlap by
-more than 50%..
-When this option is set, selecting a list item causes \fBmbnavadjust\fP to load and display the selected
-selected crossing in the "Nav Err" window.
-.TP
-.B View->Show True Crossings
-This menu item causes the \fBData Table\fP list widget to display a list of all the swath
-crossings  in the current \fBmbnavadjust\fP project for which the navigation tracks cross.
-When this option is set, selecting a list item causes \fBmbnavadjust\fP to load and display the selected
-selected crossing in the "Nav Err" window.
-.TP
-.B View->Show Ties
-This menu item causes the \fBData Table\fP list widget to display a list of the tie points
-in the current \fBmbnavadjust\fP project.
-
-The second group includes the
-\fBShow All Surveys\fP, \fBShow Only Selected Survey\fP, \fBShow Only Selected File\fP,
-and \fBShow Only Selected Section\fP items. One of these options is always active, and
-modifies what is displayed in the \fBData Table\fP list.
-.TP
-.B View->Show All Surveys
-This menu item allows all of the possible items (file, sections, crossings, ties)
-to be displayed in the \fBData Table\fP list.
-.TP
-.B View->Show Only Selected Surveys
-This menu item limits the items (file, sections, crossings, ties) displayed in
-the \fBData Table\fP list to those associated with the most recently
-selected survey (e.g. a survey selected by clicking in the \fBData Table\fP list
-while the <View->Show Surveys> option is active).
-.TP
-.B View->Show Only Selected File
-This menu item limits the items (file, sections, crossings, ties) displayed in
-the \fBData Table\fP list to those associated with the most recently
-selected file (e.g. a file selected by clicking in the \fBData Table\fP list
-while the <View->Show Files> option is active).
-.TP
-.B View->Show Only Selected Section
-This menu item limits the items (file, sections, crossings, ties) displayed in
-the \fBData Table\fP list to those associated with the most recently
-selected section (e.g. a section selected by clicking in the \fBData Table\fP list
-while the <View->Show Sections> option is active).
-
-The third group includes two options:
-.TP
-.B View->Visualize Survey
-This option is not active, and is for future use.
-.TP
-.B View->Show Modelplot
-This option causes an addition "Model Plot" window to be shown that displays
-the navigation adjustment model as three time series: longitude on top, latitude
-in the middle, and vertical on the bottom.
-.TP
-.B Action
-This button brings up a pulldown menu with nine items:
-\fBSet File Poor Navigation\fP, \fBSet File Good Navigation\fP,
-\fBSet File Fixed Navigation\fP, \fBAuto-Pick Offsets\fP,
-\fBCheck for New Crossings\fP, \fBAnalyze Crossings\fP, \fBZero All Z Offsets\fP,
-\fBInvert Navigation\fP, and \fBApply Adjusted Navigation\fP.
-.TP
-.B Action->Set File Poor Navigation
-This menu item causes \fBmbnavadjust\fP to treat the navigation of
-a selected swath data file as poor. This option is only activated
-when the \fBData Table\fP list widget shows a list of the imported
-swath files and one file has been selected by clicking in that list.
-In the case where no files are fixed, the final adjusted navigation model
-is centered on the average navigation offsets required for good files.
-The offsets tieing to files with poor navigation are ignored in
-calculating the averages.
-.TP
-.B Action->Set File Good Navigation
-This menu item causes \fBmbnavadjust\fP to treat the navigation of
-a selected swath data file as good, which is in fact the default state
-for swath files. This option is only activated
-when the \fBData Table\fP list widget shows a list of the imported
-swath files and one file has been selected by clicking in that list.
-In the case where no files are fixed, the final adjusted navigation model
-is centered on the average navigation offsets required for good files.
-The offsets tieing to files with good navigation are used in
-calculating the averages.
-.TP
-.B Action->Set File Fixed Navigation
-This menu item causes \fBmbnavadjust\fP to treat the navigation of
-a selected swath data file as fixed, which means that all navigation
-points for this file will have zero offsets in the final adjusted navigation.
-Effectively, all of the offsets between fixed and unfixed files are taken up in
-the adjustments of the unfixed files.
-This option is only activated
-when the \fBData Table\fP list widget shows a list of the imported
-swath files and one file has been selected by clicking in that list.
-.TP
-.B Action->Auto-Pick Offsets
-This menu item causes \fBmbnavadjust\fP to automatically pick offsets in
-all of the unset crossings currently displayed in the \fBData Table\fP list.
-If <View->Show True Crossings> has been selected, then only true crossings are
-displayed and only the unset true crossings will be automatically picked.
-In general, unsupervised offset picks are frequently erroneous, and use
-of this experimental option is not encouraged.
-.TP
-.B Action->Check For New Crossings
-This menu item causes \fBmbnavadjust\fP to search for new crossings using
-the adjusted navigation from the current inversion. Often, new places where
-swaths overlap and cross emerge as the navigation is adjusted. The percentage
-of overlap is also recalculated for all of the existing crossings. If new true
-crossings are found, the user will be unable to perform a new inversion until
-all of the true crossings have been analyzed.
-.TP
-.B Action->Analyze Crossings
-This menu item causes \fBmbnavadjust\fP to load and display the first
-crossing in the "Nav Err" window.
-.TP
-.B Action->Zero All Z Offsets
-This menu item causes \fBmbnavadjust\fP to load and display the first
-crossing in the "Nav Err" window.
-.TP
-.B Action->Invert Navigation
-This menu item causes \fBmbnavadjust\fP to invert for an optimal
-navigation solution that fits the offsets defined at the navigation
-tie points while minimizing speed and acceleration. This option is
-only activated when all of the true crossings in the current
-\fBmbnavadjust\fP project have been analyzed interactively.
-.TP
-.B Action->Apply Adjusted Navigation
-This menu item causes \fBmbnavadjust\fP to export the adjusted
-navigation model from the current inversion to the
-swath files in the project.This option is
-only activated when the inversion is current, meaning that no new
-data have been imported and no changes to offset picks have been
-made since the last inversion.
-.TP
-.B About
-This button brings up a pulldown menu with one item: \fBAbout\fP.
-.TP
-.B About->About
-This menu item brings up a popup window that displays the program's
-name, authors, and version. Clicking the \fBDismiss\fP button will
-close the window.
-.TP
-.B Data Table
-This list widget displays one of five tables of information regarding
-the current \fBmbnavadjust\fP project. These tables are a list of the
-imported swath surveys, the data files, the shorter data sections
-comprising each data file, a list of the identified crossing swaths, and
-a list of the navigation tie points defined interactively by the user.
-The \fBView\fP pulldown menu allows the user to set which table is displayed.
-
-The survey list will look something like:
-.br
- 	00 53 2009/08/03 08:18:49.484999 2009/08/03 22:52:59.375000 good
- 	01 51 2009/08/04 09:03:11.938999 2009/08/04 23:02:03.470999 good
- 	02 01 1998/05/13 01:33:36.791000 1998/05/13 02:42:11.703999 good
-.br
-Here the first column is the survey counter, the second is the number
-of swath files included in each survey, and the following information
-consists of the start and end times of the data in each survey
-shown in YYYY/MM/DD HH:MM:SS.SSSSSS format, followed by the survey status
-(poor, good, fixed, fixedxy, fixedz).
-
-The file list will look something like:
-.br
- 	0000:00  good   11  0.0  0.0 ../../20090803/20090803_081706.mb88
- 	0001:00  good   11  0.0  0.0 ../../20090803/20090803_083332.mb88
- 	0002:00  good   11  0.0  0.0 ../../20090803/20090803_085004.mb88
- 	0003:00  good   11  0.0  0.0 ../../20090803/20090803_090636.mb88
- 	0004:00  good   10  0.0  0.0 ../../20090803/20090803_092307.mb88
- 	 	..........................................
- 	0053:01  good   12  0.0  0.0 ../../20090804/20090804_090127.mb88
- 	0054:01  good   10  0.0  0.0 ../../20090804/20090804_092036.mb88
- 	0055:01  good   11  0.0  0.0 ../../20090804/20090804_093707.mb88
- 	0056:01  good   10  0.0  0.0 ../../20090804/20090804_095339.mb88
- 	0057:01  good   11  0.0  0.0 ../../20090804/20090804_101010.mb88
- 	 	..........................................
- 	0104:02  fixed   8  0.0  0.0 ../../MBARI/1998em300/mbari_1998_630_msn.mb57
-.br
-Here the first column is the file counter and survey counter separated by a colon.
-The second column indicates the file navigations state; "gd" indicates good
-navigation, "pr" indicates poor navigation, and "fx" indicates fixed
-navigation. The third column shows the number of sections extracted from this file.
-The fourth and fifth columns show any heading
-or roll bias offsets in degrees applied to the swath data for that file.
-The sixth column gives the name of the swath data file imported into
-\fBmbnavadjust\fP. Note that the name shown here is that of the "raw"
-swath file. The data imported by \fBmbnavadjust\fP is,
-if possible, extracted from a "processed" swath file
-generated by \fBmbprocess\fP rather than the
-associated "raw" file.
-
-The file section list will look something like:
-.br
- 	00:0000:00 2009/08/03 08:17:07.546998 2009/08/03 08:18:49.484999
- 	00:0000:01 2009/08/03 08:18:49.984999 2009/08/03 08:20:26.952999
- 	00:0000:02 2009/08/03 08:20:27.452999 2009/08/03 08:22:05.890999
- 	00:0000:03 2009/08/03 08:22:06.390999 2009/08/03 08:23:43.344001
- 	00:0000:04 2009/08/03 08:23:43.844001 2009/08/03 08:25:19.796999
- 	00:0000:05 2009/08/03 08:25:20.296999 2009/08/03 08:26:57.265997
- 	00:0000:06 2009/08/03 08:26:57.765997 2009/08/03 08:28:35.219001
- 	00:0000:07 2009/08/03 08:28:35.719001 2009/08/03 08:30:16.155999
- 	00:0000:08 2009/08/03 08:30:16.655999 2009/08/03 08:31:57.594001
- 	00:0000:09 2009/08/03 08:31:58.094001 2009/08/03 08:33:36.546999
- 	00:0000:10 2009/08/03 08:33:37.046999 2009/08/03 08:33:37.546999
-.br
-Here the first column shows the section id with the survey counter, the file counter,
-and the section counter separated by colons. The following information
-consists of the start and end times of each section
-shown in YYYY/MM/DD HH:MM:SS.SSSSSS format.
-
-The crossing list will look something like:
- 	-X    0 000:009 001:000  21  0
- 	-     1 001:009 002:000  10  0
- 	-     2 002:009 003:000  10  0
- 	U     3 003:009 004:000   6  0
- 	-     4 005:009 006:000  13  0
- 	U     5 007:009 008:000   3  0
- 	U     6 009:008 009:010   2  0
- 	*     7 009:008 010:000  16  1
- 	*X    8 009:009 010:000  41  1
- 	-     9 009:008 010:001   1  0
-.br
-Here the first column indicates the processing status for the
-crossing. The first character is the status flag. If the status flag is "U",
-then no decision has been made about skipping or tieing this crossing.
-New crossings always show a "U" flag prior to being
-inspected by a user. If the first character is "-", then the crossing
-has been skipped, and if the first character is "*", then at least one
-tie point has been set. The second column is the crossing counter. The
-third and fourth columns identify the swath data sections that overlap
-in this crossing. Each are identified by their file id and section id
-separated by ":". The fifth column indicates the percentage of overlap
-of the two sections in this crossing. The larger the degree of overlap,
-the more likely that diagnostic matching topographic features exist that
-can be used to determine the navigation offsets required for this crossing.
-The sixth, and last column gives the number of tie
-points that have been defined for each crossing. New crossings always
-begin with 0 tie points prior to being inspected by a user.
-
-The tie point list will look something like:
-.br
- 	   7 0 009:008:07 010:000:04 00:00  1.02 \-2.87 0.00 |  9.61  8.49 1.40 | 0.041 0.107 0.027
- 	   8 0 009:009:02 010:000:00 00:00  0.90 \-4.47 0.00 |  7.37  6.30 2.29 | 0.040 0.184 0.033
- 	  12 0 009:008:04 010:002:04 00:00  4.11 \-8.24 0.00 |  9.28  5.99 1.80 | 0.037 0.021 0.025
- 	  14 0 010:000:02 010:002:06 00:00  2.12 \-4.38 0.00 |  7.50  6.70 1.10 | 0.007 0.065 0.005
- 	  16 0 009:007:04 010:003:04 00:00  5.90 \-5.90 0.00 |  8.66  6.84 1.70 | 0.019 0.085 0.027
- 	  19 0 009:006:04 010:004:04 00:00  8.32 \-6.83 0.00 |  8.78  8.55 6.65 | 0.026 0.066 0.024
- 	  21 0 009:005:05 010:005:03 00:00  8.96 \-8.75 0.00 | 12.38  8.74 5.16 | 0.008 0.045 0.008
- 	  23 0 009:004:04 010:006:04 00:00 12.23 \-5.98 0.00 |  7.03  4.49 1.40 | 0.019 0.034 0.010
- 	  26 0 009:003:04 010:007:04 00:00 17.42 \-4.36 0.00 | 13.92 10.11 1.80 | 0.025 0.037 0.028
-.br
-Here the first column indicates the crossing which contains the tie point,
-and the second column shows which tie point (of those defined for that
-crossing) is displayed in a particular line. The third and fourth columns
-identify the navigation control points of the tie point. The navigation
-control points are specified by file, section, and nav point numbers separated
-by ":". The fifth through seventh columns are the longitude, latitude and vertical
-offsets (in meters) set interactively by the user. These represent the distance the second
-navigation control point must be moved relative to the first in order to make
-the bathymetry in the two swaths match. The tenth through twelth columns show the
-magnitude of the three axes of the uncertainly ellipsoid associated with each tie.
-The uncertainly ellipsoid is estimated as a 3x3 tensor and used to weight the tie
-offsets in the navigation adjustment inversion. Here the major and second axes are
-always close to horizontal, and the minor is axis is always close to vertical.
-The last three columns are nonzero only
-after an inversion for an optimal navigation solution has been performed. These
-represent the residual, or difference, between the offset calculated for this tie
-point in the inversion and that set by the user
-(displayed in the fifth through seventh columns).
-
-If the file list is displayed and one file is selected by clicking in
-the list, then the user can fix or unfix the navigation of that file using
-the <Action->Fix File> or <Action->Unfix File> pulldown menu items.
-If either the crossing list or the tie point list are displayed, selecting
-one crossing or one tie point by clicking in the list widget will cause
-the specified crossing to be loaded and displayed in the \fBNav Err\fP
-window.
-
-.SS Controls Window
-This dialog window is brought up by clicking the \fBOption->Controls\fP
-menu item in the \fBMBnavadjust Window\fP. This window includes two slider
-widgets setting data importation parameters, four slider widgets setting
-data display parameters, a button to apply any changes, and a button to
-dismiss the window.
-
-.TP
-.B Max Section Length (km)
-When \fBmbnavadjust\fP imports swath data, it breaks each data file
-up into a set of sections, or pieces. The geographical coverages of all sections
-are then compared to determine where swaths overlap or cross. This control
-sets the section track length. The ideal section length varies with the sonar
-altitude and ping rate. If the section length is too short, there will be too
-many small sections and an excessive number of crossings to analyze. If the
-section length is too large, individual sections will be slow to load and display.
-.TP
-.B Max # Soundings in Section
-This slider widget sets an additional or alternative control on swath data section size: the
-maximum number of soundings (not pings) that may be included in a given section. For some
-datasets, it may be more convenient to use the number of soundings rather than the track
-length as the criterea for breaking files up into sections.
-.TP
-.B Decimation
-When swath bathymetry sections are displayed in the \fBNav Err\fP window,
-the primary display consists of bathymetric contours.
-The time required for calculating these
-contours is linear with the number of soundings. This slider allows users to
-decimate the pings used for the contour displays. If the decimation is set
-to 1, all soundings are used. If the decimation is set to 2, the soundings from
-every second ping are used for contouring.
-.TP
-.B Contour Interval (m)
-This slider widget sets the depth interval in meters for the bathymetric contours.
-.TP
-.B Color Interval (m)
-This slider widget sets the the depth interval in meters at which the
-color of the bathymetric contours changes. The contours are generated in four
-colors: black, red, green, and blue. The color interval should be a multiple
-of the contour interval.
-.TP
-.B Tick Interval (m)
-This slider widget sets the depth interval in meters at which contours have
-downhill facing tickmarks. The tick interval should be a multiple of the contour
-interval.
-.TP
-.B Inversion Smoothing
-This slider widget sets the importance of smoothing in the adjusted
-navigation model. Larger values yield a smoother model, smaller values a rougher model.
-The default is 4.00, and possible ranges are 0.10 to
-10.0, where the smoothing penalty weight applied to the first and
-second derivatives of the adjusted navigation perturbation is ten
-raised to this power.
-.TP
-.B Apply
-This button applies any changed values in the slider widgets of the \fBControls Window\fP.
-If the \fBControls Window\fP is closed without the \fBApply\fP button being clicked, all
-changes to the values controlled by the sliders are lost.
-.TP
-.B Dismiss
-This button closes the \fBControls Window\fP.
-
-.SS Nav Err Window
-This window allows users to interactively inspect crossing swaths,
-define navigation tie points where bathymetric features can be matched,
-and set the navigation offsets at those tie points. This window can
-be brought up in a number of ways. If one pulls down the
-menu option <Action->Analyze Crossings>, then the "Nav Error" window
-will come up with the first crossing loaded. Alternatively, if the
-<View->Show All Crossings> menu item has been selected so that a table of
-crossings is displayed, clicking once on any of the crossing items in
-this tabel will bring up the  "Nav Error" window with that crossing loaded.
-Similarly, if tie points have been established and the tie point table
-displayed by selecting the <View->Show Ties> menu item, then clicking on
-any of the tie items this table will bring up the "Nav Error" window
-and load the crossing that includes the selected tie point. If the
-"Nav Error" window is already displayed, clicking on crossing or tie items
-in the display tables will load the selected crossing in place of whatever
-crossing was previously shown.
-
-The Nav Err window includes a number of button widgets and three display
-canvases. The larger display to the right shows bathymetric contour maps
-of the overlapping swaths overlain by navigation tracks and any tie points
-that have been defined for the current crossing. The smaller canvas on the
-middle left shows the RMS bathymetry misfit between the two swaths as a
-function of lateral (x and y) offset using the current vertical (z)offset. The
-smallest canvas on the lower left shows the RMS Bathymetry misfit between
-the two swaths as a function of vertical offset using the current
-lateral offset.
-
-.TP
-.B Contour Display
-This canvas displays color bathymetric contours from both overlapping
-swaths in the current swath crossing. Initially, the display is scaled
-so that the entire area covered by the current crossing is visible. The
-bathymetric contours of the second swath can be moved relative to those
-of the first by dragging with the left mouse button in the canvas. The
-current navigational offset changes as the contours shift. The location
-of the current lateral offset also changes simultaneously on the misfit plot. The
-user can display a subregion of the current map by dragging a rectangle in the canvas
-with the middle mouse button. This zoom operation can be repeated as many times
-as desired. The right mouse button is used to set the location of the current
-navigational tie point. When the right mouse button is clicked on a point in
-the contour map, the closest navigation control points from each swath to
-that position are selected for the current tie point. In practice, the user
-should right-click on the bathymetric feature being matched to set the
-tie point correctly.
-.TP
-.B Lateral Misfit Display
-This canvas shows a color two dimensional plot of the RMS bathymetric misfit
-between the two overlapping swaths. The misfit is shown as a function
-of relative lateral (x and y) offsets between the two  swaths using the
-current vertical (z) offset.  Put
-another  way,  the misfit plot shows how good, or bad, the
-misfit becomes as one moves one swath relative to another.
-The  lowest misfit values are shown in red; higher misfits
-are shown in blues to purples. The location of the minimum
-misfit  is  marked by a black "X", and the location of the
-current navigation offset is shown by a small  red  square
-with a black outline. If an inversion has been performed, a
-small black "+" will mark the location of the offset calculated
-by the inversion. If a user left-clicks in the Lateral Misfit Display, the
-location of the cursor is taken as the new navigation offset
-and the red square moves to that location. Simultaneously, the
-bathymetric contours in the Contour Display shift to reflect
-the new offset.
-.TP
-.B Vertical Misfit Display
-This canvas shows a color profile plot of the RMS bathymetric misfit
-between the two overlapping swaths. The misfit is shown as a function
-of relative vertical (z) offset between the two  swaths using the
-current lateral (x andy) offsets.  Put
-another  way,  the misfit plot shows how good, or bad, the
-misfit becomes as one moves one swath vertically relative to another.
-The  lowest misfit values are shown in red and as high points
-in the profile; higher misfits
-are shown in blues to purples and as low points. The location of the minimum
-misfit  is  marked by a black "X", and the location of the
-current vertical offset is shown by a solid line. If an inversion has been performed, a
-small black "+" will mark the location of the offset calculated
-by the inversion. If a user left-clicks in the Vertical Misfit Display, the
-location of the cursor is taken as the new vertical offset
-and the solid line moves to that location. Simultaneously, the
-bathymetric contours in the Contour Display shift to reflect
-the new offset.
-.TP
-.B Settings
-This button brings up a pulldown menu with two items: \fPBiases\fP and \fBContoursB
-.TP
-.B Settings->Biases
-This menu item brings up a dialog window with several slider widgets
-that set roll and heading bias values.
-These widgets are discussed in the \fBBiases\fP section below.
-.TP
-.B Settings->Contours
-This menu item brings up a dialog window with several slider widgets
-that set parameters controlling how swath data are imported and displayed.
-These widgets are discussed in the \fBControls\fP section above.
-.TP
-.B Previous
-Clicking this button causes the Nav Err window to load and display the previous crossing.
-.TP
-.B Next
-Clicking this button causes the Nav Err window to load and display the next crossing.
-.TP
-.B Next Unset
-Clicking this button causes the Nav Err window to load and display the next crossing which
-has no tie points set and has not been explicitly skipped.
-.TP
-.B Skip Crossing
-This button indicates that no good tie points can be defined for the current crossing.
-The program \fBmbnavadjust\fP will not allow an inversion to be calculated until all true crossings
-either have tie points defined or have been explicitly skipped.
-.TP
-.B Full Size
-Clicking this button causes the contour display to resize so that it shows the entire area
-covered by the swath sections in the current crossing.
-.TP
-.B Unset Crossing
-This button returns the current crossing to the original unset state, deleting any ties that
-have been set.
-.TP
-.B Reset Crossing
-This button is active only if a tie has been set for the current crossing. If a tie exists,
-and the user has changed the current offset from that of the current tie, then this button
-returns the working offset values to that of the existing tie.
-.TP
-.B Set Offset
-This very important button causes the current navigational offset to be set for the
-current tie point and crossing. This button is the only way that the navigational offsets
-are actually applied to the \fBmbnavadjust\fP project. If the user closes the Nav Err window,
-changes the loaded crossing, or changes the active tie point without clicking <Set Offset>,
-whatever navigational offset was viewed will be lost. Tie points are displayed in yellow
-once they are set, and in red when either the navigational offset or the navigation
-points have been changed but not yet set.
-.TP
-.B Zero Z Offset
-This button sets the current vertical offset to zero meters.
-.TP
-.B Add Tie
-This button adds a new tie point for the current crossing and makes this new tie point
-active. The tie point initially adopts the current navigational offset.
-.TP
-.B Zero Offset
-This button sets the current navigational offset to zero meters for longitude, latitude, and vertical.
-.TP
-.B Select Tie
-If more than one navigation tie point has been defined for a crossing,
-then only one tie point can be active at any time. The navigation control points of the
-active tie points will be displayed as red boxes, and those of any inactive
-tie points will be shown as smaller red boxes. This button changes the active tie point.
-Repeatedly clicking this button will cycle through all of the tie points in the
-current crossing. Note that each tie point has its own offset defined, so in general
-the positions of the bathymetric contours will change as the active tie point changes.
-.TP
-.B Delete Tie
-This button deletes the current active tie point.
-.TP
-.B Dismiss
-This button closes the Nav Err window.
-.TP
-.B Minimum Misfit
-This button shifts the current offset to the value identified as the minimum misfit in
-the current misfit display. The minimum misfit is shown as the large black X on the
-color lateral misfit plot and on the vertical misfit profile.
-.TP
-.B Minimum XY Misfit
-This button shifts the current lateral offset to the values identified as the minimum lateral misfit in
-the current misfit display. The vertical offset is not changed. The minimum lateral
-misfit is shown as the small black X on the lateral misfit plot. This button is generally
-used when the data are already corrected for all vertical offsets (e.g. tides), and so
-all z offsets can be confined to zero values.
-.TP
-.B Center on Zero Offset
-This button causes the misfit plot to be regenerated using a zero navigational offset as the plot origin.
-.TP
-.B Center on Current Offset
-This button causes the misfit plot to be regenerated using the current navigational offset as the plot origin.
-
-.SS Biases Window
-This dialog window is brought up by clicking the \fBSettings->Biases\fP
-menu item in the \fBNav Err Window\fP. The controls allow users to set
-roll and heading bias (or offset) values to be a applied to some or all of
-the swath bathymetry in the \fBmbnavadjust\fP project. Under most circumstances,
-roll bias and pitch bias problems should be resolved before swath data are
-imported into \fBmbnavadjust\fP. However, these settings make it possible to
-deal with bias issues if they are discovered during the navigation adjustment
-process. This window includes two toggle
-buttons to set the bias mode, four slider widgets to set the bias parameters,
-a button to apply the bias settings to all swath files, a button to apply the bias
-settings to the current swath file, and a button to
-dismiss the window.
-
-.TP
-.B Same Biases (km)
-This toggle button sets the bias mode so that the heading and roll bias is identical
-for both swath data sections in the current crossing. The <Different Biases> toggle
-is deselected when this toggle is selected.
-.TP
-.B Different Biases (km)
-This toggle button sets the bias mode so that the heading and roll bias can be
-different between the two swath data sections in the current crossing.  The <Same Biases> toggle
-is deselected when this toggle is selected.
-.TP
-.B Section 1 Biases (deg) \-> Heading
-This slider widget sets the heading bias for swath section 1. The
-.TP
-.B Section 1 Biases (deg) \-> Roll
-This slider widget sets the roll bias for swath section 1.
-.TP
-.B Section 2 Biases (deg) \-> Heading
-This slider widget sets the heading bias for swath section 2.
-.TP
-.B Section 2 Biases (deg) \-> Roll
-This slider widget sets the roll bias for swath section 2.
-.TP
-.B Apply to All Files
-This button sets the current heading and roll bias values as the
-bias values for all swath files in the \fBmbnavadjust\fP project.
-This button is only enabled when the <Same Biases> toggle is selected.
-.TP
-.B Apply
-This button sets the current heading and roll bias values as the
-bias values for the swath sections in the current crossing. The bathymetry
-contours and misfit plot are recalculated and redisplayed using the
-new bias values.
-.TP
-.B Dismiss
-This button closes the \fBControls Window\fP.
-
-
-.SH USING MBNAVADJUST 1: IMPORTING DATA
-Users begin using \fBmbnavadjust\fP by starting up the program
-on the command line:
-.br
- 	mbnavadjust
-.br
-In order to get started, one must either open an existing
-\fBmbnavadjust\fP project or initialize a new one. Both options
-are available under the <File> menu with the <File->New> and <File->Open>
-menu buttons. When one pulls down the <File->New> option, a dialog opens
-that allows navigation of the filesystem and specification of
-a project name. Whatever project location and name is chosen,
-a directory "{project_path}/{project_name}.dir" and a file
-"{project_path}/{project_name}.nvh" will be created. Once
-a project exists and has been opened, swath data can be imported and then
-analyzed. To open an existing \fBmbnavadjust\fP project, click
-the <File->Open> option and select the corresponding "*.nvh" file.
-
-The main \fBmbnavadjust\fP window displays basic information in a set of
-labels in the upper left, including the open project name, the number of
-files imported, the number of crossings found, the number of crossings
-analyzed, the number of navigation tie points set, and whether an
-up-to-date inversion for optimal navigation has been performed. A scrollable
-text window in the lower left displays messages regarding all actions
-performed by the program during the current session. Another scrollable
-window on the right displays one of three tables of information according
-a user selection under the <View> menu. The three choices are a table
-of the imported swath files, a table of the swath crossings, and a table
-of the interactively defined navigation tie points. If no swath data has
-yet been imported, then the all of the tables will be empty. Once some data
-files are imported, the swath file table will have entries and
-some number of crossings will be defined (assuming that
-swaths do overlap and cross), but no tie points will yet be defined.
-
-In order to import swath data into an \fBmbnavadjust\fP project,
-pull down the <File->Import Swath Data> menu item. A file selection
-dialog will appear. Swath data can be imported in single files or through
-datalists (see the \fBMB-System\fP manual page for a description
-of recursive datalists). As with other \fBMB-System\fP programs, the format
-id will be automatically determined if possible for each file selected.
-If a filename does not follow the the \fBMB-System\fP naming convention, the
-user may need to manually set the format id in the appropriately labeled
-dialog text widget.
-
-Each file that is imported is broken into
-a number of sections. The maximum size of the sections in line length or
-in number of soundings is set in a dialog opened by clicking on
-<Option->Controls>. Navigation control points are selected at regular
-intervals within each section. The control point distance interval is
-approximately  one tenth of the specified segment length, so there are
-up to 11 control points for each section. The data for each section is
-written as a format 71 bathymetry-only file in the "*.dir" directory.
-As the files are imported, the areal extent of each section is
-compared to the other sections. Any pair of sections that overlap
-is added to a list of crossings to be investigated graphically. This list
-can be displayed by pulling down the <View->Show Crossings> menu item.
-
-As the user later works through the crossings, he or she will will define
-tie points whenever the overlapping bathymetry allows the navigational offset
-to be determined reliably in three dimensions. Each tie point will reference
-two of the navigation control points, one from each swath in the crossing.
-Ultimately, some crossings will allow one, or in some case multiple tie
-points to be defined. Other crossings will still have no tie points, either
-because the swaths don't really overlap or because there aren't any
-distinctive features to match. When all of the crossings have been inspected,
-then the user can invoke inversion for an optimal navigation solution.
-In cases where the data are known to be already corrected for vertical offsets,
-such as tides, then the user can uniformly set the vertical (z) components of
-offsets to zero.
-
-.SH USING MBNAVADJUST 2: INSPECTING CROSSINGS
-
-.SS Bringing Up The Nav Error Window
-
-The heart of \fBmbnavadjust\fP is the interactive inspection of the
-swath crossings. One can bring up the crossing inspection window
-(entitled "Nav Error") in a number of ways. If one pulls down the
-menu option <Action->Analyze Crossings>, then the "Nav Error" window
-will come up with the first crossing loaded. Alternatively, if the
-<View->Show Crossings> menu item has been selected so that a table of
-crossings is displayed, clicking once on any of the crossing items in
-this tabel will bring up the  "Nav Error" window with that crossing loaded.
-Similarly, if tie points have been established and the tie point table
-displayed by selecting the <View->Show Ties> menu item, then clicking on
-any of the tie items this table will bring up the "Nav Error" window
-and load the crossing that includes the selected tie point. If the
-"Nav Error" window is already displayed, clicking on crossing or tie items
-in the display tables will load the selected crossing in place of whatever
-crossing was previously shown.
-
-Once the "Nav Err" window is displayed, the user can also move through
-the crossings by clicking on the <Previous>, <Next>, and <Next Unset>
-buttons. The <Previous> and <Next> buttons will load the previous or
-next, respectively, crossings in the crossing list. As discussed below,
-each crossing must ultimately be "resolved" by either having one or
-more navigation offsets set at particular "tie points", or by being
-"skipped" because no matchable seafloor features are found. The <Next Unset>
-button will load the next crossing that has not been resolved.
-To close the "Nav Err" window, click the <Dismiss> button.
-
-.SS Interactively Matching Seafloor Features
-
-The "Nav Error" window is complicated in appearance, and
-regrettably complicated in function also.
-The purpose is to allow the user to determine if any seafloor features
-can be confidently matched in the overlapping swaths. If so, one or more
-tie points can be defined. In order to ease the identification of matching
-features, two simultaneous displays are provided.
-The larger plot on the right consists of overlain
-bathymetric contours derived from each of the two swaths. The smaller
-canvas on the left shows a color two dimensional plot
-of the RMS misfit between the two swaths. The misfit is shown
-as a function of relative lateral offsets between the two swaths. Put another
-way, the misfit plot shows how good, or bad, the misfit becomes as one moves
-one swath relative to another. The lowest misfit values are shown in red; higher
-misfits are shown in blues to purples. The location of the global (three dimensional)
-minimum misfit is marked by the large black "X", the location of the minimum misfit
-using the current vertical offset value is marked by a small black "x",
-and the location of the current navigation offset is
-shown by a small red square with a black outline.
-
-The interactive aspect of the "Nav Error" window works simultaneously
-in both displays. If the user holds down the left mouse button in the
-contour plot and moves the cursor, the bathymetry contours from one swath
-will move along with the cursor. In this way, the user can move one of the
-swaths around relative to the other until the contours line up and features
-match. As the contours move, the red square showing the current offset location
-also moves on the misfit plot. The user can thus visually relate the contour matching
-to the misfit function. The combination of these two displays greatly improves
-a user's ability to reliably determine navigational offsets (and to conclude
-where navigational offsets cannot be determined).
-
-The "Nav Err" window includes two buttons that are particularly useful during
-efforts to match seafloor features. The <Minimum Misfit>
-button below the misfit display will cause
-\fBmbnavadjust\fP to set the current navigational offset to that
-associated with the smallest misfit for the current misfit display. This button
-is often used first to get close to the right offsets.
-The <Zero Offset> button above the contour display will return both displays
-to a state of zero navigational offset.
-
-The relationship between the contoured bathymetry and the misfit plot
-is usually quite clear. If a strongly matching seafloor feature
-exists, then a distinct minimum will show up in the misfit plot. If the navigation
-is good and the feature already matches, then the misfit minimum will be located
-at the center of the plot, corresponding to an offset that is zero distance in
-both the east-west and north-south directions. If the navigation is bad, then
-the misfit minimum will be offset from the origin, and the offset vector
-will correspond to how far and what direction one must move one swath so that
-the features in both swaths match. In cases where there is no distinctive
-seafloor feature to match, the misfit plot will not display a strong
-minimum and it will be impossible to determine the relative navigational
-offset. Alternatively, the existence of multiple similar features can
-produce multiple local minima in the misfit map. In this case, the ambiguity
-between multiple possible solutions prevents the determination of the
-navigational offset. We have found that combining both contour
-and misfit displays allows interactive, visually based decision making that
-is more generally reliable than any automated scheme we can devise.
-
-Navigational offsets can only be used when they are associated with specific
-points on the overlapping swath navigation. These points are called "tie points".
-All crossings will begin with no tie points, and users can generate one or more
-tie points for any crossing as required.
-The creation and manipulation of tie points is discussed in detail in a later section.
-
-It is also important to understand that any apparent navigation offset observed
-in the contour and misfit plots is relative. It may turn
-out that both swaths are poorly navigated and have to be moved, or that all
-of the offset can be applied to one swath or the other. The set of decisions about
-how to distribute the relative navigation offsets among the affected swath files
-intrinsically involves speed and acceleration changes. Fortunately,
-we are able to formulate the automated inversion process discussed below to obtain an
-optimal navigation solution.
-
-.SS Display Controls
-
-The user controls the appearance of the bathymetry contour plot.
-The contours are generated at regular intervals in depth, and also change
-color and are annotated with downhill facing tickmarks at regular intervals.
-A controls dialog brought up by clicking on the <Settings->Contours> button
-allows the user to set the contour, color change, and tickmark intervals. This
-same dialog also sets a decimation parameter that causes the contours to be
-calculated from fewer soundings (the data are decimated by ignoring pings). The application of
-decimation may speed up the crossing loadings, but is not generally recommended
-unless the bathymetry is strongly oversampled.
-
-Users may also use a "zoom" feature to focus on small areas in the contour plot.
-The center mouse button is used to drag a box over a region of interest in the
-contour plot. When the center button is released, both the contour and misfit plots
-are regenerated to show the smaller area.
-Users may zoom as many times in succession as
-desired. One cannot undo the individual zoom events, but clicking the <Full Size>
-button in the "Nav Err" window will cause the plots to show the original, full
-area covered by the two swaths in the current crossing.
-
-The misfit plot represents lateral offsets scaled according to the current
-contour plot display. Specifically, the width and height of the misfit plot
-correspond to one half the width and height of the bathymetry contour plot.
-When the bathymetry plot area changes due to a zoom event, the misfit is
-recalculated and redisplayed centered around the current offset. The color map
-used for the misfit display is automatically scaled according to the
-minimum and maximum misfit values.
-
-.SS Setting Crossing Ties and Offsets
-
-In order to actually set the relative navigational offset between two particular
-points on overlapping or crossing swaths, the user must first create a tie point.
-This is accomplished by clicking on the <Add Tie> button in the "Nav Err" window.
-Once a tie point exists, it will be shown on the contour plot as two
-yellow or red-filled, black
-outlined squares connected by a thin black line. Each of the squares
-is located along one of the swath navigation tracks, and represents one of
-the navigation control points defined during data importation.
-There can be multiple tie points for each crossing, and
-each one is created by clicking on the <Add Tie> button.
-
-Only one tie point
-will be active at any time. The active tie point is displayed with larger boxes
-(the inactive tie points are only 1/4 the size. If only one tie point has been
-defined, it will always be active. If more than one tie point exists,
-clicking on the <Select Tie> button in the "Nav Err" window will change the
-active tie point to the next in the list for the displayed crossing
-(the tie points are selected in the order in which they were
-created). If the user wishes to delete a tie point, then click <Select Tie> until
-the undesirable tie point is active, and then click <Delete Tie>.
-The active tie point will be
-displayed in red fill if either the associated navigation
-control points or the navigational offset have been changed since it was
-created or last set. If the active tie point is up-to-date, then it will
-be displayed in yellow fill. Each new tie point is initially displayed
-in yellow. All inactive tie points will be shown in yellow fill.
-
-When viewing a crossing with one or more tie points, the offsets displayed are
-associated with the current tie point. As one moves the contours to match
-overlapping features, it is important to remember that the navigational
-offset will be applied to the navigation points indicated for the current
-tie. Thus, the feature being matched should derive from data (soundings)
-associated with those particular points on the shiptrack. This is
-accomplished by clicking on the bathymetric feature in the contour display
-with the right mouse button. The "right-click" causes \fBmbnavadjust\fP to
-find the soundings from each swath that are closest to the point clicked, and
-then to shift the current tie point to the navigation points on each swath
-that include these soundings (that is, the navigation points associated with
-the sonar pings that include the closest soundings).
-
-In order to set, and save, a navigational offset that causes a bathymetric
-feature to be matched in overlapping swaths, the user must click the
-<Set Offset> button above the contour display. If a user changes
-the active tie point or loads a different crossing
-without clicking <Set Tie>, then no offset information will be saved.
-Conversely, for any crossing with one or more tie points,
-the <Reset Offset> button will reset the navigational
-offset to the last value set for the current crossing and tie point.
-
-So, in practice, setting navigational offsets that will be used in obtaining
-an optimal navigation solution involves the following steps:
-.br
- 	1. Identify a bathymetric feature with
- 	   overlapping data so that it can be
- 	   matched.
- 	2. Create a tie point by clicking the
- 	   <Add Tie> button.
- 	3. Set the tie point location by right
- 	   \-clicking on the feature.
- 	4. If necessary, zoom the display to
- 	   focus on the bathymetric feature
- 	   of interest by dragging a box
- 	   with the middle mouse button.
- 	5. Adjust the offsets so that the
- 	   feature is matched in both swaths
- 	   (operating in the contour display,
- 	   the misfit display, or both).
- 	6. Click the <Set Offset> button.
-.br
-These steps should be followed for every feature that can be matched
-in overlapping swaths.
-
-In some cases, the user will find it useful
-to create and set multiple tie points in a single crossing. Other crossings
-may not allow any features to be matched. Users should click the
-<Skip Crossing> button on crossings that do not allow one or more offsets
-to be determined. In fact, \fBmbnavadjust\fP will
-only allow the calculation of a navigation
-solution when all of the crossings have been acted on by either having tie
-points set or by having been explicitly skipped.
-
-Users should feel free to iterate any way they like during
-crossing inspection. Crossings may be displayed as many
-times as desired, and ties can be created, deleted, and
-changed without restriction. Users may also quit \fBmbnavadjust\fP
-and then later reopen the same project without losing any
-information.
-
-.SS Setting Good, Poor and Fixed Navigation
-
-The adjusted navigation model produced by \fBMBnavadjust\fP should be
-accurate to the bathymetric resolution in a relative sense, but fitting
-a set of relative offset ties does not provide constraints on the global
-location of the survey data. \fBMBnavadjust\fP provides two means to
-control the global location of the adjusted navigation. First, the global
-location of the model is essentially an average of the overall offsets
-associated with good navigation. Users may use the <Action->Set File Poor Navigation>
-menu item to set selected surveys or files to be ignored in setting the
-global model. Second, if certain data files are thought to have correct
-navigation, they can be fixed (e.g. to have zero adjustment) using the
-<Action->Set File Fixed Navigation> menu item. In this case, all of the
-non-fixed files are adjusted relative to the fixed files.
-
-.SH USING MBNAVADJUST 3: INVERTING FOR AN OPTIMAL NAVIGATION SOLUTION
-
-.SS Performing the Inversion
-
-Once the user has interactively analyzed all of the crossings
-and closed the "Nav Err" window by clicking the <Dismiss> button,
-the <Action->Invert navigation> button becomes enabled. Clicking
-this button causes \fBmbnavadjust\fP to construct and solve
-an inversion for the optimal navigation.
-
-The inversion solves for navigation adjustments at each
-navigation control point which satisfy the offsets at the tie points while
-minimizing speed and acceleration. The speed and acceleration penalty is
-set using a penalty weight value that may be varied. If the penalty weight
-is large, the navigation adjustments may be smooth and small but not fit the
-tie point offsets well. An infinite penalty weight produces uniformly
-zero adjustments. In contrast, a small penalty weight allows the tie point offsets
-to be fit as well as possible even if large speed and acceleration spikes
-are a consequence. Hoever, even with a zero penalty weight the inversion may
-not be able to exactly satisfy all of the tie point offsets. If some of
-the tie point offsets are conflicting (e.g. one tie point requires a navigation
-control point to move to the west while another tie point requires a
-move to the east), then the offsets cannot all be simultaneously fit
-exactly.
-
-The inversion is actually performed many times with different penalty weights,
-and the "best" solution is selected and applied to the data. The details of
-how the "best" solution is identified are given in the section "Details
-of the Inversion" section below. A log of the inversion parameters, the results
-from each of the inversion iterations, and detailed results from the final
-inversion are output to the Message text window. The program then
-outputs an adjusted navigation file for each of the input swath files and
-updates (or creates) the parameter file for each swath file so that
-\fBmbprocess\fP will merge the adjusted navigation.
-
-The output adjusted navigation files are named by adding a ".na#" suffix
-to the original swath data filename. If a swath file imported into
-\fBmbnavadjust\fP for the first time is named:
-.br
- 	mbari_1998_55.mb57
-.br
-then the adjusted navigation resulting from that project will be named:
-.br
- 	mbari_1998_55.mb57.na0
-.br
-If this file is imported into a second \fBmbnavadjust\fP project, the
-result from inversion in that project will be:
-.br
- 	mbari_1998_55.mb57.na1
-.br
-In addition to generating the adjusted navigation, \fBmbnavadjust\fP also
-sets the NAVADJMODE and NAVADJFILE values in the \fBmbprocess\fP
-parameter file. In this case, the parameter file is named:
-.br
- 	mbari_1998_55.mb57.par
-.br
-and the processed swath file generated by running \fBmbprocess\fP is:
-.br
- 	mbari_1998_55p.mb57
-.br
-Refer to the \fBmbprocess\fP and \fBmbset\fP manual pages for details on
-the control and use of \fBmbprocess\fP.
-
-Note that the relevant parameter file settings will reflect the most recent
-inversion in \fBmbnavadjust\fP.
-Users do need to be aware that the order of navigation processing is important
-because, when possible, \fBmbnavadjust\fP imports existing processed data files.
-The data within the \fBmbnavadjust\fP projects are not, however, updated when the
-source data are updated. Consequently,
-standard navigation processing should be completed and applied with \fBmbprocess\fP
-before a swath file is imported into an \fBmbnavadjust\fP project. If a swath
-file is to be used in multiple \fBmbnavadjust\fP projects, the first project
-should be finalized and the results applied before data are imported into the
-second.
-
-.SS Fine-Tuning the Inversion
-
-Once an inversion has been performed, the user should inspect the fit for each
-of the tie points before accepting and applying the adjusted navigation. The relationship
-between the interactively defined navigation offsets and the offsets associated with
-the inversion can be investigated numerically in the tie points table or
-visually in the "Nav Err" window.
-
-We suggest first examining the tie points table
-by pulling down the <View->Show Ties> menu item. This table shows, from left to
-right, the identity of each tie point, the longitude and latitude offsets defined
-by the user (in meters), and the longitude and latitude residuals, or
-differences between these offsets and those associated with the inversion (in meters).
-If any of these residuals are unexpectedly large, simply clicking on the table line
-showing the suspect navigation tie will bring up the "Nav Err" window and load the
-crossing including that navigation tie. Once an inversion is performed, the
-"Nav Err" crossing displays show the inverted offset as a small '+' symbol
-on the misfit plot. The user can then determine whether the
-previously set navigation offset is truly required by the data. On occasion, one
-discovers that the offset obtained in the inversion is as consistent with
-the bathymetry as the offset originally set by the user. Once the offset values
-have been adjusted as necessary, they can be reset by clicking on the
-<Set Offset> button (just as in the earlier interactive sessions).
-
-Once all of the suspect navigation ties have been inspected, and perhaps corrected,
-another inversion can be generated using the revised set of offsets. In this way,
-users can iterate over cycles of inversion and inspection until a satisfactory
-(self-consistemt) solution is obtained. When the final inversion has been
-performed, the user can then run \fBmbprocess\fP on all of the affected swath data
-files to produce a set of processed files incorporating the optimally adjusted
-navigation. Once again, we emphasize that users should always finalize an
-\fBmbnavadjust\fP project before importing affected swath data into another
-\fBmbnavadjust\fP project.
-
-.SS Details of the Inversion
-
-The inversion is constructed as a sparse overdetermined least squares
-matrix problem. Suppose we have N navigation control points in all of the
-swath files and have defined M tie points. The form of the problem is:
-.br
-
-.br
- 	\fBA\fP \fBX\fP = \fBD\fP
-.br
-
-.br
-Here \fBX\fP is the vector of unknowns, which happen to be the changes in the longitude
-and latitude values of all of the navigation control points. So, there
-are 2N unknowns. Note that we
-do not solve directly for longitude and latitude, but rather for the change,
-or perturbation, to the longitude and latitude values.
-The matrix \fBA\fP contains 2N columns corresponding to
-the unknowns and a row for each of the constraints we can apply to
-the navigation adjustment problem. The number of elements in the "data"
-vector \fBD\fP also corresponds to the number of constraints.
-We apply four sets of constraints in this inverse problem:
-.br
- 	1) Fixed navigation points
-.br
- 	2) Penalize speed (first derivative)
-.br
- 	3) Penalize acceleration (second derivative)
-.br
- 	4) Fit navigation offsets at tie points
-
-The first kind of constraint is simply expressed as:
-.br
-
-.br
- 	XLONj = 0
-.br
-
-.br
-	XLATj = 0
-.br
-
-.br
-where XLONj is the longitude change
-and XLATj is the latitude change for the "j"th navigation control point.
-
-The second contraint (speed) is also one of minimization:
-.br
-
-.br
- 	-XLONj + XLONj+1
-.br
- 	----------------  = 0
-.br
- 	    \-Tj + Tj+1
-.br
-
-.br
- 	-XLATj + XLATj+1
-.br
- 	----------------  = 0
-.br
- 	    \-Tj + Tj+1
-.br
-
-.br
-Here XLONj+1 and XLATj+1 are the longitude and latitude changes
-for the "j+1"th navigational control point and Tj and Tj+1 are the
-times of the "j"th and "j+1"th navigational control points. The
-denominator in these expressions is thus the time difference between
-the two navigation points. The speed constraint can only be applied
-to navigation control points that are sequential, and is not applied
-across breaks in the swath data. Note that multiple swath files
-may be sequential without breaks, while time gaps or breaks can occur
-within a single swath file. The existence of gaps or breaks in the
-swath data is determined solely on the basis of time gaps as the data
-are imported.
-
-The third contraint (acceleration) is also one of minimization:
-.br
-
-.br
- 	XLONj \- 2 * XLONj+1 + XLONj+2
-.br
- 	-----------------------------     = 0
-.br
- 	    \-Tj + Tj+2
-.br
-
-.br
- 	XLATj \-2 * XLATj+1 + XLATj+2
-.br
- 	-----------------------------     = 0
-.br
- 	    \-Tj + Tj+2
-.br
-
-.br
-The second derivative calculation requires three sequential
-navigation control points: j, j+1, and j+2.
-Here XLONj+2 and XLATj+2 are the longitude and latitude changes
-for the "j+2"th navigational control point and Tj and Tj+2 are the
-times of the "j"th and "j+2"th navigational control points. The
-denominator in these expressions is thus the time difference between
-the "j"th and "j+1"th navigation points.
-
-The final, and most important constraints
-are the relative navigation ofsets defined for each of the M tie points.
-Since each offset has a longitude and a latitude value, there are 2M
-rows in \fBA\fP and elements in \fBD\fP associated with the tie points.
-If the "i"th tie point specifies an offset DLONi and DLATi between the "j1"th and "j2"th
-navigation control points, then the constraint may be expressed as:
-.br
-
-.br
- 	-XLONj1 + XLONj2 = DLONi
-.br
-
-.br
- 	-XLATj1 + XLATj2 = DLATi
-.br
-
-.br
-
-The size of the matrix problem will vary with the number of navigation
-control points, tie points, fixed points, and time gaps. However, the addition
-of the speed and acceleration minimization constraints guarentees that the
-number of constraints will always be larger than the number of unknowns, and
-so we will always be solving an overdetermined least squares problem.
-Each of the above equations contribute one row to the matrix problem, and each
-of these rows has at most three nonzero elements in \fBA\fP. As a result,
-this matrix problem is also always extremely sparse. This condition allows
-us to use one of a class of approximate least squares solution algorithms that are
-efficient in solving sparse problems. The algorithm used for \fBmbnavadjust\fP
-inversions is that of Olsen [1987].
-
-The importance of the speed and acceleration minimization constraints is varied
-by multiplying the associated matrix row elements by a penalty weight value.
-In practice, the inversion is constructed and solved with many different
-penalty weights, and the "best" inversion is selected and applied. Generally
-speaking, we seek the smoothest inversion that satisfactorily fits the
-tie point offsets. We set smoothness using the penalty weight value so that larger
-penalty weights correspond to smoother solutions.
-We measure the fit to the tie point offsets using the usual least squares
-calculation:
-.br
- 	   2      2                                    2
- 	Fit  = Chi  = SUM(  (DLONi \- (XLONj2 \- XLONj1))
- 	                                               2
- 	                  + (DLATi \- (XLATj2 \- XLATj1))  )
-.br
-using the same notation as above. Note that the units of Chi are distance, and so
-are physically meaningful. A smaller Chi corresponds to a better fit to the
-tie point offsets. The Chi value will be smallest for a zero
-penalty weight, and increase as more smoothing is applied.
-
-The initial solution is generated using a very small penalty weight to
-insure that the smoothing is negligible and that the tie point offsets are fit
-to the maximum degree possible. This first inversion is used to set a "reference"
-value of Chi. In some cases, the tie points offsets do not substantially conflict
-and it is possible for the inversion to fit the offsets nearly exactly so that
-Chi is quite small. If the initial Chi is greater than the target precision for
-the inversion (set from the Controls panel), \fBmbnavadjust\fP sets the
-reference fit to this initial value. Otherwise, the reference fit is set to
-the target precision. The default value is 0.1 meters, which is appropriate for
-high resolution, low-altitude surveys. Larger values will be more appropriate
-for large altitude (e.g. deep water hull-mounted) surveys. The program then
-recalculates solutions with different penalty weights until the resulting Chi
-is between 1.05 and 1.1 times the reference fit. This last solution is chosen
-as the best solution, reported as the navigation adjustment inversion solution,
-and applied to that swath data navigation.  The justification for choosing the
-optimal solution in this fashion is that this approach insures that the smoothness
-constraint is sufficient large to be impacting the fit, but not so large that
-the fit has been substantially degraded.
-
-.SH REFERENCES
-
-Nishimura, C. E., and D. W. Forsyth, Improvements in navigation
-using SeaBeam crossing errors, \fIMar. Geophys. Res.\fP, \fB9\fP, 333-352, 1988.
-.br
-.br
-Olson, A. H., A Chebyshev condition for accelerating convergence of iterative tomographic
-methods \- Solving large least squares problems,
-Phys. Earth Planet. Inter., 47, 333-345, 1987.
-.br
-.br
-Parker, R. L., \fBGeophysical Inverse Theory\fP, Princeton University Press, Princeton, NJ, 1994.
-
-.SH SEE ALSO
-\fBmbnavadjustmerge(1)\fP, \fBmbsystem\fP(1), \fBmbio\fP(1), \fBmbprocess\fP(1),
-\fBmbnavedit\fP(1), \fBmbset\fP(1)
-
-.SH BUGS
-It used to be too new to be bulletproof, now its too complicated to be bulletproof.
-Good luck.
diff --git a/src/man/man1/mbnavadjustmerge.1 b/src/man/man1/mbnavadjustmerge.1
deleted file mode 100644
index 82ebbae..0000000
--- a/src/man/man1/mbnavadjustmerge.1
+++ /dev/null
@@ -1,279 +0,0 @@
-.TH mbnavadjustmerge 1 "21 March 2015" "MB-System 5.0" "MB-System 5.0"
-.SH NAME
-\fBmbnavadjustmerge\fP \- Tool to merge two MBnavadjust projects,
-either adding one to the first or outputting a new project combining
-both existing projects.
-
-.SH VERSION
-Version 5.0
-
-.SH SYNOPSIS
-\fBmbnavadjustmerge\fP --input=project-base [--input=project-add --output=project-output
---set-global-tie=file:section[:snav]/xoffset/yoffset/zoffset[/xsigma/ysigma/zsigma]
---set-global-tie-xyz=file:section[:snav]
---set-global-tie-xyonly=file:section[:snav]
---set-global-tie-zonly=file:section[:snav]
---unset-global-tie=file:section
---add-crossing=file1:section1/file2:section2
---set-tie=file1:section1/file2:section2/xoffset/yoffset/zoffset
---set-tie-xyz=file1:section1/file2:section2
---set-tie-xyonly=file1:section1/file2:section2
---set-tie-zonly=file1:section1/file2:section2
---unset-tie=file1:section1/file2:section2
---set-ties-xyz-with-file=file
---set-ties-xyonly-with-file=file
---set-ties-zonly-with-file=file
---set-ties-xyz-by-survey=survey
---set-ties-xyonly-by-survey=survey
---set-ties-zonly-by-survey=survey
---set-ties-xyz-by-block=survey1/survey2\n
---set-ties-xyonly-by-block=survey1/survey2
---set-ties-zonly-by-block=survey1/survey2
---set-ties-zoffset-by-block=survey1/survey2/zoffset
---skip-unset-crossings
---insert-discontinuity=file:section
---verbose --help ]
-
-.SH DESCRIPTION
-\fBMBnavadjustmerge\fP is a command line program that merges two
-existing \fBMBnavadjust\fP projects or modifies a single
-\fBMBnavadjust\fP project.
-
-\fBMBnavadjust\fP is an interactive graphical program used to
-adjust swath data navigation by matching bathymetric features
-in overlapping and crossing swaths. The primary purpose of
-\fBmbnavadjust\fP is to eliminate relative navigational errors in swath
-data obtained from poorly navigated sonars.
-
-With respect to the merging function, if the \fBMBnavadjustmerge\fP
-user specifies two input projects and no output project, then the
-second project is added to the first. If an output project is specified, then the
-two projects are merged and the new combined project is output.
-
-In order to make use of the project modification commands, a
-single input project must be specified, along with one or more
-of the modification commands. These can include adding crossings,
-setting tie z-offset values, setting tie offsets (even if no
-corresponding crossing already exists), setting tie modes
-(xy only, z only, xyz),  and deleting ties.
-
-.SH AUTHORSHIP
-David W. Caress (caress at mbari.org)
-.br
-  Monterey Bay Aquarium Research Institute
-.br
-Dale N. Chayes (dale at ldeo.columbia.edu)
-.br
-  Lamont-Doherty Earth Observatory
-
-.SH OPTIONS
-.TP
-.B \--input=project-base
-.B \--input=project-add
-The \fB--input\fP option defines an existing, input \fBMBnavadjust\fP
-project. A project may be defined by a relative or absolute path
-to the project *.nvh file or the project *.dir directory. This option
-can be used twice to specify two input projects. The first
-use of \fB--input\fP defines the base input project, and the second
-defines the add input project. In the case where the \fB--output\fP
-option is used to define an output project, the two input projects
-will both be copied to the new output project (\fIproject-base\fP 
-first followed by \fIproject-add\fP). If the \fBoutput\fP option is
-not specified, then the \fIproject-base\fP project is used as the
-output, and the \fIproject-add\fP project is added on to the
-\fIproject-base\fP project. If only the base input project is
-specified, then that project will be modified according to one or
-more of the "add", "delete", "skip", or "set" commands.
-.TP
-.B \--output=project-output
-This option defines the new \fBMBnavadjust output project. The two
-input projects will both be copied to the new output project
-(\fIproject-base\fP  first followed by \fIproject-add\fP).
-If the \fBoutput\fP option is
-not specified, then the \fIproject-base\fP project is used as the
-output, and the \fIproject-add\fP project is added on to the
-\fIproject-base\fP project.
-.TP
-.B \--set-global-tie=file:section[:snav]/xoffset/yoffset/zoffset[/xsigma/ysigma/zsigma]
-This options sets a global tie for a navigation point in the project. Global ties are
-ties to the global reference frame, which generally means GPS positions (e.g. WGS84).
-The file and section id's must be specified, along with the x (east-west), y (north-south),
-and z (vertical postive up) offset values in meters. If the snav id (navigation point id)
-is not specified, it is assumed to be 0, the first navigation point in the
-specified section. If the uncertainties in the global tie (xsigma, ysigma, zsigma)
-are not specified, then xsigma = ysigma = 10 m and zsigma = 0.5 m are assumed.
-.TP
-.B \--set-global-tie-xyz=file:section[:snav]
-This option sets the mode of the existing specified global tie in the
-\fBMBnavadjust\fP project to be "XYZ". This means all three
-coordinates of the tie will be used as constraints in the inversion
-for an optimal navigation model.
-.TP
-.B \--set-global-tie-xyonly=file:section[:snav]
-This option sets the mode of the existing specified global tie in the
-\fBMBnavadjust\fP project to be "XY". This means only the horizontal
-coordinates of the tie will be used as constraints in the inversion
-for an optimal navigation model.
-.TP
-.B \--set-global-tie-zonly=file:section[:snav]
-This option sets the mode of the existing specified global tie in the
-\fBMBnavadjust\fP project to be "Z". This means only the vertical
-coordinate of the tie will be used as a constraint in the inversion
-for an optimal navigation model.
-.TP
-.B \--unset-global-tie=file:section
-This option unsets (deletes) the specified global tie in the
-\fBMBnavadjust\fP project. 
-.TP
-.B \--add-crossing=file1:section1/file2:section2
-This option adds the specified crossing to the \fBMBnavadjust\fP project.
-.TP
-.B \--set-tie=file1:section1/file2:section2/xoffset/yoffset/zoffset
-This option adds the specified tie to the \fBMBnavadjust\fP project.
-If the corresponding crossing does not already exist, it will be
-created.
-.TP
-.B \--set-tie-xyz=file1:section1/file2:section2
-This option sets the mode of the existing specified tie in the
-\fBMBnavadjust\fP project to be "XYZ". This means all three
-coordinates of the tie will be used as constraints in the inversion
-for an optimal navigation model.
-.TP
-.B \--set-tie-xyonly=file1:section1/file2:section2
-This option sets the mode of the existing specified tie in the
-\fBMBnavadjust\fP project to be "XY". This means only the horizontal
-coordinates of the tie will be used as constraints in the inversion
-for an optimal navigation model.
-.TP
-.B \--set-tie-zonly=file1:section1/file2:section2
-This option sets the mode of the existing specified tie in the
-\fBMBnavadjust\fP project to be "Z". This means only the vertical
-coordinate of the tie will be used as a constraint in the inversion
-for an optimal navigation model.
-.TP
-.B \--unset-tie=file1:section1/file2:section2
-This option unsets (deletes) the specified tie in the
-\fBMBnavadjust\fP project. 
-.TP
-.B \--set-ties-xyz-with-file=file
-This option sets the mode of all ties involved with the specified
-file in the \fBMBnavadjust\fP project to be "XYZ". This means all three
-coordinates of these ties will be used as constraints in the inversion
-for an optimal navigation model.
-.TP
-.B \--set-ties-xyonly-with-file=file
-This option sets the mode of all ties involved with the specified
-file in the \fBMBnavadjust\fP project to be "XY". This means only the horizontal
-coordinates of these ties will be used as constraints in the inversion
-for an optimal navigation model.
-.TP
-.B \--set-ties-zonly-with-file=file
-This option sets the mode of all ties involved with the specified
-file in the \fBMBnavadjust\fP project to be "Z". This means only the vertical
-coordinate of these ties will be used as constraints in the inversion
-for an optimal navigation model.
-.TP
-.B \--set-ties-xyz-with-survey=survey
-This option sets the mode of all ties involved with the specified
-survey in the \fBMBnavadjust\fP project to be "XYZ". This means all three
-coordinates of these ties will be used as constraints in the inversion
-for an optimal navigation model.
-.TP
-.B \--set-ties-xyonly-with-survey=survey
-This option sets the mode of all ties involved with the specified
-survey in the \fBMBnavadjust\fP project to be "XY". This means only the horizontal
-coordinates of these ties will be used as constraints in the inversion
-for an optimal navigation model.
-.TP
-.B \--set-ties-zonly-with-survey=survey
-This option sets the mode of all ties involved with the specified
-survey in the \fBMBnavadjust\fP project to be "Z". This means only the vertical
-coordinate of these ties will be used as constraints in the inversion
-for an optimal navigation model.
-.TP
-.B \--set-ties-xyz-by-survey=survey
-This option sets the mode of all ties between two sections in the specified
-survey in the \fBMBnavadjust\fP project to be "XYZ". This means all three
-coordinates of these ties will be used as constraints in the inversion
-for an optimal navigation model.
-.TP
-.B \--set-ties-xyonly-by-survey=survey
-This option sets the mode of all ties between two sections in the specified
-survey in the \fBMBnavadjust\fP project to be "XY". This means only the horizontal
-coordinates of these ties will be used as constraints in the inversion
-for an optimal navigation model.
-.TP
-.B \--set-ties-zonly-by-survey=survey
-This option sets the mode of all ties between two sections in the specified
-survey in the \fBMBnavadjust\fP project to be "Z". This means only the vertical
-coordinate of these ties will be used as constraints in the inversion
-for an optimal navigation model.
-.TP
-.B \--set-ties-xyz-by-block=survey1/survey2
-This option sets the mode of all ties between sections of the specified
-two surveys in the \fBMBnavadjust\fP project to be "XYZ". This means all three
-coordinates of these ties will be used as constraints in the inversion
-for an optimal navigation model.
-.TP
-.B \--set-ties-xyonly-by-block=survey1/survey2
-This option sets the mode of all ties between sections in the specified
-two surveys in the \fBMBnavadjust\fP project to be "XY". This means only the horizontal
-coordinates of these ties will be used as constraints in the inversion
-for an optimal navigation model.
-.TP
-.B \--set-ties-zonly-by-block=survey1/survey2
-This option sets the mode of all ties between sections in the specified
-two surveys in the \fBMBnavadjust\fP project to be "Z". This means only the vertical
-coordinate of these ties will be used as constraints in the inversion
-for an optimal navigation model.
-.TP
-.B \--set-ties-zoffset-by-block=survey1/survey2/zoffset
-This option resets the zoffset value of all ties between sections in the specified
-two surveys.
-.TP
-.B \--skip-unset-crossings
-This option sets all unset crossings in the input projects to be
-skipped. This does not apply to any new crossings between the two
-merged projects.
-.TP
-.B \--verbose
-This option increases the verbosity of \fBMBnavadjustmerge\fP, which
-means that more information than by default is output to the stderr stream of the
-shell.
-.TP
-.B \--help
-This option causes \fBMBnavadjustmerge\P to output a list of the
-possible command line options, and then exit.
-
-.SH EXAMPLES
-Suppose you have two AUV survey missions, 20140515m1 and 10140515m2, that overlap
-slightly. If you have used \fBMBnavadjust\fP to adjust the navigation of the
-two missions separately, you can use \fBMBnavadjustmerge\fP to merge the two
-\fBMBnavadjust\fP projects into a single new project without losing any of the
-ties made between overlapping sections in the existing projects. If the two
-existing projects are named "Navadjust20140515m1" and "Navadjust20140515m2",
-respectively, then there exist project files with a ".nvh" suffix and project
-directories with a ".dir" suffix. To create a new \fBMBnavadjust\fP project
-combining the two existing projects, the following will suffice:
-.br
-     mbnavadjustmerge --input=Navadjust20140515m1.nvh \
-                      --input=Navadjust20140515m2.nvh \
-                      --output=Navadjust20140515All.nvh
-
-The new project Navadjust20140515All can be opened and analyzed further using
-\fBMBnavadjust\fP. When opening the new project, the user should first solve
-for a comprehensive navigation adjustment model by selecting the <Action->Invert Navigation>
-menu item, and then find the crossings between the two previously separate missions
-by selecting the <Action->Check For New Crossings> menu item.
-
-If the \fB--skip-unset-crossings\fP option is added to the above command, then
-all unset crossings in the two input projects will be set to "skipped" mode in
-the output project.
-
-.SH SEE ALSO
-\fBmbsystem\fP(1), \fBmbio\fP(1), \fBmbprocess\fP(1),
-\fBmbnavadjust\fP(1), \fBmbset\fP(1)
-
-.SH BUGS
-It started out simple and bulletproof, but now it's too complicated to be bulletproof. It's probably nerfgunproof, though.
-Good luck.
diff --git a/src/man/man1/mbnavedit.1 b/src/man/man1/mbnavedit.1
deleted file mode 100644
index 863670b..0000000
--- a/src/man/man1/mbnavedit.1
+++ /dev/null
@@ -1,671 +0,0 @@
-.TH mbnavedit 1 "3 June 2013" "MB-System 5.0" "MB-System 5.0"
-.SH NAME
-\fBmbnavedit\fP \- Interactive navigation editor for swath sonar data.
-
-.SH VERSION
-Version 5.0
-
-.SH SYNOPSIS
-\fBmbnavedit\fP [\fB\-B\fIyr/mo/da/hr/mn/sc\fP
-\fB\-D\fP \fB\-E\fIyr/mo/da/hr/mn/sc\fP
-\fB\-F\fIformat \fB\-G\fP \fB\-I\fIinfile \fB\-N \-P \-T \-X \-V \-H\fP]
-
-.SH DESCRIPTION
-\fBMBnavedit\fP is an interactive editor used to identify and fix
-problems with the navigation of swath sonar data.
-
-In the default mode the edited navigation is output to
-a file with the suffix ".nve" appended to the input swath
-data filename. The program can also be operated
-in a "browse" mode where no navigation is output.
-If saved, the edited navigation can be merged
-with the swath data using the program \fBmbprocess\fP, which
-outputs a processed swath data file.
-The \fBmbprocess\fP program is also used to apply
-bathymetry edits, recalculate bathymetry, and apply
-other corrections to swath bathymetry data. Users
-may cause \fBmbprocess\fP to be run automatically by
-specifying the \fB\-X\fP option when starting \fBMBnavedit\fP.
-
-In previous  versions of \fBMB-System\fP
-(version 4.6.10 or earlier), \fBMBnavedit\fP
-produced output swath data files directly by reading and
-storing all of the swath data information in memory (including
-non-survey data records). This approach limited the
-amount of data that could be handled
-at once, frequently requiring users to process files in
-small pieces. The current version only stores
-and outputs the navigation data.
-
-Once the navigation
-from a swath data file has been
-read in, \fBMBnavedit\fP displays autoscaled plots of the longitude,
-latitude, speed, heading, and sonar depth time series, along with a plot of
-the time interval between navigation values. The user may select
-outliers and interpolate over them or, in the case of heading or
-speed data, replace the erroneous values with estimates derived
-from "course-made-good" or "speed-made-good", respectively.
-Data can only be selected and altered in a single
-plot at a time (this avoids confusion and prevents mistakes).
-
-The nature of the navigation data being edited depends upon the
-data format. Some data formats include the navigation in the
-same data records as the ping or survey data. This synchronous
-navigation implies that either in the sonar or in later processing,
-the raw navigation has been interpolated to yield values at the
-same time stamps as the sonar pings. Other data formats do not
-hold navigation values in the survey data records, and instead use
-separate navigation records with different time stamps. This
-asynchronous navigation requires that MBIO interpolate or
-extrapolate the navigation as the survey data records are read.
-For data formats with synchronous navigation, the navigation
-values edited using \fBMBnavedit\fP are those in the survey data
-records. For data formats with only asynchronous navigation,
-\fBMBnavedit\fP displays and operates on the values from the
-navigation records. The \fBMBIO\fP manual page includes a listing
-of which type of navigation is used by the supported data formats.
-
-For some data formats, the user can also
-inspect plots of roll, pitch, and heaved
-data to determine if the ship's vertical reference sensors
-were working properly.
-
-The edited data is usually output to a file, but the program
-can be operated in a "browse" mode where no data is output.
-
-.SH SMOOTHING NAVIGATION
-
-Three algorithms for obtaining and using smooth navigation models are
-available. Replacing the original navigation with a smoothed
-version can be advantageous in some cases of very noisy
-navigation (typically from sonars on towed platforms or
-submerged vehicles). The first smoothing scheme is the covolution
-of a Gaussian kernal of user-defined time width with the data.
-Users may select and flag outlier navigation points; any flagged
-points are not used to calculate the Gaussian-weighted mean
-navigation values.
-The second approach is simple dead reckoning
-from the initial position using the current (possibly edited)
-heading and speed values. The dead reckoning navigation can also
-incorporate user-specified longitude and latitude drift rates.
-The third algorithm is an inversion for a smooth
-navigation that minimizes
-speed and acceleration while fitting the original navigation
-in a least squares sense. The inversion weighting against
-speed and acceleration are user specified, and only unflagged
-navigation values are used in the inversion.
-
-.SH HANDLING BAD TIME STAMPS
-
-The time interval plot allows
-users to spot problems with time stamps and to change the
-time stamps, if necessary. The most obvious time stamp errors
-are multiple pings with the same time stamps (producing a zero
-time interval value), or
-sequential pings with decreasing time stamps (resulting in
-negative time interval values). \fBMBnavedit\fP
-provides two tools for dealing with zero or negative time intervals:
-time stamp interpolation or deletion of the affected pings. Control
-dialogs allow users to apply either to the entire buffer at once.
-Time stamp interpolation may also be accomplished by selecting
-the relevant values in the time interval display, and then
-selecting interpolation.
-
-If the navigation is
-asynchronous, that generally means the time interval should be
-constant since navigation systems are set to output values at
-a uniform rate. A problem with the time stamps of asynchronous
-navigation should produce spikes in both the time interval plot
-and the speed-made-good plot, and can be solved by selecting
-the offending point in the time interval plot and interpolating
-to reset the time stamp.
-
-If the navigation is synchronous with the sonar
-pings, then the time interval will likely vary because the ping
-rate for most sonars varies with the sonars altitude above the
-seafloor. In this case, time stamp problems will
-not produce spikes in the speed-made-good plot
-because the navigation has been interpolated
-using the existing time stamps. Time interval spikes may also
-reflect problems with the sonar (e.g. occasional failure to ping
-at the appropriate time) rather than erroneous time stamps.
-
-.SH AUTHORSHIP
-David W. Caress (caress at mbari.org)
-.br
-  Monterey Bay Aquarium Research Institute
-.br
-Dale N. Chayes (dale at ldeo.columbia.edu)
-.br
-  Lamont-Doherty Earth Observatory
-
-.SH OPTIONS
-.B \-B
-\fIyr/mo/da/hr/mn/sc\fP
-.br
-Sets the starting time for data allowed in the input data; pings
-with times before the starting time will be ignored.
-Default: \fIyr/mo/da/hr/mn/sc\fP = 1962/2/21/10/30/0.
-.TP
-.B \-D
-Starts up the program in "browse" mode. If a file is opened
-in browse mode (either at startup or later), none
-of the edited data will be output to a file. The default
-is to output the edited data to a file.
-.TP
-.B \-E
-\fIyr/mo/da/hr/mn/sc\fP
-.br
-Sets the ending time for data allowed in the input data; pings
-with times after the ending time will be ignored.
-Default: \fIyr/mo/da/hr/mn/sc\fP = 2062/2/21/10/30/0.
-.TP
-.B \-F
-\fIformat\fP
-.br
-Sets the format at startup for the input and output swath sonar data using
-\fBMBIO\fP integer format identifiers. This value can also be set
-interactively when specifying the input file.
-This program uses the \fBMBIO\fP library and will read or write any swath sonar
-format supported by \fBMBIO\fP. A list of the swath sonar data formats
-currently supported by \fBMBIO\fP and their identifier values
-is given in the \fBMBIO\fP manual page.
-Default: \fIformat\fP = 11.
-.TP
-.B \-G
-This flag causes \fBMBnavedit\fP to treat the \fBDone\fP button as
-equivalent to the \fBQuit\fP button. This option is used when
-\fBMBnavedit\fP is started automatically by some other process and
-only a single file is to edited.
-.TP
-.B \-H
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-.TP
-.B \-I
-\fIinfile\fP
-.br
-Sets the data file from which the input data will be read at startup.
-This value can also be set interactively.  If the input file is named
-using the \fBMB-System\fP convention of an ".mbXX" suffix (the XX
-corresponds to the \fBMBIO\fP format id), then the output file name
-will have an "e.mbXX" suffix. Otherwise, the output file will
-be \fIinfile\fP with ".ed" appended.
-.TP
-.B \-N
-Normally, all \fBMB-System\fP processing
-programs embed comment records describing the processing actions
-and parameters into output swath data files.
-This flag, when used in conjunction with the \fB\-X\fP flag,
-causes \fBMBnavedit\fP to invoke \fBmbprocess\fP with it's
-\fB\-N\fP option. In turn, this causes \fBmbprocess\fP to
-generate an output, processed swath data file without any
-comment records.
-.TP
-.B \-O
-\fIoutfile\fP
-.br
-Sets the output data file, overriding the file naming conventions
-discussed above in the \fB\-I\fP option.
-.TP
-.B \-P
-Causes \fBMBnavedit\fP to load and work with navigation from
-survey data records even if the data format uses asynchronous
-navigation records. In this case, the only edits which will
-actually be applied to the output data are changes to the
-time stamps of the survey records.
-.TP
-.B \-V
-Normally, \fBMBnavedit\fP outputs information to the stderr stream
-regarding the number of records loaded and dumped.  If the
-\fB\-V\fP flag is given, then \fBMBnavedit\fP works in a "verbose" mode and
-outputs the program version being used, all error status messages,
-and a large amount of other information including all of the
-beams flagged or zeroed.
-.TP
-.B \-X
-This option causes \fBmbprocess\fP to run automatically
-on an input swath data file when the \fBMBnavedit\fP editing session
-is completed. The \fB\-X\fP option effectively means that the
-corresponding processed swath data is generated or updated immediately.
-The program \fBmbprocess\fP will not be invoked if the
-editing session is in the browse mode.
-
-.SH INTERACTIVE CONTROLS
-.TP
-.B File
-This button accesses a pulldown menu with two push buttons:
-\fBOpen\fP and \fBFile Selection List\fP,
-.TP
-.B File->Open
-This button brings up a popup window which allows the user to
-specify an input swath sonar bathymetry data file, its \fBMBIO\fP
-format id, and  the output mode.
-This program uses the \fBMBIO\fP library and
-will read or write any swath sonar
-format supported by \fBMBIO\fP. A list of the swath sonar data
-formats currently supported by \fBMBIO\fP and their
-identifier values is given in the \fBMBIO\fP manual page.
-If the swath sonar data file is named using the \fBMB-System\fP
-suffix convention (format 11 files end with ".mb11", format
-41 files end with ".mb41", etc.), then the program will
-automatically use the appropriate format id; otherwise the
-format must be set by the user.
-The popup window also allows the output mode to be set to "browse"
-so that no edit events are output.
-When a valid file is specified and the \fBOK\fP button
-is clicked, file will be added to an internal list of swath files
-available for editing, and then that file will be loaded into
-memory for editing (if another file was already loaded, that file
-is closed out gracefully before the new file is loaded).
-If the specified input is a datalist (format
-id = \-1), then all of the files referenced through that datalist
-will be added to the internal list, and the first of those files
-loaded. When a file is loaded for editing, \fBMBnavedit\fP reads
-as much data as will fit into the data buffer (typically 25000 records)
-and several pings are displayed as stacked bathymetry profiles.
-.TP
-.B File->File Selection List
-This button brings up a popup window displaying the internal list of
-swath files available for editing. The list has four columns.
-The first (left-most) column is either blank or shows "<locked>" or "<loaded>".
-If a file is loaded for editing by this program, it shows as "<loaded>".
-If a file is being edited or processed by another program, it shows as
-"<locked>". Locked files cannot be opened for editing, and any file
-loaded for editing by \fBMBnavedit\fP will show as "locked" to other
-programs. The second column is either blank or shows "<nve>". This indicates if
-a file has been previously edited so that an edited navigation file already
-exists. The third and fourth columns show the filename path and the \fBMBIO\fP
-format id, respectively.
-Users can select one of the files in the available list. If the "Edit Selected File"
-button is clicked, the selected file will be opened for editing (and any
-file already loaded will be closed first). If the "Remove Selected File"
-button is selected, then the selected file will be removed from the available
-list.
-.TP
-.B Controls
-This button activates a pulldown menu with five buttons:
-\fBTime Stepping\fP, \fBNav Modeling\fP, \fBTime Interpolation\fP,
-\fBDelete Bad Times\fP, and \fBPosition Offset\fP. Each
-of these buttons brings up a dialog window containing widgets
-that set parameters or perform actions.
-.TP
-.B Controls->Time Stepping->Time Span Shown
-This slider sets the number of seconds of data shown at a time.
-This value is also set by the \fBShow Entire Buffer\fP button (sets
-time shown to all available data) and the \fBPick Time Interval\fP
-function (sets time shown to an interactively specified interval).
-.TP
-.B Controls->Time Stepping->Time Step
-This slider sets the number of seconds to step when the \fBForward\fP
-or \fBReverse\fP buttons are pushed.
-.TP
-.B Controls->Navigation Modeling->Off
-This toggle button turns navigation modeling off.
-.TP
-.B Controls->Navigation Modeling->Gaussian Mean
-This toggle button enables navigation smoothing by convolution
-with a Gaussian kernel of user defined time width.
-When this toggle button is highlighted, a smooth
-navigation model is calculated and displayed
-as a blue line in both the longitude and latitude plots.
-The \fBShow Smooth Inversion\fP toggle buttons
-also appear (already enabled)
-for both the longitude and latitude plots
-among the plot display toggles on the left side of the main
-\fBMBnavedit\fP window.
-.TP
-.B Controls->Navigation Modeling->Dead Reckoning
-This toggle button enables dead reckoning navigation calculation.
-When this toggle button is highlighted, a dead reckoning
-navigation model is calculated from the initial position
-using the current heading and speed data and displayed
-as a blue line in both the longitude and latitude plots.
-The \fBShow Dead Reckoning\fP toggle buttons also appear (already enabled)
-for both the longitude and latitude plots
-among the plot display toggles on the left side of the main
-\fBMBnavedit\fP window.
-.TP
-.B Controls->Navigation Modeling->Smooth Inversion
-This toggle button enables inversion for a smooth navigation
-model which fits the original positions in a least squares
-sense while minimizing speed and acceleration.
-When this toggle button is highlighted, a smooth
-navigation model is calculated and displayed
-as a blue line in both the longitude and latitude plots.
-The \fBShow Smooth Inversion\fP toggle buttons
-also appear (already enabled)
-for both the longitude and latitude plots
-among the plot display toggles on the left side of the main
-\fBMBnavedit\fP window.
-.TP
-.B Controls->Navigation Modeling->Gaussian Mean Time Window
-This slider sets the width in seconds of the Gaussian smoothing
-kernel. If Gaussian mean smoothing is enabled, changing this slider
-causes the smoothing to be recalculated and the results shown on
-the longitude and latitude plots.
-.TP
-.B Controls->Navigation Modeling->Dead Reckoning Longitude Drift
-This slider sets the longitude drift rate in degrees/hour
-applied to the dead reckoning navigation calculation. If
-dead reckoning is enabled, changes
-to this slider cause the dead reckoning calculation to be
-redone and the results shown on the longitude and latitude plots.
-.TP
-.B Controls->Navigation Modeling->Dead Reckoning Latitude Drift
-This slider sets the latitude drift rate in degrees/hour
-applied to the dead reckoning navigation calculation. If
-dead reckoning is enabled, changes
-to this slider cause the dead reckoning calculation to be
-redone and the results shown on the longitude and latitude plots.
-.TP
-.B Controls->Navigation Modeling->Speed Deviation
-This text entry sets the penalty weighting against speed
-applied in the inversion for a smooth navigation. Higher values
-result in a smoother model; lower values result in a model
-that more closely follows the original navigation. The
-default value is 100. This value is not actually set until
-the \fBApply\fP button to the left is clicked.
-.TP
-.B Controls->Navigation Modeling->Acceleration
-This text entry sets the penalty weighting against accleration
-applied in the inversion for a smooth navigation. Higher values
-result in a smoother model; lower values result in a model
-that more closely follows the original navigation. The
-default value is 100. This value is not actually set until
-the \fBApply\fP button to the left is clicked.
-.TP
-.B Controls->Navigation Modeling->Apply
-This button causes the values in the \fBSpeed Deviation\fP and
-\fBAcceleration\fP text entries to its right to be applied. If
-smooth inversion is enabled, then clicking this button
-will cause the inversion to be recalculated and the results
-displayed in the longitude and latitude plots.
-.TP
-.B Controls->Navigation Modeling->Dismiss
-This button causes the \fBNavigation Modeling\fP dialog
-to disappear.
-.TP
-.B Controls->Time Interpolation->Apply
-This button causes the time stamps of all data in
-the current buffer associated
-with negative or zero time intervals to be interpolated so
-that the time intervals are positive. The \fBTime Interpolation\fP
-dialog disappears after this action is taken.
-.TP
-.B Controls->Time Interpolation->Dismiss
-This button causes the \fBTime Interpolation\fP dialog
-to disappear.
-.TP
-.B Controls->Delete Bad Times->Apply
-This button causes all data in
-the current buffer associated
-with negative or zero time intervals to be deleted.
-The \fBDelete Bad Times\fP
-dialog disappears after this action is taken.
-.TP
-.B Controls->Delete Bad Times->Dismiss
-This button causes the \fBDelete Bad Times\fP dialog
-to disappear.
-.TP
-.B Controls->Position Offset->Longitude Offset
-This text widget allows the user to set the desired
-longitude offset in degrees.
-.TP
-.B Controls->Position Offset->Latitude Offset
-This text widget allows the user to set the desired
-latitude offset in degrees.
-.TP
-.B Controls->Position Offset->Apply
-This button applies the current longitude and latitude
-offsets to all of the navigation data.
-The \fBPosition Offset\fP
-dialog disappears after this action is taken.
-.TP
-.B Controls->Position Offset->Dismiss
-This button causes the \fBDelete Bad Times\fP dialog
-to disappear.
-.TP
-.B Start
-This button causes the set of displayed pings to step backward to the
-beginning of the current buffer.
-.TP
-.B Reverse
-This button causes the set of displayed pings to step \fInstep\fP
-pings backward in the current buffer.  The middle mouse button causes
-the same action.
-.TP
-.B Forward
-This button causes the set of displayed pings to step \fInstep\fP
-pings forward in the current buffer.  The right mouse button causes
-the same action.
-.TP
-.B End
-This button causes the set of displayed pings to step forward to the
-end of the current buffer.
-.TP
-.B Next Buffer
-This button causes the program to write out the data from the
-current buffer and then read in and display the next buffer.
-If there is no more data to be read in after the current buffer
-has been written out, then the input and output files are closed.
-.TP
-.B Show All
-This button causes the plots to expand to show all of the data
-in the current buffer.
-.TP
-.B Pick Zoom
-This button allows users to focus the plots on a particular
-time interval. Once the button is pushed, the left mouse button
-is used to select the left edge of the time selection. Similarly,
-the middle mouse button selects the right edge of the time selection.
-Both ends of the time selection can be adjusted multiple times.
-Once the time interval of interest is selected to the users
-satisfaction, pressing the right mouse button will cause the
-plots to be redrawn with the selected beginning and ending
-times.
-.TP
-.B Done | Next File
-When the last file in the list of files available for editing has been loaded,
-this button shows as "Done". Otherwise, it shows as "Next File". In either
-case, this button causes the program to write out all of the edited navigation
-data and then close the current file. If the current file is not the last
-one in the available list, then the next unlocked file will be loaded for editing.
-.TP
-.B Quit
-This button causes the program to exit gracefully.  If a data file
-has been loaded, all of the edits will be output before exiting.
-.TP
-.B About
-This button causes a dialog to appear showing some information
-about the program.
-.TP
-.B Interpolate
-This button causes the selected data to be
-replaced by linear interpolation
-of the surrounding unselected data. If the selection extends to the
-edge of the data, the selected data will be replaced by the first
-unselected datum on the other side.
-.TP
-.B Interpolate Repeats
-This button causes any repeated values in the selected data to be
-replaced by linear interpolation between the first of the repeated
-values and the next different value.
-.TP
-.B Revert Selection
-This button causes the selected data to revert to their
-original values.
-.TP
-.B Use Solution
-This button only appears when one of the two navigation
-modeling algorithms is activated from the Navigation Modeling
-dialog.
-This button causes any selected longitude or latitude values
-to be replaced by values from navigation modeling. Either
-dead reckoning or smooth inversion navigation modeling
-must be enabled. The longitude and latitude values are
-replaced in pairs (if a longitude value is selected, the
-corresponding latitude value will also be replaced, and
-vice versa). The typical sequence is to:
-    1) adjust the modeling until an acceptable solution
-       is achieved.
-    2) click on the \fBSelect All\fP toggle button
-    3) click in either the longitude or latitude plot
-       so that all values in that window are selected
-    4) click on the \fBUse Solution\fP button so that the
-       navigation model is adopted for all longitude
-       and latitude values
-.TP
-.B Flag
-This button only appears when either of the Gaussian mean or the smooth inversion navigation
-modeling algorithm is activated from the Navigation Modeling
-dialog.
-This button causes any selected longitude or latitude values
-to be flagged to be ignored by the navigation smoothing
-algorithm. Flagged positions are shown in orange.
-.TP
-.B Unflag
-This button only appears when the Gaussian mean or smooth inversion navigation
-modeling algorithm is activated from the Navigation Modeling
-dialog.
-This button causes any selected longitude or latitude values
-to be unflagged. Flagged positions are ignored by the navigation smoothing
-algorithm. Any positions which are unflagged will once again be
-used by the modeling method. Flagged positions are shown in orange.
-Unflagged positions are shown in either black (if they are unchanged)
-or purple (if they have been altered by interpolation or application
-of a modeling solution).
-.TP
-.B Pick
-Clicking on this toggle button sets the edit mode to "pick". In
-this case, clicking the left mouse button will cause the
-nearest data value to toggle between selected (red) and
-unselected.
-.TP
-.B Select
-Clicking on this toggle button sets the edit mode to "select". In
-this case, clicking and dragging the left mouse button will
-cause any data value touched by the cursor to become selected.
-.TP
-.B Deselect
-Clicking on this toggle button sets the edit mode to "deselect". In
-this case, clicking and dragging the left mouse button will
-cause any data value touched by the cursor to become unselected.
-.TP
-.B Select All
-Clicking on this toggle button sets the edit mode to "select all". In
-this case, clicking in any of the editable plots will cause all
-of the data in that plot to be selected.
-.TP
-.B Deselect All
-Clicking on this toggle button sets the edit mode to "select all". In
-this case, clicking in any of the editable plots will cause all
-of the data in that plot to be unselected.
-.TP
-.B Time Interval Plot
-This toggle button turns the time interval plot on and off.
-.TP
-.B Show Original Data (Time Interval Plot)
-When this toggle button is on, the time interval plot includes a
-green line representing the original time interval values.
-.TP
-.B Longitude Plot
-This toggle button turns the longitude plot on and off.
-.TP
-.B Show Original Data (Longitude Plot)
-When this toggle button is on, the longitude plot includes a
-green line representing the original longitude values.
-.TP
-.B Show Dead Reckoning (Longitude Plot)
-When this toggle button is on, the longitude plot includes a
-blue line representing the dead reckoning longitude values.
-.TP
-.B Show Smooth Inversion (Longitude Plot)
-When this toggle button is on, the longitude plot includes a
-blue line representing the smooth inversion longitude values.
-.TP
-.B Latitude Plot
-This toggle button turns the latitude plot on and off.
-.TP
-.B Show Original Data (Latitude Plot)
-When this toggle button is on, the latitude plot includes a
-green line representing the original latitude values.
-.TP
-.B Show Dead Reckoning (Latitude Plot)
-When this toggle button is on, the latitude plot includes a
-blue line representing the dead reckoning latitude values.
-.TP
-.B Show Smooth Inversion (Latitude Plot)
-When this toggle button is on, the latitude plot includes a
-blue line representing the smooth inversion latitude values.
-.TP
-.B Speed Plot
-This toggle button turns the speed plot on and off.
-.TP
-.B Show Original Data (Speed Plot)
-When this toggle button is on, the speed plot includes a
-green line representing the original speed values.
-.TP
-.B Show Speed-Made-Good (Speed Plot)
-When this toggle button is on, the speed plot includes a
-blue line representing the speed-made-good values derived
-from the longitude and latitude time series.
-.TP
-.B Use Speed-Made-Good (Speed Plot)
-When this button is pushed, any selected data in the speed
-plot will be replaced by the current estimates of speed-made-good.
-.TP
-.B Heading Plot
-This toggle button turns the heading plot on and off.
-.TP
-.B Show Original Data (Heading Plot)
-When this toggle button is on, the speed plot includes a
-green line representing the original speed values.
-.TP
-.B Show Course-Made-Good (Heading Plot)
-When this toggle button is on, the heading plot includes a
-blue line representing the course-made-good values derived
-from the longitude and latitude time series.
-.TP
-.B Use Course-Made-Good (Heading Plot)
-When this button is pushed, any selected data in the heading
-plot will be replaced by the current estimates of course-made-good.
-.TP
-.B Roll, Pitch, and Heave Plots
-This toggle button turns the roll, pitch, and heave plots on and off.
-Unlike the other plots, the data in these plots is not editable.
-These data are shown purely to allow users to determine if the
-vertical reference sensors were working properly at the time the
-data was collected (note: many swath data formats do not contain roll,
-pitch, and heave data).
-
-.SH MOUSE ACTIONS
-.TP
-.B Left Mouse Button
-The left mouse button is used to pick data values.  Unselected data
-values are shown as filled black squares and selected values
-as empty red squares.  The manner in which data are selected or
-unselected is controlled by the edit mode, as set by the
-\fBPick\fP, \fBSelect\fP, \fBDeselect\fP, \fBSelect All\fP, and
-\fBDeselect All\fP buttons.
-.TP
-.B Middle Mouse Button
-The middle mouse button causes the set of displayed data to
-step backward in the current buffer by the amount of time
-set on the \fBTime Step\fP slider.
-The control button \fBReverse\fP causes
-the same action.
-.TP
-.B Right Mouse Button
-The right mouse button causes the set of displayed data to
-step forward in the current buffer by the amount of time
-set on the \fBTime Step\fP slider.
-The control button \fBForward\fP causes
-the same action.
-
-.SH SEE ALSO
-\fBmbsystem\fP(1), \fBmbio\fP(1), \fBmbprocess\fP(1), \fBmbset\fP(1),
-\fBmbedit\fP(1), \fBmbeditviz\fP(1), \fBmbinfo\fP(1)
-
-.SH BUGS
-This program doesn't handle the roll, pitch, and heave data in a general way.
diff --git a/src/man/man1/mbnavlist.1 b/src/man/man1/mbnavlist.1
deleted file mode 100644
index 0f2b471..0000000
--- a/src/man/man1/mbnavlist.1
+++ /dev/null
@@ -1,417 +0,0 @@
-.TH mbnavlist 1 "3 June 2013" "MB-System 5.0" "MB-System 5.0"
-.SH NAME
-\fBmbnavlist\fP \- List navigation data in swath sonar data files.
-
-.SH VERSION
-Version 5.0
-
-.SH SYNOPSIS
-\fBmbnavlist\fP [\fB\-B\fP\fIyr/mo/da/hr/mn/sc\fP \fB\-D\fP\fIdecimate\fP
-\fB\-E\fP\fIyr/mo/da/hr/mn/sc\fP \fB\-F\fP\fIformat\fP
-\fB\-G\fP\fIdelimeter\fP \fB\-H\fP \fB\-I\fP\fIfile\fP \fB\-K\fP\fIkind\fP
-\fB\-L\fP\fIlonflip\fP \fB\-N\fP\fInavchannel\fP
-\fB\-O\fP\fIoutput_format\fP \fB\-R\fP\fIwest/east/south/north\fP
-\fB\-S\fP\fIspeed\fP \fB\-T\fP\fItimegap\fP \fB\-V\fP \fB\-Z\fP\fIsegment\fP]
-
-.SH DESCRIPTION
-\fBmbnavlist\fP prints the specified contents of navigation records
-in a swath sonar data file to stdout. By default, \fBmbnavlist\fP
-produces ASCII files in
-spreadsheet style, with data columns separated by tabs. Alternatively,
-other column delimiters can be used (\fB\-G\fP option), or
-the output can be binary, with each field represented
-as a double precision float (\fB\-A\fP option).  The output stream can
-be decimated using the \fB\-D\fP option. The output of
-\fBmbnavlist\fP can be piped to plotting and data analysis programs. The
-option \fB\-O\fP\fIoutput_format\fP can be
-used to control the data types that
-are sent to stdout.
-
-By default, \fBmbnavlist\fP extracts navigation from the
-data record type listed as the "navigation source" for a particular
-data format. Swath data formats may contain synchronous navigation
-(navigation is included in survey data records), asynchronous navigation
-(navigation comes in records separate from and at different times
-than the survey data records), or both (survey records contain merged
-navigation while the original asynchronous navigation is preserved in
-separate navigation records). Some data formats provide for multiple
-navigation sources, so that there are more than one channel of
-asynchronous data records. In this case one channel is always designated
-as the primary or active navigation channel. The \fB\-N\fP option allows
-the user to specify that \fBmbnavlist\fP outputs navigation from
-the primary asynchronous navigation (\fB\-N\fP\fI0\fP) or from one
-of three auxiliary navigation channels
-(\fB\-N\fP\fI1\fP, \fB\-N\fP\fI2\fP, or \fB\-N\fP\fI3\fP). If the data
-format only uses asynchronous navigation, then the default
-navigation source will already be the primary asynchronous navigation
-and \fB\-N\fP need not be used. If \fB\-N\fP is used but the data file
-does not contain asynchronous navigation or the specified auxiliary
-navigation channels, then \fBmbnavlist\fP will output nothing. To
-determine if a datafile contains asynchronous navigation and/or auxiliary
-navigation, run \fBmbinfo\fP using its \fB\-N\fP option to get counts
-of all data record types in the file.
-
-Just to make things more complicated, many data formats formats pass
-heading and attitude data in records separate from position, and often
-with different timestamps and sampling rates. If, for instance, the
-attitude data are sampled at 10 Hz but position is only sampled at
-1 Hz, extracting roll using \fBmbnavlist\fP will, by default, either
-output roll values only at the sonar ping times (if the navigation source
-is the survey data) or at the position record times (if the navigation
-source is the asynchronous position data, but not at the attitude data
-times. Moreover, the attitude data will be interpolated onto the times
-of sonar pings or position fixes. In order to extract the full attitude
-data stream, the \fB\-K\fP\fIkind\fP option may be used, where \fIkind\fP
-is the identifier for the record type to be used as the trigger for output.
-Any desired values not contained in the selected record will be interpolated
-onto the times of the selected record. In order to identify the records
-available in a particular data file, use \fBmbinfo\fP with the \fB\-N\fP
-option. This will show if a data file contains records of type MB_DATA_ATTITUDE,
-which has a record type identifier of 18, A list of the record type
-identifiers used within \fBMB-System\fP is given below, although not
-all of the record types have time stamps or can be used to define
-\fBmbnavlist\fP output. For example, requesting \fBmbnavlist\fP output
-associated with comment records will yield nonuseful results.
-
-.SH AUTHORSHIP
-David W. Caress (caress at mbari.org)
-.br
-  Monterey Bay Aquarium Research Institute
-.br
-Dale N. Chayes (dale at ldeo.columbia.edu)
-.br
-  Lamont-Doherty Earth Observatory
-.br
-
-.SH OPTIONS
-.TP
-.B \-A
-.br
-Causes the output to be binary (native double precision floating
-point) rather than ASCII. Some
-output options cannot be represented as single binary floats (e.g.
-time strings and longitude or latitude broken into degrees
-and minutes. These values are output as multiple fields as
-appropriate.
-Default: ASCII output with fields separated by tabs.
-.TP
-.B \-B
-\fIyr/mo/da/hr/mn/sc\fP
-.br
-This option sets the starting time for data allowed in the input data.
-The \fB\-E\fP option sets the ending time for data. If the
-starting time is before the ending time, then any data
-with a time stamp before the starting time or after the
-ending time is ignored. If instead the starting time is
-after the ending time, then any data between the ending
-and starting time will be ignored. This scheme allows time
-windowing both inside and outside a specified interval.
-Default: \fIyr/mo/da/hr/mn/sc\fP = 1962/2/21/10/30/0.
-.TP
-.B \-D
-\fIdecimate\fP
-.br
-Sets the decimation of the output data. By default (i.e. \fIdecimate\fP=1),
-every available data record is output. If \fIdecimate\fP>1, then only
-every "\fIdecimate\fP"th record will be output. Default: \fIdecimate\fP=1.
-.TP
-.B \-E
-\fIyr/mo/da/hr/mn/sc\fP
-.br
-This option sets the ending time for data allowed in the input data.
-The \fB\-B\fP option sets the starting time for data. If the
-starting time is before the ending time, then any data
-with a time stamp before the starting time or after the
-ending time is ignored. If instead the starting time is
-after the ending time, then any data between the ending
-and starting time will be ignored. This scheme allows time
-windowing both inside and outside a specified interval.
-Default: \fIyr/mo/da/hr/mn/sc\fP = 2062/2/21/10/30/0.
-.TP
-.B \-F
-\fIformat\fP
-.br
-Sets the format for the input swath sonar data using
-\fBMBIO\fP integer format identifiers.
-This program uses the \fBMBIO\fP library and will read any swath sonar
-format supported by \fBMBIO\fP. A list of the swath sonar data formats
-currently supported by \fBMBIO\fP and their identifier values
-is given in the \fBMBIO\fP manual page. Default: \fIformat\fP = 11.
-.TP
-.B \-G
-\fIdelimiter\fP
-.br
-Sets the character(s) used to separate output fields when ascii
-columns are output. Default: tabs are used as delimiters.
-.TP
-.B \-H
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-.TP
-.B \-I
-\fIfile\fP
-.br
-Sets the input filename. If \fIformat\fP > 0 (set with the
-\fB\-F\fP option) then the swath sonar data contained in \fIfile\fP
-is read and processed. If \fIformat\fP < 0, then \fIfile\fP
-is assumed to be an ascii file containing a list of the input swath sonar
-data files to be processed and their formats.  The program will read
-the data in each one of these files.
-In the \fIfile\fP file, each
-data file should be followed by a data format identifier, e.g.:
- 	datafile1 11
- 	datafile2 24
-.br
-This program uses the \fBMBIO\fP library and will read or write any swath sonar
-format supported by \fBMBIO\fP. A list of the swath sonar data formats
-currently supported by \fBMBIO\fP and their identifier values
-is given in the \fBMBIO\fP manual page.
-Default: \fIfile\fP = "datalist.mb-1".
-.TP
-.B \-K
-\fIkind\fP
-.br
-This option sets the type of data record used as the trigger for
-output. By default, data are output when the record type listed as
-the "navigation source" for a particular data format is encountered.
-The \fB\-K\fP option causes output to be keyed to data records of
-type \fIkind\fP, where \fIkind\fP may be integer values such as:
-     MB_DATA_DATA			1	/* general survey data */
-     MB_DATA_CALIBRATE		4	/* Hydrosweep DS */
-     MB_DATA_MEAN_VELOCITY		5	/* Hydrosweep DS */
-     MB_DATA_VELOCITY_PROFILE	6	/* general */
-     MB_DATA_NAV			12	/* Simrad, Reson 7k */
-     MB_DATA_HEADING			17	/* Simrad, Hypack */
-     MB_DATA_ATTITUDE		18	/* Simrad, Hypack, Reson 7k */
-     MB_DATA_SSV			19	/* Simrad */
-     MB_DATA_NAV1			28	/* ancillary nav system 1 */
-     MB_DATA_NAV2			29	/* ancillary nav system 2 */
-     MB_DATA_NAV3			30	/* ancillary nav system 3 */
-     MB_DATA_MOTION			32	/* Reson 7k */
-     MB_DATA_SIDESCAN2		37	/* Reson 7k, XTF */
-     MB_DATA_SIDESCAN3		38	/* Reson 7k, XTF */
-     MB_DATA_ROLL			40	/* Reson 7k */
-     MB_DATA_PITCH			41	/* Reson 7k */
-     MB_DATA_NMEA_RMC		48	/* NMEA */
-     MB_DATA_NMEA_DBT		49	/* NMEA */
-     MB_DATA_NMEA_DPT		50	/* NMEA */
-     MB_DATA_NMEA_ZDA		51	/* NMEA */
-     MB_DATA_NMEA_GLL		52	/* NMEA */
-     MB_DATA_NMEA_GGA		53	/* NMEA */
-     MB_DATA_ATTITUDE1		55	/* ancillary attitude system 1 */
-     MB_DATA_ATTITUDE2		56      /* ancillary attitude system 2 */
-     MB_DATA_ATTITUDE3		57	/* ancillary attitude system 3 */
-.br
-For example, using \fB\-K\fP\fI18\fP will cause \fBmbnavlist\fP to output
-at the times of attitude data records. One consequence will be that
-any roll, pitch, or heave values specified with the \fB\-O\fP option will
-be output without modification, whereas other values (e.g. position) will
-be interpolated onto the time of the attitude record.
-This option supercedes the \fB\-N\fP option.
-.TP
-.B \-L
-\fIlonflip\fP
-.br
-Sets the range of the longitude values returned.
-If \fIlonflip\fP=\-1 then the longitude values will be in
-the range from \-360 to 0 degrees. If \fIlonflip\fP=0
-then the longitude values will be in
-the range from \-180 to 180 degrees. If \fIlonflip\fP=1
-then the longitude values will be in
-the range from 0 to 360 degrees.
-Default: \fIlonflip\fP = 0.
-.TP
-.B \-N
-\fInavchannel\fP
-.br
-Sets \fBmbnavlist\fP to look for navigation in navigation records rather
-than the record type listed as the "navigation source" for a particular
-data format. Swath data formats may contain synchronous navigation
-(navigation is included in survey data records), asynchronous navigation
-(navigation comes in records separate from and at different times
-than the survey data records), or both (survey records contain merged
-navigation while the original asynchronous navigation is preserved in
-separate navigation records). Some data formats provide for multiple
-navigation sources, so that there are more than one channel of
-asynchronous data records. In this case one channel is always designated
-as the primary or active navigation channel. The \fB\-N\fP option allows
-the user to specify that \fBmbnavlist\fP outputs navigation from
-the primary asynchronous navigation (\fB\-N\fP\fI0\fP) or from one
-of three auxiliary navigation channels
-(\fB\-N\fP\fI1\fP, \fB\-N\fP\fI2\fP, or \fB\-N\fP\fI3\fP). If \fB\-N\fP is
-used but the data file
-does not contain asynchronous navigation or the specified auxiliary
-navigation channels, then \fBmbnavlist\fP will output nothing. To
-determine if a datafile contains asynchronous navigation and/or auxiliary
-navigation, run \fBmbinfo\fP using its \fB\-N\fP option to get counts
-of all data record types in the file. This option is superceded by the
-\fB\-K\fP option.
-.TP
-.B \-O
-\fIoutput_format\fP
-.br
-Determines the form of the output. \fIOutput_format\fP is a string composed
-of one or more of the following characters:
-
- 	\fBc\fP  for sonar depth (meters)
- 	\fBH\fP  for heading (degrees)
- 	\fBh\fP  for course made good (degrees)
-  	\fBJ\fP  for a time string (yyyy jd hh mm ss.ssssss)
-                 where jd is the julian day of the year
-  	\fBj\fP  for a time string (yyyy jd dm ss.ssssss)
-                 where jd is the julian day of the year
-                 and dm is the minute of the day
- 	\fBL\fP  for cumulative along-track distance (km)
- 	\fBl\fP  for cumulative along-track distance (m)
- 	\fBM\fP  for unix time in decimal seconds since 1/1/70 00:00:00
- 	\fBm\fP  for time in decimal seconds since first record
- 	\fBN\fP  for ping count
- 	\fBP\fP  for pitch in degrees
- 	\fBp\fP  for draft in meters
- 	\fBR\fP  for roll in degrees
- 	\fBr\fP  for heave in meters
-  	\fBS\fP  for speed (km/hr)
-  	\fBs\fP  for speed made good (km/hr)
-  	\fBT\fP  for a time string (yyyy/mm/dd/hh/mm/ss)
- 	\fBt\fP  for a time string (yyyy mm dd hh mm ss)
- 	\fBU\fP  for unix time in integer seconds since 1/1/70 00:00:00
- 	\fBu\fP  for time in integer seconds since first record
- 	\fBV\fP  for ping interval (decimal seconds)
- 	\fBX\fP  for longitude (decimal degrees)
- 	\fBx\fP  for longitude (degrees + decimal minutes + E/W)
- 	\fBY\fP  for latitude (decimal degrees)
- 	\fBy\fP  for latitude (degrees + decimal minutes + N/S)
-
-Default \fIoutput_format\fP = \fBtMXYHs\fP (time, unix time, latitude,
-longitude, heading, speed).
-.TP
-.B \-R
-\fIwest/east/south/north\fP
-.br
-Sets the longitude and latitude bounds within which swath sonar
-data will be read. Only the data which lies within these bounds will
-be read.
-Default: \fIwest\fP=\-360, east\fI=360\fP, \fIsouth\fP=\-90, \fInorth\fP=90.
-.TP
-.B \-S
-\fIspeed\fP
-.br
-Sets the minimum speed in km/hr (5.5 kts ~ 10 km/hr) allowed in
-the input data; pings associated with a smaller ship speed will not be
-copied. Default: \fIspeed\fP = 0.
-.TP
-.B \-T
-\fItimegap\fP
-.br
-Sets the maximum time gap in minutes between adjacent pings allowed before
-the data is considered to have a gap. Default: \fItimegap\fP = 1.
-.TP
-.B \-V
-Normally, \fBmbnavlist\fP works "silently" without outputting
-anything to the stderr stream.  If the
-\fB\-V\fP flag is given, then \fBmbnavlist\fP works in a "verbose" mode and
-outputs the program version being used and all error status messages.
-.TP
-.B \-Z
-\fIsegment\fP
-.br
-Causes the ascii output of different input swath files
-(e.g. when a datalist is specified with the \fB\-I\fP option)
-to be separated by lines with \fIsegment\fP. If \fIsegment\fP
-is a single character, then the output is a multiple segment
-file of the sort accepted by the \fBGMT\fP program \fBpsxy\fP.
-This option only works with ascii output, and is thus disabled
-when the \fB\-A\fP option is specified. The most common usage
-is \fB\-Z\fP\I>\fP.
-
-.SH EXAMPLES
-Suppose one wishes to obtain a navigation list from a Simrad EM300 data file
-in the MBARI format (MBIO id 57) called mbari_1998_107_msn.mb57. To
-obtain a listing with time in unix second forms followed
-by longitude and latitude, the following will suffice:
-
- 	mbnavlist \-F57 \-i mbari_1998_107_msn.mb57 \-OMXY | more
-
-The output will be as follows:
-
- 	889125106.792000        \-155.898471       19.979325
- 	889125108.148000        \-155.898586       19.979400
- 	889125109.496000        \-155.898738       19.979454
- 	889125110.852000        \-155.898876       19.979504
- 	889125112.207000        \-155.899020       19.979544
- 	889125113.571000        \-155.899204       19.979591
- 	889125114.921000        \-155.899479       19.979485
- 	.....
-.SH MB-SYSTEM DATA RECORD TYPES
-This list gives the data record types and numerical identifiers
-used within \fBMB-System\fP. Users can specify that \fBmbnavlist\fP
-output be keyed to the time stamps of particular record types by
-using the \fB\-K\fP\fIkind\fP option where \fIkind\fP corresponds
-to the desired record type identifier from this table.
-
-     MB_DATA_KINDS			54
-     MB_DATA_NONE			0
-     MB_DATA_DATA			1	general survey data
-     MB_DATA_COMMENT			2	general comment
-     MB_DATA_HEADER			3	general header
-     MB_DATA_CALIBRATE		4	Hydrosweep DS
-     MB_DATA_MEAN_VELOCITY		5	Hydrosweep DS
-     MB_DATA_VELOCITY_PROFILE	6	general
-     MB_DATA_STANDBY			7	Hydrosweep DS
-     MB_DATA_NAV_SOURCE		8	Hydrosweep DS
-     MB_DATA_PARAMETER		9	general
-     MB_DATA_START			10	Simrad
-     MB_DATA_STOP			11	Simrad
-     MB_DATA_NAV			12	Simrad, Reson 7k
-     MB_DATA_RUN_PARAMETER		13	Simrad
-     MB_DATA_CLOCK			14	Simrad
-     MB_DATA_TIDE			15	Simrad, Reson 7k
-     MB_DATA_HEIGHT			16	Simrad
-     MB_DATA_HEADING			17	Simrad, Hypack
-     MB_DATA_ATTITUDE		18	Simrad, Hypack, Reson 7k
-     MB_DATA_SSV			19	Simrad
-     MB_DATA_ANGLE			20	HSMD
-     MB_DATA_EVENT			21	HSMD
-     MB_DATA_HISTORY			22	GSF
-     MB_DATA_SUMMARY			23	GSF
-     MB_DATA_PROCESSING_PARAMETERS	24	GSF
-     MB_DATA_SENSOR_PARAMETERS	25	GSF
-     MB_DATA_NAVIGATION_ERROR	26	GSF
-     MB_DATA_RAW_LINE		27	uninterpretable line for ascii formats
-     MB_DATA_NAV1			28	ancillary nav system 1
-     MB_DATA_NAV2			29	ancillary nav system 2
-     MB_DATA_NAV3			30	ancillary nav system 3
-     MB_DATA_TILT			31	Simrad
-     MB_DATA_MOTION			32	Reson 7k
-     MB_DATA_CTD			33	Reson 7k
-     MB_DATA_SUBBOTTOM_MCS		34	Reson 7k
-     MB_DATA_SUBBOTTOM_CNTRBEAM	35	Simrad
-     MB_DATA_SUBBOTTOM_SUBBOTTOM	36	Reson 7k, XTF
-     MB_DATA_SIDESCAN2		37	Reson 7k, XTF
-     MB_DATA_SIDESCAN3		38	Reson 7k, XTF
-     MB_DATA_IMAGE			39	Reson 7k
-     MB_DATA_ROLL			40	Reson 7k
-     MB_DATA_PITCH			41	Reson 7k
-     MB_DATA_ABSORPTIONLOSS		42	Reson 7k
-     MB_DATA_SPREADINGLOSS		43	Reson 7k
-     MB_DATA_INSTALLATION		44	Reson 7k
-     MB_DATA_WATER_COLUMN		45	Simrad
-     MB_DATA_STATUS			46	Simrad, XTF
-     MB_DATA_DVL			47	JSTAR
-     MB_DATA_NMEA_RMC		48	NMEA
-     MB_DATA_NMEA_DBT		49	NMEA
-     MB_DATA_NMEA_DPT		50	NMEA
-     MB_DATA_NMEA_ZDA		51	NMEA
-     MB_DATA_NMEA_GLL		52	NMEA
-     MB_DATA_NMEA_GGA		53	NMEA
-     MB_DATA_SURVEY_LINE		54	Reson 7k
-     MB_DATA_ATTITUDE1		55	ancillary attitude system 1
-     MB_DATA_ATTITUDE2		56      ancillary attitude system 2
-     MB_DATA_ATTITUDE3		57	ancillary attitude system 3
-
-.SH SEE ALSO
-\fBmbsystem\fP(1), \fBmbinfo\fP(1)
-
-.SH BUGS
-\fBmbnavlist\fP is not able to list all of the navigation information
-available in some swath data formats.
diff --git a/src/man/man1/mbneptune2esf.1 b/src/man/man1/mbneptune2esf.1
deleted file mode 100644
index 75d6415..0000000
--- a/src/man/man1/mbneptune2esf.1
+++ /dev/null
@@ -1,196 +0,0 @@
-.TH mbneptune2esf 1 "3 June 2013" "MB-System 5.0" "MB-System 5.0"
-.SH NAME
-\fBmbneptune2esf\fP \- Tool to import beam flags from Simrad's Neptune system.
-
-.SH VERSION
-Version 5.0
-
-.SH SYNOPSIS
-\fBmbneptune2esf\fP [\fB\-F\fIformat\fP
-\fB\-I\fIinfile\fP \fB\-O\fIoutfile\fP
-\fB\-M\fImode\fP \fB\-R\fIrules_file\fP \fB\-V \-H\fP]
-
-.SH DESCRIPTION
-\fBmbneptune2esf\fP imports manual data flagging performed using Simrad's NEPTUNE
-software and flags those beams in the corresponding MB-System files.
-
-The \fBbinstat\fP tool in Simrad's NEPTUNE software has a number of advantages over mbedit
-as a tool for flagging bad data, including access to a variety of statistics from gridding
-the data. MB-System is generally more flexible and powerful in a number of other areas.
-\fBmbneptune2esf\fP tries to give you the best of both worlds.
-
-\fBmbneptune2esf\fP reads a binstat_?.rules file generated by manually cleaning
-data using the correlation plot in the binstat tool of the neptune sofware
-written by Kongsberg Simrad and writes these edits in a mbsystem esf file.
-The purpose of this tool is to allow data cleaning done using neptune to
-be carried into the mbsystem environment \- thus making neptune a more useful
-tool.
-
-\fBmbneptune2esf\fP applies all the manual edits in the rules file given to those
-of the input files it recognises as matching the original lines.
-A line is considered to match if the line name contained in the rules file
-(e.g. 0002_20000408_221415) is part of the file name of the data file
-(e.g. 0002_20000408_221415.mb57).
-
-Swath line files should be converted to format 57 using mbcopy before
-using this program, as format 56 does not have the ability to flag data
-(although data can be zeroed \- but zero may be a valid depth).
-
-Data flagged by rules generated in binstat is not flagged by this program \-
-only manually flagged data is flagged.
-
-\fBmbneptune2esf\fP can also be used to transfer processing done in neptune to other surveys.
-Neptune breaks a survey up into a number of blocks and records all the
-processing done in these blocks. Changing a block results in a loss of
-all the existing processing information. When adding data to an existing
-survey that falls outside any existing block, all of the existing blocks
-must be removed, and therefore all of the processing is lost.
-\fBmbneptune2esf\fP and \fBmbprocess\fP
-can be used to zero all the beams flagged during neptune processing and
-the processed files can then be used as the basis for a new survey, preserving
-the manual flagging (but losing the flagged data).
-The zero data can then be easily flagged in neptune.
-
- 	cd $RAWDATAHOME
- 	ls *raw.all | while (read file) ; do
- 			echo $file 56 1 >> datalist.mb-1
- 		done
- 	cat $PROCHOME/old_survey/binstat_*.rules | mbneptune2esf \-m3
- 	mbprocess
- 	cat *p.mb56 | handleEmX new_survey op
-
-This program flags beams by outputting the flags as
-edit events to an "edit save file", like that produced
-by \fBmbedit\fP. If an "edit save file" (named by adding
-a ".esf" suffix to the input swath filename) already
-exists, the edits are read in and applied before the
-\fBmbneptune2esf\fP flagging algorithms are used.
-Once generated, the edit events can be applied
-to the data using the program \fBmbprocess\fP, which
-outputs a processed swath data file.
-The \fBmbprocess\fP program is also used to merge
-edited navigation, recalculate bathymetry, and apply
-other corrections to swath bathymetry data.
-
-.SH AUTHORSHIP
-Gordon Keith (gordon.keith at csiro.au)
-.br
-  CSIRO Australia
-.br
-David W. Caress (caress at mbari.org)
-.br
-  Monterey Bay Aquarium Research Institute
-.br
-Dale N. Chayes (dale at ldeo.columbia.edu)
-.br
-  Lamont-Doherty Earth Observatory
-
-.SH OPTIONS
-.TP
-.B \-F
-\fIformat\fP
-.br
-Sets the data format used if the input is read from stdin
-or from a file. If \fIformat\fP < 0, then the input file specified
-with the \fB\-I\fP option will actually contain a list of input swath sonar
-data files. This program uses the \fBMBIO\fP library
-and will read or write any swath sonar
-format supported by \fBMBIO\fP. A list of the swath sonar data formats
-currently supported by \fBMBIO\fP and their identifier values
-is given in the \fBMBIO\fP manual page. Default: \fIformat\fP = 11.
-Only formats 56 and 57 files are affected by this program. Other files are
-ignored.
-.TP
-.B \-H
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-.TP
-.B \-I
-\fIinfile\fP
-.br
-Sets the input filename. If \fIformat\fP > 0 (set with the
-\fB\-F\fP option) then the swath sonar data contained in \fIinfile\fP
-is read and processed. If \fIformat\fP < 0, then \fIinfile\fP
-is assumed to be an ascii file containing a list of the input swath sonar
-data files to be processed and their formats.  The program will read
-and process the data in each one of these files. Each input file will
-have an associated output file with the ".esf" suffix.
-In the \fIinfile\fP file, each
-data file should be followed by a data format identifier, e.g.:
- 	datafile1 11
- 	datafile2 24
-.br
-This program uses the \fBMBIO\fP library and will read or write any swath sonar
-format supported by \fBMBIO\fP. A list of the swath sonar data formats
-currently supported by \fBMBIO\fP and their identifier values
-is given in the \fBMBIO\fP manual page.
-Only formats 56 and 57 files are affected by this program. Other files are ignored.
-Default: \fIinfile\fP = "datalist.mb-1".
-.TP
-.B \-M
-\fImode\fP
-.br
-Sets the manner in which flagged by neptune are handled.
- 	\fImode\fP = 1:	Flags the flagged beam.
- 	\fImode\fP = 3:	Zeros the flagged beam.
-Default: \fImode\fP = 1.
-.TP
-.B \-O
-\fIoutfile\fP
-.br
-Specifies a file to write a copy of the beam information extracted from the
-rules file. Mostly for debugging purposes.
-.TP
-.B \-R
-\fIrules_file\fP
-.br
-The binstat rules file containing the manual flagging rules to be
-applied. Rules files are normally $PROCHOME/\fIsurvey\fP/binstat_\fIblock\fP.rules.
-The LINES_PING_BEAM_RULE rules from this file will be applied to the
-matching line(s) in the input file.
-Default: \fIrules_file\fP = stdin.
-.TP
-.B \-V
-Normally, \fBmbneptune2esf\fP works "silently" without outputting
-anything to the stderr stream.  If the
-\fB\-V\fP flag is given, then \fBmbneptune2esf\fP works in a "verbose" mode and
-outputs the program version being used, all error status messages,
-and the number of beams flagged as bad.
-
-.SH EXAMPLES
-
-The normal use of \fBmbneptune2esf\fP would be to apply all the manual edits
-in a Neptune survey to the coresponding MB-System survey represented by a
-datalist:
-
-	cat $PROCHOME/Broken_Reef/binstat_*.rules | \\
- 		mbneptune2esf \-I/data/mbproc/Broken_Reef/datalist.mb-1
-
-Since the default input file is the datalist in the current directory,
-the following is equivalent if the Neptune environment variable PROCHOME
-evaluates to /data/proc:
-
- 	cd /data/mbproc/Broken_Reef
- 	cat /data/proc/Broken_Reef/binstat_*.rules | mbneptune2esf
-
-To apply the manual edits from a particular block of a Neptune survey
-to only one of the related data files:
-
- 	mbneptune2esf \-R $PROCHOME/Broken_Reef/binstat_1.rules \\
- 		-F57 \-I0032_20000408_221201.mb57
-
-To use the manual edits from a particular block of a Neptune survey
-to zero the beams of one of the related data files:
-
- 	mbneptune2esf \-R $PROCHOME/Broken_Reef/binstat_2.rules
- 		-M3  \-F56 \-I0002_20000408_153940_raw.all
-
-.SH SEE ALSO
-\fBmbsystem\fP(1), \fBmbclean\fP(1), \fBmbedit\fP(1),
-\fBmbprocess\fP(1)
-
-.SH BUGS
-\fBmbneptune2esf\fP does not flag beams flagged by rules in binstat,
-only beams that are flagged manually using the correlation plot.
-
-Probably plenty of others.
diff --git a/src/man/man1/mbotps.1 b/src/man/man1/mbotps.1
deleted file mode 100644
index 838da7e..0000000
--- a/src/man/man1/mbotps.1
+++ /dev/null
@@ -1,350 +0,0 @@
-.TH mbotps 1 "20 November 2014" "MB-System 5.0" "MB-System 5.0"
-.SH NAME
-\fBmbotps\fP \- Predicts tides using the OSU Tidal Prediction Software (OTPS) distribution.
-
-.SH VERSION
-Version 5.0
-
-.SH SYNOPSIS
-\fBmbotps\fP [\fB\-A\fP\fItideformat\fP \fB\-B\fP\fIyear/month/day/hour/minute/second\fP
-\fB\-D\fP\fIinterval\fP \fB\-E\fP\fIyear/month/day/hour/minute/second
-\fB\-F\fP\fIformat\fP \fB\-I\fP\fIdatalist.mb-1\fP
-\fB\-M\fP \fB\-O\fP\fIoutput\fP \fB\-P\fP\fIotps_location\fP
-\fB\-R\fP\fIlon/lat\fP \fB\-T\fP\fImodel\fP \fB\-V\fP]
-
-.SH DESCRIPTION
-\fBMBotps\fP is a utility that predicts tides using the OTPS (OSU Tidal Prediction
-Software) package that can be downloaded at:
-    http://www.coas.oregonstate.edu/research/po/research/tide/
-The OTPS utilities are operated in a batch mode using command files with
-a fairly arcane format. \fBMBotps\fP provides a command line interface that
-allows \fBMB-System\fP users to easily obtain tide models for specified locations
-and times. \fBMBotps\fP is built during a normal installation of \fBMB-System\fP,
-but will work only if the OTPS package has been installed separately and
-the OTPS location has been specified. See the INSTALL file in the \fBMB-System\fP
-top directory for guidance on the build process. 
-
-There are actually three variants of the OTPS package available for download and
-installation: OTPS, OTPSnc, and OTPS2. The three versions use different tide
-model formats, but otherwise are used in the same way. OTPS uses tide models
-stored in a native binary format, OTPSnc  uses tide models in a netCDF format,
-and OTPS2 uses hybrid tide models combining a low resolution global model with
-higher resolution representation of many coastal regions.
-
-The local OTPSnc installation can include more than one tidal model; several global
-and local models are available from the Oregon State tide group. By default,
-\fBmbotps\fP attempts to use a global tide model named tpxo7.2. Users can use
-the \fB-T\fP\fImodel\fP option to specify the desired model. If no model is
-specified, and tpxo7.2 is not available, then \fBmbotps\fP will use the first
-valid model found. It is the user's responsibility to ensure that the positions
-of requested tide values lie within the specified tide model's domain.
-
-The OTPSnc models generally take the form of four files, all of which should be
-placed in a directory named "DATA" in the OTPSnc installation. For a model named
-ES2008, the files are:
-    Model_ES2008
-    gridES2008.nc
-    hf.ES2008.nc
-    uv.ES2008.nc
-.br
-Here the first file is a text file that references the other three; for
-\fBmbotps\fP the model name consists of the text that follows "Model_" in the
-first file's name. Most of the models one can obtain from the OSU tide group
-are intended to be used by running the OTPSnc program \fBpredict_tide\fP from the
-OTPSnc installation directory, and thus reference the data files using relative
-paths. For example, the original contents of Model_ES2008 are:
-    DATA/gridES2008.nc
-    DATA/hf.ES2008.nc
-    DATA/uv.ES2008.nc
-.br
-In order for the OTPSnc to work when called by \fBmbotps\fP, the model data file
-paths must be global rather than relative. If the OTPSnc package has been
-installed in /usr/local/OTPSnc, then the model file Model_ES2008 should be
-edited to have the following contents:
-    /usr/local/OTPSnc/DATA/gridES2008.nc
-    /usr/local/OTPSnc/DATA/DATA/hf.ES2008.nc
-    /usr/local/OTPSnc/DATA/DATA/uv.ES2008.nc
-.br
-
-\fBMBotps\fP can be operated in two modes. First, users may use the \fB\-R\fP,
-\fB\-B\fP, and \fB\-E\fP options to specify a location and the beginning and end times of
-a tidal model for that location. The \fB\-D\fP option sets the time interval of values in
-the output tidal model, and the \fB\-O\fP option sets the output tidal model filename.
-
-Alternatively, instead of specifying a place and time range, the user may specify
-one or more swath data files using the \fB\-I\fP option. A tidal model is produced for
-each swath file in which tidal values are calculated using the sonar navigation
-locations at intervals specified with the \fB\-D\fP option, and if the \fB\-M\fP option
-is specified, the swath file's processing parameter file is modified so that \fBmbprocess\fP
-applies the tidal model during processing.
-
-.SH AUTHORSHIP
-David W. Caress (caress at mbari.org)
-.br
-  Monterey Bay Aquarium Research Institute
-.br
-Dale N. Chayes (dale at ldeo.columbia.edu)
-.br
-  Lamont-Doherty Earth Observatory
-
-.SH OPTIONS
-.TP
-.B \-A
-\fItideformat\fP
-.br
-This option sets the tide format of the output text tide model files.
-If \fItideformat\fP = 2 (the default), the tide is output in this format:
-.br
- 	year month day hour minute second tide
-.br
-where the tide value is in meters.
-If \fItideformat\fP = 1, then the output format is:
-.br
- 	time_d tide
-.br
-where time_d is in seconds since January 1, 1970 and tide is in meters.
-.TP
-.B \-B
-\fIyr/mo/da/hr/mn/sc\fP
-.br
-This option sets the starting time for for the output tidal model.
-.TP
-.B \-D
-\fIinterval\fP
-.br
-This option sets the time interval between tidal model values in seconds.
-Default: 60 seconds.
-.TP
-.B \-E
-\fIyr/mo/da/hr/mn/sc\fP
-.br
-This option sets the ending time for the output tidal model
-.TP
-.B \-F
-\fIformat\fP
-.br
-Sets the data format of the input swath data file specified with the
-\fB\-I\fP option. If \fIformat\fP < 0, then the input file specified
-with the \fB\-I\fP option will actually contain a list of input swath sonar
-data files. This program uses the \fBMBIO\fP library and will read any
-swath sonar format with timestamps supported by \fBMBIO\fP.
-A list of the swath sonar data formats
-currently supported by \fBMBIO\fP and their identifier values
-is given in the \fBMBIO\fP manual page. The default format is
-set using \fBmbdefaults\fP.
-.TP
-.B \-H
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-.TP
-.B \-I
-\fIfilename\fP
-.br
-Sets the input filename. If \fIformat\fP > 0 (set with the
-\fB\-f\fP option) then the swath sonar data contained in \fIinfile\fP
-is read and processed. If \fIformat\fP < 0, then \fIinfile\fP
-is assumed to be an ascii file containing a list of the input swath sonar
-data files to be processed and their formats.  The program will read
-the data in each one of these files.
-In the \fIinfile\fP file, each
-data file should be followed by a data format identifier, e.g.:
- 	datafile1 11
- 	datafile2 24
-.br
-This program uses the \fBMBIO\fP library and will read or write any swath sonar
-format supported by \fBMBIO\fP. A list of the swath sonar data formats
-currently supported by \fBMBIO\fP and their identifier values
-is given in the \fBMBIO\fP manual page. Default: \fIinfile\fP = "stdin".
-.TP
-.B \-M
-If the \fB\-I\fP option has been used so that tidal models are created for swath files,
-then this option causes each swath file's parameter file to be modified so that
-\fBmbprocess\fP will read and apply the ancilliary tidal model file created by
-\fBmbotps\fP.
-.TP
-.B \-O
-\fIfilename\fP
-.br
-Sets the filename of the tidal model output.
-.TP
-.B \-P
-\fIotps_location\fP
-.br
-Sets the path to the local installation of OTPS, which in turn defines the
-location of the program \fBpredict_tide\fP called by \fBmbotps\fP and
-the tide model to be used by \fBpredict_tide\fP.
-.TP
-.B \-R
-\fIlongitude/latitude\fP
-.br
-Sets the longitude and latitude position at which the tidal model will be
-calculated.
-.TP
-.B \-T
-\fImodel\fP
-.br
-Sets the name of the OTPSnc tidal model to be used. This model must be part of
-the local OTPSnc installation. Examples include "tpxo7.2" and "altas".
-Default: "tpxo7.2"
-.TP
-.B \-V
-Increases the verbosity of \fBmbotps\fP.
-
-.SH EXAMPLES
-Suppose one wishes to obtain a tidal model for the location 121W 36N extending
-at 60 second intervals over the day February 21, 2009. The following will suffice:
- 	mbotps \-R-125/36 \-B2009/02/21/00/00/00 \-E2009/02/21/23/59/59 \-V
-.br
-.br
-The shell output looks like:
-
- 	Program mbotps
- 	Version $Id: mbotps.1 2215 2014-11-29 22:21:19Z caress $
- 	MB-system Version 5.4.2137
-
- 	Checking for available OTPS tide models
- 	OTPS location: /usr/local/OTPSnc
- 	Valid OTPS tidal models:
- 	     tpxo7.2
- 	Number of available OTPS tide models: 1
-
- 	Using OTPS tide model:            tpxo7.2
-
-  	Lat/Lon/Time file:tmp_mbotps_llt_10311.txt
-  	Predict OCEAN tide
- 	Interpolate minor constituents
-
- 	Model:        OTPSnc/DATA/Model_tpxo7.2
- 	Model is on grid uniform in lat,lon
- 	Lat limits:     -90.1250000       90.1250000
- 	Lon limits:     0.125000000       360.125000
- 	Constituents: m2  s2  n2  k2  k1  o1  p1  q1  mf  mm  m4  ms4 mn4
- 	Predict elevations (m)
- 	Constituents to include: m2  s2  n2  k2  k1  o1  p1  q1  mf  mm  m4  ms4 mn4
- 	Reading model... done
- 	Results are in tmp_mbotps_llttd_10311.txt
-
- 	Results are really in tide_model.txt
-.br
-The output tidal model is in the file tide_model.txt, which includes
-data that look like:
- 	# Tide model generated by program mbotps
- 	# Version: $Id: mbotps.1 2215 2014-11-29 22:21:19Z caress $
- 	# MB-System Version: 5.4.2137
- 	# Tide model generated by program mbotps
- 	# which in turn calls OTPS program predict_tide obtained from:
- 	#     http://www.coas.oregonstate.edu/research/po/research/tide/
- 	#
- 	# OTPSnc tide model:
- 	#      tpxo7.2
- 	# Output format:
- 	#      year month day hour minute second tide
- 	# where tide is in meters
- 	# Run by user <caress> on cpu <deitz> at <Thu Aug 15 17:53:22 2013>
- 	# Model:        OTPSnc/DATA/Model_tpxo7.2
- 	# Constituents included: m2  s2  n2  k2  k1  o1  p1  q1  mf  mm  m4  ms4 mn4
- 	2009 02 21 00 00 00   -0.6840
- 	2009 02 21 00 01 00   -0.6820
- 	2009 02 21 00 02 00   -0.6790
- 	2009 02 21 00 03 00   -0.6770
- 	2009 02 21 00 04 00   -0.6740
- 	2009 02 21 00 05 00   -0.6720
- 	2009 02 21 00 06 00   -0.6690
- 	2009 02 21 00 07 00   -0.6660
- 	2009 02 21 00 08 00   -0.6640
- 	2009 02 21 00 09 00   -0.6610
- 	2009 02 21 00 10 00   -0.6580
- 	2009 02 21 00 11 00   -0.6560
- 	2009 02 21 00 12 00   -0.6530
- 	2009 02 21 00 13 00   -0.6500
- 	.................
- 	2009 02 21 23 54 00   -0.7980
- 	2009 02 21 23 55 00   -0.7970
- 	2009 02 21 23 56 00   -0.7950
- 	2009 02 21 23 57 00   -0.7940
- 	2009 02 21 23 58 00   -0.7920
- 	2009 02 21 23 59 00   -0.7900
-.br
-.br
-Now, suppose that one wants to apply tide corrections directly to a set of EM3002
-data in GSF format. First, execute \fBmbotps\fP with the datalist for the swath
-data specified as input:
- 	mbotps \-Idatalist.mb-1 \-V
-.br
-The resulting shell output looks like:
-.br
- 	Program mbotps
- 	Version $Id: mbotps.1 2215 2014-11-29 22:21:19Z caress $
- 	MB-system Version 5.4.2137
-
- 	Checking for available OTPS tide models
- 	OTPS location: /usr/local/OTPSnc
- 	Valid OTPS tidal models:
- 	     tpxo7.2
- 	Number of available OTPS tide models: 1
-
- 	Using OTPS tide model:            tpxo7.2
-
- 	---------------------------------------
-
- 	Processing tides for himbb05291.d23.mb121
-
- 	35602 records read from himbb05291.d23.mb121.fnv
-
- 	 Lat/Lon/Time file:tmp_mbotps_llt_7413.txt
- 	 Constituents to include: m2  s2  n2  k2  k1  o1  p1  q1
- 	 Predict OCEAN tide
- 	 Interpolate minor constituents
-
- 	 Model:        ss/sandbox/tides/OTPSnc/DATA/Model_tpxo7.2
- 	 Model is on grid uniform in lat,lon
- 	 Lat limits:    \-90.125 90.125
- 	 Lon limits:    0.125 360.125
- 	 Constituents: m2  s2  n2  k2  k1  o1  p1  q1  mf  mm  m4  ms4 mn4
- 	 Predict elevations (m)
- 	 Constituents to include: m2  s2  n2  k2  k1  o1  p1  q1
- 	 Reading model... done
- 	 Results are in tmp_mbotps_llttd_7413.txt
-
- 	Results are really in himbb05291.d23.mb121.tde
-.br
-.br
-The output tide files have the same structure shown above:
- 	# Tide model generated by program mbotps
- 	# Version: $Id: mbotps.1 2215 2014-11-29 22:21:19Z caress $
- 	# MB-System Version: 5.4.2137
- 	# Tide model generated by program mbotps
- 	# which in turn calls OTPS program predict_tide obtained from:
- 	#     http://www.coas.oregonstate.edu/research/po/research/tide/
- 	#
- 	# OTPSnc tide model:
- 	#      tpxo7.2
- 	# Output format:
- 	#      year month day hour minute second tide
- 	# where tide is in meters
- 	# Run by user <caress> on cpu <deitz> at <Thu Aug 15 17:53:22 2013>
- 	# Model:        OTPSnc/DATA/Model_tpxo7.2
- 	# Constituents included: m2  s2  n2  k2  k1  o1  p1  q1  mf  mm  m4  ms4 mn4
- 	2005 10 18 19 01 36    0.0800
- 	2005 10 18 19 02 36    0.0790
- 	2005 10 18 19 03 36    0.0770
- 	2005 10 18 19 04 36    0.0760
- 	2005 10 18 19 05 37    0.0750
- 	2005 10 18 19 06 37    0.0730
- 	2005 10 18 19 07 37    0.0720
- 	2005 10 18 19 08 37    0.0710
- 	2005 10 18 19 09 37    0.0700
-.br
-In addition to generating *.tde files for each swath file referenced by the
-input datalist structure, \fBmbotps\fP modifies the parameter file associated
-with each swath file (creating it if necessary) so that tide correction is enabled
-using the *.tde file and tide format 2. When \fBmbprocess\fP is run on the same
-datalist, the files will be reprocessed, and the processing will include the
-application of the tide correction to all bathymetry.
-
-.SH SEE ALSO
-\fBmbsystem\fP(1), \fBmbprocess\fP, \fBmbset\fP
-
-.SH BUGS
-Installing the Fortran90 OTPSnc package from Oregon State is not particularly
-easy.
diff --git a/src/man/man1/mbpreprocess.1 b/src/man/man1/mbpreprocess.1
deleted file mode 100644
index 3095eb1..0000000
--- a/src/man/man1/mbpreprocess.1
+++ /dev/null
@@ -1,68 +0,0 @@
-.TH mbpreprocess 1 "14 March 2014" "MB-System 5.0" "MB-System 5.0"
-.SH NAME
-\fBmbpreprocess\fP \- performs preprocessing of swath sonar data as part of setting
-up an MB-System processing structure for a dataset.
-
-.SH VERSION
-Version 5.0
-
-.SH SYNOPSIS
-\fBmbpreprocess\fP [ 
-\fB--verbose\fP
-\fB--help\fP
-\fB--input\fP=\fIFILE\fP
-\fB--format\fP=\fIFORMAT\fP
-\fB--nav_file\fP=\fIFILE\fP
-\fB--nav_file_format\fP=\fIFORMAT\fP
-\fB--nav_async\fP=\fIRECORDTYPE\fP
-\fB--sensordepth_file\fP=\fIFILE\fP
-\fB--sensordepth_file_format\fP=\fIFILE\fP
-\fB--sensordepth_async\fP=\fIRECORDTYPE\fP
-\fB--heading_file\fP=\fIFILE\fP
-\fB--heading_file_format\fP=\fIFORMAT\fP
-\fB--heading_async\fP=\fIRECORDTYPE\fP
-\fB--attitude_file\fP=\fIFILE\fP
-\fB--attitude_file_format\fP=\fIFORMAT\fP
-\fB--attitude_async\fP=\fIRECORDTYPE\fP
-\fB--timeshift_file\fP=\fIFILE\fP
-\fB--timeshift_constant\fP=\fITIME\fP
-\fB--timeshift_apply_nav\fP
-\fB--timeshift_apply_sensordepth\fP
-\fB--timeshift_apply_heading\fP
-\fB--timeshift_apply_attitude\fP
-\fB--timeshift_apply_all_ancilliary\fP
-\fB--timeshift_apply_survey\fP
-\fB--timeshift_apply_all\fP
-]
-
-.SH DESCRIPTION
-MBpreprocess handles preprocessing of swath sonar data as part of setting
-up an MB-System processing structure for a dataset. This program replaces
-the several format-specific preprocessing programs
-found in MB-System version 5 releases with a single program for version 6.
-This program is under development, and is not ready for general use at
-this time.
-
-.SH AUTHORSHIP
-David W. Caress (caress at mbari.org)
-.br
-  Monterey Bay Aquarium Research Institute
-.br
-Dale N. Chayes (dale at ldeo.columbia.edu)
-.br
-  Lamont-Doherty Earth Observatory
-
-.SH OPTIONS
-.TP
-.B --verbose
-By default \fBmbpreprocess\fP outputs minimal information to the shell. This option
-causes the program to indicate it's progress as it runs. Goody.
-
-.SH EXAMPLES
-To be written.....
-
-.SH SEE ALSO
-\fBmbsystem\fP(1), \fBmbdatalist\fP(1), \fBmbprocess\fP(1)
-
-.SH BUGS
-Oh yeah.
diff --git a/src/man/man1/mbprocess.1 b/src/man/man1/mbprocess.1
deleted file mode 100644
index c1783da..0000000
--- a/src/man/man1/mbprocess.1
+++ /dev/null
@@ -1,1413 +0,0 @@
-.TH mbprocess 1 "10 November 2014" "MB\-System 5.0" "MB\-System 5.0"
-.SH NAME
-\fBmbprocess\fP \- this program performs a
-variety of swath data processing
-functions in a single step (producing
-a single output swath data file),
-including merging navigation, recalculating
-bathymetry from travel time
-and angle data by raytracing through a
-layered water sound velocity model,
-applying changes to ship draft, roll bias and pitch bias,
-applying tides,
-and applying bathymetry edits from edit save files.
-
-.SH VERSION
-Version 5.0
-
-.SH SYNOPSIS
-\fBmbprocess\fP \fB\-I\fP\fIinfile\fP [\fB\-F\fP\fIformat\fP
-\fB\-N\fP \fB\-O\fP\fIoutfile\fP \fB\-P \-S \-T \-V \-H\fP]
-
-.SH DESCRIPTION
-The program \fBmbprocess\fP is a tool for
-processing swath sonar bathymetry data.
-This program
-can perform a variety of swath data processing functions in
-a single step (producing a single output swath data file),
-including:
-     \- Merge edited navigation generated by \fBmbnavedit\fP.
-     \- Apply bathymetry edit flags from \fBmbedit\fP
-       and \fBmbclean\fP
-     \- Recalculate bathymetry from raw travel time and
-       angle data by raytracing through water sound speed
-       models from \fBmbvelocitytool\fP or \fBmbsvplist\fP.
-     \- Apply changes to roll bias, pitch bias, heading
-       bias, and draft values.
-     \- Recalculate sidescan from raw backscatter samples
-       (Simrad multibeam data only).
-     \- Apply corrections to sidescan based on amplitude vs
-       grazing angle tables obtained with \fBmbbackangle\fP.
-     \- Apply tides to bathymetry.
-     \- Insert metadata.
-
-The actions of \fBmbprocess\fP are controlled by text
-parameter files. Each \fBmbprocess\fP parameter file
-contains single line commands that set
-processing modes and parameters. The program \fBmbset\fP
-can be used to create and modify \fBmbprocess\fP parameter files.
-Other programs such as \fBmbedit\fP, \fBmbnavedit\fP,
-\fBmbvelocitytool\fP, \fBmbnavadjust\fP, and \fBmbclean\fP
-modify or create (if needed) \fBmbprocess\fP parameter files.
-
-The input file "infile"  must be specified with the \fB\-I\fP option.
-If "infile" is a datalist, then \fBmbprocess\fP will
-attempt to process each swath data file identified by recursively
-reading the datalist. Otherwise, \fBmbprocess\fP will attempt
-to process "infile" directly.
-
-For any swath data file "datafile", the program
-will look for and use a parameter file with the
-name "datafile.par". If no parameter file exists, \fBmbprocess\fP
-will infer a reasonable processing path by looking for navigation
-and mbedit edit save files.The data format
-can also be specified, though the program can
-infer the format if the standard MB\-System suffix convention
-is used (*.mbXX where XX is the MB\-System format id number).
-
-The processed output swath files produced by \fBmbprocess\fP
-are named using a convention based on the data format id.
-\fBMB\-System\fP data formats are specified
-using two\-digit or three\-digit numbers (see the \fBMBIO\fP manual page).
-If an input swath data file is named "root.mbXX", where XX is the format
-id, then the default processed output file will be "rootp.mbXX"
-(e.g. mydata.mb71 \-> mydatap.mb71).
-The "p" inserted before the ".mbXX" suffix indicates the output
-file has been created by \fBmbprocess\fP.
-If the input file does not follow the *.mbXX naming convention,
-then the output filename will just consist of the input name
-with "p.mbXX" added as a suffix (e.g. mydata \-> mydatap.mb71)
-
-By default, \fBmbprocess\fP will only process a swath data
-file if the processed output file is either missing or out
-of date relative to the input swath data file, the parameter
-file, or any of the ancillary data files referred to in
-the parameter file (e.g. navigation files, edit save files,
-svp files). If the \fB\-P\fP option is specified, \fBmbprocess\fP
-will process every file, whether it needs it or not.
-
-.SH MBPROCESS PARAMETER FILE COMMANDS
-
-The \fBmbprocess\fP commands found in parameter files are:
-
- GENERAL PARAMETERS:
-   EXPLICIT
-        causes mbprocess to set modes implicitely
-        \- e.g. the SVPFILE command will also set
-          raytracing on even if the RAYTRACE command
-          is not given [explicit mode commands required]
-   FORMAT constant
-        sets format id [no default]
-   INFILE filename
-        sets input file path [no default]
-   OUTFILE filename
-        sets output file path [no default]
-
- NAVIGATION MERGING:
-   NAVMODE boolean
-        sets navigation merging [0]
-          0: navigation merge off
-          1: navigation merge on
-   NAVFILE filename
-        sets navigation file path [no default]
-   NAVFORMAT constant
-        sets navigation file format [9]
- 	see below for documentation of the
- 	supported navigation formats
-   NAVHEADING boolean
-        sets heading to be merged from navigation file
-        \- note: heading merged from navigation before
-          heading correction applied
-          0: heading not changed
-          1: heading merged from navigation file
-   NAVSPEED boolean
-        sets speed to be merged from navigation file
-          0: speed not changed
-          1: speed merged from navigation file
-   NAVDRAFT boolean
-        sets draft to be merged from navigation file
-        \- note: draft merged from navigation before
-          draft correction applied
-          0: draft not changed
-          1: draft merged from navigation file
-   NAVATTITUDE boolean
-        sets roll, pitch and heave to be merged from
-        navigation file
-        \- note: roll, pitch, and heave merged from
-          navigation before roll bias and pitch bias
-          corrections applied
-          0: roll, pitch, and heave not changed
-          1: roll, pitch, and heave merged from
-             navigation file
-   NAVINTERP boolean
-        sets navigation interpolation algorithm [0]
-          0: linear interpolation (recommended)
-          1: spline interpolation
-   NAVTIMESHIFT constant
-        sets navigation time shift (seconds) [0.0]
-        \- note: time shift added to timestamps of
-          navigation fixes read in from NAVFILE
-          prior to merging
-
- NAVIGATION OFFSETS AND SHIFTS:
-        \- These offsets and shifts will be applied to the
-          original navigation and to any merged navigation,
-          but will not be applied to adjusted navigation
-          (because generally adjusted navigation generated
-          by mbnavadjust already has offsets and shifts
-          applied).
-   NAVSHIFT boolean
-        sets navigation offset [0]
-        \- note: offsets and shifts are applied to navigation
-          values from both survey and navigation records, and
-          are applied to navigation read in from
-          NAVFILE prior to merging
-        \- note: offsets and shifts are NOT applied to adjusted
-          navigation values from NAVADJFILE
-   NAVOFFSETX constant
-        sets navigation athwartship offset (meters) [0.0]
-        \- note: the effective navigation shift is
-          (NAVOFFSETX \- SONAROFFSETX), and the
-          navigation is corrected by subtracting
-          this effective shift.
-        \- note: athwartship shift is positive to
-          starboard.
-   NAVOFFSETY constant
-        sets navigation fore\-aft offset (meters) [0.0]
-        \- note: the effective navigation shift is
-          (NAVOFFSETY \- SONAROFFSETY), and the
-          navigation is corrected by subtracting
-          this effective shift.
-        \- note: fore\-aft shift is positive forward.
-   NAVOFFSETZ constant
-        sets navigation vertical offset (meters) [0.0]
-        \- note: this value is not yet used for
-          anything.
-        \- note: vertical shift is positive down.
-   NAVSHIFTLON constant
-        sets navigation longitude shift (degrees) [0.0]
-   NAVSHIFTLAT constant
-        sets navigation latitude shift (degrees) [0.0]
-
- ADJUSTED NAVIGATION MERGING:
-   NAVADJMODE mode
-        sets navigation merging from mbnavadjust [0]
-        \- can apply to longitude and latitude only
-          or longitude, latitude, and depth offset
-          0: adjusted navigation merge off
-          1: adjusted navigation merge on
-          2: adjusted navigation and depth offset merge on
-   NAVADJFILE filename
-        sets adjusted navigation file path
-        \- this file supercedes navigation file for
-          lon and lat only
-        \- uses mbnavadjust output
-   NAVADJINTERP boolean
-        sets adjusted navigation interpolation algorithm [0]
-          0: linear interpolation (recommended)
-          1: spline interpolation
-
-  ATTITUDE MERGING:
-    ATTITUDEMODE mode
-        sets attitude (roll, pitch, and heave) merging [0]
-        \- roll, pitch, and heave merged before
-          roll bias and pitch bias corrections applied
-        \- attitude merging from a separate file supersedes
-          attitude merging from a navigation file
-          0: attitude merging off
-          1: attitude merging on
-    ATTITUDEFILE filename
-        sets attitude file path
-    ATTITUDEFORMAT constant
-        sets attitude file format [1]
-        \- attitude files can be in one of four ASCII
-          table formats
-          1: format is <time_d roll pitch heave>
-          2: format is <yr mon day hour min sec roll pitch heave>
-          3: format is <yr jday hour min sec roll pitch heave>
-          4: format is <yr jday daymin sec roll pitch heave>
-        \- time_d = decimal seconds since 1/1/1970
-        \- daymin = decimal minutes start of day
-        \- roll = positive starboard up, degrees
-        \- pitch = positive forward up, degrees
-        \- heave = positive up, meters
-
-  SONARDEPTH MERGING:
-    SONARDEPTHMODE mode
-        sets sonardepth merging [0]
-        \- sonardepth merged before
-          draft corrections applied
-        \- sonardepth merging from a separate file supersedes
-          draft merging from a navigation file
-          0: sonardepth merging off
-          1: sonardepth merging on
-    SONARDEPTHFILE filename
-        sets sonardepth file path
-    SONARDEPTHFORMAT constant
-        sets sonardepth file format [1]
-        \- sonardepth files can be in one of four ASCII
-          table formats
-          1: format is <time_d sonardepth>
-          2: format is <yr mon day hour min sec sonardepth>
-          3: format is <yr jday hour min sec sonardepth>
-          4: format is <yr jday daymin sec sonardepth>
-        \- time_d = decimal seconds since 1/1/1970
-        \- daymin = decimal minutes start of day
-        \- sonardepth = sonar depth positive down, meters
-
- DATA CUTTING:
-   DATACUTCLEAR
-        removes all existing data cutting commands
-   DATACUT kind mode min max
-        adds new data cutting command, where:
-          kind = 0 : cut applied to bathymetry data
-          kind = 1 : cut applied to amplitude data
-          kind = 2 : cut applied to sidescan data
-          mode = 0 : min and max indicate start and end
-                     beam/pixel numbers between which data
-                     are flagged or zeroed
-          mode = 1 : min and max indicate start and end
-                     acrosstrack distance (m) between which
-                     data are flagged or zeroed
-   BATHCUTNUMBER min max
-        adds new bathymetry data cutting command where
-        min and max are the start and end beam numbers
-        between which data are flagged (note that
-        flagging bathymetry also flags amplitude data)
-   BATHCUTDISTANCE min max
-        adds new bathymetry data cutting command where
-        min and max are the start and end acrosstrack
-        distance (m) between which data are flagged
-        (note that flagging bathymetry also flags
-        amplitude data)
-   BATHCUTSPEED min max
-        adds new bathymetry data cutting command where
-        all beams are flagged for pings with a ship
-        or vehicle speed less than min or greater than
-        max (note that flagging bathymetry also flags
-        amplitude data)
-   AMPCUTNUMBER min max
-        adds new amplitude data cutting command where
-        min and max are the start and end beam numbers
-        between which amplitude data are zeroed (note
-        that zeroing amplitude data has no impact on
-        bathymetry data)
-   AMPCUTDISTANCE min max
-        adds new amplitude data cutting command where
-        min and max are the start and end acrosstrack
-        distance (m) between which amplitude data are
-        zeroed (note that zeroing amplitude data has
-        no impact on bathymetry data)
-   AMPCUTSPEED min max
-        adds new amplitude data cutting command where
-        all amplitude values are zeroed for pings with
-        a ship or vehicle speed less than min or greater
-        than max (note that zeroing amplitude data has
-        no impact on bathymetry data)
-   SSCUTNUMBER min max
-        adds new sidescan data cutting command where
-        min and max are the start and end pixel numbers
-        between which sidescan data are zeroed  (note
-        that zeroing sidescan data has no impact on
-        bathymetry data)
-   SSCUTDISTANCE min max
-        adds new sidescan data cutting command where
-        min and max are the start and end acrosstrack
-        distance (m) between which sidescan data are
-        zeroed  (note that zeroing sidescan data has
-        no impact on bathymetry data)
-   SSCUTSPEED min max
-        adds new sidescan data cutting command where
-        all sidescan values are zeroed for pings with
-        a ship or vehicle speed less than min or greater
-        than max (note that zeroing sidescan data has
-        no impact on bathymetry data)
-
- BATHYMETRY EDITING:
-   EDITSAVEMODE boolean
-        turns on reading edit save file (from mbedit) [0]
-   EDITSAVEFILE filename
-        sets edit save file path (from mbedit) [none]
-
- BATHYMETRY RECALCULATION:
-   SVPMODE mode
-        sets usage of a water sound speed model (sound
-        velocity profile, or SVP) [0]
-         0: bathymetry recalculation by raytracing off
-         1: bathymetry recalculation by raytracing on
-         2: translate depths from corrected to uncorrected
-            or vice versa depending on SOUNDSPEEDREF
-            command
-   SVPFILE filename
-        sets SVP file path [no default]
-   SSVMODE boolean
-        sets surface sound velocity (SSV) mode [0]
-         0: use SSV from file
-         1: offset SSV from file (set by SSV command)
-         2: use constant SSV (set by SSV command)
-   SSV constant/offset
-        sets SSV value or offset (m/s) [1500.0]
-   ANGLEMODE mode
-        sets handling of beam angles during
-        raytracing [1]
-         0: angles not changed before raytracing
-         1: angles adjusted using Snell's Law for
-            the difference between the surface sound
-            velocity (SSV) and the sound speed at
-            the sonar depth in the SVP.
-         2: angles adjusted using Snell's Law and
-            the sonar array geometry for the
-            difference between the surface sound
-            velocity (SSV) and the sound speed at
-            the sonar depth in the SVP.
-   TTMULTIPLY multiplier
-        sets value multiplied by travel times [1.0]
-   SOUNDSPEEDREF boolean
-        determines the handling of the sound
-        speed reference for bathymetry [1]
-        \- note: if raytracing is turned off then
-          this command implies correcting or
-          uncorrecting using the SVP specified
-          with the SVPFILE command
-         0: produce "uncorrected" bathymetry
-            referenced to a uniform 1500 m/s
-            water sound speed model.
-         1: produce "corrected" bathymetry
-            referenced to a realistic water
-            sound speed model.
-
- STATIC BEAM BATHYMETRY OFFSETS:
-   STATICMODE mode
-        sets offsetting of bathymetry by
-        per-beam statics [0]
-          0: static correction off
-          1: static correction by beam number
-          2: static correction by acrosstrack beam angle
-   STATICFILE filename
-        sets static per-beam file path [no default]
-        \- static files are two-column ascii tables
-        \- if correction is by beam number then
-          the beam # is in column 1 and
-          the depth offset is in m in column 2
-        \- if correction is by beam angle then
-          the beam angle (starboard positive)
-          is in column 1 and
-          the depth offset is in m in column 2
-
- DRAFT CORRECTION:
-   DRAFTMODE mode
-        sets draft correction [0]
-        \- note: draft merged from navigation before
-          draft correction applied
-          0: no draft correction
-          1: draft correction by offset
-          2: draft correction by multiply
-          3: draft correction by offset and multiply
-          4: draft set to constant
-   DRAFT constant
-        sets draft value (m) [0.0]
-   DRAFTOFFSET offset
-        sets value added to draft (m) [0.0]
-   DRAFTMULTIPLY multiplier
-        sets value multiplied by draft [1.0]
-
- HEAVE CORRECTION:
-   HEAVEMODE mode
-        sets heave correction [0]
-        \- note: heave correction by offset and/or
-          multiplication is added to any lever
-          heave correction, and then either used in
-          bathymetry recalculation or added to
-          existing bathymetry
-          0: no heave correction
-          1: heave correction by offset
-          2: heave correction by multiply
-          3: heave correction by offset and multiply
-   HEAVEOFFSET offset
-        sets value added to heave (m)
-   HEAVEMULTIPLY multiplier
-        sets value multiplied by heave
-
- LEVER CORRECTION:
-   LEVERMODE mode
-        sets heave correction by lever calculation [0]
-        \- note: lever heave correction is added to
-          any heave correction by offset and/or
-          multiplication, and then either used in
-          bathymetry recalculation or added to
-          existing bathymetry
-          0: no lever calculation
-          1: heave correction by lever calculation
-   VRUOFFSETX constant
-        sets athwartships offset of attitude sensor (m)
-        \- note: positive to starboard
-   VRUOFFSETY constant
-        sets fore\-aft offset of attitude sensor (m)
-        \- note: positive forward
-   VRUOFFSETZ constant
-        sets vertical offset of attitude sensor (m)
-        \- note: positive down
-   SONAROFFSETX constant
-        sets athwartships offset of sonar receive array (m)
-        \- note: positive to starboard
-   SONAROFFSETY constant
-        sets fore\-aft offset of sonar receive array (m)
-        \- note: positive forward
-   SONAROFFSETZ constant
-        sets vertical offset of sonar receive array (m)
-        \- note: positive down
-
- ROLL CORRECTION:
-   ROLLBIASMODE mode
-        sets roll correction [0]
-          0: no roll correction
-          1: roll correction by single roll bias
-          2: roll correction by separate port and
-             starboard roll bias
-   ROLLBIAS offset
-        sets roll bias (degrees)
-   ROLLBIASPORT offset
-        sets port roll bias (degrees)
-   ROLLBIASSTBD offset
-        sets starboard roll bias (degrees)
-
- PITCH CORRECTION:
-   PITCHBIASMODE mode
-        sets pitch correction [0]
-          0: no pitch correction
-          1: pitch correction by pitch bias
-   PITCHBIAS offset
-        sets pitch bias (degrees)
-
- HEADING CORRECTION:
-   HEADINGMODE mode
-        sets heading correction [no heading correction]
-        \- note: heading merged from navigation before
-          heading correction applied
-          0: no heading correction
-          1: heading correction using course
-             made good
-          2: heading correction by offset
-          3: heading correction using course
-             made good and offset
-   HEADINGOFFSET offset
-        sets value added to heading (degrees)
-
- TIDE CORRECTION:
-   TIDEMODE mode
-        sets tide correction [0]
-        \- note: tide added to bathymetry after
-          all other calculations and corrections
-          0: tide correction off
-          1: tide correction on
-   TIDEFILE filename
-        sets tide file path
-   TIDEFORMAT constan
-        sets tide file format [1]
-        \- tide files can be in one of four ASCII
-          table formats
-          1: format is <time_d tide>
-          2: format is <yr mon day hour min sec tide>
-          3: format is <yr jday hour min sec tide>
-          4: format is <yr jday daymin sec tide>
-        \- time_d = decimal seconds since 1/1/1970
-        \- daymin = decimal minutes start of day
-
- AMPLITUDE CORRECTION:
-   AMPCORRMODE  boolean
-        sets correction of amplitude for
-        amplitude vs grazing angle function
-          0: amplitude correction off
-          1: amplitude correction on
-   AMPCORRFILE filename
-        sets amplitude correction file path
-        [no default]
-   AMPCORRTYPE mode
-        sets sidescan correction type [0]
-          0: correction by subtraction (dB scale)
-          1: correction by division (linear scale)
-   AMPCORRSYMMETRY boolean
-        forces correction function to be symmetric [1]
-   AMPCORRANGLE constant
-        sets amplitude correction reference angle
-        (deg) [30.0]
-   AMPCORRSLOPE mode
-        sets amplitude correction slope mode [0]
-          0: local slope ignored in calculating correction
-          1: local slope used in calculating correction
-          2: topography grid used in calculating correction
- 	  	but slope ignored
-          3: local slope from topography grid used in
- 		  calculating correction
-
- SIDESCAN CORRECTION:
-   SSCORRMODE  boolean
-        sets correction of sidescan for
-        amplitude vs grazing angle function
-          0: sidescan correction off
-          1: sidescan correction on
-   SSCORRFILE filename
-        sets sidescan correction file path
-        [no default]
-   SSCORRTYPE mode
-        sets sidescan correction type [0]
-          0: correction by subtraction (dB scale)
-          1: correction by division (linear scale)
-   SSCORRSYMMETRY boolean
-        forces correction function to be symmetric [1]
-   SSCORRANGLE constant
-        sets sidescan correction reference angle
-        (deg) [30.0]
-   SSCORRSLOPE mode
-        sets sidescan correction slope mode [0]
-          0: local slope ignored in calculating correction
-          1: local slope used in calculating correction
-          2: topography grid used in calculating correction
- 	  	but slope ignored
-          3: local slope from topography grid used in
- 		  calculating correction
-   AMPSSCORRTOPOFILE
-        Sets topography grid used for correcting amplitude
-        and sidescan
-
- SIDESCAN RECALCULATION:
-   SSRECALCMODE  boolean
-        sets recalculation of sidescan for
-        Simrad multibeam data
-          0: sidescan recalculation off
-          1: sidescan recalculation on
-   SSPIXELSIZE constant
-        sets recalculated sidescan pixel size (m) [0.0]
-        \- a zero value causes the pixel size to
-          be recalculated for every data record
-   SSSWATHWIDTH  constant
-        sets sidescan swath width (degrees) [0.0]
-        \- a zero value causes the swath width
-          to be recalculated for every data record
-   SSINTERPOLATE  constant
-        sets sidescan interpolation distance
-        (number of pixels)
-
- METADATA INSERTION:
-   METAVESSEL string
-        sets mbinfo metadata string for vessel
-   METAINSTITUTION string
-        sets mbinfo metadata string for vessel
-        operator institution or company
-   METAPLATFORM string
-        sets mbinfo metadata string for sonar
-        platform (ship or vehicle)
-   METASONAR string
-        sets mbinfo metadata string for sonar
-        model name
-   METASONARVERSION string
-        sets mbinfo metadata string for sonar
-        version (usually software version)
-   METACRUISEID string
-        sets mbinfo metadata string for institutional
-        cruise id
-   METACRUISENAME string
-        sets mbinfo metadata string for descriptive
-        cruise name
-   METAPI string
-        sets mbinfo metadata string for principal
-        investigator
-   METAPIINSTITUTION string
-        sets mbinfo metadata string for principal
-        investigator
-   METACLIENT string
-        sets mbinfo metadata string fo data owner
-        (usually PI institution)
-   METASVCORRECTED boolean
-        sets mbinfo metadata boolean for sound
-        velocity corrected depths
-   METATIDECORRECTED boolean
-        sets mbinfo metadata boolean for tide
-        corrected bathymetry
-   METABATHEDITMANUAL boolean
-        sets mbinfo metadata boolean for manually
-        edited bathymetry
-   METABATHEDITAUTO boolean
-        sets mbinfo metadata boolean for automatically
-        edited bathymetry
-   METAROLLBIAS constant
-        sets mbinfo metadata constant for roll bias
-        (degrees + to starboard)
-   METAPITCHBIAS constant
-        sets mbinfo metadata constant for pitch bias
-        (degrees + forward)
-   METAHEADINGBIAS constant
-        sets mbinfo metadata constant for heading bias
-   METADRAFT constant
-        sets mbinfo metadata constant for vessel draft (m)
-
- PROCESSING KLUGES:
-   KLUGE001 boolean
-        enables correction of travel times in
-        Hydrosweep DS2 data from the R/V Maurice
-        Ewing in 2001 and 2002.
-   KLUGE002 boolean
-        enables correction of draft values in
-        Simrad data
-        \- some Simrad multibeam data has had an
-          error in which the heave has bee added
-          to the sonar depth (draft for hull
-          mounted sonars)
-        \- this correction subtracts the heave
-          value from the sonar depth
-   KLUGE003 boolean
-        enables correction of beam angles in
-        SeaBeam 2112 data
-        \- a data sample from the SeaBeam 2112 on
-          the USCG Icebreaker Healy (collected on
-          23 July 2003) was found to have an error
-          in which the beam angles had 0.25 times
-          the roll added
-        \- this correction subtracts 0.25 * roll
-          from the beam angles before the bathymetry
-          is recalculated by raytracing through a
-          water sound velocity profile
-        \- the mbprocess parameter files must be
-          set to enable bathymetry recalculation
-          by raytracing in order to apply this
-          correction
-   KLUGE004 boolean
-        deletes survey data associated with duplicate
-        or reversed time tags
-        \- if survey data records are encountered
-          with time tags less than or equal to the
-          last good time tag, an error is set and
-          the data record is not output to the
-          processed data file.
-   KLUGE005 boolean
-        replaces survey record timestamps with
-        timestamps of corresponding merged navigation
-        records
-        \- this feature allows users to fix
-          timestamp errors using MBnavedit and
-          then insert the corrected timestamps
-          into processed data
-   KLUGE006 boolean
- 	changes sonar depth / draft values without
-        changing bathymetry values
-   KLUGE007 boolean
-        processing kluge 007 (not yet defined)
-        \- occasionaly odd processing problems will
-          occur that are specific to a particular
-          survey or sonar version
-        \- mbprocess will allow one\-time fixes to
-          be defined as "kluges" that can be turned
-          on through the parameter files.
-
-.SH ANCILLARY DATA FILES
-
-\fBMB\-System\fP also uses a number of ancillary data files, most
-of which relate to \fBmbprocess\fP in some way. By default,
-these ancillary data files are named by adding a short suffix
-to the primary data file name (e.g. ".par", ".svp", ".esf", ".nve")
-
-The common ancillary files are listed below. The example names
-given here follow from an input swath data file name of mydata.mb71.
-
-The processing parameter file used by \fBmbprocess\fP has
-an ".par" suffix. These files are generated
-or modified by \fBmbset\fP, \fBmbedit\fP, \fBmbnavedit\fP,
-\fBmbvelocitytool\fP, \fBmbnavadjust\fP, and \fBmbclean\fP.
-        mydata.mb71.par
-
-The most prominent ancillary files are metadata or
-"inf" files (created from the output of \fBmbinfo\fP).
-Programs such as \fBmbgrid\fP and \fBmbm_plot\fP try to check "inf"
-files to see if the corresponding data files include data within
-desired areas. The program \fBmbprocess\fP automatically generates
-an "inf" file for any processed output swath file.
-Also, the program \fBmbdatalist\fP is often used to
-create or update "inf" files for large groups of swath data files.
-        mydata.mb71.inf
-
-The "fast bath" or "fbt" files
-are generated by copying the swath bathymetry to a sparse,
-quickly read format (format 71). Programs such as \fBmbgrid\fP,
-\fBmbswath\fP, and \fBmbcontour\fP will try to read "fbt" files
-instead of the full data files whenever only bathymetry
-information are required. The program \fBmbprocess\fP
-automatically generates
-an "fbt" file for any processed output swath file.
-Also, the program \fBmbdatalist\fP is often used to
-create or update "fbt" files for large groups of swath data files.
-These files are not generated or used
-when the original swath data is already
-in a compact bathymetry\-only data format.
-        mydata.mb71.fbt
-
-The "fast nav" or "fnv" files
-are just ASCII lists of navigation generated using \fBmblist\fP
-with a \fB\-O\fP\fItMXYHSc\fP option. Programs such as \fBmbgrid\fP,
-\fBmbswath\fP, and \fBmbcontour\fP will try to read "fnv" files
-instead of the full data files whenever only
-navigation information are required. These files are not generated or used
-when the original data is already
-in a single\-beam or navigation data format.
-        mydata.mb71.fnv
-
-The bathymetry edit save file generated by \fBmbedit\fP and
-\fBmbclean\fP has an ".esf" suffix.
-        mydata.mb71.esf
-
-A water sound velocity profile (SVP) file generated
-by \fBmbvelocitytool\fP has an ".svp" suffix unless
-the user specifies otherwise.
-        mydata.mb71.svp
-
-Water sound velocity profile (SVP) files generated
-by \fBmbsvplist\fP also use the ".svp" suffix.
-However, multiple SVP files may be
-extracted from each input swath file, so the files are
-numbered using a "_YYY.svp" suffix, where YYY increments
-from 001.
-        mydata.mb71_001.svp
-        mydata.mb71_002.svp
-        mydata.mb71_003.svp
-
-Edited navigation files generated by \fBmbnavedit\fP have
-an ".nve" suffix:
-        mydata.mb71.nve
-.br
-These navigation files can be read independently using format 166.
-
-Adjusted navigation files generated by \fBmbnavadjust\fP
-have an ".naY" suffix, where "Y" is a number between 0\-9.
-The \fBmbnavadjust\fP package may be used multiple times
-for a survey; the adjustments are numbered sequentially from
-"0":
-        mydata.mb71.na0
-        mydata.mb71.na1
-        mydata.mb71.na2
-.br
-and so on. These navigation files can be read independently using format 166.
-
-.SH AUTHORSHIP
-David W. Caress (caress at mbari.org)
-.br
-  Monterey Bay Aquarium Research Institute
-.br
-Dale N. Chayes (dale at ldeo.columbia.edu)
-.br
-  Lamont\-Doherty Earth Observatory
-
-.SH OPTIONS
-.TP
-.B \-F
-\fIformat\fP
-.br
-Sets the \fBMBIO\fP integer format identifier
-for the input file specified with the
-\fB\-I\fP option. By default, \fBmbprocess\fP
-derives the format id from the \fBmbprocess\fP parameter file
-associated with the input file (\fB\-I\fP option) or, if necessary,
-infers the format from the "*.mbXX" \fBMB\-System\fP suffix
-convention.
-.TP
-.B \-H
-This "help" flag causes the program to print out a description
-of its operation and then exit immediately.
-.TP
-.B \-I
-\fIinfile\fP
-.br
-Swath data file from which the input data will be read, or
-a datalist file containing a list of input swath data files
-and/or other datalist files. If \fIinfile\fP is a
-datalist file, then \fBmbprocess\fP will attempt to
-process all data files identified by recursively reading
-\fIinfile\fP.
-.TP
-.B \-N
-.br
-By default, \fBmbprocess\fP passes any comment records
-it encounters in the input data to the output data file
-and additionally embeds new comment records detailing the
-processing parameters used by \fBmbprocess\fP.
-This option causes \fBmbprocess\fP to not pass new or old
-comment records to the output data file.
-.TP
-.B \-O
-\fIoutfile\fP
-.br
-Data file to which the output data will be written. If
-no output file is specified, the output filename is
-set automatically. If an input swath data file
-is named "root.mbXX", where XX is the format
-id, then the default processed output file will be "rootp.mbXX".
-The "p" inserted before the ".mbXX" suffix indicates the output
-file has been created by \fBmbprocess\fP.
-If the input file does not follow the *.mbXX naming convention,
-then the output filename will just consist of the input name
-with "p.mbXX" added as a suffix.
-.TP
-.B \-P
-.br
-By default, \fBmbprocess\fP will only process a swath data
-file if the processed output file is either missing or out
-of date relative to the input swath data file, the parameter
-file, or any of the ancillary data files referred to in
-the parameter file (e.g. navigation files, edit save files,
-svp files). If the \fB\-P\fP option is specified, \fBmbprocess\fP
-will process every file, whether it needs it or not.
-.TP
-.B \-T
-.br
-This option puts \fBmbprocess\fP into a test mode. The program
-will report whether or not it would process a file, but it
-will not actually process the data or produce an output
-processed file.
-.TP
-.B \-S
-.br
-This option causes \fBmbprocess\fP to print out the status of
-each file (e.g. up to date, out of date, locked, unlocked) along
-with the file modification times used to determine if the output
-file is out of date.
-.TP
-.B \-V
-Normally, \fBmbprocess\fP works "silently" without outputting
-anything to the stderr stream.  If the
-\fB\-V\fP flag is given, then \fBmbprocess\fP works in a "verbose" mode and
-outputs the program version being used, the processing parameters
-being use, and some statistics regarding the processing accomplished.
-
-.SH NAVIGATION FORMATS
-The navigation formats that are supported for merging by \fBmbprocess\fP
-include the following:
- 	\fBMBprocess\fP ID          Name
- 	\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-      \-\-\-\-
- 	         1              Simple Decimal Time
- 	         2              Simple Date 1
- 	         3              Simple Date 2
- 	         4              Simple Date 3
- 	         5              L\-DEO Processed Nav
- 	         6              NMEA 0183 \- GLL
- 	         7              NMEA 0183 \- GGA
- 	         8              Simrad 90 Nav
- 	         9              MBPRONAV (*.nve Files)
- 	         10             R2RNAV (*_hires.r2rnav Files)
-
-Format 1 (Simple Decimal Time):
- 	\- text
- 	\- fields separated by white space
- 	\- each line contains the following fields:
- 		time_d lon lat
- 	\- time_d : decimal seconds since 1970 Jan 1 00:00:00.00
- 	\- lon: decimal longitude (deg)
- 	\- lat: decimal latitude (deg)
-
-Format 2 (Simple Date 1):
- 	\- text
- 	\- fields separated by white space
- 	\- each line contains the following fields:
- 		yr mon day hour min sec lon lat
- 	\- yr: four\-digit year
- 	\- mon: integer month of year
- 	\- day: integer day of month
- 	\- hour: integer hour of day
- 	\- min: integer minute of hour
- 	\- sec: decimal second of minute
- 	\- lon: decimal longitude (deg)
- 	\- lat: decimal latitude (deg)
-
-Format 3 (Simple Date 2):
- 	\- text
- 	\- fields separated by white space
- 	\- each line contains the following fields:
- 		yr jday hour min sec lon lat
- 	\- yr: four\-digit year
- 	\- jday: integer julian day of year
- 	\- hour: integer hour of day
- 	\- min: integer minute of hour
- 	\- sec: decimal second of minute
- 	\- lon: decimal longitude (deg)
- 	\- lat: decimal latitude (deg)
-
-Format 4 (Simple Date 3):
- 	\- text
- 	\- fields separated by white space
- 	\- each line contains the following fields:
- 		yr jday daymin sec lon lat
- 	\- yr: four\-digit year
- 	\- jday: integer julian day of year
- 	\- daymin: integer minute of day
- 	\- sec: decimal second of minute
- 	\- lon: decimal longitude (deg)
- 	\- lat: decimal latitude (deg)
-
-Format 5 (L\-DEO Processed Nav):
- 	\- text
- 	\- fields separated by white space
- 	\- each line contains the following fields:
- 		timetag NorS latd latm EorW lond lonm src dr1 dr2
- 	\- timetag: comes in two forms
- 		form 1: yy+jjj:hh:mm:ss.sss
- 		form 2: yyyy+jjj:hh:mm:ss.sss
- 	\- yy: either two\-digit or four\-digit year
- 	\- jjj: integer julian day of year
- 	\- hh: integer hour of day
- 	\- mm: integer minute of hour
- 	\- ss.sss: decimal second of minute
- 	\- NorS: 'S' for southern hemisphere
- 	        'N' for northern hemisphere
- 	\- latd: integer latitude degrees
- 	\- latm: decimal latitude minutes
- 	\- EorW: 'E' for eastern hemisphere
- 	        'W' for western hemisphere
- 	\- lond: integer longitude degrees
- 	\- lonm: decimal longitude minutes
- 	\- src: nav source (e.g. gp1, dr, satl)
- 	        'gp1'  \- GPS receiver 1
- 	        'dr'   \- dead reckoning
- 	        'satl' \- transit satellite
- 	\- dr1: nonzero when src is 'dr'
- 	\- dr2: nonzero when src is 'dr'
-
-Format 6 (NMEA 0183 \- GLL):
- 	\- text
- 	\- fields separated by commas
- 	\- nav derived from GLL strings
-
-Format 7 (NMEA 0183 \- GGA):
- 	\- text
- 	\- fields separated by commas
- 	\- nav derived from GGA strings
-
-Format 8 (Simrad 90 Nav):
- 	\- text
- 	\- fields not separated by white space
- 	\- each line contains the following fields:
- 		ddmmyy_hhmmss.ss_LLlllllN_LLLllllllE
-	\- dd: day of month
- 	\- mm: integer month of year
-	\- yy: two\-digit year
- 	\- hh: integer hour of day
- 	\- mm: integer minute of hour
- 	\- ss.ss: decimal second of minute
- 	\- LL: integer latitude degrees
- 	\- lllll: integer latitude minutes X 1000
- 	\- N:    'S' for southern hemisphere
- 	        'N' for northern hemisphere
- 	\- LLL: integer longitude degrees
- 	\- lllll: integer longitude minutes X 1000
- 	\- E:    'E' for eastern hemisphere
- 	        'W' for western hemisphere
-
-Format 9 (MBPRONAV (*.nve Files)):
- 	\- text
- 	\- fields separated by white space
- 	\- each line contains at least 9, and possibly as many as 19, of the following fields:
-  		yr mn dy hr mi se td ln lt hg sp dr rl pt hv pln plt sln slt
- 	\- yr: four\-digit year
- 	\- mn: integer month of year
- 	\- dy: integer day of month
- 	\- hr: integer hour of day
- 	\- mi: integer minute of hour
- 	\- se: decimal second of minute
- 	\- td : decimal seconds since 1970 Jan 1 00:00:00.00
- 	\- ln: decimal longitude (deg)
- 	\- lt: decimal latitude (deg)
- 	\- hg: decimal heading (deg)
- 	\- sp: decimal speed (km/hr)
- 	\- dr: decimal draft (m)
- 	\- rl: decimal roll (deg)
- 	\- pt: decimal pitch (deg)
- 	\- hv: decimal heave (m)
- 	\- pln: decimal longitude of portmost sounding (deg)
- 	\- plt: decimal latitude of portmost sounding (deg)
- 	\- sln: decimal longitude of starboardmost sounding (deg)
- 	\- slt: decimal latitude of starboardmost sounding (deg)
-
-Format 10 (R2RNAV (*_hires.r2rnav Files)):
- 	\- text
-	\- also works with *_1min.r2rnav and *_control.r2rnav files
- 		\- these lack the GPS parameters
- 	\- defined by SIO GDC as part of the R2R project
- 	\- columns separated by tabs
- 	\- each line contains the following fields
- 		yyyy\-mm\-ddThh:mm:ss.sssZ lon lat q n d h
-  	\- yyyy: four\-digit year
-  	\- mm: integer month of year
-  	\- dd: integer day of month
- 	\- T: the letter "T" is always between the date and the time
-  	\- hh: integer hour of day
-  	\- mm: integer minute of hour
-  	\- ss.sss: decimal second of minute
- 	\- Z: the letter "Z" is always there to specify UTC time zone
-  	\- lo: decimal longitude (deg) (\-180 to +180
-  	\- la: decimal latitude (deg) (\-90 to +90)
-  	\- q: GPS quality
-  	\- n: number of GPS satellites
-  	\- d: GPS dilution
- 	\- h: GPS antenna height (m)
-
-.SH EXAMPLES
-Suppose the user has a Simrad EM120 data file called
-"0051_20010829_223755.mb57" that requires processing.
-
-Editing the bathymetry data in this file with mbedit will generate
-an edit save file "0051_20010829_223755.mb57.esf" and
-an mbprocess parameter file "0051_20010829_223755.mb57.par".
-The contents of the parameter file are:
-
- ## MB\-System processing parameter file
- ## Written by mb_pr_writepar version $Id: mbprocess.1 2210 2014-11-10 19:53:01Z caress $
- ## MB\-system Version 5.0.beta22
- ## Generated by user <caress> on cpu <menard> at <Fri Sep  6 21:27:41 2002>
- ##
- ##
- ## Forces explicit reading of parameter modes.
- EXPLICIT
- ##
- ## General Parameters:
- FORMAT 57
- INFILE /data/0051_20010829_223755.mb57
- OUTFILE /data/0051_20010829_223755p.mb57
- ##
- ## Navigation Merging:
- NAVMODE 0
- NAVFILE /data/0051_20010829_223755.mb57.nve
- NAVFORMAT 0
- NAVHEADING 0
- NAVSPEED 0
- NAVDRAFT 0
- NAVATTITUDE 0
- NAVINTERP 0
- NAVTIMESHIFT 0.000000
- ##
- ## Navigation Offsets and Shifts:
- NAVSHIFT 0
- NAVOFFSETX 0.000000
- NAVOFFSETY 0.000000
- NAVOFFSETZ 0.000000
- NAVSHIFTLON 0.000000
- NAVSHIFTLAT 0.000000
- ##
- ## Adjusted Navigation Merging:
- NAVADJMODE 0
- NAVADJFILE
- NAVADJINTERP 0
- ##
- ## Attitude Merging:
- ATTITUDEMODE 0
- ATTITUDEFILE
- ATTITUDEFORMAT 1
- ##
- ## Sonardepth Merging:
- SONARDEPTHMODE 0
- SONARDEPTHFILE
- SONARDEPTHFORMAT 1
- ##
- ## Data cutting:
- DATACUTCLEAR
- ##
- ## Bathymetry Flagging:
- EDITSAVEMODE 1
- EDITSAVEFILE /data/0051_20010829_223755.mb57.esf
- ##
- ## Bathymetry Recalculation:
- SVPMODE 0
- SVPFILE
- SSVMODE 0
- SSV 0.000000
- TTMODE 0
- TTMULTIPLY 1.000000
- ANGLEMODE 0
- SOUNDSPEEDREF 1
- ##
- ## Draft Correction:
- DRAFTMODE 0
- DRAFT 0.000000
- DRAFTOFFSET 0.000000
- DRAFTMULTIPLY 1.000000
- ##
- ## Heave Correction:
- HEAVEMODE 0
- HEAVEOFFSET 0.000000
- HEAVEMULTIPLY 1.000000
- ##
- ## Lever Correction:
- LEVERMODE 0
- VRUOFFSETX 0.000000
- VRUOFFSETY 0.000000
- VRUOFFSETZ 0.000000
- SONAROFFSETX 0.000000
- SONAROFFSETY 0.000000
- SONAROFFSETZ 0.000000
- ##
- ## Roll Correction:
- ROLLBIASMODE 0
- ROLLBIAS 0.000000
- ROLLBIASPORT 0.000000
- ROLLBIASSTBD 0.000000
- ##
- ## Pitch Correction:
- PITCHBIASMODE 0
- PITCHBIAS 0.000000
- ##
- ## Heading Correction:
- HEADINGMODE 0
- HEADINGOFFSET 0.000000
- ##
- ## Tide Correction:
- TIDEMODE 0
- TIDEFILE
- TIDEFORMAT 1
- ##
- ## Amplitude Correction:
- AMPCORRMODE 0
- AMPCORRFILE
- AMPCORRTYPE 0
- AMPCORRSYMMETRY 1
- AMPCORRANGLE 30.000000
- AMPCORRSLOPE 0
- ##
- ## Sidescan Correction:
- SSCORRMODE 0
- SSCORRFILE
- SSCORRTYPE 0
- SSCORRSYMMETRY 1
- SSCORRANGLE 30.000000
- SSCORRSLOPE 0
- ##
- ## Sidescan Recalculation:
- SSRECALCMODE 0
- SSPIXELSIZE 0.000000
- SSSWATHWIDTH 0.000000
- SSINTERPOLATE 0
- ##
- ## Metadata Insertion:
- METAVESSEL
- METAINSTITUTION
- METAPLATFORM
- METASONAR
- METASONARVERSION
- METACRUISEID
- METACRUISENAME
- METAPI
- METAPIINSTITUTION
- METACLIENT
- METASVCORRECTED \-1
- METATIDECORRECTED \-1
- METABATHEDITMANUAL \-1
- METABATHEDITAUTO \-1
- METAROLLBIAS 0.000000
- METAPITCHBIAS 0.000000
- METAHEADINGBIAS 0.000000
- METADRAFT 0.000000
- ##
- ## Processing Kluges
-
-Editing the navigation with mbnavedit will generate
-a navigation file named "0051_20010829_223755.mb57.nve"
-and will modify the parameter file. The changed lines
-in "0051_20010829_223755.mb57.par" are:
-
- ## Navigation Merging:
- NAVMODE 1
- NAVFILE /data/0051_20010829_223755.mb57.nve
- NAVFORMAT 9
- NAVHEADING 1
- NAVSPEED 1
- NAVDRAFT 1
- NAVATTITUDE 1
-
-At this point, running \fBmbprocess\fP on
-"0051_20010829_223755.mb57" will apply the bathymetry
-flags from \fBmbedit\fP and merge the navigation from
-\fBmbnavedit\fP, but will not modify the data in any
-other way.
-
-If the user wants to recalculate the bathymetry using
-an SVP file "0051_20010829_223755.mb57.svp"
-and a roll bias correction
-of +0.5 degrees, the following will suffice:
-
-        mbset \-I 0051_20010829_223755.mb57 \
-                \-PSVPFILE:0051_20010829_223755.mb57.svp \
-                \-PROLLBIAS:0.5 \
-                \-PDRAFT:1.95 \
-                \-V
-
-The affected lines in "0051_20010829_223755.mb57.par" are:
-
- ##
- ## Bathymetry Recalculation:
- SVPMODE 1
- SVPFILE 0051_20010829_223755.mb57.svp
- SSVMODE 0
- SSV 0.000000
- TTMODE 0
- TTMULTIPLY 1.000000
- ANGLEMODE 0
- SOUNDSPEEDREF 1
- ##
- ## Draft Correction:
- DRAFTMODE 4
- DRAFT 1.950000
- DRAFTOFFSET 0.000000
- DRAFTMULTIPLY 1.000000
- ##
- ## Roll Correction:
- ROLLBIASMODE 1
- ROLLBIAS 0.500000
- ROLLBIASPORT 0.000000
- ROLLBIASSTBD 0.000000
-
-To process the data, run mbprocess:
-
-        mbprocess \-I0051_20010829_223755.mb57 \-V
-
- The output to the terminal is:
- Program mbprocess
- Version $Id: mbprocess.1 2210 2014-11-10 19:53:01Z caress $
- MB\-System Version 5.0.beta07
-
- Program <mbprocess>
- Version $Id: mbprocess.1 2210 2014-11-10 19:53:01Z caress $
- MB\-system Version 5.0.beta07
-
- Program Operation:
-   Input file:      0051_20010829_223755.mb57
-   Format:          57
-   Files processed only if out of date.
-   Comments embedded in output.
-
- Data processed \- out of date:
-  Input:  0051_20010829_223755.mb57
-  Output: /u/mbuser/survey/0051_20010829_223755p.mb57
-
- Input and Output Files:
-   Format:                        57
-   Input file:                    0051_20010829_223755.mb57
-   Output file:                   /u/mbuser/survey/0051_20010829_223755p.mb57
-   Comments in output: ON
-
- Navigation Merging:
-   Navigation merged from navigation file.
-   Heading merged from navigation file.
-   Speed merged from navigation file.
-   Draft merged from navigation file.
-   Navigation file:               /u/mbuser/survey/0051_20010829_223755.mb57.nve
-   Navigation algorithm:          linear interpolation
-   Navigation time shift:         0.000000
-
- Navigation Offsets and Shifts:
-   Navigation positions not shifted.
-
- Adjusted Navigation Merging:
-   Navigation not merged from adjusted navigation file.
-   Adjusted navigation file:
-   Adjusted navigation algorithm: linear interpolation
-
- Data Cutting:
-   Data cutting disabled.
-
- Bathymetry Editing:
-   Bathymetry edits applied from file.
-   Bathymetry edit file:          0051_20010829_223755.mb57.esf
-
- Bathymetry Recalculation:
-   Bathymetry recalculated by raytracing.
-   SVP file:                      0051_20010829_223755.mb57.svp
-   SSV not modified.
-   SSV offset/constant:           0.000000 m/s
-   Travel time multiplier:        1.000000 m
-
- Bathymetry Water Sound Speed Reference:
-   Output bathymetry reference:   CORRECTED
-   Depths recalculated as corrected
-
- Draft Correction:
-   Draft set to constant.
-   Draft constant:                1.950000 m
-   Draft offset:                  0.000000 m
-   Draft multiplier:              1.000000 m
-
- Heave Correction:
-   Heave not modified.
-   Heave offset:                  0.000000 m
-   Heave multiplier:              1.000000 m
-
- Lever Correction:
-   Lever calculation off.
-
- Tide Correction:
-   Tide calculation off.
-
- Roll Correction:
-   Roll offset by bias.
-   Roll bias:                     0.500000 deg
-   Port roll bias:                0.000000 deg
-   Starboard roll bias:           0.000000 deg
-
- Pitch Correction:
-   Pitch not modified.
-   Pitch bias:                    0.000000 deg
-
- Heading Correction:
-   Heading not modified.
-   Heading offset:                0.000000 deg
-
- Amplitude Corrections:
-   Amplitude correction off.
-
- Sidescan Corrections:
-   Sidescan correction off.
-
- Sidescan Recalculation:
-   Sidescan not recalculated.
-   Sidescan pixel size:           0.000000
-   Sidescan swath width:          0.000000
-   Sidescan interpolation:        0
-
- Metadata Insertion:
-   Metadata vessel:
-   Metadata institution:
-   Metadata platform:
-   Metadata sonar:
-   Metadata sonarversion:
-   Metadata cruiseid:
-   Metadata cruisename:
-   Metadata pi:
-   Metadata piinstitution:
-   Metadata client:
-   Metadata svcorrected:          \-1
-   Metadata tidecorrected         \-1
-   Metadata batheditmanual        \-1
-   Metadata batheditauto:         \-1
-   Metadata rollbias:             0.000000
-   Metadata pitchbias:            0.000000
-   Metadata headingbias:          0.000000
-   Metadata draft:                0.000000
-
- 236 navigation records read
- Nav start time: 2001 08 29 22:38:02.082999
- Nav end time:   2001 08 29 23:37:22.322000
-
- 47 bathymetry edits read
-
- 236 input data records
- 3587 input nav records
- 17 input comment records
- 6617 input other records
- 236 output data records
- 3587 output nav records
- 64 output comment records
- 6617 output other records
-
- Generating inf file for /u/mbuser/survey/0051_20010829_223755p.mb57
- Generating fbt file for /u/mbuser/survey/0051_20010829_223755p.mb57
- Generating fnv file for /u/mbuser/survey/0051_20010829_223755p.mb57
-
-.SH SEE ALSO
-\fBmbsystem\fP(1), \fBmbset\fP(1),
-\fBmbedit\fP(1), \fBmbnavedit\fP(1), \fBmbvelocitytool\fP(1)
-
-.SH BUGS
-You tell me.
diff --git a/src/man/man1/mbps.1 b/src/man/man1/mbps.1
deleted file mode 100644
index 87acf75..0000000
--- a/src/man/man1/mbps.1
+++ /dev/null
@@ -1,185 +0,0 @@
-.TH MBPS 1 "3 June 2013" "MB-System 5.0" "MB-System 5.0"
-.SH NAME
-\fBmbps\fP \- Generates a PostScript perspective plot of a piece of swath sonar data.
-
-.SH VERSION
-Version 5.0
-
-.SH SYNOPSIS
-\fBmbps\fP [\fB\-F\fIformat \fB\-I\fIfilename \fB\-Nnpingsmax\fI \fB\-Ppings\fI
-\fB\-A\fIalpha \fB\-B\fIyr/mo/da/hr/mn/sc
-\fB\-D\fIview_direction \fB\-E\fIyr/mo/da/hr/mn/sc \fB\-G\fIgap
-\fB\-K\fIeta \fB\-S\fIspeedmin \fB\-T\fI"title" \fB\-X\fIve
-\fB\-W\fImeters_per_inch \fB\-Y\fIdisplay_stats \fB\-Z\fIdisplay_scales
-\fB\-V \-H\fP]
-
-.SH DESCRIPTION
-\fBmbps\fP is a utility to generate an (almost correct) perspective view
-of a piece of swath sonar data. It is especially useful to get a detailed
-view of the quality of the data (which is not very well assessed in a contour
-plot) and to make pretty pictures of features that fit within a swath.
-The output is PostScript code, that can be piped to a PostScript printer, or to a file.
-The options are a bit hard to interpret without a picture. Consider a
-frame of reference tied to the ship, with z upward, x across the track
-(port being negative, starboard positive) and y along the track. Using
-the \fB\-D\fP option, the data can be viewed from port, starboard,
-or from the back. In the first two cases, the y-axis is horizontal in
-the plot; in the third case, the x-axis is horizontal.  The angle \fIalpha\fP
-is the angle between the x-axis and the y-axis in the final view; \fIeta\fP is the angle of elevation of the observing point (90 degrees being the zenith).  The
-data points are plotted as triangular polygons with the vertices at three good (ie. unflagged) adjacent data points. A given point is adjacent to 8 points in the surrounding swath (top, bottom, 2 sides, and 4 corners).  Now that you are thoroughly
-confused, just try plotting a half-hour or so of data from your favorite
-place. The defaults are such that a decent plot should come out.
-The plot will be scaled automatically to fit on a page, and will contain vertical and horizontal scales, an arrow pointing in the direction of the ship's motion, coordinate axes, and miscellaneous
-information identifying the piece of data being plotted.
-Now change some of the options, and things should get clearer.
-
-.SH AUTHORSHIP
-Russ T. Alexander
-.br
-  Formerly at University of California at Santa Barbara
-.br
-Alberto Malinverno (now at Schlumberger)
-.br
-  Lamont-Doherty Earth Observatory
-
-.SH OPTIONS
-.TP
-.B \-A
-\fIalpha\fP
-.br
-Sets the angle alpha (degrees) between the y-axis (shiptrack direction) and
-the x-axis (across-track). Default = \fIalpha = 70.
-.TP
-.B \-B
-\fIyr/mo/da/hr/mn/sc\fP
-.br
-This option sets the starting time for data allowed in the input data.
-The \fB\-E\fP option sets the ending time for data. If the
-starting time is before the ending time, then any data
-with a time stamp before the starting time or after the
-ending time is ignored. If instead the starting time is
-after the ending time, then any data between the ending
-and starting time will be ignored. This scheme allows time
-windowing both inside and outside a specified interval.
-Default: \fIyr/mo/da/hr/mn/sc\fP = 1962/2/21/10/30/0.
-.TP
-.B \-D
-\fIview_direction\fP
-.br
-Sets the viewing direction; \fIviewdir\fP is a single character, either
-P/p (view from the port side), S/s (starboard), or B/b (back). Default
-\fIview_direction = S.
-.TP
-.B \-E
-\fIyr/mo/da/hr/mn/sc\fP
-.br
-This option sets the ending time for data allowed in the input data.
-The \fB\-B\fP option sets the starting time for data. If the
-starting time is before the ending time, then any data
-with a time stamp before the starting time or after the
-ending time is ignored. If instead the starting time is
-after the ending time, then any data between the ending
-and starting time will be ignored. This scheme allows time
-windowing both inside and outside a specified interval.
-Default: \fIyr/mo/da/hr/mn/sc\fP = 2062/2/21/10/30/0.
-.TP
-.B \-F
-\fIformat\fP
-.br
-Sets the format for the input swath sonar data using
-\fBMBIO\fP integer format identifiers.
-This program uses the \fBMBIO\fP library and will read any swath sonar
-format supported by \fBMBIO\fP. A list of the swath sonar data formats
-currently supported by \fBMBIO\fP and their identifier values
-is given in the \fBMBIO\fP manual page. Default: \fIformat\fP = 11.
-.TP
-.B \-G
-\fIgap\fP
-.br
-Sets the manner in which data gaps are displayed.  If \fIgap \fP= 1 then
-gaps are filled with black.  If \fIgap \fP= 0 then gaps are not filled and appear the same as the background color of the paper.
-Default: \fIgap \fP= 1.
-.TP
-.B \-H
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-.TP
-.B \-I
-\fIfilename\fP
-.br
-File from which the input data will be read. If
-no input file is specified, the input will be read
-from stdin. Default: \fIfilename\fP = stdin.
-.TP
-.B \-K
-\fIeta\fP
-.br
-Sets the angle eta (degrees) that is the elevation of the observer over
-the plane defined by the mean depth. Default \fIeta = 45.
-.TP
-.B \-N
-\fInpingsmax\fP
-.br
-Sets the maximum number of pings to be read and plotted.
-Default: \fInpingsmax\fP = 1000.
-.TP
-.B \-P
-\fIpings\fP
-.br
-Sets the ping averaging of the input data. If \fIpings\fP = 1, then
-no ping averaging is performed. If \fIpings\fP > 0, then
-that number of input pings will be averaged to produce one output
-ping.  If \fIpings\fP = 0, then the ping averaging will automatically
-be done so that the along-track ping spacing is equal to the across-track
-beam spacing.
-Default: \fIpings\fP = 1 (no ping averaging).
-.TP
-.B \-S
-\fIspeedmin\fP
-.br
-Sets the minimum speed in km/hr (5.5 kts ~ 10 km/hr) allowed in
-the input data; pings associated with a smaller ship speed will not be used. Default: \fIspeed\fP = 0.
-.TP
-.B \-T
-\fI"title"\fP
-.br
-Sets the title printed at the top of the plot.  The title should be enclosed within double quotes.  Default: no title.
-.TP
-.B \-V
-If the \fB\-V\fP flag is given, then \fBmbps\fP works in a "verbose" mode and
-outputs the program version being used and all read error status messages.
-.TP
-.B \-W
-\fImeters_per_inch\fP
-.br
-Sets the horizontal plotting scale.  Default: automatically calculates
-a scale such that the plot fits on a page.
-.TP
-.B \-X
-\fIve\fP
-.br
-Sets the vertical exaggeration. Default \fIve\fP = 5.
-.TP
-.B \-Y
-\fIdisplay_stats\fP
-.br
-Sets whether the final plot includes info such as mean latitude, mean longitude, mean heading, \fIalpha\fP, \fIeta\fP, \fIve\fP, scale, track length, begin time, and end time. if \fIdisplay_stats \fP= 1 then the above info is plotted; if \fIdispaly_stats \fP= 0 then it is not plotted.  Default: \fIdisplay_stats  \fP= 1.
-.TP
-.B \-Z
-\fIdisplay_scales\fP
-.br
-Sets whether the final plot includes a horizontal scale, a vertical scale, an arrow pointing in the ship heading direction, and coordinate axes.  if \fIdisplay_scales \fP= 1 then the above info is plotted; if \fIdispaly_scales \fP= 0 then it is not plotted.  Default: \fIdisplay_scales  \fP= 1.
-
-.SH EXAMPLES
-Suppose one wishes to take a look at data from a Hydrosweep file in
-L-DGO edmb format (data.edmb), starting at 09:00 and ending at
-10:30 on September 3, 1991. The following will output PostScript to a file called fred.
-
- 	mbps \-F22 \-Idata.edmb \-B1991/9/3/9/0/0 \-E1991/9/3/10/30/0 > fred
-
-.SH SEE ALSO
-\fBmbsystem\fP(1), \fBmbcontour\fP(1), \fBmbswath\fP(1)
-
-.SH BUGS
-\fBmbps\fP assumes that the ship was moving on a straight line. Weird
-plots will result if this is not the case.  \fBmbps \fPonly draws polygons bewteen 3 adjacent good points; if isolated points without 2 neighbors exist they will not be apparent in the final plot.  The filling of bad polygons is not perfect and gaps in the black fill, especially at the edges of swaths, may occur.
diff --git a/src/man/man1/mbrollbias.1 b/src/man/man1/mbrollbias.1
deleted file mode 100644
index 2b92d64..0000000
--- a/src/man/man1/mbrollbias.1
+++ /dev/null
@@ -1,149 +0,0 @@
-.TH mbrollbias 1 "3 June 2013" "MB-System 5.0" "MB-System 5.0"
-.SH NAME
-\fBmbrollbias\fP \- Assess roll bias of swath sonar sonar systems.
-
-.SH VERSION
-Version 5.0
-
-.SH SYNOPSIS
-\fBmbrollbias\fP \fB\-F\fIformat1/format2 \fB\-L\fIlonflip \fB\-I\fIfile1 \fB\-J\fIfile2 \fB\-R\fIwest/east/south/north [\fB\-D\fIxdim/ydim \fB\-H \-V\fI]
-
-.SH DESCRIPTION
-\fBmbrollbias\fP is a utility used to assess roll bias of swath sonar
-sonar systems using bathymetry data from two swaths covering the same
-seafloor in opposite directions. The program takes two input
-files and calculates best fitting planes for each dataset.
-The roll bias is calculated by solving for a common roll bias
-factor which explains the difference between the seafloor
-slopes observed on the two swaths.  This approach assumes that
-pitch bias is not a factor; this assumption is most correct when
-the heading of the two shiptracks are exactly opposite. The area is
-divided into a number of rectangular regions and calculations are done
-in each region containing a sufficient number of data from both
-swaths.  The data contained in the two datafiles should be processed to
-ensure that no artifacts will bias the roll bias calculations.
-Typically, this means using \fBmbclean\fP and or \fBmbedit\fP to
-remove noisy outer beams.
-A positive roll bias value means that the the vertical reference
-used by the swath sonar system is biased to starboard,
-giving rise to shallow bathymetry to port and deep bathymetry
-to starboard.  Results are written to stdout.
-
-.SH AUTHORSHIP
-David W. Caress (caress at mbari.org)
-.br
-  Monterey Bay Aquarium Research Institute
-.br
-Dale N. Chayes (dale at ldeo.columbia.edu)
-.br
-  Lamont-Doherty Earth Observatory
-
-.SH OPTIONS
-.TP
-.B \-F
-\fIformat1/format2\fP
-.br
-Sets the \fBMBIO\fP format identifiers for the first and
-second data files, respectively.
-This program uses the \fBMBIO\fP library and will read or write any swath sonar
-format supported by \fBMBIO\fP. A list of the swath sonar data formats
-currently supported by \fBMBIO\fP and their identifier values
-is given in the \fBMBIO\fP manual page.
-.TP
-.B \-D
-\fIxdim/ydim\fP
-.br
-The area specified using the \fB\-R\fP option is divided up into
-a grid of rectangular regions; roll bias calculations are done
-in each of these regions providing sufficient data is available
-from both data files.  This option sets the dimensions of the
-region grid.  Use \fIxdim\fP = \fIydim\fP = 1 to make one
-calculation for the entire area.
-Default:  \fIxdim\fP = \fIydim\fP = 1.
-.TP
-.B \-H
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-.TP
-.B \-I
-\fIfile1\fP
-.br
-Sets the filename of the first data file to be analyzed.
-.TP
-.B \-J
-\fIfile2\fP
-.br
-Sets the filename of the second data file to be analyzed.
-.TP
-.B \-L
-\fIlonflip\fP
-.br
-Sets the range of the longitude values returned.
-If \fIlonflip\fP=\-1 then the longitude values will be in
-the range from \-360 to 0 degrees. If \fIlonflip\fP=0
-then the longitude values will be in
-the range from \-180 to 180 degrees. If \fIlonflip\fP=1
-then the longitude values will be in
-the range from 0 to 360 degrees.
-Default: \fIlonflip\fP = 0.
-.TP
-.B \-R
-\fIwest/east/south/north\fP
-.br
-Sets the longitude and latitude bounds of the area of the roll bias test.
-.TP
-.B \-V
-The \fB\-V\fP option causes the program to print out the program name
-and version during execution.
-.SH EXAMPLE
-Suppose you want to calculate roll bias using two coincident swaths
-of Hydrosweep DS data collected in nearly opposite directions.
-Run \fBmbrollbias\fP as follows:
-
- 	mbrollbias \-R-51.07/-50.98/9.0166/9.117 \-D1/1 \-F22/22
- 		-Ihs_leg1_z.mb22 \-Jhs_leg2_z.mb22 \-V
-
-The output looks like:
-
- Program mbrollbias
- Version $Id: mbrollbias.1 2096 2013-06-04 08:17:22Z caress $
- MB-system Version 4.00
-
- mbrollbias Parameters:
- Input file 1:     hs_leg1_z.mb22
- Input file 2:     hs_leg2_z.mb22
- Region grid bounds:
-   Longitude:  \-51.0700  \-50.9800
-   Latitude:     9.0166    9.1170
- Region grid dimensions: 1 1
- Longitude interval: 0.090000 degrees or 9.894392 km
- Latitude interval:  0.100400 degrees or 11.104426 km
- Longitude flipping:   0
-
- 4840 depth points counted in hs_leg1_z.mb22
- 1733 depth points counted in hs_leg2_z.mb22
- 4840 depth points read from hs_leg1_z.mb22
- 1733 depth points read from hs_leg2_z.mb22
-
- Region 0 (0 0) bounds:
-     Longitude:  \-51.0700  \-50.9800
-     Latitude:     9.0166    9.1170
- First data file:    hs_leg1_z.mb22
-     Number of data: 4840
-     Mean heading:   107.845062
-     Plane fit:      4.759709 \-0.002327 \-0.004623
- Second data file:   hs_leg2_z.mb22
-     Number of data: 1733
-     Mean heading:   302.022793
-     Plane fit:      4.640304 0.008438 0.008494
- Roll bias:   \-0.007288 (-0.417598 degrees)
- Roll bias is positive to port, negative to starboard.
- A postive roll bias means the ship rolls to port,
-     giving rise to shallow bathymetry to port and
-     deep bathymetry to starboard.
-
-.SH SEE ALSO
-\fBmbsystem\fP(1)
-
-.SH BUGS
-Probably.
diff --git a/src/man/man1/mbrolltimelag.1 b/src/man/man1/mbrolltimelag.1
deleted file mode 100644
index b0f93b6..0000000
--- a/src/man/man1/mbrolltimelag.1
+++ /dev/null
@@ -1,199 +0,0 @@
-.TH mbrolltimelag 1 "3 June 2013" "MB-System 5.0" "MB-System 5.0"
-.SH NAME
-\fBmbrolltimelag\fP \- Calculates cross correlation between the apparent
-bottom slope in swath bathymetry data and the roll time series used by
-the sonar in order to assess attitude time lag problems.
-
-.SH VERSION
-Version 5.0
-
-.SH SYNOPSIS
-\fBmbrolltimelag\fP \fB\-I\fP\fIswathdata\fP [\fB\-F\fP\fIformat\fP
-\fB\-K\fP\fIrollsource\fP \fB\-N\fP\fInping\fP \fB\-O\fP\fIoutroot\fP \fB\-S\fP\fInavchannel\fP
-\fB\-T\fP\fInlag/lagmin/lagmax\fP \fB\-V \-H\fP ]
-.SH DESCRIPTION
-\fBMBrolltimelag\fP is an utility used to assess relative time errors,
-or time lag, between the ping timestamps of swath bathymetry data
-and the sonar attitude (roll and pitch) used in calculating
-the bathymetry. For any sonar ping, a roll error will cause
-the acrosstrack bathymetry profile to rotate vertically so that
-it is too shallow on one side of the swath and too deep on the other.
-Consequently, if no correction is made for the roll of the sonar, then the
-bathymetry data will appear to be ruffled in the outer swath.
-If the timestamps of the roll and ping data are consistent, then
-correcting for roll will produce bathymetry without these pronounced
-across-track artifacts. If, however, there is a lag between the two
-sets of time stamps, then the roll values used for correction will
-be incorrect, and the ruffles will still occur.
-
-In order to determine the amount of time lag, if any, associated
-with a swath bathymetry dataset, this program calculates the
-cross correlation between the roll signal and the apparent bottom
-slope in the case of no roll correction (in practice this latter
-value is found by subtracting the applied roll value from the
-apparent acrosstrack bottom slope). If the seafloor is planar so
-that the apparent slope signal is dominated by roll error, then
-there will be a distinct peak in the cross correlation function
-at the actual time lag.
-
-\fBMBrolltimelag\fP reads one or more swath sonar data files
-containing bathymetry data and calculates many cross correlation
-functions. The number of pings used for each calculation is
-specified with the \fB\-N\fP\fInping\fP option. The range of time
-lags used and the number of lag values are all specified using
-the \fB\-T\fP\fInlag/lagmin/lagmax\fP option. The cross correlation
-functions are output to a file named "swathdata_xcorr.txt", where
-\fIswathdata\fP is the input file or datalist specified with the
-\fB\-I\fP\fIswathdata\fP option. The macro \fBmbm_xyplot\fP is also
-called to generate a plot shellscript that, if run, will generate
-a postscript plot of the correlation functions.
-
-.SH AUTHORSHIP
-David W. Caress (caress at mbari.org)
-.br
-  Monterey Bay Aquarium Research Institute
-.br
-Dale N. Chayes (dale at ldeo.columbia.edu)
-.br
-  Lamont-Doherty Earth Observatory
-
-.SH OPTIONS
-.TP
-.B \-F
-\fIformat\fP
-.br
-Sets the \fBMBIO\fP integer format identifier
-for the input file specified with the
-\fB\-I\fP option. By default, \fBmbrolltimelag\fP
-infers the format from the "*.mbXX" \fBMB-System\fP suffix
-convention.
-.TP
-.B \-H
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-.TP
-.B \-I
-\fIfilename\fP
-.br
-Sets the input filename. If \fIformat\fP > 0 (set with the
-\fB\-F\fP option) then the swath sonar data contained in \fIinfile\fP
-is read and processed. If \fIformat\fP < 0, then \fIinfile\fP
-is assumed to be an ascii file containing a list of the input swath sonar
-data files to be processed and their formats.  The program will read
-and process the data in each one of these files. Each input file will
-have an associated output file with either the ".sga" or ".aga" suffix.
-In the \fIinfile\fP file, each
-data file should be followed by a data format identifier, e.g.:
- 	datafile1 11
- 	datafile2 24
-.br
-This program uses the \fBMBIO\fP library and will read any swath sonar
-format supported by \fBMBIO\fP. A list of the swath sonar data formats
-currently supported by \fBMBIO\fP and their identifier values
-is given in the \fBMBIO\fP manual page. Default: \fIinfile\fP = "datalist.mb-1".
-.TP
-.B \-K
-\fIKrollsource\fP
-.br
-This option sets the type of data record from which the roll values
-will be extracted. By default, the roll values are extracted from
-survey data records. If the \fB\-S\fP option is used, the roll data
-will be extracted from primary or ancilliary navigation records. If
-this \fB\-K\fP option is set, then the roll data will be extracted from
-data records of type \fIKrollsource\fP, where the possible values are listed
-here:
-     MB_DATA_DATA			1	/* general survey data */
-     MB_DATA_CALIBRATE		4	/* Hydrosweep DS */
-     MB_DATA_MEAN_VELOCITY	5	/* Hydrosweep DS */
-     MB_DATA_VELOCITY_PROFILE	6	/* general */
-     MB_DATA_NAV			12	/* Simrad, Reson 7k */
-     MB_DATA_HEADING		17	/* Simrad, Hypack */
-     MB_DATA_ATTITUDE		18	/* Simrad, Hypack, Reson 7k */
-     MB_DATA_SSV			19	/* Simrad */
-     MB_DATA_NAV1			28	/* ancillary nav system 1 */
-     MB_DATA_NAV2			29	/* ancillary nav system 2 */
-     MB_DATA_NAV3			30	/* ancillary nav system 3 */
-     MB_DATA_MOTION			32	/* Reson 7k */
-     MB_DATA_SIDESCAN2		37	/* Reson 7k, XTF */
-     MB_DATA_SIDESCAN3		38	/* Reson 7k, XTF */
-     MB_DATA_ROLL			40	/* Reson 7k */
-     MB_DATA_PITCH			41	/* Reson 7k */
-     MB_DATA_NMEA_RMC		48	/* NMEA */
-     MB_DATA_NMEA_DBT		49	/* NMEA */
-     MB_DATA_NMEA_DPT		50	/* NMEA */
-     MB_DATA_NMEA_ZDA		51	/* NMEA */
-     MB_DATA_NMEA_GLL		52	/* NMEA */
-     MB_DATA_NMEA_GGA		53	/* NMEA */
-     MB_DATA_ATTITUDE1		55	/* ancillary attitude system 1 */
-     MB_DATA_ATTITUDE2		56      /* ancillary attitude system 2 */
-     MB_DATA_ATTITUDE3		57	/* ancillary attitude system 3 */
-.br
-A typical value is \fIKrollsource\fP=18, which specifies extraction of roll from asynchronous attitude
-data records. This option supercedes the \fB\-S\fP option.
-.TP
-.B \-N
-\fInping\fP
-.br
-Sets the number of pings to be read for each cross correlation calculation.
-Default: \fInping\fP = 50.
-.TP
-.B \-O
-\fIoutroot\fP
-.br
-Sets the root of the output filenames.
-Default: output root is is the input filename minus any \fBMB-System\fP
-filename suffixe (e.g. the root derived from "datalistp.mb-1" will be
-"datalist").
-.TP
-.B \-S
-\fInavchannel\fP
-.br
-Sets \fBMBrolltimelag\fP to read the roll data from navigation records rather
-than the record type listed as the "navigation source" for a particular
-data format. Swath data formats may contain synchronous navigation
-(navigation is included in survey data records), asynchronous navigation
-(navigation comes in records separate from and at different times
-than the survey data records), or both (survey records contain merged
-navigation while the original asynchronous navigation is preserved in
-separate navigation records). Some data formats provide for multiple
-navigation sources, so that there are more than one channel of
-asynchronous data records. In this case one channel is always designated
-as the primary or active navigation channel. The \fB\-S\fP option allows
-the user to specify that \fBMBrolltimelag\fP uses roll from
-the primary asynchronous navigation (\fB\-N\fP\fI0\fP) or from one
-of three auxiliary navigation channels
-(\fB\-N\fP\fI1\fP, \fB\-N\fP\fI2\fP, or \fB\-N\fP\fI3\fP). If \fB\-N\fP is
-used but the data file
-does not contain asynchronous navigation or the specified auxiliary
-navigation channels, then \fBmbnavlist\fP will output nothing. To
-determine if a datafile contains asynchronous navigation and/or auxiliary
-navigation, run \fBmbinfo\fP using its \fB\-N\fP option to get counts
-of all data record types in the file.
-Default: \fInavchannel\fP = 1.
-.TP
-.B \-T
-\fInlag/lagmin/lagmax\fP
-.br
-Sets the time lag values used for the cross correlation calculations. A total
-of \fInlag\fP  cross correlation values will be calculated evenly spaced from
-\fIlagmin\fP seconds to \fIlagmax\fP seconds.
-Default: \fInlag\fP = 41, \fIlagmin\fP = \-2.0 seconds, \fIlagmax\fP = 2.0 seconds.
-.TP
-.B \-V
-The \fB\-V\fP option causes the program to be verbose.
-.SH EXAMPLE
-Suppose you want to evaluate the possible roll time lag in a collection
-of Reson 7125 files referenced by a datalist called datalistp.mb-1. The
-sonar was pinging at 2Hz (twice a second), and roll is available at 10 Hz
-in asynchronous navigation records that can be accessed with
-\fInavchannel\fP = 2. We choose to calculate the cross correlation with
-time lags separated by 0.1 seconds from \-2.0 to 2.0 seconds. The following
-will suffice:
-
- 	mbrolltimelag \-Idatalistp.mb-1 \-N41/-2.0/2.0 \-S2 \-V
-
-.SH SEE ALSO
-\fBmbsystem\fP(1)
-
-.SH BUGS
-Da.
diff --git a/src/man/man1/mbroutetime.1 b/src/man/man1/mbroutetime.1
deleted file mode 100644
index b65f626..0000000
--- a/src/man/man1/mbroutetime.1
+++ /dev/null
@@ -1,201 +0,0 @@
-.TH mbroutetime 1 "3 June 2013" "MB-System 5.0" "MB-System 5.0"
-.SH NAME
-\fBmbroutetime\fP \- Program to output a list of the times when a survey passes the waypoints
-of a planned survey route.
-
-.SH VERSION
-Version 5.0\fP
-
-.SH SYNOPSIS
-\fBmbroutetime\fP \fB\-Rroutefile [\fB\-F\fP\fIformat\fP \fB\-I\fP\fIfile\fP
-\fB\-O\fP\fIwaypointtimefile\fP \fB\-U\fP\fIrangethreshold\fP \fB\-H \-V\fP]
-
-.SH DESCRIPTION
-\fBmbroutetime\fP \-
-
-.SH AUTHORSHIP
-David W. Caress (caress at mbari.org)
-.br
-  Monterey Bay Aquarium Research Institute
-.br
-Dale N. Chayes (dale at ldeo.columbia.edu)
-.br
-  Lamont-Doherty Earth Observatory
-
-.SH OPTIONS
-.TP
-.B \-F
-\fIformat\fP
-.br
-Sets the format for the input swath data using
-\fBMBIO\fP integer format identifiers.
-This program uses the \fBMBIO\fP library and will read any swath
-format supported by \fBMBIO\fP. A list of the swath data formats
-currently supported by \fBMBIO\fP and their identifier values
-is given in the \fBMBIO\fP manual page. Default: \fIformat\fP = 11.
-.TP
-.B \-H
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-.TP
-.B \-I
-\fIfilename\fP
-.br
-Sets the input filename. If \fIformat\fP > 0 (set with the
-\fB\-F\fP option) then the swath data contained in \fIinfile\fP
-is read and processed. If \fIformat\fP < 0, then \fIinfile\fP
-is assumed to be an ascii file containing a list of the input swath
-data files to be processed and their formats.  The program will read
-the data in each one of these files.
-In the \fIinfile\fP file, each
-data file should be followed by a data format identifier, e.g.:
- 	datafile1 11
- 	datafile2 24
-.br
-This program uses the \fBMBIO\fP library and will read any swath
-format supported by \fBMBIO\fP. A list of the swath data formats
-currently supported by \fBMBIO\fP and their identifier values
-is given in the \fBMBIO\fP manual page.
-Default: \fIinfile\fP = "datalist.mb-1".
-.TP
-.B \-V
-The \fB\-V\fP option causes \fBmbroutetime\fP to print out status messages.
-
-.SH EXAMPLES
-Suppose you are going to run the MBARI Mapping AUV on the Coaxial Segment of the
-Juan de Fuca Ridge. You have created a route file called Coaxial2009_1v3.rte using
-\fBmbgrdviz\fP. In order to create an MBARI AUV mission script for mission beginning
-with a spiral descent to an altitude of 50 m, followed by a survey run at a 75 m altitude,
-the following will suffice:
- 	mbroutetime \-I Coaxial2009_1v3.rte \
- 		-A75/30/75 \-B1 \
- 		-G0 \-MSL \-N50 \-R220/83/0.3 \
- 		-O Coaxial2009_1v3.cfg \
- 		-S1.5 \-L30 \-W100 \-V
-.br
-The resulting mission script has the following header:
-
-     # This MBARI Mapping AUV mission file has been generated
-     # by the MB-System program mbroutetime run by
-     # user <caress> on cpu <shepard> at <Thu Jul 30 11:36:47 PDT 2009>
-     #
-     # Mission Summary:
-     #     Route File:               Coaxial2009_1v3.rte
-     #     Mission File:             Coaxial2009_1v3.cfg
-     #     Distance:                 79501.503455 (m)
-     #     Estimated Time:           57203 (s)  15.890 (hr)
-     #     Abort Time:               60067 (s)
-     #     Max battery life:         64800 (s)
-     #     Safety margin:            1800 (s)
-     #     Ascend time:              2932 (s)
-     #     Way Points:               44
-     #     Route Points:             550
-     #     Survey behavior:          WaypointDepth
-     #     Descent style:            Spiral descent
-     #     Mapping sonar control enabled:
-     #                               Multibeam enabled
-     #                                 Multibeam receive gain:           83
-     #                                 Multibeam transmit gain:          220
-     #                                 Multibeam minimum range fraction: 0.3
-     #                               Subbottom enabled
-     #                               Low sidescan enabled
-     #                               High sidescan disabled
-     #
-     # Mission Parameters:
-     #     Vehicle Speed:            1.500000 (m/s) 2.915769 (knots)
-     #     Desired Vehicle Altitude: 75 (m)
-     #     Minimum Vehicle Altitude: 75 (m)
-     #     Abort Vehicle Altitude:   30 (m)
-     #     Maximum Vehicle Depth:    2525.307922 (m)
-     #     Abort Vehicle Depth:      2562.807922 (m)
-     #     Descent Vehicle Depth:    3 (m)
-     #     Spiral descent depth:     2324.917643 m
-     #     Spiral descent altitude:  50 m
-     #     Forward Looking Distance:  (m)
-     #     Waypoint Spacing:         100 (m)
-     #     GPS Duration:             600 (s)
-     #     Descend Rate:             0.417 (m/s)
-     #     Ascend Rate:              1 (m/s)
-     #     Initial descend Duration: 300 (s)
-     #     Setpoint Duration:        30 (s)
-     #
-     # The primary waypoints from the route file are:
-     #   <number> <longitude (deg)> <latitude (deg)> <topography (m)> <distance (m)> <type>
-     #   0 \-129.588618 46.504590 \-2384.917643 0.000000 3
-     #   1 \-129.583151 46.507559 \-2412.977865 533.709482 3
-     #   2 \-129.569223 46.503420 \-2548.389974 1697.143568 1
-     #   3 \-129.566359 46.501080 \-2494.963053 2037.557099 3
-     #   4 \-129.548611 46.529852 \-2539.510864 5512.537193 4
-     #   5 \-129.551250 46.530628 \-2562.807922 5732.537193 3
-     #   6 \-129.568962 46.501924 \-2531.034424 9199.497998 4
-     #   7 \-129.571600 46.502699 \-2519.138489 9419.497998 3
-     #   8 \-129.553889 46.531404 \-2547.114624 12886.458803 4
-     #   9 \-129.556529 46.532180 \-2514.533569 13106.458803 3
-     #   10 \-129.574238 46.503475 \-2470.815735 16573.419607 4
-     #   11 \-129.576876 46.504250 \-2444.596313 16793.419607 3
-     #   12 \-129.559168 46.532956 \-2521.781921 20260.380412 4
-     #   13 \-129.561807 46.533732 \-2537.382141 20480.380412 3
-     #   14 \-129.579514 46.505026 \-2429.459961 23947.341216 4
-     #   15 \-129.582152 46.505801 \-2412.764343 24167.341217 3
-     #   16 \-129.564447 46.534508 \-2545.397705 27634.302021 4
-     #   17 \-129.567086 46.535284 \-2534.068665 27854.302021 3
-     #   18 \-129.584791 46.506576 \-2398.283020 31321.262826 4
-     #   19 \-129.587429 46.507352 \-2390.671509 31541.262826 3
-     #   20 \-129.569726 46.536059 \-2489.889282 35008.223630 4
-     #   21 \-129.572365 46.536835 \-2465.280823 35228.223630 3
-     #   22 \-129.590068 46.508127 \-2389.067017 38695.184435 4
-     #   23 \-129.592706 46.508902 \-2409.290771 38915.184435 3
-     #   24 \-129.575005 46.537610 \-2466.533142 42382.145240 4
-     #   25 \-129.577645 46.538386 \-2491.371094 42602.145240 3
-     #   26 \-129.595345 46.509677 \-2397.609253 46069.106044 4
-     #   27 \-129.597984 46.510452 \-2413.315918 46289.106044 3
-     #   28 \-129.580285 46.539161 \-2499.048889 49756.066849 4
-     #   29 \-129.582925 46.539937 \-2523.030640 49976.066849 3
-     #   30 \-129.600622 46.511227 \-2443.481018 53443.027653 4
-     #   31 \-129.603261 46.512002 \-2419.008240 53663.027653 3
-     #   32 \-129.585565 46.540712 \-2518.522400 57129.988458 4
-     #   33 \-129.588205 46.541487 \-2498.521301 57349.988458 3
-     #   34 \-129.605900 46.512777 \-2450.386536 60816.949263 4
-     #   35 \-129.608539 46.513552 \-2473.623230 61036.949263 3
-     #   36 \-129.590845 46.542262 \-2487.422180 64503.910067 4
-     #   37 \-129.593485 46.543038 \-2491.040466 64723.910067 3
-     #   38 \-129.611178 46.514327 \-2472.610657 68190.870872 3
-     #   39 \-129.606711 46.517999 \-2485.114583 68723.704236 3
-     #   40 \-129.557338 46.509809 \-2488.398743 72619.152031 3
-     #   41 \-129.550415 46.521262 \-2545.285828 73998.189601 3
-     #   42 \-129.600724 46.536447 \-2470.920736 78209.372536 3
-     #   43 \-129.606972 46.525648 \-2443.988281 79501.503455 4
-     #
-     # A total of 550 mission points have been defined.
-     #
-     # Define Mission parameters:
-     #define MISSION_SPEED      1.500000
-     #define MISSION_DISTANCE   79501.503455
-     #define MISSION_TIME       57203
-     #define MISSION_TIMEOUT    60067
-     #define DEPTH_MAX          2525.307922
-     #define DEPTH_ABORT        2562.807922
-     #define ALTITUDE_DESIRED   75.000000
-     #define ALTITUDE_MIN       75.000000
-     #define ALTITUDE_ABORT     30.000000
-     #define GPS_DURATION       600
-     #define DESCENT_DEPTH      3.000000
-     #define SPIRAL_DESCENT_DEPTH      2324.917643
-     #define SPIRAL_DESCENT_ALTITUDE   50.000000
-     #define DESCEND_DURATION   300
-     #define SETPOINT_DURATION  30
-     #define GPSMINHITS         10
-     #define ASCENDRUDDER       3.000000
-     #define ASCENDPITCH        45.000000
-     #define ASCENDENDDEPTH     2.000000
-     #define DESCENDRUDDER      3.000000
-     #define DESCENDPITCH       \-30.000000
-     #define MAXCROSSTRACKERROR 30
-     #define RESON_DURATION     6
-     #q
-
-.SH SEE ALSO
-\fBmbsystem\fP(1), \fBmbgrdviz\fP(1)
-
-.SH BUGS
-Perhaps.
diff --git a/src/man/man1/mbsegygrid.1 b/src/man/man1/mbsegygrid.1
deleted file mode 100644
index 268eb2d..0000000
--- a/src/man/man1/mbsegygrid.1
+++ /dev/null
@@ -1,335 +0,0 @@
-.TH mbsegygrid 1 "12 October 2013" "MB-System 5.0" "MB-System 5.0"
-.SH NAME
-\fBmbsegygrid\fP \- Generate time vs. trace number grids of seismic data from segy files.
-
-.SH VERSION
-Version 5.0
-
-.SH SYNOPSIS
-\fBmbsegygrid\fP \fB\-I\fIsegyfile\fP \fB\-O\fIgridfile\fP
-[\fB\-A\fIshotscale/timescale\fP \fB\-B\fImaxvalue/window\fP \fB\-D\fIdecimatex/decimatey\fP
-\fB\-G\fImode/gain[/window]\fP
-\fB\-S\fImode[/start/end[/schan/echan]]\fP \fB\-T\fIsweep[/delay]\fP
-\fB\-W\fImode/start/end\fP \fB\-H \fB\-V\fP]";
-
-.SH DESCRIPTION
-\fBMBsegygrid\fP generates grids of seismic data from segy files.
-The program works by inserting trace data into a grid in
-which the y-axis is some measure of trace number, range, or distance
-along a profile, and the y-axis is time. The output files are \fBGMT\fP netCDF
-format grid files.
-
-By default or with use of the \fB\-A\fP option, the x-dimension of
-the grid is determined by the number of traces specified
-by the \fB\-S\fP option and any decimation specified with option \fB\-D\fP.
-If the \fB\-R\fP option is used, then the profile will represent a line between
-specified start and end positions divided into binning cells according to a specified
-cell size, and the x-dimension of the grid will be the distance along the
-line (in meters) divided by the cell size and any decimation specified with
-option \fB\-D\fP.
-
-The y-dimension of the grid is determined by the sample spacing, any decimation
-specified with option \fB\-D\fP, and the time sweep specified by the  \fB\-T\fP
-option.
-
-If the \fB\-S\fP option is not specified, then all of the traces in the segy file
-will be gridded. If the time sweep and delay (if any) are not specified using
-the \fB\-T\fP option, then the sweep and delay will be set so that all trace samples
-are incorporated into the grid.
-
-A simple time-varying gain can be applied to the traces before gridding using
-the \fB\-G\fP option. The start time for the gain may be either the start
-of the trace or the seafloor arrival time.
-
-Simple time-domain low-pass filtering can be applied to the traces before
-gridding using the \fB\-F\fP option.
-
-Regions of the grid without data are indicated in the output by NaN values.
-
-.SH AUTHORSHIP
-David W. Caress (caress at mbari.org)
-.br
-  Monterey Bay Aquarium Research Institute
-.br
-Dale N. Chayes (dale at ldeo.columbia.edu)
-.br
-  Lamont-Doherty Earth Observatory
-
-.SH OPTIONS
-.TP
-.B \-A
-\fIshotscale/timescale\fP
-.br
-This option causes the x-axis to be rescaled from shot number to distance in meters
-and the y-axis to be rescaled from time in seconds to depth in meters.
-The \fIshotscale\fP value represents the shot spacing in meters and the
-\fItimescale\fP value is the scaling from time to depth (typically 750 m/s
-for the water column).
-.TP
-.B \-B
-\fImaxvalue[/window]\fP
-.br
-This option causes the application of automatic gain control (AGC). At each sample, a time interval
-\fIwindow\fP seconds long centered on the sample is considered. The sample value is multiplied
-by a scaling factor calculated as \fImaxvalue\fP divided by the maximum original value in the
-time interval. This approach can emphasize coherent arrivals regardless of amplitude level. If
-\fIwindow\fP is not specified, then the \fIwindow is taken to be the trace length in time so that
-the entire trace is normalized using the same scale factor, and all traces has the same maximum
-value of \fImaxvalue\fP.
-.TP
-.B \-D
-\fIdecimatex/decimatey\fP
-.br
-Sets the decimation of traces (\fIdecimatex\fP) and samples (\fIdecimatey\fP) used in
-generating the output grid. The downsampling of the data is actually accomplished by averaging
-the values within each grid bin rather than omitting traces or samples.
-.TP
-.B \-F
-\fImode/window\fP
-.br
-Sets the application of low-pass filtering to the trace data. The filtering is applied
-by convolving a filter function of length \fIwindow\fP seconds with the trace. Currently the only
-available filter is a cosine taper, set using \fImode\fP = 1.
-.TP
-.B \-G
-\fImode/gain[/window]\fP
-.br
-Sets the application of gain to the trace data. The \fImode\fP value determines how
-the gain is applied. If \fImode\fP = 0, no gain is applied.If \fImode\fP = 1,
-the gain is applied starting from the beginning of the trace. If  \fImode\fP = 2,
-the gain is applied starting at the seafloor (assuming that a seafloor pick has
-been defined in the segy data file). The \fIgain\fP value sets the gain applied
-as follows. If G = \fIgain\fP and t is the time in seconds since the start of
-gain application, then each sample is multiplied by a factor of (1 + (G * t)).
-The parameter \fIwindow\fP, if given, sets the length of the time interval
-in seconds that gain is applied. When the gain is windowed, trace values after
-the end of the gain window are zeroed.
-.TP
-.B \-H
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-.TP
-.B \-I
-\fIsegyfile\fP
-.br
-Sets the filename of the input segy seismic data file to be gridded.
-.TP
-.B \-O
-\fIgridfile\fP
-.br
-Sets the filename for the output GMT netCDF format grid.
-.TP
-.B \-R
-\fIcellsize/startlon/endlon/startlat/endlat\fP
-.br
-If the \fB\-R\fP option is used, then the profile will represent a line between
-start and end positions specified using longitude and latitude values in
-decimal degrees. This line segment is divided into binning cells according to
-\fIcellsize\fP in meters, and the x-dimension of the grid will be the distance along the
-line (in meters) divided by the cell size and any decimation specified with
-option \fB\-D\fP. Effectively, the location of each trace will be projected onto the line
-segment and the segment added to the appropriate cell. Where cells have multiple traces,
-the traces will be averaged.
-.TP
-.B \-S
-\fImode[/start/end[/schan/echan]]\fP
-.br
-This option sets the range of traces that are gridded, and thus determines
-the x-dimension of the output grid (also impacted by any decimation
-specified with \fB\-D\fP). If \fImode\fP = 0, then \fIstart\fP and \fIend\fP
-refer to shot numbers. This typically is useful for subbottom data or seismic
-data in shot gather form. If \fImode\fP = 1, then \fIstart\fP and \fIend\fP
-refer to CMP (or RP or CDP) numbers. This typically is useful for seismic
-reflection data in stacked or CMP gather forms. If the data are multichannel
-seismic reflection or seismic refraction in either shot or CMP gathers, the
-start and end of the channels selected for gridding is set using the optional \fIschan\fP
-and \fIechan\fP, respectively. The x-dimension of the output grid is determined by
-(\fIend\fP \- \fIstart\fP + 1) * (\fIechan\fP \- \fIschan\fP + 1) / \fIdecimatex\fP.
-.TP
-.B \-T
-\fIsweep[/delay]\fP
-.br
-Sets the time range of seismic data to be gridded. The \fIsweep\fP specifies
-the number of seconds of data comprising the y-axis of the grid. The number of
-samples follows from the sample interval of the data, and any decimation
-applied using \fB\-D\fP. The optional \fIdelay\fP value sets the sweep
-start time, again in seconds.
-The y-dimension of the output grid is determined by
-\fIsweep\fP / sampleinterval / \fIdecimatey\fP, where the sampleinterval is
-a parameter read with the seismic data.
-.TP
-.B \-V
-Normally, \fBmbsegygrid\fP prints out information regarding its
-controlling parameters during execution; the
-\fB\-V\fP option causes the program to also print out statements
-indicating its progress.
-.TP
-.B \-W
-\fImode/start/end\fP
-.br
-This option can be used to limit the data being gridded to a particular time
-window in various ways. This option does not impact the definition of the overall
-grid bounds, but does restrict the data gridded to samples within particular times
-of interest. If \fImode\fP = 1, then \fIstart\fP and \fIend\fP are simply start and end
-times of good data in seconds. If \fImode\fP = 2, then \fIstart\fP and \fIend\fP are relative to
-the time of the bottom return. In this case \fIstart\fP is often negative so that the
-grid shows data above the seafloor, and then down into the subsurface. Finally, if \fImode\fP = 3,
-then \fIstart\fP and \fIend\fP are relative to the time corresponding to the sonar
-depth.
-
-.SH EXAMPLES
-Suppose that we have a Reson 7k format file (format 88) called 20040722_152111.s7k
-that contains subbottom profiler data. Further suppose that we
-have used \fBmbextractsegy\fP to extract the subbottom profiler data
-into a segy format file called 20040722_152111.s7k.segy. \fBMBextractsegy\fP
-also generates a "sinf" file containing statistics about the data in the segy
-file. In this case, the contents of the sinf file 20040722_152111.s7k.segy.sinf are:
- 	SEGY Data File:      20040722_152111.s7k.segy
-
- 	File Header Info:
- 	  Channels:                          1
- 	  Auxiliary Channels:                0
- 	  Sample Interval (usec):           64
- 	  Number of Samples in Trace:     8330
- 	  Trace length (sec):         0.533120
- 	  Data Format:                IEEE 32 bit integer
- 	  CDP Fold:                          0
-
- 	Data Totals:
- 	  Number of Traces:               2527
- 	  Min Max Delta:
- 	    Shot number:                    56     2582     2527
- 	    Shot trace:                      1        1        1
- 	    RP number:                      56     2582     2527
- 	    RP trace:                        1        1        1
- 	    Delay (sec):              0.000000 0.000000 0.000000
- 	    Range (m):                0.000000 0.000000 0.000000
- 	    Receiver Elevation (m):   \-224.030000 \-2.860000 \-221.170000
- 	    Source Elevation (m):     \-224.030000 \-2.860000 \-221.170000
- 	    Source Depth (m):         2.860000 224.030000 \-221.170000
- 	    Receiver Water Depth (m): 51.510000 487.670000 \-436.160000
- 	    Source Water Depth (m):   51.510000 487.670000 \-436.160000
-
- 	Navigation Totals:
-
- 	  Start of Data:
- 	    Time:  07 22 2004 15:20:37.029000  JD204
- 	    Lon: \-121.8573     Lat:   36.7755
-
- 	  End of Data:
- 	    Time:  07 22 2004 15:44:15.438000  JD204
- 	    Lon: \-121.8572     Lat:   36.7952
-
- 	Limits:
- 	  Minimum Longitude:    \-121.8574   Maximum Longitude:    \-121.8572
- 	  Minimum Latitude:       36.7755   Maximum Latitude:       36.7952
-
-In order to generate a time vs. trace number grid of all traces in the
-segy file, with a column for each trace and a row for each time sample,
-one can simply invoke \fBmbsegygrid\fP without specifying a range of
-desired traces or the desired time sweep. The program automatically sizes
-the grid to include all traces and samples, taking into account trace start
-delays if necessary. The root of the output grid filename is specified with
-the \fB\-O\fP option; if "SubbottomGrid" is specified then the output
-grid will be named SubbottomGrid.grd. The command is:
- 	mbsegygrid \-I 20040722_152111.s7k.segy \
- 		-O SubbottomGrid
-.br
-and the output to the terminal looks like:
-
- 	MBsegygrid Parameters:
- 	Input segy file:         20040722_152111.s7k.segy
- 	Output fileroot:         SubbottomGrid
- 	Input Parameters:
- 	     trace mode:         1
- 	     trace start:        56
- 	     trace end:          2582
- 	     channel start:      1
- 	     channel end:        1
- 	     trace decimation:   1
- 	     time sweep:         0.533120 seconds
- 	     time delay:         0.000000 seconds
- 	     sample interval:    0.000064 seconds
- 	     sample decimation:  1
- 	     window mode:        0
- 	     window start:       0.000000 seconds
- 	     window end:         0.000000 seconds
- 	     gain mode:          0
- 	     gain:               0.000000
- 	Output Parameters:
- 	     grid filename:      SubbottomGrid.grd
- 	     x grid dimension:   2527
- 	     y grid dimension:   8331
- 	     grid xmin:          55.500000
- 	     grid xmax:          2582.500000
- 	     grid ymin:          \-0.533152
- 	     grid ymax:          0.000032
- 	     NaN values used to flag regions with no data
- 	PROCESS read:0 position:0 rp:56 channel:1 2004/204 15:20:37.029 samples:8330 interval:64 usec minmax: 0.000000 2425.784912
- 	PROCESS read:25 position:25 rp:81 channel:1 2004/204 15:20:51.068 samples:8330 interval:64 usec minmax: 0.000000 3832.087402
- 	PROCESS read:50 position:50 rp:106 channel:1 2004/204 15:21:05.106 samples:8330 interval:64 usec minmax: 0.000000 1590.149658
- 	....................
- 	PROCESS read:2475 position:2475 rp:2531 channel:1 2004/204 15:43:46.800 samples:8330 interval:64 usec minmax: 0.000000 991.466064
- 	PROCESS read:2500 position:2500 rp:2556 channel:1 2004/204 15:44:00.838 samples:8330 interval:64 usec minmax: 0.000000 838.286926
- 	PROCESS read:2525 position:2525 rp:2581 channel:1 2004/204 15:44:14.877 samples:8330 interval:64 usec minmax: 0.000000 985.870667
-
- 	--------------
-
- 	Plot generation shellscript <SubbottomGrid.grd.cmd> created.
-
- 	Instructions:
- 	  Execute <SubbottomGrid.grd.cmd> to generate Postscript plot <SubbottomGrid.grd.ps>.
- 	  Executing <SubbottomGrid.grd.cmd> also invokes gv to view the plot on the screen.
-
- 	--------------
-
-The size of the the output grid can be checked using the \fBGMT\fP program
-\fBgrdinfo\fP. The results of the command:
- 	grdinfo SubbottomGrid.grd
-.br
-look like:
- 	SubbottomGrid.grd: Title: Seismic Grid from 20040722_152111.s7k.segy
- 	SubbottomGrid.grd: Command:
- 	SubbottomGrid.grd: Remark:
- 	        Projection: SeismicProfile
- 	        Grid created by MBsegygrid
- 	        MB-system Version 5.0.4
- 	        Run by <caress> on <hess> at <Thu Sep 23 16:24:39 2004>
- 	SubbottomGrid.grd: Pixel node registration used
- 	SubbottomGrid.grd: grdfile format # 0
- 	SubbottomGrid.grd: x_min: 55.5 x_max: 2582.5 x_inc: 1 units: Trace Number nx: 2527
- 	SubbottomGrid.grd: y_min: \-0.533152 y_max: 3.2e-05 y_inc: 6.4e-05 units: Time (seconds) ny: 8331
- 	SubbottomGrid.grd: z_min: 0 z_max: 2623.34 units: Trace Signal
- 	SubbottomGrid.grd: scale_factor: 1 add_offset: 0
-
-\fBMBsegygrid\fP also uses the macro \fBmbm_grdplot\fP to generate a shellscript
-called SubbottomGrid.grd.cmd that, when executed, will use \fBGMT\fP commands
-to generate a Postscript plot of the grid.
-
-In order to generate a grid of a subset of the subbottom data (for instance,
-shots 1500 \- 2000 and the time sweep from 0.25 to 0.35 seconds), use the \fB\-S\fP
-and \fB\-T\fP options:
- 	mbsegygrid \-I 20040722_152111.s7k.segy \
- 		-O SubbottomGrid2 \
- 		-S0/1500/2000 \-T0.1/0.25
-.br
-This time the \fBgrdinfo\fP output looks like:
- 	SubbottomGrid2.grd: Title: Seismic Grid from 20040722_152111.s7k.segy
- 	SubbottomGrid2.grd: Command:
- 	SubbottomGrid2.grd: Remark:
- 	        Projection: SeismicProfile
- 	        Grid created by MBsegygrid
- 	        MB-system Version 5.0.4
- 	        Run by <caress> on <hess> at <Thu Sep 23 16:40:34 2004>
- 	SubbottomGrid2.grd: Pixel node registration used
- 	SubbottomGrid2.grd: grdfile format # 0
- 	SubbottomGrid2.grd: x_min: 1499.5 x_max: 2000.5 x_inc: 1 units: Trace Number nx: 501
- 	SubbottomGrid2.grd: y_min: \-0.35 y_max: \-0.249968 y_inc: 6.4e-05 units: Time (seconds) ny: 1563
- 	SubbottomGrid2.grd: z_min: 0 z_max: 558.42 units: Trace Signal
- 	SubbottomGrid2.grd: scale_factor: 1 add_offset: 0
-
-.SH SEE ALSO
-\fBmbsystem\fP(1), \fBmbm_grdplot\fP(1), \fBmbmosaic\fP(1), \fBmbm_grid\fP(1)
-
-.SH BUGS
-This tool isn't close to being complete...
diff --git a/src/man/man1/mbsegyinfo.1 b/src/man/man1/mbsegyinfo.1
deleted file mode 100644
index 4318b04..0000000
--- a/src/man/man1/mbsegyinfo.1
+++ /dev/null
@@ -1,124 +0,0 @@
-.TH mbsegyinfo 1 "3 June 2013" "MB-System 5.0" "MB-System 5.0"
-.SH NAME
-\fBmbsegyinfo\fP \- Output some basic statistics of segy format seismic data files.
-
-.SH VERSION
-Version 5.0
-
-.SH SYNOPSIS
-\fBmbsegyinfo\fP [\fB\-I\fIfilename\fP \fB\-L\fIlonflip\fP \fB\-O\fP \fB\-H \-V\fP]
-
-.SH DESCRIPTION
-\fBMBsegyinfo\fP is a utility for reading a segy format seismic data file
-or files and outputting some basic statistics.  The table generated
-shows the filename, data counts, navigation totals, time and navigation
-of the first and last data records, minimum and maximum
-data values, and the geographic bounding box of the data.
-
-An important function  of \fBmbsegyinfo\fP is to generate segy
-information, or ".sinf"
-files, that may be parsed by other \fBMB-System\fP programs
-and macros. To create an ".sinf" file, simply direct the
-output of \fBmbsegyinfo\fP to a file named by adding the
-suffix ".sinf" to the input swath data filename. The
-\fB\-O\fP option accomplishes this same task
-automatically.
-
-.SH AUTHORSHIP
-David W. Caress (caress at mbari.org)
-.br
-  Monterey Bay Aquarium Research Institute
-.br
-Dale N. Chayes (dale at ldeo.columbia.edu)
-.br
-  Lamont-Doherty Earth Observatory
-
-.SH OPTIONS
-.TP
-.B \-H
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-.TP
-.B \-I
-\fIfilename\fP
-.br
-Sets the input segy seismic data filename. Default: \fIinfile\fP = "stdin".
-.TP
-.B \-L
-\fIlonflip\fP
-.br
-Sets the range of the longitude values returned.
-If \fIlonflip\fP=\-1 then the longitude values will be in
-the range from \-360 to 0 degrees. If \fIlonflip\fP=0
-then the longitude values will be in
-the range from \-180 to 180 degrees. If \fIlonflip\fP=1
-then the longitude values will be in
-the range from 0 to 360 degrees.
-Default: \fBmbsegyinfo selects the bext longitude range based
-on the first data.
-.TP
-.B \-O
-.br
-This option causes the program output to be directed to
-".sinf" files rather than to stdout. Each ".sinf" file is named
-using the original data file path with an ".sinf" suffix appended.
-.TP
-.B \-V
-Normally, \fBmbsegyinfo\fP only prints out the statistics obtained
-by reading all of the data.  If the
-\fB\-V\fP flag is given, then \fBmbsegyinfo\fP works in a "verbose" mode and
-outputs the program version being used and all read error status messages.
-
-.SH EXAMPLES
-Suppose one wishes to know something about the contents of
-a segy subbottom profiler data file named 20040722_152111.s7k.segy.
-The following will suffice:
- 	mbsegyinfo \-I 20040722_152111.s7k.segy
-.br
-and returns the following output:
- 	SEGY Data File:      20040722_152111.s7k.segy
-
- 	File Header Info:
- 	  Channels:                          1
- 	  Auxiliary Channels:                0
- 	  Sample Interval (usec):           64
- 	  Number of Samples in Trace:     8330
-          Trace length (sec):         0.533120
- 	  Data Format:                IEEE 32 bit integer
- 	  CDP Fold:                          0
-
- 	Data Totals:
- 	  Number of Traces:               2527
- 	  Min Max Delta:
- 	    Shot number:                    56     2582     2527
- 	    Shot trace:                      1        1        1
- 	    RP number:                      56     2582     2527
- 	    RP trace:                        1        1        1
-            Delay (sec):              0.000000 0.000000 0.000000
- 	    Range (m):                0.000000 0.000000 0.000000
- 	    Receiver Elevation (m):   \-224.030000 \-2.860000 \-221.170000
- 	    Source Elevation (m):     \-224.030000 \-2.860000 \-221.170000
- 	    Source Depth (m):         2.860000 224.030000 \-221.170000
- 	    Receiver Water Depth (m): 51.510000 487.670000 \-436.160000
- 	    Source Water Depth (m):   51.510000 487.670000 \-436.160000
-
- 	Navigation Totals:
-
- 	  Start of Data:
- 	    Time:  07 22 2004 15:20:37.029000  JD204
- 	    Lon: \-121.8573     Lat:   36.7755
-
- 	  End of Data:
- 	    Time:  07 22 2004 15:44:15.438000  JD204
- 	    Lon: \-121.8572     Lat:   36.7952
-
- 	Limits:
- 	  Minimum Longitude:    \-121.8574   Maximum Longitude:    \-121.8572
- 	  Minimum Latitude:       36.7755   Maximum Latitude:       36.7952
-
-.SH SEE ALSO
-\fBmbsystem\fP(1), \fBmbextractsegy\fP(1), \fBmbsegylist\fP(1), \fBmbsegygrid\fP(1),
-\fBSIOSEIS\fP(http://sioseis.ucsd.edu/ )
-
-.SH BUGS
-Maybe. Depends on who's asking...
diff --git a/src/man/man1/mbsegylist.1 b/src/man/man1/mbsegylist.1
deleted file mode 100644
index b630fa9..0000000
--- a/src/man/man1/mbsegylist.1
+++ /dev/null
@@ -1,218 +0,0 @@
-.TH mbsegylist 1 "3 June 2013" "MB-System 5.0" "MB-System 5.0"
-.SH NAME
-\fBmbsegylist\fP \- List selected header values in segy format seismic data files.
-
-.SH VERSION
-Version 5.0
-
-.SH SYNOPSIS
-\fBmbsegylist\fP [\fB\-A\fP \fB\-D\fP\fIdecimate\fP
-\fB\-H\fP \fB\-G\fP\fIdelimeter\fP \fB\-I\fP\fIinfilename\fP
-\fB\-L\fP\fIlonflip\fP \fB\-O\fP\fIoutput_format\fP
-\fB\-U\fP\fIcheck\fP \fB\-V\fP \fB\-Z\fP\fIsegment\fP]
-
-.SH DESCRIPTION
-\fBMBsegylist\fP is a utility to output specified header values
-from segy seismic data files to stdout. The
-option \fB\-O\fP\fIoutput_format\fP is
-used to control the type and order of values output.
-By default, \fBmbsegylist\fP  produces ASCII files in
-spreadsheet style, with data columns separated by tabs. Alternatively,
-the output can be binary, with each field represented
-as a double precision float (\fB\-A\fP option).
-
-.SH AUTHORSHIP
-David W. Caress (caress at mbari.org)
-.br
-  Monterey Bay Aquarium Research Institute
-.br
-Dale N. Chayes (dale at ldeo.columbia.edu)
-.br
-  Lamont-Doherty Earth Observatory
-
-.SH OPTIONS
-.TP
-.B \-A
-.br
-Causes the output to be binary (native double precision floating
-point) rather than ASCII. Some
-output options cannot be represented as single binary floats (e.g.
-time strings and longitude or latitude broken into degrees
-and minutes. These values are output as multiple fields as
-appropriate.
-Default: ASCII output with fields separated by tabs.
-.TP
-.B \-D
-\fIdecimate\fP
-.br
-Sets the decimation of the output data. By default (i.e. \fIdecimate\fP=1),
-every available data record is output. If \fIdecimate\fP>1, then only
-every "\fIdecimate\fP"th record will be output. Default: \fIdecimate\fP=1.
-.TP
-.B \-G
-\fIdelimiter\fP
-.br
-Sets the character(s) used to separate output fields when ascii
-columns are output. Default: tabs are used as delimiters.
-.TP
-.B \-H
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-.TP
-.B \-I
-\fIfilename\fP
-.br
-Sets the filename of the input segy seismic data file.
-.TP
-.B \-L
-\fIlonflip\fP
-.br
-Sets the range of the longitude values returned.
-If \fIlonflip\fP=\-1 then the longitude values will be in
-the range from \-360 to 0 degrees. If \fIlonflip\fP=0
-then the longitude values will be in
-the range from \-180 to 180 degrees. If \fIlonflip\fP=1
-then the longitude values will be in
-the range from 0 to 360 degrees.
-Default: \fIlonflip\fP = 0.
-.TP
-.B \-O
-\fIoutput_format\fP
-.br
-Determines the form of the output; \fIoutput_format\fP is a string composed
-of one or more of the following characters:
-.IP
-\fB/\fP
-special character: this causes the value
-indicated by the next character to be  inverted. This applies only to simple
-numeric values such as depth and
-heading and not to values like time
-strings orpositions with hemisphere
-characters.
-.IP
-\fB\-\fP
-special character: this causes the value
-indicated by the next character to be
-multiplied by \-1. This applies only
-to simple numeric values such as
-depth and heading and not to values
-like time strings or positions with
-hemisphere characters.
-.IP
-\fBC\fP
-for CMP (or RP or CDP) gather number of a trace
-.IP
-\fBc\fP
-for trace number within a CMP (or RP or CDP) gather
-.IP
-\fBD\fP
-for trace start delay (seconds)
-.IP
-\fBI\fP
-for sample length (seconds)
-.IP
-\fBi\fP
-for time interval since last trace (seconds)
-.IP
-\fBJ\fP
-for a time string (yyyy jd hh mm ss.ssssss)
-where jd is the day of the year
-.IP
-\fBj\fP
-for a time string (yyyy jd dm ss.ssssss)
-where jd is the day of the year
-and dm is the minute of the day
-.IP
-\fBL\fP
-for trace length (seconds)
-.IP
-\fBM\fP
-for unix (epoch) time in decimal seconds since 1/1/70 00:00:00
-.IP
-\fBm\fP
-for time in decimal seconds since first record
-.IP
-\fBN\fP
-for number of samples in the trace
-.IP
-\fBn\fP
-for trace counter (starts from 0)
-.IP
-\fBR\fP  for range from source to receiver (m)
-.IP
-\fBS\fP  for shot number
-.IP
-\fBs\fP  for trace number within a shot gather
-.IP
-\fBT\fP  for a time string (yyyy/mm/dd/hh/mm/ss)
-.IP
-\fBt\fP  for a time string (yyyy mm dd hh mm ss)
-.IP
-\fBU\fP  for unix time in integer seconds since 1/1/70 00:00:00
-.IP
-\fBu\fP  for time in integer seconds since first record
-.IP
-\fBV\fP  for shot or ping interval (decimal seconds)
-.IP
-\fBX\fP  for longitude (decimal degrees)
-.IP
-\fBx\fP  for longitude (degrees + decimal minutes + E/W)
-.IP
-\fBY\fP  for latitude (decimal degrees)
-.IP
-\fBy\fP  for latitude (degrees + decimal minutes + N/S)
-.IP
-\fBZ\fP  for source or sonar depth (positive downwards) (m)
-.IP
-\fBz\fP  for depth (positive downwards) (m)
-.br
-
-Default \fIoutput_format\fP = \fBTiXYSsCcDINL\fP
-(time, time interval, lon, lat, shot, shot trace #, cmp, cmp trace #,
-delay, sample length, number samples, trace length)
-.TP
-.B \-V
-Normally, \fBmbsegylist\fP works "silently" without outputting
-anything to the stderr stream.  If the
-\fB\-V\fP flag is given, then \fBmbsegylist\fP works in a "verbose" mode and
-outputs the program version being used and all error status messages.
-.TP
-.B \-Z
-\fIsegment\fP
-.br
-Causes the ascii output of different input segy files
-(e.g. when a datalist is specified with the \fB\-I\fP option)
-to be separated by lines with \fIsegment\fP. If \fIsegment\fP
-is a single character, then the output is a multiple segment
-file of the sort accepted by the \fBGMT\fP program \fBpsxy\fP.
-This option only works with ascii output, and is thus disabled
-when the \fB\-A\fP option is specified. The most common usage
-is \fB\-Z\fP\I>\fP.
-
-.SH EXAMPLES
-Suppose one has a subbottom profiler segy data file called
-20040722_152111.s7k.segy.
-
-In order to obtain a listing of the shot number, time tag, and position
-of the traces in the file, use \fBmbsegylist\fP as follows:
- 	mbsegylist \-I 20040722_152111.s7k.segy \-OSTXY
-
-The output will be as follows:
-
-    56  2004/07/22/15/20/37.029000      \-121.857289       36.775508
-    57  2004/07/22/15/20/37.590000      \-121.857289       36.775514
-    58  2004/07/22/15/20/38.152000      \-121.857289       36.775519
-    59  2004/07/22/15/20/38.713000      \-121.857289       36.775525
-    60  2004/07/22/15/20/39.275000      \-121.857289       36.775531
-    61  2004/07/22/15/20/39.837000      \-121.857289       36.775536
-    62  2004/07/22/15/20/40.398000      \-121.857289       36.775542
-    63  2004/07/22/15/20/40.960000      \-121.857289       36.775547
-    64  2004/07/22/15/20/41.521000      \-121.857289       36.775553
-  	.....
-
-.SH SEE ALSO
-\fBmbsystem\fP(1), \fBmbextractsegy\fP(1), \fBmbsegyinfo\fP(1), \fBmbsegygrid\fP(1),
-\fBSIOSEIS\fP(http://sioseis.ucsd.edu/ )
-
-.SH BUGS
-Si. Oui. Ya. Da. Yes. Mess.
diff --git a/src/man/man1/mbsegypsd.1 b/src/man/man1/mbsegypsd.1
deleted file mode 100644
index 06ad90d..0000000
--- a/src/man/man1/mbsegypsd.1
+++ /dev/null
@@ -1,227 +0,0 @@
-.TH mbsegypsd 1 "3 June 2013" "MB-System 5.0" "MB-System 5.0"
-.SH NAME
-\fBmbsegypsd\fP \- Calculates the power spectral densisty function (PSD) of each trace in a
-segy file, outputting the PSD estimates as a GMT grid file with trace number along
-the x axis and frequency along the y axis.
-
-.SH VERSION
-Version 5.0
-
-.SH SYNOPSIS
-\fBmbsegypsd\fP \fB\-I\fIfile\fP \fB\-O\fIroot
-[\fB\-A\fIshotscale\fP \fB\-D\fIdecimatex\fP \fB\-R\fP
-\fB\-S\fImode[/start/end[/schan/echan]]\fP \fB\-T\fIsweep[/delay]\fP
-\fB\-W\fImode/start/end\fP \fB\-H\fP \fB\-V\fP]";
-
-.SH DESCRIPTION
-\fBmbsegypsd\fP calculates the power spectral densisty function (PSD) of each
-trace in a segy file, outputting the PSD estimates as a grid with
-trace number along the x axis and frequency along the y axis.
-The output files are \fBGMT\fP netCDF format grid files.
-
-The x-dimension of the grid is determined by the number of traces specified
-by the \fB\-S\fP option and any decimation specified with option \fB\-D\fP.
-If the \fB\-S\fP option is not specified, then all of the traces in the segy file
-will be processed. If the time sweep and delay (if any) are not specified using
-the \fB\-T\fP option, then the sweep and delay will be set so that all trace samples
-are incorporated into the grid.
-
-The y-dimension of the grid is determined by the sample interval in the time series
-data. The frequency range runs from zero Hz to a maximum frequency given
-in Hz by 1/(2*sampleinterval), where the sampleinterval is in seconds. So,
-for instance, hydrophone data sampled at 26 kHz (26000 samples/second) will
-have a sample interval of (1/26000 = 0.00003846 seconds). In this case, the
-PSD will be calculated for frequencies ranging from 0 Hz to 13000 Hz (13 kHz).
-
-For each trace, the PSD will be calculated by ensemble averaging, which means that
-the trace will be broken up into a number of segments of length \fInfft\fP (specified
-with the \fB\-N\fP option, default = 1024), a fast-Fourier-transform (FFT) will be
-calculated for each segment, and the PSD estimate will be the average of
-the FFT magnitudes over all segments. Before the FFT is calculated, each segment
-is multiplied by a Hanning (cosine) taper; the PSD estimates are normalized to
-account for the loss of signal due to the taper application.
-
-The output grid can be either in linear units (Intensity/Hz) or in log-scaled dB/Hz
-calculated as 20 * log10 (raw-PSD-value). The default is the former, and the
-\fB\-L\fP option causes output in the dB/Hz form.
-
-A shellscript invoking \fBGMT\fP programs to plot the PSD grid is automatically
-generated.
-
-.SH AUTHORSHIP
-David W. Caress (caress at mbari.org)
-.br
-  Monterey Bay Aquarium Research Institute
-.br
-Dale N. Chayes (dale at ldeo.columbia.edu)
-.br
-  Lamont-Doherty Earth Observatory
-
-.SH OPTIONS
-.TP
-.B \-A
-\fIshotscale\fP
-.br
-This option causes the x-axis to be rescaled from shot number to distance in meters.
-The \fIshotscale\fP value represents the shot spacing in meters.
-.TP
-.B \-D
-\fIdecimatex\fP
-.br
-Sets the decimation of traces (\fIdecimatex\fP) used in generating the output grid.
-.TP
-.B \-H
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-.TP
-.B \-I
-\fIsegyfile\fP
-.br
-Sets the filename of the input segy seismic data file to be gridded.
-.TP
-.B \-L
-.br
-Sets the PSD grid output to be in dB/Hz.
-.TP
-.B \-O
-\fIroot\fP
-.br
-Sets the filename root for the output GMT netCDF format grid.
-.TP
-.B \-S
-\fImode[/start/end[/schan/echan]]\fP
-.br
-This option sets the range of traces that are gridded, and thus determines
-the x-dimension of the output grid (also impacted by any decimation
-specified with \fB\-D\fP). If \fImode\fP = 0, then \fIstart\fP and \fIend\fP
-refer to shot numbers. This typically is useful for subbottom data or seismic
-data in shot gather form. If \fImode\fP = 1, then \fIstart\fP and \fIend\fP
-refer to CMP (or RP or CDP) numbers. This typically is useful for seismic
-reflection data in stacked or CMP gather forms. If the data are multichannel
-seismic reflection or seismic refraction in either shot or CMP gathers, the
-start and end of the channels selected for gridding is set using the optional \fIschan\fP
-and \fIechan\fP, respectively. The x-dimension of the output grid is determined by
-(\fIend\fP \- \fIstart\fP + 1) * (\fIechan\fP \- \fIschan\fP + 1) / \fIdecimatex\fP.
-.TP
-.B \-T
-\fIsweep[/delay]\fP
-.br
-The \fIsweep\fP value sets the time range of seismic data to be processed in seconds.
-The optional \fIdelay\fP value sets the sweep start time, again in seconds.
-.TP
-.B \-V
-Normally, \fBmbsegypsd\fP prints out information regarding its
-controlling parameters during execution; the
-\fB\-V\fP option causes the program to also print out statements
-indicating its progress.
-.TP
-.B \-W
-\fImode/start/end\fP
-.br
-This option can be used to limit the data being processed to a particular time
-window in various ways. This option does not impact the definition of the overall
-grid bounds, but does restrict the data processed to samples within particular times
-of interest. If \fImode\fP = 1, then \fIstart\fP and \fIend\fP are simply start and end
-times of good data in seconds. If \fImode\fP = 2, then \fIstart\fP and \fIend\fP are relative to
-the time of the bottom return. In this case \fIstart\fP is often negative so that the
-grid shows data above the seafloor, and then down into the subsurface. Finally, if \fImode\fP = 3,
-then \fIstart\fP and \fIend\fP are relative to the time corresponding to the sonar
-depth.
-
-.SH EXAMPLES
-Suppose that one has a segy file of hydrophone data sampled at a
-37 microsecond interval, corresponding to a 27027 Hz sampling rate.
-Each of 1610 traces consists of 64865 samples. In order to create a
-sonogram displaying the power spectral density as a function of
-time, execute mbsegypsd as follows:
-.br
- 	mbsegypsd \-I 20090922_1833_V3422_S7_CH025ms.segy \-N1024 \-L \-O testpsd \-V
-.br
-Here the \fB\-N\fP option sets the FFT dimension used to be 1024 samples, which
-means that the PSD estimate for each trace is the average of 64865 / 1024 = 63
-calculations. The shell output of the program is:
-.br
- 	Program mbsegypsd
- 	Version $Id: mbsegypsd.1 2096 2013-06-04 08:17:22Z caress $
- 	MB-system Version 5.1.2beta12
-
- 	MBsegypsd Parameters:
- 	Input segy file:         20090922_1833_V3422_S7_CH025ms.segy
- 	Output fileroot:         testpsd
- 	Input Parameters:
- 	     trace mode:         0
- 	     trace start:        0
- 	     trace end:          1609
- 	     channel start:      1
- 	     channel end:        1
- 	     trace decimation:   1
- 	     time sweep:         2.399968 seconds
- 	     time delay:         0.000000 seconds
- 	     sample interval:    0.000037 seconds
- 	     window mode:        0
- 	     window start:       0.000000 seconds
- 	     window end:         0.000000 seconds
- 	Output Parameters:
- 	     grid filename:      testpsd.grd
- 	     psd filename:       testpsd_psd.txt
- 	     x grid dimension:   1610
- 	     y grid dimension:   513
- 	     grid xmin:          \-0.500000
- 	     grid xmax:          1609.500000
- 	     grid ymin:          \-13.171066
- 	     grid ymax:          13500.342448
- 	     NaN values used to flag regions with no data
- 	     shotscale:          1.000000
- 	     frequencyscale:     1.000000
-
- 	PROCESS read:0 position:0 shot:0 channel:1 2009/265 18:32:59.000 samples:64864 interval:37 usec minmax: \-102498.789062 \-187.008667
- 	PROCESS read:25 position:25 shot:25 channel:1 2009/265 18:34:14.000 samples:64864 interval:37 usec minmax: \-201902.890625 9166.462891
- 	PROCESS read:50 position:50 shot:50 channel:1 2009/265 18:35:29.000 samples:64864 interval:37 usec minmax: \-203695.765625 28316.906250
- 	PROCESS read:75 position:75 shot:75 channel:1 2009/265 18:36:44.000 samples:64864 interval:37 usec minmax: \-201434.375000 24819.115234
- 	PROCESS read:100 position:100 shot:100 channel:1 2009/265 18:37:59.000 samples:64864 interval:37 usec minmax: \-16544.123047 37.462040
- 	............................
- 	PROCESS read:1500 position:1500 shot:1500 channel:1 2009/265 19:47:59.000 samples:64864 interval:37 usec minmax: \-8367.179688 \-876.420044
- 	PROCESS read:1525 position:1525 shot:1525 channel:1 2009/265 19:49:14.000 samples:64864 interval:37 usec minmax: \-9163.580078 201.037201
- 	PROCESS read:1550 position:1550 shot:1550 channel:1 2009/265 19:50:29.000 samples:64864 interval:37 usec minmax: \-12128.291016 \-993.766357
- 	PROCESS read:1575 position:1575 shot:1575 channel:1 2009/265 19:51:44.000 samples:64864 interval:37 usec minmax: \-67764.585938 2457.883789
- 	PROCESS read:1600 position:1600 shot:1600 channel:1 2009/265 19:52:59.000 samples:64864 interval:37 usec minmax: \-190216.031250 \-14304.720703
- .br
- .br
-The output PSD grid file is named testpsd.grd. A shellscript named
-testpsd.grd.cmd is also created that, when executed, will generate a plot of the
-sonogram. \fBMBsegypsd\fP also outputs an ascii file containing the average PSD for the
-entire segy file in the form of frequency PSD pairs. In this case, the average PSD file
-is named testpsd_psd.txt, and has contents like:
-.br
- 	0.000000 193.762464
- 	26.342132 99.114274
- 	52.684263 93.781880
- 	79.026395 86.775795
- 	105.368526 80.297280
- 	131.710658 74.908340
- 	158.052790 71.366137
- 	184.394921 70.319082
- 	210.737053 69.840534
- 	237.079184 70.794517
- 	263.421316 72.002905
- 	289.763448 71.979001
- 	316.105579 70.637717
- 	342.447711 69.652364
- 	..............
- 	13329.118592 \-13.659568
- 	13355.460724 \-13.722928
- 	13381.802855 \-12.981740
- 	13408.144987 \-12.626286
- 	13434.487119 \-12.533222
- 	13460.829250 \-13.659002
- 	13487.171382 \-24.474310
-.br
-A shellscript named testpsd_psd.txt.cmd is created that will, when executed, generate
-a plot of the average PSD.
-
-.SH SEE ALSO
-\fBmbsystem\fP(1), \fBmbm_grdplot\fP(1), \fBmbmosaic\fP(1), \fBmbm_grid\fP(1)
-
-.SH BUGS
-Probably...
-The plots could be better...
diff --git a/src/man/man1/mbset.1 b/src/man/man1/mbset.1
deleted file mode 100644
index aab1c3d..0000000
--- a/src/man/man1/mbset.1
+++ /dev/null
@@ -1,1217 +0,0 @@
-.TH mbset 1 "10 November 2014" "MB-System 5.0" "MB-System 5.0"
-.SH NAME
-\fBmbset\fP \- Sets values in \fBmbprocess\fP parameter files.
-
-.SH VERSION
-Version 5.0
-
-.SH SYNOPSIS
-\fBmbset\fP \fB\-I\fIinfile\fP
-[\fB\-E \-L\fP \fB\-P\fIPARAMETER:value\fP \-V \-H\fP]
-
-.SH DESCRIPTION
-\fBmbset\fP is a utility for creating and
-modifying \fBmbprocess\fP parameter files.
-
-The program \fBmbprocess\fP
-can perform a variety of swath data processing functions in
-a single step (producing a single output swath data file),
-including:
-     \- Merge edited navigation generated by \fBmbnavedit\fP.
-     \- Apply bathymetry edit flags from \fBmbedit\fP
-       and \fBmbclean\fP
-     \- Recalculate bathymetry from raw travel time and
-       angle data by raytracing through water sound speed
-       models from \fBmbvelocitytool\fP or \fBmbsvplist\fP.
-     \- Apply changes to roll bias, pitch bias, heading
-       bias, and draft values.
-     \- Recalculate sidescan from raw backscatter samples
-       (Simrad multibeam data only).
-     \- Apply tides to bathymetry.
-     \- Insert metadata.
-
-The actions of \fBmbprocess\fP are controlled by text
-parameter files. Each \fBmbprocess\fP parameter file
-contains single line commands that set
-processing modes and parameters. The \fB\-P\fP option of
-\fBmbset\fP is used to modify a single \fBmbprocess\fP parameter
-command. This option can be invoked as many times as desired
-on the command line, allowing \fBmbset\fP to set multiple
-\fBmbprocess\fP processing parameters and modes.
-If the swath data file
-specified by the \fB\-I\fP\fIinfile\fP option of
-\fBmbset\fP has an existing \fBmbprocess\fP parameter file,
-then that parameter file will be read and the existing
-parameter values will be modified. If no \fBmbprocess\fP
-parameter file exists, then \fBmbset\fP starts with
-default processing parameters, modifies those, and then
-generates a new parameter file.
-
-If the input file specified by the \fB\-I\fP option is
-a single swath data file, \fBmbset\fP will act on that
-file and it's parameter file only. If the input file is
-a datalist, then \fBmbset\fP will act on all swath files
-extracted from the datalist (and any recursively parsed
-datalist files). This function allows users to easily
-set uniform processing parameters for large numbers of
-data files. The default input file is "datalist.mb-1".
-
-The processing parameter file used by \fBmbprocess\fP has
-an ".par" suffix. In addition to \fBmbset\fP,
-these files are generated or modified by
-\fBmbedit\fP, \fBmbnavedit\fP,
-\fBmbvelocitytool\fP, \fBmbnavadjust\fP, and \fBmbclean\fP.
-
-The processed output swath files produced by \fBmbprocess\fP
-are named using a convention based on the data format id.
-\fBMB-System\fP data formats are specified
-using two-digit or three-digit numbers (see the \fBMBIO\fP manual page).
-If an input swath data file is named "root.mbXX", where XX is the format
-id, then the default processed output file will be "rootp.mbXX"
-(e.g. mydata.mb71 \-> mydatap.mb71).
-The "p" inserted before the ".mbXX" suffix indicates the output
-file has been created by \fBmbprocess\fP.
-If the input file does not follow the *.mbXX naming convention,
-then the output filename will just consist of the input name
-with "p.mbXX" added as a suffix (e.g. mydata \-> mydatap.mb71)
-
-.SH MBPROCESS PARAMETER FILE COMMANDS
-
-The \fBmbprocess\fP parameter file commands modified by \fBmbset\fP are:
-
- GENERAL PARAMETERS:
-   EXPLICIT
-        causes mbprocess to set modes implicitely
-        \- e.g. the SVPFILE command will also set
-          raytracing on even if the RAYTRACE command
-          is not given [explicit mode commands required]
-   FORMAT constant
-        sets format id [no default]
-   INFILE filename
-        sets input file path [no default]
-   OUTFILE filename
-        sets output file path [no default]
-
- NAVIGATION MERGING:
-   NAVMODE boolean
-        sets navigation merging [0]
-          0: navigation merge off
-          1: navigation merge on
-   NAVFILE filename
-        sets navigation file path [no default]
-   NAVFORMAT constant
-        sets navigation file format [9]
- 	see the \fBmbprocess\fP man page for
- 	documentation of the supported
- 	navigation formats.
-   NAVHEADING boolean
-        sets heading to be merged from navigation file
-        \- note: heading merged from navigation before
-          heading correction applied
-          0: heading not changed
-          1: heading merged from navigation file
-   NAVSPEED boolean
-        sets speed to be merged from navigation file
-          0: speed not changed
-          1: speed merged from navigation file
-   NAVDRAFT boolean
-        sets draft to be merged from navigation file
-        \- note: draft merged from navigation before
-          draft correction applied
-          0: draft not changed
-          1: draft merged from navigation file
-   NAVATTITUDE boolean
-        sets roll, pitch and heave to be merged from
-        navigation file
-        \- note: roll, pitch, and heave merged from
-          navigation before roll bias and pitch bias
-          corrections applied
-          0: roll, pitch, and heave not changed
-          1: roll, pitch, and heave merged from
-             navigation file
-   NAVINTERP boolean
-        sets navigation interpolation algorithm [0]
-          0: linear interpolation (recommended)
-          1: spline interpolation
-   NAVTIMESHIFT constant
-        sets navigation time shift (seconds) [0.0]
-        \- note: time shift added to timestamps of
-          navigation fixes read in from NAVFILE
-          prior to merging
-
- NAVIGATION OFFSETS AND SHIFTS:
-   NAVSHIFT boolean
-        sets navigation offset [0]
-        \- note: offsets and shifts are applied to navigation
-          values from both survey and navigation records, and
-          are applied to navigation read in from
-          NAVFILE prior to merging
-        \- note: offsets and shifts are NOT applied to adjusted
-          navigation values from NAVADJFILE
-   NAVOFFSETX constant
-        sets navigation athwartship offset (meters) [0.0]
-        \- note: the effective navigation shift is
-          (NAVOFFSETX \- SONAROFFSETX), and the
-          navigation is corrected by subtracting
-          this effective shift.
-        \- note: athwartship shift is positive to
-          starboard.
-   NAVOFFSETY constant
-        sets navigation fore-aft offset (meters) [0.0]
-        \- note: the effective navigation shift is
-          (NAVOFFSETY \- SONAROFFSETY), and the
-          navigation is corrected by subtracting
-          this effective shift.
-        \- note: fore-aft shift is positive forward.
-   NAVOFFSETZ constant
-        sets navigation vertical offset (meters) [0.0]
-        \- note: this value is not yet used for
-          anything.
-        \- note: vertical shift is positive down.
-   NAVSHIFTLON constant
-        sets navigation longitude shift (degrees) [0.0]
-   NAVSHIFTLAT constant
-        sets navigation latitude shift (degrees) [0.0]
-
- ADJUSTED NAVIGATION MERGING:
-   NAVADJMODE mode
-        sets navigation merging from mbnavadjust [0]
-        \- can apply to longitude and latitude only
-          or longitude, latitude, and depth offset
-          0: adjusted navigation merge off
-          1: adjusted navigation merge on
-          2: adjusted navigation and depth offset merge on
-   NAVADJFILE filename
-        sets adjusted navigation file path
-        \- this file supercedes navigation file for
-          lon and lat only
-        \- uses mbnavadjust output
-   NAVADJINTERP boolean
-        sets adjusted navigation interpolation algorithm [0]
-          0: linear interpolation (recommended)
-          1: spline interpolation
-
-  ATTITUDE MERGING:
-    ATTITUDEMODE mode
-        sets attitude (roll, pitch, and heave) merging [0]
-        \- roll, pitch, and heave merged before
-          roll bias and pitch bias corrections applied
-        \- attitude merging from a separate file supersedes
-          attitude merging from a navigation file
-          0: attitude merging off
-          1: attitude merging on
-    ATTITUDEFILE filename
-        sets attitude file path
-    ATTITUDEFORMAT constant
-        sets attitude file format [1]
-        \- attitude files can be in one of four ASCII
-          table formats
-          1: format is <time_d roll pitch heave>
-          2: format is <yr mon day hour min sec roll pitch heave>
-          3: format is <yr jday hour min sec roll pitch heave>
-          4: format is <yr jday daymin sec roll pitch heave>
-        \- time_d = decimal seconds since 1/1/1970
-        \- daymin = decimal minutes start of day
-        \- roll = positive starboard up, degrees
-        \- pitch = positive forward up, degrees
-        \- heave = positive up, meters
-
-  SONARDEPTH MERGING:
-    SONARDEPTHMODE mode
-        sets sonardepth merging [0]
-        \- sonardepth merged before
-          draft corrections applied
-        \- sonardepth merging from a separate file supersedes
-          draft merging from a navigation file
-          0: sonardepth merging off
-          1: sonardepth merging on
-    SONARDEPTHFILE filename
-        sets sonardepth file path
-    SONARDEPTHFORMAT constant
-        sets sonardepth file format [1]
-        \- sonardepth files can be in one of four ASCII
-          table formats
-          1: format is <time_d sonardepth>
-          2: format is <yr mon day hour min sec sonardepth>
-          3: format is <yr jday hour min sec sonardepth>
-          4: format is <yr jday daymin sec sonardepth>
-        \- time_d = decimal seconds since 1/1/1970
-        \- daymin = decimal minutes start of day
-        \- sonardepth = sonar depth positive down, meters
-
- DATA CUTTING:
-   DATACUTCLEAR
-        removes all existing data cutting commands
-   DATACUT kind mode min max
-        adds new data cutting command, where:
-          kind = 0 : cut applied to bathymetry data
-          kind = 1 : cut applied to amplitude data
-          kind = 2 : cut applied to sidescan data
-          mode = 0 : min and max indicate start and end
-                     beam/pixel numbers between which data
-                     are flagged or zeroed
-          mode = 1 : min and max indicate start and end
-                     acrosstrack distance (m) between which
-                     data are flagged or zeroed
-   BATHCUTNUMBER min max
-        adds new bathymetry data cutting command where
-        min and max are the start and end beam numbers
-        between which data are flagged (note that
-        flagging bathymetry also flags amplitude data)
-   BATHCUTDISTANCE min max
-        adds new bathymetry data cutting command where
-        min and max are the start and end acrosstrack
-        distance (m) between which data are flagged
-        (note that flagging bathymetry also flags
-        amplitude data)
-   BATHCUTSPEED min max
-        adds new bathymetry data cutting command where
-        all beams are flagged for pings with a ship
-        or vehicle speed less than min or greater than
-        max (note that flagging bathymetry also flags
-        amplitude data)
-   AMPCUTNUMBER min max
-        adds new amplitude data cutting command where
-        min and max are the start and end beam numbers
-        between which amplitude data are zeroed (note
-        that zeroing amplitude data has no impact on
-        bathymetry data)
-   AMPCUTDISTANCE min max
-        adds new amplitude data cutting command where
-        min and max are the start and end acrosstrack
-        distance (m) between which amplitude data are
-        zeroed (note that zeroing amplitude data has
-        no impact on bathymetry data)
-   AMPCUTSPEED min max
-        adds new amplitude data cutting command where
-        all amplitude values are zeroed for pings with
-        a ship or vehicle speed less than min or greater
-        than max (note that zeroing amplitude data has
-        no impact on bathymetry data)
-   SSCUTNUMBER min max
-        adds new sidescan data cutting command where
-        min and max are the start and end pixel numbers
-        between which sidescan data are zeroed  (note
-        that zeroing sidescan data has no impact on
-        bathymetry data)
-   SSCUTDISTANCE min max
-        adds new sidescan data cutting command where
-        min and max are the start and end acrosstrack
-        distance (m) between which sidescan data are
-        zeroed  (note that zeroing sidescan data has
-        no impact on bathymetry data)
-   SSCUTSPEED min max
-        adds new sidescan data cutting command where
-        all sidescan values are zeroed for pings with
-        a ship or vehicle speed less than min or greater
-        than max (note that zeroing sidescan data has
-        no impact on bathymetry data)
-
- BATHYMETRY EDITING:
-   EDITSAVEMODE boolean
-        turns on reading edit save file (from mbedit) [0]
-   EDITSAVEFILE filename
-        sets edit save file path (from mbedit) [none]
-
- BATHYMETRY RECALCULATION:
-   SVPMODE mode
-        sets usage of a water sound speed model (sound
-        velocity profile, or SVP) [0]
-         0: bathymetry recalculation by raytracing off
-         1: bathymetry recalculation by raytracing on
-         2: translate depths from corrected to uncorrected
-            or vice versa depending on SOUNDSPEEDREF
-            command
-   SVPFILE filename
-        sets SVP file path [no default]
-   SSVMODE boolean
-        sets surface sound velocity (SSV) mode [0]
-         0: use SSV from file
-         1: offset SSV from file (set by SSV command)
-         2: use constant SSV (set by SSV command)
-   SSV constant/offset
-        sets SSV value or offset (m/s) [1500.0]
-   ANGLEMODE mode
-        sets handling of beam angles during
-        raytracing [1]
-         0: angles not changed before raytracing
-         1: angles adjusted using Snell's Law for
-            the difference between the surface sound
-            velocity (SSV) and the sound speed at
-            the sonar depth in the SVP.
-         2: angles adjusted using Snell's Law and
-            the sonar array geometry for the
-            difference between the surface sound
-            velocity (SSV) and the sound speed at
-            the sonar depth in the SVP.
-   TTMULTIPLY multiplier
-        sets value multiplied by travel times [1.0]
-   SOUNDSPEEDREF boolean
-        determines the handling of the sound
-        speed reference for bathymetry [1]
-        \- note: if raytracing is turned off then
-          this command implies correcting or
-          uncorrecting using the SVP specified
-          with the SVPFILE command
-         0: produce "uncorrected" bathymetry
-            referenced to a uniform 1500 m/s
-            water sound speed model.
-         1: produce "corrected" bathymetry
-            referenced to a realistic water
-            sound speed model.
-
- STATIC BEAM BATHYMETRY OFFSETS:
-   STATICMODE mode
-        sets offsetting of bathymetry by
-        per-beam statics [0]
-          0: static correction off
-          1: static correction by beam number
-          2: static correction by acrosstrack beam angle
-   STATICFILE filename
-        sets static per-beam file path [no default]
-        \- static files are two-column ascii tables
-        \- if correction is by beam number then
-          the beam # is in column 1 and
-          the depth offset is in m in column 2
-        \- if correction is by beam angle then
-          the beam angle (starboard positive)
-          is in column 1 and
-          the depth offset is in m in column 2
-
- DRAFT CORRECTION:
-   DRAFTMODE mode
-        sets draft correction [0]
-        \- note: draft merged from navigation before
-          draft correction applied
-          0: no draft correction
-          1: draft correction by offset
-          2: draft correction by multiply
-          3: draft correction by offset and multiply
-          4: draft set to constant
-   DRAFT constant
-        sets draft value (m) [0.0]
-   DRAFTOFFSET offset
-        sets value added to draft (m) [0.0]
-   DRAFTMULTIPLY multiplier
-        sets value multiplied by draft [1.0]
-
- HEAVE CORRECTION:
-   HEAVEMODE mode
-        sets heave correction [0]
-        \- note: heave correction by offset and/or
-          multiplication is added to any lever
-          heave correction, and then either used in
-          bathymetry recalculation or added to
-          existing bathymetry
-          0: no heave correction
-          1: heave correction by offset
-          2: heave correction by multiply
-          3: heave correction by offset and multiply
-   HEAVEOFFSET offset
-        sets value added to heave (m)
-   HEAVEMULTIPLY multiplier
-        sets value multiplied by heave
-
- LEVER CORRECTION:
-   LEVERMODE mode
-        sets heave correction by lever calculation [0]
-        \- note: lever heave correction is added to
-          any heave correction by offset and/or
-          multiplication, and then either used in
-          bathymetry recalculation or added to
-          existing bathymetry
-          0: no lever calculation
-          1: heave correction by lever calculation
-   VRUOFFSETX constant
-        sets athwartships offset of attitude sensor (m)
-        \- note: positive to starboard
-   VRUOFFSETY constant
-        sets fore-aft offset of attitude sensor (m)
-        \- note: positive forward
-   VRUOFFSETZ constant
-        sets vertical offset of attitude sensor (m)
-        \- note: positive down
-   SONAROFFSETX constant
-        sets athwartships offset of sonar receive array (m)
-        \- note: positive to starboard
-   SONAROFFSETY constant
-        sets fore-aft offset of sonar receive array (m)
-        \- note: positive forward
-   SONAROFFSETZ constant
-        sets vertical offset of sonar receive array (m)
-        \- note: positive down
-
- ROLL CORRECTION:
-   ROLLBIASMODE mode
-        sets roll correction [0]
-          0: no roll correction
-          1: roll correction by single roll bias
-          2: roll correction by separate port and
-             starboard roll bias
-   ROLLBIAS offset
-        sets roll bias (degrees)
-   ROLLBIASPORT offset
-        sets port roll bias (degrees)
-   ROLLBIASSTBD offset
-        sets starboard roll bias (degrees)
-
- PITCH CORRECTION:
-   PITCHBIASMODE mode
-        sets pitch correction [0]
-          0: no pitch correction
-          1: pitch correction by pitch bias
-   PITCHBIAS offset
-        sets pitch bias (degrees)
-
- HEADING CORRECTION:
-   HEADINGMODE mode
-        sets heading correction [no heading correction]
-        \- note: heading merged from navigation before
-          heading correction applied
-          0: no heading correction
-          1: heading correction using course
-             made good
-          2: heading correction by offset
-          3: heading correction using course
-             made good and offset
-   HEADINGOFFSET offset
-        sets value added to heading (degrees)
-
- TIDE CORRECTION:
-   TIDEMODE mode
-        sets tide correction [0]
-        \- note: tide added to bathymetry after
-          all other calculations and corrections
-          0: tide correction off
-          1: tide correction on
-   TIDEFILE filename
-        sets tide file path
-   TIDEFORMAT constan
-        sets tide file format [1]
-        \- tide files can be in one of four ASCII
-          table formats
-          1: format is <time_d tide>
-          2: format is <yr mon day hour min sec tide>
-          3: format is <yr jday hour min sec tide>
-          4: format is <yr jday daymin sec tide>
-        \- time_d = decimal seconds since 1/1/1970
-        \- daymin = decimal minutes start of day
-
- AMPLITUDE CORRECTION:
-   AMPCORRMODE  boolean
-        sets correction of amplitude for
-        amplitude vs grazing angle function
-          0: amplitude correction off
-          1: amplitude correction on
-   AMPCORRFILE filename
-        sets amplitude correction file path
-        [no default]
-   AMPCORRTYPE mode
-        sets sidescan correction type [0]
-          0: correction by subtraction (dB scale)
-          1: correction by division (linear scale)
-   AMPCORRSYMMETRY boolean
-        forces correction function to be symmetric [1]
-   AMPCORRANGLE constant
-        sets amplitude correction reference angle
-        (deg) [30.0]
-   AMPCORRSLOPE mode
-        sets amplitude correction slope mode [0]
-          0: local slope ignored in calculating correction
-          1: local slope used in calculating correction
-          2: topography grid used in calculating correction
-             but slope ignored
-          3: local slope from topography grid used in
-             calculating correction
-
- SIDESCAN CORRECTION:
-   SSCORRMODE  boolean
-        sets correction of sidescan for
-        amplitude vs grazing angle function
-          0: sidescan correction off
-          1: sidescan correction on
-   SSCORRFILE filename
-        sets sidescan correction file path
-        [no default]
-   SSCORRTYPE mode
-        sets sidescan correction type [0]
-          0: correction by subtraction (dB scale)
-          1: correction by division (linear scale)
-   SSCORRSYMMETRY boolean
-        forces correction function to be symmetric [1]
-   SSCORRANGLE constant
-        sets sidescan correction reference angle
-        (deg) [30.0]
-   SSCORRSLOPE mode
-        sets sidescan correction slope mode [0]
-          0: local slope ignored in calculating correction
-          1: local slope used in calculating correction
-          2: topography grid used in calculating correction
-             but slope ignored
-          3: local slope from topography grid used in
-             calculating correction
-   AMPSSCORRTOPOFILE
-        Sets topography grid used for correcting amplitude
-        and sidescan
-
- SIDESCAN RECALCULATION:
-   SSRECALCMODE  boolean
-        sets recalculation of sidescan for
-        Simrad multibeam data
-          0: sidescan recalculation off
-          1: sidescan recalculation on
-   SSPIXELSIZE constant
-        sets recalculated sidescan pixel size (m) [0.0]
-        \- a zero value causes the pixel size to
-          be recalculated for every data record
-   SSSWATHWIDTH  constant
-        sets sidescan swath width (degrees) [0.0]
-        \- a zero value causes the swath width
-          to be recalculated for every data record
-   SSINTERPOLATE  constant
-        sets sidescan interpolation distance
-        (number of pixels)
-
- METADATA INSERTION:
-   METAVESSEL string
-        sets mbinfo metadata string for vessel
-   METAINSTITUTION string
-        sets mbinfo metadata string for vessel
-        operator institution or company
-   METAPLATFORM string
-        sets mbinfo metadata string for sonar
-        platform (ship or vehicle)
-   METASONAR string
-        sets mbinfo metadata string for sonar
-        model name
-   METASONARVERSION string
-        sets mbinfo metadata string for sonar
-        version (usually software version)
-   METACRUISEID string
-        sets mbinfo metadata string for institutional
-        cruise id
-   METACRUISENAME string
-        sets mbinfo metadata string for descriptive
-        cruise name
-   METAPI string
-        sets mbinfo metadata string for principal
-        investigator
-   METAPIINSTITUTION string
-        sets mbinfo metadata string for principal
-        investigator
-   METACLIENT string
-        sets mbinfo metadata string fo data owner
-        (usually PI institution)
-   METASVCORRECTED boolean
-        sets mbinfo metadata boolean for sound
-        velocity corrected depths
-   METATIDECORRECTED boolean
-        sets mbinfo metadata boolean for tide
-        corrected bathymetry
-   METABATHEDITMANUAL boolean
-        sets mbinfo metadata boolean for manually
-        edited bathymetry
-   METABATHEDITAUTO boolean
-        sets mbinfo metadata boolean for automatically
-        edited bathymetry
-   METAROLLBIAS constant
-        sets mbinfo metadata constant for roll bias
-        (degrees + to starboard)
-   METAPITCHBIAS constant
-        sets mbinfo metadata constant for pitch bias
-        (degrees + forward)
-   METAHEADINGBIAS constant
-        sets mbinfo metadata constant for heading bias
-   METADRAFT constant
-        sets mbinfo metadata constant for vessel draft (m)
-
- PROCESSING KLUGES:
-   KLUGE001 boolean
-        enables correction of travel times in
-        Hydrosweep DS2 data from the R/V Maurice
-        Ewing in 2001 and 2002.
-   KLUGE002 boolean
-        enables correction of draft values in
-        Simrad data
-        \- some Simrad multibeam data has had an
-          error in which the heave has bee added
-          to the sonar depth (draft for hull
-          mounted sonars)
-        \- this correction subtracts the heave
-          value from the sonar depth
-   KLUGE003 boolean
-        enables correction of beam angles in
-        SeaBeam 2112 data
-        \- a data sample from the SeaBeam 2112 on
-          the USCG Icebreaker Healy (collected on
-          23 July 2003) was found to have an error
-          in which the beam angles had 0.25 times
-          the roll added
-        \- this correction subtracts 0.25 * roll
-          from the beam angles before the bathymetry
-          is recalculated by raytracing through a
-          water sound velocity profile
-        \- the mbprocess parameter files must be
-          set to enable bathymetry recalculation
-          by raytracing in order to apply this
-          correction
-   KLUGE004 boolean
-        deletes survey data associated with duplicate
-        or reversed time tags
-        \- if survey data records are encountered
-          with time tags less than or equal to the
-          last good time tag, an error is set and
-          the data record is not output to the
-          processed data file.
-   KLUGE005 boolean
-        replaces survey record timestamps with
-        timestamps of corresponding merged navigation
-        records
-        \- this feature allows users to fix
-          timestamp errors using MBnavedit and
-          then insert the corrected timestamps
-          into processed data
-   KLUGE006 boolean
- 	changes sonar depth / draft values without
-        changing bathymetry values
-   KLUGE007 boolean
-        processing kluge 007 (not yet defined)
-        \- occasionaly odd processing problems will
-          occur that are specific to a particular
-          survey or sonar version
-        \- mbprocess will allow one-time fixes to
-          be defined as "kluges" that can be turned
-          on through the parameter files.
-
-.SH ANCILLARY DATA FILES
-
-\fBMB-System\fP also uses a number of ancillary data files, most
-of which relate to \fBmbprocess\fP in some way. By default,
-these ancillary data files are named by adding a short suffix
-to the primary data file name (e.g. ".par", ".svp", ".esf", ".nve")
-
-The common ancillary files are listed below. The example names
-given here follow from an input swath data file name of mydata.mb71.
-
-The processing parameter file used by \fBmbprocess\fP has
-an ".par" suffix. These files are generated
-or modified by \fBmbset\fP, \fBmbedit\fP, \fBmbnavedit\fP,
-\fBmbvelocitytool\fP, \fBmbnavadjust\fP, and \fBmbclean\fP.
-        mydata.mb71.par
-
-The most prominent ancillary files are metadata or
-"inf" files (created from the output of \fBmbinfo\fP).
-Programs such as \fBmbgrid\fP and \fBmbm_plot\fP try to check "inf"
-files to see if the corresponding data files include data within
-desired areas. The program \fBmbprocess\fP automatically generates
-an "inf" file for any processed output swath file.
-Also, the program \fBmbdatalist\fP is often used to
-create or update "inf" files for large groups of swath data files.
-        mydata.mb71.inf
-        mydata.mb71.inf
-
-The "fast bath" or "fbt" files
-are generated by copying the swath bathymetry to a sparse,
-quickly read format (format 71). Programs such as \fBmbgrid\fP,
-\fBmbswath\fP, and \fBmbcontour\fP will try to read "fbt" files
-instead of the full data files whenever only bathymetry
-information are required. The program \fBmbprocess\fP
-automatically generates
-an "fbt" file for any processed output swath file.
-Also, the program \fBmbdatalist\fP is often used to
-create or update "fbt" files for large groups of swath data files.
-These files are not generated or used
-when the original swath data is already
-in a compact bathymetry-only data format.
-        mydata.mb71.fbt
-
-The "fast nav" or "fnv" files
-are just ASCII lists of navigation generated using \fBmblist\fP
-with a \fB\-O\fP\fItMXYHSc\fP option. Programs such as \fBmbgrid\fP,
-\fBmbswath\fP, and \fBmbcontour\fP will try to read "fnv" files
-instead of the full data files whenever only
-navigation information are required. These files are not generated or used
-when the original data is already
-in a single-beam or navigation data format.
-        mydata.mb71.fnv
-
-The bathymetry edit save file generated by \fBmbedit\fP and
-\fBmbclean\fP has an ".esf" suffix.
-        mydata.mb71.esf
-
-A water sound velocity profile (SVP) file generated
-by \fBmbvelocitytool\fP has an ".svp" suffix unless
-the user specifies otherwise.
-        mydata.mb71.svp
-
-Water sound velocity profile (SVP) files generated
-by \fBmbsvplist\fP also use the ".svp" suffix.
-However, multiple SVP files may be
-extracted from each input swath file, so the files are
-numbered using a "_YYY.svp" suffix, where YYY increments
-from 001.
-        mydata.mb71_001.svp
-        mydata.mb71_002.svp
-        mydata.mb71_003.svp
-
-Edited navigation files generated by \fBmbnavedit\fP have
-an ".nve" suffix:
-        mydata.mb71.nve
-.br
-These navigation files can be read independently using format 166.
-
-Adjusted navigation files generated by \fBmbnavadjust\fP
-have an ".naY" suffix, where "Y" is a number between 0-9.
-The \fBmbnavadjust\fP package may be used multiple times
-for a survey; the adjustments are numbered sequentially from
-"0":
-        mydata.mb71.na0
-        mydata.mb71.na1
-        mydata.mb71.na2
-.br
-and so on. These navigation files can be read independently using format 166.
-
-.SH AUTHORSHIP
-David W. Caress (caress at mbari.org)
-.br
-  Monterey Bay Aquarium Research Institute
-.br
-Dale N. Chayes (dale at ldeo.columbia.edu)
-.br
-  Lamont-Doherty Earth Observatory
-
-.SH OPTIONS
-.TP
-.B \-E
-.br
-This option causes \fBmbset\fP to require all
-processing modes to be explicitly set by \fB\-P\fP
-calls. Normally, \fBmbset\fP will implicitly set
-some modes based on the parameters applied. For example,
-if a user applies \fB\-P\fP\fISVPFILE:best.svp\fP, \fBmbset\fP
-would normally set the bathymetry recalculation mode
-on so that the SVP file specified actually gets used.
-.TP
-.B \-I
-\fIinfile\fP
-.br
-Swath data file for which an \fBmbprocess\fP parameter file
-will be created or updated, or
-a datalist file containing a list of input swath data files
-and/or other datalist files. If \fIinfile\fP is a
-datalist file, then \fBmbset\fP will attempt to
-update or create the parameter files for all swath data
-files identified by recursively reading \fIinfile\fP.
-Default \fIinfile\fP: datalist.mb-1
-.TP
-.B \-L
-.br
-If given once, this option causes \fBmbset\fP to look for any edit save
-files and navigation files with expected names
-and set the \fBmbprocess\fP parameters so that these files
-are used. If multiple navigation files are available
-(reflecting use of \fBmbnavedit\fP and one or more
-uses of \fBmbnavadjust\fP), then the latest (highest numbered)
-\fBmbnavadjust\fP solution is used.
-If \fB\-L\fP is given twice, \fBmbset\fP will also look
-for any SVP files with expected names
-and set the \fBmbprocess\fP parameters so that these files
-are used for recalculating bathymetry by raytracing.
-If multiple SVP files are available
-(reflecting use of \fBmbsvplist\fP and \fBmbvelocitytool\fP),
-then the file derived from \fBmbvelocitytool\fP
-is used.
-If \fB\-L\fP is given three times or more, then \fBmbset\fP will
-not look for any ancillary files, but instead reset
-the paths to all output files to be "local", meaning located
-in the same directory as the input file. This special option
-allows users to fix parameter files containing full paths for
-output files (as generated by early versions of this program).
-.TP
-.B \-H
-This "help" flag causes the program to print out a description
-of its operation and then exit immediately.
-.TP
-.B \-P
-\fIPARAMETER:value\fP
-The \fB\-P\fP option of \fBmbset\fP is used to modify a single
-\fBmbprocess\fP parameter command. Here \fIPARAMETER\fP may be
-any of the processing parameter names listed above, and \fIvalue\fP
-is the corresponding value to be set. This option can be invoked
-as many times as desired on the command line, allowing \fBmbset\fP
-to set multiple \fBmbprocess\fP processing parameters and modes.
-The separater between \fIPARAMETER\fP and \fIvalue\fP can be
-either ':' or '='. Only the first ':' or '=' acts as a separater;
-later instances of these characters are taken as part of \fIvalue\fP.
-.TP
-.B \-V
-Normally, \fBmbset\fP works "silently" without outputting
-anything to the stderr stream.  If the
-\fB\-V\fP flag is given, then \fBmbset\fP works in a "verbose" mode and
-outputs the program version being used and lists the processing
-parameters output to the \fBmbprocess\fP parameter file.
-
-.SH EXAMPLES
-Suppose the user has a Simrad EM120 data file called
-"0051_20010829_223755.mb57" that requires processing.
-
-Editing the bathymetry data in this file with mbedit will generate
-an edit save file "0051_20010829_223755.mb57.esf" and
-an mbprocess parameter file "0051_20010829_223755.mb57.par".
-The contents of the parameter file are:
-
- ## MB-System processing parameter file
- ## Written by mb_pr_writepar version $Id: mbset.1 2210 2014-11-10 19:53:01Z caress $
- ## MB-system Version 5.0.beta22
- ## Generated by user <caress> on cpu <menard> at <Fri Sep  6 21:27:41 2002>
- ##
- ##
- ## Forces explicit reading of parameter modes.
- EXPLICIT
- ##
- ## General Parameters:
- FORMAT 57
- INFILE /data/0051_20010829_223755.mb57
- OUTFILE /data/0051_20010829_223755p.mb57
- ##
- ## Navigation Merging:
- NAVMODE 0
- NAVFILE /data/0051_20010829_223755.mb57.nve
- NAVFORMAT 0
- NAVHEADING 0
- NAVSPEED 0
- NAVDRAFT 0
- NAVATTITUDE 0
- NAVINTERP 0
- NAVTIMESHIFT 0.000000
- ##
- ## Navigation Offsets and Shifts:
- NAVSHIFT 0
- NAVOFFSETX 0.000000
- NAVOFFSETY 0.000000
- NAVOFFSETZ 0.000000
- NAVSHIFTLON 0.000000
- NAVSHIFTLAT 0.000000
- ##
- ## Adjusted Navigation Merging:
- NAVADJMODE 0
- NAVADJFILE
- NAVADJINTERP 0
- ##
- ## Attitude Merging:
- ATTITUDEMODE 0
- ATTITUDEFILE
- ATTITUDEFORMAT 1
- ##
- ## Sonardepth Merging:
- SONARDEPTHMODE 0
- SONARDEPTHFILE
- SONARDEPTHFORMAT 1
- ##
- ## Data cutting:
- DATACUTCLEAR
- ##
- ## Bathymetry Flagging:
- EDITSAVEMODE 1
- EDITSAVEFILE /data/0051_20010829_223755.mb57.esf
- ##
- ## Bathymetry Recalculation:
- SVPMODE 0
- SVPFILE
- SSVMODE 0
- SSV 0.000000
- TTMODE 0
- TTMULTIPLY 1.000000
- ANGLEMODE 0
- SOUNDSPEEDREF 1
- ##
- ## Draft Correction:
- DRAFTMODE 0
- DRAFT 0.000000
- DRAFTOFFSET 0.000000
- DRAFTMULTIPLY 1.000000
- ##
- ## Heave Correction:
- HEAVEMODE 0
- HEAVEOFFSET 0.000000
- HEAVEMULTIPLY 1.000000
- ##
- ## Lever Correction:
- LEVERMODE 0
- VRUOFFSETX 0.000000
- VRUOFFSETY 0.000000
- VRUOFFSETZ 0.000000
- SONAROFFSETX 0.000000
- SONAROFFSETY 0.000000
- SONAROFFSETZ 0.000000
- ##
- ## Roll Correction:
- ROLLBIASMODE 0
- ROLLBIAS 0.000000
- ROLLBIASPORT 0.000000
- ROLLBIASSTBD 0.000000
- ##
- ## Pitch Correction:
- PITCHBIASMODE 0
- PITCHBIAS 0.000000
- ##
- ## Heading Correction:
- HEADINGMODE 0
- HEADINGOFFSET 0.000000
- ##
- ## Tide Correction:
- TIDEMODE 0
- TIDEFILE
- TIDEFORMAT 1
- ##
- ## Amplitude Correction:
- AMPCORRMODE 0
- AMPCORRFILE
- AMPCORRTYPE 0
- AMPCORRSYMMETRY 1
- AMPCORRANGLE 30.000000
- AMPCORRSLOPE 0
- ##
- ## Sidescan Correction:
- SSCORRMODE 0
- SSCORRFILE
- SSCORRTYPE 0
- SSCORRSYMMETRY 1
- SSCORRANGLE 30.000000
- SSCORRSLOPE 0
- ##
- ## Sidescan Recalculation:
- SSRECALCMODE 0
- SSPIXELSIZE 0.000000
- SSSWATHWIDTH 0.000000
- SSINTERPOLATE 0
- ##
- ## Metadata Insertion:
- METAVESSEL
- METAINSTITUTION
- METAPLATFORM
- METASONAR
- METASONARVERSION
- METACRUISEID
- METACRUISENAME
- METAPI
- METAPIINSTITUTION
- METACLIENT
- METASVCORRECTED \-1
- METATIDECORRECTED \-1
- METABATHEDITMANUAL \-1
- METABATHEDITAUTO \-1
- METAROLLBIAS 0.000000
- METAPITCHBIAS 0.000000
- METAHEADINGBIAS 0.000000
- METADRAFT 0.000000
- ##
- ## Processing Kluges:
-
-Editing the navigation with mbnavedit will generate
-a navigation file named "0051_20010829_223755.mb57.nve"
-and will modify the parameter file. The changed lines
-in "0051_20010829_223755.mb57.par" are:
-
- ## Navigation Merging:
- NAVMODE 1
- NAVFILE /data/0051_20010829_223755.mb57.nve
- NAVFORMAT 9
- NAVHEADING 1
- NAVSPEED 1
- NAVDRAFT 1
- NAVATTITUDE 1
-
-At this point, running \fBmbprocess\fP on
-"0051_20010829_223755.mb57" will apply the bathymetry
-flags from \fBmbedit\fP and merge the navigation from
-\fBmbnavedit\fP, but will not modify the data in any
-other way.
-
-If the user wants to recalculate the bathymetry using
-an SVP file "0051_20010829_223755.mb57.svp"
-and a roll bias correction
-of +0.5 degrees, the following will suffice:
-
-        mbset \-I 0051_20010829_223755.mb57 \
-               \-PSVPFILE:0051_20010829_223755.mb57.svp \
-               \-PROLLBIAS:0.5 \
-               \-PDRAFT:1.95 \
-               \-V
-
-The affected lines in "0051_20010829_223755.mb57.par" are:
-
- ##
- ## Bathymetry Recalculation:
- SVPMODE 1
- SVPFILE 0051_20010829_223755.mb57.svp
- SSVMODE 0
- SSV 0.000000
- TTMODE 0
- TTMULTIPLY 1.000000
- ANGLEMODE 0
- SOUNDSPEEDREF 1
- ##
- ## Draft Correction:
- DRAFTMODE 4
- DRAFT 1.950000
- DRAFTOFFSET 0.000000
- DRAFTMULTIPLY 1.000000
- ##
- ## Roll Correction:
- ROLLBIASMODE 1
- ROLLBIAS 0.500000
- ROLLBIASPORT 0.000000
- ROLLBIASSTBD 0.000000
-
-To process the data, run mbprocess:
-
-        mbprocess \-I0051_20010829_223755.mb57 \-V
-
- The output to the terminal is:
- Program mbprocess
- Version $Id: mbset.1 2210 2014-11-10 19:53:01Z caress $
- MB-System Version 5.0.beta07
-
- Program <mbprocess>
- Version $Id: mbset.1 2210 2014-11-10 19:53:01Z caress $
- MB-system Version 5.0.beta07
-
- Program Operation:
-   Input file:      0051_20010829_223755.mb57
-   Format:          57
-   Files processed only if out of date.
-   Comments embedded in output.
-
- Data processed \- out of date:
-  Input:  0051_20010829_223755.mb57
-  Output: 0051_20010829_223755p.mb57
-
- Input and Output Files:
-   Format:                        57
-   Input file:                    0051_20010829_223755.mb57
-   Output file:                   0051_20010829_223755p.mb57
-   Comments in output: ON
-
- Navigation Merging:
-   Navigation merged from navigation file.
-   Heading merged from navigation file.
-   Speed merged from navigation file.
-   Draft merged from navigation file.
-   Navigation file:               0051_20010829_223755.mb57.nve
-   Navigation algorithm:          linear interpolation
-   Navigation time shift:         0.000000
-
- Navigation Offsets and Shifts:
-   Navigation positions not shifted.
-
- Adjusted Navigation Merging:
-   Navigation not merged from adjusted navigation file.
-   Adjusted navigation file:
-   Adjusted navigation algorithm: linear interpolation
-
- Data Cutting:
-   Data cutting disabled.
-
- Bathymetry Editing:
-   Bathymetry edits applied from file.
-   Bathymetry edit file:          0051_20010829_223755.mb57.esf
-
- Bathymetry Recalculation:
-   Bathymetry recalculated by raytracing.
-   SVP file:                      0051_20010829_223755.mb57.svp
-   SSV not modified.
-   SSV offset/constant:           0.000000 m/s
-   Travel time multiplier:        1.000000 m
-
- Bathymetry Water Sound Speed Reference:
-   Output bathymetry reference:   CORRECTED
-   Depths recalculated as corrected
-
- Draft Correction:
-   Draft set to constant.
-   Draft constant:                1.950000 m
-   Draft offset:                  0.000000 m
-   Draft multiplier:              1.000000 m
-
- Heave Correction:
-   Heave not modified.
-   Heave offset:                  0.000000 m
-   Heave multiplier:              1.000000 m
-
- Lever Correction:
-   Lever calculation off.
-
- Tide Correction:
-   Tide calculation off.
-
- Roll Correction:
-   Roll offset by bias.
-   Roll bias:                     0.500000 deg
-   Port roll bias:                0.000000 deg
-   Starboard roll bias:           0.000000 deg
-
- Pitch Correction:
-   Pitch not modified.
-   Pitch bias:                    0.000000 deg
-
- Heading Correction:
-   Heading not modified.
-   Heading offset:                0.000000 deg
-
- Amplitude Corrections:
-   Amplitude correction off.
-
- Sidescan Corrections:
-   Sidescan correction off.
-
- Sidescan Recalculation:
-   Sidescan not recalculated.
-   Sidescan pixel size:           0.000000
-   Sidescan swath width:          0.000000
-   Sidescan interpolation:        0
-
- Metadata Insertion:
-   Metadata vessel:
-   Metadata institution:
-   Metadata platform:
-   Metadata sonar:
-   Metadata sonarversion:
-   Metadata cruiseid:
-   Metadata cruisename:
-   Metadata pi:
-   Metadata piinstitution:
-   Metadata client:
-   Metadata svcorrected:          \-1
-   Metadata tidecorrected         \-1
-   Metadata batheditmanual        \-1
-   Metadata batheditauto:         \-1
-   Metadata rollbias:             0.000000
-   Metadata pitchbias:            0.000000
-   Metadata headingbias:          0.000000
-   Metadata draft:                0.000000
-
- 236 navigation records read
- Nav start time: 2001 08 29 22:38:02.082999
- Nav end time:   2001 08 29 23:37:22.322000
-
- 47 bathymetry edits read
-
- 236 input data records
- 3587 input nav records
- 17 input comment records
- 6617 input other records
- 236 output data records
- 3587 output nav records
- 64 output comment records
- 6617 output other records
-
- Generating inf file for 0051_20010829_223755p.mb57
-
-
-.SH SEE ALSO
-\fBmbsystem\fP(1), \fBmbprocess\fP(1),
-\fBmbedit\fP(1), \fBmbnavedit\fP(1), \fBmbvelocitytool\fP(1)
-
-.SH BUGS
-Oh yeah...
diff --git a/src/man/man1/mbstripnan.1 b/src/man/man1/mbstripnan.1
deleted file mode 100644
index 45bd14e..0000000
--- a/src/man/man1/mbstripnan.1
+++ /dev/null
@@ -1,70 +0,0 @@
-.TH mbstripNaN 1 "3 June 2013" "MB-System 5.0" "MB-System 5.0"
-.SH NAME
-\fBmbstripNaN\fP \- filter to remove NaN nodes
-
-.SH VERSION
-Version 5.0
-
-.SH SYNOPSIS
-\fBmbstripNaN\fP
-
-.SH DESCRIPTION
-\fBmbstripNaN\fP is a utility for removing NaN nodes that are produced
-by the GMT utilities \fBgrd2xyz\fP and \fBblockmean\fP with the \-bo
-option.  The standard output
-of \fBmbstripNaN\fP may be fed into the standard input of \fBsurface\fP with
-the \-bi option.  This is used by the \fBmbm_grd2geovrml\fP utility in
-order to spline fill areas of no data so that irregular bathymetry may
-be effectively visualized using GeoVRML which has no concept of NaN.
-
-Note that \fBmbstripNaN\fP works with a double precision data stream.
-
-The code is simple.  Here it is:
-
-  #include <stdio.h>
-  #include <math.h>
-
-  /*
-   * Read double x,y,z on stdin and send to stdout all
-   * triplets but ones where z == NaN
-   */
-  main () {
- 	  struct node { double lon, lat, height; };
- 	  struct node n;
- 	  while ( ( fread(&n, 24, 1, stdin) > 0 ) ) {
- 		  if ( ! isnan(n.height) ) {
- 			  fwrite(&n, 24, 1, stdout);
- 		  }
- 	  }
-   }
-
-
-.SH EXAMPLE
-
-This is a command that \fBmbm_grd2geovrml\fP constructs and executes:
-
-  #
-  # Convert grid to xyz format for filling in blank
-  # areas, preprocess w/blockmean, use surface to
-  # extrapolate to no data areas
-  #
-  grd2xyz \-bo Samp_OregonMarginI_bath.grd | blockmean \\
-    \-bi \-bo \-V \-I0.00336363636363635/0.00134545454545457 \\
-    \-R-125.2/-124.867/45/45.1332 | mbstripNaN | surface \\
-    \-bi \-I0.00336363636363635/0.00134545454545457 \\
-    \-S0.333312 \-T0.35 \-GTmp_OregonMarginI_bath.grd \-V \\
-    \-R-125.2/-124.867/45/45.1332
-
-
-.SH SEE ALSO
-
-\fBgrd2xyz\fP(1),
-\fBblockmean\fP(1),
-\fBsurface\fP(1),
-\fBmbm_grd2geovrml\fP(1)
-
-
-
-.SH BUGS
-
-How many bugs can there be in an 8 line program?
diff --git a/src/man/man1/mbsvplist.1 b/src/man/man1/mbsvplist.1
deleted file mode 100644
index ad0e204..0000000
--- a/src/man/man1/mbsvplist.1
+++ /dev/null
@@ -1,200 +0,0 @@
-.TH mbsvplist 1 "17 March 2014" "MB-System 5.0" "MB-System 5.0"
-.SH NAME
-\fBmbsvplist\fP \- List water sound velocity profiles in swath sonar data files.
-
-.SH VERSION
-Version 5.0
-
-.SH SYNOPSIS
-\fBmbsvplist\fP [\fB\-C \-D \fB\-F\fIformat \fB\-H \fB\-I\fIfile \fB\-M\fImode\fP \fB\-O \-P \-S \-V \-Z\fP]
-
-.SH DESCRIPTION
-This program, \fBmbsvplist\fP, lists all water
-sound velocity profiles (SVPs) within swath data files.
-Swath bathymetry is calculated from raw angles and travel
-times by raytracing through a model of the speed of sound
-in water. Many swath data formats allow SVPs to be
-embedded in the data, and often the SVPs used to
-calculate the data will be included.
-By default, all unique SVPs encountered are
-listed to stdout. The SVPs may instead be
-written to individual files with names FILE_XXX.svp,
-where FILE is the swath data filename and XXX is the
-SVP count within the file. The SVP files output by \fBmbsvplist\fP
-include a header line starting with "## MB-SVP" and including the
-timestamp and location of the SVP record as inferred from its
-location in the file. This header record is recognized by the program
-\fBmbsvpselect\fP which uses the information to select the best
-SVP models to apply to swath data files for bathymetry recalculation.
-Some files contain SVPs at
-regular intervals, typically with the same SVP duplicated
-many times. By default, \fBmbsvplist\fP ignores duplicate
-SVPs. The \fB\-D\fP option causes duplicate SVPs to be output.
-The \fB\-P\fP option
-implies \fB\-O\fP, and also causes the parameter file to be modified
-so that the first SVP output for each file becomes the
-SVP used for recalculating bathymetry for that swath file.
-The \fB\-C\fP option causes \fBmbsvplist\fP to output the number
-of unique SVPs in a file to the shell (standard out).
-The \fB\-S\fP option causes \fBmbsvplist\fP to output the sound velocity values
-used for beamforming by the sonar (often called surface sound velocity, or SSV)
-instead of SVP profiles. Each SSV value will be paired with the
-corresponding sonar depth, and there will generally be one SSV value output
-for each survey ping.
-
-.SH AUTHORSHIP
-David W. Caress (caress at mbari.org)
-.br
-  Monterey Bay Aquarium Research Institute
-.br
-Dale N. Chayes (dale at ldeo.columbia.edu)
-.br
-  Lamont-Doherty Earth Observatory
-.br
-
-.SH OPTIONS
-.TP
-.B \-C
-.br
-Causes \fBmbsvplist\fP to output the number of unique SVPs in each file to the shell (standard out).
-.TP
-.B \-D
-.br
-Causes \fBmbsvplist\fP to output duplicate SVPs. This is equivalent to \fB\-M\fP\fI2\fP.
-.TP
-.B \-F
-\fIformat\fP
-.br
-Sets the format for the input swath sonar data using
-\fBMBIO\fP integer format identifiers.
-If \fIformat\fP < 0, then the input
-file specified with the \fB\-I\fP
-option will actually contain
-a list of input swath sonar data files.
-This program uses the \fBMBIO\fP library and will read any swath sonar
-format supported by \fBMBIO\fP. A list of the swath sonar data formats
-currently supported by \fBMBIO\fP and their identifier values
-is given in the \fBMBIO\fP manual page.
-.TP
-.B \-H
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-.TP
-.B \-I
-\fIfile\fP
-.br
-Sets the input filename. If \fIformat\fP > 0 (set with the
-\fB\-F\fP option) then the swath sonar data contained in \fIfile\fP
-is read and processed. If \fIformat\fP < 0, then \fIfile\fP
-is assumed to be an ascii file containing a list of the input swath sonar
-data files to be processed and their formats.  The program will read
-the data in each one of these files.
-In the \fIfile\fP file, each
-data file should be followed by a data format identifier, e.g.:
- 	datafile1 11
- 	datafile2 24
-.br
-This program uses the \fBMBIO\fP library and will read or write any swath sonar
-format supported by \fBMBIO\fP. A list of the swath sonar data formats
-currently supported by \fBMBIO\fP and their identifier values
-is given in the \fBMBIO\fP manual page. Default: \fIfile\fP = "datalist.mb-1".
-.TP
-.B \-M
-\fImode\fP
-.br
-Sets the SVP output mode. If \fImode\fP=0 (the default), then the first SVP of
-each file will be output, plus any SVP that is different from the previous SVP.
-If \fImode\fP=1, then only the first instance of each unique SVP will be output, even
-through multiple files referenced through a datalist structure. If \fImode\fP=2,
-then all SVPs will be output even if they are duplicates (equivalent to the \fB\-D\fP option).
-.TP
-.B \-O
-.br
-By default, \fBmbsvplist\fP writes the SVP records to
-stdout. This option causes the program to instead write
-the SVPs to individual files with names FILE_XXX.svp,
-where FILE is the source swath data filename and XXX is the
-SVP count within the file.
-.TP
-.B \-P
-.br
-This option implies the output option \fB\-O\fP. Additionally,
-this option sets the first SVP output for each swathfile to be used for
-recalculating the bathymetry in that swathfile by \fBmbprocess\fP
-by modifying the associated parameter file.
-.TP
-.B \-S
-.br
-This option causes \fBmbsvplist\fP to output the sound velocity values
-used for beamforming by the sonar (often called surface sound velocity, or SSV)
-instead of SVP profiles. Each SSV value will be paired with the
-corresponding sonar depth, and in general one depth-SSV pair will be output
-for each survey ping.
-.TP
-.B \-V
-Normally, \fBmbsvplist\fP works "silently" without outputting
-anything to the stderr stream.  If the
-\fB\-V\fP flag is given, then \fBmblist\fP works in a "verbose" mode and
-outputs the program version being used and all error status messages.
-.TP
-.B \-Z
-Normally, \fBmbsvplist\fP faithfully outputs the SVP data just
-as it is stored in the swath files. Rarely, sonars may store SVP
-data with a nonzero depth for the first sound speed value, a
-circumstance that causes problems with bathymetry recalculation
-using \fBmbprocess\fP. The \fB\-Z\fP option causes \fBmbsvplist\fP
-to replace the first depth value with zero before outputting the
-SVP.
-
-.SH EXAMPLES
-Suppose one wishes to obtain an SVP list from a Simrad EM300 data file
-in the MBARI format (MBIO id 57) called mbari_1998_107_msn.mb57. To
-obtain a listing to stdout, the following will suffice:
-
- 	mbsvplist \-F57 \-I mbari_1998_526_msn.mb57 \-V
-
-The output will be as follows:
-
- Program mbsvplist
- Version $Id: mbsvplist.1 2173 2014-03-18 01:13:37Z caress $
- MB-system Version 5.0
-
- Searching mbari_1998_526_msn.mb57 for SVP records
- Outputting SVP to file:
- ## Water Sound Velocity Profile (SVP)
- ## Output by Program mbsvplist
- ## Program Version $Id: mbsvplist.1 2173 2014-03-18 01:13:37Z caress $
- ## MB-System Version 5.0.alpha01
- ## Run by user <caress> on cpu <menard> at <Thu Jan  4 13:36:44 2001>
- ## Swath File: mbari_1998_526_msn.mb57
- ## Start Time: 1998/05/02 01:33:08.300000
- ## SVP Count: 1
- ## Number of SVP Points: 15
-     0.00        1503.50
-     9.99        1502.70
-    19.98        1501.80
-    30.00        1501.40
-    39.99        1501.40
-    49.98        1499.90
-    60.00        1499.80
-    69.99        1497.50
-    79.98        1496.90
-    90.00        1496.90
-    99.99        1495.10
-   198.99        1486.60
-   498.99        1480.60
-  1000.98        1481.90
-  1830.00        1488.70
- ##
- ##
- 4 SVP records read
- 1 SVP records written
-
-Total 4 SVP records read
-Total 1 SVP records written
-
-.SH SEE ALSO
-\fBmbsystem\fP(1), \fBmbprocess\fP(1), \fBmbsvpselect\fP(1)
-
-.SH BUGS
-Probably.
diff --git a/src/man/man1/mbsvpselect.1 b/src/man/man1/mbsvpselect.1
deleted file mode 100644
index d278f3a..0000000
--- a/src/man/man1/mbsvpselect.1
+++ /dev/null
@@ -1,256 +0,0 @@
-.TH mbsvpselect 1 "13 March 2014" "MB-System 5.0" "MB-System 5.0"
-.SH NAME
-\fBmbsvpselect\fP \- Mbsvpselect chooses and implements the best
-available sound speed model for each swath file in a survey
-
-.SH VERSION
-Version 5.0
-
-.SH SYNOPSIS
-mbsvpselect -N -V -Idatalist -Ssvplist -Pmode[/criteria[/submode]]
-
-[-P0, -P1, -P2/period, -P3/range, -P3/range/1]
-\fBmbsvpselect\fP [\fB\-C \-D \fB\-F\fIformat \fB\-H \fB\-I\fIfile \fB\-M\fImode\fP \fB\-O \-P \-S \-V \-Z\fP]
-
-.SH DESCRIPTION
-Mbsvpselect chooses and implements the best available sound speed model
-for each swath file in a survey. The user provides a list of the
-available sound speed models and specifies the criteria used for
-model selection. The program uses mbset to turn on bathymetry
-recalculation by raytracing through the sound speed model selected
-for each swath file.
-
-Description:
-
-The tool aims to help users to automatically apply the sound velocity
-correction to the survey files. since most surveys involve several SVPs,
-the seletion of the appropriate SVP for each survey profile is still
-missing in MB-System.
-
-After finding the appropriate svp for each profile based on the choosed
-method, the results are copied to a txt file that shows each survey
-profile with the corresponding SVP. the tool also calls mbset automatically
-so no need to assign SVP to the data. it is done automatically.
-
-There are 5 methods for choosing the appropriate SVP for each survey
-profile. These methods are:
-
-1. Nearest SVP in position: the middle position of each survey profile
-   is calculated and the geodesics (shortest distance on the ellipsoid)
-   to all SVPs are calcualted. and the SVP with the shortest distance is
-   chosen. when the middle position of the survey profile is calculated
-   there is an option to check for 0 lat 0 long wrong values. if it is
-   found at the starting the geodesic will be calculated to the end of
-   the profile.
-
-2. Nearest in time: the time interveal between the starting time of
-   the profile and the time of the SVP, and the SVP with  the shortest
-   interval will be chosen.
-
-3. Nearest in position within time: a default time radius from the
-   profile is set as 10 hours, and within this period the nearest SVP
-   in position is chosen. if none of the SVPs are within this period the
-   nearest in position will be taken despit of the period threshold. The
-   period threshold can be set by the user.
-
-4. Nearest in time within range: similar to the previous option but
-   this time a default range of 10000 meters is set and within this range
-   the svp nearest in time is chosen. also this 10000 meter value could
-   be set by the user.
-
-5. Nearest in season within range: similar to the previous option the
-   selected SVP could be chosen based on the month only not on the year.
-   it means within the specified range the user could chose either the svp
-   nearest in time or the svp nearest in month (this could be interpreted
-   as the svp that falls in the same seasonal period despite of the year
-   when it was taken).
-
-Mbsvpselect reads the .inf file of each swath file referenced in a recursive
-datalist structure to determine the location and collection time of the
-relevant data. The ancilliary *.inf, *.fbt, and *.fnv files must be created
-first. The water sound speed models (called SVPs by convention as an acronym
-for Sound Velocity Profiles) to be used must include one of three supported
-file headers specifying the time and location of the model.
-
-University of Bremen SVP headers:
-  MB-SVP 2011/01/08 19:30:00 -52.965437  -36.986314
-  (keyword yyyy/mm/dd hh:mm:ss latitude longitude)
-
-MB-System SVPs as now output by mbsvplist:
-  #MB-SVP 2011/01/08 19:30:00 -36.986314 -52.965437
-  (keyword yyyy/mm/dd hh:mm:ss longitude latitude)
-
-CARIS sound velocity header format:
-  Section 2013-150 23:22:18 -57:02:01 -26:02:18
-  (keyword yyyy-yearDay  hh:mm:ss latitude (degree:min:sec) longitude (degree:min:sec))
-
-Mbsvpselect supports SVP files with single models or files with multiple models where
-new headers occur between models.
-
-Instructions:
-
-1) Set up a survey (or surveys) for MB-System processing in the usual way,
-   including creating a datalist file referencing the swath data of interest
-   and generating the ancilliary *.inf, *.fbt, and *.fnv files for each of
-   the swath files.
-2) Create an svplist file (analagous to a datalist, but referencing the
-   relevant SVP files). Each SVP file is expected to be a text file with
-   depth-sound speed pairs on each line (depth in meters, sound speed in
-   meters/second) excepting for a header line at the start of each discrete
-   model. Any of the header formats listed above will work.
-   that refers to a local svp datalist. the local datalists includes
-3) In order to turn on bathymetry recalculation by raytracing through the
-   most appropriate sound speed model for each swath file, call mbsvpselect:
-
-     mbsvpselect -N -V -Idatalist -Ssvplist [-P0, -P1, -P2/period, -P3/range, -P3/range/1]
-
-   -N is the option to check 0 latitude 0 longitude in the survey lines.
-   -V verbosity.
-   -I input datalist
-   -S input svp datalist
-   -P the method for choosing the svp where:
-       -P or -P0                 is the nearest in position
-       -P1                       is the nearest in time
-       -P2                       is nearest in position within time (default time period is 10 hours)
-       -P2/time                  is nearest in position within specified time period (in hours)
-       -P3                       is nearest in time within range   (default range is 10000 meters)
-       -P3/range or -P3/range/0  is nearest in time within specified range (in meters)
-       -P3/range/1                     is nearest in month (seasonal) within specified range in meter.
-
-.SH AUTHORSHIP
-Ammar Aljuhe (ammaraljuhne at gmail.com)
-.br
-  MARUM, University of Bremen
-.br
-Christian do Santos Ferreira (cferreira at marum.de)
-.br
-  MARUM, University of Bremen
-.br
-
-.SH OPTIONS
-.TP
-.B \-H
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-.TP
-.B \-I
-\fIdatalist\fP
-.br
-Sets the input datalist file, where \fIdatalist\fP
-is an ascii file containing a list of the input swath sonar
-data files to be processed and their formats.  The program will read
-the data in each one of these files.
-In the \fIfile\fP file, each
-data file should be followed by a data format identifier, e.g.:
- 	datafile1 11
- 	datafile2 24
-.br
-This program uses the \fBMBIO\fP library and will operate on any swath sonar
-format supported by \fBMBIO\fP. A list of the swath sonar data formats
-currently supported by \fBMBIO\fP and their identifier values
-is given in the \fBMBIO\fP manual page. Default: \fIfile\fP = "datalist.mb-1".
-.TP
-.B \-N
-.br
-Causes the program to check for SVPs with zero longitude and latitude values.
-.TP
-.B \-P
-.br
-This option sets the criteria by which \fBmbsvpselect\fP selects the
-sound speed model to be used for each swath file.
-  -P or -P0             nearest in position
-  -P1                   nearest in time
-  -P2                   nearest in position within time 
-  -P2/time              nearest in position within specified time period
-  -P3			nearest in time within range   
-  -P3/range  		nearest in time within specified range
-  -P3/range/0  		nearest in time within specified range
-  -P3/range/1           nearest in month (seasonal) within specified range
-.br
-The times are specified in hours and the ranges in meters. 
-The default time period is 10 hours and the default range is 10000 meters.
-.TP
-.B \-S
-\fIsvplist\fP
-.br
-Sets the input svplist file, where \fIsvplist\fP
-is an ascii file containing a list of the input sound speed model
-or SVP files.  The program will read
-the location and time stamp information for all of the models
-in each one of these files.
-In the \fIsvplist\fP file, each
-SVP file should be on a separate line, e.g.:
- 	svpfile1
- 	svpfile2
-.br
-Default: \fIfile\fP = "svplist.mb-1".
-.TP
-.B \-V
-Normally, \fBmbsvpselect\fP works "silently" without outputting
-anything to the stderr stream.  If the
-\fB\-V\fP flag is given, then \fBmblist\fP works in a "verbose" mode and
-outputs the program version being used and all error status messages.
-
-.SH EXAMPLES
-Suppose you are working in a directory called Survey_1 containing
-swath files that need to have the bathymetry recalculated by
-raytracing through water sound speed models. The local datalist
-file might contain something like:
-     13349457_3934_2845.mb88 88
-     13645323_3433_5543.mb88 88
-     46372536_6563_4637.mb88 88
-     64362825_6344_2635.mb88 88
-
-or, if you use absolute passwords, something like:
-
-     /MyMac/User/Survey_1/13349457_3934_2845.mb88 88
-     /MyMac/User/Survey_1/13645323_3433_5543.mb88 88
-     /MyMac/User/Survey_1/46372536_6563_4637.mb88 88
-     /MyMac/User/Survey_1/64362825_6344_2635.mb88 88
-
-By convention, this datalist will be named something
-like datalist.mb-1, where the ".mb-1" suffix indicates to
-MB-System programs that this is a datalist file. As
-documented elsewhere, datalist files can contain entries
-that reference datalists rather than single files; thus
-datalists can be recursive.
-
-Suppose that the water properties were variable during this
-survey, with the variability dominated by location.Further suppose 
-that there are three SVP files in a separate directory with
-names such as svp1.svp, svp2.svp, and svp3.svp. Each of these files
-contains a single model derived from CTD casts at a particular
-place and time indicated in the single header line. In that directory
-one can create an svplist file named SVP_list.mb-1 with contents:
-     svp1.svp
-     svp2.svp
-     svp3.svp
-Since mbsvpselect allows svplists to be recursive (like datalists),
-one can create a second svplist named my_svplist.mb-1in the survey 
-processing directory that references the first with an entry like:
-
-     /MyMac/User/Survey_1/SVP_folder/SVP_list.mb-1 -1
-
-In order to turn on bathymetry recalculation for all of the
-swath files referenced by datalist.mb-1 using the most appropriate
-of the available sound speed models, run mbsvpselect with arguments
-like:
-
-     mbsvpselect -N -V -I datalist.mb-1 -S my_svplist.mb-1 -P2/50
-
-Here the -P2/50 option specifies that the sound speed model to be
-used for each file will be the closest one collected within 50 hours
-of the swath data. The bathymetry recalculation will be turned on
-using an mbset call of the form:
-
-     mbset -Idatalist.mb-1 -PSVPFILE:/MyMac/User/Survey_1/SVP_folder/svp1.svp
-
-Following the mbsvpselect usage, mbprocess must be run to actually
-reprocess the swath data, including bathymetry recalculation by
-raytracing.
-
-.SH SEE ALSO
-\fBmbsystem\fP(1), \fBmbprocess\fP(1), \fBmbset\fP(1), \fBmbsvplist\fP(1)
-
-.SH BUGS
-The bugs are special because they are from Egypt, Germany, and Brazil.
diff --git a/src/man/man1/mbswath.1 b/src/man/man1/mbswath.1
deleted file mode 100644
index abaab4e..0000000
--- a/src/man/man1/mbswath.1
+++ /dev/null
@@ -1,483 +0,0 @@
-.TH mbswath 1 "5 February 2015" "MB-System 5.0" "MB-System 5.0"
-.SH NAME
-\fBmbswath\fP \- \fBGMT\fP plug-in module for color fill or color shaded relief
-swath plots of swath sonar data using Postscript.
-
-.SH VERSION
-Version 5.0
-
-.SH SYNOPSIS
-\fBgmt mbswath\fP \fB\-C\fIcptfile\fP \fB\-J\fIparameters\fP
-\fB\-R\fIwest/east/south/north\fP [\fB\-A\fIfactor/mode/depth\fP
-\fB\-B\fItickinfo\fP \fB\-b\fIyr/mo/da/hr/mn/sc\fP
-\fB\-c\fIcopies\fP \fB\-D\fImode/scale/min/max\fP
-\fB\-E\fIyr/mo/da/hr/mn/sc\fP
-\fB\-f\fIformat\fP \fB\-F\fIred/green/blue\fP
-\fB\-G\fImagnitude/azimuth\fP \fB\-I\fIdatalist\fP \fB\-K\fP
-\fB\-N\fIcptfile\fP \fB\-O\fP \fB\-P\fP \fB\-p\fIpings \fB\-Q\fIdpi\fP \fB\-S\fIspeed\fP
-\fB\-T\fItimegap\fP \fB\-U\fP \fB\-W\fP \fB\-X\fIx-shift\fP \fB\-Y\fIy-shift\fP \fB\-Z\fImode[F]\fP
-\fB\-0 \-1 \-2\fP
-\fB\-V \-H\fP]
-
-.SH DESCRIPTION
-\fBmbswath\fP is a plug-in module for plotting swath sonar data in color fill
-or color shaded relief using \fBGMT\fP (Generic Mapping Tools).
-Like \fBmbcontour\fP, \fBmbswath\fP
-is fully compatible with the \fBGMT\fP package version 5, including the use
-of GMT style color pallete (cpt) files to control the color table.
-A 24-bit true color \fIPostScript\fP file is output using one of
-three methods. Unless individual polygon fills are used (\fB\-1\fP option),
-only one call to \fBmbswath\fP can be made for each plot because the
-color image produced covers the entire plot space.
-The program can read data from a single swath sonar file or from
-multiple files as referenced by an MB-System datalist file.
-
-Before opening an input swath data file, \fBmbmbswath\fP checks for
-an ascii file in the same directory having the same name except
-that ".inf" is appended to the end. The program assumes that this
-ascii file contains the output of the program \fBmbinfo\fP run on
-the input data file. If the ".inf" file exists, \fBmbswath\fP reads
-the minimum and maximum longitude and latitude bounds from the
-\fBmbinfo\fP output and compares those to the bounds
-for the plot. If the ".inf" file indicates that none of the data
-in the input file lies inside the plot bounds, that input
-file is skipped. This allows users to maintain a single master list
-of data files for use in all plotting without the performance penalty
-of \fBmbswath\fP reading through all the data files, even those
-with no relevent data. We recommend that users maintain a ".inf"
-file for each swath data file used for gridding or plotting. The
-\fBGMT\fP modules \fBmbcontour\fP and \fBmbgrid\fP also use ".inf" files
-in the same fashion.
-
-If \fBmbfilter\fP has been used to filter amplitude and/or sidescan
-data in the desired input, then the \fB\-Z\fP option can be used
-to specify plotting the filtered rather than unfiltered data.
-
-In order for \fBGMT\fP to successfully execute \fBmbswath\fP, the
-location of the shared library \fIlibmbgmt\fP containing this module must be known to \fBGMT\fP.
-This can be accomplished by either setting the GMT_CUSTOM_LIBS parameter
-in the file gmt.conf that is part of the GMT installation, by setting
-this parameter in the file gmt.conf in the user's home directory, or by
-using the GMT module \fBgmtset\fP to modify this parameter in the
-current working directory. If, for instance, the \fIlibmbgmt\fP shared library
-has been installed in the file /usr/lib/libmbgmt.dylib, then the
-GMT_CUSTOM_LIBS parameter in a gmt.conf file can be set to:
-        GMT_CUSTOM_LIBS = /usr/lib/libmbgmt.dylib
-
-.SH AUTHORSHIP
-David W. Caress (caress at mbari.org)
-.br
-  Monterey Bay Aquarium Research Institute
-.br
-Dale N. Chayes (dale at ldeo.columbia.edu)
-.br
-  Lamont-Doherty Earth Observatory
-
-.SH OPTIONS
-.TP
-.B \-A
-\fIfactor/mode/depth\fP
-.br
-This option determines how the along-track dimension of the
-beam or pixel footprints is calculated. If \fImode\fP = 1,
-then the fore-aft beam angle width of the sonar is used so that
-the width increases towards the outer parts of the swath.
-The fore-aft beam angle width (\fBMB-System\fP internally stores
-a value for each format/sonar) is multiplied by the \fIfactor\fP
-value; a \fIfactor\fP < 1.0 can be useful if the data highly
-oversamples the seafloor and a \fIfactor\fP > 1.0 can fill in
-plots of data which undersample the seafloor. If the data
-stream does not include depth values (e.g. one is plotting
-pure sidescan data), then the \fIdepth\fP value sets the
-depth value in meters used in the footprint calculations.
-If \fImode\fP = 2, then the along-track dimension of the beam
-or pixel footprints is just the along-track distance between
-pings multiplied by the \fIfactor\fP value.
-If \fImode\fP = 3, then each data point is plotted as a point,
-and the \fIfactor\fP and \fIdepth\fP parameters are ignored.
-Default: \fIfactor\fP = 1.0, \fImode\fP = 1, \fIdepth\fP = 3000.0.
-.TP
-.B \-B
-\fItickinfo\fP
-.br
-Sets map boundary tickmark intervals. See the \fBpsbasemap\fP
-manual page for details.
-.TP
-.B \-b
-\fIyr/mo/da/hr/mn/sc\fP
-.br
-Sets the starting time for data allowed in the input data; pings
-with times before the starting time will be ignored.
-Default: \fIyr/mo/da/hr/mn/sc\fP = 1962/2/21/10/30/0.
-.TP
-.B \-C
-Sets the color palette file which controls the color of the plot.
-See documentation of the GMT package for a complete description
-of cpt files.
-.TP
-.B \-c
-\fIcopies\fP
-.br
-Specifies the number of plot copies (the default is 1).
-.TP
-.B \-D
-\fImode/scale/min/max\fP
-.br
-Sets scaling of beam amplitude or sidescan pixel values which
-can be applied before plotting. If \fImode\fP = 1 or 2, then
-a linear scaling of the form:
- 	scaled_value = scale * (value \- min) / (max \- min)
-.br
-is applied.  If \fImode\fP = 3 or 4, then a log10 scaling of
-the form:
- 	scaled_value = scale * (20 * log10(value) \- min) / (max \- min)
-.br
-is applied.  If \fImode\fP = 2 or 4, then the value (or 20*log10(value))
-will be clipped to \fImin\fP if it is smaller than \fImin\fP or \fImax\fP
-if it is greater than \fImax\fP; this clipping happens prior to the
-multiplication by \fIscale\fP. Default: \fImode\fP = 1, \fIscale\fP = 1.0,
-\fImin\fP = 0.0, \fImax\fP = 1.0.
-.TP
-.B \-E
-\fIyr/mo/da/hr/mn/sc\fP
-.br
-Sets the ending time for data allowed in the input data; pings
-with times after the ending time will be ignored.
-Default: \fIyr/mo/da/hr/mn/sc\fP = 2062/2/21/10/30/0.
-.TP
-.B \-F
-\fIred/green/blue\fP
-.br
-Sets the color used for Frame and annotation. [Default is black]
-.TP
-.B \-f
-\fIformat\fP
-.br
-Sets the data format used if the input is read from stdin
-or from a file. If \fIformat\fP < 0, then the input file specified
-with the \fB\-I\fP option will actually contain a list of input swath sonar
-data files. This program uses the \fBMBIO\fP library
-and will read or write any swath sonar
-format supported by \fBMBIO\fP. A list of the swath sonar data formats
-currently supported by \fBMBIO\fP and their identifier values
-is given in the \fBMBIO\fP manual page. Default: \fIformat\fP = \-1.
-.TP
-.B \-G
-\fImagnitude/azimuth\fP or \fImagnitude/median\fP
-.br
-Sets the parameters which control how \fBmbswath\fP generates
-simulated illumination of bathymetry, which can be either
-shaded relief bathymetry or bathymetry draped with amplitude data.
-If \fImode\fP is set to 2 (shaded relief bathymetry) using the
-\fB\-Z\fP option, then the value \fImagnitude\fP
-is an effective vertical exageration which modulates the intensity of
-the shading; typical values are in the 1-5 range.  The value \fIazimuth\fP
-is the azimuth from which the bathymetry is illuminated.
-If \fImode\fP is set to 3 (bathymetry shaded using amplitudes) using the
-\fB\-Z\fP option, then the value \fImagnitude\fP
-modulates the intensity of the shading; the value \fImedian\fP sets the
-amplitude value which serves as the zero or neutral level.
-.TP
-.B \-H
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-.TP
-.B \-I
-\fIinfile\fP
-.br
-Sets the input filename. If \fIformat\fP > 0 (set with the
-\fB\-f\fP option) then the swath sonar data contained in \fIinfile\fP
-is read and processed. If \fIformat\fP < 0, then \fIinfile\fP
-is assumed to be an ascii file containing a list of the input swath sonar
-data files to be processed and their formats.  The program will read
-and plot the data in each one of these files.
-In the \fIinfile\fP file, each
-data file should be followed by a data format identifier, e.g.:
- 	datafile1 11
- 	datafile2 24
-.br
-This program uses the \fBMBIO\fP library and will read any swath sonar
-format supported by \fBMBIO\fP. A list of the swath sonar data formats
-currently supported by \fBMBIO\fP and their identifier values
-is given in the \fBMBIO\fP manual page.
-.br
-An input datafile may be accompanied by a "fast bathymetry" or "fbt" file.
-The "fbt" fine naming
-convention is to add the
-".fbt" suffix to the original swath
-data filename.
-An "fbt" file contains only swath bathymetry information
-in a compact format (format 71),
-and is thus quick to read. If \fBmbswath\fP is
-generating a plot containing only bathymetry
-(\fB\-Z\fP\fI1\fP and \fB\-Z\fP\fI2\fP).
-the program
-will attempt to read an "fbt" file in lieu of the original data.
-.TP
-.B \-J
-Selects the map projection. Scale is inch/degree, 1:xxxxx.
-or width in inches (upper case modifier).
-.br
-.sp
-\fBCYLINDRICAL PROJECTIONS:\fP
-.br
-.sp
-\fB\-Jc\fP\fIlon0/lat0/scale\fP (Cassini)
-.br
-\fB\-Jm\fP\fIscale\fP (Mercator)
-.br
-\fB\-Joa\fP\fIlon0/lat0/azimuth/scale\fP (Oblique Mercator \- point and azimuth)
-.br
-\fB\-Job\fP\fIlon0/lat0/lon1/lat1/scale\fP (Oblique Mercator \- two points)
-.br
-\fB\-Joc\fP\fIlon0/lat0/lonp/latp/scale\fP (Oblique Mercator \- point and pole)
-.br
-\fB\-Jq\fP\fIlon0/scale\fP (Equidistant Cylindrical Projection (Plate Carree))
-.br
-\fB\-Jt\fP\fIlon0/scale\fP (TM \- Transverse Mercator)
-.br
-\fB\-Ju\fP\fIzone/scale\fP (UTM \- Universal Transverse Mercator)
-.br
-\fB\-Jy\fP\fIlon0/lats/scale\fP (Basic Cylindrical Projection)
-.br
-.sp
-\fBAZIMUTHAL PROJECTIONS:\fP
-.br
-.sp
-\fB\-Ja\fP\fIlon0/lat0/scale\fP (Lambert).
-.br
-\fB\-Je\fP\fIlon0/lat0/scale\fP (Equidistant).
-.br
-\fB\-Jg\fP\fIlon0/lat0/scale\fP (Orthographic).
-.br
-\fB\-Js\fP\fIlon0/lat0/scale\fP (General Stereographic)
-.br
-.sp
-\fBCONIC PROJECTIONS:\fP
-.br
-.sp
-\fB\-Jb\fP\fIlon0/lat0/lat1/lat2/scale\fP (Albers)
-.br
-\fB\-Jl\fP\fIlon0/lat0/lat1/lat2/scale\fP (Lambert)
-.br
-.sp
-\fBMISCELLANEOUS PROJECTIONS:\fP
-.br
-.sp
-\fB\-Jh\fP\fIlon0/scale\fP (Hammer)
-.br
-\fB\-Ji\fP\fIlon0/scale\fP (Sinusoidal)
-.br
-\fB\-Jk\fP\fIlon0/scale\fP (Eckert VI)
-.br
-\fB\-Jn\fP\fIlon0/scale\fP (Robinson)
-.br
-\fB\-Jr\fP\fIlon0/scale\fP (Winkel Tripel)
-.br
-\fB\-Jw\fP\fIlon0/scale\fP (Mollweide)
-.br
-.sp
-\fBNON-GEOGRAPHICAL PROJECTIONS:\fP
-.br
-.sp
-\fB\-Jp\fP\fIscale\fP (Linear projection for polar (theta,r) coordinates)
-.br
-\fB\-Jx\fP\fIx-scale\fP[\fBl|p\fP\fIpow\fP][\fI/y-scale\fP[\fBl|p\fP\fIpow\fP]] (Linear, log, and power scaling)
-.br
-More details can be found in the \fBpsbasemap\fP manpages.
-.TP
-.B \-K
-More \fIPostScript\fP code will be appended later [Default terminates the plot system].
-.TP
-.B \-L
-\fIlonflip\fP
-.br
-Sets the range of the longitude values returned by the swath sonar i/o routines.
-If \fIlonflip\fP=\-1 then the longitude values will be in
-the range from \-360 to 0 degrees. If \fIlonflip\fP=0
-then the longitude values will be in
-the range from \-180 to 180 degrees. If \fIlonflip\fP=1
-then the longitude values will be in
-the range from 0 to 360 degrees.
-Default: \fIlonflip\fP = 0.
-.TP
-.B \-N
-\fIcptfile\fP
-.br
-Normally, shading of bathymetry with amplitudes (\fImode\fP = 3
-as set with the \fB\-Z\fP option) is accomplished
-by linearly mapping the amplitudes to shade values. This option
-specifies a grayscale cpt file used to map amplitude values
-to grayscale shade values.
-.TP
-.B \-O
-Selects Overlay plot mode [Default initializes a new plot system].
-.TP
-.B \-P
-Selects Portrait plotting mode [GMT Default is Landscape, see gmtdefaults to change this].
-.TP
-.B \-p
-\fIpings\fP
-.br
-Sets the ping averaging of the input data. If \fIpings\fP = 1, then
-no ping averaging is performed. If \fIpings\fP > 0, then
-that number of input pings will be averaged to produce one output
-ping.  If \fIpings\fP = 0, then the ping averaging will automatically
-be done so that the along-track ping spacing is equal to the across-track
-beam spacing.
-Default: \fIpings\fP = 1 (no ping averaging).
-.TP
-.B \-Q
-\fIdpi\fP
-.br
-Sets the resolution of the color image output by \fBmbswath\fP
-in pixels per inch (except when the \fB\-1\fP option is used to force individual
-polygon color fills). Default: \fIdpi\fP = 100.
-.TP
-.B \-R
-\fIwest/east/south/north\fP
-.br
-Sets the longitude and latitude bounds within which swath sonar
-data will be read and plotted. Only the data which lies within
-these bounds will be read.
-Default: \fIwest\fP=\-360, east\fI=360\fP, \fIsouth\fP=\-90, \fInorth\fP=90.
-.TP
-.B \-S
-\fIspeed\fP
-.br
-Sets the minimum speed in km/hr (5.5 kts ~ 10 km/hr) allowed in
-the input data; pings associated with a smaller ship speed will not be
-processed. Default: \fIspeed\fP = 0.
-.TP
-.B \-T
-\fItimegap\fP
-.br
-Sets the maximum time gap in minutes between adjacent pings allowed before
-the data is considered to have a gap. Default: \fItimegap\fP = 1.
-.TP
-.B \-U
-Draw Unix System time stamp on plot.  Optionally, append a label, or 'c' which will plot
-the command string.
-.TP
-.B \-V
-Selects verbose mode, which will send progress reports to stderr [Default runs "silently"].
-.TP
-.B \-W
-Normally, \fBmbswath\fP works with bathymetry values in meters.  If the
-\fB\-W\fP flag is given, then \fBmbswath\fP will work with bathymetry
-values in feet. The color palette file used must conform to the
-range of bathymetry values in feet.
-.TP
-.B \-X \-Y
-Shift origin of plot by (\fIx-shift,y-shift\fP) inches  [Default is (1,1) for new plots, (0,0) for overlays].
-.TP
-.B \-Z
-\fImode[F]\fP
-.br
-Sets the style of the plot.
- 	\fImode\fP = 1:	Color fill of bathymetry data.
- 	\fImode\fP = 2:	Color shaded relief bathymetry.
- 	\fImode\fP = 3:	Bathymetry shaded using amplitude data.
- 	\fImode\fP = 4:	Color fill of amplitude data.
- 	\fImode\fP = 5:	Color fill of sidescan data.
-.br
-If "F" is appended to \fImode\fP, then \fBmbswath\fP will attempt
-to plot amplitude or sidescan data that have been filtered with \fBmbfilter\fP.
-If the desired filtered data files do not exist, plotting will fail and
-\fBmbswath\fP will exit with an error message. Filtered amplitude
-data are stored in ancilliary files ending with ".ffa", and filtered
-sidescan files end in ".ffs". Filtering of bathymetry data is not supported,
-and so appending "F" to \fImode\fP values of 1 or 2 will have no effect.
-Default: \fImode\fP = 1;
-.TP
-.B \-0
-Create the image using the Adobe \fIPostScript\fP colorimage operator.
-This is the default.
-.TP
-.B \-1
-Create the image by plotting individual color polygons.
-.TP
-.B \-2
-Create the image by color separation using three calls to image for later
-processing by \fBpsto24\fP.
-.SH EXAMPLES
-Suppose the user has a Hydrosweep data file in the L-DEO in-house
-binary format (\fBMBIO\fP format id 24) called hs_ew9302_157_mn.mb24
-which lies in the region w/s/e/n = \-32.1874/-26.6236/54.6349/56.7536.
-The following will suffice to generate a color fill plot:
- 	gmt mbswath \-Idatalist \-Jm1.46578 \-R-32.1874/-26.6236/54.6349/56.7536
- 		-B1/1 \-Ccolor.cpt \-p1 \-A1 \-Q100 \-Z2
- 		-X1 \-Y1.75 \-V > mbswath.ps
-.br
-where the file datalist contains:
- 	hs_ew9302_157_mn.mb24 24
-.br
-A more complicated plot including a navigation track and a color scale
-can be created using \fBmbswath\fP in conjunction with other GMT
-and GMT-compatible utilities.  The following is an example of a shellscript
-which generates such a plot and then displays it on the screen:
-
- #
- # Shellscript to create Postscript plot of swath sonar data
- # Created by macro mbm_plot
- #
- # Make datalist file
- echo Making datalist file...
- echo hs_ew9302_157_bmn.mb24 24 > datalist
- #
- # Make color palette table file
- echo Making color palette table file...
- echo 2235 255 255 255 2372 255 221 171 > hs_ew9302_157_bmn.mb24.cpt
- echo 2372 255 221 171 2509 255 186 133 >> hs_ew9302_157_bmn.mb24.cpt
- echo 2509 255 186 133 2646 255 161 68 >> hs_ew9302_157_bmn.mb24.cpt
- echo 2646 255 161 68 2783 255 189 87 >> hs_ew9302_157_bmn.mb24.cpt
- echo 2783 255 189 87 2920 240 236 121 >> hs_ew9302_157_bmn.mb24.cpt
- echo 2920 240 236 121 3057 205 255 162 >> hs_ew9302_157_bmn.mb24.cpt
- echo 3057 205 255 162 3193 138 236 174 >> hs_ew9302_157_bmn.mb24.cpt
- echo 3193 138 236 174 3330 106 235 255 >> hs_ew9302_157_bmn.mb24.cpt
- echo 3330 106 235 255 3467 87 215 255 >> hs_ew9302_157_bmn.mb24.cpt
- echo 3467 87 215 255 3604 50 190 255 >> hs_ew9302_157_bmn.mb24.cpt
- echo 3604 50 190 255 3741 0 160 255 >> hs_ew9302_157_bmn.mb24.cpt
- echo 3741 0 160 255 3878 40 127 251 >> hs_ew9302_157_bmn.mb24.cpt
- echo 3878 40 127 251 4015 21 92 236 >> hs_ew9302_157_bmn.mb24.cpt
- echo 4015 21 92 236 4152 37 57 175 >> hs_ew9302_157_bmn.mb24.cpt
- #
- # Run mbswath
- echo Running mbswath...
- gmt mbswath \-Idatalist \-Jm1.46578 \-R-32.1874/-26.6236/54.6349/56.7536 \
- 	-B1.1128/1.1128":.Data File hs_ew9302_157_bmn.mb24:" \
- 	-Chs_ew9302_157_bmn.mb24.cpt \-p1 \-A1 \-Q100 \-G5/0 \-Z2 \-X1 \
- 	-Y1.75 \-K \-V > hs_ew9302_157_bmn.mb24.ps
- #
- # Run mblist
- echo Running mblist...
- mblist \-F24 \-Ihs_ew9302_157_bmn.mb24 \-OXYU > hs_ew9302_157_bmn.mb24.nav
- #
- # Run pstrack
- echo Running pstrack...
- gmt pstrack hs_ew9302_157_bmn.mb24.nav \-Jm1.46578 \
- 	-R-32.1874/-26.6236/54.6349/56.7536 \-B1.1128/1.1128":.Data File \
- 	hs_ew9302_157_bmn.mb24:" \-W1p \-Mt15ma1h \-O \-K >> hs_ew9302_157_bmn.mb24.ps
- #
- # Run psscale
- echo Running psscale...
- gmt psscale  \-Chs_ew9302_157_bmn.mb24.cpt \-D4.0777/-0.5000/6.5242/0.1500h
- 	-B":.Depth (meters):" \-O \-V >> hs_ew9302_157_bmn.mb24.ps
- #
- # Delete surplus files
- echo Deleting surplus files...
- rm \-f hs_ew9302_157_bmn.mb24.cpt datalist hs_ew9302_157_bmn.mb24.nav
- #
- # Run pageview
- echo Running gv in background...
- gv hs_ew9302_157_bmn.mb24.ps &
- #
- # All done!
- echo All done!
-
-.SH SEE ALSO
-\fBmbsystem\fP(1), \fBmbm_plot\fP(1), \fBmbcontour\fP(1),  \fBmbfilter\fP(1),
-\fBgmtsystem\fP(1), \fBpsbasemap\fP(1), \fBpsto24\fP(1)
-
-.SH BUGS
-Let us know.
diff --git a/src/man/man1/mbswplspreprocess.1 b/src/man/man1/mbswplspreprocess.1
deleted file mode 100644
index 277c883..0000000
--- a/src/man/man1/mbswplspreprocess.1
+++ /dev/null
@@ -1,180 +0,0 @@
-.TH mbswplspreprocess 1 "26 March 2014" "MB-System 5.0" "MB-System 5.0"
-.SH NAME
-\fBmbswplspreprocess\fP \- prepairs a SWATHplus sonar file (\fBMBIO\fP 
-format 222) for processed with MB System.                             
-.SH VERSION
-Version 5.0
-
-.SH SYNOPSIS
-\fBmbswplspreprocess\fP [\fB\-ABGNRSHV\fP] [\fB\-F\fP\fIformat\fP] 
-[\fB\-J\fP\fIproj4command\fP] [\fB\-O\fP\fIoutfile\fP] \fB\-I\fIfile
-
-.SH DESCRIPTION
-\fBmbswplspreprocess\fP prepairs a SWATHplus SXP (\fBMBIO\fP format 222) 
-file for processing with MB System. 
-.PP
-MB System can read and plot SXP files 
-without modification. However, many of the editing and calibration programs 
-work best if each transducer channel is stored in a separate file (use 
-the \fB\-S\fP option). In particular, multiple transducer channels pinging 
-simultaneously will trip up time filtering, since each channel in the 
-ping series has the same time stamp.                                  
-.PP
-If during data acquisition using the SEA SWATH Real-Time Acquisition System 
-(SEA Swath Processor), the "Store All Data" option was selected in combination 
-with the "Downsample" Bathy filter, the SXP ping records will contain 
-both the original data (all samples rejected) and the filtered data (all 
-samples accepted) simultaneously. This will confuse most programs in MB 
-System. Use the \fB\-B\fP and \fB\-R\fP options as needed to strip out 
-the undesired set prior to processing.                                
-.PP
-SXP ping records contain both a raw amplitude and a processed amplitude 
-value for each sample. MB System reads and writes ONLY the processed amplitude 
-values, leaving the raw values untouched. Use the \fB\-A\fP option to 
-copy (or restore) the raw amplitude values into the processed amplitude 
-slots so that they can be accessed by MB System.              
-.br
-.SH AUTHORSHIP
-David P. Finlayson (dfinlayson at usgs.gov)
-.br
- Pacific Coastal and Marine Science Center, USGS
-.br
-.SH OPTIONS
-.TP
-.B \-A
-.br
-This option causes the program to copy the raw amplitude values stored 
-with each sample into the corresponding processed amplitude slot where 
-it can then be used by MB System.
-.TP
-.B \-B
-.br
-This option causes the program to reverse the sample flag setting. That 
-is, rejected samples become accepted samples and vis-a-vis. This option 
-is always applied before option \fB\-R\fP.                 
-.TP
-.B \-F
-\fIformat\fP
-.br
-Sets the data format used if the input is read from stdin or from a file. 
-If \fIformat\fP < 0, then the input file specified with the \fB\-I\fP 
-option will actually contain a list of input swath sonar data files. This 
-program only reads Bathyswath (SWATHplus) format data files (\fBMBIO\fP 
-format 222).                                                                                                          
-.TP
-.B \-G
-Print to stdout an ASCII representation of each data record read from the file.
-.TP
-.B \-H
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-.TP
-.B \-I
-\fIinfile\fP
-.br
-Sets the input file path. If \fIformat\fP > 0 (set with the
-\fB\-f\fP option or \fBmbdefaults\fP) then the swath sonar data contained in \fIinfile\fP
-is read and processed. If \fIformat\fP < 0, then \fIinfile\fP
-is assumed to be an ascii file containing a list of the input swath sonar
-data files to be processed and their formats.  The program will read
-the data in each one of these files.
-In the \fIinfile\fP file, each
-data file should be followed by a data format identifier, e.g.:
- 	datafile1 222 1
- 	datafile2 222 1
-.br
-This program only reads SWATHplus format data files (\fBMBIO\fP format 
-222). .                                                               
-.TP
-.B \-J
-\fIprojection\fP
-.br
-The SWATHplus software packages operate with navigation in a user-defined
-projected coordinate system.  Resultantly, SXP format files contain
-positions in a projected coordinate system rather than longitude and
-latitude in geographic coordinates.  Generally, the SXP files do not contain
-any description of the projection used to obtain the eastings and northings
-in those files.  This option allows a user to specifiy the projection used
-to translate the eastings and northings back into longitude and latitude. 
-If this option is not specified, \fBMB-System\fP will assume the data are
-associated with UTM zone 1 north.  The projection identifier must conform to
-the same usage as with projections specified for \fBmbgrid\fP.  For
-instance, to fully specify a particular northern UTM zone, set projection =
-UTMXXN where XX gives the UTM zone (defined from 01 to 60).  As an example,
-a northern UTM zone 12 projection can be specified using -JUTM12N.  Southern
-UTM zones are specified as UTMXXS.  The European Petroleum Survey Group
-(EPSG) has defined a large number of PCS's used worldwide and assigned
-number id's to each; one can also specify the northern UTM zone 12
-projection using its EPSG designation, or -Jepsg32612.  The complete list of
-projected coordinate systems supported by MB-System is given in the mbgrid
-manual page.
-.TP
-.B \-N
-Do not write output file. Useful for inspecting files, especially combined 
-with \fB\-G\fP.
-.TP
-.B \-O
-\fIoutfile\fP
-.br
-This option causes \fBmbswplspreprocess\fP to output all data to a single file
-specified as \fIoutfile\fP. By default, the program creates output files for
-each input file. If combined with \fB\-S\fP, this will serve as the basename
-for a set of output files, one for each transducer.
-.TP
-.B \-R
-This option removes all rejected samples from pings before writing output.
-.TP
-.B \-S
-This option saves each transducer channel into a separate output file. This is
-the best way to handle simultaneous pinging in MB System and the only way to
-handle 3 or more transducer channel systems. The transducer channel will
-be appended to the output filename as follows:
-.br
-outfile_txer<channel>.mb222
-.SH EXAMPLES
-Suppose that one has collected a SWATHplus datafile incorporating interferometric 
-sonar data from a 2-transducer system pinging simultaneously. The file name 
-is:
-.PP
-.nf
-.RS
-20140418_150155.sxp
-.RE
-.fi
-.PP
-To split each transducer into its own file for better filtering support 
-from MB System, to reset the amplitude values to their original pre-processed 
-values, and to strip out any previously flagged data run:
-.PP
-.nf
-.RS
-mbswplspreprocess \-SAR \-I20140418_150155.sxp
-.RE
-.fi
-.PP
-To export the data records stored in an SXP file to a text file:
-.PP
-.nf
-.RS
-mbswplspreprocess \-GN \-I20140418_150155.sxp > output.txt
-.RE
-.fi
-.PP
-.SH NOTES
-The SXP file format does not contain sufficient information to completely re-process 
-the data in MB System itself. For example, you should not attempt to re-calculate 
-bathymetry based on new sound velocity information. Ridged translations and
-rotations are OK (static shifts in x, y, or z, rotations about the transducer reference point) 
-provided that each transducer channel resides in its own file (see the \fB\-S\fP option). It is 
-always safe to edit and filter the soundings in \fBmbedit\fP and \fBmbeditviz\fP.                         
-.PP
-SXP files use a projected coordinate system for all transducer and sea 
-floor sample coordinates. The user must supply a .PRJ file defining the 
-coordinate system (usually UTM) for each input file before proceeding 
-with further processing in MB System. The coordinate system is not stored 
-in the SXP file data itself.                                          
-.SH SEE ALSO
-\fBmbsystem\fP(1), \fBmbformat\fP(1), \fBmbinfo\fP(1)
-
-.SH BUGS
-Oh yeah.
diff --git a/src/man/man1/mbsystem.1 b/src/man/man1/mbsystem.1
deleted file mode 100644
index 4e1ba7b..0000000
--- a/src/man/man1/mbsystem.1
+++ /dev/null
@@ -1,1515 +0,0 @@
-.TH mbsystem 1 "26 January 2015" "MB-System 5.5" "MB-System 5.5"
-.SH NAME
-\fBmbsystem\fP \- A set of utilities for manipulating and
-processing swath sonar bathymetry, amplitude, and sidescan data.
-
-.SH VERSION
-Version 5.5
-
-.SH AUTHORSHIP
-David W. Caress (caress at mbari.org)
-.br
-  Monterey Bay Aquarium Research Institute
-.br
-Dale N. Chayes (dale at ldeo.columbia.edu)
-.br
-  Lamont-Doherty Earth Observatory
-
-.SH INTRODUCTION
-\fBMB-System\fP is a software package consisting of programs which manipulate, process, list, or
-display swath sonar bathymetry, amplitude, and sidescan data. This software is distributed freely
-(and for free) in the form of source code for Unix platforms. The heart of the system is an
-input/output library called \fBMBIO\fP which allows programs to work transparently with any of a
-number of supported swath sonar data formats. This approach has allowed the creation of
-"generic" utilities which can be applied in a uniform manner to sonar data from a variety of
-sources. Most of the programs are command-line tools, but the package does include graphical
-tools for editing swath bathymetry, editing navigation, modeling bathymetry calculation, and
-adjusting survey navigation.
-
-The acronym MB stands for MultiBeam; this reflects the fact that the early development of
-\fBMB-System\fP focused on processing deep sea bathymetry data from ship-mounted multibeam
-sonars. However, \fBMB-System\fP now supports several data formats from sidescan and interferometric
-sonars and works with sonar data that map the seafloor at scales from centimeters to kilometers.
-
-The original National Science Foundation (NSF) mandate in 1993 was to create a set of generic tools
-that would work with all of the sonar data collected on U.S. academic research vessels in NSF-supported
-projects. Not surprisingly, the early core of the \fBMB-System\fP user community consisted of
-NSF-supported researchers at U.S. institutions such as the Lamont-Doherty Earth Observatory, the Scripps
-Institution of Oceanography, and the Woods Hole Oceanographic Institution. However, in recent years
-\fBMB-System\fP has also come to be used widely in the international oceanographic community and in the
-marine technology industry.
-
-The \fBMB-System\fP source code is distributed under the GNU General Public License as formulated
-by the GNU Project. \fBMB-System\fP installation depends on some other software packages (e.g.
-GMT and netCDF), all of which are freely available as source code.
-
-.SH COPYRIGHT AND LICENSING
-\fBMB-System\fP Copyright (C) 1993-2015 by
-.br
-David W. Caress (caress at mbari.org)
-    Monterey Bay Aquarium Research Institute
-    Moss Landing, CA 95039
-.br
-Dale N. Chayes (dale at ldeo.columbia.edu)
-    Lamont-Doherty Earth Observatory of Columbia University
-    Palisades, NY 10964
-.br
-All Rights Reserved
-.br
-All Wrongs Remembered
-
-The \fBMB-System\fP source code is distributed under the GNU General Public License as formulated
-by the GNU Project. Early \fBMB-System\fP distributions were described as "public domain",
-which meant there was no restrictions whatsoever on the use of the code. We adopted
-the more restrictive GNU GPL license in order to insure that anyone who distributes software
-based in whole or in part on \fBMB-System\fP also distributes the modified \fBMB-System\fP source code
-and any additional source code.
-
-The GNU GPL also prohibits the distribution of proprietary executables linked with
-\fBMB-System\fP libraries unless the source code is also distributed. We waive this restriction on
-distributing proprietary compiled programs for specific software products if and only if those
-software products meet the following two conditions:
-.RS
-.HP
-1) The software product was created, sold, and delivered to customers using source code
-derived from \fBMB-System\fP release 4.6 distributions.
-.br
-.HP
-2) The software product was sold and delivered to customers prior to January 1, 2001.
-.RE
-
-.SH HISTORY
-The development of \fBMB-System\fP began in 1990 as part of David Caress' research at
-the Lamont-Doherty Earth Observatory (LDEO), which involved swath bathymetry data collected
-with SeaBeam multibeam sonars. Development was accelerated in 1991 as part of an effort to
-support the new STN-Atlas Hydrosweep DS multibeam sonar on LDEO's ship, the R/V Maurice Ewing.
-Dale Chayes, a Lamont-Doherty engineer, was responsible for the maintenance and operation
-of the Ewing's Hydrosweep. As part of a grant in 1993 and 1994 to Chayes and Caress to upgrade
-the Hydrosweep operations on the Ewing, the National Science Foundation provided support
-to improve and extend \fBMB-System\fP. The intent of this initial grant was to provide a
-standard "generic" set of tools for processing and display of swath sonar data that could
-be used by the U.S. academic community. The first generally released version of \fBMB-System\fP
-(3.0) was made available in the Spring of 1993. This was followed by versions 3.1 and 3.2 in
-July, 1993, version 3.3 in November, 1993, and version 3.4 in December 1993. All of these
-early releases supported only SeaBeam and Hydrosweep data.
-
-SeaBeam Instruments and Antarctic Support Associates provided additional support in
-1994 for the development of \fBMB-System\fP, with particular emphasis on capabilities related
-to the new SeaBeam 2100 series of sonars. A considerably enhanced \fBMB-System\fP version
-4.0 was released on October 22, 1994; this release followed an almost complete rewrite of
-the underlying source code. The new capabilities included support for sidescan as well as
-bathymetry data and support for data from a number of very different sonars.
-
-The National Science Foundation funded a five year effort begun in 1995 to maintain and
-further develop \fBMB-System\fP. From 1994 to 1997, SeaBeam Instruments (a major
-multibeam sonar manufacturer and, at the time, the principal employer of David W.
-Caress) provided significant support for \fBMB-System\fP development and maintenance.
-Similarly, the Newport, RI office of the Science Applications International Corporation
-(SAIC) supported some \fBMB-System\fP development during 1997-1998, when David W.
-Caress worked there. Version 4.1 was released in November, 1994, followed by 4.2 in
-February 1995, 4.3 on March 12, 1996, 4.4 on August 27, 1996, and 4.5 on September 23,
-1997.
-
-David Caress joined the Monterey Bay Aquarium Research Institute (MBARI) in
-September, 1998. Version 4.6 was released on April 16, 1999. The final update to version
-4.6 (4.6.10) was announced on March 8, 2000. The primary innovations during this period
-included support for the new generation of Simrad multibeam sonars and tools for
-generating data products that could be imported directly into GIS software packages.
-
-The National Science Foundation has continued to support \fBMB-System\fP development through
-additional five year grants (2001-2006 & 2006-2011) to MBARI and
-L-DEO. The Packard Foundation matches the NSF support to Caress at MBARI. The version 5.0 release
-incorporated another substantial rewrite of the underlying code as well as providing
-significant new capabilities. Thirty one 5.0 "beta" distributions were released during
-2001-2003, with the full 5.0.0 version released on December 5, 2003. Active development
-continued with 5.1.0 released on November 26, 2006, 5.1.1 on December 31, 2008.
-and 5.1.2 on December 31, 2009. Since the advent of 5.0, over sixty "beta" and "official"
-distributions of \fBMB-System\fP have been released. Beginning with 5.2.1880 on December 30, 2010,
-\fBMB-System\fP distributions are tied to the revisions in the source code archive (the third number
-corresponds to the revision id in the archive).
-
-Since 2004 a major theme of \fBMB-System\fP development has been the processing of multibeam, sidescan,
-and subbottom profiler data collected on submerged platforms, particularly autonomous
-underwater vehicles (AUVs).
-
-.SH WHAT'S NEW ABOUT VERSION 5
-The version 5.0 release of \fBMB-System\fP included a number of changes and improvements relative
-to the version 4 releases. The most significant changes included:
-
-.SS A new approach to managing data processing.
-.IP \(bu 4
-Many tools \- one output file. In previous versions of \fBMB-System\fP, each processing
-program read an input swath data file and produced an output swath data file. This
-"serial" processing scheme generally produced a large number of intermediate data
-files. \fBMB-System\fP version 5.0 features the integration of the editing and analysis
-tools with a single program, mbprocess, that outputs processed data files. The new
-"parallel" processing scheme covers bathymetry data processing, but does not yet
-incorporate the sidescan processing capabilities. All of the old tools and capabilities
-are still part of the distribution.
-.IP \(bu 4
-Recursive datalists. The lists of data files used by gridding and plotting programs can
-now be recursive, making it simpler to manage data from many different surveys.
-.IP \(bu 4
-Automatic format identification. \fBMB-System\fP programs will now attempt to
-automatically identify the swath data format based on the filename suffix.
-.IP \(bu 4
-Ancillary data files. Many common \fBMB-System\fP tasks (e.g. swath plotting
-and gridding) can be accomplished more rapidly using ancillary data files containing
-file statistics (".inf" files), quickly read bathymetry (".fbt" files), and
-(".fnv") files. Each of these files is named by adding the indicated four character
-suffix to the original swath data filename. The ".inf" files are created by directing
-the output of \fBmbinfo\fP to a file. The ".fbt" files are creating by using
-\fBmbcopy\fP to extract the bathymetry into a format 71 file. The ".fnv" files
-are created using \fBmblist\fP to create a text navigation list.
-These ancillary files are automatically created together using the
-program \fBmbdatalist\fP.
-
-.SS New tools.
-.IP \(bu 4
-\fBmbnavadjust\fP. This new tool allows users to adjust poorly navigated surveys by
-matching features in overlapping swathes. It is particularly useful for processing
-surveys conducted from submerged platforms.
-.IP \(bu 4
-\fBmbprocess\fP. This new tool performs a variety of processing tasks and produces a
-single output processed swath data file. The program mbprocess can apply
-bathymetry edits from mbedit and mbclean, navigation edits from mbnavedit, sound
-velocity profile changes from mbvelocitytool, and a variety of other corrections.
-.IP \(bu 4
-\fBmbset\fP. This new tool allows users to create and modify the parameter files used to
-control the operation of mbprocess.
-.IP \(bu 4
-\fBmbdatalist\fP. This new tool allows users to list the files referenced by
-a recursive datalist structure. It can also be used to create the ancillary ".inf",
-".fbt", and ".fnv" files for all of the data files referenced in a recursive datalist
-structure.
-.IP \(bu 4
-\fBmbsvplist\fP. This new tool lists water sound velocity profiles embedded
-in swath data files, creating secondary files that
-can be read into MBvelocitytool.
-.IP \(bu 4
-\fBmbareaclean\fP. This new tool identifies and flags artifacts in swath sonar
-bathymetry data within a specified area of interest. The
-area is divided into a grid with square cells or bins, and the
-data are grouped according to these bins. Once all
-of  data  are read, statistical tests are applied
-to the soundings within each bin.
-
-.SS Support for Projected Coordinate Systems.
-.IP \(bu 4
-\fBMB-System\fP now incorporates the source code for the PROJ.4 Cartographic Projections library,
-providing support for (apparently) all commonly used geodetic coordinate systems.
-\fBPROJ.4\fP was developed by Gerald Evenden (then of the USGS), and was obtained from
-the www.remotesensing.org website.
-.IP \(bu 4
-A large number of commonly used projected coordinate systems (e.g. UTM) are defined
-in a file (mbsystem/share/projections.dat) distributed with \fBMB-System\fP. These include
-all of the standard UTM zones, all of the standard state plate coordinate systems, and
-most of the European Petroleum Survey Group (EPSG) coordinate systems (also including UTM).
-.IP \(bu 4
-\fBMB-System\fP can now handle swath data that is navigated in a supported projected
-coordinate system. In particular, data files that are navigated with UTM eastings and
-northings instead of longitude and latitude can now be plotted and processed with
-\fBMB-System\fP.
-.IP \(bu 4
-The programs \fBmbgrid\fP and \fBmbmosaic\fP can now output grids and mosaics in any of
-the projected coordinate systems specified in mbsystem/share/projections.dat.
-.IP \(bu 4
-The TIFF images generated with \fBmbm_grdtiff\fP and \fBmbgrdtiff\fP now fully conform
-to the GeoTIFF standard, providing that the source grids or mosaics were generated
-using \fBmbgrid\fP or \fBmbmosaic\fP in either Geographic coordinates, UTM coordinates,
-or any of the EPSG coordinate systems specified in the projections.dat file. This means,
-for instance, that GeoTIFF images generated with \fBmbgrdtiff\fP will be properly
-georeferenced when they are imported into ESRI \fBArcGIS\fP or other GIS packages.
-
-.SS Restructuring the code.
-.IP \(bu 4
-All of the C code now conforms to the ANSI C standard.
-.IP \(bu 4
-The underlying input/output library (\fBMBIO\fP) has been substantially rewritten. The
-structure has been streamlined, simplifying both future development and support of
-the existing code. The \fBMBIO\fP API has been greatly modified.
-
-.SS Handling of old Simrad multibeam data.
-.IP \(bu 4
-Vendor format data from the old Simrad multibeams (pre-1997 sonars) are now
-supported by a single format id (51) rather than a separate format id for each sonar
-model. The old format id's are automatically aliased to 51, so existing shellscripts
-will continue to work.
-.IP \(bu 4
-\fBMB-System\fP no longer supports beam flagging in format 51 data. The use of mbedit and mbclean on format 51
-data will cause the flagged beams to be irrevocably nulled. Previous versions of \fBMB-System\fP used the highest bit
-in the depth values to represent beam flags because no Simrad data seemed to use that bit. We have not obtained
-data with depth values using the full bit-range, conflicting with the old beam flagging scheme. We recommend
-that old Simrad data be translated to the extended processing format (57) which contains proper beam flags and
-supports all processing functions. Format 57 is also used for processing data from the current Simrad multibeam
-sonars.
-.IP \(bu 4
-Sidescan data from old Simrad multibeams (pre-1997 sonars) are now handled in the same manner as data from
-the newer sonars (e.g. EM3000, EM3000, EM120). The raw samples in the vendor data format are binned,
-averaged, and interpolated into a 1024 pixel sidescan swath. This binned sidescan is not saved in the vendor
-format, so (as above) it is recommended that the data be translated to an extended format (57) that stores both
-bathymetry beam flags and processed sidescan.
-
-.SS Streamlining of MB-System Default Parameters.
-.IP \(bu 4
-Prior to version 5.0, the \fBMB-System\fP defaults
-set by \fBmbdefaults\fP included the format id, a control for
-ping averaging, longitude and latitude bounds for windowing
-by area, and begin and end times for windowing in time. These
-values are no longer set in the .mbio_defaults file or controlled
-by \fBmbdefaults\fP. As noted above, the format id is automatically
-identified from the filename when possible. When filenames do not
-match one of the recognized structures, users must specify the
-format using the relevant programs \fB\-F\fP\fIformat\fP option.
-The controls for ping averaging and windowing in time and space
-are rarely used, and must now be explicitly set in command
-line arguments.
-
-.SS New Data Formats.
-.IP \(bu 4
-Furuno HS10 multibeam bathymetry is supported as format 171.
-.IP \(bu 4
-SeaBeam 2120 multibeam data in the L3 Communications XSE format are supported as format 94 (already used
-to support Elac Bottomchart MkII XSE data).
-.IP \(bu 4
-Raw STN Atlas multibeam data generated by the upgraded Hydrosweep DS2 multibeam on the R/V Ewing are
-supported by read-only format 182. Processing is supported using the augmented read-write format 183.
-.IP \(bu 4
-The IFREMER netCDF multibeam archiving data format is supported as format 75. Similarly, the IFREMER
-netCDF navigation archiving data format is supported as format 167.
-.IP \(bu 4
-The STN Atlas processing data format SURF is supported as format 181. At
-present, SURF is supported as a read-only format. This allows plotting and gridding
-of the SURF data, but not processing. Writing or translating the SURF data to
-allow processing will be supported in a later version.
-.IP \(bu 4
-The Hawaii Mapping Research Group's new MR1 format is supported as format 64.
-This format is used to disseminate data from both the HMRG
-interferometric sonars (e.g. MR1) and the WHOI DSL 120
-deep-towed inteferometric sonar. This format has been
-supported by including the code for the HMRG library libmr1pr
-in the \fBMB-System MBIO\fP library. Thanks to Roger Davis and HMRG for
-making the code available under the GPL.
-.IP \(bu 4
-The Edgetech Jstar format for sidescan and subbottom data is
-now supported as formats 132 and 133.
-
-.SH THE NEW VERSION 5 DATA PROCESSING STRUCTURE
-Previous versions of \fBMB-System\fP have emphasized
-processing utilities that operate serially, that is, that
-read in an input swath data file, modify it, and then
-output a second swath data file. Serial processing utilities do allow
-for great flexibility in processing because one uses only
-the programs required and, in general, the order in which
-the programs are used does matter. However, one consequence of serial
-processing has been that processing data frequently results in a large
-number of intermediate data files. For instance, if
-an EM300 data file called "mbari_1998_524.mb57" has
-spikes in the bathymetry, outliers in the navigation, and
-the bathymetry has been calculated using an incorrect model
-for the water sound speed structure, users of \fBMB-System\fP
-would previously have processed it with a sequence
-something like this:
-
-     1) Run \fBmbclean\fP to automatically flag
-        the obvious bathymetric artifacts.
-            Input:  mbari_1998_524.mb57
-            Output: mbari_1998_524_c.mb57
-
-     2) Run \fBmbedit\fP to interactively flag
-        bathymetric artifacts.
-            Input:  mbari_1998_524_c.mb57
-            Output: mbari_1998_524_ce.mb57
-
-     3) Run \fBmbnavedit\fP to interactively clean
-        the navigation.
-            Input:  mbari_1998_524_ce.mb57
-            Output: mbari_1998_524_cen.mb57
-
-     4) Run \fBmbvelocitytool\fP to generate an
-        appropriate sound velocity profile (SVP) for
-        recalculating the bathymetry.
-            Input:  mbari_1998_524_cen.mb57
-            Output: good.svp
-
-     5) Run \fBmbbath\fP to recalculate the
-        bathymetry using the SVP file generated
-        using \fBmbvelocitytool\fP.
-            Input:  mbari_1998_524_cen.mb57
-            Input:  good.svp
-            Output: mbari_1998_524_cenb.mb57
-
-     6) Run \fBmbsimradmakess\fP to recalculate the
-            sidescan while ignoring sidescan samples
-            from beams now flagged as bad.
-            Input:  mbari_1998_524_cenb.mb57
-            Output: mbari_1998_524_cenbs.mb57
-
-     7) Run \fBmbbackangle\fP to calculate an amplitude
-      vs grazing angle table for correcting
-      sidescan.
-            Input:  mbari_1998_524_cenbs.mb57
-            Output: ampvsga.dat
-
-     8) Run \fBmbanglecorrect\fP to correct the sidescan.
-            Input:  mbari_1998_524_cenbs.mb57
-            Input: ampvsga.dat
-            Output: mbari_1998_524_cenbsc.mb57
-
-The result of this processing includes the input swath
-data file, the final swath data file, and five
-intermediate swath data files. The impact of this approach
-on data storage requirements is obvious (though some users
-have ameliorated the issue by working with scripts that
-automatically delete unneeded data files or by piping
-data from one non-graphical process to
-another to avoid making intermediate files).
-The serial processing approach
-also presents data management problems because data files
-frequently have different processing requirements, even
-within a single survey. We have found that working with
-very large datasets can be awkward when only a minority
-of data files require navigation editing or bathymetric
-recalculation, or when some data files require multiple
-episodes of bathymetry and navigation editing.
-
-\fBMB-System\fP version 5 includes new utilities implementing
-a parallel processing scheme that simplifies the processing
-of most swath data. This scheme is centered around the program
-\fBmbprocess\fP, which can accomplish the following
-processing tasks in a single step:
-.RS
-.IP \(bu 4
-Merge edited navigation generated by \fBmbnavedit\fP.
-.IP \(bu 4
-Apply bathymetry edit flags from \fBmbedit\fP
-and \fBmbclean\fP
-.IP \(bu 4
-Recalculate bathymetry from raw travel time and
-angle data by raytracing through water sound speed
-models from \fBmbvelocitytool\fP or \fBmbsvplist\fP.
-.IP \(bu 4
-Apply changes to roll bias, pitch bias, heading
-bias, and draft values.
-.IP \(bu 4
-Recalculate sidescan from raw backscatter samples
-(Simrad multibeam data only).
-.IP \(bu 4
-Recalculate sidescan from raw backscatter samples
-(Simrad multibeam data only).
-.IP \(bu 4
-Correct sidescan for amplitude vs grazing angle
-patterns.
-.IP \(bu 4
-Apply tides to bathymetry.
-.br
-.RE
-The actions of \fBmbprocess\fP are controlled by text
-parameter files. Each \fBmbprocess\fP parameter file is
-named by adding a ".par" suffix to the associated input
-swath data file and contains single line commands that set
-processing modes and parameters. Tools such as \fBmbedit\fP,
-\fBmbnavedit\fP, and \fBmbclean\fP all generate and/or modify
-parameter files in addition to generating parallel files
-used by \fBmbprocess\fP. The program \fBmbset\fP
-can also be used to create and modify \fBmbprocess\fP
-parameter files.
-
-The same processing steps described above as a serial
-processing scheme can be accomplished with the new parallel
-processing scheme as follows:
-
-     1) Run \fBmbdatalist\fP to create ancillary
-        data files containing statistics
-        (".inf"), quickly read bathymetry
-        (".fbt"), and quickly read navigation
-        (".fnv"). These files are used to
-        speed common operations such as swath
-        plotting and gridding.
-            Input:  mbari_1998_524.mb57
-            Output: mbari_1998_524.mb57.inf
-                    mbari_1998_524.mb57.fbt
-                    mbari_1998_524.mb57.fnv
-
-     2) Run \fBmbclean\fP to identify
-        the obvious bathymetric artifacts
-        and output a list of the edit events.
-        The parameter file is created and
-        set to apply bathymetry flags from
-        the ".esf" file.
-            Input:  mbari_1998_524.mb57
-            Output: mbari_1998_524.mb57.esf
-                    mbari_1998_524.mb57.par
-
-     3) Run \fBmbedit\fP to interactively
-        identify bathymetric artifacts
-        and output a list of the edit events.
-        The existing edits from \fBmbclean\fP
-        are loaded and applied prior to editing.
-        The parameter file is updated and
-        set to apply bathymetry flags from
-        the ".esf" file.
-            Input:  mbari_1998_524.mb57
-                    mbari_1998_524.mb57.esf
-                    mbari_1998_524.mb57.par
-            Output: mbari_1998_524.mb57.esf
-                    mbari_1998_524.mb57.par
-
-     4) Run \fBmbnavedit\fP to interactively
-        clean the navigation. The edited
-        navigation is output to the ".nve" file.
-        The parameter file is updated and
-        set to merge the navigation from
-        the ".nve" file.
-            Input:  mbari_1998_524.mb57
-                    mbari_1998_524.mb57.par
-            Output: mbari_1998_524.mb57.nve
-                    mbari_1998_524.mb57.par
-
-     5) Run \fBmbvelocitytool\fP to generate an
-        an appropriate sound velocity profile
-        (SVP) for recalculating the bathymetry.
-        The SVP is output to the ".svp" file.
-        The parameter file is updated and
-        set to recalculate the bathymetry by
-        raytracing through the SVP model from
-        the ".svp" file.
-            Input:  mbari_1998_524.mb57
-                    mbari_1998_524.mb57.par
-            Output: mbari_1998_524.mb57.svp
-                    mbari_1998_524.mb57.par
-
-     6) Run \fBmbbackangle\fP to generate an
-        a set of amplitude vs grazing angle
-        tables at regular intervals in the
-        data. These tables are placed into
-        a single ".sga" file. The parameter
-        file is updated and set to correct
-        the sidescan by interpolating the
-        amplitude vs grazing angle table for
-        each ping.
-            Input:  mbari_1998_524.mb57
-                    mbari_1998_524.mb57.par
-            Output: mbari_1998_524.mb57.sga
-                    mbari_1998_524.mb57.par
-
-     7) Run \fBmbset\fP to set the parameter file
-        so that mbprocess will recalculate
-        the sidescan (this is for Simrad
-        multibeam data only) while ignoring
-        sidescan samples from beams now flagged
-        as bad.
-            Input:  mbari_1998_524.mb57.par
-            Output: mbari_1998_524.mb57.par
-
-     8) Run \fBmbprocess\fP to apply the bathymetric
-        edits, merge the cleaned navigation,
-        recalculate the bathymetry, recalculate
-        the sidescan, and correct the sidescan.
-        The processed swath data is written to
-        an output swath data file. The usual
-        ancillary data files containing statistics,
-        quickly read bathymetry, and quickly
-        read navigation are also created.
-            Input:  mbari_1998_524.mb57
-                    mbari_1998_524.mb57.esf
-                    mbari_1998_524.mb57.nve
-                    mbari_1998_524.mb57.svp
-                    mbari_1998_524.mb57.aga
-                    mbari_1998_524.mb57.par
-            Output: mbari_1998_524p.mb57
-                    mbari_1998_524p.mb57.inf
-                    mbari_1998_524p.mb57.fbt
-                    mbari_1998_524p.mb57.fnv
-
-The result of this processing is a single output swath
-data file. Moreover, the processed output can be easily
-updated if, for example, additional bathymetry editing
-is required. If the \fBmbedit\fP program is used again,
-it will load the existing edit events from the ".esf"
-file and then update the ".esf" file. To incorporate the
-updated bathymetry edits, one just runs \fBmbprocess\fP
-again. One can similarly change the SVP file without
-impacting on the bathymetry editing or navigation editing
-components of the processing.
-
-All of the old, serial processing utilities are still
-distributed with \fBMB-System\fP. However, some of the serial
-tools have been replaced by new versions of the same name
-(e.g. \fBmbedit\fP, \fBmbclean\fP, \fBmbbackangle\fP, and \fBmbnavedit\fP).
-In these cases, the old versions are preserved as programs
-with "old" added to their names (e.g. \fBmbeditold\fP,
-\fBmbcleanold\fP, \fBmbbackangleold\fP, and \fBmbnaveditold\fP).
-
-.SH THE NEW VERSION 5 DATALIST FILES
-Previous versions of \fBMB-System\fP have used lists of
-data files, or datalists, as input to several programs
-(e.g. \fBmbgrid\fP, \fBmbmosaic\fP, \fBmbinfo\fP,
-\fBmblist\fP, and \fBmbm_plot\fP). The basic datalist
-entry has consisted of a swath data name (often including
-the entire path) followed by a space and then the \fBMB-System\fP format
-id for that file. Datalist entry lines starting with
-the character '#' are considered comments. Version 5 extends
-the definition and usage of datalists in several
-significant ways. First, datalists may now be recursive.
-A datalist entry may be another datalist file, as indicated
-by a format id of \-1. Second, datalists entries may contain
-a third column which is interpreted as a gridding weight
-value by \fBmbgird\fP. This third value may be used to
-weight some data higher than other data. For example, one might
-weight SeaBeam 2112 data with a value of 1.0 and lower
-quality SeaBeam classic data with a value of 0.001. The result
-would be that the newer 2112 data effectively overlies the less good
-data wherever overlap occurs. The third new feature of datalists
-works with data processed using the new parallel processing scheme.
-In the parallel processing scheme the raw data files are often,
-but not always,
-accompanied by processed files produced by \fBmbprocess\fP.
-It is awkward to maintain datalists that directly refer to the
-current best datafiles. If one inserts the text $PROCESSED
-into the first line of a datalist containing raw files,
-then programs like \fBmbgrid\fP will read the processed file
-if it exists, but otherwise will read the raw file. Similarly,
-a first line of $RAW will force the programs to only
-read the raw files directly referenced in the datalist. These
-options also work recursively. The first instance of
-a $PROCESSED or $RAW tag will prevail over all
-others encountered through a hierarchy of recursive datalists.
-The gridding weight values will also be applied recursively,
-so one can specify the gridding weight for a large number of
-data files by applying to a datalist entry which is itself
-a datalist referencing those files. However, gridding weights
-are by default overridden by any values applied to the file
-entries themselves (this behavior can be reversed using the
-datalist tag $NOLOCALWEIGHT).
-
-.SH VERSION 5 FILE NAMING CONVENTIONS
-The version 5 \fBMB-System\fP programs make extensive use
-of standardized filename suffixes. These suffixes allow
-\fBMB-System\fP programs to know what kinds of files it is working
-with, and in particular to determine swath data formats without
-the user having to specify them. Although the processing will
-generally work even if a user does not use the standard
-filenaming convention, we can guarentee that the user's work
-will be much easier if the convention is followed. Quite
-simply, the convention is for swath files to end with a
-suffix of the format ".mbXX" or ".mbXXX", where XX or XXX
-is the two digit or three digit \fBMB-System\fP format id,
-respectively. For instance, a Simrad EM3000 file in the
-processing format 57 might have a name like:
- 	0053_20020518_205816.mb57
-.br
-and a Reson 8101 file in the GSF format 121 might have
-a name like:
- 	039_2106.mb121
-.br
-\fBMB-System\fP programs are able to recognize many standard
-filename conventions used by sonar vendors or data logging
-package vendors. For instance, filenames with a "_raw.all"
-suffix, like:
- 	0053_20020518_205816_raw.all
-.br
-are recognized as either old (format 51) or new (format 56)
-Simrad multibeam data (and the programs also determine which
-of the two formats apply). Filenames ending with ".rec" are
-recognized as SeaBeam 2100 multibeam data. Filenames ending
-with ".xse" are known to be Elac Bottomchart or SeaBeam
-2100 multibeam data in the XSE format 94. In these instances
-the program \fBmbprocess\fP will automatically replace the
-vendor suffix with the \fBMB-System\fP convention suffix when
-it creates a processed output file.
-
-.SH LIST OF MB-SYSTEM PROGRAMS AND MACROS
-See the individual manual pages for detailed information about
-specific programs.
-See the manual page for \fBMBIO\fP for information about the
-i/o library and the swath sonar data formats supported by \fBMBIO\fP.
-
-These are the MB-system programs which are used in the
-version 5 parallel processing scheme. Those programs that
-are also relevant to the serial processing scheme are
-marked with an *:
- \fBmb7k2jstar\fP: Extract Jstar format (format 132) sidescan
- 		and subbottom data from Reson 7k (format 88)
- 		data files.
- \fBmb7k2ss\fP: Extract sidescan sonar data from Reson 7k format
- 		data, bins and lays the sidescan onto the
- 		seafloor, and outputs files in the MBF_MBLDEOIH
- 		formst (MBIO format 71).
- \fBmb7kpreprocess\fP: Preprocess Reson 7k data (MBIO format 88),
- 		including applying time lag and biases to
- 		attitude and navigation data.
- \fBmbhysweeppreprocess\fP: Preprocess multibeam data in the
- 		Hysweep HSX format (MBIO format 201).
- \fBmbkongsbergpreprocess\fP: Preprocess data from third generation
- 		Kongsberg multibeam sonars (MBIO formats 58 and 59).
- \fBmbbackangle\fP:  Generates tables of the average
- 		amplitude or sidescan values as a
- 		function of the grazing angle with
- 		the seafloor at regular intervals in
-		the data.
- \fBmbclean\fP:  Automatically identifies and
- 		flags bad beams in swath sonar
- 		bathymetry data.
- \fBmbcontour\fP*:  Generate GMT compatible Postscript
- 		color swath contour plots.
- \fBmbcopy\fP*:  Copy swath sonar data files.
- \fBmbdatalist\fP:  Parses recursive datalist files
-  		and outputs the  complete  list  of
- 		data  files,  formats,  and  file weights.
- \fBmbdefaults\fP*:  Set or list default mbio parameters
- 		for reading and writing swath sonar data
- \fBmbedit\fP:  Interactive editor used to flag bad
- 		beams in swath sonar bathymetry data.
- \fBmbextractsegy\fP: Extract subbottom profiler or
- 		center beam reflection data to segy files.
- \fBmbformat\fP*:   List information about swath sonar
- 		data formats supported by the \fBMBIO\fP library.
- \fBmbgetesf\fP*:  Extract list of flagging or unflagging
- 		beam edit events from a swath sonar data
- 		file in the edit save file (".esf") format
- 		used by \fBmbedit\fP, \fBmbclean\fP, and
- 		\fBmbprocess\fP.
- \fBmbgrdtiff\fP: Generate TIFF image from gridded data
- \fBmbgrdviz\fP: Vizualize GMT grids.
- \fBmbgrid\fP*:  Grid bathymetry, amplitude, and sidescan
- 		data from swath sonar data files.
- \fBmbhistogram\fP*:  Obtain histogram of bathymetry,
- 		amplitude, or sidescan data from
-  		swath sonar data files.
- \fBmbinfo\fP*:  Output some basic statistics of
- 		swath sonar data files.
- \fBmblevitus\fP*:  Create a water velocity profile
- 		which is representative of the mean
- 		annual water column for a specified
- 		1 degree by 1 degree region.
- \fBmblist\fP*:  List data in swath sonar data files.
- \fBmbmosaic\fP*:  Mosaic sidescan and amplitude data.
- \fBmbnavadjust\fP:  Interactive navigation adjustment
- 		package that adjusts navigation so
- 		that swath bathymetry matches where
- 		swathes overlap or cross.
- \fBmbnavedit\fP:  Interactive editor used to fix
- 		problems with navigation in
- 		swath sonar data files.
- \fBmbnavlist\fP*:  List navigation data in swath
- 		sonar data files.
- \fBmbneptune2esf\fP: Extract bathymetry edits from
- 		Simrad Neptune software into edit save
-		file format.
- \fBmbprocess\fP: Performs a variety of processing
- 		tasks in a single step, including
- 		merging navigation, applying
- 		bathymetry edits, recalculating
- 		bathymetry, and recalculating
- 		sidescan.
- \fBmbps\fP*:    Simple perspective views of swath
- 		bathymetry in Postscript.
- \fBmbrolltimelag\fP:  Estimate attitude time lag by cross
- 		correlation of apparent bottom slope with the
- 		roll time series:
- \fBmbsegygrid\fP: Generate time vs. trace number
- 		grids of seismic data from segy files.
- \fBmbsegyinfo\fP: Output some basic statistics of
- 		segy seismic data files.
- \fBmbsegylist\fP: List selected header values in
- 		segy seismic data files.
- \fBmbset\fP:  Create and modify \fBmbprocess\fP
- 		parameter files.
- \fBmbsvplist\fP*:  List water sound velocity profiles in swath
- 		sonar data files.
- \fBmbswath\fP*:  Generate GMT compatible Postscript
- 		color and color shaded relief swath plots.
- \fBmbvelocitytool\fP*:  Interactive program for
- 		modeling the affect of the water
- 		velocity profile on swath sonar
- 		bathymetry calculations.
-
-The following are MB-system programs which are not used in the
-version 5 parallel processing scheme. These programs are
-included in the version 5 releases for backward compatibility
-with the old serial processing scheme:
- \fBmbhsdump\fP:  Lists contents of the various sorts of
- 		data records in Hydrosweep DS data.
- \fBmbanglecorrect\fP:  Apply a grazing angle correction
- 		to beam amplitude or sidescan data.
- \fBmbbackangle\fP:  Generates a table of the average
- 		amplitude or sidescan values as a
- 		function of the grazing angle with
- 		the seafloor.
- \fBmbbath\fP:  Generates bathymetry from travel times
- 		in swath sonar data.
- \fBmbcleanold\fP:  Old tool that utomatically
- 		identifies and flags bad beams
- 		in swath sonar bathymetry data.
- \fBmbcut\fP:  Removes data from portions of swath
- 		as specified by the user.
- \fBmbeditold\fP:  Old interactive editor used to flag bad
- 		beams in swath sonar bathymetry data.
- \fBmbfilter\fP:   Apply some simple filter functions
- 		to sidescan, beam amplitude, or
- 		bathymetry data.
- \fBmbgetmask\fP:  Extract list of flagged or edited
- 		beams from a swath sonar data file.
- \fBmbmask\fP:  Apply editing information obtained
- 		from one file with \fBmbgetmask\fP
- 		to another file.
- \fBmbmerge\fP:  Merge swath sonar data with new
- 		navigation.
- \fBmbnaveditold\fP:  Old interactive editor used to fix
- 		problems with navigation in
- 		swath sonar data files.
- \fBmbrollbias\fP:  Evaluate the roll bias of a
- 		swath sonar system using two pieces
- 		of coincident bathymetry data
- 		collected with opposing ship headings.
- \fBmbsimradmakess\fP:  Regenerate sidescan imagery
- 		from the raw amplitude samples contained
- 		in data from Simrad EM300 and EM3000 sonars.
- \fBmbtide\fP:  Corrects swath sonar bathymetry
- 		for tide data.
- \fBmbunclean\fP:  Unflags edited beams in swath sonar
- 		bathymetry data.
-
-Macros are programs or shellscripts which make use of programs
-from the MB-system and other software packages to accomplish common
-tasks easily.  These are the current MB-system macros:
- \fBmbm_arc2grd\fP:  Convert an ESRI ArcView ASCII grid file
- 		to a GMT grid file.
- \fBmbm_copy\fP:  Translate groups of swath data files
- 		between formats
- \fBmbm_dslnavfix\fP:  Reads a WHOI DSL AMS-120 processed
- 		navigation file containing UTM northings
- 		and eastings and outputs a navigation file
- 		containing longitude and latitude which is
- 		suitable for use with \fBmbmerge\fP.
- \fBmbm_fmtvel\fP:  Scans a Hydrosweep DS data file
- 		and outputs a formatted table of
- 		the mean water velocity and surface
- 		water velocity values used in
- 		processing that data.
- \fBmbm_grd2arc\fP:  Converts a GMT grid file to an ESRI ArcView
- 		ASCII grid file.
- \fBmbm_grd2geovrml\fP:  Create and execute commands which
-  		generate a TerraVision tileset and GeoVRML
- 		set  of  files  that can  be combined with
- 		other data and viewed in a web browser.
- \fBmbm_grd3dplot\fP:  Reads a GMT GRD grid file and
- 		writes a shellscript which will
- 		generate a GMT 3D perspective view
- 		of the data.
- \fBmbm_grdcut\fP:  Extracts a subarea of a GMT grid file.
- \fBmbm_grdplot\fP:  Reads a GMT GRD grid file and
- 		writes a shellscript which will
- 		generate a GMT map of the data.
- \fBmbm_grdtiff\fP:  Reads a GMT GRD grid file and writes a
- 		shellscript which will generate a TIFF image
- 		of the data.
- \fBmbm_grid\fP:  Reads a swath sonar data file and writes a
- 		shellscript which will grid bathymetry data or
- 		mosaic sidescan (or amplitude) data using
- 		reasonable guesses at the appropriate grid
- 		bounds and bin size.
- \fBmbm_makedatalist\fP: Generates an MB-System datalist
- 		file referencing  all identifiable swath
- 		files in the specified target directory.
- \fBmbm_plot\fP:  Reads a swath sonar data file and
- 		writes a shellscript which will
- 		generate a swath and/or contour
- 		plot of the data.
- \fBmbm_rollerror\fP:  Reads a swath sonar data file,
- 		calculates the noise in the vertical reference
- 		used by the sonar, and generates a file
- 		containing roll corrections which
- 		can be applied to the data.
- \fBmbm_route2mission\fP:  Translate an mbgrdviz survey route
- 		file into an MBARI AUV mission script.
- \fBmbm_stat\fP:  Runs \fBmbinfo\fP on a swath sonar data
- 		file and extracts beam statistics from
- 		the output of \fBmbinfo\fP.
- \fBmbm_utm\fP: Performs forward and inverse UTM projections
- 		of ASCII data triples.
- \fBmbm_vrefcheck\fP:  Generates a plot of high pass
- 		filtered apparent crosstrack seafloor slope.
- \fBmbm_xbt\fP:  Processes a Sparton XBT data file
- 		and outputs a sound velocity profile
- 		file which can be used to process
- 		swath sonar data.
- \fBmbm_xyplot\fP:  Reads one or more ASCII "X-Y"
- 		data files and writes a shellscript
- 		which will generate an XY plot of the data.
-
-.SH EXAMPLE PROCESSING APPROACH
-
-An example processing stream for swath sonar data
-which uses the new, parallel processing
-scheme is provided here. Note that a '\' character at
-the end of a line indicates
-that the command line should actually continue with the
-text on the next line. Refer to individual program manual
-pages for detailed information on the command arguments and
-functionality of the various programs.
-
-.SH PROCESSING SEABEAM 2100 DATA
-
-The following data processing stream is recommended for
-data obtained with SeaBeam 2100 series multibeam sonars.
-A number of SeaBeam 2112 sonars were installed on academic
-research vessels during the 1990's, including the R/V Knorr
-and R/V Atlantis operated by the Woods Hole Oceanographic
-Institution, the R/V Revelle operated by the Scripps Institution
-of Oceanography, the R/V Ronald Brown operated by NOAA,
-R/V Mirai and R/V Kairai operated by JAMSTEC and other vessels.
-This same approach is appropriate for data from all other
-multibeam sonars, with small variations. The issues and
-differences associated with data from certain other types
-of sonars are discussed in the following sections.
-
-Consider a data file "sb199411211212.rec"
-containing one hour's worth of
-SeaBeam 2112 data in the vendor format (format 41).
-This file contains bathymetry, beam amplitude, and
-sidescan data. The following commands
-are typical for processing such data and generating
-preliminary maps.
-
-\fBStep 1\fP: What's in the data file?
-
-First we run \fBmbinfo\fP to obtain statistics about the contents
-of the data file:
-
- 	mbinfo \-I sb199411211212.mb41
-.br
-Seeing reasonable output assures us that we in fact know what
-kind of data we are processing.
-
-\fBStep 2\fP: Generate ancillary files.
-
-Next, we run \fBmbdatalist\fP to generate the statistics (".inf"),
-quickly read bathymetry (".fbt"), and quickly read navigation
-(".fnv") files that make many tasks run faster:
-
- 	mbdatalist \-I sb199411211212.mb41 \\
- 		-N \-V
-
-Running this program generates three output files, which we
-call ancillary files:
- 	sb199411211212.mb41.inf
- 	sb199411211212.mb41.fbt
- 	sb199411211212.mb41.fnv
-
-\fBStep 3\fP: Generate first cut plota.
-
-We are now set up to process the data. However, first
-we visually check the data by generating a swath plot
-of color filled bathymetry overlaid with contours and
-navigation. This is easily accomplished with \fBmbm_plot\fP:
- 	mbm_plot \-I sb199411211212.mb41 \\
- 		-G1 \-C \-N \-V \\
- 		-O ZSwathBathCont
-	ZSwathBathCont.cmd
-.br
-Here the ZSwathBathCont represents the plot name, and multiple
-files will be generated with names constructed by adding
-different suffixes to this name. The \fBmbm_plot\fP command
-generates a shellscript called ZSwathBathCont.cmd. Running
-this shellscript in turn generates a Postscript plot called
-ZSwathBathCont.ps, and then displays the plot to the screen
-using the Postscript viewer previously specified by the user with
-\fBmbdefaults\fP. The name ZSwathBathCont is descriptive but
-arbitrary. Users may specify any name they wish.
-
-The types of swath plots produced by \fBmbm_plot\fP include:
-     \- color fill bathymetry with contours
-     \- shaded relief color fill bathymetry
-     \- color fill bathymetry overlaid with amplitude
-     \- grayscale amplitude
-     \- grayscale sidescan
-
-We have already generated the first type of plot. We now
-generate the other four as well:
- 	mbm_plot \-I sb199411211212.mb41 \\
- 		-G2 \-N \-V \\
- 		-O ZSwathBathShade
- 	ZSwathBathShade.cmd
- 	mbm_plot \-I sb199411211212.mb41 \\
- 		-G3 \-S0/1 \-N \-V \\
- 		-O ZSwathBathAmp
- 	ZSwathBathAmp.cmd
- 	mbm_plot \-I sb199411211212.mb41 \\
- 		-G4 \-S \-N \-V \\
- 		-O ZSwathAmp
- 	ZSwathAmp.cmd
- 	mbm_plot \-I sb199411211212.mb41 \\
- 		-G5 \-S \-N \-V \\
- 		-O ZSwathSS
- 	ZSwathSS.cmd
-.br
-We use the \-S option to apply histogram equalization to
-sidescan and amplitude data; note that for the bathymetry
-overlaid with amplitude map we use \-S0/1 so that the
-the amplitude data used for shading is histogram
-equalized but the bathymetry is not.
-
-\fBStep 3\fP: Apply Analysis Tools
-
-We now have a reasonable idea of the data quality.
-There are several data analysis and editing tools that
-may be used to fix problems (or just to further investigate
-the data). These may be used in any order, at any time.
-
-\fBAnalysis Option A\fP: Automatic Bathymetry Editing.
-
-The program \fBmbclean\fP applies some simple artifact
-detection algorithms to the bathymetry, effectively
-providing a means of automatically editing the bathymetry.
-We generally recommend that users edit the bathymetry
-interactively (see option B below) because
-no automated filter yet approaches
-(in our opinion) the ability of the human eye and brain
-to discern the difference between interesting seafloor
-morphology and sonar artifact. In particular, none of the
-filters available in \fBmbclean\fP come remotely close to
-performing satisfactorily in general. However, many users do
-find it useful to preprocess the data with \fBmbclean\fP
-before editing in the hope that many or most of the artifacts can flagged
-automatically. Again, we emphasize the importance of not
-depending solely on automatic filters. \fBIf you care about
-your data, look at it.\fP
-
-When we apply \fBmbclean\fP, we usually use a filter that flags all
-soundings that deviate more than a specified fraction of
-the local median depth from that median depth (the \fB\-G\fP
-option). The choice of the filter or filters and the
-filter parameters used depends very much on the nature of the
-bathymetry data being processed:
- 	mbclean \-I sb199411211212.mb41 \-G0.9/1.1 \-V
-.br
-If an "edit save file" named sb199411211212.mb41.esf already
-exists, \fBmbclean\fP reads this file and applies the
-pre-existing edits prior to beginning its filtering.
-All pre-existing edit events and all newly generated flags
-by \fBmbclean\fP are output to a new
-"edit save file", again called sb199411211212.mb41.esf.
-Since this is the first
-of the analyis programs to be run on this data file, \fBmbclean\fP
-also creates an \fBmbprocess\fP parameter file called
-sb199411211212.mb41.par which contains all of the parameters
-and settings to be used by \fBmbprocess\fP in generating a
-processed swath file. If the parameter file already existed,
-\fBmbclean\fP would modify it so that the bathymetry edits
-would be applied when \fBmbprocess\fP is run.
-
-\fBAnalysis Option B\fP: Interactive Bathymetry Editing.
-
-We use the interactive graphical tool \fBmbedit\fP to check
-the quality of the bathymetry
-and to flag artifacts as necessary. We can start \fBmbedit\fP with
-the simple command:
- 	mbedit
-.br
-and then open a swath file using the pull down menus and dialogs.
-Alternatively, we can specify the swath file on the command
-line:
- 	mbedit \-I sb199411211212.mb41
-.br
-While we are editing the bathymetry, all edit
-events, both flag and unflag, are
-written to an "edit save file" called sb199411211212.mb41.esf. This
-file is closed when the <Done> or <Quit> button is clicked.
-In turn, this file of edit events will be read and these events
-applied if we run \fBmbclean\fP, or \fBmbprocess\fP, or if
-we choose to run \fBmbedit\fP again. If this is the first
-of the analyis programs to be run on this data file, \fBmbedit\fP
-also creates an \fBmbprocess\fP parameter file called
-sb199411211212.mb41.par which contains all of the parameters
-and settings to be used by \fBmbprocess\fP in generating a
-processed swath file. If the parameter file already existed,
-\fBmbedit\fP would modify it so that the bathymetry edits
-would be applied when \fBmbprocess\fP is run.
-
-\fBAnalysis Option C\fP: Editing the navigation.
-
-We use the interactive graphical tool \fBmbnavedit\fP to check
-the quality of the navigation
-and to fix problems as necessary. We can start \fBmbnavedit\fP with
-the simple command:
- 	mbnavedit
-.br
-and then open a swath file using the pull down menus and dialogs.
-Alternatively, we can specify the swath file on the command
-line:
- 	mbnavedit \-I sb199411211212.mb41
-.br
-When we have completed editing the navigation, we click the
-<Done> or <Quit> button. The program then writes the final
-navigation to an "edited navigation" file called sb199411211212.mb41.nve.
-The program \fBmbnavedit\fP
-also modifies (or creates if needed) an \fBmbprocess\fP parameter file
-and sets it so that the edited navigation is read and merged with the
-swath data when \fBmbprocess\fP is run.
-
-\fBAnalysis Option D\fP: Modeling sound velocity profiles.
-
-We use the interactive graphical tool \fBmbvelocitytool\fP to model
-the effect of altering the sound velocity profile (SVP) used to
-calculate bathymetry from the raw travel times and angles stored
-in the swath data. We can start \fBmbvelocitytool\fP with
-the simple command:
- 	mbvelocitytool
-.br
-and then open a swath file using the pull down menus and dialogs.
-Alternatively, we can specify the swath file on the command
-line:
- 	mbvelocitytool \-I sb199411211212.mb41
-.br
-If the \fBLevitus\fP database has been installed, \fBmbvelocitytool\fP
-will attempt to run \fBmblevitus\fP to extract a reference sound velocity
-profile for the approximate location of the swath data file. This SVP
-will be displayed along with the editable SVP used for modeling. See
-the \fBmbvelocitytool\fP manual page for details on its operation.
-If we conclude that the bathymetry data include artifacts associated with
-having been calculated using an incorrect SVP, and we arrive through
-modeling at an SVP which is more likely correct, we save this SVP
-using the <File->Save swath svp file> menu button. Then \fBmbvelocitytool\fP
-saves the edited SVP in a file named sb199411211212.mb41.svp, and
-also sets (or creates if needed)  the parameter file sb199411211212.mb41.par
-so that \fBmbprocess\fP will recalculate
-the bathymetry by raytracing through this SVP.
-
-\fBAnalysis Option E\fP: Correcting sidescan data.
-
-We often find that sidescan imagery, despite the best efforts
-of sonar manufacturers, is dominated by a systematic variation
-in amplitude across the swath. Most commonly, the center or nadir
-region of the swath is characterized by high amplitudes, and the
-outer swath exhibits much lower amplitudes. This effect can be
-corrected by \fBmbprocess\fP provided that an appropriate model
-for the variation in amplitude with grazing angle is available.
-Since the amplitude vs grazing angle function varies with the
-type of seafloor, we need to construct separate amplitude vs grazing angle
-correction tables at regular intervals through each swath data file.
-We use the program \fBmbbackangle\fP to construct the amplitude vs.
-grazing angle tables:
- 	mbbackangle \-I sb199411211212.mb41 \\
- 		-P25 \-N161/80 \-V
-.br
-Here a new table is constructed every 25 pings, and the tables
-will consist of 161 angle bins ranging from \-80 degrees to +80 degress
-grazing angles. The tables are written by \fBmbbackangle\fP to an
-amplitude vs. grazing angle file called sb199411211212.mb41.sga.
-Of course, the program also sets (or creates if needed)
-the parameter file sb199411211212.mb41.par
-so that \fBmbprocess\fP will correct the sidescan.
-
-\fBStep 4\fP: Process the data.
-
-The program that actually takes the input, raw swath data
-and produces processed swath data is \fBmbprocess\fP. This
-program operates using the parameters listed in the
-parameter file sb199411211212.mb41.par. To process the
-data, we run
- 	mbprocess \-I sb199411211212.mb41
-.br
-The program produces an output processed swath file called
-sb199411211212p.mb41 (a 'p' character is inserted in the
-filename just before the \fBMB-System\fP suffix. The program
-\fBmbprocess\fP also automatically generates the three basic
-ancillary data
-files for the processed swath file:
- 	sb199411211212.mb41.inf
- 	sb199411211212.mb41.fbt
- 	sb199411211212.mb41.fnv
-
-\fBStep 5\fP: Grid the bathymetry.
-
-Now use \fBmbgrid\fP to grid the bathymetry. The greatest
-depth in the file is 4502 meters (from the mbinfo output).
-The 120 degree swath is 3.4 times the water depth wide, or
-15.3 km wide. This translates to an average acrosstrack
-spacing of 15300 m / 120 = 127.5 m. If a region of a grid
-has more than one data point in each grid cell or bin, we
-say that this region is "oversampled". If some bins in a
-region have no data points, we say that this region is
-"undersampled". We choose a grid cell spacing of 150 m,
-which will cause the grid to be oversampled towards
-the center of the swath, but undersampled towards the
-edges of the swath.
-
-The program \fBmbgrid\fP takes a datalist as input, so we first
-construct that file:
- 	echo sb199411211212p.mb41 41 > datalist_grid
-
-Now run \fBmbgrid\fP using the gaussian weighted mean algorithm
-(-F1) and longitude and latitude grid cell spacings of
-150 m (-E150/150/m) to grid bathymetry (-A1). We use
-spline interpolation to fill in small gaps in the data
-no larger than two grid cells (-C2), and we set regions
-with no data to Nan values for compatibility with
-GMT programs (-N). We also specify \-M so that grids of
-data density and data standard deviation will be
-generated:
- 	mbgrid \-Idatalist_grid \-E150/150/m \\
- 		-R114.2208/114.4209/-31.9001/-31.6377 \\
- 		-OZGridBath \-A1 \-N \-C2 \-M \-V
-
-The program \fBmbgrid\fP creates a shellscript which, when
-executed, will generate a color fill plot overlaid with
-contours of the gridded bathymetry. Now run that shellscript:
- 	ZGridBath.cmd
-
-Shellscripts have also been created to generate plots of
-the data density and standard deviation grids:
- 	ZGridBath_bath_num.cmd
- 	ZGridBath_bath_sd.cmd
-
-\fBStep 6\fP: Mosaic the corrected sidescan data.
-
-The program \fBmbmosaic\fP operates in a fashion similar to
-\fBmbgrid\fP, but has special capabilities allowing users
-to prioritize which parts of the swath are used in the
-mosaic that are useful for sidescan data. In particular,
-it is possible to create mosaics which do not use the
-nadir region of the swath except where no other data is
-available, or to create mosaics of sidescan data with
-particular look azimuths. The sidescan data has a higher
-resolution than the bathymetry so a smaller grid size
-can be appropriate. However, we wish to overlay the
-sidescan on the bathymetry, so we use the same grid
-cell spacing of 150 m.
-
-In order to give the nadir region a lower priority than
-the outer parts of the sidescan swath, create a file
-of data priorities (priorities range from 0 to 1) as
-a function of apparent grazing angle (negative angles
-are on the port side of the swath, zero is at nadir,
-and positive angles are on the starboard side of the
-swath):
- 	-60.0 0.2
- 	-45.0 1.0
- 	-15.0 0.8
- 	-14.9 0.1
- 	14.9 0.1
- 	15.0 0.8
- 	45.0 1.0
- 	60.0 0.2
-
-Here the nadir region has been set to a low priority and
-the highest priority has been given to data from an
-apparent grazing angle of 45 degrees.
-
-Now run \fBmbmosaic\fP to mosaic the bathymetry corrected sidescan
-data (-A4):
- 	mbmosaic \-Idatalist_grid \-E150/150/m \\
- 		-R114.2208/114.4209/-31.9001/-31.6377 \\
- 		-Wangle_priority.dat \-F0.10 \\
- 		-OZMosaicSS \-A4 \-N \-C2 \-M \-V
-
-Now run the plot shellscripts to view the gridded sidescan
-data in grayscale and the ancillary data density and
-standard deviation plots:
- 	ZMosaicSS.cmd
- 	ZMosaicSS_num.cmd
- 	ZMosaicSS_sd.cmd
-
-\fBStep 7\fP: Generate additional maps of the gridded data.
-
-First, we use \fBmbm_grdplot\fP to generate a color shaded
-relief view of the bathymetry. We choose to illuminate
-the bathymetry from the northeast (azimuth of 45 degrees)
-and to use a shading magnitude of 0.4 (-A0.4/45).
-Because the data has been gridded as bathymetry (positive
-down) rather than as topography (positive up), the default
-plot will have "hot" colors for deep regions and "cold"
-colors for shallow regions; this is the opposite of the
-convention we usually use. In order to fix the colors, we have
-to either rescale the data by multiplying the bathymetry
-by \-1 (accomplished with \-MGS-1), or flip the color
-palette (accomplished with \-D). We use the latter approach.
-Finally, because this grid is so small, the default shaded
-relief image is likely to be grainy. To fix this problem, we
-specify a dots per inch resolution of 72 (-MGQ72); this
-will take longer and generate a larger plotfile, but the
-plot will look better. We also use the \-L option to specify
-the title and color scale label for the plot. Here is the
-command:
- 	mbm_grdplot \-IZGridBath.grd \\
- 		-G2 \-A0.4/45 \-D \-MGQ72 \-V \\
- 		-L"Shaded Relief Bathymetry":"Depth (meters)" \\
- 		-Osb199411211212_bathshade
- 	ZGridBathShade.cmd
-
-Second, we use \fBmbm_grdplot\fP to generate a color fill
-view of the bathymetry overlaid with the gridded sidescan.
-The sidescan overlay is specified using the \-K option.
-We want the colors for the bathymetry to be chosen without
-histogram equalization, but we also want histogram
-equalization to be applied to the sidescan data used for
-shading. To do this, we use \-S0/1, where the first number
-(0) specifies no histogram equalization of the color
-scale and the second number (1) causes histogram
-equalization of the shading sidescan data to be
-implemented. In order to maintain the convention that
-high sidescan amplitudes are black, we flip both the
-color palette (as in the previous example) and the
-shading scale with \-D1/1. We could also flip the shading
-by specifying a negative shading magnitude (-A-0.4).
-In this case, we forgo specifying the image resolution,
-resulting in a grainy plot:
- 	mbm_grdplot \-IZGridBath.grd \\
- 		-G3 \-KZMosaicSS.grd \\
- 		-S0/1 \-D1/1 \-A0.4 \-V \\
- 		-L"Bathymetry Overlaid With Sidescan":"Depth (meters)" \\
- 		-OZGridBathSS
- 	ZGridBathSS.cmd
-
-\fBStep 8\fP: Generate 3D perspective views of the gridded data.
-
-Now, generate a 3D perspective view of the gridded
-bathymetry with shading through synthetic illumination (-G2)
-using the macro \fBmbm_grd3dplot\fP. The grid file is in
-bathymetry (positive down) rather in topography (positive
-up), so the bathymetry needs to be rescaled by multiplying
-by \-1 (-MGS-1). We choose an illumination magnitude of 0.4
-and an illumination azimuth of 45 degrees (-A0.4/45). We
-also choose a perspective azimuth of 250 degrees and an
-elevation of 30 degrees (-E240/30):
- 	mbm_grd3dplot \-IZGridBath.grd \\
- 		-G2 \-A0.4/45 \-E250/30 \-MGS-1 \-V \\
- 		-OZGridBath3D
- 	ZGridBath3D.cmd
-
-Now, generate a 3D perspective view of the gridded
-bathymetry shaded using the gridded sidescan data
-(-KZMosaicSS.grd). We want the sidescan data to
-be histogram equalized, so we use \-S0/1. We also want
-the shading to be more prominent than the default
-shading magnitude of 0.2 would produce, so we use \-A0.5:
- 	mbm_grd3dplot \-IZGridBath.grd \\
- 		-KZMosaicSS.grd \\
- 		-G3 \-A0.5 \-E250/30 \-D0/1 \-S0/1 \-MGS-1 \-V \\
- 		-Osb199411211212_bathss3d
- 	ZGridBathSS3D.cmd
-
-.SH PROCESSING THIRD GENERATION KONGSBERG MULTIBEAM DATA
-
-The current generation of Kongsberg multibeam sonars (EM122, EM302, EM710)
-record data in files typically named with a *.all suffix. These binary
-files consist of many different data records, most of which are
-similarly structure but distinct from the records output by the
-earlier generations of Kongsberg (formerly Simrad) multibeams described
-in a later section. The raw Kongsberg format is supported in \fBMB-System\fP
-as format 58. However, format 58 lacks places to store some information
-that is important to processing. In particular, the raw Kongsberg format
-does not store beam flags, so the only to apply bathymetry edits is
-to null the flagged beams. This is not recommended, as it precludes
-unflagging flagged beams later determined to be good.
-
-Also, the raw Kongsberg format stores the initial sidescan samples derived from subsampling
-the bottom returns in each of the formed beams. The locations of these
-samples on the seafloor are irregular, and the number of samples varies
-greatly from ping to ping. This raw sidescan is not well suited for
-mapmaking or processing because of the irregular locations. \fBMB-System\fP
-automatically bins and averages the available sidescan samples into
-a regularly spaced 1024 pixels with pixel sizes that vary only slightly
-from ping to ping. This resampled sidescan is what appears in swath plots
-and in the statistics reported by \fBmbinfo\fP. The raw format has no
-space to store the rebinned sidescan, so any corrections or other
-processing applied to the sidescan in formats 58 is lost.
-
-We have defined a processing format (59) for Kongsberg multibeam that stores
-beam flags and rebinned sidescan in addition to all of the information
-in the raw file format 58. We strongly recommend that third generation
-Kongsberg multibeam data be translated into format 59 before processing. This can
-be accomplished, albeit unsatisfactorily, with mbcopy. For example, given a raw EM122 file called
-0006_20111219_201329_METEOR_EM122.all, we can translate it to format 59 using:
- 	mbcopy \-F58/59 \-I 0006_20111219_201329_METEOR_EM122.all \\
- 		-O 0006_20111219_201329_METEOR_EM122.mb59
-.br
-If we have a number of EM122 files referenced through a datalist file called
-datalist_raw.mb-1, we can translate all of them using the macro \fBmbm_copy\fP:
- 	mbm_copy \-F59 \-I datalist_raw.mb-1
-.br
-This macro simply executes \fBmbcopy\fP for each of the data referenced in
-the input datalist structure.
-
-The problem with using \fBmbcopy\fP for translation
-between formats 58 and 59 is that the navigation, heading, and attitude
-contained in format 58 files are purely asynchronous, which means these values
-are defined according to their own time stamps and not the time stamps
-of the multibeam sonar pings. When format 58 data are read, the navigation,
-heading and attitude values must be read from their own data records and
-interpolated (or extrapolated) onto the time stamps of the multibeam pings
-for each survey record. This works fine if the relevant asynchronous navigation
-and attitude data are always found in the data files before the survey data
-from the same time, but that advantageious timing is neither assured nor common.
-A better approach is to use the tool \fBmbkongsbergpreprocess\fP to preprocess
-the Kongsberg multibeam data. This program makes two passes through reading
-each input file, the first to read and store the navigation and attitude data,
-and the second to properly interpolate the navigation and attitude values onto the
-multibeam survey pings. The usage is of the form:
- 	mbkongsbergpreprocess \-I datalist_raw.mb-1 \-V
-
-One further feature of Simrad multibeam data processing should be noted.
-Given that the raw sidescan samples are derived directly from the
-bottom returns identified by the sonar for each beam, it follows that
-whenever a bottom return pick is erroneous, the sidescan samples
-associated with that beam are also erroneous. Consequently, the binned
-sidescan shoulde be reprocessed following the application of beam flags
-to exclude the incorrect sidescan samples from the final imagery.
-Recalculating the Simrad sidescan is an \fBmbprocess\fP option which
-can set using \fBmbset\fP. To turn on sidescan calculation, we use:
- 	mbset \-I 0006_20111219_201329_METEOR_EM122.mb59 \\
- 		=PSSRECALCMOD:1 \-V
-.br
-We can also turn off sidescan recalculation using:
- 	mbset \-I 0006_20111219_201329_METEOR_EM122.mb59 \\
- 		=PSSRECALCMOD:0 \-V
-
-In practice, \fBmbedit\fP, \fBmbeditviz\fP and \fBmbclean\fP automatically set the
-parameter file to turn on sidescan recalculation when writing an
-"edit save file" for format 59 data, so users should not have
-to set this parameter manually.
-
-.SH PROCESSING OLDER KONGSBERG (FORMERLY SIMRAD) MULTIBEAM DATA
-
-The older series of Simrad multibeam sonars (EM100, EM950, EM1000, EM12,
-EM12D, EM121A) recorded raw data
-in files typically named with an "_raw.all" suffix. These older data
-are supported in \fBMB-System\fP using format 51. The data
-from the second generation Simrad (Kongsberg) multibeams (EM3000, EM2000, EM1002, EM300,
-EM120) also come in files with the "_raw.all" suffix, but the
-format is different, and is supported by \fBMB-System\fP as format
-56. \fBMB-System\fP programs can automatically discern the difference
-between the two formats, and so the initial identification of the
-data type is easy with \fBmbinfo\fP.
-
-However, both formats 51 and 56 lack places to store some information
-that is important to processing. In particular, the raw Simrad formats
-do not store beam flags, so the only to apply bathymetry edits is
-to null the flagged beams. This is not recommended, as it precludes
-unflagging flagged beams later determined to be good.
-
-Also, the raw
-Simrad formats store the initial sidescan samples derived from subsampling
-the bottom returns in each of the formed beams. The locations of these
-samples on the seafloor are irregular, and the number of samples varies
-greatly from ping to ping. This raw sidescan is not well suited for
-mapmaking or processing because of the irregular locations. \fBMB-System\fP
-automatically bins and averages the available sidescan samples into
-a regularly spaced 1024 pixels with pixel sizes that vary only slightly
-from ping to ping. This resampled sidescan is what appears in swath plots
-and in the statistics reported by \fBmbinfo\fP. The raw formats have no
-space to store the rebinned sidescan, so any corrections or other
-processing applied to the sidescan in formats 51 and 56 is lost.
-
-We have defined a processing format (57) for Simrad multibeam that stores
-beam flags and rebinned sidescan in addition to all of the information
-in either of the raw file formats (51 and 56).
-We strongly recommend that Simrad multibeam data from both old and
-newer sonars be translated into format 57 before processing. This is
-accomplished with mbcopy. For example, given a raw EM1000 file called
-0021_19960714_123418_raw.all, we translate it to format 57 using:
- 	mbcopy \-F51/57 \-I 0021_19960714_123418_raw.all \\
- 		-O 0021_19960714_123418_raw.mb57
-.br
-Similarly, given a raw EM300 file called
-0005_20020425_034057_raw.all, we translate it to format 57 using:
- 	mbcopy \-F56/57 \-I 0005_20020425_034057_raw.all \\
- 		-O 0005_20020425_034057.mb57
-
-One further feature of Simrad multibeam data processing should be noted.
-Given that the raw sidescan samples are derived directly from the
-bottom returns identified by the sonar for each beam, it follows that
-whenever a bottom return pick is erroneous, the sidescan samples
-associated with that beam are also erroneous. Consequently, the binned
-sidescan shoulde be reprocessed following the application of beam flags
-to exclude the incorrect sidescan samples from the final imagery.
-Recalculating the Simrad sidescan is an \fBmbprocess\fP option which
-can set using \fBmbset\fP. To turn on sidescan calculation, we use:
- 	mbset \-I 0005_20020425_034057.mb57 \\
- 		=PSSRECALCMOD:1 \-V
-.br
-We can also turn off sidescan recalculation using:
- 	mbset \-I 0005_20020425_034057.mb57 \\
- 		=PSSRECALCMOD:0 \-V
-
-In practice, \fBmbedit\fP and \fBmbclean\fP automatically set the
-parameter file to turn on sidescan recalculation when writing an
-"edit save file" for format 57 data, so users should not have
-to set this parameter manually.
-
-.SH PROCESSING HYDROSWEEP DS DATA
-
-Hydrosweep DS sonars were used on the R/V Maurice
-Ewing (operated by the Lamont-Doherty Earth Observatory
-and the R/V Thomas Thompson (operated by the University of
-Washington) from the early 1990's until 2001. The raw data
-was logged in a text format (21) that is slow to read and write.
-We recommend that users confronted with format 21 data translate
-it to format 24 before processing. Format 24 is a binary data
-format that contains all of the information in the raw file,
-but is on the order of 15 times faster to read and write.
-We accomplish the translation using \fBmbcopy\fP:
-  	mbcopy \-F21/24 \-Ihs_ew9204_134.mb21 \\
- 		-Ohsih_ew9204_134.mb24
-.br
-We also strongly recommend that users of Hydrosweep DS data
-recalculate the bathymetry using raytracing through an
-appropriate SVP, whether obtained using \fBmblevitus\fP,
-\fBmbvelocitytool\fP, or from other sources. The sonar
-calculates the raw bathymetry using a homogeneous water
-velocity model, and the results are almost always inferior
-to those obtained by doing the full raytracing calculations
-with a correct SVP.
-
-Hydrosweep DS data do not contain sidescan, but they do
-contain per beam amplitude data. The amplitude data may
-be corrected in the same fashion as the sidescan. We
-run \fBmbbackangle\fP with the \fB\-A\fP\fI1\fP option
-to operate on the amplitude data:
- 	mbbackangle \-I sb199411211212.mb41 \\
- 		-A1 \-P25 \-N161/80 \-V
-.br
-and then run \fBmbprocess\fP as usual.
-
-.SH PROCESSING HYDROSWEEP MD DATA
-
-Processing Hydrosweep MD data is similar to processing
-Hydrosweep DS data. In particular, recalculating
-bathymetry from the travel times is necessary because
-the sonar uses a homogeneous water velocity model.
-The difference is simply in the data formats used.
-The raw Hydrosweep MD data files (typically named
-with a ".R" suffix) contain only the travel times; the
-sonar calculated bathymetry is contained in parallel
-files (typically named with a ".P" suffix). The
-".R" files are supported as format 101. Format 102
-data files contain bathymetry in addition to the travel
-times. To translate the data from format 101 to 102 we
-use:
-  	mbcopy \-F101/102 \-Iys9409040607.R \\
- 		-Oys9409040607.mb102
-.br
-Bathymetry equivalent to that generated by the sonar
-will automatically be calculated in the copy process
-(the data stream includes the mean water velocity used
-by the sonar).
-
-Hydrosweep MD data do not contain sidescan, but they do
-contain per beam amplitude data. The amplitude data may
-be corrected in the same fashion as the sidescan. We
-run \fBmbbackangle\fP with the \fB\-A\fP\fI1\fP option
-to operate on the amplitude data:
- 	mbbackangle \-I sb199411211212.mb41 \\
- 		-A1 \-P25 \-N161/80 \-V
-.br
-and then run \fBmbprocess\fP as usual.
-
-.SH SEE ALSO
-\fBmbio\fP(1)
-
-.SH BUGS
-It doesn't do everything we want it to yet, it doesn't work with
-every kind of swath data ever collected, and sometimes it
-breaks.
diff --git a/src/man/man1/mbtime.1 b/src/man/man1/mbtime.1
deleted file mode 100644
index 805e276..0000000
--- a/src/man/man1/mbtime.1
+++ /dev/null
@@ -1,78 +0,0 @@
-.TH mbtime 1 "3 June 2013" "MB-System 5.0" "MB-System 5.0"
-.SH NAME
-\fBmbtime\fP \- Translate between calendar time values and unix time.
-
-.SH VERSION
-Version 5.0
-
-.SH SYNOPSIS
-\fBmbtime\fP [\fB\-M\fItime_d\fP \fB\-T\fIyear/month/day/hour/minute/second\fP \fB\-V \-H\fP]
-
-.SH DESCRIPTION
-The program \fBmbtime\fP converts time values between unix time (seconds since
-1970/01/01 00:00:00.000000) and calendar time (e.g. 2008/006/05/17/24/32.000000).
-Unix time is also known as POSIX time or epoch time, and are typically represented
-in \fBMB-System\fP documentation (and source code) as "time_d" values.
-The input time is set using the command line arguments \fB\-M\fP\fItime_d\fP for
-epoch seconds and \fB\-T\fP\fIyear/month/day/hour/minute/second\fP for
-calendar time. The output time (in the form not specified as input) is
-written to stdout.
-
-.SH AUTHORSHIP
-David W. Caress (caress at mbari.org)
-.br
-  Monterey Bay Aquarium Research Institute
-.br
-Dale N. Chayes (dale at ldeo.columbia.edu)
-.br
-  Lamont-Doherty Earth Observatory
-
-.SH OPTIONS
-.TP
-.B \-H
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-.TP
-.B \-M
-\fItime_d\fP
-.br
-Sets the input time to be \fItime_d\fP in unix time, which
-is defined as seconds since 00:00:00.000000 01 January 1970. If \fB\-M\fP is
-specified, this time will be converted to calendar time and output
-to stdout in the form
- 	yyyy/mm/dd/hh/mm/ss.ssssss
-.TP
-.B \-T
-\fIyear/month/day/hour/minute/second\fP
-.br
-Sets the input time to be \fIyear/month/day/hour/minute/second\fP.
-If \fB\-T\fP is specified, this time will be converted to
-\fItime_d\fP in epoch (Unix) seconds, which
-are seconds since 00:00:00.000000 01 January 1970.
-The \fItime_d\fP value will be output to stdout.
-.TP
-.B \-V
-Normally, \fBmbtime\fP only prints out the converted time.  If the
-\fB\-V\fP flag is given, then \fBmbtime\fP works in a "verbose" mode and
-also outputs the program version being used.
-
-.SH EXAMPLES
-Suppose one wishes to convert the current time (06 June 2008 18:37:14.000000)
-to unix seconds. The following command:
- 	mbtime \-T2008/06/06/18/37/14.0
-.br
-yields the following result:
- 	1212777434.000000
-
-Suppose on wishes to convert the unix time 1212777434.0 to calendar time.
-The following command:
- 	mbtime \-M1212777434.0
-.br
-yields the following result:
- 	2008/06/06/18/37/14.000000
-
-.SH SEE ALSO
-\fBmbsystem\fP(1), \fBmbio\fP(1)
-
-.SH BUGS
-Never bugs, but perhaps our good friends, the terrestrial isopods.
diff --git a/src/man/man1/mbvelocitytool.1 b/src/man/man1/mbvelocitytool.1
deleted file mode 100644
index d6fd321..0000000
--- a/src/man/man1/mbvelocitytool.1
+++ /dev/null
@@ -1,358 +0,0 @@
-.TH mbvelocitytool 1 "10 November 2014" "MB-System 5.0" "MB-System 5.0"
-.SH NAME
-\fBmbvelocitytool\fP \- Interactive water sound velocity profile editor.
-
-.SH VERSION
-Version 5.0
-
-.SH SYNOPSIS
-\fBmbvelocitytool\fP [\fB\-B\fIyr/mo/da/hr/mn/sc\fP
-\fB\-E\fIyr/mo/da/hr/mn/sc\fP
-\fB\-F\fIformat \fB\-I\fIfile \fB\-S\fIsvpfile \fB\-W\fIsvpfile \fB\-V \-H\fP]
-
-.SH DESCRIPTION
-\fBMBvelocitytool\fP is an interactive water sound velocity profile
-(SVP) editor used to examine multiple SVPs, to create
-new SVPs, and to model the impact of SVP modification on swath bathymetry
-data. SVPs created using \fBMBvelocitytool\fP can be used by the program
-\fBmbprocess\fP to recalculate swath bathymetry from raw travel time
-and angle data.
-
-In general, \fBMBvelocitytool\fP is used to examine SVPs obtained from
-swath data files (see \fBmbsvplist\fP manual page), XBTs, CTDs, or
-databases, and to construct new profiles consistent with these various
-sources of information. The SVPs are represented by a set of paired
-depth and velocity values which are connected by linear interpolation.
-Users may load a number of SVPs for display. Users may load or create
-a single editable SVP and then interactively modify this profile.
-
-When users load swath bathymetry data containing raw travel time and
-angle data (many but not all swath data format include this information),
-\fBMBvelocitytool\fP  recalculates the bathymetry by raytracing through
-the current SVP model. If the bathymetry in the input swath file has
-been edited (e.g. with \fBmbedit\fP), then the associated edit save
-file (*.esf file) will be loaded as well, and the beams flagged as
-bad will not be used by \fBMBvelocitytool\fP.
-The bathymetry of each ping is fit with a line,
-and bathymetry residuals are calculated for each good beam relative
-to the linear fit.  The average of the bathymetry residuals is displayed
-along with "error bars" indicating the standard deviations of the
-residuals. Anomalously shallow  bathymetry maps into negative residuals
-and deep bathymetry into positive residuals; the residuals are displayed
-so that shallow is up and deep is down. If the seafloor is reasonably
-smooth so that a linear fit is appropriate, then the residuals will
-accurately reflect any problems with the water velocity profile.  If
-the water velocity profile is correct, then the residual plot will be
-roughly flat.  If the water velocity profile is significantly in error,
-then the outer beam depths may anomalously shallow (edge curl up) or
-deep (edge curl down).  In practice, the editable velocity profile is
-altered interactively until a reasonably residual pattern is achieved.
-
-In order to calculate bathymetry values from travel time observations,
-geometrical raypaths are traced through the SVP for each beam. Because
-the sound velocity gradients are uniform between the depth-velocity
-nodes (linear interpolation), the raypaths are be calculated
-analytically as pieces of circular arcs. This raytracing algorithm
-is the same used in the program \fBmbprocess\fP.
-
-One important aspect of the raytracing is the handling of the initial
-takeoff angles associated with each beam or sounding. In general, the
-raytracing will begin at a point in the sound speed model that has a
-sound velocity different than the surface sound velocity (SSV) used by
-the mapping sonar for the original beamforming. The usual approach is to
-use Snell's law to adjust the starting angle for this change in sound
-velocity. This amounts to an assumption that the original SSV was correct
-and that  the rays pass through an insignificantly thick layer in which the
-sound speed equals the SSV before transitioning to the sound speed implied
-by the SVP. This is the default setting for raytracing in \fBMB-System\fP.
-Alternatively, one can proceed with raytracing using the original angle
-but this is rarely useful or correct. Finally, if the SSV used by the sonar is
-judged to have been incorrect, then the takeoff angle must be corrected for
-the erroneous beamforming as well as for the difference between the SSV
-and the initial raytracing sound velocity. This correction must take the
-sonar geometry into account because the impact of changing the SSV on a beam
-angle from a flat receive array is very different from a V-shaped or curved
-array. All three of these angle correction modes are available in \fBmbvelocitytool\fP.
-
-\fBMBvelocitytool\fP can be used in conjunction with \fBmbprocess\fP.
-If the user uses the \fBSave swath svp file\fP option to save an SVP model
-developed through the analysis of a particular swath data file,
-\fBMBvelocitytool\fP also sets the associated \fBmbprocess\fP parameter file
-so that \fBmbprocess\fP recalculates the bathymetry using the new SVP model.
-The program \fBmbset\fP may be used to set the SVP file in the parameter
-file for any swath data file. Users may also save SVP models without setting
-any \fBmbprocess\fP parameters by using the \fBSave editable profile\fP
-option.
-
-Sometimes the bathymetry residuals show structure indicative of
-persistent artifacts in the bathymetry (e.g. certain parts of
-the swath may be persistently shallower or deeper than the
-rest of the swath). In this situation, it is possible to export
-the residuals and to then apply them in \fBmbprocess\fP
-as static corrections to the bathymetry. This is accomplished by
-using the \fBSave residuals as offsets\fP option under the \fBFile\fP
-menu.
-
-If a user attempts to read in swath bathymetry that does not
-contain the travel time and beam angle data required for bathymetry
-recalculation, \fBMBvelocitytool\fP will estimate the travel times
-and angles from the bathymetry by assuming a 1500 m/s half-space
-(and then post a warning dialog). Although the user can proceed
-to model bathymetry recalculation by modifying the active SVP just
-as with proper data, the travel times and angles are not in general
-correct and so the modeling and any results it gives are, well, bogus.
-A more useful approach is to leave the SVP alone and simply export
-the residuals to be applied as static corrections in mbprocess.
-This approach allows users a practical means of correcting
-older multibeam bathymetry that was originally calculated with
-an incorrect SVP but which contains no travel time or angle data.
-
-.SH AUTHORSHIP
-David W. Caress (caress at mbari.org)
-.br
-  Monterey Bay Aquarium Research Institute
-.br
-Dale N. Chayes (dale at ldeo.columbia.edu)
-.br
-  Lamont-Doherty Earth Observatory
-
-.SH OPTIONS
-.TP
-.B \-B
-\fIyr/mo/da/hr/mn/sc\fP
-.br
-Sets the starting time for data allowed in the input data; pings
-with times before the starting time will be ignored.
-Default: \fIyr/mo/da/hr/mn/sc\fP = 1962/2/21/10/30/0.
-.TP
-.B \-E
-\fIyr/mo/da/hr/mn/sc\fP
-.br
-Sets the ending time for data allowed in the input data; pings
-with times after the ending time will be ignored.
-Default: \fIyr/mo/da/hr/mn/sc\fP = 2062/2/21/10/30/0.
-.TP
-.B \-F
-\fIformat\fP
-.br
-Sets the format at startup for the input and output swath sonar data using
-\fBMBIO\fP integer format identifiers. This value can also be set
-interactively when specifying the input file.
-This program uses the \fBMBIO\fP library and will read any swath sonar
-format supported by \fBMBIO\fP. A list of the swath sonar data formats
-currently supported by \fBMBIO\fP and their identifier values
-is given in the \fBMBIO\fP manual page.
-Default: \fIformat\fP = 11.
-.TP
-.B \-H
-This "help" flag cause the program to print out a description
-of its operation and then exit immediately.
-.TP
-.B \-I
-\fIfile\fP
-.br
-Sets the data file from which the input swath data will be read at startup.
-This value can also be set interactively. See below.
-.TP
-.B \-S
-\fIsvpfile\fP
-.br
-Sets the data file from which an input display sound velocity
-profile will be read at startup. See below.
-This value can also be set interactively.
-.TP
-.B \-W
-\fIsvpfile\fP
-.br
-Sets the data file from which an input editable sound velocity
-profile will be read at startup.
-This value can also be set interactively. See below.
-.TP
-.B \-V
-Normally, \fBmbvelocitytool\fP works "silently" without outputting
-anything to the stderr stream.  If the
-\fB\-V\fP flag is given, then \fBmbvelocitytool\fP works in a "verbose" mode and
-outputs the program version being used, all error status messages,
-and a large amount of other information.
-
-.SH INTERACTIVE CONTROLS
-.TP
-.B File
-This button brings up a menu containing the commands listed below:
-.TP
-.B File->Open Display Profile
-Selecting this menu item brings up a popup window which allows the
-user to select an input water velocity profile file. The profile
-will be displayed in a depth vs velocity plot along with other
-display profiles and the edit velocity profile, if one has been
-opened.  Up to ten display velocity profiles may be loaded; the
-color of the display profiles cycles through red, green, blue, and
-black in the order that they are loaded.
-.TP
-.B File->Open Editable Profile
-Selecting this menu item brings up a popup window which allows the
-user to select an input water velocity profile file to be edited.
-The profile
-will be displayed in a depth vs velocity plot along with any
-display profiles that have been opened.  This profile will be plotted
-as black lines with small black squares at the velocity depth points.
-The velocity depth points may be selected and dragged using the mouse
-to change the editable velocity profile.
-.TP
-.B File->New Editable Profile
-Selecting this menu item creates a default editable velocity profile
-consisting of 14 velocity-depth points with a velocity of 1500 m/s.
-Any previously defined editable velocity profile will disappear. The profile
-will be displayed in a depth vs velocity plot along with any
-display profiles that have been opened.  This profile will be plotted
-as black lines with small black squares at the velocity depth points.
-The velocity depth points may be selected and dragged using the left mouse button
-to change the editable velocity profile. The center mouse button adds new
-velocity-depth points, and the right mouse button removes velocity-depth
-points.
-.TP
-.B File->Save Editable Profile
-Selecting this menu item brings up a popup window which allows the
-user to save the current editable velocity profile as a file.
-.TP
-.B File->Open Swath Sonar Data
-Selecting this menu item brings up a popup window which allows the
-user to select an input swath sonar data file to be processed
-in conjunction with the current editable velocity profile.
-The format id for the data file must be set appropriately
-in the editable text widget labeled "MBIO Format ID:"; this
-program uses the \fBMBIO\fP library and will read or write any swath sonar
-format supported by \fBMBIO\fP. A list of the swath sonar data
-formats currently supported by \fBMBIO\fP and their
-identifier values is given in the \fBMBIO\fP manual page.
-If the swath sonar data file is named using the \fBMB-System\fP
-suffix convention (format 11 files end with ".mb11", format
-41 files end with ".mb41", etc.), then the program will
-automatically use the appropriate format id.
-The swath sonar data file must be in one of the formats which store
-travel time data for each beam. Up to 25000 data records
-will be read into a buffer for processing.
-If there is no current editable velocity profile, then a
-default profile consisting of 14 velocity-depth points
-with a velocity of 1500 m/s will be created. A display profile
-generated by the \fBmblevitus\fP program will also be
-automatically generated and loaded into \fBmbvelocitytool\fP;
-this Levitus profile will serve as an average reference for
-the water sound velocity structure at the location of the
-swath data being analyzed. The travel time
-data will then be processed and displayed in the manner described
-below for the \fBReprocess\fP button.
-.TP
-.B File->Save Swath SVP File
-Selecting this menu item saves the current editable velocity
-profile as a file. The SVP filename is that of the current
-swath data input file with a ".svp" suffix added. \fBMBvelocitytool\fP
-also sets the swath data file's \fBmbprocess\fP parameter file
-to recalculate bathymetry using the new SVP file and using the same
-angle mode setting applied in the interactive modeling (see the Angle
-Mode dialog description below).
-.TP
-.B File->Save Residuals As Offsets
-Selecting this menu item saves the current bathymetry residuals
-as a "static bathymetry offset" file.
-The filename is that of the current
-swath data input file with a ".sbo" suffix added. \fBMBvelocitytool\fP
-also sets the swath data file's \fBmbprocess\fP parameter file
-to apply these residuals as static corrections to the bathymetry.
-.TP
-.B Plot Scaling
-This button brings up a dialog containing the three controls
-discussed immediately below.
-.TP
-.B Plot Scaling->Maximum Depth
-This slider sets the maximum depth in meters of both the velocity profile
-display and the raypath display. The minimum depths of these
-displays are always zero. The acrosstrack distance axis of the raypath
-display automatically adjusts so that the rays are plotted with
-no vertical exageration.
-.TP
-.B Plot Scaling->Velocity Range
-This slider sets the minimum and maximum velocity values of the velocity
-profile display.  The minimum value is the velocity center minus the velocity range;
-the maximum value is the velocity center plus the velocity range.
-.TP
-.B Plot Scaling->Velocity Center
-This slider sets the center velocity value of the velocity
-profile display.  The minimum value is the velocity center minus the velocity range;
-the maximum value is the velocity center plus the velocity range.
-.TP
-.B Plot Scaling->Residual Range
-This slider sets the minimum and maximum bathymetry residual values
-of the bathymetry residual display.  The residual plot has a minimum
-value of \-range and a maximum value of +range.
-.TP
-.B Angle Mode
-This button brings up a dialog containing three choices for how the starting
-beam angles are corrected during raytracing. The selected angle mode is
-used by \fBmbvelocitytool\fP in the interactive modeling, and is also passed
-on to the \fBmbprocess\fP parameter file created or modified when an SVP
-file is saved.
-.TP
-.B Angle Mode->Do Not Change Beam Angles
-This button sets the angle mode so that the starting beam angles are not
-corrected before raytracing for the difference between the surface sound
-velocity (SSV) and the sound velocity of the starting depth in the SVP.
-.TP
-.B Angle Mode->Adjust Angles Using Snell's Law
-This button sets the angle mode so that the starting beam angles are
-corrected before raytracing, using Snell's Law, for the difference between the
-surface sound velocity (SSV) and the sound velocity of the starting depth in
-the SVP. This amounts to an assumption that the original SSV was correct
-and that  the rays pass through an insignificantly thick layer in which the
-sound speed equals the SSV before transitioning to the sound speed implied
-by the SVP. This is the default setting for raytracing in \fBmbvelocitytool\fP
-and in \fBMB-System\fP in general.
-.TP
-.B Angle Mode->Adjust Angles Using Sonar Geometry
-This button sets the angle mode so that the starting beam angles are
-corrected before raytracing, using Snell's Law and the sonar geometry, for
-the difference between the surface sound velocity (SSV) and the sound velocity
-of the starting depth in the SVP. This option is relevant to situations where
-the SSV used by the sonar for beamforming was incorrect, and so the initial
-angles themselves must be adjusted. This mode is indistinguishable from
-that of "Adjust Angles Using Snell's Law" for multibeam sonars with flat,
-horizontal receive arrays, but deviates strongly for sonars with tilted,
-V-shaped, or curved receive arrays.
-.TP
-.B Reprocess
-Selecting this button causes the swath sonar travel time data to be processed
-into bathymetry using the current editable velocity profile. The processing
-involves full raytracing through the water velocity model. The bathymetry of
-each ping is fit with a line, and bathymetry residuals are calculated for each
-good beam relative to the linear fit.  The average of the bathymetry residuals
-is displayed in the upper right part of the window as a function of beam number,
-along with "error bars" indicating the standard deviations of the residuals.
-Raypaths are displayed without vertical exageration in the lower part of the
-window; these represent the first raypath calculated for each beam while
-processing the current data (most will be from the first ping). Anomalously
-shallow bathymetry maps into negative residuals and deep bathymetry into positive
-residuals; the residuals are displayed so that shallow is up and deep is down.
-If the seafloor is reasonably smooth so that a linear fit is appropriate, then
-the residuals will accurately reflect any problems with the water velocity profile.
-If the water velocity profile is correct, then the residual plot will be roughly
-flat.  If the water velocity profile is significantly in error, then the outer
-beam depths may anomalously shallow (edge curl up) or deep (edge curl down).
-In practice, the editable velocity profile is altered interactively until a
-reasonably residual pattern is achieved; reference velocity profiles obtained from
-CTD casts, XBT's, or data bases (see manual page for program \fBmblevitus\fP)
-may be read in as display profiles to guide the editing process.
-.TP
-.B Quit
-This button causes the program to exit gracefully, but without asking
-any questions.  If you haven't already saved your edited velocity profile
-it will be lost when you quit.
-
-.SH SEE ALSO
-\fBmbsystem\fP(1), \fBmbprocess\fP(1), \fBmbset\fP, \fBmbsvplist\fP,
-\fBmbbath\fP, \fBmblevitus\fP(1),
-\fBmbm_xbt\fP(1), \fBmbm_xbt\fP(1)
-
-.SH BUGS
-Users cannot remove display sound velocity profiles from the screen
-once they are read in. The main window for mbvelocitytool
-is too large for use on screens smaller than 1024 X 768 pixels.
diff --git a/src/man/man1/proj.1 b/src/man/man1/proj.1
deleted file mode 100644
index 52ca3d9..0000000
--- a/src/man/man1/proj.1
+++ /dev/null
@@ -1,303 +0,0 @@
-.\" release 4
-.nr LL 5.5i
-.ad b
-.hy 1
-.TH PROJ 1 "2000/03/21 Rel. 4.4" 
-.SH NAME
-proj \- forward cartographic projection filter
-.br
-invproj \- inverse cartographic projection filter
-.SH SYNOPSIS
-.B proj
-[
-.B \-bceEfiIlmorsStTvVwW
-[
-.I args
-] ] [
-.B +args
-]
-file[s]
-.br
-.B invproj
-[
-.B \-bceEfiIlmorsStTwW
-[
-.I args
-] ] [
-.B +args
-]
-file[s]
-.SH DESCRIPTION
-.I Proj
-and
-.I invproj
-perform respective forward and inverse transformation of cartographic data
-to or from cartesian data with a wide range of selectable projection functions.
-.PP
-The following control parameters can appear in any order:
-.TP
-.BI \-b
-Special option for binary coordinate data input and output
-through standard input and standard output.
-Data is assumed to be in system type
-.I double
-floating point words.
-This option is to be used when
-.B proj
-is a
-.I son
-process and allows bypassing formatting operations.
-.TP
-.BI \-i
-Selects binary input only (see
-.B \-b option).
-.TP
-.BI \-I
-alternate method to specify inverse projection.
-Redundant when used with
-.B invproj.
-.TP
-.BI \-o
-Selects binary output only (see
-.B \-b option).
-.TP
-.BI \-t "a"
-.I A
-specifies a character employed as the first character to denote
-a control line to be passed through without processing.
-This option applicable to ascii input only.
-(# is the default value).
-.TP
-.BI \-e " string"
-.I String
-is an arbitrary string to be output if an error is detected during
-data transformations.
-The default value is: *\et*.
-Note that if the
-.B \-b,
-.B \-i
-or
-.B \-o
-options are employed, an error is returned as HUGE_VAL
-value for both return values.
-.TP
-.BI \-E
-causes the input coordinates to be copied to the output line
-prior to printing the converted values.
-.TP
-.BI \-l "[p|P|=|e|u|d]" id
-List projection identifiers with
-.B \-l,
-.B \-lp
-or
-.B \-lP (expanded)
-that can be selected with
-.B +proj.
-.BI \-l= id
-gives expanded description of projection
-.I id.
-List ellipsoid identifiers with
-.B \-le,
-that can be selected with
-.B +ellps,
-.B \-lu
-list of cartesian to meter conversion factors
-that can be selected with
-.B +units
-or
-.B \-ld
-list of datums that can be selected with 
-.B +datum.
-.TP
-.BI \-r
-This options reverses the order of the
-expected input from longitude-latitude or x-y to latitude-longitude or y-x.
-.TP
-.BI \-s
-This options reverses the order of the
-output from x-y or longitude-latitude to y-x or latitude-longitude.
-.TP
-.BI \-S
-Causes estimation of
-.I meridinal
-and
-.I parallel
-scale factors,
-.I area
-scale factor and
-.I angular distortion,
-and
-.I maximum
-and
-.I minimum
-scale factors to be listed between <> for each input point.
-For conformal projections meridinal and parallel scales factors
-will be equal and angular distortion zero.
-Equal area projections will have an area factor of 1.
-.TP
-.BI \-m " mult"
-The cartesian data may be scaled by the
-.I mult
-parameter.
-When processing data in a forward projection mode the
-cartesian output values are multiplied by
-.I mult
-otherwise the input cartesian values are divided by
-.I mult
-before inverse projection.
-If the first two characters of
-.I mult
-are 1/ or 1: then the reciprocal value of
-.I mult
-is employed.
-.TP
-.BI \-f " format"
-.I Format
-is a
-.I printf
-format string to control the form of the output values.
-For inverse projections, the output will be in degrees when this option
-is employed.
-The default format is "%.2f" for forward projection and DMS
-for inverse.
-.TP
-.BI \-[w|W] n
-.I N
-is the number of significant fractional digits to employ for
-seconds output (when the option is not specified,
-.B \-w3
-is assumed).
-When
-.B \-W
-is employed the fields will be constant width and with leading zeroes.
-.TP
-.B \-v
-causes a listing of cartographic control parameters tested for and
-used by the program to be printed prior to input data.
-Should not be used with the
-.B \-T
-option.
-.TP
-.B \-V
-This option causes an expanded annotated listing of the characteristics
-of the projected point.
-.B \-v is implied with this option.
-.TP
-.BI \-T " ulow,uhi,vlow,vhi,res[,umax,vmax]"
-This option creates a set of bivariate Chebyshev polynomial
-coefficients that approximate the selected cartographic projection on
-.I stdout.
-The values
-.I low
-and
-.I hi
-denote the range of the input where the
-.I u
-or
-.I v
-prefixes apply to respective longitude-x or latitude-y
-depending upon whether a forward or inverse projection is selected.
-.I Res
-is an integer number specifying the power of 10 precision of the
-approximation.
-For example, a
-.I res
-of \-3 specifies an approximation with an accuracy better than .001.
-.I Umax,
-and
-.I vmax
-specify maximum degree of the polynomials (default: 15).
-See also:
-.B fproj(1).
-.PP
-The
-.B +args
-run-line arguments are associated with cartographic parameters
-and usage varies with projection and for a complete description see
-.I "Cartographic Projection Procedures for the UNIX Environment\(emA User's Manual" )
-and supplementary documentation for Release 4.
-.PP
-Additional projection control parameters may be contained in two
-auxiliary control files:
-the first is optionally referenced with the
-.BI +init= file:id
-and the second is always processed after the name
-of the projection has been established from either the run-line
-or the contents of
-.B +init
-file.
-The environment parameter
-.B PROJ_LIB
-establishes the default directory for a file reference without
-an absolute path.  This is also used for supporting files like
-datum shift files.
-.PP
-One or more
-.I files
-(processed in left to right order)
-specify the source of data to be transformed.
-A \- will specify the location of processing standard input.
-If no files are specified, the input is assumed to be from
-.I stdin.
-For ASCII input data the two data values must be in the
-first two white space separated fields and
-when both input and output are ASCII all trailing portions
-of the input line are appended to the output line.
-.PP
-Input geographic data
-(longitude and latitude) must be in DMS format and input
-cartesian data must be in units consistent with the ellipsoid
-major axis or sphere radius units.
-Output geographic coordinates will be in DMS
-(if the
-.B \-w
-switch is not employed) and precise to 0.001"
-with trailing, zero-valued minute-second fields deleted.
-.SH EXAMPLE
-The following script
-.RS 5
- \f(CWproj +proj=utm +lon_0=112w +ellps=clrk66 \-r <<EOF
- 45d15'33.1"	111.5W
- 45d15.551666667N	-111d30
- +45.25919444444	111d30'000w
- EOF\fR
-.RE
-will perform UTM forward projection with a standard UTM
-central meridian nearest longitude 112\(deW.
-The geographic values of this example are equivalent and meant
-as examples of various forms of DMS input.
-The x-y output data will appear as three lines of:
-.RS 5
- \f(CW460769.27	5011648.45
-.RE
-.SH OTHER PROGRAMS
-.PP
-The \fIproj\fR program is limited to converting between geographic and
-projection coordinates within one datum.
-.PP
-The \fIcs2cs\fR program operates
-similarly, but allows translation between any pair of definable coordinate
-systems, including support for datum translation.
-.PP
-The \fInad2nad\fR program provides for translation between NAD27 and NAD83
-(also available in \fRcs2cs\fI) in a convenient manner. 
-.PP 
-The \fIgeod\fR program provides the ability to compute geodesic (Great
-Circle) computations.
-.SH SEE ALSO
-.B cs2cs(1U), nad2nad(1U), geod(1U), pj_init(3U),
-.br
-.I "Cartographic Projection Procedures for the UNIX Environment\(emA User's Manual,"
-(Evenden, 1990, Open-file report 90-284).
-.br
-.I "Map Projections Used by the U. S. Geological Survey"
-(Snyder, 1984,
-USGS Bulletin 1532).
-.br
-.I "Map Projections\(emA Working Manual"
-(Snyder, 1988, USGS Prof. Paper 1395).
-.br
-.I "An Album of Map Projections"
-(Snyder & Voxland, 1989, USGS Prof. Paper 1453).
-.SH HOME PAGE
-http://www.remotesensing.org/proj
diff --git a/src/man/man3/Makefile b/src/man/man3/Makefile
deleted file mode 100644
index e6c66e7..0000000
--- a/src/man/man3/Makefile
+++ /dev/null
@@ -1,543 +0,0 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
-# src/man/man3/Makefile.  Generated from Makefile.in by configure.
-
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
-
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
-
-
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
-am__make_running_with_option = \
-  case $${target_option-} in \
-      ?) ;; \
-      *) echo "am__make_running_with_option: internal error: invalid" \
-              "target option '$${target_option-}' specified" >&2; \
-         exit 1;; \
-  esac; \
-  has_opt=no; \
-  sane_makeflags=$$MAKEFLAGS; \
-  if $(am__is_gnu_make); then \
-    sane_makeflags=$$MFLAGS; \
-  else \
-    case $$MAKEFLAGS in \
-      *\\[\ \	]*) \
-        bs=\\; \
-        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
-          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
-    esac; \
-  fi; \
-  skip_next=no; \
-  strip_trailopt () \
-  { \
-    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
-  }; \
-  for flg in $$sane_makeflags; do \
-    test $$skip_next = yes && { skip_next=no; continue; }; \
-    case $$flg in \
-      *=*|--*) continue;; \
-        -*I) strip_trailopt 'I'; skip_next=yes;; \
-      -*I?*) strip_trailopt 'I';; \
-        -*O) strip_trailopt 'O'; skip_next=yes;; \
-      -*O?*) strip_trailopt 'O';; \
-        -*l) strip_trailopt 'l'; skip_next=yes;; \
-      -*l?*) strip_trailopt 'l';; \
-      -[dEDm]) skip_next=yes;; \
-      -[JT]) skip_next=yes;; \
-    esac; \
-    case $$flg in \
-      *$$target_option*) has_opt=yes; break;; \
-    esac; \
-  done; \
-  test $$has_opt = yes
-am__make_dryrun = (target_option=n; $(am__make_running_with_option))
-am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
-pkgdatadir = $(datadir)/mbsystem
-pkgincludedir = $(includedir)/mbsystem
-pkglibdir = $(libdir)/mbsystem
-pkglibexecdir = $(libexecdir)/mbsystem
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = x86_64-apple-darwin13.4.0
-host_triplet = x86_64-apple-darwin13.4.0
-subdir = src/man/man3
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
-	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
-	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
-	$(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-	$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/src/mbio/mb_config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-AM_V_P = $(am__v_P_$(V))
-am__v_P_ = $(am__v_P_$(AM_DEFAULT_VERBOSITY))
-am__v_P_0 = false
-am__v_P_1 = :
-AM_V_GEN = $(am__v_GEN_$(V))
-am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
-am__v_GEN_0 = @echo "  GEN     " $@;
-am__v_GEN_1 = 
-AM_V_at = $(am__v_at_$(V))
-am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
-am__v_at_0 = @
-am__v_at_1 = 
-SOURCES =
-DIST_SOURCES =
-am__can_run_installinfo = \
-  case $$AM_UPDATE_INFO_DIR in \
-    n|no|NO) false;; \
-    *) (install-info --version) >/dev/null 2>&1;; \
-  esac
-am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
-am__vpath_adj = case $$p in \
-    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
-    *) f=$$p;; \
-  esac;
-am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
-am__install_max = 40
-am__nobase_strip_setup = \
-  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
-am__nobase_strip = \
-  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
-am__nobase_list = $(am__nobase_strip_setup); \
-  for p in $$list; do echo "$$p $$p"; done | \
-  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
-  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
-    if (++n[$$2] == $(am__install_max)) \
-      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
-    END { for (dir in files) print dir, files[dir] }'
-am__base_list = \
-  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
-  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
-am__uninstall_files_from_dir = { \
-  test -z "$$files" \
-    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
-    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
-         $(am__cd) "$$dir" && rm -f $$files; }; \
-  }
-man3dir = $(mandir)/man3
-am__installdirs = "$(DESTDIR)$(man3dir)"
-NROFF = nroff
-MANS = $(man_MANS)
-am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = ${SHELL} /Users/caress/sandbox/mbsystem/missing aclocal-1.14
-AMTAR = $${TAR-tar}
-AM_DEFAULT_VERBOSITY = 1
-AR = ar
-AUTOCONF = ${SHELL} /Users/caress/sandbox/mbsystem/missing autoconf
-AUTOHEADER = ${SHELL} /Users/caress/sandbox/mbsystem/missing autoheader
-AUTOMAKE = ${SHELL} /Users/caress/sandbox/mbsystem/missing automake-1.14
-AWK = awk
-CC = gcc
-CCAS = gcc
-CCASDEPMODE = depmode=gcc3
-CCASFLAGS = -g -Wall -Wmissing-prototypes -I/opt/X11/include 
-CCDEPMODE = depmode=gcc3
-CFLAGS = -g -Wall -Wmissing-prototypes -I/opt/X11/include 
-CPP = gcc -E
-CPPFLAGS = 
-CYGPATH_W = echo
-DEFS = -DHAVE_CONFIG_H
-DEPDIR = .deps
-DLLTOOL = false
-DSYMUTIL = dsymutil
-DUMPBIN = 
-ECHO_C = \c
-ECHO_N = 
-ECHO_T = 
-EGREP = /sw/bin/grep -E
-EXEEXT = 
-FGREP = /sw/bin/grep -F
-GREP = /sw/bin/grep
-INSTALL = /usr/bin/install -c
-INSTALL_DATA = ${INSTALL} -m 644
-INSTALL_PROGRAM = ${INSTALL}
-INSTALL_SCRIPT = ${INSTALL}
-INSTALL_STRIP_PROGRAM = $(install_sh) -c -s
-LD = /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld
-LDFLAGS = -L/opt/X11/lib
-LIBM = 
-LIBOBJS = 
-LIBS = -lm 
-LIBTOOL = $(SHELL) $(top_builddir)/libtool
-LIBTOOL_DEPS = ./ltmain.sh
-LIPO = lipo
-LN_S = ln -s
-LTLIBOBJS = 
-LT_SYS_LIBRARY_PATH = 
-MAINT = #
-MAKEINFO = ${SHELL} /Users/caress/sandbox/mbsystem/missing makeinfo
-MANIFEST_TOOL = :
-MKDIR_P = ../../.././install-sh -c -d
-NM = /usr/bin/nm
-NMEDIT = nmedit
-OBJDUMP = false
-OBJEXT = o
-OTOOL = otool
-OTOOL64 = :
-OTPS_DIR = /usr/local/OTPS2
-PACKAGE = mbsystem
-PACKAGE_BUGREPORT = http://listserver.mbari.org/sympa/arc/mbsystem
-PACKAGE_NAME = mbsystem
-PACKAGE_STRING = mbsystem 5.5.2252
-PACKAGE_TARNAME = mbsystem
-PACKAGE_URL = http://www.mbari.org/data/mbsystem/
-PACKAGE_VERSION = 5.5.2252
-PATH_SEPARATOR = :
-PKG_CONFIG = 
-PKG_CONFIG_LIBDIR = 
-PKG_CONFIG_PATH = 
-RANLIB = ranlib
-SED = /sw/bin/sed
-SET_MAKE = 
-SHELL = /bin/sh
-STRIP = strip
-VERSION = 5.5.2252
-XDR_LIB = 
-abs_builddir = /Users/caress/sandbox/mbsystem/src/man/man3
-abs_srcdir = /Users/caress/sandbox/mbsystem/src/man/man3
-abs_top_builddir = /Users/caress/sandbox/mbsystem
-abs_top_srcdir = /Users/caress/sandbox/mbsystem
-ac_ct_AR = ar
-ac_ct_CC = gcc
-ac_ct_DUMPBIN = 
-am__include = include
-am__leading_dot = .
-am__quote = 
-am__tar = $${TAR-tar} chof - "$$tardir"
-am__untar = $${TAR-tar} xf -
-bindir = ${exec_prefix}/bin
-build = x86_64-apple-darwin13.4.0
-build_alias = 
-build_cpu = x86_64
-build_os = darwin13.4.0
-build_vendor = apple
-builddir = .
-datadir = ${datarootdir}
-datarootdir = ${prefix}/share
-docdir = ${datarootdir}/doc/${PACKAGE_TARNAME}
-dvidir = ${docdir}
-exec_prefix = ${prefix}
-fftw_app = 
-host = x86_64-apple-darwin13.4.0
-host_alias = 
-host_cpu = x86_64
-host_os = darwin13.4.0
-host_vendor = apple
-htmldir = ${docdir}
-includedir = ${prefix}/include
-infodir = ${datarootdir}/info
-install_sh = ${SHELL} /Users/caress/sandbox/mbsystem/install-sh
-libGLU_CFLAGS = 
-libGLU_LIBS = 
-libXm_CFLAGS = 
-libXm_LIBS = 
-libdir = ${exec_prefix}/lib
-libexecdir = ${exec_prefix}/libexec
-libfftw3_CFLAGS = 
-libfftw3_LIBS = 
-libfftw_CPPFLAGS = -I/sw/include
-libfftw_LIBS = -L/sw/lib -R /sw/lib -lfftw3
-libgmt_CFLAGS = 
-libgmt_CPPFLAGS = -I/sw/include/gmt
-libgmt_LIBS = -L/sw/lib -R /sw/lib -lgmt -lpsl
-libmotif_CPPFLAGS = -I/sw/include
-libmotif_LIBS = -L/sw/lib -R /sw/lib -lXm -lXt -lX11
-libnetcdf_CFLAGS = 
-libnetcdf_CPPFLAGS = -I/sw/include
-libnetcdf_LIBS = -L/sw/lib -R /sw/lib -lnetcdf
-libopengl_CPPFLAGS = 
-libopengl_LIBS = -lGL -lGLU
-libproj_CFLAGS = 
-libproj_CPPFLAGS = -I/sw/include
-libproj_LIBS = -L/sw/lib -R /sw/lib -lproj
-libpsl_CFLAGS = 
-libpsl_LIBS = 
-localedir = ${datarootdir}/locale
-localstatedir = ${prefix}/var
-mandir = ${datarootdir}/man
-mbsystemdatadir = ${datarootdir}/mbsystem
-mbsystemhtmldir = ${datarootdir}/doc/${PACKAGE_TARNAME}/html
-mbsystempsdir = ${datarootdir}/doc/${PACKAGE_TARNAME}/ps
-mkdir_p = $(MKDIR_P)
-oldincludedir = /usr/include
-pdfdir = ${docdir}
-prefix = /Users/caress/sandbox/mbsystem
-program_transform_name = s,x,x,
-psdir = ${docdir}
-sbindir = ${exec_prefix}/sbin
-sharedstatedir = ${prefix}/com
-srcdir = .
-sysconfdir = ${prefix}/etc
-target_alias = 
-top_build_prefix = ../../../
-top_builddir = ../../..
-top_srcdir = ../../..
-man_MANS = mbio.3  
-#man_PROJ = pj_init.3 
-EXTRA_DIST = $(man_MANS) $(man_PROJ)
-all: all-am
-
-.SUFFIXES:
-$(srcdir)/Makefile.in: # $(srcdir)/Makefile.am  $(am__configure_deps)
-	@for dep in $?; do \
-	  case '$(am__configure_deps)' in \
-	    *$$dep*) \
-	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-	        && { if test -f $@; then exit 0; else break; fi; }; \
-	      exit 1;; \
-	  esac; \
-	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/man/man3/Makefile'; \
-	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --gnu src/man/man3/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	@case '$?' in \
-	  *config.status*) \
-	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-	esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure: # $(am__configure_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): # $(am__aclocal_m4_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-
-mostlyclean-libtool:
-	-rm -f *.lo
-
-clean-libtool:
-	-rm -rf .libs _libs
-install-man3: $(man_MANS)
-	@$(NORMAL_INSTALL)
-	@list1=''; \
-	list2='$(man_MANS)'; \
-	test -n "$(man3dir)" \
-	  && test -n "`echo $$list1$$list2`" \
-	  || exit 0; \
-	echo " $(MKDIR_P) '$(DESTDIR)$(man3dir)'"; \
-	$(MKDIR_P) "$(DESTDIR)$(man3dir)" || exit 1; \
-	{ for i in $$list1; do echo "$$i"; done;  \
-	if test -n "$$list2"; then \
-	  for i in $$list2; do echo "$$i"; done \
-	    | sed -n '/\.3[a-z]*$$/p'; \
-	fi; \
-	} | while read p; do \
-	  if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
-	  echo "$$d$$p"; echo "$$p"; \
-	done | \
-	sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^3][0-9a-z]*$$,3,;x' \
-	      -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
-	sed 'N;N;s,\n, ,g' | { \
-	list=; while read file base inst; do \
-	  if test "$$base" = "$$inst"; then list="$$list $$file"; else \
-	    echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man3dir)/$$inst'"; \
-	    $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man3dir)/$$inst" || exit $$?; \
-	  fi; \
-	done; \
-	for i in $$list; do echo "$$i"; done | $(am__base_list) | \
-	while read files; do \
-	  test -z "$$files" || { \
-	    echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man3dir)'"; \
-	    $(INSTALL_DATA) $$files "$(DESTDIR)$(man3dir)" || exit $$?; }; \
-	done; }
-
-uninstall-man3:
-	@$(NORMAL_UNINSTALL)
-	@list=''; test -n "$(man3dir)" || exit 0; \
-	files=`{ for i in $$list; do echo "$$i"; done; \
-	l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
-	  sed -n '/\.3[a-z]*$$/p'; \
-	} | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^3][0-9a-z]*$$,3,;x' \
-	      -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
-	dir='$(DESTDIR)$(man3dir)'; $(am__uninstall_files_from_dir)
-tags TAGS:
-
-ctags CTAGS:
-
-cscope cscopelist:
-
-
-distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	list='$(DISTFILES)'; \
-	  dist_files=`for file in $$list; do echo $$file; done | \
-	  sed -e "s|^$$srcdirstrip/||;t" \
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
-	case $$dist_files in \
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
-			   sort -u` ;; \
-	esac; \
-	for file in $$dist_files; do \
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  if test -d $$d/$$file; then \
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
-	    if test -d "$(distdir)/$$file"; then \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
-	  else \
-	    test -f "$(distdir)/$$file" \
-	    || cp -p $$d/$$file "$(distdir)/$$file" \
-	    || exit 1; \
-	  fi; \
-	done
-check-am: all-am
-check: check-am
-all-am: Makefile $(MANS)
-installdirs:
-	for dir in "$(DESTDIR)$(man3dir)"; do \
-	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
-	done
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
-	if test -z '$(STRIP)'; then \
-	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	      install; \
-	else \
-	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
-	fi
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
-	@echo "This command is intended for maintainers to use"
-	@echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-generic clean-libtool mostlyclean-am
-
-distclean: distclean-am
-	-rm -f Makefile
-distclean-am: clean-am distclean-generic
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am: install-man
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am:
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man: install-man3
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
-	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-generic mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am: uninstall-man
-
-uninstall-man: uninstall-man3
-
-.MAKE: install-am install-strip
-
-.PHONY: all all-am check check-am clean clean-generic clean-libtool \
-	cscopelist-am ctags-am distclean distclean-generic \
-	distclean-libtool distdir dvi dvi-am html html-am info info-am \
-	install install-am install-data install-data-am install-dvi \
-	install-dvi-am install-exec install-exec-am install-html \
-	install-html-am install-info install-info-am install-man \
-	install-man3 install-pdf install-pdf-am install-ps \
-	install-ps-am install-strip installcheck installcheck-am \
-	installdirs maintainer-clean maintainer-clean-generic \
-	mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
-	ps ps-am tags-am uninstall uninstall-am uninstall-man \
-	uninstall-man3
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/man/man3/Makefile.am b/src/man/man3/Makefile.am
deleted file mode 100644
index 92bbdbd..0000000
--- a/src/man/man3/Makefile.am
+++ /dev/null
@@ -1,8 +0,0 @@
-man_MANS = mbio.3  
-
-if BUILD_PROJ
-  man_PROJ = pj_init.3 
-endif
-
-EXTRA_DIST = $(man_MANS) $(man_PROJ)
-
diff --git a/src/man/man3/Makefile.in b/src/man/man3/Makefile.in
deleted file mode 100644
index 89ea14b..0000000
--- a/src/man/man3/Makefile.in
+++ /dev/null
@@ -1,543 +0,0 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
-
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
-am__make_running_with_option = \
-  case $${target_option-} in \
-      ?) ;; \
-      *) echo "am__make_running_with_option: internal error: invalid" \
-              "target option '$${target_option-}' specified" >&2; \
-         exit 1;; \
-  esac; \
-  has_opt=no; \
-  sane_makeflags=$$MAKEFLAGS; \
-  if $(am__is_gnu_make); then \
-    sane_makeflags=$$MFLAGS; \
-  else \
-    case $$MAKEFLAGS in \
-      *\\[\ \	]*) \
-        bs=\\; \
-        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
-          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
-    esac; \
-  fi; \
-  skip_next=no; \
-  strip_trailopt () \
-  { \
-    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
-  }; \
-  for flg in $$sane_makeflags; do \
-    test $$skip_next = yes && { skip_next=no; continue; }; \
-    case $$flg in \
-      *=*|--*) continue;; \
-        -*I) strip_trailopt 'I'; skip_next=yes;; \
-      -*I?*) strip_trailopt 'I';; \
-        -*O) strip_trailopt 'O'; skip_next=yes;; \
-      -*O?*) strip_trailopt 'O';; \
-        -*l) strip_trailopt 'l'; skip_next=yes;; \
-      -*l?*) strip_trailopt 'l';; \
-      -[dEDm]) skip_next=yes;; \
-      -[JT]) skip_next=yes;; \
-    esac; \
-    case $$flg in \
-      *$$target_option*) has_opt=yes; break;; \
-    esac; \
-  done; \
-  test $$has_opt = yes
-am__make_dryrun = (target_option=n; $(am__make_running_with_option))
-am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-subdir = src/man/man3
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
-	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
-	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
-	$(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-	$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/src/mbio/mb_config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-AM_V_P = $(am__v_P_ at AM_V@)
-am__v_P_ = $(am__v_P_ at AM_DEFAULT_V@)
-am__v_P_0 = false
-am__v_P_1 = :
-AM_V_GEN = $(am__v_GEN_ at AM_V@)
-am__v_GEN_ = $(am__v_GEN_ at AM_DEFAULT_V@)
-am__v_GEN_0 = @echo "  GEN     " $@;
-am__v_GEN_1 = 
-AM_V_at = $(am__v_at_ at AM_V@)
-am__v_at_ = $(am__v_at_ at AM_DEFAULT_V@)
-am__v_at_0 = @
-am__v_at_1 = 
-SOURCES =
-DIST_SOURCES =
-am__can_run_installinfo = \
-  case $$AM_UPDATE_INFO_DIR in \
-    n|no|NO) false;; \
-    *) (install-info --version) >/dev/null 2>&1;; \
-  esac
-am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
-am__vpath_adj = case $$p in \
-    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
-    *) f=$$p;; \
-  esac;
-am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
-am__install_max = 40
-am__nobase_strip_setup = \
-  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
-am__nobase_strip = \
-  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
-am__nobase_list = $(am__nobase_strip_setup); \
-  for p in $$list; do echo "$$p $$p"; done | \
-  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
-  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
-    if (++n[$$2] == $(am__install_max)) \
-      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
-    END { for (dir in files) print dir, files[dir] }'
-am__base_list = \
-  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
-  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
-am__uninstall_files_from_dir = { \
-  test -z "$$files" \
-    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
-    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
-         $(am__cd) "$$dir" && rm -f $$files; }; \
-  }
-man3dir = $(mandir)/man3
-am__installdirs = "$(DESTDIR)$(man3dir)"
-NROFF = nroff
-MANS = $(man_MANS)
-am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-CC = @CC@
-CCAS = @CCAS@
-CCASDEPMODE = @CCASDEPMODE@
-CCASFLAGS = @CCASFLAGS@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DLLTOOL = @DLLTOOL@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GREP = @GREP@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBM = @LIBM@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIBTOOL_DEPS = @LIBTOOL_DEPS@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LTLIBOBJS = @LTLIBOBJS@
-LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
-MAINT = @MAINT@
-MAKEINFO = @MAKEINFO@
-MANIFEST_TOOL = @MANIFEST_TOOL@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-OTPS_DIR = @OTPS_DIR@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_URL = @PACKAGE_URL@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PKG_CONFIG = @PKG_CONFIG@
-PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
-PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-VERSION = @VERSION@
-XDR_LIB = @XDR_LIB@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_AR = @ac_ct_AR@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-fftw_app = @fftw_app@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libGLU_CFLAGS = @libGLU_CFLAGS@
-libGLU_LIBS = @libGLU_LIBS@
-libXm_CFLAGS = @libXm_CFLAGS@
-libXm_LIBS = @libXm_LIBS@
-libdir = @libdir@
-libexecdir = @libexecdir@
-libfftw3_CFLAGS = @libfftw3_CFLAGS@
-libfftw3_LIBS = @libfftw3_LIBS@
-libfftw_CPPFLAGS = @libfftw_CPPFLAGS@
-libfftw_LIBS = @libfftw_LIBS@
-libgmt_CFLAGS = @libgmt_CFLAGS@
-libgmt_CPPFLAGS = @libgmt_CPPFLAGS@
-libgmt_LIBS = @libgmt_LIBS@
-libmotif_CPPFLAGS = @libmotif_CPPFLAGS@
-libmotif_LIBS = @libmotif_LIBS@
-libnetcdf_CFLAGS = @libnetcdf_CFLAGS@
-libnetcdf_CPPFLAGS = @libnetcdf_CPPFLAGS@
-libnetcdf_LIBS = @libnetcdf_LIBS@
-libopengl_CPPFLAGS = @libopengl_CPPFLAGS@
-libopengl_LIBS = @libopengl_LIBS@
-libproj_CFLAGS = @libproj_CFLAGS@
-libproj_CPPFLAGS = @libproj_CPPFLAGS@
-libproj_LIBS = @libproj_LIBS@
-libpsl_CFLAGS = @libpsl_CFLAGS@
-libpsl_LIBS = @libpsl_LIBS@
-localedir = @localedir@
-localstatedir = @localstatedir@
-mandir = @mandir@
-mbsystemdatadir = @mbsystemdatadir@
-mbsystemhtmldir = @mbsystemhtmldir@
-mbsystempsdir = @mbsystempsdir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-man_MANS = mbio.3  
- at BUILD_PROJ_TRUE@man_PROJ = pj_init.3 
-EXTRA_DIST = $(man_MANS) $(man_PROJ)
-all: all-am
-
-.SUFFIXES:
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
-	@for dep in $?; do \
-	  case '$(am__configure_deps)' in \
-	    *$$dep*) \
-	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-	        && { if test -f $@; then exit 0; else break; fi; }; \
-	      exit 1;; \
-	  esac; \
-	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/man/man3/Makefile'; \
-	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --gnu src/man/man3/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	@case '$?' in \
-	  *config.status*) \
-	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-	esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-
-mostlyclean-libtool:
-	-rm -f *.lo
-
-clean-libtool:
-	-rm -rf .libs _libs
-install-man3: $(man_MANS)
-	@$(NORMAL_INSTALL)
-	@list1=''; \
-	list2='$(man_MANS)'; \
-	test -n "$(man3dir)" \
-	  && test -n "`echo $$list1$$list2`" \
-	  || exit 0; \
-	echo " $(MKDIR_P) '$(DESTDIR)$(man3dir)'"; \
-	$(MKDIR_P) "$(DESTDIR)$(man3dir)" || exit 1; \
-	{ for i in $$list1; do echo "$$i"; done;  \
-	if test -n "$$list2"; then \
-	  for i in $$list2; do echo "$$i"; done \
-	    | sed -n '/\.3[a-z]*$$/p'; \
-	fi; \
-	} | while read p; do \
-	  if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
-	  echo "$$d$$p"; echo "$$p"; \
-	done | \
-	sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^3][0-9a-z]*$$,3,;x' \
-	      -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
-	sed 'N;N;s,\n, ,g' | { \
-	list=; while read file base inst; do \
-	  if test "$$base" = "$$inst"; then list="$$list $$file"; else \
-	    echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man3dir)/$$inst'"; \
-	    $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man3dir)/$$inst" || exit $$?; \
-	  fi; \
-	done; \
-	for i in $$list; do echo "$$i"; done | $(am__base_list) | \
-	while read files; do \
-	  test -z "$$files" || { \
-	    echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man3dir)'"; \
-	    $(INSTALL_DATA) $$files "$(DESTDIR)$(man3dir)" || exit $$?; }; \
-	done; }
-
-uninstall-man3:
-	@$(NORMAL_UNINSTALL)
-	@list=''; test -n "$(man3dir)" || exit 0; \
-	files=`{ for i in $$list; do echo "$$i"; done; \
-	l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
-	  sed -n '/\.3[a-z]*$$/p'; \
-	} | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^3][0-9a-z]*$$,3,;x' \
-	      -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
-	dir='$(DESTDIR)$(man3dir)'; $(am__uninstall_files_from_dir)
-tags TAGS:
-
-ctags CTAGS:
-
-cscope cscopelist:
-
-
-distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	list='$(DISTFILES)'; \
-	  dist_files=`for file in $$list; do echo $$file; done | \
-	  sed -e "s|^$$srcdirstrip/||;t" \
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
-	case $$dist_files in \
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
-			   sort -u` ;; \
-	esac; \
-	for file in $$dist_files; do \
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  if test -d $$d/$$file; then \
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
-	    if test -d "$(distdir)/$$file"; then \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
-	  else \
-	    test -f "$(distdir)/$$file" \
-	    || cp -p $$d/$$file "$(distdir)/$$file" \
-	    || exit 1; \
-	  fi; \
-	done
-check-am: all-am
-check: check-am
-all-am: Makefile $(MANS)
-installdirs:
-	for dir in "$(DESTDIR)$(man3dir)"; do \
-	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
-	done
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
-	if test -z '$(STRIP)'; then \
-	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	      install; \
-	else \
-	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
-	fi
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
-	@echo "This command is intended for maintainers to use"
-	@echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-generic clean-libtool mostlyclean-am
-
-distclean: distclean-am
-	-rm -f Makefile
-distclean-am: clean-am distclean-generic
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am: install-man
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am:
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man: install-man3
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
-	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-generic mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am: uninstall-man
-
-uninstall-man: uninstall-man3
-
-.MAKE: install-am install-strip
-
-.PHONY: all all-am check check-am clean clean-generic clean-libtool \
-	cscopelist-am ctags-am distclean distclean-generic \
-	distclean-libtool distdir dvi dvi-am html html-am info info-am \
-	install install-am install-data install-data-am install-dvi \
-	install-dvi-am install-exec install-exec-am install-html \
-	install-html-am install-info install-info-am install-man \
-	install-man3 install-pdf install-pdf-am install-ps \
-	install-ps-am install-strip installcheck installcheck-am \
-	installdirs maintainer-clean maintainer-clean-generic \
-	mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
-	ps ps-am tags-am uninstall uninstall-am uninstall-man \
-	uninstall-man3
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/man/man3/mbio.3 b/src/man/man3/mbio.3
deleted file mode 100644
index 33fda58..0000000
--- a/src/man/man3/mbio.3
+++ /dev/null
@@ -1,3999 +0,0 @@
-.TH mbio 3 "3 June 2013" "MB-System 5.0" "MB-System 5.0"
-
-.SH NAME
-\fBmbio\fP \- Format independent input/output library for swath mapping sonar data.
-
-.SH VERSION
-Version 5.0
-
-.SH DESCRIPTION
-\fBMBIO\fP (\fBM\fPulti\fBB\fPeam \fBI\fPnput/\fBO\fPutput) is a library
-of functions used for reading and writing swath mapping sonar
-data files.  \fBMBIO\fP supports a large number of data
-formats associated with different institutions and different sonar systems.
-The purpose of \fBMBIO\fP is to allow users to write processing and display
-programs which are independent of particular data formats and to provide
-a standard approach to swath mapping sonar data i/o.
-
-.SH AUTHORSHIP
-David W. Caress (caress at mbari.org)
-.br
-  Monterey Bay Aquarium Research Institute
-.br
-Dale N. Chayes (dale at ldeo.columbia.edu)
-.br
-  Lamont-Doherty Earth Observatory
-
-.SH DATA TERMINOLOGY
-\fBMBIO\fP handles three types of swath mapping data:  beam bathymetry,
-beam amplitude, and sidescan.  Both amplitude and sidescan represent
-measures of backscatter strength. Beam amplitudes are backscatter
-values associated with the same preformed beams used to
-obtain bathymetry; \fBMBIO\fP assumes that a bathymetry value
-exists for each amplitude value and uses the bathymetry beam
-location for the amplitude.  Sidescan is generally constructed with
-a higher spatial resolution than bathymetry, and carries its
-own location parameters.  In the context of \fBMB-System\fP documentation,
-the discrete values of bathymetry and amplitude are referred
-to as "beams", and the discrete values of sidescan are referred to
-as "pixels". An additional difference between "beam" and "pixel"
-data involves data flagging. An array of "beamflags" is carried by
-\fBMBIO\fP functions which allows the bathymetry (and by extension
-the amplitude) data to be flagged as bad. The details of the
-beamflagging scheme are presented below.
-
-.SH VERSION 5 CHANGES
-This document describes version 5 releases of \fBMBIO\fP.
-The source code structure used in version 4 \fBMBIO\fP had grown
-complex and difficult to support. In particular, the addition
-of new i/o modules had become excessively time consuming.
-Consequently, we have restructured and rewritten much of the library.
-Most of the changes are internal, but two  function calls have
-disappeared (\fBmb_put()\fP and \fBmb_write()\fP), and a
-number of new functions have been added.
-
-A further significant architectural change was implemented for
-release 5.0.8 in order to support data formats that have no
-explicit maximum number of beams or pixels. The memory management
-of arrays used to hold bathymetry, amplitude, and sidescan data
-has been made dynamic. Now, when data records are encountered that
-include larger numbers of beams or pixels than will fit in the
-arrays previously allocated, those arrays are reallocated to
-the required size. This is handled automatically for all of the
-internal arrays used by \fBMBIO\fP functions. Of course,
-applications using \fBMBIO\fP must allocate arrays that are
-passed into functions like \fBmb_read\fP, \fBmb_get_all\fP, and
-\fBmb_get\fP to be populated by the desired data. In order for
-these arrays to be managed dynamically, the application must
-first register each array by passing the location of the array
-pointer to a new function called \fBmb_register_array\fP.
-
-.SH OVERVIEW
-\fBMBIO\fP opens and initializes sonar data files for reading
-and writing using the functions \fBmb_read_init\fP and \fBmb_write_init\fP,
-respectively.  These functions return a pointer to a data structure
-including all relevent information about the opened file, the
-control parameters which determine how data is read or written,
-and the arrays used for processing the data as it is read or written.
-This pointer is then passed to the functions used for reading or
-writing.  There is no limit on the number of files which may be
-opened for reading or writing at any given time in a program.
-
-The \fBmb_read_init\fP and \fBmb_write_init\fP functions also return
-initial maximum numbers of bathymetry beams, amplitude beams,
-and sidescan pixels that can be used to allocate data storage
-arrays of the appropriate sizes. However, for some data formats
-there are no specified maximum numbers of beams and pixels, and
-so in general the required dimensions may increase as data are
-read. Applications must pass appropriately dimensioned arrays
-into data extraction routines such as \fBmb_read\fP, \fBmb_get\fP,
-and \fBmb_get_all\fP. In order to enable dynamic memory management
-of thse application arrays, the application must first register
-each array by passing the array pointer location to the function
-\fBmb_register_array\fP.
-
-Data files are closed using the function \fBmb_close\fP. All
-internal and registered arrays are deallocated as part of closing
-the file.
-
-When it comes to actually reading and writing swath mapping
-sonar data, \fBMBIO\fP has three levels of i/o functionality:
- 	1:	Simple reading of swath data files. The primary
- 		functions are:
-  			\fBmb_read()\fP
- 			\fBmb_get()\fP
- 		The positions of individual beams and pixels are
- 		returned in longitude and latitude by
- 		\fBmb_read()\fP and in acrosstrack and alongtrack
- 		distances by \fBmb_get()\fP. Only a limited set
- 		of navigation information is returned. Comments
- 		are also returned. These functions can be used
- 		without any special include  files or any
- 		knowledge of the actual data structures used
- 		by the data formats or \fBMBIO\fP.
- 	2:	Complete reading and writing of data structures
- 		containing all of the available information.
- 		Data records may be read or written without
- 		extracting any of the information, or the
- 		swath data may be passed with the data structure.
- 		Several functions exist to extract information
- 		from or insert information into the data
- 		structures; otherwise, special include files
- 		are required to make sense of the sonar-specific
- 		data structures passed by level 2 i/o functions.
- 		The basic read and write functions that only pass
- 		pointers to internal data structures are:
- 			\fBmb_read_ping()\fP
- 			\fBmb_write_ping()\fP
- 		The read and write routines which also extract
- 		or insert information are:
- 			\fBmb_get_all()\fP
- 			\fBmb_put_all()\fP
- 			\fBmb_put_comment()\fP
- 		The information extraction and insertion
- 		functions are:
- 			\fBmb_insert()\fP
- 			\fBmb_extract()\fP
- 			\fBmb_extract_nav()\fP
- 			\fBmb_insert_nav()\fP
- 			\fBmb_extract_altitude()\fP
- 			\fBmb_insert_altitude()\fP
- 			\fBmb_ttimes()\fP
- 			\fBmb_copyrecord()\fP
- 	3:	Buffered reading and writing of data structures
- 		containing all of the available information.
- 		The primary functions are:
- 			\fBmb_buffer_init()\fP
- 			\fBmb_buffer_close()\fP
- 			\fBmb_buffer_load()\fP
- 			\fBmb_buffer_dump()\fP
- 			\fBmb_buffer_info()\fP
- 			\fBmb_buffer_get_next_data()\fP
- 			\fBmb_buffer_extract()\fP
- 			\fBmb_buffer_insert()\fP
- 			\fBmb_buffer_get_next_nav()\fP
- 			\fBmb_buffer_extract_nav()\fP
- 			\fBmb_buffer_insert_nav()\fP
-
-The level 1 \fBMBIO\fP functions allow users to read
-sonar data independent of format, with the limitation that
-only a limited set of navigation information is passed.  Thus, some of the
-information contained in certain data formats (e.g. the "heave" value
-in Hydrosweep DS data) is not passed by \fBmb_read()\fP or \fBmb_get()\fP.
-In general, the level 1 functions are useful for applications
-such as graphics which require only the navigation and the depth
-and/or backscatter values.
-
-The level 2 functions (\fBmb_get_all()\fP and
-\fBmb_put_all()\fP) read and write the complete data
-structures, translate the data to internal data structures
-associated with each of the supported sonar systems, and
-pass pointers to these internal data structures. Additional
-functions allow a variety of information to be extracted
-from or inserted into the data structures (e.g. mb_extract()
-and mb_insert()). Additional information may be accessed
-using special include files to  decode the data structures.
-The great majority of processing programs use level 2 functions.
-
-The level 3 functions provide buffered reading and
-writing which is useful for applications that generate
-output files and need access to multiple pings at a time.  In addition to reading
-(\fBmb_buffer_load()\fP) and writing (\fBmb_buffer_dump()\fP), functions
-exist for extracting information from the buffer (\fBmb_buffer_extract()\fP)
-and inserting information into the buffer (\fBmb_buffer_insert()\fP).
-
-\fBMBIO\fP supports swath data in a number of different formats,
-each specified by a unique id number. The function \fBmb_format()\fP
-determines if a format id is valid. A set of similar functions
-returns information about the specified format
-(e.g. \fBmb_format_description()\fP, \fBmb_format_system()\fP,
-\fBmb_format_description()\fP, \fBmb_format_dimensions()\fP,
-\fBmb_format_flags()\fP, \fBmb_format_source()\fP,
-\fBmb_format_beamwidth()\fP).
-
-Some \fBMB-System\fP programs can process multiple data
-files specified in "datalist" files. Each line of a datalist
-file contains a file path and the corresponding \fBMBIO\fP
-format id. Datalist files can be recursive and can contain
-comments. The functions used to extract input swath data
-file paths from datalist files
-includes \fBmb_datalist_open()\fP, \fBmb_datalist_read()\fP,
-and \fBmb_datalist_close()\fP.
-
-A number of other \fBMBIO\fP functions dealing with default values for
-important parameters, error messages, memory management, and time conversions
-also exist and are discussed below.
-
-.SH SUPPORTED SWATH SONAR SYSTEMS
-Each swath mapping sonar system outputs a data stream which includes some values
-or parameters unique to that system.  In general, a number of different data
-formats have come into use for data from each of the sonar systems; many of
-these formats include only a subset of the original data stream.  Internally,
-\fBMBIO\fP recognizes which sonar system each data format is associated
-with and uses a data structure including the complete data stream for that
-sonar.  Consequently, it is possible to read and write the complete
-data stream when using the level 2 or 3 \fBMBIO\fP functions.
-At present, formats associated with the following sonars are
-supported:
- 	SeaBeam "classic" 16 beam multibeam sonar
- 	Hydrosweep DS 59 beam multibeam sonar
- 	Hydrosweep MD 40 beam mid-depth multibeam
- 		sonar
- 	SeaBeam 2000 multibeam sonar
- 	SeaBeam 2112, 2120, and 2130 multibeam
- 		sonars
- 	Simrad EM12, EM121, EM950, and EM1000
- 		multibeam sonars
- 	Simrad EM120, EM300, EM1002, and EM3000
- 		multibeam sonars
- 	Hawaii MR-1 shallow tow interferometric
- 		sonar
- 	ELAC Bottomchart 1180 and 1050 multibeam
- 		sonars
- 	ELAC/SeaBeam Bottomchart Mk2 1180 and
- 		1050 multibeam sonars
- 	Reson Seabat 9001/9002 multibeam sonars
- 	Reson Seabat 8101 multibeam sonars
- 	Simrad/Mesotech SM2000 multibeam sonars
- 	WHOI DSL AMS-120 deep tow interferometric
- 		sonar
-	AMS-60 interferometric sonar
-
-.SH SUPPORTED FORMATS
-The following swath mapping sonar data formats are supported in this version of
-\fBMBIO\fP:
-
-    MBIO Data Format ID:  11
-    Format name:          MBF_SBSIOMRG
-    Informal Description: SIO merge Sea Beam
-    Attributes:           Sea Beam, bathymetry, 16 beams,
-                          binary, uncentered, SIO.
-
-    MBIO Data Format ID:  12
-    Format name:          MBF_SBSIOCEN
-    Informal Description: SIO centered Sea Beam
-    Attributes:           Sea Beam, bathymetry, 19 beams,
-                          binary, centered, SIO.
-
-    MBIO Data Format ID:  13
-    Format name:          MBF_SBSIOLSI
-    Informal Description: SIO LSI Sea Beam
-    Attributes:           Sea Beam, bathymetry, 19 beams,
-                          binary, centered, obsolete, SIO.
-
-    MBIO Data Format ID:  14
-    Format name:          MBF_SBURICEN
-    Informal Description: URI Sea Beam
-    Attributes:           Sea Beam, bathymetry, 19 beams,
-                          binary, centered, URI.
-
-    MBIO Data Format ID:  15
-    Format name:          MBF_SBURIVAX
-    Informal Description: URI Sea Beam from VAX
-    Attributes:           Sea Beam, bathymetry, 19 beams,
-                          binary, centered,
-                          VAX byte order, URI.
-
-    MBIO Data Format ID:  16
-    Format name:          MBF_SBSIOSWB
-    Informal Description: SIO Swath-bathy SeaBeam
-    Attributes:           Sea Beam, bathymetry, 19 beams,
-                          binary, centered, SIO.
-
-    MBIO Data Format ID:  17
-    Format name:          MBF_SBIFREMR
-    Informal Description: IFREMER Archive SeaBeam
-    Attributes:           Sea Beam, bathymetry, 19 beams,
-                          ascii, centered, IFREMER.
-
-    MBIO Data Format ID:  21
-    Format name:          MBF_HSATLRAW
-    Informal Description: Raw Hydrosweep
-    Attributes:           Hydrosweep DS, bathymetry and
-                          amplitude, 59 beams, ascii,
-                          Atlas Electronik.
-
-    MBIO Data Format ID:  22
-    Format name:          MBF_HSLDEDMB
-    Informal Description: EDMB Hydrosweep
-    Attributes:           Hydrosweep DS, bathymetry,
-                          59 beams, binary, NRL.
-
-    MBIO Data Format ID:  23
-    Format name:          MBF_HSURICEN
-    Informal Description: URI Hydrosweep
-    Attributes:           Hydrosweep DS, 59 beams,
-                          bathymetry, binary, URI.
-
-    MBIO Data Format ID:  24
-    Format name:          MBF_HSLDEOIH
-    Informal Description: L-DEO in-house binary Hydrosweep
-    Attributes:           Hydrosweep DS, 59 beams,
-                          bathymetry and amplitude,
- 			  binary, centered, L-DEO.
-
-    MBIO Data Format ID:  25
-    Format name:          MBF_HSURIVAX
-    Informal Description: URI Hydrosweep from VAX
-    Attributes:           Hydrosweep DS, 59 beams,
-                          bathymetry, binary, VAX byte
-                          order, URI.
-
-    MBIO Data Format ID:  32
-    Format name:          MBF_SB2000SB
-    Informal Description: SIO Swath-bathy SeaBeam 2000
-    Attributes:           SeaBeam 2000, bathymetry, 121
-                          beams, binary,  SIO.
-
-    MBIO Data Format ID:  33
-    Format name:          MBF_SB2000SS
-    Informal Description: SIO Swath-bathy SeaBeam 2000
-    Attributes:           SeaBeam 2000, sidescan,
-                          1000 pixels for 4-bit
-                          sidescan, 2000 pixels for
-                          12+-bit sidescan, binary,
-                          SIO.
-
-    MBIO Data Format ID:  41
-    Format name:          MBF_SB2100RW
-    Informal Description: SeaBeam 2100 series vender format
-    Attributes:           SeaBeam 2100, bathymetry,
-                          amplitude and sidescan,
-                          151 beams and 2000 pixels,
-                          ascii with binary sidescan,
-                          SeaBeam Instruments.
-
-    MBIO Data Format ID:  42
-    Format name:          MBF_SB2100B1
-    Informal Description: SeaBeam 2100 series vender format
-    Attributes:           SeaBeam 2100, bathymetry,
-                          amplitude and sidescan,
-                          151 beams bathymetry,
-                          2000 pixels sidescan, binary,
-                          SeaBeam Instruments and L-DEO.
-
-    MBIO Data Format ID:  43
-    Format name:          MBF_SB2100B2
-    Informal Description: SeaBeam 2100 series vender format
-    Attributes:           SeaBeam 2100, bathymetry and
-                          amplitude, 151 beams bathymetry,
-                          binary, SeaBeam Instruments
-                          and L-DEO.
-
-    MBIO Data Format ID:  51
-    Format name:          MBF_EMOLDRAW
-    Informal Description: Old Simrad vendor multibeam format
-    Attributes:           Simrad EM1000, EM12S, EM12D,
-                          and EM121 multibeam sonars,
-                          bathymetry, amplitude, and
-                          sidescan, 60 beams for EM1000,
-                          81 beams for EM12S/D, 121 beams
-                          for EM121, variable pixels,
-                          ascii + binary, Simrad.
-
-    MBIO Data Format ID:  53
-    Format name:          MBF_EM12IFRM
-    Informal Description: IFREMER TRISMUS format for
-                          Simrad EM12
-    Attributes:           Simrad EM12S and EM12D,
-                          bathymetry, amplitude, and
-                          sidescan 81 beams, variable
-                          pixels, binary, IFREMER.
-
-    MBIO Data Format ID:  54
-    Format name:          MBF_EM12DARW
-    Informal Description: Simrad EM12S RRS Darwin
-                          processed format
-    Attributes:           Simrad EM12S, bathymetry
-                          and amplitude, 81 beams,
-                          binary, Oxford University.
-
-    MBIO Data Format ID:  56
-    Format name:          MBF_EM300RAW
-    Informal Description: Simrad current multibeam
-                          vendor format
-    Attributes:           Simrad EM120, EM300, EM1002,
-                          EM3000, bathymetry, amplitude,
-                          and sidescan, up to 254 beams,
-                          variable pixels, ascii + binary,
-                          Simrad.
-
-    MBIO Data Format ID:  57
-    Format name:          MBF_EM300MBA
-    Informal Description: Simrad multibeam processing format
-    Attributes:           Old and new Simrad multibeams,
- 			  EM12S, EM12D, EM121, EM120,
-                          EM300, EM100, EM1000, EM950,
-                          EM1002, EM3000, bathymetry,
-                          amplitude, and sidescan,
-                          up to 254 beams, variable pixels,
-                          ascii + binary, MBARI.
-
-    MBIO Data Format ID:  58
-    Format name:          MBF_EM710RAW
-    Informal Description: Simrad current multibeam vendor format
-    Attributes:           Simrad EM710,
-                          bathymetry, amplitude, and sidescan,
-                          up to 400 beams, variable pixels,
-    			  binary, Simrad.
-
-    MBIO Data Format ID:  59
-    Format name:          MBF_EM710MBA
-    Informal Description: Simrad current multibeam vendor format
-    Attributes:           Simrad EM710,
-                          bathymetry, amplitude, and sidescan,
-                          up to 400 beams, variable pixels,
-    			  binary, Simrad.
-
-    MBIO Data Format ID:  61
-    Format name:          MBF_MR1PRHIG
-    Informal Description: SOEST MR1 post processed format
-    Attributes:           SOEST MR1, bathymetry and
-                          sidescan, variable beams and
-                          pixels, xdr binary, SOEST,
-                          University of Hawaii.
-
-    MBIO Data Format ID:  62
-    Format name:          MBF_MR1ALDEO
-    Informal Description: L-DEO MR1 post processed
-                          format with travel times
-    Attributes:           L-DEO MR1, bathymetry and
-                          sidescan, variable beams
-                          and pixels, xdr binary, L-DEO.
-
-    MBIO Data Format ID:  63
-    Format name:          MBF_MR1BLDEO
-    Informal Description: L-DEO small MR1 post processed
-                          format with travel times
-    Attributes:           L-DEO MR1, bathymetry and sidescan,
-                          variable beams and pixels,
-                          xdr binary, L-DEO.
-
-    MBIO Data Format ID:  64
-    Format name:          MBF_MR1PRVR2
-    Informal Description: SOEST MR1 post processed format
-    Attributes:           SOEST MR1, bathymetry and sidescan,
-                          variable beams and pixels, xdr binary,
-                          SOEST, University of Hawaii.
-
-    MBIO Data Format ID:  71
-    Format name:          MBF_MBLDEOIH
-    Informal Description: L-DEO in-house generic multibeam
-    Attributes:           Data from all sonar systems,
-                          bathymetry, amplitude and
-                          sidescan, variable beams and
-                          pixels, binary, centered, L-DEO.
-
-    MBIO Data Format ID:  75
-    Format name:          MBF_MBNETCDF
-    Informal Description: CARAIBES CDF multibeam
-    Attributes:           Data from all sonar systems,
-                          bathymetry only, variable
-                          beams, netCDF, IFREMER.
-
-    MBIO Data Format ID:  81
-    Format name:          MBF_CBAT9001
-    Informal Description: Reson SeaBat 9001 shallow
-                          water multibeam
-    Attributes:           60 beam bathymetry and
-                          amplitude, binary, University
-                          of New Brunswick.
-
-    MBIO Data Format ID:  82
-    Format name:          MBF_CBAT8101
-    Informal Description: Reson SeaBat 8101 shallow
-                          water multibeam
-    Attributes:           101 beam bathymetry and
-                          amplitude, binary, SeaBeam
-                          Instruments.
-
-    MBIO Data Format ID:  83
-    Format name:          MBF_HYPC8101
-    Informal Description: Reson SeaBat 8101 shallow
-                          water multibeam
-    Attributes:           101 beam bathymetry,
-                          ASCII, read-only, Coastal
-                          Oceanographics.
-
-    MBIO Data Format ID:  84
-    Format name:          MBF_XTFR8101
-    Informal Description: XTF format Reson SeaBat 81XX
-    Attributes:           240 beam bathymetry and amplitude,
-                          1024 pixel sidescan
-                          binary, read-only,
-                          Triton-Elics.
-
-    MBIO Data Format ID:  88
-    Format name:          MBF_RESON7KR
-    Informal Description: Reson 7K multibeam vendor format
-    Attributes:           Reson 7K series multibeam sonars,
-                          bathymetry, amplitude, three
-                          channels sidescan, and subbottom
-                          up to 254 beams, variable pixels,
-                          binary, Reson.
-
-    MBIO Data Format ID:  91
-    Format name:          MBF_BCHRTUNB
-    Informal Description: Elac BottomChart shallow
-                          water multibeam
-    Attributes:           56 beam bathymetry and
-                          amplitude, binary, University
-                          of New Brunswick.
-
-    MBIO Data Format ID:  92
-    Format name:          MBF_ELMK2UNB
-    Informal Description: Elac BottomChart MkII shallow
-                          water multibeam
-    Attributes:           126 beam bathymetry and
-                          amplitude, binary, University
-                          of New Brunswick.
-
-    MBIO Data Format ID:  93
-    Format name:          MBF_BCHRXUNB
-    Informal Description: Elac BottomChart shallow
-                          water multibeam
-    Attributes:           56 beam bathymetry and
-                          amplitude, binary, University
-                          of New Brunswick.
-
-    MBIO Data Format ID:  94
-    Format name:          MBF_L3XSERAW
-    Informal Description: ELAC/SeaBeam XSE vendor format
-    Attributes:           Bottomchart MkII 50 kHz and
-                          180 kHz multibeam, SeaBeam 2120
-                          20 KHz multibeam, bathymetry,
-                          amplitude and sidescan, variable
-                          beams and pixels, binary, L3
-                          Communications (Elac Nautik
-                          and SeaBeam Instruments).
-
-    MBIO Data Format ID:  101
-    Format name:          MBF_HSMDARAW
-    Informal Description: Atlas HSMD medium depth
-                          multibeam raw format
-    Attributes:           40 beam bathymetry, 160 pixel
-                          sidescan, XDR (binary),
-                          STN Atlas Elektronik.
-
-    MBIO Data Format ID:  102
-    Format name:          MBF_HSMDLDIH
-    Informal Description: Atlas HSMD medium depth
-                          multibeam processed format
-    Attributes:           40 beam bathymetry, 160 pixel
-                          sidescan, XDR (binary), L-DEO.
-
-    MBIO Data Format ID:  111
-    Format name:          MBF_DSL120SF
-    Informal Description: WHOI DSL AMS-120 processed format
-    Attributes:           2048 beam bathymetry,
-                          8192 pixel sidescan,
-                          binary, single files, WHOI DSL.
-
-    MBIO Data Format ID:  112
-    Format name:          MBF_DSL120PF
-    Informal Description: WHOI DSL AMS-120 processed
-                          format
-    Attributes:           2048 beam bathymetry,
-                          8192 pixel sidescan,
-                          binary, parallel bathymetry
-                          and amplitude files, WHOI DSL.
-
-    MBIO Data Format ID:  121
-    Format name:          MBF_GSFGENMB
-    Informal Description: SAIC Generic Sensor Format (GSF)
-    Attributes:           variable beams,  bathymetry
-                          and amplitude, binary,
-                          single files, SAIC.
-
-    MBIO Data Format ID:  131
-    Format name:          MBF_MSTIFFSS
-    Informal Description: MSTIFF sidescan format
-    Attributes:           variable pixels,  sidescan,
-                          binary TIFF variant,
-                          single files, Sea Scan.
-
-    MBIO Data Format ID:  132
-    Format name:          MBF_EDGJSTAR
-    Informal Description: Edgetech Jstar format
-    Attributes:           variable pixels, dual frequency
-                          sidescan and subbottom,
-                          binary SEGY variant, single files,
-                          low frequency sidescan returned as
-                          survey data, Edgetech.
-
-    MBIO Data Format ID:  133
-    Format name:          MBF_EDGJSTR2
-    Informal Description: Edgetech Jstar format
-    Attributes:           variable pixels, dual frequency
-                          sidescan and subbottom,
-                          binary SEGY variant, single files,
-                          high frequency sidescan returned as
-                          survey data, Edgetech.
-
-
-    MBIO Data Format ID:  141
-    Format name:          MBF_OICGEODA
-    Informal Description: OIC swath sonar format
-    Attributes:           variable beam bathymetry and
-    			  amplitude, variable pixel
-                          sidescan, binary,
-    			  Oceanic Imaging Consultants
-
-    MBIO Data Format ID:  142
-    Format name:          MBF_OICMBARI
-    Informal Description: OIC-style extended swath
-                          sonar format
-    Attributes:           variable beam bathymetry and
-                          amplitude, variable pixel
-                          sidescan, binary, MBARI
-
-    MBIO Data Format ID:  151
-    Format name:          MBF_OMGHDCSJ
-    Informal Description: UNB OMG HDCS format
-                          (the John Hughes Clarke format)
-    Attributes:           variable beam bathymetry and
-                          amplitude, variable pixel
-                          sidescan, binary, UNB
-
-    MBIO Data Format ID:  160
-    Format name:          MBF_SEGYSEGY
-    Informal Description: SEGY seismic data format
-    Attributes:           seismic or subbottom trace data,
-                          single beam bathymetry, nav,
-                          binary, SEG (SIOSEIS variant)
-
-    MBIO Data Format ID:  161
-    Format name:          MBF_MGD77DAT
-    Informal Description: NGDC MGD77 underway geophysics
-                          format
-    Attributes:           single beam bathymetry, nav,
-                          magnetics, gravity, ascii,
-                          NOAA NGDC
-
-    MBIO Data Format ID:  162
-    Format name:          MBF_ASCIIXYZ
-    Informal Description: Generic XYZ sounding format
-    Attributes:           XYZ (lon lat depth) ASCII
-                          soundings, generic
-
-    MBIO Data Format ID:  163
-    Format name:          MBF_ASCIIYXZ
-    Informal Description: Generic YXZ sounding format
-    Attributes:           YXZ (lat lon depth) ASCII
-                          soundings, generic
-
-    MBIO Data Format ID:  164
-    Format name:         MBF_HYDROB93
-    Informal Description: NGDC binary hydrographic
-                          sounding format
-    Attributes:           XYZ (lon lat depth) binary
-                          soundings
-
-    MBIO Data Format ID:  165
-    Format name:          MBF_MBARIROV
-    Informal Description: MBARI ROV navigation format
-    Attributes:           ROV navigation, MBARI
-
-    MBIO Data Format ID:  166
-    Format name:          MBF_MBPRONAV
-    Informal Description: MB-System simple navigation
-                          format
-    Attributes:           navigation, MBARI
-
-    MBIO Data Format ID:  167
-    Format name:          MBF_MBNETCDF
-    Informal Description: CARAIBES CDF navigation
-    Attributes:           netCDF, IFREMER.
-
-    MBIO Data Format ID:  168
-    Format name:          MBF_ASCIIXYT
-    Informal Description: Generic XYT sounding format
-    Attributes:           XYT (lon lat topography) ASCII
-                          soundings, generic
-
-    MBIO Data Format ID:  169
-    Format name:          MBF_ASCIIYXT
-    Informal Description: Generic YXT sounding format
-    Attributes:           YXT (lat lon topograpy) ASCII
-                          soundings, generic
-
-    MBIO Data Format ID:  170
-    Format name:          MBF_MBARROV2
-    Informal Description: MBARI ROV navigation format
-    Attributes:           ROV navigation, MBARI
-
-    MBIO Data Format ID:  171
-    Format name:          MBF_HS10JAMS
-    Informal Description: Furuno HS-10 multibeam format,
-    Attributes:           45 beams bathymetry and amplitude,
-                          ascii, JAMSTEC
-
-    MBIO Data Format ID:  181
-    Format name:          MBF_SAMESURF
-    Informal Description: SAM Electronics SURF format.
-    Attributes:           variable beams,  bathymetry,
-    			  amplitude,  and sidescan,
-                          binary, single files, SAM Electronics
-			  (formerly Krupp-Atlas Electronik).
-
-    MBIO Data Format ID:  182
-    Format name:          MBF_HSDS2RAW
-    Informal Description: STN Atlas raw multibeam format
-    Attributes:           STN Atlas multibeam sonars,
-    			  Hydrosweep DS2, Hydrosweep MD,
-    			  Fansweep 10, Fansweep 20,
-    			  bathymetry, amplitude, and sidescan,
-    			  up to 1440 beams and 4096 pixels,
-    			  XDR binary, STN Atlas.
-
-    MBIO Data Format ID:  183
-    Format name:          MBF_HSDS2LAM
-    Informal Description: L-DEO HSDS2 processing format
-    Attributes:           STN Atlas multibeam sonars,
-    			  Hydrosweep DS2, Hydrosweep MD,
-    			  Fansweep 10, Fansweep 20,
-    			  bathymetry, amplitude, and sidescan,
-    			  up to 1440 beams and 4096 pixels,
-    			  XDR binary, L-DEO.
-
-    MBIO Data Format ID:  222
-    Format name:          MBF_SWPLSSXP
-    Informal Description: SEA interferometric processed data format
-    Attributes:           Submetrix Interferometers,
-                  SWATHplus-L, SWATHplus-M, SWATHplus-H,
-                  Bathyswath-1, Bathyswath-2,
-                  bathymetry and amplitude, SXP binary.
-
-The institutional acronyms used above have the following meanings:
- 	L-DEO	Lamont-Doherty Earth Observatory
- 	MBARI	Monterey Bay Aquarium Research Institute
- 	SIO	Scripps Institution of Oceanography
- 	WHOI	Woods Hole Oceanographic Institution
- 	URI	University of Rhode Island
- 	NRL	Naval Research Laboratory
- 	UNB	University of New Brunswick
- 	UH	University of Hawaii
- 	NOAA	National Oceans and Atmospheres Agency
- 	NGDC	National Geophysical Data Center
- 	USGS	United States Geological Survey
- 	IFREMER	French government agency responsible
- 		for operation of French oceanographic
- 		research fleet.
-
-.SH FUNCTION STATUS AND ERROR CODES
-All of the \fBMBIO\fP functions return an integer status value with the
-convention that:
- 	status = 1:	success
- 	status = 0:	failure
-.br
-All \fBMBIO\fP functions also pass an error value argument which gives
-somewhat more information about problems than the status value.  The
-full suite of possible error values and the associated error messages are:
-  	error = 0:	"No error",
-  	error = \-1:	"Time gap in data",
-  	error = \-2:	"Data outside specified location
- 			bounds",
-  	error = \-3:	"Data outside specified time interval",
-  	error = \-4:	"Ship speed too small",
-  	error = \-5:	"Comment record",
-  	error = \-6:	"Neither a data record nor a comment
- 			record",
-  	error = \-7:	"Unintelligible data record",
-  	error = \-8:	"Ignore this data",
-  	error = \-9:	"No data requested for buffer load",
-  	error = \-10:	"Data buffer is full",
-  	error = \-11:	"No data was loaded into the buffer",
-  	error = \-12:	"Data buffer is empty",
-  	error = \-13:	"No data was dumped from the buffer"
-  	error = \-14:	"No more survey data records in buffer"
-  	error = \-15:	"Data inconsistencies prevented
- 			inserting data into storage structure"
-  	error = 1:	"Unable to allocate memory,
- 			initialization failed",
-  	error = 2:	"Unable to open file,
- 			initialization failed",
-  	error = 3:	"Illegal format identifier,
- 			initialization failed",
-  	error = 4:	"Read error, probably end-of-file",
-  	error = 5:	"Write error",
-  	error = 6:	"No data in specified location bounds",
-  	error = 7:	"No data in specified time interval",
-  	error = 8:	"Invalid MBIO descriptor",
-  	error = 9:	"Inconsistent usage of MBIO descriptor",
-  	error = 10:	"No pings binned but no fatal error
- 			- this should not happen!",
-  	error = 11:	"Invalid data record type specified
- 			for writing",
-  	error = 12:	"Invalid control parameter specified
- 			by user",
-  	error = 13:	"Invalid buffer id",
-  	error = 14:	"Invalid system id \- this should
- 			not happen!"
-  	error = 15:	"This data file is not in the specified format!"
-.br
-In general, programs should treat negative error values as non-fatal
-(reading and writing can continue) and positive error values as fatal (the data
-files should be closed and the program terminated).
-.br
-.SH FUNCTION VERBOSITY
-All of the \fBMBIO\fP functions are passed a \fIverbose\fP parameter which
-controls how much debugging information is output to standard error.  If
-\fIverbose\fP is 0 or 1, the \fBMBIO\fP functions will be silent.  If
-\fIverbose\fP is 2, then each function will output information as it is
-entered and as it returns, along with the parameter values passed into and
-returned out of the function.  Greater values of \fIverbose\fP will cause
-additional information to be output, including values at various stages
-of data processing during read and write operations.  In general, programs
-using \fBMBIO\fP functions should adopt the following verbosity conventions:
-.br
- 	\fIverbose\fP = 0:	"silent" or near-"silent" execution
- 	\fIverbose\fP = 1:	simple output including
- 				program name, version
- 				and simple progress updates
- 	\fIverbose\fP >= 2:	debug mode with copious output
- 				including every function call
- 				and status listings
-.SH INITIALIZATION AND CLOSING FUNCTIONS
-
-int \fBmb_read_init\fP(
- 		int \fIverbose\fP,
- 		char \fI*file\fP,
- 		int \fIformat\fP,
- 		int \fIpings\fP,
- 		int \fIlonflip\fP,
- 		double \fIbounds[4]\fP,
- 		int \fIbtime_i[7]\fP,
- 		int \fIetime_i[7]\fP,
- 		double \fIspeedmin\fP,
- 		double \fItimegap\fP,
- 		char \fI**mbio_ptr\fP,
- 		double \fI*btime_d\fP,
- 		double \fI*etime_d\fP,
- 		int \fI*beams_bath\fP,
- 		int \fI*beams_amp\fP,
- 		int \fI*pixels_ss\fP,
- 		int \fI*error\fP);
-
-The function \fBmb_read_init\fP initializes the data file to be read
-and the data structures required for reading the data. The \fIverbose\fP
-value controls the standard error output verbosity of the function.
-
-The input control parameters have the following significance:
- 	\fIfile\fP:		input filename
- 	\fIformat\fP:		input \fBMBIO\fP data format id
- 	\fIpings\fP:		ping averaging
- 	\fIlonflip\fP:		longitude flipping
- 	\fIbounds\fP:		location bounds of acceptable data
- 	\fIbtime_i\fP:		beginning time of acceptable data
- 	\fIetime_i\fP:		ending time of acceptable data
- 	\fIspeedmin\fP:		minimum ship speed of acceptable data
- 	\fItimegap\fP:		maximum time allowed before data gap
-
-The format identifier \fIformat\fP specifies which of the supported
-data formats is being read or written; the currently supported formats
-are listed in the "SUPPORTED FORMATS" section.
-
-The \fIpings\fP parameter determines whether and how pings are averaged as part
-of data input.  This parameter is used only by the functions \fBmb_read\fP
-and \fBmb_get\fP; \fBmb_get_all\fP and \fBmb_buffer_load\fP do not average
-pings.  If \fIpings\fP = 1, then no ping averaging will be done and
-each ping read will be returned unaltered by the reading function.  If
-\fIpings\fP > 1, then the navigation and beam data for \fIpings\fP pings
-will be read, averaged, and returned as the data for a single ping.  If
-\fIpings\fP = 0, then the ping averaging will be varied so that the
-along-track distance between averaged pings is as close as possible to the
-across-track distance between beams.
-
-The \fIlonflip\fP paramenter determines the range in which longitude values
-are returned:
- 	\fIlonflip\fP = \-1 : \-360 to   0
- 	\fIlonflip\fP =  0 : \-180 to 180
- 	\fIlonflip\fP =  1 :    0 to 360
-
-The \fIbounds\fP array sets the area within which data are desired.
-Data which lie outside the area specified by \fIbounds\fP will
-be returned with an error by the reading function.
-The functions \fBmb_read\fP,
-\fBmb_get\fP and \fBmb_get_all\fP use the \fIbounds\fP array; the
-function \fBmb_buffer_load\fP does no location checking.
- 	\fIbounds\fP[0] : minimum longitude
- 	\fIbounds\fP[1] : maximum longitude
- 	\fIbounds\fP[2] : minimum latitude
- 	\fIbounds\fP[3] : maximum latitude
-
-The \fIbtime_i\fP array sets the desired beginning time for the data
-and the \fIetime_i\fP array sets the desired ending time.
-If the beginning time is earlier than the ending time, then any
-data with a time stamp before the beginning time or
-after the ending time will be returned with an
-MB_ERROR_OUT_TIME error by the reading function.
-If the beginning time is after the ending time, then
-data with time stamps between the ending and beginning
-time are returned with an error. This scheme allows time
-windowing outside or inside a specified interval.
-The functions \fBmb_read\fP,
-\fBmb_get\fP and \fBmb_get_all\fP use the
-\fIbtime_i\fP and \fIbtime_i\fP arrays; the
-function \fBmb_buffer_load\fP does no time checking.
- 	\fIbtime\fP[0] : year
- 	\fIbtime\fP[1] : month
- 	\fIbtime\fP[2] : day
- 	\fIbtime\fP[3] : hour
- 	\fIbtime\fP[4] : minute
- 	\fIbtime\fP[5] : second
- 	\fIbtime\fP[6] : microsecond
- 	\fIetime\fP[0] : year
- 	\fIetime\fP[1] : month
- 	\fIetime\fP[2] : day
- 	\fIetime\fP[3] : hour
- 	\fIetime\fP[4] : minute
- 	\fIetime\fP[5] : second
- 	\fIetime\fP[6] : microsecond
-
-The \fIspeedmin\fP parameter sets the minimum acceptable ship speed for
-the data.  If the ship speed associated with any ping is less than
-\fIspeedmin\fP, then that data will be returned with an error
-by the reading function.
-This is used to eliminate data collected while a ship is on station is
-a simple way. The functions \fBmb_read\fP,
-\fBmb_get\fP and \fBmb_get_all\fP use the \fIspeedmin\fP value; the
-function \fBmb_buffer_load\fP does no speed checking.
-
-The \fItimegap\fP parameter sets the minimum time gap allowed before a
-gap in the data is declared.  Ping averaging is not done across
-data gaps; an error is returned when time gaps are encountered.
-The functions \fBmb_read\fP and
-\fBmb_get\fP use the \fItimegap\fP value; the
-functions \fBmb_get_all\fP and \fBmb_buffer_load\fP do no ping averaging
-and thus have no need to check for time gaps.
-
-The returned values are:
- 	\fImbio_ptr\fP:	pointer to an \fBMBIO\fP descriptor structure
- 	\fIbtime_d\fP:		desired beginning time in seconds
- 					since 1/1/70 00:00:0
- 	\fIetime_d\fP:		desired ending time in seconds
- 					since 1/1/70 00:00:0
- 	\fIbeams_bath\fP:	maximum number of bathymetry beams
- 	\fIbeams_amp\fP:	maximum number of amplitude beams
- 	\fIpixels_ss\fP:	maximum number of sidescan pixels
- 	\fIerror\fP:		error value
-.br
-The structure pointed to by
-\fImbio_ptr\fP holds the file descriptor and all of the control parameters
-which govern how the data is read; this pointer must be provided to
-the functions \fBmb_read\fP, \fBmb_get\fP, \fBmb_get_all\fP,
-or \fBmb_buffer_load\fP to read data. The values \fIbeams_bath\fP,
-\fIbeams_amp\fP, and \fIpixels_ss\fP return initial estimates of the maximum number
-of bathymetry and amplitude beams and sidescan pixels, respectively,
-that the specified data format may contain. In general, \fIbeams_amp\fP
-will either be zero or equal to \fIbeams_bath\fP. The values \fIbtime_d\fP
-and \fIetime_d\fP give the desired beginning and end times of the data
-converted to seconds since 00:00:00 on January 1, 1970;
-\fBMBIO\fP uses these units to calculate time internally.
-
-For most data formats, the initial maximum beam and pixel dimensions will not change.
-However, a few formats support both variable and arbitrarily large numbers
-of beams and/or pixels, and so applications must be capable of handling
-dynamic changes in the numbers of beams and pixels. The arrays allocated
-internally in the \fImbio_ptr\fP structure are automatically increased
-when necessary. However, in order to successfully extract
-swath data using \fImb_get\fP, \fImb_get_all\fP, \fImb_read\fP, or
-\fImb_extract\fP, an application must also
-provide pointers to arrays large enough to hold the current maximum numbers
-of bathymetry beams, amplitude beams, and sidescan pixels. The function
-\fImb_register_ioarray\fP allows applications to register array pointers
-so that these arrays are also dynamically allocated by \fIMBIO\fP. Registered
-arrays will be managed as data are read and then freed when \fBmb_close\fP
-is called.
-
-A status value indicating success or failure is returned; an error value
-argument passes more detailed information about initialization failures.
-
-\---------------------------------------------------------
-.br
-int \fBmb_write_init\fP(
- 		int \fIverbose\fP,
- 		char \fI*file\fP,
- 		int \fIformat\fP,
- 		char \fI**mbio_ptr\fP,
- 		int \fI*beams_bath\fP,
- 		int \fI*beams_amp\fP,
- 		int \fI*pixels_ss\fP,
- 		int \fI*error\fP);
-
-The function \fBmb_write_init\fP initializes the data file to be written
-and the data structures required for writing the data. The \fIverbose\fP
-value controls the standard error output verbosity of the function.
-
-The input control parameters have the following significance:
- 	\fIfile\fP:		output filename
- 	\fIformat\fP:		output \fBMBIO\fP data format id
-
-The returned values are:
- 	\fImbio_ptr\fP:	pointer to a structure describing
- 					the output file
- 	\fIbeams_bath\fP:	maximum number of bathymetry beams
- 	\fIbeams_back\fP:	maximum number of backscatter beams
- 	\fIerror\fP:		error value
-
-The structure pointed to by
-\fImbio_ptr\fP holds the output file descriptor; this pointer must be
-provided to
-the functions \fBmb_write\fP, \fBmb_put\fP, \fBmb_put_all\fP,
-or \fBmb_buffer_dump\fP to write data. The values \fIbeams_bath\fP,
-\fIbeams_amp\fP, and \fIpixels_ss\fP return the maximum number
-of bathymetry and amplitude beams and sidescan pixels, respectively,
-that the specified data format may contain.  In general, \fIbeams_amp\fP
-will either be zero or equal to \fIbeams_bath\fP.  In order to successfully
-write data, the calling program must
-provide pointers to arrays large enough to hold \fIbeams_bath\fP bathymetry
-values, \fIbeams_amp\fP amplitude values, and \fIpixels_ss\fP sidescan
-values.
-
-For most data formats, the initial maximum beam and pixel dimensions will not change.
-However, a few formats support both variable and arbitrarily large numbers
-of beams and/or pixels, and so applications must be capable of handling
-dynamic changes in the numbers of beams and pixels. The arrays allocated
-internally in the \fImbio_ptr\fP structure are automatically increased
-when necessary. However, in order to successfully insert modified
-swath data using \fImb_put\fP, \fImb_put_all\fP, or
-\fImb_insert\fP, an application must also
-provide pointers to arrays large enough to hold the current maximum numbers
-of bathymetry beams, amplitude beams, and sidescan pixels. The function
-\fImb_register_ioarray\fP allows applications to register array pointers
-so that these arrays are also dynamically allocated by \fIMBIO\fP. Registered
-arrays will be managed as data are read and written and then freed when \fBmb_close\fP
-is called.
-
-A status value indicating success or failure is returned; an error value
-argument passes more detailed information about initialization failures.
-
-\---------------------------------------------------------
-.br
-int \fBmb_register_array\fP(
- 		int \fIverbose\fP,
- 		void *\fImbio_ptr\fP,
- 		int \fItype\fP,
- 		int \fIsize\fP,
- 		void **\fIhandle\fP,
- 		int \fI*error\fP)
-
-Registers an array pointer *\fIhandle\fP so that the size of
-the allocated array can be managed dynamically by \fBMBIO\fP.
-Note that the location \fI**\fIhandle\fP of the array
-pointer must be supplied, not the pointer value *\fIhandle\fP.
-The pointer value *\fIhandle\fP should initially be NULL.
-The \fItype\fP value indicates whether this
-array is to be dimensioned according to the maximum number of
-bathymetry beams (\fItype\fP = 1), amplitude beams (\fItype\fP = 2),
-or sidescan pixels (\fItype\fP = 3). The \fIsize\fP
-value indicates the size of each element array in bytes (e.g. a char
-array has \fIsize\fP = 1, a short array has \fIsize\fP = 2, an
-int array or a float array have \fIsize\fP = 4, and a double array
-has \fIsize\fP = 8). The array is associated with the \fBMBIO\fP
-descriptor \fImbio_ptr\fP, and is freed when \fImb_close\fP is
-called for this particular \fImbio_ptr\fP.
-
-\---------------------------------------------------------
-.br
-int \fBmb_close\fP(
- 		int \fIverbose\fP,
- 		char *\fImbio_ptr\fP,
- 		int \fI*error\fP)
-
-Closes the data file listed in the \fBMBIO\fP descriptor pointed to
-by \fImbio_ptr\fP and releases all specially allocated memory,
-including all application arrays registered using \fBmb_register_array\fP..
-The \fIverbose\fP value controls the standard error output verbosity
-of the function. A status value indicating success or failure is
-returned; an error value argument passes more detailed information
-about failures.
-.SH LEVEL 1 FUNCTIONS
-
-\---------------------------------------------------------
-.br
-int \fBmb_read\fP(
- 		int \fIverbose\fP,
- 		char \fI*mbio_ptr\fP,
- 		int \fI*kind\fP,
- 		int \fI*pings\fP,
- 		int \fItime_i[7]\fP,
- 		double \fI*time_d\fP,
- 		double \fI*navlon\fP,
- 		double \fI*navlat\fP,
- 		double \fI*speed\fP,
-  		double \fI*heading\fP,
- 		double \fI*distance\fP,
- 		double \fI*altitude\fP,
- 		double \fI*sonardepth\fP,
- 		int \fI*nbath\fP,
- 		int \fI*namp\fP,
- 		int \fI*nss\fP,
- 		char \fI*beamflag\fP,
- 		double \fI*bath\fP,
- 		double \fI*amp\fP,
- 		double \fI*bathlon\fP,
- 		double \fI*bathlat\fP,
- 		double \fI*ss\fP,
- 		double \fI*sslon\fP,
- 		double \fI*sslat\fP,
- 		char \fI*comment\fP,
- 		int \fI*error\fP);
-
-The function \fBmb_read\fP reads, processes, and returns sonar
-data according to the \fBMBIO\fP descriptor pointed to by \fImbio_ptr\fP.
-The \fIverbose\fP
-value controls the standard error output verbosity of the function. A number
-of different data record types are recognized by \fBMB-System\fP, but
-\fBmb_read()\fP only returns survey and comment data records. The
-\fIkind\fP value indicates which type of record has been read.
-The data is in the form of bathymetry, amplitude, and sidescan values combined
-with the longitude and latitude locations of the bathymetry and
-sidescan measurements (amplitudes are coincident with the bathymetry).
-
-The return values are:
- 	\fIkind\fP:		kind of data record read
- 					1	survey data
- 					2	comment
- 					>=3	other data that cannot
- 						be passed by \fBmb_read\fP
- 	\fIpings\fP:		number of pings averaged to give current data
- 	\fItime_i\fP:		time of current ping
- 			\fItime_i\fP[0]: year
- 			\fItime_i\fP[1]: month
- 			\fItime_i\fP[2]: day
- 			\fItime_i\fP[3]: hour
- 			\fItime_i\fP[4]: minute
- 			\fItime_i\fP[5]: second
- 			\fItime_i\fP[6]: microsecond
- 	\fItime_d\fP:		time of current ping in seconds
- 			since 1/1/70 00:00:00
- 	\fInavlon\fP:		longitude
- 	\fInavlat\fP:		latitude
- 	\fIspeed\fP:		ship speed in km/s
- 	\fIheading\fP:		ship heading in degrees
- 	\fIdistance\fP:		distance along shiptrack since last
- 			ping in km
- 	\fIaltitude\fP:		altitude of sonar above seafloor
- 			in m
- 	\fIsonardepth\fP:	depth of sonar in m
- 	\fInbath\fP:		number of bathymetry values
- 	\fInamp\fP:		number of amplitude values
- 	\fInss\fP:		number of sidescan values
- 	\fIbeamflag\fP:		array of bathymetry flags
- 	\fIbath\fP:		array of bathymetry values in meters
- 	\fIamp\fP:		array of amplitude values in unknown units
- 	\fIbathlon\fP:		array of of longitude values corresponding
- 			to bathymetry
- 	\fIbathlat\fP:		array of of latitude values corresponding
- 			to bathymetry
- 	\fIss\fP:		array of sidescan values in unknown units
- 	\fIsslon\fP:		array of of longitude values corresponding
- 			to sidescan
- 	\fIsslat\fP:		array of of latitude values corresponding
- 			to sidescan
- 	\fIcomment\fP:	comment string
- 	\fIerror\fP:		error value
-
-A status value indicating success or failure is returned; the error value
-argument \fIerror\fP passes more detailed information about
-read failures.
-
-\---------------------------------------------------------
-.br
-int \fBmb_get\fP(
- 		int \fIverbose\fP,
- 		char \fI*mbio_ptr\fP,
- 		int \fI*kind\fP,
- 		int \fI*pings\fP,
- 		int \fItime_i[7]\fP,
- 		double \fI*time_d\fP,
- 		double \fI*navlon\fP,
- 		double \fI*navlat\fP,
- 		double \fI*speed\fP,
- 		double \fI*heading\fP,
- 		double \fI*distance\fP,
- 		double \fI*altitude\fP,
- 		double \fI*sonardepth\fP,
- 		int \fI*nbath\fP,
- 		int \fI*namp\fP,
- 		int \fI*nss\fP,
- 		char \fI*beamflag\fP,
- 		double \fI*bath\fP,
- 		double \fI*amp\fP,
- 		double \fI*bathacrosstrack\fP,
- 		double \fI*bathalongtrack\fP,
- 		double \fI*ss\fP,
- 		double \fI*ssacrosstrack\fP,
- 		double \fI*ssalongtrack\fP,
- 		char \fI*comment\fP,
- 		int \fI*error\fP);
-
-The function \fBmb_get\fP reads, processes, and returns sonar
-data according to the \fBMBIO\fP descriptor pointed to by \fImbio_ptr\fP.
-The \fIverbose\fP
-value controls the standard error output verbosity of the function. A number
-of different data record types are recognized by \fBMB-System\fP, but
-\fBmb_get()\fP only returns survey and comment data records. The
-\fIkind\fP value indicates which type of record has been read.
-The data is in the form of bathymetry, amplitude, and sidescan values combined
-with the acrosstrack and alongtrack distances relative to the navigation
-of the bathymetry and sidescan
-measurements (amplitudes are coincident with the bathymetry values).
-
-The return values are:
- 	\fIkind\fP:		kind of data record read
- 					1	survey data
- 					2	comment
- 					>=3	other data that cannot
- 						be passed by \fBmb_get\fP
- 	\fIpings\fP:		number of pings averaged to give current data
- 	\fItime_i\fP:		time of current ping
- 			\fItime_i\fP[0]: year
- 			\fItime_i\fP[1]: month
- 			\fItime_i\fP[2]: day
- 			\fItime_i\fP[3]: hour
- 			\fItime_i\fP[4]: minute
- 			\fItime_i\fP[5]: second
- 			\fItime_i\fP[6]: microsecond
- 	\fItime_d\fP:		time of current ping in seconds
- 			since 1/1/70 00:00:00
- 	\fInavlon\fP:		longitude
- 	\fInavlat\fP:		latitude
- 	\fIspeed\fP:		ship speed in km/s
- 	\fIheading\fP:		ship heading in degrees
- 	\fIdistance\fP:	distance along shiptrack since last
- 			ping in km
- 	\fIaltitude\fP:		altitude of sonar above seafloor
- 			in m
- 	\fIsonardepth\fP:	depth of sonar in m
- 	\fInbath\fP:		number of bathymetry values
- 	\fInamp\fP:		number of amplitude values
- 	\fInss\fP:		number of sidescan values
- 	\fIbeamflag\fP:		array of bathymetry flags
- 	\fIbath\fP:		array of bathymetry values in meters
- 	\fIamp\fP:		array of amplitude values in unknown units
- 	\fIbathacrosstrack\fP:	array of of acrosstrack distances
- 			in meters corresponding to bathymetry
- 	\fIbathalongtrack\fP:	array of of alongtrack distances
- 			in meters corresponding to bathymetry
- 	\fIss\fP:		array of sidescan values in unknown units
- 	\fIssacrosstrack\fP:	array of of acrosstrack distances
- 			in meters corresponding to sidescan
- 	\fIssacrosstrack\fP:	array of of alongtrack distances
- 			in meters corresponding to sidescan
- 	\fIcomment\fP:		comment string
- 	\fIerror\fP:		error value
-
-A status value indicating success or failure is returned; the error value
-argument \fIerror\fP passes more detailed information about
-read failures.
-
-.SH LEVEL 2 FUNCTIONS
-
-int \fBmb_read_ping\fP(
- 		int \fIverbose\fP,
- 		char \fI*mbio_ptr\fP,
- 		char \fI*store_ptr\fP,
- 		int \fI*kind\fP,
- 		int \fI*error\fP);
-
-The function \fBmb_read_ping\fP reads and returns sonar
-data according to the \fBMBIO\fP descriptor pointed to by \fImbio_ptr\fP.
-The \fIverbose\fP
-value controls the standard error output verbosity of the function.
-The data is returned one record at a time; no averaging is performed.
-A pointer to a data structure containing all of the data read is returned
-as \fIstore_ptr\fP; the form of the data structure is determined by the
-sonar system associated with the format of the data being read. A number
-of different data record types are recognized by \fBMB-System\fP; the
-\fIkind\fP value indicates which type of record has been read.
-
-The return values are:
- 	\fIstore_ptr\fP:	pointer to complete data structure
- 	\fIkind\fP:		kind of data record read
- 					1	survey data
- 					2	comment
- 					3	header
- 					4	calibrate
- 					5	mean sound speed
- 					6	SVP
- 					7	standby
- 					8	nav source
- 					9	parameter
- 					10	start
- 					11	stop
- 					12	nav
- 					13	run parameter
- 					14	clock
- 					15	tide
- 					16	height
- 					17	heading
- 					18	attitude
- 					19	ssv
- 					20	angle
- 					21	event
- 					22	history
- 					23	summary
- 					24	processing parameters
- 					25	sensor parameters
- 					26	navigation error
- 					27	uninterpretable line
- 	\fIerror\fP:		error value
-
-A status value indicating success or failure is returned; the error value
-argument \fIerror\fP passes more detailed information about
-read failures.
-
-\---------------------------------------------------------
-.br
-int \fBmb_write_ping\fP(
- 		int \fIverbose\fP,
- 		char \fI*mbio_ptr\fP,
- 		char \fI*store_ptr\fP,
- 		int \fI*error\fP);
-
-The function \fBmb_write_ping\fP writes sonar data to the file listed
-in the \fBMBIO\fP descriptor pointed to by \fIMBIO_ptr\fP.
-The \fIverbose\fP
-value controls the standard error output verbosity of the function.
-A pointer to a data structure containing all of the data read is passed
-as \fIstore_ptr\fP; the form of the data structure is determined by the
-sonar system associated with the format of the data being written.
-The values to be output are:
- 	\fIstore_ptr\fP:	pointer to complete data structure
-
-The return values are:
- 	\fIerror\fP:		error value
-
-A status value indicating success or failure is returned; the error value
-argument \fIerror\fP passes more detailed information about
-write failures.
-
-\---------------------------------------------------------
-.br
-int \fBmb_get_store\fP(
- 		int \fIverbose\fP,
- 		char \fI*mbio_ptr\fP,
- 		char \fI**store_ptr\fP,
- 		int \fI*error\fP);
-
-The function \fBmb_get_store()\fP returns a pointer \fI*store_ptr\fP
-to the data storage structure associated with a particular \fBMBIO\fP
-descriptor \fImbio_ptr\fP. The \fBmb_read_init()\fP and
-\fBmb_write_init()\fP functions
-both allocate one of these internal storage structures. The
-form of the data structure is determined by the
-sonar system associated with the format of the data being written.
-Storage structure pointers must be passed to level two \fBMBIO\fP
-functions such as \fBmb_write_ping()\fP and \fBmb_insert()\fP.
-The \fIverbose\fP value controls the standard error
-output verbosity of the function.
-
-The return values are:
- 	\fIstore_ptr\fP:	pointer to complete data structure
- 	\fIerror\fP:		error value
-
-A status value indicating success or failure is returned; the error value
-argument \fIerror\fP passes more detailed information about failures.
-
-\---------------------------------------------------------
-.br
-int \fBmb_get_all\fP(
- 		int \fIverbose\fP,
- 		char \fI*mbio_ptr\fP,
- 		char \fI**store_ptr\fP,
- 		int \fI*kind\fP,
- 		int \fItime_i[7]\fP,
- 		double \fI*time_d\fP,
- 		double \fI*navlon\fP,
- 		double \fI*navlat\fP,
- 		double \fI*speed\fP,
- 		double \fI*heading\fP,
- 		double \fI*distance\fP,
- 		double \fI*altitude\fP,
- 		double \fI*sonardepth\fP,
- 		int \fI*nbath\fP,
- 		int \fI*namp\fP,
- 		int \fI*nss\fP,
- 		char \fI*beamflag\fP,
- 		double \fI*bath\fP,
- 		double \fI*amp\fP,
- 		double \fI*bathacrosstrack\fP,
- 		double \fI*bathalongtrack\fP,
- 		double \fI*ss\fP,
- 		double \fI*ssacrosstrack\fP,
- 		double \fI*ssalongtrack\fP,
- 		char \fI*comment\fP,
- 		int \fI*error\fP);
-
-The function \fBmb_get_all\fP reads and returns sonar
-data according to the \fBMBIO\fP descriptor pointed to by \fImbio_ptr\fP.
-The \fIverbose\fP
-value controls the standard error output verbosity of the function.
-The data is returned one record at a time; no averaging is performed.
-A pointer to a data structure containing all of the data read is returned
-as \fIstore_ptr\fP; the form of the data structure is determined by the
-sonar system associated with the format of the data being read. A number
-of different data record types are recognized by \fBMB-System\fP; the
-\fIkind\fP value indicates which type of record has been read. Additional
-data is returned if the data record is survey data (navigation,
-bathymetry, amplitude, and sidescan), navigation data (navigation only), or
-comment data (comment only).
-
-The return values are:
- 	\fIstore_ptr\fP:	pointer to complete data structure
- 	\fIkind\fP:		kind of data record read
- 					1	survey data
- 					2	comment
- 					3	header
- 					4	calibrate
- 					5	mean sound speed
- 					6	SVP
- 					7	standby
- 					8	nav source
- 					9	parameter
- 					10	start
- 					11	stop
- 					12	nav
- 					13	run parameter
- 					14	clock
- 					15	tide
- 					16	height
- 					17	heading
- 					18	attitude
- 					19	ssv
- 					20	angle
- 					21	event
- 					22	history
- 					23	summary
- 					24	processing parameters
- 					25	sensor parameters
- 					26	navigation error
- 					27	uninterpretable line
- 	\fItime_i\fP:		time of current ping
- 			\fItime_i\fP[0]: year
- 			\fItime_i\fP[1]: month
- 			\fItime_i\fP[2]: day
- 			\fItime_i\fP[3]: hour
- 			\fItime_i\fP[4]: minute
- 			\fItime_i\fP[5]: second
- 			\fItime_i\fP[6]: microsecond
- 	\fItime_d\fP:		time of current ping in seconds
- 			since 1/1/70 00:00:00
- 	\fInavlon\fP:		longitude
- 	\fInavlat\fP:		latitude
- 	\fIspeed\fP:		ship speed in km/s
- 	\fIheading\fP:		ship heading in degrees
- 	\fIdistance\fP:	distance along shiptrack since last
- 			ping in km
- 	\fIaltitude\fP:		altitude of sonar above seafloor
- 			in m
- 	\fIsonardepth\fP:	depth of sonar in m
- 	\fInbath\fP:		number of bathymetry values
- 	\fInamp\fP:		number of amplitude values
- 	\fInss\fP:		number of sidescan values
- 	\fIbeamflag\fP:		array of bathymetry flags
- 	\fIbath\fP:		array of bathymetry values in meters
- 	\fIamp\fP:		array of amplitude values in unknown units
- 	\fIbathacrosstrack\fP:	array of of acrosstrack distances
- 			in meters corresponding to bathymetry
- 	\fIbathalongtrack\fP:	array of of alongtrack distances
- 			in meters corresponding to bathymetry
- 	\fIss\fP:		array of sidescan values in unknown units
- 	\fIssacrosstrack\fP:	array of of acrosstrack distances
- 			in meters corresponding to sidescan
- 	\fIssacrosstrack\fP:	array of of alongtrack distances
- 			in meters corresponding to sidescan
- 	\fIcomment\fP:	comment string
- 	\fIerror\fP:		error value
-
-A status value indicating success or failure is returned; the error value
-argument \fIerror\fP passes more detailed information about
-read failures.
-
-\---------------------------------------------------------
-.br
-int \fBmb_put_all\fP(
- 		int \fIverbose\fP,
- 		char \fI*mbio_ptr\fP,
- 		char \fI*store_ptr\fP,
- 		int \fIusevalues\fP,
- 		int \fIkind\fP,
- 		int \fItime_i[7]\fP,
- 		double \fItime_d\fP,
- 		double \fInavlon\fP,
- 		double \fInavlat\fP,
- 		double \fIspeed\fP,
- 		double \fIheading\fP,
- 		int \fInbath\fP,
- 		int \fInamp\fP,
- 		int \fInss\fP,
- 		char \fI*beamflag\fP,
- 		double \fI*bath\fP,
- 		double \fI*amp\fP,
- 		double \fI*bathacrosstrack\fP,
- 		double \fI*bathalongtrack\fP,
- 		double \fI*ss\fP,
- 		double \fI*ssacrosstrack\fP,
- 		double \fI*ssalongtrack\fP,
- 		char \fI*comment\fP,
- 		int \fI*error\fP);
-
-The function \fBmb_put_all\fP writes sonar data to the file listed
-in the \fBMBIO\fP descriptor pointed to by \fIMBIO_ptr\fP.
-The \fIverbose\fP
-value controls the standard error output verbosity of the function.
-A pointer to a data structure containing all of the data read is passed
-as \fIstore_ptr\fP; the form of the data structure is determined by the
-sonar system associated with the format of the data being written.
-Additional data is passed if the data record is survey data (navigation,
-bathymetry, amplitude, and sidescan), navigation data (navigation only), or
-comment data (comment only).
-If the \fIusevalues\fP flag is set to 1,
-then the passed values will be inserted in the data structure
-pointed to by \fIstore_ptr\fP before
-the data is written.  If the \fIusevalues\fP flag is set to 0, the data
-structure pointed to by \fIstore_ptr\fP will be written without modification.
-The values to be output are:
- 	\fIstore_ptr\fP:	pointer to complete data structure
- 	\fIusevalues\fP:	flag controlling use of data passed by value
- 					0	do not insert into data
- 						structure before writing
- 						the data
- 					1	insert into data structure
- 						before writing the data
- 	\fIkind\fP:		kind of data record to be written
- 					1	survey data
- 					2	comment
- 					3	header
- 					4	calibrate
- 					5	mean sound speed
- 					6	SVP
- 					7	standby
- 					8	nav source
- 					9	parameter
- 					10	start
- 					11	stop
- 					12	nav
- 					13	run parameter
- 					14	clock
- 					15	tide
- 					16	height
- 					17	heading
- 					18	attitude
- 					19	ssv
- 					20	angle
- 					21	event
- 					22	history
- 					23	summary
- 					24	processing parameters
- 					25	sensor parameters
- 					26	navigation error
- 					27	uninterpretable line
- 	\fItime_i\fP:		time of current ping (used if \fItime_i\fP[0] != 0)
- 			\fItime_i\fP[0]: year
- 			\fItime_i\fP[1]: month
- 			\fItime_i\fP[2]: day
- 			\fItime_i\fP[3]: hour
- 			\fItime_i\fP[4]: minute
- 			\fItime_i\fP[5]: second
- 			\fItime_i\fP[6]: microsecond
- 	\fItime_d\fP:		time of current ping in seconds since
- 				1/1/70 00:00:00 (used if \fItime_i\fP[0] = 0)
- 	\fInavlon\fP:		longitude
- 	\fInavlat\fP:		latitude
- 	\fIspeed\fP:		ship speed in km/s
- 	\fIheading\fP:		ship heading in degrees
- 	\fInbath\fP:		number of bathymetry values
- 	\fInamp\fP:		number of amplitude values
- 	\fInss\fP:		number of sidescan values
- 	\fIbeamflag\fP:		array of bathymetry flags
- 	\fIbath\fP:		array of bathymetry values in meters
- 	\fIamp\fP:		array of amplitude values in unknown units
- 	\fIbathacrosstrack\fP:	array of of acrosstrack distances
- 			in meters corresponding to bathymetry
- 	\fIbathalongtrack\fP:	array of of alongtrack distances
- 			in meters corresponding to bathymetry
- 	\fIss\fP:		array of sidescan values in unknown units
- 	\fIssacrosstrack\fP:	array of of acrosstrack distances
- 			in meters corresponding to sidescan
- 	\fIssacrosstrack\fP:	array of of alongtrack distances
- 			in meters corresponding to sidescan
- 	\fIcomment\fP:	comment string
-
-The return values are:
- 	\fIerror\fP:		error value
-
-A status value indicating success or failure is returned; the error value
-argument \fIerror\fP passes more detailed information about
-write failures.
-
-\---------------------------------------------------------
-.br
-int \fBmb_put_comment\fP(
- 		int \fIverbose\fP,
- 		char \fI*mbio_ptr\fP,
- 		char \fI*comment\fP,
- 		int \fI*error\fP);
-
-The function \fBmb_put_comment\fP writes a comment to the file listed
-in the \fBMBIO\fP descriptor pointed to by \fIMBIO_ptr\fP.
-The \fIverbose\fP
-value controls the standard error output verbosity of the function.
-The data is in the form of a null terminated string. The maximum
-length of comments varies with different data formats. In
-general individual comments should be less than 80 characters
-long to insure compatibility with all formats.
-The values to be output are:
- 	\fIcomment\fP:		comment string
-
-The return values are:
- 	\fIerror\fP:		error value
-
-A status value indicating success or failure is returned; the error value
-argument \fIerror\fP passes more detailed information about
-write failures.
-
-\---------------------------------------------------------
-.br
-int \fBmb_extract\fP(
- 		int \fIverbose\fP,
- 		char \fI*mbio_ptr\fP,
- 		char \fI*store_ptr\fP,
- 		int \fI*kind\fP,
- 		int \fItime_i[7]\fP,
- 		double \fI*time_d\fP,
- 		double \fI*navlon\fP,
- 		double \fI*navlat\fP,
- 		double \fI*speed\fP,
- 		double \fI*heading\fP,
- 		int \fI*nbath\fP,
- 		int \fI*namp\fP,
- 		int \fI*nss\fP,
- 		char \fI*beamflag\fP,
- 		double \fI*bath\fP,
- 		double \fI*amp\fP,
- 		double \fI*bathacrosstrack\fP,
- 		double \fI*bathalongtrack\fP,
- 		double \fI*ss\fP,
- 		double \fI*ssacrosstrack\fP,
- 		double \fI*ssalongtrack\fP,
- 		char \fI*comment\fP,
- 		int \fI*error\fP);
-
-The function \fBmb_extract\fP extracts sonar data from the
-structure pointed to by \fI*store_ptr\fP according to the
-\fBMBIO\fP descriptor pointed to by \fImbio_ptr\fP.
-The \fIverbose\fP value controls the standard
-error output verbosity of the function.
-The form of the data structure is determined by the
-sonar system associated with the format of the data being read. A number
-of different data record types are recognized by \fBMB-System\fP; the
-\fIkind\fP value indicates which type of record is stored in \fI*store_ptr\fP.
-Additional
-data is returned if the data record is survey data (navigation,
-bathymetry, amplitude, and sidescan), navigation data (navigation only), or
-comment data (comment only).
-
-The return values are:
- 	\fIkind\fP:		kind of data record read
- 					1	survey data
- 					2	comment
- 					12	navigation
- 	\fItime_i\fP:		time of current ping
- 			\fItime_i\fP[0]: year
- 			\fItime_i\fP[1]: month
- 			\fItime_i\fP[2]: day
- 			\fItime_i\fP[3]: hour
- 			\fItime_i\fP[4]: minute
- 			\fItime_i\fP[5]: second
- 			\fItime_i\fP[6]: microsecond
- 	\fItime_d\fP:		time of current ping in seconds
- 			since 1/1/70 00:00:00
- 	\fInavlon\fP:		longitude
- 	\fInavlat\fP:		latitude
- 	\fIspeed\fP:		ship speed in km/s
- 	\fIheading\fP:		ship heading in degrees
- 	\fIdistance\fP:		distance along shiptrack since last
- 			ping in km
- 	\fIaltitude\fP:		altitude of sonar above seafloor
- 			in m
- 	\fIsonardepth\fP:	depth of sonar in m
- 	\fInbath\fP:		number of bathymetry values
- 	\fInamp\fP:		number of amplitude values
- 	\fInss\fP:		number of sidescan values
- 	\fIbeamflag\fP:		array of bathymetry flags
- 	\fIbath\fP:		array of bathymetry values in meters
- 	\fIamp\fP:		array of amplitude values in unknown units
- 	\fIbathacrosstrack\fP:	array of of acrosstrack distances
- 			in meters corresponding to bathymetry
- 	\fIbathalongtrack\fP:	array of of alongtrack distances
- 			in meters corresponding to bathymetry
- 	\fIss\fP:		array of sidescan values in unknown units
- 	\fIssacrosstrack\fP:	array of of acrosstrack distances
- 			in meters corresponding to sidescan
- 	\fIssacrosstrack\fP:	array of of alongtrack distances
- 			in meters corresponding to sidescan
- 	\fIcomment\fP:	comment string
- 	\fIerror\fP:		error value
-
-A status value indicating success or failure is returned; the error value
-argument \fIerror\fP passes more detailed information about
-extract failures.
-
-\---------------------------------------------------------
-.br
-int \fBmb_insert\fP(
- 		int \fIverbose\fP,
- 		char \fI*mbio_ptr\fP,
- 		char \fI*store_ptr\fP,
- 		int \fIkind\fP,
- 		int \fItime_i[7]\fP,
- 		double \fItime_d\fP,
- 		double \fInavlon\fP,
- 		double \fInavlat\fP,
- 		double \fIspeed\fP,
- 		double \fIheading\fP,
- 		int \fInbath\fP,
- 		int \fInamp\fP,
- 		int \fInss\fP,
- 		char \fI*beamflag\fP,
- 		double \fI*bath\fP,
- 		double \fI*amp\fP,
- 		double \fI*bathacrosstrack\fP,
- 		double \fI*bathalongtrack\fP,
- 		double \fI*ss\fP,
- 		double \fI*ssacrosstrack\fP,
- 		double \fI*ssalongtrack\fP,
- 		char \fI*comment\fP,
- 		int \fI*error\fP);
-
-The function \fBmb_insert\fP inserts sonar data into the
-structure pointed to by \fI*store_ptr\fP according to the
-\fBMBIO\fP descriptor pointed to by \fImbio_ptr\fP.
-The \fIverbose\fP value controls the standard
-error output verbosity of the function.
-The form of the data structure is determined by the
-sonar system associated with the format of the data being read. A number
-of different data record types are recognized by \fBMB-System\fP; the
-\fIkind\fP value indicates which type of
-record is to be stored in \fI*store_ptr\fP.
-Data will be inserted only if the data record is survey data (navigation,
-bathymetry, amplitude, and sidescan), navigation data (navigation only), or
-comment data (comment only).
-The values to be inserted are:
- 	\fIkind\fP:		kind of data record inserted
- 					1	survey data
- 					2	comment
- 					12	navigation
- 	\fItime_i\fP:		time of current ping
- 			\fItime_i\fP[0]: year
- 			\fItime_i\fP[1]: month
- 			\fItime_i\fP[2]: day
- 			\fItime_i\fP[3]: hour
- 			\fItime_i\fP[4]: minute
- 			\fItime_i\fP[5]: second
- 			\fItime_i\fP[6]: microsecond
- 	\fItime_d\fP:		time of current ping in seconds
- 			since 1/1/70 00:00:00
- 	\fInavlon\fP:		longitude
- 	\fInavlat\fP:		latitude
- 	\fIspeed\fP:		ship speed in km/s
- 	\fIheading\fP:		ship heading in degrees
- 	\fIdistance\fP:		distance along shiptrack since last
- 			ping in km
- 	\fIaltitude\fP:		altitude of sonar above seafloor
- 			in m
- 	\fIsonardepth\fP:	depth of sonar in m
- 	\fInbath\fP:		number of bathymetry values
- 	\fInamp\fP:		number of amplitude values
- 	\fInss\fP:		number of sidescan values
- 	\fIbeamflag\fP:		array of bathymetry flags
- 	\fIbath\fP:		array of bathymetry values in meters
- 	\fIamp\fP:		array of amplitude values in unknown units
- 	\fIbathacrosstrack\fP:	array of of acrosstrack distances
- 			in meters corresponding to bathymetry
- 	\fIbathalongtrack\fP:	array of of alongtrack distances
- 			in meters corresponding to bathymetry
- 	\fIss\fP:		array of sidescan values in unknown units
- 	\fIssacrosstrack\fP:	array of of acrosstrack distances
- 			in meters corresponding to sidescan
- 	\fIssacrosstrack\fP:	array of of alongtrack distances
- 			in meters corresponding to sidescan
- 	\fIcomment\fP:	comment string
-
-The return values are:
- 	\fIerror\fP:		error value
-
-A status value indicating success or failure is returned; the error value
-argument \fIerror\fP passes more detailed information about
-insert failures.
-
-\---------------------------------------------------------
-.br
-int \fBmb_extract_nav\fP(
- 		int \fIverbose\fP,
- 		char \fI*mbio_ptr\fP,
- 		char \fI*store_ptr\fP,
- 		int \fI*kind\fP,
- 		int \fItime_i[7]\fP,
- 		double \fI*time_d\fP,
- 		double \fI*navlon\fP,
- 		double \fI*navlat\fP,
- 		double \fI*speed\fP,
- 		double \fI*heading\fP,
- 		double \fI*draft\fP,
- 		double \fI*roll\fP,
- 		double \fI*pitch\fP,
- 		double \fI*heave\fP,
- 		int \fI*error\fP);
-
-The function \fBmb_extract_nav\fP extracts navigation data from the
-structure pointed to by \fI*store_ptr\fP according to the
-\fBMBIO\fP descriptor pointed to by \fImbio_ptr\fP.
-The \fIverbose\fP value controls the standard
-error output verbosity of the function.
-The form of the data structure is determined by the
-sonar system associated with the format of the data being read. A number
-of different data record types are recognized by \fBMB-System\fP; the
-\fIkind\fP value indicates which type of record is stored in \fI*store_ptr\fP.
-Navigation
-data is returned if the data record is survey data (navigation,
-bathymetry, amplitude, and sidescan) or navigation data (navigation only).
-
-The return values are:
- 	\fIkind\fP:		kind of data record read
- 				1	survey data
- 				12	navigation
- 	\fItime_i\fP:		time of current ping
- 			\fItime_i\fP[0]: year
- 			\fItime_i\fP[1]: month
- 			\fItime_i\fP[2]: day
- 			\fItime_i\fP[3]: hour
- 			\fItime_i\fP[4]: minute
- 			\fItime_i\fP[5]: second
- 			\fItime_i\fP[6]: microsecond
- 	\fItime_d\fP:		time of current ping in seconds
- 			since 1/1/70 00:00:00
- 	\fInavlon\fP:		longitude
- 	\fInavlat\fP:		latitude
- 	\fIspeed\fP:		ship speed in km/s
- 	\fIheading\fP:		ship heading in degrees
- 	\fIdraft\fP:		sonar depth in meters
- 	\fIroll\fP:		sonar roll in degrees
- 	\fIpitch\fP:		sonar pitch in degrees
- 	\fIheave\fP:		sonar heave in meters
-
-A status value indicating success or failure is returned; the error value
-argument \fIerror\fP passes more detailed information about
-extract failures.
-
-\---------------------------------------------------------
-.br
-int \fBmb_insert_nav\fP(
- 		int \fIverbose\fP,
- 		char \fI*mbio_ptr\fP,
- 		char \fI*store_ptr\fP,
- 		int \fItime_i[7]\fP,
- 		double \fItime_d\fP,
- 		double \fInavlon\fP,
- 		double \fInavlat\fP,
- 		double \fIspeed\fP,
- 		double \fIheading\fP,
- 		double \fIdraft\fP,
- 		double \fIroll\fP,
- 		double \fIpitch\fP,
- 		double \fIheave\fP,
- 		int \fI*error\fP);
-
-The function \fBmb_insert_nav\fP inserts navigation data into the
-structure pointed to by \fI*store_ptr\fP according to the
-\fBMBIO\fP descriptor pointed to by \fImbio_ptr\fP.
-The \fIverbose\fP value controls the standard
-error output verbosity of the function.
-The form of the data structure is determined by the
-sonar system associated with the format of the data being read. A number
-of different data record types are recognized by \fBMB-System\fP; the
-\fIkind\fP value indicates which type of
-record is to be stored in \fI*store_ptr\fP.
-Data will be inserted only if the data record is survey data (navigation,
-bathymetry, amplitude, and sidescan), or navigation data (navigation only).
-The values to be inserted are:
- 	\fItime_i\fP:		time of current ping
- 			\fItime_i\fP[0]: year
- 			\fItime_i\fP[1]: month
- 			\fItime_i\fP[2]: day
- 			\fItime_i\fP[3]: hour
- 			\fItime_i\fP[4]: minute
- 			\fItime_i\fP[5]: second
- 			\fItime_i\fP[6]: microsecond
- 	\fItime_d\fP:		time of current ping in seconds
- 			since 1/1/70 00:00:00
- 	\fInavlon\fP:		longitude
- 	\fInavlat\fP:		latitude
- 	\fIspeed\fP:		ship speed in km/s
- 	\fIheading\fP:		ship heading in degrees
- 	\fIdraft\fP:		sonar depth in meters
- 	\fIroll\fP:		sonar roll in degrees
- 	\fIpitch\fP:		sonar pitch in degrees
- 	\fIheave\fP:		sonar heave in meters
-
-The return values are:
- 	\fIerror\fP:		error value
-
-A status value indicating success or failure is returned; the error value
-argument \fIerror\fP passes more detailed information about
-insert failures.
-
-\---------------------------------------------------------
-.br
-int \fBmb_extract_altitude\fP(
- 		int \fIverbose\fP,
- 		char \fI*mbio_ptr\fP,
- 		char \fI*store_ptr\fP,
- 		int \fI*kind\fP,
- 		double \fI*transducer_depth\fP,
-  		double \fI*altitude\fP,
- 		int \fI*error\fP);
-
-The function \fBmb_extract_altitude\fP extracts the sonar transducer
-depth (\fBtransducer_depth\fP) below the sea surface
-and the the sonar transducer \fBaltitude\fP above the seafloor
-according to the
-\fBMBIO\fP descriptor pointed to by \fImbio_ptr\fP.
-This function is not defined for all data formats.
-The \fIverbose\fP value controls the standard
-error output verbosity of the function.
-The form of the data structure is determined by the
-sonar system associated with the format of the data being read. A number
-of different data record types are recognized by \fBMB-System\fP; the
-\fIkind\fP value indicates which type of record is stored in \fI*store_ptr\fP.
-These data are returned only if the data record is survey data.
-These values are useful for
-sidescan processing applications. Both transducer depths and
-altitudes are reported in meters.
-
-The return values are:
- 	\fIkind\fP:		kind of data record read (error
- 				if not survey data):
- 					1	survey data
- 	\fItransducer_depth\fP:	depth of sonar in meters
- 	\fIaltitude\fP:		altitude of sonar above seafloor
- 			in meters.
- 	\fIerror\fP:		error value
-
-A status value indicating success or failure is returned; the error value
-argument \fIerror\fP passes more detailed information about
-data extraction failures.
-
-\---------------------------------------------------------
-.br
-int \fBmb_insert_altitude\fP(
- 		int \fIverbose\fP,
- 		char \fI*mbio_ptr\fP,
- 		char \fI*store_ptr\fP,
- 		double \fItransducer_depth\fP,
- 		double \fIaltitude\fP,
- 		int \fI*error\fP);
-
-The function \fBmb_insert_altitude\fP inserts
-sonar depth and altitude data into the
-structure pointed to by \fI*store_ptr\fP according to the
-\fBMBIO\fP descriptor pointed to by \fImbio_ptr\fP.
-This function is not defined for all data formats.
-The \fIverbose\fP value controls the standard
-error output verbosity of the function.
-The form of the data structure is determined by the
-sonar system associated with the format of the data being read. A number
-of different data record types are recognized by \fBMB-System\fP.
-Data will be inserted only if the data record is survey data (navigation,
-bathymetry, amplitude, and sidescan).
-The values to be inserted are:
- 	\fItransducer_depth\fP:	depth of sonar in meters
- 	\fIaltitude\fP:		altitude of sonar in meters
-
-The return values are:
- 	\fIerror\fP:		error value
-
-A status value indicating success or failure is returned; the error value
-argument \fIerror\fP passes more detailed information about
-insert failures.
-
-\---------------------------------------------------------
-.br
-int \fBmb_extract_svp\fP(
- 		int \fIverbose\fP,
- 		char \fI*mbio_ptr\fP,
- 		char \fI*store_ptr\fP,
- 		int \fI*kind\fP,
- 		int \fI*nsvp\fP,
- 		double \fI*depth\fP,
-  		double \fI*velocity\fP,
- 		int \fI*error\fP);
-
-The function \fBmb_extract_svp\fP extracts a water sound
-velocity profile according to the
-\fBMBIO\fP descriptor pointed to by \fImbio_ptr\fP.
-This function is not defined for all data formats.
-The \fIverbose\fP value controls the standard
-error output verbosity of the function.
-The form of the data structure is determined by the
-sonar system associated with the format of the data being read. A number
-of different data record types are recognized by \fBMB-System\fP; the
-\fIkind\fP value indicates which type of record is stored in \fI*store_ptr\fP.
-These data are returned only if the data record is a sound
-velocity profile record. These values are useful for
-calculating bathymetry from travel times and beam angles.
-
-The return values are:
- 	\fIkind\fP:		kind of data record read (error
- 				if not SVP data):
- 					6	SVP data
- 	\fInsvp\fP:		number of depth and sound speed
- 				data in the profile
- 	\fIdepth\fP:		array of depths in meters
- 	\fIvelocity\fP:		array of sound speeds in m/sec
- 	\fIerror\fP:		error value
-
-A status value indicating success or failure is returned; the error value
-argument \fIerror\fP passes more detailed information about
-data extraction failures.
-
-\---------------------------------------------------------
-.br
-int \fBmb_insert_svp\fP(
- 		int \fIverbose\fP,
- 		char \fI*mbio_ptr\fP,
- 		char \fI*store_ptr\fP,
- 		int \fInsvp\fP,
- 		double \fI*depth\fP,
- 		double \fI*velocity\fP,
- 		int \fI*error\fP);
-
-The function \fBmb_insert_svp\fP inserts a water sound
-velocity profile according to the
-\fBMBIO\fP descriptor pointed to by \fImbio_ptr\fP.
-This function is not defined for all data formats.
-The \fIverbose\fP value controls the standard
-error output verbosity of the function.
-The form of the data structure is determined by the
-sonar system associated with the format of the data being read. A number
-of different data record types are recognized by \fBMB-System\fP.
-These data are inserted only if the data record is a sound
-velocity profile record. These values are useful for
-calculating bathymetry from travel times and beam angles.
-The inserted values are:
- 	\fInsvp\fP:		number of depth and sound speed
- 				data in the profile
- 	\fIdepth\fP:		array of depths in meters
- 	\fIvelocity\fP:		array of sound speeds in m/sec
-
-The return values are:
- 	\fIerror\fP:		error value
-
-A status value indicating success or failure is returned; the error value
-argument \fIerror\fP passes more detailed information about
-data insertion failures.
-
-\---------------------------------------------------------
-.br
-int \fBmb_ttimes\fP(
- 		int \fIverbose\fP,
- 		char \fI*mbio_ptr\fP,
- 		char \fI*store_ptr\fP,
- 		int \fI*kind\fP,
- 		int \fI*nbeams\fP,
- 		double \fI*ttimes\fP,
- 		double	\fI*angles\fP,
- 		double \fI*angles_forward\fP,
- 		double \fI*angles_null\fP,
- 		double \fI*heave\fP,
- 		double \fI*alongtrack_offset\fP,
- 		double \fI*draft\fP,
- 		double \fI*ssv\fP,
- 		int \fI*error\fP);
-
-The function \fBmb_ttimes\fP extracts travel times and beam
-angles from a sonar-specific data structure pointed to by
-\fIstore_ptr\fP. These values are used for calculating
-swath bathymetry. The \fIverbose\fP value controls
-the standard error output verbosity of the function.
-The coordinates of the beam angles can be a bit confusing.
-The angles are returned in "takeoff angle coordinates"
-appropriate for raytracing. The array angles contains the
-angle from vertical and the array angles_forward
-contains the angle from acrosstrack. This
-coordinate system is distinct from the roll-pitch coordinates
-appropriate for correcting roll and pitch values. A description
-of these relevent coordinate systems is given below.
-The \fBangles_null\fP array
-contains the effective sonar array orientation for each beam. The
-\fBangles_null\fP array may be used to correct
-beam angles using Snell's law if the \fBssv\fP is changed.
-The \fBangles_null\fP values reflect the sonar configuration.
-For example, some multibeam sonars have a flat transducer array, and
-so the \fBangles_null\fP array consists of \fBnbeams\fP zero values.
-Other multibeams have circular arrays so that the \fBangles_null\fP
-values equal the \fBangles\fP values. The \fBalongtrack_offset\fP array
-accommodates sonars which report multiple pings in a single
-survey record; each ping occurs at a different position along the
-shiptrack, producing alongtrack offsets relative to the navigation
-for some beam values. The sum of the \fBdraft\fP value
-and the \fBheave\fP array values gives the depth
-of the sonar for each beam. For hull mounted installations the
-\fBdraft\fP value is generally static but the \fBheave\fP values
-vary with time. For towed sonars the \fBdraft\fP varies with time
-and the \fBheave\fP values are typically zero. The \fBssv\fP value
-gives the water sound velocity at the sonar array.
-
-The return values are:
- 	\fIkind\fP:		kind of data record read (error
- 				if not survey data):
- 					1	survey data
- 	\fInbeams\fP:		number of beams
- 	\fIttimes\fP:		array of two-way travel times in seconds
- 	\fIangles\fP:		array of angles from vertical in degrees
- 	\fIangles_forward\fP:	array of angles from acrosstrack in degrees
- 	\fIangles_null\fP:	array of sonar array orientation in degrees
- 	\fIheave\fP:		array of heave values for each beam in meters
- 	\fIalongtrack_offset\fP:array of alongtrack distance offsets for
- 				each beam in meters
- 	\fIdraft\fP:		draft of sonar in meters
- 	\fIssv\fP:		water sound velocity at sonar in m/seconds
- 	\fIerror\fP:		error value
-
-A status value indicating success or failure is returned; the error value
-argument \fIerror\fP passes more detailed information about
-data extraction failures.
-
-\---------------------------------------------------------
-.br
-int \fBmb_detects\fP(
- 		int \fIverbose\fP,
- 		void \fI*mbio_ptr\fP,
- 		void \fI*store_ptr\fP,
- 		int \fI*kind\fP,
- 		int \fI*nbeams\fP,
- 		int \fI*detects\fP,
- 		int \fI*error\fP);
-
-The function \fBmb_detects\fP extracts beam bottom detect
-types from a sonar-specific data structure pointed to by
-\fIstore_ptr\fP. These values indicate whether the depth
-value associated with a particular beam i derived from an
-amplitude detect (e.g. detects[i] = 1), a phase detect
-(e.g. detects[i] = 2), or the algorithm is unknown
-(e.g. detects[i] = 0). The \fIverbose\fP value controls
-the standard error output verbosity of the function.
-
-The return values are:
- 	\fIkind\fP:		kind of data record read (error
- 				if not survey data):
- 					1	survey data
- 	\fInbeams\fP:		number of beams
- 	\fIdetects\fP:		array of \fInbeams\fP bottom detect algorithm flags
- 					0 = unknown
-					1 = amplitude detect
-					2 = phase detect
- 	\fIerror\fP:		error value
-
-A status value indicating success or failure is returned; the error value
-argument \fIerror\fP passes more detailed information about
-data extraction failures. This functionality is available for
-only a subset of the supported sonars. If the corresponding low
-level routine is undefined, \fI*error\fP will be set to
-MB_ERROR_BAD_SYSTEM (14).
-
-\---------------------------------------------------------
-.br
-int \fBmb_gains\fP(
- 		int \fIverbose\fP,
- 		void \fI*mbio_ptr\fP,
- 		void \fI*store_ptr\fP,
- 		int \fI*kind\fP,
- 		double \fI*transmit_gain\fP,
- 		double \fI*pulse_length\fP,
- 		double \fI*receive_gain\fP,
- 		int \fI*error\fP);
-
-The function \fBmb_gains\fP extracts the most basic gain
-settings from a sonar-specific data structure pointed to by
-\fIstore_ptr\fP. In many cases, sonars have more complicated
-gain functions, particularly with respect to the receiver
-TVG function. In those cases, the receive gain returned here
-refers to the constant gain setting and does not include any
-TVG parameters. The \fIverbose\fP value controls
-the standard error output verbosity of the function.
-
-The return values are:
- 	\fIkind\fP:		kind of data record read (error
- 				if not survey data):
- 					1	survey data
- 	\fItransmit_gain\fP:	transmit gain (dB)
- 	\fIpulse_length\fP:	transmit pulse length (sec)
- 	\fIreceive_gain\fP:	receive gain (dB)
- 	\fIerror\fP:		error value
-
-A status value indicating success or failure is returned; the error value
-argument \fIerror\fP passes more detailed information about
-data extraction failures.  This functionality is available for
-only a subset of the supported sonars. If the corresponding low
-level routine is undefined, \fI*error\fP will be set to
-MB_ERROR_BAD_SYSTEM (14).
-
-\---------------------------------------------------------
-.br
-int \fBmb_extract_rawss\fP(
- 		int \fIverbose\fP,
- 		char \fI*mbio_ptr\fP,
- 		char \fI*store_ptr\fP,
- 		int \fI*kind\fP,
- 		int \fI*nrawss\fP,
- 		double \fI*rawss\fP,
- 		double \fI*rawssacrosstrack\fP,
- 		double \fI*rawssalongtrack\fP,
- 		int \fI*error\fP);
-
-This function has not yet been implemented for any data format.
-The notion is that since some formats carry both "raw" and
-"processed" sidescan imagery, there should be functions to
-extract and insert the "raw" sidescan. Given that the meaning of "raw"
-sidescan varies greatly among sonars, the processing one might apply to
-the data will depend on the sonar source. The definition of
-\fBmb_extract_rawss\fP may well change when we actually implement it.
-
-\---------------------------------------------------------
-.br
-int \fBmb_insert_rawss\fP(
- 		int \fIverbose\fP,
- 		char \fI*mbio_ptr\fP,
- 		char \fI*store_ptr\fP,
- 		int \fInrawss\fP,
- 		double \fI*rawss\fP,
- 		double \fI*rawssacrosstrack\fP,
- 		double \fI*rawssalongtrack\fP,
- 		int \fI*error\fP);
-
-This function has not yet been implemented for any data format.
-The notion is that since some formats carry both "raw" and
-"processed" sidescan imagery, there should be functions to
-extract and insert the "raw" sidescan. Given that the meaning of "raw"
-sidescan varies greatly among sonars, the processing one might apply to
-the data will depend on the sonar source. The definition of
-\fBmb_insert_rawss\fP may well change when we actually implement it.
-
-\---------------------------------------------------------
-.br
-int \fBmb_copyrecord\fP(
- 		int \fIverbose\fP,
- 		char \fI*mbio_ptr\fP,
- 		char \fI*store_ptr\fP,
- 		char \fI*copy_ptr\fP,
- 		int \fI*error\fP);
-
-The function \fBmb_copyrecord\fP copies the sonar-specific
-data structure pointed to by
-\fIstore_ptr\fP into the data structure pointed to by \fI*copy_ptr\fP.
-The data structures must already have been allocated.
-
-The return values are:
- 	\fIerror\fP:		error value
-
-A status value indicating success or failure is returned; the error value
-argument \fIerror\fP passes more detailed information about
-data copy failures.
-
-.SH LEVEL 3 FUNCTIONS
-
-int \fBmb_buffer_init\fP(
- 		int \fIverbose\fP,
- 		char \fI**buff_ptr\fP,
- 		int \fI*error\fP);
-
-The function \fBmb_buffer_init\fP initializes the data structures
-required for buffered i/0. A pointer to the buffer data structure
-is returned as *\fIbuff_ptr\fP.
-The \fIverbose\fP
-value controls the standard error output verbosity of the function.
-
-The return values are:
- 	*\fIbuff_ptr\fP:	pointer to buffer structure
- 	\fIerror\fP:		error value
-
-A status value indicating success or failure is returned; the error value
-argument \fIerror\fP passes more detailed information about
-buffer initialization failures.
-
-\---------------------------------------------------------
-.br
-int \fBmb_buffer_close\fP(
- 		int \fIverbose\fP,
- 		char \fI**buff_ptr\fP,
- 		char \fI*mbio_ptr\fP,
- 		int \fI*error\fP);
-
-The function \fBmb_buffer_close\fP releases all memory allocated
-for buffered i/0, including the structure pointed to by *\fIbuff_ptr\fP.
-The \fIverbose\fP
-value controls the standard error output verbosity of the function.
-
-The return values are:
- 	\fIerror\fP:		error value
-
-A status value indicating success or failure is returned; the error value
-argument \fIerror\fP passes more detailed information about
-buffer deallocation failures.
-
-\---------------------------------------------------------
-.br
-int \fBmb_buffer_load\fP(
- 		int \fIverbose\fP,
- 		char \fI*buff_ptr\fP,char \fI*mbio_ptr\fP,
- 		int \fInwant\fP,
- 		int \fI*nload\fP,
- 		int \fI*nbuff\fP,
- 		int \fI*error\fP);
-
-The function \fBmb_buffer_load\fP loads data into the buffer pointed
-to by \fIbuff_ptr\fP from the input file initialized in the
-\fBMBIO\fP descriptor pointed to by \fImbio_ptr\fP.
-The \fIverbose\fP
-value controls the standard error output verbosity of the function.
-
-The input control parameters have the following significance:
- 	\fInwant\fP:		The number of data records desired
- 				in the buffer.
-
-The returned values are:
- 	\fInload\fP:		The number of data records loaded into the buffer.
- 	\fInbuff\fP:		The total number of data records in the buffer after loading.
- 	\fIerror\fP:		error value
-
-The buffer may already contain data records when the \fBmb_buffer_load\fP
-call is made; if the number of previously loaded records is less than
-\fInwant\fP, the function will attempt to read and load records
-until a total of \fInwant\fP records are loaded. The \fInload\fP
-value is the number of data records loaded during the current
-function call, and the \fInbuff\fP value is the number of data
-records in the buffer at the completion of the \fBmb_buffer_load\fP
-call.
-A status value indicating success or failure is returned; the error value
-argument \fIerror\fP passes more detailed information about
-buffer deallocation failures.
-
-\---------------------------------------------------------
-.br
-int \fBmb_buffer_dump\fP(
- 		int \fIverbose\fP,
- 		char \fI*buff_ptr\fP,
- 		char \fI*mbio_ptr\fP,
- 		char \fI*ombio_ptr\fP,
- 		int \fInhold\fP,
- 		int \fI*ndump\fP,
- 		int \fI*nbuff\fP,
- 		int \fI*error\fP);
-
-The function \fBmb_buffer_dump\fP dumps data from the buffer pointed
-to by *\fIbuff_ptr\fP into the output file initialized in the
-\fBMBIO\fP descriptor pointed to by \fIombio_ptr\fP. The data in the
-buffer were read from the input file initialized in the \fBMBIO\fP
-descriptor pointed to by \fImbio_ptr\fP.
-.
-The \fIverbose\fP
-value controls the standard error output verbosity of the function.
-
-The input control parameters have the following significance:
- 	\fInhold\fP:		The number of data records desired to be held
- 				in the buffer.
-
-The returned values are:
- 	\fInload\fP:		The number of data records dumped from the buffer.
- 	\fInbuff\fP:		The total number of data records in the buffer after dumping.
- 	\fIerror\fP:		error value
-
-If the number of loaded records is more than
-\fInhold\fP, the function will attempt to write out records
-from the beginning of the buffer until \fInhold\fP records
-are left in the buffer. The \fIndump\fP
-value is the number of data records dumped during the current
-function call, and the \fInbuff\fP value is the number of data
-records in the buffer at the completion of the \fBmb_buffer_dump\fP
-call.
-A status value indicating success or failure is returned; the error value
-argument \fIerror\fP passes more detailed information about
-buffer deallocation failures.
-
-\---------------------------------------------------------
-.br
-int \fBmb_buffer_clear\fP(
- 		int \fIverbose\fP,
- 		char \fI*buff_ptr\fP,
- 		char \fI*mbio_ptr\fP,
- 		int \fInhold\fP,
- 		int \fI*ndump\fP,
- 		int \fI*nbuff\fP,
- 		int \fI*error\fP);
-
-The function \fBmb_buffer_clear\fP removes data from the buffer pointed
-to by *\fIbuff_ptr\fP without writing those data records to an
-output file. An \fBMBIO\fP descriptor pointed to by \fImbio_ptr\fP
-is still required, and generally represents the \fBMBIO\fP descriptor
-used to read and load the data originally.
-The \fIverbose\fP
-value controls the standard error output verbosity of the function.
-
-The input control parameters have the following significance:
- 	\fInwant\fP:		The number of data records desired to be held
- 				in the buffer.
-
-The returned values are:
- 	\fInload\fP:		The number of data records cleared from the buffer.
- 	\fInbuff\fP:		The total number of data records in the buffer after dumping.
- 	\fIerror\fP:		error value
-
-If the number of loaded records is more than
-\fInhold\fP, the function will attempt to clear out records
-from the beginning of the buffer until \fInhold\fP records
-are left in the buffer. The \fIndump\fP
-value is the number of data records cleared during the current
-function call, and the \fInbuff\fP value is the number of data
-records in the buffer at the completion of the \fBmb_buffer_dump\fP
-call.
-A status value indicating success or failure is returned; the error value
-argument \fIerror\fP passes more detailed information about
-buffer deallocation failures.
-
-\---------------------------------------------------------
-.br
-int \fBmb_buffer_info\fP(
- 		int \fIverbose\fP,
- 		char \fI*buff_ptr\fP,
- 		char \fI*mbio_ptr\fP,
- 		int \fIid\fP,
- 		int \fI*system\fP,
- 		int \fI*kind\fP,
- 		int \fI*error\fP);
-
-The function \fBmb_buffer_clear\fP removes data from the buffer pointed
-to by *\fIbuff_ptr\fP without writing those data records to an
-output file. An \fBMBIO\fP descriptor pointed to by \fImbio_ptr\fP
-is still required, and generally represents the \fBMBIO\fP descriptor
-used to read and load the data originally.
-The \fIverbose\fP
-value controls the standard error output verbosity of the function.
-
-The input control parameters have the following significance:
- 	\fInwant\fP:		The number of data records desired to be held
- 				in the buffer.
-
-The returned values are:
- 	\fInload\fP:		The number of data records cleared from the buffer.
- 	\fInbuff\fP:		The total number of data records in the buffer after dumping.
- 	\fIerror\fP:		error value
-
-If the number of loaded records is more than
-\fInhold\fP, the function will attempt to clear out records
-from the beginning of the buffer until \fInhold\fP records
-are left in the buffer. The \fIndump\fP
-value is the number of data records cleared during the current
-function call, and the \fInbuff\fP value is the number of data
-records in the buffer at the completion of the \fBmb_buffer_dump\fP
-call.
-A status value indicating success or failure is returned; the error value
-argument \fIerror\fP passes more detailed information about
-buffer deallocation failures.
-
-\---------------------------------------------------------
-.br
-int \fBmb_buffer_get_next_data\fP(
- 		int \fIverbose\fP,
- 		char \fI*buff_ptr\fP,
- 		char \fI*mbio_ptr\fP,
- 		int \fIstart\fP,
- 		int \fI*id\fP,
- 		int \fItime_i[7]\fP,
- 		double \fI*time_d\fP,
- 		double \fI*navlon\fP,
- 		double \fI*navlat\fP,
- 		double \fI*speed\fP,
- 		double \fI*heading\fP,
- 		int \fI*nbath\fP,
- 		int \fI*namp\fP,
- 		int \fI*nss\fP,
- 		char \fI*beamflag\fP,
- 		double \fI*bath\fP,
- 		double \fI*amp\fP,
- 		double \fI*bathacrosstrack\fP,
- 		double \fI*bathalongtrack\fP,
- 		double \fI*ss\fP,
- 		double \fI*ssacrosstrack\fP,
- 		double \fI*ssalongtrack\fP,
- 		int \fI*error\fP);
-
-The function \fBmb_buffer_get_next_data\fP searches for the
-next survey data record in the buffer, beginning at buffer
-index \fIstart\fP. Since buffer indexes begin at 0, the first
-call to \fBmb_buffer_get_next_data\fP should have \fIstart\fP = 0.
-If a survey data record is found at or beyond \fIstart\fP,
-\fBmb_buffer_get_next_data\fP returns the buffer index of that
-record in \fIid\fP. Data is also returned in the forms of bathymetry,
-amplitude, and sidescan survey data. No comments or other
-non-survey data records are returned.
-The \fIverbose\fP
-value controls the standard error output verbosity of the function.
-
-The input control parameters have the following significance:
- 	\fIstart\fP:		The buffer index at which to start
- 			searching for a survey data record.
-
-The returned values are:
- 	\fIid\fP:		The buffer index of the first survey
- 			data record at or after \fIstart\fP.
- 	\fItime_i\fP:		time of current ping
- 			\fItime_i\fP[0]: year
- 			\fItime_i\fP[1]: month
- 			\fItime_i\fP[2]: day
- 			\fItime_i\fP[3]: hour
- 			\fItime_i\fP[4]: minute
- 			\fItime_i\fP[5]: second
- 			\fItime_i\fP[6]: microsecond
- 	\fItime_d\fP:		time of current ping in seconds
- 			since 1/1/70 00:00:00
- 	\fInavlon\fP:		longitude
- 	\fInavlat\fP:		latitude
- 	\fIspeed\fP:		ship speed in km/s
- 	\fIheading\fP:		ship heading in degrees
- 	\fInbath\fP:		number of bathymetry values
- 	\fInamp\fP:		number of amplitude values
- 	\fInss\fP:		number of sidescan values
-	\fIbeamflag\fP:		array of bathymetry flags
- 	\fIbath\fP:		array of bathymetry values in meters
- 	\fIamp\fP:		array of amplitude values in unknown units
- 	\fIbathacrosstrack\fP:	array of of acrosstrack distances
- 			in meters corresponding to bathymetry
- 	\fIbathalongtrack\fP:	array of of alongtrack distances
- 			in meters corresponding to bathymetry
- 	\fIss\fP:		array of sidescan values in unknown units
- 	\fIssacrosstrack\fP:	array of of acrosstrack distances
- 			in meters corresponding to sidescan
- 	\fIssacrosstrack\fP:	array of of alongtrack distances
- 			in meters corresponding to sidescan
- 	\fIerror\fP:		error value
-
-A status value indicating success or failure is returned; the error value
-argument \fIerror\fP passes more detailed information about
-failures. The most common error occurs when no more survey data
-records remain to be found in the buffer; in this case,
-\fIerror\fP = \-14.
-
-\---------------------------------------------------------
-.br
-int \fBmb_buffer_extract\fP(
- 		int \fIverbose\fP,
- 		char \fI*buff_ptr\fP,
- 		char \fI*mbio_ptr\fP,
- 		int \fIid\fP,
- 		int \fI*kind\fP,
- 		int \fItime_i[7]\fP,
- 		double \fI*time_d\fP,
- 		double \fI*navlon\fP,
- 		double \fI*navlat\fP,
- 		double \fI*speed\fP,
- 		double \fI*heading\fP,
- 		int \fI*nbath\fP,
- 		int \fI*namp\fP,
- 		int \fI*nss\fP,
- 		char \fI*beamflag\fP,
- 		double \fI*bath\fP,
- 		double \fI*amp\fP,
- 		double \fI*bathacrosstrack\fP,
- 		double \fI*bathalongtrack\fP,
- 		double \fI*ss\fP,
- 		double \fI*ssacrosstrack\fP,
- 		double \fI*ssalongtrack\fP,
- 		char \fI*comment\fP,
- 		int \fI*error\fP);
-
-The function \fBmb_buffer_extract\fP extracts and returns
-a subset of the data in a buffer record.
-The \fIverbose\fP
-value controls the standard error output verbosity of the function.
-The buffer record is specified with the
-buffer index \fIid\fP. The data is either
-in the form of bathymetry,
-amplitude, and sidescan survey data or a comment string.
-
-The input control parameters have the following significance:
- 	\fIid\fP:		The buffer index of the data
- 			record to extract.
-
-The returned values are:
- 	\fIkind\fP:		kind of data record extracted
- 					1	survey data
- 					2	comment
- 					>=3	other data that cannot
- 						be passed by \fBmb_buffer_extract\fP
- 	\fItime_i\fP:		time of current ping
- 			\fItime_i\fP[0]: year
- 			\fItime_i\fP[1]: month
- 			\fItime_i\fP[2]: day
- 			\fItime_i\fP[3]: hour
- 			\fItime_i\fP[4]: minute
- 			\fItime_i\fP[5]: second
- 			\fItime_i\fP[6]: microsecond
- 	\fItime_d\fP:		time of current ping in seconds
- 			since 1/1/70 00:00:00
- 	\fInavlon\fP:		longitude
- 	\fInavlat\fP:		latitude
- 	\fIspeed\fP:		ship speed in km/s
- 	\fIheading\fP:		ship heading in degrees
- 	\fInbath\fP:		number of bathymetry values
- 	\fInamp\fP:		number of amplitude values
- 	\fInss\fP:		number of sidescan values
- 	\fIbeamflag\fP:		array of bathymetry flags
- 	\fIbath\fP:		array of bathymetry values in meters
- 	\fIamp\fP:		array of amplitude values in unknown units
- 	\fIbathacrosstrack\fP:	array of of acrosstrack distances
- 			in meters corresponding to bathymetry
- 	\fIbathalongtrack\fP:	array of of alongtrack distances
- 			in meters corresponding to bathymetry
- 	\fIss\fP:		array of sidescan values in unknown units
- 	\fIssacrosstrack\fP:	array of of acrosstrack distances
- 			in meters corresponding to sidescan
- 	\fIssacrosstrack\fP:	array of of alongtrack distances
- 			in meters corresponding to sidescan
- 	\fIcomment\fP:		comment string
- 	\fIerror\fP:		error value
-
-A status value indicating success or failure is returned; the error value
-argument \fIerror\fP passes more detailed information about
-extract failures.
-
-\---------------------------------------------------------
-.br
-int \fBmb_buffer_insert\fP(
- 		int \fIverbose\fP,
- 		char \fI*buff_ptr\fP,
- 		char \fI*mbio_ptr\fP,
- 		int \fIid\fP,
- 		int \fItime_i[7]\fP,
- 		double \fItime_d\fP,
- 		double \fInavlon\fP,
- 		double \fInavlat\fP,
- 		double \fIspeed\fP,
- 		double \fIheading\fP,
- 		int \fInbath\fP,
- 		int \fInamp\fP,
- 		int \fInss\fP,
- 		char \fI*beamflag\fP,
- 		double \fI*bath\fP,
- 		double \fI*amp\fP,
- 		double \fI*bathacrosstrack\fP,
- 		double \fI*bathalongtrack\fP,
- 		double \fI*ss\fP,
- 		double \fI*ssacrosstrack\fP,
- 		double \fI*ssalongtrack\fP,
- 		char \fI*comment\fP,
- 		int \fI*error\fP);
-
-The function \fBmb_buffer_insert\fP inserts data into a
-buffer record, replacing a subset of the original values.
-The \fIverbose\fP
-value controls the standard error output verbosity of the function.
-The buffer record is specified with the
-buffer index \fIid\fP. The data is either
-in the form of bathymetry,
-amplitude, and sidescan survey data or a comment string.
-
-The input control parameters have the following significance:
- 	\fIid\fP:		The buffer index of the data
- 			record to insert.
-
-The returned values are:
- 	\fIkind\fP:		kind of data record inserted
- 					1	survey data
- 					2	comment
- 					>=3	other data that cannot
- 						be passed by \fBmb_buffer_insert\fP
- 	\fItime_i\fP:		time of current ping
- 			\fItime_i\fP[0]: year
- 			\fItime_i\fP[1]: month
- 			\fItime_i\fP[2]: day
- 			\fItime_i\fP[3]: hour
- 			\fItime_i\fP[4]: minute
- 			\fItime_i\fP[5]: second
- 			\fItime_i\fP[6]: microsecond
- 	\fItime_d\fP:		time of current ping in seconds
- 			since 1/1/70 00:00:00
- 	\fInavlon\fP:		longitude
- 	\fInavlat\fP:		latitude
- 	\fIspeed\fP:		ship speed in km/s
- 	\fIheading\fP:		ship heading in degrees
- 	\fInbath\fP:		number of bathymetry values
- 	\fInamp\fP:		number of amplitude values
- 	\fInss\fP:		number of sidescan values
- 	\fIbeamflag\fP:		array of bathymetry flags
- 	\fIbath\fP:		array of bathymetry values in meters
- 	\fIamp\fP:		array of amplitude values in unknown units
- 	\fIbathacrosstrack\fP:	array of of acrosstrack distances
- 			in meters corresponding to bathymetry
- 	\fIbathalongtrack\fP:	array of of alongtrack distances
- 			in meters corresponding to bathymetry
- 	\fIss\fP:		array of sidescan values in unknown units
- 	\fIssacrosstrack\fP:	array of of acrosstrack distances
- 			in meters corresponding to sidescan
- 	\fIssacrosstrack\fP:	array of of alongtrack distances
- 			in meters corresponding to sidescan
- 	\fIcomment\fP:		comment string
-
-The returned values are:
- 	\fIerror\fP:		error value
-
-A status value indicating success or failure is returned; the error value
-argument \fIerror\fP passes more detailed information about
-insert failures.
-
-\---------------------------------------------------------
-.br
-int \fBmb_buffer_get_next_nav\fP(
- 		int \fIverbose\fP,
- 		char \fI*buff_ptr\fP,
- 		char \fI*mbio_ptr\fP,
- 		int \fIstart\fP,
- 		int \fI*id\fP,
- 		int \fItime_i[7]\fP,
- 		double \fI*time_d\fP,
- 		double \fI*navlon\fP,
- 		double \fI*navlat\fP,
- 		double \fI*speed\fP,
- 		double \fI*heading\fP,
- 		double \fI*draft\fP,
- 		double \fI*roll\fP,
- 		double \fI*pitch\fP,
- 		double \fI*heave\fP,
- 		int \fI*error\fP);
-
-The function \fBmb_buffer_get_next_nav\fP searches for the
-next survey data record in the buffer, beginning at buffer
-index \fIstart\fP. Since buffer indexes begin at 0, the first
-call to \fBmb_buffer_get_next_nav\fP should have \fIstart\fP = 0.
-If a survey data record is found at or beyond \fIstart\fP,
-\fBmb_buffer_get_next_nav\fP returns the buffer index of that
-record in \fIid\fP. Navigation and vertical reference sensor
-data is also returned. No comments or other
-non-survey data records are returned.
-The \fIverbose\fP
-value controls the standard error output verbosity of the function.
-
-The input control parameters have the following significance:
- 	\fIstart\fP:		The buffer index at which to start
- 			searching for a survey data record.
-
-The returned values are:
- 	\fIid\fP:		The buffer index of the first survey data record at or after \fIstart\fP.
- 	\fItime_i\fP:		time of current ping
- 			\fItime_i\fP[0]: year
- 			\fItime_i\fP[1]: month
- 			\fItime_i\fP[2]: day
- 			\fItime_i\fP[3]: hour
- 			\fItime_i\fP[4]: minute
- 			\fItime_i\fP[5]: second
- 			\fItime_i\fP[6]: microsecond
- 	\fItime_d\fP:		time of current ping in seconds
- 			since 1/1/70 00:00:00
- 	\fInavlon\fP:		longitude
- 	\fInavlat\fP:		latitude
- 	\fIspeed\fP:		ship speed in km/s
- 	\fIheading\fP:		ship heading in degrees
- 	\fIroll\fP:		ship roll in degrees
- 	\fIpitch\fP:		ship pitch in degrees
- 	\fIheave\fP:		ship heave in meters
-
-A status value indicating success or failure is returned; the error value
-argument \fIerror\fP passes more detailed information about
-failures. The most common error occurs when no more survey data
-records remain to be found in the buffer; in this case,
-\fIerror\fP = \-14.
-
-\---------------------------------------------------------
-.br
-int \fBmb_buffer_extract_nav\fP(
- 		int \fIverbose\fP,
- 		char \fI*buff_ptr\fP,
- 		char \fI*mbio_ptr\fP,
- 		int \fIid\fP,
- 		int \fI*kind\fP,
- 		int \fItime_i[7]\fP,
- 		double \fI*time_d\fP,
- 		double \fI*navlon\fP,
- 		double \fI*navlat\fP,
- 		double \fI*speed\fP,
- 		double \fI*heading\fP,
- 		double \fI*draft\fP,
- 		double \fI*roll\fP,
- 		double \fI*pitch\fP,
- 		double \fI*heave\fP,
- 		int \fI*error\fP);
-
-The function \fBmb_buffer_extract_nav\fP extracts and returns
-a subset of the data in a buffer record.
-The \fIverbose\fP
-value controls the standard error output verbosity of the function.
-The buffer record is specified with the
-buffer index \fIid\fP. The data returned consists of navigation
-and vertical reference sensor data.
-
-The input control parameters have the following significance:
- 	\fIid\fP:		The buffer index of the data
- 			record to extract.
-
-The returned values are:
- 	\fIkind\fP:		kind of data record extracted
- 					1	survey data
- 					2	comment
- 					>=3	other data that cannot
- 						be passed by \fBmb_buffer_extract_nav\fP
- 	\fItime_i\fP:		time of current ping
- 			\fItime_i\fP[0]: year
- 			\fItime_i\fP[1]: month
- 			\fItime_i\fP[2]: day
- 			\fItime_i\fP[3]: hour
- 			\fItime_i\fP[4]: minute
- 			\fItime_i\fP[5]: second
- 			\fItime_i\fP[6]: microsecond
- 	\fItime_d\fP:		time of current ping in seconds
- 			since 1/1/70 00:00:00
- 	\fInavlon\fP:		longitude
- 	\fInavlat\fP:		latitude
- 	\fIspeed\fP:		ship speed in km/s
- 	\fIheading\fP:		ship heading in degrees
- 	\fIroll\fP:		ship roll in degrees
- 	\fIpitch\fP:		ship pitch in degrees
- 	\fIheave\fP:		ship heave in meters
-
-A status value indicating success or failure is returned; the error value
-argument \fIerror\fP passes more detailed information about
-extract failures.
-
-\---------------------------------------------------------
-.br
-int \fBmb_buffer_insert_nav\fP(
- 		int \fIverbose\fP,
- 		char \fI*buff_ptr\fP,
- 		char \fI*mbio_ptr\fP,
- 		int \fIid\fP,
- 		int \fItime_i[7]\fP,
- 		double \fItime_d\fP,
- 		double \fInavlon\fP,
- 		double \fInavlat\fP,
- 		double \fIspeed\fP,
- 		double \fIheading\fP,
- 		double \fIdraft\fP,
- 		double \fIroll\fP,
- 		double \fIpitch\fP,
- 		double \fIheave\fP,
- 		int \fI*error\fP);
-
-The function \fBmb_buffer_insert_nav\fP inserts navigation
-and vertical reference sensor data into a
-buffer record, replacing a subset of the original values.
-The \fIverbose\fP
-value controls the standard error output verbosity of the function.
-The buffer record is specified with the
-buffer index \fIid\fP.
-
-The input control parameters have the following significance:
- 	\fIid\fP:		The buffer index of the data
- 			record to insert.
-
-The returned values are:
- 	\fIkind\fP:		kind of data record inserted
- 					1	survey data
- 					2	comment
- 					>=3	other data that cannot
- 						be passed by \fBmb_buffer_insert_nav\fP
- 	\fItime_i\fP:		time of current ping
- 			\fItime_i\fP[0]: year
- 			\fItime_i\fP[1]: month
- 			\fItime_i\fP[2]: day
- 			\fItime_i\fP[3]: hour
- 			\fItime_i\fP[4]: minute
- 			\fItime_i\fP[5]: second
- 			\fItime_i\fP[6]: microsecond
- 	\fItime_d\fP:		time of current ping in seconds
- 			since 1/1/70 00:00:00
- 	\fInavlon\fP:		longitude
- 	\fInavlat\fP:		latitude
- 	\fIspeed\fP:		ship speed in km/s
- 	\fIheading\fP:		ship heading in degrees
- 	\fIroll\fP:		ship roll in degrees
- 	\fIpitch\fP:		ship pitch in degrees
- 	\fIheave\fP:		ship heave in meters
-
-A status value indicating success or failure is returned; the error value
-argument \fIerror\fP passes more detailed information about
-insert failures.
-
-\---------------------------------------------------------
-.br
-int \fBmb_buffer_get_ptr\fP(
- 		int \fIverbose\fP,
- 		char \fI*buff_ptr\fP,
- 		char \fI*mbio_ptr\fP,
- 		int \fIid\fP,
- 		char \fI**store_ptr\fP,
- 		int \fI*error\fP);
-
-The function \fBmb_buffer_get_ptr\fP returns
-a pointer to the data structure in a buffer record.
-The \fIverbose\fP
-value controls the standard error output verbosity of the function.
-The buffer record is specified with the
-buffer index \fIid\fP. The data returned consists of a pointer
-to the data structure stored in the specified buffer record.
-
-The input control parameters have the following significance:
- 	\fIid\fP:		The buffer index of the data
- 				record to locate.
-
-The return values are:
- 	\fI*store_ptr\fP:	pointer to data in specified
- 				buffer record
- 	\fIerror\fP:		error value
-
-A status value indicating success or failure is returned; the error value
-argument \fIerror\fP passes more detailed information about
-buffer failures.
-
-.SH MISCELLANEOUS FUNCTIONS
-
-int \fBmb_defaults\fP(
- 		int \fIverbose\fP,
- 		int \fI*format\fP,
- 		int \fI*pings\fP,
- 		int \fI*lonflip\fP,
- 		double \fIbounds[4]\fP,
- 		int \fI*btime_i\fP,
- 		int \fI*etime_i\fP,
- 		double \fI*speedmin\fP,
- 		double \fI*timegap\fP);
-
-The function \fBmb_defaults\fP provides default values of control
-parameters used by some of the \fBMBIO\fP functions. The \fIverbose\fP
-value controls the standard error output verbosity of the function.
-The other parameters
-are set by the function; the meaning of these parameters is discussed
-in the listings of the functions
-\fBmb_read_init\fP and \fBmb_write_init\fP.
-If an .mbio_defaults file exists in the user's home directory,
-the lonflip and timegap defaults are read from this file.
-Otherwise, the values are set as:
- 	\fI*lonflip\fP = 0
- 	\fI*timegap\fP = 1
-.br
-The other values are simply set as:
- 	\fI*format\fP = 0
- 	\fI*pings\fP = 1
- 	\fIbounds[0]\fP = \-360.
- 	\fIbounds[1]\fP = 360.
- 	\fIbounds[2]\fP = \-90.
- 	\fIbounds[3]\fP = 90.
- 	\fIbtime_i[0]\fP = 1962;
- 	\fIbtime_i[1]\fP = 2;
- 	\fIbtime_i[2]\fP = 21;
- 	\fIbtime_i[3]\fP = 10;
- 	\fIbtime_i[4]\fP = 30;
- 	\fIbtime_i[5]\fP = 0;
- 	\fIbtime_i[6]\fP = 0;
- 	\fIetime_i[0]\fP = 2062;
- 	\fIetime_i[1]\fP = 2;
- 	\fIetime_i[2]\fP = 21;
- 	\fIetime_i[3]\fP = 10;
- 	\fIetime_i[4]\fP = 30;
- 	\fIetime_i[5]\fP = 0;
- 	\fIetime_i[6]\fP = 0;
- 	\fI*speedmin\fP = 0.0
-
-A status value is returned to
-indicate success or failure.
-
-\---------------------------------------------------------
-.br
-int \fBmb_env\fP(
- 		int \fIverbose\fP,
- 		char \fI*psdisplay\fP,
- 		char \fI*imgdisplay\fP,
- 		char \fI*mbproject\fP);
-
-The function \fBmb_env\fP provides default values of Postscript
-and image display programs invoked by some \fBMB-System\fP
-programs and macros, and a default value for a working project
-name that will be used by future applications. The \fIverbose\fP
-value controls the standard error output verbosity of the function.
-If an .mbio_defaults file exists in the user's home directory,
-the \fI*psdisplay\fP, \fI*imgdisplay\fP, \fI*mbproject\fP
-defaults are read from this file.
-Otherwise, the values are set as:
- 	\fIpsdisplay\fP =  "xpsview" (IRIX OS)
- 	                   "pageview" (Solaris OS)
- 	                   "gv" (other OS)
- 	                   "ghostview" (other OS)
- 	\fIimgdisplay\fP = "gimp" (Linux OS)
- 	                   "xv" (other than Linux OS)
- 	\fImbproject\fP =  "none"
-
-\---------------------------------------------------------
-.br
-int \fBmb_format\fP(
- 		int \fIverbose\fP,
- 		int \fI*format\fP,
- 		int \fI*error\fP);
-
-Given the format identifier \fIformat\fP, \fBmb_format\fP checks if the
-format is valid.  If the format id corresponds to a value used in
-previous (<4.00) versions of \fBMB-System\fP, then the format value
-will be aliased to the current corresponding value.
-
-The return values are:
-  	\fIformat\fP:		\fBMBIO\fP format id
-  	\fIerror\fP:		error value
-
-A status value indicating success or failure is returned; the error value
-argument \fIerror\fP passes more detailed information about failures.
-
-\---------------------------------------------------------
-.br
-int \fBmb_format_register\fP(
- 		int \fIverbose\fP,
- 		int \fI*format\fP,
- 		char \fI*mbio_ptr\fP,
- 		int \fI*error\fP);
-
-The function \fBmb_format_register\fP is called by \fBmb_read_init\fP
-and \fBmb_write_init\fP and serves to load format specific
-parameters and function parameters into the \fBMBIO\fP
-control structure pointed to by \fI*error\fP. The format id
-\fI*format\fP is first checked for validity. In some cases,
-formerly valid but now obsolete format id values are mapped
-to current values.
-
-The input values are:
- 	\fI*format\fP:		\fBMBIO\fP format id
- 	\fI*mbio_ptr\fP:	pointer to data in specified
- 				buffer record
-
-The return values are:
-  	\fIerror\fP:		error value
-
-A status value indicating success or failure is returned; the error value
-argument \fIerror\fP passes more detailed information about failures.
-
-\---------------------------------------------------------
-.br
-int \fBmb_format_info\fP(
- 		int \fIverbose\fP,
- 		int \fI*format\fP,
- 		int \fI*system\fP,
- 		int \fI*beams_bath_max\fP,
- 		int \fI*beams_amp_max\fP,
- 		int \fI*pixels_ss_max\fP,
- 		char \fI*format_name\fP,
- 		char \fI*system_name\fP,
- 		char \fI*format_description\fP,
- 		int \fI*numfile\fP,
- 		int \fI*filetype\fP,
- 		int \fI*variable_beams\fP,
- 		int \fI*traveltime\fP,
- 		int \fI*beam_flagging\fP,
- 		int \fI*nav_source\fP,
- 		int \fI*heading_source\fP,
- 		int \fI*vru_source\fP,
- 		double \fI*beamwidth_xtrack\fP,
- 		double \fI*beamwidth_ltrack\fP,
- 		int \fI*error\fP);
-
-The function \fBmb_format_info\fP returns a variety of
-data format specific parameters. The format id
-\fI*format\fP is first checked for validity. In some cases,
-formerly valid but now obsolete format id values are mapped
-to current values.
-
-The input values are:
- 	\fI*format\fP:		\fBMBIO\fP format id
-
-The return values are:
- 	\fI*format\fP:		\fBMBIO\fP format id
- 	\fI*system\fP:		\fBMBIO\fP sonar system id
- 	\fI*beams_bath_max\fP:	maximum number of bathymetry beams
- 	\fI*beams_amp_max\fP:	maximum number of amplitude beams
- 	\fI*pixels_ss_max\fP:	maximum number of sidescan pixels
- 	\fI*format_name\fP:	\fBMBIO\fP format name
- 	\fI*system_name\fP:	\fBMBIO\fP sonar system name
- 	\fI*format_description\fP:	\fBMBIO\fP format description
- 	\fI*numfile\fP:		number of parallel data files used in format
- 	\fI*filetype\fP:	type of data files
- 	\fI*variable_beams\fP:	number of beams can vary [boolean]
- 	\fI*traveltime\fP:	travel time data available [boolean]
- 	\fI*beam_flagging\fP:	beam flagging supported [boolean]
- 	\fI*nav_source\fP:	kind of data records containing navigation
- 	\fI*heading_source\fP:	kind of data records containing
- 				heading
- 	\fI*vru_source\fP:	kind of data records containing
- 				attitude
- 	\fI*beamwidth_xtrack\fP:	typical athwartships beam
- 					width [degrees]
- 	\fI*beamwidth_ltrack\fP:	typical alongtrack beam
- 					width [degrees]
-  	\fIerror\fP:		error value
-
-A status value indicating success or failure is returned; the error value
-argument \fIerror\fP passes more detailed information about failures.
-
-\---------------------------------------------------------
-.br
-int \fBmb_format_system\fP(
- 		int \fIverbose\fP,
- 		int \fI*format\fP,
- 		int \fI*system\fP,
- 		int \fI*error\fP);
-
-The function \fBmb_format_system\fP returns
-the \fBMBIO\fP sonar system id. The format id
-\fI*format\fP is first checked for validity. In some cases,
-formerly valid but now oattintbsolete format id values are mapped
-to current values. The input values are:
- 	\fI*format\fP:		\fBMBIO\fP format id
-.br
-The return values are:
- 	\fI*format\fP:		\fBMBIO\fP format id
- 	\fI*system\fP:		\fBMBIO\fP sonar system id
-   	\fIerror\fP:		error value
-.br
-A status value indicating success or failure is returned; the error value
-argument \fIerror\fP passes more detailed information about failures.
-
-\---------------------------------------------------------
-.br
-int \fBmb_format_description\fP(
- 		int \fIverbose\fP,
- 		int \fI*format\fP,
- 		char \fI*description\fP,
- 		int \fI*error\fP);
-
-The function \fBmb_format_description\fP returns
-a short description of the format in the string
-\fI*description\fP. The format id
-\fI*format\fP is first checked for validity. In some cases,
-formerly valid but now obsolete format id values are mapped
-to current values. The input values are:
- 	\fI*format\fP:		\fBMBIO\fP format id
-.br
-The return values are:
- 	\fI*format\fP:		\fBMBIO\fP format id
- 	\fI*format_description\fP:	\fBMBIO\fP format description
-   	\fIerror\fP:		error value
-.br
-A status value indicating success or failure is returned; the error value
-argument \fIerror\fP passes more detailed information about failures.
-
-\---------------------------------------------------------
-.br
-int \fBmb_format_dimensions\fP(
- 		int \fIverbose\fP,
- 		int \fI*format\fP,
- 		int \fI*beams_bath_max\fP,
- 		int \fI*beams_amp_max\fP,
- 		int \fI*pixels_ss_max\fP,
- 		int \fI*error\fP);
-
-The function \fBmb_format_dimensions\fP returns
-the maximum numbers of beams and pixels associated
-with a particular data format. The format id
-\fI*format\fP is first checked for validity. In some cases,
-formerly valid but now obsolete format id values are mapped
-to current values. The input values are:
- 	\fI*format\fP:		\fBMBIO\fP format id
-.br
-The return values are:
- 	\fI*format\fP:		\fBMBIO\fP format id
- 	\fI*beams_bath_max\fP:	maximum number of bathymetry beams
- 	\fI*beams_amp_max\fP:	maximum number of amplitude beams
- 	\fI*pixels_ss_max\fP:	maximum number of sidescan pixels
-   	\fIerror\fP:		error value
-.br
-A status value indicating success or failure is returned; the error value
-argument \fIerror\fP passes more detailed information about failures.
-
-\---------------------------------------------------------
-.br
-int \fBmb_format_flags\fP(
- 		int \fIverbose\fP,
- 		int \fI*format\fP,
- 		int \fI*variable_beams\fP,
- 		int \fI*traveltime\fP,
- 		int \fI*beam_flagging\fP,
- 		int \fI*error\fP);
-
-The function \fBmb_format_flags\fP returns
-flags indicating certain characteristics of the
-specified data format. The format id
-\fI*format\fP is first checked for validity. In some cases,
-formerly valid but now obsolete format id values are mapped
-to current values. The input values are:
- 	\fI*format\fP:		\fBMBIO\fP format id
-.br
-The return values are:
- 	\fI*format\fP:		\fBMBIO\fP format id
- 	\fI*variable_beams\fP:	number of beams can vary [boolean]
- 	\fI*traveltime\fP:	travel time data available [boolean]
- 	\fI*beam_flagging\fP:	beam flagging supported [boolean]
-   	\fIerror\fP:		error value
-.br
-A status value indicating success or failure is returned; the error value
-argument \fIerror\fP passes more detailed information about failures.
-
-\---------------------------------------------------------
-.br
-int \fBmb_format_source\fP(
- 		int \fIverbose\fP,
- 		int \fI*format\fP,
- 		int \fI*nav_source\fP,
- 		int \fI*heading_source\fP,
- 		int \fI*vru_source\fP,
- 		int \fI*error\fP);
-
-The function \fBmb_format_source\fP returns
-flags indicating what kinds of data records contain
-navigation, heading, and attitude values in the
-specified data format. The format id
-\fI*format\fP is first checked for validity. In some cases,
-formerly valid but now obsolete format id values are mapped
-to current values. The input values are:
- 	\fI*format\fP:		\fBMBIO\fP format id
-.br
-The return values are:
- 	\fI*format\fP:		\fBMBIO\fP format id
- 	\fI*nav_source\fP:	kind of data records containing
- 				navigation
- 	\fI*heading_source\fP:	kind of data records containing
- 				heading
- 	\fI*vru_source\fP:	kind of data records containing
- 				attitude
-   	\fIerror\fP:		error value
-.br
-A status value indicating success or failure is returned; the error value
-argument \fIerror\fP passes more detailed information about failures.
-
-\---------------------------------------------------------
-.br
-int \fBmb_format_beamwidth\fP(
- 		int \fIverbose\fP,
- 		int \fI*format\fP,
- 		double \fI*beamwidth_xtrack\fP,
- 		double \fI*beamwidth_ltrack\fP,
- 		int \fI*error\fP);
-
-The function \fBmb_format_beamwidth\fP returns
-typical, upper bound values for athwartships and alongtrack
-beam widths. The format id
-\fI*format\fP is first checked for validity. In some cases,
-formerly valid but now obsolete format id values are mapped
-to current values. The input values are:
- 	\fI*format\fP:		\fBMBIO\fP format id
-.br
-The return values are:
- 	\fI*format\fP:		\fBMBIO\fP format id
- 	\fI*beamwidth_xtrack\fP:	typical athwartships beam
- 					width [degrees]
- 	\fI*beamwidth_ltrack\fP:	typical alongtrack beam
- 					width [degrees]
-   	\fIerror\fP:		error value
-.br
-A status value indicating success or failure is returned; the error value
-argument \fIerror\fP passes more detailed information about failures.
-
-\---------------------------------------------------------
-.br
-int \fBmb_datalist_open\fP(
- 		int \fIverbose\fP,
- 		char \fI**datalist\fP,
- 		char \fI*path\fP,
- 		int \fIlook_processed\fP,
- 		int \fI*error\fP);
-
-The function \fBmb_datalist_open\fP initializes reading
-from a datalist tree. The string \fI*path\fP is the
-path to the top level datalist file to be opened.
-The value \fIlook_processed\fP indicates whether the datalist
-parsing should look for or ignore processed data files
-(see the \fBmbprocess\fP and \fBmbdatalist\fP manual pages).
-The input values are:
- 	\fI*path\fP:		datalist file to be opened
- 	\fIlook_processed\fP:	processed file behavior
- 					0 : unset
- 					1 : ignore processed files
- 					2 : return processed files
-.br
-The return values are:
- 	\fI**datalist\fP:	pointer to datalist
- 				structure
-   	\fIerror\fP:		error value
-.br
-A status value indicating success or failure is returned; the error value
-argument \fIerror\fP passes more detailed information about failures.
-
-\---------------------------------------------------------
-.br
-int \fBmb_datalist_read\fP(
- 		int \fIverbose\fP,
- 		char \fI*datalist\fP,
- 		char \fI*path\fP,
- 		int \fI*format\fP,
- 		double \fI*weight\fP,
- 		int \fI*error\fP);
-
-The function \fBmb_datalist_read\fP reads
-from a datalist tree, attempting to return the path
-to the next valid swath data file, the corresponding data
-format id, and a gridding weight
-(see the \fBmbprocess\fP and \fBmbdatalist\fP manual pages).
-Information about the
-datalist tree is embedded in a data structure pointed to
-by \fI*datalist\fP. The input values are:
- 	\fI*datalist\fP:	pointer to datalist
- 				structure
-.br
-The return values are:
- 	\fI*path\fP:		swath data file
- 	\fI*format\fP:		\fBMBIO\fP format id
- 	\fI*weight\fP:		\fBmbgrid\fP gridding weight
-   	\fIerror\fP:		error value
-.br
-A status value indicating success or failure is returned; the error value
-argument \fIerror\fP passes more detailed information about failures.
-
-\---------------------------------------------------------
-.br
-int \fBmb_datalist_close\fP(
- 		int \fIverbose\fP,
- 		char \fI**datalist\fP,
- 		int \fI*error\fP);
-
-The function \fBmb_datalist_close\fP closes an
-open datalist tree, and deallocates the data structure pointed to
-by \fI*datalist\fP. The input values are:
- 	\fI*datalist\fP:	pointer to datalist
- 				structure
-.br
-The return values are:
-   	\fIerror\fP:		error value
-.br
-A status value indicating success or failure is returned; the error value
-argument \fIerror\fP passes more detailed information about failures.
-
-\---------------------------------------------------------
-.br
-int \fBmb_alloc\fP(
- 		int \fIverbose\fP,
- 		char \fI*mbio_ptr\fP,
- 		char \fI**store_ptr\fP,
- 		int \fI*error\fP);
-
-The function \fBmb_alloc\fP allocates a data structure
-for internal storage of swath sonar data
-and returns a pointer to this structure in \fI*store_ptr\fP.
-The data structure is specific to the data format identified
-in the \fBMBIO\fP data structure pointed to by \fI*mbio_ptr\fP.
-The input values are:
- 	\fI*mbio_ptr\fP:	pointer to \fBMBIO\fP structure
-.br
-The return values are:
- 	\fI**store_ptr\fP:	pointer to storage data
- 				structure
-   	\fIerror\fP:		error value
-.br
-A status value indicating success or failure is returned; the error value
-argument \fIerror\fP passes more detailed information about failures.
-
-\---------------------------------------------------------
-.br
-int \fBmb_deall\fP(
- 		int \fIverbose\fP,
- 		char \fI*mbio_ptr\fP,
- 		char \fI**store_ptr\fP,
- 		int \fI*error\fP);
-
-The function \fBmb_deall\fP deallocates a format specific
-swath sonar data structure pointed to by \fI*store_ptr\fP.
-The input values are:
- 	\fI*mbio_ptr\fP:	pointer to \fBMBIO\fP structure
- 	\fI*store_ptr\fP:	pointer to storage data
- 				structure
-.br
-The return values are:
-   	\fIerror\fP:		error value
-.br
-A status value indicating success or failure is returned; the error value
-argument \fIerror\fP passes more detailed information about failures.
-
-\---------------------------------------------------------
-.br
-int \fBmb_error\fP(
- 		int \fIerror\fP,
- 		int \fIerror\fP,
- 		char \fI**message\fP);
-
-Given the error value \fIerror\fP, \fBmb_format_inf\fP returns a
-short error message in the string **\fImessage\fP. The \fIverbose\fP
-value controls the standard error output verbosity of the function.  The return
-status value signals success if \fIformat\fP is valid and failure otherwise.
-
-\---------------------------------------------------------
-.br
-int \fBmb_navint_add\fP(
- 		int \fIverbose\fP,
- 		char \fI*mbio_ptr\fP,
- 		double \fItime_d\fP,
- 		double \fIlon\fP,
- 		double \fIlat\fP,
- 		int \fI*error\fP);
-
-The function \fBmb_navint_add\fP adds a navigation fix
-to a circular buffer of navigation values maintained in
-the \fBMBIO\fP data structure pointed to by \fB*mbio_ptr\fP.
-This buffer is used to interpolate navigation for data
-formats where the navigation is asynchronous (where navigation
-and survey pings come in different data records).
-The input values are:
- 	\fI*mbio_ptr\fP:	pointer to \fBMBIO\fP structure
- 	\fItime_d\fP:		time of navigation fix in seconds
- 			since 1/1/70 00:00:00
- 	\fIlon\fP:		longitude (degrees)
- 	\fIlat\fP:		latitude (degrees)
-.br
-The return values are:
-   	\fIerror\fP:		error value
-.br
-A status value indicating success or failure is returned; the error value
-argument \fIerror\fP passes more detailed information about failures.
-
-\---------------------------------------------------------
-.br
-int \fBmb_navint_interp\fP(
- 		int \fIverbose\fP,
- 		char \fI*mbio_ptr\fP,
- 		double \fItime_d\fP,
- 		double \fIheading\fP,
- 		double \fIrawspeed\fP,
- 		double \fI*lon\fP,
- 		double \fI*lat\fP,
- 		double \fI*speed\fP,
- 		int \fI*error\fP);
-
-The function \fBmb_navint_interp\fP interpolates navigation to
-the time \fItime_d\fP using
-a circular buffer of navigation values maintained in
-the \fBMBIO\fP data structure pointed to by \fB*mbio_ptr\fP.
-This buffer is used to interpolate navigation for data
-formats where the navigation is asynchronous (where navigation
-and survey pings come in different data records).
-The input values are:
- 	\fI*mbio_ptr\fP:	pointer to \fBMBIO\fP structure
- 	\fItime_d\fP:		time of current ping in seconds
- 			since 1/1/70 00:00:00
- 	\fIheading\fP:		heading in degrees
- 	\fIrawspeed\fP:		speed in km/hr
- 				(zero if not known)
-.br
-The return values are:
- 	\fI*lon\fP:		longitude (degrees)
- 	\fI*lat\fP:		latitude (degrees)
- 	\fI*speed\fP:		speed made good in km/hr
-   	\fIerror\fP:		error value
-.br
-A status value indicating success or failure is returned; the error value
-argument \fIerror\fP passes more detailed information about failures.
-
-\---------------------------------------------------------
-.br
-int \fBmb_attint_add\fP(
- 		int \fIverbose\fP,
- 		char \fI*mbio_ptr\fP,
- 		double \fItime_d\fP,
- 		double \fIheave\fP,
- 		double \fIroll\fP,
- 		double \fIpitch\fP,
- 		int \fI*error\fP);
-
-The function \fBmb_attint_add\fP adds an attitude
-(heave, roll, pitch) data point
-to a circular buffer of attitude values maintained in
-the \fBMBIO\fP data structure pointed to by \fB*mbio_ptr\fP.
-This buffer is used to interpolate attitude for data
-formats where the attitude is asynchronous (where attitude
-and survey pings come in different data records).
-The input values are:
- 	\fI*mbio_ptr\fP:	pointer to \fBMBIO\fP structure
- 	\fItime_d\fP:		time of attitude in seconds
- 			since 1/1/70 00:00:00
- 	\fIheave\fP:		heave (meters, up +)
- 	\fIroll\fP:		roll (degrees, starboard up +)
- 	\fIpitch\fP:		pitch (degrees, forward up +)
-.br
-The return values are:
-   	\fIerror\fP:		error value
-.br
-A status value indicating success or failure is returned; the error value
-argument \fIerror\fP passes more detailed information about failures.
-
-\---------------------------------------------------------
-.br
-int \fBmb_attint_interp\fP(
- 		int \fIverbose\fP,
- 		char \fI*mbio_ptr\fP,
- 		double \fItime_d\fP,
- 		double \fI*heave\fP,
- 		double \fI*roll\fP,
- 		double \fI*pitch\fP,
- 		int \fI*error\fP);
-
-The function \fBmb_attint_interp\fP interpolates attitude
-(heave, roll, pitch) data to
-the time \fItime_d\fP using
-a circular buffer of attitude values maintained in
-the \fBMBIO\fP data structure pointed to by \fB*mbio_ptr\fP.
-This buffer is used to interpolate attitude for data
-formats where the attitude is asynchronous (where attitude
-and survey pings come in different data records).
-The input values are:
- 	\fI*mbio_ptr\fP:	pointer to \fBMBIO\fP structure
- 	\fItime_d\fP:		time of current ping in seconds
- 			since 1/1/70 00:00:00
-.br
-The return values are:
- 	\fI*heave\fP:		heave (meters, up +)
- 	\fI*roll\fP:		roll (degrees, starboard up +)
- 	\fI*pitch\fP:		pitch (degrees, forward up +)
-   	\fIerror\fP:		error value
-.br
-A status value indicating success or failure is returned; the error value
-argument \fIerror\fP passes more detailed information about failures.
-
-\---------------------------------------------------------
-.br
-int \fBmb_hedint_add\fP(
- 		int \fIverbose\fP,
- 		char \fI*mbio_ptr\fP,
- 		double \fItime_d\fP,
- 		double \fIheading\fP,
- 		int \fI*error\fP);
-
-The function \fBmb_hedint_add\fP adds a heading point
-to a circular buffer of heading values maintained in
-the \fBMBIO\fP data structure pointed to by \fB*mbio_ptr\fP.
-This buffer is used to interpolate heading for data
-formats where the heading is asynchronous (where heading
-and survey pings come in different data records).
-The input values are:
- 	\fI*mbio_ptr\fP:	pointer to \fBMBIO\fP structure
- 	\fItime_d\fP:		time of heading value in seconds
- 			since 1/1/70 00:00:00
- 	\fIheading\fP:		heading (degrees)
-.br
-The return values are:
-   	\fIerror\fP:		error value
-.br
-A status value indicating success or failure is returned; the error value
-argument \fIerror\fP passes more detailed information about failures.
-
-\---------------------------------------------------------
-.br
-int \fBmb_hedint_interp\fP(
- 		int \fIverbose\fP,
- 		char \fI*mbio_ptr\fP,
- 		double \fItime_d\fP,
- 		double \fI*heading\fP,
- 		int \fI*error\fP);
-
-The function \fBmb_hedint_interp\fP interpolates heading to
-the time \fItime_d\fP using
-a circular buffer of heading values maintained in
-the \fBMBIO\fP data structure pointed to by \fB*mbio_ptr\fP.
-This buffer is used to interpolate heading for data
-formats where the heading is asynchronous (where heading
-and survey pings come in different data records).
-The input values are:
- 	\fI*mbio_ptr\fP:	pointer to \fBMBIO\fP structure
- 	\fItime_d\fP:		time of current ping in seconds
- 			since 1/1/70 00:00:00
-.br
-The return values are:
- 	\fI*heading\fP:		heading in degrees
-   	\fIerror\fP:		error value
-.br
-A status value indicating success or failure is returned; the error value
-argument \fIerror\fP passes more detailed information about failures.
-
-\---------------------------------------------------------
-.br
-int \fBmb_get_double\fP(
- 		double \fI*value\fP,
- 		char \fI*str\fP,
- 		int \fInchar\fP);
-
-The function \fBmb_get_double\fP parses the
-first \fInchar\fP characters of the string
-\fI*str\fP for a floating point value, storing
-this value as a double in \fI*value\fP.
-
-\---------------------------------------------------------
-.br
-int \fBmb_get_int\fP(
- 		int \fI*value\fP,
- 		char \fI*str\fP,
- 		int \fInchar\fP);
-
-The function \fBmb_get_int\fP parses the
-first \fInchar\fP characters of the string
-\fI*str\fP for an integer value, storing
-this value as a int in \fI*value\fP.
-
-\---------------------------------------------------------
-.br
-int \fBmb_get_binary_short\fP(
- 		int \fIswapped\fP,
- 		void \fI*buffer\fP,
- 		short \fI*value\fP);
-
-The function \fBmb_get_binary_short\fP extracts
-a short int value from the first two bytes pointed to
-by \fI*buffer\fP. If the boolean \fIswapped\fP is true,
-the byte order of \fI*value\fP is swapped.
-
-\---------------------------------------------------------
-.br
-int \fBmb_get_binary_int\fP(
- 		int \fIswapped\fP,
- 		void \fI*buffer\fP,
- 		int \fI*value\fP);
-
-The function \fBmb_get_binary_int\fP extracts
-an int value from the first four bytes pointed to
-by \fI*buffer\fP. If the boolean \fIswapped\fP is true,
-the byte order of \fI*value\fP is swapped.
-
-\---------------------------------------------------------
-.br
-int \fBmb_get_binary_float\fP(
- 		int \fIswapped\fP,
- 		void \fI*buffer\fP,
- 		float *value\fP);
-
-The function \fBmb_get_binary_float\fP extracts
-a float value from the first four bytes pointed to
-by \fI*buffer\fP. If the boolean \fIswapped\fP is true,
-the byte order of \fI*value\fP is swapped.
-
-\---------------------------------------------------------
-.br
-int \fBmb_get_binary_double\fP(
- 		int \fIswapped\fP,
- 		void \fI*buffer\fP,
- 		double \fI*value\fP);
-
-The function \fBmb_get_binary_double\fP extracts
-a double value from the first eight bytes pointed to
-by \fI*buffer\fP. If the boolean \fIswapped\fP is true,
-the byte order of \fI*value\fP is swapped.
-
-\---------------------------------------------------------
-.br
-int \fBmb_put_binary_short\fP(
- 		int \fIswapped\fP,
- 		short value\fP,
- 		void \fI*buffer\fP);
-
-The function \fBmb_put_binary_short\fP inserts
-a short int value into the first two bytes pointed to
-by \fI*buffer\fP. If the boolean \fIswapped\fP is true,
-the byte order of \fIvalue\fP is swapped.
-
-\---------------------------------------------------------
-.br
-int \fBmb_put_binary_int\fP(
- 		int \fIswapped\fP,
- 		int \fIvalue\fP,
- 		void \fI*buffer\fP);
-
-The function \fBmb_put_binary_int\fP inserts
-an int value into the first four bytes pointed to
-by \fI*buffer\fP. If the boolean \fIswapped\fP is true,
-the byte order of \fIvalue\fP is swapped.
-
-\---------------------------------------------------------
-.br
-int \fBmb_put_binary_float\fP(
- 		int \fIswapped\fP,
- 		float value\fP,
- 		void \fI*buffer\fP);
-
-The function \fBmb_put_binary_float\fP inserts
-a float value into the first four bytes pointed to
-by \fI*buffer\fP. If the boolean \fIswapped\fP is true,
-the byte order of \fIvalue\fP is swapped.
-
-\---------------------------------------------------------
-.br
-int \fBmb_put_binary_double\fP(
- 		int \fIswapped\fP,
- 		double \fIvalue\fP,
- 		void \fI*buffer\fP);
-
-The function \fBmb_put_binary_double\fP inserts
-a double value into the first eight bytes pointed to
-by \fI*buffer\fP. If the boolean \fIswapped\fP is true,
-the byte order of \fIvalue\fP is swapped.
-
-\---------------------------------------------------------
-.br
-int \fBmb_get_bounds\fP(
- 		char \fI*text\fP,
- 		double \fI*bounds\fP);
-
-The function \fBmb_get_bounds\fP parses the string
-\fI*text\fP and extracts geographic bounds of a
-rectangular region in the form:
- 		\fIbounds[0]\fP: minimum longitude
- 		\fIbounds[1]\fP: maximum longitude
- 		\fIbounds[2]\fP: minimum latitude
- 		\fIbounds[3]\fP: maximum latitude
-.br
-where \fI*text\fP is in the standard \fBGMT\fP bounds form.
-The longitude and latitude values in \fI*text\fP
-should separated by a '/' character, and individual
-values may be represented in decimal degrees or in
-"dd:mm:ss" form (dd=degrees, mm=minutes, ss=seconds).
-
-double \fBmb_ddmmss_to_degree\fP(
- 		char \fI*text\fP);
-
-The function \fBmb_ddmmss_to_degree\fP parses the string
-\fI*text\fP and extracts a decimal longitude or latitude
-value from a "dd:mm:ss" (dd=degrees, mm=minutes, ss=seconds)
-value.
-
-\---------------------------------------------------------
-.br
-int \fBmb_takeoff_to_rollpitch\fP(
- 		int \fIverbose\fP,
- 		double \fItheta\fP,
- 		double \fIphi\fP,
- 		double \fI*alpha\fP,
- 		double \fI*beta\fP,
- 		int \fI*error\fP);
-
-The function \fBmb_takeoff_to_rollpitch\fP
-translates angles from the "takeoff" coordinate
-reference frame to the "rollpitch" coordinate system.
-See the discussion of coordinate systems below.
-
-\---------------------------------------------------------
-.br
-int \fBmb_rollpitch_to_takeoff\fP(
- 		int \fIverbose\fP,
- 		double \fIalpha\fP,
- 		double \fIbeta\fP,
- 		double \fI*theta\fP,
- 		double \fI*phi\fP,
- 		int \fI*error\fP);
-
-The function \fBmb_rollpitch_to_takeoff\fP
-translates angles from the "rollpitch" coordinate
-reference frame to the "takeoff" coordinate system.
-See the discussion of coordinate systems below.
-
-\---------------------------------------------------------
-.br
-int \fBmb_double_compare\fP(double \fI*a\fP,
- 		double \fI*b\fP);
-
-The function \fBmb_double_compare\fP
-is used with the \fBqsort\fP function.
-This function returns 1 if a > b and \-1 if a <= b.
-
-\---------------------------------------------------------
-.br
-int \fBmb_int_compare\fP(
- 		int \fI*a\fP,
- 		int \fI*b\fP);
-
-The function \fBmb_int_compare\fP
-is used with the \fBqsort\fP function.
-This function returns 1 if a > b and \-1 if a <= b.
-
-.SH COORDINATE SYSTEMS USED IN MB-SYSTEM
-I. Introduction
-.br
-The coordinate systems described below are used
-within \fBMB-System\fP for calculations involving
-the location in space of depth, amplitude, or
-sidescan data. In all cases the origin of the
-coordinate system is at the center of the sonar
-transducers.
-
-II. Cartesian Coordinates
-.br
-The cartesian coordinate system used in \fBMB-System\fP
-is a bit odd because it is left-handed, as opposed
-to the right-handed x-y-z space conventionally
-used in most circumstances. With respect to the
-sonar (or the ship on which the sonar is mounted),
-the x-axis is athwartships with positive to starboard
-(to the right if facing forward), the y-axis is
-fore-aft with positive forward, and the z-axis is
-positive down.
-
-III. Spherical Coordinates
-.br
-There are two non-traditional spherical coordinate
-systems used in \fBMB-System\fP. The first, referred to here
-as takeoff angle coordinates, is useful for raytracing.
-The second, referred to here as roll-pitch
-coordinates, is useful for taking account of
-corrections to roll and pitch angles.
-
-III.1. Takeoff Angle Coordinates
-
-The three parameters are r, theta, and phi, where
-r is the distance from the origin, theta is the
-angle from vertical down (that is, from the
-positive z-axis), and phi is the angle from
-acrosstrack (the positive x-axis) in the x-y plane.
-Note that theta is always positive; the direction
-in the x-y plane is given by phi.
-Raytracing is simple in these coordinates because
-the ray takeoff angle is just theta. However,
-applying roll or pitch corrections is complicated because
-roll and pitch have components in both theta and phi.
-
- 	0 <= theta <= PI/2
- 	-PI/2 <= phi <= 3*PI/2
-
- 	x = rSIN(theta)COS(phi)
- 	y = rSIN(theta)SIN(phi)
- 	z = rCOS(theta)
-
- 	theta = 0    \---> vertical, along positive z-axis
- 	theta = PI/2 \---> horizontal, in x-y plane
- 	phi = \-PI/2  \---> aft, in y-z plane with y negative
- 	phi = 0      \---> port, in x-z plane with x positive
- 	phi = PI/2   \---> forward, in y-z plane with y positive
- 	phi = PI     \---> starboard, in x-z plane with x negative
- 	phi = 3*PI/2 \---> aft, in y-z plane with y negative
-
-III.2. Roll-Pitch Coordinates
-
-The three parameters are r, alpha, and beta, where
-r is the distance from the origin, alpha is the angle
-forward (effectively pitch angle), and beta is the
-angle from horizontal in the x-z plane (effectively
-roll angle). Applying a roll or pitch correction is
-simple in these coordinates because pitch is just alpha
-and roll is just beta. However, raytracing is complicated
-because deflection from vertical has components in both
-alpha and beta.
-
- 	-PI/2 <= alpha <= PI/2
- 	0 <= beta <= PI
-
- 	x = rCOS(alpha)COS(beta)
- 	y = rSIN(alpha)
- 	z = rCOS(alpha)SIN(beta)
-
-  	alpha = \-PI/2 \---> horizontal, in x-y plane with y negative
- 	alpha = 0     \---> ship level, zero pitch, in x-z plane
- 	alpha = PI/2  \---> horizontal, in x-y plane with y positive
- 	beta = 0      \---> starboard, along positive x-axis
- 	beta = PI/2   \---> in y-z plane rotated by alpha
- 	beta = PI     \---> port, along negative x-axis
-
-IV. SeaBeam Coordinates
-
-The per-beam parameters in the SB2100 data format include
-angle-from-vertical and angle-forward. Angle-from-vertical
-is the same as theta except that it is signed based on
-the acrosstrack direction (positive to starboard, negative
-to port). The angle-forward values are also defined
-slightly differently from phi, in that angle-forward is
-signed differently on the port and starboard sides. The
-SeaBeam 2100 External Interface Specifications document
-includes both discussion and figures illustrating the
-angle-forward value. To summarize:
-
-    Port:
-
- 	theta = absolute value of angle-from-vertical
-
- 	-PI/2 <= phi <= PI/2
- 	is equivalent to
- 	-PI/2 <= angle-forward <= PI/2
-
- 	phi = \-PI/2 \---> angle-forward = \-PI/2 (aft)
- 	phi = 0     \---> angle-forward = 0     (starboard)
- 	phi = PI/2  \---> angle-forward = PI/2  (forward)
-
-    Starboard:
-
- 	theta = angle-from-vertical
-
- 	PI/2 <= phi <= 3*PI/2
- 	is equivalent to
- 	-PI/2 <= angle-forward <= PI/2
-
- 	phi = PI/2   \---> angle-forward = \-PI/2 (forward)
- 	phi = PI     \---> angle-forward = 0     (port)
- 	phi = 3*PI/2 \---> angle-forward = PI/2  (aft)
-
-V. Usage of Coordinate Systems in \fBMB-System\fP
-
-Some sonar data formats provide angle values along with
-travel times. The angles are converted to takoff-angle
-coordinates regardless of the  storage form of the
-particular data format. Currently, most data formats
-do not contain an alongtrack component to the position
-values; in these cases the conversion is trivial since
-phi = beta = 0 and theta = alpha. The angle and travel time
-values can be accessed using the \fBMBIO\fP function \fBmb_ttimes\fP.
-All angle values passed by \fBMB-System\fP functions are in
-degrees rather than radians.
-
-The programs \fBmbbath\fP and \fBmbvelocitytool\fP use angles in
-take-off angle coordinates to do the raytracing. If roll
-and/or pitch corrections are to be made, the angles are
-converted to roll-pitch coordinates, corrected, and then
-converted back prior to raytracing.
-
-
-.SH BEAM FLAGS USED IN MB-SYSTEM
-\fBMB-System\fP uses arrays of 1-byte "beamflag" values to indicate
-beam data quality. Each beamflag value is actually an eight bit mask
-allowing fairly complicated information to be stored regarding
-each bathymetry value. In particular, beams may be flagged as
-bad, they may be selected as being of special interest, and
-one or more reasons for flagging or selection may be indicated.
-This scheme is very similar to the convention used in the HMPS
-hydrographic data processing package and the SAIC Hydrobat
-package. The beam selection mechanism is not currently used by
-any \fBMB-System\fP programs.
-
-The flag and select bits:
-  xxxxxx00 => This beam is neither flagged nor selected.
-  xxxxxx01 => This beam is flagged as bad and should be ignored.
-  xxxxxx10 => This beam has been selected.
-
-Flagging modes:
-  00000001 => Flagged because no detection was made by the sonar.
-  xxxxx101 => Flagged by manual editing.
-  xxxx1x01 => Flagged by automatic filter.
-  xxx1xx01 => Flagged because uncertainty exceeds 1 X IHO standard.
-  xx1xxx01 => Flagged because uncertainty exceeds 2 X IHO standard.
-  x1xxxx01 => Flagged because footprint is too large
-  1xxxxx01 => Flagged by sonar as unreliable.
-
-Selection modes:
-  00000010 => Selected, no reason specified.
-  xxxxx110 => Selected as least depth.
-  xxxx1x10 => Selected as average depth.
-  xxx1xx10 => Selected as maximum depth.
-  xx1xxx10 => Selected as location of sidescan contact.
-  x1xxxx10 => Selected, spare.
-  1xxxxx10 => Selected, spare.
-
-.SH SEE ALSO
-\fBmbsystem\fP(l), \fBmbformat\fP(l)
-
-.SH BUGS
-What could go wrong in a mere 204,289 lines of code?
-.br
-Let us know...
diff --git a/src/man/man3/pj_init.3 b/src/man/man3/pj_init.3
deleted file mode 100644
index ba1f103..0000000
--- a/src/man/man3/pj_init.3
+++ /dev/null
@@ -1,111 +0,0 @@
-.\" @(#)pj_init.3 \- 4.1
-.nr LL 5.5i
-.TH PJ_INIT 3 "2001/04/05 Rel. 4.4"
-.ad b
-.hy 1
-.SH NAME
-pj_init \- initialize cartographic projection
-.br
-pj_init_plus \- initialize cartographic projection
-.br
-pj_fwd \- forward cartographic projection
-.br
-pj_inv \- inverse cartographic projection
-.br
-pj_transform \- transform between coordinate systems
-.br
-pj_free \- de-initialize projection
-.SH SYNOPSIS
-.nf
-#include <proj_api.h>
-
-projPJ pj_init(int argc, char **argv)
-
-projPJ pj_init_plus(const char *defn)
-
-projUV pj_fwd(projUV val, projPJ proj)
-
-projUV pj_inv(projUV val, projPJ proj)
-
-int pj_transform(projPJ src_cs, projPJ dst_cs, long point_count,
-                 int point_offset, double *x, double *y, double *z)
-
-void pj_free(projPJ proj)
-
-.SH DESCRIPTION
-Procedure \fBpj_init\fR selects and initializes a cartographic projection
-with its argument control parameters.
-\fBArgc\fR is the number of elements in the array of control strings
-\fBargv\fR that each contain individual cartographic control keyword
-assignments (\f(CW+\fR \fBproj\fR arguments).
-The list must contain at least the \fBproj=\fIprojection\fR and
-Earth's radius or elliptical parameters.
-If the initialization of the projection is successful a valid
-address is returned otherwise a NULL value.
-
-The \fBpj_init_plus\fR function operates similarly to \fBpj_init\fR but
-takes a single string containing the definition, with each parameter
-prefixed with a plus sign.  For example "+proj=utm +zone=11 +ellps=WGS84".
-
-Once initialization is performed either forward or inverse
-projections can be performed with the returned value of \fBpj_init\fR
-used as the argument \fBproj\fR.
-The argument structure \fBprojUV\fR values \fBu\fR and \fBv\fR contain
-respective longitude and latitude or x and y.
-Latitude and longitude are in radians.
-If a projection operation fails, both elements of \fBprojUV\fR are
-set to HUGE_VAL (defined in \fImath.h\fR).
-
-\fBNote:\fR all projections have a forward mode, but some do not have
-an inverse projection.
-If the projection does not have an inverse the projPJ structure element
-\fIinv\fR will be NULL.
-
-The \fBpj_transform\fR function may be used to transform points between
-the two provided coordinate systems.  In addition to converting between
-cartographic projection coordinates and geographic coordinates, this function
-also takes care of datum shifts if possible between the source and destination
-coordinate system.  Unlike \fBpj_fwd\fR and \fBpj_inv\fR it is also allowable
-for the coordinate system definitions (\fBPJ *\fR) to be geographic coordinate
-systems (defined as +proj=latlong).  The \fBx\fR, \fBy\fR and \fBz\fR arrays
-contain the input values of the points, and are replaced with the output
-values.  The \fBpoint_offset\fR should indicate the spacing the of \fBx,y,z\fR
-arrays, normally 1.  The function returns zero on success, or the error number (also in
-pj_errno) on failure.
-
-Memory associated with the projection may be freed with \fBpj_free\fR.
-.SH EXAMPLE
-The following program reads latitude and longitude values in decimal
-degrees, performs Mercator projection with a Clarke 1866 ellipsoid and
-a 33\(de latitude of true scale and prints the projected
-cartesian values in meters:
-.nf
-\f(CW
-#include <proj_api.h>
-
-main(int argc, char **argv) {
-	char *args[] = { "proj=merc", "ellps=clrk66", "lat_ts=33" };
-	projUV p;
-	projPJ pj;
-
-	if (!(pj = pj_init(3, args)))
-	   exit(1);
-	while (scanf("%lf %lf", &p.v, &p.u) == 2) {
-	   p.u *= DEG_TO_RAD;
-	   p.v *= DEG_TO_RAD;
-	   p = pj_fwd(p, pj);
-	   printf("%.2f\et%.2f\en", p.u, p.v);
-	}
-	exit(0);
-} \fR
-.br
-.fi
-.SH LIBRARY
-libproj.a \- library of projections and support procedures
-.SH SEE ALSO
-.B http://proj.osgeo.org/ProjAPI, proj(1U),
-.br
-.I "Cartographic Projection Procedures for the UNIX Environment\(emA User's Manual,"
-(Evenden, 1990, Open-file report 90\-284).
-.SH HOME PAGE
-http://proj.osgeo.org
diff --git a/src/man/whatis b/src/man/whatis
deleted file mode 100644
index b29e90e..0000000
--- a/src/man/whatis
+++ /dev/null
@@ -1,82 +0,0 @@
-MBeditviz(1)             - 3D visualization-based editing of swath bathymetry soundings
-MBgrdviz(1)              - Simple interactive 2D/3D visualization of GMT grids
-geod(1)                  - direct geodesic computations invgeod - inverse geodesic computations
-hsdump(1)                - hsdump lists the information contained in Hydrosweep DS data files
-mb7k2jstar(1)            - extracts subbottom profiler and/or sidescan sonar data from Reson 7k format data files into Edgetech Jstar format data files
-mb7k2ss(1)               - extracts sidescan sonar data from Reson 7k format data, bins and lays the sidescan onto the seafloor, and outputs files in the MBF_MBLDEOIH formst (MBIO format id 71)
-mb7kpreprocess(1)        - performs preprocessing of Reson 7k multibeam data in the 7k format (MBIO format 88)
-mbabsorption(1)          - calculates the absorption of sound in sea water in dB/km as a function of frequency, temperature, salinity, sound speed, and depth
-mbareaclean(1)           - Tool to automatically flag bad beams in swath sonar bathymetry data within a specified area
-mbauvloglist(1)          - Lists table data from an MBARI AUV mission log file
-mbauvnavusbl(1)          - Adjusts inertial navigation of a submerged platform/vehicle to be consistent with more accurate but less precise surface tracking (USBL) navigation
-mbbackangle(1)           - Generates tables of the average amplitude or sidescan values in swath sonar data as a function of the grazing angle with the seafloor
-mbclean(1)               - Tool to automatically flag bad beams in swath sonar bathymetry data
-mbcontour(1)             - GMT compatible utility for color fill or color shaded relief swath plots of swath sonar data using Postscript
-mbcopy(1)                - Copy swath sonar bathymetry data files
-mbctdlist(1)             - List CTD data in swath sonar data files
-mbdatalist(1)            - parses recursive datalist files and outputs the complete list of data files, formats, and file weights
-mbdefaults(1)            - Set or list default mbio parameters for reading and writing swath sonar data
-mbedit(1)                - Interactive editor used to flag bad bathymetry values in swath sonar bathymetry data
-mbextractsegy(1)         - extracts subbottom profiler, center beam reflection, or seismic reflection data from swath data supported by MB-System and rewrites it as a SEGY file
-mbfilter(1)              - Apply some simple filter functions to sidescan or beam amplitude data from swath sonar data files
-mbformat(1)              - List information about swath sonar data formats supported by the MBIO library
-mbgetesf(1)              - Extract swath bathymetry data flags into an edit save file
-mbgrdtiff(1)             - generates a geographically located TIFF image from a GMT grid file
-mbgrid(1)                - Grid bathymetry, amplitude, or sidescan data from swath sonar data files
-mbhistogram(1)           - Generate a histogram of bathymetry, amplitude, or sidescan values from swath sonar data files
-mbhysweeppreprocess(1)   - performs preprocessing of multibeam data in the Hysweep HSX format (MBIO format 201)
-mbinfo(1)                - Output some basic statistics of swath sonar data files
-mbio(3)                  - Format independent input/output library for swath mapping sonar data
-mbkongsbergpreprocess(1) - performs preprocessing of data from third generation Kongsberg multibeam sonars (e.g. EM122, EM302, EM710)
-mblevitus(1)             - Create a water velocity profile which is representative of the mean annual water column for a specified 1 degree by 1 degree region
-mblist(1)                - List data in swath data files
-mbm_arc2grd(1)           - Macro to convert an ArcView ASCII grid to a GMT  grid file in the GMT NetCDF grid format
-mbm_bpr(1)               - MB-System macro to process data from a Seabird SBE53 pressure sensor into a tidal model for use by mbprocess
-mbm_copy(1)              - Apply mbcopy to all files referenced through a datalist, using the MB-System file suffix convention to name the output files
-mbm_dslnavfix(1)         - Translate WHOI DSL AMS-120 navigation from UTM eastings and northings to longitude and latitude
-mbm_fmtvel(1)            - Extract sound velocity info from Hydrosweep data files and create output in tabular format
-mbm_grd2arc(1)           - Macro to convert a GMT grid file in the GMT NetCDF grid format to an ArcView ASCII grid
-mbm_grd2geovrml(1)       - Create and execute commands which generate a TerraVision tileset and GeoVRML terrain set that can be combined with other geospatial data for viewing in a web browser
-mbm_grd3dplot(1)         - Create an executable shellscript which will generate a GMT 3D perspective plot of gridded data in a GMT grd file
-mbm_grdcut(1)            - Macro to extract a specified subarea of a GMT GRD grid file as another GRD file
-mbm_grdinfo(1)           - Macro to get information regarding a GMT grd file when the region of interest is a subset of the area covered in the input file
-mbm_grdplot(1)           - Create an executable shellscript which will generate a GMT map of gridded data in a GMT grd file
-mbm_grdtiff(1)           - Create an executable shellscript which will generate a TIFF image of gridded data in a GMT grd file
-mbm_grid(1)              - Create an executable shellscript which will generate a grid (bathymetry or topography) or mosaic (amplitude or sidescan) of swath sonar swath data
-mbm_histplot(1)          - Create an executable shellscript which will generate a GMT histogram plot of a dataset
-mbm_makedatalist(1)      - Macro to generate a datalist of the swath files in a specified directory
-mbm_multicopy(1)         - Apply mbcopy to all files referenced through a datalist using parallel processes. As with mbm_copy, the MB-System file suffix convention is used to name the output files
-mbm_multidatalist(1)     - Macro to use mbdatalist with the -O option to generate standard  ancilliary files, using parallel processes
-mbm_multiprocess(1)      - Macro to run mbprocess on the swath files referenced by a datalist using parallel processes
-mbm_plot(1)              - Create an executable shellscript which will generate a GMT plot of swath sonar swath data
-mbm_route2mission(1)     - Macro to convert an mbgrdviz route file into an MBARI AUV mission script
-mbm_stat(1)              - Extract beam statistics from output generated by mbinfo
-mbm_utm(1)               - Macro to perform forward and inverse UTM projections of ASCII data triples
-mbm_vrefcheck(1)         - Macro to generate plot of crosstrack seafloor slope from a swath sonar file.  The noise in this time series largely reflects noise in the vertical reference used by the sonar
-mbm_xbt(1)               - Calculate sound speed from XBT data
-mbm_xyplot(1)            - Create an executable shellscript which will generate a GMT plot of xy data
-mbmask(1), mbdumpesf(1)  - Output text version of beam edits from a binary edit save file
-mbmosaic(1)              - Mosaic amplitude or sidescan data from swath mapping sonar data files
-mbnavadjust(1)           - Package that solves for optimal navigation by matching bathymetry of overlapping swaths
-mbnavedit(1)             - Interactive navigation editor for swath sonar data
-mbnavlist(1)             - List navigation data in swath sonar data files
-mbneptune2esf(1)         - Tool to import beam flags from Simrad's Neptune system
-mbotps(1)                - Predicts tides using the OSU Tidal Prediction Software (OTPS) distribution
-mbprocess(1)             - this program performs a variety of swath data processing functions in a single step (producing a single output swath data file), including merging navigation, recalculating bathymetry from travel time and angle data by raytracing through a layered water sound velocity model, applying changes to ship draft, roll bias and pitch bias, applying tides, and applying bathymetry edits from edit save files
-mbps(1)                  - Generates a PostScript perspective plot of a piece of swath sonar data
-mbrollbias(1)            - Assess roll bias of swath sonar sonar systems
-mbrolltimelag(1)         - Calculates cross correlation between the apparent bottom slope in swath bathymetry data and the roll time series used by the sonar in order to assess attitude time lag problems
-mbroutetime(1)           - Program to output a list of the times when a survey passes the waypoints of a planned survey route
-mbsegygrid(1)            - Generate time vs. trace number grids of seismic data from segy files
-mbsegyinfo(1)            - Output some basic statistics of segy format seismic data files
-mbsegylist(1)            - List selected header values in segy format seismic data files
-mbsegypsd(1)             - Calculates the power spectral densisty function (PSD) of each trace in a segy file, outputting the PSD estimates as a GMT grid file with trace number along the x axis and frequency along the y axis
-mbset(1)                 - Sets values in mbprocess parameter files
-mbstripNaN(1)            - filter to remove NaN nodes
-mbsvplist(1)             - List water sound velocity profiles in swath sonar data files
-mbswath(1)               - GMT compatible utility for color fill or color shaded relief swath plots of swath sonar data using Postscript
-mbsystem(1)              - A set of utilities for manipulating and processing swath sonar bathymetry, amplitude, and sidescan data
-mbtime(1)                - Translate between calendar time values and unix time
-mbvelocitytool(1)        - Interactive water sound velocity profile editor
-pj_init(3)               - initialize cartographic projection pj_init_plus - initialize cartographic projection pj_fwd - forward cartographic projection pj_inv - inverse cartographic projection pj_transform - transform between coordinate systems pj_free - de-initialize projection
-proj(1)                  - forward cartographic projection filter invproj - inverse cartographic projection filter
diff --git a/src/mbaux/Makefile.am b/src/mbaux/Makefile.am
deleted file mode 100644
index 1f653a4..0000000
--- a/src/mbaux/Makefile.am
+++ /dev/null
@@ -1,28 +0,0 @@
-if BUILD_MOTIF
-  XGRLIB = libmbxgr.la
-endif
-lib_LTLIBRARIES = libmbaux.la $(XGRLIB)
-
-if BUILD_MOTIF
-  XGRINC = mb_xgraphics.h
-endif
-include_HEADERS = mb_aux.h $(XGRINC)
-
-AM_CPPFLAGS = -I${top_srcdir}/src/mbio \
-	      ${libgmt_CPPFLAGS} \
-	      ${libnetcdf_CPPFLAGS}
-AM_CFLAGS = ${libgmt_CFLAGS} ${libnetcdf_CFLAGS}
-
-libmbaux_la_LDFLAGS = -no-undefined -version-info 0:0:0
-libmbaux_la_SOURCES = \
-		      mb_spline.c mb_zgrid.c mb_surface.c mb_cheb.c \
-		      mb_delaun.c mb_track.c mb_truecont.c mb_readwritegrd.c \
-		      mb_intersectgrid.c
-libmbaux_la_LIBADD =  ${top_builddir}/src/mbio/libmbio.la \
-			${libgmt_LIBS} ${libnetcdf_LIBS}
-
-if BUILD_MOTIF
- libmbxgr_la_LDFLAGS = -no-undefined -version-info 0:0:0
- libmbxgr_la_SOURCES = mb_xgraphics.c
- libmbxgr_la_LIBADD = ${libmotif_LIBS}
-endif
diff --git a/src/mbaux/Makefile.in b/src/mbaux/Makefile.in
deleted file mode 100644
index 8d916c6..0000000
--- a/src/mbaux/Makefile.in
+++ /dev/null
@@ -1,736 +0,0 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
-
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-
-
-VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
-am__make_running_with_option = \
-  case $${target_option-} in \
-      ?) ;; \
-      *) echo "am__make_running_with_option: internal error: invalid" \
-              "target option '$${target_option-}' specified" >&2; \
-         exit 1;; \
-  esac; \
-  has_opt=no; \
-  sane_makeflags=$$MAKEFLAGS; \
-  if $(am__is_gnu_make); then \
-    sane_makeflags=$$MFLAGS; \
-  else \
-    case $$MAKEFLAGS in \
-      *\\[\ \	]*) \
-        bs=\\; \
-        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
-          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
-    esac; \
-  fi; \
-  skip_next=no; \
-  strip_trailopt () \
-  { \
-    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
-  }; \
-  for flg in $$sane_makeflags; do \
-    test $$skip_next = yes && { skip_next=no; continue; }; \
-    case $$flg in \
-      *=*|--*) continue;; \
-        -*I) strip_trailopt 'I'; skip_next=yes;; \
-      -*I?*) strip_trailopt 'I';; \
-        -*O) strip_trailopt 'O'; skip_next=yes;; \
-      -*O?*) strip_trailopt 'O';; \
-        -*l) strip_trailopt 'l'; skip_next=yes;; \
-      -*l?*) strip_trailopt 'l';; \
-      -[dEDm]) skip_next=yes;; \
-      -[JT]) skip_next=yes;; \
-    esac; \
-    case $$flg in \
-      *$$target_option*) has_opt=yes; break;; \
-    esac; \
-  done; \
-  test $$has_opt = yes
-am__make_dryrun = (target_option=n; $(am__make_running_with_option))
-am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-subdir = src/mbaux
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/depcomp $(am__include_HEADERS_DIST)
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
-	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
-	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
-	$(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-	$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/src/mbio/mb_config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
-am__vpath_adj = case $$p in \
-    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
-    *) f=$$p;; \
-  esac;
-am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
-am__install_max = 40
-am__nobase_strip_setup = \
-  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
-am__nobase_strip = \
-  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
-am__nobase_list = $(am__nobase_strip_setup); \
-  for p in $$list; do echo "$$p $$p"; done | \
-  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
-  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
-    if (++n[$$2] == $(am__install_max)) \
-      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
-    END { for (dir in files) print dir, files[dir] }'
-am__base_list = \
-  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
-  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
-am__uninstall_files_from_dir = { \
-  test -z "$$files" \
-    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
-    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
-         $(am__cd) "$$dir" && rm -f $$files; }; \
-  }
-am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includedir)"
-LTLIBRARIES = $(lib_LTLIBRARIES)
-am__DEPENDENCIES_1 =
-libmbaux_la_DEPENDENCIES = ${top_builddir}/src/mbio/libmbio.la \
-	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
-am_libmbaux_la_OBJECTS = mb_spline.lo mb_zgrid.lo mb_surface.lo \
-	mb_cheb.lo mb_delaun.lo mb_track.lo mb_truecont.lo \
-	mb_readwritegrd.lo mb_intersectgrid.lo
-libmbaux_la_OBJECTS = $(am_libmbaux_la_OBJECTS)
-AM_V_lt = $(am__v_lt_ at AM_V@)
-am__v_lt_ = $(am__v_lt_ at AM_DEFAULT_V@)
-am__v_lt_0 = --silent
-am__v_lt_1 = 
-libmbaux_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
-	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
-	$(libmbaux_la_LDFLAGS) $(LDFLAGS) -o $@
- at BUILD_MOTIF_TRUE@libmbxgr_la_DEPENDENCIES = $(am__DEPENDENCIES_1)
-am__libmbxgr_la_SOURCES_DIST = mb_xgraphics.c
- at BUILD_MOTIF_TRUE@am_libmbxgr_la_OBJECTS = mb_xgraphics.lo
-libmbxgr_la_OBJECTS = $(am_libmbxgr_la_OBJECTS)
-libmbxgr_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
-	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
-	$(libmbxgr_la_LDFLAGS) $(LDFLAGS) -o $@
- at BUILD_MOTIF_TRUE@am_libmbxgr_la_rpath = -rpath $(libdir)
-AM_V_P = $(am__v_P_ at AM_V@)
-am__v_P_ = $(am__v_P_ at AM_DEFAULT_V@)
-am__v_P_0 = false
-am__v_P_1 = :
-AM_V_GEN = $(am__v_GEN_ at AM_V@)
-am__v_GEN_ = $(am__v_GEN_ at AM_DEFAULT_V@)
-am__v_GEN_0 = @echo "  GEN     " $@;
-am__v_GEN_1 = 
-AM_V_at = $(am__v_at_ at AM_V@)
-am__v_at_ = $(am__v_at_ at AM_DEFAULT_V@)
-am__v_at_0 = @
-am__v_at_1 = 
-DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)/src/mbio
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
-am__mv = mv -f
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
-	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
-	$(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
-	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
-	$(AM_CFLAGS) $(CFLAGS)
-AM_V_CC = $(am__v_CC_ at AM_V@)
-am__v_CC_ = $(am__v_CC_ at AM_DEFAULT_V@)
-am__v_CC_0 = @echo "  CC      " $@;
-am__v_CC_1 = 
-CCLD = $(CC)
-LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
-	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
-	$(AM_LDFLAGS) $(LDFLAGS) -o $@
-AM_V_CCLD = $(am__v_CCLD_ at AM_V@)
-am__v_CCLD_ = $(am__v_CCLD_ at AM_DEFAULT_V@)
-am__v_CCLD_0 = @echo "  CCLD    " $@;
-am__v_CCLD_1 = 
-SOURCES = $(libmbaux_la_SOURCES) $(libmbxgr_la_SOURCES)
-DIST_SOURCES = $(libmbaux_la_SOURCES) $(am__libmbxgr_la_SOURCES_DIST)
-am__can_run_installinfo = \
-  case $$AM_UPDATE_INFO_DIR in \
-    n|no|NO) false;; \
-    *) (install-info --version) >/dev/null 2>&1;; \
-  esac
-am__include_HEADERS_DIST = mb_aux.h mb_xgraphics.h
-HEADERS = $(include_HEADERS)
-am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
-# Read a list of newline-separated strings from the standard input,
-# and print each of them once, without duplicates.  Input order is
-# *not* preserved.
-am__uniquify_input = $(AWK) '\
-  BEGIN { nonempty = 0; } \
-  { items[$$0] = 1; nonempty = 1; } \
-  END { if (nonempty) { for (i in items) print i; }; } \
-'
-# Make sure the list of sources is unique.  This is necessary because,
-# e.g., the same source file might be shared among _SOURCES variables
-# for different programs/libraries.
-am__define_uniq_tagged_files = \
-  list='$(am__tagged_files)'; \
-  unique=`for i in $$list; do \
-    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-  done | $(am__uniquify_input)`
-ETAGS = etags
-CTAGS = ctags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-CC = @CC@
-CCAS = @CCAS@
-CCASDEPMODE = @CCASDEPMODE@
-CCASFLAGS = @CCASFLAGS@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DLLTOOL = @DLLTOOL@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GREP = @GREP@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBM = @LIBM@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIBTOOL_DEPS = @LIBTOOL_DEPS@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LTLIBOBJS = @LTLIBOBJS@
-LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
-MAINT = @MAINT@
-MAKEINFO = @MAKEINFO@
-MANIFEST_TOOL = @MANIFEST_TOOL@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-OTPS_DIR = @OTPS_DIR@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_URL = @PACKAGE_URL@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PKG_CONFIG = @PKG_CONFIG@
-PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
-PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-VERSION = @VERSION@
-XDR_LIB = @XDR_LIB@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_AR = @ac_ct_AR@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-fftw_app = @fftw_app@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libGLU_CFLAGS = @libGLU_CFLAGS@
-libGLU_LIBS = @libGLU_LIBS@
-libXm_CFLAGS = @libXm_CFLAGS@
-libXm_LIBS = @libXm_LIBS@
-libdir = @libdir@
-libexecdir = @libexecdir@
-libfftw3_CFLAGS = @libfftw3_CFLAGS@
-libfftw3_LIBS = @libfftw3_LIBS@
-libfftw_CPPFLAGS = @libfftw_CPPFLAGS@
-libfftw_LIBS = @libfftw_LIBS@
-libgmt_CFLAGS = @libgmt_CFLAGS@
-libgmt_CPPFLAGS = @libgmt_CPPFLAGS@
-libgmt_LIBS = @libgmt_LIBS@
-libmotif_CPPFLAGS = @libmotif_CPPFLAGS@
-libmotif_LIBS = @libmotif_LIBS@
-libnetcdf_CFLAGS = @libnetcdf_CFLAGS@
-libnetcdf_CPPFLAGS = @libnetcdf_CPPFLAGS@
-libnetcdf_LIBS = @libnetcdf_LIBS@
-libopengl_CPPFLAGS = @libopengl_CPPFLAGS@
-libopengl_LIBS = @libopengl_LIBS@
-libproj_CFLAGS = @libproj_CFLAGS@
-libproj_CPPFLAGS = @libproj_CPPFLAGS@
-libproj_LIBS = @libproj_LIBS@
-libpsl_CFLAGS = @libpsl_CFLAGS@
-libpsl_LIBS = @libpsl_LIBS@
-localedir = @localedir@
-localstatedir = @localstatedir@
-mandir = @mandir@
-mbsystemdatadir = @mbsystemdatadir@
-mbsystemhtmldir = @mbsystemhtmldir@
-mbsystempsdir = @mbsystempsdir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
- at BUILD_MOTIF_TRUE@XGRLIB = libmbxgr.la
-lib_LTLIBRARIES = libmbaux.la $(XGRLIB)
- at BUILD_MOTIF_TRUE@XGRINC = mb_xgraphics.h
-include_HEADERS = mb_aux.h $(XGRINC)
-AM_CPPFLAGS = -I${top_srcdir}/src/mbio \
-	      ${libgmt_CPPFLAGS} \
-	      ${libnetcdf_CPPFLAGS}
-
-AM_CFLAGS = ${libgmt_CFLAGS} ${libnetcdf_CFLAGS}
-libmbaux_la_LDFLAGS = -no-undefined -version-info 0:0:0
-libmbaux_la_SOURCES = \
-		      mb_spline.c mb_zgrid.c mb_surface.c mb_cheb.c \
-		      mb_delaun.c mb_track.c mb_truecont.c mb_readwritegrd.c \
-		      mb_intersectgrid.c
-
-libmbaux_la_LIBADD = ${top_builddir}/src/mbio/libmbio.la \
-			${libgmt_LIBS} ${libnetcdf_LIBS}
-
- at BUILD_MOTIF_TRUE@libmbxgr_la_LDFLAGS = -no-undefined -version-info 0:0:0
- at BUILD_MOTIF_TRUE@libmbxgr_la_SOURCES = mb_xgraphics.c
- at BUILD_MOTIF_TRUE@libmbxgr_la_LIBADD = ${libmotif_LIBS}
-all: all-am
-
-.SUFFIXES:
-.SUFFIXES: .c .lo .o .obj
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
-	@for dep in $?; do \
-	  case '$(am__configure_deps)' in \
-	    *$$dep*) \
-	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-	        && { if test -f $@; then exit 0; else break; fi; }; \
-	      exit 1;; \
-	  esac; \
-	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/mbaux/Makefile'; \
-	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --gnu src/mbaux/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	@case '$?' in \
-	  *config.status*) \
-	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-	esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-
-install-libLTLIBRARIES: $(lib_LTLIBRARIES)
-	@$(NORMAL_INSTALL)
-	@list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
-	list2=; for p in $$list; do \
-	  if test -f $$p; then \
-	    list2="$$list2 $$p"; \
-	  else :; fi; \
-	done; \
-	test -z "$$list2" || { \
-	  echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \
-	  $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \
-	}
-
-uninstall-libLTLIBRARIES:
-	@$(NORMAL_UNINSTALL)
-	@list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
-	for p in $$list; do \
-	  $(am__strip_dir) \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \
-	done
-
-clean-libLTLIBRARIES:
-	-test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
-	@list='$(lib_LTLIBRARIES)'; \
-	locs=`for p in $$list; do echo $$p; done | \
-	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
-	      sort -u`; \
-	test -z "$$locs" || { \
-	  echo rm -f $${locs}; \
-	  rm -f $${locs}; \
-	}
-
-libmbaux.la: $(libmbaux_la_OBJECTS) $(libmbaux_la_DEPENDENCIES) $(EXTRA_libmbaux_la_DEPENDENCIES) 
-	$(AM_V_CCLD)$(libmbaux_la_LINK) -rpath $(libdir) $(libmbaux_la_OBJECTS) $(libmbaux_la_LIBADD) $(LIBS)
-
-libmbxgr.la: $(libmbxgr_la_OBJECTS) $(libmbxgr_la_DEPENDENCIES) $(EXTRA_libmbxgr_la_DEPENDENCIES) 
-	$(AM_V_CCLD)$(libmbxgr_la_LINK) $(am_libmbxgr_la_rpath) $(libmbxgr_la_OBJECTS) $(libmbxgr_la_LIBADD) $(LIBS)
-
-mostlyclean-compile:
-	-rm -f *.$(OBJEXT)
-
-distclean-compile:
-	-rm -f *.tab.c
-
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mb_cheb.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mb_delaun.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mb_intersectgrid.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mb_readwritegrd.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mb_spline.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mb_surface.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mb_track.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mb_truecont.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mb_xgraphics.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mb_zgrid.Plo at am__quote@
-
-.c.o:
- at am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(COMPILE) -c -o $@ $<
-
-.c.obj:
- at am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
- at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-
-.c.lo:
- at am__fastdepCC_TRUE@	$(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(LTCOMPILE) -c -o $@ $<
-
-mostlyclean-libtool:
-	-rm -f *.lo
-
-clean-libtool:
-	-rm -rf .libs _libs
-install-includeHEADERS: $(include_HEADERS)
-	@$(NORMAL_INSTALL)
-	@list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \
-	if test -n "$$list"; then \
-	  echo " $(MKDIR_P) '$(DESTDIR)$(includedir)'"; \
-	  $(MKDIR_P) "$(DESTDIR)$(includedir)" || exit 1; \
-	fi; \
-	for p in $$list; do \
-	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
-	  echo "$$d$$p"; \
-	done | $(am__base_list) | \
-	while read files; do \
-	  echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includedir)'"; \
-	  $(INSTALL_HEADER) $$files "$(DESTDIR)$(includedir)" || exit $$?; \
-	done
-
-uninstall-includeHEADERS:
-	@$(NORMAL_UNINSTALL)
-	@list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \
-	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
-	dir='$(DESTDIR)$(includedir)'; $(am__uninstall_files_from_dir)
-
-ID: $(am__tagged_files)
-	$(am__define_uniq_tagged_files); mkid -fID $$unique
-tags: tags-am
-TAGS: tags
-
-tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
-	set x; \
-	here=`pwd`; \
-	$(am__define_uniq_tagged_files); \
-	shift; \
-	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
-	  test -n "$$unique" || unique=$$empty_fix; \
-	  if test $$# -gt 0; then \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      "$$@" $$unique; \
-	  else \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      $$unique; \
-	  fi; \
-	fi
-ctags: ctags-am
-
-CTAGS: ctags
-ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
-	$(am__define_uniq_tagged_files); \
-	test -z "$(CTAGS_ARGS)$$unique" \
-	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$unique
-
-GTAGS:
-	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && $(am__cd) $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) "$$here"
-cscopelist: cscopelist-am
-
-cscopelist-am: $(am__tagged_files)
-	list='$(am__tagged_files)'; \
-	case "$(srcdir)" in \
-	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
-	  *) sdir=$(subdir)/$(srcdir) ;; \
-	esac; \
-	for i in $$list; do \
-	  if test -f "$$i"; then \
-	    echo "$(subdir)/$$i"; \
-	  else \
-	    echo "$$sdir/$$i"; \
-	  fi; \
-	done >> $(top_builddir)/cscope.files
-
-distclean-tags:
-	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	list='$(DISTFILES)'; \
-	  dist_files=`for file in $$list; do echo $$file; done | \
-	  sed -e "s|^$$srcdirstrip/||;t" \
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
-	case $$dist_files in \
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
-			   sort -u` ;; \
-	esac; \
-	for file in $$dist_files; do \
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  if test -d $$d/$$file; then \
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
-	    if test -d "$(distdir)/$$file"; then \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
-	  else \
-	    test -f "$(distdir)/$$file" \
-	    || cp -p $$d/$$file "$(distdir)/$$file" \
-	    || exit 1; \
-	  fi; \
-	done
-check-am: all-am
-check: check-am
-all-am: Makefile $(LTLIBRARIES) $(HEADERS)
-installdirs:
-	for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includedir)"; do \
-	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
-	done
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
-	if test -z '$(STRIP)'; then \
-	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	      install; \
-	else \
-	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
-	fi
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
-	@echo "This command is intended for maintainers to use"
-	@echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \
-	mostlyclean-am
-
-distclean: distclean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
-	distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am: install-includeHEADERS
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am: install-libLTLIBRARIES
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic \
-	mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am: uninstall-includeHEADERS uninstall-libLTLIBRARIES
-
-.MAKE: install-am install-strip
-
-.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
-	clean-libLTLIBRARIES clean-libtool cscopelist-am ctags \
-	ctags-am distclean distclean-compile distclean-generic \
-	distclean-libtool distclean-tags distdir dvi dvi-am html \
-	html-am info info-am install install-am install-data \
-	install-data-am install-dvi install-dvi-am install-exec \
-	install-exec-am install-html install-html-am \
-	install-includeHEADERS install-info install-info-am \
-	install-libLTLIBRARIES install-man install-pdf install-pdf-am \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-compile \
-	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-	tags tags-am uninstall uninstall-am uninstall-includeHEADERS \
-	uninstall-libLTLIBRARIES
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/mbaux/mb_aux.h b/src/mbaux/mb_aux.h
deleted file mode 100644
index c6d8fef..0000000
--- a/src/mbaux/mb_aux.h
+++ /dev/null
@@ -1,402 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mb_aux.h	5/16/94
- *    $Id: mb_aux.h 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c); 1993-2015 by
- *    David W. Caress (caress at mbari.org);
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu);
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mb_aux.h defines data structures used by swath contouring
- * functions and programs.  The source files mb_contour.c, mb_track.c,
- * and mbcontour.c all depend on this include file.
- *
- * Author:	D. W. Caress
- * Date:	May 15, 1994
- *
- * Name change:	mb_countour.h changed to mb_aux.h
- * Date:	October 13, 2009
- *
- *
- */
-
-/* contour algorithm defines */
-#define	MB_CONTOUR_OLD	0
-#define	MB_CONTOUR_TRIANGLES	1
-
-/* swath bathymetry data structure */
-struct	ping
-	{
-	int	time_i[7];
-	double	time_d;
-	double	navlon;
-	double	navlat;
-	double	heading;
-	int	pingnumber;
-	int	beams_bath;
-	int	beams_bath_alloc;
-	char	*beamflag;
-	double	*bath;
-	double	*bathlon;
-	double	*bathlat;
-	int	*bflag[2];
-	};
-
-/* structure including swath bathymetry data and control parameters
-	for swath contouring and ship track plotting */
-struct swath
-	{
-	/* raw swath data */
-	int	npings;
-	int	npings_max;
-	int	beams_bath;
-	struct ping *pings;
-
-	/* what is plotted */
-	int	contour_algorithm;
-	int	plot_contours;
-	int	plot_triangles;
-	int	plot_track;
-	int	plot_name;
-	int	plot_pingnumber;
-
-	/* contour control parameters */
-	double	contour_int;
-	double	color_int;
-	double	tick_int;
-	double	label_int;
-	double	tick_len;
-	double	label_hgt;
-	double	label_spacing;
-	int	ncolor;
-	int	nlevel;
-	int	nlevelset;
-	double	*level_list;
-	int	*label_list;
-	int	*tick_list;
-	int	*color_list;
-
-	/* track control parameters */
-	double	time_tick_int;
-	double	time_annot_int;
-	double	date_annot_int;
-	double	time_tick_len;
-	double	name_hgt;
-
-	/* pingnumber control parameters */
-	int	pingnumber_tick_int;
-	int	pingnumber_annot_int;
-	double	pingnumber_tick_len;
-
-	/* triangle network */
-	int	npts;
-	int	npts_alloc;
-	double	*x;
-	double	*y;
-	double	*z;
-	int	*edge;
-	int	*pingid;
-	int	ntri;
-	int	ntri_alloc;
-	int	*iv[3];
-	int	*ct[3];
-	int	*cs[3];
-	int	*ed[3];
-
-	/* mb_delaun work arrays */
-	double	*v1;
-	double	*v2;
-	double	*v3;
-	int	*istack;
-	int	*kv1;
-	int	*kv2;
-
-	/* triangle side flags */
-	int	*flag[3];
-
-	/* contour arrays */
-	int	nsave;
-	double	*xsave;
-	double	*ysave;
-	int	*isave;
-	int	*jsave;
-
-	/* contour label arrays */
-	int	nlabel;
-	double	*xlabel;
-	double	*ylabel;
-	double	*angle;
-	int	*justify;
-
-	/* function pointers for plot functions */
-        void (*contour_plot)(double x, double y, int ipen);
-        void (*contour_newpen)(int ipen);
-        void (*contour_setline)(int linewidth);
-        void (*contour_justify_string)(double height, char *string, double *s);
-        void (*contour_plot_string)(double x, double y, double hgt, double angle, char *label);
-
-	};
-
-/* topography grid structure for mb_intersectgrid() */
-struct mb_topogrid_struct
-	{
-	mb_path	file;
-	int	projection_mode;
-	mb_path	projection_id;
-	float	nodatavalue;
-	int	nxy;
-	int	nx;
-	int	ny;
-	double	min;
-	double	max;
-	double	xmin;
-	double	xmax;
-	double	ymin;
-	double	ymax;
-	double	dx;
-	double	dy;
-	float	*data;
-	};
-
-/* mb_contour and mb_track function prototypes */
-int mb_contour_init(
-		int	verbose,
-		struct swath **data,
-		int	npings_max,
-		int	beams_bath,
-		int	contour_algorithm,
-		int	plot_contours,
-		int	plot_triangles,
-		int	plot_track,
-		int	plot_name,
-		int	plot_pingnumber,
-		double	contour_int,
-		double	color_int,
-		double	tick_int,
-		double	label_int,
-		double	tick_len,
-		double	label_hgt,
-		double	label_spacing,
-		int	ncolor,
-		int	nlevel,
-		double	*level_list,
-		int	*label_list,
-		int	*tick_list,
-		double	time_tick_int,
-		double	time_annot_int,
-		double	date_annot_int,
-		double	time_tick_len,
-		double	name_hgt,
-		int	pingnumber_tick_int,
-		int	pingnumber_annot_int,
-		double	pingnumber_tick_len,
-		void   (*contour_plot)(double, double, int),
-		void   (*contour_newpen)(int),
-		void   (*contour_setline)(int),
-		void   (*contour_justify_string)(double, char *, double *),
-		void   (*contour_plot_string)(double, double, double, double, char *),
-		int	*error);
-int mb_contour_deall(
-		int	verbose,
-		struct swath *data,
-		int	*error);
-int mb_contour(
-		int	verbose,
-		struct swath *data,
-		int	*error);
-void mb_track(int verbose, struct swath *data, int *error);
-void mb_trackpingnumber(int verbose, struct swath *data, int *error);
-void mb_trackname(int verbose, int perpendicular, struct swath *data, char *file, int *error);
-
-/* pslibface function prototypes */
-int mb_plot_init(	int	verbose,
-		int	argc,
-		char	**argv,
-		double	*bounds_use,
-		double	*scale,
-		double	*inch2lon,
-		int	*error);
-int mb_plot_end(int verbose, int *error);
-int mb_plot_exit(int argc, char **argv);
-void mb_set_colors(int ncol, int *rd, int *gn, int *bl);
-void mb_plot(double x, double y, int ipen);
-void mb_setline(int linewidth);
-void mb_newpen(int ipen);
-void mb_justify_string(double height, char *string, double *s);
-void mb_plot_string(double x, double y, double hgt, double angle, char *label);
-
-/* mb_surface function prototypes */
-int mb_surface(int verbose, int ndat, float *xdat, float *ydat, float *zdat,
-		double xxmin, double xxmax, double yymin, double yymax, double xxinc, double yyinc,
-		double ttension, float *sgrid);
-int mb_zgrid(float *z, int *nx, int *ny,
-		float *x1, float *y1, float *dx, float *dy, float *xyz,
-		int *n, float *zpij, int *knxt, int *imnew,
-		float *cay, int *nrng);
-int mb_zgrid2(float *z, int *nx, int *ny,
-		float *x1, float *y1, float *dx, float *dy, float *xyz,
-		int *n, float *zpij, int *knxt, int *imnew,
-		float *cay, int *nrng);
-
-/* mb_delaun function prototypes */
-int mb_delaun(
-	int	verbose,
-	int	npts,
-	double	*p1,
-	double	*p2,
-	int	*ed,
-	int	*ntri,
-	int	*iv1,
-	int	*iv2,
-	int	*iv3,
-	int	*ct1,
-	int	*ct2,
-	int	*ct3,
-	int	*cs1,
-	int	*cs2,
-	int	*cs3,
-	double	*v1,
-	double	*v2,
-	double	*v3,
-	int	*istack,
-	int	*kv1,
-	int	*kv2,
-	int	*error);
-
-/* mb_readwritegrd function prototypes */
-int mb_read_gmt_grd(int verbose, char *grdfile,
-			int	*grid_projection_mode,
-			char	*grid_projection_id,
-			float	*nodatavalue,
-			int	*nxy,
-			int	*nx,
-			int	*ny,
-			double	*min,
-			double	*max,
-			double	*xmin,
-			double	*xmax,
-			double	*ymin,
-			double	*ymax,
-			double	*dx,
-			double	*dy,
-			float	**data,
-			float	**data_dzdx,
-			float	**data_dzdy,
-			int	*error);
-int mb_write_gmt_grd(int verbose,
-			char *grdfile,
-			float *grid,
-			float nodatavalue,
-			int nx,
-			int ny,
-			double xmin,
-			double xmax,
-			double ymin,
-			double ymax,
-			double zmin,
-			double zmax,
-			double dx,
-			double dy,
-			char *xlab,
-			char *ylab,
-			char *zlab,
-			char *titl,
-			char *projection,
-			int argc,
-			char **argv,
-			int *error);
-
-/* mb_spline function prototypes */
-int mb_spline_init(int verbose, double *x, double *y,
-	int n, double yp1, double ypn, double *y2, int *error);
-int mb_spline_interp(int verbose, double *xa, double *ya, double *y2a,
-	int n, double x, double *y, int *i, int *error);
-int mb_linear_interp(int verbose, double *xa, double *ya,
-		int n, double x, double *y, int *i, int *error);
-int mb_linear_interp_longitude(int verbose, double *xa, double *ya,
-		int n, double x, double *y, int *i, int *error);
-int mb_linear_interp_latitude(int verbose, double *xa, double *ya,
-		int n, double x, double *y, int *i, int *error);
-int mb_linear_interp_heading(int verbose, double *xa, double *ya,
-		int n, double x, double *y, int *i, int *error);
-
-/* mb_cheb function prototypes */
-void lsqup(
-    double  *a,
-    int	    *ia,
-    int	    *nia,
-    int	    nnz,
-    int	    nc,
-    int	    nr,
-    double  *x,
-    double  *dx,
-    double  *d,
-    int	    nfix,
-    int	    *ifix,
-    double  *fix,
-    int	    ncycle,
-    double  *sigma);
-void chebyu(
-    double  *sigma,
-    int	    ncycle,
-    double  shi,
-    double  slo,
-    double  *work);
-void splits(
-    double  *x,
-    double  *t,
-    int	    n);
-double errlim(
-	double	*sigma,
-	int	ncycle,
-	double	shi,
-	double	slo);
-double errrat(
-	double	x1,
-	double	x2,
-	double	*sigma,
-	int	ncycle);
-void lspeig(
-	double	*a,
-	int	*ia,
-	int	*nia,
-	int	nnz,
-	int	nc,
-	int	nr,
-	int	ncyc,
-	int	*nsig,
-	double	*x,
-	double	*dx,
-	double	*sigma,
-	double	*w,
-	double	*smax,
-	double	*err,
-	double	*sup);
-
-/* mb_topogrid function prototypes */
-int mb_topogrid_init(int verbose, mb_path topogridfile, int *lonflip,
-			void **topogrid_ptr, int *error);
-int mb_topogrid_deall(int verbose, void **topogrid_ptr, int *error);
-int mb_topogrid_topo(int verbose, void *topogrid_ptr,
-			double navlon, double navlat,
-			double *topo, int *error);
-int mb_topogrid_intersect(int verbose, void *topogrid_ptr,
-                        double navlon, double navlat,
-			double altitude, double sonardepth,
-			double mtodeglon, double mtodeglat,
-			double vx, double vy, double vz,
-			double *lon, double *lat, double *topo, double *range,
-                        int *error);
-int mb_topogrid_getangletable(int verbose, void *topogrid_ptr,
-                        int nangle, double angle_min, double angle_max,
-			double navlon, double navlat, double heading,
-			double altitude, double sonardepth, double pitch,
-			double *table_angle, double *table_xtrack,
-			double *table_ltrack, double *table_altitude,
-			double *table_range, int *error);
diff --git a/src/mbaux/mb_cheb.c b/src/mbaux/mb_cheb.c
deleted file mode 100644
index b905783..0000000
--- a/src/mbaux/mb_cheb.c
+++ /dev/null
@@ -1,603 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mb_cheb.c			3/23/00
- *    $Id: mb_cheb.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 2000-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * The mb_cheb library is a least squares matrix solver using
- * Richardson's algorithm with chebyshev acceleration. The step size is
- * varied to obtain uniform convergence over a prescribed
- * range of eigenvalues. This code is a C translation of Fortran 77
- * code distributed by Dr. Allen H. Olson in 1987 following the
- * publication of
- *   Olson, A. H., A Chebyshev condition for accelerating
- *   convergance of iterative tomographic methods - Solving
- *   large least squares problems, Phys. Earth Planet. Inter.,
- *   47, 333-345, 1987.
- * This algorithm is both time and memory efficient for large,
- * sparse least squares problems. The instructions for use are
- * given in comments below.
- *
- * Author:	D. W. Caress
- * Date:	March 23, 2000
- *
- * $Log: mb_cheb.c,v $
- * Revision 5.3  2008/07/10 06:43:40  caress
- * Preparing for 5.1.1beta20
- *
- * Revision 5.2  2007/10/08 05:56:18  caress
- * Changed convergence criteria.
- *
- * Revision 5.1  2006/01/11 07:33:01  caress
- * Working towards 5.0.8
- *
- * Revision 5.0  2000/12/01 22:53:59  caress
- * First cut at Version 5.0.
- *
- * Revision 4.1  2000/09/30  06:54:58  caress
- * Snapshot for Dale.
- *
- * Revision 4.0  2000/09/08  17:19:14  caress
- * Initial version.
- *
- *
- *
- */
-
-/*--------------------------------------------------------------------*/
-#include <stdio.h>
-#include <math.h>
-
-/* mbio include files */
-#include "mb_define.h"
-
-void lsqup(
-    double  *a,
-    int	    *ia,
-    int	    *nia,
-    int	    nnz,
-    int	    nc,
-    int	    nr,
-    double  *x,
-    double  *dx,
-    double  *d,
-    int	    nfix,
-    int	    *ifix,
-    double  *fix,
-    int	    ncycle,
-    double  *sigma);
-void chebyu(
-    double  *sigma,
-    int	    ncycle,
-    double  shi,
-    double  slo,
-    double  *work);
-void splits(
-    double  *x,
-    double  *t,
-    int	    n);
-double errlim(
-	double	*sigma,
-	int	ncycle,
-	double	shi,
-	double	slo);
-double errrat(
-	double	x1,
-	double	x2,
-	double	*sigma,
-	int	ncycle);
-void lspeig(
-	double	*a,
-	int	*ia,
-	int	*nia,
-	int	nnz,
-	int	nc,
-	int	nr,
-	int	ncyc,
-	int	*nsig,
-	double	*x,
-	double	*dx,
-	double	*sigma,
-	double	*w,
-	double	*smax,
-	double	*err,
-	double	*sup);
-
-/*----------------------------------------------------------------------
- *
- *     least squares solution using richardson's algorithm
- *     with chebyshev acceleration.  the step size is varied to obtain
- *     uniform convergence over a prescribed range of eigenvalues.
- *
- *                             ..... allen h. olson 6-29-85.
- *                                   university of california, san diego
- *
- *     Altered to allow particular values to be fixed.
- *                             ..... David W. Caress 4-14-88
- *----------------------------------------------------------------------
- *
- *                       nc                   ~
- *          given :     sum [ a(j,i) * x(j) ] = d(i)   ;  i=1, ... nr
- *                      j=1
- *                                               t
- *          minimize :  || a*x - d || = (a*x - d) * (a*x -d)
- *
- *----------------------------------------------------------------------*/
-void lsqup(
-    double  *a,
-    int	    *ia,
-    int	    *nia,
-    int	    nnz,
-    int	    nc,
-    int	    nr,
-    double  *x,
-    double  *dx,
-    double  *d,
-    int	    nfix,
-    int	    *ifix,
-    double  *fix,
-    int	    ncycle,
-    double  *sigma)
-/*----------------------------------------------------------------------
- * -------
- *  input
- * -------
- *     a(j,i)  -------  - packed matrix defined above dimensioned at least
- *                        (nnz,nr) note  that the first index is the column
- *                        index! i.e. the matrix is stored in row order.
- *     ia(j,i)  ------  - indices of values in packed matrix a
- *                        i.e. a(j,i) packed = a(j,ia(i,j)) unpacked
- *     nia(i)  -------  - number of nonzero values in each row
- *     nnz   ---------  - number of values in packed rows of a and ia
- *     nc,nr  --------  - number of columns and number of rows of unpacked
- *                        matrix as defined above.
- *     x(1...nc) -----  - initial guess solution; can be set to zero
- *                        or values returned form previous calls to lsquc.
- *     dx(1...nc) ----  - temporary storage array
- *     d(1...nr) -----  - data as defined above
- *     nfix  ---------  - number of solution values to be fixed
- *     ifix  ---------  - idices of fixed values
- *     fix  ----------  - fixed values:  x(ifix(j)) = fix(j)
- *     ncycle  -------  - number of iterations to perform. must be power of 2.
- *     sigma(1..ncycle) - array containing the weights for step sizes.
- *                        see subroutine 'chebyu' for computing these.
- * --------
- *  output
- * --------
- *     x(1..nc)   - solution vector as defined above
- *                  only array x(..) is over-written by lsquc.
- *
- *----------------------------------------------------------------------*/
-{
-    int	    i, j, k, icyc;
-    double  res;
-    double  s;
-
-for (i=0;i<nr;i++)
-	{
-	s = 0.0;
-	for (j=0;j<nia[i];j++)
-		{
-		k = nnz * i + j;
-		s += x[ia[k]] * a[k];
-		}
-	}
-
-    /* loop over all cycles */
-    for (icyc=0;icyc<ncycle;icyc++)
-	{
-	/* initialize dx */
-	for (j=0;j<nc;j++)
-	    dx[j] = 0.0;
-
-	/* loop over each row */
-	for (i=0;i<nr;i++)
-	    {
-	    res = 0.0;
-	    for (j=0;j<nia[i];j++)
-		{
-		k = nnz * i + j;
-		res += a[k] * x[ia[k]];
-		}
-	    res = d[i] - res;
-	    for (j=0;j<nia[i];j++)
-		{
-		k = nnz * i + j;
-		dx[ia[k]] += res * a[k];
-		}
-	    }
-
-	/* update x */
- 	for (j=0;j<nc;j++)
-	    x[j] += dx[j] / sigma[icyc];
-
-	/* apply fixed values */
-	for (j=0;j<nfix;j++)
-	    x[ifix[j]] = fix[j];
-
-	/* output info */
-	/*fprintf(stderr, "lsqup cycle %d completed...\n", icyc);*/
-	}
-}
-/*----------------------------------------------------------------------*/
-void chebyu(
-    double  *sigma,
-    int	    ncycle,
-    double  shi,
-    double  slo,
-    double  *work)
-/*----------------------------------------------------------------------
- *
- * computes the chebyshev weights with uniform distribution.
- * weights are ordered pair-wise in such a fashion that after an even
- * number of steps they are distributed uniformly on the interval [slo,shi].
- * this ordering provides optimum numerical stability of routine lsquc.
- *
- *                             ..... allen h. olson 6-29-85.
- *                                   university of california, san diego
- *
- *----------------------------------------------------------------------
- * -------
- *  input
- * -------
- *
- *     ncycle   ------  - must be a power of two!  number of iterations.
- *
- *     shi,slo  ------  - high and low limits defining the band of eigenvalues
- *                        to retain in the solution.  shi >= largest eigenvalue
- *                        of the normal equations.
- *     work(1..ncycle)  - work array for sorting array sigma(..).
- *
- * -------
- *  output
- * -------
- *
- *     sigma(1..ncycle) - weights for the step sizes in routine lsquc.
- * -------
- * calls function splits.
- *
- *----------------------------------------------------------------------*/
- {
-    int	    i, len, is, i0, nsort;
-
-    /* set up the chebyshev weights in increasing order */
-    for (i=0;i<ncycle;i++)
-	{
-	sigma[i] = -cos((2 * (i + 1) - 1)
-			* M_PI / 2 / ncycle);
-	sigma[i] = (sigma[i] * (shi - slo) + (shi + slo)) / 2;
-	}
-
-    /* sort the weights */
-    len = ncycle;
-    while (len > 2)
-	{
-	nsort = ncycle / len;
-	for (is=0;is<nsort;is++)
-	    {
-	    i0 = is * len;
-	    splits(&sigma[i0], work, len);
-	    }
-	len /= 2;
-	}
- }
-/*----------------------------------------------------------------------*/
-void splits(
-    double  *x,
-    double  *t,
-    int	    n)
-{
-    int	    i, l, nb2, nb2m1;
-
-    l = 0;
-    for (i=0;i<n;i+=2)
-	{
-	t[l] = x[i];
-	l++;
-	}
-    for (i=1;i<n;i+=2)
-	{
-	t[l] = x[i];
-	l++;
-	}
-
-    nb2 = n / 2;
-    nb2m1 = nb2 - 1;
-    if (nb2 >= 2)
-	{
-	for (i=0;i<nb2;i++)
-	    {
-	    x[i] = t[nb2m1 - i];
-	    }
-	for (i=nb2;i<n;i++)
-	    {
-	    x[i] = t[i];
-	    }
-	}
-    else
-	{
-	for (i=0;i<n;i++)
-	    x[i] = t[i];
-	}
-}
-/*----------------------------------------------------------------------*/
-/* returns limit of the maximum theoretical error using chebyshev weights */
-double errlim(
-	double	*sigma,
-	int	ncycle,
-	double	shi,
-	double	slo)
-/*----------------------------------------------------------------------*/
-{
-    double  errlim;
-    double  delta;
-    int	    i;
-
-    errlim = 1.0;
-    delta = 0.25 * (shi - slo);
-    for (i=0;i<ncycle;i++)
-	{
-	errlim *= delta / sigma[i];
-	}
-    errlim = 2 * errlim;
-    return(errlim);
-}
-/*----------------------------------------------------------------------*/
-/* computes the ratio of the error at eigenvalue x1 to the error at x2. */
-double errrat(
-	double	x1,
-	double	x2,
-	double	*sigma,
-	int	ncycle)
-/*----------------------------------------------------------------------*/
-{
-    double  errrat;
-    double  rat;
-    int	    k;
-
-    errrat = 1.0;
-    rat = x1 / x2;
-    for (k=0;k<ncycle;k++)
-	{
-	errrat = errrat * rat * (1.0 - sigma[k] / x1)
-				/ (1.0 - sigma[k] / x2);
-	}
-    errrat = fabs(errrat);
-    return(errrat);
-}
-/*----------------------------------------------------------------------
- *    least-squares eigenvalue
- *
- *    iteratively estimates the largest eigenvalue and eigenvectior
- *    with error bounds for the least-squares normal matrix a'a.
- *    a chebyshev criterion is used to calculate the optimum set of
- *    origin shifts in order to accelerate convergence.
- *    based upon the rayleigh quotient and error analysis presented in
- *    j. h. wilkinson's "the algebraic eigenvalue problem",
- *    (pp 170 ...), (pp 572 ...).
- *    under very pesimistic assumptions regarding the starting vector,
- *    the algorithm will initially converge to an eigenvalue less than
- *    the largest.  hence, a corresponding pessimistic estimate of an
- *    upper-bound on the largest eigenvalue is also made.
- *
- *                            ..... allen h. olson 10-4-85.
- *                                  university of california, san diego
- *----------------------------------------------------------------------*/
-void lspeig(
-	double	*a,
-	int	*ia,
-	int	*nia,
-	int	nnz,
-	int	nc,
-	int	nr,
-	int	ncyc,
-	int	*nsig,
-	double	*x,
-	double	*dx,
-	double	*sigma,
-	double	*w,
-	double	*smax,
-	double	*err,
-	double	*sup)
-/*-------
- * input
- *-------
- *    a(j,i)  -------  - packed matrix defined above dimensioned at least
- *                       (nnz,nr) note  that the first index is the column
- *                       index! i.e. the matrix is stored in row order.
- *    ia(j,i)  ------  - indices of values in packed matrix a
- *                       i.e. a(j,i) packed = a(j,ia(i,j)) unpacked
- *    nia(i)  -------  - number of nonzero values in each row
- *    nnz   ---------  - number of values in packed rows of a and ia
- *    nc,nr  --------  - number of columns and number of rows of unpacked
- *                       matrix as defined above.
- *    ncyc  ---------  - number of chebyshev iterations to perform.
- *                         must be a power of two.
- *    nsig  ---------  - cumulative number of iterations performed by
- *                         previous calls to this routine.  must be set
- *                         to zero on initial call.  nsig is automatically
- *                         incremented by this routine and must not be
- *                         redefined on subsequent calls by calling program.
- *    x(1..nc)  -----  - inital guess for the eigenvector.
- *    dx(1...nc) ----  - temporary storage array for x(.).
- *    sigma(1..nsmx)-  - array for holding the chebyshev origin shifts.
- *                         each call to lseig performs ncyc+1 iterations.
- *                         nsmx must be greater than or equal to the
- *                         cumulative number of iterations to be performed.
- *    w(1..nsmx)  ---  - temporary storage array for sigma(.).
- *    smax  ---------  - initial guess for the eigenvalue.
- *--------
- * output
- *--------
- *    x(1...nc) -----  - revised estimate of largest eigenvector.
- *    smax  ---------  - reivsed estimate of largest eigenvalue of a'a.
- *    err   ---------  - error bound for smax. we are guaranteed that
- *                         at least one eigenvalue is contained in the
- *                         interval smax+-err.  in the neighborhood of
- *                         convergence, this will contain the maximum.
- *    sup   ---------  - a pessimistic upper bound for the largest
- *                         eigenvector.
- *------
- * note:(1) for ncyc=0, an initial guess for the eigenvector is formed by
- *------  summing the rows of the matrix so that the accumulated vector
- *        increases in length as each row is added.  one iteration of the
- *        power method is then performed to estimate smax.
- *      (2) caution: an anomalous bad guess for the initial eigenvector
- *        being virtually orthogonal to the largest eigenvector
- *        will cause earlier iterations to converge to the next largest
- *        eigenvector.  this is impossible to detect.  in this case, smax
- *        may be much less than the largest eigenvalue.
- *          the parameter eps set below is a pessimistic assumption about
- *        the relative size of the component of the largest eigenvector in
- *        the initial iteration.  from this, an upper-bound is calculated
- *        for the largest eigenvalue, sup.  sup will always be larger than
- *        smax and reflects the uncertainty due to an anomolous bad choice
- *        for the starting vector.
- *-------------------------
- * sample calling sequence
- *-------------------------
- *    ncyc=0
- *    nsig=0
- *    call lseig(a,nc,nr,ncyc,nsig,x,dx,sigma,w,smax,err,sup)
- *    ncyc=4
- *    call lseig(a,nc,nr,ncyc,nsig,x,dx,sigma,w,smax,err,sup)
- *    ncyc=8
- *    call lseig(a,nc,nr,ncyc,nsig,x,dx,sigma,w,smax,err,sup)
- *
- *    the first call with ncyc=0 initializes x(.) and smax.  if these
- *      are already known then ncyc can be set to a nonzero value for the
- *      first call.  nsig must always be zero for the first call however.
- *    the next two calls perform chebyshev iteration to improve x(.) and smax.
- *      upon completion, a total of nsig=1+5+9=15 iterations have actually
- *      been performed.
- *    by making repeated calls to lseig, the error in smax and the difference
- *      between smax and sup can be monitored until the desired level of
- *      certainty is obtained. */
-/*----------------------------------------------------------------------*/
-{
-    int	    i, j, k, icyc;
-    int	    nsig1;
-    double  eps = 1.0e-6;
-    double  res = 0.0;
-    double  slo, smp, errsmp;
-
-    if (ncyc == 0)
-	{
-	i = 0;
-	for (j=0;j<nia[i];j++)
-	    {
-	    k = nnz * i + j;
-	    x[ia[k]] = a[k];
-	    }
-	for (i=1;i<nr;i++)
-	    {
-	    res = 0.0;
-	    for (j=0;j<nia[i];j++)
-		{
-		k = nnz * i + j;
-		res += x[ia[k]] * a[k];
-		}
-	    if (fabs(res) <= 1.0e-30)
-		res = 1.0;
-	    else
-		res = res / fabs(res);
-	    for (j=0;j<nia[i];j++)
-		{
-		k = nnz * i + j;
-		x[ia[k]] += res * a[k];
-		}
-	    }
-	res = 0.0;
-	for (j=0;j<nc;j++)
-	    {
-	    res += x[j] * x[j];
-	    }
-	res = 1.0 / sqrt(res);
-	for (j=0;j<nc;j++)
-	    {
-	    x[j] = x[j] * res;
-	    }
-	}
-
-    else
-	{
-	slo = 0.0;
-	chebyu(&sigma[*nsig], ncyc, *smax, slo, w);
-	}
-
-    nsig1 = *nsig + 1;
-    *nsig = nsig1 + ncyc;
-    sigma[*nsig-1] = 0.0;
-    for (icyc=nsig1-1;icyc<*nsig;icyc++)
-	{
-	for (j=0;j<nc;j++)
-	    {
-	    dx[j] = 0.0;
-	    }
-	for (i=0;i<nr;i++)
-	    {
-	    res = 0.0;
-	    for (j=0;j<nia[i];j++)
-		{
-		k = nnz * i + j;
-		res += a[k] * x[ia[k]];
-		}
-	    for (j=0;j<nia[i];j++)
-		{
-		k = nnz * i + j;
-		dx[ia[k]] += res * a[k];
-		}
-	    }
-	for (j=0;j<nc;j++)
-	    {
-	    dx[j] -= sigma[icyc] * x[j];
-	    }
-	*smax = 0.0;
-	for (j=0;j<nc;j++)
-	    {
-	    *smax += dx[j] * dx[j];
-	    }
-	*smax = sqrt(*smax);
-
-	if (icyc == *nsig - 1)
-	    {
-	    *err = 0.0;
-	    for (j=0;j<nc;j++)
-		{
-		res = dx[j] - *smax * x[j];
-		*err += res * res;
-		}
-	    *err = sqrt(*err);
-	    }
-
-	for (j=0;j<nc;j++)
-	    {
-	    x[j] = dx[j] / *smax;
-	    }
-	}
-
-    slo = *smax;
-    *sup = (1.0 + eps) * (*smax)
-	    * pow(eps, -1.0 / *nsig);
-    res = 1.0;
-    for (icyc=0;icyc<25 && res > eps;i++)
-	{
-	smp = 0.5 * (*sup + slo);
-	errsmp = errrat(*smax, smp, sigma, *nsig);
-	if (errsmp > eps)
-	    slo = smp;
-	else
-	    *sup = smp;
-	res = (*sup - slo) / slo;
-	}
-}
-/*----------------------------------------------------------------------*/
diff --git a/src/mbaux/mb_delaun.c b/src/mbaux/mb_delaun.c
deleted file mode 100644
index 088457c..0000000
--- a/src/mbaux/mb_delaun.c
+++ /dev/null
@@ -1,565 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mb_delaun.c	4/19/94
- *    $Id: mb_delaun.c 2247 2015-05-29 21:28:28Z caress $
- *
- *    Copyright (c) 1994-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * The function mb_delaun.c assigns triangles to a set of x,y points
- * based on the method of:
- *	Watson, Computers and Geosciences, V8, 97-101, 1982.
- * The final network is a set of Delauney triangles with the property
- * that no vertex lies inside the circumcircle of any triangle.  This
- * system is as close to equiangular as possible.
- * This code was translated from a Fortran 77 subroutine obtained from
- * Robert Parker at the Scripps Institution of Oceanography.  It is
- * unclear whether Bob wrote the subroutine based on the Watson article
- * or obtained the code from someone else.
- *
- * The input values are:
- *   verbose:		verbosity of debug output (MBIO convention)
- *   npts:		number of input x,y points
- *   p1[npts+3]:	array of npts input x values
- *   p2[npts+3]:	array of npts input y values
- *   ed[npts+3]:	array of edge flags - points on the edge
- *			of the region are flagged by nonzero values
- *			- interior points are flagged by zero values
- *			- triangles constructed using three edge points
- *			are removed
- *
- * The output values are:
- *   ntri:		number of output triangles
- *   iv1[2*npts+1]:	array of indices of points forming the first vertex
- *			of the triangles
- *   iv2[2*npts+1]:	array of indices of points forming the second vertex
- *			of the triangles
- *   iv3[2*npts+1]:	array of indices of points forming the third vertex
- *			of the triangles
- *   ct1[2*npts+1]:	triangle connection array, value ct1[i] indicates which
- *			triangle connects to side 1 of triangle i, value
- *			of -1 indicates no connecting triangle
- *   ct2[2*npts+1]:	triangle connection array, value ct2[i] indicates which
- *			triangle connects to side 2 of triangle i
- *			of -1 indicates no connecting triangle
- *   ct3[2*npts+1]:	triangle connection array, value ct3[i] indicates which
- *			triangle connects to side 3 of triangle i
- *			of -1 indicates no connecting triangle
- *   cs1[2*npts+1]:	triangle connection array, value cs1[i] indicates which
- *			side of triangle ct1[i] connects to side 1 of triangle i
- *   cs2[2*npts+1]:	triangle connection array, value cs2[i] indicates which
- *			side of triangle ct2[i] connects to side 2 of triangle i
- *   cs3[2*npts+1]:	triangle connection array, value cs3[i] indicates which
- *			side of triangle ct3[i] connects to side 3 of triangle i
- *   error:		error value, MBIO convention
- *
- * The work arrays are passed into mb_delaun rather than allocated and
- * deallocated within mb_delaun to increase the efficiency of programs
- * which use mb_delaun repeatedly. These work arrays are:
- *   v1[2*npts+1]:	the value v1[i] stores the x value of the
- *			circumcenter of triangle i
- *   v2[2*npts+1]:	the value v2[i] stores the y value of the
- *			circumcenter of triangle i
- *   v3[2*npts+1]:	the value v3[i] stores the square of the radius
- *			of the circumcircle of triangle i
- *   istack[2*npts+1]:	This is a stack onto which is pushed the the
- *			indexes of all the triangles that need to be
- *			replaced as a result of the addition of a new
- *			point. During the construction of the new 3-tuples
- *			the index of the 3-tuple to be replaced is
- *			popped from the stack. Since the addition of each
- *			new point adds 2 more triangles to the total,
- *			istack is popped 2 more times than it is pushed
- *			for each additional point. Hence istack is
- *			initialized prior to the main part of the routine
- *			so that it correctly returns the indexes of the
- *			new triangles.
- *    kv1[6*npts+1]:	For each new point, each existing triangle is
- *    kv2[6*npts+1]:	tested in turn and replaced if the new point
- *			lies within its circumcircle. Each side of the
- *			triangle is pushed onto the arrays kv1 and kv2 to
- *			potentially form a triangle with the new point.
- *			HOWEVER, if the side is already on the kv stack it
- *			is removed from the stack.  This means that if the
- *			side is common to two triangles that are to be
- *			replaced, i.e an interior side, then it is not
- *			used as the basis for forming the new triangles.
- *
- * Author:	D. W. Caress
- * Date:	April, 1994
- *
- *
- */
-
-/* standard global include files */
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_define.h"
-#include "mb_aux.h"
-
-/* some defines */
-#define	LARGE	1.0e10
-
-static char rcs_id[] = "$Id: mb_delaun.c 2247 2015-05-29 21:28:28Z caress $";
-
-/*--------------------------------------------------------------------------*/
-/* 	function mb_delaun creates a network of triangles connecting an
-	input set of points, where the triangles are as close to equiangular
-	as possible. */
-int mb_delaun(
-	int	verbose,
-	int	npts,
-	double	*p1,
-	double	*p2,
-	int	*ed,
-	int	*ntri,
-	int	*iv1,
-	int	*iv2,
-	int	*iv3,
-	int	*ct1,
-	int	*ct2,
-	int	*ct3,
-	int	*cs1,
-	int	*cs2,
-	int	*cs3,
-	double	*v1,
-	double	*v2,
-	double	*v3,
-	int	*istack,
-	int	*kv1,
-	int	*kv2,
-	int	*error)
-{
-	char	*function_name = "mb_delaun";
-	int	status = MB_SUCCESS;
-	int	itemp[2][3];
-	int	addside;
-	int	n1;
-	double	xmin, xmax, ymin, ymax;
-	double	cx, cy, crsq, rad, rsq;
-	int	maxn;
-	int	isp, id;
-	int	nuc, km, jt, kt, i1, i2;
-	int	l1, l2;
-	int	*ivs1, *ivs2;
-	double	denom, s;
-	double	xproduct;
-	int	notfound;
-	int	i, j, k;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBBA function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:          %d\n",verbose);
-		fprintf(stderr,"dbg2       npts:             %d\n",npts);
-		fprintf(stderr,"dbg2       p1:               %p\n",p1);
-		fprintf(stderr,"dbg2       p2:               %p\n",p2);
-		fprintf(stderr,"dbg2       ntri:             %d\n",*ntri);
-		fprintf(stderr,"dbg2       iv1:              %p\n",iv1);
-		fprintf(stderr,"dbg2       iv2:              %p\n",iv2);
-		fprintf(stderr,"dbg2       iv3:              %p\n",iv3);
-		fprintf(stderr,"dbg2       ct1:              %p\n",ct1);
-		fprintf(stderr,"dbg2       ct2:              %p\n",ct2);
-		fprintf(stderr,"dbg2       ct3:              %p\n",ct3);
-		fprintf(stderr,"dbg2       cs1:              %p\n",cs1);
-		fprintf(stderr,"dbg2       cs2:              %p\n",cs2);
-		fprintf(stderr,"dbg2       cs3:              %p\n",cs3);
-		fprintf(stderr,"dbg2       v1:               %p\n",v1);
-		fprintf(stderr,"dbg2       v2:               %p\n",v2);
-		fprintf(stderr,"dbg2       v3:               %p\n",v3);
-		fprintf(stderr,"dbg2       istack:           %p\n",istack);
-		fprintf(stderr,"dbg2       kv1:              %p\n",kv1);
-		fprintf(stderr,"dbg2       kv2:              %p\n",kv2);
-		fprintf(stderr,"dbg2       error:            %d\n",*error);
-		if (verbose >= 5)
-			{
-			fprintf(stderr,"dbg5       Input data:\n");
-			for (i=0;i<npts;i++)
-				fprintf(stderr,"dbg5       %d %f %f\n",
-				i,p1[i],p2[i]);
-			}
-		}
-
-	/* define itemp */
-	itemp[0][0] = 1;
-	itemp[1][0] = 2;
-	itemp[0][1] = 1;
-	itemp[1][1] = 3;
-	itemp[0][2] = 2;
-	itemp[1][2] = 3;
-
-	/* initialize the triangle stack */
-	n1 = 2*npts + 3;
-	for (i=0;i<n1;i++)
-		istack[i] = i;
-
-	/* determine the extremes of the data */
-	xmin = p1[0];
-	xmax = p1[0];
-	ymin = p2[0];
-	ymax = p2[0];
-	for (i=0;i<npts;i++)
-		{
-		xmin = MIN(xmin,p1[i]);
-		xmax = MAX(xmax,p1[i]);
-		ymin = MIN(ymin,p2[i]);
-		ymax = MAX(ymax,p2[i]);
-		}
-
-	/* enclose the data region in an equilateral triangle
-		- put circumcenter and radius-squared into the list */
-	cx = xmax - xmin;
-	cy = ymax - ymin;
-	crsq = 1.2*(cx*cx + cy*cy);
-	cx = 0.5*(xmin + xmax);
-	cy = 0.5*(ymin + ymax);
-	v1[0] = cx;
-	v2[0] = cy;
-	v3[0] = crsq;
-
-	/* put vertex coordinates in the end of the p array */
-	rad = sqrt(v3[0]);
-	maxn = npts + 3;
-	for (i=0;i<3;i++)
-		{
-		p1[npts+2-i] = v1[0] + rad*cos(2.0944*(i+1));
-		p2[npts+2-i] = v2[0] + rad*sin(2.0944*(i+1));
-		}
-	iv1[0] = npts + 2;
-	iv2[0] = npts + 1;
-	iv3[0] = npts;
-
-	/* scan through the data backwards */
-	isp = 1;
-	id = 1;
-	for (nuc=npts-1;nuc>-1;nuc--)
-	  {
-	  km = 0;
-/*fprintf(stderr,"\nnuc:%d\n",nuc);
-for (jt=0;jt<isp;jt++)
-fprintf(stderr,"jt:%d  %d %d %d\n",jt,iv1[jt],iv2[jt],iv3[jt]);*/
-
-	  /* loop through the established 3-tuples */
-	  for (jt=0;jt<isp;jt++)
-	    {
-	    i1 = iv3[jt];
-	    /* calculate the distance of the
-		point from the jt circumcenter */
-	    rsq = (p1[nuc] - p1[i1])*(p1[nuc] + p1[i1] - 2*v1[jt])
-		+ (p2[nuc] - p2[i1])*(p2[nuc] + p2[i1] - 2*v2[jt]);
-
-	    /* If the point lies within circumcircle of triangle
-		(3-tuple) jt then delete this triangle. Save the
-		edges provided that they are not part of another
-		triangle for which the point lies within the circumcircle
-		Thus "interior" edges are eliminated prior to
-		construction of the new triangles (3 tuples). */
-/*if (rsq <= 0.0 && !(rsq < 0.0))
-{
-fprintf(stderr,"NOTICE: rsq:%g\n",rsq);
-fprintf(stderr,"nuc:%d p1:%f p2:%f  i1:%d p1:%f p2:%f  jt:%d v1:%f v2:%f\n",
-nuc,p1[nuc],p2[nuc],i1,p1[i1],p2[i1],jt,v1[jt],v2[jt]);
-fprintf(stderr,"jt:%d iv1:%d %f %f\n",jt,iv1[jt],p1[iv1[jt]],p2[iv1[jt]]);
-fprintf(stderr,"jt:%d iv2:%d %f %f\n",jt,iv2[jt],p1[iv2[jt]],p2[iv2[jt]]);
-fprintf(stderr,"jt:%d iv3:%d %f %f\n",jt,iv3[jt],p1[iv3[jt]],p2[iv3[jt]]);
-}*/
-	    if (rsq <= 0.0)
-	      {
-	      /* triangle needs replacing => push the index on the stack */
-	      id = id - 1;
-	      istack[id] = jt;
-/*fprintf(stderr,"delete triangle jt:%d\n",jt);*/
-
-	      /* add edges to kv but delete if already present */
-	      for (i=0;i<3;i++)
-		{
-		/* cycle through the edges of the triangle */
-		l1 = itemp[0][i];
-		l2 = itemp[1][i];
-		if (l1 == 1) ivs1 = iv1;
-		if (l1 == 2) ivs1 = iv2;
-		if (l1 == 3) ivs1 = iv3;
-		if (l2 == 1) ivs2 = iv1;
-		if (l2 == 2) ivs2 = iv2;
-		if (l2 == 3) ivs2 = iv3;
-		addside = MB_YES;
-
-		/* Check if the side is already stored in kv. If it
-			is then Side common to more than one of the
-			current triangles. So remove it from list. */
-		j = 0;
-		while ((j < km) && addside)
-		  {
-		  if (ivs1[jt] == kv1[j] && ivs2[jt] == kv2[j])
-		    {
-		    addside = MB_NO;
-		    km--;
-		    for (k=j;k<km;k++)
-		      {
-		      kv1[k] = kv1[k+1];
-		      kv2[k] = kv2[k+1];
-		      }
-		    }
-		  j++;
-		  }
-
-		/* side was not found in list so add it now */
-		if (addside)
-		  {
-		  km++;
-		  if (km > 6*npts+1)
-		    {
-		    fprintf(stderr,"Error in mb_delaun - kv array too small at dimension %d\n",6*npts+1);
-		    *error = 99;
-		    status = MB_FAILURE;
-		    return(status);
-		    }
-		  kv1[km-1] = ivs1[jt];
-		  kv2[km-1] = ivs2[jt];
-		  }
-		} /* end: for (i=0;i<3;i++) */
-	      } /* end: if (rsq < 0.0) */
-
-	    } /* end: for (jt=0;jt<isp;jt++) */
-
-	  /* form new 3-tuples */
-	  for (i=0;i<km;i++)
-	    {
-	    /* pop the triangle index from the stack */
-	    kt = istack[id];
-	    id++;
-
-	    /* calculate the circumcircle and radius squared */
-	    i1 = kv1[i];
-	    i2 = kv2[i];
-	    denom = ((p1[i1] - p1[nuc])*(p2[i2] - p2[nuc])
-			- (p2[i1] - p2[nuc])*(p1[i2] - p1[nuc]));
-
-	    /* check if the three points form a true triangle */
-	    if (denom != 0.0)
-	      {
-	      s = ((p1[i1] - p1[nuc])*(p1[i1] - p1[i2])
-			+ (p2[i1] - p2[nuc])*(p2[i1] - p2[i2]))/denom;
-	      v1[kt] = 0.5*(p1[i2] + p1[nuc] + s*(p2[i2] - p2[nuc]));
-	      v2[kt] = 0.5*(p2[i2] + p2[nuc] - s*(p1[i2] - p1[nuc]));
-	      }
-
-	    /* The three points are degenerate and lie on a line.
-		The "true" circumcenter is at infinity and the radius
-		is also infinite. All points on the plane lie within
-		the circumcircle. Thus simulate this by using
-		circumcenter and circumcircle of the enclosing
-		equilateral triangle */
-	    else
-	      {
-              fprintf(stderr,"\nmb_delaun Warning. Zero denominator\n");
-              fprintf(stderr,"%d %f %f\n",i1,p1[i1],p2[i1]);
-              fprintf(stderr,"%d %f %f\n",i2,p1[i2],p2[i2]);
-              fprintf(stderr,"%d %f %f\n",nuc,p1[nuc],p2[nuc]);
-	      v1[kt] = cx;
-	      v2[kt] = cy;
-	      v3[kt] = nuc;
-	      }
-	    iv1[kt] = kv1[i];
-	    iv2[kt] = kv2[i];
-	    iv3[kt] = nuc;
-	    } /* end: for (i=0;i<km;i++) */
-
-	  /* adding a point adds two more triangles to the total
-		number of triangles */
-	  isp = isp + 2;
-
-	  } /* end: for (nuc=npts-1;nuc>-1;nuc--) */
-
-	/* set number of triangles */
-	*ntri = isp;
-
-	/* remove triangles using added points and triangles made
-		up of three flagged edge points */
-	for (i=*ntri-1;i>-1;i--)
-		{
-		if (iv1[i] >= npts || iv2[i] >= npts || iv3[i] >= npts)
-			{
-			for (j=i;j<isp-1;j++)
-				{
-				iv1[j] = iv1[j+1];
-				iv2[j] = iv2[j+1];
-				iv3[j] = iv3[j+1];
-				}
-			isp--;
-			}
-		else if (ed[iv1[i]] != 0 && ed[iv2[i]] != 0 && ed[iv3[i]] != 0)
-			{
-			for (j=i;j<isp-1;j++)
-				{
-				iv1[j] = iv1[j+1];
-				iv2[j] = iv2[j+1];
-				iv3[j] = iv3[j+1];
-				}
-			isp--;
-			}
-		}
-	*ntri = isp;
-
-	/* make sure all triangles are defined clockwise */
-	for (i=0;i<*ntri;i++)
-		{
-		xproduct = -(p1[iv2[i]] - p1[iv1[i]])*(p2[iv3[i]] - p2[iv2[i]])
-			+ (p1[iv3[i]] - p1[iv2[i]])*(p2[iv2[i]] - p2[iv1[i]]);
-		if (xproduct < 0.0)
-			{
-			j = iv2[i];
-			iv2[i] = iv3[i];
-			iv3[i] = j;
-			}
-		}
-
-	/* now get connectivity */
-	for (i=0;i<*ntri;i++)
-		{
-		ct1[i] = -1;
-		ct2[i] = -1;
-		ct3[i] = -1;
-		cs1[i] = -1;
-		cs2[i] = -1;
-		cs3[i] = -1;
-		}
-	for (i=0;i<*ntri;i++)
-		{
-		/* check side 1 of triangle i */
-		if (ct1[i] == -1)
-		  {
-		  notfound = MB_YES;
-		  for (j=0;notfound && j<*ntri;j++)
-			{
-			if (notfound && iv1[i] == iv2[j] && iv2[i] == iv1[j])
-				{
-				ct1[i] = j;
-				cs1[i] = 0;
-				ct1[j] = i;
-				cs1[j] = 0;
-				notfound = MB_NO;
-				}
-			if (notfound && iv1[i] == iv3[j] && iv2[i] == iv2[j])
-				{
-				ct1[i] = j;
-				cs1[i] = 1;
-				ct2[j] = i;
-				cs2[j] = 0;
-				notfound = MB_NO;
-				}
-			if (notfound && iv1[i] == iv1[j] && iv2[i] == iv3[j])
-				{
-				ct1[i] = j;
-				cs1[i] = 2;
-				ct3[j] = i;
-				cs3[j] = 0;
-				notfound = MB_NO;
-				}
-			}
-		  }
-		/* check side 2 of triangle i */
-		if (ct2[i] == -1)
-		  {
-		  notfound = MB_YES;
-		  for (j=0;notfound && j<*ntri;j++)
-			{
-			if (notfound && iv2[i] == iv2[j] && iv3[i] == iv1[j])
-				{
-				ct2[i] = j;
-				cs2[i] = 0;
-				ct1[j] = i;
-				cs1[j] = 1;
-				notfound = MB_NO;
-				}
-			if (notfound && iv2[i] == iv3[j] && iv3[i] == iv2[j])
-				{
-				ct2[i] = j;
-				cs2[i] = 1;
-				ct2[j] = i;
-				cs2[j] = 1;
-				notfound = MB_NO;
-				}
-			if (notfound && iv2[i] == iv1[j] && iv3[i] == iv3[j])
-				{
-				ct2[i] = j;
-				cs2[i] = 2;
-				ct3[j] = i;
-				cs3[j] = 1;
-				notfound = MB_NO;
-				}
-			}
-		  }
-		/* check side 3 of triangle i */
-		if (ct3[i] == -1)
-		  {
-		  notfound = MB_YES;
-		  for (j=0;notfound && j<*ntri;j++)
-			{
-			if (notfound && iv3[i] == iv2[j] && iv1[i] == iv1[j])
-				{
-				ct3[i] = j;
-				cs3[i] = 0;
-				ct1[j] = i;
-				cs1[j] = 2;
-				notfound = MB_NO;
-				}
-			if (notfound && iv3[i] == iv3[j] && iv1[i] == iv2[j])
-				{
-				ct3[i] = j;
-				cs3[i] = 1;
-				ct2[j] = i;
-				cs2[j] = 2;
-				notfound = MB_NO;
-				}
-			if (notfound && iv3[i] == iv1[j] && iv1[i] == iv3[j])
-				{
-				ct3[i] = j;
-				cs3[i] = 2;
-				ct3[j] = i;
-				cs3[j] = 2;
-				notfound = MB_NO;
-				}
-			}
-		  }
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       ntri:             %d\n",*ntri);
-		if (verbose >= 5)
-			{
-			fprintf(stderr,"dbg5       Output vertices:\n");
-			for (i=0;i<*ntri;i++)
-				fprintf(stderr,"dbg5       %3d  %3d %3d %3d\n",
-				i,iv1[i],iv2[i],iv3[i]);
-			fprintf(stderr,"dbg5       Output connectivity:\n");
-			for (i=0;i<*ntri;i++)
-				fprintf(stderr,"dbg5       %3d   %3d %3d   %3d %3d   %3d %3d\n",
-				i,ct1[i],cs1[i],ct2[i],cs2[i],ct3[i],cs3[i]);
-			}
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------------*/
diff --git a/src/mbaux/mb_intersectgrid.c b/src/mbaux/mb_intersectgrid.c
deleted file mode 100644
index 56bbeb0..0000000
--- a/src/mbaux/mb_intersectgrid.c
+++ /dev/null
@@ -1,687 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mb_intersectgrid.c	10/20/2012
- *    $Id:  $
- *
- *    Copyright (c) 2012-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * Functions to handle reading a topographic grid and then calculate
- * the intersection location of arbitrary vectors with that grid.
- * Given a sonar location and a 3D vector "look" direction, this code calculates
- * the xyz location of the intersection of the vector with the topography.
- * This is used for laying out sidescan on the seafloor and for sidescan
- * mosaicing.
- *
- * Author:	D. W. Caress
- * Date:	October 20, 2012
- *
- * $Log: mb_intersectgrid.c,v $
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-#include <time.h>
-
-/* MBIO include files */
-#include "mb_status.h"
-#include "mb_define.h"
-#include "mb_aux.h"
-
-static char rcs_id[] = "$Id: mb_intersectgrid.c 1917 2012-01-10 19:25:33Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mb_topogrid_init(int verbose, mb_path topogridfile, int *lonflip,
-			void **topogrid_ptr, int *error)
-{
-	char	*function_name = "mb_topogrid_init";
-	int	status = MB_SUCCESS;
-	struct mb_topogrid_struct *topogrid;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n", function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:                   %d\n", verbose);
-		fprintf(stderr,"dbg2       topogridfile:              %s\n", topogridfile);
-		fprintf(stderr,"dbg2       lonflip:                   %d\n", *lonflip);
-		fprintf(stderr,"dbg2       topogrid:                  %p\n", *topogrid_ptr);
-		}
-
-	/* allocate memory for topogrid structure */
-	status = mb_mallocd(verbose,__FILE__,__LINE__,sizeof(struct mb_topogrid_struct),(void **)topogrid_ptr,error);
-
-	/* get pointer to topogrid structure */
-	topogrid = (struct mb_topogrid_struct *) *topogrid_ptr;
-
-	/* read in the data */
-	strcpy(topogrid->file, topogridfile);
-	topogrid->data = NULL;
-	status = mb_read_gmt_grd(verbose, topogrid->file, &topogrid->projection_mode, topogrid->projection_id, &topogrid->nodatavalue,
-				&topogrid->nxy, &topogrid->nx, &topogrid->ny, &topogrid->min, &topogrid->max,
-				&topogrid->xmin, &topogrid->xmax, &topogrid->ymin, &topogrid->ymax,
-				&topogrid->dx, &topogrid->dy, &topogrid->data, NULL, NULL, error);
-
-	/* check for reasonable results */
-	if (topogrid->nxy <= 0 || topogrid->data == NULL)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_OPEN_FAIL;
-		}
-
-	/* rationalize topogrid bounds and lonflip */
-	if (status == MB_SUCCESS)
-		{
-		if (*lonflip == -1)
-			{
-			if (topogrid->xmax > 180.0)
-				{
-				topogrid->xmin -= 360.0;
-				topogrid->xmax -= 360.0;
-				}
-			}
-		else if (*lonflip == 0)
-			{
-			if (topogrid->xmin > 180.0)
-				{
-				topogrid->xmin -= 360.0;
-				topogrid->xmax -= 360.0;
-				}
-			else if (topogrid->xmax < -180.0)
-				{
-				topogrid->xmin += 360.0;
-				topogrid->xmax += 360.0;
-				}
-			}
-		else if (*lonflip == 1)
-			{
-			if (topogrid->xmin < -180.0)
-				{
-				topogrid->xmin += 360.0;
-				topogrid->xmax += 360.0;
-				}
-			}
-		if (topogrid->xmax > 180.0)
-			{
-			*lonflip = 1;
-			}
-		else if (topogrid->xmin < -180.0)
-			{
-			*lonflip = -1;
-			}
-		else
-			{
-			*lonflip = 0;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MB7K2SS function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       lonflip:                   %d\n", *lonflip);
-		fprintf(stderr,"dbg2       topogrid:                  %p\n", topogrid);
-		fprintf(stderr,"dbg2       topogrid->file:            %s\n", topogrid->file);
-		fprintf(stderr,"dbg2       topogrid->projection_mode: %d\n", topogrid->projection_mode);
-		fprintf(stderr,"dbg2       topogrid->projection_id:   %s\n", topogrid->projection_id);
-		fprintf(stderr,"dbg2       topogrid->nodatavalue:     %f\n", topogrid->nodatavalue);
-		fprintf(stderr,"dbg2       topogrid->nxy:             %d\n", topogrid->nxy);
-		fprintf(stderr,"dbg2       topogrid->nx:              %d\n", topogrid->nx);
-		fprintf(stderr,"dbg2       topogrid->ny:              %d\n", topogrid->ny);
-		fprintf(stderr,"dbg2       topogrid->min:             %f\n", topogrid->min);
-		fprintf(stderr,"dbg2       topogrid->max:             %f\n", topogrid->max);
-		fprintf(stderr,"dbg2       topogrid->xmin:            %f\n", topogrid->xmin);
-		fprintf(stderr,"dbg2       topogrid->xmax:            %f\n", topogrid->xmax);
-		fprintf(stderr,"dbg2       topogrid->ymin:            %f\n", topogrid->ymin);
-		fprintf(stderr,"dbg2       topogrid->ymax:            %f\n", topogrid->ymax);
-		fprintf(stderr,"dbg2       topogrid->dx:              %f\n", topogrid->dx);
-		fprintf(stderr,"dbg2       topogrid->dy               %f\n", topogrid->dy);
-		fprintf(stderr,"dbg2       topogrid->data:            %p\n", topogrid->data);
-		fprintf(stderr,"dbg2       error:                     %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:                    %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_topogrid_deall(int verbose, void **topogrid_ptr, int *error)
-{
-	char	*function_name = "mb_topogrid_deall";
-	int	status = MB_SUCCESS;
-	struct mb_topogrid_struct *topogrid;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n", function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:                   %d\n", verbose);
-		fprintf(stderr,"dbg2       topogrid_ptr:              %p\n", topogrid_ptr);
-		fprintf(stderr,"dbg2       topogrid:                  %p\n", *topogrid_ptr);
-		}
-
-	/* deallocate the topogrid structure */
-	topogrid = (struct mb_topogrid_struct *) *topogrid_ptr;
-	if (topogrid->data != NULL)
-		status = mb_freed(verbose, __FILE__, __LINE__, (void **)&(topogrid->data), error);
-	status = mb_freed(verbose,__FILE__, __LINE__, (void **)topogrid_ptr,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MB7K2SS function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:                     %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:                    %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_topogrid_topo(int verbose, void *topogrid_ptr,
-			double navlon, double navlat,
-			double *topo, int *error)
-{
-	char	*function_name = "mb_topogrid_topo";
-	int	status = MB_SUCCESS;
-	struct mb_topogrid_struct *topogrid;
-	int	nfound;
-	int	i, j, ii, jj, k;
-
-	/* get pointer to topogrid structure */
-	topogrid = (struct mb_topogrid_struct *) topogrid_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n", function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:                   %d\n", verbose);
-		fprintf(stderr,"dbg2       navlon:                    %f\n", navlon);
-		fprintf(stderr,"dbg2       navlat:                    %f\n", navlat);
-		fprintf(stderr,"dbg2       topogrid:                  %p\n", topogrid);
-		fprintf(stderr,"dbg2       topogrid->projection_mode: %d\n", topogrid->projection_mode);
-		fprintf(stderr,"dbg2       topogrid->projection_id:   %s\n", topogrid->projection_id);
-		fprintf(stderr,"dbg2       topogrid->nodatavalue:     %f\n", topogrid->nodatavalue);
-		fprintf(stderr,"dbg2       topogrid->nxy:             %d\n", topogrid->nxy);
-		fprintf(stderr,"dbg2       topogrid->nx:              %d\n", topogrid->nx);
-		fprintf(stderr,"dbg2       topogrid->ny:              %d\n", topogrid->ny);
-		fprintf(stderr,"dbg2       topogrid->min:             %f\n", topogrid->min);
-		fprintf(stderr,"dbg2       topogrid->max:             %f\n", topogrid->max);
-		fprintf(stderr,"dbg2       topogrid->xmin:            %f\n", topogrid->xmin);
-		fprintf(stderr,"dbg2       topogrid->xmax:            %f\n", topogrid->xmax);
-		fprintf(stderr,"dbg2       topogrid->ymin:            %f\n", topogrid->ymin);
-		fprintf(stderr,"dbg2       topogrid->ymax:            %f\n", topogrid->ymax);
-		fprintf(stderr,"dbg2       topogrid->dx:              %f\n", topogrid->dx);
-		fprintf(stderr,"dbg2       topogrid->dy               %f\n", topogrid->dy);
-		fprintf(stderr,"dbg2       topogrid->data:            %p\n", topogrid->data);
-		}
-
-	/* get topography at specified location */
-	nfound = 0;
-	*topo = 0.0;
-	i = (int)((navlon - topogrid->xmin) / topogrid->dx);
-	j = (int)((navlat - topogrid->ymin) / topogrid->dy);
-	if (i >= 0 && i < topogrid->nx - 1
-	    && j >= 0 && j < topogrid->ny - 1)
-		{
-		for (ii=i;ii<=i+1;ii++)
-		for (jj=j;jj<=j+1;jj++)
-		    {
-		    k = ii * topogrid->ny + jj;
-		    if (topogrid->data[k] != topogrid->nodatavalue)
-			{
-			nfound++;
-			*topo += topogrid->data[k];
-			}
-		    }
-		}
-	if (nfound > 0)
-		{
-		*topo /= (double)nfound;
-		}
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_NOT_ENOUGH_DATA;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MB7K2SS function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       topo:            %f\n",*topo);
-		fprintf(stderr,"dbg2       error:           %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:          %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_topogrid_intersect(int verbose, void *topogrid_ptr,
-			double navlon, double navlat,
-			double altitude, double sonardepth,
-			double mtodeglon, double mtodeglat,
-			double vx, double vy, double vz,
-			double *lon, double *lat, double *topo, double *range,
-			int *error)
-{
-	char	*function_name = "mb_topogrid_intersect";
-	int	status = MB_SUCCESS;
-	struct mb_topogrid_struct *topogrid;
-	int	done;
-	int	iteration;
-	int	iteration_max = 25;
-	double	topotolerance = 0.1;
-	double	dr, r, lontest, lattest;
-	double	rmin, rmax;
-	double	topotest, topog, dtopo;
-	int	nfound;
-	int	i, j, ii, jj, k;
-
-	/* get pointer to topogrid structure */
-	topogrid = (struct mb_topogrid_struct *) topogrid_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n", function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:                   %d\n", verbose);
-		fprintf(stderr,"dbg2       navlon:                    %f\n", navlon);
-		fprintf(stderr,"dbg2       navlat:                    %f\n", navlat);
-		fprintf(stderr,"dbg2       altitude:                  %f\n", altitude);
-		fprintf(stderr,"dbg2       sonardepth:                %f\n", sonardepth);
-		fprintf(stderr,"dbg2       mtodeglon:                 %f\n", mtodeglon);
-		fprintf(stderr,"dbg2       mtodeglat:                 %f\n", mtodeglat);
-		fprintf(stderr,"dbg2       vx:                        %f\n", vx);
-		fprintf(stderr,"dbg2       vy:                        %f\n", vy);
-		fprintf(stderr,"dbg2       vz:                        %f\n", vz);
-		fprintf(stderr,"dbg2       topogrid:                  %p\n", topogrid);
-		fprintf(stderr,"dbg2       topogrid->projection_mode: %d\n", topogrid->projection_mode);
-		fprintf(stderr,"dbg2       topogrid->projection_id:   %s\n", topogrid->projection_id);
-		fprintf(stderr,"dbg2       topogrid->nodatavalue:     %f\n", topogrid->nodatavalue);
-		fprintf(stderr,"dbg2       topogrid->nxy:             %d\n", topogrid->nxy);
-		fprintf(stderr,"dbg2       topogrid->nx:              %d\n", topogrid->nx);
-		fprintf(stderr,"dbg2       topogrid->ny:              %d\n", topogrid->ny);
-		fprintf(stderr,"dbg2       topogrid->min:             %f\n", topogrid->min);
-		fprintf(stderr,"dbg2       topogrid->max:             %f\n", topogrid->max);
-		fprintf(stderr,"dbg2       topogrid->xmin:            %f\n", topogrid->xmin);
-		fprintf(stderr,"dbg2       topogrid->xmax:            %f\n", topogrid->xmax);
-		fprintf(stderr,"dbg2       topogrid->ymin:            %f\n", topogrid->ymin);
-		fprintf(stderr,"dbg2       topogrid->ymax:            %f\n", topogrid->ymax);
-		fprintf(stderr,"dbg2       topogrid->dx:              %f\n", topogrid->dx);
-		fprintf(stderr,"dbg2       topogrid->dy               %f\n", topogrid->dy);
-		fprintf(stderr,"dbg2       topogrid->data:            %p\n", topogrid->data);
-		}
-
-	/* initialize search for intersection */
-	done = MB_NO;
-	iteration = 0;
-	topotest = 0.0;
-	dtopo = 0.0;
-	rmin = 0.0;
-	
-	/* if altitude specified use it for initial guess */
-	if (altitude > 0.0)
-		{
-		dr = altitude / 20;
-		r = altitude / vz - dr;
-		rmax = 4 * altitude / vz;
-		}
-		
-	/* if altitude not specified use altitude at location */
-	else
-		{
-		nfound = 0;
-		topog = 0.0;
-		i = (int)((navlon - topogrid->xmin) / topogrid->dx);
-		j = (int)((navlat - topogrid->ymin) / topogrid->dy);
-		if (i >= 0 && i < topogrid->nx - 1
-		    && j >= 0 && j < topogrid->ny - 1)
-			{
-			for (ii=i;ii<=i+1;ii++)
-			for (jj=j;jj<=j+1;jj++)
-			    {
-			    k = ii * topogrid->ny + jj;
-			    if (topogrid->data[k] != topogrid->nodatavalue)
-				{
-				nfound++;
-				topog += topogrid->data[k];
-				}
-			    }
-			}
-		if (nfound > 0)
-			{
-			topog /= (double)nfound;
-			altitude = -sonardepth - topog;
-			dr = altitude / 20;
-			r = altitude / vz - dr;
-			rmax = 4 * altitude / vz;
-			}
-		else
-			{
-			done = MB_YES;
-			status = MB_FAILURE;
-			*error = MB_ERROR_NOT_ENOUGH_DATA;
-			}
-		}
-
-	/* test different ranges along the vector until the grid is intersected */
-	while (done == MB_NO && iteration < iteration_max)
-		{
-		/* update the range to be tested */
-		r += dr;
-
-		/* get position of range estimate projected along the vector */
-		lontest = navlon + mtodeglon * vx * r;
-		lattest = navlat + mtodeglat * vy * r;
-		topotest = -sonardepth - vz * r;
-
-		/* get topography value at that point */
-		nfound = 0;
-		topog = 0.0;
-		i = (int)((lontest - topogrid->xmin) / topogrid->dx);
-		j = (int)((lattest - topogrid->ymin) / topogrid->dy);
-		if (i >= 0 && i < topogrid->nx - 1
-		    && j >= 0 && j < topogrid->ny - 1)
-			{
-			for (ii=i;ii<=i+1;ii++)
-			for (jj=j;jj<=j+1;jj++)
-			    {
-			    k = ii * topogrid->ny + jj;
-			    if (topogrid->data[k] != topogrid->nodatavalue)
-				{
-				nfound++;
-				topog += topogrid->data[k];
-				}
-			    }
-			}
-		else
-			{
-			done = MB_YES;
-			status = MB_FAILURE;
-			*error = MB_ERROR_NOT_ENOUGH_DATA;
-			}
-		if (nfound > 0)
-			{
-			topog /= (double)nfound;
-			}
-
-		/* compare topographies at projected position */
-		if (nfound > 0)
-			{
-			dtopo = topotest - topog;
-			if (fabs(dtopo) < topotolerance)
-				{
-				done = MB_YES;
-				}
-			else
-				{
-				/* get bounds on where vector crosses the grid */
-				if (dtopo < 0.0)
-					rmax = MIN(rmax, r);
-				else if (dtopo > 0.0)
-					rmin = MIN(rmin, r);
-
-				/* estimate distance to crossing point */
-				dr = dtopo / vz;
-
-				/* make sure we don't overshoot the bounds */
-				if (r + dr >= rmax)
-					dr = 0.5 * (rmax - r);
-				if (r + dr <= rmin)
-					dr = 0.5 * (rmin - r);
-				}
-			}
-		/* keep trying */
-		else
-			{
-			}
-
-		/* keep count of iterations */
-		iteration++;
-		}
-
-	/* if success return the result */
-	*lon = navlon + mtodeglon * vx * r;
-	*lat = navlat + mtodeglat * vy * r;
-	*topo = -sonardepth - vz * r;
-	*range = r;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MB7K2SS function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       lon:             %f\n",*lon);
-		fprintf(stderr,"dbg2       lat:             %f\n",*lat);
-		fprintf(stderr,"dbg2       topo:            %f\n",*topo);
-		fprintf(stderr,"dbg2       range:           %f\n",*range);
-		fprintf(stderr,"dbg2       error:           %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:          %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_topogrid_getangletable(int verbose, void *topogrid_ptr,
-				int nangle, double angle_min, double angle_max,
-				double navlon, double navlat, double heading,
-				double altitude, double sonardepth, double pitch,
-				double *table_angle, double *table_xtrack,
-				double *table_ltrack, double *table_altitude,
-				double *table_range, int *error)
-{
-	char	*function_name = "mb_topogrid_getangletable";
-	int	status = MB_SUCCESS;
-	struct mb_topogrid_struct *topogrid;
-	double	mtodeglon, mtodeglat;
-	double	dangle;
-	double	rr, xx, zz;
-	double	alpha, beta, theta, phi;
-	double	vx, vy, vz;
-	double	lon, lat, topo;
-	int	nset, first, last;
-	int	i;
-
-	/* get pointer to topogrid structure */
-	topogrid = (struct mb_topogrid_struct *) topogrid_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n", function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:                   %d\n", verbose);
-		fprintf(stderr,"dbg2       nangle:                    %d\n", nangle);
-		fprintf(stderr,"dbg2       angle_min:                 %f\n", angle_min);
-		fprintf(stderr,"dbg2       angle_max:                 %f\n", angle_max);
-		fprintf(stderr,"dbg2       navlon:                    %f\n", navlon);
-		fprintf(stderr,"dbg2       navlat:                    %f\n", navlat);
-		fprintf(stderr,"dbg2       heading:                   %f\n", heading);
-		fprintf(stderr,"dbg2       altitude:                  %f\n", altitude);
-		fprintf(stderr,"dbg2       sonardepth:                %f\n", sonardepth);
-		fprintf(stderr,"dbg2       pitch:                     %f\n", pitch);
-		fprintf(stderr,"dbg2       topogrid:                  %p\n", topogrid);
-		fprintf(stderr,"dbg2       topogrid->projection_mode: %d\n", topogrid->projection_mode);
-		fprintf(stderr,"dbg2       topogrid->projection_id:   %s\n", topogrid->projection_id);
-		fprintf(stderr,"dbg2       topogrid->nodatavalue:     %f\n", topogrid->nodatavalue);
-		fprintf(stderr,"dbg2       topogrid->nxy:             %d\n", topogrid->nxy);
-		fprintf(stderr,"dbg2       topogrid->nx:              %d\n", topogrid->nx);
-		fprintf(stderr,"dbg2       topogrid->ny:              %d\n", topogrid->ny);
-		fprintf(stderr,"dbg2       topogrid->min:             %f\n", topogrid->min);
-		fprintf(stderr,"dbg2       topogrid->max:             %f\n", topogrid->max);
-		fprintf(stderr,"dbg2       topogrid->xmin:            %f\n", topogrid->xmin);
-		fprintf(stderr,"dbg2       topogrid->xmax:            %f\n", topogrid->xmax);
-		fprintf(stderr,"dbg2       topogrid->ymin:            %f\n", topogrid->ymin);
-		fprintf(stderr,"dbg2       topogrid->ymax:            %f\n", topogrid->ymax);
-		fprintf(stderr,"dbg2       topogrid->dx:              %f\n", topogrid->dx);
-		fprintf(stderr,"dbg2       topogrid->dy               %f\n", topogrid->dy);
-		fprintf(stderr,"dbg2       topogrid->data:            %p\n", topogrid->data);
-		}
-
-	/* loop over all of the angles */
-	mb_coor_scale(verbose,navlat, &mtodeglon, &mtodeglat);
-	dangle = (angle_max - angle_min) / (nangle - 1);
-	alpha = pitch;
-	nset = 0;
-	for (i=0;i<nangle;i++)
-		{
-		/* get angles in takeoff coordinates */
-		table_angle[i] = angle_min + dangle * i;
-		beta = 90.0 - table_angle[i];
-		mb_rollpitch_to_takeoff(
-			verbose,
-			alpha, beta,
-			&theta, &phi,
-			error);
-
-		/* calculate unit vector relative to the vehicle */
-		vz = cos(DTR * theta);
-		vx = sin(DTR * theta) * cos(DTR * phi);
-		vy = sin(DTR * theta) * sin(DTR * phi);
-
-		/* rotate unit vector by vehicle heading */
-		vx = vx * cos(DTR * heading) + vy * sin(DTR * heading);
-		vy = -vx * sin(DTR * heading) + vy * cos(DTR * heading);
-
-		/* find the range where this vector intersects the grid */
-		status = mb_topogrid_intersect(verbose, topogrid_ptr,
-						navlon, navlat, altitude, sonardepth,
-						mtodeglon, mtodeglat, vx, vy, vz,
-						&lon, &lat, &topo, &rr, error);
-
-		/* get the position from successful intersection with the grid */
-		if (status == MB_SUCCESS)
-			{
-			zz = rr * cos(DTR * theta);
-			xx = rr * sin(DTR * theta);
-			table_xtrack[i] = xx * cos(DTR * phi);
-			table_ltrack[i] = xx * sin(DTR * phi);
-			table_altitude[i] = zz;
-			table_range[i] = rr;
-			nset++;
-			}
-
-		/* zero table values for the moment */
-		else
-			{
-			table_range[i] = 0.0;
-			}
-		}
-
-	/* now deal with any unset table entries */
-	if (nset < nangle)
-		{
-		/* find first and last table entries set if possible */
-		if (nset > 0)
-			{
-			first = nangle;
-			last = -1;
-			for (i=0;i<nangle;i++)
-				{
-				if (table_range[i] > 0.0)
-					{
-					first = MIN(i,first);
-					last = MAX(i,last);
-					}
-				}
-
-			/* apply flat bottom calculation to unset entries */
-			for (i=0;i<nangle;i++)
-				{
-				if (table_range[i] <= 0.0)
-					{
-					/* get angles in takeoff coordinates */
-					table_angle[i] = angle_min + dangle * i;
-					beta = 90.0 - table_angle[i];
-					mb_rollpitch_to_takeoff(
-						verbose,
-						alpha, beta,
-						&theta, &phi,
-						error);
-
-					if (nset == 0)
-						{
-						table_altitude[i] = altitude;
-						}
-					else if (i < first)
-						{
-						table_altitude[i] = table_altitude[first];
-						}
-					else if (i > last)
-						{
-						table_altitude[i] = table_altitude[last];
-						}
-					else
-						{
-						table_altitude[i] = 0.5 * (table_altitude[first] + table_altitude[last]);
-						}
-
-					table_range[i]  = table_altitude[first] / cos(DTR * theta);
-					xx = table_range[i] * sin(DTR * theta);
-					table_xtrack[i] = xx * cos(DTR * phi);
-					table_ltrack[i] = xx * sin(DTR * phi);
-					nset++;
-					}
-				}
-			}
-		}
-
-	/* reset error condition */
-	if (nset >= nangle)
-		{
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MB7K2SS function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       Lookup tables:\n");
-		for (i=0;i<nangle;i++)
-			fprintf(stderr,"dbg2         %d %f %f %f %f %f\n",
-				i, table_angle[i], table_xtrack[i], table_ltrack[i], table_altitude[i], table_range[i]);
-		fprintf(stderr,"dbg2       error:           %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:          %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbaux/mb_readwritegrd.c b/src/mbaux/mb_readwritegrd.c
deleted file mode 100644
index 27063cd..0000000
--- a/src/mbaux/mb_readwritegrd.c
+++ /dev/null
@@ -1,629 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mb_grdio.c	12/10/2007
- *    $Id: mb_readwritegrd.c 2247 2015-05-29 21:28:28Z caress $
- *
- *    Copyright (c) 2007-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * Standalone functions to read or write a GMT grid for programs not interfacing
- * with other GMT functionality.
- *
- * Author:	D. W. Caress
- * Date:	September 3, 2007
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <unistd.h>
-#include <math.h>
-#include <string.h>
-#include <time.h>
-
-/* GMT include files */
-#include "gmt.h"
-
-/* MBIO include files */
-#include "mb_status.h"
-#include "mb_define.h"
-#include "mb_aux.h"
-
-/* Projection defines */
-#define ModelTypeProjected	     1
-#define ModelTypeGeographic	     2
-#define GCS_WGS_84		  4326
-
-static char rcs_id[] = "$Id: mb_readwritegrd.c 2247 2015-05-29 21:28:28Z caress $";
-
-/*--------------------------------------------------------------------------*/
-int mb_read_gmt_grd(int verbose, char *grdfile,
-			int	*grid_projection_mode,
-			char	*grid_projection_id,
-			float	*nodatavalue,
-			int	*nxy,
-			int	*nx,
-			int	*ny,
-			double	*min,
-			double	*max,
-			double	*xmin,
-			double	*xmax,
-			double	*ymin,
-			double	*ymax,
-			double	*dx,
-			double	*dy,
-			float	**data,
-			float	**data_dzdx,
-			float	**data_dzdy,
-			int	*error)
-{
-	char function_name[] = "mb_read_gmt_grd";
-	int	status = MB_SUCCESS;
-	void *API = NULL;			/* GMT API control structure pointer */
-	struct GMT_GRID *G = NULL;		/* GMT grid structure pointer */
-	struct GMT_GRID_HEADER *header;		/* GMT grid header structure pointer */
-	int	modeltype;
-	int	projectionid;
-        mb_path    projectionname;
-	int	nscan;
-	int	utmzone;
-	char	NorS;
-	float	*usedata;
-	double	mtodeglon, mtodeglat;
-	double	ddx, ddy;
-	int	kx0, kx2, ky0, ky2;
-	int	i, j, k, ii, jj, kk;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBBA function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:         %d\n", verbose);
-		fprintf(stderr,"dbg2       grdfile:         %s\n", grdfile);
-		}
-		
-	/* Initializing new GMT session */
-	if ((API = GMT_Create_Session (function_name, 2U, 0U, NULL)) == NULL) exit (EXIT_FAILURE);
-	
-	/* read in the grid */
-	if ((G = GMT_Read_Data (API, GMT_IS_GRID, GMT_IS_FILE, GMT_IS_SURFACE, GMT_GRID_ALL, NULL, grdfile, NULL)) == NULL) exit (EXIT_FAILURE);
-	header = G->header;
-
-	/* proceed if ok */
-	if (status == MB_SUCCESS)
-		{
-		/* try to get projection from the grd file remark */
-		if (strncmp(&(header->remark[2]), "Projection: ", 12) == 0)
-			{
-			if ((nscan = sscanf(&(header->remark[2]), "Projection: UTM%d%c", &utmzone, &NorS)) == 2)
-				{
-				if (NorS == 'N')
-					{
-					projectionid = 32600 + utmzone;
-					}
-				else if (NorS == 'S')
-					{
-					projectionid = 32700 + utmzone;
-					}
-				else
-					{
-					projectionid = 32600 + utmzone;
-					}
-				modeltype = ModelTypeProjected;
-				sprintf(projectionname, "UTM%2.2d%c", utmzone, NorS);
-				*grid_projection_mode = MB_PROJECTION_PROJECTED;
-				sprintf(grid_projection_id, "epsg%d", projectionid);
-				}
-			else if ((nscan = sscanf(&(header->remark[2]), "Projection: epsg%d", &projectionid)) == 1)
-				{
-				sprintf(projectionname, "epsg%d", projectionid);
-				modeltype = ModelTypeProjected;
-				*grid_projection_mode = MB_PROJECTION_PROJECTED;
-				sprintf(grid_projection_id, "epsg%d", projectionid);
-				}
-			else
-				{
-				strcpy(projectionname, "Geographic WGS84");
-				modeltype = ModelTypeGeographic;
-				projectionid = GCS_WGS_84;
-				*grid_projection_mode = MB_PROJECTION_GEOGRAPHIC;
-				sprintf(grid_projection_id, "epsg%d", projectionid);
-				}
-			}
-		else
-			{
-			strcpy(projectionname, "Geographic WGS84");
-			modeltype = ModelTypeGeographic;
-			projectionid = GCS_WGS_84;
-			*grid_projection_mode = MB_PROJECTION_GEOGRAPHIC;
-			sprintf(grid_projection_id, "epsg%d", projectionid);
-			}
-
-		/* set up internal arrays */
-    		*nodatavalue = MIN(MB_DEFAULT_GRID_NODATA, header->z_min - 10 * (header->z_max - header->z_min));
-    		*nxy = header->nx * header->ny;
-    		*nx = header->nx;
-    		*ny = header->ny;
-    		*xmin = header->wesn[0];
-    		*xmax = header->wesn[1];
-    		*ymin = header->wesn[2];
-    		*ymax = header->wesn[3];
-    		*dx = header->inc[0];
-    		*dy = header->inc[1];
-    		*min = header->z_min;
-    		*max = header->z_max;
-
-    		status = mb_mallocd(verbose, __FILE__,__LINE__, sizeof(float) * (*nxy),
-    					(void **)&usedata, error);
-    		if (status == MB_SUCCESS)
-			{
-			*data = usedata;
-			}
-    		if (status == MB_SUCCESS && data_dzdx != NULL)
-			{
-			status = mb_mallocd(verbose, __FILE__,__LINE__, sizeof(float) * (*nxy),
-    					(void **)&usedata, error);
-			*data_dzdx = usedata;
-			}
-    		if (status == MB_SUCCESS && data_dzdy != NULL)
-			{
-			status = mb_mallocd(verbose, __FILE__,__LINE__, sizeof(float) * (*nxy),
-    					(void **)&usedata, error);
-			*data_dzdy = usedata;
-			}
-		}
-
-	/* copy grid data, reordering to internal convention */
-	if (status == MB_SUCCESS)
-		{
-		for (i=0;i<*nx;i++)
-		for (j=0;j<*ny;j++)
-			{
-			k = i * *ny + j;
-			kk = (*ny + header->pad[2] + header->pad[3] - 1 - j)
-				* (*nx + header->pad[0] + header->pad[1])
-				+ (i + header->pad[0]);
-			if (MB_IS_FNAN(G->data[kk]))
-				(*data)[k] = *nodatavalue;
-			else
-				(*data)[k] = G->data[kk];
-			}
-		}
-
-	/* calculate derivatives */
-	if (status == MB_SUCCESS && data_dzdx != NULL && data_dzdy != NULL)
-		{
-		ddx = *dx;
-		ddy = *dy;
-		if (*grid_projection_mode == MB_PROJECTION_GEOGRAPHIC)
-			{
-			mb_coor_scale(verbose,0.5 * (*ymin + *ymax), &mtodeglon, &mtodeglat);
-			ddx /= mtodeglon;
-			ddy /= mtodeglon;
-			}
-		for (i=0;i<*nx;i++)
-		for (j=0;j<*ny;j++)
-			{
-			k = i * (*ny) + j;
-			ii = 0;
-			jj = 0;
-			if (i > 0)
-				{
-				kx0 = (i - 1) * (*ny) + j;
-				ii++;
-				}
-			else
-				kx0 = k;
-			if (i < *nx - 1)
-				{
-				kx2 = (i + 1) * (*ny) + j;
-				ii++;
-				}
-			else
-				kx0 = k;
-			if (j > 0)
-				{
-				ky0 = i * (*ny) + j + 1;
-				jj++;
-				}
-			else
-				ky0 = k;
-			if (j < *ny - 1)
-				{
-				ky2 = i * (*ny) + j - 1;
-				jj++;
-				}
-			else
-				ky2 = k;
-			if (ii > 0)
-				(*data_dzdx)[k] = ((*data)[kx2] - (*data)[kx0]) / (((double)ii) * ddx);
-			if (jj > 0)
-				(*data_dzdy)[k] = ((*data)[ky2] - (*data)[ky0]) / (((double)jj) * ddy);
-			}
-		}
-
-	/* Destroy GMT session */
-	if (GMT_Destroy_Session (API)) exit (EXIT_FAILURE);
-
-	/* print debug info */
-	if (verbose > 0)
-		{
-		fprintf(stderr,"\nGrid read:\n");
-		fprintf(stderr,"  Dimensions:     %d %d\n", header->nx, header->ny);
-		fprintf(stderr,"  Registration:   %d\n", header->registration);
-		if (modeltype == ModelTypeProjected)
-			{
-			fprintf(stderr,"  Projected Coordinate System Name: %s\n", projectionname);
-			fprintf(stderr,"  Projected Coordinate System ID:   %d\n", projectionid);
-			fprintf(stderr,"  Easting:    %f %f  %f\n",
-				header->wesn[0], header->wesn[1], header->inc[0]);
-			fprintf(stderr,"  Northing:   %f %f  %f\n",
-				header->wesn[2], header->wesn[3], header->inc[1]);
-			}
-		else
-			{
-			fprintf(stderr,"  Geographic Coordinate System Name: %s\n", projectionname);
-			fprintf(stderr,"  Geographic Coordinate System ID:   %d\n", projectionid);
-			fprintf(stderr,"  Longitude:  %f %f  %f\n",
-				header->wesn[0], header->wesn[1], header->inc[0]);
-			fprintf(stderr,"  Latitude:   %f %f  %f\n",
-				header->wesn[2], header->wesn[3], header->inc[1]);
-			}
-		fprintf(stderr,"  Grid Projection Mode:     %d\n", *grid_projection_mode);
-		fprintf(stderr,"  Grid Projection ID:       %s\n", grid_projection_id);
-		fprintf(stderr,"  Data Extrema:             %f %f\n", header->z_min, header->z_max);
-		fprintf(stderr,"  Other Grid Parameters:\n");
-		fprintf(stderr,"    z_scale_factor:         %f\n", header->z_scale_factor);
-		fprintf(stderr,"    z_add_offset:           %f\n", header->z_add_offset);
-		fprintf(stderr,"    type:                   %d\n", header->type);
-		fprintf(stderr,"    bits:                   %d\n", header->bits);
-		fprintf(stderr,"    complex_mode:           %d\n", header->complex_mode);
-		fprintf(stderr,"    mx:                     %d\n", header->mx);
-		fprintf(stderr,"    my:                     %d\n", header->my);
-		fprintf(stderr,"    nm:                     %zu\n", header->nm);
-		fprintf(stderr,"    size:                   %zu\n", header->size);
-		fprintf(stderr,"    pad:                    %d %d %d %d\n", header->pad[0], header->pad[1], header->pad[2], header->pad[3]);
-		fprintf(stderr,"    data ptr:               %p\n", G->data);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBBA function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       Dimensions: %d %d\n", header->nx, header->ny);
-		if (modeltype == ModelTypeProjected)
-			{
-			fprintf(stderr,"dbg2       Projected Coordinate System Name: %s\n", projectionname);
-			fprintf(stderr,"dbg2       Projected Coordinate System ID:   %d\n", projectionid);
-			fprintf(stderr,"dbg2       Easting:                  %f %f  %f\n",header->wesn[0], header->wesn[1], header->inc[0]);
-			fprintf(stderr,"dbg2       Northing:                 %f %f  %f\n",header->wesn[2], header->wesn[3], header->inc[1]);
-			}
-		else
-			{
-			fprintf(stderr,"dbg2       Geographic Coordinate System Name: %s\n", projectionname);
-			fprintf(stderr,"dbg2       Geographic Coordinate System ID:   %d\n", projectionid);
-			fprintf(stderr,"dbg2       Longitude:                %f %f  %f\n",header->wesn[0], header->wesn[1], header->inc[0]);
-			fprintf(stderr,"dbg2       Latitude:                 %f %f  %f\n",header->wesn[2], header->wesn[3], header->inc[1]);
-			}
-		fprintf(stderr,"dbg2       Internal Grid Projection Mode: %d\n", *grid_projection_mode);
-		fprintf(stderr,"dbg2       Internal Grid Projection ID:   %s\n", grid_projection_id);
-		fprintf(stderr,"Data Read:\n");
-		fprintf(stderr,"dbg2       grid_projection_mode:     %d\n", *grid_projection_mode);
-		fprintf(stderr,"dbg2       grid_projection_id:       %s\n", grid_projection_id);
-		fprintf(stderr,"dbg2       nodatavalue:              %f\n", *nodatavalue);
-		fprintf(stderr,"dbg2       nx:                       %d\n", *nx);
-		fprintf(stderr,"dbg2       ny:                       %d\n", *ny);
-		fprintf(stderr,"dbg2       min:                      %f\n", *min);
-		fprintf(stderr,"dbg2       max:                      %f\n", *max);
-		fprintf(stderr,"dbg2       xmin:                     %f\n", *xmin);
-		fprintf(stderr,"dbg2       xmax:                     %f\n", *xmax);
-		fprintf(stderr,"dbg2       ymin:                     %f\n", *ymin);
-		fprintf(stderr,"dbg2       ymax:                     %f\n", *ymax);
-		fprintf(stderr,"dbg2       dx:                       %f\n", *dx);
-		fprintf(stderr,"dbg2       dy:                       %f\n", *dy);
-		fprintf(stderr,"dbg2       data:                     %p\n", *data);
-		fprintf(stderr,"dbg2       error:           %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:          %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}/*--------------------------------------------------------------------*/
-/*
- * function write_cdfgrd writes output grid to a
- * GMT version 2 netCDF grd file
- */
-int mb_write_gmt_grd(int verbose,
-			char *grdfile,
-			float *grid,
-			float nodatavalue,
-			int nx,
-			int ny,
-			double xmin,
-			double xmax,
-			double ymin,
-			double ymax,
-			double zmin,
-			double zmax,
-			double dx,
-			double dy,
-			char *xlab,
-			char *ylab,
-			char *zlab,
-			char *titl,
-			char *projection,
-			int argc,
-			char **argv,
-			int *error)
-{
-	char	*function_name = "write_cdfgrd";
-	int	status = MB_SUCCESS;
-	
-	double	wesn[4];
-	double	inc[2];
-	unsigned int registration;
-	int	pad;
-	void *API = NULL;			/* GMT API control structure pointer */
-	struct GMT_GRID *G = NULL;		/* GMT grid structure pointer */
-	struct GMT_GRID_HEADER *header;		/* GMT grid header structure pointer */
-
-	int	modeltype;
-	int	projectionid;
-	int	grid_projection_mode;
-        mb_path	projectionname;
-	mb_path	grid_projection_id;
-	mb_path	program_name;
-	mb_path	remark;
-	int	nscan;
-	int	utmzone;
-	char	NorS;
-	time_t	right_now;
-	char	date[32], user[MB_PATH_MAXLINE], *user_ptr, host[MB_PATH_MAXLINE];
-	int	first = MB_NO;
-	double	min = 0.0;
-	double	max = 0.0;
-	double	NaN;
-	int	nx_node_registration;
-	int	i, j, k, kk;
-	char	*ctime();
-	char	*getenv();
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  Function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       grdfile:    %s\n",grdfile);
-		fprintf(stderr,"dbg2       grid:       %p\n",(void *)grid);
-		fprintf(stderr,"dbg2       nodatavalue:%f\n", nodatavalue);
-		fprintf(stderr,"dbg2       nx:         %d\n",nx);
-		fprintf(stderr,"dbg2       ny:         %d\n",ny);
-		fprintf(stderr,"dbg2       xmin:       %f\n",xmin);
-		fprintf(stderr,"dbg2       xmax:       %f\n",xmax);
-		fprintf(stderr,"dbg2       ymin:       %f\n",ymin);
-		fprintf(stderr,"dbg2       ymax:       %f\n",ymax);
-		fprintf(stderr,"dbg2       dx:         %f\n",dx);
-		fprintf(stderr,"dbg2       dy:         %f\n",dy);
-		fprintf(stderr,"dbg2       xlab:       %s\n",xlab);
-		fprintf(stderr,"dbg2       ylab:       %s\n",ylab);
-		fprintf(stderr,"dbg2       zlab:       %s\n",zlab);
-		fprintf(stderr,"dbg2       projection: %s\n",projection);
-		fprintf(stderr,"dbg2       titl:       %s\n",titl);
-		fprintf(stderr,"dbg2       argc:       %d\n",argc);
-		fprintf(stderr,"dbg2       *argv:      %p\n",(void *)*argv);
-		}
-		
-	/* Initializing new GMT session */
-	if ((API = GMT_Create_Session (function_name, 2U, 0U, NULL)) == NULL)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_MEMORY_FAIL;
-		return(status);
-		}
-	
-	/* set grid creation control values */
-	/* GMT_GRID_NODE_REG (0) for node grids, GMT_GRID_PIXEL_REG (1) for pixel grids */
-	nx_node_registration = lround((xmax - xmin) / dx + 1);
-	if (nx == nx_node_registration)
-		{
-		registration = GMT_GRID_NODE_REG;
-		}
-	else if (nx == nx_node_registration - 1)
-		{
-		registration = GMT_GRID_PIXEL_REG;
-		}
-	else
-		{
-		registration = GMT_GRID_DEFAULT_REG;
-		}
-
-	wesn[0] = xmin;                   	/* Min/max x and y coordinates */
-	wesn[1] = xmax;                   	/* Min/max x and y coordinates */
-	wesn[2] = ymin;                   	/* Min/max x and y coordinates */
-	wesn[3] = ymax;                   	/* Min/max x and y coordinates */
-	inc[0] = dx;                    	/* x and y increment */
-	inc[1] = dy;                    	/* x and y increment */
-	pad = 0;
-	
-	/* create structure for the grid */
-	if ((G = GMT_Create_Data (API, GMT_IS_GRID, GMT_IS_SURFACE, GMT_GRID_ALL, NULL, wesn, inc,
-				     registration, pad, NULL)) == NULL)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_MEMORY_FAIL;
-		return(status);
-		}
-		
-	/* Get some projection and user info needed for the grid remark field */
-	if ((nscan = sscanf(projection, "UTM%d%c", &utmzone, &NorS)) == 2)
-		{
-		if (NorS == 'N')
-			{
-			projectionid = 32600 + utmzone;
-			}
-		else if (NorS == 'S')
-			{
-			projectionid = 32700 + utmzone;
-			}
-		else
-			{
-			projectionid = 32600 + utmzone;
-			}
-		modeltype = ModelTypeProjected;
-		sprintf(projectionname, "UTM%2.2d%c", utmzone, NorS);
-		grid_projection_mode = MB_PROJECTION_PROJECTED;
-		sprintf(grid_projection_id, "epsg%d", projectionid);
-		}
-	else if ((nscan = sscanf(projection, "epsg%d", &projectionid)) == 1)
-		{
-		sprintf(projectionname, "epsg%d", projectionid);
-		modeltype = ModelTypeProjected;
-		grid_projection_mode = MB_PROJECTION_PROJECTED;
-		sprintf(grid_projection_id, "epsg%d", projectionid);
-		}
-	else
-		{
-		strcpy(projectionname, "Geographic WGS84");
-		modeltype = ModelTypeGeographic;
-		projectionid = GCS_WGS_84;
-		grid_projection_mode = MB_PROJECTION_GEOGRAPHIC;
-		sprintf(grid_projection_id, "epsg%d", projectionid);
-		}
-	if (argc > 0)
-		strncpy(program_name, argv[0], MB_PATH_MAXLINE);
-	else
-		strcpy(program_name, "\0");
-	right_now = time((time_t *)0);
-	strcpy(date,ctime(&right_now));
-        date[strlen(date)-1] = '\0';
-	if ((user_ptr = getenv("USER")) == NULL)
-		user_ptr = getenv("LOGNAME");
-	if (user_ptr != NULL)
-		strcpy(user,user_ptr);
-	else
-		strcpy(user, "unknown");
-	gethostname(host, MB_PATH_MAXLINE);
-	sprintf(remark,"\n\tProjection: %s\n\tGrid created by %s\n\tMB-system Version %s\n\tRun by <%s> on <%s> at <%s>",
-		projection,program_name,MB_VERSION,user,host,date);
-	
-	/* set grid labels and remark */
-	header = G->header;
-	strcpy(header->command, program_name); /* name of generating command */
-	strcpy(header->x_units, xlab);     /* units in x-direction */
-	strcpy(header->y_units, ylab);     /* units in y-direction */
-	strcpy(header->z_units, zlab);     /* grid value units */
-	strcpy(header->title, titl);      /* name of data set */
-	strncpy(header->remark, remark, GMT_GRID_REMARK_LEN160);
-
-	/* recopy grid data, reordering from internal convention to grd file convention */
-	if (status == MB_SUCCESS)
-		{
-		MB_MAKE_FNAN(NaN);
-		for (i=0;i<nx;i++)
-		for (j=0;j<ny;j++)
-			{
-			k = i * ny + j;
-			kk = (ny - 1 - j) * nx + i;
-			if (grid[k] == nodatavalue)
-				G->data[kk] = NaN;
-			else
-				{
-				G->data[kk] = grid[k];
-				if (first == MB_YES)
-					{
-					min = grid[k];
-					max = grid[k];
-					first = MB_NO;
-					}
-				else
-					{
-					min = MIN(min, grid[k]);
-					max = MAX(max, grid[k]);
-					}
-				}
-			}
-		}
-
-	/* print info */
-	if (verbose > 0)
-		{
-		fprintf(stderr,"\nGrid to be written:\n");
-		fprintf(stderr,"  Dimensions:     %d %d\n", header->nx, header->ny);
-		fprintf(stderr,"  Registration:   %d\n", header->registration);
-		if (modeltype == ModelTypeProjected)
-			{
-			fprintf(stderr,"  Projected Coordinate System Name: %s\n", projectionname);
-			fprintf(stderr,"  Projected Coordinate System ID:   %d\n", projectionid);
-			fprintf(stderr,"  Easting:    %f %f  %f\n",
-				header->wesn[0], header->wesn[1], header->inc[0]);
-			fprintf(stderr,"  Northing:   %f %f  %f\n",
-				header->wesn[2], header->wesn[3], header->inc[1]);
-			}
-		else
-			{
-			fprintf(stderr,"  Geographic Coordinate System Name: %s\n", projectionname);
-			fprintf(stderr,"  Geographic Coordinate System ID:   %d\n", projectionid);
-			fprintf(stderr,"  Longitude:  %f %f  %f\n",
-				header->wesn[0], header->wesn[1], header->inc[0]);
-			fprintf(stderr,"  Latitude:   %f %f  %f\n",
-				header->wesn[2], header->wesn[3], header->inc[1]);
-			}
-		fprintf(stderr,"  Grid Projection Mode:     %d\n", grid_projection_mode);
-		fprintf(stderr,"  Grid Projection ID:       %s\n", grid_projection_id);
-		fprintf(stderr,"  Data Extrema:             %f %f\n", header->z_min, header->z_max);
-		fprintf(stderr,"  Other Grid Parameters:\n");
-		fprintf(stderr,"    z_scale_factor:         %f\n", header->z_scale_factor);
-		fprintf(stderr,"    z_add_offset:           %f\n", header->z_add_offset);
-		fprintf(stderr,"    type:                   %d\n", header->type);
-		fprintf(stderr,"    bits:                   %d\n", header->bits);
-		fprintf(stderr,"    complex_mode:           %d\n", header->complex_mode);
-		fprintf(stderr,"    mx:                     %d\n", header->mx);
-		fprintf(stderr,"    my:                     %d\n", header->my);
-		fprintf(stderr,"    nm:                     %zu\n", header->nm);
-		fprintf(stderr,"    size:                   %zu\n", header->size);
-		fprintf(stderr,"    pad:                    %d %d %d %d\n", header->pad[0], header->pad[1], header->pad[2], header->pad[3]);
-		fprintf(stderr,"    data ptr:               %p\n", G->data);
-		}
-
-	/* write out the grid */
-	if (GMT_Write_Data (API, GMT_IS_GRID, GMT_IS_FILE, GMT_IS_SURFACE, GMT_GRID_ALL, NULL, grdfile, G) != 0)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-
-	/* Destroy GMT session */
-	if (GMT_Destroy_Session (API) != 0)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbaux/mb_spline.c b/src/mbaux/mb_spline.c
deleted file mode 100644
index ee75815..0000000
--- a/src/mbaux/mb_spline.c
+++ /dev/null
@@ -1,529 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mb_spline.c	10/11/00
- *    $Id: mb_spline.c 2247 2015-05-29 21:28:28Z caress $
- *
- *    Copyright (c) 2000-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * This source file includes 1D interpolation routines.
- *
- * The 1D spline interpolation routines are modified from spline()
- * and splint() in the book:
- *   Press, W. H., S. A. Teukolsky, W. T. Vetterling, B. P. Flannery,
- *   Numerical Recipies in C: the Art of Scientific Computing,
- *   Cambridge University Press, 1988.
- * The 1D linear interpolation routine is homegrown, but mimics the
- * spline routines in usage.
- *
- * Author:	D. W. Caress
- * Date:	October 11, 2000
- *
- */
-
-/* standard global include files */
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_define.h"
-#include "mb_aux.h"
-
-static char rcs_id[]="$Id: mb_spline.c 2247 2015-05-29 21:28:28Z caress $";
-
-/*--------------------------------------------------------------------------*/
-int mb_spline_init(int verbose, double *x, double *y,
-	int n, double yp1, double ypn, double *y2, int *error)
-{
-	char	*function_name = "mb_spline_init";
-	int	status = MB_SUCCESS;
-	int	i, k;
-	double	p, qn, sig, un, *u;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBBA function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:          %d\n",verbose);
-		fprintf(stderr,"dbg2       x:                %p\n",x);
-		fprintf(stderr,"dbg2       y:                %p\n",y);
-		fprintf(stderr,"dbg2       n:                %d\n",n);
-		fprintf(stderr,"dbg2       yp1:              %f\n",yp1);
-		fprintf(stderr,"dbg2       ypn:              %f\n",ypn);
-		fprintf(stderr,"dbg2       y2:               %p\n",y2);
-		}
-
-	/* check for n > 2 */
-	if (n < 3)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_NOT_ENOUGH_DATA;
-		}
-
-	/* allocate memory for working vector */
-	if (status == MB_SUCCESS)
-		status = mb_mallocd(verbose,__FILE__,__LINE__, n * sizeof(double), (void **)&u, error);
-
-	/* set up spline interpolation coefficients */
-	if (status == MB_SUCCESS)
-		{
-		if (yp1 > 0.99e30)
-			y2[1]=u[1]=0.0;
-		else
-			{
-			y2[1] = -0.5;
-			u[1]=(3.0/(x[2]-x[1]))*((y[2]-y[1])/(x[2]-x[1])-yp1);
-			}
-		for (i=2;i<=n-1;i++)
-			{
-			sig=(x[i]-x[i-1])/(x[i+1]-x[i-1]);
-			p=sig*y2[i-1]+2.0;
-			y2[i]=(sig-1.0)/p;
-			u[i]=(y[i+1]-y[i])/(x[i+1]-x[i]) - (y[i]-y[i-1])/(x[i]-x[i-1]);
-			u[i]=(6.0*u[i]/(x[i+1]-x[i-1])-sig*u[i-1])/p;
-			}
-		if (ypn > 0.99e30)
-			qn=un=0.0;
-		else
-			{
-			qn=0.5;
-			un=(3.0/(x[n]-x[n-1]))*(ypn-(y[n]-y[n-1])/(x[n]-x[n-1]));
-			}
-		y2[n]=(un-qn*u[n-1])/(qn*y2[n-1]+1.0);
-		for (k=n-1;k>=1;k--)
-			y2[k]=y2[k]*y2[k+1]+u[k];
-
-		/* deallocate memory for vector */
-		status = mb_freed(verbose,__FILE__, __LINE__, (void **)&u, error);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_spline_interp(int verbose, double *xa, double *ya, double *y2a,
-	int n, double x, double *y, int *i, int *error)
-{
-	char	*function_name = "mb_spline_interp";
-	int	status = MB_SUCCESS;
-	int	klo, khi, k;
-	double	h, b, a;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBBA function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:          %d\n",verbose);
-		fprintf(stderr,"dbg2       xa:               %p\n",xa);
-		fprintf(stderr,"dbg2       ya:               %p\n",ya);
-		fprintf(stderr,"dbg2       y2a:              %p\n",y2a);
-		fprintf(stderr,"dbg2       n:                %d\n",n);
-		fprintf(stderr,"dbg2       x:                %f\n",x);
-		}
-
-	/* check for n >= 1 */
-	if (n < 1)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_NOT_ENOUGH_DATA;
-		}
-
-	/* perform interpolation */
-	if (status == MB_SUCCESS)
-		{
-		klo=1;
-		khi=n;
-		while (khi-klo > 1)
-			{
-			k=(khi+klo) >> 1;
-			if (xa[k] > x) khi=k;
-			else klo=k;
-			}
-		if (khi == 1) khi = 2;
-		if (klo == n) klo = n - 1;
-		h=xa[khi]-xa[klo];
-		a=(xa[khi]-x)/h;
-		b=(x-xa[klo])/h;
-		*y=a*ya[klo]+b*ya[khi]+((a*a*a-a)*y2a[klo]
-			+(b*b*b-b)*y2a[khi])*(h*h)/6.0;
-		*i=klo;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       y:          %f\n",*y);
-		fprintf(stderr,"dbg2       i:          %d\n",*i);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_linear_interp(int verbose, double *xa, double *ya,
-		int n, double x, double *y, int *i, int *error)
-{
-	char	*function_name = "mb_linear_interp";
-	int	status = MB_SUCCESS;
-	int	klo, khi, k;
-	double	h, b;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBBA function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:          %d\n",verbose);
-		fprintf(stderr,"dbg2       xa:               %p\n",xa);
-		fprintf(stderr,"dbg2       ya:               %p\n",ya);
-		fprintf(stderr,"dbg2       n:                %d\n",n);
-		fprintf(stderr,"dbg2       x:                %f\n",x);
-		}
-
-	/* check for n >= 1 */
-	if (n < 1)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_NOT_ENOUGH_DATA;
-		}
-
-	/* perform interpolation */
-	if (status == MB_SUCCESS)
-		{
-		/* do not extrapolate before or after the model, just use the
-		 * first or last values */
-		if (x <= xa[1])
-			{
-			*y = ya[1];
-			*i = 1;
-			}
-		else if (x >= xa[n])
-			{
-			*y = ya[n];
-			*i = n;
-			}
-		/* in range of model so linearly interpolate */
-		else
-			{
-			klo=1;
-			khi=n;
-			while (khi-klo > 1)
-				{
-				k=(khi+klo) >> 1;
-				if (xa[k] > x) khi=k;
-				else klo=k;
-				}
-			if (khi == 1) khi = 2;
-			if (klo == n) klo = n - 1;
-			h=xa[khi]-xa[klo];
-			b = (ya[khi] - ya[klo]) / h;
-			*y = ya[klo] + b * (x - xa[klo]);
-			*i=klo;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       y:          %f\n",*y);
-		fprintf(stderr,"dbg2       i:          %d\n",*i);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_linear_interp_longitude(int verbose, double *xa, double *ya,
-		int n, double x, double *y, int *i, int *error)
-{
-	char	*function_name = "mb_linear_interp_longitude";
-	int	status = MB_SUCCESS;
-	int	klo, khi, k;
-	double	h, b;
-	double	yahi, yalo;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBBA function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:          %d\n",verbose);
-		fprintf(stderr,"dbg2       xa:               %p\n",xa);
-		fprintf(stderr,"dbg2       ya:               %p\n",ya);
-		fprintf(stderr,"dbg2       n:                %d\n",n);
-		fprintf(stderr,"dbg2       x:                %f\n",x);
-		}
-
-	/* check for n >= 1 */
-	if (n < 1)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_NOT_ENOUGH_DATA;
-		}
-
-	/* perform interpolation */
-	if (status == MB_SUCCESS)
-		{
-		/* do not extrapolate before or after the model, just use the
-		 * first or last values */
-		if (x <= xa[1])
-			{
-			*y = ya[1];
-			*i = 1;
-			}
-		else if (x >= xa[n])
-			{
-			*y = ya[n];
-			*i = n;
-			}
-		/* in range of model so linearly interpolate */
-		else
-			{
-			klo=1;
-			khi=n;
-			while (khi-klo > 1)
-				{
-				k=(khi+klo) >> 1;
-				if (xa[k] > x) khi=k;
-				else klo=k;
-				}
-			if (khi == 1) khi = 2;
-			if (klo == n) klo = n - 1;
-			h=xa[khi]-xa[klo];
-			yahi = ya[khi];
-			yalo = ya[klo];
-			if (yahi - yalo > 180.0)
-				yahi -= 360.0;
-			else if (yahi - yalo < -180.0)
-				yahi += 360.0;
-			b = (yahi - yalo) / h;
-			*y = ya[klo] + b * (x - xa[klo]);
-			if (*y >= 180.0)
-				*y -= 360.0;
-			else if (*y < -180.0)
-				*y += 360.0;
-			*i=klo;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       y:          %f\n",*y);
-		fprintf(stderr,"dbg2       i:          %d\n",*i);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_linear_interp_latitude(int verbose, double *xa, double *ya,
-		int n, double x, double *y, int *i, int *error)
-{
-	char	*function_name = "mb_linear_interp_latitude";
-	int	status = MB_SUCCESS;
-	int	klo, khi, k;
-	double	h, b;
-	double	yahi, yalo;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBBA function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:          %d\n",verbose);
-		fprintf(stderr,"dbg2       xa:               %p\n",xa);
-		fprintf(stderr,"dbg2       ya:               %p\n",ya);
-		fprintf(stderr,"dbg2       n:                %d\n",n);
-		fprintf(stderr,"dbg2       x:                %f\n",x);
-		}
-
-	/* check for n >= 1 */
-	if (n < 1)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_NOT_ENOUGH_DATA;
-		}
-
-	/* perform interpolation */
-	if (status == MB_SUCCESS)
-		{
-		/* do not extrapolate before or after the model, just use the
-		 * first or last values */
-		if (x <= xa[1])
-			{
-			*y = ya[1];
-			*i = 1;
-			}
-		else if (x >= xa[n])
-			{
-			*y = ya[n];
-			*i = n;
-			}
-		/* in range of model so linearly interpolate */
-		else
-			{
-			klo=1;
-			khi=n;
-			while (khi-klo > 1)
-				{
-				k=(khi+klo) >> 1;
-				if (xa[k] > x) khi=k;
-				else klo=k;
-				}
-			if (khi == 1) khi = 2;
-			if (klo == n) klo = n - 1;
-			h=xa[khi]-xa[klo];
-			yahi = ya[khi];
-			yalo = ya[klo];
-			b = (yahi - yalo) / h;
-			*y = ya[klo] + b * (x - xa[klo]);
-			if (*y > 90.0)
-				*y = 90.0;
-			else if (*y < -90.0)
-				*y = -90.0;
-			*i=klo;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       y:          %f\n",*y);
-		fprintf(stderr,"dbg2       i:          %d\n",*i);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_linear_interp_heading(int verbose, double *xa, double *ya,
-		int n, double x, double *y, int *i, int *error)
-{
-	char	*function_name = "mb_linear_interp_heading";
-	int	status = MB_SUCCESS;
-	int	klo, khi, k;
-	double	h, b;
-	double	yahi, yalo;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBBA function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:          %d\n",verbose);
-		fprintf(stderr,"dbg2       xa:               %p\n",xa);
-		fprintf(stderr,"dbg2       ya:               %p\n",ya);
-		fprintf(stderr,"dbg2       n:                %d\n",n);
-		fprintf(stderr,"dbg2       x:                %f\n",x);
-		}
-
-	/* check for n >= 1 */
-	if (n < 1)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_NOT_ENOUGH_DATA;
-		}
-
-	/* perform interpolation */
-	if (status == MB_SUCCESS)
-		{
-		/* do not extrapolate before or after the model, just use the
-		 * first or last values */
-		if (x <= xa[1])
-			{
-			*y = ya[1];
-			*i = 1;
-			}
-		else if (x >= xa[n])
-			{
-			*y = ya[n];
-			*i = n;
-			}
-		/* in range of model so linearly interpolate */
-		else
-			{
-			klo=1;
-			khi=n;
-			while (khi-klo > 1)
-				{
-				k=(khi+klo) >> 1;
-				if (xa[k] > x) khi=k;
-				else klo=k;
-				}
-			if (khi == 1) khi = 2;
-			if (klo == n) klo = n - 1;
-			h=xa[khi]-xa[klo];
-			yahi = ya[khi];
-			yalo = ya[klo];
-			if (yahi - yalo > 180.0)
-				yahi -= 360.0;
-			else if (yahi - yalo < -180.0)
-				yahi += 360.0;
-			b = (yahi - yalo) / h;
-			*y = ya[klo] + b * (x - xa[klo]);
-			if (*y >= 360.0)
-				*y -= 360.0;
-			else if (*y < 0.0)
-				*y += 360.0;
-			*i=klo;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       y:          %f\n",*y);
-		fprintf(stderr,"dbg2       i:          %d\n",*i);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbaux/mb_surface.c b/src/mbaux/mb_surface.c
deleted file mode 100644
index 0716eea..0000000
--- a/src/mbaux/mb_surface.c
+++ /dev/null
@@ -1,1652 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mb_surface.c	5/2/94
- *    $Id: mb_surface.c 2247 2015-05-29 21:28:28Z caress $
- *
- *    Inclusion in MB-System:
- *    Copyright (c) 1994-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    Algorithm and original code:
- *    Copyright (c) 1991 by P. Wessel and W. H. F. Smith
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * SURFUNC is a function for gridding data using a minimum curvature
- * algorithm developed by W.H.F. Smith and P. Wessel.  The source
- * code below is almost entirely taken from the source code
- * "surface.c" distributed as part of the GMT-system by Wessel
- * and Smith. The MB-System Copyright notice above applies only
- * to the inclusion of this code in MB-System and changes made to
- * the code as part of that inclusion.  The algorithm and the
- * bulk of the code remains Copyright (c) by P. Wessel and W. H. F. Smith.
- *
- *--------------------------------------------------------------------*
- *
- * The original Smith and Wessel comments follow:
- *
- * surface.c:  a gridding program.
- * reads xyz triples and fits a surface to the data.
- * surface satisfies (1 - T) D4 z - T D2 z = 0,
- * where D4 is the biharmonic operator,
- * D2 is the Laplacian,
- * and T is a "tension factor" between 0 and 1.
- * End member T = 0 is the classical minimum curvature
- * surface.  T = 1 gives a harmonic surface.  Use T = 0.25
- * or so for potential data; something more for topography.
- *
- * Program includes overrelaxation for fast convergence and
- * automatic optimal grid factorization.
- *
- * See Smith & Wessel (Geophysics, 3, 293-305, 1990) for details.
- *
- * Authors: Walter H. F. Smith and Paul Wessel
- * Date: April, 1988.
- *
- *--------------------------------------------------------------------*
- *
- * Particulars regarding turning the program "surface" version 4.3
- * (revision of 26 February, 1992) into a function "surfunc" follow:
- *
- * Author:	D. W. Caress
- * Date:	May 2, 1994
- *
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_define.h"
-#include "mb_aux.h"
-
-#define GMT_CHUNK	2000
-#ifndef FALSE
-#define FALSE 0
-#endif
-#ifndef TRUE
-#define TRUE 1
-#endif
-#define CNULL		((char *)NULL)
-
-#define OUTSIDE 2000000000	/* Index number indicating data is outside useable area */
-
-struct MB_SURFACE_DATA {
-	float x;
-	float y;
-	float z;
-	int index;
-};
-
-struct MB_SURFACE_BRIGGS {
-	double b[6];
-};
-
-static int npoints=0;			/* Number of data points */
-static int nx=0;			/* Number of nodes in x-dir. */
-static int ny=0;			/* Number of nodes in y-dir. (Final grid) */
-static int	mx = 0;
-static int	my = 0;
-static int	ij_sw_corner, ij_se_corner, ij_nw_corner, ij_ne_corner;
-static int block_nx;			/* Number of nodes in x-dir for a given grid factor */
-static int block_ny;			/* Number of nodes in y-dir for a given grid factor */
-static int max_iterations=250;		/* Max iter per call to iterate */
-static int total_iterations = 0;
-static int grid, old_grid;		/* Node spacings  */
-static int	grid_east;
-static int n_fact = 0;			/* Number of factors in common (ny-1, nx-1) */
-static int factors[32];		/* Array of common factors */
-static int local_verbose = FALSE;
-static int local_error = MB_ERROR_NO_ERROR;
-static int status = MB_SUCCESS;
-static int n_empty;			/* No of unconstrained nodes at initialization  */
-static int set_low = 0;		/* 0 unconstrained,1 = by min data value, 2 = by user value */
-static int set_high = 0;		/* 0 unconstrained,1 = by max data value, 2 = by user value */
-static int constrained = FALSE;	/* TRUE if set_low or set_high is TRUE */
-static double low_limit, high_limit;	/* Constrains on range of solution */
-static double xmin, xmax, ymin, ymax;	/* minmax coordinates */
-static float *lower, *upper;		/* arrays for minmax values, if set */
-static double xinc, yinc;		/* Size of each grid cell (final size) */
-static double grid_xinc, grid_yinc;	/* size of each grid cell for a given grid factor */
-static double r_xinc, r_yinc, r_grid_xinc, r_grid_yinc;	/* Reciprocals  */
-static double converge_limit = 0.0;	/* Convergence limit */
-static double radius = 0.0;			/* Search radius for initializing grid  */
-static double	tension = 0.00;		/* Tension parameter on the surface  */
-static double	boundary_tension = 0.0;
-static double	interior_tension = 0.0;
-static double	a0_const_1, a0_const_2;	/* Constants for off grid point equation  */
-static double	e_2, e_m2, one_plus_e2;
-static double eps_p2, eps_m2, two_plus_ep2, two_plus_em2;
-static double	x_edge_const, y_edge_const;
-static double	epsilon = 1.0;
-static double	z_mean;
-static double	z_scale = 1.0;		/* Root mean square range of z after removing planar trend  */
-static double	r_z_scale = 1.0;	/* reciprocal of z_scale  */
-static double	plane_c0, plane_c1, plane_c2;	/* Coefficients of best fitting plane to data  */
-static double smalldistance;		/* Let data point coincide with node if distance < smalldistance */
-static float *u;			/* Pointer to grid array */
-static char *iu;			/* Pointer to grid info array */
-static char mode_type[2] = {'I','D'};	/* D means include data points when iterating
-				 * I means just interpolate from larger grid */
-
-static int	offset[25][12];		/* Indices of 12 nearby points in 25 cases of edge conditions  */
-static double		coeff[2][12];	/* Coefficients for 12 nearby points, constrained and unconstrained  */
-
-static double relax_old, relax_new = 1.4;	/* Coefficients for relaxation factor to speed up convergence */
-
-static int compare_points();
-static struct MB_SURFACE_DATA *data;		/* Data point and index to node it currently constrains  */
-static struct MB_SURFACE_BRIGGS *briggs;		/* Coefficients in Taylor series for Laplacian(z) a la I. C. Briggs (1974)  */
-
-/* function prototypes */
-int mb_surface(int verbose, int ndat, float *xdat, float *ydat, float *zdat,
-		double xxmin, double xxmax, double yymin, double yymax, double xxinc, double yyinc,
-		double ttension, float *sgrid);
-void	set_coefficients(void);
-void	set_offset(void);
-void fill_in_forecast (void);
-int compare_points (struct MB_SURFACE_DATA *point_1, struct MB_SURFACE_DATA *point_2);
-void smart_divide (void);
-void set_index (void);
-void find_nearest_point(void);
-void set_grid_parameters(void);
-void initialize_grid(void);
-void new_initialize_grid(void);
-void read_data(int ndat, float *xdat, float *ydat, float *zdat);
-void get_output(float *sgrid);
-int	iterate(int mode);
-void check_errors (void);
-int	remove_planar_trend(void);
-int	replace_planar_trend(void);
-int	throw_away_unusables(void);
-int	rescale_z_values(void);
-void load_constraints (char *low, char *high);
-double	guess_surface_time(int nx, int ny);
-int	get_prime_factors(int n, int f[]);
-int	gcd_euclid(int a,int b);
-
-static char rcs_id[] = "$Id: mb_surface.c 2247 2015-05-29 21:28:28Z caress $";
-
-int mb_surface(int verbose, int ndat, float *xdat, float *ydat, float *zdat,
-		double xxmin, double xxmax, double yymin, double yymax, double xxinc, double yyinc,
-		double ttension, float *sgrid)
-{
-
-	int	i, serror = FALSE;
-	char	low[100], high[100];
-	char	*function_name = "mb_surface";
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBBA function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       xxmin:      %f\n",xxmin);
-		fprintf(stderr,"dbg2       xxmax:      %f\n",xxmax);
-		fprintf(stderr,"dbg2       yymin:      %f\n",yymin);
-		fprintf(stderr,"dbg2       yymax:      %f\n",yymax);
-		fprintf(stderr,"dbg2       xxinc:      %f\n",xxinc);
-		fprintf(stderr,"dbg2       xxinc:      %f\n",xxinc);
-		fprintf(stderr,"dbg2       ttension:   %f\n",ttension);
-		fprintf(stderr,"dbg2       ndat:       %d\n",ndat);
-		for (i=0;i<ndat;i++)
-		fprintf(stderr,"dbg2       data:       %f %f %f\n",xdat[i],ydat[i],zdat[i]);
-		}
-
-	/* copy parameters */
-	xmin = xxmin;
-	xmax = xxmax;
-	ymin = yymin;
-	ymax = yymax;
-	xinc = xxinc;
-	yinc = yyinc;
-	tension = ttension;
-	total_iterations = 0;
-
-	/* set local verbose */
-	if (verbose > 0)
-		local_verbose = TRUE;
-	else
-		local_verbose = FALSE;
-
-	/* New in v4.3:  Default to unconstrained:  */
-	set_low = set_high = 0;
-
-	if (xmin >= xmax || ymin >= ymax) serror = TRUE;
-	if (xinc <= 0.0 || yinc <= 0.0) serror = TRUE;
-
-	if (tension != 0.0) {
-		boundary_tension = tension;
-		interior_tension = tension;
-	}
-	relax_old = 1.0 - relax_new;
-
-	nx = rint((xmax - xmin)/xinc) + 1;
-	ny = rint((ymax - ymin)/yinc) + 1;
-	mx = nx + 4;
-	my = ny + 4;
-	r_xinc = 1.0 / xinc;
-	r_yinc = 1.0 / yinc;
-
-	/* New stuff here for v4.3:  Check out the grid dimensions:  */
-	grid = gcd_euclid(nx-1, ny-1);
-
-	/*
-	if (local_verbose || size_query || grid == 1) fprintf (stderr, "W: %.3lf E: %.3lf S: %.3lf N: %.3lf nx: %d ny: %d\n",
-		xmin, xmax, ymin, ymax, nx, ny);
-	if (grid == 1) fprintf(stderr,"surface:  WARNING:  Your grid dimensions are mutually prime.\n");
-	if (grid == 1 || size_query) suggest_sizes_for_surface(nx-1, ny-1);
-	if (size_query) exit(0);
-	*/
-
-	/* New idea: set grid = 1, read data, setting index.  Then throw
-		away data that can't be used in end game, constraining
-		size of briggs->b[6] structure.  */
-
-	grid = 1;
-	set_grid_parameters();
-	read_data(ndat,xdat,ydat,zdat);
-	throw_away_unusables();
-	remove_planar_trend();
-	rescale_z_values();
-	load_constraints(low, high);
-
-	/* Set up factors and reset grid to first value  */
-
-	grid = gcd_euclid(nx-1, ny-1);
-	n_fact = get_prime_factors(grid, factors);
-	set_grid_parameters();
-	while ( block_nx < 4 || block_ny < 4 ) {
-		smart_divide();
-		set_grid_parameters();
-	}
-	set_offset();
-	set_index();
-	/* Now the data are ready to go for the first iteration.  */
-
-	/* Allocate more space  */
-
-	status = mb_mallocd(local_verbose, __FILE__, __LINE__,
-				npoints * sizeof(struct MB_SURFACE_BRIGGS),
-				(void **)&briggs, &local_error);
-	status = mb_mallocd(local_verbose, __FILE__, __LINE__,
-				mx * my * sizeof(char),
-				(void **)&iu, &local_error);
-	status = mb_mallocd(local_verbose, __FILE__, __LINE__,
-				mx * my * sizeof(float),
-				(void **)&u, &local_error);
-
-	if (radius > 0) initialize_grid(); /* Fill in nodes with a weighted avg in a search radius  */
-
-	/*
-	if (local_verbose) fprintf(stderr,"Grid\tMode\tIteration\tMax Change\tConv Limit\tTotal Iterations\n");
-	*/
-
-	set_coefficients();
-
-	old_grid = grid;
-	find_nearest_point ();
-	iterate (1);
-
-	while (grid > 1) {
-		smart_divide ();
-		set_grid_parameters();
-		set_offset();
-		set_index ();
-		fill_in_forecast ();
-		iterate(0);
-		old_grid = grid;
-		find_nearest_point ();
-		iterate (1);
-	}
-
-	if (local_verbose) check_errors ();
-
-	replace_planar_trend();
-
-	get_output(sgrid);
-
-	status = mb_freed(verbose,__FILE__, __LINE__, (void **)&data, &local_error);
-	status = mb_freed(verbose,__FILE__, __LINE__, (void **)&briggs, &local_error);
-	status = mb_freed(verbose,__FILE__, __LINE__, (void **)&iu, &local_error);
-	status = mb_freed(verbose,__FILE__, __LINE__, (void **)&u, &local_error);
-	if (set_low) status = mb_freed(verbose,__FILE__, __LINE__, (void **)&lower, &local_error);
-	if (set_high) status = mb_freed(verbose,__FILE__, __LINE__, (void **)&upper, &local_error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",local_error);
-		for (i=0;i<mx*my;i++)
-			fprintf(stderr,"dbg2       grid:       %d %f\n",i,sgrid[i]);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-void	set_coefficients()
-{
-	double	e_4, loose, a0;
-
-	loose = 1.0 - interior_tension;
-	e_2 = epsilon * epsilon;
-	e_4 = e_2 * e_2;
-	eps_p2 = e_2;
-	eps_m2 = 1.0/e_2;
-	one_plus_e2 = 1.0 + e_2;
-	two_plus_ep2 = 2.0 + 2.0*eps_p2;
-	two_plus_em2 = 2.0 + 2.0*eps_m2;
-
-	x_edge_const = 4 * one_plus_e2 - 2 * (interior_tension / loose);
-	e_m2 = 1.0 / e_2;
-	y_edge_const = 4 * (1.0 + e_m2) - 2 * (interior_tension * e_m2 / loose);
-
-
-	a0 = 1.0 / ( (6 * e_4 * loose + 10 * e_2 * loose + 8 * loose - 2 * one_plus_e2) + 4*interior_tension*one_plus_e2);
-	a0_const_1 = 2 * loose * (1.0 + e_4);
-	a0_const_2 = 2.0 - interior_tension + 2 * loose * e_2;
-
-	coeff[1][4] = coeff[1][7] = -loose;
-	coeff[1][0] = coeff[1][11] = -loose * e_4;
-	coeff[0][4] = coeff[0][7] = -loose * a0;
-	coeff[0][0] = coeff[0][11] = -loose * e_4 * a0;
-	coeff[1][5] = coeff[1][6] = 2 * loose * one_plus_e2;
-	coeff[0][5] = coeff[0][6] = (2 * coeff[1][5] + interior_tension) * a0;
-	coeff[1][2] = coeff[1][9] = coeff[1][5] * e_2;
-	coeff[0][2] = coeff[0][9] = coeff[0][5] * e_2;
-	coeff[1][1] = coeff[1][3] = coeff[1][8] = coeff[1][10] = -2 * loose * e_2;
-	coeff[0][1] = coeff[0][3] = coeff[0][8] = coeff[0][10] = coeff[1][1] * a0;
-
-	e_2 *= 2;		/* We will need these in boundary conditions  */
-	e_m2 *= 2;
-
-	ij_sw_corner = 2 * my + 2;			/*  Corners of array of actual data  */
-	ij_se_corner = ij_sw_corner + (nx - 1) * my;
-	ij_nw_corner = ij_sw_corner + (ny - 1);
-	ij_ne_corner = ij_se_corner + (ny - 1);
-
-}
-
-void	set_offset()
-{
-	int	add_w[5], add_e[5], add_s[5], add_n[5], add_w2[5], add_e2[5], add_s2[5], add_n2[5];
-	int	i, j, kase;
-
-	add_w[0] = -my; add_w[1] = add_w[2] = add_w[3] = add_w[4] = -grid_east;
-	add_w2[0] = -2 * my;  add_w2[1] = -my - grid_east;  add_w2[2] = add_w2[3] = add_w2[4] = -2 * grid_east;
-	add_e[4] = my; add_e[0] = add_e[1] = add_e[2] = add_e[3] = grid_east;
-	add_e2[4] = 2 * my;  add_e2[3] = my + grid_east;  add_e2[2] = add_e2[1] = add_e2[0] = 2 * grid_east;
-
-	add_n[4] = 1; add_n[3] = add_n[2] = add_n[1] = add_n[0] = grid;
-	add_n2[4] = 2;  add_n2[3] = grid + 1;  add_n2[2] = add_n2[1] = add_n2[0] = 2 * grid;
-	add_s[0] = -1; add_s[1] = add_s[2] = add_s[3] = add_s[4] = -grid;
-	add_s2[0] = -2;  add_s2[1] = -grid - 1;  add_s2[2] = add_s2[3] = add_s2[4] = -2 * grid;
-
-	for (i = 0, kase = 0; i < 5; i++) {
-		for (j = 0; j < 5; j++, kase++) {
-			offset[kase][0] = add_n2[j];
-			offset[kase][1] = add_n[j] + add_w[i];
-			offset[kase][2] = add_n[j];
-			offset[kase][3] = add_n[j] + add_e[i];
-			offset[kase][4] = add_w2[i];
-			offset[kase][5] = add_w[i];
-			offset[kase][6] = add_e[i];
-			offset[kase][7] = add_e2[i];
-			offset[kase][8] = add_s[j] + add_w[i];
-			offset[kase][9] = add_s[j];
-			offset[kase][10] = add_s[j] + add_e[i];
-			offset[kase][11] = add_s2[j];
-		}
-	}
-}
-
-
-
-void fill_in_forecast ()
-{
-
-	/* Fills in bilinear estimates into new node locations
-	   after grid is divided.
-	 */
-
-	int i, j, ii, jj, index_0, index_1, index_2, index_3;
-	int index_new;
-	double delta_x, delta_y, a0, a1, a2, a3;
-	double old_size;
-
-
-	old_size = 1.0 / (double)old_grid;
-
-	/* first do from southwest corner */
-
-	for (i = 0; i < nx-1; i += old_grid) {
-
-		for (j = 0; j < ny-1; j += old_grid) {
-
-			/* get indices of bilinear square */
-			index_0 = ij_sw_corner + i * my + j;
-			index_1 = index_0 + old_grid * my;
-			index_2 = index_1 + old_grid;
-			index_3 = index_0 + old_grid;
-
-			/* get coefficients */
-			a0 = u[index_0];
-			a1 = u[index_1] - a0;
-			a2 = u[index_3] - a0;
-			a3 = u[index_2] - a0 - a1 - a2;
-
-			/* find all possible new fill ins */
-
-			for (ii = i;  ii < i + old_grid; ii += grid) {
-				delta_x = (ii - i) * old_size;
-				for (jj = j;  jj < j + old_grid; jj += grid) {
-					index_new = ij_sw_corner + ii * my + jj;
-					if (index_new == index_0) continue;
-					delta_y = (jj - j) * old_size;
-					u[index_new] = a0 + a1 * delta_x + delta_y * ( a2 + a3 * delta_x);
-					iu[index_new] = 0;
-				}
-			}
-			iu[index_0] = 5;
-		}
-	}
-
-	/* now do linear guess along east edge */
-
-	for (j = 0; j < (ny-1); j += old_grid) {
-		index_0 = ij_se_corner + j;
-		index_3 = index_0 + old_grid;
-		for (jj = j;  jj < j + old_grid; jj += grid) {
-			index_new = ij_se_corner + jj;
-			delta_y = (jj - j) * old_size;
-			u[index_new] = u[index_0] + delta_y * (u[index_3] - u[index_0]);
-			iu[index_new] = 0;
-		}
-		iu[index_0] = 5;
-	}
-	/* now do linear guess along north edge */
-	for (i = 0; i < (nx-1); i += old_grid) {
-		index_0 = ij_nw_corner + i * my;
-		index_1 = index_0 + old_grid * my;
-		for (ii = i;  ii < i + old_grid; ii += grid) {
-			index_new = ij_nw_corner + ii * my;
-			delta_x = (ii - i) * old_size;
-			u[index_new] = u[index_0] + delta_x * (u[index_1] - u[index_0]);
-			iu[index_new] = 0;
-		}
-		iu[index_0] = 5;
-	}
-	/* now set northeast corner to fixed and we're done */
-	iu[ij_ne_corner] = 5;
-}
-
-int compare_points (struct MB_SURFACE_DATA *point_1, struct MB_SURFACE_DATA *point_2)
-{
-		/*  Routine for qsort to sort data structure for fast access to data by node location.
-		    Sorts on index first, then on radius to node corresponding to index, so that index
-		    goes from low to high, and so does radius.
-		*/
-	int block_i, block_j, index_1, index_2;
-	double x0, y0, dist_1, dist_2;
-
-	index_1 = point_1->index;
-	index_2 = point_2->index;
-	if (index_1 < index_2)
-		return (-1);
-	else if (index_1 > index_2)
-		return (1);
-	else if (index_1 == OUTSIDE)
-		return (0);
-	else {	/* Points are in same grid cell, find the one who is nearest to grid point */
-		block_i = point_1->index/block_ny;
-		block_j = point_1->index%block_ny;
-		x0 = xmin + block_i * grid_xinc;
-		y0 = ymin + block_j * grid_yinc;
-		dist_1 = (point_1->x - x0) * (point_1->x - x0) + (point_1->y - y0) * (point_1->y - y0);
-		dist_2 = (point_2->x - x0) * (point_2->x - x0) + (point_2->y - y0) * (point_2->y - y0);
-		if (dist_1 < dist_2)
-			return (-1);
-		if (dist_1 > dist_2)
-			return (1);
-		else
-			return (0);
-	}
-}
-
-void smart_divide ()
-{
-		/* Divide grid by its largest prime factor */
-	grid /= factors[n_fact - 1];
-	n_fact--;
-}
-
-void set_index ()
-{
-		/* recomputes data[k].index for new value of grid,
-		   sorts data on index and radii, and throws away
-		   data which are now outside the useable limits. */
-	int i, j, k, k_skipped = 0;
-
-	for (k = 0; k < npoints; k++) {
-		i = floor(((data[k].x-xmin)*r_grid_xinc) + 0.5);
-		j = floor(((data[k].y-ymin)*r_grid_yinc) + 0.5);
-		if (i < 0 || i >= block_nx || j < 0 || j >= block_ny) {
-			data[k].index = OUTSIDE;
-			k_skipped++;
-		}
-		else
-			data[k].index = i * block_ny + j;
-	}
-
-	qsort ((char *)data, npoints, sizeof (struct MB_SURFACE_DATA), (void *)compare_points);
-
-	npoints -= k_skipped;
-
-}
-
-void find_nearest_point()
-{
-	int i, j, k, last_index, block_i, block_j, iu_index, briggs_index;
-	double x0, y0, dx, dy, xys, xy1, btemp;
-	double b0, b1, b2, b3, b4, b5;
-
-	last_index = -1;
-	smalldistance = 0.05 * ((grid_xinc < grid_yinc) ? grid_xinc : grid_yinc);
-
-	for (i = 0; i < nx; i += grid)	/* Reset grid info */
-		for (j = 0; j < ny; j += grid)
-			iu[ij_sw_corner + i*my + j] = 0;
-
-	briggs_index = 0;
-	for (k = 0; k < npoints; k++) {	/* Find constraining value  */
-		if (data[k].index != last_index) {
-			block_i = data[k].index/block_ny;
-			block_j = data[k].index%block_ny;
-			last_index = data[k].index;
-	 		iu_index = ij_sw_corner + (block_i * my + block_j) * grid;
-	 		x0 = xmin + block_i*grid_xinc;
-	 		y0 = ymin + block_j*grid_yinc;
-	 		dx = (data[k].x - x0)*r_grid_xinc;
-	 		dy = (data[k].y - y0)*r_grid_yinc;
-	 		if (fabs(dx) < smalldistance && fabs(dy) < smalldistance) {
-	 			iu[iu_index] = 5;
-	 			u[iu_index] = data[k].z;
-	 		}
-	 		else {
-	 			if (dx >= 0.0) {
-	 				if (dy >= 0.0)
-	 					iu[iu_index] = 1;
-	 				else
-	 					iu[iu_index] = 4;
-	 			}
-	 			else {
-	 				if (dy >= 0.0)
-	 					iu[iu_index] = 2;
-	 				else
-	 					iu[iu_index] = 3;
-	 			}
-	 			dx = fabs(dx);
-	 			dy = fabs(dy);
-	 			btemp = 2 * one_plus_e2 / ( (dx + dy) * (1.0 + dx + dy) );
-	 			b0 = 1.0 - 0.5 * (dx + (dx * dx)) * btemp;
-	 			b3 = 0.5 * (e_2 - (dy + (dy * dy)) * btemp);
-	 			xys = 1.0 + dx + dy;
-	 			xy1 = 1.0 / xys;
-	 			b1 = (e_2 * xys - 4 * dy) * xy1;
-	 			b2 = 2 * (dy - dx + 1.0) * xy1;
-	 			b4 = b0 + b1 + b2 + b3 + btemp;
-	 			b5 = btemp * data[k].z;
-	 			briggs[briggs_index].b[0] = b0;
-	 			briggs[briggs_index].b[1] = b1;
-	 			briggs[briggs_index].b[2] = b2;
-	 			briggs[briggs_index].b[3] = b3;
-	 			briggs[briggs_index].b[4] = b4;
-	 			briggs[briggs_index].b[5] = b5;
-	 			briggs_index++;
-	 		}
-	 	}
-	 }
-}
-
-
-void set_grid_parameters()
-{
-	block_ny = (ny - 1) / grid + 1;
-	block_nx = (nx - 1) / grid + 1;
-	grid_xinc = grid * xinc;
-	grid_yinc = grid * yinc;
-	grid_east = grid * my;
-	r_grid_xinc = 1.0 / grid_xinc;
-	r_grid_yinc = 1.0 / grid_yinc;
-}
-
-void initialize_grid()
-{	/*
-	 * For the initial gridsize, compute weighted averages of data inside the search radius
-	 * and assign the values to u[i,j] where i,j are multiples of gridsize.
-	 */
-	 int	irad, jrad, i, j, imin, imax, jmin, jmax, index_1, index_2, k, ki, kj, k_index;
-	 double	r, rfact, sum_w, sum_zw, weight, x0, y0;
-
-	 irad = ceil(radius/grid_xinc);
-	 jrad = ceil(radius/grid_yinc);
-	 rfact = -4.5/(radius*radius);
-
-	 for (i = 0; i < block_nx; i ++ ) {
-	 	x0 = xmin + i*grid_xinc;
-	 	for (j = 0; j < block_ny; j ++ ) {
-	 		y0 = ymin + j*grid_yinc;
-	 		imin = i - irad;
-	 		if (imin < 0) imin = 0;
-	 		imax = i + irad;
-	 		if (imax >= block_nx) imax = block_nx - 1;
-	 		jmin = j - jrad;
-	 		if (jmin < 0) jmin = 0;
-	 		jmax = j + jrad;
-	 		if (jmax >= block_ny) jmax = block_ny - 1;
-	 		index_1 = imin*block_ny + jmin;
-	 		index_2 = imax*block_ny + jmax + 1;
-	 		sum_w = sum_zw = 0.0;
-	 		k = 0;
-	 		while (k < npoints && data[k].index < index_1) k++;
-	 		for (ki = imin; k < npoints && ki <= imax && data[k].index < index_2; ki++) {
-	 			for (kj = jmin; k < npoints && kj <= jmax && data[k].index < index_2; kj++) {
-	 				k_index = ki*block_ny + kj;
-	 				while (k < npoints && data[k].index < k_index) k++;
-	 				while (k < npoints && data[k].index == k_index) {
-	 					r = (data[k].x-x0)*(data[k].x-x0) + (data[k].y-y0)*(data[k].y-y0);
-	 					weight = exp (rfact*r);
-	 					sum_w += weight;
-	 					sum_zw += weight*data[k].z;
-	 					k++;
-	 				}
-	 			}
-	 		}
-	 		if (sum_w == 0.0) {
-				/*
-	 			fprintf (stderr, "surface: Warning: no data inside search radius at: %.8lg %.8lg\n", x0, y0);
-				*/
-	 			u[ij_sw_corner + (i * my + j) * grid] = z_mean;
-	 		}
-	 		else {
-	 			u[ij_sw_corner + (i*my+j)*grid] = sum_zw/sum_w;
-	 		}
-		}
-	}
-}
-
-
-void new_initialize_grid()
-{	/*
-	 * For the initial gridsize, load constrained nodes with weighted avg of their data;
-	 * and then do something with the unconstrained ones.
-	 */
-	 int	k, k_index, u_index, block_i, block_j;
-	 double	sum_w, sum_zw, weight, x0, y0, dx, dy, dx_scale, dy_scale;
-
-	dx_scale = 4.0 / grid_xinc;
-	dy_scale = 4.0 / grid_yinc;
-	n_empty = block_ny * block_nx;
-	k = 0;
-	while (k < npoints) {
-		block_i = data[k].index / block_ny;
-		block_j = data[k].index % block_ny;
-		x0 = xmin + block_i*grid_xinc;
-		y0 = ymin + block_j*grid_yinc;
-		u_index = ij_sw_corner + (block_i*my + block_j) * grid;
-		k_index = data[k].index;
-
-		dy = (data[k].y - y0) * dy_scale;
-		dx = (data[k].x - x0) * dx_scale;
-		sum_w = 1.0 / (1.0 + dx*dx + dy*dy);
-		sum_zw = data[k].z * sum_w;
-		k++;
-
-		while (k < npoints && data[k].index == k_index) {
-
-			dy = (data[k].y - y0) * dy_scale;
-			dx = (data[k].x - x0) * dx_scale;
-			weight = 1.0 / (1.0 + dx*dx + dy*dy);
-			sum_zw += data[k].z * weight;
-			sum_w += weight;
-			sum_zw += weight*data[k].z;
-			k++;
-	 	}
-	 	u[u_index] = sum_zw/sum_w;
-	 	iu[u_index] = 5;
-	 	n_empty--;
-	 }
-}
-
-/* This function rewritten by D.W. Caress 5/3/94 */
-void read_data(int ndat, float *xdat, float *ydat, float *zdat)
-{
-	int	i, j, k, kmax, kmin, idat;
-	double	zmin = 1.0e38, zmax = -1.0e38;
-
-	status = mb_mallocd(local_verbose, __FILE__, __LINE__,
-				ndat * sizeof(struct MB_SURFACE_DATA),
-				(void **)&data, &local_error);
-
-	/* Read in xyz data and computes index no and store it in a structure */
-	k = 0;
-	z_mean = 0;
-	for (idat=0;idat<ndat;idat++)
-		{
-		i = floor(((xdat[idat]-xmin)*r_grid_xinc) + 0.5);
-		j = floor(((ydat[idat]-ymin)*r_grid_yinc) + 0.5);
-		if (i >= 0 && i < block_nx && j >= 0 && j < block_ny)
-			{
-			data[k].index = i * block_ny + j;
-			data[k].x = xdat[idat];
-			data[k].y = ydat[idat];
-			data[k].z = zdat[idat];
-			if (zmin > zdat[idat])
-				{
-				zmin = zdat[idat];
-				kmin = k;
-				}
-			if (zmax < zdat[idat])
-				{
-				zmax = zdat[idat];
-				kmax = k;
-				}
-			k++;
-			z_mean += zdat[idat];
-			}
-		}
-
-	npoints = k;
-	z_mean /= k;
-	if( converge_limit == 0.0 ) {
-		converge_limit = 0.001 * z_scale; /* c_l = 1 ppt of L2 scale */
-	}
-	/*
-	if (local_verbose) {
-		fprintf(stderr, "surface: Minimum value of your dataset x,y,z at: %g %g %g\n",
-			data[kmin].x, data[kmin].y, data[kmin].z);
-		fprintf(stderr, "surface: Maximum value of your dataset x,y,z at: %g %g %g\n",
-			data[kmax].x, data[kmax].y, data[kmax].z);
-	}
-	*/
-
-	if (set_low == 1)
-		low_limit = data[kmin].z;
-	else if (set_low == 2 && low_limit > data[kmin].z) {
-	/*	low_limit = data[kmin].z;	*/
-		/*
-		fprintf (stderr, "surface: Warning:  Your lower value is > than min data value.\n");
-		*/
-	}
-	if (set_high == 1)
-		high_limit = data[kmax].z;
-	else if (set_high == 2 && high_limit < data[kmax].z) {
-	/*	high_limit = data[kmax].z;	*/
-		/*
-		fprintf (stderr, "surface: Warning:  Your upper value is < than max data value.\n");
-		*/
-	}
-
-}
-
-/* this function rewritten from write_output() by D.W. Caress 5/3/94 */
-void get_output(float *sgrid)
-{
-	int	index, i, j;
-
-
-	index = ij_sw_corner;
-	for(i = 0; i < nx; i++, index += my)
-		for (j = 0; j < ny; j++)
-			{
-			sgrid[j*nx+i] = u[index + ny - j - 1];
-			}
-}
-
-int	iterate(int mode)
-{
-
-	int	i, j, k, ij, kase, briggs_index, ij_v2;
-	int	x_case, y_case, x_w_case, x_e_case, y_s_case, y_n_case;
-	int	iteration_count = 0;
-
-	double	current_limit = converge_limit / grid;
-	double	change, max_change = 0.0, busum, sum_ij;
-	double	b0, b1, b2, b3, b4, b5;
-
-	double	x_0_const = 4.0 * (1.0 - boundary_tension) / (2.0 - boundary_tension);
-	double	x_1_const = (3 * boundary_tension - 2.0) / (2.0 - boundary_tension);
-	double	y_denom = 2 * epsilon * (1.0 - boundary_tension) + boundary_tension;
-	double	y_0_const = 4 * epsilon * (1.0 - boundary_tension) / y_denom;
-	double	y_1_const = (boundary_tension - 2 * epsilon * (1.0 - boundary_tension) ) / y_denom;
-
-	do {
-		briggs_index = 0;	/* Reset the constraint table stack pointer  */
-
-		max_change = -1.0;
-
-		/* Fill in auxiliary boundary values (in new way) */
-
-		/* First set d2[]/dn2 = 0 along edges:  */
-		/* New experiment : (1-T)d2[]/dn2 + Td[]/dn = 0  */
-
-
-
-		for (i = 0; i < nx; i += grid) {
-			/* set d2[]/dy2 = 0 on south side:  */
-			ij = ij_sw_corner + i * my;
-			/* u[ij - 1] = 2 * u[ij] - u[ij + grid];  */
-			u[ij - 1] = y_0_const * u[ij] + y_1_const * u[ij + grid];
-			/* set d2[]/dy2 = 0 on north side:  */
-			ij = ij_nw_corner + i * my;
-			/* u[ij + 1] = 2 * u[ij] - u[ij - grid];  */
-			u[ij + 1] = y_0_const * u[ij] + y_1_const * u[ij - grid];
-
-		}
-
-		for (j = 0; j < ny; j += grid) {
-			/* set d2[]/dx2 = 0 on west side:  */
-			ij = ij_sw_corner + j;
-			/* u[ij - my] = 2 * u[ij] - u[ij + grid_east];  */
-			u[ij - my] = x_1_const * u[ij + grid_east] + x_0_const * u[ij];
-			/* set d2[]/dx2 = 0 on east side:  */
-			ij = ij_se_corner + j;
-			/* u[ij + my] = 2 * u[ij] - u[ij - grid_east];  */
-			u[ij + my] = x_1_const * u[ij - grid_east] + x_0_const * u[ij];
-		}
-
-		/* Now set d2[]/dxdy = 0 at each corner:  */
-
-		ij = ij_sw_corner;
-		u[ij - my - 1] = u[ij + grid_east - 1] + u[ij - my + grid] - u[ij + grid_east + grid];
-
-		ij = ij_nw_corner;
-		u[ij - my + 1] = u[ij + grid_east + 1] + u[ij - my - grid] - u[ij + grid_east - grid];
-
-		ij = ij_se_corner;
-		u[ij + my - 1] = u[ij - grid_east - 1] + u[ij + my + grid] - u[ij - grid_east + grid];
-
-		ij = ij_ne_corner;
-		u[ij + my + 1] = u[ij - grid_east + 1] + u[ij + my - grid] - u[ij - grid_east - grid];
-
-		/* Now set (1-T)dC/dn + Tdu/dn = 0 at each edge :  */
-		/* New experiment:  only dC/dn = 0  */
-
-		x_w_case = 0;
-		x_e_case = block_nx - 1;
-		for (i = 0; i < nx; i += grid, x_w_case++, x_e_case--) {
-
-			if(x_w_case < 2)
-				x_case = x_w_case;
-			else if(x_e_case < 2)
-				x_case = 4 - x_e_case;
-			else
-				x_case = 2;
-
-			/* South side :  */
-			kase = x_case * 5;
-			ij = ij_sw_corner + i * my;
-			u[ij + offset[kase][11]] =
-				(u[ij + offset[kase][0]] + eps_m2*(u[ij + offset[kase][1]] + u[ij + offset[kase][3]]
-					- u[ij + offset[kase][8]] - u[ij + offset[kase][10]])
-					+ two_plus_em2 * (u[ij + offset[kase][9]] - u[ij + offset[kase][2]]) );
-				/*  + tense * eps_m2 * (u[ij + offset[kase][2]] - u[ij + offset[kase][9]]) / (1.0 - tense);  */
-			/* North side :  */
-			kase = x_case * 5 + 4;
-			ij = ij_nw_corner + i * my;
-			u[ij + offset[kase][0]] =
-				-(-u[ij + offset[kase][11]] + eps_m2 * (u[ij + offset[kase][1]] + u[ij + offset[kase][3]]
-					- u[ij + offset[kase][8]] - u[ij + offset[kase][10]])
-					+ two_plus_em2 * (u[ij + offset[kase][9]] - u[ij + offset[kase][2]]) );
-				/*  - tense * eps_m2 * (u[ij + offset[kase][2]] - u[ij + offset[kase][9]]) / (1.0 - tense);  */
-		}
-
-		y_s_case = 0;
-		y_n_case = block_ny - 1;
-		for (j = 0; j < ny; j += grid, y_s_case++, y_n_case--) {
-
-			if(y_s_case < 2)
-				y_case = y_s_case;
-			else if(y_n_case < 2)
-				y_case = 4 - y_n_case;
-			else
-				y_case = 2;
-
-			/* West side :  */
-			kase = y_case;
-			ij = ij_sw_corner + j;
-			u[ij+offset[kase][4]] =
-				u[ij + offset[kase][7]] + eps_p2 * (u[ij + offset[kase][3]] + u[ij + offset[kase][10]]
-				-u[ij + offset[kase][1]] - u[ij + offset[kase][8]])
-				+ two_plus_ep2 * (u[ij + offset[kase][5]] - u[ij + offset[kase][6]]);
-				/*  + tense * (u[ij + offset[kase][6]] - u[ij + offset[kase][5]]) / (1.0 - tense);  */
-			/* East side :  */
-			kase = 20 + y_case;
-			ij = ij_se_corner + j;
-			u[ij + offset[kase][7]] =
-				- (-u[ij + offset[kase][4]] + eps_p2 * (u[ij + offset[kase][3]] + u[ij + offset[kase][10]]
-				- u[ij + offset[kase][1]] - u[ij + offset[kase][8]])
-				+ two_plus_ep2 * (u[ij + offset[kase][5]] - u[ij + offset[kase][6]]) );
-				/*  - tense * (u[ij + offset[kase][6]] - u[ij + offset[kase][5]]) / (1.0 - tense);  */
-		}
-
-
-
-		/* That's it for the boundary points.  Now loop over all data  */
-
-		x_w_case = 0;
-		x_e_case = block_nx - 1;
-		for (i = 0; i < nx; i += grid, x_w_case++, x_e_case--) {
-
-			if(x_w_case < 2)
-				x_case = x_w_case;
-			else if(x_e_case < 2)
-				x_case = 4 - x_e_case;
-			else
-				x_case = 2;
-
-			y_s_case = 0;
-			y_n_case = block_ny - 1;
-
-			ij = ij_sw_corner + i * my;
-
-			for (j = 0; j < ny; j += grid, ij += grid, y_s_case++, y_n_case--) {
-
-				if (iu[ij] == 5) continue;	/* Point is fixed  */
-
-				if(y_s_case < 2)
-					y_case = y_s_case;
-				else if(y_n_case < 2)
-					y_case = 4 - y_n_case;
-				else
-					y_case = 2;
-
-				kase = x_case * 5 + y_case;
-				sum_ij = 0.0;
-
-				if (iu[ij] == 0) {		/* Point is unconstrained  */
-					for (k = 0; k < 12; k++) {
-						sum_ij += (u[ij + offset[kase][k]] * coeff[0][k]);
-					}
-				}
-				else {				/* Point is constrained  */
-
-					b0 = briggs[briggs_index].b[0];
-					b1 = briggs[briggs_index].b[1];
-					b2 = briggs[briggs_index].b[2];
-					b3 = briggs[briggs_index].b[3];
-					b4 = briggs[briggs_index].b[4];
-					b5 = briggs[briggs_index].b[5];
-					briggs_index++;
-					if (iu[ij] < 3) {
-						if (iu[ij] == 1) {	/* Point is in quadrant 1  */
-							busum = b0 * u[ij + offset[kase][10]]
-								+ b1 * u[ij + offset[kase][9]]
-								+ b2 * u[ij + offset[kase][5]]
-								+ b3 * u[ij + offset[kase][1]];
-						}
-						else {			/* Point is in quadrant 2  */
-							busum = b0 * u[ij + offset[kase][8]]
-								+ b1 * u[ij + offset[kase][9]]
-								+ b2 * u[ij + offset[kase][6]]
-								+ b3 * u[ij + offset[kase][3]];
-						}
-					}
-					else {
-						if (iu[ij] == 3) {	/* Point is in quadrant 3  */
-							busum = b0 * u[ij + offset[kase][1]]
-								+ b1 * u[ij + offset[kase][2]]
-								+ b2 * u[ij + offset[kase][6]]
-								+ b3 * u[ij + offset[kase][10]];
-						}
-						else {		/* Point is in quadrant 4  */
-							busum = b0 * u[ij + offset[kase][3]]
-								+ b1 * u[ij + offset[kase][2]]
-								+ b2 * u[ij + offset[kase][5]]
-								+ b3 * u[ij + offset[kase][8]];
-						}
-					}
-					for (k = 0; k < 12; k++) {
-						sum_ij += (u[ij + offset[kase][k]] * coeff[1][k]);
-					}
-					sum_ij = (sum_ij + a0_const_2 * (busum + b5))
-						/ (a0_const_1 + a0_const_2 * b4);
-				}
-
-				/* New relaxation here  */
-				sum_ij = u[ij] * relax_old + sum_ij * relax_new;
-
-				if (constrained) {	/* Must check limits.  Note lower/upper is v2 format and need ij_v2! */
-					ij_v2 = (ny - j - 1) * nx + i;
-					if (set_low /*&& !GMT_is_fnan((double)lower[ij_v2])*/ && sum_ij < lower[ij_v2])
-						sum_ij = lower[ij_v2];
-					else if (set_high /*&& !GMT_is_fnan((double)upper[ij_v2])*/ && sum_ij > upper[ij_v2])
-						sum_ij = upper[ij_v2];
-				}
-
-				change = fabs(sum_ij - u[ij]);
-				u[ij] = sum_ij;
-				if (change > max_change) max_change = change;
-			}
-		}
-		iteration_count++;
-		total_iterations++;
-		max_change *= z_scale;	/* Put max_change into z units  */
-		if (local_verbose > 1)
-			fprintf(stderr,"%4d\t%c\t%8d\t%10lg\t%10lg\t%10d\n",
-				grid, mode_type[mode],
-				iteration_count, max_change,
-				current_limit, total_iterations);
-
-	} while (max_change > current_limit && iteration_count < max_iterations);
-
-	if (local_verbose) fprintf(stderr,"%4d\t%c\t%8d\t%10lg\t%10lg\t%10d\n",
-		grid, mode_type[mode], iteration_count, max_change, current_limit, total_iterations);
-
-	return(iteration_count);
-}
-
-void check_errors () {
-
-	int	i, j, k, ij, n_nodes, move_over[12];	/* move_over = offset[kase][12], but grid = 1 so move_over is easy  */
-
-	double	x0, y0, dx, dy, mean_error, mean_squared_error, z_est, z_err, curvature, c;
-	double	du_dx, du_dy, d2u_dx2, d2u_dxdy, d2u_dy2, d3u_dx3, d3u_dx2dy, d3u_dxdy2, d3u_dy3;
-
-	double	x_0_const = 4.0 * (1.0 - boundary_tension) / (2.0 - boundary_tension);
-	double	x_1_const = (3 * boundary_tension - 2.0) / (2.0 - boundary_tension);
-	double	y_denom = 2 * epsilon * (1.0 - boundary_tension) + boundary_tension;
-	double	y_0_const = 4 * epsilon * (1.0 - boundary_tension) / y_denom;
-	double	y_1_const = (boundary_tension - 2 * epsilon * (1.0 - boundary_tension) ) / y_denom;
-
-
-	move_over[0] = 2;
-	move_over[1] = 1 - my;
-	move_over[2] = 1;
-	move_over[3] = 1 + my;
-	move_over[4] = -2 * my;
-	move_over[5] = -my;
-	move_over[6] = my;
-	move_over[7] = 2 * my;
-	move_over[8] = -1 - my;
-	move_over[9] = -1;
-	move_over[10] = -1 + my;
-	move_over[11] = -2;
-
-	mean_error = 0;
-	mean_squared_error = 0;
-
-	/* First update the boundary values  */
-
-	for (i = 0; i < nx; i ++) {
-		ij = ij_sw_corner + i * my;
-		u[ij - 1] = y_0_const * u[ij] + y_1_const * u[ij + 1];
-		ij = ij_nw_corner + i * my;
-		u[ij + 1] = y_0_const * u[ij] + y_1_const * u[ij - 1];
-	}
-
-	for (j = 0; j < ny; j ++) {
-		ij = ij_sw_corner + j;
-		u[ij - my] = x_1_const * u[ij + my] + x_0_const * u[ij];
-		ij = ij_se_corner + j;
-		u[ij + my] = x_1_const * u[ij - my] + x_0_const * u[ij];
-	}
-
-	ij = ij_sw_corner;
-	u[ij - my - 1] = u[ij + my - 1] + u[ij - my + 1] - u[ij + my + 1];
-	ij = ij_nw_corner;
-	u[ij - my + 1] = u[ij + my + 1] + u[ij - my - 1] - u[ij + my - 1];
-	ij = ij_se_corner;
-	u[ij + my - 1] = u[ij - my - 1] + u[ij + my + 1] - u[ij - my + 1];
-	ij = ij_ne_corner;
-	u[ij + my + 1] = u[ij - my + 1] + u[ij + my - 1] - u[ij - my - 1];
-
-	for (i = 0; i < nx; i ++) {
-
-		ij = ij_sw_corner + i * my;
-		u[ij + move_over[11]] =
-			(u[ij + move_over[0]] + eps_m2*(u[ij + move_over[1]] + u[ij + move_over[3]]
-				- u[ij + move_over[8]] - u[ij + move_over[10]])
-				+ two_plus_em2 * (u[ij + move_over[9]] - u[ij + move_over[2]]) );
-
-		ij = ij_nw_corner + i * my;
-		u[ij + move_over[0]] =
-			-(-u[ij + move_over[11]] + eps_m2 * (u[ij + move_over[1]] + u[ij + move_over[3]]
-				- u[ij + move_over[8]] - u[ij + move_over[10]])
-				+ two_plus_em2 * (u[ij + move_over[9]] - u[ij + move_over[2]]) );
-	}
-
-	for (j = 0; j < ny; j ++) {
-
-		ij = ij_sw_corner + j;
-		u[ij+move_over[4]] =
-			u[ij + move_over[7]] + eps_p2 * (u[ij + move_over[3]] + u[ij + move_over[10]]
-			-u[ij + move_over[1]] - u[ij + move_over[8]])
-			+ two_plus_ep2 * (u[ij + move_over[5]] - u[ij + move_over[6]]);
-
-		ij = ij_se_corner + j;
-		u[ij + move_over[7]] =
-			- (-u[ij + move_over[4]] + eps_p2 * (u[ij + move_over[3]] + u[ij + move_over[10]]
-			- u[ij + move_over[1]] - u[ij + move_over[8]])
-			+ two_plus_ep2 * (u[ij + move_over[5]] - u[ij + move_over[6]]) );
-	}
-
-	/* That resets the boundary values.  Now we can test all data.
-		Note that this loop checks all values, even though only nearest were used.  */
-
-	for (k = 0; k < npoints; k++) {
-		i = data[k].index/ny;
-		j = data[k].index%ny;
-	 	ij = ij_sw_corner + i * my + j;
-	 	if ( iu[ij] == 5 ) continue;
-	 	x0 = xmin + i*xinc;
-	 	y0 = ymin + j*yinc;
-	 	dx = (data[k].x - x0)*r_xinc;
-	 	dy = (data[k].y - y0)*r_yinc;
-
-	 	du_dx = 0.5 * (u[ij + move_over[6]] - u[ij + move_over[5]]);
-	 	du_dy = 0.5 * (u[ij + move_over[2]] - u[ij + move_over[9]]);
-	 	d2u_dx2 = u[ij + move_over[6]] + u[ij + move_over[5]] - 2 * u[ij];
-	 	d2u_dy2 = u[ij + move_over[2]] + u[ij + move_over[9]] - 2 * u[ij];
-	 	d2u_dxdy = 0.25 * (u[ij + move_over[3]] - u[ij + move_over[1]]
-	 			- u[ij + move_over[10]] + u[ij + move_over[8]]);
-	 	d3u_dx3 = 0.5 * ( u[ij + move_over[7]] - 2 * u[ij + move_over[6]]
-	 				+ 2 * u[ij + move_over[5]] - u[ij + move_over[4]]);
-	 	d3u_dy3 = 0.5 * ( u[ij + move_over[0]] - 2 * u[ij + move_over[2]]
-	 				+ 2 * u[ij + move_over[9]] - u[ij + move_over[11]]);
-	 	d3u_dx2dy = 0.5 * ( ( u[ij + move_over[3]] + u[ij + move_over[1]] - 2 * u[ij + move_over[2]] )
-	 				- ( u[ij + move_over[10]] + u[ij + move_over[8]] - 2 * u[ij + move_over[9]] ) );
-	 	d3u_dxdy2 = 0.5 * ( ( u[ij + move_over[3]] + u[ij + move_over[10]] - 2 * u[ij + move_over[6]] )
-	 				- ( u[ij + move_over[1]] + u[ij + move_over[8]] - 2 * u[ij + move_over[5]] ) );
-
-	 	/* 3rd order Taylor approx:  */
-
-	 	z_est = u[ij] + dx * (du_dx +  dx * ( (0.5 * d2u_dx2) + dx * (d3u_dx3 / 6.0) ) )
-				+ dy * (du_dy +  dy * ( (0.5 * d2u_dy2) + dy * (d3u_dy3 / 6.0) ) )
-	 			+ dx * dy * (d2u_dxdy) + (0.5 * dx * d3u_dx2dy) + (0.5 * dy * d3u_dxdy2);
-
-	 	z_err = z_est - data[k].z;
-	 	mean_error += z_err;
-	 	mean_squared_error += (z_err * z_err);
-	 }
-	 mean_error /= npoints;
-	 mean_squared_error = sqrt( mean_squared_error / npoints);
-
-	 curvature = 0.0;
-	 n_nodes = nx * ny;
-
-	 for (i = 0; i < nx; i++) {
-	 	for (j = 0; j < ny; j++) {
-	 		ij = ij_sw_corner + i * my + j;
-	 		c = u[ij + move_over[6]] + u[ij + move_over[5]]
-	 			+ u[ij + move_over[2]] + u[ij + move_over[9]] - 4.0 * u[ij + move_over[6]];
-			curvature += (c * c);
-		}
-	}
-
-	 /*
-	 fprintf(stderr, "Fit info: N data points  N nodes\tmean error\trms error\tcurvature\n");
-	 fprintf (stderr,"\t%8d\t%8d\t%.8lg\t%.8lg\t%.8lg\n", npoints, n_nodes, mean_error, mean_squared_error,
-	 	curvature);
-	*/
-	if (local_verbose)
-		{
-		fprintf(stderr,"\nSpline interpolation fit information:\n");
-		fprintf(stderr,"Data points   nodes    mean error     rms error     curvature\n");
-		fprintf(stderr,"%9d %9d   %10g   %10g  %10g\n",
-			npoints, n_nodes, mean_error, mean_squared_error,
-	 		curvature);
-		}
- }
-
-int	remove_planar_trend()
-{
-
-	int	i;
-	double	a, b, c, d, xx, yy, zz;
-	double	sx, sy, sz, sxx, sxy, sxz, syy, syz;
-
-	sx = sy = sz = sxx = sxy = sxz = syy = syz = 0.0;
-
-	for (i = 0; i < npoints; i++) {
-
-		xx = (data[i].x - xmin) * r_xinc;
-		yy = (data[i].y - ymin) * r_yinc;
-		zz = data[i].z;
-
-		sx += xx;
-		sy += yy;
-		sz += zz;
-		sxx +=(xx * xx);
-		sxy +=(xx * yy);
-		sxz +=(xx * zz);
-		syy +=(yy * yy);
-		syz +=(yy * zz);
-	}
-
-	d = npoints*sxx*syy + 2*sx*sy*sxy - npoints*sxy*sxy - sx*sx*syy - sy*sy*sxx;
-
-	if (d == 0.0) {
-		plane_c0 = plane_c1 = plane_c2 = 0.0;
-		return(0);
-	}
-
-	a = sz*sxx*syy + sx*sxy*syz + sy*sxy*sxz - sz*sxy*sxy - sx*sxz*syy - sy*syz*sxx;
-	b = npoints*sxz*syy + sz*sy*sxy + sy*sx*syz - npoints*sxy*syz - sz*sx*syy - sy*sy*sxz;
-	c = npoints*sxx*syz + sx*sy*sxz + sz*sx*sxy - npoints*sxy*sxz - sx*sx*syz - sz*sy*sxx;
-
-	plane_c0 = a / d;
-	plane_c1 = b / d;
-	plane_c2 = c / d;
-
-	for (i = 0; i < npoints; i++) {
-
-		xx = (data[i].x - xmin) * r_xinc;
-		yy = (data[i].y - ymin) * r_yinc;
-
-		data[i].z -=(plane_c0 + plane_c1 * xx + plane_c2 * yy);
-	}
-
-	return(0);
-}
-
-int	replace_planar_trend()
-{
-	int	i, j, ij;
-
-	 for (i = 0; i < nx; i++) {
-	 	for (j = 0; j < ny; j++) {
-	 		ij = ij_sw_corner + i * my + j;
-	 		u[ij] = (u[ij] * z_scale) + (plane_c0 + plane_c1 * i + plane_c2 * j);
-		}
-	}
-	return(0);
-}
-
-int	throw_away_unusables()
-{
-	/* This is a new routine to eliminate data which will become
-		unusable on the final iteration, when grid = 1.
-		It assumes grid = 1 and set_grid_parameters has been
-		called.  We sort, mark redundant data as OUTSIDE, and
-		sort again, chopping off the excess.
-
-		Experimental modification 5 Dec 1988 by Smith, as part
-		of a new implementation using core memory for b[6]
-		coefficients, eliminating calls to temp file.
-	*/
-
-	int	last_index, n_outside, k;
-
-	/* Sort the data  */
-
-	qsort ((char *)data, npoints, sizeof (struct MB_SURFACE_DATA), (void *)compare_points);
-
-	/* If more than one datum is indexed to same node, only the first should be kept.
-		Mark the additional ones as OUTSIDE
-	*/
-	last_index = -1;
-	n_outside = 0;
-	for (k = 0; k < npoints; k++) {
-		if (data[k].index == last_index) {
-			data[k].index = OUTSIDE;
-			n_outside++;
-		}
-		else {
-			last_index = data[k].index;
-		}
-	}
-	/* Sort again; this time the OUTSIDE points will be thrown away  */
-
-	qsort ((char *)data, npoints, sizeof (struct MB_SURFACE_DATA), (void *)compare_points);
-	npoints -= n_outside;
-	status = mb_reallocd(local_verbose, __FILE__, __LINE__,
-				npoints * sizeof(struct MB_SURFACE_DATA),
-				(void **)&data, &local_error);
-	if (local_verbose && (n_outside)) {
-		fprintf(stderr,"surface: %d unusable points were supplied; these will be ignored.\n", n_outside);
-		fprintf(stderr,"\tYou should have pre-processed the data with blockmean or blockmedian.\n");
-	}
-
-	return(0);
-}
-
-int	rescale_z_values()
-{
-	int	i;
-	double	ssz = 0.0;
-
-	for (i = 0; i < npoints; i++) {
-		ssz += (data[i].z * data[i].z);
-	}
-
-	/* Set z_scale = rms(z):  */
-
-	z_scale = sqrt(ssz / npoints);
-	r_z_scale = 1.0 / z_scale;
-
-	for (i = 0; i < npoints; i++) {
-		data[i].z *= r_z_scale;
-	}
-	return (0);
-}
-
-void load_constraints (char *low, char *high)
-{
-	int i, j, ij;
-	double yy;
-/*	struct GRD_HEADER hdr;*/
-
-	/* Load lower/upper limits, verify range, deplane, and rescale */
-
-	if (set_low > 0) {
-		status = mb_mallocd(local_verbose, __FILE__, __LINE__,
-					nx * ny * sizeof(float),
-					(void **)&lower, &local_error);
-		if (set_low < 3)
-			for (i = 0; i < nx * ny; i++) lower[i] = low_limit;
-/* Comment this out:
-		else {
-			if (read_grd_info (low, &hdr)) {
-				fprintf (stderr, "surface: Error opening file %s\n", low);
-				exit (-1);
-			}
-			if (hdr.nx != nx || hdr.ny != ny) {
-				fprintf (stderr, "surface: lower limit file not of proper dimension!\n");
-				exit (-1);
-			}
-			if (read_grd (low, &hdr, lower)) {
-				fprintf (stderr, "surface: Error reading file %s\n", low);
-				exit (-1);
-			}
-			n_trimmed = 0;
-			for (i = 0; i < nx * ny; i++) if (lower[i] > low_limit) {
-				lower[i] = low_limit;
-				n_trimmed++;
-			}
-			if (n_trimmed) fprintf (stderr, "surface: %d lower limit values > min data, reset to min data!\n");
-		}
-*/
-
-		for (j = ij = 0; j < ny; j++) {
-			yy = ny - j - 1;
-			for (i = 0; i < nx; i++, ij++) {
-				/*if (GMT_is_fnan ((double)lower[ij])) continue;*/
-				lower[ij] -= (plane_c0 + plane_c1 * i + plane_c2 * yy);
-				lower[ij] *= r_z_scale;
-			}
-		}
-		constrained = TRUE;
-	}
-	if (set_high > 0) {
-		status = mb_mallocd(local_verbose, __FILE__, __LINE__,
-					nx * ny * sizeof(float),
-					(void **)&upper, &local_error);
-		if (set_high < 3)
-			for (i = 0; i < nx * ny; i++) upper[i] = high_limit;
-/* Comment this out:
-		else {
-			if (read_grd_info (high, &hdr)) {
-				fprintf (stderr, "surface: Error opening file %s\n", high);
-				exit (-1);
-			}
-			if (hdr.nx != nx || hdr.ny != ny) {
-				fprintf (stderr, "surface: upper limit file not of proper dimension!\n");
-				exit (-1);
-			}
-			if (read_grd (high, &hdr, upper)) {
-				fprintf (stderr, "surface: Error reading file %s\n", high);
-				exit (-1);
-			}
-			n_trimmed = 0;
-			for (i = 0; i < nx * ny; i++) if (upper[i] < high_limit) {
-				upper[i] = high_limit;
-				n_trimmed++;
-			}
-			if (n_trimmed) fprintf (stderr, "surface: %d upper limit values < max data, reset to max data!\n");
-		}
-*/
-		for (j = ij = 0; j < ny; j++) {
-			yy = ny - j - 1;
-			for (i = 0; i < nx; i++, ij++) {
-				/*if (GMT_is_fnan ((double)upper[ij])) continue;*/
-				upper[ij] -= (plane_c0 + plane_c1 * i + plane_c2 * yy);
-				upper[ij] *= r_z_scale;
-			}
-		}
-		constrained = TRUE;
-	}
-}
-
-double	guess_surface_time(int nx, int ny)
-{
-	/* Routine to guess a number proportional to the operations
-	 * required by surface working on a user-desired grid of
-	 * size nx by ny, where nx = (xmax - xmin)/dx, and same for
-	 * ny.  (That is, one less than actually used in routine.)
-	 *
-	 * This is based on the following untested conjecture:
-	 * 	The operations are proportional to T = nxg*nyg*L,
-	 *	where L is a measure of the distance that data
-	 *	constraints must propagate, and nxg, nyg are the
-	 * 	current size of the grid.
-	 *	For nx,ny relatively prime, we will go through only
-	 * 	one grid cycle, L = max(nx,ny), and T = nx*ny*L.
-	 *	But for nx,ny whose greatest common divisor is a highly
-	 * 	composite number, we will have L equal to the division
-	 * 	step made at each new grid cycle, and nxg,nyg will
-	 * 	also be smaller than nx,ny.  Thus we can hope to find
-	 *	some nx,ny for which the total value of T is small.
-	 *
-	 * The above is pure speculation and has not been derived
-	 * empirically.  In actual practice, the distribution of the
-	 * data, both spatially and in terms of their values, will
-	 * have a strong effect on convergence.
-	 *
-	 * W. H. F. Smith, 26 Feb 1992.  */
-
-	int	gcd_euclid();	/* Finds the greatest common divisor  */
-	int	get_prime_factors();
-	int	gcd;		/* Current value of the gcd  */
-	int	nxg, nyg;	/* Current value of the grid dimensions  */
-	int	nfactors;	/* Number of prime factors of current gcd  */
-	int	factor;		/* Currently used factor  */
-	/* Doubles are used below, even though the values will be integers,
-		because the multiplications might reach sizes of O(n**3)  */
-	double	t_sum;		/* Sum of values of T at each grid cycle  */
-	double	length;		/* Current propagation distance.  */
-
-
-	gcd = gcd_euclid(nx, ny);
-	if (gcd > 1) {
-		nfactors = get_prime_factors(gcd, factors);
-		nxg = nx/gcd;
-		nyg = ny/gcd;
-		if (nxg < 3 || nyg < 3) {
-			factor = factors[nfactors - 1];
-			nfactors--;
-			gcd /= factor;
-			nxg *= factor;
-			nyg *= factor;
-		}
-	}
-	else {
-		nxg = nx;
-		nyg = ny;
-	}
-	length = MAX(nxg, nyg);
-	t_sum = nxg * (nyg * length);	/* Make it double at each multiply  */
-
-	/* Are there more grid cycles ?  */
-	while (gcd > 1) {
-		factor = factors[nfactors - 1];
-		nfactors--;
-		gcd /= factor;
-		nxg *= factor;
-		nyg *= factor;
-		length = factor;
-		t_sum += nxg * (nyg * length);
-	}
-	return(t_sum);
-}
-
-
-int	get_prime_factors(int n, int f[])
-{
-	/* Fills the integer array f with the prime factors of n.
-	 * Returns the number of locations filled in f, which is
-	 * one if n is prime.
-	 *
-	 * f[] should have been malloc'ed to enough space before
-	 * calling prime_factors().  We can be certain that f[32]
-	 * is enough space, for if n fits in a long, then n < 2**32,
-	 * and so it must have fewer than 32 prime factors.  I think
-	 * that in general, ceil(log2((double)n)) is enough storage
-	 * space for f[].
-	 *
-	 * Tries 2,3,5 explicitly; then alternately adds 2 or 4
-	 * to the previously tried factor to obtain the next trial
-	 * factor.  This is done with the variable two_four_toggle.
-	 * With this method we try 7,11,13,17,19,23,25,29,31,35,...
-	 * up to a maximum of sqrt(n).  This shortened list results
-	 * in 1/3 fewer divisions than if we simply tried all integers
-	 * between 5 and sqrt(n).  We can reduce the size of the list
-	 * of trials by an additional 20% by removing the multiples
-	 * of 5, which are equal to 30m +/- 5, where m >= 1.  Starting
-	 * from 25, these are found by alternately adding 10 or 20.
-	 * To do this, we use the variable ten_twenty_toggle.
-	 *
-	 * W. H. F. Smith, 26 Feb 1992, after D.E. Knuth, vol. II  */
-
-	int	current_factor;	/* The factor currently being tried  */
-	int	max_factor;	/* Don't try any factors bigger than this  */
-	int	n_factors = 0;	/* Returned; one if n is prime  */
-	int	two_four_toggle = 0;	/* Used to add 2 or 4 to get next trial factor  */
-	int	ten_twenty_toggle = 0;	/* Used to add 10 or 20 to skip_five  */
-	int	skip_five = 25;	/* Used to skip multiples of 5 in the list  */
-	int	m;	/* Used to keep a working copy of n  */
-
-
-	/* Initialize m and max_factor  */
-	m = abs(n);
-	if (m < 2) return(0);
-	max_factor = floor(sqrt((double)m));
-
-	/* First find the 2s  */
-	current_factor = 2;
-	while(!(m%current_factor)) {
-		m /= current_factor;
-		f[n_factors] = current_factor;
-		n_factors++;
-	}
-	if (m == 1) return(n_factors);
-
-	/* Next find the 3s  */
-	current_factor = 3;
-	while(!(m%current_factor)) {
-		m /= current_factor;
-		f[n_factors] = current_factor;
-		n_factors++;
-	}
-	if (m == 1) return(n_factors);
-
-	/* Next find the 5s  */
-	current_factor = 5;
-	while(!(m%current_factor)) {
-		m /= current_factor;
-		f[n_factors] = current_factor;
-		n_factors++;
-	}
-	if (m == 1) return(n_factors);
-
-	/* Now try all the rest  */
-
-	while (m > 1 && current_factor <= max_factor) {
-
-		/* Current factor is either 2 or 4 more than previous value  */
-
-		if (two_four_toggle) {
-			current_factor += 4;
-			two_four_toggle = 0;
-		}
-		else {
-			current_factor += 2;
-			two_four_toggle = 1;
-		}
-
-		/* If current factor is a multiple of 5, skip it.  But first,
-			set next value of skip_five according to 10/20 toggle:  */
-
-		if (current_factor == skip_five) {
-			if (ten_twenty_toggle) {
-				skip_five += 20;
-				ten_twenty_toggle = 0;
-			}
-			else {
-				skip_five += 10;
-				ten_twenty_toggle = 1;
-			}
-			continue;
-		}
-
-		/* Get here when current_factor is not a multiple of 2,3 or 5:  */
-
-		while(!(m%current_factor)) {
-			m /= current_factor;
-			f[n_factors] = current_factor;
-			n_factors++;
-		}
-	}
-
-	/* Get here when all factors up to floor(sqrt(n)) have been tried.  */
-
-	if (m > 1) {
-		/* m is an additional prime factor of n  */
-		f[n_factors] = m;
-		n_factors++;
-	}
-	return (n_factors);
-}
-/* gcd_euclid.c  Greatest common divisor routine  */
-
-#define IABS(i)	(((i) < 0) ? -(i) : (i))
-
-int	gcd_euclid(int a,int b)
-{
-	/* Returns the greatest common divisor of u and v by Euclid's method.
-	 * I have experimented also with Stein's method, which involves only
-	 * subtraction and left/right shifting; Euclid is faster, both for
-	 * integers of size 0 - 1024 and also for random integers of a size
-	 * which fits in a long integer.  Stein's algorithm might be better
-	 * when the integers are HUGE, but for our purposes, Euclid is fine.
-	 *
-	 * Walter H. F. Smith, 25 Feb 1992, after D. E. Knuth, vol. II  */
-
-	int	u,v,r;
-
-	u = MAX(IABS(a), IABS(b));
-	v = MIN(IABS(a), IABS(b));
-
-	while (v > 0) {
-		r = u%v;	/* Knuth notes that u < 2v 40% of the time;  */
-		u = v;		/* thus we could have tried a subtraction  */
-		v = r;		/* followed by an if test to do r = u%v  */
-	}
-	return(u);
-}
diff --git a/src/mbaux/mb_track.c b/src/mbaux/mb_track.c
deleted file mode 100644
index 0f1a4c3..0000000
--- a/src/mbaux/mb_track.c
+++ /dev/null
@@ -1,372 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mb_track.c	8/15/93
- *    $Id: mb_track.c 2229 2015-02-14 23:04:41Z caress $
- *
- *    Copyright (c) 1993-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mb_track.c plots the shiptrack of swath sonar data.
- *
- * Author:	D. W. Caress
- * Date:	August, 1993
- *
- *
- */
-
-/* standard global include files */
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_define.h"
-#include "mb_aux.h"
-
-//* global defines */
-#define IMOVE 	3
-#define IDRAW 	2
-#define ISTROKE	-2
-#define IOR 	-3
-#define EPS 0.0001
-
-static char rcs_id[]="$Id: mb_track.c 2229 2015-02-14 23:04:41Z caress $";
-
-/*--------------------------------------------------------------------------*/
-/* 	function mb_track plots the shiptrack of multibeam data. */
-void mb_track(int verbose, struct swath *data, int *error)
-{
-	char	*function_name = "mb_track";
-	int	status = MB_SUCCESS;
-	int	time_tick, time_annot, date_annot;
-	double	hour0, hour1;
-	int	time_j[5];
-	double	x, y, x1, y1, x2, y2, x3, y3, x4, y4;
-	double	dx, dy;
-	double	angle;
-	char	label[25];
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBBA function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:              %d\n",verbose);
-		fprintf(stderr,"dbg2       swath:                %p\n",data);
-		fprintf(stderr,"dbg2       time tick interval:   %f\n",data->time_tick_int);
-		fprintf(stderr,"dbg2       time interval:        %f\n",data->time_annot_int);
-		fprintf(stderr,"dbg2       date interval:        %f\n",data->date_annot_int);
-		fprintf(stderr,"dbg2       time tick length:     %f\n",data->time_tick_len);
-		fprintf(stderr,"dbg2       data->npings:         %d\n",data->npings);
-		for (i=0;i<data->npings;i++)
-			{
-			fprintf(stderr,"dbg2       i:%d time:%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d position: %.9f %.9f\n",
-					i,data->pings[i].time_i[0],data->pings[i].time_i[1],data->pings[i].time_i[2],
-					data->pings[i].time_i[3],data->pings[i].time_i[4],data->pings[i].time_i[5],data->pings[i].time_i[6],
-					data->pings[i].navlon,data->pings[i].navlat);
-			}
-		}
-
-	/* set line width */
-	data->contour_setline(3);
-	data->contour_newpen(0);
-
-	/* draw the time ticks */
-	for (i=1;i<data->npings;i++)
-		{
-		/* get time of day */
-		hour0 = data->pings[i-1].time_i[3]
-			+ data->pings[i-1].time_i[4]/60.0
-			+ data->pings[i-1].time_i[5]/3600.0;
-		hour1 = data->pings[i].time_i[3]
-			+ data->pings[i].time_i[4]/60.0
-			+ data->pings[i].time_i[5]/3600.0;
-
-		/* check for time tick */
-		time_tick = MB_NO;
-		if (floor(hour0/data->time_tick_int)
-			!= floor(hour1/data->time_tick_int))
-			time_tick = MB_YES;
-
-		/* check for time annotation */
-		time_annot = MB_NO;
-		if (floor(hour0/data->time_annot_int)
-			!= floor(hour1/data->time_annot_int))
-			time_annot = MB_YES;
-
-		/* check for date annotation */
-		date_annot = MB_NO;
-		if (floor(hour0/data->date_annot_int)
-			!= floor(hour1/data->date_annot_int))
-			date_annot = MB_YES;
-
-		/* now get azimuth and location if needed */
-		if (date_annot == MB_YES || time_annot == MB_YES
-			|| time_tick == MB_YES)
-			{
-			/* get azimuth from heading */
-			angle = data->pings[i].heading + 90.0;
-			if (angle > 360.0)
-				angle = angle - 360.0;
-			dx = sin(DTR*angle);
-			dy = cos(DTR*angle);
-
-			/* cheat and get location by averaging */
-			x = 0.5*(data->pings[i-1].navlon
-				+ data->pings[i].navlon);
-			y = 0.5*(data->pings[i-1].navlat
-				+ data->pings[i].navlat);
-			}
-
-		/* do date annotation if needed */
-		if (date_annot == MB_YES)
-			{
-			x1 = x + 0.375*data->time_tick_len*(dx - dy);
-			y1 = y + 0.375*data->time_tick_len*(dy + dx);
-			x3 = x + 0.375*data->time_tick_len*(dx + dy);
-			y3 = y + 0.375*data->time_tick_len*(dy - dx);
-			x2 = x + 0.375*data->time_tick_len*(-dx + dy);
-			y2 = y + 0.375*data->time_tick_len*(-dy - dx);
-			x4 = x + 0.375*data->time_tick_len*(-dx - dy);
-			y4 = y + 0.375*data->time_tick_len*(-dy + dx);
-			data->contour_plot(x1,y1,IMOVE);
-			data->contour_plot(x2,y2,IDRAW);
-			data->contour_plot(x3,y3,IMOVE);
-			data->contour_plot(x4,y4,ISTROKE);
-			mb_get_jtime(verbose,data->pings[i].time_i,time_j);
-			sprintf(label," %2.2d:%2.2d/%3.3d",
-				data->pings[i].time_i[3],
-				data->pings[i].time_i[4],
-				time_j[1]);
-			data->contour_plot_string(x,y,data->time_tick_len,90.0-angle,label);
-			}
-
-		/* do time annotation if needed */
-		else if (time_annot == MB_YES)
-			{
-			x1 = x + 0.375*data->time_tick_len*(dx - dy);
-			y1 = y + 0.375*data->time_tick_len*(dy + dx);
-			x3 = x + 0.375*data->time_tick_len*(dx + dy);
-			y3 = y + 0.375*data->time_tick_len*(dy - dx);
-			x2 = x + 0.375*data->time_tick_len*(-dx + dy);
-			y2 = y + 0.375*data->time_tick_len*(-dy - dx);
-			x4 = x + 0.375*data->time_tick_len*(-dx - dy);
-			y4 = y + 0.375*data->time_tick_len*(-dy + dx);
-			data->contour_plot(x1,y1,IMOVE);
-			data->contour_plot(x2,y2,IDRAW);
-			data->contour_plot(x3,y3,IMOVE);
-			data->contour_plot(x4,y4,ISTROKE);
-			sprintf(label,"   %2.2d:%2.2d",
-				data->pings[i].time_i[3],
-				data->pings[i].time_i[4]);
-			data->contour_plot_string(x,y,data->time_tick_len,90.0-angle,label);
-			}
-
-		/* do time tick if needed */
-		else if (time_tick == MB_YES)
-			{
-			x1 = x + 0.25*data->time_tick_len*(dx - dy);
-			y1 = y + 0.25*data->time_tick_len*(dy + dx);
-			x3 = x + 0.25*data->time_tick_len*(dx + dy);
-			y3 = y + 0.25*data->time_tick_len*(dy - dx);
-			x2 = x + 0.25*data->time_tick_len*(-dx + dy);
-			y2 = y + 0.25*data->time_tick_len*(-dy - dx);
-			x4 = x + 0.25*data->time_tick_len*(-dx - dy);
-			y4 = y + 0.25*data->time_tick_len*(-dy + dx);
-			data->contour_plot(x1,y1,IMOVE);
-			data->contour_plot(x2,y2,IDRAW);
-			data->contour_plot(x3,y3,IMOVE);
-			data->contour_plot(x4,y4,ISTROKE);
-			}
-		}
-
-	/* draw the shiptrack */
-	for (i=0;i<data->npings;i++)
-		{
-		if (i == 0)
-			data->contour_plot(data->pings[i].navlon,data->pings[i].navlat,IMOVE);
-		else if (i < data->npings - 1)
-			data->contour_plot(data->pings[i].navlon,data->pings[i].navlat,IDRAW);
-		else
-			data->contour_plot(data->pings[i].navlon,data->pings[i].navlat,ISTROKE);
-		}
-
-	/* reset line width */
-	data->contour_setline(0);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	return;
-}
-
-
-/*--------------------------------------------------------------------------*/
-/* 	function mb_trackpingnumber annotates pingnumbers */
-void mb_trackpingnumber(int verbose, struct swath *data, int *error)
-{
-	char	*function_name = "mb_trackpingnumber";
-	int	status = MB_SUCCESS;
-	int	pingnumber_tick, pingnumber_annot;
-	double	x, y, x1, y1, x2, y2;
-	double	dx, dy;
-	double	angle;
-	char	label[25];
-	double	justify[4];
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBBA function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:              %d\n",verbose);
-		fprintf(stderr,"dbg2       swath:                %p\n",data);
-		fprintf(stderr,"dbg2       pingnumber tick int:  %d\n",data->pingnumber_tick_int);
-		fprintf(stderr,"dbg2       pingnumber annot int: %d\n",data->pingnumber_annot_int);
-		fprintf(stderr,"dbg2       pingnumber tick len:  %f\n",data->pingnumber_tick_len);
-		}
-
-	/* set line width */
-	data->contour_setline(3);
-	data->contour_newpen(0);
-
-	/* draw the pingnumber ticks and annotations */
-	for (i=0;i<data->npings;i++)
-		{
-		/* check for pingnumber tick */
-		pingnumber_tick = MB_NO;
-		if (data->pings[i].pingnumber % data->pingnumber_tick_int == 0)
-			pingnumber_tick = MB_YES;
-
-		/* check for pingnumber annotation */
-		pingnumber_annot = MB_NO;
-		if (data->pings[i].pingnumber % data->pingnumber_annot_int == 0 )
-			pingnumber_annot = MB_YES;
-
-		/* now get azimuth and location if needed */
-		if (pingnumber_tick == MB_YES || pingnumber_annot == MB_YES)
-			{
-			/* get azimuth from heading */
-			angle = data->pings[i].heading + 90.0;
-			if (angle > 360.0)
-				angle = angle - 360.0;
-			dx = sin(DTR*angle);
-			dy = cos(DTR*angle);
-
-			/* get location */
-			x = data->pings[i].navlon;
-			y = data->pings[i].navlat;
-			}
-
-		/* do pingnumber annotation if needed */
-		if (pingnumber_annot == MB_YES)
-			{
-			sprintf(label,"%d ", data->pings[i].pingnumber);
-			data->contour_justify_string(data->pingnumber_tick_len, label, justify);
-			x1 = x - 0.375*data->pingnumber_tick_len*dx;
-			y1 = y - 0.375*data->pingnumber_tick_len*dy;
-			x2 = x - 1.5*justify[2]*dx;
-			y2 = y - 1.5*justify[2]*dy;
-			data->contour_plot(x1,y1,IMOVE);
-			data->contour_plot(x,y,IDRAW);
-			data->contour_plot_string(x2,y2,data->pingnumber_tick_len,90.0-angle,label);
-			}
-
-		/* do time tick if needed */
-		else if (pingnumber_tick == MB_YES)
-			{
-			x1 = x - 0.25*data->pingnumber_tick_len*dx;
-			y1 = y - 0.25*data->pingnumber_tick_len*dy;
-			x2 = x + 0.25*data->pingnumber_tick_len*dx;
-			y2 = y + 0.25*data->pingnumber_tick_len*dy;
-			data->contour_plot(x1,y1,IMOVE);
-			data->contour_plot(x,y,IDRAW);
-			}
-		}
-
-	/* reset line width */
-	data->contour_setline(0);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	return;
-}
-
-/*--------------------------------------------------------------------------*/
-/* 	function mb_trackname plots the filename on the shiptrack.
-	 - contributed by Gordon Keith, CSIRO, December 2004 */
-void mb_trackname(int verbose, int perpendicular, struct swath *data, char *file, int *error)
-{
-	char	*function_name = "mb_trackname";
-	int	status = MB_SUCCESS;
-	double	angle;
-	char	label[MB_PATH_MAXLINE];
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBBA function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:            %d\n",verbose);
-		fprintf(stderr,"dbg2       perpendicular:      %d\n",perpendicular);
-		fprintf(stderr,"dbg2       swath:              %p\n",data);
-		fprintf(stderr,"dbg2       file:               %s\n",file);
-		}
-
-	strncpy(label,file,MB_PATH_MAXLINE);
-	mb_get_basename(verbose,label,error);
-	if (perpendicular == MB_YES)
-		angle = 0.0 - data->pings[0].heading;
-	else
-		angle = 90.0 - data->pings[0].heading;
-	if (angle < 0.0)
-		angle += 360.0;
-	if (angle > 360.0)
-		angle -= 360.0;
-	data->contour_plot_string(data->pings[0].navlon,data->pings[0].navlat,
-		    data->name_hgt,
-		    angle,
-		    label);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	return;
-}
-
-/*--------------------------------------------------------------------------*/
diff --git a/src/mbaux/mb_truecont.c b/src/mbaux/mb_truecont.c
deleted file mode 100644
index e7b45a9..0000000
--- a/src/mbaux/mb_truecont.c
+++ /dev/null
@@ -1,2082 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mb_truecont.c	4/21/94
- *    $Id: mb_truecont.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1994-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mb_truecontour.c contours a block of multibeam bathymetry data,
- * dealing correctly with beams in arbitrary locations by forming
- * a delauney triangle network and then contouring that network.
- *
- * Author:	D. W. Caress
- * Date:	April, 1994
- *
- */
-
-/* standard global include files */
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_define.h"
-#include "mb_aux.h"
-
-/* global defines */
-#define IMOVE 	3
-#define IDRAW 	2
-#define ISTROKE	-2
-#define IOR 	-3
-#define EPS 0.0001
-
-/* local function prototypes */
-int mb_tcontour(
-		int	verbose,
-		struct swath *data,
-		int	*error);
-int mb_ocontour(
-		int	verbose,
-		struct swath *data,
-		int	*error);
-int get_start_tri(
-		struct swath *data,
-		int	*itri,
-		int	*iside1,
-		int	*iside2,
-		int	*closed);
-int get_next_tri(
-		struct swath *data,
-		int	*itri,
-		int	*iside1,
-		int	*iside2,
-		int	*closed,
-		int	*itristart,
-		int	*isidestart);
-int get_pos_tri(
-		struct swath *data,
-		double	eps,
-		int	itri,
-		int	iside,
-		double	value,
-		double	*x,
-		double	*y);
-int get_azimuth_tri(
-		struct swath *data,
-		int	itri,
-		int	iside,
-		double	*angle);
-int check_label(struct swath *data,
-		int	nlab);
-int dump_contour(struct swath *data, double value);
-int get_start_old(struct swath *data,
-		int *k, int *i, int *j, int *d, int *closed);
-int get_next_old(struct swath *data, int *nk, int *ni, int *nj, int *nd,
-		int k, int i, int j, int d,
-		int kbeg, int ibeg, int jbeg, int dbeg, int *closed);
-int get_pos_old(struct swath *data, double eps, double *x, double *y,
-		int k, int i, int j, double value);
-int get_hand_old(struct swath *data, int *hand,
-		int k, int i, int j, int d);
-int get_azimuth_old(struct swath *data, int iping, double *angle);
-
-static char rcs_id[]="$Id: mb_truecont.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------------*/
-/* 	function mb_contour_init initializes the memory required to
-	contour multibeam bathymetry data.
-	if mbio_ptr is null, the arrays are allocated using mb_malloc. If
-	mbio_ptr is a valid mbio structure, then the arrays tied to
-	beams_bath will be registered using mb_register_array */
-int mb_contour_init(
-		int	verbose,
-		struct swath **data,
-		int	npings_max,
-		int	beams_bath,
-		int	contour_algorithm,
-		int	plot_contours,
-		int	plot_triangles,
-		int	plot_track,
-		int	plot_name,
-		int	plot_pingnumber,
-		double	contour_int,
-		double	color_int,
-		double	tick_int,
-		double	label_int,
-		double	tick_len,
-		double	label_hgt,
-		double	label_spacing,
-		int	ncolor,
-		int	nlevel,
-		double	*level_list,
-		int	*label_list,
-		int	*tick_list,
-		double	time_tick_int,
-		double	time_annot_int,
-		double	date_annot_int,
-		double	time_tick_len,
-		double	name_hgt,
-		int	pingnumber_tick_int,
-		int	pingnumber_annot_int,
-		double	pingnumber_tick_len,
-		void 	(*contour_plot)(double, double, int),
-		void 	(*contour_newpen)(int),
-		void   	(*contour_setline)(int),
-		void 	(*contour_justify_string)(double, char *, double *),
-		void 	(*contour_plot_string)(double, double, double, double, char *),
-		int	*error)
-{
-	char	*function_name = "mb_contour_init";
-	int	status = MB_SUCCESS;
-	struct swath *dataptr;
-	struct ping *ping;
-	int	ntri_max;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:              %d\n",verbose);
-		fprintf(stderr,"dbg2       data:                 %p\n",data);
-		fprintf(stderr,"dbg2       npings_max:           %d\n",npings_max);
-		fprintf(stderr,"dbg2       beams_bath:           %d\n",beams_bath);
-		fprintf(stderr,"dbg2       contour algorithm:    %d\n",contour_algorithm);
-		fprintf(stderr,"dbg2       plot contours:        %d\n",plot_contours);
-		fprintf(stderr,"dbg2       plot triangles:       %d\n",plot_triangles);
-		fprintf(stderr,"dbg2       plot track:           %d\n",plot_track);
-		fprintf(stderr,"dbg2       plot name:            %d\n",plot_name);
-		fprintf(stderr,"dbg2       plot pingnumber:      %d\n",plot_pingnumber);
-		fprintf(stderr,"dbg2       contour interval:     %f\n",contour_int);
-		fprintf(stderr,"dbg2       color interval:       %f\n",color_int);
-		fprintf(stderr,"dbg2       tick interval:        %f\n",tick_int);
-		fprintf(stderr,"dbg2       label interval:       %f\n",label_int);
-		fprintf(stderr,"dbg2       tick length:          %f\n",tick_len);
-		fprintf(stderr,"dbg2       label height:         %f\n",label_hgt);
-		fprintf(stderr,"dbg2       label spacing:        %f\n",label_spacing);
-		fprintf(stderr,"dbg2       number of colors:     %d\n",ncolor);
-		fprintf(stderr,"dbg2       number of levels:     %d\n",nlevel);
-		for (i=0;i<nlevel;i++)
-			fprintf(stderr,"dbg2       level %d: %f %d %d\n",
-				i,level_list[i],label_list[i],tick_list[i]);
-		fprintf(stderr,"dbg2       time tick int:        %f\n",time_tick_int);
-		fprintf(stderr,"dbg2       time interval:        %f\n",time_annot_int);
-		fprintf(stderr,"dbg2       date interval:        %f\n",date_annot_int);
-		fprintf(stderr,"dbg2       time tick length:     %f\n",time_tick_len);
-		fprintf(stderr,"dbg2       name height:          %f\n",name_hgt);
-		fprintf(stderr,"dbg2       pingnumber tick int:  %d\n",pingnumber_tick_int);
-		fprintf(stderr,"dbg2       pingnumber annot int: %d\n",pingnumber_annot_int);
-		fprintf(stderr,"dbg2       pingnumber tick len:  %f\n",pingnumber_tick_len);
-		fprintf(stderr,"dbg2       contour_plot():       %p\n",contour_plot);
-		fprintf(stderr,"dbg2       contour_newpen():     %p\n",contour_newpen);
-		fprintf(stderr,"dbg2       contour_setline():    %p\n",contour_setline);
-		fprintf(stderr,"dbg2       contour_justify_string():  	 %p\n",contour_justify_string);
-		fprintf(stderr,"dbg2       contour_plot_string():  	 %p\n",contour_plot_string);
-		}
-
-	/* allocate memory for swath structure */
-	status = mb_mallocd(verbose,__FILE__,__LINE__,sizeof(struct swath),(void **)data,error);
-
-	/* set variables and allocate memory for bathymetry data */
-	dataptr = *data;
-	dataptr->npings = 0;
-	dataptr->npings_max = npings_max;
-	dataptr->beams_bath = beams_bath;
-	status = mb_mallocd(verbose,__FILE__,__LINE__,npings_max*sizeof(struct ping),
-				(void **)&(dataptr->pings),error);
-	for (i=0;i<npings_max;i++)
-		{
-		ping = &dataptr->pings[i];
-		ping->beams_bath = 0;
-		ping->beams_bath_alloc = beams_bath;
-		ping->beamflag = NULL;
-		ping->bath = NULL;
-		ping->bathlon = NULL;
-		ping->bathlat = NULL;
-		status = mb_mallocd(verbose,__FILE__,__LINE__,beams_bath*sizeof(char),
-				(void **)&(ping->beamflag),error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,beams_bath*sizeof(double),
-				(void **)&(ping->bath),error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,beams_bath*sizeof(double),
-				(void **)&(ping->bathlon),error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,beams_bath*sizeof(double),
-				(void **)&(ping->bathlat),error);
-		if (contour_algorithm == MB_CONTOUR_TRIANGLES)
-			{
-			ping->bflag[0] = NULL;
-			ping->bflag[1] = NULL;
-			}
-		else
-			{
-			ping->bflag[0] = NULL;
-			ping->bflag[1] = NULL;
-			status = mb_mallocd(verbose,__FILE__,__LINE__,beams_bath*sizeof(int),
-				(void **)&(ping->bflag[0]),error);
-			status = mb_mallocd(verbose,__FILE__,__LINE__,beams_bath*sizeof(int),
-				(void **)&(ping->bflag[1]),error);
-			}
-		}
-
-	/* set controls on what gets plotted */
-	dataptr->contour_algorithm = contour_algorithm;
-	dataptr->plot_contours = plot_contours;
-	dataptr->plot_triangles = plot_triangles;
-	dataptr->plot_track = plot_track;
-	dataptr->plot_name = plot_name;
-	dataptr->plot_pingnumber = plot_pingnumber;
-
-	/* set variables and allocate memory for contour controls */
-	dataptr->contour_int = contour_int;
-	dataptr->color_int = color_int;
-	dataptr->tick_int = tick_int;
-	dataptr->label_int = label_int;
-	dataptr->tick_len = tick_len;
-	dataptr->label_hgt = label_hgt;
-	if (label_spacing > 0.0)
-	    dataptr->label_spacing = label_spacing;
-	else
-	    dataptr->label_spacing = label_hgt;
-	dataptr->ncolor = ncolor;
-	dataptr->nlevel = nlevel;
-	dataptr->nlevelset = MB_NO;
-	dataptr->level_list = NULL;
-	dataptr->label_list = NULL;
-	dataptr->tick_list = NULL;
-	dataptr->color_list = NULL;
-	if (nlevel > 0)
-		{
-		dataptr->nlevelset = MB_YES;
-		status = mb_mallocd(verbose,__FILE__,__LINE__,nlevel*sizeof(double),
-				(void **)&(dataptr->level_list),error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,nlevel*sizeof(int),
-				(void **)&(dataptr->label_list),error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,nlevel*sizeof(int),
-				(void **)&(dataptr->tick_list),error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,nlevel*sizeof(int),
-				(void **)&(dataptr->color_list),error);
-		for (i=0;i<nlevel;i++)
-			{
-			dataptr->level_list[i] = level_list[i];
-			dataptr->label_list[i] = label_list[i];
-			dataptr->tick_list[i] = tick_list[i];
-			dataptr->color_list[i] = i;
-			}
-		}
-
-	/* set variables and allocate memory for track controls */
-	dataptr->time_tick_int = time_tick_int;
-	dataptr->time_annot_int = time_annot_int;
-	dataptr->date_annot_int = date_annot_int;
-	dataptr->time_tick_len = time_tick_len;
-	dataptr->name_hgt = name_hgt;
-
-	/* set variables and allocate memory for pingnumber control parameters */
-	dataptr->pingnumber_tick_int = pingnumber_tick_int;
-	dataptr->pingnumber_annot_int = pingnumber_annot_int;
-	dataptr->pingnumber_tick_len = pingnumber_tick_len;
-
-	/* set variables and allocate memory for triangle network */
-	dataptr->npts = 0;
-	dataptr->x = NULL;
-	dataptr->y = NULL;
-	dataptr->z = NULL;
-	dataptr->edge = NULL;
-	dataptr->pingid = NULL;
-	dataptr->ntri = 0;
-	for (i=0;i<3;i++)
-		{
-		dataptr->iv[i] = NULL;
-		dataptr->ct[i] = NULL;
-		dataptr->cs[i] = NULL;
-		dataptr->ed[i] = NULL;
-		dataptr->flag[i] = NULL;
-		}
-	dataptr->v1 = NULL;
-	dataptr->v2 = NULL;
-	dataptr->v3 = NULL;
-	dataptr->istack = NULL;
-	dataptr->kv1 = NULL;
-	dataptr->kv2 = NULL;
-	if (contour_algorithm == MB_CONTOUR_TRIANGLES)
-	  {
-	  dataptr->npts = 0;
-	  dataptr->npts_alloc = npings_max*beams_bath+3;
-	  status = mb_mallocd(verbose,__FILE__,__LINE__,dataptr->npts_alloc*sizeof(double),
-			(void **)&(dataptr->x),error);
-	  status = mb_mallocd(verbose,__FILE__,__LINE__,dataptr->npts_alloc*sizeof(double),
-			(void **)&(dataptr->y),error);
-	  status = mb_mallocd(verbose,__FILE__,__LINE__,dataptr->npts_alloc*sizeof(double),
-			(void **)&(dataptr->z),error);
-	  status = mb_mallocd(verbose,__FILE__,__LINE__,dataptr->npts_alloc*sizeof(int),
-			(void **)&(dataptr->edge),error);
-	  status = mb_mallocd(verbose,__FILE__,__LINE__,dataptr->npts_alloc*sizeof(int),
-			(void **)&(dataptr->pingid),error);
-	  ntri_max = 3*npings_max*beams_bath + 1;
-	  dataptr->ntri = 0;
-	  dataptr->ntri_alloc = ntri_max;
-	  for (i=0;i<3;i++)
-		{
-		status = mb_mallocd(verbose,__FILE__,__LINE__,ntri_max*sizeof(int),
-				(void **)&(dataptr->iv[i]),error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,ntri_max*sizeof(int),
-				(void **)&(dataptr->ct[i]),error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,ntri_max*sizeof(int),
-				(void **)&(dataptr->cs[i]),error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,ntri_max*sizeof(int),
-				(void **)&(dataptr->ed[i]),error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,ntri_max*sizeof(int),
-				(void **)&(dataptr->flag[i]),error);
-		}
-	  status = mb_mallocd(verbose,__FILE__,__LINE__,ntri_max*sizeof(double),
-			(void **)&(dataptr->v1),error);
-	  status = mb_mallocd(verbose,__FILE__,__LINE__,ntri_max*sizeof(double),
-			(void **)&(dataptr->v2),error);
-	  status = mb_mallocd(verbose,__FILE__,__LINE__,ntri_max*sizeof(double),
-			(void **)&(dataptr->v3),error);
-	  status = mb_mallocd(verbose,__FILE__,__LINE__,ntri_max*sizeof(int),
-			(void **)&(dataptr->istack),error);
-	  status = mb_mallocd(verbose,__FILE__,__LINE__,3*ntri_max*sizeof(int),
-			(void **)&(dataptr->kv1),error);
-	  status = mb_mallocd(verbose,__FILE__,__LINE__,3*ntri_max*sizeof(int),
-			(void **)&(dataptr->kv2),error);
-	  }
-
-	/* allocate memory for contour positions */
-	dataptr->nsave = 0;
-	dataptr->xsave = NULL;
-	dataptr->ysave = NULL;
-	dataptr->isave = NULL;
-	dataptr->jsave = NULL;
-	if (contour_algorithm == MB_CONTOUR_TRIANGLES)
-		{
-		status = mb_mallocd(verbose,__FILE__,__LINE__,(4*ntri_max+1)*sizeof(double),
-				(void **)&(dataptr->xsave),error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,(4*ntri_max+1)*sizeof(double),
-				(void **)&(dataptr->ysave),error);
-		}
-	else
-		{
-		dataptr->npts = 0;
-		dataptr->npts_alloc = npings_max * beams_bath;
-		status = mb_mallocd(verbose,__FILE__,__LINE__,dataptr->npts_alloc*sizeof(double),
-				(void **)&(dataptr->xsave),error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,dataptr->npts_alloc*sizeof(double),
-				(void **)&(dataptr->ysave),error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,dataptr->npts_alloc*sizeof(int),
-				(void **)&(dataptr->isave),error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,dataptr->npts_alloc*sizeof(int),
-				(void **)&(dataptr->jsave),error);
-		}
-
-	/* allocate memory for contour labels */
-	dataptr->nlabel = 0;
-	dataptr->xlabel = NULL;
-	dataptr->ylabel = NULL;
-	dataptr->angle = NULL;
-	dataptr->justify = NULL;
-	status = mb_mallocd(verbose,__FILE__,__LINE__,(5*npings_max)*sizeof(double),
-				(void **)&(dataptr->xlabel),error);
-	status = mb_mallocd(verbose,__FILE__,__LINE__,(5*npings_max)*sizeof(double),
-				(void **)&(dataptr->ylabel),error);
-	status = mb_mallocd(verbose,__FILE__,__LINE__,(5*npings_max)*sizeof(double),
-				(void **)&(dataptr->angle),error);
-	status = mb_mallocd(verbose,__FILE__,__LINE__,(5*npings_max)*sizeof(int),
-				(void **)&(dataptr->justify),error);
-	
-	/* set plotting function pointers */
-	dataptr->contour_plot = contour_plot;
- 	dataptr->contour_newpen = contour_newpen;
- 	dataptr->contour_setline = contour_setline;
- 	dataptr->contour_justify_string = contour_justify_string;
- 	dataptr->contour_plot_string = contour_plot_string;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	return(MB_SUCCESS);
-}
-
-/*--------------------------------------------------------------------------*/
-/* 	function mb_contour_deall deallocates the memory required to
-	contour multibeam bathymetry data. */
-int mb_contour_deall(
-		int	verbose,
-		struct swath *data,
-		int	*error)
-{
-	char	*function_name = "mb_contour_deall";
-	int	status = MB_SUCCESS;
-	struct ping *ping;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:                 %d\n",verbose);
-		fprintf(stderr,"dbg2       data:                    %p\n",data);
-		}
-
-	/* deallocate memory for bathymetry data */
-	for (i=0;i<data->npings_max;i++)
-		{
-		ping = &data->pings[i];
-		status = mb_freed(verbose,__FILE__, __LINE__, (void **)&ping->beamflag,error);
-		status = mb_freed(verbose,__FILE__, __LINE__, (void **)&ping->bath,error);
-		status = mb_freed(verbose,__FILE__, __LINE__, (void **)&ping->bathlon,error);
-		status = mb_freed(verbose,__FILE__, __LINE__, (void **)&ping->bathlat,error);
-		status = mb_freed(verbose,__FILE__, __LINE__, (void **)&ping->bflag[0],error);
-		status = mb_freed(verbose,__FILE__, __LINE__, (void **)&ping->bflag[1],error);
-		}
-	status = mb_freed(verbose,__FILE__, __LINE__, (void **)&data->pings,error);
-
-	/* deallocate memory for contour controls */
-	if (data->nlevel > 0)
-		{
-		status = mb_freed(verbose,__FILE__, __LINE__, (void **)&data->level_list,error);
-		status = mb_freed(verbose,__FILE__, __LINE__, (void **)&data->label_list,error);
-		status = mb_freed(verbose,__FILE__, __LINE__, (void **)&data->tick_list,error);
-		status = mb_freed(verbose,__FILE__, __LINE__, (void **)&data->color_list,error);
-		}
-
-	/* deallocate memory for triangle network */
-	status = mb_freed(verbose,__FILE__, __LINE__, (void **)&data->x,error);
-	status = mb_freed(verbose,__FILE__, __LINE__, (void **)&data->y,error);
-	status = mb_freed(verbose,__FILE__, __LINE__, (void **)&data->z,error);
-	status = mb_freed(verbose,__FILE__, __LINE__, (void **)&data->edge,error);
-	status = mb_freed(verbose,__FILE__, __LINE__, (void **)&data->pingid,error);
-	for (i=0;i<3;i++)
-		{
-		status = mb_freed(verbose,__FILE__, __LINE__, (void **)&data->iv[i],error);
-		status = mb_freed(verbose,__FILE__, __LINE__, (void **)&data->ct[i],error);
-		status = mb_freed(verbose,__FILE__, __LINE__, (void **)&data->cs[i],error);
-		status = mb_freed(verbose,__FILE__, __LINE__, (void **)&data->ed[i],error);
-		status = mb_freed(verbose,__FILE__, __LINE__, (void **)&data->flag[i],error);
-		}
-	status = mb_freed(verbose,__FILE__, __LINE__, (void **)&data->v1,error);
-	status = mb_freed(verbose,__FILE__, __LINE__, (void **)&data->v2,error);
-	status = mb_freed(verbose,__FILE__, __LINE__, (void **)&data->v3,error);
-	status = mb_freed(verbose,__FILE__, __LINE__, (void **)&data->istack,error);
-	status = mb_freed(verbose,__FILE__, __LINE__, (void **)&data->kv1,error);
-	status = mb_freed(verbose,__FILE__, __LINE__, (void **)&data->kv2,error);
-
-	/* deallocate memory for contour positions */
-	status = mb_freed(verbose,__FILE__, __LINE__, (void **)&data->xsave,error);
-	status = mb_freed(verbose,__FILE__, __LINE__, (void **)&data->ysave,error);
-	status = mb_freed(verbose,__FILE__, __LINE__, (void **)&data->isave,error);
-	status = mb_freed(verbose,__FILE__, __LINE__, (void **)&data->jsave,error);
-
-	/* deallocate memory for contour labels */
-	status = mb_freed(verbose,__FILE__, __LINE__, (void **)&data->xlabel,error);
-	status = mb_freed(verbose,__FILE__, __LINE__, (void **)&data->ylabel,error);
-	status = mb_freed(verbose,__FILE__, __LINE__, (void **)&data->angle,error);
-	status = mb_freed(verbose,__FILE__, __LINE__, (void **)&data->justify,error);
-
-	/* deallocate memory for swath structure */
-	status = mb_freed(verbose,__FILE__, __LINE__, (void **)&data,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	return(MB_SUCCESS);
-}
-/*--------------------------------------------------------------------------*/
-/* 	function mb_contour calls the appropriate contouring routine. */
-int mb_contour(
-		int	verbose,
-		struct swath *data,
-		int	*error)
-{
-	char	*function_name = "mb_contour";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:                 %d\n",verbose);
-		fprintf(stderr,"dbg2       data:                    %p\n",data);
-		fprintf(stderr,"dbg2       data->contour_alg:       %d\n",data->contour_algorithm);
-		}
-
-	/* call the appropriate contouring routine */
-	if (data->contour_algorithm == MB_CONTOUR_TRIANGLES)
-		status = mb_tcontour(verbose,data,error);
-	else
-		status = mb_ocontour(verbose,data,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	return(status);
-}
-
-/*--------------------------------------------------------------------------*/
-/* 	function mb_tcontour contours multibeam data. */
-int mb_tcontour(
-		int	verbose,
-		struct swath *data,
-		int	*error)
-{
-	char	*function_name = "mb_tcontour";
-	int	status = MB_SUCCESS;
-	struct ping *ping;
-	int	npt_cnt;
-	int	ntri_cnt;
-	int	extreme_start;
-	int	left, right;
-	double	bathmin, bathmax, xmin, xmax, ymin, ymax;
-	int	nci, ncf;
-	double	eps;
-	int	ival;
-	double	value;
-	int	tick, label;
-	int	itri, iside1, iside2, closed;
-	int	itristart, isidestart, itriend, isideend;
-	double	x, y;
-	double	magdis;
-	double	ratio;
-	int	hand;
-	int	tick_last;
-	int	i, j, k, jj;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:                 %d\n",verbose);
-		fprintf(stderr,"dbg2       data:                    %p\n",data);
-		fprintf(stderr,"dbg2       data->contour_algorithm: %d\n",data->contour_algorithm);
-		fprintf(stderr,"dbg2       data->plot_contours:     %d\n",data->plot_contours);
-		fprintf(stderr,"dbg2       data->plot_triangles:    %d\n",data->plot_triangles);
-		fprintf(stderr,"dbg2       data->plot_track:        %d\n",data->plot_track);
-		fprintf(stderr,"dbg2       data->plot_name:         %d\n",data->plot_name);
-		fprintf(stderr,"dbg2       data->contour_int:       %f\n",data->contour_int);
-		fprintf(stderr,"dbg2       data->color_int:         %f\n",data->color_int);
-		fprintf(stderr,"dbg2       data->tick_int:          %f\n",data->tick_int);
-		fprintf(stderr,"dbg2       data->label_int:         %f\n",data->label_int);
-		fprintf(stderr,"dbg2       data->tick_len:          %f\n",data->tick_len);
-		fprintf(stderr,"dbg2       data->label_hgt:         %f\n",data->label_hgt);
-		fprintf(stderr,"dbg2       data->label_spacing:     %f\n",data->label_spacing);
-		fprintf(stderr,"dbg2       data->ncolor:            %d\n",data->ncolor);
-		fprintf(stderr,"dbg2       data->nlevel:            %d\n",data->nlevel);
-		fprintf(stderr,"dbg2       data->nlevelset:         %d\n",data->nlevelset);
-		if (data->nlevelset == MB_YES)
-		for (i=0;i<data->nlevel;i++)
-			{
-			fprintf(stderr,"dbg2          level[%3d]:  %f %d %d %d\n",
-				i,data->level_list[i],data->label_list[i],data->tick_list[i],data->color_list[i]);
-			}
-		fprintf(stderr,"dbg2       data->npings:     %d\n",data->npings);
-		fprintf(stderr,"dbg2       data->npings_max: %d\n",data->npings_max);
-		fprintf(stderr,"dbg2       data->beams_bath: %d\n",data->beams_bath);
-		for (i=0;i<data->npings;i++)
-			{
-			fprintf(stderr,"dbg2          ping[%4d]: %4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d:%6.6d %f %f %f %f %d\n",
-				i,data->pings[i].time_i[0],data->pings[i].time_i[1],data->pings[i].time_i[2],
-				data->pings[i].time_i[3],data->pings[i].time_i[4],data->pings[i].time_i[5],data->pings[i].time_i[6],
-				data->pings[i].time_d,data->pings[i].navlon,data->pings[i].navlat,data->pings[i].heading,
-				data->pings[i].beams_bath);
-			for (j=0;j<data->pings[i].beams_bath;j++)
-				{
-				if (mb_beam_ok(data->pings[i].beamflag[j]))
-				fprintf(stderr,"dbg2          beam[%4d:%3d]:  %2d %f %f %f\n",
-					i,j,data->pings[i].beamflag[j],data->pings[i].bath[j],
-					data->pings[i].bathlon[j],data->pings[i].bathlat[j]);
-				}
-			}
-		}
-
-	/* count number of points and verify that enough memory is allocated */
-	npt_cnt = 0;
-	for (i=0;i<data->npings;i++)
-		{
-		ping = &data->pings[i];
-		for (j=0;j<ping->beams_bath;j++)
-			{
-			if (mb_beam_ok(ping->beamflag[j]))
-				npt_cnt++;
-			}
-		}
-	ntri_cnt = 3 * npt_cnt + 1;
-	if (npt_cnt > data->npts_alloc)
-		{
-		data->npts_alloc = npt_cnt;
-		status = mb_reallocd(verbose, __FILE__, __LINE__,data->npts_alloc*sizeof(double),
-			(void **)&(data->x),error);
-		status = mb_reallocd(verbose, __FILE__, __LINE__,data->npts_alloc*sizeof(double),
-			(void **)&(data->y),error);
-		status = mb_reallocd(verbose, __FILE__, __LINE__,data->npts_alloc*sizeof(double),
-			(void **)&(data->z),error);
-		status = mb_reallocd(verbose, __FILE__, __LINE__,data->npts_alloc*sizeof(int),
-			(void **)&(data->edge),error);
-		status = mb_reallocd(verbose, __FILE__, __LINE__,data->npts_alloc*sizeof(int),
-			(void **)&(data->pingid),error);
-		}
-	if (ntri_cnt > data->ntri_alloc)
-		{
-		data->ntri_alloc = ntri_cnt;
-		for (i=0;i<3;i++)
-			{
-			status = mb_reallocd(verbose, __FILE__, __LINE__,ntri_cnt*sizeof(int),
-				 	(void **)&(data->iv[i]),error);
-			status = mb_reallocd(verbose, __FILE__, __LINE__,ntri_cnt*sizeof(int),
-				 	(void **)&(data->ct[i]),error);
-			status = mb_reallocd(verbose, __FILE__, __LINE__,ntri_cnt*sizeof(int),
-				 	(void **)&(data->cs[i]),error);
-			status = mb_reallocd(verbose, __FILE__, __LINE__,ntri_cnt*sizeof(int),
-				 	(void **)&(data->ed[i]),error);
-			status = mb_reallocd(verbose, __FILE__, __LINE__,ntri_cnt*sizeof(int),
-					(void **)&(data->flag[i]),error);
-			}
-		status = mb_reallocd(verbose, __FILE__, __LINE__,ntri_cnt*sizeof(double),
-					(void **)&(data->v1),error);
-		status = mb_reallocd(verbose, __FILE__, __LINE__,ntri_cnt*sizeof(double),
-		 			(void **)&(data->v2),error);
-		status = mb_reallocd(verbose, __FILE__, __LINE__,ntri_cnt*sizeof(double),
-		 			(void **)&(data->v3),error);
-		status = mb_reallocd(verbose, __FILE__, __LINE__,ntri_cnt*sizeof(int),
-		 			(void **)&(data->istack),error);
-		status = mb_reallocd(verbose, __FILE__, __LINE__,3*ntri_cnt*sizeof(int),
-		 			(void **)&(data->kv1),error);
-		status = mb_reallocd(verbose, __FILE__, __LINE__,3*ntri_cnt*sizeof(int),
-		 			(void **)&(data->kv2),error);
-		status = mb_reallocd(verbose, __FILE__, __LINE__,(4*ntri_cnt+1)*sizeof(double),
-				(void **)&(data->xsave),error);
-		status = mb_reallocd(verbose, __FILE__, __LINE__,(4*ntri_cnt+1)*sizeof(double),
-				(void **)&(data->ysave),error);
-		}
-
-	/* put good bathymetry data into x arrays */
-	data->npts = 0;
-	extreme_start = MB_NO;
-	for (i=0;i<data->npings;i++)
-	  {
-	  ping = &data->pings[i];
-
-	  /* find edges of ping */
-	  left = ping->beams_bath/2;
-	  right = left;
-	  for (j=0;j<ping->beams_bath;j++)
-		{
-		if (mb_beam_ok(ping->beamflag[j]) && j < left) left = j;
-		if (mb_beam_ok(ping->beamflag[j]) && j > right) right = j;
-		}
-
-	  /* deal with data */
-	  for (j=0;j<ping->beams_bath;j++)
-		{
-		if (extreme_start == MB_NO && mb_beam_ok(ping->beamflag[j]))
-			{
-			bathmin = ping->bath[j];
-			bathmax = ping->bath[j];
-			xmin = ping->bathlon[j];
-			xmax = xmin;
-			ymin = ping->bathlat[j];
-			ymax = ymin;
-			extreme_start = MB_YES;
-			}
-		if (mb_beam_ok(ping->beamflag[j]))
-			{
-			data->x[data->npts] = ping->bathlon[j];
-			data->y[data->npts] = ping->bathlat[j];
-			data->z[data->npts] = ping->bath[j];
-			if (j == right)
-				data->edge[data->npts] = 1;
-			else if (j == left)
-				data->edge[data->npts] = -1;
-			else
-				data->edge[data->npts] = 0;
-			data->pingid[data->npts] = i;
-			bathmin = MIN(bathmin, data->z[data->npts]);
-			bathmax = MAX(bathmax, data->z[data->npts]);
-			xmin = MIN(xmin, data->x[data->npts]);
-			xmax = MAX(xmax, data->x[data->npts]);
-			ymin = MIN(ymin, data->y[data->npts]);
-			ymax = MAX(ymax, data->y[data->npts]);
-			data->npts++;
-			}
-		}
-	  }
-
-	/* delete duplicate points */
-	for (i=0;i<data->npts;i++)
-		for (j=data->npts-1;j>i;j--)
-			{
-			if (data->x[i] == data->x[j]
-				&& data->y[i] == data->y[j])
-				{
-				data->z[i] = 0.5*(data->z[i] + data->z[j]);
-				for (jj=j;jj<data->npts-1;jj++)
-					{
-					data->x[jj] = data->x[jj+1];
-					data->y[jj] = data->y[jj+1];
-					data->z[jj] = data->z[jj+1];
-					data->edge[jj] = data->edge[jj+1];
-					data->pingid[jj] = data->pingid[jj+1];
-					}
-				data->npts--;
-				}
-			}
-
-	/* print debug statements */
-	if (verbose >= 4)
-		{
-		fprintf(stderr,"\ndbg4  Data points:\n");
-		fprintf(stderr,"dbg4       npts:             %d\n",data->npts);
-		}
-	if (verbose >= 5)
-		{
-		for (i=0;i<data->npts;i++)
-			fprintf(stderr,"dbg2       %4d %4d  %f %f %f\n",
-				i,data->pingid[i],
-				data->x[i],data->y[i],data->z[i]);
-		}
-
-	/* if no depth variation dont bother */
-	if ((bathmax - bathmin) < EPS) return(status);
-
-	/* get number of contour intervals */
-	if (data->nlevelset == MB_NO)
-		{
-		if (data->nlevel > 0)
-			{
-			mb_freed(verbose,__FILE__, __LINE__, (void **)&data->level_list,error);
-			mb_freed(verbose,__FILE__, __LINE__, (void **)&data->color_list,error);
-			mb_freed(verbose,__FILE__, __LINE__, (void **)&data->label_list,error);
-			mb_freed(verbose,__FILE__, __LINE__, (void **)&data->tick_list,error);
-			}
-		nci = bathmin/data->contour_int + 1;
-		ncf = bathmax/data->contour_int + 1;
-		data->nlevel = ncf - nci;
-		status = mb_mallocd(verbose,__FILE__,__LINE__,data->nlevel*sizeof(double),
-				(void **)&(data->level_list),error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,data->nlevel*sizeof(int),
-				(void **)&(data->color_list),error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,data->nlevel*sizeof(int),
-				(void **)&(data->label_list),error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,data->nlevel*sizeof(int),
-				(void **)&(data->tick_list),error);
-		if (*error != MB_ERROR_NO_ERROR) return(status);
-		for (i=0;i<data->nlevel;i++)
-			{
-			k = nci + i;
-			data->level_list[i] = k*data->contour_int;
-			data->color_list[i] =
-				(int)(data->level_list[i]/data->color_int)
-					%data->ncolor;
-			if (data->tick_int <= 0.0)
-				data->tick_list[i] = 0;
-
-			else
-				{
-				ratio = data->level_list[i] / data->tick_int;
-				if (fabs(ROUND(ratio) - ratio) < 0.005 * data->contour_int)
-					data->tick_list[i] = 1;
-				else
-					data->tick_list[i] = 0;
-				}
-			if (data->label_int <= 0.0)
-				data->label_list[i] = 0;
-			else
-				{
-				ratio = data->level_list[i] / data->label_int;
-				if (fabs(ROUND(ratio) - ratio) < 0.005 * data->contour_int)
-					data->label_list[i] = 1;
-				else
-					data->label_list[i] = 0;
-				}
-			}
-		}
-
-	/* print debug statements */
-	if (verbose >= 4)
-		{
-		fprintf(stderr,"\ndbg4  Data points:\n");
-		fprintf(stderr,"dbg4       nlevel:           %d\n",data->nlevel);
-		fprintf(stderr,"dbg4       i level color tick label:\n");
-		for (i=0;i<data->nlevel;i++)
-			fprintf(stderr,"dbg4       %d %f %d %d %d\n",
-				i,data->level_list[i],data->color_list[i],
-				data->tick_list[i],data->label_list[i]);
-		}
-
-	/* make sure that no depths are exact contour values */
-	eps = EPS*(bathmax - bathmin);
-	for (k=0;k<data->nlevel;k++)
-		{
-		for (i=0;i<data->npts;i++)
-			{
-			if (fabs(data->z[i] - data->level_list[k]) < eps)
-				data->z[i] = data->level_list[k] + eps;
-			}
-		}
-
-	/* get triangle network */
-	status = mb_delaun(verbose,data->npts,data->x,data->y,data->edge,
-			&data->ntri,data->iv[0],data->iv[1],data->iv[2],
-			data->ct[0],data->ct[1],data->ct[2],
-			data->cs[0],data->cs[1],data->cs[2],
-			data->v1,data->v2,data->v3,
-			data->istack,data->kv1,data->kv2,error);
-	if (verbose > 1)
-		fprintf(stderr,"\n");
-	if (verbose > 0)
-		fprintf(stderr,"Obtained %d triangles from %d points in %d pings...\n",
-		data->ntri,data->npts,data->npings);
-
-	/* figure out which triangle sides are on the swath edge */
-	for (itri=0;itri<data->ntri;itri++)
-	  {
-	  for (j=0;j<3;j++)
-		{
-		jj = j + 1;
-		if (jj > 2) jj = 0;
-		if (data->edge[data->iv[j][itri]] == -1
-			&& data->edge[data->iv[jj][itri]] == -1)
-			data->ed[j][itri] = -1;
-		else if (data->edge[data->iv[j][itri]] == 1
-			&& data->edge[data->iv[jj][itri]] == 1)
-			data->ed[j][itri] = 1;
-		else
-			data->ed[j][itri] = 0;
-		}
-	  }
-
-	/* plot the triangles if desired */
-	if (data->plot_triangles)
-	  {
-	  data->contour_newpen(0);
-	  for (itri=0;itri<data->ntri;itri++)
-		{
-		data->contour_plot(data->x[data->iv[0][itri]],
-			data->y[data->iv[0][itri]],IMOVE);
-		data->contour_plot(data->x[data->iv[1][itri]],
-			data->y[data->iv[1][itri]],IDRAW);
-		data->contour_plot(data->x[data->iv[2][itri]],
-			data->y[data->iv[2][itri]],IDRAW);
-		data->contour_plot(data->x[data->iv[0][itri]],
-			data->y[data->iv[0][itri]],ISTROKE);
-		}
-	  }
-
-	/* loop over all of the contour values */
-	data->nsave = 0;
-	data->nlabel = 0;
-	if (status == MB_SUCCESS && data->plot_contours == MB_YES)
-	for (ival=0;ival<data->nlevel;ival++)
-		{
-		value = data->level_list[ival];
-		data->contour_newpen(data->color_list[ival]);
-		tick = data->tick_list[ival];
-		label = data->label_list[ival];
-
-		/* print debug statements */
-		if (verbose >= 4)
-			{
-			fprintf(stderr,"\ndbg4  About to contour level in function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4       value:         %f\n",value);
-			fprintf(stderr,"dbg4       tick:          %d\n",tick);
-			fprintf(stderr,"dbg4       label:         %d\n",label);
-			}
-
-		/* flag all triangle sides crossed by the current contour */
-		for (itri=0;itri<data->ntri;itri++)
-			{
-			for (j=0;j<3;j++)
-				{
-				jj = j + 1;
-				if (jj == 3) jj = 0;
-				if ((data->z[data->iv[j][itri]] > value
-					&& data->z[data->iv[jj][itri]] < value)
-					|| (data->z[data->iv[jj][itri]] > value
-					&& data->z[data->iv[j][itri]] < value))
-					data->flag[j][itri] = 1;
-				else
-					data->flag[j][itri] = 0;
-				}
-			}
-
-		/* do the contouring */
-		data->nsave = 0;
-		while (get_start_tri(data,&itri,&iside1,&iside2,&closed))
-			{
-			/* if not closed remove flags */
-			data->flag[iside1][itri] = -1;
-			data->flag[iside2][itri] = -1;
-
-			/* get position of start of contour */
-			get_pos_tri(data,eps,itri,iside1,value,
-				&data->xsave[data->nsave],
-				&data->ysave[data->nsave]);
-			data->nsave++;
-			get_pos_tri(data,eps,itri,iside2,value,
-				&data->xsave[data->nsave],
-				&data->ysave[data->nsave]);
-			data->nsave++;
-			itristart = itri;
-			isidestart = iside1;
-			itriend = itri;
-			isideend = iside2;
-
-			/* set tick flag */
-			tick_last = MB_NO;
-
-			/* look for next segment */
-			while(get_next_tri(data,&itri,&iside1,&iside2,&closed,
-				&itristart,&isidestart))
-				{
-				/* get position */
-				get_pos_tri(data,eps,itri,iside2,value,&x,&y);
-
-				/* deal with tick as needed */
-				if (tick && tick_last == MB_NO)
-					{
-					if (data->z[data->iv[iside1][itri]] >
-						data->z[data->iv[iside2][itri]])
-						hand = -1;
-					else
-						hand = 1;
-					data->xsave[data->nsave] =
-					  0.5*(x + data->xsave[data->nsave-1]);
-					data->ysave[data->nsave] =
-					  0.5*(y + data->ysave[data->nsave-1]);
-					magdis = sqrt(pow((x -
-					  data->xsave[data->nsave-1]),2.0)
-					  + pow((y - data->ysave[data->nsave-1]),2.0));
-					data->xsave[data->nsave+1] =
-					  data->xsave[data->nsave]
-					  - hand*data->tick_len*
-					  (y - data->ysave[data->nsave-1])
-					  /magdis;
-					data->ysave[data->nsave+1] =
-					  data->ysave[data->nsave]
-					  + hand*data->tick_len*
-					  (x - data->xsave[data->nsave-1])
-					  /magdis;
-					data->xsave[data->nsave+2] =
-						data->xsave[data->nsave];
-					data->ysave[data->nsave+2] =
-						data->ysave[data->nsave];
-					data->xsave[data->nsave+3] = x;
-					data->ysave[data->nsave+3] = y;
-					data->flag[iside1][itri] = -1;
-					data->flag[iside2][itri] = -1;
-					data->nsave = data->nsave + 4;
-					tick_last = MB_YES;
-					}
-				else
-					{
-					data->xsave[data->nsave] = x;
-					data->ysave[data->nsave] = y;
-					data->flag[iside1][itri] = -1;
-					data->flag[iside2][itri] = -1;
-					data->nsave++;
-					tick_last = MB_NO;
-					}
-
-				/* set latest point */
-				itriend = itri;
-				isideend = iside2;
-				}
-
-			/* set label if needed */
-			if (label && !closed
-				&& data->ed[isidestart][itristart] != 0)
-				{
-				data->xlabel[data->nlabel] = data->xsave[0];
-				data->ylabel[data->nlabel] = data->ysave[0];
-				get_azimuth_tri(data,itristart,isidestart,
-					&data->angle[data->nlabel]);
-				if (data->ed[isidestart][itristart] == -1)
-					data->justify[data->nlabel] = 1;
-				else
-					data->justify[data->nlabel] = 0;
-				if (check_label(data,data->nlabel))
-					data->nlabel++;
-				}
-			if (label && !closed
-				&& data->ed[isideend][itriend] != 0)
-				{
-				data->xlabel[data->nlabel]
-					= data->xsave[data->nsave-1];
-				data->ylabel[data->nlabel]
-					= data->ysave[data->nsave-1];
-				get_azimuth_tri(data,itriend,isideend,
-					&data->angle[data->nlabel]);
-				if (data->ed[isideend][itriend] == -1)
-					data->justify[data->nlabel] = 1;
-				else
-					data->justify[data->nlabel] = 0;
-				if (check_label(data,data->nlabel))
-					data->nlabel++;
-				}
-
-			/* dump the contour */
-			dump_contour(data,value);
-			}
-
-		/* done with contouring this level */
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	return(status);
-}
-
-/*--------------------------------------------------------------------------*/
-/* 	function get_start_tri finds next contour starting point. */
-int get_start_tri(
-		struct swath *data,
-		int	*itri,
-		int	*iside1,
-		int	*iside2,
-		int	*closed)
-{
-	int	isave;
-	int	i, j, jj;
-
-	/* search triangles */
-	*closed = MB_NO;
-	for (i=0;i<data->ntri;i++)
-		for (j=0;j<3;j++)
-			{
-			if (data->flag[j][i] > 0)
-				{
-				/* find two flagged sides */
-				*itri = i;
-				*iside1 = j;
-				*iside2 = -1;
-				for (jj=0;jj<3;jj++)
-					if (jj != j && data->flag[jj][i] > 0)
-						*iside2 = jj;
-		if (*iside2 == -1)
-			{
-			fprintf(stderr,"no flagged side in get_start_tri???\n");
-			fprintf(stderr,"noflag: itri:%d flags: %d %d %d\n",
-				*itri,data->flag[0][*itri],
-				data->flag[1][*itri],data->flag[2][*itri]);
-			}
-
-				/* check if contour continues on both sides */
-				if (data->ct[*iside1][i] > -1
-					&& data->ct[*iside2][i] > -1)
-					*closed = MB_YES;
-
-				/* else make sure contour starts at dead end */
-				else if (data->ct[*iside1][i] > -1)
-					{
-					isave = *iside1;
-					*iside1 = *iside2;
-					*iside2 = isave;
-					*closed = MB_NO;
-					}
-				else
-					*closed = MB_NO;
-				return(MB_YES);
-				}
-			}
-
-	/* nothing found */
-	return(MB_NO);
-}
-/*--------------------------------------------------------------------------*/
-/* 	function get_next_tri finds next contour component if it exists */
-int get_next_tri(
-		struct swath *data,
-		int	*itri,
-		int	*iside1,
-		int	*iside2,
-		int	*closed,
-		int	*itristart,
-		int	*isidestart)
-{
-	double	xs, ys;
-	int	itrisave, isidesave;
-	int	i, j;
-
-	/* check if contour ends where it began */
-	if (*closed && data->ct[*iside2][*itri] == *itristart
-		&& data->cs[*iside2][*itri] == *isidestart)
-		return(MB_NO);
-
-	/* check if current triangle side connects to another */
-	else if (data->ct[*iside2][*itri] > -1)
-		{
-		*iside1 = data->cs[*iside2][*itri];
-		*itri = data->ct[*iside2][*itri];
-		*iside2 = -1;
-		for (j=0;j<3;j++)
-			if (j != *iside1 && data->flag[j][*itri] != 0)
-				*iside2 = j;
-		if (*iside2 == -1)
-			{
-			fprintf(stderr,"no flagged side in get_next_tri???\n");
-			fprintf(stderr,"noflag: itri:%d flags: %d %d %d\n",
-				*itri,data->flag[0][*itri],
-				data->flag[1][*itri],data->flag[2][*itri]);
-			return(MB_NO);
-			}
-		return(MB_YES);
-		}
-
-	/* else if contour ends but closed set true then
-		turn contour around and continue in other direction */
-	else if (*closed)
-		{
-		for (i=0;i<data->nsave/2;i++)
-			{
-			xs = data->xsave[i];
-			ys = data->ysave[i];
-			data->xsave[i] = data->xsave[data->nsave-i-1];
-			data->ysave[i] = data->ysave[data->nsave-i-1];
-			data->xsave[data->nsave-i-1] = xs;
-			data->ysave[data->nsave-i-1] = ys;
-			}
-		*closed = MB_NO;
-		data->nsave--;
-		itrisave = *itristart;
-		isidesave = *isidestart;
-		*itristart = *itri;
-		*isidestart = *iside2;
-		*itri = itrisave;
-		*iside2 = isidesave;
-		*iside1 = -1;
-		for (j=0;j<3;j++)
-			if (j != *iside2 && data->flag[j][*itri] != 0)
-				*iside1 = j;
-
-		/* if next side not found end contour */
-		if (*iside1 == -1)
-			return(MB_NO);
-
-		/* else keep going */
-		return(MB_YES);
-		}
-
-	/* else contour ends and is not closed */
-	else
-		return(MB_NO);
-}
-/*--------------------------------------------------------------------------*/
-/* 	function get_pos_tri finds position of contour crossing point */
-int get_pos_tri(
-		struct swath *data,
-		double	eps,
-		int	itri,
-		int	iside,
-		double	value,
-		double	*x,
-		double	*y)
-{
-	double	factor;
-	int	v1, v2, pt1, pt2;
-
-	v1 = iside;
-	v2 = iside + 1;
-	if (v2 == 3) v2 = 0;
-	pt1 = data->iv[v1][itri];
-	pt2 = data->iv[v2][itri];
-
-	if (fabs(data->z[pt2] - data->z[pt1]) > eps)
-		factor = (value - data->z[pt1])/(data->z[pt2] - data->z[pt1]);
-	else
-		factor = 0.5;
-	*x = data->x[pt1] + factor*(data->x[pt2] - data->x[pt1]);
-	*y = data->y[pt1] + factor*(data->y[pt2] - data->y[pt1]);
-
-	return(MB_YES);
-
-}
-/*--------------------------------------------------------------------------*/
-/* 	function get_azimuth_tri gets azimuth across track for a label */
-int get_azimuth_tri(
-		struct swath *data,
-		int	itri,
-		int	iside,
-		double	*angle)
-{
-	*angle = -data->pings[data->pingid[data->iv[iside][itri]]].heading;
-	if (*angle > 180.0)
-		*angle = *angle - 360.0;
-	if (*angle < -180.0)
-		*angle = *angle + 360.0;
-
-	return(MB_YES);
-}
-/*--------------------------------------------------------------------------*/
-/* 	function check_label checks if new label will overwrite any recent
- *	labels. */
-int check_label(struct swath *data,
-		int	nlab)
-{
-#define	MAXHIS 30
-	static double xlabel_his[MAXHIS], ylabel_his[MAXHIS];
-	static int nlabel_his = 0;
-	double	rad_label_his;
-	int	good, ilab, i;
-	double	dx, dy, rr;
-
-	good = 1;
-	ilab = 0;
-	rad_label_his = data->label_spacing;
-	while (good && ilab < nlabel_his)
-		{
-		dx = xlabel_his[ilab] - data->xlabel[nlab];
-		dy = ylabel_his[ilab] - data->ylabel[nlab];
-		rr = sqrt(dx*dx + dy*dy);
-		if (rr < rad_label_his) good = 0;
-		ilab++;
-		}
-	ilab--;
-	if (good)
-		{
-		nlabel_his++;
-		if (nlabel_his >= MAXHIS)
-			nlabel_his = MAXHIS - 1;
-		for (i=nlabel_his;i>0;i--)
-			{
-			xlabel_his[i] = xlabel_his[i-1];
-			ylabel_his[i] = ylabel_his[i-1];
-			}
-		xlabel_his[0] = data->xlabel[nlab];
-		ylabel_his[0] = data->ylabel[nlab];
-		}
-	return(good);
-}
-/*--------------------------------------------------------------------------*/
-/* 	function dump_contour dumps the contour stored in xsave and ysave
- *	to the plotting routines */
-int dump_contour(struct swath *data, double value)
-{
-	int	i;
-	char	label[25];
-	int	len;
-	double	x, y, dx, dy, s[4];
-	double	mtodeglon, mtodeglat;
-
-	/* plot the contours */
-	if (data->nsave < 2) return(MB_NO);
-	data->contour_plot(data->xsave[0],data->ysave[0],IMOVE);
-	for (i=1;i<data->nsave-1;i++)
-		data->contour_plot(data->xsave[i],data->ysave[i],IDRAW);
-	data->contour_plot(data->xsave[data->nsave-1],data->ysave[data->nsave-1],ISTROKE);
-	data->nsave = 0;
-
-	/* plot the labels */
-	sprintf(label,"  %d",(int)value);
-	len = strlen(label);
-	for (i=0;i<data->nlabel;i++)
-		{
-		if (data->justify[i] == 1)
-			{
-			mb_coor_scale(0,data->ylabel[i],&mtodeglon,&mtodeglat);
-			data->contour_justify_string(data->label_hgt,label,s);
-			dx = 1.5*s[2]*cos(DTR*data->angle[i]);
-			dy = 1.5*mtodeglat/mtodeglon*s[2]
-				*sin(DTR*data->angle[i]);
-			x = data->xlabel[i] - dx;
-			y = data->ylabel[i] - dy;
-			data->contour_plot_string(x,y,data->label_hgt,data->angle[i],label);
-			}
-		else
-			{
-			data->contour_plot_string(data->xlabel[i],data->ylabel[i],
-				data->label_hgt,data->angle[i],label);
-			}
-		}
-	data->nlabel = 0;
-
-
-	return(MB_YES);
-}
-/*--------------------------------------------------------------------------*/
-/* 	function mb_ocontour contours multibeam data. */
-int mb_ocontour(int verbose, struct swath *data, int *error)
-{
-	char	*function_name = "mb_ocontour";
-	int	status = MB_SUCCESS;
-	struct ping *ping;
-	int	npt_cnt;
-	int	extreme_start;
-	int	beams_bath_use;
-	int	left, right;
-	char	*beamflag1, *beamflag2;
-	double	*bath1, *bath2;
-	double	bathmin, bathmax;
-	int	ibeg, jbeg, kbeg, dbeg;
-	int	ni, nj, nk, nd;
-	int	nci, ncf;
-	double	eps;
-	int	ival;
-	double	value;
-	int	tick, label;
-	int	closed;
-	double	x, y;
-	double	magdis;
-	double	ratio;
-	int	hand;
-	int	tick_last;
-	int	i, j, k, d, jj;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:                 %d\n",verbose);
-		fprintf(stderr,"dbg2       data:                    %p\n",data);
-		fprintf(stderr,"dbg2       data->contour_algorithm: %d\n",data->contour_algorithm);
-		fprintf(stderr,"dbg2       data->plot_contours:     %d\n",data->plot_contours);
-		fprintf(stderr,"dbg2       data->plot_triangles:    %d\n",data->plot_triangles);
-		fprintf(stderr,"dbg2       data->plot_track:        %d\n",data->plot_track);
-		fprintf(stderr,"dbg2       data->plot_name:         %d\n",data->plot_name);
-		fprintf(stderr,"dbg2       data->contour_int:       %f\n",data->contour_int);
-		fprintf(stderr,"dbg2       data->color_int:         %f\n",data->color_int);
-		fprintf(stderr,"dbg2       data->tick_int:          %f\n",data->tick_int);
-		fprintf(stderr,"dbg2       data->label_int:         %f\n",data->label_int);
-		fprintf(stderr,"dbg2       data->tick_len:          %f\n",data->tick_len);
-		fprintf(stderr,"dbg2       data->label_hgt:         %f\n",data->label_hgt);
-		fprintf(stderr,"dbg2       data->label_spacing:     %f\n",data->label_spacing);
-		fprintf(stderr,"dbg2       data->ncolor:            %d\n",data->ncolor);
-		fprintf(stderr,"dbg2       data->nlevel:            %d\n",data->nlevel);
-		fprintf(stderr,"dbg2       data->nlevelset:         %d\n",data->nlevelset);
-		if (data->nlevelset == MB_YES)
-		for (i=0;i<data->nlevel;i++)
-			{
-			fprintf(stderr,"dbg2          level[%3d]:  %f %d %d %d\n",
-				i,data->level_list[i],data->label_list[i],data->tick_list[i],data->color_list[i]);
-			}
-		fprintf(stderr,"dbg2       data->npings:     %d\n",data->npings);
-		fprintf(stderr,"dbg2       data->npings_max: %d\n",data->npings_max);
-		fprintf(stderr,"dbg2       data->beams_bath: %d\n",data->beams_bath);
-		for (i=0;i<data->npings;i++)
-			{
-			fprintf(stderr,"dbg2          ping[%4d]: %4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d:%6.6d %f %f %f %f %d\n",
-				i,data->pings[i].time_i[0],data->pings[i].time_i[1],data->pings[i].time_i[2],
-				data->pings[i].time_i[3],data->pings[i].time_i[4],data->pings[i].time_i[5],data->pings[i].time_i[6],
-				data->pings[i].time_d,data->pings[i].navlon,data->pings[i].navlat,data->pings[i].heading,
-				data->pings[i].beams_bath);
-			for (j=0;j<data->pings[i].beams_bath;j++)
-				{
-				if (mb_beam_ok(data->pings[i].beamflag[j]))
-				fprintf(stderr,"dbg2          beam[%4d:%3d]:  %2d %f %f %f\n",
-					i,j,data->pings[i].beamflag[j],data->pings[i].bath[j],
-					data->pings[i].bathlon[j],data->pings[i].bathlat[j]);
-				}
-			}
-		}
-
-	/* count number of points and verify that enough memory is allocated */
-	npt_cnt = 0;
-	for (i=0;i<data->npings;i++)
-		{
-		ping = &data->pings[i];
-		for (j=0;j<ping->beams_bath;j++)
-			{
-			if (mb_beam_ok(ping->beamflag[j]))
-				npt_cnt++;
-			}
-		}
-	if (npt_cnt > data->npts_alloc)
-		{
-		data->npts_alloc = npt_cnt;
-		status = mb_reallocd(verbose, __FILE__, __LINE__,data->npts_alloc*sizeof(double),
-				(void **)&(data->xsave),error);
-		status = mb_reallocd(verbose, __FILE__, __LINE__,data->npts_alloc*sizeof(double),
-				(void **)&(data->ysave),error);
-		status = mb_reallocd(verbose, __FILE__, __LINE__,data->npts_alloc*sizeof(int),
-				(void **)&(data->isave),error);
-		status = mb_reallocd(verbose, __FILE__, __LINE__,data->npts_alloc*sizeof(int),
-				(void **)&(data->jsave),error);
-		}
-
-	/* zero flags */
-	for (i=0;i<data->npings;i++)
-		{
-		ping = &data->pings[i];
-		for (j=0;j<ping->beams_bath;j++)
-			{
-			ping->bflag[0][j] = 0;
-			ping->bflag[1][j] = 0;
-			}
-		}
-
-	/* get min max of bathymetry */
-	extreme_start = MB_NO;
-	for (i=0;i<data->npings;i++)
-	  {
-	  ping = &data->pings[i];
-	  for (j=0;j<ping->beams_bath;j++)
-		{
-		if (extreme_start == MB_NO && mb_beam_ok(ping->beamflag[j]))
-			{
-			bathmin = ping->bath[j];
-			bathmax = ping->bath[j];
-			extreme_start = MB_YES;
-			}
-		if (mb_beam_ok(ping->beamflag[j]))
-			{
-			bathmin = MIN(bathmin, ping->bath[j]);
-			bathmax = MAX(bathmax, ping->bath[j]);
-			}
-		}
-	  }
-
-	/* if no depth variation dont bother */
-	if ((bathmax - bathmin) < EPS) return(status);
-
-	/* get number of contour intervals */
-	if (data->nlevelset == MB_NO)
-		{
-		if (data->nlevel > 0)
-			{
-			mb_freed(verbose,__FILE__, __LINE__, (void **)&data->level_list,error);
-			mb_freed(verbose,__FILE__, __LINE__, (void **)&data->color_list,error);
-			mb_freed(verbose,__FILE__, __LINE__, (void **)&data->label_list,error);
-			mb_freed(verbose,__FILE__, __LINE__, (void **)&data->tick_list,error);
-			}
-		nci = bathmin/data->contour_int + 1;
-		ncf = bathmax/data->contour_int + 1;
-		data->nlevel = ncf - nci;
-		status = mb_mallocd(verbose,__FILE__,__LINE__,data->nlevel*sizeof(double),
-				(void **)&(data->level_list),error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,data->nlevel*sizeof(int),
-				(void **)&(data->color_list),error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,data->nlevel*sizeof(int),
-				(void **)&(data->label_list),error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,data->nlevel*sizeof(int),
-				(void **)&(data->tick_list),error);
-		if (*error != MB_ERROR_NO_ERROR) return(status);
-		for (i=0;i<data->nlevel;i++)
-			{
-			k = nci + i;
-			data->level_list[i] = k*data->contour_int;
-			data->color_list[i] =
-				(int)(data->level_list[i]/data->color_int)
-					%data->ncolor;
-			if (data->tick_int <= 0.0)
-				data->tick_list[i] = 0;
-			else
-				{
-				ratio = data->level_list[i] / data->tick_int;
-				if (fabs(ROUND(ratio) - ratio) < 0.005 * data->contour_int)
-					data->tick_list[i] = 1;
-				else
-					data->tick_list[i] = 0;
-				}
-			if (data->label_int <= 0.0)
-				data->label_list[i] = 0;
-			else
-				{
-				ratio = data->level_list[i] / data->label_int;
-				if (fabs(ROUND(ratio) - ratio) < 0.005 * data->contour_int)
-					data->label_list[i] = 1;
-				else
-					data->label_list[i] = 0;
-				}
-			}
-		}
-
-	/* print debug statements */
-	if (verbose >= 4)
-		{
-		fprintf(stderr,"\ndbg4  Data points:\n");
-		fprintf(stderr,"dbg4       nlevel:           %d\n",data->nlevel);
-		fprintf(stderr,"dbg4       i level color tick label:\n");
-		for (i=0;i<data->nlevel;i++)
-			fprintf(stderr,"dbg4       %d %f %d %d %d\n",
-				i,data->level_list[i],data->color_list[i],
-				data->tick_list[i],data->label_list[i]);
-		}
-
-	/* make sure that no depths are exact contour values */
-	eps = EPS*(bathmax - bathmin);
-	for (k=0;k<data->nlevel;k++)
-		{
-		for (i=0;i<data->npts;i++)
-			{
-			if (fabs(data->z[i] - data->level_list[k]) < eps)
-				data->z[i] = data->level_list[k] + eps;
-			}
-		}
-
-	/* loop over all of the contour values */
-	data->nsave = 0;
-	data->nlabel = 0;
-	if (status == MB_SUCCESS && data->plot_contours == MB_YES)
-	for (ival=0;ival<data->nlevel;ival++)
-		{
-		value = data->level_list[ival];
-		data->contour_newpen(data->color_list[ival]);
-		tick = data->tick_list[ival];
-		label = data->label_list[ival];
-
-		/* print debug statements */
-		if (verbose >= 4)
-			{
-			fprintf(stderr,"\ndbg4  About to contour level in function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4       value:         %f\n",value);
-			fprintf(stderr,"dbg4       tick:          %d\n",tick);
-			fprintf(stderr,"dbg4       label:         %d\n",label);
-			}
-
-		/* flag all grid sides crossed by the current contour */
-		for (i=0;i<data->npings;i++)
-			{
-			beamflag1 = data->pings[i].beamflag;
-			bath1 = data->pings[i].bath;
-			beams_bath_use = data->pings[i].beams_bath;
-			if (i<data->npings-1)
-			    {
-			    beamflag2 = data->pings[i+1].beamflag;
-			    bath2 = data->pings[i+1].bath;
-			    beams_bath_use = MIN(beams_bath_use, data->pings[i+1].beams_bath);
-			    }
-			for (j=0;j<beams_bath_use;j++)
-				{
-				/* check for across track intersection */
-				if (j < beams_bath_use-1)
-					if ((mb_beam_ok(beamflag1[j]) && mb_beam_ok(beamflag1[j+1]))
-					&& ((bath1[j]<value && bath1[j+1]>value)
-					|| (bath1[j]>value && bath1[j+1]<value)))
-						data->pings[i].bflag[0][j] = 1;
-
-				/* check for along track intersection */
-				if (i < data->npings-1)
-					if ((mb_beam_ok(beamflag1[j]) && mb_beam_ok(beamflag2[j]))
-					&& ((bath1[j]<value && bath2[j]>value)
-					|| (bath1[j]>value && bath2[j]<value)))
-						data->pings[i].bflag[1][j] = 1;
-				}
-			}
-
-		/* loop until all flagged points have been unflagged */
-		while (get_start_old(data,&k, &i, &j, &d, &closed))
-			{
-			/* if not closed remove from flag list */
-			if (closed == 0) data->pings[i].bflag[k][j] = 0;
-
-			/* get position and handedness */
-			get_pos_old(data,eps,&x,&y,k,i,j,value);
-			data->xsave[0] = x;
-			data->ysave[0] = y;
-			data->isave[0] = i;
-			data->jsave[0] = j;
-			data->nsave = 1;
-			data->nlabel = 0;
-			ibeg = i;
-			jbeg = j;
-			kbeg = k;
-			dbeg = d;
-
-			/* set tick flag */
-			tick_last = MB_NO;
-
-			/* look for next component */
-			while (get_next_old(data,&nk,&ni,&nj,&nd,k,i,j,d,
-				kbeg,ibeg,jbeg,dbeg,&closed))
-				{
-				/* get position */
-				get_pos_old(data,eps,&x,&y,nk,ni,nj,value);
-				get_hand_old(data,&hand,k,i,j,d);
-				if (tick && tick_last == MB_NO)
-					{
-					data->xsave[data->nsave] =
-						0.5*(x +
-						data->xsave[data->nsave-1]);
-					data->ysave[data->nsave] =
-						0.5*(y +
-						data->ysave[data->nsave-1]);
-					magdis = sqrt(pow((x
-						- data->xsave[data->nsave-1]),2.0)
-						+ pow((y
-						- data->ysave[data->nsave-1]),2.0));
-					if (magdis > 0.0)
-					    {
-					    data->xsave[data->nsave+1] =
-						    data->xsave[data->nsave]
-						    - hand*data->tick_len*(y
-						    - data->ysave[data->nsave-1])/magdis;
-					    data->ysave[data->nsave+1] =
-						    data->ysave[data->nsave]
-						    + hand*data->tick_len*(x
-						    - data->xsave[data->nsave-1])/magdis;
-					    }
-					else
-					    {
-					    data->xsave[data->nsave+1] =
-						    data->xsave[data->nsave];
-					    data->ysave[data->nsave+1] =
-						    data->ysave[data->nsave];
-					    }
-					data->xsave[data->nsave+2] =
-						data->xsave[data->nsave];
-					data->ysave[data->nsave+2] =
-						data->ysave[data->nsave];
-					data->xsave[data->nsave+3] = x;
-					data->ysave[data->nsave+3] = y;
-					data->isave[data->nsave] = ni;
-					data->jsave[data->nsave] = nj;
-					data->isave[data->nsave+1] = ni;
-					data->jsave[data->nsave+1] = nj;
-					data->isave[data->nsave+2] = ni;
-					data->jsave[data->nsave+2] = nj;
-					data->isave[data->nsave+3] = ni;
-					data->jsave[data->nsave+3] = nj;
-					data->nsave = data->nsave + 4;
-					tick_last = MB_YES;
-					}
-				else
-					{
-					data->xsave[data->nsave] = x;
-					data->ysave[data->nsave] = y;
-					data->isave[data->nsave] = ni;
-					data->jsave[data->nsave] = nj;
-					data->nsave++;
-					tick_last = MB_NO;
-					}
-				i = ni;
-				j = nj;
-				k = nk;
-				d = nd;
-				data->pings[i].bflag[k][j] = 0;
-				}
-
-			/* clean up if not a full contour */
-			if (data->nsave < 2)
-				{
-				data->nsave = 0;
-				data->pings[i].bflag[k][j] = 0;
-				}
-
-			/* set labels if needed */
-			if (data->nsave > 0 && label && !closed)
-				{
-				/* check beginning of contour */
-				left = data->pings[data->isave[0]].beams_bath/2;
-				right = data->pings[data->isave[0]].beams_bath/2;
-				for (jj=0;jj<data->beams_bath;jj++)
-					{
-					if (mb_beam_ok(data->pings[data->isave[0]].beamflag[jj]))
-						{
-						if (jj < left) left = jj;
-						if (jj > right) right = jj;
-						}
-					}
-				if (data->jsave[0] == left
-					|| data->jsave[0] == left+1)
-					{
-					data->xlabel[data->nlabel] = data->xsave[0];
-					data->ylabel[data->nlabel] = data->ysave[0];
-					get_azimuth_old(data,data->isave[0],
-						&data->angle[data->nlabel]);
-					data->justify[data->nlabel] = 1;
-					if (check_label(data,data->nlabel))
-						data->nlabel++;
-					}
-				else if (data->jsave[0] == right
-					|| data->jsave[0] == right-1)
-					{
-					data->xlabel[data->nlabel] = data->xsave[0];
-					data->ylabel[data->nlabel] = data->ysave[0];
-					get_azimuth_old(data,data->isave[0],
-						&data->angle[data->nlabel]);
-					data->justify[data->nlabel] = 0;
-					if (check_label(data,data->nlabel))
-						data->nlabel++;
-					}
-
-				/* check end of contour */
-				left = data->pings[data->isave[data->nsave-1]].beams_bath/2;
-				right = data->pings[data->isave[data->nsave-1]].beams_bath/2;
-				for (jj=0;jj<data->pings[data->isave[data->nsave-1]].beams_bath;jj++)
-					{
-					if (mb_beam_ok(data->pings[data->isave[data->nsave-1]].beamflag[jj]))
-						{
-						if (jj < left) left = jj;
-						if (jj > right) right = jj;
-						}
-					}
-				if ((data->nlabel == 0 || data->nsave > 10)
-					&& (data->jsave[data->nsave-1] == left
-						|| data->jsave[data->nsave-1]
-							== left+1))
-					{
-					data->xlabel[data->nlabel]
-						= data->xsave[data->nsave-1];
-					data->ylabel[data->nlabel]
-						= data->ysave[data->nsave-1];
-					get_azimuth_old(data,data->isave[data->nsave-1],
-						&data->angle[data->nlabel]);
-					data->justify[data->nlabel] = 1;
-					if (check_label(data,data->nlabel))
-						data->nlabel++;
-					}
-				else if ((data->nlabel == 0 || data->nsave > 10)
-					&& (data->jsave[data->nsave-1] == right
-						|| data->jsave[data->nsave-1]
-							== right-1))
-					{
-					data->xlabel[data->nlabel]
-						= data->xsave[data->nsave-1];
-					data->ylabel[data->nlabel]
-						= data->ysave[data->nsave-1];
-					get_azimuth_old(data,
-						data->isave[data->nsave-1],
-						&data->angle[data->nlabel]);
-					data->justify[data->nlabel] = 0;
-					if (check_label(data,data->nlabel))
-						data->nlabel++;
-					}
-				}
-
-			/* dump the contour */
-			dump_contour(data,value);
-			}
-
-		/* done with contouring this level */
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	return(MB_SUCCESS);
-}
-/*--------------------------------------------------------------------------*/
-/* 	function get_start_old finds next contour starting point.
- *	the borders are searched first and then the interior */
-int get_start_old(struct swath *data,
-		int *k, int *i, int *j, int *d, int *closed)
-{
-	int	ii, jj;
-
-	/* search edges */
-	*closed = 0;
-
-	/* search bottom (i = 0) */
-	for (jj=0;jj<data->pings[0].beams_bath-1;jj++)
-		if (data->pings[0].bflag[0][jj])
-			{
-			*k = 0;
-			*i = 0;
-			*j = jj;
-			*d = 0;
-			return(1);
-			}
-
-	/* search top (i = npings-1) */
-	for (jj=0;jj<data->pings[data->npings-1].beams_bath-1;jj++)
-		if (data->pings[data->npings-1].bflag[0][jj])
-			{
-			*k = 0;
-			*i = data->npings - 1;
-			*j = jj;
-			*d = 1;
-			return(1);
-			}
-
-	/* search left (j = 0) */
-	for (ii=0;ii<data->npings-1;ii++)
-		if (data->pings[ii].bflag[1][0])
-			{
-			*k = 1;
-			*i = ii;
-			*j = 0;
-			*d = 0;
-			return(1);
-			}
-
-	/* search right (j = beams_bath-1) */
-	for (ii=0;ii<data->npings-1;ii++)
-		if (data->pings[ii].bflag[1][data->pings[ii].beams_bath-1])
-			{
-			*k = 1;
-			*i = ii;
-			*j = data->pings[ii].beams_bath - 1;
-			*d = 1;
-			return(1);
-			}
-
-	/* search interior */
-	*closed = 1;
-	for (ii=0;ii<data->npings-1;ii++)
-		for (jj=0;jj<data->pings[ii].beams_bath-1;jj++)
-			{
-			if (data->pings[ii].bflag[0][jj])
-				{
-				*k = 0;
-				*i = ii;
-				*j = jj;
-				*d = 0;
-				return(1);
-				}
-			if (data->pings[ii].bflag[1][jj])
-				{
-				*k = 1;
-				*i = ii;
-				*j = jj;
-				*d = 0;
-				return(1);
-				}
-			}
-
-	/* nothing found */
-	return(0);
-}
-/*--------------------------------------------------------------------------*/
-/* 	function get_next_old finds next contour component if it exists */
-int get_next_old(struct swath *data, int *nk, int *ni, int *nj, int *nd,
-		int k, int i, int j, int d,
-		int kbeg, int ibeg, int jbeg, int dbeg, int *closed)
-{
-	static int ioff[3][2][2] =
-		{
-		{{0,-1},{1,0}},
-		{{1,-1},{0,0}},
-		{{0,-1},{0,1}}
-		};
-	static int joff[3][2][2] =
-		{
-		{{0,1},{0,-1}},
-		{{0,0},{1,-1}},
-		{{1,0},{0,-1}}
-		};
-	static int koff[3][2][2] =
-		{
-		{{1,1},{0,0}},
-		{{0,0},{1,1}},
-		{{1,1},{0,0}}
-		};
-	static int doff[3][2][2] =
-		{
-		{{1,0},{0,1}},
-		{{0,1},{0,1}},
-		{{0,1},{1,0}}
-		};
-	int	ii, edge;
-	int	kt[3], it[3], jt[3], dt[3], ifedge[3];
-	double	xs, ys;
-
-	/* there are three possible edges for the contour to go to */
-	/* (left = 0, across = 1, right = 2) */
-	/* find out which edges have unflagged crossing points */
-	for (edge=0;edge<3;edge++)
-		{
-		kt[edge] = koff[edge][k][d];
-		it[edge] = i + ioff[edge][k][d];
-		jt[edge] = j + joff[edge][k][d];
-		dt[edge] = doff[edge][k][d];
-		if (it[edge] < 0 || it[edge] >= data->npings
-			|| jt[edge] < 0 || jt[edge] >= data->pings[i].beams_bath)
-			ifedge[edge] = 0;
-		else
-			ifedge[edge] =
-				data->pings[it[edge]].bflag[kt[edge]][jt[edge]];
-		}
-
-	/* if the across edge exists, use it */
-	if (ifedge[1])
-		{
-		*nk = kt[1];
-		*ni = it[1];
-		*nj = jt[1];
-		*nd = dt[1];
-		return(1);
-		}
-
-	/* else if edge 0 exists, use it */
-	else if (ifedge[0])
-		{
-		*nk = kt[0];
-		*ni = it[0];
-		*nj = jt[0];
-		*nd = dt[0];
-		return(1);
-		}
-
-	/* else if edge 2 exists, use it */
-	else if (ifedge[2])
-		{
-		*nk = kt[2];
-		*ni = it[2];
-		*nj = jt[2];
-		*nd = dt[2];
-		return(1);
-		}
-
-	/* if no edge is found and contour is closed and closes then */
-	/* contour ends */
-	else if (*closed && kbeg == k && ibeg == i && jbeg == j)
-		return(0);
-
-	/* if no edge is found and contour is closed but doesnt close then */
-	/* reverse order of points and start over */
-	else if (*closed)
-		{
-		for (ii=0;ii<data->nsave/2;ii++)
-			{
-			xs = data->xsave[ii];
-			ys = data->ysave[ii];
-			data->xsave[ii] = data->xsave[data->nsave-ii-1];
-			data->ysave[ii] = data->ysave[data->nsave-ii-1];
-			data->xsave[data->nsave-ii-1] = xs;
-			data->ysave[data->nsave-ii-1] = ys;
-			}
-		*closed = 0;
-		*nk = kbeg;
-		*ni = ibeg;
-		*nj = jbeg;
-		if (dbeg) *nd = 0;
-		else *nd = 1;
-		data->nsave--;
-		return(1);
-		}
-
-	/* else if no edge is found and contour is not closed */
-	/* then contour ends */
-	else
-		return(0);
-}
-/*--------------------------------------------------------------------------*/
-/* 	function get_pos_old finds position of contour crossing point */
-int get_pos_old(struct swath *data, double eps, double *x, double *y,
-		int k, int i, int j, double value)
-{
-	double	x1, y1, x2, y2, v1, v2, factor;
-
-	/* get grid positions and values */
-	x1 = data->pings[i].bathlon[j];
-	y1 = data->pings[i].bathlat[j];
-	v1 = data->pings[i].bath[j];
-	if (k == 0)
-		{
-		x2 = data->pings[i].bathlon[j+1];
-		y2 = data->pings[i].bathlat[j+1];
-		v2 = data->pings[i].bath[j+1];
-		}
-	else
-		{
-		x2 = data->pings[i+1].bathlon[j];
-		y2 = data->pings[i+1].bathlat[j];
-		v2 = data->pings[i+1].bath[j];
-		}
-
-	/* interpolate the position */
-	if (fabs(v2 - v1) > eps)
-		factor = (value - v1)/(v2 - v1);
-	else
-		factor = 0.5;
-	if (factor < 0.0) factor = 0.0;
-	if (factor > 1.0) factor = 1.0;
-	*x = factor*(x2 - x1) + x1;
-	*y = factor*(y2 - y1) + y1;
-
-	return(MB_YES);
-}
-/*--------------------------------------------------------------------------*/
-/* 	function get_hand_old finds handedness of contour */
-int get_hand_old(struct swath *data, int *hand,
-		int k, int i, int j, int d)
-{
-	if (k == 0 && d == 0)
-		{
-		if (data->pings[i].bath[j] > data->pings[i].bath[j+1])
-			*hand = 1;
-		else
-			*hand = -1;
-		}
-	else if (k == 0 && d == 1)
-		{
-		if (data->pings[i].bath[j] > data->pings[i].bath[j+1])
-			*hand = -1;
-		else
-			*hand = 1;
-		}
-	else if (k == 1 && d == 0)
-		{
-		if (data->pings[i].bath[j] > data->pings[i+1].bath[j])
-			*hand = -1;
-		else
-			*hand = 1;
-		}
-	else if (k == 1 && d == 1)
-		{
-		if (data->pings[i].bath[j] > data->pings[i+1].bath[j])
-			*hand = 1;
-		else
-			*hand = -1;
-		}
-	return(MB_YES);
-}
-
-/*--------------------------------------------------------------------------*/
-/* 	function get_azimuth_old gets azimuth across shiptrack at ping iping */
-int get_azimuth_old(struct swath *data, int iping, double *angle)
-{
-
-	*angle = -data->pings[iping].heading;
-	if (*angle > 180.0)
-		*angle = *angle - 360.0;
-	if (*angle < -180.0)
-		*angle = *angle + 360.0;
-
-	return(MB_YES);
-}
-/*--------------------------------------------------------------------------*/
diff --git a/src/mbaux/mb_xgraphics.c b/src/mbaux/mb_xgraphics.c
deleted file mode 100644
index 3e1ead1..0000000
--- a/src/mbaux/mb_xgraphics.c
+++ /dev/null
@@ -1,393 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	xgraphics.c	8/3/94
- *    $Id: mb_xgraphics.c 2252 2015-07-01 19:35:37Z caress $
- *
- *    Copyright (c) 1993-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * The xgraphics library supports simple 8-bit X Window graphics for
- * interactive graphical tools.  This code is based on an earlier
- * library which explicitly controlled the colormap to allow
- * double overlays.  This implementation uses only colors defined
- * by the calling program and allows line drawing in two styles:
- * solid and dashed.
- *
- * Author:	D. W. Caress
- * Date:	August 3, 1994
- *
- *
- */
-/*--------------------------------------------------------------------*/
-
-/* standard includes */
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <X11/Xlib.h>
-#include <X11/Xutil.h>
-
-/* mbaux includes */
-#include "mb_xgraphics.h"
-
-/* id variable */
-static char svn_id[] = "$Id: mb_xgraphics.c 2252 2015-07-01 19:35:37Z caress $";
-
-/**********************************************************************
- *	XG_INIT
- *	- initializes plotting variables, the colortable, and the GC
- **********************************************************************/
-void xg_init(Display *display, Window can_xid,
-		int *can_bounds, char *fontname, void **xgid)
-{
-	/* local variables */
-	struct xg_graphic *graphic;
-	XGCValues gc_val;
-	int	i;
-
-	/* allocate memory for xg_graphic structure */
-	if ((graphic = (struct xg_graphic *)
-		calloc(1,sizeof(struct xg_graphic))) == NULL)
-		exit(1);
-
-	/* copy input variables to global variables */
-	graphic->dpy = display;
-	graphic->xid = can_xid;
-	for (i=0;i<4;i++)
-		graphic->bounds[i] = can_bounds[i];
-
-	/* check for the type of display and set the display_type */
-	graphic->display_depth = DisplayPlanes(graphic->dpy,
-			DefaultScreen(graphic->dpy));
-/*fprintf(stderr,"graphic->display_depth:%d Default Visual:%d\n",
-graphic->display_depth,
-DefaultVisual(graphic->dpy, DefaultScreen(graphic->dpy)));*/
-	if (graphic->display_depth == 1 )
-		{
-		if (XMatchVisualInfo(graphic->dpy,DefaultScreen(graphic->dpy),
-			1,StaticGray,&(graphic->visinfo)) == 0)
-			{
-			fprintf(stderr,"Error: Could not Match an 1 bit GrayScale plane\n");
-			exit(-1);
-			}
-		graphic->display_type = StaticGray;
-		graphic->visual = graphic->visinfo.visual;
-		}
-	else if (graphic->display_depth == 8)
-		{
-		if (XMatchVisualInfo(graphic->dpy, DefaultScreen(graphic->dpy),
-			8,PseudoColor,&(graphic->visinfo)) == 0)
-			{
-			fprintf(stderr,"Error: Could not Match an 8 bit Pseudo-Color plane\n");
-			exit(-1);
-			}
-		graphic->display_type = PseudoColor;
-		graphic->visual = graphic->visinfo.visual;
-		}
-	else if (graphic->display_depth == 16)
-		{
-		if (XMatchVisualInfo(graphic->dpy, DefaultScreen(graphic->dpy),
-			16,TrueColor,&(graphic->visinfo)) != 0)
-			{
-			graphic->display_type = TrueColor;
-			graphic->visual = graphic->visinfo.visual;
-			}
-		else if (XMatchVisualInfo(graphic->dpy, DefaultScreen(graphic->dpy),
-			16,PseudoColor,&(graphic->visinfo)) != 0)
-			{
-			graphic->display_type = PseudoColor;
-			graphic->visual = graphic->visinfo.visual;
-			}
-		else
-			{
-			fprintf(stderr,"Error: Could not Match a 16 bit TrueColor or Pseudocolor plane\n");
-			exit(-1);
-			}
-		}
-	else if (graphic->display_depth == 24)
-		{
-		if (XMatchVisualInfo(graphic->dpy, DefaultScreen(graphic->dpy),
-			24,TrueColor,&(graphic->visinfo)) == 0)
-			{
-			fprintf(stderr,"Error: Could not Match a 24 bit TrueColor plane\n");
-			exit(-1);
-			}
-		graphic->display_type = TrueColor;
-		graphic->visual = graphic->visinfo.visual;
-		}
-	else
-		{
-		graphic->visual = DefaultVisual(graphic->dpy, DefaultScreen(graphic->dpy));
-		graphic->display_type = 0;
-		}
-
-	/* set foreground and background colors */
-	if (graphic->display_type == StaticGray
-		|| graphic->display_type == PseudoColor
-	        || graphic->display_type == TrueColor)
-		{
-		graphic->bg_pixel = WhitePixel(graphic->dpy,
-			DefaultScreen(graphic->dpy));
-		graphic->fg_pixel = BlackPixel(graphic->dpy,
-			DefaultScreen(graphic->dpy));
-		}
-	else
-		{
-		fprintf(stderr, "Error: Could not Match a one, eight, or twentyfour bit plane\n");
-		exit(-1);
-		}
-
-	/* load font */
-	if ((graphic->font_info = XLoadQueryFont(graphic->dpy, fontname))
-		== NULL)
-		{
-		fprintf(stderr,"\nFailure to load font using XLoadQueryFont: %s\n", fontname);
-		fprintf(stderr,"\tSource file: %s\n\tSource line: %d\n\tSource version: %s", __FILE__, __LINE__, svn_id);
-		fprintf(stderr,"Program Terminated\n");
-		exit(-1);
-		}
-
-	/* set up graphics context */
-	gc_val.foreground = graphic->fg_pixel;
-	gc_val.background = graphic->bg_pixel;
-	gc_val.font = graphic->font_info->fid;
-
-	/* set gc with solid lines */
-	gc_val.plane_mask = AllPlanes;
-	gc_val.line_style = LineSolid;
-	graphic->gc_solid = XCreateGC(graphic->dpy, graphic->xid,
-		(GCForeground | GCBackground | GCFont
-		| GCPlaneMask | GCLineStyle),
-		&(gc_val));
-
-	/* set gc with dash lines */
-	gc_val.line_style = LineOnOffDash;
-	graphic->gc_dash = XCreateGC(graphic->dpy, graphic->xid,
-		(GCForeground | GCBackground | GCFont
-		| GCPlaneMask | GCLineStyle),
-		&(gc_val));
-
-	/* return pointer to xg_graphic structure */
-	*xgid = (void *) graphic;
-
-}
-/**********************************************************************
- *	XG_FREE
- *	- deallocates xg_graphic structure when no longer needed
- **********************************************************************/
-void xg_free(void *xgid)
-{
-	struct xg_graphic *graphic;
-
-	graphic = (struct xg_graphic *) xgid;
-	free(graphic);
-}
-/**********************************************************************
- *	XG_DRAWPOINT
- *	- draws a pixel
- **********************************************************************/
-void xg_drawpoint(void *xgid, int x, int y, unsigned int pixel, int style)
-{
-	struct xg_graphic *graphic;
-	GC *gc;
-
-	graphic = (struct xg_graphic *) xgid;
-	if (style == XG_SOLIDLINE)
-		gc = &graphic->gc_solid;
-	else
-		gc = &graphic->gc_dash;
-	XSetForeground(graphic->dpy, *gc, pixel);
-	XDrawPoint(graphic->dpy, graphic->xid, *gc, x, y);
-}
-/**********************************************************************
- *	XG_DRAWLINE
- *	- draws a line
- **********************************************************************/
-void xg_drawline(void *xgid, int x1, int y1, int x2, int y2,
-		unsigned int pixel, int style)
-{
-	struct xg_graphic *graphic;
-	GC *gc;
-
-	graphic = (struct xg_graphic *) xgid;
-	if (style == XG_SOLIDLINE)
-		gc = &graphic->gc_solid;
-	else
-		gc = &graphic->gc_dash;
-	XSetForeground(graphic->dpy, *gc, pixel);
-	XDrawLine(graphic->dpy, graphic->xid, *gc, x1, y1, x2, y2);
-}
-/**********************************************************************
- *	XG_DRAWRECTANGLE
- *	- draws a rectangle outline
- **********************************************************************/
-void xg_drawrectangle(void *xgid, int x, int y, int width, int height,
-		unsigned int pixel, int style)
-{
-	struct xg_graphic *graphic;
-	GC *gc;
-
-	graphic = (struct xg_graphic *) xgid;
-	if (style == XG_SOLIDLINE)
-		gc = &graphic->gc_solid;
-	else
-		gc = &graphic->gc_dash;
-	XSetForeground(graphic->dpy, *gc, pixel);
-	XDrawRectangle(graphic->dpy, graphic->xid, *gc,
-		x, y, width, height);
-}
-/**********************************************************************
- *	XG_DRAWTRIANGLE
- *	- draws a triangle outline
- **********************************************************************/
-void xg_drawtriangle(void *xgid,
-		int x1, int y1, int x2, int y2, int x3, int y3,
-		unsigned int pixel, int style)
-{
-	struct xg_graphic *graphic;
-	GC *gc;
-	XSegment segments[3];
-	int nsegments = 3;
-
-	graphic = (struct xg_graphic *) xgid;
-	if (style == XG_SOLIDLINE)
-		gc = &graphic->gc_solid;
-	else
-		gc = &graphic->gc_dash;
-	segments[0].x1 = (short) x1;
-	segments[0].y1 = (short) y1;
-	segments[0].x2 = (short) x2;
-	segments[0].y2 = (short) y2;
-	segments[1].x1 = (short) x2;
-	segments[1].y1 = (short) y2;
-	segments[1].x2 = (short) x3;
-	segments[1].y2 = (short) y3;
-	segments[2].x1 = (short) x3;
-	segments[2].y1 = (short) y3;
-	segments[2].x2 = (short) x1;
-	segments[2].y2 = (short) y1;
-	XSetForeground(graphic->dpy, *gc, pixel);
-	XDrawSegments(graphic->dpy, graphic->xid, *gc,
-		segments, nsegments);
-}
-/**********************************************************************
- *	XG_FILLRECTANGLE
- *	- fills a rectangle
- **********************************************************************/
-void xg_fillrectangle(void *xgid, int x, int y, int width, int height,
-		unsigned int pixel, int style)
-{
-	struct xg_graphic *graphic;
-	GC *gc;
-
-	graphic = (struct xg_graphic *) xgid;
-	if (style == XG_SOLIDLINE)
-		gc = &graphic->gc_solid;
-	else
-		gc = &graphic->gc_dash;
-	XSetForeground(graphic->dpy, *gc, pixel);
-	XFillRectangle(graphic->dpy, graphic->xid, *gc,
-		x, y, width, height);
-}
-/**********************************************************************
- *	XG_FILLTRIANGLE
- *	- fills a triangle
- **********************************************************************/
-void xg_filltriangle(void *xgid,
-		int x1, int y1, int x2, int y2, int x3, int y3,
-		unsigned int pixel, int style)
-{
-	struct xg_graphic *graphic;
-	GC *gc;
-	XPoint points[3];
-	int npoints = 3;
-	int shape = Convex;
-	int mode = CoordModeOrigin;
-
-	graphic = (struct xg_graphic *) xgid;
-	if (style == XG_SOLIDLINE)
-		gc = &graphic->gc_solid;
-	else
-		gc = &graphic->gc_dash;
-	points[0].x = (short) x1;
-	points[0].y = (short) y1;
-	points[1].x = (short) x2;
-	points[1].y = (short) y2;
-	points[2].x = (short) x3;
-	points[2].y = (short) y3;
-	XSetForeground(graphic->dpy, *gc, pixel);
-	XFillPolygon(graphic->dpy, graphic->xid, *gc,
-		points, npoints, shape, mode);
-}
-/**********************************************************************
- *	XG_DRAWSTRING
- *	- draws a string
- **********************************************************************/
-void xg_drawstring(void *xgid, int x, int y, char *string,
-		unsigned int pixel, int style)
-{
-	struct xg_graphic *graphic;
-	GC *gc;
-	int	string_length;
-
-	graphic = (struct xg_graphic *) xgid;
-	if (style == XG_SOLIDLINE)
-		gc = &graphic->gc_solid;
-	else
-		gc = &graphic->gc_dash;
-	XSetForeground(graphic->dpy, *gc, pixel);
-	string_length = strlen(string);
-	XDrawString(graphic->dpy, graphic->xid, *gc,
-		x, y, string, string_length);
-}
-/**********************************************************************
- *	XG_JUSTIFY
- *	- figures out the dimensions of a string when drawn
- **********************************************************************/
-void xg_justify(void *xgid, char *string,
-		int *width, int *ascent, int *descent)
-{
-	struct xg_graphic *graphic;
-	int	string_length;
-	XCharStruct	string_info;
-	int	direction;
-	int	lascent;
-	int	ldescent;
-
-	graphic = (struct xg_graphic *) xgid;
-	string_length = strlen(string);
-	XTextExtents(graphic->font_info, string, string_length,
-		&direction, &lascent, &ldescent, &string_info);
-	*width = string_info.width;
-	*ascent = string_info.ascent;
-	*descent = string_info.descent;
-}
-/**********************************************************************
- *	XG_SETCLIP
- *	- sets clipping mask for all gc's
- **********************************************************************/
-void xg_setclip(void *xgid, int x, int y, int width, int height)
-{
-	struct xg_graphic *graphic;
-	XRectangle rectangle[1];
-
-	/* set up rectangle */
-	rectangle[0].x = x;
-	rectangle[0].y = y;
-	rectangle[0].width = width;
-	rectangle[0].height = height;
-
-	/* set clip rectangle */
-	graphic = (struct xg_graphic *) xgid;
-	XSetClipRectangles(graphic->dpy, graphic->gc_solid, 0, 0,
-		rectangle, 1, Unsorted);
-	XSetClipRectangles(graphic->dpy, graphic->gc_dash, 0, 0,
-		rectangle, 1, Unsorted);
-}
diff --git a/src/mbaux/mb_xgraphics.h b/src/mbaux/mb_xgraphics.h
deleted file mode 100644
index 546b0e6..0000000
--- a/src/mbaux/mb_xgraphics.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mb_aux.h	10/13/2009
- *    $Id: mb_xgraphics.h 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 2009-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mb_xgraphics.h defines data structures used by mb_xgraphics.c.
- *
- * Author:	D. W. Caress
- * Date:	October 13, 2009
- *
- * $Log: $
- *
- */
-
-/* xgraphics defines */
-#define	XG_SOLIDLINE	0
-#define	XG_DASHLINE	1
-
-/* xg_graphic structure */
-struct xg_graphic
-	{
-	Display		*dpy;		/* Xwindows display/screen number */
-	Window		xid;		/* Xwindows window id for drawable */
-	int		bounds[4];	/* Drawable borders */
-	int		display_type;	/* Monochrome or 8-bit color */
-	int		display_depth;	/* 1-bit or 8-bit */
-	Visual		*visual;	/* We get it but we don't use it */
-	XVisualInfo	visinfo;	/* We get it but we don't use it */
-	unsigned int	bg_pixel;	/* background color */
-	unsigned int	fg_pixel;	/* foreground color */
-	GC		gc_solid;	/* Xwindows graphics context */
-	GC		gc_dash;	/* Xwindows graphics context */
-	XFontStruct	*font_info;	/* XFontStruct pointer */
-	};
-
-/* xgraphics function prototypes */
-void xg_init(Display *display, Window can_xid,
-		int *can_bounds, char *fontname, void **xgid);
-void xg_free(void *xgid);
-void xg_drawpoint(void *xgid, int x, int y, unsigned int pixel, int style);
-void xg_drawline(void *xgid, int x1, int y1, int x2, int y2,
-		unsigned int pixel, int style);
-void xg_drawrectangle(void *xgid, int x, int y, int width, int height,
-		unsigned int pixel, int style);
-void xg_drawtriangle(void *xgid,
-		int x1, int y1, int x2, int y2, int x3, int y3,
-		unsigned int pixel, int style);
-void xg_fillrectangle(void *xgid, int x, int y, int width, int height,
-		unsigned int pixel, int style);
-void xg_filltriangle(void *xgid,
-		int x1, int y1, int x2, int y2, int x3, int y3,
-		unsigned int pixel, int style);
-void xg_drawstring(void *xgid, int x, int y, char *string,
-		unsigned int pixel, int style);
-void xg_justify(void *xgid, char *string,
-		int *width, int *ascent, int *descent);
-void xg_setclip(void *xgid, int x, int y, int width, int height);
diff --git a/src/mbaux/mb_zgrid.c b/src/mbaux/mb_zgrid.c
deleted file mode 100644
index 057b6fb..0000000
--- a/src/mbaux/mb_zgrid.c
+++ /dev/null
@@ -1,1068 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mb_zgrid.c	    4/25/95
- *    $Id: mb_zgrid.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1993-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * This is a function to generate thin plate spline interpolation
- * of a data field. This code originated as fortran in the
- * 1960's and was used routinely at the Institute of
- * Geophysics and Planetary Physics at the Scripps Institution
- * of Oceanography through the 1970's and 1980's. The Fortran
- * code was obtained from Professory Robert L. Parker at
- * IGPP in 1989.
- * It was converted to C in 1995 for use with the MB-System
- * software package.
- *
- * The nature of the interpolation is controlled by the
- * parameters cay and nrng: cay sets the tension of the
- * interpolation such that cay=0.0 yields a pure Laplace
- * (minimum curvature) solution and cay=infinity yields
- * a pure thin plate spline solution. A cay=1e10 value
- * has commonly been used to yield spline solutions.
- * The nrng value sets the number of grid spaces from
- * data that will be interpolated; if nrng exceeds the
- * maximum dimension of the grid then the entire grid
- * will be interpolated.
- *
- * The input parameters are:
- *     nx,ny = max subscripts of z in x and y directions .
- *     x1,y1 = coordinates of z(1,1)
- *     dx,dy = x and y increments .
- *     xyz(3,*) = array giving x-y position and hgt of each data point.
- *     n = length of xyz series.
- *     zpij[n] = float work array
- *     knxt[n] = int work array
- *     imnew[MAX(nx, ny)+1] = int work array
- *     cay = k = amount of spline eqn (between 0 and inf.)
- *     nrng...grid points more than nrng grid spaces from the nearest
- *            data point are set to undefined.
- *
- * Author:	Unknown, but "jdt", "ian crain",  and "dr t murty"
- *              obviously contributed.
- * Hacker:	D. W. Caress
- * Date:	April 25, 1995
- *
- * $Log: mb_zgrid.c,v $
- * Revision 5.6  2009/03/13 07:05:58  caress
- * Release 5.1.2beta02
- *
- * Revision 5.5  2008/12/22 08:36:18  caress
- * Check in of 22 Dec 2008.
- *
- * Revision 5.4  2008/11/16 21:51:18  caress
- * Updating all recent changes, including time lag analysis using mbeditviz and improvements to the mbgrid footprint gridding algorithm.
- *
- * Revision 5.3  2008/10/17 07:52:44  caress
- * Check in on October 17, 2008.
- *
- * Revision 5.2  2008/07/10 06:43:40  caress
- * Preparing for 5.1.1beta20
- *
- * Revision 5.1  2007/10/08 05:50:55  caress
- * Changed convergence criteria.
- *
- * Revision 5.0  2000/12/01 22:53:59  caress
- * First cut at Version 5.0.
- *
- * Revision 4.5  2000/10/11  21:48:43  caress
- * Moved file to mbaux directory and renamed to mb_zgrid.c
- *
- * Revision 4.4  2000/10/11  01:06:15  caress
- * Convert to ANSI C
- *
- * Revision 4.3  2000/09/30  07:06:28  caress
- * Snapshot for Dale.
- *
- * Revision 4.2  1997/04/21  17:19:14  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.1  1996/04/22  13:23:05  caress
- * Now have DTR and MIN/MAX defines in mb_define.h
- *
- * Revision 4.1  1996/04/22  13:23:05  caress
- * Now have DTR and MIN/MAX defines in mb_define.h
- *
- * Revision 4.0  1995/04/25  19:07:29  caress
- * First cut at C version of zgrid.
- *
- *
- * The following are the original comments from the Fortran code:
- *
- *     sets up square grid for contouring , given arbitrarily placed
- *     data points. laplace interpolation is used.
- *     the method used here was lifted directly from notes left by
- *     mr ian crain formerly with the comp.science div.
- *     info on relaxation soln of laplace eqn supplied by dr t murty.
- *     fortran ii   oceanography/emr   dec/68   jdt
- *
- *     z = 2-d array of hgts to be set up. points outside region to be
- *     contoured should be initialized to 10**35 . the rest should be 0.0
- *
- *     modification feb/69   to get smoother results a portion of the
- *     beam eqn  was added to the laplace eqn giving
- *     delta2x(z)+delta2y(z) - k(delta4x(z)+delta4y(z)) = 0 .
- *     k=0 gives pure laplace solution.  k=infinity gives pure spline
- *     solution.
- *
- *     nx,ny = max subscripts of z in x and y directions .
- *     x1,y1 = coordinates of z(1,1)
- *     dx,dy = x and y increments .
- *     xyz(3,*) = array giving x-y position and hgt of each data point.
- *     n = length of xyz series.
- *     cay = k = amount of spline eqn (between 0 and inf.)
- *     nrng...grid points more than nrng grid spaces from the nearest
- *            data point are set to undefined.
- *
- *     modification dec23/69   data pts no longer moved to grid pts.
- *
- *     modification feb/85  common blocks work1 and work2 replaced by
- *     dimension statement and parameters nwork, mwork introduced.
- *
- *     modification feb/90  nwork and mwork replaced by maxdat and maxdim
- *     for compatibility with command driven interface program
- *     David W. Caress
- *
- * zgrid.c -- translated by f2c (version 19950314) from zgrid.f.
- * Work arrays zpij[n], knxt[n], imnew[MAX(nx, ny)+1] are now
- * passed into the function.
- * David W. Caress
- * April 25,  1995
- *
- * Added function mb_zgrid2() with same calling parameters
- * - This function does interpolation onto a grid with a maximum dimension
- *   of 500 and then translates that to the desired grid by bilinear
- *   interpolation
- * - this approach is much faster and also yields nicer results - the
- *   zgrid algorithm does not seem to work well with small grid cell
- *   sizes.
- * David W. Caress
- * 2 October 2012
- *
- *--------------------------------------------------------------------*/
-
-/* standard include files */
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#include <string.h>
-
-/* MBIO include files */
-#include "mb_define.h"
-#include "mb_status.h"
-#include "mb_aux.h"
-
-#define ITERMIN 100
-#define ITERMAX 1000
-#define ITERTRANSITION 150
-
-#define ZGRID_DIMENSION_MAX	500
-
-/*----------------------------------------------------------------------- */
-int mb_zgrid2(float *z, int *nx, int *ny,
-		float *x1, float *y1, float *dx, float *dy, float *xyz,
-		int *n, float *zpij, int *knxt, int *imnew,
-		float *cay, int *nrng)
-{
-    int		error = MB_ERROR_NO_ERROR;
-    int		status = MB_SUCCESS;
-    int		verbose = 0;
-    float	*sz = NULL;
-    float	sdx, sdy;
-    double	xi, yj;
-    double	dx_d, dy_d, sfactor, sdx_d, sdy_d;
-    double	sx0, sx1, sy0, sy1;
-    int		snx, sny, snrng;
-    int		i, j, k, si, sj, sk00, sk01, sk10, sk11;
-
-    /* if nx and ny < ZGRID_DIMENSION_MAX just call zgrid() */
-    if (*nx < ZGRID_DIMENSION_MAX && *ny < ZGRID_DIMENSION_MAX)
-	{
-	fprintf(stderr,"Zgrid2 calling zgrid with unchanged grid dimensions %d %d\n",*nx,*ny);
-	mb_zgrid(z, nx, ny, x1, y1, dx, dy, xyz, n, zpij, knxt, imnew, cay, nrng);
-	}
-
-    /* else set up to call zgrid() to generate a smaller grid and then
-       use bilinear interpolation to map that onto the desired grid */
-    else
-	{
-	/* get scale reduction factor and new dimensions and cell sizes */
-	dx_d = (double)*dx;
-	dy_d = (double)*dy;
-	sfactor = ((double)(ZGRID_DIMENSION_MAX)) / MAX(*nx, *ny);
-	snx = (int)(sfactor * (*nx)) + 1;
-	sny = (int)(sfactor * (*ny)) + 1;
-	sdx_d = (dx_d * (*nx - 1)) / snx;
-	sdy_d = (dy_d * (*ny - 1)) / sny;
-	snrng = (int)(sfactor*(*nrng)) + 1;
-	sdx = (float)sdx_d;
-	sdy = (float)sdy_d;
-
-	/* allocate array for intermediate grid */
-	status = mb_mallocd(verbose,__FILE__,__LINE__,snx*sny*sizeof(float),(void **)&sz,&error);
-	memset((void *)sz,(int)0,(size_t)(snx*sny*sizeof(float)));
-
-	/* call zgrid() */
-	fprintf(stderr,"Smooth surface being calculated for grid with dimensions reduced from %d %d to %d %d\n",*nx,*ny,snx,sny);
-	mb_zgrid(sz, &snx, &sny, x1, y1, &sdx, &sdy, xyz, n, zpij, knxt, imnew, cay, &snrng);
-
-	/* now fill in the full resolution grid by bilinear interpolation */
-	fprintf(stderr,"Smooth surface mapped onto full resolution grid using bilinear interpolation\n");
-	for (i=0;i<*nx;i++)
-	    for (j=0;j<*ny;j++)
-		{
-		k = i + j * (*nx);
-
-		xi = i * dx_d;
-		yj = j * dy_d;
-		si = xi / sdx_d;
-		sj = yj / sdy_d;
-		if (si >= snx - 1)
-		    si = snx - 2;
-		if (si < 0)
-		    si = 0;
-		if (sj >= sny - 1)
-		    sj = sny - 2;
-		if (sj < 0)
-		    sj = 0;
-
-		sk00 = si + sj * snx;
-		sk10 = (si + 1) + sj * snx;
-		sk01 = si + (sj + 1) * snx;
-		sk11 = (si + 1) + (sj + 1) * snx;
-
-		if (sz[sk00] < (float)5e34
-		    && sz[sk10] < (float)5e34
-		    && sz[sk01] < (float)5e34
-		    && sz[sk11] < (float)5e34)
-		    {
-		    sx0 = si * sdx_d;
-		    sx1 = (si + 1) * sdx_d;
-		    sy0 = sj * sdy_d;
-		    sy1 = (sj + 1) * sdy_d;
-
-		    z[k] = (float)((((double)sz[sk00]) * (sx1 - xi) * (sy1 - yj)
-			    + ((double)sz[sk10]) * (xi - sx0) * (sy1 - yj)
-			    + ((double)sz[sk01]) * (sx1 - xi) * (yj - sy0)
-			    + ((double)sz[sk11]) * (xi - sx0) * (yj - sy0)) / (sdx_d * sdy_d));
-		    }
-		else
-		    z[k] = (float)1e35;
-		}
-
-	/* free array for intermediate grid */
-	status = mb_freed(verbose,__FILE__,__LINE__,(void **)&sz,&error);
-
-	}
-
-	/* return */
-	return(status);
-}
-
-/*----------------------------------------------------------------------- */
-int mb_zgrid(float *z, int *nx, int *ny,
-		float *x1, float *y1, float *dx, float *dy, float *xyz,
-		int *n, float *zpij, int *knxt, int *imnew,
-		float *cay, int *nrng)
-{
-    /* System generated locals */
-    int z_dim1, z_offset, i__1, i__2, i__3;
-    float r__1;
-
-    /* Local variables */
-    float delz;
-    int iter, nnew;
-    float zijn, zmin, zimm, zmax, zjmm, zipp, zjpp;
-    float root, zsum, zpxy, a, b, c, d;
-    int i, j, k;
-    float x, y, zbase, relax, delzm;
-    float derzm;
-    int jmnew;
-    float dzmax, dzrms;
-    int kk, im, jm;
-    float dzrms8, z00, dz, ze, hrange, zn, zs, zw, zrange,
-            dzmaxf, convtest, convtestlast,
-	    relaxn, rootgs, dzrmsp, big, abz;
-    int npg;
-    int nmax;
-    int	nconvtestincrease;
-    float eps, zim, zjm;
-    float dzcriteria;
-    int npt;
-    float wgt, zip, zjp, tpy, zxy;
-    int ii,jj, kkk;
-
-    /* Parameter adjustments */
-    z_dim1 = *nx;
-    z_offset = z_dim1 + 1;
-    z -= z_offset;
-    xyz -= 4;
-
-    /* Function Body */
-    eps = (float).002;
-    if (*nx > *ny)
-    	nmax = *nx;
-    else
-        nmax = *ny;
-    /* if (*nrng < nmax)
-    	nmax = *nrng; */
-    eps = ((float) nmax) * 0.000016;
-    if (eps < 0.02)
-    	eps = 0.02;
-
-    /* trying dzmax > eps as a simple convergence criterea */
-    dzcriteria = 0.001;
-    convtestlast = 0.0;
-
-    big = (float)9e29;
-    nconvtestincrease = 0;
-
-/*     get zbase which will make all zp values positive by 20*(zmax-zmin)
-*/
-/* **********************************************************************
-*/
-
-    zmin = xyz[6];
-    zmax = xyz[6];
-    i__1 = *n;
-    for (k = 2; k <= i__1; ++k) {
-	if (xyz[k * 3 + 3] - zmax <= (float)0.) {
-	    goto L14;
-	} else {
-	    goto L12;
-	}
-L12:
-	zmax = xyz[k * 3 + 3];
-L14:
-	if (xyz[k * 3 + 3] - zmin >= (float)0.) {
-	    goto L20;
-	} else {
-	    goto L16;
-	}
-L16:
-	zmin = xyz[k * 3 + 3];
-L20:
-	;
-    }
-    zrange = zmax - zmin;
-    zbase = zrange * (float)20. - zmin;
-    hrange = MIN(*dx * (*nx - 1), *dy * (*ny - 1));
-    derzm = zrange * (float)2. / hrange;
-
-/*     set pointer array knxt */
-/* **********************************************************************
-*/
-
-    i__1 = *n;
-    for (kk = 1; kk <= i__1; ++kk) {
-	k = *n + 1 - kk;
-	knxt[k - 1] = 0;
-	i = (xyz[k * 3 + 1] - *x1) / *dx + (float)1.5;
-	if (i * (*nx + 1 - i) <= 0) {
-	    goto L60;
-	} else {
-	    goto L35;
-	}
-L35:
-	j = (xyz[k * 3 + 2] - *y1) / *dy + (float)1.5;
-	if (j * (*ny + 1 - j) <= 0) {
-	    goto L60;
-	} else {
-	    goto L40;
-	}
-L40:
-	if (z[i + j * z_dim1] - big >= (float)0.) {
-	    goto L60;
-	} else {
-	    goto L45;
-	}
-L45:
-	knxt[k - 1] = *n + 1;
-	if (z[i + j * z_dim1] <= (float)0.) {
-	    goto L55;
-	} else {
-	    goto L50;
-	}
-L50:
-	knxt[k - 1] = z[i + j * z_dim1] + (float).5;
-L55:
-	z[i + j * z_dim1] = (float) k;
-L60:
-	;
-    }
-
-/*     affix each data point zp to its nearby grid point.  take avg zp if
-*/
-/*     more than one zp nearby the grid point. add zbase and complement.
-*/
-/* **********************************************************************
-*/
-
-    i__1 = *n;
-    for (k = 1; k <= i__1; ++k) {
-	if (knxt[k - 1] <= 0) {
-	    goto L80;
-	} else {
-	    goto L65;
-	}
-L65:
-	npt = 0;
-	zsum = (float)0.;
-	i = (xyz[k * 3 + 1] - *x1) / *dx + (float)1.5;
-	j = (xyz[k * 3 + 2] - *y1) / *dy + (float)1.5;
-	kk = k;
-L70:
-	++npt;
-	zsum += xyz[kk * 3 + 3];
-	knxt[kk - 1] = -knxt[kk - 1];
-	kk = -knxt[kk - 1];
-	if (kk <= 0) {
-	    goto L75;
-	} else if (kk - *n <= 0) {
-	    goto L70;
-	} else {
-	    goto L75;
-	}
-L75:
-	z[i + j * z_dim1] = -(double)zsum / npt - zbase;
-L80:
-	;
-    }
-
-    for (ii = 1; ii <= *nx; ++ii)
-	{
-	for (jj = 1; jj <= *ny; ++jj)
-	    {
-	    if (z[ii + jj * z_dim1] < big && z[ii + jj * z_dim1] > 0.0)
-		{
-		kkk = (int)z[ii + jj * z_dim1];
-/* fprintf(stderr,"ERROR: i:%d j:%d k:%d z:%f     iii:%d jjj:%d xyz:%f %f %f\n",
-ii,jj,ii+jj*z_dim1,z[ii + jj * z_dim1],iii,jjj,xyz[kkk * 3 + 1],xyz[kkk * 3 + 2],xyz[kkk * 3 + 3]); */
-		z[ii + jj * z_dim1] = -xyz[kkk * 3 + 3] - zbase;
-		}
-	    }
-	}
-
-/*     initially set each unset grid point to value of nearest known pt.
-*/
-/* **********************************************************************
-*/
-
-    i__1 = *nx;
-    for (i = 1; i <= i__1; ++i) {
-	i__2 = *ny;
-	for (j = 1; j <= i__2; ++j) {
-	    if (z[i + j * z_dim1] != (float)0.) {
-		goto L110;
-	    } else {
-		goto L100;
-	    }
-L100:
-	    z[i + j * z_dim1] = (float)-1e35;
-L110:
-	    ;
-	}
-    }
-    i__2 = *nrng;
-    for (iter = 1; iter <= i__2; ++iter) {
-	nnew = 0;
-	i__1 = *nx;
-	for (i = 1; i <= i__1; ++i) {
-	    i__3 = *ny;
-	    for (j = 1; j <= i__3; ++j) {
-		if (z[i + j * z_dim1] + big >= (float)0.) {
-		    goto L192;
-		} else {
-		    goto L152;
-		}
-L152:
-		if (j - 1 <= 0) {
-		    goto L162;
-		} else {
-		    goto L153;
-		}
-L153:
-		if (jmnew <= 0) {
-		    goto L154;
-		} else {
-		    goto L162;
-		}
-L154:
-		zijn = (r__1 = z[i + (j - 1) * z_dim1], (float)fabs((double)r__1));
-		if (zijn - big >= (float)0.) {
-		    goto L162;
-		} else {
-		    goto L195;
-		}
-L162:
-		if (i - 1 <= 0) {
-		    goto L172;
-		} else {
-		    goto L163;
-		}
-L163:
-		if (imnew[j - 1] <= 0) {
-		    goto L164;
-		} else {
-		    goto L172;
-		}
-L164:
-		zijn = (r__1 = z[i - 1 + j * z_dim1], (float)fabs((double)r__1));
-		if (zijn - big >= (float)0.) {
-		    goto L172;
-		} else {
-		    goto L195;
-		}
-L172:
-		if (j - *ny >= 0) {
-		    goto L182;
-		} else {
-		    goto L173;
-		}
-L173:
-		zijn = (r__1 = z[i + (j + 1) * z_dim1], (float)fabs((double)r__1));
-		if (zijn - big >= (float)0.) {
-		    goto L182;
-		} else {
-		    goto L195;
-		}
-L182:
-		if (i - *nx >= 0) {
-		    goto L192;
-		} else {
-		    goto L183;
-		}
-L183:
-		zijn = (r__1 = z[i + 1 + j * z_dim1], (float)fabs((double)r__1));
-		if (zijn - big >= (float)0.) {
-		    goto L192;
-		} else {
-		    goto L195;
-		}
-L192:
-		imnew[j - 1] = 0;
-		jmnew = 0;
-		goto L197;
-L195:
-		imnew[j - 1] = 1;
-		jmnew = 1;
-		z[i + j * z_dim1] = zijn;
-		++nnew;
-L197:
-		;
-	    }
-	}
-	if (nnew <= 0) {
-	    goto L200;
-	} else {
-	    goto L199;
-	}
-L199:
-	;
-    }
-L200:
-    i__2 = *nx;
-    for (i = 1; i <= i__2; ++i) {
-	i__3 = *ny;
-	for (j = 1; j <= i__3; ++j) {
-	    abz = (r__1 = z[i + j * z_dim1], (float)fabs((double)r__1));
-	    if (abz - big >= (float)0.) {
-		goto L201;
-	    } else {
-		goto L202;
-	    }
-L201:
-	    z[i + j * z_dim1] = abz;
-L202:
-	    ;
-	}
-    }
-
-/*     improve the non-data points by applying point over-relaxation */
-/*     using the laplace-spline equation  (carres method is used) */
-/* **********************************************************************
-*/
-fprintf(stderr,"Zgrid starting iterations\n");
-    dzrmsp = zrange;
-    relax = (float)1.;
-    for (iter = 1; iter <= ITERMAX; ++iter) {
-	dzrms = (float)0.;
-	dzmax = (float)0.;
-	npg = 0;
-	i__2 = *nx;
-	for (i = 1; i <= i__2; ++i) {
-	    i__1 = *ny;
-	    for (j = 1; j <= i__1; ++j) {
-		z00 = z[i + j * z_dim1];
-		if (z00 - big >= (float)0.) {
-		    goto L2000;
-		} else {
-		    goto L205;
-		}
-L205:
-		if (z00 >= (float)0.) {
-		    goto L208;
-		} else {
-		    goto L2000;
-		}
-L208:
-		wgt = (float)0.;
-		zsum = (float)0.;
-
-		im = 0;
-		if (i - 1 <= 0) {
-		    goto L570;
-		} else {
-		    goto L510;
-		}
-L510:
-		zim = (r__1 = z[i - 1 + j * z_dim1], (float)fabs((double)r__1));
-		if (zim - big >= (float)0.) {
-		    goto L570;
-		} else {
-		    goto L530;
-		}
-L530:
-		im = 1;
-		wgt += (float)1.;
-		zsum += zim;
-		if (i - 2 <= 0) {
-		    goto L570;
-		} else {
-		    goto L540;
-		}
-L540:
-		zimm = (r__1 = z[i - 2 + j * z_dim1], (float)fabs((double)r__1));
-		if (zimm - big >= (float)0.) {
-		    goto L570;
-		} else {
-		    goto L560;
-		}
-L560:
-		wgt += *cay;
-		zsum -= *cay * (zimm - zim * (float)2.);
-L570:
-		if (*nx - i <= 0) {
-		    goto L700;
-		} else {
-		    goto L580;
-		}
-L580:
-		zip = (r__1 = z[i + 1 + j * z_dim1], (float)fabs((double)r__1));
-		if (zip - big >= (float)0.) {
-		    goto L700;
-		} else {
-		    goto L600;
-		}
-L600:
-		wgt += (float)1.;
-		zsum += zip;
-		if (im <= 0) {
-		    goto L620;
-		} else {
-		    goto L610;
-		}
-L610:
-		wgt += *cay * (float)4.;
-		zsum += *cay * (float)2. * (zim + zip);
-L620:
-		if (*nx - 1 - i <= 0) {
-		    goto L700;
-		} else {
-		    goto L630;
-		}
-L630:
-		zipp = (r__1 = z[i + 2 + j * z_dim1], (float)fabs((double)r__1));
-		if (zipp - big >= (float)0.) {
-		    goto L700;
-		} else {
-		    goto L650;
-		}
-L650:
-		wgt += *cay;
-		zsum -= *cay * (zipp - zip * (float)2.);
-L700:
-
-		jm = 0;
-		if (j - 1 <= 0) {
-		    goto L1570;
-		} else {
-		    goto L1510;
-		}
-L1510:
-		zjm = (r__1 = z[i + (j - 1) * z_dim1], (float)fabs((double)r__1));
-		if (zjm - big >= (float)0.) {
-		    goto L1570;
-		} else {
-		    goto L1530;
-		}
-L1530:
-		jm = 1;
-		wgt += (float)1.;
-		zsum += zjm;
-		if (j - 2 <= 0) {
-		    goto L1570;
-		} else {
-		    goto L1540;
-		}
-L1540:
-		zjmm = (r__1 = z[i + (j - 2) * z_dim1], (float)fabs((double)r__1));
-		if (zjmm - big >= (float)0.) {
-		    goto L1570;
-		} else {
-		    goto L1560;
-		}
-L1560:
-		wgt += *cay;
-		zsum -= *cay * (zjmm - zjm * (float)2.);
-L1570:
-		if (*ny - j <= 0) {
-		    goto L1700;
-		} else {
-		    goto L1580;
-		}
-L1580:
-		zjp = (r__1 = z[i + (j + 1) * z_dim1], (float)fabs((double)r__1));
-		if (zjp - big >= (float)0.) {
-		    goto L1700;
-		} else {
-		    goto L1600;
-		}
-L1600:
-		wgt += (float)1.;
-		zsum += zjp;
-		if (jm <= 0) {
-		    goto L1620;
-		} else {
-		    goto L1610;
-		}
-L1610:
-		wgt += *cay * (float)4.;
-		zsum += *cay * (float)2. * (zjm + zjp);
-L1620:
-		if (*ny - 1 - j <= 0) {
-		    goto L1700;
-		} else {
-		    goto L1630;
-		}
-L1630:
-		zjpp = (r__1 = z[i + (j + 2) * z_dim1], (float)fabs((double)r__1));
-		if (zjpp - big >= (float)0.) {
-		    goto L1700;
-		} else {
-		    goto L1650;
-		}
-L1650:
-		wgt += *cay;
-		zsum -= *cay * (zjpp - zjp * (float)2.);
-L1700:
-
-		dz = zsum / wgt - z00;
-		++npg;
-		dzrms += dz * dz;
-		dzmax = MAX((float)fabs((double)dz), dzmax);
-		z[i + j * z_dim1] = z00 + dz * relax;
-L2000:
-		;
-	    }
-	}
-
-/*     shift data points zp progressively back to their proper places
-as */
-/*     the shape of surface z becomes evident. */
-/* ******************************************************************
-**** */
-
-	if (iter - iter / 10 * 10 != 0) {
-	    goto L3600;
-	} else {
-	    goto L3020;
-	}
-L3020:
-	i__1 = *n;
-	for (k = 1; k <= i__1; ++k) {
-	    knxt[k - 1] = (i__2 = knxt[k - 1], abs(i__2));
-	    if (knxt[k - 1] <= 0) {
-		goto L3400;
-	    } else {
-		goto L3030;
-	    }
-L3030:
-	    x = (xyz[k * 3 + 1] - *x1) / *dx;
-	    i = x + (float)1.5;
-	    x = x + (float)1. - i;
-	    y = (xyz[k * 3 + 2] - *y1) / *dy;
-	    j = y + (float)1.5;
-	    y = y + (float)1. - j;
-	    zpxy = xyz[k * 3 + 3] + zbase;
-	    z00 = (r__1 = z[i + j * z_dim1], (float)fabs((double)r__1));
-
-	    zw = (float)1e35;
-	    if (i - 1 <= 0) {
-		goto L3120;
-	    } else {
-		goto L3110;
-	    }
-L3110:
-	    zw = (r__1 = z[i - 1 + j * z_dim1], (float)fabs((double)r__1));
-L3120:
-	    ze = (float)1e35;
-	    if (i - *nx >= 0) {
-		goto L3140;
-	    } else {
-		goto L3130;
-	    }
-L3130:
-	    ze = (r__1 = z[i + 1 + j * z_dim1], (float)fabs((double)r__1));
-L3140:
-	    if (ze - big >= (float)0.) {
-		goto L3150;
-	    } else {
-		goto L3160;
-	    }
-L3150:
-	    if (zw - big >= (float)0.) {
-		goto L3170;
-	    } else {
-		goto L3180;
-	    }
-L3160:
-	    if (zw - big >= (float)0.) {
-		goto L3190;
-	    } else {
-		goto L3200;
-	    }
-L3170:
-	    ze = z00;
-	    zw = z00;
-	    goto L3200;
-L3180:
-	    ze = z00 * (float)2. - zw;
-	    goto L3200;
-L3190:
-	    zw = z00 * (float)2. - ze;
-
-L3200:
-	    zs = (float)1e35;
-	    if (j - 1 <= 0) {
-		goto L3220;
-	    } else {
-		goto L3210;
-	    }
-L3210:
-	    zs = (r__1 = z[i + (j - 1) * z_dim1], (float)fabs((double)r__1));
-L3220:
-	    zn = (float)1e35;
-	    if (j - *ny >= 0) {
-		goto L3240;
-	    } else {
-		goto L3230;
-	    }
-L3230:
-	    zn = (r__1 = z[i + (j + 1) * z_dim1], (float)fabs((double)r__1));
-L3240:
-	    if (zn - big >= (float)0.) {
-		goto L3250;
-	    } else {
-		goto L3260;
-	    }
-L3250:
-	    if (zs - big >= (float)0.) {
-		goto L3270;
-	    } else {
-		goto L3280;
-	    }
-L3260:
-	    if (zs - big >= (float)0.) {
-		goto L3290;
-	    } else {
-		goto L3300;
-	    }
-L3270:
-	    zn = z00;
-	    zs = z00;
-	    goto L3300;
-L3280:
-	    zn = z00 * (float)2. - zs;
-	    goto L3300;
-L3290:
-	    zs = z00 * (float)2. - zn;
-
-L3300:
-	    a = (ze - zw) * (float).5;
-	    b = (zn - zs) * (float).5;
-	    c = (ze + zw) * (float).5 - z00;
-	    d = (zn + zs) * (float).5 - z00;
-	    zxy = z00 + a * x + b * y + c * x * x + d * y * y;
-	    delz = z00 - zxy;
-	    delzm = derzm * ((float)fabs((double)x) * *dx + (float)fabs((double)y) * *dy) * (float).8;
-	    if (delz - delzm <= (float)0.) {
-		goto L3355;
-	    } else {
-		goto L3350;
-	    }
-L3350:
-	    delz = delzm;
-L3355:
-	    if (delz + delzm >= (float)0.) {
-		goto L3365;
-	    } else {
-		goto L3360;
-	    }
-L3360:
-	    delz = -(double)delzm;
-L3365:
-	    zpij[k - 1] = zpxy + delz;
-L3400:
-	    ;
-	}
-
-	i__1 = *n;
-	for (k = 1; k <= i__1; ++k) {
-	    if (knxt[k - 1] <= 0) {
-		goto L3500;
-	    } else {
-		goto L3410;
-	    }
-L3410:
-	    npt = 0;
-	    zsum = (float)0.;
-	    i = (xyz[k * 3 + 1] - *x1) / *dx + (float)1.5;
-	    j = (xyz[k * 3 + 2] - *y1) / *dy + (float)1.5;
-	    kk = k;
-L3420:
-	    ++npt;
-	    zsum += zpij[kk - 1];
-	    knxt[kk - 1] = -knxt[kk - 1];
-	    kk = -knxt[kk - 1];
-	    if (kk <= 0) {
-	        goto L3430;
-	    } else if (kk - *n <= 0) {
-		goto L3420;
-	    } else {
-		goto L3430;
-	    }
-L3430:
-	    z[i + j * z_dim1] = -(double)zsum / npt;
-L3500:
-	    ;
-	}
-L3600:
-
-/*     test for convergence */
-/* ******************************************************************
-**** */
-/* all grid points assigned */
-	if (npg <= 1) {
-	    goto L4010;
-	}
-	dzrms = sqrt(dzrms / npg);
-	if (dzrms > 0.0 && dzrmsp > 0.0)
-	    root = dzrms / dzrmsp;
-	else
-	    root = 0.0;
-	dzmaxf = dzmax / zrange;
-	dzrmsp = dzrms;
-	if (iter - iter / 10 * 10 - 2 != 0) {
-	    goto L3715;
-	} else {
-	    goto L3710;
-	}
-L3710:
-	dzrms8 = dzrms;
-L3715:
-	if (iter - iter / 10 * 10 != 0) {
-	    goto L4000;
-	} else {
-	    goto L3720;
-	}
-L3720:
-	if (dzrms > 0.0 && dzrms8 > 0.0)
-	    root = sqrt(sqrt(sqrt(dzrms / dzrms8)));
-	else
-	    root = 0.0;
-	if (root - (float).9999 >= (float)0.) {
-	    fprintf(stderr,"Zgrid iteration %d convergence test skipped root: %f\n",iter,root);
-	    goto L4000;
-	} else {
-	    goto L3730;
-	}
-L3730:
-	/* convtest = dzmaxf / ((float)1. - root) - eps; */
-	convtest = dzmaxf - dzcriteria;
-	if (iter > ITERTRANSITION && convtest > convtestlast)
-	    nconvtestincrease++;
-	fprintf(stderr,"Zgrid iteration %d convergence test: %f last:%f\n",iter,convtest,convtestlast);
-	if ((convtest <= (float)0. && iter > ITERMIN)
-	    || (iter > ITERTRANSITION && nconvtestincrease >= 4)) {
-	    goto L4010;
-	} else {
-	    convtestlast = convtest;
-	    goto L3740;
-	}
-
-/*     improve the relaxation factor. */
-/* ******************************************************************
-**** */
-
-L3740:
-	if ((iter - 20) * (iter - 40) * (iter - 60) != 0) {
-	    goto L4000;
-	} else {
-	    goto L3750;
-	}
-L3750:
-	if (relax - (float)1. - root >= (float)0.) {
-	    goto L4000;
-	} else {
-	    goto L3760;
-	}
-L3760:
-	tpy = (root + relax - (float)1.) / relax;
-	rootgs = tpy * tpy / root;
-	relaxn = (float)2. / (sqrt((float)1. - rootgs) + (float)1.);
-	if (iter - 60 != 0) {
-	    goto L3780;
-	} else {
-	    goto L3785;
-	}
-L3780:
-	relaxn -= ((float)2. - relaxn) * (float).25;
-L3785:
-	relax = MAX(relax,relaxn);
-L4000:
-	;
-    }
-L4010:
-
-/*     remove zbase from array z and return. */
-/* **********************************************************************
-*/
-
-    i__3 = *nx;
-    for (i = 1; i <= i__3; ++i) {
-	i__1 = *ny;
-	for (j = 1; j <= i__1; ++j) {
-	    if (z[i + j * z_dim1] - big >= (float)0.) {
-		goto L4500;
-	    } else {
-		goto L4400;
-	    }
-L4400:
-	    z[i + j * z_dim1] = (r__1 = z[i + j * z_dim1], (float)fabs((double)r__1)) -
-		    zbase;
-L4500:
-	    ;
-	}
-    }
-    return 0;
-} /* mb_zgrid */
diff --git a/src/mbedit/Makefile.am b/src/mbedit/Makefile.am
deleted file mode 100644
index ab17523..0000000
--- a/src/mbedit/Makefile.am
+++ /dev/null
@@ -1,20 +0,0 @@
-bin_PROGRAMS = mbedit
-
-AM_CFLAGS = ${libnetcdf_CFLAGS}
-
-AM_CPPFLAGS = -I${top_srcdir}/src/mbio \
-	      -I${top_srcdir}/src/mbaux \
-	      -I${top_srcdir}/src/gsf \
-	      ${libnetcdf_CPPFLAGS} \
-	      ${libmotif_CPPFLAGS}
-
-AM_LDFLAGS = -L$(top_builddir)/src/gsf
-
-LIBS = $(top_builddir)/src/mbio/libmbio.la \
-       $(top_builddir)/src/mbaux/libmbaux.la \
-       $(top_builddir)/src/mbaux/libmbxgr.la \
-       ${libgmt_LIBS} ${libnetcdf_LIBS} ${libproj_LIBS} \
-       ${libmotif_LIBS} \
-       $(LIBM)
-
-mbedit_SOURCES = mbedit.c mbedit_bxutils.c mbedit_callbacks.c mbedit_creation.c mbedit_prog.c mbedit_creation.h mbedit.h
diff --git a/src/mbedit/Makefile.in b/src/mbedit/Makefile.in
deleted file mode 100644
index 2d1eb54..0000000
--- a/src/mbedit/Makefile.in
+++ /dev/null
@@ -1,671 +0,0 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
-
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-
-VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
-am__make_running_with_option = \
-  case $${target_option-} in \
-      ?) ;; \
-      *) echo "am__make_running_with_option: internal error: invalid" \
-              "target option '$${target_option-}' specified" >&2; \
-         exit 1;; \
-  esac; \
-  has_opt=no; \
-  sane_makeflags=$$MAKEFLAGS; \
-  if $(am__is_gnu_make); then \
-    sane_makeflags=$$MFLAGS; \
-  else \
-    case $$MAKEFLAGS in \
-      *\\[\ \	]*) \
-        bs=\\; \
-        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
-          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
-    esac; \
-  fi; \
-  skip_next=no; \
-  strip_trailopt () \
-  { \
-    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
-  }; \
-  for flg in $$sane_makeflags; do \
-    test $$skip_next = yes && { skip_next=no; continue; }; \
-    case $$flg in \
-      *=*|--*) continue;; \
-        -*I) strip_trailopt 'I'; skip_next=yes;; \
-      -*I?*) strip_trailopt 'I';; \
-        -*O) strip_trailopt 'O'; skip_next=yes;; \
-      -*O?*) strip_trailopt 'O';; \
-        -*l) strip_trailopt 'l'; skip_next=yes;; \
-      -*l?*) strip_trailopt 'l';; \
-      -[dEDm]) skip_next=yes;; \
-      -[JT]) skip_next=yes;; \
-    esac; \
-    case $$flg in \
-      *$$target_option*) has_opt=yes; break;; \
-    esac; \
-  done; \
-  test $$has_opt = yes
-am__make_dryrun = (target_option=n; $(am__make_running_with_option))
-am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-bin_PROGRAMS = mbedit$(EXEEXT)
-subdir = src/mbedit
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/depcomp
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
-	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
-	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
-	$(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-	$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/src/mbio/mb_config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-am__installdirs = "$(DESTDIR)$(bindir)"
-PROGRAMS = $(bin_PROGRAMS)
-am_mbedit_OBJECTS = mbedit.$(OBJEXT) mbedit_bxutils.$(OBJEXT) \
-	mbedit_callbacks.$(OBJEXT) mbedit_creation.$(OBJEXT) \
-	mbedit_prog.$(OBJEXT)
-mbedit_OBJECTS = $(am_mbedit_OBJECTS)
-mbedit_LDADD = $(LDADD)
-AM_V_lt = $(am__v_lt_ at AM_V@)
-am__v_lt_ = $(am__v_lt_ at AM_DEFAULT_V@)
-am__v_lt_0 = --silent
-am__v_lt_1 = 
-AM_V_P = $(am__v_P_ at AM_V@)
-am__v_P_ = $(am__v_P_ at AM_DEFAULT_V@)
-am__v_P_0 = false
-am__v_P_1 = :
-AM_V_GEN = $(am__v_GEN_ at AM_V@)
-am__v_GEN_ = $(am__v_GEN_ at AM_DEFAULT_V@)
-am__v_GEN_0 = @echo "  GEN     " $@;
-am__v_GEN_1 = 
-AM_V_at = $(am__v_at_ at AM_V@)
-am__v_at_ = $(am__v_at_ at AM_DEFAULT_V@)
-am__v_at_0 = @
-am__v_at_1 = 
-DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)/src/mbio
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
-am__mv = mv -f
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
-	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
-	$(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
-	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
-	$(AM_CFLAGS) $(CFLAGS)
-AM_V_CC = $(am__v_CC_ at AM_V@)
-am__v_CC_ = $(am__v_CC_ at AM_DEFAULT_V@)
-am__v_CC_0 = @echo "  CC      " $@;
-am__v_CC_1 = 
-CCLD = $(CC)
-LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
-	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
-	$(AM_LDFLAGS) $(LDFLAGS) -o $@
-AM_V_CCLD = $(am__v_CCLD_ at AM_V@)
-am__v_CCLD_ = $(am__v_CCLD_ at AM_DEFAULT_V@)
-am__v_CCLD_0 = @echo "  CCLD    " $@;
-am__v_CCLD_1 = 
-SOURCES = $(mbedit_SOURCES)
-DIST_SOURCES = $(mbedit_SOURCES)
-am__can_run_installinfo = \
-  case $$AM_UPDATE_INFO_DIR in \
-    n|no|NO) false;; \
-    *) (install-info --version) >/dev/null 2>&1;; \
-  esac
-am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
-# Read a list of newline-separated strings from the standard input,
-# and print each of them once, without duplicates.  Input order is
-# *not* preserved.
-am__uniquify_input = $(AWK) '\
-  BEGIN { nonempty = 0; } \
-  { items[$$0] = 1; nonempty = 1; } \
-  END { if (nonempty) { for (i in items) print i; }; } \
-'
-# Make sure the list of sources is unique.  This is necessary because,
-# e.g., the same source file might be shared among _SOURCES variables
-# for different programs/libraries.
-am__define_uniq_tagged_files = \
-  list='$(am__tagged_files)'; \
-  unique=`for i in $$list; do \
-    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-  done | $(am__uniquify_input)`
-ETAGS = etags
-CTAGS = ctags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-CC = @CC@
-CCAS = @CCAS@
-CCASDEPMODE = @CCASDEPMODE@
-CCASFLAGS = @CCASFLAGS@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DLLTOOL = @DLLTOOL@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GREP = @GREP@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBM = @LIBM@
-LIBOBJS = @LIBOBJS@
-LIBS = $(top_builddir)/src/mbio/libmbio.la \
-       $(top_builddir)/src/mbaux/libmbaux.la \
-       $(top_builddir)/src/mbaux/libmbxgr.la \
-       ${libgmt_LIBS} ${libnetcdf_LIBS} ${libproj_LIBS} \
-       ${libmotif_LIBS} \
-       $(LIBM)
-
-LIBTOOL = @LIBTOOL@
-LIBTOOL_DEPS = @LIBTOOL_DEPS@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LTLIBOBJS = @LTLIBOBJS@
-LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
-MAINT = @MAINT@
-MAKEINFO = @MAKEINFO@
-MANIFEST_TOOL = @MANIFEST_TOOL@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-OTPS_DIR = @OTPS_DIR@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_URL = @PACKAGE_URL@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PKG_CONFIG = @PKG_CONFIG@
-PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
-PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-VERSION = @VERSION@
-XDR_LIB = @XDR_LIB@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_AR = @ac_ct_AR@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-fftw_app = @fftw_app@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libGLU_CFLAGS = @libGLU_CFLAGS@
-libGLU_LIBS = @libGLU_LIBS@
-libXm_CFLAGS = @libXm_CFLAGS@
-libXm_LIBS = @libXm_LIBS@
-libdir = @libdir@
-libexecdir = @libexecdir@
-libfftw3_CFLAGS = @libfftw3_CFLAGS@
-libfftw3_LIBS = @libfftw3_LIBS@
-libfftw_CPPFLAGS = @libfftw_CPPFLAGS@
-libfftw_LIBS = @libfftw_LIBS@
-libgmt_CFLAGS = @libgmt_CFLAGS@
-libgmt_CPPFLAGS = @libgmt_CPPFLAGS@
-libgmt_LIBS = @libgmt_LIBS@
-libmotif_CPPFLAGS = @libmotif_CPPFLAGS@
-libmotif_LIBS = @libmotif_LIBS@
-libnetcdf_CFLAGS = @libnetcdf_CFLAGS@
-libnetcdf_CPPFLAGS = @libnetcdf_CPPFLAGS@
-libnetcdf_LIBS = @libnetcdf_LIBS@
-libopengl_CPPFLAGS = @libopengl_CPPFLAGS@
-libopengl_LIBS = @libopengl_LIBS@
-libproj_CFLAGS = @libproj_CFLAGS@
-libproj_CPPFLAGS = @libproj_CPPFLAGS@
-libproj_LIBS = @libproj_LIBS@
-libpsl_CFLAGS = @libpsl_CFLAGS@
-libpsl_LIBS = @libpsl_LIBS@
-localedir = @localedir@
-localstatedir = @localstatedir@
-mandir = @mandir@
-mbsystemdatadir = @mbsystemdatadir@
-mbsystemhtmldir = @mbsystemhtmldir@
-mbsystempsdir = @mbsystempsdir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-AM_CFLAGS = ${libnetcdf_CFLAGS}
-AM_CPPFLAGS = -I${top_srcdir}/src/mbio \
-	      -I${top_srcdir}/src/mbaux \
-	      -I${top_srcdir}/src/gsf \
-	      ${libnetcdf_CPPFLAGS} \
-	      ${libmotif_CPPFLAGS}
-
-AM_LDFLAGS = -L$(top_builddir)/src/gsf
-mbedit_SOURCES = mbedit.c mbedit_bxutils.c mbedit_callbacks.c mbedit_creation.c mbedit_prog.c mbedit_creation.h mbedit.h
-all: all-am
-
-.SUFFIXES:
-.SUFFIXES: .c .lo .o .obj
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
-	@for dep in $?; do \
-	  case '$(am__configure_deps)' in \
-	    *$$dep*) \
-	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-	        && { if test -f $@; then exit 0; else break; fi; }; \
-	      exit 1;; \
-	  esac; \
-	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/mbedit/Makefile'; \
-	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --gnu src/mbedit/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	@case '$?' in \
-	  *config.status*) \
-	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-	esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-install-binPROGRAMS: $(bin_PROGRAMS)
-	@$(NORMAL_INSTALL)
-	@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
-	if test -n "$$list"; then \
-	  echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
-	  $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
-	fi; \
-	for p in $$list; do echo "$$p $$p"; done | \
-	sed 's/$(EXEEXT)$$//' | \
-	while read p p1; do if test -f $$p \
-	 || test -f $$p1 \
-	  ; then echo "$$p"; echo "$$p"; else :; fi; \
-	done | \
-	sed -e 'p;s,.*/,,;n;h' \
-	    -e 's|.*|.|' \
-	    -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
-	sed 'N;N;N;s,\n, ,g' | \
-	$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
-	  { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
-	    if ($$2 == $$4) files[d] = files[d] " " $$1; \
-	    else { print "f", $$3 "/" $$4, $$1; } } \
-	  END { for (d in files) print "f", d, files[d] }' | \
-	while read type dir files; do \
-	    if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
-	    test -z "$$files" || { \
-	    echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
-	    $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
-	    } \
-	; done
-
-uninstall-binPROGRAMS:
-	@$(NORMAL_UNINSTALL)
-	@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
-	files=`for p in $$list; do echo "$$p"; done | \
-	  sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
-	      -e 's/$$/$(EXEEXT)/' \
-	`; \
-	test -n "$$list" || exit 0; \
-	echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
-	cd "$(DESTDIR)$(bindir)" && rm -f $$files
-
-clean-binPROGRAMS:
-	@list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \
-	echo " rm -f" $$list; \
-	rm -f $$list || exit $$?; \
-	test -n "$(EXEEXT)" || exit 0; \
-	list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
-	echo " rm -f" $$list; \
-	rm -f $$list
-
-mbedit$(EXEEXT): $(mbedit_OBJECTS) $(mbedit_DEPENDENCIES) $(EXTRA_mbedit_DEPENDENCIES) 
-	@rm -f mbedit$(EXEEXT)
-	$(AM_V_CCLD)$(LINK) $(mbedit_OBJECTS) $(mbedit_LDADD) $(LIBS)
-
-mostlyclean-compile:
-	-rm -f *.$(OBJEXT)
-
-distclean-compile:
-	-rm -f *.tab.c
-
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbedit.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbedit_bxutils.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbedit_callbacks.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbedit_creation.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbedit_prog.Po at am__quote@
-
-.c.o:
- at am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(COMPILE) -c -o $@ $<
-
-.c.obj:
- at am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
- at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-
-.c.lo:
- at am__fastdepCC_TRUE@	$(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(LTCOMPILE) -c -o $@ $<
-
-mostlyclean-libtool:
-	-rm -f *.lo
-
-clean-libtool:
-	-rm -rf .libs _libs
-
-ID: $(am__tagged_files)
-	$(am__define_uniq_tagged_files); mkid -fID $$unique
-tags: tags-am
-TAGS: tags
-
-tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
-	set x; \
-	here=`pwd`; \
-	$(am__define_uniq_tagged_files); \
-	shift; \
-	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
-	  test -n "$$unique" || unique=$$empty_fix; \
-	  if test $$# -gt 0; then \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      "$$@" $$unique; \
-	  else \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      $$unique; \
-	  fi; \
-	fi
-ctags: ctags-am
-
-CTAGS: ctags
-ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
-	$(am__define_uniq_tagged_files); \
-	test -z "$(CTAGS_ARGS)$$unique" \
-	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$unique
-
-GTAGS:
-	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && $(am__cd) $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) "$$here"
-cscopelist: cscopelist-am
-
-cscopelist-am: $(am__tagged_files)
-	list='$(am__tagged_files)'; \
-	case "$(srcdir)" in \
-	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
-	  *) sdir=$(subdir)/$(srcdir) ;; \
-	esac; \
-	for i in $$list; do \
-	  if test -f "$$i"; then \
-	    echo "$(subdir)/$$i"; \
-	  else \
-	    echo "$$sdir/$$i"; \
-	  fi; \
-	done >> $(top_builddir)/cscope.files
-
-distclean-tags:
-	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	list='$(DISTFILES)'; \
-	  dist_files=`for file in $$list; do echo $$file; done | \
-	  sed -e "s|^$$srcdirstrip/||;t" \
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
-	case $$dist_files in \
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
-			   sort -u` ;; \
-	esac; \
-	for file in $$dist_files; do \
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  if test -d $$d/$$file; then \
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
-	    if test -d "$(distdir)/$$file"; then \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
-	  else \
-	    test -f "$(distdir)/$$file" \
-	    || cp -p $$d/$$file "$(distdir)/$$file" \
-	    || exit 1; \
-	  fi; \
-	done
-check-am: all-am
-check: check-am
-all-am: Makefile $(PROGRAMS)
-installdirs:
-	for dir in "$(DESTDIR)$(bindir)"; do \
-	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
-	done
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
-	if test -z '$(STRIP)'; then \
-	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	      install; \
-	else \
-	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
-	fi
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
-	@echo "This command is intended for maintainers to use"
-	@echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am
-
-distclean: distclean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
-	distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am: install-binPROGRAMS
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic \
-	mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am: uninstall-binPROGRAMS
-
-.MAKE: install-am install-strip
-
-.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \
-	clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \
-	ctags ctags-am distclean distclean-compile distclean-generic \
-	distclean-libtool distclean-tags distdir dvi dvi-am html \
-	html-am info info-am install install-am install-binPROGRAMS \
-	install-data install-data-am install-dvi install-dvi-am \
-	install-exec install-exec-am install-html install-html-am \
-	install-info install-info-am install-man install-pdf \
-	install-pdf-am install-ps install-ps-am install-strip \
-	installcheck installcheck-am installdirs maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-compile \
-	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-	tags tags-am uninstall uninstall-am uninstall-binPROGRAMS
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/mbedit/mbedit.c b/src/mbedit/mbedit.c
deleted file mode 100644
index 7101202..0000000
--- a/src/mbedit/mbedit.c
+++ /dev/null
@@ -1,167 +0,0 @@
-
-/* Begin user code block <abstract> */
-/* End user code block <abstract> */
-
-/**
- * README: Portions of this file are merged at file generation
- * time. Edits can be made *only* in between specified code blocks, look
- * for keywords <Begin user code> and <End user code>.
- */
-/*
- * Generated by the ICS Builder Xcessory (BX).
- *
- * BuilderXcessory Version 6.1.3
- * Code Generator Xcessory 6.1.3 (08/19/04) CGX Scripts 6.1 Motif 2.1
- *
- */
-
-
-/* Begin user code block <file_comments> */
-/* End user code block <file_comments> */
-
-/*
- * Motif required Headers
- */
-#include <X11/StringDefs.h>
-#include <Xm/Xm.h>
-#include <Xm/DialogS.h>
-#include <Xm/RepType.h>
-#include <Xm/MwmUtil.h>
-
-/**
- * Globally included information.
- */
-
-
-/*
- * Headers for classes used in this program
- */
-
-/**
- * Common constant and pixmap declarations.
- */
-#include "mbedit_creation.h"
-
-/**
- * Convenience functions from utilities file.
- */
-extern void RegisterBxConverters(XtAppContext);
-extern XtPointer BX_CONVERT(Widget, char *, char *, int, Boolean *);
-extern XtPointer BX_DOUBLE(double);
-extern XtPointer BX_SINGLE(float);
-extern void BX_MENU_POST(Widget, XtPointer, XEvent *, Boolean *);
-extern Pixmap XPM_PIXMAP(Widget, char **);
-extern void BX_SET_BACKGROUND_COLOR(Widget, ArgList, Cardinal *, Pixel);
-
-/**
- * Declarations for shell callbacks.
- */
-extern void do_quit(Widget, XtPointer, XtPointer);
-
-/* Begin user code block <globals> */
-
-#include "mbedit.h"
-
-Widget Createwindow_mbedit(Widget parent);
-
-/* End user code block <globals> */
-
-/**
- * Change this line via the Output Application Names Dialog.
- */
-#define BX_APP_CLASS "mbedit"
-
-int main( int argc, char **argv)
-{
-    Widget       parent;
-    XtAppContext app;
-    Arg          args[256];
-    Cardinal     ac;
-    Widget   topLevelShell;
-
-    /* Begin user code block <declarations> */
-
-    /* make sure that the argc that goes to XtVaAppInitialize
-       is 1 so that no options are removed by its option parsing */
-    int		 argc_save;
-    argc_save = argc;
-    argc = 1;
-
-    /* End user code block <declarations> */
-
-    /*
-     * Initialize Xt.
-     */
-
-    // XtSetLanguageProc(NULL, (XtLanguageProc) NULL, NULL);
-
-    /*
-     * The applicationShell is created as an unrealized
-     * parent for multiple topLevelShells.  The topLevelShells
-     * are created as popup children of the applicationShell.
-     * This is a recommendation of Paul Asente & Ralph Swick in
-     * _X_Window_System_Toolkit_ p. 677.
-     */
-
-    parent = XtVaOpenApplication ( &app,
-                                   BX_APP_CLASS,
-                                   NULL,
-                                   0,
-                                   &argc,
-                                   argv,
-                                   NULL,
-                                   sessionShellWidgetClass,
-                                   NULL );
-
-    RegisterBxConverters(app);
-    XmRepTypeInstallTearOffModelConverter();
-
-    /* Begin user code block <create_shells> */
-    /* End user code block <create_shells> */
-
-    /*
-     * Create classes and widgets used in this program.
-     */
-
-    /* Begin user code block <create_topLevelShell> */
-    /* End user code block <create_topLevelShell> */
-
-    ac = 0;
-    XtSetArg(args[ac], XmNtitle, "MBedit"); ac++;
-    XtSetArg(args[ac], XmNiconName, "MBedit"); ac++;
-    XtSetArg(args[ac], XmNallowShellResize, False); ac++;
-    XtSetArg(args[ac], XmNdeleteResponse, XmDESTROY); ac++;
-    XtSetArg(args[ac], XmNx, 114); ac++;
-    XtSetArg(args[ac], XmNy, 631); ac++;
-    XtSetArg(args[ac], XmNwidth, 1014); ac++;
-    XtSetArg(args[ac], XmNheight, 663); ac++;
-    topLevelShell = XtCreatePopupShell((char *)"topLevelShell",
-        topLevelShellWidgetClass,
-        parent,
-        args,
-        ac);
-    XtAddCallback(topLevelShell, XmNdestroyCallback, do_quit, (XtPointer)0);
-    window_mbedit = (Widget)Createwindow_mbedit(topLevelShell);
-    XtManageChild(window_mbedit);
-    XtPopup(XtParent(window_mbedit), XtGrabNone);
-
-    /* Begin user code block <app_procedures> */
-
-    /* initialize app value and wait until view realized */
-    do_wait_until_viewed(app);
-
-    /* initialize everything */
-    do_mbedit_init(argc_save,argv);
-
-    /* End user code block <app_procedures> */
-
-    /* Begin user code block <main_loop> */
-    /* End user code block <main_loop> */
-
-    XtAppMainLoop(app);
-
-    /*
-     * A return value regardless of whether or not the main loop ends.
-     */
-     return(0);
-}
diff --git a/src/mbedit/mbedit.h b/src/mbedit/mbedit.h
deleted file mode 100644
index cac1dc9..0000000
--- a/src/mbedit/mbedit.h
+++ /dev/null
@@ -1,507 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbedit.h	10/14/2009
- *    $Id: mbedit.h 2247 2015-05-29 21:28:28Z caress $
- *
- *    Copyright (c) 2009-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * MBEDIT is an interactive beam editor for multibeam bathymetry data.
- * It can work with any data format supported by the MBIO library.
- * This version uses the MOTIF toolkit and has been developed using
- * the Builder Xsessory package by ICS.  This file contains
- * contains function prototypes and was added in 2009.
- *
- * Author:	D. W. Caress
- * Date:	October 14, 2009
- *
- * $Log: $
- *
- *
- */
-
-/*--------------------------------------------------------------------*/
-
-/* function prototypes */
-int mbedit_init(int argc, char ** argv, int *startup_file);
-int mbedit_set_graphics(void *xgid, int ncol, unsigned int *pixels);
-int mbedit_set_scaling(int *brdr, int sh_time);
-int mbedit_set_filters(int f_m, int f_m_t,
-			int f_m_x, int f_m_l,
-			int f_w, int f_w_t,
-			int f_b, int f_b_b, int f_b_e,
-			int f_d, double f_d_b, double f_d_e,
-			int f_a, double f_a_b, double f_a_e);
-int mbedit_get_filters( int *b_m, double *d_m,
-			int *f_m, int *f_m_t,
-			int *f_m_x, int *f_m_l,
-			int *f_w, int *f_w_t,
-			int *f_b, int *f_b_b, int *f_b_e,
-			int *f_d, double *f_d_b, double *f_d_e,
-			int *f_a, double *f_a_b, double *f_a_e);
-int mbedit_get_defaults(
-		int	*plt_size_max,
-		int	*plt_size,
-		int	*sh_dtcts,
-		int	*sh_flggd,
-		int	*sh_time,
-		int	*buffer_size_max,
-		int	*buffer_size,
-		int	*hold_size,
-		int	*form,
-		int	*plwd,
-		int	*exgr,
-		int	*xntrvl,
-		int	*yntrvl,
-		int	*ttime_i,
-		int	*outmode);
-int mbedit_get_viewmode(int *vw_mode);
-int mbedit_set_viewmode(int vw_mode);
-int mbedit_action_open(
-		char	*file,
-		int	form,
-		int	fileid,
-		int	numfiles,
-		int	savemode,
-		int	outmode,
-		int	plwd,
-		int	exgr,
-		int	xntrvl,
-		int	yntrvl,
-		int	plt_size,
-		int	sh_dtcts,
-		int	sh_flggd,
-		int	sh_time,
-		int	*buffer_size,
-		int	*buffer_size_max,
-		int	*hold_size,
-		int	*ndumped,
-		int	*nloaded,
-		int	*nbuffer,
-		int	*ngood,
-		int	*icurrent,
-		int	*nplt);
-int mbedit_action_next_buffer(
-		int	hold_size,
-		int	buffer_size,
-		int	plwd,
-		int	exgr,
-		int	xntrvl,
-		int	yntrvl,
-		int	plt_size,
-		int	sh_dtcts,
-		int	sh_flggd,
-		int	sh_time,
-		int	*ndumped,
-		int	*nloaded,
-		int	*nbuffer,
-		int	*ngood,
-		int	*icurrent,
-		int	*nplt,
-		int	*quit);
-int mbedit_action_close(
-		int	buffer_size,
-		int	*ndumped,
-		int	*nloaded,
-		int	*nbuffer,
-		int	*ngood,
-		int	*icurrent);
-int mbedit_action_done(
-		int	buffer_size,
-		int	*ndumped,
-		int	*nloaded,
-		int	*nbuffer,
-		int	*ngood,
-		int	*icurrent,
-		int	*quit);
-int mbedit_action_quit(
-		int	buffer_size,
-		int	*ndumped,
-		int	*nloaded,
-		int	*nbuffer,
-		int	*ngood,
-		int	*icurrent);
-int mbedit_action_step(
-		int	step,
-		int	plwd,
-		int	exgr,
-		int	xntrvl,
-		int	yntrvl,
-		int	plt_size,
-		int	sh_dtcts,
-		int	sh_flggd,
-		int	sh_time,
-		int	*nbuffer,
-		int	*ngood,
-		int	*icurrent,
-		int	*nplt);
-int mbedit_action_plot(
-		int	plwd,
-		int	exgr,
-		int	xntrvl,
-		int	yntrvl,
-		int	plt_size,
-		int	sh_dtcts,
-		int	sh_flggd,
-		int	sh_time,
-		int	*nbuffer,
-		int	*ngood,
-		int	*icurrent,
-		int	*nplt);
-int mbedit_action_mouse_toggle(
-		int	x_loc,
-		int	y_loc,
-		int	plwd,
-		int	exgr,
-		int	xntrvl,
-		int	yntrvl,
-		int	plt_size,
-		int	sh_dtcts,
-		int	sh_flggd,
-		int	sh_time,
-		int	*nbuffer,
-		int	*ngood,
-		int	*icurrent,
-		int	*nplt);
-int mbedit_action_mouse_pick(
-	int	x_loc,
-	int	y_loc,
-	int	plwd,
-	int	exgr,
-	int	xntrvl,
-	int	yntrvl,
-	int	plt_size,
-	int	sh_dtcts,
-	int	sh_flggd,
-	int	sh_time,
-	int	*nbuffer,
-	int	*ngood,
-	int	*icurrent,
-	int	*nplt);
-int mbedit_action_mouse_erase(
-		int	x_loc,
-		int	y_loc,
-		int	plwd,
-		int	exgr,
-		int	xntrvl,
-		int	yntrvl,
-		int	plt_size,
-		int	sh_dtcts,
-		int	sh_flggd,
-		int	sh_time,
-		int	*nbuffer,
-		int	*ngood,
-		int	*icurrent,
-		int	*nplt);
-int mbedit_action_mouse_restore(
-		int	x_loc,
-		int	y_loc,
-		int	plwd,
-		int	exgr,
-		int	xntrvl,
-		int	yntrvl,
-		int	plt_size,
-		int	sh_dtcts,
-		int	sh_flggd,
-		int	sh_time,
-		int	*nbuffer,
-		int	*ngood,
-		int	*icurrent,
-		int	*nplt);
-int mbedit_action_mouse_grab(
-		int	grabmode,
-		int	x_loc,
-		int	y_loc,
-		int	plwd,
-		int	exgr,
-		int	xntrvl,
-		int	yntrvl,
-		int	plt_size,
-		int	sh_dtcts,
-		int	sh_flggd,
-		int	sh_time,
-		int	*nbuffer,
-		int	*ngood,
-		int	*icurrent,
-		int	*nplt);
-int mbedit_action_mouse_info(
-		int	x_loc,
-		int	y_loc,
-		int	plwd,
-		int	exgr,
-		int	xntrvl,
-		int	yntrvl,
-		int	plt_size,
-		int	sh_dtcts,
-		int	sh_flggd,
-		int	sh_time,
-		int	*nbuffer,
-		int	*ngood,
-		int	*icurrent,
-		int	*nplt);
-int mbedit_action_zap_outbounds(
-		int	iping,
-		int	plwd,
-		int	exgr,
-		int	xntrvl,
-		int	yntrvl,
-		int	plt_size,
-		int	sh_dtcts,
-		int	sh_flggd,
-		int	sh_time,
-		int	*nbuffer,
-		int	*ngood,
-		int	*icurrent,
-		int	*nplt);
-int mbedit_action_bad_ping(
-		int	plwd,
-		int	exgr,
-		int	xntrvl,
-		int	yntrvl,
-		int	plt_size,
-		int	sh_dtcts,
-		int	sh_flggd,
-		int	sh_time,
-		int	*nbuffer,
-		int	*ngood,
-		int	*icurrent,
-		int	*nplt);
-int mbedit_action_good_ping(
-		int	plwd,
-		int	exgr,
-		int	xntrvl,
-		int	yntrvl,
-		int	plt_size,
-		int	sh_dtcts,
-		int	sh_flggd,
-		int	sh_time,
-		int	*nbuffer,
-		int	*ngood,
-		int	*icurrent,
-		int	*nplt);
-int mbedit_action_left_ping(
-		int	plwd,
-		int	exgr,
-		int	xntrvl,
-		int	yntrvl,
-		int	plt_size,
-		int	sh_dtcts,
-		int	sh_flggd,
-		int	sh_time,
-		int	*nbuffer,
-		int	*ngood,
-		int	*icurrent,
-		int	*nplt);
-int mbedit_action_right_ping(
-		int	plwd,
-		int	exgr,
-		int	xntrvl,
-		int	yntrvl,
-		int	plt_size,
-		int	sh_dtcts,
-		int	sh_flggd,
-		int	sh_time,
-		int	*nbuffer,
-		int	*ngood,
-		int	*icurrent,
-		int	*nplt);
-int mbedit_action_zero_ping(
-		int	plwd,
-		int	exgr,
-		int	xntrvl,
-		int	yntrvl,
-		int	plt_size,
-		int	sh_dtcts,
-		int	sh_flggd,
-		int	sh_time,
-		int	*nbuffer,
-		int	*ngood,
-		int	*icurrent,
-		int	*nplt);
-int mbedit_action_flag_view(
-		int	plwd,
-		int	exgr,
-		int	xntrvl,
-		int	yntrvl,
-		int	plt_size,
-		int	sh_dtcts,
-		int	sh_flggd,
-		int	sh_time,
-		int	*nbuffer,
-		int	*ngood,
-		int	*icurrent,
-		int	*nplt);
-int mbedit_action_unflag_view(
-		int	plwd,
-		int	exgr,
-		int	xntrvl,
-		int	yntrvl,
-		int	plt_size,
-		int	sh_dtcts,
-		int	sh_flggd,
-		int	sh_time,
-		int	*nbuffer,
-		int	*ngood,
-		int	*icurrent,
-		int	*nplt);
-int mbedit_action_unflag_all(
-		int	plwd,
-		int	exgr,
-		int	xntrvl,
-		int	yntrvl,
-		int	plt_size,
-		int	sh_dtcts,
-		int	sh_flggd,
-		int	sh_time,
-		int	*nbuffer,
-		int	*ngood,
-		int	*icurrent,
-		int	*nplt);
-int mbedit_action_filter_all(
-		int	plwd,
-		int	exgr,
-		int	xntrvl,
-		int	yntrvl,
-		int	plt_size,
-		int	sh_dtcts,
-		int	sh_flggd,
-		int	sh_time,
-		int	*nbuffer,
-		int	*ngood,
-		int	*icurrent,
-		int	*nplt);
-int mbedit_filter_ping(int iping);
-int mbedit_get_format(char *file, int *form);
-int mbedit_open_file(char *file, int form, int savemode);
-int mbedit_close_file(void);
-int mbedit_dump_data(int hold_size, int *ndumped, int *nbuffer);
-int mbedit_load_data(int buffer_size,
-		int *nloaded, int *nbuffer, int *ngood, int *icurrent);
-int mbedit_clear_screen(void);
-int mbedit_plot_all(
-		int	plwd,
-		int	exgr,
-		int	xntrvl,
-		int	yntrvl,
-		int	plt_size,
-		int	sh_dtcts,
-		int	sh_flggd,
-		int	sh_time,
-		int	*nplt,
-		int	autoscale);
-int mbedit_plot_beam(int iping, int jbeam);
-int mbedit_plot_ping(int iping);
-int mbedit_plot_ping_label(int iping, int save);
-int mbedit_plot_info(void);
-int mbedit_unplot_beam(int iping, int jbeam);
-int mbedit_unplot_ping(int iping);
-int mbedit_unplot_info(void);
-int mbedit_action_goto(
-		int	ttime_i[7],
-		int	hold_size,
-		int	buffer_size,
-		int	plwd,
-		int	exgr,
-		int	xntrvl,
-		int	yntrvl,
-		int	plt_size,
-		int	sh_dtcts,
-		int	sh_flggd,
-		int	sh_time,
-		int	*ndumped,
-		int	*nloaded,
-		int	*nbuffer,
-		int	*ngood,
-		int	*icurrent,
-		int	*nplt);
-int mbedit_tslabel(int data_id, char *label);
-int mbedit_tsvalue(int iping, int data_id, double *value);
-int mbedit_tsminmax(int iping, int nping, int data_id, double *tsmin, double *tsmax);
-int mbedit_xtrackslope(int iping, double *slope);
-
-void do_mbedit_init(int argc, char **argv);
-void do_parse_datalist( char *file, int form);
-void do_editlistselection( Widget w, XtPointer client_data, XtPointer call_data);
-void do_filelist_remove( Widget w, XtPointer client_data, XtPointer call_data);
-void do_load_specific_file(int i_file);
-int do_setup_data(void);
-void do_build_filelist(void);
-void do_get_filters(void);
-void do_file_selection_cancel( Widget w, XtPointer client_data, XtPointer call_data);
-void do_expose( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mode_toggle( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mode_pick( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mode_erase( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mode_restore( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mode_grab( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mode_info( Widget w, XtPointer client_data, XtPointer call_data);
-void do_scale_y( Widget w, XtPointer client_data, XtPointer call_data);
-void do_fileselection_list( Widget w, XtPointer client_data, XtPointer call_data);
-void do_scale_x( Widget w, XtPointer client_data, XtPointer call_data);
-int do_reset_scale_x(int pwidth, int maxx, int xntrvl, int yntrvl);
-void do_output_edit( Widget w, XtPointer client_data, XtPointer call_data);
-void do_output_browse( Widget w, XtPointer client_data, XtPointer call_data);
-void do_output_edit_filelist( Widget w, XtPointer client_data, XtPointer call_data);
-void do_output_browse_filelist( Widget w, XtPointer client_data, XtPointer call_data);
-void do_x_interval( Widget w, XtPointer client_data, XtPointer call_data);
-void do_y_interval( Widget w, XtPointer client_data, XtPointer call_data);
-void do_load(int save_mode);
-void do_load_ok( Widget w, XtPointer client_data, XtPointer call_data);
-void do_load_ok_with_save( Widget w, XtPointer client_data, XtPointer call_data);
-void do_load_check( Widget w, XtPointer client_data, XtPointer call_data);
-void do_checkuseprevious(void);
-void do_filebutton_on(void);
-void do_filebutton_off(void);
-void do_nextbutton_on(void);
-void do_nextbutton_off(void);
-void do_end( Widget w, XtPointer client_data, XtPointer call_data);
-void do_forward( Widget w, XtPointer client_data, XtPointer call_data);
-void do_reverse( Widget w, XtPointer client_data, XtPointer call_data);
-void do_start( Widget w, XtPointer client_data, XtPointer call_data);
-void do_quit( Widget w, XtPointer client_data, XtPointer call_data);
-void do_event( Widget w, XtPointer client_data, XtPointer call_data);
-void do_flag_view( Widget w, XtPointer client_data, XtPointer call_data);
-void do_unflag_view( Widget w, XtPointer client_data, XtPointer call_data);
-void do_unflag_all( Widget w, XtPointer client_data, XtPointer call_data);
-void do_next_buffer( Widget w, XtPointer client_data, XtPointer call_data);
-void do_number_step( Widget w, XtPointer client_data, XtPointer call_data);
-void do_show_flagged( Widget w, XtPointer client_data, XtPointer call_data);
-void do_view_mode( Widget w, XtPointer client_data, XtPointer call_data);
-void do_show_time( Widget w, XtPointer client_data, XtPointer call_data);
-void do_reverse_mouse( Widget w, XtPointer client_data, XtPointer call_data);
-void do_reverse_keys( Widget w, XtPointer client_data, XtPointer call_data);
-void do_show_flags( Widget w, XtPointer client_data, XtPointer call_data);
-void do_show_detects( Widget w, XtPointer client_data, XtPointer call_data);
-void do_show_pulsetypes( Widget w, XtPointer client_data, XtPointer call_data);
-void do_buffer_hold( Widget w, XtPointer client_data, XtPointer call_data);
-void do_buffer_size( Widget w, XtPointer client_data, XtPointer call_data);
-void do_done( Widget w, XtPointer client_data, XtPointer call_data);
-void do_number_pings( Widget w, XtPointer client_data, XtPointer call_data);
-void do_goto_apply( Widget w, XtPointer client_data, XtPointer call_data);
-void do_set_filters( Widget w, XtPointer client_data, XtPointer call_data);
-void do_reset_filters( Widget w, XtPointer client_data, XtPointer call_data);
-void do_check_median_xtrack( Widget w, XtPointer client_data, XtPointer call_data);
-void do_check_median_ltrack( Widget w, XtPointer client_data, XtPointer call_data);
-int do_wait_until_viewed(XtAppContext app);
-int do_mbedit_settimer(void);
-int do_mbedit_workfunction(XtPointer client_data);
-int do_message_on(char *message);
-int do_message_off(void);
-int do_error_dialog(char *s1, char *s2, char *s3);
-void set_label_string(Widget w, String str);
-void set_label_multiline_string(Widget w, String str);
-void get_text_string(Widget w, String str);
-
-void BxUnmanageCB(Widget w, XtPointer client, XtPointer call);
-void BxManageCB(Widget w, XtPointer client, XtPointer call);
-void BxPopupCB(Widget w, XtPointer client, XtPointer call);
-XtPointer BX_CONVERT(Widget w, char *from_string, char *to_type, int to_size, Boolean *success);
-
-/*--------------------------------------------------------------------*/
diff --git a/src/mbedit/mbedit.uil b/src/mbedit/mbedit.uil
deleted file mode 100644
index 08b6396..0000000
--- a/src/mbedit/mbedit.uil
+++ /dev/null
@@ -1,4378 +0,0 @@
-/*
- * Generated by the ICS builderXcessory (BX).
- *
- *
- * BuilderXcessory Version 6.1.3.
- *
- * Identification: 
- */
-module main_uil
-version = 'V2.1'
-names = case_sensitive
-!(BX) bx_info("c_options", "")
-!(BX) bx_info("c_libs", "-lGLw -lSgm -lXm -lXt -lGL -lXext -lX11 -lgen -lm")
-!(BX) bx_info("c_cflags", "-Aa -I/usr/include/Motif1.2 -I/usr/include/X11R5")
-!(BX) bx_info("c_cc", "cc")
-!(BX) bx_info("c_excludeungenerated", "false")
-!(BX) bx_info("c_target", "main-c")
-!(BX) bx_info("c_information", "")
-!(BX) bx_info("c_user_main_loop", "", false)
-!(BX) bx_info("c_ignore_shell_geometry", "false")
-!(BX) bx_info("c_visible_windows_only", "false")
-!(BX) bx_info("c_rm_exp_callbacks", "false")
-!(BX) bx_info("c_reverse_dialogs", "true")
-!(BX) bx_info("c_dialogs_in_routine", "true")
-!(BX) bx_info("c_unmanage_dialogs", "true")
-!(BX) bx_info("c_use_locales", "false")
-!(BX) bx_info("c_ansi", "true")
-!(BX) bx_info("c_name", "mbedit")
-!(BX) bx_info("c_class", "mbedit")
-!(BX) bx_info("c_app_defaults", "mbedit", true)
-!(BX) bx_info("c_utilities", "mbedit_bxutils.c", true)
-!(BX) bx_info("c_constants", "mbedit_creation.h", true)
-!(BX) bx_info("c_callbacks", "mbedit_callbacks.c", true)
-!(BX) bx_info("c_creation", "mbedit_creation.c", true)
-!(BX) bx_info("c_main", "mbedit.c", true)
-!(BX) bx_info("c_acinclude_m4", "acinclude.m4", false)
-!(BX) bx_info("c_configure_in", "configure.in", false)
-!(BX) bx_info("c_makefile_am", "Makefile.am", false)
-!(BX) bx_info("c_cvsmake", "CVSMake", false)
-!(BX) bx_info("c_makefile", "Makefile.org", true)
-!(BX) bx_info("c_imakefile", "Imakefile", true)
-!(BX) bx_info("c_dirpath", "")
-!(BX) bx_info("include_path", ".", false)
-!(BX) bx_info("xrunner_command", "$(M_ROOT)/arch/X11.5/Xm1.2/mic_xm.o", false)
-!(BX) bx_info("system_directory", "/opt/bx-6.1")
-!(BX) bx_info("builder_version", "BuilderXcessory Version 6.1.3")
-!(BX) bx_info("build_lang", "C")
-!(BX) bx_info("default_cpp_args", "")
-!(BX) bx_info("new_mrm_style", "true")
-!(BX) bx_info("c_wrap_lines", "false")
-!(BX) bx_info("uil_wrap_lines", "true")
-!(BX) bx_info("integrate_purify", "false")
-!(BX) bx_info("purify_command", "purify")
-!(BX) bx_info("integrate_xrunner", "false")
-
-procedure BxGlobalWidgetId;
-identifier BXG_pushButton_file;
-identifier BXG_pushButton_end;
-identifier BXG_pushButton_start;
-identifier BXG_toggleButton_show_heave;
-identifier BXG_toggleButton_show_pitch;
-identifier BXG_toggleButton_show_roll;
-identifier BXG_toggleButton_show_sonardepth;
-identifier BXG_toggleButton_show_altitude;
-identifier BXG_toggleButton_show_depth;
-identifier BXG_toggleButton_show_speed;
-identifier BXG_toggleButton_show_heading;
-identifier BXG_toggleButton_show_latitude;
-identifier BXG_toggleButton_show_lon;
-identifier BXG_toggleButton_show_interval;
-identifier BXG_toggleButton_show_time;
-identifier BXG_toggleButton_show_wideplot;
-identifier BXG_toggleButton_show_pulsetypes;
-identifier BXG_toggleButton_show_detects;
-identifier BXG_toggleButton_show_flags;
-identifier BXG_toggleButton_show_flagged_on;
-identifier BXG_toggleButton_view_acrosstrack;
-identifier BXG_toggleButton_view_alongtrack;
-identifier BXG_toggleButton_view_waterfall;
-identifier BXG_toggleButton_reverse_mouse;
-identifier BXG_toggleButton_reverse_keys;
-identifier BXG_pushButton_next;
-identifier BXG_pushButton_done;
-identifier BXG_pushButton_forward;
-identifier BXG_pushButton_reverse;
-identifier BXG_slider_scale_x_label;
-identifier BXG_slider_scale_x;
-identifier BXG_slider_scale_x_max_label;
-identifier BXG_slider_scale_y_label;
-identifier BXG_slider_scale_y;
-identifier BXG_slider_scale_y_max_label;
-identifier BXG_slider_number_pings_label;
-identifier BXG_slider_number_pings;
-identifier BXG_slider_num_pings_max_label;
-identifier BXG_slider_number_step_label;
-identifier BXG_slider_number_step;
-identifier BXG_slider_number_max_step_label;
-identifier BXG_setting_mode_toggle_info;
-identifier BXG_setting_mode_toggle_grab;
-identifier BXG_setting_mode_toggle_restore;
-identifier BXG_setting_mode_toggle_erase;
-identifier BXG_setting_mode_toggle_pick;
-identifier BXG_setting_mode_toggle_toggle;
-identifier BXG_canvas_mbedit;
-identifier BXG_fileSelectionBox;
-identifier BXG_textfield_format_label;
-identifier BXG_textfield_format;
-identifier BXG_setting_output_label;
-identifier BXG_setting_output_toggle_browse;
-identifier BXG_setting_output_toggle_edit;
-identifier BXG_setting_output;
-identifier BXG_textfield_day;
-identifier BXG_textfield_second;
-identifier BXG_textfield_minute;
-identifier BXG_textfield_hour;
-identifier BXG_textfield_month;
-identifier BXG_textfield_year;
-identifier BXG_label_about_version;
-identifier BXG_label_message;
-identifier BXG_bulletinBoard_message;
-identifier BXG_bulletinBoard_editsave;
-identifier BXG_label_error_two;
-identifier BXG_label_error_one;
-identifier BXG_label_error_three;
-identifier BXG_bulletinBoard_error;
-identifier BXG_slider_buffer_hold_max_label;
-identifier BXG_slider_buffer_hold;
-identifier BXG_slider_buffer_hold_label;
-identifier BXG_slider_buffer_size_max_label;
-identifier BXG_slider_buffer_size;
-identifier BXG_slider_buffer_size_label;
-identifier BXG_slider_y_max_interval_label;
-identifier BXG_slider_y_interval;
-identifier BXG_slider_y_interval_label;
-identifier BXG_slider_x_max_interval_label;
-identifier BXG_slider_x_interval;
-identifier BXG_slider_x_interval_label;
-identifier BXG_radioBox_mediancalc;
-identifier BXG_scale_median_local_ltrack;
-identifier BXG_scale_median_local_xtrack;
-identifier BXG_scale_filters_cutangleend;
-identifier BXG_scale_filters_cutanglestart;
-identifier BXG_toggleButton_filters_cutangle;
-identifier BXG_scale_filters_cutdistanceend;
-identifier BXG_scale_filters_cutdistancestart;
-identifier BXG_toggleButton_filters_cutdistance;
-identifier BXG_scale_filters_cutbeamend;
-identifier BXG_scale_filters_cutbeamstart;
-identifier BXG_toggleButton_filters_cutbeam;
-identifier BXG_scale_filters_wrongside;
-identifier BXG_toggleButton_filters_wrongside;
-identifier BXG_scale_filters_medianspike;
-identifier BXG_toggleButton_filters_medianspike;
-identifier BXG_setting_output_toggle_browse_filelist;
-identifier BXG_setting_output_toggle_edit_filelist;
-identifier BXG_setting_output_filelist;
-identifier BXG_list_filelist;
-identifier BXG_window_mbedit;
-procedure BxManageCB(string);
-procedure BxUnmanageCB(string);
-procedure do_buffer_hold();
-procedure do_buffer_size();
-procedure do_check_median_ltrack();
-procedure do_check_median_xtrack();
-procedure do_done();
-procedure do_editlistselection();
-procedure do_end();
-procedure do_event();
-procedure do_expose();
-procedure do_filelist_remove();
-procedure do_flag_view();
-procedure do_forward();
-procedure do_goto_apply();
-procedure do_load_check();
-procedure do_load_ok();
-procedure do_load_ok_with_save();
-procedure do_mode_erase();
-procedure do_mode_grab();
-procedure do_mode_info();
-procedure do_mode_pick();
-procedure do_mode_restore();
-procedure do_mode_toggle();
-procedure do_next_buffer();
-procedure do_number_pings();
-procedure do_number_step();
-procedure do_output_browse();
-procedure do_output_browse_filelist();
-procedure do_output_edit();
-procedure do_output_edit_filelist();
-procedure do_quit();
-procedure do_reset_filters();
-procedure do_reverse();
-procedure do_reverse_keys();
-procedure do_reverse_mouse();
-procedure do_scale_x();
-procedure do_scale_y();
-procedure do_set_filters();
-procedure do_show_detects();
-procedure do_show_flagged();
-procedure do_show_flags();
-procedure do_show_pulsetypes();
-procedure do_show_time();
-procedure do_start();
-procedure do_unflag_all();
-procedure do_unflag_view();
-procedure do_view_mode();
-procedure do_x_interval();
-procedure do_y_interval();
-
-list BaseStyle : arguments {
-};
-
-list BaseStyleReasons : callbacks {
-};
-
-!(BX)list BaseStyleHandlers : handlers {
-!(BX)};
-
-list Style_use : arguments {
-        arguments BaseStyle;
-        XmNfontList = font_table(
-		font('-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1'));
-};
-
-list Style_useReasons : callbacks {
-        callbacks BaseStyleReasons;
-};
-
-!(BX)list Style_useHandlers : handlers {
-!(BX)    handlers BaseStyleHandlers;
-!(BX)};
-
-
-object list_filelist : XmList widget {
-    arguments {
-        arguments Style_use;
-        XmNfontList = font_table(
-		font('-*-courier-*-r-*-*-*-90-*-*-*-*-iso8859-1'));
-        XmNselectionPolicy = XmSINGLE_SELECT;
-        XmNwidth = 339;
-        XmNheight = 450;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_list_filelist);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object scrolledWindow_filelist : XmScrolledWindow widget {
-    arguments {
-        arguments Style_use;
-        XmNscrollingPolicy = XmAPPLICATION_DEFINED;
-        XmNtopAttachment = XmATTACH_WIDGET;
-        XmNrightAttachment = XmATTACH_FORM;
-        XmNleftAttachment = XmATTACH_FORM;
-        XmNbottomAttachment = XmATTACH_WIDGET;
-        XmNbottomOffset = 10;
-        XmNbottomWidget = XmPushButton pushButton_filelist_remove;
-        XmNleftOffset = 0;
-        XmNrightOffset = 4;
-        XmNtopOffset = 6;
-        XmNtopWidget = XmRowColumn setting_output_filelist;
-        XmNx = 0;
-        XmNy = 50;
-        XmNwidth = 339;
-        XmNheight = 450;
-    };
-    controls {
-         managed XmList list_filelist;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object pushButton_filelist_dismiss : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Dismiss");
-        XmNrecomputeSize = false;
-        XmNtopAttachment = XmATTACH_NONE;
-        XmNrightAttachment = XmATTACH_FORM;
-        XmNleftAttachment = XmATTACH_NONE;
-        XmNbottomAttachment = XmATTACH_FORM;
-        XmNbottomOffset = 10;
-        XmNrightOffset = 13;
-        XmNx = 250;
-        XmNy = 510;
-        XmNwidth = 80;
-        XmNheight = 60;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNactivateCallback = procedure BxUnmanageCB("form_filelist");
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object setting_output_toggle_edit_filelist : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Output Edits");
-        XmNwidth = 116;
-        XmNheight = 28;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_setting_output_toggle_edit_filelist);
-        XmNvalueChangedCallback = procedure do_output_edit_filelist();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object setting_output_toggle_browse_filelist : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Browse Only");
-        XmNwidth = 116;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_setting_output_toggle_browse_filelist);
-        XmNvalueChangedCallback = procedure do_output_browse_filelist();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object setting_output_filelist : XmRowColumn widget {
-    arguments {
-        arguments Style_use;
-        XmNnumColumns = 1;
-        XmNpacking = XmPACK_COLUMN;
-        XmNradioBehavior = true;
-        XmNspacing = 0;
-        XmNorientation = XmHORIZONTAL;
-        XmNtopAttachment = XmATTACH_FORM;
-        XmNrightAttachment = XmATTACH_NONE;
-        XmNleftAttachment = XmATTACH_WIDGET;
-        XmNbottomAttachment = XmATTACH_NONE;
-        XmNbottomOffset = 0;
-        XmNleftOffset = 3;
-        XmNtopOffset = 10;
-        XmNleftWidget = XmLabel setting_output_label_filelist;
-        XmNx = 110;
-        XmNy = 10;
-        XmNwidth = 238;
-        XmNheight = 34;
-    };
-    controls {
-         managed XmToggleButton setting_output_toggle_edit_filelist;
-         managed XmToggleButton setting_output_toggle_browse_filelist;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_setting_output_filelist);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object setting_output_label_filelist : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Output Mode:");
-        XmNmarginWidth = 0;
-        XmNrightAttachment = XmATTACH_NONE;
-        XmNleftAttachment = XmATTACH_FORM;
-        XmNleftOffset = 10;
-        XmNtopOffset = 10;
-        XmNx = 10;
-        XmNy = 10;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object pushButton_filelist_edit : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Edit", separate=true) &
- compound_string("Selected", separate=true) &
- compound_string("File");
-        XmNrecomputeSize = false;
-        XmNtopAttachment = XmATTACH_NONE;
-        XmNleftAttachment = XmATTACH_FORM;
-        XmNbottomAttachment = XmATTACH_FORM;
-        XmNbottomOffset = 10;
-        XmNleftOffset = 10;
-        XmNx = 10;
-        XmNy = 510;
-        XmNwidth = 90;
-        XmNheight = 60;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNactivateCallback = procedure do_editlistselection();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object pushButton_filelist_remove : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Remove", separate=true) &
- compound_string("Selected", separate=true) &
- compound_string("File");
-        XmNrecomputeSize = false;
-        XmNtopAttachment = XmATTACH_NONE;
-        XmNrightAttachment = XmATTACH_NONE;
-        XmNleftAttachment = XmATTACH_WIDGET;
-        XmNbottomAttachment = XmATTACH_FORM;
-        XmNbottomOffset = 10;
-        XmNleftOffset = 10;
-        XmNleftWidget = XmPushButton pushButton_filelist_edit;
-        XmNx = 110;
-        XmNy = 510;
-        XmNwidth = 104;
-        XmNheight = 60;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNactivateCallback = procedure do_filelist_remove();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object form_filelist : XmFormDialog widget {
-    arguments {
-        arguments Style_use;
-        XmNdialogTitle = compound_string("Files Available for Editing");
-        XmNautoUnmanage = false;
-        XmNresizePolicy = XmRESIZE_GROW;
-        XmNx = 167;
-        XmNy = 1022;
-        XmNwidth = 343;
-        XmNheight = 580;
-    };
-    controls {
-         managed XmPushButton pushButton_filelist_remove;
-         managed XmPushButton pushButton_filelist_edit;
-         managed XmLabel setting_output_label_filelist;
-         managed XmRowColumn setting_output_filelist;
-         managed XmPushButton pushButton_filelist_dismiss;
-         managed XmScrolledWindow scrolledWindow_filelist;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-!(BX)object dialogShell_filelist : XmDialogShell widget {
-!(BX)    arguments {
-!(BX)        arguments Style_use;
-!(BX)        XmNwidth = 343;
-!(BX)        XmNheight = 580;
-!(BX)    };
-!(BX)    controls {
-!(BX)         managed XmFormDialog form_filelist;
-!(BX)    };
-!(BX)    callbacks {
-!(BX)        callbacks Style_useReasons;
-!(BX)    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-!(BX)};
-
-object pushButton_filters_dismiss : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Dismiss");
-        XmNx = 270;
-        XmNy = 250;
-        XmNwidth = 90;
-        XmNheight = 40;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNactivateCallback = procedure BxUnmanageCB("bulletinBoard_filters");
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object pushButton_filters_apply : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Apply");
-        XmNx = 50;
-        XmNy = 250;
-        XmNwidth = 90;
-        XmNheight = 40;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNactivateCallback = procedure do_set_filters();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object pushButton_filters_reset : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Reset");
-        XmNx = 160;
-        XmNy = 250;
-        XmNwidth = 90;
-        XmNheight = 40;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNactivateCallback = procedure do_reset_filters();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object toggleButton_filters_medianspike : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNlabelString = compound_string("Median", separate=true) &
- compound_string("Spike", separate=true) &
- compound_string("Filter");
-        XmNx = 10;
-        XmNy = 20;
-        XmNwidth = 90;
-        XmNheight = 60;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_toggleButton_filters_medianspike);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object scale_filters_medianspike : XmScale widget {
-    arguments {
-        arguments Style_use;
-        XmNminimum = 1;
-        XmNdecimalPoints = 0;
-        XmNvalue = 10;
-        XmNtitleString = compound_string("% Median Depth Threshold ");
-        XmNshowArrows = TRUE;
-        XmNshowValue = TRUE;
-        XmNorientation = XmHORIZONTAL;
-        XmNx = 100;
-        XmNy = 10;
-        XmNwidth = 260;
-        XmNheight = 63;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_scale_filters_medianspike);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object toggleButton_filters_wrongside : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNlabelString = compound_string("Wrong", separate=true) &
- compound_string("Side", separate=true) &
- compound_string("Filter");
-        XmNx = 10;
-        XmNy = 680;
-        XmNwidth = 90;
-        XmNheight = 60;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_toggleButton_filters_wrongside);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object scale_filters_wrongside : XmScale widget {
-    arguments {
-        arguments Style_use;
-        XmNvalue = 10;
-        XmNtitleString = compound_string("Beams from Center Threshold");
-        XmNmaximum = 100;
-        XmNshowArrows = TRUE;
-        XmNshowValue = TRUE;
-        XmNorientation = XmHORIZONTAL;
-        XmNx = 100;
-        XmNy = 670;
-        XmNwidth = 260;
-        XmNheight = 63;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_scale_filters_wrongside);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object separator3 : XmSeparator widget {
-    arguments {
-        XmNx = 10;
-        XmNy = 360;
-        XmNwidth = 350;
-        XmNheight = 20;
-    };
-    controls {
-    };
-    callbacks {
-    };
-};
-
-object toggleButton_filters_cutbeam : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNlabelString = compound_string("Flag by", separate=true) &
- compound_string("Beam", separate=true) &
- compound_string("Number");
-        XmNx = 10;
-        XmNy = 240;
-        XmNwidth = 90;
-        XmNheight = 60;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_toggleButton_filters_cutbeam);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object scale_filters_cutbeamstart : XmScale widget {
-    arguments {
-        arguments Style_use;
-        XmNvalue = 10;
-        XmNtitleString = compound_string("Start Flagging Beam Number");
-        XmNmaximum = 100;
-        XmNshowArrows = TRUE;
-        XmNshowValue = TRUE;
-        XmNorientation = XmHORIZONTAL;
-        XmNx = 100;
-        XmNy = 230;
-        XmNwidth = 260;
-        XmNheight = 63;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_scale_filters_cutbeamstart);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object scale_filters_cutbeamend : XmScale widget {
-    arguments {
-        arguments Style_use;
-        XmNvalue = 10;
-        XmNtitleString = compound_string("End Flagging Beam Number");
-        XmNmaximum = 100;
-        XmNshowArrows = TRUE;
-        XmNshowValue = TRUE;
-        XmNorientation = XmHORIZONTAL;
-        XmNx = 100;
-        XmNy = 290;
-        XmNwidth = 260;
-        XmNheight = 63;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_scale_filters_cutbeamend);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object separator4 : XmSeparator widget {
-    arguments {
-        XmNx = 10;
-        XmNy = 210;
-        XmNwidth = 350;
-        XmNheight = 20;
-    };
-    controls {
-    };
-    callbacks {
-    };
-};
-
-object toggleButton_filters_cutdistance : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNlabelString = compound_string("Flag by", separate=true) &
- compound_string("Distance");
-        XmNx = 10;
-        XmNy = 390;
-        XmNwidth = 90;
-        XmNheight = 40;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_toggleButton_filters_cutdistance);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object scale_filters_cutdistancestart : XmScale widget {
-    arguments {
-        arguments Style_use;
-        XmNdecimalPoints = 2;
-        XmNvalue = 1000;
-        XmNtitleString = compound_string("Start Flagging Distance (m)");
-        XmNmaximum = 10000;
-        XmNshowArrows = TRUE;
-        XmNscaleMultiple = 1;
-        XmNshowValue = TRUE;
-        XmNorientation = XmHORIZONTAL;
-        XmNx = 100;
-        XmNy = 380;
-        XmNwidth = 260;
-        XmNheight = 63;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_scale_filters_cutdistancestart);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object scale_filters_cutdistanceend : XmScale widget {
-    arguments {
-        arguments Style_use;
-        XmNdecimalPoints = 2;
-        XmNvalue = 1000;
-        XmNtitleString = compound_string("End Flagging Distance (m)");
-        XmNmaximum = 10000;
-        XmNshowArrows = TRUE;
-        XmNscaleMultiple = 1;
-        XmNshowValue = TRUE;
-        XmNorientation = XmHORIZONTAL;
-        XmNx = 100;
-        XmNy = 440;
-        XmNwidth = 260;
-        XmNheight = 63;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_scale_filters_cutdistanceend);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object separator5 : XmSeparator widget {
-    arguments {
-        XmNx = 10;
-        XmNy = 500;
-        XmNwidth = 350;
-        XmNheight = 20;
-    };
-    controls {
-    };
-    callbacks {
-    };
-};
-
-object toggleButton_filters_cutangle : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNlabelString = compound_string("Flag by", separate=true) &
- compound_string("Beam", separate=true) &
- compound_string("Angle");
-        XmNx = 10;
-        XmNy = 530;
-        XmNwidth = 80;
-        XmNheight = 60;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_toggleButton_filters_cutangle);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object scale_filters_cutanglestart : XmScale widget {
-    arguments {
-        arguments Style_use;
-        XmNdecimalPoints = 2;
-        XmNvalue = 1000;
-        XmNtitleString = compound_string("Start Flagging Angle (deg)");
-        XmNmaximum = 10000;
-        XmNshowArrows = TRUE;
-        XmNscaleMultiple = 1;
-        XmNshowValue = TRUE;
-        XmNorientation = XmHORIZONTAL;
-        XmNx = 100;
-        XmNy = 520;
-        XmNwidth = 260;
-        XmNheight = 63;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_scale_filters_cutanglestart);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object scale_filters_cutangleend : XmScale widget {
-    arguments {
-        arguments Style_use;
-        XmNdecimalPoints = 2;
-        XmNvalue = 1000;
-        XmNtitleString = compound_string("End Flagging Angle (deg)");
-        XmNmaximum = 10000;
-        XmNshowArrows = TRUE;
-        XmNscaleMultiple = 1;
-        XmNshowValue = TRUE;
-        XmNorientation = XmHORIZONTAL;
-        XmNx = 100;
-        XmNy = 580;
-        XmNwidth = 260;
-        XmNheight = 63;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_scale_filters_cutangleend);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object separator6 : XmSeparator widget {
-    arguments {
-        XmNx = 10;
-        XmNy = 650;
-        XmNwidth = 350;
-        XmNheight = 20;
-    };
-    controls {
-    };
-    callbacks {
-    };
-};
-
-object scale_median_local_xtrack : XmScale widget {
-    arguments {
-        arguments Style_use;
-        XmNminimum = 1;
-        XmNvalue = 5;
-        XmNtitleString = compound_string("Median Acrosstrack Dimension");
-        XmNshowArrows = TRUE;
-        XmNscaleMultiple = 1;
-        XmNshowValue = TRUE;
-        XmNorientation = XmHORIZONTAL;
-        XmNx = 100;
-        XmNy = 80;
-        XmNwidth = 260;
-        XmNheight = 63;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_scale_median_local_xtrack);
-        XmNvalueChangedCallback = procedure do_check_median_xtrack();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object scale_median_local_ltrack : XmScale widget {
-    arguments {
-        arguments Style_use;
-        XmNminimum = 1;
-        XmNvalue = 1;
-        XmNtitleString = compound_string("Median Alongtrack Dimension");
-        XmNmaximum = 20;
-        XmNshowArrows = TRUE;
-        XmNscaleMultiple = 1;
-        XmNshowValue = TRUE;
-        XmNorientation = XmHORIZONTAL;
-        XmNx = 100;
-        XmNy = 140;
-        XmNwidth = 260;
-        XmNheight = 63;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_scale_median_local_ltrack);
-        XmNvalueChangedCallback = procedure do_check_median_ltrack();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object radioBox_mediancalc : XmRadioBox widget {
-    arguments {
-        arguments Style_use;
-        XmNx = 90;
-        XmNy = 70;
-        XmNwidth = 16;
-        XmNheight = 16;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_radioBox_mediancalc);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object bulletinBoard_scrollfilters : XmBulletinBoard widget {
-    arguments {
-        arguments Style_use;
-        XmNresizePolicy = XmRESIZE_GROW;
-        XmNwidth = 375;
-        XmNheight = 810;
-    };
-    controls {
-         managed XmRadioBox radioBox_mediancalc;
-         managed XmScale scale_median_local_ltrack;
-         managed XmScale scale_median_local_xtrack;
-         managed XmSeparator separator6;
-         managed XmScale scale_filters_cutangleend;
-         managed XmScale scale_filters_cutanglestart;
-         managed XmToggleButton toggleButton_filters_cutangle;
-         managed XmSeparator separator5;
-         managed XmScale scale_filters_cutdistanceend;
-         managed XmScale scale_filters_cutdistancestart;
-         managed XmToggleButton toggleButton_filters_cutdistance;
-         managed XmSeparator separator4;
-         managed XmScale scale_filters_cutbeamend;
-         managed XmScale scale_filters_cutbeamstart;
-         managed XmToggleButton toggleButton_filters_cutbeam;
-         managed XmSeparator separator3;
-         managed XmScale scale_filters_wrongside;
-         managed XmToggleButton toggleButton_filters_wrongside;
-         managed XmScale scale_filters_medianspike;
-         managed XmToggleButton toggleButton_filters_medianspike;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object scrolledWindow_filters : XmScrolledWindow widget {
-    arguments {
-        arguments Style_use;
-        XmNscrollingPolicy = XmAUTOMATIC;
-        XmNx = 10;
-        XmNy = 10;
-        XmNwidth = 410;
-        XmNheight = 230;
-    };
-    controls {
-         managed XmBulletinBoard bulletinBoard_scrollfilters;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object bulletinBoard_filters : XmBulletinBoardDialog widget {
-    arguments {
-        arguments Style_use;
-        XmNautoUnmanage = false;
-        XmNresizePolicy = XmRESIZE_GROW;
-        XmNx = 0;
-        XmNy = 1181;
-        XmNwidth = 430;
-        XmNheight = 311;
-    };
-    controls {
-         managed XmScrolledWindow scrolledWindow_filters;
-         managed XmPushButton pushButton_filters_reset;
-         managed XmPushButton pushButton_filters_apply;
-         managed XmPushButton pushButton_filters_dismiss;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-!(BX)object dialogShell_filters : XmDialogShell widget {
-!(BX)    arguments {
-!(BX)        XmNtitle = "Filters";
-!(BX)        XmNwidth = 430;
-!(BX)        XmNheight = 311;
-!(BX)    };
-!(BX)    controls {
-!(BX)         managed XmBulletinBoardDialog bulletinBoard_filters;
-!(BX)    };
-!(BX)    callbacks {
-!(BX)    };
-!(BX)};
-
-object slider_x_interval_label : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_END;
-        XmNlabelString = compound_string("X Axis Tick Interval (m): 1");
-        XmNx = 20;
-        XmNy = 10;
-        XmNheight = 20;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_slider_x_interval_label);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object slider_x_interval : XmScale widget {
-    arguments {
-        arguments Style_use;
-        XmNminimum = 1;
-        XmNvalue = 1000;
-        XmNmaximum = 5000;
-        XmNscaleHeight = 15;
-        XmNshowArrows = TRUE;
-        XmNscaleMultiple = 1;
-        XmNshowValue = TRUE;
-        XmNorientation = XmHORIZONTAL;
-        XmNx = 200;
-        XmNy = 10;
-        XmNwidth = 250;
-        XmNheight = 34;
-    };
-    controls {
-        Xm_Title {
-            arguments {
-                arguments Style_use;
-            };
-            callbacks {
-                    callbacks Style_useReasons;
-            };
-!(BX)            handlers {
-!(BX)                handlers Style_useHandlers;
-!(BX)            };
-        };
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_slider_x_interval);
-        XmNvalueChangedCallback = procedure do_x_interval();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object slider_x_max_interval_label : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("5000");
-        XmNrecomputeSize = false;
-        XmNx = 460;
-        XmNy = 10;
-        XmNwidth = 65;
-        XmNheight = 20;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_slider_x_max_interval_label);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object slider_y_interval_label : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_END;
-        XmNlabelString = compound_string("Y Axis Tick Interval (m): 1");
-        XmNx = 10;
-        XmNy = 60;
-        XmNheight = 20;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_slider_y_interval_label);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object slider_y_interval : XmScale widget {
-    arguments {
-        arguments Style_use;
-        XmNminimum = 1;
-        XmNvalue = 250;
-        XmNmaximum = 1000;
-        XmNscaleHeight = 15;
-        XmNshowArrows = TRUE;
-        XmNscaleMultiple = 1;
-        XmNshowValue = TRUE;
-        XmNorientation = XmHORIZONTAL;
-        XmNx = 200;
-        XmNy = 50;
-        XmNwidth = 250;
-        XmNheight = 34;
-    };
-    controls {
-        Xm_Title {
-            arguments {
-                arguments Style_use;
-            };
-            callbacks {
-                    callbacks Style_useReasons;
-            };
-!(BX)            handlers {
-!(BX)                handlers Style_useHandlers;
-!(BX)            };
-        };
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_slider_y_interval);
-        XmNvalueChangedCallback = procedure do_y_interval();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object slider_y_max_interval_label : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("1000");
-        XmNrecomputeSize = false;
-        XmNx = 460;
-        XmNy = 60;
-        XmNwidth = 65;
-        XmNheight = 15;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_slider_y_max_interval_label);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object pushButton_annotation_dismiss : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Dismiss");
-        XmNx = 230;
-        XmNy = 100;
-        XmNwidth = 67;
-        XmNheight = 28;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object bulletinBoard_annotation : XmBulletinBoardDialog widget {
-    arguments {
-        XmNdialogTitle = compound_string("Annotation");
-        XmNresizePolicy = XmRESIZE_GROW;
-        XmNx = 0;
-        XmNy = 1247;
-        XmNwidth = 536;
-        XmNheight = 179;
-    };
-    controls {
-         managed XmPushButton pushButton_annotation_dismiss;
-         managed XmLabel slider_y_max_interval_label;
-         managed XmScale slider_y_interval;
-         managed XmLabel slider_y_interval_label;
-         managed XmLabel slider_x_max_interval_label;
-         managed XmScale slider_x_interval;
-         managed XmLabel slider_x_interval_label;
-    };
-    callbacks {
-    };
-};
-
-!(BX)object dialogShell_annotation : XmDialogShell widget {
-!(BX)    arguments {
-!(BX)        XmNwidth = 536;
-!(BX)        XmNheight = 179;
-!(BX)    };
-!(BX)    controls {
-!(BX)         managed XmBulletinBoardDialog bulletinBoard_annotation;
-!(BX)    };
-!(BX)    callbacks {
-!(BX)    };
-!(BX)};
-
-object slider_buffer_size_label : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_END;
-        XmNlabelString = compound_string("Data Buffer Size:            1");
-        XmNx = 10;
-        XmNy = 20;
-        XmNwidth = 170;
-        XmNheight = 20;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_slider_buffer_size_label);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object slider_buffer_size : XmScale widget {
-    arguments {
-        arguments Style_use;
-        XmNminimum = 1;
-        XmNvalue = 5000;
-        XmNmaximum = 5000;
-        XmNscaleHeight = 15;
-        XmNshowArrows = TRUE;
-        XmNscaleMultiple = 1;
-        XmNshowValue = TRUE;
-        XmNorientation = XmHORIZONTAL;
-        XmNx = 190;
-        XmNy = 10;
-        XmNwidth = 260;
-        XmNheight = 34;
-    };
-    controls {
-        Xm_Title {
-            arguments {
-                arguments Style_use;
-            };
-            callbacks {
-                    callbacks Style_useReasons;
-            };
-!(BX)            handlers {
-!(BX)                handlers Style_useHandlers;
-!(BX)            };
-        };
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_slider_buffer_size);
-        XmNvalueChangedCallback = procedure do_buffer_size();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object slider_buffer_size_max_label : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("5000");
-        XmNrecomputeSize = false;
-        XmNx = 460;
-        XmNy = 20;
-        XmNwidth = 65;
-        XmNheight = 20;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_slider_buffer_size_max_label);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object slider_buffer_hold_label : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_END;
-        XmNlabelString = compound_string("Buffer Retain Size:         1");
-        XmNx = 10;
-        XmNy = 70;
-        XmNheight = 20;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_slider_buffer_hold_label);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object slider_buffer_hold : XmScale widget {
-    arguments {
-        arguments Style_use;
-        XmNminimum = 1;
-        XmNvalue = 100;
-        XmNmaximum = 5000;
-        XmNscaleHeight = 15;
-        XmNshowArrows = TRUE;
-        XmNscaleMultiple = 1;
-        XmNshowValue = TRUE;
-        XmNorientation = XmHORIZONTAL;
-        XmNx = 190;
-        XmNy = 60;
-        XmNwidth = 260;
-        XmNheight = 34;
-    };
-    controls {
-        Xm_Title {
-            arguments {
-                arguments Style_use;
-            };
-            callbacks {
-                    callbacks Style_useReasons;
-            };
-!(BX)            handlers {
-!(BX)                handlers Style_useHandlers;
-!(BX)            };
-        };
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_slider_buffer_hold);
-        XmNvalueChangedCallback = procedure do_buffer_hold();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object slider_buffer_hold_max_label : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("5000");
-        XmNrecomputeSize = false;
-        XmNx = 460;
-        XmNy = 70;
-        XmNwidth = 65;
-        XmNheight = 20;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_slider_buffer_hold_max_label);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object pushButton_buffer_dismiss : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Dismiss");
-        XmNx = 230;
-        XmNy = 110;
-        XmNwidth = 67;
-        XmNheight = 28;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNactivateCallback = procedure BxUnmanageCB("bulletinBoard_buffer");
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object bulletinBoard_buffer : XmBulletinBoardDialog widget {
-    arguments {
-        XmNresizePolicy = XmRESIZE_GROW;
-        XmNx = 0;
-        XmNy = 1244;
-        XmNwidth = 536;
-        XmNheight = 186;
-    };
-    controls {
-         managed XmPushButton pushButton_buffer_dismiss;
-         managed XmLabel slider_buffer_hold_max_label;
-         managed XmScale slider_buffer_hold;
-         managed XmLabel slider_buffer_hold_label;
-         managed XmLabel slider_buffer_size_max_label;
-         managed XmScale slider_buffer_size;
-         managed XmLabel slider_buffer_size_label;
-    };
-    callbacks {
-    };
-};
-
-!(BX)object dialogShell_buffer : XmDialogShell widget {
-!(BX)    arguments {
-!(BX)        XmNtitle = "Buffer Controls";
-!(BX)        XmNwidth = 536;
-!(BX)        XmNheight = 186;
-!(BX)    };
-!(BX)    controls {
-!(BX)         managed XmBulletinBoardDialog bulletinBoard_buffer;
-!(BX)    };
-!(BX)    callbacks {
-!(BX)    };
-!(BX)};
-
-object pushButton_error : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("OK");
-        XmNx = 110;
-        XmNy = 110;
-        XmNwidth = 90;
-        XmNheight = 40;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object label_error_three : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("permission in this directory!");
-        XmNrecomputeSize = false;
-        XmNx = 10;
-        XmNy = 70;
-        XmNwidth = 290;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_label_error_three);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object label_error_one : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Unable to open output file.");
-        XmNrecomputeSize = false;
-        XmNx = 10;
-        XmNy = 10;
-        XmNwidth = 290;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_label_error_one);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object label_error_two : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("You probably do not have write");
-        XmNrecomputeSize = false;
-        XmNx = 10;
-        XmNy = 40;
-        XmNwidth = 290;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_label_error_two);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object bulletinBoard_error : XmBulletinBoardDialog widget {
-    arguments {
-        arguments Style_use;
-        XmNdialogStyle = XmDIALOG_APPLICATION_MODAL;
-        XmNresizePolicy = XmRESIZE_GROW;
-        XmNx = 0;
-        XmNy = 1234;
-        XmNwidth = 311;
-        XmNheight = 205;
-    };
-    controls {
-         managed XmLabel label_error_two;
-         managed XmLabel label_error_one;
-         managed XmLabel label_error_three;
-         managed XmPushButton pushButton_error;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_bulletinBoard_error);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-!(BX)object xmDialogShell_error : XmDialogShell widget {
-!(BX)    arguments {
-!(BX)        XmNtitle = "Error";
-!(BX)        XmNwidth = 311;
-!(BX)        XmNheight = 205;
-!(BX)    };
-!(BX)    controls {
-!(BX)         managed XmBulletinBoardDialog bulletinBoard_error;
-!(BX)    };
-!(BX)    callbacks {
-!(BX)    };
-!(BX)};
-
-object pushButton_editsave_yes : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Yes");
-        XmNx = 100;
-        XmNy = 80;
-        XmNwidth = 90;
-        XmNheight = 40;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNactivateCallback = procedure do_load_ok_with_save();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object pushButton_editsave_no : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("No");
-        XmNx = 250;
-        XmNy = 80;
-        XmNwidth = 90;
-        XmNheight = 40;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNactivateCallback = procedure do_load_ok();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object label_editsave_two : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNlabelString = compound_string("Do you want to apply the saved e" &
- "dits to the data?");
-        XmNx = 10;
-        XmNy = 40;
-        XmNwidth = 410;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object label_editsave_one : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNlabelString = compound_string("An edit save file exists for the" &
- " specified input data file...");
-        XmNx = 10;
-        XmNy = 10;
-        XmNwidth = 410;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object bulletinBoard_editsave : XmBulletinBoardDialog widget {
-    arguments {
-        arguments Style_use;
-        XmNdialogStyle = XmDIALOG_FULL_APPLICATION_MODAL;
-        XmNresizePolicy = XmRESIZE_GROW;
-        XmNx = 0;
-        XmNy = 1248;
-        XmNwidth = 431;
-        XmNheight = 177;
-    };
-    controls {
-         managed XmLabel label_editsave_one;
-         managed XmLabel label_editsave_two;
-         managed XmPushButton pushButton_editsave_no;
-         managed XmPushButton pushButton_editsave_yes;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_bulletinBoard_editsave);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-!(BX)object xmDialogShell_editsave : XmDialogShell widget {
-!(BX)    arguments {
-!(BX)        arguments Style_use;
-!(BX)        XmNtitle = "Use MBedit edit save file?";
-!(BX)        XmNdeleteResponse = XmUNMAP;
-!(BX)        XmNwidth = 431;
-!(BX)        XmNheight = 177;
-!(BX)    };
-!(BX)    controls {
-!(BX)         managed XmBulletinBoardDialog bulletinBoard_editsave;
-!(BX)    };
-!(BX)    callbacks {
-!(BX)        callbacks Style_useReasons;
-!(BX)    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-!(BX)};
-
-object label_message : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNlabelString = compound_string("MBedit is loading data...");
-        XmNrecomputeSize = false;
-        XmNx = 10;
-        XmNy = 10;
-        XmNwidth = 480;
-        XmNheight = 20;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_label_message);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object label_pleasewait : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNlabelString = compound_string("Thank you for your patience.");
-        XmNrecomputeSize = false;
-        XmNx = 10;
-        XmNy = 40;
-        XmNwidth = 360;
-        XmNheight = 20;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object bulletinBoard_message : XmBulletinBoardDialog widget {
-    arguments {
-        arguments Style_use;
-        XmNdialogStyle = XmDIALOG_FULL_APPLICATION_MODAL;
-        XmNresizePolicy = XmRESIZE_NONE;
-        XmNx = 0;
-        XmNy = 1281;
-        XmNwidth = 496;
-        XmNheight = 112;
-    };
-    controls {
-         managed XmLabel label_pleasewait;
-         managed XmLabel label_message;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_bulletinBoard_message);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-!(BX)object xmDialogShell_message : XmDialogShell widget {
-!(BX)    arguments {
-!(BX)        arguments Style_use;
-!(BX)        XmNtitle = "Please Wait...";
-!(BX)        XmNmwmInputMode = MWM_INPUT_MODELESS;
-!(BX)        XmNdeleteResponse = XmUNMAP;
-!(BX)        XmNwidth = 496;
-!(BX)        XmNheight = 112;
-!(BX)    };
-!(BX)    controls {
-!(BX)         managed XmBulletinBoardDialog bulletinBoard_message;
-!(BX)    };
-!(BX)    callbacks {
-!(BX)        callbacks Style_useReasons;
-!(BX)    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-!(BX)};
-
-object label_about_mbedit : XmLabel widget {
-    arguments {
-        XmNfontList = font_table(
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1'));
-        XmNlabelString = compound_string("MBedit");
-        XmNx = 10;
-        XmNy = 10;
-        XmNwidth = 450;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-    };
-};
-
-object label_about_function : XmLabel widget {
-    arguments {
-        XmNfontList = font_table(
-		font('-*-times-bold-r-*-*-*-180-*-*-*-*-iso8859-1'));
-        XmNlabelString = compound_string("Interactive Swath Bathymetry Edi" &
- "tor");
-        XmNx = 10;
-        XmNy = 40;
-        XmNwidth = 450;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-    };
-};
-
-object label_about_version : XmLabel widget {
-    arguments {
-        XmNfontList = font_table(
-		font('-*-times-medium-r-*-*-*-140-*-*-*-*-iso8859-1'));
-        XmNlabelString = compound_string("MB-System Release 4.6", separate=true) &
- compound_string("April 14, 1999");
-        XmNrecomputeSize = false;
-        XmNx = 10;
-        XmNy = 340;
-        XmNwidth = 450;
-        XmNheight = 70;
-    };
-    controls {
-    };
-    callbacks {
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_label_about_version);
-    };
-};
-
-object separator : XmSeparator widget {
-    arguments {
-        XmNx = 10;
-        XmNy = 70;
-        XmNwidth = 450;
-        XmNheight = 20;
-    };
-    controls {
-    };
-    callbacks {
-    };
-};
-
-object label_about_for : XmLabel widget {
-    arguments {
-        XmNfontList = font_table(
-		font('-*-times-bold-r-*-*-*-140-*-*-*-*-iso8859-1'));
-        XmNlabelString = compound_string("for Processing and Display of Sw" &
- "ath Sonar Data");
-        XmNx = 10;
-        XmNy = 190;
-        XmNwidth = 450;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-    };
-};
-
-object label_about_component : XmLabel widget {
-    arguments {
-        XmNfontList = font_table(
-		font('-*-times-bold-r-*-*-*-140-*-*-*-*-iso8859-1'));
-        XmNlabelString = compound_string("One Component of the");
-        XmNx = 10;
-        XmNy = 90;
-        XmNwidth = 450;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-    };
-};
-
-object label_about_mbpub : XmLabel widget {
-    arguments {
-        XmNfontList = font_table(
-		font('-*-times-bold-r-*-*-*-140-*-*-*-*-iso8859-1'));
-        XmNlabelString = compound_string("An Open Source Software Package");
-        XmNx = 10;
-        XmNy = 160;
-        XmNwidth = 450;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-    };
-};
-
-object label_about_mbsystem : XmLabel widget {
-    arguments {
-        XmNfontList = font_table(
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1'));
-        XmNlabelString = compound_string("MB-System");
-        XmNx = 10;
-        XmNy = 120;
-        XmNwidth = 450;
-        XmNheight = 38;
-    };
-    controls {
-    };
-    callbacks {
-    };
-};
-
-object label_about_columbia : XmLabel widget {
-    arguments {
-        XmNfontList = font_table(
-		font('-*-times-bold-r-*-*-*-120-*-*-*-*-iso8859-1'));
-        XmNlabelString = compound_string("Monterey Bay", separate=true) &
- compound_string("Aquarium", separate=true) &
- compound_string("Research Institute");
-        XmNx = 60;
-        XmNy = 280;
-        XmNwidth = 160;
-        XmNheight = 60;
-    };
-    controls {
-    };
-    callbacks {
-    };
-};
-
-object label_about_lamont : XmLabel widget {
-    arguments {
-        XmNfontList = font_table(
-		font('-*-times-bold-r-*-*-*-120-*-*-*-*-iso8859-1'));
-        XmNlabelString = compound_string("Lamont-Doherty", separate=true) &
- compound_string("Earth Observatory", separate=true) &
- compound_string("of Columbia University");
-        XmNx = 250;
-        XmNy = 280;
-        XmNwidth = 190;
-        XmNheight = 60;
-    };
-    controls {
-    };
-    callbacks {
-    };
-};
-
-object label_about_create : XmLabel widget {
-    arguments {
-        XmNfontList = font_table(
-		font('-*-times-bold-r-*-*-*-140-*-*-*-*-iso8859-1'));
-        XmNlabelString = compound_string("Created by:");
-        XmNx = 10;
-        XmNy = 240;
-        XmNwidth = 450;
-        XmNheight = 20;
-    };
-    controls {
-    };
-    callbacks {
-    };
-};
-
-object pushButton_about_dismiss : XmPushButton widget {
-    arguments {
-        XmNfontList = font_table(
-		font('-*-times-bold-r-*-*-*-140-*-*-*-*-iso8859-1'));
-        XmNlabelString = compound_string("Dismiss");
-        XmNx = 190;
-        XmNy = 410;
-        XmNwidth = 90;
-        XmNheight = 35;
-    };
-    controls {
-    };
-    callbacks {
-        XmNactivateCallback = procedure BxUnmanageCB("bulletinBoard_about");
-    };
-};
-
-object separator1 : XmSeparator widget {
-    arguments {
-        XmNx = 10;
-        XmNy = 220;
-        XmNwidth = 450;
-        XmNheight = 20;
-    };
-    controls {
-    };
-    callbacks {
-    };
-};
-
-object label_about_create1 : XmLabel widget {
-    arguments {
-        XmNfontList = font_table(
-		font('-*-times-bold-r-*-*-*-140-*-*-*-*-iso8859-1'));
-        XmNlabelString = compound_string("David W. Caress    and    Dale N" &
- ". Chayes");
-        XmNx = 10;
-        XmNy = 260;
-        XmNwidth = 450;
-        XmNheight = 20;
-    };
-    controls {
-    };
-    callbacks {
-    };
-};
-
-object bulletinBoard_about : XmBulletinBoardDialog widget {
-    arguments {
-        XmNresizePolicy = XmRESIZE_GROW;
-        XmNx = 0;
-        XmNy = 1086;
-        XmNwidth = 473;
-        XmNheight = 501;
-    };
-    controls {
-         managed XmLabel label_about_create1;
-         managed XmSeparator separator1;
-         managed XmPushButton pushButton_about_dismiss;
-         managed XmLabel label_about_create;
-         managed XmLabel label_about_lamont;
-         managed XmLabel label_about_columbia;
-         managed XmLabel label_about_mbsystem;
-         managed XmLabel label_about_mbpub;
-         managed XmLabel label_about_component;
-         managed XmLabel label_about_for;
-         managed XmSeparator separator;
-         managed XmLabel label_about_version;
-         managed XmLabel label_about_function;
-         managed XmLabel label_about_mbedit;
-    };
-    callbacks {
-    };
-};
-
-!(BX)object xmDialogShell_about : XmDialogShell widget {
-!(BX)    arguments {
-!(BX)        XmNtitle = "About MBedit";
-!(BX)        XmNdeleteResponse = XmUNMAP;
-!(BX)        XmNwidth = 473;
-!(BX)        XmNheight = 501;
-!(BX)    };
-!(BX)    controls {
-!(BX)         managed XmBulletinBoardDialog bulletinBoard_about;
-!(BX)    };
-!(BX)    callbacks {
-!(BX)    };
-!(BX)};
-
-object textfield_year_label : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_END;
-        XmNlabelString = compound_string("Year:");
-        XmNx = 40;
-        XmNy = 10;
-        XmNheight = 40;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object textfield_month_label : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_END;
-        XmNlabelString = compound_string("Month:");
-        XmNx = 30;
-        XmNy = 50;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object textfield_day_label : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_END;
-        XmNlabelString = compound_string("Day:");
-        XmNx = 40;
-        XmNy = 90;
-        XmNwidth = 40;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object textfield_hour_label : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_END;
-        XmNlabelString = compound_string("Hour:");
-        XmNx = 30;
-        XmNy = 130;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object textfield_minute_label : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_END;
-        XmNlabelString = compound_string("Minute:");
-        XmNx = 20;
-        XmNy = 170;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object textfield_second_label : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_END;
-        XmNlabelString = compound_string("Second:");
-        XmNx = 20;
-        XmNy = 210;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object textfield_year : XmTextField widget {
-    arguments {
-        arguments Style_use;
-        XmNvalue = "1994";
-        XmNcolumns = 4;
-        XmNx = 90;
-        XmNy = 10;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_textfield_year);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object textfield_month : XmTextField widget {
-    arguments {
-        arguments Style_use;
-        XmNvalue = "1";
-        XmNcolumns = 2;
-        XmNx = 90;
-        XmNy = 50;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_textfield_month);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object textfield_hour : XmTextField widget {
-    arguments {
-        arguments Style_use;
-        XmNvalue = "1";
-        XmNcolumns = 2;
-        XmNx = 90;
-        XmNy = 130;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_textfield_hour);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object textfield_minute : XmTextField widget {
-    arguments {
-        arguments Style_use;
-        XmNvalue = "1";
-        XmNcolumns = 2;
-        XmNx = 90;
-        XmNy = 170;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_textfield_minute);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object textfield_second : XmTextField widget {
-    arguments {
-        arguments Style_use;
-        XmNvalue = "0";
-        XmNcolumns = 2;
-        XmNx = 90;
-        XmNy = 210;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_textfield_second);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object button_goto_apply : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Apply");
-        XmNx = 10;
-        XmNy = 270;
-        XmNwidth = 75;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-       XmNactivateCallback = procedures {
-                 do_goto_apply();
-                 BxUnmanageCB("bulletinBoard_goto");
-        };
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object button_goto_cancel : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Cancel");
-        XmNx = 100;
-        XmNy = 270;
-        XmNwidth = 75;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNactivateCallback = procedure BxUnmanageCB("bulletinBoard_goto");
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object textfield_day : XmTextField widget {
-    arguments {
-        arguments Style_use;
-        XmNvalue = "1";
-        XmNcolumns = 2;
-        XmNx = 90;
-        XmNy = 90;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_textfield_day);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object bulletinBoard_goto : XmBulletinBoardDialog widget {
-    arguments {
-        arguments Style_use;
-        XmNresizePolicy = XmRESIZE_GROW;
-        XmNx = 0;
-        XmNy = 1164;
-        XmNwidth = 196;
-        XmNheight = 346;
-    };
-    controls {
-         managed XmTextField textfield_day;
-         managed XmPushButton button_goto_cancel;
-         managed XmPushButton button_goto_apply;
-         managed XmTextField textfield_second;
-         managed XmTextField textfield_minute;
-         managed XmTextField textfield_hour;
-         managed XmTextField textfield_month;
-         managed XmTextField textfield_year;
-         managed XmLabel textfield_second_label;
-         managed XmLabel textfield_minute_label;
-         managed XmLabel textfield_hour_label;
-         managed XmLabel textfield_day_label;
-         managed XmLabel textfield_month_label;
-         managed XmLabel textfield_year_label;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-!(BX)object xmDialogShell_goto : XmDialogShell widget {
-!(BX)    arguments {
-!(BX)        arguments Style_use;
-!(BX)        XmNtitle = "Go To Specified Time";
-!(BX)        XmNdeleteResponse = XmUNMAP;
-!(BX)        XmNwidth = 196;
-!(BX)        XmNheight = 346;
-!(BX)    };
-!(BX)    controls {
-!(BX)         managed XmBulletinBoardDialog bulletinBoard_goto;
-!(BX)    };
-!(BX)    callbacks {
-!(BX)        callbacks Style_useReasons;
-!(BX)    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-!(BX)};
-
-object setting_output_toggle_edit : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Output Edits");
-        XmNwidth = 116;
-        XmNheight = 28;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_setting_output_toggle_edit);
-        XmNvalueChangedCallback = procedure do_output_edit();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object setting_output_toggle_browse : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Browse Only");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_setting_output_toggle_browse);
-        XmNvalueChangedCallback = procedure do_output_browse();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object setting_output : XmRowColumn widget {
-    arguments {
-        arguments Style_use;
-        XmNnumColumns = 1;
-        XmNpacking = XmPACK_COLUMN;
-        XmNradioBehavior = true;
-        XmNspacing = 0;
-        XmNorientation = XmVERTICAL;
-        XmNx = 310;
-        XmNy = 420;
-        XmNwidth = 122;
-        XmNheight = 62;
-    };
-    controls {
-         managed XmToggleButton setting_output_toggle_edit;
-         managed XmToggleButton setting_output_toggle_browse;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_setting_output);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object setting_output_label : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Output Mode:");
-        XmNmarginWidth = 0;
-        XmNx = 210;
-        XmNy = 430;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_setting_output_label);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object textfield_format : XmTextField widget {
-    arguments {
-        arguments Style_use;
-        XmNvalue = "41";
-        XmNcolumns = 3;
-        XmNmaxLength = 3;
-        XmNx = 140;
-        XmNy = 420;
-        XmNheight = 40;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_textfield_format);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object textfield_format_label : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("MBIO Format ID:");
-        XmNx = 10;
-        XmNy = 430;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_textfield_format_label);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object fileSelectionBox : XmFileSelectionBox widget {
-    arguments {
-        arguments Style_use;
-        XmNmarginHeight = 0;
-        XmNmarginWidth = 0;
-        XmNresizePolicy = XmRESIZE_GROW;
-        XmNx = 10;
-        XmNy = 10;
-        XmNwidth = 500;
-        XmNheight = 400;
-    };
-    controls {
-        Xm_Items managed {
-            arguments {
-                arguments Style_use;
-            };
-            callbacks {
-                    callbacks Style_useReasons;
-            };
-!(BX)            handlers {
-!(BX)                handlers Style_useHandlers;
-!(BX)            };
-        };
-        Xm_ItemsList managed {
-            arguments {
-                arguments Style_use;
-            };
-            callbacks {
-                    callbacks Style_useReasons;
-            };
-!(BX)            handlers {
-!(BX)                handlers Style_useHandlers;
-!(BX)            };
-        };
-        Xm_Selection managed {
-            arguments {
-                arguments Style_use;
-            };
-            callbacks {
-                    callbacks Style_useReasons;
-            };
-!(BX)            handlers {
-!(BX)                handlers Style_useHandlers;
-!(BX)            };
-        };
-        Xm_Text managed {
-            arguments {
-                arguments Style_use;
-            };
-            callbacks {
-                    callbacks Style_useReasons;
-            };
-!(BX)            handlers {
-!(BX)                handlers Style_useHandlers;
-!(BX)            };
-        };
-        Xm_Separator managed {
-            arguments {
-                arguments Style_use;
-            };
-            callbacks {
-                    callbacks Style_useReasons;
-            };
-!(BX)            handlers {
-!(BX)                handlers Style_useHandlers;
-!(BX)            };
-        };
-        Xm_OK managed {
-            arguments {
-                arguments Style_use;
-            };
-            callbacks {
-                    callbacks Style_useReasons;
-            };
-!(BX)            handlers {
-!(BX)                handlers Style_useHandlers;
-!(BX)            };
-        };
-        Xm_Cancel managed {
-            arguments {
-                arguments Style_use;
-            };
-            callbacks {
-                    callbacks Style_useReasons;
-            };
-!(BX)            handlers {
-!(BX)                handlers Style_useHandlers;
-!(BX)            };
-        };
-        Xm_Help managed {
-            arguments {
-                arguments Style_use;
-            };
-            callbacks {
-                    callbacks Style_useReasons;
-            };
-!(BX)            handlers {
-!(BX)                handlers Style_useHandlers;
-!(BX)            };
-        };
-        Xm_Apply managed {
-            arguments {
-                arguments Style_use;
-            };
-            callbacks {
-                    callbacks Style_useReasons;
-            };
-!(BX)            handlers {
-!(BX)                handlers Style_useHandlers;
-!(BX)            };
-        };
-        Xm_DirList managed {
-            arguments {
-                arguments Style_use;
-            };
-            callbacks {
-                    callbacks Style_useReasons;
-            };
-!(BX)            handlers {
-!(BX)                handlers Style_useHandlers;
-!(BX)            };
-        };
-        Xm_Dir managed {
-            arguments {
-                arguments Style_use;
-            };
-            callbacks {
-                    callbacks Style_useReasons;
-            };
-!(BX)            handlers {
-!(BX)                handlers Style_useHandlers;
-!(BX)            };
-        };
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_fileSelectionBox);
-       XmNokCallback = procedures {
-                 do_load_check();
-                 BxUnmanageCB("bulletinBoard_file");
-        };
-        XmNcancelCallback = procedure BxUnmanageCB("bulletinBoard_file");
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object bulletinBoard_file : XmBulletinBoardDialog widget {
-    arguments {
-        arguments Style_use;
-        XmNautoUnmanage = false;
-        XmNresizePolicy = XmRESIZE_GROW;
-        XmNx = 1016;
-        XmNy = 1092;
-        XmNwidth = 529;
-        XmNheight = 489;
-    };
-    controls {
-         managed XmFileSelectionBox fileSelectionBox;
-         managed XmLabel textfield_format_label;
-         managed XmTextField textfield_format;
-         managed XmLabel setting_output_label;
-         managed XmRowColumn setting_output;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-!(BX)object xmDialogShell_file : XmDialogShell widget {
-!(BX)    arguments {
-!(BX)        arguments Style_use;
-!(BX)        XmNtitle = "Open Source Swath Sonar Data Fil" &
-!(BX) "e";
-!(BX)        XmNdeleteResponse = XmUNMAP;
-!(BX)        XmNwidth = 529;
-!(BX)        XmNheight = 489;
-!(BX)    };
-!(BX)    controls {
-!(BX)         managed XmBulletinBoardDialog bulletinBoard_file;
-!(BX)    };
-!(BX)    callbacks {
-!(BX)        callbacks Style_useReasons;
-!(BX)    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-!(BX)};
-
-object canvas_mbedit : XmDrawingArea widget {
-    arguments {
-        arguments Style_use;
-        XmNborderWidth = 1;
-        XmNbackground = color('white');
-        XmNresizePolicy = XmRESIZE_GROW;
-        XmNx = 0;
-        XmNy = 150;
-        XmNwidth = 1010;
-        XmNheight = 510;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_canvas_mbedit);
-        XmNinputCallback = procedure do_event();
-        XmNexposeCallback = procedure do_expose();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object setting_mode_toggle_toggle : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Toggle");
-        XmNwidth = 75;
-        XmNheight = 28;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_setting_mode_toggle_toggle);
-        XmNvalueChangedCallback = procedure do_mode_toggle();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object setting_mode_toggle_pick : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Pick");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_setting_mode_toggle_pick);
-        XmNvalueChangedCallback = procedure do_mode_pick();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object setting_mode_toggle_erase : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Erase");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_setting_mode_toggle_erase);
-        XmNvalueChangedCallback = procedure do_mode_erase();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object setting_mode_toggle_restore : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Restore");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_setting_mode_toggle_restore);
-        XmNvalueChangedCallback = procedure do_mode_restore();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object setting_mode_toggle_grab : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Grab");
-        XmNwidth = 62;
-        XmNheight = 28;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_setting_mode_toggle_grab);
-        XmNvalueChangedCallback = procedure do_mode_grab();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object setting_mode_toggle_info : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Info");
-        XmNwidth = 54;
-        XmNheight = 28;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_setting_mode_toggle_info);
-        XmNvalueChangedCallback = procedure do_mode_info();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object setting_mode : XmRowColumn widget {
-    arguments {
-        arguments Style_use;
-        XmNnumColumns = 1;
-        XmNpacking = XmPACK_TIGHT;
-        XmNradioBehavior = true;
-        XmNspacing = 0;
-        XmNorientation = XmHORIZONTAL;
-        XmNx = 120;
-        XmNy = 120;
-        XmNwidth = 405;
-        XmNheight = 34;
-    };
-    controls {
-         managed XmToggleButton setting_mode_toggle_toggle;
-         managed XmToggleButton setting_mode_toggle_pick;
-         managed XmToggleButton setting_mode_toggle_erase;
-         managed XmToggleButton setting_mode_toggle_restore;
-         managed XmToggleButton setting_mode_toggle_grab;
-         managed XmToggleButton setting_mode_toggle_info;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object setting_mode_label : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Mode:");
-        XmNmarginWidth = 0;
-        XmNx = 70;
-        XmNy = 120;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object slider_number_max_step_label : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("20");
-        XmNrecomputeSize = false;
-        XmNx = 960;
-        XmNy = 90;
-        XmNwidth = 50;
-        XmNheight = 20;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_slider_number_max_step_label);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object slider_number_step : XmScale widget {
-    arguments {
-        arguments Style_use;
-        XmNminimum = 1;
-        XmNvalue = 5;
-        XmNmaximum = 20;
-        XmNscaleHeight = 15;
-        XmNshowArrows = TRUE;
-        XmNscaleMultiple = 1;
-        XmNshowValue = TRUE;
-        XmNorientation = XmHORIZONTAL;
-        XmNx = 670;
-        XmNy = 80;
-        XmNwidth = 290;
-        XmNheight = 34;
-    };
-    controls {
-        Xm_Title {
-            arguments {
-                arguments Style_use;
-            };
-            callbacks {
-                    callbacks Style_useReasons;
-            };
-!(BX)            handlers {
-!(BX)                handlers Style_useHandlers;
-!(BX)            };
-        };
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_slider_number_step);
-        XmNvalueChangedCallback = procedure do_number_step();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object slider_number_step_label : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_END;
-        XmNlabelString = compound_string("Pings to step:  1");
-        XmNx = 550;
-        XmNy = 90;
-        XmNheight = 20;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_slider_number_step_label);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object slider_num_pings_max_label : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("20");
-        XmNrecomputeSize = false;
-        XmNx = 960;
-        XmNy = 50;
-        XmNwidth = 50;
-        XmNheight = 20;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_slider_num_pings_max_label);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object slider_number_pings : XmScale widget {
-    arguments {
-        arguments Style_use;
-        XmNminimum = 1;
-        XmNvalue = 10;
-        XmNmaximum = 20;
-        XmNscaleHeight = 15;
-        XmNshowArrows = TRUE;
-        XmNscaleMultiple = 1;
-        XmNshowValue = TRUE;
-        XmNorientation = XmHORIZONTAL;
-        XmNx = 670;
-        XmNy = 40;
-        XmNwidth = 290;
-        XmNheight = 34;
-    };
-    controls {
-        Xm_Title {
-            arguments {
-                arguments Style_use;
-            };
-            callbacks {
-                    callbacks Style_useReasons;
-            };
-!(BX)            handlers {
-!(BX)                handlers Style_useHandlers;
-!(BX)            };
-        };
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_slider_number_pings);
-        XmNvalueChangedCallback = procedure do_number_pings();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object slider_number_pings_label : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_END;
-        XmNlabelString = compound_string("Pings shown:   1");
-        XmNx = 550;
-        XmNy = 50;
-        XmNheight = 20;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_slider_number_pings_label);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object slider_scale_y_max_label : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("20.00");
-        XmNrecomputeSize = false;
-        XmNx = 470;
-        XmNy = 90;
-        XmNwidth = 65;
-        XmNheight = 20;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_slider_scale_y_max_label);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object slider_scale_y : XmScale widget {
-    arguments {
-        arguments Style_use;
-        XmNminimum = 1;
-        XmNdecimalPoints = 2;
-        XmNvalue = 100;
-        XmNmaximum = 2000;
-        XmNscaleHeight = 15;
-        XmNshowArrows = TRUE;
-        XmNscaleMultiple = 1;
-        XmNshowValue = TRUE;
-        XmNorientation = XmHORIZONTAL;
-        XmNx = 210;
-        XmNy = 80;
-        XmNwidth = 260;
-        XmNheight = 34;
-    };
-    controls {
-        Xm_Title {
-            arguments {
-                arguments Style_use;
-            };
-            callbacks {
-                    callbacks Style_useReasons;
-            };
-!(BX)            handlers {
-!(BX)                handlers Style_useHandlers;
-!(BX)            };
-        };
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_slider_scale_y);
-        XmNvalueChangedCallback = procedure do_scale_y();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object slider_scale_y_label : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_END;
-        XmNlabelString = compound_string("Vertical Exaggeration: 0.01");
-        XmNx = 20;
-        XmNy = 90;
-        XmNheight = 20;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_slider_scale_y_label);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object slider_scale_x_max_label : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("20000");
-        XmNrecomputeSize = false;
-        XmNx = 470;
-        XmNy = 50;
-        XmNwidth = 60;
-        XmNheight = 20;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_slider_scale_x_max_label);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object slider_scale_x : XmScale widget {
-    arguments {
-        arguments Style_use;
-        XmNminimum = 1;
-        XmNvalue = 1000;
-        XmNmaximum = 20000;
-        XmNscaleHeight = 15;
-        XmNshowArrows = TRUE;
-        XmNscaleMultiple = 1;
-        XmNshowValue = TRUE;
-        XmNorientation = XmHORIZONTAL;
-        XmNx = 210;
-        XmNy = 40;
-        XmNwidth = 260;
-        XmNheight = 34;
-    };
-    controls {
-        Xm_Title {
-            arguments {
-                arguments Style_use;
-            };
-            callbacks {
-                    callbacks Style_useReasons;
-            };
-!(BX)            handlers {
-!(BX)                handlers Style_useHandlers;
-!(BX)            };
-        };
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_slider_scale_x);
-        XmNvalueChangedCallback = procedure do_scale_x();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object slider_scale_x_label : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_END;
-        XmNlabelString = compound_string("Acrosstrack Width (m):  1");
-        XmNx = 30;
-        XmNy = 50;
-        XmNheight = 20;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_slider_scale_x_label);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object pushButton_quit : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Quit");
-        XmNx = 810;
-        XmNy = 0;
-        XmNwidth = 80;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNactivateCallback = procedure do_quit();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object pushButton_reverse : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Reverse");
-        XmNx = 370;
-        XmNy = 0;
-        XmNwidth = 70;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_pushButton_reverse);
-        XmNactivateCallback = procedure do_reverse();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object pushButton_forward : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Forward");
-        XmNx = 440;
-        XmNy = 0;
-        XmNwidth = 70;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_pushButton_forward);
-        XmNactivateCallback = procedure do_forward();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object pushButton_done : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Done");
-        XmNx = 720;
-        XmNy = 0;
-        XmNwidth = 80;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_pushButton_done);
-        XmNactivateCallback = procedure do_done();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object pushButton_next : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Next Buffer");
-        XmNx = 620;
-        XmNy = 0;
-        XmNwidth = 90;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_pushButton_next);
-        XmNactivateCallback = procedure do_next_buffer();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object pushButton_about : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("About");
-        XmNx = 930;
-        XmNy = 0;
-        XmNwidth = 80;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNactivateCallback = procedure BxManageCB("bulletinBoard_about");
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object pushButton_goto : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Go To Specified Time...");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNactivateCallback = procedure BxManageCB("bulletinBoard_goto");
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object pushButton_buffer : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Buffer Controls...");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNactivateCallback = procedure BxManageCB("bulletinBoard_buffer");
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object pushButton_annotation : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Annotation...");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNactivateCallback = procedure BxManageCB("bulletinBoard_annotation");
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object pushButton_filters : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Filters...");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNactivateCallback = procedure BxManageCB("bulletinBoard_filters");
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object separator7 : XmSeparator widget {
-    arguments {
-    };
-    controls {
-    };
-    callbacks {
-    };
-};
-
-object toggleButton_reverse_keys : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNlabelString = compound_string("Reverse Right/Left Key Macros");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_toggleButton_reverse_keys);
-        XmNvalueChangedCallback = procedure do_reverse_keys();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object toggleButton_reverse_mouse : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNlabelString = compound_string("Reverse Mouse Buttons");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_toggleButton_reverse_mouse);
-        XmNvalueChangedCallback = procedure do_reverse_mouse();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object pulldownMenu_controls : XmPulldownMenu widget {
-    arguments {
-        XmNx = 0;
-        XmNy = 0;
-        XmNwidth = 240;
-        XmNheight = 150;
-    };
-    controls {
-         managed XmPushButton pushButton_goto;
-         managed XmPushButton pushButton_buffer;
-         managed XmPushButton pushButton_annotation;
-         managed XmPushButton pushButton_filters;
-         managed XmSeparator separator7;
-         managed XmToggleButton toggleButton_reverse_keys;
-         managed XmToggleButton toggleButton_reverse_mouse;
-    };
-    callbacks {
-    };
-};
-
-object cascadeButton_controls : XmCascadeButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Controls");
-        XmNx = 5;
-        XmNy = 5;
-        XmNwidth = 77;
-        XmNheight = 24;
-    };
-    controls {
-         unmanaged XmPulldownMenu pulldownMenu_controls;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object menuBar_controls : XmMenuBar widget {
-    arguments {
-        XmNx = 170;
-        XmNy = 0;
-        XmNwidth = 87;
-        XmNheight = 34;
-    };
-    controls {
-         managed XmCascadeButton cascadeButton_controls;
-    };
-    callbacks {
-    };
-};
-
-object pushButton_unflag_view : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Unflag View");
-        XmNx = 700;
-        XmNy = 120;
-        XmNwidth = 120;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNactivateCallback = procedure do_unflag_view();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object pushButton_unflag_all : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Unflag Forward");
-        XmNx = 850;
-        XmNy = 120;
-        XmNwidth = 120;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNactivateCallback = procedure do_unflag_all();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object toggleButton_view_waterfall : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Waterfall View");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_toggleButton_view_waterfall);
-        XmNvalueChangedCallback = procedure do_view_mode();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object toggleButton_view_alongtrack : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Alongtrack View");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_toggleButton_view_alongtrack);
-        XmNvalueChangedCallback = procedure do_view_mode();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object toggleButton_view_acrosstrack : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Acrosstrack View");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_toggleButton_view_acrosstrack);
-        XmNvalueChangedCallback = procedure do_view_mode();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object separator2 : XmSeparator widget {
-    arguments {
-    };
-    controls {
-    };
-    callbacks {
-    };
-};
-
-object toggleButton_show_flagged_on : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNlabelString = compound_string("Show Flagged Profile");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_toggleButton_show_flagged_on);
-        XmNvalueChangedCallback = procedure do_show_flagged();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object separator8 : XmSeparator widget {
-    arguments {
-    };
-    controls {
-    };
-    callbacks {
-    };
-};
-
-object toggleButton_show_flags : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNlabelString = compound_string("Show Flag States");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_toggleButton_show_flags);
-        XmNvalueChangedCallback = procedure do_show_flags();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object toggleButton_show_detects : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNlabelString = compound_string("Show Bottom Detect Algorithms");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_toggleButton_show_detects);
-        XmNvalueChangedCallback = procedure do_show_detects();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object toggleButton_show_pulsetypes : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNlabelString = compound_string("Show Source Pulse Types");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_toggleButton_show_pulsetypes);
-        XmNvalueChangedCallback = procedure do_show_pulsetypes();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object separator9 : XmSeparator widget {
-    arguments {
-    };
-    controls {
-    };
-    callbacks {
-    };
-};
-
-object toggleButton_show_wideplot : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNlabelString = compound_string("Wide Bathymetry Profiles");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_toggleButton_show_wideplot);
-        XmNvalueChangedCallback = procedure do_show_time();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object toggleButton_show_time : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNlabelString = compound_string("Print Time Stamps");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_toggleButton_show_time);
-        XmNvalueChangedCallback = procedure do_show_time();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object toggleButton_show_interval : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Plot Ping Interval");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_toggleButton_show_interval);
-        XmNvalueChangedCallback = procedure do_show_time();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object toggleButton_show_lon : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Plot Longitude");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_toggleButton_show_lon);
-        XmNvalueChangedCallback = procedure do_show_time();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object toggleButton_show_latitude : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Plot Latitude");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_toggleButton_show_latitude);
-        XmNvalueChangedCallback = procedure do_show_time();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object toggleButton_show_heading : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNlabelString = compound_string("Plot Heading");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_toggleButton_show_heading);
-        XmNvalueChangedCallback = procedure do_show_time();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object toggleButton_show_speed : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Plot Speed");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_toggleButton_show_speed);
-        XmNvalueChangedCallback = procedure do_show_time();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object toggleButton_show_depth : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Plot Center Beam Depth");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_toggleButton_show_depth);
-        XmNvalueChangedCallback = procedure do_show_time();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object toggleButton_show_altitude : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Plot Sonar Altitude");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_toggleButton_show_altitude);
-        XmNvalueChangedCallback = procedure do_show_time();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object toggleButton_show_sonardepth : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Plot Sonar Depth");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_toggleButton_show_sonardepth);
-        XmNvalueChangedCallback = procedure do_show_time();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object toggleButton_show_roll : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Plot Roll");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_toggleButton_show_roll);
-        XmNvalueChangedCallback = procedure do_show_time();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object toggleButton_show_pitch : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Plot Pitch");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_toggleButton_show_pitch);
-        XmNvalueChangedCallback = procedure do_show_time();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object toggleButton_show_heave : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Plot Heave");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_toggleButton_show_heave);
-        XmNvalueChangedCallback = procedure do_show_time();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object pulldownMenu_view : XmPulldownMenu widget {
-    arguments {
-        XmNx = 0;
-        XmNy = 0;
-        XmNwidth = 247;
-        XmNheight = 490;
-    };
-    controls {
-         managed XmToggleButton toggleButton_view_waterfall;
-         managed XmToggleButton toggleButton_view_alongtrack;
-         managed XmToggleButton toggleButton_view_acrosstrack;
-         managed XmSeparator separator2;
-         managed XmToggleButton toggleButton_show_flagged_on;
-         managed XmSeparator separator8;
-         managed XmToggleButton toggleButton_show_flags;
-         managed XmToggleButton toggleButton_show_detects;
-         managed XmToggleButton toggleButton_show_pulsetypes;
-         managed XmSeparator separator9;
-         managed XmToggleButton toggleButton_show_wideplot;
-         managed XmToggleButton toggleButton_show_time;
-         managed XmToggleButton toggleButton_show_interval;
-         managed XmToggleButton toggleButton_show_lon;
-         managed XmToggleButton toggleButton_show_latitude;
-         managed XmToggleButton toggleButton_show_heading;
-         managed XmToggleButton toggleButton_show_speed;
-         managed XmToggleButton toggleButton_show_depth;
-         managed XmToggleButton toggleButton_show_altitude;
-         managed XmToggleButton toggleButton_show_sonardepth;
-         managed XmToggleButton toggleButton_show_roll;
-         managed XmToggleButton toggleButton_show_pitch;
-         managed XmToggleButton toggleButton_show_heave;
-    };
-    callbacks {
-    };
-};
-
-object cascadeButton_view : XmCascadeButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("View");
-        XmNx = 5;
-        XmNy = 5;
-        XmNwidth = 48;
-        XmNheight = 24;
-    };
-    controls {
-         unmanaged XmPulldownMenu pulldownMenu_view;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object menuBar_view : XmMenuBar widget {
-    arguments {
-        XmNpacking = XmPACK_TIGHT;
-        XmNx = 90;
-        XmNy = 0;
-        XmNwidth = 58;
-        XmNheight = 34;
-    };
-    controls {
-         managed XmCascadeButton cascadeButton_view;
-    };
-    callbacks {
-    };
-};
-
-object pushButton_flag_view : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Flag View");
-        XmNx = 550;
-        XmNy = 120;
-        XmNwidth = 120;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNactivateCallback = procedure do_flag_view();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object pushButton_start : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Start");
-        XmNx = 300;
-        XmNy = 0;
-        XmNwidth = 70;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_pushButton_start);
-        XmNactivateCallback = procedure do_start();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object pushButton_end : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("End");
-        XmNx = 510;
-        XmNy = 0;
-        XmNwidth = 70;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_pushButton_end);
-        XmNactivateCallback = procedure do_end();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object pushButton_file : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Open");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_pushButton_file);
-        XmNactivateCallback = procedure BxManageCB("bulletinBoard_file");
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object separator10 : XmSeparator widget {
-    arguments {
-        arguments Style_use;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object pushButton_filelist : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("File Selection List");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNactivateCallback = procedure BxManageCB("form_filelist");
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object pulldownMenu_file : XmPulldownMenu widget {
-    arguments {
-        arguments Style_use;
-        XmNx = 0;
-        XmNy = 0;
-        XmNwidth = 135;
-        XmNheight = 54;
-    };
-    controls {
-         managed XmPushButton pushButton_file;
-         managed XmSeparator separator10;
-         managed XmPushButton pushButton_filelist;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object cascadeButton_file : XmCascadeButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("File");
-        XmNx = 5;
-        XmNy = 5;
-        XmNwidth = 41;
-        XmNheight = 24;
-    };
-    controls {
-         unmanaged XmPulldownMenu pulldownMenu_file;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object menuBar_file : XmMenuBar widget {
-    arguments {
-        arguments Style_use;
-        XmNpacking = XmPACK_TIGHT;
-        XmNx = 0;
-        XmNy = 0;
-        XmNwidth = 51;
-        XmNheight = 34;
-    };
-    controls {
-         managed XmCascadeButton cascadeButton_file;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object controls_mbedit : XmBulletinBoard widget {
-    arguments {
-        arguments Style_use;
-        XmNmarginHeight = 0;
-        XmNmarginWidth = 0;
-        XmNresizePolicy = XmRESIZE_GROW;
-        XmNx = 0;
-        XmNy = 0;
-        XmNwidth = 1040;
-        XmNheight = 154;
-    };
-    controls {
-         managed XmMenuBar menuBar_file;
-         managed XmPushButton pushButton_end;
-         managed XmPushButton pushButton_start;
-         managed XmPushButton pushButton_flag_view;
-         managed XmMenuBar menuBar_view;
-         managed XmPushButton pushButton_unflag_all;
-         managed XmPushButton pushButton_unflag_view;
-         managed XmMenuBar menuBar_controls;
-         managed XmPushButton pushButton_about;
-         managed XmPushButton pushButton_next;
-         managed XmPushButton pushButton_done;
-         managed XmPushButton pushButton_forward;
-         managed XmPushButton pushButton_reverse;
-         managed XmPushButton pushButton_quit;
-         managed XmLabel slider_scale_x_label;
-         managed XmScale slider_scale_x;
-         managed XmLabel slider_scale_x_max_label;
-         managed XmLabel slider_scale_y_label;
-         managed XmScale slider_scale_y;
-         managed XmLabel slider_scale_y_max_label;
-         managed XmLabel slider_number_pings_label;
-         managed XmScale slider_number_pings;
-         managed XmLabel slider_num_pings_max_label;
-         managed XmLabel slider_number_step_label;
-         managed XmScale slider_number_step;
-         managed XmLabel slider_number_max_step_label;
-         managed XmLabel setting_mode_label;
-         managed XmRowColumn setting_mode;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mbedit_bboard : XmBulletinBoard widget {
-    arguments {
-        arguments Style_use;
-        XmNnoResize = false;
-        XmNmarginHeight = 0;
-        XmNmarginWidth = 0;
-        XmNresizePolicy = XmRESIZE_GROW;
-        XmNwidth = 1014;
-        XmNheight = 663;
-    };
-    controls {
-         managed XmBulletinBoard controls_mbedit;
-         managed XmDrawingArea canvas_mbedit;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object window_mbedit : XmMainWindow widget {
-    arguments {
-        arguments Style_use;
-        XmNx = 114;
-        XmNy = 631;
-        XmNwidth = 1014;
-        XmNheight = 663;
-    };
-    controls {
-        Xm_Separator1 {
-            arguments {
-                arguments Style_use;
-            };
-            callbacks {
-                    callbacks Style_useReasons;
-            };
-!(BX)            handlers {
-!(BX)                handlers Style_useHandlers;
-!(BX)            };
-        };
-        Xm_Separator2 {
-            arguments {
-                arguments Style_use;
-            };
-            callbacks {
-                    callbacks Style_useReasons;
-            };
-!(BX)            handlers {
-!(BX)                handlers Style_useHandlers;
-!(BX)            };
-        };
-        Xm_Separator3 {
-            arguments {
-                arguments Style_use;
-            };
-            callbacks {
-                    callbacks Style_useReasons;
-            };
-!(BX)            handlers {
-!(BX)                handlers Style_useHandlers;
-!(BX)            };
-        };
-!(BX)         unmanaged XmDialogShell dialogShell_filelist;
-!(BX)         unmanaged XmDialogShell dialogShell_filters;
-!(BX)         unmanaged XmDialogShell dialogShell_annotation;
-!(BX)         unmanaged XmDialogShell dialogShell_buffer;
-!(BX)         unmanaged XmDialogShell xmDialogShell_error;
-!(BX)         unmanaged XmDialogShell xmDialogShell_editsave;
-!(BX)         unmanaged XmDialogShell xmDialogShell_message;
-!(BX)         unmanaged XmDialogShell xmDialogShell_about;
-!(BX)         unmanaged XmDialogShell xmDialogShell_goto;
-!(BX)         unmanaged XmDialogShell xmDialogShell_file;
-         managed XmBulletinBoard mbedit_bboard;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_window_mbedit);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-!(BX)object topLevelShell : TopLevelShell widget {
-!(BX)    arguments {
-!(BX)        arguments Style_use;
-!(BX)        XmNtitle = "MBedit";
-!(BX)        XmNiconName = "MBedit";
-!(BX)        XmNallowShellResize = false;
-!(BX)        XmNdeleteResponse = XmDESTROY;
-!(BX)        XmNx = 114;
-!(BX)        XmNy = 631;
-!(BX)        XmNwidth = 1014;
-!(BX)        XmNheight = 663;
-!(BX)    };
-!(BX)    controls {
-!(BX)         managed XmMainWindow window_mbedit;
-!(BX)    };
-!(BX)    callbacks {
-!(BX)        callbacks Style_useReasons;
-!(BX)        XmNdestroyCallback = procedure do_quit();
-!(BX)    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-!(BX)};
-end module;
diff --git a/src/mbedit/mbedit_bxutils.c b/src/mbedit/mbedit_bxutils.c
deleted file mode 100644
index 1510342..0000000
--- a/src/mbedit/mbedit_bxutils.c
+++ /dev/null
@@ -1,3926 +0,0 @@
-/*
- * WARNING: This file is overwritten at code generation time.
- * Any changes to this file will be lost.
- */
-/*
- * MODULE: BxConvert.c
- * AUTHOR: Automatically generated by Builder Xcessory
- *
- * Description: This module contains various utilities, converters
- *	for XmStrings (to work properly with app-defaults), and if needed
- *	the XPM pixmap utilities.
- *
- * Edit the file ${BX}/gen/bxutils.c (BX$SYSTEM:[gen]bxutils.c on VMS) to
- * make system wide changes to this file which will be visible next time
- * this file is generated.
- * ${BX} is the directory where Builder Xcessory is installed.
- */
-
-/*
- * BX supplies a string format for compound strings:
- *
- *		::[#tag][:t][:r]["str"]
- *
- * where:
- *	:: = indicates compound string.
- *	tag =  the font tag
- *	:t = separator (if not seen no separator added to segment)
- *	:r = right to left (if not seen left to right assumed)
- *	"str" = the text of the string.
- *
- * The components for the compound string can be repeated any number of
- * times.
- */
-
-/*****************************************************************************
- *       INCLUDE FILES
- *****************************************************************************/
-/* Added HAVE_CONFIG_H for autogen files */
-#ifdef HAVE_CONFIG_H
-#include <mb_config.h>
-#endif
-
-#include <Xm/Xm.h>
-#include <Xm/RowColumn.h>
-#include <stdio.h>
-#include <ctype.h>
-#include <string.h>
-
-/*
- * Include stdlib.h and malloc.h if code is C++, ANSI, or Extended ANSI.
- */
-#if defined(__cplusplus) || defined(__STDC__) || defined(__EXTENSIONS__)
-#include <stdlib.h>
-#ifdef HAVE_MALLOC_H
-#include <malloc.h>
-#endif
-#endif
-
-/*****************************************************************************
- *       TYPDEFS AND DEFINES
- *****************************************************************************/
-
-/*
- * Undefine this if you want to use native strcasecmp.
- */
-#define LOCAL_STRCASECMP
-
-#ifdef _NO_PROTO
-#ifdef NeedFunctionPrototypes
-#undef NeedFunctionPrototypes
-#endif
-#endif
-
-/*
- * Define SUPPORTS_WCHARS if the system supports wide character sets
- * Note: the following line flags the VAXC compiler and not the
- * DECC compiler running VAXC emulation.
- */
-#if !((defined(VAXC) && !defined(__DECC)) || defined(__CENTERLINE__))
-#define SUPPORTS_WCHARS
-#endif
-
-/*
- * Handy definition used in SET_BACKGROUND_COLOR
-*/
-#define UNSET		(-1)
-
-/*
- * Set state of inclusion of prototypes properly
- */
-#ifdef NeedFunctionPrototypes
-#define ARGLIST(p)	(
-#define ARG(a, b)	a b,
-#define GRA(a, b)	a b)
-#else
-#define ARGLIST(p)	p
-#define ARG(a, b)	a b;
-#define GRA(a, b)	a b;
-#endif
-
-#ifdef NeedFunctionPrototypes
-#ifdef __cplusplus
-#define UARG(a, b)	a,
-#define GRAU(a, b)	a)
-#else
-#define UARG(a, b)	a b,
-#define GRAU(a, b)	a b)
-#endif
-#else
-#define UARG(a, b)	a b;
-#define GRAU(a, b)	a b;
-#endif
-
-/*
- * Set up strcasecmp function
- */
-#if defined(LOCAL_STRCASECMP)
-#define STRCASECMP	StrCasecmp
-#ifndef NeedFunctionPrototypes
-static int StrCasecmp();
-#else
-static int StrCasecmp(char*, char*);
-#endif
-#else
-#define STRCASECMP	strcasecmp
-#endif
-
-/*
- * Define XTPOINTER so it works with all releases of
- * Xt and c++.
- */
-#ifdef __cplusplus
-#if XtSpecificationRelease < 5
-#define XTPOINTER	char *
-#else
-#define XTPOINTER	XPointer
-#endif
-#else
-#define XTPOINTER	XtPointer
-#endif
-
-/*
- * The following enum is used to support wide character sets.
- * Use this enum for references into the Common Wide Characters array.
- * If you add to the array, ALWAYS keep NUM_COMMON_WCHARS as the last
- * entry in the enum.  This will maintain correct memory usage, etc.
- */
-enum { WNull, WTab, WNewLine, WCarriageReturn, WFormFeed, WVerticalTab,
-       WBackSlash, WQuote, WHash, WColon, WideF, WideL, WideN, WideR,
-       WideT, WideV, WideUF, WideUL, WideUR, WideUT, WideZero, WideOne,
-       NUM_COMMON_WCHARS };
-
-/*****************************************************************************
- *       GLOBAL DECLARATIONS
- *****************************************************************************/
-
-/*****************************************************************************
- *       EXTERNAL DECLARATIONS
- *****************************************************************************/
-
-/*****************************************************************************
- *	STATIC DECLARATION
- *****************************************************************************/
-
-#ifndef NeedFunctionPrototypes
-
-#ifndef SUPPORTS_WCHARS
-static int	 mblen			();
-#endif
-static int	strlenWc		();
-static size_t	doMbstowcs		();
-static size_t	doWcstombs 		();
-static void	copyWcsToMbs		();
-static int 	dombtowc		();
-static Boolean	extractSegment		();
-static XmString	StringToXmString	();
-static char*	getNextCStrDelim	();
-static int	getCStrCount		();
-static wchar_t *CStrCommonWideCharsGet	();
-
-#else
-
-#ifndef SUPPORTS_WCHARS
-static int 	mblen			(char*, size_t);
-#endif
-static int	strlenWc		(wchar_t*);
-static size_t	doMbstowcs		(wchar_t*, char*, size_t);
-static size_t	doWcstombs 		(char*, wchar_t*, size_t);
-static void	copyWcsToMbs		(char*, wchar_t*, int, Boolean);
-static int 	dombtowc		(wchar_t*, char*, size_t);
-static Boolean	extractSegment		(wchar_t**, wchar_t**, int *,
-					 wchar_t**, int*, int*,	Boolean*);
-static XmString	StringToXmString	(char*);
-static char*	getNextCStrDelim	(char*);
-static int	getCStrCount		(char*);
-static wchar_t *CStrCommonWideCharsGet	();
-
-#endif
-
-/*****************************************************************************
- *	STATIC CODE
- *****************************************************************************/
-
-#if defined(LOCAL_STRCASECMP)
-
-/*
- * Function:
- *      cmp = StrCasecmp(s1, s2);
- * Description:
- *      Compare two strings ignoring case
- * Input:
- *      s1 - char * : string 1 to compare
- *      s2 - char * : string 2 to compare
- * Output:
- *      int :  0; s1 == s2
- *             1; s1 != s2
- */
-static int StrCasecmp
-    ARGLIST((s1, s2))
-        ARG(register char *, s1)
-        GRA(register char *, s2)
-{
-    register int        c1, c2;
-
-    while (*s1 && *s2)
-    {
-        c1 = isupper(*s1) ? tolower(*s1) : *s1;
-        c2 = isupper(*s2) ? tolower(*s2) : *s2;
-        if (c1 != c2)
-        {
-            return(1);
-        }
-        s1++;
-        s2++;
-    }
-    if (*s1 || *s2)
-    {
-        return(1);
-    }
-    return(0);
-}
-#endif
-
-#ifndef SUPPORTS_WCHARS
-/*
- * Function:
- *      len = mblen(s, n);
- * Description:
- *      The mblen function for platforms that don't have one. This
- * 	function simply returns a length of 1 since no wide character
- *	support exists for this platform.
- * Input:
- *      s - char * : the character string to get the length from
- *	n - size_t : the size of the string
- * Output:
- *      int : always 1
- */
-static int mblen
-    ARGLIST((s, n))
-        ARG(char *, s)
-        GRA(size_t, n)
-{
-    return(1);
-}
-#endif
-
-/*
- * Function:
- *      len = strlenWc(ptr);
- * Description:
- *      Return the number of characters in a wide character string (not
- *	the characters in the resultant mbs).
- * Input:
- *      ptr - wchar_t* : pointer to the wcs to count
- * Output:
- *      int : the number of characters found
- */
-static int strlenWc
-    ARGLIST((ptr))
-        GRA(wchar_t *,ptr)
-{
-    register wchar_t	*p = ptr;
-    register int	x = 0;
-
-    if (!ptr) return(0);
-
-    while (*p++) x++;
-    return (x);
-}
-
-/*
- * Function:
- *      bytesConv = doMbstowcs(wcs, mbs, n);
- * Description:
- *      Create a wcs string from an input mbs.
- * Input:
- *	wcs - wchar_t* : pointer to result buffer of wcs
- *      mbs - char* : pointer to the source mbs
- *	n - size_t : the number of characters to convert
- * Output:
- *      bytesConv - size_t : number of bytes converted
- */
-static size_t doMbstowcs
-    ARGLIST((wcs, mbs, n))
-        ARG(wchar_t *,wcs)
-        ARG(char *, mbs)
-        GRA(size_t, n)
-{
-#ifndef SUPPORTS_WCHARS
-    int i;
-
-    for (i = 0; i < n && mbs[i] != 0; ++i)
-    {
-	wcs[i] = mbs[i];
-    }
-    wcs[i++] = 0;
-    return(i);
-#else
-    return(mbstowcs(wcs, mbs, n));
-#endif
-}
-
-/*
- * Function:
- *      bytesConv = doWcstombs(wcs, mbs, n);
- * Description:
- *      Create a mbs string from an input wcs.
- * Input:
- *	wcs - wchar_t* : pointer to the source wcs
- *      mbs - char* : pointer to result mbs buffer
- *	n - size_t : the number of characters to convert
- * Output:
- *      bytesConv - size_t : number of bytes converted
- */
-static size_t doWcstombs
-    ARGLIST((mbs, wcs, n))
-        ARG(char *, mbs)
-        ARG(wchar_t *, wcs)
-        GRA(size_t, n)
-{
-#ifndef SUPPORTS_WCHARS
-    int i;
-
-    for (i = 0; i < n && wcs[i] != 0; ++i)
-    {
-	mbs[i] = wcs[i];
-    }
-    mbs[i] = 0;
-    return(i);
-#else
-    size_t	retval;
-
-    retval = wcstombs(mbs, wcs, (n * sizeof(wchar_t)));
-    if ( retval == (size_t)-1 ) return(0);
-    else return(retval);
-#endif
-}
-
-/*
- * Function:
- *      copyWcsToMbs(mbs, wcs, len);
- * Description:
- *      Create a mbs string from an input wcs. This function allocates
- *	a buffer if necessary.
- * Input:
- *	mbs - char* : destination for the converted/copied output
- *	wcs - wchar_t* : pointer to wcs to copy/convert
- *	len - int : the number of wchar_t' to convert
- *	process_it - Boolean : True if processing of quoted charcters,
- *			False if blind.
- * Output:
- *      None
- */
-static void copyWcsToMbs
-    ARGLIST((mbs, wcs, len, process_it))
-        ARG(char *, mbs)
-        ARG(wchar_t *, wcs)
-        ARG(int, len)
-        GRA(Boolean, process_it)
-{
-    static	wchar_t	*tbuf = NULL;
-    static	int	tbufSize = 0;
-
-    int		numCvt;
-    int		lenToConvert;
-    wchar_t	*fromP = wcs;
-    wchar_t	*x = &fromP[len];
-    wchar_t	*toP;
-    wchar_t	*commonWChars = CStrCommonWideCharsGet();
-    wchar_t	tmp;
-
-    /*
-     * Make sure there's room in the buffer
-     */
-    if (tbufSize < len)
-    {
-	tbuf = (wchar_t*)XtRealloc((char*)tbuf, (len + 1) * sizeof(wchar_t));
-	tbufSize = len;
-    }
-
-    /*
-     * Now copy and process
-     */
-    toP = tbuf;
-    lenToConvert = 0;
-    while (fromP < x)
-    {
-	/*
-	 * Check for quoted characters
-	 */
-	if ((*fromP == commonWChars[WBackSlash]) && process_it)
-	{
-	    fromP++;		/* Skip quote */
-	    if (fromP == x)	/* Hanging quote? */
-	    {
-		*toP++ = commonWChars[WBackSlash];
-		lenToConvert++;
-		break;
-	    }
-	    tmp = *fromP++;
-	    if (tmp == commonWChars[WideN])
-	    {
-		*toP++ = commonWChars[WNewLine];
-	    }
-	    else if (tmp == commonWChars[WideT])
-	    {
-		*toP++ = commonWChars[WTab];
-	    }
-	    else if (tmp == commonWChars[WideR])
-	    {
-		*toP++ = commonWChars[WCarriageReturn];
-	    }
-	    else if (tmp == commonWChars[WideF])
-	    {
-		*toP++ = commonWChars[WFormFeed];
-	    }
-	    else if (tmp == commonWChars[WideV])
-	    {
-		*toP++ = commonWChars[WVerticalTab];
-	    }
-	    else if (tmp == commonWChars[WBackSlash])
-	    {
-		*toP++ = commonWChars[WBackSlash];
-	    }
-	    else
-	    {
-                /*
-		 * No special translation needed
-		 */
-		*toP++ = tmp;
-	    }
-	}
-	else
-	{
-	    *toP++ = *fromP++;
-	}
-	lenToConvert++;
-    }
-
-    tmp = tbuf[lenToConvert];
-    tbuf[lenToConvert] = (wchar_t) 0;
-    numCvt = doWcstombs(mbs, tbuf, lenToConvert);
-    tbuf[lenToConvert] = tmp;
-
-    mbs[numCvt] = '\0';
-}
-
-/*
- * Function:
- *      status = dombtowc(wide, multi, size);
- * Description:
- *      Convert a multibyte character to a wide character.
- * Input:
- *      wide	- wchar_t *	: where to put the wide character
- *	multi	- char *	: the multibyte character to convert
- *	size	- size_t	: the number of characters to convert
- * Output:
- *      0	- if multi is a NULL pointer or points to a NULL character
- *	#bytes	- number of bytes in the multibyte character
- *	-1	- multi is an invalid multibyte character.
- *
- *	NOTE:  if wide is NULL, then this returns the number of bytes in
- *	       the multibyte character.
- */
-static int dombtowc
-    ARGLIST((wide, multi, size))
-        ARG(wchar_t *, wide)
-        ARG(char *, multi)
-        GRA(size_t, size)
-{
-    int		retVal = 0;
-
-#ifndef SUPPORTS_WCHARS
-    if ((multi == NULL) || (*multi == '\000'))
-    {
-	if (wide) wide[0] = '\0';
-	return (0);
-    }
-
-    for (retVal = 0; retVal < size && multi[retVal] != '\000'; retVal++)
-    {
-	if (wide != NULL)
-	{
-	    wide[retVal] = multi[retVal];
-	}
-    }
-#else
-    retVal = mbtowc(wide, multi, size);
-#endif
-    return(retVal);
-}
-
-/*
- * Function:
- *	ptr = getNextSepartor(str);
- * Description:
- *	Parse through a string looking for the next compound string
- *	field separator
- * Inputs:
- *	str - wchar_t* : the address of address of the string to parse
- * Outputs:
- *	ptr - wchar_t* : pointer to character, if found, points to end
- *			of string otherwise ('\0').
- */
-static wchar_t* getNextSeparator
-    ARGLIST((str))
-        GRA(wchar_t *, str)
-{
-    wchar_t	*ptr = str;
-    wchar_t	*commonWChars = CStrCommonWideCharsGet();
-
-    while (*ptr)
-    {
-	/*
-	 * Check for separator
-	 */
-	if ((*ptr == commonWChars[WHash]) ||
-	    (*ptr == commonWChars[WQuote]) ||
-	    (*ptr == commonWChars[WColon]))
-	{
-	    return(ptr);
-	}
-	else if (*ptr == commonWChars[WBackSlash])
-	{
-	    ptr++;
-	    if (*ptr) ptr++;	/* Skip quoted character */
-	}
-	else
-	{
-	    ptr++;
-	}
-    }
-    return(ptr);
-}
-
-/*
- * Function:
- *	more =
- *        extractSegment(str, tagStart, tagLen, txtStart, txtLen,
- *			pDir, pSep);
- * Description:
- *	Parse through a string version of a compound string and extract
- *	the first compound string segment from the string.
- * Inputs:
- *	str - char** : the address of address of the string to parse
- *	tagStart - char** : address to return pointer to tag start into
- *	tagLen - int* : address where to return the tag length into
- *	txtStart - char** : address to return the text start into
- *	txtLen - int* : address where to return the text length
- *	pDir - int* : address to return the string direction into
- *	pSep - Boolean * : address to return the separtor into
- * Outputs:
- *	more - Boolean : True if more of the string to parse.
- *			False means done.
- */
-static Boolean extractSegment
-    ARGLIST((str, tagStart, tagLen, txtStart, txtLen, pDir, pSep))
-        ARG(wchar_t **, str)
-        ARG(wchar_t **, tagStart)
-        ARG(int *, tagLen)
-        ARG(wchar_t **, txtStart)
-        ARG(int *, txtLen)
-        ARG(int *, pDir)
-        GRA(Boolean *, pSep)
-{
-    wchar_t		*start;
-    wchar_t		*text;
-    int			textL;
-    Boolean		tagSeen;
-    wchar_t		*tag;
-    int			tagL;
-    Boolean		modsSeen;
-    Boolean		sep;
-    int			dir;
-    Boolean		done;
-    Boolean		checkDir;
-    wchar_t		*commonWChars;
-    wchar_t		emptyStrWcs[1];
-
-    /*
-     * Initialize variables
-     */
-    text = NULL;
-    textL = 0;
-    tagSeen = False;
-    tag = NULL;
-    tagL = 0;
-    modsSeen = False;
-    dir = XmSTRING_DIRECTION_L_TO_R;
-    sep = False;
-    done = False;
-    commonWChars = CStrCommonWideCharsGet();
-
-    /*
-     * Guard against nulls
-     */
-    if (!(start = *str))
-    {
-	start = emptyStrWcs;
-	emptyStrWcs[0] = commonWChars[WNull];
-    }
-
-    /*
-     * If the first character of the string isn't a # or a ", then we
-     * just have a regular old simple string. Do the same the thing for
-     * the empty string.
-     */
-    if ((*start == '\0') || (start != getNextSeparator(start)))
-    {
-	text = start;
-	if (!(textL = strlenWc(start)))
-	{
-	    text = NULL;
-	}
-	start += textL;
-    }
-    else
-    {
-	done = False;
-	while (!done)
-	{
-	    if (*start == commonWChars[WHash])
-	    {
-		if (tagSeen)
-		{
-		    done = True;
-		    break;
-		}
-		else
-		{
-		    tagSeen = True;
-		    tag = ++start;
-		    start = getNextSeparator(tag);
-		    if ((tagL = start - tag) == 0)
-		    {
-			tag = NULL;		/* Null tag specified */
-		    }
-		}
-	    }
-	    else if (*start == commonWChars[WQuote])
-	    {
-		text = ++start;
-		start = getNextSeparator(start);
-		while (!((*start == commonWChars[WQuote]) ||
-			 (*start == commonWChars[WNull])))
-		{
-		    start = getNextSeparator(++start);
-		}
-
-		if ((textL = start - text) == 0)
-		{
-		    text = NULL;	/* Null text specified  */
-		}
-                /*
-		 * if a quote, skip over it
-		 */
-		if (*start == commonWChars[WQuote])
-		{
-		    start++;
-		}
-		done = True;
-	    }
-	    else if (*start == commonWChars[WColon])
-	    {
-		if (modsSeen)
-		{
-		    done = True;
-		    break;
-		}
-
-		/*
-		 * If the next character is a t or f, the we've got
-		 * a separator.
-		 */
-		modsSeen = True;
-		checkDir = False;
-		start++;
-		if ((*start == commonWChars[WideT]) ||
-		    (*start == commonWChars[WideUT]) ||
-		    (*start == commonWChars[WideOne]))
-		{
-		    sep = True;
-		    start++;
-		    checkDir = True;
-		}
-		else if ((*start == commonWChars[WideF]) ||
-			 (*start == commonWChars[WideUF]) ||
-			 (*start == commonWChars[WideZero]))
-		{
-		    sep = False;
-		    start++;
-		    checkDir = True;
-		}
-		else if ((*start == commonWChars[WideR]) ||
-			 (*start == commonWChars[WideUR]))
-		{
-		    start++;
-		    dir = XmSTRING_DIRECTION_R_TO_L;
-		}
-		else if ((*start == commonWChars[WideL]) ||
-			 (*start == commonWChars[WideUL]))
-		{
-		    start++;
-		    dir = XmSTRING_DIRECTION_L_TO_R;
-		}
-		/*
-		 * Look for direction if necessary. This requires a bit of
-		 * look ahead.
-		 */
-		if (checkDir && (*start == commonWChars[WColon]))
-		{
-		    if ((*(start + 1) == commonWChars[WideL]) ||
-			(*(start + 1) == commonWChars[WideUL]))
-		    {
-			dir = XmSTRING_DIRECTION_L_TO_R;
-			start += 2;
-		    }
-		    else if ((*(start + 1) == commonWChars[WideR]) ||
-			     (*(start + 1) == commonWChars[WideUR]))
-		    {
-			dir = XmSTRING_DIRECTION_R_TO_L;
-			start+=2;
-		    }
-		}
-	    }
-            else
-	    {
-		/*
-		 * A bad string format! We'll just skip the character.
-		 */
-		start++;
-	    }
-	}
-    }
-
-    /*
-     * Now fill in return values
-     */
-    if (*str)		*str = start;
-    if (tagStart)	*tagStart = tag;
-    if (tagLen)		*tagLen = tagL;
-    if (txtStart)	*txtStart = text;
-    if (txtLen)		*txtLen = textL;
-    if (pDir)		*pDir = dir;
-    if (pSep)		*pSep = sep;
-
-    return ((*start == commonWChars[WNull]) ? False : True);
-}
-
-/*
- * Function:
- *	xstr = StringToXmString(str);
- * Description:
- *	Parse a string into an XmString.
- * Inputs:
- *	str - char * : the string to parse
- * Outputs:
- *	xstr - XmString : the allocated return structure
- */
-static XmString StringToXmString
-    ARGLIST((str))
-        GRA(char *,str)
-{
-    static char*	tagBuf = NULL;
-    static int		tagBufLen = 0;
-    static char*	textBuf = NULL;
-    static int		textBufLen = 0;
-
-    wchar_t		*ctx;
-    wchar_t		*tag;
-    int			tagLen;
-    wchar_t		*text;
-    int			textLen;
-    Boolean		sep;
-    int			dir;
-
-    Boolean		more;
-    wchar_t		*wcStr;
-    int			curDir;
-    XmString		xmStr;
-    XmString		s1;
-    XmString		s2;
-
-    if (!str) return(NULL);
-
-    /*
-     * For expediencies sake, we'll overallocate this buffer so that
-     * the wcs is guaranteed to fit (1 wc per byte in original string).
-     */
-    wcStr = (wchar_t*)XtMalloc((strlen(str) + 1) * sizeof(wchar_t));
-    doMbstowcs(wcStr, str, strlen(str) + 1);
-
-    /*
-     * Create the beginning segment
-     */
-    curDir = XmSTRING_DIRECTION_L_TO_R;
-    xmStr = XmStringDirectionCreate(curDir);
-
-    /*
-     * Convert the string.
-     */
-    more = True;
-    ctx = wcStr;
-    while (more)
-    {
-	more = extractSegment(&ctx, &tag, &tagLen,
-			      &text, &textLen, &dir, &sep);
-	/*
-	 * Pick up a direction change
-	 */
-	if (dir != curDir)
-	{
-#if defined(VMS) || (defined(__osf__) && defined(__alpha))
-#if XmVERSION > 1 || (XmVERSION == 1 && XmREVISION >= 2)
-	    /*
-	     * This is required on DEC Windows systems because they've
-	     * added the REVERT direction.
-	     */
-	    s1 = XmStringDirectionCreate(XmSTRING_DIRECTION_REVERT);
-	    s2 = xmStr;
-	    xmStr = XmStringConcat(s2, s1);
-	    XmStringFree(s1);
-	    XmStringFree(s2);
-#endif
-#endif
-	    curDir = dir;
-	    s1 = XmStringDirectionCreate(curDir);
-	    s2 = xmStr;
-	    xmStr = XmStringConcat(s2, s1);
-	    XmStringFree(s1);
-	    XmStringFree(s2);
-
-	}
-
-	/*
-	 * Create the segment. Text and tag first.
-	 */
-	if (textLen)
-	{
-	    if (textBufLen <= (textLen * sizeof(wchar_t)))
-	    {
-		textBufLen = (textLen + 1) * sizeof(wchar_t);
-		textBuf = (char*)XtRealloc(textBuf, textBufLen);
-	    }
-	    copyWcsToMbs(textBuf, text, textLen, True);
-
-	    if (tagLen)
-	    {
-		if (tagBufLen <= (tagLen * sizeof(wchar_t)))
-		{
-		    tagBufLen = (tagLen + 1) * sizeof(wchar_t);
-		    tagBuf = (char*)XtRealloc(tagBuf, tagBufLen);
-		}
-		copyWcsToMbs(tagBuf, tag, tagLen, False);
-	    }
-	    else
-	    {
-		if (!tagBuf)
-		{
-		    tagBufLen = strlen(XmSTRING_DEFAULT_CHARSET) + 1;
-		    tagBuf = (char*)XtMalloc(tagBufLen);
-		}
-		strcpy(tagBuf, XmSTRING_DEFAULT_CHARSET);
-	    }
-
-	    s1 = XmStringCreate(textBuf, tagBuf);
-	    s2 = xmStr;
-	    xmStr = XmStringConcat(s2, s1);
-	    XmStringFree(s1);
-	    XmStringFree(s2);
-	}
-
-	/*
-	 * Add in the separators.
-	 */
-	if (sep)
-	{
-	    s1 = XmStringSeparatorCreate();
-	    s2 = xmStr;
-	    xmStr = XmStringConcat(s2, s1);
-	    XmStringFree(s1);
-	    XmStringFree(s2);
-	}
-    }
-
-    /*
-     * Free up memory and return
-     */
-    XtFree((char*)wcStr);
-    return(xmStr);
-}
-
-/*
- * Function:
- *      nextCStr = getNextCStrDelim(str);
- * Description:
- *      Find the next unquoted , or \n in the string
- * Input:
- *	str - char * : the input string
- * Output:
- *      nextCStr - char* : pointer to the next delimiter. Returns NULL if no
- *			delimiter found.
- */
-static char* getNextCStrDelim
-    ARGLIST((str))
-        GRA(char *,str)
-{
-    char	*comma = str;
-    Boolean	inQuotes = False;
-    int		len;
-
-    if (!str) return(NULL);
-    if (!*str) return(NULL);	/* At end */
-
-#ifdef __CENTERLINE__
-    len = mblen((char *)NULL, sizeof(wchar_t));
-#else
-    len = mblen(NULL, sizeof(wchar_t));
-#endif
-    while (*comma)
-    {
-	if ((len = mblen(comma, sizeof(wchar_t))) > 1)
-	{
-	    comma += len;
-	    continue;
-	}
-
-	if (*comma == '\\')
-	{
-	    comma++;	/* Over quote */
-	    comma += mblen(comma, sizeof(wchar_t));
-	    continue;
-	}
-
-	/*
-	 * See if we have a delimiter
-	 */
-	if (!inQuotes)
-	{
-	    if ((*comma == ',') || (*comma == '\012'))
-	    {
-		return(comma);
-	    }
-	}
-
-	/*
-	 * Deal with quotes
-	 */
-	if (*comma == '\"')
-	{
-	    inQuotes = ~inQuotes;
-	}
-
-	comma++;
-    }
-
-    return(NULL);		/* None found */
-}
-
-/*
- * Function:
- *	cnt = getCStrCount(str);
- * Description:
- *      Get the count of cstrings in a compound string table ascii
- *	format.
- * Input:
- *      str - char * : string to parse
- * Output:
- *      cnt - int : the number of XmStrings found
- */
-static int getCStrCount
-    ARGLIST((str))
-        GRA(char *, str)
-{
-    int		x = 1;
-    char	*newStr;
-
-    if (!str) return(0);
-    if (!*str) return(0);
-
-    while ((newStr = getNextCStrDelim(str)))
-    {
-	x++;
-	str = ++newStr;
-    }
-    return(x);
-}
-
-/*
- * Function:
- *      cwc = CStrCommonWideCharsGet();
- * Description:
- *      Return the array of common wide characters.
- * Input:
- *      None.
- * Output:
- *     	cwc - wchar_t * : this array should never be written to or FREEd.
- */
-static wchar_t *CStrCommonWideCharsGet()
-{
-    static wchar_t	*CommonWideChars = NULL;
-    /*
-     * If you add to this array, don't forget to change the enum in
-     * the TYPEDEFS and DEFINES section above to correspond to this
-     * array.
-     */
-    static char	*characters[] = { "\000", "\t", "\n", "\r", "\f", "\v",
-				  "\\", "\"", "#", ":", "f", "l", "n", "r",
-				  "t", "v", "F", "L", "R", "T", "0", "1" };
-
-
-    if (CommonWideChars == NULL)
-    {
-	int	i;
-
-	/*
-	 * Allocate and create the array.
-	 */
-	CommonWideChars = (wchar_t*)XtMalloc(NUM_COMMON_WCHARS * sizeof(wchar_t));
-
-	for (i = 0; i < NUM_COMMON_WCHARS; i++)
-	{
-	    (void)dombtowc(&(CommonWideChars[i]), characters[i], 1);
-	}
-    }
-    return(CommonWideChars);
-}
-
-/*
- * Function:
- *	CONVERTER CvtStringToXmString
- *
- * Description:
- *	Convert a string to an XmString. This allows a string contained in
- *	resource file to contain multiple fonts. The syntax for the string
- *	is:
- *		::[#[font-tag]]"string"[#[font-tag]"string"] ...
- *
- *	note that the # can be escaped (\#).
- *
- * Input:
- * Output:
- *	Standard.
- */
-static Boolean CvtStringToXmString
-    ARGLIST((d, args, num_args, fromVal, toVal, data))
-        ARG(Display *, d)
-        UARG(XrmValue *, args)
-        ARG(Cardinal *, num_args)
-        ARG(XrmValue *, fromVal)
-        ARG(XrmValue *, toVal)
-        GRAU(XtPointer, data)
-{
-    static XmString	resStr;
-    char		*str;
-
-    /*
-     * This converter takes no parameters
-     */
-    if (*num_args != 0)
-    {
-	XtAppWarningMsg(XtDisplayToApplicationContext(d),
-			"cvtStringToXmString",
-			"wrongParameters",
-			"XtToolkitError",
-			"String to XmString converter needs no extra arguments",
-			(String *)NULL,
-			(Cardinal *)NULL);
-    }
-
-    /*
-     * See if this is a simple string
-     */
-    str = (char*)fromVal->addr;
-    if (strncmp(str, "::", 2))
-    {
-	resStr = XmStringCreateLtoR(fromVal->addr, XmSTRING_DEFAULT_CHARSET);
-    }
-    else
-    {
-	/*
-	 * Convert into internal format
-	 */
-	resStr = StringToXmString(fromVal->addr + 2);	/* skip :: */
-    }
-
-    /*
-     * Done, return result
-     */
-    if (toVal->addr == NULL)
-    {
-	toVal->addr = (XTPOINTER)&resStr;
-	toVal->size = sizeof(XmString);
-    }
-    else if (toVal->size < sizeof(XmString))
-    {
-	toVal->size = sizeof(XmString);
-	XtDisplayStringConversionWarning(d, fromVal->addr, "XmString");
-	XmStringFree(resStr);
-	return(False);
-    }
-    else
-    {
-	*(XmString *)toVal->addr = resStr;
-	toVal->size = sizeof(XmString);
-    }
-    return(True);
-}
-
-/*
- * Function:
- *      CONVERTER CvtStringToXmStringTable
- *
- * Description:
- *	Convert a string to an XmString table. This allows a string
- *	contained in resource file to contain multiple fonts. The syntax
- *	for the string is:
- *
- *	   compound_string = [#[font-tag]]"string"[#[font-tag]"string"] ...
- *	   compound_string_table = [compound_string][,compound_string] ...
- *
- *	note that the # can be escaped (\#).
- *
- * Input:
- * Output:
- *	Standard.
- */
-static Boolean CvtStringToXmStringTable
-    ARGLIST((d, args, num_args, fromVal, toVal, data))
-        ARG(Display *, d)
-        ARG(XrmValue *, args)
-        ARG(Cardinal *, num_args)
-        ARG(XrmValue *, fromVal)
-        ARG(XrmValue *, toVal)
-        GRAU(XtPointer, data)
-{
-    static XmString	*CStrTable;
-    XmString		*tblPtr;
-    char		*str;
-    char		*tmpBuf;
-    char		*nextDelim;
-    XrmValue		fVal;
-    XrmValue		tVal;
-
-    /*
-     * This converter takes no parameters
-     */
-    if (*num_args != 0)
-    {
-	XtAppWarningMsg
-	    (XtDisplayToApplicationContext(d),
-	     "cvtStringToXmStringTable",
-	     "wrongParameters",
-	     "XtToolkitError",
-	     "String to XmStringTable converter needs no extra arguments",
-	     (String *)NULL,
-	     (Cardinal *)NULL);
-    }
-
-    /*
-     * Set str and make sure there's somethin' there
-     */
-    if (!(str = (char*)fromVal->addr))
-    {
-	str = "";
-    }
-
-    /*
-     * Allocate the XmStrings + 1 for NULL termination
-     */
-    CStrTable = (XmString*)XtMalloc((getCStrCount(str) + 1) * sizeof(XmString*));
-
-    /*
-     * Use the string converter for the strings
-     */
-    tmpBuf = (char*)XtMalloc(strlen(str) + 1);
-    strcpy(tmpBuf, str);
-    str = tmpBuf;
-
-    /*
-     * Create strings
-     */
-    tblPtr = CStrTable;
-    if (*str)
-    {
-	while (str)
-	{
-	    nextDelim = getNextCStrDelim(str);
-
-	    /*
-	     * Overwrite nextDelim
-	     */
-	    if (nextDelim)
-	    {
-		*nextDelim = '\0';
-		nextDelim++;
-	    }
-
-	    /*
-	     * Convert it
-	     */
-	    fVal.size = strlen(str) + 1;
-	    fVal.addr = str;
-	    tVal.size = sizeof(XTPOINTER);
-	    tVal.addr = (XTPOINTER)tblPtr;
-
-	    /*
-	     * Call converter ourselves since this is used to create
-	     * the strings in the table we create. We need to do this
-	     * since we don't have a widget to send to the XtConvertAndStore
-	     * function. Side effects are that we can never get these
-	     * compound strings cached and that no destructor function is
-	     * called when the strings leave existance, but we nuke 'em
-	     * in the XmStringTable destuctor.
-	     */
-	    CvtStringToXmString(d, args, num_args, &fVal, &tVal, NULL);
-	    tblPtr++;
-	    str = nextDelim;
-	}
-    }
-    XtFree(tmpBuf);
-
-    /*
-     * Null terminate
-     */
-    *tblPtr = NULL;
-
-    /*
-     * Done, return result
-     */
-    if (toVal->addr == NULL)
-    {
-	toVal->addr = (XTPOINTER)&CStrTable;
-	toVal->size = sizeof(XmString);
-    }
-    else if (toVal->size < sizeof(XmString*))
-    {
-	toVal->size = sizeof(XmString*);
-	XtDisplayStringConversionWarning(d, fromVal->addr, "XmStringTable");
-
-	tblPtr = CStrTable;
-	while (*tblPtr)
-	{
-	    XmStringFree(*tblPtr);
-	}
-	XtFree((char*)CStrTable);
-	return(False);
-    }
-    else
-    {
-	*(XmString **)toVal->addr = CStrTable;
-	toVal->size = sizeof(XmString*);
-    }
-    return(True);
-}
-
-/*****************************************************************************
- *	GLOBAL CODE
- *****************************************************************************/
-
-/*
- * Function:
- *      RegisterBxConverters(appContext);
- * Description:
- *      This globally available function installs all the converters necessary
- *	to run BuilderXcessory generated interfaces that use compound
- *	strings. This is necessary since Motif has not supplied very smart
- *	converters.
- * Input:
- *      appContext - XtAppContext : the application context
- * Output:
- *      None
- */
-void RegisterBxConverters
-    ARGLIST((appContext))
-        GRA(XtAppContext, appContext)
-{
-    XtAppSetTypeConverter(appContext, XmRString, XmRXmString,
-			  (XtTypeConverter)CvtStringToXmString,
-			  NULL, 0, XtCacheNone, NULL);
-
-    XtAppSetTypeConverter(appContext, XmRString, XmRXmStringTable,
-			  (XtTypeConverter)CvtStringToXmStringTable,
-			  NULL, 0, XtCacheNone, NULL);
-}
-
-/*
- * Function:
- *      CONVERT(w, from_string, to_type, to_size, success);
- * Description:
- *      A converter wrapper for convenience from BuilderXcessory.
- * Input:
- *      w - Widget : the widget to use for conversion
- *	from_string - char * : the string to convert from
- *	to_type - char * : the type to convert to
- *	to_size - int : the size of the conversion result
- *	success - Boolean* : Set to the result value of the conversion
- * Output:
- *      None
- */
-#ifndef IGNORE_CONVERT
-XtPointer BX_CONVERT
-    ARGLIST((w, from_string, to_type, to_size, success))
-        ARG(Widget, w)
-        ARG(char *, from_string)
-        ARG(char *, to_type)
-        UARG(int, to_size)
-        GRA(Boolean *, success)
-{
-    XrmValue		fromVal, toVal;	/* resource holders		*/
-    Boolean		convResult;	/* return value			*/
-    XtPointer		val;		/* Pointer size return value    */
-
-    /*
-     * We will assume that the conversion is going to fail and change this
-     * value later if the conversion is a success.
-     */
-    *success = False;
-    /*
-     * Since we are converting from a string to some type we need to
-     * set the fromVal structure up with the string information that
-     * the caller passed in.
-     */
-    fromVal.size = strlen(from_string) + 1;
-    fromVal.addr = from_string;
-
-    /*
-     * Since we are not sure what type and size of data we are going to
-     * get back we will set this up so that the converter will point us
-     * at a block of valid data.
-     */
-    toVal.size = 0;
-    toVal.addr = NULL;
-
-    /*
-     * Now lets try to convert this data by calling this handy-dandy Xt
-     * routine.
-     */
-    convResult = XtConvertAndStore(w, XmRString, &fromVal, to_type, &toVal);
-
-
-    /*
-     * Now we have two conditions here.  One the conversion was a success
-     * and two the conversion failed.
-     */
-    if(!convResult)
-    {
-	/*
-	 * If this conversion failed that we can pretty much return right
-	 * here because there is nothing else we can do.
-	 */
-	return((XtPointer) NULL);
-    }
-
-    /*
-     * If we get this far that means we did the conversion and all is
-     * well.  Now we have to handle the special cases for type and
-     * size constraints.
-     */
-    if(!strcmp(to_type, "String"))
-    {
-	/*
-	 * Since strings are handled different in Xt we have to deal with
-	 * the conversion from a string to a string.  When this happens the
-	 * toVal.size will hold the strlen of the string so generic
-	 * conversion code can't handle it.  It is possible for a string to
-	 * string conversion to happen so we do have to watch for it.
-	 */
-	val = (XTPOINTER)toVal.addr;
-    }
-    else if(!strcmp(to_type, "Double"))
-    {
-	val = (XTPOINTER)((double*)toVal.addr);
-    }
-    else if(!strcmp(to_type, "Float"))
-    {
-	val = (XTPOINTER)((float*)toVal.addr);
-    }
-    else
-    {
-	/*
-	 * Here is the generic conversion return value handler.  This
-	 * just does some size specific casting so that value that we
-	 * return is in the correct bytes of the XtPointer that we
-	 * return.  Here we check all sizes from 1 to 8 bytes.
-	 */
-	switch(toVal.size)
-	{
-	case 1:
-	    val = (XTPOINTER)(long)(*(char*)toVal.addr);
-	    break;
-	case 2:
-	    val = (XTPOINTER)(long)(*(short*)toVal.addr);
-	    break;
-	case 4:
-	    val = (XTPOINTER)(long)(*(int*)toVal.addr);
-	    break;
-	case 8:
-	default:
-	    val = (XTPOINTER)(long)(*(long*)toVal.addr);
-	    break;
-	}
-    }
-
-    /*
-     * Well everything is done and the conversion was a success so lets
-     * set the success flag to True.
-     */
-    *success = convResult;
-
-    /*
-     * Finally lets return the converted value.
-     */
-    /*SUPPRESS 80*/
-    return(val);
-}
-
-#ifdef DEFINE_OLD_BXUTILS
-XtPointer CONVERT
-    ARGLIST((w, from_string, to_type, to_size, success))
-        ARG(Widget, w)
-        ARG(char *, from_string)
-        ARG(char *, to_type)
-        ARG(int, to_size)
-        GRA(Boolean *, success)
-{
-    return(BX_CONVERT(w, from_string, to_type, to_size, success));
-}
-#endif /* DEFINE_OLD_BXUTILS */
-#endif /* !IGNORE_CONVERT */
-
-/*
- * Function:
- *      MENU_POST(p, mw, ev, dispatch);
- * Description:
- *      A converter wrapper for convenience from BuilderXcessory.
- * Input:
- *      p - Widget : the widget to post
- *	mw - XtPointer : the menu widget
- *	ev - XEvent* : the event that caused the menu post
- *	dispatch - Boolean* : not used
- * Output:
- *      None
- */
-
-#ifndef IGNORE_MENU_POST
-void BX_MENU_POST
-    ARGLIST((p, mw, ev, dispatch))
-        UARG(Widget, p)
-        ARG(XtPointer, mw)
-        ARG(XEvent *, ev)
-        GRAU(Boolean *, dispatch)
-{
-    Arg	args[2];
-    int	argcnt;
-    int	button;
-    Widget m = (Widget)mw;
-    XButtonEvent *e = (XButtonEvent *)ev;
-
-    argcnt = 0;
-    XtSetArg(args[argcnt], XmNwhichButton, &button);
-    argcnt++;
-    XtGetValues(m, args, argcnt);
-    if(e->button != button) return;
-    XmMenuPosition(m, e);
-    XtManageChild(m);
-}
-
-#ifdef DEFINE_OLD_BXUTILS
-void MENU_POST
-    ARGLIST((p, mw, ev, dispatch))
-        UARG(Widget, p)
-        ARG(XtPointer, mw)
-        ARG(XEvent *, ev)
-        GRAU(Boolean *, dispatch)
-{
-    BX_MENU_POST(p, mw, ev, dispatch);
-}
-#endif /* DEFINE_OLD_BXUTILS */
-#endif /* !IGNORE_MENU_POST */
-
-/*
- * Function:
- *      SET_BACKGROUND_COLOR(w, args, argcnt, bg_color);
- * Description:
- *      Sets the background color and shadows of a widget.
- * Input:
- *      w - The widget to set the background color on.
- *      args, argcnt - The argument list so far.
- *      bg_color - The new background color as a pixel.
- * Output:
- *      none
- *
- *  NOTES:  This assumes that args later in the argument list
- *          override those already in the list.  Therfore i f
- *          there are shadow colors later in the list they will win.
- *
- *          There is no need to use this function when creating a widget
- *          only when doing a set values, shadow colors are automatically
- *          calculated at creation time.
- */
-void BX_SET_BACKGROUND_COLOR
-    ARGLIST((w, args, argcnt, bg_color))
-        ARG(Widget, w)
-        ARG(ArgList, args)
-        ARG(Cardinal *, argcnt)
-        GRA(Pixel, bg_color)
-{
-
-#if ((XmVERSION == 1) && (XmREVISION > 0))
-
-    /*
-     * Walk through the arglist to see if the user set the top or
-     * bottom shadow colors.
-     */
-    selectLoc = topShadowLoc =  bottomShadowLoc = UNSET;
-    for (i = 0; i < *argcnt; i++)
-    {
-	if ((strcmp(args[i].name, XmNtopShadowColor) == 0) ||
-	    (strcmp(args[i].name, XmNtopShadowPixmap) == 0))
-	{
-	    topShadowLoc = i;
-	}
-	else if ((strcmp(args[i].name, XmNbottomShadowColor) == 0) ||
-		 (strcmp(args[i].name, XmNbottomShadowPixmap) == 0))
-	{
-	    bottomShadowLoc = i;
-	}
-	else if (strcmp(args[i].name, XmNarmColor) == 0)
-	{
-	    selectLoc = i;
-	}
-	else if (strcmp(args[i].name, XmNforeground) == 0)
-	{
-	    fgLoc = i;
-	}
-    }
-
-    /*
-     * If either the top or bottom shadow are not set then we
-     * need to use XmGetColors to get the shadow colors from the backgound
-     * color and add those that are not already in the arglist to the
-     * arglist.
-     *
-     */
-    if ((bottomShadowLoc == UNSET) ||
-	(topShadowLoc == UNSET) ||
-	(selectLoc == UNSET) ||
-	(fgLoc == UNSET))
-    {
-	Arg		larg[1];
-	Colormap	cmap;
-	Pixel		topShadow;
-	Pixel		bottomShadow;
-	Pixel		select;
-	Pixel		fgColor;
-
-	XtSetArg(larg[0], XmNcolormap, &cmap);
-	XtGetValues(w, larg, 1);
-	XmGetColors(XtScreen(w), cmap, bg_color,
-		    &fgColor, &topShadow, &bottomShadow, &select);
-
-	if (topShadowLoc == UNSET)
-	{
-	    XtSetArg(args[*argcnt], XmNtopShadowColor, topShadow);
-	    (*argcnt)++;
-	}
-
-	if (bottomShadowLoc == UNSET)
-	{
-	    XtSetArg(args[*argcnt], XmNbottomShadowColor, bottomShadow);
-	    (*argcnt)++;
-	}
-
-	if (selectLoc == UNSET)
-	{
-	    XtSetArg(args[*argcnt], XmNarmColor, select);
-	    (*argcnt)++;
-	}
-
-	if (fgLoc == UNSET)
-	{
-	    XtSetArg(args[*argcnt], XmNforeground, fgColor);
-	    (*argcnt)++;
-	}
-    }
-#endif
-
-    XtSetArg(args[*argcnt], XmNbackground, bg_color); (*argcnt)++;
-}
-
-#ifdef DEFINE_OLD_BXUTILS
-void SET_BACKGROUND_COLOR
-    ARGLIST((w, args, argcnt, bg_color))
-        ARG(Widget, w)
-        ARG(ArgList, args)
-        ARG(Cardinal *, argcnt)
-        GRA(Pixel, bg_color)
-{
-    BX_SET_BACKGROUND_COLOR(w, args, argcnt, bg_color);
-}
-#endif /* DEFINE_OLD_BXUTILS */
-
-/*
- * Function:
- *	w = BxFindTopShell(start);
- * Description:
- *	Go up the hierarhcy until we find a shell widget.
- * Input:
- *      start - Widget : the widget to start with.
- * Output:
- *	w - Widget : the shell widget.
- */
-#ifndef _BX_FIND_TOP_SHELL
-#define _BX_FIND_TOP_SHELL
-
-Widget BxFindTopShell
-    ARGLIST((start))
-        GRA(Widget, start)
-{
-    Widget	p;
-
-    while((p = XtParent(start)))
-    {
-	start = p;
-    }
-    return(start);
-}
-#endif /* _BX_FIND_TOP_SHELL */
-
-/*
- * Function:
- *	BxWidgetIdsFromNames(ref, cbName, stringList)
- * Description:
- *	Return an array of widget ids from a list of widget names.
- * Input:
- *	ref - Widget : reference widget.
- *	cbName - char* : callback name.
- *	stringList - char*: list of widget names.
- * Output:
- *	WidgetList : array of widget IDs.
- */
-
-#ifndef _BX_WIDGETIDS_FROM_NAMES
-#define _BX_WIDGETIDS_FROM_NAMES
-
-WidgetList BxWidgetIdsFromNames
-    ARGLIST((ref, cbName, stringList))
-        ARG(Widget, ref)
-        ARG(char, *cbName)
-        GRA(char, *stringList)
-{
-    WidgetList	wgtIds = NULL;
-    int		wgtCount = 0;
-    Widget	inst;
-    Widget	current;
-    String	tmp;
-    String	start;
-    String	widget;
-    char       *ptr;
-
-    /*
-     * For backward compatibility, remove [ and ] from the list.
-     */
-    tmp = start = XtNewString(stringList);
-    if((start = strchr(start, '[')) != NULL) start++;
-    else start = tmp;
-
-    while((start && *start) && isspace(*start))
-    {
-	start++;
-    }
-    ptr = strrchr(start, ']');
-    if (ptr)
-    {
-	*ptr = '\0';
-    }
-
-    ptr = start + strlen(start) - 1;
-    while(ptr && *ptr)
-    {
-	if (isspace(*ptr))
-	{
-	    ptr--;
-	}
-	else
-	{
-	    ptr++;
-	    break;
-	}
-    }
-    if (ptr && *ptr)
-    {
-	*ptr = '\0';
-    }
-
-    /*
-     * start now points to the first character after the [.
-     * the list is now either empty, one, or more widget
-     * instance names.
-     */
-    start = strtok(start, ",");
-    while(start)
-    {
-        while((start && *start) && isspace(*start))
-        {
-            start++;
-        }
-        ptr = start + strlen(start) - 1;
-        while(ptr && *ptr)
-        {
-            if (isspace(*ptr))
-            {
-                ptr--;
-            }
-            else
-            {
-                ptr++;
-                break;
-            }
-        }
-        if (ptr && *ptr)
-        {
-            *ptr = '\0';
-        }
-
-	/*
-	 * Form a string to use with XtNameToWidget().
-	 */
-        widget = (char *)XtMalloc((strlen(start) + 2) * sizeof(char));
-        sprintf(widget, "*%s", start);
-
-	/*
-	 * Start at this level and continue up until the widget is found
-	 * or until the top of the hierarchy is reached.
-	 */
-	current = ref;
-	while (current != NULL)
-	{
-	    inst = XtNameToWidget(current, widget);
-	    if (inst != NULL )
-	    {
-		wgtCount++;
-		wgtIds = (WidgetList)XtRealloc((char *)wgtIds,
-					       wgtCount * sizeof(Widget));
-		wgtIds[wgtCount - 1] = inst;
-		break;
-	    }
-	    current = XtParent(current);
-	}
-
-	if (current == NULL)
-        {
-            printf("Callback Error (%s):\n\t\
-Cannot find widget %s\n", cbName, widget);
-        }
-        XtFree(widget);
-        start = strtok(NULL, ",");
-    }
-
-    /*
-     * NULL terminate the list.
-     */
-    wgtIds = (WidgetList)XtRealloc((char *)wgtIds,
-				   (wgtCount + 1) * sizeof(Widget));
-    wgtIds[wgtCount] = NULL;
-
-    XtFree((char *)tmp);
-    return(wgtIds);
-}
-#endif /* _BX_WIDGETIDS_FROM_NAMES */
-
-XtPointer BX_SINGLE
-    ARGLIST((val))
-    GRA(float, val)
-{
-    XtPointer pointer;
-
-    pointer = (XtPointer)XtMalloc(sizeof(float));
-    if ( pointer != NULL ) *((float *)pointer) = val;
-    return(pointer);
-}
-
-#ifdef DEFINE_OLD_BXUTILS
-XtPointer SINGLE
-    ARGLIST((val))
-    GRA(float, val)
-{
-    return(BX_SINGLE(val));
-}
-#endif /* DEFINE_OLD_BXUTILS */
-
-XtPointer BX_DOUBLE
-    ARGLIST((val))
-    GRA(double, val)
-{
-    XtPointer	pointer;
-
-    pointer = (XtPointer)XtMalloc(sizeof(double));
-    if ( pointer != NULL ) *((double *)pointer) = val;
-    return(pointer);
-}
-
-#ifdef DEFINE_OLD_BXUTILS
-XtPointer DOUBLE
-    ARGLIST((val))
-    GRA(double, val)
-{
-    return(BX_DOUBLE(val));
-}
-#endif /* DEFINE_OLD_BXUTILS */
-
-
-/****************************************************************************
- *
- * Big chunk of code inserted from Bull (based on modified 3.3)
- *
- ****************************************************************************/
-
-#ifndef IGNORE_XPM_PIXMAP
-
-#ifndef USE_XPM_LIBRARY
-
-#ifdef SYSV
-#include <memory.h>
-#endif
-
-/*
- * Copyright 1990, 1991 GROUPE BULL
- *
- * Permission to use, copy, modify, and distribute this software and its
- * documentation for any purpose and without fee is hereby granted, provided
- * that the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of GROUPE BULL not be used in advertising
- * or publicity pertaining to distribution of the software without specific,
- * written prior permission.  GROUPE BULL makes no representations about the
- * suitability of this software for any purpose.  It is provided "as is"
- * without express or implied warranty.
- *
- * GROUPE BULL disclaims all warranties with regard to this software,
- * including all implied warranties of merchantability and fitness,
- * in no event shall GROUPE BULL be liable for any special,
- * indirect or consequential damages or any damages
- * whatsoever resulting from loss of use, data or profits,
- * whether in an action of contract, negligence or other tortious
- * action, arising out of or in connection with the use
- * or performance of this software.
- *
- */
-
-/* Return ErrorStatus codes:
- * null     if full success
- * positive if partial success
- * negative if failure
- */
-
-#define BxXpmColorError    1
-#define BxXpmSuccess       0
-#define BxXpmOpenFailed   -1
-#define BxXpmFileInvalid  -2
-#define BxXpmNoMemory     -3
-#define BxXpmColorFailed  -4
-
-typedef struct {
-    char *name;                         /* Symbolic color name */
-    char *value;                        /* Color value */
-    Pixel pixel;                        /* Color pixel */
-} 	BxXpmColorSymbol;
-
-typedef struct {
-    unsigned long valuemask;            /* Specifies which attributes are
-                                         * defined */
-
-    Visual *visual;                     /* Specifies the visual to use */
-    Colormap colormap;                  /* Specifies the colormap to use */
-    unsigned int depth;                 /* Specifies the depth */
-    unsigned int width;                 /* Returns the width of the created
-                                         * pixmap */
-    unsigned int height;                /* Returns the height of the created
-                                         * pixmap */
-    unsigned int x_hotspot;             /* Returns the x hotspot's
-                                         * coordinate */
-    unsigned int y_hotspot;             /* Returns the y hotspot's
-                                         * coordinate */
-    unsigned int cpp;                   /* Specifies the number of char per
-                                         * pixel */
-    Pixel *pixels;                      /* List of used color pixels */
-    unsigned int npixels;               /* Number of pixels */
-    BxXpmColorSymbol *colorsymbols;       /* Array of color symbols to
-                                         * override */
-    unsigned int numsymbols;            /* Number of symbols */
-    char *rgb_fname;                    /* RGB text file name */
-
-    /* Infos */
-    unsigned int ncolors;               /* Number of colors */
-    char ***colorTable;                 /* Color table pointer */
-    char *hints_cmt;                    /* Comment of the hints section */
-    char *colors_cmt;                   /* Comment of the colors section */
-    char *pixels_cmt;                   /* Comment of the pixels section */
-    unsigned int mask_pixel;            /* Transparent pixel's color table
-                                         * index */
-}      BxXpmAttributes;
-
-/* Xpm attribute value masks bits */
-#define BxXpmVisual          (1L<<0)
-#define BxXpmColormap        (1L<<1)
-#define BxXpmDepth           (1L<<2)
-#define BxXpmSize            (1L<<3)      /* width & height */
-#define BxXpmHotspot         (1L<<4)      /* x_hotspot & y_hotspot */
-#define BxXpmCharsPerPixel   (1L<<5)
-#define BxXpmColorSymbols    (1L<<6)
-#define BxXpmRgbFilename     (1L<<7)
-#define BxXpmInfos           (1L<<8)      /* all infos members */
-
-#define BxXpmReturnPixels    (1L<<9)
-#define BxXpmReturnInfos     BxXpmInfos
-
-/*
- * minimal portability layer between ansi and KR C
- */
-
-/* forward declaration of functions with prototypes */
-
-#ifdef NeedFunctionPrototypes
-#define LFUNC(f, t, p) static t f p
-#else
-#define LFUNC(f, t, p) static t f()
-#endif
-
-/*
- * functions declarations
- */
-LFUNC(BxXpmCreatePixmapFromData, int, (Display * display,
-				       Drawable d,
-				       char **data,
-				       Pixmap * pixmap_return,
-				       Pixmap * shapemask_return,
-				       BxXpmAttributes * attributes));
-
-LFUNC(BxXpmCreateImageFromData, int, (Display * display,
-				      char **data,
-				      XImage ** image_return,
-				      XImage ** shapemask_return,
-				      BxXpmAttributes * attributes));
-
-LFUNC(BxXpmFreeAttributes, void, (BxXpmAttributes * attributes));
-
-typedef struct {
-    unsigned int type;
-    union {
-        FILE *file;
-        char **data;
-    }     stream;
-    char *cptr;
-    unsigned int line;
-    int CommentLength;
-    char Comment[BUFSIZ];
-    char *Bcmt, *Ecmt, Bos, Eos;
-    unsigned int InsideString;          /* used during parsing: 0 or 1
-                                         * whether we are inside or not */
-}      bxxpmData;
-
-#define BXXPMARRAY 0
-#define BXXPMFILE  1
-#define BXXPMPIPE  2
-
-typedef unsigned char byte;
-
-#define BX_TRANSPARENT_COLOR "None"        /* this must be a string! */
-
-/* number of BxXpmColorKeys */
-#define BXNKEYS 5
-
-/*
- * key numbers for visual type, they must fit along with the number key of
- * each corresponding element in BxXpmColorKeys[] defined in xpm.h
- */
-#define BXMONO    2
-#define BXGRAY4   3
-#define BXGRAY    4
-#define BXCOLOR   5
-
-/* structure containing data related to an Xpm pixmap */
-typedef struct {
-    char *name;
-    unsigned int width;
-    unsigned int height;
-    unsigned int cpp;
-    unsigned int ncolors;
-    char ***colorTable;
-    unsigned int *pixelindex;
-    XColor *xcolors;
-    char **colorStrings;
-    unsigned int mask_pixel;            /* mask pixel's colorTable index */
-}      bxxpmInternAttrib;
-
-#define BX_UNDEF_PIXEL 0x80000000
-
-char *BxXpmColorKeys[] =
-{
- "s",					/* key #1: symbol */
- "m",					/* key #2: mono visual */
- "g4",					/* key #3: 4 grays visual */
- "g",					/* key #4: gray visual */
- "c",					/* key #5: color visual */
-};
-
-/* XPM private routines */
-
-LFUNC(xpmCreateImage, int, (Display * display,
-                           bxxpmInternAttrib * attrib,
-                           XImage ** image_return,
-                           XImage ** shapeimage_return,
-                           BxXpmAttributes * attributes));
-
-LFUNC(xpmParseData, int, (bxxpmData * data,
-                         bxxpmInternAttrib * attrib_return,
-                         BxXpmAttributes * attributes));
-
-LFUNC(BxXpmVisualType, int, (Visual * visual));
-LFUNC(xpmFreeColorTable, void, (char ***colorTable, int ncolors));
-
-LFUNC(xpmInitInternAttrib, void, (bxxpmInternAttrib * xmpdata));
-
-LFUNC(xpmFreeInternAttrib, void, (bxxpmInternAttrib * xmpdata));
-
-LFUNC(xpmSetAttributes, void, (bxxpmInternAttrib * attrib,
-                             BxXpmAttributes * attributes));
-
-/* I/O utility */
-
-LFUNC(xpmNextString, void, (bxxpmData * mdata));
-LFUNC(xpmNextUI, int, (bxxpmData * mdata, unsigned int *ui_return));
-LFUNC(xpmGetC, int, (bxxpmData * mdata));
-LFUNC(xpmUngetC, int, (int c, bxxpmData * mdata));
-LFUNC(xpmNextWord, unsigned int, (bxxpmData * mdata, char *buf));
-LFUNC(xpmGetCmt, void, (bxxpmData * mdata, char **cmt));
-LFUNC(xpmOpenArray, int, (char **data, bxxpmData * mdata));
-LFUNC(XpmDataClose, void, (bxxpmData * mdata));
-
-/* RGB utility */
-
-LFUNC(xpm_xynormalizeimagebits, void, (register unsigned char *bp,
-                                     register XImage * img));
-LFUNC(xpm_znormalizeimagebits, void, (register unsigned char *bp,
-                                    register XImage * img));
-
-/* Image utility */
-
-LFUNC(SetColor, int, (Display * display, Colormap colormap, char *colorname,
-		      unsigned int color_index, Pixel * image_pixel,
-		      Pixel * mask_pixel, unsigned int *mask_pixel_index));
-
-LFUNC(CreateXImage, int, (Display * display, Visual * visual,
-			  unsigned int depth, unsigned int width,
-			  unsigned int height, XImage ** image_return));
-
-LFUNC(SetImagePixels, void, (XImage * image, unsigned int width,
-			    unsigned int height, unsigned int *pixelindex,
-			    Pixel * pixels));
-
-LFUNC(SetImagePixels32, void, (XImage * image, unsigned int width,
-			      unsigned int height, unsigned int *pixelindex,
-			      Pixel * pixels));
-
-LFUNC(SetImagePixels16, void, (XImage * image, unsigned int width,
-			      unsigned int height, unsigned int *pixelindex,
-			      Pixel * pixels));
-
-LFUNC(SetImagePixels8, void, (XImage * image, unsigned int width,
-			     unsigned int height, unsigned int *pixelindex,
-			     Pixel * pixels));
-
-LFUNC(SetImagePixels1, void, (XImage * image, unsigned int width,
-			     unsigned int height, unsigned int *pixelindex,
-			     Pixel * pixels));
-
-LFUNC(atoui, unsigned int, (char *p, unsigned int l, unsigned int *ui_return));
-
-/*
- * Macros
- *
- * The BXXYNORMALIZE macro determines whether XY format data requires
- * normalization and calls a routine to do so if needed. The logic in
- * this module is designed for LSBFirst byte and bit order, so
- * normalization is done as required to present the data in this order.
- *
- * The BXZNORMALIZE macro performs byte and nibble order normalization if
- * required for Z format data.
- *
- * The BXXYINDEX macro computes the index to the starting byte (char) boundary
- * for a bitmap_unit containing a pixel with coordinates x and y for image
- * data in XY format.
- *
- * The BXZINDEX* macros compute the index to the starting byte (char) boundary
- * for a pixel with coordinates x and y for image data in ZPixmap format.
- *
- */
-
-#define BXXYNORMALIZE(bp, img) \
-    if ((img->byte_order == MSBFirst) || (img->bitmap_bit_order == MSBFirst)) \
-        xpm_xynormalizeimagebits((unsigned char *)(bp), img)
-
-#define BXZNORMALIZE(bp, img) \
-    if (img->byte_order == MSBFirst) \
-        xpm_znormalizeimagebits((unsigned char *)(bp), img)
-
-#define BXXYINDEX(x, y, img) \
-    ((y) * img->bytes_per_line) + \
-    (((x) + img->xoffset) / img->bitmap_unit) * (img->bitmap_unit >> 3)
-
-#define BXZINDEX(x, y, img) ((y) * img->bytes_per_line) + \
-    (((x) * img->bits_per_pixel) >> 3)
-
-#define BXZINDEX32(x, y, img) ((y) * img->bytes_per_line) + ((x) << 2)
-
-#define BXZINDEX16(x, y, img) ((y) * img->bytes_per_line) + ((x) << 1)
-
-#define BXZINDEX8(x, y, img) ((y) * img->bytes_per_line) + (x)
-
-#define BXZINDEX1(x, y, img) ((y) * img->bytes_per_line) + ((x) >> 3)
-
-#if __STDC__
-#define Const const
-#else
-#define Const
-#endif
-
-
-
-static unsigned int atoui
-ARGLIST((p, l, ui_return))
-ARG(register char *, p)
-ARG(unsigned int, l)
-GRA(unsigned int *, ui_return)
-{
-    register int n, i;
-
-    n = 0;
-    for (i = 0; i < l; i++)
-        if (*p >= '0' && *p <= '9')
-            n = n * 10 + *p++ - '0';
-        else
-            break;
-
-    if (i != 0 && i == l) {
-        *ui_return = n;
-        return 1;
-    } else
-        return 0;
-}
-
-static int BxXpmCreatePixmapFromData
-ARGLIST((display, d, data, pixmap_return, shapemask_return, attributes))
-ARG(Display *, display)
-ARG(Drawable, d)
-ARG(char **, data)
-ARG(Pixmap *, pixmap_return)
-ARG(Pixmap *, shapemask_return)
-GRA(BxXpmAttributes *,attributes)
-{
-    XImage *image, **imageptr = NULL;
-    XImage *shapeimage, **shapeimageptr = NULL;
-    int ErrorStatus;
-    XGCValues gcv;
-    GC gc;
-
-    /*
-     * initialize return values
-     */
-    if (pixmap_return) {
-        *pixmap_return = (Pixmap) NULL;
-        imageptr = ℑ
-    }
-    if (shapemask_return) {
-        *shapemask_return = (Pixmap) NULL;
-        shapeimageptr = &shapeimage;
-    }
-
-    /*
-     * create the images
-     */
-    ErrorStatus = BxXpmCreateImageFromData(display, data, imageptr,
-                                         shapeimageptr, attributes);
-    if (ErrorStatus < 0)
-        return (ErrorStatus);
-
-    /*
-     * create the pixmaps
-     */
-    if (imageptr && image) {
-        *pixmap_return = XCreatePixmap(display, d, image->width,
-                                       image->height, image->depth);
-        gcv.function = GXcopy;
-        gc = XCreateGC(display, *pixmap_return, GCFunction, &gcv);
-
-        XPutImage(display, *pixmap_return, gc, image, 0, 0, 0, 0,
-                  image->width, image->height);
-
-        XDestroyImage(image);
-        XFreeGC(display, gc);
-    }
-    if (shapeimageptr && shapeimage) {
-        *shapemask_return = XCreatePixmap(display, d, shapeimage->width,
-                                          shapeimage->height,
-                                          shapeimage->depth);
-        gcv.function = GXcopy;
-        gc = XCreateGC(display, *shapemask_return, GCFunction, &gcv);
-
-        XPutImage(display, *shapemask_return, gc, shapeimage, 0, 0, 0, 0,
-                  shapeimage->width, shapeimage->height);
-
-        XDestroyImage(shapeimage);
-        XFreeGC(display, gc);
-    }
-    return (ErrorStatus);
-}
-
-
-static int BxXpmCreateImageFromData
-ARGLIST((display, data, image_return, shapeimage_return, attributes))
-ARG(Display *,display)
-ARG(char **, data)
-ARG(XImage **, image_return)
-ARG(XImage **, shapeimage_return)
-GRA(BxXpmAttributes *, attributes)
-{
-    bxxpmData mdata;
-    int ErrorStatus;
-    bxxpmInternAttrib attrib;
-
-    /*
-     * initialize return values
-     */
-    if (image_return)
-        *image_return = NULL;
-    if (shapeimage_return)
-        *shapeimage_return = NULL;
-
-    if ((ErrorStatus = xpmOpenArray(data, &mdata)) != BxXpmSuccess)
-        return (ErrorStatus);
-
-    xpmInitInternAttrib(&attrib);
-
-    ErrorStatus = xpmParseData(&mdata, &attrib, attributes);
-
-    if (ErrorStatus == BxXpmSuccess)
-        ErrorStatus = xpmCreateImage(display, &attrib, image_return,
-                                     shapeimage_return, attributes);
-
-    if (ErrorStatus >= 0)
-        xpmSetAttributes(&attrib, attributes);
-    else if (attributes)
-        BxXpmFreeAttributes(attributes);
-
-    xpmFreeInternAttrib(&attrib);
-    XpmDataClose(&mdata);
-
-    return (ErrorStatus);
-}
-
-/*
- * open the given array to be read or written as an bxxpmData which is returned
- */
-static int xpmOpenArray
-ARGLIST((data, mdata))
-ARG(char **,data)
-GRA(bxxpmData *,mdata)
-{
-    mdata->type = BXXPMARRAY;
-    mdata->stream.data = data;
-    mdata->cptr = *data;
-    mdata->line = 0;
-    mdata->CommentLength = 0;
-    mdata->Bcmt = mdata->Ecmt = NULL;
-    mdata->Bos = mdata->Eos = '\0';
-    mdata->InsideString = 0;
-    return (BxXpmSuccess);
-}
-
-/*
- * Intialize the bxxpmInternAttrib pointers to Null to know
- * which ones must be freed later on.
- */
-static void xpmInitInternAttrib
-ARGLIST((attrib))
-GRA(bxxpmInternAttrib *,attrib)
-{
-    attrib->ncolors = 0;
-    attrib->colorTable = NULL;
-    attrib->pixelindex = NULL;
-    attrib->xcolors = NULL;
-    attrib->colorStrings = NULL;
-    attrib->mask_pixel = BX_UNDEF_PIXEL;
-}
-
-/* function call in case of error, frees only localy allocated variables */
-#undef RETURN
-#define RETURN(status) \
-  { if (colorTable) xpmFreeColorTable(colorTable, ncolors); \
-    if (chars) free(chars); \
-    if (pixelindex) free((char *)pixelindex); \
-    if (hints_cmt)  free((char *)hints_cmt); \
-    if (colors_cmt) free((char *)colors_cmt); \
-    if (pixels_cmt) free((char *)pixels_cmt); \
-    return(status); }
-
-/*
- * This function parses an Xpm file or data and store the found informations
- * in an an bxxpmInternAttrib structure which is returned.
- */
-static int xpmParseData
-ARGLIST((data, attrib_return, attributes))
-ARG(bxxpmData *,data)
-ARG(bxxpmInternAttrib *, attrib_return)
-GRA(BxXpmAttributes *, attributes)
-{
-    /* variables to return */
-    unsigned int width, height;
-    unsigned int ncolors = 0;
-    unsigned int cpp;
-    unsigned int x_hotspot, y_hotspot, hotspot = 0;
-    char ***colorTable = NULL;
-    unsigned int *pixelindex = NULL;
-    char *hints_cmt = NULL;
-    char *colors_cmt = NULL;
-    char *pixels_cmt = NULL;
-
-    /* calculation variables */
-    unsigned int rncolors = 0;		/* read number of colors, it is
-					 * different to ncolors to avoid
-					 * problem when freeing the
-					 * colorTable in case an error
-					 * occurs while reading the hints
-					 * line */
-    unsigned int key;			/* color key */
-    char *chars = NULL, buf[BUFSIZ];
-    unsigned int *iptr;
-    unsigned int a, b, x, y, l;
-
-    unsigned int curkey;		/* current color key */
-    unsigned int lastwaskey;		/* key read */
-    char curbuf[BUFSIZ];		/* current buffer */
-
-    /*
-     * read hints: width, height, ncolors, chars_per_pixel
-     */
-    if (!(xpmNextUI(data, &width) && xpmNextUI(data, &height)
-	  && xpmNextUI(data, &rncolors) && xpmNextUI(data, &cpp)))
-	RETURN(BxXpmFileInvalid);
-
-    ncolors = rncolors;
-
-    /*
-     * read hotspot coordinates if any
-     */
-    hotspot = xpmNextUI(data, &x_hotspot) && xpmNextUI(data, &y_hotspot);
-
-    /*
-     * store the hints comment line
-     */
-    if (attributes && (attributes->valuemask & BxXpmReturnInfos))
-	xpmGetCmt(data, &hints_cmt);
-
-    /*
-     * read colors
-     */
-    colorTable = (char ***) calloc(ncolors, sizeof(char **));
-    if (!colorTable)
-	RETURN(BxXpmNoMemory);
-
-    for (a = 0; a < ncolors; a++) {
-	xpmNextString(data);		/* skip the line */
-	colorTable[a] = (char **) calloc((BXNKEYS + 1), sizeof(char *));
-	if (!colorTable[a])
-	    RETURN(BxXpmNoMemory);
-
-	/*
-	 * read pixel value
-	 */
-	colorTable[a][0] = (char *) malloc(cpp);
-	if (!colorTable[a][0])
-	    RETURN(BxXpmNoMemory);
-	for (b = 0; b < cpp; b++)
-	    colorTable[a][0][b] = xpmGetC(data);
-
-	/*
-	 * read color keys and values
-	 */
-	curkey = 0;
-	lastwaskey = 0;
-	while ((l = xpmNextWord(data, buf))) {
-	    if (!lastwaskey) {
-		for (key = 1; key < BXNKEYS + 1; key++)
-		    if ((strlen(BxXpmColorKeys[key - 1]) == l)
-			&& (!strncmp(BxXpmColorKeys[key - 1], buf, l)))
-			break;
-	    }
-	    if (!lastwaskey && key <= BXNKEYS) {	/* open new key */
-		if (curkey) {		/* flush string */
-		    colorTable[a][curkey] =
-			(char *) malloc(strlen(curbuf) + 1);
-		    if (!colorTable[a][curkey])
-			RETURN(BxXpmNoMemory);
-		    strcpy(colorTable[a][curkey], curbuf);
-		}
-		curkey = key;		/* set new key  */
-		curbuf[0] = '\0';	/* reset curbuf */
-		lastwaskey = 1;
-	    } else {
-		if (!curkey)
-		    RETURN(BxXpmFileInvalid);	/* key without value */
-		if (!lastwaskey)
-		    strcat(curbuf, " ");/* append space */
-		buf[l] = '\0';
-		strcat(curbuf, buf);	/* append buf */
-		lastwaskey = 0;
-	    }
-	}
-	if (!curkey)
-	    RETURN(BxXpmFileInvalid);	/* key without value */
-	colorTable[a][curkey] = (char *) malloc(strlen(curbuf) + 1);
-	if (!colorTable[a][curkey])
-	    RETURN(BxXpmNoMemory);
-	strcpy(colorTable[a][curkey], curbuf);
-    }
-
-    /*
-     * store the colors comment line
-     */
-    if (attributes && (attributes->valuemask & BxXpmReturnInfos))
-	xpmGetCmt(data, &colors_cmt);
-
-    /*
-     * read pixels and index them on color number
-     */
-    pixelindex =
-	(unsigned int *) malloc(sizeof(unsigned int) * width * height);
-    if (!pixelindex)
-	RETURN(BxXpmNoMemory);
-
-    iptr = pixelindex;
-
-    chars = (char *) malloc(cpp);
-    if (!chars)
-	RETURN(BxXpmNoMemory);
-
-    for (y = 0; y < height; y++) {
-	xpmNextString(data);
-	for (x = 0; x < width; x++, iptr++) {
-	    for (a = 0; a < cpp; a++)
-		chars[a] = xpmGetC(data);
-	    for (a = 0; a < ncolors; a++)
-		if (!strncmp(colorTable[a][0], chars, cpp))
-		    break;
-	    if (a == ncolors)
-		RETURN(BxXpmFileInvalid);	/* no color matches */
-	    *iptr = a;
-	}
-    }
-
-    /*
-     * store the pixels comment line
-     */
-    if (attributes && (attributes->valuemask & BxXpmReturnInfos))
-	xpmGetCmt(data, &pixels_cmt);
-
-    free(chars);
-
-    /*
-     * store found informations in the bxxpmInternAttrib structure
-     */
-    attrib_return->width = width;
-    attrib_return->height = height;
-    attrib_return->cpp = cpp;
-    attrib_return->ncolors = ncolors;
-    attrib_return->colorTable = colorTable;
-    attrib_return->pixelindex = pixelindex;
-
-    if (attributes) {
-	if (attributes->valuemask & BxXpmReturnInfos) {
-	    attributes->hints_cmt = hints_cmt;
-	    attributes->colors_cmt = colors_cmt;
-	    attributes->pixels_cmt = pixels_cmt;
-	}
-	if (hotspot) {
-	    attributes->x_hotspot = x_hotspot;
-	    attributes->y_hotspot = y_hotspot;
-	    attributes->valuemask |= BxXpmHotspot;
-	}
-    }
-    return (BxXpmSuccess);
-}
-
-/*
- * set the color pixel related to the given colorname,
- * return 0 if success, 1 otherwise.
- */
-
-static int SetColor
-ARGLIST((display, colormap,colorname, color_index, image_pixel, mask_pixel, mask_pixel_index))
-ARG(Display *, display)
-ARG(Colormap, colormap)
-ARG(char *, colorname)
-ARG(unsigned int, color_index)
-ARG(Pixel *, image_pixel)
-ARG(Pixel *, mask_pixel)
-GRA(unsigned int *, mask_pixel_index)
-{
-    XColor xcolor;
-
-    if (STRCASECMP(colorname, BX_TRANSPARENT_COLOR)) {
-	if (!XParseColor(display, colormap, colorname, &xcolor)
-	    || (!XAllocColor(display, colormap, &xcolor)))
-	    return (1);
-	*image_pixel = xcolor.pixel;
-	*mask_pixel = 1;
-    } else {
-	*image_pixel = 0;
-	*mask_pixel = 0;
-	*mask_pixel_index = color_index;/* store the color table index */
-    }
-    return (0);
-}
-
-/* function call in case of error, frees only localy allocated variables */
-#undef RETURN
-#define RETURN(status) \
-  { if (image) XDestroyImage(image); \
-    if (shapeimage) XDestroyImage(shapeimage); \
-    if (image_pixels) free((char *)image_pixels); \
-    if (mask_pixels) free((char *)mask_pixels); \
-    return(status); }
-
-static int xpmCreateImage
-ARGLIST((display, attrib, image_return, shapeimage_return, attributes))
-ARG(Display *, display)
-ARG(bxxpmInternAttrib *, attrib)
-ARG(XImage **, image_return)
-ARG(XImage **, shapeimage_return)
-GRA(BxXpmAttributes *, attributes)
-{
-    /* variables stored in the BxXpmAttributes structure */
-    Visual *visual;
-    Colormap colormap;
-    unsigned int depth;
-    BxXpmColorSymbol *colorsymbols;
-    unsigned int numsymbols;
-
-    /* variables to return */
-    XImage *image = NULL;
-    XImage *shapeimage = NULL;
-    unsigned int mask_pixel;
-    unsigned int ErrorStatus, ErrorStatus2;
-
-    /* calculation variables */
-    Pixel *image_pixels = NULL;
-    Pixel *mask_pixels = NULL;
-    char *colorname;
-    unsigned int a, b, l;
-    Boolean pixel_defined;
-    unsigned int key;
-
-
-    /*
-     * retrieve information from the BxXpmAttributes
-     */
-    if (attributes && attributes->valuemask & BxXpmColorSymbols) {
-	colorsymbols = attributes->colorsymbols;
-	numsymbols = attributes->numsymbols;
-    } else
-	numsymbols = 0;
-
-    if (attributes && attributes->valuemask & BxXpmVisual)
-	visual = attributes->visual;
-    else
-	visual = DefaultVisual(display, DefaultScreen(display));
-
-    if (attributes && attributes->valuemask & BxXpmColormap)
-	colormap = attributes->colormap;
-    else
-	colormap = DefaultColormap(display, DefaultScreen(display));
-
-    if (attributes && attributes->valuemask & BxXpmDepth)
-	depth = attributes->depth;
-    else
-	depth = DefaultDepth(display, DefaultScreen(display));
-
-
-    ErrorStatus = BxXpmSuccess;
-
-    /*
-     * alloc pixels index tables
-     */
-
-    key = BxXpmVisualType(visual);
-    image_pixels = (Pixel *) malloc(sizeof(Pixel) * attrib->ncolors);
-    if (!image_pixels)
-	RETURN(BxXpmNoMemory);
-
-    mask_pixels = (Pixel *) malloc(sizeof(Pixel) * attrib->ncolors);
-    if (!mask_pixels)
-	RETURN(BxXpmNoMemory);
-
-    mask_pixel = BX_UNDEF_PIXEL;
-
-    /*
-     * get pixel colors, store them in index tables
-     */
-    for (a = 0; a < attrib->ncolors; a++) {
-	colorname = NULL;
-	pixel_defined = False;
-
-	/*
-	 * look for a defined symbol
-	 */
-	if (numsymbols && attrib->colorTable[a][1]) {
-	    for (l = 0; l < numsymbols; l++)
-		if (!strcmp(colorsymbols[l].name, attrib->colorTable[a][1]))
-		    break;
-	    if (l != numsymbols) {
-		if (colorsymbols[l].value)
-		    colorname = colorsymbols[l].value;
-		else
-		    pixel_defined = True;
-	    }
-	}
-	if (!pixel_defined) {		/* pixel not given as symbol value */
-
-	    if (colorname) {		/* colorname given as symbol value */
-		if (!SetColor(display, colormap, colorname, a,
-			   &image_pixels[a], &mask_pixels[a], &mask_pixel))
-		    pixel_defined = True;
-		else
-		    ErrorStatus = BxXpmColorError;
-	    }
-	    b = key;
-	    while (!pixel_defined && b > 1) {
-		if (attrib->colorTable[a][b]) {
-		    if (!SetColor(display, colormap, attrib->colorTable[a][b],
-				  a, &image_pixels[a], &mask_pixels[a],
-				  &mask_pixel)) {
-			pixel_defined = True;
-			break;
-		    } else
-			ErrorStatus = BxXpmColorError;
-		}
-		b--;
-	    }
-
-	    b = key + 1;
-	    while (!pixel_defined && b < BXNKEYS + 1) {
-		if (attrib->colorTable[a][b]) {
-		    if (!SetColor(display, colormap, attrib->colorTable[a][b],
-				  a, &image_pixels[a], &mask_pixels[a],
-				  &mask_pixel)) {
-			pixel_defined = True;
-			break;
-		    } else
-			ErrorStatus = BxXpmColorError;
-		}
-		b++;
-	    }
-
-	    if (!pixel_defined)
-		RETURN(BxXpmColorFailed);
-
-	} else {
-	    image_pixels[a] = colorsymbols[l].pixel;
-	    mask_pixels[a] = 1;
-	}
-    }
-
-    /*
-     * create the image
-     */
-    if (image_return) {
-	ErrorStatus2 = CreateXImage(display, visual, depth,
-				    attrib->width, attrib->height, &image);
-	if (ErrorStatus2 != BxXpmSuccess)
-	    RETURN(ErrorStatus2);
-
-	/*
-	 * set the image data
-	 *
-	 * In case depth is 1 or bits_per_pixel is 4, 6, 8, 24 or 32 use
-	 * optimized functions, otherwise use slower but sure general one.
-	 *
-	 */
-
-	if (image->depth == 1)
-	    SetImagePixels1(image, attrib->width, attrib->height,
-			    attrib->pixelindex, image_pixels);
-	else if (image->bits_per_pixel == 8)
-	    SetImagePixels8(image, attrib->width, attrib->height,
-			    attrib->pixelindex, image_pixels);
-	else if (image->bits_per_pixel == 16)
-	    SetImagePixels16(image, attrib->width, attrib->height,
-			     attrib->pixelindex, image_pixels);
-	else if (image->bits_per_pixel == 32)
-	    SetImagePixels32(image, attrib->width, attrib->height,
-			     attrib->pixelindex, image_pixels);
-	else
-	    SetImagePixels(image, attrib->width, attrib->height,
-			   attrib->pixelindex, image_pixels);
-    }
-
-    /*
-     * create the shape mask image
-     */
-    if (mask_pixel != BX_UNDEF_PIXEL && shapeimage_return) {
-	ErrorStatus2 = CreateXImage(display, visual, 1, attrib->width,
-				    attrib->height, &shapeimage);
-	if (ErrorStatus2 != BxXpmSuccess)
-	    RETURN(ErrorStatus2);
-
-	SetImagePixels1(shapeimage, attrib->width, attrib->height,
-			attrib->pixelindex, mask_pixels);
-    }
-    free((char *)mask_pixels);
-
-    /*
-     * if requested store allocated pixels in the BxXpmAttributes structure
-     */
-    if (attributes &&
-	(attributes->valuemask & BxXpmReturnInfos
-	 || attributes->valuemask & BxXpmReturnPixels)) {
-	if (mask_pixel != BX_UNDEF_PIXEL) {
-	    Pixel *pixels, *p1, *p2;
-
-	    attributes->npixels = attrib->ncolors - 1;
-	    pixels = (Pixel *) malloc(sizeof(Pixel) * attributes->npixels);
-	    if (pixels) {
-		p1 = image_pixels;
-		p2 = pixels;
-		for (a = 0; a < attrib->ncolors; a++, p1++)
-		    if (a != mask_pixel)
-			*p2++ = *p1;
-		attributes->pixels = pixels;
-	    } else {
-		/* if error just say we can't return requested data */
-		attributes->valuemask &= ~BxXpmReturnPixels;
-		attributes->valuemask &= ~BxXpmReturnInfos;
-		attributes->pixels = NULL;
-		attributes->npixels = 0;
-	    }
-	    free((char *)image_pixels);
-	} else {
-	    attributes->pixels = image_pixels;
-	    attributes->npixels = attrib->ncolors;
-	}
-	attributes->mask_pixel = mask_pixel;
-    } else
-	free((char *)image_pixels);
-
-
-    /*
-     * return created images
-     */
-    if (image_return)
-	*image_return = image;
-
-    if (shapeimage_return)
-	*shapeimage_return = shapeimage;
-
-    return (ErrorStatus);
-}
-
-
-/*
- * Create an XImage
- */
-static int CreateXImage
-ARGLIST((display, visual, depth, width, height, image_return))
-ARG(Display *, display)
-ARG(Visual *, visual)
-ARG(unsigned int, depth)
-ARG(unsigned int, width)
-ARG(unsigned int, height)
-GRA(XImage **, image_return)
-{
-    int bitmap_pad;
-
-    /* first get bitmap_pad */
-    if (depth > 16)
-	bitmap_pad = 32;
-    else if (depth > 8)
-	bitmap_pad = 16;
-    else
-	bitmap_pad = 8;
-
-    /* then create the XImage with data = NULL and bytes_per_line = 0 */
-
-    *image_return = XCreateImage(display, visual, depth, ZPixmap, 0, 0,
-				 width, height, bitmap_pad, 0);
-    if (!*image_return)
-	return (BxXpmNoMemory);
-
-    /* now that bytes_per_line must have been set properly alloc data */
-
-    (*image_return)->data =
-	(char *) malloc((*image_return)->bytes_per_line * height);
-
-    if (!(*image_return)->data) {
-	XDestroyImage(*image_return);
-	*image_return = NULL;
-	return (BxXpmNoMemory);
-    }
-    return (BxXpmSuccess);
-}
-
-
-/*
- * The functions below are written from X11R5 MIT's code (XImUtil.c)
- *
- * The idea is to have faster functions than the standard XPutPixel function
- * to build the image data. Indeed we can speed up things by supressing tests
- * performed for each pixel. We do exactly the same tests but at the image
- * level. Assuming that we use only ZPixmap images.
- */
-
-LFUNC(_putbits, void, (register char *src, int dstoffset,
-		      register int numbits, register char *dst));
-
-LFUNC(_XReverse_Bytes, void, (register unsigned char *bpt, register int nb));
-
-static unsigned char Const _reverse_byte[0x100] = {
-			    0x00, 0x80, 0x40, 0xc0, 0x20, 0xa0, 0x60, 0xe0,
-			    0x10, 0x90, 0x50, 0xd0, 0x30, 0xb0, 0x70, 0xf0,
-			    0x08, 0x88, 0x48, 0xc8, 0x28, 0xa8, 0x68, 0xe8,
-			    0x18, 0x98, 0x58, 0xd8, 0x38, 0xb8, 0x78, 0xf8,
-			    0x04, 0x84, 0x44, 0xc4, 0x24, 0xa4, 0x64, 0xe4,
-			    0x14, 0x94, 0x54, 0xd4, 0x34, 0xb4, 0x74, 0xf4,
-			    0x0c, 0x8c, 0x4c, 0xcc, 0x2c, 0xac, 0x6c, 0xec,
-			    0x1c, 0x9c, 0x5c, 0xdc, 0x3c, 0xbc, 0x7c, 0xfc,
-			    0x02, 0x82, 0x42, 0xc2, 0x22, 0xa2, 0x62, 0xe2,
-			    0x12, 0x92, 0x52, 0xd2, 0x32, 0xb2, 0x72, 0xf2,
-			    0x0a, 0x8a, 0x4a, 0xca, 0x2a, 0xaa, 0x6a, 0xea,
-			    0x1a, 0x9a, 0x5a, 0xda, 0x3a, 0xba, 0x7a, 0xfa,
-			    0x06, 0x86, 0x46, 0xc6, 0x26, 0xa6, 0x66, 0xe6,
-			    0x16, 0x96, 0x56, 0xd6, 0x36, 0xb6, 0x76, 0xf6,
-			    0x0e, 0x8e, 0x4e, 0xce, 0x2e, 0xae, 0x6e, 0xee,
-			    0x1e, 0x9e, 0x5e, 0xde, 0x3e, 0xbe, 0x7e, 0xfe,
-			    0x01, 0x81, 0x41, 0xc1, 0x21, 0xa1, 0x61, 0xe1,
-			    0x11, 0x91, 0x51, 0xd1, 0x31, 0xb1, 0x71, 0xf1,
-			    0x09, 0x89, 0x49, 0xc9, 0x29, 0xa9, 0x69, 0xe9,
-			    0x19, 0x99, 0x59, 0xd9, 0x39, 0xb9, 0x79, 0xf9,
-			    0x05, 0x85, 0x45, 0xc5, 0x25, 0xa5, 0x65, 0xe5,
-			    0x15, 0x95, 0x55, 0xd5, 0x35, 0xb5, 0x75, 0xf5,
-			    0x0d, 0x8d, 0x4d, 0xcd, 0x2d, 0xad, 0x6d, 0xed,
-			    0x1d, 0x9d, 0x5d, 0xdd, 0x3d, 0xbd, 0x7d, 0xfd,
-			    0x03, 0x83, 0x43, 0xc3, 0x23, 0xa3, 0x63, 0xe3,
-			    0x13, 0x93, 0x53, 0xd3, 0x33, 0xb3, 0x73, 0xf3,
-			    0x0b, 0x8b, 0x4b, 0xcb, 0x2b, 0xab, 0x6b, 0xeb,
-			    0x1b, 0x9b, 0x5b, 0xdb, 0x3b, 0xbb, 0x7b, 0xfb,
-			    0x07, 0x87, 0x47, 0xc7, 0x27, 0xa7, 0x67, 0xe7,
-			    0x17, 0x97, 0x57, 0xd7, 0x37, 0xb7, 0x77, 0xf7,
-			    0x0f, 0x8f, 0x4f, 0xcf, 0x2f, 0xaf, 0x6f, 0xef,
-			     0x1f, 0x9f, 0x5f, 0xdf, 0x3f, 0xbf, 0x7f, 0xff
-};
-
-static void _XReverse_Bytes
-ARGLIST((bpt, nb))
-ARG(register unsigned char *, bpt)
-GRA(register int, nb)
-{
-    do {
-	*bpt = _reverse_byte[*bpt];
-	bpt++;
-    } while (--nb > 0);
-}
-
-static void xpm_xynormalizeimagebits
-ARGLIST((bp,img))
-ARG(register unsigned char *, bp)
-GRA(register XImage *, img)
-{
-    register unsigned char c;
-
-    if (img->byte_order != img->bitmap_bit_order) {
-	switch (img->bitmap_unit) {
-
-	case 16:
-	    c = *bp;
-	    *bp = *(bp + 1);
-	    *(bp + 1) = c;
-	    break;
-
-	case 32:
-	    c = *(bp + 3);
-	    *(bp + 3) = *bp;
-	    *bp = c;
-	    c = *(bp + 2);
-	    *(bp + 2) = *(bp + 1);
-	    *(bp + 1) = c;
-	    break;
-	}
-    }
-    if (img->bitmap_bit_order == MSBFirst)
-	_XReverse_Bytes(bp, img->bitmap_unit >> 3);
-}
-
-static void xpm_znormalizeimagebits
-ARGLIST((bp,img))
-ARG(register unsigned char *, bp)
-GRA(register XImage *, img)
-{
-    register unsigned char c;
-
-    switch (img->bits_per_pixel) {
-
-    case 4:
-	*bp = ((*bp >> 4) & 0xF) | ((*bp << 4) & ~0xF);
-	break;
-
-    case 16:
-	c = *bp;
-	*bp = *(bp + 1);
-	*(bp + 1) = c;
-	break;
-
-    case 24:
-	c = *(bp + 2);
-	*(bp + 2) = *bp;
-	*bp = c;
-	break;
-
-    case 32:
-	c = *(bp + 3);
-	*(bp + 3) = *bp;
-	*bp = c;
-	c = *(bp + 2);
-	*(bp + 2) = *(bp + 1);
-	*(bp + 1) = c;
-	break;
-    }
-}
-
-static unsigned char Const _lomask[0x09] = {
-		     0x00, 0x01, 0x03, 0x07, 0x0f, 0x1f, 0x3f, 0x7f, 0xff};
-static unsigned char Const _himask[0x09] = {
-		     0xff, 0xfe, 0xfc, 0xf8, 0xf0, 0xe0, 0xc0, 0x80, 0x00};
-
-static void _putbits
-ARGLIST((src, dstoffset, numbits, dst))
-ARG(register char *, src)		/* address of source bit string */
-ARG(int, dstoffset)			/* bit offset into destination;
-					 * range is 0-31 */
-ARG(register int, numbits)		/* number of bits to copy to
-					 * destination */
-GRA(register char *, dst)		/* address of destination bit string */
-{
-    register unsigned char chlo, chhi;
-    int hibits;
-
-    dst = dst + (dstoffset >> 3);
-    dstoffset = dstoffset & 7;
-    hibits = 8 - dstoffset;
-    chlo = *dst & _lomask[dstoffset];
-    for (;;) {
-	chhi = (*src << dstoffset) & _himask[dstoffset];
-	if (numbits <= hibits) {
-	    chhi = chhi & _lomask[dstoffset + numbits];
-	    *dst = (*dst & _himask[dstoffset + numbits]) | chlo | chhi;
-	    break;
-	}
-	*dst = chhi | chlo;
-	dst++;
-	numbits = numbits - hibits;
-	chlo = (unsigned char) (*src & _himask[hibits]) >> hibits;
-	src++;
-	if (numbits <= dstoffset) {
-	    chlo = chlo & _lomask[numbits];
-	    *dst = (*dst & _himask[numbits]) | chlo;
-	    break;
-	}
-	numbits = numbits - dstoffset;
-    }
-}
-
-/*
- * Default method to write pixels into a Z image data structure.
- * The algorithm used is:
- *
- *	copy the destination bitmap_unit or Zpixel to temp
- *	normalize temp if needed
- *	copy the pixel bits into the temp
- *	renormalize temp if needed
- *	copy the temp back into the destination image data
- */
-
-static void SetImagePixels
-ARGLIST((image, width, height, pixelindex, pixels))
-ARG(XImage *, image)
-ARG(unsigned int, width)
-ARG(unsigned int, height)
-ARG(unsigned int *, pixelindex)
-GRA(Pixel *, pixels)
-{
-    Pixel pixel;
-    unsigned long px;
-    register char *src;
-    register char *dst;
-    int nbytes;
-    register unsigned int *iptr;
-    register int x, y, i;
-
-    iptr = pixelindex;
-    if (image->depth == 1) {
-	for (y = 0; y < height; y++)
-	    for (x = 0; x < width; x++, iptr++) {
-		pixel = pixels[*iptr];
-		for (i = 0, px = pixel;
-		     i < sizeof(unsigned long); i++, px >>= 8)
-		    ((unsigned char *) &pixel)[i] = (unsigned char)px;
-		src = &image->data[BXXYINDEX(x, y, image)];
-		dst = (char *) &px;
-		px = 0;
-		nbytes = image->bitmap_unit >> 3;
-		for (i = nbytes; --i >= 0;)
-		    *dst++ = *src++;
-		BXXYNORMALIZE(&px, image);
-		i = ((x + image->xoffset) % image->bitmap_unit);
-		_putbits((char *) &pixel, i, 1, (char *) &px);
-		BXXYNORMALIZE(&px, image);
-		src = (char *) &px;
-		dst = &image->data[BXXYINDEX(x, y, image)];
-		for (i = nbytes; --i >= 0;)
-		    *dst++ = *src++;
-	    }
-    } else {
-	for (y = 0; y < height; y++)
-	    for (x = 0; x < width; x++, iptr++) {
-		pixel = pixels[*iptr];
-		if (image->depth == 4)
-		    pixel &= 0xf;
-		for (i = 0, px = pixel;
-		     i < sizeof(unsigned long); i++, px >>= 8)
-		    ((unsigned char *) &pixel)[i] = (unsigned char)px;
-		src = &image->data[BXZINDEX(x, y, image)];
-		dst = (char *) &px;
-		px = 0;
-		nbytes = (image->bits_per_pixel + 7) >> 3;
-		for (i = nbytes; --i >= 0;)
-		    *dst++ = *src++;
-		BXZNORMALIZE(&px, image);
-		_putbits((char *) &pixel,
-			 (x * image->bits_per_pixel) & 7,
-			 image->bits_per_pixel, (char *) &px);
-		BXZNORMALIZE(&px, image);
-		src = (char *) &px;
-		dst = &image->data[BXZINDEX(x, y, image)];
-		for (i = nbytes; --i >= 0;)
-		    *dst++ = *src++;
-	    }
-    }
-}
-
-/*
- * write pixels into a 32-bits Z image data structure
- */
-
-#ifndef WORD64
-static unsigned long byteorderpixel = MSBFirst << 24;
-
-#endif
-
-static void SetImagePixels32
-ARGLIST((image, width, height, pixelindex, pixels))
-ARG(XImage *, image)
-ARG(unsigned int, width)
-ARG(unsigned int, height)
-ARG(unsigned int *, pixelindex)
-GRA(Pixel *, pixels)
-{
-    register unsigned char *addr;
-    register unsigned int *paddr;
-    register unsigned int *iptr;
-    register int x, y;
-
-    iptr = pixelindex;
-#ifndef WORD64
-    if (*((char *) &byteorderpixel) == image->byte_order) {
-	for (y = 0; y < height; y++)
-	    for (x = 0; x < width; x++, iptr++) {
-		paddr =
-		    (unsigned int *)(&(image->data[BXZINDEX32(x, y, image)]));
-		*paddr = (unsigned int)pixels[*iptr];
-	    }
-    } else
-#endif
-    if (image->byte_order == MSBFirst)
-	for (y = 0; y < height; y++)
-	    for (x = 0; x < width; x++, iptr++) {
-		addr = &((unsigned char *) image->data)[BXZINDEX32(x, y, image)];
-		addr[0] = (unsigned char)(pixels[*iptr] >> 24);
-		addr[1] = (unsigned char)(pixels[*iptr] >> 16);
-		addr[2] = (unsigned char)(pixels[*iptr] >> 8);
-		addr[3] = (unsigned char)(pixels[*iptr]);
-	    }
-    else
-	for (y = 0; y < height; y++)
-	    for (x = 0; x < width; x++, iptr++) {
-		addr = &((unsigned char *) image->data)[BXZINDEX32(x, y, image)];
-		addr[3] = (unsigned char)(pixels[*iptr] >> 24);
-		addr[2] = (unsigned char)(pixels[*iptr] >> 16);
-		addr[1] = (unsigned char)(pixels[*iptr] >> 8);
-		addr[0] = (unsigned char)(pixels[*iptr]);
-	    }
-}
-
-/*
- * write pixels into a 16-bits Z image data structure
- */
-
-static void SetImagePixels16
-ARGLIST((image, width, height, pixelindex, pixels))
-ARG(XImage *, image)
-ARG(unsigned int, width)
-ARG(unsigned int, height)
-ARG(unsigned int *, pixelindex)
-GRA(Pixel *, pixels)
-{
-    register unsigned char *addr;
-    register unsigned int *iptr;
-    register int x, y;
-
-    iptr = pixelindex;
-    if (image->byte_order == MSBFirst)
-	for (y = 0; y < height; y++)
-	    for (x = 0; x < width; x++, iptr++) {
-		addr = &((unsigned char *) image->data)[BXZINDEX16(x, y, image)];
-		addr[0] = (unsigned char)(pixels[*iptr] >> 8);
-		addr[1] = (unsigned char)(pixels[*iptr]);
-	    }
-    else
-	for (y = 0; y < height; y++)
-	    for (x = 0; x < width; x++, iptr++) {
-		addr = &((unsigned char *) image->data)[BXZINDEX16(x, y, image)];
-		addr[1] = (unsigned char)(pixels[*iptr] >> 8);
-		addr[0] = (unsigned char)(pixels[*iptr]);
-	    }
-}
-
-/*
- * write pixels into a 8-bits Z image data structure
- */
-
-static void SetImagePixels8
-ARGLIST((image, width, height, pixelindex, pixels))
-ARG(XImage *, image)
-ARG(unsigned int, width)
-ARG(unsigned int, height)
-ARG(unsigned int *, pixelindex)
-GRA(Pixel *, pixels)
-
-{
-    register unsigned int *iptr;
-    register int x, y;
-
-    iptr = pixelindex;
-    for (y = 0; y < height; y++)
-	for (x = 0; x < width; x++, iptr++)
-	    image->data[BXZINDEX8(x, y, image)] = (char)pixels[*iptr];
-}
-
-/*
- * write pixels into a 1-bit depth image data structure and **offset null**
- */
-
-static void SetImagePixels1
-ARGLIST((image, width, height, pixelindex, pixels))
-ARG(XImage *, image)
-ARG(unsigned int, width)
-ARG(unsigned int, height)
-ARG(unsigned int *, pixelindex)
-GRA(Pixel *, pixels)
-{
-    unsigned char bit;
-    int xoff, yoff;
-    register unsigned int *iptr;
-    register int x, y;
-
-    if (image->byte_order != image->bitmap_bit_order)
-	SetImagePixels(image, width, height, pixelindex, pixels);
-    else {
-	iptr = pixelindex;
-	if (image->bitmap_bit_order == MSBFirst)
-	    for (y = 0; y < height; y++)
-		for (x = 0; x < width; x++, iptr++) {
-		    yoff = BXZINDEX1(x, y, image);
-		    xoff = x & 7;
-		    bit = 0x80 >> xoff;
-		    if (pixels[*iptr] & 1)
-			image->data[yoff] |= bit;
-		    else
-			image->data[yoff] &= ~bit;
-		}
-	else
-	    for (y = 0; y < height; y++)
-		for (x = 0; x < width; x++, iptr++) {
-		    yoff = BXZINDEX1(x, y, image);
-		    xoff = x & 7;
-		    bit = 1 << xoff;
-		    if (pixels[*iptr] & 1)
-			image->data[yoff] |= bit;
-		    else
-			image->data[yoff] &= ~bit;
-		}
-    }
-}
-
-/*
- * Store into the BxXpmAttributes structure the required informations stored in
- * the bxxpmInternAttrib structure.
- */
-
-static void xpmSetAttributes
-ARGLIST((attrib, attributes))
-ARG(bxxpmInternAttrib *, attrib)
-GRA(BxXpmAttributes *, attributes)
-{
-    if (attributes) {
-        if (attributes->valuemask & BxXpmReturnInfos) {
-            attributes->cpp = attrib->cpp;
-            attributes->ncolors = attrib->ncolors;
-            attributes->colorTable = attrib->colorTable;
-
-            attrib->ncolors = 0;
-            attrib->colorTable = NULL;
-        }
-        attributes->width = attrib->width;
-        attributes->height = attrib->height;
-        attributes->valuemask |= BxXpmSize;
-    }
-}
-
-/*
- * Free the BxXpmAttributes structure members
- * but the structure itself
- */
-
-static void BxXpmFreeAttributes
-ARGLIST((attributes))
-GRA(BxXpmAttributes *, attributes)
-{
-    if (attributes) {
-        if (attributes->valuemask & BxXpmReturnPixels && attributes->pixels) {
-            free((char *)attributes->pixels);
-            attributes->pixels = NULL;
-            attributes->npixels = 0;
-        }
-        if (attributes->valuemask & BxXpmInfos) {
-            if (attributes->colorTable) {
-                xpmFreeColorTable(attributes->colorTable, attributes->ncolors);
-                attributes->colorTable = NULL;
-                attributes->ncolors = 0;
-            }
-            if (attributes->hints_cmt) {
-                free(attributes->hints_cmt);
-                attributes->hints_cmt = NULL;
-            }
-            if (attributes->colors_cmt) {
-                free(attributes->colors_cmt);
-                attributes->colors_cmt = NULL;
-            }
-            if (attributes->pixels_cmt) {
-                free(attributes->pixels_cmt);
-                attributes->pixels_cmt = NULL;
-            }
-            if (attributes->pixels) {
-                free((char *)attributes->pixels);
-                attributes->pixels = NULL;
-            }
-        }
-        attributes->valuemask = 0;
-    }
-}
-
-/*
- * Free the bxxpmInternAttrib pointers which have been allocated
- */
-
-static void xpmFreeInternAttrib
-ARGLIST((attrib))
-GRA(bxxpmInternAttrib *, attrib)
-{
-    unsigned int a;
-
-    if (attrib->colorTable)
-        xpmFreeColorTable(attrib->colorTable, attrib->ncolors);
-    if (attrib->pixelindex)
-        free((char *)attrib->pixelindex);
-    if (attrib->xcolors)
-        free((char *)attrib->xcolors);
-    if (attrib->colorStrings) {
-        for (a = 0; a < attrib->ncolors; a++)
-            if (attrib->colorStrings[a])
-                free((char *)attrib->colorStrings[a]);
-        free((char *)attrib->colorStrings);
-    }
-}
-
-/*
- * close the file related to the bxxpmData if any
- */
-static void XpmDataClose
-ARGLIST((mdata))
-GRA(bxxpmData *, mdata)
-{
-    switch (mdata->type) {
-    case BXXPMARRAY:
-        break;
-    case BXXPMFILE:
-        if (mdata->stream.file != (stdout) && mdata->stream.file != (stdin))
-            fclose(mdata->stream.file);
-        break;
-#ifdef ZPIPE
-    case BXXPMPIPE:
-        pclose(mdata->stream.file);
-#endif
-    }
-}
-
-/*
- * skip whitespace and compute the following unsigned int,
- * returns 1 if one is found and 0 if not
- */
-static int xpmNextUI
-ARGLIST((mdata, ui_return))
-ARG(bxxpmData *, mdata)
-GRA(unsigned int *, ui_return)
-{
-    char buf[BUFSIZ];
-    int l;
-
-    l = xpmNextWord(mdata, buf);
-    return atoui(buf, l, ui_return);
-}
-
-/*
- * get the current comment line
- */
-static void xpmGetCmt
-ARGLIST((mdata, cmt))
-ARG(bxxpmData *, mdata)
-GRA(char **, cmt)
-{
-    switch (mdata->type) {
-    case BXXPMARRAY:
-        *cmt = NULL;
-        break;
-    case BXXPMFILE:
-    case BXXPMPIPE:
-        if (mdata->CommentLength) {
-            *cmt = (char *) malloc(mdata->CommentLength + 1);
-            strncpy(*cmt, mdata->Comment, mdata->CommentLength);
-            (*cmt)[mdata->CommentLength] = '\0';
-            mdata->CommentLength = 0;
-        } else
-            *cmt = NULL;
-        break;
-    }
-}
-
-/*
- * skip to the end of the current string and the beginning of the next one
- */
-static void xpmNextString
-ARGLIST((mdata))
-GRA(bxxpmData *, mdata)
-{
-    int c;
-
-    switch (mdata->type) {
-    case BXXPMARRAY:
-        mdata->cptr = (mdata->stream.data)[++mdata->line];
-        break;
-    case BXXPMFILE:
-    case BXXPMPIPE:
-        if (mdata->Eos)
-            while ((c = xpmGetC(mdata)) != mdata->Eos && c != EOF);
-        if (mdata->Bos)                 /* if not natural XPM2 */
-            while ((c = xpmGetC(mdata)) != mdata->Bos && c != EOF);
-        break;
-    }
-}
-
-/*
- * return the current character, skipping comments
- */
-static int xpmGetC
-ARGLIST((mdata))
-GRA(bxxpmData *, mdata)
-{
-    int c;
-    register unsigned int n = 0, a;
-    unsigned int notend;
-
-    switch (mdata->type) {
-    case BXXPMARRAY:
-        return (*mdata->cptr++);
-    case BXXPMFILE:
-    case BXXPMPIPE:
-        c = getc(mdata->stream.file);
-
-        if (mdata->Bos && mdata->Eos
-            && (c == mdata->Bos || c == mdata->Eos)) {
-            /* if not natural XPM2 */
-            mdata->InsideString = !mdata->InsideString;
-            return (c);
-        }
-        if (!mdata->InsideString && mdata->Bcmt && c == mdata->Bcmt[0]) {
-            mdata->Comment[0] = c;
-
-            /*
-             * skip the string begining comment
-             */
-            do {
-                c = getc(mdata->stream.file);
-                mdata->Comment[++n] = c;
-            } while (c == mdata->Bcmt[n] && mdata->Bcmt[n] != '\0'
-                     && c != EOF);
-
-            if (mdata->Bcmt[n] != '\0') {
-                /* this wasn't the begining of a comment */
-                /* put characters back in the order that we got them */
-                for (a = n; a > 0; a--)
-                    xpmUngetC(mdata->Comment[a], mdata);
-                return (mdata->Comment[0]);
-            }
-
-            /*
-             * store comment
-             */
-            mdata->Comment[0] = mdata->Comment[n];
-            notend = 1;
-            n = 0;
-            while (notend) {
-                while (mdata->Comment[n] != mdata->Ecmt[0] && c != EOF) {
-                    c = getc(mdata->stream.file);
-                    mdata->Comment[++n] = c;
-                }
-                mdata->CommentLength = n;
-                a = 0;
-                do {
-                    c = getc(mdata->stream.file);
-                    n++;
-                    a++;
-                    mdata->Comment[n] = c;
-                } while (c == mdata->Ecmt[a] && mdata->Ecmt[a] != '\0'
-                         && c != EOF);
-                if (mdata->Ecmt[a] == '\0') {
-                    /* this is the end of the comment */
-                    notend = 0;
-                    xpmUngetC(mdata->Comment[n], mdata);
-                }
-            }
-            c = xpmGetC(mdata);
-        }
-        return (c);
-    }
-    return('\0');
-}
-
-
-/*
- * push the given character back
- */
-static int xpmUngetC
-ARGLIST((c, mdata))
-ARG(int, c)
-GRA(bxxpmData *, mdata)
-{
-    switch (mdata->type) {
-    case BXXPMARRAY:
-        return (*--mdata->cptr = c);
-    case BXXPMFILE:
-    case BXXPMPIPE:
-        if (mdata->Bos && (c == mdata->Bos || c == mdata->Eos))
-            /* if not natural XPM2 */
-            mdata->InsideString = !mdata->InsideString;
-        return (ungetc(c, mdata->stream.file));
-    }
-    return('\0');
-}
-
-/*
- * skip whitespace and return the following word
- */
-static unsigned int xpmNextWord
-ARGLIST((mdata, buf))
-ARG(bxxpmData *, mdata)
-GRA(char *, buf)
-{
-    register unsigned int n = 0;
-    int c;
-
-    switch (mdata->type) {
-    case BXXPMARRAY:
-    	c = *mdata->cptr;
-        while (isspace(c) && c != mdata->Eos)
-            {
-	    mdata->cptr++;
-    	    c = *mdata->cptr;
-	    }
-        do {
-            c = *mdata->cptr++;
-            buf[n++] = c;
-        } while (!isspace(c) && c != mdata->Eos && c != '\0');
-        n--;
-        mdata->cptr--;
-        break;
-    case BXXPMFILE:
-    case BXXPMPIPE:
-        c = xpmGetC(mdata);
-        while (isspace(c) && c != mdata->Eos)
-	    c = xpmGetC(mdata);
-        while (!isspace(c) && c != mdata->Eos && c != EOF) {
-            buf[n++] = c;
-            c = xpmGetC(mdata);
-        }
-        xpmUngetC(c, mdata);
-        break;
-    }
-    return (n);
-}
-
-static int BxXpmVisualType
-ARGLIST((visual))
-GRA(Visual *, visual)
-{
-#if defined(__cplusplus) || defined(c_plusplus)
-    switch ( visual->c_class )
-#else
-    switch ( visual->class )
-#endif
-    {
-    case StaticGray:
-    case GrayScale:
-	switch (visual->map_entries)
-	{
-	case 2:
-	    return (BXMONO);
-	case 4:
-	    return (BXGRAY4);
-	default:
-	    return (BXGRAY);
-	}
-    default:
-	return (BXCOLOR);
-    }
-}
-
-/*
- * Free the computed color table
- */
-
-static void xpmFreeColorTable
-ARGLIST((colorTable, ncolors))
-ARG(char ***, colorTable)
-GRA(int, ncolors)
-{
-    int a, b;
-
-    if (colorTable) {
-        for (a = 0; a < ncolors; a++)
-            if (colorTable[a]) {
-                for (b = 0; b < (BXNKEYS + 1); b++)
-                    if (colorTable[a][b])
-                        free(colorTable[a][b]);
-                free((char *)colorTable[a]);
-            }
-        free((char *)colorTable);
-    }
-}
-
-#else /* USE_XPM_LIBRARY */
-
-#include <xpm.h>
-
-#define BxXpmColorError    		XpmColorError
-#define BxXpmSuccess       		XpmSuccess
-#define BxXpmOpenFailed    		XpmOpenFailed
-#define BxXpmFileInvalid   		XpmFileInvalid
-#define BxXpmNoMemory      		XpmNoMemory
-#define BxXpmColorFailed   		XpmColorFailed
-
-#define BxXpmVisual        		XpmVisual
-#define BxXpmColormap      		XpmColormap
-#define BxXpmDepth         		XpmDepth
-#define BxXpmSize          		XpmSize
-#define BxXpmHotspot       		XpmHotspot
-#define BxXpmCharsPerPixel 		XpmCharsPerPixel
-#define BxXpmColorSymbols  		XpmColorSymbols
-#define BxXpmRgbFilename   		XpmRgbFilename
-#define BxXpmInfos         		XpmInfos
-
-#define BxXpmReturnPixels  		XpmReturnPixels
-#define BxXpmReturnInfos   		XpmReturnInfos
-
-#define BxXpmCreatePixmapFromData	XpmCreatePixmapFromData
-#define BxXpmCreateImageFromData	XpmCreateImageFromData
-#define BxXpmFreeAttributes		XpmFreeAttributes
-
-typedef XpmAttributes      		BxXpmAttributes;
-
-#endif /* USE_XPM_LIBRARY */
-
-Pixmap XPM_PIXMAP
-ARGLIST((w, pixmapName))
-ARG(Widget, w)
-GRA(char **, pixmapName)
-{
-    BxXpmAttributes	attributes;
-    int			argcnt;
-    Arg			args[10];
-    Pixmap		pixmap;
-    Pixmap		shape;
-    int			returnValue;
-
-    argcnt = 0;
-    XtSetArg(args[argcnt], XmNdepth, &(attributes.depth)); argcnt++;
-    XtSetArg(args[argcnt], XmNcolormap, &(attributes.colormap)); argcnt++;
-    XtGetValues(w, args, argcnt);
-
-    attributes.visual = DefaultVisual(XtDisplay(w),
-				      DefaultScreen(XtDisplay(w)));
-    attributes.valuemask = (BxXpmDepth | BxXpmColormap | BxXpmVisual);
-
-    returnValue = BxXpmCreatePixmapFromData(XtDisplay(w),
-					  DefaultRootWindow(XtDisplay(w)),
-					  pixmapName, &pixmap, &shape,
-					  &attributes);
-    if ( shape )
-    {
-	XFreePixmap(XtDisplay(w), shape);
-    }
-
-    switch(returnValue)
-    {
-    case BxXpmOpenFailed:
-    case BxXpmFileInvalid:
-    case BxXpmNoMemory:
-    case BxXpmColorFailed:
-	XtWarning("Could not create pixmap.");
-	return(XmUNSPECIFIED_PIXMAP);
-    default:
-	return(pixmap);
-    }
-}
-
-#endif
-
-/* This structure is for capturing app-defaults values for a Class */
-
-typedef struct _UIAppDefault
-{
-    char*		cName;		/* Class name */
-    char*		wName; 		/* Widget name */
-    char*		cInstName;	/* Name of class instance(nested) */
-    char*		wRsc;		/* Widget resource */
-    char*		value;		/* value read from app-defaults */
-} UIAppDefault;
-
-
-void setDefaultResources ARGLIST((_name, w, resourceSpec))
-ARG(char*, _name)
-ARG(Widget, w)
-GRA(String *,resourceSpec)
-{
-   int         i;
-   Display    *dpy = XtDisplay ( w );	  /* Retrieve the display pointer */
-   XrmDatabase rdb = NULL;             /* A resource data base */
-
-   /* Create an empty resource database */
-
-   rdb = XrmGetStringDatabase ( "" );
-
-   /* Add the Component resources, prepending the name of the component */
-
-   i = 0;
-   while ( resourceSpec[i] != NULL )
-   {
-       char buf[1000];
-
-       sprintf(buf, "*%s%s", _name, resourceSpec[i++]);
-       XrmPutLineResource( &rdb, buf );
-   }
-
-   /* Merge them into the Xt database, with lowest precendence */
-
-   if ( rdb )
-   {
-#if (XlibSpecificationRelease>=5)
-        XrmDatabase db = XtDatabase(dpy);
-	XrmCombineDatabase(rdb, &db, FALSE);
-#else
-        XrmMergeDatabases ( dpy->db, &rdb );
-        dpy->db = rdb;
-#endif
-    }
-}
-
-/*
- * This method gets all the resources from the app-defaults file
- * (resource databse) and fills in the table (defs) if the app default
- * value exists.
- */
-void
-InitAppDefaults ARGLIST((parent, defs))
-ARG(Widget, parent)
-GRA(UIAppDefault *, defs)
-{
-    XrmQuark		cQuark;
-    XrmQuark		rsc[10];
-    XrmRepresentation	rep;
-    XrmValue		val;
-    XrmDatabase		rdb;
-    int			rscIdx;
-
-    /* Get the database */
-
-#if (XlibSpecificationRelease >= 5)
-    if ((rdb = XrmGetDatabase(XtDisplay(parent))) == NULL)
-    {
-	return;			/*  Can't get the database */
-    }
-#else
-    Display *dpy = XtDisplay(parent);
-    if ((rdb = dpy->db) == NULL)
-    {
-	return;
-    }
-#endif
-
-    /* Look for each resource in the table */
-
-    while (defs->wName)
-    {
-	rscIdx = 0;
-
-	cQuark = XrmStringToQuark(defs->cName);	/* class quark */
-	rsc[rscIdx++] = cQuark;
-	if (defs->wName[0] == '\0')
-	{
-	    rsc[rscIdx++] = cQuark;
-	}
-	else
-	{
-	    if( strchr(defs->wName, '.') == NULL )
-	    {
-		rsc[rscIdx++] = XrmStringToQuark(defs->wName);
-	    }
-	    else
-	    {
-		/*
-		 * If we found a '.' that means that this is not
-		 * a simple widget name, but a sub specification so
-		 * we need to split this into several quarks.
-		 */
-		char *copy = XtNewString(defs->wName), *ptr;
-
-		for( ptr = strtok(copy, "."); ptr != NULL;
-		     ptr = strtok(NULL, ".") )
-		{
-		    rsc[rscIdx++] = XrmStringToQuark(ptr);
-		}
-		XtFree(copy);
-	    }
-	}
-
-	if (defs->cInstName && defs->cInstName[0] != '\0')
-	{
-	    rsc[rscIdx++] = XrmStringToQuark(defs->cInstName);
-	}
-
-	rsc[rscIdx++] = XrmStringToQuark(defs->wRsc);
-	rsc[rscIdx++] = NULLQUARK;
-
-	if (XrmQGetResource(rdb, rsc, rsc, &rep, &val))
-	{
-	    defs->value = XtNewString((char*)val.addr);
-	}
-	defs++;
-    }
-}
-
-/*
- * This method applies the app defaults for the class to a specific
- * instance. All the widgets in the path are loosly coupled (use *).
- * To override a specific instance, use a tightly coupled app defaults
- * resource line (use .).
- */
-void
-SetAppDefaults ARGLIST((w, defs, inst_name, override_inst))
-ARG(Widget,w)
-ARG(UIAppDefault*, defs)
-ARG(char*, inst_name)
-GRA(Boolean, override_inst)
-{
-   Display*		dpy = XtDisplay ( w );	/*  Retrieve the display */
-   XrmDatabase		rdb = NULL;		/* A resource data base */
-   char			lineage[1000];
-   char			buf[1000];
-   Widget       	parent;
-
-   /* Protect ourselves */
-
-   if (inst_name == NULL) return;
-
-   /*  Create an empty resource database */
-
-   rdb = XrmGetStringDatabase ( "" );
-
-   /* Start the lineage with our name and then get our parents */
-
-   lineage[0] = '\0';
-   parent = w;
-
-   while (parent)
-   {
-       WidgetClass wclass = XtClass(parent);
-
-       if (wclass == applicationShellWidgetClass) break;
-
-       strcpy(buf, lineage);
-       sprintf(lineage, "*%s%s", XtName(parent), buf);
-
-       parent = XtParent(parent);
-   }
-
-   /*  Add the Component resources, prepending the name of the component */
-   while (defs->wName != NULL)
-   {
-       int name_length;
-       /*
-        * We don't deal with the resource if it isn't found in the
-	* Xrm database at class initializtion time (in initAppDefaults).
-	* Special handling of class instances.
-	*/
-       if (strchr(defs->wName, '.'))
-       {
-	   name_length = strlen(defs->wName) -
-		strlen(strchr(defs->wName, '.'));
-       }
-       else
-       {
-	   name_length = strlen(defs->wName) > strlen(inst_name) ?
-	       strlen(defs->wName) : strlen(inst_name);
-       }
-       if (defs->value == NULL ||
-	   (override_inst && strncmp(inst_name, defs->wName, name_length)) ||
-	   (! override_inst && defs->cInstName != NULL))
-       {
-	   defs++;
-	   continue;
-       }
-
-       /* Build up string after lineage */
-       if (defs->cInstName != NULL)
-       {
-	   /* Don't include class instance name if it is also the instance */
-	   /* being affected.  */
-
-	   if (*defs->cInstName != '\0')
-	   {
-	       sprintf(buf, "%s*%s*%s.%s: %s",
-		       lineage, defs->wName, defs->cInstName,
-			defs->wRsc, defs->value);
-	   }
-	   else
-	   {
-	       sprintf(buf, "%s*%s.%s: %s",
-		       lineage, defs->wName, defs->wRsc,
-			defs->value);
-	   }
-       }
-       else if (*defs->wName != '\0')
-       {
-	   sprintf(buf, "%s*%s*%s.%s: %s",
-		   lineage, inst_name, defs->wName, defs->wRsc, defs->value);
-       }
-       else
-       {
-	   sprintf(buf, "%s*%s.%s: %s",
-		   lineage, inst_name,defs->wRsc, defs->value);
-       }
-
-       XrmPutLineResource( &rdb, buf );
-       defs++;
-   }
-
-   /* Merge them into the Xt database, with lowest precendence */
-   if ( rdb )
-   {
-#if (XlibSpecificationRelease >= 5)
-        XrmDatabase db = XtDatabase(dpy);
-	XrmCombineDatabase(rdb, &db, FALSE);
-#else
-        XrmMergeDatabases ( dpy->db, &rdb );
-        dpy->db = rdb;
-#endif
-    }
-}
diff --git a/src/mbedit/mbedit_callbacks.c b/src/mbedit/mbedit_callbacks.c
deleted file mode 100644
index 40f2182..0000000
--- a/src/mbedit/mbedit_callbacks.c
+++ /dev/null
@@ -1,3390 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbedit_callbacks.c	3/28/97
- *    $Id: mbedit_callbacks.c 2252 2015-07-01 19:35:37Z caress $
- *
- *    Copyright (c) 1993-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * MBEDIT is an interactive beam editor for multibeam bathymetry data.
- * It can work with any data format supported by the MBIO library.
- * This version uses the MOTIF toolkit and has been developed using
- * the Builder Xsessory package by ICS.  This file contains
- * the callbacks generated by BX.
- *
- *
- */
-/*
- * README: This file is appended to at file generation time.
- * Edits can be made throughout the file
- */
-/*
- * Generated by the ICS Builder Xcessory (BX).
- *
- * Builder Xcessory 4.0
- * Code Generator Xcessory 2.0 (09/09/96)
- *
- */
-#include <Xm/Xm.h>
-
-
-/*
- * Standard includes for builtins.
- */
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include <sys/stat.h>
-
-/* X11 includes */
-#include <X11/StringDefs.h>
-#include <X11/cursorfont.h>
-#include <X11/Xlib.h>
-#include <X11/Xutil.h>
-#include <X11/Intrinsic.h>
-#include <X11/keysym.h>
-#include <X11/keysymdef.h>
-#include <Xm/FileSB.h>
-#include <Xm/Text.h>
-#include <Xm/TextF.h>
-#include <Xm/ToggleB.h>
-#include <Xm/List.h>
-
-/* mbedit widget includes */
-#include "mbedit_creation.h"
-#include "mb_define.h"
-#include "mb_status.h"
-#include "mb_process.h"
-#include "mb_xgraphics.h"
-#include "mbedit.h"
-
-#ifndef FIXED
-#define FIXED "fixed"
-#endif
-
-/*
- * Macros to make code look nicer between ANSI and K&R.
- */
-#ifndef ARGLIST
-#if (NeedFunctionPrototypes == 0)
-#define PROTOTYPE(p)	()
-#define ARGLIST(p)	p
-#define ARG(a, b)	a b;
-#define GRA(a, b)	a b;
-#define UARG(a, b)      a b;
-#define GRAU(a, b)      a b;
-#else
-#define PROTOTYPE(p)	p
-#define ARGLIST(p)	(
-#define ARG(a, b)	a b,
-#define GRA(a, b)	a b)
-#ifdef __cplusplus
-#define UARG(a, b)      a,
-#define GRAU(a, b)      a)
-#else
-#define UARG(a, b)      a b,
-#define GRAU(a, b)      a b)
-#endif
-#endif
-#endif
-
-Widget		BxFindTopShell PROTOTYPE((Widget));
-WidgetList	BxWidgetIdsFromNames PROTOTYPE((Widget, char*, char*));
-
-/*--------------------------------------------------------------------*/
-
-/* id variables */
-static char svn_id[] = "$Id: mbedit_callbacks.c 2252 2015-07-01 19:35:37Z caress $";
-static char program_name[] = "MBedit";
-
-/* additional widgets */
-Widget	fileSelectionList;
-Widget	fileSelectionText;
-
-/* global defines and variables */
-#define EV_MASK (ButtonPressMask | KeyPressMask | KeyReleaseMask | ExposureMask )
-#define xgfont "-*-"FIXED"-bold-r-normal-*-13-*-75-75-c-70-iso8859-1"
-
-/* Mode value defines */
-#define	MODE_TOGGLE	0
-#define	MODE_PICK	1
-#define	MODE_ERASE	2
-#define	MODE_RESTORE	3
-#define	MODE_GRAB	4
-#define	MODE_INFO	5
-#define	VIEW_WATERFALL		0
-#define	VIEW_ALONGTRACK		1
-#define	VIEW_ACROSSTRACK	2
-#define	BEAM_MODE_FLAG		0
-#define	BEAM_MODE_DETECT	1
-#define	BEAM_MODE_PULSE		2
-#define	OUTPUT_MODE_OUTPUT	0
-#define	OUTPUT_MODE_EDIT	1
-#define	OUTPUT_MODE_BROWSE	2
-#define GRAB_START		0
-#define GRAB_MOVE		1
-#define GRAB_END		2
-#define	NUM_FILES_MAX		500
-
-/* global variables */
-XtAppContext app_context;
-Display *display, *theDisplay;
-Screen *screen, *can_screen;
-Window can_xid;
-Window root_return, child_return;
-Colormap theColormap, colormap;
-GC gc;
-unsigned int theCursorShape;
-Cursor theCursor;
-XGCValues xgcv;
-
-XFontStruct *fontStruct;
-
-/* Global mbedit definitions */
-int	expose_plot_ok = False;
-int	plot_size_max;
-int	mplot_size;
-int	buffer_size_max;
-int	buffer_size;
-int	hold_size;
-int	mformat;
-int	step = 5;
-int	nloaded;
-int	ndumped;
-int	nbuffer;
-int	ngood;
-int	icurrent;
-int	mnplot;
-int	mexager;
-int	mplot_width;
-int	mx_interval;
-int	my_interval;
-int	mode_pick = MODE_TOGGLE;
-int	mshow_beammode = BEAM_MODE_FLAG;
-int	mshow_flagged = MB_NO;
-int	mview_mode = VIEW_WATERFALL;
-int	mshow_time = 1;
-int	mode_output = OUTPUT_MODE_EDIT;
-int	mode_reverse_keys = MB_NO;
-int	mode_reverse_mouse = MB_NO;
-int	ttime_i[7];
-int	f_beams_max;
-double	f_distance_max;
-int	f_medianspike;
-int	f_medianspike_threshold;
-int	f_medianspike_xtrack;
-int	f_medianspike_ltrack;
-int	f_wrongside;
-int	f_wrongside_threshold;
-int	f_cutbeam;
-int	f_cutbeam_begin;
-int	f_cutbeam_end;
-int	f_cutdistance;
-double	f_cutdistance_begin;
-double	f_cutdistance_end;
-int	f_cutangle;
-double	f_cutangle_begin;
-double	f_cutangle_end;
-int	status;
-
-/* file opening parameters */
-int	startup_file = 0;
-int	numfiles = 0;
-int	currentfile = -1;
-int	currentfile_shown = -1;
-int	fileformats[NUM_FILES_MAX];
-mb_path	filepaths[NUM_FILES_MAX];
-int	filelocks[NUM_FILES_MAX];
-int	fileesfs[NUM_FILES_MAX];
-int	timer_function_set = MB_NO;
-
-static char	input_file[MB_PATH_MAXLINE];
-int selected = 0; /* indicates an input file is selected */
-
-void	*can_xgid;		/* XG graphics id */
-Cursor myCursor;
-XColor closest[2];
-XColor exact[2];
-
-int key_g_down = 0;
-int key_z_down = 0;
-int key_s_down = 0;
-int key_a_down = 0;
-int key_d_down = 0;
-
-/* Set the colors used for this program here. */
-#define NCOLORS 7
-XColor colors[NCOLORS];
-unsigned int mpixel_values[NCOLORS];
-XColor db_color;
-
-/* Set these to the dimensions of your canvas drawing */
-/* area, minus 1, located in mbedit.uil.              */
-static int mb_borders[4] =
-	{ 0, 1016, 0, 525 };
-
-/*--------------------------------------------------------------------*/
-
-/*      Function Name: 	BxUnmanageCB
- *
- *      Description:   	Given a string of the form:
- *		       	"(WL)[widgetName, widgetName, ...]"
- *			BxUnmanageCB attempts to convert the name to a Widget
- *			ID and unmanage the widget.
- *
- *      Arguments:     	Widget	    w:      the widget activating the callback.
- *		       	XtPointer   client: the list of widget names to attempt
- *					    to find and unmanage.
- *		       	XtPointer   call:   the call data (unused).
- *
- *      Notes:        *	This function expects that there is an application
- *		       	shell from which all other widgets are descended.
- */
-
-/* ARGSUSED */
-void
-BxUnmanageCB ARGLIST((w, client, call))
-ARG( Widget, w)
-ARG( XtPointer, client)
-GRAU( XtPointer, call)
-{
-    WidgetList		widgets;
-    int			i;
-
-    /*
-     * This function returns a NULL terminated WidgetList.  The memory for
-     * the list needs to be freed when it is no longer needed.
-     */
-    widgets = BxWidgetIdsFromNames(w, "BxUnmanageCB", (String)client);
-
-    i = 0;
-    while( widgets && widgets[i] != NULL )
-    {
-	XtUnmanageChild(widgets[i]);
-	i++;
-    }
-    XtFree((char *)widgets);
-}
-
-/*--------------------------------------------------------------------*/
-
-/*      Function Name: 	BxManageCB
- *
- *      Description:   	Given a string of the form:
- *		       	"(WL)[widgetName, widgetName, ...]"
- *			BxManageCB attempts to convert the name to a Widget
- *			ID and manage the widget.
- *
- *      Arguments:     	Widget	    w:      the widget activating the callback.
- *		       	XtPointer   client: the list of widget names to attempt
- *					    to find and manage.
- *		       	XtPointer   call:   the call data (unused).
- *
- *      Notes:        *	This function expects that there is an application
- *		       	shell from which all other widgets are descended.
- */
-
-/* ARGSUSED */
-void
-BxManageCB ARGLIST((w, client, call))
-ARG( Widget, w)
-ARG( XtPointer, client)
-GRAU( XtPointer, call)
-{
-    WidgetList		widgets;
-    int			i;
-
-    /*
-     * This function returns a NULL terminated WidgetList.  The memory for
-     * the list needs to be freed when it is no longer needed.
-     */
-    widgets = BxWidgetIdsFromNames(w, "BxManageCB", (String)client);
-
-    i = 0;
-    while( widgets && widgets[i] != NULL )
-    {
-	XtManageChild(widgets[i]);
-	i++;
-    }
-    XtFree((char *)widgets);
-}
-/*--------------------------------------------------------------------*/
-/*      Function Name:	BxPopupCB
- *
- *      Description:   	This function accepts a string of the form:
- *			"(WL)[widgetName, widgetName, ...]"
- *			It attempts to convert the widget names to Widget IDs
- *			and then popup the widgets WITHOUT any grab.
- *
- *      Arguments:      Widget		w:	the activating widget.
- *			XtPointer	client:	the string of widget names to
- *						popup.
- *			XtPointer	call:	the call data (unused).
- *
- *      Notes:        * This function expects that there is an application
- *                      shell from which all other widgets are descended.
- *		      * BxPopupCB can only work on Shell widgets.  It will not
- *			work on other object types.  This is because popping up
- *			can only be done to a shell.  A check is made using
- *			XtIsShell() and an appropriate error is output if the
- *			passed object is not a Shell.
- */
-
-/* ARGSUSED */
-void
-BxPopupCB ARGLIST((w, client, call))
-ARG( Widget, w)
-ARG( XtPointer, client)
-GRAU( XtPointer, call)
-{
-    WidgetList		widgets;
-    int			i;
-
-    /*
-     * This function returns a NULL terminated WidgetList.  The memory for
-     * the list needs to be freed when it is no longer needed.
-     */
-    widgets = BxWidgetIdsFromNames(w, "BxPopupCB", (String)client);
-
-    i = 0;
-    while( widgets && widgets[i] != NULL )
-    {
-	if ( XtIsShell(widgets[i]) )
-	{
-	    XtPopup(widgets[i], XtGrabNone);
-	}
-	else
-	{
-	    printf("Callback Error (BxPopupCB):\n\t\
-Object %s is not a Shell\n", XtName(widgets[i]));
-	}
-	i++;
-    }
-    XtFree((char *)widgets);
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_mbedit_init(int argc, char **argv)
-{
-    int	i;
-
-    /* make sure expose plots are off */
-    expose_plot_ok = False;
-
-    /* get additional widgets */
-    fileSelectionList = (Widget)
-	XmFileSelectionBoxGetChild(fileSelectionBox,
-				    XmDIALOG_LIST);
-    fileSelectionText = (Widget)
-	XmFileSelectionBoxGetChild(fileSelectionBox,
-				    XmDIALOG_TEXT);
-    XtAddCallback(fileSelectionList,
-	    XmNbrowseSelectionCallback,
-	    do_fileselection_list, NULL);
-
-    XtUnmanageChild(
-	    (Widget) XmFileSelectionBoxGetChild(
-				    fileSelectionBox,
-				    XmDIALOG_HELP_BUTTON));
-
-    /* Setup the entire screen. */
-    display = XtDisplay(window_mbedit);
-    colormap = DefaultColormap(display, XDefaultScreen(display));
-
-    /* Setup just the "canvas" part of the screen. */
-    theDisplay = XtDisplay(canvas_mbedit);
-    can_screen = DefaultScreenOfDisplay(theDisplay);
-    can_xid = XtWindow(canvas_mbedit);
-    theColormap = DefaultColormap(display, XDefaultScreen(theDisplay));
-
-    /* Setup the "graphics Context" for just the "canvas" */
-    xgcv.background = WhitePixelOfScreen(can_screen);
-    xgcv.foreground = BlackPixelOfScreen(can_screen);
-    xgcv.line_width = 2;
-    gc = XCreateGC(theDisplay,can_xid,GCBackground | GCForeground
-	     | GCLineWidth, &xgcv);
-
-    /* Setup the font for just the "canvas" screen. */
-    fontStruct = XLoadQueryFont(theDisplay, xgfont);
-    if (fontStruct == NULL)
-        {
-	fprintf(stderr,"\nFailure to load font using XLoadQueryFont: %s\n", xgfont);
-        fprintf(stderr,"\tSource file: %s\n\tSource line: %d\n\tSource version: %s", __FILE__, __LINE__, svn_id);
-	fprintf(stderr,"\nProgram <%s> Terminated\n", program_name);
-	exit(-1);
-        }
-    XSetFont(theDisplay,gc,fontStruct->fid);
-
-    XSelectInput(theDisplay, can_xid, EV_MASK );
-
-    /* Load the colors that will be used in this program. */
-    status = XLookupColor(display,colormap, "white",&db_color,&colors[0]);
-    if ((status = XAllocColor(display,colormap,&colors[0])) == 0)
-	    fprintf(stderr,"Failure to allocate color: white\n");
-    status = XLookupColor(display,colormap, "black",&db_color,&colors[1]);
-    if ((status = XAllocColor(display,colormap,&colors[1])) == 0)
-	    fprintf(stderr,"Failure to allocate color: black\n");
-#ifdef USE_ORANGE
-    status = XLookupColor(display,colormap, "orange",&db_color,&colors[2]);
-    if ((status = XAllocColor(display,colormap,&colors[2])) == 0)
-	    fprintf(stderr,"Failure to allocate color: orange\n");
-#else
-    status = XLookupColor(display,colormap, "red",&db_color,&colors[2]);
-    if ((status = XAllocColor(display,colormap,&colors[2])) == 0)
-	    fprintf(stderr,"Failure to allocate color: red\n");
-#endif
-    status = XLookupColor(display,colormap, "green",&db_color,&colors[3]);
-    if ((status = XAllocColor(display,colormap,&colors[3])) == 0)
-	    fprintf(stderr,"Failure to allocate color: green\n");
-    status = XLookupColor(display,colormap, "blue",&db_color,&colors[4]);
-    if ((status = XAllocColor(display,colormap,&colors[4])) == 0)
-	    fprintf(stderr,"Failure to allocate color: blue\n");
-    status = XLookupColor(display,colormap, "coral",&db_color,&colors[5]);
-    if ((status = XAllocColor(display,colormap,&colors[5])) == 0)
-	    fprintf(stderr,"Failure to allocate color: coral\n");
-    status = XLookupColor(display,colormap, "lightgrey",&db_color,&colors[6]);
-    if ((status = XAllocColor(display,colormap,&colors[6])) == 0)
-	    fprintf(stderr,"Failure to allocate color: lightgrey\n");
-    for (i=0;i<NCOLORS;i++)
-	    {
-	    mpixel_values[i] = colors[i].pixel;
-	    }
-
-    /* Setup initial cursor. This will be changed when changing "MODE". */
-    myCursor = XCreateFontCursor(theDisplay, XC_target);
-    XAllocNamedColor(theDisplay,colormap,"red",&closest[0],&exact[0]);
-    XAllocNamedColor(theDisplay,colormap,"coral",&closest[1],&exact[1]);
-    XRecolorCursor(theDisplay,myCursor,&closest[0],&closest[1]);
-    XDefineCursor(theDisplay,can_xid,myCursor);
-
-    /* initialize graphics */
-    xg_init(theDisplay, can_xid, mb_borders, xgfont, &can_xgid);
-
-    status = mbedit_set_graphics(can_xgid, NCOLORS, mpixel_values);
-    status = mbedit_set_scaling(mb_borders, mshow_time);
-
-    /* initialize mbedit proper */
-    status = mbedit_init(argc,argv, &startup_file);
-
-    /* set up the widgets */
-    do_setup_data();
-    do_filebutton_on();
-    do_nextbutton_off();
-
-    /* set timer for function to keep updating the filelist */
-    do_mbedit_settimer();
-
-    /* if startup indicated by num_files > 0 try to open first file */
-    if (startup_file == MB_YES && numfiles > 0)
-	{
-	do_load_specific_file(0);
-	}
-
-    /* finally allow expose plots */
-    expose_plot_ok = True;
-    
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_parse_datalist( char *file, int form)
-{
-	void    *datalist;
-	int     done;
-	double  weight;
-	int     filestatus;
-	int     fileformat;
-	char    fileraw[MB_PATH_MAXLINE];
-	char    fileprocessed[MB_PATH_MAXLINE];
-	int     datalist_status = MB_SUCCESS;
-	int	error = MB_ERROR_NO_ERROR;
-	int	format;
-	int     verbose = 0;
-
-    	/* try to resolve format if necessary */
-	format = form;
-	mbedit_get_format(file, &format);
-
-	/* read in a single file */
-	if (format > 0 && numfiles < NUM_FILES_MAX)
-		{
-		strcpy(filepaths[numfiles], file);
-		fileformats[numfiles] = format;
-		filelocks[numfiles] = -1;
-		fileesfs[numfiles] = -1;
-		numfiles++;
-		}
-
-	/* read in datalist if forma = -1 */
-	else if (format == -1)
-		{
-		error = MB_ERROR_NO_ERROR;
-		done = MB_NO;
-		if ((datalist_status = mb_datalist_open(verbose, &datalist,
-						file, MB_DATALIST_LOOK_NO, &error)) == MB_SUCCESS)
-			{
-			while (done == MB_NO)
-				{
-				if ((datalist_status = mb_datalist_read2(verbose, datalist,
-						&filestatus, fileraw, fileprocessed, &fileformat, &weight, &error))
-						== MB_SUCCESS)
-					{
-					if (numfiles < NUM_FILES_MAX)
-						{
-						strcpy(filepaths[numfiles], fileraw);
-						fileformats[numfiles] = fileformat;
-						filelocks[numfiles] = -1;
-						fileesfs[numfiles] = -1;
-						numfiles++;
-						}
-					}
-				else
-					{
-					datalist_status = mb_datalist_close(verbose,&datalist,&error);
-					done = MB_YES;
-					}
-				}
-			}
-		}
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_editlistselection( Widget w, XtPointer client_data, XtPointer call_data)
-{
-	Cardinal ac;
-	Arg      args[256];
-	int	*position_list = NULL;
-	int	position_count = 0;
-	int	quit;
-	int	i;
-
-	/* turn off expose plots */
-	expose_plot_ok = False;
-
-	/* get the current selection, if any, from the list */
-	ac = 0;
-	XtSetArg(args[ac], XmNselectedPositionCount, (XtPointer) &position_count); ac++;
-	XtSetArg(args[ac], XmNselectedPositions, (XtPointer) &position_list); ac++;
-	XtGetValues(list_filelist, args, ac);
-
-fprintf(stderr,"position_count:%d\n",position_count);
-for(i=0;i<position_count;i++)
-fprintf(stderr,"  %d %d\n",i,position_list[i]);
-
-
-	/* if the selected file is different than what's already loaded, unload the old file and load the new one */
-	if (position_count > 0 && currentfile != position_list[0] - 1)
-		{
-		currentfile = position_list[0] - 1;
-
-		status = mbedit_action_done(buffer_size,&ndumped,&nloaded,
-			    &nbuffer,&ngood,&icurrent,&quit);
-		if (status == 0) XBell(theDisplay,100);
-
-		if (position_count > 0)
-			currentfile = position_list[0] - 1;
-		if (currentfile < numfiles)
-			{
-			do_load_specific_file(currentfile);
-			}
-		}
-
-	/* turn on expose plots */
-	expose_plot_ok = True;
-
-	do_setup_data();
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_filelist_remove( Widget w, XtPointer client_data, XtPointer call_data)
-{
-	Cardinal ac;
-	Arg      args[256];
-	int	*position_list = NULL;
-	int	position_count = 0;
-	int	i;
-
-	/* turn off expose plots */
-	expose_plot_ok = False;
-
-	/* get the current selection, if any, from the list */
-	ac = 0;
-	XtSetArg(args[ac], XmNselectedPositionCount, (XtPointer) &position_count); ac++;
-	XtSetArg(args[ac], XmNselectedPositions, (XtPointer) &position_list); ac++;
-	XtGetValues(list_filelist, args, ac);
-
-	/* if the selected file is different than what's already loaded, remove it from the list */
-	if (position_count > 0 && currentfile != position_list[0] - 1)
-		{
-		for (i=position_list[0] - 1;i<numfiles-1;i++)
-			{
-			strcpy(filepaths[i], filepaths[i+1]);
-			fileformats[i] = fileformats[i+1];
-			filelocks[i] = filelocks[i+1];
-			fileesfs[i] = fileesfs[i+1];
-			}
-		numfiles--;
-		if (currentfile > position_list[0] - 1)
-			currentfile--;
-		}
-
-	/* turn on expose plots */
-	expose_plot_ok = True;
-
-	do_setup_data();
-
-	/* replot the data */
-	status = mbedit_action_plot(mplot_width, mexager,
-	    mx_interval, my_interval,
-	    mplot_size, mshow_beammode, mshow_flagged, mshow_time,
-	    &nbuffer, &ngood, &icurrent, &mnplot);
-	if (status == 0) XBell(theDisplay,100);
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_load_specific_file(int i_file)
-{
-	struct stat file_status;
-	int	fstat;
-	char    save_file[MB_PATH_MAXLINE];
-        int     save_mode = MB_NO;
-
-	/* check the specified file is in the list */
-	if (numfiles > 0 && i_file >= 0 && i_file < numfiles)
-		{
-		/* set current_file */
-		currentfile = i_file;
-
-		/* check for edit save file */
-		sprintf(save_file, "%s.esf", filepaths[currentfile]);
-		fstat = stat(save_file, &file_status);
-		if (fstat != 0
-			|| (file_status.st_mode & S_IFMT) == S_IFDIR)
-			{
-			sprintf(save_file, "%s.mbesf", filepaths[currentfile]);
-			fstat = stat(save_file, &file_status);
-			}
-
-		/* if esf file exists deal with it */
-		if (fstat == 0
-		    && (file_status.st_mode & S_IFMT) != S_IFDIR)
-			{
-			/* if save_mode set load data using esf */
-			if (save_mode == MB_YES)
-                                do_load(MB_YES);
-
-			/* else bring up dialog asking
-			if esf should be used */
-			else
-                                do_checkuseprevious();
-			}
-
-		/* else just try to load the data without an esf */
-		else
-			{
-			(void) do_load(MB_NO);
-			}
-		}
-}
-
-/*--------------------------------------------------------------------*/
-
-int do_setup_data()
-{
-	char value_text[MB_PATH_MAXLINE];
-
-	/* get some default values from mbedit */
-	status = mbedit_get_defaults(&plot_size_max,
-			&mplot_size,&mshow_beammode,&mshow_flagged,&mshow_time,
-			&buffer_size_max,&buffer_size,
-			&hold_size,&mformat,
-			&mplot_width,&mexager,
-			&mx_interval,&my_interval,
-			ttime_i,&mode_output);
-
-	/* set about version label */
-	sprintf(value_text, ":::t\"MB-System Release %s\":t\"%s\"",
-		MB_VERSION, MB_BUILD_DATE);
-	set_label_multiline_string(label_about_version, value_text);
-
-	/* set values of number of pings slider */
-	XtVaSetValues(slider_number_pings,
-			XmNminimum, 1,
-			XmNvalue, mplot_size,
-			NULL);
-
-	/* set values of number of pings to step slider */
-	XtVaSetValues(slider_number_step,
-			XmNminimum, 1,
-			XmNvalue, step,
-			NULL);
-
-	/* set values of buffer size slider */
-	XtVaSetValues(slider_buffer_size,
-			XmNminimum, 1,
-			XmNmaximum, buffer_size_max,
-			XmNvalue, buffer_size,
-			NULL);
-
-	/* set values of buffer size label */
-	sprintf(value_text,"%d",buffer_size_max);
-	set_label_string(slider_buffer_size_max_label,
-			value_text);
-
-	/* set values of buffer hold size slider */
-	XtVaSetValues(slider_buffer_hold,
-			XmNminimum, 1,
-			XmNmaximum, buffer_size_max,
-			XmNvalue, hold_size,
-			NULL);
-
-	/* set values of buffer hold size label */
-	sprintf(value_text,"%d",buffer_size_max);
-	set_label_string(slider_buffer_hold_max_label,
-			value_text);
-
-	/* set values of plot width slider */
-	XtVaSetValues(slider_scale_x,
-			XmNminimum, 1,
-			XmNvalue, mplot_width,
-			NULL);
-
-	/* set values of vertical exageration slider */
-	XtVaSetValues(slider_scale_y,
-			XmNdecimalPoints, 2,
-			XmNvalue, mexager,
-			NULL);
-
-	/* set values of x interval slider */
-	XtVaSetValues(slider_x_interval,
-			XmNvalue, mx_interval,
-			NULL);
-
-	/* set values of y interval slider */
-	XtVaSetValues(slider_y_interval,
-			XmNvalue, my_interval,
-			NULL);
-
-	/* set starting values in go to time widgets */
-	sprintf(value_text,"%4.4d",ttime_i[0]);
-	XmTextFieldSetString(textfield_year, value_text);
-
-	sprintf(value_text,"%2.2d",ttime_i[1]);
-	XmTextFieldSetString(textfield_month, value_text);
-
-	sprintf(value_text,"%2.2d",ttime_i[2]);
-	XmTextFieldSetString(textfield_day, value_text);
-
-	sprintf(value_text,"%2.2d",ttime_i[3]);
-	XmTextFieldSetString(textfield_hour, value_text);
-
-	sprintf(value_text,"%2.2d",ttime_i[4]);
-	XmTextFieldSetString(textfield_minute, value_text);
-
-	sprintf(value_text,"%2.2d",ttime_i[5]);
-	XmTextFieldSetString(textfield_second, value_text);
-
-	/* set value of format text item */
-	sprintf(value_text,"%2.2d",mformat);
-	XmTextFieldSetString(textfield_format, value_text);
-
-	/* set the output mode */
-	if (mode_output == OUTPUT_MODE_EDIT)
-	    {
-	    XmToggleButtonSetState(setting_output_toggle_edit,
-			TRUE, TRUE);
-	    XmToggleButtonSetState(setting_output_toggle_edit_filelist,
-			TRUE, TRUE);
-	    }
-	else
-	    {
-	    XmToggleButtonSetState(setting_output_toggle_browse,
-			TRUE, TRUE);
-	    XmToggleButtonSetState(setting_output_toggle_browse_filelist,
-			TRUE, TRUE);
-	    }
-
-	/* set the mode toggles */
-	XmToggleButtonSetState(setting_mode_toggle_toggle, 0, FALSE);
-	XmToggleButtonSetState(setting_mode_toggle_pick, 0, FALSE);
-	XmToggleButtonSetState(setting_mode_toggle_erase, 0, FALSE);
-	XmToggleButtonSetState(setting_mode_toggle_restore, 0, FALSE);
-	XmToggleButtonSetState(setting_mode_toggle_grab, 0, FALSE);
-	XmToggleButtonSetState(setting_mode_toggle_info, 0, FALSE);
-	if (mode_pick == MODE_TOGGLE)
-	    XmToggleButtonSetState(setting_mode_toggle_toggle, 1, FALSE);
-	else if (mode_pick == MODE_PICK)
-	    XmToggleButtonSetState(setting_mode_toggle_pick, 1, FALSE);
-	else if (mode_pick == MODE_ERASE)
-	    XmToggleButtonSetState(setting_mode_toggle_erase, 1, FALSE);
-	else if (mode_pick == MODE_RESTORE)
-	    XmToggleButtonSetState(setting_mode_toggle_restore, 1, FALSE);
-	else if (mode_pick == MODE_GRAB)
-	    XmToggleButtonSetState(setting_mode_toggle_grab, 1, FALSE);
-	else if (mode_pick == MODE_INFO)
-	    XmToggleButtonSetState(setting_mode_toggle_info, 1, FALSE);
-
-	/* set the show flagged toggle */
-	XmToggleButtonSetState(toggleButton_show_flagged_on, mshow_flagged, FALSE);
-
-	/* turn off all view mode togglebuttons */
-	XmToggleButtonSetState(toggleButton_view_waterfall, MB_NO, FALSE);
-	XmToggleButtonSetState(toggleButton_view_alongtrack, MB_NO, FALSE);
-	XmToggleButtonSetState(toggleButton_view_acrosstrack, MB_NO, FALSE);
-	XmToggleButtonSetState(toggleButton_show_flags, FALSE, FALSE);
-	XmToggleButtonSetState(toggleButton_show_detects, FALSE, FALSE);
-	XmToggleButtonSetState(toggleButton_show_pulsetypes, FALSE, FALSE);
-
-	/* now turn on the current view mode togglebutton */
-	if (mview_mode == 0)
-		XmToggleButtonSetState(toggleButton_view_waterfall, MB_YES, FALSE);
-	else if (mview_mode == 1)
-		XmToggleButtonSetState(toggleButton_view_alongtrack, MB_YES, FALSE);
-	else if (mview_mode == 2)
-		XmToggleButtonSetState(toggleButton_view_acrosstrack, MB_YES, FALSE);
-	if (mshow_beammode == BEAM_MODE_FLAG)
-		XmToggleButtonSetState(toggleButton_show_flags, TRUE, FALSE);
-	else if (mshow_beammode == BEAM_MODE_DETECT)
-		XmToggleButtonSetState(toggleButton_show_detects, TRUE, FALSE);
-	else if (mshow_beammode == BEAM_MODE_PULSE)
-		XmToggleButtonSetState(toggleButton_show_pulsetypes, TRUE, FALSE);
-
-	/* reset scaling */
-	status = mbedit_set_viewmode(mview_mode);
-
-	/* turn off all plot mode togglebuttons */
-	XmToggleButtonSetState(toggleButton_show_wideplot, MB_NO, FALSE);
-	XmToggleButtonSetState(toggleButton_show_time, MB_NO, FALSE);
-	XmToggleButtonSetState(toggleButton_show_interval, MB_NO, FALSE);
-	XmToggleButtonSetState(toggleButton_show_lon, MB_NO, FALSE);
-	XmToggleButtonSetState(toggleButton_show_latitude, MB_NO, FALSE);
-	XmToggleButtonSetState(toggleButton_show_heading, MB_NO, FALSE);
-	XmToggleButtonSetState(toggleButton_show_speed, MB_NO, FALSE);
-	XmToggleButtonSetState(toggleButton_show_depth, MB_NO, FALSE);
-	XmToggleButtonSetState(toggleButton_show_altitude, MB_NO, FALSE);
-	XmToggleButtonSetState(toggleButton_show_sonardepth, MB_NO, FALSE);
-	XmToggleButtonSetState(toggleButton_show_roll, MB_NO, FALSE);
-	XmToggleButtonSetState(toggleButton_show_pitch, MB_NO, FALSE);
-	XmToggleButtonSetState(toggleButton_show_heave, MB_NO, FALSE);
-
-	/* now turn on the current plot mode togglebutton */
-	if (mshow_time == 0)
-		XmToggleButtonSetState(toggleButton_show_wideplot, MB_YES, FALSE);
-	else if (mshow_time == 1)
-		XmToggleButtonSetState(toggleButton_show_time, MB_YES, FALSE);
-	else if (mshow_time == 2)
-		XmToggleButtonSetState(toggleButton_show_interval, MB_YES, FALSE);
-	else if (mshow_time == 3)
-		XmToggleButtonSetState(toggleButton_show_lon, MB_YES, FALSE);
-	else if (mshow_time == 4)
-		XmToggleButtonSetState(toggleButton_show_latitude, MB_YES, FALSE);
-	else if (mshow_time == 5)
-		XmToggleButtonSetState(toggleButton_show_heading, MB_YES, FALSE);
-	else if (mshow_time == 6)
-		XmToggleButtonSetState(toggleButton_show_speed, MB_YES, FALSE);
-	else if (mshow_time == 7)
-		XmToggleButtonSetState(toggleButton_show_depth, MB_YES, FALSE);
-	else if (mshow_time == 8)
-		XmToggleButtonSetState(toggleButton_show_altitude, MB_YES, FALSE);
-	else if (mshow_time == 9)
-		XmToggleButtonSetState(toggleButton_show_sonardepth, MB_YES, FALSE);
-	else if (mshow_time == 10)
-		XmToggleButtonSetState(toggleButton_show_roll, MB_YES, FALSE);
-	else if (mshow_time == 11)
-		XmToggleButtonSetState(toggleButton_show_pitch, MB_YES, FALSE);
-	else if (mshow_time == 12)
-		XmToggleButtonSetState(toggleButton_show_heave, MB_YES, FALSE);
-
-	/* get filter values and set widgets */
-	do_get_filters();
-
-	/* build available file list */
-	do_build_filelist();
-
-	return(1);
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_build_filelist()
-{
-	int	update_filelist;
-	Cardinal ac;
-	Arg      args[256];
-	int	item_count;
-	int	*position_list = NULL;
-	int	position_count = 0;
-	int	selection;
-	char value_text[MB_PATH_MAXLINE];
-    	XmString *xstr;
-	char	*lockstrptr;
-	char	*lockedstr   = "<Locked>";
-	char	*unlockedstr = "        ";
-	char	*loadedstr   = "<loaded>";
-	char	*esfstrptr;
-	char	*esfyesstr   = "<esf>";
-	char	*esfnostr    = "     ";
-	int     verbose = 0;
-	int	i;
-
-	/* swath file locking variables */
-	int	lock_status;
-	int	lock_error = MB_ERROR_NO_ERROR;
-	int	locked;
-	int	lock_purpose;
-	mb_path	lock_program;
-	mb_path lock_cpu;
-	mb_path lock_user;
-	char	lock_date[25];
-
-	/* esf file checking variables */
-	int	esf_exists;
-	struct stat file_status;
-	int	fstat;
-	char    save_file[MB_PATH_MAXLINE];
-
-	/* check to see if anything has changed */
-	update_filelist = MB_NO;
-
-	/* check for change in number of files */
-	ac = 0;
-	XtSetArg(args[ac], XmNitemCount, (XtPointer) &item_count); ac++;
-	XtGetValues(list_filelist, args, ac);
-	if (item_count != numfiles)
-		update_filelist = MB_YES;
-
-	/* check current file shown vs loaded */
-	if (currentfile != currentfile_shown)
-		{
-		currentfile_shown = currentfile;
-		update_filelist = MB_YES;
-		}
-
-	/* check for change in lock status or esf status */
-	for (i=0;i<numfiles;i++)
-		{
-		/* check for locks */
-		lock_status = mb_pr_lockinfo(verbose, filepaths[i], &locked,
-				&lock_purpose, lock_program, lock_user, lock_cpu,
-				lock_date, &lock_error);
-		if (locked != filelocks[i])
-			{
-			filelocks[i] = locked;
-			update_filelist = MB_YES;
-			}
-
-		/* check for edit save file */
-		sprintf(save_file, "%s.esf", filepaths[i]);
-		fstat = stat(save_file, &file_status);
-		if (fstat == 0
-		    && (file_status.st_mode & S_IFMT) != S_IFDIR)
-			esf_exists = MB_YES;
-		else
-			esf_exists = MB_NO;
-		if (esf_exists != fileesfs[i])
-			{
-			fileesfs[i] = esf_exists;
-			update_filelist = MB_YES;
-			}
-		}
-
-	/* only rebuild the filelist if necessary */
-	if (update_filelist == MB_YES)
-		{
-		/* get the current selection, if any, from the list */
-		ac = 0;
-		XtSetArg(args[ac], XmNitemCount, (XtPointer) &item_count); ac++;
-		XtSetArg(args[ac], XmNselectedPositionCount, (XtPointer) &position_count); ac++;
-		XtSetArg(args[ac], XmNselectedPositions, (XtPointer) &position_list); ac++;
-		XtGetValues(list_filelist, args, ac);
-		if (position_count > 0)
-			selection = position_list[0];
-
-		/* build available file list */
-		XmListDeleteAllItems(list_filelist);
-		if (numfiles > 0)
-			{
-
-			/* allocate array of x strings */
-			xstr = (XmString *) malloc(numfiles * sizeof(XmString));
-			for (i=0;i<numfiles;i++)
-				{
-				/* check for locks */
-				if (currentfile == i)
-					lockstrptr = loadedstr;
-				else if (filelocks[i] == MB_YES)
-					lockstrptr = lockedstr;
-				else
-					lockstrptr = unlockedstr;
-
-				/* check for edit save file */
-				if (fileesfs[i] == MB_YES)
-					esfstrptr = esfyesstr;
-				else
-					esfstrptr = esfnostr;
-
-				/* build x string item */
-				sprintf(value_text,"%s %s %s %3d",
-					lockstrptr,
-					esfstrptr,
-					filepaths[i],
-					fileformats[i]);
-   				xstr[i] = XmStringCreateLocalized(value_text);
-
-				/* print out list of files */
-				/* if (currentfile == i)
-					fprintf(stderr," *** %s %d %s %d\n",lockstrptr,i+1,filepaths[i],fileformats[i]);
-				else
-					fprintf(stderr,"     %s %d %s %d\n",lockstrptr,i+1,filepaths[i],fileformats[i]); */
- 				}
-    			XmListAddItems(list_filelist,xstr,numfiles,0);
-			for (i=0;i<numfiles;i++)
-				{
-    				XmStringFree(xstr[i]);
-    				}
-    			free(xstr);
-
-			/* reinstate selection if the number of items is the same as before */
-			if (item_count == numfiles && position_count > 0)
-				{
-    				XmListSelectPos(list_filelist,selection,False);
-				}
-			}
-		}
-	}
-/*--------------------------------------------------------------------*/
-
-void
-do_get_filters()
-{
-
-	/* get some default values from mbedit */
-	status = mbedit_get_filters(&f_beams_max, &f_distance_max,
-			&f_medianspike,
-			&f_medianspike_threshold,
-			&f_medianspike_xtrack,
-			&f_medianspike_ltrack,
-			&f_wrongside,
-			&f_wrongside_threshold,
-			&f_cutbeam,
-			&f_cutbeam_begin, &f_cutbeam_end,
-			&f_cutdistance,
-			&f_cutdistance_begin, &f_cutdistance_end,
-			&f_cutangle,
-			&f_cutangle_begin, &f_cutangle_end);
-
-	/* set values of median spike filter widgets */
- 	XmToggleButtonSetState(toggleButton_filters_medianspike,
- 					f_medianspike, FALSE);
-	XtVaSetValues(scale_filters_medianspike,
-			XmNminimum, 1,
-			XmNmaximum, 100,
-			XmNvalue, f_medianspike_threshold,
-			NULL);
-	XtVaSetValues(scale_median_local_xtrack,
-			XmNminimum, 1,
-			XmNmaximum, f_beams_max,
-			XmNvalue, f_medianspike_xtrack,
-			NULL);
-	XtVaSetValues(scale_median_local_ltrack,
-			XmNminimum, 1,
-			XmNmaximum, f_beams_max,
-			XmNvalue, f_medianspike_ltrack,
-			NULL);
-
-	/* set values of wrong side filter widgets */
- 	XmToggleButtonSetState(toggleButton_filters_wrongside,
- 					f_wrongside, FALSE);
-	XtVaSetValues(scale_filters_wrongside,
-			XmNminimum, 0,
-			XmNmaximum, f_beams_max,
-			XmNvalue, f_wrongside_threshold,
-			NULL);
-
-	/* set values of cut by beam number filter widgets */
- 	XmToggleButtonSetState(toggleButton_filters_cutbeam,
- 					f_cutbeam, FALSE);
-	XtVaSetValues(scale_filters_cutbeamstart,
-			XmNminimum, 0,
-			XmNmaximum, f_beams_max,
-			XmNvalue, f_cutbeam_begin,
-			NULL);
-	XtVaSetValues(scale_filters_cutbeamend,
-			XmNminimum, 0,
-			XmNmaximum, f_beams_max,
-			XmNvalue, f_cutbeam_end,
-			NULL);
-
-	/* set values of cut by distance filter widgets */
- 	XmToggleButtonSetState(toggleButton_filters_cutdistance,
- 					f_cutdistance, FALSE);
-	XtVaSetValues(scale_filters_cutdistancestart,
-			XmNminimum, (int)(-100 * f_distance_max - 0.5),
-			XmNmaximum, (int)(100 * f_distance_max + 0.5),
-			XmNvalue, (int)(100 * f_cutdistance_begin + 0.5),
-			NULL);
-	XtVaSetValues(scale_filters_cutdistanceend,
-			XmNminimum, (int)(-100 * f_distance_max - 0.5),
-			XmNmaximum, (int)(100 * f_distance_max + 0.5),
-			XmNvalue, (int)(100 * f_cutdistance_end + 0.5),
-			NULL);
-
-	/* set values of cut by angle filter widgets */
- 	XmToggleButtonSetState(toggleButton_filters_cutangle,
- 					f_cutangle, FALSE);
-	XtVaSetValues(scale_filters_cutanglestart,
-			XmNminimum, -9000,
-			XmNmaximum, 9000,
-			XmNvalue, (int)(100 * f_cutangle_begin + 0.5),
-			NULL);
-	XtVaSetValues(scale_filters_cutangleend,
-			XmNminimum, -9000,
-			XmNmaximum, 9000,
-			XmNvalue, (int)(100 * f_cutangle_end + 0.5),
-			NULL);
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_file_selection_cancel( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-
-    /* replot the data */
-    status = mbedit_action_plot(mplot_width, mexager,
-	    mx_interval, my_interval,
-	    mplot_size, mshow_beammode, mshow_flagged, mshow_time,
-	    &nbuffer, &ngood, &icurrent, &mnplot);
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_expose( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-
-    /* replot the data */
-    if (expose_plot_ok == True)
-	    status = mbedit_action_plot(mplot_width, mexager,
-		    mx_interval, my_interval,
-		    mplot_size, mshow_beammode, mshow_flagged, mshow_time,
-		    &nbuffer, &ngood, &icurrent, &mnplot);
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_mode_toggle( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-
-    mode_pick = MODE_TOGGLE;
-
-    myCursor = XCreateFontCursor(theDisplay, XC_target);
-    XAllocNamedColor(theDisplay,colormap,"red",&closest[0],&exact[0]);
-    XAllocNamedColor(theDisplay,colormap,"coral",&closest[1],&exact[1]);
-    XRecolorCursor(theDisplay,myCursor,&closest[0],&closest[1]);
-    XDefineCursor(theDisplay,can_xid,myCursor);
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_mode_pick( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-
-    mode_pick = MODE_PICK;
-
-    myCursor = XCreateFontCursor(theDisplay, XC_target);
-    XAllocNamedColor(theDisplay,colormap,"red",&closest[0],&exact[0]);
-    XAllocNamedColor(theDisplay,colormap,"coral",&closest[1],&exact[1]);
-    XRecolorCursor(theDisplay,myCursor,&closest[0],&closest[1]);
-    XDefineCursor(theDisplay,can_xid,myCursor);
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_mode_erase( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-
-    mode_pick = MODE_ERASE;
-
-    myCursor = XCreateFontCursor(theDisplay, XC_exchange);
-    XAllocNamedColor(theDisplay,colormap,"red",&closest[0],&exact[0]);
-    XAllocNamedColor(theDisplay,colormap,"coral",&closest[1],&exact[1]);
-    XRecolorCursor(theDisplay,myCursor,&closest[0],&closest[1]);
-    XDefineCursor(theDisplay,can_xid,myCursor);
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_mode_restore( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-
-    mode_pick = MODE_RESTORE;
-
-    myCursor = XCreateFontCursor(theDisplay, XC_exchange);
-    XAllocNamedColor(theDisplay,colormap,"green",&closest[0],&exact[0]);
-    XAllocNamedColor(theDisplay,colormap,"coral",&closest[1],&exact[1]);
-    XRecolorCursor(theDisplay,myCursor,&closest[0],&closest[1]);
-    XDefineCursor(theDisplay,can_xid,myCursor);
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_mode_grab( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-
-    mode_pick = MODE_GRAB;
-
-    myCursor = XCreateFontCursor(theDisplay, XC_target);
-    XAllocNamedColor(theDisplay,colormap,"red",&closest[0],&exact[0]);
-    XAllocNamedColor(theDisplay,colormap,"coral",&closest[1],&exact[1]);
-    XRecolorCursor(theDisplay,myCursor,&closest[0],&closest[1]);
-    XDefineCursor(theDisplay,can_xid,myCursor);
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_mode_info( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-
-    mode_pick = MODE_INFO;
-
-    myCursor = XCreateFontCursor(theDisplay, XC_target);
-    XAllocNamedColor(theDisplay,colormap,"blue",&closest[0],&exact[0]);
-    XAllocNamedColor(theDisplay,colormap,"coral",&closest[1],&exact[1]);
-    XRecolorCursor(theDisplay,myCursor,&closest[0],&closest[1]);
-    XDefineCursor(theDisplay,can_xid,myCursor);
-}
-/*--------------------------------------------------------------------*/
-
-void
-do_scale_y( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmScaleCallbackStruct *acs=(XmScaleCallbackStruct*)call_data;
-
-    int	maxx;
-    char	label[10];
-
-    mexager = acs->value;
-
-    /* if slider set to minimum value, half the value range;
-	    if slider set to maximum value,  double the range */
-    XtVaGetValues(slider_scale_y,
-		    XmNmaximum, &maxx,
-		    NULL);
-    if (mexager == 1 || mexager == maxx)
-	    {
-	    if (mexager == 1)
-		    maxx = maxx/2;
-	    else
-		    maxx = 2*maxx;
-	    if (maxx < 2)
-		    maxx = 2;
-	    XtVaSetValues(slider_scale_y,
-		    XmNmaximum, maxx,
-		    NULL);
-	    sprintf(label, "%.2f", (double)(maxx/100.));
-	    set_label_string(slider_scale_y_max_label,
-			    label);
-	    }
-
-    /* replot the data */
-    status = mbedit_action_plot(mplot_width, mexager,
-	    mx_interval, my_interval,
-	    mplot_size, mshow_beammode, mshow_flagged, mshow_time,
-	    &nbuffer, &ngood, &icurrent, &mnplot);
-    if (status == 0) XBell(theDisplay,100);
-
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_fileselection_list( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-
-    static char selection_text[MB_PATH_MAXLINE];
-    int	form;
-    char	value_text[10];
-
-    /* get selected text */
-    get_text_string(fileSelectionText, selection_text);
-
-    /* get output file */
-    if((int)strlen(selection_text) > 0)
-	    {
-	    /* look for MB suffix convention */
-	    form = mformat;
-	    if ((status = mbedit_get_format(selection_text,
-			    &form)) == MB_SUCCESS)
-		{
-		mformat = form;
-		sprintf(value_text,"%d",mformat);
-		XmTextFieldSetString(
-		    textfield_format,
-		    value_text);
-		}
-	    }
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_scale_x( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmScaleCallbackStruct *acs=(XmScaleCallbackStruct*)call_data;
-
-    int	maxx;
-    char	label[10];
-
-    mplot_width = acs->value;
-
-    /* if slider set to minimum value, half the value range;
-	    if slider set to maximum value,  double the range */
-    XtVaGetValues(slider_scale_x,
-		    XmNmaximum, &maxx,
-		    NULL);
-    if (mplot_width == 1 || mplot_width == maxx)
-	    {
-	    if (mplot_width == 1)
-		    maxx = maxx/2;
-	    else
-		    maxx = 2*maxx;
-	    if (maxx < 2)
-		    maxx = 2;
-	    XtVaSetValues(slider_scale_x,
-		    XmNmaximum, maxx,
-		    NULL);
-	    sprintf(label, "%d", maxx);
-	    set_label_string(slider_scale_x_max_label,
-			    label);
-	    }
-
-    /* replot the data */
-    status = mbedit_action_plot(mplot_width, mexager,
-	    mx_interval, my_interval,
-	    mplot_size, mshow_beammode, mshow_flagged, mshow_time,
-	    &nbuffer, &ngood, &icurrent, &mnplot);
-    if (status == 0) XBell(theDisplay,100);
-
-}
-
-/*--------------------------------------------------------------------*/
-
-int do_reset_scale_x(int pwidth, int maxx, int xntrvl, int yntrvl)
-{
-	char	label[10];
-
-	mplot_width = pwidth;
-
-	/* check max value */
-	if (pwidth > maxx - 1)
-		{
-		maxx = 2 * pwidth;
-		if (maxx < 2)
-			maxx = 2;
-		}
-	mx_interval = xntrvl;
-	my_interval = yntrvl;
-
-	/* set values of plot width slider */
-	XtVaSetValues(slider_scale_x,
-			XmNvalue, mplot_width,
-			XmNmaximum, maxx,
-			NULL);
-	sprintf(label, "%d", maxx);
-	set_label_string(slider_scale_x_max_label,
-			label);
-
-	/* set values of x interval slider */
-	XtVaSetValues(slider_x_interval,
-			XmNvalue, mx_interval,
-			NULL);
-
-	/* set values of y interval slider */
-	XtVaSetValues(slider_y_interval,
-			XmNvalue, my_interval,
-			NULL);
-
-	return(1);
-
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_output_edit( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmToggleButtonCallbackStruct *acs=(XmToggleButtonCallbackStruct*)call_data;
-
-    /* set values if needed */
-    if (acs->reason == XmCR_VALUE_CHANGED && acs->set)
-	    {
-	    mode_output = OUTPUT_MODE_EDIT;
-	    XmToggleButtonSetState(setting_output_toggle_edit_filelist,
-			TRUE, TRUE);
-	    }
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_output_browse( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmToggleButtonCallbackStruct *acs=(XmToggleButtonCallbackStruct*)call_data;
-
-    /* set values if needed */
-    if (acs->reason == XmCR_VALUE_CHANGED && acs->set)
-	    {
-	    mode_output = OUTPUT_MODE_BROWSE;
-	    XmToggleButtonSetState(setting_output_toggle_browse_filelist,
-			TRUE, TRUE);
-	    }
-}
-
-/*--------------------------------------------------------------------*/
-
-
-void
-do_output_edit_filelist( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmToggleButtonCallbackStruct *acs=(XmToggleButtonCallbackStruct*)call_data;
-
-    /* set values if needed */
-    if (acs->reason == XmCR_VALUE_CHANGED && acs->set)
-	    {
-	    mode_output = OUTPUT_MODE_EDIT;
-	    XmToggleButtonSetState(setting_output_toggle_edit,
-			TRUE, TRUE);
-	    }
-}
-
-/*--------------------------------------------------------------------*/
-
-
-void
-do_output_browse_filelist( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmToggleButtonCallbackStruct *acs=(XmToggleButtonCallbackStruct*)call_data;
-
-    /* set values if needed */
-    if (acs->reason == XmCR_VALUE_CHANGED && acs->set)
-	    {
-	    mode_output = OUTPUT_MODE_BROWSE;
-	    XmToggleButtonSetState(setting_output_toggle_browse,
-			TRUE, TRUE);
-	    }
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_x_interval( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmScaleCallbackStruct *acs=(XmScaleCallbackStruct*)call_data;
-
-    int	maxx;
-    char	label[10];
-
-    mx_interval = acs->value;
-
-    /* if slider set to minimum value, half the value range;
-	    if slider set to maximum value,  double the range */
-    XtVaGetValues(slider_x_interval,
-		    XmNmaximum, &maxx,
-		    NULL);
-    if (mx_interval == 1 || mx_interval == maxx)
-	    {
-	    if (mx_interval == 1)
-		    maxx = maxx/2;
-	    else
-		    maxx = 2*maxx;
-	    if (maxx < 2)
-		    maxx = 2;
-	    XtVaSetValues(slider_x_interval,
-		    XmNmaximum, maxx,
-		    NULL);
-	    sprintf(label, "%d", maxx);
-	    set_label_string(slider_x_max_interval_label,
-			    label);
-	    }
-
-    /* replot the data */
-    status = mbedit_action_plot(mplot_width, mexager,
-	    mx_interval, my_interval,
-	    mplot_size, mshow_beammode, mshow_flagged, mshow_time,
-	    &nbuffer, &ngood, &icurrent, &mnplot);
-    if (status == 0) XBell(theDisplay,100);
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_y_interval( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmScaleCallbackStruct *acs=(XmScaleCallbackStruct*)call_data;
-
-    int	maxx;
-    char	label[10];
-
-    my_interval = acs->value;
-
-    /* if slider set to minimum value, half the value range;
-	    if slider set to maximum value,  double the range */
-    XtVaGetValues(slider_y_interval,
-		    XmNmaximum, &maxx,
-		    NULL);
-    if (my_interval == 1 || my_interval == maxx)
-	    {
-	    if (my_interval == 1)
-		    maxx = maxx/2;
-	    else
-		    maxx = 2*maxx;
-	    if (maxx < 2)
-		    maxx = 2;
-	    XtVaSetValues(slider_y_interval,
-		    XmNmaximum, maxx,
-		    NULL);
-	    sprintf(label, "%d", maxx);
-	    set_label_string(slider_y_max_interval_label,
-			    label);
-	    }
-
-    /* replot the data */
-    status = mbedit_action_plot(mplot_width, mexager,
-	    mx_interval, my_interval,
-	    mplot_size, mshow_beammode, mshow_flagged, mshow_time,
-	    &nbuffer, &ngood, &icurrent, &mnplot);
-    if (status == 0) XBell(theDisplay,100);
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_load(int save_mode)
-{
-
-    /* turn off expose plots */
-    expose_plot_ok = False;
-
-    /* only load valid file */
-    if (currentfile >= 0)
-    	{
-	/* process input file name */
-	status = mbedit_action_open(filepaths[currentfile],
-    			fileformats[currentfile],
-			currentfile,
-			numfiles,
-			save_mode,
-			mode_output,
-			mplot_width, mexager, mx_interval,
-			my_interval, mplot_size, mshow_beammode, mshow_flagged, mshow_time,
-			&buffer_size, &buffer_size_max,
-			&hold_size,
-			&ndumped, &nloaded, &nbuffer,
-			&ngood, &icurrent, &mnplot);
-	if (status == MB_FAILURE)
-		{
-		XBell(theDisplay,100);
-		currentfile = -1;
-		}
-	}
-
-    /* display data from chosen file */
-    if (status == MB_SUCCESS)
-    	{
-	status = mbedit_action_plot(mplot_width, mexager,
-		mx_interval, my_interval,
-		mplot_size, mshow_beammode, mshow_flagged, mshow_time,
-		&nbuffer, &ngood, &icurrent, &mnplot);
-	if (status == 0) XBell(theDisplay,100);
-	}
-
-    /* set widget values */
-    do_setup_data();
-
-    /* turn on expose plots */
-    expose_plot_ok = True;
-
-}
-/*--------------------------------------------------------------------*/
-
-void
-do_load_ok( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    /* load the current file without using edit save file */
-    do_load(MB_NO);
-}
-/*--------------------------------------------------------------------*/
-
-void
-do_load_ok_with_save( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    /* load the current file using edit save file */
-    do_load(MB_YES);
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_load_check( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmFileSelectionBoxCallbackStruct *acs=(XmFileSelectionBoxCallbackStruct*)call_data;
-
-    char    *input_file_ptr;
-    static  char format_text[40];
-    int		format;
-    int		numfilessave;
-    int		quit;
-
-    /* read the input file name */
-    if(!XmStringGetLtoR(acs->value,
-	XmSTRING_DEFAULT_CHARSET,
-	&input_file_ptr))
-	{
-	fprintf(stderr,"\nno input multibeam file selected\n");
-	}
-    else
-	{
-	/* turn off expose plots */
-	expose_plot_ok = False;
-
-	/* close out previously open file */
-	status = mbedit_action_done(buffer_size,&ndumped,&nloaded,
-		    &nbuffer,&ngood,&icurrent,&quit);
-	if (status == 0) XBell(theDisplay,100);
-	currentfile = -1;
-
-	/* read the input file name */
-	numfilessave = numfiles;
-	strncpy(input_file, input_file_ptr, MB_PATH_MAXLINE);
-	XtFree(input_file_ptr);
-
-	/* read the mbio format number from the dialog */
-	get_text_string(textfield_format, format_text);
-	sscanf(format_text, "%d", &format);
-
-	/* try to parse the selection */
-	do_parse_datalist(input_file, format);
-
-	/* load first new file in the list */
-	if (numfiles > 0 && numfilessave < numfiles)
-	    {
-	    currentfile = numfilessave;
-	    do_load_specific_file(numfilessave);
-	    }
-
-	/* turn on expose plots */
-	expose_plot_ok = True;
-	}
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_checkuseprevious( )
-{
-    XtManageChild(bulletinBoard_editsave);
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_filebutton_on()
-{
-	Boolean  argok = False;
-        XmString    tmp0;
-
-	XtVaSetValues(pushButton_file,
-		XmNsensitive, True,
-		NULL);
-
-	XtVaSetValues(pushButton_done,
-		XmNsensitive, False,
-		NULL);
-        tmp0 = (XmString) BX_CONVERT(pushButton_done, (char *)"Done",
-                			XmRXmString, 0, &argok);
-	XtVaSetValues(pushButton_done,
-		XmNlabelString, tmp0,
-		NULL);
-        XmStringFree((XmString)tmp0);
-
-	XtVaSetValues(pushButton_forward,
-		XmNsensitive, False,
-		NULL);
-	XtVaSetValues(pushButton_reverse,
-		XmNsensitive, False,
-		NULL);
-	XtVaSetValues(pushButton_start,
-		XmNsensitive, False,
-		NULL);
-	XtVaSetValues(pushButton_end,
-		XmNsensitive, False,
-		NULL);
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_filebutton_off()
-{
-	Boolean  argok = False;
-        XmString    tmp0;
-
-	XtVaSetValues(pushButton_file,
-		XmNsensitive, True,
-		NULL);
-	XtVaSetValues(pushButton_done,
-		XmNsensitive, True,
-		NULL);
-	if (numfiles > 0 && currentfile >= 0 && currentfile < numfiles - 1)
-		{
-        	tmp0 = (XmString) BX_CONVERT(pushButton_done, (char *)"Next File",
-                				XmRXmString, 0, &argok);
-		XtVaSetValues(pushButton_done,
-			XmNlabelString, tmp0,
-			NULL);
-        	XmStringFree((XmString)tmp0);
-		}
-	else
-		{
-        	tmp0 = (XmString) BX_CONVERT(pushButton_done, (char *)"Done",
-                				XmRXmString, 0, &argok);
-		XtVaSetValues(pushButton_done,
-			XmNlabelString, tmp0,
-			NULL);
-        	XmStringFree((XmString)tmp0);
-		}
-	XtVaSetValues(pushButton_forward,
-		XmNsensitive, True,
-		NULL);
-	XtVaSetValues(pushButton_reverse,
-		XmNsensitive, True,
-		NULL);
-	XtVaSetValues(pushButton_start,
-		XmNsensitive, True,
-		NULL);
-	XtVaSetValues(pushButton_end,
-		XmNsensitive, True,
-		NULL);
-}
-/*--------------------------------------------------------------------*/
-
-void
-do_nextbutton_on()
-{
-		XtVaSetValues(pushButton_next,
-			XmNsensitive, True,
-			NULL);
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_nextbutton_off()
-{
-		XtVaSetValues(pushButton_next,
-			XmNsensitive, False,
-			NULL);
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_end( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-fprintf(stderr,"do_end\n");
-
-    status = mbedit_action_step(nbuffer-icurrent-1,mplot_width,mexager,
-			    mx_interval,my_interval,
-			    mplot_size,mshow_beammode,mshow_flagged,mshow_time,
-			    &nbuffer,&ngood,&icurrent,&mnplot);
-    if (status == 0) XBell(theDisplay,100);
-
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_forward( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-
-    if (key_g_down == 0)
-	{
-	status = mbedit_action_step(step,mplot_width,mexager,
-			    mx_interval,my_interval,
-			    mplot_size,mshow_beammode,mshow_flagged,mshow_time,
-			    &nbuffer,&ngood,&icurrent,&mnplot);
-	if (status == 0) XBell(theDisplay,100);
-	}
-    else
-	{
-	status = mbedit_action_step(nbuffer-icurrent-1,mplot_width,mexager,
-			    mx_interval,my_interval,
-			    mplot_size,mshow_beammode,mshow_flagged,mshow_time,
-			    &nbuffer,&ngood,&icurrent,&mnplot);
-	if (status == 0) XBell(theDisplay,100);
-	}
-
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_reverse( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-
-    if (key_g_down == 0)
-	{
-	status = mbedit_action_step(-step,mplot_width,mexager,
-			    mx_interval,my_interval,
-			    mplot_size,mshow_beammode,mshow_flagged,mshow_time,
-			    &nbuffer,&ngood,&icurrent,&mnplot);
-	if (status == 0) XBell(theDisplay,100);
-	}
-    else
-	{
-	status = mbedit_action_step(-icurrent,mplot_width,mexager,
-			    mx_interval,my_interval,
-			    mplot_size,mshow_beammode,mshow_flagged,mshow_time,
-			    &nbuffer,&ngood,&icurrent,&mnplot);
-	if (status == 0) XBell(theDisplay,100);
-	}
-
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_start( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-fprintf(stderr,"do_start\n");
-
-    status = mbedit_action_step(-icurrent,mplot_width,mexager,
-			    mx_interval,my_interval,
-			    mplot_size,mshow_beammode,mshow_flagged,mshow_time,
-			    &nbuffer,&ngood,&icurrent,&mnplot);
-    if (status == 0) XBell(theDisplay,100);
-
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_quit( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-
-    status = mbedit_action_quit(buffer_size,&ndumped,&nloaded,
-		    &nbuffer,&ngood,&icurrent);
-    if (status == 0) XBell(theDisplay,100);
-
-    exit(0);
-
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_event( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmDrawingAreaCallbackStruct *acs=(XmDrawingAreaCallbackStruct*)call_data;
-    static Position x_loc, y_loc;
-
-    XEvent  *event = acs->event;
-
-    KeySym keysym;
-    char buffer[1];
-    int actual;
-    int root_x_return, root_y_return,win_x,win_y;
-    unsigned int mask_return;
-    int doit;
-    int	grab_mode;
-    time_t start_time_t;
-
-    /* check for data file loaded at startup */
-    if (startup_file)
-	    {
-	    startup_file = 0;
-	    status = mbedit_action_plot(mplot_width, mexager,
-		    mx_interval, my_interval,
-		    mplot_size, mshow_beammode, mshow_flagged, mshow_time,
-		    &nbuffer, &ngood, &icurrent, &mnplot);
-	    if (status == 0) XBell(theDisplay,100);
-	    } /* end startup file */
-
-    /* If there is input in the drawing area */
-    if (acs->reason == XmCR_INPUT)
-    {
-      /* deal with expose events by replotting the mbedit view */
-      if (event->xany.type == Expose || event->xany.type == GraphicsExpose)
-		status = mbedit_action_plot(mplot_width, mexager,
-				    mx_interval, my_interval,
-				    mplot_size, mshow_beammode, mshow_flagged, mshow_time,
-				    &nbuffer, &ngood, &icurrent, &mnplot);
-
-      /* Deal with KeyPress events */
-      if(event->xany.type == KeyPress)
-      {
-      /* Get key pressed - buffer[0] */
-      actual = XLookupString((XKeyEvent *)event,
-		    buffer, 1, &keysym, NULL);
-
-      /* process events */
-      switch (buffer[0])
-	    {
-	    case 'F':
-	    case 'f':
-                    if (key_g_down == 0)
-                        {
-                        status = mbedit_action_step(step,mplot_width,mexager,
-                                        mx_interval,my_interval,
-                                        mplot_size,mshow_beammode,mshow_flagged,mshow_time,
-                                        &nbuffer,&ngood,&icurrent,&mnplot);
-                        if (status == 0) XBell(theDisplay,100);
-                        }
-                    else
-                        {
-                        status = mbedit_action_step(nbuffer-icurrent-1,mplot_width,mexager,
-                                        mx_interval,my_interval,
-                                        mplot_size,mshow_beammode,mshow_flagged,mshow_time,
-                                        &nbuffer,&ngood,&icurrent,&mnplot);
-                        if (status == 0) XBell(theDisplay,100);
-                        }
-                    break;
-	    case 'V':
-	    case 'v':
-                    if (key_g_down == 0)
-                       {
-                           status = mbedit_action_step(-step,mplot_width,mexager,
-                                           mx_interval,my_interval,
-                                           mplot_size,mshow_beammode,mshow_flagged,mshow_time,
-                                           &nbuffer,&ngood,&icurrent,&mnplot);
-                           if (status == 0) XBell(theDisplay,100);
-                       }
-                    else
-                       {
-                           status = mbedit_action_step(-icurrent,mplot_width,mexager,
-                                           mx_interval,my_interval,
-                                           mplot_size,mshow_beammode,mshow_flagged,mshow_time,
-                                           &nbuffer,&ngood,&icurrent,&mnplot);
-                           if (status == 0) XBell(theDisplay,100);
-                       }
- 		    break;
-	    case 'G':
-	    case 'g':
-		    key_g_down = 1;
-		    break;
-	    case 'M':
-	    case 'm':
-	    case 'Z':
-	    case 'z':
-		    status = mbedit_action_bad_ping(
-			    mplot_width,mexager,
-			    mx_interval,my_interval,
-			    mplot_size,mshow_beammode, mshow_flagged,mshow_time,
-			    &nbuffer,&ngood,&icurrent,&mnplot);
-		    key_z_down = 1;
-		    key_s_down = 0;
-		    key_a_down = 0;
-		    key_d_down = 0;
-		    break;
-	    case 'K':
-	    case 'k':
-	    case 'S':
-	    case 's':
-		    status = mbedit_action_good_ping(
-			    mplot_width,mexager,
-			    mx_interval,my_interval,
-			    mplot_size,mshow_beammode, mshow_flagged,mshow_time,
-			    &nbuffer,&ngood,&icurrent,&mnplot);
-		    key_z_down = 0;
-		    key_s_down = 1;
-		    key_a_down = 0;
-		    key_d_down = 0;
-		    break;
-	    case 'J':
-	    case 'j':
-	    case 'A':
-	    case 'a':
-		    if (mode_reverse_keys == MB_NO)
-			status = mbedit_action_left_ping(
-			    mplot_width,mexager,
-			    mx_interval,my_interval,
-			    mplot_size,mshow_beammode, mshow_flagged,mshow_time,
-			    &nbuffer,&ngood,&icurrent,&mnplot);
-		    else
-			status = mbedit_action_right_ping(
-			    mplot_width,mexager,
-			    mx_interval,my_interval,
-			    mplot_size,mshow_beammode, mshow_flagged,mshow_time,
-			    &nbuffer,&ngood,&icurrent,&mnplot);
-		    key_z_down = 0;
-		    key_s_down = 0;
-		    key_a_down = 1;
-		    key_d_down = 0;
-		    break;
-	    case 'L':
-	    case 'l':
-	    case 'D':
-	    case 'd':
-		    if (mode_reverse_keys == MB_NO)
-			status = mbedit_action_right_ping(
-			    mplot_width,mexager,
-			    mx_interval,my_interval,
-			    mplot_size,mshow_beammode, mshow_flagged,mshow_time,
-			    &nbuffer,&ngood,&icurrent,&mnplot);
-		    else
-			status = mbedit_action_left_ping(
-			    mplot_width,mexager,
-			    mx_interval,my_interval,
-			    mplot_size,mshow_beammode, mshow_flagged,mshow_time,
-			    &nbuffer,&ngood,&icurrent,&mnplot);
-		    key_z_down = 0;
-		    key_s_down = 0;
-		    key_a_down = 0;
-		    key_d_down = 1;
-		    break;
-	    case '<':
-	    case ',':
-	    case 'X':
-	    case 'x':
-		    status = mbedit_action_flag_view(
-			    mplot_width,mexager,
-			    mx_interval,my_interval,
-			    mplot_size,mshow_beammode, mshow_flagged,mshow_time,
-			    &nbuffer,&ngood,&icurrent,&mnplot);
-		    break;
-	    case '>':
-	    case '.':
-	    case 'C':
-	    case 'c':
-		    status = mbedit_action_unflag_view(
-			    mplot_width,mexager,
-			    mx_interval,my_interval,
-			    mplot_size,mshow_beammode, mshow_flagged,mshow_time,
-			    &nbuffer,&ngood,&icurrent,&mnplot);
-		    break;
-	    case '!':
-		    status = mbedit_action_zero_ping(
-			    mplot_width,mexager,
-			    mx_interval,my_interval,
-			    mplot_size,mshow_beammode, mshow_flagged,mshow_time,
-			    &nbuffer,&ngood,&icurrent,&mnplot);
-		    break;
-	    case 'U':
-	    case 'u':
-	    case 'Q':
-	    case 'q':
-			    {
-			    mode_pick = MODE_TOGGLE;
-			    XmToggleButtonSetState(setting_mode_toggle_toggle, 1, FALSE);
-			    XmToggleButtonSetState(setting_mode_toggle_pick, 0, FALSE);
-			    XmToggleButtonSetState(setting_mode_toggle_erase, 0, FALSE);
-			    XmToggleButtonSetState(setting_mode_toggle_restore, 0, FALSE);
-			    XmToggleButtonSetState(setting_mode_toggle_grab, 0, FALSE);
-			    XmToggleButtonSetState(setting_mode_toggle_info, 0, FALSE);
-
-			    myCursor = XCreateFontCursor(theDisplay, XC_target);
-			    XAllocNamedColor(theDisplay,colormap,"red",&closest[0],&exact[0]);
-			    XAllocNamedColor(theDisplay,colormap,"coral",&closest[1],&exact[1]);
-			    XRecolorCursor(theDisplay,myCursor,&closest[0],&closest[1]);
-			    XDefineCursor(theDisplay,can_xid,myCursor);
-			    }
-		    break;
-	    case 'I':
-	    case 'i':
-	    case 'W':
-	    case 'w':
-			    {
-			    mode_pick = MODE_PICK;
-			    XmToggleButtonSetState(setting_mode_toggle_toggle, 0, FALSE);
-			    XmToggleButtonSetState(setting_mode_toggle_pick, 1, FALSE);
-			    XmToggleButtonSetState(setting_mode_toggle_erase, 0, FALSE);
-			    XmToggleButtonSetState(setting_mode_toggle_restore, 0, FALSE);
-			    XmToggleButtonSetState(setting_mode_toggle_grab, 0, FALSE);
-			    XmToggleButtonSetState(setting_mode_toggle_info, 0, FALSE);
-
-			    myCursor = XCreateFontCursor(theDisplay, XC_target);
-			    XAllocNamedColor(theDisplay,colormap,"red",&closest[0],&exact[0]);
-			    XAllocNamedColor(theDisplay,colormap,"coral",&closest[1],&exact[1]);
-			    XRecolorCursor(theDisplay,myCursor,&closest[0],&closest[1]);
-			    XDefineCursor(theDisplay,can_xid,myCursor);
-			    }
-		    break;
-	    case 'O':
-	    case 'o':
-	    case 'E':
-	    case 'e':
-			    {
-			    mode_pick = MODE_ERASE;
-			    XmToggleButtonSetState(setting_mode_toggle_toggle, 0, FALSE);
-			    XmToggleButtonSetState(setting_mode_toggle_pick, 0, FALSE);
-			    XmToggleButtonSetState(setting_mode_toggle_erase, 1, FALSE);
-			    XmToggleButtonSetState(setting_mode_toggle_restore, 0, FALSE);
-			    XmToggleButtonSetState(setting_mode_toggle_grab, 0, FALSE);
-			    XmToggleButtonSetState(setting_mode_toggle_info, 0, FALSE);
-
-			    myCursor = XCreateFontCursor(theDisplay, XC_exchange);
-			    XAllocNamedColor(theDisplay,colormap,"red",&closest[0],&exact[0]);
-			    XAllocNamedColor(theDisplay,colormap,"coral",&closest[1],&exact[1]);
-			    XRecolorCursor(theDisplay,myCursor,&closest[0],&closest[1]);
-			    XDefineCursor(theDisplay,can_xid,myCursor);
-			    }
-		    break;
-	    case 'P':
-	    case 'p':
-	    case 'R':
-	    case 'r':
-			    {
-			    mode_pick = MODE_RESTORE;
-			    XmToggleButtonSetState(setting_mode_toggle_toggle, 0, FALSE);
-			    XmToggleButtonSetState(setting_mode_toggle_pick, 0, FALSE);
-			    XmToggleButtonSetState(setting_mode_toggle_erase, 0, FALSE);
-			    XmToggleButtonSetState(setting_mode_toggle_restore, 1, FALSE);
-			    XmToggleButtonSetState(setting_mode_toggle_grab, 0, FALSE);
-			    XmToggleButtonSetState(setting_mode_toggle_info, 0, FALSE);
-
-			    myCursor = XCreateFontCursor(theDisplay, XC_exchange);
-			    XAllocNamedColor(theDisplay,colormap,"green",&closest[0],&exact[0]);
-			    XAllocNamedColor(theDisplay,colormap,"coral",&closest[1],&exact[1]);
-			    XRecolorCursor(theDisplay,myCursor,&closest[0],&closest[1]);
-			    XDefineCursor(theDisplay,can_xid,myCursor);
-			    }
-		    break;
-	    case '{':
-	    case '[':
-	    case 'T':
-	    case 't':
-			    {
-			    mode_pick = MODE_GRAB;
-			    XmToggleButtonSetState(setting_mode_toggle_toggle, 0, FALSE);
-			    XmToggleButtonSetState(setting_mode_toggle_pick, 0, FALSE);
-			    XmToggleButtonSetState(setting_mode_toggle_erase, 0, FALSE);
-			    XmToggleButtonSetState(setting_mode_toggle_restore, 0, FALSE);
-			    XmToggleButtonSetState(setting_mode_toggle_grab, 1, FALSE);
-			    XmToggleButtonSetState(setting_mode_toggle_info, 0, FALSE);
-
-			    myCursor = XCreateFontCursor(theDisplay, XC_target);
-			    XAllocNamedColor(theDisplay,colormap,"blue",&closest[0],&exact[0]);
-			    XAllocNamedColor(theDisplay,colormap,"coral",&closest[1],&exact[1]);
-			    XRecolorCursor(theDisplay,myCursor,&closest[0],&closest[1]);
-			    XDefineCursor(theDisplay,can_xid,myCursor);
-			    }
-		    break;
-	    case '}':
-	    case ']':
-	    case 'Y':
-	    case 'y':
-			    {
-			    mode_pick = MODE_INFO;
-			    XmToggleButtonSetState(setting_mode_toggle_toggle, 0, FALSE);
-			    XmToggleButtonSetState(setting_mode_toggle_pick, 0, FALSE);
-			    XmToggleButtonSetState(setting_mode_toggle_erase, 0, FALSE);
-			    XmToggleButtonSetState(setting_mode_toggle_restore, 0, FALSE);
-			    XmToggleButtonSetState(setting_mode_toggle_grab, 0, FALSE);
-			    XmToggleButtonSetState(setting_mode_toggle_info, 1, FALSE);
-
-			    myCursor = XCreateFontCursor(theDisplay, XC_target);
-			    XAllocNamedColor(theDisplay,colormap,"blue",&closest[0],&exact[0]);
-			    XAllocNamedColor(theDisplay,colormap,"coral",&closest[1],&exact[1]);
-			    XRecolorCursor(theDisplay,myCursor,&closest[0],&closest[1]);
-			    XDefineCursor(theDisplay,can_xid,myCursor);
-			    }
-		    break;
-	    case '2':
-	    case '@':
-			    {
-			    /* set the view mode */
-			    mview_mode = VIEW_WATERFALL;
-			    mbedit_set_viewmode(mview_mode);
-			    XmToggleButtonSetState(toggleButton_view_waterfall, MB_YES, FALSE);
-			    XmToggleButtonSetState(toggleButton_view_alongtrack, MB_NO, FALSE);
-			    XmToggleButtonSetState(toggleButton_view_acrosstrack, MB_NO, FALSE);
-
-			    /* replot the data */
-			    status = mbedit_action_plot(mplot_width, mexager,
-				    mx_interval, my_interval,
-				    mplot_size, mshow_beammode, mshow_flagged, mshow_time,
-				    &nbuffer, &ngood, &icurrent, &mnplot);
-			    }
-		    break;
-	    case '3':
-	    case '#':
-			    {
-			    /* set the view mode */
-			    mview_mode = VIEW_ALONGTRACK;
-			    mbedit_set_viewmode(mview_mode);
-			    XmToggleButtonSetState(toggleButton_view_waterfall, MB_NO, FALSE);
-			    XmToggleButtonSetState(toggleButton_view_alongtrack, MB_YES, FALSE);
-			    XmToggleButtonSetState(toggleButton_view_acrosstrack, MB_NO, FALSE);
-
-			    /* replot the data */
-			    status = mbedit_action_plot(mplot_width, mexager,
-				    mx_interval, my_interval,
-				    mplot_size, mshow_beammode, mshow_flagged, mshow_time,
-				    &nbuffer, &ngood, &icurrent, &mnplot);
-			    }
-		    break;
-	    case '4':
-	    case '$':
-			    {
-			    /* set the view mode */
-			    mview_mode = VIEW_ACROSSTRACK;
-			    mbedit_set_viewmode(mview_mode);
-			    XmToggleButtonSetState(toggleButton_view_waterfall, MB_NO, FALSE);
-			    XmToggleButtonSetState(toggleButton_view_alongtrack, MB_NO, FALSE);
-			    XmToggleButtonSetState(toggleButton_view_acrosstrack, MB_YES, FALSE);
-
-			    /* replot the data */
-			    status = mbedit_action_plot(mplot_width, mexager,
-				    mx_interval, my_interval,
-				    mplot_size, mshow_beammode, mshow_flagged, mshow_time,
-				    &nbuffer, &ngood, &icurrent, &mnplot);
-			    }
-		    break;
-	    default:
-		    break;
-	    } /* end of key switch */
-       } /* end of key press events */
-
-      /* Deal with KeyRelease events */
-      if(event->xany.type == KeyRelease)
-      {
-      /* Get key pressed - buffer[0] */
-      actual = XLookupString((XKeyEvent *)event,
-		    buffer, 1, &keysym, NULL);
-
-      /* process events */
-      switch (buffer[0])
-	    {
-	    case 'G':
-	    case 'g':
-		    key_g_down = 0;
-		    break;
-	    case 'M':
-	    case 'm':
-	    case 'Z':
-	    case 'z':
-		    key_z_down = 0;
-		    break;
-	    case 'K':
-	    case 'k':
-	    case 'S':
-	    case 's':
-		    key_s_down = 0;
-		    break;
-	    case 'J':
-	    case 'j':
-	    case 'A':
-	    case 'a':
-		    key_a_down = 0;
-		    break;
-	    case 'L':
-	    case 'l':
-	    case 'D':
-	    case 'd':
-		    key_d_down = 0;
-		    break;
-	    default:
-		    break;
-	    } /* end of key switch */
-       } /* end of key release events */
-
-      /* Check for mouse pressed and not pressed and released. */
-      if(event->xany.type == ButtonPress)
-      {
-	  /* If left mouse button is pushed then toggle, pick, erase, restore, grab, or info. */
-	  if ((event->xbutton.button == 1 && mode_reverse_mouse == MB_NO)
-		|| (event->xbutton.button == 3 && mode_reverse_mouse == MB_YES))
-	    {
-	    x_loc = event->xbutton.x;
-	    y_loc = event->xbutton.y;
-	    grab_mode = GRAB_START;
-
-	    doit = 1;
-	    while (doit)
-		{
-
-		if (mode_pick == MODE_TOGGLE)
-		    status = mbedit_action_mouse_toggle(
-			    x_loc, y_loc,
-			    mplot_width,mexager,
-			    mx_interval,my_interval,
-			    mplot_size,mshow_beammode, mshow_flagged,mshow_time,
-			    &nbuffer,&ngood,&icurrent,&mnplot);
-		else if (mode_pick == MODE_PICK)
-		    status = mbedit_action_mouse_pick(
-			    x_loc, y_loc,
-			    mplot_width,mexager,
-			    mx_interval,my_interval,
-			    mplot_size,mshow_beammode, mshow_flagged,mshow_time,
-			    &nbuffer,&ngood,&icurrent,&mnplot);
-		else if (mode_pick == MODE_ERASE)
-		    status = mbedit_action_mouse_erase(
-			    x_loc, y_loc,
-			    mplot_width,mexager,
-			    mx_interval,my_interval,
-			    mplot_size,mshow_beammode, mshow_flagged,mshow_time,
-			    &nbuffer,&ngood,&icurrent,&mnplot);
-		else if (mode_pick == MODE_RESTORE)
-		    status = mbedit_action_mouse_restore(
-			    x_loc, y_loc,
-			    mplot_width,mexager,
-			    mx_interval,my_interval,
-			    mplot_size,mshow_beammode, mshow_flagged,mshow_time,
-			    &nbuffer,&ngood,&icurrent,&mnplot);
-		else if (mode_pick == MODE_GRAB)
-		    {
-		    status = mbedit_action_mouse_grab(
-		    	    grab_mode,
-			    x_loc, y_loc,
-			    mplot_width,mexager,
-			    mx_interval,my_interval,
-			    mplot_size,mshow_beammode, mshow_flagged,mshow_time,
-			    &nbuffer,&ngood,&icurrent,&mnplot);
-		    if (status == MB_SUCCESS)
-		    	grab_mode = GRAB_MOVE;
-		    else
-		    	grab_mode = GRAB_START;
-		    }
-		else if (mode_pick == MODE_INFO)
-		    status = mbedit_action_mouse_info(
-			    x_loc, y_loc,
-			    mplot_width,mexager,
-			    mx_interval,my_interval,
-			    mplot_size,mshow_beammode, mshow_flagged,mshow_time,
-			    &nbuffer,&ngood,&icurrent,&mnplot);
-		if (status == 0)
-			XBell(theDisplay,100);
-		else if (key_z_down)
-		    {
-		    status = mbedit_action_bad_ping(
-			    mplot_width,mexager,
-			    mx_interval,my_interval,
-			    mplot_size,mshow_beammode, mshow_flagged,mshow_time,
-			    &nbuffer,&ngood,&icurrent,&mnplot);
-		    }
-		else if (key_s_down)
-		    {
-		    status = mbedit_action_good_ping(
-			    mplot_width,mexager,
-			    mx_interval,my_interval,
-			    mplot_size,mshow_beammode, mshow_flagged,mshow_time,
-			    &nbuffer,&ngood,&icurrent,&mnplot);
-		    }
-		else if (key_a_down)
-		    {
-		    if (mode_reverse_keys == MB_NO)
-			status = mbedit_action_left_ping(
-			    mplot_width,mexager,
-			    mx_interval,my_interval,
-			    mplot_size,mshow_beammode, mshow_flagged,mshow_time,
-			    &nbuffer,&ngood,&icurrent,&mnplot);
-		    else
-			status = mbedit_action_right_ping(
-			    mplot_width,mexager,
-			    mx_interval,my_interval,
-			    mplot_size,mshow_beammode, mshow_flagged,mshow_time,
-			    &nbuffer,&ngood,&icurrent,&mnplot);
-		    }
-		else if (key_d_down)
-		    {
-		    if (mode_reverse_keys == MB_NO)
-			status = mbedit_action_right_ping(
-			    mplot_width,mexager,
-			    mx_interval,my_interval,
-			    mplot_size,mshow_beammode, mshow_flagged,mshow_time,
-			    &nbuffer,&ngood,&icurrent,&mnplot);
-		    else
-			status = mbedit_action_left_ping(
-			    mplot_width,mexager,
-			    mx_interval,my_interval,
-			    mplot_size,mshow_beammode, mshow_flagged,mshow_time,
-			    &nbuffer,&ngood,&icurrent,&mnplot);
-		    }
-
-		    status = XQueryPointer(theDisplay,can_xid,
-			    &root_return,&child_return,&root_x_return,
-			    &root_y_return, &win_x, &win_y, &mask_return);
-
-		    x_loc = win_x;
-		    y_loc = win_y;
-
-		    /* If the button is still pressed then read the location */
-		    /* of the pointer and run the action mouse function again */
-		    if (mode_reverse_mouse == MB_NO)
-			{
-			if ((mask_return & 256) == 256
-			    && mode_pick != MODE_TOGGLE
-			    && mode_pick != MODE_PICK)
-			    doit = 1;
-			else
-			    doit = 0;
-			}
-		    else if (mode_reverse_mouse == MB_YES)
-			{
-			if ((mask_return & 1024) == 1024
-			    && mode_pick != MODE_TOGGLE
-			    && mode_pick != MODE_PICK)
-			    doit = 1;
-			else
-			    doit = 0;
-			}
-		    else
-		       doit = 0;
-
-		    /* if grab on but mouse released, end grab */
-		    if (grab_mode == GRAB_MOVE && doit == 0)
-			{
-			status = mbedit_action_mouse_grab(
-		    		GRAB_END,
-				x_loc, y_loc,
-				mplot_width,mexager,
-				mx_interval,my_interval,
-				mplot_size,mshow_beammode, mshow_flagged,mshow_time,
-				&nbuffer,&ngood,&icurrent,&mnplot);
-			grab_mode = GRAB_START;
-			}
-		}
-
-	    } /* end of left button events */
-
-	/* If middle mouse button is pushed then scroll in reverse. */
-	if(event->xbutton.button == 2)
-	    {
-            time(&start_time_t);
-	    doit = 1;
-	    while (doit)
-		{
-                if (doit == 1 || difftime(time(NULL), start_time_t) > 2.0)
-                    {
-                    if (key_g_down == 0)
-                        {
-                            status = mbedit_action_step(-step,mplot_width,mexager,
-                                            mx_interval,my_interval,
-                                            mplot_size,mshow_beammode,mshow_flagged,mshow_time,
-                                            &nbuffer,&ngood,&icurrent,&mnplot);
-                            if (status == 0) XBell(theDisplay,100);
-                        }
-                    else
-                        {
-                            status = mbedit_action_step(-icurrent,mplot_width,mexager,
-                                            mx_interval,my_interval,
-                                            mplot_size,mshow_beammode,mshow_flagged,mshow_time,
-                                            &nbuffer,&ngood,&icurrent,&mnplot);
-                            if (status == 0) XBell(theDisplay,100);
-                        }
-                    }
-
-		/* If a scroll button is still pressed then scroll again */
-		status = XQueryPointer(theDisplay,can_xid,
-                                        &root_return,&child_return,&root_x_return,
-                                        &root_y_return, &win_x, &win_y, &mask_return);
-		if (mask_return & 512)
-		    doit++;
-		else
-                    doit = 0;
-                }
-	    } /* end of middle button events */
-
-	/* If right mouse button is pushed then scroll forward. */
-	if ((event->xbutton.button == 3 && mode_reverse_mouse == MB_NO)
-		|| (event->xbutton.button == 1 && mode_reverse_mouse == MB_YES))
-	    {
-            time(&start_time_t);
-	    doit = 1;
-	    while (doit)
-		{
-                if (doit == 1 || difftime(time(NULL), start_time_t) > 2.0)
-                    {
-                    if (key_g_down == 0)
-                        {
-                        status = mbedit_action_step(step,mplot_width,mexager,
-                                        mx_interval,my_interval,
-                                        mplot_size,mshow_beammode,mshow_flagged,mshow_time,
-                                        &nbuffer,&ngood,&icurrent,&mnplot);
-                        if (status == 0) XBell(theDisplay,100);
-                        }
-                    else
-                        {
-                        status = mbedit_action_step(nbuffer-icurrent-1,mplot_width,mexager,
-                                        mx_interval,my_interval,
-                                        mplot_size,mshow_beammode,mshow_flagged,mshow_time,
-                                        &nbuffer,&ngood,&icurrent,&mnplot);
-                        if (status == 0) XBell(theDisplay,100);
-                        }
-                    }
-
-		/* If a scroll button is still pressed then scroll again */
-		status = XQueryPointer(theDisplay,can_xid,
-                                        &root_return,&child_return,&root_x_return,
-                                        &root_y_return, &win_x, &win_y, &mask_return);
-		if ((mode_reverse_mouse == MB_YES && (mask_return & 256))
-                    || (mode_reverse_mouse == MB_NO && (mask_return & 1024)))
-		    doit++;
-		else
-                    doit = 0;
-               }
-	    } /* end of right button events */
-      } /* end of button pressed events */
-    } /* end of inputs from window */
-} /* end do_event function */
-
-/*--------------------------------------------------------------------*/
-
-void
-do_flag_view( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-
-    status = mbedit_action_flag_view(
-	    mplot_width,mexager,
-	    mx_interval,my_interval,
-	    mplot_size,mshow_beammode, mshow_flagged,mshow_time,
-	    &nbuffer,&ngood,&icurrent,&mnplot);
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_unflag_view( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-
-    status = mbedit_action_unflag_view(
-	    mplot_width,mexager,
-	    mx_interval,my_interval,
-	    mplot_size,mshow_beammode, mshow_flagged,mshow_time,
-	    &nbuffer,&ngood,&icurrent,&mnplot);
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_unflag_all( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-
-    status = mbedit_action_unflag_all(
-	    mplot_width,mexager,
-	    mx_interval,my_interval,
-	    mplot_size,mshow_beammode, mshow_flagged,mshow_time,
-	    &nbuffer,&ngood,&icurrent,&mnplot);
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_next_buffer( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-
-    int	    quit;
-
-    /* turn off expose plots */
-    expose_plot_ok = False;
-
-    /* get next buffer */
-    status = mbedit_action_next_buffer(hold_size,buffer_size,
-		    mplot_width,mexager,
-		    mx_interval,my_interval,
-		    mplot_size,mshow_beammode, mshow_flagged,mshow_time,
-		    &ndumped,&nloaded,&nbuffer,
-		    &ngood,&icurrent,&mnplot,&quit);
-    if (status == 0) XBell(theDisplay,100);
-
-    /* set widget values */
-    do_setup_data();
-
-    /* turn on expose plots */
-    expose_plot_ok = True;
-
-    /* quit if in GUI mode */
-    if (quit)
-	    exit(0);
-
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_number_step( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmScaleCallbackStruct *acs=(XmScaleCallbackStruct*)call_data;
-
-    int	maxx;
-    char	label[10];
-
-    step = acs->value;
-
-    /* if slider set to minimum value, half the value range;
-	    if slider set to maximum value,  double the range */
-    XtVaGetValues(slider_number_step,
-		    XmNmaximum, &maxx,
-		    NULL);
-    if (step == 1 || step == maxx)
-	    {
-	    if (step == 1)
-		    maxx = maxx/2;
-	    else
-		    maxx = 2*maxx;
-	    if (maxx > plot_size_max)
-		    maxx = plot_size_max;
-	    if (maxx < 2)
-		    maxx = 2;
-	    XtVaSetValues(slider_number_step,
-		    XmNmaximum, maxx,
-		    NULL);
-	    sprintf(label, "%d", maxx);
-	    set_label_string(slider_number_max_step_label,
-			    label);
-	    }
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_show_flagged( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-
-    mshow_flagged = XmToggleButtonGetState(toggleButton_show_flagged_on);
-
-    /* replot the data */
-    status = mbedit_action_plot(mplot_width, mexager,
-	    mx_interval, my_interval,
-	    mplot_size, mshow_beammode, mshow_flagged, mshow_time,
-	    &nbuffer, &ngood, &icurrent, &mnplot);
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_view_mode( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-
-    /* turn off all togglebuttons */
-    XmToggleButtonSetState(toggleButton_view_waterfall, MB_NO, FALSE);
-    XmToggleButtonSetState(toggleButton_view_alongtrack, MB_NO, FALSE);
-    XmToggleButtonSetState(toggleButton_view_acrosstrack, MB_NO, FALSE);
-
-    /* turn on the one that was clicked */
-    XmToggleButtonSetState(w, MB_YES, FALSE);
-
-    /* now set the data type id */
-    if (w == toggleButton_view_waterfall)
-	mview_mode = 0;
-    else if (w == toggleButton_view_alongtrack)
-	mview_mode = 1;
-    else if (w == toggleButton_view_acrosstrack)
-	mview_mode = 2;
-    else
-    	mview_mode = 0;
-
-    /* reset scaling */
-    status = mbedit_set_viewmode(mview_mode);
-
-    /* replot the data */
-    status = mbedit_action_plot(mplot_width, mexager,
-	    mx_interval, my_interval,
-	    mplot_size, mshow_beammode, mshow_flagged, mshow_time,
-	    &nbuffer, &ngood, &icurrent, &mnplot);
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_show_time( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-
-    /* turn off all togglebuttons */
-    XmToggleButtonSetState(toggleButton_show_wideplot, MB_NO, FALSE);
-    XmToggleButtonSetState(toggleButton_show_time, MB_NO, FALSE);
-    XmToggleButtonSetState(toggleButton_show_interval, MB_NO, FALSE);
-    XmToggleButtonSetState(toggleButton_show_lon, MB_NO, FALSE);
-    XmToggleButtonSetState(toggleButton_show_latitude, MB_NO, FALSE);
-    XmToggleButtonSetState(toggleButton_show_heading, MB_NO, FALSE);
-    XmToggleButtonSetState(toggleButton_show_speed, MB_NO, FALSE);
-    XmToggleButtonSetState(toggleButton_show_depth, MB_NO, FALSE);
-    XmToggleButtonSetState(toggleButton_show_altitude, MB_NO, FALSE);
-    XmToggleButtonSetState(toggleButton_show_sonardepth, MB_NO, FALSE);
-    XmToggleButtonSetState(toggleButton_show_roll, MB_NO, FALSE);
-    XmToggleButtonSetState(toggleButton_show_pitch, MB_NO, FALSE);
-    XmToggleButtonSetState(toggleButton_show_heave, MB_NO, FALSE);
-
-    /* turn on the one that was clicked */
-    XmToggleButtonSetState(w, MB_YES, FALSE);
-
-    /* now set the data type id */
-    if (w == toggleButton_show_wideplot)
-	mshow_time = 0;
-    else if (w == toggleButton_show_time)
-	mshow_time = 1;
-    else if (w == toggleButton_show_interval)
-	mshow_time = 2;
-    else if (w == toggleButton_show_lon)
-	mshow_time = 3;
-    else if (w == toggleButton_show_latitude)
-	mshow_time = 4;
-    else if (w == toggleButton_show_heading)
-	mshow_time = 5;
-    else if (w == toggleButton_show_speed)
-	mshow_time = 6;
-    else if (w == toggleButton_show_depth)
-	mshow_time = 7;
-    else if (w == toggleButton_show_altitude)
-	mshow_time = 8;
-    else if (w == toggleButton_show_sonardepth)
-	mshow_time = 9;
-    else if (w == toggleButton_show_roll)
-	mshow_time = 10;
-    else if (w == toggleButton_show_pitch)
-	mshow_time = 11;
-    else if (w == toggleButton_show_heave)
-	mshow_time = 12;
-    else
-    	mshow_time = 0;
-
-    /* reset scaling */
-    status = mbedit_set_scaling(mb_borders, mshow_time);
-
-    /* replot the data */
-    status = mbedit_action_plot(mplot_width, mexager,
-	    mx_interval, my_interval,
-	    mplot_size, mshow_beammode, mshow_flagged, mshow_time,
-	    &nbuffer, &ngood, &icurrent, &mnplot);
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_reverse_mouse( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-
-    mode_reverse_mouse = XmToggleButtonGetState(toggleButton_reverse_mouse);
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_reverse_keys( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-
-    mode_reverse_keys = XmToggleButtonGetState(toggleButton_reverse_keys);
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_show_flags( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-
-    mshow_beammode = BEAM_MODE_FLAG;
-    XmToggleButtonSetState(toggleButton_show_flags, TRUE, FALSE);
-    XmToggleButtonSetState(toggleButton_show_detects, FALSE, FALSE);
-    XmToggleButtonSetState(toggleButton_show_pulsetypes, FALSE, FALSE);
-
-    /* replot the data */
-    status = mbedit_action_plot(mplot_width, mexager,
-	mx_interval, my_interval,
-	mplot_size, mshow_beammode, mshow_flagged, mshow_time,
-	&nbuffer, &ngood, &icurrent, &mnplot);
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_show_detects( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-
-    mshow_beammode = BEAM_MODE_DETECT;
-    XmToggleButtonSetState(toggleButton_show_flags, FALSE, FALSE);
-    XmToggleButtonSetState(toggleButton_show_detects, TRUE, FALSE);
-    XmToggleButtonSetState(toggleButton_show_pulsetypes, FALSE, FALSE);
-
-    /* replot the data */
-    status = mbedit_action_plot(mplot_width, mexager,
-	mx_interval, my_interval,
-	mplot_size, mshow_beammode, mshow_flagged, mshow_time,
-	&nbuffer, &ngood, &icurrent, &mnplot);
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_show_pulsetypes( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-
-    mshow_beammode = BEAM_MODE_PULSE;
-    XmToggleButtonSetState(toggleButton_show_flags, FALSE, FALSE);
-    XmToggleButtonSetState(toggleButton_show_detects, FALSE, FALSE);
-    XmToggleButtonSetState(toggleButton_show_pulsetypes, TRUE, FALSE);
-
-    /* replot the data */
-    status = mbedit_action_plot(mplot_width, mexager,
-	mx_interval, my_interval,
-	mplot_size, mshow_beammode, mshow_flagged, mshow_time,
-	&nbuffer, &ngood, &icurrent, &mnplot);
-}
-
-
-/*--------------------------------------------------------------------*/
-
-void
-do_buffer_hold( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmScaleCallbackStruct *acs=(XmScaleCallbackStruct*)call_data;
-
-    hold_size = acs->value;
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_buffer_size( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmScaleCallbackStruct *acs=(XmScaleCallbackStruct*)call_data;
-
-    buffer_size = acs->value;
-
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_done( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-
-    int	quit;
-
-    /* turn off expose plots */
-    expose_plot_ok = False;
-
-    /* close the file */
-    status = mbedit_action_done(buffer_size,&ndumped,&nloaded,
-		    &nbuffer,&ngood,&icurrent,&quit);
-    if (status == 0) XBell(theDisplay,100);
-
-    /* if there is another file in the list open it */
-    if (currentfile >= 0 && currentfile < numfiles - 1)
-    	{
-	do_load_specific_file(currentfile + 1);
-	}
-
-    /* else do not open a file */
-    else
-    	{
-	currentfile = -1;
-	}
-
-    /* turn on expose plots */
-    expose_plot_ok = True;
-
-    if (quit)
-	    exit(0);
-
-    /* set widget values */
-    do_setup_data();
-}
-
-
-/*--------------------------------------------------------------------*/
-
-void
-do_number_pings( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmScaleCallbackStruct *acs=(XmScaleCallbackStruct*)call_data;
-
-    int	maxx;
-    char	label[10];
-
-    /* Read the value of the slider bar for number of pings displayed */
-    mplot_size = acs->value;
-
-    /* if slider set to minimum value, half the value range;
-	    if slider set to maximum value,  double the range */
-    XtVaGetValues(slider_number_pings,
-		    XmNmaximum, &maxx,
-		    NULL);
-    if (mplot_size == 1 || mplot_size == maxx)
-	    {
-	    if (mplot_size == 1)
-		    maxx = maxx/2;
-	    else
-		    maxx = 2*maxx;
-	    if (maxx > plot_size_max)
-		    maxx = plot_size_max;
-	    if (maxx < 2)
-		    maxx = 2;
-	    XtVaSetValues(slider_number_pings,
-		    XmNmaximum, maxx,
-		    NULL);
-	    sprintf(label, "%d", maxx);
-	    set_label_string(slider_num_pings_max_label,
-			    label);
-	    }
-
-    /* replot the data */
-    status = mbedit_action_plot(mplot_width, mexager,
-	    mx_interval, my_interval,
-	    mplot_size, mshow_beammode, mshow_flagged, mshow_time,
-	    &nbuffer, &ngood, &icurrent, &mnplot);
-    if (status == 0) XBell(theDisplay,100);
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_goto_apply( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-
-    char    value_text[MB_PATH_MAXLINE];
-
-    get_text_string(textfield_year, value_text);
-    sscanf(value_text, "%d", &ttime_i[0]);
-
-    get_text_string(textfield_month, value_text);
-    sscanf(value_text, "%d", &ttime_i[1]);
-
-    get_text_string(textfield_day, value_text);
-    sscanf(value_text, "%d", &ttime_i[2]);
-
-    get_text_string(textfield_hour, value_text);
-    sscanf(value_text, "%d", &ttime_i[3]);
-
-    get_text_string(textfield_minute, value_text);
-    sscanf(value_text, "%d", &ttime_i[4]);
-
-    get_text_string(textfield_second, value_text);
-    sscanf(value_text, "%d", &ttime_i[5]);
-
-    ttime_i[6] = 0;
-
-    /* turn off expose plots */
-    expose_plot_ok = False;
-
-    status = mbedit_action_goto(ttime_i,hold_size,buffer_size,
-		    mplot_width,mexager,
-		    mx_interval,my_interval,
-		    mplot_size,mshow_beammode, mshow_flagged,mshow_time,
-		    &ndumped,&nloaded,&nbuffer,
-		    &ngood,&icurrent,&mnplot);
-    if (status == 0) XBell(theDisplay,100);
-
-    /* turn on expose plots */
-    expose_plot_ok = True;
-}
-/*--------------------------------------------------------------------*/
-
-void
-do_set_filters( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-	int	ival;
-
-	/* get values of median spike filter widgets */
- 	f_medianspike = XmToggleButtonGetState(toggleButton_filters_medianspike);
-	XtVaGetValues(scale_filters_medianspike,
-		XmNvalue, &f_medianspike_threshold,
-		NULL);
-	XtVaGetValues(scale_median_local_xtrack,
-		XmNvalue, &f_medianspike_xtrack,
-		NULL);
-	XtVaGetValues(scale_median_local_ltrack,
-		XmNvalue, &f_medianspike_ltrack,
-		NULL);
-
-	/* get values of wrong side filter widgets */
- 	f_wrongside = XmToggleButtonGetState(toggleButton_filters_wrongside);
-	XtVaGetValues(scale_filters_wrongside,
-		XmNvalue, &f_wrongside_threshold,
-		NULL);
-
-	/* get values of cut by beam number filter widgets */
- 	f_cutbeam = XmToggleButtonGetState(toggleButton_filters_cutbeam);
-	XtVaGetValues(scale_filters_cutbeamstart,
-		XmNvalue, &f_cutbeam_begin,
-		NULL);
-	XtVaGetValues(scale_filters_cutbeamend,
-		XmNvalue, &f_cutbeam_end,
-		NULL);
-
-	/* get values of cut by distance filter widgets */
- 	f_cutdistance = XmToggleButtonGetState(toggleButton_filters_cutdistance);
-	XtVaGetValues(scale_filters_cutdistancestart,
-		XmNvalue, &ival,
-		NULL);
-	f_cutdistance_begin = 0.01 * ival;
-	XtVaGetValues(scale_filters_cutdistanceend,
-		XmNvalue, &ival,
-		NULL);
-	f_cutdistance_end = 0.01 * ival;
-
-	/* get values of cut by angle filter widgets */
- 	f_cutangle = XmToggleButtonGetState(toggleButton_filters_cutangle);
-	XtVaGetValues(scale_filters_cutanglestart,
-		XmNvalue, &ival,
-		NULL);
-	f_cutangle_begin = 0.01 * ival;
-	XtVaGetValues(scale_filters_cutangleend,
-		XmNvalue, &ival,
-		NULL);
-	f_cutangle_end = 0.01 * ival;
-
-	/* set some values in mbedit */
-	status = mbedit_set_filters(f_medianspike,
-			f_medianspike_threshold,
-			f_medianspike_xtrack,
-			f_medianspike_ltrack,
-			f_wrongside,
-			f_wrongside_threshold,
-			f_cutbeam,
-			f_cutbeam_begin, f_cutbeam_end,
-			f_cutdistance,
-			f_cutdistance_begin, f_cutdistance_end,
-			f_cutangle,
-			f_cutangle_begin, f_cutangle_end);
-
-    	status = mbedit_action_filter_all(
-	     	mplot_width,mexager,
-	    	mx_interval,my_interval,
-	    	mplot_size,mshow_beammode, mshow_flagged,mshow_time,
-	    	&nbuffer,&ngood,&icurrent,&mnplot);
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_reset_filters( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-
-	/* get filter values and set widgets */
-	do_get_filters();
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_check_median_xtrack( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-
-	XtVaGetValues(scale_median_local_xtrack,
-		XmNvalue, &f_medianspike_xtrack,
-		NULL);
-	if (f_medianspike_xtrack %2 == 0)
-	    f_medianspike_xtrack++;
-	XtVaSetValues(scale_median_local_xtrack,
-			XmNvalue, f_medianspike_xtrack,
-			NULL);
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_check_median_ltrack( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-
-	XtVaGetValues(scale_median_local_ltrack,
-		XmNvalue, &f_medianspike_ltrack,
-		NULL);
-	if (f_medianspike_ltrack % 2 == 0)
-	    f_medianspike_ltrack++;
-	XtVaSetValues(scale_median_local_ltrack,
-			XmNvalue, f_medianspike_ltrack,
-			NULL);
-}
-
-/*--------------------------------------------------------------------*/
-/*--------------------------------------------------------------------*/
-
-int
-do_wait_until_viewed(XtAppContext app)
-{
-    Widget  topshell;
-    Window  topwindow;
-    XWindowAttributes	xwa;
-    XEvent  event;
-
-    /* set app_context */
-    app_context = app;
-
-    /* find the top level shell */
-    for (topshell = window_mbedit;
-	    !XtIsTopLevelShell(topshell);
-	    topshell = XtParent(topshell))
-	;
-
-    /* keep processing events until it is viewed */
-    if (XtIsRealized(topshell))
-	{
-	topwindow = XtWindow(topshell);
-
-	/* wait for the window to be mapped */
-	while (XGetWindowAttributes(
-			XtDisplay(window_mbedit),
-			topwindow, &xwa)
-		&& xwa.map_state != IsViewable)
-	    {
-	    XtAppNextEvent(app_context, &event);
-	    XtDispatchEvent(&event);
-	    }
-	}
-
-    XmUpdateDisplay(topshell);
-
-    return(1);
-
-}
-/*------------------------------------------------------------------------------*/
-
-int do_mbedit_settimer()
-{
-	int	status = MB_SUCCESS;
-	int	timer_timeout_time = 1000;
-	int	id;
-
-	/* set timer function if none set for this instance */
-	if (timer_function_set == MB_NO)
-		{
-		id =  XtAppAddTimeOut(app_context,
-				(unsigned long) timer_timeout_time,
-				(XtTimerCallbackProc)do_mbedit_workfunction,
-				(XtPointer) -1);
-		if (id > 0)
-			timer_function_set = MB_YES;
-		else
-			status = MB_FAILURE;
-		}
-
-/* else
-fprintf(stderr,"do_mbedit_settimer: FUNCTION ALREADY SET!!\n"); */
-
-	return(status);
-}
-
-/*------------------------------------------------------------------------------*/
-
-int do_mbedit_workfunction(XtPointer client_data)
-{
-	int	status = MB_SUCCESS;
-
-	timer_function_set = MB_NO;
-
-	/* reset filelist */
-	if (numfiles > 0 && expose_plot_ok == True)
-		{
-		do_build_filelist();
-		}
-
-	/* reset the timer function */
-	do_mbedit_settimer();
-
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-/* Message and error dialogs */
-/*--------------------------------------------------------------------*/
-
-int
-do_message_on(char *message)
-{
-    Widget  diashell, topshell;
-    Window  diawindow, topwindow;
-    XWindowAttributes	xwa;
-    XEvent  event;
-
-    set_label_string(label_message, message);
-    XtManageChild(bulletinBoard_message);
-
-    /* force the label to be visible */
-    for (diashell = label_message;
-	    !XtIsShell(diashell);
-	    diashell = XtParent(diashell))
-	;
-    for (topshell = diashell;
-	    !XtIsTopLevelShell(topshell);
-	    topshell = XtParent(topshell))
-	;
-    if (XtIsRealized(diashell) && XtIsRealized(topshell))
-	{
-	diawindow = XtWindow(diashell);
-	topwindow = XtWindow(topshell);
-
-	/* wait for the dialog to be mapped */
-	while (XGetWindowAttributes(display, diawindow, &xwa)
-		&& xwa.map_state != IsViewable)
-	    {
-	    if (XGetWindowAttributes(display, topwindow, &xwa)
-		    && xwa.map_state != IsViewable)
-		break;
-
-	    XtAppNextEvent(app_context, &event);
-	    XtDispatchEvent(&event);
-	    }
-	}
-
-    XmUpdateDisplay(topshell);
-
-    return(1);
-}
-
-/*--------------------------------------------------------------------*/
-
-int
-do_message_off()
-{
-    XtUnmanageChild(bulletinBoard_message);
-    XSync(XtDisplay(bulletinBoard_message), 0);
-    XmUpdateDisplay(window_mbedit);
-
-    return(1);
-}
-
-/*--------------------------------------------------------------------*/
-
-int
-do_error_dialog(char *s1, char *s2, char *s3)
-{
-    set_label_string(label_error_one, s1);
-    set_label_string(label_error_two, s2);
-    set_label_string(label_error_three, s3);
-    XtManageChild(bulletinBoard_error);
-    XBell(theDisplay,100);
-/* fprintf(stderr,"do_error_dialog:\n\t%s\n\t%s\n\t%s\n",s1,s2,s3); */
-
-    return(1);
-}
-
-/*--------------------------------------------------------------------*/
-/* Change label string cleanly, no memory leak */
-/*--------------------------------------------------------------------*/
-
-void set_label_string(Widget w, String str)
-{
-    XmString xstr;
-
-    xstr = XmStringCreateLocalized( str );
-    if ( xstr != NULL )
-	XtVaSetValues(w,
-	    XmNlabelString, xstr,
-	    NULL);
-    else
-	XtWarning("Failed to update labelString");
-
-    XmStringFree( xstr );
-}
-/*--------------------------------------------------------------------*/
-/* Change multiline label string cleanly, no memory leak */
-/*--------------------------------------------------------------------*/
-
-void set_label_multiline_string(Widget w, String str)
-{
-    XmString xstr;
-    Boolean      argok;
-
-    xstr = (XtPointer)BX_CONVERT(w, str, XmRXmString, 0, &argok);
-    if ( xstr != NULL && argok)
-        XtVaSetValues(w,
-            XmNlabelString, xstr,
-            NULL);
-    else
-        XtWarning("Failed to update labelString");
-
-    XmStringFree( xstr );
-}
-/*--------------------------------------------------------------------*/
-/* Get text item string cleanly, no memory leak */
-/*--------------------------------------------------------------------*/
-
-void get_text_string(Widget w, String str)
-{
-    char	*str_tmp;
-
-    str_tmp = (char *) XmTextGetString(w);
-    strcpy(str, str_tmp);
-    XtFree(str_tmp);
-}
-
-/*--------------------------------------------------------------------*/
diff --git a/src/mbedit/mbedit_creation.c b/src/mbedit/mbedit_creation.c
deleted file mode 100644
index 95c3878..0000000
--- a/src/mbedit/mbedit_creation.c
+++ /dev/null
@@ -1,4619 +0,0 @@
-
-/* Begin user code block <abstract> */
-/* End user code block <abstract> */
-
-/**
- * README: Portions of this file are merged at file generation
- * time. Edits can be made *only* in between specified code blocks, look
- * for keywords <Begin user code> and <End user code>.
- */
-/*
- * Generated by the ICS Builder Xcessory (BX).
- *
- * BuilderXcessory Version 6.1.3
- * Code Generator Xcessory 6.1.3 (08/19/04) CGX Scripts 6.1 Motif 2.1
- *
- */
-
-
-/* Begin user code block <file_comments> */
-
-#ifndef SANS
-#define SANS "helvetica"
-#endif
-#ifndef SERIF
-#define SERIF "times"
-#endif
-#ifndef MONO
-#define MONO "courier"
-#endif
-
-/* End user code block <file_comments> */
-
-#include <Xm/Xm.h>
-#include <Xm/MainW.h>
-#include <Xm/DialogS.h>
-#include <Xm/MwmUtil.h>
-#include <Xm/Form.h>
-#include <Xm/PushB.h>
-#include <Xm/Label.h>
-#include <Xm/RowColumn.h>
-#include <Xm/ToggleB.h>
-#include <Xm/ScrolledW.h>
-#include <Xm/List.h>
-#include <Xm/BulletinB.h>
-#include <Xm/Scale.h>
-#include <Xm/Separator.h>
-#include <Xm/TextF.h>
-#include <Xm/FileSB.h>
-#include <Xm/CascadeB.h>
-#include <Xm/DrawingA.h>
-#include <Xm/MainW.h>
-#include <Xm/DialogS.h>
-#include <Xm/MwmUtil.h>
-#include <Xm/Form.h>
-#include <Xm/PushB.h>
-#include <Xm/Label.h>
-#include <Xm/RowColumn.h>
-#include <Xm/ToggleB.h>
-#include <Xm/ScrolledW.h>
-#include <Xm/List.h>
-#include <Xm/BulletinB.h>
-#include <Xm/Scale.h>
-#include <Xm/Separator.h>
-#include <Xm/TextF.h>
-#include <Xm/FileSB.h>
-#include <Xm/CascadeB.h>
-#include <Xm/DrawingA.h>
-
-/*
- * Global declarations are now stored in the header file.
- *
- * If DECLARE_BX_GLOBALS is defined then this header file
- * declares the globals, otherwise it just externs them.
- */
-#define DECLARE_BX_GLOBALS
-
-/**
- * Globally included information.
- */
-
-
-/**
- * Common constant and pixmap declarations.
- */
-#include "mbedit_creation.h"
-
-/**
- * Convenience functions from utilities file.
- */
-extern void RegisterBxConverters(XtAppContext);
-extern XtPointer BX_CONVERT(Widget, char *, char *, int, Boolean *);
-extern XtPointer BX_DOUBLE(double);
-extern XtPointer BX_SINGLE(float);
-extern void BX_MENU_POST(Widget, XtPointer, XEvent *, Boolean *);
-extern Pixmap XPM_PIXMAP(Widget, char **);
-extern void BX_SET_BACKGROUND_COLOR(Widget, ArgList, Cardinal *, Pixel);
-
-/**
- * Declarations for callbacks and handlers.
- */
-extern void do_quit(Widget, XtPointer, XtPointer);
-extern void do_filelist_remove(Widget, XtPointer, XtPointer);
-extern void do_editlistselection(Widget, XtPointer, XtPointer);
-extern void BxUnmanageCB(Widget, XtPointer, XtPointer);
-extern void do_output_edit_filelist(Widget, XtPointer, XtPointer);
-extern void do_output_browse_filelist(Widget, XtPointer, XtPointer);
-extern void do_reset_filters(Widget, XtPointer, XtPointer);
-extern void do_set_filters(Widget, XtPointer, XtPointer);
-extern void do_check_median_ltrack(Widget, XtPointer, XtPointer);
-extern void do_check_median_xtrack(Widget, XtPointer, XtPointer);
-extern void do_y_interval(Widget, XtPointer, XtPointer);
-extern void do_x_interval(Widget, XtPointer, XtPointer);
-extern void do_buffer_hold(Widget, XtPointer, XtPointer);
-extern void do_buffer_size(Widget, XtPointer, XtPointer);
-extern void do_load_ok(Widget, XtPointer, XtPointer);
-extern void do_load_ok_with_save(Widget, XtPointer, XtPointer);
-extern void do_goto_apply(Widget, XtPointer, XtPointer);
-extern void do_load_check(Widget, XtPointer, XtPointer);
-extern void do_output_edit(Widget, XtPointer, XtPointer);
-extern void do_output_browse(Widget, XtPointer, XtPointer);
-extern void do_event(Widget, XtPointer, XtPointer);
-extern void do_expose(Widget, XtPointer, XtPointer);
-extern void do_end(Widget, XtPointer, XtPointer);
-extern void do_start(Widget, XtPointer, XtPointer);
-extern void do_flag_view(Widget, XtPointer, XtPointer);
-extern void do_unflag_all(Widget, XtPointer, XtPointer);
-extern void do_unflag_view(Widget, XtPointer, XtPointer);
-extern void BxManageCB(Widget, XtPointer, XtPointer);
-extern void do_next_buffer(Widget, XtPointer, XtPointer);
-extern void do_done(Widget, XtPointer, XtPointer);
-extern void do_forward(Widget, XtPointer, XtPointer);
-extern void do_reverse(Widget, XtPointer, XtPointer);
-extern void do_scale_x(Widget, XtPointer, XtPointer);
-extern void do_scale_y(Widget, XtPointer, XtPointer);
-extern void do_number_pings(Widget, XtPointer, XtPointer);
-extern void do_number_step(Widget, XtPointer, XtPointer);
-extern void do_view_mode(Widget, XtPointer, XtPointer);
-extern void do_show_flagged(Widget, XtPointer, XtPointer);
-extern void do_show_flags(Widget, XtPointer, XtPointer);
-extern void do_show_detects(Widget, XtPointer, XtPointer);
-extern void do_show_pulsetypes(Widget, XtPointer, XtPointer);
-extern void do_show_time(Widget, XtPointer, XtPointer);
-extern void do_reverse_keys(Widget, XtPointer, XtPointer);
-extern void do_reverse_mouse(Widget, XtPointer, XtPointer);
-extern void do_mode_toggle(Widget, XtPointer, XtPointer);
-extern void do_mode_pick(Widget, XtPointer, XtPointer);
-extern void do_mode_erase(Widget, XtPointer, XtPointer);
-extern void do_mode_restore(Widget, XtPointer, XtPointer);
-extern void do_mode_grab(Widget, XtPointer, XtPointer);
-extern void do_mode_info(Widget, XtPointer, XtPointer);
-
-/**
- * Create the window_mbedit hierarchy of widgets.
- */
-Widget
-Createwindow_mbedit(Widget parent)
-{
-    Cardinal ac = 0;
-    Arg      args[256];
-    Boolean  argok = False;
-    Widget   dialogShell_filelist;
-    Widget   form_filelist;
-    Widget   pushButton_filelist_remove;
-    Widget   pushButton_filelist_edit;
-    Widget   setting_output_label_filelist;
-    Widget   pushButton_filelist_dismiss;
-    Widget   scrolledWindow_filelist;
-    Widget   dialogShell_filters;
-    Widget   bulletinBoard_filters;
-    Widget   scrolledWindow_filters;
-    Widget   bulletinBoard_scrollfilters;
-    Widget   separator6;
-    Widget   separator5;
-    Widget   separator4;
-    Widget   separator3;
-    Widget   pushButton_filters_reset;
-    Widget   pushButton_filters_apply;
-    Widget   pushButton_filters_dismiss;
-    Widget   dialogShell_annotation;
-    Widget   bulletinBoard_annotation;
-    Widget   pushButton_annotation_dismiss;
-    Widget   dialogShell_buffer;
-    Widget   bulletinBoard_buffer;
-    Widget   pushButton_buffer_dismiss;
-    Widget   xmDialogShell_error;
-    Widget   pushButton_error;
-    Widget   xmDialogShell_editsave;
-    Widget   label_editsave_one;
-    Widget   label_editsave_two;
-    Widget   pushButton_editsave_no;
-    Widget   pushButton_editsave_yes;
-    Widget   xmDialogShell_message;
-    Widget   label_pleasewait;
-    Widget   xmDialogShell_about;
-    Widget   bulletinBoard_about;
-    Widget   label_about_create1;
-    Widget   separator1;
-    Widget   pushButton_about_dismiss;
-    Widget   label_about_create;
-    Widget   label_about_lamont;
-    Widget   label_about_columbia;
-    Widget   label_about_mbsystem;
-    Widget   label_about_mbpub;
-    Widget   label_about_component;
-    Widget   label_about_for;
-    Widget   separator;
-    Widget   label_about_function;
-    Widget   label_about_mbedit;
-    Widget   xmDialogShell_goto;
-    Widget   bulletinBoard_goto;
-    Widget   button_goto_cancel;
-    Widget   button_goto_apply;
-    Widget   textfield_second_label;
-    Widget   textfield_minute_label;
-    Widget   textfield_hour_label;
-    Widget   textfield_day_label;
-    Widget   textfield_month_label;
-    Widget   textfield_year_label;
-    Widget   xmDialogShell_file;
-    Widget   bulletinBoard_file;
-    Widget   mbedit_bboard;
-    Widget   controls_mbedit;
-    Widget   menuBar_file;
-    Widget   cascadeButton_file;
-    Widget   pulldownMenu_file;
-    Widget   separator10;
-    Widget   pushButton_filelist;
-    Widget   pushButton_flag_view;
-    Widget   menuBar_view;
-    Widget   cascadeButton_view;
-    Widget   pulldownMenu_view;
-    Widget   separator2;
-    Widget   separator8;
-    Widget   separator9;
-    Widget   pushButton_unflag_all;
-    Widget   pushButton_unflag_view;
-    Widget   menuBar_controls;
-    Widget   cascadeButton_controls;
-    Widget   pulldownMenu_controls;
-    Widget   pushButton_goto;
-    Widget   pushButton_buffer;
-    Widget   pushButton_annotation;
-    Widget   pushButton_filters;
-    Widget   separator7;
-    Widget   pushButton_about;
-    Widget   pushButton_quit;
-    Widget   setting_mode_label;
-    Widget   setting_mode;
-
-    /**
-     * Register the converters for the widgets.
-     */
-    RegisterBxConverters(XtWidgetToApplicationContext(parent));
-    XtInitializeWidgetClass((WidgetClass)xmMainWindowWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmDialogShellWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmFormWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmPushButtonWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmLabelWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmRowColumnWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmToggleButtonWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmScrolledWindowWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmListWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmBulletinBoardWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmBulletinBoardWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmRowColumnWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmScaleWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmSeparatorWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmTextFieldWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmFileSelectionBoxWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmRowColumnWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmCascadeButtonWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmRowColumnWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmDrawingAreaWidgetClass);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 114); ac++;
-    XtSetArg(args[ac], XmNy, 631); ac++;
-    XtSetArg(args[ac], XmNwidth, 1014); ac++;
-    XtSetArg(args[ac], XmNheight, 663); ac++;
-    window_mbedit = XmCreateMainWindow(parent,
-        (char *)"window_mbedit",
-        args,
-        ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNnoResize, False); ac++;
-    XtSetArg(args[ac], XmNmarginHeight, 0); ac++;
-    XtSetArg(args[ac], XmNmarginWidth, 0); ac++;
-    XtSetArg(args[ac], XmNresizePolicy, XmRESIZE_GROW); ac++;
-    XtSetArg(args[ac], XmNwidth, 1014); ac++;
-    XtSetArg(args[ac], XmNheight, 663); ac++;
-    mbedit_bboard = XmCreateBulletinBoard(window_mbedit,
-        (char *)"mbedit_bboard",
-        args,
-        ac);
-    XtManageChild(mbedit_bboard);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNmarginHeight, 0); ac++;
-    XtSetArg(args[ac], XmNmarginWidth, 0); ac++;
-    XtSetArg(args[ac], XmNresizePolicy, XmRESIZE_GROW); ac++;
-    XtSetArg(args[ac], XmNx, 0); ac++;
-    XtSetArg(args[ac], XmNy, 0); ac++;
-    XtSetArg(args[ac], XmNwidth, 1040); ac++;
-    XtSetArg(args[ac], XmNheight, 154); ac++;
-    controls_mbedit = XmCreateBulletinBoard(mbedit_bboard,
-        (char *)"controls_mbedit",
-        args,
-        ac);
-    XtManageChild(controls_mbedit);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNpacking, XmPACK_TIGHT); ac++;
-    XtSetArg(args[ac], XmNx, 0); ac++;
-    XtSetArg(args[ac], XmNy, 0); ac++;
-    XtSetArg(args[ac], XmNwidth, 51); ac++;
-    XtSetArg(args[ac], XmNheight, 34); ac++;
-    menuBar_file = XmCreateMenuBar(controls_mbedit,
-        (char *)"menuBar_file",
-        args,
-        ac);
-    XtManageChild(menuBar_file);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(menuBar_file, (char *)"File",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 5); ac++;
-        XtSetArg(args[ac], XmNy, 5); ac++;
-        XtSetArg(args[ac], XmNwidth, 41); ac++;
-        XtSetArg(args[ac], XmNheight, 24); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(menuBar_file, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        cascadeButton_file = XmCreateCascadeButton(menuBar_file,
-            (char *)"cascadeButton_file",
-            args,
-            ac);
-        XtManageChild(cascadeButton_file);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 0); ac++;
-    XtSetArg(args[ac], XmNy, 0); ac++;
-    XtSetArg(args[ac], XmNwidth, 135); ac++;
-    XtSetArg(args[ac], XmNheight, 54); ac++;
-    pulldownMenu_file = XmCreatePulldownMenu(XtParent(cascadeButton_file),
-        (char *)"pulldownMenu_file",
-        args,
-        ac);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(pulldownMenu_file, (char *)"Open",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_file, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_file = XmCreatePushButton(pulldownMenu_file,
-            (char *)"pushButton_file",
-            args,
-            ac);
-        XtManageChild(pushButton_file);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_file, XmNactivateCallback, BxManageCB, (XtPointer)"bulletinBoard_file");
-
-    ac = 0;
-    separator10 = XmCreateSeparator(pulldownMenu_file,
-        (char *)"separator10",
-        args,
-        ac);
-    XtManageChild(separator10);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(pulldownMenu_file, (char *)"File Selection List",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_file, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_filelist = XmCreatePushButton(pulldownMenu_file,
-            (char *)"pushButton_filelist",
-            args,
-            ac);
-        XtManageChild(pushButton_filelist);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_filelist, XmNactivateCallback, BxManageCB, (XtPointer)"form_filelist");
-
-    ac = 0;
-    XtSetArg(args[ac], XmNsubMenuId, pulldownMenu_file); ac++;
-    XtSetValues(cascadeButton_file, args, ac);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(controls_mbedit, (char *)"End",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 510); ac++;
-        XtSetArg(args[ac], XmNy, 0); ac++;
-        XtSetArg(args[ac], XmNwidth, 70); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(controls_mbedit, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_end = XmCreatePushButton(controls_mbedit,
-            (char *)"pushButton_end",
-            args,
-            ac);
-        XtManageChild(pushButton_end);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_end, XmNactivateCallback, do_end, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(controls_mbedit, (char *)"Start",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 300); ac++;
-        XtSetArg(args[ac], XmNy, 0); ac++;
-        XtSetArg(args[ac], XmNwidth, 70); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(controls_mbedit, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_start = XmCreatePushButton(controls_mbedit,
-            (char *)"pushButton_start",
-            args,
-            ac);
-        XtManageChild(pushButton_start);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_start, XmNactivateCallback, do_start, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(controls_mbedit, (char *)"Flag View",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 550); ac++;
-        XtSetArg(args[ac], XmNy, 120); ac++;
-        XtSetArg(args[ac], XmNwidth, 120); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(controls_mbedit, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_flag_view = XmCreatePushButton(controls_mbedit,
-            (char *)"pushButton_flag_view",
-            args,
-            ac);
-        XtManageChild(pushButton_flag_view);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_flag_view, XmNactivateCallback, do_flag_view, (XtPointer)0);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNpacking, XmPACK_TIGHT); ac++;
-    XtSetArg(args[ac], XmNx, 90); ac++;
-    XtSetArg(args[ac], XmNy, 0); ac++;
-    XtSetArg(args[ac], XmNwidth, 58); ac++;
-    XtSetArg(args[ac], XmNheight, 34); ac++;
-    menuBar_view = XmCreateMenuBar(controls_mbedit,
-        (char *)"menuBar_view",
-        args,
-        ac);
-    XtManageChild(menuBar_view);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(menuBar_view, (char *)"View",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 5); ac++;
-        XtSetArg(args[ac], XmNy, 5); ac++;
-        XtSetArg(args[ac], XmNwidth, 48); ac++;
-        XtSetArg(args[ac], XmNheight, 24); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(menuBar_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        cascadeButton_view = XmCreateCascadeButton(menuBar_view,
-            (char *)"cascadeButton_view",
-            args,
-            ac);
-        XtManageChild(cascadeButton_view);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 0); ac++;
-    XtSetArg(args[ac], XmNy, 0); ac++;
-    XtSetArg(args[ac], XmNwidth, 247); ac++;
-    XtSetArg(args[ac], XmNheight, 490); ac++;
-    pulldownMenu_view = XmCreatePulldownMenu(XtParent(cascadeButton_view),
-        (char *)"pulldownMenu_view",
-        args,
-        ac);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(pulldownMenu_view, (char *)"Waterfall View",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        toggleButton_view_waterfall = XmCreateToggleButton(pulldownMenu_view,
-            (char *)"toggleButton_view_waterfall",
-            args,
-            ac);
-        XtManageChild(toggleButton_view_waterfall);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(toggleButton_view_waterfall, XmNvalueChangedCallback, do_view_mode, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(pulldownMenu_view, (char *)"Alongtrack View",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        toggleButton_view_alongtrack = XmCreateToggleButton(pulldownMenu_view,
-            (char *)"toggleButton_view_alongtrack",
-            args,
-            ac);
-        XtManageChild(toggleButton_view_alongtrack);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(toggleButton_view_alongtrack, XmNvalueChangedCallback, do_view_mode, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(pulldownMenu_view, (char *)"Acrosstrack View",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        toggleButton_view_acrosstrack = XmCreateToggleButton(pulldownMenu_view,
-            (char *)"toggleButton_view_acrosstrack",
-            args,
-            ac);
-        XtManageChild(toggleButton_view_acrosstrack);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(toggleButton_view_acrosstrack, XmNvalueChangedCallback, do_view_mode, (XtPointer)0);
-
-    ac = 0;
-    separator2 = XmCreateSeparator(pulldownMenu_view,
-        (char *)"separator2",
-        args,
-        ac);
-    XtManageChild(separator2);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(pulldownMenu_view, (char *)"Show Flagged Profile",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        toggleButton_show_flagged_on = XmCreateToggleButton(pulldownMenu_view,
-            (char *)"toggleButton_show_flagged_on",
-            args,
-            ac);
-        XtManageChild(toggleButton_show_flagged_on);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(toggleButton_show_flagged_on, XmNvalueChangedCallback, do_show_flagged, (XtPointer)0);
-
-    ac = 0;
-    separator8 = XmCreateSeparator(pulldownMenu_view,
-        (char *)"separator8",
-        args,
-        ac);
-    XtManageChild(separator8);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(pulldownMenu_view, (char *)"Show Flag States",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        toggleButton_show_flags = XmCreateToggleButton(pulldownMenu_view,
-            (char *)"toggleButton_show_flags",
-            args,
-            ac);
-        XtManageChild(toggleButton_show_flags);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(toggleButton_show_flags, XmNvalueChangedCallback, do_show_flags, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(pulldownMenu_view, (char *)"Show Bottom Detect Algorithms",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        toggleButton_show_detects = XmCreateToggleButton(pulldownMenu_view,
-            (char *)"toggleButton_show_detects",
-            args,
-            ac);
-        XtManageChild(toggleButton_show_detects);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(toggleButton_show_detects, XmNvalueChangedCallback, do_show_detects, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(pulldownMenu_view, (char *)"Show Source Pulse Types",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        toggleButton_show_pulsetypes = XmCreateToggleButton(pulldownMenu_view,
-            (char *)"toggleButton_show_pulsetypes",
-            args,
-            ac);
-        XtManageChild(toggleButton_show_pulsetypes);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(toggleButton_show_pulsetypes, XmNvalueChangedCallback, do_show_pulsetypes, (XtPointer)0);
-
-    ac = 0;
-    separator9 = XmCreateSeparator(pulldownMenu_view,
-        (char *)"separator9",
-        args,
-        ac);
-    XtManageChild(separator9);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(pulldownMenu_view, (char *)"Wide Bathymetry Profiles",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        toggleButton_show_wideplot = XmCreateToggleButton(pulldownMenu_view,
-            (char *)"toggleButton_show_wideplot",
-            args,
-            ac);
-        XtManageChild(toggleButton_show_wideplot);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(toggleButton_show_wideplot, XmNvalueChangedCallback, do_show_time, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(pulldownMenu_view, (char *)"Print Time Stamps",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        toggleButton_show_time = XmCreateToggleButton(pulldownMenu_view,
-            (char *)"toggleButton_show_time",
-            args,
-            ac);
-        XtManageChild(toggleButton_show_time);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(toggleButton_show_time, XmNvalueChangedCallback, do_show_time, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(pulldownMenu_view, (char *)"Plot Ping Interval",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        toggleButton_show_interval = XmCreateToggleButton(pulldownMenu_view,
-            (char *)"toggleButton_show_interval",
-            args,
-            ac);
-        XtManageChild(toggleButton_show_interval);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(toggleButton_show_interval, XmNvalueChangedCallback, do_show_time, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(pulldownMenu_view, (char *)"Plot Longitude",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        toggleButton_show_lon = XmCreateToggleButton(pulldownMenu_view,
-            (char *)"toggleButton_show_lon",
-            args,
-            ac);
-        XtManageChild(toggleButton_show_lon);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(toggleButton_show_lon, XmNvalueChangedCallback, do_show_time, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(pulldownMenu_view, (char *)"Plot Latitude",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        toggleButton_show_latitude = XmCreateToggleButton(pulldownMenu_view,
-            (char *)"toggleButton_show_latitude",
-            args,
-            ac);
-        XtManageChild(toggleButton_show_latitude);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(toggleButton_show_latitude, XmNvalueChangedCallback, do_show_time, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(pulldownMenu_view, (char *)"Plot Heading",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        toggleButton_show_heading = XmCreateToggleButton(pulldownMenu_view,
-            (char *)"toggleButton_show_heading",
-            args,
-            ac);
-        XtManageChild(toggleButton_show_heading);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(toggleButton_show_heading, XmNvalueChangedCallback, do_show_time, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(pulldownMenu_view, (char *)"Plot Speed",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        toggleButton_show_speed = XmCreateToggleButton(pulldownMenu_view,
-            (char *)"toggleButton_show_speed",
-            args,
-            ac);
-        XtManageChild(toggleButton_show_speed);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(toggleButton_show_speed, XmNvalueChangedCallback, do_show_time, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(pulldownMenu_view, (char *)"Plot Center Beam Depth",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        toggleButton_show_depth = XmCreateToggleButton(pulldownMenu_view,
-            (char *)"toggleButton_show_depth",
-            args,
-            ac);
-        XtManageChild(toggleButton_show_depth);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(toggleButton_show_depth, XmNvalueChangedCallback, do_show_time, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(pulldownMenu_view, (char *)"Plot Sonar Altitude",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        toggleButton_show_altitude = XmCreateToggleButton(pulldownMenu_view,
-            (char *)"toggleButton_show_altitude",
-            args,
-            ac);
-        XtManageChild(toggleButton_show_altitude);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(toggleButton_show_altitude, XmNvalueChangedCallback, do_show_time, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(pulldownMenu_view, (char *)"Plot Sonar Depth",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        toggleButton_show_sonardepth = XmCreateToggleButton(pulldownMenu_view,
-            (char *)"toggleButton_show_sonardepth",
-            args,
-            ac);
-        XtManageChild(toggleButton_show_sonardepth);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(toggleButton_show_sonardepth, XmNvalueChangedCallback, do_show_time, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(pulldownMenu_view, (char *)"Plot Roll",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        toggleButton_show_roll = XmCreateToggleButton(pulldownMenu_view,
-            (char *)"toggleButton_show_roll",
-            args,
-            ac);
-        XtManageChild(toggleButton_show_roll);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(toggleButton_show_roll, XmNvalueChangedCallback, do_show_time, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(pulldownMenu_view, (char *)"Plot Pitch",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        toggleButton_show_pitch = XmCreateToggleButton(pulldownMenu_view,
-            (char *)"toggleButton_show_pitch",
-            args,
-            ac);
-        XtManageChild(toggleButton_show_pitch);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(toggleButton_show_pitch, XmNvalueChangedCallback, do_show_time, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(pulldownMenu_view, (char *)"Plot Heave",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        toggleButton_show_heave = XmCreateToggleButton(pulldownMenu_view,
-            (char *)"toggleButton_show_heave",
-            args,
-            ac);
-        XtManageChild(toggleButton_show_heave);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(toggleButton_show_heave, XmNvalueChangedCallback, do_show_time, (XtPointer)0);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNsubMenuId, pulldownMenu_view); ac++;
-    XtSetValues(cascadeButton_view, args, ac);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(controls_mbedit, (char *)"Unflag Forward",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 850); ac++;
-        XtSetArg(args[ac], XmNy, 120); ac++;
-        XtSetArg(args[ac], XmNwidth, 120); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(controls_mbedit, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_unflag_all = XmCreatePushButton(controls_mbedit,
-            (char *)"pushButton_unflag_all",
-            args,
-            ac);
-        XtManageChild(pushButton_unflag_all);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_unflag_all, XmNactivateCallback, do_unflag_all, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(controls_mbedit, (char *)"Unflag View",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 700); ac++;
-        XtSetArg(args[ac], XmNy, 120); ac++;
-        XtSetArg(args[ac], XmNwidth, 120); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(controls_mbedit, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_unflag_view = XmCreatePushButton(controls_mbedit,
-            (char *)"pushButton_unflag_view",
-            args,
-            ac);
-        XtManageChild(pushButton_unflag_view);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_unflag_view, XmNactivateCallback, do_unflag_view, (XtPointer)0);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 170); ac++;
-    XtSetArg(args[ac], XmNy, 0); ac++;
-    XtSetArg(args[ac], XmNwidth, 87); ac++;
-    XtSetArg(args[ac], XmNheight, 34); ac++;
-    menuBar_controls = XmCreateMenuBar(controls_mbedit,
-        (char *)"menuBar_controls",
-        args,
-        ac);
-    XtManageChild(menuBar_controls);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(menuBar_controls, (char *)"Controls",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 5); ac++;
-        XtSetArg(args[ac], XmNy, 5); ac++;
-        XtSetArg(args[ac], XmNwidth, 77); ac++;
-        XtSetArg(args[ac], XmNheight, 24); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(menuBar_controls, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        cascadeButton_controls = XmCreateCascadeButton(menuBar_controls,
-            (char *)"cascadeButton_controls",
-            args,
-            ac);
-        XtManageChild(cascadeButton_controls);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 0); ac++;
-    XtSetArg(args[ac], XmNy, 0); ac++;
-    XtSetArg(args[ac], XmNwidth, 240); ac++;
-    XtSetArg(args[ac], XmNheight, 150); ac++;
-    pulldownMenu_controls = XmCreatePulldownMenu(XtParent(cascadeButton_controls),
-        (char *)"pulldownMenu_controls",
-        args,
-        ac);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(pulldownMenu_controls, (char *)"Go To Specified Time...",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_controls, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_goto = XmCreatePushButton(pulldownMenu_controls,
-            (char *)"pushButton_goto",
-            args,
-            ac);
-        XtManageChild(pushButton_goto);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_goto, XmNactivateCallback, BxManageCB, (XtPointer)"bulletinBoard_goto");
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(pulldownMenu_controls, (char *)"Buffer Controls...",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_controls, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_buffer = XmCreatePushButton(pulldownMenu_controls,
-            (char *)"pushButton_buffer",
-            args,
-            ac);
-        XtManageChild(pushButton_buffer);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_buffer, XmNactivateCallback, BxManageCB, (XtPointer)"bulletinBoard_buffer");
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(pulldownMenu_controls, (char *)"Annotation...",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_controls, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_annotation = XmCreatePushButton(pulldownMenu_controls,
-            (char *)"pushButton_annotation",
-            args,
-            ac);
-        XtManageChild(pushButton_annotation);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_annotation, XmNactivateCallback, BxManageCB, (XtPointer)"bulletinBoard_annotation");
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(pulldownMenu_controls, (char *)"Filters...",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_controls, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_filters = XmCreatePushButton(pulldownMenu_controls,
-            (char *)"pushButton_filters",
-            args,
-            ac);
-        XtManageChild(pushButton_filters);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_filters, XmNactivateCallback, BxManageCB, (XtPointer)"bulletinBoard_filters");
-
-    ac = 0;
-    separator7 = XmCreateSeparator(pulldownMenu_controls,
-        (char *)"separator7",
-        args,
-        ac);
-    XtManageChild(separator7);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(pulldownMenu_controls, (char *)"Reverse Right/Left Key Macros",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_controls, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        toggleButton_reverse_keys = XmCreateToggleButton(pulldownMenu_controls,
-            (char *)"toggleButton_reverse_keys",
-            args,
-            ac);
-        XtManageChild(toggleButton_reverse_keys);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(toggleButton_reverse_keys, XmNvalueChangedCallback, do_reverse_keys, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(pulldownMenu_controls, (char *)"Reverse Mouse Buttons",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_controls, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        toggleButton_reverse_mouse = XmCreateToggleButton(pulldownMenu_controls,
-            (char *)"toggleButton_reverse_mouse",
-            args,
-            ac);
-        XtManageChild(toggleButton_reverse_mouse);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(toggleButton_reverse_mouse, XmNvalueChangedCallback, do_reverse_mouse, (XtPointer)0);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNsubMenuId, pulldownMenu_controls); ac++;
-    XtSetValues(cascadeButton_controls, args, ac);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(controls_mbedit, (char *)"About",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 930); ac++;
-        XtSetArg(args[ac], XmNy, 0); ac++;
-        XtSetArg(args[ac], XmNwidth, 80); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(controls_mbedit, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_about = XmCreatePushButton(controls_mbedit,
-            (char *)"pushButton_about",
-            args,
-            ac);
-        XtManageChild(pushButton_about);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_about, XmNactivateCallback, BxManageCB, (XtPointer)"bulletinBoard_about");
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(controls_mbedit, (char *)"Next Buffer",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 620); ac++;
-        XtSetArg(args[ac], XmNy, 0); ac++;
-        XtSetArg(args[ac], XmNwidth, 90); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(controls_mbedit, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_next = XmCreatePushButton(controls_mbedit,
-            (char *)"pushButton_next",
-            args,
-            ac);
-        XtManageChild(pushButton_next);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_next, XmNactivateCallback, do_next_buffer, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(controls_mbedit, (char *)"Done",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 720); ac++;
-        XtSetArg(args[ac], XmNy, 0); ac++;
-        XtSetArg(args[ac], XmNwidth, 80); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(controls_mbedit, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_done = XmCreatePushButton(controls_mbedit,
-            (char *)"pushButton_done",
-            args,
-            ac);
-        XtManageChild(pushButton_done);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_done, XmNactivateCallback, do_done, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(controls_mbedit, (char *)"Forward",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 440); ac++;
-        XtSetArg(args[ac], XmNy, 0); ac++;
-        XtSetArg(args[ac], XmNwidth, 70); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(controls_mbedit, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_forward = XmCreatePushButton(controls_mbedit,
-            (char *)"pushButton_forward",
-            args,
-            ac);
-        XtManageChild(pushButton_forward);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_forward, XmNactivateCallback, do_forward, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(controls_mbedit, (char *)"Reverse",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 370); ac++;
-        XtSetArg(args[ac], XmNy, 0); ac++;
-        XtSetArg(args[ac], XmNwidth, 70); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(controls_mbedit, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_reverse = XmCreatePushButton(controls_mbedit,
-            (char *)"pushButton_reverse",
-            args,
-            ac);
-        XtManageChild(pushButton_reverse);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_reverse, XmNactivateCallback, do_reverse, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(controls_mbedit, (char *)"Quit",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 810); ac++;
-        XtSetArg(args[ac], XmNy, 0); ac++;
-        XtSetArg(args[ac], XmNwidth, 80); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(controls_mbedit, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_quit = XmCreatePushButton(controls_mbedit,
-            (char *)"pushButton_quit",
-            args,
-            ac);
-        XtManageChild(pushButton_quit);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_quit, XmNactivateCallback, do_quit, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(controls_mbedit, (char *)"Acrosstrack Width (m):  1",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_END); ac++;
-        XtSetArg(args[ac], XmNx, 30); ac++;
-        XtSetArg(args[ac], XmNy, 50); ac++;
-        XtSetArg(args[ac], XmNheight, 20); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(controls_mbedit, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        slider_scale_x_label = XmCreateLabel(controls_mbedit,
-            (char *)"slider_scale_x_label",
-            args,
-            ac);
-        XtManageChild(slider_scale_x_label);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNminimum, 1); ac++;
-    XtSetArg(args[ac], XmNvalue, 1000); ac++;
-    XtSetArg(args[ac], XmNmaximum, 20000); ac++;
-    XtSetArg(args[ac], XmNscaleHeight, 15); ac++;
-    XtSetArg(args[ac], XmNshowArrows, TRUE); ac++;
-    XtSetArg(args[ac], XmNscaleMultiple, 1); ac++;
-    XtSetArg(args[ac], XmNshowValue, TRUE); ac++;
-    XtSetArg(args[ac], XmNorientation, XmHORIZONTAL); ac++;
-    XtSetArg(args[ac], XmNx, 210); ac++;
-    XtSetArg(args[ac], XmNy, 40); ac++;
-    XtSetArg(args[ac], XmNwidth, 260); ac++;
-    XtSetArg(args[ac], XmNheight, 34); ac++;
-    XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(controls_mbedit, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-        XmRFontList, 0, &argok)); if (argok) ac++;
-    slider_scale_x = XmCreateScale(controls_mbedit,
-        (char *)"slider_scale_x",
-        args,
-        ac);
-    XtManageChild(slider_scale_x);
-    XtAddCallback(slider_scale_x, XmNvalueChangedCallback, do_scale_x, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(controls_mbedit, (char *)"20000",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
-        XtSetArg(args[ac], XmNx, 470); ac++;
-        XtSetArg(args[ac], XmNy, 50); ac++;
-        XtSetArg(args[ac], XmNwidth, 60); ac++;
-        XtSetArg(args[ac], XmNheight, 20); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(controls_mbedit, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        slider_scale_x_max_label = XmCreateLabel(controls_mbedit,
-            (char *)"slider_scale_x_max_label",
-            args,
-            ac);
-        XtManageChild(slider_scale_x_max_label);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(controls_mbedit, (char *)"Vertical Exaggeration: 0.01",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_END); ac++;
-        XtSetArg(args[ac], XmNx, 20); ac++;
-        XtSetArg(args[ac], XmNy, 90); ac++;
-        XtSetArg(args[ac], XmNheight, 20); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(controls_mbedit, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        slider_scale_y_label = XmCreateLabel(controls_mbedit,
-            (char *)"slider_scale_y_label",
-            args,
-            ac);
-        XtManageChild(slider_scale_y_label);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNminimum, 1); ac++;
-    XtSetArg(args[ac], XmNdecimalPoints, 2); ac++;
-    XtSetArg(args[ac], XmNvalue, 100); ac++;
-    XtSetArg(args[ac], XmNmaximum, 2000); ac++;
-    XtSetArg(args[ac], XmNscaleHeight, 15); ac++;
-    XtSetArg(args[ac], XmNshowArrows, TRUE); ac++;
-    XtSetArg(args[ac], XmNscaleMultiple, 1); ac++;
-    XtSetArg(args[ac], XmNshowValue, TRUE); ac++;
-    XtSetArg(args[ac], XmNorientation, XmHORIZONTAL); ac++;
-    XtSetArg(args[ac], XmNx, 210); ac++;
-    XtSetArg(args[ac], XmNy, 80); ac++;
-    XtSetArg(args[ac], XmNwidth, 260); ac++;
-    XtSetArg(args[ac], XmNheight, 34); ac++;
-    XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(controls_mbedit, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-        XmRFontList, 0, &argok)); if (argok) ac++;
-    slider_scale_y = XmCreateScale(controls_mbedit,
-        (char *)"slider_scale_y",
-        args,
-        ac);
-    XtManageChild(slider_scale_y);
-    XtAddCallback(slider_scale_y, XmNvalueChangedCallback, do_scale_y, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(controls_mbedit, (char *)"20.00",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
-        XtSetArg(args[ac], XmNx, 470); ac++;
-        XtSetArg(args[ac], XmNy, 90); ac++;
-        XtSetArg(args[ac], XmNwidth, 65); ac++;
-        XtSetArg(args[ac], XmNheight, 20); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(controls_mbedit, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        slider_scale_y_max_label = XmCreateLabel(controls_mbedit,
-            (char *)"slider_scale_y_max_label",
-            args,
-            ac);
-        XtManageChild(slider_scale_y_max_label);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(controls_mbedit, (char *)"Pings shown:   1",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_END); ac++;
-        XtSetArg(args[ac], XmNx, 550); ac++;
-        XtSetArg(args[ac], XmNy, 50); ac++;
-        XtSetArg(args[ac], XmNheight, 20); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(controls_mbedit, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        slider_number_pings_label = XmCreateLabel(controls_mbedit,
-            (char *)"slider_number_pings_label",
-            args,
-            ac);
-        XtManageChild(slider_number_pings_label);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNminimum, 1); ac++;
-    XtSetArg(args[ac], XmNvalue, 10); ac++;
-    XtSetArg(args[ac], XmNmaximum, 20); ac++;
-    XtSetArg(args[ac], XmNscaleHeight, 15); ac++;
-    XtSetArg(args[ac], XmNshowArrows, TRUE); ac++;
-    XtSetArg(args[ac], XmNscaleMultiple, 1); ac++;
-    XtSetArg(args[ac], XmNshowValue, TRUE); ac++;
-    XtSetArg(args[ac], XmNorientation, XmHORIZONTAL); ac++;
-    XtSetArg(args[ac], XmNx, 670); ac++;
-    XtSetArg(args[ac], XmNy, 40); ac++;
-    XtSetArg(args[ac], XmNwidth, 290); ac++;
-    XtSetArg(args[ac], XmNheight, 34); ac++;
-    XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(controls_mbedit, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-        XmRFontList, 0, &argok)); if (argok) ac++;
-    slider_number_pings = XmCreateScale(controls_mbedit,
-        (char *)"slider_number_pings",
-        args,
-        ac);
-    XtManageChild(slider_number_pings);
-    XtAddCallback(slider_number_pings, XmNvalueChangedCallback, do_number_pings, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(controls_mbedit, (char *)"20",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
-        XtSetArg(args[ac], XmNx, 960); ac++;
-        XtSetArg(args[ac], XmNy, 50); ac++;
-        XtSetArg(args[ac], XmNwidth, 50); ac++;
-        XtSetArg(args[ac], XmNheight, 20); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(controls_mbedit, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        slider_num_pings_max_label = XmCreateLabel(controls_mbedit,
-            (char *)"slider_num_pings_max_label",
-            args,
-            ac);
-        XtManageChild(slider_num_pings_max_label);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(controls_mbedit, (char *)"Pings to step:  1",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_END); ac++;
-        XtSetArg(args[ac], XmNx, 550); ac++;
-        XtSetArg(args[ac], XmNy, 90); ac++;
-        XtSetArg(args[ac], XmNheight, 20); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(controls_mbedit, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        slider_number_step_label = XmCreateLabel(controls_mbedit,
-            (char *)"slider_number_step_label",
-            args,
-            ac);
-        XtManageChild(slider_number_step_label);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNminimum, 1); ac++;
-    XtSetArg(args[ac], XmNvalue, 5); ac++;
-    XtSetArg(args[ac], XmNmaximum, 20); ac++;
-    XtSetArg(args[ac], XmNscaleHeight, 15); ac++;
-    XtSetArg(args[ac], XmNshowArrows, TRUE); ac++;
-    XtSetArg(args[ac], XmNscaleMultiple, 1); ac++;
-    XtSetArg(args[ac], XmNshowValue, TRUE); ac++;
-    XtSetArg(args[ac], XmNorientation, XmHORIZONTAL); ac++;
-    XtSetArg(args[ac], XmNx, 670); ac++;
-    XtSetArg(args[ac], XmNy, 80); ac++;
-    XtSetArg(args[ac], XmNwidth, 290); ac++;
-    XtSetArg(args[ac], XmNheight, 34); ac++;
-    XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(controls_mbedit, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-        XmRFontList, 0, &argok)); if (argok) ac++;
-    slider_number_step = XmCreateScale(controls_mbedit,
-        (char *)"slider_number_step",
-        args,
-        ac);
-    XtManageChild(slider_number_step);
-    XtAddCallback(slider_number_step, XmNvalueChangedCallback, do_number_step, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(controls_mbedit, (char *)"20",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
-        XtSetArg(args[ac], XmNx, 960); ac++;
-        XtSetArg(args[ac], XmNy, 90); ac++;
-        XtSetArg(args[ac], XmNwidth, 50); ac++;
-        XtSetArg(args[ac], XmNheight, 20); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(controls_mbedit, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        slider_number_max_step_label = XmCreateLabel(controls_mbedit,
-            (char *)"slider_number_max_step_label",
-            args,
-            ac);
-        XtManageChild(slider_number_max_step_label);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(controls_mbedit, (char *)"Mode:",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNmarginWidth, 0); ac++;
-        XtSetArg(args[ac], XmNx, 70); ac++;
-        XtSetArg(args[ac], XmNy, 120); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(controls_mbedit, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        setting_mode_label = XmCreateLabel(controls_mbedit,
-            (char *)"setting_mode_label",
-            args,
-            ac);
-        XtManageChild(setting_mode_label);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNnumColumns, 1); ac++;
-    XtSetArg(args[ac], XmNpacking, XmPACK_TIGHT); ac++;
-    XtSetArg(args[ac], XmNradioBehavior, True); ac++;
-    XtSetArg(args[ac], XmNspacing, 0); ac++;
-    XtSetArg(args[ac], XmNorientation, XmHORIZONTAL); ac++;
-    XtSetArg(args[ac], XmNx, 120); ac++;
-    XtSetArg(args[ac], XmNy, 120); ac++;
-    XtSetArg(args[ac], XmNwidth, 405); ac++;
-    XtSetArg(args[ac], XmNheight, 34); ac++;
-    setting_mode = XmCreateRowColumn(controls_mbedit,
-        (char *)"setting_mode",
-        args,
-        ac);
-    XtManageChild(setting_mode);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(setting_mode, (char *)"Toggle",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNwidth, 75); ac++;
-        XtSetArg(args[ac], XmNheight, 28); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(setting_mode, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        setting_mode_toggle_toggle = XmCreateToggleButton(setting_mode,
-            (char *)"setting_mode_toggle_toggle",
-            args,
-            ac);
-        XtManageChild(setting_mode_toggle_toggle);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(setting_mode_toggle_toggle, XmNvalueChangedCallback, do_mode_toggle, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(setting_mode, (char *)"Pick",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(setting_mode, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        setting_mode_toggle_pick = XmCreateToggleButton(setting_mode,
-            (char *)"setting_mode_toggle_pick",
-            args,
-            ac);
-        XtManageChild(setting_mode_toggle_pick);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(setting_mode_toggle_pick, XmNvalueChangedCallback, do_mode_pick, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(setting_mode, (char *)"Erase",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(setting_mode, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        setting_mode_toggle_erase = XmCreateToggleButton(setting_mode,
-            (char *)"setting_mode_toggle_erase",
-            args,
-            ac);
-        XtManageChild(setting_mode_toggle_erase);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(setting_mode_toggle_erase, XmNvalueChangedCallback, do_mode_erase, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(setting_mode, (char *)"Restore",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(setting_mode, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        setting_mode_toggle_restore = XmCreateToggleButton(setting_mode,
-            (char *)"setting_mode_toggle_restore",
-            args,
-            ac);
-        XtManageChild(setting_mode_toggle_restore);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(setting_mode_toggle_restore, XmNvalueChangedCallback, do_mode_restore, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(setting_mode, (char *)"Grab",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNwidth, 62); ac++;
-        XtSetArg(args[ac], XmNheight, 28); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(setting_mode, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        setting_mode_toggle_grab = XmCreateToggleButton(setting_mode,
-            (char *)"setting_mode_toggle_grab",
-            args,
-            ac);
-        XtManageChild(setting_mode_toggle_grab);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(setting_mode_toggle_grab, XmNvalueChangedCallback, do_mode_grab, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(setting_mode, (char *)"Info",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNwidth, 54); ac++;
-        XtSetArg(args[ac], XmNheight, 28); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(setting_mode, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        setting_mode_toggle_info = XmCreateToggleButton(setting_mode,
-            (char *)"setting_mode_toggle_info",
-            args,
-            ac);
-        XtManageChild(setting_mode_toggle_info);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(setting_mode_toggle_info, XmNvalueChangedCallback, do_mode_info, (XtPointer)0);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNborderWidth, 1); ac++;
-    XtSetArg(args[ac], XmNbackground,
-        BX_CONVERT(mbedit_bboard, (char *)"white",
-        XmRPixel, 0, &argok)); if (argok) ac++;
-    XtSetArg(args[ac], XmNresizePolicy, XmRESIZE_GROW); ac++;
-    XtSetArg(args[ac], XmNx, 0); ac++;
-    XtSetArg(args[ac], XmNy, 150); ac++;
-    XtSetArg(args[ac], XmNwidth, 1010); ac++;
-    XtSetArg(args[ac], XmNheight, 510); ac++;
-    canvas_mbedit = XmCreateDrawingArea(mbedit_bboard,
-        (char *)"canvas_mbedit",
-        args,
-        ac);
-    XtManageChild(canvas_mbedit);
-    XtAddCallback(canvas_mbedit, XmNinputCallback, do_event, (XtPointer)0);
-    XtAddCallback(canvas_mbedit, XmNexposeCallback, do_expose, (XtPointer)0);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNtitle, "Open Source Swath Sonar Data File"); ac++;
-    XtSetArg(args[ac], XmNdeleteResponse, XmUNMAP); ac++;
-    XtSetArg(args[ac], XmNwidth, 529); ac++;
-    XtSetArg(args[ac], XmNheight, 489); ac++;
-    xmDialogShell_file = XmCreateDialogShell(window_mbedit,
-        (char *)"xmDialogShell_file",
-        args,
-        ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNautoUnmanage, False); ac++;
-    XtSetArg(args[ac], XmNresizePolicy, XmRESIZE_GROW); ac++;
-    XtSetArg(args[ac], XmNx, 1016); ac++;
-    XtSetArg(args[ac], XmNy, 1092); ac++;
-    XtSetArg(args[ac], XmNwidth, 529); ac++;
-    XtSetArg(args[ac], XmNheight, 489); ac++;
-    bulletinBoard_file = XtCreateWidget((char *)"bulletinBoard_file",
-        xmBulletinBoardWidgetClass,
-        xmDialogShell_file,
-        args,
-        ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNmarginHeight, 0); ac++;
-    XtSetArg(args[ac], XmNmarginWidth, 0); ac++;
-    XtSetArg(args[ac], XmNresizePolicy, XmRESIZE_GROW); ac++;
-    XtSetArg(args[ac], XmNx, 10); ac++;
-    XtSetArg(args[ac], XmNy, 10); ac++;
-    XtSetArg(args[ac], XmNwidth, 500); ac++;
-    XtSetArg(args[ac], XmNheight, 400); ac++;
-    fileSelectionBox = XmCreateFileSelectionBox(bulletinBoard_file,
-        (char *)"fileSelectionBox",
-        args,
-        ac);
-    XtManageChild(fileSelectionBox);
-    XtAddCallback(fileSelectionBox, XmNokCallback, do_load_check, (XtPointer)0);
-    XtAddCallback(fileSelectionBox, XmNokCallback, BxUnmanageCB, (XtPointer)"bulletinBoard_file");
-    XtAddCallback(fileSelectionBox, XmNcancelCallback, BxUnmanageCB, (XtPointer)"bulletinBoard_file");
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_file, (char *)"MBIO Format ID:",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 430); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_file, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        textfield_format_label = XmCreateLabel(bulletinBoard_file,
-            (char *)"textfield_format_label",
-            args,
-            ac);
-        XtManageChild(textfield_format_label);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNvalue, "41"); ac++;
-    XtSetArg(args[ac], XmNcolumns, 3); ac++;
-    XtSetArg(args[ac], XmNmaxLength, 3); ac++;
-    XtSetArg(args[ac], XmNx, 140); ac++;
-    XtSetArg(args[ac], XmNy, 420); ac++;
-    XtSetArg(args[ac], XmNheight, 40); ac++;
-    XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(bulletinBoard_file, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-        XmRFontList, 0, &argok)); if (argok) ac++;
-    textfield_format = XmCreateTextField(bulletinBoard_file,
-        (char *)"textfield_format",
-        args,
-        ac);
-    XtManageChild(textfield_format);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_file, (char *)"Output Mode:",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNmarginWidth, 0); ac++;
-        XtSetArg(args[ac], XmNx, 210); ac++;
-        XtSetArg(args[ac], XmNy, 430); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_file, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        setting_output_label = XmCreateLabel(bulletinBoard_file,
-            (char *)"setting_output_label",
-            args,
-            ac);
-        XtManageChild(setting_output_label);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNnumColumns, 1); ac++;
-    XtSetArg(args[ac], XmNpacking, XmPACK_COLUMN); ac++;
-    XtSetArg(args[ac], XmNradioBehavior, True); ac++;
-    XtSetArg(args[ac], XmNspacing, 0); ac++;
-    XtSetArg(args[ac], XmNorientation, XmVERTICAL); ac++;
-    XtSetArg(args[ac], XmNx, 310); ac++;
-    XtSetArg(args[ac], XmNy, 420); ac++;
-    XtSetArg(args[ac], XmNwidth, 122); ac++;
-    XtSetArg(args[ac], XmNheight, 62); ac++;
-    setting_output = XmCreateRowColumn(bulletinBoard_file,
-        (char *)"setting_output",
-        args,
-        ac);
-    XtManageChild(setting_output);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(setting_output, (char *)"Output Edits",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNwidth, 116); ac++;
-        XtSetArg(args[ac], XmNheight, 28); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(setting_output, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        setting_output_toggle_edit = XmCreateToggleButton(setting_output,
-            (char *)"setting_output_toggle_edit",
-            args,
-            ac);
-        XtManageChild(setting_output_toggle_edit);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(setting_output_toggle_edit, XmNvalueChangedCallback, do_output_edit, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(setting_output, (char *)"Browse Only",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(setting_output, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        setting_output_toggle_browse = XmCreateToggleButton(setting_output,
-            (char *)"setting_output_toggle_browse",
-            args,
-            ac);
-        XtManageChild(setting_output_toggle_browse);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(setting_output_toggle_browse, XmNvalueChangedCallback, do_output_browse, (XtPointer)0);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNtitle, "Go To Specified Time"); ac++;
-    XtSetArg(args[ac], XmNdeleteResponse, XmUNMAP); ac++;
-    XtSetArg(args[ac], XmNwidth, 196); ac++;
-    XtSetArg(args[ac], XmNheight, 346); ac++;
-    xmDialogShell_goto = XmCreateDialogShell(window_mbedit,
-        (char *)"xmDialogShell_goto",
-        args,
-        ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNresizePolicy, XmRESIZE_GROW); ac++;
-    XtSetArg(args[ac], XmNx, 0); ac++;
-    XtSetArg(args[ac], XmNy, 1164); ac++;
-    XtSetArg(args[ac], XmNwidth, 196); ac++;
-    XtSetArg(args[ac], XmNheight, 346); ac++;
-    bulletinBoard_goto = XtCreateWidget((char *)"bulletinBoard_goto",
-        xmBulletinBoardWidgetClass,
-        xmDialogShell_goto,
-        args,
-        ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNvalue, "1"); ac++;
-    XtSetArg(args[ac], XmNcolumns, 2); ac++;
-    XtSetArg(args[ac], XmNx, 90); ac++;
-    XtSetArg(args[ac], XmNy, 90); ac++;
-    XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(bulletinBoard_goto, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-        XmRFontList, 0, &argok)); if (argok) ac++;
-    textfield_day = XmCreateTextField(bulletinBoard_goto,
-        (char *)"textfield_day",
-        args,
-        ac);
-    XtManageChild(textfield_day);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_goto, (char *)"Cancel",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 100); ac++;
-        XtSetArg(args[ac], XmNy, 270); ac++;
-        XtSetArg(args[ac], XmNwidth, 75); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_goto, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        button_goto_cancel = XmCreatePushButton(bulletinBoard_goto,
-            (char *)"button_goto_cancel",
-            args,
-            ac);
-        XtManageChild(button_goto_cancel);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(button_goto_cancel, XmNactivateCallback, BxUnmanageCB, (XtPointer)"bulletinBoard_goto");
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_goto, (char *)"Apply",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 270); ac++;
-        XtSetArg(args[ac], XmNwidth, 75); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_goto, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        button_goto_apply = XmCreatePushButton(bulletinBoard_goto,
-            (char *)"button_goto_apply",
-            args,
-            ac);
-        XtManageChild(button_goto_apply);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(button_goto_apply, XmNactivateCallback, do_goto_apply, (XtPointer)0);
-    XtAddCallback(button_goto_apply, XmNactivateCallback, BxUnmanageCB, (XtPointer)"bulletinBoard_goto");
-
-    ac = 0;
-    XtSetArg(args[ac], XmNvalue, "0"); ac++;
-    XtSetArg(args[ac], XmNcolumns, 2); ac++;
-    XtSetArg(args[ac], XmNx, 90); ac++;
-    XtSetArg(args[ac], XmNy, 210); ac++;
-    XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(bulletinBoard_goto, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-        XmRFontList, 0, &argok)); if (argok) ac++;
-    textfield_second = XmCreateTextField(bulletinBoard_goto,
-        (char *)"textfield_second",
-        args,
-        ac);
-    XtManageChild(textfield_second);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNvalue, "1"); ac++;
-    XtSetArg(args[ac], XmNcolumns, 2); ac++;
-    XtSetArg(args[ac], XmNx, 90); ac++;
-    XtSetArg(args[ac], XmNy, 170); ac++;
-    XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(bulletinBoard_goto, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-        XmRFontList, 0, &argok)); if (argok) ac++;
-    textfield_minute = XmCreateTextField(bulletinBoard_goto,
-        (char *)"textfield_minute",
-        args,
-        ac);
-    XtManageChild(textfield_minute);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNvalue, "1"); ac++;
-    XtSetArg(args[ac], XmNcolumns, 2); ac++;
-    XtSetArg(args[ac], XmNx, 90); ac++;
-    XtSetArg(args[ac], XmNy, 130); ac++;
-    XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(bulletinBoard_goto, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-        XmRFontList, 0, &argok)); if (argok) ac++;
-    textfield_hour = XmCreateTextField(bulletinBoard_goto,
-        (char *)"textfield_hour",
-        args,
-        ac);
-    XtManageChild(textfield_hour);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNvalue, "1"); ac++;
-    XtSetArg(args[ac], XmNcolumns, 2); ac++;
-    XtSetArg(args[ac], XmNx, 90); ac++;
-    XtSetArg(args[ac], XmNy, 50); ac++;
-    XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(bulletinBoard_goto, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-        XmRFontList, 0, &argok)); if (argok) ac++;
-    textfield_month = XmCreateTextField(bulletinBoard_goto,
-        (char *)"textfield_month",
-        args,
-        ac);
-    XtManageChild(textfield_month);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNvalue, "1994"); ac++;
-    XtSetArg(args[ac], XmNcolumns, 4); ac++;
-    XtSetArg(args[ac], XmNx, 90); ac++;
-    XtSetArg(args[ac], XmNy, 10); ac++;
-    XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(bulletinBoard_goto, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-        XmRFontList, 0, &argok)); if (argok) ac++;
-    textfield_year = XmCreateTextField(bulletinBoard_goto,
-        (char *)"textfield_year",
-        args,
-        ac);
-    XtManageChild(textfield_year);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_goto, (char *)"Second:",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_END); ac++;
-        XtSetArg(args[ac], XmNx, 20); ac++;
-        XtSetArg(args[ac], XmNy, 210); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_goto, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        textfield_second_label = XmCreateLabel(bulletinBoard_goto,
-            (char *)"textfield_second_label",
-            args,
-            ac);
-        XtManageChild(textfield_second_label);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_goto, (char *)"Minute:",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_END); ac++;
-        XtSetArg(args[ac], XmNx, 20); ac++;
-        XtSetArg(args[ac], XmNy, 170); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_goto, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        textfield_minute_label = XmCreateLabel(bulletinBoard_goto,
-            (char *)"textfield_minute_label",
-            args,
-            ac);
-        XtManageChild(textfield_minute_label);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_goto, (char *)"Hour:",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_END); ac++;
-        XtSetArg(args[ac], XmNx, 30); ac++;
-        XtSetArg(args[ac], XmNy, 130); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_goto, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        textfield_hour_label = XmCreateLabel(bulletinBoard_goto,
-            (char *)"textfield_hour_label",
-            args,
-            ac);
-        XtManageChild(textfield_hour_label);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_goto, (char *)"Day:",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_END); ac++;
-        XtSetArg(args[ac], XmNx, 40); ac++;
-        XtSetArg(args[ac], XmNy, 90); ac++;
-        XtSetArg(args[ac], XmNwidth, 40); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_goto, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        textfield_day_label = XmCreateLabel(bulletinBoard_goto,
-            (char *)"textfield_day_label",
-            args,
-            ac);
-        XtManageChild(textfield_day_label);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_goto, (char *)"Month:",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_END); ac++;
-        XtSetArg(args[ac], XmNx, 30); ac++;
-        XtSetArg(args[ac], XmNy, 50); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_goto, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        textfield_month_label = XmCreateLabel(bulletinBoard_goto,
-            (char *)"textfield_month_label",
-            args,
-            ac);
-        XtManageChild(textfield_month_label);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_goto, (char *)"Year:",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_END); ac++;
-        XtSetArg(args[ac], XmNx, 40); ac++;
-        XtSetArg(args[ac], XmNy, 10); ac++;
-        XtSetArg(args[ac], XmNheight, 40); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_goto, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        textfield_year_label = XmCreateLabel(bulletinBoard_goto,
-            (char *)"textfield_year_label",
-            args,
-            ac);
-        XtManageChild(textfield_year_label);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNtitle, "About MBedit"); ac++;
-    XtSetArg(args[ac], XmNdeleteResponse, XmUNMAP); ac++;
-    XtSetArg(args[ac], XmNwidth, 473); ac++;
-    XtSetArg(args[ac], XmNheight, 501); ac++;
-    xmDialogShell_about = XmCreateDialogShell(window_mbedit,
-        (char *)"xmDialogShell_about",
-        args,
-        ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNresizePolicy, XmRESIZE_GROW); ac++;
-    XtSetArg(args[ac], XmNx, 0); ac++;
-    XtSetArg(args[ac], XmNy, 1086); ac++;
-    XtSetArg(args[ac], XmNwidth, 473); ac++;
-    XtSetArg(args[ac], XmNheight, 501); ac++;
-    bulletinBoard_about = XtCreateWidget((char *)"bulletinBoard_about",
-        xmBulletinBoardWidgetClass,
-        xmDialogShell_about,
-        args,
-        ac);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_about, (char *)"David W. Caress    and    Dale N. Chayes",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_about, (char *)"-*-"SERIF"-bold-r-*-*-*-140-*-*-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 260); ac++;
-        XtSetArg(args[ac], XmNwidth, 450); ac++;
-        XtSetArg(args[ac], XmNheight, 20); ac++;
-        label_about_create1 = XmCreateLabel(bulletinBoard_about,
-            (char *)"label_about_create1",
-            args,
-            ac);
-        XtManageChild(label_about_create1);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 10); ac++;
-    XtSetArg(args[ac], XmNy, 220); ac++;
-    XtSetArg(args[ac], XmNwidth, 450); ac++;
-    XtSetArg(args[ac], XmNheight, 20); ac++;
-    separator1 = XmCreateSeparator(bulletinBoard_about,
-        (char *)"separator1",
-        args,
-        ac);
-    XtManageChild(separator1);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_about, (char *)"Dismiss",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_about, (char *)"-*-"SERIF"-bold-r-*-*-*-140-*-*-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 190); ac++;
-        XtSetArg(args[ac], XmNy, 410); ac++;
-        XtSetArg(args[ac], XmNwidth, 90); ac++;
-        XtSetArg(args[ac], XmNheight, 35); ac++;
-        pushButton_about_dismiss = XmCreatePushButton(bulletinBoard_about,
-            (char *)"pushButton_about_dismiss",
-            args,
-            ac);
-        XtManageChild(pushButton_about_dismiss);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_about_dismiss, XmNactivateCallback, BxUnmanageCB, (XtPointer)"bulletinBoard_about");
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_about, (char *)"Created by:",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_about, (char *)"-*-"SERIF"-bold-r-*-*-*-140-*-*-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 240); ac++;
-        XtSetArg(args[ac], XmNwidth, 450); ac++;
-        XtSetArg(args[ac], XmNheight, 20); ac++;
-        label_about_create = XmCreateLabel(bulletinBoard_about,
-            (char *)"label_about_create",
-            args,
-            ac);
-        XtManageChild(label_about_create);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_about, (char *)":::t\"Lamont-Doherty\":t\"Earth Observatory\"\"of Columbia University\"",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_about, (char *)"-*-"SERIF"-bold-r-*-*-*-120-*-*-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 250); ac++;
-        XtSetArg(args[ac], XmNy, 280); ac++;
-        XtSetArg(args[ac], XmNwidth, 190); ac++;
-        XtSetArg(args[ac], XmNheight, 60); ac++;
-        label_about_lamont = XmCreateLabel(bulletinBoard_about,
-            (char *)"label_about_lamont",
-            args,
-            ac);
-        XtManageChild(label_about_lamont);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_about, (char *)":::t\"Monterey Bay\":t\"Aquarium\"\"Research Institute\"",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_about, (char *)"-*-"SERIF"-bold-r-*-*-*-120-*-*-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 60); ac++;
-        XtSetArg(args[ac], XmNy, 280); ac++;
-        XtSetArg(args[ac], XmNwidth, 160); ac++;
-        XtSetArg(args[ac], XmNheight, 60); ac++;
-        label_about_columbia = XmCreateLabel(bulletinBoard_about,
-            (char *)"label_about_columbia",
-            args,
-            ac);
-        XtManageChild(label_about_columbia);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_about, (char *)"MB-System",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_about, (char *)"-*-"SERIF"-bold-r-*-*-*-240-*-*-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 120); ac++;
-        XtSetArg(args[ac], XmNwidth, 450); ac++;
-        XtSetArg(args[ac], XmNheight, 38); ac++;
-        label_about_mbsystem = XmCreateLabel(bulletinBoard_about,
-            (char *)"label_about_mbsystem",
-            args,
-            ac);
-        XtManageChild(label_about_mbsystem);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_about, (char *)"An Open Source Software Package",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_about, (char *)"-*-"SERIF"-bold-r-*-*-*-140-*-*-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 160); ac++;
-        XtSetArg(args[ac], XmNwidth, 450); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        label_about_mbpub = XmCreateLabel(bulletinBoard_about,
-            (char *)"label_about_mbpub",
-            args,
-            ac);
-        XtManageChild(label_about_mbpub);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_about, (char *)"One Component of the",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_about, (char *)"-*-"SERIF"-bold-r-*-*-*-140-*-*-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 90); ac++;
-        XtSetArg(args[ac], XmNwidth, 450); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        label_about_component = XmCreateLabel(bulletinBoard_about,
-            (char *)"label_about_component",
-            args,
-            ac);
-        XtManageChild(label_about_component);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_about, (char *)"for Processing and Display of Swath Sonar Data",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_about, (char *)"-*-"SERIF"-bold-r-*-*-*-140-*-*-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 190); ac++;
-        XtSetArg(args[ac], XmNwidth, 450); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        label_about_for = XmCreateLabel(bulletinBoard_about,
-            (char *)"label_about_for",
-            args,
-            ac);
-        XtManageChild(label_about_for);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 10); ac++;
-    XtSetArg(args[ac], XmNy, 70); ac++;
-    XtSetArg(args[ac], XmNwidth, 450); ac++;
-    XtSetArg(args[ac], XmNheight, 20); ac++;
-    separator = XmCreateSeparator(bulletinBoard_about,
-        (char *)"separator",
-        args,
-        ac);
-    XtManageChild(separator);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_about, (char *)":::t\"MB-System Release 4.6\"\"April 14, 1999\"",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_about, (char *)"-*-"SERIF"-medium-r-*-*-*-140-*-*-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 340); ac++;
-        XtSetArg(args[ac], XmNwidth, 450); ac++;
-        XtSetArg(args[ac], XmNheight, 70); ac++;
-        label_about_version = XmCreateLabel(bulletinBoard_about,
-            (char *)"label_about_version",
-            args,
-            ac);
-        XtManageChild(label_about_version);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_about, (char *)"Interactive Swath Bathymetry Editor",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_about, (char *)"-*-"SERIF"-bold-r-*-*-*-180-*-*-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 40); ac++;
-        XtSetArg(args[ac], XmNwidth, 450); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        label_about_function = XmCreateLabel(bulletinBoard_about,
-            (char *)"label_about_function",
-            args,
-            ac);
-        XtManageChild(label_about_function);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_about, (char *)"MBedit",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_about, (char *)"-*-"SERIF"-bold-r-*-*-*-240-*-*-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 10); ac++;
-        XtSetArg(args[ac], XmNwidth, 450); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        label_about_mbedit = XmCreateLabel(bulletinBoard_about,
-            (char *)"label_about_mbedit",
-            args,
-            ac);
-        XtManageChild(label_about_mbedit);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNtitle, "Please Wait..."); ac++;
-    XtSetArg(args[ac], XmNmwmInputMode, MWM_INPUT_MODELESS); ac++;
-    XtSetArg(args[ac], XmNdeleteResponse, XmUNMAP); ac++;
-    XtSetArg(args[ac], XmNwidth, 496); ac++;
-    XtSetArg(args[ac], XmNheight, 112); ac++;
-    xmDialogShell_message = XmCreateDialogShell(window_mbedit,
-        (char *)"xmDialogShell_message",
-        args,
-        ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNdialogStyle, XmDIALOG_FULL_APPLICATION_MODAL); ac++;
-    XtSetArg(args[ac], XmNresizePolicy, XmRESIZE_NONE); ac++;
-    XtSetArg(args[ac], XmNx, 0); ac++;
-    XtSetArg(args[ac], XmNy, 1281); ac++;
-    XtSetArg(args[ac], XmNwidth, 496); ac++;
-    XtSetArg(args[ac], XmNheight, 112); ac++;
-    bulletinBoard_message = XtCreateWidget((char *)"bulletinBoard_message",
-        xmBulletinBoardWidgetClass,
-        xmDialogShell_message,
-        args,
-        ac);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_message, (char *)"Thank you for your patience.",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 40); ac++;
-        XtSetArg(args[ac], XmNwidth, 360); ac++;
-        XtSetArg(args[ac], XmNheight, 20); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_message, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        label_pleasewait = XmCreateLabel(bulletinBoard_message,
-            (char *)"label_pleasewait",
-            args,
-            ac);
-        XtManageChild(label_pleasewait);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_message, (char *)"MBedit is loading data...",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 10); ac++;
-        XtSetArg(args[ac], XmNwidth, 480); ac++;
-        XtSetArg(args[ac], XmNheight, 20); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_message, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        label_message = XmCreateLabel(bulletinBoard_message,
-            (char *)"label_message",
-            args,
-            ac);
-        XtManageChild(label_message);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNtitle, "Use MBedit edit save file?"); ac++;
-    XtSetArg(args[ac], XmNdeleteResponse, XmUNMAP); ac++;
-    XtSetArg(args[ac], XmNwidth, 431); ac++;
-    XtSetArg(args[ac], XmNheight, 177); ac++;
-    xmDialogShell_editsave = XmCreateDialogShell(window_mbedit,
-        (char *)"xmDialogShell_editsave",
-        args,
-        ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNdialogStyle, XmDIALOG_FULL_APPLICATION_MODAL); ac++;
-    XtSetArg(args[ac], XmNresizePolicy, XmRESIZE_GROW); ac++;
-    XtSetArg(args[ac], XmNx, 0); ac++;
-    XtSetArg(args[ac], XmNy, 1248); ac++;
-    XtSetArg(args[ac], XmNwidth, 431); ac++;
-    XtSetArg(args[ac], XmNheight, 177); ac++;
-    bulletinBoard_editsave = XtCreateWidget((char *)"bulletinBoard_editsave",
-        xmBulletinBoardWidgetClass,
-        xmDialogShell_editsave,
-        args,
-        ac);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_editsave, (char *)"An edit save file exists for the specified input data file...",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 10); ac++;
-        XtSetArg(args[ac], XmNwidth, 410); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_editsave, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        label_editsave_one = XmCreateLabel(bulletinBoard_editsave,
-            (char *)"label_editsave_one",
-            args,
-            ac);
-        XtManageChild(label_editsave_one);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_editsave, (char *)"Do you want to apply the saved edits to the data?",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 40); ac++;
-        XtSetArg(args[ac], XmNwidth, 410); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_editsave, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        label_editsave_two = XmCreateLabel(bulletinBoard_editsave,
-            (char *)"label_editsave_two",
-            args,
-            ac);
-        XtManageChild(label_editsave_two);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_editsave, (char *)"No",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 250); ac++;
-        XtSetArg(args[ac], XmNy, 80); ac++;
-        XtSetArg(args[ac], XmNwidth, 90); ac++;
-        XtSetArg(args[ac], XmNheight, 40); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_editsave, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_editsave_no = XmCreatePushButton(bulletinBoard_editsave,
-            (char *)"pushButton_editsave_no",
-            args,
-            ac);
-        XtManageChild(pushButton_editsave_no);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_editsave_no, XmNactivateCallback, do_load_ok, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_editsave, (char *)"Yes",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 100); ac++;
-        XtSetArg(args[ac], XmNy, 80); ac++;
-        XtSetArg(args[ac], XmNwidth, 90); ac++;
-        XtSetArg(args[ac], XmNheight, 40); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_editsave, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_editsave_yes = XmCreatePushButton(bulletinBoard_editsave,
-            (char *)"pushButton_editsave_yes",
-            args,
-            ac);
-        XtManageChild(pushButton_editsave_yes);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_editsave_yes, XmNactivateCallback, do_load_ok_with_save, (XtPointer)0);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNtitle, "Error"); ac++;
-    XtSetArg(args[ac], XmNwidth, 311); ac++;
-    XtSetArg(args[ac], XmNheight, 205); ac++;
-    xmDialogShell_error = XmCreateDialogShell(window_mbedit,
-        (char *)"xmDialogShell_error",
-        args,
-        ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNdialogStyle, XmDIALOG_APPLICATION_MODAL); ac++;
-    XtSetArg(args[ac], XmNresizePolicy, XmRESIZE_GROW); ac++;
-    XtSetArg(args[ac], XmNx, 0); ac++;
-    XtSetArg(args[ac], XmNy, 1234); ac++;
-    XtSetArg(args[ac], XmNwidth, 311); ac++;
-    XtSetArg(args[ac], XmNheight, 205); ac++;
-    bulletinBoard_error = XtCreateWidget((char *)"bulletinBoard_error",
-        xmBulletinBoardWidgetClass,
-        xmDialogShell_error,
-        args,
-        ac);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_error, (char *)"You probably do not have write",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 40); ac++;
-        XtSetArg(args[ac], XmNwidth, 290); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_error, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        label_error_two = XmCreateLabel(bulletinBoard_error,
-            (char *)"label_error_two",
-            args,
-            ac);
-        XtManageChild(label_error_two);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_error, (char *)"Unable to open output file.",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 10); ac++;
-        XtSetArg(args[ac], XmNwidth, 290); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_error, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        label_error_one = XmCreateLabel(bulletinBoard_error,
-            (char *)"label_error_one",
-            args,
-            ac);
-        XtManageChild(label_error_one);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_error, (char *)"permission in this directory!",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 70); ac++;
-        XtSetArg(args[ac], XmNwidth, 290); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_error, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        label_error_three = XmCreateLabel(bulletinBoard_error,
-            (char *)"label_error_three",
-            args,
-            ac);
-        XtManageChild(label_error_three);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_error, (char *)"OK",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 110); ac++;
-        XtSetArg(args[ac], XmNy, 110); ac++;
-        XtSetArg(args[ac], XmNwidth, 90); ac++;
-        XtSetArg(args[ac], XmNheight, 40); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_error, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_error = XmCreatePushButton(bulletinBoard_error,
-            (char *)"pushButton_error",
-            args,
-            ac);
-        XtManageChild(pushButton_error);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNtitle, "Buffer Controls"); ac++;
-    XtSetArg(args[ac], XmNwidth, 536); ac++;
-    XtSetArg(args[ac], XmNheight, 186); ac++;
-    dialogShell_buffer = XmCreateDialogShell(window_mbedit,
-        (char *)"dialogShell_buffer",
-        args,
-        ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNresizePolicy, XmRESIZE_GROW); ac++;
-    XtSetArg(args[ac], XmNx, 0); ac++;
-    XtSetArg(args[ac], XmNy, 1244); ac++;
-    XtSetArg(args[ac], XmNwidth, 536); ac++;
-    XtSetArg(args[ac], XmNheight, 186); ac++;
-    bulletinBoard_buffer = XtCreateWidget((char *)"bulletinBoard_buffer",
-        xmBulletinBoardWidgetClass,
-        dialogShell_buffer,
-        args,
-        ac);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_buffer, (char *)"Dismiss",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 230); ac++;
-        XtSetArg(args[ac], XmNy, 110); ac++;
-        XtSetArg(args[ac], XmNwidth, 67); ac++;
-        XtSetArg(args[ac], XmNheight, 28); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_buffer, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_buffer_dismiss = XmCreatePushButton(bulletinBoard_buffer,
-            (char *)"pushButton_buffer_dismiss",
-            args,
-            ac);
-        XtManageChild(pushButton_buffer_dismiss);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_buffer_dismiss, XmNactivateCallback, BxUnmanageCB, (XtPointer)"bulletinBoard_buffer");
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_buffer, (char *)"5000",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
-        XtSetArg(args[ac], XmNx, 460); ac++;
-        XtSetArg(args[ac], XmNy, 70); ac++;
-        XtSetArg(args[ac], XmNwidth, 65); ac++;
-        XtSetArg(args[ac], XmNheight, 20); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_buffer, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        slider_buffer_hold_max_label = XmCreateLabel(bulletinBoard_buffer,
-            (char *)"slider_buffer_hold_max_label",
-            args,
-            ac);
-        XtManageChild(slider_buffer_hold_max_label);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNminimum, 1); ac++;
-    XtSetArg(args[ac], XmNvalue, 100); ac++;
-    XtSetArg(args[ac], XmNmaximum, 5000); ac++;
-    XtSetArg(args[ac], XmNscaleHeight, 15); ac++;
-    XtSetArg(args[ac], XmNshowArrows, TRUE); ac++;
-    XtSetArg(args[ac], XmNscaleMultiple, 1); ac++;
-    XtSetArg(args[ac], XmNshowValue, TRUE); ac++;
-    XtSetArg(args[ac], XmNorientation, XmHORIZONTAL); ac++;
-    XtSetArg(args[ac], XmNx, 190); ac++;
-    XtSetArg(args[ac], XmNy, 60); ac++;
-    XtSetArg(args[ac], XmNwidth, 260); ac++;
-    XtSetArg(args[ac], XmNheight, 34); ac++;
-    XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(bulletinBoard_buffer, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-        XmRFontList, 0, &argok)); if (argok) ac++;
-    slider_buffer_hold = XmCreateScale(bulletinBoard_buffer,
-        (char *)"slider_buffer_hold",
-        args,
-        ac);
-    XtManageChild(slider_buffer_hold);
-    XtAddCallback(slider_buffer_hold, XmNvalueChangedCallback, do_buffer_hold, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_buffer, (char *)"Buffer Retain Size:         1",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_END); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 70); ac++;
-        XtSetArg(args[ac], XmNheight, 20); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_buffer, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        slider_buffer_hold_label = XmCreateLabel(bulletinBoard_buffer,
-            (char *)"slider_buffer_hold_label",
-            args,
-            ac);
-        XtManageChild(slider_buffer_hold_label);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_buffer, (char *)"5000",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
-        XtSetArg(args[ac], XmNx, 460); ac++;
-        XtSetArg(args[ac], XmNy, 20); ac++;
-        XtSetArg(args[ac], XmNwidth, 65); ac++;
-        XtSetArg(args[ac], XmNheight, 20); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_buffer, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        slider_buffer_size_max_label = XmCreateLabel(bulletinBoard_buffer,
-            (char *)"slider_buffer_size_max_label",
-            args,
-            ac);
-        XtManageChild(slider_buffer_size_max_label);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNminimum, 1); ac++;
-    XtSetArg(args[ac], XmNvalue, 5000); ac++;
-    XtSetArg(args[ac], XmNmaximum, 5000); ac++;
-    XtSetArg(args[ac], XmNscaleHeight, 15); ac++;
-    XtSetArg(args[ac], XmNshowArrows, TRUE); ac++;
-    XtSetArg(args[ac], XmNscaleMultiple, 1); ac++;
-    XtSetArg(args[ac], XmNshowValue, TRUE); ac++;
-    XtSetArg(args[ac], XmNorientation, XmHORIZONTAL); ac++;
-    XtSetArg(args[ac], XmNx, 190); ac++;
-    XtSetArg(args[ac], XmNy, 10); ac++;
-    XtSetArg(args[ac], XmNwidth, 260); ac++;
-    XtSetArg(args[ac], XmNheight, 34); ac++;
-    XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(bulletinBoard_buffer, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-        XmRFontList, 0, &argok)); if (argok) ac++;
-    slider_buffer_size = XmCreateScale(bulletinBoard_buffer,
-        (char *)"slider_buffer_size",
-        args,
-        ac);
-    XtManageChild(slider_buffer_size);
-    XtAddCallback(slider_buffer_size, XmNvalueChangedCallback, do_buffer_size, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_buffer, (char *)"Data Buffer Size:            1",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_END); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 20); ac++;
-        XtSetArg(args[ac], XmNwidth, 170); ac++;
-        XtSetArg(args[ac], XmNheight, 20); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_buffer, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        slider_buffer_size_label = XmCreateLabel(bulletinBoard_buffer,
-            (char *)"slider_buffer_size_label",
-            args,
-            ac);
-        XtManageChild(slider_buffer_size_label);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNwidth, 536); ac++;
-    XtSetArg(args[ac], XmNheight, 179); ac++;
-    dialogShell_annotation = XmCreateDialogShell(window_mbedit,
-        (char *)"dialogShell_annotation",
-        args,
-        ac);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(dialogShell_annotation, (char *)"Annotation",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNdialogTitle, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNresizePolicy, XmRESIZE_GROW); ac++;
-        XtSetArg(args[ac], XmNx, 0); ac++;
-        XtSetArg(args[ac], XmNy, 1247); ac++;
-        XtSetArg(args[ac], XmNwidth, 536); ac++;
-        XtSetArg(args[ac], XmNheight, 179); ac++;
-        bulletinBoard_annotation = XtCreateWidget((char *)"bulletinBoard_annotation",
-            xmBulletinBoardWidgetClass,
-            dialogShell_annotation,
-            args,
-            ac);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_annotation, (char *)"Dismiss",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 230); ac++;
-        XtSetArg(args[ac], XmNy, 100); ac++;
-        XtSetArg(args[ac], XmNwidth, 67); ac++;
-        XtSetArg(args[ac], XmNheight, 28); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_annotation, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_annotation_dismiss = XmCreatePushButton(bulletinBoard_annotation,
-            (char *)"pushButton_annotation_dismiss",
-            args,
-            ac);
-        XtManageChild(pushButton_annotation_dismiss);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_annotation, (char *)"1000",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
-        XtSetArg(args[ac], XmNx, 460); ac++;
-        XtSetArg(args[ac], XmNy, 60); ac++;
-        XtSetArg(args[ac], XmNwidth, 65); ac++;
-        XtSetArg(args[ac], XmNheight, 15); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_annotation, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        slider_y_max_interval_label = XmCreateLabel(bulletinBoard_annotation,
-            (char *)"slider_y_max_interval_label",
-            args,
-            ac);
-        XtManageChild(slider_y_max_interval_label);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNminimum, 1); ac++;
-    XtSetArg(args[ac], XmNvalue, 250); ac++;
-    XtSetArg(args[ac], XmNmaximum, 1000); ac++;
-    XtSetArg(args[ac], XmNscaleHeight, 15); ac++;
-    XtSetArg(args[ac], XmNshowArrows, TRUE); ac++;
-    XtSetArg(args[ac], XmNscaleMultiple, 1); ac++;
-    XtSetArg(args[ac], XmNshowValue, TRUE); ac++;
-    XtSetArg(args[ac], XmNorientation, XmHORIZONTAL); ac++;
-    XtSetArg(args[ac], XmNx, 200); ac++;
-    XtSetArg(args[ac], XmNy, 50); ac++;
-    XtSetArg(args[ac], XmNwidth, 250); ac++;
-    XtSetArg(args[ac], XmNheight, 34); ac++;
-    XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(bulletinBoard_annotation, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-        XmRFontList, 0, &argok)); if (argok) ac++;
-    slider_y_interval = XmCreateScale(bulletinBoard_annotation,
-        (char *)"slider_y_interval",
-        args,
-        ac);
-    XtManageChild(slider_y_interval);
-    XtAddCallback(slider_y_interval, XmNvalueChangedCallback, do_y_interval, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_annotation, (char *)"Y Axis Tick Interval (m): 1",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_END); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 60); ac++;
-        XtSetArg(args[ac], XmNheight, 20); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_annotation, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        slider_y_interval_label = XmCreateLabel(bulletinBoard_annotation,
-            (char *)"slider_y_interval_label",
-            args,
-            ac);
-        XtManageChild(slider_y_interval_label);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_annotation, (char *)"5000",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
-        XtSetArg(args[ac], XmNx, 460); ac++;
-        XtSetArg(args[ac], XmNy, 10); ac++;
-        XtSetArg(args[ac], XmNwidth, 65); ac++;
-        XtSetArg(args[ac], XmNheight, 20); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_annotation, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        slider_x_max_interval_label = XmCreateLabel(bulletinBoard_annotation,
-            (char *)"slider_x_max_interval_label",
-            args,
-            ac);
-        XtManageChild(slider_x_max_interval_label);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNminimum, 1); ac++;
-    XtSetArg(args[ac], XmNvalue, 1000); ac++;
-    XtSetArg(args[ac], XmNmaximum, 5000); ac++;
-    XtSetArg(args[ac], XmNscaleHeight, 15); ac++;
-    XtSetArg(args[ac], XmNshowArrows, TRUE); ac++;
-    XtSetArg(args[ac], XmNscaleMultiple, 1); ac++;
-    XtSetArg(args[ac], XmNshowValue, TRUE); ac++;
-    XtSetArg(args[ac], XmNorientation, XmHORIZONTAL); ac++;
-    XtSetArg(args[ac], XmNx, 200); ac++;
-    XtSetArg(args[ac], XmNy, 10); ac++;
-    XtSetArg(args[ac], XmNwidth, 250); ac++;
-    XtSetArg(args[ac], XmNheight, 34); ac++;
-    XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(bulletinBoard_annotation, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-        XmRFontList, 0, &argok)); if (argok) ac++;
-    slider_x_interval = XmCreateScale(bulletinBoard_annotation,
-        (char *)"slider_x_interval",
-        args,
-        ac);
-    XtManageChild(slider_x_interval);
-    XtAddCallback(slider_x_interval, XmNvalueChangedCallback, do_x_interval, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_annotation, (char *)"X Axis Tick Interval (m): 1",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_END); ac++;
-        XtSetArg(args[ac], XmNx, 20); ac++;
-        XtSetArg(args[ac], XmNy, 10); ac++;
-        XtSetArg(args[ac], XmNheight, 20); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_annotation, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        slider_x_interval_label = XmCreateLabel(bulletinBoard_annotation,
-            (char *)"slider_x_interval_label",
-            args,
-            ac);
-        XtManageChild(slider_x_interval_label);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNtitle, "Filters"); ac++;
-    XtSetArg(args[ac], XmNwidth, 430); ac++;
-    XtSetArg(args[ac], XmNheight, 311); ac++;
-    dialogShell_filters = XmCreateDialogShell(window_mbedit,
-        (char *)"dialogShell_filters",
-        args,
-        ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNautoUnmanage, False); ac++;
-    XtSetArg(args[ac], XmNresizePolicy, XmRESIZE_GROW); ac++;
-    XtSetArg(args[ac], XmNx, 0); ac++;
-    XtSetArg(args[ac], XmNy, 1181); ac++;
-    XtSetArg(args[ac], XmNwidth, 430); ac++;
-    XtSetArg(args[ac], XmNheight, 311); ac++;
-    bulletinBoard_filters = XtCreateWidget((char *)"bulletinBoard_filters",
-        xmBulletinBoardWidgetClass,
-        dialogShell_filters,
-        args,
-        ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNscrollingPolicy, XmAUTOMATIC); ac++;
-    XtSetArg(args[ac], XmNx, 10); ac++;
-    XtSetArg(args[ac], XmNy, 10); ac++;
-    XtSetArg(args[ac], XmNwidth, 410); ac++;
-    XtSetArg(args[ac], XmNheight, 230); ac++;
-    scrolledWindow_filters = XmCreateScrolledWindow(bulletinBoard_filters,
-        (char *)"scrolledWindow_filters",
-        args,
-        ac);
-    XtManageChild(scrolledWindow_filters);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNresizePolicy, XmRESIZE_GROW); ac++;
-    XtSetArg(args[ac], XmNwidth, 375); ac++;
-    XtSetArg(args[ac], XmNheight, 810); ac++;
-    bulletinBoard_scrollfilters = XmCreateBulletinBoard(scrolledWindow_filters,
-        (char *)"bulletinBoard_scrollfilters",
-        args,
-        ac);
-    XtManageChild(bulletinBoard_scrollfilters);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 90); ac++;
-    XtSetArg(args[ac], XmNy, 70); ac++;
-    XtSetArg(args[ac], XmNwidth, 16); ac++;
-    XtSetArg(args[ac], XmNheight, 16); ac++;
-    XtSetArg(args[ac], XmNisHomogeneous, False); ac++;
-    radioBox_mediancalc = XmCreateRadioBox(bulletinBoard_scrollfilters,
-        (char *)"radioBox_mediancalc",
-        args,
-        ac);
-    XtManageChild(radioBox_mediancalc);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_scrollfilters, (char *)"Median Alongtrack Dimension",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNtitleString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNminimum, 1); ac++;
-        XtSetArg(args[ac], XmNvalue, 1); ac++;
-        XtSetArg(args[ac], XmNmaximum, 20); ac++;
-        XtSetArg(args[ac], XmNshowArrows, TRUE); ac++;
-        XtSetArg(args[ac], XmNscaleMultiple, 1); ac++;
-        XtSetArg(args[ac], XmNshowValue, TRUE); ac++;
-        XtSetArg(args[ac], XmNorientation, XmHORIZONTAL); ac++;
-        XtSetArg(args[ac], XmNx, 100); ac++;
-        XtSetArg(args[ac], XmNy, 140); ac++;
-        XtSetArg(args[ac], XmNwidth, 260); ac++;
-        XtSetArg(args[ac], XmNheight, 63); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_scrollfilters, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        scale_median_local_ltrack = XmCreateScale(bulletinBoard_scrollfilters,
-            (char *)"scale_median_local_ltrack",
-            args,
-            ac);
-        XtManageChild(scale_median_local_ltrack);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(scale_median_local_ltrack, XmNvalueChangedCallback, do_check_median_ltrack, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_scrollfilters, (char *)"Median Acrosstrack Dimension",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNtitleString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNminimum, 1); ac++;
-        XtSetArg(args[ac], XmNvalue, 5); ac++;
-        XtSetArg(args[ac], XmNshowArrows, TRUE); ac++;
-        XtSetArg(args[ac], XmNscaleMultiple, 1); ac++;
-        XtSetArg(args[ac], XmNshowValue, TRUE); ac++;
-        XtSetArg(args[ac], XmNorientation, XmHORIZONTAL); ac++;
-        XtSetArg(args[ac], XmNx, 100); ac++;
-        XtSetArg(args[ac], XmNy, 80); ac++;
-        XtSetArg(args[ac], XmNwidth, 260); ac++;
-        XtSetArg(args[ac], XmNheight, 63); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_scrollfilters, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        scale_median_local_xtrack = XmCreateScale(bulletinBoard_scrollfilters,
-            (char *)"scale_median_local_xtrack",
-            args,
-            ac);
-        XtManageChild(scale_median_local_xtrack);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(scale_median_local_xtrack, XmNvalueChangedCallback, do_check_median_xtrack, (XtPointer)0);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 10); ac++;
-    XtSetArg(args[ac], XmNy, 650); ac++;
-    XtSetArg(args[ac], XmNwidth, 350); ac++;
-    XtSetArg(args[ac], XmNheight, 20); ac++;
-    separator6 = XmCreateSeparator(bulletinBoard_scrollfilters,
-        (char *)"separator6",
-        args,
-        ac);
-    XtManageChild(separator6);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_scrollfilters, (char *)"End Flagging Angle (deg)",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNtitleString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNdecimalPoints, 2); ac++;
-        XtSetArg(args[ac], XmNvalue, 1000); ac++;
-        XtSetArg(args[ac], XmNmaximum, 10000); ac++;
-        XtSetArg(args[ac], XmNshowArrows, TRUE); ac++;
-        XtSetArg(args[ac], XmNscaleMultiple, 1); ac++;
-        XtSetArg(args[ac], XmNshowValue, TRUE); ac++;
-        XtSetArg(args[ac], XmNorientation, XmHORIZONTAL); ac++;
-        XtSetArg(args[ac], XmNx, 100); ac++;
-        XtSetArg(args[ac], XmNy, 580); ac++;
-        XtSetArg(args[ac], XmNwidth, 260); ac++;
-        XtSetArg(args[ac], XmNheight, 63); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_scrollfilters, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        scale_filters_cutangleend = XmCreateScale(bulletinBoard_scrollfilters,
-            (char *)"scale_filters_cutangleend",
-            args,
-            ac);
-        XtManageChild(scale_filters_cutangleend);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_scrollfilters, (char *)"Start Flagging Angle (deg)",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNtitleString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNdecimalPoints, 2); ac++;
-        XtSetArg(args[ac], XmNvalue, 1000); ac++;
-        XtSetArg(args[ac], XmNmaximum, 10000); ac++;
-        XtSetArg(args[ac], XmNshowArrows, TRUE); ac++;
-        XtSetArg(args[ac], XmNscaleMultiple, 1); ac++;
-        XtSetArg(args[ac], XmNshowValue, TRUE); ac++;
-        XtSetArg(args[ac], XmNorientation, XmHORIZONTAL); ac++;
-        XtSetArg(args[ac], XmNx, 100); ac++;
-        XtSetArg(args[ac], XmNy, 520); ac++;
-        XtSetArg(args[ac], XmNwidth, 260); ac++;
-        XtSetArg(args[ac], XmNheight, 63); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_scrollfilters, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        scale_filters_cutanglestart = XmCreateScale(bulletinBoard_scrollfilters,
-            (char *)"scale_filters_cutanglestart",
-            args,
-            ac);
-        XtManageChild(scale_filters_cutanglestart);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_scrollfilters, (char *)":::t\"Flag by\":t\"Beam\"\"Angle\"",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 530); ac++;
-        XtSetArg(args[ac], XmNwidth, 80); ac++;
-        XtSetArg(args[ac], XmNheight, 60); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_scrollfilters, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        toggleButton_filters_cutangle = XmCreateToggleButton(bulletinBoard_scrollfilters,
-            (char *)"toggleButton_filters_cutangle",
-            args,
-            ac);
-        XtManageChild(toggleButton_filters_cutangle);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 10); ac++;
-    XtSetArg(args[ac], XmNy, 500); ac++;
-    XtSetArg(args[ac], XmNwidth, 350); ac++;
-    XtSetArg(args[ac], XmNheight, 20); ac++;
-    separator5 = XmCreateSeparator(bulletinBoard_scrollfilters,
-        (char *)"separator5",
-        args,
-        ac);
-    XtManageChild(separator5);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_scrollfilters, (char *)"End Flagging Distance (m)",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNtitleString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNdecimalPoints, 2); ac++;
-        XtSetArg(args[ac], XmNvalue, 1000); ac++;
-        XtSetArg(args[ac], XmNmaximum, 10000); ac++;
-        XtSetArg(args[ac], XmNshowArrows, TRUE); ac++;
-        XtSetArg(args[ac], XmNscaleMultiple, 1); ac++;
-        XtSetArg(args[ac], XmNshowValue, TRUE); ac++;
-        XtSetArg(args[ac], XmNorientation, XmHORIZONTAL); ac++;
-        XtSetArg(args[ac], XmNx, 100); ac++;
-        XtSetArg(args[ac], XmNy, 440); ac++;
-        XtSetArg(args[ac], XmNwidth, 260); ac++;
-        XtSetArg(args[ac], XmNheight, 63); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_scrollfilters, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        scale_filters_cutdistanceend = XmCreateScale(bulletinBoard_scrollfilters,
-            (char *)"scale_filters_cutdistanceend",
-            args,
-            ac);
-        XtManageChild(scale_filters_cutdistanceend);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_scrollfilters, (char *)"Start Flagging Distance (m)",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNtitleString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNdecimalPoints, 2); ac++;
-        XtSetArg(args[ac], XmNvalue, 1000); ac++;
-        XtSetArg(args[ac], XmNmaximum, 10000); ac++;
-        XtSetArg(args[ac], XmNshowArrows, TRUE); ac++;
-        XtSetArg(args[ac], XmNscaleMultiple, 1); ac++;
-        XtSetArg(args[ac], XmNshowValue, TRUE); ac++;
-        XtSetArg(args[ac], XmNorientation, XmHORIZONTAL); ac++;
-        XtSetArg(args[ac], XmNx, 100); ac++;
-        XtSetArg(args[ac], XmNy, 380); ac++;
-        XtSetArg(args[ac], XmNwidth, 260); ac++;
-        XtSetArg(args[ac], XmNheight, 63); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_scrollfilters, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        scale_filters_cutdistancestart = XmCreateScale(bulletinBoard_scrollfilters,
-            (char *)"scale_filters_cutdistancestart",
-            args,
-            ac);
-        XtManageChild(scale_filters_cutdistancestart);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_scrollfilters, (char *)":::t\"Flag by\"\"Distance\"",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 390); ac++;
-        XtSetArg(args[ac], XmNwidth, 90); ac++;
-        XtSetArg(args[ac], XmNheight, 40); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_scrollfilters, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        toggleButton_filters_cutdistance = XmCreateToggleButton(bulletinBoard_scrollfilters,
-            (char *)"toggleButton_filters_cutdistance",
-            args,
-            ac);
-        XtManageChild(toggleButton_filters_cutdistance);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 10); ac++;
-    XtSetArg(args[ac], XmNy, 210); ac++;
-    XtSetArg(args[ac], XmNwidth, 350); ac++;
-    XtSetArg(args[ac], XmNheight, 20); ac++;
-    separator4 = XmCreateSeparator(bulletinBoard_scrollfilters,
-        (char *)"separator4",
-        args,
-        ac);
-    XtManageChild(separator4);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_scrollfilters, (char *)"End Flagging Beam Number",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNtitleString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNvalue, 10); ac++;
-        XtSetArg(args[ac], XmNmaximum, 100); ac++;
-        XtSetArg(args[ac], XmNshowArrows, TRUE); ac++;
-        XtSetArg(args[ac], XmNshowValue, TRUE); ac++;
-        XtSetArg(args[ac], XmNorientation, XmHORIZONTAL); ac++;
-        XtSetArg(args[ac], XmNx, 100); ac++;
-        XtSetArg(args[ac], XmNy, 290); ac++;
-        XtSetArg(args[ac], XmNwidth, 260); ac++;
-        XtSetArg(args[ac], XmNheight, 63); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_scrollfilters, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        scale_filters_cutbeamend = XmCreateScale(bulletinBoard_scrollfilters,
-            (char *)"scale_filters_cutbeamend",
-            args,
-            ac);
-        XtManageChild(scale_filters_cutbeamend);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_scrollfilters, (char *)"Start Flagging Beam Number",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNtitleString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNvalue, 10); ac++;
-        XtSetArg(args[ac], XmNmaximum, 100); ac++;
-        XtSetArg(args[ac], XmNshowArrows, TRUE); ac++;
-        XtSetArg(args[ac], XmNshowValue, TRUE); ac++;
-        XtSetArg(args[ac], XmNorientation, XmHORIZONTAL); ac++;
-        XtSetArg(args[ac], XmNx, 100); ac++;
-        XtSetArg(args[ac], XmNy, 230); ac++;
-        XtSetArg(args[ac], XmNwidth, 260); ac++;
-        XtSetArg(args[ac], XmNheight, 63); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_scrollfilters, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        scale_filters_cutbeamstart = XmCreateScale(bulletinBoard_scrollfilters,
-            (char *)"scale_filters_cutbeamstart",
-            args,
-            ac);
-        XtManageChild(scale_filters_cutbeamstart);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_scrollfilters, (char *)":::t\"Flag by\":t\"Beam\"\"Number\"",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 240); ac++;
-        XtSetArg(args[ac], XmNwidth, 90); ac++;
-        XtSetArg(args[ac], XmNheight, 60); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_scrollfilters, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        toggleButton_filters_cutbeam = XmCreateToggleButton(bulletinBoard_scrollfilters,
-            (char *)"toggleButton_filters_cutbeam",
-            args,
-            ac);
-        XtManageChild(toggleButton_filters_cutbeam);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 10); ac++;
-    XtSetArg(args[ac], XmNy, 360); ac++;
-    XtSetArg(args[ac], XmNwidth, 350); ac++;
-    XtSetArg(args[ac], XmNheight, 20); ac++;
-    separator3 = XmCreateSeparator(bulletinBoard_scrollfilters,
-        (char *)"separator3",
-        args,
-        ac);
-    XtManageChild(separator3);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_scrollfilters, (char *)"Beams from Center Threshold",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNtitleString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNvalue, 10); ac++;
-        XtSetArg(args[ac], XmNmaximum, 100); ac++;
-        XtSetArg(args[ac], XmNshowArrows, TRUE); ac++;
-        XtSetArg(args[ac], XmNshowValue, TRUE); ac++;
-        XtSetArg(args[ac], XmNorientation, XmHORIZONTAL); ac++;
-        XtSetArg(args[ac], XmNx, 100); ac++;
-        XtSetArg(args[ac], XmNy, 670); ac++;
-        XtSetArg(args[ac], XmNwidth, 260); ac++;
-        XtSetArg(args[ac], XmNheight, 63); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_scrollfilters, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        scale_filters_wrongside = XmCreateScale(bulletinBoard_scrollfilters,
-            (char *)"scale_filters_wrongside",
-            args,
-            ac);
-        XtManageChild(scale_filters_wrongside);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_scrollfilters, (char *)":::t\"Wrong\":t\"Side\"\"Filter\"",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 680); ac++;
-        XtSetArg(args[ac], XmNwidth, 90); ac++;
-        XtSetArg(args[ac], XmNheight, 60); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_scrollfilters, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        toggleButton_filters_wrongside = XmCreateToggleButton(bulletinBoard_scrollfilters,
-            (char *)"toggleButton_filters_wrongside",
-            args,
-            ac);
-        XtManageChild(toggleButton_filters_wrongside);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_scrollfilters, (char *)"% Median Depth Threshold ",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNtitleString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNminimum, 1); ac++;
-        XtSetArg(args[ac], XmNdecimalPoints, 0); ac++;
-        XtSetArg(args[ac], XmNvalue, 10); ac++;
-        XtSetArg(args[ac], XmNshowArrows, TRUE); ac++;
-        XtSetArg(args[ac], XmNshowValue, TRUE); ac++;
-        XtSetArg(args[ac], XmNorientation, XmHORIZONTAL); ac++;
-        XtSetArg(args[ac], XmNx, 100); ac++;
-        XtSetArg(args[ac], XmNy, 10); ac++;
-        XtSetArg(args[ac], XmNwidth, 260); ac++;
-        XtSetArg(args[ac], XmNheight, 63); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_scrollfilters, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        scale_filters_medianspike = XmCreateScale(bulletinBoard_scrollfilters,
-            (char *)"scale_filters_medianspike",
-            args,
-            ac);
-        XtManageChild(scale_filters_medianspike);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_scrollfilters, (char *)":::t\"Median\":t\"Spike\"\"Filter\"",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 20); ac++;
-        XtSetArg(args[ac], XmNwidth, 90); ac++;
-        XtSetArg(args[ac], XmNheight, 60); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_scrollfilters, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        toggleButton_filters_medianspike = XmCreateToggleButton(bulletinBoard_scrollfilters,
-            (char *)"toggleButton_filters_medianspike",
-            args,
-            ac);
-        XtManageChild(toggleButton_filters_medianspike);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_filters, (char *)"Reset",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 160); ac++;
-        XtSetArg(args[ac], XmNy, 250); ac++;
-        XtSetArg(args[ac], XmNwidth, 90); ac++;
-        XtSetArg(args[ac], XmNheight, 40); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_filters, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_filters_reset = XmCreatePushButton(bulletinBoard_filters,
-            (char *)"pushButton_filters_reset",
-            args,
-            ac);
-        XtManageChild(pushButton_filters_reset);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_filters_reset, XmNactivateCallback, do_reset_filters, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_filters, (char *)"Apply",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 50); ac++;
-        XtSetArg(args[ac], XmNy, 250); ac++;
-        XtSetArg(args[ac], XmNwidth, 90); ac++;
-        XtSetArg(args[ac], XmNheight, 40); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_filters, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_filters_apply = XmCreatePushButton(bulletinBoard_filters,
-            (char *)"pushButton_filters_apply",
-            args,
-            ac);
-        XtManageChild(pushButton_filters_apply);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_filters_apply, XmNactivateCallback, do_set_filters, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_filters, (char *)"Dismiss",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 270); ac++;
-        XtSetArg(args[ac], XmNy, 250); ac++;
-        XtSetArg(args[ac], XmNwidth, 90); ac++;
-        XtSetArg(args[ac], XmNheight, 40); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_filters, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_filters_dismiss = XmCreatePushButton(bulletinBoard_filters,
-            (char *)"pushButton_filters_dismiss",
-            args,
-            ac);
-        XtManageChild(pushButton_filters_dismiss);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_filters_dismiss, XmNactivateCallback, BxUnmanageCB, (XtPointer)"bulletinBoard_filters");
-
-    ac = 0;
-    XtSetArg(args[ac], XmNwidth, 343); ac++;
-    XtSetArg(args[ac], XmNheight, 580); ac++;
-    dialogShell_filelist = XmCreateDialogShell(window_mbedit,
-        (char *)"dialogShell_filelist",
-        args,
-        ac);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(dialogShell_filelist, (char *)"Files Available for Editing",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNdialogTitle, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNautoUnmanage, False); ac++;
-        XtSetArg(args[ac], XmNresizePolicy, XmRESIZE_GROW); ac++;
-        XtSetArg(args[ac], XmNx, 167); ac++;
-        XtSetArg(args[ac], XmNy, 1022); ac++;
-        XtSetArg(args[ac], XmNwidth, 343); ac++;
-        XtSetArg(args[ac], XmNheight, 580); ac++;
-        form_filelist = XtCreateWidget((char *)"form_filelist",
-            xmFormWidgetClass,
-            dialogShell_filelist,
-            args,
-            ac);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(form_filelist, (char *)":::t\"Remove\":t\"Selected\"\"File\"",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
-        XtSetArg(args[ac], XmNx, 110); ac++;
-        XtSetArg(args[ac], XmNy, 510); ac++;
-        XtSetArg(args[ac], XmNwidth, 104); ac++;
-        XtSetArg(args[ac], XmNheight, 60); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(form_filelist, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_filelist_remove = XmCreatePushButton(form_filelist,
-            (char *)"pushButton_filelist_remove",
-            args,
-            ac);
-        XtManageChild(pushButton_filelist_remove);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_filelist_remove, XmNactivateCallback, do_filelist_remove, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(form_filelist, (char *)":::t\"Edit\":t\"Selected\"\"File\"",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 510); ac++;
-        XtSetArg(args[ac], XmNwidth, 90); ac++;
-        XtSetArg(args[ac], XmNheight, 60); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(form_filelist, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_filelist_edit = XmCreatePushButton(form_filelist,
-            (char *)"pushButton_filelist_edit",
-            args,
-            ac);
-        XtManageChild(pushButton_filelist_edit);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_filelist_edit, XmNactivateCallback, do_editlistselection, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(form_filelist, (char *)"Output Mode:",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNmarginWidth, 0); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 10); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(form_filelist, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        setting_output_label_filelist = XmCreateLabel(form_filelist,
-            (char *)"setting_output_label_filelist",
-            args,
-            ac);
-        XtManageChild(setting_output_label_filelist);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNnumColumns, 1); ac++;
-    XtSetArg(args[ac], XmNpacking, XmPACK_COLUMN); ac++;
-    XtSetArg(args[ac], XmNradioBehavior, True); ac++;
-    XtSetArg(args[ac], XmNspacing, 0); ac++;
-    XtSetArg(args[ac], XmNorientation, XmHORIZONTAL); ac++;
-    XtSetArg(args[ac], XmNx, 110); ac++;
-    XtSetArg(args[ac], XmNy, 10); ac++;
-    XtSetArg(args[ac], XmNwidth, 238); ac++;
-    XtSetArg(args[ac], XmNheight, 34); ac++;
-    setting_output_filelist = XmCreateRowColumn(form_filelist,
-        (char *)"setting_output_filelist",
-        args,
-        ac);
-    XtManageChild(setting_output_filelist);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(setting_output_filelist, (char *)"Output Edits",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNwidth, 116); ac++;
-        XtSetArg(args[ac], XmNheight, 28); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(setting_output_filelist, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        setting_output_toggle_edit_filelist = XmCreateToggleButton(setting_output_filelist,
-            (char *)"setting_output_toggle_edit_filelist",
-            args,
-            ac);
-        XtManageChild(setting_output_toggle_edit_filelist);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(setting_output_toggle_edit_filelist, XmNvalueChangedCallback, do_output_edit_filelist, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(setting_output_filelist, (char *)"Browse Only",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNwidth, 116); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(setting_output_filelist, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        setting_output_toggle_browse_filelist = XmCreateToggleButton(setting_output_filelist,
-            (char *)"setting_output_toggle_browse_filelist",
-            args,
-            ac);
-        XtManageChild(setting_output_toggle_browse_filelist);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(setting_output_toggle_browse_filelist, XmNvalueChangedCallback, do_output_browse_filelist, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(form_filelist, (char *)"Dismiss",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
-        XtSetArg(args[ac], XmNx, 250); ac++;
-        XtSetArg(args[ac], XmNy, 510); ac++;
-        XtSetArg(args[ac], XmNwidth, 80); ac++;
-        XtSetArg(args[ac], XmNheight, 60); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(form_filelist, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_filelist_dismiss = XmCreatePushButton(form_filelist,
-            (char *)"pushButton_filelist_dismiss",
-            args,
-            ac);
-        XtManageChild(pushButton_filelist_dismiss);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_filelist_dismiss, XmNactivateCallback, BxUnmanageCB, (XtPointer)"form_filelist");
-
-    ac = 0;
-    XtSetArg(args[ac], XmNscrollingPolicy, XmAPPLICATION_DEFINED); ac++;
-    XtSetArg(args[ac], XmNx, 0); ac++;
-    XtSetArg(args[ac], XmNy, 50); ac++;
-    XtSetArg(args[ac], XmNwidth, 339); ac++;
-    XtSetArg(args[ac], XmNheight, 450); ac++;
-    scrolledWindow_filelist = XmCreateScrolledWindow(form_filelist,
-        (char *)"scrolledWindow_filelist",
-        args,
-        ac);
-    XtManageChild(scrolledWindow_filelist);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(scrolledWindow_filelist, (char *)"-*-"MONO"-*-r-*-*-*-90-*-*-*-*-iso8859-1",
-        XmRFontList, 0, &argok)); if (argok) ac++;
-    XtSetArg(args[ac], XmNselectionPolicy, XmSINGLE_SELECT); ac++;
-    XtSetArg(args[ac], XmNwidth, 339); ac++;
-    XtSetArg(args[ac], XmNheight, 450); ac++;
-    list_filelist = XmCreateList(scrolledWindow_filelist,
-        (char *)"list_filelist",
-        args,
-        ac);
-    XtManageChild(list_filelist);
-    ac = 0;
-    XtSetArg(args[ac], XmNtopAttachment, XmATTACH_NONE); ac++;
-    XtSetArg(args[ac], XmNrightAttachment, XmATTACH_NONE); ac++;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_WIDGET); ac++;
-    XtSetArg(args[ac], XmNbottomAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNbottomOffset, 10); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 10); ac++;
-    XtSetArg(args[ac], XmNleftWidget, pushButton_filelist_edit); ac++;
-    XtSetValues(pushButton_filelist_remove, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNtopAttachment, XmATTACH_NONE); ac++;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNbottomAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNbottomOffset, 10); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 10); ac++;
-    XtSetValues(pushButton_filelist_edit, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNrightAttachment, XmATTACH_NONE); ac++;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 10); ac++;
-    XtSetArg(args[ac], XmNtopOffset, 10); ac++;
-    XtSetValues(setting_output_label_filelist, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNtopAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNrightAttachment, XmATTACH_NONE); ac++;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_WIDGET); ac++;
-    XtSetArg(args[ac], XmNbottomAttachment, XmATTACH_NONE); ac++;
-    XtSetArg(args[ac], XmNbottomOffset, 0); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 3); ac++;
-    XtSetArg(args[ac], XmNtopOffset, 10); ac++;
-    XtSetArg(args[ac], XmNleftWidget, setting_output_label_filelist); ac++;
-    XtSetValues(setting_output_filelist, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNtopAttachment, XmATTACH_NONE); ac++;
-    XtSetArg(args[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_NONE); ac++;
-    XtSetArg(args[ac], XmNbottomAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNbottomOffset, 10); ac++;
-    XtSetArg(args[ac], XmNrightOffset, 13); ac++;
-    XtSetValues(pushButton_filelist_dismiss, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNtopAttachment, XmATTACH_WIDGET); ac++;
-    XtSetArg(args[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNbottomAttachment, XmATTACH_WIDGET); ac++;
-    XtSetArg(args[ac], XmNbottomOffset, 10); ac++;
-    XtSetArg(args[ac], XmNbottomWidget, pushButton_filelist_remove); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 0); ac++;
-    XtSetArg(args[ac], XmNrightOffset, 4); ac++;
-    XtSetArg(args[ac], XmNtopOffset, 6); ac++;
-    XtSetArg(args[ac], XmNtopWidget, setting_output_filelist); ac++;
-    XtSetValues(scrolledWindow_filelist, args, ac);
-
-
-
-    /* Begin user code block <end_Createwindow_mbedit> */
-    /* End user code block <end_Createwindow_mbedit> */
-    return( window_mbedit );
-}
diff --git a/src/mbedit/mbedit_creation.h b/src/mbedit/mbedit_creation.h
deleted file mode 100644
index d7ad5d2..0000000
--- a/src/mbedit/mbedit_creation.h
+++ /dev/null
@@ -1,138 +0,0 @@
-
-/* Begin user code block <abstract> */
-/* End user code block <abstract> */
-
-/**
- * WARNING: This file is overwritten at code generation time.
- * Any changes to this file will be lost.
- */
-/*
- *
- * Created by BuilderXcessory Version 6.1.3
- * Generated by Code Generator Xcessory 6.1.3 (08/19/04) CGX Scripts 6.1 Motif 2.1 
- *
- */
-#ifndef mbedit_creation_H
-#define mbedit_creation_H
-
-/*
- * Global widget declarations.
- *        - EXTERNAL is set to extern if the
- *          defs file is not included from the
- *          main file.
- */
-#ifdef DECLARE_BX_GLOBALS
-#define EXTERNAL
-#else
-#define EXTERNAL extern
-#endif
-
-/**
- * Start Global Widget Declarations.
- */
-EXTERNAL Widget   window_mbedit;
-EXTERNAL Widget   setting_output_filelist;
-EXTERNAL Widget   setting_output_toggle_edit_filelist;
-EXTERNAL Widget   setting_output_toggle_browse_filelist;
-EXTERNAL Widget   list_filelist;
-EXTERNAL Widget   radioBox_mediancalc;
-EXTERNAL Widget   scale_median_local_ltrack;
-EXTERNAL Widget   scale_median_local_xtrack;
-EXTERNAL Widget   scale_filters_cutangleend;
-EXTERNAL Widget   scale_filters_cutanglestart;
-EXTERNAL Widget   toggleButton_filters_cutangle;
-EXTERNAL Widget   scale_filters_cutdistanceend;
-EXTERNAL Widget   scale_filters_cutdistancestart;
-EXTERNAL Widget   toggleButton_filters_cutdistance;
-EXTERNAL Widget   scale_filters_cutbeamend;
-EXTERNAL Widget   scale_filters_cutbeamstart;
-EXTERNAL Widget   toggleButton_filters_cutbeam;
-EXTERNAL Widget   scale_filters_wrongside;
-EXTERNAL Widget   toggleButton_filters_wrongside;
-EXTERNAL Widget   scale_filters_medianspike;
-EXTERNAL Widget   toggleButton_filters_medianspike;
-EXTERNAL Widget   slider_y_max_interval_label;
-EXTERNAL Widget   slider_y_interval;
-EXTERNAL Widget   slider_y_interval_label;
-EXTERNAL Widget   slider_x_max_interval_label;
-EXTERNAL Widget   slider_x_interval;
-EXTERNAL Widget   slider_x_interval_label;
-EXTERNAL Widget   slider_buffer_hold_max_label;
-EXTERNAL Widget   slider_buffer_hold;
-EXTERNAL Widget   slider_buffer_hold_label;
-EXTERNAL Widget   slider_buffer_size_max_label;
-EXTERNAL Widget   slider_buffer_size;
-EXTERNAL Widget   slider_buffer_size_label;
-EXTERNAL Widget   bulletinBoard_error;
-EXTERNAL Widget   label_error_two;
-EXTERNAL Widget   label_error_one;
-EXTERNAL Widget   label_error_three;
-EXTERNAL Widget   bulletinBoard_editsave;
-EXTERNAL Widget   bulletinBoard_message;
-EXTERNAL Widget   label_message;
-EXTERNAL Widget   label_about_version;
-EXTERNAL Widget   textfield_day;
-EXTERNAL Widget   textfield_second;
-EXTERNAL Widget   textfield_minute;
-EXTERNAL Widget   textfield_hour;
-EXTERNAL Widget   textfield_month;
-EXTERNAL Widget   textfield_year;
-EXTERNAL Widget   fileSelectionBox;
-EXTERNAL Widget   textfield_format_label;
-EXTERNAL Widget   textfield_format;
-EXTERNAL Widget   setting_output_label;
-EXTERNAL Widget   setting_output;
-EXTERNAL Widget   setting_output_toggle_edit;
-EXTERNAL Widget   setting_output_toggle_browse;
-EXTERNAL Widget   pushButton_file;
-EXTERNAL Widget   pushButton_end;
-EXTERNAL Widget   pushButton_start;
-EXTERNAL Widget   toggleButton_view_waterfall;
-EXTERNAL Widget   toggleButton_view_alongtrack;
-EXTERNAL Widget   toggleButton_view_acrosstrack;
-EXTERNAL Widget   toggleButton_show_flagged_on;
-EXTERNAL Widget   toggleButton_show_flags;
-EXTERNAL Widget   toggleButton_show_detects;
-EXTERNAL Widget   toggleButton_show_pulsetypes;
-EXTERNAL Widget   toggleButton_show_wideplot;
-EXTERNAL Widget   toggleButton_show_time;
-EXTERNAL Widget   toggleButton_show_interval;
-EXTERNAL Widget   toggleButton_show_lon;
-EXTERNAL Widget   toggleButton_show_latitude;
-EXTERNAL Widget   toggleButton_show_heading;
-EXTERNAL Widget   toggleButton_show_speed;
-EXTERNAL Widget   toggleButton_show_depth;
-EXTERNAL Widget   toggleButton_show_altitude;
-EXTERNAL Widget   toggleButton_show_sonardepth;
-EXTERNAL Widget   toggleButton_show_roll;
-EXTERNAL Widget   toggleButton_show_pitch;
-EXTERNAL Widget   toggleButton_show_heave;
-EXTERNAL Widget   toggleButton_reverse_keys;
-EXTERNAL Widget   toggleButton_reverse_mouse;
-EXTERNAL Widget   pushButton_next;
-EXTERNAL Widget   pushButton_done;
-EXTERNAL Widget   pushButton_forward;
-EXTERNAL Widget   pushButton_reverse;
-EXTERNAL Widget   slider_scale_x_label;
-EXTERNAL Widget   slider_scale_x;
-EXTERNAL Widget   slider_scale_x_max_label;
-EXTERNAL Widget   slider_scale_y_label;
-EXTERNAL Widget   slider_scale_y;
-EXTERNAL Widget   slider_scale_y_max_label;
-EXTERNAL Widget   slider_number_pings_label;
-EXTERNAL Widget   slider_number_pings;
-EXTERNAL Widget   slider_num_pings_max_label;
-EXTERNAL Widget   slider_number_step_label;
-EXTERNAL Widget   slider_number_step;
-EXTERNAL Widget   slider_number_max_step_label;
-EXTERNAL Widget   setting_mode_toggle_toggle;
-EXTERNAL Widget   setting_mode_toggle_pick;
-EXTERNAL Widget   setting_mode_toggle_erase;
-EXTERNAL Widget   setting_mode_toggle_restore;
-EXTERNAL Widget   setting_mode_toggle_grab;
-EXTERNAL Widget   setting_mode_toggle_info;
-EXTERNAL Widget   canvas_mbedit;
-/**
- * End Global Widget Declarations.
- */
-#endif
diff --git a/src/mbedit/mbedit_prog.c b/src/mbedit/mbedit_prog.c
deleted file mode 100644
index 0c1317d..0000000
--- a/src/mbedit/mbedit_prog.c
+++ /dev/null
@@ -1,7300 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbedit.c	4/8/93
- *    $Id: mbedit_prog.c 2252 2015-07-01 19:35:37Z caress $
- *
- *    Copyright (c) 1993-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * MBEDIT is an interactive beam editor for multibeam bathymetry data.
- * It can work with any data format supported by the MBIO library.
- * This version uses the MOTIF toolkit and has been developed using
- * the Builder Xsessory package by ICS.  This file contains
- * the code that does not directly depend on the MOTIF interface - the
- * companion file mbedit.c contains the user interface related
- * code.
- *
- * Author:	D. W. Caress
- * Date:	April 8, 1993
- * Date:	March 28, 1997  GUI recast
- * Date:	September 19, 2000 (New version - no buffered i/o)
- *
- *
- */
-
-/*--------------------------------------------------------------------*/
-
-/* standard include files */
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <math.h>
-#include <string.h>
-#include <sys/stat.h>
-#include <time.h>
-#include <X11/Intrinsic.h>
-
-/* MBIO include files */
-#include "mb_format.h"
-#include "mb_status.h"
-#include "mb_define.h"
-#include "mb_io.h"
-#include "mb_swap.h"
-#include "mb_process.h"
-#include "mb_xgraphics.h"
-#include "mbedit.h"
-
-/* output mode defines */
-#define	MBEDIT_OUTPUT_EDIT   1
-#define	MBEDIT_OUTPUT_BROWSE 2
-
-/* edit outbounds defines */
-#define	MBEDIT_OUTBOUNDS_NONE		0
-#define	MBEDIT_OUTBOUNDS_FLAGGED	1
-#define	MBEDIT_OUTBOUNDS_UNFLAGGED	2
-
-/* plot modes */
-#define MBEDIT_PLOT_WIDE		0
-#define MBEDIT_PLOT_TIME		1
-#define MBEDIT_PLOT_INTERVAL		2
-#define MBEDIT_PLOT_LON			3
-#define MBEDIT_PLOT_LAT			4
-#define MBEDIT_PLOT_HEADING		5
-#define MBEDIT_PLOT_SPEED		6
-#define MBEDIT_PLOT_DEPTH		7
-#define MBEDIT_PLOT_ALTITUDE		8
-#define MBEDIT_PLOT_SONARDEPTH		9
-#define MBEDIT_PLOT_ROLL		10
-#define MBEDIT_PLOT_PITCH		11
-#define MBEDIT_PLOT_HEAVE		12
-
-/* view modes */
-#define MBEDIT_VIEW_WATERFALL		0
-#define MBEDIT_VIEW_ALONGTRACK		1
-#define MBEDIT_VIEW_ACROSSTRACK		2
-#define MBEDIT_SHOW_FLAG		0
-#define MBEDIT_SHOW_DETECT		1
-#define MBEDIT_SHOW_PULSE		2
-
-/* grab modes */
-#define MBEDIT_GRAB_START		0
-#define MBEDIT_GRAB_MOVE		1
-#define MBEDIT_GRAB_END			2
-
-/* Bottom detect type names */
-char *detect_name[] =
-	{	"Unknown",
-		"Amplitude",
-		"Phase"
-	};
-
-/* Source pulse type names */
-char *pulse_name[] =
-	{	"Unknown",
-		"CW",
-		"Up-Chirp",
-		"Down-Chirp"
-	};
-
-/* ping structure definition */
-struct mbedit_ping_struct
-	{
-	int	allocated;
-	int	id;
-	int	record;
-	int	outbounds;
-	int	time_i[7];
-	double	time_d;
-	int	multiplicity;
-	double	time_interval;
-	double	navlon;
-	double	navlat;
-	double	speed;
-	double	heading;
-	double	altitude;
-	double	sonardepth;
-	double	roll;
-	double	pitch;
-	double	heave;
-	double	distance;
-	int	beams_bath;
-	char	*beamflag;
-	char	*beamflagorg;
-	double	*bath;
-	double	*bathacrosstrack;
-	double	*bathalongtrack;
-	int	*detect;
-	int	*pulses;
-	int	*bath_x;
-	int	*bath_y;
-	int	label_x;
-	int	label_y;
-	int	zap_x1;
-	int	zap_x2;
-	int	zap_y1;
-	int	zap_y2;
-	};
-
-/* id variables */
-static char svn_id[] = "$Id: mbedit_prog.c 2252 2015-07-01 19:35:37Z caress $";
-static char program_name[] = "MBedit";
-static char help_message[] =
-"MBedit is an interactive editor used to identify and flag\n\
-artifacts in swath sonar bathymetry data. Once a file has\n\
-been read in, MBedit displays the bathymetry profiles from\n\
-several pings, allowing the user to identify and flag\n\
-anomalous beams. Flagging is handled internally by setting\n\
-depth values negative, so that no information is lost.";
-static char usage_message[] = "mbedit [-Byr/mo/da/hr/mn/sc -D  -Eyr/mo/da/hr/mn/sc \n\t-Fformat -Ifile -Ooutfile -S -X -V -H]";
-
-/* status variables */
-static int	error = MB_ERROR_NO_ERROR;
-static int	verbose = 0;
-static char	*message = NULL;
-
-/* MBIO control parameters */
-static int	format;
-static int	pings;
-static int	lonflip;
-static double	bounds[4];
-static int	btime_i[7];
-static int	etime_i[7];
-static double	btime_d;
-static double	etime_d;
-static double	speedmin;
-static double	timegap;
-static int	beams_bath;
-static int	beams_amp;
-static int	pixels_ss;
-static char	ifile[MB_PATH_MAXLINE];
-static void	*imbio_ptr = NULL;
-static int	output_mode = MBEDIT_OUTPUT_EDIT;
-static int	run_mbprocess = MB_NO;
-static int	gui_mode = MB_NO;
-static int	uselockfiles = MB_YES;
-
-/* mbio read and write values */
-static void	*store_ptr = NULL;
-static int	kind;
-static double	distance;
-static double	draft;
-static char	*beamflag = NULL;
-static double	*bath = NULL;
-static double	*bathacrosstrack = NULL;
-static double	*bathalongtrack = NULL;
-static double	*amp = NULL;
-static double	*ss = NULL;
-static double	*ssacrosstrack = NULL;
-static double	*ssalongtrack = NULL;
-static int	*detect = NULL;
-static int	*pulses = NULL;
-static int	*editcount = NULL;
-static char	comment[MB_COMMENT_MAXLINE];
-
-/* buffer control variables */
-#define	MBEDIT_BUFFER_SIZE	30000
-static int	file_open = MB_NO;
-static int	buff_size = MBEDIT_BUFFER_SIZE;
-static int	buff_size_max = MBEDIT_BUFFER_SIZE;
-static int	holdd_size = MBEDIT_BUFFER_SIZE / 1000;
-static int	nload = 0;
-static int	ndump = 0;
-static int	nbuff = 0;
-static int	current_id = 0;
-static int	nload_total = 0;
-static int	ndump_total = 0;
-static char	last_ping[MB_PATH_MAXLINE];
-static int	file_id;
-static int	num_files;
-
-/* info parameters */
-static int	info_set = MB_NO;
-static int	info_ping;
-static int	info_beam;
-static int	info_time_i[7];
-static double	info_time_d;
-static double	info_navlon;
-static double	info_navlat;
-static double	info_speed;
-static double	info_heading;
-static double	info_altitude;
-static int	info_beams_bath;
-static char	info_beamflag;
-static double	info_bath;
-static double	info_bathacrosstrack;
-static double	info_bathalongtrack;
-static int	info_detect;
-static int	info_pulse;
-
-/* grab parameters */
-static int	grab_set = MB_NO;
-static int	grab_start_x;
-static int	grab_start_y;
-static int	grab_end_x;
-static int	grab_end_y;
-
-/* save file control variables */
-static int	esffile_open = MB_NO;
-struct mb_esf_struct esf;
-static char	esffile[MB_PATH_MAXLINE];
-static char	notice[MB_PATH_MAXLINE];
-
-/* filter variables */
-static int	filter_medianspike = MB_NO;
-static int	filter_medianspike_threshold = 10;
-static int	filter_medianspike_xtrack = 5;
-static int	filter_medianspike_ltrack = 1;
-static int	filter_wrongside = MB_NO;
-static int	filter_wrongside_threshold = 15;
-static int	filter_cutbeam = MB_NO;
-static int	filter_cutbeam_begin = 0;
-static int	filter_cutbeam_end = 0;
-static int	filter_cutdistance = MB_NO;
-static double	filter_cutdistance_begin = 0.0;
-static double	filter_cutdistance_end = 0.0;
-static int	filter_cutangle = MB_NO;
-static double	filter_cutangle_begin = 0.0;
-static double	filter_cutangle_end = 0.0;
-
-/* ping drawing control variables */
-#define	MBEDIT_MAX_PINGS	250
-#define	MBEDIT_PICK_DISTANCE	50
-#define	MBEDIT_ERASE_DISTANCE	15
-struct mbedit_ping_struct	ping[MBEDIT_BUFFER_SIZE];
-static int	view_mode = MBEDIT_VIEW_WATERFALL;
-static int	plot_size = 10;
-static int	nplot = 0;
-static void	*mbedit_xgid;
-static int	borders[4];
-static int	margin;
-static int	xmin, xmax;
-static int	ymin, ymax;
-static int	exager = 100;
-static int	plot_width = 5000;
-static double	xscale;
-static double	yscale;
-static int	x_interval = 1000;
-static int	y_interval = 250;
-static int	show_mode = MBEDIT_SHOW_FLAG;
-static int	show_flagged = MB_NO;
-static int	show_time = MBEDIT_PLOT_TIME;
-static int	beam_save = MB_NO;
-static int	iping_save = 0;
-static int	jbeam_save = 0;
-static double	*bathlist;
-
-/* color control values */
-#define	WHITE	0
-#define	BLACK	1
-#define RED	2
-#define GREEN	3
-#define BLUE	4
-#define CORAL	5
-#define LIGHTGREY	6
-#define	XG_SOLIDLINE	0
-#define	XG_DASHLINE	1
-static int	ncolors;
-static unsigned int	pixel_values[256];
-
-/*--------------------------------------------------------------------*/
-int mbedit_init(int argc, char ** argv, int *startup_file)
-{
-	/* local variables */
-	char	*function_name = "mbedit_init";
-	int	status = MB_SUCCESS;
-	int	fileflag = 0;
-	int	i;
-
-	/* parsing variables */
-	extern char *optarg;
-	int	errflg = 0;
-	int	c;
-	int	help = 0;
-	int	flag = 0;
-
-	/* set default values */
-	status = mb_defaults(verbose,&format,&pings,&lonflip,bounds,
-		btime_i,etime_i,&speedmin,&timegap);
-	status = mb_uselockfiles(verbose,&uselockfiles);
-	format = 0;
-	pings = 1;
-	lonflip = 0;
-	bounds[0] = -360.;
-	bounds[1] = 360.;
-	bounds[2] = -90.;
-	bounds[3] = 90.;
-	btime_i[0] = 1962;
-	btime_i[1] = 2;
-	btime_i[2] = 21;
-	btime_i[3] = 10;
-	btime_i[4] = 30;
-	btime_i[5] = 0;
-	btime_i[6] = 0;
-	etime_i[0] = 2062;
-	etime_i[1] = 2;
-	etime_i[2] = 21;
-	etime_i[3] = 10;
-	etime_i[4] = 30;
-	etime_i[5] = 0;
-	etime_i[6] = 0;
-	speedmin = 0.0;
-	timegap = 1000000000.0;
-	strcpy(ifile,"\0");
-
-	/* process argument list */
-	while ((c = getopt(argc, argv, "VvHhB:b:DdE:e:F:f:GgI:i:SsXx")) != -1)
-	  {
-	  switch (c)
-		{
-		case 'H':
-		case 'h':
-			help++;
-			break;
-		case 'V':
-		case 'v':
-			verbose++;
-			break;
-		case 'B':
-		case 'b':
-			sscanf (optarg,"%d/%d/%d/%d/%d/%d",
-				&btime_i[0],&btime_i[1],&btime_i[2],
-				&btime_i[3],&btime_i[4],&btime_i[5]);
-			btime_i[6] = 0;
-			flag++;
-			break;
-		case 'D':
-		case 'd':
-			output_mode = MBEDIT_OUTPUT_BROWSE;
-			flag++;
-			break;
-		case 'E':
-		case 'e':
-			sscanf (optarg,"%d/%d/%d/%d/%d/%d",
-				&etime_i[0],&etime_i[1],&etime_i[2],
-				&etime_i[3],&etime_i[4],&etime_i[5]);
-			etime_i[6] = 0;
-			flag++;
-			break;
-		case 'F':
-		case 'f':
-			sscanf (optarg,"%d", &format);
-			flag++;
-			break;
-		case 'G':
-		case 'g':
-			gui_mode = MB_YES;
-			flag++;
-			break;
-		case 'I':
-		case 'i':
-			sscanf (optarg,"%s", ifile);
-			do_parse_datalist(ifile, format);
-			flag++;
-			fileflag++;
-			break;
-		case 'X':
-		case 'x':
-			run_mbprocess = MB_YES;
-			flag++;
-			break;
-		case '?':
-			errflg++;
-		}
-	    }
-
-	/* if error flagged then print it and exit */
-	if (errflg)
-		{
-		fprintf(stderr,"usage: %s\n", usage_message);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		error = MB_ERROR_BAD_USAGE;
-		exit(error);
-		}
-
-	/* print starting message */
-	if (verbose == 1 || help)
-		{
-		fprintf(stderr,"\nProgram %s\n",program_name);
-		fprintf(stderr,"Version %s\n",svn_id);
-		fprintf(stderr,"MB-system Version %s\n",MB_VERSION);
-		}
-
-	/* print starting debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  Program <%s>\n",program_name);
-		fprintf(stderr,"dbg2  Version %s\n",svn_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Control Parameters:\n");
-		fprintf(stderr,"dbg2       verbose:         %d\n",verbose);
-		fprintf(stderr,"dbg2       help:            %d\n",help);
-		fprintf(stderr,"dbg2       format:          %d\n",format);
-		fprintf(stderr,"dbg2       input file:      %s\n",ifile);
-		fprintf(stderr,"dbg2       output mode:     %d\n",output_mode);
-		}
-
-	/* if help desired then print it and exit */
-	if (help)
-		{
-		fprintf(stderr,"\n%s\n",help_message);
-		fprintf(stderr,"\nusage: %s\n", usage_message);
-		exit(error);
-		}
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       argc:      %d\n",argc);
-		for (i=0;i<argc;i++)
-			fprintf(stderr,"dbg2       argv[%d]:    %s\n",
-				i,argv[i]);
-		}
-
-	/* if file specified then use it */
-	if (fileflag > 0)
-		*startup_file = MB_YES;
-	else
-		*startup_file = MB_NO;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       startup_file: %d\n",*startup_file);
-		fprintf(stderr,"dbg2       error:        %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbedit_set_graphics(void *xgid, int ncol, unsigned int *pixels)
-{
-	/* local variables */
-	char	*function_name = "mbedit_set_graphics";
-	int	status = MB_SUCCESS;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       xgid:         %p\n",xgid);
-		fprintf(stderr,"dbg2       ncolors:      %d\n",ncol);
-		for (i=0;i<ncol;i++)
-			fprintf(stderr,"dbg2       pixel[%d]:     %d\n",
-				i, pixels[i]);
-		}
-
-	/* set graphics id */
-	mbedit_xgid = xgid;
-
-	/* set colors */
-	ncolors = ncol;
-	for (i=0;i<ncolors;i++)
-		pixel_values[i] = pixels[i];
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbedit_set_scaling(int *brdr, int sh_time)
-{
-	/* local variables */
-	char	*function_name = "mbedit_set_scaling";
-	int	status = MB_SUCCESS;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		for (i=0;i<4;i++)
-			fprintf(stderr,"dbg2       brdr[%d]:     %d\n",
-				i,brdr[i]);
-		fprintf(stderr,"dbg2       show_time:      %d\n",sh_time);
-		}
-
-	/* set graphics bounds */
-	for (i=0;i<4;i++)
-		borders[i] = brdr[i];
-
-	/* set scaling */
-	show_time = sh_time;
-	if (show_time > MBEDIT_PLOT_WIDE)
-		{
-		margin = (borders[1] - borders[0])/16;
-		xmin = 5 * margin;
-		xmax = borders[1] - margin;
-		ymin = margin;
-		ymax = borders[3] - margin/2;
-		xscale = 100.0 * plot_width / (xmax - xmin);
-		yscale = (xscale * exager) / 100.0;
-		}
-	else
-		{
-		margin = (borders[1] - borders[0])/16;
-		xmin = 2 * margin + 20;
-		xmax = borders[1] - margin;
-		ymin = margin;
-		ymax = borders[3] - margin/2;
-		xscale = 100.0 * plot_width / (xmax - xmin);
-		yscale = (xscale * exager) / 100.0;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbedit_set_filters(int f_m, int f_m_t,
-			int f_m_x, int f_m_l,
-			int f_w, int f_w_t,
-			int f_b, int f_b_b, int f_b_e,
-			int f_d, double f_d_b, double f_d_e,
-			int f_a, double f_a_b, double f_a_e)
-{
-	/* local variables */
-	char	*function_name = "mbedit_set_filters";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2       f_m:     %d\n",f_m);
-		fprintf(stderr,"dbg2       f_m_t:   %d\n",f_m_t);
-		fprintf(stderr,"dbg2       f_m_x:   %d\n",f_m_x);
-		fprintf(stderr,"dbg2       f_m_l:   %d\n",f_m_l);
- 		fprintf(stderr,"dbg2       f_w:     %d\n",f_w);
-		fprintf(stderr,"dbg2       f_w_t:   %d\n",f_w_t);
- 		fprintf(stderr,"dbg2       f_b:     %d\n",f_b);
-		fprintf(stderr,"dbg2       f_b_b:   %d\n",f_b_b);
-		fprintf(stderr,"dbg2       f_b_e:   %d\n",f_b_e);
- 		fprintf(stderr,"dbg2       f_d:     %d\n",f_d);
-		fprintf(stderr,"dbg2       f_d_b:   %f\n",f_d_b);
-		fprintf(stderr,"dbg2       f_d_e:   %f\n",f_d_e);
- 		fprintf(stderr,"dbg2       f_a:     %d\n",f_a);
-		fprintf(stderr,"dbg2       f_a_b:   %f\n",f_a_b);
-		fprintf(stderr,"dbg2       f_a_e:   %f\n",f_a_e);
- 		}
-
- 	/* set the filter values */
- 	filter_medianspike = f_m;
- 	filter_medianspike_threshold = f_m_t;
-	filter_medianspike_xtrack = f_m_x;
-	filter_medianspike_ltrack = f_m_l;
- 	filter_wrongside = f_w;
- 	filter_wrongside_threshold = f_w_t;
- 	filter_cutbeam = f_b;
- 	filter_cutbeam_begin = f_b_b;
- 	filter_cutbeam_end = f_b_e;
- 	filter_cutdistance = f_d;
- 	filter_cutdistance_begin = f_d_b;
- 	filter_cutdistance_end = f_d_e;
- 	filter_cutangle = f_a;
- 	filter_cutangle_begin = f_a_b;
- 	filter_cutangle_end = f_a_e;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbedit_get_filters( int *b_m, double *d_m,
-			int *f_m, int *f_m_t,
-			int *f_m_x, int *f_m_l,
-			int *f_w, int *f_w_t,
-			int *f_b, int *f_b_b, int *f_b_e,
-			int *f_d, double *f_d_b, double *f_d_e,
-			int *f_a, double *f_a_b, double *f_a_e)
-{
-	/* local variables */
-	char	*function_name = "mbedit_get_filters";
-	int	status = MB_SUCCESS;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2       b_m:     %p\n",b_m);
-		fprintf(stderr,"dbg2       d_m:     %p\n",d_m);
- 		fprintf(stderr,"dbg2       f_m:     %p\n",f_m);
-		fprintf(stderr,"dbg2       f_m_t:   %p\n",f_m_t);
-		fprintf(stderr,"dbg2       f_m_x:   %p\n",f_m_x);
-		fprintf(stderr,"dbg2       f_m_l:   %p\n",f_m_l);
- 		fprintf(stderr,"dbg2       f_w:     %p\n",f_w);
-		fprintf(stderr,"dbg2       f_w_t:   %p\n",f_w_t);
- 		fprintf(stderr,"dbg2       f_b:     %p\n",f_b);
-		fprintf(stderr,"dbg2       f_b_b:   %p\n",f_b_b);
-		fprintf(stderr,"dbg2       f_b_e:   %p\n",f_b_e);
- 		fprintf(stderr,"dbg2       f_d:     %p\n",f_d);
-		fprintf(stderr,"dbg2       f_d_b:   %p\n",f_d_b);
-		fprintf(stderr,"dbg2       f_d_e:   %p\n",f_d_e);
- 		fprintf(stderr,"dbg2       f_a:     %p\n",f_a);
-		fprintf(stderr,"dbg2       f_a_b:   %p\n",f_a_b);
-		fprintf(stderr,"dbg2       f_a_e:   %p\n",f_a_e);
-		}
-
-	/* set max beam number and acrosstrack distance */
-	*b_m = 0;
-	*d_m = 0.0;
-	if (file_open == MB_YES)
-		{
-		/* loop over all pings */
-		for (i=0;i<nbuff;i++)
-		    {
-		    for (j=0;j<ping[i].beams_bath;j++)
-			{
-			if (mb_beam_ok(ping[i].beamflag[j]))
-			    {
-			    *b_m = MAX(*b_m, ping[i].beams_bath);
-			    *d_m = MAX(*d_m, fabs(ping[i].bathacrosstrack[j]));;
-			    }
-			}
-		    }
-		}
-	if (*b_m == 0)
- 		*b_m = 200;
-	if (*d_m == 0.0)
- 		*d_m = 10000.0;
-
- 	/* set the filter values */
- 	*f_m = filter_medianspike;
- 	*f_m_t = filter_medianspike_threshold;
- 	*f_m_x = filter_medianspike_xtrack;
- 	*f_m_l = filter_medianspike_ltrack;
- 	*f_w = filter_wrongside;
- 	*f_w_t = filter_wrongside_threshold;
- 	*f_b = filter_cutbeam;
- 	*f_b_b = filter_cutbeam_begin;
- 	*f_b_e = filter_cutbeam_end;
- 	*f_d = filter_cutdistance;
- 	*f_d_b = filter_cutdistance_begin;
- 	*f_d_e = filter_cutdistance_end;
- 	*f_a = filter_cutangle;
- 	*f_a_b = filter_cutangle_begin;
- 	*f_a_e = filter_cutangle_end;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       b_m:     %d\n",*b_m);
-		fprintf(stderr,"dbg2       d_m:     %f\n",*d_m);
-		fprintf(stderr,"dbg2       f_m:     %d\n",*f_m);
-		fprintf(stderr,"dbg2       f_m_t:   %d\n",*f_m_t);
-		fprintf(stderr,"dbg2       f_m_x:   %d\n",*f_m_x);
-		fprintf(stderr,"dbg2       f_m_l:   %d\n",*f_m_l);
- 		fprintf(stderr,"dbg2       f_w:     %d\n",*f_w);
-		fprintf(stderr,"dbg2       f_w_t:   %d\n",*f_w_t);
- 		fprintf(stderr,"dbg2       f_b:     %d\n",*f_b);
-		fprintf(stderr,"dbg2       f_b_b:   %d\n",*f_b_b);
-		fprintf(stderr,"dbg2       f_b_e:   %d\n",*f_b_e);
- 		fprintf(stderr,"dbg2       f_d:     %d\n",*f_d);
-		fprintf(stderr,"dbg2       f_d_b:   %f\n",*f_d_b);
-		fprintf(stderr,"dbg2       f_d_e:   %f\n",*f_d_e);
- 		fprintf(stderr,"dbg2       f_a:     %d\n",*f_a);
-		fprintf(stderr,"dbg2       f_a_b:   %f\n",*f_a_b);
-		fprintf(stderr,"dbg2       f_a_e:   %f\n",*f_a_e);
-		fprintf(stderr,"dbg2       error:   %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbedit_get_defaults(
-		int	*plt_size_max,
-		int	*plt_size,
-		int	*sh_mode,
-		int	*sh_flggd,
-		int	*sh_time,
-		int	*buffer_size_max,
-		int	*buffer_size,
-		int	*hold_size,
-		int	*form,
-		int	*plwd,
-		int	*exgr,
-		int	*xntrvl,
-		int	*yntrvl,
-		int	*ttime_i,
-		int	*outmode)
-{
-	/* local variables */
-	char	*function_name = "mbedit_get_defaults";
-	int	status = MB_SUCCESS;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
-
-	/* get maximum number of pings to plot */
-	*plt_size_max = MBEDIT_MAX_PINGS;
-	*plt_size = plot_size;
-
-	/* get show mode flag */
-	*sh_mode = show_mode;
-
-	/* get show flagged flag */
-	*sh_flggd = show_flagged;
-
-	/* get show time flag */
-	*sh_time = show_time;
-
-	/* get maximum and starting buffer sizes */
-	*buffer_size_max = buff_size_max;
-	*buffer_size = buff_size;
-
-	/* get starting hold size */
-	*hold_size = holdd_size;
-
-	/* get format */
-	*form = format;
-
-	/* get scaling */
-	*plwd = plot_width;
-	*exgr = exager;
-
-	/* get tick intervals */
-	*xntrvl = x_interval;
-	*yntrvl = y_interval;
-
-	/* get time of first data */
-	if (file_open == MB_YES && nbuff > 0)
-		{
-		for (i=0;i<7;i++)
-			ttime_i[i] = ping[0].time_i[i];
-		}
-	else
-		for (i=0;i<7;i++)
-			ttime_i[i] = btime_i[i];
-
-	/* get output mode */
-	*outmode = output_mode;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       plot max:    %d\n",*plt_size_max);
-		fprintf(stderr,"dbg2       plot_size:   %d\n",*plt_size);
-		fprintf(stderr,"dbg2       show_mode:   %d\n",*sh_mode);
-		fprintf(stderr,"dbg2       show_flagged:%d\n",*sh_flggd);
-		fprintf(stderr,"dbg2       show_time:   %d\n",*sh_time);
-		fprintf(stderr,"dbg2       buffer max:  %d\n",*buffer_size_max);
-		fprintf(stderr,"dbg2       buffer_size: %d\n",*buffer_size);
-		fprintf(stderr,"dbg2       hold_size:   %d\n",*hold_size);
-		fprintf(stderr,"dbg2       format:      %d\n",*form);
-		fprintf(stderr,"dbg2       plot_width:  %d\n",*plwd);
-		fprintf(stderr,"dbg2       exager:      %d\n",*exgr);
-		fprintf(stderr,"dbg2       x_interval:  %d\n",*xntrvl);
-		fprintf(stderr,"dbg2       y_interval:  %d\n",*yntrvl);
-		for (i=0;i<7;i++)
-			fprintf(stderr,"dbg2       ttime[%d]:    %d\n",
-				i, ttime_i[i]);
-		fprintf(stderr,"dbg2       outmode:     %d\n",*outmode);
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbedit_get_viewmode(int *vw_mode)
-{
-	/* local variables */
-	char	*function_name = "mbedit_get_viewmode";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
-
-	/* get view mode */
-	*vw_mode = view_mode;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       view_mode:   %d\n",*vw_mode);
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbedit_set_viewmode(int vw_mode)
-{
-	/* local variables */
-	char	*function_name = "mbedit_set_viewmode";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       view_mode:   %d\n",vw_mode);
-		}
-
-	/* get view mode */
-	view_mode = vw_mode;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbedit_action_open(
-		char	*file,
-		int	form,
-		int	fileid,
-		int	numfiles,
-		int	savemode,
-		int	outmode,
-		int	plwd,
-		int	exgr,
-		int	xntrvl,
-		int	yntrvl,
-		int	plt_size,
-		int	sh_mode,
-		int	sh_flggd,
-		int	sh_time,
-		int	*buffer_size,
-		int	*buffer_size_max,
-		int	*hold_size,
-		int	*ndumped,
-		int	*nloaded,
-		int	*nbuffer,
-		int	*ngood,
-		int	*icurrent,
-		int	*nplt)
-{
-	/* local variables */
-	char	*function_name = "mbedit_action_open";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       file:            %s\n",file);
-		fprintf(stderr,"dbg2       format:          %d\n",form);
-		fprintf(stderr,"dbg2       fileid:          %d\n",fileid);
-		fprintf(stderr,"dbg2       numfiles:        %d\n",numfiles);
-		fprintf(stderr,"dbg2       savemode:        %d\n",savemode);
-		fprintf(stderr,"dbg2       outmode:         %d\n",outmode);
-		fprintf(stderr,"dbg2       plot_width:      %d\n",plwd);
-		fprintf(stderr,"dbg2       exager:          %d\n",exgr);
-		fprintf(stderr,"dbg2       x_interval:      %d\n",xntrvl);
-		fprintf(stderr,"dbg2       y_interval:      %d\n",yntrvl);
-		fprintf(stderr,"dbg2       plot_size:       %d\n",plt_size);
-		fprintf(stderr,"dbg2       show_mode:       %d\n",sh_mode);
-		fprintf(stderr,"dbg2       show_flagged:    %d\n",sh_flggd);
-		fprintf(stderr,"dbg2       show_time:       %d\n",sh_time);
-		fprintf(stderr,"dbg2       buffer_size:     %d\n",*buffer_size);
-		fprintf(stderr,"dbg2       buffer_size_max: %d\n",*buffer_size_max);
-		fprintf(stderr,"dbg2       hold_size:       %d\n",*hold_size);
-		}
-
-	/* reset info */
-	info_set = MB_NO;
-
-	/* set the output mode */
-	output_mode = outmode;
-
-	/* clear the screen */
-	status = mbedit_clear_screen();
-
-	/* open the file */
-	status = mbedit_open_file(file, form, savemode);
-
-	/* check buffer size */
-	if (status == MB_SUCCESS)
-		{
-		if (*hold_size > *buffer_size)
-			*hold_size = *buffer_size / 2;
-		buff_size = *buffer_size;
-		buff_size_max = *buffer_size_max;
-		holdd_size = *hold_size;
-		}
-
-	/* load the buffer */
-	if (status == MB_SUCCESS)
-		{
-		status = mbedit_load_data(*buffer_size,nloaded,nbuffer,
-			ngood,icurrent);
-
-		/* if no data read show error dialog */
-		if (*nloaded == 0)
-			do_error_dialog("No data were loaded from the input",
-					"file. You may have specified an",
-					"incorrect MB-System format id!");
-		}
-
-	/* set up plotting */
-	if (status == MB_SUCCESS && *ngood > 0)
-		{
-		/* turn file button off */
-		do_filebutton_off();
-
-		/* now plot it */
-		status = mbedit_plot_all(plwd,exgr,xntrvl,yntrvl,
-			    plt_size,sh_mode,sh_flggd,sh_time,nplt,MB_YES);
-
-		/* set fileid and numfiles */
-		file_id = fileid;
-		num_files = numfiles;
-		}
-
-	/* reset beam_save */
-	beam_save = MB_NO;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       buffer_size:     %d\n",*buffer_size);
-		fprintf(stderr,"dbg2       buffer_size_max: %d\n",*buffer_size_max);
-		fprintf(stderr,"dbg2       hold_size:       %d\n",*hold_size);
-		fprintf(stderr,"dbg2       ndumped:         %d\n",*ndumped);
-		fprintf(stderr,"dbg2       nloaded:         %d\n",*nloaded);
-		fprintf(stderr,"dbg2       nbuffer:         %d\n",*nbuffer);
-		fprintf(stderr,"dbg2       ngood:           %d\n",*ngood);
-		fprintf(stderr,"dbg2       icurrent:        %d\n",*icurrent);
-		fprintf(stderr,"dbg2       nplot:           %d\n",*nplt);
-		fprintf(stderr,"dbg2       error:           %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbedit_action_next_buffer(
-		int	hold_size,
-		int	buffer_size,
-		int	plwd,
-		int	exgr,
-		int	xntrvl,
-		int	yntrvl,
-		int	plt_size,
-		int	sh_mode,
-		int	sh_flggd,
-		int	sh_time,
-		int	*ndumped,
-		int	*nloaded,
-		int	*nbuffer,
-		int	*ngood,
-		int	*icurrent,
-		int	*nplt,
-		int	*quit)
-{
-	/* local variables */
-	char	*function_name = "mbedit_action_next_buffer";
-	int	status = MB_SUCCESS;
-	int	save_dumped = 0;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       hold_size:   %d\n",hold_size);
-		fprintf(stderr,"dbg2       buffer_size: %d\n",buffer_size);
-		fprintf(stderr,"dbg2       plot_width:  %d\n",plwd);
-		fprintf(stderr,"dbg2       exager:      %d\n",exgr);
-		fprintf(stderr,"dbg2       x_interval:  %d\n",xntrvl);
-		fprintf(stderr,"dbg2       y_interval:  %d\n",yntrvl);
-		fprintf(stderr,"dbg2       plot_size:   %d\n",plt_size);
-		fprintf(stderr,"dbg2       show_mode:   %d\n",sh_mode);
-		fprintf(stderr,"dbg2       show_flagged:%d\n",sh_flggd);
-		fprintf(stderr,"dbg2       show_time:   %d\n",sh_time);
-		}
-
-	/* reset info */
-	info_set = MB_NO;
-
-	/* clear the screen */
-	status = mbedit_clear_screen();
-
-	/* set quit off */
-	*quit = MB_NO;
-
-	/* check if a file has been opened */
-	if (file_open == MB_YES)
-		{
-		/* set buffer size */
-		buff_size = buffer_size;
-		holdd_size = hold_size;
-
-		/* keep going until good data or end of file found */
-		do
-			{
-			/* dump the buffer */
-			status = mbedit_dump_data(hold_size,ndumped,nbuffer);
-
-			/* load the buffer */
-			status = mbedit_load_data(buffer_size,nloaded,nbuffer,
-				ngood,icurrent);
-			}
-		while (*nloaded > 0 && *ngood == 0);
-
-		/* if end of file reached then
-			dump last buffer and close file */
-		if (*nloaded <= 0)
-			{
-			save_dumped = *ndumped;
-			status = mbedit_dump_data(0,ndumped,nbuffer);
-			status = mbedit_close_file();
-			*ndumped = *ndumped + save_dumped;
-			*nplt = 0;
-
-			/* if in normal mode last next_buffer
-				does not mean quit,
-				if in gui mode it does mean quit */
-			if (gui_mode == MB_YES)
-				*quit = MB_YES;
-			else
-				*quit = MB_NO;
-
-			/* if quitting let the world know... */
-			if (*quit == MB_YES && verbose >= 1)
-				fprintf(stderr,"\nQuitting MBedit\nBye Bye...\n");
-			}
-
-		/* else set up plotting */
-		else
-			{
-			status = mbedit_plot_all(plwd,exgr,xntrvl,yntrvl,
-				plt_size,sh_mode,sh_flggd,sh_time,nplt,MB_YES);
-			}
-		}
-
-	/* if no file open set failure status */
-	else
-		{
-		status = MB_FAILURE;
-		*ndumped = 0;
-		*nloaded = 0;
-		*nbuffer = nbuff;
-		*ngood = nbuff;
-		current_id = 0;
-		*icurrent = current_id;
-		*nplt = 0;
-		}
-
-	/* reset beam_save */
-	beam_save = MB_NO;
-
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       ndumped:     %d\n",*ndumped);
-		fprintf(stderr,"dbg2       nloaded:     %d\n",*nloaded);
-		fprintf(stderr,"dbg2       nbuffer:     %d\n",*nbuffer);
-		fprintf(stderr,"dbg2       ngood:       %d\n",*ngood);
-		fprintf(stderr,"dbg2       icurrent:    %d\n",*icurrent);
-		fprintf(stderr,"dbg2       nplot:       %d\n",*nplt);
-		fprintf(stderr,"dbg2       quit:        %d\n",*quit);
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbedit_action_close(
-		int	buffer_size,
-		int	*ndumped,
-		int	*nloaded,
-		int	*nbuffer,
-		int	*ngood,
-		int	*icurrent)
-{
-	/* local variables */
-	char	*function_name = "mbedit_action_close";
-	int	status = MB_SUCCESS;
-	int	save_nloaded = 0;
-	int	save_ndumped = 0;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       buffer_size: %d\n",buffer_size);
-		}
-
-	/* reset info */
-	info_set = MB_NO;
-
-	/* clear the screen */
-	status = mbedit_clear_screen();
-
-	/* if file has been opened and in browse mode
-		just dump the current buffer and close the file */
-	if (file_open == MB_YES
-		&& (output_mode == MBEDIT_OUTPUT_BROWSE
-		    || (output_mode == MBEDIT_OUTPUT_EDIT
-			&& esf.nedit == 0)))
-		{
-
-		/* dump the buffer */
-		status = mbedit_dump_data(0,ndumped,nbuffer);
-		save_ndumped = save_ndumped + *ndumped;
-		*ndumped = save_ndumped;
-		*nloaded = save_nloaded;
-
-		/* now close the file */
-		status = mbedit_close_file();
-		}
-
-	/* if file has been opened deal with all of the data */
-	else if (file_open == MB_YES)
-		{
-
-		/* dump and load until the end of the file is reached */
-		do
-			{
-			/* dump the buffer */
-			status = mbedit_dump_data(0,ndumped,nbuffer);
-			save_ndumped = save_ndumped + *ndumped;
-
-			/* load the buffer */
-			status = mbedit_load_data(buffer_size,nloaded,nbuffer,ngood,icurrent);
-			save_nloaded = save_nloaded + *nloaded;
-			}
-		while (*nloaded > 0);
-		*ndumped = save_ndumped;
-		*nloaded = save_nloaded;
-
-		/* now close the file */
-		status = mbedit_close_file();
-		}
-
-	else
-		{
-		*ndumped = 0;
-		*nloaded = 0;
-		*nbuffer = 0;
-		*ngood = 0;
-		*icurrent = 0;
-		status = MB_FAILURE;
-		}
-
-	/* reset beam_save */
-	beam_save = MB_NO;
-
-	/* let the world know... */
-	if (verbose >= 1)
-		{
-		fprintf(stderr,"\nLast ping viewed: %s\n",last_ping);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       ndumped:     %d\n",*ndumped);
-		fprintf(stderr,"dbg2       nloaded:     %d\n",*nloaded);
-		fprintf(stderr,"dbg2       nbuffer:     %d\n",*nbuffer);
-		fprintf(stderr,"dbg2       ngood:       %d\n",*ngood);
-		fprintf(stderr,"dbg2       icurrent:    %d\n",*icurrent);
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbedit_action_done(
-		int	buffer_size,
-		int	*ndumped,
-		int	*nloaded,
-		int	*nbuffer,
-		int	*ngood,
-		int	*icurrent,
-		int	*quit)
-{
-	/* local variables */
-	char	*function_name = "mbedit_action_done";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       buffer_size: %d\n",buffer_size);
-		}
-
-	/* reset info */
-	info_set = MB_NO;
-
-	/* if in normal mode done does not mean quit,
-		if in gui mode done does mean quit */
-	if (gui_mode == MB_YES)
-		*quit = MB_YES;
-	else
-		*quit = MB_NO;
-
-	/* if quitting let the world know... */
-	if (*quit == MB_YES && verbose >= 1)
-		fprintf(stderr,"\nShutting MBedit down without further ado...\n");
-
-	/* call routine to deal with saving the current file, if any */
-	if (file_open == MB_YES)
-		status = mbedit_action_close(buffer_size,ndumped,nloaded,
-			nbuffer,ngood,icurrent);
-
-	/* if quitting let the world know... */
-	if (*quit == MB_YES && verbose >= 1)
-		fprintf(stderr,"\nQuitting MBedit\nBye Bye...\n");
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       ndumped:     %d\n",*ndumped);
-		fprintf(stderr,"dbg2       nloaded:     %d\n",*nloaded);
-		fprintf(stderr,"dbg2       nbuffer:     %d\n",*nbuffer);
-		fprintf(stderr,"dbg2       ngood:       %d\n",*ngood);
-		fprintf(stderr,"dbg2       icurrent:    %d\n",*icurrent);
-		fprintf(stderr,"dbg2       quit:        %d\n",*quit);
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbedit_action_quit(
-		int	buffer_size,
-		int	*ndumped,
-		int	*nloaded,
-		int	*nbuffer,
-		int	*ngood,
-		int	*icurrent)
-{
-	/* local variables */
-	char	*function_name = "mbedit_action_quit";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       buffer_size: %d\n",buffer_size);
-		}
-
-	/* let the world know... */
-	if (verbose >= 1)
-		fprintf(stderr,"\nShutting MBedit down without further ado...\n");
-
-	/* reset info */
-	info_set = MB_NO;
-
-	/* call routine to deal with saving the current file, if any */
-	if (file_open == MB_YES)
-		status = mbedit_action_close(buffer_size,ndumped,nloaded,
-			nbuffer,ngood,icurrent);
-
-	/* let the world know... */
-	if (verbose >= 1)
-		fprintf(stderr,"\nQuitting MBedit\nBye Bye...\n");
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       ndumped:     %d\n",*ndumped);
-		fprintf(stderr,"dbg2       nloaded:     %d\n",*nloaded);
-		fprintf(stderr,"dbg2       nbuffer:     %d\n",*nbuffer);
-		fprintf(stderr,"dbg2       ngood:       %d\n",*ngood);
-		fprintf(stderr,"dbg2       icurrent:    %d\n",*icurrent);
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbedit_action_step(
-		int	step,
-		int	plwd,
-		int	exgr,
-		int	xntrvl,
-		int	yntrvl,
-		int	plt_size,
-		int	sh_mode,
-		int	sh_flggd,
-		int	sh_time,
-		int	*nbuffer,
-		int	*ngood,
-		int	*icurrent,
-		int	*nplt)
-{
-	/* local variables */
-	char	*function_name = "mbedit_action_step";
-	int	status = MB_SUCCESS;
-	int	old_id, new_id;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       step:        %d\n",step);
-		fprintf(stderr,"dbg2       plot_width:  %d\n",plwd);
-		fprintf(stderr,"dbg2       exager:      %d\n",exgr);
-		fprintf(stderr,"dbg2       x_interval:  %d\n",xntrvl);
-		fprintf(stderr,"dbg2       y_interval:  %d\n",yntrvl);
-		fprintf(stderr,"dbg2       plot_size:   %d\n",plt_size);
-		fprintf(stderr,"dbg2       show_mode:   %d\n",sh_mode);
-		fprintf(stderr,"dbg2       show_flagged:%d\n",sh_flggd);
-		fprintf(stderr,"dbg2       show_time:   %d\n",sh_time);
-		}
-
-	/* reset info */
-	info_set = MB_NO;
-
-	/* check if a file has been opened and there are data */
-	if (file_open == MB_YES && nbuff > 0)
-		{
-
-		/* figure out if stepping is possible */
-		old_id = current_id;
-		new_id = current_id + step;
-		if (new_id < 0)
-			new_id = 0;
-		if (new_id >= nbuff)
-			new_id = nbuff - 1;
-
-		/* set some return values */
-		*nbuffer = nbuff;
-		*ngood = nbuff;
-		current_id = new_id;
-		*icurrent = current_id;
-
-		/* set the plotting list */
-		if (*ngood > 0)
-			{
-			status = mbedit_plot_all(plwd,exgr,xntrvl,yntrvl,
-				    plt_size,sh_mode,sh_flggd,sh_time,nplt,MB_NO);
-			}
-
-		/* set failure flag if no step was made */
-		if (new_id == old_id)
-			status = MB_FAILURE;
-		}
-
-	/* if no file open set failure status */
-	else
-		{
-		status = MB_FAILURE;
-		*nbuffer = nbuff;
-		*ngood = nbuff;
-		current_id = 0;
-		*icurrent = current_id;
-		}
-
-	/* reset beam_save */
-	beam_save = MB_NO;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       nbuffer:     %d\n",*nbuffer);
-		fprintf(stderr,"dbg2       ngood:       %d\n",*ngood);
-		fprintf(stderr,"dbg2       icurrent:    %d\n",*icurrent);
-		fprintf(stderr,"dbg2       nplt:        %d\n",*nplt);
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbedit_action_plot(
-		int	plwd,
-		int	exgr,
-		int	xntrvl,
-		int	yntrvl,
-		int	plt_size,
-		int	sh_mode,
-		int	sh_flggd,
-		int	sh_time,
-		int	*nbuffer,
-		int	*ngood,
-		int	*icurrent,
-		int	*nplt)
-{
-	/* local variables */
-	char	*function_name = "mbedit_action_plot";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       plot_width:  %d\n",plwd);
-		fprintf(stderr,"dbg2       exager:      %d\n",exgr);
-		fprintf(stderr,"dbg2       x_interval:  %d\n",xntrvl);
-		fprintf(stderr,"dbg2       y_interval:  %d\n",yntrvl);
-		fprintf(stderr,"dbg2       plot_size:   %d\n",plt_size);
-		fprintf(stderr,"dbg2       show_mode:   %d\n",sh_mode);
-		fprintf(stderr,"dbg2       show_flagged:%d\n",sh_flggd);
-		fprintf(stderr,"dbg2       show_time:   %d\n",sh_time);
-		}
-
-	/* clear the screen */
-	mbedit_clear_screen();
-
-	/* check if a file has been opened */
-	if (file_open == MB_YES)
-		{
-
-		/* set some return values */
-		*nbuffer = nbuff;
-		*ngood = nbuff;
-		*icurrent = current_id;
-
-		/* set the plotting list */
-		if (*ngood > 0)
-			{
-			status = mbedit_plot_all(plwd,exgr,xntrvl,yntrvl,
-					plt_size,sh_mode,sh_flggd,sh_time,nplt,MB_NO);
-			}
-		}
-
-	/* if no file open set failure status */
-	else
-		{
-		status = MB_FAILURE;
-		*nbuffer = nbuff;
-		*nbuffer = nbuff;
-		*ngood = nbuff;
-		current_id = 0;
-		*icurrent = current_id;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       nbuffer:     %d\n",*nbuffer);
-		fprintf(stderr,"dbg2       ngood:       %d\n",*ngood);
-		fprintf(stderr,"dbg2       icurrent:    %d\n",*icurrent);
-		fprintf(stderr,"dbg2       nplt:        %d\n",*nplt);
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbedit_action_mouse_toggle(
-		int	x_loc,
-		int	y_loc,
-		int	plwd,
-		int	exgr,
-		int	xntrvl,
-		int	yntrvl,
-		int	plt_size,
-		int	sh_mode,
-		int	sh_flggd,
-		int	sh_time,
-		int	*nbuffer,
-		int	*ngood,
-		int	*icurrent,
-		int	*nplt)
-{
-	/* local variables */
-	char	*function_name = "mbedit_action_mouse_toggle";
-	int	status = MB_SUCCESS;
-	int	zap_box, zap_ping;
-	int	ix, iy, range, range_min;
-	int	found;
-	int	iping, jbeam;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       x_loc:       %d\n",x_loc);
-		fprintf(stderr,"dbg2       y_loc:       %d\n",y_loc);
-		fprintf(stderr,"dbg2       plot_width:  %d\n",plwd);
-		fprintf(stderr,"dbg2       exager:      %d\n",exgr);
-		fprintf(stderr,"dbg2       x_interval:  %d\n",xntrvl);
-		fprintf(stderr,"dbg2       y_interval:  %d\n",yntrvl);
-		fprintf(stderr,"dbg2       plot_size:   %d\n",plt_size);
-		fprintf(stderr,"dbg2       show_mode:   %d\n",sh_mode);
-		fprintf(stderr,"dbg2       show_flagged:%d\n",sh_flggd);
-		fprintf(stderr,"dbg2       show_time:   %d\n",sh_time);
-		}
-
-	/* reset info */
-	if (info_set == MB_YES)
-		{
-		status = mbedit_unplot_beam(info_ping,info_beam);
-		status = mbedit_unplot_info();
-		info_set = MB_NO;
-		status = mbedit_plot_beam(info_ping,info_beam-1);
-		status = mbedit_plot_beam(info_ping,info_beam);
-		status = mbedit_plot_beam(info_ping,info_beam+1);
-		status = mbedit_plot_ping(info_ping);
-		}
-
-	/* do nothing unless file has been opened */
-	if (file_open == MB_YES)
-		{
-		/* check if a zap box has been picked */
-		zap_box = MB_NO;
-		for (i=current_id;i<current_id+nplot;i++)
-			{
-			if (ping[i].outbounds == MBEDIT_OUTBOUNDS_UNFLAGGED)
-			    {
-			    if (x_loc >= ping[i].zap_x1
-				&& x_loc <= ping[i].zap_x2
-				&& y_loc >= ping[i].zap_y1
-				&& y_loc <= ping[i].zap_y2)
-				{
-				zap_box = MB_YES;
-				zap_ping = i;
-				}
-			    }
-			}
-
-		/* if a zap box has been picked call zap routine */
-		if (zap_box == MB_YES)
-			status = mbedit_action_zap_outbounds(zap_ping,
-				plwd,exgr,xntrvl,yntrvl,
-				plt_size,sh_mode,sh_flggd,sh_time,
-				nbuffer,ngood,icurrent,nplt);
-		}
-
-	/* do not look for beam pick unless file has been opened
-		and no zap box was picked */
-	if (file_open == MB_YES && zap_box == MB_NO)
-		{
-		/* check if a beam has been picked */
-		iping = 0;
-		jbeam = 0;
-		range_min = 100000;
-		for (i=current_id;i<current_id+nplot;i++)
-			{
-			for (j=0;j<ping[i].beams_bath;j++)
-				{
-				if (!mb_beam_check_flag_null(ping[i].beamflag[j]))
-					{
-					ix = x_loc - ping[i].bath_x[j];
-					iy = y_loc - ping[i].bath_y[j];
-					range = (int)
-						sqrt((double) (ix*ix + iy*iy));
-					if (range < range_min)
-						{
-						range_min = range;
-						iping = i;
-						jbeam = j;
-						}
-					}
-				}
-			}
-
-		/* check to see if closest beam is
-			close enough to be toggled */
-		if (range_min <= MBEDIT_PICK_DISTANCE)
-			found = MB_YES;
-		else
-			found = MB_NO;
-
-		/* unplot the affected beam and ping */
-		if (found && *ngood > 0)
-			{
-			status = mbedit_unplot_ping(iping);
-			status = mbedit_unplot_beam(iping,jbeam);
-			}
-
-		/* reset picked beam */
-		if (found == MB_YES)
-			{
-			/* write edit to save file */
-			if (esffile_open == MB_YES)
-			    {
-			    if (mb_beam_ok(ping[iping].beamflag[jbeam]))
-				mb_ess_save(verbose, &esf,
-				    ping[iping].time_d,
-				    jbeam + ping[iping].multiplicity * MB_ESF_MULTIPLICITY_FACTOR,
-				    MBP_EDIT_FLAG, &error);
-			    else if (!mb_beam_check_flag_null(ping[iping].beamflag[jbeam]))
-				mb_ess_save(verbose, &esf,
-				    ping[iping].time_d,
-				    jbeam + ping[iping].multiplicity * MB_ESF_MULTIPLICITY_FACTOR,
-				    MBP_EDIT_UNFLAG, &error);
-			    }
-
-			/* apply edit */
-			if (mb_beam_ok(ping[iping].beamflag[jbeam]))
-                            {
-                            /* reset the beam value - if beam was originally flagged
-                                then reset to the original flag value */
-                            if (mb_beam_ok(ping[iping].beamflagorg[jbeam]))
-                                ping[iping].beamflag[jbeam] = mb_beam_set_flag_manual(ping[iping].beamflag[jbeam]);
-                            else
-                                ping[iping].beamflag[jbeam] = ping[iping].beamflagorg[jbeam];
-                            if (verbose >= 1)
-                                    {
-                                    fprintf(stderr,"\nping: %d beam:%d depth:%10.3f ",
-                                            iping,jbeam,ping[iping].bath[jbeam]);
-                                    fprintf(stderr," flagged\n");
-                                    }
-                            }
-			else if (!mb_beam_check_flag_null(ping[iping].beamflag[jbeam]))
-			    {
-                            ping[iping].beamflag[jbeam] = mb_beam_set_flag_none(ping[iping].beamflag[jbeam]);
-                            if (verbose >= 1)
-				{
-				fprintf(stderr,"\nping: %d beam:%d depth:%10.3f ",
-					iping,jbeam,ping[iping].bath[jbeam]);
-				fprintf(stderr," unflagged\n");
-				}
-                            }
-			beam_save = MB_YES;
-			iping_save = iping;
-			jbeam_save = jbeam;
-			}
-
-		/* set some return values */
-		*nbuffer = nbuff;
-		*ngood = nbuff;
-		*icurrent = current_id;
-
-		/* replot the affected beam and ping */
-		status = mbedit_plot_ping(iping);
-		status = mbedit_plot_beam(iping,jbeam-1);
-		status = mbedit_plot_beam(iping,jbeam);
-		status = mbedit_plot_beam(iping,jbeam+1);
-
-		/* if beam out of bounds replot label */
-		if (ping[iping].bath_x[jbeam] < xmin
-		    || ping[iping].bath_x[jbeam] > xmax
-		    || ping[iping].bath_y[jbeam] < ymin
-		    || ping[iping].bath_y[jbeam] > ymax)
-		    status = mbedit_plot_ping_label(iping, MB_NO);
-		}
-
-	/* if no file open set failure status */
-	else if (file_open == MB_NO)
-		{
-		status = MB_FAILURE;
-		*nbuffer = nbuff;
-		*nbuffer = nbuff;
-		*ngood = nbuff;
-		current_id = 0;
-		*icurrent = current_id;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       nbuffer:     %d\n",*nbuffer);
-		fprintf(stderr,"dbg2       ngood:       %d\n",*ngood);
-		fprintf(stderr,"dbg2       icurrent:    %d\n",*icurrent);
-		fprintf(stderr,"dbg2       nplt:        %d\n",*nplt);
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbedit_action_mouse_pick(
-	int	x_loc,
-	int	y_loc,
-	int	plwd,
-	int	exgr,
-	int	xntrvl,
-	int	yntrvl,
-	int	plt_size,
-	int	sh_mode,
-	int	sh_flggd,
-	int	sh_time,
-	int	*nbuffer,
-	int	*ngood,
-	int	*icurrent,
-	int	*nplt)
-{
-	/* local variables */
-	char	*function_name = "mbedit_action_mouse_pick";
-	int	status = MB_SUCCESS;
-	int	zap_box, zap_ping;
-	int	ix, iy, range, range_min;
-	int	found;
-	int	iping, jbeam;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       x_loc:       %d\n",x_loc);
-		fprintf(stderr,"dbg2       y_loc:       %d\n",y_loc);
-		fprintf(stderr,"dbg2       plot_width:  %d\n",plwd);
-		fprintf(stderr,"dbg2       exager:      %d\n",exgr);
-		fprintf(stderr,"dbg2       x_interval:  %d\n",xntrvl);
-		fprintf(stderr,"dbg2       y_interval:  %d\n",yntrvl);
-		fprintf(stderr,"dbg2       plot_size:   %d\n",plt_size);
-		fprintf(stderr,"dbg2       show_mode:   %d\n",sh_mode);
-		fprintf(stderr,"dbg2       show_flagged:%d\n",sh_flggd);
-		fprintf(stderr,"dbg2       show_time:   %d\n",sh_time);
-		}
-
-	/* reset info */
-	if (info_set == MB_YES)
-		{
-		status = mbedit_unplot_beam(info_ping,info_beam);
-		status = mbedit_unplot_info();
-		info_set = MB_NO;
-		status = mbedit_plot_beam(info_ping,info_beam-1);
-		status = mbedit_plot_beam(info_ping,info_beam);
-		status = mbedit_plot_beam(info_ping,info_beam+1);
-		status = mbedit_plot_ping(info_ping);
-		}
-
-	/* do nothing unless file has been opened */
-	if (file_open == MB_YES)
-		{
-		/* check if a zap box has been picked */
-		zap_box = MB_NO;
-		for (i=current_id;i<current_id+nplot;i++)
-			{
-			if (ping[i].outbounds == MBEDIT_OUTBOUNDS_UNFLAGGED)
-			    {
-			    if (x_loc >= ping[i].zap_x1
-				&& x_loc <= ping[i].zap_x2
-				&& y_loc >= ping[i].zap_y1
-				&& y_loc <= ping[i].zap_y2)
-				{
-				zap_box = MB_YES;
-				zap_ping = i;
-				}
-			    }
-			}
-
-		/* if a zap box has been picked call zap routine */
-		if (zap_box == MB_YES)
-			status = mbedit_action_zap_outbounds(zap_ping,
-				plwd,exgr,xntrvl,yntrvl,
-				plt_size,sh_mode,sh_flggd,sh_time,
-				nbuffer,ngood,icurrent,nplt);
-		}
-
-	/* do not look for beam pick unless file has been opened
-		and no zap box was picked */
-	if (file_open == MB_YES && zap_box == MB_NO)
-		{
-		/* check if a beam has been picked */
-		iping = 0;
-		jbeam = 0;
-		range_min = 100000;
-		for (i=current_id;i<current_id+nplot;i++)
-			{
-			for (j=0;j<ping[i].beams_bath;j++)
-				{
-				if (mb_beam_ok(ping[i].beamflag[j]))
-					{
-					ix = x_loc - ping[i].bath_x[j];
-					iy = y_loc - ping[i].bath_y[j];
-					range = (int)
-						sqrt((double) (ix*ix + iy*iy));
-					if (range < range_min)
-						{
-						range_min = range;
-						iping = i;
-						jbeam = j;
-						}
-					}
-				}
-			}
-
-		/* check to see if closest beam is
-			close enough to be picked */
-		if (range_min <= MBEDIT_PICK_DISTANCE)
-			found = MB_YES;
-		else
-			found = MB_NO;
-
-		/* unplot the affected beam and ping */
-		if (found && *ngood > 0)
-			{
-			status = mbedit_unplot_ping(iping);
-			status = mbedit_unplot_beam(iping,jbeam);
-			}
-
-		/* reset picked beam */
-		if (found == MB_YES)
-			{
-			/* write edit to save file */
-			if (esffile_open == MB_YES)
-			    {
-			    mb_ess_save(verbose, &esf,
-				    ping[iping].time_d,
-				    jbeam + ping[iping].multiplicity * MB_ESF_MULTIPLICITY_FACTOR,
-				    MBP_EDIT_FLAG, &error);
-			    }
-
-                        /* reset the beam value - if beam was originally flagged
-                            then reset to the original flag value */
-                        if (mb_beam_ok(ping[iping].beamflagorg[jbeam]))
-                            ping[iping].beamflag[jbeam] = mb_beam_set_flag_manual(ping[iping].beamflag[jbeam]);
-                        else
-                            ping[iping].beamflag[jbeam] = ping[iping].beamflagorg[jbeam];
-                        if (verbose >= 1)
-                                {
-                                fprintf(stderr,"\nping: %d beam:%d depth:%10.3f ",
-                                        iping,jbeam,ping[iping].bath[jbeam]);
-                                fprintf(stderr," flagged\n");
-                                }
-			beam_save = MB_YES;
-			iping_save = iping;
-			jbeam_save = jbeam;
-			}
-
-		/* set some return values */
-		*nbuffer = nbuff;
-		*ngood = nbuff;
-		*icurrent = current_id;
-
-		/* replot the affected beam and ping */
-		status = mbedit_plot_ping(iping);
-		status = mbedit_plot_beam(iping,jbeam-1);
-		status = mbedit_plot_beam(iping,jbeam);
-		status = mbedit_plot_beam(iping,jbeam+1);
-
-		/* if beam out of bounds replot label */
-		if (ping[iping].bath_x[jbeam] < xmin
-		    || ping[iping].bath_x[jbeam] > xmax
-		    || ping[iping].bath_y[jbeam] < ymin
-		    || ping[iping].bath_y[jbeam] > ymax)
-		    status = mbedit_plot_ping_label(iping, MB_NO);
-		}
-
-	/* if no file open set failure status */
-	else if (file_open == MB_NO)
-		{
-		status = MB_FAILURE;
-		*nbuffer = nbuff;
-		*nbuffer = nbuff;
-		*ngood = nbuff;
-		current_id = 0;
-		*icurrent = current_id;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       nbuffer:     %d\n",*nbuffer);
-		fprintf(stderr,"dbg2       ngood:       %d\n",*ngood);
-		fprintf(stderr,"dbg2       icurrent:    %d\n",*icurrent);
-		fprintf(stderr,"dbg2       nplt:        %d\n",*nplt);
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbedit_action_mouse_erase(
-		int	x_loc,
-		int	y_loc,
-		int	plwd,
-		int	exgr,
-		int	xntrvl,
-		int	yntrvl,
-		int	plt_size,
-		int	sh_mode,
-		int	sh_flggd,
-		int	sh_time,
-		int	*nbuffer,
-		int	*ngood,
-		int	*icurrent,
-		int	*nplt)
-{
-	/* local variables */
-	char	*function_name = "mbedit_action_mouse_erase";
-	int	status = MB_SUCCESS;
-	int	zap_box, zap_ping;
-	int	ix, iy, range;
-	int	found;
-	int	replot_label;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       x_loc:       %d\n",x_loc);
-		fprintf(stderr,"dbg2       y_loc:       %d\n",y_loc);
-		fprintf(stderr,"dbg2       plot_width:  %d\n",plwd);
-		fprintf(stderr,"dbg2       exager:      %d\n",exgr);
-		fprintf(stderr,"dbg2       x_interval:  %d\n",xntrvl);
-		fprintf(stderr,"dbg2       y_interval:  %d\n",yntrvl);
-		fprintf(stderr,"dbg2       plot_size:   %d\n",plt_size);
-		fprintf(stderr,"dbg2       show_mode:   %d\n",sh_mode);
-		fprintf(stderr,"dbg2       show_flagged:%d\n",sh_flggd);
-		fprintf(stderr,"dbg2       show_time:   %d\n",sh_time);
-		}
-
-	/* reset info */
-	if (info_set == MB_YES)
-		{
-		status = mbedit_unplot_beam(info_ping,info_beam);
-		status = mbedit_unplot_info();
-		info_set = MB_NO;
-		status = mbedit_plot_beam(info_ping,info_beam-1);
-		status = mbedit_plot_beam(info_ping,info_beam);
-		status = mbedit_plot_beam(info_ping,info_beam+1);
-		status = mbedit_plot_ping(info_ping);
-		}
-
-	/* do nothing unless file has been opened */
-	if (file_open == MB_YES)
-	    {
-	    /* check if a zap box has been picked */
-	    zap_box = MB_NO;
-	    for (i=current_id;i<current_id+nplot;i++)
-		{
-		if (ping[i].outbounds == MBEDIT_OUTBOUNDS_UNFLAGGED)
-		    {
-		    if (x_loc >= ping[i].zap_x1
-			&& x_loc <= ping[i].zap_x2
-			&& y_loc >= ping[i].zap_y1
-			&& y_loc <= ping[i].zap_y2)
-			{
-			zap_box = MB_YES;
-			zap_ping = i;
-
-			/* if a zap box has been picked call zap routine */
-			status = mbedit_action_zap_outbounds(zap_ping,
-				plwd,exgr,xntrvl,yntrvl,plt_size,sh_mode,sh_flggd,sh_time,
-				nbuffer,ngood,icurrent,nplt);
-			}
-		    }
-		}
-	    }
-
-	/* do not look for beam erase unless file has been opened
-		and no zap box was picked */
-	if (file_open == MB_YES && zap_box == MB_NO)
-	  {
-
-	  /* look for beams to be erased */
-	  for (i=current_id;i<current_id+nplot;i++)
-	    {
-	    found = MB_NO;
-	    replot_label = MB_NO;
-	    for (j=0;j<ping[i].beams_bath;j++)
-	      {
-	      if (mb_beam_ok(ping[i].beamflag[j]))
-		{
-		ix = x_loc - ping[i].bath_x[j];
-		iy = y_loc - ping[i].bath_y[j];
-		range = (int) sqrt((double) (ix*ix + iy*iy));
-		if (range < MBEDIT_ERASE_DISTANCE && *ngood > 0)
-			{
-			/* write edit to save file */
-			if (esffile_open == MB_YES)
-			    {
-			    mb_ess_save(verbose, &esf,
-			    	    ping[i].time_d,
-				    j + ping[i].multiplicity * MB_ESF_MULTIPLICITY_FACTOR,
-				    MBP_EDIT_FLAG, &error);
-			    }
-
-	          	/* unplot the affected beam and ping */
-			status = mbedit_unplot_ping(i);
-			status = mbedit_unplot_beam(i,j);
-
-                        /* reset the beam value - if beam was originally flagged
-                            then reset to the original flag value */
-                        if (mb_beam_ok(ping[i].beamflagorg[j]))
-                            ping[i].beamflag[j] = mb_beam_set_flag_manual(ping[i].beamflag[j]);
-                        else
-                            ping[i].beamflag[j] = ping[i].beamflagorg[j];
-                        if (verbose >= 1)
-                                {
-                                fprintf(stderr,"\nping: %d beam:%d depth:%10.3f ",
-                                        i,j,ping[i].bath[j]);
-                                fprintf(stderr," flagged\n");
-                                }
-
-			/* replot the affected beams */
-		 	found = MB_YES;
-			beam_save = MB_YES;
-			iping_save = i;
-			jbeam_save = j;
-			status = mbedit_plot_beam(i,j-1);
-			status = mbedit_plot_beam(i,j);
-			status = mbedit_plot_beam(i,j+1);
-
-			/* if beam out of bounds replot label */
-			if (ping[i].bath_x[j] < xmin
-			    || ping[i].bath_x[j] > xmax
-			    || ping[i].bath_y[j] < ymin
-			    || ping[i].bath_y[j] > ymax)
-			    replot_label = MB_YES;
-			}
-		}
-	      }
-
-	    /* replot affected ping */
-	    if (found == MB_YES && *ngood > 0)
-			status = mbedit_plot_ping(i);
-	    if (replot_label == MB_YES)
-		    status = mbedit_plot_ping_label(i, MB_NO);
-	    }
-
-	  /* set some return values */
-	  *nbuffer = nbuff;
-	  *ngood = nbuff;
-	  *icurrent = current_id;
-	  }
-
-	/* if no file open set failure status */
-	else if (file_open == MB_NO)
-		{
-		status = MB_FAILURE;
-		*nbuffer = nbuff;
-		*nbuffer = nbuff;
-		*ngood = nbuff;
-		current_id = 0;
-		*icurrent = current_id;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       nbuffer:     %d\n",*nbuffer);
-		fprintf(stderr,"dbg2       ngood:       %d\n",*ngood);
-		fprintf(stderr,"dbg2       icurrent:    %d\n",*icurrent);
-		fprintf(stderr,"dbg2       nplt:        %d\n",*nplt);
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbedit_action_mouse_restore(
-		int	x_loc,
-		int	y_loc,
-		int	plwd,
-		int	exgr,
-		int	xntrvl,
-		int	yntrvl,
-		int	plt_size,
-		int	sh_mode,
-		int	sh_flggd,
-		int	sh_time,
-		int	*nbuffer,
-		int	*ngood,
-		int	*icurrent,
-		int	*nplt)
-{
-	/* local variables */
-	char	*function_name = "mbedit_action_mouse_restore";
-	int	status = MB_SUCCESS;
-	int	zap_box, zap_ping;
-	int	ix, iy, range;
-	int	found;
-	int	replot_label;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       x_loc:       %d\n",x_loc);
-		fprintf(stderr,"dbg2       y_loc:       %d\n",y_loc);
-		fprintf(stderr,"dbg2       plot_width:  %d\n",plwd);
-		fprintf(stderr,"dbg2       exager:      %d\n",exgr);
-		fprintf(stderr,"dbg2       x_interval:  %d\n",xntrvl);
-		fprintf(stderr,"dbg2       y_interval:  %d\n",yntrvl);
-		fprintf(stderr,"dbg2       plot_size:   %d\n",plt_size);
-		fprintf(stderr,"dbg2       show_mode:   %d\n",sh_mode);
-		fprintf(stderr,"dbg2       show_flagged:%d\n",sh_flggd);
-		fprintf(stderr,"dbg2       show_time:   %d\n",sh_time);
-		}
-
-	/* reset info */
-	if (info_set == MB_YES)
-		{
-		status = mbedit_unplot_beam(info_ping,info_beam);
-		status = mbedit_unplot_info();
-		info_set = MB_NO;
-		status = mbedit_plot_beam(info_ping,info_beam-1);
-		status = mbedit_plot_beam(info_ping,info_beam);
-		status = mbedit_plot_beam(info_ping,info_beam+1);
-		status = mbedit_plot_ping(info_ping);
-		}
-
-	/* do nothing unless file has been opened */
-	if (file_open == MB_YES)
-	    {
-	    /* check if a zap box has been picked */
-	    zap_box = MB_NO;
-	    for (i=current_id;i<current_id+nplot;i++)
-		{
-		if (ping[i].outbounds == MBEDIT_OUTBOUNDS_UNFLAGGED)
-		    {
-		    if (x_loc >= ping[i].zap_x1
-			&& x_loc <= ping[i].zap_x2
-			&& y_loc >= ping[i].zap_y1
-			&& y_loc <= ping[i].zap_y2)
-			{
-			zap_box = MB_YES;
-			zap_ping = i;
-
-			/* if a zap box has been picked call zap routine */
-			status = mbedit_action_zap_outbounds(zap_ping,
-				plwd,exgr,xntrvl,yntrvl,plt_size,sh_mode,sh_flggd,sh_time,
-				nbuffer,ngood,icurrent,nplt);
-			}
-		    }
-		}
-	    }
-
-	/* do not look for beam restore unless file has been opened
-		and no zap box was picked */
-	if (file_open == MB_YES && zap_box == MB_NO)
-	  {
-
-	  /* look for beams to be erased */
-	  for (i=current_id;i<current_id+nplot;i++)
-	    {
-	    found = MB_NO;
-	    replot_label = MB_NO;
-	    for (j=0;j<ping[i].beams_bath;j++)
-	      {
-	      if (!mb_beam_ok(ping[i].beamflag[j])
-		&& !mb_beam_check_flag_null(ping[i].beamflag[j]))
-		{
-		ix = x_loc - ping[i].bath_x[j];
-		iy = y_loc - ping[i].bath_y[j];
-		range = (int) sqrt((double) (ix*ix + iy*iy));
-		if (range < MBEDIT_ERASE_DISTANCE && *ngood > 0)
-			{
-			/* write edit to save file */
-			if (esffile_open == MB_YES)
-			    {
-			    mb_ess_save(verbose, &esf,
-				    ping[i].time_d,
-				    j + ping[i].multiplicity * MB_ESF_MULTIPLICITY_FACTOR,
-				    MBP_EDIT_UNFLAG, &error);
-			    }
-
-	          	/* unplot the affected beam and ping */
-			if (found == MB_NO)
-				status = mbedit_unplot_ping(i);
-			status = mbedit_unplot_beam(i,j);
-
-			/* reset the beam value */
-			if (!mb_beam_ok(ping[i].beamflag[j])
-			    && !mb_beam_check_flag_null(ping[i].beamflag[j]))
-			    ping[i].beamflag[j] = ping[i].beamflag[j] = mb_beam_set_flag_none(ping[i].beamflag[j]);
-			if (verbose >= 1)
-				{
-				fprintf(stderr,"\nping: %d beam:%d depth:%10.3f ",
-					i,j,ping[i].bath[j]);
-				fprintf(stderr," flagged\n");
-				}
-
-			/* replot the affected beams */
-		 	found = MB_YES;
-			beam_save = MB_YES;
-			iping_save = i;
-			jbeam_save = j;
-			status = mbedit_plot_beam(i,j-1);
-			status = mbedit_plot_beam(i,j);
-			status = mbedit_plot_beam(i,j+1);
-
-			/* if beam out of bounds replot label */
-			if (ping[i].bath_x[j] < xmin
-			    || ping[i].bath_x[j] > xmax
-			    || ping[i].bath_y[j] < ymin
-			    || ping[i].bath_y[j] > ymax)
-			    replot_label = MB_YES;
-			}
-		}
-	      }
-
-	    /* replot affected ping */
-	    if (found == MB_YES && *ngood > 0)
-		    status = mbedit_plot_ping(i);
-	    if (replot_label == MB_YES)
-		    status = mbedit_plot_ping_label(i, MB_NO);
-	    }
-
-	  /* set some return values */
-	  *nbuffer = nbuff;
-	  *ngood = nbuff;
-	  *icurrent = current_id;
-	  }
-
-	/* if no file open set failure status */
-	else if (file_open == MB_NO)
-		{
-		status = MB_FAILURE;
-		*nbuffer = nbuff;
-		*nbuffer = nbuff;
-		*ngood = nbuff;
-		current_id = 0;
-		*icurrent = current_id;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       nbuffer:     %d\n",*nbuffer);
-		fprintf(stderr,"dbg2       ngood:       %d\n",*ngood);
-		fprintf(stderr,"dbg2       icurrent:    %d\n",*icurrent);
-		fprintf(stderr,"dbg2       nplt:        %d\n",*nplt);
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbedit_action_mouse_grab(
-		int	grabmode,
-		int	x_loc,
-		int	y_loc,
-		int	plwd,
-		int	exgr,
-		int	xntrvl,
-		int	yntrvl,
-		int	plt_size,
-		int	sh_mode,
-		int	sh_flggd,
-		int	sh_time,
-		int	*nbuffer,
-		int	*ngood,
-		int	*icurrent,
-		int	*nplt)
-{
-	/* local variables */
-	char	*function_name = "mbedit_action_mouse_grab";
-	int	status = MB_SUCCESS;
-	int	zap_box, zap_ping;
-	int	xgmin, xgmax, ygmin, ygmax;
-	int	found;
-	int	replot_label;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       grabmode:    %d\n",grabmode);
-		fprintf(stderr,"dbg2       x_loc:       %d\n",x_loc);
-		fprintf(stderr,"dbg2       y_loc:       %d\n",y_loc);
-		fprintf(stderr,"dbg2       plot_width:  %d\n",plwd);
-		fprintf(stderr,"dbg2       exager:      %d\n",exgr);
-		fprintf(stderr,"dbg2       x_interval:  %d\n",xntrvl);
-		fprintf(stderr,"dbg2       y_interval:  %d\n",yntrvl);
-		fprintf(stderr,"dbg2       plot_size:   %d\n",plt_size);
-		fprintf(stderr,"dbg2       show_mode:   %d\n",sh_mode);
-		fprintf(stderr,"dbg2       show_flagged:%d\n",sh_flggd);
-		fprintf(stderr,"dbg2       show_time:   %d\n",sh_time);
-		}
-
-	/* do nothing unless file has been opened */
-	if (file_open == MB_YES)
-		{
-		/* replot old info beam if needed */
-		if (info_set == MB_YES)
-			{
-			status = mbedit_unplot_beam(info_ping,info_beam);
-			status = mbedit_unplot_info();
-			info_set = MB_NO;
-			status = mbedit_plot_beam(info_ping,info_beam-1);
-			status = mbedit_plot_beam(info_ping,info_beam);
-			status = mbedit_plot_beam(info_ping,info_beam+1);
-			status = mbedit_plot_ping(info_ping);
-			}
-
-		/* get start of grab rectangle */
-		if (grabmode == MBEDIT_GRAB_START)
-			{
-			grab_set = MB_YES;
-			grab_start_x = x_loc;
-			grab_start_y = y_loc;
-			grab_end_x = x_loc;
-			grab_end_y = y_loc;
-
-			/* get grab rectangle to use */
-			if (grab_start_x <= grab_end_x)
-				{
-				xgmin = grab_start_x;
-				xgmax = grab_end_x;
-				}
-			else
-				{
-				xgmin = grab_end_x;
-				xgmax = grab_start_x;
-				}
-			if (grab_start_y <= grab_end_y)
-				{
-				ygmin = grab_start_y;
-				ygmax = grab_end_y;
-				}
-			else
-				{
-				ygmin = grab_end_y;
-				ygmax = grab_start_y;
-				}
-
-			/* draw grab ractangle */
-			xg_drawrectangle(mbedit_xgid,
-				xgmin,
-				ygmin,
-				xgmax - xgmin,
-				ygmax - ygmin,
-				pixel_values[RED],XG_SOLIDLINE);
-			}
-
-		/* change grab rectangle */
-		else if (grabmode == MBEDIT_GRAB_MOVE)
-			{
-			/* get grab rectangle to use */
-			if (grab_start_x <= grab_end_x)
-				{
-				xgmin = grab_start_x;
-				xgmax = grab_end_x;
-				}
-			else
-				{
-				xgmin = grab_end_x;
-				xgmax = grab_start_x;
-				}
-			if (grab_start_y <= grab_end_y)
-				{
-				ygmin = grab_start_y;
-				ygmax = grab_end_y;
-				}
-			else
-				{
-				ygmin = grab_end_y;
-				ygmax = grab_start_y;
-				}
-
-			/* undraw old grab rectangle */
-			xg_drawrectangle(mbedit_xgid,
-				xgmin,
-				ygmin,
-				xgmax - xgmin,
-				ygmax - ygmin,
-				pixel_values[WHITE],XG_SOLIDLINE);
-
-			/* update grab rectangle */
-			grab_set = MB_YES;
-			grab_end_x = x_loc;
-			grab_end_y = y_loc;
-
-			/* get grab rectangle to use */
-			if (grab_start_x <= grab_end_x)
-				{
-				xgmin = grab_start_x;
-				xgmax = grab_end_x;
-				}
-			else
-				{
-				xgmin = grab_end_x;
-				xgmax = grab_start_x;
-				}
-			if (grab_start_y <= grab_end_y)
-				{
-				ygmin = grab_start_y;
-				ygmax = grab_end_y;
-				}
-			else
-				{
-				ygmin = grab_end_y;
-				ygmax = grab_start_y;
-				}
-
-			/* draw grab rectangle */
-			xg_drawrectangle(mbedit_xgid,
-				xgmin,
-				ygmin,
-				xgmax - xgmin,
-				ygmax - ygmin,
-				pixel_values[RED],XG_SOLIDLINE);
-
-			/* replot beams on bounds of the grab box */
-			for (i=current_id;i<current_id+nplot;i++)
-			    {
-			    found = MB_NO;
-			    replot_label = MB_NO;
-			    for (j=0;j<ping[i].beams_bath;j++)
-			      {
-			      if (!mb_beam_check_flag_null(ping[i].beamflag[j]))
-				{
-				if (abs(ping[i].bath_x[j] - xgmin) <= 10
-					|| abs(ping[i].bath_x[j] - xgmax) <= 10
-					|| abs(ping[i].bath_y[j] - ygmin) <= 10
-					|| abs(ping[i].bath_y[j] - ygmax) <= 10)
-					{
-					/* replot the affected beams */
-		 			found = MB_YES;
-					status = mbedit_plot_beam(i,j);
-
-					/* if beam out of bounds replot label */
-					if (ping[i].bath_x[j] < xmin
-					    || ping[i].bath_x[j] > xmax
-					    || ping[i].bath_y[j] < ymin
-					    || ping[i].bath_y[j] > ymax)
-					    replot_label = MB_YES;
-					}
-				}
-			      }
-
-			    /* replot affected ping */
-			    if (found == MB_YES && *ngood > 0)
-					status = mbedit_plot_ping(i);
-			    if (replot_label == MB_YES)
-				    status = mbedit_plot_ping_label(i, MB_NO);
-			    }
-			}
-
-		/* apply grab rectangle */
-		else if (grabmode == MBEDIT_GRAB_END)
-			{
-			/* get final grab rectangle */
-			grab_set = MB_NO;
-			grab_end_x = x_loc;
-			grab_end_y = y_loc;
-
-			/* get grab rectangle to use */
-			if (grab_start_x <= grab_end_x)
-				{
-				xgmin = grab_start_x;
-				xgmax = grab_end_x;
-				}
-			else
-				{
-				xgmin = grab_end_x;
-				xgmax = grab_start_x;
-				}
-			if (grab_start_y <= grab_end_y)
-				{
-				ygmin = grab_start_y;
-				ygmax = grab_end_y;
-				}
-			else
-				{
-				ygmin = grab_end_y;
-				ygmax = grab_start_y;
-				}
-
-			/* check if any zap boxes has been picked */
-			zap_box = MB_NO;
-			for (i=current_id;i<current_id+nplot;i++)
-			    {
-			    if (ping[i].outbounds == MBEDIT_OUTBOUNDS_UNFLAGGED)
-				{
-				if (xgmin <= ping[i].zap_x1
-				    && xgmax >= ping[i].zap_x2
-				    && ygmin <= ping[i].zap_y1
-				    && ygmax >= ping[i].zap_y2)
-				    {
-				    zap_box = MB_YES;
-				    zap_ping = i;
-
-				    /* if a zap box has been picked call zap routine */
-				    status = mbedit_action_zap_outbounds(zap_ping,
-					    plwd,exgr,xntrvl,yntrvl,plt_size,sh_mode,sh_flggd,sh_time,
-					    nbuffer,ngood,icurrent,nplt);
-				    }
-				}
-			    }
-
-			/* look for beams to be erased */
-			for (i=current_id;i<current_id+nplot;i++)
-			    {
-			    found = MB_NO;
-			    replot_label = MB_NO;
-			    for (j=0;j<ping[i].beams_bath;j++)
-			      {
-			      if (mb_beam_ok(ping[i].beamflag[j]))
-				{
-				if (ping[i].bath_x[j] >= xgmin
-					&& ping[i].bath_x[j] <= xgmax
-					&& ping[i].bath_y[j] >= ygmin
-					&& ping[i].bath_y[j] <= ygmax
-					&& *ngood > 0)
-					{
-					/* write edit to save file */
-					if (esffile_open == MB_YES)
-					    {
-					    mb_ess_save(verbose, &esf,
-			    			    ping[i].time_d,
-						    j + ping[i].multiplicity * MB_ESF_MULTIPLICITY_FACTOR,
-						    MBP_EDIT_FLAG, &error);
-					    }
-
-					/* reset the beam value - if beam was originally flagged
-                                            then reset to the original flag value */
-					if (mb_beam_ok(ping[i].beamflagorg[j]))
-                                            ping[i].beamflag[j] = mb_beam_set_flag_manual(ping[i].beamflag[j]);
-					else
-                                            ping[i].beamflag[j] = ping[i].beamflagorg[j];
-					if (verbose >= 1)
-						{
-						fprintf(stderr,"\nping: %d beam:%d depth:%10.3f ",
-							i,j,ping[i].bath[j]);
-						fprintf(stderr," flagged\n");
-						}
-
-					/* replot the affected beams */
-		 			found = MB_YES;
-					beam_save = MB_YES;
-					iping_save = i;
-					jbeam_save = j;
-
-					/* if beam out of bounds replot label */
-					if (ping[i].bath_x[j] < xmin
-					    || ping[i].bath_x[j] > xmax
-					    || ping[i].bath_y[j] < ymin
-					    || ping[i].bath_y[j] > ymax)
-					    replot_label = MB_YES;
-					}
-				}
-			      }
-			    }
-
-			/* replot everything */
-			status = mbedit_plot_all(plwd,exgr,xntrvl,yntrvl,
-				    plt_size,sh_mode,sh_flggd,sh_time,nplt,MB_NO);
-			}
-
-		/* set some return values */
-		*nbuffer = nbuff;
-		*ngood = nbuff;
-		*icurrent = current_id;
-		}
-
-	/* if no file open set failure status */
-	else if (file_open == MB_NO)
-		{
-		status = MB_FAILURE;
-		*nbuffer = nbuff;
-		*nbuffer = nbuff;
-		*ngood = nbuff;
-		current_id = 0;
-		*icurrent = current_id;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       nbuffer:     %d\n",*nbuffer);
-		fprintf(stderr,"dbg2       ngood:       %d\n",*ngood);
-		fprintf(stderr,"dbg2       icurrent:    %d\n",*icurrent);
-		fprintf(stderr,"dbg2       nplt:        %d\n",*nplt);
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbedit_action_mouse_info(
-		int	x_loc,
-		int	y_loc,
-		int	plwd,
-		int	exgr,
-		int	xntrvl,
-		int	yntrvl,
-		int	plt_size,
-		int	sh_mode,
-		int	sh_flggd,
-		int	sh_time,
-		int	*nbuffer,
-		int	*ngood,
-		int	*icurrent,
-		int	*nplt)
-{
-	/* local variables */
-	char	*function_name = "mbedit_action_mouse_info";
-	int	status = MB_SUCCESS;
-	int	ix, iy, range, range_min;
-	int	iping, jbeam;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       x_loc:       %d\n",x_loc);
-		fprintf(stderr,"dbg2       y_loc:       %d\n",y_loc);
-		fprintf(stderr,"dbg2       plot_width:  %d\n",plwd);
-		fprintf(stderr,"dbg2       exager:      %d\n",exgr);
-		fprintf(stderr,"dbg2       x_interval:  %d\n",xntrvl);
-		fprintf(stderr,"dbg2       y_interval:  %d\n",yntrvl);
-		fprintf(stderr,"dbg2       plot_size:   %d\n",plt_size);
-		fprintf(stderr,"dbg2       show_mode:   %d\n",sh_mode);
-		fprintf(stderr,"dbg2       show_flagged:%d\n",sh_flggd);
-		fprintf(stderr,"dbg2       show_time:   %d\n",sh_time);
-		}
-
-	/* do nothing unless file has been opened */
-	if (file_open == MB_YES)
-		{
-		/* replot old info beam if needed */
-		if (info_set == MB_YES)
-			{
-			status = mbedit_unplot_beam(info_ping,info_beam);
-			status = mbedit_unplot_info();
-			info_set = MB_NO;
-			status = mbedit_plot_beam(info_ping,info_beam-1);
-			status = mbedit_plot_beam(info_ping,info_beam);
-			status = mbedit_plot_beam(info_ping,info_beam+1);
-			status = mbedit_plot_ping(info_ping);
-			}
-
-		/* check if a beam has been picked */
-		iping = 0;
-		jbeam = 0;
-		range_min = 100000;
-		for (i=current_id;i<current_id+nplot;i++)
-			{
-			for (j=0;j<ping[i].beams_bath;j++)
-				{
-				if (!mb_beam_check_flag_null(ping[i].beamflag[j]))
-					{
-					ix = x_loc - ping[i].bath_x[j];
-					iy = y_loc - ping[i].bath_y[j];
-					range = (int)
-						sqrt((double) (ix*ix + iy*iy));
-					if (range < range_min)
-						{
-						range_min = range;
-						iping = i;
-						jbeam = j;
-						}
-					}
-				}
-			}
-
-		/* check to see if closest beam is
-			close enough to be id'd */
-		if (range_min <= MBEDIT_PICK_DISTANCE)
-			{
-			info_set = MB_YES;
-			info_ping = iping;
-			info_beam = jbeam;
-			info_time_i[0] = ping[iping].time_i[0];
-			info_time_i[1] = ping[iping].time_i[1];
-			info_time_i[2] = ping[iping].time_i[2];
-			info_time_i[3] = ping[iping].time_i[3];
-			info_time_i[4] = ping[iping].time_i[4];
-			info_time_i[5] = ping[iping].time_i[5];
-			info_time_i[6] = ping[iping].time_i[6];
-			info_time_d = ping[iping].time_d;
-			info_navlon = ping[iping].navlon;
-			info_navlat = ping[iping].navlat;
-			info_speed = ping[iping].speed;
-			info_heading = ping[iping].heading;
-			info_altitude = ping[iping].altitude;
-			info_beams_bath = ping[iping].beams_bath;
-			info_beamflag = ping[iping].beamflag[jbeam];
-			info_bath = ping[iping].bath[jbeam];
-			info_bathacrosstrack = ping[iping].bathacrosstrack[jbeam];
-			info_bathalongtrack = ping[iping].bathalongtrack[jbeam];
-			info_detect = ping[iping].detect[jbeam];
-			info_pulse = ping[iping].pulses[jbeam];
-/*			fprintf(stderr,"\nping: %d beam:%d depth:%10.3f \n",
-				iping,jbeam,ping[iping].bath[jbeam]);*/
-
-			/* replot old info beam if needed */
-			status = mbedit_plot_beam(info_ping,info_beam);
-			status = mbedit_plot_info();
-
-			}
-		else
-			info_set = MB_NO;
-
-		/* set some return values */
-		*nbuffer = nbuff;
-		*ngood = nbuff;
-		*icurrent = current_id;
-		}
-
-	/* if no file open set failure status */
-	else if (file_open == MB_NO)
-		{
-		status = MB_FAILURE;
-		*nbuffer = nbuff;
-		*nbuffer = nbuff;
-		*ngood = nbuff;
-		current_id = 0;
-		*icurrent = current_id;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       nbuffer:     %d\n",*nbuffer);
-		fprintf(stderr,"dbg2       ngood:       %d\n",*ngood);
-		fprintf(stderr,"dbg2       icurrent:    %d\n",*icurrent);
-		fprintf(stderr,"dbg2       nplt:        %d\n",*nplt);
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbedit_action_zap_outbounds(
-		int	iping,
-		int	plwd,
-		int	exgr,
-		int	xntrvl,
-		int	yntrvl,
-		int	plt_size,
-		int	sh_mode,
-		int	sh_flggd,
-		int	sh_time,
-		int	*nbuffer,
-		int	*ngood,
-		int	*icurrent,
-		int	*nplt)
-{
-	/* local variables */
-	char	*function_name = "mbedit_action_zap_outbounds";
-	int	status = MB_SUCCESS;
-	int	found;
-	int	j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       iping:       %d\n",iping);
-		fprintf(stderr,"dbg2       plot_width:  %d\n",plwd);
-		fprintf(stderr,"dbg2       exager:      %d\n",exgr);
-		fprintf(stderr,"dbg2       x_interval:  %d\n",xntrvl);
-		fprintf(stderr,"dbg2       y_interval:  %d\n",yntrvl);
-		fprintf(stderr,"dbg2       plot_size:   %d\n",plt_size);
-		fprintf(stderr,"dbg2       show_mode:   %d\n",sh_mode);
-		fprintf(stderr,"dbg2       show_flagged:%d\n",sh_flggd);
-		fprintf(stderr,"dbg2       show_time:   %d\n",sh_time);
-		}
-
-	/* reset info */
-	if (info_set == MB_YES)
-		{
-		status = mbedit_unplot_beam(info_ping,info_beam);
-		status = mbedit_unplot_info();
-		info_set = MB_NO;
-		status = mbedit_plot_beam(info_ping,info_beam-1);
-		status = mbedit_plot_beam(info_ping,info_beam);
-		status = mbedit_plot_beam(info_ping,info_beam+1);
-		status = mbedit_plot_ping(info_ping);
-		}
-
-	/* do nothing unless file has been opened */
-	if (file_open == MB_YES)
-	    {
-
-	    /* look for beams to be erased */
-	    found = MB_NO;
-	    for (j=0;j<ping[iping].beams_bath;j++)
-	      {
-	      if (mb_beam_ok(ping[iping].beamflag[j])
-		    && (ping[iping].bath_x[j] < xmin
-			|| ping[iping].bath_x[j] > xmax
-			|| ping[iping].bath_y[j] < ymin
-			|| ping[iping].bath_y[j] > ymax))
-		    {
-		    /* write edit to save file */
-		    if (esffile_open == MB_YES)
-			{
-			mb_ess_save(verbose, &esf,
-				ping[iping].time_d,
-				j + ping[iping].multiplicity * MB_ESF_MULTIPLICITY_FACTOR,
-				MBP_EDIT_FLAG, &error);
-			}
-
-		    /* unplot the affected beam and ping */
-		    status = mbedit_unplot_ping(iping);
-		    status = mbedit_unplot_beam(iping,j);
-
-                    /* reset the beam value - if beam was originally flagged
-                        then reset to the original flag value */
-                    if (mb_beam_ok(ping[iping].beamflagorg[j]))
-                        ping[iping].beamflag[j] = mb_beam_set_flag_manual(ping[iping].beamflag[j]);
-                    else
-                        ping[iping].beamflag[j] = ping[iping].beamflagorg[j];
-                    if (verbose >= 1)
-                            {
-                            fprintf(stderr,"\nping: %d beam:%d depth:%10.3f ",
-                                    iping,j,ping[iping].bath[j]);
-                            fprintf(stderr," flagged\n");
-                            }
-
-		    /* replot the affected beams */
-		    found = MB_YES;
-		    beam_save = MB_YES;
-		    iping_save = iping;
-		    jbeam_save = j;
-		    status = mbedit_plot_beam(iping,j-1);
-		    status = mbedit_plot_beam(iping,j);
-		    status = mbedit_plot_beam(iping,j+1);
-		    }
-	      }
-
-	   /* replot affected ping */
-	   if (found == MB_YES && *ngood > 0)
-		    {
-		    status = mbedit_plot_ping(iping);
-		    status = mbedit_plot_ping_label(iping, MB_NO);
-		    }
-
-	   /* set some return values */
-	   *nbuffer = nbuff;
-	   *ngood = nbuff;
-	   *icurrent = current_id;
-	   }
-
-	/* if no file open set failure status */
-	else if (file_open == MB_NO)
-		{
-		status = MB_FAILURE;
-		*nbuffer = nbuff;
-		*nbuffer = nbuff;
-		*ngood = nbuff;
-		current_id = 0;
-		*icurrent = current_id;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       nbuffer:     %d\n",*nbuffer);
-		fprintf(stderr,"dbg2       ngood:       %d\n",*ngood);
-		fprintf(stderr,"dbg2       icurrent:    %d\n",*icurrent);
-		fprintf(stderr,"dbg2       nplt:        %d\n",*nplt);
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbedit_action_bad_ping(
-		int	plwd,
-		int	exgr,
-		int	xntrvl,
-		int	yntrvl,
-		int	plt_size,
-		int	sh_mode,
-		int	sh_flggd,
-		int	sh_time,
-		int	*nbuffer,
-		int	*ngood,
-		int	*icurrent,
-		int	*nplt)
-{
-	/* local variables */
-	char	*function_name = "mbedit_action_bad_ping";
-	int	status = MB_SUCCESS;
-	int	j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       plot_width:  %d\n",plwd);
-		fprintf(stderr,"dbg2       exager:      %d\n",exgr);
-		fprintf(stderr,"dbg2       x_interval:  %d\n",xntrvl);
-		fprintf(stderr,"dbg2       y_interval:  %d\n",yntrvl);
-		fprintf(stderr,"dbg2       plot_size:   %d\n",plt_size);
-		fprintf(stderr,"dbg2       show_mode:   %d\n",sh_mode);
-		fprintf(stderr,"dbg2       show_flagged:%d\n",sh_flggd);
-		fprintf(stderr,"dbg2       show_time:   %d\n",sh_time);
-		}
-
-	/* reset info */
-	if (info_set == MB_YES)
-		{
-		status = mbedit_unplot_beam(info_ping,info_beam);
-		status = mbedit_unplot_info();
-		info_set = MB_NO;
-		status = mbedit_plot_beam(info_ping,info_beam-1);
-		status = mbedit_plot_beam(info_ping,info_beam);
-		status = mbedit_plot_beam(info_ping,info_beam+1);
-		status = mbedit_plot_ping(info_ping);
-		}
-
-	/* check if a file has been opened
-		and a beam has been picked and saved */
-	if (file_open == MB_YES && beam_save == MB_YES)
-		{
-		/* write edits to save file */
-		if (esffile_open == MB_YES)
-		    {
-		    for (j=0;j<ping[iping_save].beams_bath;j++)
-			if (mb_beam_ok(ping[iping_save].beamflag[j]))
-			    mb_ess_save(verbose, &esf,
-				ping[iping_save].time_d,
-				j + ping[iping_save].multiplicity * MB_ESF_MULTIPLICITY_FACTOR,
-				MBP_EDIT_FLAG, &error);
-		    }
-
-		/* unplot the affected beam and ping */
-		status = mbedit_unplot_ping(iping_save);
-		for (j=0;j<ping[iping_save].beams_bath;j++)
-			status = mbedit_unplot_beam(iping_save,j);
-
-		/* flag beams in bad ping */
-		if (verbose >= 1)
-			fprintf(stderr,"\nbeams in ping: %d flagged\n",
-				iping_save);
-		for (j=0;j<ping[iping_save].beams_bath;j++)
-			{
-                        if (mb_beam_ok(ping[iping_save].beamflag[j]))
-                            {
-                            /* reset the beam value - if beam was originally flagged
-                                then reset to the original flag value */
-                            if (mb_beam_ok(ping[iping_save].beamflagorg[j]))
-                                ping[iping_save].beamflag[j] = mb_beam_set_flag_manual(ping[iping_save].beamflag[j]);
-                            else
-                                ping[iping_save].beamflag[j] = ping[iping_save].beamflagorg[j];
-                            if (verbose >= 1)
-                                    {
-                                    fprintf(stderr,"\nping: %d beam:%d depth:%10.3f ",
-                                            iping_save,j,ping[iping_save].bath[j]);
-                                    fprintf(stderr," flagged\n");
-                                    }
-                            }
-                        }
-
-		/* set some return values */
-		*nbuffer = nbuff;
-		*ngood = nbuff;
-		*icurrent = current_id;
-
-		/* replot the affected beam and ping */
-		status = mbedit_plot_ping(iping_save);
-		for (j=0;j<ping[iping_save].beams_bath;j++)
-			status = mbedit_plot_beam(iping_save,j);
-
-		/* if ping has outbounds flag replot label */
-		if (ping[iping_save].outbounds != MBEDIT_OUTBOUNDS_NONE)
-			status = mbedit_plot_ping_label(iping_save, MB_NO);
-		}
-
-	/* if no file open or beam saved set failure status */
-	else
-		{
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       nbuffer:     %d\n",*nbuffer);
-		fprintf(stderr,"dbg2       ngood:       %d\n",*ngood);
-		fprintf(stderr,"dbg2       icurrent:    %d\n",*icurrent);
-		fprintf(stderr,"dbg2       nplt:        %d\n",*nplt);
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbedit_action_good_ping(
-		int	plwd,
-		int	exgr,
-		int	xntrvl,
-		int	yntrvl,
-		int	plt_size,
-		int	sh_mode,
-		int	sh_flggd,
-		int	sh_time,
-		int	*nbuffer,
-		int	*ngood,
-		int	*icurrent,
-		int	*nplt)
-{
-	/* local variables */
-	char	*function_name = "mbedit_action_good_ping";
-	int	status = MB_SUCCESS;
-	int	j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       plot_width:  %d\n",plwd);
-		fprintf(stderr,"dbg2       exager:      %d\n",exgr);
-		fprintf(stderr,"dbg2       x_interval:  %d\n",xntrvl);
-		fprintf(stderr,"dbg2       y_interval:  %d\n",yntrvl);
-		fprintf(stderr,"dbg2       plot_size:   %d\n",plt_size);
-		fprintf(stderr,"dbg2       show_mode:   %d\n",sh_mode);
-		fprintf(stderr,"dbg2       show_flagged:%d\n",sh_flggd);
-		fprintf(stderr,"dbg2       show_time:   %d\n",sh_time);
-		}
-
-	/* reset info */
-	if (info_set == MB_YES)
-		{
-		status = mbedit_unplot_beam(info_ping,info_beam);
-		status = mbedit_unplot_info();
-		info_set = MB_NO;
-		status = mbedit_plot_beam(info_ping,info_beam-1);
-		status = mbedit_plot_beam(info_ping,info_beam);
-		status = mbedit_plot_beam(info_ping,info_beam+1);
-		status = mbedit_plot_ping(info_ping);
-		}
-
-	/* check if a file has been opened
-		and a beam has been picked and saved */
-	if (file_open == MB_YES && beam_save == MB_YES)
-		{
-		/* write edits to save file */
-		if (esffile_open == MB_YES)
-		    {
-		    for (j=0;j<ping[iping_save].beams_bath;j++)
-			if (!mb_beam_ok(ping[iping_save].beamflag[j])
-			    && !mb_beam_check_flag_null(ping[iping_save].beamflag[j]))
-			    mb_ess_save(verbose, &esf,
-				ping[iping_save].time_d,
-				j + ping[iping_save].multiplicity * MB_ESF_MULTIPLICITY_FACTOR,
-				MBP_EDIT_UNFLAG, &error);
-		    }
-
-		/* unplot the affected beam and ping */
-		status = mbedit_unplot_ping(iping_save);
-		for (j=0;j<ping[iping_save].beams_bath;j++)
-			status = mbedit_unplot_beam(iping_save,j);
-
-		/* flag beams in good ping */
-		for (j=0;j<ping[iping_save].beams_bath;j++)
-			if (!mb_beam_ok(ping[iping_save].beamflag[j])
-			    && !mb_beam_check_flag_null(ping[iping_save].beamflag[j]))
-				ping[iping_save].beamflag[j] = mb_beam_set_flag_none(ping[iping_save].beamflag[j]);
-		if (verbose >= 1)
-			fprintf(stderr,"\nbeams in ping: %d unflagged\n",
-				iping_save);
-
-		/* set some return values */
-		*nbuffer = nbuff;
-		*ngood = nbuff;
-		*icurrent = current_id;
-
-		/* replot the affected beam and ping */
-		status = mbedit_plot_ping(iping_save);
-		for (j=0;j<ping[iping_save].beams_bath;j++)
-			status = mbedit_plot_beam(iping_save,j);
-
-		/* if ping has outbounds flag replot label */
-		if (ping[iping_save].outbounds != MBEDIT_OUTBOUNDS_NONE)
-			status = mbedit_plot_ping_label(iping_save, MB_NO);
-		}
-
-	/* if no file open or beam saved set failure status */
-	else
-		{
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       nbuffer:     %d\n",*nbuffer);
-		fprintf(stderr,"dbg2       ngood:       %d\n",*ngood);
-		fprintf(stderr,"dbg2       icurrent:    %d\n",*icurrent);
-		fprintf(stderr,"dbg2       nplt:        %d\n",*nplt);
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbedit_action_left_ping(
-		int	plwd,
-		int	exgr,
-		int	xntrvl,
-		int	yntrvl,
-		int	plt_size,
-		int	sh_mode,
-		int	sh_flggd,
-		int	sh_time,
-		int	*nbuffer,
-		int	*ngood,
-		int	*icurrent,
-		int	*nplt)
-{
-	/* local variables */
-	char	*function_name = "mbedit_action_left_ping";
-	int	status = MB_SUCCESS;
-	int	j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       plot_width:  %d\n",plwd);
-		fprintf(stderr,"dbg2       exager:      %d\n",exgr);
-		fprintf(stderr,"dbg2       x_interval:  %d\n",xntrvl);
-		fprintf(stderr,"dbg2       y_interval:  %d\n",yntrvl);
-		fprintf(stderr,"dbg2       plot_size:   %d\n",plt_size);
-		fprintf(stderr,"dbg2       show_mode:   %d\n",sh_mode);
-		fprintf(stderr,"dbg2       show_flagged:%d\n",sh_flggd);
-		fprintf(stderr,"dbg2       show_time:   %d\n",sh_time);
-		}
-
-	/* reset info */
-	if (info_set == MB_YES)
-		{
-		status = mbedit_unplot_beam(info_ping,info_beam);
-		status = mbedit_unplot_info();
-		info_set = MB_NO;
-		status = mbedit_plot_beam(info_ping,info_beam-1);
-		status = mbedit_plot_beam(info_ping,info_beam);
-		status = mbedit_plot_beam(info_ping,info_beam+1);
-		status = mbedit_plot_ping(info_ping);
-		}
-
-	/* check if a file has been opened
-		and a beam has been picked and saved */
-	if (file_open == MB_YES && beam_save == MB_YES)
-		{
-		/* write edits to save file */
-		if (esffile_open == MB_YES)
-		    {
-		    for (j=0;j<=jbeam_save;j++)
-			if (mb_beam_ok(ping[iping_save].beamflag[j]))
-			    mb_ess_save(verbose, &esf,
-				ping[iping_save].time_d,
-				j + ping[iping_save].multiplicity * MB_ESF_MULTIPLICITY_FACTOR,
-				MBP_EDIT_FLAG, &error);
-		    }
-
-		/* unplot the affected beam and ping */
-		status = mbedit_unplot_ping(iping_save);
-		for (j=0;j<ping[iping_save].beams_bath;j++)
-			status = mbedit_unplot_beam(iping_save,j);
-
-		/* flag beams to left of picked beam */
-		if (verbose >= 1)
-			fprintf(stderr,"\nbeams in ping: %d left of beam: %d flagged\n",
-				iping_save,jbeam_save);
-		for (j=0;j<=jbeam_save;j++)
-		    {
-                    if (mb_beam_ok(ping[iping_save].beamflag[j]))
-                        {
-                       /* reset the beam value - if beam was originally flagged
-                            then reset to the original flag value */
-                        if (mb_beam_ok(ping[iping_save].beamflagorg[j]))
-                            ping[iping_save].beamflag[j] = mb_beam_set_flag_manual(ping[iping_save].beamflag[j]);
-                        else
-                            ping[iping_save].beamflag[j] = ping[iping_save].beamflagorg[j];
-                        if (verbose >= 1)
-                                {
-                                fprintf(stderr,"\nping: %d beam:%d depth:%10.3f ",
-                                        iping_save,j,ping[iping_save].bath[j]);
-                                fprintf(stderr," flagged\n");
-                                }
-                        }
-                    }
-
-		/* set some return values */
-		*nbuffer = nbuff;
-		*ngood = nbuff;
-		*icurrent = current_id;
-
-		/* replot the affected beam and ping */
-		status = mbedit_plot_ping(iping_save);
-		for (j=0;j<ping[iping_save].beams_bath;j++)
-			status = mbedit_plot_beam(iping_save,j);
-
-		/* if ping has outbounds flag replot label */
-		if (ping[iping_save].outbounds != MBEDIT_OUTBOUNDS_NONE)
-			status = mbedit_plot_ping_label(iping_save, MB_NO);
-		}
-
-	/* if no file open or beam saved set failure status */
-	else
-		{
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       nbuffer:     %d\n",*nbuffer);
-		fprintf(stderr,"dbg2       ngood:       %d\n",*ngood);
-		fprintf(stderr,"dbg2       icurrent:    %d\n",*icurrent);
-		fprintf(stderr,"dbg2       nplt:        %d\n",*nplt);
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbedit_action_right_ping(
-		int	plwd,
-		int	exgr,
-		int	xntrvl,
-		int	yntrvl,
-		int	plt_size,
-		int	sh_mode,
-		int	sh_flggd,
-		int	sh_time,
-		int	*nbuffer,
-		int	*ngood,
-		int	*icurrent,
-		int	*nplt)
-{
-	/* local variables */
-	char	*function_name = "mbedit_action_right_ping";
-	int	status = MB_SUCCESS;
-	int	j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       plot_width:  %d\n",plwd);
-		fprintf(stderr,"dbg2       exager:      %d\n",exgr);
-		fprintf(stderr,"dbg2       x_interval:  %d\n",xntrvl);
-		fprintf(stderr,"dbg2       y_interval:  %d\n",yntrvl);
-		fprintf(stderr,"dbg2       plot_size:   %d\n",plt_size);
-		fprintf(stderr,"dbg2       show_mode:   %d\n",sh_mode);
-		fprintf(stderr,"dbg2       show_flagged:%d\n",sh_flggd);
-		fprintf(stderr,"dbg2       show_time:   %d\n",sh_time);
-		}
-
-	/* reset info */
-	if (info_set == MB_YES)
-		{
-		status = mbedit_unplot_beam(info_ping,info_beam);
-		status = mbedit_unplot_info();
-		info_set = MB_NO;
-		status = mbedit_plot_beam(info_ping,info_beam-1);
-		status = mbedit_plot_beam(info_ping,info_beam);
-		status = mbedit_plot_beam(info_ping,info_beam+1);
-		status = mbedit_plot_ping(info_ping);
-		}
-
-	/* check if a file has been opened
-		and a beam has been picked and saved */
-	if (file_open == MB_YES && beam_save == MB_YES)
-		{
-		/* write edits to save file */
-		if (esffile_open == MB_YES)
-		    {
-		    for (j=jbeam_save;j<ping[iping_save].beams_bath;j++)
-			if (mb_beam_ok(ping[iping_save].beamflag[j]))
-			    mb_ess_save(verbose, &esf,
-				ping[iping_save].time_d,
-				j + ping[iping_save].multiplicity * MB_ESF_MULTIPLICITY_FACTOR,
-				MBP_EDIT_FLAG, &error);
-		    }
-
-		/* unplot the affected beam and ping */
-		status = mbedit_unplot_ping(iping_save);
-		for (j=0;j<ping[iping_save].beams_bath;j++)
-			status = mbedit_unplot_beam(iping_save,j);
-
-		/* flag beams to right of picked beam */
-		if (verbose >= 1)
-			fprintf(stderr,"\nbeams in ping: %d right of beam: %d flagged\n",
-				iping_save,jbeam_save);
-		for (j=jbeam_save;j<ping[iping_save].beams_bath;j++)
-		    {
-                    if (mb_beam_ok(ping[iping_save].beamflag[j]))
-                        {
-                       /* reset the beam value - if beam was originally flagged
-                            then reset to the original flag value */
-                        if (mb_beam_ok(ping[iping_save].beamflagorg[j]))
-                            ping[iping_save].beamflag[j] = mb_beam_set_flag_manual(ping[iping_save].beamflag[j]);
-                        else
-                            ping[iping_save].beamflag[j] = ping[iping_save].beamflagorg[j];
-                        if (verbose >= 1)
-                                {
-                                fprintf(stderr,"\nping: %d beam:%d depth:%10.3f ",
-                                        iping_save,j,ping[iping_save].bath[j]);
-                                fprintf(stderr," flagged\n");
-                                }
-                        }
-                    }
-
-		/* set some return values */
-		*nbuffer = nbuff;
-		*ngood = nbuff;
-		*icurrent = current_id;
-
-		/* replot the affected beam and ping */
-		status = mbedit_plot_ping(iping_save);
-		for (j=0;j<ping[iping_save].beams_bath;j++)
-			status = mbedit_plot_beam(iping_save,j);
-
-		/* if ping has outbounds flag replot label */
-		if (ping[iping_save].outbounds != MBEDIT_OUTBOUNDS_NONE)
-			status = mbedit_plot_ping_label(iping_save, MB_NO);
-		}
-
-	/* if no file open or beam saved set failure status */
-	else
-		{
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       nbuffer:     %d\n",*nbuffer);
-		fprintf(stderr,"dbg2       ngood:       %d\n",*ngood);
-		fprintf(stderr,"dbg2       icurrent:    %d\n",*icurrent);
-		fprintf(stderr,"dbg2       nplt:        %d\n",*nplt);
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbedit_action_zero_ping(
-		int	plwd,
-		int	exgr,
-		int	xntrvl,
-		int	yntrvl,
-		int	plt_size,
-		int	sh_mode,
-		int	sh_flggd,
-		int	sh_time,
-		int	*nbuffer,
-		int	*ngood,
-		int	*icurrent,
-		int	*nplt)
-{
-	/* local variables */
-	char	*function_name = "mbedit_action_zero_ping";
-	int	status = MB_SUCCESS;
-	int	j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       plot_width:  %d\n",plwd);
-		fprintf(stderr,"dbg2       exager:      %d\n",exgr);
-		fprintf(stderr,"dbg2       x_interval:  %d\n",xntrvl);
-		fprintf(stderr,"dbg2       y_interval:  %d\n",yntrvl);
-		fprintf(stderr,"dbg2       plot_size:   %d\n",plt_size);
-		fprintf(stderr,"dbg2       show_mode:   %d\n",sh_mode);
-		fprintf(stderr,"dbg2       show_flagged:%d\n",sh_flggd);
-		fprintf(stderr,"dbg2       show_time:   %d\n",sh_time);
-		}
-
-	/* reset info */
-	if (info_set == MB_YES)
-		{
-		status = mbedit_unplot_beam(info_ping,info_beam);
-		status = mbedit_unplot_info();
-		info_set = MB_NO;
-		status = mbedit_plot_beam(info_ping,info_beam-1);
-		status = mbedit_plot_beam(info_ping,info_beam);
-		status = mbedit_plot_beam(info_ping,info_beam+1);
-		status = mbedit_plot_ping(info_ping);
-		}
-
-	/* check if a file has been opened
-		and a beam has been picked and saved */
-	if (file_open == MB_YES && beam_save == MB_YES)
-		{
-		/* write edits to save file */
-		if (esffile_open == MB_YES)
-		    {
-		    for (j=0;j<ping[iping_save].beams_bath;j++)
-		    	{
-			if (!mb_beam_check_flag_null(ping[iping_save].beamflag[j]))
-			    mb_ess_save(verbose, &esf,
-				ping[iping_save].time_d,
-				j + ping[iping_save].multiplicity * MB_ESF_MULTIPLICITY_FACTOR,
-				MBP_EDIT_ZERO, &error);
-			}
-		    }
-
-		/* unplot the affected beam and ping */
-		status = mbedit_unplot_ping(iping_save);
-		for (j=0;j<ping[iping_save].beams_bath;j++)
-			status = mbedit_unplot_beam(iping_save,j);
-
-		/* null beams in bad ping */
-		for (j=0;j<ping[iping_save].beams_bath;j++)
-			{
-			ping[iping_save].beamflag[j] = mb_beam_set_flag_null(ping[iping_save].beamflag[j]);
-			}
-		if (verbose >= 1)
-			fprintf(stderr,"\nbeams in ping: %d nulled\n",
-				iping_save);
-
-		/* set some return values */
-		*nbuffer = nbuff;
-		*ngood = nbuff;
-		*icurrent = current_id;
-
-		/* replot the affected beam and ping */
-		status = mbedit_plot_ping(iping_save);
-		for (j=0;j<ping[iping_save].beams_bath;j++)
-			status = mbedit_plot_beam(iping_save,j);
-
-		/* if ping has outbounds flag replot label */
-		if (ping[iping_save].outbounds != MBEDIT_OUTBOUNDS_NONE)
-			status = mbedit_plot_ping_label(iping_save, MB_NO);
-		}
-
-	/* if no file open or beam saved set failure status */
-	else
-		{
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       nbuffer:     %d\n",*nbuffer);
-		fprintf(stderr,"dbg2       ngood:       %d\n",*ngood);
-		fprintf(stderr,"dbg2       icurrent:    %d\n",*icurrent);
-		fprintf(stderr,"dbg2       nplt:        %d\n",*nplt);
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbedit_action_flag_view(
-		int	plwd,
-		int	exgr,
-		int	xntrvl,
-		int	yntrvl,
-		int	plt_size,
-		int	sh_mode,
-		int	sh_flggd,
-		int	sh_time,
-		int	*nbuffer,
-		int	*ngood,
-		int	*icurrent,
-		int	*nplt)
-{
-	/* local variables */
-	char	*function_name = "mbedit_action_flag_view";
-	int	status = MB_SUCCESS;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       plot_width:  %d\n",plwd);
-		fprintf(stderr,"dbg2       exager:      %d\n",exgr);
-		fprintf(stderr,"dbg2       x_interval:  %d\n",xntrvl);
-		fprintf(stderr,"dbg2       y_interval:  %d\n",yntrvl);
-		fprintf(stderr,"dbg2       plot_size:   %d\n",plt_size);
-		fprintf(stderr,"dbg2       show_mode:   %d\n",sh_mode);
-		fprintf(stderr,"dbg2       show_flagged:%d\n",sh_flggd);
-		fprintf(stderr,"dbg2       show_time:   %d\n",sh_time);
-		}
-
-	/* reset info */
-	if (info_set == MB_YES)
-		{
-		status = mbedit_unplot_beam(info_ping,info_beam);
-		status = mbedit_unplot_info();
-		info_set = MB_NO;
-		status = mbedit_plot_beam(info_ping,info_beam-1);
-		status = mbedit_plot_beam(info_ping,info_beam);
-		status = mbedit_plot_beam(info_ping,info_beam+1);
-		status = mbedit_plot_ping(info_ping);
-		}
-
-	/* do nothing unless file has been opened */
-	if (file_open == MB_YES)
-		{
-		/* flag all unflagged beams */
-		for (i=current_id;i<current_id+nplot;i++)
-			{
-			for (j=0;j<ping[i].beams_bath;j++)
-			    {
-			    if (mb_beam_ok(ping[i].beamflag[j]))
-				    {
-				    /* write edit to save file */
-				    if (esffile_open == MB_YES)
-					mb_ess_save(verbose, &esf,
-						ping[i].time_d,
-						j + ping[i].multiplicity * MB_ESF_MULTIPLICITY_FACTOR,
-						MBP_EDIT_FLAG, &error);
-
-                                    /* reset the beam value - if beam was originally flagged
-                                        then reset to the original flag value */
-                                    if (mb_beam_ok(ping[i].beamflagorg[j]))
-                                       ping[i].beamflag[j] = mb_beam_set_flag_manual(ping[i].beamflag[j]);
-                                    else
-                                        ping[i].beamflag[j] = ping[i].beamflagorg[j];
-                                    if (verbose >= 1)
-                                            {
-                                            fprintf(stderr,"\nping: %d beam:%d depth:%10.3f ",
-                                                    i,j,ping[i].bath[j]);
-                                            fprintf(stderr," flagged\n");
-                                            }
-				    beam_save = MB_YES;
-				    iping_save = i;
-				    jbeam_save = j;
-				    }
-			    }
-			}
-
-		/* set some return values */
-		*nbuffer = nbuff;
-		*ngood = nbuff;
-		*icurrent = current_id;
-
-		/* clear the screen */
-		status = mbedit_clear_screen();
-
-		/* set up plotting */
-		if (*ngood > 0)
-			{
-			status = mbedit_plot_all(plwd,exgr,xntrvl,yntrvl,
-					plt_size,sh_mode,sh_flggd,sh_time,nplt, MB_NO);
-			}
-		}
-
-	/* if no file open set failure status */
-	else if (file_open == MB_NO)
-		{
-		status = MB_FAILURE;
-		*nbuffer = nbuff;
-		*nbuffer = nbuff;
-		*ngood = nbuff;
-		current_id = 0;
-		*icurrent = current_id;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       nbuffer:     %d\n",*nbuffer);
-		fprintf(stderr,"dbg2       ngood:       %d\n",*ngood);
-		fprintf(stderr,"dbg2       icurrent:    %d\n",*icurrent);
-		fprintf(stderr,"dbg2       nplt:        %d\n",*nplt);
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbedit_action_unflag_view(
-		int	plwd,
-		int	exgr,
-		int	xntrvl,
-		int	yntrvl,
-		int	plt_size,
-		int	sh_mode,
-		int	sh_flggd,
-		int	sh_time,
-		int	*nbuffer,
-		int	*ngood,
-		int	*icurrent,
-		int	*nplt)
-{
-	/* local variables */
-	char	*function_name = "mbedit_action_unflag_view";
-	int	status = MB_SUCCESS;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       plot_width:  %d\n",plwd);
-		fprintf(stderr,"dbg2       exager:      %d\n",exgr);
-		fprintf(stderr,"dbg2       x_interval:  %d\n",xntrvl);
-		fprintf(stderr,"dbg2       y_interval:  %d\n",yntrvl);
-		fprintf(stderr,"dbg2       plot_size:   %d\n",plt_size);
-		fprintf(stderr,"dbg2       show_mode:   %d\n",sh_mode);
-		fprintf(stderr,"dbg2       show_flagged:%d\n",sh_flggd);
-		fprintf(stderr,"dbg2       show_time:   %d\n",sh_time);
-		}
-
-	/* reset info */
-	if (info_set == MB_YES)
-		{
-		status = mbedit_unplot_beam(info_ping,info_beam);
-		status = mbedit_unplot_info();
-		info_set = MB_NO;
-		status = mbedit_plot_beam(info_ping,info_beam-1);
-		status = mbedit_plot_beam(info_ping,info_beam);
-		status = mbedit_plot_beam(info_ping,info_beam+1);
-		status = mbedit_plot_ping(info_ping);
-		}
-
-	/* do nothing unless file has been opened */
-	if (file_open == MB_YES)
-		{
-		/* unflag all flagged beams */
-		for (i=current_id;i<current_id+nplot;i++)
-			{
-			for (j=0;j<ping[i].beams_bath;j++)
-			    {
-			    if (!mb_beam_ok(ping[i].beamflag[j])
-				&& !mb_beam_check_flag_null(ping[i].beamflag[j]))
-				    {
-				    /* write edit to save file */
-				    if (esffile_open == MB_YES)
-					mb_ess_save(verbose, &esf,
-						ping[i].time_d,
-						j + ping[i].multiplicity * MB_ESF_MULTIPLICITY_FACTOR,
-						MBP_EDIT_UNFLAG, &error);
-
-				    /* apply edit */
-				    ping[i].beamflag[j] = mb_beam_set_flag_none(ping[i].beamflag[j]);
-				    if (verbose >= 1)
-					{
-					fprintf(stderr,"\nping: %d beam:%d depth:%10.3f ",
-						i,j,ping[i].bath[j]);
-					fprintf(stderr," unflagged\n");
-					}
-				    beam_save = MB_YES;
-				    iping_save = i;
-				    jbeam_save = j;
-				    }
-			    }
-			}
-
-
-		/* set some return values */
-		*nbuffer = nbuff;
-		*ngood = nbuff;
-		*icurrent = current_id;
-
-		/* clear the screen */
-		status = mbedit_clear_screen();
-
-		/* set up plotting */
-		if (*ngood > 0)
-			{
-			status = mbedit_plot_all(plwd,exgr,xntrvl,yntrvl,
-					plt_size,sh_mode,sh_flggd,sh_time,nplt, MB_NO);
-			}
-		}
-
-	/* if no file open set failure status */
-	else if (file_open == MB_NO)
-		{
-		status = MB_FAILURE;
-		*nbuffer = nbuff;
-		*nbuffer = nbuff;
-		*ngood = nbuff;
-		current_id = 0;
-		*icurrent = current_id;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       nbuffer:     %d\n",*nbuffer);
-		fprintf(stderr,"dbg2       ngood:       %d\n",*ngood);
-		fprintf(stderr,"dbg2       icurrent:    %d\n",*icurrent);
-		fprintf(stderr,"dbg2       nplt:        %d\n",*nplt);
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbedit_action_unflag_all(
-		int	plwd,
-		int	exgr,
-		int	xntrvl,
-		int	yntrvl,
-		int	plt_size,
-		int	sh_mode,
-		int	sh_flggd,
-		int	sh_time,
-		int	*nbuffer,
-		int	*ngood,
-		int	*icurrent,
-		int	*nplt)
-{
-	/* local variables */
-	char	*function_name = "mbedit_action_unflag_all";
-	int	status = MB_SUCCESS;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       plot_width:  %d\n",plwd);
-		fprintf(stderr,"dbg2       exager:      %d\n",exgr);
-		fprintf(stderr,"dbg2       x_interval:  %d\n",xntrvl);
-		fprintf(stderr,"dbg2       y_interval:  %d\n",yntrvl);
-		fprintf(stderr,"dbg2       plot_size:   %d\n",plt_size);
-		fprintf(stderr,"dbg2       show_mode:   %d\n",sh_mode);
-		fprintf(stderr,"dbg2       show_flagged:%d\n",sh_flggd);
-		fprintf(stderr,"dbg2       show_time:   %d\n",sh_time);
-		}
-
-	/* reset info */
-	if (info_set == MB_YES)
-		{
-		status = mbedit_unplot_beam(info_ping,info_beam);
-		status = mbedit_unplot_info();
-		info_set = MB_NO;
-		status = mbedit_plot_beam(info_ping,info_beam-1);
-		status = mbedit_plot_beam(info_ping,info_beam);
-		status = mbedit_plot_beam(info_ping,info_beam+1);
-		status = mbedit_plot_ping(info_ping);
-		}
-
-	/* do nothing unless file has been opened */
-	if (file_open == MB_YES)
-		{
-		/* unflag all flagged beams from current point in buffer */
-		for (i=current_id;i<nbuff;i++)
-		    {
-		    for (j=0;j<ping[i].beams_bath;j++)
-			{
-			if (!mb_beam_ok(ping[i].beamflag[j])
-			    && !mb_beam_check_flag_null(ping[i].beamflag[j]))
-			    {
-			    /* write edit to save file */
-			    if (esffile_open == MB_YES)
-				mb_ess_save(verbose, &esf,
-					ping[i].time_d,
-					j + ping[i].multiplicity * MB_ESF_MULTIPLICITY_FACTOR,
-					MBP_EDIT_UNFLAG, &error);
-
-			    /* apply edit */
-			    ping[i].beamflag[j] = mb_beam_set_flag_none(ping[i].beamflag[j]);
-			    if (verbose >= 1)
-				{
-				fprintf(stderr,"\nping: %d beam:%d depth:%10.3f ",
-					i,j,ping[i].bath[j]);
-				fprintf(stderr," unflagged\n");
-				}
-			    beam_save = MB_NO;
-			    }
-			}
-		    }
-
-
-		/* set some return values */
-		*nbuffer = nbuff;
-		*ngood = nbuff;
-		*icurrent = current_id;
-
-		/* clear the screen */
-		status = mbedit_clear_screen();
-
-		/* set up plotting */
-		if (*ngood > 0)
-			{
-			status = mbedit_plot_all(plwd,exgr,xntrvl,yntrvl,
-					plt_size,sh_mode,sh_flggd,sh_time,nplt, MB_NO);
-			}
-		}
-
-	/* if no file open set failure status */
-	else if (file_open == MB_NO)
-		{
-		status = MB_FAILURE;
-		*nbuffer = nbuff;
-		*nbuffer = nbuff;
-		*ngood = nbuff;
-		current_id = 0;
-		*icurrent = current_id;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       nbuffer:     %d\n",*nbuffer);
-		fprintf(stderr,"dbg2       ngood:       %d\n",*ngood);
-		fprintf(stderr,"dbg2       icurrent:    %d\n",*icurrent);
-		fprintf(stderr,"dbg2       nplt:        %d\n",*nplt);
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbedit_action_filter_all(
-		int	plwd,
-		int	exgr,
-		int	xntrvl,
-		int	yntrvl,
-		int	plt_size,
-		int	sh_mode,
-		int	sh_flggd,
-		int	sh_time,
-		int	*nbuffer,
-		int	*ngood,
-		int	*icurrent,
-		int	*nplt)
-{
-	/* local variables */
-	char	*function_name = "mbedit_action_filter_all";
-	int	status = MB_SUCCESS;
-	char	string[MB_PATH_MAXLINE];
-	int	i;
-
-	/* print input debug statements */
-fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-function_name);
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       plot_width:  %d\n",plwd);
-		fprintf(stderr,"dbg2       exager:      %d\n",exgr);
-		fprintf(stderr,"dbg2       x_interval:  %d\n",xntrvl);
-		fprintf(stderr,"dbg2       y_interval:  %d\n",yntrvl);
-		fprintf(stderr,"dbg2       plot_size:   %d\n",plt_size);
-		fprintf(stderr,"dbg2       show_mode:   %d\n",sh_mode);
-		fprintf(stderr,"dbg2       show_flagged:%d\n",sh_flggd);
-		fprintf(stderr,"dbg2       show_time:   %d\n",sh_time);
-		}
-
-	/* reset info */
-	if (info_set == MB_YES)
-		{
-		status = mbedit_unplot_beam(info_ping,info_beam);
-		status = mbedit_unplot_info();
-		info_set = MB_NO;
-		status = mbedit_plot_beam(info_ping,info_beam-1);
-		status = mbedit_plot_beam(info_ping,info_beam);
-		status = mbedit_plot_beam(info_ping,info_beam+1);
-		status = mbedit_plot_ping(info_ping);
-		}
-
-	/* do nothing unless file has been opened */
-	if (file_open == MB_YES)
-		{
-		do_message_on("MBedit is applying bathymetry filters...");
-
-		/* filter all pings in buffer */
-		for (i=current_id;i<nbuff;i++)
-		    {
-		    mbedit_filter_ping(i);
-
-		    /* update message every 250 records */
-		    if (i % 250 == 0)
-			{
-			sprintf(string, "MBedit: filters applied to %d of %d records so far...",
-				i, nbuff - current_id - 1);
-			do_message_on(string);
-			}
-		    }
-
-		/* set some return values */
-		*nbuffer = nbuff;
-		*ngood = nbuff;
-		*icurrent = current_id;
-
-		/* clear the screen */
-		status = mbedit_clear_screen();
-
-		/* set up plotting */
-		do_message_off();
-		if (*ngood > 0)
-			{
-			status = mbedit_plot_all(plwd,exgr,xntrvl,yntrvl,
-					plt_size,sh_mode,sh_flggd,sh_time,nplt, MB_NO);
-			}
-		}
-
-	/* if no file open set failure status */
-	else if (file_open == MB_NO)
-		{
-		status = MB_FAILURE;
-		*nbuffer = nbuff;
-		*nbuffer = nbuff;
-		*ngood = nbuff;
-		current_id = 0;
-		*icurrent = current_id;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       nbuffer:     %d\n",*nbuffer);
-		fprintf(stderr,"dbg2       ngood:       %d\n",*ngood);
-		fprintf(stderr,"dbg2       icurrent:    %d\n",*icurrent);
-		fprintf(stderr,"dbg2       nplt:        %d\n",*nplt);
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbedit_filter_ping(int iping)
-{
-	/* local variables */
-	char	*function_name = "mbedit_filter_ping";
-	int	status = MB_SUCCESS;
-	int	nbathsum, nbathlist;
-	double	bathsum, bathmedian;
-	int	start, end;
-	double	angle;
-	int	istart, iend, jstart, jend, jbeam;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       iping:       %d\n",iping);
-		}
-
-	/* reset info */
-	if (info_set == MB_YES)
-		{
-		status = mbedit_unplot_beam(info_ping,info_beam);
-		status = mbedit_unplot_info();
-		info_set = MB_NO;
-		status = mbedit_plot_beam(info_ping,info_beam-1);
-		status = mbedit_plot_beam(info_ping,info_beam);
-		status = mbedit_plot_beam(info_ping,info_beam+1);
-		status = mbedit_plot_ping(info_ping);
-		}
-
-	/* do nothing unless file has been opened and filters set on */
-	if (file_open == MB_YES
-		&& iping >= 0 && iping < nbuff)
-		{
-		/* work on good data */
-		if (status == MB_SUCCESS)
-		    {
-		    /* clear previous filter flags */
-		    for (j=0;j<ping[iping].beams_bath;j++)
-		    	{
-		    	if (mb_beam_check_flag_filter2(ping[iping].beamflag[j]))
-		    		{
-			    	/* write edit to save file */
-			    	if (esffile_open == MB_YES)
-				    mb_ess_save(verbose, &esf,
-						ping[iping].time_d,
-						j + ping[iping].multiplicity * MB_ESF_MULTIPLICITY_FACTOR,
-						MBP_EDIT_UNFLAG, &error);
-
-			    	/* apply edit */
-				ping[iping].beamflag[j] = mb_beam_set_flag_none(ping[iping].beamflag[j]);
-			    	if (verbose >= 1)
-				    {
-				    fprintf(stderr,"\nping: %d beam:%d depth:%10.3f ",
-						iping,j,ping[iping].bath[j]);
-				    fprintf(stderr," unflagged\n");
-				    }
-		    		}
-		    	}
-
-		    /* apply median filter if desired */
-		    if (filter_medianspike == MB_YES)
-		    	{
-			/* loop over all beams in the ping */
-		    	for (jbeam=0;jbeam<ping[iping].beams_bath;jbeam++)
-			    {
-			    /* calculate median if beam not flagged */
-			    if (mb_beam_ok(ping[iping].beamflag[jbeam]))
-				{
-		    		nbathlist = 0;
-		    		nbathsum = 0;
-		    		bathsum = 0.0;
-		    		bathmedian = 0.0;
-				istart = MAX(iping - filter_medianspike_ltrack / 2, 0);
-				iend = MIN(iping + filter_medianspike_ltrack / 2, nbuff - 1);
-				for (i=istart;i<=iend;i++)
-				    {
-				    jstart = MAX(jbeam - filter_medianspike_xtrack / 2, 0);
-				    jend = MIN(jbeam + filter_medianspike_xtrack / 2, ping[iping].beams_bath - 1);
-				    for (j=jstart;j<=jend;j++)
-					{
-			    		if (mb_beam_ok(ping[i].beamflag[j]))
-					    {
-					    bathsum += ping[i].bath[j];
-				    	    nbathsum++;
-				    	    bathlist[nbathlist] = ping[i].bath[j];
-					    nbathlist++;
-					    }
-					}
-				    }
-				if (nbathlist > 0)
-				    {
-				    qsort((char *)bathlist,nbathlist,sizeof(double),(void *)mb_double_compare);
-				    bathmedian = bathlist[nbathlist/2];
-		 		    }
-			    	if (100 * fabs(ping[iping].bath[jbeam] - bathmedian) / ping[iping].altitude
-			    	        > filter_medianspike_threshold)
-				    {
-			    	    /* write edit to save file */
-			    	    if (esffile_open == MB_YES)
-					mb_ess_save(verbose, &esf,
-						ping[iping].time_d,
-						jbeam + ping[iping].multiplicity * MB_ESF_MULTIPLICITY_FACTOR,
-						MBP_EDIT_FILTER, &error);
-
-                                    /* reset the beam value - if beam was originally flagged
-                                        then reset to the original flag value */
-                                    if (mb_beam_ok(ping[iping].beamflagorg[jbeam]))
-                                        ping[iping].beamflag[jbeam] = mb_beam_set_flag_filter2(ping[iping].beamflag[jbeam]);
-                                    else
-                                        ping[iping].beamflag[jbeam] = ping[iping].beamflagorg[jbeam];
-                                    if (verbose >= 1)
-                                            {
-                                            fprintf(stderr,"\nping: %d beam:%d depth:%10.3f ",
-                                                    iping,jbeam,ping[iping].bath[jbeam]);
-                                            fprintf(stderr," flagged\n");
-                                            }
-				    }
-				}
-			    }
-			}
-
-
-		    /* apply wrongside filter if desired */
-		    if (filter_wrongside == MB_YES)
-		    	{
-		    	start = 0;
-		    	end = (ping[iping].beams_bath / 2) - filter_wrongside_threshold;
-		 	for (j=start;j<end;j++)
-		 	    {
-		 	    if (mb_beam_ok(ping[iping].beamflag[j])
-		 	    	&& ping[iping].bathacrosstrack[j] > 0.0)
-		 	    	{
-			   	/* write edit to save file */
-			        if (esffile_open == MB_YES)
-					mb_ess_save(verbose, &esf,
-						ping[iping].time_d,
-						j + ping[iping].multiplicity * MB_ESF_MULTIPLICITY_FACTOR,
-						MBP_EDIT_FILTER, &error);
-
-                                /* reset the beam value - if beam was originally flagged
-                                    then reset to the original flag value */
-                                if (mb_beam_ok(ping[iping].beamflagorg[j]))
-                                    ping[iping].beamflag[j] = ping[iping].beamflag[j] = mb_beam_set_flag_filter2(ping[iping].beamflag[j]);
-                                else
-                                    ping[iping].beamflag[j] = ping[iping].beamflagorg[j];
-                                if (verbose >= 1)
-                                        {
-                                        fprintf(stderr,"\nping: %d beam:%d depth:%10.3f ",
-                                                iping,j,ping[iping].bath[j]);
-                                        fprintf(stderr," flagged\n");
-                                        }
-		 	    	}
-		 	    }
-		    	start = (ping[iping].beams_bath / 2) + filter_wrongside_threshold;
-		    	end = ping[iping].beams_bath;
-		 	for (j=start;j<end;j++)
-		 	    {
-		 	    if (mb_beam_ok(ping[iping].beamflag[j])
-		 	    	&& ping[iping].bathacrosstrack[j] < 0.0)
-		 	    	{
-			   	/* write edit to save file */
-			        if (esffile_open == MB_YES)
-					mb_ess_save(verbose, &esf,
-						ping[iping].time_d,
-						j + ping[iping].multiplicity * MB_ESF_MULTIPLICITY_FACTOR,
-						MBP_EDIT_FILTER, &error);
-
-                                /* reset the beam value - if beam was originally flagged
-                                    then reset to the original flag value */
-                                if (mb_beam_ok(ping[iping].beamflagorg[j]))
-                                    ping[iping].beamflag[j] = ping[iping].beamflag[j] = mb_beam_set_flag_filter2(ping[iping].beamflag[j]);
-                                else
-                                    ping[iping].beamflag[j] = ping[iping].beamflagorg[j];
-                                if (verbose >= 1)
-                                        {
-                                        fprintf(stderr,"\nping: %d beam:%d depth:%10.3f ",
-                                                iping,j,ping[iping].bath[j]);
-                                        fprintf(stderr," flagged\n");
-                                        }
-		 	    	}
-		 	    }
-			}
-
-		    /* apply cut by beam number filter if desired */
-		    if (filter_cutbeam == MB_YES)
-		    	{
-			/* handle cut inside swath */
-		 	if (filter_cutbeam_begin <= filter_cutbeam_end)
-		 	    {
-		    	    start = MAX(filter_cutbeam_begin, 0);
-		    	    end = MIN(filter_cutbeam_end, ping[iping].beams_bath - 1);
-		    	    for (j=start;j<end;j++)
-			    	{
-			    	if (mb_beam_ok(ping[iping].beamflag[j]))
-				    {
-			    	    /* write edit to save file */
-			    	    if (esffile_open == MB_YES)
-					mb_ess_save(verbose, &esf,
-						ping[iping].time_d,
-						j + ping[iping].multiplicity * MB_ESF_MULTIPLICITY_FACTOR,
-						MBP_EDIT_FILTER, &error);
-
-                                    /* reset the beam value - if beam was originally flagged
-                                        then reset to the original flag value */
-                                    if (mb_beam_ok(ping[iping].beamflagorg[j]))
-                                        ping[iping].beamflag[j] = ping[iping].beamflag[j] = mb_beam_set_flag_filter2(ping[iping].beamflag[j]);
-                                    else
-                                        ping[iping].beamflag[j] = ping[iping].beamflagorg[j];
-                                    if (verbose >= 1)
-                                            {
-                                            fprintf(stderr,"\nping: %d beam:%d depth:%10.3f ",
-                                                    iping,j,ping[iping].bath[j]);
-                                            fprintf(stderr," flagged\n");
-                                            }
-				    }
-			    	}
-			    }
-
-			/* handle cut at edges of swath */
-		 	else if (filter_cutbeam_begin > filter_cutbeam_end)
-		 	    {
-		    	    for (j=0;j<ping[iping].beams_bath;j++)
-			    	{
-			    	if ((j <= filter_cutbeam_end || j >= filter_cutbeam_begin)
-				    && mb_beam_ok(ping[iping].beamflag[j]))
-				    {
-			    	    /* write edit to save file */
-			    	    if (esffile_open == MB_YES)
-					mb_ess_save(verbose, &esf,
-						ping[iping].time_d,
-						j + ping[iping].multiplicity * MB_ESF_MULTIPLICITY_FACTOR,
-						MBP_EDIT_FILTER, &error);
-
-                                    /* reset the beam value - if beam was originally flagged
-                                        then reset to the original flag value */
-                                    if (mb_beam_ok(ping[iping].beamflagorg[j]))
-                                        ping[iping].beamflag[j] = ping[iping].beamflag[j] = mb_beam_set_flag_filter2(ping[iping].beamflag[j]);
-                                    else
-                                        ping[iping].beamflag[j] = ping[iping].beamflagorg[j];
-                                    if (verbose >= 1)
-                                            {
-                                            fprintf(stderr,"\nping: %d beam:%d depth:%10.3f ",
-                                                    iping,j,ping[iping].bath[j]);
-                                            fprintf(stderr," flagged\n");
-                                            }
-				    }
-			    	}
-			    }
-			}
-
-		    /* apply cut by distance filter if desired */
-		    if (filter_cutdistance == MB_YES)
-		    	{
-			/* handle cut inside swath */
-		 	if (filter_cutdistance_begin <= filter_cutdistance_end)
-		 	    {
-		    	    for (j=0;j<ping[iping].beams_bath;j++)
-			    	{
-			    	if (mb_beam_ok(ping[iping].beamflag[j]))
-				    {
-				    if (ping[iping].bathacrosstrack[j] >= filter_cutdistance_begin
-				    	&& ping[iping].bathacrosstrack[j] <= filter_cutdistance_end)
-				    	{
-			    	    	/* write edit to save file */
-			    	    	if (esffile_open == MB_YES)
-						mb_ess_save(verbose, &esf,
-							ping[iping].time_d,
-							j + ping[iping].multiplicity * MB_ESF_MULTIPLICITY_FACTOR,
-							MBP_EDIT_FILTER, &error);
-
-                                        /* reset the beam value - if beam was originally flagged
-                                            then reset to the original flag value */
-                                        if (mb_beam_ok(ping[iping].beamflagorg[j]))
-                                            ping[iping].beamflag[j] = mb_beam_set_flag_filter2(ping[iping].beamflag[j]);
-                                        else
-                                            ping[iping].beamflag[j] = ping[iping].beamflagorg[j];
-                                        if (verbose >= 1)
-                                                {
-                                                fprintf(stderr,"\nping: %d beam:%d depth:%10.3f ",
-                                                        iping,j,ping[iping].bath[j]);
-                                                fprintf(stderr," flagged\n");
-                                                }
-				  	}
-				    }
-			    	}
-			    }
-
-			/* handle cut at edges of swath */
-		 	else if (filter_cutdistance_begin > filter_cutdistance_end)
-		 	    {
-		    	    for (j=0;j<ping[iping].beams_bath;j++)
-			    	{
-			    	if (mb_beam_ok(ping[iping].beamflag[j]))
-				    {
-				    if (ping[iping].bathacrosstrack[j] >= filter_cutdistance_begin
-					|| ping[iping].bathacrosstrack[j] <= filter_cutdistance_end)
-				    	{
-			    	    	/* write edit to save file */
-			    	    	if (esffile_open == MB_YES)
-						mb_ess_save(verbose, &esf,
-							ping[iping].time_d,
-							j + ping[iping].multiplicity * MB_ESF_MULTIPLICITY_FACTOR,
-							MBP_EDIT_FILTER, &error);
-
-                                        /* reset the beam value - if beam was originally flagged
-                                            then reset to the original flag value */
-                                        if (mb_beam_ok(ping[iping].beamflagorg[j]))
-                                            ping[iping].beamflag[j] = mb_beam_set_flag_filter2(ping[iping].beamflag[j]);
-                                        else
-                                            ping[iping].beamflag[j] = ping[iping].beamflagorg[j];
-                                        if (verbose >= 1)
-                                                {
-                                                fprintf(stderr,"\nping: %d beam:%d depth:%10.3f ",
-                                                        iping,j,ping[iping].bath[j]);
-                                                fprintf(stderr," flagged\n");
-                                                }
-					}
-				    }
-			    	}
-			    }
-			}
-
-		    /* apply cut by angle filter if desired */
-		    if (filter_cutangle == MB_YES)
-		    	{
-			/* handle cut inside swath */
-		 	if (filter_cutangle_begin <= filter_cutangle_end)
-		 	    {
-		    	    for (j=0;j<ping[iping].beams_bath;j++)
-			    	{
-			    	if (mb_beam_ok(ping[iping].beamflag[j])
-				    && ping[iping].altitude > 0.0)
-				    {
-				    angle = RTD * atan(ping[iping].bathacrosstrack[j]
-							/ ping[iping].altitude);
-				    if (angle >= filter_cutangle_begin
-				    	&& angle <= filter_cutangle_end)
-				    	{
-			    	    	/* write edit to save file */
-			    	    	if (esffile_open == MB_YES)
-						mb_ess_save(verbose, &esf,
-							ping[iping].time_d,
-							j + ping[iping].multiplicity * MB_ESF_MULTIPLICITY_FACTOR,
-							MBP_EDIT_FILTER, &error);
-
-                                        /* reset the beam value - if beam was originally flagged
-                                            then reset to the original flag value */
-                                        if (mb_beam_ok(ping[iping].beamflagorg[j]))
-                                            ping[iping].beamflag[j] = mb_beam_set_flag_filter2(ping[iping].beamflag[j]);
-                                        else
-                                            ping[iping].beamflag[j] = ping[iping].beamflagorg[j];
-                                        if (verbose >= 1)
-                                                {
-                                                fprintf(stderr,"\nping: %d beam:%d depth:%10.3f ",
-                                                        iping,j,ping[iping].bath[j]);
-                                                fprintf(stderr," flagged\n");
-                                                }
-				  	}
-				    }
-			    	}
-			    }
-
-			/* handle cut at edges of swath */
-		 	else if (filter_cutangle_begin > filter_cutangle_end)
-		 	    {
-		    	    for (j=0;j<ping[iping].beams_bath;j++)
-			    	{
-			    	if (mb_beam_ok(ping[iping].beamflag[j])
-				    && ping[iping].altitude > 0.0)
-				    {
-				    angle = RTD * atan(ping[iping].bathacrosstrack[j]
-							/ ping[iping].altitude);
-				    if (angle >= filter_cutangle_begin
-					|| angle <= filter_cutangle_end)
-				    	{
-			    	    	/* write edit to save file */
-			    	    	if (esffile_open == MB_YES)
-						mb_ess_save(verbose, &esf,
-							ping[iping].time_d,
-							j + ping[iping].multiplicity * MB_ESF_MULTIPLICITY_FACTOR,
-							MBP_EDIT_FILTER, &error);
-
-                                        /* reset the beam value - if beam was originally flagged
-                                            then reset to the original flag value */
-                                        if (mb_beam_ok(ping[iping].beamflagorg[j]))
-                                            ping[iping].beamflag[j] = mb_beam_set_flag_filter2(ping[iping].beamflag[j]);
-                                        else
-                                            ping[iping].beamflag[j] = ping[iping].beamflagorg[j];
-                                        if (verbose >= 1)
-                                                {
-                                                fprintf(stderr,"\nping: %d beam:%d depth:%10.3f ",
-                                                        iping,j,ping[iping].bath[j]);
-                                                fprintf(stderr," flagged\n");
-                                                }
-					}
-				    }
-			    	}
-			    }
-			}
-
-		    }
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbedit_get_format(char *file, int *form)
-{
-	/* local variables */
-	char	*function_name = "mbedit_get_format";
-	int	status = MB_SUCCESS;
-	char	tmp[MB_PATH_MAXLINE];
-	int	tform;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       file:        %s\n",file);
-		fprintf(stderr,"dbg2       format:      %d\n",*form);
-		}
-
-	/* get filenames */
-	/* look for MB suffix convention */
-	if ((status = mb_get_format(verbose, file, tmp,
-				    &tform, &error))
-				    == MB_SUCCESS)
-	    {
-	    *form = tform;
-	    }
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       format:      %d\n",*form);
-		fprintf(stderr,"dbg2       error:      %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbedit_open_file(char *file, int form, int savemode)
-{
-	/* local variables */
-	char	*function_name = "mbedit_open_file";
-	int	status = MB_SUCCESS;
-	int	outputmode;
-	int	i;
-	mb_path	error1;
-	mb_path	error2;
-	mb_path	error3;
-
-	/* swath file locking variables */
-	int	lock_status;
-	int	locked;
-	int	lock_purpose;
-	mb_path	lock_program;
-	mb_path lock_cpu;
-	mb_path lock_user;
-	char	lock_date[25];
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       file:        %s\n",file);
-		fprintf(stderr,"dbg2       format:      %d\n",form);
-		fprintf(stderr,"dbg2       savemode:    %d\n",savemode);
-		}
-
-	/* reset message */
-	do_message_on("MBedit is opening a data file...");
-
-	/* get filenames */
-	strcpy(ifile,file);
-	format = form;
-
-	/* try to lock file */
-	if (uselockfiles == MB_YES)
-		{
-		status = mb_pr_lockswathfile(verbose, ifile,
-				MBP_LOCK_EDITBATHY, program_name, &error);
-		}
-	else
-		{
-		lock_status = mb_pr_lockinfo(verbose, ifile, &locked,
-				&lock_purpose, lock_program, lock_user, lock_cpu,
-				lock_date, &error);
-
-		/* if locked get lock info */
-		if (error == MB_ERROR_FILE_LOCKED)
-			{
-			fprintf(stderr, "\nFile %s locked but lock ignored\n", ifile);
-			fprintf(stderr, "File locked by <%s> running <%s>\n", lock_user, lock_program);
-			fprintf(stderr, "on cpu <%s> at <%s>\n", lock_cpu, lock_date);
-			error = MB_ERROR_NO_ERROR;
-			}
-		}
-
-	/* if locked let the user know file can't be opened */
-	if (status == MB_FAILURE)
-		{
-		/* turn off message */
-		do_message_off();
-
-		/* if locked get lock info */
-		if (error == MB_ERROR_FILE_LOCKED)
-			{
-			lock_status = mb_pr_lockinfo(verbose, ifile, &locked,
-					&lock_purpose, lock_program, lock_user, lock_cpu,
-					lock_date, &error);
-
-			sprintf(error1, "Unable to open input file:");
-			sprintf(error2, "File locked by <%s> running <%s>", lock_user, lock_program);
-			sprintf(error3, "on cpu <%s> at <%s>", lock_cpu, lock_date);
-			fprintf(stderr, "\nUnable to open input file:\n");
-			fprintf(stderr, "  %s\n", ifile);
-			fprintf(stderr, "File locked by <%s> running <%s>\n", lock_user, lock_program);
-			fprintf(stderr, "on cpu <%s> at <%s>\n", lock_cpu, lock_date);
-			}
-
-		/* else if unable to create lock file there is a permissions problem */
-		else if (error == MB_ERROR_OPEN_FAIL)
-			{
-			sprintf(error1, "Unable to create lock file");
-			sprintf(error2, "for intended input file:");
-			sprintf(error3, "-Likely permissions issue");
-			fprintf(stderr, "Unable to create lock file\n");
-			fprintf(stderr, "for intended input file:\n");
-			fprintf(stderr, "  %s\n", ifile);
-			fprintf(stderr, "-Likely permissions issue\n");
-			}
-
-		/* put up error dialog */
-		do_error_dialog(error1,error2, error3);
-		}
-
-	/* if successfully locked (or lock ignored) proceed */
-	if (status == MB_SUCCESS)
-		{
-		/* initialize reading the input multibeam file */
-		if ((status = mb_read_init(
-			verbose,ifile,format,pings,lonflip,bounds,
-			btime_i,etime_i,speedmin,timegap,
-			&imbio_ptr,&btime_d,&etime_d,
-			&beams_bath,&beams_amp,&pixels_ss,&error)) != MB_SUCCESS)
-			{
-			mb_error(verbose,error,&message);
-			fprintf(stderr,"\nMBIO Error returned from function <mb_read_init>:\n%s\n",message);
-			fprintf(stderr,"\nMultibeam File <%s> not initialized for reading\n",ifile);
-			status = MB_FAILURE;
-			do_error_dialog("Unable to open input file.",
-					"You may not have read",
-					"permission in this directory!");
-			return(status);
-			}
-
-		/* allocate memory for data arrays */
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							sizeof(char), (void **)&beamflag, &error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							sizeof(double), (void **)&bath, &error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_AMPLITUDE,
-							sizeof(double), (void **)&amp, &error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							sizeof(double), (void **)&bathacrosstrack, &error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							sizeof(double), (void **)&bathalongtrack, &error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_SIDESCAN,
-							sizeof(double), (void **)&ss, &error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_SIDESCAN,
-							sizeof(double), (void **)&ssacrosstrack, &error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_SIDESCAN,
-							sizeof(double), (void **)&ssalongtrack, &error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							sizeof(int), (void **)&detect, &error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							sizeof(int), (void **)&pulses, &error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							sizeof(int), (void **)&editcount, &error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							MBEDIT_MAX_PINGS*sizeof(double), (void **)&bathlist, &error);
-		for (i=0;i<MBEDIT_BUFFER_SIZE;i++)
-			{
-			ping[i].allocated = 0;
-			ping[i].beamflag = NULL;
-			ping[i].bath = NULL;
-			ping[i].bathacrosstrack = NULL;
-			ping[i].bathalongtrack = NULL;
-			ping[i].detect = NULL;
-			ping[i].pulses = NULL;
-			ping[i].bath_x = NULL;
-			ping[i].bath_y = NULL;
-			}
-
-		/* if error initializing memory then quit */
-		if (error != MB_ERROR_NO_ERROR)
-			{
-			mb_error(verbose,error,&message);
-			fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",message);
-			fprintf(stderr,"\nProgram <%s> Terminated\n",
-				program_name);
-			exit(error);
-			}
-
-		/* initialize the buffer */
-		nbuff = 0;
-		}
-
-	/* if success so far deal with edit save files */
-	if (status == MB_SUCCESS)
-		{
-		/* reset message */
-		if (savemode == MB_YES)
-			{
-			sprintf(notice, "MBedit is sorting %d old edits...", esf.nedit);
-			do_message_on(notice);
-			}
-
-		/* handle esf edits */
-		if (output_mode != MBEDIT_OUTPUT_BROWSE)
-			outputmode = MB_YES;
-		else
-			outputmode = MB_NO;
-		if (savemode == MB_YES || outputmode == MB_YES)
-			{
-			status = mb_esf_load(verbose, ifile,
-					savemode, outputmode, esffile, &esf, &error);
-			if (output_mode != MBEDIT_OUTPUT_BROWSE
-				&& status == MB_SUCCESS
-				&& esf.esffp != NULL)
-				esffile_open = MB_YES;
-			if (status == MB_FAILURE
-				&& error == MB_ERROR_OPEN_FAIL)
-				{
-				esffile_open = MB_NO;
-				fprintf(stderr, "\nUnable to open new edit save file %s\n",
-				    esf.esffile);
-				do_error_dialog("Unable to open new edit save file.",
-						"You may not have write",
-						"permission in this directory!");
-				}
-			else if (status == MB_FAILURE
-				&& error == MB_ERROR_MEMORY_FAIL)
-				{
-				esffile_open = MB_NO;
-				fprintf(stderr, "\nUnable to allocate memory for edits in esf file %s\n", esf.esffile);
-				do_error_dialog("Unable to allocate memory for.",
-						"edits in existing edit",
-						"save file!");
-				}
-			}
-		}
-
-	/* deal with success */
-	if (status == MB_SUCCESS)
-		{
-		file_open = MB_YES;
-		if (verbose >= 0)
-			{
-			fprintf(stderr,"\nMultibeam File <%s> initialized for reading\n",ifile);
-			fprintf(stderr,"Multibeam Data Format ID: %d\n",format);
-			}
-		}
-	else
-		{
-		file_open = MB_NO;
-		if (verbose >= 0)
-			{
-			fprintf(stderr,"\nERROR: Multibeam File <%s> NOT initialized for reading\n",ifile);
-			fprintf(stderr,"Multibeam Data Format ID: %d\n",format);
-			}
-		}
-
-	/* turn off message */
-	do_message_off();
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-verbose = 0;
-	/* return */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbedit_close_file()
-{
-	/* local variables */
-	char	*function_name = "mbedit_close_file";
-	int	status = MB_SUCCESS;
-	char	command[MB_PATH_MAXLINE];
-        int     shellstatus;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
-
-	/* reset message */
-	do_message_on("MBedit is closing a data file...");
-
-	/* deallocate memory for data arrays */
-	for (i=0;i<MBEDIT_BUFFER_SIZE;i++)
-		{
-		if (ping[i].allocated > 0)
-		    {
-		    ping[i].allocated = 0;
-		    free(ping[i].beamflag);
-		    free(ping[i].bath);
-		    free(ping[i].bathacrosstrack);
-		    free(ping[i].bathalongtrack);
-		    free(ping[i].detect);
-		    free(ping[i].pulses);
-		    free(ping[i].bath_x);
-		    free(ping[i].bath_y);
-
-		    /* reset message */
-		    if (i%250 == 0)
-			{
-			sprintf(notice, "MBedit: %d pings deallocated...", i);
-			do_message_on(notice);
-			}
-		    }
-		}
-
-	/* check memory */
-	if (verbose >= 4)
-		status = mb_memory_list(verbose,&error);
-
-	/* close the files */
-	status = mb_close(verbose,&imbio_ptr,&error);
-	if (esf.nedit > 0 || esf.esffp != NULL)
-	    {
-	    status = mb_esf_close(verbose, &esf, &error);
-	    }
-
-	/* unlock the raw swath file */
-	if (uselockfiles == MB_YES)
-		status = mb_pr_unlockswathfile(verbose, ifile,
-						MBP_LOCK_EDITBATHY, program_name, &error);
-
-	/* set mbprocess parameters */
-	if (output_mode == MBEDIT_OUTPUT_EDIT)
-	    {
-	    /* update mbprocess parameter file */
-	    status = mb_pr_update_format(verbose, ifile,
-			MB_YES, format,
-			&error);
-	    status = mb_pr_update_edit(verbose, ifile,
-			MBP_EDIT_ON, esf.esffile,
-			&error);
-
-	    /* run mbprocess if desired */
-	    if (run_mbprocess == MB_YES)
-		    {
-		    /* turn message on */
-		    do_message_on("Bathymetry edits being applied using mbprocess...");
-
-		    /* run mbprocess */
-		    sprintf(command, "mbprocess -I %s\n",ifile);
-		    shellstatus = system(command);
-		    }
-	    }
-
-	/* if we got here we must have succeeded */
-	if (verbose >= 0)
-		{
-		fprintf(stderr,"\nMultibeam Input File <%s> closed\n",ifile);
-		fprintf(stderr,"%d data records loaded\n",nload_total);
-		fprintf(stderr,"%d data records dumped\n",ndump_total);
-
-		}
-	file_open = MB_NO;
-	nload_total = 0;
-	ndump_total = 0;
-
-	/* turn file button on */
-	do_filebutton_on();
-	do_nextbutton_off();
-
-	/* turn off message */
-	do_message_off();
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbedit_dump_data(int hold_size, int *ndumped, int *nbuffer)
-{
-	/* local variables */
-	char	*function_name = "mbedit_dump_data";
-	int	status = MB_SUCCESS;
-	int	action;
-	int	iping, jbeam;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       hold_size:   %d\n",hold_size);
-		}
-
-	/* dump or clear data from the buffer */
-	ndump = 0;
-	if (nbuff > 0)
-		{
-		/* turn message on */
-		do_message_on("MBedit is clearing data...");
-
-		/* output changed edits in pings to be dumped */
-		for (iping=0;iping<nbuff-hold_size;iping++)
-			{
-			for (jbeam=0;jbeam<ping[iping].beams_bath;jbeam++)
-			    {
-			    if (ping[iping].beamflag[jbeam] != ping[iping].beamflagorg[jbeam])
-			    	{
-				if (mb_beam_ok(ping[iping].beamflag[jbeam]))
-					action = MBP_EDIT_UNFLAG;
-				else if (mb_beam_check_flag_filter2(ping[iping].beamflag[jbeam]))
-					action = MBP_EDIT_FILTER;
-				else if (mb_beam_check_flag_filter(ping[iping].beamflag[jbeam]))
-					action = MBP_EDIT_FILTER;
-				else if (!mb_beam_check_flag_null(ping[iping].beamflag[jbeam]))
-					action = MBP_EDIT_FLAG;
-				else
-					action = MBP_EDIT_ZERO;
-				mb_esf_save(verbose, &esf,
-						ping[iping].time_d,
-						jbeam + ping[iping].multiplicity * MB_ESF_MULTIPLICITY_FACTOR,
-						action, &error);
-				}
-			    }
-			}
-
-		/* deallocate pings to be dumped */
-		for (iping=0;iping<nbuff-hold_size;iping++)
-			{
-			if (ping[iping].allocated > 0)
-			    {
-			    ping[iping].allocated = 0;
-			    free(ping[iping].beamflag);
-			    free(ping[iping].beamflagorg);
-			    free(ping[iping].bath);
-			    free(ping[iping].bathacrosstrack);
-			    free(ping[iping].bathalongtrack);
-			    free(ping[iping].detect);
-			    free(ping[iping].pulses);
-			    free(ping[iping].bath_x);
-			    free(ping[iping].bath_y);
-			    }
-			}
-
-		/* copy data to be held */
-		for (iping=0;iping<hold_size;iping++)
-			{
-			ping[iping] = ping[iping+nbuff-hold_size];
-			}
-		ndump = nbuff - hold_size;
-		nbuff = hold_size;
-
-		/* turn message off */
-		do_message_off();
-		}
-	*ndumped = ndump;
-	ndump_total += ndump;
-
-	/* reset current data pointer */
-	if (ndump > 0)
-		current_id = current_id - ndump;
-	if (current_id < 0)
-		current_id = 0;
-	if (current_id > nbuff - 1)
-		current_id = nbuff - 1;
-	*nbuffer = nbuff;
-
-	/* print out information */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\n%d data records dumped from buffer\n",
-				*ndumped);
-		fprintf(stderr,"%d data records remain in buffer\n",*nbuffer);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       ndumped:    %d\n",*ndumped);
-		fprintf(stderr,"dbg2       nbuffer:    %d\n",*nbuffer);
-		fprintf(stderr,"dbg2       error:      %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return */
-	return (status);
-}
-/*--------------------------------------------------------------------*/
-int mbedit_load_data(int buffer_size,
-		int *nloaded, int *nbuffer, int *ngood, int *icurrent)
-{
-	/* local variables */
-	char	*function_name = "mbedit_load_data";
-	int	status = MB_SUCCESS;
-	int	namp, nss;
-	char	string[MB_PATH_MAXLINE];
-	int	detect_status, detect_error, nbeams;
-	double	speed_nav;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       buffer_size: %d\n",buffer_size);
-		}
-
-	/* turn message on */
-	nload = 0;
-	sprintf(string, "MBedit: %d records loaded so far...", nload);
-	do_message_on(string);
-
-	/* load data */
-	do
-		{
-		error = MB_ERROR_NO_ERROR;
-		status = mb_get_all(verbose,imbio_ptr,&store_ptr,&kind,
-				ping[nbuff].time_i,
-				&ping[nbuff].time_d,
-				&ping[nbuff].navlon,
-				&ping[nbuff].navlat,
-				&ping[nbuff].speed,
-				&ping[nbuff].heading,
-				&distance,&ping[nbuff].altitude,&ping[nbuff].sonardepth,
-				&ping[nbuff].beams_bath,&namp,&nss,
-				beamflag,bath,amp,
-				bathacrosstrack,bathalongtrack,
-				ss,ssacrosstrack,ssalongtrack,
-				comment,&error);
-		if (error <= MB_ERROR_NO_ERROR
-		    && kind == MB_DATA_DATA)
-		    	{
-			if (nbuff > 0)
-				ping[nbuff].time_interval =
-					ping[nbuff].time_d
-						- ping[nbuff-1].time_d;
-			status = mb_extract_nav(verbose,imbio_ptr,
-						store_ptr,&kind,
-						ping[nbuff].time_i,
-						&ping[nbuff].time_d,
-						&ping[nbuff].navlon,
-						&ping[nbuff].navlat,
-						&speed_nav,
-						&ping[nbuff].heading,
-						&draft,
-						&ping[nbuff].roll,
-						&ping[nbuff].pitch,
-						&ping[nbuff].heave,
-						&error);
-			if (nbuff > 0 && ping[nbuff].time_d == ping[nbuff-1].time_d)
-				{
-				ping[nbuff].multiplicity = ping[nbuff-1].multiplicity + 1;
-				}
-			else
-				{
-				ping[nbuff].multiplicity = 0;
-				}
-			if (nbuff == 0)
-				ping[nbuff].distance = 0.0;
-			else
-				ping[nbuff].distance = ping[nbuff-1].distance
-							+ ping[nbuff].speed * ping[nbuff].time_interval / 3.6;
-			nbeams = ping[nbuff].beams_bath;
-			detect_status = mb_detects(verbose,imbio_ptr,store_ptr,
-						&kind,&nbeams,detect,&detect_error);
-			if (detect_status != MB_SUCCESS)
-				{
-				status = MB_SUCCESS;
-				for (i=0;i<ping[nbuff].beams_bath;i++)
-					{
-					detect[i] = MB_DETECT_UNKNOWN;
-					}
-				}
-			detect_status = mb_pulses(verbose,imbio_ptr,store_ptr,
-						&kind,&nbeams,pulses,&detect_error);
-			if (detect_status != MB_SUCCESS)
-				{
-				status = MB_SUCCESS;
-				for (i=0;i<ping[nbuff].beams_bath;i++)
-					{
-					pulses[i] = MB_PULSE_UNKNOWN;
-					}
-				}
-		    	}
-		if (error <= MB_ERROR_NO_ERROR
-		    && (kind == MB_DATA_DATA)
-		    && (error == MB_ERROR_NO_ERROR
-			    || error == MB_ERROR_TIME_GAP
-			    || error == MB_ERROR_OUT_BOUNDS
-			    || error == MB_ERROR_OUT_TIME
-			    || error == MB_ERROR_SPEED_TOO_SMALL))
-			{
-			status = MB_SUCCESS;
-			error = MB_ERROR_NO_ERROR;
-			}
-		else if (error <= MB_ERROR_NO_ERROR)
-			{
-			status = MB_FAILURE;
-			error = MB_ERROR_OTHER;
-			}
-
-		if (status == MB_SUCCESS
-			&& ping[nbuff].allocated > 0
-			&& ping[nbuff].allocated < ping[nbuff].beams_bath)
-			{
-			ping[nbuff].allocated = 0;
-			free(ping[nbuff].beamflag);
-			free(ping[nbuff].beamflagorg);
-			free(ping[nbuff].bath);
-			free(ping[nbuff].bathacrosstrack);
-			free(ping[nbuff].bathalongtrack);
-			free(ping[nbuff].detect);
-			free(ping[nbuff].pulses);
-			free(ping[nbuff].bath_x);
-			free(ping[nbuff].bath_y);
-			}
-		if (status == MB_SUCCESS
-			&& ping[nbuff].allocated < ping[nbuff].beams_bath)
-			{
-			ping[nbuff].beamflag = NULL;
-			ping[nbuff].beamflagorg = NULL;
-			ping[nbuff].bath = NULL;
-			ping[nbuff].bathacrosstrack = NULL;
-			ping[nbuff].bathalongtrack = NULL;
-			ping[nbuff].bath_x = NULL;
-			ping[nbuff].bath_y = NULL;
-			ping[nbuff].beamflag = (char *) malloc(ping[nbuff].beams_bath*sizeof(char));
-			ping[nbuff].beamflagorg = (char *) malloc(ping[nbuff].beams_bath*sizeof(char));
-			ping[nbuff].bath = (double *) malloc(ping[nbuff].beams_bath*sizeof(double));
-			ping[nbuff].bathacrosstrack = (double *) malloc(ping[nbuff].beams_bath*sizeof(double));
-			ping[nbuff].bathalongtrack = (double *) malloc(ping[nbuff].beams_bath*sizeof(double));
-			ping[nbuff].detect = (int *) malloc(ping[nbuff].beams_bath*sizeof(int));
-			ping[nbuff].pulses = (int *) malloc(ping[nbuff].beams_bath*sizeof(int));
-			ping[nbuff].bath_x = (int *) malloc(ping[nbuff].beams_bath*sizeof(int));
-			ping[nbuff].bath_y = (int *) malloc(ping[nbuff].beams_bath*sizeof(int));
-			ping[nbuff].allocated = ping[nbuff].beams_bath;
-			}
-		if (status == MB_SUCCESS
-			&& ping[nbuff].allocated > 0)
-			{
-			for (i=0;i<ping[nbuff].beams_bath;i++)
-			    {
-			    ping[nbuff].beamflag[i] = beamflag[i];
-			    ping[nbuff].beamflagorg[i] = beamflag[i];
-			    ping[nbuff].bath[i] = bath[i];
-			    ping[nbuff].bathacrosstrack[i] = bathacrosstrack[i];
-			    ping[nbuff].bathalongtrack[i] = bathalongtrack[i];
-			    ping[nbuff].detect[i] = detect[i];
-			    ping[nbuff].pulses[i] = pulses[i];
-			    ping[nbuff].bath_x[i] = 0;
-			    ping[nbuff].bath_y[i] = 0;
-			    }
-			}
-		if (status == MB_SUCCESS)
-			{
-			nbuff++;
-			nload++;
-
-			/* update message every 250 records */
-			if (nload % 250 == 0)
-			    {
-			    sprintf(string, "MBedit: %d records loaded so far...", nload);
-			    do_message_on(string);
-			    }
-
-			/* print output debug statements */
-			if (verbose >= 5)
-			    {
-			    fprintf(stderr,"\ndbg5  Next good data found in function <%s>:\n",
-				    function_name);
-			    fprintf(stderr,"dbg5       buffer id: %d   global id: %d\n",
-				    nbuff - 1, nbuff - 1 + ndump_total);
-			    }
-			}
-		}
-	while (error <= MB_ERROR_NO_ERROR
-		&& nbuff < buffer_size);
-	*ngood = nbuff;
-	*nbuffer = nbuff;
-	*nloaded = nload;
-	nload_total += nload;
-
-	/* define success */
-	if (nload > 0)
-		{
-		status = MB_SUCCESS;
-		error = MB_ERROR_NO_ERROR;
-		}
-	else
-		{
-		status = MB_FAILURE;
-		error = MB_ERROR_EOF;
-		}
-
-	/* find index of current ping */
-	current_id = 0;
-	*icurrent = current_id;
-
-	/* if desired apply saved edits */
-	if (esf.nedit > 0)
-		{
-		/* reset message */
-		do_message_on("MBedit is applying saved edits...");
-
-		/* loop over each data record, checking each edit */
-		for (i = 0; i < nbuff; i++)
-		    {
-		    /* apply edits for this ping */
-		    status = mb_esf_apply(verbose, &esf,
-		    		ping[i].time_d, ping[i].multiplicity, ping[i].beams_bath,
-				ping[i].beamflag, &error);
-
-                    /* check beamflags versus original beamflags - beams that were originally flagged
-                            flagged by sonar but have since been flagged for other reasons should have
-                            beamflag reset to flag by sonar */
-                    for (j=0;j<ping[i].beams_bath;j++)
-                        {
-                        if (!mb_beam_ok(ping[i].beamflag[j]) && mb_beam_check_flag_sonar(ping[i].beamflagorg[j]))
-                            ping[i].beamflag[j] = mb_beam_set_flag_sonar(ping[i].beamflag[j]);
-                        }
-
-		    /* update message every 250 records */
-		    if (i % 250 == 0)
-			{
-			sprintf(string, "MBedit: saved edits applied to %d of %d records so far...",
-				i, nbuff - 1);
-			do_message_on(string);
-			}
-		    }
-		}
-
-	/* if desired filter pings */
-	if (filter_medianspike == MB_YES
-		|| filter_wrongside == MB_YES
-		|| filter_cutbeam == MB_YES
-		|| filter_cutdistance == MB_YES
-		|| filter_cutangle == MB_YES)
-		{
-		/* reset message */
-		do_message_on("MBedit is applying bathymetry filters...");
-
-		/* loop over each data record, checking each edit */
-		for (i = 0; i < nbuff; i++)
-		    {
-		    mbedit_filter_ping(i);
-
-		    /* update message every 250 records */
-		    if (i % 250 == 0)
-			{
-			sprintf(string, "MBedit: filters applied to %d of %d records so far...",
-				i, nbuff - 1);
-			do_message_on(string);
-			}
- 		    }
-		}
-
-	/* set next button */
-	if (*nbuffer < buffer_size)
-		do_nextbutton_off();
-	else
-		do_nextbutton_on();
-
-	/* turn message off */
-	do_message_off();
-
-	/* print out information */
-	if (verbose >= 0)
-		{
-		fprintf(stderr,"\n%d data records loaded from input file <%s>\n",
-			*nloaded,ifile);
-		fprintf(stderr,"%d data records now in buffer\n",*nbuffer);
-		fprintf(stderr,"%d editable survey data records now in buffer\n",*ngood);
-		fprintf(stderr,"Current data record:        %d\n",
-			current_id);
-		fprintf(stderr,"Current global data record: %d\n",
-			current_id + ndump_total);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       nloaded:    %d\n",*nloaded);
-		fprintf(stderr,"dbg2       nbuffer:    %d\n",*nbuffer);
-		fprintf(stderr,"dbg2       ngood:      %d\n",*ngood);
-		fprintf(stderr,"dbg2       icurrent:   %d\n",*icurrent);
-		fprintf(stderr,"dbg2       error:      %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return */
-	return (status);
-}
-/*--------------------------------------------------------------------*/
-int mbedit_clear_screen()
-{
-	/* local variables */
-	char	*function_name = "mbedit_clear_screen";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
-
-	/* clear screen */
-	xg_fillrectangle(mbedit_xgid,borders[0],borders[2],
-		borders[1]-borders[0],borders[3]-borders[2],
-		pixel_values[WHITE],XG_SOLIDLINE);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return */
-	return (status);
-}
-/*--------------------------------------------------------------------*/
-int mbedit_plot_all(
-		int	plwd,
-		int	exgr,
-		int	xntrvl,
-		int	yntrvl,
-		int	plt_size,
-		int	sh_mode,
-		int	sh_flggd,
-		int	sh_time,
-		int	*nplt,
-		int	autoscale)
-{
-	/* local variables */
-	char	*function_name = "mbedit_plot_all";
-	int	status = MB_SUCCESS;
-	int	i, j;
-	int	nbathsum,  nbathlist;
-	double	bathsum, bathmedian;
-	double	xtrack_max;
-	int	ndec, maxx;
-	double	dxscale, dyscale;
-	double	dx_width, dy_height;
-	int	nx_int, ny_int;
-	int	x_int, y_int;
-	int	xx, vx, yy, vy;
-	int	swidth, sascent, sdescent;
-	int	sxstart;
-	int	xcen, ycen;
-	int	x0, y0, x, y;
-	double	dx, dy;
-	char	string[MB_PATH_MAXLINE];
-	char	*string_ptr;
-	int	fpx, fpdx, fpy, fpdy;
-	double	tsmin, tsmax, tsscale, tsvalue, tsslope;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       plot_width:  %d\n",plwd);
-		fprintf(stderr,"dbg2       exager:      %d\n",exgr);
-		fprintf(stderr,"dbg2       x_interval:  %d\n",xntrvl);
-		fprintf(stderr,"dbg2       y_interval:  %d\n",yntrvl);
-		fprintf(stderr,"dbg2       plot_size:   %d\n",plt_size);
-		fprintf(stderr,"dbg2       show_mode:   %d\n",sh_mode);
-		fprintf(stderr,"dbg2       show_flagged:%d\n",sh_flggd);
-		fprintf(stderr,"dbg2       show_time:   %d\n",sh_time);
-		fprintf(stderr,"dbg2       nplt:        %p\n",nplt);
-		fprintf(stderr,"dbg2       autoscale:   %d\n",autoscale);
-		}
-
-	/* set scales and tick intervals */
-	plot_width = plwd;
-	exager = exgr;
-	show_mode = sh_mode;
-	show_flagged = sh_flggd;
-	show_time = sh_time,
-
-	/* figure out which pings to plot */
-	plot_size = plt_size;
-	if (current_id + plot_size > nbuff)
-		nplot = nbuff - current_id;
-	else
-		nplot = plot_size;
-	*nplt = nplot;
-
-	/* get data into ping arrays and find median depth value */
-	bathsum = 0.0;
-	nbathsum = 0;
-	nbathlist = 0;
-	xtrack_max = 0.0;
-	for (i=current_id;i<current_id+nplot;i++)
-		{
-		ping[i].record = i + ndump_total;
-		ping[i].outbounds = MBEDIT_OUTBOUNDS_NONE;
-		for (j=0;j<ping[i].beams_bath;j++)
-			{
-			if (mb_beam_ok(ping[i].beamflag[j]))
-				{
-				bathsum += ping[i].bath[j];
-				nbathsum++;
-				bathlist[nbathlist] = ping[i].bath[j];
-				nbathlist++;
-				xtrack_max = MAX(xtrack_max,
-					fabs(ping[i].bathacrosstrack[j]));
-				}
-			}
-		}
-
-	/* if not enough information in unflagged bathymetry look
-	    into the flagged bathymetry */
-	if (nbathlist <= 0 || xtrack_max <= 0.0)
-		{
-		for (i=current_id;i<current_id+nplot;i++)
-			{
-			for (j=0;j<ping[i].beams_bath;j++)
-				{
-				if (!mb_beam_ok(ping[i].beamflag[j])
-				    && !mb_beam_check_flag_null(ping[i].beamflag[j]))
-					{
-					bathsum += ping[i].bath[j];
-					nbathsum++;
-					bathlist[nbathlist] = ping[i].bath[j];
-					nbathlist++;
-					xtrack_max = MAX(xtrack_max,
-						fabs(ping[i].bathacrosstrack[j]));
-					}
-				}
-			}
-		}
-	if (nbathlist > 0)
-		{
-		qsort((char *)bathlist,nbathlist,sizeof(double),(void *)mb_double_compare);
-		bathmedian = bathlist[nbathlist/2];
-		}
-
-	/* reset xtrack_max if required */
-	if (autoscale && xtrack_max < 0.5)
-		{
-		xtrack_max = 1000.0;
-		}
-	else if (autoscale && xtrack_max > 100000.0)
-		{
-		xtrack_max = 100000.0;
-		}
-
-	/* if autoscale on reset plot width */
-	if (autoscale == MB_YES && xtrack_max > 0.0)
-		{
-		plot_width = 2.4 * xtrack_max;
-		ndec = MAX(1, (int) log10((double) plot_width));
-		maxx = 1;
-		for (i=0;i<ndec;i++)
-			maxx = maxx * 10;
-		maxx = (plot_width / maxx + 1) * maxx;
-
-		xntrvl = plot_width / 10;
-		if (xntrvl > 1000)
-			{
-			xntrvl = 1000 * (xntrvl / 1000);
-			}
-		else if (xntrvl > 500)
-			{
-			xntrvl = 500 * (xntrvl / 500);
-			}
-		else if (xntrvl > 250)
-			{
-			xntrvl = 250 * (xntrvl / 250);
-			}
-		else if (xntrvl > 100)
-			{
-			xntrvl = 100 * (xntrvl / 100);
-			}
-		else if (xntrvl > 50)
-			{
-			xntrvl = 50 * (xntrvl / 50);
-			}
-		else if (xntrvl > 25)
-			{
-			xntrvl = 25 * (xntrvl / 25);
-			}
-		else if (xntrvl > 10)
-			{
-			xntrvl = 10 * (xntrvl / 10);
-			}
-		else if (xntrvl > 5)
-			{
-			xntrvl = 5 * (xntrvl / 5);
-			}
-		else if (xntrvl > 2)
-			{
-			xntrvl = 2 * (xntrvl / 2);
-			}
-		else
-			{
-			xntrvl = 1;
-			}
-		yntrvl = xntrvl;
-		do_reset_scale_x(plot_width, maxx, xntrvl, yntrvl);
-		}
-
-	/* print out information */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2       %d data records set for plotting (%d desired)\n",
-			nplot,plot_size);
-		fprintf(stderr,"dbg2       xtrack_max:  %f\n",xtrack_max);
-		fprintf(stderr,"dbg2       bathmedian:  %f\n",bathmedian);
-		fprintf(stderr,"dbg2       nbathlist:   %d\n",nbathlist);
-		fprintf(stderr,"dbg2       nbathsum:    %d\n",nbathsum);
-		for (i=current_id;i<current_id+nplot;i++)
-			{
-			fprintf(stderr,"dbg2       %4d %4d %4d  %d/%d/%d %2.2d:%2.2d:%2.2d.%6.6d  %10.3f\n",
-				i,ping[i].id,ping[i].record,
-				ping[i].time_i[1],ping[i].time_i[2],
-				ping[i].time_i[0],ping[i].time_i[3],
-				ping[i].time_i[4],ping[i].time_i[5],
-				ping[i].time_i[6],
-				ping[i].bath[ping[i].beams_bath/2]);
-			}
-		}
-
-	/* clear screen */
-	xg_fillrectangle(mbedit_xgid,borders[0],borders[2],
-		borders[1]-borders[0],borders[3]-borders[2],
-		pixel_values[WHITE],XG_SOLIDLINE);
-
-	/* set scaling */
-	x_interval = xntrvl;
-	y_interval = yntrvl;
-	xcen = xmin + (xmax - xmin)/2;
-	ycen = ymin + (ymax - ymin)/2;
-	dx = ((double)(xmax - xmin))/plot_size;
-	dy = ((double)(ymax - ymin))/plot_size;
-	xscale = 100.0 * plot_width / (xmax - xmin);
-	yscale = (xscale * 100.0) / exager;
-	dxscale = 100.0 / xscale;
-	dyscale = 100.0 / yscale;
-
-	if (info_set == MB_YES)
-		{
-		mbedit_plot_info();
-		}
-	if (sh_mode == MBEDIT_SHOW_FLAG)
-		{
-		sprintf(string,"Sounding Colors by Flagging:  Unflagged  Manual  Filter  Sonar");
-		xg_justify(mbedit_xgid,string,&swidth,
-			&sascent,&sdescent);
-		sxstart = xcen - swidth / 2;
-
-		sprintf(string,"Sounding Colors by Flagging:  Unflagged  ");
-		xg_justify(mbedit_xgid,string,&swidth,
-			&sascent,&sdescent);
-		xg_drawstring(mbedit_xgid,sxstart,
-			ymin-margin/2+sascent+5,string,
-			pixel_values[BLACK],XG_SOLIDLINE);
-
-		sxstart += swidth;
-		sprintf(string,"Manual  ");
-		xg_justify(mbedit_xgid,string,&swidth,
-			&sascent,&sdescent);
-		xg_drawstring(mbedit_xgid,sxstart,
-			ymin-margin/2+sascent+5,string,
-			pixel_values[RED],XG_SOLIDLINE);
-
-		sxstart += swidth;
-		sprintf(string,"Filter  ");
-		xg_justify(mbedit_xgid,string,&swidth,
-			&sascent,&sdescent);
-		xg_drawstring(mbedit_xgid,sxstart,
-			ymin-margin/2+sascent+5,string,
-			pixel_values[BLUE],XG_SOLIDLINE);
-
-		sxstart += swidth;
-		sprintf(string,"Sonar");
-		xg_justify(mbedit_xgid,string,&swidth,
-			&sascent,&sdescent);
-		xg_drawstring(mbedit_xgid,sxstart,
-			ymin-margin/2+sascent+5,string,
-			pixel_values[GREEN],XG_SOLIDLINE);
-		}
-	else if (sh_mode == MBEDIT_SHOW_DETECT)
-		{
-		sprintf(string,"Sounding Colors by Bottom Detection:  Amplitude  Phase  Unknown");
-		xg_justify(mbedit_xgid,string,&swidth,
-			&sascent,&sdescent);
-		sxstart = xcen - swidth / 2;
-
-		sprintf(string,"Sounding Colors by Bottom Detection:  Amplitude  ");
-		xg_justify(mbedit_xgid,string,&swidth,
-			&sascent,&sdescent);
-		xg_drawstring(mbedit_xgid,sxstart,
-			ymin-margin/2+sascent+5,string,
-			pixel_values[BLACK],XG_SOLIDLINE);
-
-		sxstart += swidth;
-		sprintf(string,"Phase  ");
-		xg_justify(mbedit_xgid,string,&swidth,
-			&sascent,&sdescent);
-		xg_drawstring(mbedit_xgid,sxstart,
-			ymin-margin/2+sascent+5,string,
-			pixel_values[RED],XG_SOLIDLINE);
-
-		sxstart += swidth;
-		sprintf(string,"Unknown");
-		xg_justify(mbedit_xgid,string,&swidth,
-			&sascent,&sdescent);
-		xg_drawstring(mbedit_xgid,sxstart,
-			ymin-margin/2+sascent+5,string,
-			pixel_values[GREEN],XG_SOLIDLINE);
-		}
-	else if (sh_mode == MBEDIT_SHOW_PULSE)
-		{
-		sprintf(string,"Sounding Colors by Source Type:  CW  Up-Chirp  Down-Chirp  Unknown");
-		xg_justify(mbedit_xgid,string,&swidth,
-			&sascent,&sdescent);
-		sxstart = xcen - swidth / 2;
-
-		sprintf(string,"Sounding Colors by Source Type:  CW  ");
-		xg_justify(mbedit_xgid,string,&swidth,
-			&sascent,&sdescent);
-		xg_drawstring(mbedit_xgid,sxstart,
-			ymin-margin/2+sascent+5,string,
-			pixel_values[BLACK],XG_SOLIDLINE);
-
-		sxstart += swidth;
-		sprintf(string,"Up-Chirp  ");
-		xg_justify(mbedit_xgid,string,&swidth,
-			&sascent,&sdescent);
-		xg_drawstring(mbedit_xgid,sxstart,
-			ymin-margin/2+sascent+5,string,
-			pixel_values[RED],XG_SOLIDLINE);
-
-		sxstart += swidth;
-		sprintf(string,"Down-Chirp  ");
-		xg_justify(mbedit_xgid,string,&swidth,
-			&sascent,&sdescent);
-		xg_drawstring(mbedit_xgid,sxstart,
-			ymin-margin/2+sascent+5,string,
-			pixel_values[BLUE],XG_SOLIDLINE);
-
-		sxstart += swidth;
-		sprintf(string,"Unknown");
-		xg_justify(mbedit_xgid,string,&swidth,
-			&sascent,&sdescent);
-		xg_drawstring(mbedit_xgid,sxstart,
-			ymin-margin/2+sascent+5,string,
-			pixel_values[GREEN],XG_SOLIDLINE);
-		}
-
-	sprintf(string,"Vertical Exageration: %4.2f   All Distances and Depths in Meters",(exager/100.));
-	xg_justify(mbedit_xgid,string,&swidth,
-		&sascent,&sdescent);
-	xg_drawstring(mbedit_xgid,xcen-swidth/2,
-		ymin-margin/2+2*(sascent+sdescent)+5,string,
-		pixel_values[BLACK],XG_SOLIDLINE);
-
-	/* plot filename */
-	sprintf(string,"File %d of %d:", file_id + 1, num_files);
-	xg_justify(mbedit_xgid,string,&swidth,
-		&sascent,&sdescent);
-	xg_drawstring(mbedit_xgid,margin/2,
-		ymin-3*margin/4,string,
-		pixel_values[BLACK],XG_SOLIDLINE);
-	string_ptr = strrchr(ifile, '/');
-	if (string_ptr == NULL)
-		string_ptr = ifile;
-	else if (strlen(string_ptr) > 0)
-		string_ptr++;
-	xg_drawstring(mbedit_xgid,margin/2+2+swidth,
-		ymin-margin/2-1*(sascent+sdescent)-5,string_ptr,
-		pixel_values[BLACK],XG_SOLIDLINE);
-
-	/* plot file position bar */
-	fpx = margin/2 + ((4 * margin) * current_id) / nbuff;
-	fpdx = MAX((((4 * margin) * nplot) / nbuff), 5);
-	fpy = ymin - 5*margin/8;
-	fpdy = margin/4;
-	if (fpx + fpdx > 9 * margin / 2)
-	    fpx = 9 * margin /2 - fpdx;
-	xg_drawrectangle(mbedit_xgid,
-		margin/2,
-		ymin-5*margin/8,
-		4*margin,
-		margin/4,
-		pixel_values[BLACK],XG_SOLIDLINE);
-	xg_drawrectangle(mbedit_xgid,
-		margin/2-1,
-		ymin-5*margin/8-1,
-		4*margin+2,
-		margin/4+2,
-		pixel_values[BLACK],XG_SOLIDLINE);
-	xg_fillrectangle(mbedit_xgid,
-		fpx, fpy, fpdx, fpdy,
-		pixel_values[LIGHTGREY],XG_SOLIDLINE);
-	xg_drawrectangle(mbedit_xgid,
-		fpx, fpy, fpdx, fpdy,
-		pixel_values[BLACK],XG_SOLIDLINE);
-	sprintf(string,"0 ");
-	xg_justify(mbedit_xgid,string,&swidth,
-		&sascent,&sdescent);
-	xg_drawstring(mbedit_xgid,margin/2-swidth,
-		ymin-margin/2+sascent/2,string,
-		pixel_values[BLACK],XG_SOLIDLINE);
-	sprintf(string," %d", nbuff);
-	xg_drawstring(mbedit_xgid,9*margin/2,
-		ymin-margin/2+sascent/2,string,
-		pixel_values[BLACK],XG_SOLIDLINE);
-
-	/* plot scale bars */
-	dx_width = (xmax - xmin)/dxscale;
-	nx_int = 0.5*dx_width/x_interval + 1;
-	x_int = x_interval*dxscale;
-	xg_drawline(mbedit_xgid,xmin,ymax,xmax,ymax,
-		pixel_values[BLACK],XG_SOLIDLINE);
-	xg_drawline(mbedit_xgid,xmin,ymin,xmax,ymin,
-		pixel_values[BLACK],XG_SOLIDLINE);
-	for (i=0;i<nx_int;i++)
-		{
-		xx = i*x_int;
-		vx = i*x_interval;
-		xg_drawline(mbedit_xgid,xcen-xx,ymin,xcen-xx,ymax,
-			pixel_values[BLACK],XG_DASHLINE);
-		xg_drawline(mbedit_xgid,xcen+xx,ymin,xcen+xx,ymax,
-			pixel_values[BLACK],XG_DASHLINE);
-		sprintf(string,"%1d",vx);
-		xg_justify(mbedit_xgid,string,&swidth,
-			&sascent,&sdescent);
-		xg_drawstring(mbedit_xgid,xcen+xx-swidth/2,
-			ymax+sascent+5,string,
-			pixel_values[BLACK],XG_SOLIDLINE);
-		xg_drawstring(mbedit_xgid,xcen-xx-swidth/2,
-			ymax+sascent+5,string,
-			pixel_values[BLACK],XG_SOLIDLINE);
-		}
-	dy_height = (ymax - ymin)/dyscale;
-	ny_int = dy_height/y_interval + 1;
-	y_int = y_interval*dyscale;
-	xg_drawline(mbedit_xgid,xmin,ymin,xmin,ymax,
-		pixel_values[BLACK],XG_SOLIDLINE);
-	xg_drawline(mbedit_xgid,xmax,ymin,xmax,ymax,
-		pixel_values[BLACK],XG_SOLIDLINE);
-	for (i=0;i<ny_int;i++)
-		{
-		yy = i*y_int;
-		vy = i*y_interval;
-		xg_drawline(mbedit_xgid,xmin,ymax-yy,xmax,ymax-yy,
-			pixel_values[BLACK],XG_DASHLINE);
-		sprintf(string,"%1d",vy);
-		xg_justify(mbedit_xgid,string,&swidth,
-			&sascent,&sdescent);
-		xg_drawstring(mbedit_xgid,xmax+5,
-			ymax-yy+sascent/2,string,
-			pixel_values[BLACK],XG_SOLIDLINE);
-		}
-
-	/* plot time series if desired */
-	if (show_time > MBEDIT_PLOT_TIME)
-		{
-		/* get scaling */
-		mbedit_tsminmax(current_id, nplot, show_time, &tsmin, &tsmax);
-		tsscale = 2.0 * margin / (tsmax - tsmin);
-
-		/* draw time series plot box */
-		xg_drawline(mbedit_xgid,margin/2,ymin,margin/2,ymax,
-			pixel_values[BLACK],XG_SOLIDLINE);
-		xg_drawline(mbedit_xgid,margin,ymin,margin,ymax,
-			pixel_values[BLACK],XG_DASHLINE);
-		xg_drawline(mbedit_xgid,3*margin/2,ymin,3*margin/2,ymax,
-			pixel_values[BLACK],XG_DASHLINE);
-		xg_drawline(mbedit_xgid,2*margin,ymin,2*margin,ymax,
-			pixel_values[BLACK],XG_DASHLINE);
-		xg_drawline(mbedit_xgid,5*margin/2,ymin,5*margin/2,ymax,
-			pixel_values[BLACK],XG_SOLIDLINE);
-		xg_drawline(mbedit_xgid,margin/2,ymax,5*margin/2,ymax,
-			pixel_values[BLACK],XG_SOLIDLINE);
-		xg_drawline(mbedit_xgid,margin/2,ymin,5*margin/2,ymin,
-			pixel_values[BLACK],XG_SOLIDLINE);
-
-		/* draw time series labels */
-		/*sprintf(string,"Heading (deg)");*/
-		mbedit_tslabel(show_time, string);
-		xg_justify(mbedit_xgid,string,&swidth,
-			&sascent,&sdescent);
-		xg_drawstring(mbedit_xgid,3*margin/2-swidth/2,
-			ymin-sdescent,string,
-			pixel_values[BLACK],XG_SOLIDLINE);
-		sprintf(string,"%g",tsmin);
-		xg_justify(mbedit_xgid,string,&swidth,
-			&sascent,&sdescent);
-		xg_drawstring(mbedit_xgid,margin/2-swidth/2,
-			ymax+sascent+5,string,
-			pixel_values[BLACK],XG_SOLIDLINE);
-		sprintf(string,"%g",tsmax);
-		xg_justify(mbedit_xgid,string,&swidth,
-			&sascent,&sdescent);
-		xg_drawstring(mbedit_xgid,5*margin/2-swidth/2,
-			ymax+sascent+5,string,
-			pixel_values[BLACK],XG_SOLIDLINE);
-
-		/*x0 = margin/2 + ping[current_id].heading / 360.0 * 2 * margin;*/
-		mbedit_tsvalue(current_id, show_time, &tsvalue);
-		x0 = margin/2 + (int) ((tsvalue - tsmin) * tsscale);
-		y0 = ymax - (int)(dy / 2);
-		for (i=current_id;i<current_id+nplot;i++)
-			{
-			/*x = margin/2 + ping[i].heading / 360.0 * 2 * margin;*/
-			mbedit_tsvalue(i, show_time, &tsvalue);
-			x = margin/2 + (int) ((tsvalue - tsmin) * tsscale);
-			y = ymax - (int)(dy / 2) - (int)((i - current_id) * dy);
-			xg_drawline(mbedit_xgid,x0,y0,x,y,
-				pixel_values[BLACK],XG_SOLIDLINE);
-			xg_fillrectangle(mbedit_xgid,
-				x-2, y-2, 4, 4,
-				pixel_values[BLACK],XG_SOLIDLINE);
-			x0 = x;
-			y0 = y;
-			}
-
-		/* if plotting roll, also plot acrosstrack slope */
-		if (show_time == MBEDIT_PLOT_ROLL)
-			{
-			mbedit_xtrackslope(current_id, &tsslope);
-			x0 = margin/2 + (int) ((tsslope - tsmin) * tsscale);
-			y0 = ymax - (int)(dy / 2);
-			for (i=current_id;i<current_id+nplot;i++)
-				{
-				/*x = margin/2 + ping[i].heading / 360.0 * 2 * margin;*/
-				mbedit_xtrackslope(i, &tsslope);
-				x = margin/2 + (int) ((tsslope - tsmin) * tsscale);
-				y = ymax - (int)(dy / 2) - (int)((i - current_id) * dy);
-				xg_drawline(mbedit_xgid,x0,y0,x,y,
-					pixel_values[RED],XG_SOLIDLINE);
-				x0 = x;
-				y0 = y;
-				}
-			}
-
-		/* if plotting roll, also plot acrosstrack slope - roll */
-		if (show_time == MBEDIT_PLOT_ROLL)
-			{
-			mbedit_xtrackslope(current_id, &tsslope);
-			mbedit_tsvalue(i, show_time, &tsvalue);
-			x0 = margin/2 + (int) ((tsvalue - tsslope - tsmin) * tsscale);
-			y0 = ymax - (int)(dy / 2);
-			for (i=current_id;i<current_id+nplot;i++)
-				{
-				/*x = margin/2 + ping[i].heading / 360.0 * 2 * margin;*/
-				mbedit_xtrackslope(i, &tsslope);
-				mbedit_tsvalue(i, show_time, &tsvalue);
-				x = margin/2 + (int) ((tsvalue - tsslope - tsmin) * tsscale);
-				y = ymax - (int)(dy / 2) - (int)((i - current_id) * dy);
-				xg_drawline(mbedit_xgid,x0,y0,x,y,
-					pixel_values[BLUE],XG_SOLIDLINE);
-				x0 = x;
-				y0 = y;
-				}
-			}
-		}
-
-	/* plot pings */
-	for (i=current_id;i<current_id+nplot;i++)
-		{
-		/* set beam plotting locations */
-		x = xmax - (int)(dx / 2) - (int)((i - current_id) * dx);
-		y = ymax - (int)(dy / 2) - (int)((i - current_id) * dy);
-		ping[i].label_x = xmin - 5;
-		ping[i].label_y = y;
-		for (j=0;j<ping[i].beams_bath;j++)
-			{
-			if (!mb_beam_check_flag_null(ping[i].beamflag[j]))
-				{
-				if (view_mode == MBEDIT_VIEW_WATERFALL)
-					{
-					ping[i].bath_x[j] = xcen
-						+ dxscale*ping[i].bathacrosstrack[j];
-					ping[i].bath_y[j] = y + dyscale*
-						(fabs((double)ping[i].bath[j])
-						- bathmedian);
-					}
-				else if (view_mode == MBEDIT_VIEW_ALONGTRACK)
-					{
-					ping[i].bath_x[j] = xcen
-						+ dxscale*ping[i].bathacrosstrack[j];
-					ping[i].bath_y[j] = ycen + dyscale*
-						(fabs((double)ping[i].bath[j])
-						- bathmedian);
-					}
-				else
-					{
-					/* ping[i].bath_x[j] = x;*/
-					ping[i].bath_x[j] = xcen
-						+ dxscale*(ping[i].bathalongtrack[j] + ping[i].distance - ping[current_id+nplot/2].distance);
-					ping[i].bath_y[j] = ycen + dyscale*
-						(fabs((double)ping[i].bath[j])
-						- bathmedian);
-					}
-				}
-			else
-				{
-				ping[i].bath_x[j] = 0;
-				ping[i].bath_y[j] = 0;
-				}
-			}
-
-		/* plot the beams */
-		for (j=0;j<ping[i].beams_bath;j++)
-			status = mbedit_plot_beam(i,j);
-
-		/* plot the ping profile */
-		status = mbedit_plot_ping(i);
-
-		/* set and draw info string */
-		mbedit_plot_ping_label(i, MB_YES);
-		}
-
-	/* set status */
-	if (nplot > 0)
-		status = MB_SUCCESS;
-	else
-		status = MB_FAILURE;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       nplot:       %d\n",*nplt);
-		fprintf(stderr,"dbg2       error:      %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return */
-	return (status);
-}
-/*--------------------------------------------------------------------*/
-int mbedit_plot_beam(int iping, int jbeam)
-{
-	/* local variables */
-	char	*function_name = "mbedit_plot_beam";
-	int	status = MB_SUCCESS;
-	int	beam_color;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       iping:       %d\n",iping);
-		fprintf(stderr,"dbg2       jbeam:       %d\n",jbeam);
-		}
-
-	/* plot the beam */
-	if (info_set == MB_YES && iping == info_ping && jbeam == info_beam)
-		{
-		if (!mb_beam_check_flag_null(ping[iping].beamflag[jbeam]))
-			xg_fillrectangle(mbedit_xgid,
-				ping[iping].bath_x[jbeam]-4,
-				ping[iping].bath_y[jbeam]-4, 8, 8,
-				pixel_values[BLUE],XG_SOLIDLINE);
-		}
-	else if (jbeam >= 0 && jbeam < ping[iping].beams_bath
-		&& !mb_beam_check_flag_null(ping[iping].beamflag[jbeam]))
-		{
-		if (show_mode == MBEDIT_SHOW_FLAG)
-			{
-			if (mb_beam_ok(ping[iping].beamflag[jbeam]))
-				beam_color = BLACK;
-			else if (mb_beam_check_flag_filter2(ping[iping].beamflag[jbeam]))
-				beam_color = BLUE;
-			else if (mb_beam_check_flag_filter(ping[iping].beamflag[jbeam]))
-				beam_color = BLUE;
-			else if (mb_beam_check_flag_sonar(ping[iping].beamflag[jbeam]))
-				beam_color = GREEN;
-			else if (!mb_beam_check_flag_null(ping[iping].beamflag[jbeam]))
-				beam_color = RED;
-			else
-				beam_color = GREEN;
-			}
-		else if (show_mode == MBEDIT_SHOW_DETECT)
-			{
-			if (ping[iping].detect[jbeam] == MB_DETECT_AMPLITUDE)
-				beam_color = BLACK;
-			else if (ping[iping].detect[jbeam] == MB_DETECT_PHASE)
-				beam_color = RED;
-			else
-				beam_color = GREEN;
-			}
-		else if (show_mode == MBEDIT_SHOW_PULSE)
-			{
-			if (ping[iping].pulses[jbeam] == MB_PULSE_CW)
-				beam_color = BLACK;
-			else if (ping[iping].pulses[jbeam] == MB_PULSE_UPCHIRP)
-				beam_color = RED;
-			else if (ping[iping].pulses[jbeam] == MB_PULSE_DOWNCHIRP)
-				beam_color = BLUE;
-			else
-				beam_color = GREEN;
-			}
-		if (mb_beam_ok(ping[iping].beamflag[jbeam]))
-			xg_fillrectangle(mbedit_xgid,
-				ping[iping].bath_x[jbeam]-2,
-				ping[iping].bath_y[jbeam]-2, 4, 4,
-				pixel_values[beam_color],XG_SOLIDLINE);
-		else
-			xg_drawrectangle(mbedit_xgid,
-				ping[iping].bath_x[jbeam]-2,
-				ping[iping].bath_y[jbeam]-2, 4, 4,
-				pixel_values[beam_color],XG_SOLIDLINE);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return */
-	return (status);
-}
-/*--------------------------------------------------------------------*/
-int mbedit_plot_ping(int iping)
-{
-	/* local variables */
-	char	*function_name = "mbedit_plot_ping";
-	int	status = MB_SUCCESS;
-	int	j;
-	int	first, last_flagged;
-	int	xold, yold;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       iping:       %d\n",iping);
-		}
-
-	/* plot the ping profile */
-	first = MB_YES;
-	last_flagged = MB_NO;
-	for (j=0;j<ping[iping].beams_bath;j++)
-		{
-		if (show_flagged == MB_YES
-			&& !mb_beam_ok(ping[iping].beamflag[j])
-			&& !mb_beam_check_flag_null(ping[iping].beamflag[j])
-			&& first == MB_YES)
-			{
-			first = MB_NO;
-			last_flagged = MB_YES;
-			xold = ping[iping].bath_x[j];
-			yold = ping[iping].bath_y[j];
-			}
-		else if (mb_beam_ok(ping[iping].beamflag[j])
-			&& first == MB_YES)
-			{
-			first = MB_NO;
-			last_flagged = MB_NO;
-			xold = ping[iping].bath_x[j];
-			yold = ping[iping].bath_y[j];
-			}
-		else if (last_flagged == MB_NO
-			&& mb_beam_ok(ping[iping].beamflag[j]))
-			{
-			xg_drawline(mbedit_xgid,xold,yold,
-					ping[iping].bath_x[j],
-					ping[iping].bath_y[j],
-					pixel_values[BLACK],XG_SOLIDLINE);
-			last_flagged = MB_NO;
-			xold = ping[iping].bath_x[j];
-			yold = ping[iping].bath_y[j];
-			}
-		else if (mb_beam_ok(ping[iping].beamflag[j]))
-			{
-			xg_drawline(mbedit_xgid,xold,yold,
-					ping[iping].bath_x[j],
-					ping[iping].bath_y[j],
-					pixel_values[RED],XG_SOLIDLINE);
-			last_flagged = MB_NO;
-			xold = ping[iping].bath_x[j];
-			yold = ping[iping].bath_y[j];
-			}
-		else if (show_flagged == MB_YES
-			&& !mb_beam_ok(ping[iping].beamflag[j])
-			&& !mb_beam_check_flag_null(ping[iping].beamflag[j]))
-			{
-			if (j > 0)
-			xg_drawline(mbedit_xgid,xold,yold,
-					ping[iping].bath_x[j],
-					ping[iping].bath_y[j],
-					pixel_values[RED],XG_SOLIDLINE);
-			last_flagged = MB_YES;
-			xold = ping[iping].bath_x[j];
-			yold = ping[iping].bath_y[j];
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return */
-	return (status);
-}
-/*--------------------------------------------------------------------*/
-int mbedit_plot_ping_label(int iping, int save)
-{
-	/* local variables */
-	char	*function_name = "mbedit_plot_ping_label";
-	int	status = MB_SUCCESS;
-	int	sascent, sdescent, swidth;
-	char	string[MB_PATH_MAXLINE];
-	int	j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       iping:       %d\n",iping);
-		fprintf(stderr,"dbg2       save:        %d\n",save);
-		}
-
-	/* get the ping outbounds value */
-	ping[iping].outbounds = MBEDIT_OUTBOUNDS_NONE;
-	for (j=0;j<ping[iping].beams_bath;j++)
-		{
-		if (!mb_beam_check_flag_null(ping[iping].beamflag[j])
-		    && (ping[iping].bath_x[j] < xmin
-		    || ping[iping].bath_x[j] > xmax
-		    || ping[iping].bath_y[j] < ymin
-		    || ping[iping].bath_y[j] > ymax))
-		    {
-		    if (mb_beam_ok(ping[iping].beamflag[j]))
-			ping[iping].outbounds
-			    = MBEDIT_OUTBOUNDS_UNFLAGGED;
-		    else if (!mb_beam_check_flag_null(ping[iping].beamflag[j])
-			&& ping[iping].outbounds != MBEDIT_OUTBOUNDS_UNFLAGGED)
-			ping[iping].outbounds
-			    = MBEDIT_OUTBOUNDS_FLAGGED;
-		    }
-		}
-
-	/* set info string with time tag */
-	if (show_time == MBEDIT_PLOT_TIME || save == MB_YES)
-		{
-		if (ping[iping].beams_bath > 0
-			&& mb_beam_ok(ping[iping].beamflag[ping[iping].beams_bath/2]))
-		sprintf(string,"%5d %2.2d/%2.2d/%4.4d %2.2d:%2.2d:%2.2d.%3.3d %10.3f",
-			ping[iping].record + 1,
-			ping[iping].time_i[1],ping[iping].time_i[2],
-			ping[iping].time_i[0],ping[iping].time_i[3],
-			ping[iping].time_i[4],ping[iping].time_i[5],
-			(int)(0.001 * ping[iping].time_i[6]),
-			ping[iping].bath[ping[iping].beams_bath/2]);
-		else if (ping[iping].beams_bath > 0)
-		sprintf(string,"%5d %2.2d/%2.2d/%4.4d %2.2d:%2.2d:%2.2d.%3.3d %10.3f",
-			ping[iping].record + 1,
-			ping[iping].time_i[1],ping[iping].time_i[2],
-			ping[iping].time_i[0],ping[iping].time_i[3],
-			ping[iping].time_i[4],ping[iping].time_i[5],
-			(int)(0.001 * ping[iping].time_i[6]),
-			ping[iping].altitude + ping[iping].sonardepth);
-		else
-		sprintf(string,"%5d %2.2d/%2.2d/%4.4d %2.2d:%2.2d:%2.2d.%3.3d %10.3f",
-			ping[iping].record + 1,
-			ping[iping].time_i[1],ping[iping].time_i[2],
-			ping[iping].time_i[0],ping[iping].time_i[3],
-			ping[iping].time_i[4],ping[iping].time_i[5],
-			(int)(0.001 * ping[iping].time_i[6]),
-			0.0);
-
-		/* save string to show last ping seen at end of program */
-		if (save == MB_YES)
-			strcpy(last_ping,string);
-		}
-
-	/* set info string without time tag */
-	if (show_time != MBEDIT_PLOT_TIME)
-		{
-		if (ping[iping].beams_bath > 0)
-		sprintf(string,"%5d %10.3f",
-			ping[iping].record,
-			ping[iping].bath[ping[iping].beams_bath/2]);
-		else
-		sprintf(string,"%5d %10.3f",
-			ping[iping].record,0.0);
-
-		/* save string to show last ping seen at end of program */
-		if (save == MB_YES)
-			strcpy(last_ping,string);
-		}
-
-	/* justify the string */
-	xg_justify(mbedit_xgid,string,&swidth,&sascent,&sdescent);
-
-	/* unplot the ping label */
-	xg_fillrectangle(mbedit_xgid,
-		ping[iping].label_x - swidth - 21,
-		ping[iping].label_y - sascent - 1,
-		swidth + 22,
-		sascent + sdescent + 2,
-		pixel_values[WHITE],XG_SOLIDLINE);
-
-	/* plot the ping label */
-	if (ping[iping].outbounds == MBEDIT_OUTBOUNDS_UNFLAGGED)
-	    {
-	    xg_fillrectangle(mbedit_xgid,
-		    ping[iping].label_x - swidth,
-		    ping[iping].label_y - sascent,
-		    swidth,
-		    sascent + sdescent,
-		    pixel_values[RED],XG_SOLIDLINE);
-	    ping[iping].zap_x1 = ping[iping].label_x - swidth - 20;
-	    ping[iping].zap_x2 =  ping[iping].zap_x1 + 10;
-	    ping[iping].zap_y1 = ping[iping].label_y - sascent;
-	    ping[iping].zap_y2 =  ping[iping].zap_y1 + sascent + sdescent;
-	    xg_drawrectangle(mbedit_xgid,
-		    ping[iping].zap_x1,
-		    ping[iping].zap_y1,
-		    10,
-		    sascent + sdescent,
-		    pixel_values[BLACK],XG_SOLIDLINE);
-	    }
-	else if (ping[iping].outbounds == MBEDIT_OUTBOUNDS_FLAGGED)
-	    xg_fillrectangle(mbedit_xgid,
-		    ping[iping].label_x - swidth,
-		    ping[iping].label_y - sascent,
-		    swidth,
-		    sascent + sdescent,
-		    pixel_values[GREEN],XG_SOLIDLINE);
-	xg_drawstring(mbedit_xgid,
-		    ping[iping].label_x - swidth,
-		    ping[iping].label_y,
-		    string,
-		    pixel_values[BLACK],XG_SOLIDLINE);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return */
-	return (status);
-}
-/*--------------------------------------------------------------------*/
-int mbedit_plot_info()
-{
-	/* local variables */
-	char	*function_name = "mbedit_plot_info";
-	int	status = MB_SUCCESS;
-	char	string[MB_PATH_MAXLINE];
-	int	sascent, sdescent, swidth;
-	int	xcen;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
-
-	/* plot the info */
-	if (info_set == MB_YES)
-		{
-		xcen = xmin + (xmax - xmin)/2;
-
-		sprintf(string,"Selected Sounding: Ping:%d Beam:%d",
-			info_ping, info_beam);
-		sprintf(string,"Ping:%d  Beam:%d  Time: %2.2d/%2.2d/%4.4d %2.2d:%2.2d:%2.2d.%3.3d",
-			info_ping, info_beam,
-			info_time_i[1],info_time_i[2],
-			info_time_i[0],info_time_i[3],
-			info_time_i[4],info_time_i[5],
-			(int)(0.001 * info_time_i[6]));
-		xg_justify(mbedit_xgid,string,&swidth,
-			&sascent,&sdescent);
-		xg_drawstring(mbedit_xgid,xcen-swidth/2,
-			ymin-margin/2-2*(sascent+sdescent),string,
-			pixel_values[BLACK],XG_SOLIDLINE);
-
-		sprintf(string,"Longitude:%.5f  Latitude:%.5f  Heading:%.1f  Speed:%.1f",
-			info_navlon, info_navlat, info_heading, info_speed);
-		xg_justify(mbedit_xgid,string,&swidth,
-			&sascent,&sdescent);
-		xg_drawstring(mbedit_xgid,xcen-swidth/2,
-			ymin-margin/2-1*(sascent+sdescent),string,
-			pixel_values[BLACK],XG_SOLIDLINE);
-
-		sprintf(string,"Depth:%.2f  XTrack:%.2f  LTrack:%.2f  Altitude:%.2f  Detect:%s  Pulse:%s",
-			info_bath, info_bathacrosstrack,
-			info_bathalongtrack, info_altitude, detect_name[info_detect], pulse_name[info_pulse]);
-		xg_justify(mbedit_xgid,string,&swidth,
-			&sascent,&sdescent);
-		xg_drawstring(mbedit_xgid,xcen-swidth/2,
-			ymin-margin/2,string,
-			pixel_values[BLACK],XG_SOLIDLINE);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return */
-	return (status);
-}
-/*--------------------------------------------------------------------*/
-int mbedit_unplot_beam(int iping, int jbeam)
-{
-	/* local variables */
-	char	*function_name = "mbedit_unplot_beam";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       iping:       %d\n",iping);
-		fprintf(stderr,"dbg2       jbeam:       %d\n",jbeam);
-		}
-
-	/* unplot the beam */
-	if (info_set == MB_YES && iping == info_ping && jbeam == info_beam)
-		{
-		if (!mb_beam_check_flag_null(ping[iping].beamflag[jbeam]))
-			xg_fillrectangle(mbedit_xgid,
-				ping[iping].bath_x[jbeam]-4,
-				ping[iping].bath_y[jbeam]-4, 8, 8,
-				pixel_values[WHITE],XG_SOLIDLINE);
-		}
-	else if (jbeam >= 0 && jbeam < ping[iping].beams_bath)
-		{
-		if (mb_beam_ok(ping[iping].beamflag[jbeam]))
-			xg_fillrectangle(mbedit_xgid,
-				ping[iping].bath_x[jbeam]-2,
-				ping[iping].bath_y[jbeam]-2, 4, 4,
-				pixel_values[WHITE],XG_SOLIDLINE);
-		else if (!mb_beam_check_flag_null(ping[iping].beamflag[jbeam]))
-			xg_drawrectangle(mbedit_xgid,
-				ping[iping].bath_x[jbeam]-2,
-				ping[iping].bath_y[jbeam]-2, 4, 4,
-				pixel_values[WHITE],XG_SOLIDLINE);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return */
-	return (status);
-}
-/*--------------------------------------------------------------------*/
-int mbedit_unplot_ping(int iping)
-{
-	/* local variables */
-	char	*function_name = "mbedit_unplot_ping";
-	int	status = MB_SUCCESS;
-	int	j;
-	int	first, xold, yold;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       iping:       %d\n",iping);
-		}
-
-	/* unplot the ping profile */
-	first = MB_YES;
-	for (j=0;j<ping[iping].beams_bath;j++)
-		{
-		if (mb_beam_ok(ping[iping].beamflag[j]) && first == MB_YES)
-			{
-			first = MB_NO;
-			xold = ping[iping].bath_x[j];
-			yold = ping[iping].bath_y[j];
-			}
-		else if (mb_beam_ok(ping[iping].beamflag[j]))
-			{
-			xg_drawline(mbedit_xgid,xold,yold,
-					ping[iping].bath_x[j],
-					ping[iping].bath_y[j],
-					pixel_values[WHITE],XG_SOLIDLINE);
-			xold = ping[iping].bath_x[j];
-			yold = ping[iping].bath_y[j];
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return */
-	return (status);
-}
-/*--------------------------------------------------------------------*/
-int mbedit_unplot_info()
-{
-	/* local variables */
-	char	*function_name = "mbedit_unplot_info";
-	int	status = MB_SUCCESS;
-	char	string[MB_PATH_MAXLINE];
-	int	sascent, sdescent, swidth;
-	int	xcen;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
-
-	/* plot the info */
-	if (info_set == MB_YES)
-		{
-		xcen = xmin + (xmax - xmin)/2;
-
-		sprintf(string,"Selected Sounding: Ping:%d Beam:%d",
-			info_ping, info_beam);
-		sprintf(string,"Ping:%d  Beam:%d  Time: %2.2d/%2.2d/%4.4d %2.2d:%2.2d:%2.2d.%3.3d",
-			info_ping, info_beam,
-			info_time_i[1],info_time_i[2],
-			info_time_i[0],info_time_i[3],
-			info_time_i[4],info_time_i[5],
-			(int)(0.001 * info_time_i[6]));
-		xg_justify(mbedit_xgid,string,&swidth,
-			&sascent,&sdescent);
-		xg_drawstring(mbedit_xgid,xcen-swidth/2,
-			ymin-margin/2-2*(sascent+sdescent),string,
-			pixel_values[WHITE],XG_SOLIDLINE);
-
-		sprintf(string,"Longitude:%.5f  Latitude:%.5f  Heading:%.1f  Speed:%.1f",
-			info_navlon, info_navlat, info_heading, info_speed);
-		xg_justify(mbedit_xgid,string,&swidth,
-			&sascent,&sdescent);
-		xg_drawstring(mbedit_xgid,xcen-swidth/2,
-			ymin-margin/2-1*(sascent+sdescent),string,
-			pixel_values[WHITE],XG_SOLIDLINE);
-
-		sprintf(string,"Depth:%.2f  XTrack:%.2f  LTrack:%.2f  Altitude:%.2f  Detect:%d  Pulse:%d",
-			info_bath, info_bathacrosstrack,
-			info_bathalongtrack, info_altitude, info_detect, info_pulse);
-		xg_justify(mbedit_xgid,string,&swidth,
-			&sascent,&sdescent);
-		xg_drawstring(mbedit_xgid,xcen-swidth/2,
-			ymin-margin/2,string,
-			pixel_values[WHITE],XG_SOLIDLINE);
-
-		sprintf(string,"Depth:%.2f  XTrack:%.2f  LTrack:%.2f  Altitude:%.2f  Detect:%s  Pulse:%s",
-			info_bath, info_bathacrosstrack,
-			info_bathalongtrack, info_altitude, detect_name[info_detect], pulse_name[info_pulse]);
-		xg_justify(mbedit_xgid,string,&swidth,
-			&sascent,&sdescent);
-		xg_drawstring(mbedit_xgid,xcen-swidth/2,
-			ymin-margin/2,string,
-			pixel_values[WHITE],XG_SOLIDLINE);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return */
-	return (status);
-}
-/*--------------------------------------------------------------------*/
-int mbedit_action_goto(
-		int	ttime_i[7],
-		int	hold_size,
-		int	buffer_size,
-		int	plwd,
-		int	exgr,
-		int	xntrvl,
-		int	yntrvl,
-		int	plt_size,
-		int	sh_mode,
-		int	sh_flggd,
-		int	sh_time,
-		int	*ndumped,
-		int	*nloaded,
-		int	*nbuffer,
-		int	*ngood,
-		int	*icurrent,
-		int	*nplt)
-{
-	/* local variables */
-	char	*function_name = "mbedit_action_goto";
-	int	status = MB_SUCCESS;
-	double	ttime_d;
-	int	found;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       time_i[0]:   %d\n",ttime_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:   %d\n",ttime_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:   %d\n",ttime_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:   %d\n",ttime_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:   %d\n",ttime_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:   %d\n",ttime_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:   %d\n",ttime_i[6]);
-		fprintf(stderr,"dbg2       hold_size:   %d\n",hold_size);
-		fprintf(stderr,"dbg2       buffer_size: %d\n",buffer_size);
-		fprintf(stderr,"dbg2       plot_width:  %d\n",plwd);
-		fprintf(stderr,"dbg2       exager:      %d\n",exgr);
-		fprintf(stderr,"dbg2       x_interval:  %d\n",xntrvl);
-		fprintf(stderr,"dbg2       y_interval:  %d\n",yntrvl);
-		fprintf(stderr,"dbg2       plot_size:   %d\n",plt_size);
-		fprintf(stderr,"dbg2       show_mode:   %d\n",sh_mode);
-		fprintf(stderr,"dbg2       show_flagged:%d\n",sh_flggd);
-		fprintf(stderr,"dbg2       show_time:   %d\n",sh_time);
-		}
-
-	/* let the world know... */
-	if (verbose >= 1)
-		{
-		fprintf(stderr,"\n>> Looking for time: %4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d\n\n",
-			ttime_i[0],ttime_i[1],ttime_i[2],ttime_i[3],
-			ttime_i[4],ttime_i[5],ttime_i[6]);
-		}
-
-	/* set found flag */
-	found = MB_NO;
-
-	/* get time_d value */
-	mb_get_time(verbose,ttime_i,&ttime_d);
-
-	/* check if a file has been opened */
-	if (file_open == MB_NO)
-		{
-		status = MB_FAILURE;
-		*ndumped = 0;
-		*nloaded = 0;
-		*nbuffer = nbuff;
-		*ngood = nbuff;
-		current_id = 0;
-		*icurrent = current_id;
-		*nplt = 0;
-		if (verbose >= 1)
-			fprintf(stderr,"\n>> No data file has been opened...\n");
-		do_error_dialog("No data file has",
-				"been opened...",
-				"  ");
-		}
-
-	/* check if the target time is in the present buffer */
-	else if (nbuff > 0)
-		{
-		/* check if the present buffer starts
-		    later than the target time */
-		if (ping[0].time_d > ttime_d)
-			{
-			status = MB_FAILURE;
-			*ndumped = 0;
-			*nloaded = 0;
-			*nbuffer = nbuff;
-			*ngood = nbuff;
-			*icurrent = current_id;
-			*nplt = 0;
-			if (verbose >= 1)
-				fprintf(stderr,"\n>> Beginning of present buffer is later than target time...\n");
-			do_error_dialog("Beginning of loaded data",
-					"is later than the",
-					"specified target time...");
-			}
-
-		/* check if the file ends
-		    before the target time */
-		else if (ping[nbuff-1].time_d < ttime_d
-			&& nbuff < buffer_size)
-			{
-			status = MB_FAILURE;
-			*ndumped = 0;
-			*nloaded = 0;
-			*nbuffer = nbuff;
-			*ngood = nbuff;
-			*icurrent = current_id;
-			*nplt = 0;
-			if (verbose >= 1)
-				fprintf(stderr,"\n>> Target time is beyond end of file...\n");
-			do_error_dialog("Target time is",
-					"beyond the end",
-					"of the data file...");
-			}
-		}
-
-	/* loop through buffers until the target time is found
-		or the file ends */
-	while (found == MB_NO && status == MB_SUCCESS)
-		{
-		/* check out current buffer */
-		for (i=0;i<nbuff;i++)
-			{
-			if (ping[i].time_d > ttime_d && found == MB_NO)
-				{
-				found = MB_YES;
-				current_id = i;
-				}
-			}
-
-		/* load new buffer if needed */
-		if (found == MB_NO && nbuff >= buffer_size)
-			{
-			/* dump the buffer */
-			status = mbedit_dump_data(hold_size,ndumped,nbuffer);
-
-			/* load the buffer */
-			status = mbedit_load_data(buffer_size,nloaded,
-				nbuffer,ngood,icurrent);
-
-			/* if end of file close it */
-			if (status == MB_FAILURE)
-				{
-				status = mbedit_dump_data(0,ndumped,nbuffer);
-				mbedit_close_file();
-				status = MB_FAILURE;
-				*nbuffer = nbuff;
-				*ngood = nbuff;
-				*icurrent = current_id;
-				*nplt = 0;
-				if (verbose >= 1)
-					fprintf(stderr,"\n>> Target time is beyond end of file, file closed...\n");
-				do_error_dialog("Target time is beyond the",
-						"end of the data file!",
-						"The file has been closed...");
-				}
-			}
-
-		/* turns out the file ends
-		    before the target time */
-		else if (found == MB_NO && nbuff < buffer_size)
-			{
-			status = MB_FAILURE;
-			*nbuffer = nbuff;
-			*ngood = nbuff;
-			*icurrent = current_id;
-			*nplt = 0;
-			if (verbose >= 1)
-				fprintf(stderr,"\n>> Target time is beyond end of file...\n");
-			do_error_dialog("Target time is",
-					"beyond the end",
-					"of the data file...");
-			}
-		}
-
-	/* clear the screen */
-	status = mbedit_clear_screen();
-
-	/* set up plotting */
-	if (*ngood > 0)
-		{
-		status = mbedit_plot_all(plwd,exgr,xntrvl,yntrvl,
-				plt_size,sh_mode,sh_flggd,sh_time,nplt, MB_NO);
-		}
-
-	/* let the world know... */
-	if (verbose >= 2 && found == MB_YES)
-		{
-		fprintf(stderr,"\n>> Target time %4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d found\n",
-			ttime_i[0],ttime_i[1],ttime_i[2],
-			ttime_i[3],ttime_i[4],ttime_i[5],ttime_i[6]);
-		fprintf(stderr,">> Found time: %4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d\n",
-			ping[0].time_i[0],ping[0].time_i[1],
-			ping[0].time_i[2],ping[0].time_i[3],
-			ping[0].time_i[4],ping[0].time_i[5],
-			ping[0].time_i[6]);
-		fprintf(stderr,"Current data record index:  %d\n",
-			current_id);
-		fprintf(stderr,"Current global data record: %d\n",
-			current_id + ndump_total);
-		}
-	else if (verbose >= 2)
-		{
-		fprintf(stderr,"\n>> Target time %4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d found\n",
-			ttime_i[0],ttime_i[1],ttime_i[2],
-			ttime_i[3],ttime_i[4],ttime_i[5],ttime_i[6]);
-		fprintf(stderr,"\n>> Unable to go to target time...\n");
-		}
-
-	/* reset beam_save */
-	beam_save = MB_NO;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       ndumped:     %d\n",*ndumped);
-		fprintf(stderr,"dbg2       nloaded:     %d\n",*nloaded);
-		fprintf(stderr,"dbg2       nbuffer:     %d\n",*nbuffer);
-		fprintf(stderr,"dbg2       ngood:       %d\n",*ngood);
-		fprintf(stderr,"dbg2       icurrent:    %d\n",*icurrent);
-		fprintf(stderr,"dbg2       nplot:        %d\n",*nplt);
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbedit_tslabel(int data_id, char *label)
-{
-	/* local variables */
-	char	*function_name = "mbedit_tslabel";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       data_id:         %d\n",data_id);
-		}
-
-	/* get the time series label */
-       switch (data_id)
-	       {
-	       case MBEDIT_PLOT_WIDE:
-		       strcpy(label, "WIDE PLOT");
-		       break;
-	       case MBEDIT_PLOT_TIME:
-		       strcpy(label, "TIME STAMP");
-		       break;
-	       case MBEDIT_PLOT_INTERVAL:
-		       strcpy(label, "Ping Interval (sec)");
-		       break;
-	       case MBEDIT_PLOT_LON:
-		       strcpy(label, "Longitude (deg)");
-		       break;
-	       case MBEDIT_PLOT_LAT:
-		       strcpy(label, "Latitude (deg)");
-		       break;
-	       case MBEDIT_PLOT_HEADING:
-		       strcpy(label, "Heading (deg)");
-		       break;
-	       case MBEDIT_PLOT_SPEED:
-		       strcpy(label, "Speed (km/hr)");
-		       break;
-	       case MBEDIT_PLOT_DEPTH:
-		       strcpy(label, "Center Beam Depth (m)");
-		       break;
-	       case MBEDIT_PLOT_ALTITUDE:
-		       strcpy(label, "Sonar Altitude (m)");
-		       break;
-	       case MBEDIT_PLOT_SONARDEPTH:
-		       strcpy(label, "Sonar Depth (m)");
-		       break;
-	       case MBEDIT_PLOT_ROLL:
-		       strcpy(label, "Roll (deg)");
-		       break;
-	       case MBEDIT_PLOT_PITCH:
-		       strcpy(label, "Pitch (deg)");
-		       break;
-	       case MBEDIT_PLOT_HEAVE:
-		       strcpy(label, "Heave (m)");
-		       break;
-	       }
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       label:       %s\n",label);
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbedit_tsvalue(int iping, int data_id, double *value)
-{
-	/* local variables */
-	char	*function_name = "mbedit_tsvalue";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       iping:           %d\n",iping);
-		fprintf(stderr,"dbg2       data_id:         %d\n",data_id);
-		}
-
-	/* get the time series value */
-	if (iping >= 0 && nbuff > iping)
-		{
-		switch (data_id)
-			{
-			case MBEDIT_PLOT_WIDE:
-				*value = 0.0;
-				break;
-			case MBEDIT_PLOT_TIME:
-				*value = 0.0;
-				break;
-			case MBEDIT_PLOT_INTERVAL:
-				*value = ping[iping].time_interval;
-				break;
-			case MBEDIT_PLOT_LON:
-				*value = ping[iping].navlon;
-				break;
-			case MBEDIT_PLOT_LAT:
-				*value = ping[iping].navlat;
-				break;
-			case MBEDIT_PLOT_HEADING:
-				*value = ping[iping].heading;
-				break;
-			case MBEDIT_PLOT_SPEED:
-				*value = ping[iping].speed;
-				break;
-			case MBEDIT_PLOT_DEPTH:
-				*value = ping[iping].bath[ping[iping].beams_bath/2];
-				break;
-			case MBEDIT_PLOT_ALTITUDE:
-				*value = ping[iping].altitude;
-				break;
-			case MBEDIT_PLOT_SONARDEPTH:
-				*value = ping[iping].sonardepth;
-				break;
-			case MBEDIT_PLOT_ROLL:
-				*value = ping[iping].roll;
-				break;
-			case MBEDIT_PLOT_PITCH:
-				*value = ping[iping].pitch;
-				break;
-			case MBEDIT_PLOT_HEAVE:
-				*value = ping[iping].heave;
-				break;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       value:       %f\n",*value);
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbedit_tsminmax(int iping, int nping, int data_id, double *tsmin, double *tsmax)
-{
-	/* local variables */
-	char	*function_name = "mbedit_tsminmax";
-	int	status = MB_SUCCESS;
-	double	value, value2;
-	double	halfwidth;
-	double	center;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       iping:           %d\n",iping);
-		fprintf(stderr,"dbg2       nping:           %d\n",nping);
-		fprintf(stderr,"dbg2       data_id:         %d\n",data_id);
-		}
-
-	/* get the time series minimum and maximum value */
-	*tsmin = 0.0;
-	*tsmax = 0.0;
-	if (iping >= 0
-		&& nbuff > iping
-		&& nping > 0
-		&& iping + nping - 1 < nbuff)
-		{
-		mbedit_tsvalue(iping, data_id, tsmin);
-		*tsmax = *tsmin;
-		for (i=iping;i<iping+nping;i++)
-			{
-			mbedit_tsvalue(i, data_id, &value);
-			*tsmin = MIN(*tsmin, value);
-			*tsmax = MAX(*tsmax, value);
-
-			/* handle slope plotting in roll plot */
-			if (data_id == MBEDIT_PLOT_ROLL)
-				{
-				mbedit_xtrackslope(i, &value2);
-				*tsmin = MIN(*tsmin, value2);
-				*tsmax = MAX(*tsmax, value2);
-				*tsmin = MIN(*tsmin, value - value2);
-				*tsmax = MAX(*tsmax, value - value2);
-				}
-			}
-		}
-
-	/* adjust the min max according to data type */
-	switch (data_id)
-		{
-		case MBEDIT_PLOT_WIDE:
-			*tsmin = 0.0;
-			*tsmax = 1.0;
-			break;
-		case MBEDIT_PLOT_TIME:
-			*tsmin = 0.0;
-			*tsmax = 1.0;
-			break;
-		case MBEDIT_PLOT_INTERVAL:
-			*tsmin = 0.0;
-			*tsmax = MAX(1.1 * (*tsmax), 0.01);
-			break;
-		case MBEDIT_PLOT_LON:
-			halfwidth = MAX(0.001, 0.55 * (*tsmax - *tsmin));
-			center = 0.5 * (*tsmin + *tsmax);
-			*tsmin = center - halfwidth;
-			*tsmax = center + halfwidth;
-			break;
-		case MBEDIT_PLOT_LAT:
-			halfwidth = MAX(0.001, 0.55 * (*tsmax - *tsmin));
-			center = 0.5 * (*tsmin + *tsmax);
-			*tsmin = center - halfwidth;
-			*tsmax = center + halfwidth;
-			break;
-		case MBEDIT_PLOT_HEADING:
-			*tsmin = 0.0;
-			*tsmax = 360.0;
-			break;
-		case MBEDIT_PLOT_SPEED:
-			*tsmin = 0.0;
-			*tsmax = MAX(*tsmax, 5.0);
-			break;
-		case MBEDIT_PLOT_DEPTH:
-			halfwidth = MAX(1.0, 0.55 * (*tsmax - *tsmin));
-			center = 0.5 * (*tsmin + *tsmax);
-			*tsmin = center - halfwidth;
-			*tsmax = center + halfwidth;
-			break;
-		case MBEDIT_PLOT_ALTITUDE:
-			halfwidth = MAX(1.0, 0.55 * (*tsmax - *tsmin));
-			center = 0.5 * (*tsmin + *tsmax);
-			*tsmin = center - halfwidth;
-			*tsmax = center + halfwidth;
-			break;
-		case MBEDIT_PLOT_SONARDEPTH:
-			halfwidth = MAX(1.0, 0.55 * (*tsmax - *tsmin));
-			center = 0.5 * (*tsmin + *tsmax);
-			*tsmin = center - halfwidth;
-			*tsmax = center + halfwidth;
-			break;
-		case MBEDIT_PLOT_ROLL:
-			*tsmax = 1.1 * MAX(fabs(*tsmin), fabs(*tsmax));
-			*tsmax = MAX(*tsmax, 1.0);
-			*tsmin = -(*tsmax);
-			break;
-		case MBEDIT_PLOT_PITCH:
-			*tsmax = 1.1 * MAX(fabs(*tsmin), fabs(*tsmax));
-			*tsmax = MAX(*tsmax, 1.0);
-			*tsmin = -(*tsmax);
-			break;
-		case MBEDIT_PLOT_HEAVE:
-			*tsmax = 1.1 * MAX(fabs(*tsmin), fabs(*tsmax));
-			*tsmax = MAX(*tsmax, 0.25);
-			*tsmin = -(*tsmax);
-			break;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       tsmin:       %f\n",*tsmin);
-		fprintf(stderr,"dbg2       tsmax:       %f\n",*tsmax);
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbedit_xtrackslope(int iping, double *slope)
-{
-	/* local variables */
-	char	*function_name = "mbedit_xtrackslope";
-	int	status = MB_SUCCESS;
-	int	jbeam;
-	int	ns;
-	double	sx, sy, sxx, sxy, delta, b;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       iping:           %d\n",iping);
-		}
-
-	/* initialize linear fit variables */
-	sx = 0.0;
-	sy = 0.0;
-	sxx = 0.0;
-	sxy = 0.0;
-	ns = 0;
-	*slope = 0.0;
-
-	/* get the slope value */
-	if (iping >= 0 && nbuff > iping)
-		{
-		ns = 0;
-		for (jbeam=0;jbeam<ping[iping].beams_bath;jbeam++)
-		    	{
-			/* use valid beams to calculate slope */
-			if (mb_beam_ok(ping[iping].beamflag[jbeam]))
-				{
-				sx += ping[iping].bathacrosstrack[jbeam];
-				sy += ping[iping].bath[jbeam];
-				sxx += ping[iping].bathacrosstrack[jbeam] * ping[iping].bathacrosstrack[jbeam];
-				sxy += ping[iping].bathacrosstrack[jbeam] * ping[iping].bath[jbeam];
-				ns++;
-				}
-			}
-
-		/* get linear fit to ping */
-		if (ns > 0)
-			{
-			delta = ns*sxx - sx*sx;
-			/* a = (sxx*sy - sx*sxy)/delta; */
-			b = (ns*sxy - sx*sy)/delta;
-			*slope = -RTD * atan(b);;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       slope:       %f\n",*slope);
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbeditviz/Makefile.am b/src/mbeditviz/Makefile.am
deleted file mode 100644
index 80beef8..0000000
--- a/src/mbeditviz/Makefile.am
+++ /dev/null
@@ -1,24 +0,0 @@
-bin_PROGRAMS = mbeditviz
-
-AM_CFLAGS = ${libgmt_CFLAGS} ${libnetcdf_CFLAGS}
-
-AM_CPPFLAGS = -I${top_srcdir}/src/mbio \
-	-I${top_srcdir}/src/mbaux \
-	-I${top_srcdir}/src/mbview \
-	-I${top_srcdir}/src/mr1pr \
-	-I${top_srcdir}/src/surf \
-	-I${top_srcdir}/src/gsf \
-	${libgmt_CPPFLAGS} \
-	${libnetcdf_CPPFLAGS} \
-	${libmotif_CPPFLAGS} ${libopengl_CPPFLAGS}
-
-AM_LDFLAGS = 
-
-mbeditviz_SOURCES = mbeditviz_main.c mbeditviz_callbacks.c mbeditviz_prog.c mbeditviz_creation.c
-mbeditviz_LDADD = ${top_builddir}/src/mbio/libmbio.la \
-		  ${top_builddir}/src/mbaux/libmbaux.la \
-		  ${top_builddir}/src/mbaux/libmbxgr.la \
-		  ${top_builddir}/src/mbview/libmbview.la \
-		  ${libgmt_LIBS} ${libnetcdf_LIBS} ${libproj_LIBS} \
-		  ${libmotif_LIBS} ${libopengl_LIBS} \
-		  $(LIBM)
diff --git a/src/mbeditviz/Makefile.in b/src/mbeditviz/Makefile.in
deleted file mode 100644
index 4efd876..0000000
--- a/src/mbeditviz/Makefile.in
+++ /dev/null
@@ -1,683 +0,0 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
-
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-
-VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
-am__make_running_with_option = \
-  case $${target_option-} in \
-      ?) ;; \
-      *) echo "am__make_running_with_option: internal error: invalid" \
-              "target option '$${target_option-}' specified" >&2; \
-         exit 1;; \
-  esac; \
-  has_opt=no; \
-  sane_makeflags=$$MAKEFLAGS; \
-  if $(am__is_gnu_make); then \
-    sane_makeflags=$$MFLAGS; \
-  else \
-    case $$MAKEFLAGS in \
-      *\\[\ \	]*) \
-        bs=\\; \
-        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
-          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
-    esac; \
-  fi; \
-  skip_next=no; \
-  strip_trailopt () \
-  { \
-    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
-  }; \
-  for flg in $$sane_makeflags; do \
-    test $$skip_next = yes && { skip_next=no; continue; }; \
-    case $$flg in \
-      *=*|--*) continue;; \
-        -*I) strip_trailopt 'I'; skip_next=yes;; \
-      -*I?*) strip_trailopt 'I';; \
-        -*O) strip_trailopt 'O'; skip_next=yes;; \
-      -*O?*) strip_trailopt 'O';; \
-        -*l) strip_trailopt 'l'; skip_next=yes;; \
-      -*l?*) strip_trailopt 'l';; \
-      -[dEDm]) skip_next=yes;; \
-      -[JT]) skip_next=yes;; \
-    esac; \
-    case $$flg in \
-      *$$target_option*) has_opt=yes; break;; \
-    esac; \
-  done; \
-  test $$has_opt = yes
-am__make_dryrun = (target_option=n; $(am__make_running_with_option))
-am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-bin_PROGRAMS = mbeditviz$(EXEEXT)
-subdir = src/mbeditviz
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/depcomp
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
-	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
-	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
-	$(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-	$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/src/mbio/mb_config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-am__installdirs = "$(DESTDIR)$(bindir)"
-PROGRAMS = $(bin_PROGRAMS)
-am_mbeditviz_OBJECTS = mbeditviz_main.$(OBJEXT) \
-	mbeditviz_callbacks.$(OBJEXT) mbeditviz_prog.$(OBJEXT) \
-	mbeditviz_creation.$(OBJEXT)
-mbeditviz_OBJECTS = $(am_mbeditviz_OBJECTS)
-am__DEPENDENCIES_1 =
-mbeditviz_DEPENDENCIES = ${top_builddir}/src/mbio/libmbio.la \
-	${top_builddir}/src/mbaux/libmbaux.la \
-	${top_builddir}/src/mbaux/libmbxgr.la \
-	${top_builddir}/src/mbview/libmbview.la $(am__DEPENDENCIES_1) \
-	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
-	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
-	$(am__DEPENDENCIES_1)
-AM_V_lt = $(am__v_lt_ at AM_V@)
-am__v_lt_ = $(am__v_lt_ at AM_DEFAULT_V@)
-am__v_lt_0 = --silent
-am__v_lt_1 = 
-AM_V_P = $(am__v_P_ at AM_V@)
-am__v_P_ = $(am__v_P_ at AM_DEFAULT_V@)
-am__v_P_0 = false
-am__v_P_1 = :
-AM_V_GEN = $(am__v_GEN_ at AM_V@)
-am__v_GEN_ = $(am__v_GEN_ at AM_DEFAULT_V@)
-am__v_GEN_0 = @echo "  GEN     " $@;
-am__v_GEN_1 = 
-AM_V_at = $(am__v_at_ at AM_V@)
-am__v_at_ = $(am__v_at_ at AM_DEFAULT_V@)
-am__v_at_0 = @
-am__v_at_1 = 
-DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)/src/mbio
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
-am__mv = mv -f
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
-	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
-	$(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
-	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
-	$(AM_CFLAGS) $(CFLAGS)
-AM_V_CC = $(am__v_CC_ at AM_V@)
-am__v_CC_ = $(am__v_CC_ at AM_DEFAULT_V@)
-am__v_CC_0 = @echo "  CC      " $@;
-am__v_CC_1 = 
-CCLD = $(CC)
-LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
-	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
-	$(AM_LDFLAGS) $(LDFLAGS) -o $@
-AM_V_CCLD = $(am__v_CCLD_ at AM_V@)
-am__v_CCLD_ = $(am__v_CCLD_ at AM_DEFAULT_V@)
-am__v_CCLD_0 = @echo "  CCLD    " $@;
-am__v_CCLD_1 = 
-SOURCES = $(mbeditviz_SOURCES)
-DIST_SOURCES = $(mbeditviz_SOURCES)
-am__can_run_installinfo = \
-  case $$AM_UPDATE_INFO_DIR in \
-    n|no|NO) false;; \
-    *) (install-info --version) >/dev/null 2>&1;; \
-  esac
-am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
-# Read a list of newline-separated strings from the standard input,
-# and print each of them once, without duplicates.  Input order is
-# *not* preserved.
-am__uniquify_input = $(AWK) '\
-  BEGIN { nonempty = 0; } \
-  { items[$$0] = 1; nonempty = 1; } \
-  END { if (nonempty) { for (i in items) print i; }; } \
-'
-# Make sure the list of sources is unique.  This is necessary because,
-# e.g., the same source file might be shared among _SOURCES variables
-# for different programs/libraries.
-am__define_uniq_tagged_files = \
-  list='$(am__tagged_files)'; \
-  unique=`for i in $$list; do \
-    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-  done | $(am__uniquify_input)`
-ETAGS = etags
-CTAGS = ctags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-CC = @CC@
-CCAS = @CCAS@
-CCASDEPMODE = @CCASDEPMODE@
-CCASFLAGS = @CCASFLAGS@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DLLTOOL = @DLLTOOL@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GREP = @GREP@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBM = @LIBM@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIBTOOL_DEPS = @LIBTOOL_DEPS@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LTLIBOBJS = @LTLIBOBJS@
-LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
-MAINT = @MAINT@
-MAKEINFO = @MAKEINFO@
-MANIFEST_TOOL = @MANIFEST_TOOL@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-OTPS_DIR = @OTPS_DIR@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_URL = @PACKAGE_URL@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PKG_CONFIG = @PKG_CONFIG@
-PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
-PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-VERSION = @VERSION@
-XDR_LIB = @XDR_LIB@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_AR = @ac_ct_AR@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-fftw_app = @fftw_app@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libGLU_CFLAGS = @libGLU_CFLAGS@
-libGLU_LIBS = @libGLU_LIBS@
-libXm_CFLAGS = @libXm_CFLAGS@
-libXm_LIBS = @libXm_LIBS@
-libdir = @libdir@
-libexecdir = @libexecdir@
-libfftw3_CFLAGS = @libfftw3_CFLAGS@
-libfftw3_LIBS = @libfftw3_LIBS@
-libfftw_CPPFLAGS = @libfftw_CPPFLAGS@
-libfftw_LIBS = @libfftw_LIBS@
-libgmt_CFLAGS = @libgmt_CFLAGS@
-libgmt_CPPFLAGS = @libgmt_CPPFLAGS@
-libgmt_LIBS = @libgmt_LIBS@
-libmotif_CPPFLAGS = @libmotif_CPPFLAGS@
-libmotif_LIBS = @libmotif_LIBS@
-libnetcdf_CFLAGS = @libnetcdf_CFLAGS@
-libnetcdf_CPPFLAGS = @libnetcdf_CPPFLAGS@
-libnetcdf_LIBS = @libnetcdf_LIBS@
-libopengl_CPPFLAGS = @libopengl_CPPFLAGS@
-libopengl_LIBS = @libopengl_LIBS@
-libproj_CFLAGS = @libproj_CFLAGS@
-libproj_CPPFLAGS = @libproj_CPPFLAGS@
-libproj_LIBS = @libproj_LIBS@
-libpsl_CFLAGS = @libpsl_CFLAGS@
-libpsl_LIBS = @libpsl_LIBS@
-localedir = @localedir@
-localstatedir = @localstatedir@
-mandir = @mandir@
-mbsystemdatadir = @mbsystemdatadir@
-mbsystemhtmldir = @mbsystemhtmldir@
-mbsystempsdir = @mbsystempsdir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-AM_CFLAGS = ${libgmt_CFLAGS} ${libnetcdf_CFLAGS}
-AM_CPPFLAGS = -I${top_srcdir}/src/mbio \
-	-I${top_srcdir}/src/mbaux \
-	-I${top_srcdir}/src/mbview \
-	-I${top_srcdir}/src/mr1pr \
-	-I${top_srcdir}/src/surf \
-	-I${top_srcdir}/src/gsf \
-	${libgmt_CPPFLAGS} \
-	${libnetcdf_CPPFLAGS} \
-	${libmotif_CPPFLAGS} ${libopengl_CPPFLAGS}
-
-AM_LDFLAGS = 
-mbeditviz_SOURCES = mbeditviz_main.c mbeditviz_callbacks.c mbeditviz_prog.c mbeditviz_creation.c
-mbeditviz_LDADD = ${top_builddir}/src/mbio/libmbio.la \
-		  ${top_builddir}/src/mbaux/libmbaux.la \
-		  ${top_builddir}/src/mbaux/libmbxgr.la \
-		  ${top_builddir}/src/mbview/libmbview.la \
-		  ${libgmt_LIBS} ${libnetcdf_LIBS} ${libproj_LIBS} \
-		  ${libmotif_LIBS} ${libopengl_LIBS} \
-		  $(LIBM)
-
-all: all-am
-
-.SUFFIXES:
-.SUFFIXES: .c .lo .o .obj
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
-	@for dep in $?; do \
-	  case '$(am__configure_deps)' in \
-	    *$$dep*) \
-	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-	        && { if test -f $@; then exit 0; else break; fi; }; \
-	      exit 1;; \
-	  esac; \
-	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/mbeditviz/Makefile'; \
-	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --gnu src/mbeditviz/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	@case '$?' in \
-	  *config.status*) \
-	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-	esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-install-binPROGRAMS: $(bin_PROGRAMS)
-	@$(NORMAL_INSTALL)
-	@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
-	if test -n "$$list"; then \
-	  echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
-	  $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
-	fi; \
-	for p in $$list; do echo "$$p $$p"; done | \
-	sed 's/$(EXEEXT)$$//' | \
-	while read p p1; do if test -f $$p \
-	 || test -f $$p1 \
-	  ; then echo "$$p"; echo "$$p"; else :; fi; \
-	done | \
-	sed -e 'p;s,.*/,,;n;h' \
-	    -e 's|.*|.|' \
-	    -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
-	sed 'N;N;N;s,\n, ,g' | \
-	$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
-	  { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
-	    if ($$2 == $$4) files[d] = files[d] " " $$1; \
-	    else { print "f", $$3 "/" $$4, $$1; } } \
-	  END { for (d in files) print "f", d, files[d] }' | \
-	while read type dir files; do \
-	    if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
-	    test -z "$$files" || { \
-	    echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
-	    $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
-	    } \
-	; done
-
-uninstall-binPROGRAMS:
-	@$(NORMAL_UNINSTALL)
-	@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
-	files=`for p in $$list; do echo "$$p"; done | \
-	  sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
-	      -e 's/$$/$(EXEEXT)/' \
-	`; \
-	test -n "$$list" || exit 0; \
-	echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
-	cd "$(DESTDIR)$(bindir)" && rm -f $$files
-
-clean-binPROGRAMS:
-	@list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \
-	echo " rm -f" $$list; \
-	rm -f $$list || exit $$?; \
-	test -n "$(EXEEXT)" || exit 0; \
-	list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
-	echo " rm -f" $$list; \
-	rm -f $$list
-
-mbeditviz$(EXEEXT): $(mbeditviz_OBJECTS) $(mbeditviz_DEPENDENCIES) $(EXTRA_mbeditviz_DEPENDENCIES) 
-	@rm -f mbeditviz$(EXEEXT)
-	$(AM_V_CCLD)$(LINK) $(mbeditviz_OBJECTS) $(mbeditviz_LDADD) $(LIBS)
-
-mostlyclean-compile:
-	-rm -f *.$(OBJEXT)
-
-distclean-compile:
-	-rm -f *.tab.c
-
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbeditviz_callbacks.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbeditviz_creation.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbeditviz_main.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbeditviz_prog.Po at am__quote@
-
-.c.o:
- at am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(COMPILE) -c -o $@ $<
-
-.c.obj:
- at am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
- at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-
-.c.lo:
- at am__fastdepCC_TRUE@	$(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(LTCOMPILE) -c -o $@ $<
-
-mostlyclean-libtool:
-	-rm -f *.lo
-
-clean-libtool:
-	-rm -rf .libs _libs
-
-ID: $(am__tagged_files)
-	$(am__define_uniq_tagged_files); mkid -fID $$unique
-tags: tags-am
-TAGS: tags
-
-tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
-	set x; \
-	here=`pwd`; \
-	$(am__define_uniq_tagged_files); \
-	shift; \
-	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
-	  test -n "$$unique" || unique=$$empty_fix; \
-	  if test $$# -gt 0; then \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      "$$@" $$unique; \
-	  else \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      $$unique; \
-	  fi; \
-	fi
-ctags: ctags-am
-
-CTAGS: ctags
-ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
-	$(am__define_uniq_tagged_files); \
-	test -z "$(CTAGS_ARGS)$$unique" \
-	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$unique
-
-GTAGS:
-	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && $(am__cd) $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) "$$here"
-cscopelist: cscopelist-am
-
-cscopelist-am: $(am__tagged_files)
-	list='$(am__tagged_files)'; \
-	case "$(srcdir)" in \
-	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
-	  *) sdir=$(subdir)/$(srcdir) ;; \
-	esac; \
-	for i in $$list; do \
-	  if test -f "$$i"; then \
-	    echo "$(subdir)/$$i"; \
-	  else \
-	    echo "$$sdir/$$i"; \
-	  fi; \
-	done >> $(top_builddir)/cscope.files
-
-distclean-tags:
-	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	list='$(DISTFILES)'; \
-	  dist_files=`for file in $$list; do echo $$file; done | \
-	  sed -e "s|^$$srcdirstrip/||;t" \
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
-	case $$dist_files in \
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
-			   sort -u` ;; \
-	esac; \
-	for file in $$dist_files; do \
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  if test -d $$d/$$file; then \
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
-	    if test -d "$(distdir)/$$file"; then \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
-	  else \
-	    test -f "$(distdir)/$$file" \
-	    || cp -p $$d/$$file "$(distdir)/$$file" \
-	    || exit 1; \
-	  fi; \
-	done
-check-am: all-am
-check: check-am
-all-am: Makefile $(PROGRAMS)
-installdirs:
-	for dir in "$(DESTDIR)$(bindir)"; do \
-	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
-	done
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
-	if test -z '$(STRIP)'; then \
-	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	      install; \
-	else \
-	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
-	fi
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
-	@echo "This command is intended for maintainers to use"
-	@echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am
-
-distclean: distclean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
-	distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am: install-binPROGRAMS
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic \
-	mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am: uninstall-binPROGRAMS
-
-.MAKE: install-am install-strip
-
-.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \
-	clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \
-	ctags ctags-am distclean distclean-compile distclean-generic \
-	distclean-libtool distclean-tags distdir dvi dvi-am html \
-	html-am info info-am install install-am install-binPROGRAMS \
-	install-data install-data-am install-dvi install-dvi-am \
-	install-exec install-exec-am install-html install-html-am \
-	install-info install-info-am install-man install-pdf \
-	install-pdf-am install-ps install-ps-am install-strip \
-	installcheck installcheck-am installdirs maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-compile \
-	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-	tags tags-am uninstall uninstall-am uninstall-binPROGRAMS
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/mbeditviz/mbeditviz.h b/src/mbeditviz/mbeditviz.h
deleted file mode 100644
index e50e24f..0000000
--- a/src/mbeditviz/mbeditviz.h
+++ /dev/null
@@ -1,332 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbeditviz.h		4/27/2007
- *    $Id: mbeditviz.h 2247 2015-05-29 21:28:28Z caress $
- *
- *    Copyright (c) 2007-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- *
- * MBeditviz is an interactive swath bathymetry editor and patch
- * test tool for  MB-System.
- * It can work with any data format supported by the MBIO library.
- * This include file contains global control parameters shared with
- * the Motif interface code.
- *
- * Author:	D. W. Caress
- * Date:	April 27, 2007
- *
- * $Log: mbeditviz.h,v $
- * Revision 5.2  2008/11/16 21:51:18  caress
- * Updating all recent changes, including time lag analysis using mbeditviz and improvements to the mbgrid footprint gridding algorithm.
- *
- * Revision 5.1  2007/11/16 17:26:56  caress
- * Progress on MBeditviz
- *
- * Revision 5.0  2007/06/17 23:24:12  caress
- * Added NBeditviz.
- *
- *
- */
-
-/*--------------------------------------------------------------------*/
-
-/* start this include */
-#ifndef MB_EDITVIZ_DEF
-
-/* header file flag */
-#define	MB_EDITVIZ_DEF		1
-
-#ifndef MB_STATUS_DEF
-#include "mb_status.h"
-#endif
-
-#ifndef MB_DEFINE_DEF
-#include "mb_define.h"
-#endif
-
-#ifndef MB_PROCESS_DEF
-#include "mb_process.h"
-#endif
-
-#ifndef MB_INFO_DEF
-#include "mb_info.h"
-#endif
-
-#ifdef MBEDITVIZ_DECLARE_GLOBALS
-#define MBVIEW_EXTERNAL
-#else
-#define MBVIEW_EXTERNAL extern
-#endif
-
-/* MBeditviz defines */
-#define MBEV_GRID_NONE		0
-#define MBEV_GRID_NOTVIEWED	1
-#define MBEV_GRID_VIEWED	2
-#define MBEV_GRID_ALGORITH_SIMPLE	0
-#define MBEV_GRID_ALGORITH_FOOTPRINT	1
-#define MBEV_GRID_WEIGHT_TINY	0.0000001
-#define MBEV_OUTPUT_MODE_EDIT	0
-#define MBEV_OUTPUT_MODE_BROWSE	1
-#define MBEV_ALLOC_NUM		24
-#define MBEV_ALLOCK_NUM		1024
-#define MBEV_NODATA		-10000000.0
-
-/* usage of footprint based weight */
-#define MBEV_USE_NO		0
-#define MBEV_USE_YES		1
-#define MBEV_USE_CONDITIONAL	2
-
-/* mbeditviz structures */
-struct	mbev_ping_struct
-	{
-	int	time_i[7];
-	double	time_d;
-	int	multiplicity;
-	double	navlon;
-	double	navlat;
-	double	navlonx;
-	double	navlaty;
-	double	portlon;
-	double	portlat;
-	double	stbdlon;
-	double	stbdlat;
-	double	speed;
-	double	heading;
-	double	distance;
-	double	altitude;
-	double	sonardepth;
-	double	draft;
-	double	roll;
-	double	pitch;
-	double	heave;
-	double	ssv;
-	int	beams_bath;
-	char	*beamflag;
-	char	*beamflagorg;
-        int     *beamcolor;
-	double	*bath;
-	double	*bathacrosstrack;
-	double	*bathalongtrack;
-	double	*bathcorr;
-	double	*bathlon;
-	double	*bathlat;
-	double	*bathx;
-	double	*bathy;
-	double	*angles;
-	double	*angles_forward;
-	double	*angles_null;
-	double	*ttimes;
-	double	*bheave;
-	double	*alongtrack_offset;
-	};
-struct mbev_file_struct
-	{
-	int	load_status;
-	int	load_status_shown;
-	int	locked;
-	int	esf_exists;
-	char 	name[MB_PATH_MAXLINE];
-	char 	path[MB_PATH_MAXLINE];
-	int	format;
-	int	raw_info_loaded;
-	int	processed_info_loaded;
-	struct mb_info_struct raw_info;
-	struct mb_info_struct processed_info;
-	struct mb_process_struct process;
-	int	esf_open;
-	char 	esffile[MB_PATH_MAXLINE];
-	struct mb_esf_struct esf;
-	int	num_pings;
-	int	num_pings_alloc;
-	struct mbev_ping_struct *pings;
-	double	beamwidth_xtrack;
-	double	beamwidth_ltrack;
-        int     topo_type;
-
-	int	n_async_heading;
-	int	n_async_heading_alloc;
-	double	*async_heading_time_d;
-	double	*async_heading_heading;
-	int	n_async_sonardepth;
-	int	n_async_sonardepth_alloc;
-	double	*async_sonardepth_time_d;
-	double	*async_sonardepth_sonardepth;
-	int	n_async_attitude;
-	int	n_async_attitude_alloc;
-	double	*async_attitude_time_d;
-	double	*async_attitude_roll;
-	double	*async_attitude_pitch;
-	int	n_sync_attitude;
-	int	n_sync_attitude_alloc;
-	double	*sync_attitude_time_d;
-	double	*sync_attitude_roll;
-	double	*sync_attitude_pitch;
-	};
-struct mbev_grid_struct
-	{
-	int	status;
-	char	projection_id[MB_PATH_MAXLINE];
-	void	*pjptr;
-	double	bounds[4];
-	double	boundsutm[4];
-	double	dx;
-	double	dy;
-	int	nx;
-	int	ny;
-	double	min;
-	double	max;
-	double	smin;
-	double	smax;
-	float	nodatavalue;
-	float	*sum;
-	float	*wgt;
-	float	*val;
-	float	*sgm;
-	};
-
-/*--------------------------------------------------------------------*/
-
-/* mbeditviz global control parameters */
-
-/* status parameters */
-MBVIEW_EXTERNAL int	mbev_status;
-MBVIEW_EXTERNAL int	mbev_error;
-MBVIEW_EXTERNAL int	mbev_verbose;
-
-/* gui parameters */
-MBVIEW_EXTERNAL int	mbev_message_on;
-
-/* mode parameters */
-MBVIEW_EXTERNAL int	mbev_mode_output;
-MBVIEW_EXTERNAL int	mbev_grid_algorithm;
-
-/* data parameters */
-MBVIEW_EXTERNAL int	mbev_num_files;
-MBVIEW_EXTERNAL int	mbev_num_files_alloc;
-MBVIEW_EXTERNAL int	mbev_num_files_loaded;
-MBVIEW_EXTERNAL int	mbev_num_pings_loaded;
-MBVIEW_EXTERNAL int	mbev_num_soundings_loaded;
-MBVIEW_EXTERNAL double mbev_bounds[4];
-MBVIEW_EXTERNAL struct mbev_file_struct *mbev_files;
-MBVIEW_EXTERNAL struct mbev_grid_struct mbev_grid;
-MBVIEW_EXTERNAL size_t	mbev_instance;
-
-/* gridding parameters */
-MBVIEW_EXTERNAL double	mbev_grid_bounds[4];
-MBVIEW_EXTERNAL double	mbev_grid_boundsutm[4];
-MBVIEW_EXTERNAL double mbev_grid_cellsize;
-MBVIEW_EXTERNAL int mbev_grid_nx;
-MBVIEW_EXTERNAL int mbev_grid_ny;
-
-/* global patch test parameters */
-MBVIEW_EXTERNAL double	mbev_rollbias;
-MBVIEW_EXTERNAL double	mbev_pitchbias;
-MBVIEW_EXTERNAL double	mbev_headingbias;
-MBVIEW_EXTERNAL double	mbev_timelag;
-MBVIEW_EXTERNAL double	mbev_rollbias_3dsdg;
-MBVIEW_EXTERNAL double	mbev_pitchbias_3dsdg;
-MBVIEW_EXTERNAL double	mbev_headingbias_3dsdg;
-MBVIEW_EXTERNAL double	mbev_timelag_3dsdg;
-
-/* selected sounding parameters */
-MBVIEW_EXTERNAL struct mb3dsoundings_struct mbev_selected;
-
-/* timer function */
-MBVIEW_EXTERNAL int	timer_function_set;
-
-int do_mbeditviz_init(Widget parentwidget, XtAppContext appcon);
-void do_mbeditviz_mode_change( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbeditviz_openfile( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbeditviz_fileselection_list( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbeditviz_fileSelectionBox_openswath( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbeditviz_quit( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbeditviz_viewall( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbeditviz_viewselected( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbeditviz_regrid( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbeditviz_updategrid( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbeditviz_changecellsize( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbeditviz_gridparameters( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbeditviz_viewgrid(void);
-int do_mbeditviz_mbview_dismiss_notify(size_t instance);
-void do_mbeditviz_deleteselected( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbeditviz_changeoutputmode( Widget w, XtPointer client_data, XtPointer call_data);
-int do_mbeditviz_opendata(char *input_file_ptr, int format);
-void do_mbeditviz_update_gui(void);
-void do_mbeditviz_update_filelist(void);
-void do_mbeditviz_pickonepoint_notify(size_t instance);
-void do_mbeditviz_picktwopoint_notify(size_t instance);
-void do_mbeditviz_pickarea_notify(size_t instance);
-void do_mbeditviz_pickregion_notify(size_t instance);
-void do_mbeditviz_picksite_notify(size_t instance);
-void do_mbeditviz_pickroute_notify(size_t instance);
-void do_mbeditviz_picknav_notify(size_t instance);
-void do_mbeditviz_regrid_notify( Widget w, XtPointer client_data, XtPointer call_data);
-int do_mbeditviz_message_on(char *message);
-int do_mbeditviz_message_off(void);
-int do_error_dialog(char *s1, char *s2, char *s3);
-void set_label_string(Widget w, String str);
-void set_label_multiline_string(Widget w, String str);
-void get_text_string(Widget w, String str);
-int do_wait_until_viewed(void);
-int do_mbeditviz_settimer(void);
-int do_mbeditviz_workfunction(XtPointer client_data);
-
-int mbeditviz_init(int argc,char **argv);
-int mbeditviz_get_format(char *file, int *form);
-int mbeditviz_open_data(char *path, int format);
-int mbeditviz_import_file(char *path, int format);
-int mbeditviz_load_file(int ifile);
-int mbeditviz_apply_timelag(struct mbev_file_struct *file, struct mbev_ping_struct *ping,
-				double rollbias, double pitchbias, double headingbias, double timelag,
-				double *heading, double *sonardepth,
-				double *rolldelta, double *pitchdelta);
-int mbeditviz_beam_position(double navlon, double navlat, double headingx, double headingy,
-				double mtodeglon, double mtodeglat,
-				double bath, double acrosstrack, double alongtrack,
-				double sonardepth,
-				double rollbias, double pitchbias,
-				double *bathcorr, double *lon, double *lat);
-int mbeditviz_unload_file(int ifile);
-int mbeditviz_delete_file(int ifile);
-double mbeditviz_erf(double x);
-int mbeditviz_bin_weight(double foot_a, double foot_b, double scale,
-		    double pcx, double pcy, double dx, double dy,
-		    double *px, double *py,
-		    double *weight, int *use);
-int mbeditviz_get_grid_bounds(void);
-int mbeditviz_setup_grid(void);
-int mbeditviz_project_soundings(void);
-int mbeditviz_make_grid(void);
-int mbeditviz_grid_beam(struct mbev_file_struct *file, struct mbev_ping_struct *ping, int ibeam, int beam_ok, int apply_now);
-int mbeditviz_make_grid_simple(void);
-int mbeditviz_destroy_grid(void);
-int mbeditviz_selectregion(size_t instance);
-int mbeditviz_selectarea(size_t instance);
-int mbeditviz_selectnav(size_t instance);
-void mbeditviz_mb3dsoundings_dismiss(void);
-void mbeditviz_mb3dsoundings_edit(int ifile, int iping, int ibeam, char beamflag, int flush);
-void mbeditviz_mb3dsoundings_info(int ifile, int iping, int ibeam, char *infostring);
-void mbeditviz_mb3dsoundings_bias(double rollbias, double pitchbias, double headingbias, double timelag);
-void mbeditviz_mb3dsoundings_biasapply(double rollbias, double pitchbias, double headingbias, double timelag);
-void mbeditviz_mb3dsoundings_colorsoundings(int color);
-int mb3dsoundings_set_biasapply_notify(int verbose, void (biasapply_notify)(double, double, double, double), int *error);
-
-void BxUnmanageCB(Widget w, XtPointer client, XtPointer call);
-void BxManageCB(Widget w, XtPointer client, XtPointer call);
-void BxPopupCB(Widget w, XtPointer client, XtPointer call);
-XtPointer BX_CONVERT(Widget w, char *from_string, char *to_type, int to_size, Boolean *success);
-void BxExitCB(Widget w, XtPointer client, XtPointer call);
-void BxSetValuesCB(Widget w, XtPointer client, XtPointer call);
-
-/* end this include */
-#endif
-
-/*--------------------------------------------------------------------*/
diff --git a/src/mbeditviz/mbeditviz.uil b/src/mbeditviz/mbeditviz.uil
deleted file mode 100644
index 68cbeb0..0000000
--- a/src/mbeditviz/mbeditviz.uil
+++ /dev/null
@@ -1,1897 +0,0 @@
-/*
- * Generated by the ICS builderXcessory (BX).
- *
- *
- * BuilderXcessory Version 6.1.3.
- *
- * Identification: 
- */
-module main_uil
-version = 'V2.1'
-names = case_sensitive
-!(BX) bx_info("c_options", "")
-!(BX) bx_info("c_libs", "-L/usr/lib/Motif1.2 -lXm -lXt -lX11")
-!(BX) bx_info("c_cflags", "-Aa -I/usr/include/Motif1.2 -I/usr/include/X11R5")
-!(BX) bx_info("c_cc", "cc")
-!(BX) bx_info("c_excludeungenerated", "false")
-!(BX) bx_info("c_target", "main-c")
-!(BX) bx_info("c_information", "")
-!(BX) bx_info("c_user_main_loop", "", false)
-!(BX) bx_info("c_ignore_shell_geometry", "false")
-!(BX) bx_info("c_visible_windows_only", "false")
-!(BX) bx_info("c_rm_exp_callbacks", "false")
-!(BX) bx_info("c_reverse_dialogs", "true")
-!(BX) bx_info("c_dialogs_in_routine", "true")
-!(BX) bx_info("c_unmanage_dialogs", "true")
-!(BX) bx_info("c_use_locales", "false")
-!(BX) bx_info("c_ansi", "true")
-!(BX) bx_info("c_name", "MB-System")
-!(BX) bx_info("c_class", "MB-System")
-!(BX) bx_info("c_app_defaults", "app-defaults", true)
-!(BX) bx_info("c_utilities", "bxutils.c", true)
-!(BX) bx_info("c_constants", "mbeditviz_creation.h", true)
-!(BX) bx_info("c_callbacks", "mbeditviz_callbacks.c", true)
-!(BX) bx_info("c_creation", "mbeditviz_creation.c", true)
-!(BX) bx_info("c_main", "mbeditviz_main.c", true)
-!(BX) bx_info("c_acinclude_m4", "acinclude.m4", false)
-!(BX) bx_info("c_configure_in", "configure.in", false)
-!(BX) bx_info("c_makefile_am", "Makefile.am", false)
-!(BX) bx_info("c_cvsmake", "CVSMake", false)
-!(BX) bx_info("c_makefile", "mbeditviz_makefile-c", true)
-!(BX) bx_info("c_imakefile", "mbeditviz_Imakefile", true)
-!(BX) bx_info("c_dirpath", "")
-!(BX) bx_info("include_path", "./sandbox/mbsystem/src/mbview",
-!(BX)		".", false)
-!(BX) bx_info("xrunner_command", "$(M_ROOT)/arch/X11.5/Xm1.2/mic_xm.o", false)
-!(BX) bx_info("system_directory", "/opt/bx-6.1")
-!(BX) bx_info("builder_version", "BuilderXcessory Version 6.1.3")
-!(BX) bx_info("build_lang", "C")
-!(BX) bx_info("default_cpp_args", "")
-!(BX) bx_info("new_mrm_style", "true")
-!(BX) bx_info("c_wrap_lines", "false")
-!(BX) bx_info("uil_wrap_lines", "true")
-!(BX) bx_info("integrate_purify", "false")
-!(BX) bx_info("purify_command", "purify")
-!(BX) bx_info("integrate_xrunner", "false")
-
-procedure BxGlobalWidgetId;
-identifier BXG_label_mbeditviz_status;
-identifier BXG_toggleButton_mode_browse;
-identifier BXG_toggleButton_mode_edit;
-identifier BXG_pushButton_deleteselected;
-identifier BXG_pushButton_viewselected;
-identifier BXG_pushButton_viewall;
-identifier BXG_list_filelist;
-identifier BXG_pushButton_updategrid;
-identifier BXG_pushButton_openswath;
-identifier BXG_label_about_version;
-identifier BXG_label_mbeditviz_message;
-identifier BXG_bulletinBoard_mbeditviz_message;
-identifier BXG_dialogShell_mbeditviz_message;
-identifier BXG_toggleButton_openmodebrowse;
-identifier BXG_toggleButton_openmodeedit;
-identifier BXG_radioBox_openmode;
-identifier BXG_text_format;
-identifier BXG_fileSelectionBox;
-identifier BXG_form_open;
-identifier BXG_dialogShell_open;
-identifier BXG_scale_cellsize;
-identifier BXG_label_current;
-identifier BXG_label_implied;
-identifier BXG_label_error_two;
-identifier BXG_label_error_one;
-identifier BXG_label_error_three;
-identifier BXG_bulletinBoard_error;
-procedure BxExitCB(integer);
-procedure BxManageCB(string);
-procedure BxUnmanageCB(string);
-procedure do_mbeditviz_changecellsize();
-procedure do_mbeditviz_changeoutputmode();
-procedure do_mbeditviz_deleteselected();
-procedure do_mbeditviz_fileSelectionBox_openswath();
-procedure do_mbeditviz_mode_change();
-procedure do_mbeditviz_openfile();
-procedure do_mbeditviz_quit();
-procedure do_mbeditviz_regrid();
-procedure do_mbeditviz_updategrid();
-procedure do_mbeditviz_viewall();
-procedure do_mbeditviz_viewselected();
-
-list BaseStyle : arguments {
-};
-
-list BaseStyleReasons : callbacks {
-};
-
-!(BX)list BaseStyleHandlers : handlers {
-!(BX)};
-
-list Style_use : arguments {
-        arguments BaseStyle;
-        XmNfontList = font_table(
-		font('-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1'));
-};
-
-list Style_useReasons : callbacks {
-        callbacks BaseStyleReasons;
-};
-
-!(BX)list Style_useHandlers : handlers {
-!(BX)    handlers BaseStyleHandlers;
-!(BX)};
-
-
-object pushButton_error : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("OK");
-        XmNx = 110;
-        XmNy = 110;
-        XmNwidth = 90;
-        XmNheight = 40;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNactivateCallback = procedure BxUnmanageCB("bulletinBoard_error");
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object label_error_three : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("permission in this directory!");
-        XmNrecomputeSize = false;
-        XmNx = 10;
-        XmNy = 70;
-        XmNwidth = 290;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_label_error_three);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object label_error_one : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Unable to open output file.");
-        XmNrecomputeSize = false;
-        XmNx = 10;
-        XmNy = 10;
-        XmNwidth = 290;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_label_error_one);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object label_error_two : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("You probably do not have write");
-        XmNrecomputeSize = false;
-        XmNx = 10;
-        XmNy = 40;
-        XmNwidth = 290;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_label_error_two);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object bulletinBoard_error : XmBulletinBoardDialog widget {
-    arguments {
-        arguments Style_use;
-        XmNdialogStyle = XmDIALOG_APPLICATION_MODAL;
-        XmNdialogTitle = compound_string("Error");
-        XmNresizePolicy = XmRESIZE_GROW;
-        XmNx = 1125;
-        XmNy = 1234;
-        XmNwidth = 311;
-        XmNheight = 205;
-    };
-    controls {
-         managed XmLabel label_error_two;
-         managed XmLabel label_error_one;
-         managed XmLabel label_error_three;
-         managed XmPushButton pushButton_error;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_bulletinBoard_error);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-!(BX)object dialogShell_error : XmDialogShell widget {
-!(BX)    arguments {
-!(BX)        arguments Style_use;
-!(BX)        XmNwidth = 311;
-!(BX)        XmNheight = 205;
-!(BX)    };
-!(BX)    controls {
-!(BX)         managed XmBulletinBoardDialog bulletinBoard_error;
-!(BX)    };
-!(BX)    callbacks {
-!(BX)        callbacks Style_useReasons;
-!(BX)    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-!(BX)};
-
-object pushButton_gridparameters_apply : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Apply");
-        XmNtopAttachment = XmATTACH_WIDGET;
-        XmNleftAttachment = XmATTACH_FORM;
-        XmNbottomAttachment = XmATTACH_NONE;
-        XmNleftOffset = 70;
-        XmNtopOffset = 18;
-        XmNtopWidget = XmLabel label_implied;
-        XmNx = 70;
-        XmNy = 290;
-        XmNwidth = 100;
-        XmNheight = 32;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-       XmNactivateCallback = procedures {
-                 BxUnmanageCB("form_gridparameters");
-                 do_mbeditviz_updategrid();
-        };
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object pushButton_gridparameters_dismiss : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Dismiss");
-        XmNtopAttachment = XmATTACH_WIDGET;
-        XmNrightAttachment = XmATTACH_FORM;
-        XmNleftAttachment = XmATTACH_NONE;
-        XmNbottomAttachment = XmATTACH_NONE;
-        XmNrightOffset = 63;
-        XmNtopOffset = 18;
-        XmNtopWidget = XmLabel label_implied;
-        XmNx = 290;
-        XmNy = 290;
-        XmNwidth = 100;
-        XmNheight = 32;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNactivateCallback = procedure BxUnmanageCB("form_gridparameters");
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object label_implied : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNborderWidth = 1;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNbackground = color('white');
-        XmNlabelString = compound_string("Selected Grid Parameters:", separate=true) &
- compound_string("    Cell Size: 5.00 m", separate=true) &
- compound_string("    Dimensions 2345 X 3456");
-        XmNtopAttachment = XmATTACH_WIDGET;
-        XmNrightAttachment = XmATTACH_FORM;
-        XmNleftAttachment = XmATTACH_FORM;
-        XmNbottomAttachment = XmATTACH_NONE;
-        XmNbottomOffset = 0;
-        XmNleftOffset = 10;
-        XmNrightOffset = 11;
-        XmNtopOffset = 11;
-        XmNtopWidget = XmScale scale_cellsize;
-        XmNx = 10;
-        XmNy = 200;
-        XmNwidth = 430;
-        XmNheight = 70;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_label_implied);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object label_current : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNborderWidth = 0;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNlabelString = compound_string("Current Grid Parameters:", separate=true) &
- compound_string("    Longitude: -151.56667 -150.00000", separate=true) &
- compound_string("    Latitude:     23.4567 24.0000", separate=true) &
- compound_string("    Cell Size: 10.00 m", separate=true) &
- compound_string("    Dimensions:  1234 X 2345");
-        XmNtopAttachment = XmATTACH_FORM;
-        XmNrightAttachment = XmATTACH_FORM;
-        XmNleftAttachment = XmATTACH_FORM;
-        XmNleftOffset = 10;
-        XmNrightOffset = 11;
-        XmNtopOffset = 10;
-        XmNx = 10;
-        XmNy = 10;
-        XmNwidth = 432;
-        XmNheight = 110;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_label_current);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object scale_cellsize : XmScale widget {
-    arguments {
-        arguments Style_use;
-        XmNminimum = 1;
-        XmNdecimalPoints = 2;
-        XmNvalue = 100;
-        XmNtitleString = compound_string("Grid Cell Size (m)");
-        XmNmaximum = 25000;
-        XmNshowArrows = TRUE;
-        XmNshowValue = TRUE;
-        XmNhighlightThickness = 1;
-        XmNorientation = XmHORIZONTAL;
-        XmNtopAttachment = XmATTACH_WIDGET;
-        XmNrightAttachment = XmATTACH_FORM;
-        XmNleftAttachment = XmATTACH_FORM;
-        XmNbottomAttachment = XmATTACH_NONE;
-        XmNbottomOffset = 0;
-        XmNleftOffset = 10;
-        XmNrightOffset = 13;
-        XmNtopOffset = 8;
-        XmNtopWidget = XmLabel label_current;
-        XmNx = 10;
-        XmNy = 128;
-        XmNwidth = 430;
-        XmNheight = 61;
-    };
-    controls {
-        Xm_Title {
-            arguments {
-                arguments Style_use;
-            };
-            callbacks {
-                    callbacks Style_useReasons;
-            };
-!(BX)            handlers {
-!(BX)                handlers Style_useHandlers;
-!(BX)            };
-        };
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_scale_cellsize);
-        XmNvalueChangedCallback = procedure do_mbeditviz_changecellsize();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object form_gridparameters : XmFormDialog widget {
-    arguments {
-        arguments Style_use;
-        XmNresizePolicy = XmRESIZE_GROW;
-        XmNx = 1054;
-        XmNy = 1168;
-        XmNwidth = 453;
-        XmNheight = 337;
-    };
-    controls {
-         managed XmScale scale_cellsize;
-         managed XmLabel label_current;
-         managed XmLabel label_implied;
-         managed XmPushButton pushButton_gridparameters_dismiss;
-         managed XmPushButton pushButton_gridparameters_apply;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-!(BX)object dialogShell_gridparameters : XmDialogShell widget {
-!(BX)    arguments {
-!(BX)        arguments Style_use;
-!(BX)        XmNtitle = "Grid Parameters";
-!(BX)        XmNwidth = 453;
-!(BX)        XmNheight = 337;
-!(BX)    };
-!(BX)    controls {
-!(BX)         managed XmFormDialog form_gridparameters;
-!(BX)    };
-!(BX)    callbacks {
-!(BX)        callbacks Style_useReasons;
-!(BX)    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-!(BX)};
-
-object fileSelectionBox : XmFileSelectionBox widget {
-    arguments {
-        arguments Style_use;
-        XmNnoResize = true;
-        XmNresizePolicy = XmRESIZE_GROW;
-        XmNtopAttachment = XmATTACH_FORM;
-        XmNrightAttachment = XmATTACH_FORM;
-        XmNleftAttachment = XmATTACH_FORM;
-        XmNbottomAttachment = XmATTACH_FORM;
-        XmNbottomOffset = 72;
-        XmNleftOffset = 0;
-        XmNrightOffset = 6;
-        XmNtopOffset = 0;
-        XmNx = 0;
-        XmNy = 0;
-        XmNwidth = 498;
-        XmNheight = 478;
-    };
-    controls {
-        Xm_Items managed {
-            arguments {
-                arguments Style_use;
-            };
-            callbacks {
-                    callbacks Style_useReasons;
-            };
-!(BX)            handlers {
-!(BX)                handlers Style_useHandlers;
-!(BX)            };
-        };
-        Xm_ItemsList managed {
-            arguments {
-                arguments Style_use;
-            };
-            callbacks {
-                    callbacks Style_useReasons;
-            };
-!(BX)            handlers {
-!(BX)                handlers Style_useHandlers;
-!(BX)            };
-        };
-        Xm_Selection managed {
-            arguments {
-                arguments Style_use;
-            };
-            callbacks {
-                    callbacks Style_useReasons;
-            };
-!(BX)            handlers {
-!(BX)                handlers Style_useHandlers;
-!(BX)            };
-        };
-        Xm_Text managed {
-            arguments {
-                arguments Style_use;
-            };
-            callbacks {
-                    callbacks Style_useReasons;
-            };
-!(BX)            handlers {
-!(BX)                handlers Style_useHandlers;
-!(BX)            };
-        };
-        Xm_Separator managed {
-            arguments {
-                arguments Style_use;
-            };
-            callbacks {
-                    callbacks Style_useReasons;
-            };
-!(BX)            handlers {
-!(BX)                handlers Style_useHandlers;
-!(BX)            };
-        };
-        Xm_OK managed {
-            arguments {
-                arguments Style_use;
-            };
-            callbacks {
-                    callbacks Style_useReasons;
-            };
-!(BX)            handlers {
-!(BX)                handlers Style_useHandlers;
-!(BX)            };
-        };
-        Xm_Cancel managed {
-            arguments {
-                arguments Style_use;
-            };
-            callbacks {
-                    callbacks Style_useReasons;
-            };
-!(BX)            handlers {
-!(BX)                handlers Style_useHandlers;
-!(BX)            };
-        };
-        Xm_Help managed {
-            arguments {
-                arguments Style_use;
-            };
-            callbacks {
-                    callbacks Style_useReasons;
-            };
-!(BX)            handlers {
-!(BX)                handlers Style_useHandlers;
-!(BX)            };
-        };
-        Xm_Apply managed {
-            arguments {
-                arguments Style_use;
-            };
-            callbacks {
-                    callbacks Style_useReasons;
-            };
-!(BX)            handlers {
-!(BX)                handlers Style_useHandlers;
-!(BX)            };
-        };
-        Xm_FilterLabel managed {
-            arguments {
-                arguments Style_use;
-            };
-            callbacks {
-                    callbacks Style_useReasons;
-            };
-!(BX)            handlers {
-!(BX)                handlers Style_useHandlers;
-!(BX)            };
-        };
-        Xm_FilterText managed {
-            arguments {
-                arguments Style_use;
-            };
-            callbacks {
-                    callbacks Style_useReasons;
-            };
-!(BX)            handlers {
-!(BX)                handlers Style_useHandlers;
-!(BX)            };
-        };
-        Xm_DirList managed {
-            arguments {
-                arguments Style_use;
-            };
-            callbacks {
-                    callbacks Style_useReasons;
-            };
-!(BX)            handlers {
-!(BX)                handlers Style_useHandlers;
-!(BX)            };
-        };
-        Xm_Dir managed {
-            arguments {
-                arguments Style_use;
-            };
-            callbacks {
-                    callbacks Style_useReasons;
-            };
-!(BX)            handlers {
-!(BX)                handlers Style_useHandlers;
-!(BX)            };
-        };
-        Xm_Filter managed {
-            arguments {
-                arguments Style_use;
-            };
-            callbacks {
-                    callbacks Style_useReasons;
-            };
-!(BX)            handlers {
-!(BX)                handlers Style_useHandlers;
-!(BX)            };
-        };
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_fileSelectionBox);
-       XmNokCallback = procedures {
-                 do_mbeditviz_openfile();
-                 BxUnmanageCB("form_open");
-        };
-        XmNcancelCallback = procedure BxUnmanageCB("form_open");
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object label_open_mbio : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNlabelString = compound_string("MBIO Format ID:");
-        XmNtopAttachment = XmATTACH_NONE;
-        XmNleftAttachment = XmATTACH_FORM;
-        XmNbottomAttachment = XmATTACH_FORM;
-        XmNbottomOffset = 23;
-        XmNleftOffset = 0;
-        XmNx = 0;
-        XmNy = 497;
-        XmNwidth = 130;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object text_format : XmText widget {
-    arguments {
-        arguments Style_use;
-        XmNtopAttachment = XmATTACH_NONE;
-        XmNleftAttachment = XmATTACH_FORM;
-        XmNbottomAttachment = XmATTACH_FORM;
-        XmNbottomOffset = 20;
-        XmNleftOffset = 120;
-        XmNx = 120;
-        XmNy = 490;
-        XmNwidth = 70;
-        XmNheight = 40;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_text_format);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object label_outputmode : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Output Mode:");
-        XmNtopAttachment = XmATTACH_NONE;
-        XmNleftAttachment = XmATTACH_FORM;
-        XmNbottomAttachment = XmATTACH_FORM;
-        XmNbottomOffset = 23;
-        XmNleftOffset = 200;
-        XmNx = 200;
-        XmNy = 497;
-        XmNwidth = 120;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object toggleButton_openmodeedit : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Output Edits");
-        XmNwidth = 116;
-        XmNheight = 28;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_toggleButton_openmodeedit);
-        XmNvalueChangedCallback = procedure do_mbeditviz_changeoutputmode();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object toggleButton_openmodebrowse : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Browse Only");
-        XmNwidth = 116;
-        XmNheight = 28;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_toggleButton_openmodebrowse);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object radioBox_openmode : XmRadioBox widget {
-    arguments {
-        arguments Style_use;
-        XmNtopAttachment = XmATTACH_NONE;
-        XmNleftAttachment = XmATTACH_FORM;
-        XmNbottomAttachment = XmATTACH_FORM;
-        XmNbottomOffset = 7;
-        XmNleftOffset = 310;
-        XmNx = 310;
-        XmNy = 478;
-        XmNwidth = 122;
-        XmNheight = 65;
-    };
-    controls {
-         managed XmToggleButton toggleButton_openmodeedit;
-         managed XmToggleButton toggleButton_openmodebrowse;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_radioBox_openmode);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object form_open : XmFormDialog widget {
-    arguments {
-        arguments Style_use;
-        XmNresizePolicy = XmRESIZE_GROW;
-        XmNx = 1029;
-        XmNy = 1062;
-        XmNwidth = 504;
-        XmNheight = 550;
-    };
-    controls {
-         managed XmRadioBox radioBox_openmode;
-         managed XmLabel label_outputmode;
-         managed XmText text_format;
-         managed XmLabel label_open_mbio;
-         managed XmFileSelectionBox fileSelectionBox;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_form_open);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-!(BX)object dialogShell_open : XmDialogShell widget {
-!(BX)    arguments {
-!(BX)        arguments Style_use;
-!(BX)        XmNtitle = "Open Swath Data";
-!(BX)        XmNwidth = 504;
-!(BX)        XmNheight = 550;
-!(BX)    };
-!(BX)    controls {
-!(BX)         managed XmFormDialog form_open;
-!(BX)    };
-!(BX)    callbacks {
-!(BX)        callbacks Style_useReasons;
-!(BX)        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_dialogShell_open);
-!(BX)    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-!(BX)};
-
-object label_mbeditviz_message : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNlabelString = compound_string("Message...");
-        XmNx = 10;
-        XmNy = 10;
-        XmNwidth = 380;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_label_mbeditviz_message);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object label_mbeditviz_patience : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNlabelString = compound_string("Thank you for your patience...");
-        XmNx = 10;
-        XmNy = 50;
-        XmNwidth = 350;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object bulletinBoard_mbeditviz_message : XmBulletinBoardDialog widget {
-    arguments {
-        arguments Style_use;
-        XmNresizePolicy = XmRESIZE_GROW;
-        XmNx = 1076;
-        XmNy = 1290;
-        XmNwidth = 409;
-        XmNheight = 93;
-    };
-    controls {
-         managed XmLabel label_mbeditviz_patience;
-         managed XmLabel label_mbeditviz_message;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_bulletinBoard_mbeditviz_message);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-!(BX)object dialogShell_mbeditviz_message : XmDialogShell widget {
-!(BX)    arguments {
-!(BX)        arguments Style_use;
-!(BX)        XmNtitle = "Please Wait...";
-!(BX)        XmNwidth = 409;
-!(BX)        XmNheight = 93;
-!(BX)    };
-!(BX)    controls {
-!(BX)         managed XmBulletinBoardDialog bulletinBoard_mbeditviz_message;
-!(BX)    };
-!(BX)    callbacks {
-!(BX)        callbacks Style_useReasons;
-!(BX)        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_dialogShell_mbeditviz_message);
-!(BX)    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-!(BX)};
-
-object pushButton_about_dismiss : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Dismiss");
-        XmNx = 170;
-        XmNy = 470;
-        XmNwidth = 120;
-        XmNheight = 50;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNactivateCallback = procedure BxUnmanageCB("bulletinBoard_about");
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object label_about_title : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNfontList = font_table(
-		font('-*-times-bold-r-*-*-*-180-*-*-*-*-iso8859-1',character_set=character_set('TimesBold18')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')));
-        XmNlabelString = compound_string(#character_set("TimesBold24")"MBe" &
- "ditviz") &
- compound_string("", separate=true) &
- compound_string(#character_set("TimesBold18")"Swath Bathymetry Editing", separate=true) &
- compound_string(#character_set("TimesBold18")"and", separate=true) &
- compound_string(#character_set("TimesBold18")"Patch Test Tool");
-        XmNx = 10;
-        XmNy = 10;
-        XmNwidth = 440;
-        XmNheight = 90;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object separator1 : XmSeparator widget {
-    arguments {
-        arguments Style_use;
-        XmNx = 10;
-        XmNy = 100;
-        XmNwidth = 440;
-        XmNheight = 20;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object label_about_mbsystem : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNfontList = font_table(
-		font('-*-times-bold-r-*-*-*-140-*-*-*-*-iso8859-1',character_set=character_set('TimesBold14')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')));
-        XmNlabelString = compound_string(#character_set("TimesBold14")"One" &
- " component of the", separate=true) &
- compound_string(#character_set("T" &
- "imesBold24")"MB-System") &
- compound_string(#character_set("TimesBold14")"", separate=true) &
- compound_string(#character_set("TimesBold14")"An open Source Software Package", separate=true) &
- compound_string(#character_set("TimesBold14")"for Processing and Display", separate=true) &
- compound_string(#character_set("TimesBold14")"of Swath Sonar Data");
-        XmNx = 10;
-        XmNy = 120;
-        XmNwidth = 440;
-        XmNheight = 140;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object separator3 : XmSeparator widget {
-    arguments {
-        arguments Style_use;
-        XmNx = 10;
-        XmNy = 260;
-        XmNwidth = 440;
-        XmNheight = 20;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object label_about_LDEO : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNfontList = font_table(
-		font('-*-times-bold-r-*-*-*-140-*-*-*-*-iso8859-1',character_set=character_set('TimesBold14')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-120-*-*-*-*-iso8859-1',character_set=character_set('TimesBold12')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-120-*-*-*-*-iso8859-1',character_set=character_set('TimesBold12')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-120-*-*-*-*-iso8859-1',character_set=character_set('TimesBold12')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-120-*-*-*-*-iso8859-1',character_set=character_set('TimesBold12')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-120-*-*-*-*-iso8859-1',character_set=character_set('TimesBold12')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-120-*-*-*-*-iso8859-1',character_set=character_set('TimesBold12')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-120-*-*-*-*-iso8859-1',character_set=character_set('TimesBold12')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-120-*-*-*-*-iso8859-1',character_set=character_set('TimesBold12')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-120-*-*-*-*-iso8859-1',character_set=character_set('TimesBold12')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-120-*-*-*-*-iso8859-1',character_set=character_set('TimesBold12')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-120-*-*-*-*-iso8859-1',character_set=character_set('TimesBold12')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-120-*-*-*-*-iso8859-1',character_set=character_set('TimesBold12')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-120-*-*-*-*-iso8859-1',character_set=character_set('TimesBold12')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-120-*-*-*-*-iso8859-1',character_set=character_set('TimesBold12')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-120-*-*-*-*-iso8859-1',character_set=character_set('TimesBold12')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-120-*-*-*-*-iso8859-1',character_set=character_set('TimesBold12')));
-        XmNlabelString = compound_string(#character_set("TimesBold12")"Lam" &
- "ont-Doherty", separate=true) &
- compound_string(#character_set("T" &
- "imesBold12")"Earth Observatory", separate=true) &
- compound_string(#character_set("TimesBold12")"of Columbia University");
-        XmNx = 230;
-        XmNy = 340;
-        XmNwidth = 180;
-        XmNheight = 80;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object label_about_MBARI : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNfontList = font_table(
-		font('-*-times-bold-r-*-*-*-140-*-*-*-*-iso8859-1',character_set=character_set('TimesBold14')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-120-*-*-*-*-iso8859-1',character_set=character_set('TimesBold12')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-120-*-*-*-*-iso8859-1',character_set=character_set('TimesBold12')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-120-*-*-*-*-iso8859-1',character_set=character_set('TimesBold12')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-120-*-*-*-*-iso8859-1',character_set=character_set('TimesBold12')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-120-*-*-*-*-iso8859-1',character_set=character_set('TimesBold12')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-120-*-*-*-*-iso8859-1',character_set=character_set('TimesBold12')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-120-*-*-*-*-iso8859-1',character_set=character_set('TimesBold12')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-120-*-*-*-*-iso8859-1',character_set=character_set('TimesBold12')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-120-*-*-*-*-iso8859-1',character_set=character_set('TimesBold12')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-120-*-*-*-*-iso8859-1',character_set=character_set('TimesBold12')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-120-*-*-*-*-iso8859-1',character_set=character_set('TimesBold12')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-120-*-*-*-*-iso8859-1',character_set=character_set('TimesBold12')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-120-*-*-*-*-iso8859-1',character_set=character_set('TimesBold12')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-120-*-*-*-*-iso8859-1',character_set=character_set('TimesBold12')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-120-*-*-*-*-iso8859-1',character_set=character_set('TimesBold12')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-120-*-*-*-*-iso8859-1',character_set=character_set('TimesBold12')));
-        XmNlabelString = compound_string(#character_set("TimesBold12")"Mon" &
- "terey Bay", separate=true) &
- compound_string(#character_set("T" &
- "imesBold12")"Aquarium", separate=true) &
- compound_string(#character_set("TimesBold12")"Research Institute");
-        XmNx = 70;
-        XmNy = 340;
-        XmNwidth = 140;
-        XmNheight = 80;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object label_about_authors : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNfontList = font_table(
-		font('-*-times-bold-r-*-*-*-140-*-*-*-*-iso8859-1',character_set=character_set('TimesBold14')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-120-*-*-*-*-iso8859-1',character_set=character_set('TimesBold12')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-120-*-*-*-*-iso8859-1',character_set=character_set('TimesBold12')));
-        XmNlabelString = compound_string(#character_set("TimesBold14")"Cre" &
- "ated By:", separate=true) &
- compound_string(#character_set("T" &
- "imesBold14")"David W. Caress   and   Dale N. Chayes ");
-        XmNx = 10;
-        XmNy = 280;
-        XmNwidth = 440;
-        XmNheight = 60;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object label_about_version : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNfontList = font_table(
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-120-*-*-*-*-iso8859-1',character_set=character_set('TimesBold12')),
-		font('-*-times-bold-r-*-*-*-140-*-*-*-*-iso8859-1',character_set=character_set('TimesBold14')),
-		font('-*-times-medium-r-*-*-*-140-*-*-*-*-iso8859-1',character_set=character_set('TimesMedium14')),
-		font('-*-times-bold-r-*-*-*-120-*-*-*-*-iso8859-1',character_set=character_set('TimesBold12')),
-		font('-*-times-bold-r-*-*-*-140-*-*-*-*-iso8859-1',character_set=character_set('TimesBold14')),
-		font('-*-times-medium-r-*-*-*-140-*-*-*-*-iso8859-1',character_set=character_set('TimesMedium14')));
-        XmNlabelString = compound_string(#character_set("TimesMedium14")"M" &
- "B-System Release 5.0.8", separate=true) &
- compound_string(#character_set("T" &
- "imesMedium14")"February 2, 2006");
-        XmNrecomputeSize = false;
-        XmNx = 10;
-        XmNy = 410;
-        XmNwidth = 440;
-        XmNheight = 50;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_label_about_version);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object bulletinBoard_about : XmBulletinBoardDialog widget {
-    arguments {
-        arguments Style_use;
-        XmNresizePolicy = XmRESIZE_GROW;
-        XmNx = 1049;
-        XmNy = 1071;
-        XmNwidth = 463;
-        XmNheight = 531;
-    };
-    controls {
-         managed XmLabel label_about_version;
-         managed XmLabel label_about_authors;
-         managed XmLabel label_about_MBARI;
-         managed XmLabel label_about_LDEO;
-         managed XmSeparator separator3;
-         managed XmLabel label_about_mbsystem;
-         managed XmSeparator separator1;
-         managed XmLabel label_about_title;
-         managed XmPushButton pushButton_about_dismiss;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-!(BX)object dialogShell_about : XmDialogShell widget {
-!(BX)    arguments {
-!(BX)        arguments Style_use;
-!(BX)        XmNtitle = "About MBeditviz...";
-!(BX)        XmNwidth = 463;
-!(BX)        XmNheight = 531;
-!(BX)    };
-!(BX)    controls {
-!(BX)         managed XmBulletinBoardDialog bulletinBoard_about;
-!(BX)    };
-!(BX)    callbacks {
-!(BX)        callbacks Style_useReasons;
-!(BX)    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-!(BX)};
-
-object pushButton_openswath : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Open Swath Data");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_pushButton_openswath);
-       XmNactivateCallback = procedures {
-                 do_mbeditviz_fileSelectionBox_openswath();
-                 BxManageCB("form_open");
-        };
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object separator2 : XmSeparator widget {
-    arguments {
-        arguments Style_use;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object pushButton_quit : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Quit");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-       XmNactivateCallback = procedures {
-                 do_mbeditviz_quit();
-                 BxExitCB(0);
-        };
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object pulldownMenu_file : XmPulldownMenu widget {
-    arguments {
-        arguments Style_use;
-        XmNx = 185;
-        XmNy = 612;
-        XmNwidth = 132;
-        XmNheight = 54;
-    };
-    controls {
-         managed XmPushButton pushButton_openswath;
-         managed XmSeparator separator2;
-         managed XmPushButton pushButton_quit;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object cascadeButton_file : XmCascadeButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("File");
-        XmNx = 5;
-        XmNy = 5;
-        XmNwidth = 41;
-        XmNheight = 24;
-    };
-    controls {
-         unmanaged XmPulldownMenu pulldownMenu_file;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object pushButton_updategrid : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Generate New Grid");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_pushButton_updategrid);
-       XmNactivateCallback = procedures {
-                 BxManageCB("form_gridparameters");
-                 do_mbeditviz_regrid();
-        };
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object pulldownMenu_options : XmPulldownMenu widget {
-    arguments {
-        arguments Style_use;
-        XmNx = 0;
-        XmNy = 0;
-        XmNwidth = 142;
-        XmNheight = 28;
-    };
-    controls {
-         managed XmPushButton pushButton_updategrid;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object cascadeButton_options : XmCascadeButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Options");
-        XmNx = 46;
-        XmNy = 5;
-        XmNwidth = 72;
-        XmNheight = 24;
-    };
-    controls {
-         unmanaged XmPulldownMenu pulldownMenu_options;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object pushButton_help_about : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("About");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNactivateCallback = procedure BxManageCB("bulletinBoard_about");
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object pulldownMenu_help : XmPulldownMenu widget {
-    arguments {
-        arguments Style_use;
-        XmNx = 0;
-        XmNy = 0;
-        XmNwidth = 54;
-        XmNheight = 28;
-    };
-    controls {
-         managed XmPushButton pushButton_help_about;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object cascadeButton_help : XmCascadeButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Help");
-        XmNx = 401;
-        XmNy = 5;
-        XmNwidth = 47;
-        XmNheight = 24;
-    };
-    controls {
-         unmanaged XmPulldownMenu pulldownMenu_help;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object menuBar_mbeditviz : XmMenuBar widget {
-    arguments {
-        arguments Style_use;
-        XmNpacking = XmPACK_TIGHT;
-        XmNmenuHelpWidget = XmCascadeButton cascadeButton_help;
-        XmNwidth = 453;
-        XmNheight = 34;
-    };
-    controls {
-         managed XmCascadeButton cascadeButton_file;
-         managed XmCascadeButton cascadeButton_options;
-         managed XmCascadeButton cascadeButton_help;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object list_filelist : XmList widget {
-    arguments {
-        arguments Style_use;
-        XmNfontList = font_table(
-		font('-*-courier-*-r-*-*-*-90-*-*-*-*-iso8859-1'));
-        XmNselectionPolicy = XmEXTENDED_SELECT;
-        XmNwidth = 435;
-        XmNheight = 289;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_list_filelist);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object scrolledWindow_mbeditviz : XmScrolledWindow widget {
-    arguments {
-        arguments Style_use;
-        XmNscrollingPolicy = XmAPPLICATION_DEFINED;
-        XmNtopAttachment = XmATTACH_FORM;
-        XmNrightAttachment = XmATTACH_FORM;
-        XmNleftAttachment = XmATTACH_FORM;
-        XmNbottomAttachment = XmATTACH_FORM;
-        XmNbottomOffset = 14;
-        XmNleftOffset = 10;
-        XmNrightOffset = 8;
-        XmNtopOffset = 220;
-        XmNx = 10;
-        XmNy = 220;
-        XmNwidth = 435;
-        XmNheight = 289;
-    };
-    controls {
-         managed XmList list_filelist;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object label_filelist : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Swath Files:");
-        XmNrightAttachment = XmATTACH_FORM;
-        XmNleftAttachment = XmATTACH_FORM;
-        XmNleftOffset = 10;
-        XmNrightOffset = 8;
-        XmNtopOffset = 190;
-        XmNx = 10;
-        XmNy = 190;
-        XmNwidth = 435;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object pushButton_viewall : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("View", separate=true) &
- compound_string("All", separate=true) &
- compound_string("Files");
-        XmNrightAttachment = XmATTACH_NONE;
-        XmNleftAttachment = XmATTACH_WIDGET;
-        XmNleftOffset = 12;
-        XmNrightOffset = 0;
-        XmNtopOffset = 100;
-        XmNleftWidget = XmLabel label_mbeditviz_status;
-        XmNx = 220;
-        XmNy = 100;
-        XmNwidth = 70;
-        XmNheight = 70;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_pushButton_viewall);
-       XmNactivateCallback = procedures {
-                 do_mbeditviz_viewall();
-                 BxManageCB("form_gridparameters");
-        };
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object pushButton_viewselected : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("View", separate=true) &
- compound_string("Selected", separate=true) &
- compound_string("Files");
-        XmNrightAttachment = XmATTACH_NONE;
-        XmNleftAttachment = XmATTACH_WIDGET;
-        XmNleftOffset = 6;
-        XmNtopOffset = 100;
-        XmNleftWidget = XmPushButton pushButton_viewall;
-        XmNx = 296;
-        XmNy = 100;
-        XmNwidth = 70;
-        XmNheight = 70;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_pushButton_viewselected);
-       XmNactivateCallback = procedures {
-                 do_mbeditviz_viewselected();
-                 BxManageCB("form_gridparameters");
-        };
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object pushButton_deleteselected : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Remove", separate=true) &
- compound_string("Selected", separate=true) &
- compound_string("Files");
-        XmNrightAttachment = XmATTACH_NONE;
-        XmNleftAttachment = XmATTACH_WIDGET;
-        XmNleftOffset = 10;
-        XmNtopOffset = 100;
-        XmNleftWidget = XmPushButton pushButton_viewselected;
-        XmNx = 376;
-        XmNy = 100;
-        XmNwidth = 70;
-        XmNheight = 70;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_pushButton_deleteselected);
-        XmNactivateCallback = procedure do_mbeditviz_deleteselected();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object toggleButton_mode_edit : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Edit Bathymetry");
-        XmNwidth = 138;
-        XmNheight = 28;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_toggleButton_mode_edit);
-        XmNvalueChangedCallback = procedure do_mbeditviz_mode_change();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object toggleButton_mode_browse : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Browse Only");
-        XmNwidth = 138;
-        XmNheight = 28;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_toggleButton_mode_browse);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object radioBox_programmode : XmRadioBox widget {
-    arguments {
-        arguments Style_use;
-        XmNrightAttachment = XmATTACH_NONE;
-        XmNleftAttachment = XmATTACH_FORM;
-        XmNleftOffset = 260;
-        XmNtopOffset = 30;
-        XmNx = 260;
-        XmNy = 30;
-        XmNwidth = 144;
-        XmNheight = 65;
-    };
-    controls {
-         managed XmToggleButton toggleButton_mode_edit;
-         managed XmToggleButton toggleButton_mode_browse;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object label_programmode : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Mode:");
-        XmNtopAttachment = XmATTACH_FORM;
-        XmNrightAttachment = XmATTACH_FORM;
-        XmNleftAttachment = XmATTACH_NONE;
-        XmNbottomAttachment = XmATTACH_NONE;
-        XmNbottomOffset = 0;
-        XmNrightOffset = 43;
-        XmNtopOffset = 0;
-        XmNx = 260;
-        XmNy = 0;
-        XmNwidth = 150;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object label_mbeditviz_status : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNborderWidth = 1;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNbackground = color('white');
-        XmNborderColor = color('black');
-        XmNlabelString = compound_string("Available Files: 0", separate=true) &
- compound_string("Loaded Files: 0", separate=true) &
- compound_string("Grid Bounds:", separate=true) &
- compound_string("     Longitude: 0.00 0.00", separate=true) &
- compound_string("     Latitude: 0.00 0.00", separate=true) &
- compound_string("Grid Spacing: 10.0 m", separate=true) &
- compound_string("Mode: Edit Bathymetry");
-        XmNrecomputeSize = false;
-        XmNrightAttachment = XmATTACH_FORM;
-        XmNleftAttachment = XmATTACH_FORM;
-        XmNleftOffset = 10;
-        XmNrightOffset = 245;
-        XmNtopOffset = 30;
-        XmNx = 10;
-        XmNy = 30;
-        XmNwidth = 196;
-        XmNheight = 150;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_label_mbeditviz_status);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object label_status : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Status:");
-        XmNrightAttachment = XmATTACH_FORM;
-        XmNleftAttachment = XmATTACH_FORM;
-        XmNleftOffset = 0;
-        XmNrightOffset = 243;
-        XmNtopOffset = 0;
-        XmNx = 0;
-        XmNy = 0;
-        XmNwidth = 210;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object form_mbeditviz : XmForm widget {
-    arguments {
-        arguments Style_use;
-        XmNresizePolicy = XmRESIZE_GROW;
-        XmNwidth = 453;
-        XmNheight = 523;
-    };
-    controls {
-         managed XmLabel label_status;
-         managed XmLabel label_mbeditviz_status;
-         managed XmLabel label_programmode;
-         managed XmRadioBox radioBox_programmode;
-         managed XmPushButton pushButton_deleteselected;
-         managed XmPushButton pushButton_viewselected;
-         managed XmPushButton pushButton_viewall;
-         managed XmLabel label_filelist;
-         managed XmScrolledWindow scrolledWindow_mbeditviz;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mainWindow_mbeditviz : XmMainWindow widget {
-    arguments {
-        arguments Style_use;
-        XmNx = 180;
-        XmNy = 583;
-        XmNwidth = 453;
-        XmNheight = 557;
-    };
-    controls {
-        Xm_Separator1 {
-            arguments {
-                arguments Style_use;
-            };
-            callbacks {
-                    callbacks Style_useReasons;
-            };
-!(BX)            handlers {
-!(BX)                handlers Style_useHandlers;
-!(BX)            };
-        };
-        Xm_Separator2 {
-            arguments {
-                arguments Style_use;
-            };
-            callbacks {
-                    callbacks Style_useReasons;
-            };
-!(BX)            handlers {
-!(BX)                handlers Style_useHandlers;
-!(BX)            };
-        };
-        Xm_Separator3 {
-            arguments {
-                arguments Style_use;
-            };
-            callbacks {
-                    callbacks Style_useReasons;
-            };
-!(BX)            handlers {
-!(BX)                handlers Style_useHandlers;
-!(BX)            };
-        };
-!(BX)         unmanaged XmDialogShell dialogShell_error;
-!(BX)         unmanaged XmDialogShell dialogShell_gridparameters;
-!(BX)         unmanaged XmDialogShell dialogShell_open;
-!(BX)         unmanaged XmDialogShell dialogShell_mbeditviz_message;
-!(BX)         unmanaged XmDialogShell dialogShell_about;
-         managed XmMenuBar menuBar_mbeditviz;
-         managed XmForm form_mbeditviz;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-       XmNdestroyCallback = procedures {
-                 do_mbeditviz_quit();
-                 BxExitCB(0);
-        };
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-!(BX)object topLevelShell : TopLevelShell widget {
-!(BX)    arguments {
-!(BX)        arguments Style_use;
-!(BX)        XmNtitle = "MBeditviz";
-!(BX)        XmNx = 180;
-!(BX)        XmNy = 583;
-!(BX)        XmNwidth = 453;
-!(BX)        XmNheight = 557;
-!(BX)    };
-!(BX)    controls {
-!(BX)         managed XmMainWindow mainWindow_mbeditviz;
-!(BX)    };
-!(BX)    callbacks {
-!(BX)        callbacks Style_useReasons;
-!(BX)       XmNdestroyCallback = procedures {
-!(BX)                 do_mbeditviz_quit();
-!(BX)                 BxExitCB(0);
-!(BX)        };
-!(BX)    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-!(BX)};
-end module;
diff --git a/src/mbeditviz/mbeditviz_callbacks.c b/src/mbeditviz/mbeditviz_callbacks.c
deleted file mode 100644
index a62771c..0000000
--- a/src/mbeditviz/mbeditviz_callbacks.c
+++ /dev/null
@@ -1,2362 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbeditviz_callbacks.c		4/27/2007
- *    $Id: mbeditviz_callbacks.c 2247 2015-05-29 21:28:28Z caress $
- *
- *    Copyright (c) 2007-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- *
- * MBeditviz is an interactive swath bathymetry editor and patch
- * test tool for  MB-System.
- * It can work with any data format supported by the MBIO library.
- * This include file contains global control parameters shared with
- * the Motif interface code.
- *
- * Author:	D. W. Caress
- * Date:	April 27, 2007
- *
- *
- */
-
-/**
- * README: This file is appended to at file generation time.
- * Edits can be made throughout the file
- */
-/*
- * Generated by the ICS Builder Xcessory (BX).
- *
- * BuilderXcessory Version 6.1.3
- * Code Generator Xcessory 6.1.3 (08/19/04) CGX Scripts 6.1 Motif 2.1
- *
- */
-#include <Xm/Xm.h>
-
-
-/*
- * Standard includes for builtins.
- */
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include <math.h>
-#include <unistd.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-
-/* MBIO include files */
-#include "mb_status.h"
-#include "mb_define.h"
-#include "mb_format.h"
-#include "mbsys_singlebeam.h"
-
-/* mbview include file */
-#include "mbview.h"
-#include "mbeditviz.h"
-
-/* fileSelectionBox modes */
-#define MBEDITVIZ_OPENSWATH		1
-
-/* Projection defines */
-#define ModelTypeProjected	     1
-#define ModelTypeGeographic	     2
-#define GCS_WGS_84		  4326
-
-/* widgets */
-static XtAppContext	app;
-static Widget	parent;
-static int	mbview_id[MBV_MAX_WINDOWS];
-static Widget	fileSelectionList;
-static Widget	fileSelectionText;
-int		mformat;
-static Cardinal ac;
-static Arg      args[256];
-static char	value_text[MB_PATH_MAXLINE];
-
-/*
- * Motif required Headers
- */
-#include <X11/StringDefs.h>
-#include <Xm/Xm.h>
-#include <Xm/DialogS.h>
-#include <Xm/Text.h>
-#include <Xm/FileSB.h>
-#include <Xm/ToggleB.h>
-#include <Xm/List.h>
-#if (XmVersion >= 1002)
-#include <Xm/RepType.h>
-#endif
-#include <Xm/MwmUtil.h>
-#include "mbeditviz_creation.h"
-
-/*
- * Macros to make code look nicer between ANSI and K&R.
- */
-#ifndef ARGLIST
-#if (NeedFunctionPrototypes == 0)
-#define PROTOTYPE(p)	()
-#define ARGLIST(p)	p
-#define ARG(a, b)	a b;
-#define GRA(a, b)	a b;
-#define UARG(a, b)      a b;
-#define GRAU(a, b)      a b;
-#else
-#define PROTOTYPE(p)	p
-#define ARGLIST(p)	(
-#define ARG(a, b)	a b,
-#define GRA(a, b)	a b)
-#ifdef __cplusplus
-#define UARG(a, b)      a,
-#define GRAU(a, b)      a)
-#else
-#define UARG(a, b)      a b,
-#define GRAU(a, b)      a b)
-#endif
-#endif
-#endif
-
-Widget		BxFindTopShell PROTOTYPE((Widget));
-WidgetList	BxWidgetIdsFromNames PROTOTYPE((Widget, char*, char*));
-
-
-/*---------------------------------------------------------------------------------------*/
-/*      Function Name: 	BxManageCB
- *
- *      Description:   	Given a string of the form:
- *		       	"(WL)[widgetName, widgetName, ...]"
- *			BxManageCB attempts to convert the name to a Widget
- *			ID and manage the widget.
- *
- *      Arguments:     	Widget	    w:      the widget activating the callback.
- *		       	XtPointer   client: the list of widget names to attempt
- *					    to find and manage.
- *		       	XtPointer   call:   the call data (unused).
- *
- *      Notes:        *	This function expects that there is an application
- *		       	shell from which all other widgets are descended.
- */
-
-/* ARGSUSED */
-void
-BxManageCB ARGLIST((w, client, call))
-ARG( Widget, w)
-ARG( XtPointer, client)
-GRAU( XtPointer, call)
-{
-    WidgetList		widgets;
-    int			i;
-
-    /*
-     * This function returns a NULL terminated WidgetList.  The memory for
-     * the list needs to be freed when it is no longer needed.
-     */
-    widgets = BxWidgetIdsFromNames(w, "BxManageCB", (String)client);
-
-    i = 0;
-    while( widgets && widgets[i] != NULL )
-    {
-	XtManageChild(widgets[i]);
-	i++;
-    }
-    XtFree((char *)widgets);
-}
-
-/*---------------------------------------------------------------------------------------*/
-/*      Function Name: 	BxUnmanageCB
- *
- *      Description:   	Given a string of the form:
- *		       	"(WL)[widgetName, widgetName, ...]"
- *			BxUnmanageCB attempts to convert the name to a Widget
- *			ID and unmanage the widget.
- *
- *      Arguments:     	Widget	    w:      the widget activating the callback.
- *		       	XtPointer   client: the list of widget names to attempt
- *					    to find and unmanage.
- *		       	XtPointer   call:   the call data (unused).
- *
- *      Notes:        *	This function expects that there is an application
- *		       	shell from which all other widgets are descended.
- */
-
-/* ARGSUSED */
-void
-BxUnmanageCB ARGLIST((w, client, call))
-ARG( Widget, w)
-ARG( XtPointer, client)
-GRAU( XtPointer, call)
-{
-    WidgetList		widgets;
-    int			i;
-
-    /*
-     * This function returns a NULL terminated WidgetList.  The memory for
-     * the list needs to be freed when it is no longer needed.
-     */
-    widgets = BxWidgetIdsFromNames(w, "BxUnmanageCB", (String)client);
-
-    i = 0;
-    while( widgets && widgets[i] != NULL )
-    {
-	XtUnmanageChild(widgets[i]);
-	i++;
-    }
-    XtFree((char *)widgets);
-}
-
-/*---------------------------------------------------------------------------------------*/
-/*      Function Name:	BxExitCB
- *
- *      Description:   	This functions expects an integer to be passed in
- *		       	client data.  It calls the exit() system call with
- *			the integer value as the argument to the function.
- *
- *      Arguments:      Widget		w: 	the activating widget.
- *			XtPointer	client:	the integer exit value.
- *			XtPointer	call:	the call data (unused).
- */
-
-#ifdef VMS
-#include <stdlib.h>
-#endif
-
-/* ARGSUSED */
-void
-BxExitCB ARGLIST((w, client, call))
-UARG( Widget, w)
-ARG( XtPointer, client)
-GRAU( XtPointer, call)
-{
-    long	exitValue = EXIT_FAILURE;
-    exit(exitValue);
-}
-
-/*---------------------------------------------------------------------------------------*/
-
-int do_mbeditviz_init(Widget parentwidget, XtAppContext appcon)
-{
-	char function_name[] = "do_mbeditviz_init";
-	int	i;
-
-	/* print input debug statements */
-	if (mbev_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       mbev_verbose:   %d\n",mbev_verbose);
-		fprintf(stderr,"dbg2       parentwidget:   %p\n",parentwidget);
-		fprintf(stderr,"dbg2       appcon:         %p\n",appcon);
-		}
-
-	parent = parentwidget;
-	app = appcon;
-	mbev_message_on = MB_NO;
-
-if (mbev_verbose > 0)
-fprintf(stderr,"do_mbeditviz_init\n");
-
-	/* set about version label */
-	sprintf(value_text, "::#TimesMedium14:t\"MB-System Release %s\"#TimesMedium14\"%s\"",
-		MB_VERSION, MB_BUILD_DATE);
-	set_mbview_label_multiline_string(label_about_version, value_text);
-
-	/* set file selection widgets */
-	fileSelectionList = (Widget)
-	    XmFileSelectionBoxGetChild(fileSelectionBox,
-					XmDIALOG_LIST);
-	fileSelectionText = (Widget)
-	    XmFileSelectionBoxGetChild(fileSelectionBox,
-					XmDIALOG_TEXT);
-	XtAddCallback(fileSelectionList,
-		XmNbrowseSelectionCallback,
-		do_mbeditviz_fileselection_list, NULL);
-	XtUnmanageChild(
-		(Widget) XmFileSelectionBoxGetChild(
-					fileSelectionBox,
-					XmDIALOG_HELP_BUTTON));
-	mformat = -1;
-	sprintf(value_text,"%d",mformat);
-	XmTextSetString(
-	    text_format,
-	    value_text);
-
-	/* set the output mode */
-	if (mbev_mode_output == MBEV_OUTPUT_MODE_EDIT)
-	    {
-	    XmToggleButtonSetState(toggleButton_mode_edit,
-			TRUE, FALSE);
-	    XmToggleButtonSetState(toggleButton_mode_browse,
-			FALSE, FALSE);
-	    XmToggleButtonSetState(toggleButton_openmodeedit,
-			TRUE, FALSE);
-	    XmToggleButtonSetState(toggleButton_openmodebrowse,
-			FALSE, FALSE);
-	    }
-	else
-	    {
-	    XmToggleButtonSetState(toggleButton_mode_edit,
-			FALSE, FALSE);
-	    XmToggleButtonSetState(toggleButton_mode_browse,
-			TRUE, FALSE);
-	    XmToggleButtonSetState(toggleButton_openmodeedit,
-			FALSE, FALSE);
-	    XmToggleButtonSetState(toggleButton_openmodebrowse,
-			TRUE, FALSE);
-	    }
-
-	/* initialize mbview_id list */
-	for (i=0;i<MBV_MAX_WINDOWS;i++)
-	    {
-	    mbview_id[i] = MB_NO;
-	    }
-
-	/* set sensitivity of widgets that require an mbview instance to be active */
-	do_mbeditviz_update_gui( );
-
-	/* set timer for function to keep updating the filelist */
-	timer_function_set = MB_NO;
-	do_mbeditviz_settimer();
-
-if (mbev_verbose > 0)
-fprintf(stderr,"return do_mbeditviz_init status:%d\n", mbev_status);
-
-	return(0);
-}
-/*---------------------------------------------------------------------------------------*/
-
-void
-do_mbeditviz_mode_change( Widget w, XtPointer client_data, XtPointer call_data)
-{
-	char function_name[] = "do_mbeditviz_mode_change";
-	XmToggleButtonCallbackStruct *acs;
-	acs = (XmToggleButtonCallbackStruct*)call_data;
-
-	/* print input debug statements */
-	if (mbev_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       w:           %p\n",w);
-		fprintf(stderr,"dbg2       client_data: %p\n",client_data);
-		fprintf(stderr,"dbg2       call_data:   %p\n",call_data);
-		}
-
-if (mbev_verbose > 0)
-fprintf(stderr,"do_mbeditviz_mode_change\n");
-
-    /* set values if needed */
-    if (acs->reason == XmCR_VALUE_CHANGED)
-	    {
-	    if (acs->set)
-	    	mbev_mode_output = MBEV_OUTPUT_MODE_EDIT;
-	    else
-	    	mbev_mode_output = MBEV_OUTPUT_MODE_BROWSE;
-	    if (mbev_mode_output == MBEV_OUTPUT_MODE_EDIT)
-		    {
-		    XmToggleButtonSetState(toggleButton_mode_edit,
-			     TRUE, FALSE);
-		    XmToggleButtonSetState(toggleButton_mode_browse,
-			     FALSE, FALSE);
-		    XmToggleButtonSetState(toggleButton_openmodeedit,
-			     TRUE, FALSE);
-		    XmToggleButtonSetState(toggleButton_openmodebrowse,
-			     FALSE, FALSE);
-		    }
-	    else
-		    {
-		    XmToggleButtonSetState(toggleButton_mode_edit,
-			     FALSE, FALSE);
-		    XmToggleButtonSetState(toggleButton_mode_browse,
-			     TRUE, FALSE);
-		    XmToggleButtonSetState(toggleButton_openmodeedit,
-			     FALSE, FALSE);
-		    XmToggleButtonSetState(toggleButton_openmodebrowse,
-			     TRUE, FALSE);
-		    }
-if (mbev_verbose > 0)
-fprintf(stderr,"acs->set:%d mode:%d\n",acs->set,mbev_mode_output);
-	    }
-
-if (mbev_verbose > 0)
-fprintf(stderr,"return do_mbeditviz_mode_change status:%d\n", mbev_status);
-
-}
-
-/*---------------------------------------------------------------------------------------*/
-void
-do_mbeditviz_openfile( Widget w, XtPointer client_data, XtPointer call_data)
-{
-	char function_name[] = "do_mbeditviz_openfile";
-	XmFileSelectionBoxCallbackStruct *acs;
-	acs = (XmFileSelectionBoxCallbackStruct*)call_data;
-	char    *file_ptr;
-	int	format;
-
-	/* print input debug statements */
-	if (mbev_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       w:           %p\n",w);
-		fprintf(stderr,"dbg2       client_data: %p\n",client_data);
-		fprintf(stderr,"dbg2       call_data:   %p\n",call_data);
-		}
-
-if (mbev_verbose > 0)
-if (mbev_verbose > 0)
-fprintf(stderr,"do_mbeditviz_openfile\n");
-	/* read the mbio format number */
-	get_text_string(text_format, value_text);
-	sscanf(value_text, "%d", &format);
-
-	/* read the input file name */
-	XmStringGetLtoR(acs->value, XmSTRING_DEFAULT_CHARSET,
-			&file_ptr);
-	if (strlen(file_ptr) <= 0 && file_ptr != NULL)
-		{
-		XtFree(file_ptr);
-		file_ptr = NULL;
-		}
-
-	/* open data */
-	mbev_status = do_mbeditviz_opendata(file_ptr, format);
-
-if (mbev_verbose > 0)
-fprintf(stderr,"return do_mbeditviz_openfile status:%d\n", mbev_status);
-}
-
-/*---------------------------------------------------------------------------------------*/
-void
-do_mbeditviz_fileselection_list( Widget w, XtPointer client_data, XtPointer call_data)
-{
-	char function_name[] = "do_mbeditviz_fileselection_list";
-	XmAnyCallbackStruct *acs;
-	acs = (XmAnyCallbackStruct*)call_data;
-
-	/* print input debug statements */
-	if (mbev_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       w:           %p\n",w);
-		fprintf(stderr,"dbg2       client_data: %p\n",client_data);
-		fprintf(stderr,"dbg2       call_data:   %p\n",call_data);
-		}
-
-if (mbev_verbose > 0)
-fprintf(stderr,"do_mbeditviz_fileselection_list\n");
-
-    static char selection_text[128];
-    int	form;
-    char value_text[10];
-
-    /* get selected text */
-    get_text_string(fileSelectionText, (String) selection_text);
-
-    /* get output file */
-    if((int)strlen(selection_text) > 0)
-	    {
-	    /* look for MB suffix convention */
-	    form = mformat;
-	    if ((mbev_status = mbeditviz_get_format(selection_text,
-			    &form)) == MB_SUCCESS)
-		{
-		mformat = form;
-		sprintf(value_text,"%d",mformat);
-		XmTextSetString(
-		    text_format,
-		    value_text);
-		}
-	    }
-if (mbev_verbose > 0)
-fprintf(stderr,"return do_mbeditviz_fileselection_list status:%d\n", mbev_status);
-}
-/*---------------------------------------------------------------------------------------*/
-void
-do_mbeditviz_fileSelectionBox_openswath( Widget w, XtPointer client_data, XtPointer call_data)
-{
-	char function_name[] = "do_mbeditviz_fileSelectionBox_openswath";
-	XmAnyCallbackStruct *acs;
-    XmString	tmp0;
-	Boolean	argok;
-	acs = (XmAnyCallbackStruct*)call_data;
-
-	/* print input debug statements */
-	if (mbev_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       w:           %p\n",w);
-		fprintf(stderr,"dbg2       client_data: %p\n",client_data);
-		fprintf(stderr,"dbg2       call_data:   %p\n",call_data);
-		}
-
-if (mbev_verbose > 0)
-fprintf(stderr,"do_mbeditviz_fileSelectionBox_openswath\n");
-
-	/* set title to open swath data */
-	ac = 0;
-	XtSetArg(args[ac], XmNtitle, "Open Swath Data"); ac++;
-	XtSetValues(dialogShell_open, args, ac);
-	BxManageCB(w, (XtPointer)"fileSelectionBox", call_data);
-
-
-	/* set filter */
-	ac = 0;
-	tmp0 = (XmString) BX_CONVERT(dialogShell_open, "*.mb*",
-                				XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNpattern, tmp0); ac++;
-	XtSetValues(fileSelectionBox, args, ac);
-        XmStringFree((XmString)tmp0);
-if (mbev_verbose > 0)
-fprintf(stderr,"return do_mbeditviz_fileSelectionBox_openswath status:%d\n", mbev_status);
-
-}
-
-/*---------------------------------------------------------------------------------------*/
-void
-do_mbeditviz_quit( Widget w, XtPointer client_data, XtPointer call_data)
-{
-	char function_name[] = "do_mbeditviz_quit";
-	XmAnyCallbackStruct *acs;
-	acs = (XmAnyCallbackStruct*)call_data;
-	struct mbev_file_struct *file;
-	int	ifile;
-
-	/* print input debug statements */
-	if (mbev_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       w:           %p\n",w);
-		fprintf(stderr,"dbg2       client_data: %p\n",client_data);
-		fprintf(stderr,"dbg2       call_data:   %p\n",call_data);
-		}
-
-if (mbev_verbose > 0)
-fprintf(stderr,"do_mbeditviz_quit\n");
-	do_mbeditviz_message_on("Shutting down...");
-
-	/* destroy any mbview window */
-	if (mbev_grid.status == MBEV_GRID_VIEWED)
-		{
-		/* destroy any mb3dsoundings window */
-		mbev_status = mb3dsoundings_end(mbev_verbose, &mbev_error);
-		mbeditviz_mb3dsoundings_dismiss();
-
-		mbev_status = mbview_destroy(mbev_verbose, 0, MB_YES, &mbev_error);
-		mbev_grid.status = MBEV_GRID_NOTVIEWED;
-		}
-
-	/* destroy the grid */
-	if (mbev_grid.status != MBEV_GRID_NONE)
-		mbeditviz_destroy_grid();
-
-	/* loop over all files to be sure all files are unloaded */
-	for (ifile=0;ifile<mbev_num_files;ifile++)
-		{
-		file = &(mbev_files[ifile]);
-		if (file->load_status == MB_YES)
-			{
-			mbeditviz_unload_file(ifile);
-			}
-		}
-
-	/* reset the gui */
-	do_mbeditviz_update_gui();
-	do_mbeditviz_message_off();
-
-if (mbev_verbose > 0)
-fprintf(stderr,"return do_mbeditviz_quit status:%d\n", mbev_status);
-
-}
-
-/*---------------------------------------------------------------------------------------*/
-void
-do_mbeditviz_viewall( Widget w, XtPointer client_data, XtPointer call_data)
-{
-	char function_name[] = "do_mbeditviz_viewall";
-	XmAnyCallbackStruct *acs;
-	acs = (XmAnyCallbackStruct*)call_data;
-	struct mbev_file_struct *file;
-	int	ifile;
-	int	loadcount;
-
-	/* print input debug statements */
-	if (mbev_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       w:           %p\n",w);
-		fprintf(stderr,"dbg2       client_data: %p\n",client_data);
-		fprintf(stderr,"dbg2       call_data:   %p\n",call_data);
-		}
-
-if (mbev_verbose > 0)
-fprintf(stderr,"do_mbeditviz_viewall\n");
-
-	/* destroy any mbview window */
-	if (mbev_grid.status == MBEV_GRID_VIEWED)
-		{
-		/* destroy any mb3dsoundings window */
-		mbev_status = mb3dsoundings_end(mbev_verbose, &mbev_error);
-		mbeditviz_mb3dsoundings_dismiss();
-
-		mbev_status = mbview_destroy(mbev_verbose, 0, MB_YES, &mbev_error);
-		mbev_grid.status = MBEV_GRID_NOTVIEWED;
-if (mbev_verbose > 0)
-fprintf(stderr,"do_mbeditviz_viewall destroyed previous windows\n");
-		}
-
-	/* destroy old grid */
-	if (mbev_grid.status != MBEV_GRID_NONE)
-		{
-		mbeditviz_destroy_grid();
-if (mbev_verbose > 0)
-fprintf(stderr,"do_mbeditviz_viewall destroyed old grid\n");
-		}
-
-	/* loop over all files to be sure all files are loaded */
-if (mbev_verbose > 0)
-fprintf(stderr,"do_mbeditviz_viewall loading files...\n");
-	do_mbeditviz_message_on("Loading files...");
-	loadcount = 0;
-	for (ifile=0;ifile<mbev_num_files;ifile++)
-		{
-if (mbev_verbose > 0)
-fprintf(stderr,"do_mbeditviz_viewall loading file %d\n",ifile);
-		file = &(mbev_files[ifile]);
-		if (file->load_status == MB_NO)
-			{
-			sprintf(value_text, "Loading file %d of %d...", ifile+1, mbev_num_files);
-			do_mbeditviz_message_on(value_text);
-if (mbev_verbose > 0)
-fprintf(stderr,"do_mbeditviz_viewall loading file %d of %d...\n", ifile+1, mbev_num_files);
-			mbeditviz_load_file(ifile);
-			}
-		loadcount++;
-if (mbev_verbose > 0)
-fprintf(stderr,"do_mbeditviz_viewall mbev_status:%d loadcount:%d\n",mbev_status,loadcount);
-		}
-	do_mbeditviz_message_off();
-
-	/* put up dialog on grid parameters */
-if (mbev_verbose > 0)
-fprintf(stderr,"do_mbeditviz_viewall mbev_status:%d loadcount:%d\n",mbev_status,loadcount);
-	if (mbev_status == MB_SUCCESS && loadcount > 0)
-		{
-if (mbev_verbose > 0)
-fprintf(stderr,"do_mbeditviz_viewall calling do_mbeditviz_gridparameters\n");
-		do_mbeditviz_gridparameters(w, client_data, call_data);
-		}
-	else
-		{
-		XBell(XtDisplay(list_filelist),100);
-		}
-
-	/* reset the gui */
-if (mbev_verbose > 0)
-fprintf(stderr,"do_mbeditviz_viewall calling do_mbeditviz_update_gui\n");
-	do_mbeditviz_update_gui();
-
-if (mbev_verbose > 0)
-fprintf(stderr,"return do_mbeditviz_viewall status:%d\n", mbev_status);
-}
-
-/*---------------------------------------------------------------------------------------*/
-void
-do_mbeditviz_viewselected( Widget w, XtPointer client_data, XtPointer call_data)
-{
-	char function_name[] = "do_mbeditviz_viewselected";
-	XmAnyCallbackStruct *acs;
-	acs = (XmAnyCallbackStruct*)call_data;
-	struct mbev_file_struct *file;
-	int	*position_list = NULL;
-	int position_count = 0;
-	int	selected;
-	int	ifile;
-	int	loadcount;
-	int	i;
-
-	/* print input debug statements */
-	if (mbev_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       w:           %p\n",w);
-		fprintf(stderr,"dbg2       client_data: %p\n",client_data);
-		fprintf(stderr,"dbg2       call_data:   %p\n",call_data);
-		}
-
-if (mbev_verbose > 0)
-fprintf(stderr,"do_mbeditviz_viewselected\n");
-
-	/* destroy any mbview window */
-	if (mbev_grid.status == MBEV_GRID_VIEWED)
-		{
-		/* destroy any mb3dsoundings window */
-		mbev_status = mb3dsoundings_end(mbev_verbose, &mbev_error);
-		mbeditviz_mb3dsoundings_dismiss();
-
-		mbev_status = mbview_destroy(mbev_verbose, 0, MB_YES, &mbev_error);
-		mbev_grid.status = MBEV_GRID_NOTVIEWED;
-		}
-
-	/* destroy old grid */
-	if (mbev_grid.status != MBEV_GRID_NONE)
-		mbeditviz_destroy_grid();
-
-	/* get positions of selected list items */
-	ac = 0;
-	XtSetArg(args[ac], XmNselectedPositionCount, (XtPointer) &position_count); ac++;
-	XtSetArg(args[ac], XmNselectedPositions, (XtPointer) &position_list); ac++;
-	XtGetValues(list_filelist, args, ac);
-if (mbev_verbose > 0)
-{
-fprintf(stderr,"position_count:%d\n",position_count);
-for(i=0;i<position_count;i++)
-fprintf(stderr,"  %d %d\n",i,position_list[i]);
-}
-
-	/* loop over all files to be sure selected files are loaded */
-	do_mbeditviz_message_on("Loading files...");
-	loadcount = 0;
-	for (ifile=0;ifile<mbev_num_files;ifile++)
-		{
-		/* find out if file is in selected list */
-		selected = MB_NO;
-		for (i=0;i<position_count;i++)
-			{
-			if (ifile == position_list[i] - 1)
-				selected = MB_YES;
-			}
-
-		/* load unloaded selected files, unload loaded unselected files */
-		file = &(mbev_files[ifile]);
-		if (selected == MB_YES && file->load_status == MB_NO)
-			{
-			loadcount++;
-			sprintf(value_text, "Loading file %d of %d...", loadcount, position_count);
-			do_mbeditviz_message_on(value_text);
-			mbeditviz_load_file(ifile);
-			}
-		else if (selected == MB_YES && file->load_status == MB_YES)
-			{
-			loadcount++;
-			}
-		else if (selected == MB_NO && file->load_status == MB_YES)
-			{
-			mbeditviz_unload_file(ifile);
-			}
-		}
-	do_mbeditviz_message_off();
-
-	/* put up dialog on grid parameters */
-if (mbev_verbose > 0)
-fprintf(stderr," mbev_status:%d loadcount:%d\n",mbev_status,loadcount);
-	if (mbev_status == MB_SUCCESS && loadcount > 0)
-		{
-		do_mbeditviz_gridparameters(w, client_data, call_data);
-		}
-	else
-		{
-		XBell(XtDisplay(list_filelist),100);
-		}
-
-	/* reset the gui */
-	do_mbeditviz_update_gui();
-
-	/* reset status */
-	mbev_status = MB_SUCCESS;
-	mbev_error = MB_ERROR_NO_ERROR;
-
-if (mbev_verbose > 0)
-fprintf(stderr,"return do_mbeditviz_viewselected status:%d\n", mbev_status);
-}
-/*---------------------------------------------------------------------------------------*/
-void
-do_mbeditviz_regrid( Widget w, XtPointer client_data, XtPointer call_data)
-{
-	char function_name[] = "do_mbeditviz_regrid";
-	XmAnyCallbackStruct *acs;
-	acs = (XmAnyCallbackStruct*)call_data;
-	struct mbev_file_struct *file;
-	int	ifile;
-	int	loadcount;
-
-	/* print input debug statements */
-	if (mbev_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       w:           %p\n",w);
-		fprintf(stderr,"dbg2       client_data: %p\n",client_data);
-		fprintf(stderr,"dbg2       call_data:   %p\n",call_data);
-		}
-
-if (mbev_verbose > 0)
-fprintf(stderr,"do_mbeditviz_regrid\n");
-
-	/* destroy any mbview window */
-	if (mbev_grid.status == MBEV_GRID_VIEWED)
-		{
-		/* destroy any mb3dsoundings window */
-		mbev_status = mb3dsoundings_end(mbev_verbose, &mbev_error);
-		mbeditviz_mb3dsoundings_dismiss();
-
-		mbev_status = mbview_destroy(mbev_verbose, 0, MB_YES, &mbev_error);
-		mbev_grid.status = MBEV_GRID_NOTVIEWED;
-		}
-
-	/* destroy old grid */
-	if (mbev_grid.status != MBEV_GRID_NONE)
-		mbeditviz_destroy_grid();
-
-	/* loop over all files to be count loaded files */
-	loadcount = 0;
-	for (ifile=0;ifile<mbev_num_files;ifile++)
-		{
-		file = &(mbev_files[ifile]);
-		if (file->load_status == MB_YES)
-			loadcount++;
-		}
-
-	/* put up dialog on grid parameters */
-if (mbev_verbose > 0)
-fprintf(stderr," mbev_status:%d loadcount:%d\n",mbev_status,loadcount);
-	if (mbev_status == MB_SUCCESS && loadcount > 0)
-		{
-		do_mbeditviz_gridparameters(w, client_data, call_data);
-		}
-	else
-		{
-		XBell(XtDisplay(list_filelist),100);
-		}
-
-	/* reset the gui */
-	do_mbeditviz_update_gui();
-
-	/* reset status */
-	mbev_status = MB_SUCCESS;
-	mbev_error = MB_ERROR_NO_ERROR;
-
-if (mbev_verbose > 0)
-fprintf(stderr,"return do_mbeditviz_regrid status:%d\n", mbev_status);
-}
-/*---------------------------------------------------------------------------------------*/
-
-void
-do_mbeditviz_updategrid( Widget w, XtPointer client_data, XtPointer call_data)
-{
-	char function_name[] = "do_mbeditviz_updategrid";
-	XmAnyCallbackStruct *acs;
-	acs = (XmAnyCallbackStruct*)call_data;
-	struct mbev_file_struct *file;
-	int	loadcount;
-	int	ifile;
-
-	/* print input debug statements */
-	if (mbev_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       w:           %p\n",w);
-		fprintf(stderr,"dbg2       client_data: %p\n",client_data);
-		fprintf(stderr,"dbg2       call_data:   %p\n",call_data);
-		}
-
-if (mbev_verbose > 0)
-fprintf(stderr,"do_mbeditviz_updategrid\n");
-	do_mbeditviz_mbview_dismiss_notify(0);
-
-	/* loop over all files to be sure all files are loaded */
-	loadcount = 0;
-	for (ifile=0;ifile<mbev_num_files;ifile++)
-		{
-		file = &(mbev_files[ifile]);
-		if (file->load_status == MB_YES)
-			loadcount++;
-		}
-
-	/* make the grid and display grid */
-	if (mbev_status == MB_SUCCESS && loadcount > 0)
-		{
-		/* make the grid */
-		do_mbeditviz_message_on("Making grid...");
-		mbev_status = mbeditviz_setup_grid();
-		mbeditviz_project_soundings();
-		mbev_status = mbeditviz_make_grid();
-
-		/* display grid */
-		do_mbeditviz_viewgrid();
-
-		do_mbeditviz_message_off();
-		}
-	else
-		{
-		do_mbeditviz_message_off();
-		XBell(XtDisplay(list_filelist),100);
-		}
-
-	/* reset the gui */
-	do_mbeditviz_update_gui();
-
-	/* reset status */
-	mbev_status = MB_SUCCESS;
-	mbev_error = MB_ERROR_NO_ERROR;
-
-if (mbev_verbose > 0)
-fprintf(stderr,"return do_mbeditviz_updategrid status:%d\n", mbev_status);
-
-}
-
-/*--------------------------------------------------------------------*/
-void
-do_mbeditviz_changecellsize( Widget w, XtPointer client_data, XtPointer call_data)
-{
-	char function_name[] = "do_mbeditviz_changecellsize";
-	XmAnyCallbackStruct *acs;
-	acs = (XmAnyCallbackStruct*)call_data;
-	char	string[MB_PATH_MAXLINE];
-	int	icellsize;
-
-	/* print input debug statements */
-	if (mbev_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       w:           %p\n",w);
-		fprintf(stderr,"dbg2       client_data: %p\n",client_data);
-		fprintf(stderr,"dbg2       call_data:   %p\n",call_data);
-		}
-
-if (mbev_verbose > 0)
-fprintf(stderr,"do_mbeditviz_changecellsize\n");
-
-    	/* get cell size value */
-	ac = 0;
-        XtSetArg(args[ac], XmNvalue, &icellsize); ac++;
-	XtGetValues(scale_cellsize, args, ac);
-	mbev_grid_cellsize = 0.01 * icellsize;
-
-	/* get updated grid dimensions */
-	mbev_grid_nx = (mbev_grid_boundsutm[1] - mbev_grid_boundsutm[0]) / mbev_grid_cellsize + 1;
-	mbev_grid_ny = (mbev_grid_boundsutm[3] - mbev_grid_boundsutm[2]) / mbev_grid_cellsize + 1;
-if (mbev_verbose > 0)
-{
-fprintf(stderr,"Grid bounds: %f %f %f %f    %f %f %f %f\n",
-mbev_grid_bounds[0], mbev_grid_bounds[1], mbev_grid_bounds[2], mbev_grid_bounds[3],
-mbev_grid_boundsutm[0], mbev_grid_boundsutm[1], mbev_grid_boundsutm[2], mbev_grid_boundsutm[3]);
-fprintf(stderr,"cell size:%f dimensions: %d %d\n",
-mbev_grid_cellsize, mbev_grid_nx, mbev_grid_ny);
-}
-
-	/* reset the widgets */
-	sprintf(string,":::t\"Selected Grid Parameters:\":t\"    Cell Size: %.1f m\":t\"    Dimensions: %d %d\"",
-		mbev_grid_cellsize, mbev_grid_nx, mbev_grid_ny);
-	set_label_multiline_string(label_implied, (String) string);
-
-}
-
-
-/*--------------------------------------------------------------------*/
-void
-do_mbeditviz_gridparameters( Widget w, XtPointer client_data, XtPointer call_data)
-{
-	char function_name[] = "do_mbeditviz_gridparameters";
-	XmAnyCallbackStruct *acs;
-	acs = (XmAnyCallbackStruct*)call_data;
-	int	icellsize;
-	char	string[MB_PATH_MAXLINE];
-
-	/* print input debug statements */
-	if (mbev_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       w:           %p\n",w);
-		fprintf(stderr,"dbg2       client_data: %p\n",client_data);
-		fprintf(stderr,"dbg2       call_data:   %p\n",call_data);
-		}
-
-if (mbev_verbose > 0)
-fprintf(stderr,"do_mbeditviz_gridparameters\n");
-
-	/* get calculated grid parameters */
-	mbeditviz_get_grid_bounds();
-
-	/* set the widgets */
-	ac = 0;
-	icellsize = (int)(100 * mbev_grid_cellsize);
-        XtSetArg(args[ac], XmNvalue, icellsize); ac++;
-	XtSetValues(scale_cellsize, args, ac);
-	sprintf(string,":::t\"Grid Bounds:\":t\"    Longitude: %10.5f %10.5f  | %6.3f km\":t\"    Latitude: %9.5f %9.5f | %6.3f km\":t\"Suggested Grid Parameters:\":t\"    Cell Size: %.2f m\":t\"    Dimensions: %d %d\"",
-		mbev_grid_bounds[0], mbev_grid_bounds[1], 0.001 * (mbev_grid_boundsutm[1] - mbev_grid_boundsutm[0]),
-		mbev_grid_bounds[2], mbev_grid_bounds[3], 0.001 * (mbev_grid_boundsutm[3] - mbev_grid_boundsutm[2]),
-		mbev_grid_cellsize, mbev_grid_nx, mbev_grid_ny);
-	set_label_multiline_string(label_current, (String) string);
-	sprintf(string,":::t\"Selected Grid Parameters:\":t\"    Cell Size: %.2f m\":t\"    Dimensions: %d %d\"",
-		mbev_grid_cellsize, mbev_grid_nx, mbev_grid_ny);
-	set_label_multiline_string(label_implied, (String) string);
-
-}
-
-/*--------------------------------------------------------------------*/
-void
-do_mbeditviz_viewgrid()
-{
-	char function_name[] = "do_mbeditviz_viewgrid";
-	struct mbev_file_struct *file;
-	struct mbev_ping_struct *ping;
-	char	mbv_title[MB_PATH_MAXLINE];
-	int	mbv_xo;
-	int	mbv_yo;
-	int	mbv_width;
-	int	mbv_height;
-	int	mbv_lorez_dimension;
-	int	mbv_hirez_dimension;
-	int	mbv_lorez_navdecimate;
-	int	mbv_hirez_navdecimate;
-	int	mbv_display_mode;
-	int	mbv_mouse_mode;
-	int	mbv_grid_mode;
-	int	mbv_primary_histogram;
-	int	mbv_primaryslope_histogram;
-	int	mbv_secondary_histogram;
-	int	mbv_primary_shade_mode;
-	int	mbv_slope_shade_mode;
-	int	mbv_secondary_shade_mode;
-	int	mbv_grid_contour_mode;
-	int	mbv_site_view_mode;
-	int	mbv_route_view_mode;
-	int	mbv_nav_view_mode;
-	int	mbv_navdrape_view_mode;
-	int	mbv_vector_view_mode;
-	int	mbv_primary_colortable;
-	int	mbv_primary_colortable_mode;
-	double	mbv_primary_colortable_min;
-	double	mbv_primary_colortable_max;
-	int	mbv_slope_colortable;
-	int	mbv_slope_colortable_mode;
-	double	mbv_slope_colortable_min;
-	double	mbv_slope_colortable_max;
-	int	mbv_secondary_colortable;
-	int	mbv_secondary_colortable_mode;
-	double	mbv_secondary_colortable_min;
-	double	mbv_secondary_colortable_max;
-	double	mbv_exageration;
-	double	mbv_modelelevation3d;
-	double	mbv_modelazimuth3d;
-	double	mbv_viewelevation3d;
-	double	mbv_viewazimuth3d;
-	double	mbv_illuminate_magnitude;
-	double	mbv_illuminate_elevation;
-	double	mbv_illuminate_azimuth;
-	double	mbv_slope_magnitude;
-	double	mbv_overlay_shade_magnitude;
-	double	mbv_overlay_shade_center;
-	int	mbv_overlay_shade_mode;
-	double	mbv_contour_interval;
-	double	*navtime_d = NULL;
-	double	*navlon = NULL;
-	double	*navlat = NULL;
-	double	*navz = NULL;
-	double	*navheading = NULL;
-	double	*navspeed = NULL;
-	double	*navportlon = NULL;
-	double	*navportlat = NULL;
-	double	*navstbdlon = NULL;
-	double	*navstbdlat = NULL;
-	int	*navline = NULL;
-	int	*navshot = NULL;
-	int	*navcdp = NULL;
-	int	ifile, iping;
-
-	/* print input debug statements */
-	if (mbev_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		}
-
-if (mbev_verbose > 0)
-fprintf(stderr,"do_mbeditviz_viewgrid\n");
-
-	/* display grid */
-	if (mbev_status == MB_SUCCESS
-		&& mbev_grid.status == MBEV_GRID_NOTVIEWED)
-		{
-		/* set parameters */
-		sprintf(mbv_title, "MBeditviz Survey Viewer");
-		mbv_xo = 200;
-		mbv_yo = 200;
-		mbv_width = 560;
-		mbv_height = 500;
-		mbv_lorez_dimension = 100;
-		mbv_hirez_dimension = 500;
-		mbv_lorez_navdecimate = 5;
-		mbv_hirez_navdecimate = 1;
-		mbv_display_mode = MBV_DISPLAY_2D;
-		mbv_mouse_mode = MBV_MOUSE_MOVE;
-		mbv_grid_mode = MBV_GRID_VIEW_PRIMARY;
-		mbv_primary_histogram = MB_NO;
-		mbv_primaryslope_histogram = MB_NO;
-		mbv_secondary_histogram = MB_NO;
-		mbv_primary_shade_mode = MBV_SHADE_VIEW_SLOPE;
-		mbv_slope_shade_mode = MBV_SHADE_VIEW_NONE;
-		mbv_secondary_shade_mode = MBV_SHADE_VIEW_NONE;
-		mbv_grid_contour_mode = MBV_VIEW_OFF;
-		mbv_site_view_mode = MBV_VIEW_OFF;
-		mbv_route_view_mode = MBV_VIEW_OFF;
-		mbv_nav_view_mode = MBV_VIEW_OFF;
-		mbv_navdrape_view_mode = MBV_VIEW_OFF;
-		mbv_vector_view_mode = MBV_VIEW_OFF;
-		mbv_primary_colortable = MBV_COLORTABLE_HAXBY;
-		mbv_primary_colortable_mode = MBV_COLORTABLE_NORMAL;
-		mbv_primary_colortable_min = mbev_grid.min;
-		mbv_primary_colortable_max = mbev_grid.max;
-		mbv_slope_colortable = MBV_COLORTABLE_HAXBY;
-		mbv_slope_colortable_mode = MBV_COLORTABLE_REVERSED;
-		mbv_slope_colortable_min = 0.0;
-		mbv_slope_colortable_max = 0.5;
-		mbv_secondary_colortable = MBV_COLORTABLE_HAXBY;
-		mbv_secondary_colortable_mode = MBV_COLORTABLE_NORMAL;
-		mbv_secondary_colortable_min = mbev_grid.smin;
-		mbv_secondary_colortable_max = mbev_grid.smax;
-		mbv_exageration = 1.0;
-		mbv_modelelevation3d = 90.0;
-		mbv_modelazimuth3d = 0.0;
-		mbv_viewelevation3d = 90.0;
-		mbv_viewazimuth3d = 0.0;
-		mbv_illuminate_magnitude = 1.0;
-		mbv_illuminate_elevation = 5.0;
-		mbv_illuminate_azimuth = 90.0;
-		mbv_slope_magnitude = 1.0;
-		mbv_overlay_shade_magnitude = 1.0;
-		mbv_overlay_shade_center = 0.0;
-		mbv_overlay_shade_mode = MBV_COLORTABLE_NORMAL;
-		mbv_contour_interval
-			= pow(10.0, floor(log10(mbev_grid.max
-						- mbev_grid.min)) - 1.0);
-
-		/* initialize mbview window */
-		mbev_status = mbview_init(mbev_verbose, &mbev_instance, &mbev_error);
-
-		/* set basic mbview window parameters */
-		mbev_status = mbview_setwindowparms(mbev_verbose, mbev_instance,
-					&do_mbeditviz_mbview_dismiss_notify,
-					mbv_title,
-					mbv_xo,
-					mbv_yo,
-					mbv_width,
-					mbv_height,
-					mbv_lorez_dimension,
-					mbv_hirez_dimension,
-					mbv_lorez_navdecimate,
-					mbv_hirez_navdecimate,
-					&mbev_error);
-
-
-		/* set basic mbview view controls */
-		if (mbev_status == MB_SUCCESS)
-		mbev_status = mbview_setviewcontrols(mbev_verbose, mbev_instance,
-					mbv_display_mode,
-					mbv_mouse_mode,
-					mbv_grid_mode,
-					mbv_primary_histogram,
-					mbv_primaryslope_histogram,
-					mbv_secondary_histogram,
-					mbv_primary_shade_mode,
-					mbv_slope_shade_mode,
-					mbv_secondary_shade_mode,
-					mbv_grid_contour_mode,
-					mbv_site_view_mode,
-					mbv_route_view_mode,
-					mbv_nav_view_mode,
-					mbv_navdrape_view_mode,
-					mbv_vector_view_mode,
-					mbv_exageration,
-					mbv_modelelevation3d,
-					mbv_modelazimuth3d,
-					mbv_viewelevation3d,
-					mbv_viewazimuth3d,
-					mbv_illuminate_magnitude,
-					mbv_illuminate_elevation,
-					mbv_illuminate_azimuth,
-					mbv_slope_magnitude,
-					mbv_overlay_shade_magnitude,
-					mbv_overlay_shade_center,
-					mbv_overlay_shade_mode,
-					mbv_contour_interval,
-					MBV_PROJECTION_PROJECTED,
-					mbev_grid.projection_id,
-					&mbev_error);
-
-		/* set primary grid data */
-		if (mbev_status == MB_SUCCESS)
-		mbev_status = mbview_setprimarygrid(mbev_verbose, mbev_instance,
-					MBV_PROJECTION_PROJECTED,
-					mbev_grid.projection_id,
-					mbev_grid.nodatavalue,
-					mbev_grid.nx,
-					mbev_grid.ny,
-					mbev_grid.min,
-					mbev_grid.max,
-					mbev_grid.boundsutm[0],
-					mbev_grid.boundsutm[1],
-					mbev_grid.boundsutm[2],
-					mbev_grid.boundsutm[3],
-					mbev_grid.dx,
-					mbev_grid.dy,
-					mbev_grid.val,
-					&mbev_error);
-
-		/* set more mbview control values */
-		if (mbev_status == MB_SUCCESS)
-		mbev_status = mbview_setprimarycolortable(mbev_verbose, mbev_instance,
-					mbv_primary_colortable,
-					mbv_primary_colortable_mode,
-					mbv_primary_colortable_min,
-					mbv_primary_colortable_max,
-					&mbev_error);
-		if (mbev_status == MB_SUCCESS)
-		mbev_status = mbview_setslopecolortable(mbev_verbose, mbev_instance,
-					mbv_slope_colortable,
-					mbv_slope_colortable_mode,
-					mbv_slope_colortable_min,
-					mbv_slope_colortable_max,
-					&mbev_error);
-
-		/* open up mbview window */
-		mbev_status = mbview_open(mbev_verbose, mbev_instance, &mbev_error);
-
-		/* set grid status */
-		if (mbev_status == MB_SUCCESS)
-			mbev_grid.status = MBEV_GRID_VIEWED;
-
-		/* set more mbview control values */
-		if (mbev_status == MB_SUCCESS)
-		mbev_status = mbview_setsecondarygrid(mbev_verbose, mbev_instance,
-					MBV_PROJECTION_PROJECTED,
-					mbev_grid.projection_id,
-					mbev_grid.nodatavalue,
-					mbev_grid.nx,
-					mbev_grid.ny,
-					mbev_grid.smin,
-					mbev_grid.smax,
-					mbev_grid.boundsutm[0],
-					mbev_grid.boundsutm[1],
-					mbev_grid.boundsutm[2],
-					mbev_grid.boundsutm[3],
-					mbev_grid.dx,
-					mbev_grid.dy,
-					mbev_grid.sgm,
-					&mbev_error);
-		if (mbev_status == MB_SUCCESS)
-		mbev_status = mbview_setsecondarycolortable(mbev_verbose, mbev_instance,
-					mbv_secondary_colortable,
-					mbv_secondary_colortable_mode,
-					mbv_secondary_colortable_min,
-					mbv_secondary_colortable_max,
-					mbv_overlay_shade_magnitude,
-					mbv_overlay_shade_center,
-					mbv_overlay_shade_mode,
-					&mbev_error);
-		mbev_status = mbview_setsecondaryname(mbev_verbose, mbev_instance,
-				"Standard Deviation", &mbev_error);
-
-		/* update widgets */
-		if (mbev_status == MB_SUCCESS)
-		mbev_status = mbview_update(mbev_verbose, mbev_instance, &mbev_error);
-
-		/* add navigation to view */
-		for (ifile=0;ifile<mbev_num_files;ifile++)
-			{
-			file = &(mbev_files[ifile]);
-			if (file->load_status == MB_YES && file->num_pings > 0)
-				{
-				/* set message */
-				sprintf(value_text, "Loading nav %d of %d...", ifile+1, mbev_num_files);
-				do_mbeditviz_message_on(value_text);
-
-				/* allocate arrays */
-				if ((navtime_d = (double *) malloc(file->num_pings*sizeof(double))) == NULL)
-					mbev_status = MB_FAILURE;
-				if (mbev_status == MB_SUCCESS)
-				if ((navlon = malloc(file->num_pings*sizeof(double))) == NULL)
-					mbev_status = MB_FAILURE;
-				if (mbev_status == MB_SUCCESS)
-				if ((navlat = malloc(file->num_pings*sizeof(double))) == NULL)
-					mbev_status = MB_FAILURE;
-				if (mbev_status == MB_SUCCESS)
-				if ((navz = malloc(file->num_pings*sizeof(double))) == NULL)
-					mbev_status = MB_FAILURE;
-				if (mbev_status == MB_SUCCESS)
-				if ((navheading = malloc(file->num_pings*sizeof(double))) == NULL)
-					mbev_status = MB_FAILURE;
-				if (mbev_status == MB_SUCCESS)
-				if ((navspeed = malloc(file->num_pings*sizeof(double))) == NULL)
-					mbev_status = MB_FAILURE;
-				if (mbev_status == MB_SUCCESS)
-				if ((navportlon = malloc(file->num_pings*sizeof(double))) == NULL)
-					mbev_status = MB_FAILURE;
-				if (mbev_status == MB_SUCCESS)
-				if ((navportlat = malloc(file->num_pings*sizeof(double))) == NULL)
-					mbev_status = MB_FAILURE;
-				if (mbev_status == MB_SUCCESS)
-				if ((navstbdlon = malloc(file->num_pings*sizeof(double))) == NULL)
-					mbev_status = MB_FAILURE;
-				if (mbev_status == MB_SUCCESS)
-				if ((navstbdlat = malloc(file->num_pings*sizeof(double))) == NULL)
-					mbev_status = MB_FAILURE;
-				if (mbev_status == MB_SUCCESS)
-				if ((navline = malloc(file->num_pings*sizeof(double))) == NULL)
-					mbev_status = MB_FAILURE;
-				if (mbev_status == MB_SUCCESS)
-				if ((navshot = malloc(file->num_pings*sizeof(double))) == NULL)
-					mbev_status = MB_FAILURE;
-				if (mbev_status == MB_SUCCESS)
-				if ((navcdp = malloc(file->num_pings*sizeof(double))) == NULL)
-					mbev_status = MB_FAILURE;
-
-				/* copy nav data */
-				if (mbev_status == MB_SUCCESS)
-				for (iping=0;iping<file->num_pings;iping++)
-					{
-					ping = (struct mbev_ping_struct *) &(file->pings[iping]);
-					navtime_d[iping] = ping->time_d;
-					navlon[iping] = ping->navlon;
-					navlat[iping] = ping->navlat;
-					navz[iping] = -ping->sonardepth;
-					navheading[iping] = ping->heading;
-					navspeed[iping] = ping->speed;
-					navportlon[iping] = ping->portlon;
-					navportlat[iping] = ping->portlat;
-					navstbdlon[iping] = ping->stbdlon;
-					navstbdlat[iping] = ping->stbdlat;
-					navline[iping] = 0;
-					navshot[iping] = iping;
-					navcdp[iping] = 0;
-					}
-
-				/* add nav data to mbview */
-				if (mbev_status == MB_SUCCESS)
-				mbev_status = mbview_addnav(mbev_verbose, mbev_instance,
-						file->num_pings,
-						navtime_d,
-						navlon,
-						navlat,
-						navz,
-						navheading,
-						navspeed,
-						navportlon,
-						navportlat,
-						navstbdlon,
-						navstbdlat,
-						navline,
-						navshot,
-						navcdp,
-						MBV_COLOR_BLACK,
-						2,
-						file->name,
-						MB_PROCESSED_NONE,
-						file->path,
-						file->path,
-						file->format,
-						MB_YES,
-						MB_NO,
-						MB_NO,
-						MB_NO,
-						1,
-						&mbev_error);
-
-				/* deallocate memory used for data arrays */
-				free(navtime_d);
-				navtime_d = NULL;
-				free(navlon);
-				navlon = NULL;
-				free(navlat);
-				navlat = NULL;
-				free(navz);
-				navz = NULL;
-				free(navheading);
-				navheading = NULL;
-				free(navspeed);
-				navspeed = NULL;
-				free(navportlon);
-				navportlon = NULL;
-				free(navportlat);
-				navportlat = NULL;
-				free(navstbdlon);
-				navstbdlon = NULL;
-				free(navstbdlat);
-				navstbdlat = NULL;
-				free(navline);
-				navline = NULL;
-				free(navshot);
-				navshot = NULL;
-				free(navcdp);
-				navcdp = NULL;
-				}
-			}
-		mbview_enableviewnavs(mbev_verbose, mbev_instance, &mbev_error);
-		mbev_status = mbview_update(mbev_verbose, mbev_instance, &mbev_error);
-		do_mbeditviz_message_off();
-
-		/* add pick notify functions */
-		mbview_addpicknotify(mbev_verbose, 0,
-					MBV_PICK_ONEPOINT,
-					do_mbeditviz_pickonepoint_notify,
-					&mbev_error);
-		mbview_addpicknotify(mbev_verbose, 0,
-					MBV_PICK_TWOPOINT,
-					do_mbeditviz_picktwopoint_notify,
-					&mbev_error);
-		mbview_addpicknotify(mbev_verbose, 0,
-					MBV_PICK_AREA,
-					do_mbeditviz_pickarea_notify,
-					&mbev_error);
-		mbview_addpicknotify(mbev_verbose, 0,
-					MBV_PICK_REGION,
-					do_mbeditviz_pickregion_notify,
-					&mbev_error);
-		mbview_addpicknotify(mbev_verbose, 0,
-					MBV_PICK_SITE,
-					do_mbeditviz_picksite_notify,
-					&mbev_error);
-		mbview_addpicknotify(mbev_verbose, 0,
-					MBV_PICK_ROUTE,
-					do_mbeditviz_pickroute_notify,
-					&mbev_error);
-		mbview_addpicknotify(mbev_verbose, 0,
-					MBV_PICK_NAV,
-					do_mbeditviz_picknav_notify,
-					&mbev_error);
-
-		/* add action button */
-		mbview_addaction(mbev_verbose, mbev_instance,
-			do_mbeditviz_regrid_notify,
-			"Update Bathymetry Grid",
-			MBV_PICKMASK_NONE, &mbev_error);
-		}
-
-	/* reset the gui */
-	do_mbeditviz_update_gui();
-
-if (mbev_verbose > 0)
-fprintf(stderr,"return do_mbeditviz_viewgrid status:%d\n", mbev_status);
-
-}
-/*---------------------------------------------------------------------------------------*/
-
-int do_mbeditviz_mbview_dismiss_notify(size_t instance)
-{
-	char function_name[] = "do_mbeditviz_mbview_dismiss_notify";
-
-	/* print input debug statements */
-	if (mbev_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       instance:   %zu\n",instance);
-		}
-
-if (mbev_verbose > 0)
-fprintf(stderr,"do_mbeditviz_mbview_dismiss_notify status:%d\n", mbev_status);
-
-	/* destroy any mb3dsoundings window */
-if (mbev_verbose > 0)
-fprintf(stderr,"1 do_mbeditviz_mbview_dismiss_notify status:%d\n", mbev_status);
-	mbev_status = mb3dsoundings_end(mbev_verbose, &mbev_verbose);
-if (mbev_verbose > 0)
-fprintf(stderr,"2 do_mbeditviz_mbview_dismiss_notify status:%d\n", mbev_status);
-	mbeditviz_mb3dsoundings_dismiss();
-if (mbev_verbose > 0)
-fprintf(stderr,"3 do_mbeditviz_mbview_dismiss_notify status:%d\n", mbev_status);
-
-	/* destroy the grid */
-if (mbev_verbose > 0)
-fprintf(stderr,"mbev_grid.status:%d\n",mbev_grid.status);
-	if (mbev_grid.status != MBEV_GRID_NONE)
-		mbeditviz_destroy_grid();
-if (mbev_verbose > 0)
-fprintf(stderr,"4 do_mbeditviz_mbview_dismiss_notify status:%d\n", mbev_status);
-
-	/* reset the gui */
-	do_mbeditviz_update_gui();
-
-if (mbev_verbose > 0)
-fprintf(stderr,"return do_mbeditviz_mbview_dismiss_notify status:%d\n", mbev_status);
-
-	return(mbev_status);
-}
-/*---------------------------------------------------------------------------------------*/
-void
-do_mbeditviz_deleteselected( Widget w, XtPointer client_data, XtPointer call_data)
-{
-	char function_name[] = "do_mbeditviz_deleteselected";
-	XmAnyCallbackStruct *acs;
-	acs = (XmAnyCallbackStruct*)call_data;
-	int	*position_list = NULL;
-	int position_count = 0;
-	int	i;
-
-	/* print input debug statements */
-	if (mbev_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       w:           %p\n",w);
-		fprintf(stderr,"dbg2       client_data: %p\n",client_data);
-		fprintf(stderr,"dbg2       call_data:   %p\n",call_data);
-		}
-
-if (mbev_verbose > 0)
-fprintf(stderr,"do_mbeditviz_deleteselected\n");
-
-	/* get positions of selected list items */
-	ac = 0;
-	XtSetArg(args[ac], XmNselectedPositionCount, (XtPointer) &position_count); ac++;
-	XtSetArg(args[ac], XmNselectedPositions, (XtPointer) &position_list); ac++;
-	XtGetValues(list_filelist, args, ac);
-
-	/* delete the selected files */
-	for (i=position_count-1;i>=0;i--)
-		mbeditviz_delete_file(position_list[i]-1);
-
-	/* reset the gui */
-	do_mbeditviz_update_gui();
-
-if (mbev_verbose > 0)
-fprintf(stderr,"return do_mbeditviz_deleteselected status:%d\n", mbev_status);
-
-}
-
-/*---------------------------------------------------------------------------------------*/
-void
-do_mbeditviz_changeoutputmode( Widget w, XtPointer client_data, XtPointer call_data)
-{
-	char function_name[] = "do_mbeditviz_changeoutputmode";
-	XmToggleButtonCallbackStruct *acs;
-	acs = (XmToggleButtonCallbackStruct*)call_data;
-
-	/* print input debug statements */
-	if (mbev_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       w:           %p\n",w);
-		fprintf(stderr,"dbg2       client_data: %p\n",client_data);
-		fprintf(stderr,"dbg2       call_data:   %p\n",call_data);
-		}
-
-if (mbev_verbose > 0)
-fprintf(stderr,"do_mbeditviz_changeoutputmode\n");
-
-    /* set values if needed */
-    if (acs->reason == XmCR_VALUE_CHANGED)
-	    {
-	    if (acs->set)
-	    	mbev_mode_output = MBEV_OUTPUT_MODE_EDIT;
-	    else
-	    	mbev_mode_output = MBEV_OUTPUT_MODE_BROWSE;
-	    if (mbev_mode_output == MBEV_OUTPUT_MODE_EDIT)
-		{
-		XmToggleButtonSetState(toggleButton_mode_edit,
-			    TRUE, FALSE);
-		XmToggleButtonSetState(toggleButton_mode_browse,
-			    FALSE, FALSE);
-		XmToggleButtonSetState(toggleButton_openmodeedit,
-			    TRUE, FALSE);
-		XmToggleButtonSetState(toggleButton_openmodebrowse,
-			    FALSE, FALSE);
-		}
-	    else
-		{
-		XmToggleButtonSetState(toggleButton_mode_edit,
-			    FALSE, FALSE);
-		XmToggleButtonSetState(toggleButton_mode_browse,
-			    TRUE, FALSE);
-		XmToggleButtonSetState(toggleButton_openmodeedit,
-			    FALSE, FALSE);
-		XmToggleButtonSetState(toggleButton_openmodebrowse,
-			    TRUE, FALSE);
-		}
-if (mbev_verbose > 0)
-fprintf(stderr,"acs->set:%d mbev_mode_output:%d\n",acs->set,mbev_mode_output);
-	    }
-
-if (mbev_verbose > 0)
-fprintf(stderr,"return do_mbeditviz_changeoutputmode status:%d\n", mbev_status);
-
-}
-/*---------------------------------------------------------------------------------------*/
-
-int do_mbeditviz_opendata(char *input_file_ptr, int format)
-{
-	char function_name[] = "do_mbeditviz_opendata";
-
-	/* print input debug statements */
-	if (mbev_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       input_file_ptr:    %s\n",input_file_ptr);
-		fprintf(stderr,"dbg2       format:            %d\n",format);
-		}
-
-if (mbev_verbose > 0)
-fprintf(stderr,"do_mbeditviz_opendata:%s %d\n", input_file_ptr, format);
-	do_mbeditviz_message_on("Reading datalismbeditviz_unload_filet...");
-
-	mbeditviz_open_data(input_file_ptr, format);
-
-	do_mbeditviz_message_off();
-
-if (mbev_verbose > 0)
-fprintf(stderr,"return do_mbeditviz_opendata status:%d\n", mbev_status);
-
-	return(mbev_status);
-}
-/*---------------------------------------------------------------------------------------*/
-void
-do_mbeditviz_update_gui( )
-{
-	char function_name[] = "do_mbeditviz_update_gui";
-	struct mbev_file_struct *file;
-	struct mbev_ping_struct *ping;
-	char	string[MB_PATH_MAXLINE];
-	int	i, j, k;
-
-	/* print input debug statements */
-	if (mbev_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		}
-
-if (mbev_verbose > 0)
-fprintf(stderr,"do_mbeditviz_update_gui status:%d\n", mbev_status);
-
-	/* set status text */
-	mbev_num_files_loaded = 0;
-	mbev_num_pings_loaded = 0;
-	mbev_num_soundings_loaded = 0;
-	for (i=0;i<mbev_num_files;i++)
-		{
-		file = &(mbev_files[i]);
-		if (file->load_status == MB_YES)
-			{
-			mbev_num_files_loaded++;
-			mbev_num_pings_loaded += file->num_pings;
-			for (j=0;j<file->num_pings;j++)
-				{
-				ping = &(file->pings[j]);
-				for (k=0;k<ping->beams_bath;k++)
-					{
-					if (!mb_beam_check_flag_null(ping->beamflag[k]))
-						mbev_num_soundings_loaded ++;
-					}
-				}
-			}
-		}
-	if (mbev_grid.status == MBEV_GRID_NONE)
-	sprintf(string,":::t\"Available Files: %d\":t\"Loaded Files: %d\":t\"Grid Not Generated\"",
-		mbev_num_files,mbev_num_files_loaded);
-	else
-	sprintf(string,":::t\"Available Files: %d\":t\"Loaded Files: %d\":t\"Grid:\":t\"  Lon: %f %f\":t\"  Lat: %f %f\":t\"  Cell Size: %f m\":t\"  Dimensions: %d %d\"",
-		mbev_num_files,mbev_num_files_loaded,
-		mbev_grid.bounds[0],mbev_grid.bounds[1],mbev_grid.bounds[2],mbev_grid.bounds[3],
-		mbev_grid.dx,mbev_grid.nx,mbev_grid.ny);
-	set_label_multiline_string(label_mbeditviz_status, (String) string);
-
-	/* build available file list */
-	do_mbeditviz_update_filelist();
-
-	/*set sensitivity */
-	if (mbev_grid.status == MBEV_GRID_NONE)
-		{
-		XtVaSetValues(pushButton_openswath,
-			XmNsensitive, True,
-			NULL);
-		}
-	else
-		{
-		XtVaSetValues(pushButton_openswath,
-			XmNsensitive, False,
-			NULL);
-		}
-	if (mbev_num_files > 0 && mbev_grid.status == MBEV_GRID_NONE)
-		{
-		XtVaSetValues(pushButton_deleteselected,
-			XmNsensitive, True,
-			NULL);
-		XtVaSetValues(pushButton_viewselected,
-			XmNsensitive, True,
-			NULL);
-		XtVaSetValues(pushButton_viewall,
-			XmNsensitive, True,
-			NULL);
-		XtVaSetValues(toggleButton_mode_edit,
-			XmNsensitive, True,
-			NULL);
-		XtVaSetValues(toggleButton_mode_browse,
-			XmNsensitive, True,
-			NULL);
-		XtVaSetValues(pushButton_updategrid,
-			XmNsensitive, False,
-			NULL);
-		}
-	else
-		{
-		XtVaSetValues(pushButton_deleteselected,
-			XmNsensitive, False,
-			NULL);
-		XtVaSetValues(pushButton_viewselected,
-			XmNsensitive, False,
-			NULL);
-		XtVaSetValues(pushButton_viewall,
-			XmNsensitive, False,
-			NULL);
-		XtVaSetValues(toggleButton_mode_edit,
-			XmNsensitive, False,
-			NULL);
-		XtVaSetValues(toggleButton_mode_browse,
-			XmNsensitive, False,
-			NULL);
-		XtVaSetValues(pushButton_updategrid,
-			XmNsensitive, True,
-			NULL);
-		}
-
-if (mbev_verbose > 0)
-fprintf(stderr,"return do_mbeditviz_update_gui status:%d\n", mbev_status);
-}
-/*---------------------------------------------------------------------------------------*/
-void
-do_mbeditviz_update_filelist( )
-{
-	char function_name[] = "do_mbeditviz_update_filelist";
-	struct mbev_file_struct *file;
-	int	update_filelist;
-
-	char	string[MB_PATH_MAXLINE];
-	Cardinal ac;
-	Arg      args[256];
-	int	item_count;
-	int	*position_list = NULL;
-	int	position_list_save[MB_PATH_MAXLINE];
-	int	position_count = 0;
-	char	athchar;
-	char	atschar;
-	char	atachar;
-    	XmString *xstr;
-	char	*lockstrptr;
-	char	*lockedstr   = "<Locked>";
-	char	*unlockedstr = "        ";
-	char	*loadedstr   = "<loaded>";
-	char	*esfstrptr;
-	char	*esfyesstr   = "<esf>";
-	char	*esfnostr    = "     ";
-	int	i;
-
-	/* swath file locking variables */
-	int	lock_status;
-	int	lock_error = MB_ERROR_NO_ERROR;
-	int	locked;
-	int	lock_purpose;
-	mb_path	lock_program;
-	mb_path lock_cpu;
-	mb_path lock_user;
-	char	lock_date[25];
-
-	/* esf file checking variables */
-	int	esf_exists;
-	struct stat file_status;
-	int	fstat;
-	char    save_file[MB_PATH_MAXLINE];
-
-	/* print input debug statements */
-	if (mbev_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		}
-
-if (mbev_verbose > 0)
-fprintf(stderr,"do_mbeditviz_update_filelist status:%d\n", mbev_status);
-
-	/* check to see if anything has changed */
-	update_filelist = MB_NO;
-
-	/* check for change in number of files */
-	ac = 0;
-	XtSetArg(args[ac], XmNitemCount, (XtPointer) &item_count); ac++;
-	XtGetValues(list_filelist, args, ac);
-	if (item_count != mbev_num_files)
-		update_filelist = MB_YES;
-
-	/* check for change in load status, lock status, or esf status */
-	for (i=0;i<mbev_num_files;i++)
-		{
-		file = &(mbev_files[i]);
-
-		/* check load status */
-		if (file->load_status != file->load_status_shown)
-			{
-			file->load_status_shown = file->load_status;
-			update_filelist = MB_YES;
-			}
-
-		/* check for locks */
-		lock_status = mb_pr_lockinfo(mbev_verbose, mbev_files[i].path, &locked,
-				&lock_purpose, lock_program, lock_user, lock_cpu,
-				lock_date, &lock_error);
-		if (locked != file->locked)
-			{
-			file->locked = locked;
-			update_filelist = MB_YES;
-			}
-
-		/* check for edit save file */
-		sprintf(save_file, "%s.esf", mbev_files[i].path);
-		fstat = stat(save_file, &file_status);
-		if (fstat == 0
-		    && (file_status.st_mode & S_IFMT) != S_IFDIR)
-			esf_exists = MB_YES;
-		else
-			esf_exists = MB_NO;
-		if (esf_exists != file->esf_exists)
-			{
-			file->esf_exists = esf_exists;
-			update_filelist = MB_YES;
-			}
-		}
-
-	/* only update the filelist if necessary */
-	if (update_filelist == MB_YES)
-		{
-		/* get the current selection, if any, from the list */
-		ac = 0;
-		XtSetArg(args[ac], XmNitemCount, (XtPointer) &item_count); ac++;
-		XtSetArg(args[ac], XmNselectedPositionCount, (XtPointer) &position_count); ac++;
-		XtSetArg(args[ac], XmNselectedPositions, (XtPointer) &position_list); ac++;
-		XtGetValues(list_filelist, args, ac);
-		if (position_count > MB_PATH_MAXLINE)
-			position_count = MB_PATH_MAXLINE;
-		for (i=0;i<position_count;i++)
-			{
-			position_list_save[i] = position_list[i];
-			}
-
-		/* delete existing file list */
-		XmListDeleteAllItems(list_filelist);
-
-		/* build available file list */
-		if (mbev_num_files > 0)
-			{
-			xstr = (XmString *) malloc(mbev_num_files * sizeof(XmString));
-			for (i=0;i<mbev_num_files;i++)
-				{
-				file = &(mbev_files[i]);
-
-				/* set label strings */
-				if (file->load_status == MB_YES)
-					lockstrptr = loadedstr;
-				else if (file->locked == MB_YES)
-					lockstrptr = lockedstr;
-				else
-					lockstrptr = unlockedstr;
-				if (file->esf_exists == MB_YES)
-					esfstrptr = esfyesstr;
-				else
-					esfstrptr = esfnostr;
-				if (file->n_async_heading > 0)
-					athchar = 'H';
-				else
-					athchar = ' ';
-				if (file->n_async_sonardepth > 0)
-					atschar = 'S';
-				else
-					atschar = ' ';
-				if (file->n_async_attitude > 0)
-					atachar = 'A';
-				else
-					atachar = ' ';
-				sprintf(string,"%s %s %c%c%c %s %d",
-					lockstrptr, esfstrptr,
-					athchar, atschar, atachar,
-					mbev_files[i].name,mbev_files[i].format);
-   				xstr[i] = XmStringCreateLocalized(string);
- 				}
-    			XmListAddItems(list_filelist,xstr,mbev_num_files,0);
-			for (i=0;i<mbev_num_files;i++)
-				{
-    				XmStringFree(xstr[i]);
-    				}
-    			free(xstr);
-
-			/* reinstate selection if the number of items is the same as before */
-			if (item_count == mbev_num_files && position_count > 0)
-				{
-				ac = 0;
-				XtSetArg(args[ac], XmNselectedPositionCount, position_count); ac++;
-				XtSetArg(args[ac], XmNselectedPositions, (XtPointer) position_list_save); ac++;
-				XtSetValues(list_filelist, args, ac);
- 				}
-			}
-		}
-
-if (mbev_verbose > 0)
-fprintf(stderr,"return do_mbeditviz_update_filelist status:%d\n", mbev_status);
-}
-/*---------------------------------------------------------------------------------------*/
-void do_mbeditviz_pickonepoint_notify(size_t instance)
-{
-	char function_name[] = "do_mbeditviz_pickonepoint_notify";
-
-	/* print input debug statements */
-	if (mbev_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       instance:    %zu\n",instance);
-		}
-
-if (mbev_verbose > 0)
-fprintf(stderr,"do_mbeditviz_pickonepoint_notify:%zu\n", instance);
-
-
-if (mbev_verbose > 0)
-fprintf(stderr,"return do_mbeditviz_pickonepoint_notify status:%d\n", mbev_status);
-}
-/*------------------------------------------------------------------------------*/
-
-void do_mbeditviz_picktwopoint_notify(size_t instance)
-{
-	char function_name[] = "do_mbeditviz_picktwopoint_notify";
-
-	/* print input debug statements */
-	if (mbev_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       instance:    %zu\n",instance);
-		}
-
-if (mbev_verbose > 0)
-fprintf(stderr,"do_mbeditviz_picktwopoint_notify:%zu\n", instance);
-
-
-if (mbev_verbose > 0)
-fprintf(stderr,"return do_mbeditviz_picktwopoint_notify status:%d\n", mbev_status);
-}
-/*------------------------------------------------------------------------------*/
-
-void do_mbeditviz_pickarea_notify(size_t instance)
-{
-	char function_name[] = "do_mbeditviz_pickarea_notify";
-
-	/* print input debug statements */
-	if (mbev_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       instance:    %zu\n",instance);
-		}
-
-if (mbev_verbose > 0)
-fprintf(stderr,"do_mbeditviz_pickarea_notify:%zu\n", instance);
-
-	mbeditviz_selectarea(instance);
-	mbev_status = mb3dsoundings_open(mbev_verbose, &mbev_selected, &mbev_error);
-	mbev_status = mb3dsoundings_set_dismiss_notify(mbev_verbose, &mbeditviz_mb3dsoundings_dismiss, &mbev_error);
-	mbev_status = mb3dsoundings_set_edit_notify(mbev_verbose, &mbeditviz_mb3dsoundings_edit, &mbev_error);
-	mbev_status = mb3dsoundings_set_info_notify(mbev_verbose, &mbeditviz_mb3dsoundings_info, &mbev_error);
-	mbev_status = mb3dsoundings_set_bias_notify(mbev_verbose, &mbeditviz_mb3dsoundings_bias, &mbev_error);
-	mbev_status = mb3dsoundings_set_biasapply_notify(mbev_verbose, &mbeditviz_mb3dsoundings_biasapply, &mbev_error);
-	mbev_status = mb3dsoundings_set_colorsoundings_notify(mbev_verbose, &mbeditviz_mb3dsoundings_colorsoundings, &mbev_error);
-
-if (mbev_verbose > 0)
-fprintf(stderr,"return do_mbeditviz_picktwopoint_notify status:%d\n", mbev_status);
-
-}
-/*------------------------------------------------------------------------------*/
-
-void do_mbeditviz_pickregion_notify(size_t instance)
-{
-	char function_name[] = "do_mbeditviz_pickregion_notify";
-
-	/* print input debug statements */
-	if (mbev_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       instance:    %zu\n",instance);
-		}
-
-if (mbev_verbose > 0)
-fprintf(stderr,"do_mbeditviz_pickregion_notify:%zu\n", instance);
-
-	mbeditviz_selectregion(instance);
-	mbev_status = mb3dsoundings_open(mbev_verbose, &mbev_selected, &mbev_error);
-	mbev_status = mb3dsoundings_set_dismiss_notify(mbev_verbose, &mbeditviz_mb3dsoundings_dismiss, &mbev_error);
-	mbev_status = mb3dsoundings_set_edit_notify(mbev_verbose, &mbeditviz_mb3dsoundings_edit, &mbev_error);
-	mbev_status = mb3dsoundings_set_info_notify(mbev_verbose, &mbeditviz_mb3dsoundings_info, &mbev_error);
-	mbev_status = mb3dsoundings_set_bias_notify(mbev_verbose, &mbeditviz_mb3dsoundings_bias, &mbev_error);
-	mbev_status = mb3dsoundings_set_biasapply_notify(mbev_verbose, &mbeditviz_mb3dsoundings_biasapply, &mbev_error);
-	mbev_status = mb3dsoundings_set_colorsoundings_notify(mbev_verbose, &mbeditviz_mb3dsoundings_colorsoundings, &mbev_error);
-
-if (mbev_verbose > 0)
-fprintf(stderr,"return do_mbeditviz_pickregion_notify status:%d\n", mbev_status);
-}
-/*------------------------------------------------------------------------------*/
-
-void do_mbeditviz_picksite_notify(size_t instance)
-{
-	char function_name[] = "do_mbeditviz_picksite_notify";
-
-	/* print input debug statements */
-	if (mbev_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       instance:    %zu\n",instance);
-		}
-
-if (mbev_verbose > 0)
-fprintf(stderr,"do_mbeditviz_picksite_notify:%zu\n", instance);
-
-
-if (mbev_verbose > 0)
-fprintf(stderr,"return do_mbeditviz_picksite_notify status:%d\n", mbev_status);
-}
-/*------------------------------------------------------------------------------*/
-
-void do_mbeditviz_pickroute_notify(size_t instance)
-{
-	char function_name[] = "do_mbeditviz_pickroute_notify";
-
-	/* print input debug statements */
-	if (mbev_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       instance:    %zu\n",instance);
-		}
-
-if (mbev_verbose > 0)
-fprintf(stderr,"do_mbeditviz_pickroute_notify:%zu\n", instance);
-
-
-if (mbev_verbose > 0)
-fprintf(stderr,"return do_mbeditviz_pickroute_notify status:%d\n", mbev_status);
-}
-/*------------------------------------------------------------------------------*/
-
-void do_mbeditviz_picknav_notify(size_t instance)
-{
-	char function_name[] = "do_mbeditviz_picknav_notify";
-
-	/* print input debug statements */
-	if (mbev_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       instance:    %zu\n",instance);
-		}
-
-if (mbev_verbose > 0)
-fprintf(stderr,"do_mbeditviz_picknav_notify:%zu\n", instance);
-
-
-	mbeditviz_selectnav(instance);
-
-	/* open ping editor */
-	/* BxManageCB(parent, (XtPointer)"form_pingedit", NULL); */
-
-	/* open mb3dsoundings 3d editor */
-	mbev_status = mb3dsoundings_open(mbev_verbose, &mbev_selected, &mbev_error);
-	mbev_status = mb3dsoundings_set_dismiss_notify(mbev_verbose, &mbeditviz_mb3dsoundings_dismiss, &mbev_error);
-	mbev_status = mb3dsoundings_set_edit_notify(mbev_verbose, &mbeditviz_mb3dsoundings_edit, &mbev_error);
-	mbev_status = mb3dsoundings_set_info_notify(mbev_verbose, &mbeditviz_mb3dsoundings_info, &mbev_error);
-	mbev_status = mb3dsoundings_set_bias_notify(mbev_verbose, &mbeditviz_mb3dsoundings_bias, &mbev_error);
-	mbev_status = mb3dsoundings_set_biasapply_notify(mbev_verbose, &mbeditviz_mb3dsoundings_biasapply, &mbev_error);
-	mbev_status = mb3dsoundings_set_colorsoundings_notify(mbev_verbose, &mbeditviz_mb3dsoundings_colorsoundings, &mbev_error);
-
-if (mbev_verbose > 0)
-fprintf(stderr,"return do_mbeditviz_picknav_notify status:%d\n", mbev_status);
-}
-/*------------------------------------------------------------------------------*/
-void
-do_mbeditviz_regrid_notify( Widget w, XtPointer client_data, XtPointer call_data)
-{
-	char function_name[] = "do_mbeditviz_regrid_notify";
-	XmAnyCallbackStruct *acs;
-	acs = (XmAnyCallbackStruct*)call_data;
-	double	rollbias;
-	double	pitchbias;
-	double	headingbias;
-	double	timelag;
-
-	/* print input debug statements */
-	if (mbev_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       w:           %p\n",w);
-		fprintf(stderr,"dbg2       client_data: %p\n",client_data);
-		fprintf(stderr,"dbg2       call_data:   %p\n",call_data);
-		}
-
-if (mbev_verbose > 0)
-fprintf(stderr,"do_mbeditviz_regrid_notify\n");
-
-	/* get current bias parameters */
-	mb3dsoundings_get_bias_values(mbev_verbose, &rollbias, &pitchbias, &headingbias, &timelag, &mbev_error);
-
-	/* regrid the bathymetry */
-	mbeditviz_mb3dsoundings_biasapply(rollbias, pitchbias, headingbias, timelag);
-
-	/* reset the gui */
-	do_mbeditviz_update_gui();
-
-if (mbev_verbose > 0)
-fprintf(stderr,"return do_mbeditviz_regrid_notify status:%d\n", mbev_status);
-
-}
-
-/*--------------------------------------------------------------------*/
-/* Mbeditviz message functions */
-/*------------------------------------------------------------------------------*/
-
-int
-do_mbeditviz_message_on(char *message)
-{
-	char function_name[] = "do_mbeditviz_message_on";
-  	Widget  diashell, topshell;
-    	Window  diawindow, topwindow;
-    	XWindowAttributes	xwa;
-    	XEvent  event;
-
-	/* print input debug statements */
-	if (mbev_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       message:   %s\n",message);
-		}
-
-	mbev_message_on = MB_YES;
-
-    	set_mbview_label_string(label_mbeditviz_message, message);
-    	XtManageChild(bulletinBoard_mbeditviz_message);
-
-    	/* force the label to be visible */
-    	for (diashell = label_mbeditviz_message;
-	    	!XtIsShell(diashell);
-	    	diashell = XtParent(diashell));
-    	for (topshell = diashell;
-	    	!XtIsTopLevelShell(topshell);
-	    	topshell = XtParent(topshell));
-    	if (XtIsRealized(diashell) && XtIsRealized(topshell))
-		{
-		diawindow = XtWindow(diashell);
-		topwindow = XtWindow(topshell);
-
-		/* wait for the dialog to be mapped */
-		while (XGetWindowAttributes(XtDisplay(label_mbeditviz_message),
-						diawindow, &xwa)
-			&& xwa.map_state != IsViewable)
-	    		{
-	    		if (XGetWindowAttributes(XtDisplay(label_mbeditviz_message),
-							topwindow, &xwa)
-		    		&& xwa.map_state != IsViewable)
-			break;
-
-	    		XtAppNextEvent(app, &event);
-	    		XtDispatchEvent(&event);
-	    		}
-		}
-
-    	XmUpdateDisplay(topshell);
-
-    	return(1);
-}
-
-/*------------------------------------------------------------------------------*/
-
-int
-do_mbeditviz_message_off()
-{
-	char function_name[] = "do_mbeditviz_message_off";
-
-	/* print input debug statements */
-	if (mbev_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		}
-
-	mbev_message_on = MB_NO;
-
-     	XtUnmanageChild(bulletinBoard_mbeditviz_message);
-    	XSync(XtDisplay(bulletinBoard_mbeditviz_message), 0);
-    	XmUpdateDisplay(bulletinBoard_mbeditviz_message);
-
-    	return(1);
-}
-/*--------------------------------------------------------------------*/
-
-int
-do_error_dialog(char *s1, char *s2, char *s3)
-{
-    set_label_string(label_error_one, s1);
-    set_label_string(label_error_two, s2);
-    set_label_string(label_error_three, s3);
-    XtManageChild(bulletinBoard_error);
-    XBell(XtDisplay(bulletinBoard_error),100);
-/* fprintf(stderr,"do_error_dialog:\n\t%s\n\t%s\n\t%s\n",s1,s2,s3); */
-
-    return(1);
-}
-
-
-/*--------------------------------------------------------------------*/
-/* Change label string cleanly, no memory leak */
-/*--------------------------------------------------------------------*/
-
-void set_label_string(Widget w, String str)
-{
-    XmString xstr;
-
-    xstr = XmStringCreateLocalized( str );
-    if ( xstr != NULL )
-	XtVaSetValues(w,
-	    XmNlabelString, xstr,
-	    NULL);
-    else
-	XtWarning("Failed to update labelString");
-
-    XmStringFree( xstr );
-}
-/*--------------------------------------------------------------------*/
-/* Change multiline label string cleanly, no memory leak */
-/*--------------------------------------------------------------------*/
-
-void set_label_multiline_string(Widget w, String str)
-{
-    XmString xstr;
-    Boolean      argok;
-
-    xstr = (XtPointer)BX_CONVERT(w, str, XmRXmString, 0, &argok);
-    if ( xstr != NULL && argok)
-        XtVaSetValues(w,
-            XmNlabelString, xstr,
-            NULL);
-    else
-        XtWarning("Failed to update labelString");
-
-    XmStringFree( xstr );
-}
-/*--------------------------------------------------------------------*/
-/* Get text item string cleanly, no memory leak */
-/*--------------------------------------------------------------------*/
-
-void get_text_string(Widget w, String str)
-{
-    char	*str_tmp;
-
-    str_tmp = (char *) XmTextGetString(w);
-    strcpy(str, str_tmp);
-    XtFree(str_tmp);
-}
-
-/*--------------------------------------------------------------------*/
-
-int
-do_wait_until_viewed()
-{
-    Widget  topshell;
-    Window  topwindow;
-    XWindowAttributes	xwa;
-    XEvent  event;
-
-    /* find the top level shell */
-    for (topshell = parent;
-	    !XtIsTopLevelShell(topshell);
-	    topshell = XtParent(topshell))
-	;
-
-    /* keep processing events until it is viewed */
-    if (XtIsRealized(topshell))
-	{
-	topwindow = XtWindow(topshell);
-
-	/* wait for the window to be mapped */
-	while (XGetWindowAttributes(
-			XtDisplay(parent),
-			topwindow, &xwa)
-		&& xwa.map_state != IsViewable)
-	    {
-	    XtAppNextEvent(app, &event);
-	    XtDispatchEvent(&event);
-	    }
-	}
-
-    XmUpdateDisplay(topshell);
-
-    return(MB_SUCCESS);
-}
-
-/*------------------------------------------------------------------------------*/
-
-int do_mbeditviz_settimer()
-{
-	int	status = MB_SUCCESS;
-	int	timer_timeout_time = 1000;
-	int	id;
-
-	/* set timer function if none set for this instance */
-	if (timer_function_set == MB_NO)
-		{
-		id =  XtAppAddTimeOut(app,
-				(unsigned long) timer_timeout_time,
-				(XtTimerCallbackProc)do_mbeditviz_workfunction,
-				(XtPointer) -1);
-		if (id > 0)
-			timer_function_set = MB_YES;
-		else
-			status = MB_FAILURE;
-		}
-
-/* else
-fprintf(stderr,"do_mbeditviz_settimer: FUNCTION ALREADY SET!!\n"); */
-
-	return(status);
-}
-
-/*------------------------------------------------------------------------------*/
-
-int do_mbeditviz_workfunction(XtPointer client_data)
-{
-	int	status = MB_SUCCESS;
-
-	timer_function_set = MB_NO;
-
-	/* reset filelist */
-	if (mbev_num_files > 0)
-		{
-		do_mbeditviz_update_filelist();
-		}
-
-	/* reset the timer function */
-	do_mbeditviz_settimer();
-
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
diff --git a/src/mbeditviz/mbeditviz_creation.c b/src/mbeditviz/mbeditviz_creation.c
deleted file mode 100644
index f79c9df..0000000
--- a/src/mbeditviz/mbeditviz_creation.c
+++ /dev/null
@@ -1,1721 +0,0 @@
-
-/* Begin user code block <abstract> */
-/* End user code block <abstract> */
-
-/**
- * README: Portions of this file are merged at file generation
- * time. Edits can be made *only* in between specified code blocks, look
- * for keywords <Begin user code> and <End user code>.
- */
-/*
- * Generated by the ICS Builder Xcessory (BX).
- *
- * BuilderXcessory Version 6.1.3
- * Code Generator Xcessory 6.1.3 (08/19/04) CGX Scripts 6.1 Motif 2.1
- *
- */
-
-
-/* Begin user code block <file_comments> */
-
-#ifndef SANS
-#define SANS "helvetica"
-#endif
-#ifndef SERIF
-#define SERIF "times"
-#endif
-#ifndef MONO
-#define MONO "courier"
-#endif
-
-/* End user code block <file_comments> */
-
-#include <Xm/Xm.h>
-#include <Xm/MainW.h>
-#include <Xm/DialogS.h>
-#include <Xm/MwmUtil.h>
-#include <Xm/BulletinB.h>
-#include <Xm/Label.h>
-#include <Xm/PushB.h>
-#include <Xm/Form.h>
-#include <Xm/Scale.h>
-#include <Xm/RowColumn.h>
-#include <Xm/ToggleB.h>
-#include <Xm/Text.h>
-#include <Xm/FileSB.h>
-#include <Xm/Separator.h>
-#include <Xm/CascadeB.h>
-#include <Xm/ScrolledW.h>
-#include <Xm/List.h>
-#include <Xm/MainW.h>
-#include <Xm/DialogS.h>
-#include <Xm/MwmUtil.h>
-#include <Xm/BulletinB.h>
-#include <Xm/Label.h>
-#include <Xm/PushB.h>
-#include <Xm/Form.h>
-#include <Xm/Scale.h>
-#include <Xm/RowColumn.h>
-#include <Xm/ToggleB.h>
-#include <Xm/Text.h>
-#include <Xm/FileSB.h>
-#include <Xm/Separator.h>
-#include <Xm/CascadeB.h>
-#include <Xm/ScrolledW.h>
-#include <Xm/List.h>
-
-/*
- * Global declarations are now stored in the header file.
- *
- * If DECLARE_BX_GLOBALS is defined then this header file
- * declares the globals, otherwise it just externs them.
- */
-#define DECLARE_BX_GLOBALS
-
-/**
- * Globally included information.
- */
-
-
-/**
- * Common constant and pixmap declarations.
- */
-#include "mbeditviz_creation.h"
-
-/**
- * Convenience functions from utilities file.
- */
-extern void RegisterBxConverters(XtAppContext);
-extern XtPointer BX_CONVERT(Widget, char *, char *, int, Boolean *);
-extern XtPointer BX_DOUBLE(double);
-extern XtPointer BX_SINGLE(float);
-extern void BX_MENU_POST(Widget, XtPointer, XEvent *, Boolean *);
-extern Pixmap XPM_PIXMAP(Widget, char **);
-extern void BX_SET_BACKGROUND_COLOR(Widget, ArgList, Cardinal *, Pixel);
-
-/**
- * Declarations for callbacks and handlers.
- */
-extern void do_mbeditviz_quit(Widget, XtPointer, XtPointer);
-extern void BxExitCB(Widget, XtPointer, XtPointer);
-extern void BxUnmanageCB(Widget, XtPointer, XtPointer);
-extern void do_mbeditviz_changecellsize(Widget, XtPointer, XtPointer);
-extern void do_mbeditviz_updategrid(Widget, XtPointer, XtPointer);
-extern void do_mbeditviz_openfile(Widget, XtPointer, XtPointer);
-extern void do_mbeditviz_changeoutputmode(Widget, XtPointer, XtPointer);
-extern void do_mbeditviz_fileSelectionBox_openswath(Widget, XtPointer, XtPointer);
-extern void BxManageCB(Widget, XtPointer, XtPointer);
-extern void do_mbeditviz_regrid(Widget, XtPointer, XtPointer);
-extern void do_mbeditviz_deleteselected(Widget, XtPointer, XtPointer);
-extern void do_mbeditviz_viewselected(Widget, XtPointer, XtPointer);
-extern void do_mbeditviz_viewall(Widget, XtPointer, XtPointer);
-extern void do_mbeditviz_mode_change(Widget, XtPointer, XtPointer);
-
-/**
- * Create the mainWindow_mbeditviz hierarchy of widgets.
- */
-Widget
-CreatemainWindow_mbeditviz(Widget parent)
-{
-    Cardinal ac = 0;
-    Arg      args[256];
-    Boolean  argok = False;
-    Widget   mainWindow_mbeditviz;
-    Widget   dialogShell_error;
-    Widget   pushButton_error;
-    Widget   dialogShell_gridparameters;
-    Widget   form_gridparameters;
-    Widget   pushButton_gridparameters_dismiss;
-    Widget   pushButton_gridparameters_apply;
-    Widget   label_outputmode;
-    Widget   label_open_mbio;
-    Widget   label_mbeditviz_patience;
-    Widget   dialogShell_about;
-    Widget   bulletinBoard_about;
-    Widget   label_about_authors;
-    Widget   label_about_MBARI;
-    Widget   label_about_LDEO;
-    Widget   separator3;
-    Widget   label_about_mbsystem;
-    Widget   separator1;
-    Widget   label_about_title;
-    Widget   pushButton_about_dismiss;
-    Widget   menuBar_mbeditviz;
-    Widget   cascadeButton_file;
-    Widget   pulldownMenu_file;
-    Widget   separator2;
-    Widget   pushButton_quit;
-    Widget   cascadeButton_options;
-    Widget   pulldownMenu_options;
-    Widget   cascadeButton_help;
-    Widget   pulldownMenu_help;
-    Widget   pushButton_help_about;
-    Widget   form_mbeditviz;
-    Widget   label_status;
-    Widget   label_programmode;
-    Widget   radioBox_programmode;
-    Widget   label_filelist;
-    Widget   scrolledWindow_mbeditviz;
-
-    /**
-     * Register the converters for the widgets.
-     */
-    RegisterBxConverters(XtWidgetToApplicationContext(parent));
-    XtInitializeWidgetClass((WidgetClass)xmMainWindowWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmDialogShellWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmBulletinBoardWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmLabelWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmPushButtonWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmFormWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmScaleWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmRowColumnWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmToggleButtonWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmTextWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmFileSelectionBoxWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmSeparatorWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmRowColumnWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmCascadeButtonWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmRowColumnWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmFormWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmScrolledWindowWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmListWidgetClass);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 180); ac++;
-    XtSetArg(args[ac], XmNy, 583); ac++;
-    XtSetArg(args[ac], XmNwidth, 453); ac++;
-    XtSetArg(args[ac], XmNheight, 557); ac++;
-    mainWindow_mbeditviz = XmCreateMainWindow(parent,
-        (char *)"mainWindow_mbeditviz",
-        args,
-        ac);
-    XtAddCallback(mainWindow_mbeditviz, XmNdestroyCallback, do_mbeditviz_quit, (XtPointer)0);
-    XtAddCallback(mainWindow_mbeditviz, XmNdestroyCallback, BxExitCB, (XtPointer)0);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNpacking, XmPACK_TIGHT); ac++;
-    XtSetArg(args[ac], XmNwidth, 453); ac++;
-    XtSetArg(args[ac], XmNheight, 34); ac++;
-    menuBar_mbeditviz = XmCreateMenuBar(mainWindow_mbeditviz,
-        (char *)"menuBar_mbeditviz",
-        args,
-        ac);
-    XtManageChild(menuBar_mbeditviz);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(menuBar_mbeditviz, (char *)"File",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 5); ac++;
-        XtSetArg(args[ac], XmNy, 5); ac++;
-        XtSetArg(args[ac], XmNwidth, 41); ac++;
-        XtSetArg(args[ac], XmNheight, 24); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(menuBar_mbeditviz, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        cascadeButton_file = XmCreateCascadeButton(menuBar_mbeditviz,
-            (char *)"cascadeButton_file",
-            args,
-            ac);
-        XtManageChild(cascadeButton_file);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 185); ac++;
-    XtSetArg(args[ac], XmNy, 612); ac++;
-    XtSetArg(args[ac], XmNwidth, 132); ac++;
-    XtSetArg(args[ac], XmNheight, 54); ac++;
-    pulldownMenu_file = XmCreatePulldownMenu(XtParent(cascadeButton_file),
-        (char *)"pulldownMenu_file",
-        args,
-        ac);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(pulldownMenu_file, (char *)"Open Swath Data",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_file, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_openswath = XmCreatePushButton(pulldownMenu_file,
-            (char *)"pushButton_openswath",
-            args,
-            ac);
-        XtManageChild(pushButton_openswath);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_openswath, XmNactivateCallback, do_mbeditviz_fileSelectionBox_openswath, (XtPointer)0);
-    XtAddCallback(pushButton_openswath, XmNactivateCallback, BxManageCB, (XtPointer)"form_open");
-
-    ac = 0;
-    separator2 = XmCreateSeparator(pulldownMenu_file,
-        (char *)"separator2",
-        args,
-        ac);
-    XtManageChild(separator2);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(pulldownMenu_file, (char *)"Quit",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_file, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_quit = XmCreatePushButton(pulldownMenu_file,
-            (char *)"pushButton_quit",
-            args,
-            ac);
-        XtManageChild(pushButton_quit);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_quit, XmNactivateCallback, do_mbeditviz_quit, (XtPointer)0);
-    XtAddCallback(pushButton_quit, XmNactivateCallback, BxExitCB, (XtPointer)0);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNsubMenuId, pulldownMenu_file); ac++;
-    XtSetValues(cascadeButton_file, args, ac);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(menuBar_mbeditviz, (char *)"Options",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 46); ac++;
-        XtSetArg(args[ac], XmNy, 5); ac++;
-        XtSetArg(args[ac], XmNwidth, 72); ac++;
-        XtSetArg(args[ac], XmNheight, 24); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(menuBar_mbeditviz, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        cascadeButton_options = XmCreateCascadeButton(menuBar_mbeditviz,
-            (char *)"cascadeButton_options",
-            args,
-            ac);
-        XtManageChild(cascadeButton_options);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 0); ac++;
-    XtSetArg(args[ac], XmNy, 0); ac++;
-    XtSetArg(args[ac], XmNwidth, 142); ac++;
-    XtSetArg(args[ac], XmNheight, 28); ac++;
-    pulldownMenu_options = XmCreatePulldownMenu(XtParent(cascadeButton_options),
-        (char *)"pulldownMenu_options",
-        args,
-        ac);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(pulldownMenu_options, (char *)"Generate New Grid",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_options, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_updategrid = XmCreatePushButton(pulldownMenu_options,
-            (char *)"pushButton_updategrid",
-            args,
-            ac);
-        XtManageChild(pushButton_updategrid);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_updategrid, XmNactivateCallback, BxManageCB, (XtPointer)"form_gridparameters");
-    XtAddCallback(pushButton_updategrid, XmNactivateCallback, do_mbeditviz_regrid, (XtPointer)0);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNsubMenuId, pulldownMenu_options); ac++;
-    XtSetValues(cascadeButton_options, args, ac);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(menuBar_mbeditviz, (char *)"Help",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 401); ac++;
-        XtSetArg(args[ac], XmNy, 5); ac++;
-        XtSetArg(args[ac], XmNwidth, 47); ac++;
-        XtSetArg(args[ac], XmNheight, 24); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(menuBar_mbeditviz, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        cascadeButton_help = XmCreateCascadeButton(menuBar_mbeditviz,
-            (char *)"cascadeButton_help",
-            args,
-            ac);
-        XtManageChild(cascadeButton_help);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 0); ac++;
-    XtSetArg(args[ac], XmNy, 0); ac++;
-    XtSetArg(args[ac], XmNwidth, 54); ac++;
-    XtSetArg(args[ac], XmNheight, 28); ac++;
-    pulldownMenu_help = XmCreatePulldownMenu(XtParent(cascadeButton_help),
-        (char *)"pulldownMenu_help",
-        args,
-        ac);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(pulldownMenu_help, (char *)"About",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_help, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_help_about = XmCreatePushButton(pulldownMenu_help,
-            (char *)"pushButton_help_about",
-            args,
-            ac);
-        XtManageChild(pushButton_help_about);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_help_about, XmNactivateCallback, BxManageCB, (XtPointer)"bulletinBoard_about");
-
-    ac = 0;
-    XtSetArg(args[ac], XmNsubMenuId, pulldownMenu_help); ac++;
-    XtSetValues(cascadeButton_help, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNresizePolicy, XmRESIZE_GROW); ac++;
-    XtSetArg(args[ac], XmNwidth, 453); ac++;
-    XtSetArg(args[ac], XmNheight, 523); ac++;
-    form_mbeditviz = XmCreateForm(mainWindow_mbeditviz,
-        (char *)"form_mbeditviz",
-        args,
-        ac);
-    XtManageChild(form_mbeditviz);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(form_mbeditviz, (char *)"Status:",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 0); ac++;
-        XtSetArg(args[ac], XmNy, 0); ac++;
-        XtSetArg(args[ac], XmNwidth, 210); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(form_mbeditviz, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        label_status = XmCreateLabel(form_mbeditviz,
-            (char *)"label_status",
-            args,
-            ac);
-        XtManageChild(label_status);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(form_mbeditviz, (char *)":::t\"Available Files: 0\":t\"Loaded Files: 0\":t\"Grid Bounds:\":t\"     Longitude: 0.00 0.00\":t\"     Latitude: 0.00 0.00\":t\"Grid Spacing: 10.0 m\"\"Mode: Edit Bathymetry\"",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNborderWidth, 1); ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNbackground,
-            BX_CONVERT(form_mbeditviz, (char *)"white",
-            XmRPixel, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNborderColor,
-            BX_CONVERT(form_mbeditviz, (char *)"black",
-            XmRPixel, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 30); ac++;
-        XtSetArg(args[ac], XmNwidth, 196); ac++;
-        XtSetArg(args[ac], XmNheight, 150); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(form_mbeditviz, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        label_mbeditviz_status = XmCreateLabel(form_mbeditviz,
-            (char *)"label_mbeditviz_status",
-            args,
-            ac);
-        XtManageChild(label_mbeditviz_status);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(form_mbeditviz, (char *)"Mode:",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 260); ac++;
-        XtSetArg(args[ac], XmNy, 0); ac++;
-        XtSetArg(args[ac], XmNwidth, 150); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(form_mbeditviz, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        label_programmode = XmCreateLabel(form_mbeditviz,
-            (char *)"label_programmode",
-            args,
-            ac);
-        XtManageChild(label_programmode);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 260); ac++;
-    XtSetArg(args[ac], XmNy, 30); ac++;
-    XtSetArg(args[ac], XmNwidth, 144); ac++;
-    XtSetArg(args[ac], XmNheight, 65); ac++;
-    XtSetArg(args[ac], XmNisHomogeneous, False); ac++;
-    radioBox_programmode = XmCreateRadioBox(form_mbeditviz,
-        (char *)"radioBox_programmode",
-        args,
-        ac);
-    XtManageChild(radioBox_programmode);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(radioBox_programmode, (char *)"Edit Bathymetry",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNwidth, 138); ac++;
-        XtSetArg(args[ac], XmNheight, 28); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(radioBox_programmode, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        toggleButton_mode_edit = XmCreateToggleButton(radioBox_programmode,
-            (char *)"toggleButton_mode_edit",
-            args,
-            ac);
-        XtManageChild(toggleButton_mode_edit);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(toggleButton_mode_edit, XmNvalueChangedCallback, do_mbeditviz_mode_change, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(radioBox_programmode, (char *)"Browse Only",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNwidth, 138); ac++;
-        XtSetArg(args[ac], XmNheight, 28); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(radioBox_programmode, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        toggleButton_mode_browse = XmCreateToggleButton(radioBox_programmode,
-            (char *)"toggleButton_mode_browse",
-            args,
-            ac);
-        XtManageChild(toggleButton_mode_browse);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(form_mbeditviz, (char *)":::t\"Remove\":t\"Selected\"\"Files\"",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 376); ac++;
-        XtSetArg(args[ac], XmNy, 100); ac++;
-        XtSetArg(args[ac], XmNwidth, 70); ac++;
-        XtSetArg(args[ac], XmNheight, 70); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(form_mbeditviz, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_deleteselected = XmCreatePushButton(form_mbeditviz,
-            (char *)"pushButton_deleteselected",
-            args,
-            ac);
-        XtManageChild(pushButton_deleteselected);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_deleteselected, XmNactivateCallback, do_mbeditviz_deleteselected, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(form_mbeditviz, (char *)":::t\"View\":t\"Selected\"\"Files\"",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 296); ac++;
-        XtSetArg(args[ac], XmNy, 100); ac++;
-        XtSetArg(args[ac], XmNwidth, 70); ac++;
-        XtSetArg(args[ac], XmNheight, 70); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(form_mbeditviz, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_viewselected = XmCreatePushButton(form_mbeditviz,
-            (char *)"pushButton_viewselected",
-            args,
-            ac);
-        XtManageChild(pushButton_viewselected);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_viewselected, XmNactivateCallback, do_mbeditviz_viewselected, (XtPointer)0);
-    XtAddCallback(pushButton_viewselected, XmNactivateCallback, BxManageCB, (XtPointer)"form_gridparameters");
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(form_mbeditviz, (char *)":::t\"View\":t\"All\"\"Files\"",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 220); ac++;
-        XtSetArg(args[ac], XmNy, 100); ac++;
-        XtSetArg(args[ac], XmNwidth, 70); ac++;
-        XtSetArg(args[ac], XmNheight, 70); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(form_mbeditviz, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_viewall = XmCreatePushButton(form_mbeditviz,
-            (char *)"pushButton_viewall",
-            args,
-            ac);
-        XtManageChild(pushButton_viewall);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_viewall, XmNactivateCallback, do_mbeditviz_viewall, (XtPointer)0);
-    XtAddCallback(pushButton_viewall, XmNactivateCallback, BxManageCB, (XtPointer)"form_gridparameters");
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(form_mbeditviz, (char *)"Swath Files:",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 190); ac++;
-        XtSetArg(args[ac], XmNwidth, 435); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(form_mbeditviz, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        label_filelist = XmCreateLabel(form_mbeditviz,
-            (char *)"label_filelist",
-            args,
-            ac);
-        XtManageChild(label_filelist);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNscrollingPolicy, XmAPPLICATION_DEFINED); ac++;
-    XtSetArg(args[ac], XmNx, 10); ac++;
-    XtSetArg(args[ac], XmNy, 220); ac++;
-    XtSetArg(args[ac], XmNwidth, 435); ac++;
-    XtSetArg(args[ac], XmNheight, 289); ac++;
-    scrolledWindow_mbeditviz = XmCreateScrolledWindow(form_mbeditviz,
-        (char *)"scrolledWindow_mbeditviz",
-        args,
-        ac);
-    XtManageChild(scrolledWindow_mbeditviz);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(scrolledWindow_mbeditviz, (char *)"-*-"MONO"-*-r-*-*-*-90-*-*-*-*-iso8859-1",
-        XmRFontList, 0, &argok)); if (argok) ac++;
-    XtSetArg(args[ac], XmNselectionPolicy, XmEXTENDED_SELECT); ac++;
-    XtSetArg(args[ac], XmNwidth, 435); ac++;
-    XtSetArg(args[ac], XmNheight, 289); ac++;
-    list_filelist = XmCreateList(scrolledWindow_mbeditviz,
-        (char *)"list_filelist",
-        args,
-        ac);
-    XtManageChild(list_filelist);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNtitle, "About MBeditviz..."); ac++;
-    XtSetArg(args[ac], XmNwidth, 463); ac++;
-    XtSetArg(args[ac], XmNheight, 531); ac++;
-    XtSetArg(args[ac], XmNdeleteResponse, XmDO_NOTHING); ac++;
-    dialogShell_about = XmCreateDialogShell(mainWindow_mbeditviz,
-        (char *)"dialogShell_about",
-        args,
-        ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNresizePolicy, XmRESIZE_GROW); ac++;
-    XtSetArg(args[ac], XmNx, 1049); ac++;
-    XtSetArg(args[ac], XmNy, 1071); ac++;
-    XtSetArg(args[ac], XmNwidth, 463); ac++;
-    XtSetArg(args[ac], XmNheight, 531); ac++;
-    bulletinBoard_about = XtCreateWidget((char *)"bulletinBoard_about",
-        xmBulletinBoardWidgetClass,
-        dialogShell_about,
-        args,
-        ac);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_about, (char *)"::#TimesMedium14:t\"MB-System Release 5.0.8\"#TimesMedium14\"February 2, 2006\"",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_about, (char *)"-*-"SERIF"-bold-r-*-*-*-240-*-*-*-*-iso8859-1=TimesBold24,-*-"SERIF"-bold-r-*-*-*-120-*-*-*-*-iso8859-1=TimesBold12,-*-"SERIF"-bold-r-*-*-*-140-*-*-*-*-iso8859-1=TimesBold14,-*-"SERIF"-medium-r-*-*-*-140-*-*-*-*-iso8859-1=TimesMedium14",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 410); ac++;
-        XtSetArg(args[ac], XmNwidth, 440); ac++;
-        XtSetArg(args[ac], XmNheight, 50); ac++;
-        label_about_version = XmCreateLabel(bulletinBoard_about,
-            (char *)"label_about_version",
-            args,
-            ac);
-        XtManageChild(label_about_version);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_about, (char *)"::#TimesBold14:t\"Created By:\"#TimesBold14\"David W. Caress   and   Dale N. Chayes \"",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_about, (char *)"-*-"SERIF"-bold-r-*-*-*-140-*-*-*-*-iso8859-1=TimesBold14,-*-"SERIF"-bold-r-*-*-*-240-*-*-*-*-iso8859-1=TimesBold24,-*-"SERIF"-bold-r-*-*-*-120-*-*-*-*-iso8859-1=TimesBold12",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 280); ac++;
-        XtSetArg(args[ac], XmNwidth, 440); ac++;
-        XtSetArg(args[ac], XmNheight, 60); ac++;
-        label_about_authors = XmCreateLabel(bulletinBoard_about,
-            (char *)"label_about_authors",
-            args,
-            ac);
-        XtManageChild(label_about_authors);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_about, (char *)"::#TimesBold12:t\"Monterey Bay\"#TimesBold12:t\"Aquarium\"#TimesBold12\"Research Institute\"",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_about, (char *)"-*-"SERIF"-bold-r-*-*-*-140-*-*-*-*-iso8859-1=TimesBold14,-*-"SERIF"-bold-r-*-*-*-240-*-*-*-*-iso8859-1=TimesBold24,-*-"SERIF"-bold-r-*-*-*-120-*-*-*-*-iso8859-1=TimesBold12",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 70); ac++;
-        XtSetArg(args[ac], XmNy, 340); ac++;
-        XtSetArg(args[ac], XmNwidth, 140); ac++;
-        XtSetArg(args[ac], XmNheight, 80); ac++;
-        label_about_MBARI = XmCreateLabel(bulletinBoard_about,
-            (char *)"label_about_MBARI",
-            args,
-            ac);
-        XtManageChild(label_about_MBARI);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_about, (char *)"::#TimesBold12:t\"Lamont-Doherty\"#TimesBold12:t\"Earth Observatory\"#TimesBold12\"of Columbia University\"",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_about, (char *)"-*-"SERIF"-bold-r-*-*-*-140-*-*-*-*-iso8859-1=TimesBold14,-*-"SERIF"-bold-r-*-*-*-240-*-*-*-*-iso8859-1=TimesBold24,-*-"SERIF"-bold-r-*-*-*-120-*-*-*-*-iso8859-1=TimesBold12",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 230); ac++;
-        XtSetArg(args[ac], XmNy, 340); ac++;
-        XtSetArg(args[ac], XmNwidth, 180); ac++;
-        XtSetArg(args[ac], XmNheight, 80); ac++;
-        label_about_LDEO = XmCreateLabel(bulletinBoard_about,
-            (char *)"label_about_LDEO",
-            args,
-            ac);
-        XtManageChild(label_about_LDEO);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 10); ac++;
-    XtSetArg(args[ac], XmNy, 260); ac++;
-    XtSetArg(args[ac], XmNwidth, 440); ac++;
-    XtSetArg(args[ac], XmNheight, 20); ac++;
-    separator3 = XmCreateSeparator(bulletinBoard_about,
-        (char *)"separator3",
-        args,
-        ac);
-    XtManageChild(separator3);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_about, (char *)"::#TimesBold14:t\"One component of the\"#TimesBold24\"MB-System\"#TimesBold14:t\"\"#TimesBold14:t\"An open Source Software Package\"#TimesBold14:t\"for Processing and Display\"#TimesBold14\"of Swath Sonar Data\"",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_about, (char *)"-*-"SERIF"-bold-r-*-*-*-140-*-*-*-*-iso8859-1=TimesBold14,-*-"SERIF"-bold-r-*-*-*-240-*-*-*-*-iso8859-1=TimesBold24",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 120); ac++;
-        XtSetArg(args[ac], XmNwidth, 440); ac++;
-        XtSetArg(args[ac], XmNheight, 140); ac++;
-        label_about_mbsystem = XmCreateLabel(bulletinBoard_about,
-            (char *)"label_about_mbsystem",
-            args,
-            ac);
-        XtManageChild(label_about_mbsystem);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 10); ac++;
-    XtSetArg(args[ac], XmNy, 100); ac++;
-    XtSetArg(args[ac], XmNwidth, 440); ac++;
-    XtSetArg(args[ac], XmNheight, 20); ac++;
-    separator1 = XmCreateSeparator(bulletinBoard_about,
-        (char *)"separator1",
-        args,
-        ac);
-    XtManageChild(separator1);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_about, (char *)"::#TimesBold24\"MBeditviz\":t\"\"#TimesBold18:t\"Swath Bathymetry Editing\"#TimesBold18:t\"and Patch Test Tool\"",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_about, (char *)"-*-"SERIF"-bold-r-*-*-*-180-*-*-*-*-iso8859-1=TimesBold18,-*-"SERIF"-bold-r-*-*-*-240-*-*-*-*-iso8859-1=TimesBold24",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 10); ac++;
-        XtSetArg(args[ac], XmNwidth, 440); ac++;
-        XtSetArg(args[ac], XmNheight, 110); ac++;
-        label_about_title = XmCreateLabel(bulletinBoard_about,
-            (char *)"label_about_title",
-            args,
-            ac);
-        XtManageChild(label_about_title);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_about, (char *)"Dismiss",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 170); ac++;
-        XtSetArg(args[ac], XmNy, 470); ac++;
-        XtSetArg(args[ac], XmNwidth, 120); ac++;
-        XtSetArg(args[ac], XmNheight, 50); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_about, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_about_dismiss = XmCreatePushButton(bulletinBoard_about,
-            (char *)"pushButton_about_dismiss",
-            args,
-            ac);
-        XtManageChild(pushButton_about_dismiss);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_about_dismiss, XmNactivateCallback, BxUnmanageCB, (XtPointer)"bulletinBoard_about");
-
-    ac = 0;
-    XtSetArg(args[ac], XmNtitle, "Please Wait..."); ac++;
-    XtSetArg(args[ac], XmNwidth, 409); ac++;
-    XtSetArg(args[ac], XmNheight, 93); ac++;
-    XtSetArg(args[ac], XmNdeleteResponse, XmDO_NOTHING); ac++;
-    dialogShell_mbeditviz_message = XmCreateDialogShell(mainWindow_mbeditviz,
-        (char *)"dialogShell_mbeditviz_message",
-        args,
-        ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNresizePolicy, XmRESIZE_GROW); ac++;
-    XtSetArg(args[ac], XmNx, 1076); ac++;
-    XtSetArg(args[ac], XmNy, 1290); ac++;
-    XtSetArg(args[ac], XmNwidth, 409); ac++;
-    XtSetArg(args[ac], XmNheight, 93); ac++;
-    bulletinBoard_mbeditviz_message = XtCreateWidget((char *)"bulletinBoard_mbeditviz_message",
-        xmBulletinBoardWidgetClass,
-        dialogShell_mbeditviz_message,
-        args,
-        ac);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_mbeditviz_message, (char *)"Thank you for your patience...",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 50); ac++;
-        XtSetArg(args[ac], XmNwidth, 350); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_mbeditviz_message, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        label_mbeditviz_patience = XmCreateLabel(bulletinBoard_mbeditviz_message,
-            (char *)"label_mbeditviz_patience",
-            args,
-            ac);
-        XtManageChild(label_mbeditviz_patience);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_mbeditviz_message, (char *)"Message...",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 10); ac++;
-        XtSetArg(args[ac], XmNwidth, 380); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_mbeditviz_message, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        label_mbeditviz_message = XmCreateLabel(bulletinBoard_mbeditviz_message,
-            (char *)"label_mbeditviz_message",
-            args,
-            ac);
-        XtManageChild(label_mbeditviz_message);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNtitle, "Open Swath Data"); ac++;
-    XtSetArg(args[ac], XmNwidth, 504); ac++;
-    XtSetArg(args[ac], XmNheight, 550); ac++;
-    XtSetArg(args[ac], XmNdeleteResponse, XmDO_NOTHING); ac++;
-    dialogShell_open = XmCreateDialogShell(mainWindow_mbeditviz,
-        (char *)"dialogShell_open",
-        args,
-        ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNresizePolicy, XmRESIZE_GROW); ac++;
-    XtSetArg(args[ac], XmNx, 1029); ac++;
-    XtSetArg(args[ac], XmNy, 1062); ac++;
-    XtSetArg(args[ac], XmNwidth, 504); ac++;
-    XtSetArg(args[ac], XmNheight, 550); ac++;
-    form_open = XtCreateWidget((char *)"form_open",
-        xmFormWidgetClass,
-        dialogShell_open,
-        args,
-        ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 310); ac++;
-    XtSetArg(args[ac], XmNy, 478); ac++;
-    XtSetArg(args[ac], XmNwidth, 122); ac++;
-    XtSetArg(args[ac], XmNheight, 65); ac++;
-    XtSetArg(args[ac], XmNisHomogeneous, False); ac++;
-    radioBox_openmode = XmCreateRadioBox(form_open,
-        (char *)"radioBox_openmode",
-        args,
-        ac);
-    XtManageChild(radioBox_openmode);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(radioBox_openmode, (char *)"Output Edits",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNwidth, 116); ac++;
-        XtSetArg(args[ac], XmNheight, 28); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(radioBox_openmode, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        toggleButton_openmodeedit = XmCreateToggleButton(radioBox_openmode,
-            (char *)"toggleButton_openmodeedit",
-            args,
-            ac);
-        XtManageChild(toggleButton_openmodeedit);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(toggleButton_openmodeedit, XmNvalueChangedCallback, do_mbeditviz_changeoutputmode, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(radioBox_openmode, (char *)"Browse Only",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNwidth, 116); ac++;
-        XtSetArg(args[ac], XmNheight, 28); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(radioBox_openmode, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        toggleButton_openmodebrowse = XmCreateToggleButton(radioBox_openmode,
-            (char *)"toggleButton_openmodebrowse",
-            args,
-            ac);
-        XtManageChild(toggleButton_openmodebrowse);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(form_open, (char *)"Output Mode:",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 200); ac++;
-        XtSetArg(args[ac], XmNy, 497); ac++;
-        XtSetArg(args[ac], XmNwidth, 120); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(form_open, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        label_outputmode = XmCreateLabel(form_open,
-            (char *)"label_outputmode",
-            args,
-            ac);
-        XtManageChild(label_outputmode);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 120); ac++;
-    XtSetArg(args[ac], XmNy, 490); ac++;
-    XtSetArg(args[ac], XmNwidth, 70); ac++;
-    XtSetArg(args[ac], XmNheight, 40); ac++;
-    XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(form_open, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-        XmRFontList, 0, &argok)); if (argok) ac++;
-    text_format = XmCreateText(form_open,
-        (char *)"text_format",
-        args,
-        ac);
-    XtManageChild(text_format);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(form_open, (char *)"MBIO Format ID:",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNx, 0); ac++;
-        XtSetArg(args[ac], XmNy, 497); ac++;
-        XtSetArg(args[ac], XmNwidth, 130); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(form_open, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        label_open_mbio = XmCreateLabel(form_open,
-            (char *)"label_open_mbio",
-            args,
-            ac);
-        XtManageChild(label_open_mbio);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNnoResize, True); ac++;
-    XtSetArg(args[ac], XmNresizePolicy, XmRESIZE_GROW); ac++;
-    XtSetArg(args[ac], XmNx, 0); ac++;
-    XtSetArg(args[ac], XmNy, 0); ac++;
-    XtSetArg(args[ac], XmNwidth, 498); ac++;
-    XtSetArg(args[ac], XmNheight, 478); ac++;
-    fileSelectionBox = XmCreateFileSelectionBox(form_open,
-        (char *)"fileSelectionBox",
-        args,
-        ac);
-    XtManageChild(fileSelectionBox);
-    XtAddCallback(fileSelectionBox, XmNokCallback, do_mbeditviz_openfile, (XtPointer)0);
-    XtAddCallback(fileSelectionBox, XmNokCallback, BxUnmanageCB, (XtPointer)"form_open");
-    XtAddCallback(fileSelectionBox, XmNcancelCallback, BxUnmanageCB, (XtPointer)"form_open");
-
-    ac = 0;
-    XtSetArg(args[ac], XmNtitle, "Grid Parameters"); ac++;
-    XtSetArg(args[ac], XmNwidth, 453); ac++;
-    XtSetArg(args[ac], XmNheight, 337); ac++;
-    XtSetArg(args[ac], XmNdeleteResponse, XmDO_NOTHING); ac++;
-    dialogShell_gridparameters = XmCreateDialogShell(mainWindow_mbeditviz,
-        (char *)"dialogShell_gridparameters",
-        args,
-        ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNresizePolicy, XmRESIZE_GROW); ac++;
-    XtSetArg(args[ac], XmNx, 1054); ac++;
-    XtSetArg(args[ac], XmNy, 1168); ac++;
-    XtSetArg(args[ac], XmNwidth, 453); ac++;
-    XtSetArg(args[ac], XmNheight, 337); ac++;
-    form_gridparameters = XtCreateWidget((char *)"form_gridparameters",
-        xmFormWidgetClass,
-        dialogShell_gridparameters,
-        args,
-        ac);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(form_gridparameters, (char *)"Grid Cell Size (m)",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNtitleString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNminimum, 1); ac++;
-        XtSetArg(args[ac], XmNdecimalPoints, 2); ac++;
-        XtSetArg(args[ac], XmNvalue, 100); ac++;
-        XtSetArg(args[ac], XmNmaximum, 25000); ac++;
-        XtSetArg(args[ac], XmNshowArrows, TRUE); ac++;
-        XtSetArg(args[ac], XmNshowValue, TRUE); ac++;
-        XtSetArg(args[ac], XmNhighlightThickness, 1); ac++;
-        XtSetArg(args[ac], XmNorientation, XmHORIZONTAL); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 128); ac++;
-        XtSetArg(args[ac], XmNwidth, 430); ac++;
-        XtSetArg(args[ac], XmNheight, 61); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(form_gridparameters, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        scale_cellsize = XmCreateScale(form_gridparameters,
-            (char *)"scale_cellsize",
-            args,
-            ac);
-        XtManageChild(scale_cellsize);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(scale_cellsize, XmNvalueChangedCallback, do_mbeditviz_changecellsize, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(form_gridparameters, (char *)":::t\"Current Grid Parameters:\":t\"    Longitude: -151.56667 -150.00000\":t\"    Latitude:     23.4567 24.0000\":t\"    Cell Size: 10.00 m\"\"    Dimensions:  1234 X 2345\"",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNborderWidth, 0); ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 10); ac++;
-        XtSetArg(args[ac], XmNwidth, 432); ac++;
-        XtSetArg(args[ac], XmNheight, 110); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(form_gridparameters, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        label_current = XmCreateLabel(form_gridparameters,
-            (char *)"label_current",
-            args,
-            ac);
-        XtManageChild(label_current);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(form_gridparameters, (char *)":::t\"Selected Grid Parameters:\":t\"    Cell Size: 5.00 m\"\"    Dimensions 2345 X 3456\"",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNborderWidth, 1); ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNbackground,
-            BX_CONVERT(form_gridparameters, (char *)"white",
-            XmRPixel, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 200); ac++;
-        XtSetArg(args[ac], XmNwidth, 430); ac++;
-        XtSetArg(args[ac], XmNheight, 70); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(form_gridparameters, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        label_implied = XmCreateLabel(form_gridparameters,
-            (char *)"label_implied",
-            args,
-            ac);
-        XtManageChild(label_implied);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(form_gridparameters, (char *)"Dismiss",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 290); ac++;
-        XtSetArg(args[ac], XmNy, 290); ac++;
-        XtSetArg(args[ac], XmNwidth, 100); ac++;
-        XtSetArg(args[ac], XmNheight, 32); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(form_gridparameters, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_gridparameters_dismiss = XmCreatePushButton(form_gridparameters,
-            (char *)"pushButton_gridparameters_dismiss",
-            args,
-            ac);
-        XtManageChild(pushButton_gridparameters_dismiss);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_gridparameters_dismiss, XmNactivateCallback, BxUnmanageCB, (XtPointer)"form_gridparameters");
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(form_gridparameters, (char *)"Apply",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 70); ac++;
-        XtSetArg(args[ac], XmNy, 290); ac++;
-        XtSetArg(args[ac], XmNwidth, 100); ac++;
-        XtSetArg(args[ac], XmNheight, 32); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(form_gridparameters, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_gridparameters_apply = XmCreatePushButton(form_gridparameters,
-            (char *)"pushButton_gridparameters_apply",
-            args,
-            ac);
-        XtManageChild(pushButton_gridparameters_apply);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_gridparameters_apply, XmNactivateCallback, BxUnmanageCB, (XtPointer)"form_gridparameters");
-    XtAddCallback(pushButton_gridparameters_apply, XmNactivateCallback, do_mbeditviz_updategrid, (XtPointer)0);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNwidth, 311); ac++;
-    XtSetArg(args[ac], XmNheight, 205); ac++;
-    XtSetArg(args[ac], XmNdeleteResponse, XmDO_NOTHING); ac++;
-    dialogShell_error = XmCreateDialogShell(mainWindow_mbeditviz,
-        (char *)"dialogShell_error",
-        args,
-        ac);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(dialogShell_error, (char *)"Error",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNdialogTitle, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNdialogStyle, XmDIALOG_APPLICATION_MODAL); ac++;
-        XtSetArg(args[ac], XmNresizePolicy, XmRESIZE_GROW); ac++;
-        XtSetArg(args[ac], XmNx, 1125); ac++;
-        XtSetArg(args[ac], XmNy, 1234); ac++;
-        XtSetArg(args[ac], XmNwidth, 311); ac++;
-        XtSetArg(args[ac], XmNheight, 205); ac++;
-        bulletinBoard_error = XtCreateWidget((char *)"bulletinBoard_error",
-            xmBulletinBoardWidgetClass,
-            dialogShell_error,
-            args,
-            ac);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_error, (char *)"You probably do not have write",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 40); ac++;
-        XtSetArg(args[ac], XmNwidth, 290); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_error, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        label_error_two = XmCreateLabel(bulletinBoard_error,
-            (char *)"label_error_two",
-            args,
-            ac);
-        XtManageChild(label_error_two);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_error, (char *)"Unable to open output file.",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 10); ac++;
-        XtSetArg(args[ac], XmNwidth, 290); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_error, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        label_error_one = XmCreateLabel(bulletinBoard_error,
-            (char *)"label_error_one",
-            args,
-            ac);
-        XtManageChild(label_error_one);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_error, (char *)"permission in this directory!",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 70); ac++;
-        XtSetArg(args[ac], XmNwidth, 290); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_error, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        label_error_three = XmCreateLabel(bulletinBoard_error,
-            (char *)"label_error_three",
-            args,
-            ac);
-        XtManageChild(label_error_three);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_error, (char *)"OK",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 110); ac++;
-        XtSetArg(args[ac], XmNy, 110); ac++;
-        XtSetArg(args[ac], XmNwidth, 90); ac++;
-        XtSetArg(args[ac], XmNheight, 40); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_error, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_error = XmCreatePushButton(bulletinBoard_error,
-            (char *)"pushButton_error",
-            args,
-            ac);
-        XtManageChild(pushButton_error);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_error, XmNactivateCallback, BxUnmanageCB, (XtPointer)"bulletinBoard_error");
-    ac = 0;
-    XtSetArg(args[ac], XmNtopAttachment, XmATTACH_WIDGET); ac++;
-    XtSetArg(args[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNbottomAttachment, XmATTACH_NONE); ac++;
-    XtSetArg(args[ac], XmNbottomOffset, 0); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 10); ac++;
-    XtSetArg(args[ac], XmNrightOffset, 13); ac++;
-    XtSetArg(args[ac], XmNtopOffset, 8); ac++;
-    XtSetArg(args[ac], XmNtopWidget, label_current); ac++;
-    XtSetValues(scale_cellsize, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNtopAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 10); ac++;
-    XtSetArg(args[ac], XmNrightOffset, 11); ac++;
-    XtSetArg(args[ac], XmNtopOffset, 10); ac++;
-    XtSetValues(label_current, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNtopAttachment, XmATTACH_WIDGET); ac++;
-    XtSetArg(args[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNbottomAttachment, XmATTACH_NONE); ac++;
-    XtSetArg(args[ac], XmNbottomOffset, 0); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 10); ac++;
-    XtSetArg(args[ac], XmNrightOffset, 11); ac++;
-    XtSetArg(args[ac], XmNtopOffset, 11); ac++;
-    XtSetArg(args[ac], XmNtopWidget, scale_cellsize); ac++;
-    XtSetValues(label_implied, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNtopAttachment, XmATTACH_WIDGET); ac++;
-    XtSetArg(args[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_NONE); ac++;
-    XtSetArg(args[ac], XmNbottomAttachment, XmATTACH_NONE); ac++;
-    XtSetArg(args[ac], XmNrightOffset, 63); ac++;
-    XtSetArg(args[ac], XmNtopOffset, 18); ac++;
-    XtSetArg(args[ac], XmNtopWidget, label_implied); ac++;
-    XtSetValues(pushButton_gridparameters_dismiss, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNtopAttachment, XmATTACH_WIDGET); ac++;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNbottomAttachment, XmATTACH_NONE); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 70); ac++;
-    XtSetArg(args[ac], XmNtopOffset, 18); ac++;
-    XtSetArg(args[ac], XmNtopWidget, label_implied); ac++;
-    XtSetValues(pushButton_gridparameters_apply, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNtopAttachment, XmATTACH_NONE); ac++;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNbottomAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNbottomOffset, 7); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 310); ac++;
-    XtSetValues(radioBox_openmode, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNtopAttachment, XmATTACH_NONE); ac++;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNbottomAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNbottomOffset, 23); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 200); ac++;
-    XtSetValues(label_outputmode, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNtopAttachment, XmATTACH_NONE); ac++;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNbottomAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNbottomOffset, 20); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 120); ac++;
-    XtSetValues(text_format, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNtopAttachment, XmATTACH_NONE); ac++;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNbottomAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNbottomOffset, 23); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 0); ac++;
-    XtSetValues(label_open_mbio, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNtopAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNbottomAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNbottomOffset, 72); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 0); ac++;
-    XtSetArg(args[ac], XmNrightOffset, 6); ac++;
-    XtSetArg(args[ac], XmNtopOffset, 0); ac++;
-    XtSetValues(fileSelectionBox, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNmenuHelpWidget, cascadeButton_help); ac++;
-    XtSetValues(menuBar_mbeditviz, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 0); ac++;
-    XtSetArg(args[ac], XmNrightOffset, 243); ac++;
-    XtSetArg(args[ac], XmNtopOffset, 0); ac++;
-    XtSetValues(label_status, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 10); ac++;
-    XtSetArg(args[ac], XmNrightOffset, 245); ac++;
-    XtSetArg(args[ac], XmNtopOffset, 30); ac++;
-    XtSetValues(label_mbeditviz_status, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNtopAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_NONE); ac++;
-    XtSetArg(args[ac], XmNbottomAttachment, XmATTACH_NONE); ac++;
-    XtSetArg(args[ac], XmNbottomOffset, 0); ac++;
-    XtSetArg(args[ac], XmNrightOffset, 43); ac++;
-    XtSetArg(args[ac], XmNtopOffset, 0); ac++;
-    XtSetValues(label_programmode, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNrightAttachment, XmATTACH_NONE); ac++;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 260); ac++;
-    XtSetArg(args[ac], XmNtopOffset, 30); ac++;
-    XtSetValues(radioBox_programmode, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNrightAttachment, XmATTACH_NONE); ac++;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_WIDGET); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 10); ac++;
-    XtSetArg(args[ac], XmNtopOffset, 100); ac++;
-    XtSetArg(args[ac], XmNleftWidget, pushButton_viewselected); ac++;
-    XtSetValues(pushButton_deleteselected, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNrightAttachment, XmATTACH_NONE); ac++;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_WIDGET); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 6); ac++;
-    XtSetArg(args[ac], XmNtopOffset, 100); ac++;
-    XtSetArg(args[ac], XmNleftWidget, pushButton_viewall); ac++;
-    XtSetValues(pushButton_viewselected, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNrightAttachment, XmATTACH_NONE); ac++;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_WIDGET); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 12); ac++;
-    XtSetArg(args[ac], XmNrightOffset, 0); ac++;
-    XtSetArg(args[ac], XmNtopOffset, 100); ac++;
-    XtSetArg(args[ac], XmNleftWidget, label_mbeditviz_status); ac++;
-    XtSetValues(pushButton_viewall, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 10); ac++;
-    XtSetArg(args[ac], XmNrightOffset, 8); ac++;
-    XtSetArg(args[ac], XmNtopOffset, 190); ac++;
-    XtSetValues(label_filelist, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNtopAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNbottomAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNbottomOffset, 14); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 10); ac++;
-    XtSetArg(args[ac], XmNrightOffset, 8); ac++;
-    XtSetArg(args[ac], XmNtopOffset, 220); ac++;
-    XtSetValues(scrolledWindow_mbeditviz, args, ac);
-
-
-
-    /* Begin user code block <end_CreatemainWindow_mbeditviz> */
-    /* End user code block <end_CreatemainWindow_mbeditviz> */
-    return( mainWindow_mbeditviz );
-}
diff --git a/src/mbeditviz/mbeditviz_creation.h b/src/mbeditviz/mbeditviz_creation.h
deleted file mode 100644
index 26b4ed4..0000000
--- a/src/mbeditviz/mbeditviz_creation.h
+++ /dev/null
@@ -1,63 +0,0 @@
-
-/* Begin user code block <abstract> */
-/* End user code block <abstract> */
-
-/**
- * WARNING: This file is overwritten at code generation time.
- * Any changes to this file will be lost.
- */
-/*
- *
- * Created by BuilderXcessory Version 6.1.3
- * Generated by Code Generator Xcessory 6.1.3 (08/19/04) CGX Scripts 6.1 Motif 2.1 
- *
- */
-#ifndef mbeditviz_creation_H
-#define mbeditviz_creation_H
-
-/*
- * Global widget declarations.
- *        - EXTERNAL is set to extern if the
- *          defs file is not included from the
- *          main file.
- */
-#ifdef DECLARE_BX_GLOBALS
-#define EXTERNAL
-#else
-#define EXTERNAL extern
-#endif
-
-/**
- * Start Global Widget Declarations.
- */
-EXTERNAL Widget   bulletinBoard_error;
-EXTERNAL Widget   label_error_two;
-EXTERNAL Widget   label_error_one;
-EXTERNAL Widget   label_error_three;
-EXTERNAL Widget   scale_cellsize;
-EXTERNAL Widget   label_current;
-EXTERNAL Widget   label_implied;
-EXTERNAL Widget   dialogShell_open;
-EXTERNAL Widget   form_open;
-EXTERNAL Widget   radioBox_openmode;
-EXTERNAL Widget   toggleButton_openmodeedit;
-EXTERNAL Widget   toggleButton_openmodebrowse;
-EXTERNAL Widget   text_format;
-EXTERNAL Widget   fileSelectionBox;
-EXTERNAL Widget   dialogShell_mbeditviz_message;
-EXTERNAL Widget   bulletinBoard_mbeditviz_message;
-EXTERNAL Widget   label_mbeditviz_message;
-EXTERNAL Widget   label_about_version;
-EXTERNAL Widget   pushButton_openswath;
-EXTERNAL Widget   pushButton_updategrid;
-EXTERNAL Widget   label_mbeditviz_status;
-EXTERNAL Widget   toggleButton_mode_edit;
-EXTERNAL Widget   toggleButton_mode_browse;
-EXTERNAL Widget   pushButton_deleteselected;
-EXTERNAL Widget   pushButton_viewselected;
-EXTERNAL Widget   pushButton_viewall;
-EXTERNAL Widget   list_filelist;
-/**
- * End Global Widget Declarations.
- */
-#endif
diff --git a/src/mbeditviz/mbeditviz_main.c b/src/mbeditviz/mbeditviz_main.c
deleted file mode 100644
index 9b4b493..0000000
--- a/src/mbeditviz/mbeditviz_main.c
+++ /dev/null
@@ -1,240 +0,0 @@
-
-/* Begin user code block <abstract> */
-/*--------------------------------------------------------------------
- *    The MB-system:	mbeditviz_main.c		4/27/2007
- *    $Id: mbeditviz_main.c 2250 2015-06-30 02:12:26Z caress $
- *
- *    Copyright (c) 2007-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/* End user code block <abstract> */
-
-/**
- * README: Portions of this file are merged at file generation
- * time. Edits can be made *only* in between specified code blocks, look
- * for keywords <Begin user code> and <End user code>.
- */
-/*
- * Generated by the ICS Builder Xcessory (BX).
- *
- * BuilderXcessory Version 6.1.3
- * Code Generator Xcessory 6.1.3 (08/19/04) CGX Scripts 6.1 Motif 2.1
- *
- */
-
-
-/* Begin user code block <file_comments> */
-/* End user code block <file_comments> */
-
-/*
- * Motif required Headers
- */
-#include <X11/StringDefs.h>
-#include <Xm/Xm.h>
-#include <Xm/DialogS.h>
-#include <Xm/RepType.h>
-#include <Xm/MwmUtil.h>
-
-/**
- * Globally included information.
- */
-
-
-/*
- * Headers for classes used in this program
- */
-
-/**
- * Common constant and pixmap declarations.
- */
-#include "mbeditviz_creation.h"
-
-/**
- * Convenience functions from utilities file.
- */
-extern void RegisterBxConverters(XtAppContext);
-extern XtPointer BX_CONVERT(Widget, char *, char *, int, Boolean *);
-extern XtPointer BX_DOUBLE(double);
-extern XtPointer BX_SINGLE(float);
-extern void BX_MENU_POST(Widget, XtPointer, XEvent *, Boolean *);
-extern Pixmap XPM_PIXMAP(Widget, char **);
-extern void BX_SET_BACKGROUND_COLOR(Widget, ArgList, Cardinal *, Pixel);
-
-/**
- * Declarations for shell callbacks.
- */
-extern void do_mbeditviz_quit(Widget, XtPointer, XtPointer);
-extern void BxExitCB(Widget, XtPointer, XtPointer);
-
-/* Begin user code block <globals> */
-
-#include <stdio.h>
-#include <stdlib.h>
-
-/* Avoid conflict due to BOOL redefinitions (Xm vs Win headers) */
-#ifdef WIN32
-#	undef BOOL
-#endif
-
-/* MBIO include files */
-#include "mb_status.h"
-#include "mb_define.h"
-
-/* mbview include file */
-#include "mbview.h"
-
-/* global mbeditviz variables */
-#include "mbeditviz.h"
-
-/* function prototypes */
-Widget CreatemainWindow_mbeditviz(Widget parent);
-
-/* use these parameters only when debugging X events */
-#ifdef MBEDITVIZ_DEBUG
-char	eventname[64];
-XEvent	event;
-XAnyEvent *xany;
-XKeyEvent *xkey;
-XButtonEvent *xbutton;
-XMotionEvent *xmotion;
-XCrossingEvent *xcrossing;
-XFocusChangeEvent *xfocus;
-XExposeEvent *xexpose;
-XGraphicsExposeEvent *xgraphicsexpose;
-XNoExposeEvent *xnoexpose;
-XVisibilityEvent *xvisibility;
-XCreateWindowEvent *xcreatewindow;
-XDestroyWindowEvent *xdestroywindow;
-XUnmapEvent *xunmap;
-XMapEvent *xmap;
-XMapRequestEvent *xmaprequest;
-XReparentEvent *xreparent;
-XConfigureEvent *xconfigure;
-XGravityEvent *xgravity;
-XResizeRequestEvent *xresizerequest;
-XConfigureRequestEvent *xconfigurerequest;
-XCirculateEvent *xcirculate;
-XCirculateRequestEvent *xcirculaterequest;
-XPropertyEvent *xproperty;
-XSelectionClearEvent *xselectionclear;
-XSelectionRequestEvent *xselectionrequest;
-XSelectionEvent *xselection;
-XColormapEvent *xcolormap;
-XClientMessageEvent *xclient;
-XMappingEvent *xmapping;
-XErrorEvent *xerror;
-XKeymapEvent *xkeymap;
-#endif
-
-/* End user code block <globals> */
-
-/**
- * Change this line via the Output Application Names Dialog.
- */
-#define BX_APP_CLASS "MB-System"
-
-int main( int argc, char **argv)
-{
-    Widget       parent;
-    XtAppContext app;
-    Arg          args[256];
-    Cardinal     ac;
-    Widget   topLevelShell;
-    Widget   mainWindow_mbeditviz;
-
-    /* Begin user code block <declarations> */
-
-    int		argcsave;
-    argcsave = argc;
-    argc = 1;
-
-    /* End user code block <declarations> */
-
-    /*
-     * Initialize Xt.
-     */
-
-    // XtSetLanguageProc(NULL, (XtLanguageProc) NULL, NULL);
-
-    /*
-     * The applicationShell is created as an unrealized
-     * parent for multiple topLevelShells.  The topLevelShells
-     * are created as popup children of the applicationShell.
-     * This is a recommendation of Paul Asente & Ralph Swick in
-     * _X_Window_System_Toolkit_ p. 677.
-     */
-
-    parent = XtVaOpenApplication ( &app,
-                                   BX_APP_CLASS,
-                                   NULL,
-                                   0,
-                                   &argc,
-                                   argv,
-                                   NULL,
-                                   sessionShellWidgetClass,
-                                   NULL );
-
-    RegisterBxConverters(app);
-    XmRepTypeInstallTearOffModelConverter();
-
-    /* Begin user code block <create_shells> */
-    /* End user code block <create_shells> */
-
-    /*
-     * Create classes and widgets used in this program.
-     */
-
-    /* Begin user code block <create_topLevelShell> */
-    /* End user code block <create_topLevelShell> */
-
-    ac = 0;
-    XtSetArg(args[ac], XmNtitle, "MBeditviz"); ac++;
-    XtSetArg(args[ac], XmNx, 180); ac++;
-    XtSetArg(args[ac], XmNy, 583); ac++;
-    XtSetArg(args[ac], XmNwidth, 453); ac++;
-    XtSetArg(args[ac], XmNheight, 557); ac++;
-    topLevelShell = XtCreatePopupShell((char *)"topLevelShell",
-        topLevelShellWidgetClass,
-        parent,
-        args,
-        ac);
-    XtAddCallback(topLevelShell, XmNdestroyCallback, do_mbeditviz_quit, (XtPointer)0);
-    XtAddCallback(topLevelShell, XmNdestroyCallback, BxExitCB, (XtPointer)0);
-    mainWindow_mbeditviz = (Widget)CreatemainWindow_mbeditviz(topLevelShell);
-    XtManageChild(mainWindow_mbeditviz);
-    XtPopup(XtParent(mainWindow_mbeditviz), XtGrabNone);
-
-    /* Begin user code block <app_procedures> */
-
-    /* End user code block <app_procedures> */
-
-    /* Begin user code block <main_loop> */
-
-    /* initialize the gui code */
-    do_mbeditviz_init(parent, app);
-
-    /* initialize the vizualization widgets code */
-    mbview_startup(mbev_verbose, parent, app, &mbev_error);
-    mb3dsoundings_startup(mbev_verbose, parent, app, &mbev_error);
-    mb3dsoundings_set_dismiss_notify(mbev_verbose, mbeditviz_mb3dsoundings_dismiss, &mbev_error);
-    mb3dsoundings_set_edit_notify(mbev_verbose, mbeditviz_mb3dsoundings_edit, &mbev_error);
-
-    /* initialize the program code */
-    mbeditviz_init(argcsave,argv);
-
-    /* End user code block <main_loop> */
-
-    XtAppMainLoop(app);
-
-    /*
-     * A return value regardless of whether or not the main loop ends.
-     */
-     return(0);
-}
diff --git a/src/mbeditviz/mbeditviz_prog.c b/src/mbeditviz/mbeditviz_prog.c
deleted file mode 100644
index 01e89c0..0000000
--- a/src/mbeditviz/mbeditviz_prog.c
+++ /dev/null
@@ -1,4460 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbeditviz_prog.c		5/1/2007
- *    $Id: mbeditviz_prog.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 2007-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- *
- * MBeditviz is an interactive swath bathymetry editor and patch
- * test tool for  MB-System.
- * It can work with any data format supported by the MBIO library.
- * This include file contains global control parameters shared with
- * the Motif interface code.
- *
- * Author:	D. W. Caress
- * Date:	May 1, 2007
- *
- */
-
-/* Standard includes */
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <string.h>
-#include <ctype.h>
-#include <math.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-
-/* MBIO include files */
-#include "mb_status.h"
-#include "mb_define.h"
-#include "mb_format.h"
-#include "mb_aux.h"
-#include "mbsys_singlebeam.h"
-
-/* mbview include file */
-#include <X11/StringDefs.h>
-#include <Xm/Xm.h>
-#include "mbview.h"
-
-/* mbeditviz include file - define globals here */
-#define MBEDITVIZ_DECLARE_GLOBALS
-#include "mbeditviz.h"
-
-/* id variables */
-static char rcs_id[] = "$Id: mbeditviz_prog.c 2227 2015-02-05 21:12:31Z caress $";
-static char program_name[] = "MBeditviz";
-static char help_message[] = "MBeditviz is a bathymetry editor and patch test tool.";
-static char usage_message[] = "mbeditviz [-H -T -V]";
-
-
-/* status variables */
-char	*error_message;
-char	message[MB_PATH_MAXLINE];
-char	error1[MB_PATH_MAXLINE];
-char	error2[MB_PATH_MAXLINE];
-char	error3[MB_PATH_MAXLINE];
-
-/* data file parameters */
-void	*datalist;
-
-/* MBIO control parameters */
-int	mbdef_pings;
-int	mbdef_format;
-int	mbdef_lonflip;
-double	mbdef_bounds[4];
-int	mbdef_btime_i[7];
-int	mbdef_etime_i[7];
-double	mbdef_btime_d;
-double	mbdef_etime_d;
-double	mbdef_speedmin;
-double	mbdef_timegap;
-int	mbdef_uselockfiles;
-
-/*--------------------------------------------------------------------*/
-int mbeditviz_init(int argc,char **argv)
-{
-	/* local variables */
-	char	*function_name = "mbeditviz_init";
-	int	fileflag = 0;
-	char	ifile[MB_PATH_MAXLINE];
-	int	i;
-
-	/* parsing variables */
-	extern char *optarg;
-	int	errflg = 0;
-	int	c;
-	int	help = 0;
-	int	flag = 0;
-
-	/* set default global control parameters */
-	mbev_status = MB_SUCCESS;
-	mbev_error = MB_ERROR_NO_ERROR;
-	mbev_verbose = 0;
-
-	mbev_mode_output = MBEV_OUTPUT_MODE_EDIT;
-	mbev_grid_algorithm = MBEV_GRID_ALGORITH_FOOTPRINT;
-	mbev_num_files = 0;
-	mbev_num_files_alloc = 0;
-	mbev_num_files_loaded = 0;
-	mbev_num_pings_loaded = 0;
-	mbev_num_soundings_loaded = 0;
-	for (i=0;i<4;i++)
-		{
-		mbev_bounds[i] = 0.0;
-		}
-	mbev_files = NULL;
-	mbev_grid.status = MBEV_GRID_NONE;
-	mbev_grid.projection_id[0] = 0;
-	for (i=0;i<4;i++)
-		{
-		mbev_grid.bounds[i] = 0.0;
-		mbev_grid.boundsutm[i] = 0.0;
-		}
-	mbev_grid.dx = 0.0;
-	mbev_grid.dy = 0.0;
-	mbev_grid.nx = 0;
-	mbev_grid.ny = 0;
-	mbev_grid.min = 0.0;
-	mbev_grid.max = 0.0;
-	mbev_grid.smin = 0.0;
-	mbev_grid.smax = 0.0;
-	mbev_grid.nodatavalue = 0.0;
-	mbev_grid.sum = NULL;
-	mbev_grid.wgt = NULL;
-	mbev_grid.val = NULL;
-	mbev_grid.sgm = NULL;
-	for (i=0;i<4;i++)
-		{
-		mbev_grid_bounds[i] = 0.0;
-		mbev_grid_boundsutm[i] = 0.0;
-		}
-	mbev_grid_cellsize = 0.0;
-	mbev_grid_nx = 0;
-	mbev_grid_ny = 0;
-	mbev_selected.xorigin = 0.0;
-	mbev_selected.yorigin = 0.0;
-	mbev_selected.zorigin = 0.0;
-	mbev_selected.bearing = 0.0;
-	mbev_selected.xmin = 0.0;
-	mbev_selected.ymin = 0.0;
-	mbev_selected.zmin = 0.0;
-	mbev_selected.xmax = 0.0;
-	mbev_selected.ymax = 0.0;
-	mbev_selected.zmax = 0.0;
-	mbev_selected.sinbearing = 0.0;
-	mbev_selected.cosbearing = 0.0;
-	mbev_selected.scale = 0.0;
-	mbev_selected.zscale = 0.0;
-	mbev_selected.num_soundings = 0;
-	mbev_selected.num_soundings_unflagged = 0;
-	mbev_selected.num_soundings_flagged = 0;
-	mbev_selected.num_soundings_alloc = 0;
-	mbev_selected.soundings = NULL;
-	mbev_rollbias = 0.0;
-	mbev_pitchbias = 0.0;
-	mbev_headingbias = 0.0;
-	mbev_timelag = 0.0;
-
-	/* set mbio default values */
-	mb_lonflip(mbev_verbose,&mbdef_lonflip);
-	mb_uselockfiles(mbev_verbose,&mbdef_uselockfiles);
-	mbdef_pings = 1;
-	mbdef_format = 0;
-	mbdef_bounds[0] = -360.;
-	mbdef_bounds[1] = 360.;
-	mbdef_bounds[2] = -90.;
-	mbdef_bounds[3] = 90.;
-	mbdef_btime_i[0] = 1962;
-	mbdef_btime_i[1] = 2;
-	mbdef_btime_i[2] = 21;
-	mbdef_btime_i[3] = 10;
-	mbdef_btime_i[4] = 30;
-	mbdef_btime_i[5] = 0;
-	mbdef_btime_i[6] = 0;
-	mbdef_etime_i[0] = 2062;
-	mbdef_etime_i[1] = 2;
-	mbdef_etime_i[2] = 21;
-	mbdef_etime_i[3] = 10;
-	mbdef_etime_i[4] = 30;
-	mbdef_etime_i[5] = 0;
-	mbdef_etime_i[6] = 0;
-	mbdef_speedmin = 0.0;
-	mbdef_timegap = 1000000000.0;
-
-	/* process argument list */
-	while ((c = getopt(argc, argv, "VvHhF:f:GgI:i:")) != -1)
-	  switch (c)
-		{
-		case 'H':
-		case 'h':
-			help++;
-			break;
-		case 'V':
-		case 'v':
-			mbev_verbose++;
-			break;
-		case 'F':
-		case 'f':
-			sscanf (optarg,"%d", &mbdef_format);
-			flag++;
-			break;
-		case 'G':
-		case 'g':
-			mbev_grid_algorithm = MBEV_GRID_ALGORITH_SIMPLE;
-			flag++;
-			break;
-		case 'I':
-		case 'i':
-			sscanf (optarg,"%s", ifile);
-			flag++;
-			fileflag++;
-			mbev_status = mbeditviz_open_data(ifile, mbdef_format);
-			break;
-		case '?':
-			errflg++;
-		}
-
-	/* if error flagged then print it and exit */
-	if (errflg)
-		{
-		fprintf(stderr,"usage: %s\n", usage_message);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		mbev_error = MB_ERROR_BAD_USAGE;
-		exit(mbev_error);
-		}
-
-	/* print starting message */
-	if (mbev_verbose == 1 || help)
-		{
-		fprintf(stderr,"\nProgram %s\n",program_name);
-		fprintf(stderr,"Version %s\n",rcs_id);
-		fprintf(stderr,"MB-system Version %s\n",MB_VERSION);
-		}
-
-	/* print starting debug statements */
-	if (mbev_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  Program <%s>\n",program_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Control Parameters:\n");
-		fprintf(stderr,"dbg2       mbev_verbose:    %d\n",mbev_verbose);
-		fprintf(stderr,"dbg2       help:            %d\n",help);
-		fprintf(stderr,"dbg2       input file:      %s\n",ifile);
-		}
-
-	/* if help desired then print it and exit */
-	if (help)
-		{
-		fprintf(stderr,"\n%s\n",help_message);
-		fprintf(stderr,"\nusage: %s\n", usage_message);
-		exit(mbev_error);
-		}
-
-	/* print input debug statements */
-	if (mbev_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       argc:      %d\n",argc);
-		for (i=0;i<argc;i++)
-			fprintf(stderr,"dbg2       argv[%d]:    %s\n",
-				i,argv[i]);
-		}
-
-	/* print output debug statements */
-	if (mbev_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBeditviz function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:        %d\n",mbev_error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       mbev_status:  %d\n",mbev_status);
-		}
-
-	/* return */
-	return(mbev_status);
-}
-/*--------------------------------------------------------------------*/
-int mbeditviz_get_format(char *file, int *form)
-{
-	/* local variables */
-	char	*function_name = "mbedit_get_format";
-	char	tmp[MB_PATH_MAXLINE];
-	int	tform;
-
-	/* print input debug statements */
-	if (mbev_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       file:        %s\n",file);
-		fprintf(stderr,"dbg2       format:      %d\n",*form);
-		}
-
-	/* get filenames */
-	/* look for MB suffix convention */
-	if ((mbev_status = mb_get_format(mbev_verbose, file, tmp,
-				    &tform, &mbev_error))
-				    == MB_SUCCESS)
-	    {
-	    *form = tform;
-	    }
-
-	/* print output debug statements */
-	if (mbev_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       format:      %d\n",*form);
-		fprintf(stderr,"dbg2       error:      %d\n",mbev_error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       mbev_status: %d\n",mbev_status);
-		}
-
-	/* return */
-	return(mbev_status);
-}
-/*--------------------------------------------------------------------*/
-int mbeditviz_open_data(char *path, int format)
-{
-	/* local variables */
-	char	*function_name = "mbeditviz_open_data";
-	int	done;
-	double	weight;
-	int	filestatus;
-	char	fileraw[MB_PATH_MAXLINE];
-	char	fileprocessed[MB_PATH_MAXLINE];
-
-	/* print input debug statements */
-	if (mbev_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       file:        %s\n",path);
-		fprintf(stderr,"dbg2       format:      %d\n",format);
-		}
-
-	/* get format if required */
-	if (format == 0)
-		mb_get_format(mbev_verbose,path,NULL,&format,&mbev_error);
-
-	/* loop until all inf files are read */
-	done = MB_NO;
-	while (done == MB_NO)
-		{
-		if (format > 0)
-			{
-			mbev_status = mbeditviz_import_file(path,format);
-			done = MB_YES;
-			}
-		else if (format == -1)
-			{
-			if ((mbev_status = mb_datalist_open(mbev_verbose,&datalist,
-							path,MB_DATALIST_LOOK_NO,&mbev_error)) == MB_SUCCESS)
-				{
-				while (done == MB_NO)
-					{
-					if ((mbev_status = mb_datalist_read2(mbev_verbose,datalist,
-							&filestatus,fileraw,fileprocessed,&format,&weight,&mbev_error))
-							== MB_SUCCESS)
-						{
-						mbev_status = mbeditviz_import_file(fileraw,format);
-						}
-					else
-						{
-						mbev_status = mb_datalist_close(mbev_verbose,&datalist,&mbev_error);
-						done = MB_YES;
-						}
-					}
-				}
-			}
-		}
-	do_mbeditviz_message_off();
-	do_mbeditviz_update_gui();
-
-	/* print output debug statements */
-	if (mbev_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",mbev_error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       mbev_status: %d\n",mbev_status);
-		}
-
-	/* return */
-	return(mbev_status);
-}
-/*--------------------------------------------------------------------*/
-int mbeditviz_import_file(char *path, int format)
-{
-	/* local variables */
-	char	*function_name = "mbeditviz_import_file";
-	char	*root;
-	struct mbev_file_struct *file;
-	struct stat file_status;
-	int	fstatus;
-
-	/* print input debug statements */
-	if (mbev_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       path:        %s\n",path);
-		fprintf(stderr,"dbg2       format:      %d\n",format);
-		}
-
-	/* turn on message */
-	root = (char *) strrchr(path, '/');
-	if (root == NULL)
-		root = path;
-	else
-		root++;
-	sprintf(message,"Importing format %d data from %s",format,root);
-	do_mbeditviz_message_on(message);
-
-	/* allocate mbpr_file_struct array if needed */
-	mbev_status = MB_SUCCESS;
-	if (mbev_num_files_alloc <= mbev_num_files)
-		{
-		mbev_files = (struct mbev_file_struct *) realloc(mbev_files,
-				sizeof(struct mbev_file_struct) * (mbev_num_files_alloc + MBEV_ALLOC_NUM));
-		if (mbev_files != NULL)
-			mbev_num_files_alloc += MBEV_ALLOC_NUM;
-		else
-			{
-			mbev_status = MB_FAILURE;
-			mbev_error = MB_ERROR_MEMORY_FAIL;
-			}
-		}
-
-	/* set new file structure */
-	if (mbev_status == MB_SUCCESS)
-		{
-		file = &(mbev_files[mbev_num_files]);
-		file->load_status = MB_NO;
-		file->load_status_shown = MB_NO;
-		file->locked = MB_NO;
-		file->esf_exists = MB_NO;
-		strcpy(file->path, path);
-		strcpy(file->name, root);
-		file->format = format;
-		file->raw_info_loaded = MB_NO;
-		file->esf_open = MB_NO;
-		file->n_async_heading = 0;
-		file->n_async_heading_alloc = 0;
-		file->async_heading_time_d = NULL;
-		file->async_heading_heading = NULL;
-		file->n_async_attitude = 0;
-		file->n_async_attitude_alloc = 0;
-		file->async_attitude_time_d = NULL;
-		file->async_attitude_roll = NULL;
-		file->async_attitude_pitch = NULL;
-		file->n_sync_attitude = 0;
-		file->n_sync_attitude_alloc = 0;
-		file->sync_attitude_time_d = NULL;
-		file->sync_attitude_roll = NULL;
-		file->sync_attitude_pitch = NULL;
-
-		/* load info */
-		mbev_status = mb_get_info(mbev_verbose, file->path, &(file->raw_info), mbdef_lonflip, &mbev_error);
-		if (mbev_status == MB_SUCCESS)
-			{
-			file->raw_info_loaded = MB_YES;
-			mbev_num_files++;
-			}
-
-		/* load processing parameters */
-		if (mbev_status == MB_SUCCESS)
-			{
-			mbev_status = mb_pr_readpar(mbev_verbose, file->path, MB_NO, &(file->process), &mbev_error);
-			if (file->process.mbp_format_specified == MB_NO)
-				{
-				file->process.mbp_format_specified = MB_YES;
-				file->process.mbp_format = file->format;
-				}
-			}
-
-		/* load processed file info */
-		if (mbev_status == MB_SUCCESS)
-			{
-			if ((fstatus = stat(file->process.mbp_ofile, &file_status)) == 0
-				&& (file_status.st_mode & S_IFMT) != S_IFDIR)
-				{
-				mbev_status = mb_get_info(mbev_verbose, file->process.mbp_ofile,
-							&(file->processed_info),mbdef_lonflip, &mbev_error);
-				if (mbev_status == MB_SUCCESS)
-					file->processed_info_loaded = MB_YES;
-				}
-			}
-		}
-
-	/* print output debug statements */
-	if (mbev_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",mbev_error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       mbev_status: %d\n",mbev_status);
-		}
-
-	/* return */
-	return(mbev_status);
-}
-/*--------------------------------------------------------------------*/
-int mbeditviz_load_file(int ifile)
-{
-	/* local variables */
-	char	*function_name = "mbeditviz_load_file";
-	struct mbev_file_struct *file;
-	struct mbev_ping_struct *ping;
-	mb_path	swathfile;
-	struct stat file_status;
-	int	fstatus;
-	FILE	*afp;
-	mb_path	asyncfile;
-	mb_path	geffile;
-	char	buffer[MBP_FILENAMESIZE], *result;
-	char	command[MBP_FILENAMESIZE];
-	int	nread;
-
-	mb_path	error1;
-	mb_path	error2;
-	mb_path	error3;
-
-	/* swath file locking variables */
-	int	lock_status;
-	int	locked;
-	int	lock_purpose;
-	mb_path	lock_program;
-	mb_path lock_cpu;
-	mb_path lock_user;
-	char	lock_date[25];
-
-	/* mbio read and write values */
-	int	format;
-	void	*imbio_ptr = NULL;
-	struct mb_io_struct *imb_io_ptr = NULL;
-	void	*istore_ptr = NULL;
-	int	kind;
-	double	draft;
-	int	beams_bath;
-	int	nbeams;
-	int	beams_amp;
-	int	pixels_ss;
-	char	*beamflag = NULL;
-	double	*bath = NULL;
-	double	*bathacrosstrack = NULL;
-	double	*bathalongtrack = NULL;
-	double	*amp = NULL;
-	double	*ss = NULL;
-	double	*ssacrosstrack = NULL;
-	double	*ssalongtrack = NULL;
-	char	comment[MB_COMMENT_MAXLINE];
-
-	int	rawmodtime = 0;
-	int	gefmodtime = 0;
-
-	double	mtodeglon, mtodeglat;
-	double	heading, sonardepth;
-	double	headingx, headingy;
-	double	rolldelta, pitchdelta;
-	int	swathbounds;
-	int	icenter, iport, istbd;
-	double	centerdistance, portdistance, stbddistance;
-	int	iping, ibeam;
-	int	shellstatus;
-
-	/* print input debug statements */
-	if (mbev_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       ifile:       %d\n",ifile);
-		}
-
-	/* lock the file if it needs loading */
-	mbev_status = MB_SUCCESS;
-	mbev_error = MB_ERROR_NO_ERROR;
-	if (ifile >= 0 && ifile < mbev_num_files
-		&& mbev_files[ifile].load_status == MB_NO
-		&& mbev_files[ifile].raw_info.nrecords > 0)
-		{
-		file = &(mbev_files[ifile]);
-
-		/* try to lock file */
-		if (mbdef_uselockfiles == MB_YES)
-			{
-			mbev_status = mb_pr_lockswathfile(mbev_verbose, file->path,
-					MBP_LOCK_EDITBATHY, program_name, &mbev_error);
-			}
-		else
-			{
-			mbev_status = mb_pr_lockinfo(mbev_verbose, file->path, &locked,
-					&lock_purpose, lock_program, lock_user, lock_cpu,
-					lock_date, &mbev_error);
-
-			/* if locked get lock info */
-			if (mbev_error == MB_ERROR_FILE_LOCKED)
-				{
-				fprintf(stderr, "\nFile %s locked but lock ignored\n", file->path);
-				fprintf(stderr, "File locked by <%s> running <%s>\n", lock_user, lock_program);
-				fprintf(stderr, "on cpu <%s> at <%s>\n", lock_cpu, lock_date);
-				mbev_error = MB_ERROR_NO_ERROR;
-				mbev_status = MB_SUCCESS;
-				}
-			}
-
-		/* if locked let the user know file can't be opened */
-		if (mbev_status == MB_FAILURE)
-			{
-			/* turn off message */
-			do_mbeditviz_message_off();
-
-			/* if locked get lock info */
-			if (mbev_error == MB_ERROR_FILE_LOCKED)
-				{
-				lock_status = mb_pr_lockinfo(mbev_verbose, file->path, &locked,
-						&lock_purpose, lock_program, lock_user, lock_cpu,
-						lock_date, &mbev_error);
-
-				sprintf(error1, "Unable to open input file:");
-				sprintf(error2, "File locked by <%s> running <%s>", lock_user, lock_program);
-				sprintf(error3, "on cpu <%s> at <%s>", lock_cpu, lock_date);
-				fprintf(stderr, "\nUnable to open input file:\n");
-				fprintf(stderr, "  %s\n", file->path);
-				fprintf(stderr, "File locked by <%s> running <%s>\n", lock_user, lock_program);
-				fprintf(stderr, "on cpu <%s> at <%s>\n", lock_cpu, lock_date);
-				}
-
-			/* else if unable to create lock file there is a permissions problem */
-			else if (mbev_error == MB_ERROR_OPEN_FAIL)
-				{
-				sprintf(error1, "Unable to create lock file");
-				sprintf(error2, "for intended input file:");
-				sprintf(error3, "-Likely permissions issue");
-				fprintf(stderr, "Unable to create lock file\n");
-				fprintf(stderr, "for intended input file:\n");
-				fprintf(stderr, "  %s\n", file->path);
-				fprintf(stderr, "-Likely permissions issue\n");
-				}
-
-			/* put up error dialog */
-			do_error_dialog(error1,error2, error3);
-			}
-		}
-
-	/* load the file if it needs loading and has been locked */
-	if (mbev_status == MB_SUCCESS
-		&& ifile >= 0 && ifile < mbev_num_files
-		&& mbev_files[ifile].load_status == MB_NO
-		&& mbev_files[ifile].raw_info.nrecords > 0)
-		{
-		file = &(mbev_files[ifile]);
-
-		/* allocate memory for pings */
-		if (file->raw_info.nrecords > 0)
-			{
-			file->pings = (struct mbev_ping_struct *)
-				malloc(sizeof(struct mbev_ping_struct) * (file->raw_info.nrecords + 1));
-			if (file->pings != NULL)
-				{
-				file->num_pings_alloc = file->raw_info.nrecords + 1;
-				memset(file->pings,0,sizeof(struct mbev_ping_struct) * (file->num_pings_alloc));
-				file->num_pings = 0;
-				}
-			else
-				{
-				file->num_pings_alloc = 0;
-				file->num_pings = 0;
-				mbev_status = MB_FAILURE;
-				mbev_error = MB_ERROR_MEMORY_FAIL;
-				}
-			}
-
-		/* open the file for reading */
-		if (mbev_status == MB_SUCCESS)
-			{
-			/* read processed file if available, raw otherwise (fbt if possible) */
-			if (file->processed_info_loaded == MB_YES)
-				strcpy(swathfile, file->process.mbp_ofile);
-			else
-				strcpy(swathfile, file->path);
-			format = file->format;
-			file->esf_open = MB_NO;
-			mb_get_shortest_path(mbev_verbose, swathfile, &mbev_error);
-
-			/* use fbt file if possible */
-			mb_get_fbt(mbev_verbose, swathfile, &format, &mbev_error);
-
-			/* initialize reading the swath file */
-			
-			if ((mbev_status = mb_read_init(
-				mbev_verbose,swathfile,format,mbdef_pings,mbdef_lonflip,mbdef_bounds,
-				mbdef_btime_i,mbdef_etime_i,mbdef_speedmin,mbdef_timegap,
-				&imbio_ptr,&mbdef_btime_d,&mbdef_etime_d,
-				&beams_bath,&beams_amp,&pixels_ss,&mbev_error)) != MB_SUCCESS)
-				{
-				mb_error(mbev_verbose,mbev_error,&error_message);
-				fprintf(stderr,"\nMBIO Error returned from function <mb_read_init>:\n%s\n",error_message);
-				fprintf(stderr,"\nSwath sonar File <%s> not initialized for reading\n",file->path);
-				}
-			}
-
-		/* allocate memory for data arrays */
-		if (mbev_status == MB_SUCCESS)
-			{
-			beamflag = NULL;
-			bath = NULL;
-			amp = NULL;
-			bathacrosstrack = NULL;
-			bathalongtrack = NULL;
-			ss = NULL;
-			ssacrosstrack = NULL;
-			ssalongtrack = NULL;
-			if (mbev_error == MB_ERROR_NO_ERROR)
-				mbev_status = mb_register_array(mbev_verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-								sizeof(char), (void **)&beamflag, &mbev_error);
-			if (mbev_error == MB_ERROR_NO_ERROR)
-				mbev_status = mb_register_array(mbev_verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-								sizeof(double), (void **)&bath, &mbev_error);
-			if (mbev_error == MB_ERROR_NO_ERROR)
-				mbev_status = mb_register_array(mbev_verbose, imbio_ptr, MB_MEM_TYPE_AMPLITUDE,
-								sizeof(double), (void **)&amp, &mbev_error);
-			if (mbev_error == MB_ERROR_NO_ERROR)
-				mbev_status = mb_register_array(mbev_verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-								sizeof(double), (void **)&bathacrosstrack, &mbev_error);
-			if (mbev_error == MB_ERROR_NO_ERROR)
-				mbev_status = mb_register_array(mbev_verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-								sizeof(double), (void **)&bathalongtrack, &mbev_error);
-			if (mbev_error == MB_ERROR_NO_ERROR)
-				mbev_status = mb_register_array(mbev_verbose, imbio_ptr, MB_MEM_TYPE_SIDESCAN,
-								sizeof(double), (void **)&ss, &mbev_error);
-			if (mbev_error == MB_ERROR_NO_ERROR)
-				mbev_status = mb_register_array(mbev_verbose, imbio_ptr, MB_MEM_TYPE_SIDESCAN,
-								sizeof(double), (void **)&ssacrosstrack, &mbev_error);
-			if (mbev_error == MB_ERROR_NO_ERROR)
-				mbev_status = mb_register_array(mbev_verbose, imbio_ptr, MB_MEM_TYPE_SIDESCAN,
-								sizeof(double), (void **)&ssalongtrack, &mbev_error);
-
-			/* if error initializing memory then don't read the file */
-			if (mbev_error != MB_ERROR_NO_ERROR)
-				{
-				mb_error(mbev_verbose,mbev_error,&error_message);
-				fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",
-					error_message);
-				}
- 			}
-
-		/* set the topo_type and beamwidths */
-		imb_io_ptr = (struct mb_io_struct *) imbio_ptr;
-		file->beamwidth_xtrack = imb_io_ptr->beamwidth_xtrack;
-		file->beamwidth_ltrack = imb_io_ptr->beamwidth_ltrack;
-		mbev_status = mb_sonartype(mbev_verbose, imbio_ptr, imb_io_ptr->store_data, &file->topo_type, &mbev_error);
-
-		/* read the data */
-		if (mbev_status == MB_SUCCESS)
-			{
-			file->num_pings = 0;
-			while (mbev_error <= MB_ERROR_NO_ERROR)
-				{
-				/* get pointer to next ping */
-				ping = &(file->pings[file->num_pings]);
-
-				/* read a ping of data */
-				mbev_status = mb_get_all(mbev_verbose,imbio_ptr,&istore_ptr,&kind,
-					ping->time_i,&ping->time_d,&ping->navlon,&ping->navlat,&ping->speed,
-					&ping->heading,&ping->distance,&ping->altitude,&ping->sonardepth,
-					&ping->beams_bath,&beams_amp,&pixels_ss,
-					beamflag,bath,amp,bathacrosstrack,bathalongtrack,
-					ss,ssacrosstrack,ssalongtrack,
-					comment,&mbev_error);
-
-				/* ignore minor errors */
-				if (kind == MB_DATA_DATA
-					&& (mbev_error == MB_ERROR_TIME_GAP
-						|| mbev_error == MB_ERROR_OUT_BOUNDS
-						|| mbev_error == MB_ERROR_OUT_TIME
-						|| mbev_error == MB_ERROR_SPEED_TOO_SMALL))
-					{
-					mbev_status = MB_SUCCESS;
-					mbev_error = MB_ERROR_NO_ERROR;
-					}
-
-				/* check for multiplicity of pings with the same time stamp */
-				if (mbev_error == MB_ERROR_NO_ERROR
-				    && kind == MB_DATA_DATA)
-					{
-					if (file->num_pings > 0 && ping->time_d == file->pings[file->num_pings-1].time_d)
-						{
-						ping->multiplicity = file->pings[file->num_pings-1].multiplicity + 1;
-						}
-					else
-						{
-						ping->multiplicity = 0;
-						}
-					}
-
-				/* allocate memory for pings */
-				if (mbev_error == MB_ERROR_NO_ERROR
-				    && kind == MB_DATA_DATA)
-					{
-					if ((ping->beamflag = (char *) malloc(ping->beams_bath)) == NULL)
-						mbev_error = MB_ERROR_MEMORY_FAIL;
-					if ((ping->beamflagorg = (char *) malloc(ping->beams_bath)) == NULL)
-						mbev_error = MB_ERROR_MEMORY_FAIL;
-					if ((ping->beamcolor = (int *) malloc(sizeof(int) * ping->beams_bath)) == NULL)
-						mbev_error = MB_ERROR_MEMORY_FAIL;
-					if ((ping->bath = (double *) malloc(sizeof(double) * (ping->beams_bath))) == NULL)
-						mbev_error = MB_ERROR_MEMORY_FAIL;
-					if ((ping->bathacrosstrack = (double *) malloc(sizeof(double) * (ping->beams_bath))) == NULL)
-						mbev_error = MB_ERROR_MEMORY_FAIL;
-					if ((ping->bathalongtrack = (double *) malloc(sizeof(double) * (ping->beams_bath))) == NULL)
-						mbev_error = MB_ERROR_MEMORY_FAIL;
-					if ((ping->bathcorr = (double *) malloc(sizeof(double) * (ping->beams_bath))) == NULL)
-						mbev_error = MB_ERROR_MEMORY_FAIL;
-					if ((ping->bathlon = (double *) malloc(sizeof(double) * (ping->beams_bath))) == NULL)
-						mbev_error = MB_ERROR_MEMORY_FAIL;
-					if ((ping->bathlat = (double *) malloc(sizeof(double) * (ping->beams_bath))) == NULL)
-						mbev_error = MB_ERROR_MEMORY_FAIL;
-					if ((ping->bathx = (double *) malloc(sizeof(double) * (ping->beams_bath))) == NULL)
-						mbev_error = MB_ERROR_MEMORY_FAIL;
-					if ((ping->bathy = (double *) malloc(sizeof(double) * (ping->beams_bath))) == NULL)
-						mbev_error = MB_ERROR_MEMORY_FAIL;
-					if ((ping->angles = (double *) malloc(sizeof(double) * (ping->beams_bath))) == NULL)
-						mbev_error = MB_ERROR_MEMORY_FAIL;
-					if ((ping->angles_forward = (double *) malloc(sizeof(double) * (ping->beams_bath))) == NULL)
-						mbev_error = MB_ERROR_MEMORY_FAIL;
-					if ((ping->angles_null = (double *) malloc(sizeof(double) * (ping->beams_bath))) == NULL)
-						mbev_error = MB_ERROR_MEMORY_FAIL;
-					if ((ping->ttimes = (double *) malloc(sizeof(double) * (ping->beams_bath))) == NULL)
-						mbev_error = MB_ERROR_MEMORY_FAIL;
-					if ((ping->bheave = (double *) malloc(sizeof(double) * (ping->beams_bath))) == NULL)
-						mbev_error = MB_ERROR_MEMORY_FAIL;
-					if ((ping->alongtrack_offset = (double *) malloc(sizeof(double) * (ping->beams_bath))) == NULL)
-						mbev_error = MB_ERROR_MEMORY_FAIL;
-					if (mbev_error == MB_ERROR_MEMORY_FAIL)
-						{
-fprintf(stderr,"MEMORY FAILURE in mbeditviz_load_file\n");
-						mbev_status = MB_FAILURE;
-						if (ping->beamflag != NULL)
-							{
-							free(ping->beamflag);
-							ping->beamflag = NULL;
-							}
-						if (ping->beamflagorg != NULL)
-							{
-							free(ping->beamflagorg);
-							ping->beamflagorg = NULL;
-							}
-						if (ping->beamcolor != NULL)
-							{
-							free(ping->beamcolor);
-							ping->beamcolor = NULL;
-							}
-						if (ping->bath != NULL)
-							{
-							free(ping->bath);
-							ping->bath = NULL;
-							}
-						if (ping->bathacrosstrack != NULL)
-							{
-							free(ping->bathacrosstrack);
-							ping->bathacrosstrack = NULL;
-							}
-						if (ping->bathalongtrack != NULL)
-							{
-							free(ping->bathalongtrack);
-							ping->bathalongtrack = NULL;
-							}
-						if (ping->bathcorr != NULL)
-							{
-							free(ping->bathcorr);
-							ping->bathcorr = NULL;
-							}
-						if (ping->bathlon != NULL)
-							{
-							free(ping->bathlon);
-							ping->bathlon = NULL;
-							}
-						if (ping->bathlat != NULL)
-							{
-							free(ping->bathlat);
-							ping->bathlat = NULL;
-							}
-						if (ping->bathx != NULL)
-							{
-							free(ping->bathx);
-							ping->bathx = NULL;
-							}
-						if (ping->bathy != NULL)
-							{
-							free(ping->bathy);
-							ping->bathy = NULL;
-							}
-						if (ping->angles != NULL)
-							{
-							free(ping->angles);
-							ping->angles = NULL;
-							}
-						if (ping->angles_forward != NULL)
-							{
-							free(ping->angles_forward);
-							ping->angles_forward = NULL;
-							}
-						if (ping->angles_null != NULL)
-							{
-							free(ping->angles_null);
-							ping->angles_null = NULL;
-							}
-						if (ping->ttimes != NULL)
-							{
-							free(ping->ttimes);
-							ping->ttimes = NULL;
-							}
-						if (ping->bheave != NULL)
-							{
-							free(ping->bheave);
-							ping->bheave = NULL;
-							}
-						if (ping->alongtrack_offset != NULL)
-							{
-							free(ping->alongtrack_offset);
-							ping->alongtrack_offset = NULL;
-							}
-						}
-					}
-/* fprintf(stderr,"num_pings:%d ping:%p beamflags: %p %p\n",file->num_pings,ping,ping->beamflag,ping->beamflagorg); */
-
-				/* copy data into ping arrays */
-				if (mbev_error == MB_ERROR_NO_ERROR
-				    && kind == MB_DATA_DATA)
-					{
-					mbeditviz_apply_timelag(file, ping,
-								mbev_rollbias, mbev_pitchbias, mbev_headingbias, mbev_timelag,
-								&heading, &sonardepth,
-								&rolldelta, &pitchdelta);
-					mb_coor_scale(mbev_verbose,ping->navlat,&mtodeglon,&mtodeglat);
-					headingx = sin(heading * DTR);
-					headingy = cos(heading * DTR);
-
-					for (ibeam=0;ibeam<ping->beams_bath;ibeam++)
-						{
-						ping->beamflag[ibeam] = beamflag[ibeam];
-						ping->beamflagorg[ibeam] = beamflag[ibeam];
-						ping->beamcolor[ibeam] = MBV_COLOR_BLACK;
-						if (!mb_beam_check_flag_null(ping->beamflag[ibeam])
-							&& (isnan(bath[ibeam] || isnan(bathacrosstrack[ibeam] || isnan(bathalongtrack[ibeam])))))
-							{
-							ping->beamflag[ibeam] = MB_FLAG_NULL;
-fprintf(stderr,"\nEncountered NaN value in swath data from file: %s\n",swathfile);
-fprintf(stderr,"     Ping time: %4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d\n",
-	ping->time_i[0],ping->time_i[1],ping->time_i[2],ping->time_i[3],ping->time_i[4],ping->time_i[5],ping->time_i[6]);
-fprintf(stderr,"     Beam bathymetry: %d %f %f %f\n",ibeam,ping->bath[ibeam],ping->bathacrosstrack[ibeam],ping->bathalongtrack[ibeam]);
-							}
-						if (!mb_beam_check_flag_null(ping->beamflag[ibeam]))
-							{
-							/* copy bath */
-							ping->bath[ibeam] = bath[ibeam];
-							ping->bathacrosstrack[ibeam] = bathacrosstrack[ibeam];
-							ping->bathalongtrack[ibeam] = bathalongtrack[ibeam];
-
-							/* apply rotations and calculate position */
-							mbeditviz_beam_position(ping->navlon, ping->navlat, headingx, headingy,
-										mtodeglon, mtodeglat,
-										ping->bath[ibeam], ping->bathacrosstrack[ibeam], ping->bathalongtrack[ibeam],
-										sonardepth,
-										rolldelta, pitchdelta,
-										&(ping->bathcorr[ibeam]), &(ping->bathlon[ibeam]), &(ping->bathlat[ibeam]));
-							}
-						}
-					}
-
-
-				/* extract some more values */
-				if (mbev_error == MB_ERROR_NO_ERROR
-				    && kind == MB_DATA_DATA)
-					{
-					mbev_status = mb_extract_nav(mbev_verbose,imbio_ptr,
-						istore_ptr,&kind,
-						ping->time_i,&ping->time_d,&ping->navlon,&ping->navlat,&ping->speed,
-						&ping->heading,&draft,&ping->roll,&ping->pitch,&ping->heave,
-						&mbev_error);
-					}
-
-				/* extract some more values */
-				if (mbev_error == MB_ERROR_NO_ERROR
-				    && kind == MB_DATA_DATA)
-					{
-					mbev_status = mb_ttimes(mbev_verbose,imbio_ptr,
-						istore_ptr,&kind,&nbeams,
-						ping->ttimes,ping->angles,
-						ping->angles_forward,ping->angles_null,
-						ping->bheave,ping->alongtrack_offset,
-						&ping->draft,&ping->ssv,&mbev_error);
-					}
-
-				/* get swathbounds */
-				if (mbev_error == MB_ERROR_NO_ERROR
-				    && kind == MB_DATA_DATA)
-				        {
-					if (format == MBF_MBPRONAV)
-						{
-						mbev_status = mbsys_singlebeam_swathbounds(mbev_verbose, imbio_ptr, istore_ptr, &kind,
-											&ping->portlon, &ping->portlat,
-											&ping->stbdlon, &ping->stbdlat,
-											&mbev_error);
-						if (ping->portlon != ping->stbdlon
-							|| ping->portlat != ping->stbdlat)
-							swathbounds = MB_YES;
-						}
-
-					else
-						{
-						/* find centermost beam */
-						icenter = -1;
-						iport = -1;
-						istbd = -1;
-						centerdistance = 0.0;
-						portdistance = 0.0;
-						stbddistance = 0.0;
-						for (ibeam=0;ibeam<beams_bath;ibeam++)
-							{
-							if (!mb_beam_check_flag_null(beamflag[ibeam]))
-								{
-								if (icenter == -1
-									|| fabs(bathacrosstrack[ibeam]) < centerdistance)
-									{
-									icenter = ibeam;
-									centerdistance = bathacrosstrack[ibeam];
-									}
-								if (iport == -1
-									|| bathacrosstrack[ibeam] < portdistance)
-									{
-									iport = ibeam;
-									portdistance = bathacrosstrack[ibeam];
-									}
-								if (istbd == -1
-									|| bathacrosstrack[ibeam] > stbddistance)
-									{
-									istbd = ibeam;
-									stbddistance = bathacrosstrack[ibeam];
-									}
-								}
-							}
-
-						mb_coor_scale(mbev_verbose,ping->navlat,&mtodeglon,&mtodeglat);
-						headingx = sin(ping->heading * DTR);
-						headingy = cos(ping->heading * DTR);
-						if (icenter >= 0)
-							{
-							ping->portlon = ping->bathlon[iport];
-							ping->portlat = ping->bathlat[iport];
-							ping->stbdlon = ping->bathlon[istbd];
-							ping->stbdlat = ping->bathlat[istbd];
-							}
-						else
-							{
-							ping->portlon = ping->navlon;
-							ping->portlat = ping->navlat;
-							ping->stbdlon = ping->navlon;
-							ping->stbdlat = ping->navlat;
-							}
-						}
-					}
-
-				/* increment counters */
-				if (mbev_error == MB_ERROR_NO_ERROR && kind == MB_DATA_DATA)
-					file->num_pings++;
-
-				/* print debug statements */
-				if (mbev_verbose >= 2)
-					{
-					fprintf(stderr,"\ndbg2  Ping read in program <%s>\n",
-						program_name);
-					fprintf(stderr,"dbg2       kind:           %d\n",kind);
-					fprintf(stderr,"dbg2       error:          %d\n",mbev_error);
-					fprintf(stderr,"dbg2       status:         %d\n",mbev_status);
-					}
-				if (mbev_verbose >= 2 && kind == MB_DATA_COMMENT)
-					{
-					fprintf(stderr,"dbg2       comment:        %s\n",comment);
-					}
-				if (mbev_verbose >= 2 && mbev_error <= 0 && kind == MB_DATA_DATA)
-					{
-					fprintf(stderr,"dbg2       time_i:         %4d/%2d/%2d %2.2d:%2.2d:%2.2d.%6.6d\n",
-								ping->time_i[0],ping->time_i[1],
-								ping->time_i[2],ping->time_i[3],
-								ping->time_i[4],ping->time_i[5],ping->time_i[6]);
-					fprintf(stderr,"dbg2       time_d:         %f\n",ping->time_d);
-					fprintf(stderr,"dbg2       navlon:         %f\n",ping->navlon);
-					fprintf(stderr,"dbg2       navlat:         %f\n",ping->navlat);
-					fprintf(stderr,"dbg2       speed:          %f\n",ping->speed);
-					fprintf(stderr,"dbg2       heading:        %f\n",ping->heading);
-					fprintf(stderr,"dbg2       distance:       %f\n",ping->distance);
-					fprintf(stderr,"dbg2       beams_bath:     %d\n",ping->beams_bath);
-					fprintf(stderr,"dbg2       beams_amp:      %d\n",beams_amp);
-					fprintf(stderr,"dbg2       pixels_ss:      %d\n",pixels_ss);
-					}
-				}
-
-			/* close the file */
-			mbev_status = mb_close(mbev_verbose,&imbio_ptr,&mbev_error);
-
-			/* if processed file read, then reset the beam edits to the original raw state
-				by reading in a global esf file from the raw file */
-			if (file->processed_info_loaded == MB_YES)
-				{
-		    		/* check if global edit file (*.gef) exists and is up to date */
-				if ((fstatus = stat(file->path, &file_status)) == 0
-					&& (file_status.st_mode & S_IFMT) != S_IFDIR)
-					rawmodtime = file_status.st_mtime;
-				  else
-					rawmodtime = 0;
-				sprintf(geffile, "%s.gef", file->path);
-				if ((fstatus = stat(geffile, &file_status)) == 0
-					&& (file_status.st_mode & S_IFMT) != S_IFDIR)
-					gefmodtime = file_status.st_mtime;
-				  else
-					gefmodtime = 0;
-				if (rawmodtime >= gefmodtime)
-					{
-					sprintf(command, "mbgetesf -I %s -M2 -O %s.gef", file->path, file->path);
-					fprintf(stderr,"Generating global edit file:\n\t%s\n",command);
-					shellstatus = system(command);
-					}
-
-				/* now read and apply the global edits */
-				mbev_status = mb_esf_open(mbev_verbose, geffile, MB_YES, MBP_ESF_NOWRITE,
-							&(file->esf), &mbev_error);
-				if (mbev_status == MB_SUCCESS)
-					{
-					file->esf_open = MB_YES;
-fprintf(stderr,"%d global beam states read from %s...\n",file->esf.nedit,geffile);
-					}
-				else
-					{
-					file->esf_open = MB_NO;
-					mbev_status = MB_SUCCESS;
-					mbev_error = MB_ERROR_NO_ERROR;
-					}
-				if (file->esf_open == MB_YES)
-					{
-					/* loop over pings applying edits */
-					do_mbeditviz_message_on("MBeditviz is applying original beam states...");
-fprintf(stderr,"MBeditviz is applying %d original beam states\n",file->esf.nedit);
-					for (iping=0;iping<file->num_pings;iping++)
-						{
-						ping = &(file->pings[iping]);
-
-						/* apply edits for this ping */
-						mb_esf_apply(mbev_verbose, &(file->esf),
-		    					    ping->time_d, ping->multiplicity, ping->beams_bath,
-							    ping->beamflag, &mbev_error);
-						for (ibeam=0;ibeam<ping->beams_bath;ibeam++)
-							ping->beamflagorg[ibeam] = ping->beamflag[ibeam];
-
-						/* update message every 250 records */
-						if (iping % 250 == 0)
-							{
-							sprintf(message, "MBeditviz: global edits applied to %d of %d records so far...",
-								iping, file->num_pings);
-							do_mbeditviz_message_on(message);
-							}
-						}
-
-					/* close the esf */
-					if (file->esf_open == MB_YES)
-						{
-						mb_esf_close(mbev_verbose, &file->esf, &mbev_error);
-						file->esf_open = MB_NO;
-						}
-					}
-				}
-
-if (mbev_verbose > 0)
-fprintf(stderr,"loaded swathfile:%s file->processed_info_loaded:%d file->process.mbp_edit_mode:%d\n",
-swathfile,file->processed_info_loaded,file->process.mbp_edit_mode);
-
-			/* attempt to load bathymetry edits */
-			mbev_status = mb_esf_load(mbev_verbose, file->path, MB_YES, MBP_ESF_NOWRITE,
-							file->esffile, &(file->esf), &mbev_error);
-			if (mbev_status == MB_SUCCESS)
-				{
-				file->esf_open = MB_YES;
-				}
-			else
-				{
-				file->esf_open = MB_NO;
-				mbev_status = MB_SUCCESS;
-				mbev_error = MB_ERROR_NO_ERROR;
-				}
-			if (file->esf_open == MB_YES)
-				{
-				/* loop over pings applying edits */
-				do_mbeditviz_message_on("MBeditviz is applying saved edits...");
-				for (iping=0;iping<file->num_pings;iping++)
-					{
-					ping = &(file->pings[iping]);
-
-					/* apply edits for this ping */
-					mb_esf_apply(mbev_verbose, &(file->esf),
-		    				    ping->time_d, ping->multiplicity, ping->beams_bath,
-						    ping->beamflag, &mbev_error);
-					for (ibeam=0;ibeam<ping->beams_bath;ibeam++)
-						ping->beamflagorg[ibeam] = ping->beamflag[ibeam];
-
-					/* update message every 250 records */
-					if (iping % 250 == 0)
-						{
-						sprintf(message, "MBeditviz: saved edits applied to %d of %d records so far...",
-							iping, file->num_pings);
-						do_mbeditviz_message_on(message);
-						}
-					}
-
-				/* close the esf */
-				if (file->esf_open == MB_YES)
-					{
-					mb_esf_close(mbev_verbose, &file->esf, &mbev_error);
-					file->esf_open = MB_NO;
-					}
-				}
-			}
-
-		/* load asynchronous data if available */
-		if (mbev_status == MB_SUCCESS)
-			{
-			/* try to load heading data from file */
-			strcpy(asyncfile, file->path);
-			strcat(asyncfile, ".ath");
-			if ((fstatus = stat(asyncfile, &file_status)) == 0
-				&& (file_status.st_mode & S_IFMT) != S_IFDIR)
-				{
-				/* count the asynchronous heading data */
-				file->n_async_heading = 0;
-				file->n_async_heading_alloc = 0;
-				if ((afp = fopen(asyncfile, "r")) != NULL)
-					{
-					while ((result = fgets(buffer,MBP_FILENAMESIZE,afp)) == buffer)
-						if (buffer[0] != '#')
-						    file->n_async_heading++;
-					fclose(afp);
-					}
-
-				/* allocate space for asynchronous heading */
-				if (file->n_async_heading > 0)
-					{
-					if ((file->async_heading_time_d = (double *) malloc(sizeof(double) * (file->n_async_heading))) != NULL)
-						{
-						if ((file->async_heading_heading = (double *) malloc(sizeof(double) * (file->n_async_heading))) != NULL)
-							{
-							file->n_async_heading_alloc = file->n_async_heading;
-							}
-						else if (file->async_heading_time_d != NULL)
-							{
-							free(file->async_heading_time_d);
-							file->async_heading_time_d = NULL;
-							}
-						}
-					}
-
-				/* read the asynchronous heading data */
-				file->n_async_heading = 0;
-				if ((afp = fopen(asyncfile, "r")) != NULL)
-					{
-					while ((result = fgets(buffer,MBP_FILENAMESIZE,afp)) == buffer)
-						{
-						if (buffer[0] != '#')
-		    					{
-							nread = sscanf(buffer,"%lf %lf",
-									&(file->async_heading_time_d[file->n_async_heading]),
-						    			&(file->async_heading_heading[file->n_async_heading]));
-							if (nread == 2)
-						    	    file->n_async_heading++;
-							}
-						}
-					fclose(afp);
-					}
-
-				}
-
-			/* if heading data not loaded from file extract from ping data */
-			if (file->n_async_heading <= 0)
-				{
-				if (file->num_pings > 0)
-					{
-					if ((file->async_heading_time_d = (double *) malloc(sizeof(double) * (file->num_pings))) != NULL)
-						{
-						if ((file->async_heading_heading = (double *) malloc(sizeof(double) * (file->num_pings))) != NULL)
-							{
-							file->n_async_heading = file->num_pings;
-							file->n_async_heading_alloc = file->n_async_heading;
-							}
-						else if (file->async_heading_time_d != NULL)
-							{
-							free(file->async_heading_time_d);
-							file->async_heading_time_d = NULL;
-							}
-						}
-					for (iping=0;iping<file->num_pings;iping++)
-						{
-						ping = &(file->pings[iping]);
-						file->async_heading_time_d[iping] = ping->time_d;
-						file->async_heading_heading[iping] = ping->heading;
-						}
-					}
-				}
-
-			/* try to load sonardepth data */
-			strcpy(asyncfile, file->path);
-			strcat(asyncfile, ".ats");
-			if ((fstatus = stat(asyncfile, &file_status)) == 0
-				&& (file_status.st_mode & S_IFMT) != S_IFDIR)
-				{
-				/* count the asynchronous sonardepth data */
-				file->n_async_sonardepth = 0;
-				file->n_async_sonardepth_alloc = 0;
-				if ((afp = fopen(asyncfile, "r")) != NULL)
-					{
-					while ((result = fgets(buffer,MBP_FILENAMESIZE,afp)) == buffer)
-						if (buffer[0] != '#')
-						    file->n_async_sonardepth++;
-					fclose(afp);
-					}
-
-				/* allocate space for asynchronous sonardepth */
-				if (file->n_async_sonardepth > 0)
-					{
-					if ((file->async_sonardepth_time_d = (double *) malloc(sizeof(double) * (file->n_async_sonardepth))) != NULL)
-						{
-						if ((file->async_sonardepth_sonardepth = (double *) malloc(sizeof(double) * (file->n_async_sonardepth))) != NULL)
-							{
-							file->n_async_sonardepth_alloc = file->n_async_sonardepth;
-							}
-						else if (file->async_sonardepth_time_d != NULL)
-							{
-							free(file->async_sonardepth_time_d);
-							file->async_sonardepth_time_d = NULL;
-							}
-						}
-					}
-
-				/* read the asynchronous sonardepth data */
-				file->n_async_sonardepth = 0;
-				if ((afp = fopen(asyncfile, "r")) != NULL)
-					{
-					while ((result = fgets(buffer,MBP_FILENAMESIZE,afp)) == buffer)
-						{
-						if (buffer[0] != '#')
-		    					{
-							nread = sscanf(buffer,"%lf %lf",
-									&(file->async_sonardepth_time_d[file->n_async_sonardepth]),
-						    			&(file->async_sonardepth_sonardepth[file->n_async_sonardepth]));
-							if (nread == 2)
-						    	    file->n_async_sonardepth++;
-							}
-						}
-					fclose(afp);
-					}
-
-				}
-
-			/* if sonardepth data not loaded from file extract from ping data */
-			if (file->n_async_sonardepth <= 0)
-				{
-				if (file->num_pings > 0)
-					{
-					if ((file->async_sonardepth_time_d = (double *) malloc(sizeof(double) * (file->num_pings))) != NULL)
-						{
-						if ((file->async_sonardepth_sonardepth = (double *) malloc(sizeof(double) * (file->num_pings))) != NULL)
-							{
-							file->n_async_sonardepth = file->num_pings;
-							file->n_async_sonardepth_alloc = file->n_async_sonardepth;
-							}
-						else if (file->async_sonardepth_time_d != NULL)
-							{
-							free(file->async_sonardepth_time_d);
-							file->async_sonardepth_time_d = NULL;
-							}
-						}
-					for (iping=0;iping<file->num_pings;iping++)
-						{
-						ping = &(file->pings[iping]);
-						file->async_sonardepth_time_d[iping] = ping->time_d;
-						file->async_sonardepth_sonardepth[iping] = ping->sonardepth;
-						}
-					}
-				}
-
-			/* try to load asynchronous attitude data */
-			strcpy(asyncfile, file->path);
-			strcat(asyncfile, ".ata");
-			if ((fstatus = stat(asyncfile, &file_status)) == 0
-				&& (file_status.st_mode & S_IFMT) != S_IFDIR)
-				{
-				/* count the asynchronous attitude data */
-				file->n_async_attitude = 0;
-				file->n_async_attitude_alloc = 0;
-				if ((afp = fopen(asyncfile, "r")) != NULL)
-					{
-					while ((result = fgets(buffer,MBP_FILENAMESIZE,afp)) == buffer)
-						if (buffer[0] != '#')
-						    file->n_async_attitude++;
-					fclose(afp);
-					}
-
-				/* allocate space for asynchronous attitude */
-				if (file->n_async_attitude > 0)
-					{
-					if ((file->async_attitude_time_d = (double *) malloc(sizeof(double) * (file->n_async_attitude))) != NULL)
-						{
-						if ((file->async_attitude_roll = (double *) malloc(sizeof(double) * (file->n_async_attitude))) != NULL)
-							{
-							if ((file->async_attitude_pitch = (double *) malloc(sizeof(double) * (file->n_async_attitude))) != NULL)
-								{
-								file->n_async_attitude_alloc = file->n_async_attitude;
-								}
-							else
-								{
-								if (file->async_attitude_time_d != NULL)
-									{
-									free(file->async_attitude_time_d);
-									file->async_attitude_time_d = NULL;
-									}
-								if (file->async_attitude_roll != NULL)
-									{
-									free(file->async_attitude_roll);
-									file->async_attitude_roll = NULL;
-									}
-								}
-							}
-						else if (file->async_attitude_time_d != NULL)
-							{
-							free(file->async_attitude_time_d);
-							file->async_attitude_time_d = NULL;
-							}
-						}
-					}
-
-				/* read the asynchronous attitude data */
-				file->n_async_attitude = 0;
-				if ((afp = fopen(asyncfile, "r")) != NULL)
-					{
-					while ((result = fgets(buffer,MBP_FILENAMESIZE,afp)) == buffer)
-						{
-						if (buffer[0] != '#')
-		    					{
-							nread = sscanf(buffer,"%lf %lf %lf",
-									&(file->async_attitude_time_d[file->n_async_attitude]),
-						    			&(file->async_attitude_roll[file->n_async_attitude]),
-						    			&(file->async_attitude_pitch[file->n_async_attitude]));
-							if (nread == 3)
-						    	    file->n_async_attitude++;
-							}
-						}
-					fclose(afp);
-					}
-				}
-
-			/* if attitude data not loaded from file extract from ping data */
-			if (file->n_async_attitude <= 0)
-				{
-				if (file->num_pings > 0)
-					{
-					if ((file->async_attitude_time_d = (double *) malloc(sizeof(double) * (file->num_pings))) != NULL)
-						{
-						if ((file->async_attitude_roll = (double *) malloc(sizeof(double) * (file->num_pings))) != NULL)
-							{
-							if ((file->async_attitude_pitch = (double *) malloc(sizeof(double) * (file->num_pings))) != NULL)
-								{
-								file->n_async_attitude = file->num_pings;
-								file->n_async_attitude_alloc = file->n_async_attitude;
-								}
-							else
-								{
-								if (file->async_attitude_time_d != NULL)
-									{
-									free(file->async_attitude_time_d);
-									file->async_attitude_time_d = NULL;
-									}
-								if (file->async_attitude_roll != NULL)
-									{
-									free(file->async_attitude_roll);
-									file->async_attitude_roll = NULL;
-									}
-								}
-							}
-						else if (file->async_attitude_time_d != NULL)
-							{
-							free(file->async_attitude_time_d);
-							file->async_attitude_time_d = NULL;
-							}
-						}
-					for (iping=0;iping<file->num_pings;iping++)
-						{
-						ping = &(file->pings[iping]);
-						file->async_attitude_time_d[iping] = ping->time_d;
-						file->async_attitude_roll[iping] = ping->roll;
-						file->async_attitude_pitch[iping] = ping->pitch;
-						}
-					}
-				}
-
-			/* try to load synchronous attitude data */
-			strcpy(asyncfile, file->path);
-			strcat(asyncfile, ".sta");
-			if ((fstatus = stat(asyncfile, &file_status)) == 0
-				&& (file_status.st_mode & S_IFMT) != S_IFDIR)
-				{
-				/* count the synchronous attitude data */
-				file->n_sync_attitude = 0;
-				file->n_sync_attitude_alloc = 0;
-				if ((afp = fopen(asyncfile, "r")) != NULL)
-					{
-					while ((result = fgets(buffer,MBP_FILENAMESIZE,afp)) == buffer)
-						if (buffer[0] != '#')
-						    file->n_sync_attitude++;
-					fclose(afp);
-					}
-
-				/* allocate space for asynchronous attitude */
-				if (file->n_sync_attitude > 0)
-					{
-					if ((file->sync_attitude_time_d = (double *) malloc(sizeof(double) * (file->n_sync_attitude))) != NULL)
-						{
-						if ((file->sync_attitude_roll = (double *) malloc(sizeof(double) * (file->n_sync_attitude))) != NULL)
-							{
-							if ((file->sync_attitude_pitch = (double *) malloc(sizeof(double) * (file->n_sync_attitude))) != NULL)
-								{
-								file->n_sync_attitude_alloc = file->n_sync_attitude;
-								}
-							else
-								{
-								if (file->sync_attitude_time_d != NULL)
-									{
-									free(file->sync_attitude_time_d);
-									file->sync_attitude_time_d = NULL;
-									}
-								if (file->sync_attitude_roll != NULL)
-									{
-									free(file->sync_attitude_roll);
-									file->sync_attitude_roll = NULL;
-									}
-								}
-							}
-						else if (file->sync_attitude_time_d != NULL)
-							{
-							free(file->sync_attitude_time_d);
-							file->sync_attitude_time_d = NULL;
-							}
-						}
-					}
-
-				/* read the synchronous attitude data */
-				file->n_sync_attitude = 0;
-				if ((afp = fopen(asyncfile, "r")) != NULL)
-					{
-					while ((result = fgets(buffer,MBP_FILENAMESIZE,afp)) == buffer)
-						{
-						if (buffer[0] != '#')
-		    					{
-							nread = sscanf(buffer,"%lf %lf %lf",
-									&(file->sync_attitude_time_d[file->n_sync_attitude]),
-						    			&(file->sync_attitude_roll[file->n_sync_attitude]),
-						    			&(file->sync_attitude_pitch[file->n_sync_attitude]));
-							if (nread == 3)
-						    	    file->n_sync_attitude++;
-							}
-						}
-					fclose(afp);
-					}
-				}
-
-			/* if attitude data not loaded from file extract from ping data */
-			if (file->n_sync_attitude <= 0)
-				{
-				if (file->num_pings > 0)
-					{
-					if ((file->sync_attitude_time_d = (double *) malloc(sizeof(double) * (file->num_pings))) != NULL)
-						{
-						if ((file->sync_attitude_roll = (double *) malloc(sizeof(double) * (file->num_pings))) != NULL)
-							{
-							if ((file->sync_attitude_pitch = (double *) malloc(sizeof(double) * (file->num_pings))) != NULL)
-								{
-								file->n_sync_attitude = file->num_pings;
-								file->n_sync_attitude_alloc = file->n_sync_attitude;
-								}
-							else
-								{
-								if (file->sync_attitude_time_d != NULL)
-									{
-									free(file->sync_attitude_time_d);
-									file->sync_attitude_time_d = NULL;
-									}
-								if (file->sync_attitude_roll != NULL)
-									{
-									free(file->sync_attitude_roll);
-									file->sync_attitude_roll = NULL;
-									}
-								}
-							}
-						else if (file->sync_attitude_time_d != NULL)
-							{
-							free(file->sync_attitude_time_d);
-							file->sync_attitude_time_d = NULL;
-							}
-						}
-					for (iping=0;iping<file->num_pings;iping++)
-						{
-						ping = &(file->pings[iping]);
-						file->sync_attitude_time_d[iping] = ping->time_d;
-						file->sync_attitude_roll[iping] = ping->roll;
-						file->sync_attitude_pitch[iping] = ping->pitch;
-						}
-					}
-				}
-			}
-
-		/* set the load status */
-		if (mbev_status == MB_SUCCESS)
-			{
-			file->load_status = MB_YES;
-			mbev_num_files_loaded++;
-			}
-		}
-
-	/* print output debug statements */
-	if (mbev_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",mbev_error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       mbev_status: %d\n",mbev_status);
-		}
-
-	/* return */
-	return(mbev_status);
-}
-/*--------------------------------------------------------------------*/
-int mbeditviz_apply_timelag(struct mbev_file_struct *file, struct mbev_ping_struct *ping,
-				double rollbias, double pitchbias, double headingbias, double timelag,
-				double *heading, double *sonardepth,
-				double *rolldelta, double *pitchdelta)
-{
-	/* local variables */
-	char	*function_name = "mbeditviz_apply_timelag";
-	double	time_d;
-	int	intstat;
-	int	iheading = 0;
-	int	isonardepth = 0;
-	int	iattitude = 0;
-	double	rollsync, pitchsync;
-	double	rollasync, pitchasync;
-
-	/* print input debug statements */
-	if (mbev_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       file:        %p\n",file);
-		fprintf(stderr,"dbg2       ping:        %p\n",ping);
-		fprintf(stderr,"dbg2       rollbias:    %f\n",rollbias);
-		fprintf(stderr,"dbg2       pitchbias:   %f\n",pitchbias);
-		fprintf(stderr,"dbg2       headingbias: %f\n",headingbias);
-		fprintf(stderr,"dbg2       timelag:     %f\n",timelag);
-		}
-
-	/* apply timelag to get new values of lon, lat, heading, rollbias, pitchbias */
-	if (file != NULL && ping != NULL)
-		{
-		/* get adjusted time for interpolation in asyncronous time series */
-		time_d = ping->time_d + timelag;
-
-		/* if asyncronous heading available, interpolate new value */
-		if (file->n_async_heading > 0)
-			{
-			intstat = mb_linear_interp_heading(mbev_verbose,
-					file->async_heading_time_d-1, file->async_heading_heading-1,
-					file->n_async_heading, time_d, heading, &iheading,
-					&mbev_error);
-			*heading += headingbias;
-			if (*heading >= 360.0)
-				*heading -= 360.0;
-			else if (*heading < 0.0)
-				*heading += 360.0;
-			}
-		else
-			{
-			*heading = ping->heading + headingbias;
-			}
-
-		/* if asyncronous sonardepth available, interpolate new value */
-		if (file->n_async_sonardepth > 0)
-			{
-			intstat = mb_linear_interp(mbev_verbose,
-					file->async_sonardepth_time_d-1, file->async_sonardepth_sonardepth-1,
-					file->n_async_sonardepth, time_d, sonardepth, &isonardepth,
-					&mbev_error);
-			}
-		else
-			{
-			*sonardepth = ping->sonardepth;
-			}
-
-		/* if both synchronous and asyncronous attitude available, interpolate new values */
-		if (file->n_sync_attitude > 0 && file->n_async_attitude > 0)
-			{
-			intstat = mb_linear_interp(mbev_verbose,
-					file->sync_attitude_time_d-1, file->sync_attitude_roll-1,
-					file->n_sync_attitude, ping->time_d, &rollsync, &iattitude,
-					&mbev_error);
-			intstat = mb_linear_interp(mbev_verbose,
-					file->sync_attitude_time_d-1, file->sync_attitude_pitch-1,
-					file->n_sync_attitude, ping->time_d, &pitchsync, &iattitude,
-					&mbev_error);
-			intstat = mb_linear_interp(mbev_verbose,
-					file->async_attitude_time_d-1, file->async_attitude_roll-1,
-					file->n_async_attitude, time_d, &rollasync, &iattitude,
-					&mbev_error);
-			intstat = mb_linear_interp(mbev_verbose,
-					file->async_attitude_time_d-1, file->async_attitude_pitch-1,
-					file->n_async_attitude, time_d, &pitchasync, &iattitude,
-					&mbev_error);
-			*rolldelta = rollasync - rollsync + rollbias;
-			*pitchdelta = pitchasync - pitchsync + pitchbias;
-			}
-		else
-			{
-			*rolldelta = rollbias;
-			*pitchdelta = pitchbias;
-			}
-/*fprintf(stderr,"heading: %f %f   %f %d\n", *heading, ping->heading, *heading-ping->heading, iheading);
-fprintf(stderr,"sonardepth: %f %f   %f %d\n", *sonardepth, ping->sonardepth,*sonardepth-ping->sonardepth, isonardepth);
-fprintf(stderr,"rolldelta:  %f %f    roll:%f %f   %d\n", *rolldelta, rollbias, rollasync, rollsync, iattitude);
-fprintf(stderr,"pitchdelta: %f %f    pitch:%f %f   %d\n", *pitchdelta, pitchbias, pitchasync, pitchsync, iattitude);*/
-		}
-
-	/* print output debug statements */
-	if (mbev_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",mbev_error);
-		fprintf(stderr,"dbg2       heading:    %f\n",*heading);
-		fprintf(stderr,"dbg2       sonardepth: %f\n",*sonardepth);
-		fprintf(stderr,"dbg2       rolldelta:  %f\n",*rolldelta);
-		fprintf(stderr,"dbg2       pitchdelta: %f\n",*pitchdelta);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       mbev_status: %d\n",mbev_status);
-		}
-
-	/* return */
-	return(mbev_status);
-}
-/*--------------------------------------------------------------------*/
-int mbeditviz_beam_position(double navlon, double navlat, double headingx, double headingy,
-				double mtodeglon, double mtodeglat,
-				double bath, double acrosstrack, double alongtrack,
-				double sonardepth,
-				double rollbias, double pitchbias,
-				double *bathcorr, double *lon, double *lat)
-{
-	/* local variables */
-	char	*function_name = "mbeditviz_beam_position";
-	double	bathuse;
-	double	range;
-	double	alpha, beta;
-	double	newbath, newacrosstrack, newalongtrack;
-
-	/* print input debug statements */
-	if (mbev_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       navlon:      %f\n",navlon);
-		fprintf(stderr,"dbg2       navlat:      %f\n",navlat);
-		fprintf(stderr,"dbg2       mtodeglon:   %f\n",mtodeglon);
-		fprintf(stderr,"dbg2       mtodeglat:   %f\n",mtodeglat);
-		fprintf(stderr,"dbg2       headingx:    %f\n",headingx);
-		fprintf(stderr,"dbg2       headingy:    %f\n",headingy);
-		fprintf(stderr,"dbg2       bath:        %f\n",bath);
-		fprintf(stderr,"dbg2       acrosstrack: %f\n",acrosstrack);
-		fprintf(stderr,"dbg2       alongtrack:  %f\n",alongtrack);
-		fprintf(stderr,"dbg2       sonardepth:  %f\n",sonardepth);
-		fprintf(stderr,"dbg2       rollbias:    %f\n",rollbias);
-		fprintf(stderr,"dbg2       pitchbias:   %f\n",pitchbias);
-		}
-
-	/* strip off heave + draft */
-	bathuse = bath - sonardepth;
-
-	/* get range and angles in
-	    roll-pitch frame */
-	range = sqrt(bathuse * bathuse
-		    + acrosstrack
-			* acrosstrack
-		    + alongtrack
-			* alongtrack);
-	if (fabs(range) < 0.001)
-		{
-		alpha = 0.0;
-		beta = 0.5 * M_PI;
-		}
-	else
-		{
-		alpha = asin(MAX(-1.0, MIN(1.0, (alongtrack / range))));
-		beta = acos(MAX(-1.0, MIN(1.0, (acrosstrack / range / cos(alpha)))));
-		}
-	if (bathuse < 0.0)
-		beta = 2.0 * M_PI - beta;
-
-	/* apply roll pitch corrections */
-	alpha += DTR * pitchbias;
-	beta += DTR * rollbias;
-
-	/* recalculate bathymetry */
-	newbath = range * cos(alpha) * sin(beta);
-	newalongtrack = range * sin(alpha);
-	newacrosstrack = range * cos(alpha) * cos(beta);
-
-	/* add heave and draft back in */
-	*bathcorr = newbath + sonardepth;
-
-	/* locate lon lat position */
-	*lon = navlon
-		+ headingy * mtodeglon * newacrosstrack
-		+ headingx * mtodeglon * newalongtrack;
-	*lat = navlat
-		- headingx * mtodeglat * newacrosstrack
-		+ headingy * mtodeglat * newalongtrack;
-if (isnan(*bathcorr))
-{
-fprintf(stderr,"\nFunction mbeditviz_beam_position(): Calculated NaN bathcorr\n");
-fprintf(stderr,"     navlon:      %f\n",navlon);
-fprintf(stderr,"     navlat:      %f\n",navlat);
-fprintf(stderr,"     mtodeglon:   %f\n",mtodeglon);
-fprintf(stderr,"     mtodeglat:   %f\n",mtodeglat);
-fprintf(stderr,"     headingx:    %f\n",headingx);
-fprintf(stderr,"     headingy:    %f\n",headingy);
-fprintf(stderr,"     bath:        %f\n",bath);
-fprintf(stderr,"     acrosstrack: %f\n",acrosstrack);
-fprintf(stderr,"     alongtrack:  %f\n",alongtrack);
-fprintf(stderr,"     sonardepth:  %f\n",sonardepth);
-fprintf(stderr,"     rollbias:    %f\n",rollbias);
-fprintf(stderr,"     pitchbias:   %f\n",pitchbias);
-fprintf(stderr,"     bathuse:     %f\n",bathuse);
-fprintf(stderr,"     range:       %f\n",range);
-fprintf(stderr,"     alpha:       %f\n",alpha);
-fprintf(stderr,"     beta:        %f\n",beta);
-fprintf(stderr,"     newbath:     %f\n",newbath);
-fprintf(stderr,"     bathcorr:    %f\n",*bathcorr);
-fprintf(stderr,"     lon:         %f\n",*lon);
-fprintf(stderr,"     lat:         %f\n",*lat);
-}
-
-	/* print output debug statements */
-	if (mbev_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",mbev_error);
-		fprintf(stderr,"dbg2       bathcorr:    %f\n",*bathcorr);
-		fprintf(stderr,"dbg2       lon:         %f\n",*lon);
-		fprintf(stderr,"dbg2       lat:         %f\n",*lat);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       mbev_status: %d\n",mbev_status);
-		}
-
-	/* return */
-	return(mbev_status);
-}
-/*--------------------------------------------------------------------*/
-int mbeditviz_unload_file(int ifile)
-{
-	/* local variables */
-	char	*function_name = "mbeditviz_unload_file";
-	struct mbev_file_struct *file;
-	struct mbev_ping_struct *ping;
-	int	lock_status;
-	int	lock_error = MB_ERROR_NO_ERROR;
-	int	iping;
-
-	/* print input debug statements */
-	if (mbev_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       ifile:       %d\n",ifile);
-		}
-
-	/* unload the file */
-	if (ifile >= 0 && ifile < mbev_num_files
-		&& mbev_files[ifile].load_status == MB_YES)
-		{
-
-		/* release memory */
-		file = &(mbev_files[ifile]);
-		if (file->pings != NULL)
-		    {
-		    for (iping=0;iping<file->num_pings;iping++)
-			{
-			ping = &(file->pings[iping]);
-			if (ping->beamflag != NULL)
-				{
-				free(ping->beamflag);
-				ping->beamflag = NULL;
-				}
-			if (ping->beamflagorg != NULL)
-				{
-				free(ping->beamflagorg);
-				ping->beamflagorg = NULL;
-				}
-			if (ping->beamcolor != NULL)
-				{
-				free(ping->beamcolor);
-				ping->beamcolor = NULL;
-				}
-			if (ping->bath != NULL)
-				{
-				free(ping->bath);
-				ping->bath = NULL;
-				}
-			if (ping->bathacrosstrack != NULL)
-				{
-				free(ping->bathacrosstrack);
-				ping->bathacrosstrack = NULL;
-				}
-			if (ping->bathalongtrack != NULL)
-				{
-				free(ping->bathalongtrack);
-				ping->bathalongtrack = NULL;
-				}
-			if (ping->bathcorr != NULL)
-				{
-				free(ping->bathcorr);
-				ping->bathcorr = NULL;
-				}
-			if (ping->bathlon != NULL)
-				{
-				free(ping->bathlon);
-				ping->bathlon = NULL;
-				}
-			if (ping->bathlat != NULL)
-				{
-				free(ping->bathlat);
-				ping->bathlat = NULL;
-				}
-			if (ping->bathx != NULL)
-				{
-				free(ping->bathx);
-				ping->bathx = NULL;
-				}
-			if (ping->bathy != NULL)
-				{
-				free(ping->bathy);
-				ping->bathy = NULL;
-				}
-			if (ping->angles != NULL)
-				{
-				free(ping->angles);
-				ping->angles = NULL;
-				}
-			if (ping->angles_forward != NULL)
-				{
-				free(ping->angles_forward);
-				ping->angles_forward = NULL;
-				}
-			if (ping->angles_null != NULL)
-				{
-				free(ping->angles_null);
-				ping->angles_null = NULL;
-				}
-			if (ping->ttimes != NULL)
-				{
-				free(ping->ttimes);
-				ping->ttimes = NULL;
-				}
-			if (ping->bheave != NULL)
-				{
-				free(ping->bheave);
-				ping->bheave = NULL;
-				}
-			if (ping->alongtrack_offset != NULL)
-				{
-				free(ping->alongtrack_offset);
-				ping->alongtrack_offset = NULL;
-				}
-			}
-		    free(file->pings);
-		    file->pings = NULL;
-
-		    file->n_async_heading = 0;
-		    file->n_async_heading_alloc = 0;
-		    if (file->async_heading_time_d != NULL)
-		    	{
-			free(file->async_heading_time_d);
-			file->async_heading_time_d = NULL;
-			}
-		    if (file->async_heading_heading != NULL)
-		    	{
-			free(file->async_heading_heading);
-			file->async_heading_heading = NULL;
-			}
-		    file->n_async_sonardepth = 0;
-		    file->n_async_sonardepth_alloc = 0;
-		    if (file->async_sonardepth_time_d != NULL)
-		    	{
-			free(file->async_sonardepth_time_d);
-			file->async_sonardepth_time_d = NULL;
-			}
-		    if (file->async_sonardepth_sonardepth != NULL)
-		    	{
-			free(file->async_sonardepth_sonardepth);
-			file->async_sonardepth_sonardepth = NULL;
-			}
-		    file->n_async_attitude = 0;
-		    file->n_async_attitude_alloc = 0;
-		    if (file->async_attitude_time_d != NULL)
-		    	{
-			free(file->async_attitude_time_d);
-			file->async_attitude_time_d = NULL;
-			}
-		    if (file->async_attitude_roll != NULL)
-		    	{
-			free(file->async_attitude_roll);
-			file->async_attitude_roll = NULL;
-			}
-		    if (file->async_attitude_pitch != NULL)
-		    	{
-			free(file->async_attitude_pitch);
-			file->async_attitude_pitch = NULL;
-			}
-		    file->n_sync_attitude = 0;
-		    file->n_sync_attitude_alloc = 0;
-		    if (file->sync_attitude_time_d != NULL)
-		    	{
-			free(file->sync_attitude_time_d);
-			file->sync_attitude_time_d = NULL;
-			}
-		    if (file->sync_attitude_roll != NULL)
-		    	{
-			free(file->sync_attitude_roll);
-			file->sync_attitude_roll = NULL;
-			}
-		    if (file->sync_attitude_pitch != NULL)
-		    	{
-			free(file->sync_attitude_pitch);
-			file->sync_attitude_pitch = NULL;
-			}
-		    }
-
-		/* reset load status */
-		file->load_status = MB_NO;
-		mbev_num_files_loaded--;
-
-		/* unlock the file */
-		if (mbdef_uselockfiles == MB_YES)
-			lock_status = mb_pr_unlockswathfile(mbev_verbose, file->path,
-						MBP_LOCK_EDITBATHY, program_name, &lock_error);
-
-		}
-
-	/* print output debug statements */
-	if (mbev_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",mbev_error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       mbev_status: %d\n",mbev_status);
-		}
-
-	/* return */
-	return(mbev_status);
-}
-/*--------------------------------------------------------------------*/
-int mbeditviz_delete_file(int ifile)
-{
-	/* local variables */
-	char	*function_name = "mbeditviz_delete_file";
-	int	i;
-
-	/* print input debug statements */
-	if (mbev_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       ifile:       %d\n",ifile);
-		}
-
-	/* unload the file if needed */
-	if (ifile >= 0 && ifile < mbev_num_files
-		&& mbev_files[ifile].load_status == MB_YES)
-		{
-		mbeditviz_unload_file(ifile);
-		}
-
-	/* delete the file */
-	for (i=ifile;i<mbev_num_files-1;i++)
-		{
-		mbev_files[i] = mbev_files[i+1];
-		}
-	mbev_num_files--;
-
-	/* print output debug statements */
-	if (mbev_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",mbev_error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       mbev_status: %d\n",mbev_status);
-		}
-
-	/* return */
-	return(mbev_status);
-}
-/*--------------------------------------------------------------------*/
-/* approximate error function altered from numerical recipies */
-double mbeditviz_erf(double x)
-{
-	double t, z, erfc_d, erf_d;
-
-	z=fabs(x);
-	t=1.0/(1.0+0.5*z);
-	erfc_d=t*exp(-z*z-1.26551223+t*(1.00002368+t*(0.37409196+t*(0.09678418+
-		t*(-0.18628806+t*(0.27886807+t*(-1.13520398+t*(1.48851587+
-		t*(-0.82215223+t*0.17087277)))))))));
-	erfc_d =  x >= 0.0 ? erfc_d : 2.0-erfc_d;
-	erf_d = 1.0 - erfc_d;
-	return  erf_d;
-}
-/*--------------------------------------------------------------------*/
-/*
- * function mbeditviz_bin_weight calculates the integrated weight over a bin
- * given the footprint of a sounding
- */
-int mbeditviz_bin_weight(double foot_a, double foot_b, double scale,
-		    double pcx, double pcy, double dx, double dy,
-		    double *px, double *py,
-		    double *weight, int *use)
-{
-	char	*function_name = "mbeditviz_bin_weight";
-	double	fa, fb;
-	double	xe, ye, ang, ratio;
-	int	i;
-
-	/* print input debug statements */
-	if (mbev_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  Function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       foot_a:     %f\n",foot_a);
-		fprintf(stderr,"dbg2       foot_b:     %f\n",foot_b);
-		fprintf(stderr,"dbg2       scale:      %f\n",scale);
-		fprintf(stderr,"dbg2       pcx:        %f\n",pcx);
-		fprintf(stderr,"dbg2       pcy:        %f\n",pcy);
-		fprintf(stderr,"dbg2       dx:         %f\n",dx);
-		fprintf(stderr,"dbg2       dy:         %f\n",dy);
-		fprintf(stderr,"dbg2       p1 x:       %f\n",px[0]);
-		fprintf(stderr,"dbg2       p1 y:       %f\n",py[0]);
-		fprintf(stderr,"dbg2       p2 x:       %f\n",px[1]);
-		fprintf(stderr,"dbg2       p2 y:       %f\n",py[1]);
-		fprintf(stderr,"dbg2       p3 x:       %f\n",px[2]);
-		fprintf(stderr,"dbg2       p3 y:       %f\n",py[2]);
-		fprintf(stderr,"dbg2       p4 x:       %f\n",px[3]);
-		fprintf(stderr,"dbg2       p4 y:       %f\n",py[3]);
-		}
-
-	/* The weighting function is
-		w(x, y) = (1 / (PI * a * b)) * exp(-(x**2/a**2 + y**2/b**2))
-	    in the footprint coordinate system, where the x axis
-	    is along the horizontal projection of the beam and the
-	    y axix is perpendicular to that. The integral of the
-	    weighting function over an simple rectangle defined
-	    by corners (x1, y1), (x2, y1), (x1, y2), (x2, y2) is
-		    x2 y2
-		W = I  I { w(x, y) } dx dy
-		    x1 y1
-
-		  = 1 / 4 * ( erfc(x1/a) - erfc(x2/a)) * ( erfc(y1/a) - erfc(y2/a))
-	    where erfc(u) is the complementary error function.
-	    Each bin is represented as a simple integral in geographic
-	    coordinates, but is rotated in the footprint coordinate system.
-	    I can't figure out how to evaluate this integral over a
-	    rotated rectangle,  and so I am crudely and incorrectly
-	    approximating the integrated weight value by evaluating it over
-	    the same sized rectangle centered at the same location.
-	    Maybe someday I'll figure out how to do it correctly.
-	    DWC 11/18/99 */
-
-	/* get integrated weight */
-	fa = scale * foot_a;
-	fb = scale * foot_b;
-	*weight = 0.25 * ( mbeditviz_erf((pcx + dx) / fa) - mbeditviz_erf((pcx - dx) / fa))
-			* ( mbeditviz_erf((pcy + dy) / fb) - mbeditviz_erf((pcy - dy) / fb));
-
-	/* use if weight large or any ratio <= 1 */
-	if (*weight > 0.05)
-	    {
-	    *use = MBEV_USE_YES;
-	    }
-	/* check ratio of each corner footprint 1/e distance */
-	else
-	    {
-	    *use = MBEV_USE_NO;
-	    for (i=0;i<4;i++)
-		{
-		ang = RTD * atan2(py[i], px[i]);
-		xe = foot_a * cos(DTR * ang);
-		ye = foot_b * sin(DTR * ang);
-		ratio = sqrt((px[i] * px[i] + py[i] * py[i])
-				/ (xe * xe + ye * ye));
-		if (ratio <= 1.0)
-		    *use = MBEV_USE_YES;
-		else if (ratio <= 2.0)
-		    *use = MBEV_USE_CONDITIONAL;
-		}
-	    }
-
-	/* print output debug statements */
-	if (mbev_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",mbev_error);
-		fprintf(stderr,"dbg2       weight:     %f\n",*weight);
-		fprintf(stderr,"dbg2       use:        %d\n",*use);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       mbev_status:%d\n",mbev_status);
-		}
-
-	/* return status */
-	return(mbev_status);
-}
-/*--------------------------------------------------------------------*/
-int mbeditviz_get_grid_bounds()
-{
-	/* local variables */
-	char	*function_name = "mbeditviz_get_grid_bounds";
-	struct mbev_file_struct *file;
-	struct mb_info_struct *info;
-	double	depth_min, depth_max;
-	double	altitude_min, altitude_max;
-	int	first;
-	double	xx, yy;
-	double	reference_lon, reference_lat;
-	int	utm_zone;
-	int	proj_status;
-	char	projection_id[MB_PATH_MAXLINE];
-	void	*pjptr;
-	int	ifile;
-
-	/* print input debug statements */
-	if (mbev_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		}
-
-	/* find lon lat bounds of loaded files */
-	if (mbev_num_files_loaded > 0)
-		{
-		first = MB_YES;
-		for (ifile=0;ifile<mbev_num_files;ifile++)
-			{
-			file = &mbev_files[ifile];
-			if (file->load_status == MB_YES)
-				{
-				if (file->processed_info_loaded == MB_YES)
-					info = &(file->processed_info);
-				else
-					info = &(file->raw_info);
-				if (first == MB_YES)
-					{
-					mbev_grid_bounds[0] = info->lon_min;
-					mbev_grid_bounds[1] = info->lon_max;
-					mbev_grid_bounds[2] = info->lat_min;
-					mbev_grid_bounds[3] = info->lat_max;
-					depth_min = info->depth_min;
-					depth_max = info->depth_max;
-					altitude_min = info->altitude_min;
-					altitude_max = info->altitude_max;
-					first = MB_NO;
-/*fprintf(stderr,"Processed:%d Name:%s Bounds: %f %f %f %F   File Bounds: %f %f %f %f\n",
-file->processed_info_loaded,file->name,
-mbev_grid_bounds[0],mbev_grid_bounds[1],mbev_grid_bounds[2],mbev_grid_bounds[3],
-info->lon_min,info->lon_max,info->lat_min,info->lat_max);*/
-					}
-				else
-					{
-					mbev_grid_bounds[0] = MIN(mbev_grid_bounds[0],info->lon_min);
-					mbev_grid_bounds[1] = MAX(mbev_grid_bounds[1],info->lon_max);
-					mbev_grid_bounds[2] = MIN(mbev_grid_bounds[2],info->lat_min);
-					mbev_grid_bounds[3] = MAX(mbev_grid_bounds[3],info->lat_max);
-					depth_min = MIN(depth_min,info->depth_min);
-					depth_max = MIN(depth_max,info->depth_max);
-					altitude_min = MIN(altitude_min,info->altitude_min);
-					altitude_max = MIN(altitude_max,info->altitude_max);
-/*fprintf(stderr,"Processed:%d Name:%s Bounds: %f %f %f %F   File Bounds: %f %f %f %f\n",
-file->processed_info_loaded,file->name,
-mbev_grid_bounds[0],mbev_grid_bounds[1],mbev_grid_bounds[2],mbev_grid_bounds[3],
-info->lon_min,info->lon_max,info->lat_min,info->lat_max);*/
-					}
-				}
-			}
-		}
-	if (mbev_num_files_loaded <= 0 || mbev_grid_bounds[1] <= mbev_grid_bounds[0]
-		|| mbev_grid_bounds[3] <= mbev_grid_bounds[2])
-		{
-		mbev_status = MB_FAILURE;
-		mbev_error = MB_ERROR_BAD_PARAMETER;
-		}
-	else
-		{
-		mbev_status = MB_SUCCESS;
-		mbev_error = MB_ERROR_NO_ERROR;
-		}
-
-	/* get projection */
-	if (mbev_status == MB_SUCCESS)
-		{
-		/* get projection */
-		reference_lon = 0.5 * (mbev_grid_bounds[0] + mbev_grid_bounds[1]);
-		reference_lat = 0.5 * (mbev_grid_bounds[2] + mbev_grid_bounds[3]);
-		if (reference_lon < 180.0)
-			reference_lon += 360.0;
-		if (reference_lon >= 180.0)
-			reference_lon -= 360.0;
-		utm_zone = (int)(((reference_lon + 183.0)
-			/ 6.0) + 0.5);
-		if (reference_lat >= 0.0)
-			sprintf(projection_id, "UTM%2.2dN", utm_zone);
-		else
-			sprintf(projection_id, "UTM%2.2dS", utm_zone);
-		proj_status = mb_proj_init(mbev_verbose,projection_id,
-			&(pjptr), &mbev_error);
-		if (proj_status != MB_SUCCESS)
-			{
-			mbev_status = MB_FAILURE;
-			mbev_error = MB_ERROR_BAD_PARAMETER;
-			}
-		}
-
-	/* get grid cell size and dimensions */
-	if (mbev_status == MB_SUCCESS)
-		{
-		/* get projected bounds */
-
-		/* first point */
-		mb_proj_forward(mbev_verbose, pjptr, mbev_grid_bounds[0], mbev_grid_bounds[2],
-				&xx, &yy, &mbev_error);
-		mbev_grid_boundsutm[0] = xx;
-		mbev_grid_boundsutm[1] = xx;
-		mbev_grid_boundsutm[2] = yy;
-		mbev_grid_boundsutm[3] = yy;
-//fprintf(stderr,"Grid bounds: %f %f %f %f    %f %f %f %f\n",
-//mbev_grid_bounds[0],mbev_grid_bounds[1],mbev_grid_bounds[2],mbev_grid_bounds[3],
-//mbev_grid_boundsutm[0],mbev_grid_boundsutm[1],mbev_grid_boundsutm[2],mbev_grid_boundsutm[3]);
-
-		/* second point */
-		mb_proj_forward(mbev_verbose, pjptr, mbev_grid_bounds[1], mbev_grid_bounds[2],
-				&xx, &yy, &mbev_error);
-		mbev_grid_boundsutm[0] = MIN(mbev_grid_boundsutm[0], xx);
-		mbev_grid_boundsutm[1] = MAX(mbev_grid_boundsutm[1], xx);
-		mbev_grid_boundsutm[2] = MIN(mbev_grid_boundsutm[2], yy);
-		mbev_grid_boundsutm[3] = MAX(mbev_grid.boundsutm[3], yy);
-//fprintf(stderr,"Grid bounds: %f %f %f %f    %f %f %f %f\n",
-//mbev_grid_bounds[0],mbev_grid_bounds[1],mbev_grid_bounds[2],mbev_grid_bounds[3],
-//mbev_grid_boundsutm[0],mbev_grid_boundsutm[1],mbev_grid_boundsutm[2],mbev_grid_boundsutm[3]);
-
-		/* third point */
-		mb_proj_forward(mbev_verbose, pjptr, mbev_grid_bounds[0], mbev_grid_bounds[3],
-				&xx, &yy, &mbev_error);
-		mbev_grid_boundsutm[0] = MIN(mbev_grid_boundsutm[0], xx);
-		mbev_grid_boundsutm[1] = MAX(mbev_grid_boundsutm[1], xx);
-		mbev_grid_boundsutm[2] = MIN(mbev_grid_boundsutm[2], yy);
-		mbev_grid_boundsutm[3] = MAX(mbev_grid_boundsutm[3], yy);
-//fprintf(stderr,"Grid bounds: %f %f %f %f    %f %f %f %f\n",
-//mbev_grid_bounds[0],mbev_grid_bounds[1],mbev_grid_bounds[2],mbev_grid_bounds[3],
-//mbev_grid_boundsutm[0],mbev_grid_boundsutm[1],mbev_grid_boundsutm[2],mbev_grid_boundsutm[3]);
-
-		/* fourth point */
-		mb_proj_forward(mbev_verbose, pjptr, mbev_grid_bounds[1], mbev_grid_bounds[3],
-				&xx, &yy, &mbev_error);
-		mbev_grid_boundsutm[0] = MIN(mbev_grid_boundsutm[0], xx);
-		mbev_grid_boundsutm[1] = MAX(mbev_grid_boundsutm[1], xx);
-		mbev_grid_boundsutm[2] = MIN(mbev_grid_boundsutm[2], yy);
-		mbev_grid_boundsutm[3] = MAX(mbev_grid_boundsutm[3], yy);
-//fprintf(stderr,"Grid bounds: %f %f %f %f    %f %f %f %f\n",
-//mbev_grid_bounds[0],mbev_grid_bounds[1],mbev_grid_bounds[2],mbev_grid_bounds[3],
-//mbev_grid_boundsutm[0],mbev_grid_boundsutm[1],mbev_grid_boundsutm[2],mbev_grid_boundsutm[3]);
-
-		/* get grid spacing */
-fprintf(stderr,"altitude: %f %f\n", altitude_min, altitude_max);
-		if (altitude_max > 0.0)
-			mbev_grid_cellsize = 0.02 * altitude_max;
-		else if (depth_max > 0.0)
-			mbev_grid_cellsize = 0.02 * depth_max;
-		else
-			mbev_grid_cellsize = (mbev_grid_boundsutm[1] - mbev_grid_boundsutm[0]) / 250;
-
-		/* get grid dimensions */
-		mbev_grid_nx = (mbev_grid_boundsutm[1] - mbev_grid_boundsutm[0]) / mbev_grid_cellsize + 1;
-		mbev_grid_ny = (mbev_grid_boundsutm[3] - mbev_grid_boundsutm[2]) / mbev_grid_cellsize + 1;
-		mbev_grid_boundsutm[1] = mbev_grid_boundsutm[0] + (mbev_grid_nx - 1) * mbev_grid_cellsize;
-		mbev_grid_boundsutm[3] = mbev_grid_boundsutm[2] + (mbev_grid_ny - 1) * mbev_grid_cellsize;
-fprintf(stderr,"Grid bounds: %f %f %f %f    %f %f %f %f\n",
-mbev_grid_bounds[0],mbev_grid_bounds[1],mbev_grid_bounds[2],mbev_grid_bounds[3],
-mbev_grid_boundsutm[0],mbev_grid_boundsutm[1],mbev_grid_boundsutm[2],mbev_grid_boundsutm[3]);
-fprintf(stderr,"cell size:%f dimensions: %d %d\n",
-mbev_grid_cellsize,mbev_grid_nx,mbev_grid_ny);
-
-		/* release projection */
-		mb_proj_free(mbev_verbose, &(pjptr), &mbev_error);
-		}
-
-	/* print output debug statements */
-	if (mbev_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",mbev_error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       mbev_status: %d\n",mbev_status);
-		}
-
-	/* return */
-	return(mbev_status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbeditviz_setup_grid()
-{
-	/* local variables */
-	char	*function_name = "mbeditviz_setup_grid";
-	double	xx, yy;
-	double	reference_lon, reference_lat;
-	int	utm_zone;
-	int	proj_status;
-
-	/* print input debug statements */
-	if (mbev_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		}
-
-	/* find lon lat bounds of loaded files */
-	if (mbev_num_files_loaded > 0)
-		{
-		/* get grid bounds */
-		mbev_grid.bounds[0] = mbev_grid_bounds[0];
-		mbev_grid.bounds[1] = mbev_grid_bounds[1];
-		mbev_grid.bounds[2] = mbev_grid_bounds[2];
-		mbev_grid.bounds[3] = mbev_grid_bounds[3];
-
-		/* get grid spacing */
-		mbev_grid.dx = mbev_grid_cellsize;
-		mbev_grid.dy = mbev_grid_cellsize;
-		}
-	if (mbev_num_files_loaded <= 0 || mbev_grid.bounds[1] <= mbev_grid.bounds[0]
-		|| mbev_grid.bounds[3] <= mbev_grid.bounds[2])
-		{
-		mbev_status = MB_FAILURE;
-		mbev_error = MB_ERROR_BAD_PARAMETER;
-		}
-	else
-		{
-		mbev_status = MB_SUCCESS;
-		mbev_error = MB_ERROR_NO_ERROR;
-		}
-
-	/* get projection */
-	if (mbev_status == MB_SUCCESS)
-		{
-		/* get projection */
-		reference_lon = 0.5 * (mbev_grid.bounds[0] + mbev_grid.bounds[1]);
-		reference_lat = 0.5 * (mbev_grid.bounds[2] + mbev_grid.bounds[3]);
-		if (reference_lon < 180.0)
-			reference_lon += 360.0;
-		if (reference_lon >= 180.0)
-			reference_lon -= 360.0;
-		utm_zone = (int)(((reference_lon + 183.0)
-			/ 6.0) + 0.5);
-		if (reference_lat >= 0.0)
-			sprintf(mbev_grid.projection_id, "UTM%2.2dN", utm_zone);
-		else
-			sprintf(mbev_grid.projection_id, "UTM%2.2dS", utm_zone);
-		proj_status = mb_proj_init(mbev_verbose,mbev_grid.projection_id,
-			&(mbev_grid.pjptr), &mbev_error);
-		if (proj_status != MB_SUCCESS)
-			{
-			mbev_status = MB_FAILURE;
-			mbev_error = MB_ERROR_BAD_PARAMETER;
-			}
-		}
-
-	/* get grid cell size and dimensions */
-	if (mbev_status == MB_SUCCESS)
-		{
-		/* get projected bounds */
-
-		/* first point */
-		mb_proj_forward(mbev_verbose, mbev_grid.pjptr, mbev_grid.bounds[0], mbev_grid.bounds[2],
-				&xx, &yy, &mbev_error);
-		mbev_grid.boundsutm[0] = xx;
-		mbev_grid.boundsutm[1] = xx;
-		mbev_grid.boundsutm[2] = yy;
-		mbev_grid.boundsutm[3] = yy;
-
-		/* second point */
-		mb_proj_forward(mbev_verbose, mbev_grid.pjptr, mbev_grid.bounds[1], mbev_grid.bounds[2],
-				&xx, &yy, &mbev_error);
-		mbev_grid.boundsutm[0] = MIN(mbev_grid.boundsutm[0], xx);
-		mbev_grid.boundsutm[1] = MAX(mbev_grid.boundsutm[1], xx);
-		mbev_grid.boundsutm[2] = MIN(mbev_grid.boundsutm[2], yy);
-		mbev_grid.boundsutm[3] = MAX(mbev_grid.boundsutm[3], yy);
-
-		/* third point */
-		mb_proj_forward(mbev_verbose, mbev_grid.pjptr, mbev_grid.bounds[0], mbev_grid.bounds[3],
-				&xx, &yy, &mbev_error);
-		mbev_grid.boundsutm[0] = MIN(mbev_grid.boundsutm[0], xx);
-		mbev_grid.boundsutm[1] = MAX(mbev_grid.boundsutm[1], xx);
-		mbev_grid.boundsutm[2] = MIN(mbev_grid.boundsutm[2], yy);
-		mbev_grid.boundsutm[3] = MAX(mbev_grid.boundsutm[3], yy);
-
-		/* fourth point */
-		mb_proj_forward(mbev_verbose, mbev_grid.pjptr, mbev_grid.bounds[1], mbev_grid.bounds[3],
-				&xx, &yy, &mbev_error);
-		mbev_grid.boundsutm[0] = MIN(mbev_grid.boundsutm[0], xx);
-		mbev_grid.boundsutm[1] = MAX(mbev_grid.boundsutm[1], xx);
-		mbev_grid.boundsutm[2] = MIN(mbev_grid.boundsutm[2], yy);
-		mbev_grid.boundsutm[3] = MAX(mbev_grid.boundsutm[3], yy);
-
-		/* get grid dimensions */
-		mbev_grid.nx = (mbev_grid.boundsutm[1] - mbev_grid.boundsutm[0]) / mbev_grid.dx + 1;
-		mbev_grid.ny = (mbev_grid.boundsutm[3] - mbev_grid.boundsutm[2]) / mbev_grid.dy + 1;
-		mbev_grid.boundsutm[1] = mbev_grid.boundsutm[0] + (mbev_grid.nx - 1) * mbev_grid.dx;
-		mbev_grid.boundsutm[3] = mbev_grid.boundsutm[2] + (mbev_grid.ny - 1) * mbev_grid.dy;
-/*fprintf(stderr,"Grid bounds: %f %f %f %f    %f %f %f %f\n",
-mbev_grid.bounds[0],mbev_grid.bounds[1],mbev_grid.bounds[2],mbev_grid.bounds[3],
-mbev_grid.boundsutm[0],mbev_grid.boundsutm[1],mbev_grid.boundsutm[2],mbev_grid.boundsutm[3]);
-fprintf(stderr,"cell size:%f %f dimensions: %d %d\n",
-mbev_grid.dx,mbev_grid.dy,mbev_grid.nx,mbev_grid.ny);*/
-		}
-
-	/* allocate memory for grid */
-	if (mbev_status == MB_SUCCESS)
-		{
-		if ((mbev_grid.sum = (float *) malloc(mbev_grid.nx * mbev_grid.ny * sizeof(float))) == NULL)
-						mbev_error = MB_ERROR_MEMORY_FAIL;
-		if ((mbev_grid.wgt = (float *) malloc(mbev_grid.nx * mbev_grid.ny * sizeof(float))) == NULL)
-						mbev_error = MB_ERROR_MEMORY_FAIL;
-		if ((mbev_grid.val = (float *) malloc(mbev_grid.nx * mbev_grid.ny * sizeof(float))) == NULL)
-						mbev_error = MB_ERROR_MEMORY_FAIL;
-		if ((mbev_grid.sgm = (float *) malloc(mbev_grid.nx * mbev_grid.ny * sizeof(float))) == NULL)
-						mbev_error = MB_ERROR_MEMORY_FAIL;
-		if (mbev_error == MB_ERROR_NO_ERROR)
-			{
-			memset(mbev_grid.sum, 0, mbev_grid.nx * mbev_grid.ny * sizeof(float));
-			memset(mbev_grid.wgt, 0, mbev_grid.nx * mbev_grid.ny * sizeof(float));
-			memset(mbev_grid.val, 0, mbev_grid.nx * mbev_grid.ny * sizeof(float));
-			memset(mbev_grid.sgm, 0, mbev_grid.nx * mbev_grid.ny * sizeof(float));
-			}
-		else
-			mbev_status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (mbev_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",mbev_error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       mbev_status: %d\n",mbev_status);
-		}
-
-	/* return */
-	return(mbev_status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbeditviz_project_soundings()
-{
-	/* local variables */
-	char	*function_name = "mbeditviz_project_soundings";
-	struct mbev_file_struct *file;
-	struct mbev_ping_struct *ping;
-	int	ifile, iping, ibeam;
-	int	filecount;
-
-	/* print input debug statements */
-	if (mbev_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		}
-
-	/* project all soundings into the grid coordinates */
-	if (mbev_status == MB_SUCCESS)
-		{
-		/* loop over loaded files */
-		filecount = 0;
-		for (ifile=0;ifile<mbev_num_files;ifile++)
-			{
-			file = &mbev_files[ifile];
-			if (file->load_status == MB_YES)
-				{
-				filecount++;
-				sprintf(message, "Projecting file %d of %d...", filecount, mbev_num_files_loaded);
-				do_mbeditviz_message_on(message);
-				for (iping=0;iping<file->num_pings;iping++)
-					{
-					ping = &(file->pings[iping]);
-					mb_proj_forward(mbev_verbose, mbev_grid.pjptr,
-							ping->navlon, ping->navlat,
-							&ping->navlonx, &ping->navlaty,
-							&mbev_error);
-					for (ibeam=0;ibeam<ping->beams_bath;ibeam++)
-						{
-						if (!mb_beam_check_flag_null(ping->beamflag[ibeam]))
-							{
-							mb_proj_forward(mbev_verbose, mbev_grid.pjptr,
-									ping->bathlon[ibeam], ping->bathlat[ibeam],
-									&ping->bathx[ibeam], &ping->bathy[ibeam],
-									&mbev_error);
-							}
-						}
-					}
-				}
-			}
-		}
-
-	/* print output debug statements */
-	if (mbev_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",mbev_error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       mbev_status: %d\n",mbev_status);
-		}
-
-	/* return */
-	return(mbev_status);
-}
-
-
-/*--------------------------------------------------------------------*/
-int mbeditviz_make_grid()
-{
-	/* local variables */
-	char	*function_name = "mbeditviz_make_grid";
-	struct mbev_file_struct *file;
-	struct mbev_ping_struct *ping;
-	int	first;
-	int	ifile, iping, ibeam;
-	int	filecount;
-	int	i, j, k;
-
-	/* print input debug statements */
-	if (mbev_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		}
-
-	/* zero the grid arrays */
-	memset(mbev_grid.sum, 0, mbev_grid.nx * mbev_grid.ny * sizeof(float));
-	memset(mbev_grid.wgt, 0, mbev_grid.nx * mbev_grid.ny * sizeof(float));
-	/* memset(mbev_grid.val, 0, mbev_grid.nx * mbev_grid.ny * sizeof(float));*/
-	memset(mbev_grid.sgm, 0, mbev_grid.nx * mbev_grid.ny * sizeof(float));
-
-	/* loop over loaded files */
-	filecount = 0;
-	for (ifile=0;ifile<mbev_num_files;ifile++)
-		{
-		file = &mbev_files[ifile];
-		if (file->load_status == MB_YES)
-			{
-			filecount++;
-			sprintf(message, "Gridding file %d of %d...", filecount, mbev_num_files_loaded);
-			do_mbeditviz_message_on(message);
-			for (iping=0;iping<file->num_pings;iping++)
-				{
-				ping = &(file->pings[iping]);
-				for (ibeam=0;ibeam<ping->beams_bath;ibeam++)
-					{
-					if (mb_beam_ok(ping->beamflag[ibeam]))
-						{
-						mbeditviz_grid_beam(file, ping, ibeam, MB_YES, MB_NO);
-						}
-					}
-				}
-			}
-		}
-	mbev_grid.nodatavalue = MBEV_NODATA;
-	first = MB_YES;
-	for (i=0;i<mbev_grid.nx;i++)
-		for (j=0;j<mbev_grid.ny;j++)
-			{
-			k = i * mbev_grid.ny + j;
-			if (mbev_grid.wgt[k] > 0.0)
-				{
-				mbev_grid.val[k] = mbev_grid.sum[k] / mbev_grid.wgt[k];
-				mbev_grid.sgm[k] = sqrt(fabs(mbev_grid.sgm[k] / mbev_grid.wgt[k]
-							- mbev_grid.val[k] * mbev_grid.val[k]));
-				if (first == MB_YES)
-					{
-					mbev_grid.min = mbev_grid.val[k];
-					mbev_grid.max = mbev_grid.val[k];
-					mbev_grid.smin = mbev_grid.sgm[k];
-					mbev_grid.smax = mbev_grid.sgm[k];
-					first = MB_NO;
-					}
-				else
-					{
-					mbev_grid.min = MIN(mbev_grid.min, mbev_grid.val[k]);
-					mbev_grid.max = MAX(mbev_grid.max, mbev_grid.val[k]);
-					mbev_grid.smin = MIN(mbev_grid.smin, mbev_grid.sgm[k]);
-					mbev_grid.smax = MAX(mbev_grid.smax, mbev_grid.sgm[k]);
-					}
-				}
-			else
-				{
-				mbev_grid.val[k] = mbev_grid.nodatavalue;
-				mbev_grid.sgm[k] = mbev_grid.nodatavalue;
-				}
-			}
-	if (mbev_grid.status == MBEV_GRID_NONE)
-		mbev_grid.status = MBEV_GRID_NOTVIEWED;
-
-	/* print output debug statements */
-	if (mbev_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",mbev_error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       mbev_status: %d\n",mbev_status);
-		}
-
-	/* return */
-	return(mbev_status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbeditviz_grid_beam(struct mbev_file_struct *file, struct mbev_ping_struct *ping, int ibeam, int beam_ok, int apply_now)
-{
-	/* local variables */
-	char	*function_name = "mbeditviz_grid_beam";
-	double	xx, yy;
-	double	foot_dx, foot_dy, foot_dxn, foot_dyn;
-	double	foot_lateral, foot_range, foot_theta;
-	double	foot_dtheta, foot_dphi;
-	double	foot_hwidth, foot_hlength;
-	int	foot_wix, foot_wiy, foot_lix, foot_liy, foot_dix, foot_diy;
-	double	xx0, yy0, bdx, bdy, xx1, xx2, yy1, yy2;
-	double	prx[5], pry[5];
-	double	weight;
-	int	use_weight;
-	int	ix1, ix2, iy1, iy2;
-	int	ii, jj, kk;
-	int	i, j;
-
-	/* print input debug statements */
-	if (mbev_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       file:       %p\n",file);
-		fprintf(stderr,"dbg2       ping:       %p\n",ping);
-		fprintf(stderr,"dbg2       ibeam:      %d\n",ibeam);
-		fprintf(stderr,"dbg2       beam_ok:    %d\n",beam_ok);
-		fprintf(stderr,"dbg2       apply_now:  %d\n",apply_now);
-		}
-
-	/* find location of beam center */
-	i = (ping->bathx[ibeam] - mbev_grid.boundsutm[0] + 0.5 * mbev_grid.dx)
-		/ mbev_grid.dx;
-	j = (ping->bathy[ibeam] - mbev_grid.boundsutm[2] + 0.5 * mbev_grid.dy)
-		/ mbev_grid.dy;
-
-	/* proceed if beam in grid */
-	if (i >= 0 && i < mbev_grid.nx && j >= 0 && j < mbev_grid.ny)
-		{
-		/* simple gridding mode */
-		if (file->topo_type != MB_TOPOGRAPHY_TYPE_MULTIBEAM
-			|| mbev_grid_algorithm == MBEV_GRID_ALGORITH_SIMPLE)
-			{
-			/* get location in grid arrays */
-			kk = i * mbev_grid.ny + j;
-
-if (isnan(ping->bathcorr[ibeam]))
-{
-fprintf(stderr,"\nFunction mbeditviz_grid_beam(): Encountered NaN value in swath data from file: %s\n",file->path);
-fprintf(stderr,"     Ping time: %4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d\n",
-	ping->time_i[0],ping->time_i[1],ping->time_i[2],ping->time_i[3],ping->time_i[4],ping->time_i[5],ping->time_i[6]);
-fprintf(stderr,"     Beam bathymetry: beam:%d flag:%d bath:<%f %f> acrosstrack:%f alongtrack:%f\n",ibeam,ping->beamflag[ibeam],ping->bath[ibeam],ping->bathcorr[ibeam],ping->bathacrosstrack[ibeam],ping->bathalongtrack[ibeam]);
-}
-
-			/* add to weights and sums */
-			if (beam_ok == MB_YES)
-				{
-				mbev_grid.wgt[kk] += 1.0;
-				mbev_grid.sum[kk] += (-ping->bathcorr[ibeam]);
-				mbev_grid.sgm[kk] += ping->bathcorr[ibeam] * ping->bathcorr[ibeam];
-				}
-			else
-				{
-				mbev_grid.wgt[kk] -= 1.0;
-				mbev_grid.sum[kk] -= (-ping->bathcorr[ibeam]);
-				mbev_grid.sgm[kk] -= ping->bathcorr[ibeam] * ping->bathcorr[ibeam];
-				if (mbev_grid.wgt[kk] < MBEV_GRID_WEIGHT_TINY)
-					mbev_grid.wgt[kk] = 0.0;
-				}
-
-			/* recalculate grid cell if desired */
-			if (apply_now == MB_YES)
-				{
-				/* recalculate grid cell */
-				if (mbev_grid.wgt[kk] > 0.0)
-					{
-					mbev_grid.val[kk] = mbev_grid.sum[kk] / mbev_grid.wgt[kk];
-					mbev_grid.sgm[kk] = sqrt(fabs(mbev_grid.sgm[kk] / mbev_grid.wgt[kk]
-								- mbev_grid.val[kk] * mbev_grid.val[kk]));
-					mbev_grid.min = MIN(mbev_grid.min, mbev_grid.val[kk]);
-					mbev_grid.max = MAX(mbev_grid.max, mbev_grid.val[kk]);
-					mbev_grid.smin = MIN(mbev_grid.smin, mbev_grid.sgm[kk]);
-					mbev_grid.smax = MAX(mbev_grid.smax, mbev_grid.sgm[kk]);
-					}
-				else
-					{
-					mbev_grid.val[kk] = mbev_grid.nodatavalue;
-					mbev_grid.sgm[kk] = mbev_grid.nodatavalue;
-					}
-
-				/* update grid in mbview display */
-				mbview_updateprimarygridcell(mbev_verbose, 0, i, j, mbev_grid.val[kk], &mbev_error);
-				}
-			}
-
-		/* else footprint gridding algorithm */
-		else
-			{
-			/* calculate footprint */
-			foot_dx = (ping->bathx[ibeam] - ping->navlonx);
-			foot_dy = (ping->bathy[ibeam] - ping->navlaty);
-			foot_lateral = sqrt(foot_dx * foot_dx + foot_dy * foot_dy);
-			if (foot_lateral > 0.0)
-				{
-				foot_dxn = foot_dx / foot_lateral;
-				foot_dyn = foot_dy / foot_lateral;
-				}
-			else
-				{
-				foot_dxn = 1.0;
-				foot_dyn = 0.0;
-				}
-			foot_range = sqrt(foot_lateral * foot_lateral + ping->altitude * ping->altitude);
-			foot_theta = RTD * atan2(foot_lateral, (ping->bathcorr[ibeam] - ping->sonardepth));
-			foot_dtheta = 0.5 * file->beamwidth_xtrack;
-			foot_dphi = 0.5 * file->beamwidth_ltrack;
-			if (foot_dtheta <= 0.0)
-				foot_dtheta = 1.0;
-			if (foot_dphi <= 0.0)
-				foot_dphi = 1.0;
-			foot_hwidth =(ping->bathcorr[ibeam] - ping->sonardepth)
-					* tan(DTR * (foot_theta + foot_dtheta))
-					    - foot_lateral;
-			foot_hlength = foot_range * tan(DTR * foot_dphi);
-
-			/* get range of bins around footprint to examine */
-			foot_wix = fabs(foot_hwidth * cos(DTR * foot_theta) / mbev_grid.dx);
-			foot_wiy = fabs(foot_hwidth * sin(DTR * foot_theta) / mbev_grid.dx);
-			foot_lix = fabs(foot_hlength * sin(DTR * foot_theta) / mbev_grid.dy);
-			foot_liy = fabs(foot_hlength * cos(DTR * foot_theta) / mbev_grid.dy);
-			foot_dix = 2 * MAX(foot_wix, foot_lix);
-			foot_diy = 2 * MAX(foot_wiy, foot_liy);
-			ix1 = MAX(i - foot_dix, 0);
-			ix2 = MIN(i + foot_dix, mbev_grid.nx - 1);
-			iy1 = MAX(j - foot_diy, 0);
-			iy2 = MIN(j + foot_diy, mbev_grid.ny - 1);
-
-			/* loop over neighborhood of bins */
-			for (ii=ix1;ii<=ix2;ii++)
-				for (jj=iy1;jj<=iy2;jj++)
-					{
-					/* find distance of bin center from sounding center */
-					xx = (mbev_grid.boundsutm[0] + ii * mbev_grid.dx
-						+ 0.5 * mbev_grid.dx - ping->bathx[ibeam]);
-					yy = (mbev_grid.boundsutm[2] + jj * mbev_grid.dy
-						+ 0.5 * mbev_grid.dy - ping->bathy[ibeam]);
-
-					/* get center and corners of bin in meters from sounding center */
-					xx0 = xx;
-					yy0 = yy;
-					bdx = 0.5 * mbev_grid.dx;
-					bdy = 0.5 * mbev_grid.dy;
-					xx1 = xx0 - bdx;
-					xx2 = xx0 + bdx;
-					yy1 = yy0 - bdy;
-					yy2 = yy0 + bdy;
-
-					/* rotate center and corners of bin to footprint coordinates */
-					prx[0] = xx0 * foot_dxn + yy0 * foot_dyn;
-					pry[0] = -xx0 * foot_dyn + yy0 * foot_dxn;
-					prx[1] = xx1 * foot_dxn + yy1 * foot_dyn;
-					pry[1] = -xx1 * foot_dyn + yy1 * foot_dxn;
-					prx[2] = xx2 * foot_dxn + yy1 * foot_dyn;
-					pry[2] = -xx2 * foot_dyn + yy1 * foot_dxn;
-					prx[3] = xx1 * foot_dxn + yy2 * foot_dyn;
-					pry[3] = -xx1 * foot_dyn + yy2 * foot_dxn;
-					prx[4] = xx2 * foot_dxn + yy2 * foot_dyn;
-					pry[4] = -xx2 * foot_dyn + yy2 * foot_dxn;
-
-					/* get weight integrated over bin */
-					mbeditviz_bin_weight(foot_hwidth, foot_hlength, 1.0,
-						prx[0], pry[0], bdx, bdy,
-						&prx[1], &pry[1],
-						&weight, &use_weight);
-
-					/* if beam affects cell apply using weight */
-					if (use_weight == MBEV_USE_YES)
-						{
-						/* get location in grid arrays */
-						kk = ii * mbev_grid.ny + jj;
-
-						/* add to weights and sums */
-						if (beam_ok == MB_YES)
-							{
-							mbev_grid.wgt[kk] += weight;
-							mbev_grid.sum[kk] += weight * (-ping->bathcorr[ibeam]);
-							mbev_grid.sgm[kk] += weight * ping->bathcorr[ibeam] * ping->bathcorr[ibeam];
-							}
-						else
-							{
-							mbev_grid.wgt[kk] -= weight;
-							mbev_grid.sum[kk] -= weight * (-ping->bathcorr[ibeam]);
-							mbev_grid.sgm[kk] -= weight * ping->bathcorr[ibeam] * ping->bathcorr[ibeam];
-							if (mbev_grid.wgt[kk] < MBEV_GRID_WEIGHT_TINY)
-								mbev_grid.wgt[kk] = 0.0;
-							}
-
-						/* recalculate grid cell if desired */
-						if (apply_now == MB_YES)
-							{
-							/* recalculate grid cell */
-							if (mbev_grid.wgt[kk] > 0.0)
-								{
-								mbev_grid.val[kk] = mbev_grid.sum[kk] / mbev_grid.wgt[kk];
-								mbev_grid.sgm[kk] = sqrt(fabs(mbev_grid.sgm[kk] / mbev_grid.wgt[kk]
-											- mbev_grid.val[kk] * mbev_grid.val[kk]));
-								mbev_grid.min = MIN(mbev_grid.min, mbev_grid.val[kk]);
-								mbev_grid.max = MAX(mbev_grid.max, mbev_grid.val[kk]);
-								mbev_grid.smin = MIN(mbev_grid.smin, mbev_grid.sgm[kk]);
-								mbev_grid.smax = MAX(mbev_grid.smax, mbev_grid.sgm[kk]);
-								}
-							else
-								{
-								mbev_grid.val[kk] = mbev_grid.nodatavalue;
-								mbev_grid.sgm[kk] = mbev_grid.nodatavalue;
-								}
-
-							/* update grid in mbview display */
-							mbview_updateprimarygridcell(mbev_verbose, 0, ii, jj, mbev_grid.val[kk], &mbev_error);
-							}
-						}
-					}
-			}
-		}
-
-	/* print output debug statements */
-	if (mbev_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",mbev_error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       mbev_status: %d\n",mbev_status);
-		}
-
-	/* return */
-	return(mbev_status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbeditviz_make_grid_simple()
-{
-	/* local variables */
-	char	*function_name = "mbeditviz_make_grid_simple";
-	struct mbev_file_struct *file;
-	struct mbev_ping_struct *ping;
-	struct mb_info_struct *info;
-	double	depth_min, depth_max;
-	double	altitude_min, altitude_max;
-	int	first;
-	double	xx, yy;
-	double	reference_lon, reference_lat;
-	int	utm_zone;
-	int	proj_status;
-	int	ifile, iping, ibeam;
-	int	filecount;
-	int	i, j, k;
-
-	/* print input debug statements */
-	if (mbev_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		}
-
-	/* find lon lat bounds of loaded files */
-	if (mbev_num_files_loaded > 0)
-		{
-		first = MB_YES;
-		for (ifile=0;ifile<mbev_num_files;ifile++)
-			{
-			file = &mbev_files[ifile];
-			if (file->load_status == MB_YES)
-				{
-				if (file->processed_info_loaded == MB_YES)
-					info = &(file->processed_info);
-				else
-					info = &(file->raw_info);
-				if (first == MB_YES)
-					{
-					mbev_grid.bounds[0] = info->lon_min;
-					mbev_grid.bounds[1] = info->lon_max;
-					mbev_grid.bounds[2] = info->lat_min;
-					mbev_grid.bounds[3] = info->lat_max;
-					depth_min = info->depth_min;
-					depth_max = info->depth_max;
-					altitude_min = info->altitude_min;
-					altitude_max = info->altitude_max;
-					first = MB_NO;
-if (mbev_verbose > 0)
-fprintf(stderr,"Processed:%d Name:%s Bounds: %f %f %f %F   File Bounds: %f %f %f %f\n",
-file->processed_info_loaded,file->name,
-mbev_grid.bounds[0],mbev_grid.bounds[1],mbev_grid.bounds[2],mbev_grid.bounds[3],
-info->lon_min,info->lon_max,info->lat_min,info->lat_max);
-					}
-				else
-					{
-					mbev_grid.bounds[0] = MIN(mbev_grid.bounds[0],info->lon_min);
-					mbev_grid.bounds[1] = MAX(mbev_grid.bounds[1],info->lon_max);
-					mbev_grid.bounds[2] = MIN(mbev_grid.bounds[2],info->lat_min);
-					mbev_grid.bounds[3] = MAX(mbev_grid.bounds[3],info->lat_max);
-					depth_min = MIN(depth_min,info->depth_min);
-					depth_max = MIN(depth_max,info->depth_max);
-					altitude_min = MIN(altitude_min,info->altitude_min);
-					altitude_max = MIN(altitude_max,info->altitude_max);
-if (mbev_verbose > 0)
-fprintf(stderr,"Processed:%d Name:%s Bounds: %f %f %f %F   File Bounds: %f %f %f %f\n",
-file->processed_info_loaded,file->name,
-mbev_grid.bounds[0],mbev_grid.bounds[1],mbev_grid.bounds[2],mbev_grid.bounds[3],
-info->lon_min,info->lon_max,info->lat_min,info->lat_max);
-					}
-				}
-			}
-		}
-	if (mbev_num_files_loaded <= 0 || mbev_grid.bounds[1] <= mbev_grid.bounds[0]
-		|| mbev_grid.bounds[3] <= mbev_grid.bounds[2])
-		{
-		mbev_status = MB_FAILURE;
-		mbev_error = MB_ERROR_BAD_PARAMETER;
-		}
-	else
-		{
-		mbev_status = MB_SUCCESS;
-		mbev_error = MB_ERROR_NO_ERROR;
-		}
-
-	/* get projection */
-	if (mbev_status == MB_SUCCESS)
-		{
-		/* get projection */
-		reference_lon = 0.5 * (mbev_grid.bounds[0] + mbev_grid.bounds[1]);
-		reference_lat = 0.5 * (mbev_grid.bounds[2] + mbev_grid.bounds[3]);
-		if (reference_lon < 180.0)
-			reference_lon += 360.0;
-		if (reference_lon >= 180.0)
-			reference_lon -= 360.0;
-		utm_zone = (int)(((reference_lon + 183.0)
-			/ 6.0) + 0.5);
-		if (reference_lat >= 0.0)
-			sprintf(mbev_grid.projection_id, "UTM%2.2dN", utm_zone);
-		else
-			sprintf(mbev_grid.projection_id, "UTM%2.2dS", utm_zone);
-		proj_status = mb_proj_init(mbev_verbose,mbev_grid.projection_id,
-			&(mbev_grid.pjptr), &mbev_error);
-		if (proj_status != MB_SUCCESS)
-			{
-			mbev_status = MB_FAILURE;
-			mbev_error = MB_ERROR_BAD_PARAMETER;
-			}
-		}
-
-	/* get grid cell size and dimensions */
-	if (mbev_status == MB_SUCCESS)
-		{
-		/* get projected bounds */
-
-		/* first point */
-		mb_proj_forward(mbev_verbose, mbev_grid.pjptr, mbev_grid.bounds[0], mbev_grid.bounds[2],
-				&xx, &yy, &mbev_error);
-		mbev_grid.boundsutm[0] = xx;
-		mbev_grid.boundsutm[1] = xx;
-		mbev_grid.boundsutm[2] = yy;
-		mbev_grid.boundsutm[3] = yy;
-
-		/* second point */
-		mb_proj_forward(mbev_verbose, mbev_grid.pjptr, mbev_grid.bounds[1], mbev_grid.bounds[2],
-				&xx, &yy, &mbev_error);
-		mbev_grid.boundsutm[0] = MIN(mbev_grid.boundsutm[0], xx);
-		mbev_grid.boundsutm[1] = MAX(mbev_grid.boundsutm[1], xx);
-		mbev_grid.boundsutm[2] = MIN(mbev_grid.boundsutm[2], yy);
-		mbev_grid.boundsutm[3] = MAX(mbev_grid.boundsutm[3], yy);
-
-		/* third point */
-		mb_proj_forward(mbev_verbose, mbev_grid.pjptr, mbev_grid.bounds[0], mbev_grid.bounds[3],
-				&xx, &yy, &mbev_error);
-		mbev_grid.boundsutm[0] = MIN(mbev_grid.boundsutm[0], xx);
-		mbev_grid.boundsutm[1] = MAX(mbev_grid.boundsutm[1], xx);
-		mbev_grid.boundsutm[2] = MIN(mbev_grid.boundsutm[2], yy);
-		mbev_grid.boundsutm[3] = MAX(mbev_grid.boundsutm[3], yy);
-
-		/* fourth point */
-		mb_proj_forward(mbev_verbose, mbev_grid.pjptr, mbev_grid.bounds[1], mbev_grid.bounds[3],
-				&xx, &yy, &mbev_error);
-		mbev_grid.boundsutm[0] = MIN(mbev_grid.boundsutm[0], xx);
-		mbev_grid.boundsutm[1] = MAX(mbev_grid.boundsutm[1], xx);
-		mbev_grid.boundsutm[2] = MIN(mbev_grid.boundsutm[2], yy);
-		mbev_grid.boundsutm[3] = MAX(mbev_grid.boundsutm[3], yy);
-
-		/* get grid spacing */
-		mbev_grid.dx = 0.14 * altitude_max;
-		mbev_grid.dy = 0.14 * altitude_max;
-		if (altitude_max > 0.0)
-			{
-			mbev_grid.dx = 0.02 * altitude_max;
-			mbev_grid.dy = 0.02 * altitude_max;
-			}
-		else if (depth_max > 0.0)
-			{
-			mbev_grid.dx = 0.02 * depth_max;
-			mbev_grid.dy = 0.02 * depth_max;
-			}
-		else
-			{
-			mbev_grid.dx = (mbev_grid.boundsutm[1] - mbev_grid.boundsutm[0]) / 250;
-			mbev_grid.dy = (mbev_grid.boundsutm[1] - mbev_grid.boundsutm[0]) / 250;
-			}
-
-		/* get grid dimensions */
-		mbev_grid.nx = (mbev_grid.boundsutm[1] - mbev_grid.boundsutm[0]) / mbev_grid.dx + 1;
-		mbev_grid.ny = (mbev_grid.boundsutm[3] - mbev_grid.boundsutm[2]) / mbev_grid.dy + 1;
-		mbev_grid.boundsutm[1] = mbev_grid.boundsutm[0] + (mbev_grid.nx - 1) * mbev_grid.dx;
-		mbev_grid.boundsutm[3] = mbev_grid.boundsutm[2] + (mbev_grid.ny - 1) * mbev_grid.dy;
-if (mbev_verbose > 0)
-fprintf(stderr,"Grid bounds: %f %f %f %f    %f %f %f %f\n",
-mbev_grid.bounds[0],mbev_grid.bounds[1],mbev_grid.bounds[2],mbev_grid.bounds[3],
-mbev_grid.boundsutm[0],mbev_grid.boundsutm[1],mbev_grid.boundsutm[2],mbev_grid.boundsutm[3]);
-if (mbev_verbose > 0)
-fprintf(stderr,"cell size:%f %f dimensions: %d %d\n",
-mbev_grid.dx,mbev_grid.dy,mbev_grid.nx,mbev_grid.ny);
-		}
-
-	/* allocate memory for grid */
-	if (mbev_status == MB_SUCCESS)
-		{
-		if ((mbev_grid.sum = (float *) malloc(mbev_grid.nx * mbev_grid.ny * sizeof(float))) == NULL)
-						mbev_error = MB_ERROR_MEMORY_FAIL;
-		if ((mbev_grid.wgt = (float *) malloc(mbev_grid.nx * mbev_grid.ny * sizeof(float))) == NULL)
-						mbev_error = MB_ERROR_MEMORY_FAIL;
-		if ((mbev_grid.val = (float *) malloc(mbev_grid.nx * mbev_grid.ny * sizeof(float))) == NULL)
-						mbev_error = MB_ERROR_MEMORY_FAIL;
-		if ((mbev_grid.sgm = (float *) malloc(mbev_grid.nx * mbev_grid.ny * sizeof(float))) == NULL)
-						mbev_error = MB_ERROR_MEMORY_FAIL;
-		if (mbev_error == MB_ERROR_NO_ERROR)
-			{
-			memset(mbev_grid.sum, 0, mbev_grid.nx * mbev_grid.ny * sizeof(float));
-			memset(mbev_grid.wgt, 0, mbev_grid.nx * mbev_grid.ny * sizeof(float));
-			memset(mbev_grid.val, 0, mbev_grid.nx * mbev_grid.ny * sizeof(float));
-			memset(mbev_grid.sgm, 0, mbev_grid.nx * mbev_grid.ny * sizeof(float));
-			}
-		else
-			mbev_status = MB_FAILURE;
-		}
-
-	/* make grid */
-	if (mbev_status == MB_SUCCESS)
-		{
-		/* loop over loaded files */
-		filecount = 0;
-		for (ifile=0;ifile<mbev_num_files;ifile++)
-			{
-			file = &mbev_files[ifile];
-			if (file->load_status == MB_YES)
-				{
-				filecount++;
-				sprintf(message, "Gridding file %d of %d...", filecount, mbev_num_files_loaded);
-				do_mbeditviz_message_on(message);
-				for (iping=0;iping<file->num_pings;iping++)
-					{
-					ping = &(file->pings[iping]);
-					for (ibeam=0;ibeam<ping->beams_bath;ibeam++)
-						{
-						if (!mb_beam_check_flag_null(ping->beamflag[ibeam]))
-							{
-							mb_proj_forward(mbev_verbose, mbev_grid.pjptr,
-									ping->bathlon[ibeam], ping->bathlat[ibeam],
-									&ping->bathx[ibeam], &ping->bathy[ibeam],
-									&mbev_error);
-							}
-						if (mb_beam_ok(ping->beamflag[ibeam]))
-							{
-							i = (ping->bathx[ibeam] - mbev_grid.boundsutm[0] + 0.5 * mbev_grid.dx)
-								/ mbev_grid.dx;
-							j = (ping->bathy[ibeam] - mbev_grid.boundsutm[2] + 0.5 * mbev_grid.dy)
-								/ mbev_grid.dy;
-							k = i * mbev_grid.ny + j;
-							mbev_grid.sum[k] += (-ping->bathcorr[ibeam]);
-							mbev_grid.wgt[k] += 1.0;
-							mbev_grid.sgm[k] += ping->bathcorr[ibeam] * ping->bathcorr[ibeam];
-							}
-						}
-					}
-				}
-			}
-		mbev_grid.nodatavalue = MBEV_NODATA;
-		first = MB_YES;
-		for (i=0;i<mbev_grid.nx;i++)
-			for (j=0;j<mbev_grid.ny;j++)
-				{
-				k = i * mbev_grid.ny + j;
-				if (mbev_grid.wgt[k] > 0.0)
-					{
-					mbev_grid.val[k] = mbev_grid.sum[k] / mbev_grid.wgt[k];
-					mbev_grid.sgm[k] = sqrt(fabs(mbev_grid.sgm[k] / mbev_grid.wgt[k]
-								- mbev_grid.val[k] * mbev_grid.val[k]));
-					if (first == MB_YES)
-						{
-						mbev_grid.min = mbev_grid.val[k];
-						mbev_grid.max = mbev_grid.val[k];
-						mbev_grid.smin = mbev_grid.sgm[k];
-						mbev_grid.smax = mbev_grid.sgm[k];
-						first = MB_NO;
-						}
-					else
-						{
-						mbev_grid.min = MIN(mbev_grid.min, mbev_grid.val[k]);
-						mbev_grid.max = MAX(mbev_grid.max, mbev_grid.val[k]);
-						mbev_grid.smin = MIN(mbev_grid.smin, mbev_grid.sgm[k]);
-						mbev_grid.smax = MAX(mbev_grid.smax, mbev_grid.sgm[k]);
-						}
-					}
-				else
-					{
-					mbev_grid.val[k] = mbev_grid.nodatavalue;
-					mbev_grid.sgm[k] = mbev_grid.nodatavalue;
-					}
-				}
-		mbev_grid.status = MBEV_GRID_NOTVIEWED;
-		}
-
-	/* print output debug statements */
-	if (mbev_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",mbev_error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       mbev_status: %d\n",mbev_status);
-		}
-
-	/* return */
-	return(mbev_status);
-}
-/*--------------------------------------------------------------------*/
-int mbeditviz_destroy_grid()
-{
-	/* local variables */
-	char	*function_name = "mbeditviz_destroy_grid";
-	struct mbev_file_struct *file;
-	struct mbev_ping_struct *ping;
-	int	action;
-	int	ifile, iping, ibeam;
-	int	i;
-
-	/* print input debug statements */
-	if (mbev_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		}
-
-if (mbev_verbose > 0)
-fprintf(stderr,"mbeditviz_destroy_grid status:%d\n", mbev_status);
-
-	/* loop over all files and output edits as necessary */
-	for (ifile=0;ifile<mbev_num_files;ifile++)
-		{
-		file = &mbev_files[ifile];
-if (mbev_verbose > 0)
-fprintf(stderr,"ifile:%d load_status:%d esf_open:%d\n",
-ifile,file->load_status,file->esf_open);
-		if (file->load_status == MB_YES && file->esf_open == MB_YES)
-			{
-			for (iping=0;iping<file->num_pings;iping++)
-				{
-				ping = &(file->pings[iping]);
-				for (ibeam=0;ibeam<ping->beams_bath;ibeam++)
-					{
-					if (ping->beamflag[ibeam] != ping->beamflagorg[ibeam])
-						{
-						if (mb_beam_ok(ping->beamflag[ibeam]))
-							action = MBP_EDIT_UNFLAG;
-						else if (mb_beam_check_flag_filter2(ping->beamflag[ibeam]))
-							action = MBP_EDIT_FILTER;
-						else if (mb_beam_check_flag_filter(ping->beamflag[ibeam]))
-							action = MBP_EDIT_FILTER;
-						else if (!mb_beam_check_flag_null(ping->beamflag[ibeam]))
-							action = MBP_EDIT_FLAG;
-						else
-							action = MBP_EDIT_ZERO;
-if (mbev_verbose > 0)
-fprintf(stderr,"mb_esf_save: ifile:%d iping:%d ibeam:%d %d action:%d\n",
-ifile,iping,ibeam, ibeam + ping->multiplicity * MB_ESF_MULTIPLICITY_FACTOR, action);
-						mb_esf_save(mbev_verbose, &(file->esf),
-								ping->time_d, ibeam + ping->multiplicity * MB_ESF_MULTIPLICITY_FACTOR,
-								action, &mbev_error);
-						}
-					}
-				}
-
-			/* update the process structure */
-			file->process.mbp_edit_mode = MBP_EDIT_ON;
-			strcpy(file->process.mbp_editfile, file->esf.esffile);
-
-			/* close the esf file */
-			mb_esf_close(mbev_verbose, &(file->esf), &mbev_error);
-			file->esf_open = MB_NO;
-
-			/* update mbprocess parameter file */
-			mb_pr_writepar(mbev_verbose, file->path,
-						&(file->process), &mbev_error);
-			}
-		}
-
-	/* deallocate memory and reset status */
-	if (mbev_grid.status != MBEV_GRID_NONE)
-		{
-		/* deallocate arrays */
-		if (mbev_grid.sum != NULL)
-			free(mbev_grid.sum);
-		if (mbev_grid.wgt != NULL)
-			free(mbev_grid.wgt);
-		if (mbev_grid.val != NULL)
-			free(mbev_grid.val);
-		if (mbev_grid.sgm != NULL)
-			free(mbev_grid.sgm);
-		mbev_grid.sum = NULL;
-		mbev_grid.wgt = NULL;
-		mbev_grid.val = NULL;
-		mbev_grid.sgm = NULL;
-
-		/* release projection */
-		mb_proj_free(mbev_verbose, &(mbev_grid.pjptr), &mbev_error);
-
-		/* reset parameters */
-		memset(mbev_grid.projection_id, 0, MB_PATH_MAXLINE);
-		for (i=0;i<4;i++)
-			{
-			mbev_grid.bounds[i] = 0.0;
-			mbev_grid.boundsutm[i] = 0.0;
-			}
-		mbev_grid.dx = 0.0;
-		mbev_grid.dy = 0.0;
-		mbev_grid.nx = 0;
-		mbev_grid.ny = 0;
-
-		/* reset status */
-		mbev_grid.status = MBEV_GRID_NONE;
-		}
-
-	/* print output debug statements */
-	if (mbev_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",mbev_error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       mbev_status: %d\n",mbev_status);
-		}
-
-	/* return */
-	return(mbev_status);
-}
-/*--------------------------------------------------------------------*/
-int mbeditviz_selectregion(size_t instance)
-{
-	char	*function_name = "mbeditviz_selectregion";
-	struct mbev_file_struct *file;
-	struct mbev_ping_struct *ping;
-	struct mbview_struct *mbviewdata;
-	struct mbview_region_struct *region;
-	double	xmin, xmax, ymin, ymax, zmin, zmax;
-	double	dx, dy, dz;
-	double	x, y;
-	double	xx, yy;
-	double	heading, sonardepth;
-	double	rolldelta, pitchdelta;
-	double	headingx, headingy;
-	double	mtodeglon, mtodeglat;
-	int	i, ifile, iping, ibeam;
-
-	/* print input debug statements */
-	if (mbev_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  Function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       instance:     %zu\n",instance);
-		}
-
-    	/* check data source for selected area */
-	mbev_status = mbview_getdataptr(mbev_verbose, instance, &mbviewdata, &mbev_error);
-
-	/* check if area is currently defined */
-	if (mbev_status == MB_SUCCESS && mbviewdata->region_type == MBV_REGION_QUAD)
-		{
-		/* get area */
-		region = (struct mbview_region_struct *) &mbviewdata->region;
-
-		/* get region bounds */
-if (mbev_verbose > 0)
-fprintf(stderr,"mbeditviz_selectregion: rollbias:%f pitchbias:%f headingbias:%f timelag:%f\n",
-mbev_rollbias_3dsdg, mbev_pitchbias_3dsdg, mbev_headingbias_3dsdg, mbev_timelag_3dsdg);
-if (mbev_verbose > 0)
-fprintf(stderr,"REGION: %f %f   %f %f   %f %f   %f %f\n",
-region->cornerpoints[0].xgrid,region->cornerpoints[0].ygrid,
-region->cornerpoints[1].xgrid,region->cornerpoints[2].ygrid,
-region->cornerpoints[2].xgrid,region->cornerpoints[2].ygrid,
-region->cornerpoints[3].xgrid,region->cornerpoints[3].ygrid);
-		xmin = region->cornerpoints[0].xgrid;
-		xmax = region->cornerpoints[0].xgrid;
-		ymin = region->cornerpoints[0].ygrid;
-		ymax = region->cornerpoints[0].ygrid;
-		zmin = region->cornerpoints[0].zdata;
-		zmax = region->cornerpoints[0].zdata;
-		for (i=1;i<4;i++)
-			{
-			xmin = MIN(xmin, region->cornerpoints[i].xgrid);
-			xmax = MAX(xmax, region->cornerpoints[i].xgrid);
-			ymin = MIN(ymin, region->cornerpoints[i].ygrid);
-			ymax = MAX(ymax, region->cornerpoints[i].ygrid);
-			zmin = MIN(zmin, region->cornerpoints[i].zdata);
-			zmax = MAX(zmax, region->cornerpoints[i].zdata);
-			}
-
-		/* get sounding bounds */
-		mbev_selected.xorigin = 0.5 * (xmin + xmax);
-		mbev_selected.yorigin = 0.5 * (ymin + ymax);
-		mbev_selected.zorigin = 0.5 * (zmin + zmax);
-		dx = xmax - xmin;
-		dy = ymax - ymin;
-		mbev_selected.xmin = -0.5 * dx;
-		mbev_selected.ymin = -0.5 * dy;
-		mbev_selected.xmax = 0.5 * dx;
-		mbev_selected.ymax = 0.5 * dy;
-		mbev_selected.bearing = 90.0;
-		mbev_selected.sinbearing = sin(DTR * mbev_selected.bearing);
-		mbev_selected.cosbearing = cos(DTR * mbev_selected.bearing);
-		mbev_selected.scale = 2.0 / sqrt((xmax - xmin) * (xmax - xmin) + (ymax - ymin) * (ymax - ymin));
-		mbev_selected.num_soundings = 0;
-		mbev_selected.num_soundings_unflagged = 0;
-		mbev_selected.num_soundings_flagged = 0;
-
-		/* loop over all files */
-		for (ifile=0;ifile<mbev_num_files;ifile++)
-			{
-			file = &mbev_files[ifile];
-			if (file->load_status == MB_YES)
-				{
-				for (iping=0;iping<file->num_pings;iping++)
-					{
-					ping = &(file->pings[iping]);
-					mbeditviz_apply_timelag(file, ping,
-								mbev_rollbias_3dsdg, mbev_pitchbias_3dsdg, mbev_headingbias_3dsdg, mbev_timelag_3dsdg,
-								&heading, &sonardepth,
-								&rolldelta, &pitchdelta);
-					mb_coor_scale(mbev_verbose,ping->navlat,&mtodeglon,&mtodeglat);
-					headingx = sin(heading * DTR);
-					headingy = cos(heading * DTR);
-					for (ibeam=0;ibeam<ping->beams_bath;ibeam++)
-						{
-						if (!mb_beam_check_flag_null(ping->beamflag[ibeam]))
-							{
-							if (ping->bathx[ibeam] >= xmin
-								&& ping->bathx[ibeam] <= xmax
-								&& ping->bathy[ibeam] >= ymin
-								&& ping->bathy[ibeam] <= ymax)
-								{
-								/* allocate memory if needed */
-								if (mbev_selected.num_soundings
-									>= mbev_selected.num_soundings_alloc)
-									{
-									mbev_selected.num_soundings_alloc += MBEV_ALLOCK_NUM;
-									mbev_selected.soundings = realloc(mbev_selected.soundings, mbev_selected.num_soundings_alloc
-													* sizeof(struct mb3dsoundings_sounding_struct));
-									}
-
-								/* same beam ids */
-								mbev_selected.soundings[mbev_selected.num_soundings].ifile = ifile;
-								mbev_selected.soundings[mbev_selected.num_soundings].iping = iping;
-								mbev_selected.soundings[mbev_selected.num_soundings].ibeam = ibeam;
-								mbev_selected.soundings[mbev_selected.num_soundings].beamflag = ping->beamflag[ibeam];
-								mbev_selected.soundings[mbev_selected.num_soundings].beamflagorg = ping->beamflagorg[ibeam];
-								mbev_selected.soundings[mbev_selected.num_soundings].beamcolor = ping->beamcolor[ibeam];
-
-								/* apply rotations and recalculate position */
-								mbeditviz_beam_position(ping->navlon, ping->navlat, headingx, headingy,
-										mtodeglon, mtodeglat,
-										ping->bath[ibeam], ping->bathacrosstrack[ibeam], ping->bathalongtrack[ibeam],
-										sonardepth,
-										rolldelta, pitchdelta,
-										&(ping->bathcorr[ibeam]), &(ping->bathlon[ibeam]), &(ping->bathlat[ibeam]));
-								mb_proj_forward(mbev_verbose, mbev_grid.pjptr,
-									ping->bathlon[ibeam], ping->bathlat[ibeam],
-									&ping->bathx[ibeam], &ping->bathy[ibeam],
-									&mbev_error);
-
-								/* get local position in selected region */
-								x = ping->bathx[ibeam] - mbev_selected.xorigin;
-								y = ping->bathy[ibeam] - mbev_selected.yorigin;
-								xx = x * mbev_selected.sinbearing + y * mbev_selected.cosbearing;
-								yy = -x * mbev_selected.cosbearing + y * mbev_selected.sinbearing;
-								mbev_selected.soundings[mbev_selected.num_soundings].x = xx;
-								mbev_selected.soundings[mbev_selected.num_soundings].y = yy;
-									/*mbev_selected.soundings[mbev_selected.num_soundings].x
-										= xx * mbev_selected.cosbearing - yy * mbev_selected.sinbearing;
-									mbev_selected.soundings[mbev_selected.num_soundings].y
-										= xx * mbev_selected.sinbearing + yy * mbev_selected.cosbearing;*/
-								mbev_selected.soundings[mbev_selected.num_soundings].z
-									= -ping->bathcorr[ibeam];
-								if (mbev_selected.num_soundings == 0)
-									{
-									zmin = -ping->bathcorr[ibeam];
-									zmax = -ping->bathcorr[ibeam];
-									}
-								else
-									{
-									zmin = MIN(zmin, -ping->bathcorr[ibeam]);
-									zmax = MAX(zmax, -ping->bathcorr[ibeam]);
-									}
-/*fprintf(stderr,"SELECTED SOUNDING: %d %d %d  %f %f  |  %d %f %f %f\n",
-ifile,iping,ibeam,ping->bathx[ibeam],ping->bathy[ibeam],
-mbev_selected.num_soundings,
-mbev_selected.soundings[mbev_selected.num_soundings].x,
-mbev_selected.soundings[mbev_selected.num_soundings].y,
-mbev_selected.soundings[mbev_selected.num_soundings].z);*/
-								/* keep the counts right */
-								mbev_selected.num_soundings++;
-								if (mb_beam_ok(ping->beamflag[ibeam]))
-									mbev_selected.num_soundings_unflagged++;
-								else
-									mbev_selected.num_soundings_flagged++;
-								}
-							}
-						}
-					}
-				}
-			}
-
-		/* get zscaling */
-		mbev_selected.zscale = mbev_selected.scale;
-		dz = zmax - zmin;
-		mbev_selected.zorigin = 0.5 * (zmin + zmax);
-		mbev_selected.zmin = -0.5 * dz;
-		mbev_selected.zmax = 0.5 * dz;
-		for (i=0;i<mbev_selected.num_soundings;i++)
-			mbev_selected.soundings[i].z = mbev_selected.soundings[i].z - mbev_selected.zorigin;
-if (mbev_verbose > 0)
-fprintf(stderr,"mbeditviz_selectregion: num_soundings:%d\n",
-mbev_selected.num_soundings);
-		}
-
-	/* print output debug statements */
-	if (mbev_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",mbev_error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       mbev_status:%d\n",mbev_status);
-		}
-
-	/* return status */
-	return(mbev_status);
-}
-/*--------------------------------------------------------------------*/
-int mbeditviz_selectarea(size_t instance)
-{
-	char	*function_name = "mbeditviz_selectarea";
-	struct mbev_file_struct *file;
-	struct mbev_ping_struct *ping;
-	struct mbview_struct *mbviewdata;
-	struct mbview_area_struct *area;
-	int	ifile, iping, ibeam;
-	double	x, y, xx, yy;
-	double	zmin, zmax, dz;
-	double	heading, sonardepth;
-	double	rolldelta, pitchdelta;
-	double	headingx, headingy;
-	double	mtodeglon, mtodeglat;
-	int	i;
-
-	/* print input debug statements */
-	if (mbev_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  Function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       instance:     %zu\n",instance);
-		}
-
-    	/* check data source for selected area */
-	mbev_status = mbview_getdataptr(mbev_verbose, instance, &mbviewdata, &mbev_error);
-
-	/* check if area is currently defined */
-	if (mbev_status == MB_SUCCESS && mbviewdata->area_type == MBV_AREA_QUAD)
-		{
-		/* get area */
-		area = (struct mbview_area_struct *) &mbviewdata->area;
-if (mbev_verbose > 0)
-fprintf(stderr,"mbeditviz_selectarea: rollbias:%f pitchbias:%f headingbias:%f timelag:%f\n",
-mbev_rollbias_3dsdg, mbev_pitchbias_3dsdg, mbev_headingbias_3dsdg, mbev_timelag_3dsdg);
-if (mbev_verbose > 0)
-fprintf(stderr,"AREA: %f %f   %f %f   %f %f   %f %f\n",
-area->cornerpoints[0].xgrid,area->cornerpoints[0].ygrid,
-area->cornerpoints[1].xgrid,area->cornerpoints[2].ygrid,
-area->cornerpoints[2].xgrid,area->cornerpoints[2].ygrid,
-area->cornerpoints[3].xgrid,area->cornerpoints[3].ygrid);
-
-		/* get sounding bounds */
-		mbev_selected.xorigin = 0.5 * (area->endpoints[0].xgrid + area->endpoints[1].xgrid);
-		mbev_selected.yorigin = 0.5 * (area->endpoints[0].ygrid + area->endpoints[1].ygrid);;
-		mbev_selected.zorigin = 0.5 * (area->endpoints[0].zdata + area->endpoints[1].zdata);;
-		mbev_selected.xmin = -0.5 * area->length;
-		mbev_selected.ymin = -0.5 * area->width;
-		mbev_selected.xmax = 0.5 * area->length;
-		mbev_selected.ymax = 0.5 * area->width;
-		mbev_selected.bearing = area->bearing;
-		mbev_selected.sinbearing = sin(DTR * mbev_selected.bearing);
-		mbev_selected.cosbearing = cos(DTR * mbev_selected.bearing);
-		mbev_selected.scale = 2.0 / sqrt(area->length * area->length + area->width * area->width);
-		mbev_selected.num_soundings = 0;
-		mbev_selected.num_soundings_unflagged = 0;
-		mbev_selected.num_soundings_flagged = 0;
-
-		/* loop over all files */
-		for (ifile=0;ifile<mbev_num_files;ifile++)
-			{
-			file = &mbev_files[ifile];
-			if (file->load_status == MB_YES)
-				{
-				for (iping=0;iping<file->num_pings;iping++)
-					{
-					ping = &(file->pings[iping]);
-					mbeditviz_apply_timelag(file, ping,
-								mbev_rollbias_3dsdg, mbev_pitchbias_3dsdg, mbev_headingbias_3dsdg, mbev_timelag_3dsdg,
-								&heading, &sonardepth,
-								&rolldelta, &pitchdelta);
-					mb_coor_scale(mbev_verbose,ping->navlat,&mtodeglon,&mtodeglat);
-					headingx = sin(heading * DTR);
-					headingy = cos(heading * DTR);
-					for (ibeam=0;ibeam<ping->beams_bath;ibeam++)
-						{
-						if (!mb_beam_check_flag_null(ping->beamflag[ibeam]))
-							{
-							x = ping->bathx[ibeam] - mbev_selected.xorigin;
-							y = ping->bathy[ibeam] - mbev_selected.yorigin;
-							yy = -x * mbev_selected.cosbearing + y * mbev_selected.sinbearing;
-							xx = x * mbev_selected.sinbearing + y * mbev_selected.cosbearing;
-							if (xx >= mbev_selected.xmin
-								&& xx <= mbev_selected.xmax
-								&& yy >= mbev_selected.ymin
-								&& yy <= mbev_selected.ymax)
-								{
-								/* allocate memory if needed */
-								if (mbev_selected.num_soundings
-									>= mbev_selected.num_soundings_alloc)
-									{
-									mbev_selected.num_soundings_alloc += MBEV_ALLOCK_NUM;
-									mbev_selected.soundings = realloc(mbev_selected.soundings, mbev_selected.num_soundings_alloc
-													* sizeof(struct mb3dsoundings_sounding_struct));
-									}
-
-								/* same beam ids */
-								mbev_selected.soundings[mbev_selected.num_soundings].ifile = ifile;
-								mbev_selected.soundings[mbev_selected.num_soundings].iping = iping;
-								mbev_selected.soundings[mbev_selected.num_soundings].ibeam = ibeam;
-								mbev_selected.soundings[mbev_selected.num_soundings].beamflag = ping->beamflag[ibeam];
-								mbev_selected.soundings[mbev_selected.num_soundings].beamflagorg = ping->beamflagorg[ibeam];
-								mbev_selected.soundings[mbev_selected.num_soundings].beamcolor = ping->beamcolor[ibeam];
-
-								/* apply rotations and recalculate position */
-								mbeditviz_beam_position(ping->navlon, ping->navlat, headingx, headingy,
-										mtodeglon, mtodeglat,
-										ping->bath[ibeam], ping->bathacrosstrack[ibeam], ping->bathalongtrack[ibeam],
-										sonardepth,
-										rolldelta, pitchdelta,
-										&(ping->bathcorr[ibeam]), &(ping->bathlon[ibeam]), &(ping->bathlat[ibeam]));
-								mb_proj_forward(mbev_verbose, mbev_grid.pjptr,
-									ping->bathlon[ibeam], ping->bathlat[ibeam],
-									&ping->bathx[ibeam], &ping->bathy[ibeam],
-									&mbev_error);
-								x = ping->bathx[ibeam] - mbev_selected.xorigin;
-								y = ping->bathy[ibeam] - mbev_selected.yorigin;
-								yy = -x * mbev_selected.cosbearing + y * mbev_selected.sinbearing;
-								xx = x * mbev_selected.sinbearing + y * mbev_selected.cosbearing;
-
-								/* get local position in selected region */
-								mbev_selected.soundings[mbev_selected.num_soundings].x = xx;
-								mbev_selected.soundings[mbev_selected.num_soundings].y = yy;
-								mbev_selected.soundings[mbev_selected.num_soundings].z
-									= -ping->bathcorr[ibeam];
-								if (mbev_selected.num_soundings == 0)
-									{
-									zmin = -ping->bathcorr[ibeam];
-									zmax = -ping->bathcorr[ibeam];
-									}
-								else
-									{
-									zmin = MIN(zmin, -ping->bathcorr[ibeam]);
-									zmax = MAX(zmax, -ping->bathcorr[ibeam]);
-									}
-/*fprintf(stderr,"SELECTED SOUNDING: %d %d %d  %f %f  |  %d %f %f %f\n",
-ifile,iping,ibeam,ping->bathx[ibeam],ping->bathy[ibeam],
-mbev_selected.num_soundings,
-mbev_selected.soundings[mbev_selected.num_soundings].x,
-mbev_selected.soundings[mbev_selected.num_soundings].y,
-mbev_selected.soundings[mbev_selected.num_soundings].z);*/
-								mbev_selected.num_soundings++;
-								if (mb_beam_ok(ping->beamflag[ibeam]))
-									mbev_selected.num_soundings_unflagged++;
-								else
-									mbev_selected.num_soundings_flagged++;
-								}
-							}
-						}
-					}
-				}
-			}
-
-		/* get zscaling */
-		mbev_selected.zscale = mbev_selected.scale;
-		dz = zmax - zmin;
-		mbev_selected.zorigin = 0.5 * (zmin + zmax);
-		mbev_selected.zmin = -0.5 * dz;
-		mbev_selected.zmax = 0.5 * dz;
-		for (i=0;i<mbev_selected.num_soundings;i++)
-			mbev_selected.soundings[i].z = mbev_selected.soundings[i].z - mbev_selected.zorigin;
-if (mbev_verbose > 0)
-fprintf(stderr,"mbeditviz_selectarea: num_soundings:%d\n",
-mbev_selected.num_soundings);
-		}
-
-	/* print output debug statements */
-	if (mbev_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",mbev_error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       mbev_status:%d\n",mbev_status);
-		}
-
-	/* return status */
-	return(mbev_status);
-}
-/*--------------------------------------------------------------------*/
-int mbeditviz_selectnav(size_t instance)
-{
-	char	*function_name = "mbeditviz_selectnav";
-	struct mbev_file_struct *file;
-	struct mbev_ping_struct *ping;
-	struct mbview_shareddata_struct *mbviewshared;
-	struct mbview_navpointw_struct *navpts;
-	int	inavcount;
-	int	ifile, iping, ibeam;
-	double	dx, dy, dz;
-	double	xmin, xmax, ymin, ymax, zmin, zmax;
-	double	heading, sonardepth;
-	double	rolldelta, pitchdelta;
-	double	headingx, headingy;
-	double	mtodeglon, mtodeglat;
-	int	i;
-
-	/* print input debug statements */
-	if (mbev_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  Function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       instance:     %zu\n",instance);
-		}
-if (mbev_verbose > 0)
-fprintf(stderr,"mbeditviz_selectnav: \n");
-
-    	/* check shared data source for selected nav */
-	mbev_status = mbview_getsharedptr(mbev_verbose, &mbviewshared, &mbev_error);
-
-	/* check if any nav is currently selected */
-	if (mbev_status == MB_SUCCESS)
-		{
-		/* reset sounding count */
-		mbev_selected.num_soundings = 0;
-		mbev_selected.num_soundings_unflagged = 0;
-		mbev_selected.num_soundings_flagged = 0;
-
-		/* get sounding bearing */
-		mbev_selected.bearing = 90.0;
-		mbev_selected.sinbearing = sin(DTR * mbev_selected.bearing);
-		mbev_selected.cosbearing = cos(DTR * mbev_selected.bearing);
-
-		/* loop over all files to get bounds */
-		inavcount = 0;
-		for (ifile=0;ifile<mbev_num_files;ifile++)
-			{
-			file = &mbev_files[ifile];
-			if (file->load_status == MB_YES)
-				{
-				navpts = (struct mbview_navpointw_struct *) mbviewshared->navs[inavcount].navpts;
-				for (iping=0;iping<file->num_pings;iping++)
-					{
-					if (navpts[iping].selected == MB_YES)
-						{
-						ping = &(file->pings[iping]);
-						mbeditviz_apply_timelag(file, ping,
-								  	mbev_rollbias_3dsdg, mbev_pitchbias_3dsdg, mbev_headingbias_3dsdg, mbev_timelag_3dsdg,
-								  	&heading, &sonardepth,
-								  	&rolldelta, &pitchdelta);
-						mb_coor_scale(mbev_verbose,ping->navlat,&mtodeglon,&mtodeglat);
-						headingx = sin(heading * DTR);
-						headingy = cos(heading * DTR);
-						for (ibeam=0;ibeam<ping->beams_bath;ibeam++)
-							{
-							if (!mb_beam_check_flag_null(ping->beamflag[ibeam]))
-								{
-								/* allocate memory if needed */
-								if (mbev_selected.num_soundings
-									>= mbev_selected.num_soundings_alloc)
-									{
-									mbev_selected.num_soundings_alloc += MBEV_ALLOCK_NUM;
-									mbev_selected.soundings = realloc(mbev_selected.soundings, mbev_selected.num_soundings_alloc
-													* sizeof(struct mb3dsoundings_sounding_struct));
-									}
-
-								/* same beam ids */
-								mbev_selected.soundings[mbev_selected.num_soundings].ifile = ifile;
-								mbev_selected.soundings[mbev_selected.num_soundings].iping = iping;
-								mbev_selected.soundings[mbev_selected.num_soundings].ibeam = ibeam;
-								mbev_selected.soundings[mbev_selected.num_soundings].beamflag = ping->beamflag[ibeam];
-								mbev_selected.soundings[mbev_selected.num_soundings].beamflagorg = ping->beamflagorg[ibeam];
-								mbev_selected.soundings[mbev_selected.num_soundings].beamcolor = ping->beamcolor[ibeam];
-
-								/* apply rotations and recalculate position */
-								mbeditviz_beam_position(ping->navlon, ping->navlat, headingx, headingy,
-										mtodeglon, mtodeglat,
-										ping->bath[ibeam], ping->bathacrosstrack[ibeam], ping->bathalongtrack[ibeam],
-										sonardepth,
-										rolldelta, pitchdelta,
-										&(ping->bathcorr[ibeam]), &(ping->bathlon[ibeam]), &(ping->bathlat[ibeam]));
-								mb_proj_forward(mbev_verbose, mbev_grid.pjptr,
-									ping->bathlon[ibeam], ping->bathlat[ibeam],
-									&ping->bathx[ibeam], &ping->bathy[ibeam],
-									&mbev_error);
-
-								/* get local position in selected region */
-								mbev_selected.soundings[mbev_selected.num_soundings].x = ping->bathx[ibeam];
-								mbev_selected.soundings[mbev_selected.num_soundings].y = ping->bathy[ibeam];
-								mbev_selected.soundings[mbev_selected.num_soundings].z = -ping->bathcorr[ibeam];
-								if (mbev_selected.num_soundings == 0)
-									{
-									xmin = ping->bathx[ibeam];
-									xmax = ping->bathx[ibeam];
-									ymin = ping->bathy[ibeam];
-									ymax = ping->bathy[ibeam];
-									zmin = -ping->bathcorr[ibeam];
-									zmax = -ping->bathcorr[ibeam];
-									}
-								else
-									{
-									xmin = MIN(xmin, ping->bathx[ibeam]);
-									xmax = MAX(xmax, ping->bathx[ibeam]);
-									ymin = MIN(ymin, ping->bathy[ibeam]);
-									ymax = MAX(ymax, ping->bathy[ibeam]);
-									zmin = MIN(zmin, -ping->bathcorr[ibeam]);
-									zmax = MAX(zmax, -ping->bathcorr[ibeam]);
-									}
-/*fprintf(stderr,"SELECTED SOUNDING: %d %d %d  %f %f  |  %d %f %f %f\n",
-ifile,iping,ibeam,ping->bathx[ibeam],ping->bathy[ibeam],
-mbev_selected.num_soundings,
-mbev_selected.soundings[mbev_selected.num_soundings].x,
-mbev_selected.soundings[mbev_selected.num_soundings].y,
-mbev_selected.soundings[mbev_selected.num_soundings].z);*/
-								mbev_selected.num_soundings++;
-								if (mb_beam_ok(ping->beamflag[ibeam]))
-									mbev_selected.num_soundings_unflagged++;
-								else
-									mbev_selected.num_soundings_flagged++;
-								}
-							}
-						}
-					}
-
-				inavcount++;
-				}
-			}
-
-		/* get origin and scaling */
-		dz = zmax - zmin;
-		dx = xmax - xmin;
-		dy = ymax - ymin;
-		mbev_selected.xorigin = 0.5 * (xmin + xmax);
-		mbev_selected.yorigin = 0.5 * (ymin + ymax);;
-		mbev_selected.zorigin = 0.5 * (zmin + zmax);;
-		mbev_selected.scale = 2.0 / sqrt(dy * dy + dx * dx);
-		mbev_selected.zscale = mbev_selected.scale;
-		mbev_selected.xmin = -0.5 * dx;
-		mbev_selected.xmax = 0.5 * dx;
-		mbev_selected.ymin = -0.5 * dy;
-		mbev_selected.ymax = 0.5 * dy;
-		mbev_selected.zmin = -0.5 * dz;
-		mbev_selected.zmax = 0.5 * dz;
-		for (i=0;i<mbev_selected.num_soundings;i++)
-			{
-			mbev_selected.soundings[i].x = mbev_selected.soundings[i].x - mbev_selected.xorigin;
-			mbev_selected.soundings[i].y = mbev_selected.soundings[i].y - mbev_selected.yorigin;
-			mbev_selected.soundings[i].z = mbev_selected.soundings[i].z - mbev_selected.zorigin;
-			}
-if (mbev_verbose > 0)
-fprintf(stderr,"mbeditviz_selectarea: num_soundings:%d\n",
-mbev_selected.num_soundings);
-		}
-
-	/* print output debug statements */
-	if (mbev_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",mbev_error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       mbev_status:%d\n",mbev_status);
-		}
-
-	/* return status */
-	return(mbev_status);
-}
-/*--------------------------------------------------------------------*/
-void mbeditviz_mb3dsoundings_dismiss()
-{
-	char	*function_name = "mbeditviz_mb3dsoundings_dismiss";
-if (mbev_verbose > 0)
-fprintf(stderr,"mbeditviz_mb3dsoundings_dismiss\n");
-
-	/* print input debug statements */
-	if (mbev_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  Function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		}
-
-	/* release the memory of the soundings */
-	if (mbev_selected.num_soundings_alloc > 0)
-		{
-		if (mbev_selected.soundings != NULL)
-			{
-			free(mbev_selected.soundings);
-			mbev_selected.soundings = NULL;
-			}
-		mbev_selected.xorigin = 0.0;
-		mbev_selected.yorigin = 0.0;
-		mbev_selected.zorigin = 0.0;
-		mbev_selected.bearing = 0.0;
-		mbev_selected.xmin = 0.0;
-		mbev_selected.ymin = 0.0;
-		mbev_selected.zmin = 0.0;
-		mbev_selected.xmax = 0.0;
-		mbev_selected.ymax = 0.0;
-		mbev_selected.zmax = 0.0;
-		mbev_selected.sinbearing = 0.0;
-		mbev_selected.cosbearing = 0.0;
-		mbev_selected.scale = 0.0;
-		mbev_selected.zscale = 0.0;
-		mbev_selected.num_soundings = 0;
-		mbev_selected.num_soundings_unflagged = 0;
-		mbev_selected.num_soundings_flagged = 0;
-		mbev_selected.num_soundings_alloc = 0;
-		}
-
-	/* print output debug statements */
-	if (mbev_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",mbev_error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       mbev_status:%d\n",mbev_status);
-		}
-}
-/*--------------------------------------------------------------------*/
-void mbeditviz_mb3dsoundings_edit(int ifile, int iping, int ibeam, char beamflag, int flush)
-{
-	char	*function_name = "mbeditviz_mb3dsoundings_edit";
-	struct mbev_file_struct *file;
-	struct mbev_ping_struct *ping;
-	int	action;
-/* fprintf(stderr,"mbeditviz_mb3dsoundings_edit:%d %d %d beamflag:%d flush:%d\n",
-ifile, iping, ibeam, beamflag, flush); */
-
-	/* print input debug statements */
-	if (mbev_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  Function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       ifile:       %d\n",ifile);
-		fprintf(stderr,"dbg2       iping:       %d\n",iping);
-		fprintf(stderr,"dbg2       ibeam:       %d\n",ibeam);
-		fprintf(stderr,"dbg2       beamflag:    %d\n",beamflag);
-		fprintf(stderr,"dbg2       flush:       %d\n",flush);
-		}
-
-	/* apply current edit event */
-	if (flush != MB3DSDG_EDIT_FLUSHPREVIOUS)
-		{
-		file = &mbev_files[ifile];
-		ping = &(file->pings[iping]);
-
-		/* check for real flag state change */
-		if (mb_beam_ok(ping->beamflag[ibeam]) != mb_beam_ok(beamflag))
-			{
-			/* apply change to grid */
-			mbeditviz_grid_beam(file, ping, ibeam, mb_beam_ok(beamflag), MB_YES);
-			}
-
-		/* output edits if desired */
-		if (mbev_mode_output == MBEV_OUTPUT_MODE_EDIT)
-			{
-			/* open esf and ess files if not already open */
-			if (file->esf_open == MB_NO)
-				{
-				mbev_status = mb_esf_load(mbev_verbose, file->path, MB_NO, MBP_ESF_APPEND,
-								file->esffile, &(file->esf), &mbev_error);
-				if (mbev_status == MB_SUCCESS)
-					{
-					file->esf_open = MB_YES;
-					}
-				else
-					{
-					file->esf_open = MB_NO;
-					mbev_status = MB_SUCCESS;
-					mbev_error = MB_ERROR_NO_ERROR;
-					}
-				}
-
-			/* save the edits to the esf stream */
-			if (file->esf_open == MB_YES)
-				{
-				if (mb_beam_ok(beamflag))
-					action = MBP_EDIT_UNFLAG;
-				else if (mb_beam_check_flag_filter2(beamflag))
-					action = MBP_EDIT_FILTER;
-				else if (mb_beam_check_flag_filter(beamflag))
-					action = MBP_EDIT_FILTER;
-				else if (!mb_beam_check_flag_null(beamflag))
-					action = MBP_EDIT_FLAG;
-				else
-					action = MBP_EDIT_ZERO;
-				mb_ess_save(mbev_verbose, &(file->esf),
-						ping->time_d, ibeam + ping->multiplicity * MB_ESF_MULTIPLICITY_FACTOR,
-						action, &mbev_error);
-				}
-			}
-
-		/* save new beamflag */
-		ping->beamflag[ibeam] = beamflag;
-		}
-
-	/* redisplay grid if flush specified */
-	if (flush !=  MB3DSDG_EDIT_NOFLUSH)
-		{
-		mbview_plothigh(0);
-		}
-
-	/* print output debug statements */
-	if (mbev_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",mbev_error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       mbev_status:%d\n",mbev_status);
-		}
-}
-/*--------------------------------------------------------------------*/
-void mbeditviz_mb3dsoundings_info(int ifile, int iping, int ibeam, char *infostring)
-{
-	char	*function_name = "mbeditviz_mb3dsoundings_info";
-	struct mbev_file_struct *file;
-	struct mbev_ping_struct *ping;
-if (mbev_verbose > 0)
-fprintf(stderr,"mbeditviz_mb3dsoundings_info:%d %d %d\n",
-ifile, iping, ibeam);
-
-	/* print input debug statements */
-	if (mbev_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  Function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       ifile:       %d\n",ifile);
-		fprintf(stderr,"dbg2       iping:       %d\n",iping);
-		fprintf(stderr,"dbg2       ibeam:       %d\n",ibeam);
-		}
-
-	/* generate info string */
-	file = &mbev_files[ifile];
-	ping = &(file->pings[iping]);
-	sprintf(infostring,"Beam %d of %d   Ping %d of %d   File:%s\nPing Time: %4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d %f\nLon:%.6f Lat:%.6f Depth:%.3f X:%.3f L:%.3f",
-		ibeam,ping->beams_bath,iping,file->num_pings,file->name,ping->time_i[0],ping->time_i[1],ping->time_i[2],
-		ping->time_i[3],ping->time_i[4],ping->time_i[5],ping->time_i[6],ping->time_d,
-		ping->bathlon[ibeam],ping->bathlat[ibeam],ping->bath[ibeam],ping->bathacrosstrack[ibeam],ping->bathalongtrack[ibeam]);
-
-	/* print output debug statements */
-	if (mbev_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",mbev_error);
-		fprintf(stderr,"dbg2       infostring: %s\n",infostring);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       mbev_status:%d\n",mbev_status);
-		}
-}
-/*--------------------------------------------------------------------*/
-void mbeditviz_mb3dsoundings_bias(double rollbias, double pitchbias, double headingbias, double timelag)
-{
-	char	*function_name = "mbeditviz_mb3dsoundings_bias";
-	struct mbev_file_struct *file;
-	struct mbev_ping_struct *ping;
-	int	ifile, iping, ibeam;
-	double	x, y, xx, yy;
-	double	zmin, zmax, dz;
-	double	heading, sonardepth;
-	double	rolldelta, pitchdelta;
-	double	headingx, headingy;
-	double	mtodeglon, mtodeglat;
-	int	ifilelast, ipinglast;
-	int	i;
-
-if (mbev_verbose > 0)
-fprintf(stderr,"mbeditviz_mb3dsoundings_bias:%f %f %f %f\n",
-rollbias, pitchbias, headingbias, timelag);
-
-	/* print input debug statements */
-	if (mbev_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  Function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       rollbias:    %f\n",rollbias);
-		fprintf(stderr,"dbg2       pitchbias:   %f\n",pitchbias);
-		fprintf(stderr,"dbg2       headingbias: %f\n",headingbias);
-		fprintf(stderr,"dbg2       timelag:     %f\n",timelag);
-		}
-
-	/* copy bias parameters */
-	mbev_rollbias_3dsdg = rollbias;
-	mbev_pitchbias_3dsdg = pitchbias;
-	mbev_headingbias_3dsdg = headingbias;
-	mbev_timelag_3dsdg = timelag;
-	ifilelast = -1;
-	ipinglast = -1;
-
-	/* apply bias parameters */
-	for (i=0;i<mbev_selected.num_soundings;i++)
-		{
-		ifile = mbev_selected.soundings[i].ifile;
-		iping = mbev_selected.soundings[i].iping;
-		ibeam = mbev_selected.soundings[i].ibeam;
-		file = &mbev_files[ifile];
-		ping = &(file->pings[iping]);
-
-		if (ifile != ifilelast || iping != ipinglast)
-			{
-			mbeditviz_apply_timelag(file, ping,
-					mbev_rollbias_3dsdg, mbev_pitchbias_3dsdg, mbev_headingbias_3dsdg, mbev_timelag_3dsdg,
-					&heading, &sonardepth,
-					&rolldelta, &pitchdelta);
-			mb_coor_scale(mbev_verbose,ping->navlat,&mtodeglon,&mtodeglat);
-			headingx = sin(heading * DTR);
-			headingy = cos(heading * DTR);
-			ifilelast = ifile;
-			ipinglast = iping;
-			}
-
-		/* apply rotations and recalculate position */
-		mbeditviz_beam_position(ping->navlon, ping->navlat, headingx, headingy,
-				mtodeglon, mtodeglat,
-				ping->bath[ibeam], ping->bathacrosstrack[ibeam], ping->bathalongtrack[ibeam],
-				sonardepth,
-				rolldelta, pitchdelta,
-				&(ping->bathcorr[ibeam]), &(ping->bathlon[ibeam]), &(ping->bathlat[ibeam]));
-		mb_proj_forward(mbev_verbose, mbev_grid.pjptr,
-			ping->bathlon[ibeam], ping->bathlat[ibeam],
-			&ping->bathx[ibeam], &ping->bathy[ibeam],
-			&mbev_error);
-		x = ping->bathx[ibeam] - mbev_selected.xorigin;
-		y = ping->bathy[ibeam] - mbev_selected.yorigin;
-		xx = x * mbev_selected.sinbearing + y * mbev_selected.cosbearing;
-		yy = -x * mbev_selected.cosbearing + y * mbev_selected.sinbearing;
-
-		/* get local position in selected region */
-		mbev_selected.soundings[i].x = xx;
-		mbev_selected.soundings[i].y = yy;
-		mbev_selected.soundings[i].z = -ping->bathcorr[ibeam];
-		if (i == 0)
-			{
-			zmin = -ping->bathcorr[ibeam];
-			zmax = -ping->bathcorr[ibeam];
-			}
-		else
-			{
-			zmin = MIN(zmin, -ping->bathcorr[ibeam]);
-			zmax = MAX(zmax, -ping->bathcorr[ibeam]);
-			}
-		}
-
-	/* get zscaling */
-	mbev_selected.zscale = mbev_selected.scale;
-	dz = zmax - zmin;
-	mbev_selected.zorigin = 0.5 * (zmin + zmax);
-	mbev_selected.zmin = -0.5 * dz;
-	mbev_selected.zmax = 0.5 * dz;
-	for (i=0;i<mbev_selected.num_soundings;i++)
-		mbev_selected.soundings[i].z = mbev_selected.soundings[i].z - mbev_selected.zorigin;
-
-	/* print output debug statements */
-	if (mbev_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",mbev_error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       mbev_status:%d\n",mbev_status);
-		}
-}
-/*--------------------------------------------------------------------*/
-void mbeditviz_mb3dsoundings_biasapply(double rollbias, double pitchbias, double headingbias, double timelag)
-{
-	char	*function_name = "mbeditviz_mb3dsoundings_biasapply";
-	struct mbev_file_struct *file;
-	struct mbev_ping_struct *ping;
-	int	ifile, iping, ibeam;
-	double	heading, sonardepth;
-	double	rolldelta, pitchdelta;
-	double	headingx, headingy;
-	double	mtodeglon, mtodeglat;
-
-if (mbev_verbose > 0)
-fprintf(stderr,"mbeditviz_mb3dsoundings_biasapply:%f %f %f %f\n",
-rollbias, pitchbias, headingbias, timelag);
-
-	/* print input debug statements */
-	if (mbev_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  Function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       rollbias:    %f\n",rollbias);
-		fprintf(stderr,"dbg2       pitchbias:   %f\n",pitchbias);
-		fprintf(stderr,"dbg2       headingbias: %f\n",headingbias);
-		fprintf(stderr,"dbg2       timelag:     %f\n",timelag);
-		}
-
-	/* copy bias parameters */
-	mbev_rollbias = rollbias;
-	mbev_pitchbias = pitchbias;
-	mbev_headingbias = headingbias;
-	mbev_timelag = timelag;
-
-	/* turn message on */
-	sprintf(message, "Regridding using new bias parameters %f %f %f %f\n",
-				mbev_rollbias, mbev_pitchbias, mbev_headingbias, mbev_timelag);
-	do_mbeditviz_message_on(message);
-
-	/* apply bias parameters to swath data */
-	for (ifile=0;ifile<mbev_num_files;ifile++)
-		{
-		file = &mbev_files[ifile];
-		if (file->load_status == MB_YES)
-			{
-			for (iping=0;iping<file->num_pings;iping++)
-				{
-				ping = &(file->pings[iping]);
-				mbeditviz_apply_timelag(file, ping,
-							mbev_rollbias_3dsdg, mbev_pitchbias_3dsdg, mbev_headingbias_3dsdg, mbev_timelag_3dsdg,
-							&heading, &sonardepth,
-							&rolldelta, &pitchdelta);
-				mb_coor_scale(mbev_verbose,ping->navlat,&mtodeglon,&mtodeglat);
-				headingx = sin(heading * DTR);
-				headingy = cos(heading * DTR);
-				for (ibeam=0;ibeam<ping->beams_bath;ibeam++)
-					{
-					/* apply rotations and recalculate position */
-					mbeditviz_beam_position(ping->navlon, ping->navlat, headingx, headingy,
-							mtodeglon, mtodeglat,
-							ping->bath[ibeam], ping->bathacrosstrack[ibeam], ping->bathalongtrack[ibeam],
-							sonardepth,
-							rolldelta, pitchdelta,
-							&(ping->bathcorr[ibeam]), &(ping->bathlon[ibeam]), &(ping->bathlat[ibeam]));
-					mb_proj_forward(mbev_verbose, mbev_grid.pjptr,
-						ping->bathlon[ibeam], ping->bathlat[ibeam],
-						&ping->bathx[ibeam], &ping->bathy[ibeam],
-						&mbev_error);
-					}
-				}
-			}
-		}
-
-	/* recalculate grid */
-	mbeditviz_make_grid();
-
-	/* update the grid to mbview */
-	mbview_updateprimarygrid(mbev_verbose, 0, mbev_grid.nx, mbev_grid.ny, mbev_grid.val, &mbev_error);
-	mbview_updatesecondarygrid(mbev_verbose, 0, mbev_grid.nx, mbev_grid.ny, mbev_grid.sgm, &mbev_error);
-
-	/* turn message of */
-	do_mbeditviz_message_off();
-
-	/* redisplay grid */
-	mbview_plothigh(0);
-
-	/* print output debug statements */
-	if (mbev_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",mbev_error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       mbev_status:%d\n",mbev_status);
-		}
-}
-/*--------------------------------------------------------------------*/
-void mbeditviz_mb3dsoundings_colorsoundings(int color)
-{
-	char	*function_name = "mbeditviz_mb3dsoundings_colorsoundings";
-	struct mb3dsoundings_sounding_struct *sounding;
-	int	isounding;
-
-if (mbev_verbose > 0)
-fprintf(stderr,"mbeditviz_mb3dsoundings_colorsoundings:%d\n", color);
-
-	/* print input debug statements */
-	if (mbev_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  Function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       color:       %d\n",color);
-		}
-
-	/* apply the specified color to all unflagged, currently selected soundings
-		(currently selected soundings are displayed in the 3D soundings view) */
-	for (isounding=0;isounding<mbev_selected.num_soundings;isounding++)
-		{
-		sounding = &mbev_selected.soundings[isounding];
-		if (mb_beam_ok(sounding->beamflag))
-			{
-			sounding->beamcolor = color;
-			mbev_files[sounding->ifile].pings[sounding->iping].beamcolor[sounding->ibeam] = color;
-			}
-		}
-
-	/* print output debug statements */
-	if (mbev_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",mbev_error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       mbev_status:%d\n",mbev_status);
-		}
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbgrdviz/Makefile.am b/src/mbgrdviz/Makefile.am
deleted file mode 100644
index 30bb1c8..0000000
--- a/src/mbgrdviz/Makefile.am
+++ /dev/null
@@ -1,24 +0,0 @@
-bin_PROGRAMS = mbgrdviz
-
-AM_CFLAGS = ${libgmt_CFLAGS} ${libnetcdf_CFLAGS}
-
-AM_CPPFLAGS = -I${top_srcdir}/src/mbio \
-       -I${top_srcdir}/src/mbaux \
-       -I${top_srcdir}/src/mbview \
-       -I${top_srcdir}/src/mr1pr \
-       -I${top_srcdir}/src/surf \
-	      -I${top_srcdir}/src/gsf \
-       ${libgmt_CPPFLAGS} ${libnetcdf_CPPFLAGS} \
-       ${libmotif_CPPFLAGS} ${libopengl_CPPFLAGS}
-
-AM_LDFLAGS =
-
-mbgrdviz_SOURCES =  mbgrdviz_main.c mbgrdviz_callbacks.c  mbgrdviz_creation.c
-mbgrdviz_LDADD = ${top_builddir}/src/mbio/libmbio.la \
-		 ${top_builddir}/src/mbaux/libmbaux.la \
-		 ${top_builddir}/src/mbaux/libmbxgr.la \
-        	 ${top_builddir}/src/mbview/libmbview.la \
-		 ${libgmt_LIBS} ${libnetcdf_LIBS} ${libproj_LIBS} \
-		 ${libmotif_LIBS} ${libopengl_LIBS} \
-		 $(LIBM)
-
diff --git a/src/mbgrdviz/Makefile.in b/src/mbgrdviz/Makefile.in
deleted file mode 100644
index 3d4cf42..0000000
--- a/src/mbgrdviz/Makefile.in
+++ /dev/null
@@ -1,680 +0,0 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
-
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-
-VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
-am__make_running_with_option = \
-  case $${target_option-} in \
-      ?) ;; \
-      *) echo "am__make_running_with_option: internal error: invalid" \
-              "target option '$${target_option-}' specified" >&2; \
-         exit 1;; \
-  esac; \
-  has_opt=no; \
-  sane_makeflags=$$MAKEFLAGS; \
-  if $(am__is_gnu_make); then \
-    sane_makeflags=$$MFLAGS; \
-  else \
-    case $$MAKEFLAGS in \
-      *\\[\ \	]*) \
-        bs=\\; \
-        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
-          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
-    esac; \
-  fi; \
-  skip_next=no; \
-  strip_trailopt () \
-  { \
-    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
-  }; \
-  for flg in $$sane_makeflags; do \
-    test $$skip_next = yes && { skip_next=no; continue; }; \
-    case $$flg in \
-      *=*|--*) continue;; \
-        -*I) strip_trailopt 'I'; skip_next=yes;; \
-      -*I?*) strip_trailopt 'I';; \
-        -*O) strip_trailopt 'O'; skip_next=yes;; \
-      -*O?*) strip_trailopt 'O';; \
-        -*l) strip_trailopt 'l'; skip_next=yes;; \
-      -*l?*) strip_trailopt 'l';; \
-      -[dEDm]) skip_next=yes;; \
-      -[JT]) skip_next=yes;; \
-    esac; \
-    case $$flg in \
-      *$$target_option*) has_opt=yes; break;; \
-    esac; \
-  done; \
-  test $$has_opt = yes
-am__make_dryrun = (target_option=n; $(am__make_running_with_option))
-am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-bin_PROGRAMS = mbgrdviz$(EXEEXT)
-subdir = src/mbgrdviz
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/depcomp
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
-	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
-	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
-	$(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-	$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/src/mbio/mb_config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-am__installdirs = "$(DESTDIR)$(bindir)"
-PROGRAMS = $(bin_PROGRAMS)
-am_mbgrdviz_OBJECTS = mbgrdviz_main.$(OBJEXT) \
-	mbgrdviz_callbacks.$(OBJEXT) mbgrdviz_creation.$(OBJEXT)
-mbgrdviz_OBJECTS = $(am_mbgrdviz_OBJECTS)
-am__DEPENDENCIES_1 =
-mbgrdviz_DEPENDENCIES = ${top_builddir}/src/mbio/libmbio.la \
-	${top_builddir}/src/mbaux/libmbaux.la \
-	${top_builddir}/src/mbaux/libmbxgr.la \
-	${top_builddir}/src/mbview/libmbview.la $(am__DEPENDENCIES_1) \
-	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
-	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
-	$(am__DEPENDENCIES_1)
-AM_V_lt = $(am__v_lt_ at AM_V@)
-am__v_lt_ = $(am__v_lt_ at AM_DEFAULT_V@)
-am__v_lt_0 = --silent
-am__v_lt_1 = 
-AM_V_P = $(am__v_P_ at AM_V@)
-am__v_P_ = $(am__v_P_ at AM_DEFAULT_V@)
-am__v_P_0 = false
-am__v_P_1 = :
-AM_V_GEN = $(am__v_GEN_ at AM_V@)
-am__v_GEN_ = $(am__v_GEN_ at AM_DEFAULT_V@)
-am__v_GEN_0 = @echo "  GEN     " $@;
-am__v_GEN_1 = 
-AM_V_at = $(am__v_at_ at AM_V@)
-am__v_at_ = $(am__v_at_ at AM_DEFAULT_V@)
-am__v_at_0 = @
-am__v_at_1 = 
-DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)/src/mbio
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
-am__mv = mv -f
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
-	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
-	$(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
-	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
-	$(AM_CFLAGS) $(CFLAGS)
-AM_V_CC = $(am__v_CC_ at AM_V@)
-am__v_CC_ = $(am__v_CC_ at AM_DEFAULT_V@)
-am__v_CC_0 = @echo "  CC      " $@;
-am__v_CC_1 = 
-CCLD = $(CC)
-LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
-	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
-	$(AM_LDFLAGS) $(LDFLAGS) -o $@
-AM_V_CCLD = $(am__v_CCLD_ at AM_V@)
-am__v_CCLD_ = $(am__v_CCLD_ at AM_DEFAULT_V@)
-am__v_CCLD_0 = @echo "  CCLD    " $@;
-am__v_CCLD_1 = 
-SOURCES = $(mbgrdviz_SOURCES)
-DIST_SOURCES = $(mbgrdviz_SOURCES)
-am__can_run_installinfo = \
-  case $$AM_UPDATE_INFO_DIR in \
-    n|no|NO) false;; \
-    *) (install-info --version) >/dev/null 2>&1;; \
-  esac
-am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
-# Read a list of newline-separated strings from the standard input,
-# and print each of them once, without duplicates.  Input order is
-# *not* preserved.
-am__uniquify_input = $(AWK) '\
-  BEGIN { nonempty = 0; } \
-  { items[$$0] = 1; nonempty = 1; } \
-  END { if (nonempty) { for (i in items) print i; }; } \
-'
-# Make sure the list of sources is unique.  This is necessary because,
-# e.g., the same source file might be shared among _SOURCES variables
-# for different programs/libraries.
-am__define_uniq_tagged_files = \
-  list='$(am__tagged_files)'; \
-  unique=`for i in $$list; do \
-    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-  done | $(am__uniquify_input)`
-ETAGS = etags
-CTAGS = ctags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-CC = @CC@
-CCAS = @CCAS@
-CCASDEPMODE = @CCASDEPMODE@
-CCASFLAGS = @CCASFLAGS@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DLLTOOL = @DLLTOOL@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GREP = @GREP@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBM = @LIBM@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIBTOOL_DEPS = @LIBTOOL_DEPS@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LTLIBOBJS = @LTLIBOBJS@
-LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
-MAINT = @MAINT@
-MAKEINFO = @MAKEINFO@
-MANIFEST_TOOL = @MANIFEST_TOOL@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-OTPS_DIR = @OTPS_DIR@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_URL = @PACKAGE_URL@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PKG_CONFIG = @PKG_CONFIG@
-PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
-PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-VERSION = @VERSION@
-XDR_LIB = @XDR_LIB@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_AR = @ac_ct_AR@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-fftw_app = @fftw_app@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libGLU_CFLAGS = @libGLU_CFLAGS@
-libGLU_LIBS = @libGLU_LIBS@
-libXm_CFLAGS = @libXm_CFLAGS@
-libXm_LIBS = @libXm_LIBS@
-libdir = @libdir@
-libexecdir = @libexecdir@
-libfftw3_CFLAGS = @libfftw3_CFLAGS@
-libfftw3_LIBS = @libfftw3_LIBS@
-libfftw_CPPFLAGS = @libfftw_CPPFLAGS@
-libfftw_LIBS = @libfftw_LIBS@
-libgmt_CFLAGS = @libgmt_CFLAGS@
-libgmt_CPPFLAGS = @libgmt_CPPFLAGS@
-libgmt_LIBS = @libgmt_LIBS@
-libmotif_CPPFLAGS = @libmotif_CPPFLAGS@
-libmotif_LIBS = @libmotif_LIBS@
-libnetcdf_CFLAGS = @libnetcdf_CFLAGS@
-libnetcdf_CPPFLAGS = @libnetcdf_CPPFLAGS@
-libnetcdf_LIBS = @libnetcdf_LIBS@
-libopengl_CPPFLAGS = @libopengl_CPPFLAGS@
-libopengl_LIBS = @libopengl_LIBS@
-libproj_CFLAGS = @libproj_CFLAGS@
-libproj_CPPFLAGS = @libproj_CPPFLAGS@
-libproj_LIBS = @libproj_LIBS@
-libpsl_CFLAGS = @libpsl_CFLAGS@
-libpsl_LIBS = @libpsl_LIBS@
-localedir = @localedir@
-localstatedir = @localstatedir@
-mandir = @mandir@
-mbsystemdatadir = @mbsystemdatadir@
-mbsystemhtmldir = @mbsystemhtmldir@
-mbsystempsdir = @mbsystempsdir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-AM_CFLAGS = ${libgmt_CFLAGS} ${libnetcdf_CFLAGS}
-AM_CPPFLAGS = -I${top_srcdir}/src/mbio \
-       -I${top_srcdir}/src/mbaux \
-       -I${top_srcdir}/src/mbview \
-       -I${top_srcdir}/src/mr1pr \
-       -I${top_srcdir}/src/surf \
-	      -I${top_srcdir}/src/gsf \
-       ${libgmt_CPPFLAGS} ${libnetcdf_CPPFLAGS} \
-       ${libmotif_CPPFLAGS} ${libopengl_CPPFLAGS}
-
-AM_LDFLAGS = 
-mbgrdviz_SOURCES = mbgrdviz_main.c mbgrdviz_callbacks.c  mbgrdviz_creation.c
-mbgrdviz_LDADD = ${top_builddir}/src/mbio/libmbio.la \
-		 ${top_builddir}/src/mbaux/libmbaux.la \
-		 ${top_builddir}/src/mbaux/libmbxgr.la \
-        	 ${top_builddir}/src/mbview/libmbview.la \
-		 ${libgmt_LIBS} ${libnetcdf_LIBS} ${libproj_LIBS} \
-		 ${libmotif_LIBS} ${libopengl_LIBS} \
-		 $(LIBM)
-
-all: all-am
-
-.SUFFIXES:
-.SUFFIXES: .c .lo .o .obj
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
-	@for dep in $?; do \
-	  case '$(am__configure_deps)' in \
-	    *$$dep*) \
-	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-	        && { if test -f $@; then exit 0; else break; fi; }; \
-	      exit 1;; \
-	  esac; \
-	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/mbgrdviz/Makefile'; \
-	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --gnu src/mbgrdviz/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	@case '$?' in \
-	  *config.status*) \
-	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-	esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-install-binPROGRAMS: $(bin_PROGRAMS)
-	@$(NORMAL_INSTALL)
-	@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
-	if test -n "$$list"; then \
-	  echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
-	  $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
-	fi; \
-	for p in $$list; do echo "$$p $$p"; done | \
-	sed 's/$(EXEEXT)$$//' | \
-	while read p p1; do if test -f $$p \
-	 || test -f $$p1 \
-	  ; then echo "$$p"; echo "$$p"; else :; fi; \
-	done | \
-	sed -e 'p;s,.*/,,;n;h' \
-	    -e 's|.*|.|' \
-	    -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
-	sed 'N;N;N;s,\n, ,g' | \
-	$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
-	  { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
-	    if ($$2 == $$4) files[d] = files[d] " " $$1; \
-	    else { print "f", $$3 "/" $$4, $$1; } } \
-	  END { for (d in files) print "f", d, files[d] }' | \
-	while read type dir files; do \
-	    if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
-	    test -z "$$files" || { \
-	    echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
-	    $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
-	    } \
-	; done
-
-uninstall-binPROGRAMS:
-	@$(NORMAL_UNINSTALL)
-	@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
-	files=`for p in $$list; do echo "$$p"; done | \
-	  sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
-	      -e 's/$$/$(EXEEXT)/' \
-	`; \
-	test -n "$$list" || exit 0; \
-	echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
-	cd "$(DESTDIR)$(bindir)" && rm -f $$files
-
-clean-binPROGRAMS:
-	@list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \
-	echo " rm -f" $$list; \
-	rm -f $$list || exit $$?; \
-	test -n "$(EXEEXT)" || exit 0; \
-	list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
-	echo " rm -f" $$list; \
-	rm -f $$list
-
-mbgrdviz$(EXEEXT): $(mbgrdviz_OBJECTS) $(mbgrdviz_DEPENDENCIES) $(EXTRA_mbgrdviz_DEPENDENCIES) 
-	@rm -f mbgrdviz$(EXEEXT)
-	$(AM_V_CCLD)$(LINK) $(mbgrdviz_OBJECTS) $(mbgrdviz_LDADD) $(LIBS)
-
-mostlyclean-compile:
-	-rm -f *.$(OBJEXT)
-
-distclean-compile:
-	-rm -f *.tab.c
-
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbgrdviz_callbacks.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbgrdviz_creation.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbgrdviz_main.Po at am__quote@
-
-.c.o:
- at am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(COMPILE) -c -o $@ $<
-
-.c.obj:
- at am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
- at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-
-.c.lo:
- at am__fastdepCC_TRUE@	$(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(LTCOMPILE) -c -o $@ $<
-
-mostlyclean-libtool:
-	-rm -f *.lo
-
-clean-libtool:
-	-rm -rf .libs _libs
-
-ID: $(am__tagged_files)
-	$(am__define_uniq_tagged_files); mkid -fID $$unique
-tags: tags-am
-TAGS: tags
-
-tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
-	set x; \
-	here=`pwd`; \
-	$(am__define_uniq_tagged_files); \
-	shift; \
-	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
-	  test -n "$$unique" || unique=$$empty_fix; \
-	  if test $$# -gt 0; then \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      "$$@" $$unique; \
-	  else \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      $$unique; \
-	  fi; \
-	fi
-ctags: ctags-am
-
-CTAGS: ctags
-ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
-	$(am__define_uniq_tagged_files); \
-	test -z "$(CTAGS_ARGS)$$unique" \
-	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$unique
-
-GTAGS:
-	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && $(am__cd) $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) "$$here"
-cscopelist: cscopelist-am
-
-cscopelist-am: $(am__tagged_files)
-	list='$(am__tagged_files)'; \
-	case "$(srcdir)" in \
-	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
-	  *) sdir=$(subdir)/$(srcdir) ;; \
-	esac; \
-	for i in $$list; do \
-	  if test -f "$$i"; then \
-	    echo "$(subdir)/$$i"; \
-	  else \
-	    echo "$$sdir/$$i"; \
-	  fi; \
-	done >> $(top_builddir)/cscope.files
-
-distclean-tags:
-	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	list='$(DISTFILES)'; \
-	  dist_files=`for file in $$list; do echo $$file; done | \
-	  sed -e "s|^$$srcdirstrip/||;t" \
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
-	case $$dist_files in \
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
-			   sort -u` ;; \
-	esac; \
-	for file in $$dist_files; do \
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  if test -d $$d/$$file; then \
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
-	    if test -d "$(distdir)/$$file"; then \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
-	  else \
-	    test -f "$(distdir)/$$file" \
-	    || cp -p $$d/$$file "$(distdir)/$$file" \
-	    || exit 1; \
-	  fi; \
-	done
-check-am: all-am
-check: check-am
-all-am: Makefile $(PROGRAMS)
-installdirs:
-	for dir in "$(DESTDIR)$(bindir)"; do \
-	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
-	done
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
-	if test -z '$(STRIP)'; then \
-	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	      install; \
-	else \
-	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
-	fi
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
-	@echo "This command is intended for maintainers to use"
-	@echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am
-
-distclean: distclean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
-	distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am: install-binPROGRAMS
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic \
-	mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am: uninstall-binPROGRAMS
-
-.MAKE: install-am install-strip
-
-.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \
-	clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \
-	ctags ctags-am distclean distclean-compile distclean-generic \
-	distclean-libtool distclean-tags distdir dvi dvi-am html \
-	html-am info info-am install install-am install-binPROGRAMS \
-	install-data install-data-am install-dvi install-dvi-am \
-	install-exec install-exec-am install-html install-html-am \
-	install-info install-info-am install-man install-pdf \
-	install-pdf-am install-ps install-ps-am install-strip \
-	installcheck installcheck-am installdirs maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-compile \
-	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-	tags tags-am uninstall uninstall-am uninstall-binPROGRAMS
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/mbgrdviz/mbgrdviz.uil b/src/mbgrdviz/mbgrdviz.uil
deleted file mode 100644
index ec9b9f1..0000000
--- a/src/mbgrdviz/mbgrdviz.uil
+++ /dev/null
@@ -1,2992 +0,0 @@
-/*
- * Generated by the ICS builderXcessory (BX).
- *
- *
- * BuilderXcessory Version 6.1.3.
- *
- * Identification: 
- */
-module main_uil
-version = 'V2.1'
-names = case_sensitive
-!(BX) bx_info("c_options", "")
-!(BX) bx_info("c_libs", "-L/usr/lib/Motif1.2 -lXm -lXt -lX11")
-!(BX) bx_info("c_cflags", "-Aa -I/usr/include/Motif1.2 -I/usr/include/X11R5")
-!(BX) bx_info("c_cc", "cc")
-!(BX) bx_info("c_excludeungenerated", "false")
-!(BX) bx_info("c_target", "main-c")
-!(BX) bx_info("c_information", "")
-!(BX) bx_info("c_user_main_loop", "", false)
-!(BX) bx_info("c_ignore_shell_geometry", "false")
-!(BX) bx_info("c_visible_windows_only", "false")
-!(BX) bx_info("c_rm_exp_callbacks", "false")
-!(BX) bx_info("c_reverse_dialogs", "true")
-!(BX) bx_info("c_dialogs_in_routine", "true")
-!(BX) bx_info("c_unmanage_dialogs", "true")
-!(BX) bx_info("c_use_locales", "false")
-!(BX) bx_info("c_ansi", "true")
-!(BX) bx_info("c_name", "MB-System")
-!(BX) bx_info("c_class", "MB-System")
-!(BX) bx_info("c_app_defaults", "app-defaults", true)
-!(BX) bx_info("c_utilities", "mbgrdviz_bxutils.c", true)
-!(BX) bx_info("c_constants", "mbgrdviz_creation.h", true)
-!(BX) bx_info("c_callbacks", "mbgrdviz_callbacks.c", true)
-!(BX) bx_info("c_creation", "mbgrdviz_creation.c", true)
-!(BX) bx_info("c_main", "mbgrdviz_main.c", true)
-!(BX) bx_info("c_acinclude_m4", "acinclude.m4", false)
-!(BX) bx_info("c_configure_in", "configure.in", false)
-!(BX) bx_info("c_makefile_am", "Makefile.am", false)
-!(BX) bx_info("c_cvsmake", "CVSMake", false)
-!(BX) bx_info("c_makefile", "mbgrdviz_makefile-c", true)
-!(BX) bx_info("c_imakefile", "mbgrdviz_Imakefile", true)
-!(BX) bx_info("c_dirpath", "")
-!(BX) bx_info("include_path", "./sandbox/mbsystem/src/mbview",
-!(BX)		".", false)
-!(BX) bx_info("xrunner_command", "$(M_ROOT)/arch/X11.5/Xm1.2/mic_xm.o", false)
-!(BX) bx_info("system_directory", "/opt/bx-6.1")
-!(BX) bx_info("builder_version", "BuilderXcessory Version 6.1.3")
-!(BX) bx_info("build_lang", "C")
-!(BX) bx_info("default_cpp_args", "")
-!(BX) bx_info("new_mrm_style", "true")
-!(BX) bx_info("c_wrap_lines", "false")
-!(BX) bx_info("uil_wrap_lines", "true")
-!(BX) bx_info("integrate_purify", "false")
-!(BX) bx_info("purify_command", "purify")
-!(BX) bx_info("integrate_xrunner", "false")
-
-procedure BxGlobalWidgetId;
-identifier BXG_pushButton_realtime_resume;
-identifier BXG_pushButton_realtime_pause;
-identifier BXG_pushButton_realtime_stop;
-identifier BXG_pushButton_realtime_start;
-identifier BXG_pushButton_realtime_setup;
-identifier BXG_pushButton_saveroute;
-identifier BXG_pushButton_savesite;
-identifier BXG_pushButton_openvector;
-identifier BXG_pushButton_openswath;
-identifier BXG_pushButton_opennav;
-identifier BXG_pushButton_openroute;
-identifier BXG_pushButton_opensite;
-identifier BXG_pushButton_file_openprimary;
-identifier BXG_label_about_version;
-identifier BXG_fileSelectionBox;
-identifier BXG_dialogShell_open;
-identifier BXG_spinText_arearoute_interleaving;
-identifier BXG_spinBox_arearoute_interleaving;
-identifier BXG_textField_arearoute_name;
-identifier BXG_spinText_arearoute_color;
-identifier BXG_spinBox_arearoute_color;
-identifier BXG_spinText_arearoute_crosslines;
-identifier BXG_spinBox_arearoute_crosslines;
-identifier BXG_label_arearoute_depth;
-identifier BXG_label_arearoute_altitude;
-identifier BXG_spinText_arearoute_altitude;
-identifier BXG_spinBox_arearoute_altitude;
-identifier BXG_spinText_arearoute_depth;
-identifier BXG_spinBox_arearoute_depth;
-identifier BXG_spinText_arearoute_direction;
-identifier BXG_spinBox_arearoute_direction;
-identifier BXG_spinText_arearoute_swathwidth;
-identifier BXG_spinBox_arearoute_swathwidth;
-identifier BXG_label_arearoute_swathwidth;
-identifier BXG_label_arearoute_platform;
-identifier BXG_spinText_arearoute_platform;
-identifier BXG_spinBox_arearoute_platform;
-identifier BXG_spinText_arearoute_linespacing;
-identifier BXG_spinBox_arearoute_linespacing;
-identifier BXG_spinText_arearoute_crosslinesfirstlast;
-identifier BXG_spinBox_arearoute_crosslinesfirstlast;
-identifier BXG_label_arearoute_info;
-identifier BXG_spinText_arearoute_linecontrol;
-identifier BXG_spinBox_arearoute_linecontrol;
-identifier BXG_label_arearoute_linespacing;
-identifier BXG_pushButton_arearoute_ok;
-identifier BXG_bulletinBoard_arearoute;
-identifier BXG_label_realtimesetup_teststatus;
-identifier BXG_toggleButton_realtimesetup_pointer;
-identifier BXG_toggleButton_realtimesetup_recent;
-identifier BXG_radioBox_realtimesetup_pathmode;
-identifier BXG_spinText_realtimesetup_icon;
-identifier BXG_pushButton_realtimesetup_pathbrowse;
-identifier BXG_pushButton_realtimesetup_pathtest;
-identifier BXG_scale_realtimesetup_update;
-identifier BXG_textField_realtimesetup_path;
-procedure BxExitCB(integer);
-procedure BxManageCB(string);
-procedure BxUnmanageCB(string);
-procedure do_mbgrdviz_arearoute_altitude_increment();
-procedure do_mbgrdviz_arearoute_depth_increment();
-procedure do_mbgrdviz_arearoute_dismiss();
-procedure do_mbgrdviz_arearoute_linespacing_increment();
-procedure do_mbgrdviz_arearoute_parameterchange();
-procedure do_mbgrdviz_fileSelectionBox(integer);
-procedure do_mbgrdviz_fileSelectionBox_opennav();
-procedure do_mbgrdviz_fileSelectionBox_openroute();
-procedure do_mbgrdviz_fileSelectionBox_opensite();
-procedure do_mbgrdviz_fileSelectionBox_openswath();
-procedure do_mbgrdviz_fileSelectionBox_openvector();
-procedure do_mbgrdviz_fileSelectionBox_saveroute();
-procedure do_mbgrdviz_fileSelectionBox_savesite();
-procedure do_mbgrdviz_generate_survey();
-procedure do_mbgrdviz_openfile();
-procedure do_mbgrdviz_quit();
-procedure do_mbgrdviz_realtime_pause();
-procedure do_mbgrdviz_realtime_resume();
-procedure do_mbgrdviz_realtime_start();
-procedure do_mbgrdviz_realtime_stop();
-procedure do_mbgrdviz_realtimesetup_icon();
-procedure do_mbgrdviz_realtimesetup_path_browse();
-procedure do_mbgrdviz_realtimesetup_path_test();
-procedure do_mbgrdviz_realtimesetup_pathmode();
-procedure do_mbgrdviz_realtimesetup_updaterate();
-
-list BaseStyle : arguments {
-};
-
-list BaseStyleReasons : callbacks {
-};
-
-!(BX)list BaseStyleHandlers : handlers {
-!(BX)};
-
-list Style_use : arguments {
-        arguments BaseStyle;
-        XmNfontList = font_table(
-		font('-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1'));
-};
-
-list Style_useReasons : callbacks {
-        callbacks BaseStyleReasons;
-};
-
-!(BX)list Style_useHandlers : handlers {
-!(BX)    handlers BaseStyleHandlers;
-!(BX)};
-
-
-object label_realtimesetup_path : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_CENTER;
-        XmNlabelString = compound_string("Realtime Nav Source Path:");
-        XmNrightAttachment = XmATTACH_FORM;
-        XmNleftAttachment = XmATTACH_FORM;
-        XmNleftOffset = 10;
-        XmNrightOffset = 16;
-        XmNtopOffset = 10;
-        XmNx = 10;
-        XmNy = 10;
-        XmNwidth = 471;
-        XmNheight = 40;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object textField_realtimesetup_path : XmTextField widget {
-    arguments {
-        arguments Style_use;
-        XmNtopAttachment = XmATTACH_FORM;
-        XmNrightAttachment = XmATTACH_FORM;
-        XmNleftAttachment = XmATTACH_FORM;
-        XmNbottomAttachment = XmATTACH_NONE;
-        XmNleftOffset = 10;
-        XmNrightOffset = 11;
-        XmNtopOffset = 50;
-        XmNx = 10;
-        XmNy = 50;
-        XmNwidth = 476;
-        XmNheight = 40;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_textField_realtimesetup_path);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object separator4 : XmSeparator widget {
-    arguments {
-        XmNtopAttachment = XmATTACH_WIDGET;
-        XmNrightAttachment = XmATTACH_FORM;
-        XmNleftAttachment = XmATTACH_FORM;
-        XmNbottomAttachment = XmATTACH_NONE;
-        XmNbottomOffset = 0;
-        XmNleftOffset = 10;
-        XmNrightOffset = 11;
-        XmNtopOffset = 0;
-        XmNtopWidget = XmLabel label_realtimesetup_teststatus;
-        XmNx = 10;
-        XmNy = 222;
-        XmNwidth = 476;
-        XmNheight = 20;
-    };
-    controls {
-    };
-    callbacks {
-    };
-};
-
-object label_realtimesetup_update : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_CENTER;
-        XmNlabelString = compound_string("Display Update Rate:");
-        XmNtopAttachment = XmATTACH_WIDGET;
-        XmNrightAttachment = XmATTACH_FORM;
-        XmNleftAttachment = XmATTACH_FORM;
-        XmNbottomAttachment = XmATTACH_NONE;
-        XmNbottomOffset = 0;
-        XmNleftOffset = 10;
-        XmNrightOffset = 11;
-        XmNtopOffset = 0;
-        XmNtopWidget = XmSeparator separator4;
-        XmNx = 10;
-        XmNy = 242;
-        XmNwidth = 476;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object scale_realtimesetup_update : XmScale widget {
-    arguments {
-        arguments Style_use;
-        XmNvalue = 1;
-        XmNtitleString = compound_string("Data read before update");
-        XmNmaximum = 25;
-        XmNshowArrows = TRUE;
-        XmNshowValue = TRUE;
-        XmNorientation = XmHORIZONTAL;
-        XmNtopAttachment = XmATTACH_WIDGET;
-        XmNrightAttachment = XmATTACH_FORM;
-        XmNleftAttachment = XmATTACH_FORM;
-        XmNbottomAttachment = XmATTACH_NONE;
-        XmNbottomOffset = 0;
-        XmNleftOffset = 10;
-        XmNrightOffset = 11;
-        XmNtopOffset = 0;
-        XmNtopWidget = XmLabel label_realtimesetup_update;
-        XmNx = 10;
-        XmNy = 272;
-        XmNwidth = 476;
-        XmNheight = 63;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_scale_realtimesetup_update);
-        XmNvalueChangedCallback = procedure do_mbgrdviz_realtimesetup_updaterate();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object separator5 : XmSeparator widget {
-    arguments {
-        XmNtopAttachment = XmATTACH_WIDGET;
-        XmNrightAttachment = XmATTACH_FORM;
-        XmNleftAttachment = XmATTACH_FORM;
-        XmNbottomAttachment = XmATTACH_NONE;
-        XmNbottomOffset = 0;
-        XmNleftOffset = 10;
-        XmNrightOffset = 11;
-        XmNtopOffset = 7;
-        XmNtopWidget = XmScale scale_realtimesetup_update;
-        XmNx = 10;
-        XmNy = 342;
-        XmNwidth = 476;
-        XmNheight = 20;
-    };
-    controls {
-    };
-    callbacks {
-    };
-};
-
-object pushButton_realtimesetup_pathtest : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Test");
-        XmNtopAttachment = XmATTACH_FORM;
-        XmNrightAttachment = XmATTACH_NONE;
-        XmNleftAttachment = XmATTACH_WIDGET;
-        XmNbottomAttachment = XmATTACH_NONE;
-        XmNbottomOffset = 0;
-        XmNleftOffset = 8;
-        XmNrightOffset = 0;
-        XmNtopOffset = 100;
-        XmNleftWidget = XmPushButton pushButton_realtimesetup_pathbrowse;
-        XmNx = 110;
-        XmNy = 100;
-        XmNwidth = 92;
-        XmNheight = 52;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_pushButton_realtimesetup_pathtest);
-        XmNactivateCallback = procedure do_mbgrdviz_realtimesetup_path_test();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object pushButton_realtimesetup_pathbrowse : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Browse");
-        XmNtopAttachment = XmATTACH_FORM;
-        XmNrightAttachment = XmATTACH_NONE;
-        XmNleftAttachment = XmATTACH_FORM;
-        XmNbottomAttachment = XmATTACH_NONE;
-        XmNbottomOffset = 0;
-        XmNleftOffset = 10;
-        XmNrightOffset = 0;
-        XmNtopOffset = 100;
-        XmNx = 10;
-        XmNy = 100;
-        XmNwidth = 92;
-        XmNheight = 52;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_pushButton_realtimesetup_pathbrowse);
-        XmNactivateCallback = procedure do_mbgrdviz_realtimesetup_path_browse();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object label_realtime_setup_icon : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Realtime Display Icon:");
-        XmNtopAttachment = XmATTACH_WIDGET;
-        XmNrightAttachment = XmATTACH_FORM;
-        XmNleftAttachment = XmATTACH_FORM;
-        XmNbottomAttachment = XmATTACH_NONE;
-        XmNbottomOffset = 0;
-        XmNleftOffset = 10;
-        XmNrightOffset = 7;
-        XmNtopOffset = 0;
-        XmNtopWidget = XmSeparator separator5;
-        XmNx = 10;
-        XmNy = 362;
-        XmNwidth = 480;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object spinText_realtimesetup_icon : XmTextField widget {
-    arguments {
-        arguments Style_use;
-        XmNeditable = false;
-        XmNx = 2;
-        XmNy = 5;
-        XmNwidth = 410;
-        XmNheight = 40;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_spinText_realtimesetup_icon);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object spinBox_realtimesetup_icon : XmSpinBox widget {
-    arguments {
-        arguments Style_use;
-        XmNtopAttachment = XmATTACH_WIDGET;
-        XmNrightAttachment = XmATTACH_FORM;
-        XmNleftAttachment = XmATTACH_FORM;
-        XmNbottomAttachment = XmATTACH_NONE;
-        XmNbottomOffset = 0;
-        XmNleftOffset = 10;
-        XmNrightOffset = 7;
-        XmNtopOffset = 0;
-        XmNtopWidget = XmLabel label_realtime_setup_icon;
-        XmNx = 10;
-        XmNy = 392;
-        XmNwidth = 480;
-        XmNheight = 50;
-    };
-    controls {
-         managed XmTextField spinText_realtimesetup_icon;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNvalueChangedCallback = procedure do_mbgrdviz_realtimesetup_icon();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object separator6 : XmSeparator widget {
-    arguments {
-        XmNtopAttachment = XmATTACH_WIDGET;
-        XmNleftAttachment = XmATTACH_FORM;
-        XmNbottomAttachment = XmATTACH_NONE;
-        XmNbottomOffset = 0;
-        XmNleftOffset = 10;
-        XmNtopOffset = 0;
-        XmNtopWidget = XmSpinBox spinBox_realtimesetup_icon;
-        XmNx = 10;
-        XmNy = 442;
-        XmNwidth = 476;
-        XmNheight = 20;
-    };
-    controls {
-    };
-    callbacks {
-    };
-};
-
-object pushButton_realtimesetup_dismiss : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Dismiss");
-        XmNtopAttachment = XmATTACH_WIDGET;
-        XmNrightAttachment = XmATTACH_FORM;
-        XmNleftAttachment = XmATTACH_FORM;
-        XmNbottomAttachment = XmATTACH_NONE;
-        XmNbottomOffset = 0;
-        XmNleftOffset = 200;
-        XmNrightOffset = 197;
-        XmNtopOffset = 9;
-        XmNtopWidget = XmSeparator separator6;
-        XmNx = 200;
-        XmNy = 471;
-        XmNwidth = 100;
-        XmNheight = 52;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNactivateCallback = procedure BxUnmanageCB("form_realtime_setup");
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object toggleButton : XmToggleButton widget {
-    arguments {
-        XmNx = -700;
-        XmNy = -200;
-        XmNwidth = 100;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-    };
-};
-
-object toggleButton_realtimesetup_recent : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNlabelString = compound_string("Most Recent File in Directory");
-        XmNwidth = 231;
-        XmNheight = 28;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_toggleButton_realtimesetup_recent);
-        XmNvalueChangedCallback = procedure do_mbgrdviz_realtimesetup_pathmode();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object toggleButton_realtimesetup_pointer : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNlabelString = compound_string("Use Pointer File");
-        XmNwidth = 231;
-        XmNheight = 28;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_toggleButton_realtimesetup_pointer);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object radioBox_realtimesetup_pathmode : XmRadioBox widget {
-    arguments {
-        arguments Style_use;
-        XmNtopAttachment = XmATTACH_WIDGET;
-        XmNrightAttachment = XmATTACH_FORM;
-        XmNleftAttachment = XmATTACH_WIDGET;
-        XmNbottomAttachment = XmATTACH_NONE;
-        XmNbottomOffset = 0;
-        XmNleftOffset = 8;
-        XmNrightOffset = 50;
-        XmNtopOffset = 2;
-        XmNleftWidget = XmPushButton pushButton_realtimesetup_pathtest;
-        XmNtopWidget = XmTextField textField_realtimesetup_path;
-        XmNx = 210;
-        XmNy = 92;
-        XmNwidth = 237;
-        XmNheight = 65;
-    };
-    controls {
-         managed XmToggleButton toggleButton_realtimesetup_recent;
-         managed XmToggleButton toggleButton_realtimesetup_pointer;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_radioBox_realtimesetup_pathmode);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object label_realtimesetup_teststatus : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNlabelString = compound_string("Test Status: No realtime data av" &
- "ailable", separate=true) &
- compound_string("Path: Unknown");
-        XmNtopAttachment = XmATTACH_WIDGET;
-        XmNrightAttachment = XmATTACH_FORM;
-        XmNleftAttachment = XmATTACH_FORM;
-        XmNbottomAttachment = XmATTACH_NONE;
-        XmNbottomOffset = 0;
-        XmNleftOffset = 10;
-        XmNrightOffset = 7;
-        XmNtopOffset = 72;
-        XmNtopWidget = XmTextField textField_realtimesetup_path;
-        XmNx = 10;
-        XmNy = 162;
-        XmNwidth = 480;
-        XmNheight = 60;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_label_realtimesetup_teststatus);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object form_realtime_setup : XmFormDialog widget {
-    arguments {
-        arguments Style_use;
-        XmNautoUnmanage = false;
-        XmNresizePolicy = XmRESIZE_GROW;
-        XmNx = 1032;
-        XmNy = 1067;
-        XmNwidth = 497;
-        XmNheight = 540;
-    };
-    controls {
-         managed XmLabel label_realtimesetup_teststatus;
-         managed XmRadioBox radioBox_realtimesetup_pathmode;
-         managed XmToggleButton toggleButton;
-         managed XmPushButton pushButton_realtimesetup_dismiss;
-         managed XmSeparator separator6;
-         managed XmSpinBox spinBox_realtimesetup_icon;
-         managed XmLabel label_realtime_setup_icon;
-         managed XmPushButton pushButton_realtimesetup_pathbrowse;
-         managed XmPushButton pushButton_realtimesetup_pathtest;
-         managed XmSeparator separator5;
-         managed XmScale scale_realtimesetup_update;
-         managed XmLabel label_realtimesetup_update;
-         managed XmSeparator separator4;
-         managed XmTextField textField_realtimesetup_path;
-         managed XmLabel label_realtimesetup_path;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-!(BX)object dialogShell_realtimesetup : XmDialogShell widget {
-!(BX)    arguments {
-!(BX)        arguments Style_use;
-!(BX)        XmNtitle = "Realtime Setup";
-!(BX)        XmNwidth = 497;
-!(BX)        XmNheight = 540;
-!(BX)    };
-!(BX)    controls {
-!(BX)         managed XmFormDialog form_realtime_setup;
-!(BX)    };
-!(BX)    callbacks {
-!(BX)        callbacks Style_useReasons;
-!(BX)    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-!(BX)};
-
-object pushButton_arearoute_dismiss : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Dismiss");
-        XmNx = 270;
-        XmNy = 640;
-        XmNwidth = 120;
-        XmNheight = 40;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-       XmNactivateCallback = procedures {
-                 BxUnmanageCB("bulletinBoard_arearoute");
-                 do_mbgrdviz_arearoute_dismiss();
-        };
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object pushButton_arearoute_ok : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Generate Route");
-        XmNx = 90;
-        XmNy = 640;
-        XmNwidth = 120;
-        XmNheight = 40;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_pushButton_arearoute_ok);
-        XmNactivateCallback = procedure do_mbgrdviz_generate_survey();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object label_arearoute_linespacing : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNlabelString = compound_string("Line Spacing (m):");
-        XmNx = 240;
-        XmNy = 160;
-        XmNwidth = 140;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_label_arearoute_linespacing);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object label_arearoute_linecontrol : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNlabelString = compound_string("Line Spacing Mode:");
-        XmNx = 10;
-        XmNy = 160;
-        XmNwidth = 180;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object spinText_arearoute_linecontrol : XmTextField widget {
-    arguments {
-        arguments Style_use;
-        XmNcursorPositionVisible = false;
-        XmNvalue = "";
-        XmNeditable = false;
-        XmNnumValues = 0;
-        XmNvalues = string_table(
-	compound_string(""));
-        XmNpositionType = XmPOSITION_VALUE;
-        XmNx = 2;
-        XmNy = 5;
-        XmNwidth = 200;
-        XmNheight = 40;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_spinText_arearoute_linecontrol);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object spinBox_arearoute_linecontrol : XmSpinBox widget {
-    arguments {
-        arguments Style_use;
-        XmNarrowLayout = XmARROWS_END;
-        XmNlayoutDirection = XmLEFT_TO_RIGHT;
-        XmNx = 10;
-        XmNy = 190;
-        XmNwidth = 230;
-        XmNheight = 50;
-    };
-    controls {
-         managed XmTextField spinText_arearoute_linecontrol;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_spinBox_arearoute_linecontrol);
-        XmNvalueChangedCallback = procedure do_mbgrdviz_arearoute_parameterchange();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object label_arearoute_info : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNborderWidth = 2;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNbackground = color('White');
-        XmNlabelString = compound_string("Current Area Info:");
-        XmNrecomputeSize = false;
-        XmNx = 10;
-        XmNy = 10;
-        XmNwidth = 440;
-        XmNheight = 140;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_label_arearoute_info);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object spinText_arearoute_crosslinesfirstlast : XmTextField widget {
-    arguments {
-        arguments Style_use;
-        XmNcursorPositionVisible = false;
-        XmNvalue = "1";
-        XmNeditable = false;
-        XmNnumValues = 0;
-        XmNvalues = string_table(
-	compound_string(""));
-        XmNpositionType = XmPOSITION_VALUE;
-        XmNx = 2;
-        XmNy = 5;
-        XmNwidth = 200;
-        XmNheight = 40;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_spinText_arearoute_crosslinesfirstlast);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object spinBox_arearoute_crosslinesfirstlast : XmSpinBox widget {
-    arguments {
-        arguments Style_use;
-        XmNarrowLayout = XmARROWS_END;
-        XmNlayoutDirection = XmLEFT_TO_RIGHT;
-        XmNx = 10;
-        XmNy = 430;
-        XmNwidth = 230;
-        XmNheight = 50;
-    };
-    controls {
-         managed XmTextField spinText_arearoute_crosslinesfirstlast;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_spinBox_arearoute_crosslinesfirstlast);
-        XmNvalueChangedCallback = procedure do_mbgrdviz_arearoute_parameterchange();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object label_arearoute_crosslinesfirstlast : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNlabelString = compound_string("Crosslines Before/After Survey:");
-        XmNx = 10;
-        XmNy = 400;
-        XmNwidth = 220;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object spinText_arearoute_linespacing : XmTextField widget {
-    arguments {
-        arguments Style_use;
-        XmNcursorPositionVisible = false;
-        XmNeditable = false;
-        XmNposition = 200;
-        XmNminimumValue = 1;
-        XmNmaximumValue = 10000;
-        XmNspinBoxChildType = XmNUMERIC;
-        XmNx = 2;
-        XmNy = 5;
-        XmNwidth = 200;
-        XmNheight = 40;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_spinText_arearoute_linespacing);
-        XmNvalueChangedCallback = procedure do_mbgrdviz_arearoute_linespacing_increment();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object spinBox_arearoute_linespacing : XmSpinBox widget {
-    arguments {
-        arguments Style_use;
-        XmNx = 240;
-        XmNy = 190;
-        XmNwidth = 230;
-        XmNheight = 50;
-    };
-    controls {
-         managed XmTextField spinText_arearoute_linespacing;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_spinBox_arearoute_linespacing);
-        XmNvalueChangedCallback = procedure do_mbgrdviz_arearoute_parameterchange();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object spinText_arearoute_platform : XmTextField widget {
-    arguments {
-        arguments Style_use;
-        XmNcursorPositionVisible = false;
-        XmNvalue = "";
-        XmNeditable = false;
-        XmNnumValues = 0;
-        XmNvalues = string_table(
-	compound_string(""));
-        XmNpositionType = XmPOSITION_VALUE;
-        XmNx = 2;
-        XmNy = 5;
-        XmNwidth = 200;
-        XmNheight = 40;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_spinText_arearoute_platform);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object spinBox_arearoute_platform : XmSpinBox widget {
-    arguments {
-        arguments Style_use;
-        XmNarrowLayout = XmARROWS_END;
-        XmNlayoutDirection = XmLEFT_TO_RIGHT;
-        XmNx = 240;
-        XmNy = 270;
-        XmNwidth = 230;
-        XmNheight = 50;
-    };
-    controls {
-         managed XmTextField spinText_arearoute_platform;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_spinBox_arearoute_platform);
-        XmNvalueChangedCallback = procedure do_mbgrdviz_arearoute_parameterchange();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object label_arearoute_platform : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNlabelString = compound_string("Platform Type:");
-        XmNx = 240;
-        XmNy = 240;
-        XmNwidth = 180;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_label_arearoute_platform);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object label_arearoute_swathwidth : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNmappedWhenManaged = true;
-        XmNlabelString = compound_string("Swath Width (degrees):");
-        XmNx = 240;
-        XmNy = 320;
-        XmNwidth = 200;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_label_arearoute_swathwidth);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object spinText_arearoute_swathwidth : XmTextField widget {
-    arguments {
-        arguments Style_use;
-        XmNcursorPositionVisible = false;
-        XmNeditable = false;
-        XmNincrementValue = 5;
-        XmNposition = 120;
-        XmNminimumValue = 5;
-        XmNmaximumValue = 175;
-        XmNspinBoxChildType = XmNUMERIC;
-        XmNy = 5;
-        XmNwidth = 200;
-        XmNheight = 40;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_spinText_arearoute_swathwidth);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object spinBox_arearoute_swathwidth : XmSpinBox widget {
-    arguments {
-        arguments Style_use;
-        XmNx = 240;
-        XmNy = 350;
-        XmNwidth = 230;
-        XmNheight = 50;
-    };
-    controls {
-         managed XmTextField spinText_arearoute_swathwidth;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_spinBox_arearoute_swathwidth);
-        XmNvalueChangedCallback = procedure do_mbgrdviz_arearoute_parameterchange();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object label_arearoute_direction : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNlabelString = compound_string("Start Corner:");
-        XmNx = 10;
-        XmNy = 240;
-        XmNwidth = 180;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object spinText_arearoute_direction : XmTextField widget {
-    arguments {
-        arguments Style_use;
-        XmNcursorPositionVisible = false;
-        XmNvalue = "";
-        XmNeditable = false;
-        XmNnumValues = 0;
-        XmNvalues = string_table(
-	compound_string(""));
-        XmNpositionType = XmPOSITION_VALUE;
-        XmNx = 2;
-        XmNy = 0;
-        XmNwidth = 200;
-        XmNheight = 40;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_spinText_arearoute_direction);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object spinBox_arearoute_direction : XmSpinBox widget {
-    arguments {
-        arguments Style_use;
-        XmNarrowLayout = XmARROWS_END;
-        XmNlayoutDirection = XmLEFT_TO_RIGHT;
-        XmNx = 10;
-        XmNy = 270;
-        XmNwidth = 230;
-        XmNheight = 40;
-    };
-    controls {
-         managed XmTextField spinText_arearoute_direction;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_spinBox_arearoute_direction);
-        XmNvalueChangedCallback = procedure do_mbgrdviz_arearoute_parameterchange();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object spinText_arearoute_depth : XmTextField widget {
-    arguments {
-        arguments Style_use;
-        XmNcursorPositionVisible = false;
-        XmNeditable = false;
-        XmNposition = 200;
-        XmNminimumValue = 1;
-        XmNmaximumValue = 10000;
-        XmNspinBoxChildType = XmNUMERIC;
-        XmNx = 2;
-        XmNy = 5;
-        XmNwidth = 200;
-        XmNheight = 40;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_spinText_arearoute_depth);
-        XmNvalueChangedCallback = procedure do_mbgrdviz_arearoute_depth_increment();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object spinBox_arearoute_depth : XmSpinBox widget {
-    arguments {
-        arguments Style_use;
-        XmNx = 240;
-        XmNy = 510;
-        XmNwidth = 230;
-        XmNheight = 50;
-    };
-    controls {
-         managed XmTextField spinText_arearoute_depth;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_spinBox_arearoute_depth);
-        XmNvalueChangedCallback = procedure do_mbgrdviz_arearoute_parameterchange();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object spinText_arearoute_altitude : XmTextField widget {
-    arguments {
-        arguments Style_use;
-        XmNcursorPositionVisible = false;
-        XmNeditable = false;
-        XmNposition = 200;
-        XmNminimumValue = 1;
-        XmNmaximumValue = 10000;
-        XmNspinBoxChildType = XmNUMERIC;
-        XmNy = 5;
-        XmNwidth = 200;
-        XmNheight = 40;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_spinText_arearoute_altitude);
-        XmNvalueChangedCallback = procedure do_mbgrdviz_arearoute_altitude_increment();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object spinBox_arearoute_altitude : XmSpinBox widget {
-    arguments {
-        arguments Style_use;
-        XmNx = 240;
-        XmNy = 430;
-        XmNwidth = 230;
-        XmNheight = 50;
-    };
-    controls {
-         managed XmTextField spinText_arearoute_altitude;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_spinBox_arearoute_altitude);
-        XmNvalueChangedCallback = procedure do_mbgrdviz_arearoute_parameterchange();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object label_arearoute_altitude : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNlabelString = compound_string("Sonar Altitude (m):");
-        XmNx = 240;
-        XmNy = 400;
-        XmNwidth = 140;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_label_arearoute_altitude);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object label_arearoute_depth : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNlabelString = compound_string("Sonar Depth (m):");
-        XmNx = 240;
-        XmNy = 480;
-        XmNwidth = 140;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_label_arearoute_depth);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object spinText_arearoute_crosslines : XmTextField widget {
-    arguments {
-        arguments Style_use;
-        XmNcursorPositionVisible = false;
-        XmNeditable = false;
-        XmNposition = 0;
-        XmNminimumValue = 0;
-        XmNmaximumValue = 50;
-        XmNspinBoxChildType = XmNUMERIC;
-        XmNx = 2;
-        XmNy = 0;
-        XmNwidth = 200;
-        XmNheight = 40;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_spinText_arearoute_crosslines);
-        XmNvalueChangedCallback = procedure do_mbgrdviz_arearoute_linespacing_increment();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object spinBox_arearoute_crosslines : XmSpinBox widget {
-    arguments {
-        arguments Style_use;
-        XmNx = 10;
-        XmNy = 350;
-        XmNwidth = 230;
-        XmNheight = 40;
-    };
-    controls {
-         managed XmTextField spinText_arearoute_crosslines;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_spinBox_arearoute_crosslines);
-        XmNvalueChangedCallback = procedure do_mbgrdviz_arearoute_parameterchange();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object label_arearoute_crosslines : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNlabelString = compound_string("Cross Lines:");
-        XmNx = 10;
-        XmNy = 320;
-        XmNwidth = 140;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object label_arearoute_color : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNlabelString = compound_string("Route Color:");
-        XmNx = 240;
-        XmNy = 560;
-        XmNwidth = 180;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object spinText_arearoute_color : XmTextField widget {
-    arguments {
-        arguments Style_use;
-        XmNcursorPositionVisible = false;
-        XmNvalue = "";
-        XmNeditable = false;
-        XmNnumValues = 0;
-        XmNvalues = string_table(
-	compound_string(""));
-        XmNpositionType = XmPOSITION_VALUE;
-        XmNx = 2;
-        XmNy = 0;
-        XmNwidth = 200;
-        XmNheight = 40;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_spinText_arearoute_color);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object spinBox_arearoute_color : XmSpinBox widget {
-    arguments {
-        arguments Style_use;
-        XmNarrowLayout = XmARROWS_END;
-        XmNlayoutDirection = XmLEFT_TO_RIGHT;
-        XmNx = 240;
-        XmNy = 590;
-        XmNwidth = 230;
-        XmNheight = 40;
-    };
-    controls {
-         managed XmTextField spinText_arearoute_color;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_spinBox_arearoute_color);
-        XmNvalueChangedCallback = procedure do_mbgrdviz_arearoute_parameterchange();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object label_arearoute_name : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNlabelString = compound_string("Route Name:");
-        XmNx = 10;
-        XmNy = 560;
-        XmNwidth = 180;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object textField_arearoute_name : XmTextField widget {
-    arguments {
-        arguments Style_use;
-        XmNx = 10;
-        XmNy = 590;
-        XmNwidth = 200;
-        XmNheight = 40;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_textField_arearoute_name);
-        XmNvalueChangedCallback = procedure do_mbgrdviz_arearoute_parameterchange();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object spinText_arearoute_interleaving : XmTextField widget {
-    arguments {
-        arguments Style_use;
-        XmNcursorPositionVisible = false;
-        XmNvalue = "1";
-        XmNeditable = false;
-        XmNposition = 1;
-        XmNminimumValue = 1;
-        XmNspinBoxChildType = XmNUMERIC;
-        XmNnumValues = 0;
-        XmNvalues = string_table(
-	compound_string(""));
-        XmNpositionType = XmPOSITION_VALUE;
-        XmNx = 2;
-        XmNy = 5;
-        XmNwidth = 200;
-        XmNheight = 40;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_spinText_arearoute_interleaving);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object spinBox_arearoute_interleaving : XmSpinBox widget {
-    arguments {
-        arguments Style_use;
-        XmNarrowLayout = XmARROWS_END;
-        XmNlayoutDirection = XmLEFT_TO_RIGHT;
-        XmNx = 10;
-        XmNy = 510;
-        XmNwidth = 230;
-        XmNheight = 50;
-    };
-    controls {
-         managed XmTextField spinText_arearoute_interleaving;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_spinBox_arearoute_interleaving);
-        XmNvalueChangedCallback = procedure do_mbgrdviz_arearoute_parameterchange();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object label_arearoute_interleaving : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNlabelString = compound_string("Interleaving:");
-        XmNx = 10;
-        XmNy = 480;
-        XmNwidth = 220;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object bulletinBoard_arearoute : XmBulletinBoardDialog widget {
-    arguments {
-        arguments Style_use;
-        XmNdialogTitle = compound_string("Generate Survey Route for Select" &
- "ed Area...");
-        XmNautoUnmanage = false;
-        XmNresizePolicy = XmRESIZE_GROW;
-        XmNx = 1040;
-        XmNy = 991;
-        XmNwidth = 481;
-        XmNheight = 691;
-    };
-    controls {
-         managed XmLabel label_arearoute_interleaving;
-         managed XmSpinBox spinBox_arearoute_interleaving;
-         managed XmTextField textField_arearoute_name;
-         managed XmLabel label_arearoute_name;
-         managed XmSpinBox spinBox_arearoute_color;
-         managed XmLabel label_arearoute_color;
-         managed XmLabel label_arearoute_crosslines;
-         managed XmSpinBox spinBox_arearoute_crosslines;
-         managed XmLabel label_arearoute_depth;
-         managed XmLabel label_arearoute_altitude;
-         managed XmSpinBox spinBox_arearoute_altitude;
-         managed XmSpinBox spinBox_arearoute_depth;
-         managed XmSpinBox spinBox_arearoute_direction;
-         managed XmLabel label_arearoute_direction;
-         managed XmSpinBox spinBox_arearoute_swathwidth;
-         managed XmLabel label_arearoute_swathwidth;
-         managed XmLabel label_arearoute_platform;
-         managed XmSpinBox spinBox_arearoute_platform;
-         managed XmSpinBox spinBox_arearoute_linespacing;
-         managed XmLabel label_arearoute_crosslinesfirstlast;
-         managed XmSpinBox spinBox_arearoute_crosslinesfirstlast;
-         managed XmLabel label_arearoute_info;
-         managed XmSpinBox spinBox_arearoute_linecontrol;
-         managed XmLabel label_arearoute_linecontrol;
-         managed XmLabel label_arearoute_linespacing;
-         managed XmPushButton pushButton_arearoute_ok;
-         managed XmPushButton pushButton_arearoute_dismiss;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_bulletinBoard_arearoute);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-!(BX)object dialogShell_arearoute : XmDialogShell widget {
-!(BX)    arguments {
-!(BX)        arguments Style_use;
-!(BX)        XmNwidth = 481;
-!(BX)        XmNheight = 691;
-!(BX)    };
-!(BX)    controls {
-!(BX)         managed XmBulletinBoardDialog bulletinBoard_arearoute;
-!(BX)    };
-!(BX)    callbacks {
-!(BX)        callbacks Style_useReasons;
-!(BX)    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-!(BX)};
-
-object fileSelectionBox : XmFileSelectionDialog widget {
-    arguments {
-        arguments Style_use;
-        XmNautoUnmanage = true;
-        XmNpattern = compound_string("*grd");
-        XmNx = 0;
-        XmNy = 1084;
-        XmNwidth = 334;
-        XmNheight = 505;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_fileSelectionBox);
-        XmNokCallback = procedure do_mbgrdviz_openfile();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-!(BX)object dialogShell_open : XmDialogShell widget {
-!(BX)    arguments {
-!(BX)        arguments Style_use;
-!(BX)        XmNtitle = "Open GMT Grid File";
-!(BX)        XmNwidth = 334;
-!(BX)        XmNheight = 505;
-!(BX)    };
-!(BX)    controls {
-!(BX)         managed XmFileSelectionDialog fileSelectionBox;
-!(BX)    };
-!(BX)    callbacks {
-!(BX)        callbacks Style_useReasons;
-!(BX)        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_dialogShell_open);
-!(BX)    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-!(BX)};
-
-object pushButton_about_dismiss : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Dismiss");
-        XmNx = 170;
-        XmNy = 470;
-        XmNwidth = 120;
-        XmNheight = 50;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNactivateCallback = procedure BxUnmanageCB("bulletinBoard_about");
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object label_about_title : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNfontList = font_table(
-		font('-*-times-bold-r-*-*-*-180-*-*-*-*-iso8859-1',character_set=character_set('TimesBold18')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')));
-        XmNlabelString = compound_string(#character_set("TimesBold24")"MBg" &
- "rdviz") &
- compound_string("", separate=true) &
- compound_string(#character_set("TimesBold18")"Simple 3D Visualization ", separate=true) &
- compound_string(#character_set("TimesBold18")"of GMT Grids");
-        XmNx = 10;
-        XmNy = 10;
-        XmNwidth = 440;
-        XmNheight = 90;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object separator1 : XmSeparator widget {
-    arguments {
-        arguments Style_use;
-        XmNx = 10;
-        XmNy = 100;
-        XmNwidth = 440;
-        XmNheight = 20;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object label_about_mbsystem : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNfontList = font_table(
-		font('-*-times-bold-r-*-*-*-140-*-*-*-*-iso8859-1',character_set=character_set('TimesBold14')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')));
-        XmNlabelString = compound_string(#character_set("TimesBold14")"One" &
- " component of the", separate=true) &
- compound_string(#character_set("T" &
- "imesBold24")"MB-System") &
- compound_string(#character_set("TimesBold14")"", separate=true) &
- compound_string(#character_set("TimesBold14")"An open Source Software Package", separate=true) &
- compound_string(#character_set("TimesBold14")"for Processing and Display", separate=true) &
- compound_string(#character_set("TimesBold14")"of Swath Sonar Data");
-        XmNx = 10;
-        XmNy = 120;
-        XmNwidth = 440;
-        XmNheight = 140;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object separator3 : XmSeparator widget {
-    arguments {
-        arguments Style_use;
-        XmNx = 10;
-        XmNy = 260;
-        XmNwidth = 440;
-        XmNheight = 20;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object label_about_LDEO : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNfontList = font_table(
-		font('-*-times-bold-r-*-*-*-140-*-*-*-*-iso8859-1',character_set=character_set('TimesBold14')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-120-*-*-*-*-iso8859-1',character_set=character_set('TimesBold12')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-120-*-*-*-*-iso8859-1',character_set=character_set('TimesBold12')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-120-*-*-*-*-iso8859-1',character_set=character_set('TimesBold12')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-120-*-*-*-*-iso8859-1',character_set=character_set('TimesBold12')));
-        XmNlabelString = compound_string(#character_set("TimesBold12")"Lam" &
- "ont-Doherty", separate=true) &
- compound_string(#character_set("T" &
- "imesBold12")"Earth Observatory", separate=true) &
- compound_string(#character_set("TimesBold12")"of Columbia University");
-        XmNx = 230;
-        XmNy = 340;
-        XmNwidth = 180;
-        XmNheight = 80;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object label_about_MBARI : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNfontList = font_table(
-		font('-*-times-bold-r-*-*-*-140-*-*-*-*-iso8859-1',character_set=character_set('TimesBold14')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-120-*-*-*-*-iso8859-1',character_set=character_set('TimesBold12')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-120-*-*-*-*-iso8859-1',character_set=character_set('TimesBold12')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-120-*-*-*-*-iso8859-1',character_set=character_set('TimesBold12')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-120-*-*-*-*-iso8859-1',character_set=character_set('TimesBold12')));
-        XmNlabelString = compound_string(#character_set("TimesBold12")"Mon" &
- "terey Bay", separate=true) &
- compound_string(#character_set("T" &
- "imesBold12")"Aquarium", separate=true) &
- compound_string(#character_set("TimesBold12")"Research Institute");
-        XmNx = 70;
-        XmNy = 340;
-        XmNwidth = 140;
-        XmNheight = 80;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object label_about_authors : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNfontList = font_table(
-		font('-*-times-bold-r-*-*-*-140-*-*-*-*-iso8859-1',character_set=character_set('TimesBold14')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-120-*-*-*-*-iso8859-1',character_set=character_set('TimesBold12')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-120-*-*-*-*-iso8859-1',character_set=character_set('TimesBold12')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-120-*-*-*-*-iso8859-1',character_set=character_set('TimesBold12')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-120-*-*-*-*-iso8859-1',character_set=character_set('TimesBold12')));
-        XmNlabelString = compound_string(#character_set("TimesBold14")"Cre" &
- "ated By:", separate=true) &
- compound_string(#character_set("T" &
- "imesBold14")"David W. Caress   and   Dale N. Chayes ");
-        XmNx = 10;
-        XmNy = 280;
-        XmNwidth = 440;
-        XmNheight = 60;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object label_about_version : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNfontList = font_table(
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-120-*-*-*-*-iso8859-1',character_set=character_set('TimesBold12')),
-		font('-*-times-bold-r-*-*-*-140-*-*-*-*-iso8859-1',character_set=character_set('TimesBold14')),
-		font('-*-times-medium-r-*-*-*-140-*-*-*-*-iso8859-1',character_set=character_set('TimesMedium14')),
-		font('-*-times-bold-r-*-*-*-120-*-*-*-*-iso8859-1',character_set=character_set('TimesBold12')),
-		font('-*-times-bold-r-*-*-*-140-*-*-*-*-iso8859-1',character_set=character_set('TimesBold14')),
-		font('-*-times-medium-r-*-*-*-140-*-*-*-*-iso8859-1',character_set=character_set('TimesMedium14')),
-		font('-*-times-bold-r-*-*-*-120-*-*-*-*-iso8859-1',character_set=character_set('TimesBold12')),
-		font('-*-times-bold-r-*-*-*-140-*-*-*-*-iso8859-1',character_set=character_set('TimesBold14')),
-		font('-*-times-medium-r-*-*-*-140-*-*-*-*-iso8859-1',character_set=character_set('TimesMedium14')),
-		font('-*-times-bold-r-*-*-*-120-*-*-*-*-iso8859-1',character_set=character_set('TimesBold12')),
-		font('-*-times-bold-r-*-*-*-140-*-*-*-*-iso8859-1',character_set=character_set('TimesBold14')),
-		font('-*-times-medium-r-*-*-*-140-*-*-*-*-iso8859-1',character_set=character_set('TimesMedium14')));
-        XmNlabelString = compound_string(#character_set("TimesMedium14")"M" &
- "B-System Release 5.0.8", separate=true) &
- compound_string(#character_set("T" &
- "imesMedium14")"February 2, 2006");
-        XmNrecomputeSize = false;
-        XmNx = 10;
-        XmNy = 410;
-        XmNwidth = 440;
-        XmNheight = 50;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_label_about_version);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object bulletinBoard_about : XmBulletinBoardDialog widget {
-    arguments {
-        arguments Style_use;
-        XmNresizePolicy = XmRESIZE_GROW;
-        XmNx = 0;
-        XmNy = 1071;
-        XmNwidth = 463;
-        XmNheight = 531;
-    };
-    controls {
-         managed XmLabel label_about_version;
-         managed XmLabel label_about_authors;
-         managed XmLabel label_about_MBARI;
-         managed XmLabel label_about_LDEO;
-         managed XmSeparator separator3;
-         managed XmLabel label_about_mbsystem;
-         managed XmSeparator separator1;
-         managed XmLabel label_about_title;
-         managed XmPushButton pushButton_about_dismiss;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-!(BX)object dialogShell_about : XmDialogShell widget {
-!(BX)    arguments {
-!(BX)        arguments Style_use;
-!(BX)        XmNtitle = "About MBgrdviz...";
-!(BX)        XmNwidth = 463;
-!(BX)        XmNheight = 531;
-!(BX)    };
-!(BX)    controls {
-!(BX)         managed XmBulletinBoardDialog bulletinBoard_about;
-!(BX)    };
-!(BX)    callbacks {
-!(BX)        callbacks Style_useReasons;
-!(BX)    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-!(BX)};
-
-object bulletinBoard_mbgrdviz : XmBulletinBoard widget {
-    arguments {
-        arguments Style_use;
-        XmNresizePolicy = XmRESIZE_GROW;
-        XmNwidth = 260;
-        XmNheight = 181;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object pushButton_file_openprimary : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Open Primary Grid");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_pushButton_file_openprimary);
-        XmNactivateCallback = procedure do_mbgrdviz_fileSelectionBox(0);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object separator : XmSeparator widget {
-    arguments {
-        arguments Style_use;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object pushButton_opensite : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Open Site");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_pushButton_opensite);
-        XmNactivateCallback = procedure do_mbgrdviz_fileSelectionBox_opensite();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object pushButton_openroute : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Open Route");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_pushButton_openroute);
-        XmNactivateCallback = procedure do_mbgrdviz_fileSelectionBox_openroute();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object pushButton_opennav : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Open Navigation");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_pushButton_opennav);
-        XmNactivateCallback = procedure do_mbgrdviz_fileSelectionBox_opennav();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object pushButton_openswath : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Open Swath");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_pushButton_openswath);
-        XmNactivateCallback = procedure do_mbgrdviz_fileSelectionBox_openswath();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object pushButton_openvector : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Open Vector");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_pushButton_openvector);
-        XmNactivateCallback = procedure do_mbgrdviz_fileSelectionBox_openvector();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object pushButton_savesite : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Save Site");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_pushButton_savesite);
-        XmNactivateCallback = procedure do_mbgrdviz_fileSelectionBox_savesite();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object pushButton_saveroute : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Save Route");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_pushButton_saveroute);
-        XmNactivateCallback = procedure do_mbgrdviz_fileSelectionBox_saveroute();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object separator2 : XmSeparator widget {
-    arguments {
-    };
-    controls {
-    };
-    callbacks {
-    };
-};
-
-object pushButton_quit : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Quit");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-       XmNactivateCallback = procedures {
-                 do_mbgrdviz_quit();
-                 BxExitCB(0);
-        };
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object pulldownMenu_file : XmPulldownMenu widget {
-    arguments {
-        arguments Style_use;
-        XmNx = 113;
-        XmNy = 292;
-        XmNwidth = 142;
-        XmNheight = 224;
-    };
-    controls {
-         managed XmPushButton pushButton_file_openprimary;
-         managed XmSeparator separator;
-         managed XmPushButton pushButton_opensite;
-         managed XmPushButton pushButton_openroute;
-         managed XmPushButton pushButton_opennav;
-         managed XmPushButton pushButton_openswath;
-         managed XmPushButton pushButton_openvector;
-         managed XmPushButton pushButton_savesite;
-         managed XmPushButton pushButton_saveroute;
-         managed XmSeparator separator2;
-         managed XmPushButton pushButton_quit;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object cascadeButton_file : XmCascadeButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("File");
-        XmNx = 5;
-        XmNy = 5;
-        XmNwidth = 41;
-        XmNheight = 24;
-    };
-    controls {
-         unmanaged XmPulldownMenu pulldownMenu_file;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object pushButton_help_about : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("About");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNactivateCallback = procedure BxManageCB("bulletinBoard_about");
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object pulldownMenu_help : XmPulldownMenu widget {
-    arguments {
-        arguments Style_use;
-        XmNx = 0;
-        XmNy = 0;
-        XmNwidth = 54;
-        XmNheight = 28;
-    };
-    controls {
-         managed XmPushButton pushButton_help_about;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object cascadeButton_help : XmCascadeButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Help");
-        XmNx = 208;
-        XmNy = 5;
-        XmNwidth = 47;
-        XmNheight = 24;
-    };
-    controls {
-         unmanaged XmPulldownMenu pulldownMenu_help;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object pushButton_realtime_setup : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNsensitive = false;
-        XmNlabelString = compound_string("Setup");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_pushButton_realtime_setup);
-        XmNactivateCallback = procedure BxManageCB("form_realtime_setup");
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object pushButton_realtime_start : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNsensitive = false;
-        XmNlabelString = compound_string("Start");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_pushButton_realtime_start);
-        XmNactivateCallback = procedure do_mbgrdviz_realtime_start();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object pushButton_realtime_stop : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNsensitive = false;
-        XmNlabelString = compound_string("Stop");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_pushButton_realtime_stop);
-        XmNactivateCallback = procedure do_mbgrdviz_realtime_stop();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object pushButton_realtime_pause : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNsensitive = false;
-        XmNlabelString = compound_string("Pause");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_pushButton_realtime_pause);
-        XmNactivateCallback = procedure do_mbgrdviz_realtime_pause();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object pushButton_realtime_resume : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNsensitive = false;
-        XmNlabelString = compound_string("Resume");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_pushButton_realtime_resume);
-        XmNactivateCallback = procedure do_mbgrdviz_realtime_resume();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object pulldownMenu_realtime : XmPulldownMenu widget {
-    arguments {
-        arguments Style_use;
-        XmNx = 0;
-        XmNy = 0;
-        XmNwidth = 68;
-        XmNheight = 124;
-    };
-    controls {
-         managed XmPushButton pushButton_realtime_setup;
-         managed XmPushButton pushButton_realtime_start;
-         managed XmPushButton pushButton_realtime_stop;
-         managed XmPushButton pushButton_realtime_pause;
-         managed XmPushButton pushButton_realtime_resume;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object cascadeButton_realtime : XmCascadeButton widget {
-    arguments {
-        arguments Style_use;
-        XmNsensitive = false;
-        XmNlabelString = compound_string("Realtime");
-        XmNx = 46;
-        XmNy = 5;
-        XmNwidth = 76;
-        XmNheight = 24;
-    };
-    controls {
-         unmanaged XmPulldownMenu pulldownMenu_realtime;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object menuBar_mbgrdviz : XmMenuBar widget {
-    arguments {
-        arguments Style_use;
-        XmNpacking = XmPACK_TIGHT;
-        XmNmenuHelpWidget = XmCascadeButton cascadeButton_help;
-        XmNwidth = 260;
-        XmNheight = 34;
-    };
-    controls {
-         managed XmCascadeButton cascadeButton_file;
-         managed XmCascadeButton cascadeButton_help;
-         managed XmCascadeButton cascadeButton_realtime;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mainWindow_mbgrdviz : XmMainWindow widget {
-    arguments {
-        arguments Style_use;
-        XmNx = 108;
-        XmNy = 263;
-        XmNwidth = 260;
-        XmNheight = 215;
-    };
-    controls {
-        Xm_Separator1 {
-            arguments {
-                arguments Style_use;
-            };
-            callbacks {
-                    callbacks Style_useReasons;
-            };
-!(BX)            handlers {
-!(BX)                handlers Style_useHandlers;
-!(BX)            };
-        };
-        Xm_Separator2 {
-            arguments {
-                arguments Style_use;
-            };
-            callbacks {
-                    callbacks Style_useReasons;
-            };
-!(BX)            handlers {
-!(BX)                handlers Style_useHandlers;
-!(BX)            };
-        };
-        Xm_Separator3 {
-            arguments {
-                arguments Style_use;
-            };
-            callbacks {
-                    callbacks Style_useReasons;
-            };
-!(BX)            handlers {
-!(BX)                handlers Style_useHandlers;
-!(BX)            };
-        };
-!(BX)         unmanaged XmDialogShell dialogShell_realtimesetup;
-!(BX)         unmanaged XmDialogShell dialogShell_arearoute;
-!(BX)         unmanaged XmDialogShell dialogShell_open;
-!(BX)         unmanaged XmDialogShell dialogShell_about;
-         managed XmBulletinBoard bulletinBoard_mbgrdviz;
-         managed XmMenuBar menuBar_mbgrdviz;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-!(BX)object topLevelShell : TopLevelShell widget {
-!(BX)    arguments {
-!(BX)        arguments Style_use;
-!(BX)        XmNtitle = "MBgrdviz";
-!(BX)        XmNx = 108;
-!(BX)        XmNy = 241;
-!(BX)        XmNwidth = 260;
-!(BX)        XmNheight = 215;
-!(BX)    };
-!(BX)    controls {
-!(BX)         managed XmMainWindow mainWindow_mbgrdviz;
-!(BX)    };
-!(BX)    callbacks {
-!(BX)        callbacks Style_useReasons;
-!(BX)       XmNdestroyCallback = procedures {
-!(BX)                 do_mbgrdviz_quit();
-!(BX)                 BxExitCB(0);
-!(BX)        };
-!(BX)    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-!(BX)};
-end module;
diff --git a/src/mbgrdviz/mbgrdviz_callbacks.c b/src/mbgrdviz/mbgrdviz_callbacks.c
deleted file mode 100644
index 29cac02..0000000
--- a/src/mbgrdviz/mbgrdviz_callbacks.c
+++ /dev/null
@@ -1,7499 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbgrdviz_callbacks.c		10/9/2002
- *    $Id: mbgrdviz_callbacks.c 2251 2015-07-01 01:02:06Z caress $
- *
- *    Copyright (c) 2002-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * README: This file is appended to at file generation time.
- * Edits can be made throughout the file
- */
-/*
- * Generated by the ICS Builder Xcessory (BX).
- *
- * Builder Xcessory Version 5.0.3
- * Code Generator Xcessory 5.0.1 (09/29/98)
- *
- */
-#include <Xm/Xm.h>
-
-
-/*
- * Standard includes for builtins.
- */
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <string.h>
-#include <ctype.h>
-#include <math.h>
-#include <time.h>
-
-/* MBIO include files */
-#include "mb_status.h"
-#include "mb_define.h"
-#include "mb_format.h"
-#include "mb_aux.h"
-#include "mbsys_singlebeam.h"
-
-/* mbview include file */
-#include "mbview.h"
-
-#ifndef SANS
-#define SANS "helvetica"
-#endif
-#ifndef SERIF
-#define SERIF "times"
-#endif
-#ifndef MONO
-#define MONO "courier"
-#endif
-
-/* fileSelectionBox modes */
-#define MBGRDVIZ_OPENGRID		0
-#define MBGRDVIZ_OPENOVERLAY		1
-#define MBGRDVIZ_OPENSITE		2
-#define MBGRDVIZ_OPENROUTE		3
-#define MBGRDVIZ_OPENVECTOR		4
-#define MBGRDVIZ_OPENNAV		5
-#define MBGRDVIZ_OPENSWATH		6
-#define MBGRDVIZ_SAVEROUTE		7
-#define MBGRDVIZ_SAVERISISCRIPT		8
-#define MBGRDVIZ_SAVEWINFROGPTS		9
-#define MBGRDVIZ_SAVEWINFROGWPT		10
-#define MBGRDVIZ_SAVEDEGDECMIN		11
-#define MBGRDVIZ_SAVELNW		12
-#define MBGRDVIZ_SAVESITE		13
-#define MBGRDVIZ_SAVEPROFILE		14
-#define MBGRDVIZ_REALTIME		15
-
-/* Projection defines */
-#define ModelTypeProjected	     1
-#define ModelTypeGeographic	     2
-#define GCS_WGS_84		  4326
-
-/* Site and route file versions */
-#define MBGRDVIZ_SITE_VERSION "1.00"
-#define MBGRDVIZ_ROUTE_VERSION "1.00"
-#define MBGRDVIZ_PROFILE_VERSION "1.00"
-#define MBGRDVIZ_RISISCRIPT_VERSION "1.00"
-
-/* Survey planning parameters */
-#define MBGRDVIZ_SURVEY_MODE_UNIFORM			0
-#define MBGRDVIZ_SURVEY_MODE_VARIABLE			1
-#define MBGRDVIZ_SURVEY_PLATFORM_SURFACE		0
-#define MBGRDVIZ_SURVEY_PLATFORM_SUBMERGED_ALTITUDE	1
-#define MBGRDVIZ_SURVEY_PLATFORM_SUBMERGED_DEPTH	2
-#define MBGRDVIZ_SURVEY_DIRECTION_SW			0
-#define MBGRDVIZ_SURVEY_DIRECTION_SE			1
-#define MBGRDVIZ_SURVEY_DIRECTION_NW			2
-#define MBGRDVIZ_SURVEY_DIRECTION_NE			3
-#define	MBGRDVIZ_REALTIME_ICON_SHIP			0
-#define	MBGRDVIZ_REALTIME_ICON_ROV			1
-#define	MBGRDVIZ_REALTIME_ICON_AUV			2
-#define	MBGRDVIZ_REALTIME_OFF				0
-#define	MBGRDVIZ_REALTIME_ON				1
-#define	MBGRDVIZ_REALTIME_PAUSE				2
-static int	working_route = -1;
-static int	survey_instance = 0;
-static int	survey_mode = MBGRDVIZ_SURVEY_MODE_UNIFORM;
-static int	survey_platform = MBGRDVIZ_SURVEY_PLATFORM_SUBMERGED_ALTITUDE;
-static int	survey_interleaving = 1;
-static int	survey_direction = MBGRDVIZ_SURVEY_DIRECTION_SW;
-static int	survey_crosslines_last = MB_NO;
-static int	survey_crosslines = 0;
-static int	survey_linespacing = 200;
-static int	survey_swathwidth = 120;
-static int	survey_depth = 0;
-static int	survey_altitude = 150;
-static int	survey_color = MBV_COLOR_BLACK;
-static char	survey_name[MB_PATH_MAXLINE];
-
-/* id variables */
-static char rcs_id[] = "$Id: mbgrdviz_callbacks.c 2251 2015-07-01 01:02:06Z caress $";
-static char program_name[] = "MBgrdviz";
-
-/* status variables */
-static int	verbose;
-static int	error;
-static int	pargc;
-static char	**pargv;
-
-/* widgets */
-static int	mbview_id[MBV_MAX_WINDOWS];
-extern 	Widget mainWindow;
-static Widget	fileSelectionList;
-static Widget	fileSelectionText;
-
-/* function prototypes */
-int do_mbgrdviz_init(int argc, char **argv, int verbosity);
-void do_mbgrdviz_sensitivity(void);
-int do_mbgrdviz_dismiss_notify(size_t instance);
-void do_mbgrdviz_fileSelectionBox( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbgrdviz_fileSelectionBox_openoverlay( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbgrdviz_fileSelectionBox_openroute( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbgrdviz_fileSelectionBox_openvector( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbgrdviz_fileSelectionBox_opensite( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbgrdviz_fileSelectionBox_opennav( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbgrdviz_fileSelectionBox_openswath( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbgrdviz_fileSelectionBox_saveroute( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbgrdviz_fileSelectionBox_saverisiscript( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbgrdviz_fileSelectionBox_savewinfrogpts( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbgrdviz_fileSelectionBox_savewinfrogwpt( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbgrdviz_fileSelectionBox_savedegdecmin( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbgrdviz_fileSelectionBox_savelnw( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbgrdviz_fileSelectionBox_saveprofile( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbgrdviz_fileSelectionBox_realtime( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbgrdviz_fileSelectionBox_savesite( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbgrdviz_openfile( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbgrdviz_close( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbgrdviz_quit( Widget w, XtPointer client_data, XtPointer call_data);
-int do_mbgrdviz_openprimary(char *input_file_ptr);
-int do_mbgrdviz_openoverlay(size_t instance, char *input_file_ptr);
-int do_mbgrdviz_opensite(size_t instance, char *input_file_ptr);
-int do_mbgrdviz_savesite(size_t instance, char *output_file_ptr);
-int do_mbgrdviz_openroute(size_t instance, char *input_file_ptr);
-int do_mbgrdviz_saveroute(size_t instance, char *output_file_ptr);
-int do_mbgrdviz_openvector(size_t instance, char *input_file_ptr);
-int do_mbgrdviz_saverisiscript(size_t instance, char *output_file_ptr);
-int do_mbgrdviz_savewinfrogpts(size_t instance, char *output_file_ptr);
-int do_mbgrdviz_savewinfrogwpt(size_t instance, char *output_file_ptr);
-int do_mbgrdviz_savedegdecmin(size_t instance, char *output_file_ptr);
-int do_mbgrdviz_savelnw(size_t instance, char *output_file_ptr);
-int do_mbgrdviz_saveprofile(size_t instance, char *output_file_ptr);
-int do_mbgrdviz_opennav(size_t instance, int swathbounds, char *input_file_ptr);
-int do_mbgrdviz_readnav(size_t instance, char *swathfile,
-				int pathstatus, char *pathraw, char *pathprocessed,
-				int format, int formatorg, double weight, int *error);
-int do_mbgrdviz_readgrd(size_t instance, char *grdfile,
-			int	*grid_projection_mode,
-			char	*grid_projection_id,
-			float	*nodatavalue,
-			int	*nxy,
-			int	*nx,
-			int	*ny,
-			double	*min,
-			double	*max,
-			double	*xmin,
-			double	*xmax,
-			double	*ymin,
-			double	*ymax,
-			double	*dx,
-			double	*dy,
-			float	**data);
-int do_mbgrdviz_opentest(size_t instance,
-			double	factor1,
-			double	factor2,
-			double	factor3,
-			int	*grid_projection_mode,
-			char	*grid_projection_id,
-			float	*nodatavalue,
-			int	*nxy,
-			int	*nx,
-			int	*ny,
-			double	*min,
-			double	*max,
-			double	*xmin,
-			double	*xmax,
-			double	*ymin,
-			double	*ymax,
-			double	*dx,
-			double	*dy,
-			float	**data);
-void do_mbgrdviz_open_region( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbgrdviz_open_mbedit( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbgrdviz_open_mbeditviz( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbgrdviz_open_mbnavedit( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbgrdviz_open_mbvelocitytool( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbgrdviz_make_survey( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbgrdviz_generate_survey( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbgrdviz_arearoute_dismiss( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbgrdviz_arearoute_parameterchange( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbgrdviz_arearoute_recalc(size_t instance);
-void do_mbgrdviz_arearoute_info(size_t instance);
-void do_mbgrdviz_arearoute_linespacing_increment( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbgrdviz_arearoute_altitude_increment( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbgrdviz_arearoute_depth_increment( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbgrdviz_realtime_start( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbgrdviz_realtimesetup_path_reset( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbgrdviz_realtime_pause( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbgrdviz_realtime_stop( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbgrdviz_realtime_resume( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbgrdviz_realtimesetup_path_apply( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbgrdviz_realtimesetup_icon( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbgrdviz_realtimesetup_path_browse( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbgrdviz_realtimesetup_updaterate( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbgrdviz_realtimesetup_path_test( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbgrdviz_realtimesetup_pathmode( Widget w, XtPointer client_data, XtPointer call_data);
-
-void BxUnmanageCB(Widget w, XtPointer client, XtPointer call);
-void BxManageCB(Widget w, XtPointer client, XtPointer call);
-void BxPopupCB(Widget w, XtPointer client, XtPointer call);
-void BxPopdownCB(Widget w, XtPointer client, XtPointer call);
-XtPointer BX_CONVERT(Widget w, char *from_string, char *to_type, int to_size, Boolean *success);
-void BxExitCB(Widget w, XtPointer client, XtPointer call);
-void BxSetValuesCB(Widget w, XtPointer client, XtPointer call);
-
-/*
- * Motif required Headers
- */
-#include <X11/StringDefs.h>
-#include <Xm/Xm.h>
-#include <Xm/DialogS.h>
-#include <Xm/Text.h>
-#include <Xm/FileSB.h>
-#if (XmVersion >= 1002)
-#include <Xm/RepType.h>
-#endif
-#include <Xm/MwmUtil.h>
-#include "mbgrdviz_creation.h"
-
-/*
- * Macros to make code look nicer between ANSI and K&R.
- */
-#ifndef ARGLIST
-#if (NeedFunctionPrototypes == 0)
-#define PROTOTYPE(p)	()
-#define ARGLIST(p)	p
-#define ARG(a, b)	a b;
-#define GRA(a, b)	a b;
-#define UARG(a, b)      a b;
-#define GRAU(a, b)      a b;
-#else
-#define PROTOTYPE(p)	p
-#define ARGLIST(p)	(
-#define ARG(a, b)	a b,
-#define GRA(a, b)	a b)
-#ifdef __cplusplus
-#define UARG(a, b)      a,
-#define GRAU(a, b)      a)
-#else
-#define UARG(a, b)      a b,
-#define GRAU(a, b)      a b)
-#endif
-#endif
-#endif
-
-Widget		BxFindTopShell PROTOTYPE((Widget));
-WidgetList	BxWidgetIdsFromNames PROTOTYPE((Widget, char*, char*));
-
-
-/*      Function Name:	BxExitCB
- *
- *      Description:   	This functions expects an integer to be passed in
- *		       	client data.  It calls the exit() system call with
- *			the integer value as the argument to the function.
- *
- *      Arguments:      Widget		w: 	the activating widget.
- *			XtPointer	client:	the integer exit value.
- *			XtPointer	call:	the call data (unused).
- */
-
-#ifdef VMS
-#include <stdlib.h>
-#endif
-
-/* ARGSUSED */
-void
-BxExitCB ARGLIST((w, client, call))
-UARG( Widget, w)
-ARG( XtPointer, client)
-GRAU( XtPointer, call)
-{
-    long	exitValue = EXIT_FAILURE;
-    exit(exitValue);
-}
-
-/*      Function Name: 	BxManageCB
- *
- *      Description:   	Given a string of the form:
- *		       	"(WL)[widgetName, widgetName, ...]"
- *			BxManageCB attempts to convert the name to a Widget
- *			ID and manage the widget.
- *
- *      Arguments:     	Widget	    w:      the widget activating the callback.
- *		       	XtPointer   client: the list of widget names to attempt
- *					    to find and manage.
- *		       	XtPointer   call:   the call data (unused).
- *
- *      Notes:        *	This function expects that there is an application
- *		       	shell from which all other widgets are descended.
- */
-
-/* ARGSUSED */
-void
-BxManageCB ARGLIST((w, client, call))
-ARG( Widget, w)
-ARG( XtPointer, client)
-GRAU( XtPointer, call)
-{
-    WidgetList		widgets;
-    int			i;
-
-    /*
-     * This function returns a NULL terminated WidgetList.  The memory for
-     * the list needs to be freed when it is no longer needed.
-     */
-    widgets = BxWidgetIdsFromNames(w, "BxManageCB", (String)client);
-
-    i = 0;
-    while( widgets && widgets[i] != NULL )
-    {
-	XtManageChild(widgets[i]);
-	i++;
-    }
-    XtFree((char *)widgets);
-}
-
-/*      Function Name: 	BxUnmanageCB
- *
- *      Description:   	Given a string of the form:
- *		       	"(WL)[widgetName, widgetName, ...]"
- *			BxUnmanageCB attempts to convert the name to a Widget
- *			ID and unmanage the widget.
- *
- *      Arguments:     	Widget	    w:      the widget activating the callback.
- *		       	XtPointer   client: the list of widget names to attempt
- *					    to find and unmanage.
- *		       	XtPointer   call:   the call data (unused).
- *
- *      Notes:        *	This function expects that there is an application
- *		       	shell from which all other widgets are descended.
- */
-
-/* ARGSUSED */
-void
-BxUnmanageCB ARGLIST((w, client, call))
-ARG( Widget, w)
-ARG( XtPointer, client)
-GRAU( XtPointer, call)
-{
-    WidgetList		widgets;
-    int			i;
-
-    /*
-     * This function returns a NULL terminated WidgetList.  The memory for
-     * the list needs to be freed when it is no longer needed.
-     */
-    widgets = BxWidgetIdsFromNames(w, "BxUnmanageCB", (String)client);
-
-    i = 0;
-    while( widgets && widgets[i] != NULL )
-    {
-	XtUnmanageChild(widgets[i]);
-	i++;
-    }
-    XtFree((char *)widgets);
-}
-/*      Function Name:	BxPopdownCB
- *
- *      Description:   	This function accepts a string of the form:
- *			"(WL)[widgetName, widgetName, ...]"
- *			It attempts to convert the widget names to Widget IDs
- *			and then popdown the widgets WITHOUT any grab.
- *
- *      Arguments:      Widget		w:	the activating widget.
- *			XtPointer	client:	the string of widget names to
- *						popup.
- *			XtPointer	call:	the call data (unused).
- *
- *      Notes:        * This function expects that there is an application
- *                      shell from which all other widgets are descended.
- *		      * BxPopdownCB can only work on Shell widgets.  It will
- *			not work on other object types.  This is because
- *			popping down can only be done to a shell.  A check
- *			is made using XtIsShell() and an appropriate error
- *			is output if the passed object is not a Shell.
- */
-
-/* ARGSUSED */
-void
-BxPopdownCB ARGLIST((w, client, call))
-ARG( Widget, w)
-ARG( XtPointer, client)
-GRAU( XtPointer, call)
-{
-    WidgetList		widgets;
-    int			i;
-
-    /*
-     * This function returns a NULL terminated WidgetList.  The memory for
-     * the list needs to be freed when it is no longer needed.
-     */
-    widgets = BxWidgetIdsFromNames(w, "BxPopdownCB", (String)client);
-
-    i = 0;
-    while ( widgets && widgets[i] != NULL )
-    {
-	if ( XtIsShell(widgets[i]) )
-	{
-	    XtPopdown(widgets[i]);
-	}
-	else
-	{
-	    printf("Callback Error (BxPopdownCB):\n\t\
-Object %s is not a Shell\n", XtName(widgets[i]));
-	}
-	i++;
-    }
-    XtFree((char *)widgets);
-}
-
-/*      Function Name:	BxPopupCB
- *
- *      Description:   	This function accepts a string of the form:
- *			"(WL)[widgetName, widgetName, ...]"
- *			It attempts to convert the widget names to Widget IDs
- *			and then popup the widgets WITHOUT any grab.
- *
- *      Arguments:      Widget		w:	the activating widget.
- *			XtPointer	client:	the string of widget names to
- *						popup.
- *			XtPointer	call:	the call data (unused).
- *
- *      Notes:        * This function expects that there is an application
- *                      shell from which all other widgets are descended.
- *		      * BxPopupCB can only work on Shell widgets.  It will not
- *			work on other object types.  This is because popping up
- *			can only be done to a shell.  A check is made using
- *			XtIsShell() and an appropriate error is output if the
- *			passed object is not a Shell.
- */
-
-/* ARGSUSED */
-void
-BxPopupCB ARGLIST((w, client, call))
-ARG( Widget, w)
-ARG( XtPointer, client)
-GRAU( XtPointer, call)
-{
-    WidgetList		widgets;
-    int			i;
-
-    /*
-     * This function returns a NULL terminated WidgetList.  The memory for
-     * the list needs to be freed when it is no longer needed.
-     */
-    widgets = BxWidgetIdsFromNames(w, "BxPopupCB", (String)client);
-
-    i = 0;
-    while( widgets && widgets[i] != NULL )
-    {
-	if ( XtIsShell(widgets[i]) )
-	{
-	    XtPopup(widgets[i], XtGrabNone);
-	}
-	else
-	{
-	    printf("Callback Error (BxPopupCB):\n\t\
-Object %s is not a Shell\n", XtName(widgets[i]));
-	}
-	i++;
-    }
-    XtFree((char *)widgets);
-}
-/*---------------------------------------------------------------------------------------*/
-
-int do_mbgrdviz_init(int argc, char **argv, int verbosity)
-{
-	char function_name[] = "do_mbgrdviz_init";
-        Cardinal ac = 0;
-        Arg      args[256];
-	char	value_text[MB_PATH_MAXLINE];
-	XmStringTable	str_list;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       argc:           %d\n",argc);
-		fprintf(stderr,"dbg2       argv:\n");
-		for (i=0;i<argc;i++)
-			fprintf(stderr,"dbg2       argv[%d]:    %s\n",i,argv[i]);
-		fprintf(stderr,"dbg2       verbosity:   %d\n",verbosity);
-		}
-
-	pargc = 1;
-	pargv = argv;
-	verbose = verbosity;
-	error = MB_ERROR_NO_ERROR;
-
-	/* set about version label */
-	sprintf(value_text, "::#TimesMedium14:t\"MB-System Release %s\"#TimesMedium14\"%s\"",
-		MB_VERSION, MB_BUILD_DATE);
-	set_mbview_label_multiline_string(label_about_version, value_text);
-
-	/* get additional widgets */
-	fileSelectionList = (Widget)
-	    XmFileSelectionBoxGetChild(fileSelectionBox,
-					XmDIALOG_LIST);
-	fileSelectionText = (Widget)
-	    XmFileSelectionBoxGetChild(fileSelectionBox,
-					XmDIALOG_TEXT);
-	XtUnmanageChild(
-		(Widget) XmFileSelectionBoxGetChild(
-					fileSelectionBox,
-					XmDIALOG_HELP_BUTTON));
-
-	/* set up survey planning widgets */
-
-	/* set up line control */
-	str_list = (XmStringTable) XtMalloc(2 * sizeof(XmString *));
-	str_list[0] = XmStringCreateLocalized("Uniform");
-	str_list[1] = XmStringCreateLocalized("Variable by Swath Width");
-	ac = 0;
-	XtSetArg(args[ac], XmNnumValues, 2); ac++;
-	XtSetArg(args[ac], XmNvalues, str_list); ac++;
-	XtSetValues(spinText_arearoute_linecontrol, args, ac);
-	XmStringFree(str_list[0]);
-	XmStringFree(str_list[1]);
-	XtFree((XtPointer)str_list);
-
-	/* set up platform type */
-	str_list = (XmStringTable) XtMalloc(3 * sizeof(XmString *));
-	str_list[0] = XmStringCreateLocalized("Surface Vessel");
-	str_list[1] = XmStringCreateLocalized("Submerged - constant altitude");
-	str_list[2] = XmStringCreateLocalized("Submerged - constant depth");
-	ac = 0;
-	XtSetArg(args[ac], XmNnumValues, 3); ac++;
-	XtSetArg(args[ac], XmNvalues, str_list); ac++;
-	XtSetValues(spinText_arearoute_platform, args, ac);
-	XmStringFree(str_list[0]);
-	XmStringFree(str_list[1]);
-	XmStringFree(str_list[2]);
-	XtFree((XtPointer)str_list);
-
-	/* set up crosslinesfirstlast type */
-	str_list = (XmStringTable) XtMalloc(2 * sizeof(XmString *));
-	str_list[0] = XmStringCreateLocalized("Crosslines first");
-	str_list[1] = XmStringCreateLocalized("Crosslines last");
-	ac = 0;
-	XtSetArg(args[ac], XmNnumValues, 2); ac++;
-	XtSetArg(args[ac], XmNvalues, str_list); ac++;
-	XtSetValues(spinText_arearoute_crosslinesfirstlast, args, ac);
-	XmStringFree(str_list[0]);
-	XmStringFree(str_list[1]);
-	XtFree((XtPointer)str_list);
-
-	/* set up survey direction */
-	str_list = (XmStringTable) XtMalloc(4 * sizeof(XmString *));
-	str_list[0] = XmStringCreateLocalized("SW");
-	str_list[1] = XmStringCreateLocalized("SE");
-	str_list[2] = XmStringCreateLocalized("NW");
-	str_list[3] = XmStringCreateLocalized("NE");
-	ac = 0;
-	XtSetArg(args[ac], XmNnumValues, 4); ac++;
-	XtSetArg(args[ac], XmNvalues, str_list); ac++;
-	XtSetValues(spinText_arearoute_direction, args, ac);
-	XmStringFree(str_list[0]);
-	XmStringFree(str_list[1]);
-	XmStringFree(str_list[2]);
-	XmStringFree(str_list[3]);
-	XtFree((XtPointer)str_list);
-
-	/* set up survey color */
-	str_list = (XmStringTable) XtMalloc(6 * sizeof(XmString *));
-	str_list[0] = XmStringCreateLocalized("Black");
-	str_list[1] = XmStringCreateLocalized("Yellow");
-	str_list[2] = XmStringCreateLocalized("Green");
-	str_list[3] = XmStringCreateLocalized("Bluegreen");
-	str_list[4] = XmStringCreateLocalized("Blue");
-	str_list[5] = XmStringCreateLocalized("Purple");
-	ac = 0;
-	XtSetArg(args[ac], XmNnumValues, 6); ac++;
-	XtSetArg(args[ac], XmNvalues, str_list); ac++;
-	XtSetValues(spinText_arearoute_color, args, ac);
-	XmStringFree(str_list[0]);
-	XmStringFree(str_list[1]);
-	XmStringFree(str_list[2]);
-	XmStringFree(str_list[3]);
-	XmStringFree(str_list[4]);
-	XmStringFree(str_list[5]);
-	XtFree((XtPointer)str_list);
-
-	/* set up realtime control widgets */
-
-	/* set up realtime display icon */
-	str_list = (XmStringTable) XtMalloc(3 * sizeof(XmString *));
-	str_list[0] = XmStringCreateLocalized("Ship");
-	str_list[1] = XmStringCreateLocalized("ROV");
-	str_list[2] = XmStringCreateLocalized("AUV");
-	ac = 0;
-	XtSetArg(args[ac], XmNnumValues, 3); ac++;
-	XtSetArg(args[ac], XmNvalues, str_list); ac++;
-	XtSetValues(spinText_realtimesetup_icon, args, ac);
-	XmStringFree(str_list[0]);
-	XmStringFree(str_list[1]);
-	XtFree((XtPointer)str_list);
-
-	/* initialize mbview_id list */
-	for (i=0;i<MBV_MAX_WINDOWS;i++)
-	    {
-	    mbview_id[i] = MB_NO;
-	    }
-
-	/* set sensitivity of widgets that require an mbview instance to be active */
-	do_mbgrdviz_sensitivity( );
-
-	return(0);
-}
-/*---------------------------------------------------------------------------------------*/
-void
-do_mbgrdviz_sensitivity()
-{
-	char function_name[] = "do_mbgrdviz_sensitivity";
-   	int	mbview_active;
-   	int	mbview_allactive;
-        Cardinal ac = 0;
-        Arg	args[256];
-	size_t	instance;
-	int	nsite, nroute;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
-
-/* fprintf(stderr,"do_mbgrdviz_sensitivity called\n");*/
-    	/* set file opening menu items only if an mbview instance is active */
-	mbview_active = MB_NO;
-	mbview_allactive = MB_YES;
-	instance = MBV_NO_WINDOW;
-	for (i=0;i<MBV_MAX_WINDOWS;i++)
-		{
-		if (mbview_id[i] == MB_YES)
-			{
-			mbview_active = MB_YES;
-			if (instance == MBV_NO_WINDOW)
-				instance = i;
-			}
-		else
-			mbview_allactive = MB_NO;
-		}
-
-    	/* set file opening menu item only if not all mbview instances are active */
-	if (mbview_allactive != MB_YES)
-		{
-		ac = 0;
-		XtSetArg(args[ac], XmNsensitive, True); ac++;
-		}
-	else
-		{
-		ac = 0;
-		XtSetArg(args[ac], XmNsensitive, False); ac++;
-		}
-	XtSetValues(pushButton_file_openprimary, args, ac);
-
-    	/* set other file opening menu items only if an mbview instance is active */
-	if (mbview_active == MB_YES)
-		{
-		ac = 0;
-		XtSetArg(args[ac], XmNsensitive, True); ac++;
-		}
-	else
-		{
-		ac = 0;
-		XtSetArg(args[ac], XmNsensitive, False); ac++;
-		}
-	XtSetValues(pushButton_opensite, args, ac);
-	XtSetValues(pushButton_openroute, args, ac);
-	XtSetValues(pushButton_opennav, args, ac);
-	XtSetValues(pushButton_openswath, args, ac);
-	XtSetValues(pushButton_openvector, args, ac);
-
-	mbview_getsitecount(verbose, instance, &nsite, &error);
-	if (mbview_active == MB_YES && nsite > 0)
-		{
-		ac = 0;
-		XtSetArg(args[ac], XmNsensitive, True); ac++;
-		}
-	else
-		{
-		ac = 0;
-		XtSetArg(args[ac], XmNsensitive, False); ac++;
-		}
-	XtSetValues(pushButton_savesite, args, ac);
-
-	mbview_getroutecount(verbose, instance, &nroute, &error);
-	if (mbview_active == MB_YES && nroute > 0)
-		{
-		ac = 0;
-		XtSetArg(args[ac], XmNsensitive, True); ac++;
-		}
-	else
-		{
-		ac = 0;
-		XtSetArg(args[ac], XmNsensitive, False); ac++;
-		}
-	XtSetValues(pushButton_saveroute, args, ac);
-
-}
-/*---------------------------------------------------------------------------------------*/
-void
-do_mbgrdviz_fileSelectionBox( Widget w, XtPointer client_data, XtPointer call_data)
-{
-	char function_name[] = "do_mbgrdviz_fileSelectionBox";
- 	size_t	actionid;
-	size_t	mode;
-        Cardinal ac = 0;
-        Arg      args[256];
-	size_t	instance;
-        XmString	tmp0;
-	Boolean	argok;
-	XmAnyCallbackStruct *acs;
-	acs = (XmAnyCallbackStruct*)call_data;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       w:           %p\n",w);
-		fprintf(stderr,"dbg2       client_data: %p\n",client_data);
-		fprintf(stderr,"dbg2       call_data:   %p\n",call_data);
-		}
-
-    	/* figure out what kind of file is to be opened */
-	actionid = (size_t) client_data;
-	mode = actionid / MBV_MAX_WINDOWS;
-	instance = actionid - mode * MBV_MAX_WINDOWS;
-
-	/* set title to open primary grid */
-	ac = 0;
-	XtSetArg(args[ac], XmNtitle, "Open GMT Grid File"); ac++;
-	XtSetValues(dialogShell_open, args, ac);
-	BxManageCB(w, (XtPointer)"fileSelectionBox", call_data);
-
-
-	/* open primary grid */
-	ac = 0;
-	tmp0 = (XmString) BX_CONVERT(dialogShell_open, "*.grd",
-                				XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNpattern, tmp0); ac++;
-
-	XtSetArg(args[ac], XmNuserData, (XtPointer) actionid); ac++;
-	XtSetValues(fileSelectionBox, args, ac);
-        XmStringFree((XmString)tmp0);
-
-}
-/*---------------------------------------------------------------------------------------*/
-void
-do_mbgrdviz_fileSelectionBox_openoverlay( Widget w, XtPointer client_data, XtPointer call_data)
-{
-	char function_name[] = "do_mbgrdviz_fileSelectionBox_openoverlay";
-        Cardinal ac = 0;
-        Arg      args[256];
-	size_t	instance;
-	size_t	actionid;
-        XmString	tmp0;
-	Boolean	argok;
-	XmAnyCallbackStruct *acs;
-	acs = (XmAnyCallbackStruct*)call_data;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       w:           %p\n",w);
-		fprintf(stderr,"dbg2       client_data: %p\n",client_data);
-		fprintf(stderr,"dbg2       call_data:   %p\n",call_data);
-		}
-
-    	/* get instance */
-	instance = (size_t) client_data;
-
-	/* set title to open file dialog  */
-	ac = 0;
-	XtSetArg(args[ac], XmNtitle, "Open Overlay GMT Grid File"); ac++;
-	XtSetValues(dialogShell_open, args, ac);
-	BxManageCB(w, (XtPointer)"fileSelectionBox", call_data);
-
-	/* set fileSelectionBox parameters */
-	ac = 0;
-	tmp0 = (XmString) BX_CONVERT(dialogShell_open, "*.grd",
-                				XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNpattern, tmp0); ac++;
-	actionid = MBGRDVIZ_OPENOVERLAY * MBV_MAX_WINDOWS + instance;
-	XtSetArg(args[ac], XmNuserData, (XtPointer) actionid); ac++;
-	XtSetValues(fileSelectionBox, args, ac);
-        XmStringFree((XmString)tmp0);
-
-}
-/*---------------------------------------------------------------------------------------*/
-void
-do_mbgrdviz_fileSelectionBox_opensite( Widget w, XtPointer client_data, XtPointer call_data)
-{
-	char function_name[] = "do_mbgrdviz_fileSelectionBox_opensite";
-        Cardinal ac = 0;
-        Arg      args[256];
-	size_t	instance;
-	size_t	actionid;
-        XmString	tmp0;
-	Boolean	argok;
-	XmAnyCallbackStruct *acs;
-	acs = (XmAnyCallbackStruct*)call_data;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       w:           %p\n",w);
-		fprintf(stderr,"dbg2       client_data: %p\n",client_data);
-		fprintf(stderr,"dbg2       call_data:   %p\n",call_data);
-		}
-
-    	/* get instance */
-	instance = (size_t) client_data;
-
-	/* set title to open file dialog  */
-	ac = 0;
-	XtSetArg(args[ac], XmNtitle, "Open Site File"); ac++;
-	XtSetValues(dialogShell_open, args, ac);
-	BxManageCB(w, (XtPointer)"fileSelectionBox", call_data);
-
-	/* set fileSelectionBox parameters */
-	ac = 0;
-	tmp0 = (XmString) BX_CONVERT(dialogShell_open, "*.ste",
-                				XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNpattern, tmp0); ac++;
-	actionid = MBGRDVIZ_OPENSITE * MBV_MAX_WINDOWS + instance;
-	XtSetArg(args[ac], XmNuserData, (XtPointer) actionid); ac++;
-	XtSetValues(fileSelectionBox, args, ac);
-        XmStringFree((XmString)tmp0);
-
-}
-/*---------------------------------------------------------------------------------------*/
-void
-do_mbgrdviz_fileSelectionBox_openroute( Widget w, XtPointer client_data, XtPointer call_data)
-{
-	char function_name[] = "do_mbgrdviz_fileSelectionBox_openroute";
-        Cardinal ac = 0;
-        Arg      args[256];
-	size_t	instance;
-	size_t	actionid;
-        XmString	tmp0;
-	Boolean	argok;
-	XmAnyCallbackStruct *acs;
-	acs = (XmAnyCallbackStruct*)call_data;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       w:           %p\n",w);
-		fprintf(stderr,"dbg2       client_data: %p\n",client_data);
-		fprintf(stderr,"dbg2       call_data:   %p\n",call_data);
-		}
-
-    	/* get instance */
-	instance = (size_t) client_data;
-
-	/* set title to open file dialog  */
-	ac = 0;
-	XtSetArg(args[ac], XmNtitle, "Open Route File"); ac++;
-	XtSetValues(dialogShell_open, args, ac);
-	BxManageCB(w, (XtPointer)"fileSelectionBox", call_data);
-
-	/* set fileSelectionBox parameters */
-	ac = 0;
-	tmp0 = (XmString) BX_CONVERT(dialogShell_open, "*.rte",
-                				XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNpattern, tmp0); ac++;
-	actionid = MBGRDVIZ_OPENROUTE * MBV_MAX_WINDOWS + instance;
-	XtSetArg(args[ac], XmNuserData, (XtPointer) actionid); ac++;
-	XtSetValues(fileSelectionBox, args, ac);
-        XmStringFree((XmString)tmp0);
-
-}
-/*---------------------------------------------------------------------------------------*/
-void
-do_mbgrdviz_fileSelectionBox_opennav( Widget w, XtPointer client_data, XtPointer call_data)
-{
-	char function_name[] = "do_mbgrdviz_fileSelectionBox_opennav";
-        Cardinal ac = 0;
-        Arg      args[256];
-	size_t	instance;
-	size_t	actionid;
-        XmString	tmp0;
-	Boolean	argok;
-	XmAnyCallbackStruct *acs;
-	acs = (XmAnyCallbackStruct*)call_data;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       w:           %p\n",w);
-		fprintf(stderr,"dbg2       client_data: %p\n",client_data);
-		fprintf(stderr,"dbg2       call_data:   %p\n",call_data);
-		}
-
-    	/* get instance */
-	instance = (size_t) client_data;
-
-	/* set title to open file dialog  */
-	ac = 0;
-	XtSetArg(args[ac], XmNtitle, "Open Navigation Datalist File"); ac++;
-	XtSetValues(dialogShell_open, args, ac);
-	BxManageCB(w, (XtPointer)"fileSelectionBox", call_data);
-
-	/* set fileSelectionBox parameters */
-	ac = 0;
-	tmp0 = (XmString) BX_CONVERT(dialogShell_open, "*.mb-1",
-                				XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNpattern, tmp0); ac++;
-	actionid = MBGRDVIZ_OPENNAV * MBV_MAX_WINDOWS + instance;
-	XtSetArg(args[ac], XmNuserData, (XtPointer) actionid); ac++;
-	XtSetValues(fileSelectionBox, args, ac);
-        XmStringFree((XmString)tmp0);
-
-}
-/*---------------------------------------------------------------------------------------*/
-void
-do_mbgrdviz_fileSelectionBox_openswath( Widget w, XtPointer client_data, XtPointer call_data)
-{
-	char function_name[] = "do_mbgrdviz_fileSelectionBox_openswath";
-        Cardinal ac = 0;
-        Arg      args[256];
-	size_t	instance;
-	size_t	actionid;
-        XmString	tmp0;
-	Boolean	argok;
-	XmAnyCallbackStruct *acs;
-	acs = (XmAnyCallbackStruct*)call_data;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       w:           %p\n",w);
-		fprintf(stderr,"dbg2       client_data: %p\n",client_data);
-		fprintf(stderr,"dbg2       call_data:   %p\n",call_data);
-		}
-
-    	/* get instance */
-	instance = (size_t) client_data;
-
-	/* set title to open file dialog  */
-	ac = 0;
-	XtSetArg(args[ac], XmNtitle, "Open Swath Datalist File"); ac++;
-	XtSetValues(dialogShell_open, args, ac);
-	BxManageCB(w, (XtPointer)"fileSelectionBox", call_data);
-
-	/* set fileSelectionBox parameters */
-	ac = 0;
-	tmp0 = (XmString) BX_CONVERT(dialogShell_open, "*.mb-1",
-                				XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNpattern, tmp0); ac++;
-	actionid = MBGRDVIZ_OPENSWATH * MBV_MAX_WINDOWS + instance;
-	XtSetArg(args[ac], XmNuserData, (XtPointer) actionid); ac++;
-	XtSetValues(fileSelectionBox, args, ac);
-        XmStringFree((XmString)tmp0);
-
-}
-/*---------------------------------------------------------------------------------------*/
-void
-do_mbgrdviz_fileSelectionBox_openvector( Widget w, XtPointer client_data, XtPointer call_data)
-{
-	char function_name[] = "do_mbgrdviz_fileSelectionBox_openvector";
-        Cardinal ac = 0;
-        Arg      args[256];
-	size_t	instance;
-	size_t	actionid;
-        XmString	tmp0;
-	Boolean	argok;
-	XmAnyCallbackStruct *acs;
-	acs = (XmAnyCallbackStruct*)call_data;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       w:           %p\n",w);
-		fprintf(stderr,"dbg2       client_data: %p\n",client_data);
-		fprintf(stderr,"dbg2       call_data:   %p\n",call_data);
-		}
-
-    	/* get instance */
-	instance = (size_t) client_data;
-
-	/* set title to open file dialog  */
-	ac = 0;
-	XtSetArg(args[ac], XmNtitle, "Open Vector File"); ac++;
-	XtSetValues(dialogShell_open, args, ac);
-	BxManageCB(w, (XtPointer)"fileSelectionBox", call_data);
-
-	/* set fileSelectionBox parameters */
-	ac = 0;
-	tmp0 = (XmString) BX_CONVERT(dialogShell_open, "*",
-                				XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNpattern, tmp0); ac++;
-	actionid = MBGRDVIZ_OPENVECTOR * MBV_MAX_WINDOWS + instance;
-	XtSetArg(args[ac], XmNuserData, (XtPointer) actionid); ac++;
-	XtSetValues(fileSelectionBox, args, ac);
-        XmStringFree((XmString)tmp0);
-
-}
-/*---------------------------------------------------------------------------------------*/
-void
-do_mbgrdviz_fileSelectionBox_savesite( Widget w, XtPointer client_data, XtPointer call_data)
-{
-	char function_name[] = "do_mbgrdviz_fileSelectionBox_savesite";
-        Cardinal ac = 0;
-        Arg      args[256];
-	size_t	instance;
-	size_t	actionid;
-        XmString	tmp0;
-	Boolean	argok;
-	XmAnyCallbackStruct *acs;
-	acs = (XmAnyCallbackStruct*)call_data;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       w:           %p\n",w);
-		fprintf(stderr,"dbg2       client_data: %p\n",client_data);
-		fprintf(stderr,"dbg2       call_data:   %p\n",call_data);
-		}
-
-    	/* get instance */
-	instance = (size_t) client_data;
-
-	/* set title to open file dialog  */
-	ac = 0;
-	XtSetArg(args[ac], XmNtitle, "Save Site File"); ac++;
-	XtSetValues(dialogShell_open, args, ac);
-	BxManageCB(w, (XtPointer)"fileSelectionBox", call_data);
-
-	/* set fileSelectionBox parameters */
-	ac = 0;
-	tmp0 = (XmString) BX_CONVERT(dialogShell_open, "*",
-                				XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNpattern, tmp0); ac++;
-	actionid = MBGRDVIZ_SAVESITE * MBV_MAX_WINDOWS + instance;
-	XtSetArg(args[ac], XmNuserData, (XtPointer) actionid); ac++;
-	XtSetValues(fileSelectionBox, args, ac);
-        XmStringFree((XmString)tmp0);
-
-}
-/*---------------------------------------------------------------------------------------*/
-void
-do_mbgrdviz_fileSelectionBox_saveroute( Widget w, XtPointer client_data, XtPointer call_data)
-{
-	char function_name[] = "do_mbgrdviz_fileSelectionBox_saveroute";
-        Cardinal ac = 0;
-        Arg      args[256];
-	size_t	instance;
-	size_t	actionid;
-        XmString	tmp0;
-	Boolean	argok;
-	XmAnyCallbackStruct *acs;
-	acs = (XmAnyCallbackStruct*)call_data;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       w:           %p\n",w);
-		fprintf(stderr,"dbg2       client_data: %p\n",client_data);
-		fprintf(stderr,"dbg2       call_data:   %p\n",call_data);
-		}
-
-    	/* get instance */
-	instance = (size_t) client_data;
-
-	/* set title to open file dialog  */
-	ac = 0;
-	XtSetArg(args[ac], XmNtitle, "Save Route File"); ac++;
-	XtSetValues(dialogShell_open, args, ac);
-	BxManageCB(w, (XtPointer)"fileSelectionBox", call_data);
-
-	/* set fileSelectionBox parameters */
-	ac = 0;
-	tmp0 = (XmString) BX_CONVERT(dialogShell_open, "*",
-                				XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNpattern, tmp0); ac++;
-	actionid = MBGRDVIZ_SAVEROUTE * MBV_MAX_WINDOWS + instance;
-	XtSetArg(args[ac], XmNuserData, (XtPointer) actionid); ac++;
-	XtSetValues(fileSelectionBox, args, ac);
-        XmStringFree((XmString)tmp0);
-
-}
-/*---------------------------------------------------------------------------------------*/
-void
-do_mbgrdviz_fileSelectionBox_saverisiscript( Widget w, XtPointer client_data, XtPointer call_data)
-{
-	char function_name[] = "do_mbgrdviz_fileSelectionBox_saverisiscript";
-        Cardinal ac = 0;
-        Arg      args[256];
-	size_t	instance;
-	size_t	actionid;
-        XmString	tmp0;
-	Boolean	argok;
-	XmAnyCallbackStruct *acs;
-	acs = (XmAnyCallbackStruct*)call_data;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       w:           %p\n",w);
-		fprintf(stderr,"dbg2       client_data: %p\n",client_data);
-		fprintf(stderr,"dbg2       call_data:   %p\n",call_data);
-		}
-
-    	/* get instance */
-	instance = (size_t) client_data;
-
-	/* set title to open file dialog  */
-	ac = 0;
-	XtSetArg(args[ac], XmNtitle, "Save Risi Script File"); ac++;
-	XtSetValues(dialogShell_open, args, ac);
-	BxManageCB(w, (XtPointer)"fileSelectionBox", call_data);
-
-	/* set fileSelectionBox parameters */
-	ac = 0;
-	tmp0 = (XmString) BX_CONVERT(dialogShell_open, "*",
-                				XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNpattern, tmp0); ac++;
-	actionid = MBGRDVIZ_SAVERISISCRIPT * MBV_MAX_WINDOWS + instance;
-	XtSetArg(args[ac], XmNuserData, (XtPointer) actionid); ac++;
-	XtSetValues(fileSelectionBox, args, ac);
-        XmStringFree((XmString)tmp0);
-
-}
-/*---------------------------------------------------------------------------------------*/
-void
-do_mbgrdviz_fileSelectionBox_savewinfrogpts( Widget w, XtPointer client_data, XtPointer call_data)
-{
-	char function_name[] = "do_mbgrdviz_fileSelectionBox_savewinfrogpts";
-        Cardinal ac = 0;
-        Arg      args[256];
-	size_t	instance;
-	size_t	actionid;
-        XmString	tmp0;
-	Boolean	argok;
-	XmAnyCallbackStruct *acs;
-	acs = (XmAnyCallbackStruct*)call_data;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       w:           %p\n",w);
-		fprintf(stderr,"dbg2       client_data: %p\n",client_data);
-		fprintf(stderr,"dbg2       call_data:   %p\n",call_data);
-		}
-
-    	/* get instance */
-	instance = (size_t) client_data;
-
-	/* set title to open file dialog  */
-	ac = 0;
-	XtSetArg(args[ac], XmNtitle, "Save Route as Winfrog PTS File"); ac++;
-	XtSetValues(dialogShell_open, args, ac);
-	BxManageCB(w, (XtPointer)"fileSelectionBox", call_data);
-
-	/* set fileSelectionBox parameters */
-	ac = 0;
-	tmp0 = (XmString) BX_CONVERT(dialogShell_open, "*",
-                				XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNpattern, tmp0); ac++;
-	actionid = MBGRDVIZ_SAVEWINFROGPTS * MBV_MAX_WINDOWS + instance;
-	XtSetArg(args[ac], XmNuserData, (XtPointer) actionid); ac++;
-	XtSetValues(fileSelectionBox, args, ac);
-        XmStringFree((XmString)tmp0);
-
-}
-/*---------------------------------------------------------------------------------------*/
-void
-do_mbgrdviz_fileSelectionBox_savewinfrogwpt( Widget w, XtPointer client_data, XtPointer call_data)
-{
-	char function_name[] = "do_mbgrdviz_fileSelectionBox_savewinfrogwpt";
-        Cardinal ac = 0;
-        Arg      args[256];
-	size_t	instance;
-	size_t	actionid;
-        XmString	tmp0;
-	Boolean	argok;
-	XmAnyCallbackStruct *acs;
-	acs = (XmAnyCallbackStruct*)call_data;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       w:           %p\n",w);
-		fprintf(stderr,"dbg2       client_data: %p\n",client_data);
-		fprintf(stderr,"dbg2       call_data:   %p\n",call_data);
-		}
-
-    	/* get instance */
-	instance = (size_t) client_data;
-
-	/* set title to open file dialog  */
-	ac = 0;
-	XtSetArg(args[ac], XmNtitle, "Save Route as Winfrog WPT File"); ac++;
-	XtSetValues(dialogShell_open, args, ac);
-	BxManageCB(w, (XtPointer)"fileSelectionBox", call_data);
-
-	/* set fileSelectionBox parameters */
-	ac = 0;
-	tmp0 = (XmString) BX_CONVERT(dialogShell_open, "*",
-                				XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNpattern, tmp0); ac++;
-	actionid = MBGRDVIZ_SAVEWINFROGWPT * MBV_MAX_WINDOWS + instance;
-	XtSetArg(args[ac], XmNuserData, (XtPointer) actionid); ac++;
-	XtSetValues(fileSelectionBox, args, ac);
-        XmStringFree((XmString)tmp0);
-
-}
-/*---------------------------------------------------------------------------------------*/
-void
-do_mbgrdviz_fileSelectionBox_savedegdecmin( Widget w, XtPointer client_data, XtPointer call_data)
-{
-	char function_name[] = "do_mbgrdviz_fileSelectionBox_savedegdecmin";
-        Cardinal ac = 0;
-        Arg      args[256];
-	size_t	instance;
-	size_t	actionid;
-        XmString	tmp0;
-	Boolean	argok;
-	XmAnyCallbackStruct *acs;
-	acs = (XmAnyCallbackStruct*)call_data;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       w:           %p\n",w);
-		fprintf(stderr,"dbg2       client_data: %p\n",client_data);
-		fprintf(stderr,"dbg2       call_data:   %p\n",call_data);
-		}
-
-    	/* get instance */
-	instance = (size_t) client_data;
-
-	/* set title to open file dialog  */
-	ac = 0;
-	XtSetArg(args[ac], XmNtitle, "Save Route as Degrees + Decimal Minutes File"); ac++;
-	XtSetValues(dialogShell_open, args, ac);
-	BxManageCB(w, (XtPointer)"fileSelectionBox", call_data);
-
-	/* set fileSelectionBox parameters */
-	ac = 0;
-	tmp0 = (XmString) BX_CONVERT(dialogShell_open, "*",
-                				XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNpattern, tmp0); ac++;
-	actionid = MBGRDVIZ_SAVEDEGDECMIN * MBV_MAX_WINDOWS + instance;
-	XtSetArg(args[ac], XmNuserData, (XtPointer) actionid); ac++;
-	XtSetValues(fileSelectionBox, args, ac);
-        XmStringFree((XmString)tmp0);
-
-}
-/*---------------------------------------------------------------------------------------*/
-void
-do_mbgrdviz_fileSelectionBox_savelnw( Widget w, XtPointer client_data, XtPointer call_data)
-{
-	char function_name[] = "do_mbgrdviz_fileSelectionBox_savelnw";
-        Cardinal ac = 0;
-        Arg      args[256];
-	size_t	instance;
-	size_t	actionid;
-        XmString	tmp0;
-	Boolean	argok;
-	XmAnyCallbackStruct *acs;
-	acs = (XmAnyCallbackStruct*)call_data;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       w:           %p\n",w);
-		fprintf(stderr,"dbg2       client_data: %p\n",client_data);
-		fprintf(stderr,"dbg2       call_data:   %p\n",call_data);
-		}
-
-    	/* get instance */
-	instance = (size_t) client_data;
-
-	/* set title to open file dialog  */
-	ac = 0;
-	XtSetArg(args[ac], XmNtitle, "Save Route as Hypack LNW File"); ac++;
-	XtSetValues(dialogShell_open, args, ac);
-	BxManageCB(w, (XtPointer)"fileSelectionBox", call_data);
-
-	/* set fileSelectionBox parameters */
-	ac = 0;
-	tmp0 = (XmString) BX_CONVERT(dialogShell_open, "*",
-                				XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNpattern, tmp0); ac++;
-	actionid = MBGRDVIZ_SAVELNW * MBV_MAX_WINDOWS + instance;
-	XtSetArg(args[ac], XmNuserData, (XtPointer) actionid); ac++;
-	XtSetValues(fileSelectionBox, args, ac);
-        XmStringFree((XmString)tmp0);
-
-}
-/*---------------------------------------------------------------------------------------*/
-void
-do_mbgrdviz_fileSelectionBox_saveprofile( Widget w, XtPointer client_data, XtPointer call_data)
-{
-	char function_name[] = "do_mbgrdviz_fileSelectionBox_saveprofile";
-        Cardinal ac = 0;
-        Arg      args[256];
-	size_t	instance;
-	size_t	actionid;
-        XmString	tmp0;
-	Boolean	argok;
-	XmAnyCallbackStruct *acs;
-	acs = (XmAnyCallbackStruct*)call_data;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       w:           %p\n",w);
-		fprintf(stderr,"dbg2       client_data: %p\n",client_data);
-		fprintf(stderr,"dbg2       call_data:   %p\n",call_data);
-		}
-
-    	/* get instance */
-	instance = (size_t) client_data;
-
-	/* set title to open file dialog  */
-	ac = 0;
-	XtSetArg(args[ac], XmNtitle, "Save Profile File"); ac++;
-	XtSetValues(dialogShell_open, args, ac);
-	BxManageCB(w, (XtPointer)"fileSelectionBox", call_data);
-
-	/* set fileSelectionBox parameters */
-	ac = 0;
-	tmp0 = (XmString) BX_CONVERT(dialogShell_open, "*",
-                				XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNpattern, tmp0); ac++;
-	actionid = MBGRDVIZ_SAVEPROFILE * MBV_MAX_WINDOWS + instance;
-	XtSetArg(args[ac], XmNuserData, (XtPointer) actionid); ac++;
-	XtSetValues(fileSelectionBox, args, ac);
-        XmStringFree((XmString)tmp0);
-
-}
-/*---------------------------------------------------------------------------------------*/
-void
-do_mbgrdviz_fileSelectionBox_realtime( Widget w, XtPointer client_data, XtPointer call_data)
-{
-	char function_name[] = "do_mbgrdviz_fileSelectionBox_realtime";
-        Cardinal ac = 0;
-        Arg      args[256];
-	size_t	instance;
-	size_t	actionid;
-        XmString	tmp0;
-	Boolean	argok;
-	XmAnyCallbackStruct *acs;
-	acs = (XmAnyCallbackStruct*)call_data;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       w:           %p\n",w);
-		fprintf(stderr,"dbg2       client_data: %p\n",client_data);
-		fprintf(stderr,"dbg2       call_data:   %p\n",call_data);
-		}
-
-    	/* get instance */
-	instance = 0;
-
-	/* set title to open file dialog  */
-	ac = 0;
-	XtSetArg(args[ac], XmNtitle, "Set Realtime Navigation Source"); ac++;
-	XtSetValues(dialogShell_open, args, ac);
-	BxManageCB(w, (XtPointer)"fileSelectionBox", call_data);
-
-	/* set fileSelectionBox parameters */
-	ac = 0;
-	tmp0 = (XmString) BX_CONVERT(dialogShell_open, "*",
-                				XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNpattern, tmp0); ac++;
-	actionid = MBGRDVIZ_REALTIME * MBV_MAX_WINDOWS + instance;
-	XtSetArg(args[ac], XmNuserData, (XtPointer) actionid); ac++;
-	XtSetValues(fileSelectionBox, args, ac);
-        XmStringFree((XmString)tmp0);
-
-}
-/*---------------------------------------------------------------------------------------*/
-void
-do_mbgrdviz_close( Widget w, XtPointer client_data, XtPointer call_data)
-{
-	char function_name[] = "do_mbgrdviz_close";
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       w:           %p\n",w);
-		fprintf(stderr,"dbg2       client_data: %p\n",client_data);
-		fprintf(stderr,"dbg2       call_data:   %p\n",call_data);
-		}
-}
-/*---------------------------------------------------------------------------------------*/
-
-void
-do_mbgrdviz_quit( Widget w, XtPointer client_data, XtPointer call_data)
-{
-	char function_name[] = "do_mbgrdviz_quit";
-	int status = MB_SUCCESS;
-	XmAnyCallbackStruct *acs;
-	acs = (XmAnyCallbackStruct*)call_data;
-	
-	/* close any active mbview instances */
-	status = mbview_quit(verbose, &error);
-	
-	XtUnmanageChild(XtParent(mainWindow));
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       w:           %p\n",w);
-		fprintf(stderr,"dbg2       client_data: %p\n",client_data);
-		fprintf(stderr,"dbg2       call_data:   %p\n",call_data);
-		}
-}
-/*---------------------------------------------------------------------------------------*/
-
-int do_mbgrdviz_dismiss_notify(size_t instance)
-{
-	char function_name[] = "do_mbgrdviz_dismiss_notify";
-	int	status = MB_SUCCESS;
-	int	verbose = 0;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       instance:  %zu\n",instance);
-		}
-
-	/* set mbview window <id> to inactive */
-	if (instance != MBV_NO_WINDOW && instance < MBV_MAX_WINDOWS
-		&& mbview_id[instance] == MB_YES)
-		{
-		mbview_id[instance] = MB_NO;
-	   	/* fprintf(stderr, "Freeing mbview window %d in local list...\n",
-				instance); */
-		}
-	else
-	    	{
-	   	/* fprintf(stderr, "Unable to free mbview - mbview window %d not found in local list...\n",
-				instance); */
-	    	}
-
-	/* update widgets of remaining mbview windows */
-	for (i=0;i<MBV_MAX_WINDOWS;i++)
-		{
-		if (mbview_id[i] == MB_YES)
-			status = mbview_update(verbose, i, &error);
-		}
-
-	/* set sensitivity of widgets that require an mbview instance to be active */
-	do_mbgrdviz_sensitivity( );
-
-	return(status);
-}
-/*---------------------------------------------------------------------------------------*/
-
-void
-do_mbgrdviz_openfile( Widget w, XtPointer client_data, XtPointer call_data)
-{
-	char function_name[] = "do_mbgrdviz_openfile";
-	int	status = MB_SUCCESS;
-	size_t	actionid;
-	size_t	mode;
-	size_t	instance;
-	char    *file_ptr;
-        Cardinal ac = 0;
-        Arg      args[256];
-	XmFileSelectionBoxCallbackStruct *acs;
-	acs=(XmFileSelectionBoxCallbackStruct*)call_data;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       w:           %p\n",w);
-		fprintf(stderr,"dbg2       client_data: %p\n",client_data);
-		fprintf(stderr,"dbg2       call_data:   %p\n",call_data);
-		}
-
-	/* read the input file name */
-	XmStringGetLtoR(acs->value, XmSTRING_DEFAULT_CHARSET,
-			&file_ptr);
-	if (strlen(file_ptr) <= 0 && file_ptr != NULL)
-		{
-		XtFree(file_ptr);
-		file_ptr = NULL;
-		}
-
-	/* print debug statements */
-	if (verbose >= 4)
-		{
-		fprintf(stderr,"\ndbg4  Extracted input file name from call_data:\n");
-		fprintf(stderr,"dbg4       call_data:           %p\n",call_data);
-		fprintf(stderr,"dbg4       acs:                 %p\n",acs);
-		fprintf(stderr,"dbg4       acs->value:          %p\n",acs->value);
-		fprintf(stderr,"dbg4       file_ptr:            %p\n",file_ptr);
-		fprintf(stderr,"dbg4       file_ptr:            %s\n",file_ptr);
-		}
-
-    	/* figure out what kind of file is to be opened */
-
-	ac = 0;
-	XtSetArg(args[ac], XmNuserData, (XtPointer) &actionid); ac++;
-	XtGetValues(fileSelectionBox, args, ac);
-
-	mode = actionid / MBV_MAX_WINDOWS;
-	if (mode > 0)
-		instance = actionid - mode * MBV_MAX_WINDOWS;
-	else
-		instance = 0;
-
-	/* print debug statements */
-	if (verbose >= 4)
-		{
-		fprintf(stderr,"\ndbg4  Extracted user data from widget fileSelectionBox:\n");
-		fprintf(stderr,"dbg4       fileSelectionBox:    %p\n",fileSelectionBox);
-		fprintf(stderr,"dbg4       actionid:            %zu\n",actionid);
-		fprintf(stderr,"dbg4       mode:                %zu\n",mode);
-		}
-
-	/* open primary grid */
-	if (mode <= MBGRDVIZ_OPENGRID)
-		{
-		/* read the grid and open mbview window */
-		status = do_mbgrdviz_openprimary(file_ptr);
-		}
-
-	/* else open overlay grid */
-	else if (mode == MBGRDVIZ_OPENOVERLAY)
-		{
-		/* read the grid and update mbview window */
-		do_mbview_message_on("Reading overlay grid...", instance);
-		status = do_mbgrdviz_openoverlay(instance, file_ptr);
-		}
-
-	/* else open site data */
-	else if (mode == MBGRDVIZ_OPENSITE)
-		{
-		/* read site file and update mbview window */
-		do_mbview_message_on("Reading site data...", instance);
-		status = do_mbgrdviz_opensite(instance, file_ptr);
-		}
-
-	/* else open route data */
-	else if (mode == MBGRDVIZ_OPENROUTE)
-		{
-		/* read route file and update mbview window */
-		do_mbview_message_on("Reading route data...", instance);
-		status = do_mbgrdviz_openroute(instance, file_ptr);
-		}
-
-	/* else open nav data */
-	else if (mode == MBGRDVIZ_OPENNAV)
-		{
-		/* read nav file and update mbview window */
-		do_mbview_message_on("Reading navigation data...", instance);
-		status = do_mbgrdviz_opennav(instance, MB_NO, file_ptr);
-		}
-
-	/* else open swath data */
-	else if (mode == MBGRDVIZ_OPENSWATH)
-		{
-		/* read nav file and update mbview window */
-		do_mbview_message_on("Reading swath data...", instance);
-		status = do_mbgrdviz_opennav(instance, MB_YES, file_ptr);
-		}
-
-	/* else open vector data */
-	else if (mode == MBGRDVIZ_OPENVECTOR)
-		{
-		/* read vector file and update mbview window */
-		do_mbview_message_on("Reading vector data...", instance);
-		status = do_mbgrdviz_openvector(instance, file_ptr);
-		}
-
-	/* else write site data */
-	else if (mode == MBGRDVIZ_SAVESITE)
-		{
-		/* write site file */
-		do_mbview_message_on("Saving site data...", instance);
-		status = do_mbgrdviz_savesite(instance, file_ptr);
-		}
-
-	/* else write route data */
-	else if (mode == MBGRDVIZ_SAVEROUTE)
-		{
-		/* write route file */
-		do_mbview_message_on("Saving route data...", instance);
-		status = do_mbgrdviz_saveroute(instance, file_ptr);
-		}
-
-	/* else write route data */
-	else if (mode == MBGRDVIZ_SAVERISISCRIPT)
-		{
-		/* write route file */
-		do_mbview_message_on("Saving route as Risi script...", instance);
-		status = do_mbgrdviz_saverisiscript(instance, file_ptr);
-		}
-
-	/* else write route data as Winfrog pts file */
-	else if (mode == MBGRDVIZ_SAVEWINFROGPTS)
-		{
-		/* write route file */
-		do_mbview_message_on("Saving route as Winfrog PTS file...", instance);
-		status = do_mbgrdviz_savewinfrogpts(instance, file_ptr);
-		}
-
-	/* else write route data as Winfrog wpt file */
-	else if (mode == MBGRDVIZ_SAVEWINFROGWPT)
-		{
-		/* write route file */
-		do_mbview_message_on("Saving route as Winfrog WPT file...", instance);
-		status = do_mbgrdviz_savewinfrogwpt(instance, file_ptr);
-		}
-
-	/* else write route data as degrees decimal minutes file */
-	else if (mode == MBGRDVIZ_SAVEDEGDECMIN)
-		{
-		/* write route file */
-		do_mbview_message_on("Saving route as degrees + decimal minutes file...", instance);
-		status = do_mbgrdviz_savedegdecmin(instance, file_ptr);
-		}
-
-	/* else write route data as Hypack lnw file */
-	else if (mode == MBGRDVIZ_SAVELNW)
-		{
-		/* write route file */
-		do_mbview_message_on("Saving route as Hypack LNW file...", instance);
-		status = do_mbgrdviz_savelnw(instance, file_ptr);
-		}
-
-	/* else write route data */
-	else if (mode == MBGRDVIZ_SAVEPROFILE)
-		{
-		/* write route file */
-		do_mbview_message_on("Saving profile data...", instance);
-		status = do_mbgrdviz_saveprofile(instance, file_ptr);
-		}
-
-	/* else set realtime data source */
-	else if (mode == MBGRDVIZ_REALTIME)
-		{
-		/* Set realtime source path */
-		XmTextSetString(textField_realtimesetup_path, file_ptr);
-
-		}
-
-	/* free the string */
-	if (file_ptr != NULL)
-		{
-		XtFree(file_ptr);
-		file_ptr = NULL;
-		}
-
-	/* close the message */
-	if (mode > MBGRDVIZ_OPENGRID && mode != MBGRDVIZ_REALTIME)
-		do_mbview_message_off(instance);
-}
-/*---------------------------------------------------------------------------------------*/
-
-int do_mbgrdviz_openprimary(char *input_file_ptr)
-{
-	char function_name[] = "do_mbgrdviz_openprimary";
-	int	status = MB_SUCCESS;
-	char    *button_name_ptr;
-	size_t	instance;
-	char	*testname = "Internal Test Grid";
-	int	projectionid, utmzone;
-	double	reference_lon;
-
-	/* mbview parameters */
-	char	mbv_title[MB_PATH_MAXLINE];
-	int	mbv_xo;
-	int	mbv_yo;
-	int	mbv_width;
-	int	mbv_height;
-	int	mbv_lorez_dimension;
-	int	mbv_hirez_dimension;
-	int	mbv_lorez_navdecimate;
-	int	mbv_hirez_navdecimate;
-	int	mbv_display_mode;
-	int	mbv_mouse_mode;
-	int	mbv_grid_mode;
-	int	mbv_primary_histogram;
-	int	mbv_primaryslope_histogram;
-	int	mbv_secondary_histogram;
-	int	mbv_primary_shade_mode;
-	int	mbv_slope_shade_mode;
-	int	mbv_secondary_shade_mode;
-	int	mbv_grid_contour_mode;
-	int	mbv_site_view_mode;
-	int	mbv_route_view_mode;
-	int	mbv_nav_view_mode;
-	int	mbv_navdrape_view_mode;
-	int	mbv_vector_view_mode;
-	int	mbv_primary_colortable;
-	int	mbv_primary_colortable_mode;
-	double	mbv_primary_colortable_min;
-	double	mbv_primary_colortable_max;
-	int	mbv_slope_colortable;
-	int	mbv_slope_colortable_mode;
-	double	mbv_slope_colortable_min;
-	double	mbv_slope_colortable_max;
-	int	mbv_secondary_colortable;
-	int	mbv_secondary_colortable_mode;
-	double	mbv_secondary_colortable_min;
-	double	mbv_secondary_colortable_max;
-	double	mbv_exageration;
-	double	mbv_modelelevation3d;
-	double	mbv_modelazimuth3d;
-	double	mbv_viewelevation3d;
-	double	mbv_viewazimuth3d;
-	double	mbv_illuminate_magnitude;
-	double	mbv_illuminate_elevation;
-	double	mbv_illuminate_azimuth;
-	double	mbv_slope_magnitude;
-	double	mbv_overlay_shade_magnitude;
-	double	mbv_overlay_shade_center;
-	int	mbv_overlay_shade_mode;
-	double	mbv_contour_interval;
-	int	mbv_primary_grid_projection_mode;
-	char	mbv_primary_grid_projection_id[MB_PATH_MAXLINE];
-	int	mbv_display_projection_mode;
-	char	mbv_display_projection_id[MB_PATH_MAXLINE];
-	float	mbv_primary_nodatavalue;
-	int	mbv_primary_nxy;
-	int	mbv_primary_nx;
-	int	mbv_primary_ny;
-	double	mbv_primary_min;
-	double	mbv_primary_max;
-	double	mbv_primary_xmin;
-	double	mbv_primary_xmax;
-	double	mbv_primary_ymin;
-	double	mbv_primary_ymax;
-	double	mbv_primary_dx;
-	double	mbv_primary_dy;
-	float	*mbv_primary_data;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       input_file_ptr:  %s\n",input_file_ptr);
-		}
-
-	/* get next instance number */
-	status = mbview_init(verbose, &instance, &error);
-	if (instance == MBV_NO_WINDOW)
-		{
-		fprintf(stderr, "Unable to create mbview - %d mbview windows already created\n",
-		MBV_MAX_WINDOWS);
-		}
-
-	else
-		{
-		/* get button name */
-		if (input_file_ptr != NULL)
-			{
-#ifdef WIN32
-			button_name_ptr = strrchr(input_file_ptr, '/');		/* This one should work for gcc as well */
-#else
-			button_name_ptr = (char *) rindex(input_file_ptr, '/');
-#endif
-			if (button_name_ptr == NULL)
-				button_name_ptr = input_file_ptr;
-			else
-				button_name_ptr++;
-			}
-		else
-			{
-			button_name_ptr = testname;
-			}
-
-
-		/* set parameters */
-		sprintf(mbv_title, "MBgrdviz: %s\n", button_name_ptr);
-		mbv_xo = 200;
-		mbv_yo = 200;
-		mbv_width = 560;
-		mbv_height = 500;
-		mbv_lorez_dimension = 100;
-		mbv_hirez_dimension = 500;
-		mbv_lorez_navdecimate = 5;
-		mbv_hirez_navdecimate = 1;
-
-		/* set basic mbview window parameters */
-		status = mbview_setwindowparms(verbose, instance,
-					&do_mbgrdviz_dismiss_notify,
-					mbv_title,
-					mbv_xo,
-					mbv_yo,
-					mbv_width,
-					mbv_height,
-					mbv_lorez_dimension,
-					mbv_hirez_dimension,
-					mbv_lorez_navdecimate,
-					mbv_hirez_navdecimate,
-					&error);
-
-		/* read in the grd file */
-		if (status == MB_SUCCESS
-			&& input_file_ptr != NULL)
-		status = mb_read_gmt_grd(verbose, input_file_ptr,
-			&mbv_primary_grid_projection_mode,
-			mbv_primary_grid_projection_id,
-			&mbv_primary_nodatavalue,
-			&mbv_primary_nxy,
-			&mbv_primary_nx,
-			&mbv_primary_ny,
-			&mbv_primary_min,
-			&mbv_primary_max,
-			&mbv_primary_xmin,
-			&mbv_primary_xmax,
-			&mbv_primary_ymin,
-			&mbv_primary_ymax,
-			&mbv_primary_dx,
-			&mbv_primary_dy,
-			&mbv_primary_data,
-                        NULL,
-                        NULL,
-                        &error);
-
-		else if (status == MB_SUCCESS)
-		status = do_mbgrdviz_opentest(instance,
-			1000.0, 3.0, 2.0,
-			&mbv_primary_grid_projection_mode,
-			mbv_primary_grid_projection_id,
-			&mbv_primary_nodatavalue,
-			&mbv_primary_nxy,
-			&mbv_primary_nx,
-			&mbv_primary_ny,
-			&mbv_primary_min,
-			&mbv_primary_max,
-			&mbv_primary_xmin,
-			&mbv_primary_xmax,
-			&mbv_primary_ymin,
-			&mbv_primary_ymax,
-			&mbv_primary_dx,
-			&mbv_primary_dy,
-			&mbv_primary_data);
-
-		/* set parameters */
-                if (status == MB_SUCCESS)
-                        {
-                        mbv_display_mode = MBV_DISPLAY_2D;
-                        mbv_mouse_mode = MBV_MOUSE_MOVE;
-                        mbv_grid_mode = MBV_GRID_VIEW_PRIMARY;
-                        mbv_primary_histogram = MB_NO;
-                        mbv_primaryslope_histogram = MB_NO;
-                        mbv_secondary_histogram = MB_NO;
-                        mbv_primary_shade_mode = MBV_SHADE_VIEW_SLOPE;
-                        mbv_slope_shade_mode = MBV_SHADE_VIEW_NONE;
-                        mbv_secondary_shade_mode = MBV_SHADE_VIEW_NONE;
-                        mbv_grid_contour_mode = MBV_VIEW_OFF;
-                        mbv_site_view_mode = MBV_VIEW_OFF;
-                        mbv_route_view_mode = MBV_VIEW_OFF;
-                        mbv_nav_view_mode = MBV_VIEW_OFF;
-                        mbv_navdrape_view_mode = MBV_VIEW_OFF;
-                        mbv_vector_view_mode = MBV_VIEW_OFF;
-                        mbv_primary_colortable = MBV_COLORTABLE_HAXBY;
-                        mbv_primary_colortable_mode = MBV_COLORTABLE_NORMAL;
-                        mbv_primary_colortable_min = mbv_primary_min;
-                        mbv_primary_colortable_max = mbv_primary_max;
-                        mbv_slope_colortable = MBV_COLORTABLE_HAXBY;
-                        mbv_slope_colortable_mode = MBV_COLORTABLE_REVERSED;
-                        mbv_slope_colortable_min = 0.0;
-                        mbv_slope_colortable_max = 0.5;
-                        mbv_secondary_colortable = MBV_COLORTABLE_HAXBY;
-                        mbv_secondary_colortable_mode = MBV_COLORTABLE_NORMAL;
-                        mbv_secondary_colortable_min = 0.0;
-                        mbv_secondary_colortable_max = 0.0;
-                        mbv_exageration = 1.0;
-                        mbv_modelelevation3d = 90.0;
-                        mbv_modelazimuth3d = 0.0;
-                        mbv_viewelevation3d = 90.0;
-                        mbv_viewazimuth3d = 0.0;
-                        mbv_illuminate_magnitude = 1.0;
-                        mbv_illuminate_elevation = 5.0;
-                        mbv_illuminate_azimuth = 90.0;
-                        mbv_slope_magnitude = 1.0;
-                        mbv_overlay_shade_magnitude = 1.0;
-                        mbv_overlay_shade_center = 0.0;
-                        mbv_overlay_shade_mode = MBV_COLORTABLE_NORMAL;
-                        mbv_contour_interval
-                                = pow(10.0, floor(log10(mbv_primary_max
-                                                        - mbv_primary_min)) - 1.0);
-
-                        /* set mbview default values */
-                        status = mb_mbview_defaults(verbose,
-                                                    &mbv_primary_colortable,
-					            &mbv_primary_colortable_mode,
-					            &mbv_primary_shade_mode,
-					            &mbv_slope_colortable,
-					            &mbv_slope_colortable_mode,
-					            &mbv_secondary_colortable,
-					            &mbv_secondary_colortable_mode,
-					            &mbv_illuminate_magnitude,
-					            &mbv_illuminate_elevation,
-					            &mbv_illuminate_azimuth,
-					            &mbv_slope_magnitude);
-                        }
-        
-                /* set the display projection */
-                if (status == MB_SUCCESS)
-                        {
-                        /* if grid projected then use the same projected coordinate system by default */
-                        if (mbv_primary_grid_projection_mode == MBV_PROJECTION_PROJECTED)
-                                {
-                                mbv_display_projection_mode = mbv_primary_grid_projection_mode;
-                                strcpy(mbv_display_projection_id,mbv_primary_grid_projection_id);
-                                }
-        
-                        /* else if grid geographic and covers much of the world use spheroid */
-                        else if (mbv_primary_xmax - mbv_primary_xmin > 15.0
-                                || mbv_primary_ymax - mbv_primary_ymin > 15.0)
-                                {
-                                mbv_display_projection_mode = MBV_PROJECTION_SPHEROID;
-                                sprintf(mbv_display_projection_id, "SPHEROID");
-                                }
-        
-                        /* else if grid geographic then use appropriate UTM zone for non-polar grids */
-                        else if (mbv_primary_ymax > -80.0
-                                && mbv_primary_ymin < 84.0)
-                                {
-                                mbv_display_projection_mode = MBV_PROJECTION_PROJECTED;
-                                reference_lon = 0.5 * (mbv_primary_xmin + mbv_primary_xmax);
-                                if (reference_lon > 180.0)
-                                        reference_lon -= 360.0;
-                                utmzone = (int)(((reference_lon + 183.0)
-                                                / 6.0) + 0.5);
-                                if (0.5 * (mbv_primary_ymin + mbv_primary_ymax) >= 0.0)
-                                        projectionid = 32600 + utmzone;
-                                else
-                                        projectionid = 32700 + utmzone;
-                                sprintf(mbv_display_projection_id, "epsg%d", projectionid);
-                                }
-        
-                        /* else if grid geographic and more northerly than 84 deg N then use
-                                North Univeral Polar Stereographic Projection */
-                        else if (mbv_primary_ymin > 84.0)
-                                {
-                                mbv_display_projection_mode = MBV_PROJECTION_PROJECTED;
-                                projectionid = 32661;
-                                sprintf(mbv_display_projection_id, "epsg%d", projectionid);
-                                }
-        
-                        /* else if grid geographic and more southerly than 80 deg S then use
-                                South Univeral Polar Stereographic Projection */
-                        else if (mbv_primary_ymax < 80.0)
-                                {
-                                mbv_display_projection_mode = MBV_PROJECTION_PROJECTED;
-                                projectionid = 32761;
-                                sprintf(mbv_display_projection_id, "epsg%d", projectionid);
-                                }
-        
-                        /* else just use geographic */
-                        else
-                                {
-                                mbv_display_projection_mode = MBV_PROJECTION_GEOGRAPHIC;
-                                sprintf(mbv_display_projection_id, "epsg%d", GCS_WGS_84);
-                                }
-                        }
-
-		/* set basic mbview view controls */
-		if (status == MB_SUCCESS)
-		status = mbview_setviewcontrols(verbose, instance,
-					mbv_display_mode,
-					mbv_mouse_mode,
-					mbv_grid_mode,
-					mbv_primary_histogram,
-					mbv_primaryslope_histogram,
-					mbv_secondary_histogram,
-					mbv_primary_shade_mode,
-					mbv_slope_shade_mode,
-					mbv_secondary_shade_mode,
-					mbv_grid_contour_mode,
-					mbv_site_view_mode,
-					mbv_route_view_mode,
-					mbv_nav_view_mode,
-					mbv_navdrape_view_mode,
-					mbv_vector_view_mode,
-					mbv_exageration,
-					mbv_modelelevation3d,
-					mbv_modelazimuth3d,
-					mbv_viewelevation3d,
-					mbv_viewazimuth3d,
-					mbv_illuminate_magnitude,
-					mbv_illuminate_elevation,
-					mbv_illuminate_azimuth,
-					mbv_slope_magnitude,
-					mbv_overlay_shade_magnitude,
-					mbv_overlay_shade_center,
-					mbv_overlay_shade_mode,
-					mbv_contour_interval,
-					mbv_display_projection_mode,
-					mbv_display_projection_id,
-					&error);
-
-		/* set primary grid data */
-		if (status == MB_SUCCESS)
-		status = mbview_setprimarygrid(verbose, instance,
-					mbv_primary_grid_projection_mode,
-					mbv_primary_grid_projection_id,
-					mbv_primary_nodatavalue,
-					mbv_primary_nx,
-					mbv_primary_ny,
-					mbv_primary_min,
-					mbv_primary_max,
-					mbv_primary_xmin,
-					mbv_primary_xmax,
-					mbv_primary_ymin,
-					mbv_primary_ymax,
-					mbv_primary_dx,
-					mbv_primary_dy,
-					mbv_primary_data,
-					&error);
-		mb_freed(verbose, __FILE__, __LINE__, (void **)&mbv_primary_data, &error);
-
-		/* set more mbview control values */
-		if (status == MB_SUCCESS)
-		status = mbview_setprimarycolortable(verbose, instance,
-					mbv_primary_colortable,
-					mbv_primary_colortable_mode,
-					mbv_primary_colortable_min,
-					mbv_primary_colortable_max,
-					&error);
-		if (status == MB_SUCCESS)
-		status = mbview_setslopecolortable(verbose, instance,
-					mbv_slope_colortable,
-					mbv_slope_colortable_mode,
-					mbv_slope_colortable_min,
-					mbv_slope_colortable_max,
-					&error);
-		if (status == MB_SUCCESS)
-		status = mbview_enableeditsites(verbose, instance,
-					&error);
-		if (status == MB_SUCCESS)
-		status = mbview_enableeditroutes(verbose, instance,
-					&error);
-
-		/* open up mbview window */
-		if (status == MB_SUCCESS)
-			{
-			status = mbview_open(verbose, instance, &error);
-			if (status == MB_SUCCESS)
-				mbview_id[instance] = MB_YES;
-			else
-				mbview_id[instance] = MB_NO;
-
-			/* set sensitivity callback routine */
-			if (status == MB_SUCCESS)
-				{
-				mbview_setsensitivitynotify(verbose, instance,
-					do_mbgrdviz_sensitivity, &error);
-				}
-
-			/* add action button */
-			if (status == MB_SUCCESS)
-				{
-				mbview_addaction(verbose, instance,
-					do_mbgrdviz_fileSelectionBox_openoverlay,
-					"Open Overlay Grid",
-					MBV_PICKMASK_NONE, &error);
-				mbview_addaction(verbose, instance,
-					do_mbgrdviz_fileSelectionBox_opensite,
-					"Open Site File",
-					MBV_PICKMASK_NONE, &error);
-				mbview_addaction(verbose, instance,
-					do_mbgrdviz_fileSelectionBox_openroute,
-					"Open Route File",
-					MBV_PICKMASK_NONE, &error);
-				mbview_addaction(verbose, instance,
-					do_mbgrdviz_fileSelectionBox_opennav,
-					"Open Navigation",
-					MBV_PICKMASK_NONE, &error);
-				mbview_addaction(verbose, instance,
-					do_mbgrdviz_fileSelectionBox_openswath,
-					"Open Swath Data",
-					MBV_PICKMASK_NONE, &error);
-				mbview_addaction(verbose, instance,
-					do_mbgrdviz_fileSelectionBox_openvector,
-					"Open Vector File",
-					MBV_PICKMASK_NONE, &error);
-				mbview_addaction(verbose, instance,
-					do_mbgrdviz_fileSelectionBox_savesite,
-					"Save Site File",
-					MBV_EXISTMASK_SITE, &error);
-				mbview_addaction(verbose, instance,
-					do_mbgrdviz_fileSelectionBox_saveroute,
-					"Save Route File",
-					MBV_EXISTMASK_ROUTE, &error);
-				mbview_addaction(verbose, instance,
-					do_mbgrdviz_fileSelectionBox_saverisiscript,
-					"Save Risi Script File",
-					MBV_EXISTMASK_ROUTE, &error);
-				mbview_addaction(verbose, instance,
-					do_mbgrdviz_fileSelectionBox_savewinfrogpts,
-					"Save Route as Winfrog PTS File",
-					MBV_EXISTMASK_ROUTE, &error);
-				mbview_addaction(verbose, instance,
-					do_mbgrdviz_fileSelectionBox_savewinfrogwpt,
-					"Save Route as Winfrog WPT File",
-					MBV_EXISTMASK_ROUTE, &error);
-				mbview_addaction(verbose, instance,
-					do_mbgrdviz_fileSelectionBox_savedegdecmin,
-					"Save Route as Degrees + Decimal Minutes File",
-					MBV_EXISTMASK_ROUTE, &error);
-				mbview_addaction(verbose, instance,
-					do_mbgrdviz_fileSelectionBox_savelnw,
-					"Save Route as Hypack LNW File",
-					MBV_EXISTMASK_ROUTE, &error);
-				mbview_addaction(verbose, instance,
-					do_mbgrdviz_fileSelectionBox_saveprofile,
-					"Save Profile File",
-					MBV_PICKMASK_TWOPOINT + MBV_PICKMASK_ROUTE + MBV_PICKMASK_NAVTWOPOINT,
-					&error);
-
-				mbview_addaction(verbose, instance,
-					do_mbgrdviz_open_mbedit,
-					"Open Selected Nav in MBedit",
-					MBV_PICKMASK_NAVANY,
-					&error);
-				mbview_addaction(verbose, instance,
-					do_mbgrdviz_open_mbeditviz,
-					"Open Selected Nav in MBeditviz",
-					MBV_PICKMASK_NAVANY,
-					&error);
-				mbview_addaction(verbose, instance,
-					do_mbgrdviz_open_mbnavedit,
-					"Open Selected Nav in MBnavedit",
-					MBV_PICKMASK_NAVANY,
-					&error);
-				mbview_addaction(verbose, instance,
-					do_mbgrdviz_open_mbvelocitytool,
-					"Open Selected Nav in MBvelocitytool",
-					MBV_PICKMASK_NAVANY,
-					&error);
-
-				mbview_addaction(verbose, instance,
-					do_mbgrdviz_open_region,
-					"Open Region as New View",
-					MBV_PICKMASK_REGION + MBV_PICKMASK_NEWINSTANCE, &error);
-				mbview_addaction(verbose, instance,
-					do_mbgrdviz_make_survey,
-					"Generate Survey Route from Area",
-					MBV_PICKMASK_AREA, &error);
-				}
-			}
-		}
-
-	/* set sensitivity of widgets that require an mbview instance to be active */
-	do_mbgrdviz_sensitivity( );
-
-	/* all done */
-	return(status);
-}
-/*---------------------------------------------------------------------------------------*/
-
-int do_mbgrdviz_openoverlay(size_t instance, char *input_file_ptr)
-{
-	char function_name[] = "do_mbgrdviz_openoverlay";
-	int	status = MB_SUCCESS;
-
-	/* mbview parameters */
-	int	mbv_secondary_colortable;
-	int	mbv_secondary_colortable_mode;
-	double	mbv_secondary_colortable_min;
-	double	mbv_secondary_colortable_max;
-	int	mbv_secondary_grid_projection_mode;
-	char	mbv_secondary_grid_projection_id[MB_PATH_MAXLINE];
-	float	mbv_secondary_nodatavalue;
-	int	mbv_secondary_nxy;
-	int	mbv_secondary_nx;
-	int	mbv_secondary_ny;
-	double	mbv_secondary_min;
-	double	mbv_secondary_max;
-	double	mbv_secondary_xmin;
-	double	mbv_secondary_xmax;
-	double	mbv_secondary_ymin;
-	double	mbv_secondary_ymax;
-	double	mbv_secondary_dx;
-	double	mbv_secondary_dy;
-	float	*mbv_secondary_data;
-	double	mbv_overlay_shade_magnitude;
-	double	mbv_overlay_shade_center;
-	int	mbv_overlay_shade_mode;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       instance:        %zu\n",instance);
-		fprintf(stderr,"dbg2       input_file_ptr:  %s\n",input_file_ptr);
-		}
-
-	/* read data for valid instance */
-	if (instance != MBV_NO_WINDOW)
-		{
-
-		/* read in the grd file */
-		if (status == MB_SUCCESS
-			&& input_file_ptr != NULL)
-		status = mb_read_gmt_grd(verbose, input_file_ptr,
-			&mbv_secondary_grid_projection_mode,
-			mbv_secondary_grid_projection_id,
-			&mbv_secondary_nodatavalue,
-			&mbv_secondary_nxy,
-			&mbv_secondary_nx,
-			&mbv_secondary_ny,
-			&mbv_secondary_min,
-			&mbv_secondary_max,
-			&mbv_secondary_xmin,
-			&mbv_secondary_xmax,
-			&mbv_secondary_ymin,
-			&mbv_secondary_ymax,
-			&mbv_secondary_dx,
-			&mbv_secondary_dy,
-			&mbv_secondary_data,
-                        NULL,
-                        NULL,
-                        &error);
-
-		else if (status == MB_SUCCESS)
-		status = do_mbgrdviz_opentest(instance,
-			1000.0, 6.0, 1.5,
-			&mbv_secondary_grid_projection_mode,
-			mbv_secondary_grid_projection_id,
-			&mbv_secondary_nodatavalue,
-			&mbv_secondary_nxy,
-			&mbv_secondary_nx,
-			&mbv_secondary_ny,
-			&mbv_secondary_min,
-			&mbv_secondary_max,
-			&mbv_secondary_xmin,
-			&mbv_secondary_xmax,
-			&mbv_secondary_ymin,
-			&mbv_secondary_ymax,
-			&mbv_secondary_dx,
-			&mbv_secondary_dy,
-			&mbv_secondary_data);
-
-		/* set parameters */
-		if (status == MB_SUCCESS)
-                        {
-                        mbv_secondary_colortable = MBV_COLORTABLE_HAXBY;
-                        mbv_secondary_colortable_mode = MBV_COLORTABLE_NORMAL;
-                        mbv_secondary_colortable_min = mbv_secondary_min;
-                        mbv_secondary_colortable_max = mbv_secondary_max;
-                        mbv_overlay_shade_magnitude = 1.0;
-                        mbv_overlay_shade_center = 0.5 * (mbv_secondary_max + mbv_secondary_min);
-                        mbv_overlay_shade_mode = MBV_COLORTABLE_NORMAL;
-                        }
-
-		/* set more mbview control values */
-		if (status == MB_SUCCESS)
-                        {
-                        status = mbview_setsecondarygrid(verbose, instance,
-					mbv_secondary_grid_projection_mode,
-					mbv_secondary_grid_projection_id,
-					mbv_secondary_nodatavalue,
-					mbv_secondary_nx,
-					mbv_secondary_ny,
-					mbv_secondary_min,
-					mbv_secondary_max,
-					mbv_secondary_xmin,
-					mbv_secondary_xmax,
-					mbv_secondary_ymin,
-					mbv_secondary_ymax,
-					mbv_secondary_dx,
-					mbv_secondary_dy,
-					mbv_secondary_data,
-					&error);
-                        mb_freed(verbose, __FILE__, __LINE__, (void **)&mbv_secondary_data, &error);
-                        }
-		if (status == MB_SUCCESS)
-		status = mbview_setsecondarycolortable(verbose, instance,
-					mbv_secondary_colortable,
-					mbv_secondary_colortable_mode,
-					mbv_secondary_colortable_min,
-					mbv_secondary_colortable_max,
-					mbv_overlay_shade_magnitude,
-					mbv_overlay_shade_center,
-					mbv_overlay_shade_mode,
-					&error);
-
-		/* update widgets */
-		if (status == MB_SUCCESS)
-		status = mbview_update(verbose, instance, &error);
-
-		}
-
-	/* all done */
-	return(status);
-}
-/*---------------------------------------------------------------------------------------*/
-
-int do_mbgrdviz_opensite(size_t instance, char *input_file_ptr)
-{
-	char function_name[] = "do_mbgrdviz_opensite";
-	int	status = MB_SUCCESS;
-	FILE	*sfp;
-	char	buffer[MB_PATH_MAXLINE];
-	int	nsite;
-	double	*sitelon;
-	double	*sitelat;
-	double	*sitetopo;
-	int	*sitecolor;
-	int	*sitesize;
-	mb_path	*sitename;
-	char	*result;
-	char	*name;
-	int	nget;
-	int	site_ok;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       instance:        %zu\n",instance);
-		fprintf(stderr,"dbg2       input_file_ptr:  %s\n",input_file_ptr);
-		}
-
-	/* read data for valid instance */
-	if (instance != MBV_NO_WINDOW)
-	    {
-
-	    /* count the sites in the input file */
-	    nsite = 0;
-	    if ((sfp = fopen(input_file_ptr, "r")) == NULL)
-		    {
-		    error = MB_ERROR_OPEN_FAIL;
-		    fprintf(stderr,"\nUnable to Open Site File <%s> for reading\n",input_file_ptr);
-		    XBell((Display *) XtDisplay(mainWindow),100);
-		    status = MB_FAILURE;
-		    return(status);
-		    }
-	    while ((result = fgets(buffer,MB_PATH_MAXLINE,sfp)) == buffer)
-		    {
-		    if (buffer[0] != '#')
-		    	nsite++;
-		    }
-	    fclose(sfp);
-
-	    /* allocate arrays for sites */
-	    if (nsite > 0)
-		{
-		/* allocate the arrays */
-		sitelon = NULL;
-		sitelat = NULL;
-		sitetopo = NULL;
-		sitecolor = NULL;
-		sitesize = NULL;
-		sitename = NULL;
-		status = mbview_allocsitearrays(verbose,
-			nsite, &sitelon, &sitelat, &sitetopo,
-			&sitecolor, &sitesize, &sitename, &error);
-
-		/* if error initializing memory then cancel dealing with sites */
-		if (status == MB_FAILURE)
-			{
-			nsite = 0;
-			fprintf(stderr,"\nUnable to allocate arrays for %d sites\n",nsite);
-			XBell((Display *) XtDisplay(mainWindow),100);
-			return(status);
-			}
-		}
-
-	    /* read the sites from the input file */
-	    if (nsite > 0)
-	    	{
-		nsite = 0;
-		if ((sfp = fopen(input_file_ptr, "r")) == NULL)
-			{
-			error = MB_ERROR_OPEN_FAIL;
-			status = MB_FAILURE;
-			fprintf(stderr,"\nUnable to open site file <%s> for reading\n",input_file_ptr);
-			XBell((Display *) XtDisplay(mainWindow),100);
-			return(status);
-			}
-		while ((result = fgets(buffer,MB_PATH_MAXLINE,sfp)) == buffer)
-		    {
-		    site_ok = MB_NO;
-
-		    /* deal with site in form: lon lat topo color size name */
-		    if (buffer[0] != '#')
-		    	{
-			nget = sscanf(buffer,"%lf %lf %lf %d %d %[^\n]",
-			    &sitelon[nsite], &sitelat[nsite], &sitetopo[nsite],
-			    &sitecolor[nsite], &sitesize[nsite],
-			    sitename[nsite]);
-		    	if (nget >= 2)
-			    site_ok = MB_YES;
-			}
-		    if (site_ok == MB_YES)
-			{
-		    	if (nget < 6)
-		    	    {
-			    name = (char *) sitename[nsite];
-			    name[0] = '\0';
-			    }
-		    	if (nget < 5)
-			    sitesize[nsite] = 0;
-		    	if (nget < 4)
-			    sitecolor[nsite] = 0;
-		    	if (nget < 3)
-			    sitetopo[nsite] = MBV_DEFAULT_NODATA;
-			}
-
-		    /* output some debug values */
-		    if (verbose > 0 && site_ok == MB_YES)
-			    {
-			    fprintf(stderr,"\ndbg5  Site point read in program <%s>\n",program_name);
-			    fprintf(stderr,"dbg5       site[%d]: %f %f %f  %d %d  %s\n",
-				    nsite,sitelon[nsite],sitelat[nsite],sitetopo[nsite],
-				    sitecolor[nsite],sitesize[nsite],
-				    sitename[nsite]);
-			    }
-		    else if (verbose > 0 && site_ok == MB_NO)
-			    {
-			    fprintf(stderr,"\ndbg5  Unintelligible line read from site file in program <%s>\n",program_name);
-			    fprintf(stderr,"dbg5       buffer:  %s\n",
-				   buffer);
-			    }
-
-		    strncpy(buffer,"\0",sizeof(buffer));
-		    if (site_ok == MB_YES)
-		    	nsite++;
-		    }
-		fclose(sfp);
-		}
-
-	    /* add the sites */
-	    if (nsite > 0)
-	    	{
-	    	status = mbview_addsites(verbose, instance,
-			nsite, sitelon, sitelat, sitetopo,
-			sitecolor, sitesize, sitename,
-			&error);
-
-	    	/* update widgets */
-	    	if (status == MB_SUCCESS)
-	    	status = mbview_update(verbose, instance, &error);
-		}
-
-	    /* deallocate memory */
-	    if (nsite > 0)
-	    	{
-		status = mbview_freesitearrays(verbose,
-			&sitelon, &sitelat, &sitetopo,
-			&sitecolor, &sitesize, &sitename, &error);
-		}
-
-	    }
-
-	/* set sensitivity of widgets that require an mbview instance to be active */
-	do_mbgrdviz_sensitivity( );
-
-	/* all done */
-	return(status);
-}
-/*---------------------------------------------------------------------------------------*/
-
-int do_mbgrdviz_savesite(size_t instance, char *output_file_ptr)
-{
-	char function_name[] = "do_mbgrdviz_savesite";
-	int	status = MB_SUCCESS;
-	FILE	*sfp;
-	int	nsite;
-	double	*sitelon;
-	double	*sitelat;
-	double	*sitetopo;
-	int	*sitecolor;
-	int	*sitesize;
-	mb_path	*sitename;
-	int	i;
-
-	/* time, user, host variables */
-	time_t	right_now;
-	char	date[32], *user_ptr, host[MB_PATH_MAXLINE];
-	char	*unknown = "Unknown";
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       instance:        %zu\n",instance);
-		fprintf(stderr,"dbg2       output_file_ptr: %s\n",output_file_ptr);
-		}
-
-	/* read data for valid instance */
-	if (instance != MBV_NO_WINDOW)
-	    {
-
-	    /* get the number of sites to be written to the outpuf file */
-	    status = mbview_getsitecount(verbose, instance, &nsite, &error);
-	    if (status == MB_SUCCESS && nsite <= 0)
-	    	{
-		fprintf(stderr,"Unable to write site file...\nCurrently %d sites defined for instance %zu!\n",
-			nsite, instance);
-		XBell((Display *) XtDisplay(mainWindow),100);
-		status = MB_FAILURE;
-		}
-
-	    /* allocate arrays for sites */
-	    if (status == MB_SUCCESS && nsite > 0)
-		{
-		/* allocate the arrays */
-		sitelon = NULL;
-		sitelat = NULL;
-		sitetopo = NULL;
-		sitecolor = NULL;
-		sitesize = NULL;
-		sitename = NULL;
-		status = mbview_allocsitearrays(verbose,
-			nsite, &sitelon, &sitelat, &sitetopo,
-			&sitecolor, &sitesize, &sitename, &error);
-
-		/* if error initializing memory then cancel dealing with sites */
-		if (status == MB_FAILURE)
-	    		{
-			nsite = 0;
-			fprintf(stderr,"Unable to write site file...\nArray allocation for %d sites failed for instance %zu!\n",
-				nsite, instance);
-			XBell((Display *) XtDisplay(mainWindow),100);
-			}
-		}
-
-	    /* get the sites */
-	    if (status == MB_SUCCESS)
-	    	{
-	    	status = mbview_getsites(verbose, instance,
-			&nsite, sitelon, sitelat, sitetopo,
-			sitecolor, sitesize, sitename,
-			&error);
-		}
-
-	    /* write the sites to the output file */
-	    if (status == MB_SUCCESS)
-	    	{
-		/* open the output file */
-		if ((sfp = fopen(output_file_ptr, "w")) != NULL)
-			{
-			/* write the site file header */
-			fprintf(sfp, "## Site File Version %s\n", MBGRDVIZ_SITE_VERSION);
-			fprintf(sfp, "## Output by Program %s\n",program_name);
-			fprintf(sfp, "## Program Version %s\n",rcs_id);
-			fprintf(sfp, "## MB-System Version %s\n",MB_VERSION);
-			right_now = time((time_t *)0);
-			strcpy(date,ctime(&right_now));
-                        date[strlen(date)-1] = '\0';
-			if ((user_ptr = getenv("USER")) == NULL)
-				if ((user_ptr = getenv("LOGNAME")) == NULL)
-					user_ptr = unknown;
-			gethostname(host,MB_PATH_MAXLINE);
-			fprintf(sfp, "## Run by user <%s> on cpu <%s> at <%s>\n",
-				user_ptr,host,date);
-			fprintf(sfp, "## Number of sites: %d\n",nsite);
-
-			/* loop over the sites */
-			for (i=0;i<nsite;i++)
-				{
-				fprintf(sfp,"%12.7f %12.7f %10.3f %2d %2d %s\n",
-			 	   	sitelon[i], sitelat[i], sitetopo[i],
-			    		sitecolor[i], sitesize[i],
-			    		sitename[i]);
-
-				}
-
-			/* close the output file */
-			fclose(sfp);
-			}
-
-		/* output error message */
-		else
-			{
-			error = MB_ERROR_OPEN_FAIL;
-			fprintf(stderr,"\nUnable to Open Site File <%s> for writing\n",output_file_ptr);
-			XBell((Display *) XtDisplay(mainWindow),100);
-			status = MB_FAILURE;
-			}
-		}
-
-	    /* deallocate arrays for sites */
-	    if (nsite > 0)
-	    	{
-		status = mbview_freesitearrays(verbose,
-			&sitelon, &sitelat, &sitetopo,
-			&sitecolor, &sitesize, &sitename, &error);
-		}
-
-	    }
-
-	/* all done */
-	return(status);
-}
-/*---------------------------------------------------------------------------------------*/
-
-int do_mbgrdviz_openroute(size_t instance, char *input_file_ptr)
-{
-	char function_name[] = "do_mbgrdviz_openroute";
-	int	status = MB_SUCCESS;
-	FILE	*sfp;
-	char	buffer[MB_PATH_MAXLINE];
-	int	npoint = 0;
-	int	npointalloc = 0;
-	double	*routelon = NULL;
-	double	*routelat = NULL;
-	double	lon, lat, topo;
-	int	*routewaypoint = NULL;
-	int	routecolor;
-	int	routesize;
-	int	routeeditmode;
-	mb_path	routename;
-	int	iroute;
-	int	waypoint;
-	int	rawroutefile = MB_YES;
-	char	*result;
-	int	nget;
-	int	point_ok;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       instance:        %zu\n",instance);
-		fprintf(stderr,"dbg2       input_file_ptr:  %s\n",input_file_ptr);
-		}
-
-	/* read data for valid instance */
-	if (instance != MBV_NO_WINDOW)
-	    {
-	    /* initialize route values */
-	    routecolor = MBV_COLOR_BLUE;
-	    routesize = 1;
-            routeeditmode = MB_YES;
-	    routename[0] = '\0';
-	    rawroutefile = MB_YES;
-	    npoint = 0;
-	    npointalloc = 0;
-
-	    /* open the input file */
-	    if ((sfp = fopen(input_file_ptr, "r")) == NULL)
-		    {
-		    error = MB_ERROR_OPEN_FAIL;
-		    status = MB_FAILURE;
-		    fprintf(stderr,"\nUnable to open route file <%s> for reading\n",input_file_ptr);
-		    XBell((Display *) XtDisplay(mainWindow),100);
-		    }
-
-	    /* loop over reading */
-	    if (status == MB_SUCCESS)
-	    	{
-		while ((result = fgets(buffer,MB_PATH_MAXLINE,sfp)) == buffer)
-		    {
-		    /* deal with comments */
-		    if (buffer[0] == '#')
-		    	{
-			if (rawroutefile == MB_YES
-				&& strncmp(buffer,"## Route File Version", 21) == 0)
-				{
-				rawroutefile = MB_NO;
-				}
-			else if (strncmp(buffer,"## ROUTENAME", 12) == 0)
-				{
-                                strcpy(routename, &buffer[13]);
-                                if (routename[strlen(routename)-1] == '\n')
-                                    routename[strlen(routename)-1] = '\0';
-                                if (routename[strlen(routename)-1] == '\r')
-                                    routename[strlen(routename)-1] = '\0';
-				}
-			else if (strncmp(buffer,"## ROUTECOLOR", 13) == 0)
-				{
-				sscanf(buffer,"## ROUTECOLOR %d", &routecolor);
-				}
-			else if (strncmp(buffer,"## ROUTESIZE", 12) == 0)
-				{
-				sscanf(buffer,"## ROUTESIZE %d", &routesize);
-				}
-			else if (strncmp(buffer,"## ROUTEEDITMODE", 16) == 0)
-				{
-				sscanf(buffer,"## ROUTEEDITMODE %d", &routeeditmode);
-				}
-			}
-
-		    /* deal with route segment marker */
-		    else if (buffer[0] == '>')
-		    	{
-			/* if data accumulated call mbview_addroute() */
-			if (npoint > 0)
-			    {
-			    status = mbview_addroute(verbose, instance,
-			    				npoint, routelon, routelat, routewaypoint,
-							routecolor, routesize, routeeditmode, routename,
-							&iroute, &error);
-			    npoint = 0;
-			    }
-			}
-
-		    /* deal with data */
-		    else
-		        {
-			/* read the data from the buffer */
-			nget = sscanf(buffer,"%lf %lf %lf %d",
-			    &lon, &lat, &topo, &waypoint);
-		    	if ((rawroutefile == MB_YES && nget >= 2)
-				|| (rawroutefile == MB_NO && nget >= 3 && waypoint > MBV_ROUTE_WAYPOINT_NONE))
-			    point_ok = MB_YES;
-			else
-			    point_ok = MB_NO;
-
-			/* if good data check for need to allocate more space */
-			if (point_ok == MB_YES
-				&& npoint + 1 > npointalloc)
-			    {
-			    npointalloc += MBV_ALLOC_NUM;
-			    status = mbview_allocroutearrays(verbose,
-						    npointalloc,
-						    &routelon,
-						    &routelat,
-						    &routewaypoint,
-						    NULL,
-						    NULL,
-						    NULL,
-						    NULL,
-						    NULL,
-						    &error);
-			    if (status != MB_SUCCESS)
-				    {
-				    npointalloc = 0;
-				    }
-			    }
-
-			/* add good point to route */
-			if (point_ok == MB_YES && npointalloc > npoint)
-			    {
-			    routelon[npoint] = lon;
-			    routelat[npoint] = lat;
-			    routewaypoint[npoint] = waypoint;
-			    npoint++;
-			    }
-			}
-		    }
-
-		/* add last route if not already handled */
-		if (npoint > 0)
-		    {
-		    status = mbview_addroute(verbose, instance,
-			    			npoint, routelon, routelat, routewaypoint,
-						routecolor, routesize, routeeditmode, routename,
-						&iroute, &error);
-		    npoint = 0;
-		    }
-
-		/* free the memory */
-		if (npointalloc > 0)
-		status = mbview_freeroutearrays(verbose,
-						    &routelon,
-						    &routelat,
-						    &routewaypoint,
-						    NULL,
-						    NULL,
-						    NULL,
-						    NULL,
-						    NULL,
-						    &error);
-
-		/* close the input file */
-		fclose(sfp);
-		}
-
-	    /* update widgets */
-	    if (status == MB_SUCCESS)
-	    status = mbview_update(verbose, instance, &error);
-	    }
-
-
-	/* set sensitivity of widgets that require an mbview instance to be active */
-	do_mbgrdviz_sensitivity( );
-
-	/* all done */
-	return(status);
-}
-/*---------------------------------------------------------------------------------------*/
-
-int do_mbgrdviz_saveroute(size_t instance, char *output_file_ptr)
-{
-	char function_name[] = "do_mbgrdviz_saveroute";
-	int	status = MB_SUCCESS;
-	FILE	*sfp;
-	int	nroute = 0;
-	int	nroutewrite = 0;
-	int	npoint = 0;
-	int	nintpoint = 0;
-	int	npointtotal = 0;
-	int	npointalloc = 0;
-	double	*routelon = NULL;
-	double	*routelat = NULL;
-	int	*routewaypoint = NULL;
-	double	*routetopo = NULL;
-	double	*routebearing = NULL;
-	double	*distlateral = NULL;
-	double	*distovertopo = NULL;
-	double	*slope = NULL;
-	int	routecolor;
-	int	routesize;
-	mb_path	routename;
-	int	selected;
-	int	iroute, j;
-
-	/* time, user, host variables */
-	time_t	right_now;
-	char	date[32], *user_ptr, host[MB_PATH_MAXLINE];
-	char	*unknown = "Unknown";
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       instance:        %zu\n",instance);
-		fprintf(stderr,"dbg2       output_file_ptr: %s\n",output_file_ptr);
-		}
-
-	/* read data for valid instance */
-	if (instance != MBV_NO_WINDOW)
-	    {
-
-	    /* get the number of routes to be written to the outpuf file */
-	    status = mbview_getroutecount(verbose, instance, &nroute, &error);
-	    for (iroute=0;iroute<nroute;iroute++)
-	    	{
-		mbview_getrouteselected(verbose, instance, iroute, &selected, &error);
-		if (selected == MB_YES)
-			nroutewrite++;
-		}
-	    if (nroutewrite == 0)
-	    	nroutewrite = nroute;
-	    if (nroute <= 0)
-	    	{
-		fprintf(stderr,"Unable to write route file...\nCurrently %d routes defined for instance %zu!\n",
-			nroute, instance);
-		XBell((Display *) XtDisplay(mainWindow),100);
-		status = MB_FAILURE;
-		}
-
-	    /* initialize the output file */
-	    if (status == MB_SUCCESS && nroutewrite > 0)
-	    	{
-		/* open the output file */
-		if ((sfp = fopen(output_file_ptr, "w")) != NULL)
-			{
-			/* write the route file header */
-			fprintf(sfp, "## Route File Version %s\n", MBGRDVIZ_ROUTE_VERSION);
-			fprintf(sfp, "## Output by Program %s\n",program_name);
-			fprintf(sfp, "## Program Version %s\n",rcs_id);
-			fprintf(sfp, "## MB-System Version %s\n",MB_VERSION);
-			right_now = time((time_t *)0);
-			strcpy(date,ctime(&right_now));
-                        date[strlen(date)-1] = '\0';
-			if ((user_ptr = getenv("USER")) == NULL)
-				if ((user_ptr = getenv("LOGNAME")) == NULL)
-					user_ptr = unknown;
-			gethostname(host,MB_PATH_MAXLINE);
-			fprintf(sfp, "## Run by user <%s> on cpu <%s> at <%s>\n",
-				user_ptr,host,date);
-			fprintf(sfp, "## Number of routes: %d\n",nroutewrite);
-			fprintf(sfp, "## Route point format:\n");
-			fprintf(sfp, "##   <longitude (deg)> <latitude (deg)> <topography (m)> <waypoint (boolean)> <bearing (deg)> <lateral distance (m)> <distance along topography (m)> <slope (m/m)>\n");
-			}
-
-		/* output error message */
-		else
-			{
-			error = MB_ERROR_OPEN_FAIL;
-			status = MB_FAILURE;
-			fprintf(stderr,"\nUnable to Open route file <%s> for writing\n",output_file_ptr);
-			XBell((Display *) XtDisplay(mainWindow),100);
-			}
-		}
-
-	    /* if all ok proceed to extract and output routes */
-	    if (status == MB_SUCCESS && nroutewrite > 0)
-	    	{
-	        /* loop over routes */
-		for (iroute=0;iroute<nroute;iroute++)
-	    	    {
-		    /* check if this route is selected for writing */
-		    if (nroutewrite == nroute)
-		    	selected = MB_YES;
-		    else
-			mbview_getrouteselected(verbose, instance, iroute, &selected, &error);
-
-		    /* output if selected */
-		    if (selected == MB_YES)
-		    	{
-			/* get point count for current route */
-			status = mbview_getroutepointcount(verbose, instance,
-				iroute, &npoint, &nintpoint, &error);
-
-			/* allocate route arrays */
-			npointtotal = npoint + nintpoint;
-			if (status == MB_SUCCESS
-				&& npointalloc < npointtotal)
-				{
-				status = mbview_allocroutearrays(verbose,
-							npointtotal,
-							&routelon,
-							&routelat,
-							&routewaypoint,
-							&routetopo,
-							&routebearing,
-							&distlateral,
-							&distovertopo,
-							&slope,
-							&error);
-				if (status == MB_SUCCESS)
-					{
-					npointalloc = npointtotal;
-					}
-
-				/* if error initializing memory then cancel dealing with this route */
-				else
-	    				{
-					fprintf(stderr,"Unable to write route...\nArray allocation for %d points failed for instance %zu!\n",
-						npointtotal, instance);
-					XBell((Display *) XtDisplay(mainWindow),100);
-					npoint = 0;
-					nintpoint = 0;
-					npointtotal = 0;
-					}
-				}
-
-			/* extract data for route */
-			status = mbview_getroute(verbose, instance,
-						iroute,
-						&npointtotal,
-						routelon,
-						routelat,
-						routewaypoint,
-						routetopo,
-						routebearing,
-						distlateral,
-						distovertopo,
-						slope,
-						&routecolor,
-						&routesize,
-						routename,
-						&error);
-
-			/* write the route header */
-			fprintf(sfp,"## ROUTENAME %s\n", routename);
-			fprintf(sfp,"## ROUTESIZE %d\n", routesize);
-			fprintf(sfp,"## ROUTECOLOR %d\n", routecolor);
-			fprintf(sfp,"## ROUTEPOINTS %d\n", npointtotal);
-			fprintf(sfp,"> ## STARTROUTE\n");
-
-			/* write the route points */
-			for (j=0;j<npointtotal;j++)
-				{
-				fprintf(sfp,"%f %f %f %d %f %f %f %f",
-					routelon[j], routelat[j],
-					routetopo[j],
-					routewaypoint[j], routebearing[j],
-					distlateral[j], distovertopo[j], slope[j]);
-				if (routewaypoint[j] == MBV_ROUTE_WAYPOINT_SIMPLE)
-			    	    fprintf(sfp," ## WAYPOINT\n");
-				else if (routewaypoint[j] == MBV_ROUTE_WAYPOINT_TRANSIT)
-			    	    fprintf(sfp," ## WAYPOINT TRANSIT\n");
-				else if (routewaypoint[j] == MBV_ROUTE_WAYPOINT_STARTLINE)
-			    	    fprintf(sfp," ## WAYPOINT STARTLINE\n");
-				else if (routewaypoint[j] == MBV_ROUTE_WAYPOINT_ENDLINE)
-			    	    fprintf(sfp," ## WAYPOINT ENDLINE\n");
-				else if (routewaypoint[j] == MBV_ROUTE_WAYPOINT_STARTLINE2)
-			    	    fprintf(sfp," ## WAYPOINT STARTLINE2\n");
-				else if (routewaypoint[j] == MBV_ROUTE_WAYPOINT_ENDLINE2)
-			    	    fprintf(sfp," ## WAYPOINT ENDLINE2\n");
-				else if (routewaypoint[j] == MBV_ROUTE_WAYPOINT_STARTLINE3)
-			    	    fprintf(sfp," ## WAYPOINT STARTLINE3\n");
-				else if (routewaypoint[j] == MBV_ROUTE_WAYPOINT_ENDLINE3)
-			    	    fprintf(sfp," ## WAYPOINT ENDLINE3\n");
-				else if (routewaypoint[j] == MBV_ROUTE_WAYPOINT_STARTLINE4)
-			    	    fprintf(sfp," ## WAYPOINT STARTLINE4\n");
-				else if (routewaypoint[j] == MBV_ROUTE_WAYPOINT_ENDLINE4)
-			    	    fprintf(sfp," ## WAYPOINT ENDLINE4\n");
-				else
-			    	    fprintf(sfp,"\n");
-				}
-
-			/* write the route end */
-			fprintf(sfp,"> ## ENDROUTE\n");
-			}
-
-		    /* deallocate arrays */
-		    if (npointalloc > 0)
-	    		{
-			status = mbview_freeroutearrays(verbose,
-						&routelon,
-						&routelat,
-						&routewaypoint,
-						&routetopo,
-						&routebearing,
-						&distlateral,
-						&distovertopo,
-						&slope,
-						&error);
-			}
-		    }
-
-		/* close the output file */
-		fclose(sfp);
-
-		}
-	    }
-
-	/* all done */
-	return(status);
-}
-/*---------------------------------------------------------------------------------------*/
-
-int do_mbgrdviz_saverisiscript(size_t instance, char *output_file_ptr)
-{
-	char function_name[] = "do_mbgrdviz_saverisiscript";
-	int	status = MB_SUCCESS;
-	FILE	*sfp;
-	int	nroute = 0;
-	int	nroutewrite = 0;
-	int	npoint = 0;
-	int	nintpoint = 0;
-	int	npointtotal = 0;
-	int	npointalloc = 0;
-	double	*routelon = NULL;
-	double	*routelat = NULL;
-	int	*routewaypoint = NULL;
-	double	*routetopo = NULL;
-	double	*routebearing = NULL;
-	double	*distlateral = NULL;
-	double	*distovertopo = NULL;
-	double	*slope = NULL;
-	int	routecolor;
-	int	routesize;
-	mb_path	routename;
-	int	selected;
-	int	iroute, j;
-        int     projection_initialized = MB_NO;
-        double  lon_origin, lat_origin;
-        double  mtodeglon, mtodeglat;
-        int     iscript;
-        double  xx, yy, zz;
-        double  vvspeed = 0.2;
-        double  settlingtime = 3.0;
-
-	/* time, user, host variables */
-	time_t	right_now;
-	char	date[32], *user_ptr, host[MB_PATH_MAXLINE];
-	char	*unknown = "Unknown";
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       instance:        %zu\n",instance);
-		fprintf(stderr,"dbg2       output_file_ptr: %s\n",output_file_ptr);
-		}
-
-	/* read data for valid instance */
-	if (instance != MBV_NO_WINDOW)
-	    {
-
-	    /* get the number of routes to be written to the outpuf file */
-	    status = mbview_getroutecount(verbose, instance, &nroute, &error);
-	    for (iroute=0;iroute<nroute;iroute++)
-	    	{
-		mbview_getrouteselected(verbose, instance, iroute, &selected, &error);
-		if (selected == MB_YES)
-			nroutewrite++;
-		}
-	    if (nroutewrite == 0)
-	    	nroutewrite = nroute;
-	    if (nroute <= 0)
-	    	{
-		fprintf(stderr,"Unable to write route file...\nCurrently %d routes defined for instance %zu!\n",
-			nroute, instance);
-		XBell((Display *) XtDisplay(mainWindow),100);
-		status = MB_FAILURE;
-		}
-
-	    /* initialize the output file */
-	    if (status == MB_SUCCESS && nroutewrite > 0)
-	    	{
-		/* open the output file */
-		if ((sfp = fopen(output_file_ptr, "w")) != NULL)
-			{
-			/* write the route file header */
-			fprintf(sfp, "## Risi Script Version %s\r\n", MBGRDVIZ_RISISCRIPT_VERSION);
-			fprintf(sfp, "## Output by Program %s\r\n",program_name);
-			fprintf(sfp, "## Program Version %s\r\n",rcs_id);
-			fprintf(sfp, "## MB-System Version %s\r\n",MB_VERSION);
-			right_now = time((time_t *)0);
-			strcpy(date,ctime(&right_now));
-                        date[strlen(date)-1] = '\0';
-			if ((user_ptr = getenv("USER")) == NULL)
-				if ((user_ptr = getenv("LOGNAME")) == NULL)
-					user_ptr = unknown;
-			gethostname(host,MB_PATH_MAXLINE);
-			fprintf(sfp, "## Run by user <%s> on cpu <%s> at <%s>\r\n",
-				user_ptr,host,date);
-			fprintf(sfp, "## Number of routes: %d\r\n",nroutewrite);
-			fprintf(sfp, "## Risi script format:\r\n");
-			fprintf(sfp, "##   <id (starting at 1)> <x (m)> <y (m)> <z (m but ignored)> <speed (m/s)> <settling time (sec)>\r\n");
-			}
-
-		/* output error message */
-		else
-			{
-			error = MB_ERROR_OPEN_FAIL;
-			status = MB_FAILURE;
-			fprintf(stderr,"\nUnable to Open route file <%s> for writing\r\n",output_file_ptr);
-			XBell((Display *) XtDisplay(mainWindow),100);
-			}
-		}
-
-	    /* if all ok proceed to extract and output routes */
-	    if (status == MB_SUCCESS && nroutewrite > 0)
-	    	{
-	        /* loop over routes */
-		for (iroute=0;iroute<nroute;iroute++)
-	    	    {
-		    /* check if this route is selected for writing */
-		    if (nroutewrite == nroute)
-		    	selected = MB_YES;
-		    else
-			mbview_getrouteselected(verbose, instance, iroute, &selected, &error);
-
-		    /* output if selected */
-		    if (selected == MB_YES)
-		    	{
-			/* get point count for current route */
-			status = mbview_getroutepointcount(verbose, instance,
-				iroute, &npoint, &nintpoint, &error);
-
-			/* allocate route arrays */
-			npointtotal = npoint + nintpoint;
-			if (status == MB_SUCCESS
-				&& npointalloc < npointtotal)
-				{
-				status = mbview_allocroutearrays(verbose,
-							npointtotal,
-							&routelon,
-							&routelat,
-							&routewaypoint,
-							&routetopo,
-							&routebearing,
-							&distlateral,
-							&distovertopo,
-							&slope,
-							&error);
-				if (status == MB_SUCCESS)
-					{
-					npointalloc = npointtotal;
-					}
-
-				/* if error initializing memory then cancel dealing with this route */
-				else
-	    				{
-					fprintf(stderr,"Unable to write route...\nArray allocation for %d points failed for instance %zu!\n",
-						npointtotal, instance);
-					XBell((Display *) XtDisplay(mainWindow),100);
-					npoint = 0;
-					nintpoint = 0;
-					npointtotal = 0;
-					}
-				}
-
-			/* extract data for route */
-			status = mbview_getroute(verbose, instance,
-						iroute,
-						&npointtotal,
-						routelon,
-						routelat,
-						routewaypoint,
-						routetopo,
-						routebearing,
-						distlateral,
-						distovertopo,
-						slope,
-						&routecolor,
-						&routesize,
-						routename,
-						&error);
-
-			/* write the route header */
-			fprintf(sfp,"## ROUTENAME %s\r\n", routename);
-			fprintf(sfp,"## ROUTEPOINTS %d\r\n", npointtotal);
-			fprintf(sfp,"## STARTROUTE\r\n");
-
-			/* write the route points */
-                        iscript = 0;
-                        vvspeed = 0.2;
-                        settlingtime = 3.0;
-			for (j=0;j<npointtotal;j++)
-				{
-                                if (projection_initialized == MB_NO)
-                                    {
-                                    mb_coor_scale(verbose, routelat[j], &mtodeglon, &mtodeglat);
-                                    lon_origin = routelon[j];
-                                    lat_origin = routelat[j];
-                                    projection_initialized = MB_YES;
-                                    }
-				if (routewaypoint[j] > MBV_ROUTE_WAYPOINT_NONE)
-                                    {
-                                    iscript++;
-                                    xx = (routelon[j] - lon_origin) / mtodeglon;
-                                    yy = (routelat[j] - lat_origin) / mtodeglat;
-                                    zz = 0.0;
-			    	    fprintf(sfp,"%d, %.3f, %.3f, %.3f, %.3f, %.3f\r\n",
-                                            iscript, xx, yy, zz, vvspeed, settlingtime);
-                                    }
-				}
-
-			/* write the route end */
-			fprintf(sfp,"## ENDROUTE\r\n");
-			}
-
-		    /* deallocate arrays */
-		    if (npointalloc > 0)
-	    		{
-			status = mbview_freeroutearrays(verbose,
-						&routelon,
-						&routelat,
-						&routewaypoint,
-						&routetopo,
-						&routebearing,
-						&distlateral,
-						&distovertopo,
-						&slope,
-						&error);
-			}
-		    }
-
-		/* close the output file */
-		fclose(sfp);
-
-		}
-	    }
-
-	/* all done */
-	return(status);
-}
-/*---------------------------------------------------------------------------------------*/
-
-int do_mbgrdviz_savewinfrogpts(size_t instance, char *output_file_ptr)
-{
-	char function_name[] = "do_mbgrdviz_savewinfrogpts";
-	int	status = MB_SUCCESS;
-	FILE	*sfp;
-	int	nroute = 0;
-	int	npoint = 0;
-	int	nintpoint = 0;
-	int	npointtotal = 0;
-	int	npointalloc = 0;
-	double	*routelon = NULL;
-	double	*routelat = NULL;
-	int	*routewaypoint = NULL;
-	double	*routetopo = NULL;
-	double	*routebearing = NULL;
-	double	*distlateral = NULL;
-	double	*distovertopo = NULL;
-	double	*slope = NULL;
-	int	routecolor;
-	int	routesize;
-	mb_path	routename;
-	int	iroute, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       instance:        %zu\n",instance);
-		fprintf(stderr,"dbg2       output_file_ptr: %s\n",output_file_ptr);
-		}
-
-	/* read data for valid instance */
-	if (instance != MBV_NO_WINDOW)
-	    {
-
-	    /* get the number of routes to be written to the outpuf file */
-	    status = mbview_getroutecount(verbose, instance, &nroute, &error);
-	    if (nroute <= 0)
-	    	{
-		fprintf(stderr,"Unable to write route file...\nCurrently %d routes defined for instance %zu!\n",
-			nroute, instance);
-		XBell((Display *) XtDisplay(mainWindow),100);
-		status = MB_FAILURE;
-		}
-
-	    /* initialize the output file */
-	    if (status == MB_SUCCESS && nroute > 0)
-	    	{
-		/* open the output file */
-		if ((sfp = fopen(output_file_ptr, "w")) == NULL)
-			{
-			error = MB_ERROR_OPEN_FAIL;
-			status = MB_FAILURE;
-			fprintf(stderr,"\nUnable to Open route file <%s> for writing\n",output_file_ptr);
-			XBell((Display *) XtDisplay(mainWindow),100);
-			}
-		}
-
-	    /* if all ok proceed to extract and output routes */
-	    if (status == MB_SUCCESS)
-	    	{
-	        /* loop over routes */
-		for (iroute=0;iroute<nroute;iroute++)
-	    	    {
-		    /* get point count for current route */
-		    status = mbview_getroutepointcount(verbose, instance,
-			    iroute, &npoint, &nintpoint, &error);
-
-		    /* allocate route arrays */
-		    npointtotal = npoint + nintpoint;
-		    if (status == MB_SUCCESS
-			    && npointalloc < npointtotal)
-			    {
-			    status = mbview_allocroutearrays(verbose,
-						    npointtotal,
-						    &routelon,
-						    &routelat,
-						    &routewaypoint,
-						    &routetopo,
-						    &routebearing,
-						    &distlateral,
-						    &distovertopo,
-						    &slope,
-						    &error);
-			    if (status == MB_SUCCESS)
-				    {
-				    npointalloc = npointtotal;
-				    }
-
-			    /* if error initializing memory then cancel dealing with this route */
-			    else
-	    			    {
-				    fprintf(stderr,"Unable to write route...\nArray allocation for %d points failed for instance %zu!\n",
-					    npointtotal, instance);
-				    XBell((Display *) XtDisplay(mainWindow),100);
-				    npoint = 0;
-				    nintpoint = 0;
-				    npointtotal = 0;
-				    }
-			    }
-
-		    /* extract data for route */
-		    status = mbview_getroute(verbose, instance,
-					    iroute,
-					    &npointtotal,
-					    routelon,
-					    routelat,
-					    routewaypoint,
-					    routetopo,
-					    routebearing,
-					    distlateral,
-					    distovertopo,
-					    slope,
-					    &routecolor,
-					    &routesize,
-					    routename,
-					    &error);
-
-		    /* write the route header */
-		    fprintf(sfp, "0,%s,0,0.000,0.000,1,2,65280,0,0.200,0,0,1.000\r\n", routename);
-
-		    /* write the route points */
-		    for (j=0;j<npointtotal;j++)
-			    {
-			    if (routewaypoint[j] != MBV_ROUTE_WAYPOINT_NONE)
- 			        fprintf(sfp,"1,%.10f,%.10f,0.00m,0.00m,0.00,0.00,%.3f\r\n", routelat[j], routelon[j], distlateral[j]);
-			    }
-		    }
-
-		/* close the output file */
-		fclose(sfp);
-
-		/* deallocate arrays */
-		if (npointalloc > 0)
-	    	    {
-		    status = mbview_freeroutearrays(verbose,
-					    &routelon,
-					    &routelat,
-					    &routewaypoint,
-					    &routetopo,
-					    &routebearing,
-					    &distlateral,
-					    &distovertopo,
-					    &slope,
-					    &error);
-		    }
-		}
-	    }
-
-	/* all done */
-	return(status);
-}
-/*---------------------------------------------------------------------------------------*/
-
-int do_mbgrdviz_savewinfrogwpt(size_t instance, char *output_file_ptr)
-{
-	char function_name[] = "do_mbgrdviz_savewinfrogwpt";
-	int	status = MB_SUCCESS;
-	FILE	*sfp;
-	int	nroute = 0;
-	int	npoint = 0;
-	int	nintpoint = 0;
-	int	npointtotal = 0;
-	int	npointalloc = 0;
-	double	*routelon = NULL;
-	double	*routelat = NULL;
-	int	*routewaypoint = NULL;
-	double	*routetopo = NULL;
-	double	*routebearing = NULL;
-	double	*distlateral = NULL;
-	double	*distovertopo = NULL;
-	double	*slope = NULL;
-	int	routecolor;
-	int	routesize;
-	mb_path	routename;
-	int	iroute, j, n;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       instance:        %zu\n",instance);
-		fprintf(stderr,"dbg2       output_file_ptr: %s\n",output_file_ptr);
-		}
-
-	/* read data for valid instance */
-	if (instance != MBV_NO_WINDOW)
-	    {
-
-	    /* get the number of routes to be written to the outpuf file */
-	    status = mbview_getroutecount(verbose, instance, &nroute, &error);
-	    if (nroute <= 0)
-	    	{
-		fprintf(stderr,"Unable to write route file...\nCurrently %d routes defined for instance %zu!\n",
-			nroute, instance);
-		XBell((Display *) XtDisplay(mainWindow),100);
-		status = MB_FAILURE;
-		}
-
-	    /* initialize the output file */
-	    if (status == MB_SUCCESS && nroute > 0)
-	    	{
-		/* open the output file */
-		if ((sfp = fopen(output_file_ptr, "w")) == NULL)
-			{
-			error = MB_ERROR_OPEN_FAIL;
-			status = MB_FAILURE;
-			fprintf(stderr,"\nUnable to Open route file <%s> for writing\n",output_file_ptr);
-			XBell((Display *) XtDisplay(mainWindow),100);
-			}
-		}
-
-	    /* if all ok proceed to extract and output routes */
-	    if (status == MB_SUCCESS)
-	    	{
-	        /* loop over routes */
-		for (iroute=0;iroute<nroute;iroute++)
-	    	    {
-		    /* get point count for current route */
-		    status = mbview_getroutepointcount(verbose, instance,
-			    iroute, &npoint, &nintpoint, &error);
-
-		    /* allocate route arrays */
-		    npointtotal = npoint + nintpoint;
-		    if (status == MB_SUCCESS
-			    && npointalloc < npointtotal)
-			    {
-			    status = mbview_allocroutearrays(verbose,
-						    npointtotal,
-						    &routelon,
-						    &routelat,
-						    &routewaypoint,
-						    &routetopo,
-						    &routebearing,
-						    &distlateral,
-						    &distovertopo,
-						    &slope,
-						    &error);
-			    if (status == MB_SUCCESS)
-				    {
-				    npointalloc = npointtotal;
-				    }
-
-			    /* if error initializing memory then cancel dealing with this route */
-			    else
-	    			    {
-				    fprintf(stderr,"Unable to write route...\nArray allocation for %d points failed for instance %zu!\n",
-					    npointtotal, instance);
-				    XBell((Display *) XtDisplay(mainWindow),100);
-				    npoint = 0;
-				    nintpoint = 0;
-				    npointtotal = 0;
-				    }
-			    }
-
-		    /* extract data for route */
-		    status = mbview_getroute(verbose, instance,
-					    iroute,
-					    &npointtotal,
-					    routelon,
-					    routelat,
-					    routewaypoint,
-					    routetopo,
-					    routebearing,
-					    distlateral,
-					    distovertopo,
-					    slope,
-					    &routecolor,
-					    &routesize,
-					    routename,
-					    &error);
-
-		    /* write the route points */
-		    n = 0;
-		    for (j=0;j<npointtotal;j++)
-			    {
-			    if (routewaypoint[j] != MBV_ROUTE_WAYPOINT_NONE)
-			    	{
-				n++;
- 			        fprintf(sfp,"%s %d,%.10f,%.10f,17,100.0,0.00,0.00,255,0.00\r\n",
-						routename, n, routelat[j], routelon[j]);
-				}
-			    }
-		    }
-
-		/* close the output file */
-		fclose(sfp);
-
-		/* deallocate arrays */
-		if (npointalloc > 0)
-	    	    {
-		    status = mbview_freeroutearrays(verbose,
-					    &routelon,
-					    &routelat,
-					    &routewaypoint,
-					    &routetopo,
-					    &routebearing,
-					    &distlateral,
-					    &distovertopo,
-					    &slope,
-					    &error);
-		    }
-		}
-	    }
-
-	/* all done */
-	return(status);
-}
-/*---------------------------------------------------------------------------------------*/
-
-int do_mbgrdviz_savedegdecmin(size_t instance, char *output_file_ptr)
-{
-	char function_name[] = "do_mbgrdviz_savedegdecmin";
-	int	status = MB_SUCCESS;
-	FILE	*sfp;
-	int	nroute = 0;
-	int	npoint = 0;
-	int	nintpoint = 0;
-	int	npointtotal = 0;
-	int	npointalloc = 0;
-	double	*routelon = NULL;
-	double	*routelat = NULL;
-	int	*routewaypoint = NULL;
-	double	*routetopo = NULL;
-	double	*routebearing = NULL;
-	double	*distlateral = NULL;
-	double	*distovertopo = NULL;
-	double	*slope = NULL;
-	int	routecolor;
-	int	routesize;
-	mb_path	routename;
-	char	latNS, lonEW;
-	int	latDeg, lonDeg;
-	double	latMin, lonMin;
-	int	iroute, j, n;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       instance:        %zu\n",instance);
-		fprintf(stderr,"dbg2       output_file_ptr: %s\n",output_file_ptr);
-		}
-
-	/* read data for valid instance */
-	if (instance != MBV_NO_WINDOW)
-	    {
-
-	    /* get the number of routes to be written to the outpuf file */
-	    status = mbview_getroutecount(verbose, instance, &nroute, &error);
-	    if (nroute <= 0)
-	    	{
-		fprintf(stderr,"Unable to write route file...\nCurrently %d routes defined for instance %zu!\n",
-			nroute, instance);
-		XBell((Display *) XtDisplay(mainWindow),100);
-		status = MB_FAILURE;
-		}
-
-	    /* initialize the output file */
-	    if (status == MB_SUCCESS && nroute > 0)
-	    	{
-		/* open the output file */
-		if ((sfp = fopen(output_file_ptr, "w")) == NULL)
-			{
-			error = MB_ERROR_OPEN_FAIL;
-			status = MB_FAILURE;
-			fprintf(stderr,"\nUnable to Open route file <%s> for writing\n",output_file_ptr);
-			XBell((Display *) XtDisplay(mainWindow),100);
-			}
-		}
-
-	    /* if all ok proceed to extract and output routes */
-	    if (status == MB_SUCCESS)
-	    	{
-	        /* loop over routes */
-		for (iroute=0;iroute<nroute;iroute++)
-	    	    {
-		    /* get point count for current route */
-		    status = mbview_getroutepointcount(verbose, instance,
-			    iroute, &npoint, &nintpoint, &error);
-
-		    /* allocate route arrays */
-		    npointtotal = npoint + nintpoint;
-		    if (status == MB_SUCCESS
-			    && npointalloc < npointtotal)
-			    {
-			    status = mbview_allocroutearrays(verbose,
-						    npointtotal,
-						    &routelon,
-						    &routelat,
-						    &routewaypoint,
-						    &routetopo,
-						    &routebearing,
-						    &distlateral,
-						    &distovertopo,
-						    &slope,
-						    &error);
-			    if (status == MB_SUCCESS)
-				    {
-				    npointalloc = npointtotal;
-				    }
-
-			    /* if error initializing memory then cancel dealing with this route */
-			    else
-	    			    {
-				    fprintf(stderr,"Unable to write route...\nArray allocation for %d points failed for instance %zu!\n",
-					    npointtotal, instance);
-				    XBell((Display *) XtDisplay(mainWindow),100);
-				    npoint = 0;
-				    nintpoint = 0;
-				    npointtotal = 0;
-				    }
-			    }
-
-		    /* extract data for route */
-		    status = mbview_getroute(verbose, instance,
-					    iroute,
-					    &npointtotal,
-					    routelon,
-					    routelat,
-					    routewaypoint,
-					    routetopo,
-					    routebearing,
-					    distlateral,
-					    distovertopo,
-					    slope,
-					    &routecolor,
-					    &routesize,
-					    routename,
-					    &error);
-
-		    /* write the route points */
-		    n = 0;
-		    for (j=0;j<npointtotal;j++)
-			    {
-			    if (routewaypoint[j] != MBV_ROUTE_WAYPOINT_NONE)
-			    	{
-				n++;
-				}
-			    }
-		    if (iroute > 0)
-			fprintf(sfp,"#\r\n");
-		    fprintf(sfp,"# Route: %s\r\n",routename);
-		    fprintf(sfp,"# Number of waypoints: %d\r\n",n);
-		    for (j=0;j<npointtotal;j++)
-			    {
-			    if (routewaypoint[j] != MBV_ROUTE_WAYPOINT_NONE)
-			    	{
-				if (routelat[j] >= 0.0)
-				    latNS = 'N';
-				else
-				    latNS = 'S';
-				latDeg = (int)(floor(fabs(routelat[j])));
-				latMin = (fabs(routelat[j]) - (double)latDeg) * 60.0;
-				if (routelon[j] >= 0.0)
-				    lonEW = 'E';
-				else
-				    lonEW = 'W';
-				lonDeg = (int)(floor(fabs(routelon[j])));
-				lonMin = (fabs(routelon[j]) - (double)lonDeg) * 60.0;
-
- 			        fprintf(sfp,"%c %3d %9.6f   %c %3d %9.6f \r\n",
-						latNS,latDeg,latMin,lonEW,lonDeg,lonMin);
-				}
-			    }
-		    }
-
-		/* close the output file */
-		fclose(sfp);
-
-		/* deallocate arrays */
-		if (npointalloc > 0)
-	    	    {
-		    status = mbview_freeroutearrays(verbose,
-					    &routelon,
-					    &routelat,
-					    &routewaypoint,
-					    &routetopo,
-					    &routebearing,
-					    &distlateral,
-					    &distovertopo,
-					    &slope,
-					    &error);
-		    }
-		}
-	    }
-
-	/* all done */
-	return(status);
-}
-/*---------------------------------------------------------------------------------------*/
-
-int do_mbgrdviz_savelnw(size_t instance, char *output_file_ptr)
-{
-	char function_name[] = "do_mbgrdviz_savelnw";
-	int	status = MB_SUCCESS;
-	FILE	*sfp;
-	int	nroute = 0;
-	int	npoint = 0;
-	int	nintpoint = 0;
-	int	npointtotal = 0;
-	int	npointalloc = 0;
-	double	*routelon = NULL;
-	double	*routelat = NULL;
-	int	*routewaypoint = NULL;
-	double	*routetopo = NULL;
-	double	*routebearing = NULL;
-	double	*distlateral = NULL;
-	double	*distovertopo = NULL;
-	double	*slope = NULL;
-	int	routecolor;
-	int	routesize;
-	mb_path	routename;
-	char	*error_message;
-	char	projection_id[MB_PATH_MAXLINE];
-	void	*pjptr = NULL;
-	int	proj_status;
-	int	utm_zone;
-	double	reference_lon, reference_lat;
-	double	easting, northing;
-	int	iroute, j, n;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       instance:        %zu\n",instance);
-		fprintf(stderr,"dbg2       output_file_ptr: %s\n",output_file_ptr);
-		}
-
-	/* read data for valid instance */
-	if (instance != MBV_NO_WINDOW)
-	    {
-
-	    /* get the number of routes to be written to the outpuf file */
-	    status = mbview_getroutecount(verbose, instance, &nroute, &error);
-	    if (nroute <= 0)
-	    	{
-		fprintf(stderr,"Unable to write route file...\nCurrently %d routes defined for instance %zu!\n",
-			nroute, instance);
-		XBell((Display *) XtDisplay(mainWindow),100);
-		status = MB_FAILURE;
-		}
-
-	    /* initialize the output file */
-	    if (status == MB_SUCCESS && nroute > 0)
-	    	{
-		/* open the output file */
-		if ((sfp = fopen(output_file_ptr, "w")) == NULL)
-			{
-			error = MB_ERROR_OPEN_FAIL;
-			status = MB_FAILURE;
-			fprintf(stderr,"\nUnable to Open route file <%s> for writing\n",output_file_ptr);
-			XBell((Display *) XtDisplay(mainWindow),100);
-			}
-		}
-
-	    /* if all ok proceed to extract and output routes */
-	    if (status == MB_SUCCESS)
-	    	{
-		/* output number of routes */
-		fprintf(sfp,"LNS %d\r\n",nroute);
-
-	        /* loop over routes */
-		for (iroute=0;iroute<nroute;iroute++)
-	    	    {
-		    /* get point count for current route */
-		    status = mbview_getroutepointcount(verbose, instance,
-			    iroute, &npoint, &nintpoint, &error);
-
-		    /* allocate route arrays */
-		    npointtotal = npoint + nintpoint;
-		    if (status == MB_SUCCESS
-			    && npointalloc < npointtotal)
-			    {
-			    status = mbview_allocroutearrays(verbose,
-						    npointtotal,
-						    &routelon,
-						    &routelat,
-						    &routewaypoint,
-						    &routetopo,
-						    &routebearing,
-						    &distlateral,
-						    &distovertopo,
-						    &slope,
-						    &error);
-			    if (status == MB_SUCCESS)
-				    {
-				    npointalloc = npointtotal;
-				    }
-
-			    /* if error initializing memory then cancel dealing with this route */
-			    else
-	    			    {
-				    fprintf(stderr,"Unable to write route...\nArray allocation for %d points failed for instance %zu!\n",
-					    npointtotal, instance);
-				    XBell((Display *) XtDisplay(mainWindow),100);
-				    npoint = 0;
-				    nintpoint = 0;
-				    npointtotal = 0;
-				    }
-			    }
-
-		    /* extract data for route */
-		    status = mbview_getroute(verbose, instance,
-					    iroute,
-					    &npointtotal,
-					    routelon,
-					    routelat,
-					    routewaypoint,
-					    routetopo,
-					    routebearing,
-					    distlateral,
-					    distovertopo,
-					    slope,
-					    &routecolor,
-					    &routesize,
-					    routename,
-					    &error);
-
-		    /* if the is the first route define the projection */
-		    if (pjptr == NULL && npointtotal > 0)
-			{
-			reference_lon = 0.0;
-			reference_lat = 0.0;
-			for (j=0;j<npointtotal;j++)
-			    {
-			    reference_lon += routelon[j];
-			    reference_lat += routelat[j];
-			    }
-			reference_lon = reference_lon / npointtotal;
-			reference_lat = reference_lat / npointtotal;
-			if (reference_lon < 180.0)
-				reference_lon += 360.0;
-			if (reference_lon >= 180.0)
-				reference_lon -= 360.0;
-			utm_zone = (int)(((reference_lon + 183.0)
-				/ 6.0) + 0.5);
-			if (reference_lat >= 0.0)
-				sprintf(projection_id, "UTM%2.2dN", utm_zone);
-			else
-				sprintf(projection_id, "UTM%2.2dS", utm_zone);
-			fprintf(stderr,"Reference longitude: %.9f latitude:%.9f\nOutput lnw file in projection:%s\n",
-				reference_lon,reference_lat,projection_id);
-
-			/* initialize appropriate UTM projection */
-			proj_status = mb_proj_init(verbose, projection_id, &(pjptr), &error);
-
-			/* quit if projection fails */
-			if (proj_status != MB_SUCCESS)
-				{
-				mb_error(verbose,error,&error_message);
-				fprintf(stderr,"\nMBIO Error initializing projection:\n%s\n",
-					error_message);
-				fprintf(stderr,"\nProgram terminated in <%s>\n",
-					function_name);
-				mb_memory_clear(verbose, &error);
-				exit(error);
-				}
-			}
-
-		    /* write the route points */
-		    n = 0;
-		    for (j=0;j<npointtotal;j++)
-			    {
-			    if (routewaypoint[j] != MBV_ROUTE_WAYPOINT_NONE)
-			    	{
-				n++;
-				}
-			    }
-		    fprintf(sfp,"LIN %d\r\n",n);
-		    for (j=0;j<npointtotal;j++)
-			    {
-			    if (routewaypoint[j] != MBV_ROUTE_WAYPOINT_NONE)
-			    	{
-				proj_status = mb_proj_forward(verbose,
-							pjptr,
-							routelon[j], routelat[j],
-							&easting,
-							&northing,
-							&error);
- 			        fprintf(sfp,"PTS %.2f %.2f\r\n",easting,northing);
-				}
-			    }
-		    fprintf(sfp,"LNN %d\r\nEOL\r\n",iroute+1);
-		    }
-
-		/* free the projection */
-		mb_proj_free(verbose, &pjptr, &error);
-
-		/* close the output file */
-		fclose(sfp);
-
-		/* deallocate arrays */
-		if (npointalloc > 0)
-	    	    {
-		    status = mbview_freeroutearrays(verbose,
-					    &routelon,
-					    &routelat,
-					    &routewaypoint,
-					    &routetopo,
-					    &routebearing,
-					    &distlateral,
-					    &distovertopo,
-					    &slope,
-					    &error);
-		    }
-		}
-	    }
-
-	/* all done */
-	return(status);
-}
-/*---------------------------------------------------------------------------------------*/
-
-int do_mbgrdviz_openvector(size_t instance, char *input_file_ptr)
-{
-	char function_name[] = "do_mbgrdviz_openvector";
-	int	status = MB_SUCCESS;
-	FILE	*sfp;
-	char	buffer[MB_PATH_MAXLINE];
-	int	npoint = 0;
-	int	npointalloc = 0;
-	double	*vectorlon = NULL;
-	double	*vectorlat = NULL;
-	double	*vectorz = NULL;
-	double	*vectordata = NULL;
-	double	lon, lat, z, data;
-	int	vectorcolor;
-	int	vectorsize;
-	double	vectordatamin;
-	double	vectordatamax;
-	int	minmax_set = MB_NO;
-	mb_path	vectorname;
-	int	rawvectorfile = MB_YES;
-	char	*result;
-	int	nget;
-	int	point_ok;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       instance:        %zu\n",instance);
-		fprintf(stderr,"dbg2       input_file_ptr:  %s\n",input_file_ptr);
-		}
-
-	/* read data for valid instance */
-	if (instance != MBV_NO_WINDOW)
-	    {
-	    /* initialize vector values */
-	    vectorcolor = MBV_COLOR_BLUE;
-	    vectorsize = 4;
-	    vectorname[0] = '\0';
-	    rawvectorfile = MB_YES;
-	    npoint = 0;
-	    npointalloc = 0;
-	    vectordatamin = 0.0;
-	    vectordatamax = 0.0;
-	    minmax_set = MB_NO;
-
-	    /* open the input file */
-	    if ((sfp = fopen(input_file_ptr, "r")) == NULL)
-		    {
-		    error = MB_ERROR_OPEN_FAIL;
-		    status = MB_FAILURE;
-		    fprintf(stderr,"\nUnable to open vector file <%s> for reading\n",input_file_ptr);
-		    XBell((Display *) XtDisplay(mainWindow),100);
-		    }
-
-	    /* loop over reading */
-	    if (status == MB_SUCCESS)
-	    	{
-fprintf(stderr,"Reading from vector file:%s\n",input_file_ptr);
-		while ((result = fgets(buffer,MB_PATH_MAXLINE,sfp)) == buffer)
-		    {
-		    /* deal with comments */
-		    if (buffer[0] == '#')
-		    	{
-			if (rawvectorfile == MB_YES
-				&& strncmp(buffer,"## Vector File Version", 21) == 0)
-				{
-				rawvectorfile = MB_NO;
-				}
-			else if (strncmp(buffer,"## VECTORNAME", 12) == 0)
-				{
-				sscanf(buffer,"## VECTORNAME %s", vectorname);
-				}
-			else if (strncmp(buffer,"## VECTORCOLOR", 13) == 0)
-				{
-				sscanf(buffer,"## ROUTECOLOR %d", &vectorcolor);
-				}
-			else if (strncmp(buffer,"## ROUTESIZE", 12) == 0)
-				{
-				sscanf(buffer,"## ROUTESIZE %d", &vectorsize);
-				}
-			else if (strncmp(buffer,"## MIN", 6) == 0)
-				{
-				sscanf(buffer,"## MIN %lf", &vectordatamin);
-				minmax_set = MB_YES;
-				}
-			else if (strncmp(buffer,"## MAX", 6) == 0)
-				{
-				sscanf(buffer,"## MAX %lf", &vectordatamax);
-				minmax_set = MB_YES;
-				}
-			}
-
-		    /* deal with vector segment marker */
-		    else if (buffer[0] == '>')
-		    	{
-			/* if data accumulated call mbview_addvector() */
-			if (npoint > 0)
-			    {
-			    status = mbview_addvector(verbose, instance,
-			    				npoint, vectorlon, vectorlat, vectorz, vectordata,
-							vectorcolor, vectorsize, vectorname,
-							vectordatamin, vectordatamax,
-							&error);
-			    npoint = 0;
-			    }
-			}
-
-		    /* deal with data */
-		    else
-		        {
-			/* read the data from the buffer */
-			nget = sscanf(buffer,"%lf %lf %lf %lf",
-			    		&lon, &lat, &z, &data);
-		    	if (nget == 4)
-			    point_ok = MB_YES;
-			else
-			    point_ok = MB_NO;
-
-			/* if good data check for need to allocate more space */
-			if (point_ok == MB_YES
-				&& npoint + 1 > npointalloc)
-			    {
-			    npointalloc += MBV_ALLOC_NUM;
-			    status = mbview_allocvectorarrays(verbose,
-						    npointalloc,
-						    &vectorlon,
-						    &vectorlat,
-						    &vectorz,
-						    &vectordata,
-						    &error);
-			    if (status != MB_SUCCESS)
-				    {
-				    npointalloc = 0;
-				    }
-			    }
-
-			/* add good point to vector */
-			if (point_ok == MB_YES && npointalloc > npoint)
-			    {
-			    vectorlon[npoint] = lon;
-			    vectorlat[npoint] = lat;
-			    vectorz[npoint] = z;
-			    vectordata[npoint] = data;
-
-			    /* get min max bounds if not set in file header */
-			    if (minmax_set == MB_NO)
-			    	{
-				if (npoint == 0)
-			    	    {
-				    vectordatamin = data;
-				    vectordatamax = data;
-				    }
-				else
-			    	    {
-				    vectordatamin = MIN(vectordatamin, data);
-				    vectordatamax = MAX(vectordatamax, data);
-				    }
-				}
-
-			    /* increment the counter */
-			    npoint++;
-			    }
-			}
-		    }
-
-		/* add last vector if not already handled */
-		if (npoint > 0)
-		    {
-fprintf(stderr,"Adding vector npoints:%d\n",npoint);
-		    status = mbview_addvector(verbose, instance,
-			    			npoint, vectorlon, vectorlat, vectorz, vectordata,
-						vectorcolor, vectorsize, vectorname,
-						vectordatamin, vectordatamax,
-						&error);
-		    npoint = 0;
-		    }
-
-		/* free the memory */
-		if (npointalloc > 0)
-		status = mbview_freevectorarrays(verbose,
-						    &vectorlon,
-						    &vectorlat,
-						    &vectorz,
-						    &vectordata,
-						    &error);
-
-		/* close the input file */
-		fclose(sfp);
-		}
-
-	    /* update widgets */
-	    mbview_enableviewvectors(verbose, instance, &error);
-	    status = mbview_update(verbose, instance, &error);
-	    }
-
-	/* set sensitivity of widgets that require an mbview instance to be active */
-	do_mbgrdviz_sensitivity( );
-
-	/* all done */
-	return(status);
-}
-/*---------------------------------------------------------------------------------------*/
-
-int do_mbgrdviz_saveprofile(size_t instance, char *output_file_ptr)
-{
-	char function_name[] = "do_mbgrdviz_saveprofile";
-	int	status = MB_SUCCESS;
-	FILE	*sfp;
-	int	npoints = 0;
-	int	npointalloc = 0;
-	double	*prdistance = NULL;
-	double	*prtopo = NULL;
-	int	*prboundary = NULL;
-	double	*prlon = NULL;
-	double	*prlat = NULL;
-	double	*prdistovertopo = NULL;
-	double	*prbearing = NULL;
-	double	*prslope = NULL;
-	mb_path	prsourcename;
-	double	prlength;
-	double	przmin;
-	double	przmax;
-	int	j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       instance:        %zu\n",instance);
-		fprintf(stderr,"dbg2       output_file_ptr: %s\n",output_file_ptr);
-		}
-
-	/* time, user, host variables */
-	time_t	right_now;
-	char	date[32], *user_ptr, host[MB_PATH_MAXLINE];
-	char	*unknown = "Unknown";
-
-	/* read data for valid instance */
-	if (instance != MBV_NO_WINDOW)
-	    {
-
-	    /* get the number of profiles to be written to the outpuf file */
-	    status = mbview_getprofilecount(verbose, instance, &npoints, &error);
-	    if (npoints <= 0)
-	    	{
-		fprintf(stderr,"Unable to write profile file...\nCurrently %d profile points defined for instance %zu!\n",
-			npoints, instance);
-		XBell((Display *) XtDisplay(mainWindow),100);
-		status = MB_FAILURE;
-		}
-
-	    /* initialize the output file */
-	    if (status == MB_SUCCESS && npoints > 0)
-	    	{
-		/* open the output file */
-		if ((sfp = fopen(output_file_ptr, "w")) != NULL)
-			{
-			/* write the profile file header */
-			fprintf(sfp, "## Profile File Version %s\n", MBGRDVIZ_PROFILE_VERSION);
-			fprintf(sfp, "## Output by Program %s\n",program_name);
-			fprintf(sfp, "## Program Version %s\n",rcs_id);
-			fprintf(sfp, "## MB-System Version %s\n",MB_VERSION);
-			right_now = time((time_t *)0);
-			strcpy(date,ctime(&right_now));
-                        date[strlen(date)-1] = '\0';
-			if ((user_ptr = getenv("USER")) == NULL)
-				if ((user_ptr = getenv("LOGNAME")) == NULL)
-					user_ptr = unknown;
-			gethostname(host,MB_PATH_MAXLINE);
-			fprintf(sfp, "## Run by user <%s> on cpu <%s> at <%s>\n",
-				user_ptr,host,date);
-			fprintf(sfp, "## Number of profile points: %d\n",npoints);
-			fprintf(sfp, "## Profile point format:\n");
-			fprintf(sfp, "##   <lateral distance (m)> <topography (m)> <boundary (boolean)> <longitude (deg)> <latitude (deg)> <distance over topo (m)> <bearing (deg)> <slope (m/m)>\n");
-			}
-
-		/* output error message */
-		else
-			{
-			error = MB_ERROR_OPEN_FAIL;
-			status = MB_FAILURE;
-			fprintf(stderr,"\nUnable to Open profile file <%s> for writing\n",output_file_ptr);
-			XBell((Display *) XtDisplay(mainWindow),100);
-			}
-		}
-
-	    /* if all ok proceed to extract and output profiles */
-	    if (status == MB_SUCCESS)
-		{
-		/* allocate profile arrays */
-		if (status == MB_SUCCESS
-			&& npointalloc < npoints)
-			{
-			status = mbview_allocprofilearrays(verbose,
-						npoints,
-						&prdistance,
-						&prtopo,
-						&prboundary,
-						&prlon,
-						&prlat,
-						&prdistovertopo,
-						&prbearing,
-						&prslope,
-						&error);
-			if (status == MB_SUCCESS)
-				{
-				npointalloc = npoints;
-				}
-
-			/* if error initializing memory then cancel dealing with this profile */
-			else
-	    			{
-				fprintf(stderr,"Unable to write profile...\nArray allocation for %d points failed for instance %zu!\n",
-					npoints, instance);
-				XBell((Display *) XtDisplay(mainWindow),100);
-				npoints = 0;
-				}
-			}
-
-		/* extract data for profile */
-		status = mbview_getprofile(verbose, instance,
-					prsourcename,
-					&prlength,
-					&przmin,
-					&przmax,
-					&npoints,
-					prdistance,
-					prtopo,
-					prboundary,
-					prlon,
-					prlat,
-					prdistovertopo,
-					prbearing,
-					prslope,
-					&error);
-
-		/* write the profile header */
-		fprintf(sfp,"## PROFILESOURCE %s\n", prsourcename);
-		fprintf(sfp,"## PROFILELENGTH %f\n", prlength);
-		fprintf(sfp,"## PROFILEZMIN %f\n", przmin);
-		fprintf(sfp,"## PROFILEZMAX %f\n", przmax);
-		fprintf(sfp,"## PROFILEPOINTS %d\n", npoints);
-
-		/* write the profile points */
-		for (j=0;j<npoints;j++)
-			{
-			fprintf(sfp,"%f %f %d %f %f %f %f %f\n",
-				prdistance[j], prtopo[j], prboundary[j],
-				prlon[j], prlat[j], prdistovertopo[j],
-				prbearing[j], prslope[j]);
-			}
-
-		 /* close the output file */
-		 fclose(sfp);
-
-		 /* deallocate arrays */
-		 if (npointalloc > 0)
-	    	    {
-		    status = mbview_freeprofilearrays(verbose,
-					    &prdistance,
-					    &prtopo,
-					    &prboundary,
-					    &prlon,
-					    &prlat,
-					    &prdistovertopo,
-					    &prbearing,
-					    &prslope,
-					    &error);
-		    }
-		}
-	    }
-
-	/* all done */
-	return(status);
-}
-/*---------------------------------------------------------------------------------------*/
-
-int do_mbgrdviz_opennav(size_t instance, int swathbounds, char *input_file_ptr)
-{
-	char function_name[] = "do_mbgrdviz_opennav";
-	int	status = MB_SUCCESS;
-	void	*datalist;
-	mb_path	swathfile;
-	int	swathfilestatus;
-	mb_path	swathfileraw;
-	mb_path	swathfileprocessed;
-	int	format;
-	int	formatorg;
-	double	weight;
-	int	done;
-	mb_path	messagestr;
-	char	*lastslash;
-	int	nfiledatalist = 0;
-	int	nfileread = 0;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       instance:        %zu\n",instance);
-		fprintf(stderr,"dbg2       swathbounds:     %d\n",swathbounds);
-		fprintf(stderr,"dbg2       input_file_ptr:  %s\n",input_file_ptr);
-		}
-
-	/* read data for valid instance */
-	if (instance != MBV_NO_WINDOW)
-	    {
-	    done = MB_NO;
-	    while (done == MB_NO)
-		{
-		if ((status = mb_datalist_open(verbose,&datalist,
-						input_file_ptr,
-						MB_DATALIST_LOOK_UNSET,&error)) == MB_SUCCESS)
-			{
-			while (done == MB_NO)
-				{
-				if ((status = mb_datalist_read2(verbose,datalist,
-						&swathfilestatus,swathfileraw,swathfileprocessed,
-						&format,&weight,&error))
-						== MB_SUCCESS)
-					{
-					nfiledatalist++;
-					if (format != MBF_ASCIIXYZ
-						&& format != MBF_ASCIIYXZ
-						&& format != MBF_ASCIIXYT
-						&& format != MBF_ASCIIYXT)
-						{
-						/* check for available nav file if that is
-						   all that is needed */
-						if (swathfilestatus == MB_PROCESSED_USE)
-							strcpy(swathfile, swathfileprocessed);
-						else
-							strcpy(swathfile, swathfileraw);
-						formatorg = format;
-						if (swathbounds == MB_NO)
-							mb_get_fnv(verbose, swathfile, &format, &error);
-
-						/* else check for available fbt file  */
-						else
-							mb_get_fbt(verbose, swathfile, &format, &error);
-
-						/* read the swath or nav data using mbio calls */
-
-						/* update message */
-						if (swathbounds == MB_NO)
-							strcpy(messagestr, "Reading navigation: ");
-						else
-							strcpy(messagestr, "Reading swath data: ");
-						lastslash = strrchr(swathfile, '/');
-						if ((lastslash = strrchr(swathfile, '/')) != NULL)
-							strcat(messagestr,&(lastslash[1]));
-						else
-							strcat(messagestr,swathfile);
-						do_mbview_message_on(messagestr, instance);
-fprintf(stderr,"%s\n",messagestr);
-
-						/* read the data */
-						nfileread++;
-						do_mbgrdviz_readnav(instance, swathfile,
-							swathfilestatus, swathfileraw, swathfileprocessed,
-							format, formatorg, weight, &error);
-						}
-else
-fprintf(stderr,"Skipped xyz data: %s\n",swathfile);
-					}
-				else
-					{
-					mb_datalist_close(verbose,&datalist,&error);
-					done = MB_YES;
-					}
-				}
-			}
-		}
-fprintf(stderr,"Attempted to load %d files, actually read %d files\n",nfiledatalist,nfileread);
-
-	    /* update widgets */
-	    mbview_enableviewnavs(verbose, instance, &error);
-	    status = mbview_update(verbose, instance, &error);
-	    }
-
-	/* all done */
-	return(status);
-
-}
-/*---------------------------------------------------------------------------------------*/
-
-int do_mbgrdviz_readnav(size_t instance, char *swathfile,
-				int pathstatus, char *pathraw, char *pathprocessed,
-				int format, int formatorg, double weight, int *error)
-{
-	char function_name[] = "do_mbgrdviz_readnav";
-	int	status = MB_SUCCESS;
-	char	*error_message;
-
-	/* MBIO control parameters */
-	int	pings = 1;
-	int	lonflip;
-	double	bounds[4];
-	int	btime_i[7];
-	int	etime_i[7];
-	double	btime_d;
-	double	etime_d;
-	double	speedmin;
-	double	timegap;
-	int	beams_bath;
-	int	beams_amp;
-	int	pixels_ss;
-	void	*mbio_ptr = NULL;
-
-	/* mbio read and write values */
-	void	*store_ptr = NULL;
-	int	kind;
-	int	time_i[7];
-	double	time_d;
-	double	lon;
-	double	lat;
-	double	speed;
-	double	heading;
-	double	distance;
-	double	altitude;
-	double	sonardepth;
-	char	*beamflag = NULL;
-	double	*bath = NULL;
-	double	*bathacrosstrack = NULL;
-	double	*bathalongtrack = NULL;
-	double	*amp = NULL;
-	double	*ss = NULL;
-	double	*ssacrosstrack = NULL;
-	double	*ssalongtrack = NULL;
-	char	comment[MB_COMMENT_MAXLINE];
-
-	int	npoint;
-	int	npointread;
-	int	npointalloc;
-	double	*navtime_d = NULL;
-	double	*navlon = NULL;
-	double	*navlat = NULL;
-	double	*navz = NULL;
-	double	*navheading = NULL;
-	double	*navspeed = NULL;
-	double	*navportlon = NULL;
-	double	*navportlat = NULL;
-	double	*navstbdlon = NULL;
-	double	*navstbdlat = NULL;
-	int	*navline = NULL;
-	int	*navshot = NULL;
-	int	*navcdp = NULL;
-	int	color;
-	int	size;
-	mb_path	name;
-	int	swathbounds;
-	int	line;
-	int	shot;
-	int	cdp;
-	int	decimation;
-
-	struct mbview_struct *data;
-
-	double	mtodeglon, mtodeglat;
-	double	headingx, headingy;
-	double	xd, yd, zd;
-
-	double	cellsize;
-	double	distancealongtrack;
-
-	int	form;
-	int	icenter, iport, istbd;
-	double	centerdistance, portdistance, stbddistance;
-	char	*lastslash;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       instance:        %zu\n",instance);
-		fprintf(stderr,"dbg2       swathfile:       %s\n",swathfile);
-		fprintf(stderr,"dbg2       pathstatus:      %d\n",pathstatus);
-		fprintf(stderr,"dbg2       pathraw:         %s\n",pathraw);
-		fprintf(stderr,"dbg2       pathprocessed:   %s\n",pathprocessed);
-		fprintf(stderr,"dbg2       format:          %d\n",format);
-		fprintf(stderr,"dbg2       formatorg:       %d\n",formatorg);
-		fprintf(stderr,"dbg2       weight:          %f\n",weight);
-		}
-
-	*error = MB_ERROR_NO_ERROR;
-
-	/* initialize nav values */
-	color = MBV_COLOR_BLACK;
-	size = 2;
-	name[0] = '\0';
-	lastslash = strrchr(swathfile, '/');
-	if ((lastslash = strrchr(swathfile, '/')) != NULL)
-		strcpy(name,&(lastslash[1]));
-	else
-		strcpy(name,swathfile);
-
-	swathbounds = MB_NO;
-	line = MB_NO;
-	shot = MB_YES;
-	cdp = MB_NO;
-	npoint = 0;
-	npointread = 0;
-	npointalloc = 0;
-	distancealongtrack = 0.0;
-
-	/* set mbio default values */
-	status = mb_defaults(verbose,&form,&pings,&lonflip,bounds,
-		btime_i,etime_i,&speedmin,&timegap);
-
-	/* get data structure of current instance */
-	status = mbview_getdataptr(verbose, instance, &data, error);
-	if (status == MB_SUCCESS)
-		{
-		bounds[0] = data->primary_xmin;
-		bounds[1] = data->primary_xmax;
-		bounds[2] = data->primary_ymin;
-		bounds[3] = data->primary_ymax;
-		status = mbview_projectforward(instance, MB_YES,
-				data->primary_xmin, data->primary_ymin,
-				0.5 * (data->primary_min + data->primary_max),
-				&bounds[0], &bounds[2],
-				&xd, &yd, &zd);
-		status = mbview_projectforward(instance, MB_YES,
-				data->primary_xmax, data->primary_ymax,
-				0.5 * (data->primary_min + data->primary_max),
-				&bounds[1], &bounds[3],
-				&xd, &yd, &zd);
-		mb_coor_scale(verbose, 0.5 * (bounds[2] + bounds[3]), &mtodeglon, &mtodeglat);
-		cellsize = 0.0005 * (((bounds[3] - bounds[2]) / ((double)data->primary_ny) / mtodeglat)
-				+ ((bounds[1] - bounds[0]) / ((double)data->primary_nx) / mtodeglon));
-		}
-
-	/* rationalize bounds and lonflip */
-	if (bounds[1] > 180.0)
-		{
-		lonflip = 1;
-		}
-	else if (bounds[0] < -180.0)
-		{
-		lonflip = -1;
-		}
-	else
-		{
-		lonflip = 0;
-		}
-
-	/* initialize reading the swath file */
-	if ((status = mb_read_init(
-		verbose,swathfile,format,pings,lonflip,bounds,
-		btime_i,etime_i,speedmin,timegap,
-		&mbio_ptr,&btime_d,&etime_d,
-		&beams_bath,&beams_amp,&pixels_ss,error)) != MB_SUCCESS)
-		{
-		mb_error(verbose,*error,&error_message);
-		fprintf(stderr,"\nMBIO Error returned from function <mb_read_init>:\n%s\n",error_message);
-		fprintf(stderr,"\nSwath sonar File <%s> not initialized for reading\n",swathfile);
-		}
-	/* allocate memory for data arrays */
-	if (status == MB_SUCCESS)
-		{
-		status = mb_mallocd(verbose,__FILE__,__LINE__,beams_bath*sizeof(char),
-					(void **)&beamflag,error);
-		if (status == MB_SUCCESS)
-			status = mb_mallocd(verbose,__FILE__,__LINE__,beams_bath*sizeof(double),
-						(void **)&bath,error);
-		if (status == MB_SUCCESS)
-			status = mb_mallocd(verbose,__FILE__,__LINE__,beams_bath*sizeof(double),
-						(void **)&bathacrosstrack,error);
-		if (status == MB_SUCCESS)
-			status = mb_mallocd(verbose,__FILE__,__LINE__,beams_bath*sizeof(double),
-						(void **)&bathalongtrack,error);
-		if (status == MB_SUCCESS)
-			status = mb_mallocd(verbose,__FILE__,__LINE__,beams_amp*sizeof(double),
-						(void **)&amp,error);
-		if (status == MB_SUCCESS)
-			status = mb_mallocd(verbose,__FILE__,__LINE__,pixels_ss*sizeof(double),
-						(void **)&ss,error);
-		if (status == MB_SUCCESS)
-			status = mb_mallocd(verbose,__FILE__,__LINE__,pixels_ss*sizeof(double),
-						(void **)&ssacrosstrack,error);
-		if (status == MB_SUCCESS)
-			status = mb_mallocd(verbose,__FILE__,__LINE__,pixels_ss*sizeof(double),
-						(void **)&ssalongtrack,error);
-
-		/* if error initializing memory then don't read the file */
-		if (*error != MB_ERROR_NO_ERROR)
-			{
-			mb_error(verbose,*error,&error_message);
-			fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",
-				error_message);
-			}
- 		}
-
-	/* read data */
-	if (status == MB_SUCCESS)
-		{
-		/* set swathbounds true if nore than one beam is expected */
-		if (beams_bath > 1)
-			swathbounds = MB_YES;
-
-		/* enable line and cdp values if segy data */
-		if (format == MBF_SEGYSEGY)
-			{
-			line = MB_YES;
-			cdp = MB_YES;
-			}
-
-		/* loop over successful reads and nonfatal errors
-		   until a fatal error is encountered */
-		while (*error <= MB_ERROR_NO_ERROR)
-			{
-			/* read a ping of data */
-			status = mb_get_all(verbose,mbio_ptr,&store_ptr,&kind,
-				time_i,&time_d,&lon,&lat,&speed,
-				&heading,&distance,&altitude,&sonardepth,
-				&beams_bath,&beams_amp,&pixels_ss,
-				beamflag,bath,amp,bathacrosstrack,bathalongtrack,
-				ss,ssacrosstrack,ssalongtrack,
-				comment,error);
-
-			/* ignore minor errors */
-			if (kind == MB_DATA_DATA
-				&& (*error == MB_ERROR_TIME_GAP
-					|| *error == MB_ERROR_OUT_TIME
-					|| *error == MB_ERROR_SPEED_TOO_SMALL))
-				{
-				status = MB_SUCCESS;
-				*error = MB_ERROR_NO_ERROR;
-				}
-
-			if (kind == MB_DATA_DATA
-				&& *error == MB_ERROR_NO_ERROR)
-				{
-/*fprintf(stderr,"Ping %d: %4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%.6.6d %f %f\n",
-npoint,time_i[0],time_i[1],time_i[2],time_i[3],time_i[4],time_i[5],time_i[6],lon,lat);*/
-				/* overwrite previous nav point if distance change does not
-					exceed cell size */
-				if (npoint == 0)
-					{
-					distancealongtrack  = 0.0;
-					}
-				else if (distancealongtrack < cellsize)
-					{
-					npoint--;
-					distancealongtrack += distance;
-					}
-				else
-					{
-					distancealongtrack = 0.0;
-					}
-
-				/* allocate memory if required */
-				if (npoint >= npointalloc)
-					{
-					npointalloc += MBV_ALLOC_NUM;
-					status = mb_reallocd(verbose, __FILE__, __LINE__, npointalloc*sizeof(double),
-								(void **)&navtime_d,error);
-					if (status == MB_SUCCESS)
-						status = mb_reallocd(verbose, __FILE__, __LINE__, npointalloc*sizeof(double),
-									(void **)&navlon,error);
-					if (status == MB_SUCCESS)
-						status = mb_reallocd(verbose, __FILE__, __LINE__, npointalloc*sizeof(double),
-									(void **)&navlat,error);
-					if (status == MB_SUCCESS)
-						status = mb_reallocd(verbose, __FILE__, __LINE__, npointalloc*sizeof(double),
-									(void **)&navz,error);
-					if (status == MB_SUCCESS)
-						status = mb_reallocd(verbose, __FILE__, __LINE__, npointalloc*sizeof(double),
-									(void **)&navheading,error);
-					if (status == MB_SUCCESS)
-						status = mb_reallocd(verbose, __FILE__, __LINE__, npointalloc*sizeof(double),
-									(void **)&navspeed,error);
-					if (status == MB_SUCCESS)
-						status = mb_reallocd(verbose, __FILE__, __LINE__, npointalloc*sizeof(double),
-									(void **)&navportlon,error);
-					if (status == MB_SUCCESS)
-						status = mb_reallocd(verbose, __FILE__, __LINE__, npointalloc*sizeof(double),
-									(void **)&navportlat,error);
-					if (status == MB_SUCCESS)
-						status = mb_reallocd(verbose, __FILE__, __LINE__, npointalloc*sizeof(double),
-									(void **)&navstbdlon,error);
-					if (status == MB_SUCCESS)
-						status = mb_reallocd(verbose, __FILE__, __LINE__, npointalloc*sizeof(double),
-									(void **)&navstbdlat,error);
-					if (status == MB_SUCCESS)
-						status = mb_reallocd(verbose, __FILE__, __LINE__, npointalloc*sizeof(int),
-									(void **)&navline,error);
-					if (status == MB_SUCCESS)
-						status = mb_reallocd(verbose, __FILE__, __LINE__, npointalloc*sizeof(int),
-									(void **)&navshot,error);
-					if (status == MB_SUCCESS)
-						status = mb_reallocd(verbose, __FILE__, __LINE__, npointalloc*sizeof(int),
-									(void **)&navcdp,error);
-
-					/* if error initializing memory then don't read the file */
-					if (*error != MB_ERROR_NO_ERROR)
-						{
-						npointalloc = 0;
-						mb_error(verbose,*error,&error_message);
-						fprintf(stderr,"\nMBIO Error allocating navigation data arrays:\n%s\n",
-							error_message);
-						}
-					}
-
-				/* get swathbounds */
-				if (format == MBF_MBPRONAV)
-					{
-					status = mbsys_singlebeam_swathbounds(verbose, mbio_ptr, store_ptr, &kind,
-										&navportlon[npoint], &navportlat[npoint],
-										&navstbdlon[npoint], &navstbdlat[npoint],
-										error);
-					if (navportlon[npoint] != navstbdlon[npoint]
-						|| navportlat[npoint] != navstbdlat[npoint])
-						swathbounds = MB_YES;
-					}
-
-				else
-					{
-					/* find centermost beam */
-					icenter = -1;
-					iport = -1;
-					istbd = -1;
-					centerdistance = 0.0;
-					portdistance = 0.0;
-					stbddistance = 0.0;
-					for (i=0;i<beams_bath;i++)
-						{
-						if (mb_beam_ok(beamflag[i]))
-							{
-							if (icenter == -1
-								|| fabs(bathacrosstrack[i]) < centerdistance)
-								{
-								icenter = i;
-								centerdistance = bathacrosstrack[i];
-								}
-							if (iport == -1
-								|| bathacrosstrack[i] < portdistance)
-								{
-								iport = i;
-								portdistance = bathacrosstrack[i];
-								}
-							if (istbd == -1
-								|| bathacrosstrack[i] > stbddistance)
-								{
-								istbd = i;
-								stbddistance = bathacrosstrack[i];
-								}
-							}
-						}
-
-					mb_coor_scale(verbose,lat,&mtodeglon,&mtodeglat);
-					headingx = sin(heading * DTR);
-					headingy = cos(heading * DTR);
-					if (icenter >= 0)
-						{
-						navportlon[npoint] = lon
-							+ headingy * mtodeglon * bathacrosstrack[iport]
-							+ headingx * mtodeglon * bathalongtrack[iport];
-						navportlat[npoint] = lat
-							- headingx * mtodeglat * bathacrosstrack[iport]
-							+ headingy * mtodeglat * bathalongtrack[iport];
-						navstbdlon[npoint] = lon
-							+ headingy * mtodeglon * bathacrosstrack[istbd]
-							+ headingx * mtodeglon * bathalongtrack[istbd];
-						navstbdlat[npoint] = lat
-							- headingx * mtodeglat * bathacrosstrack[istbd]
-							+ headingy * mtodeglat * bathalongtrack[istbd];
-						}
-					else
-						{
-						navportlon[npoint] = lon;
-						navportlat[npoint] = lat;
-						navstbdlon[npoint] = lon;
-						navstbdlat[npoint] = lat;
-						}
-					}
-
-				/* store the navigation values */
-				navtime_d[npoint] = time_d;
-				navlon[npoint] = lon;
-				navlat[npoint] = lat;
-				navz[npoint] = -sonardepth;
-				navheading[npoint] = heading;
-				navspeed[npoint] = speed;
-
-				mb_segynumber(verbose, mbio_ptr, &(navline[npoint]), &(navshot[npoint]),
-							&(navcdp[npoint]), error);
-
-				/* increment npoint */
-				npoint++;
-				npointread++;
-				}
-			}
-
-		/* close the swath file */
-		status = mb_close(verbose,&mbio_ptr,error);
-
-		/* insert nav data to mbview */
-		if (npoint > 0)
-			{
-			decimation = npointread / npoint;
-			status = mbview_addnav(verbose, instance,
-				npoint,
-				navtime_d,
-				navlon,
-				navlat,
-				navz,
-				navheading,
-				navspeed,
-				navportlon,
-				navportlat,
-				navstbdlon,
-				navstbdlat,
-				navline,
-				navshot,
-				navcdp,
-				color,
-				size,
-				name,
-				pathstatus,
-				pathraw,
-				pathprocessed,
-				formatorg,
-				swathbounds,
-				line,
-				shot,
-				cdp,
-				decimation,
-				error);
-			}
-else
-fprintf(stderr,"    Skipping %s because of 0 nav points read\n",name);
-
-	/* deallocate memory used for data arrays */
-	mb_freed(verbose, __FILE__, __LINE__, (void **)&beamflag, error);
-	mb_freed(verbose, __FILE__, __LINE__, (void **)&bath, error);
-	mb_freed(verbose, __FILE__, __LINE__, (void **)&bathacrosstrack, error);
-	mb_freed(verbose, __FILE__, __LINE__, (void **)&bathalongtrack, error);
-	mb_freed(verbose, __FILE__, __LINE__, (void **)&amp, error);
-	mb_freed(verbose, __FILE__, __LINE__, (void **)&ss, error);
-	mb_freed(verbose, __FILE__, __LINE__, (void **)&ssacrosstrack, error);
-	mb_freed(verbose, __FILE__, __LINE__, (void **)&ssalongtrack, error);
-
-	mb_freed(verbose, __FILE__, __LINE__, (void **)&navtime_d, error);
-	mb_freed(verbose, __FILE__, __LINE__, (void **)&navlon, error);
-	mb_freed(verbose, __FILE__, __LINE__, (void **)&navlat, error);
-	mb_freed(verbose, __FILE__, __LINE__, (void **)&navz, error);
-	mb_freed(verbose, __FILE__, __LINE__, (void **)&navheading, error);
-	mb_freed(verbose, __FILE__, __LINE__, (void **)&navspeed, error);
-	mb_freed(verbose, __FILE__, __LINE__, (void **)&navportlon, error);
-	mb_freed(verbose, __FILE__, __LINE__, (void **)&navportlat, error);
-	mb_freed(verbose, __FILE__, __LINE__, (void **)&navstbdlon, error);
-	mb_freed(verbose, __FILE__, __LINE__, (void **)&navstbdlat, error);
-	mb_freed(verbose, __FILE__, __LINE__, (void **)&navline, error);
-	mb_freed(verbose, __FILE__, __LINE__, (void **)&navshot, error);
-	mb_freed(verbose, __FILE__, __LINE__, (void **)&navcdp, error);
-	}
-
-	/* all done */
-	return(status);
-
-}
-/*---------------------------------------------------------------------------------------*/
-
-int do_mbgrdviz_opentest(size_t instance,
-			double	factor1,
-			double	factor2,
-			double	factor3,
-			int	*grid_projection_mode,
-			char	*grid_projection_id,
-			float	*nodatavalue,
-			int	*nxy,
-			int	*nx,
-			int	*ny,
-			double	*min,
-			double	*max,
-			double	*xmin,
-			double	*xmax,
-			double	*ymin,
-			double	*ymax,
-			double	*dx,
-			double	*dy,
-			float	**data)
-{
-	char function_name[] = "do_mbgrdviz_opentest";
-	int	status = MB_SUCCESS;
-	double	xx, yy;
-	float	*usedata;
-	int	i, j, k;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       instance:        %zu\n",instance);
-		fprintf(stderr,"dbg2       factor1:         %f\n",factor1);
-		fprintf(stderr,"dbg2       factor2:         %f\n",factor2);
-		fprintf(stderr,"dbg2       factor3:         %f\n",factor3);
-		}
-
-	*grid_projection_mode = MBV_PROJECTION_GEOGRAPHIC;
-	sprintf(grid_projection_id, "epsg%d", GCS_WGS_84);
-    	*nodatavalue = MBV_DEFAULT_NODATA;
-    	*nx = 501;
-    	*ny = 501;
-    	*nxy = *nx * *ny;
-    	*xmin = -1.0;
-    	*xmax = 1.0;
-    	*ymin = -1.0;
-    	*ymax = 1.0;
-    	*dx = (*xmax - *xmin) / (*nx -1);
-    	*dy = (*ymax - *ymin) / (*ny -1);
-    	*min = 0.0;
-    	*max = 1000.0;
-    	*min = 0.0;
-    	*max = 0.0;
-
-    	if (status == MB_SUCCESS)
-    	status = mb_mallocd(verbose,__FILE__,__LINE__, sizeof(float) * (*nxy),
-    				(void **)data,&error);
-	usedata = *data;
-	if (status != MB_SUCCESS)
-	    {
-	    fprintf(stderr,"\nUnable to allocate memory to store test data...\n");
-	    fprintf(stderr,"\nProgram <%s> Terminated\n",
-		    program_name);
-	    exit(error);
-	    }
-
-	for (i=0;i<*nx;i++)
-		for (j=0;j<*ny;j++)
-			{
-			k = i * *ny + j;
-			xx = *xmin + i * *dx;
-			yy = *ymin + j * *dy;
-			usedata[k] = factor1 * sin(factor2 * M_PI * xx)
-							* sin(factor2 * M_PI * yy)
-							* exp(-factor3 * xx * yy);
-    			*min = MIN(*min, usedata[k]);
-    			*max = MAX(*max, usedata[k]);
-			}
-
-	/* all done */
-	return(status);
-}
-/*---------------------------------------------------------------------------------------*/
-
-void do_mbgrdviz_open_region( Widget w, XtPointer client_data, XtPointer call_data)
-{
-	char function_name[] = "do_mbgrdviz_open_region";
-	int	status = MB_SUCCESS;
-	int	ixmin, ixmax, jymin, jymax;
-	int	i, j, k, ksource;
-
-	/* existing mbview instance */
-	size_t	instance_source;
-	struct mbview_struct *data_source;
-	char	button_name_source[MB_PATH_MAXLINE];
-
-	/* new mbview instance */
-	size_t	instance;
-	char	button_name[MB_PATH_MAXLINE];
-
-	/* mbview parameters */
-	char	mbv_title[MB_PATH_MAXLINE];
-	int	mbv_xo;
-	int	mbv_yo;
-	int	mbv_width;
-	int	mbv_height;
-	int	mbv_lorez_dimension;
-	int	mbv_hirez_dimension;
-	int	mbv_lorez_navdecimate;
-	int	mbv_hirez_navdecimate;
-	int	mbv_primary_nxy;
-	int	mbv_primary_nx;
-	int	mbv_primary_ny;
-	double	mbv_primary_min;
-	double	mbv_primary_max;
-	double	mbv_primary_xmin;
-	double	mbv_primary_xmax;
-	double	mbv_primary_ymin;
-	double	mbv_primary_ymax;
-	double	mbv_primary_dx;
-	double	mbv_primary_dy;
-	float	*mbv_primary_data;
-	int	mbv_secondary_nxy;
-	int	mbv_secondary_nx;
-	int	mbv_secondary_ny;
-	double	mbv_secondary_min;
-	double	mbv_secondary_max;
-	double	mbv_secondary_xmin;
-	double	mbv_secondary_xmax;
-	double	mbv_secondary_ymin;
-	double	mbv_secondary_ymax;
-	double	mbv_secondary_dx;
-	double	mbv_secondary_dy;
-	float	*mbv_secondary_data;
-
-    	/* get source mbview instance */
-	instance_source = (size_t) client_data;
-/*fprintf(stderr,"Called do_mbgrdviz_open_region instance:%d\n", instance_source);*/
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       w:           %p\n",w);
-		fprintf(stderr,"dbg2       client_data: %p\n",client_data);
-		fprintf(stderr,"dbg2       call_data:   %p\n",call_data);
-		}
-
-	/* get new instance number */
-	if (instance_source != MBV_NO_WINDOW && instance_source < MBV_MAX_WINDOWS)
-		{
-		status = mbview_init(verbose, &instance, &error);
-		if (instance == MBV_NO_WINDOW)
-			{
-			fprintf(stderr, "Unable to create mbview - %d mbview windows already created\n",
-			MBV_MAX_WINDOWS);
-			status = MB_FAILURE;
-			}
-		}
-	else
-		{
-		status = MB_FAILURE;
-		}
-
-    	/* check data source for region to extract */
-	if (status == MB_SUCCESS)
-		{
-		/* get source data */
-		mbview_getdataptr(verbose, instance_source, &data_source, &error);
-
-		/* extract the grid from the source */
-		if (data_source->region_type != MBV_REGION_QUAD)
-			status = MB_FAILURE;
-		}
-
-    	/* extract data from source and create new mbview instance */
-	if (status == MB_SUCCESS)
-		{
-		/* get source data */
-		mbview_getdataptr(verbose, instance_source, &data_source, &error);
-
-		/* get button name */
-		sscanf(data_source->title,"MBgrdviz: %s", button_name_source);
-		sprintf(button_name,"Region from %s", button_name_source);
-
-		/* set parameters */
-		sprintf(mbv_title, "MBgrdviz: %s\n", button_name);
-		mbv_xo = 200;
-		mbv_yo = 200;
-		mbv_width = 560;
-		mbv_height = 500;
-		mbv_lorez_dimension = data_source->lorez_dimension;
-		mbv_hirez_dimension = data_source->hirez_dimension;
-		mbv_lorez_navdecimate = data_source->lorez_navdecimate;
-		mbv_hirez_navdecimate = data_source->hirez_navdecimate;
-
-		/* set basic mbview window parameters */
-		status = mbview_setwindowparms(verbose, instance,
-					&do_mbgrdviz_dismiss_notify,
-					mbv_title,
-					mbv_xo,
-					mbv_yo,
-					mbv_width,
-					mbv_height,
-					mbv_lorez_dimension,
-					mbv_hirez_dimension,
-					mbv_lorez_navdecimate,
-					mbv_hirez_navdecimate,
-					&error);
-
-		/* extract the primary grid from the source */
-		mbv_primary_dx = data_source->primary_dx;
-		mbv_primary_dy = data_source->primary_dy;
-		mbv_primary_xmin = MIN(data_source->region.cornerpoints[0].xgrid,
-					data_source->region.cornerpoints[3].xgrid);
-		mbv_primary_xmax = MAX(data_source->region.cornerpoints[0].xgrid,
-					data_source->region.cornerpoints[3].xgrid);
-		mbv_primary_ymin = MIN(data_source->region.cornerpoints[0].ygrid,
-					data_source->region.cornerpoints[3].ygrid);
-		mbv_primary_ymax = MAX(data_source->region.cornerpoints[0].ygrid,
-					data_source->region.cornerpoints[3].ygrid);
-		ixmin = (mbv_primary_xmin
-				- data_source->primary_xmin)
-				/ mbv_primary_dx;
-		ixmax = ((mbv_primary_xmax
-				- data_source->primary_xmin)
-				/ mbv_primary_dx) + 1;
-		jymin = (mbv_primary_ymin
-				- data_source->primary_ymin)
-				/ mbv_primary_dy;
-		jymax = ((mbv_primary_ymax
-				- data_source->primary_ymin)
-				/ mbv_primary_dy) + 1;
-		ixmin = MAX(ixmin, 0);
-		ixmax = MIN(ixmax, data_source->primary_nx - 1);
-		jymin = MAX(jymin, 0);
-		jymax = MIN(jymax, data_source->primary_ny - 1);
-		mbv_primary_xmin = data_source->primary_xmin + mbv_primary_dx * ixmin;
-		mbv_primary_xmax = data_source->primary_xmin + mbv_primary_dx * ixmax;
-		mbv_primary_ymin = data_source->primary_ymin + mbv_primary_dy * jymin;
-		mbv_primary_ymax = data_source->primary_ymin + mbv_primary_dy * jymax;
-		mbv_primary_nx = ixmax - ixmin + 1;
-		mbv_primary_ny = jymax - jymin + 1;
-		mbv_primary_nxy = mbv_primary_nx * mbv_primary_ny;
-		status = mb_mallocd(verbose,__FILE__,__LINE__, sizeof(float) * mbv_primary_nxy,
-    				(void **)&mbv_primary_data,&error);
-		mbv_primary_min = data_source->primary_nodatavalue;
-		mbv_primary_max = data_source->primary_nodatavalue;
-		for (i=0;i<mbv_primary_nx;i++)
-			{
-			for (j=0;j<mbv_primary_ny;j++)
-				{
-				k = i * mbv_primary_ny + j;
-				ksource = (i + ixmin) * data_source->primary_ny + (j + jymin);
-				mbv_primary_data[k] = data_source->primary_data[ksource];
-				if (mbv_primary_data[k] != data_source->primary_nodatavalue)
-					{
-					if (mbv_primary_min == data_source->primary_nodatavalue
-						|| mbv_primary_data[k] < mbv_primary_min)
-						{
-						mbv_primary_min = mbv_primary_data[k];
-						}
-					if (mbv_primary_max == data_source->primary_nodatavalue
-						|| mbv_primary_data[k] > mbv_primary_max)
-						{
-						mbv_primary_max = mbv_primary_data[k];
-						}
-					}
-				}
-			}
-
-		/* set basic mbview view controls */
-		if (status == MB_SUCCESS)
-		status = mbview_setviewcontrols(verbose, instance,
-					data_source->display_mode,
-					data_source->mouse_mode,
-					data_source->grid_mode,
-					data_source->primary_histogram,
-					data_source->primaryslope_histogram,
-					data_source->secondary_histogram,
-					data_source->primary_shade_mode,
-					data_source->slope_shade_mode,
-					data_source->secondary_shade_mode,
-					data_source->grid_contour_mode,
-					data_source->site_view_mode,
-					data_source->route_view_mode,
-					data_source->nav_view_mode,
-					data_source->navdrape_view_mode,
-					data_source->vector_view_mode,
-					data_source->exageration,
-					data_source->modelelevation3d,
-					data_source->modelazimuth3d,
-					data_source->viewelevation3d,
-					data_source->viewazimuth3d,
-					data_source->illuminate_magnitude,
-					data_source->illuminate_elevation,
-					data_source->illuminate_azimuth,
-					data_source->slope_magnitude,
-					data_source->overlay_shade_magnitude,
-					data_source->overlay_shade_center,
-					data_source->overlay_shade_mode,
-					data_source->contour_interval,
-					data_source->display_projection_mode,
-					data_source->display_projection_id,
-					&error);
-
-		/* set more mbview control values */
-		if (status == MB_SUCCESS)
-		status = mbview_setprimarygrid(verbose, instance,
-					data_source->primary_grid_projection_mode,
-					data_source->primary_grid_projection_id,
-					data_source->primary_nodatavalue,
-					mbv_primary_nx,
-					mbv_primary_ny,
-					mbv_primary_min,
-					mbv_primary_max,
-					mbv_primary_xmin,
-					mbv_primary_xmax,
-					mbv_primary_ymin,
-					mbv_primary_ymax,
-					mbv_primary_dx,
-					mbv_primary_dy,
-					mbv_primary_data,
-					&error);
-		mb_freed(verbose, __FILE__, __LINE__, (void **)&mbv_primary_data, &error);
-		if (status == MB_SUCCESS)
-		status = mbview_setprimarycolortable(verbose, instance,
-					data_source->primary_colortable,
-					data_source->primary_colortable_mode,
-					data_source->primary_colortable_min,
-					data_source->primary_colortable_max,
-					&error);
-		if (status == MB_SUCCESS)
-		status = mbview_setslopecolortable(verbose, instance,
-					data_source->slope_colortable,
-					data_source->slope_colortable_mode,
-					data_source->slope_colortable_min,
-					data_source->slope_colortable_max,
-					&error);
-		if (status == MB_SUCCESS)
-		status = mbview_enableeditsites(verbose, instance,
-					&error);
-		if (status == MB_SUCCESS)
-		status = mbview_enableeditroutes(verbose, instance,
-					&error);
-
-		/* open up mbview window */
-		if (status == MB_SUCCESS)
-			{
-/*fprintf(stderr,"about to open mbview instance:%zu\n",instance);*/
-			status = mbview_open(verbose, instance, &error);
-			if (status == MB_SUCCESS)
-				mbview_id[instance] = MB_YES;
-			else
-				mbview_id[instance] = MB_NO;
-/*fprintf(stderr,"done opening mbview instance:%zu\n",instance);*/
-
-			/* add action button */
-			if (status == MB_SUCCESS)
-				{
-				mbview_addaction(verbose, instance,
-					do_mbgrdviz_fileSelectionBox_openoverlay,
-					"Open Overlay Grid",
-					MBV_PICKMASK_NONE, &error);
-				mbview_addaction(verbose, instance,
-					do_mbgrdviz_fileSelectionBox_opensite,
-					"Open Site File",
-					MBV_PICKMASK_NONE, &error);
-				mbview_addaction(verbose, instance,
-					do_mbgrdviz_fileSelectionBox_openroute,
-					"Open Route File",
-					MBV_PICKMASK_NONE, &error);
-				mbview_addaction(verbose, instance,
-					do_mbgrdviz_fileSelectionBox_openvector,
-					"Open Vector File",
-					MBV_PICKMASK_NONE, &error);
-				mbview_addaction(verbose, instance,
-					do_mbgrdviz_fileSelectionBox_opennav,
-					"Open Navigation",
-					MBV_PICKMASK_NONE, &error);
-				mbview_addaction(verbose, instance,
-					do_mbgrdviz_fileSelectionBox_openswath,
-					"Open Swath Data",
-					MBV_PICKMASK_NONE, &error);
-				mbview_addaction(verbose, instance,
-					do_mbgrdviz_fileSelectionBox_savesite,
-					"Save Site File",
-					MBV_EXISTMASK_SITE, &error);
-				mbview_addaction(verbose, instance,
-					do_mbgrdviz_fileSelectionBox_saveroute,
-					"Save Route File",
-					MBV_EXISTMASK_ROUTE, &error);
-				mbview_addaction(verbose, instance,
-					do_mbgrdviz_fileSelectionBox_saverisiscript,
-					"Save Risi Script File",
-					MBV_EXISTMASK_ROUTE, &error);
-				mbview_addaction(verbose, instance,
-					do_mbgrdviz_fileSelectionBox_savewinfrogpts,
-					"Save Route as Winfrog PTS File",
-					MBV_EXISTMASK_ROUTE, &error);
-				mbview_addaction(verbose, instance,
-					do_mbgrdviz_fileSelectionBox_savewinfrogwpt,
-					"Save Route as Winfrog WPT File",
-					MBV_EXISTMASK_ROUTE, &error);
-				mbview_addaction(verbose, instance,
-					do_mbgrdviz_fileSelectionBox_savedegdecmin,
-					"Save Route as Degrees + Decimal Minutes File",
-					MBV_EXISTMASK_ROUTE, &error);
-				mbview_addaction(verbose, instance,
-					do_mbgrdviz_fileSelectionBox_savelnw,
-					"Save Route as Hypack LNW File",
-					MBV_EXISTMASK_ROUTE, &error);
-				mbview_addaction(verbose, instance,
-					do_mbgrdviz_fileSelectionBox_saveprofile,
-					"Save Profile File",
-					MBV_PICKMASK_TWOPOINT + MBV_PICKMASK_ROUTE + MBV_PICKMASK_NAVTWOPOINT,
-					&error);
-
-				mbview_addaction(verbose, instance,
-					do_mbgrdviz_open_mbedit,
-					"Open Selected Nav in MBedit",
-					MBV_PICKMASK_NAVANY,
-					&error);
-				mbview_addaction(verbose, instance,
-					do_mbgrdviz_open_mbeditviz,
-					"Open Selected Nav in MBeditviz",
-					MBV_PICKMASK_NAVANY,
-					&error);
-				mbview_addaction(verbose, instance,
-					do_mbgrdviz_open_mbnavedit,
-					"Open Selected Nav in MBnavedit",
-					MBV_PICKMASK_NAVANY,
-					&error);
-				mbview_addaction(verbose, instance,
-					do_mbgrdviz_open_mbvelocitytool,
-					"Open Selected Nav in MBvelocitytool",
-					MBV_PICKMASK_NAVANY,
-					&error);
-
-				mbview_addaction(verbose, instance,
-					do_mbgrdviz_open_region,
-					"Open Region as New View",
-					MBV_PICKMASK_REGION + MBV_PICKMASK_NEWINSTANCE, &error);
-				mbview_addaction(verbose, instance,
-					do_mbgrdviz_make_survey,
-					"Generate Survey Route from Area",
-					MBV_PICKMASK_AREA, &error);
-				}
-			}
-
-		/* extract the secondary grid, if it exists, from the source */
-		if (data_source->secondary_nxy > 0 && data_source->secondary_data != NULL)
-			{
-			mbv_secondary_dx = data_source->secondary_dx;
-			mbv_secondary_dy = data_source->secondary_dy;
-			mbv_secondary_xmin = MIN(data_source->region.cornerpoints[0].xgrid,
-						data_source->region.cornerpoints[3].xgrid);
-			mbv_secondary_xmax = MAX(data_source->region.cornerpoints[0].xgrid,
-						data_source->region.cornerpoints[3].xgrid);
-			mbv_secondary_ymin = MIN(data_source->region.cornerpoints[0].ygrid,
-						data_source->region.cornerpoints[3].ygrid);
-			mbv_secondary_ymax = MAX(data_source->region.cornerpoints[0].ygrid,
-						data_source->region.cornerpoints[3].ygrid);
-			ixmin = (mbv_secondary_xmin
-					- data_source->secondary_xmin)
-					/ mbv_secondary_dx;
-			ixmax = ((mbv_secondary_xmax
-					- data_source->secondary_xmin)
-					/ mbv_secondary_dx) + 1;
-			jymin = (mbv_secondary_ymin
-					- data_source->secondary_ymin)
-					/ mbv_secondary_dy;
-			jymax = ((mbv_secondary_ymax
-					- data_source->secondary_ymin)
-					/ mbv_secondary_dy) + 1;
-			ixmin = MAX(ixmin, 0);
-			ixmax = MIN(ixmax, data_source->secondary_nx - 1);
-			jymin = MAX(jymin, 0);
-			jymax = MIN(jymax, data_source->secondary_ny - 1);
-			mbv_secondary_xmin = data_source->secondary_xmin + mbv_secondary_dx * ixmin;
-			mbv_secondary_xmax = data_source->secondary_xmin + mbv_secondary_dx * ixmax;
-			mbv_secondary_ymin = data_source->secondary_ymin + mbv_secondary_dy * jymin;
-			mbv_secondary_ymax = data_source->secondary_ymin + mbv_secondary_dy * jymax;
-			mbv_secondary_nx = ixmax - ixmin + 1;
-			mbv_secondary_ny = jymax - jymin + 1;
-			mbv_secondary_nxy = mbv_secondary_nx * mbv_secondary_ny;
-			status = mb_mallocd(verbose,__FILE__,__LINE__, sizeof(float) * mbv_secondary_nxy,
-    					(void **)&mbv_secondary_data,&error);
-			mbv_secondary_min = data_source->secondary_nodatavalue;
-			mbv_secondary_max = data_source->secondary_nodatavalue;
-			for (i=0;i<mbv_secondary_nx;i++)
-				{
-				for (j=0;j<mbv_secondary_ny;j++)
-					{
-					k = i * mbv_secondary_ny + j;
-					ksource = (i + ixmin) * data_source->secondary_ny + (j + jymin);
-					mbv_secondary_data[k] = data_source->secondary_data[ksource];
-					if (mbv_secondary_data[k] != data_source->secondary_nodatavalue)
-						{
-						if (mbv_secondary_min == data_source->secondary_nodatavalue
-							|| mbv_secondary_data[k] < mbv_secondary_min)
-							{
-							mbv_secondary_min = mbv_secondary_data[k];
-							}
-						if (mbv_secondary_max == data_source->secondary_nodatavalue
-							|| mbv_secondary_data[k] > mbv_secondary_max)
-							{
-							mbv_secondary_max = mbv_secondary_data[k];
-							}
-						}
-					}
-				}
-
-			/* set more mbview control values */
-			if (status == MB_SUCCESS)
-			status = mbview_setsecondarygrid(verbose, instance,
-						data_source->secondary_grid_projection_mode,
-						data_source->secondary_grid_projection_id,
-						data_source->secondary_nodatavalue,
-						mbv_secondary_nx,
-						mbv_secondary_ny,
-						mbv_secondary_min,
-						mbv_secondary_max,
-						mbv_secondary_xmin,
-						mbv_secondary_xmax,
-						mbv_secondary_ymin,
-						mbv_secondary_ymax,
-						mbv_secondary_dx,
-						mbv_secondary_dy,
-						mbv_secondary_data,
-						&error);
-			mb_freed(verbose, __FILE__, __LINE__, (void **)&mbv_secondary_data, &error);
-			if (status == MB_SUCCESS)
-			status = mbview_setsecondarycolortable(verbose, instance,
-						data_source->secondary_colortable,
-						data_source->secondary_colortable_mode,
-						data_source->secondary_colortable_min,
-						data_source->secondary_colortable_max,
-						data_source->overlay_shade_magnitude,
-						data_source->overlay_shade_center,
-						data_source->overlay_shade_mode,
-						&error);
-			}
-
-		}
-
-	/* update widgets */
-	status = mbview_update(verbose, instance, &error);
-
-	/* set sensitivity of widgets that require an mbview instance to be active */
-	do_mbgrdviz_sensitivity( );
-}
-/*---------------------------------------------------------------------------------------*/
-
-void do_mbgrdviz_open_mbedit( Widget w, XtPointer client_data, XtPointer call_data)
-{
-	char function_name[] = "do_mbgrdviz_open_mbedit";
-	int	status = MB_SUCCESS;
-
-	/* mbview instance */
-	size_t	instance;
-	struct mbview_struct *data;
-	struct mbview_shareddata_struct *shareddata;
-	struct mbview_nav_struct *nav;
-	mb_path	mbedit_cmd;
-	mb_path	filearg;
-	int	nselected;
-        int     shellstatus;
-	int	i;
-
-    	/* get source mbview instance */
-	instance = (size_t) client_data;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       w:           %p\n",w);
-		fprintf(stderr,"dbg2       client_data: %p\n",client_data);
-		fprintf(stderr,"dbg2       call_data:   %p\n",call_data);
-		}
-
-	/* getting instance from client_data doesn't seem
-		to work so use survey_instance instead */
-	instance = survey_instance;
-fprintf(stderr,"Called do_mbgrdviz_open_mbedit instance:%zu\n", instance);
-
-    	/* check data source for area to bounding desired survey */
-	status = mbview_getdataptr(verbose, instance, &data, &error);
-	status = mbview_getsharedptr(verbose, &shareddata, &error);
-
-	/* check if any nav is selected */
-	nselected = 0;
-	sprintf(mbedit_cmd, "mbedit");
-	if (status == MB_SUCCESS && shareddata->nnav > 0)
-		{
-		for (i=0;i<shareddata->nnav;i++)
-			{
-			nav = (struct mbview_nav_struct *) &(shareddata->navs[i]);
-fprintf(stderr,"Nav %d name:%s path:%s format:%d nselected:%d\n",
-i, nav->name, nav->pathraw, nav->format, nav->nselected);
-			if (nav->nselected > 0)
-				{
-				sprintf(filearg, " -F%d -I%s", nav->format, nav->pathraw);
-				strncat(mbedit_cmd, filearg, MB_PATH_MAXLINE-3);
-				nselected += nav->nselected;
-fprintf(stderr, "nselected: %d %d    Adding filearg:%s\n",nav->nselected, nselected, filearg);
-				}
-			}
-		}
-
-	/* open all data files with selected nav into mbedit */
-	if (status == MB_SUCCESS && shareddata->nnav > 0 && nselected > 0)
-		{
-		strncat(mbedit_cmd, " &", MB_PATH_MAXLINE);
-fprintf(stderr,"Calling mbedit: %s\n", mbedit_cmd);
-		shellstatus = system(mbedit_cmd);
-		}
-
-	/* update widgets of all mbview windows */
-	status = mbview_update(verbose, instance, &error);
-	for (i=0;i<MBV_MAX_WINDOWS;i++)
-		{
-		if (i != instance && mbview_id[i] == MB_YES)
-			status = mbview_update(verbose, i, &error);
-		}
-}
-/*---------------------------------------------------------------------------------------*/
-
-void do_mbgrdviz_open_mbeditviz( Widget w, XtPointer client_data, XtPointer call_data)
-{
-	char function_name[] = "do_mbgrdviz_open_mbeditviz";
-	int	status = MB_SUCCESS;
-
-	/* mbview instance */
-	size_t	instance;
-	struct mbview_struct *data;
-	struct mbview_shareddata_struct *shareddata;
-	struct mbview_nav_struct *nav;
-	mb_path	mbeditviz_cmd;
-	mb_path	filearg;
-	int	nselected;
-        int     shellstatus;
-	int	i;
-
-    	/* get source mbview instance */
-	instance = (size_t) client_data;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       w:           %p\n",w);
-		fprintf(stderr,"dbg2       client_data: %p\n",client_data);
-		fprintf(stderr,"dbg2       call_data:   %p\n",call_data);
-		}
-
-	/* getting instance from client_data doesn't seem
-		to work so use survey_instance instead */
-	instance = survey_instance;
-fprintf(stderr,"Called do_mbgrdviz_open_mbeditviz instance:%zu\n", instance);
-
-    	/* check data source for area to bounding desired survey */
-	status = mbview_getdataptr(verbose, instance, &data, &error);
-	status = mbview_getsharedptr(verbose, &shareddata, &error);
-
-	/* check if any nav is selected */
-	nselected = 0;
-	sprintf(mbeditviz_cmd, "mbeditviz");
-	if (status == MB_SUCCESS && shareddata->nnav > 0)
-		{
-		for (i=0;i<shareddata->nnav;i++)
-			{
-			nav = (struct mbview_nav_struct *) &(shareddata->navs[i]);
-fprintf(stderr,"Nav %d name:%s path:%s format:%d nselected:%d\n",
-i, nav->name, nav->pathraw, nav->format, nav->nselected);
-			nselected += nav->nselected;
-			if (nav->nselected > 0)
-				{
-				sprintf(filearg, " -F%d -I%s", nav->format, nav->pathraw);
-				strncat(mbeditviz_cmd, filearg, MB_PATH_MAXLINE-3);
-fprintf(stderr, "nselected: %d %d    Adding filearg:%s\n",nav->nselected, nselected, filearg);
-				}
-			}
-		}
-
-	/* open all data files with selected nav into mbeditviz */
-	if (status == MB_SUCCESS && shareddata->nnav > 0 && nselected > 0)
-		{
-		strncat(mbeditviz_cmd, " &", MB_PATH_MAXLINE);
-fprintf(stderr,"Calling mbeditviz: %s\n", mbeditviz_cmd);
-		shellstatus = system(mbeditviz_cmd);
-		}
-
-	/* update widgets of all mbview windows */
-	status = mbview_update(verbose, instance, &error);
-	for (i=0;i<MBV_MAX_WINDOWS;i++)
-		{
-		if (i != instance && mbview_id[i] == MB_YES)
-			status = mbview_update(verbose, i, &error);
-		}
-}
-/*---------------------------------------------------------------------------------------*/
-
-void do_mbgrdviz_open_mbnavedit( Widget w, XtPointer client_data, XtPointer call_data)
-{
-	char function_name[] = "do_mbgrdviz_open_mbnavedit";
-	int	status = MB_SUCCESS;
-
-	/* mbview instance */
-	size_t	instance;
-	struct mbview_struct *data;
-	struct mbview_shareddata_struct *shareddata;
-	struct mbview_nav_struct *nav;
-	mb_path	mbnavedit_cmd;
-	mb_path	filearg;
-	int	nselected;
-        int     shellstatus;
-	int	i;
-
-    	/* get source mbview instance */
-	instance = (size_t) client_data;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       w:           %p\n",w);
-		fprintf(stderr,"dbg2       client_data: %p\n",client_data);
-		fprintf(stderr,"dbg2       call_data:   %p\n",call_data);
-		}
-
-	/* getting instance from client_data doesn't seem
-		to work so use survey_instance instead */
-	instance = survey_instance;
-fprintf(stderr,"Called do_mbgrdviz_open_mbnavedit instance:%zu\n", instance);
-
-    	/* check data source for area to bounding desired survey */
-	status = mbview_getdataptr(verbose, instance, &data, &error);
-	status = mbview_getsharedptr(verbose, &shareddata, &error);
-
-	/* check if any nav is selected */
-	nselected = 0;
-	sprintf(mbnavedit_cmd, "mbnavedit");
-	if (status == MB_SUCCESS && shareddata->nnav > 0)
-		{
-		for (i=0;i<shareddata->nnav;i++)
-			{
-			nav = (struct mbview_nav_struct *) &(shareddata->navs[i]);
-fprintf(stderr,"Nav %d name:%s path:%s format:%d nselected:%d\n",
-i, nav->name, nav->pathraw, nav->format, nav->nselected);
-			if (nav->nselected > 0)
-				{
-				sprintf(filearg, " -F%d -I%s", nav->format, nav->pathraw);
-				strncat(mbnavedit_cmd, filearg, MB_PATH_MAXLINE-3);
-				nselected += nav->nselected;
-fprintf(stderr, "nselected: %d %d    Adding filearg:%s\n",nav->nselected, nselected, filearg);
-				}
-			}
-		}
-
-	/* open all data files with selected nav into mbnavedit */
-	if (status == MB_SUCCESS && shareddata->nnav > 0 && nselected > 0)
-		{
-		strncat(mbnavedit_cmd, " &", MB_PATH_MAXLINE);
-fprintf(stderr,"Calling mbnavedit: %s\n", mbnavedit_cmd);
-		shellstatus = system(mbnavedit_cmd);
-		}
-
-	/* update widgets of all mbview windows */
-	status = mbview_update(verbose, instance, &error);
-	for (i=0;i<MBV_MAX_WINDOWS;i++)
-		{
-		if (i != instance && mbview_id[i] == MB_YES)
-			status = mbview_update(verbose, i, &error);
-		}
-}
-/*---------------------------------------------------------------------------------------*/
-
-void do_mbgrdviz_open_mbvelocitytool( Widget w, XtPointer client_data, XtPointer call_data)
-{
-	char function_name[] = "do_mbgrdviz_open_mbvelocitytool";
-	int	status = MB_SUCCESS;
-
-	/* mbview instance */
-	size_t	instance;
-	struct mbview_struct *data;
-	struct mbview_shareddata_struct *shareddata;
-	struct mbview_nav_struct *nav;
-	mb_path	mbvelocitytool_cmd;
-	mb_path	filearg;
-	int	nselected;
-        int     shellstatus;
-	int	i;
-
-    	/* get source mbview instance */
-	instance = (size_t) client_data;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       w:           %p\n",w);
-		fprintf(stderr,"dbg2       client_data: %p\n",client_data);
-		fprintf(stderr,"dbg2       call_data:   %p\n",call_data);
-		}
-
-	/* getting instance from client_data doesn't seem
-		to work so use survey_instance instead */
-	instance = survey_instance;
-fprintf(stderr,"Called do_mbgrdviz_open_mbvelocitytool instance:%zu\n", instance);
-
-    	/* check data source for area to bounding desired survey */
-	status = mbview_getdataptr(verbose, instance, &data, &error);
-	status = mbview_getsharedptr(verbose, &shareddata, &error);
-
-	/* check if any nav is selected */
-	nselected = 0;
-	sprintf(mbvelocitytool_cmd, "mbvelocitytool");
-	if (status == MB_SUCCESS && shareddata->nnav > 0)
-		{
-		for (i=0;i<shareddata->nnav;i++)
-			{
-			nav = (struct mbview_nav_struct *) &(shareddata->navs[i]);
-fprintf(stderr,"Nav %d name:%s path:%s format:%d nselected:%d\n",
-i, nav->name, nav->pathraw, nav->format, nav->nselected);
-			if (nav->nselected > 0)
-				{
-				sprintf(filearg, " -F%d -I%s", nav->format, nav->pathraw);
-				strncat(mbvelocitytool_cmd, filearg, MB_PATH_MAXLINE-3);
-				nselected += nav->nselected;
-fprintf(stderr, "nselected: %d %d    Adding filearg:%s\n",nav->nselected, nselected, filearg);
-				}
-			}
-		}
-
-	/* open all data files with selected nav into mbvelocitytool */
-	if (status == MB_SUCCESS && shareddata->nnav > 0 && nselected > 0)
-		{
-		strncat(mbvelocitytool_cmd, " &", MB_PATH_MAXLINE);
-fprintf(stderr,"Calling mbvelocitytool: %s\n", mbvelocitytool_cmd);
-		shellstatus = system(mbvelocitytool_cmd);
-		}
-
-	/* update widgets of all mbview windows */
-	status = mbview_update(verbose, instance, &error);
-	for (i=0;i<MBV_MAX_WINDOWS;i++)
-		{
-		if (i != instance && mbview_id[i] == MB_YES)
-			status = mbview_update(verbose, i, &error);
-		}
-}
-/*---------------------------------------------------------------------------------------*/
-
-void do_mbgrdviz_make_survey( Widget w, XtPointer client_data, XtPointer call_data)
-{
-	char function_name[] = "do_mbgrdviz_make_survey";
-	int	status = MB_SUCCESS;
-
-	/* mbview instance */
-        Cardinal ac = 0;
-        Arg      args[256];
-	size_t	instance;
-	struct mbview_struct *data;
-
-    	/* get source mbview instance */
-	instance = (size_t) client_data;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       w:           %p\n",w);
-		fprintf(stderr,"dbg2       client_data: %p\n",client_data);
-		fprintf(stderr,"dbg2       call_data:   %p\n",call_data);
-		}
-
-    	/* check data source for area to bounding desired survey */
-	status = mbview_getdataptr(verbose, instance, &data, &error);
-
-	/* check if area is currently defined */
-	if (status == MB_SUCCESS)
-		{
-		if (data->area_type != MBV_AREA_QUAD)
-			status = MB_FAILURE;
-		}
-
-    	/* set parameters and display the survey generation dialog */
-	if (status == MB_SUCCESS)
-		{
-
-		/* set title to open primary grid */
-		ac = 0;
-		XtSetArg(args[ac], XmNtitle, "Generate Survey Lines from Area"); ac++;
-		XtSetValues(bulletinBoard_arearoute, args, ac);
-
-		/* set instance into XmNuserData resources */
-		ac = 0;
-		XtSetArg(args[ac], XmNuserData, (XtPointer)instance); ac++;
-		XtSetValues(bulletinBoard_arearoute, args, ac);
-		XtSetValues(textField_arearoute_name, args, ac);
-		XtSetValues(spinBox_arearoute_color, args, ac);
-		XtSetValues(spinText_arearoute_color, args, ac);
-		XtSetValues(spinBox_arearoute_crosslines, args, ac);
-		XtSetValues(spinText_arearoute_crosslines, args, ac);
-		XtSetValues(spinBox_arearoute_altitude, args, ac);
-		XtSetValues(spinText_arearoute_altitude, args, ac);
-		XtSetValues(spinBox_arearoute_depth, args, ac);
-		XtSetValues(spinText_arearoute_depth, args, ac);
-		XtSetValues(spinBox_arearoute_direction, args, ac);
-		XtSetValues(spinText_arearoute_direction, args, ac);
-		XtSetValues(spinBox_arearoute_swathwidth, args, ac);
-		XtSetValues(spinText_arearoute_swathwidth, args, ac);
-		XtSetValues(spinBox_arearoute_platform, args, ac);
-		XtSetValues(spinText_arearoute_platform, args, ac);
-		XtSetValues(spinBox_arearoute_linespacing, args, ac);
-		XtSetValues(spinText_arearoute_linespacing, args, ac);
-		XtSetValues(spinBox_arearoute_crosslinesfirstlast, args, ac);
-		XtSetValues(spinText_arearoute_crosslinesfirstlast, args, ac);
-		XtSetValues(spinBox_arearoute_interleaving, args, ac);
-		XtSetValues(spinText_arearoute_interleaving, args, ac);
-		XtSetValues(label_arearoute_info, args, ac);
-		XtSetValues(spinBox_arearoute_linecontrol, args, ac);
-		XtSetValues(spinText_arearoute_linecontrol, args, ac);
-		XtSetValues(pushButton_arearoute_ok, args, ac);
-
-		/* setting instance into XmNuserData resources
-			doesn't seem to work, so set survey_instance as well */
-		survey_instance = instance;
-
-		}
-
-    	/* set widgets */
-	if (status == MB_SUCCESS)
-		{
-		ac = 0;
-		XtSetArg(args[ac], XmNposition, survey_mode); ac++;
-		XtSetValues(spinText_arearoute_linecontrol, args, ac);
-
-		ac = 0;
-		XtSetArg(args[ac], XmNposition, survey_direction); ac++;
-		XtSetValues(spinText_arearoute_direction, args, ac);
-
-		ac = 0;
-		XtSetArg(args[ac], XmNposition, survey_crosslines); ac++;
-		XtSetValues(spinText_arearoute_crosslines, args, ac);
-
-		ac = 0;
-		XtSetArg(args[ac], XmNposition, survey_crosslines_last); ac++;
-		XtSetValues(spinText_arearoute_crosslinesfirstlast, args, ac);
-
-		ac = 0;
-		XtSetArg(args[ac], XmNposition, survey_interleaving); ac++;
-		XtSetValues(spinText_arearoute_interleaving, args, ac);
-
-		ac = 0;
-		XtSetArg(args[ac], XmNposition, survey_color); ac++;
-		XtSetValues(spinText_arearoute_color, args, ac);
-
-		ac = 0;
-		XtSetArg(args[ac], XmNposition, survey_linespacing); ac++;
-		XtSetValues(spinText_arearoute_linespacing, args, ac);
-
-		ac = 0;
-		XtSetArg(args[ac], XmNposition, survey_platform); ac++;
-		XtSetValues(spinText_arearoute_platform, args, ac);
-
-		ac = 0;
-		XtSetArg(args[ac], XmNposition, survey_swathwidth); ac++;
-		XtSetValues(spinText_arearoute_swathwidth, args, ac);
-
-		ac = 0;
-		XtSetArg(args[ac], XmNposition, survey_altitude); ac++;
-		XtSetValues(spinText_arearoute_altitude, args, ac);
-
-		ac = 0;
-		XtSetArg(args[ac], XmNposition, survey_depth); ac++;
-		XtSetValues(spinText_arearoute_depth, args, ac);
-
-		XmTextSetString(textField_arearoute_name, survey_name);
-
-		do_mbgrdviz_arearoute_recalc(instance);
-
-		/* put up the dialog */
-		BxManageCB(w, (XtPointer)"bulletinBoard_arearoute", call_data);
-		}
-}
-/*---------------------------------------------------------------------------------------*/
-
-void do_mbgrdviz_generate_survey( Widget w, XtPointer client_data, XtPointer call_data)
-{
-	char function_name[] = "do_mbgrdviz_generate_survey";
-	int	status = MB_SUCCESS;
-
-	/* mbview instance */
-	size_t	instance;
-	struct mbview_struct *data;
-
-	/* survey construction parameters */
-	int	color;
-	double	line_spacing;
-	double	line_spacing_use;
-	double	crossline_spacing;
-	double	sonar_depth;
-	double	sonar_altitude;
-	double	maxtopo;
-	struct mbview_linesegment_struct segment;
-	int	nlines;
-	int	nlinegroups, npoints;
-	double xgrid, ygrid;
-	double xlon, ylat, zdata;
-	double xdisplay, ydisplay, zdisplay;
-	double	dsign;
-	int	waypoint;
-	int	first;
-	double	dsigna[4] = {1.0, -1.0, 1.0, -1.0};
-	int	jendpointa[4] = {0, 0, 1, 1};
-
-	char	*error_message;
-	double	*xx = NULL;
-	double	dx, dy, r, dxuse, dyuse, dxd, dyd, dxextra, dyextra;
-	double	rrr[4], xxx, yyy;
-	int	iline, jendpoint, ok;
-	int	startcorner, endcorner, jstart, kend;
-	int	nlines_alloc = 0;
-	int	i, j, k;
-
-    	/* get source mbview instance */
-	instance = (size_t) client_data;
-
-	/* getting instance from client_data doesn't seem
-		to work so use survey_instance instead */
-	instance = survey_instance;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       w:           %p\n",w);
-		fprintf(stderr,"dbg2       client_data: %p\n",client_data);
-		fprintf(stderr,"dbg2       call_data:   %p\n",call_data);
-		}
-
-    	/* check data source for area to bounding desired survey */
-	status = mbview_getdataptr(verbose, instance, &data, &error);
-
-	/* check if area is currently defined */
-	if (status == MB_SUCCESS)
-		{
-		if (data->area_type != MBV_AREA_QUAD)
-			status = MB_FAILURE;
-		}
-
-    	/* generate survey lines from area and add as new route */
-	if (status == MB_SUCCESS)
-		{
-		/* delete current working route if defined */
-		if (working_route > -1)
-			{
-			mbview_deleteroute(verbose, instance, working_route, &error);
-			working_route = -1;
-			}
-
-		/* get unit vector for survey area boundaries */
-		dx = data->area.cornerpoints[1].xdisplay
-			- data->area.cornerpoints[0].xdisplay;
-		dy = data->area.cornerpoints[1].ydisplay
-			- data->area.cornerpoints[0].ydisplay;
-		r = sqrt(dx * dx + dy * dy);
-		dx = dx / r;
-		dy = dy / r;
-
-		/* get parameters */
-		if (data->area.bearing >= 315.0 || data->area.bearing < 45.0)
-			{
-			if (survey_direction == MBGRDVIZ_SURVEY_DIRECTION_SW)
-				k = 0;
-			else if (survey_direction == MBGRDVIZ_SURVEY_DIRECTION_SE)
-				k = 1;
-			else if (survey_direction == MBGRDVIZ_SURVEY_DIRECTION_NW)
-				k = 2;
-			else /* if (survey_direction == MBGRDVIZ_SURVEY_DIRECTION_NE) */
-				k = 3;
-			}
-		else if (data->area.bearing >= 45.0 && data->area.bearing < 135.0)
-			{
-			if (survey_direction == MBGRDVIZ_SURVEY_DIRECTION_SW)
-				k = 1;
-			else if (survey_direction == MBGRDVIZ_SURVEY_DIRECTION_SE)
-				k = 3;
-			else if (survey_direction == MBGRDVIZ_SURVEY_DIRECTION_NW)
-				k = 0;
-			else /* if (survey_direction == MBGRDVIZ_SURVEY_DIRECTION_NE) */
-				k = 2;
-			}
-		else if (data->area.bearing >= 135.0 && data->area.bearing < 225.0)
-			{
-			if (survey_direction == MBGRDVIZ_SURVEY_DIRECTION_SW)
-				k = 3;
-			else if (survey_direction == MBGRDVIZ_SURVEY_DIRECTION_SE)
-				k = 2;
-			else if (survey_direction == MBGRDVIZ_SURVEY_DIRECTION_NW)
-				k = 1;
-			else /* if (survey_direction == MBGRDVIZ_SURVEY_DIRECTION_NE) */
-				k = 0;
-			}
-		else /* if (data->area.bearing >= 225.0 && data->area.bearing < 315.0) */
-			{
-			if (survey_direction == MBGRDVIZ_SURVEY_DIRECTION_SW)
-				k = 2;
-			else if (survey_direction == MBGRDVIZ_SURVEY_DIRECTION_SE)
-				k = 0;
-			else if (survey_direction == MBGRDVIZ_SURVEY_DIRECTION_NW)
-				k = 3;
-			else /* if (survey_direction == MBGRDVIZ_SURVEY_DIRECTION_NE) */
-				k = 1;
-			}
-		dsign = dsigna[k];
-		jendpoint = jendpointa[k];
-		if (survey_color == 0)
-			color = MBV_COLOR_BLACK;
-		else if (survey_color == 1)
-			color = MBV_COLOR_YELLOW;
-		else if (survey_color == 2)
-			color = MBV_COLOR_GREEN;
-		else if (survey_color == 3)
-			color = MBV_COLOR_BLUEGREEN;
-		else if (survey_color == 4)
-			color = MBV_COLOR_BLUE;
-		else if (survey_color == 5)
-			color = MBV_COLOR_PURPLE;
-
-		/* initialize number of waypoints */
-		npoints = 0;
-		first = MB_YES;
-
-		/* do uniform line spacing */
-		if (survey_mode == MBGRDVIZ_SURVEY_MODE_UNIFORM)
-			{
-			/* get number of lines */
-			line_spacing = (double) survey_linespacing;
-			line_spacing_use = line_spacing * r / data->area.width;
-			nlines = (data->area.width / line_spacing) + 1;
-
-			/* allocate space for line position array */
-			status = mb_mallocd(verbose,__FILE__,__LINE__, nlines * sizeof(double), (void **)&xx, &error);
-			if (status != MB_SUCCESS)
-				{
-				nlines_alloc = 0;
-				mb_error(verbose,error,&error_message);
-				fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",
-					error_message);
-				}
-			else
-				nlines_alloc = nlines;
-
-			/* calculate line positions */
-			if (status == MB_SUCCESS)
-			for (i=0;i<nlines;i++)
-				{
-				/* get line position in survey area */
-				xx[i] = dsign * line_spacing_use * (((double)i) - 0.5 * (nlines - 1.0));
-				}
-			}
-
-		/* do variable line spacing with constant altitude */
-		else if (survey_mode == MBGRDVIZ_SURVEY_MODE_VARIABLE
-			&& survey_platform == MBGRDVIZ_SURVEY_PLATFORM_SUBMERGED_ALTITUDE)
-			{
-			/* get number of lines */
-			line_spacing = (double) survey_altitude * 2.0 * tan(DTR * 0.5 * (double) survey_swathwidth);
-			line_spacing_use = line_spacing * r / data->area.width;
-			nlines = (data->area.width / line_spacing) + 1;
-
-			/* allocate space for line position array */
-			status = mb_mallocd(verbose,__FILE__,__LINE__, nlines * sizeof(double), (void **)&xx, &error);
-			if (status != MB_SUCCESS)
-				{
-				nlines_alloc = 0;
-				mb_error(verbose,error,&error_message);
-				fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",
-					error_message);
-				}
-			else
-				nlines_alloc = nlines;
-
-			/* calculate line positions */
-			if (status == MB_SUCCESS)
-			for (i=0;i<nlines;i++)
-				{
-				/* get line position in survey area */
-				xx[i] = dsign * line_spacing_use * (((double)i) - 0.5 * (nlines - 1.0));
-				}
-			}
-
-		/* do variable line spacing with variable altitude */
-		else if (survey_mode == MBGRDVIZ_SURVEY_MODE_VARIABLE)
-			{
-			/* get platform depth */
-			if (survey_platform == MBGRDVIZ_SURVEY_PLATFORM_SUBMERGED_DEPTH)
-				{
-				sonar_depth = (double) survey_depth;
-				}
-			else
-				{
-				sonar_depth = 0.0;
-				}
-
-			/* allocate space for line position array */
-			nlines_alloc += 100;
-			status = mb_mallocd(verbose, __FILE__, __LINE__, nlines_alloc * sizeof(double), (void **)&xx, &error);
-			if (status != MB_SUCCESS)
-				{
-				nlines_alloc = 0;
-				mb_error(verbose,error,&error_message);
-				fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",
-					error_message);
-				}
-
-			/* start on the port side of the survey */
-			/* find range of altitude along each line and calculate the swath width
-				from the smallest altitude */
-			xx[0] = -dsign * 0.5 * r;
-			nlines = 1;
-			segment.nls = 0;
-			segment.nls_alloc = 0;
-			segment.lspoints = NULL;
-
-			while (nlines == 1 || fabs(xx[nlines-1] + dsign * 0.5 * line_spacing_use) < 0.5 * r)
-				{
-				/* allocate more space for xx if needed */
-				if (nlines_alloc <= nlines)
-					{
-					nlines_alloc += 100;
-					status = mb_reallocd(verbose, __FILE__, __LINE__, nlines_alloc * sizeof(double), (void **)&xx, &error);
-					if (status != MB_SUCCESS)
-						{
-						nlines_alloc = 0;
-						mb_error(verbose,error,&error_message);
-						fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",
-							error_message);
-						}
-					}
-				/* get offset from last xx */
-				dxuse = dx * xx[nlines-1];
-				dyuse = dy * xx[nlines-1];
-
-				/* get first point */
-				segment.endpoints[0].xdisplay = data->area.endpoints[0].xdisplay + dxuse;
-				segment.endpoints[0].ydisplay = data->area.endpoints[0].ydisplay + dyuse;
-				segment.endpoints[0].zdisplay = data->area.endpoints[0].zdisplay;
-				mbview_projectinverse(instance, MB_YES,
-						segment.endpoints[0].xdisplay,
-						segment.endpoints[0].ydisplay,
-						segment.endpoints[0].zdisplay,
-						&segment.endpoints[0].xlon,
-						&segment.endpoints[0].ylat,
-						&segment.endpoints[0].xgrid,
-						&segment.endpoints[0].ygrid);
-				mbview_getzdata(instance,
-						segment.endpoints[0].xgrid, segment.endpoints[0].ygrid,
-						&ok, &segment.endpoints[0].zdata);
-
-				/* get second point */
-				segment.endpoints[1].xdisplay = data->area.endpoints[1].xdisplay + dxuse;
-				segment.endpoints[1].ydisplay = data->area.endpoints[1].ydisplay + dyuse;
-				segment.endpoints[1].zdisplay = data->area.endpoints[1].zdisplay;
-				mbview_projectinverse(instance, MB_YES,
-						segment.endpoints[1].xdisplay,
-						segment.endpoints[1].ydisplay,
-						segment.endpoints[1].zdisplay,
-						&segment.endpoints[1].xlon,
-						&segment.endpoints[1].ylat,
-						&segment.endpoints[1].xgrid,
-						&segment.endpoints[1].ygrid);
-				mbview_getzdata(instance,
-						segment.endpoints[1].xgrid, segment.endpoints[1].ygrid,
-						&ok, &segment.endpoints[1].zdata);
-
-				/* drape line and get max topo */
-				mbview_drapesegment(instance, &(segment));
-				maxtopo = -9999999.9;
-				if (segment.endpoints[0].zdata < -sonar_depth)
-					{
-					maxtopo = segment.endpoints[0].zdata;
-					}
-				if (segment.endpoints[1].zdata < -sonar_depth
-					&& segment.endpoints[1].zdata > maxtopo)
-					{
-					maxtopo = segment.endpoints[1].zdata;
-					}
-				for (i=0;i<segment.nls;i++)
-					{
-					if (segment.lspoints[i].zdata < -sonar_depth)
-						maxtopo = MAX(maxtopo, segment.lspoints[i].zdata);
-					}
-
-				/* figure minimum swath width and location of next line */
-				sonar_altitude = -maxtopo - sonar_depth;
-				line_spacing = sonar_altitude * 2.0 * tan(DTR * 0.5 * (double) survey_swathwidth);
-				line_spacing_use = line_spacing * r / data->area.width;
-				xx[nlines] = xx[nlines-1] + dsign * line_spacing_use;
-				nlines++;
-				}
-
-			/* deallocate segment points */
-			if (segment.lspoints != NULL)
-				{
-				mb_freed(verbose, __FILE__, __LINE__, (void **)&(segment.lspoints), &error);
-				segment.nls_alloc = 0;
-				}
-			}
-
-		/* do crosslines if requested */
-		if (survey_crosslines > 0 && survey_crosslines_last == MB_NO && status == MB_SUCCESS)
-			{
-			/* figure out which corner the main lines start at */
-			dxuse = dx * xx[0];
-			dyuse = dy * xx[0];
-			dxextra = 0.0;
-			dyextra = 0.0;
-			xdisplay = data->area.endpoints[jendpoint].xdisplay
-				+ dxuse + dxextra;
-			ydisplay = data->area.endpoints[jendpoint].ydisplay
-				+ dyuse + dyextra;
-			for (i=0;i<4;i++)
-				{
-				xxx = xdisplay - data->area.cornerpoints[i].xdisplay;
-				yyy = ydisplay - data->area.cornerpoints[i].ydisplay;
-				rrr[i] = sqrt(xxx * xxx + yyy * yyy);
-				}
-			startcorner = 0;
-			for (i=1;i<4;i++)
-				{
-				if (rrr[i] < rrr[startcorner])
-					startcorner = i;
-				}
-
-			/* figure out which corner the cross lines should start at */
-			if (survey_crosslines % 2 == 0)
-				{
-				if (startcorner == 0)
-					startcorner = 3;
-				else if (startcorner == 1)
-					startcorner = 2;
-				else if (startcorner == 2)
-					startcorner = 1;
-				else if (startcorner == 3)
-					startcorner = 0;
-				}
-			else
-				{
-				if (startcorner == 0)
-					startcorner = 2;
-				else if (startcorner == 1)
-					startcorner = 3;
-				else if (startcorner == 2)
-					startcorner = 0;
-				else if (startcorner == 3)
-					startcorner = 1;
-				}
-
-			/* get crossline vector */
-			if (startcorner == 0 || startcorner == 3)
-				{
-				dx = data->area.cornerpoints[1].xdisplay
-					- data->area.cornerpoints[0].xdisplay;
-				dy = data->area.cornerpoints[1].ydisplay
-					- data->area.cornerpoints[0].ydisplay;
-				}
-			else
-				{
-				dx = data->area.cornerpoints[0].xdisplay
-					- data->area.cornerpoints[1].xdisplay;
-				dy = data->area.cornerpoints[0].ydisplay
-					- data->area.cornerpoints[1].ydisplay;
-				}
-			r = sqrt(dx * dx + dy * dy);
-			dxd = dx / r;
-			dyd = dy / r;
-
-			/* get crossline spacing */
-			crossline_spacing = (data->area.length / (survey_crosslines + 1)) * (r / data->area.width);
-
-			/* generate cross lines */
-			jstart = startcorner;
-			if (startcorner == 0 || startcorner == 2)
-				kend = jstart + 1;
-			else
-				kend = jstart - 1;
-			dx = (data->area.endpoints[1].xdisplay
-				- data->area.endpoints[0].xdisplay) / (survey_crosslines + 1);
-			dy = (data->area.endpoints[1].ydisplay
-				- data->area.endpoints[0].ydisplay) / (survey_crosslines + 1);
-			if (startcorner >= 2)
-				{
-				dx = -dx;
-				dy = -dy;
-				}
-			j = jstart;
-			for (i=0;i<survey_crosslines;i++)
-				{
-				/* get offset from corners */
-				dxuse = (i + 1) * dx;
-				dyuse = (i + 1) * dy;
-				if (j == jstart)
-					{
-					dxextra = -dxd * line_spacing_use;
-					dyextra = -dyd * line_spacing_use;
-					}
-				else
-					{
-					dxextra = dxd * line_spacing_use;
-					dyextra = dyd * line_spacing_use;
-					}
-
-				/* get first point */
-				waypoint = MBV_ROUTE_WAYPOINT_STARTLINE;
-				xdisplay = data->area.cornerpoints[j].xdisplay
-					+ dxuse + dxextra;
-				ydisplay = data->area.cornerpoints[j].ydisplay
-					+ dyuse + dyextra;
-				zdisplay = data->area.cornerpoints[j].zdisplay;
-				mbview_projectinverse(instance, MB_YES,
-						xdisplay, ydisplay, zdisplay,
-						&xlon, &ylat,
-						&xgrid, &ygrid);
-				mbview_getzdata(instance,
-						xgrid, ygrid,
-						&ok, &zdata);
-				if (ok == MB_NO)
-					zdata = data->area.cornerpoints[jendpoint].zdata;
-				mbview_projectll2display(instance,
-					xlon, ylat, zdata,
-					&xdisplay, &ydisplay, &zdisplay);
-				if (first == MB_YES)
-					{
-					mbview_addroute(verbose, instance,
-							1, &xlon, &ylat, &waypoint,
-							color, 2, MB_YES, 
-							survey_name,
-							&working_route, &error);
-					first = MB_NO;
-					}
-				else
-					{
-					mbview_route_add(instance, working_route, npoints, waypoint,
-							xgrid, ygrid,
-							xlon, ylat, zdata,
-							xdisplay, ydisplay, zdisplay);
-					}
-				npoints++;
-
-				/* get second point */
-				if (j == jstart)
-					j = kend;
-				else
-					j = jstart;
-				if (j == jstart)
-					{
-					dxextra = -dxd * line_spacing_use;
-					dyextra = -dyd * line_spacing_use;
-					}
-				else
-					{
-					dxextra = dxd * line_spacing_use;
-					dyextra = dyd * line_spacing_use;
-					}
-
-				/* get second point */
-				waypoint = MBV_ROUTE_WAYPOINT_ENDLINE;
-				xdisplay = data->area.cornerpoints[j].xdisplay
-					+ dxuse + dxextra;
-				ydisplay = data->area.cornerpoints[j].ydisplay
-					+ dyuse + dyextra;
-				zdisplay = data->area.cornerpoints[j].zdisplay;
-				mbview_projectinverse(instance, MB_YES,
-						xdisplay, ydisplay, zdisplay,
-						&xlon, &ylat,
-						&xgrid, &ygrid);
-				mbview_getzdata(instance,
-						xgrid, ygrid,
-						&ok, &zdata);
-				if (ok == MB_NO)
-					zdata = data->area.cornerpoints[jendpoint].zdata;
-				mbview_projectll2display(instance,
-					xlon, ylat, zdata,
-					&xdisplay, &ydisplay, &zdisplay);
-				mbview_route_add(instance, working_route, npoints, waypoint,
-						xgrid, ygrid,
-						xlon, ylat, zdata,
-						xdisplay, ydisplay, zdisplay);
-				npoints++;
-				}
-			}
-
-		/* generate the lines */
-		if (nlines > 0 && status == MB_SUCCESS)
-			{
-			/* get unit vector for survey area boundaries */
-			dx = data->area.cornerpoints[1].xdisplay
-				- data->area.cornerpoints[0].xdisplay;
-			dy = data->area.cornerpoints[1].ydisplay
-				- data->area.cornerpoints[0].ydisplay;
-			r = sqrt(dx * dx + dy * dy);
-			dx = dx / r;
-			dy = dy / r;
-
-			/* generate points */
-			/* work in display coordinates */
-			nlinegroups = nlines / survey_interleaving + 1;
-			for (j=0;j<survey_interleaving;j++)
-			for (i=0;i<nlinegroups;i++)
-				{
-				/* get line number */
-				iline = i * survey_interleaving + j;
-
-				if (iline < nlines)
-					{
-					/* get line position in survey area */
-					dxuse = dx * xx[iline];
-					dyuse = dy * xx[iline];
-
-					/* add a bit of transit before later interleaved lines */
-					if (jendpoint == 1)
-						{
-						dxextra = -dy * j * 0.25 * line_spacing_use;
-						dyextra = dx * j * 0.25 * line_spacing_use;
-						}
-					else
-						{
-						dxextra = dy * j * 0.25 * line_spacing_use;
-						dyextra = -dx * j * 0.25 * line_spacing_use;
-						}
-
-					/* get first point */
-					waypoint = MBV_ROUTE_WAYPOINT_STARTLINE;
-					xdisplay = data->area.endpoints[jendpoint].xdisplay
-						+ dxuse + dxextra;
-					ydisplay = data->area.endpoints[jendpoint].ydisplay
-						+ dyuse + dyextra;
-					zdisplay = data->area.endpoints[jendpoint].zdisplay;
-					mbview_projectinverse(instance, MB_YES,
-							xdisplay, ydisplay, zdisplay,
-							&xlon, &ylat,
-							&xgrid, &ygrid);
-					mbview_getzdata(instance,
-							xgrid, ygrid,
-							&ok, &zdata);
-					if (ok == MB_NO)
-						zdata = data->area.endpoints[jendpoint].zdata;
-					mbview_projectll2display(instance,
-						xlon, ylat, zdata,
-						&xdisplay, &ydisplay, &zdisplay);
-fprintf(stderr,"\nSurvey Line:%d Point:%d  Position: %f %f %f  %f %f   %f %f %f\n",
-iline, jendpoint, xlon, ylat, zdata, xgrid, ygrid, xdisplay, ydisplay, zdisplay);
-
-					/* add new route for first point, just add single point
-						after that */
-					if (first == MB_YES)
-						{
-						mbview_addroute(verbose, instance,
-								1, &xlon, &ylat, &waypoint,
-								color, 2, MB_YES, 
-								survey_name,
-								&working_route, &error);
-						first = MB_NO;
-						}
-					else
-						{
-						mbview_route_add(instance, working_route, npoints, waypoint,
-								xgrid, ygrid,
-								xlon, ylat, zdata,
-								xdisplay, ydisplay, zdisplay);
-						}
-					npoints++;
-
-					/* switch endpoint */
-					jendpoint = (jendpoint + 1) % 2;
-
-					/* add a bit of transit before interleaved lines */
-					if (jendpoint == 1)
-						{
-						dxextra = -dy * j * 0.25 * line_spacing_use;
-						dyextra = dx * j * 0.25 * line_spacing_use;
-						}
-					else
-						{
-						dxextra = dy * j * 0.25 * line_spacing_use;
-						dyextra = -dx * j * 0.25 * line_spacing_use;
-						}
-
-					/* get second point */
-					waypoint = MBV_ROUTE_WAYPOINT_ENDLINE;
-					xdisplay = data->area.endpoints[jendpoint].xdisplay
-						+ dxuse + dxextra;
-					ydisplay = data->area.endpoints[jendpoint].ydisplay
-						+ dyuse + dyextra;
-					zdisplay = data->area.endpoints[jendpoint].zdisplay;
-					mbview_projectinverse(instance, MB_YES,
-							xdisplay, ydisplay, zdisplay,
-							&xlon, &ylat,
-							&xgrid, &ygrid);
-					mbview_getzdata(instance,
-							xgrid, ygrid,
-							&ok, &zdata);
-					if (ok == MB_NO)
-						zdata = data->area.endpoints[jendpoint].zdata;
-					mbview_projectll2display(instance,
-						xlon, ylat, zdata,
-						&xdisplay, &ydisplay, &zdisplay);
-fprintf(stderr,"Survey Line:%d Point:%d  Position: %f %f %f  %f %f   %f %f %f\n",
-iline, jendpoint, xlon, ylat, zdata, xgrid, ygrid, xdisplay, ydisplay, zdisplay);
-
-					/* add single point */
-					mbview_route_add(instance, working_route, npoints, waypoint,
-							xgrid, ygrid,
-							xlon, ylat, zdata,
-							xdisplay, ydisplay, zdisplay);
-					npoints++;
-					}
-				}
-
-			/* deallocate line position array */
-			mb_freed(verbose, __FILE__, __LINE__, (void **)&xx, &error);
-			}
-
-		/* do crosslines if requested */
-		if (survey_crosslines > 0 && survey_crosslines_last == MB_YES && status == MB_SUCCESS)
-			{
-			/* figure out which corner the mail lines ended at */
-			for (i=0;i<4;i++)
-				{
-				xxx = xdisplay - data->area.cornerpoints[i].xdisplay;
-				yyy = ydisplay - data->area.cornerpoints[i].ydisplay;
-				rrr[i] = sqrt(xxx * xxx + yyy * yyy);
-				}
-			endcorner = 0;
-			for (i=1;i<4;i++)
-				{
-				if (rrr[i] < rrr[endcorner])
-					endcorner = i;
-				}
-
-			/* get crossline vector */
-			if (endcorner == 0 || endcorner == 3)
-				{
-				dx = data->area.cornerpoints[1].xdisplay
-					- data->area.cornerpoints[0].xdisplay;
-				dy = data->area.cornerpoints[1].ydisplay
-					- data->area.cornerpoints[0].ydisplay;
-				}
-			else
-				{
-				dx = data->area.cornerpoints[0].xdisplay
-					- data->area.cornerpoints[1].xdisplay;
-				dy = data->area.cornerpoints[0].ydisplay
-					- data->area.cornerpoints[1].ydisplay;
-				}
-			r = sqrt(dx * dx + dy * dy);
-			dxd = dx / r;
-			dyd = dy / r;
-
-			/* get crossline spacing */
-			crossline_spacing = (data->area.length / (crossline_spacing + 1)) * (r / data->area.width);
-
-			/* generate cross lines */
-			jstart = endcorner;
-			if (endcorner == 0 || endcorner == 2)
-				kend = jstart + 1;
-			else
-				kend = jstart - 1;
-			dx = (data->area.endpoints[1].xdisplay
-				- data->area.endpoints[0].xdisplay) / (survey_crosslines + 1);
-			dy = (data->area.endpoints[1].ydisplay
-				- data->area.endpoints[0].ydisplay) / (survey_crosslines + 1);
-			if (endcorner >= 2)
-				{
-				dx = -dx;
-				dy = -dy;
-				}
-			j = jstart;
-			for (i=0;i<survey_crosslines;i++)
-				{
-				/* get offset from corners */
-				dxuse = (i + 1) * dx;
-				dyuse = (i + 1) * dy;
-				if (j == jstart)
-					{
-					dxextra = -dxd * line_spacing_use;
-					dyextra = -dyd * line_spacing_use;
-					}
-				else
-					{
-					dxextra = dxd * line_spacing_use;
-					dyextra = dyd * line_spacing_use;
-					}
-
-				/* get first point */
-				waypoint = MBV_ROUTE_WAYPOINT_STARTLINE;
-				xdisplay = data->area.cornerpoints[j].xdisplay
-					+ dxuse + dxextra;
-				ydisplay = data->area.cornerpoints[j].ydisplay
-					+ dyuse + dyextra;
-				zdisplay = data->area.cornerpoints[j].zdisplay;
-				mbview_projectinverse(instance, MB_YES,
-						xdisplay, ydisplay, zdisplay,
-						&xlon, &ylat,
-						&xgrid, &ygrid);
-				mbview_getzdata(instance,
-						xgrid, ygrid,
-						&ok, &zdata);
-				if (ok == MB_NO)
-					zdata = data->area.cornerpoints[jendpoint].zdata;
-				mbview_projectll2display(instance,
-					xlon, ylat, zdata,
-					&xdisplay, &ydisplay, &zdisplay);
-				mbview_route_add(instance, working_route, npoints, waypoint,
-						xgrid, ygrid,
-						xlon, ylat, zdata,
-						xdisplay, ydisplay, zdisplay);
-				npoints++;
-
-				/* get second point */
-				if (j == jstart)
-					j = kend;
-				else
-					j = jstart;
-				if (j == jstart)
-					{
-					dxextra = -dxd * line_spacing_use;
-					dyextra = -dyd * line_spacing_use;
-					}
-				else
-					{
-					dxextra = dxd * line_spacing_use;
-					dyextra = dyd * line_spacing_use;
-					}
-
-				/* get second point */
-				waypoint = MBV_ROUTE_WAYPOINT_ENDLINE;
-				xdisplay = data->area.cornerpoints[j].xdisplay
-					+ dxuse + dxextra;
-				ydisplay = data->area.cornerpoints[j].ydisplay
-					+ dyuse + dyextra;
-				zdisplay = data->area.cornerpoints[j].zdisplay;
-				mbview_projectinverse(instance, MB_YES,
-						xdisplay, ydisplay, zdisplay,
-						&xlon, &ylat,
-						&xgrid, &ygrid);
-				mbview_getzdata(instance,
-						xgrid, ygrid,
-						&ok, &zdata);
-				if (ok == MB_NO)
-					zdata = data->area.cornerpoints[jendpoint].zdata;
-				mbview_projectll2display(instance,
-					xlon, ylat, zdata,
-					&xdisplay, &ydisplay, &zdisplay);
-				mbview_route_add(instance, working_route, npoints, waypoint,
-						xgrid, ygrid,
-						xlon, ylat, zdata,
-						xdisplay, ydisplay, zdisplay);
-				npoints++;
-				}
-
-			}
-
-		/* free the memory for xx */
-		status = mb_freed(verbose, __FILE__, __LINE__, (void **)&xx, &error);
-
-		/* update widgets */
-		do_mbgrdviz_arearoute_info(instance);
-		mbview_enableviewnavs(verbose, instance, &error);
-		status = mbview_update(verbose, instance, &error);
-		}
-
-	/* update widgets of remaining mbview windows */
-	for (i=0;i<MBV_MAX_WINDOWS;i++)
-		{
-		if (i != instance && mbview_id[i] == MB_YES)
-			status = mbview_update(verbose, i, &error);
-		}
-}
-/*---------------------------------------------------------------------------------------*/
-
-
-void
-do_mbgrdviz_arearoute_dismiss( Widget w, XtPointer client_data, XtPointer call_data)
-{
-	char function_name[] = "do_mbgrdviz_arearoute_dismiss";
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       w:           %p\n",w);
-		fprintf(stderr,"dbg2       client_data: %p\n",client_data);
-		fprintf(stderr,"dbg2       call_data:   %p\n",call_data);
-		}
-	/* reset current working route so the last one generated is saved */
-	working_route = -1;
-}
-/*---------------------------------------------------------------------------------------*/
-
-void
-do_mbgrdviz_arearoute_parameterchange( Widget w, XtPointer client_data, XtPointer call_data)
-{
-	char function_name[] = "do_mbgrdviz_arearoute_parameterchange";
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-	int	status = MB_SUCCESS;
-
-	/* mbview instance */
-        Cardinal ac = 0;
-        Arg      args[256];
-	size_t	instance;
-	struct mbview_struct *data;
-	char	*tmp;
-
-    	/* get source mbview instance */
-	instance = (size_t) client_data;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       w:           %p\n",w);
-		fprintf(stderr,"dbg2       client_data: %p\n",client_data);
-		fprintf(stderr,"dbg2       call_data:   %p\n",call_data);
-		}
-
-    	/* check data source for area to bounding desired survey */
-	status = mbview_getdataptr(verbose, instance, &data, &error);
-
-	/* check if area is currently defined */
-	if (status == MB_SUCCESS)
-		{
-		if (data->area_type != MBV_AREA_QUAD)
-			status = MB_FAILURE;
-		}
-
-    	/* get parameters */
-	if (status == MB_SUCCESS)
-		{
-		/* get values */
-
-		ac = 0;
-		XtSetArg(args[ac], XmNposition, (XtPointer) &survey_mode); ac++;
-		XtGetValues(spinText_arearoute_linecontrol, args, ac);
-
-		ac = 0;
-		XtSetArg(args[ac], XmNposition, (XtPointer) &survey_direction); ac++;
-		XtGetValues(spinText_arearoute_direction, args, ac);
-
-		ac = 0;
-		XtSetArg(args[ac], XmNposition, (XtPointer) &survey_crosslines); ac++;
-		XtGetValues(spinText_arearoute_crosslines, args, ac);
-
-		ac = 0;
-		XtSetArg(args[ac], XmNposition, (XtPointer) &survey_crosslines_last); ac++;
-		XtGetValues(spinText_arearoute_crosslinesfirstlast, args, ac);
-
-		ac = 0;
-		XtSetArg(args[ac], XmNposition, (XtPointer) &survey_interleaving); ac++;
-		XtGetValues(spinText_arearoute_interleaving, args, ac);
-
-		ac = 0;
-		XtSetArg(args[ac], XmNposition, (XtPointer) &survey_color); ac++;
-		XtGetValues(spinText_arearoute_color, args, ac);
-
-		ac = 0;
-		XtSetArg(args[ac], XmNposition, (XtPointer) &survey_linespacing); ac++;
-		XtGetValues(spinText_arearoute_linespacing, args, ac);
-
-		ac = 0;
-		XtSetArg(args[ac], XmNposition, (XtPointer) &survey_platform); ac++;
-		XtGetValues(spinText_arearoute_platform, args, ac);
-
-		ac = 0;
-		XtSetArg(args[ac], XmNposition, (XtPointer) &survey_swathwidth); ac++;
-		XtGetValues(spinText_arearoute_swathwidth, args, ac);
-
-		ac = 0;
-		XtSetArg(args[ac], XmNposition, (XtPointer) &survey_altitude); ac++;
-		XtGetValues(spinText_arearoute_altitude, args, ac);
-
-		ac = 0;
-		XtSetArg(args[ac], XmNposition, (XtPointer) &survey_depth); ac++;
-		XtGetValues(spinText_arearoute_depth, args, ac);
-
-		tmp = XmTextGetString(textField_arearoute_name);
-		if (tmp != NULL && strlen(tmp) > 0)
-			strcpy(survey_name,tmp);
-		else
-			{
-			if (strlen(survey_name) <= 0)
-				sprintf(survey_name, "Survey");
-			XmTextSetString(textField_arearoute_name, survey_name);
-			}
-		if (tmp != NULL)
-			XtFree(tmp);
-
-fprintf(stderr,"\nIn do_mbgrdviz_arearoute_parameterchange:\n");
-fprintf(stderr,"  survey_mode:                %d\n",survey_mode);
-fprintf(stderr,"  survey_platform:            %d\n",survey_platform);
-fprintf(stderr,"  survey_interleaving:        %d\n",survey_interleaving);
-fprintf(stderr,"  survey_direction:           %d\n",survey_direction);
-fprintf(stderr,"  survey_crosslines_last:     %d\n",survey_crosslines_last);
-fprintf(stderr,"  survey_crosslines:          %d\n",survey_crosslines);
-fprintf(stderr,"  survey_linespacing:         %d\n",survey_linespacing);
-fprintf(stderr,"  survey_swathwidth:          %d\n",survey_swathwidth);
-fprintf(stderr,"  survey_depth:               %d\n",survey_depth);
-fprintf(stderr,"  survey_altitude:            %d\n",survey_altitude);
-fprintf(stderr,"  survey_color:               %d\n",survey_color);
-fprintf(stderr,"  survey_name:                %s\n",survey_name);
-
-		/* reset widgets accordingly (sensitivity and info) */
-		do_mbgrdviz_arearoute_recalc(instance);
-
-		}
-}
-/*---------------------------------------------------------------------------------------*/
-
-void
-do_mbgrdviz_arearoute_recalc(size_t instance)
-{
-	char function_name[] = "do_mbgrdviz_arearoute_recalc";
-	int	status = MB_SUCCESS;
-
-	/* mbview instance */
-        Cardinal ac = 0;
-        Arg      args[256];
-	struct mbview_struct *data;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       instance:   %zu\n",instance);
-		}
-
-    	/* check data source for area to bounding desired survey */
-	status = mbview_getdataptr(verbose, instance, &data, &error);
-
-	/* check if area is currently defined */
-	if (status == MB_SUCCESS)
-		{
-		if (data->area_type != MBV_AREA_QUAD)
-			status = MB_FAILURE;
-		}
-
-    	/* set widgets */
-	if (status == MB_SUCCESS)
-		{
-		ac = 0;
-		XtSetArg(args[ac], XmNsensitive, True); ac++;
-		XtSetValues(spinText_arearoute_linecontrol, args, ac);
-
-		ac = 0;
-		XtSetArg(args[ac], XmNsensitive, True); ac++;
-		XtSetValues(spinText_arearoute_direction, args, ac);
-
-		ac = 0;
-		XtSetArg(args[ac], XmNsensitive, True); ac++;
-		XtSetValues(spinText_arearoute_crosslines, args, ac);
-
-		ac = 0;
-		XtSetArg(args[ac], XmNsensitive, True); ac++;
-		XtSetValues(spinText_arearoute_crosslinesfirstlast, args, ac);
-
-		ac = 0;
-		XtSetArg(args[ac], XmNsensitive, True); ac++;
-		XtSetValues(spinText_arearoute_interleaving, args, ac);
-
-		ac = 0;
-		XtSetArg(args[ac], XmNsensitive, True); ac++;
-		XtSetValues(spinText_arearoute_color, args, ac);
-
-		ac = 0;
-		if (survey_mode == MBGRDVIZ_SURVEY_MODE_UNIFORM)
-			{
-			XtSetArg(args[ac], XmNsensitive, True); ac++;
-			}
-		else
-			{
-			XtSetArg(args[ac], XmNsensitive, False); ac++;
-			}
-		XtSetValues(spinText_arearoute_linespacing, args, ac);
-
-		ac = 0;
-		if (survey_mode == MBGRDVIZ_SURVEY_MODE_VARIABLE)
-			{
-			XtSetArg(args[ac], XmNsensitive, True); ac++;
-			}
-		else
-			{
-			XtSetArg(args[ac], XmNsensitive, False); ac++;
-			}
-		XtSetValues(spinText_arearoute_platform, args, ac);
-
-		ac = 0;
-		if (survey_mode == MBGRDVIZ_SURVEY_MODE_VARIABLE)
-			{
-			XtSetArg(args[ac], XmNsensitive, True); ac++;
-			}
-		else
-			{
-			XtSetArg(args[ac], XmNsensitive, False); ac++;
-			}
-		XtSetValues(spinText_arearoute_swathwidth, args, ac);
-
-		ac = 0;
-		if (survey_mode == MBGRDVIZ_SURVEY_MODE_VARIABLE
-			&& survey_platform == MBGRDVIZ_SURVEY_PLATFORM_SUBMERGED_ALTITUDE)
-			{
-			XtSetArg(args[ac], XmNsensitive, True); ac++;
-			}
-		else
-			{
-			XtSetArg(args[ac], XmNsensitive, False); ac++;
-			}
-		XtSetValues(spinText_arearoute_altitude, args, ac);
-
-		ac = 0;
-		if (survey_mode == MBGRDVIZ_SURVEY_MODE_VARIABLE
-			&& survey_platform == MBGRDVIZ_SURVEY_PLATFORM_SUBMERGED_DEPTH)
-			{
-			XtSetArg(args[ac], XmNsensitive, True); ac++;
-			}
-		else
-			{
-			XtSetArg(args[ac], XmNsensitive, False); ac++;
-			}
-		XtSetValues(spinText_arearoute_depth, args, ac);
-
-		do_mbgrdviz_arearoute_info(instance);
-
-		}
-}
-/*---------------------------------------------------------------------------------------*/
-
-void
-do_mbgrdviz_arearoute_info(size_t instance)
-{
-	char function_name[] = "do_mbgrdviz_arearoute_info";
-	int	status = MB_SUCCESS;
-
-	/* mbview instance */
-	struct mbview_struct *data;
-	int	nroutewaypoint;
-	int	nroutpoint;
-	char	routename[MB_PATH_MAXLINE];
-	int	routecolor;
-	int	routesize;
-	double	routedistancelateral;
-	double	routedistancetopo;
-	char	info_text[MB_PATH_MAXLINE];
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       instance:   %zu\n",instance);
-		}
-
-    	/* check data source for area to bounding desired survey */
-	status = mbview_getdataptr(verbose, instance, &data, &error);
-
-	/* check if area is currently defined */
-	if (status == MB_SUCCESS)
-		{
-		if (data->area_type != MBV_AREA_QUAD)
-			status = MB_FAILURE;
-		sprintf(info_text, ":::t\"No Current Area:\"");
-		}
-
-    	/* set widgets */
-	if (status == MB_SUCCESS)
-		{
-		if (working_route >= 0)
-			{
-			/* get info for working route */
-			status = mbview_getrouteinfo(verbose, instance,
-			    		working_route, &nroutewaypoint, &nroutpoint,
-					routename, &routecolor, &routesize,
-					&routedistancelateral, &routedistancetopo,
-					&error);
-
-			sprintf(info_text,
-			":::t\"Current Area:\":t\" Length: %.1f m  Width: %.1f m  Bearing: %.1f deg\":t\"New Route: %d  Name: %s\":t\" Waypoints: %d  Total Points:%d\":t\" Distance: %.1f m (lateral) %.1f m (over bottom)\"",
-				data->area.length,
-				data->area.width,
-				data->area.bearing,
-				working_route,
-				routename,
-				nroutewaypoint,
-				nroutpoint,
-				routedistancelateral,
-				routedistancetopo);
-			}
-		else
-			{
-			sprintf(info_text,
-			":::t\"Current Area:\":t\" Length: %.3f m\":t\" Width: %.3f m\":t\" Bearing: %.1f deg\"",
-				data->area.length,
-				data->area.width,
-				data->area.bearing);
-			}
-		set_mbview_label_multiline_string(label_arearoute_info, info_text);
-		}
-}
-/*---------------------------------------------------------------------------------------*/
-
-void
-do_mbgrdviz_arearoute_linespacing_increment( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-	char function_name[] = "do_mbgrdviz_arearoute_linespacing_increment";
-        Cardinal ac = 0;
-        Arg      args[256];
-	int	linespacing;
-	int	increment;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       w:           %p\n",w);
-		fprintf(stderr,"dbg2       client_data: %p\n",client_data);
-		fprintf(stderr,"dbg2       call_data:   %p\n",call_data);
-		}
-
-	/* reset line spacing spinbox increment as value changes */
-  	ac = 0;
-	XtSetArg(args[ac], XmNposition, (XtPointer) &linespacing); ac++;
-	XtGetValues(spinText_arearoute_linespacing, args, ac);
-	if (linespacing < 25)
-		increment = 1;
-	else if (linespacing < 100)
-		increment = 5;
-	else if (linespacing < 250)
-		increment = 10;
-	else if (linespacing < 1000)
-		increment = 25;
-	else if (linespacing < 2000)
-		increment = 50;
-	else
-		increment = 100;
- 	ac = 0;
-	XtSetArg(args[ac], XmNincrementValue, increment); ac++;
-	XtSetValues(spinText_arearoute_linespacing, args, ac);
- }
-/*---------------------------------------------------------------------------------------*/
-
-void
-do_mbgrdviz_arearoute_altitude_increment( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-	char function_name[] = "do_mbgrdviz_arearoute_altitude_increment";
-        Cardinal ac = 0;
-        Arg      args[256];
-	int	altitude;
-	int	increment;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       w:           %p\n",w);
-		fprintf(stderr,"dbg2       client_data: %p\n",client_data);
-		fprintf(stderr,"dbg2       call_data:   %p\n",call_data);
-		}
-
-	/* reset line spacing spinbox increment as value changes */
-  	ac = 0;
-	XtSetArg(args[ac], XmNposition, (XtPointer) &altitude); ac++;
-	XtGetValues(spinText_arearoute_altitude, args, ac);
-	if (altitude < 25)
-		increment = 1;
-	else if (altitude < 100)
-		increment = 5;
-	else if (altitude < 250)
-		increment = 10;
-	else if (altitude < 1000)
-		increment = 25;
-	else if (altitude < 2000)
-		increment = 50;
-	else
-		increment = 100;
- 	ac = 0;
-	XtSetArg(args[ac], XmNincrementValue, increment); ac++;
-	XtSetValues(spinText_arearoute_altitude, args, ac);
-}
-/*---------------------------------------------------------------------------------------*/
-
-
-void
-do_mbgrdviz_arearoute_depth_increment( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-	char function_name[] = "do_mbgrdviz_arearoute_depth_increment";
-	int	status = MB_SUCCESS;
-        Cardinal ac = 0;
-        Arg      args[256];
-	int	depth;
-	int	increment;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       w:           %p\n",w);
-		fprintf(stderr,"dbg2       client_data: %p\n",client_data);
-		fprintf(stderr,"dbg2       call_data:   %p\n",call_data);
-		}
-
-	/* reset line spacing spinbox increment as value changes */
-  	ac = 0;
-	XtSetArg(args[ac], XmNposition, (XtPointer) &depth); ac++;
-	XtGetValues(spinText_arearoute_depth, args, ac);
-	if (depth < 25)
-		increment = 1;
-	else if (depth < 100)
-		increment = 5;
-	else if (depth < 250)
-		increment = 10;
-	else if (depth < 1000)
-		increment = 25;
-	else if (depth < 2000)
-		increment = 50;
-	else
-		increment = 100;
- 	ac = 0;
-	XtSetArg(args[ac], XmNincrementValue, increment); ac++;
-	XtSetValues(spinText_arearoute_depth, args, ac);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-}
-/*---------------------------------------------------------------------------------------*/
-
-void
-do_mbgrdviz_realtime_start( Widget w, XtPointer client_data, XtPointer call_data)
-{
-	char function_name[] = "do_mbgrdviz_realtime_start";
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       w:           %p\n",w);
-		fprintf(stderr,"dbg2       client_data: %p\n",client_data);
-		fprintf(stderr,"dbg2       call_data:   %p\n",call_data);
-		}
-}
-
-void
-do_mbgrdviz_realtimesetup_path_reset( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-	char function_name[] = "do_mbgrdviz_realtimesetup_path_reset";
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       w:           %p\n",w);
-		fprintf(stderr,"dbg2       client_data: %p\n",client_data);
-		fprintf(stderr,"dbg2       call_data:   %p\n",call_data);
-		}
-}
-
-void
-do_mbgrdviz_realtime_pause( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-	char function_name[] = "do_mbgrdviz_realtime_pause";
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       w:           %p\n",w);
-		fprintf(stderr,"dbg2       client_data: %p\n",client_data);
-		fprintf(stderr,"dbg2       call_data:   %p\n",call_data);
-		}
-}
-
-void
-do_mbgrdviz_realtime_stop( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-	char function_name[] = "do_mbgrdviz_realtime_stop";
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       w:           %p\n",w);
-		fprintf(stderr,"dbg2       client_data: %p\n",client_data);
-		fprintf(stderr,"dbg2       call_data:   %p\n",call_data);
-		}
-}
-
-void
-do_mbgrdviz_realtime_resume( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-	char function_name[] = "do_mbgrdviz_realtime_resume";
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       w:           %p\n",w);
-		fprintf(stderr,"dbg2       client_data: %p\n",client_data);
-		fprintf(stderr,"dbg2       call_data:   %p\n",call_data);
-		}
-}
-
-void
-do_mbgrdviz_realtimesetup_path_apply( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-	char function_name[] = "do_mbgrdviz_realtimesetup_path_apply";
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       w:           %p\n",w);
-		fprintf(stderr,"dbg2       client_data: %p\n",client_data);
-		fprintf(stderr,"dbg2       call_data:   %p\n",call_data);
-		}
-}
-
-
-void
-do_mbgrdviz_realtimesetup_icon( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-	char function_name[] = "do_mbgrdviz_realtimesetup_icon";
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       w:           %p\n",w);
-		fprintf(stderr,"dbg2       client_data: %p\n",client_data);
-		fprintf(stderr,"dbg2       call_data:   %p\n",call_data);
-		}
-}
-
-void
-do_mbgrdviz_realtimesetup_path_browse( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-	char function_name[] = "do_mbgrdviz_realtimesetup_path_browse";
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       w:           %p\n",w);
-		fprintf(stderr,"dbg2       client_data: %p\n",client_data);
-		fprintf(stderr,"dbg2       call_data:   %p\n",call_data);
-		}
-
-	do_mbgrdviz_fileSelectionBox_realtime( w, client_data, call_data);
-
-}
-
-void
-do_mbgrdviz_realtimesetup_updaterate( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-	char function_name[] = "do_mbgrdviz_realtimesetup_updaterate";
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       w:           %p\n",w);
-		fprintf(stderr,"dbg2       client_data: %p\n",client_data);
-		fprintf(stderr,"dbg2       call_data:   %p\n",call_data);
-		}
-}
-
-void
-do_mbgrdviz_realtimesetup_path_test( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-	char function_name[] = "do_mbgrdviz_realtimesetup_path_test";
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       w:           %p\n",w);
-		fprintf(stderr,"dbg2       client_data: %p\n",client_data);
-		fprintf(stderr,"dbg2       call_data:   %p\n",call_data);
-		}
-}
-
-void
-do_mbgrdviz_realtimesetup_pathmode( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-	char function_name[] = "do_mbgrdviz_realtimesetup_pathmode";
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       w:           %p\n",w);
-		fprintf(stderr,"dbg2       client_data: %p\n",client_data);
-		fprintf(stderr,"dbg2       call_data:   %p\n",call_data);
-		}
-}
diff --git a/src/mbgrdviz/mbgrdviz_creation.c b/src/mbgrdviz/mbgrdviz_creation.c
deleted file mode 100644
index 07a8a56..0000000
--- a/src/mbgrdviz/mbgrdviz_creation.c
+++ /dev/null
@@ -1,2447 +0,0 @@
-
-/* Begin user code block <abstract> */
-/* End user code block <abstract> */
-
-/**
- * README: Portions of this file are merged at file generation
- * time. Edits can be made *only* in between specified code blocks, look
- * for keywords <Begin user code> and <End user code>.
- */
-/*
- * Generated by the ICS Builder Xcessory (BX).
- *
- * BuilderXcessory Version 6.1.3
- * Code Generator Xcessory 6.1.3 (08/19/04) CGX Scripts 6.1 Motif 2.1
- *
- */
-
-
-/* Begin user code block <file_comments> */
-
-#ifndef SANS
-#define SANS "helvetica"
-#endif
-#ifndef SERIF
-#define SERIF "times"
-#endif
-#ifndef MONO
-#define MONO "courier"
-#endif
-
-/* End user code block <file_comments> */
-
-#include <Xm/Xm.h>
-#include <Xm/MainW.h>
-#include <Xm/DialogS.h>
-#include <Xm/MwmUtil.h>
-#include <Xm/Form.h>
-#include <Xm/Label.h>
-#include <Xm/RowColumn.h>
-#include <Xm/ToggleB.h>
-#include <Xm/PushB.h>
-#include <Xm/Separator.h>
-#include <Xm/SpinB.h>
-#include <Xm/TextF.h>
-#include <Xm/Scale.h>
-#include <Xm/BulletinB.h>
-#include <Xm/FileSB.h>
-#include <Xm/CascadeB.h>
-#include <Xm/MainW.h>
-#include <Xm/DialogS.h>
-#include <Xm/MwmUtil.h>
-#include <Xm/Form.h>
-#include <Xm/Label.h>
-#include <Xm/RowColumn.h>
-#include <Xm/ToggleB.h>
-#include <Xm/PushB.h>
-#include <Xm/Separator.h>
-#include <Xm/SpinB.h>
-#include <Xm/TextF.h>
-#include <Xm/Scale.h>
-#include <Xm/BulletinB.h>
-#include <Xm/FileSB.h>
-#include <Xm/CascadeB.h>
-
-/*
- * Global declarations are now stored in the header file.
- *
- * If DECLARE_BX_GLOBALS is defined then this header file
- * declares the globals, otherwise it just externs them.
- */
-#define DECLARE_BX_GLOBALS
-
-/**
- * Globally included information.
- */
-
-
-/**
- * Common constant and pixmap declarations.
- */
-#include "mbgrdviz_creation.h"
-
-/**
- * Convenience functions from utilities file.
- */
-extern void RegisterBxConverters(XtAppContext);
-extern XtPointer BX_CONVERT(Widget, char *, char *, int, Boolean *);
-extern XtPointer BX_DOUBLE(double);
-extern XtPointer BX_SINGLE(float);
-extern void BX_MENU_POST(Widget, XtPointer, XEvent *, Boolean *);
-extern Pixmap XPM_PIXMAP(Widget, char **);
-extern void BX_SET_BACKGROUND_COLOR(Widget, ArgList, Cardinal *, Pixel);
-
-/**
- * Declarations for callbacks and handlers.
- */
-extern void do_mbgrdviz_quit(Widget, XtPointer, XtPointer);
-extern void BxExitCB(Widget, XtPointer, XtPointer);
-extern void BxUnmanageCB(Widget, XtPointer, XtPointer);
-extern void do_mbgrdviz_realtimesetup_icon(Widget, XtPointer, XtPointer);
-extern void do_mbgrdviz_realtimesetup_path_browse(Widget, XtPointer, XtPointer);
-extern void do_mbgrdviz_realtimesetup_path_test(Widget, XtPointer, XtPointer);
-extern void do_mbgrdviz_realtimesetup_updaterate(Widget, XtPointer, XtPointer);
-extern void do_mbgrdviz_realtimesetup_pathmode(Widget, XtPointer, XtPointer);
-extern void do_mbgrdviz_arearoute_parameterchange(Widget, XtPointer, XtPointer);
-extern void do_mbgrdviz_generate_survey(Widget, XtPointer, XtPointer);
-extern void do_mbgrdviz_arearoute_dismiss(Widget, XtPointer, XtPointer);
-extern void do_mbgrdviz_arearoute_linespacing_increment(Widget, XtPointer, XtPointer);
-extern void do_mbgrdviz_arearoute_altitude_increment(Widget, XtPointer, XtPointer);
-extern void do_mbgrdviz_arearoute_depth_increment(Widget, XtPointer, XtPointer);
-extern void do_mbgrdviz_openfile(Widget, XtPointer, XtPointer);
-extern void do_mbgrdviz_fileSelectionBox(Widget, XtPointer, XtPointer);
-extern void do_mbgrdviz_fileSelectionBox_opensite(Widget, XtPointer, XtPointer);
-extern void do_mbgrdviz_fileSelectionBox_openroute(Widget, XtPointer, XtPointer);
-extern void do_mbgrdviz_fileSelectionBox_opennav(Widget, XtPointer, XtPointer);
-extern void do_mbgrdviz_fileSelectionBox_openswath(Widget, XtPointer, XtPointer);
-extern void do_mbgrdviz_fileSelectionBox_openvector(Widget, XtPointer, XtPointer);
-extern void do_mbgrdviz_fileSelectionBox_savesite(Widget, XtPointer, XtPointer);
-extern void do_mbgrdviz_fileSelectionBox_saveroute(Widget, XtPointer, XtPointer);
-extern void BxManageCB(Widget, XtPointer, XtPointer);
-extern void do_mbgrdviz_realtime_start(Widget, XtPointer, XtPointer);
-extern void do_mbgrdviz_realtime_stop(Widget, XtPointer, XtPointer);
-extern void do_mbgrdviz_realtime_pause(Widget, XtPointer, XtPointer);
-extern void do_mbgrdviz_realtime_resume(Widget, XtPointer, XtPointer);
-
-/**
- * Create the mainWindow_mbgrdviz hierarchy of widgets.
- */
-Widget
-CreatemainWindow_mbgrdviz(Widget parent)
-{
-    Cardinal ac = 0;
-    Arg      args[256];
-    Boolean  argok = False;
-    Widget   mainWindow_mbgrdviz;
-    Widget   dialogShell_realtimesetup;
-    Widget   form_realtime_setup;
-    Widget   toggleButton;
-    Widget   pushButton_realtimesetup_dismiss;
-    Widget   separator6;
-    Widget   spinBox_realtimesetup_icon;
-    Widget   label_realtime_setup_icon;
-    Widget   separator5;
-    Widget   label_realtimesetup_update;
-    Widget   separator4;
-    Widget   label_realtimesetup_path;
-    Widget   dialogShell_arearoute;
-    Widget   label_arearoute_interleaving;
-    Widget   label_arearoute_name;
-    Widget   label_arearoute_color;
-    Widget   label_arearoute_crosslines;
-    Widget   label_arearoute_direction;
-    Widget   label_arearoute_crosslinesfirstlast;
-    Widget   label_arearoute_linecontrol;
-    Widget   pushButton_arearoute_dismiss;
-    Widget   dialogShell_about;
-    Widget   bulletinBoard_about;
-    Widget   label_about_authors;
-    Widget   label_about_MBARI;
-    Widget   label_about_LDEO;
-    Widget   separator3;
-    Widget   label_about_mbsystem;
-    Widget   separator1;
-    Widget   label_about_title;
-    Widget   pushButton_about_dismiss;
-    Widget   bulletinBoard_mbgrdviz;
-    Widget   menuBar_mbgrdviz;
-    Widget   cascadeButton_file;
-    Widget   pulldownMenu_file;
-    Widget   separator;
-    Widget   separator2;
-    Widget   pushButton_quit;
-    Widget   cascadeButton_help;
-    Widget   pulldownMenu_help;
-    Widget   pushButton_help_about;
-    Widget   cascadeButton_realtime;
-    Widget   pulldownMenu_realtime;
-
-    /**
-     * Register the converters for the widgets.
-     */
-    RegisterBxConverters(XtWidgetToApplicationContext(parent));
-    XtInitializeWidgetClass((WidgetClass)xmMainWindowWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmDialogShellWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmFormWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmLabelWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmRowColumnWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmToggleButtonWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmPushButtonWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmSeparatorWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmSpinBoxWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmTextFieldWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmScaleWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmBulletinBoardWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmFileSelectionBoxWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmBulletinBoardWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmRowColumnWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmCascadeButtonWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmRowColumnWidgetClass);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 108); ac++;
-    XtSetArg(args[ac], XmNy, 263); ac++;
-    XtSetArg(args[ac], XmNwidth, 260); ac++;
-    XtSetArg(args[ac], XmNheight, 215); ac++;
-    mainWindow_mbgrdviz = XmCreateMainWindow(parent,
-        (char *)"mainWindow_mbgrdviz",
-        args,
-        ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNresizePolicy, XmRESIZE_GROW); ac++;
-    XtSetArg(args[ac], XmNwidth, 260); ac++;
-    XtSetArg(args[ac], XmNheight, 181); ac++;
-    bulletinBoard_mbgrdviz = XmCreateBulletinBoard(mainWindow_mbgrdviz,
-        (char *)"bulletinBoard_mbgrdviz",
-        args,
-        ac);
-    XtManageChild(bulletinBoard_mbgrdviz);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNpacking, XmPACK_TIGHT); ac++;
-    XtSetArg(args[ac], XmNwidth, 260); ac++;
-    XtSetArg(args[ac], XmNheight, 34); ac++;
-    menuBar_mbgrdviz = XmCreateMenuBar(mainWindow_mbgrdviz,
-        (char *)"menuBar_mbgrdviz",
-        args,
-        ac);
-    XtManageChild(menuBar_mbgrdviz);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(menuBar_mbgrdviz, (char *)"File",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 5); ac++;
-        XtSetArg(args[ac], XmNy, 5); ac++;
-        XtSetArg(args[ac], XmNwidth, 41); ac++;
-        XtSetArg(args[ac], XmNheight, 24); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(menuBar_mbgrdviz, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        cascadeButton_file = XmCreateCascadeButton(menuBar_mbgrdviz,
-            (char *)"cascadeButton_file",
-            args,
-            ac);
-        XtManageChild(cascadeButton_file);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 113); ac++;
-    XtSetArg(args[ac], XmNy, 292); ac++;
-    XtSetArg(args[ac], XmNwidth, 142); ac++;
-    XtSetArg(args[ac], XmNheight, 224); ac++;
-    pulldownMenu_file = XmCreatePulldownMenu(XtParent(cascadeButton_file),
-        (char *)"pulldownMenu_file",
-        args,
-        ac);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(pulldownMenu_file, (char *)"Open Primary Grid",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_file, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_file_openprimary = XmCreatePushButton(pulldownMenu_file,
-            (char *)"pushButton_file_openprimary",
-            args,
-            ac);
-        XtManageChild(pushButton_file_openprimary);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_file_openprimary, XmNactivateCallback, do_mbgrdviz_fileSelectionBox, (XtPointer)0);
-
-    ac = 0;
-    separator = XmCreateSeparator(pulldownMenu_file,
-        (char *)"separator",
-        args,
-        ac);
-    XtManageChild(separator);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(pulldownMenu_file, (char *)"Open Site",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_file, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_opensite = XmCreatePushButton(pulldownMenu_file,
-            (char *)"pushButton_opensite",
-            args,
-            ac);
-        XtManageChild(pushButton_opensite);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_opensite, XmNactivateCallback, do_mbgrdviz_fileSelectionBox_opensite, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(pulldownMenu_file, (char *)"Open Route",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_file, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_openroute = XmCreatePushButton(pulldownMenu_file,
-            (char *)"pushButton_openroute",
-            args,
-            ac);
-        XtManageChild(pushButton_openroute);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_openroute, XmNactivateCallback, do_mbgrdviz_fileSelectionBox_openroute, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(pulldownMenu_file, (char *)"Open Navigation",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_file, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_opennav = XmCreatePushButton(pulldownMenu_file,
-            (char *)"pushButton_opennav",
-            args,
-            ac);
-        XtManageChild(pushButton_opennav);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_opennav, XmNactivateCallback, do_mbgrdviz_fileSelectionBox_opennav, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(pulldownMenu_file, (char *)"Open Swath",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_file, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_openswath = XmCreatePushButton(pulldownMenu_file,
-            (char *)"pushButton_openswath",
-            args,
-            ac);
-        XtManageChild(pushButton_openswath);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_openswath, XmNactivateCallback, do_mbgrdviz_fileSelectionBox_openswath, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(pulldownMenu_file, (char *)"Open Vector",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_file, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_openvector = XmCreatePushButton(pulldownMenu_file,
-            (char *)"pushButton_openvector",
-            args,
-            ac);
-        XtManageChild(pushButton_openvector);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_openvector, XmNactivateCallback, do_mbgrdviz_fileSelectionBox_openvector, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(pulldownMenu_file, (char *)"Save Site",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_file, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_savesite = XmCreatePushButton(pulldownMenu_file,
-            (char *)"pushButton_savesite",
-            args,
-            ac);
-        XtManageChild(pushButton_savesite);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_savesite, XmNactivateCallback, do_mbgrdviz_fileSelectionBox_savesite, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(pulldownMenu_file, (char *)"Save Route",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_file, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_saveroute = XmCreatePushButton(pulldownMenu_file,
-            (char *)"pushButton_saveroute",
-            args,
-            ac);
-        XtManageChild(pushButton_saveroute);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_saveroute, XmNactivateCallback, do_mbgrdviz_fileSelectionBox_saveroute, (XtPointer)0);
-
-    ac = 0;
-    separator2 = XmCreateSeparator(pulldownMenu_file,
-        (char *)"separator2",
-        args,
-        ac);
-    XtManageChild(separator2);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(pulldownMenu_file, (char *)"Quit",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_file, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_quit = XmCreatePushButton(pulldownMenu_file,
-            (char *)"pushButton_quit",
-            args,
-            ac);
-        XtManageChild(pushButton_quit);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_quit, XmNactivateCallback, do_mbgrdviz_quit, (XtPointer)0);
-    XtAddCallback(pushButton_quit, XmNactivateCallback, BxExitCB, (XtPointer)0);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNsubMenuId, pulldownMenu_file); ac++;
-    XtSetValues(cascadeButton_file, args, ac);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(menuBar_mbgrdviz, (char *)"Help",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 208); ac++;
-        XtSetArg(args[ac], XmNy, 5); ac++;
-        XtSetArg(args[ac], XmNwidth, 47); ac++;
-        XtSetArg(args[ac], XmNheight, 24); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(menuBar_mbgrdviz, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        cascadeButton_help = XmCreateCascadeButton(menuBar_mbgrdviz,
-            (char *)"cascadeButton_help",
-            args,
-            ac);
-        XtManageChild(cascadeButton_help);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 0); ac++;
-    XtSetArg(args[ac], XmNy, 0); ac++;
-    XtSetArg(args[ac], XmNwidth, 54); ac++;
-    XtSetArg(args[ac], XmNheight, 28); ac++;
-    pulldownMenu_help = XmCreatePulldownMenu(XtParent(cascadeButton_help),
-        (char *)"pulldownMenu_help",
-        args,
-        ac);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(pulldownMenu_help, (char *)"About",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_help, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_help_about = XmCreatePushButton(pulldownMenu_help,
-            (char *)"pushButton_help_about",
-            args,
-            ac);
-        XtManageChild(pushButton_help_about);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_help_about, XmNactivateCallback, BxManageCB, (XtPointer)"bulletinBoard_about");
-
-    ac = 0;
-    XtSetArg(args[ac], XmNsubMenuId, pulldownMenu_help); ac++;
-    XtSetValues(cascadeButton_help, args, ac);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(menuBar_mbgrdviz, (char *)"Realtime",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNsensitive, False); ac++;
-        XtSetArg(args[ac], XmNx, 46); ac++;
-        XtSetArg(args[ac], XmNy, 5); ac++;
-        XtSetArg(args[ac], XmNwidth, 76); ac++;
-        XtSetArg(args[ac], XmNheight, 24); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(menuBar_mbgrdviz, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        cascadeButton_realtime = XmCreateCascadeButton(menuBar_mbgrdviz,
-            (char *)"cascadeButton_realtime",
-            args,
-            ac);
-        XtManageChild(cascadeButton_realtime);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 0); ac++;
-    XtSetArg(args[ac], XmNy, 0); ac++;
-    XtSetArg(args[ac], XmNwidth, 68); ac++;
-    XtSetArg(args[ac], XmNheight, 124); ac++;
-    pulldownMenu_realtime = XmCreatePulldownMenu(XtParent(cascadeButton_realtime),
-        (char *)"pulldownMenu_realtime",
-        args,
-        ac);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(pulldownMenu_realtime, (char *)"Setup",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNsensitive, False); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_realtime, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_realtime_setup = XmCreatePushButton(pulldownMenu_realtime,
-            (char *)"pushButton_realtime_setup",
-            args,
-            ac);
-        XtManageChild(pushButton_realtime_setup);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_realtime_setup, XmNactivateCallback, BxManageCB, (XtPointer)"form_realtime_setup");
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(pulldownMenu_realtime, (char *)"Start",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNsensitive, False); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_realtime, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_realtime_start = XmCreatePushButton(pulldownMenu_realtime,
-            (char *)"pushButton_realtime_start",
-            args,
-            ac);
-        XtManageChild(pushButton_realtime_start);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_realtime_start, XmNactivateCallback, do_mbgrdviz_realtime_start, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(pulldownMenu_realtime, (char *)"Stop",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNsensitive, False); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_realtime, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_realtime_stop = XmCreatePushButton(pulldownMenu_realtime,
-            (char *)"pushButton_realtime_stop",
-            args,
-            ac);
-        XtManageChild(pushButton_realtime_stop);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_realtime_stop, XmNactivateCallback, do_mbgrdviz_realtime_stop, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(pulldownMenu_realtime, (char *)"Pause",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNsensitive, False); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_realtime, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_realtime_pause = XmCreatePushButton(pulldownMenu_realtime,
-            (char *)"pushButton_realtime_pause",
-            args,
-            ac);
-        XtManageChild(pushButton_realtime_pause);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_realtime_pause, XmNactivateCallback, do_mbgrdviz_realtime_pause, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(pulldownMenu_realtime, (char *)"Resume",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNsensitive, False); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_realtime, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_realtime_resume = XmCreatePushButton(pulldownMenu_realtime,
-            (char *)"pushButton_realtime_resume",
-            args,
-            ac);
-        XtManageChild(pushButton_realtime_resume);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_realtime_resume, XmNactivateCallback, do_mbgrdviz_realtime_resume, (XtPointer)0);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNsubMenuId, pulldownMenu_realtime); ac++;
-    XtSetValues(cascadeButton_realtime, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNtitle, "About MBgrdviz..."); ac++;
-    XtSetArg(args[ac], XmNwidth, 463); ac++;
-    XtSetArg(args[ac], XmNheight, 531); ac++;
-    XtSetArg(args[ac], XmNdeleteResponse, XmDO_NOTHING); ac++;
-    dialogShell_about = XmCreateDialogShell(mainWindow_mbgrdviz,
-        (char *)"dialogShell_about",
-        args,
-        ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNresizePolicy, XmRESIZE_GROW); ac++;
-    XtSetArg(args[ac], XmNx, 0); ac++;
-    XtSetArg(args[ac], XmNy, 1071); ac++;
-    XtSetArg(args[ac], XmNwidth, 463); ac++;
-    XtSetArg(args[ac], XmNheight, 531); ac++;
-    bulletinBoard_about = XtCreateWidget((char *)"bulletinBoard_about",
-        xmBulletinBoardWidgetClass,
-        dialogShell_about,
-        args,
-        ac);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_about, (char *)"::#TimesMedium14:t\"MB-System Release 5.0.8\"#TimesMedium14\"February 2, 2006\"",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_about, (char *)"-*-"SERIF"-medium-r-*-*-*-140-*-*-*-*-iso8859-1=TimesMedium14",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 410); ac++;
-        XtSetArg(args[ac], XmNwidth, 440); ac++;
-        XtSetArg(args[ac], XmNheight, 50); ac++;
-        label_about_version = XmCreateLabel(bulletinBoard_about,
-            (char *)"label_about_version",
-            args,
-            ac);
-        XtManageChild(label_about_version);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_about, (char *)"::#TimesBold14:t\"Created By:\"#TimesBold14\"David W. Caress   and   Dale N. Chayes \"",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_about, (char *)"-*-"SERIF"-bold-r-*-*-*-140-*-*-*-*-iso8859-1=TimesBold14",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 280); ac++;
-        XtSetArg(args[ac], XmNwidth, 440); ac++;
-        XtSetArg(args[ac], XmNheight, 60); ac++;
-        label_about_authors = XmCreateLabel(bulletinBoard_about,
-            (char *)"label_about_authors",
-            args,
-            ac);
-        XtManageChild(label_about_authors);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_about, (char *)"::#TimesBold12:t\"Monterey Bay\"#TimesBold12:t\"Aquarium\"#TimesBold12\"Research Institute\"",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_about, (char *)"-*-"SERIF"-bold-r-*-*-*-120-*-*-*-*-iso8859-1=TimesBold12",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 70); ac++;
-        XtSetArg(args[ac], XmNy, 340); ac++;
-        XtSetArg(args[ac], XmNwidth, 140); ac++;
-        XtSetArg(args[ac], XmNheight, 80); ac++;
-        label_about_MBARI = XmCreateLabel(bulletinBoard_about,
-            (char *)"label_about_MBARI",
-            args,
-            ac);
-        XtManageChild(label_about_MBARI);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_about, (char *)"::#TimesBold12:t\"Lamont-Doherty\"#TimesBold12:t\"Earth Observatory\"#TimesBold12\"of Columbia University\"",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_about, (char *)"-*-"SERIF"-bold-r-*-*-*-120-*-*-*-*-iso8859-1=TimesBold12",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 230); ac++;
-        XtSetArg(args[ac], XmNy, 340); ac++;
-        XtSetArg(args[ac], XmNwidth, 180); ac++;
-        XtSetArg(args[ac], XmNheight, 80); ac++;
-        label_about_LDEO = XmCreateLabel(bulletinBoard_about,
-            (char *)"label_about_LDEO",
-            args,
-            ac);
-        XtManageChild(label_about_LDEO);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 10); ac++;
-    XtSetArg(args[ac], XmNy, 260); ac++;
-    XtSetArg(args[ac], XmNwidth, 440); ac++;
-    XtSetArg(args[ac], XmNheight, 20); ac++;
-    separator3 = XmCreateSeparator(bulletinBoard_about,
-        (char *)"separator3",
-        args,
-        ac);
-    XtManageChild(separator3);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_about, (char *)"::#TimesBold14:t\"One component of the\"#TimesBold24\"MB-System\"#TimesBold14:t\"\"#TimesBold14:t\"An open Source Software Package\"#TimesBold14:t\"for Processing and Display\"#TimesBold14\"of Swath Sonar Data\"",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_about, (char *)"-*-"SERIF"-bold-r-*-*-*-140-*-*-*-*-iso8859-1=TimesBold14,-*-"SERIF"-bold-r-*-*-*-240-*-*-*-*-iso8859-1=TimesBold24",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 120); ac++;
-        XtSetArg(args[ac], XmNwidth, 440); ac++;
-        XtSetArg(args[ac], XmNheight, 140); ac++;
-        label_about_mbsystem = XmCreateLabel(bulletinBoard_about,
-            (char *)"label_about_mbsystem",
-            args,
-            ac);
-        XtManageChild(label_about_mbsystem);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 10); ac++;
-    XtSetArg(args[ac], XmNy, 100); ac++;
-    XtSetArg(args[ac], XmNwidth, 440); ac++;
-    XtSetArg(args[ac], XmNheight, 20); ac++;
-    separator1 = XmCreateSeparator(bulletinBoard_about,
-        (char *)"separator1",
-        args,
-        ac);
-    XtManageChild(separator1);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_about, (char *)"::#TimesBold24\"MBgrdviz\":t\"\"#TimesBold18:t\"Simple 3D Visualization \"#TimesBold18\"of GMT Grids\"",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_about, (char *)"-*-"SERIF"-bold-r-*-*-*-180-*-*-*-*-iso8859-1=TimesBold18,-*-"SERIF"-bold-r-*-*-*-240-*-*-*-*-iso8859-1=TimesBold24",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 10); ac++;
-        XtSetArg(args[ac], XmNwidth, 440); ac++;
-        XtSetArg(args[ac], XmNheight, 90); ac++;
-        label_about_title = XmCreateLabel(bulletinBoard_about,
-            (char *)"label_about_title",
-            args,
-            ac);
-        XtManageChild(label_about_title);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_about, (char *)"Dismiss",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 170); ac++;
-        XtSetArg(args[ac], XmNy, 470); ac++;
-        XtSetArg(args[ac], XmNwidth, 120); ac++;
-        XtSetArg(args[ac], XmNheight, 50); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_about, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_about_dismiss = XmCreatePushButton(bulletinBoard_about,
-            (char *)"pushButton_about_dismiss",
-            args,
-            ac);
-        XtManageChild(pushButton_about_dismiss);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_about_dismiss, XmNactivateCallback, BxUnmanageCB, (XtPointer)"bulletinBoard_about");
-
-    ac = 0;
-    XtSetArg(args[ac], XmNtitle, "Open GMT Grid File"); ac++;
-    XtSetArg(args[ac], XmNwidth, 334); ac++;
-    XtSetArg(args[ac], XmNheight, 505); ac++;
-    XtSetArg(args[ac], XmNdeleteResponse, XmDO_NOTHING); ac++;
-    dialogShell_open = XmCreateDialogShell(mainWindow_mbgrdviz,
-        (char *)"dialogShell_open",
-        args,
-        ac);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(dialogShell_open, (char *)"*grd",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNpattern, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNautoUnmanage, True); ac++;
-        XtSetArg(args[ac], XmNx, 0); ac++;
-        XtSetArg(args[ac], XmNy, 1084); ac++;
-        XtSetArg(args[ac], XmNwidth, 334); ac++;
-        XtSetArg(args[ac], XmNheight, 505); ac++;
-        fileSelectionBox = XtCreateWidget((char *)"fileSelectionBox",
-            xmFileSelectionBoxWidgetClass,
-            dialogShell_open,
-            args,
-            ac);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(fileSelectionBox, XmNokCallback, do_mbgrdviz_openfile, (XtPointer)0);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNwidth, 481); ac++;
-    XtSetArg(args[ac], XmNheight, 691); ac++;
-    XtSetArg(args[ac], XmNdeleteResponse, XmDO_NOTHING); ac++;
-    dialogShell_arearoute = XmCreateDialogShell(mainWindow_mbgrdviz,
-        (char *)"dialogShell_arearoute",
-        args,
-        ac);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(dialogShell_arearoute, (char *)"Generate Survey Route for Selected Area...",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNdialogTitle, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNautoUnmanage, False); ac++;
-        XtSetArg(args[ac], XmNresizePolicy, XmRESIZE_GROW); ac++;
-        XtSetArg(args[ac], XmNx, 1040); ac++;
-        XtSetArg(args[ac], XmNy, 991); ac++;
-        XtSetArg(args[ac], XmNwidth, 481); ac++;
-        XtSetArg(args[ac], XmNheight, 691); ac++;
-        bulletinBoard_arearoute = XtCreateWidget((char *)"bulletinBoard_arearoute",
-            xmBulletinBoardWidgetClass,
-            dialogShell_arearoute,
-            args,
-            ac);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_arearoute, (char *)"Interleaving:",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 480); ac++;
-        XtSetArg(args[ac], XmNwidth, 220); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_arearoute, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        label_arearoute_interleaving = XmCreateLabel(bulletinBoard_arearoute,
-            (char *)"label_arearoute_interleaving",
-            args,
-            ac);
-        XtManageChild(label_arearoute_interleaving);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNarrowLayout, XmARROWS_END); ac++;
-    XtSetArg(args[ac], XmNlayoutDirection, XmLEFT_TO_RIGHT); ac++;
-    XtSetArg(args[ac], XmNx, 10); ac++;
-    XtSetArg(args[ac], XmNy, 510); ac++;
-    XtSetArg(args[ac], XmNwidth, 230); ac++;
-    XtSetArg(args[ac], XmNheight, 50); ac++;
-    spinBox_arearoute_interleaving = XmCreateSpinBox(bulletinBoard_arearoute,
-        (char *)"spinBox_arearoute_interleaving",
-        args,
-        ac);
-    XtManageChild(spinBox_arearoute_interleaving);
-    XtAddCallback(spinBox_arearoute_interleaving, XmNvalueChangedCallback, do_mbgrdviz_arearoute_parameterchange, (XtPointer)0);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNcursorPositionVisible, False); ac++;
-    XtSetArg(args[ac], XmNvalue, "1"); ac++;
-    XtSetArg(args[ac], XmNeditable, False); ac++;
-    XtSetArg(args[ac], XmNx, 2); ac++;
-    XtSetArg(args[ac], XmNy, 5); ac++;
-    XtSetArg(args[ac], XmNwidth, 200); ac++;
-    XtSetArg(args[ac], XmNheight, 40); ac++;
-    XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(spinBox_arearoute_interleaving, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-        XmRFontList, 0, &argok)); if (argok) ac++;
-    spinText_arearoute_interleaving = XmCreateTextField(spinBox_arearoute_interleaving,
-        (char *)"spinText_arearoute_interleaving",
-        args,
-        ac);
-    XtManageChild(spinText_arearoute_interleaving);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 10); ac++;
-    XtSetArg(args[ac], XmNy, 590); ac++;
-    XtSetArg(args[ac], XmNwidth, 200); ac++;
-    XtSetArg(args[ac], XmNheight, 40); ac++;
-    XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(bulletinBoard_arearoute, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-        XmRFontList, 0, &argok)); if (argok) ac++;
-    textField_arearoute_name = XmCreateTextField(bulletinBoard_arearoute,
-        (char *)"textField_arearoute_name",
-        args,
-        ac);
-    XtManageChild(textField_arearoute_name);
-    XtAddCallback(textField_arearoute_name, XmNvalueChangedCallback, do_mbgrdviz_arearoute_parameterchange, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_arearoute, (char *)"Route Name:",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 560); ac++;
-        XtSetArg(args[ac], XmNwidth, 180); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_arearoute, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        label_arearoute_name = XmCreateLabel(bulletinBoard_arearoute,
-            (char *)"label_arearoute_name",
-            args,
-            ac);
-        XtManageChild(label_arearoute_name);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNarrowLayout, XmARROWS_END); ac++;
-    XtSetArg(args[ac], XmNlayoutDirection, XmLEFT_TO_RIGHT); ac++;
-    XtSetArg(args[ac], XmNx, 240); ac++;
-    XtSetArg(args[ac], XmNy, 590); ac++;
-    XtSetArg(args[ac], XmNwidth, 230); ac++;
-    XtSetArg(args[ac], XmNheight, 40); ac++;
-    spinBox_arearoute_color = XmCreateSpinBox(bulletinBoard_arearoute,
-        (char *)"spinBox_arearoute_color",
-        args,
-        ac);
-    XtManageChild(spinBox_arearoute_color);
-    XtAddCallback(spinBox_arearoute_color, XmNvalueChangedCallback, do_mbgrdviz_arearoute_parameterchange, (XtPointer)0);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNcursorPositionVisible, False); ac++;
-    XtSetArg(args[ac], XmNvalue, ""); ac++;
-    XtSetArg(args[ac], XmNeditable, False); ac++;
-    XtSetArg(args[ac], XmNx, 2); ac++;
-    XtSetArg(args[ac], XmNy, 0); ac++;
-    XtSetArg(args[ac], XmNwidth, 200); ac++;
-    XtSetArg(args[ac], XmNheight, 40); ac++;
-    XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(spinBox_arearoute_color, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-        XmRFontList, 0, &argok)); if (argok) ac++;
-    spinText_arearoute_color = XmCreateTextField(spinBox_arearoute_color,
-        (char *)"spinText_arearoute_color",
-        args,
-        ac);
-    XtManageChild(spinText_arearoute_color);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_arearoute, (char *)"Route Color:",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNx, 240); ac++;
-        XtSetArg(args[ac], XmNy, 560); ac++;
-        XtSetArg(args[ac], XmNwidth, 180); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_arearoute, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        label_arearoute_color = XmCreateLabel(bulletinBoard_arearoute,
-            (char *)"label_arearoute_color",
-            args,
-            ac);
-        XtManageChild(label_arearoute_color);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_arearoute, (char *)"Cross Lines:",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 320); ac++;
-        XtSetArg(args[ac], XmNwidth, 140); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_arearoute, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        label_arearoute_crosslines = XmCreateLabel(bulletinBoard_arearoute,
-            (char *)"label_arearoute_crosslines",
-            args,
-            ac);
-        XtManageChild(label_arearoute_crosslines);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 10); ac++;
-    XtSetArg(args[ac], XmNy, 350); ac++;
-    XtSetArg(args[ac], XmNwidth, 230); ac++;
-    XtSetArg(args[ac], XmNheight, 40); ac++;
-    spinBox_arearoute_crosslines = XmCreateSpinBox(bulletinBoard_arearoute,
-        (char *)"spinBox_arearoute_crosslines",
-        args,
-        ac);
-    XtManageChild(spinBox_arearoute_crosslines);
-    XtAddCallback(spinBox_arearoute_crosslines, XmNvalueChangedCallback, do_mbgrdviz_arearoute_parameterchange, (XtPointer)0);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNcursorPositionVisible, False); ac++;
-    XtSetArg(args[ac], XmNeditable, False); ac++;
-    XtSetArg(args[ac], XmNx, 2); ac++;
-    XtSetArg(args[ac], XmNy, 0); ac++;
-    XtSetArg(args[ac], XmNwidth, 200); ac++;
-    XtSetArg(args[ac], XmNheight, 40); ac++;
-    XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(spinBox_arearoute_crosslines, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-        XmRFontList, 0, &argok)); if (argok) ac++;
-    spinText_arearoute_crosslines = XmCreateTextField(spinBox_arearoute_crosslines,
-        (char *)"spinText_arearoute_crosslines",
-        args,
-        ac);
-    XtManageChild(spinText_arearoute_crosslines);
-    XtAddCallback(spinText_arearoute_crosslines, XmNvalueChangedCallback, do_mbgrdviz_arearoute_linespacing_increment, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_arearoute, (char *)"Sonar Depth (m):",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNx, 240); ac++;
-        XtSetArg(args[ac], XmNy, 480); ac++;
-        XtSetArg(args[ac], XmNwidth, 140); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_arearoute, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        label_arearoute_depth = XmCreateLabel(bulletinBoard_arearoute,
-            (char *)"label_arearoute_depth",
-            args,
-            ac);
-        XtManageChild(label_arearoute_depth);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_arearoute, (char *)"Sonar Altitude (m):",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNx, 240); ac++;
-        XtSetArg(args[ac], XmNy, 400); ac++;
-        XtSetArg(args[ac], XmNwidth, 140); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_arearoute, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        label_arearoute_altitude = XmCreateLabel(bulletinBoard_arearoute,
-            (char *)"label_arearoute_altitude",
-            args,
-            ac);
-        XtManageChild(label_arearoute_altitude);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 240); ac++;
-    XtSetArg(args[ac], XmNy, 430); ac++;
-    XtSetArg(args[ac], XmNwidth, 230); ac++;
-    XtSetArg(args[ac], XmNheight, 50); ac++;
-    spinBox_arearoute_altitude = XmCreateSpinBox(bulletinBoard_arearoute,
-        (char *)"spinBox_arearoute_altitude",
-        args,
-        ac);
-    XtManageChild(spinBox_arearoute_altitude);
-    XtAddCallback(spinBox_arearoute_altitude, XmNvalueChangedCallback, do_mbgrdviz_arearoute_parameterchange, (XtPointer)0);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNcursorPositionVisible, False); ac++;
-    XtSetArg(args[ac], XmNeditable, False); ac++;
-    XtSetArg(args[ac], XmNy, 5); ac++;
-    XtSetArg(args[ac], XmNwidth, 200); ac++;
-    XtSetArg(args[ac], XmNheight, 40); ac++;
-    XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(spinBox_arearoute_altitude, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-        XmRFontList, 0, &argok)); if (argok) ac++;
-    spinText_arearoute_altitude = XmCreateTextField(spinBox_arearoute_altitude,
-        (char *)"spinText_arearoute_altitude",
-        args,
-        ac);
-    XtManageChild(spinText_arearoute_altitude);
-    XtAddCallback(spinText_arearoute_altitude, XmNvalueChangedCallback, do_mbgrdviz_arearoute_altitude_increment, (XtPointer)0);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 240); ac++;
-    XtSetArg(args[ac], XmNy, 510); ac++;
-    XtSetArg(args[ac], XmNwidth, 230); ac++;
-    XtSetArg(args[ac], XmNheight, 50); ac++;
-    spinBox_arearoute_depth = XmCreateSpinBox(bulletinBoard_arearoute,
-        (char *)"spinBox_arearoute_depth",
-        args,
-        ac);
-    XtManageChild(spinBox_arearoute_depth);
-    XtAddCallback(spinBox_arearoute_depth, XmNvalueChangedCallback, do_mbgrdviz_arearoute_parameterchange, (XtPointer)0);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNcursorPositionVisible, False); ac++;
-    XtSetArg(args[ac], XmNeditable, False); ac++;
-    XtSetArg(args[ac], XmNx, 2); ac++;
-    XtSetArg(args[ac], XmNy, 5); ac++;
-    XtSetArg(args[ac], XmNwidth, 200); ac++;
-    XtSetArg(args[ac], XmNheight, 40); ac++;
-    XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(spinBox_arearoute_depth, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-        XmRFontList, 0, &argok)); if (argok) ac++;
-    spinText_arearoute_depth = XmCreateTextField(spinBox_arearoute_depth,
-        (char *)"spinText_arearoute_depth",
-        args,
-        ac);
-    XtManageChild(spinText_arearoute_depth);
-    XtAddCallback(spinText_arearoute_depth, XmNvalueChangedCallback, do_mbgrdviz_arearoute_depth_increment, (XtPointer)0);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNarrowLayout, XmARROWS_END); ac++;
-    XtSetArg(args[ac], XmNlayoutDirection, XmLEFT_TO_RIGHT); ac++;
-    XtSetArg(args[ac], XmNx, 10); ac++;
-    XtSetArg(args[ac], XmNy, 270); ac++;
-    XtSetArg(args[ac], XmNwidth, 230); ac++;
-    XtSetArg(args[ac], XmNheight, 40); ac++;
-    spinBox_arearoute_direction = XmCreateSpinBox(bulletinBoard_arearoute,
-        (char *)"spinBox_arearoute_direction",
-        args,
-        ac);
-    XtManageChild(spinBox_arearoute_direction);
-    XtAddCallback(spinBox_arearoute_direction, XmNvalueChangedCallback, do_mbgrdviz_arearoute_parameterchange, (XtPointer)0);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNcursorPositionVisible, False); ac++;
-    XtSetArg(args[ac], XmNvalue, ""); ac++;
-    XtSetArg(args[ac], XmNeditable, False); ac++;
-    XtSetArg(args[ac], XmNx, 2); ac++;
-    XtSetArg(args[ac], XmNy, 0); ac++;
-    XtSetArg(args[ac], XmNwidth, 200); ac++;
-    XtSetArg(args[ac], XmNheight, 40); ac++;
-    XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(spinBox_arearoute_direction, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-        XmRFontList, 0, &argok)); if (argok) ac++;
-    spinText_arearoute_direction = XmCreateTextField(spinBox_arearoute_direction,
-        (char *)"spinText_arearoute_direction",
-        args,
-        ac);
-    XtManageChild(spinText_arearoute_direction);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_arearoute, (char *)"Start Corner:",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 240); ac++;
-        XtSetArg(args[ac], XmNwidth, 180); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_arearoute, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        label_arearoute_direction = XmCreateLabel(bulletinBoard_arearoute,
-            (char *)"label_arearoute_direction",
-            args,
-            ac);
-        XtManageChild(label_arearoute_direction);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 240); ac++;
-    XtSetArg(args[ac], XmNy, 350); ac++;
-    XtSetArg(args[ac], XmNwidth, 230); ac++;
-    XtSetArg(args[ac], XmNheight, 50); ac++;
-    spinBox_arearoute_swathwidth = XmCreateSpinBox(bulletinBoard_arearoute,
-        (char *)"spinBox_arearoute_swathwidth",
-        args,
-        ac);
-    XtManageChild(spinBox_arearoute_swathwidth);
-    XtAddCallback(spinBox_arearoute_swathwidth, XmNvalueChangedCallback, do_mbgrdviz_arearoute_parameterchange, (XtPointer)0);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNcursorPositionVisible, False); ac++;
-    XtSetArg(args[ac], XmNeditable, False); ac++;
-    XtSetArg(args[ac], XmNy, 5); ac++;
-    XtSetArg(args[ac], XmNwidth, 200); ac++;
-    XtSetArg(args[ac], XmNheight, 40); ac++;
-    XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(spinBox_arearoute_swathwidth, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-        XmRFontList, 0, &argok)); if (argok) ac++;
-    spinText_arearoute_swathwidth = XmCreateTextField(spinBox_arearoute_swathwidth,
-        (char *)"spinText_arearoute_swathwidth",
-        args,
-        ac);
-    XtManageChild(spinText_arearoute_swathwidth);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_arearoute, (char *)"Swath Width (degrees):",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNmappedWhenManaged, True); ac++;
-        XtSetArg(args[ac], XmNx, 240); ac++;
-        XtSetArg(args[ac], XmNy, 320); ac++;
-        XtSetArg(args[ac], XmNwidth, 200); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_arearoute, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        label_arearoute_swathwidth = XmCreateLabel(bulletinBoard_arearoute,
-            (char *)"label_arearoute_swathwidth",
-            args,
-            ac);
-        XtManageChild(label_arearoute_swathwidth);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_arearoute, (char *)"Platform Type:",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNx, 240); ac++;
-        XtSetArg(args[ac], XmNy, 240); ac++;
-        XtSetArg(args[ac], XmNwidth, 180); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_arearoute, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        label_arearoute_platform = XmCreateLabel(bulletinBoard_arearoute,
-            (char *)"label_arearoute_platform",
-            args,
-            ac);
-        XtManageChild(label_arearoute_platform);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNarrowLayout, XmARROWS_END); ac++;
-    XtSetArg(args[ac], XmNlayoutDirection, XmLEFT_TO_RIGHT); ac++;
-    XtSetArg(args[ac], XmNx, 240); ac++;
-    XtSetArg(args[ac], XmNy, 270); ac++;
-    XtSetArg(args[ac], XmNwidth, 230); ac++;
-    XtSetArg(args[ac], XmNheight, 50); ac++;
-    spinBox_arearoute_platform = XmCreateSpinBox(bulletinBoard_arearoute,
-        (char *)"spinBox_arearoute_platform",
-        args,
-        ac);
-    XtManageChild(spinBox_arearoute_platform);
-    XtAddCallback(spinBox_arearoute_platform, XmNvalueChangedCallback, do_mbgrdviz_arearoute_parameterchange, (XtPointer)0);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNcursorPositionVisible, False); ac++;
-    XtSetArg(args[ac], XmNvalue, ""); ac++;
-    XtSetArg(args[ac], XmNeditable, False); ac++;
-    XtSetArg(args[ac], XmNx, 2); ac++;
-    XtSetArg(args[ac], XmNy, 5); ac++;
-    XtSetArg(args[ac], XmNwidth, 200); ac++;
-    XtSetArg(args[ac], XmNheight, 40); ac++;
-    XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(spinBox_arearoute_platform, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-        XmRFontList, 0, &argok)); if (argok) ac++;
-    spinText_arearoute_platform = XmCreateTextField(spinBox_arearoute_platform,
-        (char *)"spinText_arearoute_platform",
-        args,
-        ac);
-    XtManageChild(spinText_arearoute_platform);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 240); ac++;
-    XtSetArg(args[ac], XmNy, 190); ac++;
-    XtSetArg(args[ac], XmNwidth, 230); ac++;
-    XtSetArg(args[ac], XmNheight, 50); ac++;
-    spinBox_arearoute_linespacing = XmCreateSpinBox(bulletinBoard_arearoute,
-        (char *)"spinBox_arearoute_linespacing",
-        args,
-        ac);
-    XtManageChild(spinBox_arearoute_linespacing);
-    XtAddCallback(spinBox_arearoute_linespacing, XmNvalueChangedCallback, do_mbgrdviz_arearoute_parameterchange, (XtPointer)0);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNcursorPositionVisible, False); ac++;
-    XtSetArg(args[ac], XmNeditable, False); ac++;
-    XtSetArg(args[ac], XmNx, 2); ac++;
-    XtSetArg(args[ac], XmNy, 5); ac++;
-    XtSetArg(args[ac], XmNwidth, 200); ac++;
-    XtSetArg(args[ac], XmNheight, 40); ac++;
-    XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(spinBox_arearoute_linespacing, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-        XmRFontList, 0, &argok)); if (argok) ac++;
-    spinText_arearoute_linespacing = XmCreateTextField(spinBox_arearoute_linespacing,
-        (char *)"spinText_arearoute_linespacing",
-        args,
-        ac);
-    XtManageChild(spinText_arearoute_linespacing);
-    XtAddCallback(spinText_arearoute_linespacing, XmNvalueChangedCallback, do_mbgrdviz_arearoute_linespacing_increment, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_arearoute, (char *)"Crosslines Before/After Survey:",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 400); ac++;
-        XtSetArg(args[ac], XmNwidth, 220); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_arearoute, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        label_arearoute_crosslinesfirstlast = XmCreateLabel(bulletinBoard_arearoute,
-            (char *)"label_arearoute_crosslinesfirstlast",
-            args,
-            ac);
-        XtManageChild(label_arearoute_crosslinesfirstlast);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNarrowLayout, XmARROWS_END); ac++;
-    XtSetArg(args[ac], XmNlayoutDirection, XmLEFT_TO_RIGHT); ac++;
-    XtSetArg(args[ac], XmNx, 10); ac++;
-    XtSetArg(args[ac], XmNy, 430); ac++;
-    XtSetArg(args[ac], XmNwidth, 230); ac++;
-    XtSetArg(args[ac], XmNheight, 50); ac++;
-    spinBox_arearoute_crosslinesfirstlast = XmCreateSpinBox(bulletinBoard_arearoute,
-        (char *)"spinBox_arearoute_crosslinesfirstlast",
-        args,
-        ac);
-    XtManageChild(spinBox_arearoute_crosslinesfirstlast);
-    XtAddCallback(spinBox_arearoute_crosslinesfirstlast, XmNvalueChangedCallback, do_mbgrdviz_arearoute_parameterchange, (XtPointer)0);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNcursorPositionVisible, False); ac++;
-    XtSetArg(args[ac], XmNvalue, "1"); ac++;
-    XtSetArg(args[ac], XmNeditable, False); ac++;
-    XtSetArg(args[ac], XmNx, 2); ac++;
-    XtSetArg(args[ac], XmNy, 5); ac++;
-    XtSetArg(args[ac], XmNwidth, 200); ac++;
-    XtSetArg(args[ac], XmNheight, 40); ac++;
-    XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(spinBox_arearoute_crosslinesfirstlast, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-        XmRFontList, 0, &argok)); if (argok) ac++;
-    spinText_arearoute_crosslinesfirstlast = XmCreateTextField(spinBox_arearoute_crosslinesfirstlast,
-        (char *)"spinText_arearoute_crosslinesfirstlast",
-        args,
-        ac);
-    XtManageChild(spinText_arearoute_crosslinesfirstlast);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_arearoute, (char *)"Current Area Info:",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNborderWidth, 2); ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNbackground,
-            BX_CONVERT(bulletinBoard_arearoute, (char *)"White",
-            XmRPixel, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 10); ac++;
-        XtSetArg(args[ac], XmNwidth, 440); ac++;
-        XtSetArg(args[ac], XmNheight, 140); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_arearoute, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        label_arearoute_info = XmCreateLabel(bulletinBoard_arearoute,
-            (char *)"label_arearoute_info",
-            args,
-            ac);
-        XtManageChild(label_arearoute_info);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNarrowLayout, XmARROWS_END); ac++;
-    XtSetArg(args[ac], XmNlayoutDirection, XmLEFT_TO_RIGHT); ac++;
-    XtSetArg(args[ac], XmNx, 10); ac++;
-    XtSetArg(args[ac], XmNy, 190); ac++;
-    XtSetArg(args[ac], XmNwidth, 230); ac++;
-    XtSetArg(args[ac], XmNheight, 50); ac++;
-    spinBox_arearoute_linecontrol = XmCreateSpinBox(bulletinBoard_arearoute,
-        (char *)"spinBox_arearoute_linecontrol",
-        args,
-        ac);
-    XtManageChild(spinBox_arearoute_linecontrol);
-    XtAddCallback(spinBox_arearoute_linecontrol, XmNvalueChangedCallback, do_mbgrdviz_arearoute_parameterchange, (XtPointer)0);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNcursorPositionVisible, False); ac++;
-    XtSetArg(args[ac], XmNvalue, ""); ac++;
-    XtSetArg(args[ac], XmNeditable, False); ac++;
-    XtSetArg(args[ac], XmNx, 2); ac++;
-    XtSetArg(args[ac], XmNy, 5); ac++;
-    XtSetArg(args[ac], XmNwidth, 200); ac++;
-    XtSetArg(args[ac], XmNheight, 40); ac++;
-    XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(spinBox_arearoute_linecontrol, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-        XmRFontList, 0, &argok)); if (argok) ac++;
-    spinText_arearoute_linecontrol = XmCreateTextField(spinBox_arearoute_linecontrol,
-        (char *)"spinText_arearoute_linecontrol",
-        args,
-        ac);
-    XtManageChild(spinText_arearoute_linecontrol);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_arearoute, (char *)"Line Spacing Mode:",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 160); ac++;
-        XtSetArg(args[ac], XmNwidth, 180); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_arearoute, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        label_arearoute_linecontrol = XmCreateLabel(bulletinBoard_arearoute,
-            (char *)"label_arearoute_linecontrol",
-            args,
-            ac);
-        XtManageChild(label_arearoute_linecontrol);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_arearoute, (char *)"Line Spacing (m):",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNx, 240); ac++;
-        XtSetArg(args[ac], XmNy, 160); ac++;
-        XtSetArg(args[ac], XmNwidth, 140); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_arearoute, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        label_arearoute_linespacing = XmCreateLabel(bulletinBoard_arearoute,
-            (char *)"label_arearoute_linespacing",
-            args,
-            ac);
-        XtManageChild(label_arearoute_linespacing);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_arearoute, (char *)"Generate Route",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 90); ac++;
-        XtSetArg(args[ac], XmNy, 640); ac++;
-        XtSetArg(args[ac], XmNwidth, 120); ac++;
-        XtSetArg(args[ac], XmNheight, 40); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_arearoute, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_arearoute_ok = XmCreatePushButton(bulletinBoard_arearoute,
-            (char *)"pushButton_arearoute_ok",
-            args,
-            ac);
-        XtManageChild(pushButton_arearoute_ok);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_arearoute_ok, XmNactivateCallback, do_mbgrdviz_generate_survey, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_arearoute, (char *)"Dismiss",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 270); ac++;
-        XtSetArg(args[ac], XmNy, 640); ac++;
-        XtSetArg(args[ac], XmNwidth, 120); ac++;
-        XtSetArg(args[ac], XmNheight, 40); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_arearoute, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_arearoute_dismiss = XmCreatePushButton(bulletinBoard_arearoute,
-            (char *)"pushButton_arearoute_dismiss",
-            args,
-            ac);
-        XtManageChild(pushButton_arearoute_dismiss);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_arearoute_dismiss, XmNactivateCallback, BxUnmanageCB, (XtPointer)"bulletinBoard_arearoute");
-    XtAddCallback(pushButton_arearoute_dismiss, XmNactivateCallback, do_mbgrdviz_arearoute_dismiss, (XtPointer)0);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNtitle, "Realtime Setup"); ac++;
-    XtSetArg(args[ac], XmNwidth, 497); ac++;
-    XtSetArg(args[ac], XmNheight, 540); ac++;
-    XtSetArg(args[ac], XmNdeleteResponse, XmDO_NOTHING); ac++;
-    dialogShell_realtimesetup = XmCreateDialogShell(mainWindow_mbgrdviz,
-        (char *)"dialogShell_realtimesetup",
-        args,
-        ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNautoUnmanage, False); ac++;
-    XtSetArg(args[ac], XmNresizePolicy, XmRESIZE_GROW); ac++;
-    XtSetArg(args[ac], XmNx, 1032); ac++;
-    XtSetArg(args[ac], XmNy, 1067); ac++;
-    XtSetArg(args[ac], XmNwidth, 497); ac++;
-    XtSetArg(args[ac], XmNheight, 540); ac++;
-    form_realtime_setup = XtCreateWidget((char *)"form_realtime_setup",
-        xmFormWidgetClass,
-        dialogShell_realtimesetup,
-        args,
-        ac);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(form_realtime_setup, (char *)":::t\"Test Status: No realtime data available\"\"Path: Unknown\"",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 162); ac++;
-        XtSetArg(args[ac], XmNwidth, 480); ac++;
-        XtSetArg(args[ac], XmNheight, 60); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(form_realtime_setup, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        label_realtimesetup_teststatus = XmCreateLabel(form_realtime_setup,
-            (char *)"label_realtimesetup_teststatus",
-            args,
-            ac);
-        XtManageChild(label_realtimesetup_teststatus);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 210); ac++;
-    XtSetArg(args[ac], XmNy, 92); ac++;
-    XtSetArg(args[ac], XmNwidth, 237); ac++;
-    XtSetArg(args[ac], XmNheight, 65); ac++;
-    XtSetArg(args[ac], XmNisHomogeneous, False); ac++;
-    radioBox_realtimesetup_pathmode = XmCreateRadioBox(form_realtime_setup,
-        (char *)"radioBox_realtimesetup_pathmode",
-        args,
-        ac);
-    XtManageChild(radioBox_realtimesetup_pathmode);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(radioBox_realtimesetup_pathmode, (char *)"Most Recent File in Directory",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNwidth, 231); ac++;
-        XtSetArg(args[ac], XmNheight, 28); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(radioBox_realtimesetup_pathmode, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        toggleButton_realtimesetup_recent = XmCreateToggleButton(radioBox_realtimesetup_pathmode,
-            (char *)"toggleButton_realtimesetup_recent",
-            args,
-            ac);
-        XtManageChild(toggleButton_realtimesetup_recent);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(toggleButton_realtimesetup_recent, XmNvalueChangedCallback, do_mbgrdviz_realtimesetup_pathmode, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(radioBox_realtimesetup_pathmode, (char *)"Use Pointer File",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNwidth, 231); ac++;
-        XtSetArg(args[ac], XmNheight, 28); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(radioBox_realtimesetup_pathmode, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        toggleButton_realtimesetup_pointer = XmCreateToggleButton(radioBox_realtimesetup_pathmode,
-            (char *)"toggleButton_realtimesetup_pointer",
-            args,
-            ac);
-        XtManageChild(toggleButton_realtimesetup_pointer);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, -700); ac++;
-    XtSetArg(args[ac], XmNy, -200); ac++;
-    XtSetArg(args[ac], XmNwidth, 100); ac++;
-    XtSetArg(args[ac], XmNheight, 30); ac++;
-    toggleButton = XmCreateToggleButton(form_realtime_setup,
-        (char *)"toggleButton",
-        args,
-        ac);
-    XtManageChild(toggleButton);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(form_realtime_setup, (char *)"Dismiss",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 200); ac++;
-        XtSetArg(args[ac], XmNy, 471); ac++;
-        XtSetArg(args[ac], XmNwidth, 100); ac++;
-        XtSetArg(args[ac], XmNheight, 52); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(form_realtime_setup, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_realtimesetup_dismiss = XmCreatePushButton(form_realtime_setup,
-            (char *)"pushButton_realtimesetup_dismiss",
-            args,
-            ac);
-        XtManageChild(pushButton_realtimesetup_dismiss);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_realtimesetup_dismiss, XmNactivateCallback, BxUnmanageCB, (XtPointer)"form_realtime_setup");
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 10); ac++;
-    XtSetArg(args[ac], XmNy, 442); ac++;
-    XtSetArg(args[ac], XmNwidth, 476); ac++;
-    XtSetArg(args[ac], XmNheight, 20); ac++;
-    separator6 = XmCreateSeparator(form_realtime_setup,
-        (char *)"separator6",
-        args,
-        ac);
-    XtManageChild(separator6);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 10); ac++;
-    XtSetArg(args[ac], XmNy, 392); ac++;
-    XtSetArg(args[ac], XmNwidth, 480); ac++;
-    XtSetArg(args[ac], XmNheight, 50); ac++;
-    spinBox_realtimesetup_icon = XmCreateSpinBox(form_realtime_setup,
-        (char *)"spinBox_realtimesetup_icon",
-        args,
-        ac);
-    XtManageChild(spinBox_realtimesetup_icon);
-    XtAddCallback(spinBox_realtimesetup_icon, XmNvalueChangedCallback, do_mbgrdviz_realtimesetup_icon, (XtPointer)0);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNeditable, False); ac++;
-    XtSetArg(args[ac], XmNx, 2); ac++;
-    XtSetArg(args[ac], XmNy, 5); ac++;
-    XtSetArg(args[ac], XmNwidth, 410); ac++;
-    XtSetArg(args[ac], XmNheight, 40); ac++;
-    XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(spinBox_realtimesetup_icon, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-        XmRFontList, 0, &argok)); if (argok) ac++;
-    spinText_realtimesetup_icon = XmCreateTextField(spinBox_realtimesetup_icon,
-        (char *)"spinText_realtimesetup_icon",
-        args,
-        ac);
-    XtManageChild(spinText_realtimesetup_icon);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(form_realtime_setup, (char *)"Realtime Display Icon:",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 362); ac++;
-        XtSetArg(args[ac], XmNwidth, 480); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(form_realtime_setup, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        label_realtime_setup_icon = XmCreateLabel(form_realtime_setup,
-            (char *)"label_realtime_setup_icon",
-            args,
-            ac);
-        XtManageChild(label_realtime_setup_icon);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(form_realtime_setup, (char *)"Browse",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 100); ac++;
-        XtSetArg(args[ac], XmNwidth, 92); ac++;
-        XtSetArg(args[ac], XmNheight, 52); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(form_realtime_setup, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_realtimesetup_pathbrowse = XmCreatePushButton(form_realtime_setup,
-            (char *)"pushButton_realtimesetup_pathbrowse",
-            args,
-            ac);
-        XtManageChild(pushButton_realtimesetup_pathbrowse);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_realtimesetup_pathbrowse, XmNactivateCallback, do_mbgrdviz_realtimesetup_path_browse, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(form_realtime_setup, (char *)"Test",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 110); ac++;
-        XtSetArg(args[ac], XmNy, 100); ac++;
-        XtSetArg(args[ac], XmNwidth, 92); ac++;
-        XtSetArg(args[ac], XmNheight, 52); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(form_realtime_setup, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_realtimesetup_pathtest = XmCreatePushButton(form_realtime_setup,
-            (char *)"pushButton_realtimesetup_pathtest",
-            args,
-            ac);
-        XtManageChild(pushButton_realtimesetup_pathtest);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_realtimesetup_pathtest, XmNactivateCallback, do_mbgrdviz_realtimesetup_path_test, (XtPointer)0);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 10); ac++;
-    XtSetArg(args[ac], XmNy, 342); ac++;
-    XtSetArg(args[ac], XmNwidth, 476); ac++;
-    XtSetArg(args[ac], XmNheight, 20); ac++;
-    separator5 = XmCreateSeparator(form_realtime_setup,
-        (char *)"separator5",
-        args,
-        ac);
-    XtManageChild(separator5);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(form_realtime_setup, (char *)"Data read before update",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNtitleString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNvalue, 1); ac++;
-        XtSetArg(args[ac], XmNmaximum, 25); ac++;
-        XtSetArg(args[ac], XmNshowArrows, TRUE); ac++;
-        XtSetArg(args[ac], XmNshowValue, TRUE); ac++;
-        XtSetArg(args[ac], XmNorientation, XmHORIZONTAL); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 272); ac++;
-        XtSetArg(args[ac], XmNwidth, 476); ac++;
-        XtSetArg(args[ac], XmNheight, 63); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(form_realtime_setup, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        scale_realtimesetup_update = XmCreateScale(form_realtime_setup,
-            (char *)"scale_realtimesetup_update",
-            args,
-            ac);
-        XtManageChild(scale_realtimesetup_update);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(scale_realtimesetup_update, XmNvalueChangedCallback, do_mbgrdviz_realtimesetup_updaterate, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(form_realtime_setup, (char *)"Display Update Rate:",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_CENTER); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 242); ac++;
-        XtSetArg(args[ac], XmNwidth, 476); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(form_realtime_setup, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        label_realtimesetup_update = XmCreateLabel(form_realtime_setup,
-            (char *)"label_realtimesetup_update",
-            args,
-            ac);
-        XtManageChild(label_realtimesetup_update);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 10); ac++;
-    XtSetArg(args[ac], XmNy, 222); ac++;
-    XtSetArg(args[ac], XmNwidth, 476); ac++;
-    XtSetArg(args[ac], XmNheight, 20); ac++;
-    separator4 = XmCreateSeparator(form_realtime_setup,
-        (char *)"separator4",
-        args,
-        ac);
-    XtManageChild(separator4);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 10); ac++;
-    XtSetArg(args[ac], XmNy, 50); ac++;
-    XtSetArg(args[ac], XmNwidth, 476); ac++;
-    XtSetArg(args[ac], XmNheight, 40); ac++;
-    XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(form_realtime_setup, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-        XmRFontList, 0, &argok)); if (argok) ac++;
-    textField_realtimesetup_path = XmCreateTextField(form_realtime_setup,
-        (char *)"textField_realtimesetup_path",
-        args,
-        ac);
-    XtManageChild(textField_realtimesetup_path);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(form_realtime_setup, (char *)"Realtime Nav Source Path:",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_CENTER); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 10); ac++;
-        XtSetArg(args[ac], XmNwidth, 471); ac++;
-        XtSetArg(args[ac], XmNheight, 40); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(form_realtime_setup, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        label_realtimesetup_path = XmCreateLabel(form_realtime_setup,
-            (char *)"label_realtimesetup_path",
-            args,
-            ac);
-        XtManageChild(label_realtimesetup_path);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    ac = 0;
-    XtSetArg(args[ac], XmNtopAttachment, XmATTACH_WIDGET); ac++;
-    XtSetArg(args[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNbottomAttachment, XmATTACH_NONE); ac++;
-    XtSetArg(args[ac], XmNbottomOffset, 0); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 10); ac++;
-    XtSetArg(args[ac], XmNrightOffset, 7); ac++;
-    XtSetArg(args[ac], XmNtopOffset, 72); ac++;
-    XtSetArg(args[ac], XmNtopWidget, textField_realtimesetup_path); ac++;
-    XtSetValues(label_realtimesetup_teststatus, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNtopAttachment, XmATTACH_WIDGET); ac++;
-    XtSetArg(args[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_WIDGET); ac++;
-    XtSetArg(args[ac], XmNbottomAttachment, XmATTACH_NONE); ac++;
-    XtSetArg(args[ac], XmNbottomOffset, 0); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 8); ac++;
-    XtSetArg(args[ac], XmNrightOffset, 50); ac++;
-    XtSetArg(args[ac], XmNtopOffset, 2); ac++;
-    XtSetArg(args[ac], XmNleftWidget, pushButton_realtimesetup_pathtest); ac++;
-    XtSetArg(args[ac], XmNtopWidget, textField_realtimesetup_path); ac++;
-    XtSetValues(radioBox_realtimesetup_pathmode, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNtopAttachment, XmATTACH_WIDGET); ac++;
-    XtSetArg(args[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNbottomAttachment, XmATTACH_NONE); ac++;
-    XtSetArg(args[ac], XmNbottomOffset, 0); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 200); ac++;
-    XtSetArg(args[ac], XmNrightOffset, 197); ac++;
-    XtSetArg(args[ac], XmNtopOffset, 9); ac++;
-    XtSetArg(args[ac], XmNtopWidget, separator6); ac++;
-    XtSetValues(pushButton_realtimesetup_dismiss, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNtopAttachment, XmATTACH_WIDGET); ac++;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNbottomAttachment, XmATTACH_NONE); ac++;
-    XtSetArg(args[ac], XmNbottomOffset, 0); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 10); ac++;
-    XtSetArg(args[ac], XmNtopOffset, 0); ac++;
-    XtSetArg(args[ac], XmNtopWidget, spinBox_realtimesetup_icon); ac++;
-    XtSetValues(separator6, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNtopAttachment, XmATTACH_WIDGET); ac++;
-    XtSetArg(args[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNbottomAttachment, XmATTACH_NONE); ac++;
-    XtSetArg(args[ac], XmNbottomOffset, 0); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 10); ac++;
-    XtSetArg(args[ac], XmNrightOffset, 7); ac++;
-    XtSetArg(args[ac], XmNtopOffset, 0); ac++;
-    XtSetArg(args[ac], XmNtopWidget, label_realtime_setup_icon); ac++;
-    XtSetValues(spinBox_realtimesetup_icon, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNtopAttachment, XmATTACH_WIDGET); ac++;
-    XtSetArg(args[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNbottomAttachment, XmATTACH_NONE); ac++;
-    XtSetArg(args[ac], XmNbottomOffset, 0); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 10); ac++;
-    XtSetArg(args[ac], XmNrightOffset, 7); ac++;
-    XtSetArg(args[ac], XmNtopOffset, 0); ac++;
-    XtSetArg(args[ac], XmNtopWidget, separator5); ac++;
-    XtSetValues(label_realtime_setup_icon, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNtopAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNrightAttachment, XmATTACH_NONE); ac++;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNbottomAttachment, XmATTACH_NONE); ac++;
-    XtSetArg(args[ac], XmNbottomOffset, 0); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 10); ac++;
-    XtSetArg(args[ac], XmNrightOffset, 0); ac++;
-    XtSetArg(args[ac], XmNtopOffset, 100); ac++;
-    XtSetValues(pushButton_realtimesetup_pathbrowse, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNtopAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNrightAttachment, XmATTACH_NONE); ac++;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_WIDGET); ac++;
-    XtSetArg(args[ac], XmNbottomAttachment, XmATTACH_NONE); ac++;
-    XtSetArg(args[ac], XmNbottomOffset, 0); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 8); ac++;
-    XtSetArg(args[ac], XmNrightOffset, 0); ac++;
-    XtSetArg(args[ac], XmNtopOffset, 100); ac++;
-    XtSetArg(args[ac], XmNleftWidget, pushButton_realtimesetup_pathbrowse); ac++;
-    XtSetValues(pushButton_realtimesetup_pathtest, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNtopAttachment, XmATTACH_WIDGET); ac++;
-    XtSetArg(args[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNbottomAttachment, XmATTACH_NONE); ac++;
-    XtSetArg(args[ac], XmNbottomOffset, 0); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 10); ac++;
-    XtSetArg(args[ac], XmNrightOffset, 11); ac++;
-    XtSetArg(args[ac], XmNtopOffset, 7); ac++;
-    XtSetArg(args[ac], XmNtopWidget, scale_realtimesetup_update); ac++;
-    XtSetValues(separator5, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNtopAttachment, XmATTACH_WIDGET); ac++;
-    XtSetArg(args[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNbottomAttachment, XmATTACH_NONE); ac++;
-    XtSetArg(args[ac], XmNbottomOffset, 0); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 10); ac++;
-    XtSetArg(args[ac], XmNrightOffset, 11); ac++;
-    XtSetArg(args[ac], XmNtopOffset, 0); ac++;
-    XtSetArg(args[ac], XmNtopWidget, label_realtimesetup_update); ac++;
-    XtSetValues(scale_realtimesetup_update, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNtopAttachment, XmATTACH_WIDGET); ac++;
-    XtSetArg(args[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNbottomAttachment, XmATTACH_NONE); ac++;
-    XtSetArg(args[ac], XmNbottomOffset, 0); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 10); ac++;
-    XtSetArg(args[ac], XmNrightOffset, 11); ac++;
-    XtSetArg(args[ac], XmNtopOffset, 0); ac++;
-    XtSetArg(args[ac], XmNtopWidget, separator4); ac++;
-    XtSetValues(label_realtimesetup_update, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNtopAttachment, XmATTACH_WIDGET); ac++;
-    XtSetArg(args[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNbottomAttachment, XmATTACH_NONE); ac++;
-    XtSetArg(args[ac], XmNbottomOffset, 0); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 10); ac++;
-    XtSetArg(args[ac], XmNrightOffset, 11); ac++;
-    XtSetArg(args[ac], XmNtopOffset, 0); ac++;
-    XtSetArg(args[ac], XmNtopWidget, label_realtimesetup_teststatus); ac++;
-    XtSetValues(separator4, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNtopAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNbottomAttachment, XmATTACH_NONE); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 10); ac++;
-    XtSetArg(args[ac], XmNrightOffset, 11); ac++;
-    XtSetArg(args[ac], XmNtopOffset, 50); ac++;
-    XtSetValues(textField_realtimesetup_path, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 10); ac++;
-    XtSetArg(args[ac], XmNrightOffset, 16); ac++;
-    XtSetArg(args[ac], XmNtopOffset, 10); ac++;
-    XtSetValues(label_realtimesetup_path, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNposition, 1); ac++;
-    XtSetArg(args[ac], XmNminimumValue, 1); ac++;
-    XtSetArg(args[ac], XmNspinBoxChildType, XmNUMERIC); ac++;
-    XtSetArg(args[ac], XmNnumValues, 0); ac++;
-    XtSetArg(args[ac], XmNpositionType, XmPOSITION_VALUE); ac++;
-    XtSetValues(spinText_arearoute_interleaving, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNnumValues, 0); ac++;
-    XtSetArg(args[ac], XmNpositionType, XmPOSITION_VALUE); ac++;
-    XtSetValues(spinText_arearoute_color, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNposition, 0); ac++;
-    XtSetArg(args[ac], XmNminimumValue, 0); ac++;
-    XtSetArg(args[ac], XmNmaximumValue, 50); ac++;
-    XtSetArg(args[ac], XmNspinBoxChildType, XmNUMERIC); ac++;
-    XtSetValues(spinText_arearoute_crosslines, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNposition, 200); ac++;
-    XtSetArg(args[ac], XmNminimumValue, 1); ac++;
-    XtSetArg(args[ac], XmNmaximumValue, 10000); ac++;
-    XtSetArg(args[ac], XmNspinBoxChildType, XmNUMERIC); ac++;
-    XtSetValues(spinText_arearoute_altitude, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNposition, 200); ac++;
-    XtSetArg(args[ac], XmNminimumValue, 1); ac++;
-    XtSetArg(args[ac], XmNmaximumValue, 10000); ac++;
-    XtSetArg(args[ac], XmNspinBoxChildType, XmNUMERIC); ac++;
-    XtSetValues(spinText_arearoute_depth, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNnumValues, 0); ac++;
-    XtSetArg(args[ac], XmNpositionType, XmPOSITION_VALUE); ac++;
-    XtSetValues(spinText_arearoute_direction, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNincrementValue, 5); ac++;
-    XtSetArg(args[ac], XmNposition, 120); ac++;
-    XtSetArg(args[ac], XmNminimumValue, 5); ac++;
-    XtSetArg(args[ac], XmNmaximumValue, 175); ac++;
-    XtSetArg(args[ac], XmNspinBoxChildType, XmNUMERIC); ac++;
-    XtSetValues(spinText_arearoute_swathwidth, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNnumValues, 0); ac++;
-    XtSetArg(args[ac], XmNpositionType, XmPOSITION_VALUE); ac++;
-    XtSetValues(spinText_arearoute_platform, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNposition, 200); ac++;
-    XtSetArg(args[ac], XmNminimumValue, 1); ac++;
-    XtSetArg(args[ac], XmNmaximumValue, 10000); ac++;
-    XtSetArg(args[ac], XmNspinBoxChildType, XmNUMERIC); ac++;
-    XtSetValues(spinText_arearoute_linespacing, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNnumValues, 0); ac++;
-    XtSetArg(args[ac], XmNpositionType, XmPOSITION_VALUE); ac++;
-    XtSetValues(spinText_arearoute_crosslinesfirstlast, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNnumValues, 0); ac++;
-    XtSetArg(args[ac], XmNpositionType, XmPOSITION_VALUE); ac++;
-    XtSetValues(spinText_arearoute_linecontrol, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNmenuHelpWidget, cascadeButton_help); ac++;
-    XtSetValues(menuBar_mbgrdviz, args, ac);
-
-    /* Begin user code block <end_CreatemainWindow_mbgrdviz> */
-    /* End user code block <end_CreatemainWindow_mbgrdviz> */
-    return( mainWindow_mbgrdviz );
-}
diff --git a/src/mbgrdviz/mbgrdviz_creation.h b/src/mbgrdviz/mbgrdviz_creation.h
deleted file mode 100644
index 89bd4a7..0000000
--- a/src/mbgrdviz/mbgrdviz_creation.h
+++ /dev/null
@@ -1,92 +0,0 @@
-
-/* Begin user code block <abstract> */
-/* End user code block <abstract> */
-
-/**
- * WARNING: This file is overwritten at code generation time.
- * Any changes to this file will be lost.
- */
-/*
- *
- * Created by BuilderXcessory Version 6.1.3
- * Generated by Code Generator Xcessory 6.1.3 (08/19/04) CGX Scripts 6.1 Motif 2.1 
- *
- */
-#ifndef mbgrdviz_creation_H
-#define mbgrdviz_creation_H
-
-/*
- * Global widget declarations.
- *        - EXTERNAL is set to extern if the
- *          defs file is not included from the
- *          main file.
- */
-#ifdef DECLARE_BX_GLOBALS
-#define EXTERNAL
-#else
-#define EXTERNAL extern
-#endif
-
-/**
- * Start Global Widget Declarations.
- */
-EXTERNAL Widget   label_realtimesetup_teststatus;
-EXTERNAL Widget   radioBox_realtimesetup_pathmode;
-EXTERNAL Widget   toggleButton_realtimesetup_recent;
-EXTERNAL Widget   toggleButton_realtimesetup_pointer;
-EXTERNAL Widget   spinText_realtimesetup_icon;
-EXTERNAL Widget   pushButton_realtimesetup_pathbrowse;
-EXTERNAL Widget   pushButton_realtimesetup_pathtest;
-EXTERNAL Widget   scale_realtimesetup_update;
-EXTERNAL Widget   textField_realtimesetup_path;
-EXTERNAL Widget   bulletinBoard_arearoute;
-EXTERNAL Widget   spinBox_arearoute_interleaving;
-EXTERNAL Widget   spinText_arearoute_interleaving;
-EXTERNAL Widget   textField_arearoute_name;
-EXTERNAL Widget   spinBox_arearoute_color;
-EXTERNAL Widget   spinText_arearoute_color;
-EXTERNAL Widget   spinBox_arearoute_crosslines;
-EXTERNAL Widget   spinText_arearoute_crosslines;
-EXTERNAL Widget   label_arearoute_depth;
-EXTERNAL Widget   label_arearoute_altitude;
-EXTERNAL Widget   spinBox_arearoute_altitude;
-EXTERNAL Widget   spinText_arearoute_altitude;
-EXTERNAL Widget   spinBox_arearoute_depth;
-EXTERNAL Widget   spinText_arearoute_depth;
-EXTERNAL Widget   spinBox_arearoute_direction;
-EXTERNAL Widget   spinText_arearoute_direction;
-EXTERNAL Widget   spinBox_arearoute_swathwidth;
-EXTERNAL Widget   spinText_arearoute_swathwidth;
-EXTERNAL Widget   label_arearoute_swathwidth;
-EXTERNAL Widget   label_arearoute_platform;
-EXTERNAL Widget   spinBox_arearoute_platform;
-EXTERNAL Widget   spinText_arearoute_platform;
-EXTERNAL Widget   spinBox_arearoute_linespacing;
-EXTERNAL Widget   spinText_arearoute_linespacing;
-EXTERNAL Widget   spinBox_arearoute_crosslinesfirstlast;
-EXTERNAL Widget   spinText_arearoute_crosslinesfirstlast;
-EXTERNAL Widget   label_arearoute_info;
-EXTERNAL Widget   spinBox_arearoute_linecontrol;
-EXTERNAL Widget   spinText_arearoute_linecontrol;
-EXTERNAL Widget   label_arearoute_linespacing;
-EXTERNAL Widget   pushButton_arearoute_ok;
-EXTERNAL Widget   dialogShell_open;
-EXTERNAL Widget   fileSelectionBox;
-EXTERNAL Widget   label_about_version;
-EXTERNAL Widget   pushButton_file_openprimary;
-EXTERNAL Widget   pushButton_opensite;
-EXTERNAL Widget   pushButton_openroute;
-EXTERNAL Widget   pushButton_opennav;
-EXTERNAL Widget   pushButton_openswath;
-EXTERNAL Widget   pushButton_openvector;
-EXTERNAL Widget   pushButton_savesite;
-EXTERNAL Widget   pushButton_saveroute;
-EXTERNAL Widget   pushButton_realtime_setup;
-EXTERNAL Widget   pushButton_realtime_start;
-EXTERNAL Widget   pushButton_realtime_stop;
-EXTERNAL Widget   pushButton_realtime_pause;
-EXTERNAL Widget   pushButton_realtime_resume;
-/**
- * End Global Widget Declarations.
- */
-#endif
diff --git a/src/mbgrdviz/mbgrdviz_main.c b/src/mbgrdviz/mbgrdviz_main.c
deleted file mode 100644
index 7741a61..0000000
--- a/src/mbgrdviz/mbgrdviz_main.c
+++ /dev/null
@@ -1,412 +0,0 @@
-
-/* Begin user code block <abstract> */
-/*--------------------------------------------------------------------
- *    The MB-system:	mbgrdviz_main.c		10/9/2002
- *    $Id: mbgrdviz_main.c 2250 2015-06-30 02:12:26Z caress $
- *
- *    Copyright (c) 2002-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/* End user code block <abstract> */
-
-/**
- * README: Portions of this file are merged at file generation
- * time. Edits can be made *only* in between specified code blocks, look
- * for keywords <Begin user code> and <End user code>.
- */
-/*
- * Generated by the ICS Builder Xcessory (BX).
- *
- * BuilderXcessory Version 6.1.3
- * Code Generator Xcessory 6.1.3 (08/19/04) CGX Scripts 6.1 Motif 2.1
- *
- */
-
-
-/* Begin user code block <file_comments> */
-/* #define MBGRDVIZ_DEBUG 1 */
-/* End user code block <file_comments> */
-
-/*
- * Motif required Headers
- */
-#include <X11/StringDefs.h>
-#include <Xm/Xm.h>
-#include <Xm/DialogS.h>
-#include <Xm/RepType.h>
-#include <Xm/MwmUtil.h>
-
-/**
- * Globally included information.
- */
-
-
-/*
- * Headers for classes used in this program
- */
-
-/**
- * Common constant and pixmap declarations.
- */
-#include "mbgrdviz_creation.h"
-
-/**
- * Convenience functions from utilities file.
- */
-extern void RegisterBxConverters(XtAppContext);
-extern XtPointer BX_CONVERT(Widget, char *, char *, int, Boolean *);
-extern XtPointer BX_DOUBLE(double);
-extern XtPointer BX_SINGLE(float);
-extern void BX_MENU_POST(Widget, XtPointer, XEvent *, Boolean *);
-extern Pixmap XPM_PIXMAP(Widget, char **);
-extern void BX_SET_BACKGROUND_COLOR(Widget, ArgList, Cardinal *, Pixel);
-
-/**
- * Declarations for shell callbacks.
- */
-extern void do_mbgrdviz_quit(Widget, XtPointer, XtPointer);
-extern void BxExitCB(Widget, XtPointer, XtPointer);
-
-/* Begin user code block <globals> */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-
-/* Avoid conflict due to BOOL redefinitions (Xm vs Win headers) */
-#ifdef WIN32
-#	undef BOOL
-#endif
-
-/* MBIO include files */
-#include "mb_status.h"
-#include "mb_define.h"
-
-/* mbview include file */
-#include "mbview.h"
-
-/* global mbview variables */
-Widget mainWindow;
-
-/* function prototypes */
-Widget CreatemainWindow_mbgrdviz(Widget parent);
-int do_mbgrdviz_init(int argc, char **argv, int verbosity);
-void do_mbgrdviz_sensitivity();
-int do_mbgrdviz_dismiss_notify(size_t instance);
-void do_mbgrdviz_fileSelectionBox( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbgrdviz_fileSelectionBox_openoverlay( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbgrdviz_fileSelectionBox_openroute( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbgrdviz_fileSelectionBox_opensite( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbgrdviz_fileSelectionBox_opennav( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbgrdviz_fileSelectionBox_openswath( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbgrdviz_fileSelectionBox_saveroute( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbgrdviz_fileSelectionBox_savewinfrogpts( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbgrdviz_fileSelectionBox_savewinfrogwpt( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbgrdviz_fileSelectionBox_savesite( Widget w, XtPointer client_data, XtPointer call_data);
-int do_mbgrdviz_openprimary(char *input_file_ptr);
-int do_mbgrdviz_openoverlay(size_t instance, char *input_file_ptr);
-int do_mbgrdviz_opensite(size_t instance, char *input_file_ptr);
-int do_mbgrdviz_savesite(size_t instance, char *output_file_ptr);
-int do_mbgrdviz_openroute(size_t instance, char *input_file_ptr);
-int do_mbgrdviz_saveroute(size_t instance, char *output_file_ptr);
-int do_mbgrdviz_savewinfrogpts(size_t instance, char *output_file_ptr);
-int do_mbgrdviz_savewinfrogwpt(size_t instance, char *output_file_ptr);
-int do_mbgrdviz_saveprofile(size_t instance, char *output_file_ptr);
-int do_mbgrdviz_opennav(size_t instance, int swathbounds, char *input_file_ptr);
-int do_mbgrdviz_readnav(size_t instance, char *swathfile,
-				int pathstatus, char *pathraw, char *pathprocessed,
-				int format, int formatorg, double weight, int *error);
-int do_mbgrdviz_readgrd(size_t instance, char *grdfile,
-			int	*grid_projection_mode,
-			char	*grid_projection_id,
-			float	*nodatavalue,
-			int	*nxy,
-			int	*nx,
-			int	*ny,
-			double	*min,
-			double	*max,
-			double	*xmin,
-			double	*xmax,
-			double	*ymin,
-			double	*ymax,
-			double	*dx,
-			double	*dy,
-			float	**data);
-int do_mbgrdviz_opentest(size_t instance,
-			double	factor1,
-			double	factor2,
-			double	factor3,
-			int	*grid_projection_mode,
-			char	*grid_projection_id,
-			float	*nodatavalue,
-			int	*nxy,
-			int	*nx,
-			int	*ny,
-			double	*min,
-			double	*max,
-			double	*xmin,
-			double	*xmax,
-			double	*ymin,
-			double	*ymax,
-			double	*dx,
-			double	*dy,
-			float	**data);
-void do_mbgrdviz_open_region( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbgrdviz_open_mbeditviz( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbgrdviz_make_survey( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbgrdviz_generate_survey( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbgrdviz_arearoute_dismiss( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbgrdviz_arearoute_parameterchange( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbgrdviz_arearoute_recalc(size_t instance);
-void do_mbgrdviz_arearoute_info(size_t instance);
-void do_mbgrdviz_arearoute_linespacing_increment( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbgrdviz_arearoute_altitude_increment( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbgrdviz_arearoute_depth_increment( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbgrdviz_realtime_start( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbgrdviz_realtimesetup_path_reset( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbgrdviz_realtime_pause( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbgrdviz_realtime_stop( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbgrdviz_realtime_resume( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbgrdviz_realtimesetup_path_apply( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbgrdviz_realtimesetup_icon( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbgrdviz_realtimesetup_path_browse( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbgrdviz_realtimesetup_updaterate( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbgrdviz_realtimesetup_path_test( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbgrdviz_realtimesetup_pathmode( Widget w, XtPointer client_data, XtPointer call_data);
-
-static char rcs_id[] = "$Id: mbgrdviz_main.c 2250 2015-06-30 02:12:26Z caress $";
-static char program_name[] = "MBgrdviz";
-static char help_message[] =  "MBgrdviz provides simple interactive 2D/3Dvizualization of GMT grids.";
-static char usage_message[] = "mbgrdviz [-Igrdfile -T -V -H]";
-char	ifile[MB_PATH_MAXLINE];
-char	jfile[MB_PATH_MAXLINE];
-
-/* parsing variables */
-extern char *optarg;
-extern int optkind;
-int	errflg = 0;
-int	c;
-int	help = 0;
-int	flag = 0;
-
-/* use these parameters only when debugging X events */
-#ifdef MBGRDVIZ_DEBUG
-char	eventname[64];
-XEvent	event;
-XAnyEvent *xany;
-XKeyEvent *xkey;
-XButtonEvent *xbutton;
-XMotionEvent *xmotion;
-XCrossingEvent *xcrossing;
-XFocusChangeEvent *xfocus;
-XExposeEvent *xexpose;
-XGraphicsExposeEvent *xgraphicsexpose;
-XNoExposeEvent *xnoexpose;
-XVisibilityEvent *xvisibility;
-XCreateWindowEvent *xcreatewindow;
-XDestroyWindowEvent *xdestroywindow;
-XUnmapEvent *xunmap;
-XMapEvent *xmap;
-XMapRequestEvent *xmaprequest;
-XReparentEvent *xreparent;
-XConfigureEvent *xconfigure;
-XGravityEvent *xgravity;
-XResizeRequestEvent *xresizerequest;
-XConfigureRequestEvent *xconfigurerequest;
-XCirculateEvent *xcirculate;
-XCirculateRequestEvent *xcirculaterequest;
-XPropertyEvent *xproperty;
-XSelectionClearEvent *xselectionclear;
-XSelectionRequestEvent *xselectionrequest;
-XSelectionEvent *xselection;
-XColormapEvent *xcolormap;
-XClientMessageEvent *xclient;
-XMappingEvent *xmapping;
-XErrorEvent *xerror;
-XKeymapEvent *xkeymap;
-#endif
-
-/* End user code block <globals> */
-
-/**
- * Change this line via the Output Application Names Dialog.
- */
-#define BX_APP_CLASS "MB-System"
-
-int main( int argc, char **argv)
-{
-    Widget       parent;
-    XtAppContext app;
-    Arg          args[256];
-    Cardinal     ac;
-    Widget   topLevelShell;
-    Widget   mainWindow_mbgrdviz;
-
-    /* Begin user code block <declarations> */
-	int	error = MB_ERROR_NO_ERROR;
-	int	verbose = 0;
-	int	ifileflag = 0;
-	int	jfileflag = 0;
-	int	testflag = 0;
-	//sessionShellWidgetClass widget_class;
-	//widget_class.core_class.class_inited = NULL;
-
-	/* process argument list */
-	while ((c = getopt(argc, argv, "VvHhI:i:J:j:Tt")) != -1)
-	  {
-	  switch (c)
-		{
-		case 'H':
-		case 'h':
-			help++;
-			break;
-		case 'V':
-		case 'v':
-			verbose++;
-			break;
-		case 'I':
-		case 'i':
-			sscanf (optarg,"%s", ifile);
-			flag++;
-			ifileflag++;
-			break;
-		case 'J':
-		case 'j':
-			sscanf (optarg,"%s", jfile);
-			flag++;
-			jfileflag++;
-			break;
-		case 'T':
-		case 't':
-			flag++;
-			testflag++;
-			break;
-		case '?':
-			errflg++;
-		}
-	    }
-
-	/* if error flagged then print it and exit */
-	if (errflg)
-		{
-		fprintf(stderr,"usage: %s\n", usage_message);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		error = MB_ERROR_BAD_USAGE;
-		exit(error);
-		}
-
-	/* print starting message */
-	if (verbose == 1 || help)
-		{
-		fprintf(stderr,"\nProgram %s\n",program_name);
-		fprintf(stderr,"Version %s\n",rcs_id);
-		fprintf(stderr,"MB-system Version %s\n",MB_VERSION);
-		}
-
-	/* print starting message */
-	if (help)
-		{
-		fprintf(stderr,"\n%s\n\nUsage: %s\n", help_message, usage_message);
-		error = MB_ERROR_NO_ERROR;
-		exit(error);
-		}
-
-    /* End user code block <declarations> */
-
-    /*
-     * Initialize Xt.
-     */
-
-    // XtSetLanguageProc(NULL, (XtLanguageProc) NULL, NULL);
-
-    /*
-     * The applicationShell is created as an unrealized
-     * parent for multiple topLevelShells.  The topLevelShells
-     * are created as popup children of the applicationShell.
-     * This is a recommendation of Paul Asente & Ralph Swick in
-     * _X_Window_System_Toolkit_ p. 677.
-     */
-
-    parent = XtVaOpenApplication ( &app,
-                                   BX_APP_CLASS,
-                                   NULL,
-                                   0,
-                                   &argc,
-                                   argv,
-                                   NULL,
-                                   sessionShellWidgetClass,
-                                   NULL );
-
-    RegisterBxConverters(app);
-    XmRepTypeInstallTearOffModelConverter();
-
-    /* Begin user code block <create_shells> */
-    /* End user code block <create_shells> */
-
-    /*
-     * Create classes and widgets used in this program.
-     */
-
-    /* Begin user code block <create_topLevelShell> */
-    /* End user code block <create_topLevelShell> */
-
-    ac = 0;
-    XtSetArg(args[ac], XmNtitle, "MBgrdviz"); ac++;
-    XtSetArg(args[ac], XmNx, 108); ac++;
-    XtSetArg(args[ac], XmNy, 241); ac++;
-    XtSetArg(args[ac], XmNwidth, 260); ac++;
-    XtSetArg(args[ac], XmNheight, 215); ac++;
-    topLevelShell = XtCreatePopupShell((char *)"topLevelShell",
-        topLevelShellWidgetClass,
-        parent,
-        args,
-        ac);
-    XtAddCallback(topLevelShell, XmNdestroyCallback, do_mbgrdviz_quit, (XtPointer)0);
-    XtAddCallback(topLevelShell, XmNdestroyCallback, BxExitCB, (XtPointer)0);
-    mainWindow_mbgrdviz = (Widget)CreatemainWindow_mbgrdviz(topLevelShell);
-    XtManageChild(mainWindow_mbgrdviz);
-    XtPopup(XtParent(mainWindow_mbgrdviz), XtGrabNone);
-
-    /* Begin user code block <app_procedures> */
-
-    /* set top level widget */
-    mainWindow = mainWindow_mbgrdviz;
-
-    /* End user code block <app_procedures> */
-
-    /* Begin user code block <main_loop> */
-
-    /* initialize the vizualization widgets code */
-    mbview_startup(verbose, parent, app, &error);
-
-    /* open the file specified on the command line */
-    do_mbgrdviz_init(argc,argv, verbose);
-    if (ifileflag > 0)
-    	{
-    	do_mbgrdviz_openprimary(ifile);
-	if (jfileflag > 0)
-		{
-		do_mbgrdviz_openoverlay(0,jfile);
-		}
-	}
-    else if (testflag > 0)
-    	{
-        do_mbgrdviz_openprimary(NULL);
-	}
-    /* End user code block <main_loop> */
-
-    XtAppMainLoop(app);
-
-    /*
-     * A return value regardless of whether or not the main loop ends.
-     */
-     return(0);
-}
diff --git a/src/mbio/Makefile.am b/src/mbio/Makefile.am
deleted file mode 100644
index dc6dd74..0000000
--- a/src/mbio/Makefile.am
+++ /dev/null
@@ -1,150 +0,0 @@
-lib_LTLIBRARIES = libmbio.la
-
-include_HEADERS = mb_config.h \
-        mb_format.h mb_status.h \
-        mb_io.h mb_swap.h \
-        mb_define.h mb_process.h \
-        mb_segy.h mb_info.h \
-        mbsys_sb.h mbsys_hsds.h \
-        mbsys_sb2100.h mbsys_simrad.h \
-        mbsys_simrad2.h mbsys_simrad3.h \
-        mbsys_mr1.h mbsys_mr1b.h mbsys_mr1v2001.h \
-        mbsys_ldeoih.h \
-        mbsys_reson.h mbsys_sb2000.h \
-        mbsys_hsmd.h mbsys_dsl.h \
-        mbsys_mstiff.h \
-        mbsys_oic.h mbsys_hdcs.h \
-        mbsys_singlebeam.h mbsys_xse.h \
-        mbsys_hs10.h \
-        mbsys_atlas.h mbsys_surf.h \
-	mbsys_gsf.h mbf_gsfgenmb.h \
-        mbsys_reson8k.h \
-        mbsys_netcdf.h mbsys_navnetcdf.h \
-        mbsys_reson7k.h mbsys_jstar.h \
-        mbsys_image83p.h mbsys_hysweep.h \
-        mbsys_benthos.h mbsys_swathplus.h \
-	mbsys_3datdepthlidar.h mbsys_wassp.h \
-	mbsys_stereopair.h \
-        mbf_sbsiomrg.h mbf_sbsiocen.h \
-        mbf_sbsiolsi.h mbf_sburicen.h \
-        mbf_sbifremr.h mbf_hsatlraw.h \
-        mbf_hsldedmb.h mbf_hsuricen.h \
-        mbf_hsldeoih.h \
-        mbf_sb2100rw.h \
-        mbf_em12darw.h mbf_em12ifrm.h \
-        mbf_mr1prhig.h mbf_mr1aldeo.h \
-        mbf_mr1bldeo.h mbf_cbat9001.h \
-        mbf_cbat8101.h mbf_hypc8101.h \
-        mbf_bchrtunb.h mbf_elmk2unb.h \
-        mbf_bchrxunb.h \
-        mbf_sbsioswb.h \
-        mbf_hsmdaraw.h mbf_hsmdldih.h \
-        mbf_dsl120pf.h mbf_dsl120sf.h \
-        mbf_mstiffss.h \
-        mbf_oicgeoda.h mbf_oicmbari.h \
-        mbf_omghdcsj.h mbf_mgd77dat.h \
-        mbf_mbarirov.h mbf_mbarrov2.h \
-        mbf_mbpronav.h mbf_xtfr8101.h
-
-AM_CFLAGS = ${libgmt_CFLAGS} ${libnetcdf_CFLAGS}
-
-AM_CPPFLAGS = -I at top_srcdir@/src/bsio \
-	-I at top_srcdir@/src/surf \
-	-I at top_srcdir@/src/gsf \
-	${libgmt_CPPFLAGS} \
-	${libnetcdf_CPPFLAGS}
-if BUILD_PROJ
-  AM_CPPFLAGS += -I at top_srcdir@/src/proj
-else
-  AM_CPPFLAGS += ${libproj_CPPFLAGS}
-endif
-
-libmbio_la_LDFLAGS = -no-undefined -version-info 0:0:0
-
-libmbio_la_SOURCES = \
-		mb_format.c mb_error.c \
-                mb_swap.c mb_compare.c mb_navint.c \
-                mb_read_init.c mb_write_init.c mb_close.c \
-                mb_fileio.c mb_mem.c \
-                mb_coor_scale.c mb_check_info.c \
-                mb_time.c mb_angle.c \
-                mb_absorption.c mb_proj.c \
-                mb_get_value.c mb_defaults.c \
-                mb_process.c mb_esf.c \
-                mb_get.c mb_get_all.c mb_read.c \
-                mb_put_all.c mb_put_comment.c \
-                mb_buffer.c mb_platform.c \
-                mb_read_ping.c mb_write_ping.c \
-                mb_access.c mb_segy.c mb_rt.c \
-                mbsys_sb.c mbsys_hsds.c \
-                mbsys_sb2100.c mbsys_simrad.c \
-                mbsys_simrad2.c mbsys_simrad3.c \
-                mbsys_mr1.c mbsys_mr1b.c mbsys_mr1v2001.c \
-                mbsys_ldeoih.c mbsys_reson.c \
-                mbsys_elac.c mbsys_elacmk2.c \
-                mbsys_sb2000.c mbsys_hsmd.c mbsys_dsl.c \
-                mbsys_mstiff.c \
-                mbsys_oic.c mbsys_hdcs.c \
-                mbsys_singlebeam.c mbsys_xse.c \
-                mbsys_hs10.c mbsys_atlas.c \
-                mbsys_surf.c mbsys_reson8k.c \
-		mbsys_gsf.c mbr_gsfgenmb.c \
-                mbsys_netcdf.c mbsys_navnetcdf.c \
-                mbsys_reson7k.c mbsys_jstar.c \
-                mbsys_image83p.c mbsys_hysweep.c \
-                mbsys_benthos.c mbsys_swathplus.c \
-		mbsys_3datdepthlidar.c mbsys_wassp.c \
-		mbsys_stereopair.c \
-                mbr_sbsiomrg.c mbr_sbsiocen.c \
-                mbr_sbsiolsi.c mbr_sburicen.c \
-                mbr_sburivax.c mbr_sbifremr.c \
-                mbr_hsatlraw.c mbr_hsldedmb.c \
-                mbr_hsuricen.c mbr_hsurivax.c \
-                mbr_hsldeoih.c mbr_hsunknwn.c \
-                mbr_sb2100rw.c mbr_sb2100bi.c \
-                mbr_emoldraw.c mbr_em12darw.c \
-                mbr_em12ifrm.c \
-                mbr_em300raw.c mbr_em300mba.c \
-                mbr_em710raw.c mbr_em710mba.c \
-                mbr_mr1prhig.c mbr_mr1aldeo.c \
-                mbr_mr1bldeo.c mbr_mr1prvr2.c \
-                mbr_mbldeoih.c mbr_cbat9001.c \
-                mbr_cbat8101.c mbr_hypc8101.c \
-                mbr_bchrtunb.c mbr_elmk2unb.c \
-                mbr_bchrxunb.c mbr_l3xseraw.c \
-                mbr_sbsioswb.c \
-                mbr_sb2000sb.c mbr_sb2000ss.c \
-                mbr_hsmdaraw.c mbr_hsmdldih.c \
-                mbr_dsl120pf.c mbr_dsl120sf.c \
-                mbr_mstiffss.c \
-                mbr_oicgeoda.c mbr_oicmbari.c \
-                mbr_omghdcsj.c mbr_mgd77dat.c \
-                mbr_asciixyz.c mbr_hydrob93.c \
-                mbr_mbarirov.c mbr_mbarrov2.c \
-                mbr_mbpronav.c mbr_hs10jams.c \
-                mbr_hsds2raw.c mbr_hsds2lam.c \
-                mbr_xtfr8101.c \
-                mbr_mbnetcdf.c mbr_nvnetcdf.c \
-                mbr_samesurf.c mbr_reson7kr.c \
-                mbr_edgjstar.c mbr_segysegy.c \
-                mbr_image83p.c mbr_imagemba.c \
-                mbr_hir2rnav.c mbr_hysweep1.c \
-                mbr_xtfb1624.c mbr_swplssxi.c \
-                mbr_swplssxp.c mbr_3ddepthp.c \
-		mbr_wasspenl.c mbr_mgd77txt.c \
-		mbr_mgd77tab.c mbr_photgram.c
-
-libmbio_la_LIBADD = $(top_builddir)/src/bsio/libmbbsio.la \
-                   $(top_builddir)/src/surf/libmbsapi.la \
-		   $(top_builddir)/src/gsf/libmbgsf.la \
-		   ${libgmt_LIBS} ${libnetcdf_LIBS} ${libproj_LIBS} ${XDR_LIB}
-
-nodist_libmbio_la_SOURCES = projections.h
-
-BUILT_SOURCES = projections.h
-
-CLEANFILES = projections.h
-DISTCLEANFILES = projections.h
-
-projections.h: Makefile
-	echo 'char *projectionfile = "$(mbsystemdatadir)/Projections.dat";' >$@
diff --git a/src/mbio/Makefile.in b/src/mbio/Makefile.in
deleted file mode 100644
index 2f5fd43..0000000
--- a/src/mbio/Makefile.in
+++ /dev/null
@@ -1,1042 +0,0 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
-
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-
-
-VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
-am__make_running_with_option = \
-  case $${target_option-} in \
-      ?) ;; \
-      *) echo "am__make_running_with_option: internal error: invalid" \
-              "target option '$${target_option-}' specified" >&2; \
-         exit 1;; \
-  esac; \
-  has_opt=no; \
-  sane_makeflags=$$MAKEFLAGS; \
-  if $(am__is_gnu_make); then \
-    sane_makeflags=$$MFLAGS; \
-  else \
-    case $$MAKEFLAGS in \
-      *\\[\ \	]*) \
-        bs=\\; \
-        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
-          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
-    esac; \
-  fi; \
-  skip_next=no; \
-  strip_trailopt () \
-  { \
-    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
-  }; \
-  for flg in $$sane_makeflags; do \
-    test $$skip_next = yes && { skip_next=no; continue; }; \
-    case $$flg in \
-      *=*|--*) continue;; \
-        -*I) strip_trailopt 'I'; skip_next=yes;; \
-      -*I?*) strip_trailopt 'I';; \
-        -*O) strip_trailopt 'O'; skip_next=yes;; \
-      -*O?*) strip_trailopt 'O';; \
-        -*l) strip_trailopt 'l'; skip_next=yes;; \
-      -*l?*) strip_trailopt 'l';; \
-      -[dEDm]) skip_next=yes;; \
-      -[JT]) skip_next=yes;; \
-    esac; \
-    case $$flg in \
-      *$$target_option*) has_opt=yes; break;; \
-    esac; \
-  done; \
-  test $$has_opt = yes
-am__make_dryrun = (target_option=n; $(am__make_running_with_option))
-am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
- at BUILD_PROJ_TRUE@am__append_1 = -I at top_srcdir@/src/proj
- at BUILD_PROJ_FALSE@am__append_2 = ${libproj_CPPFLAGS}
-subdir = src/mbio
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(srcdir)/mb_config.h.in $(top_srcdir)/depcomp \
-	$(include_HEADERS)
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
-	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
-	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
-	$(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-	$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = mb_config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
-am__vpath_adj = case $$p in \
-    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
-    *) f=$$p;; \
-  esac;
-am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
-am__install_max = 40
-am__nobase_strip_setup = \
-  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
-am__nobase_strip = \
-  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
-am__nobase_list = $(am__nobase_strip_setup); \
-  for p in $$list; do echo "$$p $$p"; done | \
-  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
-  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
-    if (++n[$$2] == $(am__install_max)) \
-      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
-    END { for (dir in files) print dir, files[dir] }'
-am__base_list = \
-  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
-  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
-am__uninstall_files_from_dir = { \
-  test -z "$$files" \
-    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
-    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
-         $(am__cd) "$$dir" && rm -f $$files; }; \
-  }
-am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includedir)"
-LTLIBRARIES = $(lib_LTLIBRARIES)
-am__DEPENDENCIES_1 =
-libmbio_la_DEPENDENCIES = $(top_builddir)/src/bsio/libmbbsio.la \
-	$(top_builddir)/src/surf/libmbsapi.la \
-	$(top_builddir)/src/gsf/libmbgsf.la $(am__DEPENDENCIES_1) \
-	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
-	$(am__DEPENDENCIES_1)
-am_libmbio_la_OBJECTS = mb_format.lo mb_error.lo mb_swap.lo \
-	mb_compare.lo mb_navint.lo mb_read_init.lo mb_write_init.lo \
-	mb_close.lo mb_fileio.lo mb_mem.lo mb_coor_scale.lo \
-	mb_check_info.lo mb_time.lo mb_angle.lo mb_absorption.lo \
-	mb_proj.lo mb_get_value.lo mb_defaults.lo mb_process.lo \
-	mb_esf.lo mb_get.lo mb_get_all.lo mb_read.lo mb_put_all.lo \
-	mb_put_comment.lo mb_buffer.lo mb_platform.lo mb_read_ping.lo \
-	mb_write_ping.lo mb_access.lo mb_segy.lo mb_rt.lo mbsys_sb.lo \
-	mbsys_hsds.lo mbsys_sb2100.lo mbsys_simrad.lo mbsys_simrad2.lo \
-	mbsys_simrad3.lo mbsys_mr1.lo mbsys_mr1b.lo mbsys_mr1v2001.lo \
-	mbsys_ldeoih.lo mbsys_reson.lo mbsys_elac.lo mbsys_elacmk2.lo \
-	mbsys_sb2000.lo mbsys_hsmd.lo mbsys_dsl.lo mbsys_mstiff.lo \
-	mbsys_oic.lo mbsys_hdcs.lo mbsys_singlebeam.lo mbsys_xse.lo \
-	mbsys_hs10.lo mbsys_atlas.lo mbsys_surf.lo mbsys_reson8k.lo \
-	mbsys_gsf.lo mbr_gsfgenmb.lo mbsys_netcdf.lo \
-	mbsys_navnetcdf.lo mbsys_reson7k.lo mbsys_jstar.lo \
-	mbsys_image83p.lo mbsys_hysweep.lo mbsys_benthos.lo \
-	mbsys_swathplus.lo mbsys_3datdepthlidar.lo mbsys_wassp.lo \
-	mbsys_stereopair.lo mbr_sbsiomrg.lo mbr_sbsiocen.lo \
-	mbr_sbsiolsi.lo mbr_sburicen.lo mbr_sburivax.lo \
-	mbr_sbifremr.lo mbr_hsatlraw.lo mbr_hsldedmb.lo \
-	mbr_hsuricen.lo mbr_hsurivax.lo mbr_hsldeoih.lo \
-	mbr_hsunknwn.lo mbr_sb2100rw.lo mbr_sb2100bi.lo \
-	mbr_emoldraw.lo mbr_em12darw.lo mbr_em12ifrm.lo \
-	mbr_em300raw.lo mbr_em300mba.lo mbr_em710raw.lo \
-	mbr_em710mba.lo mbr_mr1prhig.lo mbr_mr1aldeo.lo \
-	mbr_mr1bldeo.lo mbr_mr1prvr2.lo mbr_mbldeoih.lo \
-	mbr_cbat9001.lo mbr_cbat8101.lo mbr_hypc8101.lo \
-	mbr_bchrtunb.lo mbr_elmk2unb.lo mbr_bchrxunb.lo \
-	mbr_l3xseraw.lo mbr_sbsioswb.lo mbr_sb2000sb.lo \
-	mbr_sb2000ss.lo mbr_hsmdaraw.lo mbr_hsmdldih.lo \
-	mbr_dsl120pf.lo mbr_dsl120sf.lo mbr_mstiffss.lo \
-	mbr_oicgeoda.lo mbr_oicmbari.lo mbr_omghdcsj.lo \
-	mbr_mgd77dat.lo mbr_asciixyz.lo mbr_hydrob93.lo \
-	mbr_mbarirov.lo mbr_mbarrov2.lo mbr_mbpronav.lo \
-	mbr_hs10jams.lo mbr_hsds2raw.lo mbr_hsds2lam.lo \
-	mbr_xtfr8101.lo mbr_mbnetcdf.lo mbr_nvnetcdf.lo \
-	mbr_samesurf.lo mbr_reson7kr.lo mbr_edgjstar.lo \
-	mbr_segysegy.lo mbr_image83p.lo mbr_imagemba.lo \
-	mbr_hir2rnav.lo mbr_hysweep1.lo mbr_xtfb1624.lo \
-	mbr_swplssxi.lo mbr_swplssxp.lo mbr_3ddepthp.lo \
-	mbr_wasspenl.lo mbr_mgd77txt.lo mbr_mgd77tab.lo \
-	mbr_photgram.lo
-nodist_libmbio_la_OBJECTS =
-libmbio_la_OBJECTS = $(am_libmbio_la_OBJECTS) \
-	$(nodist_libmbio_la_OBJECTS)
-AM_V_lt = $(am__v_lt_ at AM_V@)
-am__v_lt_ = $(am__v_lt_ at AM_DEFAULT_V@)
-am__v_lt_0 = --silent
-am__v_lt_1 = 
-libmbio_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
-	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
-	$(libmbio_la_LDFLAGS) $(LDFLAGS) -o $@
-AM_V_P = $(am__v_P_ at AM_V@)
-am__v_P_ = $(am__v_P_ at AM_DEFAULT_V@)
-am__v_P_0 = false
-am__v_P_1 = :
-AM_V_GEN = $(am__v_GEN_ at AM_V@)
-am__v_GEN_ = $(am__v_GEN_ at AM_DEFAULT_V@)
-am__v_GEN_0 = @echo "  GEN     " $@;
-am__v_GEN_1 = 
-AM_V_at = $(am__v_at_ at AM_V@)
-am__v_at_ = $(am__v_at_ at AM_DEFAULT_V@)
-am__v_at_0 = @
-am__v_at_1 = 
-DEFAULT_INCLUDES = -I. at am__isrc@
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
-am__mv = mv -f
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
-	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
-	$(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
-	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
-	$(AM_CFLAGS) $(CFLAGS)
-AM_V_CC = $(am__v_CC_ at AM_V@)
-am__v_CC_ = $(am__v_CC_ at AM_DEFAULT_V@)
-am__v_CC_0 = @echo "  CC      " $@;
-am__v_CC_1 = 
-CCLD = $(CC)
-LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
-	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
-	$(AM_LDFLAGS) $(LDFLAGS) -o $@
-AM_V_CCLD = $(am__v_CCLD_ at AM_V@)
-am__v_CCLD_ = $(am__v_CCLD_ at AM_DEFAULT_V@)
-am__v_CCLD_0 = @echo "  CCLD    " $@;
-am__v_CCLD_1 = 
-SOURCES = $(libmbio_la_SOURCES) $(nodist_libmbio_la_SOURCES)
-DIST_SOURCES = $(libmbio_la_SOURCES)
-am__can_run_installinfo = \
-  case $$AM_UPDATE_INFO_DIR in \
-    n|no|NO) false;; \
-    *) (install-info --version) >/dev/null 2>&1;; \
-  esac
-HEADERS = $(include_HEADERS)
-am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \
-	$(LISP)mb_config.h.in
-# Read a list of newline-separated strings from the standard input,
-# and print each of them once, without duplicates.  Input order is
-# *not* preserved.
-am__uniquify_input = $(AWK) '\
-  BEGIN { nonempty = 0; } \
-  { items[$$0] = 1; nonempty = 1; } \
-  END { if (nonempty) { for (i in items) print i; }; } \
-'
-# Make sure the list of sources is unique.  This is necessary because,
-# e.g., the same source file might be shared among _SOURCES variables
-# for different programs/libraries.
-am__define_uniq_tagged_files = \
-  list='$(am__tagged_files)'; \
-  unique=`for i in $$list; do \
-    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-  done | $(am__uniquify_input)`
-ETAGS = etags
-CTAGS = ctags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-CC = @CC@
-CCAS = @CCAS@
-CCASDEPMODE = @CCASDEPMODE@
-CCASFLAGS = @CCASFLAGS@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DLLTOOL = @DLLTOOL@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GREP = @GREP@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBM = @LIBM@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIBTOOL_DEPS = @LIBTOOL_DEPS@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LTLIBOBJS = @LTLIBOBJS@
-LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
-MAINT = @MAINT@
-MAKEINFO = @MAKEINFO@
-MANIFEST_TOOL = @MANIFEST_TOOL@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-OTPS_DIR = @OTPS_DIR@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_URL = @PACKAGE_URL@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PKG_CONFIG = @PKG_CONFIG@
-PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
-PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-VERSION = @VERSION@
-XDR_LIB = @XDR_LIB@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_AR = @ac_ct_AR@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-fftw_app = @fftw_app@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libGLU_CFLAGS = @libGLU_CFLAGS@
-libGLU_LIBS = @libGLU_LIBS@
-libXm_CFLAGS = @libXm_CFLAGS@
-libXm_LIBS = @libXm_LIBS@
-libdir = @libdir@
-libexecdir = @libexecdir@
-libfftw3_CFLAGS = @libfftw3_CFLAGS@
-libfftw3_LIBS = @libfftw3_LIBS@
-libfftw_CPPFLAGS = @libfftw_CPPFLAGS@
-libfftw_LIBS = @libfftw_LIBS@
-libgmt_CFLAGS = @libgmt_CFLAGS@
-libgmt_CPPFLAGS = @libgmt_CPPFLAGS@
-libgmt_LIBS = @libgmt_LIBS@
-libmotif_CPPFLAGS = @libmotif_CPPFLAGS@
-libmotif_LIBS = @libmotif_LIBS@
-libnetcdf_CFLAGS = @libnetcdf_CFLAGS@
-libnetcdf_CPPFLAGS = @libnetcdf_CPPFLAGS@
-libnetcdf_LIBS = @libnetcdf_LIBS@
-libopengl_CPPFLAGS = @libopengl_CPPFLAGS@
-libopengl_LIBS = @libopengl_LIBS@
-libproj_CFLAGS = @libproj_CFLAGS@
-libproj_CPPFLAGS = @libproj_CPPFLAGS@
-libproj_LIBS = @libproj_LIBS@
-libpsl_CFLAGS = @libpsl_CFLAGS@
-libpsl_LIBS = @libpsl_LIBS@
-localedir = @localedir@
-localstatedir = @localstatedir@
-mandir = @mandir@
-mbsystemdatadir = @mbsystemdatadir@
-mbsystemhtmldir = @mbsystemhtmldir@
-mbsystempsdir = @mbsystempsdir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-lib_LTLIBRARIES = libmbio.la
-include_HEADERS = mb_config.h \
-        mb_format.h mb_status.h \
-        mb_io.h mb_swap.h \
-        mb_define.h mb_process.h \
-        mb_segy.h mb_info.h \
-        mbsys_sb.h mbsys_hsds.h \
-        mbsys_sb2100.h mbsys_simrad.h \
-        mbsys_simrad2.h mbsys_simrad3.h \
-        mbsys_mr1.h mbsys_mr1b.h mbsys_mr1v2001.h \
-        mbsys_ldeoih.h \
-        mbsys_reson.h mbsys_sb2000.h \
-        mbsys_hsmd.h mbsys_dsl.h \
-        mbsys_mstiff.h \
-        mbsys_oic.h mbsys_hdcs.h \
-        mbsys_singlebeam.h mbsys_xse.h \
-        mbsys_hs10.h \
-        mbsys_atlas.h mbsys_surf.h \
-	mbsys_gsf.h mbf_gsfgenmb.h \
-        mbsys_reson8k.h \
-        mbsys_netcdf.h mbsys_navnetcdf.h \
-        mbsys_reson7k.h mbsys_jstar.h \
-        mbsys_image83p.h mbsys_hysweep.h \
-        mbsys_benthos.h mbsys_swathplus.h \
-	mbsys_3datdepthlidar.h mbsys_wassp.h \
-	mbsys_stereopair.h \
-        mbf_sbsiomrg.h mbf_sbsiocen.h \
-        mbf_sbsiolsi.h mbf_sburicen.h \
-        mbf_sbifremr.h mbf_hsatlraw.h \
-        mbf_hsldedmb.h mbf_hsuricen.h \
-        mbf_hsldeoih.h \
-        mbf_sb2100rw.h \
-        mbf_em12darw.h mbf_em12ifrm.h \
-        mbf_mr1prhig.h mbf_mr1aldeo.h \
-        mbf_mr1bldeo.h mbf_cbat9001.h \
-        mbf_cbat8101.h mbf_hypc8101.h \
-        mbf_bchrtunb.h mbf_elmk2unb.h \
-        mbf_bchrxunb.h \
-        mbf_sbsioswb.h \
-        mbf_hsmdaraw.h mbf_hsmdldih.h \
-        mbf_dsl120pf.h mbf_dsl120sf.h \
-        mbf_mstiffss.h \
-        mbf_oicgeoda.h mbf_oicmbari.h \
-        mbf_omghdcsj.h mbf_mgd77dat.h \
-        mbf_mbarirov.h mbf_mbarrov2.h \
-        mbf_mbpronav.h mbf_xtfr8101.h
-
-AM_CFLAGS = ${libgmt_CFLAGS} ${libnetcdf_CFLAGS}
-AM_CPPFLAGS = -I at top_srcdir@/src/bsio -I at top_srcdir@/src/surf \
-	-I at top_srcdir@/src/gsf ${libgmt_CPPFLAGS} \
-	${libnetcdf_CPPFLAGS} $(am__append_1) $(am__append_2)
-libmbio_la_LDFLAGS = -no-undefined -version-info 0:0:0
-libmbio_la_SOURCES = \
-		mb_format.c mb_error.c \
-                mb_swap.c mb_compare.c mb_navint.c \
-                mb_read_init.c mb_write_init.c mb_close.c \
-                mb_fileio.c mb_mem.c \
-                mb_coor_scale.c mb_check_info.c \
-                mb_time.c mb_angle.c \
-                mb_absorption.c mb_proj.c \
-                mb_get_value.c mb_defaults.c \
-                mb_process.c mb_esf.c \
-                mb_get.c mb_get_all.c mb_read.c \
-                mb_put_all.c mb_put_comment.c \
-                mb_buffer.c mb_platform.c \
-                mb_read_ping.c mb_write_ping.c \
-                mb_access.c mb_segy.c mb_rt.c \
-                mbsys_sb.c mbsys_hsds.c \
-                mbsys_sb2100.c mbsys_simrad.c \
-                mbsys_simrad2.c mbsys_simrad3.c \
-                mbsys_mr1.c mbsys_mr1b.c mbsys_mr1v2001.c \
-                mbsys_ldeoih.c mbsys_reson.c \
-                mbsys_elac.c mbsys_elacmk2.c \
-                mbsys_sb2000.c mbsys_hsmd.c mbsys_dsl.c \
-                mbsys_mstiff.c \
-                mbsys_oic.c mbsys_hdcs.c \
-                mbsys_singlebeam.c mbsys_xse.c \
-                mbsys_hs10.c mbsys_atlas.c \
-                mbsys_surf.c mbsys_reson8k.c \
-		mbsys_gsf.c mbr_gsfgenmb.c \
-                mbsys_netcdf.c mbsys_navnetcdf.c \
-                mbsys_reson7k.c mbsys_jstar.c \
-                mbsys_image83p.c mbsys_hysweep.c \
-                mbsys_benthos.c mbsys_swathplus.c \
-		mbsys_3datdepthlidar.c mbsys_wassp.c \
-		mbsys_stereopair.c \
-                mbr_sbsiomrg.c mbr_sbsiocen.c \
-                mbr_sbsiolsi.c mbr_sburicen.c \
-                mbr_sburivax.c mbr_sbifremr.c \
-                mbr_hsatlraw.c mbr_hsldedmb.c \
-                mbr_hsuricen.c mbr_hsurivax.c \
-                mbr_hsldeoih.c mbr_hsunknwn.c \
-                mbr_sb2100rw.c mbr_sb2100bi.c \
-                mbr_emoldraw.c mbr_em12darw.c \
-                mbr_em12ifrm.c \
-                mbr_em300raw.c mbr_em300mba.c \
-                mbr_em710raw.c mbr_em710mba.c \
-                mbr_mr1prhig.c mbr_mr1aldeo.c \
-                mbr_mr1bldeo.c mbr_mr1prvr2.c \
-                mbr_mbldeoih.c mbr_cbat9001.c \
-                mbr_cbat8101.c mbr_hypc8101.c \
-                mbr_bchrtunb.c mbr_elmk2unb.c \
-                mbr_bchrxunb.c mbr_l3xseraw.c \
-                mbr_sbsioswb.c \
-                mbr_sb2000sb.c mbr_sb2000ss.c \
-                mbr_hsmdaraw.c mbr_hsmdldih.c \
-                mbr_dsl120pf.c mbr_dsl120sf.c \
-                mbr_mstiffss.c \
-                mbr_oicgeoda.c mbr_oicmbari.c \
-                mbr_omghdcsj.c mbr_mgd77dat.c \
-                mbr_asciixyz.c mbr_hydrob93.c \
-                mbr_mbarirov.c mbr_mbarrov2.c \
-                mbr_mbpronav.c mbr_hs10jams.c \
-                mbr_hsds2raw.c mbr_hsds2lam.c \
-                mbr_xtfr8101.c \
-                mbr_mbnetcdf.c mbr_nvnetcdf.c \
-                mbr_samesurf.c mbr_reson7kr.c \
-                mbr_edgjstar.c mbr_segysegy.c \
-                mbr_image83p.c mbr_imagemba.c \
-                mbr_hir2rnav.c mbr_hysweep1.c \
-                mbr_xtfb1624.c mbr_swplssxi.c \
-                mbr_swplssxp.c mbr_3ddepthp.c \
-		mbr_wasspenl.c mbr_mgd77txt.c \
-		mbr_mgd77tab.c mbr_photgram.c
-
-libmbio_la_LIBADD = $(top_builddir)/src/bsio/libmbbsio.la \
-                   $(top_builddir)/src/surf/libmbsapi.la \
-		   $(top_builddir)/src/gsf/libmbgsf.la \
-		   ${libgmt_LIBS} ${libnetcdf_LIBS} ${libproj_LIBS} ${XDR_LIB}
-
-nodist_libmbio_la_SOURCES = projections.h
-BUILT_SOURCES = projections.h
-CLEANFILES = projections.h
-DISTCLEANFILES = projections.h
-all: $(BUILT_SOURCES) mb_config.h
-	$(MAKE) $(AM_MAKEFLAGS) all-am
-
-.SUFFIXES:
-.SUFFIXES: .c .lo .o .obj
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
-	@for dep in $?; do \
-	  case '$(am__configure_deps)' in \
-	    *$$dep*) \
-	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-	        && { if test -f $@; then exit 0; else break; fi; }; \
-	      exit 1;; \
-	  esac; \
-	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/mbio/Makefile'; \
-	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --gnu src/mbio/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	@case '$?' in \
-	  *config.status*) \
-	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-	esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-
-mb_config.h: stamp-h1
-	@test -f $@ || rm -f stamp-h1
-	@test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1
-
-stamp-h1: $(srcdir)/mb_config.h.in $(top_builddir)/config.status
-	@rm -f stamp-h1
-	cd $(top_builddir) && $(SHELL) ./config.status src/mbio/mb_config.h
-$(srcdir)/mb_config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) 
-	($(am__cd) $(top_srcdir) && $(AUTOHEADER))
-	rm -f stamp-h1
-	touch $@
-
-distclean-hdr:
-	-rm -f mb_config.h stamp-h1
-
-install-libLTLIBRARIES: $(lib_LTLIBRARIES)
-	@$(NORMAL_INSTALL)
-	@list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
-	list2=; for p in $$list; do \
-	  if test -f $$p; then \
-	    list2="$$list2 $$p"; \
-	  else :; fi; \
-	done; \
-	test -z "$$list2" || { \
-	  echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \
-	  $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \
-	}
-
-uninstall-libLTLIBRARIES:
-	@$(NORMAL_UNINSTALL)
-	@list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
-	for p in $$list; do \
-	  $(am__strip_dir) \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \
-	done
-
-clean-libLTLIBRARIES:
-	-test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
-	@list='$(lib_LTLIBRARIES)'; \
-	locs=`for p in $$list; do echo $$p; done | \
-	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
-	      sort -u`; \
-	test -z "$$locs" || { \
-	  echo rm -f $${locs}; \
-	  rm -f $${locs}; \
-	}
-
-libmbio.la: $(libmbio_la_OBJECTS) $(libmbio_la_DEPENDENCIES) $(EXTRA_libmbio_la_DEPENDENCIES) 
-	$(AM_V_CCLD)$(libmbio_la_LINK) -rpath $(libdir) $(libmbio_la_OBJECTS) $(libmbio_la_LIBADD) $(LIBS)
-
-mostlyclean-compile:
-	-rm -f *.$(OBJEXT)
-
-distclean-compile:
-	-rm -f *.tab.c
-
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mb_absorption.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mb_access.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mb_angle.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mb_buffer.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mb_check_info.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mb_close.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mb_compare.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mb_coor_scale.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mb_defaults.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mb_error.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mb_esf.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mb_fileio.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mb_format.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mb_get.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mb_get_all.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mb_get_value.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mb_mem.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mb_navint.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mb_platform.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mb_process.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mb_proj.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mb_put_all.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mb_put_comment.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mb_read.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mb_read_init.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mb_read_ping.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mb_rt.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mb_segy.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mb_swap.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mb_time.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mb_write_init.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mb_write_ping.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbr_3ddepthp.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbr_asciixyz.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbr_bchrtunb.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbr_bchrxunb.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbr_cbat8101.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbr_cbat9001.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbr_dsl120pf.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbr_dsl120sf.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbr_edgjstar.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbr_elmk2unb.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbr_em12darw.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbr_em12ifrm.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbr_em300mba.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbr_em300raw.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbr_em710mba.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbr_em710raw.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbr_emoldraw.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbr_gsfgenmb.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbr_hir2rnav.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbr_hs10jams.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbr_hsatlraw.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbr_hsds2lam.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbr_hsds2raw.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbr_hsldedmb.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbr_hsldeoih.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbr_hsmdaraw.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbr_hsmdldih.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbr_hsunknwn.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbr_hsuricen.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbr_hsurivax.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbr_hydrob93.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbr_hypc8101.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbr_hysweep1.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbr_image83p.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbr_imagemba.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbr_l3xseraw.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbr_mbarirov.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbr_mbarrov2.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbr_mbldeoih.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbr_mbnetcdf.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbr_mbpronav.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbr_mgd77dat.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbr_mgd77tab.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbr_mgd77txt.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbr_mr1aldeo.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbr_mr1bldeo.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbr_mr1prhig.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbr_mr1prvr2.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbr_mstiffss.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbr_nvnetcdf.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbr_oicgeoda.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbr_oicmbari.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbr_omghdcsj.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbr_photgram.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbr_reson7kr.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbr_samesurf.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbr_sb2000sb.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbr_sb2000ss.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbr_sb2100bi.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbr_sb2100rw.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbr_sbifremr.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbr_sbsiocen.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbr_sbsiolsi.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbr_sbsiomrg.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbr_sbsioswb.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbr_sburicen.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbr_sburivax.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbr_segysegy.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbr_swplssxi.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbr_swplssxp.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbr_wasspenl.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbr_xtfb1624.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbr_xtfr8101.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbsys_3datdepthlidar.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbsys_atlas.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbsys_benthos.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbsys_dsl.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbsys_elac.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbsys_elacmk2.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbsys_gsf.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbsys_hdcs.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbsys_hs10.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbsys_hsds.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbsys_hsmd.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbsys_hysweep.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbsys_image83p.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbsys_jstar.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbsys_ldeoih.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbsys_mr1.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbsys_mr1b.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbsys_mr1v2001.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbsys_mstiff.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbsys_navnetcdf.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbsys_netcdf.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbsys_oic.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbsys_reson.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbsys_reson7k.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbsys_reson8k.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbsys_sb.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbsys_sb2000.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbsys_sb2100.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbsys_simrad.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbsys_simrad2.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbsys_simrad3.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbsys_singlebeam.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbsys_stereopair.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbsys_surf.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbsys_swathplus.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbsys_wassp.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbsys_xse.Plo at am__quote@
-
-.c.o:
- at am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(COMPILE) -c -o $@ $<
-
-.c.obj:
- at am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
- at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-
-.c.lo:
- at am__fastdepCC_TRUE@	$(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(LTCOMPILE) -c -o $@ $<
-
-mostlyclean-libtool:
-	-rm -f *.lo
-
-clean-libtool:
-	-rm -rf .libs _libs
-install-includeHEADERS: $(include_HEADERS)
-	@$(NORMAL_INSTALL)
-	@list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \
-	if test -n "$$list"; then \
-	  echo " $(MKDIR_P) '$(DESTDIR)$(includedir)'"; \
-	  $(MKDIR_P) "$(DESTDIR)$(includedir)" || exit 1; \
-	fi; \
-	for p in $$list; do \
-	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
-	  echo "$$d$$p"; \
-	done | $(am__base_list) | \
-	while read files; do \
-	  echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includedir)'"; \
-	  $(INSTALL_HEADER) $$files "$(DESTDIR)$(includedir)" || exit $$?; \
-	done
-
-uninstall-includeHEADERS:
-	@$(NORMAL_UNINSTALL)
-	@list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \
-	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
-	dir='$(DESTDIR)$(includedir)'; $(am__uninstall_files_from_dir)
-
-ID: $(am__tagged_files)
-	$(am__define_uniq_tagged_files); mkid -fID $$unique
-tags: tags-am
-TAGS: tags
-
-tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
-	set x; \
-	here=`pwd`; \
-	$(am__define_uniq_tagged_files); \
-	shift; \
-	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
-	  test -n "$$unique" || unique=$$empty_fix; \
-	  if test $$# -gt 0; then \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      "$$@" $$unique; \
-	  else \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      $$unique; \
-	  fi; \
-	fi
-ctags: ctags-am
-
-CTAGS: ctags
-ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
-	$(am__define_uniq_tagged_files); \
-	test -z "$(CTAGS_ARGS)$$unique" \
-	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$unique
-
-GTAGS:
-	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && $(am__cd) $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) "$$here"
-cscopelist: cscopelist-am
-
-cscopelist-am: $(am__tagged_files)
-	list='$(am__tagged_files)'; \
-	case "$(srcdir)" in \
-	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
-	  *) sdir=$(subdir)/$(srcdir) ;; \
-	esac; \
-	for i in $$list; do \
-	  if test -f "$$i"; then \
-	    echo "$(subdir)/$$i"; \
-	  else \
-	    echo "$$sdir/$$i"; \
-	  fi; \
-	done >> $(top_builddir)/cscope.files
-
-distclean-tags:
-	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	list='$(DISTFILES)'; \
-	  dist_files=`for file in $$list; do echo $$file; done | \
-	  sed -e "s|^$$srcdirstrip/||;t" \
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
-	case $$dist_files in \
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
-			   sort -u` ;; \
-	esac; \
-	for file in $$dist_files; do \
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  if test -d $$d/$$file; then \
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
-	    if test -d "$(distdir)/$$file"; then \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
-	  else \
-	    test -f "$(distdir)/$$file" \
-	    || cp -p $$d/$$file "$(distdir)/$$file" \
-	    || exit 1; \
-	  fi; \
-	done
-check-am: all-am
-check: $(BUILT_SOURCES)
-	$(MAKE) $(AM_MAKEFLAGS) check-am
-all-am: Makefile $(LTLIBRARIES) $(HEADERS) mb_config.h
-installdirs:
-	for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includedir)"; do \
-	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
-	done
-install: $(BUILT_SOURCES)
-	$(MAKE) $(AM_MAKEFLAGS) install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
-	if test -z '$(STRIP)'; then \
-	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	      install; \
-	else \
-	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
-	fi
-mostlyclean-generic:
-
-clean-generic:
-	-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
-
-distclean-generic:
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-	-test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
-
-maintainer-clean-generic:
-	@echo "This command is intended for maintainers to use"
-	@echo "it deletes files that may require special tools to rebuild."
-	-test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
-clean: clean-am
-
-clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \
-	mostlyclean-am
-
-distclean: distclean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
-	distclean-hdr distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am: install-includeHEADERS
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am: install-libLTLIBRARIES
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic \
-	mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am: uninstall-includeHEADERS uninstall-libLTLIBRARIES
-
-.MAKE: all check install install-am install-strip
-
-.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
-	clean-libLTLIBRARIES clean-libtool cscopelist-am ctags \
-	ctags-am distclean distclean-compile distclean-generic \
-	distclean-hdr distclean-libtool distclean-tags distdir dvi \
-	dvi-am html html-am info info-am install install-am \
-	install-data install-data-am install-dvi install-dvi-am \
-	install-exec install-exec-am install-html install-html-am \
-	install-includeHEADERS install-info install-info-am \
-	install-libLTLIBRARIES install-man install-pdf install-pdf-am \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-compile \
-	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-	tags tags-am uninstall uninstall-am uninstall-includeHEADERS \
-	uninstall-libLTLIBRARIES
-
-
-projections.h: Makefile
-	echo 'char *projectionfile = "$(mbsystemdatadir)/Projections.dat";' >$@
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/mbio/mb_absorption.c b/src/mbio/mb_absorption.c
deleted file mode 100644
index 107a193..0000000
--- a/src/mbio/mb_absorption.c
+++ /dev/null
@@ -1,197 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mb_absorption.c		2/10/2008
- *    $Id: mb_absorption.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 2008-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mb_absorption.c includes a "mb_" function used to calculate
- * the absorption of sound in sea water in dB/km as a
- * function of frequency, temperature, salinity, and pressure.
- *
- * We use the Francois and Garrison equations from:
- *     Francois, R.E., Garrison, G.R., "Sound absorption based
- *       on ocean measurements: Part I: Pure water and magnesium
- *       sulfate contributions", J. Acoust. Soc. Am., 72(3),
- *       896-907, 1982.
- *     Francois, R.E., Garrison, G.R., "Sound absorption based
- *       on ocean measurements: Part II: Boric acid contribution
- *       and equation for total absorption", J. Acoust. Soc. Am.,
- *       72(6), 1879-1890, 1982.
- *
- * Francois and Garrison [1982] model the sound absorption in
- * sea water as resulting from contributions from pure water,
- * magnesium sulfate, and boric acid. The boric acid contribution
- * is significant below 10 kHz. The equations are:
- *
- * absorption = Boric Acid Contribution
- * 		+ MbSO4 Contribution
- * 		+ Pure Water Contribution
- *
- * **************************
- *
- * Boric Acid Contribution
- * AlphaB = Ab * Pb * Fb * f**2
- *          -------------------
- *             f**2 + Fb**2
- *
- * Ab = 8.86 / c * 10**(0.78 * pH - 5) (dB/km/kHz)
- * Pb = 1
- * Fb = 2.8 * (S / 35)**0.5 * 10**(4 - 1245 / Tk) (kHz)
- *
- * **************************
- *
- * MgSO4 Contribution
- * AlphaM = Am * Pm * Fm * f**2
- *          -------------------
- *             f**2 + Fm**2
- *
- * Am = 21.44 * S * (1 + 0.025 * T) / c (dB/km/kHZ)
- * Pm = 1 - 0.000137 * D + 0.0000000062 * D**2
- * Fm = (8.17 * 10**(8 - 1990 / Tk)) / (1 + 0.0018 * (S - 35))  (kHz)
- *
- * **************************
- *
- * Pure Water Contribution
- * AlphaW = Aw * Pw * f**2
- *
- * For T <= 20 deg C
- *   Aw = 0.0004397 - 0.0000259 * T
- *           + 0.000000911 * T**2 - 0.000000015 * T**3 (dB/km/kHz)
- * For T > 20 deg C
- *   Aw = 0.0003964 - 0.00001146 * T
- *           + 0.000000145 * T**2 - 0.00000000049 * T**3 (dB/km/kHz)
- * Pw = 1 - 0.0000383 * D + 0.00000000049 * D**2
- *
- * **************************
- *
- * c = speed of sound (m/s)
- *   =~ 1412 + 3.21 * T + 1.19 * S + 0.0167 * D
- * T = temperature (deg C)
- * Tk = temperature (deg K) = T + 273 (deg K)
- * S = salinity (per mil)
- * D = depth (m)
- *
- * **************************
- *
- * Author:	D. W. Caress
- * Date:	February 10, 2008
- *              R/V Zephyr
- *              Hanging out at the channel entrance to La Paz, BCS, MX
- *              helping out as MBARI tries to save the grounded
- *              R/V Western Flyer.
- *              Note: as I was writing this code the Flyer was refloated
- *              and successfully backed off the reef.
- *
- * $Log: mb_absorption.c,v $
- * Revision 5.0  2008/03/01 09:19:29  caress
- * Added function to calculate sound absoprtion in water from water properties parameters.
- *
- *
- */
-
-
-/* standard include files */
-#include <stdio.h>
-#include <math.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_define.h"
-
-/*--------------------------------------------------------------------*/
-int mb_absorption(int verbose,
-		double frequency, double temperature,double salinity,
-		double depth, double ph, double soundspeed,
-		double *absorption, int *error)
-{
-	char	*function_name = "mb_absorption";
-	int	status = MB_SUCCESS;
-	double	Alphab, Alpham, Alphaw;
-	double	tk;
-	double	Ab, Pb, Fb;
-	double	Am, Pm, Fm;
-	double	Aw, Pw;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       frequency:  %f\n",frequency);
-		fprintf(stderr,"dbg2       temperature:%f\n",temperature);
-		fprintf(stderr,"dbg2       salinity:   %f\n",salinity);
-		fprintf(stderr,"dbg2       soundspeed: %f\n",soundspeed);
-		fprintf(stderr,"dbg2       depth:      %f\n",depth);
-		fprintf(stderr,"dbg2       ph:         %f\n",ph);
-		}
-
-	/* calculate sound speed if needed */
-	if (soundspeed <= 0.0)
-		soundspeed = 1412.0 + 3.21 * temperature
-				+ 1.19 * salinity + 0.0167 * depth;
-
-	/* get temperature in deg Kelvin
-		- I know the conversion is slightly wrong, but this
-			is what they published.... */
-	tk = temperature + 273.0;
-
-	/* calculate boric acid contribution */
-	Ab = 8.86 / soundspeed * pow(10.0, (0.78 * ph - 5.0));
-	Pb = 1.0;
-	Fb = 2.8 * sqrt(salinity / 35.0) * pow(10.0, (4.0 - (1245.0 / tk)));
-	Alphab = (Ab * Pb * Fb * frequency * frequency)
-			/ (Fb * Fb + frequency * frequency);
-
-	/* calculate MgSO4 contribution */
-	Am = 21.44 * salinity * (1 + 0.025 * temperature) / soundspeed;
-	Pm = 1 - 0.000137 * depth + 0.0000000062 * depth * depth;
-	Fm = (8.17 * pow(10.0, (8.0 - 1990.0 / tk))) / (1 + 0.0018 * (salinity - 35));
-	Alpham = (Am * Pm * Fm * frequency * frequency)
-			/ (Fm * Fm + frequency * frequency);
-
-	/* calculate pure water contribution */
-	if (temperature <= 20.0)
-		Aw = 0.0004397 - 0.0000259 * temperature
-			+ 0.000000911 * temperature * temperature
-			- 0.000000015 * temperature * temperature * temperature;
-	else
-		Aw = 0.0003964 - 0.00001146 * temperature
-			+ 0.000000145 * temperature * temperature
-			- 0.00000000049 * temperature * temperature * temperature;
-
-	Pw = 1 - 0.0000383 * depth + 0.00000000049 *  depth * depth;
-	Alphaw = Aw * Pw * frequency * frequency;
-
-	/* add it all together */
-	*absorption = Alphab + Alpham + Alphaw;
-
-	/* assume success */
-	*error = MB_ERROR_NO_ERROR;
-	status = MB_SUCCESS;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       absorption:      %f\n",*absorption);
-		fprintf(stderr,"dbg2       error:           %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:          %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
diff --git a/src/mbio/mb_access.c b/src/mbio/mb_access.c
deleted file mode 100644
index 7d6aabe..0000000
--- a/src/mbio/mb_access.c
+++ /dev/null
@@ -1,2673 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mb_access.c	11/1/00
- *    $Id: mb_access.c 2250 2015-06-30 02:12:26Z caress $
- *
- *    Copyright (c) 2000-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * This source file includes the functions used to extract data from
- * and insert data into sonar specific structures.
- *
- * Author:	D. W. Caress
- * Date:	October 1, 2000
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mb_define.h"
-#include "mb_segy.h"
-
-static char svn_id[]="$Id: mb_access.c 2250 2015-06-30 02:12:26Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mb_alloc(int verbose, void *mbio_ptr,
-		    void **store_ptr, int *error)
-{
-	char	*function_name = "mb_alloc";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* call appropriate memory allocation routine */
-	if (mb_io_ptr->mb_io_store_alloc != NULL)
-		{
-		status = (*mb_io_ptr->mb_io_store_alloc)
-				(verbose,mbio_ptr,store_ptr,error);
-		}
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_BAD_SYSTEM;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)*store_ptr);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_deall(int verbose, void *mbio_ptr,
-			void **store_ptr, int *error)
-{
-	char	*function_name = "mb_deall";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)*store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* call appropriate memory deallocation routine */
-	if (mb_io_ptr->mb_io_store_free != NULL)
-		{
-		status = (*mb_io_ptr->mb_io_store_free)
-				(verbose,mbio_ptr,store_ptr,error);
-		}
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_BAD_SYSTEM;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_get_store(int verbose, void *mbio_ptr,
-		    void **store_ptr, int *error)
-{
-	char	*function_name = "mb_get_store";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get store pointer */
-	*store_ptr = (void *) mb_io_ptr->store_data;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)*store_ptr);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_dimensions(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int *nbath, int *namp, int *nss, int *error)
-{
-	char	*function_name = "mb_dimensions";
-	int	status;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* call the appropriate mbsys_ extraction routine */
-	if (mb_io_ptr->mb_io_extract != NULL)
-		{
-		status = (*mb_io_ptr->mb_io_dimensions)
-				(verbose, mbio_ptr, store_ptr,
-				kind, nbath, namp, nss, error);
-		}
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_BAD_SYSTEM;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		fprintf(stderr,"dbg2       nbath:      %d\n",*nbath);
-		fprintf(stderr,"dbg2       namp:       %d\n",*namp);
-		fprintf(stderr,"dbg2       nss:        %d\n",*nss);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_pingnumber(int verbose, void *mbio_ptr,
-		int *pingnumber, int *error)
-{
-	char	*function_name = "mb_pingnumber";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* call the appropriate mbsys_ extraction routine */
-	if (mb_io_ptr->mb_io_pingnumber != NULL)
-		{
-		status = (*mb_io_ptr->mb_io_pingnumber)
-				(verbose, mbio_ptr,
-				pingnumber, error);
-		}
-	else
-		{
-		*pingnumber = mb_io_ptr->ping_count;
-		status = MB_SUCCESS;
-		*error = MB_ERROR_NO_ERROR;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       pingnumber: %d\n",*pingnumber);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_segynumber(int verbose, void *mbio_ptr,
-		int *line, int *shot, int *cdp, int *error)
-{
-	char	*function_name = "mb_segynumber";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* call the appropriate mbsys_ extraction routine */
-	if (mb_io_ptr->mb_io_segynumber != NULL)
-		{
-		status = (*mb_io_ptr->mb_io_segynumber)
-				(verbose, mbio_ptr,
-				line, shot, cdp, error);
-		}
-	else
-		{
-		*line = 0;
-		*shot = mb_io_ptr->ping_count;
-		*cdp = 0;
-		status = MB_SUCCESS;
-		*error = MB_ERROR_NO_ERROR;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       line:       %d\n",*line);
-		fprintf(stderr,"dbg2       shot:       %d\n",*shot);
-		fprintf(stderr,"dbg2       cdp:        %d\n",*cdp);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_beamwidths(int verbose, void *mbio_ptr,
-		double *beamwidth_xtrack, double *beamwidth_ltrack, int *error)
-{
-	char	*function_name = "mb_beamwidths";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:          %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:           %p\n",(void *)mbio_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* extract the values from the mb_io structure */
-	*beamwidth_xtrack = mb_io_ptr->beamwidth_xtrack;
-	*beamwidth_ltrack = mb_io_ptr->beamwidth_ltrack;
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       beamwidth_xtrack: %f\n",*beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack: %f\n",*beamwidth_ltrack);
-		fprintf(stderr,"dbg2       error:            %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:           %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_sonartype(int verbose, void *mbio_ptr, void *store_ptr,
-		int *sonartype, int *error)
-{
-	char	*function_name = "mb_sonartype";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-	
-	/* start off with sonartype unknown */
-	*sonartype = MB_TOPOGRAPHY_TYPE_UNKNOWN;
-
-	/* call the appropriate mbsys_ sonartype routine
-			mb_io_ptr->system == MB_SYS_LDEOIH
-			mb_io_ptr->system == MB_SYS_GSF
-			mb_io_ptr->system == MB_SYS_HDCS
-			mb_io_ptr->system == MB_SYS_HYSWEEP */
-	if (mb_io_ptr->mb_io_sonartype != NULL)
-		{
-		if (store_ptr == NULL)
-			store_ptr = (void *) mb_io_ptr->store_data;
-		status = (*mb_io_ptr->mb_io_sonartype)
-				(verbose, mbio_ptr, store_ptr, sonartype, error);
-		}
-
-	/* Some systems are definitively echosounders */
-	else if (mb_io_ptr->system == MB_SYS_SINGLEBEAM)
-		{
-		if (mb_io_ptr->format == MBF_ASCIIXYZ
-			|| mb_io_ptr->format == MBF_ASCIIYXZ
-			|| mb_io_ptr->format == MBF_ASCIIYXT
-			|| mb_io_ptr->format == MBF_ASCIIYXT)
-			{
-			*sonartype = MB_TOPOGRAPHY_TYPE_POINT;
-			}
-		else
-			{
-			*sonartype = MB_TOPOGRAPHY_TYPE_ECHOSOUNDER;
-			}
-		}
-
-	/* Some systems are definitively multibeams */
-	else if (mb_io_ptr->system == MB_SYS_SB
-			|| mb_io_ptr->system == MB_SYS_HSDS
-			|| mb_io_ptr->system == MB_SYS_SB2000
-			|| mb_io_ptr->system == MB_SYS_SB2100
-			|| mb_io_ptr->system == MB_SYS_SIMRAD
-			|| mb_io_ptr->system == MB_SYS_SIMRAD2
-			|| mb_io_ptr->system == MB_SYS_SIMRAD3
-			|| mb_io_ptr->system == MB_SYS_RESON
-			|| mb_io_ptr->system == MB_SYS_RESON8K
-			|| mb_io_ptr->system == MB_SYS_ELAC
-			|| mb_io_ptr->system == MB_SYS_ELACMK2
-			|| mb_io_ptr->system == MB_SYS_HSMD
-			|| mb_io_ptr->system == MB_SYS_XSE
-			|| mb_io_ptr->system == MB_SYS_NETCDF
-			|| mb_io_ptr->system == MB_SYS_HS10
-			|| mb_io_ptr->system == MB_SYS_ATLAS
-			|| mb_io_ptr->system == MB_SYS_SURF
-			|| mb_io_ptr->system == MB_SYS_RESON7K
-			|| mb_io_ptr->system == MB_SYS_WASSP)
-		{
-		*sonartype = MB_TOPOGRAPHY_TYPE_MULTIBEAM;
-		}
-
-	/* Some systems are definitively sidescans */
-	else if (mb_io_ptr->system == MB_SYS_MSTIFF
-			|| mb_io_ptr->system == MB_SYS_JSTAR
-			|| mb_io_ptr->system == MB_SYS_BENTHOS
-			|| mb_io_ptr->system == MB_SYS_IMAGE83P)
-		{
-		*sonartype = MB_TOPOGRAPHY_TYPE_SIDESCAN;
-		}
-
-	/* Some systems are definitively interferometric sonars */
-	else if (mb_io_ptr->system == MB_SYS_MR1
-			|| mb_io_ptr->system == MB_SYS_MR1B
-			|| mb_io_ptr->system == MB_SYS_MR1V2001
-			|| mb_io_ptr->system == MB_SYS_DSL
-			|| mb_io_ptr->system == MB_SYS_OIC
-			|| mb_io_ptr->system == MB_SYS_SWATHPLUS)
-		{
-		*sonartype = MB_TOPOGRAPHY_TYPE_INTERFEROMETRIC;
-		}
-
-	/* Some systems are definitively lidars */
-	else if (mb_io_ptr->system == MB_SYS_3DATDEPTHLIDAR)
-		{
-		*sonartype = MB_TOPOGRAPHY_TYPE_LIDAR;
-		}
-
-	/* Some systems are definitively stereo cameras */
-	else if (mb_io_ptr->system == MB_SYS_STEREOPAIR)
-		{
-		*sonartype = MB_TOPOGRAPHY_TYPE_CAMERA;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       sonartype:  %d\n",*sonartype);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_sidescantype(int verbose, void *mbio_ptr, void *store_ptr,
-		int *ss_type, int *error)
-{
-	char	*function_name = "mb_sidescantype";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* call the appropriate mbsys_ extraction routine */
-	if (mb_io_ptr->mb_io_sidescantype != NULL)
-		{
-		if (store_ptr == NULL)
-			store_ptr = (void *) mb_io_ptr->store_data;
-		status = (*mb_io_ptr->mb_io_sidescantype)
-				(verbose, mbio_ptr, store_ptr, ss_type, error);
-		}
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_BAD_SYSTEM;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       ss_type:    %d\n",*ss_type);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_preprocess(int verbose, void *mbio_ptr, void *store_ptr,
-		double time_d, double navlon, double navlat,
-		double speed, double heading, double sonardepth,
-		double roll, double pitch, double heave,
-		int *error)
-{
-	char	*function_name = "mb_preprocess";
-	int	status;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:       %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:      %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:     %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       time_d:        %f\n",time_d);
-		fprintf(stderr,"dbg2       longitude:     %f\n",navlon);
-		fprintf(stderr,"dbg2       latitude:      %f\n",navlat);
-		fprintf(stderr,"dbg2       speed:         %f\n",speed);
-		fprintf(stderr,"dbg2       heading:       %f\n",heading);
-		fprintf(stderr,"dbg2       sonardepth:    %f\n",sonardepth);
-		fprintf(stderr,"dbg2       roll:          %f\n",roll);
-		fprintf(stderr,"dbg2       pitch:         %f\n",pitch);
-		fprintf(stderr,"dbg2       heave:         %f\n",heave);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* call the appropriate mbsys_ extraction routine */
-	if (mb_io_ptr->mb_io_preprocess != NULL)
-		{
-		status = (*mb_io_ptr->mb_io_preprocess)
-				(verbose, mbio_ptr, store_ptr,
-				time_d, navlon, navlat,
-				speed, heading, sonardepth,
-				roll, pitch, heave, error);
-		}
-		
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_BAD_SYSTEM;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:         %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:        %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_extract(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int time_i[7], double *time_d,
-		double *navlon, double *navlat,
-		double *speed, double *heading,
-		int *nbath, int *namp, int *nss,
-		char *beamflag, double *bath, double *amp,
-		double *bathacrosstrack, double *bathalongtrack,
-		double *ss, double *ssacrosstrack, double *ssalongtrack,
-		char *comment, int *error)
-{
-	char	*function_name = "mb_extract";
-	int	status;
-	struct mb_io_struct *mb_io_ptr;
-	double	easting, northing;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* call the appropriate mbsys_ extraction routine */
-	if (mb_io_ptr->mb_io_extract != NULL)
-		{
-		status = (*mb_io_ptr->mb_io_extract)
-				(verbose, mbio_ptr, store_ptr,
-				kind, time_i, time_d,
-				navlon, navlat,
-				speed, heading,
-				nbath, namp, nss,
-				beamflag, bath, amp,
-				bathacrosstrack, bathalongtrack,
-				ss, ssacrosstrack, ssalongtrack,
-				comment, error);
-		}
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_BAD_SYSTEM;
-		}
-
-	/* apply projection and lonflip if necessary */
-	if (status == MB_SUCCESS)
-		{
-		/* apply inverse projection if required */
-		if (mb_io_ptr->projection_initialized == MB_YES)
-			{
-			easting = *navlon;
-			northing = *navlat;
-			mb_proj_inverse(verbose, mb_io_ptr->pjptr,
-							easting, northing,
-							navlon, navlat,
-							error);
-			}
-
-		/* apply lonflip */
-		if (mb_io_ptr->lonflip < 0)
-			{
-			if (*navlon > 0.)
-				*navlon = *navlon - 360.;
-			else if (*navlon < -360.)
-				*navlon = *navlon + 360.;
-			}
-		else if (mb_io_ptr->lonflip == 0)
-			{
-			if (*navlon > 180.)
-				*navlon = *navlon - 360.;
-			else if (*navlon < -180.)
-				*navlon = *navlon + 360.;
-			}
-		else
-			{
-			if (*navlon > 360.)
-				*navlon = *navlon - 360.;
-			else if (*navlon < 0.)
-				*navlon = *navlon + 360.;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind == MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"dbg2       comment:     \ndbg2       %s\n",
-			comment);
-		}
-	else if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind != MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"dbg2       time_i[0]:     %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:     %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:     %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:     %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:     %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:     %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:     %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:        %f\n",*time_d);
-		fprintf(stderr,"dbg2       longitude:     %f\n",*navlon);
-		fprintf(stderr,"dbg2       latitude:      %f\n",*navlat);
-		fprintf(stderr,"dbg2       speed:         %f\n",*speed);
-		fprintf(stderr,"dbg2       heading:       %f\n",*heading);
-		}
-	if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind == MB_DATA_DATA)
-		{
-		fprintf(stderr,"dbg2       nbath:      %d\n",
-			*nbath);
-		for (i=0;i<*nbath;i++)
-		  fprintf(stderr,"dbg2       beam:%d  flag:%3d  bath:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,beamflag[i],bath[i],
-			bathacrosstrack[i],bathalongtrack[i]);
-		fprintf(stderr,"dbg2        namp:     %d\n",
-			*namp);
-		for (i=0;i<*namp;i++)
-		  fprintf(stderr,"dbg2       beam:%d   amp:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,amp[i],bathacrosstrack[i],bathalongtrack[i]);
-		fprintf(stderr,"dbg2        nss:      %d\n",
-			*nss);
-		for (i=0;i<*nss;i++)
-		  fprintf(stderr,"dbg2        pixel:%d   ss:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,ss[i],ssacrosstrack[i],ssalongtrack[i]);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_insert(int verbose, void *mbio_ptr, void *store_ptr,
-		int kind, int time_i[7], double time_d,
-		double navlon, double navlat,
-		double speed, double heading,
-		int nbath, int namp, int nss,
-		char *beamflag, double *bath, double *amp,
-		double *bathacrosstrack, double *bathalongtrack,
-		double *ss, double *ssacrosstrack, double *ssalongtrack,
-		char *comment, int *error)
-{
-	char	*function_name = "mb_insert";
-	int	status;
-	struct mb_io_struct *mb_io_ptr;
-	double	easting, northing;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       kind:       %d\n",kind);
-		}
-	if (verbose >= 2 && (kind == MB_DATA_DATA || kind == MB_DATA_NAV))
-		{
-		fprintf(stderr,"dbg2       time_i[0]:  %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:  %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:  %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:  %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:  %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:  %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:  %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:     %f\n",time_d);
-		fprintf(stderr,"dbg2       navlon:     %f\n",navlon);
-		fprintf(stderr,"dbg2       navlat:     %f\n",navlat);
-		fprintf(stderr,"dbg2       speed:      %f\n",speed);
-		fprintf(stderr,"dbg2       heading:    %f\n",heading);
-		}
-	if (verbose >= 2 && kind == MB_DATA_DATA)
-		{
-		fprintf(stderr,"dbg2       nbath:      %d\n",nbath);
-		if (verbose >= 3)
-		 for (i=0;i<nbath;i++)
-		  fprintf(stderr,"dbg3       beam:%d  flag:%3d  bath:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,beamflag[i],bath[i],
-			bathacrosstrack[i],bathalongtrack[i]);
-		fprintf(stderr,"dbg2       namp:       %d\n",namp);
-		if (verbose >= 3)
-		 for (i=0;i<namp;i++)
-		  fprintf(stderr,"dbg3        beam:%d   amp:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,amp[i],bathacrosstrack[i],bathalongtrack[i]);
-		fprintf(stderr,"dbg2        nss:       %d\n",nss);
-		if (verbose >= 3)
-		 for (i=0;i<nss;i++)
-		  fprintf(stderr,"dbg3        pixel:%d   ss:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,ss[i],ssacrosstrack[i],ssalongtrack[i]);
-		}
-	if (verbose >= 2 && kind == MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"dbg2       comment:     \ndbg2       %s\n",
-			comment);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* check that io arrays are large enough, allocate larger arrays if necessary */
-	if (nbath > mb_io_ptr->beams_bath_alloc
-		|| namp > mb_io_ptr->beams_amp_alloc
-		|| nss > mb_io_ptr->pixels_ss_alloc)
-		{
-		status = mb_update_arrays(verbose, mbio_ptr,
-			nbath, namp, nss, error);
-		}
-	mb_io_ptr->beams_bath_max = MAX(mb_io_ptr->beams_bath_max, nbath);
-	mb_io_ptr->beams_amp_max = MAX(mb_io_ptr->beams_amp_max, namp);
-	mb_io_ptr->pixels_ss_max = MAX(mb_io_ptr->pixels_ss_max, nss);
-
-	/* apply inverse projection if required */
-	if (mb_io_ptr->projection_initialized == MB_YES)
-		{
-		mb_proj_forward(verbose, mb_io_ptr->pjptr,
-						navlon, navlat,
-						&easting, &northing,
-						error);
-		navlon = easting;
-		navlat = northing;
-		}
-
-	/* call the appropriate mbsys_ insertion routine */
-	if (mb_io_ptr->mb_io_insert != NULL)
-		{
-		status = (*mb_io_ptr->mb_io_insert)
-				(verbose, mbio_ptr, store_ptr,
-				kind, time_i, time_d,
-				navlon, navlat,
-				speed, heading,
-				nbath, namp, nss,
-				beamflag, bath, amp,
-				bathacrosstrack, bathalongtrack,
-				ss, ssacrosstrack, ssalongtrack,
-				comment, error);
-		}
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_BAD_SYSTEM;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:             %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:            %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_extract_nav(int verbose, void *mbio_ptr, void *store_ptr, int *kind,
-	int time_i[7], double *time_d,
-	double *navlon, double *navlat,
-	double *speed, double *heading, double *draft,
-	double *roll, double *pitch, double *heave,
-	int *error)
-{
-	char	*function_name = "mb_extract_nav";
-	int	status;
-	struct mb_io_struct *mb_io_ptr;
-	double	easting, northing;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* call the appropriate mbsys_ extraction routine */
-	if (mb_io_ptr->mb_io_extract_nav != NULL)
-		{
-		status = (*mb_io_ptr->mb_io_extract_nav)
-				(verbose,mbio_ptr,store_ptr,
-				kind,time_i,time_d,
-				navlon,navlat,
-				speed,heading,draft,
-				roll,pitch,heave,
-				error);
-		}
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_BAD_SYSTEM;
-		}
-
-	/* apply projection and lonflip if necessary */
-	if (status == MB_SUCCESS)
-		{
-		/* apply inverse projection if required */
-		if (mb_io_ptr->projection_initialized == MB_YES)
-			{
-			easting = *navlon;
-			northing = *navlat;
-			mb_proj_inverse(verbose, mb_io_ptr->pjptr,
-							easting, northing,
-							navlon, navlat,
-							error);
-			}
-
-		/* apply lonflip */
-		if (mb_io_ptr->lonflip < 0)
-			{
-			if (*navlon > 0.)
-				*navlon = *navlon - 360.;
-			else if (*navlon < -360.)
-				*navlon = *navlon + 360.;
-			}
-		else if (mb_io_ptr->lonflip == 0)
-			{
-			if (*navlon > 180.)
-				*navlon = *navlon - 360.;
-			else if (*navlon < -180.)
-				*navlon = *navlon + 360.;
-			}
-		else
-			{
-			if (*navlon > 360.)
-				*navlon = *navlon - 360.;
-			else if (*navlon < 0.)
-				*navlon = *navlon + 360.;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		fprintf(stderr,"dbg2       time_i[0]:     %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:     %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:     %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:     %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:     %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:     %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:     %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:        %f\n",*time_d);
-		fprintf(stderr,"dbg2       longitude:     %f\n",*navlon);
-		fprintf(stderr,"dbg2       latitude:      %f\n",*navlat);
-		fprintf(stderr,"dbg2       speed:         %f\n",*speed);
-		fprintf(stderr,"dbg2       heading:       %f\n",*heading);
-		fprintf(stderr,"dbg2       draft:         %f\n",*draft);
-		fprintf(stderr,"dbg2       roll:          %f\n",*roll);
-		fprintf(stderr,"dbg2       pitch:         %f\n",*pitch);
-		fprintf(stderr,"dbg2       heave:         %f\n",*heave);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_extract_nnav(int verbose, void *mbio_ptr, void *store_ptr,
-	int nmax, int *kind, int *n,
-	int *time_i, double *time_d,
-	double *navlon, double *navlat,
-	double *speed, double *heading, double *draft,
-	double *roll, double *pitch, double *heave,
-	int *error)
-{
-	char	*function_name = "mb_extract_nnav";
-	int	status;
-	struct mb_io_struct *mb_io_ptr;
-	double	easting, northing;
-	int	i, inav;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* call the appropriate mbsys_ extraction routine */
-	if (mb_io_ptr->mb_io_extract_nnav != NULL)
-		{
-		status = (*mb_io_ptr->mb_io_extract_nnav)
-				(verbose,mbio_ptr,store_ptr,
-				nmax,kind,n,
-				time_i,time_d,
-				navlon,navlat,
-				speed,heading,draft,
-				roll,pitch,heave,
-				error);
-		}
-	else if (mb_io_ptr->mb_io_extract_nav != NULL)
-		{
-		status = (*mb_io_ptr->mb_io_extract_nav)
-				(verbose,mbio_ptr,store_ptr,
-				kind,time_i,time_d,
-				navlon,navlat,
-				speed,heading,draft,
-				roll,pitch,heave,
-				error);
-		if (status == MB_SUCCESS)
-			*n = 1;
-		else
-			*n = 0;
-		}
-	else
-		{
-		*n = 0;
-		status = MB_FAILURE;
-		*error = MB_ERROR_BAD_SYSTEM;
-		}
-
-	/* if call was made for an unsupported record type ("kind") then try to get the
-		values out of the asynchronous data interpolation buffers
-		The time stamp must be sensible for this to work. */
-	if (status == MB_FAILURE && *error == MB_ERROR_OTHER && *time_d > 0.0)
-		{
-		/* reset status */
-		status = MB_SUCCESS;
-		*error = MB_ERROR_NO_ERROR;
-
-		/* get number of available navigation values */
-		*n = 1;
-
-		/* get heading */
-		status = mb_hedint_interp(verbose, mbio_ptr, *time_d, heading, error);
-
-		/* get longitude, latitude, and speed */
-		*speed = 0.0;
-		if (status == MB_SUCCESS)
-		status = mb_navint_interp(verbose, mbio_ptr, *time_d, *heading, *speed,
-				   navlon, navlat, speed, error);
-
-		/* get roll pitch and heave */
-		if (status == MB_SUCCESS)
-		status = mb_attint_interp(verbose, mbio_ptr, *time_d,
-				    &(heave[0]), &(roll[0]), &(pitch[0]), error);
-
-		/* get draft  */
-		if (status == MB_SUCCESS)
-		status = mb_depint_interp(verbose, mbio_ptr, *time_d,
-				    draft, error);
-
-		/* get roll pitch and heave */
-		if (status == MB_SUCCESS)
-		status = mb_attint_interp(verbose, mbio_ptr, *time_d,
-				    heave, roll, pitch, error);
-		}
-
-	/* apply projection and lonflip if necessary */
-	if (status == MB_SUCCESS)
-		{
-		for (inav=0;inav<*n;inav++)
-			{
-			/* apply inverse projection if required */
-			if (mb_io_ptr->projection_initialized == MB_YES)
-				{
-				easting = navlon[inav];
-				northing = navlat[inav];
-				mb_proj_inverse(verbose, mb_io_ptr->pjptr,
-								easting, northing,
-								&(navlon[inav]), &(navlat[inav]),
-								error);
-				}
-
-			/* apply lonflip */
-			if (mb_io_ptr->lonflip < 0)
-				{
-				if (navlon[inav] > 0.)
-					navlon[inav] = navlon[inav] - 360.;
-				else if (navlon[inav] < -360.)
-					navlon[inav] = navlon[inav] + 360.;
-				}
-			else if (mb_io_ptr->lonflip == 0)
-				{
-				if (navlon[inav] > 180.)
-					navlon[inav] = navlon[inav] - 360.;
-				else if (navlon[inav] < -180.)
-					navlon[inav] = navlon[inav] + 360.;
-				}
-			else
-				{
-				if (navlon[inav] > 360.)
-					navlon[inav] = navlon[inav] - 360.;
-				else if (navlon[inav] < 0.)
-					navlon[inav] = navlon[inav] + 360.;
-				}
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		fprintf(stderr,"dbg2       n:          %d\n",*n);
-		for (inav=0;inav<*n;inav++)
-			{
-			for (i=0;i<7;i++)
-				fprintf(stderr,"dbg2       %d time_i[%d]:     %d\n",inav,i,time_i[inav * 7 + i]);
-			fprintf(stderr,"dbg2       %d time_d:        %f\n",inav,time_d[inav]);
-			fprintf(stderr,"dbg2       %d longitude:     %f\n",inav,navlon[inav]);
-			fprintf(stderr,"dbg2       %d latitude:      %f\n",inav,navlat[inav]);
-			fprintf(stderr,"dbg2       %d speed:         %f\n",inav,speed[inav]);
-			fprintf(stderr,"dbg2       %d heading:       %f\n",inav,heading[inav]);
-			fprintf(stderr,"dbg2       %d draft:         %f\n",inav,draft[inav]);
-			fprintf(stderr,"dbg2       %d roll:          %f\n",inav,roll[inav]);
-			fprintf(stderr,"dbg2       %d pitch:         %f\n",inav,pitch[inav]);
-			fprintf(stderr,"dbg2       %d heave:         %f\n",inav,heave[inav]);
-			}
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_insert_nav(int verbose, void *mbio_ptr, void *store_ptr,
-	int time_i[7], double time_d,
-	double navlon, double navlat,
-	double speed, double heading, double draft,
-	double roll, double pitch, double heave,
-	int *error)
-{
-	char	*function_name = "mb_insert_nav";
-	int	status;
-	struct mb_io_struct *mb_io_ptr;
-	double	easting, northing;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:       %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:        %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:     %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       time_i[0]:     %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:     %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:     %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:     %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:     %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:     %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:     %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:        %f\n",time_d);
-		fprintf(stderr,"dbg2       longitude:     %f\n",navlon);
-		fprintf(stderr,"dbg2       latitude:      %f\n",navlat);
-		fprintf(stderr,"dbg2       speed:         %f\n",speed);
-		fprintf(stderr,"dbg2       heading:       %f\n",heading);
-		fprintf(stderr,"dbg2       draft:         %f\n",draft);
-		fprintf(stderr,"dbg2       roll:          %f\n",roll);
-		fprintf(stderr,"dbg2       pitch:         %f\n",pitch);
-		fprintf(stderr,"dbg2       heave:         %f\n",heave);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* apply inverse projection if required */
-	if (mb_io_ptr->projection_initialized == MB_YES)
-		{
-		mb_proj_forward(verbose, mb_io_ptr->pjptr,
-						navlon, navlat,
-						&easting, &northing,
-						error);
-		navlon = easting;
-		navlat = northing;
-		}
-
-	/* call the appropriate mbsys_ insertion routine */
-	if (mb_io_ptr->mb_io_insert_nav != NULL)
-		{
-		status = (*mb_io_ptr->mb_io_insert_nav)
-				(verbose,mbio_ptr,store_ptr,
-				time_i,time_d,
-				navlon,navlat,
-				speed,heading,draft,
-				roll,pitch,heave,
-				error);
-		}
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_BAD_SYSTEM;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_extract_altitude(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind,
-		double *transducer_depth, double *altitude,
-		int *error)
-{
-	char	*function_name = "mb_extract_altitude";
-	int	status;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* call the appropriate mbsys_ extraction routine */
-	if (mb_io_ptr->mb_io_extract_altitude != NULL)
-		{
-		status = (*mb_io_ptr->mb_io_extract_altitude)
-				(verbose,mbio_ptr,store_ptr,
-				kind,transducer_depth,altitude,error);
-		}
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_BAD_SYSTEM;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:              %d\n",*kind);
-		fprintf(stderr,"dbg2       transducer_depth:  %f\n",*transducer_depth);
-		fprintf(stderr,"dbg2       altitude:          %f\n",*altitude);
-		fprintf(stderr,"dbg2       error:             %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:            %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_insert_altitude(int verbose, void *mbio_ptr, void *store_ptr,
-		double transducer_depth, double altitude,
-		int *error)
-{
-	char	*function_name = "mb_insert_altitude";
-	int	status;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:           %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:            %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:         %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       transducer_depth:  %f\n",transducer_depth);
-		fprintf(stderr,"dbg2       altitude:          %f\n",altitude);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* call the appropriate mbsys_ insertion routine */
-	if (mb_io_ptr->mb_io_insert_altitude != NULL)
-		{
-		status = (*mb_io_ptr->mb_io_insert_altitude)
-				(verbose,mbio_ptr,store_ptr,
-				transducer_depth,altitude,error);
-		}
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_BAD_SYSTEM;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:             %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:            %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_extract_svp(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind,
-		int *nsvp,
-		double *depth, double *velocity,
-		int *error)
-{
-	char	*function_name = "mb_extract_svp";
-	int	status;
-	struct mb_io_struct *mb_io_ptr;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* call the appropriate mbsys_ extraction routine */
-	if (mb_io_ptr->mb_io_extract_svp != NULL)
-		{
-		status = (*mb_io_ptr->mb_io_extract_svp)
-				(verbose,mbio_ptr,store_ptr,
-				kind,nsvp,depth,velocity,error);
-		}
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_BAD_SYSTEM;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:              %d\n",*kind);
-		fprintf(stderr,"dbg2       nsvp:              %d\n",*nsvp);
-		for (i=0;i<*nsvp;i++)
-		    fprintf(stderr,"dbg2       depth[%d]: %f   velocity[%d]: %f\n",i, depth[i], i, velocity[i]);
-		fprintf(stderr,"dbg2       error:             %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:            %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_insert_svp(int verbose, void *mbio_ptr, void *store_ptr,
-		int nsvp,
-		double *depth, double *velocity,
-		int *error)
-{
-	char	*function_name = "mb_insert_svp";
-	int	status;
-	struct mb_io_struct *mb_io_ptr;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:           %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:            %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:         %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       nsvp:              %d\n",nsvp);
-		for (i=0;i<nsvp;i++)
-		    fprintf(stderr,"dbg2       depth[%d]: %f   velocity[%d]: %f\n",i, depth[i], i, velocity[i]);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* call the appropriate mbsys_ insertion routine */
-	if (mb_io_ptr->mb_io_insert_svp != NULL)
-		{
-		status = (*mb_io_ptr->mb_io_insert_svp)
-				(verbose,mbio_ptr,store_ptr,
-				nsvp,depth,velocity,error);
-		}
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_BAD_SYSTEM;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:             %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:            %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-/*
- * mb_ttimes() calls the appropriate mbsys_ routine for
- * extracting travel times and  beam angles from
- * a stored survey data ping.
- *
- * The coordinates of the beam angles can be a bit confusing.
- * The angles are returned in "takeoff angle coordinates"
- * appropriate for raytracing. The array angles contains the
- * angle from vertical (theta below) and the array angles_forward
- * contains the angle from acrosstrack (phi below). This
- * coordinate system is distinct from the roll-pitch coordinates
- * appropriate for correcting roll and pitch values. The following
- * is a description of these relevent coordinate systems:
- *
- * Notes on Coordinate Systems used in MB-System
- *
- * David W. Caress
- * April 22, 1996
- * R/V Maurice Ewing, EW9602
- *
- * I. Introduction
- * ---------------
- * The coordinate systems described below are used
- * within MB-System for calculations involving
- * the location in space of depth, amplitude, or
- * sidescan data. In all cases the origin of the
- * coordinate system is at the center of the sonar
- * transducers.
- *
- * II. Cartesian Coordinates
- * -------------------------
- * The cartesian coordinate system used in MB-System
- * is a bit odd because it is left-handed, as opposed
- * to the right-handed x-y-z space conventionally
- * used in most circumstances. With respect to the
- * sonar (or the ship on which the sonar is mounted),
- * the x-axis is athwartships with positive to starboard
- * (to the right if facing forward), the y-axis is
- * fore-aft with positive forward, and the z-axis is
- * positive down.
- *
- * III. Spherical Coordinates
- * --------------------------
- * There are two non-traditional spherical coordinate
- * systems used in MB-System. The first, referred to here
- * as takeoff angle coordinates, is useful for raytracing.
- * The second, referred to here as roll-pitch
- * coordinates, is useful for taking account of
- * corrections to roll and pitch angles.
- *
- * 1. Takeoff Angle Coordinates
- * ----------------------------
- * The three parameters are r, theta, and phi, where
- * r is the distance from the origin, theta is the
- * angle from vertical down (that is, from the
- * positive z-axis), and phi is the angle from
- * acrosstrack (the positive x-axis) in the x-y plane.
- * Note that theta is always positive; the direction
- * in the x-y plane is given by phi.
- * Raytracing is simple in these coordinates because
- * the ray takeoff angle is just theta. However,
- * applying roll or pitch corrections is complicated because
- * roll and pitch have components in both theta and phi.
- *
- * 	0 <= theta <= PI/2
- * 	-PI/2 <= phi <= 3*PI/2
- *
- * 	x = r * SIN(theta) * COS(phi)
- * 	y = r * SIN(theta) * SIN(phi)
- * 	z = r * COS(theta)
- *
- * 	theta = 0    ---> vertical, along positive z-axis
- * 	theta = PI/2 ---> horizontal, in x-y plane
- * 	phi = -PI/2  ---> aft, in y-z plane with y negative
- * 	phi = 0      ---> port, in x-z plane with x positive
- * 	phi = PI/2   ---> forward, in y-z plane with y positive
- * 	phi = PI     ---> starboard, in x-z plane with x negative
- * 	phi = 3*PI/2 ---> aft, in y-z plane with y negative
- *
- * 2. Roll-Pitch Coordinates
- * -------------------------
- * The three parameters are r, alpha, and beta, where
- * r is the distance from the origin, alpha is the angle
- * forward (effectively pitch angle), and beta is the
- * angle from horizontal in the x-z plane (effectively
- * roll angle). Applying a roll or pitch correction is
- * simple in these coordinates because pitch is just alpha
- * and roll is just beta. However, raytracing is complicated
- * because deflection from vertical has components in both
- * alpha and beta.
- *
- * 	-PI/2 <= alpha <= PI/2
- * 	0 <= beta <= PI
- *
- * 	x = r * COS(alpha) * COS(beta)
- * 	y = r * SIN(alpha)
- * 	z = r * COS(alpha) * SIN(beta)
- *
- * 	alpha = -PI/2 ---> horizontal, in x-y plane with y negative
- * 	alpha = 0     ---> ship level, zero pitch, in x-z plane
- * 	alpha = PI/2  ---> horizontal, in x-y plane with y positive
- * 	beta = 0      ---> starboard, along positive x-axis
- * 	beta = PI/2   ---> in y-z plane rotated by alpha
- * 	beta = PI     ---> port, along negative x-axis
- *
- * IV. SeaBeam Coordinates
- * ----------------------
- * The per-beam parameters in the SB2100 data format include
- * angle-from-vertical and angle-forward. Angle-from-vertical
- * is the same as theta except that it is signed based on
- * the acrosstrack direction (positive to starboard, negative
- * to port). The angle-forward values are also defined
- * slightly differently from phi, in that angle-forward is
- * signed differently on the port and starboard sides. The
- * SeaBeam 2100 External Interface Specifications document
- * includes both discussion and figures illustrating the
- * angle-forward value. To summarize:
- *
- *     Port:
- *
- * 	theta = absolute value of angle-from-vertical
- *
- * 	-PI/2 <= phi <= PI/2
- * 	is equivalent to
- * 	-PI/2 <= angle-forward <= PI/2
- *
- * 	phi = -PI/2 ---> angle-forward = -PI/2 (aft)
- * 	phi = 0     ---> angle-forward = 0     (starboard)
- * 	phi = PI/2  ---> angle-forward = PI/2  (forward)
- *
- *     Starboard:
- *
- * 	theta = angle-from-vertical
- *
- * 	PI/2 <= phi <= 3*PI/2
- * 	is equivalent to
- * 	-PI/2 <= angle-forward <= PI/2
- *
- * 	phi = PI/2   ---> angle-forward = -PI/2 (forward)
- * 	phi = PI     ---> angle-forward = 0     (port)
- * 	phi = 3*PI/2 ---> angle-forward = PI/2  (aft)
- *
- * V. Usage of Coordinate Systems in MB-System
- * ------------------------------------------
- * Some sonar data formats provide angle values along with
- * travel times. The angles are converted to takoff-angle
- * coordinates regardless of the  storage form of the
- * particular data format. Currently, most data formats
- * do not contain an alongtrack component to the position
- * values; in these cases the conversion is trivial since
- * phi = beta = 0 and theta = alpha. The angle and travel time
- * values can be accessed using the MBIO function mb_ttimes.
- * All angle values passed by MB-System functions are in
- * degrees rather than radians.
- *
- * The programs mbbath and mbvelocitytool use angles in
- * take-off angle coordinates to do the raytracing. If roll
- * and/or pitch corrections are to be made, the angles are
- * converted to roll-pitch coordinates, corrected, and then
- * converted back prior to raytracing.
- *
- * The SeaBeam patch test tool SeaPatch calculates angles
- * in roll-pitch coordinates from the initial bathymetry
- * and then applies whatever roll and pitch corrections are
- * set interactively by the user.
- *
-*
- */
-/*--------------------------------------------------------------------*/
-int mb_ttimes(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, int *nbeams,
-	double *ttimes, double	*angles,
-	double *angles_forward, double *angles_null,
-	double *heave, double *alongtrack_offset,
-	double *draft, double *ssv, int *error)
-{
-	char	*function_name = "mb_ttimes";
-	int	status;
-	struct mb_io_struct *mb_io_ptr;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* call the appropriate mbsys_ extraction routine */
-	if (mb_io_ptr->mb_io_ttimes != NULL)
-		{
-		status = (*mb_io_ptr->mb_io_ttimes)
-				(verbose,mbio_ptr,store_ptr,
-				kind,nbeams,ttimes,
-				angles,angles_forward,angles_null,
-				heave,alongtrack_offset,
-				draft,ssv,error);
-		}
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_BAD_SYSTEM;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error == MB_ERROR_NO_ERROR)
-		{
-		fprintf(stderr,"dbg2       draft:      %f\n",*draft);
-		fprintf(stderr,"dbg2       ssv:        %f\n",*ssv);
-		fprintf(stderr,"dbg2       nbeams:     %d\n",*nbeams);
-		for (i=0;i<*nbeams;i++)
-			fprintf(stderr,"dbg2       beam %d: tt:%f  angle_xtrk:%f  angle_ltrk:%f  angle_null:%f  heave:%f  ltrk_off:%f\n",
-				i,ttimes[i],angles[i],
-				angles_forward[i],angles_null[i],
-				heave[i],alongtrack_offset[i]);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_detects(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, int *nbeams, int *detects, int *error)
-{
-	char	*function_name = "mb_detects";
-	int	status;
-	struct mb_io_struct *mb_io_ptr;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* call the appropriate mbsys_ extraction routine */
-	if (mb_io_ptr->mb_io_detects != NULL)
-		{
-		status = (*mb_io_ptr->mb_io_detects)
-				(verbose,mbio_ptr,store_ptr,
-				kind,nbeams,detects,error);
-		}
-	else
-		{
-		for (i=0;i<*nbeams;i++)
-			detects[i] = MB_DETECT_UNKNOWN;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error == MB_ERROR_NO_ERROR)
-		{
-		fprintf(stderr,"dbg2       nbeams:     %d\n",*nbeams);
-		for (i=0;i<*nbeams;i++)
-			fprintf(stderr,"dbg2       beam %d: detects:%d\n",
-				i,detects[i]);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_pulses(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, int *nbeams, int *pulses, int *error)
-{
-	char	*function_name = "mb_pulses";
-	int	status;
-	struct mb_io_struct *mb_io_ptr;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* call the appropriate mbsys_ extraction routine */
-	if (mb_io_ptr->mb_io_pulses != NULL)
-		{
-		status = (*mb_io_ptr->mb_io_pulses)
-				(verbose,mbio_ptr,store_ptr,
-				kind,nbeams,pulses,error);
-		}
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_BAD_SYSTEM;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error == MB_ERROR_NO_ERROR)
-		{
-		fprintf(stderr,"dbg2       nbeams:     %d\n",*nbeams);
-		for (i=0;i<*nbeams;i++)
-			fprintf(stderr,"dbg2       beam %d: pulses:%d\n",
-				i,pulses[i]);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_gains(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, double *transmit_gain, double *pulse_length,
-	double *receive_gain, int *error)
-{
-	char	*function_name = "mb_gains";
-	int	status;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* call the appropriate mbsys_ extraction routine */
-	if (mb_io_ptr->mb_io_gains != NULL)
-		{
-		status = (*mb_io_ptr->mb_io_gains)
-				(verbose,mbio_ptr,store_ptr,
-				kind,transmit_gain,pulse_length,receive_gain,error);
-		}
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_BAD_SYSTEM;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error == MB_ERROR_NO_ERROR)
-		{
-		fprintf(stderr,"dbg2       transmit_gain: %f\n",*transmit_gain);
-		fprintf(stderr,"dbg2       pulse_length:  %f\n",*pulse_length);
-		fprintf(stderr,"dbg2       receive_gain:  %f\n",*receive_gain);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-	int mb_extract_rawssdimensions(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, double *sample_interval,
-		int *num_samples_port, int *num_samples_stbd, int *error)
-{
-	char	*function_name = "mb_io_extract_rawsssdimensions";
-	int	status;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* call the appropriate mbsys_ extraction routine */
-	if (mb_io_ptr->mb_io_extract_rawssdimensions != NULL)
-		{
-		status = (*mb_io_ptr->mb_io_extract_rawssdimensions)
-				(verbose,mbio_ptr,store_ptr,
-				kind,sample_interval,
-				num_samples_port,num_samples_stbd,error);
-		}
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_BAD_SYSTEM;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:              %d\n",*kind);
-		fprintf(stderr,"dbg2       sample_interval:   %lf\n",*sample_interval);
-		fprintf(stderr,"dbg2       num_samples_port:  %d\n",*num_samples_port);
-		fprintf(stderr,"dbg2       num_samples_stbd:  %d\n",*num_samples_stbd);
-		fprintf(stderr,"dbg2       error:             %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:            %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_extract_rawss(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int *sidescan_type, double *sample_interval,
-		double *beamwidth_xtrack, double *beamwidth_ltrack,
-		int *num_samples_port, double *rawss_port, 
-		int *num_samples_stbd, double *rawss_stbd, int *error)
-{
-	char	*function_name = "mb_extract_rawss";
-	int	status;
-	struct mb_io_struct *mb_io_ptr;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* call the appropriate mbsys_ extraction routine */
-	if (mb_io_ptr->mb_io_extract_rawss != NULL)
-		{
-		status = (*mb_io_ptr->mb_io_extract_rawss)
-				(verbose, mbio_ptr, store_ptr,
-				kind, sidescan_type, sample_interval,
-				beamwidth_xtrack, beamwidth_ltrack,
-				num_samples_port, rawss_port,
-				num_samples_stbd, rawss_stbd,
-				error);
-		}
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_BAD_SYSTEM;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:              %d\n",*kind);
-		fprintf(stderr,"dbg2       sidescan_type:     %d\n",*sidescan_type);
-		fprintf(stderr,"dbg2       sample_interval:   %lf\n",*sample_interval);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:  %lf\n",*beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:  %lf\n",*beamwidth_ltrack);
-		fprintf(stderr,"dbg2       num_samples_port:  %d\n",*num_samples_port);
-		for (i=0;i<*num_samples_port;i++)
-		    fprintf(stderr,"dbg2       sample: %d  rawss_port:%f\n",
-			    i, rawss_port[i]);
-		fprintf(stderr,"dbg2       num_samples_stbd:  %d\n",*num_samples_stbd);
-		for (i=0;i<*num_samples_stbd;i++)
-		    fprintf(stderr,"dbg2       sample: %d  rawss_stbd:%f\n",
-			    i, rawss_stbd[i]);
-		fprintf(stderr,"dbg2       error:             %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:            %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_insert_rawss(int verbose, void *mbio_ptr, void *store_ptr,
-		int kind, int sidescan_type, double sample_interval,
-		double beamwidth_xtrack, double beamwidth_ltrack,
-		int num_samples_port, double *rawss_port,
-		int num_samples_stbd, double *rawss_stbd, int *error)
-{
-	char	*function_name = "mb_insert_rawss";
-	int	status;
-	struct mb_io_struct *mb_io_ptr;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:           %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:            %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:         %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       kind:              %d\n",kind);
-		fprintf(stderr,"dbg2       sidescan_type:     %d\n",sidescan_type);
-		fprintf(stderr,"dbg2       sample_interval:   %lf\n",sample_interval);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:  %lf\n",beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:  %lf\n",beamwidth_ltrack);
-		fprintf(stderr,"dbg2       num_samples_port:  %d\n",num_samples_port);
-		for (i=0;i<num_samples_port;i++)
-		    fprintf(stderr,"dbg2       sample: %d  rawss_port:%f\n",
-			    i, rawss_port[i]);
-		fprintf(stderr,"dbg2       num_samples_stbd:  %d\n",num_samples_stbd);
-		for (i=0;i<num_samples_stbd;i++)
-		    fprintf(stderr,"dbg2       sample: %d  rawss_stbd:%f\n",
-			    i, rawss_stbd[i]);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* call the appropriate mbsys_ insertion routine */
-	if (mb_io_ptr->mb_io_insert_rawss != NULL)
-		{
-		status = (*mb_io_ptr->mb_io_insert_rawss)
-				(verbose,mbio_ptr,store_ptr,
-				kind, sidescan_type, sample_interval,
-				beamwidth_xtrack, beamwidth_ltrack,
-				num_samples_port,rawss_port,
-				num_samples_stbd,rawss_stbd,
-				error);
-		}
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_BAD_SYSTEM;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:             %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:            %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_extract_segytraceheader(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind,
-		void *segytraceheader_ptr,
-		int *error)
-{
-	char	*function_name = "mb_extract_segytraceheader";
-	int	status;
-	struct mb_io_struct *mb_io_ptr;
-	struct mb_segytraceheader_struct *mb_segytraceheader_ptr;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:        %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:         %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:      %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       kind:           %d\n",*kind);
-		fprintf(stderr,"dbg2       segytraceheader_ptr: %p\n",(void *)segytraceheader_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-	mb_segytraceheader_ptr = (struct mb_segytraceheader_struct *) segytraceheader_ptr;
-
-	/* call the appropriate mbsys_ extraction routine */
-	if (mb_io_ptr->mb_io_extract_segy != NULL)
-		{
-		status = (*mb_io_ptr->mb_io_extract_segytraceheader)
-				(verbose,mbio_ptr,store_ptr,
-				kind,segytraceheader_ptr,
-				error);
-		}
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_BAD_SYSTEM;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:              %d\n",*kind);
-		fprintf(stderr,"dbg2       seq_num:           %d\n",mb_segytraceheader_ptr->seq_num);
-		fprintf(stderr,"dbg2       seq_reel:          %d\n",mb_segytraceheader_ptr->seq_reel);
-		fprintf(stderr,"dbg2       shot_num:          %d\n",mb_segytraceheader_ptr->shot_num);
-		fprintf(stderr,"dbg2       shot_tr:           %d\n",mb_segytraceheader_ptr->shot_tr);
-		fprintf(stderr,"dbg2       espn:              %d\n",mb_segytraceheader_ptr->espn);
-		fprintf(stderr,"dbg2       rp_num:            %d\n",mb_segytraceheader_ptr->rp_num);
-		fprintf(stderr,"dbg2       rp_tr:             %d\n",mb_segytraceheader_ptr->rp_tr);
-		fprintf(stderr,"dbg2       trc_id:            %d\n",mb_segytraceheader_ptr->trc_id);
-		fprintf(stderr,"dbg2       num_vstk:          %d\n",mb_segytraceheader_ptr->num_vstk);
-		fprintf(stderr,"dbg2       cdp_fold:          %d\n",mb_segytraceheader_ptr->cdp_fold);
-		fprintf(stderr,"dbg2       use:               %d\n",mb_segytraceheader_ptr->use);
-		fprintf(stderr,"dbg2       range:             %d\n",mb_segytraceheader_ptr->range);
-		fprintf(stderr,"dbg2       grp_elev:          %d\n",mb_segytraceheader_ptr->grp_elev);
-		fprintf(stderr,"dbg2       src_elev:          %d\n",mb_segytraceheader_ptr->src_elev);
-		fprintf(stderr,"dbg2       src_depth:         %d\n",mb_segytraceheader_ptr->src_depth);
-		fprintf(stderr,"dbg2       grp_datum:         %d\n",mb_segytraceheader_ptr->grp_datum);
-		fprintf(stderr,"dbg2       src_datum:         %d\n",mb_segytraceheader_ptr->src_datum);
-		fprintf(stderr,"dbg2       src_wbd:           %d\n",mb_segytraceheader_ptr->src_wbd);
-		fprintf(stderr,"dbg2       grp_wbd:           %d\n",mb_segytraceheader_ptr->grp_wbd);
-		fprintf(stderr,"dbg2       elev_scalar:       %d\n",mb_segytraceheader_ptr->elev_scalar);
-		fprintf(stderr,"dbg2       coord_scalar:      %d\n",mb_segytraceheader_ptr->coord_scalar);
-		fprintf(stderr,"dbg2       src_long:          %d\n",mb_segytraceheader_ptr->src_long);
-		fprintf(stderr,"dbg2       src_lat:           %d\n",mb_segytraceheader_ptr->src_lat);
-		fprintf(stderr,"dbg2       grp_long:          %d\n",mb_segytraceheader_ptr->grp_long);
-		fprintf(stderr,"dbg2       grp_lat:           %d\n",mb_segytraceheader_ptr->grp_lat);
-		fprintf(stderr,"dbg2       coord_units:       %d\n",mb_segytraceheader_ptr->coord_units);
-		fprintf(stderr,"dbg2       wvel:              %d\n",mb_segytraceheader_ptr->wvel);
-		fprintf(stderr,"dbg2       sbvel:             %d\n",mb_segytraceheader_ptr->sbvel);
-		fprintf(stderr,"dbg2       src_up_vel:        %d\n",mb_segytraceheader_ptr->src_up_vel);
-		fprintf(stderr,"dbg2       grp_up_vel:        %d\n",mb_segytraceheader_ptr->grp_up_vel);
-		fprintf(stderr,"dbg2       src_static:        %d\n",mb_segytraceheader_ptr->src_static);
-		fprintf(stderr,"dbg2       grp_static:        %d\n",mb_segytraceheader_ptr->grp_static);
-		fprintf(stderr,"dbg2       tot_static:        %d\n",mb_segytraceheader_ptr->tot_static);
-		fprintf(stderr,"dbg2       laga:              %d\n",mb_segytraceheader_ptr->laga);
-		fprintf(stderr,"dbg2       delay_mils:        %d\n",mb_segytraceheader_ptr->delay_mils);
-		fprintf(stderr,"dbg2       smute_mils:        %d\n",mb_segytraceheader_ptr->smute_mils);
-		fprintf(stderr,"dbg2       emute_mils:        %d\n",mb_segytraceheader_ptr->emute_mils);
-		fprintf(stderr,"dbg2       nsamps:            %d\n",mb_segytraceheader_ptr->nsamps);
-		fprintf(stderr,"dbg2       si_micros:         %d\n",mb_segytraceheader_ptr->si_micros);
-		for (i=0;i<19;i++)
-		fprintf(stderr,"dbg2       other_1[%2d]:       %d\n",i,mb_segytraceheader_ptr->other_1[i]);
-		fprintf(stderr,"dbg2       year:              %d\n",mb_segytraceheader_ptr->year);
-		fprintf(stderr,"dbg2       day_of_yr:         %d\n",mb_segytraceheader_ptr->day_of_yr);
-		fprintf(stderr,"dbg2       hour:              %d\n",mb_segytraceheader_ptr->hour);
-		fprintf(stderr,"dbg2       min:               %d\n",mb_segytraceheader_ptr->min);
-		fprintf(stderr,"dbg2       sec:               %d\n",mb_segytraceheader_ptr->sec);
-		fprintf(stderr,"dbg2       mils:              %d\n",mb_segytraceheader_ptr->mils);
-		fprintf(stderr,"dbg2       tr_weight:         %d\n",mb_segytraceheader_ptr->tr_weight);
-		for (i=0;i<5;i++)
-		fprintf(stderr,"dbg2       other_2[%2d]:       %d\n",i,mb_segytraceheader_ptr->other_2[i]);
-		fprintf(stderr,"dbg2       delay:             %f\n",mb_segytraceheader_ptr->delay);
-		fprintf(stderr,"dbg2       smute_sec:         %f\n",mb_segytraceheader_ptr->smute_sec);
-		fprintf(stderr,"dbg2       emute_sec:         %f\n",mb_segytraceheader_ptr->emute_sec);
-		fprintf(stderr,"dbg2       si_secs:           %f\n",mb_segytraceheader_ptr->si_secs);
-		fprintf(stderr,"dbg2       wbt_secs:          %f\n",mb_segytraceheader_ptr->wbt_secs);
-		fprintf(stderr,"dbg2       end_of_rp:         %d\n",mb_segytraceheader_ptr->end_of_rp);
-		fprintf(stderr,"dbg2       dummy1:            %f\n",mb_segytraceheader_ptr->dummy1);
-		fprintf(stderr,"dbg2       dummy2:            %f\n",mb_segytraceheader_ptr->dummy2);
-		fprintf(stderr,"dbg2       dummy3:            %f\n",mb_segytraceheader_ptr->dummy3);
-		fprintf(stderr,"dbg2       dummy4:            %f\n",mb_segytraceheader_ptr->dummy4);
-		fprintf(stderr,"dbg2       soundspeed:        %f\n",mb_segytraceheader_ptr->soundspeed);
-		fprintf(stderr,"dbg2       distance:          %f\n",mb_segytraceheader_ptr->distance);
-		fprintf(stderr,"dbg2       dummy7:            %f\n",mb_segytraceheader_ptr->roll);
-		fprintf(stderr,"dbg2       dummy8:            %f\n",mb_segytraceheader_ptr->pitch);
-		fprintf(stderr,"dbg2       heading:           %f\n",mb_segytraceheader_ptr->heading);
-		fprintf(stderr,"dbg2       error:             %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:            %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_extract_segy(int verbose, void *mbio_ptr, void *store_ptr,
-		int *sampleformat,
-		int *kind,
-		void *segytraceheader_ptr,
-		float *segydata,
-		int *error)
-{
-	char	*function_name = "mb_extract_segy";
-	int	status;
-	struct mb_io_struct *mb_io_ptr;
-	struct mb_segytraceheader_struct *mb_segytraceheader_ptr;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:        %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:         %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:      %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       sampleformat:   %d\n",*sampleformat);
-		fprintf(stderr,"dbg2       segytraceheader_ptr: %p\n",(void *)segytraceheader_ptr);
-		fprintf(stderr,"dbg2       segydata:       %p\n",(void *)segydata);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-	mb_segytraceheader_ptr = (struct mb_segytraceheader_struct *) segytraceheader_ptr;
-
-	/* call the appropriate mbsys_ extraction routine */
-	if (mb_io_ptr->mb_io_extract_segy != NULL)
-		{
-		status = (*mb_io_ptr->mb_io_extract_segy)
-				(verbose,mbio_ptr,store_ptr,sampleformat,
-				kind,segytraceheader_ptr,segydata,
-				error);
-		}
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_BAD_SYSTEM;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       sampleformat:   %d\n",*sampleformat);
-		fprintf(stderr,"dbg2       kind:           %d\n",*kind);
-		fprintf(stderr,"dbg2       seq_num:        %d\n",mb_segytraceheader_ptr->seq_num);
-		fprintf(stderr,"dbg2       seq_reel:       %d\n",mb_segytraceheader_ptr->seq_reel);
-		fprintf(stderr,"dbg2       shot_num:       %d\n",mb_segytraceheader_ptr->shot_num);
-		fprintf(stderr,"dbg2       shot_tr:        %d\n",mb_segytraceheader_ptr->shot_tr);
-		fprintf(stderr,"dbg2       espn:           %d\n",mb_segytraceheader_ptr->espn);
-		fprintf(stderr,"dbg2       rp_num:         %d\n",mb_segytraceheader_ptr->rp_num);
-		fprintf(stderr,"dbg2       rp_tr:          %d\n",mb_segytraceheader_ptr->rp_tr);
-		fprintf(stderr,"dbg2       trc_id:         %d\n",mb_segytraceheader_ptr->trc_id);
-		fprintf(stderr,"dbg2       num_vstk:       %d\n",mb_segytraceheader_ptr->num_vstk);
-		fprintf(stderr,"dbg2       cdp_fold:       %d\n",mb_segytraceheader_ptr->cdp_fold);
-		fprintf(stderr,"dbg2       use:            %d\n",mb_segytraceheader_ptr->use);
-		fprintf(stderr,"dbg2       range:          %d\n",mb_segytraceheader_ptr->range);
-		fprintf(stderr,"dbg2       grp_elev:       %d\n",mb_segytraceheader_ptr->grp_elev);
-		fprintf(stderr,"dbg2       src_elev:       %d\n",mb_segytraceheader_ptr->src_elev);
-		fprintf(stderr,"dbg2       src_depth:      %d\n",mb_segytraceheader_ptr->src_depth);
-		fprintf(stderr,"dbg2       grp_datum:      %d\n",mb_segytraceheader_ptr->grp_datum);
-		fprintf(stderr,"dbg2       src_datum:      %d\n",mb_segytraceheader_ptr->src_datum);
-		fprintf(stderr,"dbg2       src_wbd:        %d\n",mb_segytraceheader_ptr->src_wbd);
-		fprintf(stderr,"dbg2       grp_wbd:        %d\n",mb_segytraceheader_ptr->grp_wbd);
-		fprintf(stderr,"dbg2       elev_scalar:    %d\n",mb_segytraceheader_ptr->elev_scalar);
-		fprintf(stderr,"dbg2       coord_scalar:   %d\n",mb_segytraceheader_ptr->coord_scalar);
-		fprintf(stderr,"dbg2       src_long:       %d\n",mb_segytraceheader_ptr->src_long);
-		fprintf(stderr,"dbg2       src_lat:        %d\n",mb_segytraceheader_ptr->src_lat);
-		fprintf(stderr,"dbg2       grp_long:       %d\n",mb_segytraceheader_ptr->grp_long);
-		fprintf(stderr,"dbg2       grp_lat:        %d\n",mb_segytraceheader_ptr->grp_lat);
-		fprintf(stderr,"dbg2       coord_units:    %d\n",mb_segytraceheader_ptr->coord_units);
-		fprintf(stderr,"dbg2       wvel:           %d\n",mb_segytraceheader_ptr->wvel);
-		fprintf(stderr,"dbg2       sbvel:          %d\n",mb_segytraceheader_ptr->sbvel);
-		fprintf(stderr,"dbg2       src_up_vel:     %d\n",mb_segytraceheader_ptr->src_up_vel);
-		fprintf(stderr,"dbg2       grp_up_vel:     %d\n",mb_segytraceheader_ptr->grp_up_vel);
-		fprintf(stderr,"dbg2       src_static:     %d\n",mb_segytraceheader_ptr->src_static);
-		fprintf(stderr,"dbg2       grp_static:     %d\n",mb_segytraceheader_ptr->grp_static);
-		fprintf(stderr,"dbg2       tot_static:     %d\n",mb_segytraceheader_ptr->tot_static);
-		fprintf(stderr,"dbg2       laga:           %d\n",mb_segytraceheader_ptr->laga);
-		fprintf(stderr,"dbg2       delay_mils:     %d\n",mb_segytraceheader_ptr->delay_mils);
-		fprintf(stderr,"dbg2       smute_mils:     %d\n",mb_segytraceheader_ptr->smute_mils);
-		fprintf(stderr,"dbg2       emute_mils:     %d\n",mb_segytraceheader_ptr->emute_mils);
-		fprintf(stderr,"dbg2       nsamps:         %d\n",mb_segytraceheader_ptr->nsamps);
-		fprintf(stderr,"dbg2       si_micros:      %d\n",mb_segytraceheader_ptr->si_micros);
-		for (i=0;i<19;i++)
-		fprintf(stderr,"dbg2       other_1[%2d]:       %d\n",i,mb_segytraceheader_ptr->other_1[i]);
-		fprintf(stderr,"dbg2       year:           %d\n",mb_segytraceheader_ptr->year);
-		fprintf(stderr,"dbg2       day_of_yr:      %d\n",mb_segytraceheader_ptr->day_of_yr);
-		fprintf(stderr,"dbg2       hour:           %d\n",mb_segytraceheader_ptr->hour);
-		fprintf(stderr,"dbg2       min:            %d\n",mb_segytraceheader_ptr->min);
-		fprintf(stderr,"dbg2       sec:            %d\n",mb_segytraceheader_ptr->sec);
-		fprintf(stderr,"dbg2       mils:           %d\n",mb_segytraceheader_ptr->mils);
-		fprintf(stderr,"dbg2       tr_weight:      %d\n",mb_segytraceheader_ptr->tr_weight);
-		for (i=0;i<5;i++)
-		fprintf(stderr,"dbg2       other_2[%2d]:       %d\n",i,mb_segytraceheader_ptr->other_2[i]);
-		fprintf(stderr,"dbg2       delay:          %f\n",mb_segytraceheader_ptr->delay);
-		fprintf(stderr,"dbg2       smute_sec:      %f\n",mb_segytraceheader_ptr->smute_sec);
-		fprintf(stderr,"dbg2       emute_sec:      %f\n",mb_segytraceheader_ptr->emute_sec);
-		fprintf(stderr,"dbg2       si_secs:        %f\n",mb_segytraceheader_ptr->si_secs);
-		fprintf(stderr,"dbg2       wbt_secs:       %f\n",mb_segytraceheader_ptr->wbt_secs);
-		fprintf(stderr,"dbg2       end_of_rp:      %d\n",mb_segytraceheader_ptr->end_of_rp);
-		fprintf(stderr,"dbg2       dummy1:         %f\n",mb_segytraceheader_ptr->dummy1);
-		fprintf(stderr,"dbg2       dummy2:         %f\n",mb_segytraceheader_ptr->dummy2);
-		fprintf(stderr,"dbg2       dummy3:         %f\n",mb_segytraceheader_ptr->dummy3);
-		fprintf(stderr,"dbg2       dummy4:         %f\n",mb_segytraceheader_ptr->dummy4);
-		fprintf(stderr,"dbg2       soundspeed:     %f\n",mb_segytraceheader_ptr->soundspeed);
-		fprintf(stderr,"dbg2       distance:       %f\n",mb_segytraceheader_ptr->distance);
-		fprintf(stderr,"dbg2       dummy7:         %f\n",mb_segytraceheader_ptr->roll);
-		fprintf(stderr,"dbg2       dummy8:         %f\n",mb_segytraceheader_ptr->pitch);
-		fprintf(stderr,"dbg2       heading:        %f\n",mb_segytraceheader_ptr->heading);
-		for (i=0;i<mb_segytraceheader_ptr->nsamps;i++)
-		    fprintf(stderr,"dbg2       sample:%d  data:%f\n", i, segydata[i]);
-		fprintf(stderr,"dbg2       error:          %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_insert_segy(int verbose, void *mbio_ptr, void *store_ptr,
-		int kind,
-		void *segytraceheader_ptr,
-		float *segydata,
-		int *error)
-{
-	char	*function_name = "mb_insert_segy";
-	int	status;
-	struct mb_io_struct *mb_io_ptr;
-	struct mb_segytraceheader_struct *mb_segytraceheader_ptr;
-	int	i;
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-	mb_segytraceheader_ptr = (struct mb_segytraceheader_struct *) segytraceheader_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:        %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:         %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:      %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       segytraceheader_ptr: %p\n",(void *)segytraceheader_ptr);
-		fprintf(stderr,"dbg2       segydata:       %p\n",(void *)segydata);
-		fprintf(stderr,"dbg2       kind:           %d\n",kind);
-		fprintf(stderr,"dbg2       seq_num:        %d\n",mb_segytraceheader_ptr->seq_num);
-		fprintf(stderr,"dbg2       seq_reel:       %d\n",mb_segytraceheader_ptr->seq_reel);
-		fprintf(stderr,"dbg2       shot_num:       %d\n",mb_segytraceheader_ptr->shot_num);
-		fprintf(stderr,"dbg2       shot_tr:        %d\n",mb_segytraceheader_ptr->shot_tr);
-		fprintf(stderr,"dbg2       espn:           %d\n",mb_segytraceheader_ptr->espn);
-		fprintf(stderr,"dbg2       rp_num:         %d\n",mb_segytraceheader_ptr->rp_num);
-		fprintf(stderr,"dbg2       rp_tr:          %d\n",mb_segytraceheader_ptr->rp_tr);
-		fprintf(stderr,"dbg2       trc_id:         %d\n",mb_segytraceheader_ptr->trc_id);
-		fprintf(stderr,"dbg2       num_vstk:       %d\n",mb_segytraceheader_ptr->num_vstk);
-		fprintf(stderr,"dbg2       cdp_fold:       %d\n",mb_segytraceheader_ptr->cdp_fold);
-		fprintf(stderr,"dbg2       use:            %d\n",mb_segytraceheader_ptr->use);
-		fprintf(stderr,"dbg2       range:          %d\n",mb_segytraceheader_ptr->range);
-		fprintf(stderr,"dbg2       grp_elev:       %d\n",mb_segytraceheader_ptr->grp_elev);
-		fprintf(stderr,"dbg2       src_elev:       %d\n",mb_segytraceheader_ptr->src_elev);
-		fprintf(stderr,"dbg2       src_depth:      %d\n",mb_segytraceheader_ptr->src_depth);
-		fprintf(stderr,"dbg2       grp_datum:      %d\n",mb_segytraceheader_ptr->grp_datum);
-		fprintf(stderr,"dbg2       src_datum:      %d\n",mb_segytraceheader_ptr->src_datum);
-		fprintf(stderr,"dbg2       src_wbd:        %d\n",mb_segytraceheader_ptr->src_wbd);
-		fprintf(stderr,"dbg2       grp_wbd:        %d\n",mb_segytraceheader_ptr->grp_wbd);
-		fprintf(stderr,"dbg2       elev_scalar:    %d\n",mb_segytraceheader_ptr->elev_scalar);
-		fprintf(stderr,"dbg2       coord_scalar:   %d\n",mb_segytraceheader_ptr->coord_scalar);
-		fprintf(stderr,"dbg2       src_long:       %d\n",mb_segytraceheader_ptr->src_long);
-		fprintf(stderr,"dbg2       src_lat:        %d\n",mb_segytraceheader_ptr->src_lat);
-		fprintf(stderr,"dbg2       grp_long:       %d\n",mb_segytraceheader_ptr->grp_long);
-		fprintf(stderr,"dbg2       grp_lat:        %d\n",mb_segytraceheader_ptr->grp_lat);
-		fprintf(stderr,"dbg2       coord_units:    %d\n",mb_segytraceheader_ptr->coord_units);
-		fprintf(stderr,"dbg2       wvel:           %d\n",mb_segytraceheader_ptr->wvel);
-		fprintf(stderr,"dbg2       sbvel:          %d\n",mb_segytraceheader_ptr->sbvel);
-		fprintf(stderr,"dbg2       src_up_vel:     %d\n",mb_segytraceheader_ptr->src_up_vel);
-		fprintf(stderr,"dbg2       grp_up_vel:     %d\n",mb_segytraceheader_ptr->grp_up_vel);
-		fprintf(stderr,"dbg2       src_static:     %d\n",mb_segytraceheader_ptr->src_static);
-		fprintf(stderr,"dbg2       grp_static:     %d\n",mb_segytraceheader_ptr->grp_static);
-		fprintf(stderr,"dbg2       tot_static:     %d\n",mb_segytraceheader_ptr->tot_static);
-		fprintf(stderr,"dbg2       laga:           %d\n",mb_segytraceheader_ptr->laga);
-		fprintf(stderr,"dbg2       delay_mils:     %d\n",mb_segytraceheader_ptr->delay_mils);
-		fprintf(stderr,"dbg2       smute_mils:     %d\n",mb_segytraceheader_ptr->smute_mils);
-		fprintf(stderr,"dbg2       emute_mils:     %d\n",mb_segytraceheader_ptr->emute_mils);
-		fprintf(stderr,"dbg2       nsamps:         %d\n",mb_segytraceheader_ptr->nsamps);
-		fprintf(stderr,"dbg2       si_micros:      %d\n",mb_segytraceheader_ptr->si_micros);
-		for (i=0;i<19;i++)
-		fprintf(stderr,"dbg2       other_1[%2d]:       %d\n",i,mb_segytraceheader_ptr->other_1[i]);
-		fprintf(stderr,"dbg2       year:           %d\n",mb_segytraceheader_ptr->year);
-		fprintf(stderr,"dbg2       day_of_yr:      %d\n",mb_segytraceheader_ptr->day_of_yr);
-		fprintf(stderr,"dbg2       hour:           %d\n",mb_segytraceheader_ptr->hour);
-		fprintf(stderr,"dbg2       min:            %d\n",mb_segytraceheader_ptr->min);
-		fprintf(stderr,"dbg2       sec:            %d\n",mb_segytraceheader_ptr->sec);
-		fprintf(stderr,"dbg2       mils:           %d\n",mb_segytraceheader_ptr->mils);
-		fprintf(stderr,"dbg2       tr_weight:      %d\n",mb_segytraceheader_ptr->tr_weight);
-		for (i=0;i<5;i++)
-		fprintf(stderr,"dbg2       other_2[%2d]:       %d\n",i,mb_segytraceheader_ptr->other_2[i]);
-		fprintf(stderr,"dbg2       delay:          %f\n",mb_segytraceheader_ptr->delay);
-		fprintf(stderr,"dbg2       smute_sec:      %f\n",mb_segytraceheader_ptr->smute_sec);
-		fprintf(stderr,"dbg2       emute_sec:      %f\n",mb_segytraceheader_ptr->emute_sec);
-		fprintf(stderr,"dbg2       si_secs:        %f\n",mb_segytraceheader_ptr->si_secs);
-		fprintf(stderr,"dbg2       wbt_secs:       %f\n",mb_segytraceheader_ptr->wbt_secs);
-		fprintf(stderr,"dbg2       end_of_rp:      %d\n",mb_segytraceheader_ptr->end_of_rp);
-		fprintf(stderr,"dbg2       dummy1:         %f\n",mb_segytraceheader_ptr->dummy1);
-		fprintf(stderr,"dbg2       dummy2:         %f\n",mb_segytraceheader_ptr->dummy2);
-		fprintf(stderr,"dbg2       dummy3:         %f\n",mb_segytraceheader_ptr->dummy3);
-		fprintf(stderr,"dbg2       dummy4:         %f\n",mb_segytraceheader_ptr->dummy4);
-		fprintf(stderr,"dbg2       soundspeed:     %f\n",mb_segytraceheader_ptr->soundspeed);
-		fprintf(stderr,"dbg2       distance:       %f\n",mb_segytraceheader_ptr->distance);
-		fprintf(stderr,"dbg2       roll:           %f\n",mb_segytraceheader_ptr->roll);
-		fprintf(stderr,"dbg2       pitch:          %f\n",mb_segytraceheader_ptr->pitch);
-		fprintf(stderr,"dbg2       heading:        %f\n",mb_segytraceheader_ptr->heading);
-		for (i=0;i<mb_segytraceheader_ptr->nsamps;i++)
-		    fprintf(stderr,"dbg2       sample:%d  data:%f\n", i, segydata[i]);
-		}
-
-	/* call the appropriate mbsys_ insertion routine */
-	if (mb_io_ptr->mb_io_insert_segy != NULL)
-		{
-		status = (*mb_io_ptr->mb_io_insert_segy)
-				(verbose,mbio_ptr,store_ptr,
-				kind,segytraceheader_ptr,segydata,
-				error);
-		}
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_BAD_SYSTEM;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:             %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:            %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_ctd(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, int *nctd, double *time_d,
-	double *conductivity, double *temperature,
-	double *depth, double *salinity, double *soundspeed, int *error)
-{
-	char	*function_name = "mb_ctd";
-	int	status;
-	struct mb_io_struct *mb_io_ptr;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* call the appropriate mbsys_ extraction routine */
-	/* note: the arrays should be allocated to MB_CTD_MAX length */
-	if (mb_io_ptr->mb_io_ctd != NULL)
-		{
-		status = (*mb_io_ptr->mb_io_ctd)
-				(verbose,mbio_ptr,store_ptr,
-				kind,nctd,time_d,conductivity,
-				temperature,depth,salinity,
-				soundspeed,error);
-		}
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_BAD_SYSTEM;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error == MB_ERROR_NO_ERROR)
-		{
-		fprintf(stderr,"dbg2       nctd:          %d\n",*nctd);
-		for (i=0;i<*nctd;i++)
-			{
-			fprintf(stderr,"dbg2       time_d:        %f\n",time_d[i]);
-			fprintf(stderr,"dbg2       conductivity:  %f\n",conductivity[i]);
-			fprintf(stderr,"dbg2       temperature:   %f\n",temperature[i]);
-			fprintf(stderr,"dbg2       depth:         %f\n",depth[i]);
-			fprintf(stderr,"dbg2       salinity:      %f\n",salinity[i]);
-			fprintf(stderr,"dbg2       soundspeed:    %f\n",soundspeed[i]);
-			}
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_ancilliarysensor(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, int *nsensor, double *time_d,
-	double *sensor1, double *sensor2, double *sensor3,
-	double *sensor4, double *sensor5, double *sensor6,
-	double *sensor7, double *sensor8, int *error)
-{
-	char	*function_name = "mb_ancilliarysensor";
-	int	status;
-	struct mb_io_struct *mb_io_ptr;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* call the appropriate mbsys_ extraction routine */
-	/* note: the arrays should be allocated to MB_CTD_MAX length */
-	if (mb_io_ptr->mb_io_ancilliarysensor != NULL)
-		{
-		status = (*mb_io_ptr->mb_io_ancilliarysensor)
-				(verbose,mbio_ptr,store_ptr,
-				kind, nsensor, time_d,
-				sensor1, sensor2, sensor3,
-				sensor4, sensor5, sensor6,
-				sensor7, sensor8, error);
-		}
-	else
-		{
-		*nsensor = 0;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error == MB_ERROR_NO_ERROR)
-		{
-		fprintf(stderr,"dbg2       nsensor:       %d\n",*nsensor);
-		for (i=0;i<*nsensor;i++)
-			{
-			fprintf(stderr,"dbg2       time_d:        %f\n",time_d[i]);
-			fprintf(stderr,"dbg2       sensor1:       %f\n",sensor1[i]);
-			fprintf(stderr,"dbg2       sensor2:       %f\n",sensor2[i]);
-			fprintf(stderr,"dbg2       sensor3:       %f\n",sensor3[i]);
-			fprintf(stderr,"dbg2       sensor4:       %f\n",sensor4[i]);
-			fprintf(stderr,"dbg2       sensor5:       %f\n",sensor5[i]);
-			fprintf(stderr,"dbg2       sensor6:       %f\n",sensor6[i]);
-			fprintf(stderr,"dbg2       sensor7:       %f\n",sensor7[i]);
-			fprintf(stderr,"dbg2       sensor8:       %f\n",sensor8[i]);
-			fprintf(stderr,"dbg2       sensor1:       %f\n",sensor1[i]);
-			}
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_copyrecord(int verbose, void *mbio_ptr,
-		    void *store_ptr, void *copy_ptr, int *error)
-{
-	char	*function_name = "mb_copy_record";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       copy_ptr:   %p\n",(void *)copy_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* call appropriate memory copy routine */
-	if (mb_io_ptr->mb_io_copyrecord != NULL)
-		{
-		status = (*mb_io_ptr->mb_io_copyrecord)
-				(verbose,mbio_ptr,
-				store_ptr,copy_ptr,error);
-		}
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_BAD_SYSTEM;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mb_angle.c b/src/mbio/mb_angle.c
deleted file mode 100644
index df42037..0000000
--- a/src/mbio/mb_angle.c
+++ /dev/null
@@ -1,827 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mb_angle.c	1/21/93
- *    $Id: mb_angle.c 2249 2015-06-26 19:26:09Z caress $
- *
- *    Copyright (c) 1998-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mb_angle.c includes the "mb_" functions used to translate between
- * the two coordinate systems that are relevent to the calculation
- * of bathymetry data. The following
- * is a description of these coordinate systems:
- *
- * Notes on Coordinate Systems used in MB-System
- *
- * David W. Caress
- * April 22, 1996
- * Updated January 16, 2009
- * R/V Maurice Ewing, EW9602
- *
- * I. Introduction
- * ---------------
- * The coordinate systems described below are used
- * within MB-System for calculations involving
- * the location in space of depth, amplitude, or
- * sidescan data. In all cases the origin of the
- * coordinate system is at the center of the sonar
- * transducers.
- *
- * II. Cartesian Coordinates
- * -------------------------
- * The cartesian coordinate system used in MB-System
- * is a bit odd because it is left-handed, as opposed
- * to the right-handed x-y-z space conventionally
- * used in most circumstances. With respect to the
- * sonar (or the ship on which the sonar is mounted),
- * the x-axis is athwartships with positive to starboard
- * (to the right if facing forward), the y-axis is
- * fore-aft with positive forward, and the z-axis is
- * positive down.
- *
- * III. Spherical Coordinates
- * --------------------------
- * There are two non-traditional spherical coordinate
- * systems used in MB-System. The first, referred to here
- * as takeoff angle coordinates, is useful for raytracing.
- * The second, referred to here as roll-pitch
- * coordinates, is useful for taking account of
- * corrections to roll and pitch angles.
- *
- * 1. Takeoff Angle Coordinates
- * ----------------------------
- * The three parameters are r, theta, and phi, where
- * r is the distance from the origin, theta is the
- * angle from vertical down (that is, from the
- * positive z-axis), and phi is the angle from
- * acrosstrack (the positive x-axis) in the x-y plane.
- * Note that theta is always positive; the direction
- * in the x-y plane is given by phi.
- * Raytracing is simple in these coordinates because
- * the ray takeoff angle is just theta. However,
- * applying roll or pitch corrections is complicated because
- * roll and pitch have components in both theta and phi.
- *
- * 	0 <= theta <= PI/2
- * 	-PI/2 <= phi <= 3*PI/2
- *
- * 	x = r * SIN(theta) * COS(phi)
- * 	y = r * SIN(theta) * SIN(phi)
- * 	z = r * COS(theta)
- *
- * 	theta = 0    ---> vertical, along positive z-axis
- * 	theta = PI/2 ---> horizontal, in x-y plane
- * 	phi = -PI/2  ---> aft, in y-z plane with y negative
- * 	phi = 0      ---> port, in x-z plane with x positive
- * 	phi = PI/2   ---> forward, in y-z plane with y positive
- * 	phi = PI     ---> starboard, in x-z plane with x negative
- * 	phi = 3*PI/2 ---> aft, in y-z plane with y negative
- *
- * 2. Roll-Pitch Coordinates
- * -------------------------
- * The three parameters are r, pitch, and roll, where
- * r is the distance from the origin, pitch is the angle
- * forward (effectively pitch angle), and roll is the
- * angle from horizontal in the x-z plane (effectively
- * roll angle). Applying a roll or pitch correction is
- * simple in these coordinates because pitch is just pitch
- * and roll is just roll. However, raytracing is complicated
- * because deflection from vertical has components in both
- * pitch and roll.
- *
- * 	-PI/2 <= pitch <= PI/2
- * 	0 <= roll <= PI
- *
- * 	x = r * COS(pitch) * COS(roll)
- * 	y = r * SIN(pitch)
- * 	z = r * COS(pitch) * SIN(roll)
- *
- * 	pitch = -PI/2 ---> horizontal, in x-y plane with y negative
- * 	pitch = 0     ---> ship level, zero pitch, in x-z plane
- * 	pitch = PI/2  ---> horizontal, in x-y plane with y positive
- * 	roll = 0      ---> starboard, along positive x-axis
- * 	roll = PI/2   ---> in y-z plane rotated by pitch
- * 	roll = PI     ---> port, along negative x-axis
- *
- * IV. An Example of Vendor-Specific Coordinates: SeaBeam 2100
- * ----------------------
- * The per-beam parameters in the SB2100 data format include
- * angle-from-vertical and angle-forward. Angle-from-vertical
- * is the same as theta except that it is signed based on
- * the acrosstrack direction (positive to starboard, negative
- * to port). The angle-forward values are also defined
- * slightly differently from phi, in that angle-forward is
- * signed differently on the port and starboard sides. The
- * SeaBeam 2100 External Interface Specifications document
- * includes both discussion and figures illustrating the
- * angle-forward value. To summarize:
- *
- *     Port:
- *
- * 	theta = absolute value of angle-from-vertical
- *
- * 	-PI/2 <= phi <= PI/2
- * 	is equivalent to
- * 	-PI/2 <= angle-forward <= PI/2
- *
- * 	phi = -PI/2 ---> angle-forward = -PI/2 (aft)
- * 	phi = 0     ---> angle-forward = 0     (starboard)
- * 	phi = PI/2  ---> angle-forward = PI/2  (forward)
- *
- *     Starboard:
- *
- * 	theta = angle-from-vertical
- *
- * 	PI/2 <= phi <= 3*PI/2
- * 	is equivalent to
- * 	-PI/2 <= angle-forward <= PI/2
- *
- * 	phi = PI/2   ---> angle-forward = -PI/2 (forward)
- * 	phi = PI     ---> angle-forward = 0     (port)
- * 	phi = 3*PI/2 ---> angle-forward = PI/2  (aft)
- *
- * V. Usage of Coordinate Systems in MB-System
- * ------------------------------------------
- * Some sonar data formats provide angle values along with
- * travel times. The angles are converted to takoff-angle
- * coordinates regardless of the  storage form of the
- * particular data format. Older data formats often
- * do not contain an alongtrack component to the position
- * values; in these cases the conversion is trivial since
- * phi = roll = 0 and theta = pitch. The angle and travel time
- * values can be accessed using the MBIO function mb_ttimes.
- * All angle values passed by MB-System functions are in
- * degrees rather than radians.
- *
- * The programs mbprocess and mbvelocitytool use angles in
- * take-off angle coordinates to do the raytracing. If roll
- * and/or pitch corrections are to be made, the angles are
- * converted to roll-pitch coordinates, corrected, and then
- * converted back prior to raytracing.
- *
- * When used for the patch test function, MBeditviz can apply
- * roll and pitch bias corrections interactively. This is
- * accomplished by first calculating the effective angles in
- * roll-pitch coordinates from each beam (sounding) using the depth
- * (relative to the sonar), the acrosstrack distance, and the
- * alongtrack distance, The corrections in roll and pitch are
- * then applied, and the depth and distances recalculated from
- * from the corrected angles.
- *
- *
- * Author:	D. W. Caress
- * Date:	December 30, 1998
- *
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <math.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_define.h"
-
-static char rcs_id[]="$Id: mb_angle.c 2249 2015-06-26 19:26:09Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mb_takeoff_to_rollpitch(int verbose,
-		double theta, double phi,
-		double *pitch, double *roll,
-		int *error)
-{
-	char	*function_name = "mb_takeoff_to_rollpitch";
-	int	status = MB_SUCCESS;
-	double	x, y, z;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       theta:      %f\n",theta);
-		fprintf(stderr,"dbg2       phi:        %f\n",phi);
-		}
-
-	/* convert to cartesian coordinates */
-	x = sin(DTR * theta) * cos(DTR * phi);
-	y = sin(DTR * theta) * sin(DTR * phi);
-	z = cos(DTR * theta);
-
-	/* convert to roll-pitch coordinates */
-	*roll = acos(x);
-	*pitch = asin(y / sin(*roll));
-	*pitch *= RTD;
-	*roll *= RTD;
-
-	/* assume success */
-	*error = MB_ERROR_NO_ERROR;
-	status = MB_SUCCESS;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       pitch:           %f\n",*pitch);
-		fprintf(stderr,"dbg2       roll:            %f\n",*roll);
-		fprintf(stderr,"dbg2       error:           %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:          %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_rollpitch_to_takeoff(int verbose,
-		double pitch, double roll,
-		double *theta, double *phi,
-		int *error)
-{
-	char	*function_name = "mb_rollpitch_to_takeoff";
-	int	status = MB_SUCCESS;
-	double	x, y, z;
-	double	sintheta;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       pitch:      %f\n",pitch);
-		fprintf(stderr,"dbg2       roll:       %f\n",roll);
-		}
-
-	/* convert to cartesian coordinates */
-	x = cos(DTR * roll);
-	y = sin(DTR * pitch) * sin(DTR * roll);
-	z = cos(DTR * pitch) * sin(DTR * roll);
-
-	/* convert to takeoff angle coordinates */
-	*theta = acos(z);
-	sintheta = sin(*theta);
-	if (fabs(sintheta) < 0.00001)
-		{
-		*phi = 0.0;
-		}
-	else
-		{
-		*phi = atan2(y,x);
-		}
-	*theta *= RTD;
-	*phi *= RTD;
-
-	/* assume success */
-	*error = MB_ERROR_NO_ERROR;
-	status = MB_SUCCESS;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       theta:           %f\n",*theta);
-		fprintf(stderr,"dbg2       phi:             %f\n",*phi);
-		fprintf(stderr,"dbg2       error:           %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:          %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_xyz_to_takeoff(int verbose,
-		double x, double y, double z,
-		double *theta, double *phi,
-		int *error)
-{
-	char	*function_name = "mb_xyz_to_takeoff";
-	int	status = MB_SUCCESS;
-	double	aa, xx, yy, zz, rr;
-
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       x:          %f\n",x);
-		fprintf(stderr,"dbg2       y:          %f\n",y);
-		fprintf(stderr,"dbg2       z:          %f\n",z);
-		}
-
-	/* normalize cartesian coordinates */
-	rr = sqrt(x * x + y * y + z * z);
-	xx = x / rr;
-	yy = y / rr;
-	zz = z / rr;
-
-	/* convert to takeoff angle coordinates */
-	*theta = acos(zz);
-	if (zz < 1.0)
-	    aa = yy / sin(*theta);
-	else
-	    aa = 0.0;
-	if (aa > 1.0)
-	    *phi = 0.5 * M_PI;
-	else if (aa < -1.0)
-	    *phi = -0.5 * M_PI;
-	else
-	    *phi = asin(aa);
-	*theta *= RTD;
-	*phi *= RTD;
-	if (xx < 0.0)
-		*phi = 180.0 - *phi;
-
-	/* assume success */
-	*error = MB_ERROR_NO_ERROR;
-	status = MB_SUCCESS;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       theta:           %f\n",*theta);
-		fprintf(stderr,"dbg2       phi:             %f\n",*phi);
-		fprintf(stderr,"dbg2       error:           %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:          %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_lever(int verbose,
-		double sonar_offset_x,
-		double sonar_offset_y,
-		double sonar_offset_z,
-		double nav_offset_x,
-		double nav_offset_y,
-		double nav_offset_z,
-		double vru_offset_x,
-		double vru_offset_y,
-		double vru_offset_z,
-		double vru_pitch,
-		double vru_roll,
-		double *lever_x,
-		double *lever_y,
-		double *lever_z,
-		int *error)
-{
-	char	*function_name = "mb_lever";
-	int	status = MB_SUCCESS;
-	double	x, y, z;
-	double	xx, yy, zz, r;
-	double	pitch, roll;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       sonar_offset_x: %f\n",sonar_offset_x);
-		fprintf(stderr,"dbg2       sonar_offset_y: %f\n",sonar_offset_y);
-		fprintf(stderr,"dbg2       sonar_offset_z: %f\n",sonar_offset_z);
-		fprintf(stderr,"dbg2       nav_offset_x:   %f\n",nav_offset_x);
-		fprintf(stderr,"dbg2       nav_offset_y:   %f\n",nav_offset_y);
-		fprintf(stderr,"dbg2       nav_offset_z:   %f\n",nav_offset_z);
-		fprintf(stderr,"dbg2       vru_offset_x:   %f\n",vru_offset_x);
-		fprintf(stderr,"dbg2       vru_offset_y:   %f\n",vru_offset_y);
-		fprintf(stderr,"dbg2       vru_offset_z:   %f\n",vru_offset_z);
-		fprintf(stderr,"dbg2       vru_pitch:      %f\n",vru_pitch);
-		fprintf(stderr,"dbg2       vru_roll:       %f\n",vru_roll);
-		}
-
-	/* do lever calculation to find heave implied by roll and pitch
-	   for a sonar displaced from the vru:
-		x = r * COS(pitch) * COS(roll)
-		y = r * SIN(pitch)
-		z = r * COS(pitch) * SIN(roll) */
-	/* get net offset between sonar and vru */
-	xx = sonar_offset_x - vru_offset_x;
-	yy = sonar_offset_y - vru_offset_y;
-	zz = sonar_offset_z - vru_offset_z;
-	r = sqrt(xx * xx + yy * yy + zz * zz);
-
-	/* lever arm only matters if offset is nonzero */
-	if (r > 0.0)
-	    {
-	    /* get initial angles */
-	    roll = RTD * acos(xx / r );
-	    if (zz < 0.0)
-	    	roll = -roll;
-	    if (sin(DTR * roll) != 0.0)
-		pitch = RTD * asin(yy / (r * sin(DTR * roll)));
-	    else
-		pitch = 0.0;
-
-  	    /* apply angle change */
-	    pitch += vru_pitch;
-	    roll += vru_roll;
-
-	    /* calculate new offsets */
-	    x = r * cos(DTR * roll);
-	    y = r * sin(DTR * pitch) * sin(DTR * roll);
-	    z = r * cos(DTR * pitch) * sin(DTR * roll);
-
-	    /* get heave change due to lever arm */
-	    *lever_z =  z - zz;
-	    }
-	else
-	    {
-	    *lever_z = 0.0;
-	    }
-
-	/* do lever calculation to find position shift implied by roll and pitch
-	   for a sonar displaced from the nav sensor:
-		x = r * COS(pitch) * COS(roll)
-		y = r * SIN(pitch)
-		z = r * COS(pitch) * SIN(roll) */
-	/* get net offset between sonar and nav sensor */
-	xx = sonar_offset_x - nav_offset_x;
-	yy = sonar_offset_y - nav_offset_y;
-	zz = sonar_offset_z - nav_offset_z;
-	r = sqrt(xx * xx + yy * yy + zz * zz);
-
-	/* lever arm only matters if offset is nonzero */
-	if (r > 0.0)
-	    {
-	    /* get initial angles */
-	    roll = RTD * acos(xx / r );
-	    if (sin(DTR * roll) != 0.0)
-		pitch = RTD * asin(yy / (r * sin(DTR * roll)));
-	    else
-		pitch = 0.0;
-
-  	    /* apply angle change */
-	    pitch += vru_pitch;
-	    roll += vru_roll;
-
-	    /* calculate new offsets */
-	    x = r * cos(DTR * roll);
-	    y = r * sin(DTR * pitch) * sin(DTR * roll);
-	    z = r * cos(DTR * pitch) * sin(DTR * roll);
-
-	    /* get position change due to lever arm */
-	    *lever_x =  x - xx;
-	    *lever_y =  y - yy;
-	    }
-	else
-	    {
-	    *lever_x = 0.0;
-	    *lever_y = 0.0;
-	    }
-
-	/* assume success */
-	*error = MB_ERROR_NO_ERROR;
-	status = MB_SUCCESS;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       lever_x:         %f\n",*lever_x);
-		fprintf(stderr,"dbg2       lever_y:         %f\n",*lever_y);
-		fprintf(stderr,"dbg2       lever_z:         %f\n",*lever_z);
-		fprintf(stderr,"dbg2       error:           %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:          %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-/*
- * Calculate multibeam beam angles for bathymetry calculation by raytracing
- * from the transducer array orientations and beam steering angles.
- * This code was written by Jonathan Beaudoin and John Hughes Clarke,
- * provided to the MB-System team by Jonathan Beaudoin, and
- * derives from the paper:
- * 
- * 	Beaudoin, J., Hughes Clarke, J., and Bartlett, J. Application of
- *          Surface Sound Speed Measurements in Post-Processing for
- *          Multi-Sector Multibeam Echosounders : International
- *          Hydrographic Review, v.5, no.3, p.26-31.
- *      (available for download at
- *       http://www.omg.unb.ca/omg/papers/beaudoin_IHR_nov2004.pdf).
- *
- * The input consists of 14 angles:
- * 	Transmit array installation angles: roll, pitch, heading
- * 	Receive array installation angles: roll, pitch, heading
- * 	Roll, pitch, and heading at transmit time
- * 	Roll, pitch, and heading at receive time
- * 	Transmit fore-aft pitch steering angle, can be unique by sector
- * 	    with Kongsberg systems (+ve angle is forward)
- * 	RX steer angle (+ve angle is to port, this is consistent with
- * 	    the Roll sign convention but opposite of what most people expect)
- *
- * The output consists of the beam azimuthal and depression angles.
- * 
- * Several Kongsberg multisector multibeams have arrays that can be reverse mounted.
- * The EM710 and EM2040 can have TX and RX independently mounted so one or both of
- * the TX and RX can be reverse mounted. If a transmit or receive array is reverse
- * mounted, the code handles this by:
- *      1) subtracting 180 degrees from the heading mount angle of the array
- *      2) flipping the sign of the pitch and roll mount offsets of the array
- *      3) flipping the sign of the beam steering angle from that array
- *         (reverse TX means flip sign of TX steer, reverse RX means flip sign of RX steer)
- */
- 
-int mb_beaudoin(int verbose,
-		mb_3D_orientation tx_align,
-		mb_3D_orientation tx_orientation,
-		double tx_steer,
-		mb_3D_orientation rx_align,
-		mb_3D_orientation rx_orientation,
-		double rx_steer,
-		double reference_heading,
-		double *beamAzimuth,
-		double *beamDepression,
-		int	*error)
-{
-	char	*function_name = "mb_beaudoin";
-	int	status = MB_SUCCESS;
-	mb_3D_orientation datt;   
-	mb_3D_vector xPrime, yPrime, zPrime;
-	mb_3D_vector txIdeal;
-	mb_3D_vector txMount;
-	mb_3D_vector txGeo;
-	mb_3D_vector rxIdeal;
-	mb_3D_vector rxMount;
-	mb_3D_vector rxGeo;
-	mb_3D_vector beamVectRel;
-	mb_3D_vector beamVectGeo;
-	double non_ortho;
-	double y1, y2, radial;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:                 %d\n",verbose);
-		fprintf(stderr,"dbg2       tx_align.roll:           %f\n", tx_align.roll);
-		fprintf(stderr,"dbg2       tx_align.pitch:          %f\n", tx_align.pitch);
-		fprintf(stderr,"dbg2       tx_align.heading:        %f\n", tx_align.heading);
-		fprintf(stderr,"dbg2       tx_orientation.roll:     %f\n", tx_orientation.roll);
-		fprintf(stderr,"dbg2       tx_orientation.pitch:    %f\n", tx_orientation.pitch);
-		fprintf(stderr,"dbg2       tx_orientation.heading:  %f\n", tx_orientation.heading);
-		fprintf(stderr,"dbg2       tx_steer:                %f\n", tx_steer);
-		fprintf(stderr,"dbg2       rx_align.roll:           %f\n", rx_align.roll);
-		fprintf(stderr,"dbg2       rx_align.pitch:          %f\n", rx_align.pitch);
-		fprintf(stderr,"dbg2       rx_align.heading:        %f\n", rx_align.heading);
-		fprintf(stderr,"dbg2       rx_orientation.roll:     %f\n", rx_orientation.roll);
-		fprintf(stderr,"dbg2       rx_orientation.pitch:    %f\n", rx_orientation.pitch);
-		fprintf(stderr,"dbg2       rx_orientation.heading:  %f\n", rx_orientation.heading);
-		fprintf(stderr,"dbg2       rx_steer:                %f\n", rx_steer);
-		fprintf(stderr,"dbg2       reference_heading:       %f\n", reference_heading);
-		}
-    
-	txIdeal.x = 1.0;
-	txIdeal.y = 0.0;
-	txIdeal.z = 0.0;
-    
-	// All of these in degrees, these are the transmitter array mount angles.
-	datt.roll = tx_align.roll;
-	datt.pitch = tx_align.pitch;
-	datt.heading = tx_align.heading;
-	mb_beaudoin_unrotate(verbose, txIdeal, datt, &txMount, error);
-    
-	// All of these in degrees, these are the motion measurements at the time of transmit.
-	datt.roll = tx_orientation.roll;
-	datt.pitch = tx_orientation.pitch;
-	datt.heading = tx_orientation.heading;
-	mb_beaudoin_unrotate(verbose, txMount, datt, &txGeo, error);
-    
-	if (verbose >= 4)
-		fprintf(stderr, "dbg4      TX array x %f y %f z %f in geographic reference frame\n", txGeo.x, txGeo.y, txGeo.z);
-    
-	rxIdeal.x = 0.0;
-	rxIdeal.y = 1.0;
-	rxIdeal.z = 0.0;
-    
-	// Degrees, these are the receiver array mount angles.
-	datt.roll = rx_align.roll;
-	datt.pitch = rx_align.pitch;
-	datt.heading = rx_align.heading;
-	mb_beaudoin_unrotate(verbose, rxIdeal, datt, &rxMount, error);
-    
-	// Degrees, these are the motion measurements at the time of reception (this is unique per beam)
-	datt.roll = rx_orientation.roll;
-	datt.pitch = rx_orientation.pitch;
-	datt.heading = rx_orientation.heading;
-	mb_beaudoin_unrotate(verbose, rxMount, datt, &rxGeo, error);
-    
-	if (verbose >= 4)
-		fprintf(stderr, "dbg4     RX array x %f y %f z %f in geographic reference frame\n", rxGeo.x, rxGeo.y, rxGeo.z);
-    
-	/* Have to negate it so signs work out...(was 90 - acos(...) before)  */
-	/* acos of dotproduct of rxGeo and txGeo yields angle from between vectors */
-	/* ...subtract 90 to bring into required units */
-	non_ortho = acos (rxGeo.x * txGeo.x +
-	rxGeo.y * txGeo.y +
-	rxGeo.z * txGeo.z) * 180.0 / M_PI - 90.0;
-    
-	if (verbose >= 4)
-		fprintf(stderr, "dbg4     TX/RX are non-orthogonal by %f degrees\n", non_ortho);
-      
-	y1 = sin (-rx_steer * DTR) / cos (non_ortho * DTR);
-	y2 = sin (tx_steer * DTR) * tan (non_ortho * DTR);
-	radial = sqrt ((y1 + y2) * (y1 + y2) + sin (tx_steer * DTR) * sin (tx_steer * DTR));
-      
-	if (radial <= 1.0)
-		{
-		beamVectRel.x = sin (tx_steer * DTR);
-		beamVectRel.y = y1 + y2;
-		beamVectRel.z = sqrt (1.0 - radial * radial);
-		}
-	else
-		{
-		beamVectRel.x = sin (tx_steer * DTR);
-		beamVectRel.y = sqrt(1.0 - beamVectRel.x * beamVectRel.x);
-		beamVectRel.z = 0.0;
-		}
-	      
-	//if (verbose >= 4)
-	if (radial > 1.0)
-	      fprintf(stderr, "dbg4     Got y1, y2, radial: %lf %lf %lf     beamVectRel:%f %f %f\n",
-		      y1, y2, radial, beamVectRel.x, beamVectRel.y, beamVectRel.z);
-      
-	/* Build ortho-normal basis */
-	xPrime = txGeo;
-      
-	/* Crossproduct of txGeo and rxGeo yields zPrime */
-	/* i.e. normal of plane containing txGeo and rxGeo */
-	zPrime.x = txGeo.y * rxGeo.z - txGeo.z * rxGeo.y;
-	zPrime.y = txGeo.z * rxGeo.x - txGeo.x * rxGeo.z;
-	zPrime.z = txGeo.x * rxGeo.y - txGeo.y * rxGeo.x;
-      
-	/* Crossproduct of zPrime and xPrime yields yPrime */
-	yPrime.x = zPrime.y * xPrime.z - zPrime.z * xPrime.y;
-	yPrime.y = zPrime.z * xPrime.x - zPrime.x * xPrime.z;
-	yPrime.z = zPrime.x * xPrime.y - zPrime.y * xPrime.x;
-      
-	if (verbose >= 4)
-		{
-		fprintf(stderr, "dbg4     x': %f, %f, %f\n", xPrime.x, xPrime.y, xPrime.z);
-		fprintf(stderr, "dbg4     y': %f, %f, %f\n", yPrime.x, yPrime.y, yPrime.z);
-		fprintf(stderr, "dbg4     z': %f, %f, %f\n", zPrime.x, zPrime.y, zPrime.z);
-		}
-      
-	/* Columns of equivalent rotation matrix are coordinates of */
-	/* primed unit vectors in original coordinate system */
-	/* Inverse (transpose) of this matrix will bring relative vector into */
-	/* geographic coordinates */
-	beamVectGeo.x = beamVectRel.x * xPrime.x + beamVectRel.y * yPrime.x + beamVectRel.z * zPrime.x;
-	beamVectGeo.y = beamVectRel.x * xPrime.y + beamVectRel.y * yPrime.y + beamVectRel.z * zPrime.y;
-	beamVectGeo.z = beamVectRel.x * xPrime.z + beamVectRel.y * yPrime.z + beamVectRel.z * zPrime.z;
-      
-	if (verbose >= 4)
-		{
-		fprintf(stderr, "dbg4     Beam vector is %f %f %f in transducer reference frame\n",
-			beamVectRel.x, beamVectRel.y, beamVectRel.z);
-		fprintf(stderr, "dbg4     Beam vector is %f %f %f in geographic reference frame\n",
-			beamVectGeo.x, beamVectGeo.y, beamVectGeo.z);
-		}
-      
-	*beamAzimuth = atan2 (beamVectGeo.y, beamVectGeo.x) * 180.0 / M_PI;
-      
-	/* Reduce the beam azimuth relative to the ship's heading ...  */
-	/* Hmmmm, this can do some funny stuff with multi-sector systems */
-	/* as the ship's heading in the math below is different for each beam */
-	/* but then we use the last sector as the reference azimuth -- JDB, Feb. 28, 2008 */
-      
-	// Taking care of this by now using reference_heading, which specifically
-	// is taken as the heading at the ping time associated with the first sector.
-	*beamAzimuth = *beamAzimuth - reference_heading;
-      
-	/* and then make sure she's positive, eh? */
-	if (*beamAzimuth < 0)
-		*beamAzimuth = 360.0 + *beamAzimuth;
-      
-	*beamDepression
-	      = atan (beamVectGeo.z / sqrt (beamVectGeo.x * beamVectGeo.x + beamVectGeo.y * beamVectGeo.y))
-		* 180.0 / M_PI;
-      
-	if (verbose >= 4)
-	      fprintf(stderr, "dbg4     Got beam azimuth (re: ship's heading) and depression %.2f %.2f\n",
-		     *beamAzimuth, *beamDepression);
-
-	/* assume success */
-	*error = MB_ERROR_NO_ERROR;
-	status = MB_SUCCESS;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       beamAzimuth:     %f\n",*beamAzimuth);
-		fprintf(stderr,"dbg2       beamDepression:  %f\n",*beamDepression);
-		fprintf(stderr,"dbg2       error:           %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:          %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-
-int mb_beaudoin_unrotate (int verbose,
-				mb_3D_vector orig,
-				mb_3D_orientation rotate,
-				mb_3D_vector * final,
-				int *error)
-{
-	char	*function_name = "mb_beaudoin_unrotate";
-	int	status = MB_SUCCESS;
-	double cosr, cosp, cosy;
-	double sinr, sinp, siny;
- 
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:         %d\n",verbose);
-		fprintf(stderr,"dbg2       orig.x:          %f\n", orig.x);
-		fprintf(stderr,"dbg2       orig.y:          %f\n", orig.y);
-		fprintf(stderr,"dbg2       orig.z:          %f\n", orig.z);
-		fprintf(stderr,"dbg2       rotate.roll:     %f\n", rotate.roll);
-		fprintf(stderr,"dbg2       rotate.pitch:    %f\n", rotate.pitch);
-		fprintf(stderr,"dbg2       rotate.heading:  %f\n", rotate.heading);
-		}
-      
-	sinr = sin (rotate.roll * DTR);
-	cosr = cos (rotate.roll * DTR);
-	sinp = sin (rotate.pitch * DTR);
-	cosp = cos (rotate.pitch * DTR);
-	siny = sin (rotate.heading * DTR);
-	cosy = cos (rotate.heading * DTR);
-     
-	final->x = cosp * cosy * orig.x +
-		    (sinr * sinp * cosy - cosr * siny) * orig.y +
-		    (cosr * sinp * cosy + sinr * siny) * orig.z;
-      
-	final->y = cosp * siny * orig.x +
-		    (sinr * sinp * siny + cosr * cosy) * orig.y +
-		    (cosr * sinp * siny - sinr * cosy) * orig.z;
-      
-	final->z = -sinp * orig.x + sinr * cosp * orig.y
-		    + cosr * cosp * orig.z;
-      
-	/* assume success */
-	*error = MB_ERROR_NO_ERROR;
-	status = MB_SUCCESS;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       final->x:        %f\n", final->x);
-		fprintf(stderr,"dbg2       final->y:        %f\n", final->y);
-		fprintf(stderr,"dbg2       final->z:        %f\n", final->z);
-		fprintf(stderr,"dbg2       error:           %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:          %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-
diff --git a/src/mbio/mb_buffer.c b/src/mbio/mb_buffer.c
deleted file mode 100644
index 6252700..0000000
--- a/src/mbio/mb_buffer.c
+++ /dev/null
@@ -1,1500 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mb_buffer.c	2/25/93
- *    $Id: mb_buffer.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1993-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mb_buffer.c contains the functions for buffered i/o of multibeam
- * data.
- * These functions include:
- *   mb_buffer_init	- initialize buffer structure
- *   mb_buffer_close	- close buffer structure
- *   mb_buffer_load	- load data from file into buffer
- *   mb_buffer_dump	- dump data from buffer into file
- *   mb_buffer_clear	- clear data from buffer
- *   mb_buffer_get_next_data	- extract navigation and bathymetry/backscatter
- *   				from next suitable record in buffer
- *   mb_buffer_get_next_nav	- extract navigation and vru
- *   				from next suitable record in buffer
- *   mb_buffer_extract	- extract navigation and bathymetry/backscatter
- *   				from specified record in buffer
- *   mb_buffer_insert	- insert altered navigation and
- *   				bathymetry/backscatter data into
- *   				record in buffer
- *   mb_buffer_extract_nav - extract navigation and vru
- *   				from specified record in buffer
- *   mb_buffer_insert_nav - insert altered navigation into
- *   				record in buffer
- *
- * Author:	D. W. Caress
- * Date:	February 25, 1993
- *
- * $Log: mb_buffer.c,v $
- * Revision 5.8  2009/03/02 18:51:52  caress
- * Fixed problems with formats 58 and 59, and also updated copyright dates in several source files.
- *
- * Revision 5.7  2005/11/05 00:48:05  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.6  2004/04/27 01:46:13  caress
- * Various updates of April 26, 2004.
- *
- * Revision 5.5  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.4  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.3  2002/07/20 20:42:40  caress
- * Release 5.0.beta20
- *
- * Revision 5.2  2002/05/29 23:36:53  caress
- * Release 5.0.beta18
- *
- * Revision 5.1  2001/07/20 00:31:11  caress
- * Release 5.0.beta03
- *
- * Revision 5.0  2000/12/01 22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.21  2000/10/11  01:02:30  caress
- * Convert to ANSI C
- *
- * Revision 4.20  2000/09/30  06:26:58  caress
- * Snapshot for Dale.
- *
- * Revision 4.19  1999/08/08  04:12:45  caress
- * Added ELMK2XSE format.
- *
- * Revision 4.18  1999/07/16  19:24:15  caress
- * Yet another version.
- *
- * Revision 4.17  1999/03/31  18:11:35  caress
- * MB-System 4.6beta7
- *
- * Revision 4.16  1998/12/17  22:56:15  caress
- * MB-System version 4.6beta4
- *
- * Revision 4.15  1998/10/05  17:46:15  caress
- * MB-System version 4.6beta
- *
- * Revision 4.14  1997/07/28  15:10:28  caress
- * Fixed typos.
- *
- * Revision 4.13  1997/07/25  14:19:53  caress
- * Version 4.5beta2.
- * Much mucking, particularly with Simrad formats.
- *
- * Revision 4.12  1997/04/21  17:02:07  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.11  1996/08/26  17:24:56  caress
- * Release 4.4 revision.
- *
- * Revision 4.11  1996/08/26  17:24:56  caress
- * Release 4.4 revision.
- *
- * Revision 4.10  1996/08/05  15:21:58  caress
- * Just redid i/o for Simrad sonars, including adding EM12S and EM121 support.
- *
- * Revision 4.9  1996/04/22  13:21:19  caress
- * Now have DTR and MIN/MAX defines in mb_define.h
- *
- * Revision 4.8  1996/03/12  17:21:55  caress
- * Added format 63, short HMR1 processing format.
- *
- * Revision 4.7  1995/09/28  18:10:48  caress
- * Various bug fixes working toward release 4.3.
- *
- * Revision 4.6  1995/08/17  14:42:45  caress
- * Revision for release 4.3.
- *
- * Revision 4.5  1995/03/06  19:38:54  caress
- * Changed include strings.h to string.h for POSIX compliance.
- *
- * Revision 4.4  1995/02/10  22:10:46  caress
- * Added mb_buffer_clear() function to allow data to be cleared
- * without being dumped to a file.
- *
- * Revision 4.3  1994/10/21  12:11:53  caress
- * Release V4.0
- *
- * Revision 4.2  1994/07/29  18:46:51  caress
- * Changes associated with supporting Lynx OS (byte swapped) and
- * using unix second time base (for time_d values).
- *
- * Revision 4.1  1994/04/12  00:24:27  caress
- * Added mbio_ptr to input list for mb_buffer_close to fix
- * segmentation fault on closing.
- *
- * Revision 4.0  1994/03/05  23:55:38  caress
- * First cut at version 4.0
- *
- * Revision 4.4  1994/03/05  22:51:44  caress
- * Added ability to handle Simrad EM12 system and
- * format MBF_EM12DARW.
- *
- * Revision 4.3  1994/03/03  03:39:43  caress
- * Fixed copyright message.
- *
- * Revision 4.2  1994/02/25  01:56:17  caress
- * Fixed some significant bugs that caused seg faults.
- *
- * Revision 4.1  1994/02/24  05:23:36  caress
- * Fixed some major problems with buffered i/o - the
- * switch to bath,amp,ss hadn't been completed for all
- * the functions!
- *
- * Revision 4.0  1994/02/20  03:49:44  caress
- * First cut at new version. Now supports both amplitude
- * and sidescan data.
- *
- * Revision 3.3  1993/06/15  06:08:02  caress
- * Added some debug messages in mb_buffer_close.
- *
- * Revision 3.2  1993/06/10  05:43:19  caress
- * Added facility in mb_buffer_close to deallocate memory associate
- * with any remaining records in buffer before deallocating the
- * buffer structure itself.
- *
- * Revision 3.1  1993/05/14  22:04:16  dale
- * Fix rcsid declaration
- *
- * Revision 3.0  1993/04/23  15:40:29  dale
- * Initial version
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mb_define.h"
-
-static char rcs_id[]="$Id: mb_buffer.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mb_buffer_init(int verbose, void **buff_ptr, int *error)
-{
-	char	*function_name = "mb_buffer_init";
-	int	status = MB_SUCCESS;
-	struct mb_buffer_struct *buff;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* allocate memory for data structure */
-	status = mb_mallocd(verbose,__FILE__,__LINE__,sizeof(struct mb_buffer_struct),buff_ptr,error);
-	buff = (struct mb_buffer_struct *) *buff_ptr;
-
-	/* set nbuffer to zero */
-	buff->nbuffer = 0;
-	for (i=0;i<MB_BUFFER_MAX;i++)
-		buff->buffer[i] = NULL;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       buff_ptr:   %p\n",(void *)*buff_ptr);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_buffer_close(int verbose, void **buff_ptr, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mb_buffer_close";
-	int	status = MB_SUCCESS;
-	struct mb_buffer_struct *buff;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       buff_ptr:   %p\n",(void *)*buff_ptr);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		}
-
-	/* get buffer structure */
-	buff = (struct mb_buffer_struct *) *buff_ptr;
-
-	/* deal with any remaining records in the buffer */
-	if (buff->nbuffer > 0)
-		{
-		if (verbose >= 4)
-			{
-			fprintf(stderr,"\ndbg4  Remaining records in buffer: %d\n",buff->nbuffer);
-			for (i=0;i<buff->nbuffer;i++)
-				fprintf(stderr,"dbg4       Record[%d] pointer: %p\n",i,(void *)(buff->buffer[i]));
-			}
-		for (i=0;i<buff->nbuffer;i++)
-			status = mb_deall(verbose,mbio_ptr,
-				&buff->buffer[i],error);
-		}
-
-	/* deallocate memory for data structure */
-	status = mb_free(verbose,buff_ptr,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_buffer_load(int verbose, void *buff_ptr,void *mbio_ptr,
-		    int nwant, int *nload, int *nbuff, int *error)
-{
-	char	*function_name = "mb_buffer_load";
-	int	status = MB_SUCCESS;
-	struct mb_buffer_struct *buff;
-	struct mb_io_struct *mb_io_ptr;
-	char	*store_ptr;
-	int	nget;
-	int	kind;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       buff_ptr:   %p\n",(void *)buff_ptr);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       nwant:      %d\n",nwant);
-		}
-
-	/* get buffer structure */
-	buff = (struct mb_buffer_struct *) buff_ptr;
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-	store_ptr = mb_io_ptr->store_data;
-
-	/* can't get more than the buffer will hold */
-	nget = nwant - buff->nbuffer;
-	if (buff->nbuffer + nget > MB_BUFFER_MAX)
-		nget = MB_BUFFER_MAX - buff->nbuffer;
-	*nload = 0;
-	*error = MB_ERROR_NO_ERROR;
-
-	/* print debug statements */
-	if (verbose >= 4)
-		{
-		fprintf(stderr,"\ndbg4  Getting ready to read records in MBIO function <%s>\n",
-			function_name);
-		fprintf(stderr,"dbg4       nwant:         %d\n",nwant);
-		fprintf(stderr,"dbg4       nget:          %d\n",nget);
-		fprintf(stderr,"dbg4       nload:         %d\n",*nload);
-		fprintf(stderr,"dbg4       error:         %d\n",*error);
-		}
-
-	/* read records into the buffer until its full or eof */
-	while (*error <= MB_ERROR_NO_ERROR && *nload < nget)
-		{
-		/* read the next data record */
-		status = mb_read_ping(verbose,mbio_ptr,store_ptr,
-					&kind,error);
-
-		/* log errors */
-		if (*error < MB_ERROR_NO_ERROR)
-			mb_notice_log_error(verbose, mbio_ptr, *error);
-
-		/* print debug statements */
-		if (verbose >= 4)
-			{
-			fprintf(stderr,"\ndbg4  New record read by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4       kind:          %d\n",kind);
-			fprintf(stderr,"dbg4       store_ptr:     %p\n",(void *)store_ptr);
-			fprintf(stderr,"dbg4       nbuffer:       %d\n",buff->nbuffer);
-			fprintf(stderr,"dbg4       nwant:         %d\n",nwant);
-			fprintf(stderr,"dbg4       nget:          %d\n",nget);
-			fprintf(stderr,"dbg4       nload:         %d\n",*nload);
-			fprintf(stderr,"dbg4       error:         %d\n",*error);
-			fprintf(stderr,"dbg4       status:        %d\n",status);
-			}
-
-		/* ignore time gaps */
-		if (*error == MB_ERROR_TIME_GAP)
-			{
-			status = MB_SUCCESS;
-			*error = MB_ERROR_NO_ERROR;
-			}
-
-		/* deal with good data */
-		if (*error == MB_ERROR_NO_ERROR && store_ptr != NULL)
-			{
-
-			/* allocate space and copy the data */
-			status = mb_alloc(verbose,mbio_ptr,
-				&buff->buffer[buff->nbuffer],
-				error);
-			if (status == MB_SUCCESS)
-			status = mb_copyrecord(verbose,mbio_ptr,
-				store_ptr,
-				buff->buffer[buff->nbuffer],error);
-			if (status == MB_SUCCESS)
-				{
-				buff->buffer_kind[buff->nbuffer] = kind;
-				buff->nbuffer++;
-				(*nload)++;
-				}
-			}
-
-		/* print debug statements */
-		if (verbose >= 4)
-			{
-			fprintf(stderr,"\ndbg4  Buffer status in MBIO function <%s>\n",function_name);
-			fprintf(stderr,"dbg4       nbuffer:       %d\n",buff->nbuffer);
-			fprintf(stderr,"dbg4       nload:         %d\n",*nload);
-			fprintf(stderr,"dbg4       nget:          %d\n",nget);
-			fprintf(stderr,"dbg4       nwant:         %d\n",nwant);
-			fprintf(stderr,"dbg4       error:         %d\n",*error);
-			fprintf(stderr,"dbg4       status:        %d\n",status);
-			for (i=0;i<buff->nbuffer;i++)
-				{
-				fprintf(stderr,"dbg4       i:%d  kind:%d  ptr:%p\n",
-					i,buff->buffer_kind[i],(void *)buff->buffer[i]);
-				}
-			}
-		}
-	*nbuff = buff->nbuffer;
-
-	/* error only if no records were loaded */
-	if (*nload > 0)
-		{
-		status = MB_SUCCESS;
-		*error = MB_ERROR_NO_ERROR;
-		}
-	else if (nwant <= 0)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_NO_DATA_REQUESTED;
-		}
-	else if (nget <= 0)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_BUFFER_FULL;
-		}
-	else if (*nload <= 0 && *error <= MB_ERROR_NO_ERROR)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_NO_DATA_LOADED;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       nload:      %d\n",*nload);
-		fprintf(stderr,"dbg2       nbuff:      %d\n",*nbuff);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_buffer_dump(int verbose, void *buff_ptr, void *mbio_ptr, void *ombio_ptr,
-		    int nhold, int *ndump, int *nbuff, int *error)
-{
-	char	*function_name = "mb_buffer_dump";
-	int	status = MB_SUCCESS;
-	struct mb_buffer_struct *buff;
-	struct mb_io_struct *mb_io_ptr;
-
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       buff_ptr:   %p\n",(void *)buff_ptr);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       omb_ptr:    %p\n",(void *)ombio_ptr);
-		fprintf(stderr,"dbg2       nhold:      %d\n",nhold);
-		}
-
-	/* get buffer structure */
-	buff = (struct mb_buffer_struct *) buff_ptr;
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* figure out how much to dump */
-	*ndump = buff->nbuffer - nhold;
-	if (buff->nbuffer <= 0)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_BUFFER_EMPTY;
-		*ndump = 0;
-		}
-	else if (*ndump <= 0)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_NO_DATA_DUMPED;
-		*ndump = 0;
-		}
-
-	/* print debug statements */
-	if (verbose >= 4)
-		{
-		fprintf(stderr,"\ndbg4  Buffer list in MBIO function <%s>\n",
-			function_name);
-		fprintf(stderr,"dbg4       nbuffer:     %d\n",buff->nbuffer);
-		for (i=0;i<buff->nbuffer;i++)
-			{
-			fprintf(stderr,"dbg4       i:%d  kind:%d  ptr:%p\n",
-			i,buff->buffer_kind[i],(void *)buff->buffer[i]);
-			}
-		}
-
-	/* dump records from buffer */
-	if (status == MB_SUCCESS)
-		{
-		for (i=0;i<*ndump;i++)
-			{
-			/* print debug statements */
-			if (verbose >= 4)
-				{
-				fprintf(stderr,"\ndbg4  Dumping record in MBIO function <%s>\n",function_name);
-				fprintf(stderr,"dbg4       record:      %d\n",i);
-				fprintf(stderr,"dbg4       ptr:         %p\n",(void *)buff->buffer[i]);
-				fprintf(stderr,"dbg4       kind:        %d\n",buff->buffer_kind[i]);
-				}
-
-			/* only write out data if output defined */
-			if (ombio_ptr != NULL)
-				status = mb_write_ping(verbose,ombio_ptr,buff->buffer[i],error);
-
-			/* print debug statements */
-			if (verbose >= 4)
-				{
-				fprintf(stderr,"\ndbg4  Deallocating record in MBIO function <%s>\n",function_name);
-				fprintf(stderr,"dbg4       record:      %d\n",i);
-				fprintf(stderr,"dbg4       ptr:         %p\n",(void *)buff->buffer[i]);
-				fprintf(stderr,"dbg4       kind:        %d\n",buff->buffer_kind[i]);
-				}
-
-			status = mb_deall(verbose,mbio_ptr,
-				&buff->buffer[i],error);
-			buff->buffer[i] = NULL;
-
-			/* print debug statements */
-			if (verbose >= 4)
-				{
-				fprintf(stderr,"\ndbg4  Done dumping record in MBIO function <%s>\n",function_name);
-				fprintf(stderr,"dbg4       record:      %d\n",i);
-				fprintf(stderr,"dbg4       ptr:         %p\n",(void *)buff->buffer[i]);
-				fprintf(stderr,"dbg4       kind:        %d\n",buff->buffer_kind[i]);
-				}
-			}
-		for (i=0;i<nhold;i++)
-			{
-			/* print debug statements */
-			if (verbose >= 4)
-				{
-				fprintf(stderr,"\ndbg4  Moving buffer record in MBIO function <%s>\n",function_name);
-				fprintf(stderr,"dbg4       old:         %d\n",*ndump + i);
-				fprintf(stderr,"dbg4       new:         %d\n",i);
-				fprintf(stderr,"dbg4       old ptr:     %p\n",(void *)buff->buffer[*ndump + i]);
-				fprintf(stderr,"dbg4       new ptr:     %p\n",(void *)buff->buffer[i]);
-				fprintf(stderr,"dbg4       old kind:    %d\n",buff->buffer_kind[*ndump + i]);
-				fprintf(stderr,"dbg4       new kind:    %d\n",buff->buffer_kind[i]);
-				}
-
-			buff->buffer[i] =
-				buff->buffer[*ndump + i];
-			buff->buffer_kind[i] =
-				buff->buffer_kind[*ndump + i];
-			buff->buffer[*ndump + i] = NULL;
-			buff->buffer_kind[*ndump + i] = 0;
-
-			/* print debug statements */
-			if (verbose >= 4)
-				{
-				fprintf(stderr,"\ndbg4  Done moving buffer record in MBIO function <%s>\n",function_name);
-				fprintf(stderr,"dbg4       old:         %d\n",*ndump + i);
-				fprintf(stderr,"dbg4       new:         %d\n",i);
-				fprintf(stderr,"dbg4       old ptr:     %p\n",(void *)buff->buffer[*ndump + i]);
-				fprintf(stderr,"dbg4       new ptr:     %p\n",(void *)buff->buffer[i]);
-				fprintf(stderr,"dbg4       old kind:    %d\n",buff->buffer_kind[*ndump + i]);
-				fprintf(stderr,"dbg4       new kind:    %d\n",buff->buffer_kind[i]);
-				}
-			}
-		buff->nbuffer = buff->nbuffer - *ndump;
-		}
-
-	/* print debug statements */
-	if (verbose >= 4)
-		{
-		fprintf(stderr,"\ndbg4  Buffer list at end of MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg4       nbuffer:     %d\n",buff->nbuffer);
-		for (i=0;i<buff->nbuffer;i++)
-			{
-			fprintf(stderr,"dbg4       i:%d  kind:%d  ptr:%p\n",
-			i,buff->buffer_kind[i],(void *)buff->buffer[i]);
-			}
-		}
-
-	/* set return value */
-	*nbuff = buff->nbuffer;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       ndump:      %d\n",*ndump);
-		fprintf(stderr,"dbg2       nbuff:      %d\n",*nbuff);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_buffer_clear(int verbose, void *buff_ptr, void *mbio_ptr,
-		    int nhold, int *ndump, int *nbuff, int *error)
-{
-	char	*function_name = "mb_buffer_clear";
-	int	status = MB_SUCCESS;
-	struct mb_buffer_struct *buff;
-	struct mb_io_struct *mb_io_ptr;
-
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       buff_ptr:   %p\n",(void *)buff_ptr);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       nhold:      %d\n",nhold);
-		}
-
-	/* get buffer structure */
-	buff = (struct mb_buffer_struct *) buff_ptr;
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* figure out how much to dump */
-	*ndump = buff->nbuffer - nhold;
-	if (buff->nbuffer <= 0)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_BUFFER_EMPTY;
-		*ndump = 0;
-		}
-	else if (*ndump <= 0)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_NO_DATA_DUMPED;
-		*ndump = 0;
-		}
-
-	/* print debug statements */
-	if (verbose >= 4)
-		{
-		fprintf(stderr,"\ndbg4  Buffer list in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg4       nbuffer:     %d\n",buff->nbuffer);
-		for (i=0;i<buff->nbuffer;i++)
-			{
-			fprintf(stderr,"dbg4       i:%d  kind:%d  ptr:%p\n",
-			i,buff->buffer_kind[i],(void *)buff->buffer[i]);
-			}
-		}
-
-	/* dump records from buffer */
-	if (status == MB_SUCCESS)
-		{
-		for (i=0;i<*ndump;i++)
-			{
-			/* print debug statements */
-			if (verbose >= 4)
-				{
-				fprintf(stderr,"\ndbg4  Deallocating record in MBIO function <%s>\n",function_name);
-				fprintf(stderr,"dbg4       record:      %d\n",i);
-				fprintf(stderr,"dbg4       ptr:         %p\n",(void *)buff->buffer[i]);
-				fprintf(stderr,"dbg4       kind:        %d\n",buff->buffer_kind[i]);
-				}
-
-			status = mb_deall(verbose,mbio_ptr,
-				&buff->buffer[i],error);
-			buff->buffer[i] = NULL;
-
-			/* print debug statements */
-			if (verbose >= 4)
-				{
-				fprintf(stderr,"\ndbg4  Done dumping record in MBIO function <%s>\n",function_name);
-				fprintf(stderr,"dbg4       record:      %d\n",i);
-				fprintf(stderr,"dbg4       ptr:         %p\n",(void *)buff->buffer[i]);
-				fprintf(stderr,"dbg4       kind:        %d\n",buff->buffer_kind[i]);
-				}
-			}
-		for (i=0;i<nhold;i++)
-			{
-			/* print debug statements */
-			if (verbose >= 4)
-				{
-				fprintf(stderr,"\ndbg4  Moving buffer record in MBIO function <%s>\n",function_name);
-				fprintf(stderr,"dbg4       old:         %d\n",*ndump + i);
-				fprintf(stderr,"dbg4       new:         %d\n",i);
-				fprintf(stderr,"dbg4       old ptr:     %p\n",(void *)buff->buffer[*ndump + i]);
-				fprintf(stderr,"dbg4       new ptr:     %p\n",(void *)buff->buffer[i]);
-				fprintf(stderr,"dbg4       old kind:    %d\n",buff->buffer_kind[*ndump + i]);
-				fprintf(stderr,"dbg4       new kind:    %d\n",buff->buffer_kind[i]);
-				}
-
-			buff->buffer[i] =
-				buff->buffer[*ndump + i];
-			buff->buffer_kind[i] =
-				buff->buffer_kind[*ndump + i];
-			buff->buffer[*ndump + i] = NULL;
-			buff->buffer_kind[*ndump + i] = 0;
-
-			/* print debug statements */
-			if (verbose >= 4)
-				{
-				fprintf(stderr,"\ndbg4  Done moving buffer record in MBIO function <%s>\n",function_name);
-				fprintf(stderr,"dbg4       old:         %d\n",*ndump + i);
-				fprintf(stderr,"dbg4       new:         %d\n",i);
-				fprintf(stderr,"dbg4       old ptr:     %p\n",(void *)buff->buffer[*ndump + i]);
-				fprintf(stderr,"dbg4       new ptr:     %p\n",(void *)buff->buffer[i]);
-				fprintf(stderr,"dbg4       old kind:    %d\n",buff->buffer_kind[*ndump + i]);
-				fprintf(stderr,"dbg4       new kind:    %d\n",buff->buffer_kind[i]);
-				}
-			}
-		buff->nbuffer = buff->nbuffer - *ndump;
-		}
-
-	/* print debug statements */
-	if (verbose >= 4)
-		{
-		fprintf(stderr,"\ndbg4  Buffer list at end of MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg4       nbuffer:     %d\n",buff->nbuffer);
-		for (i=0;i<buff->nbuffer;i++)
-			{
-			fprintf(stderr,"dbg4       i:%d  kind:%d  ptr:%p\n",
-			i,buff->buffer_kind[i],(void *)buff->buffer[i]);
-			}
-		}
-
-	/* set return value */
-	*nbuff = buff->nbuffer;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       ndump:      %d\n",*ndump);
-		fprintf(stderr,"dbg2       nbuff:      %d\n",*nbuff);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_buffer_get_next_data(int verbose, void *buff_ptr, void *mbio_ptr,
-		int start, int *id,
-		int time_i[7], double *time_d,
-		double *navlon, double *navlat,
-		double *speed, double *heading,
-		int *nbath, int *namp, int *nss,
-		char *beamflag, double *bath, double *amp,
-		double *bathacrosstrack, double *bathalongtrack,
-		double *ss, double *ssacrosstrack, double *ssalongtrack,
-		int *error)
-{
-	char	*function_name = "mb_buffer_get_next_data";
-	int	status = MB_SUCCESS;
-	struct mb_buffer_struct *buff;
-	struct mb_io_struct *mb_io_ptr;
-	int	kind;
-	char	comment[200];
-	int	found;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       buff_ptr:   %p\n",(void *)buff_ptr);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       start:      %d\n",start);
-		}
-
-	/* get buffer structure */
-	buff = (struct mb_buffer_struct *) buff_ptr;
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* look for next survey data */
-	found = MB_NO;
-	for (i=start;i<buff->nbuffer;i++)
-		{
-		if (found == MB_NO
-			&& buff->buffer_kind[i] == MB_DATA_DATA)
-			{
-			*id = i;
-			found = MB_YES;
-			}
-		}
-	if (found == MB_NO)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_NO_MORE_DATA;
-		*id = -1;
-		}
-
-	/* extract the data */
-	if (found == MB_YES)
-		status = mb_buffer_extract(verbose,buff_ptr,mbio_ptr,*id,&kind,
-			time_i,time_d,navlon,navlat,speed,heading,
-			nbath,namp,nss,
-			beamflag,bath,amp,
-			bathacrosstrack,bathalongtrack,
-			ss,ssacrosstrack,ssalongtrack,
-			comment,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       id:         %d\n",*id);
-		}
-	if (verbose >= 2 && *error == MB_ERROR_NO_ERROR)
-		{
-		fprintf(stderr,"dbg2       time_i[0]:     %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:     %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:     %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:     %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:     %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:     %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:     %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:        %f\n",*time_d);
-		fprintf(stderr,"dbg2       longitude:     %f\n",*navlon);
-		fprintf(stderr,"dbg2       latitude:      %f\n",*navlat);
-		fprintf(stderr,"dbg2       speed:         %f\n",*speed);
-		fprintf(stderr,"dbg2       heading:       %f\n",*heading);
-		fprintf(stderr,"dbg4       nbath:         %d\n",*nbath);
-		if (*nbath > 0)
-		  {
-		  fprintf(stderr,"dbg4       beam   flag   bath  crosstrack alongtrack\n");
-		  for (i=0;i<*nbath;i++)
-		    fprintf(stderr,"dbg4       %4d   %3d   %f    %f     %f\n",
-			i,beamflag[i],bath[i],bathacrosstrack[i],bathalongtrack[i]);
-		  }
-		fprintf(stderr,"dbg4       namp:          %d\n",*namp);
-		if (*namp > 0)
-		  {
-		  fprintf(stderr,"dbg4       beam    amp  crosstrack alongtrack\n");
-		  for (i=0;i<*nbath;i++)
-		    fprintf(stderr,"dbg4       %4d   %f    %f     %f\n",
-			i,amp[i],bathacrosstrack[i],bathalongtrack[i]);
-		  }
-		fprintf(stderr,"dbg4       nss:           %d\n",*nss);
-		if (*nss > 0)
-		  {
-		  fprintf(stderr,"dbg4       pixel sidescan crosstrack alongtrack\n");
-		  for (i=0;i<*nss;i++)
-		    fprintf(stderr,"dbg4       %4d   %f    %f     %f\n",
-			i,ss[i],ssacrosstrack[i],ssalongtrack[i]);
-		  }
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_buffer_get_next_nav(int verbose, void *buff_ptr, void *mbio_ptr,
-		int start, int *id,
-		int time_i[7], double *time_d,
-		double *navlon, double *navlat,
-		double *speed, double *heading, double *draft,
-		double *roll, double *pitch, double *heave,
-		int *error)
-{
-	char	*function_name = "mb_buffer_get_next_nav";
-	int	status = MB_SUCCESS;
-	struct mb_buffer_struct *buff;
-	struct mb_io_struct *mb_io_ptr;
-	int	kind;
-	int	found;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       buff_ptr:   %p\n",(void *)buff_ptr);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       start:      %d\n",start);
-		}
-
-	/* get buffer structure */
-	buff = (struct mb_buffer_struct *) buff_ptr;
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* look for next data of the appropriate type */
-	found = MB_NO;
-	for (i=start;i<buff->nbuffer;i++)
-		{
-		if (found == MB_NO
-			&& buff->buffer_kind[i] == mb_io_ptr->nav_source)
-			{
-			*id = i;
-			found = MB_YES;
-			}
-		}
-	if (found == MB_NO)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_NO_MORE_DATA;
-		*id = -1;
-		}
-
-	/* extract the data */
-	if (found == MB_YES)
-		status = mb_buffer_extract_nav(verbose,
-			buff_ptr,mbio_ptr,*id,&kind,
-			time_i,time_d,navlon,navlat,
-			speed,heading,draft,
-			roll,pitch,heave,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       id:         %d\n",*id);
-		}
-	if (verbose >= 2 && *error == MB_ERROR_NO_ERROR)
-		{
-		fprintf(stderr,"dbg2       time_i[0]:     %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:     %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:     %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:     %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:     %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:     %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:     %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:        %f\n",*time_d);
-		fprintf(stderr,"dbg2       longitude:     %f\n",*navlon);
-		fprintf(stderr,"dbg2       latitude:      %f\n",*navlat);
-		fprintf(stderr,"dbg2       speed:         %f\n",*speed);
-		fprintf(stderr,"dbg2       heading:       %f\n",*heading);
-		fprintf(stderr,"dbg2       draft:         %f\n",*draft);
-		fprintf(stderr,"dbg2       roll:          %f\n",*roll);
-		fprintf(stderr,"dbg2       pitch:         %f\n",*pitch);
-		fprintf(stderr,"dbg2       heave:         %f\n",*heave);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_buffer_extract(int verbose, void *buff_ptr, void *mbio_ptr,
-		int id, int *kind,
-		int time_i[7], double *time_d,
-		double *navlon, double *navlat,
-		double *speed, double *heading,
-		int *nbath, int *namp, int *nss,
-		char *beamflag, double *bath, double *amp,
-		double *bathacrosstrack, double *bathalongtrack,
-		double *ss, double *ssacrosstrack, double *ssalongtrack,
-		char *comment,
-		int *error)
-{
-	char	*function_name = "mb_buffer_extract";
-	int	status = MB_SUCCESS;
-	struct mb_buffer_struct *buff;
-	struct mb_io_struct *mb_io_ptr;
-	char	*store_ptr;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       buff_ptr:   %p\n",(void *)buff_ptr);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       id:         %d\n",id);
-		}
-
-	/* get buffer structure */
-	buff = (struct mb_buffer_struct *) buff_ptr;
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get store_ptr and kind for desired record */
-	if (id < 0 || id >= buff->nbuffer)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_BAD_BUFFER_ID;
-		}
-	else
-		{
-		store_ptr = buff->buffer[id];
-		*kind = buff->buffer_kind[id];
-		*error = MB_ERROR_NO_ERROR;
-		}
-
-	/* if no error then proceed */
-	if (status == MB_SUCCESS)
-		{
-		status = mb_extract(verbose,mbio_ptr,
-			store_ptr,kind,
-			time_i,time_d,navlon,navlat,speed,heading,
-			nbath,namp,nss,
-			beamflag,bath,amp,
-			bathacrosstrack,bathalongtrack,
-			ss,ssacrosstrack,ssalongtrack,
-			comment,error);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind == MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"dbg2       comment:     \ndbg2       %s\n",
-			comment);
-		}
-	else if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind != MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"dbg2       time_i[0]:     %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:     %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:     %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:     %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:     %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:     %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:     %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:        %f\n",*time_d);
-		fprintf(stderr,"dbg2       longitude:     %f\n",*navlon);
-		fprintf(stderr,"dbg2       latitude:      %f\n",*navlat);
-		fprintf(stderr,"dbg2       speed:         %f\n",*speed);
-		fprintf(stderr,"dbg2       heading:       %f\n",*heading);
-		}
-	if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind == MB_DATA_DATA)
-		{
-		fprintf(stderr,"dbg4       nbath:         %d\n",*nbath);
-		if (*nbath > 0)
-		  {
-		  fprintf(stderr,"dbg4       beam    flag   bath  crosstrack alongtrack\n");
-		  for (i=0;i<*nbath;i++)
-		    fprintf(stderr,"dbg4       %4d   %3d   %f    %f     %f\n",
-			i,beamflag[i],bath[i],
-			bathacrosstrack[i],bathalongtrack[i]);
-		  }
-		fprintf(stderr,"dbg4       namp:          %d\n",*namp);
-		if (*namp > 0)
-		  {
-		  fprintf(stderr,"dbg4       beam    amp  crosstrack alongtrack\n");
-		  for (i=0;i<*nbath;i++)
-		    fprintf(stderr,"dbg4       %4d   %f    %f     %f\n",
-			i,amp[i],bathacrosstrack[i],bathalongtrack[i]);
-		  }
-		fprintf(stderr,"dbg4       nss:           %d\n",*nss);
-		if (*nss > 0)
-		  {
-		  fprintf(stderr,"dbg4       pixel sidescan crosstrack alongtrack\n");
-		  for (i=0;i<*nss;i++)
-		    fprintf(stderr,"dbg4       %4d   %f    %f     %f\n",
-			i,ss[i],ssacrosstrack[i],ssalongtrack[i]);
-		  }
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_buffer_extract_nav(int verbose, void *buff_ptr, void *mbio_ptr,
-		int id, int *kind,
-		int time_i[7], double *time_d,
-		double *navlon, double *navlat,
-		double *speed, double *heading, double *draft,
-		double *roll, double *pitch, double *heave,
-		int *error)
-{
-	char	*function_name = "mb_buffer_extract_nav";
-	int	status = MB_SUCCESS;
-	struct mb_buffer_struct *buff;
-	struct mb_io_struct *mb_io_ptr;
-	char	*store_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       buff_ptr:   %p\n",(void *)buff_ptr);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       id:         %d\n",id);
-		}
-
-	/* get buffer structure */
-	buff = (struct mb_buffer_struct *) buff_ptr;
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get store_ptr and kind for desired record */
-	if (id < 0 || id >= buff->nbuffer)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_BAD_BUFFER_ID;
-		}
-	else
-		{
-		store_ptr = buff->buffer[id];
-		*kind = buff->buffer_kind[id];
-		*error = MB_ERROR_NO_ERROR;
-		}
-
-	/* if no error then proceed */
-	if (status == MB_SUCCESS)
-		{
-		status = mb_extract_nav(verbose,mbio_ptr,
-			store_ptr,kind,
-			time_i,time_d,navlon,navlat,
-			speed,heading,draft,
-			roll,pitch,heave,
-			error);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind != MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"dbg2       time_i[0]:     %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:     %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:     %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:     %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:     %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:     %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:     %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:        %f\n",*time_d);
-		fprintf(stderr,"dbg2       longitude:     %f\n",*navlon);
-		fprintf(stderr,"dbg2       latitude:      %f\n",*navlat);
-		fprintf(stderr,"dbg2       speed:         %f\n",*speed);
-		fprintf(stderr,"dbg2       heading:       %f\n",*heading);
-		fprintf(stderr,"dbg2       draft:         %f\n",*draft);
-		fprintf(stderr,"dbg2       roll:          %f\n",*roll);
-		fprintf(stderr,"dbg2       pitch:         %f\n",*pitch);
-		fprintf(stderr,"dbg2       heave:         %f\n",*heave);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_buffer_insert(int verbose, void *buff_ptr, void *mbio_ptr,
-		int id, int time_i[7], double time_d,
-		double navlon, double navlat,
-		double speed, double heading,
-		int nbath, int namp, int nss,
-		char *beamflag, double *bath, double *amp,
-		double *bathacrosstrack, double *bathalongtrack,
-		double *ss, double *ssacrosstrack, double *ssalongtrack,
-		char *comment,
-		int *error)
-{
-	char	*function_name = "mb_buffer_insert";
-	int	status = MB_SUCCESS;
-	struct mb_buffer_struct *buff;
-	struct mb_io_struct *mb_io_ptr;
-	char	*store_ptr;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       id:         %d\n",id);
-		fprintf(stderr,"dbg2       time_i[0]:  %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:  %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:  %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:  %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:  %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:  %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:  %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:     %f\n",time_d);
-		fprintf(stderr,"dbg2       navlon:     %f\n",navlon);
-		fprintf(stderr,"dbg2       navlat:     %f\n",navlat);
-		fprintf(stderr,"dbg2       speed:      %f\n",speed);
-		fprintf(stderr,"dbg2       heading:    %f\n",heading);
-		fprintf(stderr,"dbg4       nbath:      %d\n",nbath);
-		if (nbath > 0)
-		  {
-		  fprintf(stderr,"dbg4       beam   flag   bath  crosstrack alongtrack\n");
-		  for (i=0;i<nbath;i++)
-		    fprintf(stderr,"dbg4       %4d   %3d   %f    %f     %f\n",
-			i,beamflag[i],bath[i],
-			bathacrosstrack[i],bathalongtrack[i]);
-		  }
-		fprintf(stderr,"dbg4       namp:          %d\n",namp);
-		if (namp > 0)
-		  {
-		  fprintf(stderr,"dbg4       beam    amp  crosstrack alongtrack\n");
-		  for (i=0;i<nbath;i++)
-		    fprintf(stderr,"dbg4       %4d   %f    %f     %f\n",
-			i,amp[i],bathacrosstrack[i],bathalongtrack[i]);
-		  }
-		fprintf(stderr,"dbg4       nss:           %d\n",nss);
-		if (nss > 0)
-		  {
-		  fprintf(stderr,"dbg4       pixel sidescan crosstrack alongtrack\n");
-		  for (i=0;i<nss;i++)
-		    fprintf(stderr,"dbg4       %4d   %f    %f     %f\n",
-			i,ss[i],ssacrosstrack[i],ssalongtrack[i]);
-		  }
-		fprintf(stderr,"dbg2       comment:    %s\n",comment);
-		}
-
-	/* get buffer structure */
-	buff = (struct mb_buffer_struct *) buff_ptr;
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get store_ptr for specified record */
-	if (id < 0 || id >= buff->nbuffer)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_BAD_BUFFER_ID;
-		}
-	else
-		{
-		store_ptr = buff->buffer[id];
-		status = mb_insert(verbose,mbio_ptr,store_ptr,
-			buff->buffer_kind[id],
-			time_i,time_d,navlon,navlat,speed,heading,
-			nbath,namp,nss,
-			beamflag,bath,amp,
-			bathacrosstrack,bathalongtrack,
-			ss,ssacrosstrack,ssalongtrack,
-			comment,error);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_buffer_insert_nav(int verbose, void *buff_ptr, void *mbio_ptr,
-		int id, int time_i[7], double time_d,
-		double navlon, double navlat,
-		double speed, double heading, double draft,
-		double roll, double pitch, double heave,
-		int *error)
-{
-	char	*function_name = "mb_buffer_insert_nav";
-	int	status = MB_SUCCESS;
-	struct mb_buffer_struct *buff;
-	struct mb_io_struct *mb_io_ptr;
-	char	*store_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       id:         %d\n",id);
-		fprintf(stderr,"dbg2       time_i[0]:  %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:  %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:  %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:  %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:  %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:  %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:  %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:     %f\n",time_d);
-		fprintf(stderr,"dbg2       navlon:     %f\n",navlon);
-		fprintf(stderr,"dbg2       navlat:     %f\n",navlat);
-		fprintf(stderr,"dbg2       speed:      %f\n",speed);
-		fprintf(stderr,"dbg2       heading:    %f\n",heading);
-		fprintf(stderr,"dbg2       draft:      %f\n",draft);
-		fprintf(stderr,"dbg2       roll:       %f\n",roll);
-		fprintf(stderr,"dbg2       pitch:      %f\n",pitch);
-		fprintf(stderr,"dbg2       heave:      %f\n",heave);
-		}
-
-	/* get buffer structure */
-	buff = (struct mb_buffer_struct *) buff_ptr;
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get store_ptr for specified record */
-	if (id < 0 || id >= buff->nbuffer)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_BAD_BUFFER_ID;
-		}
-	else
-		{
-		store_ptr = buff->buffer[id];
-		status = mb_insert_nav(verbose,
-			mbio_ptr,store_ptr,
-			time_i,time_d,navlon,navlat,
-			speed,heading,draft,
-			roll,pitch,heave,
-			error);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_buffer_get_kind(int verbose, void *buff_ptr, void *mbio_ptr,
-			int id, int *kind,
-			int *error)
-{
-	char	*function_name = "mb_buffer_get_kind";
-	int	status = MB_SUCCESS;
-	struct mb_buffer_struct *buff;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       id:         %d\n",id);
-		}
-
-	/* get buffer structure */
-	buff = (struct mb_buffer_struct *) buff_ptr;
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get store_ptr for specified record */
-	if (id < 0 || id >= buff->nbuffer)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_BAD_BUFFER_ID;
-		}
-	else
-		{
-		*kind = buff->buffer_kind[id];
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_buffer_get_ptr(int verbose, void *buff_ptr, void *mbio_ptr,
-			int id, void **store_ptr,
-			int *error)
-{
-	char	*function_name = "mb_buffer_get_ptr";
-	int	status = MB_SUCCESS;
-	struct mb_buffer_struct *buff;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       id:         %d\n",id);
-		}
-
-	/* get buffer structure */
-	buff = (struct mb_buffer_struct *) buff_ptr;
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get store_ptr for specified record */
-	if (id < 0 || id >= buff->nbuffer)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_BAD_BUFFER_ID;
-		}
-	else
-		{
-		*store_ptr = buff->buffer[id];
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)*store_ptr);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mb_check_info.c b/src/mbio/mb_check_info.c
deleted file mode 100644
index 13a93e6..0000000
--- a/src/mbio/mb_check_info.c
+++ /dev/null
@@ -1,1733 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mb_check_info.c	1/25/93
- *    $Id: mb_check_info.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1993-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mb_check_info.c checks if a file has data within the specified
- * bounds by reading the mbinfo output of that file. The mbinfo
- * output must be in an ascii file with a name consisting of the
- * data file name followed by a ".inf" suffix. If the ".inf" file
- * does not exist then the file is assumed to have data within the
- * specified bounds.
- *
- * Author:	D. W. Caress
- * Date:	September 3, 1996
- *
- * $Log: mb_check_info.c,v $
- * Revision 5.22  2009/03/02 18:51:52  caress
- * Fixed problems with formats 58 and 59, and also updated copyright dates in several source files.
- *
- * Revision 5.21  2008/07/10 06:43:40  caress
- * Preparing for 5.1.1beta20
- *
- * Revision 5.20  2008/01/14 18:05:09  caress
- * Made checking for data min maxes and bounds more robust.
- *
- * Revision 5.19  2007/10/08 15:59:34  caress
- * MBIO changes as of 8 October 2007.
- *
- * Revision 5.18  2007/06/18 01:19:48  caress
- * Changes as of 17 June 2007.
- *
- * Revision 5.17  2006/11/26 09:37:09  caress
- * Making distribution 5.1.0.
- *
- * Revision 5.16  2006/10/05 18:58:28  caress
- * Changes for 5.1.0beta4
- *
- * Revision 5.15  2006/09/11 18:55:52  caress
- * Changes during Western Flyer and Thomas Thompson cruises, August-September
- * 2006.
- *
- * Revision 5.14  2006/01/06 18:27:19  caress
- * Working towards 5.0.8
- *
- * Revision 5.13  2004/12/02 06:33:30  caress
- * Fixes while supporting Reson 7k data.
- *
- * Revision 5.12  2004/09/24 20:43:47  caress
- * Changed character array dimensions.
- *
- * Revision 5.11  2003/09/23 23:41:27  caress
- * Another change in adding formats 68 and 69.
- *
- * Revision 5.10  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.9  2003/01/15 20:54:46  caress
- * Release 5.0.beta28
- *
- * Revision 5.8  2002/09/20 17:45:43  caress
- * Release 5.0.beta23
- *
- * Revision 5.7  2002/05/29 23:36:53  caress
- * Release 5.0.beta18
- *
- * Revision 5.6  2002/05/02 03:55:34  caress
- * Release 5.0.beta17
- *
- * Revision 5.5  2002/04/08 20:59:38  caress
- * Release 5.0.beta17
- *
- * Revision 5.4  2002/04/06 02:43:39  caress
- * Release 5.0.beta16
- *
- * Revision 5.3  2002/03/18 18:28:46  caress
- * Fixed handling of data bounds that cross the current lonflip setting.
- *
- * Revision 5.2  2002/02/22 09:03:43  caress
- * Release 5.0.beta13
- *
- * Revision 5.1  2001/03/22  20:45:56  caress
- * Trying to make 5.0.beta0...
- *
- * Revision 5.0  2000/12/01  22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.4  2000/10/11  01:02:30  caress
- * Convert to ANSI C
- *
- * Revision 4.3  2000/09/30  06:26:58  caress
- * Snapshot for Dale.
- *
- * Revision 4.2  1998/10/05  18:32:27  caress
- * MB-System version 4.6beta
- *
- * Revision 4.1  1996/12/08  04:14:22  caress
- * Fixed problem where lonflipping was applied to latitude.
- *
- * Revision 4.1  1996/12/08  04:14:22  caress
- * Fixed problem where lonflipping was applied to latitude.
- *
- * Revision 4.0  1996/09/05  13:59:47  caress
- * Initial revision.
- *
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#include <string.h>
-#include <time.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_define.h"
-#include "mb_format.h"
-#include "mb_info.h"
-
-static char rcs_id[]="$Id: mb_check_info.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mb_check_info(int verbose, char *file, int lonflip, double bounds[4], int *file_in_bounds, int *error)
-{
-	char	*function_name = "mb_check_info";
-	int	status;
-	char	file_inf[MB_PATH_MAXLINE];
-	char	line[MB_PATH_MAXLINE];
-	int	nrecords, nrecords_read;
-	double	lon_min, lon_max;
-	double	lat_min, lat_max;
-	int	mask_nx, mask_ny;
-	double	mask_dx, mask_dy;
-	double	lonwest, loneast, latsouth, latnorth;
-	int	*mask = NULL;
-	char	*startptr, *endptr;
-	FILE	*fp;
-	char	*stdin_string = "stdin";
-	int	nscan;
-	int	i, j, k;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       file:       %s\n",file);
-		fprintf(stderr,"dbg2       lonflip:    %d\n",lonflip);
-		fprintf(stderr,"dbg2       bounds[0]:  %f\n",bounds[0]);
-		fprintf(stderr,"dbg2       bounds[1]:  %f\n",bounds[1]);
-		fprintf(stderr,"dbg2       bounds[2]:  %f\n",bounds[2]);
-		fprintf(stderr,"dbg2       bounds[3]:  %f\n",bounds[3]);
-		}
-
-	/* cannot check bounds if input is stdin */
-	if (strncmp(file,stdin_string,5) == 0)
-		{
-		*file_in_bounds = MB_YES;
-
-		/*print debug statements */
-		if (verbose >= 4)
-			{
-			fprintf(stderr,"dbg4  Cannot check bounds if input is stdin...\n");
-			}
-		}
-
-	/* check for inf file */
-	else
-		{
-		/* get info file path */
-		strcpy(file_inf, file);
-		strcat(file_inf, ".inf");
-
-		/* open if possible */
-		if ((fp = fopen(file_inf,"r")) != NULL)
-		    {
-		    /* initialize the parameters */
-		    nrecords = -1;
-		    lon_min = 0.0;
-		    lon_max = 0.0;
-		    lat_min = 0.0;
-		    lat_max = 0.0;
-		    mask_nx = 0;
-		    mask_ny = 0;
-
-		    /* read the inf file */
-		    while (fgets(line, MB_PATH_MAXLINE, fp) != NULL)
-			{
-			if (strncmp(line, "Number of Records:", 18) == 0)
-			    {
-			    nscan = sscanf(line, "Number of Records: %d",
-					    &nrecords_read);
-			    if (nscan == 1)
-				nrecords = nrecords_read;
-			    }
-			else if (strncmp(line, "Minimum Longitude:", 18) == 0)
-			    sscanf(line, "Minimum Longitude: %lf Maximum Longitude: %lf",
-				    &lon_min, &lon_max);
-			else if (strncmp(line, "Minimum Latitude:", 17) == 0)
-			    sscanf(line, "Minimum Latitude: %lf Maximum Latitude: %lf",
-				    &lat_min, &lat_max);
-			else if (strncmp(line, "CM dimensions:", 14) == 0)
-			    {
-			    sscanf(line, "CM dimensions: %d %d", &mask_nx, &mask_ny);
-			    status = mb_mallocd(verbose,__FILE__, __LINE__,mask_nx*mask_ny*sizeof(int),
-							(void **)&mask,error);
-			    for (j=mask_ny-1;j>=0;j--)
-				{
-				if ((startptr = fgets(line, 128, fp)) != NULL)
-				    {
-				    startptr = &line[6];
-				    for (i=0;i<mask_nx;i++)
-					{
-					k = i + j * mask_nx;
-					mask[k] = strtol(startptr, &endptr, 0);
-					startptr = endptr;
-					}
-				    }
-				}
-			    }
-			}
-
-		    /* check bounds if there is data */
-		    if (nrecords > 0)
-			{
-			/* set lon lat min max according to lonflip */
-			if (lonflip == -1
-			    && lon_min > 0.0)
-			    {
-			    lon_min -= 360.0;
-			    lon_max -= 360.0;
-			    }
-			else if (lonflip == 0
-			    && lon_max < -180.0)
-			    {
-			    lon_min += 360.0;
-			    lon_max += 360.0;
-			    }
-			else if (lonflip == 0
-			    && lon_min > 180.0)
-			    {
-			    lon_min -= 360.0;
-			    lon_max -= 360.0;
-			    }
-			else if (lonflip == 1
-			    && lon_max < 0.0)
-			    {
-			    lon_min += 360.0;
-			    lon_max += 360.0;
-			    }
-
-			/* check for lonflip conflict with bounds */
-			if (lon_min > lon_max || lat_min > lat_max)
-			    *file_in_bounds = MB_YES;
-
-			/* else check mask against desired input bounds */
-			else if (mask_nx > 0 && mask_ny > 0)
-			    {
-			    *file_in_bounds = MB_NO;
-			    mask_dx = (lon_max - lon_min) / mask_nx;
-			    mask_dy = (lat_max - lat_min) / mask_ny;
-			    for (i=0; i<mask_nx && *file_in_bounds == MB_NO; i++)
-				for (j=0; j<mask_ny && *file_in_bounds == MB_NO; j++)
-				    {
-				    k = i + j * mask_nx;
-				    lonwest = lon_min + i * mask_dx;
-				    loneast = lonwest + mask_dx;
-				    latsouth = lat_min + j * mask_dy;
-				    latnorth = latsouth + mask_dy;
-				    if (mask[k] == 1
-					&& lonwest < bounds[1] && loneast > bounds[0]
-					&& latsouth < bounds[3] && latnorth > bounds[2])
-					*file_in_bounds = MB_YES;
-				    }
-			    mb_freed(verbose,__FILE__, __LINE__,(void **) &mask, error);
-			    }
-
-			/* else check whole file against desired input bounds */
-			else
-			    {
-			    if (lon_min < bounds[1] && lon_max > bounds[0]
-				&& lat_min < bounds[3] && lat_max > bounds[2])
-				*file_in_bounds = MB_YES;
-			    else
-				*file_in_bounds = MB_NO;
-			    }
-
-                        /*print debug statements */
-                        if (verbose >= 4)
-			    {
-                            fprintf(stderr,"dbg4  Bounds from inf file:\n");
-                            fprintf(stderr,"dbg4      lon_min: %f\n", lon_min);
-                            fprintf(stderr,"dbg4      lon_max: %f\n", lon_max);
-                            fprintf(stderr,"dbg4      lat_min: %f\n", lat_min);
-                            fprintf(stderr,"dbg4      lat_max: %f\n", lat_max);
-			    }
-			}
-
-		    /* else if no data records in inf file
-			treat file as out of bounds */
-		    else if (nrecords == 0)
-			{
-			*file_in_bounds = MB_NO;
-
-             		/*print debug statements */
-                    	if (verbose >= 4)
-                        	fprintf(stderr,"dbg4  The inf file shows zero records so out of bounds...\n");
-			}
-
-		    /* else if no data assume inf file is botched so
-			assume file has data in bounds */
-		    else
-			{
-			*file_in_bounds = MB_YES;
-
-             		/*print debug statements */
-                    	if (verbose >= 4)
-                        	fprintf(stderr,"dbg4  No data listed in inf file so cannot check bounds...\n");
-			}
-
-		    /* close the file */
-		    fclose(fp);
-		    }
-
-		/* if no inf file assume file has data in bounds */
-		else
-		    {
-		    *file_in_bounds = MB_YES;
-
-		    /*print debug statements */
-		    if (verbose >= 4)
-                        fprintf(stderr,"dbg4  Cannot open inf file so cannot check bounds...\n");
-		    }
-		}
-
-	/* set error and status (if you got here you succeeded */
-	*error = MB_ERROR_NO_ERROR;
-	status = MB_SUCCESS;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       file_in_bounds: %d\n",*file_in_bounds);
-		fprintf(stderr,"dbg2       error:          %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_get_info(int verbose, char *file, struct mb_info_struct *mb_info, int lonflip,
-		    int *error)
-{
-	char	*function_name = "mb_get_info";
-	int	status;
-	char	file_inf[MB_PATH_MAXLINE];
-	char	line[MB_PATH_MAXLINE];
-	char	*startptr, *endptr;
-	FILE	*fp;
-	int	time_i[7];
-	double	speedkts;
-	int	nscan, nproblem, problemid;
-	int	i, j, k;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       file:       %s\n",file);
-		fprintf(stderr,"dbg2       info:       %p\n",(void *)mb_info);
-		fprintf(stderr,"dbg2       lonflip:    %d\n",lonflip);
-		}
-
-	/* initialize the parameters */
-	mb_info_init(verbose, mb_info, error);
-
-	/* get info file path */
-	strcpy(file_inf, file);
-	strcat(file_inf, ".inf");
-
-	/* open if possible */
-	if ((fp = fopen(file_inf,"r")) == NULL)
-		{
-		/* set error */
-		*error = MB_ERROR_OPEN_FAIL;
-		status = MB_FAILURE;
-
-		/*print debug statements */
-		if (verbose >= 2)
-			{
-			fprintf(stderr,"dbg2  Cannot open requested inf file: %s\n", file_inf);
-			}
-
-		/* return in disgrace */
-		return(status);
-		}
-
-	/* load information from inf file */
-	else
-		{
-		/* set file name */
-		strcpy(mb_info->file, file);
-
-		/* read the inf file */
-		while (fgets(line, MB_PATH_MAXLINE, fp) != NULL)
-			{
-			if (strncmp(line, "Number of Records:", 18) == 0)
-			    {
-			    nscan = sscanf(line, "Number of Records: %d",
-					    &mb_info->nrecords);
-			    }
-			else if (strncmp(line, "Number of Subbottom Records:", 28) == 0)
-			    {
-			    nscan = sscanf(line, "Number of Subbottom Records: %d",
-					    &mb_info->nrecords_sbp);
-			    }
-			else if (strncmp(line, "Number of Secondary Sidescan Records:", 37) == 0)
-			    {
-			    nscan = sscanf(line, "Number of Secondary Sidescan Records: %d",
-					    &mb_info->nrecords_ss1);
-			    }
-			else if (strncmp(line, "Number of Tertiary Sidescan Records:", 36) == 0)
-			    {
-			    nscan = sscanf(line, "Number of Tertiary Sidescan Records: %d",
-					    &mb_info->nrecords_ss2);
-			    }
-
-			else if (strncmp(line, "Bathymetry Data (", 17) == 0)
-			    {
-			    nscan = sscanf(line, "Bathymetry Data (%d beams):",
-					    &mb_info->nbeams_bath);
-			    if (fgets(line, MB_PATH_MAXLINE, fp) != NULL)
-			    nscan = sscanf(line, "  Number of Beams: %d",
-					    &mb_info->nbeams_bath_total);
-			    if (fgets(line, MB_PATH_MAXLINE, fp) != NULL)
-			    nscan = sscanf(line, "  Number of Good Beams: %d",
-					    &mb_info->nbeams_bath_good);
-			    if (fgets(line, MB_PATH_MAXLINE, fp) != NULL)
-			    nscan = sscanf(line, "  Number of Zero Beams: %d",
-					    &mb_info->nbeams_bath_zero);
-			    if (fgets(line, MB_PATH_MAXLINE, fp) != NULL)
-			    nscan = sscanf(line, "  Number of Flagged Beams: %d",
-					    &mb_info->nbeams_bath_flagged);
-			    }
-
-			else if (strncmp(line, "Amplitude Data (", 17) == 0)
-			    {
-			    nscan = sscanf(line, "Amplitude Data (%d beams):",
-					    &mb_info->nbeams_amp);
-			    if (fgets(line, MB_PATH_MAXLINE, fp) != NULL)
-			    nscan = sscanf(line, "  Number of Beams: %d",
-					    &mb_info->nbeams_amp_total);
-			    if (fgets(line, MB_PATH_MAXLINE, fp) != NULL)
-			    nscan = sscanf(line, "  Number of Good Beams: %d",
-					    &mb_info->nbeams_amp_good);
-			    if (fgets(line, MB_PATH_MAXLINE, fp) != NULL)
-			    nscan = sscanf(line, "  Number of Zero Beams: %d",
-					    &mb_info->nbeams_amp_zero);
-			    if (fgets(line, MB_PATH_MAXLINE, fp) != NULL)
-			    nscan = sscanf(line, "  Number of Flagged Beams: %d",
-					    &mb_info->nbeams_amp_flagged);
-			    }
-
-			else if (strncmp(line, "Sidescan Data (", 15) == 0)
-			    {
-			    nscan = sscanf(line, "Sidescan Data (%d pixels):",
-					    &mb_info->npixels_ss);
-			    if (fgets(line, MB_PATH_MAXLINE, fp) != NULL)
-			    nscan = sscanf(line, "  Number of Pixels: %d",
-					    &mb_info->npixels_ss_total);
-			    if (fgets(line, MB_PATH_MAXLINE, fp) != NULL)
-			    nscan = sscanf(line, "  Number of Good Pixels: %d",
-					    &mb_info->npixels_ss_good);
-			    if (fgets(line, MB_PATH_MAXLINE, fp) != NULL)
-			    nscan = sscanf(line, "  Number of Zero Pixels: %d",
-					    &mb_info->npixels_ss_zero);
-			    if (fgets(line, MB_PATH_MAXLINE, fp) != NULL)
-			    nscan = sscanf(line, "  Number of Flagged Pixels: %d",
-					    &mb_info->npixels_ss_flagged);
-			    }
-
-			else if (strncmp(line, "Total Time:", 11) == 0)
-			    {
-			    nscan = sscanf(line, "Total Time: %lf hours",
-					    &mb_info->time_total);
-			    }
-			else if (strncmp(line, "Total Track Length:", 19) == 0)
-			    {
-			    nscan = sscanf(line, "Total Track Length: %lf km",
-					    &mb_info->dist_total);
-			    }
-			else if (strncmp(line, "Average Speed:", 14) == 0)
-			    {
-			    nscan = sscanf(line, "Average Speed: %lf km/hr",
-					    &mb_info->speed_avg);
-			    }
-
-			else if (strncmp(line, "Start of Data:", 14) == 0)
-			    {
-			    if ((startptr = fgets(line, 128, fp)) != NULL)
-				{
-			    	nscan = sscanf(line, "Time:  %d %d %d %d:%d:%d.%d  JD",
-					    &time_i[1], &time_i[2], &time_i[0],
-					    &time_i[3], &time_i[4], &time_i[5], &time_i[6]);
-				if (nscan == 7)
-					mb_get_time(verbose, time_i, &(mb_info->time_start));
-				}
-			    if ((startptr = fgets(line, 128, fp)) != NULL)
-				{
-			    	nscan = sscanf(line, "Lon: %lf	 Lat: %lf Depth: %lf meters",
-					    &mb_info->lon_start, &mb_info->lat_start, &mb_info->depth_start);
-				}
-			    if ((startptr = fgets(line, 128, fp)) != NULL)
-				{
-			    	nscan = sscanf(line, "Speed: %lf km/hr ( %lf knots)  Heading: %lf degrees",
-					    &mb_info->speed_start, &speedkts, &mb_info->heading_start);
-				}
-			    if ((startptr = fgets(line, 128, fp)) != NULL)
-				{
-			    	nscan = sscanf(line, "Sonar Depth:  %lf m  Sonar Altitude:   %lf m",
-					    &mb_info->sonardepth_start, &mb_info->sonaraltitude_start);
-				}
-			    }
-
-			else if (strncmp(line, "End of Data:", 12) == 0)
-			    {
-			    if ((startptr = fgets(line, 128, fp)) != NULL)
-				{
-			    	nscan = sscanf(line, "Time:  %d %d %d %d:%d:%d.%d  JD",
-					    &time_i[1], &time_i[2], &time_i[0],
-					    &time_i[3], &time_i[4], &time_i[5], &time_i[6]);
-				if (nscan == 7)
-					mb_get_time(verbose, time_i, &(mb_info->time_end));
-				}
-			    if ((startptr = fgets(line, 128, fp)) != NULL)
-				{
-			    	nscan = sscanf(line, "Lon: %lf	 Lat: %lf Depth: %lf meters",
-					    &mb_info->lon_end, &mb_info->lat_end, &mb_info->depth_end);
-				}
-			    if ((startptr = fgets(line, 128, fp)) != NULL)
-				{
-			    	nscan = sscanf(line, "Speed: %lf km/hr ( %lf knots)  Heading: %lf degrees",
-					    &mb_info->speed_end, &speedkts, &mb_info->heading_end);
-				}
-			    if ((startptr = fgets(line, 128, fp)) != NULL)
-				{
-			    	nscan = sscanf(line, "Sonar Depth:  %lf m  Sonar Altitude:   %lf m",
-					    &mb_info->sonardepth_end, &mb_info->sonaraltitude_end);
-				}
-			    }
-
-			else if (strncmp(line, "Minimum Longitude:", 18) == 0)
-			    sscanf(line, "Minimum Longitude: %lf Maximum Longitude: %lf",
-				    &mb_info->lon_min, &mb_info->lon_max);
-			else if (strncmp(line, "Minimum Latitude:", 17) == 0)
-			    sscanf(line, "Minimum Latitude: %lf Maximum Latitude: %lf",
-				    &mb_info->lat_min, &mb_info->lat_max);
-
-			else if (strncmp(line, "Minimum Sonar Depth:", 20) == 0)
-			    sscanf(line, "Minimum Sonar Depth: %lf Maximum Sonar Depth: %lf",
-				    &mb_info->sonardepth_min, &mb_info->sonardepth_max);
-
-			else if (strncmp(line, "Minimum Altitude:", 17) == 0)
-			    sscanf(line, "Minimum Altitude: %lf Maximum Altitude: %lf",
-				    &mb_info->altitude_min, &mb_info->altitude_max);
-
-			else if (strncmp(line, "Minimum Depth:", 14) == 0)
-			    sscanf(line, "Minimum Depth: %lf Maximum Depth: %lf",
-				    &mb_info->depth_min, &mb_info->depth_max);
-
-			else if (strncmp(line, "Minimum Amplitude:", 18) == 0)
-			    sscanf(line, "Minimum Amplitude: %lf Maximum Amplitude: %lf",
-				    &mb_info->amp_min, &mb_info->amp_max);
-
-			else if (strncmp(line, "Minimum Sidescan:", 17) == 0)
-			    sscanf(line, "Minimum Sidescan: %lf Maximum Sidescan: %lf",
-				    &mb_info->ss_min, &mb_info->ss_max);
-
-			else if (strncmp(line, "PN:", 3) == 0)
-			    {
-			    sscanf(line, "PN: %d DATA PROBLEM (ID=%d):",
-				    &nproblem,&problemid);
-			    if (problemid == MB_PROBLEM_NO_DATA)
-				mb_info->problem_nodata += nproblem;
-			    else if (problemid == MB_PROBLEM_ZERO_NAV)
-				mb_info->problem_zeronav += nproblem;
-			    else if (problemid == MB_PROBLEM_TOO_FAST)
-			 	mb_info->problem_toofast += nproblem;
-			    else if (problemid == MB_PROBLEM_AVG_TOO_FAST)
-				mb_info->problem_avgtoofast += nproblem;
-			    else if (problemid == MB_PROBLEM_TOO_DEEP)
-				mb_info->problem_toodeep += nproblem;
-			    else if (problemid == MB_PROBLEM_BAD_DATAGRAM)
-				mb_info->problem_baddatagram += nproblem;
-			    }
-
-			else if (strncmp(line, "CM dimensions:", 14) == 0)
-			    {
-			    sscanf(line, "CM dimensions: %d %d", &mb_info->mask_nx, &mb_info->mask_ny);
-			    status = mb_mallocd(verbose,__FILE__, __LINE__,mb_info->mask_nx*mb_info->mask_ny*sizeof(int),
-							(void **)&mb_info->mask,error);
-			    for (j=mb_info->mask_ny-1;j>=0;j--)
-				{
-				if ((startptr = fgets(line, 128, fp)) != NULL)
-				    {
-				    startptr = &line[6];
-				    for (i=0;i<mb_info->mask_nx;i++)
-					{
-					k = i + j * mb_info->mask_nx;
-					mb_info->mask[k] = strtol(startptr, &endptr, 0);
-					startptr = endptr;
-					}
-				    }
-				}
-			    }
-			}
-
-		/* close the file */
-		fclose(fp);
-
-		/* apply lonflip if needed */
-		if (lonflip == -1
-		    && mb_info->lon_min > 0.0)
-		    {
-		    mb_info->lon_min -= 360.0;
-		    mb_info->lon_max -= 360.0;
-		    mb_info->lon_start -= 360.0;
-		    mb_info->lon_end -= 360.0;
-		    }
-		else if (lonflip == 0
-		    && mb_info->lon_max < -180.0)
-		    {
-		    mb_info->lon_min += 360.0;
-		    mb_info->lon_max += 360.0;
-		    mb_info->lon_start += 360.0;
-		    mb_info->lon_end += 360.0;
-		    }
-		else if (lonflip == 0
-		    && mb_info->lon_min > 180.0)
-		    {
-		    mb_info->lon_min -= 360.0;
-		    mb_info->lon_max -= 360.0;
-		    mb_info->lon_start -= 360.0;
-		    mb_info->lon_end -= 360.0;
-		    }
-		else if (lonflip == 1
-		    && mb_info->lon_max < 0.0)
-		    {
-		    mb_info->lon_min += 360.0;
-		    mb_info->lon_max += 360.0;
-		    mb_info->lon_start += 360.0;
-		    mb_info->lon_end += 360.0;
-		    }
-		}
-
-	/* set error and status (if you got here you succeeded */
-	*error = MB_ERROR_NO_ERROR;
-	status = MB_SUCCESS;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       loaded:                   %d\n",mb_info->loaded);
-		fprintf(stderr,"dbg2       file:                     %s\n",mb_info->file);
-		fprintf(stderr,"dbg2       nrecords:                 %d\n",mb_info->nrecords);
-		fprintf(stderr,"dbg2       nrecords_sbp:             %d\n",mb_info->nrecords_sbp);
-		fprintf(stderr,"dbg2       nrecords_ss1:             %d\n",mb_info->nrecords_ss1);
-		fprintf(stderr,"dbg2       nrecords_ss2:             %d\n",mb_info->nrecords_ss2);
-		fprintf(stderr,"dbg2       nbeams_bath:              %d\n",mb_info->nbeams_bath);
-		fprintf(stderr,"dbg2       nbeams_bath_total:        %d\n",mb_info->nbeams_bath_total);
-		fprintf(stderr,"dbg2       nbeams_bath_good:         %d\n",mb_info->nbeams_bath_good);
-		fprintf(stderr,"dbg2       nbeams_bath_zero:         %d\n",mb_info->nbeams_bath_zero);
-		fprintf(stderr,"dbg2       nbeams_bath_flagged:      %d\n",mb_info->nbeams_bath_flagged);
-		fprintf(stderr,"dbg2       nbeams_amp:               %d\n",mb_info->nbeams_amp);
-		fprintf(stderr,"dbg2       nbeams_amp_total:         %d\n",mb_info->nbeams_amp_total);
-		fprintf(stderr,"dbg2       nbeams_amp_good:          %d\n",mb_info->nbeams_amp_good);
-		fprintf(stderr,"dbg2       nbeams_amp_zero:          %d\n",mb_info->nbeams_amp_zero);
-		fprintf(stderr,"dbg2       nbeams_amp_flagged:       %d\n",mb_info->nbeams_amp_flagged);
-		fprintf(stderr,"dbg2       npixels_ss:               %d\n",mb_info->npixels_ss);
-		fprintf(stderr,"dbg2       npixels_ss_total:         %d\n",mb_info->npixels_ss_total);
-		fprintf(stderr,"dbg2       npixels_ss_good:          %d\n",mb_info->npixels_ss_good);
-		fprintf(stderr,"dbg2       npixels_ss_zero:          %d\n",mb_info->npixels_ss_zero);
-		fprintf(stderr,"dbg2       npixels_ss_flagged:       %d\n",mb_info->npixels_ss_flagged);
-		fprintf(stderr,"dbg2       time_total:               %f\n",mb_info->time_total);
-		fprintf(stderr,"dbg2       dist_total:               %f\n",mb_info->dist_total);
-		fprintf(stderr,"dbg2       speed_avg:                %f\n",mb_info->speed_avg);
-		fprintf(stderr,"dbg2       time_start:               %f\n",mb_info->time_start);
-		fprintf(stderr,"dbg2       lon_start:                %f\n",mb_info->lon_start);
-		fprintf(stderr,"dbg2       lat_start:                %f\n",mb_info->lat_start);
-		fprintf(stderr,"dbg2       depth_start:              %f\n",mb_info->depth_start);
-		fprintf(stderr,"dbg2       heading_start:            %f\n",mb_info->heading_start);
-		fprintf(stderr,"dbg2       speed_start:              %f\n",mb_info->speed_start);
-		fprintf(stderr,"dbg2       sonardepth_start:         %f\n",mb_info->sonardepth_start);
-		fprintf(stderr,"dbg2       sonaraltitude_start:      %f\n",mb_info->sonaraltitude_start);
-		fprintf(stderr,"dbg2       time_end:                 %f\n",mb_info->time_end);
-		fprintf(stderr,"dbg2       lon_end:                  %f\n",mb_info->lon_end);
-		fprintf(stderr,"dbg2       lat_end:                  %f\n",mb_info->lat_end);
-		fprintf(stderr,"dbg2       depth_end:                %f\n",mb_info->depth_end);
-		fprintf(stderr,"dbg2       heading_end:              %f\n",mb_info->heading_end);
-		fprintf(stderr,"dbg2       speed_end:                %f\n",mb_info->speed_end);
-		fprintf(stderr,"dbg2       sonardepth_end:           %f\n",mb_info->sonardepth_end);
-		fprintf(stderr,"dbg2       sonaraltitude_end:        %f\n",mb_info->sonaraltitude_end);
-		fprintf(stderr,"dbg2       lon_min:                  %f\n",mb_info->lon_min);
-		fprintf(stderr,"dbg2       lon_max:                  %f\n",mb_info->lon_max);
-		fprintf(stderr,"dbg2       lat_min:                  %f\n",mb_info->lat_min);
-		fprintf(stderr,"dbg2       lat_max:                  %f\n",mb_info->lat_max);
-		fprintf(stderr,"dbg2       sonardepth_min:           %f\n",mb_info->sonardepth_min);
-		fprintf(stderr,"dbg2       sonardepth_max:           %f\n",mb_info->sonardepth_max);
-		fprintf(stderr,"dbg2       altitude_min:             %f\n",mb_info->altitude_min);
-		fprintf(stderr,"dbg2       altitude_max:             %f\n",mb_info->altitude_max);
-		fprintf(stderr,"dbg2       depth_min:                %f\n",mb_info->depth_min);
-		fprintf(stderr,"dbg2       depth_max:                %f\n",mb_info->depth_max);
-		fprintf(stderr,"dbg2       amp_min:                  %f\n",mb_info->amp_min);
-		fprintf(stderr,"dbg2       amp_max:                  %f\n",mb_info->amp_max);
-		fprintf(stderr,"dbg2       ss_min:                   %f\n",mb_info->ss_min);
-		fprintf(stderr,"dbg2       ss_max:                   %f\n",mb_info->ss_max);
-		fprintf(stderr,"dbg2       problem_nodata:           %d\n",mb_info->problem_nodata);
-		fprintf(stderr,"dbg2       problem_zeronav:          %d\n",mb_info->problem_zeronav);
-		fprintf(stderr,"dbg2       problem_toofast:          %d\n",mb_info->problem_toofast);
-		fprintf(stderr,"dbg2       problem_avgtoofast:       %d\n",mb_info->problem_avgtoofast);
-		fprintf(stderr,"dbg2       problem_toodeep:          %d\n",mb_info->problem_toodeep);
-		fprintf(stderr,"dbg2       problem_baddatagram:      %d\n",mb_info->problem_baddatagram);
-		fprintf(stderr,"dbg2       mask_nx:                  %d\n",mb_info->mask_nx);
-		fprintf(stderr,"dbg2       mask_ny:                  %d\n",mb_info->mask_ny);
-		fprintf(stderr,"dbg2       mask_dx:                  %f\n",mb_info->mask_dx);
-		fprintf(stderr,"dbg2       mask_dy:                  %f\n",mb_info->mask_dy);
-		fprintf(stderr,"dbg2       mask:\n");
-		for (j=mb_info->mask_ny-1;j>=0;j--)
-			{
-			fprintf(stderr, "dbg2       ");
-			for (i=0;i<mb_info->mask_nx;i++)
-				{
-				k = i + j * mb_info->mask_nx;
-				fprintf(stderr, " %1d", mb_info->mask[k]);
-				}
-			fprintf(stderr, "\n");
-			}
-		fprintf(stderr,"dbg2       error:                    %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_make_info(int verbose, int force,
-		    char *file, int format, int *error)
-{
-	char	*function_name = "mb_make_info";
-	int	status = MB_SUCCESS;
-	char	inffile[MB_PATH_MAXLINE];
-	char	fbtfile[MB_PATH_MAXLINE];
-	char	fnvfile[MB_PATH_MAXLINE];
-	char	command[MB_PATH_MAXLINE];
-	int	datmodtime = 0;
-	int	infmodtime = 0;
-	int	fbtmodtime = 0;
-	int	fnvmodtime = 0;
-	struct stat file_status;
-	int	fstat;
-	int	shellstatus;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       force:      %d\n",force);
-		fprintf(stderr,"dbg2       file:       %s\n",file);
-		fprintf(stderr,"dbg2       format:     %d\n",format);
-		}
-
-	/* check for existing ancillary files */
-	sprintf(inffile, "%s.inf", file);
-	sprintf(fbtfile, "%s.fbt", file);
-	sprintf(fnvfile, "%s.fnv", file);
-	if ((fstat = stat(file, &file_status)) == 0
-		&& (file_status.st_mode & S_IFMT) != S_IFDIR)
-		{
-		datmodtime = file_status.st_mtime;
-		}
-	if ((fstat = stat(inffile, &file_status)) == 0
-		&& (file_status.st_mode & S_IFMT) != S_IFDIR
-		&& file_status.st_size  > 0)
-		{
-		infmodtime = file_status.st_mtime;
-		}
-	if ((fstat = stat(fbtfile, &file_status)) == 0
-		&& (file_status.st_mode & S_IFMT) != S_IFDIR
-		&& file_status.st_size  > 0)
-		{
-		fbtmodtime = file_status.st_mtime;
-		}
-	if ((fstat = stat(fnvfile, &file_status)) == 0
-		&& (file_status.st_mode & S_IFMT) != S_IFDIR
-		&& file_status.st_size  > 0)
-		{
-		fnvmodtime = file_status.st_mtime;
-		}
-
-	/* make new inf file if not there or out of date */
-	if (force == MB_YES
-		|| (datmodtime > 0 && datmodtime > infmodtime))
-		{
-		if (verbose >= 1)
-			fprintf(stderr,"\nGenerating inf file for %s\n",file);
-		sprintf(command, "mbinfo -F %d -I %s -G -N -O -M10/10",
-			format, file);
-		if (verbose >= 2)
-			fprintf(stderr,"\t%s\n",command);
-		shellstatus = system(command);
-		}
-
-	/* make new fbt file if not there or out of date */
-	if ((force
-		|| (datmodtime > 0
-	    	&& datmodtime > fbtmodtime))
-	    && format != MBF_SBSIOMRG
-	    && format != MBF_SBSIOCEN
-	    && format != MBF_SBSIOLSI
-	    && format != MBF_SBURICEN
-	    && format != MBF_SBURIVAX
-	    && format != MBF_SBSIOSWB
-	    && format != MBF_HSLDEDMB
-	    && format != MBF_HSURICEN
-	    && format != MBF_HSURIVAX
-	    && format != MBF_SB2000SS
-	    && format != MBF_SB2000SB
-	    && format != MBF_MSTIFFSS
-	    && format != MBF_MBLDEOIH
-	    && format != MBF_MBNETCDF
-	    && format != MBF_ASCIIXYZ
-	    && format != MBF_ASCIIYXZ
-	    && format != MBF_ASCIIXYT
-	    && format != MBF_ASCIIYXT
-	    && format != MBF_HYDROB93
-	    && format != MBF_SEGYSEGY
-	    && format != MBF_MGD77DAT
-	    && format != MBF_MBARIROV
-	    && format != MBF_MBARROV2
-	    && format != MBF_MBPRONAV)
-		{
-		if (verbose >= 1)
-			fprintf(stderr,"Generating fbt file for %s\n",file);
-		sprintf(command, "mbcopy -F %d/71 -I %s -D -O %s.fbt",
-			format, file, file);
-		shellstatus = system(command);
-		}
-
-	/* make new fnv file if not there or out of date */
-	if ((force
-		|| (datmodtime > 0
-	    		&& datmodtime > fnvmodtime))
-	    && format != MBF_ASCIIXYZ
-	    && format != MBF_ASCIIYXZ
-	    && format != MBF_ASCIIXYT
-	    && format != MBF_ASCIIYXT
-	    && format != MBF_HYDROB93
-	    && format != MBF_SEGYSEGY
-	    && format != MBF_MGD77DAT
-	    && format != MBF_MBARIROV
-	    && format != MBF_MBARROV2
-	    && format != MBF_NVNETCDF
-	    && format != MBF_MBPRONAV)
-		{
-		if (verbose >= 1)
-			fprintf(stderr,"Generating fnv file for %s\n",file);
-		sprintf(command, "mblist -F %d -I %s -O tMXYHScRPr=X=Y+X+Y -UN > %s.fnv",
-			format, file, file);
-		shellstatus = system(command);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_get_fbt(int verbose, char *file, int *format, int *error)
-{
-	char	*function_name = "mb_get_fbt";
-	int	status = MB_SUCCESS;
-	char	fbtfile[MB_PATH_MAXLINE];
-	int	datmodtime = 0;
-	int	fbtmodtime = 0;
-	struct stat file_status;
-	int	fstat;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       file:       %s\n",file);
-		fprintf(stderr,"dbg2       format:     %d\n",*format);
-		}
-
-	/* check for existing fbt file */
-	sprintf(fbtfile, "%s.fbt", file);
-	if ((fstat = stat(file, &file_status)) == 0
-		&& (file_status.st_mode & S_IFMT) != S_IFDIR)
-		{
-		datmodtime = file_status.st_mtime;
-		}
-	if ((fstat = stat(fbtfile, &file_status)) == 0
-		&& (file_status.st_mode & S_IFMT) != S_IFDIR)
-		{
-		fbtmodtime = file_status.st_mtime;
-		}
-
-	/* replace file with fbt file if fbt file exists */
-	if (datmodtime > 0 && fbtmodtime > 0)
-	    {
-	    strcpy(file, fbtfile);
-	    *format = 71;
-	    }
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       file:       %s\n",file);
-		fprintf(stderr,"dbg2       format:     %d\n",*format);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_get_fnv(int verbose, char *file, int *format, int *error)
-{
-	char	*function_name = "mb_get_fnv";
-	int	status = MB_SUCCESS;
-	char	fnvfile[MB_PATH_MAXLINE];
-	int	datmodtime = 0;
-	int	fnvmodtime = 0;
-	struct stat file_status;
-	int	fstat;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       file:       %s\n",file);
-		fprintf(stderr,"dbg2       format:     %d\n",*format);
-		}
-
-	/* check for existing fnv file */
-	sprintf(fnvfile, "%s.fnv", file);
-	if ((fstat = stat(file, &file_status)) == 0
-		&& (file_status.st_mode & S_IFMT) != S_IFDIR)
-		{
-		datmodtime = file_status.st_mtime;
-		}
-	if ((fstat = stat(fnvfile, &file_status)) == 0
-		&& (file_status.st_mode & S_IFMT) != S_IFDIR)
-		{
-		fnvmodtime = file_status.st_mtime;
-		}
-
-	/* replace file with fnv file if fnv file exists */
-	if (datmodtime > 0 && fnvmodtime > 0)
-	    {
-	    strcpy(file, fnvfile);
-	    *format = 166;
-	    }
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       file:       %s\n",file);
-		fprintf(stderr,"dbg2       format:     %d\n",*format);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_get_ffa(int verbose, char *file, int *format, int *error)
-{
-	char	*function_name = "mb_get_ffa";
-	int	status = MB_SUCCESS;
-	char	ffafile[MB_PATH_MAXLINE];
-	int	datmodtime = 0;
-	int	ffamodtime = 0;
-	struct stat file_status;
-	int	fstat;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       file:       %s\n",file);
-		fprintf(stderr,"dbg2       format:     %d\n",*format);
-		}
-
-	/* check for existing ffa file */
-	sprintf(ffafile, "%s.ffa", file);
-	if ((fstat = stat(file, &file_status)) == 0
-		&& (file_status.st_mode & S_IFMT) != S_IFDIR)
-		{
-		datmodtime = file_status.st_mtime;
-		}
-	if ((fstat = stat(ffafile, &file_status)) == 0
-		&& (file_status.st_mode & S_IFMT) != S_IFDIR)
-		{
-		ffamodtime = file_status.st_mtime;
-		}
-
-	/* replace file with ffa file if ffa file exists */
-	if (datmodtime > 0 && ffamodtime > 0)
-	    {
-	    strcpy(file, ffafile);
-	    *format = 71;
-	    }
-	else
-	    {
-	    status = MB_FAILURE;
-	    *error = MB_ERROR_FILE_NOT_FOUND;
-	    }
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       file:       %s\n",file);
-		fprintf(stderr,"dbg2       format:     %d\n",*format);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_get_ffs(int verbose, char *file, int *format, int *error)
-{
-	char	*function_name = "mb_get_ffs";
-	int	status = MB_SUCCESS;
-	char	ffsfile[MB_PATH_MAXLINE];
-	int	datmodtime = 0;
-	int	ffsmodtime = 0;
-	struct stat file_status;
-	int	fstat;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       file:       %s\n",file);
-		fprintf(stderr,"dbg2       format:     %d\n",*format);
-		}
-
-	/* check for existing ffs file */
-	sprintf(ffsfile, "%s.ffs", file);
-	if ((fstat = stat(file, &file_status)) == 0
-		&& (file_status.st_mode & S_IFMT) != S_IFDIR)
-		{
-		datmodtime = file_status.st_mtime;
-		}
-	if ((fstat = stat(ffsfile, &file_status)) == 0
-		&& (file_status.st_mode & S_IFMT) != S_IFDIR)
-		{
-		ffsmodtime = file_status.st_mtime;
-		}
-
-	/* replace file with ffs file if ffs file exists */
-	if (datmodtime > 0 && ffsmodtime > 0)
-	    {
-	    strcpy(file, ffsfile);
-	    *format = 71;
-	    }
-	else
-	    {
-	    status = MB_FAILURE;
-	    *error = MB_ERROR_FILE_NOT_FOUND;
-	    }
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       file:       %s\n",file);
-		fprintf(stderr,"dbg2       format:     %d\n",*format);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_swathbounds(int verbose, int checkgood,
-			double navlon, double navlat, double heading,
-			int nbath, int nss,
-			char *beamflag, double *bath,
-			double *bathacrosstrack, double *bathalongtrack,
-			double *ss, double *ssacrosstrack, double *ssalongtrack,
-			int *ibeamport,
-			int *ibeamcntr,
-			int *ibeamstbd,
-			int *ipixelport,
-			int *ipixelcntr,
-			int *ipixelstbd,
-			int *error)
-{
-	char	*function_name = "mb_swathbounds";
-	int	status = MB_SUCCESS;
-	double	mtodeglon, mtodeglat;
-	double	headingx, headingy;
-	double	xtrackmin, xtrackmax, distmin;
-	int	found;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:       %d\n",verbose);
-		fprintf(stderr,"dbg2       checkgood:     %d\n",checkgood);
-		fprintf(stderr,"dbg2       longitude:     %f\n",navlon);
-		fprintf(stderr,"dbg2       latitude:      %f\n",navlat);
-		fprintf(stderr,"dbg2       heading:       %f\n",heading);
-		fprintf(stderr,"dbg2       nbath:         %d\n",nbath);
-		if (verbose >= 3 && nbath > 0)
-		  {
-		  fprintf(stderr,"dbg3       beam   flag  bath  crosstrack alongtrack\n");
-		  for (i=0;i<nbath;i++)
-		    fprintf(stderr,"dbg3       %4d   %3d   %f    %f     %f\n",
-			i,beamflag[i],bath[i],
-			bathacrosstrack[i],bathalongtrack[i]);
-		  }
-		fprintf(stderr,"dbg2       nss:      %d\n",nss);
-		if (verbose >= 3 && nss > 0)
-		  {
-		  fprintf(stderr,"dbg3       pixel sidescan crosstrack alongtrack\n");
-		  for (i=0;i<nss;i++)
-		    fprintf(stderr,"dbg3       %4d   %f    %f     %f\n",
-			i,ss[i],
-			ssacrosstrack[i],ssalongtrack[i]);
-		  }
-		}
-
-	/* get coordinate scaling */
-	mb_coor_scale(verbose,navlat,&mtodeglon,&mtodeglat);
-	headingx = sin(heading * DTR);
-	headingy = cos(heading * DTR);
-
-	/* set starting values */
-	*ibeamport = 0;
-	*ibeamcntr = 0;
-	*ibeamstbd = 0;
-	*ipixelport = 0;
-	*ipixelcntr = 0;
-	*ipixelstbd = 0;
-
-	/* get min max of non-null beams */
-	xtrackmin = 0.0;
-	xtrackmax = 0.0;
-	distmin = 0.0;
-	found = MB_NO;
-	for (i=0;i<nbath;i++)
-		{
-		if ((checkgood && mb_beam_ok(beamflag[i])) || !mb_beam_check_flag_null(beamflag[i]))
-			{
-			if (found == MB_NO)
-				{
-				*ibeamport = i;
-				*ibeamcntr = i;
-				*ibeamstbd = i;
-				xtrackmin = bathacrosstrack[i];
-				distmin = fabs(bathacrosstrack[i]);
-				xtrackmax = bathacrosstrack[i];
-				found = MB_YES;
-				}
-			else
-				{
-				if (fabs(bathacrosstrack[i]) < distmin)
-					{
-					*ibeamcntr = i;
-					distmin = fabs(bathacrosstrack[i]);
-					}
-				if (bathacrosstrack[i] < xtrackmin)
-					{
-					*ibeamport = i;
-					xtrackmin = bathacrosstrack[i];
-					}
-				else if (bathacrosstrack[i] > xtrackmax)
-					{
-					*ibeamstbd = i;
-					xtrackmax = bathacrosstrack[i];
-					}
-				}
-			}
-		}
-
-	/* get min max of non-null pixels */
-	xtrackmin = 0.0;
-	xtrackmax = 0.0;
-	distmin = 0.0;
-	found = MB_NO;
-	for (i=0;i<nss;i++)
-		{
-		if (ss[i] > 0.0)
-			{
-			if (found == MB_NO)
-				{
-				*ipixelport = i;
-				*ipixelcntr = i;
-				*ipixelstbd = i;
-				xtrackmin = ssacrosstrack[i];
-				distmin = fabs(ssacrosstrack[i]);
-				xtrackmax = ssacrosstrack[i];
-				found = MB_YES;
-				}
-			else
-				{
-				if (fabs(ssacrosstrack[i]) < distmin)
-					{
-					*ipixelcntr = i;
-					distmin = fabs(ssacrosstrack[i]);
-					}
-				if (ssacrosstrack[i] < xtrackmin)
-					{
-					*ipixelport = i;
-					xtrackmin = ssacrosstrack[i];
-					}
-				else if (ssacrosstrack[i] > xtrackmax)
-					{
-					*ipixelstbd = i;
-					xtrackmax = ssacrosstrack[i];
-					}
-				}
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       ibeamport:     %d\n",*ibeamport);
-		fprintf(stderr,"dbg2       ibeamport:     %d\n",*ibeamcntr);
-		fprintf(stderr,"dbg2       ibeamstbd:     %d\n",*ibeamstbd);
-		fprintf(stderr,"dbg2       ipixelport:    %d\n",*ipixelport);
-		fprintf(stderr,"dbg2       ipixelport:    %d\n",*ipixelcntr);
-		fprintf(stderr,"dbg2       ipixelstbd:    %d\n",*ipixelstbd);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mb_info_init(int verbose, struct mb_info_struct *mb_info, int *error)
-{
-	char	*function_name = "mb_info_init";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_info:    %p\n",(void *)mb_info);
-		}
-
-	/* initialize mb_info_struct */
-	mb_info->loaded = MB_NO;
-	mb_info->file[0] = '\0';;
-	mb_info->nrecords = 0;
-	mb_info->nrecords_ss1 = 0;
-	mb_info->nrecords_ss2 = 0;
-	mb_info->nrecords_sbp = 0;
-	mb_info->nbeams_bath = 0;
-	mb_info->nbeams_bath_total = 0;
-	mb_info->nbeams_bath_good = 0;
-	mb_info->nbeams_bath_zero = 0;
-	mb_info->nbeams_bath_flagged = 0;
-	mb_info->nbeams_amp = 0;
-	mb_info->nbeams_amp_total = 0;
-	mb_info->nbeams_amp_good = 0;
-	mb_info->nbeams_amp_zero = 0;
-	mb_info->nbeams_amp_flagged = 0;
-	mb_info->npixels_ss = 0;
-	mb_info->npixels_ss_total = 0;
-	mb_info->npixels_ss_good = 0;
-	mb_info->npixels_ss_zero = 0;
-	mb_info->npixels_ss_flagged = 0;
-
-	mb_info->time_total = 0.0;
-	mb_info->dist_total = 0.0;
-	mb_info->speed_avg = 0.0;
-
-	mb_info->time_start = 0.0;
-	mb_info->lon_start = 0.0;
-	mb_info->lat_start = 0.0;
-	mb_info->depth_start = 0.0;
-	mb_info->heading_start = 0.0;
-	mb_info->speed_start = 0.0;
-	mb_info->sonardepth_start = 0.0;
-	mb_info->sonaraltitude_start = 0.0;
-
-	mb_info->time_end = 0.0;
-	mb_info->lon_end = 0.0;
-	mb_info->lat_end = 0.0;
-	mb_info->depth_end = 0.0;
-	mb_info->heading_end = 0.0;
-	mb_info->speed_end = 0.0;
-	mb_info->sonardepth_end = 0.0;
-	mb_info->sonaraltitude_end = 0.0;
-
-	mb_info->lon_min = 0.0;
-	mb_info->lon_max = 0.0;
-	mb_info->lat_min = 0.0;
-	mb_info->lat_max = 0.0;
-	mb_info->sonardepth_min = 0.0;
-	mb_info->sonardepth_max = 0.0;
-	mb_info->altitude_min = 0.0;
-	mb_info->altitude_max = 0.0;
-	mb_info->depth_min = 0.0;
-	mb_info->depth_max = 0.0;
-	mb_info->amp_min = 0.0;
-	mb_info->amp_max = 0.0;
-	mb_info->ss_min = 0.0;
-	mb_info->ss_max = 0.0;
-
-	mb_info->problem_nodata = 0;
-	mb_info->problem_zeronav = 0;
-	mb_info->problem_toofast = 0;
-	mb_info->problem_avgtoofast = 0;
-	mb_info->problem_toodeep = 0;
-	mb_info->problem_baddatagram = 0;
-
-	mb_info->mask_nx = 0;
-	mb_info->mask_ny = 0;
-	mb_info->mask_dx = 0;
-	mb_info->mask_dy = 0;
-	mb_info->mask_alloc = 0;
-	mb_info->mask = NULL;
-
-	*error = MB_ERROR_NO_ERROR;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:          %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_get_info_datalist(int verbose, char *read_file, int *format,
-			struct mb_info_struct *mb_info, int lonflip, int *error)
-{
-	char	*function_name = "mb_get_info_datalist";
-	int	status = MB_SUCCESS;
-	char	swathfile[MB_PATH_MAXLINE];
-	struct mb_info_struct mb_info_file;
-	int	read_datalist = MB_NO;
-	void	*datalist;
-	int	look_processed = MB_DATALIST_LOOK_UNSET;
-	int	read_data;
-	double	file_weight;
-	int	nfile = 0;
-	int	i, j, k;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       read_file:  %s\n",read_file);
-		fprintf(stderr,"dbg2       format:     %d\n",*format);
-		fprintf(stderr,"dbg2       lonflip:    %d\n",lonflip);
-		}
-
-	/* initialize mb_info_struct */
-	mb_info_init(verbose, mb_info, error);
-	strcpy(mb_info->file, read_file);
-
-	/* get format if required */
-	if (*format == 0)
-		mb_get_format(verbose,read_file,NULL,format,error);
-
-	/* determine whether to read one file or a list of files */
-	if (*format < 0)
-		read_datalist = MB_YES;
-
-	/* open file list */
-	if (read_datalist == MB_YES)
-	    {
-	    if ((status = mb_datalist_open(verbose, &datalist,
-					    read_file, look_processed, error)) != MB_SUCCESS)
-		{
-		*error = MB_ERROR_OPEN_FAIL;
-		status = MB_FAILURE;
-		fprintf(stderr,"\nUnable to open data list file: %s\n",
-			read_file);
-		fprintf(stderr,"\nProgram terminated in function <%s>\n",function_name);
-		exit(status);
-		}
-	    if ((status = mb_datalist_read(verbose,datalist,
-			    swathfile,format,&file_weight,error))
-			    == MB_SUCCESS)
-		read_data = MB_YES;
-	    else
-		read_data = MB_NO;
-	    }
-	/* else copy single filename to be read */
-	else
-	    {
-	    strcpy(swathfile, read_file);
-	    read_data = MB_YES;
-	    }
-
-	/* loop over all files to be read */
-	while (read_data == MB_YES)
-		{
-		/* read inf file */
-		status = mb_get_info(verbose, swathfile, &mb_info_file, lonflip, error);
-
-		/* only use if there are data */
-		if (mb_info_file.nrecords > 0)
-			{
-
-			/* add in the results */
-                	mb_info->nrecords += mb_info_file.nrecords;
-                	mb_info->nrecords_ss1 += mb_info_file.nrecords_ss1;
-                	mb_info->nrecords_ss2 += mb_info_file.nrecords_ss2;
-                	mb_info->nrecords_sbp += mb_info_file.nrecords_sbp;
-                	mb_info->nbeams_bath += mb_info_file.nbeams_bath;
-                	mb_info->nbeams_bath_total += mb_info_file.nbeams_bath_total;
-                	mb_info->nbeams_bath_good += mb_info_file.nbeams_bath_good;
-                	mb_info->nbeams_bath_zero += mb_info_file.nbeams_bath_zero;
-                	mb_info->nbeams_bath_flagged += mb_info_file.nbeams_bath_flagged;
-                	mb_info->nbeams_amp += mb_info_file.nbeams_amp;
-                	mb_info->nbeams_amp_total += mb_info_file.nbeams_amp_total;
-                	mb_info->nbeams_amp_good += mb_info_file.nbeams_amp_good;
-                	mb_info->nbeams_amp_zero += mb_info_file.nbeams_amp_zero;
-                	mb_info->nbeams_amp_flagged += mb_info_file.nbeams_amp_flagged;
-                	mb_info->npixels_ss += mb_info_file.npixels_ss;
-                	mb_info->npixels_ss_total += mb_info_file.npixels_ss_total;
-                	mb_info->npixels_ss_good += mb_info_file.npixels_ss_good;
-                	mb_info->npixels_ss_zero += mb_info_file.npixels_ss_zero;
-                	mb_info->npixels_ss_flagged += mb_info_file.npixels_ss_flagged;
-
-                	mb_info->time_total += mb_info_file.time_total;
-                	mb_info->dist_total += mb_info_file.dist_total;
-                	/* mb_info.speed_avg += mb_info_file.speed_avg;*/
-
-			if (nfile == 0)
-				{
-                		mb_info->time_start += mb_info_file.time_start;
-                		mb_info->lon_start += mb_info_file.lon_start;
-                		mb_info->lat_start += mb_info_file.lat_start;
-                		mb_info->depth_start += mb_info_file.depth_start;
-                		mb_info->heading_start += mb_info_file.heading_start;
-                		mb_info->speed_start += mb_info_file.speed_start;
-                		mb_info->sonardepth_start += mb_info_file.sonardepth_start;
-                		mb_info->sonaraltitude_start += mb_info_file.sonaraltitude_start;
-				}
-
-                	mb_info->time_end += mb_info_file.time_end;
-                	mb_info->lon_end += mb_info_file.lon_end;
-                	mb_info->lat_end += mb_info_file.lat_end;
-                	mb_info->depth_end += mb_info_file.depth_end;
-                	mb_info->heading_end += mb_info_file.heading_end;
-                	mb_info->speed_end += mb_info_file.speed_end;
-                	mb_info->sonardepth_end += mb_info_file.sonardepth_end;
-                	mb_info->sonaraltitude_end += mb_info_file.sonaraltitude_end;
-
-			if (nfile == 0)
-				{
-                		mb_info->lon_min = mb_info_file.lon_min;
-                		mb_info->lon_max = mb_info_file.lon_max;
-                		mb_info->lat_min = mb_info_file.lat_min;
-                		mb_info->lat_max = mb_info_file.lat_max;
-                		mb_info->sonardepth_min = mb_info_file.sonardepth_min;
-                		mb_info->sonardepth_max = mb_info_file.sonardepth_max;
-                		mb_info->altitude_min = mb_info_file.altitude_min;
-                		mb_info->altitude_max = mb_info_file.altitude_max;
-                		mb_info->depth_min = mb_info_file.depth_min;
-                		mb_info->depth_max = mb_info_file.depth_max;
-                		mb_info->amp_min = mb_info_file.amp_min;
-                		mb_info->amp_max = mb_info_file.amp_max;
-                		mb_info->ss_min = mb_info_file.ss_min;
-                		mb_info->ss_max = mb_info_file.ss_max;
-				}
-			else
-				{
-				if (mb_info->lon_min == 0.0)
-					mb_info->lon_min = mb_info_file.lon_min;
-                		else
-					mb_info->lon_min = MIN(mb_info_file.lon_min, mb_info->lon_min);
-                		if (mb_info->lon_max == 0.0)
-					mb_info->lon_max = mb_info_file.lon_max;
-                		else
-					mb_info->lon_max = MAX(mb_info_file.lon_max, mb_info->lon_max);
-                		if (mb_info->lat_min == 0.0)
-					mb_info->lat_min = mb_info_file.lat_min;
-                		else
-					mb_info->lat_min = MIN(mb_info_file.lat_min, mb_info->lat_min);
-                		if (mb_info->lat_max == 0.0)
-					mb_info->lat_max = mb_info_file.lat_max;
-                		else
-					mb_info->lat_max = MAX(mb_info_file.lat_max, mb_info->lat_max);
-                		mb_info->sonardepth_min = MIN(mb_info_file.sonardepth_min, mb_info->sonardepth_min);
-                		mb_info->sonardepth_max = MAX(mb_info_file.sonardepth_max, mb_info->sonardepth_max);
-                		mb_info->altitude_min = MIN(mb_info_file.altitude_min, mb_info->altitude_min);
-                		mb_info->altitude_max = MAX(mb_info_file.altitude_max, mb_info->altitude_max);
-                		mb_info->depth_min = MIN(mb_info_file.depth_min, mb_info->depth_min);
-                		mb_info->depth_max = MAX(mb_info_file.depth_max, mb_info->depth_max);
-                		mb_info->amp_min = MIN(mb_info_file.amp_min, mb_info->amp_min);
-                		mb_info->amp_max = MAX(mb_info_file.amp_max, mb_info->amp_max);
-                		mb_info->ss_min = MIN(mb_info_file.ss_min, mb_info->ss_min);
-                		mb_info->ss_max = MAX(mb_info_file.ss_max, mb_info->ss_max);
-				}
-
-                	mb_info->problem_nodata += mb_info_file.problem_nodata;
-                	mb_info->problem_zeronav += mb_info_file.problem_zeronav;
-                	mb_info->problem_toofast += mb_info_file.problem_toofast;
-                	mb_info->problem_avgtoofast += mb_info_file.problem_avgtoofast;
-                	mb_info->problem_toodeep += mb_info_file.problem_toodeep;
-                	mb_info->problem_baddatagram += mb_info_file.problem_baddatagram;
-
-			nfile++;
-			}
-
-		/* check memory */
-		if (verbose >= 4)
-			status = mb_memory_list(verbose,error);
-
-		/* figure out whether and what to read next */
-        	if (read_datalist == MB_YES)
-                	{
-			if ((status = mb_datalist_read(verbose,datalist,
-				    swathfile,format,&file_weight,error))
-				    == MB_SUCCESS)
-                        	read_data = MB_YES;
-                	else
-                        	read_data = MB_NO;
-                	}
-        	else
-                	{
-                	read_data = MB_NO;
-                	}
-
-		/* end loop over files in list */
-		}
-        if (read_datalist == MB_YES)
-		mb_datalist_close(verbose,&datalist,error);
-
-	/* check memory */
-	if (verbose >= 4)
-		status = mb_memory_list(verbose,error);
-
-	/* set error and status (if you got here you succeeded */
-	*error = MB_ERROR_NO_ERROR;
-	status = MB_SUCCESS;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       loaded:                   %d\n",mb_info->loaded);
-		fprintf(stderr,"dbg2       file:                     %s\n",mb_info->file);
-		fprintf(stderr,"dbg2       nrecords:                 %d\n",mb_info->nrecords);
-		fprintf(stderr,"dbg2       nrecords_sbp:             %d\n",mb_info->nrecords_sbp);
-		fprintf(stderr,"dbg2       nrecords_ss1:             %d\n",mb_info->nrecords_ss1);
-		fprintf(stderr,"dbg2       nrecords_ss2:             %d\n",mb_info->nrecords_ss2);
-		fprintf(stderr,"dbg2       nbeams_bath:              %d\n",mb_info->nbeams_bath);
-		fprintf(stderr,"dbg2       nbeams_bath_total:        %d\n",mb_info->nbeams_bath_total);
-		fprintf(stderr,"dbg2       nbeams_bath_good:         %d\n",mb_info->nbeams_bath_good);
-		fprintf(stderr,"dbg2       nbeams_bath_zero:         %d\n",mb_info->nbeams_bath_zero);
-		fprintf(stderr,"dbg2       nbeams_bath_flagged:      %d\n",mb_info->nbeams_bath_flagged);
-		fprintf(stderr,"dbg2       nbeams_amp:               %d\n",mb_info->nbeams_amp);
-		fprintf(stderr,"dbg2       nbeams_amp_total:         %d\n",mb_info->nbeams_amp_total);
-		fprintf(stderr,"dbg2       nbeams_amp_good:          %d\n",mb_info->nbeams_amp_good);
-		fprintf(stderr,"dbg2       nbeams_amp_zero:          %d\n",mb_info->nbeams_amp_zero);
-		fprintf(stderr,"dbg2       nbeams_amp_flagged:       %d\n",mb_info->nbeams_amp_flagged);
-		fprintf(stderr,"dbg2       npixels_ss:               %d\n",mb_info->npixels_ss);
-		fprintf(stderr,"dbg2       npixels_ss_total:         %d\n",mb_info->npixels_ss_total);
-		fprintf(stderr,"dbg2       npixels_ss_good:          %d\n",mb_info->npixels_ss_good);
-		fprintf(stderr,"dbg2       npixels_ss_zero:          %d\n",mb_info->npixels_ss_zero);
-		fprintf(stderr,"dbg2       npixels_ss_flagged:       %d\n",mb_info->npixels_ss_flagged);
-		fprintf(stderr,"dbg2       time_total:               %f\n",mb_info->time_total);
-		fprintf(stderr,"dbg2       dist_total:               %f\n",mb_info->dist_total);
-		fprintf(stderr,"dbg2       speed_avg:                %f\n",mb_info->speed_avg);
-		fprintf(stderr,"dbg2       time_start:               %f\n",mb_info->time_start);
-		fprintf(stderr,"dbg2       lon_start:                %f\n",mb_info->lon_start);
-		fprintf(stderr,"dbg2       lat_start:                %f\n",mb_info->lat_start);
-		fprintf(stderr,"dbg2       depth_start:              %f\n",mb_info->depth_start);
-		fprintf(stderr,"dbg2       heading_start:            %f\n",mb_info->heading_start);
-		fprintf(stderr,"dbg2       speed_start:              %f\n",mb_info->speed_start);
-		fprintf(stderr,"dbg2       sonardepth_start:         %f\n",mb_info->sonardepth_start);
-		fprintf(stderr,"dbg2       sonaraltitude_start:      %f\n",mb_info->sonaraltitude_start);
-		fprintf(stderr,"dbg2       time_end:                 %f\n",mb_info->time_end);
-		fprintf(stderr,"dbg2       lon_end:                  %f\n",mb_info->lon_end);
-		fprintf(stderr,"dbg2       lat_end:                  %f\n",mb_info->lat_end);
-		fprintf(stderr,"dbg2       depth_end:                %f\n",mb_info->depth_end);
-		fprintf(stderr,"dbg2       heading_end:              %f\n",mb_info->heading_end);
-		fprintf(stderr,"dbg2       speed_end:                %f\n",mb_info->speed_end);
-		fprintf(stderr,"dbg2       sonardepth_end:           %f\n",mb_info->sonardepth_end);
-		fprintf(stderr,"dbg2       sonaraltitude_end:        %f\n",mb_info->sonaraltitude_end);
-		fprintf(stderr,"dbg2       lon_min:                  %f\n",mb_info->lon_min);
-		fprintf(stderr,"dbg2       lon_max:                  %f\n",mb_info->lon_max);
-		fprintf(stderr,"dbg2       lat_min:                  %f\n",mb_info->lat_min);
-		fprintf(stderr,"dbg2       lat_max:                  %f\n",mb_info->lat_max);
-		fprintf(stderr,"dbg2       sonardepth_min:           %f\n",mb_info->sonardepth_min);
-		fprintf(stderr,"dbg2       sonardepth_max:           %f\n",mb_info->sonardepth_max);
-		fprintf(stderr,"dbg2       altitude_min:             %f\n",mb_info->altitude_min);
-		fprintf(stderr,"dbg2       altitude_max:             %f\n",mb_info->altitude_max);
-		fprintf(stderr,"dbg2       depth_min:                %f\n",mb_info->depth_min);
-		fprintf(stderr,"dbg2       depth_max:                %f\n",mb_info->depth_max);
-		fprintf(stderr,"dbg2       amp_min:                  %f\n",mb_info->amp_min);
-		fprintf(stderr,"dbg2       amp_max:                  %f\n",mb_info->amp_max);
-		fprintf(stderr,"dbg2       ss_min:                   %f\n",mb_info->ss_min);
-		fprintf(stderr,"dbg2       ss_max:                   %f\n",mb_info->ss_max);
-		fprintf(stderr,"dbg2       problem_nodata:           %d\n",mb_info->problem_nodata);
-		fprintf(stderr,"dbg2       problem_zeronav:          %d\n",mb_info->problem_zeronav);
-		fprintf(stderr,"dbg2       problem_toofast:          %d\n",mb_info->problem_toofast);
-		fprintf(stderr,"dbg2       problem_avgtoofast:       %d\n",mb_info->problem_avgtoofast);
-		fprintf(stderr,"dbg2       problem_toodeep:          %d\n",mb_info->problem_toodeep);
-		fprintf(stderr,"dbg2       problem_baddatagram:      %d\n",mb_info->problem_baddatagram);
-		fprintf(stderr,"dbg2       mask_nx:                  %d\n",mb_info->mask_nx);
-		fprintf(stderr,"dbg2       mask_ny:                  %d\n",mb_info->mask_ny);
-		fprintf(stderr,"dbg2       mask_dx:                  %f\n",mb_info->mask_dx);
-		fprintf(stderr,"dbg2       mask_dy:                  %f\n",mb_info->mask_dy);
-		fprintf(stderr,"dbg2       mask:\n");
-		for (j=mb_info->mask_ny-1;j>=0;j--)
-			{
-			fprintf(stderr, "dbg2       ");
-			for (i=0;i<mb_info->mask_nx;i++)
-				{
-				k = i + j * mb_info->mask_nx;
-				fprintf(stderr, " %1d", mb_info->mask[k]);
-				}
-			fprintf(stderr, "\n");
-			}
-		fprintf(stderr,"dbg2       error:          %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mb_close.c b/src/mbio/mb_close.c
deleted file mode 100644
index f643c7a..0000000
--- a/src/mbio/mb_close.c
+++ /dev/null
@@ -1,144 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mb_close.c	1/25/93
- *	$Id: mb_close.c 2224 2015-02-04 19:14:05Z caress $
- *
- *    Copyright (c) 1993-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mb_close.c closes a multibeam data file which had been opened for
- * reading or writing.
- *
- * Author:	D. W. Caress
- * Date:	January 25, 1993
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_define.h"
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mb_segy.h"
-#include "../surf/mb_sapi.h"
-#include "gsf.h"
-#include "netcdf.h"
-
-static	char	rcs_id[]="$Id: mb_close.c 2224 2015-02-04 19:14:05Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mb_close(int verbose, void **mbio_ptr, int *error)
-{
-	char	*function_name = "mb_close";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)*mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) *mbio_ptr;
-
-	/* deallocate format dependent structures */
-	status = (*mb_io_ptr->mb_io_format_free)(verbose,*mbio_ptr,error);
-
-	/* deallocate system dependent structures */
-	/*status = (*mb_io_ptr->mb_io_store_free)
-			(verbose,*mbio_ptr,&(mb_io_ptr->store_data),error);*/
-
-	/* deallocate memory for arrays within the mbio descriptor */
-	if (mb_io_ptr->filetype == MB_FILETYPE_XDR
-		&& mb_io_ptr->xdrs != NULL)
-		status = mb_freed(verbose,__FILE__, __LINE__,(void **)&mb_io_ptr->xdrs,error);
-	if (mb_io_ptr->filetype == MB_FILETYPE_XDR
-		&& mb_io_ptr->xdrs2 != NULL)
-		status = mb_freed(verbose,__FILE__, __LINE__,(void **)&mb_io_ptr->xdrs2,error);
-	if (mb_io_ptr->filetype == MB_FILETYPE_XDR
-		&& mb_io_ptr->xdrs3 != NULL)
-		status = mb_freed(verbose,__FILE__, __LINE__,(void **)&mb_io_ptr->xdrs3,error);
-	if (mb_io_ptr->hdr_comment != NULL)
-		status = mb_freed(verbose,__FILE__, __LINE__,(void **)&mb_io_ptr->hdr_comment,error);
-	status = mb_deall_ioarrays(verbose, *mbio_ptr, error);
-
-	/* close the files if normal */
-	if (mb_io_ptr->filetype == MB_FILETYPE_NORMAL
-	    || mb_io_ptr->filetype == MB_FILETYPE_XDR)
-	    {
-	    if (mb_io_ptr->mbfp != NULL)
-		    fclose(mb_io_ptr->mbfp);
-	    if (mb_io_ptr->mbfp2 != NULL)
-		    fclose(mb_io_ptr->mbfp2);
-	    if (mb_io_ptr->mbfp3 != NULL)
-		    fclose(mb_io_ptr->mbfp3);
-	    }
-
-	/* else handle single normal files to be closed with mb_fileio_close() */
-	else if (mb_io_ptr->filetype == MB_FILETYPE_SINGLE)
-	    {
-	    status = mb_fileio_close(verbose, *mbio_ptr, error);
-	    }
-
-	/* else if gsf then use gsfClose */
-	else if (mb_io_ptr->filetype == MB_FILETYPE_GSF)
-	    {
-	    gsfClose((int) mb_io_ptr->gsfid);
-	    }
-
-	/* else if netcdf then use nc_close */
-	else if (mb_io_ptr->filetype == MB_FILETYPE_NETCDF)
-	    {
-	    if (mb_io_ptr->filemode == MB_FILEMODE_WRITE)
-		nc_enddef(mb_io_ptr->ncid);
-	    nc_close(mb_io_ptr->ncid);
-	    }
-
-        /* else handle surf files to be opened with libsapi */
-        else if (mb_io_ptr->filetype == MB_FILETYPE_SURF)
-            {
-  	    SAPI_close();
-	    }
-
-	/* deallocate UTM projection if required */
-	if (mb_io_ptr->projection_initialized == MB_YES)
-		{
-		mb_io_ptr->projection_initialized = MB_NO;
-		mb_proj_free(verbose, &(mb_io_ptr->pjptr), error);
-		}
-
-	/* deallocate the mbio descriptor */
-	status = mb_freed(verbose,__FILE__, __LINE__,(void **)mbio_ptr,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mb_compare.c b/src/mbio/mb_compare.c
deleted file mode 100644
index 115c1c8..0000000
--- a/src/mbio/mb_compare.c
+++ /dev/null
@@ -1,89 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mb_compare.c	11/19/98
- *    $Id: mb_compare.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1993-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mb_compare.c includes the "mb_" functions for comparing values
- * which are passed to the qsort routine.
- *
- * Author:	D. W. Caress
- * Date:	November 19,  1998
- *
- *
- */
-#include <stdio.h>
-#include <math.h>
-
-/* mbio include files */
-#include "mb_define.h"
-#include "mb_process.h"
-
-/* static char rcs_id[]="$Id: mb_compare.c,v 5.4 2003/07/26 17:59:32 caress Exp
-$"; */
-
-/*--------------------------------------------------------------------*/
-/* 	function mb_int_compare compares int values. */
-int mb_int_compare(const void *a, const void *b)
-{
-	int	*aa, *bb;
-
-	aa = (int *) a;
-	bb = (int *) b;
-
-	if (*aa > *bb)
-		return(1);
-	else
-		return(-1);
-}
-/*--------------------------------------------------------------------*/
-/* 	function mb_double_compare compares double values. */
-int mb_double_compare(const void *a, const void *b)
-{
-	double	*aa, *bb;
-
-	aa = (double *) a;
-	bb = (double *) b;
-
-	if (*aa > *bb)
-		return(1);
-	else
-		return(-1);
-}
-/*--------------------------------------------------------------------*/
-/* 	function mb_edit_compare compares mb_edit_struct values. */
-int mb_edit_compare(const void *a, const void *b)
-{
-	struct mb_edit_struct	*aa, *bb;
-
-	aa = (struct mb_edit_struct *) a;
-	bb = (struct mb_edit_struct *) b;
-
-/*if (fabs(aa->time_d - bb->time_d) < MB_ESF_MAXTIMEDIFF && aa->time_d != bb->time_d)
-{
-fprintf(stderr,"aa:%.7f bb:%.7f diff:%g\n",aa->time_d,bb->time_d,aa->time_d - bb->time_d);
-}*/
-	if (fabs(aa->time_d - bb->time_d) < MB_ESF_MAXTIMEDIFF)
-		{
-		if (aa->beam > bb->beam)
-			return(1);
-		else if (aa->beam < bb->beam)
-			return(-1);
-		else
-			return(0);
-		}
-	else if (aa->time_d > bb->time_d)
-		return(1);
-	else
-		return(-1);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mb_config.h b/src/mbio/mb_config.h
deleted file mode 100644
index 8d113a0..0000000
--- a/src/mbio/mb_config.h
+++ /dev/null
@@ -1,108 +0,0 @@
-/* src/mbio/mb_config.h.  Generated from mb_config.h.in by configure.  */
-/* src/mbio/mb_config.h.in.  Generated from configure.ac by autoheader.  */
-
-/* Machine is littleendian, (Byteswapping on) */
-#define BYTESWAPPED 1
-
-/* Machine is bigendian, (Byteswapping off) */
-/* #undef ENDIAN_BIG */
-
-/* Turned on OpenGL define in config */
-#define GOT_GL 1
-
-/* Define to 1 if you have the <dlfcn.h> header file. */
-#define HAVE_DLFCN_H 1
-
-/* Define to 1 if you have the <inttypes.h> header file. */
-#define HAVE_INTTYPES_H 1
-
-/* Define to 1 if you have the `m' library (-lm). */
-#define HAVE_LIBM 1
-
-/* Define to 1 if you have the `ws2_32' library (-lws2_32). */
-/* #undef HAVE_LIBWS2_32 */
-
-/* Have malloc.h */
-/* #undef HAVE_MALLOC_H */
-
-/* Define to 1 if you have the <memory.h> header file. */
-#define HAVE_MEMORY_H 1
-
-/* Define to 1 if you have the <rpc/rpc.h> header file. */
-#define HAVE_RPC_RPC_H 1
-
-/* Define to 1 if you have the <rpc/types.h> header file. */
-#define HAVE_RPC_TYPES_H 1
-
-/* Define to 1 if you have the <stdint.h> header file. */
-#define HAVE_STDINT_H 1
-
-/* Define to 1 if you have the <stdlib.h> header file. */
-#define HAVE_STDLIB_H 1
-
-/* Define to 1 if you have the <strings.h> header file. */
-#define HAVE_STRINGS_H 1
-
-/* Define to 1 if you have the <string.h> header file. */
-#define HAVE_STRING_H 1
-
-/* Define to 1 if you have the <sys/stat.h> header file. */
-#define HAVE_SYS_STAT_H 1
-
-/* Define to 1 if you have the <sys/types.h> header file. */
-#define HAVE_SYS_TYPES_H 1
-
-/* Define to 1 if you have the <unistd.h> header file. */
-#define HAVE_UNISTD_H 1
-
-/* Define to the sub-directory where libtool stores uninstalled libraries. */
-#define LT_OBJDIR ".libs/"
-
-/* Name of package */
-#define PACKAGE "mbsystem"
-
-/* Define to the address where bug reports for this package should be sent. */
-#define PACKAGE_BUGREPORT "http://listserver.mbari.org/sympa/arc/mbsystem"
-
-/* Define to the full name of this package. */
-#define PACKAGE_NAME "mbsystem"
-
-/* Define to the full name and version of this package. */
-#define PACKAGE_STRING "mbsystem 5.5.2252"
-
-/* Define to the one symbol short name of this package. */
-#define PACKAGE_TARNAME "mbsystem"
-
-/* Define to the home page for this package. */
-#define PACKAGE_URL "http://www.mbari.org/data/mbsystem/"
-
-/* Define to the version of this package. */
-#define PACKAGE_VERSION "5.5.2252"
-
-/* Define to 1 if you have the ANSI C header files. */
-#define STDC_HEADERS 1
-
-/* Version number of package */
-#define VERSION "5.5.2252"
-
-/* Set VERSION_DATE define in mb_config.h */
-#define VERSION_DATE "1 July 2015"
-
-/* Turned on WIN32 define in config */
-/* #undef WIN32 */
-
-/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
-   significant byte first (like Motorola and SPARC, unlike Intel). */
-#if defined AC_APPLE_UNIVERSAL_BUILD
-# if defined __BIG_ENDIAN__
-#  define WORDS_BIGENDIAN 1
-# endif
-#else
-# ifndef WORDS_BIGENDIAN
-/* #  undef WORDS_BIGENDIAN */
-# endif
-#endif
-
-/* Define to the type of a signed integer type of width exactly 8 bits if such
-   a type exists and the standard includes do not define it. */
-/* #undef int8_t */
diff --git a/src/mbio/mb_config.h.in b/src/mbio/mb_config.h.in
deleted file mode 100644
index 0f8cef9..0000000
--- a/src/mbio/mb_config.h.in
+++ /dev/null
@@ -1,107 +0,0 @@
-/* src/mbio/mb_config.h.in.  Generated from configure.ac by autoheader.  */
-
-/* Machine is littleendian, (Byteswapping on) */
-#undef BYTESWAPPED
-
-/* Machine is bigendian, (Byteswapping off) */
-#undef ENDIAN_BIG
-
-/* Turned on OpenGL define in config */
-#undef GOT_GL
-
-/* Define to 1 if you have the <dlfcn.h> header file. */
-#undef HAVE_DLFCN_H
-
-/* Define to 1 if you have the <inttypes.h> header file. */
-#undef HAVE_INTTYPES_H
-
-/* Define to 1 if you have the `m' library (-lm). */
-#undef HAVE_LIBM
-
-/* Define to 1 if you have the `ws2_32' library (-lws2_32). */
-#undef HAVE_LIBWS2_32
-
-/* Have malloc.h */
-#undef HAVE_MALLOC_H
-
-/* Define to 1 if you have the <memory.h> header file. */
-#undef HAVE_MEMORY_H
-
-/* Define to 1 if you have the <rpc/rpc.h> header file. */
-#undef HAVE_RPC_RPC_H
-
-/* Define to 1 if you have the <rpc/types.h> header file. */
-#undef HAVE_RPC_TYPES_H
-
-/* Define to 1 if you have the <stdint.h> header file. */
-#undef HAVE_STDINT_H
-
-/* Define to 1 if you have the <stdlib.h> header file. */
-#undef HAVE_STDLIB_H
-
-/* Define to 1 if you have the <strings.h> header file. */
-#undef HAVE_STRINGS_H
-
-/* Define to 1 if you have the <string.h> header file. */
-#undef HAVE_STRING_H
-
-/* Define to 1 if you have the <sys/stat.h> header file. */
-#undef HAVE_SYS_STAT_H
-
-/* Define to 1 if you have the <sys/types.h> header file. */
-#undef HAVE_SYS_TYPES_H
-
-/* Define to 1 if you have the <unistd.h> header file. */
-#undef HAVE_UNISTD_H
-
-/* Define to the sub-directory where libtool stores uninstalled libraries. */
-#undef LT_OBJDIR
-
-/* Name of package */
-#undef PACKAGE
-
-/* Define to the address where bug reports for this package should be sent. */
-#undef PACKAGE_BUGREPORT
-
-/* Define to the full name of this package. */
-#undef PACKAGE_NAME
-
-/* Define to the full name and version of this package. */
-#undef PACKAGE_STRING
-
-/* Define to the one symbol short name of this package. */
-#undef PACKAGE_TARNAME
-
-/* Define to the home page for this package. */
-#undef PACKAGE_URL
-
-/* Define to the version of this package. */
-#undef PACKAGE_VERSION
-
-/* Define to 1 if you have the ANSI C header files. */
-#undef STDC_HEADERS
-
-/* Version number of package */
-#undef VERSION
-
-/* Set VERSION_DATE define in mb_config.h */
-#undef VERSION_DATE
-
-/* Turned on WIN32 define in config */
-#undef WIN32
-
-/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
-   significant byte first (like Motorola and SPARC, unlike Intel). */
-#if defined AC_APPLE_UNIVERSAL_BUILD
-# if defined __BIG_ENDIAN__
-#  define WORDS_BIGENDIAN 1
-# endif
-#else
-# ifndef WORDS_BIGENDIAN
-#  undef WORDS_BIGENDIAN
-# endif
-#endif
-
-/* Define to the type of a signed integer type of width exactly 8 bits if such
-   a type exists and the standard includes do not define it. */
-#undef int8_t
diff --git a/src/mbio/mb_coor_scale.c b/src/mbio/mb_coor_scale.c
deleted file mode 100644
index 2925871..0000000
--- a/src/mbio/mb_coor_scale.c
+++ /dev/null
@@ -1,221 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mb_coor_scale.c	1/21/93
- *    $Id: mb_coor_scale.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1993-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * The function mb_coor_scale.c returns scaling factors
- * to turn longitude and latitude differences into distances in meters.
- * This function is based on code by James Charters (Scripps Institution
- * of Oceanography).
- *
- * Author:	D. W. Caress
- * Date:	January 21, 1993
- *
- * $Log: mb_coor_scale.c,v $
- * Revision 5.4  2008/09/27 03:27:10  caress
- * Working towards release 5.1.1beta24
- *
- * Revision 5.3  2006/09/11 18:55:52  caress
- * Changes during Western Flyer and Thomas Thompson cruises, August-September
- * 2006.
- *
- * Revision 5.2  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.1  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.0  2000/12/01 22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.9  2000/10/11  01:02:30  caress
- * Convert to ANSI C
- *
- * Revision 4.8  2000/09/30  06:26:58  caress
- * Snapshot for Dale.
- *
- * Revision 4.7  1998/10/05  18:32:27  caress
- * MB-System version 4.6beta
- *
- * Revision 4.6  1997/04/21  17:02:07  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.6  1997/04/21  17:02:07  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.5  1996/04/22  13:21:19  caress
- * Now have DTR and MIN/MAX defines in mb_define.h
- *
- * Revision 4.5  1996/04/22  13:21:19  caress
- * Now have DTR and MIN/MAX defines in mb_define.h
- *
- * Revision 4.4  1996/04/22  10:57:09  caress
- * DTR define now in mb_io.h
- *
- * Revision 4.3  1995/03/06  19:38:54  caress
- * Changed include strings.h to string.h for POSIX compliance.
- *
- * Revision 4.2  1994/10/21  12:11:53  caress
- * Release V4.0
- *
- * Revision 4.1  1994/07/29  18:46:51  caress
- * Changes associated with supporting Lynx OS (byte swapped) and
- * using unix second time base (for time_d values).
- *
- * Revision 4.0  1994/03/05  23:55:38  caress
- * First cut at version 4.0
- *
- * Revision 4.1  1994/03/03  03:39:43  caress
- * Fixed copyright message.
- *
- * Revision 4.0  1994/02/21  04:03:10  caress
- * First cut at new version.  No changes.
- *
- * Revision 3.1  1993/05/14  22:32:39  sohara
- * fixed rcs_id message
- *
- * Revision 3.1  1993/05/14  22:32:39  sohara
- * fixed rcs_id message
- *
- * Revision 3.0  1993/04/23  15:45:07  dale
- * Initial version
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_io.h"
-#include "mb_define.h"
-
-/* ellipsoid coefficients from World Geodetic System Ellipsoid of 1972
- * - see Bowditch (H.O. 9 -- American Practical Navigator). */
-#define C1 111412.84
-#define C2 -93.5
-#define C3 0.118
-#define C4 111132.92
-#define C5 -559.82
-#define C6 1.175
-#define C7 0.0023
-
-static char rcs_id[]="$Id: mb_coor_scale.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mb_coor_scale(int verbose, double latitude,
-			double *mtodeglon, double *mtodeglat)
-{
-	char	*function_name = "mb_coor_scale";
-	int	status;
-	double	radlat;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose: %d\n",verbose);
-		fprintf(stderr,"dbg2       latitude: %f\n",latitude);
-		}
-
-	/* check that the latitude value is sensible */
-	if (fabs(latitude) <= 90.0)
-		{
-		radlat = DTR*latitude;
-		*mtodeglon = 1./fabs(C1*cos(radlat) + C2*cos(3*radlat)
-				+ C3*cos(5*radlat));
-		*mtodeglat = 1./fabs(C4 + C5*cos(2*radlat)
-				+ C6*cos(4*radlat) + C7*cos(6*radlat));
-		status = MB_SUCCESS;
-		}
-
-	/* set error flag if needed */
-	else
-		{
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return arguments:\n");
-		fprintf(stderr,"dbg2       mtodeglon: %g\n",*mtodeglon);
-		fprintf(stderr,"dbg2       mtodeglat: %g\n",*mtodeglat);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:    %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_apply_lonflip(int verbose, int lonflip, double *longitude)
-{
-	char	*function_name = "mb_apply_lonflip";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose: %d\n",verbose);
-		fprintf(stderr,"dbg2       lonflip:   %d\n",lonflip);
-		fprintf(stderr,"dbg2       longitude: %f\n",*longitude);
-		}
-
-	/* apply lonflip */
-	if (lonflip < 0)
-		{
-		if (*longitude > 0.)
-			*longitude = *longitude - 360.;
-		else if (*longitude < -360.)
-			*longitude = *longitude + 360.;
-		}
-	else if (lonflip == 0)
-		{
-		if (*longitude > 180.)
-			*longitude = *longitude - 360.;
-		else if (*longitude < -180.)
-			*longitude = *longitude + 360.;
-		}
-	else
-		{
-		if (*longitude > 360.)
-			*longitude = *longitude - 360.;
-		else if (*longitude < 0.)
-			*longitude = *longitude + 360.;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return arguments:\n");
-		fprintf(stderr,"dbg2       longitude: %f\n",*longitude);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:    %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mb_defaults.c b/src/mbio/mb_defaults.c
deleted file mode 100644
index cafdc80..0000000
--- a/src/mbio/mb_defaults.c
+++ /dev/null
@@ -1,693 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mb_defaults.c	10/7/94
- *    $Id: mb_defaults.c 2239 2015-05-07 00:51:42Z caress $
- *
- *    Copyright (c) 1993-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mb_defaults.c contains two functions - mb_defaults() and mb_env().
- * mb_defaults() returns the default MBIO control parameters and
- * mb_env() returns the default MB-System environment variables - all
- * values are read from ~/.mbio_defaults providing this file exists.
- * The return values are MB_SUCCESS if the file exists and MB_FAILURE
- * if it does not exist.
- *
- * Author:	D. W. Caress
- * Date:	January 23, 1993
- *
- * $Log: mb_defaults.c,v $
- * Revision 5.9  2008/12/31 08:47:38  caress
- * Updates towards release 5.1.1
- *
- * Revision 5.8  2007/10/08 15:59:34  caress
- * MBIO changes as of 8 October 2007.
- *
- * Revision 5.7  2006/09/11 18:55:52  caress
- * Changes during Western Flyer and Thomas Thompson cruises, August-September
- * 2006.
- *
- * Revision 5.6  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.5  2002/10/02 23:55:42  caress
- * Release 5.0.beta24
- *
- * Revision 5.4  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.3  2001/11/20 21:52:13  caress
- * The .mbio_defaults file no longer controls format,
- * pings, bounds, btime_i, and etime_i.
- *
- * Revision 5.2  2001/07/20  00:31:11  caress
- * Release 5.0.beta03
- *
- * Revision 5.1  2001/04/30  05:13:06  caress
- * Changed handling of mbdefaults - more flexible parsing of
- * defaults file and addition of image viewer default.
- *
- * Revision 5.0  2000/12/01 22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.8  2000/10/11  01:02:30  caress
- * Convert to ANSI C
- *
- * Revision 4.7  2000/09/30  06:26:58  caress
- * Snapshot for Dale.
- *
- * Revision 4.6  1998/10/05  17:46:15  caress
- * MB-System version 4.6beta
- *
- * Revision 4.5  1997/04/21  17:02:07  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.5  1997/04/17  18:53:33  caress
- * Added LINUX ifdef.
- *
- * Revision 4.4  1995/03/22  19:14:25  caress
- * Added #ifdef's for HPUX.
- *
- * Revision 4.3  1995/03/06  19:38:54  caress
- * Changed include strings.h to string.h for POSIX compliance.
- *
- * Revision 4.2  1995/01/25  18:17:24  caress
- * Let the operating system define determine the
- * system default postscript viewer.
- *
- * Revision 4.1  1994/10/21  12:11:53  caress
- * Release V4.0
- *
- * Revision 4.0  1994/03/05  23:55:38  caress
- * First cut at version 4.0
- *
- * Revision 4.0  1994/03/05  23:55:38  caress
- * First cut at version 4.0
- *
- * Revision 4.1  1994/03/03  03:39:43  caress
- * Fixed copyright message.
- *
- * Revision 4.0  1994/02/21  04:03:10  caress
- * First cut at new version.  No changes.
- *
- * Revision 3.1  1993/05/14  22:33:05  sohara
- * fixed rcs_id message
- *
- * Revision 3.1  1993/05/14  22:33:05  sohara
- * fixed rcs_id message
- *
- * Revision 3.0  1993/04/23  15:46:59  dale
- * Initial version
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_define.h"
-
-static char rcs_id[]="$Id: mb_defaults.c 2239 2015-05-07 00:51:42Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mb_defaults(int verbose, int *format, int *pings,
-		int *lonflip, double bounds[4],
-		int *btime_i, int *etime_i,
-		double *speedmin, double *timegap)
-{
-	char	*function_name = "mb_defaults";
-	int	status;
-	FILE	*fp;
-	char	file[MB_PATH_MAXLINE];
-	char	string[MB_PATH_MAXLINE];
-	char	*HOME = "HOME";
-	char	*home_ptr;
-	char	*getenv();
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose: %d\n",verbose);
-		}
-
-	/* successful no matter what happens */
-	status = MB_SUCCESS;
-
-	/* set system default values */
-	*format = 0;
-	*pings = 1;
-	*lonflip = 0;
-	bounds[0] = -360.;
-	bounds[1] = 360.;
-	bounds[2] = -90.;
-	bounds[3] = 90.;
-	btime_i[0] = 1962;
-	btime_i[1] = 2;
-	btime_i[2] = 21;
-	btime_i[3] = 10;
-	btime_i[4] = 30;
-	btime_i[5] = 0;
-	btime_i[6] = 0;
-	etime_i[0] = 2062;
-	etime_i[1] = 2;
-	etime_i[2] = 21;
-	etime_i[3] = 10;
-	etime_i[4] = 30;
-	etime_i[5] = 0;
-	etime_i[6] = 0;
-	*speedmin = 0.0;
-	*timegap = 1.0;
-
-	/* set the filename */
-	if ((home_ptr = getenv(HOME)) != NULL)
-		{
-		strcpy(file,home_ptr);
-		strcat(file,"/.mbio_defaults");
-
-		/* open and read values from file if possible */
-		if ((fp = fopen(file, "r")) != NULL)
-			{
-			while (fgets(string,sizeof(string),fp) != NULL)
-				{
-				if (strncmp(string,"lonflip:",8) == 0)
-					sscanf(string,"lonflip: %d",lonflip);
-				if (strncmp(string,"speed:",6) == 0)
-					sscanf(string,"timegap: %lf",timegap);
-				}
- 			fclose(fp);
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       format:     %d\n",*format);
-		fprintf(stderr,"dbg2       pings:      %d\n",*pings);
-		fprintf(stderr,"dbg2       lonflip:    %d\n",*lonflip);
-		fprintf(stderr,"dbg2       bounds[0]:  %f\n",bounds[0]);
-		fprintf(stderr,"dbg2       bounds[1]:  %f\n",bounds[1]);
-		fprintf(stderr,"dbg2       bounds[2]:  %f\n",bounds[2]);
-		fprintf(stderr,"dbg2       bounds[3]:  %f\n",bounds[3]);
-		fprintf(stderr,"dbg2       btime_i[0]: %d\n",btime_i[0]);
-		fprintf(stderr,"dbg2       btime_i[1]: %d\n",btime_i[1]);
-		fprintf(stderr,"dbg2       btime_i[2]: %d\n",btime_i[2]);
-		fprintf(stderr,"dbg2       btime_i[3]: %d\n",btime_i[3]);
-		fprintf(stderr,"dbg2       btime_i[4]: %d\n",btime_i[4]);
-		fprintf(stderr,"dbg2       btime_i[5]: %d\n",btime_i[5]);
-		fprintf(stderr,"dbg2       btime_i[6]: %d\n",btime_i[6]);
-		fprintf(stderr,"dbg2       etime_i[0]: %d\n",etime_i[0]);
-		fprintf(stderr,"dbg2       etime_i[1]: %d\n",etime_i[1]);
-		fprintf(stderr,"dbg2       etime_i[2]: %d\n",etime_i[2]);
-		fprintf(stderr,"dbg2       etime_i[3]: %d\n",etime_i[3]);
-		fprintf(stderr,"dbg2       etime_i[4]: %d\n",etime_i[4]);
-		fprintf(stderr,"dbg2       etime_i[5]: %d\n",etime_i[5]);
-		fprintf(stderr,"dbg2       etime_i[6]: %d\n",etime_i[6]);
-		fprintf(stderr,"dbg2       speedmin:   %f\n",*speedmin);
-		fprintf(stderr,"dbg2       timegap:    %f\n",*timegap);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_env(int verbose, char *psdisplay, char *imgdisplay, char *mbproject)
-{
-	char	*function_name = "mbenv";
-	int	status;
-	FILE	*fp;
-	char	file[MB_PATH_MAXLINE];
-	char	string[MB_PATH_MAXLINE];
-	char	*HOME = "HOME";
-	char	*home_ptr;
-	char	*getenv();
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose: %d\n",verbose);
-		}
-
-	/* set system default Postscript displayer */
-#ifdef IRIX
-	strcpy(psdisplay, "xpsview");
-	strcpy(imgdisplay, "xv");
-#endif
-#ifdef IRIX64
-	strcpy(psdisplay, "xpsview");
-	strcpy(imgdisplay, "xv");
-#endif
-#ifdef SOLARIS
-	strcpy(psdisplay, "pageview");
-	strcpy(imgdisplay, "xv");
-#endif
-#ifdef LYNX
-	strcpy(psdisplay, "gv");
-	strcpy(imgdisplay, "xv");
-#endif
-#ifdef LINUX
-	strcpy(psdisplay, "gv");
-	strcpy(imgdisplay, "gimp");
-#endif
-#ifdef SUN
-	strcpy(psdisplay, "pageview");
-	strcpy(imgdisplay, "xv");
-#endif
-#ifdef HPUX
-	strcpy(psdisplay, "gv");
-	strcpy(imgdisplay, "xv");
-#endif
-#ifdef DARWIN
-	strcpy(psdisplay, "gv");
-	strcpy(imgdisplay, "display");
-#endif
-#ifdef CYGWIN
-	strcpy(psdisplay, "gv");
-	strcpy(imgdisplay, "xv");
-#endif
-#ifdef OTHER
-	strcpy(psdisplay, "gv");
-	strcpy(imgdisplay, "xv");
-#endif
-
-	/* successful no matter what happens */
-	status = MB_SUCCESS;
-
-	/* set system default project name */
-	strcpy(mbproject, "none");
-
-	/* set the filename */
-	if ((home_ptr = getenv(HOME)) != NULL)
-		{
-		strcpy(file,home_ptr);
-		strcat(file,"/.mbio_defaults");
-
-		/* open and read values from file if possible */
-		if ((fp = fopen(file, "r")) != NULL)
-			{
-			status = MB_SUCCESS;
-			while (fgets(string,sizeof(string),fp) != NULL)
-				{
-				if (strncmp(string,"ps viewer:",10) == 0)
-					sscanf(string,"ps viewer: %s",psdisplay);
-				if (strncmp(string,"img viewer:",10) == 0)
-					sscanf(string,"img viewer: %s",imgdisplay);
-				if (strncmp(string,"project:",8) == 0)
-					sscanf(string,"project: %s",mbproject);
-				}
- 			fclose(fp);
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       psdisplay:  %s\n",psdisplay);
-		fprintf(stderr,"dbg2       mbproject:  %s\n",mbproject);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_lonflip(int verbose, int *lonflip)
-{
-	char	*function_name = "mb_lonflip";
-	int	status;
-	FILE	*fp;
-	char	file[MB_PATH_MAXLINE];
-	char	string[MB_PATH_MAXLINE];
-	char	*HOME = "HOME";
-	char	*home_ptr;
-	char	*getenv();
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose: %d\n",verbose);
-		}
-
-	/* successful no matter what happens */
-	status = MB_SUCCESS;
-
-	/* set system default values */
-	*lonflip = 0;
-
-	/* set the filename */
-	if ((home_ptr = getenv(HOME)) != NULL)
-		{
-		strcpy(file,home_ptr);
-		strcat(file,"/.mbio_defaults");
-
-		/* open and read values from file if possible */
-		if ((fp = fopen(file, "r")) != NULL)
-			{
-			while (fgets(string,sizeof(string),fp) != NULL)
-				{
-				if (strncmp(string,"lonflip:",8) == 0)
-					sscanf(string,"lonflip: %d",lonflip);
-				}
- 			fclose(fp);
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       lonflip:    %d\n",*lonflip);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_mbview_defaults(int verbose,
-			int *primary_colortable,
-			int *primary_colortable_mode,
-			int *primary_shade_mode,
-			int *slope_colortable,
-			int *slope_colortable_mode,
-			int *secondary_colortable,
-			int *secondary_colortable_mode,
-			double *illuminate_magnitude,
-			double *illuminate_elevation,
-			double *illuminate_azimuth,
-			double *slope_magnitude)
-{
-	char	*function_name = "mb_mbview_defaults";
-	int	status;
-	FILE	*fp;
-	char	file[MB_PATH_MAXLINE];
-	char	string[MB_PATH_MAXLINE];
-	char	*HOME = "HOME";
-	char	*home_ptr;
-	char	*getenv();
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose: %d\n",verbose);
-		}
-
-	/* successful no matter what happens */
-	status = MB_SUCCESS;
-
-	/* set system default values */
-	*primary_colortable = 0;
-	*primary_colortable_mode = 0;
-	*primary_shade_mode = 2;
-	*slope_colortable = 0;
-	*slope_colortable_mode = 0;
-	*secondary_colortable = 0;
-	*secondary_colortable_mode = 1;
-	*illuminate_magnitude = 2.0;
-	*illuminate_elevation = 5.0;
-	*illuminate_azimuth = 90.0;
-	*slope_magnitude = 1.0;
-
-	/* set the filename */
-	if ((home_ptr = getenv(HOME)) != NULL)
-		{
-		strcpy(file,home_ptr);
-		strcat(file,"/.mbio_defaults");
-
-		/* open and read values from file if possible */
-		if ((fp = fopen(file, "r")) != NULL)
-			{
-			while (fgets(string,sizeof(string),fp) != NULL)
-				{
-				if (strncmp(string,"mbview_primary_colortable:",25) == 0)
-					sscanf(string,"mbview_primary_colortable:%d", primary_colortable);
-				if (strncmp(string,"mbview_primary_colortable_mode:",30) == 0)
-					sscanf(string,"mbview_primary_colortable_mode:%d", primary_colortable_mode);
-				if (strncmp(string,"mbview_primary_shade_mode:",25) == 0)
-					sscanf(string,"mbview_primary_shade_mode:%d", primary_shade_mode);
-				if (strncmp(string,"mbview_slope_colortable:",23) == 0)
-					sscanf(string,"mbview_slope_colortable:%d", slope_colortable);
-				if (strncmp(string,"mbview_slope_colortable_mode:",28) == 0)
-					sscanf(string,"mbview_slope_colortable_mode:%d", slope_colortable_mode);
-				if (strncmp(string,"mbview_secondary_colortable:",27) == 0)
-					sscanf(string,"mbview_secondary_colortable:%d", secondary_colortable);
-				if (strncmp(string,"mbview_secondary_colortable_mode:",32) == 0)
-					sscanf(string,"mbview_secondary_colortable_mode:%d", secondary_colortable_mode);
-				if (strncmp(string,"mbview_illuminate_magnitude:",27) == 0)
-					sscanf(string,"mbview_illuminate_magnitude:%lf", illuminate_magnitude);
-				if (strncmp(string,"mbview_illuminate_elevation:",27) == 0)
-					sscanf(string,"mbview_illuminate_elevation:%lf", illuminate_elevation);
-				if (strncmp(string,"mbview_illuminate_azimuth:",25) == 0)
-					sscanf(string,"mbview_illuminate_azimuth:%lf", illuminate_azimuth);
-				if (strncmp(string,"mbview_slope_magnitude:",22) == 0)
-					sscanf(string,"mbview_slope_magnitude:%lf", slope_magnitude);
-				}
- 			fclose(fp);
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       primary_colortable:         %d\n",*primary_colortable);
-		fprintf(stderr,"dbg2       primary_colortable_mode:    %d\n",*primary_colortable_mode);
-		fprintf(stderr,"dbg2       primary_shade_mode:         %d\n",*primary_shade_mode);
-		fprintf(stderr,"dbg2       slope_colortable:           %d\n",*slope_colortable);
-		fprintf(stderr,"dbg2       slope_colortable_mode:      %d\n",*slope_colortable_mode);
-		fprintf(stderr,"dbg2       secondary_colortable:       %d\n",*secondary_colortable);
-		fprintf(stderr,"dbg2       secondary_colortable_mode:  %d\n",*secondary_colortable_mode);
-		fprintf(stderr,"dbg2       illuminate_magnitude:       %f\n",*illuminate_magnitude);
-		fprintf(stderr,"dbg2       illuminate_elevation:       %f\n",*illuminate_elevation);
-		fprintf(stderr,"dbg2       illuminate_azimuth:         %f\n",*illuminate_azimuth);
-		fprintf(stderr,"dbg2       slope_magnitude:            %f\n",*slope_magnitude);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_fbtversion(int verbose, int *fbtversion)
-{
-	char	*function_name = "mb_fbtversion";
-	int	status;
-	FILE	*fp;
-	char	file[MB_PATH_MAXLINE];
-	char	string[MB_PATH_MAXLINE];
-	char	*HOME = "HOME";
-	char	*home_ptr;
-	char	*getenv();
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose: %d\n",verbose);
-		}
-
-	/* successful no matter what happens */
-	status = MB_SUCCESS;
-
-	/* set system default values */
-	*fbtversion = 3;
-
-	/* set the filename */
-	if ((home_ptr = getenv(HOME)) != NULL)
-		{
-		strcpy(file,home_ptr);
-		strcat(file,"/.mbio_defaults");
-
-		/* open and read values from file if possible */
-		if ((fp = fopen(file, "r")) != NULL)
-			{
-			while (fgets(string,sizeof(string),fp) != NULL)
-				{
-				if (strncmp(string,"fbtversion:",11) == 0)
-					sscanf(string,"fbtversion: %d",fbtversion);
-				}
- 			fclose(fp);
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id:     %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       fbtversion: %d\n",*fbtversion);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_uselockfiles(int verbose, int *uselockfiles)
-{
-	char	*function_name = "mb_uselockfiles";
-	int	status;
-	FILE	*fp;
-	char	file[MB_PATH_MAXLINE];
-	char	string[MB_PATH_MAXLINE];
-	char	*HOME = "HOME";
-	char	*home_ptr;
-	char	*getenv();
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose: %d\n",verbose);
-		}
-
-	/* successful no matter what happens */
-	status = MB_SUCCESS;
-
-#ifdef WIN32
-	/* It would crash because the lock file is attempted to be created with the new "wx"
-	   that VC12 does not know and we don't have any use for this anyway.
-	*/
-	*uselockfiles = 0;
-	return(status);
-#endif
-
-	/* set system default values */
-	*uselockfiles = 1;
-
-	/* set the filename */
-	if ((home_ptr = getenv(HOME)) != NULL)
-		{
-		strcpy(file,home_ptr);
-		strcat(file,"/.mbio_defaults");
-
-		/* open and read values from file if possible */
-		if ((fp = fopen(file, "r")) != NULL)
-			{
-			while (fgets(string,sizeof(string),fp) != NULL)
-				{
-				if (strncmp(string,"uselockfiles:",13) == 0)
-					sscanf(string,"uselockfiles:%d",uselockfiles);
-				if (*uselockfiles < 0 || *uselockfiles > 1)
-					*uselockfiles = 1;
-				}
- 			fclose(fp);
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id:       %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       uselockfiles: %d\n",*uselockfiles);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:       %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_fileiobuffer(int verbose, int *fileiobuffer)
-{
-	char	*function_name = "mb_fileiobuffer";
-	int	status;
-	FILE	*fp;
-	char	file[MB_PATH_MAXLINE];
-	char	string[MB_PATH_MAXLINE];
-	char	*HOME = "HOME";
-	char	*home_ptr;
-	char	*getenv();
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose: %d\n",verbose);
-		}
-
-	/* successful no matter what happens */
-	status = MB_SUCCESS;
-
-	/* set system default values */
-	*fileiobuffer = 0;
-
-	/* set the filename */
-	if ((home_ptr = getenv(HOME)) != NULL)
-		{
-		strcpy(file,home_ptr);
-		strcat(file,"/.mbio_defaults");
-
-		/* open and read values from file if possible */
-		if ((fp = fopen(file, "r")) != NULL)
-			{
-			while (fgets(string,sizeof(string),fp) != NULL)
-				{
-				if (strncmp(string,"fileiobuffer:",13) == 0)
-					sscanf(string,"fileiobuffer:%d",fileiobuffer);
-				}
- 			fclose(fp);
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id:       %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       fileiobuffer: %d\n",*fileiobuffer);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:       %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mb_define.h b/src/mbio/mb_define.h
deleted file mode 100644
index 9dd0dd6..0000000
--- a/src/mbio/mb_define.h
+++ /dev/null
@@ -1,826 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mb_define.h	4/21/96
- *    $Id: mb_define.h 2250 2015-06-30 02:12:26Z caress $
- *
- *    Copyright (c) 1996-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mb_define.h defines macros used by MB-System programs and functions
- * for degree/radian conversions and min/max calculations.
- *
- * Author:	D. W. Caress
- * Date:	April 21, 1996
- *
- * $Log: mb_define.h,v $
- *
- */
-
-/* include this code only once */
-#ifndef MB_DEFINE_DEF
-#define MB_DEFINE_DEF
-
-#include "mb_config.h"
-
-/* include for mb_s_char types */
-#if HAVE_STDINT_H
-# include <stdint.h>
-#endif
-
-/* For XDR/RPC */
-#ifdef HAVE_RPC_RPC_H
-# include <rpc/rpc.h>
-#endif
-#ifdef HAVE_RPC_TYPES_H
-# include <rpc/types.h>
-# include <rpc/xdr.h>
-#endif
-
-/* for Windows */
-#if defined(_WIN32) && (_MSC_VER < 1800)
-#	if !defined(copysign)
-#		define copysign(x,y) _copysign(x,y)
-#	endif
-#	if !defined(log2)
-#		define log2(x) (log(x) / log(2))
-#	endif
-#	if !defined(rint)
-#		define rint(x) (floor((x)+0.5))
-#	endif
-#endif
-
-#ifdef _WIN32
-#define sleep Sleep
-#define popen _popen
-#define pclose _pclose
-#define ftello ftell
-#define fseeko fseek
-#	ifndef isnan
-#		define isnan(x) _isnan(x)
-#	endif
-#	ifndef inline
-#		define inline __inline
-#	endif
-#endif
-
-/* MB-system version id */
-#define	MB_VERSION	VERSION
-#define	MB_BUILD_DATE	VERSION_DATE
-#define	MB_SVN		"$Id: mb_define.h 2250 2015-06-30 02:12:26Z caress $"
-
-/* type definitions of signed and unsigned char */
-typedef unsigned char	mb_u_char;
-
-/* From stdint.h if available */
-#if defined INT8_MAX || defined int8_t
-typedef int8_t mb_s_char;
-#else
-typedef signed char	mb_s_char;
-#endif
-
-/* type definitions of signed and unsigned long int (64 bit integer) */
-typedef unsigned long long	mb_u_long;
-typedef long long	mb_s_long;
-
-/* type definitions for structures used in beam angle calculations */
-typedef struct {
-    double x;
-    double y;
-    double z;
-} mb_3D_vector;
-
-typedef struct {
-    double roll;
-    double pitch;
-    double heading;
-} mb_3D_orientation;
-
-/* declare buffer maximum */
-#define	MB_BUFFER_MAX	5000
-
-/* maximum path length in characters */
-#define MB_PATH_MAXLINE 1024
-
-/* maximum comment length in characters */
-#define MB_COMMENT_MAXLINE 1944
-
-/* other string length defines */
-#define MB_NAME_LENGTH		32
-#define MB_LONGNAME_LENGTH	128
-#define MB_DESCRIPTION_LENGTH	2048
-
-/* typedef for path string */
-typedef char mb_path[MB_PATH_MAXLINE];
-typedef char mb_name[MB_NAME_LENGTH];
-typedef char mb_longname[MB_LONGNAME_LENGTH];
-
-/* maximum number of asynchronous data saved */
-#define MB_ASYNCH_SAVE_MAX 10000
-
-/* maximum size of SVP profiles */
-#define MB_SVP_MAX 1024
-
-/* maximum number of CTD samples per record */
-#define MB_CTD_MAX 256
-
-/* maximum number of asynchronous nav samples per record */
-#define MB_NAV_MAX 256
-
-/* file mode (read or write) */
-#define	MB_FILEMODE_READ	0
-#define	MB_FILEMODE_WRITE	1
-
-/* types of  files used by swath sonar data formats */
-#define	MB_FILETYPE_NORMAL	1
-#define	MB_FILETYPE_SINGLE	2
-#define	MB_FILETYPE_XDR		3
-#define	MB_FILETYPE_GSF		4
-#define	MB_FILETYPE_NETCDF	5
-#define MB_FILETYPE_SURF	6
-#define MB_FILETYPE_SEGY	7
-
-/* settings for recursive datalist reading functions */
-#define MB_DATALIST_LOOK_UNSET		0
-#define MB_DATALIST_LOOK_NO 		1
-#define MB_DATALIST_LOOK_YES		2
-
-/* settings of i/o array dimension types */
-#define MB_MEM_TYPE_NONE		0
-#define MB_MEM_TYPE_BATHYMETRY		1
-#define MB_MEM_TYPE_AMPLITUDE		2
-#define MB_MEM_TYPE_SIDESCAN		3
-
-/* declare PI if needed */
-#ifndef M_PI
-#define	M_PI	3.14159265358979323846
-#endif
-
-/* the natural log of 2 is always useful */
-#define MB_LN_2        0.69314718056
-
-/* multiply this by degrees to get radians */
-#define DTR	0.01745329251994329500
-
-/* multiply this by radians to get degrees */
-#define RTD	57.2957795130823230000
-
-/* min max round define */
-#ifndef MIN
-#define	MIN(A, B)	((A) < (B) ? (A) : (B))
-#endif
-#ifndef MAX
-#define	MAX(A, B)	((A) > (B) ? (A) : (B))
-#endif
-#ifndef ROUND
-#define	ROUND(X)	X < 0.0 ? ceil(X - 0.5) : floor(X + 0.5)
-#endif
-
-/* NaN defines */
-#ifdef NO_IEEE
-#define MB_MAKE_FNAN(x) (x = FLT_MAX)
-#define MB_MAKE_DNAN(x) (x = DBL_MAX)
-#define MB_IS_FNAN(x) ((x) == FLT_MAX)
-#define MB_IS_DNAN(x) ((x) == DBL_MAX)
-#else
-#define MB_MAKE_FNAN(x) (x = (float) NAN)
-#define MB_MAKE_DNAN(x) (x = NAN)
-#define MB_IS_FNAN isnan
-#define MB_IS_DNAN isnan
-#endif
-
-/* default grid no data value define */
-#define	MB_DEFAULT_GRID_NODATA		-9999999.9
-
-/* safe square root define - sets argument to zero if negative */
-#define SAFESQRT(X) sqrt(MAX(0.0, X))
-
-/* position projection flag (0 = longitude latitude, 1 = projected eastings northings) */
-#define	MB_PROJECTION_GEOGRAPHIC	0
-#define	MB_PROJECTION_PROJECTED		1
-
-/* MBIO core function prototypes */
-int mb_defaults(int verbose, int *format, int *pings,
-		int *lonflip, double bounds[4],
-		int *btime_i, int *etime_i,
-		double *speedmin, double *timegap);
-int mb_env(int verbose, char *psdisplay, char *imgdisplay, char *mbproject);
-int mb_lonflip(int verbose, int *lonflip);
-int mb_mbview_defaults(int verbose,
-			int *primary_colortable,
-			int *primary_colortable_mode,
-			int *primary_shade_mode,
-			int *slope_colortable,
-			int *slope_colortable_mode,
-			int *secondary_colortable,
-			int *secondary_colortable_mode,
-			double *illuminate_magnitude,
-			double *illuminate_elevation,
-			double *illuminate_azimuth,
-			double *slope_magnitude);
-int mb_fbtversion(int verbose, int *fbtversion);
-int mb_uselockfiles(int verbose, int *uselockfiles);
-int mb_fileiobuffer(int verbose, int *fileiobuffer);
-int mb_format_register(int verbose, int *format, void *mbio_ptr, int *error);
-int mb_format_info(int verbose, int *format, int *system,
-		int *beams_bath_max, int *beams_amp_max, int *pixels_ss_max,
-		char *format_name, char *system_name, char *format_description,
-		int *numfile, int *filetype, int *variable_beams,
-		int *traveltime, int *beam_flagging,
-		int *nav_source, int *heading_source, int *vru_source, int *svp_source,
-		double *beamwidth_xtrack, double *beamwidth_ltrack,
-		int *error);
-int mb_format(int verbose, int *format, int *error);
-int mb_format_system(int verbose, int *format, int *system, int *error);
-int mb_format_description(int verbose, int *format,
-		char *description, int *error);
-int mb_format_dimensions(int verbose, int *format,
-		int *beams_bath_max, int *beams_amp_max, int *pixels_ss_max,
-		int *error);
-int mb_format_flags(int verbose, int *format,
-		int *variable_beams, int *traveltime, int *beam_flagging,
-		int *error);
-int mb_format_source(int verbose, int *format,
-		int *nav_source, int *heading_source,
-		int *vru_source, int *svp_source,
-		int *error);
-int mb_format_beamwidth(int verbose, int *format,
-		double *beamwidth_xtrack, double *beamwidth_ltrack,
-		int *error);
-int mb_get_format(int verbose, char *filename, char *fileroot,
-		    int *format, int *error);
-int mb_datalist_open(int verbose,
-		void **datalist,
-		char *path,
-		int look_processed,
-		int *error);
-int mb_datalist_read(int verbose,
-		void *datalist,
-		char *path, int *format, double *weight,
-		int *error);
-int mb_datalist_read2(int verbose,
-		void *datalist,
-		int *pstatus, char *path, char *ppath, int *format, double *weight,
-		int *error);
-int mb_datalist_close(int verbose,
-		void **datalist, int *error);
-int mb_get_relative_path(int verbose,
-		char *path,
-		char *pwd,
-		int *error);
-int mb_get_shortest_path(int verbose,
-		char *path,
-		int *error);
-int mb_get_basename(int verbose,
-		char *path,
-		int *error);
-int mb_check_info(int verbose, char *file, int lonflip,
-		    double bounds[4], int *file_in_bounds,
-		    int *error);
-int mb_make_info(int verbose, int force,
-		    char *file, int format, int *error);
-int mb_get_fbt(int verbose, char *file, int *format, int *error);
-int mb_get_fnv(int verbose, char *file, int *format, int *error);
-int mb_get_ffa(int verbose, char *file, int *format, int *error);
-int mb_get_ffs(int verbose, char *file, int *format, int *error);
-int mb_swathbounds(int verbose, int checkgood,
-		double navlon, double navlat, double heading,
-		int nbath, int nss,
-		char *beamflag, double *bath,
-		double *bathacrosstrack, double *bathalongtrack,
-		double *ss, double *ssacrosstrack, double *ssalongtrack,
-		int *ibeamport,
-		int *ibeamcntr,
-		int *ibeamstbd,
-		int *ipixelport,
-		int *ipixelcntr,
-		int *ipixelstbd,
-		int *error);
-int mb_read_init(int verbose, char *file,
-		int format, int pings, int lonflip, double bounds[4],
-		int btime_i[7], int etime_i[7],
-		double speedmin, double timegap,
-		void **mbio_ptr, double *btime_d, double *etime_d,
-		int *beams_bath, int *beams_amp, int *pixels_ss,
-		int *error);
-int mb_write_init(int verbose,
-		char *file, int format, void **mbio_ptr,
-		int *beams_bath, int *beams_amp, int *pixels_ss,
-		int *error);
-int mb_close(int verbose, void **mbio_ptr, int *error);
-int mb_read_ping(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int *error);
-int mb_get_all(int verbose, void *mbio_ptr, void **store_ptr, int *kind,
-		int time_i[7], double *time_d,
-		double *navlon, double *navlat,
-		double *speed, double *heading,
-		double *distance, double *altitude, double *sonardepth,
-		int *nbath, int *namp, int *nss,
-		char *beamflag, double *bath, double *amp,
-		double *bathacrosstrack, double *bathalongtrack,
-		double *ss, double *ssacrosstrack, double *ssalongtrack,
-		char *comment, int *error);
-int mb_get(int verbose, void *mbio_ptr, int *kind, int *pings,
-		int time_i[7], double *time_d,
-		double *navlon, double *navlat,
-		double *speed, double *heading,
-		double *distance, double *altitude, double *sonardepth,
-		int *nbath, int *namp, int *nss,
-		char *beamflag, double *bath, double *amp,
-		double *bathacrosstrack, double *bathalongtrack,
-		double *ss, double *ssacrosstrack, double *ssalongtrack,
-		char *comment, int *error);
-int mb_read(int verbose, void *mbio_ptr,
-		int *kind, int *pings,
-		int time_i[7], double *time_d,
-		double *navlon, double *navlat,
-		double *speed, double *heading,
-		double *distance, double *altitude, double *sonardepth,
-		int *nbath, int *namp, int *nss,
-		char *beamflag, double *bath, double *amp,
-		double *bathlon, double *bathlat,
-		double *ss, double *sslon, double *sslat,
-		char *comment, int *error);
-int mb_write_ping(int verbose, void *mbio_ptr, void *store_ptr,
-		int *error);
-int mb_put_all(int verbose, void *mbio_ptr, void *store_ptr,
-		int usevalues, int kind,
-		int time_i[7], double time_d,
-		double navlon, double navlat,
-		double speed, double heading,
-		int nbath, int namp, int nss,
-		char *beamflag, double *bath, double *amp,
-		double *bathacrosstrack, double *bathalongtrack,
-		double *ss, double *ssacrosstrack, double *ssalongtrack,
-		char *comment, int *error);
-int mb_put_comment(int verbose, void *mbio_ptr, char *comment,
-		int *error);
-int mb_fileio_open(int verbose, void *mbio_ptr, int *error);
-int mb_fileio_close(int verbose, void *mbio_ptr, int *error);
-int mb_fileio_get(int verbose, void *mbio_ptr, char *buffer, size_t *size, int *error);
-int mb_fileio_put(int verbose, void *mbio_ptr, char *buffer, size_t *size, int *error);
-int mb_alloc(int verbose, void *mbio_ptr,
-		void **store_ptr, int *error);
-int mb_deall(int verbose, void *mbio_ptr,
-		void **store_ptr, int *error);
-int mb_get_store(int verbose, void *mbio_ptr,
-		    void **store_ptr, int *error);
-int mb_dimensions(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int *nbath, int *namp, int *nss, int *error);
-int mb_pingnumber(int verbose, void *mbio_ptr,
-		int *pingnumber, int *error);
-int mb_segynumber(int verbose, void *mbio_ptr,
-		int *line, int *shot, int *cdp, int *error);
-int mb_beamwidths(int verbose, void *mbio_ptr,
-		double *beamwidth_xtrack, double *beamwidth_ltrack, int *error);
-int mb_sonartype(int verbose, void *mbio_ptr, void *store_ptr,
-		int *sonartype, int *error);
-int mb_sidescantype(int verbose, void *mbio_ptr, void *store_ptr,
-		int *ss_type, int *error);
-int mb_preprocess(int verbose, void *mbio_ptr, void *store_ptr,
-		double time_d, double navlon, double navlat,
-		double speed, double heading, double sonardepth,
-		double roll, double pitch, double heave,
-		int *error);
-int mb_extract(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int time_i[7], double *time_d,
-		double *navlon, double *navlat,
-		double *speed, double *heading,
-		int *nbath, int *namp, int *nss,
-		char *beamflag, double *bath, double *amp,
-		double *bathacrosstrack, double *bathalongtrack,
-		double *ss, double *ssacrosstrack, double *ssalongtrack,
-		char *comment, int *error);
-int mb_insert(int verbose, void *mbio_ptr, void *store_ptr,
-		int kind, int time_i[7], double time_d,
-		double navlon, double navlat,
-		double speed, double heading,
-		int nbath, int namp, int nss,
-		char *beamflag, double *bath, double *amp,
-		double *bathacrosstrack, double *bathalongtrack,
-		double *ss, double *ssacrosstrack, double *ssalongtrack,
-		char *comment, int *error);
-int mb_extract_nav(int verbose, void *mbio_ptr, void *store_ptr, int *kind,
-		int time_i[7], double *time_d,
-		double *navlon, double *navlat,
-		double *speed, double *heading, double *draft,
-		double *roll, double *pitch, double *heave,
-		int *error);
-int mb_extract_nnav(int verbose, void *mbio_ptr, void *store_ptr,
-		int nmax, int *kind, int *n,
-		int *time_i, double *time_d,
-		double *navlon, double *navlat,
-		double *speed, double *heading, double *draft,
-		double *roll, double *pitch, double *heave,
-		int *error);
-int mb_insert_nav(int verbose, void *mbio_ptr, void *store_ptr,
-		int time_i[7], double time_d,
-		double navlon, double navlat,
-		double speed, double heading, double draft,
-		double roll, double pitch, double heave,
-		int *error);
-int mb_extract_altitude(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind,
-		double *transducer_depth, double *altitude,
-		int *error);
-int mb_insert_altitude(int verbose, void *mbio_ptr, void *store_ptr,
-		double transducer_depth, double altitude,
-		int *error);
-int mb_extract_svp(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind,
-		int *nsvp,
-		double *depth, double *velocity,
-		int *error);
-int mb_insert_svp(int verbose, void *mbio_ptr, void *store_ptr,
-		int nsvp,
-		double *depth, double *velocity,
-		int *error);
-int mb_ttimes(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int *nbeams,
-		double *ttimes, double	*angles,
-		double *angles_forward, double *angles_null,
-		double *heave, double *alongtrack_offset,
-		double *draft, double *ssv, int *error);
-int mb_detects(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int *nbeams, int *detects, int *error);
-int mb_pulses(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int *nbeams, int *pulses, int *error);
-int mb_gains(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, double *transmit_gain, double *pulse_length,
-		double *receive_gain, int *error);
-int mb_extract_rawssdimensions(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, double *sample_interval,
-		int *num_samples_port, int *num_samples_stbd, int *error);
-int mb_extract_rawss(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int *sidescan_type, double *sample_interval,
-		double *beamwidth_xtrack, double *beamwidth_ltrack,
-		int *num_samples_port, double *rawss_port, 
-		int *num_samples_stbd, double *rawss_stbd, int *error);
-int mb_insert_rawss(int verbose, void *mbio_ptr, void *store_ptr,
-		int kind, int sidescan_type, double sample_interval,
-		double beamwidth_xtrack, double beamwidth_ltrack,
-		int num_samples_port, double *rawss_port,
-		int num_samples_stbd, double *rawss_stbd, int *error);
-int mb_extract_segytraceheader(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind,
-		void *segytraceheader_ptr,
-		int *error);
-int mb_extract_segy(int verbose, void *mbio_ptr, void *store_ptr,
-		int *sampleformat,
-		int *kind,
-		void *segyheader_ptr,
-		float *segydata,
-		int *error);
-int mb_insert_segy(int verbose, void *mbio_ptr, void *store_ptr,
-		int kind,
-		void *segyheader_ptr,
-		float *segydata,
-		int *error);
-int mb_ctd(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int *nctd, double *time_d,
-		double *conductivity, double *temperature,
-		double *depth, double *salinity, double *soundspeed, int *error);
-int mb_ancilliarysensor(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int *nsensor, double *time_d,
-		double *sensor1, double *sensor2, double *sensor3,
-		double *sensor4, double *sensor5, double *sensor6,
-		double *sensor7, double *sensor8, int *error);
-int mb_copyrecord(int verbose, void *mbio_ptr,
-		void *store_ptr, void *copy_ptr, int *error);
-
-int mb_platform_init(int verbose, int type, char *name, char *organization,
-		int source_swathbathymetry, int source_position,
-		int source_depth, int source_heave, int source_heading,
-		int source_rollpitch, 
-		void **platform_ptr, int *error);
-int mb_platform_add_sensor(int verbose, void **platform_ptr,
-		int type, mb_longname model,
-		mb_longname manufacturer,
-		mb_longname serialnumber,
-		int capability, int special_capability,
-		int num_offsets, int num_time_latency,
-		int *error);
-int mb_platform_add_sensor_offset(int verbose, void **platform_ptr,
-		int isensor, int ioffset,
-		int time_latency_mode,
-		double time_latency_static,
-		int num_time_latency,
-		double *time_latency_time_d,
-		double *time_latency_value,
-		int position_offset_mode,
-		double position_offset_x,
-		double position_offset_y,
-		double position_offset_z,   
-		int attitude_offset_mode,
-		double attitude_offset_azimuth,
-		double attitude_offset_roll,
-		double attitude_offset_pitch,
-		int *error);
-int mb_platform_deall(int verbose, void **platform_ptr, int *error);
-int mb_platform_read(int verbose, char *platform_file, void **platform_ptr, int *error);
-int mb_platform_write(int verbose, char *platform_file, void **platform_ptr, int *error);
-int mb_platform_lever(int verbose, void **platform_ptr,
-                int targetsensor, int targetsensoroffset,
-		double heading, double roll, double pitch,
-		double *lever_x, double *lever_y, double *lever_z,
-                int *error);
-int mb_platform_position(int verbose, void **platform_ptr,
-                int targetsensor, int targetsensoroffset,
-		double navlon, double navlat, double sensordepth,
-		double heading, double roll, double pitch,
-		double *targetlon, double *targetlat, double *targetz,
-                int *error);
-
-int mb_buffer_init(int verbose, void **buff_ptr, int *error);
-int mb_buffer_close(int verbose, void **buff_ptr, void *mbio_ptr,
-		int *error);
-int mb_buffer_load(int verbose, void *buff_ptr,void *mbio_ptr,
-		int nwant, int *nload, int *nbuff, int *error);
-int mb_buffer_dump(int verbose, void *buff_ptr, void *mbio_ptr, void *ombio_ptr,
-		int nhold, int *ndump, int *nbuff, int *error);
-int mb_buffer_clear(int verbose, void *buff_ptr, void *mbio_ptr,
-		int nhold, int *ndump, int *nbuff, int *error);
-int mb_buffer_info(int verbose, void *buff_ptr, void *mbio_ptr,
-		int id, int *system, int *kind, int *error);
-int mb_buffer_get_next_data(int verbose, void *buff_ptr, void *mbio_ptr,
-		int start, int *id,
-		int time_i[7], double *time_d,
-		double *navlon, double *navlat,
-		double *speed, double *heading,
-		int *nbath, int *namp, int *nss,
-		char *beamflag, double *bath, double *amp,
-		double *bathacrosstrack, double *bathalongtrack,
-		double *ss, double *ssacrosstrack, double *ssalongtrack,
-		int *error);
-int mb_buffer_get_next_nav(int verbose, void *buff_ptr, void *mbio_ptr,
-		int start, int *id,
-		int time_i[7], double *time_d,
-		double *navlon, double *navlat,
-		double *speed, double *heading, double *draft,
-		double *roll, double *pitch, double *heave,
-		int *error);
-int mb_buffer_extract(int verbose, void *buff_ptr, void *mbio_ptr,
-		int id, int *kind,
-		int time_i[7], double *time_d,
-		double *navlon, double *navlat,
-		double *speed, double *heading,
-		int *nbath, int *namp, int *nss,
-		char *beamflag, double *bath, double *amp,
-		double *bathacrosstrack, double *bathalongtrack,
-		double *ss, double *ssacrosstrack, double *ssalongtrack,
-		char *comment,
-		int *error);
-int mb_buffer_extract_nav(int verbose, void *buff_ptr, void *mbio_ptr,
-		int id, int *kind,
-		int time_i[7], double *time_d,
-		double *navlon, double *navlat,
-		double *speed, double *heading, double *draft,
-		double *roll, double *pitch, double *heave,
-		int *error);
-int mb_buffer_insert(int verbose, void *buff_ptr, void *mbio_ptr,
-		int id, int time_i[7], double time_d,
-		double navlon, double navlat,
-		double speed, double heading,
-		int nbath, int namp, int nss,
-		char *beamflag, double *bath, double *amp,
-		double *bathacrosstrack, double *bathalongtrack,
-		double *ss, double *ssacrosstrack, double *ssalongtrack,
-		char *comment,
-		int *error);
-int mb_buffer_insert_nav(int verbose, void *buff_ptr, void *mbio_ptr,
-		int id, int time_i[7], double time_d,
-		double navlon, double navlat,
-		double speed, double heading, double draft,
-		double roll, double pitch, double heave,
-		int *error);
-int mb_buffer_get_kind(int verbose, void *buff_ptr, void *mbio_ptr,
-		int id, int *kind,
-		int *error);
-int mb_buffer_get_ptr(int verbose, void *buff_ptr, void *mbio_ptr,
-		int id, void **store_ptr,
-		int *error);
-
-int mb_coor_scale(int verbose, double latitude,
-		double *mtodeglon, double *mtodeglat);
-int mb_apply_lonflip(int verbose, int lonflip, double *longitude);
-
-int mb_error(int, int, char **);
-int mb_notice_log_datatype(int verbose, void *mbio_ptr, int data_id);
-int mb_notice_log_error(int verbose, void *mbio_ptr, int error_id);
-int mb_notice_log_problem(int verbose, void *mbio_ptr, int problem_id);
-int mb_notice_get_list(int verbose, void *mbio_ptr, int *notice_list);
-int mb_notice_message(int verbose, int notice, char **message);
-int mb_navint_add(int verbose, void *mbio_ptr,
-		double time_d, double lon_easting, double lat_northing, int *error);
-int mb_navint_interp(int verbose, void *mbio_ptr,
-		double time_d, double heading, double rawspeed,
-		double *lon, double *lat, double *speed,
-		int *error);
-int mb_navint_prjinterp(int verbose, void *mbio_ptr,
-		double time_d, double heading, double rawspeed,
-		double *easting, double *northing, double *speed,
-		int *error);
-int mb_attint_add(int verbose, void *mbio_ptr,
-		double time_d, double heave,
-		double roll, double pitch, int *error);
-int mb_attint_nadd(int verbose, void *mbio_ptr,
-		int nsamples, double *time_d, double *heave,
-		double *roll, double *pitch, int *error);
-int mb_attint_interp(int verbose, void *mbio_ptr,
-		double time_d, double *heave,
-		double *roll, double *pitch,
-		int *error);
-int mb_hedint_add(int verbose, void *mbio_ptr,
-		double time_d, double heading, int *error);
-int mb_hedint_nadd(int verbose, void *mbio_ptr,
-		int nsamples, double *time_d, double *heading, int *error);
-int mb_hedint_interp(int verbose, void *mbio_ptr,
-		double time_d, double *heading,
-		int *error);
-int mb_depint_add(int verbose, void *mbio_ptr, double time_d, double sonardepth, int *error);
-int mb_depint_interp(int verbose, void *mbio_ptr,
-		double time_d, double *sonardepth,
-		int *error);
-int mb_altint_add(int verbose, void *mbio_ptr, double time_d, double altitude, int *error);
-int mb_altint_interp(int verbose, void *mbio_ptr,
-		double time_d, double *altitude,
-		int *error);
-int mb_loadnavdata(int verbose, char *merge_nav_file, int merge_nav_format, int merge_nav_lonflip,
-                int *merge_nav_num, int *merge_nav_alloc,
-                double **merge_nav_time_d, double **merge_nav_lon,
-                double **merge_nav_lat, double **merge_nav_speed, int *error);
-int mb_loadsensordepthdata(int verbose, char *merge_sensordepth_file, int merge_sensordepth_format,
-                int *merge_sensordepth_num, int *merge_sensordepth_alloc,
-                double **merge_sensordepth_time_d, double **merge_sensordepth_sensordepth,
-                int *error);
-int mb_loadaltitudedata(int verbose, char *merge_altitude_file, int merge_altitude_format,
-                int *merge_altitude_num, int *merge_altitude_alloc,
-                double **merge_altitude_time_d, double **merge_altitude_altitude,
-		int *error);
-int mb_loadheadingdata(int verbose, char *merge_heading_file, int merge_heading_format,
-                int *merge_heading_num, int *merge_heading_alloc,
-                double **merge_heading_time_d, double **merge_heading_heading,
-                int *error);
-int mb_loadattitudedata(int verbose, char *merge_attitude_file, int merge_attitude_format,
-                int *merge_attitude_num, int *merge_attitude_alloc,
-                double **merge_attitude_time_d, double **merge_attitude_roll,
-                double **merge_attitude_pitch, double **merge_attitude_heave,
-                int *error);
-int mb_loadsoundspeeddata(int verbose, char *merge_soundspeed_file, int merge_soundspeed_format,
-                int *merge_soundspeed_num, int *merge_soundspeed_alloc,
-                double **merge_soundspeed_time_d, double **merge_soundspeed_soundspeed,
-		int *error);
-int mb_loadtimeshiftdata(int verbose, char *merge_timeshift_file, int merge_timeshift_format,
-                int *merge_timeshift_num, int *merge_timeshift_alloc,
-                double **merge_timeshift_time_d, double **merge_timeshift_timeshift,
-                int *error);
-
-int mb_swap_check(void);
-int mb_get_double(double *, char *, int);
-int mb_get_int(int *, char *, int);
-int mb_get_binary_short(int, void *, void *);
-int mb_get_binary_int(int, void *, void *);
-int mb_get_binary_float(int, void *, void *);
-int mb_get_binary_double(int, void *, void *);
-int mb_get_binary_long(int, void *, void *);
-int mb_put_binary_short(int, short, void *);
-int mb_put_binary_int(int, int, void *);
-int mb_put_binary_float(int, float, void *);
-int mb_put_binary_double(int, double, void *);
-int mb_put_binary_long(int, mb_s_long, void *);
-int mb_get_bounds (char *text, double *bounds);
-double mb_ddmmss_to_degree (char *text);
-int mb_takeoff_to_rollpitch(int verbose,
-		double theta, double phi,
-		double *alpha, double *beta,
-		int *error);
-int mb_rollpitch_to_takeoff(int verbose,
-		double alpha, double beta,
-		double *theta, double *phi,
-		int *error);
-int mb_xyz_to_takeoff(int verbose,
-		double x, double y, double z,
-		double *theta, double *phi,
-		int *error);
-int mb_lever(int verbose,
-		double sonar_offset_x,
-		double sonar_offset_y,
-		double sonar_offset_z,
-		double nav_offset_x,
-		double nav_offset_y,
-		double nav_offset_z,
-		double vru_offset_x,
-		double vru_offset_y,
-		double vru_offset_z,
-		double vru_pitch,
-		double vru_roll,
-		double *lever_x,
-		double *lever_y,
-		double *lever_z,
-		int *error);
-int mb_mergesort(void *base, size_t nmemb,register size_t size, int (*cmp) (const void *, const void *));
-int mb_double_compare(const void *a, const void *b);
-int mb_int_compare(const void *a, const void *b);
-int mb_edit_compare(const void *a, const void *b);
-void hilbert(int n, double delta[], double kappa[]);
-void hilbert2(int n, double data[]);
-
-int mb_absorption(int verbose,
-		double frequency, double temperature,double salinity,
-		double depth, double ph, double soundspeed,
-		double *absorption, int *error);
-
-int mb_mem_debug_on(int verbose, int *error);
-int mb_mem_debug_off(int verbose, int *error);
-int mb_malloc(int verbose, size_t size, void **ptr, int *error);
-int mb_realloc(int verbose, size_t size, void **ptr, int *error);
-int mb_free(int verbose, void **ptr, int *error);
-int mb_mallocd(int verbose, const char *sourcefile, int sourceline, size_t size, void **ptr, int *error);
-int mb_reallocd(int verbose, const char *sourcefile, int sourceline, size_t size, void **ptr, int *error);
-int mb_freed(int verbose, const char *sourcefile, int sourceline, void **ptr, int *error);
-int mb_memory_clear(int verbose, int *error);
-int mb_memory_status(int verbose, int *nalloc, int *nallocmax,
-			int *overflow, size_t *allocsize, int *error);
-int mb_memory_list(int verbose, int *error);
-int mb_register_array(int verbose, void *mbio_ptr,
-		int type, size_t size, void **handle, int *error);
-int mb_update_arrays(int verbose, void *mbio_ptr,
-		int nbath, int namp, int nss, int *error);
-int mb_update_arrayptr(int verbose, void *mbio_ptr,
-		void **handle, int *error);
-int mb_list_arrays(int verbose, void *mbio_ptr, int *error);
-int mb_deall_ioarrays(int verbose, void *mbio_ptr, int *error);
-
-int mb_get_time(int verbose, int time_i[7], double *time_d);
-int mb_get_date(int verbose, double time_d, int time_i[7]);
-int mb_get_date_string(int verbose, double time_d, char *string);
-int mb_get_jtime(int verbose, int time_i[7], int time_j[5]);
-int mb_get_itime(int verbose, int time_j[5], int time_i[7]);
-int mb_fix_y2k(int verbose, int year_short, int *year_long);
-int mb_unfix_y2k(int verbose, int year_long, int *year_short);
-
-int mb_proj_init(int verbose,
-		char *projection,
-		void **pjptr,
-		int *error);
-int mb_proj_free(int verbose,
-		void **pjptr,
-		int *error);
-int mb_proj_forward(int verbose,
-		void *pjptr,
-		double lon, double lat,
-		double *easting, double *northing,
-		int *error);
-int mb_proj_inverse(int verbose,
-		void *pjptr,
-		double easting, double northing,
-		double *lon, double *lat,
-		int *error);
-int mb_proj_transform(int verbose,
-		void *pjsrcptr,
-		void *pjdstptr,
-		int npoint,
-		double *x, double *y, double *z,
-		int *error);
-
-int mb_swap_check();
-int mb_swap_float(float *a);
-int mb_swap_double(double *a);
-int mb_swap_long(mb_s_long *a);
-
-int mb_beaudoin(int verbose,
-		mb_3D_orientation tx_align,
-		mb_3D_orientation tx_orientation,
-		double tx_steer,
-		mb_3D_orientation rx_align,
-		mb_3D_orientation rx_orientation,
-		double rx_steer,
-		double reference_heading,
-		double *beamAzimuth,
-		double *beamDepression,
-		int	*error);
-int mb_beaudoin_unrotate (int verbose,
-                            mb_3D_vector orig,
-                            mb_3D_orientation rotate,
-                            mb_3D_vector *final,
-                            int *error);
-
-/* mb_rt function prototypes */
-int mb_rt_init(int verbose, int number_node,
-		double *depth, double *velocity,
-		void **modelptr, int *error);
-int mb_rt_deall(int verbose, void **modelptr, int *error);
-int mb_rt(int verbose, void *modelptr,
-	double source_depth, double source_angle, double end_time,
-	int ssv_mode, double surface_vel, double null_angle,
-	int nplot_max, int *nplot, double *xplot, double *zplot,
-	double *x, double *z, double *travel_time, int *ray_stat, int *error);
-
-/* end conditional include */
-#endif
diff --git a/src/mbio/mb_error.c b/src/mbio/mb_error.c
deleted file mode 100644
index bd2ffba..0000000
--- a/src/mbio/mb_error.c
+++ /dev/null
@@ -1,379 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mb_error.c	2/2/93
- *    $Id: mb_error.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1993-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mb_error.c returns a short error message associated with the
- * input error code.
- *
- * Author:	D. W. Caress
- * Date:	February 2, 1993
- *
- * $Log: mb_error.c,v $
- * Revision 5.6  2006/06/16 19:30:58  caress
- * Check in after the Santa Monica Basin Mapping AUV Expedition.
- *
- * Revision 5.5  2006/01/06 18:27:19  caress
- * Working towards 5.0.8
- *
- * Revision 5.4  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.3  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.2  2002/05/29 23:36:53  caress
- * Release 5.0.beta18
- *
- * Revision 5.1  2002/02/22 09:03:43  caress
- * Release 5.0.beta13
- *
- * Revision 5.0  2000/12/01 22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.7  2000/10/11  01:02:30  caress
- * Convert to ANSI C
- *
- * Revision 4.6  2000/09/30  06:26:58  caress
- * Snapshot for Dale.
- *
- * Revision 4.5  1998/10/05  18:32:27  caress
- * MB-System version 4.6beta
- *
- * Revision 4.4  1997/04/21  17:02:07  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.4  1997/04/21  17:02:07  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.3  1995/03/06  19:38:54  caress
- * Changed include strings.h to string.h for POSIX compliance.
- *
- * Revision 4.3  1995/03/06  19:38:54  caress
- * Changed include strings.h to string.h for POSIX compliance.
- *
- * Revision 4.2  1994/10/21  12:11:53  caress
- * Release V4.0
- *
- * Revision 4.1  1994/07/29  18:46:51  caress
- * Changes associated with supporting Lynx OS (byte swapped) and
- * using unix second time base (for time_d values).
- *
- * Revision 4.0  1994/03/05  23:55:38  caress
- * First cut at version 4.0
- *
- * Revision 4.1  1994/03/03  03:39:43  caress
- * Fixed copyright message.
- *
- * Revision 4.0  1994/02/21  04:03:10  caress
- * First cut at new version.  No changes.
- *
- * Revision 3.1  1993/05/14  22:33:34  sohara
- * fixed rcs_id message
- *
- * Revision 3.1  1993/05/14  22:33:34  sohara
- * fixed rcs_id message
- *
- * Revision 3.0  1993/04/23  15:48:29  dale
- * Initial version
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#define DEFINE_MB_MESSAGES 1
-#include "mb_status.h"
-#include "mb_define.h"
-#include "mb_io.h"
-
-static char rcs_id[]="$Id: mb_error.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mb_error(int verbose, int error, char **message)
-{
-	char	*function_name = "mb_error";
-	int	status;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       rcs_id:  %s\n",rcs_id);
-		fprintf(stderr,"dbg2       verbose: %d\n",verbose);
-		fprintf(stderr,"dbg2       error:   %d\n",error);
-		fprintf(stderr,"dbg2       message: %p\n",(void *)message);
-		fprintf(stderr,"dbg2       MB_ERROR_MIN: %d\n",MB_ERROR_MIN);
-		fprintf(stderr,"dbg2       MB_ERROR_MAX: %d\n",MB_ERROR_MAX);
-		}
-
-	/* set the message and status */
-	if (error < MB_ERROR_MIN || error > MB_ERROR_MAX)
-		{
-		*message = unknown_error_msg[0];
-		status = MB_FAILURE;
-		}
-	else if (error > MB_ERROR_NO_ERROR)
-		{
-		*message = fatal_error_msg[error];
-		status = MB_SUCCESS;
-		}
-	else
-		{
-		*message = nonfatal_error_msg[-error];
-		status = MB_SUCCESS;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       message: %s\n",*message);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_notice_log_datatype(int verbose, void *mbio_ptr,
-				int data_id)
-{
-	char	*function_name = "mb_notice_log_datatype";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       rcs_id:     %s\n",rcs_id);
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       data_id:    %d\n",data_id);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* log data record type in the notice list */
-	if (data_id > 0 && data_id <= MB_DATA_KINDS)
-		{
-		mb_io_ptr->notice_list[data_id]++;
-		}
-	else
-		{
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_notice_log_error(int verbose, void *mbio_ptr,
-				int error_id)
-{
-	char	*function_name = "mb_notice_log_error";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       rcs_id:     %s\n",rcs_id);
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       error_id:   %d\n",error_id);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* log any nonfatal error in the notice list */
-	if (error_id < 0 && error_id >= MB_ERROR_MIN)
-		{
-		mb_io_ptr->notice_list[MB_DATA_KINDS-error_id]++;
-		}
-	else
-		{
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_notice_log_problem(int verbose, void *mbio_ptr,
-				int problem_id)
-{
-	char	*function_name = "mb_notice_log_problem";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       rcs_id:     %s\n",rcs_id);
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       problem_id: %d\n",problem_id);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* log data record type in the notice list */
-	if (problem_id > 0 && problem_id <= MB_PROBLEM_MAX)
-		{
-		mb_io_ptr->notice_list[MB_DATA_KINDS - MB_ERROR_MIN + problem_id]++;
-		}
-	else
-		{
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_notice_get_list(int verbose, void *mbio_ptr,
-				int *notice_list)
-{
-	char	*function_name = "mb_notice_get_list";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       rcs_id:         %s\n",rcs_id);
-		fprintf(stderr,"dbg2       verbose:        %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:       %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       notice_list:    %p\n",(void *)notice_list);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* copy notice list */
-	for (i=0;i<MB_NOTICE_MAX;i++)
-		{
-		notice_list[i] = mb_io_ptr->notice_list[i];
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		for (i=0;i<MB_NOTICE_MAX;i++)
-			fprintf(stderr,"dbg2       notice_list[%2.2d]: %d\n",i,notice_list[i]);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:          %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_notice_message(int verbose, int notice, char **message)
-{
-	char	*function_name = "mb_notice_message";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       rcs_id:     %s\n",rcs_id);
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       notice:     %d\n",notice);
-		}
-
-	/* set the message and status */
-	if (notice < 0 || notice > MB_NOTICE_MAX)
-		{
-		*message = unknown_notice_msg[0];
-		status = MB_FAILURE;
-		}
-	else
-		{
-		*message = notice_msg[notice];
-		status = MB_SUCCESS;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       message: %s\n",*message);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mb_esf.c b/src/mbio/mb_esf.c
deleted file mode 100644
index 104ad06..0000000
--- a/src/mbio/mb_esf.c
+++ /dev/null
@@ -1,1180 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mb_esf.c	4/10/2003
- *    $Id: mb_esf.c 2241 2015-05-12 21:00:35Z caress $
- *
- *    Copyright (c) 2003-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mb_esf.c includes the functions used to read, write, and use
- * edit save files.
- *
- * Author:	D. W. Caress
- * Date:	April 10, 2003
- *
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_define.h"
-#include "mb_process.h"
-#include "mb_swap.h"
-
-/* local prototypes */
-void mb_mergesort_setup(mb_u_char *list1, mb_u_char *list2, size_t n, size_t size,
-	int (*cmp) (const void *, const void *));
-void mb_mergesort_insertionsort(mb_u_char *a, size_t n, size_t size,
-	int (*cmp)(const void *, const void *));
-
-static char rcs_id[]="$Id: mb_esf.c 2241 2015-05-12 21:00:35Z caress $";
-
-/*--------------------------------------------------------------------*/
-/* 	function mb_esf_check checks for an existing esf file. */
-int mb_esf_check(int verbose, char *swathfile, char *esffile,
-		int *found, int *error)
-{
-  	char	*function_name = "mb_esf_check";
-	int	status = MB_SUCCESS;
-	int	mbp_edit_mode;
-	char	mbp_editfile[MB_PATH_MAXLINE];
-
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:     %d\n",verbose);
-		fprintf(stderr,"dbg2       swathfile:   %s\n",swathfile);
-		}
-
-	/* check if edit save file is set in mbprocess parameter file
-		or just lying around */
-	status = mb_pr_get_edit(verbose, swathfile,
-			&mbp_edit_mode, mbp_editfile, error);
-	if (mbp_edit_mode == MBP_EDIT_ON)
-		{
-		*found = MB_YES;
-		strcpy(esffile, mbp_editfile);
-		}
-	else
-		{
-		*found = MB_NO;
-		sprintf(esffile, "%s.esf", swathfile);
-		}
-
-	/* assume success */
-	status = MB_SUCCESS;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       esfile:      %s\n",esffile);
-		fprintf(stderr,"dbg2       found:       %d\n",*found);
-		fprintf(stderr,"dbg2       error:       %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	/* return success */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-/* 	function mb_esf_load starts handling an edit save file for
-		the specified swath file.
-		The load flag indicates whether an existing esf file
-			should be loaded.
-		The output flag indicates whether an output
-			esf file should be opened,
-			overwriting any existing esf file. Any
-			existing esf file will be backed up first.
-		If both load and output are MB_NO, nothing will be
-		done. */
-int mb_esf_load(int verbose, char *swathfile,
-		int load, int output,
-		char *esffile,
-		struct mb_esf_struct *esf,
-		int *error)
-{
-  	char	*function_name = "mb_esf_load";
-	int	status = MB_SUCCESS;
-	int	found;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:     %d\n",verbose);
-		fprintf(stderr,"dbg2       swathfile:   %s\n",swathfile);
-		fprintf(stderr,"dbg2       load:        %d\n",load);
-		fprintf(stderr,"dbg2       output:      %d\n",output);
-		}
-
-	/* initialize the esf structure */
-	esf->nedit = 0;
-	esf->esffile[0] = '\0';
-	esf->esstream[0] = '\0';
-	esf->edit = NULL;
-	esf->esffp = NULL;
-	esf->essfp = NULL;
-	esf->byteswapped = mb_swap_check();
-	esf->startnextsearch = 0;
-
-	/* get name of existing or new esffile, then load old edits
-		and/or open new esf file */
-	status = mb_esf_check(verbose, swathfile, esffile, &found, error);
-	if ((load == MB_YES && found == MB_YES) || output != MBP_ESF_NOWRITE)
-		{
-		status = mb_esf_open(verbose, esffile,
-				load, output, esf, error);
-		}
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_NO_DATA_LOADED;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       esfile:      %s\n",esffile);
-		fprintf(stderr,"dbg2       nedit:       %d\n",esf->nedit);
-		for (i=0;i<esf->nedit;i++)
-			fprintf(stderr,"dbg2       edit event:  %d %.6f %5d %3d %3d\n",
-				i,esf->edit[i].time_d,esf->edit[i].beam,
-				esf->edit[i].action,esf->edit[i].use);
-		fprintf(stderr,"dbg2       esf->esffp:  %p\n",(void *)esf->esffp);
-		fprintf(stderr,"dbg2       error:       %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	/* return success */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-/* 	function mb_esf_open starts handling of an edit save file.
-		The load flag indicates whether an existing esf file
-			should be loaded.
-		The output flag indicates whether to open an output
-			edit save file and edit save stream. If
-			the output flag is MBP_ESF_WRITE a new
-			esf file is created. If the output flag is
-			MBP_ESF_APPEND then edit events are appended
-			to any existing esf file. Any
-			existing esf file will be backed up first. */
-int mb_esf_open(int verbose, char *esffile,
-		int load, int output,
-		struct mb_esf_struct *esf,
-		int *error)
-{
-  	char	*function_name = "mb_esf_open";
-	int	status = MB_SUCCESS;
-	char	command[MB_PATH_MAXLINE];
-	FILE	*esffp;
-	struct stat file_status;
-	int	fstat;
-	char	fmode[16];
-	int	shellstatus;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:     %d\n",verbose);
-		fprintf(stderr,"dbg2       esffile:     %s\n",esffile);
-		fprintf(stderr,"dbg2       load:        %d\n",load);
-		fprintf(stderr,"dbg2       output:      %d\n",output);
-		fprintf(stderr,"dbg2       esf:         %p\n",(void *)esf);
-		fprintf(stderr,"dbg2       error:       %p\n",(void *)error);
-		}
-
-	/* initialize the esf structure */
-	esf->nedit = 0;
-	strcpy(esf->esffile, esffile);
-	sprintf(esf->esstream, "%s.stream", esffile);
-	esf->edit = NULL;
-	esf->esffp = NULL;
-	esf->essfp = NULL;
-	esf->byteswapped = mb_swap_check();
-	esf->startnextsearch = 0;
-
-	/* load edits from existing esf file if requested */
-	if (load == MB_YES)
-		{
-
-		/* check that esf file exists */
-		fstat = stat(esffile, &file_status);
-		if (fstat == 0
-		    && (file_status.st_mode & S_IFMT) != S_IFDIR)
-		    {
-		    /* save filename in structure */
-		    strcpy(esf->esffile, esffile);
-
-		    /* get number of old edits */
-		    esf->nedit = file_status.st_size
-				/ (sizeof(double) + 2 * sizeof(int));
-
-		    /* allocate arrays for old edits */
-		    if (esf->nedit > 0)
-			{
-			status = mb_mallocd(verbose, __FILE__, __LINE__, esf->nedit * sizeof(struct mb_edit_struct), (void **)&(esf->edit), error);
-			if (status == MB_SUCCESS)
-			memset(esf->edit, 0, esf->nedit * sizeof(struct mb_edit_struct));
-
-			/* if error initializing memory then quit */
-			if (status != MB_SUCCESS)
-			    {
-			    *error = MB_ERROR_MEMORY_FAIL;
-			    fprintf(stderr, "\nUnable to allocate memory for %d edit events\n",
-				esf->nedit);
-			    esf->nedit = 0;
-			    return(status);
-			    }
-			}
-
-		    /* open and read the old edit file */
-#ifdef WIN32
-		    strcpy(fmode,"r+b");
-#else
-		    strcpy(fmode,"rw");
-#endif
-		    if (status == MB_SUCCESS && esf->nedit > 0 && (esffp = fopen(esffile,fmode)) == NULL)
-			{
-			fprintf(stderr, "\nnedit:%d\n", esf->nedit);
-			esf->nedit = 0;
-			*error = MB_ERROR_OPEN_FAIL;
-			fprintf(stderr, "\nUnable to open edit save file %s\n", esffile);
-			}
-		    else if (status == MB_SUCCESS && esf->nedit > 0)
-			{
-			/* reset message */
-			if (verbose > 0)
-				fprintf(stderr, "Reading %d old edits...\n", esf->nedit);
-
-			*error = MB_ERROR_NO_ERROR;
-			for (i=0;i<esf->nedit && *error == MB_ERROR_NO_ERROR;i++)
-			    {
-			    if (fread(&(esf->edit[i].time_d), sizeof(double), 1, esffp) != 1
-				|| fread(&(esf->edit[i].beam), sizeof(int), 1, esffp) != 1
-				|| fread(&(esf->edit[i].action), sizeof(int), 1, esffp) != 1)
-				{
-				status = MB_FAILURE;
-				*error = MB_ERROR_EOF;
-				}
-			    else if (esf->byteswapped == MB_YES)
-				{
-				mb_swap_double(&(esf->edit[i].time_d));
-				esf->edit[i].beam = mb_swap_int(esf->edit[i].beam);
-				esf->edit[i].action = mb_swap_int(esf->edit[i].action);
-				}
-/*fprintf(stderr,"EDITS READ: i:%d edit: %f %d %d  use:%d\n",
-i,esf->edit[i].time_d,esf->edit[i].beam,
-esf->edit[i].action,esf->edit[i].use);*/
-			    }
-
-			/* close the file */
-			fclose(esffp);
-
-			/* reset message */
-			if (verbose > 0)
-				fprintf(stderr, "Sorting %d old edits...\n", esf->nedit);
-
-			/* first round all timestamps to the nearest 0.1 millisecond to avoid
-				comparison errors during sorting */
-			/* for (i=0;i<esf->nedit;i++)
-			    {
-			    esf->edit[i].time_d = 0.0001 * floor(10000.0 * esf->edit[i].time_d + 0.5);
-			    } */
-
-			/* now sort the edits */
-			mb_mergesort((char *)esf->edit, esf->nedit,
-					sizeof(struct mb_edit_struct), mb_edit_compare);
-/* for (i=0;i<esf->nedit;i++)
-fprintf(stderr,"EDITS SORTED: i:%d edit: %f %d %d  use:%d\n",
-i,esf->edit[i].time_d,esf->edit[i].beam,
-esf->edit[i].action,esf->edit[i].use); */
-			}
-		    }
-	    	}
-
-	if (status == MB_SUCCESS
-		&& output != MBP_ESF_NOWRITE)
-	    	{
-		/* check if esf file exists */
-		fstat = stat(esffile, &file_status);
-		if (fstat == 0
-		    && (file_status.st_mode & S_IFMT) != S_IFDIR)
-		    {
-		    /* copy old edit save file to tmp file */
-		    if (load == MB_YES)
-	    		{
-			sprintf(command, "cp %s %s.tmp\n",
-				esffile, esffile);
-	    		shellstatus = system(command);
-			}
-		    }
-
-		/* open the edit save file */
-		if (output == MBP_ESF_WRITE)
-			strcpy(fmode,"wb");
-		else if (output == MBP_ESF_APPEND)
-			strcpy(fmode,"ab");
-		if ((esf->esffp = fopen(esf->esffile,fmode)) == NULL)
-		    {
-		    status = MB_FAILURE;
-		    *error = MB_ERROR_OPEN_FAIL;
-		    }
-/*else
-fprintf(stderr,"esffile %s opened with mode %s\n",esf->esffile,fmode);*/
-
-		/* open the edit save stream file */
-		if ((esf->essfp = fopen(esf->esstream,fmode)) == NULL)
-		    {
-		    status = MB_FAILURE;
-		    *error = MB_ERROR_OPEN_FAIL;
-		    }
-/*else
-fprintf(stderr,"esstream %s opened with mode %s\n",esf->esstream,fmode);*/
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       nedit:       %d\n",esf->nedit);
-		for (i=0;i<esf->nedit;i++)
-			fprintf(stderr,"dbg2       edit event:  %d %.6f %5d %3d %3d\n",
-				i,esf->edit[i].time_d,esf->edit[i].beam,
-				esf->edit[i].action,esf->edit[i].use);
-		fprintf(stderr,"dbg2       esf->esffile:  %s\n",esf->esffile);
-		fprintf(stderr,"dbg2       esf->esstream: %s\n",esf->esstream);
-		fprintf(stderr,"dbg2       esf->esffp:    %p\n",(void *)esf->esffp);
-		fprintf(stderr,"dbg2       esf->essfp:    %p\n",(void *)esf->essfp);
-		fprintf(stderr,"dbg2       error:         %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:       %d\n",status);
-		}
-
-	/* return success */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-/* 	function mb_esf_fixtimestamps fixes timestamps of all edits
-        in esf that are within tolerance of time_d - those timestamps
-        are set to time_d so that the edits correspond to this ping.
-        This function is used to rectify edit timestamps when edits are
-        being extracted from one version of a dataset and applied to
-        another. */
-int mb_esf_fixtimestamps(int verbose, struct mb_esf_struct *esf,
-		double time_d, double tolerance, int *error)
-{
-  	char	*function_name = "mb_esf_fixtimestamps";
-	int	status = MB_SUCCESS;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:          %d\n",verbose);
-		fprintf(stderr,"dbg2       nedit:            %d\n",esf->nedit);
-		for (i=0;i<esf->nedit;i++)
-			fprintf(stderr,"dbg2       edit event: %d %.6f %5d %3d %3d\n",
-				i,esf->edit[i].time_d,esf->edit[i].beam,
-				esf->edit[i].action,esf->edit[i].use);
-		fprintf(stderr,"dbg2       time_d:           %f\n",time_d);
-		fprintf(stderr,"dbg2       tolerance:        %f\n",tolerance);
-		}
-
-	/* all edits that have timestamps within tolerance of time_d will have
-	their timestamps set to time_d */
-	for (j = 0; j < esf->nedit; j++)
-		{
-		if (fabs(esf->edit[j].time_d - time_d) < tolerance)
-		    {
-		    esf->edit[j].time_d = time_d;
-		    }
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		for (i=0;i<esf->nedit;i++)
-			fprintf(stderr,"dbg2       edit event: %d %.6f %5d %3d %3d\n",
-				i,esf->edit[i].time_d,esf->edit[i].beam,
-				esf->edit[i].action,esf->edit[i].use);
-		fprintf(stderr,"dbg2       error:  %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return success */
-	return(status);
-}
-
-
-/*--------------------------------------------------------------------*/
-/* 	function mb_esf_apply applies saved edits to the beamflags
-	in a ping. If an output esf file is open the applied edits
-	are saved to that file. */
-int mb_esf_apply(int verbose, struct mb_esf_struct *esf,
-		double time_d, int pingmultiplicity, int nbath, char *beamflag,
-		int *error)
-{
-  	char	*function_name = "mb_esf_apply";
-	int	status = MB_SUCCESS;
-	int	firstedit, lastedit;
-	int	apply, action;
-	int	beamoffset, beamoffsetmax;
-	char	beamflagorg;
-	int	ibeam;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:          %d\n",verbose);
-		fprintf(stderr,"dbg2       nedit:            %d\n",esf->nedit);
-		for (i=0;i<esf->nedit;i++)
-			fprintf(stderr,"dbg2       edit event: %d %.6f %5d %3d %3d\n",
-				i,esf->edit[i].time_d,esf->edit[i].beam,
-				esf->edit[i].action,esf->edit[i].use);
-		fprintf(stderr,"dbg2       time_d:           %f\n",time_d);
-		fprintf(stderr,"dbg2       pingmultiplicity: %d\n",pingmultiplicity);
-		fprintf(stderr,"dbg2       nbath:            %d\n",nbath);
-		for (i=0;i<nbath;i++)
-			fprintf(stderr,"dbg2       beamflag:    %d %d\n",i,beamflag[i]);
-		}
-
-	/* if ping has the same time stamp as previous pings, pingmultiplicity will be
-		> 0 and the edit beam values will be augmented by
-		MB_ESF_MULTIPLICITY_FACTOR * pingmultiplicity */
-	beamoffset = MB_ESF_MULTIPLICITY_FACTOR * pingmultiplicity;
-	beamoffsetmax = beamoffset + MB_ESF_MULTIPLICITY_FACTOR;
-
-	/* find first and last edits for this ping - take ping multiplicity into account */
-	if (esf->nedit > 0 && time_d < (esf->edit[esf->startnextsearch].time_d - MB_ESF_MAXTIMEDIFF)
-		&& (esf->startnextsearch > 0
-			&& time_d < (esf->edit[esf->startnextsearch-1].time_d - MB_ESF_MAXTIMEDIFF)))
-		firstedit = 0;
-	else
-		firstedit = esf->startnextsearch;
-	lastedit = firstedit - 1;
-	for (j = firstedit; j < esf->nedit && time_d >= (esf->edit[j].time_d - MB_ESF_MAXTIMEDIFF); j++)
-		{
-		if (fabs(esf->edit[j].time_d - time_d) < MB_ESF_MAXTIMEDIFF
-		    && esf->edit[j].beam >= beamoffset && esf->edit[j].beam < beamoffsetmax)
-		    {
-		    if (lastedit < firstedit)
-			firstedit = j;
-		    lastedit = j;
-		    }
-		}
-/*fprintf(stderr,"firstedit:%d lastedit:%d\n",firstedit,lastedit);*/
-
-	/* apply edits */
-	if (lastedit >= firstedit)
-		{
-		/* check for edits with bad beam numbers */
-		for (j=firstedit;j<=lastedit;j++)
-		    {
-		    if ((esf->edit[j].beam % MB_ESF_MULTIPLICITY_FACTOR) >= nbath)
-		    	esf->edit[j].use += 10000;
-		    }
-
-		/* loop over all beams */
-		for (i=0;i<nbath;i++)
-		    {
-		    /* apply beam offset for cases of multiple pings */
-		    ibeam = i + beamoffset;
-
-		    /* loop over all edits for this ping */
-		    apply = MB_NO;
-		    beamflagorg = beamflag[i];
-		    for (j=firstedit;j<=lastedit;j++)
-			{
-			/* apply the edits for this beam in the
-			   order they were created so that the last
-			   edit event is applied last - only the
-			   last event will be output to a new
-			   esf file - the overridden edit events
-			   may already be indicated by a use value
-			   of 100 or more. */
-			if (esf->edit[j].beam == ibeam
-			    && esf->edit[j].use < 100)
-			    {
-			    /* apply edit */
-			    if (esf->edit[j].action == MBP_EDIT_FLAG
-				&& !mb_beam_check_flag_null(beamflag[i]))
-				{
-/*fprintf(stderr,"edit:%d beam:%d MBP_EDIT_FLAG  flag:%d ",j,i,beamflag[i]);*/
-				beamflag[i] = mb_beam_set_flag_manual(beamflag[i]);
-				esf->edit[j].use++;
-				apply = MB_YES;
-				action = esf->edit[j].action;
-/*fprintf(stderr," %d\n",beamflag[i]);*/
-				}
-			    else if (esf->edit[j].action == MBP_EDIT_FILTER
-				&& !mb_beam_check_flag_null(beamflag[i]))
-				{
-/*fprintf(stderr,"edit:%d beam:%d MBP_EDIT_FILTER\n",j,i);*/
-				beamflag[i] = mb_beam_set_flag_filter(beamflag[i]);
-				esf->edit[j].use++;
-				apply = MB_YES;
-				action = esf->edit[j].action;
-				}
-			    else if (esf->edit[j].action == MBP_EDIT_UNFLAG
-				&& !mb_beam_check_flag_null(beamflag[i]))
-				{
-/*fprintf(stderr,"edit:%d beam:%d MBP_EDIT_UNFLAG\n",j,i);*/
-				beamflag[i] = mb_beam_set_flag_none(beamflag[i]);
-				esf->edit[j].use++;
-				apply = MB_YES;
-				action = esf->edit[j].action;
-				}
-			    else if (esf->edit[j].action == MBP_EDIT_ZERO)
-				{
-/*fprintf(stderr,"edit:%d beam:%d MBP_EDIT_ZERO\n",j,i);*/
-				beamflag[i] = mb_beam_set_flag_null(beamflag[i]);
-				esf->edit[j].use++;
-				apply = MB_YES;
-				action = esf->edit[j].action;
-				}
-			    else
-				{
-/*fprintf(stderr,"edit:%d beam:%d NOT USED\n",j,i);*/
-				esf->edit[j].use += 1000;
-/*fprintf(stderr,"Dup Edit[%d]?: ping:%f beam:%d flag:%d action:%d\n",
-j, time_d, i, beamflag[i], esf->edit[j].action);*/
-				}
-			    }
-			}
-		    if (apply == MB_YES
-		    	&& esf->essfp != NULL
-			&& beamflag[i] != beamflagorg)
-		    	mb_ess_save(verbose, esf, time_d, ibeam, action, error);
-		    }
-		    
-		/* reset startnextsearch */
-		esf->startnextsearch = lastedit + 1;
-		if (esf->startnextsearch >= esf->nedit)
-			esf->startnextsearch = esf->nedit - 1;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       time_d:           %f\n",time_d);
-		fprintf(stderr,"dbg2       pingmultiplicity: %d\n",pingmultiplicity);
-		fprintf(stderr,"dbg2       nbath:            %d\n",nbath);
-		for (i=0;i<nbath;i++)
-			fprintf(stderr,"dbg2       beamflag:    %d %d %d\n",i,ibeam,beamflag[i]);
-		fprintf(stderr,"dbg2       error:  %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return success */
-	return(status);
-}
-
-
-/*--------------------------------------------------------------------*/
-/* 	function mb_esf_save saves one edit event to an esf file. */
-int mb_esf_save(int verbose, struct mb_esf_struct *esf,
-		double time_d, int beam, int action, int *error)
-{
-  	char	*function_name = "mb_esf_save";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:          %d\n",verbose);
-		fprintf(stderr,"dbg2       esf->nedit:       %d\n",esf->nedit);
-		fprintf(stderr,"dbg2       esf->edit:        %p\n",(void *)esf->edit);
-		fprintf(stderr,"dbg2       esf->esffp:       %p\n",(void *)esf->esffp);
-		fprintf(stderr,"dbg2       time_d:           %f\n",time_d);
-		fprintf(stderr,"dbg2       beam:             %d\n",beam);
-		fprintf(stderr,"dbg2       action:           %d\n",action);
-		}
-
-	/* write out the edit */
-	if (esf->esffp != NULL)
-	    {
-/*fprintf(stderr,"OUTPUT EDIT: %f %d %d\n",time_d,beam,action);*/
-	    if (esf->byteswapped == MB_YES)
-	    	{
-	   	mb_swap_double(&time_d);
-	    	beam = mb_swap_int(beam);
-	    	action = mb_swap_int(action);
-		}
-	    if (fwrite(&time_d, sizeof(double), 1, esf->esffp) != 1)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	    if (status == MB_SUCCESS
-		&& fwrite(&beam, sizeof(int), 1, esf->esffp) != 1)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	    if (status == MB_SUCCESS
-		&& fwrite(&action, sizeof(int), 1, esf->esffp) != 1)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	    }
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       esf->nedit:       %d\n",esf->nedit);
-		fprintf(stderr,"dbg2       esf->edit:        %p\n",(void *)esf->edit);
-		fprintf(stderr,"dbg2       esf->esffp:       %p\n",(void *)esf->esffp);
-		fprintf(stderr,"dbg2       error:            %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:           %d\n",status);
-		}
-
-	/* return success */
-	return(status);
-}
-
-
-/*--------------------------------------------------------------------*/
-/* 	function mb_ess_save saves one edit event to an edit save stream file. */
-int mb_ess_save(int verbose, struct mb_esf_struct *esf,
-		double time_d, int beam, int action, int *error)
-{
-  	char	*function_name = "mb_ess_save";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:          %d\n",verbose);
-		fprintf(stderr,"dbg2       esf->nedit:       %d\n",esf->nedit);
-		fprintf(stderr,"dbg2       esf->edit:        %p\n",(void *)esf->edit);
-		fprintf(stderr,"dbg2       esf->essfp:       %p\n",(void *)esf->essfp);
-		fprintf(stderr,"dbg2       time_d:           %f\n",time_d);
-		fprintf(stderr,"dbg2       beam:             %d\n",beam);
-		fprintf(stderr,"dbg2       action:           %d\n",action);
-		}
-
-	/* write out the edit */
-	if (esf->essfp != NULL)
-	    {
-/*fprintf(stderr,"OUTPUT EDIT: %f %d %d\n",time_d,beam,action);*/
-	    if (esf->byteswapped == MB_YES)
-	    	{
-	        mb_swap_double(&time_d);
-	        beam = mb_swap_int(beam);
-	        action = mb_swap_int(action);
-		}
-	    if (fwrite(&time_d, sizeof(double), 1, esf->essfp) != 1)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	    if (status == MB_SUCCESS
-		&& fwrite(&beam, sizeof(int), 1, esf->essfp) != 1)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	    if (status == MB_SUCCESS
-		&& fwrite(&action, sizeof(int), 1, esf->essfp) != 1)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	    }
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       esf->nedit:       %d\n",esf->nedit);
-		fprintf(stderr,"dbg2       esf->edit:        %p\n",(void *)esf->edit);
-		fprintf(stderr,"dbg2       esf->essfp:       %p\n",(void *)esf->essfp);
-		fprintf(stderr,"dbg2       error:            %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:           %d\n",status);
-		}
-
-	/* return success */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-/* 	function mb_esf_close deallocates memory in the esf structure. */
-int mb_esf_close(int verbose, struct mb_esf_struct *esf, int *error)
-{
-  	char	*function_name = "mb_esf_close";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:          %d\n",verbose);
-		fprintf(stderr,"dbg2       esf->nedit:       %d\n",esf->nedit);
-		fprintf(stderr,"dbg2       esf->edit:        %p\n",(void *)esf->edit);
-		fprintf(stderr,"dbg2       esf->esffp:       %p\n",(void *)esf->esffp);
-		}
-
-	/* deallocate the arrays */
-	if (esf->nedit != 0)
-		{
-		if (esf->edit != NULL)
-			status = mb_freed(verbose,__FILE__, __LINE__,(void **)&(esf->edit), error);
-		}
-	esf->nedit = 0;
-
-	/* close the esf file */
-	if (esf->esffp != NULL)
-		{
-		fclose(esf->esffp);
-		esf->esffp = NULL;
-		}
-
-	/* close the esf stream file */
-	if (esf->essfp != NULL)
-		{
-		fclose(esf->essfp);
-		esf->essfp = NULL;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       esf->nedit:       %d\n",esf->nedit);
-		fprintf(stderr,"dbg2       esf->edit:        %p\n",(void *)esf->edit);
-		fprintf(stderr,"dbg2       esf->esffp:       %p\n",(void *)esf->esffp);
-		fprintf(stderr,"dbg2       esf->essfp:       %p\n",(void *)esf->essfp);
-		fprintf(stderr,"dbg2       error:            %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:           %d\n",status);
-		}
-
-	/* return success */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-/* The following code has been modified from code obtained from
-	http://www.gnu-darwin.org/sources/4Darwin-x86/src/lib/libc/stdlib/merge.c
-   on July 27, 2003 by David W. Caress.
- */
-
-/*
- * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
- *
- * @APPLE_LICENSE_HEADER_START@
- *
- * The contents of this file constitute Original Code as defined in and
- * are subject to the Apple Public Source License Version 1.1 (the
- * "License").  You may not use this file except in compliance with the
- * License.  Please obtain a copy of the License at
- * http://www.apple.com/publicsource and read it before using this file.
- *
- * This Original Code and all software distributed under the License are
- * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
- * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
- * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT.  Please see the
- * License for the specific language governing rights and limitations
- * under the License.
- *
- * @APPLE_LICENSE_HEADER_END@
- */
-/*
- * Copyright (c) 1992, 1993
- *	The Regents of the University of California.  All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Peter McIlroy.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *	This product includes software developed by the University of
- *	California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-
-/*
- * Hybrid exponential search/linear search merge sort with hybrid
- * natural/pairwise first pass.  Requires about .3% more comparisons
- * for random data than LSMS with pairwise first pass alone.
- * It works for objects as small as two bytes.
- */
-
-#define NATURAL
-#define THRESHOLD 16	/* Best choice for natural merge cut-off. */
-
-/* #define NATURAL to get hybrid natural merge.
- * (The default is pairwise merging.)
- */
-
-#define ISIZE sizeof(int)
-#define PSIZE sizeof(mb_u_char *)
-#define ICOPY_LIST(src, dst, last)				\
-	do							\
-	*(int*)dst = *(int*)src, src += ISIZE, dst += ISIZE;	\
-	while(src < last)
-#define ICOPY_ELT(src, dst, i)					\
-	do							\
-	*(int*) dst = *(int*) src, src += ISIZE, dst += ISIZE;	\
-	while (i -= ISIZE)
-
-#define CCOPY_LIST(src, dst, last)		\
-	do					\
-		*dst++ = *src++;		\
-	while (src < last)
-#define CCOPY_ELT(src, dst, i)			\
-	do					\
-		*dst++ = *src++;		\
-	while (i -= 1)
-
-/*
- * Find the next possible pointer head.  (Trickery for forcing an array
- * to do double duty as a linked list when objects do not align with word
- * boundaries.
- */
-/* Assumption: PSIZE is a power of 2. */
-#define EVAL(p) (mb_u_char **)						\
-	((mb_u_char *)0 +							\
-	    (((mb_u_char *)p + PSIZE - 1 - (mb_u_char *) 0) & ~(PSIZE - 1)))
-
-/*
- * Arguments are as for qsort.
- */
-int mb_mergesort(void *base, size_t nmemb,register size_t size,
-	int (*cmp) (const void *, const void *))
-{
-	register int i, sense;
-	int big, iflag;
-	register mb_u_char *f1, *f2, *t, *b, *tp2, *q, *l1, *l2;
-	mb_u_char *list2, *list1, *p2, *p, *last, **p1;
-
-	if (size < PSIZE / 2) {		/* Pointers must fit into 2 * size. */
-		/*errno = EINVAL;*/
-		return (-1);
-	}
-
-	/*
-	 * XXX
-	 * Stupid subtraction for the Cray.
-	 */
-	iflag = 0;
-	if (!(size % ISIZE) && !(((char *)base - (char *)0) % ISIZE))
-		iflag = 1;
-
-	if ((list2 = (mb_u_char *) malloc(nmemb * size + PSIZE)) == NULL)
-		return (-1);
-
-	list1 = base;
-	mb_mergesort_setup(list1, list2, nmemb, size, cmp);
-	last = list2 + nmemb * size;
-	i = big = 0;
-	while (*EVAL(list2) != last) {
-	    l2 = list1;
-	    p1 = EVAL(list1);
-	    for (tp2 = p2 = list2; p2 != last; p1 = EVAL(l2)) {
-	    	p2 = *EVAL(p2);
-	    	f1 = l2;
-	    	f2 = l1 = list1 + (p2 - list2);
-	    	if (p2 != last)
-	    		p2 = *EVAL(p2);
-	    	l2 = list1 + (p2 - list2);
-	    	while (f1 < l1 && f2 < l2) {
-	    		if ((*cmp)(f1, f2) <= 0) {
-	    			q = f2;
-	    			b = f1, t = l1;
-	    			sense = -1;
-	    		} else {
-	    			q = f1;
-	    			b = f2, t = l2;
-	    			sense = 0;
-	    		}
-	    		if (!big) {	/* here i = 0 */
-/*LINEAR:*/	    			while ((b += size) < t && cmp(q, b) >sense)
-	    				if (++i == 6) {
-	    					big = 1;
-	    					goto EXPONENTIAL;
-	    				}
-	    		} else {
-EXPONENTIAL:	    		for (i = size; ; i <<= 1)
-	    				if ((p = (b + i)) >= t) {
-	    					if ((p = t - size) > b &&
-						    (*cmp)(q, p) <= sense)
-	    						t = p;
-	    					else
-	    						b = p;
-	    					break;
-	    				} else if ((*cmp)(q, p) <= sense) {
-	    					t = p;
-	    					if (i == size)
-	    						big = 0;
-	    					goto FASTCASE;
-	    				} else
-	    					b = p;
-/*SLOWCASE:*/	    		while (t > b+size) {
-	    				i = (((t - b) / size) >> 1) * size;
-	    				if ((*cmp)(q, p = b + i) <= sense)
-	    					t = p;
-	    				else
-	    					b = p;
-	    			}
-	    			goto COPY;
-FASTCASE:	    		while (i > size)
-	    				if ((*cmp)(q,
-	    					p = b + (i >>= 1)) <= sense)
-	    					t = p;
-	    				else
-	    					b = p;
-COPY:	    			b = t;
-	    		}
-	    		i = size;
-	    		if (q == f1) {
-	    			if (iflag) {
-	    				ICOPY_LIST(f2, tp2, b);
-	    				ICOPY_ELT(f1, tp2, i);
-	    			} else {
-	    				CCOPY_LIST(f2, tp2, b);
-	    				CCOPY_ELT(f1, tp2, i);
-	    			}
-	    		} else {
-	    			if (iflag) {
-	    				ICOPY_LIST(f1, tp2, b);
-	    				ICOPY_ELT(f2, tp2, i);
-	    			} else {
-	    				CCOPY_LIST(f1, tp2, b);
-	    				CCOPY_ELT(f2, tp2, i);
-	    			}
-	    		}
-	    	}
-	    	if (f2 < l2) {
-	    		if (iflag)
-	    			ICOPY_LIST(f2, tp2, l2);
-	    		else
-	    			CCOPY_LIST(f2, tp2, l2);
-	    	} else if (f1 < l1) {
-	    		if (iflag)
-	    			ICOPY_LIST(f1, tp2, l1);
-	    		else
-	    			CCOPY_LIST(f1, tp2, l1);
-	    	}
-	    	*p1 = l2;
-	    }
-	    tp2 = list1;	/* swap list1, list2 */
-	    list1 = list2;
-	    list2 = tp2;
-	    last = list2 + nmemb*size;
-	}
-	if (base == list2) {
-		memmove(list2, list1, nmemb*size);
-		list2 = list1;
-	}
-	free(list2);
-	return (0);
-}
-
-#define	swap(a, b) {					\
-		s = b;					\
-		i = size;				\
-		do {					\
-			tmp = *a; *a++ = *s; *s++ = tmp; \
-		} while (--i);				\
-		a -= size;				\
-	}
-#define reverse(bot, top) {				\
-	s = top;					\
-	do {						\
-		i = size;				\
-		do {					\
-			tmp = *bot; *bot++ = *s; *s++ = tmp; \
-		} while (--i);				\
-		s -= size2;				\
-	} while(bot < s);				\
-}
-
-/*
- * Optional hybrid natural/pairwise first pass.  Eats up list1 in runs of
- * increasing order, list2 in a corresponding linked list.  Checks for runs
- * when THRESHOLD/2 pairs compare with same sense.  (Only used when NATURAL
- * is defined.  Otherwise simple pairwise merging is used.)
- */
-void mb_mergesort_setup(mb_u_char *list1, mb_u_char *list2, size_t n, size_t size,
-	int (*cmp) (const void *, const void *))
-{
-	int i, length, size2, tmp, sense;
-	mb_u_char *f1, *f2, *s, *l2, *last, *p2;
-
-	size2 = size*2;
-	if (n <= 5) {
-		mb_mergesort_insertionsort(list1, n, size, cmp);
-		*EVAL(list2) = (mb_u_char*) list2 + n*size;
-		return;
-	}
-	/*
-	 * Avoid running pointers out of bounds; limit n to evens
-	 * for simplicity.
-	 */
-	i = 4 + (n & 1);
-	mb_mergesort_insertionsort(list1 + (n - i) * size, i, size, cmp);
-	last = list1 + size * (n - i);
-	*EVAL(list2 + (last - list1)) = list2 + n * size;
-
-#ifdef NATURAL
-	p2 = list2;
-	f1 = list1;
-	sense = (cmp(f1, f1 + size) > 0);
-	for (; f1 < last; sense = !sense) {
-		length = 2;
-					/* Find pairs with same sense. */
-		for (f2 = f1 + size2; f2 < last; f2 += size2) {
-			if ((cmp(f2, f2+ size) > 0) != sense)
-				break;
-			length += 2;
-		}
-		if (length < THRESHOLD) {		/* Pairwise merge */
-			do {
-				p2 = *EVAL(p2) = f1 + size2 - list1 + list2;
-				if (sense > 0)
-					swap (f1, f1 + size);
-			} while ((f1 += size2) < f2);
-		} else {				/* Natural merge */
-			l2 = f2;
-			for (f2 = f1 + size2; f2 < l2; f2 += size2) {
-				if ((cmp(f2-size, f2) > 0) != sense) {
-					p2 = *EVAL(p2) = f2 - list1 + list2;
-					if (sense > 0)
-						reverse(f1, f2-size);
-					f1 = f2;
-				}
-			}
-			if (sense > 0)
-				reverse (f1, f2-size);
-			f1 = f2;
-			if (f2 < last || cmp(f2 - size, f2) > 0)
-				p2 = *EVAL(p2) = f2 - list1 + list2;
-			else
-				p2 = *EVAL(p2) = list2 + n*size;
-		}
-	}
-#else		/* pairwise merge only. */
-	for (f1 = list1, p2 = list2; f1 < last; f1 += size2) {
-		p2 = *EVAL(p2) = p2 + size2;
-		if (cmp (f1, f1 + size) > 0)
-			swap(f1, f1 + size);
-	}
-#endif /* NATURAL */
-}
-
-/*
- * This is to avoid out-of-bounds addresses in sorting the
- * last 4 elements.
- */
-void mb_mergesort_insertionsort(mb_u_char *a, size_t n, size_t size,
-	int (*cmp)(const void *, const void *))
-{
-	mb_u_char *ai, *s, *t, *u, tmp;
-	int i;
-
-	for (ai = a+size; --n >= 1; ai += size)
-		for (t = ai; t > a; t -= size) {
-			u = t - size;
-			if (cmp(u, t) <= 0)
-				break;
-			swap(u, t);
-		}
-}
diff --git a/src/mbio/mb_fileio.c b/src/mbio/mb_fileio.c
deleted file mode 100644
index 3c5e4a3..0000000
--- a/src/mbio/mb_fileio.c
+++ /dev/null
@@ -1,264 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mb_fileio.c	5/23/2012
- *    $Id:  $
- *
- *    Copyright (c) 2012-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mb_fileio.c contains the functions handling reading and writing of bytes to and from
- * single, regular files. In some cases this may be done directly using
- * fread() and fwrite() with standard buffering, in others there may be
- * local buffering, and in others mmap may be used.
- *
- * These functions include:
- *   mb_fileio_open	- initialize i/o, called by mb_read_init() and mb_write_init()
- *   mb_fileio_close	- cleanup i/o, called by mb_close()
- *   mb_fileio_get	- get bytes from input
- *   mb_fileio_put	- put bytes to output
- *
- * Author:	D. W. Caress
- * Date:	23 May 2012
- *
- * $Log: $
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_io.h"
-#include "mb_define.h"
-
-static char rcs_id[]="$Id: $";
-
-/*--------------------------------------------------------------------*/
-int mb_fileio_open(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mb_fileio_open";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	int	fileiobuffer;
-	size_t	fileiobufferbytes;
-	int	buffer_status = MB_SUCCESS;
-	int	buffer_error = MB_ERROR_NO_ERROR;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* open the file for reading */
-	if (mb_io_ptr->filemode == MB_FILEMODE_READ)
-		{
-		if ((mb_io_ptr->mbfp = fopen(mb_io_ptr->file, "rb")) == NULL)
-			 {
-			 *error = MB_ERROR_OPEN_FAIL;
-			 status = MB_FAILURE;
-			 }
-		}
-	else if (mb_io_ptr->filemode == MB_FILEMODE_WRITE)
-		{
-		if ((mb_io_ptr->mbfp = fopen(mb_io_ptr->file, "wb")) == NULL)
-			 {
-			 *error = MB_ERROR_OPEN_FAIL;
-			 status = MB_FAILURE;
-			 }
-		}
-
-	/* set buffering if desired
-		fileiomode: mode of single normal file i/o:
-                        0   use fread() and fwrite() with standard buffering
-                        >0  use fread() and fwrite() with user defined buffer
-                        <0  use mmap for file i/o */
-	if (status == MB_SUCCESS)
-		{
-		mb_fileiobuffer(verbose, &fileiobuffer);
-		if (fileiobuffer > 0)
-			{
-			/* the buffer size must be a multiple of 512, plus 8 to be efficient */
-			fileiobufferbytes = (fileiobuffer * 1024) + 8;
-
-			/* allocate the buffer */
-			buffer_error = MB_ERROR_NO_ERROR;
-			buffer_status = mb_mallocd(verbose,__FILE__, __LINE__, fileiobufferbytes,
-							(void **) &mb_io_ptr->file_iobuffer, &buffer_error);
-
-			/* apply the buffer */
-			if (buffer_status == MB_SUCCESS)
-				{
-				buffer_status = setvbuf(mb_io_ptr->mbfp, mb_io_ptr->file_iobuffer, _IOFBF, fileiobufferbytes);
-/* printf(stderr,"Called setvbuf size:%d status:%d\n",fileiobufferbytes,buffer_status); */
-				}
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_fileio_close(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mb_fileio_close";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* open the file */
-	if (mb_io_ptr->mbfp != NULL)
-		{
-                fclose(mb_io_ptr->mbfp);
-                mb_io_ptr->mbfp = NULL;
-                }
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_fileio_get(int verbose, void *mbio_ptr, char *buffer, size_t *size, int *error)
-{
-	char	*function_name = "mb_fileio_get";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-        size_t  read_len;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       buffer:     %p\n",(void *)buffer);
-		fprintf(stderr,"dbg2       size:       %p\n",(void *)size);
-		fprintf(stderr,"dbg2       *size:      %p\n",(void *)(*size));
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-        /* read expected number of bytes into buffer */
-        if ((read_len = fread(buffer, 1, *size, mb_io_ptr->mbfp)) != *size)
-                {
-                status = MB_FAILURE;
-                *error = MB_ERROR_EOF;
-                *size = read_len;
-                }
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       size:       %p\n",(void *)size);
-		fprintf(stderr,"dbg2       *size:      %p\n",(void *)(*size));
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_fileio_put(int verbose, void *mbio_ptr, char *buffer, size_t *size, int *error)
-{
-	char	*function_name = "mb_fileio_put";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	size_t	write_len;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       buffer:     %p\n",(void *)buffer);
-		fprintf(stderr,"dbg2       size:       %p\n",(void *)size);
-		fprintf(stderr,"dbg2       *size:      %p\n",(void *)(*size));
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-        /* write expected number of bytes from buffer */
-        if ((write_len = fwrite(buffer, 1, *size, mb_io_ptr->mbfp)) != *size)
-                {
-                status = MB_FAILURE;
-                *error = MB_ERROR_EOF;
-                *size = write_len;
-                }
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       size:       %p\n",(void *)size);
-		fprintf(stderr,"dbg2       *size:      %p\n",(void *)(*size));
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mb_format.c b/src/mbio/mb_format.c
deleted file mode 100644
index b83c0a2..0000000
--- a/src/mbio/mb_format.c
+++ /dev/null
@@ -1,4827 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mb_format.c	2/18/94
- *    $Id: mb_format.c 2247 2015-05-29 21:28:28Z caress $
- *
- *    Copyright (c) 1993-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mb_format.c contains several functions associated with getting
- * information about data formats.
- *
- * Author:	D. W. Caress
- * Date:	Februrary 18, 1994
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <unistd.h>
-#include <math.h>
-#include <string.h>
-#include <sys/stat.h>
-
-/* mbio include files */
-#include "mb_define.h"
-#include "mb_status.h"
-#include "mb_process.h"
-#include "mb_io.h"
-#include "mb_swap.h"
-#include "mb_format.h"
-#include "mbsys_simrad.h"
-#include "mbsys_simrad2.h"
-#include "mbsys_simrad3.h"
-#include "mbsys_jstar.h"
-
-/* Alias table for old (pre-version 4.0) format id's */
-static int format_alias_table[] =
-	{
-	0,	/* NULL */
-	11,	/* MBF_SBSIOMRG */
-	12,	/* MBF_SBSIOCEN */
-	13,	/* MBF_SBSIOLSI */
-	14,	/* MBF_SBURICEN */
-	21,	/* MBF_HSATLRAW */
-	22,	/* MBF_HSLDEDMB */
-	23,	/* MBF_HSURICEN */
-	24,	/* MBF_HSLDEOIH */
-	71,	/* MBF_MBLDEOIH */
-	};
-
-/* local prototypes not found in mb_define.h */
-int mb_datalist_readorg(int verbose,
-		void *datalist,
-		char *path, int *format, double *weight,
-		int *error);
-int cvt_to_nix_path(char *path);
-
-static char rcs_id[]="$Id: mb_format.c 2247 2015-05-29 21:28:28Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mb_format_register(int verbose,
-			int *format,
-			void *mbio_ptr,
-			int *error)
-{
-	char	*function_name = "mb_format_register";
-	int	status;
-	struct mb_io_struct *mb_io_ptr;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       rcs_id:    %s\n",rcs_id);
-		fprintf(stderr,"dbg2       verbose:   %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:  %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       format:    %d\n",*format);
-		}
-
-	/* get mb_io_ptr */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* check for old format id and provide alias if needed */
-	if (*format > 0
-	    && (*format < 10 || *format == 44
-		|| *format == 52 || *format == 55))
-	    {
-	    /* replace original mbio id's */
-	    if (*format < 10)
-		i = format_alias_table[*format];
-
-	    /* handle incorrectly identified SeaBeam 2120 data */
-	    else if (*format == 44)
-		i = MBF_L3XSERAW;
-
-	    /* handle old Simrad EM12 and EM121 formats */
-	    else if (*format == 52 || *format == 55)
-		i = MBF_EMOLDRAW;
-		
-	    else
-	        i = 0;
-		
-	    /* print output debug statements */
-	    if (verbose >= 2)
-		    {
-		    fprintf(stderr,"\ndbg2  Old format id aliased to current value in MBIO function <%s>\n",
-			    function_name);
-		    fprintf(stderr,"dbg2  Old format value:\n");
-		    fprintf(stderr,"dbg2       format:     %d\n",*format);
-		    fprintf(stderr,"dbg2  Current format value:\n");
-		    fprintf(stderr,"dbg2       format:     %d\n",i);
-		    }
-
-	    /* set new format value */
-	    *format = i;
-	    }
-
-	/* set format value */
-	mb_io_ptr->format = *format;
-
-	/* look for a corresponding format */
-	if (*format == MBF_SBSIOMRG)
-		{
-		status = mbr_register_sbsiomrg(verbose, mbio_ptr, error);
-		}
-	else if (*format == MBF_SBSIOCEN)
-		{
-		status = mbr_register_sbsiocen(verbose, mbio_ptr, error);
-		}
-	else if (*format == MBF_SBSIOLSI)
-		{
-		status = mbr_register_sbsiolsi(verbose, mbio_ptr, error);
-		}
-	else if (*format == MBF_SBURICEN)
-		{
-		status = mbr_register_sburicen(verbose, mbio_ptr, error);
-		}
-	else if (*format == MBF_SBURIVAX)
-		{
-		status = mbr_register_sburivax(verbose, mbio_ptr, error);
-		}
-	else if (*format == MBF_SBSIOSWB)
-		{
-		status = mbr_register_sbsioswb(verbose, mbio_ptr, error);
-		}
-	else if (*format == MBF_SBIFREMR)
-		{
-		status = mbr_register_sbifremr(verbose, mbio_ptr, error);
-		}
-	else if (*format == MBF_HSLDEDMB)
-		{
-		status = mbr_register_hsldedmb(verbose, mbio_ptr, error);
-		}
-	else if (*format == MBF_HSURICEN)
-		{
-		status = mbr_register_hsuricen(verbose, mbio_ptr, error);
-		}
-	else if (*format == MBF_HSATLRAW)
-		{
-		status = mbr_register_hsatlraw(verbose, mbio_ptr, error);
-		}
-	else if (*format == MBF_HSLDEOIH)
-		{
-		status = mbr_register_hsldeoih(verbose, mbio_ptr, error);
-		}
-	else if (*format == MBF_HSURIVAX)
-		{
-		status = mbr_register_hsurivax(verbose, mbio_ptr, error);
-		}
-	else if (*format == MBF_HSUNKNWN)
-		{
-		status = mbr_register_hsunknwn(verbose, mbio_ptr, error);
-		}
-	else if (*format == MBF_SB2000SB)
-		{
-		status = mbr_register_sb2000sb(verbose, mbio_ptr, error);
-		}
-	else if (*format == MBF_SB2000SS)
-		{
-		status = mbr_register_sb2000ss(verbose, mbio_ptr, error);
-		}
-	else if (*format == MBF_SB2100RW)
-		{
-		status = mbr_register_sb2100rw(verbose, mbio_ptr, error);
-		}
-	else if (*format == MBF_SB2100B1)
-		{
-		status = mbr_register_sb2100b1(verbose, mbio_ptr, error);
-		}
-	else if (*format == MBF_SB2100B2)
-		{
-		status = mbr_register_sb2100b2(verbose, mbio_ptr, error);
-		}
-	else if (*format == MBF_EMOLDRAW)
-		{
-		status = mbr_register_emoldraw(verbose, mbio_ptr, error);
-		}
-	else if (*format == MBF_EM12IFRM)
-		{
-		status = mbr_register_em12ifrm(verbose, mbio_ptr, error);
-		}
-	else if (*format == MBF_EM12DARW)
-		{
-		status = mbr_register_em12darw(verbose, mbio_ptr, error);
-		}
-	else if (*format == MBF_EM300RAW)
-		{
-		status = mbr_register_em300raw(verbose, mbio_ptr, error);
-		}
-	else if (*format == MBF_EM300MBA)
-		{
-		status = mbr_register_em300mba(verbose, mbio_ptr, error);
-		}
-	else if (*format == MBF_EM710RAW)
-		{
-		status = mbr_register_em710raw(verbose, mbio_ptr, error);
-		}
-	else if (*format == MBF_EM710MBA)
-		{
-		status = mbr_register_em710mba(verbose, mbio_ptr, error);
-		}
-	else if (*format == MBF_MR1PRHIG)
-		{
-		status = mbr_register_mr1prhig(verbose, mbio_ptr, error);
-		}
-	else if (*format == MBF_MR1ALDEO)
-		{
-		status = mbr_register_mr1aldeo(verbose, mbio_ptr, error);
-		}
-	else if (*format == MBF_MR1BLDEO)
-		{
-		status = mbr_register_mr1bldeo(verbose, mbio_ptr, error);
-		}
-	else if (*format == MBF_MR1PRVR2)
-		{
-		status = mbr_register_mr1prvr2(verbose, mbio_ptr, error);
-		}
-	else if (*format == MBF_MBLDEOIH)
-		{
-		status = mbr_register_mbldeoih(verbose, mbio_ptr, error);
-		}
-	else if (*format == MBF_MBNETCDF)
-		{
-		status = mbr_register_mbnetcdf(verbose, mbio_ptr, error);
-		}
-	else if (*format == MBF_MBNCDFXT)
-		{
-		status = mbr_register_mbnetcdf(verbose, mbio_ptr, error);
-		}
-	else if (*format == MBF_CBAT9001)
-		{
-		status = mbr_register_cbat9001(verbose, mbio_ptr, error);
-		}
-	else if (*format == MBF_CBAT8101)
-		{
-		status = mbr_register_cbat8101(verbose, mbio_ptr, error);
-		}
-	else if (*format == MBF_HYPC8101)
-		{
-		status = mbr_register_hypc8101(verbose, mbio_ptr, error);
-		}
-	else if (*format == MBF_XTFR8101)
-		{
-		status = mbr_register_xtfr8101(verbose, mbio_ptr, error);
-		}
-	else if (*format == MBF_RESON7KR)
-		{
-		status = mbr_register_reson7kr(verbose, mbio_ptr, error);
-		}
-	else if (*format == MBF_BCHRTUNB)
-		{
-		status = mbr_register_bchrtunb(verbose, mbio_ptr, error);
-		}
-	else if (*format == MBF_ELMK2UNB)
-		{
-		status = mbr_register_elmk2unb(verbose, mbio_ptr, error);
-		}
-	else if (*format == MBF_BCHRXUNB)
-		{
-		status = mbr_register_bchrxunb(verbose, mbio_ptr, error);
-		}
-	else if (*format == MBF_HSMDARAW)
-		{
-		status = mbr_register_hsmdaraw(verbose, mbio_ptr, error);
-		}
-	else if (*format == MBF_HSMDLDIH)
-		{
-		status = mbr_register_hsmdldih(verbose, mbio_ptr, error);
-		}
-	else if (*format == MBF_DSL120PF)
-		{
-		status = mbr_register_dsl120pf(verbose, mbio_ptr, error);
-		}
-	else if (*format == MBF_DSL120SF)
-		{
-		status = mbr_register_dsl120sf(verbose, mbio_ptr, error);
-		}
-	else if (*format == MBF_GSFGENMB)
-		{
-		status = mbr_register_gsfgenmb(verbose, mbio_ptr, error);
-		}
-	else if (*format == MBF_MSTIFFSS)
-		{
-		status = mbr_register_mstiffss(verbose, mbio_ptr, error);
-		}
-	else if (*format == MBF_EDGJSTAR)
-		{
-		status = mbr_register_edgjstar(verbose, mbio_ptr, error);
-		}
-	else if (*format == MBF_EDGJSTR2)
-		{
-		status = mbr_register_edgjstr2(verbose, mbio_ptr, error);
-		}
-	else if (*format == MBF_OICGEODA)
-		{
-		status = mbr_register_oicgeoda(verbose, mbio_ptr, error);
-		}
-	else if (*format == MBF_OICMBARI)
-		{
-		status = mbr_register_oicmbari(verbose, mbio_ptr, error);
-		}
-	else if (*format == MBF_OMGHDCSJ)
-		{
-		status = mbr_register_omghdcsj(verbose, mbio_ptr, error);
-		}
-	else if (*format == MBF_SEGYSEGY)
-		{
-		status = mbr_register_segysegy(verbose, mbio_ptr, error);
-		}
-	else if (*format == MBF_MGD77DAT)
-		{
-		status = mbr_register_mgd77dat(verbose, mbio_ptr, error);
-		}
-	else if (*format == MBF_ASCIIXYZ)
-		{
-		status = mbr_register_asciixyz(verbose, mbio_ptr, error);
-		}
-	else if (*format == MBF_ASCIIYXZ)
-		{
-		status = mbr_register_asciiyxz(verbose, mbio_ptr, error);
-		}
-	else if (*format == MBF_HYDROB93)
-		{
-		status = mbr_register_hydrob93(verbose, mbio_ptr, error);
-		}
-	else if (*format == MBF_HYDROB93)
-		{
-		status = mbr_register_hydrob93(verbose, mbio_ptr, error);
-		}
-	else if (*format == MBF_MBARIROV)
-		{
-		status = mbr_register_mbarirov(verbose, mbio_ptr, error);
-		}
-	else if (*format == MBF_MBARROV2)
-		{
-		status = mbr_register_mbarrov2(verbose, mbio_ptr, error);
-		}
-	else if (*format == MBF_MBPRONAV)
-		{
-		status = mbr_register_mbpronav(verbose, mbio_ptr, error);
-		}
-	else if (*format == MBF_NVNETCDF)
-		{
-		status = mbr_register_nvnetcdf(verbose, mbio_ptr, error);
-		}
-	else if (*format == MBF_ASCIIXYT)
-		{
-		status = mbr_register_asciixyt(verbose, mbio_ptr, error);
-		}
-	else if (*format == MBF_ASCIIYXT)
-		{
-		status = mbr_register_asciiyxt(verbose, mbio_ptr, error);
-		}
-	else if (*format == MBF_L3XSERAW)
-		{
-		status = mbr_register_l3xseraw(verbose, mbio_ptr, error);
-		}
-	else if (*format == MBF_HS10JAMS)
-		{
-		status = mbr_register_hs10jams(verbose, mbio_ptr, error);
-		}
-	else if (*format == MBF_HSDS2RAW)
-		{
-		status = mbr_register_hsds2raw(verbose, mbio_ptr, error);
-		}
-	else if (*format == MBF_HSDS2LAM)
-		{
-		status = mbr_register_hsds2lam(verbose, mbio_ptr, error);
-		}
-	else if (*format == MBF_SAMESURF)
-		{
-		status = mbr_register_samesurf(verbose, mbio_ptr, error);
-		}
-	else if (*format == MBF_IMAGE83P)
-		{
-		status = mbr_register_image83p(verbose, mbio_ptr, error);
-		}
-	else if (*format == MBF_IMAGEMBA)
-		{
-		status = mbr_register_imagemba(verbose, mbio_ptr, error);
-		}
-	else if (*format == MBF_HIR2RNAV)
-		{
-		status = mbr_register_hir2rnav(verbose, mbio_ptr, error);
-		}
-	else if (*format == MBF_HYSWEEP1)
-		{
-		status = mbr_register_hysweep1(verbose, mbio_ptr, error);
-		}
-	else if (*format == MBF_XTFB1624)
-		{
-		status = mbr_register_xtfb1624(verbose, mbio_ptr, error);
-		}
-	else if (*format == MBF_SWPLSSXI)
-		{
-		status = mbr_register_swplssxi(verbose, mbio_ptr, error);
-		}
-	else if (*format == MBF_SWPLSSXP)
-		{
-		status = mbr_register_swplssxp(verbose, mbio_ptr, error);
-		}
- 	else if (*format == MBF_3DDEPTHP)
-		{
-		status = mbr_register_3ddepthp(verbose, mbio_ptr, error);
-		}
- 	else if (*format == MBF_WASSPENL)
-		{
-		status = mbr_register_wasspenl(verbose, mbio_ptr, error);
-		}
- 	else if (*format == MBF_MGD77TXT)
-		{
-		status = mbr_register_mgd77txt(verbose, mbio_ptr, error);
-		}
- 	else if (*format == MBF_MGD77TAB)
-		{
-		status = mbr_register_mgd77tab(verbose, mbio_ptr, error);
-		}
- 	else if (*format == MBF_PHOTGRAM)
-		{
-		status = mbr_register_photgram(verbose, mbio_ptr, error);
-		}
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_BAD_FORMAT;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       format:             %d\n",*format);
-		fprintf(stderr,"dbg2       system:             %d\n",mb_io_ptr->system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",mb_io_ptr->beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",mb_io_ptr->beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",mb_io_ptr->pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",mb_io_ptr->format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",mb_io_ptr->system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",mb_io_ptr->format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",mb_io_ptr->numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",mb_io_ptr->filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",mb_io_ptr->variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",mb_io_ptr->traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",mb_io_ptr->beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",mb_io_ptr->nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",mb_io_ptr->heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",mb_io_ptr->vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",mb_io_ptr->svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",mb_io_ptr->beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",mb_io_ptr->beamwidth_ltrack);
-		fprintf(stderr,"dbg2       format_alloc:       %p\n",(void *)mb_io_ptr->mb_io_format_alloc);
-		fprintf(stderr,"dbg2       format_free:        %p\n",(void *)mb_io_ptr->mb_io_format_free);
-		fprintf(stderr,"dbg2       store_alloc:        %p\n",(void *)mb_io_ptr->mb_io_store_alloc);
-		fprintf(stderr,"dbg2       store_free:         %p\n",(void *)mb_io_ptr->mb_io_store_free);
-		fprintf(stderr,"dbg2       read_ping:          %p\n",(void *)mb_io_ptr->mb_io_read_ping);
-		fprintf(stderr,"dbg2       write_ping:         %p\n",(void *)mb_io_ptr->mb_io_write_ping);
-		fprintf(stderr,"dbg2       extract:            %p\n",(void *)mb_io_ptr->mb_io_extract);
-		fprintf(stderr,"dbg2       insert:             %p\n",(void *)mb_io_ptr->mb_io_insert);
-		fprintf(stderr,"dbg2       extract_nav:        %p\n",(void *)mb_io_ptr->mb_io_extract_nav);
-		fprintf(stderr,"dbg2       insert_nav:         %p\n",(void *)mb_io_ptr->mb_io_insert_nav);
-		fprintf(stderr,"dbg2       extract_altitude:   %p\n",(void *)mb_io_ptr->mb_io_extract_altitude);
-		fprintf(stderr,"dbg2       insert_altitude:    %p\n",(void *)mb_io_ptr->mb_io_insert_altitude);
-		fprintf(stderr,"dbg2       extract_svp:        %p\n",(void *)mb_io_ptr->mb_io_extract_svp);
-		fprintf(stderr,"dbg2       insert_svp:         %p\n",(void *)mb_io_ptr->mb_io_insert_svp);
-		fprintf(stderr,"dbg2       ttimes:             %p\n",(void *)mb_io_ptr->mb_io_ttimes);
-		fprintf(stderr,"dbg2       detects:            %p\n",(void *)mb_io_ptr->mb_io_detects);
-		fprintf(stderr,"dbg2       copyrecord:         %p\n",(void *)mb_io_ptr->mb_io_copyrecord);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:             %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_format_info(int verbose,
-			int *format,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error)
-{
-	char	*function_name = "mb_format_info";
-	int	status;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       rcs_id:    %s\n",rcs_id);
-		fprintf(stderr,"dbg2       verbose:   %d\n",verbose);
-		fprintf(stderr,"dbg2       format:    %d\n",*format);
-		}
-
-	/* check for old format id and provide alias if needed */
-	if (*format > 0
-	    && (*format < 10 || *format == 44
-		|| *format == 52 || *format == 55))
-	    {
-	    /* replace original mbio id's */
-	    if (*format < 10)
-		i = format_alias_table[*format];
-
-	    /* handle incorrectly identified SeaBeam 2120 data */
-	    else if (*format == 44)
-		i = MBF_L3XSERAW;
-
-	    /* handle old Simrad EM12 and EM121 formats */
-	    else if (*format == 52 || *format == 55)
-		i = MBF_EMOLDRAW;
-		
-	    else
-	        i = 0;
-
-	    /* print output debug statements */
-	    if (verbose >= 2)
-		    {
-		    fprintf(stderr,"\ndbg2  Old format id aliased to current value in MBIO function <%s>\n",
-			    function_name);
-		    fprintf(stderr,"dbg2  Old format value:\n");
-		    fprintf(stderr,"dbg2       format:     %d\n",*format);
-		    fprintf(stderr,"dbg2  Current format value:\n");
-		    fprintf(stderr,"dbg2       format:     %d\n",i);
-		    }
-
-	    /* set new format value */
-	    *format = i;
-	    }
-
-	/* look for a corresponding format */
-	if (*format == MBF_SBSIOMRG)
-		{
-		status = mbr_info_sbsiomrg(verbose, system,
-			beams_bath_max, beams_amp_max, pixels_ss_max,
-			format_name, system_name, format_description,
-			numfile, filetype,
-			variable_beams, traveltime, beam_flagging,
-			nav_source, heading_source, vru_source, svp_source,
-			beamwidth_xtrack, beamwidth_ltrack,
-			error);
-		}
-	else if (*format == MBF_SBSIOCEN)
-		{
-		status = mbr_info_sbsiocen(verbose, system,
-			beams_bath_max, beams_amp_max, pixels_ss_max,
-			format_name, system_name, format_description,
-			numfile, filetype,
-			variable_beams, traveltime, beam_flagging,
-			nav_source, heading_source, vru_source, svp_source,
-			beamwidth_xtrack, beamwidth_ltrack,
-			error);
-		}
-	else if (*format == MBF_SBSIOLSI)
-		{
-		status = mbr_info_sbsiolsi(verbose, system,
-			beams_bath_max, beams_amp_max, pixels_ss_max,
-			format_name, system_name, format_description,
-			numfile, filetype,
-			variable_beams, traveltime, beam_flagging,
-			nav_source, heading_source, vru_source, svp_source,
-			beamwidth_xtrack, beamwidth_ltrack,
-			error);
-		}
-	else if (*format == MBF_SBURICEN)
-		{
-		status = mbr_info_sburicen(verbose, system,
-			beams_bath_max, beams_amp_max, pixels_ss_max,
-			format_name, system_name, format_description,
-			numfile, filetype,
-			variable_beams, traveltime, beam_flagging,
-			nav_source, heading_source, vru_source, svp_source,
-			beamwidth_xtrack, beamwidth_ltrack,
-			error);
-		}
-	else if (*format == MBF_SBURIVAX)
-		{
-		status = mbr_info_sburivax(verbose, system,
-			beams_bath_max, beams_amp_max, pixels_ss_max,
-			format_name, system_name, format_description,
-			numfile, filetype,
-			variable_beams, traveltime, beam_flagging,
-			nav_source, heading_source, vru_source, svp_source,
-			beamwidth_xtrack, beamwidth_ltrack,
-			error);
-		}
-	else if (*format == MBF_SBSIOSWB)
-		{
-		status = mbr_info_sbsioswb(verbose, system,
-			beams_bath_max, beams_amp_max, pixels_ss_max,
-			format_name, system_name, format_description,
-			numfile, filetype,
-			variable_beams, traveltime, beam_flagging,
-			nav_source, heading_source, vru_source, svp_source,
-			beamwidth_xtrack, beamwidth_ltrack,
-			error);
-		}
-	else if (*format == MBF_SBIFREMR)
-		{
-		status = mbr_info_sbifremr(verbose, system,
-			beams_bath_max, beams_amp_max, pixels_ss_max,
-			format_name, system_name, format_description,
-			numfile, filetype,
-			variable_beams, traveltime, beam_flagging,
-			nav_source, heading_source, vru_source, svp_source,
-			beamwidth_xtrack, beamwidth_ltrack,
-			error);
-		}
-	else if (*format == MBF_HSLDEDMB)
-		{
-		status = mbr_info_hsldedmb(verbose, system,
-			beams_bath_max, beams_amp_max, pixels_ss_max,
-			format_name, system_name, format_description,
-			numfile, filetype,
-			variable_beams, traveltime, beam_flagging,
-			nav_source, heading_source, vru_source, svp_source,
-			beamwidth_xtrack, beamwidth_ltrack,
-			error);
-		}
-	else if (*format == MBF_HSURICEN)
-		{
-		status = mbr_info_hsuricen(verbose, system,
-			beams_bath_max, beams_amp_max, pixels_ss_max,
-			format_name, system_name, format_description,
-			numfile, filetype,
-			variable_beams, traveltime, beam_flagging,
-			nav_source, heading_source, vru_source, svp_source,
-			beamwidth_xtrack, beamwidth_ltrack,
-			error);
-		}
-	else if (*format == MBF_HSATLRAW)
-		{
-		status = mbr_info_hsatlraw(verbose, system,
-			beams_bath_max, beams_amp_max, pixels_ss_max,
-			format_name, system_name, format_description,
-			numfile, filetype,
-			variable_beams, traveltime, beam_flagging,
-			nav_source, heading_source, vru_source, svp_source,
-			beamwidth_xtrack, beamwidth_ltrack,
-			error);
-		}
-	else if (*format == MBF_HSLDEOIH)
-		{
-		status = mbr_info_hsldeoih(verbose, system,
-			beams_bath_max, beams_amp_max, pixels_ss_max,
-			format_name, system_name, format_description,
-			numfile, filetype,
-			variable_beams, traveltime, beam_flagging,
-			nav_source, heading_source, vru_source, svp_source,
-			beamwidth_xtrack, beamwidth_ltrack,
-			error);
-		}
-	else if (*format == MBF_HSURIVAX)
-		{
-		status = mbr_info_hsurivax(verbose, system,
-			beams_bath_max, beams_amp_max, pixels_ss_max,
-			format_name, system_name, format_description,
-			numfile, filetype,
-			variable_beams, traveltime, beam_flagging,
-			nav_source, heading_source, vru_source, svp_source,
-			beamwidth_xtrack, beamwidth_ltrack,
-			error);
-		}
-	else if (*format == MBF_HSUNKNWN)
-		{
-		status = mbr_info_hsunknwn(verbose, system,
-			beams_bath_max, beams_amp_max, pixels_ss_max,
-			format_name, system_name, format_description,
-			numfile, filetype,
-			variable_beams, traveltime, beam_flagging,
-			nav_source, heading_source, vru_source, svp_source,
-			beamwidth_xtrack, beamwidth_ltrack,
-			error);
-		}
-	else if (*format == MBF_SB2000SB)
-		{
-		status = mbr_info_sb2000sb(verbose, system,
-			beams_bath_max, beams_amp_max, pixels_ss_max,
-			format_name, system_name, format_description,
-			numfile, filetype,
-			variable_beams, traveltime, beam_flagging,
-			nav_source, heading_source, vru_source, svp_source,
-			beamwidth_xtrack, beamwidth_ltrack,
-			error);
-		}
-	else if (*format == MBF_SB2000SS)
-		{
-		status = mbr_info_sb2000ss(verbose, system,
-			beams_bath_max, beams_amp_max, pixels_ss_max,
-			format_name, system_name, format_description,
-			numfile, filetype,
-			variable_beams, traveltime, beam_flagging,
-			nav_source, heading_source, vru_source, svp_source,
-			beamwidth_xtrack, beamwidth_ltrack,
-			error);
-		}
-	else if (*format == MBF_SB2100RW)
-		{
-		status = mbr_info_sb2100rw(verbose, system,
-			beams_bath_max, beams_amp_max, pixels_ss_max,
-			format_name, system_name, format_description,
-			numfile, filetype,
-			variable_beams, traveltime, beam_flagging,
-			nav_source, heading_source, vru_source, svp_source,
-			beamwidth_xtrack, beamwidth_ltrack,
-			error);
-		}
-	else if (*format == MBF_SB2100B1)
-		{
-		status = mbr_info_sb2100b1(verbose, system,
-			beams_bath_max, beams_amp_max, pixels_ss_max,
-			format_name, system_name, format_description,
-			numfile, filetype,
-			variable_beams, traveltime, beam_flagging,
-			nav_source, heading_source, vru_source, svp_source,
-			beamwidth_xtrack, beamwidth_ltrack,
-			error);
-		}
-	else if (*format == MBF_SB2100B2)
-		{
-		status = mbr_info_sb2100b2(verbose, system,
-			beams_bath_max, beams_amp_max, pixels_ss_max,
-			format_name, system_name, format_description,
-			numfile, filetype,
-			variable_beams, traveltime, beam_flagging,
-			nav_source, heading_source, vru_source, svp_source,
-			beamwidth_xtrack, beamwidth_ltrack,
-			error);
-		}
-	else if (*format == MBF_EMOLDRAW)
-		{
-		status = mbr_info_emoldraw(verbose, system,
-			beams_bath_max, beams_amp_max, pixels_ss_max,
-			format_name, system_name, format_description,
-			numfile, filetype,
-			variable_beams, traveltime, beam_flagging,
-			nav_source, heading_source, vru_source, svp_source,
-			beamwidth_xtrack, beamwidth_ltrack,
-			error);
-		}
-	else if (*format == MBF_EM12IFRM)
-		{
-		status = mbr_info_em12ifrm(verbose, system,
-			beams_bath_max, beams_amp_max, pixels_ss_max,
-			format_name, system_name, format_description,
-			numfile, filetype,
-			variable_beams, traveltime, beam_flagging,
-			nav_source, heading_source, vru_source, svp_source,
-			beamwidth_xtrack, beamwidth_ltrack,
-			error);
-		}
-	else if (*format == MBF_EM12DARW)
-		{
-		status = mbr_info_em12darw(verbose, system,
-			beams_bath_max, beams_amp_max, pixels_ss_max,
-			format_name, system_name, format_description,
-			numfile, filetype,
-			variable_beams, traveltime, beam_flagging,
-			nav_source, heading_source, vru_source, svp_source,
-			beamwidth_xtrack, beamwidth_ltrack,
-			error);
-		}
-	else if (*format == MBF_EM300RAW)
-		{
-		status = mbr_info_em300raw(verbose, system,
-			beams_bath_max, beams_amp_max, pixels_ss_max,
-			format_name, system_name, format_description,
-			numfile, filetype,
-			variable_beams, traveltime, beam_flagging,
-			nav_source, heading_source, vru_source, svp_source,
-			beamwidth_xtrack, beamwidth_ltrack,
-			error);
-		}
-	else if (*format == MBF_EM300MBA)
-		{
-		status = mbr_info_em300mba(verbose, system,
-			beams_bath_max, beams_amp_max, pixels_ss_max,
-			format_name, system_name, format_description,
-			numfile, filetype,
-			variable_beams, traveltime, beam_flagging,
-			nav_source, heading_source, vru_source, svp_source,
-			beamwidth_xtrack, beamwidth_ltrack,
-			error);
-		}
-	else if (*format == MBF_EM710RAW)
-		{
-		status = mbr_info_em710raw(verbose, system,
-			beams_bath_max, beams_amp_max, pixels_ss_max,
-			format_name, system_name, format_description,
-			numfile, filetype,
-			variable_beams, traveltime, beam_flagging,
-			nav_source, heading_source, vru_source, svp_source,
-			beamwidth_xtrack, beamwidth_ltrack,
-			error);
-		}
-	else if (*format == MBF_EM710MBA)
-		{
-		status = mbr_info_em710mba(verbose, system,
-			beams_bath_max, beams_amp_max, pixels_ss_max,
-			format_name, system_name, format_description,
-			numfile, filetype,
-			variable_beams, traveltime, beam_flagging,
-			nav_source, heading_source, vru_source, svp_source,
-			beamwidth_xtrack, beamwidth_ltrack,
-			error);
-		}
-	else if (*format == MBF_MR1PRHIG)
-		{
-		status = mbr_info_mr1prhig(verbose, system,
-			beams_bath_max, beams_amp_max, pixels_ss_max,
-			format_name, system_name, format_description,
-			numfile, filetype,
-			variable_beams, traveltime, beam_flagging,
-			nav_source, heading_source, vru_source, svp_source,
-			beamwidth_xtrack, beamwidth_ltrack,
-			error);
-		}
-	else if (*format == MBF_MR1ALDEO)
-		{
-		status = mbr_info_mr1aldeo(verbose, system,
-			beams_bath_max, beams_amp_max, pixels_ss_max,
-			format_name, system_name, format_description,
-			numfile, filetype,
-			variable_beams, traveltime, beam_flagging,
-			nav_source, heading_source, vru_source, svp_source,
-			beamwidth_xtrack, beamwidth_ltrack,
-			error);
-		}
-	else if (*format == MBF_MR1BLDEO)
-		{
-		status = mbr_info_mr1bldeo(verbose, system,
-			beams_bath_max, beams_amp_max, pixels_ss_max,
-			format_name, system_name, format_description,
-			numfile, filetype,
-			variable_beams, traveltime, beam_flagging,
-			nav_source, heading_source, vru_source, svp_source,
-			beamwidth_xtrack, beamwidth_ltrack,
-			error);
-		}
-	else if (*format == MBF_MR1PRVR2)
-		{
-		status = mbr_info_mr1prvr2(verbose, system,
-			beams_bath_max, beams_amp_max, pixels_ss_max,
-			format_name, system_name, format_description,
-			numfile, filetype,
-			variable_beams, traveltime, beam_flagging,
-			nav_source, heading_source, vru_source, svp_source,
-			beamwidth_xtrack, beamwidth_ltrack,
-			error);
-		}
-	else if (*format == MBF_MBLDEOIH)
-		{
-		status = mbr_info_mbldeoih(verbose, system,
-			beams_bath_max, beams_amp_max, pixels_ss_max,
-			format_name, system_name, format_description,
-			numfile, filetype,
-			variable_beams, traveltime, beam_flagging,
-			nav_source, heading_source, vru_source, svp_source,
-			beamwidth_xtrack, beamwidth_ltrack,
-			error);
-		}
-	else if (*format == MBF_MBNETCDF)
-		{
-		status = mbr_info_mbnetcdf(verbose, system,
-			beams_bath_max, beams_amp_max, pixels_ss_max,
-			format_name, system_name, format_description,
-			numfile, filetype,
-			variable_beams, traveltime, beam_flagging,
-			nav_source, heading_source, vru_source, svp_source,
-			beamwidth_xtrack, beamwidth_ltrack,
-			error);
-		}
-	else if (*format == MBF_MBNCDFXT)
-		{
-		status = mbr_info_mbncdfxt(verbose, system,
-			beams_bath_max, beams_amp_max, pixels_ss_max,
-			format_name, system_name, format_description,
-			numfile, filetype,
-			variable_beams, traveltime, beam_flagging,
-			nav_source, heading_source, vru_source, svp_source,
-			beamwidth_xtrack, beamwidth_ltrack,
-			error);
-		}
-	else if (*format == MBF_CBAT9001)
-		{
-		status = mbr_info_cbat9001(verbose, system,
-			beams_bath_max, beams_amp_max, pixels_ss_max,
-			format_name, system_name, format_description,
-			numfile, filetype,
-			variable_beams, traveltime, beam_flagging,
-			nav_source, heading_source, vru_source, svp_source,
-			beamwidth_xtrack, beamwidth_ltrack,
-			error);
-		}
-	else if (*format == MBF_CBAT8101)
-		{
-		status = mbr_info_cbat8101(verbose, system,
-			beams_bath_max, beams_amp_max, pixels_ss_max,
-			format_name, system_name, format_description,
-			numfile, filetype,
-			variable_beams, traveltime, beam_flagging,
-			nav_source, heading_source, vru_source, svp_source,
-			beamwidth_xtrack, beamwidth_ltrack,
-			error);
-		}
-	else if (*format == MBF_HYPC8101)
-		{
-		status = mbr_info_hypc8101(verbose, system,
-			beams_bath_max, beams_amp_max, pixels_ss_max,
-			format_name, system_name, format_description,
-			numfile, filetype,
-			variable_beams, traveltime, beam_flagging,
-			nav_source, heading_source, vru_source, svp_source,
-			beamwidth_xtrack, beamwidth_ltrack,
-			error);
-		}
-	else if (*format == MBF_XTFR8101)
-		{
-		status = mbr_info_xtfr8101(verbose, system,
-			beams_bath_max, beams_amp_max, pixels_ss_max,
-			format_name, system_name, format_description,
-			numfile, filetype,
-			variable_beams, traveltime, beam_flagging,
-			nav_source, heading_source, vru_source, svp_source,
-			beamwidth_xtrack, beamwidth_ltrack,
-			error);
-		}
-	else if (*format == MBF_RESON7KR)
-		{
-		status = mbr_info_reson7kr(verbose, system,
-			beams_bath_max, beams_amp_max, pixels_ss_max,
-			format_name, system_name, format_description,
-			numfile, filetype,
-			variable_beams, traveltime, beam_flagging,
-			nav_source, heading_source, vru_source, svp_source,
-			beamwidth_xtrack, beamwidth_ltrack,
-			error);
-		}
-	else if (*format == MBF_BCHRTUNB)
-		{
-		status = mbr_info_bchrtunb(verbose, system,
-			beams_bath_max, beams_amp_max, pixels_ss_max,
-			format_name, system_name, format_description,
-			numfile, filetype,
-			variable_beams, traveltime, beam_flagging,
-			nav_source, heading_source, vru_source, svp_source,
-			beamwidth_xtrack, beamwidth_ltrack,
-			error);
-		}
-	else if (*format == MBF_ELMK2UNB)
-		{
-		status = mbr_info_elmk2unb(verbose, system,
-			beams_bath_max, beams_amp_max, pixels_ss_max,
-			format_name, system_name, format_description,
-			numfile, filetype,
-			variable_beams, traveltime, beam_flagging,
-			nav_source, heading_source, vru_source, svp_source,
-			beamwidth_xtrack, beamwidth_ltrack,
-			error);
-		}
-	else if (*format == MBF_BCHRXUNB)
-		{
-		status = mbr_info_bchrxunb(verbose, system,
-			beams_bath_max, beams_amp_max, pixels_ss_max,
-			format_name, system_name, format_description,
-			numfile, filetype,
-			variable_beams, traveltime, beam_flagging,
-			nav_source, heading_source, vru_source, svp_source,
-			beamwidth_xtrack, beamwidth_ltrack,
-			error);
-		}
-	else if (*format == MBF_HSMDARAW)
-		{
-		status = mbr_info_hsmdaraw(verbose, system,
-			beams_bath_max, beams_amp_max, pixels_ss_max,
-			format_name, system_name, format_description,
-			numfile, filetype,
-			variable_beams, traveltime, beam_flagging,
-			nav_source, heading_source, vru_source, svp_source,
-			beamwidth_xtrack, beamwidth_ltrack,
-			error);
-		}
-	else if (*format == MBF_HSMDLDIH)
-		{
-		status = mbr_info_hsmdldih(verbose, system,
-			beams_bath_max, beams_amp_max, pixels_ss_max,
-			format_name, system_name, format_description,
-			numfile, filetype,
-			variable_beams, traveltime, beam_flagging,
-			nav_source, heading_source, vru_source, svp_source,
-			beamwidth_xtrack, beamwidth_ltrack,
-			error);
-		}
-	else if (*format == MBF_DSL120PF)
-		{
-		status = mbr_info_dsl120pf(verbose, system,
-			beams_bath_max, beams_amp_max, pixels_ss_max,
-			format_name, system_name, format_description,
-			numfile, filetype,
-			variable_beams, traveltime, beam_flagging,
-			nav_source, heading_source, vru_source, svp_source,
-			beamwidth_xtrack, beamwidth_ltrack,
-			error);
-		}
-	else if (*format == MBF_DSL120SF)
-		{
-		status = mbr_info_dsl120sf(verbose, system,
-			beams_bath_max, beams_amp_max, pixels_ss_max,
-			format_name, system_name, format_description,
-			numfile, filetype,
-			variable_beams, traveltime, beam_flagging,
-			nav_source, heading_source, vru_source, svp_source,
-			beamwidth_xtrack, beamwidth_ltrack,
-			error);
-		}
-	else if (*format == MBF_GSFGENMB)
-		{
-		status = mbr_info_gsfgenmb(verbose, system,
-			beams_bath_max, beams_amp_max, pixels_ss_max,
-			format_name, system_name, format_description,
-			numfile, filetype,
-			variable_beams, traveltime, beam_flagging,
-			nav_source, heading_source, vru_source, svp_source,
-			beamwidth_xtrack, beamwidth_ltrack,
-			error);
-		}
-	else if (*format == MBF_MSTIFFSS)
-		{
-		status = mbr_info_mstiffss(verbose, system,
-			beams_bath_max, beams_amp_max, pixels_ss_max,
-			format_name, system_name, format_description,
-			numfile, filetype,
-			variable_beams, traveltime, beam_flagging,
-			nav_source, heading_source, vru_source, svp_source,
-			beamwidth_xtrack, beamwidth_ltrack,
-			error);
-		}
-	else if (*format == MBF_EDGJSTAR)
-		{
-		status = mbr_info_edgjstar(verbose, system,
-			beams_bath_max, beams_amp_max, pixels_ss_max,
-			format_name, system_name, format_description,
-			numfile, filetype,
-			variable_beams, traveltime, beam_flagging,
-			nav_source, heading_source, vru_source, svp_source,
-			beamwidth_xtrack, beamwidth_ltrack,
-			error);
-		}
-	else if (*format == MBF_EDGJSTR2)
-		{
-		status = mbr_info_edgjstr2(verbose, system,
-			beams_bath_max, beams_amp_max, pixels_ss_max,
-			format_name, system_name, format_description,
-			numfile, filetype,
-			variable_beams, traveltime, beam_flagging,
-			nav_source, heading_source, vru_source, svp_source,
-			beamwidth_xtrack, beamwidth_ltrack,
-			error);
-		}
-	else if (*format == MBF_OICGEODA)
-		{
-		status = mbr_info_oicgeoda(verbose, system,
-			beams_bath_max, beams_amp_max, pixels_ss_max,
-			format_name, system_name, format_description,
-			numfile, filetype,
-			variable_beams, traveltime, beam_flagging,
-			nav_source, heading_source, vru_source, svp_source,
-			beamwidth_xtrack, beamwidth_ltrack,
-			error);
-		}
-	else if (*format == MBF_OICMBARI)
-		{
-		status = mbr_info_oicmbari(verbose, system,
-			beams_bath_max, beams_amp_max, pixels_ss_max,
-			format_name, system_name, format_description,
-			numfile, filetype,
-			variable_beams, traveltime, beam_flagging,
-			nav_source, heading_source, vru_source, svp_source,
-			beamwidth_xtrack, beamwidth_ltrack,
-			error);
-		}
-	else if (*format == MBF_OMGHDCSJ)
-		{
-		status = mbr_info_omghdcsj(verbose, system,
-			beams_bath_max, beams_amp_max, pixels_ss_max,
-			format_name, system_name, format_description,
-			numfile, filetype,
-			variable_beams, traveltime, beam_flagging,
-			nav_source, heading_source, vru_source, svp_source,
-			beamwidth_xtrack, beamwidth_ltrack,
-			error);
-		}
-	else if (*format == MBF_SEGYSEGY)
-		{
-		status = mbr_info_segysegy(verbose, system,
-			beams_bath_max, beams_amp_max, pixels_ss_max,
-			format_name, system_name, format_description,
-			numfile, filetype,
-			variable_beams, traveltime, beam_flagging,
-			nav_source, heading_source, vru_source, svp_source,
-			beamwidth_xtrack, beamwidth_ltrack,
-			error);
-		}
-	else if (*format == MBF_MGD77DAT)
-		{
-		status = mbr_info_mgd77dat(verbose, system,
-			beams_bath_max, beams_amp_max, pixels_ss_max,
-			format_name, system_name, format_description,
-			numfile, filetype,
-			variable_beams, traveltime, beam_flagging,
-			nav_source, heading_source, vru_source, svp_source,
-			beamwidth_xtrack, beamwidth_ltrack,
-			error);
-		}
-	else if (*format == MBF_ASCIIXYZ)
-		{
-		status = mbr_info_asciixyz(verbose, system,
-			beams_bath_max, beams_amp_max, pixels_ss_max,
-			format_name, system_name, format_description,
-			numfile, filetype,
-			variable_beams, traveltime, beam_flagging,
-			nav_source, heading_source, vru_source, svp_source,
-			beamwidth_xtrack, beamwidth_ltrack,
-			error);
-		}
-	else if (*format == MBF_ASCIIYXZ)
-		{
-		status = mbr_info_asciiyxz(verbose, system,
-			beams_bath_max, beams_amp_max, pixels_ss_max,
-			format_name, system_name, format_description,
-			numfile, filetype,
-			variable_beams, traveltime, beam_flagging,
-			nav_source, heading_source, vru_source, svp_source,
-			beamwidth_xtrack, beamwidth_ltrack,
-			error);
-		}
-	else if (*format == MBF_HYDROB93)
-		{
-		status = mbr_info_hydrob93(verbose, system,
-			beams_bath_max, beams_amp_max, pixels_ss_max,
-			format_name, system_name, format_description,
-			numfile, filetype,
-			variable_beams, traveltime, beam_flagging,
-			nav_source, heading_source, vru_source, svp_source,
-			beamwidth_xtrack, beamwidth_ltrack,
-			error);
-		}
-	else if (*format == MBF_MBARIROV)
-		{
-		status = mbr_info_mbarirov(verbose, system,
-			beams_bath_max, beams_amp_max, pixels_ss_max,
-			format_name, system_name, format_description,
-			numfile, filetype,
-			variable_beams, traveltime, beam_flagging,
-			nav_source, heading_source, vru_source, svp_source,
-			beamwidth_xtrack, beamwidth_ltrack,
-			error);
-		}
-	else if (*format == MBF_MBARROV2)
-		{
-		status = mbr_info_mbarrov2(verbose, system,
-			beams_bath_max, beams_amp_max, pixels_ss_max,
-			format_name, system_name, format_description,
-			numfile, filetype,
-			variable_beams, traveltime, beam_flagging,
-			nav_source, heading_source, vru_source, svp_source,
-			beamwidth_xtrack, beamwidth_ltrack,
-			error);
-		}
-	else if (*format == MBF_MBPRONAV)
-		{
-		status = mbr_info_mbpronav(verbose, system,
-			beams_bath_max, beams_amp_max, pixels_ss_max,
-			format_name, system_name, format_description,
-			numfile, filetype,
-			variable_beams, traveltime, beam_flagging,
-			nav_source, heading_source, vru_source, svp_source,
-			beamwidth_xtrack, beamwidth_ltrack,
-			error);
-		}
-	else if (*format == MBF_NVNETCDF)
-		{
-		status = mbr_info_nvnetcdf(verbose, system,
-			beams_bath_max, beams_amp_max, pixels_ss_max,
-			format_name, system_name, format_description,
-			numfile, filetype,
-			variable_beams, traveltime, beam_flagging,
-			nav_source, heading_source, vru_source, svp_source,
-			beamwidth_xtrack, beamwidth_ltrack,
-			error);
-		}
-	else if (*format == MBF_ASCIIXYT)
-		{
-		status = mbr_info_asciixyt(verbose, system,
-			beams_bath_max, beams_amp_max, pixels_ss_max,
-			format_name, system_name, format_description,
-			numfile, filetype,
-			variable_beams, traveltime, beam_flagging,
-			nav_source, heading_source, vru_source, svp_source,
-			beamwidth_xtrack, beamwidth_ltrack,
-			error);
-		}
-	else if (*format == MBF_ASCIIYXT)
-		{
-		status = mbr_info_asciiyxt(verbose, system,
-			beams_bath_max, beams_amp_max, pixels_ss_max,
-			format_name, system_name, format_description,
-			numfile, filetype,
-			variable_beams, traveltime, beam_flagging,
-			nav_source, heading_source, vru_source, svp_source,
-			beamwidth_xtrack, beamwidth_ltrack,
-			error);
-		}
-	else if (*format == MBF_L3XSERAW)
-		{
-		status = mbr_info_l3xseraw(verbose, system,
-			beams_bath_max, beams_amp_max, pixels_ss_max,
-			format_name, system_name, format_description,
-			numfile, filetype,
-			variable_beams, traveltime, beam_flagging,
-			nav_source, heading_source, vru_source, svp_source,
-			beamwidth_xtrack, beamwidth_ltrack,
-			error);
-		}
-	else if (*format == MBF_HS10JAMS)
-		{
-		status = mbr_info_hs10jams(verbose, system,
-			beams_bath_max, beams_amp_max, pixels_ss_max,
-			format_name, system_name, format_description,
-			numfile, filetype,
-			variable_beams, traveltime, beam_flagging,
-			nav_source, heading_source, vru_source, svp_source,
-			beamwidth_xtrack, beamwidth_ltrack,
-			error);
-		}
-	else if (*format == MBF_HSDS2RAW)
-		{
-		status = mbr_info_hsds2raw(verbose, system,
-			beams_bath_max, beams_amp_max, pixels_ss_max,
-			format_name, system_name, format_description,
-			numfile, filetype,
-			variable_beams, traveltime, beam_flagging,
-			nav_source, heading_source, vru_source, svp_source,
-			beamwidth_xtrack, beamwidth_ltrack,
-			error);
-		}
-	else if (*format == MBF_HSDS2LAM)
-		{
-		status = mbr_info_hsds2lam(verbose, system,
-			beams_bath_max, beams_amp_max, pixels_ss_max,
-			format_name, system_name, format_description,
-			numfile, filetype,
-			variable_beams, traveltime, beam_flagging,
-			nav_source, heading_source, vru_source, svp_source,
-			beamwidth_xtrack, beamwidth_ltrack,
-			error);
-		}
-	else if (*format == MBF_SAMESURF)
-		{
-		status = mbr_info_samesurf(verbose, system,
-			beams_bath_max, beams_amp_max, pixels_ss_max,
-			format_name, system_name, format_description,
-			numfile, filetype,
-			variable_beams, traveltime, beam_flagging,
-			nav_source, heading_source, vru_source, svp_source,
-			beamwidth_xtrack, beamwidth_ltrack,
-			error);
-		}
-	else if (*format == MBF_IMAGE83P)
-		{
-		status = mbr_info_image83p(verbose, system,
-			beams_bath_max, beams_amp_max, pixels_ss_max,
-			format_name, system_name, format_description,
-			numfile, filetype,
-			variable_beams, traveltime, beam_flagging,
-			nav_source, heading_source, vru_source, svp_source,
-			beamwidth_xtrack, beamwidth_ltrack,
-			error);
-		}
-	else if (*format == MBF_IMAGEMBA)
-		{
-		status = mbr_info_imagemba(verbose, system,
-			beams_bath_max, beams_amp_max, pixels_ss_max,
-			format_name, system_name, format_description,
-			numfile, filetype,
-			variable_beams, traveltime, beam_flagging,
-			nav_source, heading_source, vru_source, svp_source,
-			beamwidth_xtrack, beamwidth_ltrack,
-			error);
-		}
-	else if (*format == MBF_HIR2RNAV)
-		{
-		status = mbr_info_hir2rnav(verbose, system,
-			beams_bath_max, beams_amp_max, pixels_ss_max,
-			format_name, system_name, format_description,
-			numfile, filetype,
-			variable_beams, traveltime, beam_flagging,
-			nav_source, heading_source, vru_source, svp_source,
-			beamwidth_xtrack, beamwidth_ltrack,
-			error);
-		}
-	else if (*format == MBF_HYSWEEP1)
-		{
-		status = mbr_info_hysweep1(verbose, system,
-			beams_bath_max, beams_amp_max, pixels_ss_max,
-			format_name, system_name, format_description,
-			numfile, filetype,
-			variable_beams, traveltime, beam_flagging,
-			nav_source, heading_source, vru_source, svp_source,
-			beamwidth_xtrack, beamwidth_ltrack,
-			error);
-		}
-	else if (*format == MBF_XTFB1624)
-		{
-		status = mbr_info_xtfb1624(verbose, system,
-			beams_bath_max, beams_amp_max, pixels_ss_max,
-			format_name, system_name, format_description,
-			numfile, filetype,
-			variable_beams, traveltime, beam_flagging,
-			nav_source, heading_source, vru_source, svp_source,
-			beamwidth_xtrack, beamwidth_ltrack,
-			error);
-		}
-	else if (*format == MBF_SWPLSSXI)
-		{
-		status = mbr_info_swplssxi(verbose, system,
-			beams_bath_max, beams_amp_max, pixels_ss_max,
-			format_name, system_name, format_description,
-			numfile, filetype,
-			variable_beams, traveltime, beam_flagging,
-			nav_source, heading_source, vru_source, svp_source,
-			beamwidth_xtrack, beamwidth_ltrack,
-			error);
-		}
-	else if (*format == MBF_SWPLSSXP)
-		{
-		status = mbr_info_swplssxp(verbose, system,
-			beams_bath_max, beams_amp_max, pixels_ss_max,
-			format_name, system_name, format_description,
-			numfile, filetype,
-			variable_beams, traveltime, beam_flagging,
-			nav_source, heading_source, vru_source, svp_source,
-			beamwidth_xtrack, beamwidth_ltrack,
-			error);
-		}
- 	else if (*format == MBF_3DDEPTHP)
-		{
-		status = mbr_info_3ddepthp(verbose, system,
-			beams_bath_max, beams_amp_max, pixels_ss_max,
-			format_name, system_name, format_description,
-			numfile, filetype,
-			variable_beams, traveltime, beam_flagging,
-			nav_source, heading_source, vru_source, svp_source,
-			beamwidth_xtrack, beamwidth_ltrack,
-			error); 
-		}
- 	else if (*format == MBF_WASSPENL)
-		{
-		status = mbr_info_wasspenl(verbose, system,
-			beams_bath_max, beams_amp_max, pixels_ss_max,
-			format_name, system_name, format_description,
-			numfile, filetype,
-			variable_beams, traveltime, beam_flagging,
-			nav_source, heading_source, vru_source, svp_source,
-			beamwidth_xtrack, beamwidth_ltrack,
-			error); 
-		}
- 	else if (*format == MBF_MGD77TXT)
-		{
-		status = mbr_info_mgd77txt(verbose, system,
-			beams_bath_max, beams_amp_max, pixels_ss_max,
-			format_name, system_name, format_description,
-			numfile, filetype,
-			variable_beams, traveltime, beam_flagging,
-			nav_source, heading_source, vru_source, svp_source,
-			beamwidth_xtrack, beamwidth_ltrack,
-			error); 
-		}
- 	else if (*format == MBF_MGD77TAB)
-		{
-		status = mbr_info_mgd77tab(verbose, system,
-			beams_bath_max, beams_amp_max, pixels_ss_max,
-			format_name, system_name, format_description,
-			numfile, filetype,
-			variable_beams, traveltime, beam_flagging,
-			nav_source, heading_source, vru_source, svp_source,
-			beamwidth_xtrack, beamwidth_ltrack,
-			error); 
-		}
- 	else if (*format == MBF_PHOTGRAM)
-		{
-		status = mbr_info_photgram(verbose, system,
-			beams_bath_max, beams_amp_max, pixels_ss_max,
-			format_name, system_name, format_description,
-			numfile, filetype,
-			variable_beams, traveltime, beam_flagging,
-			nav_source, heading_source, vru_source, svp_source,
-			beamwidth_xtrack, beamwidth_ltrack,
-			error); 
-		}
-	else if (*format == MBF_DATALIST)
-		{
-		*format = MBF_DATALIST;
-		*system = MB_SYS_NONE;
-		*beams_bath_max = 0;
-		*beams_amp_max = 0;
-		*pixels_ss_max = 0;
-		strcpy(format_name,"MBF_DATALIST");
-		strcpy(system_name,"MB_SYS_DATALIST");
-		strcpy(format_description,"MBF_DATALIST");
-		strncpy(format_description, "Format name:          MBF_DATALIST\nInformal Description: Datalist\nAttributes:           List of swath data files, each filename \n\tfollowed by MB-System format id.\n", MB_DESCRIPTION_LENGTH);
-		*numfile = 0;
-		*filetype = 0;
-		*variable_beams = MB_NO;
-		*traveltime = MB_NO;
-		*beam_flagging = MB_NO;
-		*nav_source = MB_DATA_NONE;
-		*heading_source = MB_DATA_NONE;
-		*vru_source = MB_DATA_NONE;
-		*svp_source = MB_DATA_NONE;
-		*beamwidth_xtrack = 0.0;
-		*beamwidth_ltrack = 0.0;
-		status = MB_FAILURE;
-		*error = MB_ERROR_BAD_FORMAT;
-		}
-	else
-		{
-		*format = MBF_NONE;
-		*system = MB_SYS_NONE;
-		*beams_bath_max = 0;
-		*beams_amp_max = 0;
-		*pixels_ss_max = 0;
-		format_name[0] = '\0';
-		system_name[0] = '\0';
-		format_description[0] = '\0';
-		*numfile = 0;
-		*filetype = 0;
-		*variable_beams = MB_NO;
-		*traveltime = MB_NO;
-		*beam_flagging = MB_NO;
-		*nav_source = MB_DATA_NONE;
-		*heading_source = MB_DATA_NONE;
-		*vru_source = MB_DATA_NONE;
-		*svp_source = MB_DATA_NONE;
-		*beamwidth_xtrack = 0.0;
-		*beamwidth_ltrack = 0.0;
-		status = MB_FAILURE;
-		*error = MB_ERROR_BAD_FORMAT;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       format:             %d\n",*format);
-		fprintf(stderr,"dbg2       system:             %d\n",*system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",*beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",*beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",*pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",*numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",*filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",*variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",*traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",*beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",*nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",*heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",*vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",*svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",*beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",*beamwidth_ltrack);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:             %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_format(int verbose, int *format, int *error)
-{
-	char	*function_name = "mb_format";
-	int	status;
-
-	/* format parameters */
-	int	system;		/* system id */
-	int	beams_bath_max;	/* maximum number of bathymetry beams */
-	int	beams_amp_max;	/* maximum number of amplitude beams
-					- either 0 or = beams_bath */
-	int	pixels_ss_max;	/* maximum number of sidescan pixels */
-	char	format_name[MB_NAME_LENGTH];
-	char	system_name[MB_NAME_LENGTH];
-	char	format_description[MB_DESCRIPTION_LENGTH];
-	int	numfile;	/* the number of parallel files required for i/o */
-	int	filetype;	/* type of files used (normal, xdr, or gsf) */
-	int	variable_beams; /* if true then number of beams variable */
-	int	traveltime;	/* if true then traveltime and angle data supported */
-	int	beam_flagging;	/* if true then beam flagging supported */
-	int	nav_source;	/* data record types containing the primary navigation */
-	int	heading_source;	/* data record types containing the primary heading */
-	int	vru_source;	/* data record types containing the primary vru */
-	int	svp_source;	/* data record types containing the primary svp */
-	double	beamwidth_xtrack;   /* nominal acrosstrack beamwidth */
-	double	beamwidth_ltrack;   /* nominal alongtrack beamwidth */
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       rcs_id:     %s\n",rcs_id);
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       format:     %d\n",*format);
-		}
-
-	/* set the message and status */
-	status = mb_format_info(verbose, format, &system,
-			&beams_bath_max, &beams_amp_max, &pixels_ss_max,
-			format_name, system_name, format_description,
-			&numfile, &filetype,
-			&variable_beams, &traveltime, &beam_flagging,
-			&nav_source, &heading_source, &vru_source, &svp_source,
-			&beamwidth_xtrack, &beamwidth_ltrack,
-			error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       format:     %d\n",*format);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_format_system(int verbose, int *format, int *system, int *error)
-{
-  static char rcs_id[]="$Id: mb_format.c 2247 2015-05-29 21:28:28Z caress $";
-	char	*function_name = "mb_format_system";
-	int	status;
-
-	/* format parameters */
-	int	beams_bath_max;	/* maximum number of bathymetry beams */
-	int	beams_amp_max;	/* maximum number of amplitude beams
-					- either 0 or = beams_bath */
-	int	pixels_ss_max;	/* maximum number of sidescan pixels */
-	char	format_name[MB_NAME_LENGTH];
-	char	system_name[MB_NAME_LENGTH];
-	char	format_description[MB_DESCRIPTION_LENGTH];
-	int	numfile;	/* the number of parallel files required for i/o */
-	int	filetype;	/* type of files used (normal, xdr, or gsf) */
-	int	variable_beams; /* if true then number of beams variable */
-	int	traveltime;	/* if true then traveltime and angle data supported */
-	int	beam_flagging;	/* if true then beam flagging supported */
-	int	nav_source;	/* data record types containing the primary navigation */
-	int	heading_source;	/* data record types containing the primary heading */
-	int	vru_source;	/* data record types containing the primary vru */
-	int	svp_source;	/* data record types containing the primary svp */
-	double	beamwidth_xtrack;   /* nominal acrosstrack beamwidth */
-	double	beamwidth_ltrack;   /* nominal alongtrack beamwidth */
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       rcs_id:     %s\n",rcs_id);
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       format:     %d\n",*format);
-		}
-
-	/* set the message and status */
-	status = mb_format_info(verbose, format, system,
-			&beams_bath_max, &beams_amp_max, &pixels_ss_max,
-			format_name, system_name, format_description,
-			&numfile, &filetype,
-			&variable_beams, &traveltime, &beam_flagging,
-			&nav_source, &heading_source, &vru_source, &svp_source,
-			&beamwidth_xtrack, &beamwidth_ltrack,
-			error);
-	if (status == MB_FAILURE)
-		{
-		*system = MB_SYS_NONE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       format:      %d\n",*format);
-		fprintf(stderr,"dbg2       system:      %d\n",*system);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		fprintf(stderr,"dbg2       error:       %d\n",*error);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_format_dimensions(int verbose, int *format,
-		int *beams_bath_max, int *beams_amp_max, int *pixels_ss_max,
-		int *error)
-{
-  static char rcs_id[]="$Id: mb_format.c 2247 2015-05-29 21:28:28Z caress $";
-	char	*function_name = "mb_format_dimensions";
-	int	status;
-
-	/* format parameters */
-	int	system;		/* sonar system id */
-	char	format_name[MB_NAME_LENGTH];
-	char	system_name[MB_NAME_LENGTH];
-	char	format_description[MB_DESCRIPTION_LENGTH];
-	int	numfile;	/* the number of parallel files required for i/o */
-	int	filetype;	/* type of files used (normal, xdr, or gsf) */
-	int	variable_beams; /* if true then number of beams variable */
-	int	traveltime;	/* if true then traveltime and angle data supported */
-	int	beam_flagging;	/* if true then beam flagging supported */
-	int	nav_source;	/* data record types containing the primary navigation */
-	int	heading_source;	/* data record types containing the primary heading */
-	int	vru_source;	/* data record types containing the primary vru */
-	int	svp_source;	/* data record types containing the primary svp */
-	double	beamwidth_xtrack;   /* nominal acrosstrack beamwidth */
-	double	beamwidth_ltrack;   /* nominal alongtrack beamwidth */
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       rcs_id:     %s\n",rcs_id);
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       format:     %d\n",*format);
-		}
-
-	/* set the message and status */
-	status = mb_format_info(verbose, format, &system,
-			beams_bath_max, beams_amp_max, pixels_ss_max,
-			format_name, system_name, format_description,
-			&numfile, &filetype,
-			&variable_beams, &traveltime, &beam_flagging,
-			&nav_source, &heading_source, &vru_source, &svp_source,
-			&beamwidth_xtrack, &beamwidth_ltrack,
-			error);
-	if (status == MB_FAILURE)
-		{
-		*beams_bath_max = 0;
-		*beams_amp_max = 0;
-		*pixels_ss_max = 0;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       format:         %d\n",*format);
-		fprintf(stderr,"dbg2       beams_bath_max: %d\n",*beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:  %d\n",*beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:  %d\n",*pixels_ss_max);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		fprintf(stderr,"dbg2       error:          %d\n",*error);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_format_description(int verbose, int *format, char *description, int *error)
-{
-  static char rcs_id[]="$Id: mb_format.c 2247 2015-05-29 21:28:28Z caress $";
-	char	*function_name = "mb_format_description";
-	int	status;
-
-	/* format parameters */
-	int	system;		/* sonar system id */
-	int	beams_bath_max;	/* maximum number of bathymetry beams */
-	int	beams_amp_max;	/* maximum number of amplitude beams
-					- either 0 or = beams_bath */
-	int	pixels_ss_max;	/* maximum number of sidescan pixels */
-	char	format_name[MB_NAME_LENGTH];
-	char	system_name[MB_NAME_LENGTH];
-	int	numfile;	/* the number of parallel files required for i/o */
-	int	filetype;	/* type of files used (normal, xdr, or gsf) */
-	int	variable_beams; /* if true then number of beams variable */
-	int	traveltime;	/* if true then traveltime and angle data supported */
-	int	beam_flagging;	/* if true then beam flagging supported */
-	int	nav_source;	/* data record types containing the primary navigation */
-	int	heading_source;	/* data record types containing the primary heading */
-	int	vru_source;	/* data record types containing the primary vru */
-	int	svp_source;	/* data record types containing the primary svp */
-	double	beamwidth_xtrack;   /* nominal acrosstrack beamwidth */
-	double	beamwidth_ltrack;   /* nominal alongtrack beamwidth */
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       rcs_id:     %s\n",rcs_id);
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       format:     %d\n",*format);
-		}
-
-	/* set the message and status */
-	status = mb_format_info(verbose, format, &system,
-			&beams_bath_max, &beams_amp_max, &pixels_ss_max,
-			format_name, system_name, description,
-			&numfile, &filetype,
-			&variable_beams, &traveltime, &beam_flagging,
-			&nav_source, &heading_source, &vru_source, &svp_source,
-			&beamwidth_xtrack, &beamwidth_ltrack,
-			error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       format:      %d\n",*format);
-		fprintf(stderr,"dbg2       description: %s\n",description);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		fprintf(stderr,"dbg2       error:       %d\n",*error);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_format_flags(int verbose, int *format,
-		int *variable_beams, int *traveltime, int *beam_flagging,
-		int *error)
-{
-  static char rcs_id[]="$Id: mb_format.c 2247 2015-05-29 21:28:28Z caress $";
-	char	*function_name = "mb_format_flags";
-	int	status;
-
-	/* format parameters */
-	int	system;		/* sonar system id */
-	int	beams_bath_max;	/* maximum number of bathymetry beams */
-	int	beams_amp_max;	/* maximum number of amplitude beams
-					- either 0 or = beams_bath */
-	int	pixels_ss_max;	/* maximum number of sidescan pixels */
-	char	format_name[MB_NAME_LENGTH];
-	char	system_name[MB_NAME_LENGTH];
-	char	format_description[MB_DESCRIPTION_LENGTH];
-	int	numfile;	/* the number of parallel files required for i/o */
-	int	filetype;	/* type of files used (normal, xdr, or gsf) */
-	int	nav_source;	/* data record types containing the primary navigation */
-	int	heading_source;	/* data record types containing the primary heading */
-	int	vru_source;	/* data record types containing the primary vru */
-	int	svp_source;	/* data record types containing the primary svp */
-	double	beamwidth_xtrack;   /* nominal acrosstrack beamwidth */
-	double	beamwidth_ltrack;   /* nominal alongtrack beamwidth */
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       rcs_id:     %s\n",rcs_id);
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       format:     %d\n",*format);
-		}
-
-	/* set the message and status */
-	status = mb_format_info(verbose, format, &system,
-			&beams_bath_max, &beams_amp_max, &pixels_ss_max,
-			format_name, system_name, format_description,
-			&numfile, &filetype,
-			variable_beams, traveltime, beam_flagging,
-			&nav_source, &heading_source, &vru_source, &svp_source,
-			&beamwidth_xtrack, &beamwidth_ltrack,
-			error);
-	if (status == MB_FAILURE)
-		{
-		*variable_beams = MB_NO;
-		*traveltime = MB_NO;
-		*beam_flagging = MB_NO;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       format:         %d\n",*format);
-		fprintf(stderr,"dbg2       variable_beams: %d\n",*variable_beams);
-		fprintf(stderr,"dbg2       traveltime:     %d\n",*traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:  %d\n",*beam_flagging);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		fprintf(stderr,"dbg2       error:          %d\n",*error);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_format_source(int verbose, int *format,
-		int *nav_source, int *heading_source,
-		int *vru_source, int *svp_source,
-		int *error)
-{
-  static char rcs_id[]="$Id: mb_format.c 2247 2015-05-29 21:28:28Z caress $";
-	char	*function_name = "mb_format_source";
-	int	status;
-
-	/* format parameters */
-	int	system;		/* sonar system id */
-	int	beams_bath_max;	/* maximum number of bathymetry beams */
-	int	beams_amp_max;	/* maximum number of amplitude beams
-					- either 0 or = beams_bath */
-	int	pixels_ss_max;	/* maximum number of sidescan pixels */
-	char	format_name[MB_NAME_LENGTH];
-	char	system_name[MB_NAME_LENGTH];
-	char	format_description[MB_DESCRIPTION_LENGTH];
-	int	numfile;	/* the number of parallel files required for i/o */
-	int	filetype;	/* type of files used (normal, xdr, or gsf) */
-	int	variable_beams; /* if true then number of beams variable */
-	int	traveltime;	/* if true then traveltime and angle data supported */
-	int	beam_flagging;	/* if true then beam flagging supported */
-	double	beamwidth_xtrack;   /* nominal acrosstrack beamwidth */
-	double	beamwidth_ltrack;   /* nominal alongtrack beamwidth */
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       rcs_id:     %s\n",rcs_id);
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       format:     %d\n",*format);
-		}
-
-	/* set the message and status */
-	status = mb_format_info(verbose, format, &system,
-			&beams_bath_max, &beams_amp_max, &pixels_ss_max,
-			format_name, system_name, format_description,
-			&numfile, &filetype,
-			&variable_beams, &traveltime, &beam_flagging,
-			nav_source, heading_source, vru_source, svp_source,
-			&beamwidth_xtrack, &beamwidth_ltrack,
-			error);
-	if (status == MB_FAILURE)
-		{
-		*nav_source = MB_DATA_NONE;
-		*heading_source = MB_DATA_NONE;
-		*vru_source = MB_DATA_NONE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       format:         %d\n",*format);
-		fprintf(stderr,"dbg2       nav_source:     %d\n",*nav_source);
-		fprintf(stderr,"dbg2       heading_source: %d\n",*heading_source);
-		fprintf(stderr,"dbg2       vru_source:     %d\n",*vru_source);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		fprintf(stderr,"dbg2       error:          %d\n",*error);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_format_beamwidth(int verbose, int *format,
-		double *beamwidth_xtrack, double *beamwidth_ltrack,
-		int *error)
-{
-  static char rcs_id[]="$Id: mb_format.c 2247 2015-05-29 21:28:28Z caress $";
-	char	*function_name = "mb_format_beamwidth";
-	int	status;
-
-	/* format parameters */
-	int	system;		/* sonar system id */
-	int	beams_bath_max;	/* maximum number of bathymetry beams */
-	int	beams_amp_max;	/* maximum number of amplitude beams
-					- either 0 or = beams_bath */
-	int	pixels_ss_max;	/* maximum number of sidescan pixels */
-	char	format_name[MB_NAME_LENGTH];
-	char	system_name[MB_NAME_LENGTH];
-	char	format_description[MB_DESCRIPTION_LENGTH];
-	int	numfile;	/* the number of parallel files required for i/o */
-	int	filetype;	/* type of files used (normal, xdr, or gsf) */
-	int	variable_beams; /* if true then number of beams variable */
-	int	traveltime;	/* if true then traveltime and angle data supported */
-	int	beam_flagging;	/* if true then beam flagging supported */
-	int     nav_source;     /* data record types containing the primary navigation */
-        int     heading_source;	/* data record types containing the primary heading */
-        int     vru_source;	/* data record types containing the primary vru */
-        int     svp_source;	/* data record types containing the primary svp */
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       rcs_id:     %s\n",rcs_id);
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       format:     %d\n",*format);
-		}
-
-	/* set the message and status */
-	status = mb_format_info(verbose, format, &system,
-			&beams_bath_max, &beams_amp_max, &pixels_ss_max,
-			format_name, system_name, format_description,
-			&numfile, &filetype,
-			&variable_beams, &traveltime, &beam_flagging,
-			&nav_source, &heading_source, &vru_source, &svp_source,
-			beamwidth_xtrack, beamwidth_ltrack,
-			error);
-	if (status == MB_FAILURE)
-		{
-		*beamwidth_xtrack = 0.0;
-		*beamwidth_ltrack = 0.0;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       format:           %d\n",*format);
-		fprintf(stderr,"dbg2       beamwidth_xtrack: %f\n",*beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack: %f\n",*beamwidth_ltrack);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		fprintf(stderr,"dbg2       error:          %d\n",*error);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_get_format(int verbose, char *filename, char *fileroot,
-		    int *format, int *error)
-{
-	char	*function_name = "mb_get_format";
-	int	status = MB_SUCCESS;
-	int	found = MB_NO;
-	char	*suffix;
-	int	suffix_len;
-	FILE	*checkfp;
-	mb_path	parfile;
-	mb_path	dummy;
-	int	pformat;
-	struct	stat statbuf;
-	char	buffer[MB_COMMENT_MAXLINE];
-	char	*result;
-
-	short	*shortptr;
-	short	type1, sonar1, type2, sonar2, type1swap, sonar1swap, type2swap, sonar2swap;
-	int	nsonar, nlow, nhigh, subsystem, size;
-	int	done;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       rcs_id:    %s\n",rcs_id);
-		fprintf(stderr,"dbg2       verbose:   %d\n",verbose);
-		fprintf(stderr,"dbg2       filename:  %s\n",filename);
-		}
-
-	/* set format not found */
-	found = MB_NO;
-	*format = 0;
-
-	/* first look for MB suffix convention */
-	if (found == MB_NO)
-	    {
-	    if (strlen(filename) > 6)
-		i = strlen(filename) - 6;
-	    else
-		i = 0;
-	    if ((suffix = strstr(&filename[i],".mb")) != NULL
-		    || (suffix = strstr(&filename[i],".MB")) != NULL)
-		{
-		suffix_len = strlen(suffix);
-		if (suffix_len >= 4 && suffix_len <= 6)
-		    {
-		    if (fileroot != NULL)
-			{
-			strncpy(fileroot, filename, strlen(filename)-suffix_len);
-			fileroot[strlen(filename)-suffix_len] = '\0';
-			}
-		    if (sscanf(suffix, ".mb%d", format) > 0
-			    || sscanf(suffix, ".MB%d", format) > 0)
-			found = MB_YES;
-		    }
-		}
-	    }
-
-	/* look for mbnavedit navigation suffix */
-	if (found == MB_NO)
-	    {
-	    if (strlen(filename) > 4)
-		i = strlen(filename) - 4;
-	    else
-		i = 0;
-	    if ((suffix = strstr(&filename[i],".nve")) != NULL
-	    	|| (suffix = strstr(&filename[i],".MVE")) != NULL)
-		{
-		suffix_len = strlen(suffix);
-		if (suffix_len == 4)
-		    {
-		    if (fileroot != NULL)
-			{
-			strncpy(fileroot, filename, strlen(filename)-suffix_len);
-			fileroot[strlen(filename)-suffix_len] = '\0';
-			}
-		    *format = MBF_MBPRONAV;
-		    found = MB_YES;
-		    }
-		}
-	    }
-
-	/* look for mbnavadjust navigation suffixes */
-	if (found == MB_NO)
-	    {
-	    if (strlen(filename) > 4)
-		i = strlen(filename) - 4;
-	    else
-		i = 0;
-	    if ((suffix = strstr(&filename[i],".na")) != NULL
-	    	|| (suffix = strstr(&filename[i],".NA")) != NULL)
-		{
-		suffix_len = strlen(suffix);
-		if (suffix_len == 4)
-		    {
-		    if (fileroot != NULL)
-			{
-			strncpy(fileroot, filename, strlen(filename)-suffix_len);
-			fileroot[strlen(filename)-suffix_len] = '\0';
-			}
-		    *format = MBF_MBPRONAV;
-		    found = MB_YES;
-		    }
-		}
-	    }
-
-	/* look for "fast bath" or .fbt suffix */
-	if (found == MB_NO)
-	    {
-	    if (strlen(filename) > 4)
-		i = strlen(filename) - 4;
-	    else
-		i = 0;
-	    if ((suffix = strstr(&filename[i],".fbt")) != NULL
-	    	|| (suffix = strstr(&filename[i],".FBT")) != NULL)
-		{
-		suffix_len = strlen(suffix);
-		if (suffix_len == 4)
-		    {
-		    if (fileroot != NULL)
-			{
-			strncpy(fileroot, filename, strlen(filename)-suffix_len);
-			fileroot[strlen(filename)-suffix_len] = '\0';
-			}
-		    *format = MBF_MBLDEOIH;
-		    found = MB_YES;
-		    }
-		}
-	    }
-
-	/* look for "fast filtered bath" or .ffb suffix */
-	if (found == MB_NO)
-	    {
-	    if (strlen(filename) > 4)
-		i = strlen(filename) - 4;
-	    else
-		i = 0;
-	    if ((suffix = strstr(&filename[i],".ffb")) != NULL
-	    	|| (suffix = strstr(&filename[i],".FFB")) != NULL)
-		{
-		suffix_len = strlen(suffix);
-		if (suffix_len == 4)
-		    {
-		    if (fileroot != NULL)
-			{
-			strncpy(fileroot, filename, strlen(filename)-suffix_len);
-			fileroot[strlen(filename)-suffix_len] = '\0';
-			}
-		    *format = MBF_MBLDEOIH;
-		    found = MB_YES;
-		    }
-		}
-	    }
-
-	/* look for "fast filtered amplitude" or .ffa suffix */
-	if (found == MB_NO)
-	    {
-	    if (strlen(filename) > 4)
-		i = strlen(filename) - 4;
-	    else
-		i = 0;
-	    if ((suffix = strstr(&filename[i],".ffa")) != NULL
-	    	|| (suffix = strstr(&filename[i],".FFA")) != NULL)
-		{
-		suffix_len = strlen(suffix);
-		if (suffix_len == 4)
-		    {
-		    if (fileroot != NULL)
-			{
-			strncpy(fileroot, filename, strlen(filename)-suffix_len);
-			fileroot[strlen(filename)-suffix_len] = '\0';
-			}
-		    *format = MBF_MBLDEOIH;
-		    found = MB_YES;
-		    }
-		}
-	    }
-
-	/* look for "fast filtered sidescan" or .ffs suffix */
-	if (found == MB_NO)
-	    {
-	    if (strlen(filename) > 4)
-		i = strlen(filename) - 4;
-	    else
-		i = 0;
-	    if ((suffix = strstr(&filename[i],".ffs")) != NULL
-	    	|| (suffix = strstr(&filename[i],".FFS")) != NULL)
-		{
-		suffix_len = strlen(suffix);
-		if (suffix_len == 4)
-		    {
-		    if (fileroot != NULL)
-			{
-			strncpy(fileroot, filename, strlen(filename)-suffix_len);
-			fileroot[strlen(filename)-suffix_len] = '\0';
-			}
-		    *format = MBF_MBLDEOIH;
-		    found = MB_YES;
-		    }
-		}
-	    }
-
-	/* look for "fast nav" or .fnv suffix */
-	if (found == MB_NO)
-	    {
-	    if (strlen(filename) > 4)
-		i = strlen(filename) - 4;
-	    else
-		i = 0;
-	    if ((suffix = strstr(&filename[i],".fnv")) != NULL || (suffix = strstr(&filename[i],".FNV")) != NULL)
-		{
-		suffix_len = strlen(suffix);
-		if (suffix_len == 4)
-		    {
-		    if (fileroot != NULL)
-			{
-			strncpy(fileroot, filename, strlen(filename)-suffix_len);
-			fileroot[strlen(filename)-suffix_len] = '\0';
-			}
-		    *format = MBF_MBPRONAV;
-		    found = MB_YES;
-		    }
-		}
-	    }
-
-	/* look for datalist suffixes */
-	if (found == MB_NO)
-	    {
-	    if (strlen(filename) > 4)
-		i = strlen(filename) - 4;
-	    else
-		i = 0;
-	    if ((suffix = strstr(&filename[i],".dls")) != NULL
-	    	|| (suffix = strstr(&filename[i],".DLS")) != NULL)
-		{
-		suffix_len = strlen(suffix);
-		if (suffix_len == 4)
-		    {
-		    if (fileroot != NULL)
-			{
-			strncpy(fileroot, filename, strlen(filename)-suffix_len);
-			fileroot[strlen(filename)-suffix_len] = '\0';
-			}
-		    *format = -1;
-		    found = MB_YES;
-		    }
-		}
-	    }
-
-	/* look for SeaBeam suffix convention */
-	if (found == MB_NO)
-	    {
-	    if (strlen(filename) > 4)
-		i = strlen(filename) - 4;
-	    else
-		i = 0;
-	    if ((suffix = strstr(&filename[i],".rec")) != NULL
-	    	|| (suffix = strstr(&filename[i],".REC")) != NULL)
-		{
-		suffix_len = strlen(suffix);
-		if (suffix_len == 4)
-		    {
-		    if (fileroot != NULL)
-			{
-			strncpy(fileroot, filename, strlen(filename)-suffix_len);
-			fileroot[strlen(filename)-suffix_len] = '\0';
-			}
-		    *format = MBF_SB2100RW;
-		    found = MB_YES;
-		    }
-		}
-	    }
-
-	/* look for L3 XSE suffix convention */
-	if (found == MB_NO)
-	    {
-	    if (strlen(filename) > 4)
-		i = strlen(filename) - 4;
-	    else
-		i = 0;
-	    if ((suffix = strstr(&filename[i],".xse")) != NULL
-	    	|| (suffix = strstr(&filename[i],".XSE")) != NULL)
-		{
-		suffix_len = strlen(suffix);
-		if (suffix_len == 4)
-		    {
-		    if (fileroot != NULL)
-			{
-			strncpy(fileroot, filename, strlen(filename)-suffix_len);
-			fileroot[strlen(filename)-suffix_len] = '\0';
-			}
-		    *format = MBF_L3XSERAW;
-		    found = MB_YES;
-		    }
-		}
-	    }
-
-	/* look for old Simrad Mermaid suffix convention */
-	if (found == MB_NO)
-	    {
-	    if (strlen(filename) > 8)
-		i = strlen(filename) - 8;
-	    else
-		i = 0;
-	    if ((suffix = strstr(&filename[i],"_raw.all")) != NULL
-	    	|| (suffix = strstr(&filename[i],"-raw.all")) != NULL
-		|| (suffix = strstr(&filename[i],"_RAW.ALL")) != NULL
-	    	|| (suffix = strstr(&filename[i],"-RAW.ALL")) != NULL)
-		{
-		suffix_len = strlen(suffix);
-		if (suffix_len == 8)
-		    {
-		    /* examine the first datagram to determine
-			whether data is old or new Simrad format */
-		    if ((checkfp = fopen(filename,"r")) != NULL)
-			{
-			if (fread(buffer,1,8,checkfp) == 8)
-			    {
-			    shortptr = (short *) &buffer[0];
-			    type1 = *shortptr;
-			    type1swap = (short) mb_swap_short(type1);
-			    shortptr = (short *) &buffer[2];
-			    sonar1 = *shortptr;
-			    sonar1swap = (short) mb_swap_short(sonar1);
-
-			    shortptr = (short *) &buffer[4];
-			    type2 = *shortptr;
-			    type2swap = (short) mb_swap_short(type2);
-			    shortptr = (short *) &buffer[6];
-			    sonar2 = *shortptr;
-			    sonar2swap = (short) mb_swap_short(sonar2);
-			    if (sonar2 == MBSYS_SIMRAD3_EM710 || sonar2swap == MBSYS_SIMRAD3_EM710
-			    	|| sonar2 == MBSYS_SIMRAD3_EM302 || sonar2swap == MBSYS_SIMRAD3_EM302
-			    	|| sonar2 == MBSYS_SIMRAD3_EM122 || sonar2swap == MBSYS_SIMRAD3_EM122
-			    	|| sonar2 == MBSYS_SIMRAD3_EM2040 || sonar2swap == MBSYS_SIMRAD3_EM2040
-			    	|| sonar2 == MBSYS_SIMRAD3_EM2045 || sonar2swap == MBSYS_SIMRAD3_EM2045)
-				*format = MBF_EM710RAW;
-			    else if (type2 == EM_START
-				|| type2 == EM_STOP
-				|| type2 == EM_PARAMETER)
-				*format = MBF_EMOLDRAW;
-			    else if (type2 == EM2_START
-				|| type2 == EM2_STOP
-				|| type2 == EM2_STOP2
-				|| type2 == EM2_STATUS
-				|| type2 == EM2_ON
-				|| type2 == EM2_RUN_PARAMETER)
-				*format = MBF_EM300RAW;
-			    else if (type2swap == EM_START
-				|| type2swap == EM_STOP
-				|| type2swap == EM_PARAMETER)
-				*format = MBF_EMOLDRAW;
-			    else if (type2swap == EM2_START
-				|| type2swap == EM2_STOP
-				|| type2swap == EM2_STOP2
-				|| type2swap == EM2_STATUS
-				|| type2swap == EM2_ON
-				|| type2swap == EM2_RUN_PARAMETER)
-				*format = MBF_EM300RAW;
-			    else if (type1 == EM_START
-				|| type1 == EM_STOP
-				|| type1 == EM_PARAMETER)
-				*format = MBF_EMOLDRAW;
-			    else if (type1 == EM2_START
-				|| type1 == EM2_STOP
-				|| type1 == EM2_STOP2
-				|| type1 == EM2_STATUS
-				|| type1 == EM2_ON
-				|| type1 == EM2_RUN_PARAMETER)
-				*format = MBF_EM300RAW;
-			    else if (type1swap == EM_START
-				|| type1swap == EM_STOP
-				|| type1swap == EM_PARAMETER)
-				*format = MBF_EMOLDRAW;
-			    else if (type1swap == EM2_START
-				|| type1swap == EM2_STOP
-				|| type1swap == EM2_STOP2
-				|| type1swap == EM2_STATUS
-				|| type1swap == EM2_ON
-				|| type1swap == EM2_RUN_PARAMETER)
-				*format = MBF_EM300RAW;
-			    else
-				*format = MBF_EM300RAW;
-			    }
-			fclose(checkfp);
-			}
-		    else
-			*format = MBF_EM300RAW;
-		    if (fileroot != NULL)
-			{
-			strncpy(fileroot, filename, strlen(filename)-suffix_len);
-			fileroot[strlen(filename)-suffix_len] = '\0';
-			}
-		    found = MB_YES;
-		    }
-		}
-	    }
-
-	/* look for newer Simrad Mermaid suffix convention */
-	if (found == MB_NO)
-	    {
-	    if (strlen(filename) > 4)
-		i = strlen(filename) - 4;
-	    else
-		i = 0;
-	    if ((suffix = strstr(&filename[i],".all")) != NULL
-	    	|| (suffix = strstr(&filename[i],".ALL")) != NULL)
-		{
-		suffix_len = strlen(suffix);
-		if (suffix_len == 4)
-		    {
-		    /* examine the first datagram to determine
-			whether data is old or new Simrad format */
-		    if ((checkfp = fopen(filename,"r")) != NULL)
-			{
-			if (fread(buffer,1,8,checkfp) == 8)
-			    {
-			    shortptr = (short *) &buffer[0];
-			    type1 = *shortptr;
-			    type1swap = (short) mb_swap_short(type1);
-			    shortptr = (short *) &buffer[2];
-			    sonar1 = *shortptr;
-			    sonar1swap = (short) mb_swap_short(sonar1);
-
-			    shortptr = (short *) &buffer[4];
-			    type2 = *shortptr;
-			    type2swap = (short) mb_swap_short(type2);
-			    shortptr = (short *) &buffer[6];
-			    sonar2 = *shortptr;
-			    sonar2swap = (short) mb_swap_short(sonar2);
-			    if (sonar2 == MBSYS_SIMRAD3_EM710 || sonar2swap == MBSYS_SIMRAD3_EM710
-			    	|| sonar2 == MBSYS_SIMRAD3_EM302 || sonar2swap == MBSYS_SIMRAD3_EM302
-			    	|| sonar2 == MBSYS_SIMRAD3_EM122 || sonar2swap == MBSYS_SIMRAD3_EM122
-			    	|| sonar2 == MBSYS_SIMRAD3_EM2040 || sonar2swap == MBSYS_SIMRAD3_EM2040
-			    	|| sonar2 == MBSYS_SIMRAD3_EM2045 || sonar2swap == MBSYS_SIMRAD3_EM2045
-			    	|| sonar2 == MBSYS_SIMRAD3_M3 || sonar2swap == MBSYS_SIMRAD3_M3)
-				*format = MBF_EM710RAW;
-			    else if (type2 == EM_START
-				|| type2 == EM_STOP
-				|| type2 == EM_PARAMETER)
-				*format = MBF_EMOLDRAW;
-			    else if (type2 == EM2_START
-				|| type2 == EM2_STOP
-				|| type2 == EM2_STOP2
-				|| type2 == EM2_STATUS
-				|| type2 == EM2_ON
-				|| type2 == EM2_RUN_PARAMETER)
-				*format = MBF_EM300RAW;
-			    else if (type2swap == EM_START
-				|| type2swap == EM_STOP
-				|| type2swap == EM_PARAMETER)
-				*format = MBF_EMOLDRAW;
-			    else if (type2swap == EM2_START
-				|| type2swap == EM2_STOP
-				|| type2swap == EM2_STOP2
-				|| type2swap == EM2_STATUS
-				|| type2swap == EM2_ON
-				|| type2swap == EM2_RUN_PARAMETER)
-				*format = MBF_EM300RAW;
-			    else if (type1 == EM_START
-				|| type1 == EM_STOP
-				|| type1 == EM_PARAMETER)
-				*format = MBF_EMOLDRAW;
-			    else if (type1 == EM2_START
-				|| type1 == EM2_STOP
-				|| type1 == EM2_STOP2
-				|| type1 == EM2_STATUS
-				|| type1 == EM2_ON
-				|| type1 == EM2_RUN_PARAMETER)
-				*format = MBF_EM300RAW;
-			    else if (type1swap == EM_START
-				|| type1swap == EM_STOP
-				|| type1swap == EM_PARAMETER)
-				*format = MBF_EMOLDRAW;
-			    else if (type1swap == EM2_START
-				|| type1swap == EM2_STOP
-				|| type1swap == EM2_STOP2
-				|| type1swap == EM2_STATUS
-				|| type1swap == EM2_ON
-				|| type1swap == EM2_RUN_PARAMETER)
-				*format = MBF_EM300RAW;
-			    else
-				*format = MBF_EM300RAW;
-			    }
-			fclose(checkfp);
-			}
-		    else
-		    	*format = MBF_EM300RAW;
-		    if (fileroot != NULL)
-			{
-			strncpy(fileroot, filename, strlen(filename)-suffix_len);
-			fileroot[strlen(filename)-suffix_len] = '\0';
-			}
-		    found = MB_YES;
-		    }
-		}
-	    }
-
-	/* look for JHC format suffix convention */
-	if (found == MB_NO)
-	    {
-	    if (strlen(filename) > 7)
-		i = strlen(filename) - 7;
-	    else
-		i = 0;
-	    if ((suffix = strstr(&filename[i],".merged")) != NULL
-	    	|| (suffix = strstr(&filename[i],".MERGED")) != NULL)
-		{
-		suffix_len = strlen(suffix);
-		if (suffix_len == 7)
-		    {
-		    if (fileroot != NULL)
-			{
-			strncpy(fileroot, filename, strlen(filename)-suffix_len);
-			fileroot[strlen(filename)-suffix_len] = '\0';
-			}
-		    *format = MBF_OMGHDCSJ;
-		    found = MB_YES;
-		    }
-		}
-	    }
-
-	/* look for Hypac format suffix convention */
-	if (found == MB_NO)
-	    {
-	    if (strlen(filename) > 4)
-		i = strlen(filename) - 4;
-	    else
-		i = 0;
-	    if ((suffix = strstr(&filename[i],".HAL")) != NULL
-	    	|| (suffix = strstr(&filename[i],".hal")) != NULL)
-		{
-		suffix_len = strlen(suffix);
-		if (suffix_len == 4)
-		    {
-		    if (fileroot != NULL)
-			{
-			strncpy(fileroot, filename, strlen(filename)-suffix_len);
-			fileroot[strlen(filename)-suffix_len] = '\0';
-			}
-		    *format = MBF_HYPC8101;
-		    found = MB_YES;
-		    }
-		}
-	    }
-
-	/* look for MBARI format suffix convention */
-	if (found == MB_NO)
-	    {
-	    if (strlen(filename) >= 18)
-		i = strlen(filename) - 8;
-	    else
-		i = 0;
-	    if ((suffix = strstr(&filename[i],"tibr.txt")) != NULL)
-		suffix_len = 4;
-	    else if ((suffix = strstr(&filename[i],"docr.txt")) != NULL)
-		suffix_len = 4;
-	    else if ((suffix = strstr(&filename[i],"vnta.txt")) != NULL)
-		suffix_len = 4;
-	    else if ((suffix = strstr(&filename[i],"ptlo.txt")) != NULL)
-		suffix_len = 4;
-	    else if ((suffix = strstr(&filename[i],"wfly.txt")) != NULL)
-		suffix_len = 4;
-	    else
-		suffix_len = 0;
-	    if (suffix_len == 4)
-		{
-		if (fileroot != NULL)
-		    {
-		    strncpy(fileroot, filename, strlen(filename)-suffix_len);
-		    fileroot[strlen(filename)-suffix_len] = '\0';
-		    }
-		*format = MBF_MBARIROV;
-		found = MB_YES;
-		}
-	    }
-
-	/* look for MBARI edited format suffix convention */
-	if (found == MB_NO)
-	    {
-	    if (strlen(filename) >= 24)
-		i = strlen(filename) - 14;
-	    else
-		i = 0;
-	    if ((suffix = strstr(&filename[i],"tibredited.txt")) != NULL)
-		suffix_len = 4;
-	    else if ((suffix = strstr(&filename[i],"docredited.txt")) != NULL)
-		suffix_len = 4;
-	    else if ((suffix = strstr(&filename[i],"vntaedited.txt")) != NULL)
-		suffix_len = 4;
-	    else if ((suffix = strstr(&filename[i],"ptloedited.txt")) != NULL)
-		suffix_len = 4;
-	    else if ((suffix = strstr(&filename[i],"wflyedited.txt")) != NULL)
-		suffix_len = 4;
-	    else
-		suffix_len = 0;
-	    if (suffix_len == 4)
-		{
-		if (fileroot != NULL)
-		    {
-		    strncpy(fileroot, filename, strlen(filename)-suffix_len);
-		    fileroot[strlen(filename)-suffix_len] = '\0';
-		    }
-		*format = MBF_MBARIROV;
-		found = MB_YES;
-		}
-	    }
-
-	/* look for NIO Hydrosweep DS raw format suffix convention */
-	if (found == MB_NO)
-	    {
-	    if (strlen(filename) >= 4)
-		i = strlen(filename) - 3;
-	    else
-		i = 0;
-	    if ((suffix = strstr(&filename[i],".hs")) != NULL
-	    	|| (suffix = strstr(&filename[i],".HS")) != NULL)
-		suffix_len = 3;
-	    else
-		suffix_len = 0;
-	    if (suffix_len == 3)
-		{
-		if (fileroot != NULL)
-		    {
-		    strncpy(fileroot, filename, strlen(filename)-suffix_len);
-		    fileroot[strlen(filename)-suffix_len] = '\0';
-		    }
-		*format = MBF_HSATLRAW;
-		found = MB_YES;
-		}
-	    }
-
-	/* look for STN Atlas raw format suffix convention */
-	if (found == MB_NO)
-	    {
-	    if (strlen(filename) >= 5)
-		i = strlen(filename) - 4;
-	    else
-		i = 0;
-	    if ((suffix = strstr(&filename[i],".fsw")) != NULL
-	    	|| (suffix = strstr(&filename[i],".FSW")) != NULL)
-		suffix_len = 4;
-	    else
-		suffix_len = 0;
-	    if (suffix_len == 4)
-		{
-		if (fileroot != NULL)
-		    {
-		    strncpy(fileroot, filename, strlen(filename)-suffix_len);
-		    fileroot[strlen(filename)-suffix_len] = '\0';
-		    }
-		*format = MBF_HSDS2RAW;
-		found = MB_YES;
-		}
-	    }
-
-	/* look for Triton-ELics XTF format suffix convention */
-	if (found == MB_NO)
-	    {
-	    if (strlen(filename) >= 5)
-		i = strlen(filename) - 4;
-	    else
-		i = 0;
-	    if ((suffix = strstr(&filename[i],".xtf")) != NULL
-	    	|| (suffix = strstr(&filename[i],".XTF")) != NULL)
-		suffix_len = 4;
-	    else
-		suffix_len = 0;
-	    if (suffix_len == 4)
-		{
-		if (fileroot != NULL)
-		    {
-		    strncpy(fileroot, filename, strlen(filename)-suffix_len);
-		    fileroot[strlen(filename)-suffix_len] = '\0';
-		    }
-		*format = MBF_XTFR8101;
-		found = MB_YES;
-		}
-	    }
-
-	/* look for MGD77 suffix conventions */
-	if (found == MB_NO)
-	    {
-	    if (strlen(filename) >= 7)
-		i = strlen(filename) - 6;
-	    else
-		i = 0;
-	    if ((suffix = strstr(&filename[i],".mgd77")) != NULL
-	    	|| (suffix = strstr(&filename[i],".MGD77")) != NULL)
-		suffix_len = 6;
-	    else
-		suffix_len = 0;
-	    if (suffix_len == 4 || suffix_len == 6)
-		{
-		if (fileroot != NULL)
-		    {
-		    strncpy(fileroot, filename, strlen(filename)-suffix_len);
-		    fileroot[strlen(filename)-suffix_len] = '\0';
-		    }
-		*format = MBF_MGD77DAT;
-		found = MB_YES;
-		}
-	    }
-
-	/* look for MGD77 suffix conventions */
-	if (found == MB_NO)
-	    {
-	    if (strlen(filename) >= 5)
-		i = strlen(filename) - 4;
-	    else
-		i = 0;
-	    if ((suffix = strstr(&filename[i],".a77")) != NULL
-	    	|| (suffix = strstr(&filename[i],".A77")) != NULL)
-		suffix_len = 4;
-	    else
-		suffix_len = 0;
-	    if (suffix_len == 4)
-		{
-		if (fileroot != NULL)
-		    {
-		    strncpy(fileroot, filename, strlen(filename)-suffix_len);
-		    fileroot[strlen(filename)-suffix_len] = '\0';
-		    }
-		*format = MBF_MGD77TXT;
-		found = MB_YES;
-		}
-	    }
-
-	/* look for MGD77T suffix conventions */
-	if (found == MB_NO)
-	    {
-	    if (strlen(filename) >= 6)
-		i = strlen(filename) - 5;
-	    else
-		i = 0;
-	    if ((suffix = strstr(&filename[i],".m77t")) != NULL
-	    	|| (suffix = strstr(&filename[i],".M77T")) != NULL)
-		suffix_len = 5;
-	    else
-		suffix_len = 0;
-	    if (suffix_len == 5)
-		{
-		if (fileroot != NULL)
-		    {
-		    strncpy(fileroot, filename, strlen(filename)-suffix_len);
-		    fileroot[strlen(filename)-suffix_len] = '\0';
-		    }
-		*format = MBF_PHOTGRAM;
-		found = MB_YES;
-		}
-	    }
-
-	/* look for segy suffix convention */
-	if (found == MB_NO)
-	    {
-	    if (strlen(filename) >= 6)
-		i = strlen(filename) - 5;
-	    else
-		i = 0;
-	    if ((suffix = strstr(&filename[i],".segy")) != NULL
-	    	|| (suffix = strstr(&filename[i],".SEGY")) != NULL)
-		suffix_len = 5;
-	    else
-		suffix_len = 0;
-	    if (suffix_len == 5)
-		{
-		if (fileroot != NULL)
-		    {
-		    strncpy(fileroot, filename, strlen(filename)-suffix_len);
-		    fileroot[strlen(filename)-suffix_len] = '\0';
-		    }
-		*format = MBF_SEGYSEGY;
-		found = MB_YES;
-		}
-	    }
-
-	/* look for IFREMER Trismus format convention */
-	if (found == MB_NO)
-	    {
-	    if (strlen(filename) >= 4)
-		i = strlen(filename) - 3;
-	    else
-		i = 0;
-	    if ((suffix = strstr(&filename[i],".so")) != NULL
-	    	|| (suffix = strstr(&filename[i],".SO")) != NULL)
-		suffix_len = 3;
-	    else
-		suffix_len = 0;
-	    if (suffix_len == 3)
-		{
-		if (fileroot != NULL)
-		    {
-		    strncpy(fileroot, filename, strlen(filename)-suffix_len);
-		    fileroot[strlen(filename)-suffix_len] = '\0';
-		    }
-		*format = MBF_EM12IFRM;
-		found = MB_YES;
-		}
-	    }
-
-	/* look for IFREMER netCDF format convention */
-	if (found == MB_NO)
-	    {
-	    if (strlen(filename) >= 5)
-		i = strlen(filename) - 4;
-	    else
-		i = 0;
-	    if ((suffix = strstr(&filename[i],".mbb")) != NULL
-	    	|| (suffix = strstr(&filename[i],".MBB")) != NULL)
-		suffix_len = 4;
-	    else
-		suffix_len = 0;
-	    if (suffix_len == 4)
-		{
-		if (fileroot != NULL)
-		    {
-		    strncpy(fileroot, filename, strlen(filename)-suffix_len);
-		    fileroot[strlen(filename)-suffix_len] = '\0';
-		    }
-		*format = MBF_MBNETCDF;
-		found = MB_YES;
-		}
-	    }
-
-	/* look for IFREMER netCDF format convention */
-	if (found == MB_NO)
-	    {
-	    if (strlen(filename) >= 5)
-		i = strlen(filename) - 4;
-	    else
-		i = 0;
-	    if ((suffix = strstr(&filename[i],".mbg")) != NULL
-	    	|| (suffix = strstr(&filename[i],".MBG")) != NULL)
-		suffix_len = 4;
-	    else
-		suffix_len = 0;
-	    if (suffix_len == 4)
-		{
-		if (fileroot != NULL)
-		    {
-		    strncpy(fileroot, filename, strlen(filename)-suffix_len);
-		    fileroot[strlen(filename)-suffix_len] = '\0';
-		    }
-		*format = MBF_MBNETCDF;
-		found = MB_YES;
-		}
-	    }
-
-	/* look for IFREMER netCDF navigation format convention */
-	if (found == MB_NO)
-	    {
-	    if (strlen(filename) >= 5)
-		i = strlen(filename) - 4;
-	    else
-		i = 0;
-	    if ((suffix = strstr(&filename[i],".nvi")) != NULL
-	    	|| (suffix = strstr(&filename[i],".NVI")) != NULL)
-		suffix_len = 4;
-	    else
-		suffix_len = 0;
-	    if (suffix_len == 4)
-		{
-		if (fileroot != NULL)
-		    {
-		    strncpy(fileroot, filename, strlen(filename)-suffix_len);
-		    fileroot[strlen(filename)-suffix_len] = '\0';
-		    }
-		*format = MBF_NVNETCDF;
-		found = MB_YES;
-		}
-	    }
-
-	/* look for SAME SURF format convention */
-	if (found == MB_NO)
-	    {
-	    if (strlen(filename) >= 5)
-		i = strlen(filename) - 4;
-	    else
-		i = 0;
-	    if ((suffix = strstr(&filename[i],".six")) != NULL)
-		suffix_len = 4;
-	    else if ((suffix = strstr(&filename[i],".SIX")) != NULL)
-		suffix_len = 4;
-	    else if ((suffix = strstr(&filename[i],".sda")) != NULL)
-		suffix_len = 4;
-	    else if ((suffix = strstr(&filename[i],".SDA")) != NULL)
-		suffix_len = 4;
-	    else
-		suffix_len = 0;
-	    if (suffix_len == 4)
-		{
-		if (fileroot != NULL)
-		    {
-		    strncpy(fileroot, filename, strlen(filename)-suffix_len);
-		    fileroot[strlen(filename)-suffix_len] = '\0';
-		    }
-		*format = MBF_SAMESURF;
-		found = MB_YES;
-		}
-	    }
-
-	/* look for xyz sounding format convention */
-	if (found == MB_NO)
-	    {
-	    if (strlen(filename) >= 5)
-		i = strlen(filename) - 4;
-	    else
-		i = 0;
-	    if ((suffix = strstr(&filename[i],".xyz")) != NULL)
-		suffix_len = 4;
-	    else if ((suffix = strstr(&filename[i],".XYZ")) != NULL)
-		suffix_len = 4;
-	    else
-		suffix_len = 0;
-	    if (suffix_len == 4)
-		{
-		if (fileroot != NULL)
-		    {
-		    strncpy(fileroot, filename, strlen(filename)-suffix_len);
-		    fileroot[strlen(filename)-suffix_len] = '\0';
-		    }
-		*format = MBF_ASCIIXYZ;
-		found = MB_YES;
-		}
-	    }
-
-	/* look for yxz sounding format convention */
-	if (found == MB_NO)
-	    {
-	    if (strlen(filename) >= 5)
-		i = strlen(filename) - 4;
-	    else
-		i = 0;
-	    if ((suffix = strstr(&filename[i],".yxz")) != NULL)
-		suffix_len = 4;
-	    else if ((suffix = strstr(&filename[i],".YXZ")) != NULL)
-		suffix_len = 4;
-	    else
-		suffix_len = 0;
-	    if (suffix_len == 4)
-		{
-		if (fileroot != NULL)
-		    {
-		    strncpy(fileroot, filename, strlen(filename)-suffix_len);
-		    fileroot[strlen(filename)-suffix_len] = '\0';
-		    }
-		*format = MBF_ASCIIYXZ;
-		found = MB_YES;
-		}
-	    }
-
-	/* look for xyt sounding format convention */
-	if (found == MB_NO)
-	    {
-	    if (strlen(filename) >= 5)
-		i = strlen(filename) - 4;
-	    else
-		i = 0;
-	    if ((suffix = strstr(&filename[i],".xyt")) != NULL)
-		suffix_len = 4;
-	    else if ((suffix = strstr(&filename[i],".XYT")) != NULL)
-		suffix_len = 4;
-	    else
-		suffix_len = 0;
-	    if (suffix_len == 4)
-		{
-		if (fileroot != NULL)
-		    {
-		    strncpy(fileroot, filename, strlen(filename)-suffix_len);
-		    fileroot[strlen(filename)-suffix_len] = '\0';
-		    }
-		*format = MBF_ASCIIXYT;
-		found = MB_YES;
-		}
-	    }
-
-	/* look for yxt sounding format convention */
-	if (found == MB_NO)
-	    {
-	    if (strlen(filename) >= 5)
-		i = strlen(filename) - 4;
-	    else
-		i = 0;
-	    if ((suffix = strstr(&filename[i],".yxt")) != NULL)
-		suffix_len = 4;
-	    else if ((suffix = strstr(&filename[i],".YXT")) != NULL)
-		suffix_len = 4;
-	    else
-		suffix_len = 0;
-	    if (suffix_len == 4)
-		{
-		if (fileroot != NULL)
-		    {
-		    strncpy(fileroot, filename, strlen(filename)-suffix_len);
-		    fileroot[strlen(filename)-suffix_len] = '\0';
-		    }
-		*format = MBF_ASCIIYXT;
-		found = MB_YES;
-		}
-	    }
-
-	/* look for binary HYDRO93 sounding format convention */
-	if (found == MB_NO)
-	    {
-	    if (strlen(filename) >= 5)
-		i = strlen(filename) - 4;
-	    else
-		i = 0;
-	    if ((suffix = strstr(&filename[i],".b93")) != NULL)
-		suffix_len = 4;
-	    else if ((suffix = strstr(&filename[i],".B93")) != NULL)
-		suffix_len = 4;
-	    else
-		suffix_len = 0;
-	    if (suffix_len == 4)
-		{
-		if (fileroot != NULL)
-		    {
-		    strncpy(fileroot, filename, strlen(filename)-suffix_len);
-		    fileroot[strlen(filename)-suffix_len] = '\0';
-		    }
-		*format = MBF_HYDROB93;
-		found = MB_YES;
-		}
-	    }
-
-	/* look for SIO SB2000 prefix convention */
-	if (found == MB_NO)
-	    {
-	    if (strlen(filename) > 6
-		&& strncmp(filename, "SSmed.", 6) == 0)
-		{
-		if (fileroot != NULL)
-		    {
-		    strcpy(fileroot, filename);
-		    }
-		*format = MBF_SB2000SS;
-		found = MB_YES;
-		}
-	    }
-
-	/* look for Marine Sonic MSTIFF format convention */
-	if (found == MB_NO)
-	    {
-	    if (strlen(filename) >= 5)
-		i = strlen(filename) - 4;
-	    else
-		i = 0;
-	    if ((suffix = strstr(&filename[i],".MST")) != NULL)
-		suffix_len = 4;
-	    else if ((suffix = strstr(&filename[i],".mst")) != NULL)
-		suffix_len = 4;
-	    else
-		suffix_len = 0;
-	    if (suffix_len == 4)
-		{
-		if (fileroot != NULL)
-		    {
-		    strncpy(fileroot, filename, strlen(filename)-suffix_len);
-		    fileroot[strlen(filename)-suffix_len] = '\0';
-		    }
-		*format = MBF_MSTIFFSS;
-		found = MB_YES;
-		}
-	    }
-
-	/* look for Edgetech Jstar format convention */
-	if (found == MB_NO)
-	    {
-	    if (strlen(filename) >= 5)
-		i = strlen(filename) - 4;
-	    else
-		i = 0;
-	    if ((suffix = strstr(&filename[i],".JSF")) != NULL)
-		suffix_len = 4;
-	    else if ((suffix = strstr(&filename[i],".jsf")) != NULL)
-		suffix_len = 4;
-	    else
-		suffix_len = 0;
-	    if (suffix_len == 4)
-		{
-		if (fileroot != NULL)
-		    {
-		    strncpy(fileroot, filename, strlen(filename)-suffix_len);
-		    fileroot[strlen(filename)-suffix_len] = '\0';
-		    }
-		*format = MBF_EDGJSTAR;
-		found = MB_YES;
-
-		/* examine the file to determine if sidescan data is
-			high frequency (*format = MBF_EDGJSTR2 = 133) rather than
-			low frequency (*format = MBF_EDGJSTAR = 132)
-			- if both low and high frequency are present treat format
-				as low frequency */
-		if ((checkfp = fopen(filename,"r")) != NULL)
-		    {
-		    /* loop over reading data until four full sidescan sonar records are read */
-		    done = MB_NO;
-		    nsonar = 0;
-		    nlow = 0;
-		    nhigh = 0;
-		    while (done == MB_NO)
-			{
-			/* read message header */
-			if (fread(buffer, MBSYS_JSTAR_MESSAGE_SIZE, 1, checkfp) == 1)
-			    {
-			    /* extract and check the subsystem value from the message header */
-			    subsystem = (int)((mb_u_char) buffer[7]);
-			    if (subsystem > 0)
-			    	{
-				nsonar++;
-				}
-			    if (subsystem == 20)
-			    	nlow++;
-			    if (subsystem == 21)
-			    	nhigh++;
-			    if (nsonar >= 4)
-			    	done = MB_YES;
-
-			    /* read and discard the rest of the record */
-			    if (done == MB_NO)
-			    	{
-				mb_get_binary_int(MB_YES, &buffer[12], &size);
-				for (i=0;i<size;i++)
-			    	    {
-				    if (fread(buffer, 1, 1, checkfp) != 1)
-					    done = MB_YES;
-				    }
-				}
-			    }
-
-			/* end of file */
-			else
-			    {
-			    done = MB_YES;
-			    }
-			}
-		    fclose(checkfp);
-		    if (nlow == 0 && nhigh > 0)
-			*format = MBF_EDGJSTR2;
-		    else
-			*format = MBF_EDGJSTAR;
-		    }
-		}
-	    }
-
-	/* look for HMRG MR1 and BS format conventions */
-	if (found == MB_NO)
-	    {
-	    if (strlen(filename) >= 6)
-		i = strlen(filename) - 5;
-	    else
-		i = 0;
-	    if ((suffix = strstr(&filename[i],".BTYW")) != NULL)
-		suffix_len = 5;
-	    else if ((suffix = strstr(&filename[i],".btyw")) != NULL)
-		suffix_len = 5;
-	    else
-		suffix_len = 0;
-	    if (suffix_len == 5)
-		{
-		if (fileroot != NULL)
-		    {
-		    strncpy(fileroot, filename, strlen(filename)-suffix_len);
-		    fileroot[strlen(filename)-suffix_len] = '\0';
-		    }
-		*format = MBF_MR1PRVR2;
-		found = MB_YES;
-		}
-	    }
-	if (found == MB_NO)
-	    {
-	    if (strlen(filename) >= 7)
-		i = strlen(filename) - 6;
-	    else
-		i = 0;
-	    if ((suffix = strstr(&filename[i],".BTYWT")) != NULL)
-		suffix_len = 6;
-	    else if ((suffix = strstr(&filename[i],".btywt")) != NULL)
-		suffix_len = 6;
-	    else
-		suffix_len = 0;
-	    if (suffix_len == 6)
-		{
-		if (fileroot != NULL)
-		    {
-		    strncpy(fileroot, filename, strlen(filename)-suffix_len);
-		    fileroot[strlen(filename)-suffix_len] = '\0';
-		    }
-		*format = MBF_MR1PRVR2;
-		found = MB_YES;
-		}
-	    }
-	if (found == MB_NO)
-	    {
-	    if (strlen(filename) >= 12)
-		i = strlen(filename) - 11;
-	    else
-		i = 0;
-	    if ((suffix = strstr(&filename[i],".BTYWT-DSAN")) != NULL)
-		suffix_len = 11;
-	    else if ((suffix = strstr(&filename[i],".btywt-dsan")) != NULL)
-		suffix_len = 11;
-	    else
-		suffix_len = 0;
-	    if (suffix_len == 11)
-		{
-		if (fileroot != NULL)
-		    {
-		    strncpy(fileroot, filename, strlen(filename)-suffix_len);
-		    fileroot[strlen(filename)-suffix_len] = '\0';
-		    }
-		*format = MBF_MR1PRVR2;
-		found = MB_YES;
-		}
-	    }
-	if (found == MB_NO)
-	    {
-	    if (strlen(filename) >= 7)
-		i = strlen(filename) - 6;
-	    else
-		i = 0;
-	    if ((suffix = strstr(&filename[i],".BSFIN")) != NULL)
-		suffix_len = 6;
-	    else if ((suffix = strstr(&filename[i],".bsfin")) != NULL)
-		suffix_len = 6;
-	    else
-		suffix_len = 0;
-	    if (suffix_len == 6)
-		{
-		if (fileroot != NULL)
-		    {
-		    strncpy(fileroot, filename, strlen(filename)-suffix_len);
-		    fileroot[strlen(filename)-suffix_len] = '\0';
-		    }
-		*format = MBF_MR1PRVR2;
-		found = MB_YES;
-		}
-	    }
-
-	/* look for a CARIS GSF export *.gsf format convention */
-	if (found == MB_NO)
-	    {
-	    if (strlen(filename) >= 5)
-		i = strlen(filename) - 4;
-	    else
-		i = 0;
-	    if ((suffix = strstr(&filename[i],".gsf")) != NULL)
-		suffix_len = 4;
-	    else if ((suffix = strstr(&filename[i],".GSF")) != NULL)
-		suffix_len = 4;
-	    else
-		suffix_len = 0;
-	    if (suffix_len == 4)
-		{
-		if (fileroot != NULL)
-		    {
-		    strncpy(fileroot, filename, strlen(filename)-suffix_len);
-		    fileroot[strlen(filename)-suffix_len] = '\0';
-		    }
-		*format = MBF_GSFGENMB;
-		found = MB_YES;
-		}
-	    }
-
-	/* look for a SAIC GSF *.d0X format convention */
-	if (found == MB_NO)
-	    {
-	    if (strlen(filename) >= 5)
-		i = strlen(filename) - 4;
-	    else
-		i = 0;
-	    if ((suffix = strstr(&filename[i],".d0")) != NULL)
-		suffix_len = 4;
-	    else
-		suffix_len = 0;
-	    if (suffix_len == 4)
-		{
-		if (fileroot != NULL)
-		    {
-		    strncpy(fileroot, filename, strlen(filename)-suffix_len);
-		    fileroot[strlen(filename)-suffix_len] = '\0';
-		    }
-		*format = MBF_GSFGENMB;
-		found = MB_YES;
-		}
-	    }
-
-	/* look for a Reson 7K multibeam *.s7k format convention */
-	if (found == MB_NO)
-	    {
-	    if (strlen(filename) >= 5)
-		i = strlen(filename) - 4;
-	    else
-		i = 0;
-	    if ((suffix = strstr(&filename[i],".s7k")) != NULL)
-		suffix_len = 4;
-	    else if ((suffix = strstr(&filename[i],".S7K")) != NULL)
-		suffix_len = 4;
-	    else if ((suffix = strstr(&filename[i],".7k")) != NULL)
-		suffix_len = 3;
-	    else if ((suffix = strstr(&filename[i],".7K")) != NULL)
-		suffix_len = 3;
-	    else
-		suffix_len = 0;
-	    if (suffix_len == 4 || suffix_len == 3)
-		{
-		if (fileroot != NULL)
-		    {
-		    strncpy(fileroot, filename, strlen(filename)-suffix_len);
-		    fileroot[strlen(filename)-suffix_len] = '\0';
-		    }
-		*format = MBF_RESON7KR;
-		found = MB_YES;
-		}
-	    }
-
-	/* look for a Imagex multibeam .83p format convention*/
-	if (found == MB_NO)
-	    {
-	    if (strlen(filename) >= 5)
-		i = strlen(filename) - 4;
-	    else
-		i = 0;
-	    if ((suffix = strstr(&filename[i],".83p")) != NULL)
-		suffix_len = 4;
-	    else if ((suffix = strstr(&filename[i],".83P")) != NULL)
-		suffix_len = 4;
-	    else
-		suffix_len = 0;
-	    if (suffix_len == 4)
-		{
-		if (fileroot != NULL)
-		    {
-		    strncpy(fileroot, filename, strlen(filename)-suffix_len);
-		    fileroot[strlen(filename)-suffix_len] = '\0';
-		    }
-		*format = MBF_IMAGE83P;
-		found = MB_YES;
-		}
-	    }
-
-	/* look for an R2R navigation format convention*/
-	if (found == MB_NO)
-	    {
-	    if (strlen(filename) >= 8)
-		i = strlen(filename) - 7;
-	    else
-		i = 0;
-	    if ((suffix = strstr(&filename[i],".r2rnav")) != NULL)
-		suffix_len = 7;
-	    else if ((suffix = strstr(&filename[i],".R2RNAV")) != NULL)
-		suffix_len = 7;
-	    else
-		suffix_len = 0;
-	    if (suffix_len == 7)
-		{
-		if (fileroot != NULL)
-		    {
-		    strncpy(fileroot, filename, strlen(filename)-suffix_len);
-		    fileroot[strlen(filename)-suffix_len] = '\0';
-		    }
-		*format = MBF_HIR2RNAV;
-		found = MB_YES;
-		}
-	    }
-
-	/* look for a HYSWEEP *.HSX file format convention*/
-	if (found == MB_NO)
-	    {
-	    if (strlen(filename) >= 5)
-		i = strlen(filename) - 4;
-	    else
-		i = 0;
-	    if ((suffix = strstr(&filename[i],".hsx")) != NULL)
-		suffix_len = 4;
-	    else if ((suffix = strstr(&filename[i],".HSX")) != NULL)
-		suffix_len = 4;
-	    else
-		suffix_len = 0;
-	    if (suffix_len == 4)
-		{
-		if (fileroot != NULL)
-		    {
-		    strncpy(fileroot, filename, strlen(filename)-suffix_len);
-		    fileroot[strlen(filename)-suffix_len] = '\0';
-		    }
-		*format = MBF_HYSWEEP1;
-		found = MB_YES;
-		}
-	    }
-
-	/* look for a SEA SWATHplus *.sxi file format convention*/
-	if (found == MB_NO)
-	    {
-	    if (strlen(filename) >= 5)
-		i = strlen(filename) - 4;
-	    else
-		i = 0;
-	    if ((suffix = strstr(&filename[i],".sxi")) != NULL)
-		suffix_len = 4;
-	    else if ((suffix = strstr(&filename[i],".SXI")) != NULL)
-		suffix_len = 4;
-	    else
-		suffix_len = 0;
-	    if (suffix_len == 4)
-		{
-		if (fileroot != NULL)
-		    {
-		    strncpy(fileroot, filename, strlen(filename)-suffix_len);
-		    fileroot[strlen(filename)-suffix_len] = '\0';
-		    }
-		*format = MBF_SWPLSSXI;
-		found = MB_YES;
-		}
-	    }
-
-	/* look for a SEA SWATHplus *.sxp file format convention*/
-	if (found == MB_NO)
-	    {
-	    if (strlen(filename) >= 5)
-		i = strlen(filename) - 4;
-	    else
-		i = 0;
-	    if ((suffix = strstr(&filename[i],".sxp")) != NULL)
-		suffix_len = 4;
-	    else if ((suffix = strstr(&filename[i],".SXP")) != NULL)
-		suffix_len = 4;
-	    else
-		suffix_len = 0;
-	    if (suffix_len == 4)
-		{
-		if (fileroot != NULL)
-		    {
-		    strncpy(fileroot, filename, strlen(filename)-suffix_len);
-		    fileroot[strlen(filename)-suffix_len] = '\0';
-		    }
-		*format = MBF_SWPLSSXP;
-		found = MB_YES;
-		}
-	    }
-
-	/* look for a 3DatDepth *.raa file format convention*/
-	if (found == MB_NO)
-	    {
-	    if (strlen(filename) >= 5)
-		i = strlen(filename) - 4;
-	    else
-		i = 0;
-	    if ((suffix = strstr(&filename[i],".raa")) != NULL)
-		suffix_len = 4;
-	    else if ((suffix = strstr(&filename[i],".RAA")) != NULL)
-		suffix_len = 4;
-	    else
-		suffix_len = 0;
-	    if (suffix_len == 4)
-		{
-		if (fileroot != NULL)
-		    {
-		    strncpy(fileroot, filename, strlen(filename)-suffix_len);
-		    fileroot[strlen(filename)-suffix_len] = '\0';
-		    }
-		*format = MBF_3DDEPTHP;
-		found = MB_YES;
-		}
-	    }
-
-	/* look for a WASSP *.000 file format convention*/
-	if (found == MB_NO)
-	    {
-	    if (strlen(filename) >= 5)
-		i = strlen(filename) - 4;
-	    else
-		i = 0;
-	    if ((suffix = strstr(&filename[i],".000")) != NULL)
-		suffix_len = 4;
-	    else
-		suffix_len = 0;
-	    if (suffix_len == 4)
-		{
-		if (fileroot != NULL)
-		    {
-		    strncpy(fileroot, filename, strlen(filename)-suffix_len);
-		    fileroot[strlen(filename)-suffix_len] = '\0';
-		    }
-		*format = MBF_WASSPENL;
-		found = MB_YES;
-		}
-	    }
-
-	/* look for a WASSP *.nwsf file format convention*/
-	if (found == MB_NO)
-	    {
-	    if (strlen(filename) >= 6)
-		i = strlen(filename) - 5;
-	    else
-		i = 0;
-	    if ((suffix = strstr(&filename[i],".nwsf")) != NULL)
-		suffix_len = 5;
-	    else
-		suffix_len = 0;
-	    if (suffix_len == 5)
-		{
-		if (fileroot != NULL)
-		    {
-		    strncpy(fileroot, filename, strlen(filename)-suffix_len);
-		    fileroot[strlen(filename)-suffix_len] = '\0';
-		    }
-		*format = MBF_WASSPENL;
-		found = MB_YES;
-		}
-	    }
-
-	/* finally check for parameter file */
-	sprintf(parfile, "%s.par", filename);
-	if (stat(parfile, &statbuf) == 0)
-	    {
-	    if ((checkfp = fopen(parfile,"r")) != NULL)
-		{
-		while ((result = fgets(buffer,MBP_FILENAMESIZE,checkfp)) == buffer)
-		    {
-		    if (buffer[0] != '#')
-			{
-			if (strlen(buffer) > 0)
-			    {
-			    if (buffer[strlen(buffer)-1] == '\n')
-				    buffer[strlen(buffer)-1] = '\0';
-			    }
-
-			if (strncmp(buffer, "FORMAT", 6) == 0)
-			    {
-			    sscanf(buffer, "%s %d", dummy, &pformat);
-			    if (pformat != 0)
-		    		{
-				*format = pformat;
-				if (found == MB_NO)
-				    {
-				    if (fileroot != NULL)
-					strcpy(fileroot, filename);
-				    found = MB_YES;
-				    }
-				}
-			    }
-			}
-		    }
-		fclose(checkfp);
-		}
-	    }
-
-	/* check for old format id and provide alias if needed */
-	if (found == MB_YES && *format > 0
-	    && (*format < 10 || *format == 44
-		|| *format == 52 || *format == 55))
-	    {
-	    /* replace original mbio id's */
-	    if (*format < 10)
-		i = format_alias_table[*format];
-
-	    /* handle incorrectly identified SeaBeam 2120 data */
-	    else if (*format == 44)
-		i = MBF_L3XSERAW;
-
-	    /* handle old Simrad EM12 and EM121 formats */
-	    else if (*format == 52 || *format == 55)
-		i = MBF_EMOLDRAW;
-
-	    /* print output debug statements */
-	    if (verbose >= 2)
-		    {
-		    fprintf(stderr,"\ndbg2  Old format id aliased to current value in MBIO function <%s>\n",
-			    function_name);
-		    fprintf(stderr,"dbg2  Old format value:\n");
-		    fprintf(stderr,"dbg2       format:     %d\n",*format);
-		    fprintf(stderr,"dbg2  Current format value:\n");
-		    fprintf(stderr,"dbg2       format:     %d\n",i);
-		    }
-
-	    /* set new format value */
-	    *format = i;
-	    }
-
-	/* set error if needed */
-	if (found == MB_NO)
-	    {
-	    *error = MB_ERROR_BAD_FORMAT;
-	    status = MB_FAILURE;
-	    *format = 0;
-	    if (fileroot != NULL)
-		    strcpy(fileroot, filename);
-	    }
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		if (fileroot != NULL)
-		    fprintf(stderr,"dbg2       fileroot:   %s\n",fileroot);
-		fprintf(stderr,"dbg2       format:     %d\n",*format);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_datalist_open(int verbose,
-		void **datalist,
-		char *path,
-		int look_processed, int *error)
-{
-	/* local variables */
-	char	*function_name = "mb_datalist_open";
-	int	status = MB_SUCCESS;
-	struct mb_datalist_struct *datalist_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       rcs_id:        %s\n",rcs_id);
-		fprintf(stderr,"dbg2       verbose:       %d\n",verbose);
-		fprintf(stderr,"dbg2       datalist:      %p\n",(void *)*datalist);
-		fprintf(stderr,"dbg2       path:          %s\n",path);
-		fprintf(stderr,"dbg2       look_processed:%d\n",look_processed);
-		}
-
-	/* allocate memory for datalist structure */
-	if ((status = mb_mallocd(verbose,__FILE__,__LINE__,sizeof(struct mb_datalist_struct),
-				datalist,error)) == MB_SUCCESS)
-		{
-		/* get datalist pointer */
-		datalist_ptr = (struct mb_datalist_struct *) *datalist;
-
-		if ((datalist_ptr->fp = fopen(path,"r")) == NULL)
-			{
-			mb_free(verbose,datalist,error);
-			status = MB_FAILURE;
-			*error = MB_ERROR_OPEN_FAIL;
-			}
-		else
-			{
-			strcpy(datalist_ptr->path,path);
-			datalist_ptr->open = MB_YES;
-			datalist_ptr->recursion = 0;
-			datalist_ptr->look_processed = look_processed;
-			datalist_ptr->local_weight = MB_YES;
-			datalist_ptr->weight_set = MB_NO;
-			datalist_ptr->weight = 0.0;
-			datalist_ptr->datalist = NULL;
-			}
-
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       datalist:      %p\n",(void *)*datalist);
-		if (*datalist != NULL)
-			{
-			fprintf(stderr,"dbg2       datalist->open:       %d\n",datalist_ptr->open);
-			fprintf(stderr,"dbg2       datalist->fp:         %p\n",(void *)datalist_ptr->fp);
-			fprintf(stderr,"dbg2       datalist->recursion:  %d\n",datalist_ptr->recursion);
-			fprintf(stderr,"dbg2       datalist->path:       %s\n",datalist_ptr->path);
-			fprintf(stderr,"dbg2       datalist->datalist:   %p\n",(void *)datalist_ptr->datalist);
-			}
-		fprintf(stderr,"dbg2       error:         %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:        %d\n",status);
-		}
-
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mb_datalist_close(int verbose,
-		void **datalist, int *error)
-{
-	/* local variables */
-	char	*function_name = "mb_datalist_close";
-	int	status = MB_SUCCESS;
-	struct mb_datalist_struct *datalist_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       rcs_id:        %s\n",rcs_id);
-		fprintf(stderr,"dbg2       verbose:       %d\n",verbose);
-		fprintf(stderr,"dbg2       datalist:      %p\n",(void *)*datalist);
-		}
-
-	/* close file */
-	if (*datalist != NULL)
-		{
-		/* get datalist pointer */
-		datalist_ptr = (struct mb_datalist_struct *) *datalist;
-
-		/* close file */
-		if (datalist_ptr->open == MB_YES)
-			{
-			fclose(datalist_ptr->fp);
-			}
-		}
-
-	/* deallocate structure */
-	if (*datalist != NULL)
-		{
-		status = mb_free(verbose,datalist,error);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       datalist:      %p\n",(void *)*datalist);
-		fprintf(stderr,"dbg2       error:         %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:        %d\n",status);
-		}
-
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mb_datalist_read(int verbose,
-		void *datalist,
-		char *path, int *format, double *weight,
-		int *error)
-{
-	/* local variables */
-	char	*function_name = "mb_datalist_read";
-	int	status = MB_SUCCESS;
-	struct mb_datalist_struct *datalist_ptr;
-	char	ppath[MB_PATH_MAXLINE];
-	int	pstatus;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       rcs_id:        %s\n",rcs_id);
-		fprintf(stderr,"dbg2       verbose:       %d\n",verbose);
-		fprintf(stderr,"dbg2       datalist:      %p\n",(void *)datalist);
-		}
-
-	/* get datalist pointer */
-	datalist_ptr = (struct mb_datalist_struct *) datalist;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       datalist_ptr->open:       %d\n",datalist_ptr->open);
-		fprintf(stderr,"dbg2       datalist_ptr->fp:         %p\n",(void *)datalist_ptr->fp);
-		fprintf(stderr,"dbg2       datalist_ptr->recursion:  %d\n",datalist_ptr->recursion);
-		fprintf(stderr,"dbg2       datalist_ptr->path:       %s\n",datalist_ptr->path);
-		fprintf(stderr,"dbg2       datalist_ptr->datalist:   %p\n",(void *)datalist_ptr->datalist);
-		fprintf(stderr,"dbg2       datalist_ptr->look_processed:   %d\n",datalist_ptr->look_processed);
-		}
-
-	/* call mb_datalist_read2() */
-	status = mb_datalist_read2(verbose, datalist, &pstatus, path, ppath, format, weight, error);
-
-	/* deal with pstatus */
-	if (status == MB_SUCCESS && *error == MB_ERROR_NO_ERROR)
-		{
-		if (pstatus == MB_PROCESSED_USE)
-			{
-			strcpy(path, ppath);
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       path:        %s\n",path);
-		fprintf(stderr,"dbg2       format:      %d\n",*format);
-		fprintf(stderr,"dbg2       weight:      %f\n",*weight);
-		fprintf(stderr,"dbg2       error:       %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mb_datalist_readorg(int verbose,
-		void *datalist,
-		char *path, int *format, double *weight,
-		int *error)
-{
-	/* local variables */
-	char	*function_name = "mb_datalist_readorg";
-	int	status = MB_SUCCESS;
-	struct mb_datalist_struct *datalist_ptr;
-	struct mb_datalist_struct *datalist2_ptr;
-	char	buffer[MB_PATH_MAXLINE];
-	char	root[MB_PATH_MAXLINE];
-	char	tmpstr[MB_PATH_MAXLINE];
-	char	pfile[MB_PATH_MAXLINE];
-	int	pfile_specified;
-	char	*buffer_ptr;
-	int	len;
-	int	nscan, done, rdone;
-	int	pformat;
-	struct stat file_status;
-	int	fstat, file_ok;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       rcs_id:        %s\n",rcs_id);
-		fprintf(stderr,"dbg2       verbose:       %d\n",verbose);
-		fprintf(stderr,"dbg2       datalist:      %p\n",(void *)datalist);
-		}
-
-	/* get datalist pointer */
-	datalist_ptr = (struct mb_datalist_struct *) datalist;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       datalist_ptr->open:       %d\n",datalist_ptr->open);
-		fprintf(stderr,"dbg2       datalist_ptr->fp:         %p\n",(void *)datalist_ptr->fp);
-		fprintf(stderr,"dbg2       datalist_ptr->recursion:  %d\n",datalist_ptr->recursion);
-		fprintf(stderr,"dbg2       datalist_ptr->path:       %s\n",datalist_ptr->path);
-		fprintf(stderr,"dbg2       datalist_ptr->datalist:   %p\n",(void *)datalist_ptr->datalist);
-		fprintf(stderr,"dbg2       datalist_ptr->look_processed:   %d\n",datalist_ptr->look_processed);
-		}
-
-	/* loop over reading from datalist_ptr */
-	done = MB_NO;
-	if (datalist_ptr->open == MB_YES
-		&& done == MB_NO)
-		{
-		while (done == MB_NO)
-		    {
-		    /* if recursive datalist closed read current datalist */
-		    if (datalist_ptr->datalist == NULL)
-			{
-			rdone = MB_NO;
-			while (rdone == MB_NO)
-			    {
-			    buffer_ptr = fgets(buffer,MB_PATH_MAXLINE,datalist_ptr->fp);
-
-			    /* deal with end of datalist file */
-			    if (buffer_ptr != buffer)
-				{
-				rdone = MB_YES;
-				done = MB_YES;
-				status = MB_FAILURE;
-				*error = MB_ERROR_EOF;
-				}
-
-			    /* look for special $PROCESSED command */
-			    else if (strncmp(buffer,"$PROCESSED",10) == 0)
-				{
-				if (datalist_ptr->look_processed
-						== MB_DATALIST_LOOK_UNSET)
-						datalist_ptr->look_processed = MB_DATALIST_LOOK_YES;
-				}
-
-			    /* look for special $RAW command */
-			    else if (strncmp(buffer,"$RAW",4) == 0)
-				{
-				if (datalist_ptr->look_processed
-						== MB_DATALIST_LOOK_UNSET)
-						datalist_ptr->look_processed = MB_DATALIST_LOOK_NO;
-				}
-
-			    /* look for special $NOLOCALWEIGHT command */
-			    else if (strncmp(buffer,"$NOLOCALWEIGHT",14) == 0)
-				{
-				datalist_ptr->local_weight = MB_NO;
-				}
-
-			    /* get filename */
-			    else if (buffer[0] != '#')
-				{
-				/* read datalist item */
-				nscan = sscanf(buffer,"%s %d %lf",path,format,weight);
-
-				/* get path */
-				if (nscan >= 1 && path[0] != '/'
-					&& strrchr(datalist_ptr->path,'/') != NULL
-					&& (len = strrchr(datalist_ptr->path,'/')
-						    - datalist_ptr->path + 1) > 1)
-				    {
-				    strcpy(tmpstr,path);
-				    strncpy(path,datalist_ptr->path,len);
-				    path[len] = '\0';
-				    strcat(path,tmpstr);
-				    }
-
-				/* guess format if no format specified */
-				if (nscan == 1)
-				    {
-				    fstat = mb_get_format(verbose, path, root, &pformat, error);
-
-				    /* if no format specified set it */
-				    if (nscan == 1 && pformat != 0)
-					    {
-					    nscan = 2;
-					    *format = pformat;
-					    }
-				    }
-
-				/* check for processed file if requested */
-				if (datalist_ptr->look_processed
-					== MB_DATALIST_LOOK_YES)
-				    {
-				    pfile[0] = '\0';
-				    mb_pr_get_ofile(verbose, path,
-					    &pfile_specified, pfile, error);
-				    if (strlen(pfile) > 0 && pfile[0] != '/'
-					    && strrchr(path,'/') != NULL
-					    && (len = strrchr(path,'/')
-							- path + 1) > 1)
-					{
-					strcpy(tmpstr,pfile);
-					strncpy(pfile,path,len);
-					pfile[len] = '\0';
-					strcat(pfile,tmpstr);
-					}
-
-				    if (pfile_specified == MB_YES)
-					{
-					if ((fstat = stat(pfile, &file_status)) == 0
-					    && (file_status.st_mode & S_IFMT) != S_IFDIR
-					    && file_status.st_size > 0)
-					    strcpy(path,pfile);
-					}
-				    }
-
-				/* check if file or datalist can be opened */
-				if (nscan >= 2)
-				    {
-				    fstat = stat(path, &file_status);
-				    if (fstat == 0
-						&& (file_status.st_mode & S_IFMT) != S_IFDIR
-						&& file_status.st_size > 0)
-						file_ok = MB_YES;
-				    else
-						{
-						file_ok = MB_NO;
-						/* print warning if verbose > 0 */
-						if (verbose > 0)
-					    	{
-					    	fprintf(stderr, "MBIO Warning: Datalist entry skipped because it could not be opened!\n");
-					    	fprintf(stderr, "\tDatalist: %s\n", datalist_ptr->path);
-					    	fprintf(stderr, "\tFile:     %s\n", path);
-					    	}
-						}
-				    }
-
-				/* set weight value - recursive weight from above
-				   overrides local weight as long as local_weight == MB_YES */
-				if (nscan >= 2 && file_ok == MB_YES)
-				    {
-				    /* use recursive weight from above unless prohibited */
-				    if (datalist_ptr->weight_set == MB_YES
-				    	&& (datalist_ptr->local_weight == MB_NO
-						|| nscan != 3))
-					*weight = datalist_ptr->weight;
-
-				    /* else if weight not locally specified set to 1.0 */
-				    else if (nscan != 3)
-					    *weight = 1.0;
-				    }
-
-				/* deal with file */
-				if (nscan >= 2 && file_ok == MB_YES && *format >= 0)
-				    {
-				    /* set done */
-				    done = MB_YES;
-				    rdone = MB_YES;
-				    }
-
-				/* deal with recursive datalist */
-				else if (nscan >= 2 && file_ok == MB_YES && *format == -1
-					&& datalist_ptr->recursion < MB_DATALIST_RECURSION_MAX)
-				    {
-				    if ((status = mb_datalist_open(verbose,
-						    (void **)&(datalist_ptr->datalist), path,
-							datalist_ptr->look_processed, error))
-					    == MB_SUCCESS)
-					{
-					datalist2_ptr = (struct mb_datalist_struct *) datalist_ptr->datalist;
-					datalist2_ptr->recursion =
-						datalist_ptr->recursion + 1;
-					datalist2_ptr->local_weight
-					    		= datalist_ptr->local_weight;
-					rdone = MB_YES;
-
-					/* set weight to recursive value if available */
-					if (nscan >= 3
-						&& (datalist_ptr->weight_set == MB_NO
-							|| datalist_ptr->local_weight == MB_YES))
-					    {
-					    datalist2_ptr->weight_set = MB_YES;
-					    datalist2_ptr->weight = *weight;
-					    }
-
-					else if (datalist_ptr->weight_set == MB_YES)
-					    {
-					    datalist2_ptr->weight_set = MB_YES;
-					    datalist2_ptr->weight = datalist_ptr->weight;
-					    }
-
-					/* else set weight to local value if available */
-					/* else do not set weight */
-					else
-					    {
-					    datalist2_ptr->weight_set = MB_NO;
-					    datalist2_ptr->weight = 0.0;
-					    }
-					}
-				    else
-					{
-					status = MB_SUCCESS;
-					*error = MB_ERROR_NO_ERROR;
-					}
-				    }
-				}
-			    }
-			}
-
-		    /* if open read next entry from recursive datalist */
-		    if (done == MB_NO
-			&& datalist_ptr->open == MB_YES
-			&& datalist_ptr->datalist != NULL)
-			{
-			datalist2_ptr = (struct mb_datalist_struct *) datalist_ptr->datalist;
-			if (datalist2_ptr->open == MB_YES)
-			    {
-			    /* recursively call mb_read_datalist */
-			    status = mb_datalist_read(verbose,
-					    (void *)datalist_ptr->datalist,
-					    path,
-					    format,
-					    weight,
-					    error);
-
-			    /* if datalist read fails close it */
-			    if (status == MB_FAILURE)
-				{
-				status = mb_datalist_close(verbose,
-					    (void **)&(datalist_ptr->datalist),
-					    error);
-				}
-			    else
-				{
-				done = MB_YES;
-				}
-			    }
-			}
-		    }
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       path:        %s\n",path);
-		fprintf(stderr,"dbg2       format:      %d\n",*format);
-		fprintf(stderr,"dbg2       weight:      %f\n",*weight);
-		fprintf(stderr,"dbg2       error:       %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_datalist_read2(int verbose,
-		void *datalist,
-		int *pstatus, char *path, char *ppath, int *format, double *weight,
-		int *error)
-{
-	/* local variables */
-	char	*function_name = "mb_datalist_read2";
-	int	status = MB_SUCCESS;
-	struct mb_datalist_struct *datalist_ptr;
-	struct mb_datalist_struct *datalist2_ptr;
-	char	buffer[MB_PATH_MAXLINE];
-	char	root[MB_PATH_MAXLINE];
-	char	tmpstr[MB_PATH_MAXLINE];
-	char	pfile[MB_PATH_MAXLINE];
-	int	pfile_specified;
-	char	*buffer_ptr;
-	int	len;
-	int	nscan, done, rdone;
-	int	pformat;
-	struct stat file_status;
-	int	fstat, file_ok;
-	int	rawspecified = MB_NO;
-	int	processedspecified = MB_NO;
-	int	istart;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       rcs_id:        %s\n",rcs_id);
-		fprintf(stderr,"dbg2       verbose:       %d\n",verbose);
-		fprintf(stderr,"dbg2       datalist:      %p\n",(void *)datalist);
-		}
-
-	/* get datalist pointer */
-	datalist_ptr = (struct mb_datalist_struct *) datalist;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       datalist_ptr->open:             %d\n",datalist_ptr->open);
-		fprintf(stderr,"dbg2       datalist_ptr->fp:               %p\n",(void *)datalist_ptr->fp);
-		fprintf(stderr,"dbg2       datalist_ptr->recursion:        %d\n",datalist_ptr->recursion);
-		fprintf(stderr,"dbg2       datalist_ptr->path:             %s\n",datalist_ptr->path);
-		fprintf(stderr,"dbg2       datalist_ptr->datalist:         %p\n",(void *)datalist_ptr->datalist);
-		fprintf(stderr,"dbg2       datalist_ptr->look_processed:   %d\n",datalist_ptr->look_processed);
-		}
-
-	/* loop over reading from datalist_ptr */
-	done = MB_NO;
-	if (datalist_ptr->open == MB_YES
-		&& done == MB_NO)
-		{
-		while (done == MB_NO)
-		    {
-		    /* if recursive datalist closed read current datalist */
-		    if (datalist_ptr->datalist == NULL)
-			{
-			rdone = MB_NO;
-			while (rdone == MB_NO)
-			    {
-			    buffer_ptr = fgets(buffer,MB_PATH_MAXLINE,datalist_ptr->fp);
-
-			    /* deal with end of datalist file */
-			    if (buffer_ptr != buffer)
-				{
-				rdone = MB_YES;
-				done = MB_YES;
-				*pstatus = MB_PROCESSED_NONE;
-				status = MB_FAILURE;
-				*error = MB_ERROR_EOF;
-				}
-
-			    /* look for special $PROCESSED command */
-			    else if (strncmp(buffer,"$PROCESSED",10) == 0)
-				{
-				if (datalist_ptr->look_processed
-						== MB_DATALIST_LOOK_UNSET)
-						datalist_ptr->look_processed = MB_DATALIST_LOOK_YES;
-				}
-
-			    /* look for special $RAW command */
-			    else if (strncmp(buffer,"$RAW",4) == 0)
-				{
-				if (datalist_ptr->look_processed
-						== MB_DATALIST_LOOK_UNSET)
-						datalist_ptr->look_processed = MB_DATALIST_LOOK_NO;
-				}
-
-			    /* look for special $NOLOCALWEIGHT command */
-			    else if (strncmp(buffer,"$NOLOCALWEIGHT",14) == 0)
-				{
-				datalist_ptr->local_weight = MB_NO;
-				}
-
-			    /* get filename */
-			    else if (buffer[0] != '#')
-				{
-				/* check for R: and P: prefixes on paths. If either prefix is found,
-					then the file path is for a raw file, and the R: or P: indicates
-					whether the raw or processed file should be used. These prefixes
-					override the datalist_ptr->look_processed value. In general these
-					prefixes are placed in datalists by mbgrid and mbmosaic to indicate
-					which file was used in gridding/mosaicing */
-				if (buffer[1] == ':')
-					{
-					if (strncmp(buffer, "R:", 2) == 0)
-						{
-						istart = 2;
-						rawspecified = MB_YES;
-						}
-					else if (strncmp(buffer, "P:", 2) == 0)
-						{
-						istart = 2;
-						processedspecified = MB_YES;
-						}
-					else
-						istart = 0;
-					}
-				else
-					istart = 0;
-
-				/* read datalist item */
-				nscan = sscanf(&(buffer[istart]),"%s %d %lf",path,format,weight);
-
-				/* get path */
-				if (nscan >= 1 && path[0] != '/'
-					&& strrchr(datalist_ptr->path,'/') != NULL
-					&& (len = strrchr(datalist_ptr->path,'/')
-						    - datalist_ptr->path + 1) > 1)
-				    {
-				    strcpy(tmpstr,path);
-				    strncpy(path,datalist_ptr->path,len);
-				    path[len] = '\0';
-				    strcat(path,tmpstr);
-				    }
-
-				/* guess format if no format specified */
-				if (nscan == 1)
-				    {
-				    fstat = mb_get_format(verbose, path, root, &pformat, error);
-
-				    /* if no format specified set it */
-				    if (nscan == 1 && pformat != 0)
-					    {
-					    nscan = 2;
-					    *format = pformat;
-					    }
-				    }
-
-				/* check if file or datalist can be opened */
-				if (nscan >= 2)
-				    {
-				    fstat = stat(path, &file_status);
-				    if (fstat == 0
-					    && (file_status.st_mode & S_IFMT) != S_IFDIR
-					    && file_status.st_size > 0)
-					    {
-					    file_ok = MB_YES;
-					    }
-				    else
-					    {
-					    file_ok = MB_NO;
-					    /* print warning if verbose > 0 */
-					    if (verbose > 0)
-						    {
-						    fprintf(stderr, "MBIO Warning: Datalist entry skipped because it could not be opened!\n");
-						    fprintf(stderr, "\tDatalist: %s\n", datalist_ptr->path);
-						    fprintf(stderr, "\tFile:     %s\n", path);
-						    }
-					    }
-				    }
-
-				/* check for processed file */
-				*pstatus = MB_PROCESSED_NONE;
-				pfile[0] = '\0';
-				if (file_ok == MB_YES)
-				    {
-				    mb_pr_get_ofile(verbose, path,
-					    &pfile_specified, pfile, error);
-				    if (strlen(pfile) > 0 && pfile[0] != '/'
-					    && strrchr(path,'/') != NULL
-					    && (len = strrchr(path,'/')
-							- path + 1) > 1)
-					{
-					strcpy(tmpstr,pfile);
-					strncpy(pfile,path,len);
-					pfile[len] = '\0';
-					strcat(pfile,tmpstr);
-					}
-
-				    if (pfile_specified == MB_YES)
-					{
-					if ((fstat = stat(pfile, &file_status)) == 0
-					    && (file_status.st_mode & S_IFMT) != S_IFDIR
-					    && file_status.st_size > 0)
-					    {
-					    strcpy(ppath,pfile);
-					    if (datalist_ptr->look_processed
-						== MB_DATALIST_LOOK_YES)
-						*pstatus = MB_PROCESSED_USE;
-					    else
-						*pstatus = MB_PROCESSED_EXIST;
-					    }
-					}
-
-				    /* apply processed or raw prefixes */
-				    if (*pstatus ==  MB_PROCESSED_EXIST
-				    		&& processedspecified == MB_YES)
-					*pstatus = MB_PROCESSED_USE;
-				    else if (*pstatus ==  MB_PROCESSED_USE
-				    		&& rawspecified == MB_YES)
-					*pstatus = MB_PROCESSED_EXIST;
-				    }
-
-				/* set weight value - recursive weight from above
-				   overrides local weight as long as local_weight == MB_YES */
-				if (nscan >= 2 && file_ok == MB_YES)
-				    {
-				    /* use recursive weight from above unless prohibited */
-				    if (datalist_ptr->weight_set == MB_YES
-				    	&& (datalist_ptr->local_weight == MB_NO
-						|| nscan != 3))
-					*weight = datalist_ptr->weight;
-
-				    /* else if weight not locally specified set to 1.0 */
-				    else if (nscan != 3)
-					    *weight = 1.0;
-				    }
-
-				/* deal with file */
-				if (nscan >= 2 && file_ok == MB_YES && *format >= 0)
-				    {
-				    /* set done */
-				    done = MB_YES;
-				    rdone = MB_YES;
-				    }
-
-				/* deal with recursive datalist */
-				else if (nscan >= 2 && file_ok == MB_YES && *format == -1
-					&& datalist_ptr->recursion < MB_DATALIST_RECURSION_MAX)
-				    {
-				    if ((status = mb_datalist_open(verbose,
-						    (void **)&(datalist_ptr->datalist), path,
-							datalist_ptr->look_processed, error))
-					    == MB_SUCCESS)
-					{
-					datalist2_ptr = (struct mb_datalist_struct *) datalist_ptr->datalist;
-					datalist2_ptr->recursion =
-						datalist_ptr->recursion + 1;
-					datalist2_ptr->local_weight
-					    		= datalist_ptr->local_weight;
-					rdone = MB_YES;
-
-					/* set weight to recursive value if available */
-					if (nscan >= 3
-						&& (datalist_ptr->weight_set == MB_NO
-							|| datalist_ptr->local_weight == MB_YES))
-					    {
-					    datalist2_ptr->weight_set = MB_YES;
-					    datalist2_ptr->weight = *weight;
-					    }
-
-					else if (datalist_ptr->weight_set == MB_YES)
-					    {
-					    datalist2_ptr->weight_set = MB_YES;
-					    datalist2_ptr->weight = datalist_ptr->weight;
-					    }
-
-					/* else set weight to local value if available */
-					/* else do not set weight */
-					else
-					    {
-					    datalist2_ptr->weight_set = MB_NO;
-					    datalist2_ptr->weight = 0.0;
-					    }
-					}
-				    else
-					{
-					status = MB_SUCCESS;
-					*error = MB_ERROR_NO_ERROR;
-					}
-				    }
-				}
-			    }
-			}
-
-		    /* if open read next entry from recursive datalist */
-		    if (done == MB_NO
-			&& datalist_ptr->open == MB_YES
-			&& datalist_ptr->datalist != NULL)
-			{
-			datalist2_ptr = (struct mb_datalist_struct *) datalist_ptr->datalist;
-			if (datalist2_ptr->open == MB_YES)
-			    {
-			    /* recursively call mb_read_datalist */
-			    status = mb_datalist_read2(verbose,
-					    (void *)datalist_ptr->datalist,
-					    pstatus,
-					    path,
-					    ppath,
-					    format,
-					    weight,
-					    error);
-
-			    /* if datalist read fails close it */
-			    if (status == MB_FAILURE)
-				{
-				status = mb_datalist_close(verbose,
-					    (void **)&(datalist_ptr->datalist),
-					    error);
-				}
-			    else
-				{
-				done = MB_YES;
-				}
-			    }
-			}
-		    }
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       pstatus      %d\n",*pstatus);
-		fprintf(stderr,"dbg2       path:        %s\n",path);
-		fprintf(stderr,"dbg2       ppath:       %s\n",ppath);
-		fprintf(stderr,"dbg2       format:      %d\n",*format);
-		fprintf(stderr,"dbg2       weight:      %f\n",*weight);
-		fprintf(stderr,"dbg2       error:       %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int cvt_to_nix_path(char *path)
-{
-	/* Replace back slashes by slashes and trim first two chars in paths like "C:/path" */
-	size_t k, len = strlen(path);
-	
-	if (len == 0) return(0);
-	for (k = 0; k < len; k++)
-		if (path[k] == '\\') path[k] = '/';
-
-	if (path[1] == ':')
-		{
-		for (k = 0; k < len - 2; k++)
-			path[k] = path[k + 2];
-		path[len - 2] = '\0';	/* Make sure it's null terminated */
-		}
-
-	return(0);
-}
-/*--------------------------------------------------------------------*/
-int mb_get_relative_path(int verbose,
-		char *path,
-		char *ipwd,
-		int *error)
-{
-	/* local variables */
-	char	*function_name = "mb_get_relative_path";
-	int	status = MB_SUCCESS;
-	char	relativepath[MB_PATH_MAXLINE] = {""};
-	char	pwd[MB_PATH_MAXLINE] = {""};
-	int	pathlen;
-	int	pwdlen;
-	int	same, isame, ndiff;
-	char	*bufptr;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       rcs_id:        %s\n",rcs_id);
-		fprintf(stderr,"dbg2       verbose:       %d\n",verbose);
-		fprintf(stderr,"dbg2       path:          %s\n",path);
-		fprintf(stderr,"dbg2       ipwd:          %s\n",ipwd);
-		}
-
-	/* get string lengths */
-	pathlen = strlen(path);
-	pwdlen = strlen(ipwd);
-
-#ifdef WIN32
-	/* The approximation here is to try to make a Windows path like a unix one and expect that
-	   the same algorithm still applies. Off course, there probably many ways this can go wrong
-	   because we trim the first 2 chars in strings like C:\blabla and don't put it back. But
-	   test have shown that it was maybe not necessary.
-	*/
-	cvt_to_nix_path(path);
-	cvt_to_nix_path(ipwd);
-#endif
-
-	/* if path doesn't start with '/' not an absolute path */
-	if (pathlen > 0 && path[0] != '/' )
-	    {
-	    strncpy(relativepath,path,MB_PATH_MAXLINE);
-	    bufptr = getcwd(path, MB_PATH_MAXLINE);
-#ifdef WIN32
-		cvt_to_nix_path(path);
-		cvt_to_nix_path(bufptr);
-#endif
-	    if (bufptr == NULL || strlen(path) + pathlen + 1 >= MB_PATH_MAXLINE)
-	        {
-	        strcpy(path,relativepath);
-		status = MB_FAILURE;
-		*error = MB_ERROR_BAD_PARAMETER;
-		}
-	    else
-	        {
-		strcat(path,"/");
-		   strcat(path,relativepath);
-		}
-	    }
-
-	/* if path doesn't start with '/' not an absolute path */
-	if (pwdlen == 0)
-	     pwd[0] = '\0';
-	else if (ipwd[0] == '/' )
-	     strncpy(pwd,ipwd,MB_PATH_MAXLINE);
-	else
-	    {
-	    bufptr = getcwd(pwd, MB_PATH_MAXLINE);
-#ifdef WIN32
-		cvt_to_nix_path(pwd);
-		cvt_to_nix_path(bufptr);
-#endif
-	    if (bufptr == NULL || strlen(pwd) + pwdlen + 1 >= MB_PATH_MAXLINE)
-	        {
-	        strncpy(pwd,ipwd,MB_PATH_MAXLINE);
-		status = MB_FAILURE;
-		*error = MB_ERROR_BAD_PARAMETER;
-		}
-	    else
-	        {
-		strcat(pwd,"/");
-		strcat(pwd,ipwd);
-		}
-	    }
-
-	mb_get_shortest_path(verbose,path,error);
-	mb_get_shortest_path(verbose,pwd,error);
-
-	pathlen = strlen(path);
-	pwdlen = strlen(pwd);
-
-	/* try to get best relative path */
-	if (pathlen > 0 && pwdlen > 0)
-	    {
-	    /* look for last identical slash-terminated section */
-	    same = MB_YES;
-	    isame = 0;
-	    for (i=0;i<MIN(pathlen, pwdlen) && same==MB_YES;i++)
-		{
-		if (path[i] == pwd[i])
-		    {
-		    if (path[i] == '/')
-			isame = i;
-		    else if (i == pwdlen - 1
-				&& pathlen > i
-				&& path[i+1] == '/')
-			isame = i + 1;
-		    }
-		else
-		    {
-		    same = MB_NO;
-		    }
-		}
-
-	    /* if more in common than first '/' look through pwd */
-	    if (isame > 0)
-		{
-		/* look for number of different directories in pwd */
-		ndiff = 0;
-		for (i=isame;i<pwdlen-1;i++)
-		    {
-		    if (pwd[i] == '/')
-			ndiff++;
-		    }
-
-		/* now make relative path if possible */
-		relativepath[0] = '\0';
-		for (i=0;i<ndiff;i++)
-		    {
-		    strcat(relativepath, "../");
-		    }
-		if (pathlen > isame + 1)
-		    strcat(relativepath, &path[isame+1]);
-
-		/* overwrite original path with relative path if possible */
-		if (strlen(relativepath) > 0)
-		    strcpy(path, relativepath);
-
-		status = MB_SUCCESS;
-		*error = MB_ERROR_NO_ERROR;
-		}
-
-	    /* else keep original path */
-	    else
-		{
-		status = MB_SUCCESS;
-		*error = MB_ERROR_NO_ERROR;
-		}
-	    }
-
-	/* no error even if no path or pwd */
-	else if (pathlen <= 0 || pwdlen <= 0)
-	    {
-	    status = MB_SUCCESS;
-	    *error = MB_ERROR_NO_ERROR;
-	    }
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       path:          %s\n",path);
-		fprintf(stderr,"dbg2       error:         %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_get_shortest_path(int verbose,
-		char *path,
-		int *error)
-{
-	/* local variables */
-	char	*function_name = "mb_get_shortest_path";
-	int	status = MB_SUCCESS;
-	char	tmppath[MB_PATH_MAXLINE];
-	char	lasttoken[MB_PATH_MAXLINE];
-	char	*result;
-	int	lasttokenordinary;
-	int	done, change;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       rcs_id:        %s\n",rcs_id);
-		fprintf(stderr,"dbg2       verbose:       %d\n",verbose);
-		fprintf(stderr,"dbg2       path:          %s\n",path);
-		}
-
-#ifdef WIN32
-	/* No path hammerings here. Too dangerous */
-	//return(status);
-#endif
-
-	/* loop until no changes are made */
-	done = MB_NO;
-	while (done == MB_NO)
-	    {
-	    /* set no change made */
-	    change = MB_NO;
-
-	    /* copy the path */
-	    strncpy(tmppath, path, MB_PATH_MAXLINE);
-
-	    /* step through path */
-	    path[0] = '\0';
-	    if (tmppath[0] == '/')
-		strcpy(path, "/");
-	    result = strtok(tmppath, "/");
-	    lasttokenordinary = MB_NO;
-	    while (result != NULL)
-		{
-		if (strcmp("..", result) == 0)
-		    {
-		    if (lasttokenordinary == MB_NO)
-			{
-			strcat(path, "../");
-			}
-		    else
-			{
-			change = MB_YES;
-			}
-		    lasttokenordinary = MB_NO;
-		    }
-		else if (strcmp(".", result) == 0)
-		     {
-		     }
-		else
-		    {
-		    if (lasttokenordinary == MB_YES)
-			{
-			strcat(path, lasttoken);
-			strcat(path, "/");
-			}
-		    lasttokenordinary = MB_YES;
-		    strcpy(lasttoken, result);
-		    }
-		result = strtok(NULL, "/");
-		}
-	    if (lasttokenordinary == MB_YES)
-		strcat(path, lasttoken);
-
-	    /* if change not made set done = MB_YES */
-	    if (change == MB_NO)
-		done = MB_YES;
-
-	    }
-
-	/* no error even if no path */
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       path:          %s\n",path);
-		fprintf(stderr,"dbg2       error:         %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-
-int mb_get_basename(int verbose,
-		char *path,
-		int *error)
-{
-	/* local variables */
-	char	*function_name = "mb_get_basename";
-	int	status = MB_SUCCESS;
-	char	tmppath[MB_PATH_MAXLINE];
-	char	*result;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       rcs_id:        %s\n",rcs_id);
-		fprintf(stderr,"dbg2       verbose:       %d\n",verbose);
-		fprintf(stderr,"dbg2       path:          %s\n",path);
-		}
-
-	/* copy the path */
-	strncpy(tmppath, path, MB_PATH_MAXLINE);
-
-	/* return everything after the last '/' */
-	result = strrchr(tmppath,'/');
-	if (result != NULL  && strlen(result) > 1)
-		strcpy(path,&result[1]);
-
-	/* remove .fbt .fnv .inf .esf suffix if present */
-	if (strlen(path) > 4)
-		{
-		i = strlen(path) - 4;
-		if ((result = strstr(&path[i],".fbt")) != NULL)
-			{
-			path[i] = '\0';
-			}
-		else if ((result = strstr(&path[i],".fnv")) != NULL)
-			{
-			path[i] = '\0';
-			}
-		else if ((result = strstr(&path[i],".inf")) != NULL)
-			{
-			path[i] = '\0';
-			}
-		else if ((result = strstr(&path[i],".esf")) != NULL)
-			{
-			path[i] = '\0';
-			}
-		}
-
-	/* no error even if no path */
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       path:          %s\n",path);
-		fprintf(stderr,"dbg2       error:         %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mb_format.h b/src/mbio/mb_format.h
deleted file mode 100644
index 845faf3..0000000
--- a/src/mbio/mb_format.h
+++ /dev/null
@@ -1,2039 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mb_format.h	1/19/93
- *    $Id: mb_format.h 2224 2015-02-04 19:14:05Z caress $
- *
- *    Copyright (c) 1993-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mb_format.h defines data format identifiers used by MBIO functions
- *
- * Author:	D. W. Caress
- * Date:	January 19, 1993
- *
- *
- */
-
-/* make sure mb_status.h has been included */
-#ifndef MB_STATUS_DEF
-#include "mb_status.h"
-#endif
-
-/* include this code only once */
-#ifndef MB_FORMAT_DEF
-#define MB_FORMAT_DEF
-
-/* define date of last format update */
-#define	MB_FORMAT_UPDATEDATE	"$Id: mb_format.h 2224 2015-02-04 19:14:05Z caress $ $Revision: $"
-
-/* Supported swath sonar systems */
-#define	MB_SYS_NONE		0
-#define	MB_SYS_SB		1
-#define	MB_SYS_HSDS		2
-#define	MB_SYS_SB2000		3
-#define	MB_SYS_SB2100		4
-#define	MB_SYS_SIMRAD		5
-#define	MB_SYS_SIMRAD2		6
-#define	MB_SYS_SIMRAD3		7
-#define	MB_SYS_MR1		8
-#define	MB_SYS_MR1B		9
-#define	MB_SYS_MR1V2001		10
-#define	MB_SYS_LDEOIH		11
-#define	MB_SYS_RESON		12
-#define	MB_SYS_RESON8K		13
-#define	MB_SYS_ELAC		14
-#define	MB_SYS_ELACMK2		15
-#define MB_SYS_HSMD		16
-#define MB_SYS_DSL		17
-#define MB_SYS_GSF		18
-#define MB_SYS_MSTIFF		19
-#define MB_SYS_OIC		20
-#define MB_SYS_HDCS		21
-#define MB_SYS_SINGLEBEAM	22
-#define MB_SYS_XSE		23
-#define MB_SYS_HS10		24
-#define	MB_SYS_NETCDF		25
-#define	MB_SYS_ATLAS		26
-#define	MB_SYS_NAVNETCDF	27
-#define	MB_SYS_SURF		28
-#define	MB_SYS_RESON7K		29
-#define	MB_SYS_JSTAR		30
-#define	MB_SYS_IMAGE83P		31
-#define	MB_SYS_HYSWEEP		32
-#define	MB_SYS_BENTHOS		33
-#define	MB_SYS_SWATHPLUS	34
-#define MB_SYS_3DATDEPTHLIDAR   35
-#define MB_SYS_WASSP            36
-#define MB_SYS_STEREOPAIR       37
-
-/* Number of supported MBIO data formats */
-#define	MB_FORMATS	77
-
-/* Data formats supported by MBIO */
-#define MBF_DATALIST	-1
-#define MBF_NONE	0
-#define	MBF_SBSIOMRG	11	/* SeaBeam, 16 beam, bathymetry,
- 					binary, uncentered, SIO. */
-#define	MBF_SBSIOCEN	12	/* SeaBeam, 19 beam, bathymetry,
- 					binary, centered, SIO. */
-#define	MBF_SBSIOLSI	13	/* SeaBeam, 19 beam, bathymetry,
- 					binary, centered, obsolete, SIO. */
-#define	MBF_SBURICEN	14	/* SeaBeam, 19 beam, bathymetry,
- 					binary, centered, URI. */
-#define	MBF_SBURIVAX	15	/* SeaBeam, 19 beam, bathymetry,
- 					binary, centered,
-					VAX byte order, URI. */
-#define	MBF_SBSIOSWB	16	/* SeaBeam, 19 beam, bathymetry,
- 					binary, centered,
-					swath-bathy, SIO. */
-#define	MBF_SBIFREMR	17	/* SeaBeam, 19 beam, bathymetry,
- 					ascii, centered,
-					sounding-oriented, IFREMER. */
-#define	MBF_HSATLRAW	21	/* Hydrosweep DS raw format, 59 beam,
- 					bathymetry and amplitude,
-  					ascii, Atlas Electronik. */
-#define	MBF_HSLDEDMB	22	/* Hydrosweep DS, 59 beam, bathymetry,
- 					binary, NRL. */
-#define	MBF_HSURICEN	23	/* Hydrosweep DS, 59 beam, bathymetry,
- 					binary, URI. */
-#define	MBF_HSLDEOIH	24	/* Hydrosweep DS in-house format, 59 beam,
- 					bathymetry and amplitude,
- 					binary, centered, L-DEO. */
-#define	MBF_HSURIVAX	25	/* Hydrosweep DS, 59 beam, bathymetry,
- 					binary, VAX byte order, URI. */
-#define	MBF_HSUNKNWN	26	/* Hydrosweep DS, 59 beam, bathymetry,
- 					bathymetry and amplitude,
-					ascii, unknown origin, SOPAC. */
-#define	MBF_SB2000RW	31	/* SeaBeam 2000 vender format,
-					151 beam bathymetry and amplitude,
-					2000 pixel sidescan, ascii + binary,
- 					SeaBeam Instruments. */
-#define	MBF_SB2000SB	32	/* SeaBeam 2000, 121 beam bathymetry,
-					binary, swath-bathy, SIO. */
-#define	MBF_SB2000SS	33	/* SeaBeam 2000, 1000 pixel sidescan,
-					binary, swath-bathy, SIO. */
-#define	MBF_SB2100RW	41	/* SeaBeam 2100 series vender format,
-					151 beam bathymetry and amplitude,
-					2000 pixel sidescan, ascii + binary,
-					centered, SeaBeam Instruments */
-#define	MBF_SB2100B1	42	/* SeaBeam 2100 series vendor format,
-					151 beam bathymetry and amplitude,
-					2000 pixel sidescan, binary, centered,
-					SeaBeam Instruments and L-DEO */
-#define	MBF_SB2100B2	43	/* SeaBeam 2100 series vendor format,
-					151 beam bathymetry and amplitude,
-					binary, centered,
-					SeaBeam Instruments and L-DEO */
-#define	MBF_EMOLDRAW	51	/* Old Simrad vendor multibeam format,
-					Simrad EM1000, EM12S, EM12D,
-					EM121 multibeam sonars,
-					bathymetry, amplitude, and sidescan,
-					60 beams for EM1000, 81 beams for EM12S/D,
-					121 beams for EM121, variable pixels,
-					ascii + binary, Simrad. */
-#define	MBF_EM12IFRM	53	/* Simrad EM12S/EM12D multibeam archive format,
-					81 beam bathymetry and
-					amplitude,
-					binary, read-only, IFREMER */
-#define	MBF_EM12DARW	54	/* Simrad EM12 RRS Darwin processed format,
-					81 beam, bathymetry and amplitude,
-					binary, centered, Oxford University */
-#define	MBF_EM300RAW	56	/* Simrad EM300/EM3000 multibeam vendor format,
-					up to 254 beam bathymetry and
-					amplitude, variable pixel sidescan,
-					ascii + binary, Simrad */
-#define	MBF_EM300MBA	57	/* Simrad EM300/EM3000 multibeam processing format,
-					up to 254 beam bathymetry and
-					amplitude, variable pixel sidescan,
-					ascii + binary, MBARI */
-#define	MBF_EM710RAW	58	/* Kongsberg EM122, EM302, EM710 multibeam vendor format,
-					up to 400 beam bathymetry and
-					amplitude, variable pixel sidescan,
-					binary, Kongsberg */
-#define	MBF_EM710MBA	59	/* Kongsberg EM122, EM302, EM710 multibeam processing format,
-					up to 400 beam bathymetry and
-					amplitude, variable pixel sidescan,
-					binary, MBARI */
-#define	MBF_MR1PRHIG	61	/* Obsolete MR1 post processed format,
-					variable beam bathymetry, variable
-					pixel sidescan, xdr binary, SOEST */
-#define	MBF_MR1ALDEO	62	/* MR1 Lamont format with travel times,
-					variable beam bathymetry, variable
-					pixel sidescan, xdr binary, L-DEO */
-#define	MBF_MR1BLDEO	63	/* MR1 small Lamont format with travel times,
-					variable beam bathymetry, variable
-					pixel sidescan, xdr binary, L-DEO */
-#define	MBF_MR1PRVR2	64	/* MR1 post processed format,
-					variable beam bathymetry, variable
-					pixel sidescan, xdr binary, SOEST */
-#define	MBF_MBLDEOIH	71	/* Generic in-house multibeam, variable beam,
- 					bathymetry, amplitude, and sidescan
- 					binary, centered, L-DEO. */
-#define	MBF_MBNETCDF	75	/* CARAIBES CDF multibeam, variable beam,
- 					netCDF, IFREMER. */
-#define	MBF_MBNCDFXT	76	/* CARAIBES CDF multibeam, variable beam,
- 					netCDF, IFREMER. - extended format */
-#define	MBF_CBAT9001	81	/* Reson SeaBat 9001 multibeam, 60 beams
- 					bathymetry and amplitude,
- 					binary, University of New Brunswick. */
-#define	MBF_CBAT8101	82	/* Reson SeaBat 8101 multibeam, 101 beams
- 					bathymetry and amplitude,
- 					binary, SeaBeam Instruments. */
-#define	MBF_HYPC8101	83	/* Reson SeaBat 8101 multibeam, 101 beams
- 					bathymetry,
- 					ASCII, read-only,
-					Coastal Oceanographics. */
-#define	MBF_XTFR8101	84	/* Reson SeaBat 8XXX multibeam, 250 beams
- 					bathymetry,
- 					binary, read-only,
-					Triton-Elics XTF format. */
-#define	MBF_RESONS8K	85	/* Reson SeaBat 8XXX multibeam, 250 beams
- 					bathymetry,
- 					binary, read-only,
-					Reson 6042 format. */
-#define	MBF_SBATPROC	86	/* Reson SeaBat 8XXX multibeam, 250 beams
- 					bathymetry,
- 					binary,
-					MBARI processing format. */
-#define MBF_RESON7KR	88	/* Reson 7K multibeam vendor format
-					Reson 7K series multibeam sonars,
-					bathymetry, amplitude, three channels sidescan, and subbottom
-					up to 254 beams, variable pixels, binary, Reson. */
-#define MBF_RESON7KP	89	/* MBARI processing format for Reson 7K multibeam data
-					Reson 7K series multibeam sonars,
-					bathymetry, amplitude, three channels sidescan, and subbottom
-					up to 254 beams, variable pixels, binary, Reson. */
-#define	MBF_BCHRTUNB	91	/* Elac BottomChart multibeam, 56 beams
- 					bathymetry and amplitude,
- 					binary, University of New Brunswick. */
-#define	MBF_ELMK2UNB	92	/* Elac BottomChart multibeam, 56 beams
- 					bathymetry and amplitude,
- 					binary, University of New Brunswick. */
-#define	MBF_BCHRXUNB	93	/* Elac BottomChart multibeam, 56 beams
- 					bathymetry and amplitude,
- 					binary, University of New Brunswick. */
-#define	MBF_L3XSERAW	94	/* ELAC/SeaBeam XSE vendor format
-					Bottomchart MkII 50 kHz and 180 kHz multibeam,
-					SeaBeam 2120 20 KHz multibeam,
-					bathymetry, amplitude and sidescan,
-					variable beams and pixels, binary,
-					L3 Communications (Elac Nautik
-					and SeaBeam Instruments). */
-#define MBF_HSMDARAW    101     /* Hydroseep MD multibeam raw format, 40 beam
-					bathymetry, 160 pixel sidescan,
-					xdr binary, Atlas Electronik. */
-#define MBF_HSMDLDIH    102     /* Hydroseep MD multibeam in-house format,
-					40 beam bathymetry, 160 pixel sidescan,
-					binary, L-DEO. */
-#define MBF_DSL120PF    111     /* WHOI DSL AMS-120 deep-tow,
-					2048 beam bathymetry, 2048 pixel sidescan,
-					binary, parallel files, WHOI DSL. */
-#define MBF_DSL120SF    112     /* WHOI DSL AMS-120 deep-tow,
-					2048 beam bathymetry, 2048 pixel sidescan,
-					binary, single files, WHOI DSL. */
-#define MBF_GSFGENMB    121     /* SAIC Generic Sensor Format (GSF),
-					variable beams,  bathymetry and amplitude,
-					binary, single files, SAIC. */
-#define MBF_MSTIFFSS    131     /* MSTIFF sidescan format,
-					variable pixels,  sidescan,
-					binary TIFF variant, single files, Sea Scan */
-#define MBF_EDGJSTAR    132     /* Edgetech Jstar format
-					variable pixels, dual frequency sidescan and subbottom,
-                      			binary SEGY variant, single files, low frequency sidescan
-					returned as survey data, Edgetech. */
-#define MBF_EDGJSTR2    133     /* Edgetech Jstar format
-					variable pixels, dual frequency sidescan and subbottom,
-                      			binary SEGY variant, single files, high frequency sidescan
-					returned as survey data, Edgetech. */
-#define MBF_OICGEODA    141     /* OIC swath sonar format, variable beam
-					bathymetry and amplitude, variable
-					pixel sidescan, binary, Oceanic Imaging
-					Consultants */
-#define MBF_OICMBARI    142     /* OIC-style extended swath sonar format, variable
-					beam bathymetry and amplitude, variable
-					pixel sidescan, binary, MBARI */
-#define MBF_OMGHDCSJ    151     /* UNB OMG HDCS format, variable
-					beam bathymetry and amplitude, variable
-					pixel sidescan, binary, UNB */
-#define MBF_SEGYSEGY    160     /* SEGY seismic or subbottom trace data,
-					single beam bathymetry, nav,
-					binary, SEG (SIOSEIS variant) */
-#define MBF_MGD77DAT    161     /* NGDC MGD77 underway geophysics format,
-					single beam bathymetry, nav, magnetics, gravity,
-					120 byte ascii records with no line breaks, NOAA NGDC */
-#define MBF_ASCIIXYZ    162     /* XYZ (lon lat depth) soundings, ascii, generic */
-#define MBF_ASCIIYXZ    163     /* YXZ (lat lon depth) soundings, ascii, generic */
-#define MBF_HYDROB93    164     /* NGDC hydrographic soundings, binary */
-#define MBF_MBARIROV    165     /* MBARI ROV navigation format, ascii, MBARI */
-#define MBF_MBPRONAV    166     /* MB-System simple navigation format, ascii, MBARI */
-#define MBF_NVNETCDF    167     /* CARAIBES CDF navigation, netCDF, IFREMER */
-#define MBF_ASCIIXYT    168     /* XYT (lon lat topography) soundings, ascii, generic */
-#define MBF_ASCIIYXT    169     /* YXT (lat lon topography) soundings, ascii, generic */
-#define MBF_MBARROV2    170     /* MBARI ROV navigation format, ascii, MBARI */
-#define MBF_HS10JAMS    171     /* Furuno HS10 multibeam format, 45 beams,
-					bathymetry and amplitude, ascii, JAMSTEC */
-#define MBF_HIR2RNAV    172     /* SIO GDC R2R navigation format, ascii, navigation, SIO */
-#define MBF_MGD77TXT    173     /* NGDC MGD77 underway geophysics format,
-					single beam bathymetry, nav, magnetics, gravity,
-					122 byte ascii records with CRLF line breaks, NOAA NGDC */
-#define MBF_MGD77TAB    174     /* NGDC MGD77T underway geophysics format,
-					single beam bathymetry, nav, magnetics, gravity,
-					tab delimited ascii records with CRLF line breaks, NOAA NGDC */
-#define MBF_SAMESURF    181     /* STN Atlas processing multibeam format,
-					Hydrosweep DS2, Hydrosweep MD,
-					Fansweep 10, Fansweep 20,
-					bathymetry, amplitude, and sidescan,
-					up to 1440 beams and 4096 pixels,
-					XDR binary, STN Atlas. */
-#define MBF_HSDS2RAW    182     /* STN Atlas raw multibeam format,
-					Hydrosweep DS2, Hydrosweep MD,
-					Fansweep 10, Fansweep 20,
-					bathymetry, amplitude, and sidescan,
-					up to 1440 beams and 4096 pixels,
-					XDR binary, STN Atlas. */
-#define MBF_HSDS2LAM    183     /* L-DEO HSDS2 processing format,
-					STN Atlas multibeam sonars,
-					Hydrosweep DS2, Hydrosweep MD,
-					Fansweep 10, Fansweep 20,
-					bathymetry, amplitude, and sidescan,
-					up to 1440 beams and 4096 pixels,
-					XDR binary, L-DEO. */
-#define MBF_IMAGE83P	191	/* Imagenex 83p vendor format for DeltaT multibeam
-					480 beams bathymetry */
-#define MBF_IMAGEMBA	192	/* MBARI processing format for DeltaT multibeam
-					480 beams bathymetry */
-#define MBF_HYSWEEP1	201	/* HYSWEEP format for multibeam data
-					variable beams,  bathymetry, amplitude, and sidescan,
-					ascii text, single files, Hypack. */
-#define MBF_XTFB1624	211	/* XTF format Benthos Sidescan SIS1624
-                                        variable pixels, dual frequency sidescan and subbottom,
-                                        xtf variant, single files,
-                                        low frequency sidescan returned as survey data, Benthos. */
-#define MBF_SWPLSSXI	221	/* SEA intermediate format for SWATHplus interferometric sonar,
-                                        variable beams, bathymetry, amplitude,
-                                        binary, single files, SEA. */
-#define MBF_SWPLSSXP	222	/* SEA processed format for SWATHplus interferometric sonar,
-                                        variable beams, bathymetry, amplitude,
-                                        binary, single files, SEA. */
-#define MBF_3DDEPTHP    231     /* 3DatDepth processed format for 3DatDepth LIDAR,
-                                        variable beams, bathymetry, amplitude,
-                                        binary, single files, 3DatDepth. */
-#define MBF_WASSPENL    241     /* WASSP Multibeam Vendor Format,
-                                        WASSP multibeams,
-                                        bathymetry and amplitude,
-                                        122 or 244 beams, binary, Electronic Navigation Ltd. */
-#define MBF_PHOTGRAM    251     /* Stereo Photogrammetry format,
-                                        stereo camera rigs,
-                                        bathymetry,
-                                        variable soundings, binary, MBARI. */
-
-/* format registration function prototypes */
-int mbr_register_sbsiomrg(int verbose, void *mbio_ptr, int *error);
-int mbr_register_sbsiocen(int verbose, void *mbio_ptr, int *error);
-int mbr_register_sbsiolsi(int verbose, void *mbio_ptr, int *error);
-int mbr_register_sburicen(int verbose, void *mbio_ptr, int *error);
-int mbr_register_sburivax(int verbose, void *mbio_ptr, int *error);
-int mbr_register_sbsioswb(int verbose, void *mbio_ptr, int *error);
-int mbr_register_sbifremr(int verbose, void *mbio_ptr, int *error);
-int mbr_register_hsldedmb(int verbose, void *mbio_ptr, int *error);
-int mbr_register_hsuricen(int verbose, void *mbio_ptr, int *error);
-int mbr_register_hsatlraw(int verbose, void *mbio_ptr, int *error);
-int mbr_register_hsldeoih(int verbose, void *mbio_ptr, int *error);
-int mbr_register_hsurivax(int verbose, void *mbio_ptr, int *error);
-int mbr_register_hsunknwn(int verbose, void *mbio_ptr, int *error);
-int mbr_register_sb2000sb(int verbose, void *mbio_ptr, int *error);
-int mbr_register_sb2000ss(int verbose, void *mbio_ptr, int *error);
-int mbr_register_sb2100rw(int verbose, void *mbio_ptr, int *error);
-int mbr_register_sb2100b1(int verbose, void *mbio_ptr, int *error);
-int mbr_register_sb2100b2(int verbose, void *mbio_ptr, int *error);
-int mbr_register_emoldraw(int verbose, void *mbio_ptr, int *error);
-int mbr_register_em12ifrm(int verbose, void *mbio_ptr, int *error);
-int mbr_register_em12darw(int verbose, void *mbio_ptr, int *error);
-int mbr_register_em300raw(int verbose, void *mbio_ptr, int *error);
-int mbr_register_em300mba(int verbose, void *mbio_ptr, int *error);
-int mbr_register_em710raw(int verbose, void *mbio_ptr, int *error);
-int mbr_register_em710mba(int verbose, void *mbio_ptr, int *error);
-int mbr_register_mr1prhig(int verbose, void *mbio_ptr, int *error);
-int mbr_register_mr1aldeo(int verbose, void *mbio_ptr, int *error);
-int mbr_register_mr1bldeo(int verbose, void *mbio_ptr, int *error);
-int mbr_register_mr1prvr2(int verbose, void *mbio_ptr, int *error);
-int mbr_register_mbldeoih(int verbose, void *mbio_ptr, int *error);
-int mbr_register_mbnetcdf(int verbose, void *mbio_ptr, int *error);
-int mbr_register_mbnetcdf(int verbose, void *mbio_ptr, int *error);
-int mbr_register_cbat9001(int verbose, void *mbio_ptr, int *error);
-int mbr_register_cbat8101(int verbose, void *mbio_ptr, int *error);
-int mbr_register_hypc8101(int verbose, void *mbio_ptr, int *error);
-int mbr_register_xtfr8101(int verbose, void *mbio_ptr, int *error);
-int mbr_register_reson7kr(int verbose, void *mbio_ptr, int *error);
-int mbr_register_bchrtunb(int verbose, void *mbio_ptr, int *error);
-int mbr_register_elmk2unb(int verbose, void *mbio_ptr, int *error);
-int mbr_register_bchrxunb(int verbose, void *mbio_ptr, int *error);
-int mbr_register_hsmdaraw(int verbose, void *mbio_ptr, int *error);
-int mbr_register_hsmdldih(int verbose, void *mbio_ptr, int *error);
-int mbr_register_dsl120pf(int verbose, void *mbio_ptr, int *error);
-int mbr_register_dsl120sf(int verbose, void *mbio_ptr, int *error);
-int mbr_register_gsfgenmb(int verbose, void *mbio_ptr, int *error);
-int mbr_register_mstiffss(int verbose, void *mbio_ptr, int *error);
-int mbr_register_edgjstar(int verbose, void *mbio_ptr, int *error);
-int mbr_register_edgjstr2(int verbose, void *mbio_ptr, int *error);
-int mbr_register_oicgeoda(int verbose, void *mbio_ptr, int *error);
-int mbr_register_oicmbari(int verbose, void *mbio_ptr, int *error);
-int mbr_register_omghdcsj(int verbose, void *mbio_ptr, int *error);
-int mbr_register_segysegy(int verbose, void *mbio_ptr, int *error);
-int mbr_register_mgd77dat(int verbose, void *mbio_ptr, int *error);
-int mbr_register_asciixyz(int verbose, void *mbio_ptr, int *error);
-int mbr_register_asciiyxz(int verbose, void *mbio_ptr, int *error);
-int mbr_register_hydrob93(int verbose, void *mbio_ptr, int *error);
-int mbr_register_hydrob93(int verbose, void *mbio_ptr, int *error);
-int mbr_register_mbarirov(int verbose, void *mbio_ptr, int *error);
-int mbr_register_mbarrov2(int verbose, void *mbio_ptr, int *error);
-int mbr_register_mbpronav(int verbose, void *mbio_ptr, int *error);
-int mbr_register_nvnetcdf(int verbose, void *mbio_ptr, int *error);
-int mbr_register_asciixyt(int verbose, void *mbio_ptr, int *error);
-int mbr_register_asciiyxt(int verbose, void *mbio_ptr, int *error);
-int mbr_register_l3xseraw(int verbose, void *mbio_ptr, int *error);
-int mbr_register_hs10jams(int verbose, void *mbio_ptr, int *error);
-int mbr_register_hsds2raw(int verbose, void *mbio_ptr, int *error);
-int mbr_register_hsds2lam(int verbose, void *mbio_ptr, int *error);
-int mbr_register_samesurf(int verbose, void *mbio_ptr, int *error);
-int mbr_register_image83p(int verbose, void *mbio_ptr, int *error);
-int mbr_register_imagemba(int verbose, void *mbio_ptr, int *error);
-int mbr_register_hir2rnav(int verbose, void *mbio_ptr, int *error);
-int mbr_register_hysweep1(int verbose, void *mbio_ptr, int *error);
-int mbr_register_xtfb1624(int verbose, void *mbio_ptr, int *error);
-int mbr_register_swplssxi(int verbose, void *mbio_ptr, int *error);
-int mbr_register_swplssxp(int verbose, void *mbio_ptr, int *error);
-int mbr_register_3ddepthp(int verbose, void *mbio_ptr, int *error);
-int mbr_register_wasspenl(int verbose, void *mbio_ptr, int *error);
-int mbr_register_mgd77txt(int verbose, void *mbio_ptr, int *error);
-int mbr_register_mgd77tab(int verbose, void *mbio_ptr, int *error);
-int mbr_register_photgram(int verbose, void *mbio_ptr, int *error);
-int mbr_info_sbsiomrg(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_info_sbsiocen(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_info_sbsiolsi(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_info_sburicen(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_info_sburivax(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_info_sbsioswb(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_info_sbifremr(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_info_hsldedmb(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_info_hsuricen(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_info_hsatlraw(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_info_hsldeoih(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_info_hsurivax(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_info_hsunknwn(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_info_sb2000sb(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_info_sb2000ss(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_info_sb2100rw(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_info_sb2100b1(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_info_sb2100b2(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_info_emoldraw(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_info_em12ifrm(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_info_em12darw(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_info_em300raw(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_info_em300mba(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_info_em710raw(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_info_em710mba(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_info_mr1prhig(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_info_mr1aldeo(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_info_mr1bldeo(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_info_mr1prvr2(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_info_mbldeoih(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_info_mbnetcdf(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_info_mbnetcdf(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_info_mbncdfxt(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_info_cbat9001(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_info_cbat8101(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_info_hypc8101(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_info_xtfr8101(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_info_reson7kr(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_info_bchrtunb(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_info_elmk2unb(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_info_bchrxunb(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_info_hsmdaraw(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_info_hsmdldih(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_info_dsl120pf(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_info_dsl120sf(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_info_gsfgenmb(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_info_mstiffss(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_info_edgjstar(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_info_edgjstr2(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_info_oicgeoda(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_info_oicmbari(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_info_omghdcsj(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_info_segysegy(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_info_mgd77dat(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_info_asciixyz(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_info_asciiyxz(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_info_hydrob93(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_info_hydrob93(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_info_mbarirov(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_info_mbarrov2(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_info_mbpronav(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_info_nvnetcdf(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_info_asciixyt(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_info_asciiyxt(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_info_l3xseraw(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_info_hs10jams(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_info_hsds2raw(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_info_hsds2lam(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_info_samesurf(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_info_image83p(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_info_imagemba(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_info_hir2rnav(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_info_hysweep1(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_info_xtfb1624(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_info_swplssxi(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_info_swplssxp(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_info_3ddepthp(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_info_wasspenl(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_info_mgd77txt(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_info_mgd77tab(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_info_photgram(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-/* end conditional include */
-#endif
diff --git a/src/mbio/mb_get.c b/src/mbio/mb_get.c
deleted file mode 100644
index b7a56ae..0000000
--- a/src/mbio/mb_get.c
+++ /dev/null
@@ -1,1056 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mb_get.c	1/26/93
- *    $Id: mb_get.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1993-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mb_get.c reads and averages multibeam data from a file
- * which has been initialized by mb_read_init(). Crosstrack distances
- * are not mapped into lon and lat.
- *
- * Author:	D. W. Caress
- * Date:	January 26, 1993
- *
- * $Log: mb_get.c,v $
- * Revision 5.7  2005/11/05 00:48:05  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.6  2004/04/27 01:46:13  caress
- * Various updates of April 26, 2004.
- *
- * Revision 5.5  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.4  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.3  2002/05/29 23:36:53  caress
- * Release 5.0.beta18
- *
- * Revision 5.2  2001/07/20 00:31:11  caress
- * Release 5.0.beta03
- *
- * Revision 5.1  2001/03/22 20:45:56  caress
- * Trying to make 5.0.beta0...
- *
- * Revision 5.0  2000/12/01  22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.11  2000/10/11  01:02:30  caress
- * Convert to ANSI C
- *
- * Revision 4.10  2000/09/30  06:26:58  caress
- * Snapshot for Dale.
- *
- * Revision 4.9  1999/08/08  04:12:45  caress
- * Added ELMK2XSE format.
- *
- * Revision 4.8  1998/10/05  17:46:15  caress
- * MB-System version 4.6beta
- *
- * Revision 4.7  1997/04/21  17:02:07  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.6  1996/04/22  13:21:19  caress
- * Now have DTR and MIN/MAX defines in mb_define.h
- *
- * Revision 4.6  1996/04/22  13:21:19  caress
- * Now have DTR and MIN/MAX defines in mb_define.h
- *
- * Revision 4.5  1996/04/22  10:57:09  caress
- * DTR define now in mb_io.h
- *
- * Revision 4.4  1995/04/06  15:03:23  caress
- * Reset mb_io_ptr->error_save to MB_ERROR_NO_ERROR after it is
- * used to fix bug where time gap errors were perpetuated after
- * they occurred.
- *
- * Revision 4.3  1995/03/06  19:38:54  caress
- * Changed include strings.h to string.h for POSIX compliance.
- *
- * Revision 4.2  1994/10/21  12:11:53  caress
- * Release V4.0
- *
- * Revision 4.1  1994/07/29  18:46:51  caress
- * Changes associated with supporting Lynx OS (byte swapped) and
- * using unix second time base (for time_d values).
- *
- * Revision 4.0  1994/03/06  00:01:56  caress
- * First cut at version 4.0
- *
- * Revision 4.4  1994/03/03  03:39:43  caress
- * Fixed copyright message.
- *
- * Revision 4.3  1994/02/23  00:32:27  caress
- * Fixed several debug messages plus a couple real bugs.
- *
- * Revision 4.2  1994/02/20  03:25:30  caress
- * Fixed a bunch of bad variable names.
- *
- * Revision 4.1  1994/02/20  01:32:49  caress
- * Changed some of the debug printing.
- *
- * Revision 4.0  1994/02/18  21:43:12  caress
- * First cut of new version.  Includes new handling of
- * sidescan and amplitude data.
- *
- * Revision 3.3  1993/06/09  08:14:25  caress
- * Some unknown minor change.
- *
- * Revision 3.2  1993/06/05  07:19:31  caress
- * Fixed heading averaging problem.
- *
- * Revision 3.1  1993/05/14  22:35:03  sohara
- * fixed rcs_id message
- *
- * Revision 3.0  1993/04/23  15:54:14  dale
- * Initial version
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mb_define.h"
-
-static char rcs_id[]="$Id: mb_get.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mb_get(int verbose, void *mbio_ptr, int *kind, int *pings,
-		int time_i[7], double *time_d,
-		double *navlon, double *navlat,
-		double *speed, double *heading,
-		double *distance, double *altitude, double *sonardepth,
-		int *nbath, int *namp, int *nss,
-		char *beamflag, double *bath, double *amp,
-		double *bathacrosstrack, double *bathalongtrack,
-		double *ss, double *ssacrosstrack, double *ssalongtrack,
-		char *comment, int *error)
-{
-	char	*function_name = "mb_get";
-	int	status;
-	struct mb_io_struct *mb_io_ptr;
-	char	*store_ptr;
-	int	i;
-	int	done;
-	int	reset_last;
-	double	mtodeglon, mtodeglat;
-	double	dx, dy;
-	double	delta_time;
-	double	headingx, headingy;
-	double	denom;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-	store_ptr = (char *) mb_io_ptr->store_data;
-
-	/* initialize binning values */
-	mb_io_ptr->pings_read = 0;
-	mb_io_ptr->pings_binned = 0;
-	mb_io_ptr->time_d = 0.0;
-	mb_io_ptr->lon = 0.0;
-	mb_io_ptr->lat = 0.0;
-	mb_io_ptr->speed = 0.0;
-	mb_io_ptr->heading = 0.0;
-	headingx = 0.0;
-	headingy = 0.0;
-	for (i=0;i<mb_io_ptr->beams_bath_max;i++)
-		{
-		mb_io_ptr->beamflag[i] = MB_FLAG_NULL;
-		mb_io_ptr->bath[i] = 0.0;
-		mb_io_ptr->bath_acrosstrack[i] = 0.0;
-		mb_io_ptr->bath_alongtrack[i] = 0.0;
-		mb_io_ptr->bath_num[i] = 0;
-		}
-	for (i=0;i<mb_io_ptr->beams_amp_max;i++)
-		{
-		mb_io_ptr->amp[i] = 0.0;
-		mb_io_ptr->amp_num[i] = 0;
-		}
-	for (i=0;i<mb_io_ptr->pixels_ss_max;i++)
-		{
-		mb_io_ptr->ss[i] = 0.0;
-		mb_io_ptr->ss_acrosstrack[i] = 0.0;
-		mb_io_ptr->ss_alongtrack[i] = 0.0;
-		mb_io_ptr->ss_num[i] = 0;
-		}
-
-	/* read the data */
-	done = MB_NO;
-	while (done == MB_NO)
-		{
-
-		/* print debug statements */
-		if (verbose >= 4)
-			{
-			fprintf(stderr,"\ndbg2  About to read ping in function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg2       need_new_ping: %d\n",
-				mb_io_ptr->need_new_ping);
-			fprintf(stderr,"dbg2       ping_count:    %d\n",
-				mb_io_ptr->ping_count);
-			fprintf(stderr,"dbg2       pings_read:    %d\n",
-				mb_io_ptr->pings_read);
-			fprintf(stderr,"dbg2       status:        %d\n",status);
-			fprintf(stderr,"dbg2       error:         %d\n",*error);
-			}
-
-		/* get next ping */
-		if (mb_io_ptr->need_new_ping)
-			{
-			status = mb_read_ping(verbose,mbio_ptr,store_ptr,
-						&mb_io_ptr->new_kind,error);
-
-			/* log errors */
-			if (*error < MB_ERROR_NO_ERROR)
-				mb_notice_log_error(verbose, mbio_ptr, *error);
-
-			/* if io arrays have been reallocated, update the
-				pointers of arrays passed into this function,
-				as these pointers may have changed */
-			if (status == MB_SUCCESS
-				&& mb_io_ptr->new_kind == MB_DATA_DATA)
-				{
-				if (mb_io_ptr->bath_arrays_reallocated == MB_YES)
-					{
-					status = mb_update_arrayptr(verbose, mbio_ptr, (void **) &beamflag, error);
-					status = mb_update_arrayptr(verbose, mbio_ptr, (void **) &bath, error);
-					status = mb_update_arrayptr(verbose, mbio_ptr, (void **) &bathacrosstrack, error);
-					status = mb_update_arrayptr(verbose, mbio_ptr, (void **) &bathalongtrack, error);
-					mb_io_ptr->bath_arrays_reallocated = MB_NO;
-					}
-				if (mb_io_ptr->amp_arrays_reallocated == MB_YES)
-					{
-					status = mb_update_arrayptr(verbose, mbio_ptr, (void **) &amp, error);
-					mb_io_ptr->amp_arrays_reallocated = MB_NO;
-					}
-				if (mb_io_ptr->ss_arrays_reallocated == MB_YES)
-					{
-					status = mb_update_arrayptr(verbose, mbio_ptr, (void **) &ss, error);
-					status = mb_update_arrayptr(verbose, mbio_ptr, (void **) &ssacrosstrack, error);
-					status = mb_update_arrayptr(verbose, mbio_ptr, (void **) &ssalongtrack, error);
-					mb_io_ptr->ss_arrays_reallocated = MB_NO;
-					}
-				}
-
-			/* if survey data read into storage array */
-			if (status == MB_SUCCESS
-				&& (mb_io_ptr->new_kind == MB_DATA_DATA
-				    || mb_io_ptr->new_kind == MB_DATA_COMMENT))
-				{
-				status = mb_extract(verbose,
-					mbio_ptr, store_ptr,
-					&mb_io_ptr->new_kind,
-					mb_io_ptr->new_time_i,
-					&mb_io_ptr->new_time_d,
-					&mb_io_ptr->new_lon,
-					&mb_io_ptr->new_lat,
-					&mb_io_ptr->new_speed,
-					&mb_io_ptr->new_heading,
-					&mb_io_ptr->new_beams_bath,
-					&mb_io_ptr->new_beams_amp,
-					&mb_io_ptr->new_pixels_ss,
-					mb_io_ptr->new_beamflag,
-					mb_io_ptr->new_bath,
-					mb_io_ptr->new_amp,
-					mb_io_ptr->new_bath_acrosstrack,
-					mb_io_ptr->new_bath_alongtrack,
-					mb_io_ptr->new_ss,
-					mb_io_ptr->new_ss_acrosstrack,
-					mb_io_ptr->new_ss_alongtrack,
-					mb_io_ptr->new_comment,
-					error);
-				}
-			if (status == MB_SUCCESS
-				&& mb_io_ptr->new_kind == MB_DATA_DATA)
-				{
-				status = mb_extract_altitude(verbose,
-					mbio_ptr, store_ptr,
-					&mb_io_ptr->new_kind,
-					sonardepth,
-					altitude,
-					error);
-				}
-
-			/* set errors if not survey data */
-			if (status == MB_SUCCESS)
-				{
-				mb_io_ptr->need_new_ping = MB_NO;
-				if (mb_io_ptr->new_kind == MB_DATA_DATA)
-					mb_io_ptr->ping_count++;
-				else if (mb_io_ptr->new_kind == MB_DATA_COMMENT)
-					{
-					mb_io_ptr->comment_count++;
-					status = MB_FAILURE;
-					*error = MB_ERROR_COMMENT;
-					mb_io_ptr->new_error = *error;
-					mb_notice_log_error(verbose, mbio_ptr, *error);
-					}
-				else if (mb_io_ptr->new_kind == MB_DATA_SUBBOTTOM_MCS
-					|| mb_io_ptr->new_kind == MB_DATA_SUBBOTTOM_CNTRBEAM
-					|| mb_io_ptr->new_kind == MB_DATA_SUBBOTTOM_SUBBOTTOM)
-					{
-					status = MB_FAILURE;
-					*error = MB_ERROR_SUBBOTTOM;
-					mb_io_ptr->new_error = *error;
-					mb_notice_log_error(verbose, mbio_ptr, *error);
-					}
-				else
-					{
-					status = MB_FAILURE;
-					*error = MB_ERROR_OTHER;
-					mb_io_ptr->new_error = *error;
-					mb_notice_log_error(verbose, mbio_ptr, *error);
-					}
-				}
-			}
-		else
-			{
-			*error = mb_io_ptr->new_error;
-			if (*error == MB_ERROR_NO_ERROR)
-				status = MB_SUCCESS;
-			else
-				status = MB_FAILURE;
-			}
-
-		/* if not a fatal error, increment ping counter */
-		if (status == MB_SUCCESS
-			&& mb_io_ptr->new_kind == MB_DATA_DATA)
-			mb_io_ptr->pings_read++;
-
-		/* if first ping read set "old" navigation values */
-		if (status == MB_SUCCESS
-			&& mb_io_ptr->new_kind == MB_DATA_DATA
-			&& mb_io_ptr->ping_count == 1)
-			{
-			mb_io_ptr->old_time_d = mb_io_ptr->new_time_d;
-			mb_io_ptr->old_lon = mb_io_ptr->new_lon;
-			mb_io_ptr->old_lat = mb_io_ptr->new_lat;
-			}
-
-		/* print debug statements */
-		if (verbose >= 4)
-			{
-			fprintf(stderr,"\ndbg2  New ping read in function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg2       need_new_ping: %d\n",
-				mb_io_ptr->need_new_ping);
-			fprintf(stderr,"dbg2       ping_count:    %d\n",
-				mb_io_ptr->ping_count);
-			fprintf(stderr,"dbg2       comment_count: %d\n",
-				mb_io_ptr->comment_count);
-			fprintf(stderr,"dbg2       pings_read:    %d\n",
-				mb_io_ptr->pings_read);
-			fprintf(stderr,"dbg2       status:        %d\n",
-				status);
-			fprintf(stderr,"dbg2       error:         %d\n",
-				*error);
-			fprintf(stderr,"dbg2       new_error:     %d\n",
-				mb_io_ptr->new_error);
-			}
-
-		/* check for out of location or time bounds */
-		if (status == MB_SUCCESS
-			&& mb_io_ptr->new_kind == MB_DATA_DATA)
-		{
-		if (mb_io_ptr->new_lon < mb_io_ptr->bounds[0]
-			|| mb_io_ptr->new_lon > mb_io_ptr->bounds[1]
-			|| mb_io_ptr->new_lat < mb_io_ptr->bounds[2]
-			|| mb_io_ptr->new_lat > mb_io_ptr->bounds[3])
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_OUT_BOUNDS;
-			mb_notice_log_error(verbose, mbio_ptr, *error);
-			}
-		else if (mb_io_ptr->etime_d > mb_io_ptr->btime_d
-			&& mb_io_ptr->new_time_d > MB_TIME_D_UNKNOWN
-			&& (mb_io_ptr->new_time_d > mb_io_ptr->etime_d
-				|| mb_io_ptr->new_time_d < mb_io_ptr->btime_d))
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_OUT_TIME;
-			mb_notice_log_error(verbose, mbio_ptr, *error);
-			}
-		else if (mb_io_ptr->etime_d < mb_io_ptr->btime_d
-			&& mb_io_ptr->new_time_d > MB_TIME_D_UNKNOWN
-			&& (mb_io_ptr->new_time_d > mb_io_ptr->etime_d
-				&& mb_io_ptr->new_time_d < mb_io_ptr->btime_d))
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_OUT_TIME;
-			mb_notice_log_error(verbose, mbio_ptr, *error);
-			}
-		}
-
-		/* check for time gap */
-		if (status == MB_SUCCESS
-			&& mb_io_ptr->new_time_d > MB_TIME_D_UNKNOWN
-			&& mb_io_ptr->new_kind == MB_DATA_DATA
-			&& mb_io_ptr->ping_count > 1)
-		{
-		if ((mb_io_ptr->new_time_d - mb_io_ptr->last_time_d)
-			> 60*mb_io_ptr->timegap)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_TIME_GAP;
-			mb_notice_log_error(verbose, mbio_ptr, *error);
-			}
-		}
-
-		/* log errors */
-		if (*error < MB_ERROR_NO_ERROR)
-			mb_notice_log_error(verbose, mbio_ptr, *error);
-
-		/* print debug statements */
-		if (verbose >= 4)
-			{
-			fprintf(stderr,"\ndbg4  New ping checked by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  New ping values:\n");
-			fprintf(stderr,"dbg4       ping_count:    %d\n",
-				mb_io_ptr->ping_count);
-			fprintf(stderr,"dbg4       comment_count: %d\n",
-				mb_io_ptr->comment_count);
-			fprintf(stderr,"dbg4       pings_avg:     %d\n",
-				mb_io_ptr->pings_avg);
-			fprintf(stderr,"dbg4       pings_read:    %d\n",
-				mb_io_ptr->pings_read);
-			fprintf(stderr,"dbg4       error:         %d\n",
-				mb_io_ptr->new_error);
-			fprintf(stderr,"dbg4       status:        %d\n",
-				status);
-			}
-		if (verbose >= 4
-			&& mb_io_ptr->new_kind == MB_DATA_COMMENT)
-			{
-			fprintf(stderr,"dbg4       comment:     \ndbg4       %s\n",
-				mb_io_ptr->new_comment);
-			}
-		else if (verbose >= 4
-			&& mb_io_ptr->new_kind == MB_DATA_DATA
-			&& *error <= MB_ERROR_NO_ERROR
-			&& *error > MB_ERROR_COMMENT)
-			{
-			fprintf(stderr,"dbg4       time_i[0]:     %d\n",
-				mb_io_ptr->new_time_i[0]);
-			fprintf(stderr,"dbg4       time_i[1]:     %d\n",
-				mb_io_ptr->new_time_i[1]);
-			fprintf(stderr,"dbg4       time_i[2]:     %d\n",
-				mb_io_ptr->new_time_i[2]);
-			fprintf(stderr,"dbg4       time_i[3]:     %d\n",
-				mb_io_ptr->new_time_i[3]);
-			fprintf(stderr,"dbg4       time_i[4]:     %d\n",
-				mb_io_ptr->new_time_i[4]);
-			fprintf(stderr,"dbg4       time_i[5]:     %d\n",
-				mb_io_ptr->new_time_i[5]);
-			fprintf(stderr,"dbg4       time_i[6]:     %d\n",
-				mb_io_ptr->new_time_i[6]);
-			fprintf(stderr,"dbg4       time_d:        %f\n",
-				mb_io_ptr->new_time_d);
-			fprintf(stderr,"dbg4       longitude:     %f\n",
-				mb_io_ptr->new_lon);
-			fprintf(stderr,"dbg4       latitude:      %f\n",
-				mb_io_ptr->new_lat);
-			fprintf(stderr,"dbg4       speed:         %f\n",
-				mb_io_ptr->new_speed);
-			fprintf(stderr,"dbg4       heading:       %f\n",
-				mb_io_ptr->new_heading);
-			fprintf(stderr,"dbg4       beams_bath:    %d\n",
-				mb_io_ptr->new_beams_bath);
-			if (mb_io_ptr->new_beams_bath > 0)
-			  {
-			  fprintf(stderr,"dbg4       beam   flag   bath  crosstrack alongtrack\n");
-			  for (i=0;i<mb_io_ptr->new_beams_bath;i++)
-			    fprintf(stderr,"dbg4       %4d   %3d    %f    %f     %f\n",
-				i,mb_io_ptr->new_beamflag[i],
-				mb_io_ptr->new_bath[i],
-				mb_io_ptr->new_bath_acrosstrack[i],
-				mb_io_ptr->new_bath_alongtrack[i]);
-			  }
-			fprintf(stderr,"dbg4       beams_amp:     %d\n",
-				mb_io_ptr->new_beams_amp);
-			if (mb_io_ptr->new_beams_amp > 0)
-			  {
-			  fprintf(stderr,"dbg4       beam    amp  crosstrack alongtrack\n");
-			  for (i=0;i<mb_io_ptr->new_beams_bath;i++)
-			    fprintf(stderr,"dbg4       %4d   %f    %f     %f\n",
-				i,mb_io_ptr->new_amp[i],
-				mb_io_ptr->new_bath_acrosstrack[i],
-				mb_io_ptr->new_bath_alongtrack[i]);
-			  }
-			fprintf(stderr,"dbg4       pixels_ss:     %d\n",
-				mb_io_ptr->new_pixels_ss);
-			if (mb_io_ptr->new_pixels_ss > 0)
-			  {
-			  fprintf(stderr,"dbg4       pixel sidescan crosstrack alongtrack\n");
-			  for (i=0;i<mb_io_ptr->new_pixels_ss;i++)
-			    fprintf(stderr,"dbg4       %4d   %f    %f     %f\n",
-				i,mb_io_ptr->new_ss[i],
-				mb_io_ptr->new_ss_acrosstrack[i],mb_io_ptr->new_ss_alongtrack[i]);
-			  }
-			}
-
-		/* now bin the data if appropriate */
-		if (mb_io_ptr->new_kind == MB_DATA_DATA &&
-
-			/* if data is ok */
-			(status == MB_SUCCESS
-
-			/* or if nonfatal error and only one ping read,
-				bin the ping */
-			|| (*error < MB_ERROR_NO_ERROR
-			&& *error > MB_ERROR_COMMENT
-			&& mb_io_ptr->pings_read == 1))
-			)
-
-			{
-			/* bin the values */
-			mb_io_ptr->pings_binned++;
-			mb_io_ptr->time_d = mb_io_ptr->time_d
-				+ mb_io_ptr->new_time_d;
-			mb_io_ptr->lon = mb_io_ptr->lon
-				+ mb_io_ptr->new_lon;
-			mb_io_ptr->lat = mb_io_ptr->lat
-				+ mb_io_ptr->new_lat;
-			mb_io_ptr->speed = mb_io_ptr->speed
-				+ mb_io_ptr->new_speed;
-			mb_io_ptr->heading = mb_io_ptr->heading
-				+ mb_io_ptr->new_heading;
-			headingx = headingx + sin(DTR*mb_io_ptr->new_heading);
-			headingy = headingy + cos(DTR*mb_io_ptr->new_heading);
-		        if (mb_io_ptr->pings == 1)
-			  {
-			  for (i=0;i<mb_io_ptr->new_beams_bath;i++)
-			    {
-			    mb_io_ptr->beamflag[i] = mb_io_ptr->new_beamflag[i];
-			    mb_io_ptr->bath[i] = mb_io_ptr->new_bath[i];
-			    mb_io_ptr->bath_acrosstrack[i] = mb_io_ptr->new_bath_acrosstrack[i];
-			    mb_io_ptr->bath_alongtrack[i] = mb_io_ptr->new_bath_alongtrack[i];
-			    mb_io_ptr->bath_num[i] = 1;
-			    }
-			  for (i=0;i<mb_io_ptr->new_beams_amp;i++)
-			    {
-			    mb_io_ptr->amp[i] = mb_io_ptr->new_amp[i];
-			    mb_io_ptr->amp_num[i] = 1;
-			    }
-			  for (i=0;i<mb_io_ptr->new_pixels_ss;i++)
-			    {
-			    mb_io_ptr->ss[i] = mb_io_ptr->new_ss[i];
-			    mb_io_ptr->ss_acrosstrack[i] = mb_io_ptr->new_ss_acrosstrack[i];
-			    mb_io_ptr->ss_alongtrack[i] = mb_io_ptr->new_ss_alongtrack[i];
-			    mb_io_ptr->ss_num[i] = 1;
-			    }
-			  }
-			else
-			  {
-			  for (i=0;i<mb_io_ptr->new_beams_bath;i++)
-			    {
-			    if (!mb_beam_check_flag(mb_io_ptr->new_beamflag[i]))
-			      {
-			      mb_io_ptr->beamflag[i] = MB_FLAG_NONE;
-			      mb_io_ptr->bath[i] = mb_io_ptr->bath[i]
-			                         + mb_io_ptr->new_bath[i];
-			      mb_io_ptr->bath_acrosstrack[i] = mb_io_ptr->bath_acrosstrack[i]
-			                         + mb_io_ptr->new_bath_acrosstrack[i];
-			      mb_io_ptr->bath_alongtrack[i] = mb_io_ptr->bath_alongtrack[i]
-			                         + mb_io_ptr->new_bath_alongtrack[i];
-			      mb_io_ptr->bath_num[i]++;
-			      }
-			    }
-			  for (i=0;i<mb_io_ptr->new_beams_amp;i++)
-			    {
-			    if (!mb_beam_check_flag(mb_io_ptr->new_beamflag[i]))
-			      {
-			      mb_io_ptr->amp[i] = mb_io_ptr->amp[i]
-						 + mb_io_ptr->new_amp[i];
-			      mb_io_ptr->amp_num[i]++;
-			      }
-			    }
-			  for (i=0;i<mb_io_ptr->new_pixels_ss;i++)
-			    {
-			    if (mb_io_ptr->new_ss[i] != 0.0)
-			      {
-			      mb_io_ptr->ss[i] = mb_io_ptr->ss[i]
-			                         + mb_io_ptr->new_ss[i];
-			      mb_io_ptr->ss_acrosstrack[i] = mb_io_ptr->ss_acrosstrack[i]
-			                         + mb_io_ptr->new_ss_acrosstrack[i];
-			      mb_io_ptr->ss_alongtrack[i] = mb_io_ptr->ss_alongtrack[i]
-			                         + mb_io_ptr->new_ss_alongtrack[i];
-			      mb_io_ptr->ss_num[i]++;
-			      }
-			    }
-			  }
-			}
-
-		/* print debug statements */
-		if (verbose >= 4
-			&& mb_io_ptr->new_kind == MB_DATA_DATA
-			&& (status == MB_SUCCESS
-			|| (*error < MB_ERROR_NO_ERROR
-			&& *error > MB_ERROR_COMMENT
-			&& mb_io_ptr->pings_read == 1)))
-			{
-			fprintf(stderr,"\ndbg4  New ping binned by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  Current binned ping values:\n");
-			fprintf(stderr,"dbg4       pings_binned: %d\n",
-				mb_io_ptr->pings_binned);
-			fprintf(stderr,"dbg4       time_d:       %f\n",
-				mb_io_ptr->time_d);
-			fprintf(stderr,"dbg4       longitude:    %f\n",
-				mb_io_ptr->lon);
-			fprintf(stderr,"dbg4       latitude:     %f\n",
-				mb_io_ptr->lat);
-			fprintf(stderr,"dbg4       speed:        %f\n",
-				mb_io_ptr->speed);
-			fprintf(stderr,"dbg4       heading:      %f\n",
-				mb_io_ptr->heading);
-			fprintf(stderr,"dbg4       beams_bath:    %d\n",
-				mb_io_ptr->beams_bath_max);
-			if (mb_io_ptr->beams_bath_max > 0)
-			  {
-			  fprintf(stderr,"dbg4       beam   nbath bath  crosstrack alongtrack\n");
-			  for (i=0;i<mb_io_ptr->beams_bath_max;i++)
-			    fprintf(stderr,"dbg4       %4d   %4d  %f    %f     %f\n",
-				i,mb_io_ptr->bath_num[i],mb_io_ptr->bath[i],
-				mb_io_ptr->bath_acrosstrack[i],
-				mb_io_ptr->bath_alongtrack[i]);
-			  }
-			fprintf(stderr,"dbg4       beams_amp:    %d\n",
-				mb_io_ptr->beams_amp_max);
-			if (mb_io_ptr->beams_amp_max > 0)
-			  {
-			  fprintf(stderr,"dbg4       beam    namp  amp  crosstrack alongtrack\n");
-			  for (i=0;i<mb_io_ptr->beams_amp_max;i++)
-			    fprintf(stderr,"dbg4       %4d   %4d  %f    %f     %f\n",
-				i,mb_io_ptr->amp_num[i],mb_io_ptr->amp[i],
-				mb_io_ptr->bath_acrosstrack[i],
-				mb_io_ptr->bath_alongtrack[i]);
-			  }
-			fprintf(stderr,"dbg4       pixels_ss:     %d\n",
-				mb_io_ptr->pixels_ss_max);
-			if (mb_io_ptr->pixels_ss_max > 0)
-			  {
-			  fprintf(stderr,"dbg4       pixel nss  sidescan crosstrack alongtrack\n");
-			  for (i=0;i<mb_io_ptr->pixels_ss_max;i++)
-			    fprintf(stderr,"dbg4       %4d   %4d   %f    %f     %f\n",
-				i,mb_io_ptr->ss_num[i],mb_io_ptr->ss[i],
-				mb_io_ptr->ss_acrosstrack[i],
-				mb_io_ptr->ss_alongtrack[i]);
-			  }
-			}
-
-		/* if data is ok but more pings needed keep reading */
-		if (status == MB_SUCCESS
-			&& mb_io_ptr->new_kind == MB_DATA_DATA
-			&& mb_io_ptr->pings_binned < mb_io_ptr->pings_avg)
-			{
-			done = MB_NO;
-			mb_io_ptr->need_new_ping = MB_YES;
-			reset_last = MB_YES;
-			}
-
-		/* if data is ok and enough pings binned then done */
-		else if (status == MB_SUCCESS
-			&& mb_io_ptr->new_kind == MB_DATA_DATA
-			&& mb_io_ptr->pings_binned >= mb_io_ptr->pings_avg)
-			{
-			done = MB_YES;
-			mb_io_ptr->need_new_ping = MB_YES;
-			reset_last = MB_YES;
-			}
-
-		/* if data gap and only one ping read and more
-			pings needed set error save flag and keep reading */
-		else if (*error == MB_ERROR_TIME_GAP
-			&& mb_io_ptr->new_kind == MB_DATA_DATA
-			&& mb_io_ptr->pings_read == 1
-			&& mb_io_ptr->pings_avg > 1)
-			{
-			done = MB_NO;
-			mb_io_ptr->need_new_ping = MB_YES;
-			mb_io_ptr->error_save = *error;
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			reset_last = MB_YES;
-			}
-
-		/* if other kind of data and need more pings
-			then keep reading */
-		else if ((*error == MB_ERROR_OTHER
-			|| *error == MB_ERROR_UNINTELLIGIBLE)
-			&& mb_io_ptr->pings_binned < mb_io_ptr->pings_avg)
-			{
-			done = MB_NO;
-			mb_io_ptr->need_new_ping = MB_YES;
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			reset_last = MB_NO;
-			}
-
-		/* if error and only one ping read then done */
-		else if (*error != MB_ERROR_NO_ERROR
-			&& mb_io_ptr->pings_read <= 1)
-			{
-			done = MB_YES;
-			mb_io_ptr->need_new_ping = MB_YES;
-			if (*error == MB_ERROR_TIME_GAP
-				|| *error == MB_ERROR_OUT_BOUNDS)
-				reset_last = MB_YES;
-			else
-				reset_last = MB_NO;
-			}
-
-		/* if error and more than one ping read,
-			then done but save the ping */
-		else if (*error != MB_ERROR_NO_ERROR)
-			{
-			done = MB_YES;
-			mb_io_ptr->need_new_ping = MB_NO;
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			reset_last = MB_NO;
-			}
-
-		/* if needed reset "last" pings */
-		if (reset_last == MB_YES)
-			{
-			mb_io_ptr->last_time_d = mb_io_ptr->new_time_d;
-			mb_io_ptr->last_lon = mb_io_ptr->new_lon;
-			mb_io_ptr->last_lat = mb_io_ptr->new_lat;
-			}
-
-		/* print debug statements */
-		if (verbose >= 4)
-			{
-			fprintf(stderr,"\ndbg4  End of reading loop in MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  Current status values:\n");
-			fprintf(stderr,"dbg4       done:          %d\n",done);
-			fprintf(stderr,"dbg4       need_new_ping: %d\n",
-					mb_io_ptr->need_new_ping);
-			fprintf(stderr,"dbg4       pings_binned:  %d\n",
-					mb_io_ptr->pings_binned);
-			fprintf(stderr,"dbg4       error:         %d\n",*error);			fprintf(stderr,"dbg4       status:        %d\n",status);
-			}
-		}
-
-	/* set output number of pings */
-	*pings = mb_io_ptr->pings_binned;
-
-	/* set data kind */
-	if (mb_io_ptr->pings_binned > 0)
-		*kind = MB_DATA_DATA;
-	else if (*error == MB_ERROR_COMMENT)
-		*kind = MB_DATA_COMMENT;
-	else
-		*kind = mb_io_ptr->new_kind;
-
-	/* get output time */
-	if (*error <= MB_ERROR_NO_ERROR
-		&& *error > MB_ERROR_COMMENT)
-		{
-		if (mb_io_ptr->pings_binned == 1)
-			{
-			for (i=0;i<7;i++)
-				time_i[i] = mb_io_ptr->new_time_i[i];
-			*time_d = mb_io_ptr->new_time_d;
-			}
-		else if (mb_io_ptr->pings_binned > 1)
-			{
-			*time_d = mb_io_ptr->time_d/mb_io_ptr->pings_binned;
-			mb_get_date(verbose,*time_d,time_i);
-			}
-		else
-			{
-			*error = MB_ERROR_NO_PINGS_BINNED;
-			mb_notice_log_error(verbose, mbio_ptr, *error);
-			}
-		}
-
-	/* get other output values */
-	if (*error <= MB_ERROR_NO_ERROR
-		&& *error > MB_ERROR_COMMENT)
-		{
-		/* get navigation values */
-		*navlon = mb_io_ptr->lon/mb_io_ptr->pings_binned;
-		*navlat = mb_io_ptr->lat/mb_io_ptr->pings_binned;
-		headingx = headingx/mb_io_ptr->pings_binned;
-		headingy = headingy/mb_io_ptr->pings_binned;
-		denom = sqrt(headingx*headingx + headingy*headingy);
-		if (denom > 0.0)
-			{
-			headingx = headingx/denom;
-			headingy = headingy/denom;
-			*heading = RTD*atan2(headingx,headingy);
-			}
-		else
-			*heading = mb_io_ptr->heading/mb_io_ptr->pings_binned;
-		if (*heading < 0.0)
-			*heading = *heading + 360.0;
-
-		/* get coordinate scaling */
-		mb_coor_scale(verbose,*navlat,&mtodeglon,&mtodeglat);
-
-		/* get distance value */
-		if (mb_io_ptr->old_time_d > 0.0)
-			{
-			dx = (*navlon - mb_io_ptr->old_lon)/mtodeglon;
-			dy = (*navlat - mb_io_ptr->old_lat)/mtodeglat;
-			*distance = 0.001*sqrt(dx*dx + dy*dy); /* km */
-			}
-		else
-			*distance = 0.0;
-
-		/* get speed value */
-		if (mb_io_ptr->speed > 0.0)
-			{
-			*speed = mb_io_ptr->speed/mb_io_ptr->pings_binned;
-			delta_time = 0.0;
-			}
-		else if (mb_io_ptr->old_time_d > 0.0)
-			{
-			delta_time = 0.000277778*
-				(*time_d - mb_io_ptr->old_time_d); /* hours */
-			if (delta_time > 0.0)
-				*speed = *distance/delta_time; /* km/hr */
-			else
-				*speed = 0.0;
-			}
-		else
-			*speed = 0.0;
-
-		/* check for less than minimum speed */
-		if (*error == MB_ERROR_NO_ERROR
-			|| *error == MB_ERROR_TIME_GAP)
-		{
-		if (mb_io_ptr->ping_count > 1
-			&& *time_d > MB_TIME_D_UNKNOWN
-			&& *speed < mb_io_ptr->speedmin)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_SPEED_TOO_SMALL;
-			mb_notice_log_error(verbose, mbio_ptr, *error);
-			}
-		}
-
-		/* print debug statements */
-		if (verbose >= 4)
-			{
-			fprintf(stderr,"\ndbg4  Distance and Speed Calculated in MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  Speed and Distance Related Values:\n");
-			fprintf(stderr,"dbg4       binned speed: %f\n",
-					mb_io_ptr->speed);
-			fprintf(stderr,"dbg4       pings_binned: %d\n",
-					mb_io_ptr->pings_binned);
-			fprintf(stderr,"dbg4       ping_count:   %d\n",
-					mb_io_ptr->ping_count);
-			fprintf(stderr,"dbg4       time:         %f\n",
-					*time_d);
-			fprintf(stderr,"dbg4       lon:          %f\n",
-					*navlon);
-			fprintf(stderr,"dbg4       lat:          %f\n",
-					*navlat);
-			fprintf(stderr,"dbg4       old time:     %f\n",
-					mb_io_ptr->old_time_d);
-			fprintf(stderr,"dbg4       old lon:      %f\n",
-					mb_io_ptr->old_lon);
-			fprintf(stderr,"dbg4       old lat:      %f\n",
-					mb_io_ptr->old_lat);
-			fprintf(stderr,"dbg4       distance:     %f\n",
-					*distance);
-			fprintf(stderr,"dbg4       altitude:     %f\n",
-					*altitude);
-			fprintf(stderr,"dbg4       sonardepth:   %f\n",
-					*sonardepth);
-			fprintf(stderr,"dbg4       delta_time:   %f\n",
-					delta_time);
-			fprintf(stderr,"dbg4       speed:        %f\n",
-					*speed);
-			fprintf(stderr,"dbg4       error:        %d\n",*error);
-			fprintf(stderr,"dbg4       status:       %d\n",status);
-			}
-
-		/* get swath data */
-		*nbath = 0;
-		*namp = 0;
-		*nss = 0;
-		for (i=0;i<mb_io_ptr->beams_bath_max;i++)
-			{
-			beamflag[i] = mb_io_ptr->beamflag[i];
-			if (mb_io_ptr->bath_num[i] > 0)
-				{
-				bath[i] = (mb_io_ptr->bath[i])
-					/(mb_io_ptr->bath_num[i]);
-				bathacrosstrack[i] = (mb_io_ptr->bath_acrosstrack[i])
-					/(mb_io_ptr->bath_num[i]);
-				bathalongtrack[i] = (mb_io_ptr->bath_alongtrack[i])
-					/(mb_io_ptr->bath_num[i]);
-				*nbath = i + 1;
-				}
-			else
-				{
-				beamflag[i] = MB_FLAG_NULL;
-				bath[i] = 0.0;
-				bathacrosstrack[i] = 0.0;
-				bathalongtrack[i] = 0.0;
-				}
-			}
-		for (i=0;i<mb_io_ptr->beams_amp_max;i++)
-			{
-			if (mb_io_ptr->amp_num[i] > 0)
-				{
-				amp[i] = (mb_io_ptr->amp[i])
-					/(mb_io_ptr->amp_num[i]);
-				*namp = i + 1;
-				}
-			else
-				{
-				amp[i] = 0.0;
-				}
-			}
-		for (i=0;i<mb_io_ptr->pixels_ss_max;i++)
-			{
-			if (mb_io_ptr->ss_num[i] > 0)
-				{
-				ss[i] = mb_io_ptr->ss[i]
-					/mb_io_ptr->ss_num[i];
-				ssacrosstrack[i] = mb_io_ptr->ss_acrosstrack[i]
-					/mb_io_ptr->ss_num[i];
-				ssalongtrack[i] = mb_io_ptr->ss_alongtrack[i]
-					/mb_io_ptr->ss_num[i];
-				*nss = i + 1;
-				}
-			else
-				{
-				ss[i] = 0.0;
-				ssacrosstrack[i] = 0.0;
-				ssalongtrack[i] = 0.0;
-				}
-			}
-		if (mb_io_ptr->variable_beams == MB_NO)
-			{
-			*nbath = mb_io_ptr->beams_bath_max;
-			*namp = mb_io_ptr->beams_amp_max;
-			*nss = mb_io_ptr->pixels_ss_max;
-			}
-		}
-
-	/* get output comment */
-	if (*error == MB_ERROR_COMMENT)
-		{
-		strcpy(comment,mb_io_ptr->new_comment);
-		}
-
-	/* reset "old" navigation values */
-	if (*error <= MB_ERROR_NO_ERROR
-		&& *error > MB_ERROR_COMMENT)
-		{
-		mb_io_ptr->old_time_d = *time_d;
-		mb_io_ptr->old_lon = *navlon;
-		mb_io_ptr->old_lat = *navlat;
-		}
-
-	/* get saved error flag if needed */
-	if (*error == MB_ERROR_NO_ERROR
-		&& mb_io_ptr->error_save != MB_ERROR_NO_ERROR)
-		{
-		*error = mb_io_ptr->error_save;
-		status = MB_FAILURE;
-		mb_io_ptr->error_save = MB_ERROR_NO_ERROR;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *kind == MB_DATA_DATA)
-		{
-		fprintf(stderr,"dbg2       pings:      %d\n",*pings);
-		fprintf(stderr,"dbg2       time_i[0]:  %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:  %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:  %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:  %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:  %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:  %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:  %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       navlon:     %f\n",*navlon);
-		fprintf(stderr,"dbg2       navlat:     %f\n",*navlat);
-		fprintf(stderr,"dbg2       speed:      %f\n",*speed);
-		fprintf(stderr,"dbg2       heading:    %f\n",*heading);
-		fprintf(stderr,"dbg2       distance:   %f\n",*distance);
-		fprintf(stderr,"dbg2       altitude:   %f\n",*altitude);
-		fprintf(stderr,"dbg2       sonardepth: %f\n",*sonardepth);
-		fprintf(stderr,"dbg2       nbath:      %d\n",*nbath);
-		if (verbose >= 3 && *nbath > 0)
-		  {
-		  fprintf(stderr,"dbg3       beam   nbath flag bath  crosstrack alongtrack\n");
-		  for (i=0;i<*nbath;i++)
-		    fprintf(stderr,"dbg3       %4d   %4d  %3d  %f    %f     %f\n",
-			i,mb_io_ptr->bath_num[i],beamflag[i],bath[i],
-			bathacrosstrack[i],bathalongtrack[i]);
-		  }
-		fprintf(stderr,"dbg2       namp:       %d\n",*namp);
-		if (verbose >= 3 && *namp > 0)
-		  {
-		  fprintf(stderr,"dbg3       beam    namp  amp  crosstrack alongtrack\n");
-		  for (i=0;i<*namp;i++)
-		    fprintf(stderr,"dbg3       %4d   %4d  %f    %f     %f\n",
-			i,mb_io_ptr->amp_num[i],amp[i],
-			bathacrosstrack[i],bathalongtrack[i]);
-		  }
-		fprintf(stderr,"dbg2       nss:      %d\n",*nss);
-		if (verbose >= 3 && *nss > 0)
-		  {
-		  fprintf(stderr,"dbg3       pixel nss  sidescan crosstrack alongtrack\n");
-		  for (i=0;i<*nss;i++)
-		    fprintf(stderr,"dbg3       %4d   %4d   %f    %f     %f\n",
-			i,mb_io_ptr->ss_num[i],ss[i],
-			ssacrosstrack[i],ssalongtrack[i]);
-		  }
-		}
-	else if (verbose >= 2 && *kind == MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"dbg2       comment:    %s\n",comment);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mb_get_all.c b/src/mbio/mb_get_all.c
deleted file mode 100644
index 7885937..0000000
--- a/src/mbio/mb_get_all.c
+++ /dev/null
@@ -1,691 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mb_get_all.c	1/26/93
- *    $Id: mb_get_all.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1993-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mb_get_all.c reads swath data from a file
- * which has been initialized by mb_read_init(). Crosstrack distances
- * are not mapped into lon and lat.  The data is not averaged, and
- * values are also read into a storage data structure including
- * all possible values output by the particular multibeam system
- * associated with the specified format.
- *
- * Author:	D. W. Caress
- * Date:	January 26, 1993
- *
- * $Log: mb_get_all.c,v $
- * Revision 5.10  2005/11/05 00:48:04  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.9  2004/12/02 06:33:30  caress
- * Fixes while supporting Reson 7k data.
- *
- * Revision 5.8  2004/04/27 01:46:12  caress
- * Various updates of April 26, 2004.
- *
- * Revision 5.7  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.6  2003/04/16 16:47:41  caress
- * Release 5.0.beta30
- *
- * Revision 5.5  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.4  2002/05/29 23:36:53  caress
- * Release 5.0.beta18
- *
- * Revision 5.3  2001/07/20 00:31:11  caress
- * Release 5.0.beta03
- *
- * Revision 5.2  2001/06/08  21:44:01  caress
- * Version 5.0.beta01
- *
- * Revision 5.1  2001/03/22  20:45:56  caress
- * Trying to make 5.0.beta0...
- *
- * Revision 5.0  2000/12/01  22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.12  2000/10/16  21:52:54  caress
- * No longer initializes some null arrays.
- *
- * Revision 4.11  2000/10/11  01:02:30  caress
- * Convert to ANSI C
- *
- * Revision 4.10  2000/09/30  06:26:58  caress
- * Snapshot for Dale.
- *
- * Revision 4.9  2000/07/19  03:28:02  caress
- * Fixed handling of some nonsurvey data records.
- *
- * Revision 4.8  1999/08/08  04:12:45  caress
- * Added ELMK2XSE format.
- *
- * Revision 4.7  1998/10/05  17:46:15  caress
- * MB-System version 4.6beta
- *
- * Revision 4.6  1997/04/21  17:02:07  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.5  1996/04/22  13:21:19  caress
- * Now have DTR and MIN/MAX defines in mb_define.h
- *
- * Revision 4.5  1996/04/22  13:21:19  caress
- * Now have DTR and MIN/MAX defines in mb_define.h
- *
- * Revision 4.4  1995/09/28  18:10:48  caress
- * Various bug fixes working toward release 4.3.
- *
- * Revision 4.3  1995/03/06  19:38:54  caress
- * Changed include strings.h to string.h for POSIX compliance.
- *
- * Revision 4.2  1994/10/21  12:11:53  caress
- * Release V4.0
- *
- * Revision 4.1  1994/07/29  18:46:51  caress
- * Changes associated with supporting Lynx OS (byte swapped) and
- * using unix second time base (for time_d values).
- *
- * Revision 4.0  1994/03/06  00:01:56  caress
- * First cut at version 4.0
- *
- * Revision 4.3  1994/03/03  03:39:43  caress
- * Fixed copyright message.
- *
- * Revision 4.2  1994/02/23  00:32:27  caress
- * Fixed several debug messages plus a couple real bugs.
- *
- * Revision 4.1  1994/02/20  03:37:05  caress
- * Fixed a number of bad variable names.
- *
- * Revision 4.0  1994/02/20  01:50:47  caress
- * First cut of new version.  Includes new handling of
- * sidescan and amplitude data.
- *
- * Revision 3.1  1993/05/14  22:35:26  sohara
- * fixed rcs_id message
- *
- * Revision 3.0  1993/04/23  15:57:18  dale
- * Initial version
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mb_define.h"
-
-static char rcs_id[]="$Id: mb_get_all.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mb_get_all(int verbose, void *mbio_ptr, void **store_ptr, int *kind,
-		int time_i[7], double *time_d,
-		double *navlon, double *navlat,
-		double *speed, double *heading,
-		double *distance, double *altitude, double *sonardepth,
-		int *nbath, int *namp, int *nss,
-		char *beamflag, double *bath, double *amp,
-		double *bathacrosstrack, double *bathalongtrack,
-		double *ss, double *ssacrosstrack, double *ssalongtrack,
-		char *comment, int *error)
-{
-	char	*function_name = "mb_get_all";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	int	i;
-	double	mtodeglon, mtodeglat;
-	double	dx, dy;
-	double	delta_time;
-	double	roll, pitch, heave;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		}
-
-	/* get mbio and data structure descriptors */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-	*store_ptr = mb_io_ptr->store_data;
-
-	/* reset status */
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-
-	/* print debug statements */
-	if (verbose >= 4)
-		{
-		fprintf(stderr,"\ndbg2  About to read ping in function <%s>\n",
-			function_name);
-		fprintf(stderr,"dbg2       ping_count:    %d\n",
-			mb_io_ptr->ping_count);
-		fprintf(stderr,"dbg2       status:        %d\n",status);
-		fprintf(stderr,"dbg2       error:         %d\n",*error);
-		}
-
-	/* get next ping */
-	status = mb_read_ping(verbose,mbio_ptr,*store_ptr,kind,error);
-
-	/* if io arrays have been reallocated, update the
-		pointers of arrays passed into this function,
-		as these pointers may have changed */
-	if (status == MB_SUCCESS
-		&& mb_io_ptr->new_kind == MB_DATA_DATA)
-		{
-		if (mb_io_ptr->bath_arrays_reallocated == MB_YES)
-			{
-			status = mb_update_arrayptr(verbose, mbio_ptr, (void **) &beamflag, error);
-			status = mb_update_arrayptr(verbose, mbio_ptr, (void **) &bath, error);
-			status = mb_update_arrayptr(verbose, mbio_ptr, (void **) &bathacrosstrack, error);
-			status = mb_update_arrayptr(verbose, mbio_ptr, (void **) &bathalongtrack, error);
-			mb_io_ptr->bath_arrays_reallocated = MB_NO;
-			}
-		if (mb_io_ptr->amp_arrays_reallocated == MB_YES)
-			{
-			status = mb_update_arrayptr(verbose, mbio_ptr, (void **) &amp, error);
-			mb_io_ptr->amp_arrays_reallocated = MB_NO;
-			}
-		if (mb_io_ptr->ss_arrays_reallocated == MB_YES)
-			{
-			status = mb_update_arrayptr(verbose, mbio_ptr, (void **) &ss, error);
-			status = mb_update_arrayptr(verbose, mbio_ptr, (void **) &ssacrosstrack, error);
-			status = mb_update_arrayptr(verbose, mbio_ptr, (void **) &ssalongtrack, error);
-			mb_io_ptr->ss_arrays_reallocated = MB_NO;
-			}
-		}
-
-	/* if survey data read into storage array */
-	if (status == MB_SUCCESS
-		&& (*kind == MB_DATA_DATA
-			|| *kind == MB_DATA_SUBBOTTOM_MCS
-			|| *kind == MB_DATA_SUBBOTTOM_CNTRBEAM
-			|| *kind == MB_DATA_SUBBOTTOM_SUBBOTTOM
-			|| *kind == MB_DATA_SIDESCAN2
-			|| *kind == MB_DATA_SIDESCAN3
-			|| *kind == MB_DATA_WATER_COLUMN
-			|| *kind == MB_DATA_NAV
-			|| *kind == MB_DATA_NAV1
-			|| *kind == MB_DATA_NAV2
-			|| *kind == MB_DATA_NAV3
-			|| *kind == MB_DATA_COMMENT))
-		{
-		/* initialize return values */
-		*kind = MB_DATA_NONE;
-		for (i=0;i<7;i++)
-			time_i[i] = 0;
-		*time_d = 0.0;
-		*navlon = 0.0;
-		*navlat = 0.0;
-		*speed = 0.0;
-		*heading = 0.0;
-		*nbath = 0;
-		*namp = 0;
-		*nss = 0;
-		for (i=0;i<mb_io_ptr->beams_bath_max;i++)
-			{
-			beamflag[i] = mb_beam_set_flag_null(beamflag[i]);
-			bath[i] = 0.0;
-			bathacrosstrack[i] = 0.0;
-			bathalongtrack[i] = 0.0;
-			}
-		for (i=0;i<mb_io_ptr->beams_amp_max;i++)
-			{
-			amp[i] = 0.0;
-			}
-		for (i=0;i<mb_io_ptr->pixels_ss_max;i++)
-			{
-			ss[i] = 0.0;
-			ssacrosstrack[i] = 0.0;
-			ssalongtrack[i] = 0.0;
-			}
-		strcpy(comment,"\0");
-
-		/* get the data */
-		status = mb_extract(verbose,
-			mbio_ptr, *store_ptr, kind,
-			time_i, time_d,
-			navlon, navlat, speed, heading,
-			nbath, namp, nss,
-			beamflag, bath, amp, bathacrosstrack, bathalongtrack,
-			ss, ssacrosstrack, ssalongtrack,
-			comment, error);
-		if (status == MB_SUCCESS
-			&& (*kind == MB_DATA_DATA
-				|| *kind == MB_DATA_CALIBRATE
-				|| *kind == MB_DATA_SUBBOTTOM_MCS
-				|| *kind == MB_DATA_SUBBOTTOM_CNTRBEAM
-				|| *kind == MB_DATA_SUBBOTTOM_SUBBOTTOM
-				|| *kind == MB_DATA_SIDESCAN2
-				|| *kind == MB_DATA_SIDESCAN3
-				|| *kind == MB_DATA_WATER_COLUMN))
-			{
-			status = mb_extract_altitude(verbose,
-				mbio_ptr, *store_ptr,
-				kind,
-				sonardepth,
-				altitude,
-				error);
-			}
-		if (status == MB_SUCCESS
-			&& (*kind == MB_DATA_NAV
-				|| *kind == MB_DATA_NAV1
-				|| *kind == MB_DATA_NAV2
-				|| *kind == MB_DATA_NAV3))
-			{
-			status = mb_extract_nav(verbose,
-				mbio_ptr, *store_ptr, kind,
-				time_i, time_d,
-				navlon, navlat, speed, heading,
-				sonardepth, &roll, &pitch, &heave,
-				error);
-			}
-		}
-
-	/* print debug statements */
-	if (verbose >= 4)
-		{
-		fprintf(stderr,"\ndbg2  New ping read in function <%s>\n",
-			function_name);
-		fprintf(stderr,"dbg2       status:        %d\n",
-			status);
-		fprintf(stderr,"dbg2       error:         %d\n",
-			*error);
-		fprintf(stderr,"dbg2       kind:          %d\n",
-			mb_io_ptr->new_kind);
-		}
-
-	/* increment counters */
-	if (status == MB_SUCCESS)
-		{
-		if (*kind == MB_DATA_DATA)
-			mb_io_ptr->ping_count++;
-		else if (*kind == MB_DATA_NAV)
-			mb_io_ptr->nav_count++;
-		else if (*kind == MB_DATA_COMMENT)
-			mb_io_ptr->comment_count++;
-		}
-
-	/* if first ping read set "old" navigation values */
-	if (status == MB_SUCCESS
-		&& (*kind == MB_DATA_DATA
-		    || *kind == MB_DATA_NAV
-		    || *kind == MB_DATA_CALIBRATE)
-		&& mb_io_ptr->ping_count == 1)
-		{
-		mb_io_ptr->old_time_d = *time_d;
-		mb_io_ptr->old_lon = *navlon;
-		mb_io_ptr->old_lat = *navlat;
-		}
-
-	/* if first nav read set "old" navigation values */
-	if (status == MB_SUCCESS
-		&& (*kind == MB_DATA_NAV)
-		&& mb_io_ptr->nav_count == 1)
-		{
-		mb_io_ptr->old_ntime_d = *time_d;
-		mb_io_ptr->old_nlon = *navlon;
-		mb_io_ptr->old_nlat = *navlat;
-		}
-
-	/* calculate speed and distance for ping data */
-	if (status == MB_SUCCESS
-		&& (*kind == MB_DATA_DATA
-		    || *kind == MB_DATA_CALIBRATE
-		    || *kind == MB_DATA_SUBBOTTOM_MCS
-		    || *kind == MB_DATA_SUBBOTTOM_CNTRBEAM
-		    || *kind == MB_DATA_SUBBOTTOM_SUBBOTTOM
-		    || *kind == MB_DATA_SIDESCAN2
-		    || *kind == MB_DATA_SIDESCAN3
-		    || *kind == MB_DATA_WATER_COLUMN))
-		{
-		/* get coordinate scaling */
-		mb_coor_scale(verbose,*navlat,&mtodeglon,&mtodeglat);
-
-		/* get distance value */
-		if (mb_io_ptr->old_time_d > 0.0)
-			{
-			dx = (*navlon - mb_io_ptr->old_lon)/mtodeglon;
-			dy = (*navlat - mb_io_ptr->old_lat)/mtodeglat;
-			*distance = 0.001*sqrt(dx*dx + dy*dy); /* km */
-			}
-		else
-			*distance = 0.0;
-
-		/* get speed value */
-		if (*speed <= 0.0 && mb_io_ptr->old_time_d > 0.0)
-			{
-			delta_time = 0.000277778*
-				(*time_d - mb_io_ptr->old_time_d); /* hours */
-			if (delta_time > 0.0)
-				*speed = *distance/delta_time; /* km/hr */
-			else
-				*speed = 0.0;
-			}
-		else if (*speed < 0.0)
-			*speed = 0.0;
-
-		/* print debug statements */
-		if (verbose >= 4)
-			{
-			fprintf(stderr,"\ndbg4  Distance and Speed Calculated in MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  Speed and Distance Related Values:\n");
-			fprintf(stderr,"dbg4       ping_count:   %d\n",
-					mb_io_ptr->ping_count);
-			fprintf(stderr,"dbg4       time:         %f\n",
-					*time_d);
-			fprintf(stderr,"dbg4       lon:          %f\n",
-					*navlon);
-			fprintf(stderr,"dbg4       lat:          %f\n",
-					*navlat);
-			fprintf(stderr,"dbg4       old time:     %f\n",
-					mb_io_ptr->old_time_d);
-			fprintf(stderr,"dbg4       old lon:      %f\n",
-					mb_io_ptr->old_lon);
-			fprintf(stderr,"dbg4       old lat:      %f\n",
-					mb_io_ptr->old_lat);
-			fprintf(stderr,"dbg4       distance:     %f\n",
-					*distance);
-			fprintf(stderr,"dbg4       altitude:     %f\n",
-					*altitude);
-			fprintf(stderr,"dbg4       sonardepth:   %f\n",
-					*sonardepth);
-			fprintf(stderr,"dbg4       delta_time:   %f\n",
-					delta_time);
-			fprintf(stderr,"dbg4       raw speed:    %f\n",
-					mb_io_ptr->new_speed);
-			fprintf(stderr,"dbg4       speed:        %f\n",
-					*speed);
-			fprintf(stderr,"dbg4       error:        %d\n",*error);
-			fprintf(stderr,"dbg4       status:       %d\n",status);
-			}
-		}
-
-	/* calculate speed and distance for nav data */
-	else if (status == MB_SUCCESS
-		&& (*kind == MB_DATA_NAV
-			|| *kind == MB_DATA_NAV
-			|| *kind == MB_DATA_NAV1
-			|| *kind == MB_DATA_NAV2
-			|| *kind == MB_DATA_NAV3))
-		{
-		/* get coordinate scaling */
-		mb_coor_scale(verbose,*navlat,&mtodeglon,&mtodeglat);
-
-		/* get distance value */
-		if (mb_io_ptr->old_ntime_d > 0.0)
-			{
-			dx = (*navlon - mb_io_ptr->old_nlon)/mtodeglon;
-			dy = (*navlat - mb_io_ptr->old_nlat)/mtodeglat;
-			*distance = 0.001*sqrt(dx*dx + dy*dy); /* km */
-			}
-		else
-			*distance = 0.0;
-
-		/* get speed value */
-		if (*speed <= 0.0 && mb_io_ptr->old_ntime_d > 0.0)
-			{
-			delta_time = 0.000277778*
-				(*time_d - mb_io_ptr->old_ntime_d); /* hours */
-			if (delta_time > 0.0)
-				*speed = *distance/delta_time; /* km/hr */
-			else
-				*speed = 0.0;
-			}
-		else if (*speed < 0.0)
-			*speed = 0.0;
-
-		/* print debug statements */
-		if (verbose >= 4)
-			{
-			fprintf(stderr,"\ndbg4  Distance and Speed Calculated in MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  Speed and Distance Related Values:\n");
-			fprintf(stderr,"dbg4       ping_count:   %d\n",
-					mb_io_ptr->ping_count);
-			fprintf(stderr,"dbg4       time:         %f\n",
-					*time_d);
-			fprintf(stderr,"dbg4       lon:          %f\n",
-					*navlon);
-			fprintf(stderr,"dbg4       lat:          %f\n",
-					*navlat);
-			fprintf(stderr,"dbg4       old time:     %f\n",
-					mb_io_ptr->old_ntime_d);
-			fprintf(stderr,"dbg4       old lon:      %f\n",
-					mb_io_ptr->old_nlon);
-			fprintf(stderr,"dbg4       old lat:      %f\n",
-					mb_io_ptr->old_lat);
-			fprintf(stderr,"dbg4       distance:     %f\n",
-					*distance);
-			fprintf(stderr,"dbg4       altitude:     %f\n",
-					*altitude);
-			fprintf(stderr,"dbg4       sonardepth:   %f\n",
-					*sonardepth);
-			fprintf(stderr,"dbg4       delta_time:   %f\n",
-					delta_time);
-			fprintf(stderr,"dbg4       raw speed:    %f\n",
-					mb_io_ptr->new_speed);
-			fprintf(stderr,"dbg4       speed:        %f\n",
-					*speed);
-			fprintf(stderr,"dbg4       error:        %d\n",*error);
-			fprintf(stderr,"dbg4       status:       %d\n",status);
-			}
-		}
-
-	/* else set nav values to zero */
-	else
-		{
-		*navlon = 0.0;
-		*navlat = 0.0;
-		*distance = 0.0;
-		*altitude = 0.0;
-		*sonardepth = 0.0;
-		*speed = 0.0;
-		}
-
-	/* check for out of location or time bounds */
-	if (status == MB_SUCCESS
-		&& (*kind == MB_DATA_DATA
-		    || *kind == MB_DATA_NAV
-		    || *kind == MB_DATA_CALIBRATE))
-		{
-		if (*navlon < mb_io_ptr->bounds[0]
-			|| *navlon > mb_io_ptr->bounds[1]
-			|| *navlat < mb_io_ptr->bounds[2]
-			|| *navlat > mb_io_ptr->bounds[3])
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_OUT_BOUNDS;
-			}
-		else if (mb_io_ptr->etime_d > mb_io_ptr->btime_d
-			&& *time_d > MB_TIME_D_UNKNOWN
-			&& (*time_d > mb_io_ptr->etime_d
-				|| *time_d < mb_io_ptr->btime_d))
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_OUT_TIME;
-			}
-		else if (mb_io_ptr->etime_d < mb_io_ptr->btime_d
-			&& *time_d > MB_TIME_D_UNKNOWN
-			&& (*time_d > mb_io_ptr->etime_d
-				&& *time_d < mb_io_ptr->btime_d))
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_OUT_TIME;
-			}
-		}
-
-	/* check for time gap */
-	if (status == MB_SUCCESS
-		&& mb_io_ptr->new_time_d > MB_TIME_D_UNKNOWN
-		&& (*kind == MB_DATA_DATA
-		    || *kind == MB_DATA_NAV
-		    || *kind == MB_DATA_CALIBRATE)
-		&& mb_io_ptr->ping_count > 1)
-		{
-		if ((*time_d - mb_io_ptr->old_ntime_d)
-			> 60*mb_io_ptr->timegap)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_TIME_GAP;
-			}
-		}
-
-	/* check for less than minimum speed */
-	if ((*error == MB_ERROR_NO_ERROR
-		|| *error == MB_ERROR_TIME_GAP)
-		&& (((*kind == MB_DATA_DATA
-			|| *kind == MB_DATA_CALIBRATE)
-			&& mb_io_ptr->ping_count > 1)
-		    || (*kind == MB_DATA_NAV
-			&& mb_io_ptr->nav_count > 1)))
-		{
-		if (*time_d > MB_TIME_D_UNKNOWN
-			&& *speed < mb_io_ptr->speedmin)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_SPEED_TOO_SMALL;
-			}
-		}
-
-	/* log errors */
-	if (*error < MB_ERROR_NO_ERROR)
-		mb_notice_log_error(verbose, mbio_ptr, *error);
-
-	/* print debug statements */
-	if (verbose >= 4)
-		{
-		fprintf(stderr,"\ndbg4  New ping checked by MBIO function <%s>\n",
-			function_name);
-		fprintf(stderr,"dbg4  New ping values:\n");
-		fprintf(stderr,"dbg4       kind:          %d\n",
-			*kind);
-		fprintf(stderr,"dbg4       ping_count:    %d\n",
-			mb_io_ptr->ping_count);
-		fprintf(stderr,"dbg4       nav_count:     %d\n",
-			mb_io_ptr->nav_count);
-		fprintf(stderr,"dbg4       comment_count: %d\n",
-			mb_io_ptr->comment_count);
-		fprintf(stderr,"dbg4       error:         %d\n",
-			mb_io_ptr->new_error);
-		fprintf(stderr,"dbg4       status:        %d\n",
-			status);
-		}
-
-	/* reset "old" navigation values */
-	if (*error <= MB_ERROR_NO_ERROR
-		&& *error > MB_ERROR_COMMENT
-		&& (*kind == MB_DATA_DATA
-		    || *kind == MB_DATA_CALIBRATE))
-		{
-		mb_io_ptr->old_time_d = *time_d;
-		mb_io_ptr->old_lon = *navlon;
-		mb_io_ptr->old_lat = *navlat;
-		}
-
-	/* reset "old" navigation values */
-	if (*error <= MB_ERROR_NO_ERROR
-		&& *error > MB_ERROR_COMMENT
-		&& *kind == MB_DATA_NAV)
-		{
-		mb_io_ptr->old_ntime_d = *time_d;
-		mb_io_ptr->old_nlon = *navlon;
-		mb_io_ptr->old_nlat = *navlat;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)*store_ptr);
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind == MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"dbg2       comment:     \ndbg2       %s\n",
-			comment);
-		}
-	else if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind != MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"dbg2       time_i[0]:     %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:     %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:     %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:     %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:     %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:     %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:     %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:        %f\n",*time_d);
-		fprintf(stderr,"dbg2       longitude:     %f\n",*navlon);
-		fprintf(stderr,"dbg2       latitude:      %f\n",*navlat);
-		fprintf(stderr,"dbg2       speed:         %f\n",*speed);
-		fprintf(stderr,"dbg2       heading:       %f\n",*heading);
-		fprintf(stderr,"dbg2       distance:      %f\n",*distance);
-		fprintf(stderr,"dbg2       altitude:      %f\n",*altitude);
-		fprintf(stderr,"dbg2       sonardepth:    %f\n",*sonardepth);
-		}
-	if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind == MB_DATA_DATA)
-		{
-		fprintf(stderr,"dbg2       nbath:      %d\n",*nbath);
-		if (verbose >= 3 && *nbath > 0)
-		  {
-		  fprintf(stderr,"dbg3       beam   flag  bath  crosstrack alongtrack\n");
-		  for (i=0;i<*nbath;i++)
-		    fprintf(stderr,"dbg3       %4d   %3d   %f    %f     %f\n",
-			i,beamflag[i],bath[i],
-			bathacrosstrack[i],bathalongtrack[i]);
-		  }
-		fprintf(stderr,"dbg2       namp:      %d\n",*namp);
-		if (verbose >= 3 && *namp > 0)
-		  {
-		  fprintf(stderr,"dbg3       beam   amp  crosstrack alongtrack\n");
-		  for (i=0;i<*namp;i++)
-		    fprintf(stderr,"dbg3       %4d   %f    %f     %f\n",
-			i,amp[i],
-			bathacrosstrack[i],bathalongtrack[i]);
-		  }
-		fprintf(stderr,"dbg2       nss:      %d\n",*nss);
-		if (verbose >= 3 && *nss > 0)
-		  {
-		  fprintf(stderr,"dbg3       pixel sidescan crosstrack alongtrack\n");
-		  for (i=0;i<*nss;i++)
-		    fprintf(stderr,"dbg3       %4d   %f    %f     %f\n",
-			i,ss[i],
-			ssacrosstrack[i],ssalongtrack[i]);
-		  }
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mb_get_value.c b/src/mbio/mb_get_value.c
deleted file mode 100644
index bacba47..0000000
--- a/src/mbio/mb_get_value.c
+++ /dev/null
@@ -1,361 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mb_get_value.c	2/15/93
- *    $Id: mb_get_value.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1993-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mb_get_value.c includes the "mb_" functions used to get int and double
- * values out of string buffers and the functions used to get
- * values into or out of binary buffers.
- *
- * Author:	D. W. Caress
- * Date:	February 15, 1993
- *
- * $Log: mb_get_value.c,v $
- * Revision 5.5  2008/09/13 06:08:09  caress
- * Updates to apply suggested patches to segy handling. Also fixes to remove compiler warnings.
- *
- * Revision 5.4  2004/11/06 03:55:16  caress
- * Working to support the Reson 7k format.
- *
- * Revision 5.3  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.2  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.1  2001/03/22 20:45:56  caress
- * Trying to make 5.0.beta0...
- *
- * Revision 5.0  2000/12/01  22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.8  2000/10/11  01:02:30  caress
- * Convert to ANSI C
- *
- * Revision 4.7  2000/09/30  06:26:58  caress
- * Snapshot for Dale.
- *
- * Revision 4.6  1999/12/29  00:34:06  caress
- * Release 4.6.8
- *
- * Revision 4.5  1999/08/08  04:12:45  caress
- * Added ELMK2XSE format.
- *
- * Revision 4.4  1998/10/05  18:32:27  caress
- * MB-System version 4.6beta
- *
- * Revision 4.3  1997/04/21  17:02:07  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.3  1997/04/21  17:02:07  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.3  1997/04/17  15:07:36  caress
- * MB-System 4.5 Beta Release
- *
- * Revision 4.3  1997/04/17  15:07:36  caress
- * MB-System 4.5 Beta Release
- *
- * Revision 4.2  1995/03/06  19:38:54  caress
- * Changed include strings.h to string.h for POSIX compliance.
- *
- * Revision 4.1  1994/10/21  12:11:53  caress
- * Release V4.0
- *
- * Revision 4.0  1994/03/06  00:01:56  caress
- * First cut at version 4.0
- *
- * Revision 4.0  1994/03/06  00:01:56  caress
- * First cut at version 4.0
- *
- * Revision 4.1  1994/03/03  03:39:43  caress
- * Fixed copyright message.
- *
- * Revision 4.0  1994/02/21  04:03:53  caress
- * First cut at new version.  No changes.
- *
- * Revision 3.2  1993/05/15  14:44:54  caress
- * removed excess rcs_id message
- *
- * Revision 3.1  1993/05/14  22:27:02  sohara
- * fixed rcs_id message
- *
- * Revision 3.0  1993/04/23  16:00:04  dale
- * Inital version
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_swap.h"
-#include "mb_define.h"
-
-/* maximum line length in characters */
-#define MB_GET_VALUE_MAXLINE 200
-
-/* static char rcs_id[]="$Id: mb_get_value.c 2227 2015-02-05 21:12:31Z caress $"; */
-char	tmp[MB_GET_VALUE_MAXLINE];
-
-/*--------------------------------------------------------------------*/
-/*	function mb_get_double reads a double value from a string.
- */
-int mb_get_double(double *value, char *str, int nchar)
-{
-	memset(tmp, 0, MB_GET_VALUE_MAXLINE);
-	*value = 0.0;
-	*value = atof(strncpy(tmp,str,nchar));
-	return(0);
-}
-/*--------------------------------------------------------------------*/
-/*	function mb_get_int reads a int value from a string.
- */
-int mb_get_int(int *value, char *str, int nchar)
-{
-	memset(tmp, 0, MB_GET_VALUE_MAXLINE);
-	*value = atoi(strncpy(tmp,str,nchar));
-	return(0);
-}
-/*--------------------------------------------------------------------*/
-/*	function mb_get_binary_short copies a binary short from
- *	a buffer, swapping if necessary
- */
-int mb_get_binary_short(int swapped, void *buffer, void *ptr)
-{
-	short *value;
-
-	value = (short *) ptr;
-	memcpy(value, buffer, sizeof(short));
-#ifdef BYTESWAPPED
-	if (swapped == MB_NO)
-	    *value = mb_swap_short(*((short *)value));
-#else
-	if (swapped == MB_YES)
-	    *value = mb_swap_short(*value);
-#endif
-	return(0);
-}
-/*--------------------------------------------------------------------*/
-/*	function mb_get_binary_int copies a binary int from
- *	a buffer, swapping if necessary
- */
-int mb_get_binary_int(int swapped, void *buffer, void *ptr)
-{
-	int *value;
-
-	value = (int *) ptr;
-	memcpy(value, buffer, sizeof(int));
-#ifdef BYTESWAPPED
-	if (swapped == MB_NO)
-	    *value = mb_swap_int(*value);
-#else
-	if (swapped == MB_YES)
-	    *value = mb_swap_int(*value);
-#endif
-	return(0);
-}
-/*--------------------------------------------------------------------*/
-/*	function mb_get_binary_float copies a binary float from
- *	a buffer, swapping if necessary
- */
-int mb_get_binary_float(int swapped, void *buffer, void *ptr)
-{
-	float *value;
-
-	value = (float *) ptr;
-	memcpy(value, buffer, sizeof(float));
-#ifdef BYTESWAPPED
-	if (swapped == MB_NO)
-	    mb_swap_float(value);
-#else
-	if (swapped == MB_YES)
-	    mb_swap_float(value);
-#endif
-	return(0);
-}
-/*--------------------------------------------------------------------*/
-/*	function mb_get_binary_double copies a binary double from
- *	a buffer, swapping if necessary
- */
-int mb_get_binary_double(int swapped, void *buffer, void *ptr)
-{
-	double *value;
-
-	value = (double *) ptr;
-	memcpy(value, buffer, sizeof(double));
-#ifdef BYTESWAPPED
-	if (swapped == MB_NO)
-	    mb_swap_double(value);
-#else
-	if (swapped == MB_YES)
-	    mb_swap_double(value);
-#endif
-	return(0);
-}
-/*--------------------------------------------------------------------*/
-/*	function mb_get_binary_long copies a binary long from
- *	a buffer, swapping if necessary
- */
-int mb_get_binary_long(int swapped, void *buffer, void *ptr)
-{
-	mb_s_long *value;
-
-	value = (mb_s_long *) ptr;
-	memcpy(value, buffer, sizeof(mb_s_long));
-#ifdef BYTESWAPPED
-	if (swapped == MB_NO)
-	    mb_swap_long(value);
-#else
-	if (swapped == MB_YES)
-	    mb_swap_long(value);
-#endif
-	return(0);
-}
-/*--------------------------------------------------------------------*/
-/*	function mb_put_binary_short copies a binary short to
- *	a buffer, swapping if necessary
- */
-int mb_put_binary_short(int swapped, short value, void *buffer)
-{
-#ifdef BYTESWAPPED
-	if (swapped == MB_NO)
-	    value = mb_swap_short(value);
-#else
-	if (swapped == MB_YES)
-	    value = mb_swap_short(value);
-#endif
-	memcpy(buffer, &value, sizeof(short));
-	return(0);
-}
-/*--------------------------------------------------------------------*/
-/*	function mb_put_binary_int copies a binary int to
- *	a buffer, swapping if necessary
- */
-int mb_put_binary_int(int swapped, int value, void *buffer)
-{
-#ifdef BYTESWAPPED
-	if (swapped == MB_NO)
-	    value = mb_swap_int(value);
-#else
-	if (swapped == MB_YES)
-	    value = mb_swap_int(value);
-#endif
-	memcpy(buffer, &value, sizeof(int));
-	return(0);
-}
-/*--------------------------------------------------------------------*/
-/*	function mb_put_binary_float copies a binary float to
- *	a buffer, swapping if necessary
- */
-int mb_put_binary_float(int swapped, float value, void *buffer)
-{
-#ifdef BYTESWAPPED
-	if (swapped == MB_NO)
-	    mb_swap_float(&value);
-#else
-	if (swapped == MB_YES)
-	    mb_swap_float(&value);
-#endif
-	memcpy(buffer, &value, sizeof(float));
-	return(0);
-}
-/*--------------------------------------------------------------------*/
-/*	function mb_put_binary_double copies a binary double to
- *	a buffer, swapping if necessary
- */
-int mb_put_binary_double(int swapped, double value, void *buffer)
-{
-#ifdef BYTESWAPPED
-	if (swapped == MB_NO)
-	    mb_swap_double(&value);
-#else
-	if (swapped == MB_YES)
-	    mb_swap_double(&value);
-#endif
-	memcpy(buffer, &value, sizeof(double));
-	return(0);
-}
-/*--------------------------------------------------------------------*/
-/*	function mb_put_binary_long copies a binary long to
- *	a buffer, swapping if necessary
- */
-int mb_put_binary_long(int swapped, mb_s_long value, void *buffer)
-{
-#ifdef BYTESWAPPED
-	if (swapped == MB_NO)
-	    mb_swap_long(&value);
-#else
-	if (swapped == MB_YES)
-	    mb_swap_long(&value);
-#endif
-	memcpy(buffer, &value, sizeof(mb_s_long));
-	return(0);
-}
-/*--------------------------------------------------------------------*/
-/*	function mb_get_bounds interprets longitude and
- *	latitude values in decimal degrees and degrees:minutes:seconds
- *	form. This code derives from code in GMT (gmt_init.c).
- */
-int mb_get_bounds (char *text, double *bounds)
-{
-	int	status = MB_SUCCESS;
-	char	*result;
-	int	i;
-
-	result = strtok(text, "/");
-	i = 0;
-	while (result && i < 4)
-	    {
-	    bounds[i] = mb_ddmmss_to_degree (result);
-	    i++;
-	    result = strtok (NULL, "/");
-	    }
-	if (i == 4)
-	    status = MB_SUCCESS;
-	else
-	    status = MB_FAILURE;
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-/*	function mb_ddmmss_to_degree interprets longitude and
- *	latitude values in decimal degrees and degrees:minutes:seconds
- *	form. This code has been taken from GMT (gmt_init.c).
- */
-double mb_ddmmss_to_degree(char *text)
-{
-	int i, colons = 0, suffix;
-	double degree, minute, degfrac, second;
-
-	for (i = 0; text[i]; i++) if (text[i] == ':') colons++;
-	suffix = (int)text[i-1];	/* Last character in string */
-	if (colons == 2) {	/* dd:mm:ss format */
-		sscanf (text, "%lf:%lf:%lf", &degree, &minute, &second);
-		degfrac = degree + copysign (minute / 60.0 + second / 3600.0, degree);
-	}
-	else if (colons == 1) {	/* dd:mm format */
-		sscanf (text, "%lf:%lf", &degree, &minute);
-		degfrac = degree + copysign (minute / 60.0, degree);
-	}
-	else
-		degfrac = atof (text);
-	if (suffix == 'W' || suffix == 'w' || suffix == 'S' || suffix == 's') degfrac = -degfrac;	/* Sign was given implicitly */
-	return (degfrac);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mb_info.h b/src/mbio/mb_info.h
deleted file mode 100644
index bebcab6..0000000
--- a/src/mbio/mb_info.h
+++ /dev/null
@@ -1,123 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mb_info.h			8/21/2006
- *    $Id: mb_info.h 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 2006-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mb_info.h defines file information and data structures used by
- * mbproject..
- *
- * Author:	D. W. Caress
- * Date:	August 21, 2006
- *
- * $Log: mb_info.h,v $
- * Revision 5.1  2007/10/08 15:59:34  caress
- * MBIO changes as of 8 October 2007.
- *
- * Revision 5.0  2006/10/05 18:56:44  caress
- * New files for 5.1.0
- *
- *
- *
- */
-
-/* include this code only once */
-#ifndef MB_INFO_DEF
-#define MB_INFO_DEF
-
- /* structure holding output of mbinfo -N -G */
-struct mb_info_struct
-	{
-	int	loaded;
-	char	file[MB_PATH_MAXLINE];
-
-	int	nrecords;
-	int	nrecords_ss1;
-	int	nrecords_ss2;
-	int	nrecords_sbp;
-	int	nbeams_bath;
-	int	nbeams_bath_total;
-	int	nbeams_bath_good;
-	int	nbeams_bath_zero;
-	int	nbeams_bath_flagged;
-	int	nbeams_amp;
-	int	nbeams_amp_total;
-	int	nbeams_amp_good;
-	int	nbeams_amp_zero;
-	int	nbeams_amp_flagged;
-	int	npixels_ss;
-	int	npixels_ss_total;
-	int	npixels_ss_good;
-	int	npixels_ss_zero;
-	int	npixels_ss_flagged;
-
-	double	time_total;
-	double	dist_total;
-	double	speed_avg;
-
-	double	time_start;
-	double	lon_start;
-	double	lat_start;
-	double	depth_start;
-	double	heading_start;
-	double	speed_start;
-	double	sonardepth_start;
-	double	sonaraltitude_start;
-
-	double	time_end;
-	double	lon_end;
-	double	lat_end;
-	double	depth_end;
-	double	heading_end;
-	double	speed_end;
-	double	sonardepth_end;
-	double	sonaraltitude_end;
-
-	double	lon_min;
-	double	lon_max;
-	double	lat_min;
-	double	lat_max;
-	double	sonardepth_min;
-	double	sonardepth_max;
-	double	altitude_min;
-	double	altitude_max;
-	double	depth_min;
-	double	depth_max;
-	double	amp_min;
-	double	amp_max;
-	double	ss_min;
-	double	ss_max;
-
-	int	problem_nodata;
-	int	problem_zeronav;
-	int	problem_toofast;
-	int	problem_avgtoofast;
-	int	problem_toodeep;
-	int	problem_baddatagram;
-
-	int	mask_nx;
-	int	mask_ny;
-	double	mask_dx;
-	double	mask_dy;
-	int	mask_alloc;
-	int	*mask;
-
-	};
-
-/* MBIO mb_info function prototypes */
-int mb_info_init(int verbose, struct mb_info_struct *mb_info, int *error);
-int mb_get_info(int verbose, char *file, struct mb_info_struct *mb_info, int lonflip,
-		    int *error);
-int mb_get_info_datalist(int verbose, char *read_file, int *format,
-			struct mb_info_struct *mb_info, int lonflip, int *error);
-
-#endif
diff --git a/src/mbio/mb_io.h b/src/mbio/mb_io.h
deleted file mode 100644
index e793035..0000000
--- a/src/mbio/mb_io.h
+++ /dev/null
@@ -1,543 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mb_io.h	1/19/93
- *    $Id: mb_io.h 2249 2015-06-26 19:26:09Z caress $
- *
- *    Copyright (c) 1993-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mb_io.h defines data structures used by MBIO "mb_" functions
- * to store parameters relating to reading data from or writing
- * data to a single multibeam data file.
- *
- * Author:	D. W. Caress
- * Date:	January 19, 1993
- *
- */
-
-/* include this code only once */
-#ifndef MB_IO_DEF
-#define MB_IO_DEF
-
-#include "mb_config.h"
-#include "mb_define.h"
-#include "mb_status.h"
-        
-/* survey platform definition structures */
-#define MB_SENSOR_TIME_LATENCY_NONE                     0
-#define MB_SENSOR_TIME_LATENCY_STATIC                   1
-#define MB_SENSOR_TIME_LATENCY_MODEL                    2
-#define MB_SENSOR_POSITION_OFFSET_NONE                  0
-#define MB_SENSOR_POSITION_OFFSET_STATIC                1
-#define MB_SENSOR_ATTITUDE_OFFSET_NONE                   0
-#define MB_SENSOR_ATTITUDE_OFFSET_STATIC                 1
-struct mb_sensor_offset_struct
-        {
-        int     time_latency_mode;
-        double  time_latency_static;
-        int     num_time_latency;
-        int     num_time_latency_alloc;
-        double  *time_latency_time_d;
-        double  *time_latency_value;
-        
-        int     position_offset_mode;
-        double  position_offset_x;
-        double  position_offset_y;
-        double  position_offset_z;
-        
-        int     attitude_offset_mode;
-        double  attitude_offset_azimuth;
-        double  attitude_offset_roll;
-        double  attitude_offset_pitch;
-        };
-
-#define MB_SENSOR_TYPE_NONE                             0
-#define MB_SENSOR_TYPE_SONAR_ECHOSOUNDER                1
-#define MB_SENSOR_TYPE_SONAR_MULTIECHOSOUNDER           2
-#define MB_SENSOR_TYPE_SONAR_SIDESCAN                   3
-#define MB_SENSOR_TYPE_SONAR_INTERFEROMETRY             4
-#define MB_SENSOR_TYPE_SONAR_MULTIBEAM                  5
-#define MB_SENSOR_TYPE_SONAR_SUBBOTTOM                  6
-#define MB_SENSOR_TYPE_CAMERA_MONO                      21
-#define MB_SENSOR_TYPE_CAMERA_STEREO                    22
-#define MB_SENSOR_TYPE_CAMERA_VIDEO                     23
-#define MB_SENSOR_TYPE_LIDAR_SCAN                       31
-#define MB_SENSOR_TYPE_LIDAR_SWATH                      32
-#define MB_SENSOR_TYPE_POSITION                         51
-#define MB_SENSOR_TYPE_COMPASS                          61
-#define MB_SENSOR_TYPE_VRU                              71
-#define MB_SENSOR_TYPE_IMU                              81
-#define MB_SENSOR_TYPE_INS                              82
-#define MB_SENSOR_TYPE_CTD                              91
-#define MB_SENSOR_TYPE_PRESSURE                         92
-#define MB_SENSOR_TYPE_SOUNDSPEED                       101
-struct mb_sensor_struct
-        {
-        int     type;
-        mb_longname model;
-        mb_longname manufacturer;
-        mb_longname serialnumber;
-        int     capability;
-        int     special_capability;
-        int     num_offsets;
-        int     num_offsets_alloc;
-        struct mb_sensor_offset_struct *offsets;
-        
-        };
-        
-#define MB_PLATFORM_NONE                0
-#define MB_PLATFORM_SURFACE_VESSEL      1
-#define MB_PLATFORM_TOW_BODY            2
-#define MB_PLATFORM_ROV                 3
-#define MB_PLATFORM_AUV                 4
-#define MB_PLATFORM_AIRPLANE            5
-#define MB_PLATFORM_SATELLITE           6
-struct mb_platform_struct
-        {
-        int             type;
-        mb_longname     name;
-        mb_longname     organization;
-        
-        int             source_swathbathymetry;
-        int             source_position;
-        int             source_depth;
-        int             source_heave;
-        int             source_heading;
-        int             source_rollpitch;
-        
-        int             num_sensors;
-        int             num_sensors_alloc;
-        struct mb_sensor_struct *sensors;
-        };
-
-struct mb_io_ping_struct
-	{
-	double	time_d;
-	double	navlon;
-	double	navlat;
-	double	speed;
-	double	heading;
-	double	distance;
-	double	altitude;
-	double	sonardepth;
-	int	nbath;
-	int	namp;
-	int	nss;
-	char	*beamflag;
-	double	*bath;
-	double	*bathlon;
-	double	*bathlat;
-	double	*amp;
-	double	*ss;
-	double	*sslon;
-	double	*sslat;
-	};
-
-/* MBIO input/output control structure */
-struct mb_io_struct
-	{
-	/* system byte swapping */
-	int	byteswapped;	/* 0 = unswapped, 1 = swapped (Intel byte order) */
-
-	/* format parameters */
-	int	format;		/* data format id */
-	int	system;		/* sonar system id */
-	int	beams_bath_max;	/* maximum number of bathymetry beams */
-	int	beams_amp_max;	/* maximum number of amplitude beams
-					- either 0 or = beams_bath */
-	int	pixels_ss_max;	/* maximum number of sidescan pixels */
-	int	beams_bath_alloc;	/* allocated number of bathymetry beams */
-	int	beams_amp_alloc;	/* allocated number of amplitude beams */
-	int	pixels_ss_alloc;	/* allocated number of sidescan pixels */
-	char	format_name[MB_NAME_LENGTH];
-	char	system_name[MB_NAME_LENGTH];
-	char	format_description[MB_DESCRIPTION_LENGTH];
-	int	numfile;	/* the number of parallel files required for i/o */
-	int	filetype;	/* type of files used (normal, single normal, xdr, or gsf) */
-	int	filemode;	/* file mode (read or write) */
-	int	variable_beams; /* if true then number of beams variable */
-	int	traveltime;	/* if true then traveltime and angle data supported */
-	int	beam_flagging;	/* if true then beam flagging supported */
-	int	nav_source;	/* data record types containing the primary navigation */
-	int	heading_source;	/* data record types containing the primary heading */
-	int	vru_source;	/* data record types containing the primary vru */
-	int	svp_source;	/* data record types containing the primary svp */
-	double	beamwidth_xtrack;   /* nominal acrosstrack beamwidth */
-	double	beamwidth_ltrack;   /* nominal alongtrack beamwidth */
-
-	/* control parameters - see mbio manual pages for explanation */
-	int	pings;		/* controls ping averaging */
-	int	lonflip;	/* controls longitude range */
-	double	bounds[4];	/* locations bounds of acceptable data */
-	int	btime_i[7];	/* beginning time of acceptable data */
-	int	etime_i[7];	/* ending time of acceptable data */
-	double	btime_d;	/* beginning time of acceptable data
-					in "_d" format (unix seconds) */
-	double	etime_d;	/* ending time of acceptable data
-					in "_d" format (unix seconds) */
-	double	speedmin;	/* minimum ship speed of acceptable data
-					in km/hr */
-	double	timegap;	/* maximum time between pings without
-					a data gap */
-
-	/* file descriptor, file name, and usage flag */
-	FILE	*mbfp;		/* file descriptor */
-	mb_path	file;	        /* file name */
-	long	file_pos;	/* file position at start of
-				    last record read */
-	long	file_bytes;	/* number of bytes read from file */
-        char    *file_iobuffer;  /* file i/o buffer for fread() and fwrite() calls */
-	FILE	*mbfp2;		/* file descriptor #2 */
-	char	file2[MB_PATH_MAXLINE];	/* file name #2 */
-	long	file2_pos;	/* file position #2 at start of
-				    last record read */
-	long	file2_bytes;	/* number of bytes read from file */
-	FILE	*mbfp3;		/* file descriptor #3 */
-	char	file3[MB_PATH_MAXLINE];	/* file name #3 */
-	long	file3_pos;	/* file position #3 at start of
-				    last record read */
-	long	file3_bytes;	/* number of bytes read from file */
-	int	ncid;		/* netCDF datastream ID */
-	int	gsfid;		/* GSF datastream ID */
-	void	*xdrs;		/* XDR stream handle */
-	void	*xdrs2;		/* XDR stream handle #2 */
-	void	*xdrs3;		/* XDR stream handle #2 */
-
-	/* read or write history */
-	int	fileheader;	/* indicates whether file header has
-					been read or written */
-	int	hdr_comment_size;/* number of characters in
-					header_comment string */
-	int	hdr_comment_loc;/* number of characters already extracted
-					from header_comment string */
-	char	*hdr_comment;	/* placeholder for long comment strings
-					for formats using a single
-					comment string in a file header */
-	int	irecord_count;	/* counting variable used for VMS derived
-					data formats to remove extra
-					bytes (e.g. sburivax format) */
-	int	orecord_count;	/* counting variable used for VMS derived
-					data formats to insert extra
-					bytes (e.g. sburivax format) */
-
-	/* pointer to structure containing raw data (could be any format) */
-	int	structure_size;
-	int	data_structure_size;
-	int	header_structure_size;
-	void	*raw_data;
-	void	*store_data;
-
-	/* working variables */
-	int	ping_count;	/* number of pings read or written so far */
-	int	nav_count;	/* number of nav records read or written so far */
-	int	comment_count;	/* number of comments read or written so far */
-	int	pings_avg;	/* number of pings currently averaged */
-	int	pings_read;	/* number of pings read this binning cycle */
-	int	error_save;	/* saves time gap error to end of binning */
-	double	last_time_d;
-	double	last_lon;
-	double	last_lat;
-	double	old_time_d;
-	double	old_lon;
-	double	old_lat;
-	double	old_ntime_d;
-	double	old_nlon;
-	double	old_nlat;
-
-	/* data binning variables */
-	int	pings_binned;
-	double	time_d;
-	double	lon;
-	double	lat;
-	double	speed;
-	double	heading;
-	char	*beamflag;
-	double	*bath;
-	double	*amp;
-	double	*bath_acrosstrack;
-	double	*bath_alongtrack;
-	int	*bath_num;
-	int	*amp_num;
-	double	*ss;
-	double	*ss_acrosstrack;
-	double	*ss_alongtrack;
-	int	*ss_num;
-
-	/* current ping variables */
-	int	need_new_ping;
-	int	new_kind;
-	int	new_error;
-	char	new_comment[MB_COMMENT_MAXLINE];
-	int	new_time_i[7];
-	double	new_time_d;
-	double	new_lon;
-	double	new_lat;
-	double	new_speed;
-	double	new_heading;
-	int	new_beams_bath;	/* number of bathymetry beams */
-	int	new_beams_amp;	/* number of amplitude beams
-					- either 0 or = beams_bath */
-	int	new_pixels_ss;	/* number of sidescan pixels */
-	char	*new_beamflag;
-	double	*new_bath;
-	double	*new_amp;
-	double	*new_bath_acrosstrack;
-	double	*new_bath_alongtrack;
-	double	*new_ss;
-	double	*new_ss_acrosstrack;
-	double	*new_ss_alongtrack;
-
-	/* variables for projections to and from projected coordinates */
-	int	projection_initialized;
-        char	projection_id[MB_NAME_LENGTH];
-	void 	*pjptr;
-
-	/* variables for interpolating/extrapolating navigation
-		for formats containing nav as asynchronous
-		position records separate from ping data */
-	int nfix;
-	double fix_time_d[MB_ASYNCH_SAVE_MAX];
-	double fix_lon[MB_ASYNCH_SAVE_MAX];
-	double fix_lat[MB_ASYNCH_SAVE_MAX];
-
-	/* variables for interpolating/extrapolating attitude
-		for formats containing attitude as asynchronous
-		data records separate from ping data */
-	int nattitude;
-	double attitude_time_d[MB_ASYNCH_SAVE_MAX];
-	double attitude_heave[MB_ASYNCH_SAVE_MAX];
-	double attitude_roll[MB_ASYNCH_SAVE_MAX];
-	double attitude_pitch[MB_ASYNCH_SAVE_MAX];
-
-	/* variables for interpolating/extrapolating heading
-		for formats containing heading as asynchronous
-		data records separate from ping data */
-	int nheading;
-	double heading_time_d[MB_ASYNCH_SAVE_MAX];
-	double heading_heading[MB_ASYNCH_SAVE_MAX];
-
-	/* variables for interpolating/extrapolating sonar depth
-		for formats containing sonar depth as asynchronous
-		data records separate from ping data */
-	int nsonardepth;
-	double sonardepth_time_d[MB_ASYNCH_SAVE_MAX];
-	double sonardepth_sonardepth[MB_ASYNCH_SAVE_MAX];
-
-	/* variables for interpolating/extrapolating altitude
-		for formats containing altitude as asynchronous
-		data records separate from ping data */
-	int naltitude;
-	double altitude_time_d[MB_ASYNCH_SAVE_MAX];
-	double altitude_altitude[MB_ASYNCH_SAVE_MAX];
-
-	/* variables for accumulating MBIO notices */
-	int	notice_list[MB_NOTICE_MAX];
-
-	/* variable for registering and maintaining application i/o arrays */
-	int	bath_arrays_reallocated;
-	int	amp_arrays_reallocated;
-	int	ss_arrays_reallocated;
-	int	n_regarray;
-	int	n_regarray_alloc;
-	void	**regarray_handle;
-	void	**regarray_ptr;
-	void	**regarray_oldptr;
-	int	*regarray_type;
-	size_t	*regarray_size;
-
-	/* variables for saving information */
-	char	save_label[12];
-	int	save_label_flag;
-	int	save_flag;
-	int	save1;
-	int	save2;
-	int	save3;
-	int	save4;
-	int	save5;
-	int	save6;
-	int	save7;
-	int	save8;
-	int	save9;
-	int	save10;
-	int	save11;
-	int	save12;
-	int	save13;
-	int	save14;
-	double	saved1;
-	double	saved2;
-	double	saved3;
-	double	saved4;
-	double	saved5;
-	void	*saveptr1;
-	void	*saveptr2;
-
-	/* function pointers for allocating and deallocating format
-		specific structures */
-	int (*mb_io_format_alloc)(int verbose, void *mbio_ptr, int *error);
-	int (*mb_io_format_free)(int verbose, void *mbio_ptr, int *error);
-	int (*mb_io_store_alloc)(int verbose, void *mbio_ptr,
-		void **store_ptr, int *error);
-	int (*mb_io_store_free)(int verbose, void *mbio_ptr,
-		void **store_ptr, int *error);
-
-	/* function pointers for reading and writing records */
-	int (*mb_io_read_ping)(int verbose, void *mbio_ptr,
-		void *store_ptr, int *error);
-	int (*mb_io_write_ping)(int verbose, void *mbio_ptr,
-		void *store_ptr, int *error);
-
-	/* function pointers for extracting and inserting data */
-	int (*mb_io_dimensions)(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int *nbath, int *namp, int *nss, int *error);
-	int (*mb_io_pingnumber)(int verbose, void *mbio_ptr,
-		int *pingnumber, int *error);
-	int (*mb_io_segynumber)(int verbose, void *mbio_ptr,
-		int *line, int *shot, int *cdp, int *error);
-	int (*mb_io_sonartype)(int verbose, void *mbio_ptr, void *store_ptr,
-		int *sonartype, int *error);
-	int (*mb_io_sidescantype)(int verbose, void *mbio_ptr, void *store_ptr,
-		int *ss_type, int *error);
-        int (*mb_io_preprocess)(int verbose, void *mbio_ptr, void *store_ptr,
-		double time_d, double navlon, double navlat,
-		double speed, double heading, double sonardepth,
-		double roll, double pitch, double heave,
-		int *error);
-	int (*mb_io_extract)(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int time_i[7], double *time_d,
-		double *navlon, double *navlat,
-		double *speed, double *heading,
-		int *nbath, int *namp, int *nss,
-		char *beamflag, double *bath, double *amp,
-		double *bathacrosstrack, double *bathalongtrack,
-		double *ss, double *ssacrosstrack, double *ssalongtrack,
-		char *comment, int *error);
-	int (*mb_io_insert)(int verbose, void *mbio_ptr, void *store_ptr,
-		int kind, int time_i[7], double time_d,
-		double navlon, double navlat,
-		double speed, double heading,
-		int nbath, int namp, int nss,
-		char *beamflag, double *bath, double *amp,
-		double *bathacrosstrack, double *bathalongtrack,
-		double *ss, double *ssacrosstrack, double *ssalongtrack,
-		char *comment, int *error);
-	int (*mb_io_extract_nav)(int verbose, void *mbio_ptr, void *store_ptr, int *kind,
-		int time_i[7], double *time_d,
-		double *navlon, double *navlat,
-		double *speed, double *heading, double *draft,
-		double *roll, double *pitch, double *heave,
-		int *error);
-	int (*mb_io_extract_nnav)(int verbose, void *mbio_ptr, void *store_ptr,
-		int nmax, int *kind, int *n,
-		int *time_i, double *time_d,
-		double *navlon, double *navlat,
-		double *speed, double *heading, double *draft,
-		double *roll, double *pitch, double *heave,
-		int *error);
-	int (*mb_io_insert_nav)(int verbose, void *mbio_ptr, void *store_ptr,
-		int time_i[7], double time_d,
-		double navlon, double navlat,
-		double speed, double heading, double draft,
-		double roll, double pitch, double heave,
-		int *error);
-	int (*mb_io_extract_altitude)(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind,
-		double *transducer_depth, double *altitude,
-		int *error);
-	int (*mb_io_insert_altitude)(int verbose, void *mbio_ptr, void *store_ptr,
-		double transducer_depth, double altitude,
-		int *error);
-	int (*mb_io_extract_svp)(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind,
-		int *nsvp,
-		double *depth, double *velocity,
-		int *error);
-	int (*mb_io_insert_svp)(int verbose, void *mbio_ptr, void *store_ptr,
-		int nsvp,
-		double *depth, double *velocity,
-		int *error);
-	int (*mb_io_ttimes)(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int *nbeams,
-		double *ttimes, double	*angles,
-		double *angles_forward, double *angles_null,
-		double *heave, double *alongtrack_offset,
-		double *draft, double *ssv, int *error);
-	int (*mb_io_detects)(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int *nbeams, int *detects, int *error);
-	int (*mb_io_pulses)(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int *nbeams, int *pulses, int *error);
-	int (*mb_io_gains)(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, double *transmit_gain, double *pulse_length,
-		double *receive_gain, int *error);
-	int (*mb_io_extract_rawssdimensions)(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, double *sample_interval,
-		int *num_samples_port, int *num_samples_stbd, int *error);
-	int (*mb_io_extract_rawss)(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int *sidescan_type, double *sample_interval,
-                double *beamwidth_xtrack, double *beamwidth_ltrack,
-		int *num_samples_port, double *rawss_port, 
-		int *num_samples_stbd, double *rawss_stbd, int *error);
-	int (*mb_io_insert_rawss)(int verbose, void *mbio_ptr, void *store_ptr,
-		int kind, int sidescan_type, double sample_interval,
-		double beamwidth_xtrack, double beamwidth_ltrack,
-		int num_samples_port, double *rawss_port,
-		int num_samples_stbd, double *rawss_stbd, int *error);
-	int (*mb_io_extract_segytraceheader)(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind,
-		void *segytraceheader_ptr,
-		int *error);
-	int (*mb_io_extract_segy)(int verbose, void *mbio_ptr, void *store_ptr,
-		int *sampleformat,
-		int *kind,
-		void *segytraceheader_ptr,
-		float *segydata,
-		int *error);
-	int (*mb_io_insert_segy)(int verbose, void *mbio_ptr, void *store_ptr,
-		int kind,
-		void *segytraceheader_ptr,
-		float *segydata,
-		int *error);
-	int (*mb_io_ctd)(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int *nctd, double *time_d,
-		double *conductivity, double *temperature,
-		double *depth, double *salinity, double *soundspeed, int *error);
-	int (*mb_io_ancilliarysensor)(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int *nsensor, double *time_d,
-		double *sensor1, double *sensor2, double *sensor3,
-		double *sensor4, double *sensor5, double *sensor6,
-		double *sensor7, double *sensor8, int *error);
-	int (*mb_io_copyrecord)(int verbose, void *mbio_ptr,
-		void *store_ptr, void *copy_ptr, int *error);
-
-	};
-
-/* MBIO buffer control structure */
-struct mb_buffer_struct
-	{
-	void *buffer[MB_BUFFER_MAX];
-	int buffer_kind[MB_BUFFER_MAX];
-	int nbuffer;
-	};
-
-/* MBIO datalist control structure */
-#define MB_DATALIST_RECURSION_MAX 	25
-struct mb_datalist_struct {
-	int	open;
-	int	recursion;
-	int	look_processed;
-	int	local_weight;
-	int	weight_set;
-	double	weight;
-	FILE	*fp;
-	char	path[MB_PATH_MAXLINE];
-	struct mb_datalist_struct *datalist;
-	};
-
-/* end conditional include */
-#endif
diff --git a/src/mbio/mb_mem.c b/src/mbio/mb_mem.c
deleted file mode 100644
index 373f433..0000000
--- a/src/mbio/mb_mem.c
+++ /dev/null
@@ -1,1573 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mb_mem.c	3/1/93
- *    $Id: mb_mem.c 2229 2015-02-14 23:04:41Z caress $
- *
- *    Copyright (c) 1993-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mb_mem.c contains the MBIO routines for managing memory:
- * mb_malloc and mb_free.  These routines call malloc and free,
- * respectively, and also allow debug messages to be printed out
- * according to the verbosity.
- *
- * Author:	D. W. Caress
- * Date:	March 1, 1993
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_define.h"
-#include "mb_io.h"
-
-/* memory allocation list variables */
-#define	MB_MEMORY_ALLOC_STEP	100
-#define	MB_MEMORY_HEAP_MAX	10000
-static int	mb_mem_debug = MB_NO;
-static int	n_mb_alloc = 0;
-static void	*mb_alloc_ptr[MB_MEMORY_HEAP_MAX];
-static size_t	mb_alloc_size[MB_MEMORY_HEAP_MAX];
-static mb_name	mb_alloc_sourcefile[MB_MEMORY_HEAP_MAX];
-static int	mb_alloc_sourceline[MB_MEMORY_HEAP_MAX];
-static int	mb_alloc_overflow = MB_NO;
-
-/* Local debug define */
-/* #define MB_MEM_DEBUG 1 */
-
-static char svn_id[]="$Id: mb_mem.c 2229 2015-02-14 23:04:41Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mb_mem_debug_on(int verbose, int *error)
-{
-	char	*function_name = "mb_mem_debug_on";
-	int	status = MB_SUCCESS;
-	int	i;
-
-	/* turn debug output on */
-	mb_mem_debug = MB_YES;
-
-	/* print input debug statements */
-	if (verbose >= 2 || mb_mem_debug)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* print debug statements */
-	if (verbose >= 6 || mb_mem_debug)
-		{
-		fprintf(stderr,"\ndbg6  Allocated memory list in MBIO function <%s>\n",
-			function_name);
-		for (i=0;i<n_mb_alloc;i++)
-			fprintf(stderr,"dbg6       i:%d  ptr:%p  size:%zu source:%s line:%d\n",
-				i,(void *)mb_alloc_ptr[i],mb_alloc_size[i],
-				mb_alloc_sourcefile[i],mb_alloc_sourceline[i]);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2 || mb_mem_debug)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mb_mem_debug_off(int verbose, int *error)
-{
-	char	*function_name = "mb_mem_debug_off";
-	int	status = MB_SUCCESS;
-	int	i;
-
-	/* turn debug output off */
-	mb_mem_debug = MB_NO;
-
-	/* print input debug statements */
-	if (verbose >= 2 || mb_mem_debug)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* print debug statements */
-	if (verbose >= 6 || mb_mem_debug)
-		{
-		fprintf(stderr,"\ndbg6  Allocated memory list in MBIO function <%s>\n",
-			function_name);
-		for (i=0;i<n_mb_alloc;i++)
-			fprintf(stderr,"dbg6       i:%d  ptr:%p  size:%zu source:%s line:%d\n",
-				i,(void *)mb_alloc_ptr[i],mb_alloc_size[i],
-				mb_alloc_sourcefile[i],mb_alloc_sourceline[i]);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2 || mb_mem_debug)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mb_malloc(int verbose, size_t size, void **ptr, int *error)
-{
-	char	*function_name = "mb_malloc";
-	int	status = MB_SUCCESS;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2 || mb_mem_debug)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       size:       %zu\n",size);
-		fprintf(stderr,"dbg2       ptr:        %p\n",(void *)ptr);
-		fprintf(stderr,"dbg2       *ptr:       %p\n",(void *)*ptr);
-		}
-
-	/* allocate memory */
-	*ptr = NULL;
-	if (size > 0)
-		{
-		if ((*ptr = (char *) malloc(size)) == NULL)
-			{
-			*error = MB_ERROR_MEMORY_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-	else
-		{
-		*ptr = NULL;
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-		}
-
-	/* print debug statements */
-	if ((verbose >= 5 || mb_mem_debug) && size > 0)
-		{
-		fprintf(stderr,"\ndbg5  Memory allocated in MBIO function <%s>\n",
-			function_name);
-		fprintf(stderr,"dbg5       i:%d  ptr:%p  size:%zu\n",
-			n_mb_alloc,(void *)*ptr,size);
-		}
-
-	/* add to list if size > 0 */
-	if (size > 0)
-		{
-		if (n_mb_alloc < MB_MEMORY_HEAP_MAX)
-			{
-			mb_alloc_ptr[n_mb_alloc] = *ptr;
-			mb_alloc_size[n_mb_alloc] = size;
-			n_mb_alloc++;
-			}
-		else
-			{
-			mb_alloc_overflow = MB_YES;
-#ifdef MB_MEM_DEBUG
-		fprintf(stderr,"NOTICE: mbm_mem overflow pointer allocated %d in function %s\n",*ptr, function_name);
-#endif
-			}
-		}
-
-	/* print debug statements */
-	if (verbose >= 6 || mb_mem_debug)
-		{
-		fprintf(stderr,"\ndbg6  Allocated memory list in MBIO function <%s>\n",
-			function_name);
-		for (i=0;i<n_mb_alloc;i++)
-			fprintf(stderr,"dbg6       i:%d  ptr:%p  size:%zu source:%s line:%d\n",
-				i,(void *)mb_alloc_ptr[i],mb_alloc_size[i],
-				mb_alloc_sourcefile[i],mb_alloc_sourceline[i]);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2 || mb_mem_debug)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       ptr:        %p\n",(void *)*ptr);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_mallocd(int verbose, const char *sourcefile, int sourceline,
-		size_t size, void **ptr, int *error)
-{
-	char	*function_name = "mb_mallocd";
-	int	status = MB_SUCCESS;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2 || mb_mem_debug)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       sourcefile: %s\n",sourcefile);
-		fprintf(stderr,"dbg2       sourceline: %d\n",sourceline);
-		fprintf(stderr,"dbg2       size:       %zu\n",size);
-		fprintf(stderr,"dbg2       ptr:        %p\n",(void *)ptr);
-		fprintf(stderr,"dbg2       *ptr:       %p\n",(void *)*ptr);
-		}
-
-	/* allocate memory */
-	*ptr = NULL;
-	if (size > 0)
-		{
-		if ((*ptr = (char *) malloc(size)) == NULL)
-			{
-			*error = MB_ERROR_MEMORY_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-	else
-		{
-		*ptr = NULL;
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-		}
-
-	/* print debug statements */
-	if ((verbose >= 5 || mb_mem_debug) && size > 0)
-		{
-		fprintf(stderr,"\ndbg5  Memory allocated in MBIO function <%s>\n",
-			function_name);
-		fprintf(stderr,"dbg5       i:%d  ptr:%p  size:%zu\n",
-			n_mb_alloc,(void *)*ptr,size);
-		}
-
-	/* add to list if size > 0 */
-	if (size > 0)
-		{
-		if (n_mb_alloc < MB_MEMORY_HEAP_MAX)
-			{
-			mb_alloc_ptr[n_mb_alloc] = *ptr;
-			mb_alloc_size[n_mb_alloc] = size;
-			strncpy(mb_alloc_sourcefile[n_mb_alloc],sourcefile,MB_NAME_LENGTH-1);
-			mb_alloc_sourceline[n_mb_alloc] = sourceline;
-			n_mb_alloc++;
-			}
-		else
-			{
-			mb_alloc_overflow = MB_YES;
-#ifdef MB_MEM_DEBUG
-		fprintf(stderr,"NOTICE: mbm_mem overflow pointer allocated %d in function %s\n",*ptr, function_name);
-#endif
-			}
-		}
-
-	/* print debug statements */
-	if (verbose >= 6 || mb_mem_debug)
-		{
-		fprintf(stderr,"\ndbg6  Allocated memory list in MBIO function <%s>\n",
-			function_name);
-		for (i=0;i<n_mb_alloc;i++)
-			fprintf(stderr,"dbg6       i:%d  ptr:%p  size:%zu source:%s line:%d\n",
-				i,(void *)mb_alloc_ptr[i],mb_alloc_size[i],
-				mb_alloc_sourcefile[i],mb_alloc_sourceline[i]);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2 || mb_mem_debug)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       ptr:        %p\n",(void *)*ptr);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_realloc(int verbose, size_t size, void **ptr, int *error)
-{
-	char	*function_name = "mb_realloc";
-	int	status = MB_SUCCESS;
-	int	i;
-	int	iptr;
-
-	/* print input debug statements */
-	if (verbose >= 2 || mb_mem_debug)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       size:       %zu\n",size);
-		fprintf(stderr,"dbg2       ptr:        %p\n",(void *)ptr);
-		fprintf(stderr,"dbg2       *ptr:       %p\n",(void *)*ptr);
-		}
-
-	/* check if pointer is in list */
-	iptr = -1;
-	for (i=0;i<n_mb_alloc;i++)
-		if (mb_alloc_ptr[i] == *ptr)
-			iptr = i;
-
-	/* if pointer is non-NULL use realloc */
-	if (*ptr != NULL)
-	    *ptr = (char *) realloc(*ptr, size);
-
-	/* if pointer is NULL use malloc */
-	else if (size > 0)
-	    *ptr = (char *) malloc(size);
-
-	/* check for success */
-	if (size > 0 && *ptr == NULL)
-	    {
-	    *error = MB_ERROR_MEMORY_FAIL;
-	    status = MB_FAILURE;
-	    }
-	else
-	    {
-	    *error = MB_ERROR_NO_ERROR;
-	    status = MB_SUCCESS;
-	    }
-
-	/* if pointer was already in list update it */
-	if (status == MB_SUCCESS
-	    && iptr > -1)
-	    {
-	    /* if pointer non-NULL update it */
-	    if (size > 0 && *ptr != NULL)
-		{
-		mb_alloc_ptr[iptr] = *ptr;
-		mb_alloc_size[iptr] = size;
-		}
-
-	    /* else remove it from list */
-	    else
-		{
-		for (i=iptr;i<n_mb_alloc-1;i++)
-			{
-			mb_alloc_ptr[i] = mb_alloc_ptr[i+1];
-			mb_alloc_size[i] = mb_alloc_size[i+1];
-			}
-		n_mb_alloc--;
-		}
-	    }
-
-	/* else add to list if possible if size > 0 */
-	else if (status == MB_SUCCESS
-	    && size > 0)
-	    {
-	    if (n_mb_alloc < MB_MEMORY_HEAP_MAX)
-		{
-		mb_alloc_ptr[n_mb_alloc] = *ptr;
-		mb_alloc_size[n_mb_alloc] = size;
-		n_mb_alloc++;
-		}
-	    else
-		{
-		mb_alloc_overflow = MB_YES;
-#ifdef MB_MEM_DEBUG
-		fprintf(stderr,"NOTICE: mbm_mem overflow pointer allocated %p in function %s\n",*ptr, function_name);
-#endif
-		}
-	    }
-
-	/* print debug statements */
-	if ((verbose >= 5 || mb_mem_debug) && size > 0)
-		{
-		fprintf(stderr,"\ndbg5  Memory reallocated in MBIO function <%s>\n",
-			function_name);
-		fprintf(stderr,"dbg5       i:%d  ptr:%p  size:%zu\n",
-			n_mb_alloc,(void *)*ptr,size);
-		}
-
-	/* print debug statements */
-	if (verbose >= 6 || mb_mem_debug)
-		{
-		fprintf(stderr,"\ndbg6  Allocated memory list in MBIO function <%s>\n",
-			function_name);
-		for (i=0;i<n_mb_alloc;i++)
-			fprintf(stderr,"dbg6       i:%d  ptr:%p  size:%zu source:%s line:%d\n",
-				i,(void *)mb_alloc_ptr[i],mb_alloc_size[i],
-				mb_alloc_sourcefile[i],mb_alloc_sourceline[i]);
-		}
-
-	/* assume success */
-	*error = MB_ERROR_NO_ERROR;
-	status = MB_SUCCESS;
-
-	/* print output debug statements */
-	if (verbose >= 2 || mb_mem_debug)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       ptr:        %p\n",(void *)*ptr);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_reallocd(int verbose, const char *sourcefile, int sourceline,
-		size_t size, void **ptr, int *error)
-{
-	char	*function_name = "mb_reallocd";
-	int	status = MB_SUCCESS;
-	int	i;
-	int	iptr;
-
-	/* print input debug statements */
-	if (verbose >= 2 || mb_mem_debug)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       sourcefile: %s\n",sourcefile);
-		fprintf(stderr,"dbg2       sourceline: %d\n",sourceline);
-		fprintf(stderr,"dbg2       size:       %zu\n",size);
-		fprintf(stderr,"dbg2       ptr:        %p\n",(void *)ptr);
-		fprintf(stderr,"dbg2       *ptr:       %p\n",(void *)*ptr);
-		}
-
-	/* check if pointer is in list */
-	iptr = -1;
-	for (i=0;i<n_mb_alloc;i++)
-		if (mb_alloc_ptr[i] == *ptr)
-			iptr = i;
-
-	/* if pointer is non-NULL use realloc */
-	if (*ptr != NULL)
-	    *ptr = (char *) realloc(*ptr, size);
-
-	/* if pointer is NULL use malloc */
-	else if (size > 0)
-	    *ptr = (char *) malloc(size);
-
-	/* check for success */
-	if (size > 0 && *ptr == NULL)
-	    {
-	    *error = MB_ERROR_MEMORY_FAIL;
-	    status = MB_FAILURE;
-	    }
-	else
-	    {
-	    *error = MB_ERROR_NO_ERROR;
-	    status = MB_SUCCESS;
-	    }
-
-	/* if pointer was already in list update it */
-	if (status == MB_SUCCESS
-	    && iptr > -1)
-	    {
-	    /* if pointer non-NULL update it */
-	    if (size > 0 && *ptr != NULL)
-		{
-		mb_alloc_ptr[iptr] = *ptr;
-		mb_alloc_size[iptr] = size;
-		strncpy(mb_alloc_sourcefile[iptr],sourcefile,MB_NAME_LENGTH-1);
-		mb_alloc_sourceline[iptr] = sourceline;
-		}
-
-	    /* else remove it from list */
-	    else
-		{
-		for (i=iptr;i<n_mb_alloc-1;i++)
-			{
-			mb_alloc_ptr[i] = mb_alloc_ptr[i+1];
-			mb_alloc_size[i] = mb_alloc_size[i+1];
-			strncpy(mb_alloc_sourcefile[i],mb_alloc_sourcefile[i+1],MB_NAME_LENGTH-1);
-			mb_alloc_sourceline[i] = mb_alloc_sourceline[i+1];
-			}
-		n_mb_alloc--;
-		}
-	    }
-
-	/* else add to list if possible if size > 0 */
-	else if (status == MB_SUCCESS
-	    && size > 0)
-	    {
-	    if (n_mb_alloc < MB_MEMORY_HEAP_MAX)
-		{
-		mb_alloc_ptr[n_mb_alloc] = *ptr;
-		mb_alloc_size[n_mb_alloc] = size;
-		strncpy(mb_alloc_sourcefile[n_mb_alloc],sourcefile,MB_NAME_LENGTH-1);
-		mb_alloc_sourceline[n_mb_alloc] = sourceline;
-		n_mb_alloc++;
-		}
-	    else
-		{
-		mb_alloc_overflow = MB_YES;
-#ifdef MB_MEM_DEBUG
-		fprintf(stderr,"NOTICE: mbm_mem overflow pointer allocated %d in function %s\n",*ptr, function_name);
-#endif
-		}
-	    }
-
-	/* print debug statements */
-	if ((verbose >= 5 || mb_mem_debug) && size > 0)
-		{
-		fprintf(stderr,"\ndbg5  Memory reallocated in MBIO function <%s>\n",
-			function_name);
-		fprintf(stderr,"dbg5       i:%d  ptr:%p  size:%zu source:%s line:%d\n",
-			n_mb_alloc,(void *)*ptr,size,sourcefile,sourceline);
-		}
-
-	/* print debug statements */
-	if (verbose >= 6 || mb_mem_debug)
-		{
-		fprintf(stderr,"\ndbg6  Allocated memory list in MBIO function <%s>\n",
-			function_name);
-		for (i=0;i<n_mb_alloc;i++)
-			fprintf(stderr,"dbg6       i:%d  ptr:%p  size:%zu source:%s line:%d\n",
-				i,(void *)mb_alloc_ptr[i],mb_alloc_size[i],
-				mb_alloc_sourcefile[i],mb_alloc_sourceline[i]);
-		}
-
-	/* assume success */
-	*error = MB_ERROR_NO_ERROR;
-	status = MB_SUCCESS;
-
-	/* print output debug statements */
-	if (verbose >= 2 || mb_mem_debug)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       ptr:        %p\n",(void *)*ptr);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_free(int verbose, void **ptr, int *error)
-{
-	char	*function_name = "mb_free";
-	int	status = MB_SUCCESS;
-	int	i;
-	int	iptr;
-	size_t	ptrsize;
-	void	*ptrvalue;
-
-	/* print input debug statements */
-	if (verbose >= 2 || mb_mem_debug)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       ptr:        %p\n",(void *)*ptr);
-		}
-
-	/* check if pointer is in list */
-	iptr = -1;
-	for (i=0;i<n_mb_alloc;i++)
-		if (mb_alloc_ptr[i] == *ptr)
-			iptr = i;
-
-	/* if pointer is in list remove it from list
-		and deallocate the memory */
-	if (iptr > -1)
-		{
-		/* remove it from list */
-		ptrvalue = mb_alloc_ptr[iptr];
-		ptrsize = mb_alloc_size[iptr];
-		for (i=iptr;i<n_mb_alloc-1;i++)
-			{
-			mb_alloc_ptr[i] = mb_alloc_ptr[i+1];
-			mb_alloc_size[i] = mb_alloc_size[i+1];
-			strncpy(mb_alloc_sourcefile[i],mb_alloc_sourcefile[i+1],MB_NAME_LENGTH-1);
-			mb_alloc_sourceline[i] = mb_alloc_sourceline[i+1];
-			}
-		n_mb_alloc--;
-
-		/* free the memory */
-		free(*ptr);
-		*ptr = NULL;
-		}
-
-	/* else deallocate the memory if pointer is non-null and
-		heap overflow has occurred */
-	else if (mb_alloc_overflow == MB_YES && *ptr != NULL)
-		{
-#ifdef MB_MEM_DEBUG
-		fprintf(stderr,"NOTICE: mbm_mem overflow pointer freed %d in function %s\n",*ptr, function_name);
-#endif
-		/* free the memory */
-		free(*ptr);
-		*ptr = NULL;
-		}
-
-	/* print debug statements */
-	if ((verbose >= 5 || mb_mem_debug) && iptr > -1)
-		{
-		fprintf(stderr,"\ndbg5  Allocated memory freed in MBIO function <%s>\n",
-			function_name);
-		fprintf(stderr,"dbg5       i:%d  ptr:%p  size:%zu\n",
-			iptr,ptrvalue,ptrsize);
-		}
-
-	/* print debug statements */
-	if (verbose >= 6 || mb_mem_debug)
-		{
-		fprintf(stderr,"\ndbg6  Allocated memory list in MBIO function <%s>\n",
-			function_name);
-		for (i=0;i<n_mb_alloc;i++)
-			fprintf(stderr,"dbg6       i:%d  ptr:%p  size:%zu source:%s line:%d\n",
-				i,(void *)mb_alloc_ptr[i],mb_alloc_size[i],
-				mb_alloc_sourcefile[i],mb_alloc_sourceline[i]);
-		}
-
-	/* assume success */
-	*error = MB_ERROR_NO_ERROR;
-	status = MB_SUCCESS;
-
-	/* print output debug statements */
-	if (verbose >= 2 || mb_mem_debug)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_freed(int verbose, const char *sourcefile, int sourceline, void **ptr, int *error)
-{
-	char	*function_name = "mb_freed";
-	int	status = MB_SUCCESS;
-	int	i;
-	int	iptr;
-	size_t	ptrsize;
-	long	ptrvalue;
-
-	/* print input debug statements */
-	if (verbose >= 2 || mb_mem_debug)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       sourcefile: %s\n",sourcefile);
-		fprintf(stderr,"dbg2       sourceline: %d\n",sourceline);
-		fprintf(stderr,"dbg2       ptr:        %p\n",(void *)*ptr);
-		}
-
-	/* check if pointer is in list */
-	iptr = -1;
-	for (i=0;i<n_mb_alloc;i++)
-		if (mb_alloc_ptr[i] == *ptr)
-			iptr = i;
-
-	/* if pointer is in list remove it from list
-		and deallocate the memory */
-	if (iptr > -1)
-		{
-		/* remove it from list */
-		ptrvalue = (size_t) mb_alloc_ptr[iptr];
-		ptrsize = mb_alloc_size[iptr];
-		for (i=iptr;i<n_mb_alloc-1;i++)
-			{
-			mb_alloc_ptr[i] = mb_alloc_ptr[i+1];
-			mb_alloc_size[i] = mb_alloc_size[i+1];
-			strncpy(mb_alloc_sourcefile[i],mb_alloc_sourcefile[i+1],MB_NAME_LENGTH-1);
-			mb_alloc_sourceline[i] = mb_alloc_sourceline[i+1];
-			}
-		n_mb_alloc--;
-
-		/* free the memory */
-		free(*ptr);
-		*ptr = NULL;
-		}
-
-	/* else deallocate the memory if pointer is non-null and
-		heap overflow has occurred */
-	else if (mb_alloc_overflow == MB_YES && *ptr != NULL)
-		{
-#ifdef MB_MEM_DEBUG
-		fprintf(stderr,"NOTICE: mbm_mem overflow pointer freed %d in function %s\n",*ptr, function_name);
-#endif
-		/* free the memory */
-		free(*ptr);
-		*ptr = NULL;
-		}
-
-	/* print debug statements */
-	if ((verbose >= 5 || mb_mem_debug) && iptr > -1)
-		{
-		fprintf(stderr,"\ndbg5  Allocated memory freed in MBIO function <%s>\n",
-			function_name);
-		fprintf(stderr,"dbg5       i:%d  ptr:%p  size:%zu\n",
-			iptr,(void *)ptrvalue,ptrsize);
-		}
-
-	/* print debug statements */
-	if (verbose >= 6 || mb_mem_debug)
-		{
-		fprintf(stderr,"\ndbg6  Allocated memory list in MBIO function <%s>\n",
-			function_name);
-		for (i=0;i<n_mb_alloc;i++)
-			fprintf(stderr,"dbg6       i:%d  ptr:%p  size:%zu source:%s line:%d\n",
-				i,(void *)mb_alloc_ptr[i],mb_alloc_size[i],
-				mb_alloc_sourcefile[i],mb_alloc_sourceline[i]);
-		}
-
-	/* assume success */
-	*error = MB_ERROR_NO_ERROR;
-	status = MB_SUCCESS;
-
-	/* print output debug statements */
-	if (verbose >= 2 || mb_mem_debug)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_memory_clear(int verbose, int *error)
-{
-	char	*function_name = "mb_memory_clear";
-	int	status = MB_SUCCESS;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2 || mb_mem_debug)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* loop over all allocated memory */
-	for (i=0;i<n_mb_alloc;i++)
-		{
-		/* print debug statements */
-		if (verbose >= 5 || mb_mem_debug)
-			{
-			fprintf(stderr,"\ndbg5  Allocated memory freed in MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4       i:%d  ptr:%12p  size:%zu\n",
-				i,(void *)mb_alloc_ptr[i],mb_alloc_size[i]);
-			}
-
-		/* free the memory */
-		if (mb_alloc_ptr[i] != NULL)
-			free(mb_alloc_ptr[i]);
-		mb_alloc_ptr[i] = NULL;
-		mb_alloc_size[i] = 0;
-		(mb_alloc_sourcefile[i])[0] = 0;
-		mb_alloc_sourceline[i] = 0;
-		}
-	n_mb_alloc = 0;
-
-	/* assume success */
-	*error = MB_ERROR_NO_ERROR;
-	status = MB_SUCCESS;
-
-	/* print output debug statements */
-	if (verbose >= 2 || mb_mem_debug)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_memory_status(int verbose, int *nalloc, int *nallocmax,
-			int *overflow, size_t *allocsize, int *error)
-{
-	char	*function_name = "mb_memory_status";
-	int	status = MB_SUCCESS;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2 || mb_mem_debug)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* get status */
-	*nalloc = n_mb_alloc;
-	*nallocmax = MB_MEMORY_HEAP_MAX;
-	*overflow = mb_alloc_overflow;
-	*allocsize = 0;
-	for (i=0;i<n_mb_alloc;i++)
-		*allocsize += mb_alloc_size[i];
-
-	/* assume success */
-	*error = MB_ERROR_NO_ERROR;
-	status = MB_SUCCESS;
-
-	/* print output debug statements */
-	if (verbose >= 2 || mb_mem_debug)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       nalloc:     %d\n",*nalloc);
-		fprintf(stderr,"dbg2       nallocmax:  %d\n",*nallocmax);
-		fprintf(stderr,"dbg2       overflow:   %d\n",*overflow);
-		fprintf(stderr,"dbg2       allocsize:  %zu\n",*allocsize);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_memory_list(int verbose, int *error)
-{
-	char	*function_name = "mb_memory_list";
-	int	status = MB_SUCCESS;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2 || mb_mem_debug)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* print debug statements */
-	if ((verbose >= 4  || mb_mem_debug) && n_mb_alloc > 0)
-		{
-		fprintf(stderr,"\ndbg4  Allocated memory list in MBIO function <%s>\n",
-			function_name);
-		for (i=0;i<n_mb_alloc;i++)
-			fprintf(stderr,"dbg6       i:%d  ptr:%p  size:%zu source:%s line:%d\n",
-				i,(void *)mb_alloc_ptr[i],mb_alloc_size[i],
-				mb_alloc_sourcefile[i],mb_alloc_sourceline[i]);
-		}
-	else if (verbose >= 4 || mb_mem_debug)
-		{
-		fprintf(stderr,"\ndbg4  No memory currently allocated in MBIO function <%s>\n",
-			function_name);
-		}
-
-	/* assume success */
-	*error = MB_ERROR_NO_ERROR;
-	status = MB_SUCCESS;
-
-	/* print output debug statements */
-	if (verbose >= 2 || mb_mem_debug)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_register_array(int verbose, void *mbio_ptr,
-		int type, size_t size, void **handle, int *error)
-{
-	static char svn_id[]="$Id: mb_mem.c 2229 2015-02-14 23:04:41Z caress $";
-	char	*function_name = "mb_register_array";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	int	nalloc;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2 || mb_mem_debug)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       type:       %d\n",type);
-		fprintf(stderr,"dbg2       size:       %p\n",(void *)size);
-		fprintf(stderr,"dbg2       handle:     %lx\n",(size_t)handle);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* allocate larger array for register if necessary */
-	if (mb_io_ptr->n_regarray >= mb_io_ptr->n_regarray_alloc)
-		{
-		mb_io_ptr->n_regarray_alloc += MB_MEMORY_ALLOC_STEP;
-		status = mb_realloc(verbose, mb_io_ptr->n_regarray_alloc * sizeof(void *),
-					(void **)&(mb_io_ptr->regarray_handle), error);
-		if (status == MB_SUCCESS)
-		status = mb_realloc(verbose, mb_io_ptr->n_regarray_alloc * sizeof(void *),
-					(void **)&(mb_io_ptr->regarray_ptr), error);
-		if (status == MB_SUCCESS)
-		status = mb_realloc(verbose, mb_io_ptr->n_regarray_alloc * sizeof(void *),
-					(void **)&(mb_io_ptr->regarray_oldptr), error);
-		if (status == MB_SUCCESS)
-		status = mb_realloc(verbose, mb_io_ptr->n_regarray_alloc * sizeof(int),
-					(void **)&(mb_io_ptr->regarray_type), error);
-		if (status == MB_SUCCESS)
-		status = mb_realloc(verbose, mb_io_ptr->n_regarray_alloc * sizeof(size_t),
-					(void **)&(mb_io_ptr->regarray_size), error);
-		for (i=mb_io_ptr->n_regarray;i<mb_io_ptr->n_regarray_alloc;i++)
-			{
-			mb_io_ptr->regarray_handle[i] = NULL;
-			mb_io_ptr->regarray_ptr[i] = NULL;
-			mb_io_ptr->regarray_oldptr[i] = NULL;
-			mb_io_ptr->regarray_type[i] = MB_MEM_TYPE_NONE;
-			mb_io_ptr->regarray_size[i] = 0;
-			}
-		}
-
-	/* register the array */
-	if (status == MB_SUCCESS)
-		{
-		/* get dimension of desired array */
-		if (type == MB_MEM_TYPE_BATHYMETRY)
-			nalloc = mb_io_ptr->beams_bath_max;
-		else if (type == MB_MEM_TYPE_AMPLITUDE)
-			nalloc = mb_io_ptr->beams_amp_max;
-		else if (type == MB_MEM_TYPE_SIDESCAN)
-			nalloc = mb_io_ptr->pixels_ss_max;
-		else
-			nalloc = 0;
-
-		/* allocate the array - always allocate at least one dimension so the pointer is non-null */
-		if (nalloc <= 0)
-			nalloc = 1;
-		status = mb_realloc(verbose, nalloc * size,
-					handle, error);
-		if (status == MB_SUCCESS)
-			{
-			mb_io_ptr->regarray_handle[mb_io_ptr->n_regarray] = (void *) (handle);
-			mb_io_ptr->regarray_ptr[mb_io_ptr->n_regarray] = (void *) (*handle);
-			mb_io_ptr->regarray_oldptr[mb_io_ptr->n_regarray] = NULL;
-			mb_io_ptr->regarray_type[mb_io_ptr->n_regarray] = type;
-			mb_io_ptr->regarray_size[mb_io_ptr->n_regarray] = size;
-			mb_io_ptr->n_regarray++;
-/*fprintf(stderr,"Array registered: handle:%lx ptr:%lx  stored handle:%lx ptr:%lx type:%d size:%zu\n",
-(size_t)handle, (size_t)*handle,
-(size_t)mb_io_ptr->regarray_handle[mb_io_ptr->n_regarray-1],
-(size_t)mb_io_ptr->regarray_ptr[mb_io_ptr->n_regarray-1],
-mb_io_ptr->regarray_type[mb_io_ptr->n_regarray-1],
-mb_io_ptr->regarray_size[mb_io_ptr->n_regarray-1]);*/
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2 || mb_mem_debug)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       *handle:    %p\n",(void *)*handle);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_update_arrays(int verbose, void *mbio_ptr,
-		int nbath, int namp, int nss, int *error)
-{
-	static char svn_id[]="$Id: mb_mem.c 2229 2015-02-14 23:04:41Z caress $";
-	char	*function_name = "mb_update_arrays";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	void	**handle;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2 || mb_mem_debug)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       nbath:      %d\n",nbath);
-		fprintf(stderr,"dbg2       namp:       %d\n",namp);
-		fprintf(stderr,"dbg2       nss:        %d\n",nss);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-//fprintf(stderr,"\nSTART mb_update_arrays: nbath:%d %d  namp:%d %d  nss:%d %d\n",
-//nbath,mb_io_ptr->beams_bath_alloc,
-//namp,mb_io_ptr->beams_amp_alloc,
-//nss,mb_io_ptr->pixels_ss_alloc);
-//fprintf(stderr,"KEYPTRS1:\n\tbeamflag: %p\n\tbath:     %p\n\tbathxtrk: %p\n\tbathltrk: %p\n\tbathnum:  %p\n",
-//mb_io_ptr->beamflag,mb_io_ptr->bath,mb_io_ptr->bath_acrosstrack,mb_io_ptr->bath_alongtrack,mb_io_ptr->bath_num);
-//fprintf(stderr,"KEYHNDL1:\n\tbeamflag: %p\n\tbath:     %p\n\tbathxtrk: %p\n\tbathltrk: %p\n\tbathnum:  %p\n",
-//&mb_io_ptr->beamflag,&mb_io_ptr->bath,&mb_io_ptr->bath_acrosstrack,&mb_io_ptr->bath_alongtrack,&mb_io_ptr->bath_num);
-//if (mb_io_ptr->beamflag != NULL)
-//{
-//fprintf(stderr,"VALUES1: \n\tbeamflag: %d\n\tbath:     %f\n\tbathxtrk: %f\n\tbathltrk: %f\n\tbathnum:  %d\n",
-//mb_io_ptr->beamflag[0],mb_io_ptr->bath[0],mb_io_ptr->bath_acrosstrack[0],mb_io_ptr->bath_alongtrack[0],mb_io_ptr->bath_num[0]);
-//for (i=0;i<mb_io_ptr->beams_bath_alloc;i++)
-//{
-//fprintf(stderr,"%d ",mb_io_ptr->beamflag[i]);
-//if (i%25==0 || i==mb_io_ptr->beams_bath_alloc-1) fprintf(stderr,"\n");
-//}
-//}
-
-	/* reallocate larger arrays if necessary */
-	if (nbath > mb_io_ptr->beams_bath_alloc)
-		{
-		/* set allocation size */
-		if (nbath < 1024)
-			{
-			mb_io_ptr->beams_bath_alloc = (nbath / 256) * 256;
-			if (nbath % 256 > 0)
-				mb_io_ptr->beams_bath_alloc += 256;
-			}
-		else
-			{
-			mb_io_ptr->beams_bath_alloc = (nbath / 1024) * 1024;
-			if (nbath % 1024 > 0)
-				mb_io_ptr->beams_bath_alloc += 1024;
-			}
-//fprintf(stderr,"CHECK mb_update_arrays: nbath:%d %d  namp:%d %d  nss:%d %d\n",
-//nbath,mb_io_ptr->beams_bath_alloc,
-//namp,mb_io_ptr->beams_amp_alloc,
-//nss,mb_io_ptr->pixels_ss_alloc);
-
-
-		/* allocate mb_io_ptr arrays */
-		if (status == MB_SUCCESS)
-			status = mb_realloc(verbose,mb_io_ptr->beams_bath_alloc*sizeof(char),
-					(void **)&mb_io_ptr->beamflag,error);
-		if (status == MB_SUCCESS)
-			status = mb_realloc(verbose,mb_io_ptr->beams_bath_alloc*sizeof(double),
-					(void **)&mb_io_ptr->bath,error);
-		if (status == MB_SUCCESS)
-			status = mb_realloc(verbose,mb_io_ptr->beams_bath_alloc*sizeof(double),
-					(void **)&mb_io_ptr->bath_acrosstrack,error);
-		if (status == MB_SUCCESS)
-			status = mb_realloc(verbose,mb_io_ptr->beams_bath_alloc*sizeof(double),
-					(void **)&mb_io_ptr->bath_alongtrack,error);
-		if (status == MB_SUCCESS)
-			status = mb_realloc(verbose,mb_io_ptr->beams_bath_alloc*sizeof(int),
-					(void **)&mb_io_ptr->bath_num,error);
-		if (status == MB_SUCCESS)
-			status = mb_realloc(verbose,mb_io_ptr->beams_bath_alloc*sizeof(char),
-					(void **)&mb_io_ptr->new_beamflag,error);
-		if (status == MB_SUCCESS)
-			status = mb_realloc(verbose,mb_io_ptr->beams_bath_alloc*sizeof(double),
-					(void **)&mb_io_ptr->new_bath,error);
-		if (status == MB_SUCCESS)
-			status = mb_realloc(verbose,mb_io_ptr->beams_bath_alloc*sizeof(double),
-					(void **)&mb_io_ptr->new_bath_acrosstrack,error);
-		if (status == MB_SUCCESS)
-			status = mb_realloc(verbose,mb_io_ptr->beams_bath_alloc*sizeof(double),
-					(void **)&mb_io_ptr->new_bath_alongtrack,error);
-		for (i=mb_io_ptr->beams_bath_max;i<mb_io_ptr->beams_bath_alloc;i++)
-			{
-			mb_io_ptr->beamflag[i] = 0;
-			mb_io_ptr->bath[i] = 0.0;
-			mb_io_ptr->bath_acrosstrack[i] = 0.0;
-			mb_io_ptr->bath_alongtrack[i] = 0.0;
-			mb_io_ptr->bath_num[i] = 0;
-			mb_io_ptr->new_beamflag[i] = 0;
-			mb_io_ptr->new_bath[i] = 0.0;
-			mb_io_ptr->new_bath_acrosstrack[i] = 0.0;
-			mb_io_ptr->new_bath_alongtrack[i] = 0.0;
-			}
-		mb_io_ptr->beams_bath_max = nbath;
-//fprintf(stderr,"KEYPTRS2:\n\tbeamflag: %p\n\tbath:     %p\n\tbathxtrk: %p\n\tbathltrk: %p\n\tbathnum:  %p\n",
-//mb_io_ptr->beamflag,mb_io_ptr->bath,mb_io_ptr->bath_acrosstrack,mb_io_ptr->bath_alongtrack,mb_io_ptr->bath_num);
-//fprintf(stderr,"KEYHNDL2:\n\tbeamflag: %p\n\tbath:     %p\n\tbathxtrk: %p\n\tbathltrk: %p\n\tbathnum:  %p\n",
-//&mb_io_ptr->beamflag,&mb_io_ptr->bath,&mb_io_ptr->bath_acrosstrack,&mb_io_ptr->bath_alongtrack,&mb_io_ptr->bath_num);
-//if (mb_io_ptr->beamflag != NULL)
-//{
-//fprintf(stderr,"VALUES2: \n\tbeamflag: %d\n\tbath:     %f\n\tbathxtrk: %f\n\tbathltrk: %f\n\tbathnum:  %d\n",
-//mb_io_ptr->beamflag[0],mb_io_ptr->bath[0],mb_io_ptr->bath_acrosstrack[0],mb_io_ptr->bath_alongtrack[0],mb_io_ptr->bath_num[0]);
-//for (i=0;i<mb_io_ptr->beams_bath_alloc;i++)
-//{
-//fprintf(stderr,"%d ",mb_io_ptr->beamflag[i]);
-//if (i%25==0 || i==mb_io_ptr->beams_bath_alloc-1) fprintf(stderr,"\n");
-//}
-//}
-
-		/* allocate registered arrays */
-		for (i=0;i<mb_io_ptr->n_regarray;i++)
-			{
-			/* allocate the bathymetry dimensioned arrays */
-			if (mb_io_ptr->regarray_type[i] == MB_MEM_TYPE_BATHYMETRY
-				&& mb_io_ptr->beams_bath_alloc > 0)
-				{
-				mb_io_ptr->regarray_oldptr[i] = mb_io_ptr->regarray_ptr[i];
-				handle = (void **)(mb_io_ptr->regarray_handle[i]);
-				status = mb_realloc(verbose,
-						mb_io_ptr->beams_bath_alloc * mb_io_ptr->regarray_size[i],
-						handle, error);
-				mb_io_ptr->regarray_ptr[i] = *handle;
-				}
-			}
-
-		/* set reallocation flag */
-		mb_io_ptr->bath_arrays_reallocated = MB_YES;
-		}
-	if (namp > mb_io_ptr->beams_amp_alloc)
-		{
-		/* set allocation size */
-		if (namp < 1024)
-			{
-			mb_io_ptr->beams_amp_alloc = (namp / 256) * 256;
-			if (namp % 256 > 0)
-				mb_io_ptr->beams_amp_alloc += 256;
-			}
-		else
-			{
-			mb_io_ptr->beams_amp_alloc = (namp / 1024) * 1024;
-			if (namp % 1024 > 0)
-				mb_io_ptr->beams_amp_alloc += 1024;
-			}
-
-		if (status == MB_SUCCESS)
-			status = mb_realloc(verbose,mb_io_ptr->beams_amp_alloc*sizeof(double),
-					(void **)&mb_io_ptr->amp,error);
-		if (status == MB_SUCCESS)
-			status = mb_realloc(verbose,mb_io_ptr->beams_amp_alloc*sizeof(int),
-					(void **)&mb_io_ptr->amp_num,error);
-		if (status == MB_SUCCESS)
-			status = mb_realloc(verbose,mb_io_ptr->beams_amp_alloc*sizeof(double),
-					(void **)&mb_io_ptr->new_amp,error);
-		for (i=mb_io_ptr->beams_amp_max;i<mb_io_ptr->beams_amp_alloc;i++)
-			{
-			mb_io_ptr->amp[i] = 0.0;
-			mb_io_ptr->amp_num[i] = 0;
-			mb_io_ptr->new_amp[i] = 0.0;
-			}
-		mb_io_ptr->beams_amp_max = namp;
-
-		/* allocate registered arrays */
-		for (i=0;i<mb_io_ptr->n_regarray;i++)
-			{
-			/* allocate the amplitude dimensioned arrays */
-			if (mb_io_ptr->regarray_type[i] == MB_MEM_TYPE_AMPLITUDE
-				&& mb_io_ptr->beams_amp_alloc > 0)
-				{
-				mb_io_ptr->regarray_oldptr[i] = mb_io_ptr->regarray_ptr[i];
-				handle = (void **)(mb_io_ptr->regarray_handle[i]);
-				status = mb_realloc(verbose,
-						mb_io_ptr->beams_amp_alloc * mb_io_ptr->regarray_size[i],
-						handle, error);
-				mb_io_ptr->regarray_ptr[i] = *handle;
-				}
-			}
-
-		/* set reallocation flag */
-		mb_io_ptr->amp_arrays_reallocated = MB_YES;
-		}
-	if (nss > mb_io_ptr->pixels_ss_alloc)
-		{
-		/* set allocation size */
-		if (nss < 1024)
-			{
-			mb_io_ptr->pixels_ss_alloc = (nss / 256) * 256;
-			if (nss % 256 > 0)
-				mb_io_ptr->pixels_ss_alloc += 256;
-			}
-		else
-			{
-			mb_io_ptr->pixels_ss_alloc = (nss / 1024) * 1024;
-			if (nss % 1024 > 0)
-				mb_io_ptr->pixels_ss_alloc += 1024;
-			}
-
-		if (status == MB_SUCCESS)
-			status = mb_realloc(verbose,mb_io_ptr->pixels_ss_alloc*sizeof(double),
-					(void **)&mb_io_ptr->ss,error);
-		if (status == MB_SUCCESS)
-			status = mb_realloc(verbose,mb_io_ptr->pixels_ss_alloc*sizeof(double),
-					(void **)&mb_io_ptr->ss_acrosstrack,error);
-		if (status == MB_SUCCESS)
-			status = mb_realloc(verbose,mb_io_ptr->pixels_ss_alloc*sizeof(double),
-					(void **)&mb_io_ptr->ss_alongtrack,error);
-		if (status == MB_SUCCESS)
-			status = mb_realloc(verbose,mb_io_ptr->pixels_ss_alloc*sizeof(int),
-					(void **)&mb_io_ptr->ss_num,error);
-		if (status == MB_SUCCESS)
-			status = mb_realloc(verbose,mb_io_ptr->pixels_ss_alloc*sizeof(double),
-					(void **)&mb_io_ptr->new_ss,error);
-		if (status == MB_SUCCESS)
-			status = mb_realloc(verbose,mb_io_ptr->pixels_ss_alloc*sizeof(double),
-					(void **)&mb_io_ptr->new_ss_acrosstrack,error);
-		if (status == MB_SUCCESS)
-			status = mb_realloc(verbose,mb_io_ptr->pixels_ss_alloc*sizeof(double),
-					(void **)&mb_io_ptr->new_ss_alongtrack,error);
-		for (i=mb_io_ptr->pixels_ss_max;i<mb_io_ptr->pixels_ss_alloc;i++)
-			{
-			mb_io_ptr->ss[i] = 0.0;
-			mb_io_ptr->ss_acrosstrack[i] = 0.0;
-			mb_io_ptr->ss_alongtrack[i] = 0.0;
-			mb_io_ptr->ss_num[i] = 0;
-			mb_io_ptr->new_ss[i] = 0.0;
-			mb_io_ptr->new_ss_acrosstrack[i] = 0.0;
-			mb_io_ptr->new_ss_alongtrack[i] = 0.0;
-			}
-		mb_io_ptr->pixels_ss_max = nss;
-
-		/* allocate registered arrays */
-		for (i=0;i<mb_io_ptr->n_regarray;i++)
-			{
-			/* allocate the sidescan dimensioned arrays */
-			if (mb_io_ptr->regarray_type[i] == MB_MEM_TYPE_SIDESCAN
-				&& mb_io_ptr->pixels_ss_alloc > 0)
-				{
-				mb_io_ptr->regarray_oldptr[i] = mb_io_ptr->regarray_ptr[i];
-				handle = (void **)(mb_io_ptr->regarray_handle[i]);
-				status = mb_realloc(verbose,
-						mb_io_ptr->pixels_ss_alloc * mb_io_ptr->regarray_size[i],
-						handle, error);
-				mb_io_ptr->regarray_ptr[i] = *handle;
-				}
-			}
-
-		/* set reallocation flag */
-		mb_io_ptr->ss_arrays_reallocated = MB_YES;
-		}
-
-	/* deal with a memory allocation failure */
-	if (status == MB_FAILURE)
-		{
-		/* free the registered arrays */
-		for (i=0;i<mb_io_ptr->n_regarray;i++)
-			{
-			/* free all arrays */
-			if (mb_io_ptr->regarray_handle[i] != NULL)
-				{
-				status = mb_free(verbose, (void **)(mb_io_ptr->regarray_handle[i]), error);
-				}
-			}
-
-		/* free the standard arrays */
-		status = mb_free(verbose,(void **)&mb_io_ptr->beamflag,error);
-		status = mb_free(verbose,(void **)&mb_io_ptr->bath,error);
-		status = mb_free(verbose,(void **)&mb_io_ptr->amp,error);
-		status = mb_free(verbose,(void **)&mb_io_ptr->bath_acrosstrack,error);
-		status = mb_free(verbose,(void **)&mb_io_ptr->bath_alongtrack,error);
-		status = mb_free(verbose,(void **)&mb_io_ptr->bath_num,error);
-		status = mb_free(verbose,(void **)&mb_io_ptr->amp_num,error);
-		status = mb_free(verbose,(void **)&mb_io_ptr->ss,error);
-		status = mb_free(verbose,(void **)&mb_io_ptr->ss_acrosstrack,error);
-		status = mb_free(verbose,(void **)&mb_io_ptr->ss_alongtrack,error);
-		status = mb_free(verbose,(void **)&mb_io_ptr->ss_num,error);
-		status = mb_free(verbose,(void **)&mb_io_ptr->beamflag,error);
-		status = mb_free(verbose,(void **)&mb_io_ptr->new_bath,error);
-		status = mb_free(verbose,(void **)&mb_io_ptr->new_amp,error);
-		status = mb_free(verbose,(void **)&mb_io_ptr->new_bath_acrosstrack,error);
-		status = mb_free(verbose,(void **)&mb_io_ptr->new_bath_alongtrack,error);
-		status = mb_free(verbose,(void **)&mb_io_ptr->new_ss,error);
-		status = mb_free(verbose,(void **)&mb_io_ptr->new_ss_acrosstrack,error);
-		status = mb_free(verbose,(void **)&mb_io_ptr->new_ss_alongtrack,error);
-
-		/* free the mb_io structure */
-		status = mb_free(verbose,(void **)&mb_io_ptr,error);
-		mb_io_ptr->beams_bath_alloc = 0;
-		mb_io_ptr->beams_amp_alloc = 0;
-		mb_io_ptr->pixels_ss_alloc = 0;
-		status = MB_FAILURE;
-		*error = MB_ERROR_MEMORY_FAIL;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2 || mb_mem_debug)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-//fprintf(stderr,"KEYPTRS3:\n\tbeamflag: %p\n\tbath:     %p\n\tbathxtrk: %p\n\tbathltrk: %p\n\tbathnum:  %p\n",
-//mb_io_ptr->beamflag,mb_io_ptr->bath,mb_io_ptr->bath_acrosstrack,mb_io_ptr->bath_alongtrack,mb_io_ptr->bath_num);
-//fprintf(stderr,"KEYHNDL3:\n\tbeamflag: %p\n\tbath:     %p\n\tbathxtrk: %p\n\tbathltrk: %p\n\tbathnum:  %p\n",
-//&mb_io_ptr->beamflag,&mb_io_ptr->bath,&mb_io_ptr->bath_acrosstrack,&mb_io_ptr->bath_alongtrack,&mb_io_ptr->bath_num);
-//if (mb_io_ptr->beamflag != NULL)
-//{
-//fprintf(stderr,"VALUES3: \n\tbeamflag: %d\n\tbath:     %f\n\tbathxtrk: %f\n\tbathltrk: %f\n\tbathnum:  %d\n",
-//mb_io_ptr->beamflag[0],mb_io_ptr->bath[0],mb_io_ptr->bath_acrosstrack[0],mb_io_ptr->bath_alongtrack[0],mb_io_ptr->bath_num[0]);
-//for (i=0;i<mb_io_ptr->beams_bath_alloc;i++)
-//{
-//fprintf(stderr,"%d ",mb_io_ptr->beamflag[i]);
-//if (i%25==0 || i==mb_io_ptr->beams_bath_alloc-1) fprintf(stderr,"\n");
-//}
-//}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_update_arrayptr(int verbose, void *mbio_ptr,
-		void **handle, int *error)
-{
-	static char svn_id[]="$Id: mb_mem.c 2229 2015-02-14 23:04:41Z caress $";
-	char	*function_name = "mb_update_arrayptr";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	int	found;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2 || mb_mem_debug)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       handle:     %p\n",(void *)handle);
-		fprintf(stderr,"dbg2       *handle:    %p\n",(void *)*handle);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* look for handle in registered arrays */
-	found = MB_NO;
-	for (i=0;i<mb_io_ptr->n_regarray && found == MB_NO;i++)
-		{
-		if (*handle == mb_io_ptr->regarray_oldptr[i])
-			{
-			*handle = mb_io_ptr->regarray_ptr[i];
-/*fprintf(stderr,"check handle:%x old ptrs:%x %x",handle,*handle,mb_io_ptr->regarray_oldptr[i]);
-fprintf(stderr," found : new ptr:%x",*handle);
-fprintf(stderr,"\n");*/
-			found = MB_YES;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2 || mb_mem_debug)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       *handle:    %p\n",(void *)*handle);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_list_arrays(int verbose, void *mbio_ptr, int *error)
-{
-	static char svn_id[]="$Id: mb_mem.c 2229 2015-02-14 23:04:41Z caress $";
-	char	*function_name = "mb_list_arrays";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2 || mb_mem_debug)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* look for handle in registered arrays */
-	fprintf(stderr,"\nRegistered Array List:\n");
-	for (i=0;i<mb_io_ptr->n_regarray;i++)
-		{
-		fprintf(stderr,"Array %d: handle:%p ptr:%p type:%d size:%zu\n",
-				i,(void *)mb_io_ptr->regarray_handle[i],(void *)mb_io_ptr->regarray_ptr[i],
-				mb_io_ptr->regarray_type[i],mb_io_ptr->regarray_size[i]);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2 || mb_mem_debug)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_deall_ioarrays(int verbose, void *mbio_ptr, int *error)
-{
-	static char svn_id[]="$Id: mb_mem.c 2229 2015-02-14 23:04:41Z caress $";
-	char	*function_name = "mb_deall_ioarrays";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2 || mb_mem_debug)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* deallocate mb_io_ptr arrays */
-	status = mb_free(verbose, (void **)&mb_io_ptr->beamflag,error);
-	status = mb_free(verbose, (void **)&mb_io_ptr->bath,error);
-	status = mb_free(verbose, (void **)&mb_io_ptr->bath_acrosstrack,error);
-	status = mb_free(verbose, (void **)&mb_io_ptr->bath_alongtrack,error);
-	status = mb_free(verbose, (void **)&mb_io_ptr->bath_num,error);
-	status = mb_free(verbose, (void **)&mb_io_ptr->new_beamflag,error);
-	status = mb_free(verbose, (void **)&mb_io_ptr->new_bath,error);
-	status = mb_free(verbose, (void **)&mb_io_ptr->new_bath_acrosstrack,error);
-	status = mb_free(verbose, (void **)&mb_io_ptr->new_bath_alongtrack,error);
-	status = mb_free(verbose, (void **)&mb_io_ptr->amp,error);
-	status = mb_free(verbose, (void **)&mb_io_ptr->amp_num,error);
-	status = mb_free(verbose, (void **)&mb_io_ptr->new_amp,error);
-	status = mb_free(verbose, (void **)&mb_io_ptr->ss,error);
-	status = mb_free(verbose, (void **)&mb_io_ptr->ss_acrosstrack,error);
-	status = mb_free(verbose, (void **)&mb_io_ptr->ss_alongtrack,error);
-	status = mb_free(verbose, (void **)&mb_io_ptr->ss_num,error);
-	status = mb_free(verbose, (void **)&mb_io_ptr->new_ss,error);
-	status = mb_free(verbose, (void **)&mb_io_ptr->new_ss_acrosstrack,error);
-	status = mb_free(verbose, (void **)&mb_io_ptr->new_ss_alongtrack,error);
-	mb_io_ptr->beams_bath_max = 0;
-	mb_io_ptr->beams_bath_alloc = 0;
-	mb_io_ptr->beams_amp_max = 0;
-	mb_io_ptr->beams_amp_alloc = 0;
-	mb_io_ptr->pixels_ss_max = 0;
-	mb_io_ptr->pixels_ss_alloc = 0;
-
-	/* deallocate registered arrays */
-/*fprintf(stderr,"deallocate %d registered arrays\n",mb_io_ptr->n_regarray);*/
-	for (i=0;i<mb_io_ptr->n_regarray;i++)
-		{
-/*fprintf(stderr,"i:%d registered array: stored handle:%x ptr:%x\n",
-i,mb_io_ptr->regarray_handle[mb_io_ptr->n_regarray-1],
-mb_io_ptr->regarray_ptr[mb_io_ptr->n_regarray-1]);*/
-		if (status == MB_SUCCESS)
-			status = mb_free(verbose, (void **)(mb_io_ptr->regarray_handle[i]), error);
-		}
-	mb_io_ptr->n_regarray = 0;
-	mb_io_ptr->n_regarray_alloc = 0;
-
-	/* deallocate registry itself */
-	if (status == MB_SUCCESS)
-		status = mb_free(verbose, (void **)&(mb_io_ptr->regarray_handle), error);
-	if (status == MB_SUCCESS)
-		status = mb_free(verbose, (void **)&(mb_io_ptr->regarray_ptr), error);
-	if (status == MB_SUCCESS)
-		status = mb_free(verbose, (void **)&(mb_io_ptr->regarray_oldptr), error);
-	if (status == MB_SUCCESS)
-		status = mb_free(verbose, (void **)&(mb_io_ptr->regarray_type), error);
-	if (status == MB_SUCCESS)
-		status = mb_free(verbose, (void **)&(mb_io_ptr->regarray_size), error);
-
-	/* print output debug statements */
-	if (verbose >= 2 || mb_mem_debug)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mb_navint.c b/src/mbio/mb_navint.c
deleted file mode 100644
index bb99a51..0000000
--- a/src/mbio/mb_navint.c
+++ /dev/null
@@ -1,3296 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mb_time.c	10/30/2000
- *    $Id: mb_navint.c 2230 2015-02-19 00:39:00Z caress $
- *
- *    Copyright (c) 2000-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mb_navint.c includes the "mb_" functions used to interpolate
- * navigation for data formats using asynchronous nav.
- *
- * Author:	D. W. Caress
- * Date:	October 30, 2000
- *
- * $Log: mb_navint.c,v $
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_define.h"
-#include "mb_io.h"
-#include "mb_process.h"
-
-//    #define MB_NAVINT_DEBUG 1
-//    #define MB_ATTINT_DEBUG 1
-//    #define MB_HEDINT_DEBUG 1
-//    #define MB_DEPINT_DEBUG 1
-//    #define MB_ALTINT_DEBUG 1
-
-static char rcs_id[]="$Id: mb_navint.c 2230 2015-02-19 00:39:00Z caress $";
-
-/*--------------------------------------------------------------------*/
-/* 	function mb_navint_add adds a nav fix to the internal
-		list used for interpolation/extrapolation. */
-int mb_navint_add(int verbose, void *mbio_ptr, double time_d, double lon_easting, double lat_northing, int *error)
-{
-	char	*function_name = "mb_navint_add";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       rcs_id:       %s\n",rcs_id);
-		fprintf(stderr,"dbg2       verbose:      %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       time_d:       %f\n",time_d);
-		fprintf(stderr,"dbg2       lon_easting:  %f\n",lon_easting);
-		fprintf(stderr,"dbg2       lat_northing: %f\n",lat_northing);
-		}
-
-	/* get pointers to mbio descriptor and data structures */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  Current nav fix values:\n");
-		for (i=0;i<mb_io_ptr->nfix;i++)
-			fprintf(stderr,"dbg2       nav fix[%2d]:   %f %f %f\n",
-						i, mb_io_ptr->fix_time_d[i],
-						mb_io_ptr->fix_lon[i],
-						mb_io_ptr->fix_lat[i]);
-		}
-
-	/* add another fix only if time stamp has changed */
-	if (mb_io_ptr->nfix == 0
-		|| (time_d > mb_io_ptr->fix_time_d[mb_io_ptr->nfix-1]))
-		{
-		/* if list if full make room for another nav fix */
-		if (mb_io_ptr->nfix >= MB_ASYNCH_SAVE_MAX)
-			{
-			mb_io_ptr->nfix = MB_ASYNCH_SAVE_MAX - 1;
-			for (i=0;i<mb_io_ptr->nfix;i++)
-				{
-				mb_io_ptr->fix_time_d[i]
-					= mb_io_ptr->fix_time_d[i+1];
-				mb_io_ptr->fix_lon[i] = mb_io_ptr->fix_lon[i+1];
-				mb_io_ptr->fix_lat[i] = mb_io_ptr->fix_lat[i+1];
-				}
-			}
-
-		/* add new fix to list */
-		mb_io_ptr->fix_time_d[mb_io_ptr->nfix] = time_d;
-		mb_io_ptr->fix_lon[mb_io_ptr->nfix] = lon_easting;
-		mb_io_ptr->fix_lat[mb_io_ptr->nfix] = lat_northing;
-		mb_io_ptr->nfix++;
-#ifdef MB_NAVINT_DEBUG
-	fprintf(stderr, "mb_navint_add:    Nav fix %d %f %f added\n", mb_io_ptr->nfix, lon_easting, lat_northing);
-#endif
-
-		/* print debug statements */
-		if (verbose >= 4)
-			{
-			fprintf(stderr,"\ndbg4  Nav fix added to list by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  New fix values:\n");
-			fprintf(stderr,"dbg4       nfix:       %d\n",
-				mb_io_ptr->nfix);
-			fprintf(stderr,"dbg4       time_d:     %f\n",
-				mb_io_ptr->fix_time_d[mb_io_ptr->nfix-1]);
-			fprintf(stderr,"dbg4       fix_lon:    %f\n",
-				mb_io_ptr->fix_lon[mb_io_ptr->nfix-1]);
-			fprintf(stderr,"dbg4       fix_lat:    %f\n",
-				mb_io_ptr->fix_lat[mb_io_ptr->nfix-1]);
-			}
-		}
-
-	/* assume success */
-	status = MB_SUCCESS;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		fprintf(stderr,"\ndbg2  Current nav fix values:\n");
-		for (i=0;i<mb_io_ptr->nfix;i++)
-			fprintf(stderr,"dbg2       nav fix[%2d]:   %f %f %f\n",
-						i, mb_io_ptr->fix_time_d[i],
-						mb_io_ptr->fix_lon[i],
-						mb_io_ptr->fix_lat[i]);
-		}
-
-	/* return success */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-/* 	function mb_navint_interp interpolates or extrapolates a
-		nav fix from the internal list. */
-int mb_navint_interp(int verbose, void *mbio_ptr,
-		double time_d, double heading, double rawspeed,
-		double *lon, double *lat, double *speed,
-		int *error)
-{
-	char	*function_name = "mb_navint_interp";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	double	mtodeglon = 0.0;
-	double	mtodeglat = 0.0;
-	double	dx, dy, dt, dd;
-	double	factor, headingx, headingy;
-	double  speed_mps;
-	int	ifix = 0;
-	int	ifix0, ifix1;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       rcs_id:     %s\n",rcs_id);
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       time_d:     %f\n",time_d);
-		fprintf(stderr,"dbg2       heading:    %f\n",heading);
-		fprintf(stderr,"dbg2       rawspeed:   %f\n",rawspeed);
-		}
-
-	/* get pointers to mbio descriptor and data structures */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  Current nav fix values:\n");
-		for (i=0;i<mb_io_ptr->nfix;i++)
-			fprintf(stderr,"dbg2       nav fix[%2d]:   %f %f %f\n",
-						i, mb_io_ptr->fix_time_d[i],
-						mb_io_ptr->fix_lon[i],
-						mb_io_ptr->fix_lat[i]);
-		}
-
-	/* get degrees to meters conversion if fix available */
-	if (mb_io_ptr->nfix > 0)
-		{
-		mb_coor_scale(verbose,
-			mb_io_ptr->fix_lat[mb_io_ptr->nfix-1],
-			&mtodeglon,&mtodeglat);
-		}
-		
-	/* find location of time_d in the list arrays */
-	if (mb_io_ptr->nfix > 1)
-		{
-		if (time_d <= mb_io_ptr->fix_time_d[0])
-			ifix = 0;
-		else if (time_d >= mb_io_ptr->fix_time_d[mb_io_ptr->nfix-1])
-			ifix = mb_io_ptr->nfix - 1;
-		else
-			{
-			ifix = (mb_io_ptr->nfix - 1) * (time_d - mb_io_ptr->fix_time_d[0])
-				/(mb_io_ptr->fix_time_d[mb_io_ptr->nfix - 1] - mb_io_ptr->fix_time_d[0]);
-			while (time_d > mb_io_ptr->fix_time_d[ifix])
-				{
-				ifix++;
-				}
-			while (time_d < mb_io_ptr->fix_time_d[ifix-1])
-				{
-				ifix--;
-				}
-			}
-		}
-	else if (mb_io_ptr->nfix == 1)
-		{
-		ifix = 0;
-		}
-
-	/* use raw speed if available */
-	if (rawspeed > 0.0)
-	  *speed = rawspeed; /* km/hr */
-
-	/* else get speed averaged over as many as 100 fixes */
-	else if (mb_io_ptr->nfix > 1)
-		{
-		ifix0 = MAX(ifix - 50, 0 );
-		ifix1 = MIN(ifix + 50, mb_io_ptr->nfix - 1);
-		dx = (mb_io_ptr->fix_lon[ifix1]
-			- mb_io_ptr->fix_lon[ifix0])/mtodeglon;
-		dy = (mb_io_ptr->fix_lat[ifix1]
-			- mb_io_ptr->fix_lat[ifix0])/mtodeglat;
-		dt = mb_io_ptr->fix_time_d[ifix1]
-			- mb_io_ptr->fix_time_d[ifix0];
-		*speed = 3.6 * sqrt(dx*dx + dy*dy)/dt; /* km/hr */
-		}
-
-	/* else speed unknown */
-	else
-		*speed = 0.0;
-
-	/* get speed in m/s */
-	speed_mps = *speed / 3.6;
-
-	/* interpolate if possible */
-	if (mb_io_ptr->nfix > 1
-		&& (time_d >= mb_io_ptr->fix_time_d[0])
-		&& (time_d <= mb_io_ptr->fix_time_d[mb_io_ptr->nfix-1]))
-		{
-		factor = (time_d - mb_io_ptr->fix_time_d[ifix-1])
-			/(mb_io_ptr->fix_time_d[ifix] - mb_io_ptr->fix_time_d[ifix-1]);
-		*lon = mb_io_ptr->fix_lon[ifix-1]
-			+ factor*(mb_io_ptr->fix_lon[ifix] - mb_io_ptr->fix_lon[ifix-1]);
-		*lat = mb_io_ptr->fix_lat[ifix-1]
-			+ factor*(mb_io_ptr->fix_lat[ifix] - mb_io_ptr->fix_lat[ifix-1]);
-		status = MB_SUCCESS;
-#ifdef MB_NAVINT_DEBUG
-	fprintf(stderr, "mb_navint_interp: Nav  %f %f interpolated at fix %d of %d with factor:%f\n",
-		*lon, *lat, ifix, mb_io_ptr->nfix, factor);
-#endif
-		}
-
-	/* extrapolate from last fix - note zero speed
-	    results in just using the last fix */
-	else if (mb_io_ptr->nfix > 1
-		&& (time_d > mb_io_ptr->fix_time_d[mb_io_ptr->nfix-1]))
-		{
-		/* extrapolated position using average speed */
-		dd = (time_d - mb_io_ptr->fix_time_d[mb_io_ptr->nfix-1])
-			* speed_mps; /* meters */
-		headingx = sin(DTR * heading);
-		headingy = cos(DTR * heading);
-		*lon = mb_io_ptr->fix_lon[mb_io_ptr->nfix-1]
-			+ headingx * mtodeglon * dd;
-		*lat = mb_io_ptr->fix_lat[mb_io_ptr->nfix-1]
-			+ headingy * mtodeglat * dd;
-		status = MB_SUCCESS;
-#ifdef MB_NAVINT_DEBUG
-	fprintf(stderr, "mb_navint_interp: Nav %f %f extrapolated from last fix of %d with distance:%f and speed:%f\n",
-		*lon, *lat, mb_io_ptr->nfix, dd, speed_mps);
-#endif
-		}
-
-	/* extrapolate from first fix - note zero speed
-	    results in just using the first fix */
-	else if (mb_io_ptr->nfix >= 1)
-		{
-		/* extrapolated position using average speed */
-		dd = (time_d - mb_io_ptr->fix_time_d[0])
-			* speed_mps; /* meters */
-		headingx = sin(DTR * heading);
-		headingy = cos(DTR * heading);
-		*lon = mb_io_ptr->fix_lon[0]
-			+ headingx * mtodeglon * dd;
-		*lat = mb_io_ptr->fix_lat[0]
-			+ headingy * mtodeglat * dd;
-		status = MB_SUCCESS;
-#ifdef MB_NAVINT_DEBUG
-	fprintf(stderr, "mb_navint_interp: Nav %f %f extrapolated from first fix of %d with distance %f and speed:%f\n",
-		*lon, *lat, mb_io_ptr->nfix, dd, speed_mps);
-#endif
-		}
-
-	/* else no fix */
-	else
-		{
-		*lon = 0.0;
-		*lat = 0.0;
-		*speed = 0.0;
-		status = MB_FAILURE;
-		*error = MB_ERROR_NOT_ENOUGH_DATA;
-#ifdef MB_NAVINT_DEBUG
-	fprintf(stderr, "mb_navint_interp: Nav zeroed\n");
-#endif
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       lon:        %f\n",*lon);
-		fprintf(stderr,"dbg2       lat:        %f\n",*lat);
-		fprintf(stderr,"dbg2       speed:      %f\n",*speed);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return success */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-/* 	function mb_navint_prjinterp interpolates or extrapolates a
-		nav fix from the internal list treating the position
-		list as being in a projected coordinate system
-		rather than in geographic lon lat. */
-int mb_navint_prjinterp(int verbose, void *mbio_ptr,
-		double time_d, double heading, double rawspeed,
-		double *easting, double *northing, double *speed,
-		int *error)
-{
-	char	*function_name = "mb_navintprj_interp";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	double	dx, dy, dt, dd;
-	double	factor, headingx, headingy;
-	double  speed_mps;
-	int	ifix = 0;
-	int	ifix0, ifix1;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       rcs_id:     %s\n",rcs_id);
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       time_d:     %f\n",time_d);
-		fprintf(stderr,"dbg2       heading:    %f\n",heading);
-		fprintf(stderr,"dbg2       rawspeed:   %f\n",rawspeed);
-		}
-
-	/* get pointers to mbio descriptor and data structures */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  Current nav fix values:\n");
-		for (i=0;i<mb_io_ptr->nfix;i++)
-			fprintf(stderr,"dbg2       nav fix[%2d]:   %f %f %f\n",
-						i, mb_io_ptr->fix_time_d[i],
-						mb_io_ptr->fix_lon[i],
-						mb_io_ptr->fix_lat[i]);
-		}
-		
-	/* find location of time_d in the list arrays */
-	if (mb_io_ptr->nfix > 1)
-		{
-		if (time_d <= mb_io_ptr->fix_time_d[0])
-			ifix = 0;
-		else if (time_d >= mb_io_ptr->fix_time_d[mb_io_ptr->nfix-1])
-			ifix = mb_io_ptr->nfix - 1;
-		else
-			{
-			ifix = (mb_io_ptr->nfix - 1) * (time_d - mb_io_ptr->fix_time_d[0])
-				/(mb_io_ptr->fix_time_d[mb_io_ptr->nfix - 1] - mb_io_ptr->fix_time_d[0]);
-			while (time_d > mb_io_ptr->fix_time_d[ifix])
-				{
-				ifix++;
-				}
-			while (time_d < mb_io_ptr->fix_time_d[ifix-1])
-				{
-				ifix--;
-				}
-			}
-		}
-	else if (mb_io_ptr->nfix == 1)
-		{
-		ifix = 0;
-		}
-
-	/* use raw speed if available */
-	if (rawspeed > 0.0)
-	  *speed = rawspeed; /* km/hr */
-
-	/* else get speed averaged over as many as 100 fixes */
-	else if (mb_io_ptr->nfix > 1)
-		{
-		ifix0 = MAX(ifix - 50, 0 );
-		ifix1 = MIN(ifix + 50, mb_io_ptr->nfix - 1);
-		dx = (mb_io_ptr->fix_lon[ifix1]
-			- mb_io_ptr->fix_lon[ifix0]);
-		dy = (mb_io_ptr->fix_lat[ifix1]
-			- mb_io_ptr->fix_lat[ifix0]);
-		dt = mb_io_ptr->fix_time_d[ifix1]
-			- mb_io_ptr->fix_time_d[ifix0];
-		*speed = 3.6 * sqrt(dx*dx + dy*dy)/dt; /* km/hr */
-		}
-
-	/* else speed unknown */
-	else
-		*speed = 0.0;
-
-	/* get speed in m/s */
-	speed_mps = *speed / 3.6;
-
-	/* interpolate if possible */
-	if (mb_io_ptr->nfix > 1
-		&& (time_d >= mb_io_ptr->fix_time_d[0])
-		&& (time_d <= mb_io_ptr->fix_time_d[mb_io_ptr->nfix-1]))
-		{
-		factor = (time_d - mb_io_ptr->fix_time_d[ifix-1])
-			/(mb_io_ptr->fix_time_d[ifix] - mb_io_ptr->fix_time_d[ifix-1]);
-		*easting = mb_io_ptr->fix_lon[ifix-1]
-			+ factor*(mb_io_ptr->fix_lon[ifix] - mb_io_ptr->fix_lon[ifix-1]);
-		*northing = mb_io_ptr->fix_lat[ifix-1]
-			+ factor*(mb_io_ptr->fix_lat[ifix] - mb_io_ptr->fix_lat[ifix-1]);
-		status = MB_SUCCESS;
-#ifdef MB_NAVINT_DEBUG
-	fprintf(stderr, "mb_navint_interp: Nav  %f %f interpolated at fix %d of %d with factor:%f\n",
-		*easting, *northing, ifix, mb_io_ptr->nfix, factor);
-#endif
-		}
-
-	/* extrapolate from last fix - note zero speed
-	    results in just using the last fix */
-	else if (mb_io_ptr->nfix > 1
-		&& (time_d > mb_io_ptr->fix_time_d[mb_io_ptr->nfix-1]))
-		{
-		/* extrapolated position using average speed */
-		dd = (time_d - mb_io_ptr->fix_time_d[mb_io_ptr->nfix-1])
-			* speed_mps; /* meters */
-		headingx = sin(DTR * heading);
-		headingy = cos(DTR * heading);
-		*easting = mb_io_ptr->fix_lon[mb_io_ptr->nfix-1]
-			+ headingx * dd;
-		*northing = mb_io_ptr->fix_lat[mb_io_ptr->nfix-1]
-			+ headingy * dd;
-		status = MB_SUCCESS;
-#ifdef MB_NAVINT_DEBUG
-	fprintf(stderr, "mb_navint_interp: Nav %f %f extrapolated from last fix of %d with distance:%f and speed:%f\n",
-		*easting, *northing, mb_io_ptr->nfix, dd, speed_mps);
-#endif
-		}
-
-	/* extrapolate from first fix - note zero speed
-	    results in just using the first fix */
-	else if (mb_io_ptr->nfix >= 1)
-		{
-		/* extrapolated position using average speed */
-		dd = (time_d - mb_io_ptr->fix_time_d[0])
-			* speed_mps; /* meters */
-		headingx = sin(DTR * heading);
-		headingy = cos(DTR * heading);
-		*easting = mb_io_ptr->fix_lon[0]
-			+ headingx * dd;
-		*northing = mb_io_ptr->fix_lat[0]
-			+ headingy * dd;
-		status = MB_SUCCESS;
-#ifdef MB_NAVINT_DEBUG
-	fprintf(stderr, "mb_navint_interp: Nav %f %f extrapolated from first fix of %d with distance %f and speed:%f\n",
-		*easting, *northing, mb_io_ptr->nfix, dd, speed_mps);
-#endif
-		}
-
-	/* else no fix */
-	else
-		{
-		*easting = 0.0;
-		*northing = 0.0;
-		*speed = 0.0;
-		status = MB_FAILURE;
-		*error = MB_ERROR_NOT_ENOUGH_DATA;
-#ifdef MB_NAVINT_DEBUG
-	fprintf(stderr, "mb_navint_interp: Nav zeroed\n");
-#endif
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       easting:    %f\n",*easting);
-		fprintf(stderr,"dbg2       northing:   %f\n",*northing);
-		fprintf(stderr,"dbg2       speed:      %f\n",*speed);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return success */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-/* 	function mb_attint_add adds a attitude fix to the internal
-		list used for interpolation/extrapolation. */
-int mb_attint_add(int verbose, void *mbio_ptr,
-			double time_d, double heave,
-			double roll, double pitch, int *error)
-{
-	char	*function_name = "mb_attint_add";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       rcs_id:     %s\n",rcs_id);
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       time_d:     %f\n",time_d);
-		fprintf(stderr,"dbg2       heave:      %f\n",heave);
-		fprintf(stderr,"dbg2       roll:       %f\n",roll);
-		fprintf(stderr,"dbg2       pitch:      %f\n",pitch);
-		}
-
-	/* get pointers to mbio descriptor and data structures */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* add another fix only if time stamp has changed */
-	if (mb_io_ptr->nattitude == 0
-		|| (time_d > mb_io_ptr->attitude_time_d[mb_io_ptr->nattitude-1]))
-		{
-		/* if list if full make room for another attitude fix */
-		if (mb_io_ptr->nattitude >= MB_ASYNCH_SAVE_MAX)
-			{
-			mb_io_ptr->nattitude = MB_ASYNCH_SAVE_MAX - 1;
-			for (i=0;i<mb_io_ptr->nattitude;i++)
-				{
-				mb_io_ptr->attitude_time_d[i]
-					= mb_io_ptr->attitude_time_d[i+1];
-				mb_io_ptr->attitude_heave[i] = mb_io_ptr->attitude_heave[i+1];
-				mb_io_ptr->attitude_roll[i] = mb_io_ptr->attitude_roll[i+1];
-				mb_io_ptr->attitude_pitch[i] = mb_io_ptr->attitude_pitch[i+1];
-				}
-			}
-
-		/* add new fix to list */
-		mb_io_ptr->attitude_time_d[mb_io_ptr->nattitude] = time_d;
-		mb_io_ptr->attitude_heave[mb_io_ptr->nattitude] = heave;
-		mb_io_ptr->attitude_roll[mb_io_ptr->nattitude] = roll;
-		mb_io_ptr->attitude_pitch[mb_io_ptr->nattitude] = pitch;
-		mb_io_ptr->nattitude++;
-#ifdef MB_ATTINT_DEBUG
-	fprintf(stderr, "mb_attint_add:    Attitude fix %d time_d:%f roll:%f pitch:%f heave:%f added\n",
-				mb_io_ptr->nattitude, time_d, roll, pitch, heave);
-#endif
-
-		/* print debug statements */
-		if (verbose >= 4)
-			{
-			fprintf(stderr,"\ndbg4  Attitude fix added to list by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  New fix values:\n");
-			fprintf(stderr,"dbg4       nattitude:       %d\n",
-				mb_io_ptr->nattitude);
-			fprintf(stderr,"dbg4       time_d:     %f\n",
-				mb_io_ptr->attitude_time_d[mb_io_ptr->nattitude-1]);
-			fprintf(stderr,"dbg4       attitude_heave:    %f\n",
-				mb_io_ptr->attitude_heave[mb_io_ptr->nattitude-1]);
-			fprintf(stderr,"dbg4       attitude_roll:     %f\n",
-				mb_io_ptr->attitude_roll[mb_io_ptr->nattitude-1]);
-			fprintf(stderr,"dbg4       attitude_pitch:    %f\n",
-				mb_io_ptr->attitude_pitch[mb_io_ptr->nattitude-1]);
-			}
-		}
-
-	/* assume success */
-	status = MB_SUCCESS;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return success */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-/* 	function mb_attint_nadd adds multiple attitude fixes to the internal
-		list used for interpolation/extrapolation. */
-int mb_attint_nadd(int verbose, void *mbio_ptr,
-			int nsamples, double *time_d, double *heave,
-			double *roll, double *pitch, int *error)
-{
-	char	*function_name = "mb_attint_nadd";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	int	shift;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       rcs_id:     %s\n",rcs_id);
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       nsamples:   %d\n",nsamples);
-		for (i=0;i<nsamples;i++)
-			{
-			fprintf(stderr,"dbg2       %d time_d:%f heave:%f roll:%f pitch:%f\n",
-				i,time_d[i],heave[i],roll[i],pitch[i]);
-			}
-		}
-
-	/* get pointers to mbio descriptor and data structures */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* if necessary make room for attitude fixes */
-	if (mb_io_ptr->nattitude + nsamples >= MB_ASYNCH_SAVE_MAX)
-		{
-		shift = mb_io_ptr->nattitude + nsamples - MB_ASYNCH_SAVE_MAX;
-		for (i=0;i<mb_io_ptr->nattitude-shift;i++)
-			{
-			mb_io_ptr->attitude_time_d[i]
-				= mb_io_ptr->attitude_time_d[i+shift];
-			mb_io_ptr->attitude_heave[i] = mb_io_ptr->attitude_heave[i+shift];
-			mb_io_ptr->attitude_roll[i] = mb_io_ptr->attitude_roll[i+shift];
-			mb_io_ptr->attitude_pitch[i] = mb_io_ptr->attitude_pitch[i+shift];
-			}
-		mb_io_ptr->nattitude = mb_io_ptr->nattitude - shift;
-		}
-
-	/* add fixes */
-	for (i=0;i<nsamples;i++)
-		{
-		/* add new fix to list */
-		mb_io_ptr->attitude_time_d[mb_io_ptr->nattitude] = time_d[i];
-		mb_io_ptr->attitude_heave[mb_io_ptr->nattitude] = heave[i];
-		mb_io_ptr->attitude_roll[mb_io_ptr->nattitude] = roll[i];
-		mb_io_ptr->attitude_pitch[mb_io_ptr->nattitude] = pitch[i];
-#ifdef MB_ATTINT_DEBUG
-	fprintf(stderr, "mb_attint_add:    Attitude fix %d of %d: time:%f roll:%f pitch:%f heave:%f added\n",
-				i, mb_io_ptr->nattitude, time_d[i], roll[i], pitch[i], heave[i]);
-#endif
-		mb_io_ptr->nattitude++;
-
-		/* print debug statements */
-		if (verbose >= 4)
-			{
-			fprintf(stderr,"\ndbg4  Attitude fixes added to list by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  New fix values:\n");
-			fprintf(stderr,"dbg4       nattitude:       %d\n",
-				mb_io_ptr->nattitude);
-			fprintf(stderr,"dbg4       time_d:     %f\n",
-				mb_io_ptr->attitude_time_d[mb_io_ptr->nattitude-1]);
-			fprintf(stderr,"dbg4       attitude_heave:    %f\n",
-				mb_io_ptr->attitude_heave[mb_io_ptr->nattitude-1]);
-			fprintf(stderr,"dbg4       attitude_roll:     %f\n",
-				mb_io_ptr->attitude_roll[mb_io_ptr->nattitude-1]);
-			fprintf(stderr,"dbg4       attitude_pitch:    %f\n",
-				mb_io_ptr->attitude_pitch[mb_io_ptr->nattitude-1]);
-			}
-		}
-
-	/* assume success */
-	status = MB_SUCCESS;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return success */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-/* 	function mb_attint_interp interpolates or extrapolates a
-		attitude fix from the internal list. */
-int mb_attint_interp(int verbose, void *mbio_ptr,
-		double time_d, double *heave,
-		double *roll, double *pitch,
-		int *error)
-{
-	char	*function_name = "mb_attint_interp";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	double	factor;
-	int	ifix;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       rcs_id:     %s\n",rcs_id);
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       time_d:     %f\n",time_d);
-		}
-
-	/* get pointers to mbio descriptor and data structures */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* interpolate if possible */
-	if (mb_io_ptr->nattitude > 1
-		&& (mb_io_ptr->attitude_time_d[mb_io_ptr->nattitude-1]
-			>= time_d)
-		&& (mb_io_ptr->attitude_time_d[0]
-			<= time_d))
-		{
-		/* get interpolated position */
-		ifix = (mb_io_ptr->nattitude - 1) * (time_d - mb_io_ptr->attitude_time_d[0])
-			/(mb_io_ptr->attitude_time_d[mb_io_ptr->nattitude - 1] - mb_io_ptr->attitude_time_d[0]);
-		while (time_d > mb_io_ptr->attitude_time_d[ifix])
-			ifix++;
-		while (time_d < mb_io_ptr->attitude_time_d[ifix-1])
-			ifix--;
-
-		factor = (time_d - mb_io_ptr->attitude_time_d[ifix-1])
-			/(mb_io_ptr->attitude_time_d[ifix] - mb_io_ptr->attitude_time_d[ifix-1]);
-		*heave = mb_io_ptr->attitude_heave[ifix-1]
-			+ factor*(mb_io_ptr->attitude_heave[ifix] - mb_io_ptr->attitude_heave[ifix-1]);
-		*roll = mb_io_ptr->attitude_roll[ifix-1]
-			+ factor*(mb_io_ptr->attitude_roll[ifix] - mb_io_ptr->attitude_roll[ifix-1]);
-		*pitch = mb_io_ptr->attitude_pitch[ifix-1]
-			+ factor*(mb_io_ptr->attitude_pitch[ifix] - mb_io_ptr->attitude_pitch[ifix-1]);
-		status = MB_SUCCESS;
-#ifdef MB_ATTINT_DEBUG
-	fprintf(stderr, "mb_attint_interp: Attitude time_d:%f roll:%f pitch:%f heave:%f interpolated at fix %d of %d with factor:%f\n",
-		time_d, *roll, *pitch, *heave, ifix, mb_io_ptr->nattitude, factor);
-#endif
-		}
-
-	/* extrapolate from last fix */
-	else if (mb_io_ptr->nattitude > 1
-		&& (mb_io_ptr->attitude_time_d[mb_io_ptr->nattitude-1]
-			< time_d))
-		{
-		/* extrapolated position using average speed */
-		*heave = mb_io_ptr->attitude_heave[mb_io_ptr->nattitude-1];
-		*roll = mb_io_ptr->attitude_roll[mb_io_ptr->nattitude-1];
-		*pitch = mb_io_ptr->attitude_pitch[mb_io_ptr->nattitude-1];
-		status = MB_SUCCESS;
-#ifdef MB_ATTINT_DEBUG
-	fprintf(stderr, "mb_attint_interp: Attitude time_d:%f roll:%f pitch:%f heave:%f extrapolated from last fix of %d\n",
-		time_d, *roll, *pitch, *heave, mb_io_ptr->nattitude);
-#endif
-		}
-
-	/* extrapolate from first fix */
-	else if (mb_io_ptr->nattitude >= 1)
-		{
-		*heave = mb_io_ptr->attitude_heave[0];
-		*roll = mb_io_ptr->attitude_roll[0];
-		*pitch = mb_io_ptr->attitude_pitch[0];
-		status = MB_SUCCESS;
-#ifdef MB_ATTINT_DEBUG
-	fprintf(stderr, "mb_attint_interp: Attitude time_d:%f roll:%f pitch:%f heave:%f extrapolated from first fix of %d\n",
-		time_d, *roll, *pitch, *heave, mb_io_ptr->nattitude);
-#endif
-		}
-
-	/* else no fix */
-	else
-		{
-		*heave = 0.0;
-		*roll = 0.0;
-		*pitch = 0.0;
-		status = MB_FAILURE;
-		*error = MB_ERROR_NOT_ENOUGH_DATA;
-#ifdef MB_ATTINT_DEBUG
-	fprintf(stderr, "mb_attint_interp: Attitude zeroed\n");
-#endif
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       heave:        %f\n",*heave);
-		fprintf(stderr,"dbg2       roll:         %f\n",*roll);
-		fprintf(stderr,"dbg2       pitch:        %f\n",*pitch);
-		fprintf(stderr,"dbg2       error:        %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:       %d\n",status);
-		}
-
-	/* return success */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-/* 	function mb_hedint_add adds a heading fix to the internal
-		list used for interpolation/extrapolation. */
-int mb_hedint_add(int verbose, void *mbio_ptr, double time_d, double heading, int *error)
-{
-	char	*function_name = "mb_hedint_add";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       rcs_id:     %s\n",rcs_id);
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       time_d:     %f\n",time_d);
-		fprintf(stderr,"dbg2       heading:    %f\n",heading);
-		}
-
-	/* get pointers to mbio descriptor and data structures */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* add another fix only if time stamp has changed */
-	if (mb_io_ptr->nheading == 0
-		|| (time_d > mb_io_ptr->heading_time_d[mb_io_ptr->nheading-1]))
-		{
-		/* if list if full make room for another heading fix */
-		if (mb_io_ptr->nheading >= MB_ASYNCH_SAVE_MAX)
-			{
-			mb_io_ptr->nheading = MB_ASYNCH_SAVE_MAX - 1;
-			for (i=0;i<mb_io_ptr->nheading;i++)
-				{
-				mb_io_ptr->heading_time_d[i]
-					= mb_io_ptr->heading_time_d[i+1];
-				mb_io_ptr->heading_heading[i] = mb_io_ptr->heading_heading[i+1];
-				}
-			}
-
-		/* add new fix to list */
-		mb_io_ptr->heading_time_d[mb_io_ptr->nheading] = time_d;
-		mb_io_ptr->heading_heading[mb_io_ptr->nheading] = heading;
-		mb_io_ptr->nheading++;
-#ifdef MB_HEDINT_DEBUG
-	fprintf(stderr, "mb_hedint_add:    Heading fix %d %f added\n", mb_io_ptr->nheading, heading);
-#endif
-
-		/* print debug statements */
-		if (verbose >= 4)
-			{
-			fprintf(stderr,"\ndbg4  Heading fix added to list by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  New fix values:\n");
-			fprintf(stderr,"dbg4       nheading:       %d\n",
-				mb_io_ptr->nheading);
-			fprintf(stderr,"dbg4       time_d:     %f\n",
-				mb_io_ptr->heading_time_d[mb_io_ptr->nheading-1]);
-			fprintf(stderr,"dbg4       heading_heading:  %f\n",
-				mb_io_ptr->heading_heading[mb_io_ptr->nheading-1]);
-			}
-		}
-
-	/* assume success */
-	status = MB_SUCCESS;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return success */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-/* 	function mb_hedint_nadd adds multiple heading fixes to the internal
-		list used for interpolation/extrapolation. */
-int mb_hedint_nadd(int verbose, void *mbio_ptr,
-			int nsamples, double *time_d, double *heading, int *error)
-{
-	char	*function_name = "mb_hedint_nadd";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	int	shift;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       rcs_id:     %s\n",rcs_id);
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       nsamples:   %d\n",nsamples);
-		for (i=0;i<nsamples;i++)
-			{
-			fprintf(stderr,"dbg2       %d time_d:%f heading:%f\n",
-				i,time_d[i],heading[i]);
-			}
-		}
-
-	/* get pointers to mbio descriptor and data structures */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* if necessary make room for heading fixes */
-	if (mb_io_ptr->nheading + nsamples >= MB_ASYNCH_SAVE_MAX)
-		{
-		shift = mb_io_ptr->nheading + nsamples - MB_ASYNCH_SAVE_MAX;
-		for (i=0;i<mb_io_ptr->nheading-shift;i++)
-			{
-			mb_io_ptr->heading_time_d[i]
-				= mb_io_ptr->heading_time_d[i+shift];
-			mb_io_ptr->heading_heading[i] = mb_io_ptr->heading_heading[i+shift];
-			}
-		mb_io_ptr->nheading = mb_io_ptr->nheading - shift;
-		}
-
-	/* add fixes */
-	for (i=0;i<nsamples;i++)
-		{
-		/* add new fix to list */
-		mb_io_ptr->heading_time_d[mb_io_ptr->nheading] = time_d[i];
-		mb_io_ptr->heading_heading[mb_io_ptr->nheading] = heading[i];
-#ifdef MB_HEDINT_DEBUG
-	fprintf(stderr, "mb_hedint_nadd:    Heading fix %d of %d: %f added\n",
-				i, mb_io_ptr->nheading, heading[i]);
-#endif
-		mb_io_ptr->nheading++;
-
-		/* print debug statements */
-		if (verbose >= 4)
-			{
-			fprintf(stderr,"\ndbg4  Heading fixes added to list by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  New fix values:\n");
-			fprintf(stderr,"dbg4       nheading:       %d\n",
-				mb_io_ptr->nheading);
-			fprintf(stderr,"dbg4       time_d:          %f\n",
-				mb_io_ptr->heading_time_d[mb_io_ptr->nheading-1]);
-			fprintf(stderr,"dbg4       heading_heading: %f\n",
-				mb_io_ptr->heading_heading[mb_io_ptr->nheading-1]);
-			}
-		}
-
-	/* assume success */
-	status = MB_SUCCESS;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return success */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-/* 	function mb_hedint_interp interpolates or extrapolates a
-		heading fix from the internal list. */
-int mb_hedint_interp(int verbose, void *mbio_ptr,
-		double time_d, double *heading,
-		int *error)
-{
-	char	*function_name = "mb_hedint_interp";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	double	factor;
-	int	ifix;
-	double	heading1, heading2;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       rcs_id:     %s\n",rcs_id);
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       time_d:     %f\n",time_d);
-		}
-
-	/* get pointers to mbio descriptor and data structures */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* interpolate if possible */
-	if (mb_io_ptr->nheading > 1
-		&& (mb_io_ptr->heading_time_d[mb_io_ptr->nheading-1]
-			>= time_d)
-		&& (mb_io_ptr->heading_time_d[0]
-			<= time_d))
-		{
-		/* get interpolated heading */
-		ifix = (mb_io_ptr->nheading - 1) * (time_d - mb_io_ptr->heading_time_d[0])
-			/(mb_io_ptr->heading_time_d[mb_io_ptr->nheading - 1] - mb_io_ptr->heading_time_d[0]);
-		while (time_d > mb_io_ptr->heading_time_d[ifix])
-			ifix++;
-		while (time_d < mb_io_ptr->heading_time_d[ifix-1])
-			ifix--;
-
-		factor = (time_d - mb_io_ptr->heading_time_d[ifix-1])
-			/(mb_io_ptr->heading_time_d[ifix] - mb_io_ptr->heading_time_d[ifix-1]);
-		heading1 = mb_io_ptr->heading_heading[ifix-1];
-		heading2 = mb_io_ptr->heading_heading[ifix];
-		if (heading2 - heading1 > 180.0)
-			heading2 -= 360.0;
-		else if (heading2 - heading1 < -180.0)
-			heading2 += 360.0;
-		*heading = heading1 + factor*(heading2 - heading1);
-		if (*heading < 0.0)
-			*heading += 360.0;
-		else if (*heading > 360.0)
-			*heading -= 360.0;
-		status = MB_SUCCESS;
-#ifdef MB_HEDINT_DEBUG
-	fprintf(stderr, "mb_hedint_interp: Heading %f interpolated at value %d of %d with factor:%f\n",
-		*heading, ifix, mb_io_ptr->nheading, factor);
-#endif
-		}
-
-	/* extrapolate from last fix */
-	else if (mb_io_ptr->nheading > 1
-		&& (mb_io_ptr->heading_time_d[mb_io_ptr->nheading-1]
-			< time_d))
-		{
-		/* extrapolated heading using average speed */
-		*heading = mb_io_ptr->heading_heading[mb_io_ptr->nheading-1];
-		status = MB_SUCCESS;
-#ifdef MB_HEDINT_DEBUG
-	fprintf(stderr, "mb_hedint_interp: Heading %f taken from last value of %d\n",
-		*heading, mb_io_ptr->nheading);
-#endif
-		}
-
-	/* extrapolate from first fix */
-	else if (mb_io_ptr->nheading >= 1)
-		{
-		*heading = mb_io_ptr->heading_heading[0];
-		status = MB_SUCCESS;
-#ifdef MB_HEDINT_DEBUG
-	fprintf(stderr, "mb_hedint_interp: Heading %f taken from first value of %d\n",
-		*heading, mb_io_ptr->nheading);
-#endif
-		}
-
-	/* else no fix */
-	else
-		{
-		*heading = 0.0;
-		status = MB_FAILURE;
-		*error = MB_ERROR_NOT_ENOUGH_DATA;
-#ifdef MB_HEDINT_DEBUG
-	fprintf(stderr, "mb_hedint_interp: Heading zeroed\n");
-#endif
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       heading:      %f\n",*heading);
-		fprintf(stderr,"dbg2       error:        %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:       %d\n",status);
-		}
-
-	/* return success */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-/* 	function mb_depint_add adds a sonar depth fix to the internal
-		list used for interpolation/extrapolation. */
-int mb_depint_add(int verbose, void *mbio_ptr, double time_d, double sonardepth, int *error)
-{
-	char	*function_name = "mb_depint_add";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       rcs_id:     %s\n",rcs_id);
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       time_d:     %f\n",time_d);
-		fprintf(stderr,"dbg2       sonardepth: %f\n",sonardepth);
-		}
-
-	/* get pointers to mbio descriptor and data structures */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* add another fix only if time stamp has changed */
-	if (mb_io_ptr->nsonardepth == 0
-		|| (time_d > mb_io_ptr->sonardepth_time_d[mb_io_ptr->nsonardepth-1]))
-		{
-		/* if list if full make room for another sonardepth fix */
-		if (mb_io_ptr->nsonardepth >= MB_ASYNCH_SAVE_MAX)
-			{
-			mb_io_ptr->nsonardepth = MB_ASYNCH_SAVE_MAX - 1;
-			for (i=0;i<mb_io_ptr->nsonardepth;i++)
-				{
-				mb_io_ptr->sonardepth_time_d[i]
-					= mb_io_ptr->sonardepth_time_d[i+1];
-				mb_io_ptr->sonardepth_sonardepth[i] = mb_io_ptr->sonardepth_sonardepth[i+1];
-				}
-			}
-
-		/* add new fix to list */
-		mb_io_ptr->sonardepth_time_d[mb_io_ptr->nsonardepth] = time_d;
-		mb_io_ptr->sonardepth_sonardepth[mb_io_ptr->nsonardepth] = sonardepth;
-		mb_io_ptr->nsonardepth++;
-#ifdef MB_DEPINT_DEBUG
-	fprintf(stderr, "mb_depint_add:    sonardepth fix %d %f added\n", mb_io_ptr->nsonardepth, sonardepth);
-#endif
-
-		/* print debug statements */
-		if (verbose >= 4)
-			{
-			fprintf(stderr,"\ndbg4  Sonar depth fix added to list by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  New fix values:\n");
-			fprintf(stderr,"dbg4       nsonardepth:       %d\n",
-				mb_io_ptr->nsonardepth);
-			fprintf(stderr,"dbg4       time_d:     %f\n",
-				mb_io_ptr->sonardepth_time_d[mb_io_ptr->nsonardepth-1]);
-			fprintf(stderr,"dbg4       sonardepth_sonardepth:  %f\n",
-				mb_io_ptr->sonardepth_sonardepth[mb_io_ptr->nsonardepth-1]);
-			}
-		}
-
-	/* assume success */
-	status = MB_SUCCESS;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return success */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-/* 	function mb_depint_interp interpolates or extrapolates a
-		sonar depth fix from the internal list. */
-int mb_depint_interp(int verbose, void *mbio_ptr,
-		double time_d, double *sonardepth,
-		int *error)
-{
-	char	*function_name = "mb_depint_interp";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	double	factor;
-	int	ifix;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       rcs_id:     %s\n",rcs_id);
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       time_d:     %f\n",time_d);
-		}
-
-	/* get pointers to mbio descriptor and data structures */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* interpolate if possible */
-	if (mb_io_ptr->nsonardepth > 1
-		&& (mb_io_ptr->sonardepth_time_d[mb_io_ptr->nsonardepth-1]
-			>= time_d)
-		&& (mb_io_ptr->sonardepth_time_d[0]
-			<= time_d))
-		{
-		/* get interpolated position */
-		ifix = (mb_io_ptr->nsonardepth - 1) * (time_d - mb_io_ptr->sonardepth_time_d[0])
-			/(mb_io_ptr->sonardepth_time_d[mb_io_ptr->nsonardepth - 1] - mb_io_ptr->sonardepth_time_d[0]);
-		while (time_d > mb_io_ptr->sonardepth_time_d[ifix])
-			ifix++;
-		while (time_d < mb_io_ptr->sonardepth_time_d[ifix-1])
-			ifix--;
-
-		factor = (time_d - mb_io_ptr->sonardepth_time_d[ifix-1])
-			/(mb_io_ptr->sonardepth_time_d[ifix] - mb_io_ptr->sonardepth_time_d[ifix-1]);
-		*sonardepth = mb_io_ptr->sonardepth_sonardepth[ifix-1]
-			+ factor*(mb_io_ptr->sonardepth_sonardepth[ifix] - mb_io_ptr->sonardepth_sonardepth[ifix-1]);
-		status = MB_SUCCESS;
-#ifdef MB_DEPINT_DEBUG
-	fprintf(stderr, "mb_depint_interp: sonardepth %f interpolated at fix %d of %d with factor:%f\n",
-		*sonardepth, ifix, mb_io_ptr->nsonardepth, factor);
-#endif
-		}
-
-	/* extrapolate from last value */
-	else if (mb_io_ptr->nsonardepth > 1
-		&& (mb_io_ptr->sonardepth_time_d[mb_io_ptr->nsonardepth-1]
-			< time_d))
-		{
-		/* extrapolated depth using last value */
-		*sonardepth = mb_io_ptr->sonardepth_sonardepth[mb_io_ptr->nsonardepth-1];
-		status = MB_SUCCESS;
-#ifdef MB_DEPINT_DEBUG
-	fprintf(stderr, "mb_depint_interp: sonardepth %f extrapolated from last fix of %d\n",
-		*sonardepth, mb_io_ptr->nsonardepth);
-#endif
-		}
-
-	/* extrapolate from first fix */
-	else if (mb_io_ptr->nsonardepth >= 1)
-		{
-		*sonardepth = mb_io_ptr->sonardepth_sonardepth[0];
-		status = MB_SUCCESS;
-#ifdef MB_DEPINT_DEBUG
-	fprintf(stderr, "mb_depint_interp: sonardepth %f extrapolated from first fix of %d\n",
-		*sonardepth, mb_io_ptr->nsonardepth);
-#endif
-		}
-
-	/* else no fix */
-	else
-		{
-		*sonardepth = 0.0;
-		status = MB_FAILURE;
-		*error = MB_ERROR_NOT_ENOUGH_DATA;
-#ifdef MB_DEPINT_DEBUG
-	fprintf(stderr, "mb_depint_interp: sonardepth zeroed\n");
-#endif
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       sonardepth:   %f\n",*sonardepth);
-		fprintf(stderr,"dbg2       error:        %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:       %d\n",status);
-		}
-
-	/* return success */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-/* 	function mb_altint_add adds a heading fix to the internal
-		list used for interpolation/extrapolation. */
-int mb_altint_add(int verbose, void *mbio_ptr, double time_d, double altitude, int *error)
-{
-	char	*function_name = "mb_altint_add";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       rcs_id:     %s\n",rcs_id);
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       time_d:     %f\n",time_d);
-		fprintf(stderr,"dbg2       altitude:   %f\n",altitude);
-		}
-
-	/* get pointers to mbio descriptor and data structures */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* add another fix only if time stamp has changed */
-	if (mb_io_ptr->naltitude == 0
-		|| (time_d > mb_io_ptr->altitude_time_d[mb_io_ptr->naltitude-1]))
-		{
-		/* if list if full make room for another altitude fix */
-		if (mb_io_ptr->naltitude >= MB_ASYNCH_SAVE_MAX)
-			{
-			mb_io_ptr->naltitude = MB_ASYNCH_SAVE_MAX - 1;
-			for (i=0;i<mb_io_ptr->naltitude;i++)
-				{
-				mb_io_ptr->altitude_time_d[i]
-					= mb_io_ptr->altitude_time_d[i+1];
-				mb_io_ptr->altitude_altitude[i] = mb_io_ptr->altitude_altitude[i+1];
-				}
-			}
-
-		/* add new fix to list */
-		mb_io_ptr->altitude_time_d[mb_io_ptr->naltitude] = time_d;
-		mb_io_ptr->altitude_altitude[mb_io_ptr->naltitude] = altitude;
-		mb_io_ptr->naltitude++;
-#ifdef MB_ALTINT_DEBUG
-	fprintf(stderr, "mb_altint_add:    altitude fix %d %f added\n", mb_io_ptr->naltitude, altitude);
-#endif
-
-		/* print debug statements */
-		if (verbose >= 4)
-			{
-			fprintf(stderr,"\ndbg4  Altitude fix added to list by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  New fix values:\n");
-			fprintf(stderr,"dbg4       naltitude:       %d\n",
-				mb_io_ptr->naltitude);
-			fprintf(stderr,"dbg4       time_d:     %f\n",
-				mb_io_ptr->altitude_time_d[mb_io_ptr->naltitude-1]);
-			fprintf(stderr,"dbg4       altitude_altitude:  %f\n",
-				mb_io_ptr->altitude_altitude[mb_io_ptr->naltitude-1]);
-			}
-		}
-
-	/* assume success */
-	status = MB_SUCCESS;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return success */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-/* 	function mb_altint_interp interpolates or extrapolates a
-		altitude fix from the internal list. */
-int mb_altint_interp(int verbose, void *mbio_ptr,
-		double time_d, double *altitude,
-		int *error)
-{
-	char	*function_name = "mb_altint_interp";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	double	factor;
-	int	ifix;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       rcs_id:     %s\n",rcs_id);
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       time_d:     %f\n",time_d);
-		}
-
-	/* get pointers to mbio descriptor and data structures */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* interpolate if possible */
-	if (mb_io_ptr->naltitude > 1
-		&& (mb_io_ptr->altitude_time_d[mb_io_ptr->naltitude-1]
-			>= time_d)
-		&& (mb_io_ptr->altitude_time_d[0]
-			<= time_d))
-		{
-		/* get interpolated position */
-		ifix = (mb_io_ptr->naltitude - 1) * (time_d - mb_io_ptr->altitude_time_d[0])
-			/(mb_io_ptr->altitude_time_d[mb_io_ptr->naltitude - 1] - mb_io_ptr->altitude_time_d[0]);
-		while (time_d > mb_io_ptr->altitude_time_d[ifix])
-			ifix++;
-		while (time_d < mb_io_ptr->fix_time_d[ifix-1])
-			ifix--;
-
-		factor = (time_d - mb_io_ptr->altitude_time_d[ifix-1])
-			/(mb_io_ptr->altitude_time_d[ifix] - mb_io_ptr->altitude_time_d[ifix-1]);
-		*altitude = mb_io_ptr->altitude_altitude[ifix-1]
-			+ factor*(mb_io_ptr->altitude_altitude[ifix] - mb_io_ptr->altitude_altitude[ifix-1]);
-		status = MB_SUCCESS;
-#ifdef MB_ALTINT_DEBUG
-	fprintf(stderr, "mb_altint_interp: altitude %f interpolated at fix %d of %d with factor:%f\n",
-		*altitude, ifix, mb_io_ptr->naltitude, factor);
-#endif
-		}
-
-	/* extrapolate from last fix */
-	else if (mb_io_ptr->naltitude > 1
-		&& (mb_io_ptr->altitude_time_d[mb_io_ptr->naltitude-1]
-			< time_d))
-		{
-		/* extrapolated position using average speed */
-		*altitude = mb_io_ptr->altitude_altitude[mb_io_ptr->naltitude-1];
-		status = MB_SUCCESS;
-#ifdef MB_ALTINT_DEBUG
-	fprintf(stderr, "mb_altint_interp: altitude %f extrapolated from last fix of %d\n",
-		*altitude, mb_io_ptr->naltitude);
-#endif
-		}
-
-	/* extrapolate from first fix */
-	else if (mb_io_ptr->naltitude >= 1)
-		{
-		*altitude = mb_io_ptr->altitude_altitude[0];
-		status = MB_SUCCESS;
-#ifdef MB_ALTINT_DEBUG
-	fprintf(stderr, "mb_altint_interp: altitude %f extrapolated from first fix of %d\n",
-		*altitude, mb_io_ptr->naltitude);
-#endif
-		}
-
-	/* else no fix */
-	else
-		{
-		*altitude = 0.0;
-		status = MB_FAILURE;
-		*error = MB_ERROR_NOT_ENOUGH_DATA;
-#ifdef MB_ALTINT_DEBUG
-	fprintf(stderr, "mb_altint_interp: altitude zeroed\n");
-#endif
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       altitude:     %f\n",*altitude);
-		fprintf(stderr,"dbg2       error:        %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:       %d\n",status);
-		}
-
-	/* return success */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-
-int mb_loadnavdata(int verbose, char *merge_nav_file, int merge_nav_format, int merge_nav_lonflip,
-                int *merge_nav_num, int *merge_nav_alloc,
-                double **merge_nav_time_d, double **merge_nav_lon,
-                double **merge_nav_lat, double **merge_nav_speed, int *error)
-	{
-	char	*function_name = "mb_loadnavdata";
-	int	status = MB_SUCCESS;
-	char	buffer[MBP_FILENAMESIZE], dummy[MBP_FILENAMESIZE], *result, *bufftmp;
-	int	nrecord;
-	int	nchar, nget;
-	size_t	size;
-	FILE	*tfp;
-	int	nav_ok;
-	int	time_i[7], time_j[6], ihr, ioff;
-	char	NorS[2], EorW[2];
-	double	mlon, llon, mlat, llat;
-	int	degree, time_set;
-	double	sec, hr, dminute;
-	double	time_d, heading, sensordepth, roll, pitch, heave;
-	int	len;
-	int	quality, nsatellite, dilution, gpsheight;
-	double	*n_time_d;
-	double	*n_lon;
-	double	*n_lat;
-	double	*n_speed;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       rcs_id:                 %s\n",rcs_id);
-		fprintf(stderr,"dbg2       verbose:                %d\n",verbose);
-		fprintf(stderr,"dbg2       merge_nav_file:         %s\n",merge_nav_file);
-		fprintf(stderr,"dbg2       merge_nav_format:       %d\n",merge_nav_format);
-		fprintf(stderr,"dbg2       merge_nav_lonflip:      %d\n",merge_nav_lonflip);
-		fprintf(stderr,"dbg2       merge_nav_num *:        %p\n",merge_nav_num);
-		fprintf(stderr,"dbg2       merge_nav_num:          %d\n",*merge_nav_num);
-		fprintf(stderr,"dbg2       merge_nav_alloc *:      %p\n",merge_nav_alloc);
-		fprintf(stderr,"dbg2       merge_nav_alloc:        %d\n",*merge_nav_alloc);
-		fprintf(stderr,"dbg2       merge_nav_time_d **:    %p\n",merge_nav_time_d);
-		fprintf(stderr,"dbg2       merge_nav_time_d *:     %p\n",*merge_nav_time_d);
-		fprintf(stderr,"dbg2       merge_nav_lon **:       %p\n",merge_nav_lon);
-		fprintf(stderr,"dbg2       merge_nav_lon *:        %p\n",*merge_nav_lon);
-		fprintf(stderr,"dbg2       merge_nav_lat **:       %p\n",merge_nav_lat);
-		fprintf(stderr,"dbg2       merge_nav_lat *:        %p\n",*merge_nav_lat);
-		fprintf(stderr,"dbg2       merge_nav_speed **:     %p\n",merge_nav_speed);
-		fprintf(stderr,"dbg2       merge_nav_speed *:      %p\n",*merge_nav_speed);
-		}
-	
-	/* set max number of characters to be read at a time */
-	if (merge_nav_format == 8)
-		nchar = 96;
-	else
-		nchar = MBP_FILENAMESIZE-1;
-
-	/* count the records */
-	*error = MB_ERROR_NO_ERROR;
-	nrecord = 0;
-	if ((tfp = fopen(merge_nav_file, "r")) != NULL)
-		{
-		/* loop over reading the records */
-		while ((result = fgets(buffer,nchar,tfp)) == buffer)
-			nrecord++;
-			
-		/* close the file */
-		fclose(tfp);
-		tfp = NULL;
-		}
-	else
-		{
-		*error = MB_ERROR_OPEN_FAIL;
-		status = MB_FAILURE;
-		}
-	
-	/* allocate memory if necessary */
-	if (status == MB_SUCCESS && *merge_nav_alloc < nrecord)
-		{
-		size = nrecord * sizeof(double);
-		status = mb_mallocd(verbose, __FILE__, __LINE__, size, (void **)merge_nav_time_d, error);
-		if (status == MB_SUCCESS)
-			status = mb_mallocd(verbose, __FILE__, __LINE__, size, (void **)merge_nav_lon, error);
-		if (status == MB_SUCCESS)
-			status = mb_mallocd(verbose, __FILE__, __LINE__, size, (void **)merge_nav_lat, error);
-		if (status == MB_SUCCESS)
-			status = mb_mallocd(verbose, __FILE__, __LINE__, size, (void **)merge_nav_speed, error);
-		if (status == MB_SUCCESS)
-			*merge_nav_alloc = nrecord;
-		n_time_d = *merge_nav_time_d;
-		n_lon = *merge_nav_lon;
-		n_lat = *merge_nav_lat;
-		n_speed = *merge_nav_speed;
-		}
-
-	/* read the records */
-	if (status == MB_SUCCESS)
-		{
-		nrecord = 0;
-		if ((tfp = fopen(merge_nav_file, "r")) == NULL)
-			{
-			*error = MB_ERROR_OPEN_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			/* loop over reading the records - handle the different formats */
-			while ((result = fgets(buffer,nchar,tfp)) == buffer)
-				{
-				nav_ok = MB_NO;
-
-				/* deal with nav in form: time_d lon lat speed */
-				if (merge_nav_format == 1)
-					{
-					nget = sscanf(buffer,"%lf %lf %lf %lf",
-						&n_time_d[nrecord],&n_lon[nrecord],&n_lat[nrecord],&n_speed[nrecord]);
-					if (nget == 3)
-						n_speed[nrecord] = 0.0;
-					if (nget >= 3)
-						nav_ok = MB_YES;
-					}
-		
-				/* deal with nav in form: yr mon day hour min sec lon lat */
-				else if (merge_nav_format == 2)
-					{
-					nget = sscanf(buffer,"%d %d %d %d %d %lf %lf %lf",
-						&time_i[0],&time_i[1],&time_i[2],
-						&time_i[3],&time_i[4],&sec,
-						&n_lon[nrecord],&n_lat[nrecord]);
-					time_i[5] = (int) sec;
-					time_i[6] = 1000000*(sec - time_i[5]);
-					mb_get_time(verbose,time_i,&time_d);
-					n_time_d[nrecord] = time_d;
-					n_speed[nrecord] = 0.0;
-					if (nget == 8)
-						nav_ok = MB_YES;
-					}
-		
-				/* deal with nav in form: yr jday hour min sec lon lat */
-				else if (merge_nav_format == 3)
-					{
-					nget = sscanf(buffer,"%d %d %d %d %lf %lf %lf",
-						&time_j[0],&time_j[1],&ihr,
-						&time_j[2],&sec,
-						&n_lon[nrecord],&n_lat[nrecord]);
-					time_j[2] = time_j[2] + 60*ihr;
-					time_j[3] = (int) sec;
-					time_j[4] = 1000000*(sec - time_j[3]);
-					mb_get_itime(verbose,time_j,time_i);
-					mb_get_time(verbose,time_i,&time_d);
-					n_time_d[nrecord] = time_d;
-					n_speed[nrecord] = 0.0;
-					if (nget == 7)
-						nav_ok = MB_YES;
-					}
-		
-				/* deal with nav in form: yr jday daymin sec lon lat */
-				else if (merge_nav_format == 4)
-					{
-					nget = sscanf(buffer,"%d %d %d %lf %lf %lf",
-						&time_j[0],&time_j[1],&time_j[2],
-						&sec,
-						&n_lon[nrecord],&n_lat[nrecord]);
-					time_j[3] = (int) sec;
-					time_j[4] = 1000000*(sec - time_j[3]);
-					mb_get_itime(verbose,time_j,time_i);
-					mb_get_time(verbose,time_i,&time_d);
-					n_time_d[nrecord] = time_d;
-					n_speed[nrecord] = 0.0;
-					if (nget == 6)
-						nav_ok = MB_YES;
-					}
-		
-				/* deal with nav in L-DEO processed nav format */
-				else if (merge_nav_format == 5)
-					{
-					strncpy(dummy,"\0",128);
-					if (buffer[2] == '+')
-						{
-						time_j[0] = atoi(strncpy(dummy,buffer,2));
-						mb_fix_y2k(verbose, time_j[0], &time_j[0]);
-						ioff = 3;
-						}
-					else
-						{
-						time_j[0] = atoi(strncpy(dummy,buffer,4));
-						ioff = 5;
-						}
-					strncpy(dummy,"\0",128);
-					time_j[1] = atoi(strncpy(dummy,buffer+ioff,3));
-					strncpy(dummy,"\0",128);
-					ioff += 4;
-					hr = atoi(strncpy(dummy,buffer+ioff,2));
-					strncpy(dummy,"\0",128);
-					ioff += 3;
-					time_j[2] = atoi(strncpy(dummy,buffer+ioff,2))
-						+ 60*hr;
-					strncpy(dummy,"\0",128);
-					ioff += 3;
-					time_j[3] = atoi(strncpy(dummy,buffer+ioff,2));
-					time_j[4] = 0;
-					mb_get_itime(verbose,time_j,time_i);
-					mb_get_time(verbose,time_i,&time_d);
-					n_time_d[nrecord] = time_d;
-		
-					strncpy(NorS,"\0",sizeof(NorS));
-					ioff += 7;
-					NorS[0] = buffer[ioff];
-					ioff += 1;
-					strncpy(dummy,"\0",128);
-					mlat = atof(strncpy(dummy,buffer+ioff,3));
-					strncpy(dummy,"\0",128);
-					ioff += 3;
-					llat = atof(strncpy(dummy,buffer+ioff,8));
-					strncpy(EorW,"\0",sizeof(EorW));
-					ioff += 9;
-					EorW[0] = buffer[ioff];
-					strncpy(dummy,"\0",128);
-					ioff += 1;
-					mlon = atof(strncpy(dummy,buffer+ioff,4));
-					strncpy(dummy,"\0",128);
-					ioff += 4;
-					llon = atof(strncpy(dummy,buffer+ioff,8));
-					n_lon[nrecord] = mlon + llon/60.;
-					if (strncmp(EorW,"W",1) == 0)
-						n_lon[nrecord] = -n_lon[nrecord];
-					n_lat[nrecord] = mlat + llat/60.;
-					if (strncmp(NorS,"S",1) == 0)
-						n_lat[nrecord] = -n_lat[nrecord];
-					n_speed[nrecord] = 0.0;
-					nav_ok = MB_YES;
-					}
-		
-				/* deal with nav in real and pseudo NMEA 0183 format */
-				else if (merge_nav_format == 6 || merge_nav_format == 7)
-					{
-					/* check if real sentence */
-					len = strlen(buffer);
-					if (strncmp(buffer,"$",1) == 0)
-					    {
-					    if (strncmp(&buffer[3],"DAT",3) == 0
-						&& len > 15)
-						{
-						time_set = MB_NO;
-						strncpy(dummy,"\0",128);
-						time_i[0] = atoi(strncpy(dummy,buffer+7,4));
-						time_i[1] = atoi(strncpy(dummy,buffer+11,2));
-						time_i[2] = atoi(strncpy(dummy,buffer+13,2));
-						}
-					    else if ((strncmp(&buffer[3],"ZDA",3) == 0
-						    || strncmp(&buffer[3],"UNX",3) == 0)
-						    && len > 14)
-						{
-						time_set = MB_NO;
-						/* find start of ",hhmmss.ss" */
-						if ((bufftmp = strchr(buffer, ',')) != NULL)
-						    {
-						    strncpy(dummy,"\0",128);
-						    time_i[3] = atoi(strncpy(dummy,bufftmp+1,2));
-						    strncpy(dummy,"\0",128);
-						    time_i[4] = atoi(strncpy(dummy,bufftmp+3,2));
-						    strncpy(dummy,"\0",128);
-						    time_i[5] = atoi(strncpy(dummy,bufftmp+5,2));
-						    if (bufftmp[7] == '.')
-							{
-							strncpy(dummy,"\0",128);
-							time_i[6] = 10000*
-							    atoi(strncpy(dummy,bufftmp+8,2));
-							}
-						    else
-							time_i[6] = 0;
-						    /* find start of ",dd,mm,yyyy" */
-						    if ((bufftmp = strchr(&bufftmp[1], ',')) != NULL)
-							{
-							strncpy(dummy,"\0",128);
-							time_i[2] = atoi(strncpy(dummy,bufftmp+1,2));
-							strncpy(dummy,"\0",128);
-							time_i[1] = atoi(strncpy(dummy,bufftmp+4,2));
-							strncpy(dummy,"\0",128);
-							time_i[0] = atoi(strncpy(dummy,bufftmp+7,4));
-							time_set = MB_YES;
-							}
-						    }
-						}
-					    else if (((merge_nav_format == 6 && strncmp(&buffer[3],"GLL",3) == 0)
-						|| (merge_nav_format == 7 && strncmp(&buffer[3],"GGA",3) == 0))
-						&& time_set == MB_YES && len > 26)
-						{
-						time_set = MB_NO;
-						/* find start of ",ddmm.mm,N,ddmm.mm,E" */
-						if ((bufftmp = strchr(buffer, ',')) != NULL)
-						    {
-						    if (merge_nav_format == 7)
-							bufftmp = strchr(&bufftmp[1], ',');
-						    strncpy(dummy,"\0",128);
-						    degree = atoi(strncpy(dummy,bufftmp+1,2));
-						    strncpy(dummy,"\0",128);
-						    dminute = atof(strncpy(dummy,bufftmp+3,5));
-						    strncpy(NorS,"\0",sizeof(NorS));
-						    bufftmp = strchr(&bufftmp[1], ',');
-						    strncpy(NorS,bufftmp+1,1);
-						    n_lat[nrecord] = degree + dminute/60.;
-						    if (strncmp(NorS,"S",1) == 0)
-							n_lat[nrecord] = -n_lat[nrecord];
-						    bufftmp = strchr(&bufftmp[1], ',');
-						    strncpy(dummy,"\0",128);
-						    degree = atoi(strncpy(dummy,bufftmp+1,3));
-						    strncpy(dummy,"\0",128);
-						    dminute = atof(strncpy(dummy,bufftmp+4,5));
-						    bufftmp = strchr(&bufftmp[1], ',');
-						    strncpy(EorW,"\0",sizeof(EorW));
-						    strncpy(EorW,bufftmp+1,1);
-						    n_lon[nrecord] = degree + dminute/60.;
-						    if (strncmp(EorW,"W",1) == 0)
-							n_lon[nrecord] = -n_lon[nrecord];
-						    mb_get_time(verbose,time_i,&time_d);
-						    n_time_d[nrecord] = time_d;
-						    nav_ok = MB_YES;
-						    }
-						}
-					    }
-					n_speed[nrecord] = 0.0;
-					}
-		
-				/* deal with nav in Simrad 90 format */
-				else if (merge_nav_format == 8)
-					{
-					mb_get_int(&(time_i[2]), buffer+2,  2);
-					mb_get_int(&(time_i[1]), buffer+4,  2);
-					mb_get_int(&(time_i[0]), buffer+6,  2);
-					mb_fix_y2k(verbose, time_i[0], &time_i[0]);
-					mb_get_int(&(time_i[3]), buffer+9,  2);
-					mb_get_int(&(time_i[4]), buffer+11, 2);
-					mb_get_int(&(time_i[5]), buffer+13, 2);
-					mb_get_int(&(time_i[6]), buffer+15, 2);
-					time_i[6] = 10000 * time_i[6];
-					mb_get_time(verbose,time_i,&time_d);
-					n_time_d[nrecord] = time_d;
-		
-					mb_get_double(&mlat,    buffer+18,   2);
-					mb_get_double(&llat, buffer+20,   7);
-					NorS[0] = buffer[27];
-					n_lat[nrecord] = mlat + llat/60.0;
-					if (NorS[0] == 'S' || NorS[0] == 's')
-						n_lat[nrecord] = -n_lat[nrecord];
-					mb_get_double(&mlon,    buffer+29,   3);
-					mb_get_double(&llon, buffer+32,   7);
-					EorW[0] = buffer[39];
-					n_lon[nrecord] = mlon + llon/60.0;
-					if (EorW[0] == 'W' || EorW[0] == 'w')
-						n_lon[nrecord] = -n_lon[nrecord];
-					n_speed[nrecord] = 0.0;
-					nav_ok = MB_YES;
-					}
-		
-				/* deal with nav in form: yr mon day hour min sec time_d lon lat heading speed sensordepth*/
-				else if (merge_nav_format == 9)
-					{
-					nget = sscanf(buffer,"%d %d %d %d %d %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf",
-						&time_i[0],&time_i[1],&time_i[2],
-						&time_i[3],&time_i[4],&sec,
-						&n_time_d[nrecord],
-						&n_lon[nrecord],&n_lat[nrecord],
-						&heading,&n_speed[nrecord],&sensordepth,
-						&roll,&pitch,&heave);
-					if (nget >= 9)
-						nav_ok = MB_YES;
-					if (nrecord > 0 && n_time_d[nrecord] <= n_time_d[nrecord-1])
-						nav_ok = MB_NO;
-					}
-		
-				/* deal with nav in r2rnav form:
-					yyyy-mm-ddThh:mm:ss.sssZ decimalLongitude decimalLatitude quality nsat dilution height */
-				else if (merge_nav_format == 10)
-					{
-					nget = sscanf(buffer,"%d-%d-%dT%d:%d:%lfZ %lf %lf %d %d %d %d",
-						&time_i[0],&time_i[1],&time_i[2],
-						&time_i[3],&time_i[4],&sec,
-						&n_lon[nrecord],&n_lat[nrecord],
-						&quality,&nsatellite,&dilution,&gpsheight);
-					if (nget != 12)
-						{
-						quality = 0;
-						nsatellite = 0;
-						dilution = 0;
-						gpsheight = 0;
-						}
-					time_i[5] = (int) floor(sec);
-					time_i[6] = (int)((sec - time_i[5]) * 1000000);
-					mb_get_time(verbose,time_i,&time_d);
-					n_time_d[nrecord] = time_d;
-					n_speed[nrecord] = 0.0;
-					if (nget >= 8)
-						nav_ok = MB_YES;
-					}
-		
-		
-				/* make sure longitude is defined according to lonflip */
-				if (nav_ok == MB_YES)
-					{
-					if (merge_nav_lonflip == -1 && n_lon[nrecord] > 0.0)
-						n_lon[nrecord] = n_lon[nrecord] - 360.0;
-					else if (merge_nav_lonflip == 0 && n_lon[nrecord] < -180.0)
-						n_lon[nrecord] = n_lon[nrecord] + 360.0;
-					else if (merge_nav_lonflip == 0 && n_lon[nrecord] > 180.0)
-						n_lon[nrecord] = n_lon[nrecord] - 360.0;
-					else if (merge_nav_lonflip == 1 && n_lon[nrecord] < 0.0)
-						n_lon[nrecord] = n_lon[nrecord] + 360.0;
-					}
-		
-				/* output some debug values */
-				if (verbose >= 5 && nav_ok == MB_YES)
-					{
-					fprintf(stderr,"\ndbg5  New navigation point read in function <%s>\n",function_name);
-					fprintf(stderr,"dbg5       nav[%d]: %f %f %f\n",
-						nrecord,n_time_d[nrecord],n_lon[nrecord],n_lat[nrecord]);
-					}
-				else if (verbose >= 5)
-					{
-					fprintf(stderr,"\ndbg5  Error parsing line in navigation file in function <%s>\n",function_name);
-					fprintf(stderr,"dbg5       line: %s\n",buffer);
-					}
-		
-				/* check for reverses or repeats in time */
-				if (nav_ok == MB_YES)
-					{
-					if (nrecord == 0)
-						nrecord++;
-					else if (n_time_d[nrecord] > n_time_d[nrecord-1])
-						nrecord++;
-					else if (nrecord > 0 && n_time_d[nrecord] <= n_time_d[nrecord-1]
-						&& verbose >= 5)
-						{
-						fprintf(stderr,"\ndbg5  Navigation time error in function <%s>\n",function_name);
-						fprintf(stderr,"dbg5       nav[%d]: %f %f %f\n",
-							nrecord-1,n_time_d[nrecord-1],n_lon[nrecord-1],
-							n_lat[nrecord-1]);
-						fprintf(stderr,"dbg5       nav[%d]: %f %f %f\n",
-							nrecord,n_time_d[nrecord],n_lon[nrecord],
-							n_lat[nrecord]);
-						}
-					}
-				strncpy(buffer,"\0",sizeof(buffer));
-				}
-			
-			/* get the good record count */
-			*merge_nav_num = nrecord;
-			
-			/* close the file */
-			fclose(tfp);
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       merge_nav_num:          %d\n",*merge_nav_num);
-		fprintf(stderr,"dbg2       merge_nav_alloc:        %d\n",*merge_nav_alloc);
-		fprintf(stderr,"dbg2       merge_nav_time_d *:     %p\n",*merge_nav_time_d);
-		fprintf(stderr,"dbg2       merge_nav_lon *:        %p\n",*merge_nav_lon);
-		fprintf(stderr,"dbg2       merge_nav_lat *:        %p\n",*merge_nav_lat);
-		fprintf(stderr,"dbg2       merge_nav_speed *:      %p\n",*merge_nav_speed);
-		fprintf(stderr,"dbg2       error:                  %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:                 %d\n",status);
-		}
-
-	/* return success */
-	return(status);
-	}
-
-/*--------------------------------------------------------------------*/
-
-int mb_loadsensordepthdata(int verbose, char *merge_sensordepth_file, int merge_sensordepth_format,
-                int *merge_sensordepth_num, int *merge_sensordepth_alloc,
-                double **merge_sensordepth_time_d, double **merge_sensordepth_sensordepth,
-		int *error)
-	{
-	char	*function_name = "mb_loadsensordepthdata";
-	int	status = MB_SUCCESS;
-	char	buffer[MBP_FILENAMESIZE], *result;
-	int	nrecord;
-	int	nchar, nget;
-	size_t	size;
-	FILE	*tfp;
-	int	sensordepth_ok;
-	int	time_i[7], time_j[6], ihr;
-	double	sec;
-	double	time_d, lon, lat, heading, speed, roll, pitch, heave;
-	double	*n_time_d;
-	double	*n_sensordepth;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       rcs_id:                           %s\n",rcs_id);
-		fprintf(stderr,"dbg2       verbose:                          %d\n",verbose);
-		fprintf(stderr,"dbg2       merge_sensordepth_file:           %s\n",merge_sensordepth_file);
-		fprintf(stderr,"dbg2       merge_sensordepth_format:         %d\n",merge_sensordepth_format);
-		fprintf(stderr,"dbg2       merge_sensordepth_num *:          %p\n",merge_sensordepth_num);
-		fprintf(stderr,"dbg2       merge_sensordepth_num:            %d\n",*merge_sensordepth_num);
-		fprintf(stderr,"dbg2       merge_sensordepth_alloc *:        %p\n",merge_sensordepth_alloc);
-		fprintf(stderr,"dbg2       merge_sensordepth_alloc:          %d\n",*merge_sensordepth_alloc);
-		fprintf(stderr,"dbg2       merge_sensordepth_time_d **:      %p\n",merge_sensordepth_time_d);
-		fprintf(stderr,"dbg2       merge_sensordepth_time_d *:       %p\n",*merge_sensordepth_time_d);
-		fprintf(stderr,"dbg2       merge_sensordepth_sensordepth **: %p\n",merge_sensordepth_sensordepth);
-		fprintf(stderr,"dbg2       merge_sensordepth_sensordepth *:  %p\n",*merge_sensordepth_sensordepth);
-		}
-	
-	/* set max number of characters to be read at a time */
-	nchar = MBP_FILENAMESIZE-1;
-
-	/* count the records */
-	*error = MB_ERROR_NO_ERROR;
-	nrecord = 0;
-	if ((tfp = fopen(merge_sensordepth_file, "r")) != NULL)
-		{
-		/* loop over reading the records */
-		while ((result = fgets(buffer,nchar,tfp)) == buffer)
-			nrecord++;
-			
-		/* close the file */
-		fclose(tfp);
-		tfp = NULL;
-		}
-	else
-		{
-		*error = MB_ERROR_OPEN_FAIL;
-		status = MB_FAILURE;
-		}
-	
-	/* allocate memory if necessary */
-	if (status == MB_SUCCESS && *merge_sensordepth_alloc < nrecord)
-		{
-		size = nrecord * sizeof(double);
-		status = mb_mallocd(verbose, __FILE__, __LINE__, size, (void **)merge_sensordepth_time_d, error);
-		if (status == MB_SUCCESS)
-			status = mb_mallocd(verbose, __FILE__, __LINE__, size, (void **)merge_sensordepth_sensordepth, error);
-		if (status == MB_SUCCESS)
-			*merge_sensordepth_alloc = nrecord;
-		n_time_d = *merge_sensordepth_time_d;
-		n_sensordepth = *merge_sensordepth_sensordepth;
-		}
-
-	/* read the records */
-	if (status == MB_SUCCESS)
-		{
-		nrecord = 0;
-		if ((tfp = fopen(merge_sensordepth_file, "r")) == NULL)
-			{
-			*error = MB_ERROR_OPEN_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			/* loop over reading the records - handle the different formats */
-			while ((result = fgets(buffer,nchar,tfp)) == buffer)
-				{
-				sensordepth_ok = MB_NO;
-
-				/* deal with sensordepth in form: time_d sensordepth */
-				if (merge_sensordepth_format == 1)
-					{
-					nget = sscanf(buffer,"%lf %lf",
-						&n_time_d[nrecord],&n_sensordepth[nrecord]);
-					if (nget == 2)
-						sensordepth_ok = MB_YES;
-					}
-		
-				/* deal with sensordepth in form: yr mon day hour min sec sensordepth */
-				else if (merge_sensordepth_format == 2)
-					{
-					nget = sscanf(buffer,"%d %d %d %d %d %lf %lf",
-						&time_i[0],&time_i[1],&time_i[2],
-						&time_i[3],&time_i[4],&sec,
-						&n_sensordepth[nrecord]);
-					time_i[5] = (int) sec;
-					time_i[6] = 1000000*(sec - time_i[5]);
-					mb_get_time(verbose,time_i,&time_d);
-					n_time_d[nrecord] = time_d;
-					if (nget == 7)
-						sensordepth_ok = MB_YES;
-					}
-		
-				/* deal with sensordepth in form: yr jday hour min sec sensordepth */
-				else if (merge_sensordepth_format == 3)
-					{
-					nget = sscanf(buffer,"%d %d %d %d %lf %lf",
-						&time_j[0],&time_j[1],&ihr,
-						&time_j[2],&sec,
-						&n_sensordepth[nrecord]);
-					time_j[2] = time_j[2] + 60*ihr;
-					time_j[3] = (int) sec;
-					time_j[4] = 1000000*(sec - time_j[3]);
-					mb_get_itime(verbose,time_j,time_i);
-					mb_get_time(verbose,time_i,&time_d);
-					n_time_d[nrecord] = time_d;
-					if (nget == 6)
-						sensordepth_ok = MB_YES;
-					}
-		
-				/* deal with sensordepth in form: yr jday daymin sec sensordepth */
-				else if (merge_sensordepth_format == 4)
-					{
-					nget = sscanf(buffer,"%d %d %d %lf %lf",
-						&time_j[0],&time_j[1],&time_j[2],
-						&sec,
-						&n_sensordepth[nrecord]);
-					time_j[3] = (int) sec;
-					time_j[4] = 1000000*(sec - time_j[3]);
-					mb_get_itime(verbose,time_j,time_i);
-					mb_get_time(verbose,time_i,&time_d);
-					n_time_d[nrecord] = time_d;
-					if (nget == 5)
-						sensordepth_ok = MB_YES;
-					}
-		
-				/* deal with sensordepth in form: yr mon day hour min sec time_d lon lat heading speed draft*/
-				else if (merge_sensordepth_format == 9)
-					{
-					nget = sscanf(buffer,"%d %d %d %d %d %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf",
-						&time_i[0],&time_i[1],&time_i[2],
-						&time_i[3],&time_i[4],&sec,
-						&n_time_d[nrecord],
-						&lon,&lat,
-						&heading,&speed,&n_sensordepth[nrecord],
-						&roll,&pitch,&heave);
-					if (nget >= 9)
-						sensordepth_ok = MB_YES;
-					if (nrecord > 0 && n_time_d[nrecord] <= n_time_d[nrecord-1])
-						sensordepth_ok = MB_NO;
-					}
-		
-				/* output some debug values */
-				if (verbose >= 5 && sensordepth_ok == MB_YES)
-					{
-					fprintf(stderr,"\ndbg5  New sensordepth point read in function <%s>\n",function_name);
-					fprintf(stderr,"dbg5       sensordepth[%d]: %f %f\n",
-						nrecord,n_time_d[nrecord],n_sensordepth[nrecord]);
-					}
-				else if (verbose >= 5)
-					{
-					fprintf(stderr,"\ndbg5  Error parsing line in sensordepth file in function <%s>\n",function_name);
-					fprintf(stderr,"dbg5       line: %s\n",buffer);
-					}
-		
-				/* check for reverses or repeats in time */
-				if (sensordepth_ok == MB_YES)
-					{
-					if (nrecord == 0)
-						nrecord++;
-					else if (n_time_d[nrecord] > n_time_d[nrecord-1])
-						nrecord++;
-					else if (nrecord > 0 && n_time_d[nrecord] <= n_time_d[nrecord-1]
-						&& verbose >= 5)
-						{
-						fprintf(stderr,"\ndbg5  sensordepth time error in function <%s>\n",function_name);
-						fprintf(stderr,"dbg5       sensordepth[%d]: %f %f\n",
-							nrecord-1,n_time_d[nrecord-1],n_sensordepth[nrecord-1]);
-						fprintf(stderr,"dbg5       sensordepth[%d]: %f %f\n",
-							nrecord,n_time_d[nrecord],n_sensordepth[nrecord]);
-						}
-					}
-				strncpy(buffer,"\0",sizeof(buffer));
-				}
-			
-			/* get the good record count */
-			*merge_sensordepth_num = nrecord;
-			
-			/* close the file */
-			fclose(tfp);
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       merge_sensordepth_num:            %d\n",*merge_sensordepth_num);
-		fprintf(stderr,"dbg2       merge_sensordepth_alloc:          %d\n",*merge_sensordepth_alloc);
-		fprintf(stderr,"dbg2       merge_sensordepth_time_d *:       %p\n",*merge_sensordepth_time_d);
-		fprintf(stderr,"dbg2       merge_sensordepth_sensordepth *:  %p\n",*merge_sensordepth_sensordepth);
-		fprintf(stderr,"dbg2       error:                            %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:                           %d\n",status);
-		}
-
-	/* return success */
-	return(status);
-	}
-
-/*--------------------------------------------------------------------*/
-
-int mb_loadaltitudedata(int verbose, char *merge_altitude_file, int merge_altitude_format,
-                int *merge_altitude_num, int *merge_altitude_alloc,
-                double **merge_altitude_time_d, double **merge_altitude_altitude,
-		int *error)
-	{
-	char	*function_name = "mb_loadaltitudedata";
-	int	status = MB_SUCCESS;
-	char	buffer[MBP_FILENAMESIZE], *result;
-	int	nrecord;
-	int	nchar, nget;
-	size_t	size;
-	FILE	*tfp;
-	int	altitude_ok;
-	int	time_i[7], time_j[6], ihr;
-	double	sec;
-	double	time_d;
-	double	*n_time_d;
-	double	*n_altitude;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       rcs_id:                           %s\n",rcs_id);
-		fprintf(stderr,"dbg2       verbose:                          %d\n",verbose);
-		fprintf(stderr,"dbg2       merge_altitude_file:              %s\n",merge_altitude_file);
-		fprintf(stderr,"dbg2       merge_altitude_format:            %d\n",merge_altitude_format);
-		fprintf(stderr,"dbg2       merge_altitude_num *:             %p\n",merge_altitude_num);
-		fprintf(stderr,"dbg2       merge_altitude_num:               %d\n",*merge_altitude_num);
-		fprintf(stderr,"dbg2       merge_altitude_alloc *:           %p\n",merge_altitude_alloc);
-		fprintf(stderr,"dbg2       merge_altitude_alloc:             %d\n",*merge_altitude_alloc);
-		fprintf(stderr,"dbg2       merge_altitude_time_d **:         %p\n",merge_altitude_time_d);
-		fprintf(stderr,"dbg2       merge_altitude_time_d *:          %p\n",*merge_altitude_time_d);
-		fprintf(stderr,"dbg2       merge_altitude_altitude **:       %p\n",merge_altitude_altitude);
-		fprintf(stderr,"dbg2       merge_altitude_altitude *:        %p\n",*merge_altitude_altitude);
-		}
-	
-	/* set max number of characters to be read at a time */
-	nchar = MBP_FILENAMESIZE-1;
-
-	/* count the records */
-	*error = MB_ERROR_NO_ERROR;
-	nrecord = 0;
-	if ((tfp = fopen(merge_altitude_file, "r")) != NULL)
-		{
-		/* loop over reading the records */
-		while ((result = fgets(buffer,nchar,tfp)) == buffer)
-			nrecord++;
-			
-		/* close the file */
-		fclose(tfp);
-		tfp = NULL;
-		}
-	else
-		{
-		*error = MB_ERROR_OPEN_FAIL;
-		status = MB_FAILURE;
-		}
-	
-	/* allocate memory if necessary */
-	if (status == MB_SUCCESS && *merge_altitude_alloc < nrecord)
-		{
-		size = nrecord * sizeof(double);
-		status = mb_mallocd(verbose, __FILE__, __LINE__, size, (void **)merge_altitude_time_d, error);
-		if (status == MB_SUCCESS)
-			status = mb_mallocd(verbose, __FILE__, __LINE__, size, (void **)merge_altitude_altitude, error);
-		if (status == MB_SUCCESS)
-			*merge_altitude_alloc = nrecord;
-		n_time_d = *merge_altitude_time_d;
-		n_altitude = *merge_altitude_altitude;
-		}
-
-	/* read the records */
-	if (status == MB_SUCCESS)
-		{
-		nrecord = 0;
-		if ((tfp = fopen(merge_altitude_file, "r")) == NULL)
-			{
-			*error = MB_ERROR_OPEN_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			/* loop over reading the records - handle the different formats */
-			while ((result = fgets(buffer,nchar,tfp)) == buffer)
-				{
-				altitude_ok = MB_NO;
-
-				/* deal with altitude in form: time_d altitude */
-				if (merge_altitude_format == 1)
-					{
-					nget = sscanf(buffer,"%lf %lf",
-						&n_time_d[nrecord],&n_altitude[nrecord]);
-					if (nget == 2)
-						altitude_ok = MB_YES;
-					}
-		
-				/* deal with altitude in form: yr mon day hour min sec altitude */
-				else if (merge_altitude_format == 2)
-					{
-					nget = sscanf(buffer,"%d %d %d %d %d %lf %lf",
-						&time_i[0],&time_i[1],&time_i[2],
-						&time_i[3],&time_i[4],&sec,
-						&n_altitude[nrecord]);
-					time_i[5] = (int) sec;
-					time_i[6] = 1000000*(sec - time_i[5]);
-					mb_get_time(verbose,time_i,&time_d);
-					n_time_d[nrecord] = time_d;
-					if (nget == 7)
-						altitude_ok = MB_YES;
-					}
-		
-				/* deal with altitude in form: yr jday hour min sec altitude */
-				else if (merge_altitude_format == 3)
-					{
-					nget = sscanf(buffer,"%d %d %d %d %lf %lf",
-						&time_j[0],&time_j[1],&ihr,
-						&time_j[2],&sec,
-						&n_altitude[nrecord]);
-					time_j[2] = time_j[2] + 60*ihr;
-					time_j[3] = (int) sec;
-					time_j[4] = 1000000*(sec - time_j[3]);
-					mb_get_itime(verbose,time_j,time_i);
-					mb_get_time(verbose,time_i,&time_d);
-					n_time_d[nrecord] = time_d;
-					if (nget == 6)
-						altitude_ok = MB_YES;
-					}
-		
-				/* deal with altitude in form: yr jday daymin sec altitude */
-				else if (merge_altitude_format == 4)
-					{
-					nget = sscanf(buffer,"%d %d %d %lf %lf",
-						&time_j[0],&time_j[1],&time_j[2],
-						&sec,
-						&n_altitude[nrecord]);
-					time_j[3] = (int) sec;
-					time_j[4] = 1000000*(sec - time_j[3]);
-					mb_get_itime(verbose,time_j,time_i);
-					mb_get_time(verbose,time_i,&time_d);
-					n_time_d[nrecord] = time_d;
-					if (nget == 5)
-						altitude_ok = MB_YES;
-					}
-		
-				/* output some debug values */
-				if (verbose >= 5 && altitude_ok == MB_YES)
-					{
-					fprintf(stderr,"\ndbg5  New altitude point read in function <%s>\n",function_name);
-					fprintf(stderr,"dbg5       altitude[%d]: %f %f\n",
-						nrecord,n_time_d[nrecord],n_altitude[nrecord]);
-					}
-				else if (verbose >= 5)
-					{
-					fprintf(stderr,"\ndbg5  Error parsing line in altitude file in function <%s>\n",function_name);
-					fprintf(stderr,"dbg5       line: %s\n",buffer);
-					}
-		
-				/* check for reverses or repeats in time */
-				if (altitude_ok == MB_YES)
-					{
-					if (nrecord == 0)
-						nrecord++;
-					else if (n_time_d[nrecord] > n_time_d[nrecord-1])
-						nrecord++;
-					else if (nrecord > 0 && n_time_d[nrecord] <= n_time_d[nrecord-1]
-						&& verbose >= 5)
-						{
-						fprintf(stderr,"\ndbg5  altitude time error in function <%s>\n",function_name);
-						fprintf(stderr,"dbg5       altitude[%d]: %f %f\n",
-							nrecord-1,n_time_d[nrecord-1],n_altitude[nrecord-1]);
-						fprintf(stderr,"dbg5       altitude[%d]: %f %f\n",
-							nrecord,n_time_d[nrecord],n_altitude[nrecord]);
-						}
-					}
-				strncpy(buffer,"\0",sizeof(buffer));
-				}
-			
-			/* get the good record count */
-			*merge_altitude_num = nrecord;
-			
-			/* close the file */
-			fclose(tfp);
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       merge_altitude_num:               %d\n",*merge_altitude_num);
-		fprintf(stderr,"dbg2       merge_altitude_alloc:             %d\n",*merge_altitude_alloc);
-		fprintf(stderr,"dbg2       merge_altitude_time_d *:          %p\n",*merge_altitude_time_d);
-		fprintf(stderr,"dbg2       merge_altitude_altitude *:        %p\n",*merge_altitude_altitude);
-		fprintf(stderr,"dbg2       error:                            %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:                           %d\n",status);
-		}
-
-	/* return success */
-	return(status);
-	}
-
-/*--------------------------------------------------------------------*/
-
-int mb_loadheadingdata(int verbose, char *merge_heading_file, int merge_heading_format,
-                int *merge_heading_num, int *merge_heading_alloc,
-                double **merge_heading_time_d, double **merge_heading_heading,
-		int *error)
-	{
-	char	*function_name = "mb_loadheadingdata";
-	int	status = MB_SUCCESS;
-	char	buffer[MBP_FILENAMESIZE], *result;
-	int	nrecord;
-	int	nchar, nget;
-	size_t	size;
-	FILE	*tfp;
-	int	heading_ok;
-	int	time_i[7], time_j[6], ihr;
-	double	sec;
-	double	time_d, lon, lat, sensordepth, speed, roll, pitch, heave;
-	double	*n_time_d;
-	double	*n_heading;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       rcs_id:                           %s\n",rcs_id);
-		fprintf(stderr,"dbg2       verbose:                          %d\n",verbose);
-		fprintf(stderr,"dbg2       merge_heading_file:               %s\n",merge_heading_file);
-		fprintf(stderr,"dbg2       merge_heading_format:             %d\n",merge_heading_format);
-		fprintf(stderr,"dbg2       merge_heading_num *:              %p\n",merge_heading_num);
-		fprintf(stderr,"dbg2       merge_heading_num:                %d\n",*merge_heading_num);
-		fprintf(stderr,"dbg2       merge_heading_alloc *:            %p\n",merge_heading_alloc);
-		fprintf(stderr,"dbg2       merge_heading_alloc:              %d\n",*merge_heading_alloc);
-		fprintf(stderr,"dbg2       merge_heading_time_d **:          %p\n",merge_heading_time_d);
-		fprintf(stderr,"dbg2       merge_heading_time_d *:           %p\n",*merge_heading_time_d);
-		fprintf(stderr,"dbg2       merge_heading_heading **:         %p\n",merge_heading_heading);
-		fprintf(stderr,"dbg2       merge_heading_heading *:          %p\n",*merge_heading_heading);
-		}
-	
-	/* set max number of characters to be read at a time */
-	nchar = MBP_FILENAMESIZE-1;
-
-	/* count the records */
-	*error = MB_ERROR_NO_ERROR;
-	nrecord = 0;
-	if ((tfp = fopen(merge_heading_file, "r")) != NULL)
-		{
-		/* loop over reading the records */
-		while ((result = fgets(buffer,nchar,tfp)) == buffer)
-			nrecord++;
-			
-		/* close the file */
-		fclose(tfp);
-		tfp = NULL;
-		}
-	else
-		{
-		*error = MB_ERROR_OPEN_FAIL;
-		status = MB_FAILURE;
-		}
-	
-	/* allocate memory if necessary */
-	if (status == MB_SUCCESS && *merge_heading_alloc < nrecord)
-		{
-		size = nrecord * sizeof(double);
-		status = mb_mallocd(verbose, __FILE__, __LINE__, size, (void **)merge_heading_time_d, error);
-		if (status == MB_SUCCESS)
-			status = mb_mallocd(verbose, __FILE__, __LINE__, size, (void **)merge_heading_heading, error);
-		if (status == MB_SUCCESS)
-			*merge_heading_alloc = nrecord;
-		n_time_d = *merge_heading_time_d;
-		n_heading = *merge_heading_heading;
-		}
-
-	/* read the records */
-	if (status == MB_SUCCESS)
-		{
-		nrecord = 0;
-		if ((tfp = fopen(merge_heading_file, "r")) == NULL)
-			{
-			*error = MB_ERROR_OPEN_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			/* loop over reading the records - handle the different formats */
-			while ((result = fgets(buffer,nchar,tfp)) == buffer)
-				{
-				heading_ok = MB_NO;
-
-				/* deal with heading in form: time_d heading */
-				if (merge_heading_format == 1)
-					{
-					nget = sscanf(buffer,"%lf %lf",
-						&n_time_d[nrecord],&n_heading[nrecord]);
-					if (nget == 2)
-						heading_ok = MB_YES;
-					}
-		
-				/* deal with heading in form: yr mon day hour min sec heading */
-				else if (merge_heading_format == 2)
-					{
-					nget = sscanf(buffer,"%d %d %d %d %d %lf %lf",
-						&time_i[0],&time_i[1],&time_i[2],
-						&time_i[3],&time_i[4],&sec,
-						&n_heading[nrecord]);
-					time_i[5] = (int) sec;
-					time_i[6] = 1000000*(sec - time_i[5]);
-					mb_get_time(verbose,time_i,&time_d);
-					n_time_d[nrecord] = time_d;
-					if (nget == 7)
-						heading_ok = MB_YES;
-					}
-		
-				/* deal with heading in form: yr jday hour min sec heading */
-				else if (merge_heading_format == 3)
-					{
-					nget = sscanf(buffer,"%d %d %d %d %lf %lf",
-						&time_j[0],&time_j[1],&ihr,
-						&time_j[2],&sec,
-						&n_heading[nrecord]);
-					time_j[2] = time_j[2] + 60*ihr;
-					time_j[3] = (int) sec;
-					time_j[4] = 1000000*(sec - time_j[3]);
-					mb_get_itime(verbose,time_j,time_i);
-					mb_get_time(verbose,time_i,&time_d);
-					n_time_d[nrecord] = time_d;
-					if (nget == 6)
-						heading_ok = MB_YES;
-					}
-		
-				/* deal with heading in form: yr jday daymin sec heading */
-				else if (merge_heading_format == 4)
-					{
-					nget = sscanf(buffer,"%d %d %d %lf %lf",
-						&time_j[0],&time_j[1],&time_j[2],
-						&sec,
-						&n_heading[nrecord]);
-					time_j[3] = (int) sec;
-					time_j[4] = 1000000*(sec - time_j[3]);
-					mb_get_itime(verbose,time_j,time_i);
-					mb_get_time(verbose,time_i,&time_d);
-					n_time_d[nrecord] = time_d;
-					if (nget == 5)
-						heading_ok = MB_YES;
-					}
-		
-				/* deal with heading in form: yr mon day hour min sec time_d lon lat heading speed draft*/
-				else if (merge_heading_format == 9)
-					{
-					nget = sscanf(buffer,"%d %d %d %d %d %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf",
-						&time_i[0],&time_i[1],&time_i[2],
-						&time_i[3],&time_i[4],&sec,
-						&n_time_d[nrecord],
-						&lon,&lat,
-						&n_heading[nrecord],&speed,&sensordepth,
-						&roll,&pitch,&heave);
-					if (nget >= 9)
-						heading_ok = MB_YES;
-					if (nrecord > 0 && n_time_d[nrecord] <= n_time_d[nrecord-1])
-						heading_ok = MB_NO;
-					}
-		
-				/* output some debug values */
-				if (verbose >= 5 && heading_ok == MB_YES)
-					{
-					fprintf(stderr,"\ndbg5  New heading point read in function <%s>\n",function_name);
-					fprintf(stderr,"dbg5       heading[%d]: %f %f\n",
-						nrecord,n_time_d[nrecord],n_heading[nrecord]);
-					}
-				else if (verbose >= 5)
-					{
-					fprintf(stderr,"\ndbg5  Error parsing line in heading file in function <%s>\n",function_name);
-					fprintf(stderr,"dbg5       line: %s\n",buffer);
-					}
-		
-				/* check for reverses or repeats in time */
-				if (heading_ok == MB_YES)
-					{
-					if (nrecord == 0)
-						nrecord++;
-					else if (n_time_d[nrecord] > n_time_d[nrecord-1])
-						nrecord++;
-					else if (nrecord > 0 && n_time_d[nrecord] <= n_time_d[nrecord-1]
-						&& verbose >= 5)
-						{
-						fprintf(stderr,"\ndbg5  heading time error in function <%s>\n",function_name);
-						fprintf(stderr,"dbg5       heading[%d]: %f %f\n",
-							nrecord-1,n_time_d[nrecord-1],n_heading[nrecord-1]);
-						fprintf(stderr,"dbg5       heading[%d]: %f %f\n",
-							nrecord,n_time_d[nrecord],n_heading[nrecord]);
-						}
-					}
-				strncpy(buffer,"\0",sizeof(buffer));
-				}
-			
-			/* get the good record count */
-			*merge_heading_num = nrecord;
-			
-			/* close the file */
-			fclose(tfp);
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       merge_heading_num:                %d\n",*merge_heading_num);
-		fprintf(stderr,"dbg2       merge_heading_alloc:              %d\n",*merge_heading_alloc);
-		fprintf(stderr,"dbg2       merge_heading_time_d *:           %p\n",*merge_heading_time_d);
-		fprintf(stderr,"dbg2       merge_heading_heading *:          %p\n",*merge_heading_heading);
-		fprintf(stderr,"dbg2       error:                            %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:                           %d\n",status);
-		}
-
-	/* return success */
-	return(status);
-	}
-
-/*--------------------------------------------------------------------*/
-
-int mb_loadattitudedata(int verbose, char *merge_attitude_file, int merge_attitude_format,
-                int *merge_attitude_num, int *merge_attitude_alloc,
-                double **merge_attitude_time_d, double **merge_attitude_roll,
-		double **merge_attitude_pitch, double **merge_attitude_heave,
-		int *error)
-	{
-	char	*function_name = "mb_loadattitudedata";
-	int	status = MB_SUCCESS;
-	char	buffer[MBP_FILENAMESIZE], *result;
-	int	nrecord;
-	int	nchar, nget;
-	size_t	size;
-	FILE	*tfp;
-	int	attitude_ok;
-	int	time_i[7], time_j[6], ihr;
-	double	sec;
-	double	time_d, lon, lat, sensordepth, heading, speed;
-	double	*n_time_d;
-	double	*n_roll;
-	double	*n_pitch;
-	double	*n_heave;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       rcs_id:                           %s\n",rcs_id);
-		fprintf(stderr,"dbg2       verbose:                          %d\n",verbose);
-		fprintf(stderr,"dbg2       merge_attitude_file:              %s\n",merge_attitude_file);
-		fprintf(stderr,"dbg2       merge_attitude_format:            %d\n",merge_attitude_format);
-		fprintf(stderr,"dbg2       merge_attitude_num *:             %p\n",merge_attitude_num);
-		fprintf(stderr,"dbg2       merge_attitude_num:               %d\n",*merge_attitude_num);
-		fprintf(stderr,"dbg2       merge_attitude_alloc *:           %p\n",merge_attitude_alloc);
-		fprintf(stderr,"dbg2       merge_attitude_alloc:             %d\n",*merge_attitude_alloc);
-		fprintf(stderr,"dbg2       merge_attitude_time_d **:         %p\n",merge_attitude_time_d);
-		fprintf(stderr,"dbg2       merge_attitude_time_d *:          %p\n",*merge_attitude_time_d);
-		fprintf(stderr,"dbg2       merge_attitude_roll **:           %p\n",merge_attitude_roll);
-		fprintf(stderr,"dbg2       merge_attitude_roll *:            %p\n",*merge_attitude_roll);
-		fprintf(stderr,"dbg2       merge_attitude_pitch **:          %p\n",merge_attitude_pitch);
-		fprintf(stderr,"dbg2       merge_attitude_pitch *:           %p\n",*merge_attitude_pitch);
-		fprintf(stderr,"dbg2       merge_attitude_heave **:          %p\n",merge_attitude_heave);
-		fprintf(stderr,"dbg2       merge_attitude_heave *:           %p\n",*merge_attitude_heave);
-		}
-	
-	/* set max number of characters to be read at a time */
-	nchar = MBP_FILENAMESIZE-1;
-
-	/* count the records */
-	*error = MB_ERROR_NO_ERROR;
-	nrecord = 0;
-	if ((tfp = fopen(merge_attitude_file, "r")) != NULL)
-		{
-		/* loop over reading the records */
-		while ((result = fgets(buffer,nchar,tfp)) == buffer)
-			nrecord++;
-			
-		/* close the file */
-		fclose(tfp);
-		tfp = NULL;
-		}
-	else
-		{
-		*error = MB_ERROR_OPEN_FAIL;
-		status = MB_FAILURE;
-		}
-	
-	/* allocate memory if necessary */
-	if (status == MB_SUCCESS && *merge_attitude_alloc < nrecord)
-		{
-		size = nrecord * sizeof(double);
-		status = mb_mallocd(verbose, __FILE__, __LINE__, size, (void **)merge_attitude_time_d, error);
-		if (status == MB_SUCCESS)
-			status = mb_mallocd(verbose, __FILE__, __LINE__, size, (void **)merge_attitude_roll, error);
-		if (status == MB_SUCCESS)
-			status = mb_mallocd(verbose, __FILE__, __LINE__, size, (void **)merge_attitude_pitch, error);
-		if (status == MB_SUCCESS)
-			status = mb_mallocd(verbose, __FILE__, __LINE__, size, (void **)merge_attitude_heave, error);
-		if (status == MB_SUCCESS)
-			*merge_attitude_alloc = nrecord;
-		n_time_d = *merge_attitude_time_d;
-		n_roll = *merge_attitude_roll;
-		n_pitch = *merge_attitude_pitch;
-		n_heave = *merge_attitude_heave;
-		}
-
-	/* read the records */
-	if (status == MB_SUCCESS)
-		{
-		nrecord = 0;
-		if ((tfp = fopen(merge_attitude_file, "r")) == NULL)
-			{
-			*error = MB_ERROR_OPEN_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			/* loop over reading the records - handle the different formats */
-			while ((result = fgets(buffer,nchar,tfp)) == buffer)
-				{
-				attitude_ok = MB_NO;
-
-				/* deal with attitude in form: time_d roll pitch heave */
-				if (merge_attitude_format == 1)
-					{
-					nget = sscanf(buffer,"%lf %lf %lf %lf",
-						&n_time_d[nrecord],&n_roll[nrecord],&n_pitch[nrecord],&n_heave[nrecord]);
-					if (nget == 4)
-						attitude_ok = MB_YES;
-					}
-		
-				/* deal with attitude in form: yr mon day hour min sec roll pitch heave */
-				else if (merge_attitude_format == 2)
-					{
-					nget = sscanf(buffer,"%d %d %d %d %d %lf %lf %lf %lf",
-						&time_i[0],&time_i[1],&time_i[2],
-						&time_i[3],&time_i[4],&sec,
-						&n_roll[nrecord],&n_pitch[nrecord],&n_heave[nrecord]);
-					time_i[5] = (int) sec;
-					time_i[6] = 1000000*(sec - time_i[5]);
-					mb_get_time(verbose,time_i,&time_d);
-					n_time_d[nrecord] = time_d;
-					if (nget == 9)
-						attitude_ok = MB_YES;
-					}
-		
-				/* deal with attitude in form: yr jday hour min sec roll pitch heave */
-				else if (merge_attitude_format == 3)
-					{
-					nget = sscanf(buffer,"%d %d %d %d %lf %lf %lf %lf",
-						&time_j[0],&time_j[1],&ihr,
-						&time_j[2],&sec,
-						&n_roll[nrecord],&n_pitch[nrecord],&n_heave[nrecord]);
-					time_j[2] = time_j[2] + 60*ihr;
-					time_j[3] = (int) sec;
-					time_j[4] = 1000000*(sec - time_j[3]);
-					mb_get_itime(verbose,time_j,time_i);
-					mb_get_time(verbose,time_i,&time_d);
-					n_time_d[nrecord] = time_d;
-					if (nget == 8)
-						attitude_ok = MB_YES;
-					}
-		
-				/* deal with attitude in form: yr jday daymin sec roll pitch heave */
-				else if (merge_attitude_format == 4)
-					{
-					nget = sscanf(buffer,"%d %d %d %lf %lf %lf %lf",
-						&time_j[0],&time_j[1],&time_j[2],
-						&sec,&n_roll[nrecord],&n_pitch[nrecord],&n_heave[nrecord]);
-					time_j[3] = (int) sec;
-					time_j[4] = 1000000*(sec - time_j[3]);
-					mb_get_itime(verbose,time_j,time_i);
-					mb_get_time(verbose,time_i,&time_d);
-					n_time_d[nrecord] = time_d;
-					if (nget == 7)
-						attitude_ok = MB_YES;
-					}
-		
-				/* deal with attitude in form: yr mon day hour min sec time_d lon lat heading speed sensordepth roll pitch heave */
-				else if (merge_attitude_format == 9)
-					{
-					nget = sscanf(buffer,"%d %d %d %d %d %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf",
-						&time_i[0],&time_i[1],&time_i[2],
-						&time_i[3],&time_i[4],&sec,
-						&n_time_d[nrecord],
-						&lon,&lat,
-						&heading,&speed,&sensordepth,
-						&n_roll[nrecord],&n_pitch[nrecord],&n_heave[nrecord]);
-					if (nget >= 9)
-						attitude_ok = MB_YES;
-					if (nrecord > 0 && n_time_d[nrecord] <= n_time_d[nrecord-1])
-						attitude_ok = MB_NO;
-					}
-		
-				/* output some debug values */
-				if (verbose >= 5 && attitude_ok == MB_YES)
-					{
-					fprintf(stderr,"\ndbg5  New attitude point read in function <%s>\n",function_name);
-					fprintf(stderr,"dbg5       attitude[%d]: %f %f %f %f\n",
-						nrecord,n_time_d[nrecord],n_roll[nrecord],n_pitch[nrecord],n_heave[nrecord]);
-					}
-				else if (verbose >= 5)
-					{
-					fprintf(stderr,"\ndbg5  Error parsing line in attitude file in function <%s>\n",function_name);
-					fprintf(stderr,"dbg5       line: %s\n",buffer);
-					}
-		
-				/* check for reverses or repeats in time */
-				if (attitude_ok == MB_YES)
-					{
-					if (nrecord == 0)
-						nrecord++;
-					else if (n_time_d[nrecord] > n_time_d[nrecord-1])
-						nrecord++;
-					else if (nrecord > 0 && n_time_d[nrecord] <= n_time_d[nrecord-1]
-						&& verbose >= 5)
-						{
-						fprintf(stderr,"\ndbg5  attitude time error in function <%s>\n",function_name);
-						fprintf(stderr,"dbg5       attitude[%d]: %f %f %f %f\n",
-							nrecord-1,n_time_d[nrecord-1],n_roll[nrecord-1],n_pitch[nrecord-1],n_heave[nrecord-1]);
-						fprintf(stderr,"dbg5       attitude[%d]: %f %f %f %f\n",
-							nrecord,n_time_d[nrecord],n_roll[nrecord],n_pitch[nrecord],n_heave[nrecord]);
-						}
-					}
-				strncpy(buffer,"\0",sizeof(buffer));
-				}
-			
-			/* get the good record count */
-			*merge_attitude_num = nrecord;
-			
-			/* close the file */
-			fclose(tfp);
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       merge_attitude_num:               %d\n",*merge_attitude_num);
-		fprintf(stderr,"dbg2       merge_attitude_alloc:             %d\n",*merge_attitude_alloc);
-		fprintf(stderr,"dbg2       merge_attitude_time_d *:          %p\n",*merge_attitude_time_d);
-		fprintf(stderr,"dbg2       merge_attitude_roll *:            %p\n",*merge_attitude_roll);
-		fprintf(stderr,"dbg2       merge_attitude_pitch *:           %p\n",*merge_attitude_pitch);
-		fprintf(stderr,"dbg2       merge_attitude_heave *:           %p\n",*merge_attitude_heave);
-		fprintf(stderr,"dbg2       error:                            %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:                           %d\n",status);
-		}
-
-	/* return success */
-	return(status);	
-	}
-/*--------------------------------------------------------------------*/
-
-int mb_loadsoundspeeddata(int verbose, char *merge_soundspeed_file, int merge_soundspeed_format,
-                int *merge_soundspeed_num, int *merge_soundspeed_alloc,
-                double **merge_soundspeed_time_d, double **merge_soundspeed_soundspeed,
-		int *error)
-	{
-	char	*function_name = "mb_loadsoundspeeddata";
-	int	status = MB_SUCCESS;
-	char	buffer[MBP_FILENAMESIZE], *result;
-	int	nrecord;
-	int	nchar, nget;
-	size_t	size;
-	FILE	*tfp;
-	int	soundspeed_ok;
-	int	time_i[7], time_j[6], ihr;
-	double	sec;
-	double	time_d;
-	double	*n_time_d;
-	double	*n_soundspeed;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       rcs_id:                           %s\n",rcs_id);
-		fprintf(stderr,"dbg2       verbose:                          %d\n",verbose);
-		fprintf(stderr,"dbg2       merge_soundspeed_file:            %s\n",merge_soundspeed_file);
-		fprintf(stderr,"dbg2       merge_soundspeed_format:          %d\n",merge_soundspeed_format);
-		fprintf(stderr,"dbg2       merge_soundspeed_num *:           %p\n",merge_soundspeed_num);
-		fprintf(stderr,"dbg2       merge_soundspeed_num:             %d\n",*merge_soundspeed_num);
-		fprintf(stderr,"dbg2       merge_soundspeed_alloc *:         %p\n",merge_soundspeed_alloc);
-		fprintf(stderr,"dbg2       merge_soundspeed_alloc:           %d\n",*merge_soundspeed_alloc);
-		fprintf(stderr,"dbg2       merge_soundspeed_time_d **:       %p\n",merge_soundspeed_time_d);
-		fprintf(stderr,"dbg2       merge_soundspeed_time_d *:        %p\n",*merge_soundspeed_time_d);
-		fprintf(stderr,"dbg2       merge_soundspeed_soundspeed **:   %p\n",merge_soundspeed_soundspeed);
-		fprintf(stderr,"dbg2       merge_soundspeed_soundspeed *:    %p\n",*merge_soundspeed_soundspeed);
-		}
-	
-	/* set max number of characters to be read at a time */
-	nchar = MBP_FILENAMESIZE-1;
-
-	/* count the records */
-	*error = MB_ERROR_NO_ERROR;
-	nrecord = 0;
-	if ((tfp = fopen(merge_soundspeed_file, "r")) != NULL)
-		{
-		/* loop over reading the records */
-		while ((result = fgets(buffer,nchar,tfp)) == buffer)
-			nrecord++;
-			
-		/* close the file */
-		fclose(tfp);
-		tfp = NULL;
-		}
-	else
-		{
-		*error = MB_ERROR_OPEN_FAIL;
-		status = MB_FAILURE;
-		}
-	
-	/* allocate memory if necessary */
-	if (status == MB_SUCCESS && *merge_soundspeed_alloc < nrecord)
-		{
-		size = nrecord * sizeof(double);
-		status = mb_mallocd(verbose, __FILE__, __LINE__, size, (void **)merge_soundspeed_time_d, error);
-		if (status == MB_SUCCESS)
-			status = mb_mallocd(verbose, __FILE__, __LINE__, size, (void **)merge_soundspeed_soundspeed, error);
-		if (status == MB_SUCCESS)
-			*merge_soundspeed_alloc = nrecord;
-		n_time_d = *merge_soundspeed_time_d;
-		n_soundspeed = *merge_soundspeed_soundspeed;
-		}
-
-	/* read the records */
-	if (status == MB_SUCCESS)
-		{
-		nrecord = 0;
-		if ((tfp = fopen(merge_soundspeed_file, "r")) == NULL)
-			{
-			*error = MB_ERROR_OPEN_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			/* loop over reading the records - handle the different formats */
-			while ((result = fgets(buffer,nchar,tfp)) == buffer)
-				{
-				soundspeed_ok = MB_NO;
-
-				/* deal with soundspeed in form: time_d soundspeed */
-				if (merge_soundspeed_format == 1)
-					{
-					nget = sscanf(buffer,"%lf %lf",
-						&n_time_d[nrecord],&n_soundspeed[nrecord]);
-					if (nget == 4)
-						soundspeed_ok = MB_YES;
-					}
-		
-				/* deal with soundspeed in form: yr mon day hour min sec soundspeed */
-				else if (merge_soundspeed_format == 2)
-					{
-					nget = sscanf(buffer,"%d %d %d %d %d %lf %lf",
-						&time_i[0],&time_i[1],&time_i[2],
-						&time_i[3],&time_i[4],&sec,
-						&n_soundspeed[nrecord]);
-					time_i[5] = (int) sec;
-					time_i[6] = 1000000*(sec - time_i[5]);
-					mb_get_time(verbose,time_i,&time_d);
-					n_time_d[nrecord] = time_d;
-					if (nget == 9)
-						soundspeed_ok = MB_YES;
-					}
-		
-				/* deal with soundspeed in form: yr jday hour min sec soundspeed */
-				else if (merge_soundspeed_format == 3)
-					{
-					nget = sscanf(buffer,"%d %d %d %d %lf %lf",
-						&time_j[0],&time_j[1],&ihr,
-						&time_j[2],&sec,
-						&n_soundspeed[nrecord]);
-					time_j[2] = time_j[2] + 60*ihr;
-					time_j[3] = (int) sec;
-					time_j[4] = 1000000*(sec - time_j[3]);
-					mb_get_itime(verbose,time_j,time_i);
-					mb_get_time(verbose,time_i,&time_d);
-					n_time_d[nrecord] = time_d;
-					if (nget == 8)
-						soundspeed_ok = MB_YES;
-					}
-		
-				/* deal with soundspeed in form: yr jday daymin sec soundspeed */
-				else if (merge_soundspeed_format == 4)
-					{
-					nget = sscanf(buffer,"%d %d %d %lf %lf",
-						&time_j[0],&time_j[1],&time_j[2],
-						&sec,&n_soundspeed[nrecord]);
-					time_j[3] = (int) sec;
-					time_j[4] = 1000000*(sec - time_j[3]);
-					mb_get_itime(verbose,time_j,time_i);
-					mb_get_time(verbose,time_i,&time_d);
-					n_time_d[nrecord] = time_d;
-					if (nget == 7)
-						soundspeed_ok = MB_YES;
-					}
-		
-				/* output some debug values */
-				if (verbose >= 5 && soundspeed_ok == MB_YES)
-					{
-					fprintf(stderr,"\ndbg5  New soundspeed point read in function <%s>\n",function_name);
-					fprintf(stderr,"dbg5       soundspeed[%d]: %f %f\n",
-						nrecord,n_time_d[nrecord],n_soundspeed[nrecord]);
-					}
-				else if (verbose >= 5)
-					{
-					fprintf(stderr,"\ndbg5  Error parsing line in soundspeed file in function <%s>\n",function_name);
-					fprintf(stderr,"dbg5       line: %s\n",buffer);
-					}
-		
-				/* check for reverses or repeats in time */
-				if (soundspeed_ok == MB_YES)
-					{
-					if (nrecord == 0)
-						nrecord++;
-					else if (n_time_d[nrecord] > n_time_d[nrecord-1])
-						nrecord++;
-					else if (nrecord > 0 && n_time_d[nrecord] <= n_time_d[nrecord-1]
-						&& verbose >= 5)
-						{
-						fprintf(stderr,"\ndbg5  soundspeed time error in function <%s>\n",function_name);
-						fprintf(stderr,"dbg5       soundspeed[%d]: %f %f\n",
-							nrecord-1,n_time_d[nrecord-1],n_soundspeed[nrecord-1]);
-						fprintf(stderr,"dbg5       soundspeed[%d]: %f %f\n",
-							nrecord,n_time_d[nrecord],n_soundspeed[nrecord]);
-						}
-					}
-				strncpy(buffer,"\0",sizeof(buffer));
-				}
-			
-			/* get the good record count */
-			*merge_soundspeed_num = nrecord;
-			
-			/* close the file */
-			fclose(tfp);
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       merge_soundspeed_num:             %d\n",*merge_soundspeed_num);
-		fprintf(stderr,"dbg2       merge_soundspeed_alloc:           %d\n",*merge_soundspeed_alloc);
-		fprintf(stderr,"dbg2       merge_soundspeed_time_d *:        %p\n",*merge_soundspeed_time_d);
-		fprintf(stderr,"dbg2       merge_soundspeed_soundspeed *:    %p\n",*merge_soundspeed_soundspeed);
-		fprintf(stderr,"dbg2       error:                            %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:                           %d\n",status);
-		}
-
-	/* return success */
-	return(status);	
-	}
-
-/*--------------------------------------------------------------------*/
-
-int mb_loadtimeshiftdata(int verbose, char *merge_timeshift_file, int merge_timeshift_format,
-                int *merge_timeshift_num, int *merge_timeshift_alloc,
-                double **merge_timeshift_time_d, double **merge_timeshift_timeshift,
-		int *error)
-	{
-	char	*function_name = "mb_loadtimeshiftdata";
-	int	status = MB_SUCCESS;
-	char	buffer[MBP_FILENAMESIZE], *result;
-	int	nrecord;
-	int	nchar, nget;
-	size_t	size;
-	FILE	*tfp;
-	int	timeshift_ok;
-	int	time_i[7], time_j[6], ihr;
-	double	sec;
-	double	time_d;
-	double	*n_time_d;
-	double	*n_timeshift;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       rcs_id:                           %s\n",rcs_id);
-		fprintf(stderr,"dbg2       verbose:                          %d\n",verbose);
-		fprintf(stderr,"dbg2       merge_timeshift_file:             %s\n",merge_timeshift_file);
-		fprintf(stderr,"dbg2       merge_timeshift_format:           %d\n",merge_timeshift_format);
-		fprintf(stderr,"dbg2       merge_timeshift_num *:            %p\n",merge_timeshift_num);
-		fprintf(stderr,"dbg2       merge_timeshift_num:              %d\n",*merge_timeshift_num);
-		fprintf(stderr,"dbg2       merge_timeshift_alloc *:          %p\n",merge_timeshift_alloc);
-		fprintf(stderr,"dbg2       merge_timeshift_alloc:            %d\n",*merge_timeshift_alloc);
-		fprintf(stderr,"dbg2       merge_timeshift_time_d **:        %p\n",merge_timeshift_time_d);
-		fprintf(stderr,"dbg2       merge_timeshift_time_d *:         %p\n",*merge_timeshift_time_d);
-		fprintf(stderr,"dbg2       merge_timeshift_timeshift **:     %p\n",merge_timeshift_timeshift);
-		fprintf(stderr,"dbg2       merge_timeshift_timeshift *:      %p\n",*merge_timeshift_timeshift);
-		}
-	
-	/* set max number of characters to be read at a time */
-	nchar = MBP_FILENAMESIZE-1;
-
-	/* count the records */
-	*error = MB_ERROR_NO_ERROR;
-	nrecord = 0;
-	if ((tfp = fopen(merge_timeshift_file, "r")) != NULL)
-		{
-		/* loop over reading the records */
-		while ((result = fgets(buffer,nchar,tfp)) == buffer)
-			nrecord++;
-			
-		/* close the file */
-		fclose(tfp);
-		tfp = NULL;
-		}
-	else
-		{
-		*error = MB_ERROR_OPEN_FAIL;
-		status = MB_FAILURE;
-		}
-	
-	/* allocate memory if necessary */
-	if (status == MB_SUCCESS && *merge_timeshift_alloc < nrecord)
-		{
-		size = nrecord * sizeof(double);
-		status = mb_mallocd(verbose, __FILE__, __LINE__, size, (void **)merge_timeshift_time_d, error);
-		if (status == MB_SUCCESS)
-			status = mb_mallocd(verbose, __FILE__, __LINE__, size, (void **)merge_timeshift_timeshift, error);
-		if (status == MB_SUCCESS)
-			*merge_timeshift_alloc = nrecord;
-		n_time_d = *merge_timeshift_time_d;
-		n_timeshift = *merge_timeshift_timeshift;
-		}
-
-	/* read the records */
-	if (status == MB_SUCCESS)
-		{
-		nrecord = 0;
-		if ((tfp = fopen(merge_timeshift_file, "r")) == NULL)
-			{
-			*error = MB_ERROR_OPEN_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			/* loop over reading the records - handle the different formats */
-			while ((result = fgets(buffer,nchar,tfp)) == buffer)
-				{
-				timeshift_ok = MB_NO;
-
-				/* deal with timeshift in form: time_d timeshift */
-				if (merge_timeshift_format == 1)
-					{
-					nget = sscanf(buffer,"%lf %lf",
-						&n_time_d[nrecord],&n_timeshift[nrecord]);
-					if (nget == 2)
-						timeshift_ok = MB_YES;
-					}
-		
-				/* deal with timeshift in form: yr mon day hour min sec timeshift */
-				else if (merge_timeshift_format == 2)
-					{
-					nget = sscanf(buffer,"%d %d %d %d %d %lf %lf",
-						&time_i[0],&time_i[1],&time_i[2],
-						&time_i[3],&time_i[4],&sec,
-						&n_timeshift[nrecord]);
-					time_i[5] = (int) sec;
-					time_i[6] = 1000000*(sec - time_i[5]);
-					mb_get_time(verbose,time_i,&time_d);
-					n_time_d[nrecord] = time_d;
-					if (nget == 7)
-						timeshift_ok = MB_YES;
-					}
-		
-				/* deal with timeshift in form: yr jday hour min sec timeshift */
-				else if (merge_timeshift_format == 3)
-					{
-					nget = sscanf(buffer,"%d %d %d %d %lf %lf",
-						&time_j[0],&time_j[1],&ihr,
-						&time_j[2],&sec,
-						&n_timeshift[nrecord]);
-					time_j[2] = time_j[2] + 60*ihr;
-					time_j[3] = (int) sec;
-					time_j[4] = 1000000*(sec - time_j[3]);
-					mb_get_itime(verbose,time_j,time_i);
-					mb_get_time(verbose,time_i,&time_d);
-					n_time_d[nrecord] = time_d;
-					if (nget == 6)
-						timeshift_ok = MB_YES;
-					}
-		
-				/* deal with timeshift in form: yr jday daymin sec timeshift */
-				else if (merge_timeshift_format == 4)
-					{
-					nget = sscanf(buffer,"%d %d %d %lf %lf",
-						&time_j[0],&time_j[1],&time_j[2],
-						&sec,
-						&n_timeshift[nrecord]);
-					time_j[3] = (int) sec;
-					time_j[4] = 1000000*(sec - time_j[3]);
-					mb_get_itime(verbose,time_j,time_i);
-					mb_get_time(verbose,time_i,&time_d);
-					n_time_d[nrecord] = time_d;
-					if (nget == 5)
-						timeshift_ok = MB_YES;
-					}
-		
-				/* output some debug values */
-				if (verbose >= 5 && timeshift_ok == MB_YES)
-					{
-					fprintf(stderr,"\ndbg5  New timeshift point read in function <%s>\n",function_name);
-					fprintf(stderr,"dbg5       timeshift[%d]: %f %f\n",
-						nrecord,n_time_d[nrecord],n_timeshift[nrecord]);
-					}
-				else if (verbose >= 5)
-					{
-					fprintf(stderr,"\ndbg5  Error parsing line in timeshift file in function <%s>\n",function_name);
-					fprintf(stderr,"dbg5       line: %s\n",buffer);
-					}
-		
-				/* check for reverses or repeats in time */
-				if (timeshift_ok == MB_YES)
-					{
-					if (nrecord == 0)
-						nrecord++;
-					else if (n_time_d[nrecord] > n_time_d[nrecord-1])
-						nrecord++;
-					else if (nrecord > 0 && n_time_d[nrecord] <= n_time_d[nrecord-1]
-						&& verbose >= 5)
-						{
-						fprintf(stderr,"\ndbg5  timeshift time error in function <%s>\n",function_name);
-						fprintf(stderr,"dbg5       timeshift[%d]: %f %f\n",
-							nrecord-1,n_time_d[nrecord-1],n_timeshift[nrecord-1]);
-						fprintf(stderr,"dbg5       timeshift[%d]: %f %f\n",
-							nrecord,n_time_d[nrecord],n_timeshift[nrecord]);
-						}
-					}
-				strncpy(buffer,"\0",sizeof(buffer));
-				}
-			
-			/* get the good record count */
-			*merge_timeshift_num = nrecord;
-			
-			/* close the file */
-			fclose(tfp);
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       merge_timeshift_num:              %d\n",*merge_timeshift_num);
-		fprintf(stderr,"dbg2       merge_timeshift_alloc:            %d\n",*merge_timeshift_alloc);
-		fprintf(stderr,"dbg2       merge_timeshift_time_d *:         %p\n",*merge_timeshift_time_d);
-		fprintf(stderr,"dbg2       merge_timeshift_timeshift *:      %p\n",*merge_timeshift_timeshift);
-		fprintf(stderr,"dbg2       error:                            %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:                           %d\n",status);
-		}
-
-	/* return success */
-	return(status);
-	}
-
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mb_platform.c b/src/mbio/mb_platform.c
deleted file mode 100644
index 0df50bd..0000000
--- a/src/mbio/mb_platform.c
+++ /dev/null
@@ -1,1415 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mb_platform.c	11/1/00
- *    $Id: mb_platform.c 2250 2015-06-30 02:12:26Z caress $
- *
- *    Copyright (c) 2015-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * This source file includes the functions used to read and write
- * platform definition files.
- * The structures used to store platform, sensor, and offset information
- * are defined in mb_io.h
- *
- * Author:	D. W. Caress
- * Date:	June 26, 2015
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mb_define.h"
-#include "mb_segy.h"
-
-static char svn_id[]="$Id: mb_platform.c 2250 2015-06-30 02:12:26Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mb_platform_init(int verbose, int type, char *name, char *organization,
-			int source_swathbathymetry, int source_position,
-			int source_depth, int source_heave, int source_heading,
-			int source_rollpitch, 
-			void **platform_ptr, int *error)
-{
-	char	*function_name = "mb_platform_init";
-	int	status = MB_SUCCESS;
-	struct mb_platform_struct *platform;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:                  %d\n", verbose);
-		fprintf(stderr,"dbg2       type:		     %d\n", type);
-		fprintf(stderr,"dbg2       name:		     %s\n", name);
-		fprintf(stderr,"dbg2       organization:	     %s\n", organization);
-		fprintf(stderr,"dbg2       source_swathbathymetry:   %d\n", source_swathbathymetry);
-		fprintf(stderr,"dbg2       source_position:	     %d\n", source_position);
-		fprintf(stderr,"dbg2       source_depth:	     %d\n", source_depth);
-		fprintf(stderr,"dbg2       source_heave:	     %d\n", source_heave);
-		fprintf(stderr,"dbg2       source_heading:	     %d\n", source_heading);
-		fprintf(stderr,"dbg2       source_rollpitch:	     %d\n", source_rollpitch);
-		fprintf(stderr,"dbg2       platform_ptr:             %p\n", platform_ptr);
-		fprintf(stderr,"dbg2       *platform_ptr:            %p\n", *platform_ptr);
-		}
-
-	/* allocate memory for platform descriptor structure if needed */
-	if (*platform_ptr == NULL)
-		{
-		status = mb_mallocd(verbose,__FILE__, __LINE__,sizeof(struct mb_platform_struct),
-				(void **) platform_ptr, error);
-		if (status == MB_SUCCESS)
-			{
-			memset(*platform_ptr, 0, sizeof(struct mb_platform_struct));
-			}
-		}
-		
-	/* get platform structure */
-	platform = (struct mb_platform_struct *) *platform_ptr;
-	
-	/* set values */
-	platform->type = type;
-	if (name != NULL)
-		strcpy(platform->name, name);
-	else
-		memset(platform->name, 0, sizeof(mb_longname));
-	if (organization != NULL)
-		strcpy(platform->organization, organization);
-	else
-		memset(platform->name, 0, sizeof(mb_longname));
-	platform->source_swathbathymetry = source_swathbathymetry;
-	platform->source_position = source_position;
-	platform->source_depth = source_depth;
-	platform->source_heave = source_heave;
-	platform->source_heading = source_heading;
-	platform->source_rollpitch = source_rollpitch;
-	platform->num_sensors = 0;
-	
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       platform_ptr:		     %p\n", platform_ptr);
-		fprintf(stderr,"dbg2       *platform_ptr:		     %p\n", *platform_ptr);
-		fprintf(stderr,"dbg2       platform->type:		     %d\n", platform->type);
-		fprintf(stderr,"dbg2       platform->name:		     %s\n", platform->name);
-		fprintf(stderr,"dbg2       platform->organization:	     %s\n", platform->organization);
-		fprintf(stderr,"dbg2       platform->source_swathbathymetry: %d\n", platform->source_swathbathymetry);
-		fprintf(stderr,"dbg2       platform->source_position:	     %d\n", platform->source_position);
-		fprintf(stderr,"dbg2       platform->source_depth:	     %d\n", platform->source_depth);
-		fprintf(stderr,"dbg2       platform->source_heave:	     %d\n", platform->source_heave);
-		fprintf(stderr,"dbg2       platform->source_heading:	     %d\n", platform->source_heading);
-		fprintf(stderr,"dbg2       platform->source_rollpitch:	     %d\n", platform->source_rollpitch);
-		fprintf(stderr,"dbg2       platform->num_sensors:	     %d\n", platform->num_sensors);
-		fprintf(stderr,"dbg2       error:			     %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:			     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_platform_add_sensor(int verbose, void **platform_ptr,
-			           int type, mb_longname model,
-				   mb_longname manufacturer,
-				   mb_longname serialnumber,
-				   int capability, int special_capability,
-				   int num_offsets, int num_time_latency,
-				   int *error)
-{
-	char	*function_name = "mb_platform_add_sensor";
-	int	status = MB_SUCCESS;
-	struct mb_platform_struct *platform;
-	struct mb_sensor_struct *sensor;
-	struct mb_sensor_offset_struct *offset;
-	int	isensor;
-	int	ioffset;
-	char	*message = NULL;
-	size_t	size;
-	int	i, j, k;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:              %d\n", verbose);
-		fprintf(stderr,"dbg2       platform_ptr:         %p\n", platform_ptr);
-		fprintf(stderr,"dbg2       *platform_ptr:        %p\n", *platform_ptr);
-		fprintf(stderr,"dbg2       type:                 %d\n", type);
-		fprintf(stderr,"dbg2       model:                %s\n", model);
-		fprintf(stderr,"dbg2       manufacturer:         %s\n", manufacturer);
-		fprintf(stderr,"dbg2       serialnumber:         %s\n", serialnumber);
-		fprintf(stderr,"dbg2       capability:           %d\n", capability);
-		fprintf(stderr,"dbg2       special_capability:   %d\n", special_capability);
-		fprintf(stderr,"dbg2       num_offsets:          %d\n", num_offsets);
-		fprintf(stderr,"dbg2       num_time_latency:     %d\n", num_time_latency);
-		}
-
-	/* allocate memory for platform descriptor structure if needed */
-	if (*platform_ptr == NULL)
-		{
-		status = mb_mallocd(verbose,__FILE__, __LINE__,sizeof(struct mb_platform_struct),
-				(void **) platform_ptr, error);
-		if (status == MB_SUCCESS)
-			{
-			memset(*platform_ptr, 0, sizeof(struct mb_platform_struct));
-			}
-		}
-		
-	/* get platform structure */
-	platform = (struct mb_platform_struct *) *platform_ptr;
-	
-	/* allocate memory for sensor if needed */
-	platform->num_sensors++;
-	if (platform->num_sensors > platform->num_sensors_alloc)
-		{
-		size = platform->num_sensors * sizeof(struct mb_sensor_struct);
-		status = mb_reallocd(verbose,__FILE__, __LINE__,
-					size, (void **) &platform->sensors, error);
-		if (status == MB_SUCCESS)
-			{
-			memset(&platform->sensors[platform->num_sensors_alloc],
-			       0, (platform->num_sensors - platform->num_sensors_alloc) * sizeof(struct mb_sensor_struct));
-			platform->num_sensors_alloc = platform->num_sensors;
-			}
-		else
-			{
-			mb_error(verbose,*error,&message);
-			fprintf(stderr,"\nMBIO Error allocating sensor structures:\n%s\n",message);
-			fprintf(stderr,"\nProgram terminated in function <%s>\n", function_name);
-			exit(*error);
-			}
-		}
-		
-	/* allocate memory for offsets if needed */
-	isensor = platform->num_sensors - 1;
-	sensor = &platform->sensors[isensor];
-	sensor->num_offsets = num_offsets;
-	if (sensor->num_offsets > sensor->num_offsets_alloc)
-		{
-		size = sensor->num_offsets * sizeof(struct mb_sensor_offset_struct);
-		status = mb_reallocd(verbose,__FILE__, __LINE__,
-					size, (void **) &sensor->offsets, error);
-		if (status == MB_SUCCESS)
-			{
-			memset(sensor->offsets, 0, size);
-			sensor->num_offsets_alloc = sensor->num_offsets;
-			}
-		else
-			{
-			mb_error(verbose,*error,&message);
-			fprintf(stderr,"\nMBIO Error allocating sensor offsets structures:\n%s\n",message);
-			fprintf(stderr,"\nProgram terminated in function <%s>\n", function_name);
-			exit(*error);
-			}
-		}
-		
-	/* allocate memory for time latency model if needed */
-	if (num_time_latency > 0)
-		{
-		for (ioffset=0;ioffset<sensor->num_offsets;ioffset++)
-			{
-			offset = &sensor->offsets[ioffset];
-			
-			size = num_time_latency * sizeof(double);
-			status = mb_reallocd(verbose,__FILE__, __LINE__,
-						size, (void **) &offset->time_latency_time_d, error);
-			if (status == MB_SUCCESS)
-			status = mb_reallocd(verbose,__FILE__, __LINE__,
-						size, (void **) &offset->time_latency_value, error);
-			if (status == MB_SUCCESS)
-				{
-				memset(offset->time_latency_time_d, 0, size);
-				memset(offset->time_latency_value, 0, size);
-				offset->num_time_latency_alloc = num_time_latency;
-				}
-			else
-				{
-				mb_error(verbose,*error,&message);
-				fprintf(stderr,"\nMBIO Error allocating sensor offsets structures:\n%s\n",message);
-				fprintf(stderr,"\nProgram terminated in function <%s>\n", function_name);
-				exit(*error);
-				}
-			}
-		}
-	
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       platform_ptr:		%p\n", platform_ptr);
-		}
-	if (verbose >= 2 && *error == MB_ERROR_NO_ERROR)
-		{
-		fprintf(stderr,"dbg2       *platform_ptr:		     %p\n", *platform_ptr);
-		fprintf(stderr,"dbg2       platform->type:		     %d\n", platform->type);
-		fprintf(stderr,"dbg2       platform->name:		     %s\n", platform->name);
-		fprintf(stderr,"dbg2       platform->organization:	     %s\n", platform->organization);
-		fprintf(stderr,"dbg2       platform->source_swathbathymetry: %d\n", platform->source_swathbathymetry);
-		fprintf(stderr,"dbg2       platform->source_position:	     %d\n", platform->source_position);
-		fprintf(stderr,"dbg2       platform->source_depth:	     %d\n", platform->source_depth);
-		fprintf(stderr,"dbg2       platform->source_heave:	     %d\n", platform->source_heave);
-		fprintf(stderr,"dbg2       platform->source_heading:	     %d\n", platform->source_heading);
-		fprintf(stderr,"dbg2       platform->source_rollpitch:	     %d\n", platform->source_rollpitch);
-		fprintf(stderr,"dbg2       platform->num_sensors:	     %d\n", platform->num_sensors);
-		for (i=0;i<platform->num_sensors;i++)
-			{
-			fprintf(stderr,"dbg2       platform->sensors[%2d].type:                 %d\n", i, platform->sensors[i].type);
-			fprintf(stderr,"dbg2       platform->sensors[%2d].model:                %s\n", i, platform->sensors[i].model);
-			fprintf(stderr,"dbg2       platform->sensors[%2d].manufacturer:         %s\n", i, platform->sensors[i].manufacturer);
-			fprintf(stderr,"dbg2       platform->sensors[%2d].serialnumber:         %s\n", i, platform->sensors[i].serialnumber);
-			fprintf(stderr,"dbg2       platform->sensors[%2d].capability:           %d\n", i, platform->sensors[i].capability);
-			fprintf(stderr,"dbg2       platform->sensors[%2d].special_capability:   %d\n", i, platform->sensors[i].special_capability);
-			fprintf(stderr,"dbg2       platform->sensors[%2d].num_offsets:          %d\n", i, platform->sensors[i].num_offsets);
-			for (j=0;j<platform->sensors[i].num_offsets;j++)
-				{
-				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].time_latency_mode:	%d\n", i, j, platform->sensors[i].offsets[j].time_latency_mode);
-				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].time_latency_static:	%f\n", i, j, platform->sensors[i].offsets[j].time_latency_static);
-				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].num_time_latency:		%d\n", i, j, platform->sensors[i].offsets[j].num_time_latency);
-				for (k=0;k<platform->sensors[i].offsets[j].num_time_latency;k++)
-					{
-					fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].time_latency[%2d]:		%16.6f %8.6f\n", i, j, k,
-						platform->sensors[i].offsets[j].time_latency_time_d[k],platform->sensors[i].offsets[j].time_latency_value[k]);
-					}
-				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].position_offset_mode:	%d\n", i, j, platform->sensors[i].offsets[j].position_offset_mode);
-				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].position_offset_x:	%f\n", i, j, platform->sensors[i].offsets[j].position_offset_x);
-				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].position_offset_y:	%f\n", i, j, platform->sensors[i].offsets[j].position_offset_y);
-				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].position_offset_z:	%f\n", i, j, platform->sensors[i].offsets[j].position_offset_z);
-				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].attitude_offset_mode:	%d\n", i, j, platform->sensors[i].offsets[j].attitude_offset_mode);
-				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].attitude_offset_azimuth:	%f\n", i, j, platform->sensors[i].offsets[j].attitude_offset_azimuth);
-				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].attitude_offset_roll:	%f\n", i, j, platform->sensors[i].offsets[j].attitude_offset_roll);
-				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].attitude_offset_pitch:	%f\n", i, j, platform->sensors[i].offsets[j].attitude_offset_pitch);
-				}
-			}
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:			%d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:			%d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_platform_add_sensor_offset(int verbose, void **platform_ptr,
-					int isensor, int ioffset,
-					int time_latency_mode,
-					double time_latency_static,
-					int num_time_latency,
-					double *time_latency_time_d,
-					double *time_latency_value,
-					int position_offset_mode,
-					double position_offset_x,
-					double position_offset_y,
-					double position_offset_z,   
-					int attitude_offset_mode,
-					double attitude_offset_azimuth,
-					double attitude_offset_roll,
-					double attitude_offset_pitch,
-					int *error)
-{
-	char	*function_name = "mb_platform_add_sensor_offset";
-	int	status = MB_SUCCESS;
-	struct mb_platform_struct *platform;
-	struct mb_sensor_struct *sensor;
-	struct mb_sensor_offset_struct *offset;
-	char	*message = NULL;
-	size_t	size;
-	int	i, j, k;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:                 %d\n", verbose);
-		fprintf(stderr,"dbg2       platform_ptr:            %p\n", platform_ptr);
-		fprintf(stderr,"dbg2       *platform_ptr:           %p\n", *platform_ptr);
-		fprintf(stderr,"dbg2       isensor:                 %d\n", isensor);
-		fprintf(stderr,"dbg2       ioffset:                 %d\n", ioffset);
-		fprintf(stderr,"dbg2       time_latency_mode:	    %d\n", time_latency_mode);
-		fprintf(stderr,"dbg2       time_latency_static:	    %f\n", time_latency_static);
-		fprintf(stderr,"dbg2       num_time_latency:        %d\n", num_time_latency);
-		for (k=0;k<num_time_latency;k++)
-			{
-			fprintf(stderr,"dbg2       time_latency[%2d]:       %16.6f %8.6f\n", 
-				k, time_latency_time_d[k],time_latency_value[k]);
-			}
-		fprintf(stderr,"dbg2       position_offset_mode:    %d\n", position_offset_mode);
-		fprintf(stderr,"dbg2       position_offset_x:       %f\n", position_offset_x);
-		fprintf(stderr,"dbg2       position_offset_y:	    %f\n", position_offset_y);
-		fprintf(stderr,"dbg2       position_offset_z:	    %f\n", position_offset_z);
-		fprintf(stderr,"dbg2       attitude_offset_mode:    %d\n", attitude_offset_mode);
-		fprintf(stderr,"dbg2       attitude_offset_azimuth: %f\n", attitude_offset_azimuth);
-		fprintf(stderr,"dbg2       attitude_offset_roll:    %f\n", attitude_offset_roll);
-		fprintf(stderr,"dbg2       attitude_offset_pitch:   %f\n", attitude_offset_pitch);
-		}
-
-	/* get platform and sensor structures */
-	platform = (struct mb_platform_struct *) *platform_ptr;
-	sensor = &platform->sensors[isensor];
-		
-	/* allocate memory for offsets if needed */
-	if (ioffset > sensor->num_offsets - 1)
-		sensor->num_offsets = ioffset + 1;
-	if (sensor->num_offsets > sensor->num_offsets_alloc)
-		{
-		size = sensor->num_offsets * sizeof(struct mb_sensor_offset_struct);
-		status = mb_reallocd(verbose,__FILE__, __LINE__,
-					size, (void **) &sensor->offsets, error);
-		if (status == MB_SUCCESS)
-			{
-			memset(sensor->offsets, 0, size);
-			sensor->num_offsets_alloc = sensor->num_offsets;
-			}
-		else
-			{
-			mb_error(verbose,*error,&message);
-			fprintf(stderr,"\nMBIO Error allocating sensor offsets structures:\n%s\n",message);
-			fprintf(stderr,"\nProgram terminated in function <%s>\n", function_name);
-			exit(*error);
-			}
-		}
-
-	/* get offset structure */
-	offset = &sensor->offsets[ioffset];
-		
-	/* allocate memory for time latency model if needed */
-	if (num_time_latency > 0)
-		{
-		size = num_time_latency * sizeof(double);
-		status = mb_reallocd(verbose,__FILE__, __LINE__,
-					size, (void **) &offset->time_latency_time_d, error);
-		if (status == MB_SUCCESS)
-		status = mb_reallocd(verbose,__FILE__, __LINE__,
-					size, (void **) &offset->time_latency_value, error);
-		if (status == MB_SUCCESS)
-			{
-			memset(offset->time_latency_time_d, 0, size);
-			memset(offset->time_latency_value, 0, size);
-			offset->num_time_latency_alloc = num_time_latency;
-			}
-		else
-			{
-			mb_error(verbose,*error,&message);
-			fprintf(stderr,"\nMBIO Error allocating sensor offsets structures:\n%s\n",message);
-			fprintf(stderr,"\nProgram terminated in function <%s>\n", function_name);
-			exit(*error);
-			}
-		}
-
-	/* set offset values */
-	offset->time_latency_mode = time_latency_mode;
-	offset->time_latency_static = time_latency_static;
-	offset->num_time_latency = num_time_latency;
-	for (k=0;k<offset->num_time_latency;k++)
-		{
-		offset->time_latency_time_d[k] = time_latency_time_d[k];
-		offset->time_latency_value[k] = time_latency_value[k];
-		}
-	offset->position_offset_mode = position_offset_mode;
-	offset->position_offset_x = position_offset_x;
-	offset->position_offset_y = position_offset_y;
-	offset->position_offset_z = position_offset_z;
-	offset->attitude_offset_mode = attitude_offset_mode;
-	offset->attitude_offset_azimuth = attitude_offset_azimuth;
-	offset->attitude_offset_roll = attitude_offset_roll;
-	offset->attitude_offset_pitch = attitude_offset_pitch;
-	
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       platform_ptr:		%p\n", platform_ptr);
-		}
-	if (verbose >= 2 && *error == MB_ERROR_NO_ERROR)
-		{
-		fprintf(stderr,"dbg2       *platform_ptr:		     %p\n", *platform_ptr);
-		fprintf(stderr,"dbg2       platform->type:		     %d\n", platform->type);
-		fprintf(stderr,"dbg2       platform->name:		     %s\n", platform->name);
-		fprintf(stderr,"dbg2       platform->organization:	     %s\n", platform->organization);
-		fprintf(stderr,"dbg2       platform->source_swathbathymetry: %d\n", platform->source_swathbathymetry);
-		fprintf(stderr,"dbg2       platform->source_position:	     %d\n", platform->source_position);
-		fprintf(stderr,"dbg2       platform->source_depth:	     %d\n", platform->source_depth);
-		fprintf(stderr,"dbg2       platform->source_heave:	     %d\n", platform->source_heave);
-		fprintf(stderr,"dbg2       platform->source_heading:	     %d\n", platform->source_heading);
-		fprintf(stderr,"dbg2       platform->source_rollpitch:	     %d\n", platform->source_rollpitch);
-		fprintf(stderr,"dbg2       platform->num_sensors:	     %d\n", platform->num_sensors);
-		for (i=0;i<platform->num_sensors;i++)
-			{
-			fprintf(stderr,"dbg2       platform->sensors[%2d].type:                 %d\n", i, platform->sensors[i].type);
-			fprintf(stderr,"dbg2       platform->sensors[%2d].model:                %s\n", i, platform->sensors[i].model);
-			fprintf(stderr,"dbg2       platform->sensors[%2d].manufacturer:         %s\n", i, platform->sensors[i].manufacturer);
-			fprintf(stderr,"dbg2       platform->sensors[%2d].serialnumber:         %s\n", i, platform->sensors[i].serialnumber);
-			fprintf(stderr,"dbg2       platform->sensors[%2d].capability:           %d\n", i, platform->sensors[i].capability);
-			fprintf(stderr,"dbg2       platform->sensors[%2d].special_capability:   %d\n", i, platform->sensors[i].special_capability);
-			fprintf(stderr,"dbg2       platform->sensors[%2d].num_offsets:          %d\n", i, platform->sensors[i].num_offsets);
-			for (j=0;j<platform->sensors[i].num_offsets;j++)
-				{
-				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].time_latency_mode:	%d\n", i, j, platform->sensors[i].offsets[j].time_latency_mode);
-				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].time_latency_static:	%f\n", i, j, platform->sensors[i].offsets[j].time_latency_static);
-				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].num_time_latency:		%d\n", i, j, platform->sensors[i].offsets[j].num_time_latency);
-				for (k=0;k<platform->sensors[i].offsets[j].num_time_latency;k++)
-					{
-					fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].time_latency[%2d]:		%16.6f %8.6f\n", i, j, k,
-						platform->sensors[i].offsets[j].time_latency_time_d[k],platform->sensors[i].offsets[j].time_latency_value[k]);
-					}
-				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].position_offset_mode:	%d\n", i, j, platform->sensors[i].offsets[j].position_offset_mode);
-				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].position_offset_x:	%f\n", i, j, platform->sensors[i].offsets[j].position_offset_x);
-				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].position_offset_y:	%f\n", i, j, platform->sensors[i].offsets[j].position_offset_y);
-				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].position_offset_z:	%f\n", i, j, platform->sensors[i].offsets[j].position_offset_z);
-				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].attitude_offset_mode:	%d\n", i, j, platform->sensors[i].offsets[j].attitude_offset_mode);
-				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].attitude_offset_azimuth:	%f\n", i, j, platform->sensors[i].offsets[j].attitude_offset_azimuth);
-				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].attitude_offset_roll:	%f\n", i, j, platform->sensors[i].offsets[j].attitude_offset_roll);
-				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].attitude_offset_pitch:	%f\n", i, j, platform->sensors[i].offsets[j].attitude_offset_pitch);
-				}
-			}
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:			%d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:			%d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-	
-int mb_platform_deall(int verbose, void **platform_ptr, int *error)
-{
-	char	*function_name = "mb_platform_deall";
-	int	status = MB_SUCCESS;
-	struct mb_platform_struct *platform;
-	struct mb_sensor_struct *sensor;
-	struct mb_sensor_offset_struct *offset;
-	int	isensor;
-	int	ioffset;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:           %d\n", verbose);
-		fprintf(stderr,"dbg2       platform_ptr:      %p\n", platform_ptr);
-		fprintf(stderr,"dbg2       *platform_ptr:     %p\n", *platform_ptr);
-		}
-
-	/* free memory for platform descriptor structure if needed */
-	if (*platform_ptr != NULL)
-		{
-		/* get platform structure */
-		platform = (struct mb_platform_struct *) *platform_ptr;
-		
-		/* loop over all sensors */
-		for (isensor=0;isensor<platform->num_sensors_alloc;isensor++)
-			{
-			sensor = (struct mb_sensor_struct *) &platform->sensors[isensor];
-			
-			/* free all offsets */
-			if (sensor->num_offsets_alloc > 0
-				&& sensor->offsets != NULL)
-				{
-				/* free any time latency model */
-				for (ioffset=0;ioffset<sensor->num_offsets;ioffset++)
-					{
-					offset = (struct mb_sensor_offset_struct *) &sensor->offsets[ioffset];
-					if (offset->num_time_latency_alloc > 0)
-						{
-						status = mb_freed(verbose,__FILE__, __LINE__,
-							(void **) &offset->time_latency_time_d, error);
-						status = mb_freed(verbose,__FILE__, __LINE__,
-							(void **) &offset->time_latency_value, error);
-						offset->num_time_latency_alloc = 0;
-						}
-					}
-				
-				status = mb_freed(verbose,__FILE__, __LINE__,
-						(void **) &sensor->offsets, error);
-				sensor->num_offsets_alloc = 0;
-				}
-			}
-
-		/* free all offsets */
-		if (platform->num_sensors_alloc > 0
-			&& platform->sensors != NULL)
-			{
-			status = mb_freed(verbose,__FILE__, __LINE__,
-					(void **) &platform->sensors, error);
-			}
-			
-		/* free platform structure */
-		status = mb_freed(verbose,__FILE__, __LINE__,
-				(void **) platform_ptr, error);
-		}
-	
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       platform_ptr:		%p\n", platform_ptr);
-		fprintf(stderr,"dbg2       *platform_ptr:     %p\n", *platform_ptr);
-		fprintf(stderr,"dbg2       error:			%d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:			%d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-	
-/*--------------------------------------------------------------------*/
-
-int mb_platform_read(int verbose, char *platform_file, void **platform_ptr, int *error)
-{
-	char	*function_name = "mb_platform_read";
-	int	status = MB_SUCCESS;
-	struct mb_platform_struct *platform;
-	size_t	size;
-	FILE	*fp;
-	char	buffer[MB_PATH_MAXLINE], dummy[MB_PATH_MAXLINE], *result, *message;
-	int	ivalue;
-	double	dvalue, dvalue2, dvalue3;
-	char	svalue[MB_PATH_MAXLINE];
-	int 	len;
-	int	isensor, ioffset;
-	int	i, j, k;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:           %d\n", verbose);
-		fprintf(stderr,"dbg2       platform_file:     %s\n", platform_file);
-		fprintf(stderr,"dbg2       platform_ptr:      %p\n", platform_ptr);
-		fprintf(stderr,"dbg2       *platform_ptr:     %p\n", *platform_ptr);
-		}
-
-	/* allocate memory for platform descriptor structure if needed */
-	if (*platform_ptr == NULL)
-		{
-		status = mb_mallocd(verbose,__FILE__, __LINE__,sizeof(struct mb_platform_struct),
-				(void **) platform_ptr, error);
-		if (status == MB_SUCCESS)
-			{
-			memset(*platform_ptr, 0, sizeof(struct mb_platform_struct));
-			}
-		}
-		
-	/* get platform structure */
-	platform = (struct mb_platform_struct *) *platform_ptr;
-		
-	/* open and read platform file */
-	if ((fp = fopen(platform_file, "r")) != NULL)
-		{
-		while ((result = fgets(buffer,MB_PATH_MAXLINE,fp)) == buffer)
-			{
-			if (buffer[0] != '#')
-				{
-				len = strlen(buffer);
-				if (len > 0)
-					{
-					if (buffer[len-1] == '\n')
-						buffer[len-1] = '\0';
-					if (buffer[len-2] == '\r')
-						buffer[len-2] = '\0';
-					}
-	    
-				/* general parameters */
-				if (strncmp(buffer, "PLATFORM_TYPE", 13) == 0)
-					{
-					sscanf(buffer, "%s %d", dummy, &platform->type);
-					}
-				else if (strncmp(buffer, "PLATFORM_NAME", 13) == 0)
-					{
-					sscanf(buffer, "%s %s", dummy, platform->name);
-					}
-				else if (strncmp(buffer, "PLATFORM_ORGANIZATION", 21) == 0)
-					{
-					sscanf(buffer, "%s %s", dummy, platform->organization);
-					}
-				else if (strncmp(buffer, "SOURCE_SWATHBATHYMETRY", 15) == 0)
-					{
-					sscanf(buffer, "%s %d", dummy, &platform->source_swathbathymetry);
-					}
-				else if (strncmp(buffer, "SOURCE_POSITION", 15) == 0)
-					{
-					sscanf(buffer, "%s %d", dummy, &platform->source_position);
-					}
-				else if (strncmp(buffer, "SOURCE_DEPTH", 12) == 0)
-					{
-					sscanf(buffer, "%s %d", dummy, &platform->source_depth);
-					}
-				else if (strncmp(buffer, "SOURCE_HEAVE", 12) == 0)
-					{
-					sscanf(buffer, "%s %d", dummy, &platform->source_heave);
-					}
-				else if (strncmp(buffer, "SOURCE_HEADING", 14) == 0)
-					{
-					sscanf(buffer, "%s %d", dummy, &platform->source_heading);
-					}
-				else if (strncmp(buffer, "SOURCE_ROLLPITCH", 16) == 0)
-					{
-					sscanf(buffer, "%s %d", dummy, &platform->source_rollpitch);
-					}
-				else if (strncmp(buffer, "PLATFORM_NUM_SENSORS", 20) == 0)
-					{
-					sscanf(buffer, "%s %d", dummy, &platform->num_sensors);
-					if (platform->num_sensors > platform->num_sensors_alloc)
-						{
-						size = platform->num_sensors * sizeof(struct mb_sensor_struct);
-						status = mb_mallocd(verbose,__FILE__, __LINE__,
-									size, (void **) &platform->sensors, error);
-						if (status == MB_SUCCESS)
-							{
-							memset(platform->sensors, 0, size);
-							platform->num_sensors_alloc = platform->num_sensors;
-							}
-						else
-							{
-							mb_error(verbose,*error,&message);
-							fprintf(stderr,"\nMBIO Error allocating sensor structures:\n%s\n",message);
-							fprintf(stderr,"\nProgram terminated in function <%s>\n", function_name);
-							exit(*error);
-							}
-						}
-					}
-	
-				else if (strncmp(buffer, "SENSOR_TYPE", 11) == 0)
-					{
-					sscanf(buffer, "%s %d %d", dummy, &isensor, &ivalue);
-					if (isensor >= 0 && isensor < platform->num_sensors)
-						platform->sensors[isensor].type = ivalue;
-					}
-				else if (strncmp(buffer, "SENSOR_MODEL", 12) == 0)
-					{
-					sscanf(buffer, "%s %d %s", dummy, &isensor, svalue);
-					if (isensor >= 0 && isensor < platform->num_sensors)
-						strcpy(platform->sensors[isensor].model, svalue);
-					}
-				else if (strncmp(buffer, "SENSOR_MANUFACTURER", 19) == 0)
-					{
-					sscanf(buffer, "%s %d %s", dummy, &isensor, svalue);
-					if (isensor >= 0 && isensor < platform->num_sensors)
-						strcpy(platform->sensors[isensor].manufacturer, svalue);
-					}
-				else if (strncmp(buffer, "SENSOR_SERIALNUMBER", 19) == 0)
-					{
-					sscanf(buffer, "%s %d %s", dummy, &isensor, svalue);
-					if (isensor >= 0 && isensor < platform->num_sensors)
-						strcpy(platform->sensors[isensor].serialnumber, svalue);
-					}
-				else if (strncmp(buffer, "SENSOR_CAPABILITY", 17) == 0)
-					{
-					sscanf(buffer, "%s %d %d", dummy, &isensor, &ivalue);
-					if (isensor >= 0 && isensor < platform->num_sensors)
-						platform->sensors[isensor].capability = ivalue;
-					}
-				else if (strncmp(buffer, "SENSOR_SPECIAL_CAPABILITY", 25) == 0)
-					{
-					sscanf(buffer, "%s %d %d", dummy, &isensor, &ivalue);
-					if (isensor >= 0 && isensor < platform->num_sensors)
-						platform->sensors[isensor].special_capability = ivalue;
-					}
-				else if (strncmp(buffer, "SENSOR_NUM_OFFSETS", 17) == 0)
-					{
-					sscanf(buffer, "%s %d %d", dummy, &isensor, &ivalue);
-					if (isensor >= 0 && isensor < platform->num_sensors)
-						platform->sensors[isensor].num_offsets = ivalue;
-					if (platform->sensors[isensor].num_offsets > platform->sensors[isensor].num_offsets_alloc)
-						{
-						size = platform->sensors[isensor].num_offsets * sizeof(struct mb_sensor_offset_struct);
-						status = mb_mallocd(verbose,__FILE__, __LINE__,
-									size, (void **) &platform->sensors[isensor].offsets, error);
-						if (status == MB_SUCCESS)
-							{
-							memset(platform->sensors[isensor].offsets, 0, size);
-							platform->sensors[isensor].num_offsets_alloc = platform->sensors[isensor].num_offsets;
-							}
-						else
-							{
-							mb_error(verbose,*error,&message);
-							fprintf(stderr,"\nMBIO Error allocating sensor offsets structures:\n%s\n",message);
-							fprintf(stderr,"\nProgram terminated in function <%s>\n", function_name);
-							exit(*error);
-							}
-						}
-					}
-	
-				else if (strncmp(buffer, "OFFSET_TIME_LATENCY_STATIC", 26) == 0)
-					{
-					sscanf(buffer, "%s %d %d %lf", dummy, &isensor, &ioffset, &dvalue);
-					if (isensor >= 0 && isensor < platform->num_sensors
-					    && ioffset >= 0 && ioffset < platform->sensors[isensor].num_offsets)
-						{
-						platform->sensors[isensor].offsets[ioffset].time_latency_static = dvalue;
-						platform->sensors[isensor].offsets[ioffset].time_latency_mode = MB_SENSOR_TIME_LATENCY_STATIC;
-						}
-					}
-				else if (strncmp(buffer, "OFFSET_TIME_LATENCY_MODEL", 26) == 0)
-					{
-					sscanf(buffer, "%s %d %d %d", dummy, &isensor, &ioffset, &ivalue);
-					if (isensor >= 0 && isensor < platform->num_sensors
-					    && ioffset >= 0 && ioffset < platform->sensors[isensor].num_offsets)
-						{
-						platform->sensors[isensor].offsets[ioffset].num_time_latency = ivalue;
-						platform->sensors[isensor].offsets[ioffset].time_latency_mode = MB_SENSOR_TIME_LATENCY_MODEL;
-						if (platform->sensors[isensor].offsets[ioffset].num_time_latency
-						    < platform->sensors[isensor].offsets[ioffset].num_time_latency_alloc)
-							{
-							size = platform->sensors[isensor].offsets[ioffset].num_time_latency * sizeof(double);
-							status = mb_mallocd(verbose,__FILE__, __LINE__, size,
-										(void **) &platform->sensors[isensor].offsets[ioffset].time_latency_time_d,
-										error);
-							status = mb_mallocd(verbose,__FILE__, __LINE__, size,
-										(void **) &platform->sensors[isensor].offsets[ioffset].time_latency_value,
-										error);
-							if (status == MB_SUCCESS)
-								{
-								memset(platform->sensors[isensor].offsets[ioffset].time_latency_time_d, 0, size);
-								memset(platform->sensors[isensor].offsets[ioffset].time_latency_value, 0, size);
-								platform->sensors[isensor].offsets[ioffset].num_time_latency_alloc
-									= platform->sensors[isensor].offsets[ioffset].num_time_latency;
-								}
-							else
-								{
-								mb_error(verbose,*error,&message);
-								fprintf(stderr,"\nMBIO Error allocating sensor offsets structures:\n%s\n",message);
-								fprintf(stderr,"\nProgram terminated in function <%s>\n", function_name);
-								exit(*error);
-								}
-							
-							}
-									
-						/* read the time latency model */
-						for (i=0;i<platform->sensors[isensor].offsets[ioffset].num_time_latency;i++)
-							{
-							if ((result = fgets(buffer,MB_PATH_MAXLINE,fp)) == buffer)
-								{
-								sscanf(buffer, "%lf %lf",
-									&platform->sensors[isensor].offsets[ioffset].time_latency_time_d[i],
-									&platform->sensors[isensor].offsets[ioffset].time_latency_value[i]);
-								}
-							else
-								{
-								status = MB_FAILURE;
-								*error = MB_ERROR_EOF;
-								mb_error(verbose,*error,&message);
-								fprintf(stderr,"\nMBIO Error parsing sensor offset time latency model:\n%s\n",message);
-								fprintf(stderr,"\nProgram terminated in function <%s>\n", function_name);
-								exit(*error);
-								}
-							}
-						}
-					}
-	
-				else if (strncmp(buffer, "OFFSET_POSITION", 15) == 0)
-					{
-					sscanf(buffer, "%s %d %d %lf %lf %lf", dummy, &isensor, &ioffset, &dvalue, &dvalue2, &dvalue3);
-					platform->sensors[isensor].offsets[ioffset].position_offset_x = dvalue;
-					platform->sensors[isensor].offsets[ioffset].position_offset_y = dvalue2;
-					platform->sensors[isensor].offsets[ioffset].position_offset_z = dvalue3;
-					platform->sensors[isensor].offsets[ioffset].position_offset_mode = MB_SENSOR_POSITION_OFFSET_STATIC;
-					}
-				else if (strncmp(buffer, "OFFSET_ATTITUDE", 15) == 0)
-					{
-					sscanf(buffer, "%s %d %d %lf %lf %lf", dummy, &isensor, &ioffset, &dvalue, &dvalue2, &dvalue3);
-					platform->sensors[isensor].offsets[ioffset].attitude_offset_azimuth = dvalue;
-					platform->sensors[isensor].offsets[ioffset].attitude_offset_roll = dvalue2;
-					platform->sensors[isensor].offsets[ioffset].attitude_offset_pitch = dvalue3;
-					platform->sensors[isensor].offsets[ioffset].attitude_offset_mode = MB_SENSOR_ATTITUDE_OFFSET_STATIC;
-					}
-				}
-			}
-			
-		/* close the file */
-		fclose(fp);
-		}
-
-	/* failure opening */
-	else
-		{
-		*error = MB_ERROR_OPEN_FAIL;
-		status = MB_FAILURE;
-		}
-	
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       platform_ptr:		%p\n", platform_ptr);
-		}
-	if (verbose >= 2 && *error == MB_ERROR_NO_ERROR)
-		{
-		fprintf(stderr,"dbg2       *platform_ptr:		     %p\n", *platform_ptr);
-		fprintf(stderr,"dbg2       platform->type:		     %d\n", platform->type);
-		fprintf(stderr,"dbg2       platform->name:		     %s\n", platform->name);
-		fprintf(stderr,"dbg2       platform->organization:	     %s\n", platform->organization);
-		fprintf(stderr,"dbg2       platform->source_swathbathymetry: %d\n", platform->source_swathbathymetry);
-		fprintf(stderr,"dbg2       platform->source_position:	     %d\n", platform->source_position);
-		fprintf(stderr,"dbg2       platform->source_depth:	     %d\n", platform->source_depth);
-		fprintf(stderr,"dbg2       platform->source_heave:	     %d\n", platform->source_heave);
-		fprintf(stderr,"dbg2       platform->source_heading:	     %d\n", platform->source_heading);
-		fprintf(stderr,"dbg2       platform->source_rollpitch:	     %d\n", platform->source_rollpitch);
-		fprintf(stderr,"dbg2       platform->num_sensors:	     %d\n", platform->num_sensors);
-		for (i=0;i<platform->num_sensors;i++)
-			{
-			fprintf(stderr,"dbg2       platform->sensors[%2d].type:                 %d\n", i, platform->sensors[i].type);
-			fprintf(stderr,"dbg2       platform->sensors[%2d].model:                %s\n", i, platform->sensors[i].model);
-			fprintf(stderr,"dbg2       platform->sensors[%2d].manufacturer:         %s\n", i, platform->sensors[i].manufacturer);
-			fprintf(stderr,"dbg2       platform->sensors[%2d].serialnumber:         %s\n", i, platform->sensors[i].serialnumber);
-			fprintf(stderr,"dbg2       platform->sensors[%2d].capability:           %d\n", i, platform->sensors[i].capability);
-			fprintf(stderr,"dbg2       platform->sensors[%2d].special_capability:   %d\n", i, platform->sensors[i].special_capability);
-			fprintf(stderr,"dbg2       platform->sensors[%2d].num_offsets:          %d\n", i, platform->sensors[i].num_offsets);
-			for (j=0;j<platform->sensors[i].num_offsets;j++)
-				{
-				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].time_latency_mode:	%d\n", i, j, platform->sensors[i].offsets[j].time_latency_mode);
-				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].time_latency_static:	%f\n", i, j, platform->sensors[i].offsets[j].time_latency_static);
-				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].num_time_latency:		%d\n", i, j, platform->sensors[i].offsets[j].num_time_latency);
-				for (k=0;k<platform->sensors[i].offsets[j].num_time_latency;k++)
-					{
-					fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].time_latency[%2d]:		%16.6f %8.6f\n", i, j, k,
-						platform->sensors[i].offsets[j].time_latency_time_d[k],platform->sensors[i].offsets[j].time_latency_value[k]);
-					}
-				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].position_offset_mode:	%d\n", i, j, platform->sensors[i].offsets[j].position_offset_mode);
-				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].position_offset_x:	%f\n", i, j, platform->sensors[i].offsets[j].position_offset_x);
-				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].position_offset_y:	%f\n", i, j, platform->sensors[i].offsets[j].position_offset_y);
-				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].position_offset_z:	%f\n", i, j, platform->sensors[i].offsets[j].position_offset_z);
-				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].attitude_offset_mode:	%d\n", i, j, platform->sensors[i].offsets[j].attitude_offset_mode);
-				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].attitude_offset_azimuth:	%f\n", i, j, platform->sensors[i].offsets[j].attitude_offset_azimuth);
-				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].attitude_offset_roll:	%f\n", i, j, platform->sensors[i].offsets[j].attitude_offset_roll);
-				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].attitude_offset_pitch:	%f\n", i, j, platform->sensors[i].offsets[j].attitude_offset_pitch);
-				}
-			}
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:			%d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:			%d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_platform_write(int verbose, char *platform_file, void **platform_ptr, int *error)
-{
-	char	*function_name = "mb_platform_write";
-	int	status = MB_SUCCESS;
-	struct mb_platform_struct *platform;
-	time_t	right_now;
-	char	date[32], user[MB_PATH_MAXLINE], *user_ptr, host[MB_PATH_MAXLINE];
-	FILE 	*fp;
-	int	isensor, ioffset;
-	int	i, j, k;
-		
-	/* get platform structure */
-	platform = (struct mb_platform_struct *) *platform_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:           %d\n", verbose);
-		fprintf(stderr,"dbg2       platform_ptr:		%p\n", platform_ptr);
-		fprintf(stderr,"dbg2       *platform_ptr:		%p\n", *platform_ptr);
-		}
-	if (verbose >= 2 && *error == MB_ERROR_NO_ERROR)
-		{
-		fprintf(stderr,"dbg2       *platform_ptr:		     %p\n", *platform_ptr);
-		fprintf(stderr,"dbg2       platform->type:		     %d\n", platform->type);
-		fprintf(stderr,"dbg2       platform->name:		     %s\n", platform->name);
-		fprintf(stderr,"dbg2       platform->organization:	     %s\n", platform->organization);
-		fprintf(stderr,"dbg2       platform->source_swathbathymetry: %d\n", platform->source_swathbathymetry);
-		fprintf(stderr,"dbg2       platform->source_position:	     %d\n", platform->source_position);
-		fprintf(stderr,"dbg2       platform->source_depth:	     %d\n", platform->source_depth);
-		fprintf(stderr,"dbg2       platform->source_heave:	     %d\n", platform->source_heave);
-		fprintf(stderr,"dbg2       platform->source_heading:	     %d\n", platform->source_heading);
-		fprintf(stderr,"dbg2       platform->source_rollpitch:	     %d\n", platform->source_rollpitch);
-		fprintf(stderr,"dbg2       platform->num_sensors:	     %d\n", platform->num_sensors);
-		for (i=0;i<platform->num_sensors;i++)
-			{
-			fprintf(stderr,"dbg2       platform->sensors[%2d].type:                 %d\n", i, platform->sensors[i].type);
-			fprintf(stderr,"dbg2       platform->sensors[%2d].model:                %s\n", i, platform->sensors[i].model);
-			fprintf(stderr,"dbg2       platform->sensors[%2d].manufacturer:         %s\n", i, platform->sensors[i].manufacturer);
-			fprintf(stderr,"dbg2       platform->sensors[%2d].serialnumber:         %s\n", i, platform->sensors[i].serialnumber);
-			fprintf(stderr,"dbg2       platform->sensors[%2d].capability:           %d\n", i, platform->sensors[i].capability);
-			fprintf(stderr,"dbg2       platform->sensors[%2d].special_capability:   %d\n", i, platform->sensors[i].special_capability);
-			fprintf(stderr,"dbg2       platform->sensors[%2d].num_offsets:          %d\n", i, platform->sensors[i].num_offsets);
-			for (j=0;j<platform->sensors[i].num_offsets;j++)
-				{
-				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].time_latency_mode:	%d\n", i, j, platform->sensors[i].offsets[j].time_latency_mode);
-				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].time_latency_static:	%f\n", i, j, platform->sensors[i].offsets[j].time_latency_static);
-				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].num_time_latency:		%d\n", i, j, platform->sensors[i].offsets[j].num_time_latency);
-				for (k=0;k<platform->sensors[i].offsets[j].num_time_latency;k++)
-					{
-					fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].time_latency[%2d]:		%16.6f %8.6f\n", i, j, k,
-						platform->sensors[i].offsets[j].time_latency_time_d[k],platform->sensors[i].offsets[j].time_latency_value[k]);
-					}
-				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].position_offset_mode:	%d\n", i, j, platform->sensors[i].offsets[j].position_offset_mode);
-				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].position_offset_x:	%f\n", i, j, platform->sensors[i].offsets[j].position_offset_x);
-				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].position_offset_y:	%f\n", i, j, platform->sensors[i].offsets[j].position_offset_y);
-				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].position_offset_z:	%f\n", i, j, platform->sensors[i].offsets[j].position_offset_z);
-				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].attitude_offset_mode:	%d\n", i, j, platform->sensors[i].offsets[j].attitude_offset_mode);
-				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].attitude_offset_azimuth:	%f\n", i, j, platform->sensors[i].offsets[j].attitude_offset_azimuth);
-				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].attitude_offset_roll:	%f\n", i, j, platform->sensors[i].offsets[j].attitude_offset_roll);
-				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].attitude_offset_pitch:	%f\n", i, j, platform->sensors[i].offsets[j].attitude_offset_pitch);
-				}
-			}
-		}
-		
-	/* open and read platform file */
-	if ((fp = fopen(platform_file, "w")) != NULL)
-		{
-		right_now = time((time_t *)0);
-		strcpy(date,ctime(&right_now));
-                date[strlen(date)-1] = '\0';
-		if ((user_ptr = getenv("USER")) == NULL)
-			user_ptr = getenv("LOGNAME");
-		if (user_ptr != NULL)
-			strcpy(user,user_ptr);
-		else
-			strcpy(user, "unknown");
-		gethostname(host,MB_PATH_MAXLINE);
-		fprintf(fp, "## MB-System Platform Definition File\n");
-		fprintf(fp,"MB-SYSTEM_VERSION\t%s\n",MB_VERSION);
-		fprintf(fp,"SOURCE_VERSION\t%s\n",svn_id);
-		fprintf(fp,"FILE_VERSION\t1.00\n");
-		fprintf(fp,"ORIGIN\tGenerated by user <%s> on cpu <%s> at <%s>\n", user,host,date);
-		
-		
-		fprintf(stderr, "PLATFORM_TYPE\t%d\n", platform->type);
-		fprintf(stderr, "PLATFORM_NAME\t%s\n", platform->name);
-		fprintf(stderr, "PLATFORM_ORGANIZATION\t%s\n", platform->organization);
-		fprintf(stderr, "SOURCE_SWATHBATHYMETRY\t%d\n", platform->source_swathbathymetry);
-		fprintf(stderr, "SOURCE_POSITION\t%d\n", platform->source_position);
-		fprintf(stderr, "SOURCE_DEPTH\t%d\n", platform->source_depth);
-		fprintf(stderr, "SOURCE_HEAVE\t%d\n", platform->source_heave);
-		fprintf(stderr, "SOURCE_HEADING\t%d\n", platform->source_heading);
-		fprintf(stderr, "SOURCE_ROLLPITCH\t%d\n", platform->source_rollpitch);
-		fprintf(stderr, "PLATFORM_NUM_SENSORS\t%d\n", platform->num_sensors);
-		for (isensor=0;isensor<platform->num_sensors;isensor++)
-			{
-			fprintf(stderr, "SENSOR_TYPE\t%d\t%d\n", isensor, platform->sensors[i].type);
-			fprintf(stderr, "SENSOR_MODEL\t%d\t%s\n", isensor, platform->sensors[i].model);
-			fprintf(stderr, "SENSOR_MANUFACTURER\t%d\t%s\n", isensor, platform->sensors[i].manufacturer);
-			fprintf(stderr, "SENSOR_SERIALNUMBER\t%d\t%s\n", isensor, platform->sensors[i].serialnumber);
-			fprintf(stderr, "SENSOR_CAPABILITY\t%d\t%d\n", isensor, platform->sensors[i].capability);
-			fprintf(stderr, "SENSOR_SPECIAL_CAPABILITY\t%d\t%d\n", isensor, platform->sensors[i].special_capability);
-			fprintf(stderr, "SENSOR_NUM_OFFSETS\t%d\t%d\n", isensor, platform->sensors[i].num_offsets);
-			for (ioffset=0;ioffset<platform->sensors[isensor].num_offsets;ioffset++)
-				{
-				if (platform->sensors[isensor].offsets[ioffset].time_latency_mode
-					== MB_SENSOR_TIME_LATENCY_STATIC)
-					{
-					fprintf(stderr, "OFFSET_TIME_LATENCY_STATIC\t%d\t%d %f\n",
-							isensor, ioffset, platform->sensors[isensor].offsets[ioffset].time_latency_static);
-					}
-				else if (platform->sensors[isensor].offsets[ioffset].time_latency_mode
-					== MB_SENSOR_TIME_LATENCY_MODEL)
-					{
-					fprintf(stderr, "OFFSET_TIME_LATENCY_MODEL\t%d\t%d\t%d\n",
-							isensor, ioffset, platform->sensors[isensor].offsets[ioffset].num_time_latency);
-					for (i=0;i<platform->sensors[isensor].offsets[ioffset].num_time_latency;i++)
-						{
-						fprintf(stdout, "%f\t%f",
-								platform->sensors[isensor].offsets[ioffset].time_latency_time_d[i],
-								platform->sensors[isensor].offsets[ioffset].time_latency_value[i]);
-						
-						}
-					}
-				if (platform->sensors[isensor].offsets[ioffset].position_offset_mode == MB_SENSOR_POSITION_OFFSET_STATIC)
-					{
-					fprintf(stderr, "OFFSET_POSITION\t%d\t%d\t%lf\t%lf\t%lf\n", isensor, ioffset, 
-						platform->sensors[isensor].offsets[ioffset].position_offset_x,
-						platform->sensors[isensor].offsets[ioffset].position_offset_y,
-						platform->sensors[isensor].offsets[ioffset].position_offset_z);
-					}
-				if (platform->sensors[isensor].offsets[ioffset].attitude_offset_mode == MB_SENSOR_ATTITUDE_OFFSET_STATIC)
-					{
-					fprintf(stderr, "OFFSET_ATTITUDE\t%d\t%d\t%lf\t%lf\t%lf\n", isensor, ioffset, 
-						platform->sensors[isensor].offsets[ioffset].attitude_offset_azimuth,
-						platform->sensors[isensor].offsets[ioffset].attitude_offset_roll,
-						platform->sensors[isensor].offsets[ioffset].attitude_offset_pitch);
-					}
-				}
-			}
-			
-		/* close the file */
-		fclose(fp);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:			%d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:			%d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_platform_lever(int verbose, void **platform_ptr,
-                      int targetsensor, int targetsensoroffset,
-		      double heading, double roll, double pitch,
-		      double *lever_x, double *lever_y, double *lever_z,
-                      int *error)
-{
-	char	*function_name = "mb_platform_lever";
-	int	status = MB_SUCCESS;
-	struct mb_platform_struct *platform;
-	struct mb_sensor_struct *sensor_target = NULL;
-	struct mb_sensor_struct *sensor_swathbathymetry = NULL;
-	struct mb_sensor_struct *sensor_rollpitch = NULL;
-	struct mb_sensor_struct *sensor_heading = NULL;
-	struct mb_sensor_struct *sensor_position = NULL;
-	struct mb_sensor_struct *sensor_depth = NULL;
-	double	xx, yy, zz;
-	double	croll, cpitch, cheading;
-	double	headingx, headingy;
-	int	i, j, k;
-		
-        /* reset error */
-        *error = MB_ERROR_NO_ERROR;
-
-	/* get platform structure */
-	platform = (struct mb_platform_struct *) *platform_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:           %d\n", verbose);
-		fprintf(stderr,"dbg2       platform_ptr:		%p\n", platform_ptr);
-		fprintf(stderr,"dbg2       *platform_ptr:		%p\n", *platform_ptr);
-		fprintf(stderr,"dbg2       targetsensor:		%d\n", targetsensor);
-		fprintf(stderr,"dbg2       targetsensoroffset:		%d\n", targetsensoroffset);
-		fprintf(stderr,"dbg2       heading:		        %f\n", heading);
-		fprintf(stderr,"dbg2       roll:		        %f\n", roll);
-		fprintf(stderr,"dbg2       pitch:		        %f\n", pitch);
-		}
-	if (verbose >= 2 && *error == MB_ERROR_NO_ERROR)
-		{
-		fprintf(stderr,"dbg2       *platform_ptr:		     %p\n", *platform_ptr);
-		fprintf(stderr,"dbg2       platform->type:		     %d\n", platform->type);
-		fprintf(stderr,"dbg2       platform->name:		     %s\n", platform->name);
-		fprintf(stderr,"dbg2       platform->organization:	     %s\n", platform->organization);
-		fprintf(stderr,"dbg2       platform->source_swathbathymetry: %d\n", platform->source_swathbathymetry);
-		fprintf(stderr,"dbg2       platform->source_position:	     %d\n", platform->source_position);
-		fprintf(stderr,"dbg2       platform->source_depth:	     %d\n", platform->source_depth);
-		fprintf(stderr,"dbg2       platform->source_heave:	     %d\n", platform->source_heave);
-		fprintf(stderr,"dbg2       platform->source_heading:	     %d\n", platform->source_heading);
-		fprintf(stderr,"dbg2       platform->source_rollpitch:	     %d\n", platform->source_rollpitch);
-		fprintf(stderr,"dbg2       platform->num_sensors:	     %d\n", platform->num_sensors);
-		for (i=0;i<platform->num_sensors;i++)
-			{
-			fprintf(stderr,"dbg2       platform->sensors[%2d].type:                 %d\n", i, platform->sensors[i].type);
-			fprintf(stderr,"dbg2       platform->sensors[%2d].model:                %s\n", i, platform->sensors[i].model);
-			fprintf(stderr,"dbg2       platform->sensors[%2d].manufacturer:         %s\n", i, platform->sensors[i].manufacturer);
-			fprintf(stderr,"dbg2       platform->sensors[%2d].serialnumber:         %s\n", i, platform->sensors[i].serialnumber);
-			fprintf(stderr,"dbg2       platform->sensors[%2d].capability:           %d\n", i, platform->sensors[i].capability);
-			fprintf(stderr,"dbg2       platform->sensors[%2d].special_capability:   %d\n", i, platform->sensors[i].special_capability);
-			fprintf(stderr,"dbg2       platform->sensors[%2d].num_offsets:          %d\n", i, platform->sensors[i].num_offsets);
-			for (j=0;j<platform->sensors[i].num_offsets;j++)
-				{
-				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].time_latency_mode:	%d\n", i, j, platform->sensors[i].offsets[j].time_latency_mode);
-				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].time_latency_static:	%f\n", i, j, platform->sensors[i].offsets[j].time_latency_static);
-				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].num_time_latency:		%d\n", i, j, platform->sensors[i].offsets[j].num_time_latency);
-				for (k=0;k<platform->sensors[i].offsets[j].num_time_latency;k++)
-					{
-					fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].time_latency[%2d]:		%16.6f %8.6f\n", i, j, k,
-						platform->sensors[i].offsets[j].time_latency_time_d[k],platform->sensors[i].offsets[j].time_latency_value[k]);
-					}
-				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].position_offset_mode:	%d\n", i, j, platform->sensors[i].offsets[j].position_offset_mode);
-				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].position_offset_x:	%f\n", i, j, platform->sensors[i].offsets[j].position_offset_x);
-				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].position_offset_y:	%f\n", i, j, platform->sensors[i].offsets[j].position_offset_y);
-				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].position_offset_z:	%f\n", i, j, platform->sensors[i].offsets[j].position_offset_z);
-				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].attitude_offset_mode:	%d\n", i, j, platform->sensors[i].offsets[j].attitude_offset_mode);
-				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].attitude_offset_azimuth:	%f\n", i, j, platform->sensors[i].offsets[j].attitude_offset_azimuth);
-				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].attitude_offset_roll:	%f\n", i, j, platform->sensors[i].offsets[j].attitude_offset_roll);
-				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].attitude_offset_pitch:	%f\n", i, j, platform->sensors[i].offsets[j].attitude_offset_pitch);
-				}
-			}
-		}
-        
-        /* check that all sensor id's are sensible for this platform */
-        if (targetsensor < 0 || targetsensor >= platform->num_sensors
-                || platform->source_swathbathymetry < 0 || platform->source_swathbathymetry >= platform->num_sensors
-                || platform->source_rollpitch < 0 || platform->source_rollpitch >= platform->num_sensors
-                || platform->source_heading < 0 || platform->source_heading >= platform->num_sensors
-                || platform->source_position < 0 || platform->source_position >= platform->num_sensors
-                || platform->source_depth < 0 || platform->source_depth >= platform->num_sensors)
-                {
-                status = MB_FAILURE;
-                *error = MB_ERROR_BAD_PARAMETER;
-                }
-        
-        /* else proceed */
-        else
-                {
-                /* get sensor structures */
-                sensor_target = &platform->sensors[targetsensor];
-                sensor_swathbathymetry = &platform->sensors[platform->source_swathbathymetry];
-                sensor_rollpitch = &platform->sensors[platform->source_rollpitch];
-                sensor_heading = &platform->sensors[platform->source_heading];
-                sensor_position = &platform->sensors[platform->source_position];
-                sensor_depth = &platform->sensors[platform->source_depth];
-                
-                /* start with zero lever */
-                *lever_x = 0.0;
-                *lever_y = 0.0;
-                *lever_z = 0.0;
-                
-                /* apply change in z due to offset between the depth sensor and the target sensor
-			using roll and pitch values corrected for the offsets between the
-			attitude sensor and the target sensor */
-		xx = 0.0;
-		yy = 0.0;
-		zz = 0.0;
-		cheading = heading;
-		croll = roll;
-		cpitch = pitch;
-		if (sensor_target->offsets[targetsensoroffset].position_offset_mode == MB_SENSOR_POSITION_OFFSET_STATIC)
-			{
-			xx += sensor_target->offsets[targetsensoroffset].position_offset_x;
-			yy += sensor_target->offsets[targetsensoroffset].position_offset_y;
-			zz += sensor_target->offsets[targetsensoroffset].position_offset_z;
-			}
-		if (sensor_depth->offsets[0].position_offset_mode == MB_SENSOR_POSITION_OFFSET_STATIC)
-			{
-			xx -= sensor_depth->offsets[0].position_offset_x;
-			yy -= sensor_depth->offsets[0].position_offset_y;
-			zz -= sensor_depth->offsets[0].position_offset_z;
-			}
-		if (sensor_target->offsets[targetsensoroffset].attitude_offset_mode == MB_SENSOR_ATTITUDE_OFFSET_STATIC)
-			{
-			cheading += sensor_target->offsets[targetsensoroffset].attitude_offset_azimuth;
-			croll += sensor_target->offsets[targetsensoroffset].attitude_offset_roll;
-			cpitch += sensor_target->offsets[targetsensoroffset].attitude_offset_pitch;
-			}
-		if (sensor_rollpitch->offsets[0].attitude_offset_mode == MB_SENSOR_ATTITUDE_OFFSET_STATIC)
-			{
-			cheading -= sensor_rollpitch->offsets[0].attitude_offset_azimuth;
-			croll -= sensor_rollpitch->offsets[0].attitude_offset_roll;
-			cpitch -= sensor_rollpitch->offsets[0].attitude_offset_pitch;
-			}
-		*lever_z = sin(DTR * croll) * xx
-				- sin(DTR * cpitch) * yy
-				+ cos(DTR * cpitch) * zz;
-                
-                /* apply change in x and y due to offset between the position sensor and the target sensor
-			using heading corrected for the offset between the heading sensor and the target sensor */
-		xx = 0.0;
-		yy = 0.0;
-		zz = 0.0;
-		cheading = heading;
-		croll = roll;
-		cpitch = pitch;
-		if (sensor_target->offsets[targetsensoroffset].position_offset_mode == MB_SENSOR_POSITION_OFFSET_STATIC)
-			{
-			xx += sensor_target->offsets[targetsensoroffset].position_offset_x;
-			yy += sensor_target->offsets[targetsensoroffset].position_offset_y;
-			zz += sensor_target->offsets[targetsensoroffset].position_offset_z;
-			}
-		if (sensor_position->offsets[0].position_offset_mode == MB_SENSOR_POSITION_OFFSET_STATIC)
-			{
-			xx -= sensor_depth->offsets[0].position_offset_x;
-			yy -= sensor_depth->offsets[0].position_offset_y;
-			zz -= sensor_depth->offsets[0].position_offset_z;
-			}
-		if (sensor_target->offsets[targetsensoroffset].attitude_offset_mode == MB_SENSOR_ATTITUDE_OFFSET_STATIC)
-			{
-			cheading += sensor_target->offsets[targetsensoroffset].attitude_offset_azimuth;
-			croll += sensor_target->offsets[targetsensoroffset].attitude_offset_roll;
-			cpitch += sensor_target->offsets[targetsensoroffset].attitude_offset_pitch;
-			}
-		if (sensor_heading->offsets[0].attitude_offset_mode == MB_SENSOR_ATTITUDE_OFFSET_STATIC)
-			{
-			cheading -= sensor_heading->offsets[0].attitude_offset_azimuth;
-			croll -= sensor_heading->offsets[0].attitude_offset_roll;
-			cpitch -= sensor_heading->offsets[0].attitude_offset_pitch;
-			}
-		headingx = sin(DTR * cheading);
-		headingy = cos(DTR * cheading);	
-		*lever_x = headingy * xx + headingx * yy;
-		*lever_y = -headingx * xx + headingy * yy;
-                }
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       lever_x:		        %f\n", *lever_x);
-		fprintf(stderr,"dbg2       lever_y:		        %f\n", *lever_y);
-		fprintf(stderr,"dbg2       lever_z:		        %f\n", *lever_z);
-		fprintf(stderr,"dbg2       error:			%d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:			%d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_platform_position(int verbose, void **platform_ptr,
-                      int targetsensor, int targetsensoroffset,
-		      double navlon, double navlat, double sensordepth,
-		      double heading, double roll, double pitch,
-		      double *targetlon, double *targetlat, double *targetz,
-                      int *error)
-{
-	char	*function_name = "mb_platform_position";
-	int	status = MB_SUCCESS;
-	struct mb_platform_struct *platform;
-	double	mtodeglon, mtodeglat;
-	double	lever_x, lever_y, lever_z;
-	int	i, j, k;
-		
-	/* get platform structure */
-	platform = (struct mb_platform_struct *) *platform_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:           %d\n", verbose);
-		fprintf(stderr,"dbg2       platform_ptr:		%p\n", platform_ptr);
-		fprintf(stderr,"dbg2       *platform_ptr:		%p\n", *platform_ptr);
-		fprintf(stderr,"dbg2       targetsensor:		%d\n", targetsensor);
-		fprintf(stderr,"dbg2       targetsensoroffset:		%d\n", targetsensoroffset);
-		fprintf(stderr,"dbg2       navlon:		        %f\n", navlon);
-		fprintf(stderr,"dbg2       navlat:		        %f\n", navlat);
-		fprintf(stderr,"dbg2       sensordepth:		        %f\n", sensordepth);
-		fprintf(stderr,"dbg2       heading:		        %f\n", heading);
-		fprintf(stderr,"dbg2       roll:		        %f\n", roll);
-		fprintf(stderr,"dbg2       pitch:		        %f\n", pitch);
-		}
-	if (verbose >= 2 && *error == MB_ERROR_NO_ERROR)
-		{
-		fprintf(stderr,"dbg2       *platform_ptr:		     %p\n", *platform_ptr);
-		fprintf(stderr,"dbg2       platform->type:		     %d\n", platform->type);
-		fprintf(stderr,"dbg2       platform->name:		     %s\n", platform->name);
-		fprintf(stderr,"dbg2       platform->organization:	     %s\n", platform->organization);
-		fprintf(stderr,"dbg2       platform->source_swathbathymetry: %d\n", platform->source_swathbathymetry);
-		fprintf(stderr,"dbg2       platform->source_position:	     %d\n", platform->source_position);
-		fprintf(stderr,"dbg2       platform->source_depth:	     %d\n", platform->source_depth);
-		fprintf(stderr,"dbg2       platform->source_heave:	     %d\n", platform->source_heave);
-		fprintf(stderr,"dbg2       platform->source_heading:	     %d\n", platform->source_heading);
-		fprintf(stderr,"dbg2       platform->source_rollpitch:	     %d\n", platform->source_rollpitch);
-		fprintf(stderr,"dbg2       platform->num_sensors:	     %d\n", platform->num_sensors);
-		for (i=0;i<platform->num_sensors;i++)
-			{
-			fprintf(stderr,"dbg2       platform->sensors[%2d].type:                 %d\n", i, platform->sensors[i].type);
-			fprintf(stderr,"dbg2       platform->sensors[%2d].model:                %s\n", i, platform->sensors[i].model);
-			fprintf(stderr,"dbg2       platform->sensors[%2d].manufacturer:         %s\n", i, platform->sensors[i].manufacturer);
-			fprintf(stderr,"dbg2       platform->sensors[%2d].serialnumber:         %s\n", i, platform->sensors[i].serialnumber);
-			fprintf(stderr,"dbg2       platform->sensors[%2d].capability:           %d\n", i, platform->sensors[i].capability);
-			fprintf(stderr,"dbg2       platform->sensors[%2d].special_capability:   %d\n", i, platform->sensors[i].special_capability);
-			fprintf(stderr,"dbg2       platform->sensors[%2d].num_offsets:          %d\n", i, platform->sensors[i].num_offsets);
-			for (j=0;j<platform->sensors[i].num_offsets;j++)
-				{
-				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].time_latency_mode:	%d\n", i, j, platform->sensors[i].offsets[j].time_latency_mode);
-				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].time_latency_static:	%f\n", i, j, platform->sensors[i].offsets[j].time_latency_static);
-				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].num_time_latency:		%d\n", i, j, platform->sensors[i].offsets[j].num_time_latency);
-				for (k=0;k<platform->sensors[i].offsets[j].num_time_latency;k++)
-					{
-					fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].time_latency[%2d]:		%16.6f %8.6f\n", i, j, k,
-						platform->sensors[i].offsets[j].time_latency_time_d[k],platform->sensors[i].offsets[j].time_latency_value[k]);
-					}
-				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].position_offset_mode:	%d\n", i, j, platform->sensors[i].offsets[j].position_offset_mode);
-				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].position_offset_x:	%f\n", i, j, platform->sensors[i].offsets[j].position_offset_x);
-				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].position_offset_y:	%f\n", i, j, platform->sensors[i].offsets[j].position_offset_y);
-				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].position_offset_z:	%f\n", i, j, platform->sensors[i].offsets[j].position_offset_z);
-				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].attitude_offset_mode:	%d\n", i, j, platform->sensors[i].offsets[j].attitude_offset_mode);
-				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].attitude_offset_azimuth:	%f\n", i, j, platform->sensors[i].offsets[j].attitude_offset_azimuth);
-				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].attitude_offset_roll:	%f\n", i, j, platform->sensors[i].offsets[j].attitude_offset_roll);
-				fprintf(stderr,"dbg2       platform->sensors[%2d].offsets[%d].attitude_offset_pitch:	%f\n", i, j, platform->sensors[i].offsets[j].attitude_offset_pitch);
-				}
-			}
-		}
-
-	/* call mb_platform lever to get relative lever offsets */
-	status = mb_platform_lever(verbose, platform_ptr,
-                      targetsensor, targetsensoroffset,
-		      heading, roll, pitch,
-		      &lever_x, &lever_y, &lever_z,
-                      error);
-	
-	/* get local translation between lon lat degrees and meters */
-	mb_coor_scale(verbose,navlat,&mtodeglon,&mtodeglat);
-	
-	/* calculate absolute position and depth for target sensor */
-	*targetlon = navlon + lever_x * mtodeglon;
-	*targetlat = navlat + lever_y * mtodeglat;
-	*targetz = sensordepth + lever_z;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",svn_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       targetlon:		        %f\n", *targetlon);
-		fprintf(stderr,"dbg2       targetlat:		        %f\n", *targetlat);
-		fprintf(stderr,"dbg2       targetz:		        %f\n", *targetz);
-		fprintf(stderr,"dbg2       error:			%d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:			%d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mb_process.c b/src/mbio/mb_process.c
deleted file mode 100644
index f375bba..0000000
--- a/src/mbio/mb_process.c
+++ /dev/null
@@ -1,6071 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mb_process.c	9/11/00
- *    $Id: mb_process.c 2241 2015-05-12 21:00:35Z caress $
- *
- *    Copyright (c) 2000-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mb_process.c contains functions for reading and writing
- * mbprocess parameter files. The mb_process structure is defined
- * in mb_process.h. A description of mbprocess parameters and
- * parameter file keywords is found in mb_process.h
- *
- * Author:	D. W. Caress
- * Date:	September 11, 2000
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <string.h>
-#include <time.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-
-/* mbio include files */
-#include "mb_io.h"
-#include "mb_status.h"
-#include "mb_define.h"
-#include "mb_format.h"
-#include "mb_process.h"
-
-static char rcs_id[]="$Id: mb_process.c 2241 2015-05-12 21:00:35Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mb_pr_checkstatus(int verbose, char *file,
-			int *prstatus, int *error)
-{
-	char	*function_name = "mb_pr_checkstatus";
-	int	status = MB_SUCCESS;
-	int	ifilemodtime = 0;
-	int	ofilemodtime = 0;
-	int	pfilemodtime = 0;
-	int	navfilemodtime = 0;
-	int	navadjfilemodtime = 0;
-	int	attitudefilemodtime = 0;
-	int	sonardepthfilemodtime = 0;
-	int	esfmodtime = 0;
-	int	svpmodtime = 0;
-	struct stat file_status;
-	int	fstat;
-	struct mb_process_struct process;
-	mb_path	mbp_pfile;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:   %d\n",verbose);
-		fprintf(stderr,"dbg2       file:      %s\n",file);
-		}
-
-	/* get started */
-	*prstatus = MB_PR_FILE_NEEDS_PROCESSING;
-	*error = MB_ERROR_NO_ERROR;
-
-	/* get existence and get mod time for the input file */
-	fstat = stat(file, &file_status);
-	if ((fstat = stat(file, &file_status)) == 0
-		&& (file_status.st_mode & S_IFMT) != S_IFDIR)
-		{
- 		ifilemodtime = file_status.st_mtime;
-		}
-	else
-		{
-		*prstatus = MB_PR_FILE_NOT_EXIST;
-		}
-
-	/* check for existing parameter file */
-	if (*prstatus == MB_PR_FILE_NEEDS_PROCESSING)
-		{
-		sprintf(mbp_pfile, "%s.par", file);
-	        if ((fstat = stat(mbp_pfile, &file_status)) == 0
-			&& (file_status.st_mode & S_IFMT) != S_IFDIR)
-			{
-			pfilemodtime = file_status.st_mtime;
-			}
-		else
-			{
-	    		*prstatus = MB_PR_NO_PARAMETER_FILE;
-			}
-		}
-
-	/* if input and parameter files found check output and dependencies */
-	if (*prstatus == MB_PR_FILE_NEEDS_PROCESSING)
-		{
-		/* read the parameter file */
-		mb_pr_readpar(verbose, file, MB_NO, &process, error);
-
-		/* get mod time for the output file */
-		if ((fstat = stat(process.mbp_ofile, &file_status)) == 0
-			&& (file_status.st_mode & S_IFMT) != S_IFDIR)
-			ofilemodtime = file_status.st_mtime;
-		else
-			ofilemodtime = 0;
-
-		/* get mod time for the navigation file if needed */
-		if (process.mbp_nav_mode != MBP_NAV_OFF
-			&& (fstat = stat(process.mbp_navfile, &file_status)) == 0
-			&& (file_status.st_mode & S_IFMT) != S_IFDIR)
-			navfilemodtime = file_status.st_mtime;
-		else
-			navfilemodtime = 0;
-
-		/* get mod time for the navigation adjustment file if needed */
-		if (process.mbp_navadj_mode != MBP_NAVADJ_OFF
-			&& (fstat = stat(process.mbp_navadjfile, &file_status)) == 0
-			&& (file_status.st_mode & S_IFMT) != S_IFDIR)
-			navadjfilemodtime = file_status.st_mtime;
-		else
-			navadjfilemodtime = 0;
-
-		/* get mod time for the attitude file if needed */
-		if (process.mbp_attitude_mode != MBP_ATTITUDE_OFF
-			&& (fstat = stat(process.mbp_attitudefile, &file_status)) == 0
-			&& (file_status.st_mode & S_IFMT) != S_IFDIR)
-			attitudefilemodtime = file_status.st_mtime;
-		else
-			attitudefilemodtime = 0;
-
-		/* get mod time for the sonardepth file if needed */
-		if (process.mbp_sonardepth_mode != MBP_SONARDEPTH_OFF
-			&& (fstat = stat(process.mbp_sonardepthfile, &file_status)) == 0
-			&& (file_status.st_mode & S_IFMT) != S_IFDIR)
-			sonardepthfilemodtime = file_status.st_mtime;
-		else
-			sonardepthfilemodtime = 0;
-
-		/* get mod time for the edit save file if needed */
-		if (process.mbp_edit_mode != MBP_EDIT_OFF
-			&& (fstat = stat(process.mbp_editfile, &file_status)) == 0
-			&& (file_status.st_mode & S_IFMT) != S_IFDIR)
-			esfmodtime = file_status.st_mtime;
-		else
-			esfmodtime = 0;
-
-		/* get mod time for the svp file if needed */
-		if (process.mbp_svp_mode != MBP_SVP_OFF
-			&& (fstat = stat(process.mbp_svpfile, &file_status)) == 0
-			&& (file_status.st_mode & S_IFMT) != S_IFDIR)
-			svpmodtime = file_status.st_mtime;
-		else
-			svpmodtime = 0;
-
-		/* now check if processed file is out of date */
-		if (ofilemodtime > 0
-			&& ofilemodtime >= ifilemodtime
-			&& ofilemodtime >= pfilemodtime
-			&& ofilemodtime >= navfilemodtime
-			&& ofilemodtime >= navadjfilemodtime
-			&& ofilemodtime >= attitudefilemodtime
-			&& ofilemodtime >= sonardepthfilemodtime
-			&& ofilemodtime >= esfmodtime
-			&& ofilemodtime >= svpmodtime)
-		    {
-		    *prstatus = MB_PR_FILE_UP_TO_DATE;
-		    }
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       prstatus:   %d\n",*prstatus);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_pr_readpar(int verbose, char *file, int lookforfiles,
-			struct mb_process_struct *process,
-			int *error)
-{
-	char	*function_name = "mb_pr_readpar";
-	char	parfile[MBP_FILENAMESIZE];
-	char	buffer[MBP_FILENAMESIZE], dummy[MBP_FILENAMESIZE], *result;
-	char	*lastslash;
-	FILE	*fp;
-	struct	stat statbuf;
-	int	status = MB_SUCCESS;
-	int	len;
-	int	explicit;
-	char	*bufptr;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:      %d\n",verbose);
-		fprintf(stderr,"dbg2       file:         %s\n",file);
-		fprintf(stderr,"dbg2       lookforfiles: %d\n",lookforfiles);
-		fprintf(stderr,"dbg2       process:      %p\n",(void *)process);
-		}
-
-	/* get expected process parameter file name */
-	strcpy(parfile, file);
-	strcat(parfile, ".par");
-
-	/* initialize process parameter structure */
-
-	/* general parameters */
-	explicit = MB_NO;
-	process->mbp_ifile_specified = MB_NO;
-	process->mbp_ifile[0] = '\0';
-	process->mbp_ofile_specified = MB_NO;
-	process->mbp_ofile[0] = '\0';
-	process->mbp_format_specified = MB_NO;
-	process->mbp_format = 0;
-
-	/* navigation merging */
-	process->mbp_nav_mode = MBP_NAV_OFF;
-	process->mbp_navfile[0] = '\0';
-	process->mbp_nav_format = 0;
-	process->mbp_nav_heading = MBP_NAV_OFF;
-	process->mbp_nav_speed = MBP_NAV_OFF;
-	process->mbp_nav_draft = MBP_NAV_OFF;
-	process->mbp_nav_attitude = MBP_NAV_OFF;
-	process->mbp_nav_algorithm = MBP_NAV_LINEAR;
-	process->mbp_nav_timeshift = 0.0;
-	process->mbp_nav_shift = MBP_NAV_OFF;
-	process->mbp_nav_offsetx = 0.0;
-	process->mbp_nav_offsety = 0.0;
-	process->mbp_nav_offsetz = 0.0;
-	process->mbp_nav_shiftlon = 0.0;
-	process->mbp_nav_shiftlat = 0.0;
-
-	/* adjusted navigation merging */
-	process->mbp_navadj_mode = MBP_NAV_OFF;
-	process->mbp_navadjfile[0] = '\0';
-	process->mbp_navadj_algorithm = MBP_NAV_LINEAR;
-
-	/* attitude merging */
-	process->mbp_attitude_mode = 0;
-	process->mbp_attitudefile[0] = '\0';
-	process->mbp_attitude_format = 1;
-
-	/* sonardepth merging */
-	process->mbp_sonardepth_mode = 0;
-	process->mbp_sonardepthfile[0] = '\0';
-	process->mbp_sonardepth_format = 1;
-
-	/* data cutting */
-	process->mbp_cut_num = 0;
-	for (i=0;i<MBP_CUT_NUM_MAX;i++)
-		{
-		process->mbp_cut_kind[i] = MBP_CUT_DATA_BATH;
-		process->mbp_cut_mode[i] = MBP_CUT_MODE_NONE;
-		process->mbp_cut_min[i] = 0.0;
-		process->mbp_cut_max[i] = 0.0;
-		}
-
-	/* bathymetry editing */
-	process->mbp_edit_mode = MBP_EDIT_OFF;
-	process->mbp_editfile[0] = '\0';
-
-	/* bathymetry recalculation */
-	process->mbp_bathrecalc_mode = MBP_BATHRECALC_OFF;
-	process->mbp_svp_mode = MBP_SVP_OFF;
-	process->mbp_svpfile[0] = '\0';
-	process->mbp_ssv_mode = MBP_SSV_OFF;
-	process->mbp_ssv = 0.0;
-	process->mbp_tt_mode = MBP_TT_OFF;
-	process->mbp_tt_mult = 1.0;
-	process->mbp_angle_mode = MBP_ANGLES_SNELL;
-	process->mbp_corrected = MB_YES;
-	process->mbp_static_mode = MBP_STATIC_OFF;
-	process->mbp_staticfile[0] = '\0';
-
-	/* draft correction */
-	process->mbp_draft_mode = MBP_DRAFT_OFF;
-	process->mbp_draft = 0.0;
-	process->mbp_draft_offset = 0.0;
-	process->mbp_draft_mult = 1.0;
-
-	/* heave correction */
-	process->mbp_heave_mode = MBP_HEAVE_OFF;
-	process->mbp_heave = 0.0;
-	process->mbp_heave_mult = 1.0;
-
-	/* lever correction */
-	process->mbp_lever_mode = MBP_LEVER_OFF;
-	process->mbp_vru_offsetx = 0.0;
-	process->mbp_vru_offsety = 0.0;
-	process->mbp_vru_offsetz = 0.0;
-	process->mbp_sonar_offsetx = 0.0;
-	process->mbp_sonar_offsety = 0.0;
-	process->mbp_sonar_offsetz = 0.0;
-
-	/* roll correction */
-	process->mbp_rollbias_mode = MBP_ROLLBIAS_OFF;
-	process->mbp_rollbias = 0.0;
-	process->mbp_rollbias_port = 0.0;
-	process->mbp_rollbias_stbd = 0.0;
-
-	/* pitch correction */
-	process->mbp_pitchbias_mode = MBP_PITCHBIAS_OFF;
-	process->mbp_pitchbias = 0.0;
-
-	/* heading correction */
-	process->mbp_heading_mode = MBP_HEADING_OFF;
-	process->mbp_headingbias = 0.0;
-
-	/* tide correction */
-	process->mbp_tide_mode = MBP_TIDE_OFF;
-	process->mbp_tidefile[0] = '\0';
-	process->mbp_tide_format = 1;
-
-	/* amplitude correction */
-	process->mbp_ampcorr_mode = MBP_AMPCORR_OFF;
-	process->mbp_ampcorrfile[0] = '\0';
-	process->mbp_ampcorr_type = MBP_AMPCORR_SUBTRACTION;
-	process->mbp_ampcorr_symmetry = MBP_AMPCORR_SYMMETRIC,
-	process->mbp_ampcorr_angle = 30.0;
-	process->mbp_ampcorr_slope = MBP_AMPCORR_IGNORESLOPE;
-
-	/* sidescan correction */
-	process->mbp_sscorr_mode = MBP_SSCORR_OFF;
-	process->mbp_sscorrfile[0] = '\0';
-	process->mbp_sscorr_type = MBP_SSCORR_SUBTRACTION;
-	process->mbp_sscorr_symmetry = MBP_SSCORR_SYMMETRIC,
-	process->mbp_sscorr_angle = 30.0;
-	process->mbp_sscorr_slope = MBP_SSCORR_IGNORESLOPE;
-
-	/* amplitude and sidescan correction */
-	process->mbp_ampsscorr_topofile[0] = '\0';
-
-	/* sidescan recalculation */
-	process->mbp_ssrecalc_mode = MBP_SSRECALC_OFF;
-	process->mbp_ssrecalc_pixelsize = 0.0;
-	process->mbp_ssrecalc_swathwidth = 0.0;
-	process->mbp_ssrecalc_interpolate = 0;
-
-	/* metadata insertion */
-	process->mbp_meta_vessel[0] = '\0';
-	process->mbp_meta_institution[0] = '\0';
-	process->mbp_meta_platform[0] = '\0';
-	process->mbp_meta_sonar[0] = '\0';
-	process->mbp_meta_sonarversion[0] = '\0';
-	process->mbp_meta_cruiseid[0] = '\0';
-	process->mbp_meta_cruisename[0] = '\0';
-	process->mbp_meta_pi[0] = '\0';
-	process->mbp_meta_piinstitution[0] = '\0';
-	process->mbp_meta_client[0] = '\0';
-	process->mbp_meta_svcorrected = MBP_CORRECTION_UNKNOWN;
-	process->mbp_meta_tidecorrected = MBP_CORRECTION_UNKNOWN;
-	process->mbp_meta_batheditmanual = MBP_CORRECTION_UNKNOWN;
-	process->mbp_meta_batheditauto = MBP_CORRECTION_UNKNOWN;
-	process->mbp_meta_rollbias = MBP_METANOVALUE + 1.;
-	process->mbp_meta_pitchbias = MBP_METANOVALUE + 1.;
-	process->mbp_meta_headingbias = MBP_METANOVALUE + 1.;
-	process->mbp_meta_draft = MBP_METANOVALUE + 1.;
-
-	/* processing kluges */
-	process->mbp_kluge001 = MB_NO;
-	process->mbp_kluge002 = MB_NO;
-	process->mbp_kluge003 = MB_NO;
-	process->mbp_kluge004 = MB_NO;
-	process->mbp_kluge005 = MB_NO;
-	process->mbp_kluge006 = MB_NO;
-	process->mbp_kluge007 = MB_NO;
-	process->mbp_kluge008 = MB_NO;
-	process->mbp_kluge009 = MB_NO;
-	process->mbp_kluge010 = MB_NO;
-
-	/* open and read parameter file */
-	if ((fp = fopen(parfile, "r")) != NULL)
-	    {
-	    while ((result = fgets(buffer,MBP_FILENAMESIZE,fp)) == buffer)
-		{
-		if (buffer[0] != '#')
-		    {
-		    len = strlen(buffer);
-		    if (len > 0)
-			{
-			if (buffer[len-1] == '\n')
-			    buffer[len-1] = '\0';
-			if (buffer[len-2] == '\r')
-			    buffer[len-2] = '\0';
-			}
-
-		    /* general parameters */
-		    if (strncmp(buffer, "EXPLICIT", 8) == 0)
-			{
-			explicit = MB_YES;
-			}
-		    else if (strncmp(buffer, "INFILE", 6) == 0
-			&& process->mbp_ifile_specified == MB_NO)
-			{
-			sscanf(buffer, "%s %s", dummy, process->mbp_ifile);
-			process->mbp_ifile_specified = MB_YES;
-			}
-		    else if (strncmp(buffer, "OUTFILE", 7) == 0
-			&& process->mbp_ofile_specified == MB_NO)
-			{
-			sscanf(buffer, "%s %s", dummy, process->mbp_ofile);
-			process->mbp_ofile_specified = MB_YES;
-			}
-		    else if (strncmp(buffer, "FORMAT", 6) == 0
-			&& process->mbp_format_specified == MB_NO)
-			{
-			sscanf(buffer, "%s %d", dummy, &process->mbp_format);
-			process->mbp_format_specified = MB_YES;
-			}
-
-		    /* navigation merging */
-		    else if (strncmp(buffer, "NAVMODE", 7) == 0)
-			{
-			sscanf(buffer, "%s %d", dummy, &process->mbp_nav_mode);
-			}
-		    else if (strncmp(buffer, "NAVFILE", 7) == 0)
-			{
-			sscanf(buffer, "%s %s", dummy, process->mbp_navfile);
-			if (explicit == MB_NO)
-			    {
-			    process->mbp_nav_mode = MBP_NAV_ON;
-			    process->mbp_nav_heading = MBP_NAV_ON;
-			    process->mbp_nav_speed = MBP_NAV_ON;
-			    process->mbp_nav_draft = MBP_NAV_ON;
-			    process->mbp_nav_attitude = MBP_NAV_ON;
-			    }
-			}
-		    else if (strncmp(buffer, "NAVFORMAT", 9) == 0)
-			{
-			sscanf(buffer, "%s %d", dummy, &process->mbp_nav_format);
-			}
-		    else if (strncmp(buffer, "NAVHEADING", 10) == 0)
-			{
-			sscanf(buffer, "%s %d", dummy, &process->mbp_nav_heading);
-			}
-		    else if (strncmp(buffer, "NAVSPEED", 8) == 0)
-			{
-			sscanf(buffer, "%s %d", dummy, &process->mbp_nav_speed);
-			}
-		    else if (strncmp(buffer, "NAVDRAFT", 8) == 0)
-			{
-			sscanf(buffer, "%s %d", dummy, &process->mbp_nav_draft);
-			}
-		    else if (strncmp(buffer, "NAVATTITUDE", 8) == 0)
-			{
-			sscanf(buffer, "%s %d", dummy, &process->mbp_nav_attitude);
-			}
-		    else if (strncmp(buffer, "NAVINTERP", 9) == 0)
-			{
-			sscanf(buffer, "%s %d", dummy, &process->mbp_nav_algorithm);
-			}
-		    else if (strncmp(buffer, "NAVTIMESHIFT", 12) == 0)
-			{
-			sscanf(buffer, "%s %lf", dummy, &process->mbp_nav_timeshift);
-			}
-
-		    /* navigation offsets and shifts */
-		    else if (strncmp(buffer, "NAVOFFSETX", 10) == 0)
-			{
-			sscanf(buffer, "%s %lf", dummy, &process->mbp_nav_offsetx);
-			}
-		    else if (strncmp(buffer, "NAVOFFSETY", 10) == 0)
-			{
-			sscanf(buffer, "%s %lf", dummy, &process->mbp_nav_offsety);
-			}
-		    else if (strncmp(buffer, "NAVOFFSETZ", 10) == 0)
-			{
-			sscanf(buffer, "%s %lf", dummy, &process->mbp_nav_offsetz);
-			}
-		    else if (strncmp(buffer, "NAVSHIFTLON", 11) == 0)
-			{
-			sscanf(buffer, "%s %lf", dummy, &process->mbp_nav_shiftlon);
-			}
-		    else if (strncmp(buffer, "NAVSHIFTLAT", 11) == 0)
-			{
-			sscanf(buffer, "%s %lf", dummy, &process->mbp_nav_shiftlat);
-			}
-		    else if (strncmp(buffer, "NAVSHIFT", 8) == 0)
-			{
-			sscanf(buffer, "%s %d", dummy, &process->mbp_nav_shift);
-			}
-
-		    /* adjusted navigation merging */
-		    else if (strncmp(buffer, "NAVADJMODE", 10) == 0)
-			{
-			sscanf(buffer, "%s %d", dummy, &process->mbp_navadj_mode);
-			}
-		    else if (strncmp(buffer, "NAVADJFILE", 10) == 0)
-			{
-			sscanf(buffer, "%s %s", dummy, process->mbp_navadjfile);
-			if (explicit == MB_NO)
-			    {
-			    process->mbp_navadj_mode = MBP_NAV_ON;
-			    }
-			}
-		    else if (strncmp(buffer, "NAVADJINTERP", 12) == 0)
-			{
-			sscanf(buffer, "%s %d", dummy, &process->mbp_navadj_algorithm);
-			}
-
-		    /* attitude merging */
-		    else if (strncmp(buffer, "ATTITUDEMODE", 12) == 0)
-			{
-			sscanf(buffer, "%s %d", dummy, &process->mbp_attitude_mode);
-			}
-		    else if (strncmp(buffer, "ATTITUDEFILE", 12) == 0)
-			{
-			sscanf(buffer, "%s %s", dummy, process->mbp_attitudefile);
-			if (explicit == MB_NO)
-			    {
-			    process->mbp_attitude_mode = MBP_ATTITUDE_ON;
-			    }
-			}
-		    else if (strncmp(buffer, "ATTITUDEFORMAT", 14) == 0)
-			{
-			sscanf(buffer, "%s %d", dummy, &process->mbp_attitude_format);
-			}
-
-		    /* sonardepth merging */
-		    else if (strncmp(buffer, "SONARDEPTHMODE", 12) == 0)
-			{
-			sscanf(buffer, "%s %d", dummy, &process->mbp_sonardepth_mode);
-			}
-		    else if (strncmp(buffer, "SONARDEPTHFILE", 12) == 0)
-			{
-			sscanf(buffer, "%s %s", dummy, process->mbp_sonardepthfile);
-			if (explicit == MB_NO)
-			    {
-			    process->mbp_sonardepth_mode = MBP_SONARDEPTH_ON;
-			    }
-			}
-		    else if (strncmp(buffer, "SONARDEPTHFORMAT", 14) == 0)
-			{
-			sscanf(buffer, "%s %d", dummy, &process->mbp_sonardepth_format);
-			}
-
-		    /* data cutting */
-		    else if (strncmp(buffer, "DATACUTCLEAR", 12) == 0)
-			{
-			process->mbp_cut_num = 0;
-			}
-		    else if (strncmp(buffer, "DATACUT", 7) == 0)
-			{
-			if (process->mbp_cut_num < MBP_CUT_NUM_MAX)
-				{
-				sscanf(buffer, "%s %d %d %lf %lf", dummy,
-					&process->mbp_cut_kind[process->mbp_cut_num],
-					&process->mbp_cut_mode[process->mbp_cut_num],
-					&process->mbp_cut_min[process->mbp_cut_num],
-					&process->mbp_cut_max[process->mbp_cut_num]);
-				process->mbp_cut_num++;
-				}
-			}
-		    else if (strncmp(buffer, "BATHCUTNUMBER", 13) == 0)
-			{
-			if (process->mbp_cut_num < MBP_CUT_NUM_MAX)
-				{
-				sscanf(buffer, "%s %lf %lf", dummy,
-					&process->mbp_cut_min[process->mbp_cut_num],
-					&process->mbp_cut_max[process->mbp_cut_num]);
-				process->mbp_cut_kind[process->mbp_cut_num] = MBP_CUT_DATA_BATH;
-				process->mbp_cut_mode[process->mbp_cut_num] = MBP_CUT_MODE_NUMBER;
-				process->mbp_cut_num++;
-				}
-			}
-		    else if (strncmp(buffer, "BATHCUTDISTANCE", 15) == 0)
-			{
-			if (process->mbp_cut_num < MBP_CUT_NUM_MAX)
-				{
-				sscanf(buffer, "%s %lf %lf", dummy,
-					&process->mbp_cut_min[process->mbp_cut_num],
-					&process->mbp_cut_max[process->mbp_cut_num]);
-				process->mbp_cut_kind[process->mbp_cut_num] = MBP_CUT_DATA_BATH;
-				process->mbp_cut_mode[process->mbp_cut_num] = MBP_CUT_MODE_DISTANCE;
-				process->mbp_cut_num++;
-				}
-			}
-		    else if (strncmp(buffer, "BATHCUTSPEED", 12) == 0)
-			{
-			if (process->mbp_cut_num < MBP_CUT_NUM_MAX)
-				{
-				sscanf(buffer, "%s %lf %lf", dummy,
-					&process->mbp_cut_min[process->mbp_cut_num],
-					&process->mbp_cut_max[process->mbp_cut_num]);
-				process->mbp_cut_kind[process->mbp_cut_num] = MBP_CUT_DATA_BATH;
-				process->mbp_cut_mode[process->mbp_cut_num] = MBP_CUT_MODE_SPEED;
-				process->mbp_cut_num++;
-				}
-			}
-		    else if (strncmp(buffer, "AMPCUTNUMBER", 12) == 0)
-			{
-			if (process->mbp_cut_num < MBP_CUT_NUM_MAX)
-				{
-				sscanf(buffer, "%s %lf %lf", dummy,
-					&process->mbp_cut_min[process->mbp_cut_num],
-					&process->mbp_cut_max[process->mbp_cut_num]);
-				process->mbp_cut_kind[process->mbp_cut_num] = MBP_CUT_DATA_AMP;
-				process->mbp_cut_mode[process->mbp_cut_num] = MBP_CUT_MODE_NUMBER;
-				process->mbp_cut_num++;
-				}
-			}
-		    else if (strncmp(buffer, "AMPCUTDISTANCE", 14) == 0)
-			{
-			if (process->mbp_cut_num < MBP_CUT_NUM_MAX)
-				{
-				sscanf(buffer, "%s %lf %lf", dummy,
-					&process->mbp_cut_min[process->mbp_cut_num],
-					&process->mbp_cut_max[process->mbp_cut_num]);
-				process->mbp_cut_kind[process->mbp_cut_num] = MBP_CUT_DATA_AMP;
-				process->mbp_cut_mode[process->mbp_cut_num] = MBP_CUT_MODE_DISTANCE;
-				process->mbp_cut_num++;
-				}
-			}
-		    else if (strncmp(buffer, "AMPCUTSPEED", 11) == 0)
-			{
-			if (process->mbp_cut_num < MBP_CUT_NUM_MAX)
-				{
-				sscanf(buffer, "%s %lf %lf", dummy,
-					&process->mbp_cut_min[process->mbp_cut_num],
-					&process->mbp_cut_max[process->mbp_cut_num]);
-				process->mbp_cut_kind[process->mbp_cut_num] = MBP_CUT_DATA_AMP;
-				process->mbp_cut_mode[process->mbp_cut_num] = MBP_CUT_MODE_SPEED;
-				process->mbp_cut_num++;
-				}
-			}
-		    else if (strncmp(buffer, "SSCUTNUMBER", 12) == 0)
-			{
-			if (process->mbp_cut_num < MBP_CUT_NUM_MAX)
-				{
-				sscanf(buffer, "%s %lf %lf", dummy,
-					&process->mbp_cut_min[process->mbp_cut_num],
-					&process->mbp_cut_max[process->mbp_cut_num]);
-				process->mbp_cut_kind[process->mbp_cut_num] = MBP_CUT_DATA_SS;
-				process->mbp_cut_mode[process->mbp_cut_num] = MBP_CUT_MODE_NUMBER;
-				process->mbp_cut_num++;
-				}
-			}
-		    else if (strncmp(buffer, "SSCUTDISTANCE", 14) == 0)
-			{
-			if (process->mbp_cut_num < MBP_CUT_NUM_MAX)
-				{
-				sscanf(buffer, "%s %lf %lf", dummy,
-					&process->mbp_cut_min[process->mbp_cut_num],
-					&process->mbp_cut_max[process->mbp_cut_num]);
-				process->mbp_cut_kind[process->mbp_cut_num] = MBP_CUT_DATA_SS;
-				process->mbp_cut_mode[process->mbp_cut_num] = MBP_CUT_MODE_DISTANCE;
-				process->mbp_cut_num++;
-				}
-			}
-		    else if (strncmp(buffer, "SSCUTSPEED", 10) == 0)
-			{
-			if (process->mbp_cut_num < MBP_CUT_NUM_MAX)
-				{
-				sscanf(buffer, "%s %lf %lf", dummy,
-					&process->mbp_cut_min[process->mbp_cut_num],
-					&process->mbp_cut_max[process->mbp_cut_num]);
-				process->mbp_cut_kind[process->mbp_cut_num] = MBP_CUT_DATA_SS;
-				process->mbp_cut_mode[process->mbp_cut_num] = MBP_CUT_MODE_SPEED;
-				process->mbp_cut_num++;
-				}
-			}
-
-		    /* bathymetry editing */
-		    else if (strncmp(buffer, "EDITSAVEMODE", 12) == 0)
-			{
-			sscanf(buffer, "%s %d", dummy, &process->mbp_edit_mode);
-			}
-		    else if (strncmp(buffer, "EDITSAVEFILE", 12) == 0)
-			{
-			sscanf(buffer, "%s %s", dummy, process->mbp_editfile);
-			if (explicit == MB_NO)
-			    {
-			    process->mbp_edit_mode = MBP_EDIT_ON;
-			    }
-			}
-
-		    /* bathymetry recalculation */
-		    else if (strncmp(buffer, "RAYTRACE", 8) == 0)
-			{
-			sscanf(buffer, "%s %d", dummy, &process->mbp_svp_mode);
-			}
-		    else if (strncmp(buffer, "SVPMODE", 7) == 0)
-			{
-			sscanf(buffer, "%s %d", dummy, &process->mbp_svp_mode);
-			}
-		    else if (strncmp(buffer, "SVPFILE", 7) == 0)
-			{
-			sscanf(buffer, "%s %s", dummy, process->mbp_svpfile);
-			if (explicit == MB_NO)
-			    {
-			    process->mbp_svp_mode = MBP_SVP_ON;
-			    }
-			}
-		    else if (strncmp(buffer, "SVP", 3) == 0)
-			{
-			sscanf(buffer, "%s %s", dummy, process->mbp_svpfile);
-			if (explicit == MB_NO)
-			    {
-			    process->mbp_svp_mode = MBP_SVP_ON;
-			    }
-			}
-		    else if (strncmp(buffer, "SSVMODE", 7) == 0)
-			{
-			sscanf(buffer, "%s %d", dummy, &process->mbp_ssv_mode);
-			}
-		    else if (strncmp(buffer, "SSV", 3) == 0)
-			{
-			sscanf(buffer, "%s %lf", dummy, &process->mbp_ssv);
-			}
-		    else if (strncmp(buffer, "TTMODE", 6) == 0)
-			{
-			sscanf(buffer, "%s %d", dummy, &process->mbp_tt_mode);
-			}
-		    else if (strncmp(buffer, "TTMULTIPLY", 10) == 0)
-			{
-			sscanf(buffer, "%s %lf", dummy, &process->mbp_tt_mult);
-			}
-		    else if (strncmp(buffer, "ANGLEMODE", 9) == 0)
-			{
-			sscanf(buffer, "%s %d", dummy, &process->mbp_angle_mode);
-			}
-		    else if (strncmp(buffer, "CORRECTED", 9) == 0)
-			{
-			sscanf(buffer, "%s %d", dummy, &process->mbp_corrected);
-			}
-		    else if (strncmp(buffer, "SOUNDSPEEDREF", 13) == 0)
-			{
-			sscanf(buffer, "%s %d", dummy, &process->mbp_corrected);
-			}
-
-		    /* static beam bathymetry correction */
-		    else if (strncmp(buffer, "STATICMODE", 10) == 0)
-			{
-			sscanf(buffer, "%s %d", dummy, &process->mbp_static_mode);
-			}
-		    else if (strncmp(buffer, "STATICFILE", 10) == 0)
-			{
-			sscanf(buffer, "%s %s", dummy, process->mbp_staticfile);
-			if (explicit == MB_NO)
-			    {
-			    process->mbp_static_mode = MBP_SVP_ON;
-			    }
-			}
-
-		    /* draft correction */
-		    else if (strncmp(buffer, "DRAFTMODE", 9) == 0)
-			{
-			sscanf(buffer, "%s %d", dummy, &process->mbp_draft_mode);
-			}
-		    else if (strncmp(buffer, "DRAFTOFFSET", 11) == 0)
-			{
-			sscanf(buffer, "%s %lf", dummy, &process->mbp_draft_offset);
-			}
-		    else if (strncmp(buffer, "DRAFTMULTIPLY", 13) == 0)
-			{
-			sscanf(buffer, "%s %lf", dummy, &process->mbp_draft_mult);
-			}
-		    else if (strncmp(buffer, "DRAFT", 5) == 0)
-			{
-			sscanf(buffer, "%s %lf", dummy, &process->mbp_draft);
-			}
-
-		    /* heave correction */
-		    else if (strncmp(buffer, "HEAVEMODE", 9) == 0)
-			{
-			sscanf(buffer, "%s %d", dummy, &process->mbp_heave_mode);
-			}
-		    else if (strncmp(buffer, "HEAVEOFFSET", 11) == 0)
-			{
-			sscanf(buffer, "%s %lf", dummy, &process->mbp_heave);
-			}
-		    else if (strncmp(buffer, "HEAVEMULTIPLY", 13) == 0)
-			{
-			sscanf(buffer, "%s %lf", dummy, &process->mbp_heave_mult);
-			}
-
-		    /* lever correction */
-		    else if (strncmp(buffer, "LEVERMODE", 9) == 0)
-			{
-			sscanf(buffer, "%s %d", dummy, &process->mbp_lever_mode);
-			}
-		    else if (strncmp(buffer, "VRUOFFSETX", 10) == 0)
-			{
-			sscanf(buffer, "%s %lf", dummy, &process->mbp_vru_offsetx);
-			}
-		    else if (strncmp(buffer, "VRUOFFSETY", 10) == 0)
-			{
-			sscanf(buffer, "%s %lf", dummy, &process->mbp_vru_offsety);
-			}
-		    else if (strncmp(buffer, "VRUOFFSETZ", 10) == 0)
-			{
-			sscanf(buffer, "%s %lf", dummy, &process->mbp_vru_offsetz);
-			}
-		    else if (strncmp(buffer, "SONAROFFSETX", 12) == 0)
-			{
-			sscanf(buffer, "%s %lf", dummy, &process->mbp_sonar_offsetx);
-			}
-		    else if (strncmp(buffer, "SONAROFFSETY", 12) == 0)
-			{
-			sscanf(buffer, "%s %lf", dummy, &process->mbp_sonar_offsety);
-			}
-		    else if (strncmp(buffer, "SONAROFFSETZ", 12) == 0)
-			{
-			sscanf(buffer, "%s %lf", dummy, &process->mbp_sonar_offsetz);
-			}
-
-		    /* roll correction */
-		    else if (strncmp(buffer, "ROLLBIASMODE", 12) == 0)
-			{
-			sscanf(buffer, "%s %d", dummy, &process->mbp_rollbias_mode);
-			}
-		    else if (strncmp(buffer, "ROLLBIASPORT", 12) == 0)
-			{
-			sscanf(buffer, "%s %lf", dummy, &process->mbp_rollbias_port);
-			}
-		    else if (strncmp(buffer, "ROLLBIASSTBD", 12) == 0)
-			{
-			sscanf(buffer, "%s %lf", dummy, &process->mbp_rollbias_stbd);
-			}
-		    else if (strncmp(buffer, "ROLLBIAS", 8) == 0)
-			{
-			sscanf(buffer, "%s %lf", dummy, &process->mbp_rollbias);
-			}
-
-		    /* pitch correction */
-		    else if (strncmp(buffer, "PITCHBIASMODE", 13) == 0)
-			{
-			sscanf(buffer, "%s %d", dummy, &process->mbp_pitchbias_mode);
-			}
-		    else if (strncmp(buffer, "PITCHBIAS", 9) == 0)
-			{
-			sscanf(buffer, "%s %lf", dummy, &process->mbp_pitchbias);
-			}
-
-		    /* heading correction */
-		    else if (strncmp(buffer, "HEADINGMODE", 11) == 0)
-			{
-			sscanf(buffer, "%s %d", dummy, &process->mbp_heading_mode);
-			}
-		    else if (strncmp(buffer, "HEADINGOFFSET", 13) == 0)
-			{
-			sscanf(buffer, "%s %lf", dummy, &process->mbp_headingbias);
-			}
-
-		    /* tide correction */
-		    else if (strncmp(buffer, "TIDEMODE", 8) == 0)
-			{
-			sscanf(buffer, "%s %d", dummy, &process->mbp_tide_mode);
-			}
-		    else if (strncmp(buffer, "TIDEFILE", 8) == 0)
-			{
-			sscanf(buffer, "%s %s", dummy, process->mbp_tidefile);
-			if (explicit == MB_NO)
-			    {
-			    process->mbp_tide_mode = MBP_TIDE_ON;
-			    }
-			}
-		    else if (strncmp(buffer, "TIDEFORMAT", 10) == 0)
-			{
-			sscanf(buffer, "%s %d", dummy, &process->mbp_tide_format);
-			}
-
-		    /* amplitude correction */
-		    else if (strncmp(buffer, "AMPCORRMODE", 11) == 0)
-			{
-			sscanf(buffer, "%s %d", dummy, &process->mbp_ampcorr_mode);
-			}
-		    else if (strncmp(buffer, "AMPCORRFILE", 11) == 0)
-			{
-			sscanf(buffer, "%s %s", dummy, process->mbp_ampcorrfile);
-			if (explicit == MB_NO)
-			    {
-			    process->mbp_ampcorr_mode = MBP_AMPCORR_ON;
-			    }
-			}
-		    else if (strncmp(buffer, "AMPCORRTYPE", 11) == 0)
-			{
-			sscanf(buffer, "%s %d", dummy, &process->mbp_ampcorr_type);
-			}
-		    else if (strncmp(buffer, "AMPCORRSYMMETRY", 15) == 0)
-			{
-			sscanf(buffer, "%s %d", dummy, &process->mbp_ampcorr_symmetry);
-			}
-		    else if (strncmp(buffer, "AMPCORRANGLE", 12) == 0)
-			{
-			sscanf(buffer, "%s %lf", dummy, &process->mbp_ampcorr_angle);
-			}
-		    else if (strncmp(buffer, "AMPCORRSLOPE", 12) == 0)
-			{
-			sscanf(buffer, "%s %d", dummy, &process->mbp_ampcorr_slope);
-			}
-
-		    /* sidescan correction */
-		    else if (strncmp(buffer, "SSCORRMODE", 10) == 0)
-			{
-			sscanf(buffer, "%s %d", dummy, &process->mbp_sscorr_mode);
-			}
-		    else if (strncmp(buffer, "SSCORRFILE", 10) == 0)
-			{
-			sscanf(buffer, "%s %s", dummy, process->mbp_sscorrfile);
-			if (explicit == MB_NO)
-			    {
-			    process->mbp_sscorr_mode = MBP_SSCORR_ON;
-			    }
-			}
-		    else if (strncmp(buffer, "SSCORRTYPE", 10) == 0)
-			{
-			sscanf(buffer, "%s %d", dummy, &process->mbp_sscorr_type);
-			}
-		    else if (strncmp(buffer, "SSCORRSYMMETRY", 14) == 0)
-			{
-			sscanf(buffer, "%s %d", dummy, &process->mbp_sscorr_symmetry);
-			}
-		    else if (strncmp(buffer, "SSCORRANGLE", 11) == 0)
-			{
-			sscanf(buffer, "%s %lf", dummy, &process->mbp_sscorr_angle);
-			}
-		    else if (strncmp(buffer, "SSCORRSLOPE", 11) == 0)
-			{
-			sscanf(buffer, "%s %d", dummy, &process->mbp_sscorr_slope);
-			}
-
-		    /* amplitude/sidescan topography correction */
-		    else if (strncmp(buffer, "AMPSSCORRTOPOFILE", 17) == 0)
-			{
-			sscanf(buffer, "%s %s", dummy, process->mbp_ampsscorr_topofile);
-			}
-
-		    /* sidescan recalculation */
-		    else if (strncmp(buffer, "SSRECALCMODE", 12) == 0)
-			{
-			sscanf(buffer, "%s %d", dummy, &process->mbp_ssrecalc_mode);
-			}
-		    else if (strncmp(buffer, "SSPIXELSIZE", 11) == 0)
-			{
-			sscanf(buffer, "%s %lf", dummy, &process->mbp_ssrecalc_pixelsize);
-			}
-		    else if (strncmp(buffer, "SSSWATHWIDTH", 11) == 0)
-			{
-			sscanf(buffer, "%s %lf", dummy, &process->mbp_ssrecalc_swathwidth);
-			}
-		    else if (strncmp(buffer, "SSINTERPOLATE", 11) == 0)
-			{
-			sscanf(buffer, "%s %d", dummy, &process->mbp_ssrecalc_interpolate);
-			}
-
-		    /* metadata strings */
-		    else if (strncmp(buffer, "METAVESSEL", 10) == 0)
-			{
-			strncpy(process->mbp_meta_vessel, &buffer[11], MBP_FILENAMESIZE);
-			}
-		    else if (strncmp(buffer, "METAINSTITUTION", 15) == 0)
-			{
-			strncpy(process->mbp_meta_institution, &buffer[16], MBP_FILENAMESIZE);
-			}
-		    else if (strncmp(buffer, "METAPLATFORM", 12) == 0)
-			{
-			strncpy(process->mbp_meta_platform, &buffer[13], MBP_FILENAMESIZE);
-			}
-		    else if (strncmp(buffer, "METASONARVERSION", 16) == 0)
-			{
-			strncpy(process->mbp_meta_sonarversion, &buffer[17], MBP_FILENAMESIZE);
-			}
-		    else if (strncmp(buffer, "METASONAR", 9) == 0)
-			{
-			strncpy(process->mbp_meta_sonar, &buffer[10], MBP_FILENAMESIZE);
-			}
-		    else if (strncmp(buffer, "METACRUISEID", 12) == 0)
-			{
-			strncpy(process->mbp_meta_cruiseid, &buffer[13], MBP_FILENAMESIZE);
-			}
-		    else if (strncmp(buffer, "METACRUISENAME", 14) == 0)
-			{
-			strncpy(process->mbp_meta_cruisename, &buffer[15], MBP_FILENAMESIZE);
-			}
-		    else if (strncmp(buffer, "METAPIINSTITUTION", 17) == 0)
-			{
-			strncpy(process->mbp_meta_piinstitution, &buffer[18], MBP_FILENAMESIZE);
-			}
-		    else if (strncmp(buffer, "METACLIENT", 10) == 0)
-			{
-			strncpy(process->mbp_meta_client, &buffer[11], MBP_FILENAMESIZE);
-			}
-		    else if (strncmp(buffer, "METASVCORRECTED", 15) == 0)
-			{
-			sscanf(buffer, "METASVCORRECTED %d", &process->mbp_meta_svcorrected);
-			}
-		    else if (strncmp(buffer, "METATIDECORRECTED", 17) == 0)
-			{
-			sscanf(buffer, "METATIDECORRECTED %d", &process->mbp_meta_tidecorrected);
-			}
-		    else if (strncmp(buffer, "METABATHEDITMANUAL", 18) == 0)
-			{
-			sscanf(buffer, "METABATHEDITMANUAL %d", &process->mbp_meta_batheditmanual);
-			}
-		    else if (strncmp(buffer, "METABATHEDITAUTO", 16) == 0)
-			{
-			sscanf(buffer, "METABATHEDITAUTO %d", &process->mbp_meta_batheditauto);
-			}
-		    else if (strncmp(buffer, "METAROLLBIAS", 12) == 0)
-			{
-			sscanf(buffer, "METAROLLBIAS %lf", &process->mbp_meta_rollbias);
-			}
-		    else if (strncmp(buffer, "METAPITCHBIAS", 13) == 0)
-			{
-			sscanf(buffer, "METAPITCHBIAS %lf", &process->mbp_meta_pitchbias);
-			}
-		    else if (strncmp(buffer, "METAPI", 6) == 0)
-			{
-			strncpy(process->mbp_meta_pi, &buffer[7], MBP_FILENAMESIZE);
-			}
-		    else if (strncmp(buffer, "METAHEADINGBIAS", 15) == 0)
-			{
-			sscanf(buffer, "METAHEADINGBIAS %lf", &process->mbp_meta_headingbias);
-			}
-		    else if (strncmp(buffer, "METADRAFT", 9) == 0)
-			{
-			sscanf(buffer, "METADRAFT %lf", &process->mbp_meta_draft);
-			}
-
-		    /* processing kluges */
-		    else if (strncmp(buffer, "KLUGE001", 8) == 0)
-			{
-			process->mbp_kluge001 = MB_YES;
-			}
-		    else if (strncmp(buffer, "KLUGE002", 8) == 0)
-			{
-			process->mbp_kluge002 = MB_YES;
-			}
-		    else if (strncmp(buffer, "KLUGE003", 8) == 0)
-			{
-			process->mbp_kluge003 = MB_YES;
-			}
-		    else if (strncmp(buffer, "KLUGE004", 8) == 0)
-			{
-			process->mbp_kluge004 = MB_YES;
-			}
-		    else if (strncmp(buffer, "KLUGE005", 8) == 0)
-			{
-			process->mbp_kluge005 = MB_YES;
-			}
-		    else if (strncmp(buffer, "KLUGE006", 8) == 0)
-			{
-			process->mbp_kluge006 = MB_YES;
-			}
-		    else if (strncmp(buffer, "KLUGE007", 8) == 0)
-			{
-			process->mbp_kluge007 = MB_YES;
-			}
-		    else if (strncmp(buffer, "KLUGE008", 8) == 0)
-			{
-			process->mbp_kluge008 = MB_YES;
-			}
-		    else if (strncmp(buffer, "KLUGE009", 8) == 0)
-			{
-			process->mbp_kluge009 = MB_YES;
-			}
-		    else if (strncmp(buffer, "KLUGE010", 8) == 0)
-			{
-			process->mbp_kluge010 = MB_YES;
-			}
-		    }
-		}
-
-	    /* close file */
-	    fclose(fp);
-
-	    }
-
-	/* Now make input file global if local */
-	process->mbp_ifile_specified = MB_YES;
-	if (file[0] != '/' && file[1] != ':')
-	    {
-	    bufptr = getcwd(process->mbp_ifile, MB_PATH_MAXLINE);
-	    strcat(process->mbp_ifile, "/");
-	    strcat(process->mbp_ifile, file);
-	    }
-	else
-	    strcpy(process->mbp_ifile, file);
-	mb_get_shortest_path(verbose, process->mbp_ifile, error);
-
-	/* figure out data format or output filename if required */
-	if (process->mbp_format_specified == MB_NO
-	    || process->mbp_ofile_specified == MB_NO)
-	    {
-	    mb_pr_default_output(verbose, process, error);
-	    }
-
-	/* Make output file global if local */
-	if (process->mbp_ofile[0] != '/' && process->mbp_ofile[1] != ':')
-	    {
-	    lastslash = strrchr(process->mbp_ifile, '/');
-	    if (lastslash != NULL)
-		{
-		strcpy(dummy, process->mbp_ofile);
-		strcpy(process->mbp_ofile, process->mbp_ifile);
-		process->mbp_ofile[strlen(process->mbp_ifile) - strlen(lastslash)] = '\0';
-		strcat(process->mbp_ofile, "/");
-		strcat(process->mbp_ofile, dummy);
-		}
-	    }
-
-	/* look for nav and other bath edit files if not specified */
-	if (lookforfiles == 1 || lookforfiles == 2)
-	    {
-	    /* look for navadj file */
-	    if (process->mbp_navadj_mode == MBP_NAV_OFF)
-		{
-		for (i = 9; i >= 0 && process->mbp_navadj_mode == MBP_NAV_OFF; i--)
-		    {
-		    sprintf(process->mbp_navadjfile, "%s.na%d", process->mbp_ifile, i);
-		    if (stat(process->mbp_navadjfile, &statbuf) == 0)
-			    {
-			    process->mbp_navadj_mode = MBP_NAV_ON;
-			    }
-		    }
-		if (process->mbp_navadj_mode == MBP_NAV_OFF)
-		    {
-		    process->mbp_navadjfile[0] = '\0';
-		    }
-		}
-
-	    /* look for nav file */
-	    if (process->mbp_nav_mode == MBP_NAV_OFF)
- 		{
-		strcpy(process->mbp_navfile, process->mbp_ifile);
-		strcat(process->mbp_navfile, ".nve");
-		if (stat(process->mbp_navfile, &statbuf) == 0)
-		    {
-		    process->mbp_nav_mode = MBP_NAV_ON;
-		    process->mbp_nav_format = 9;
-		    }
-		else
-		    {
-		    process->mbp_navfile[0] = '\0';
-		    }
-		}
-
-	    /* look for edit file */
-	    if (process->mbp_edit_mode == MBP_EDIT_OFF)
- 		{
-		strcpy(process->mbp_editfile, process->mbp_ifile);
-		strcat(process->mbp_editfile, ".esf");
-		if (stat(process->mbp_editfile, &statbuf) == 0)
-		    {
-		    process->mbp_edit_mode = MBP_EDIT_ON;
-		    }
-		else
-		    {
-		    strcpy(process->mbp_editfile, process->mbp_ifile);
-		    strcat(process->mbp_editfile, ".mbesf");
-		    if (stat(process->mbp_editfile, &statbuf) == 0)
-			{
-			process->mbp_edit_mode = MBP_EDIT_ON;
-			}
-		    else
-			{
-			process->mbp_editfile[0] = '\0';
-			}
-		    }
-		}
-	     }
-
-	/* look for svp files if not specified */
-	if (lookforfiles == 2)
-	    {
-	    /* look for svp file */
-	    if (process->mbp_svp_mode == MBP_SVP_OFF)
- 		{
-		strcpy(process->mbp_svpfile, process->mbp_ifile);
-		strcat(process->mbp_svpfile, ".svp");
-		if (stat(process->mbp_svpfile, &statbuf) == 0)
-		    {
-		    process->mbp_svp_mode = MBP_SVP_ON;
-		    }
-		else
-		    {
-		    strcpy(process->mbp_svpfile, process->mbp_ifile);
-		    strcat(process->mbp_svpfile, "_001.svp");
-		    if (stat(process->mbp_svpfile, &statbuf) == 0)
-			{
-			process->mbp_svp_mode = MBP_SVP_ON;
-			}
-		    else
-			{
-			process->mbp_svpfile[0] = '\0';
-			}
-		    }
-		}
-	    }
-
-	/* reset all output files to local path if possible */
-	if (lookforfiles > 2)
-	    {
-	    /* reset output file */
-	    process->mbp_ofile_specified = MB_NO;
-	    mb_pr_default_output(verbose, process, error);
-
-	    /* reset navadj file */
-	    if ((lastslash = strrchr(process->mbp_navadjfile, '/')) != NULL
-		&& strlen(lastslash) > 1)
-		{
-		strcpy(dummy, &(lastslash[1]));
-		strcpy(process->mbp_navadjfile, dummy);
-		}
-
-	    /* reset nav file */
-	    if ((lastslash = strrchr(process->mbp_navfile, '/')) != NULL
-		&& strlen(lastslash) > 1)
-		{
-		strcpy(dummy, &(lastslash[1]));
-		strcpy(process->mbp_navfile, dummy);
-		}
-
-	    /* reset edit file */
-	    if ((lastslash = strrchr(process->mbp_editfile, '/')) != NULL
-		&& strlen(lastslash) > 1)
-		{
-		strcpy(dummy, &(lastslash[1]));
-		strcpy(process->mbp_editfile, dummy);
-		}
-
-	    /* reset static file */
-	    if ((lastslash = strrchr(process->mbp_staticfile, '/')) != NULL
-		&& strlen(lastslash) > 1)
-		{
-		strcpy(dummy, &(lastslash[1]));
-		strcpy(process->mbp_staticfile, dummy);
-		}
-
-	    /* reset attitude file */
-	    if ((lastslash = strrchr(process->mbp_attitudefile, '/')) != NULL
-		&& strlen(lastslash) > 1)
-		{
-		strcpy(dummy, &(lastslash[1]));
-		strcpy(process->mbp_attitudefile, dummy);
-		}
-
-	    /* reset sonardepth file */
-	    if ((lastslash = strrchr(process->mbp_sonardepthfile, '/')) != NULL
-		&& strlen(lastslash) > 1)
-		{
-		strcpy(dummy, &(lastslash[1]));
-		strcpy(process->mbp_sonardepthfile, dummy);
-		}
-
-	    /* reset tide file */
-	    if ((lastslash = strrchr(process->mbp_tidefile, '/')) != NULL
-		&& strlen(lastslash) > 1)
-		{
-		strcpy(dummy, &(lastslash[1]));
-		strcpy(process->mbp_tidefile, dummy);
-		}
-
-	    /* reset ampcorr file */
-	    if ((lastslash = strrchr(process->mbp_ampcorrfile, '/')) != NULL
-		&& strlen(lastslash) > 1)
-		{
-		strcpy(dummy, &(lastslash[1]));
-		strcpy(process->mbp_ampcorrfile, dummy);
-		}
-
-	    /* reset sscorr file */
-	    if ((lastslash = strrchr(process->mbp_sscorrfile, '/')) != NULL
-		&& strlen(lastslash) > 1)
-		{
-		strcpy(dummy, &(lastslash[1]));
-		strcpy(process->mbp_sscorrfile, dummy);
-		}
-
-	    /* reset mbp_ampsscorr_topo file */
-	    if ((lastslash = strrchr(process->mbp_ampsscorr_topofile, '/')) != NULL
-		&& strlen(lastslash) > 1)
-		{
-		strcpy(dummy, &(lastslash[1]));
-		strcpy(process->mbp_ampsscorr_topofile, dummy);
-		}
-	    }
-
-	/* Now make filenames global if local */
-	lastslash = strrchr(process->mbp_ifile, '/');
-	len = lastslash - process->mbp_ifile + 1;
-
-	/* reset navadj file */
-	if (len > 1
-	    && strlen(process->mbp_navadjfile) > 1
-	    && process->mbp_navadjfile[0] != '/' && process->mbp_navadjfile[1] != ':')
-	    {
-	    strcpy(dummy, process->mbp_navadjfile);
-	    strncpy(process->mbp_navadjfile, process->mbp_ifile, len);
-	    process->mbp_navadjfile[len] = '\0';
-	    strcat(process->mbp_navadjfile, dummy);
-	    }
-
-	/* reset nav file */
-	if (len > 1
-	    && strlen(process->mbp_navfile) > 1
-	    && process->mbp_navfile[0] != '/' && process->mbp_navfile[1] != ':')
-	    {
-	    strcpy(dummy, process->mbp_navfile);
-	    strncpy(process->mbp_navfile, process->mbp_ifile, len);
-	    process->mbp_navfile[len] = '\0';
-	    strcat(process->mbp_navfile, dummy);
-	    }
-
-	/* reset attitude file */
-	if (len > 1
-	    && strlen(process->mbp_attitudefile) > 1
-	    && process->mbp_attitudefile[0] != '/' && process->mbp_attitudefile[1] != ':')
-	    {
-	    strcpy(dummy, process->mbp_attitudefile);
-	    strncpy(process->mbp_attitudefile, process->mbp_ifile, len);
-	    process->mbp_attitudefile[len] = '\0';
-	    strcat(process->mbp_attitudefile, dummy);
-	    }
-
-	/* reset sonardepth file */
-	if (len > 1
-	    && strlen(process->mbp_sonardepthfile) > 1
-	    && process->mbp_sonardepthfile[0] != '/' && process->mbp_sonardepthfile[1] != ':')
-	    {
-	    strcpy(dummy, process->mbp_sonardepthfile);
-	    strncpy(process->mbp_sonardepthfile, process->mbp_ifile, len);
-	    process->mbp_sonardepthfile[len] = '\0';
-	    strcat(process->mbp_sonardepthfile, dummy);
-	    }
-
-	/* reset svp file */
-	if (len > 1
-	    && strlen(process->mbp_svpfile) > 1
-	    && process->mbp_svpfile[0] != '/' && process->mbp_svpfile[1] != ':')
-	    {
-	    strcpy(dummy, process->mbp_svpfile);
-	    strncpy(process->mbp_svpfile, process->mbp_ifile, len);
-	    process->mbp_svpfile[len] = '\0';
-	    strcat(process->mbp_svpfile, dummy);
-	    }
-
-	/* reset edit file */
-	if (len > 1
-	    && strlen(process->mbp_editfile) > 1
-	    && process->mbp_editfile[0] != '/' && process->mbp_editfile[1] != ':')
-	    {
-	    strcpy(dummy, process->mbp_editfile);
-	    strncpy(process->mbp_editfile, process->mbp_ifile, len);
-	    process->mbp_editfile[len] = '\0';
-	    strcat(process->mbp_editfile, dummy);
-	    }
-
-	/* reset static file */
-	if (len > 1
-	    && strlen(process->mbp_staticfile) > 1
-	    && process->mbp_staticfile[0] != '/' && process->mbp_staticfile[1] != ':')
-	    {
-	    strcpy(dummy, process->mbp_staticfile);
-	    strncpy(process->mbp_staticfile, process->mbp_ifile, len);
-	    process->mbp_staticfile[len] = '\0';
-	    strcat(process->mbp_staticfile, dummy);
-	    }
-
-	/* reset tide file */
-	if (len > 1
-	    && strlen(process->mbp_tidefile) > 1
-	    && process->mbp_tidefile[0] != '/' && process->mbp_tidefile[1] != ':')
-	    {
-	    strcpy(dummy, process->mbp_tidefile);
-	    strncpy(process->mbp_tidefile, process->mbp_ifile, len);
-	    process->mbp_tidefile[len] = '\0';
-	    strcat(process->mbp_tidefile, dummy);
-	    }
-
-	/* reset amplitude correction file */
-	if (len > 1
-	    && strlen(process->mbp_ampcorrfile) > 1
-	    && process->mbp_ampcorrfile[0] != '/' && process->mbp_ampcorrfile[1] != ':')
-	    {
-	    strcpy(dummy, process->mbp_ampcorrfile);
-	    strncpy(process->mbp_ampcorrfile, process->mbp_ifile, len);
-	    process->mbp_ampcorrfile[len] = '\0';
-	    strcat(process->mbp_ampcorrfile, dummy);
-	    }
-
-	/* reset sidescan correction file */
-	if (len > 1
-	    && strlen(process->mbp_sscorrfile) > 1
-	    && process->mbp_sscorrfile[0] != '/' && process->mbp_sscorrfile[1] != ':')
-	    {
-	    strcpy(dummy, process->mbp_sscorrfile);
-	    strncpy(process->mbp_sscorrfile, process->mbp_ifile, len);
-	    process->mbp_sscorrfile[len] = '\0';
-	    strcat(process->mbp_sscorrfile, dummy);
-	    }
-
-	/* reset mbp_ampsscorr_topo file */
-	if (len > 1
-	    && strlen(process->mbp_ampsscorr_topofile) > 1
-	    && process->mbp_ampsscorr_topofile[0] != '/' && process->mbp_ampsscorr_topofile[1] != ':')
-	    {
-	    strcpy(dummy, process->mbp_ampsscorr_topofile);
-	    strncpy(process->mbp_ampsscorr_topofile, process->mbp_ifile, len);
-	    process->mbp_ampsscorr_topofile[len] = '\0';
-	    strcat(process->mbp_ampsscorr_topofile, dummy);
-	    }
-
-	/* make sure all global paths are as short as possible */
-	mb_get_shortest_path(verbose, process->mbp_navadjfile, error);
-	mb_get_shortest_path(verbose, process->mbp_navfile, error);
-	mb_get_shortest_path(verbose, process->mbp_attitudefile, error);
-	mb_get_shortest_path(verbose, process->mbp_sonardepthfile, error);
-	mb_get_shortest_path(verbose, process->mbp_svpfile, error);
-	mb_get_shortest_path(verbose, process->mbp_editfile, error);
-	mb_get_shortest_path(verbose, process->mbp_staticfile, error);
-	mb_get_shortest_path(verbose, process->mbp_tidefile, error);
-	mb_get_shortest_path(verbose, process->mbp_ampcorrfile, error);
-	mb_get_shortest_path(verbose, process->mbp_sscorrfile, error);
-	mb_get_shortest_path(verbose, process->mbp_ampsscorr_topofile, error);
-
-	/* update bathymetry recalculation mode */
-	mb_pr_bathmode(verbose, process, error);
-
-	/* check for error */
-	if (process->mbp_ifile_specified == MB_NO
-	    || process->mbp_ofile_specified == MB_NO
-	    || process->mbp_format_specified == MB_NO)
-	    {
-	    status = MB_FAILURE;
-	    *error = MB_ERROR_OPEN_FAIL;
-	    }
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       mbp_ifile_specified:    %d\n",process->mbp_ifile_specified);
-		fprintf(stderr,"dbg2       mbp_ifile:              %s\n",process->mbp_ifile);
-		fprintf(stderr,"dbg2       mbp_ofile_specified:    %d\n",process->mbp_ofile_specified);
-		fprintf(stderr,"dbg2       mbp_ofile:              %s\n",process->mbp_ofile);
-		fprintf(stderr,"dbg2       mbp_format_specified:   %d\n",process->mbp_format_specified);
-		fprintf(stderr,"dbg2       mbp_format:             %d\n",process->mbp_format);
-		fprintf(stderr,"dbg2       mbp_nav_mode:           %d\n",process->mbp_nav_mode);
-		fprintf(stderr,"dbg2       mbp_navfile:            %s\n",process->mbp_navfile);
-		fprintf(stderr,"dbg2       mbp_nav_format:         %d\n",process->mbp_nav_format);
-		fprintf(stderr,"dbg2       mbp_nav_heading:        %d\n",process->mbp_nav_heading);
-		fprintf(stderr,"dbg2       mbp_nav_speed:          %d\n",process->mbp_nav_speed);
-		fprintf(stderr,"dbg2       mbp_nav_draft:          %d\n",process->mbp_nav_draft);
-		fprintf(stderr,"dbg2       mbp_nav_attitude:       %d\n",process->mbp_nav_attitude);
-		fprintf(stderr,"dbg2       mbp_nav_algorithm:      %d\n",process->mbp_nav_algorithm);
-		fprintf(stderr,"dbg2       mbp_nav_timeshift:      %f\n",process->mbp_nav_timeshift);
-		fprintf(stderr,"dbg2       mbp_nav_shift:          %d\n",process->mbp_nav_shift);
-		fprintf(stderr,"dbg2       mbp_nav_offsetx:        %f\n",process->mbp_nav_offsetx);
-		fprintf(stderr,"dbg2       mbp_nav_offsety:        %f\n",process->mbp_nav_offsety);
-		fprintf(stderr,"dbg2       mbp_nav_offsetz:        %f\n",process->mbp_nav_offsetz);
-		fprintf(stderr,"dbg2       mbp_nav_shiftlon:       %f\n",process->mbp_nav_shiftlon);
-		fprintf(stderr,"dbg2       mbp_nav_shiftlat:       %f\n",process->mbp_nav_shiftlat);
-		fprintf(stderr,"dbg2       mbp_navadj_mode:        %d\n",process->mbp_navadj_mode);
-		fprintf(stderr,"dbg2       mbp_navadjfile:         %s\n",process->mbp_navadjfile);
-		fprintf(stderr,"dbg2       mbp_navadj_algorithm:   %d\n",process->mbp_navadj_algorithm);
-		fprintf(stderr,"dbg2       mbp_attitude_mode:      %d\n",process->mbp_attitude_mode);
-		fprintf(stderr,"dbg2       mbp_attitudefile:       %s\n",process->mbp_attitudefile);
-		fprintf(stderr,"dbg2       mbp_attitude_format:    %d\n",process->mbp_attitude_format);
-		fprintf(stderr,"dbg2       mbp_sonardepth_mode:    %d\n",process->mbp_sonardepth_mode);
-		fprintf(stderr,"dbg2       mbp_sonardepthfile:     %s\n",process->mbp_sonardepthfile);
-		fprintf(stderr,"dbg2       mbp_sonardepth_format:  %d\n",process->mbp_sonardepth_format);
-		fprintf(stderr,"dbg2       mbp_cut_num:            %d\n",process->mbp_cut_num);
-		for (i=0;i<process->mbp_cut_num;i++)
-			{
-			fprintf(stderr,"dbg2           cut %d:\n",i);
-			fprintf(stderr,"dbg2           mbp_cut_kind[%d]:     %d\n", i, process->mbp_cut_kind[i]);
-			fprintf(stderr,"dbg2           mbp_cut_mode[%d]:     %d\n", i, process->mbp_cut_mode[i]);
-			fprintf(stderr,"dbg2           mbp_cut_min[%d]:      %f\n", i, process->mbp_cut_min[i]);
-			fprintf(stderr,"dbg2           mbp_cut_max[%d]:      %f\n", i, process->mbp_cut_max[i]);
-			}
-		fprintf(stderr,"dbg2       mbp_bathrecalc_mode:    %d\n",process->mbp_bathrecalc_mode);
-		fprintf(stderr,"dbg2       mbp_rollbias_mode:      %d\n",process->mbp_rollbias_mode);
-		fprintf(stderr,"dbg2       mbp_rollbias:           %f\n",process->mbp_rollbias);
-		fprintf(stderr,"dbg2       mbp_rollbias_port:      %f\n",process->mbp_rollbias_port);
-		fprintf(stderr,"dbg2       mbp_rollbias_stbd:      %f\n",process->mbp_rollbias_stbd);
-		fprintf(stderr,"dbg2       mbp_pitchbias_mode:     %d\n",process->mbp_pitchbias_mode);
-		fprintf(stderr,"dbg2       mbp_pitchbias:          %f\n",process->mbp_pitchbias);
-		fprintf(stderr,"dbg2       mbp_draft_mode:         %d\n",process->mbp_draft_mode);
-		fprintf(stderr,"dbg2       mbp_draft:              %f\n",process->mbp_draft);
-		fprintf(stderr,"dbg2       mbp_draft_offset:       %f\n",process->mbp_draft_offset);
-		fprintf(stderr,"dbg2       mbp_draft_mult:         %f\n",process->mbp_draft_mult);
-		fprintf(stderr,"dbg2       mbp_heave_mode:         %d\n",process->mbp_heave_mode);
-		fprintf(stderr,"dbg2       mbp_heave:              %f\n",process->mbp_heave);
-		fprintf(stderr,"dbg2       mbp_heave_mult:         %f\n",process->mbp_heave_mult);
-		fprintf(stderr,"dbg2       mbp_lever_mode:         %d\n",process->mbp_heave_mode);
-		fprintf(stderr,"dbg2       mbp_vru_offsetx:        %f\n",process->mbp_vru_offsetx);
-		fprintf(stderr,"dbg2       mbp_vru_offsety:        %f\n",process->mbp_vru_offsety);
-		fprintf(stderr,"dbg2       mbp_vru_offsetz:        %f\n",process->mbp_vru_offsetz);
-		fprintf(stderr,"dbg2       mbp_sonar_offsetx:      %f\n",process->mbp_sonar_offsetx);
-		fprintf(stderr,"dbg2       mbp_sonar_offsety:      %f\n",process->mbp_sonar_offsety);
-		fprintf(stderr,"dbg2       mbp_sonar_offsetz:      %f\n",process->mbp_sonar_offsetz);
-		fprintf(stderr,"dbg2       mbp_ssv_mode:           %d\n",process->mbp_ssv_mode);
-		fprintf(stderr,"dbg2       mbp_ssv:                %f\n",process->mbp_ssv);
-		fprintf(stderr,"dbg2       mbp_svp_mode:           %d\n",process->mbp_svp_mode);
-		fprintf(stderr,"dbg2       mbp_svpfile:            %s\n",process->mbp_svpfile);
-		fprintf(stderr,"dbg2       mbp_corrected:          %d\n",process->mbp_corrected);
-		fprintf(stderr,"dbg2       mbp_tt_mode:            %d\n",process->mbp_tt_mode);
-		fprintf(stderr,"dbg2       mbp_tt_mult:            %f\n",process->mbp_tt_mult);
-		fprintf(stderr,"dbg2       mbp_angle_mode:         %d\n",process->mbp_angle_mode);
-		fprintf(stderr,"dbg2       mbp_static_mode:        %d\n",process->mbp_static_mode);
-		fprintf(stderr,"dbg2       mbp_staticfile:         %s\n",process->mbp_staticfile);
-		fprintf(stderr,"dbg2       mbp_heading_mode:       %d\n",process->mbp_heading_mode);
-		fprintf(stderr,"dbg2       mbp_headingbias:        %f\n",process->mbp_headingbias);
-		fprintf(stderr,"dbg2       mbp_edit_mode:          %d\n",process->mbp_edit_mode);
-		fprintf(stderr,"dbg2       mbp_editfile:           %s\n",process->mbp_editfile);
-		fprintf(stderr,"dbg2       mbp_tide_mode:          %d\n",process->mbp_tide_mode);
-		fprintf(stderr,"dbg2       mbp_tidefile:           %s\n",process->mbp_tidefile);
-		fprintf(stderr,"dbg2       mbp_tide_format:        %d\n",process->mbp_tide_format);
-		fprintf(stderr,"dbg2       mbp_ampcorr_mode:       %d\n",process->mbp_ampcorr_mode);
-		fprintf(stderr,"dbg2       mbp_ampcorrfile:        %s\n",process->mbp_ampcorrfile);
-		fprintf(stderr,"dbg2       mbp_ampcorr_type:       %d\n",process->mbp_ampcorr_type);
-		fprintf(stderr,"dbg2       mbp_ampcorr_symmetry:   %d\n",process->mbp_ampcorr_symmetry);
-		fprintf(stderr,"dbg2       mbp_ampcorr_angle:      %f\n",process->mbp_ampcorr_angle);
-		fprintf(stderr,"dbg2       mbp_ampcorr_slope:      %d\n",process->mbp_ampcorr_slope);
-		fprintf(stderr,"dbg2       mbp_sscorr_mode:        %d\n",process->mbp_sscorr_mode);
-		fprintf(stderr,"dbg2       mbp_sscorrfile:         %s\n",process->mbp_sscorrfile);
-		fprintf(stderr,"dbg2       mbp_sscorr_type:        %d\n",process->mbp_sscorr_type);
-		fprintf(stderr,"dbg2       mbp_sscorr_symmetry:    %d\n",process->mbp_sscorr_symmetry);
-		fprintf(stderr,"dbg2       mbp_sscorr_angle:       %f\n",process->mbp_sscorr_angle);
-		fprintf(stderr,"dbg2       mbp_sscorr_slope:       %d\n",process->mbp_sscorr_slope);
-		fprintf(stderr,"dbg2       mbp_ampsscorr_topofile: %s\n",process->mbp_ampsscorr_topofile);
-		fprintf(stderr,"dbg2       mbp_ssrecalc_mode:      %d\n",process->mbp_ssrecalc_mode);
-		fprintf(stderr,"dbg2       mbp_ssrecalc_pixelsize: %f\n",process->mbp_ssrecalc_pixelsize);
-		fprintf(stderr,"dbg2       mbp_ssrecalc_swathwidth:%f\n",process->mbp_ssrecalc_swathwidth);
-		fprintf(stderr,"dbg2       mbp_ssrecalc_interp    :%d\n",process->mbp_ssrecalc_interpolate);
-		fprintf(stderr,"dbg2       mbp_meta_vessel        :%s\n",process->mbp_meta_vessel);
-		fprintf(stderr,"dbg2       mbp_meta_institution   :%s\n",process->mbp_meta_institution);
-		fprintf(stderr,"dbg2       mbp_meta_platform      :%s\n",process->mbp_meta_platform);
-		fprintf(stderr,"dbg2       mbp_meta_sonar         :%s\n",process->mbp_meta_sonar);
-		fprintf(stderr,"dbg2       mbp_meta_sonarversion  :%s\n",process->mbp_meta_sonarversion);
-		fprintf(stderr,"dbg2       mbp_meta_cruiseid      :%s\n",process->mbp_meta_cruiseid);
-		fprintf(stderr,"dbg2       mbp_meta_cruisename    :%s\n",process->mbp_meta_cruisename);
-		fprintf(stderr,"dbg2       mbp_meta_pi            :%s\n",process->mbp_meta_pi);
-		fprintf(stderr,"dbg2       mbp_meta_piinstitution :%s\n",process->mbp_meta_piinstitution);
-		fprintf(stderr,"dbg2       mbp_meta_client        :%s\n",process->mbp_meta_client);
-		fprintf(stderr,"dbg2       mbp_meta_svcorrected   :%d\n",process->mbp_meta_svcorrected);
-		fprintf(stderr,"dbg2       mbp_meta_tidecorrected :%d\n",process->mbp_meta_tidecorrected);
-		fprintf(stderr,"dbg2       mbp_meta_batheditmanual:%d\n",process->mbp_meta_batheditmanual);
-		fprintf(stderr,"dbg2       mbp_meta_batheditauto:  %d\n",process->mbp_meta_batheditauto);
-		fprintf(stderr,"dbg2       mbp_meta_rollbias:      %f\n",process->mbp_meta_rollbias);
-		fprintf(stderr,"dbg2       mbp_meta_pitchbias:     %f\n",process->mbp_meta_pitchbias);
-		fprintf(stderr,"dbg2       mbp_meta_headingbias:   %f\n",process->mbp_meta_headingbias);
-		fprintf(stderr,"dbg2       mbp_meta_draft:         %f\n",process->mbp_meta_draft);
-		fprintf(stderr,"dbg2       mbp_kluge001:           %d\n",process->mbp_kluge001);
-		fprintf(stderr,"dbg2       mbp_kluge002:           %d\n",process->mbp_kluge002);
-		fprintf(stderr,"dbg2       mbp_kluge003:           %d\n",process->mbp_kluge003);
-		fprintf(stderr,"dbg2       mbp_kluge004:           %d\n",process->mbp_kluge004);
-		fprintf(stderr,"dbg2       mbp_kluge005:           %d\n",process->mbp_kluge005);
-		fprintf(stderr,"dbg2       mbp_kluge006:           %d\n",process->mbp_kluge006);
-		fprintf(stderr,"dbg2       mbp_kluge007:           %d\n",process->mbp_kluge007);
-		fprintf(stderr,"dbg2       mbp_kluge008:           %d\n",process->mbp_kluge008);
-		fprintf(stderr,"dbg2       mbp_kluge009:           %d\n",process->mbp_kluge009);
-		fprintf(stderr,"dbg2       mbp_kluge010:           %d\n",process->mbp_kluge010);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_pr_writepar(int verbose, char *file,
-			struct mb_process_struct *process,
-			int *error)
-{
-	char	*function_name = "mb_pr_writepar";
-	char	parfile[MBP_FILENAMESIZE];
-	char	pwd[MBP_FILENAMESIZE];
-	char	relative_path[MBP_FILENAMESIZE];
-	char	*lastslash;
-	FILE	*fp;
-	int	status = MB_SUCCESS;
-	time_t	right_now;
-	char	date[32], user[MBP_FILENAMESIZE], *user_ptr, host[MBP_FILENAMESIZE];
-	char	*bufptr;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:                %d\n",verbose);
-		fprintf(stderr,"dbg2       file:                   %s\n",file);
-		fprintf(stderr,"dbg2       process:                %p\n",(void *)process);
-		fprintf(stderr,"dbg2       mbp_ifile_specified:    %d\n",process->mbp_ifile_specified);
-		fprintf(stderr,"dbg2       mbp_ifile:              %s\n",process->mbp_ifile);
-		fprintf(stderr,"dbg2       mbp_ofile_specified:    %d\n",process->mbp_ofile_specified);
-		fprintf(stderr,"dbg2       mbp_ofile:              %s\n",process->mbp_ofile);
-		fprintf(stderr,"dbg2       mbp_format_specified:   %d\n",process->mbp_format_specified);
-		fprintf(stderr,"dbg2       mbp_format:             %d\n",process->mbp_format);
-		fprintf(stderr,"dbg2       mbp_nav_mode:           %d\n",process->mbp_nav_mode);
-		fprintf(stderr,"dbg2       mbp_navfile:            %s\n",process->mbp_navfile);
-		fprintf(stderr,"dbg2       mbp_nav_format:         %d\n",process->mbp_nav_format);
-		fprintf(stderr,"dbg2       mbp_nav_heading:        %d\n",process->mbp_nav_heading);
-		fprintf(stderr,"dbg2       mbp_nav_speed:          %d\n",process->mbp_nav_speed);
-		fprintf(stderr,"dbg2       mbp_nav_draft:          %d\n",process->mbp_nav_draft);
-		fprintf(stderr,"dbg2       mbp_nav_attitude:       %d\n",process->mbp_nav_attitude);
-		fprintf(stderr,"dbg2       mbp_nav_algorithm:      %d\n",process->mbp_nav_algorithm);
-		fprintf(stderr,"dbg2       mbp_nav_timeshift:      %f\n",process->mbp_nav_timeshift);
-		fprintf(stderr,"dbg2       mbp_nav_shift:          %d\n",process->mbp_nav_shift);
-		fprintf(stderr,"dbg2       mbp_nav_offsetx:        %f\n",process->mbp_nav_offsetx);
-		fprintf(stderr,"dbg2       mbp_nav_offsety:        %f\n",process->mbp_nav_offsety);
-		fprintf(stderr,"dbg2       mbp_nav_offsetz:        %f\n",process->mbp_nav_offsetz);
-		fprintf(stderr,"dbg2       mbp_nav_shiftlon:       %f\n",process->mbp_nav_shiftlon);
-		fprintf(stderr,"dbg2       mbp_nav_shiftlat:       %f\n",process->mbp_nav_shiftlat);
-		fprintf(stderr,"dbg2       mbp_navadj_mode:        %d\n",process->mbp_navadj_mode);
-		fprintf(stderr,"dbg2       mbp_navadjfile:         %s\n",process->mbp_navadjfile);
-		fprintf(stderr,"dbg2       mbp_navadj_algorithm:   %d\n",process->mbp_navadj_algorithm);
-		fprintf(stderr,"dbg2       mbp_attitude_mode:      %d\n",process->mbp_attitude_mode);
-		fprintf(stderr,"dbg2       mbp_attitudefile:       %s\n",process->mbp_attitudefile);
-		fprintf(stderr,"dbg2       mbp_attitude_format:    %d\n",process->mbp_attitude_format);
-		fprintf(stderr,"dbg2       mbp_cut_num:            %d\n",process->mbp_cut_num);
-		fprintf(stderr,"dbg2       mbp_sonardepth_mode:    %d\n",process->mbp_sonardepth_mode);
-		fprintf(stderr,"dbg2       mbp_sonardepthfile:     %s\n",process->mbp_sonardepthfile);
-		fprintf(stderr,"dbg2       mbp_sonardepth_format:  %d\n",process->mbp_sonardepth_format);
-		fprintf(stderr,"dbg2       mbp_cut_num:            %d\n",process->mbp_cut_num);
-		for (i=0;i<process->mbp_cut_num;i++)
-			{
-			fprintf(stderr,"dbg2           cut %d:\n",i);
-			fprintf(stderr,"dbg2           mbp_cut_kind[%d]:     %d\n", i, process->mbp_cut_kind[i]);
-			fprintf(stderr,"dbg2           mbp_cut_mode[%d]:     %d\n", i, process->mbp_cut_mode[i]);
-			fprintf(stderr,"dbg2           mbp_cut_min[%d]:      %f\n", i, process->mbp_cut_min[i]);
-			fprintf(stderr,"dbg2           mbp_cut_max[%d]:      %f\n", i, process->mbp_cut_max[i]);
-			}
-		fprintf(stderr,"dbg2       mbp_bathrecalc_mode:    %d\n",process->mbp_bathrecalc_mode);
-		fprintf(stderr,"dbg2       mbp_rollbias_mode:      %d\n",process->mbp_rollbias_mode);
-		fprintf(stderr,"dbg2       mbp_rollbias:           %f\n",process->mbp_rollbias);
-		fprintf(stderr,"dbg2       mbp_rollbias_port:      %f\n",process->mbp_rollbias_port);
-		fprintf(stderr,"dbg2       mbp_rollbias_stbd:      %f\n",process->mbp_rollbias_stbd);
-		fprintf(stderr,"dbg2       mbp_pitchbias_mode:     %d\n",process->mbp_pitchbias_mode);
-		fprintf(stderr,"dbg2       mbp_pitchbias:          %f\n",process->mbp_pitchbias);
-		fprintf(stderr,"dbg2       mbp_draft_mode:         %d\n",process->mbp_draft_mode);
-		fprintf(stderr,"dbg2       mbp_draft:              %f\n",process->mbp_draft);
-		fprintf(stderr,"dbg2       mbp_draft_offset:       %f\n",process->mbp_draft_offset);
-		fprintf(stderr,"dbg2       mbp_draft_mult:         %f\n",process->mbp_draft_mult);
-		fprintf(stderr,"dbg2       mbp_heave_mode:         %d\n",process->mbp_heave_mode);
-		fprintf(stderr,"dbg2       mbp_heave:              %f\n",process->mbp_heave);
-		fprintf(stderr,"dbg2       mbp_heave_mult:         %f\n",process->mbp_heave_mult);
-		fprintf(stderr,"dbg2       mbp_lever_mode:         %d\n",process->mbp_heave_mode);
-		fprintf(stderr,"dbg2       mbp_vru_offsetx:        %f\n",process->mbp_vru_offsetx);
-		fprintf(stderr,"dbg2       mbp_vru_offsety:        %f\n",process->mbp_vru_offsety);
-		fprintf(stderr,"dbg2       mbp_vru_offsetz:        %f\n",process->mbp_vru_offsetz);
-		fprintf(stderr,"dbg2       mbp_sonar_offsetx:      %f\n",process->mbp_sonar_offsetx);
-		fprintf(stderr,"dbg2       mbp_sonar_offsety:      %f\n",process->mbp_sonar_offsety);
-		fprintf(stderr,"dbg2       mbp_sonar_offsetz:      %f\n",process->mbp_sonar_offsetz);
-		fprintf(stderr,"dbg2       mbp_ssv_mode:           %d\n",process->mbp_ssv_mode);
-		fprintf(stderr,"dbg2       mbp_ssv:                %f\n",process->mbp_ssv);
-		fprintf(stderr,"dbg2       mbp_svp_mode:           %d\n",process->mbp_svp_mode);
-		fprintf(stderr,"dbg2       mbp_svpfile:            %s\n",process->mbp_svpfile);
-		fprintf(stderr,"dbg2       mbp_corrected:          %d\n",process->mbp_corrected);
-		fprintf(stderr,"dbg2       mbp_tt_mode:            %d\n",process->mbp_tt_mode);
-		fprintf(stderr,"dbg2       mbp_tt_mult:            %f\n",process->mbp_tt_mult);
-		fprintf(stderr,"dbg2       mbp_angle_mode:         %d\n",process->mbp_angle_mode);
-		fprintf(stderr,"dbg2       mbp_static_mode:        %d\n",process->mbp_static_mode);
-		fprintf(stderr,"dbg2       mbp_staticfile:         %s\n",process->mbp_staticfile);
-		fprintf(stderr,"dbg2       mbp_heading_mode:       %d\n",process->mbp_heading_mode);
-		fprintf(stderr,"dbg2       mbp_headingbias:        %f\n",process->mbp_headingbias);
-		fprintf(stderr,"dbg2       mbp_edit_mode:          %d\n",process->mbp_edit_mode);
-		fprintf(stderr,"dbg2       mbp_editfile:           %s\n",process->mbp_editfile);
-		fprintf(stderr,"dbg2       mbp_tide_mode:          %d\n",process->mbp_tide_mode);
-		fprintf(stderr,"dbg2       mbp_tidefile:           %s\n",process->mbp_tidefile);
-		fprintf(stderr,"dbg2       mbp_tide_format:        %d\n",process->mbp_tide_format);
-		fprintf(stderr,"dbg2       mbp_ampcorr_mode:       %d\n",process->mbp_ampcorr_mode);
-		fprintf(stderr,"dbg2       mbp_ampcorrfile:        %s\n",process->mbp_ampcorrfile);
-		fprintf(stderr,"dbg2       mbp_ampcorr_type:       %d\n",process->mbp_ampcorr_type);
-		fprintf(stderr,"dbg2       mbp_ampcorr_symmetry:   %d\n",process->mbp_ampcorr_symmetry);
-		fprintf(stderr,"dbg2       mbp_ampcorr_angle:      %f\n",process->mbp_ampcorr_angle);
-		fprintf(stderr,"dbg2       mbp_ampcorr_slope:      %d\n",process->mbp_ampcorr_slope);
-		fprintf(stderr,"dbg2       mbp_sscorr_mode:        %d\n",process->mbp_sscorr_mode);
-		fprintf(stderr,"dbg2       mbp_sscorrfile:         %s\n",process->mbp_sscorrfile);
-		fprintf(stderr,"dbg2       mbp_sscorr_type:        %d\n",process->mbp_sscorr_type);
-		fprintf(stderr,"dbg2       mbp_sscorr_symmetry:    %d\n",process->mbp_sscorr_symmetry);
-		fprintf(stderr,"dbg2       mbp_sscorr_angle:       %f\n",process->mbp_sscorr_angle);
-		fprintf(stderr,"dbg2       mbp_sscorr_slope:       %d\n",process->mbp_sscorr_slope);
-		fprintf(stderr,"dbg2       mbp_ampsscorr_topofile: %s\n",process->mbp_ampsscorr_topofile);
-		fprintf(stderr,"dbg2       mbp_ssrecalc_mode:      %d\n",process->mbp_ssrecalc_mode);
-		fprintf(stderr,"dbg2       mbp_ssrecalc_pixelsize: %f\n",process->mbp_ssrecalc_pixelsize);
-		fprintf(stderr,"dbg2       mbp_ssrecalc_swathwidth:%f\n",process->mbp_ssrecalc_swathwidth);
-		fprintf(stderr,"dbg2       mbp_ssrecalc_interp    :%d\n",process->mbp_ssrecalc_interpolate);
-		fprintf(stderr,"dbg2       mbp_meta_vessel        :%s\n",process->mbp_meta_vessel);
-		fprintf(stderr,"dbg2       mbp_meta_institution   :%s\n",process->mbp_meta_institution);
-		fprintf(stderr,"dbg2       mbp_meta_platform      :%s\n",process->mbp_meta_platform);
-		fprintf(stderr,"dbg2       mbp_meta_sonar         :%s\n",process->mbp_meta_sonar);
-		fprintf(stderr,"dbg2       mbp_meta_sonarversion  :%s\n",process->mbp_meta_sonarversion);
-		fprintf(stderr,"dbg2       mbp_meta_cruiseid      :%s\n",process->mbp_meta_cruiseid);
-		fprintf(stderr,"dbg2       mbp_meta_cruisename    :%s\n",process->mbp_meta_cruisename);
-		fprintf(stderr,"dbg2       mbp_meta_pi            :%s\n",process->mbp_meta_pi);
-		fprintf(stderr,"dbg2       mbp_meta_piinstitution :%s\n",process->mbp_meta_piinstitution);
-		fprintf(stderr,"dbg2       mbp_meta_client        :%s\n",process->mbp_meta_client);
-		fprintf(stderr,"dbg2       mbp_meta_svcorrected   :%d\n",process->mbp_meta_svcorrected);
-		fprintf(stderr,"dbg2       mbp_meta_tidecorrected :%d\n",process->mbp_meta_tidecorrected);
-		fprintf(stderr,"dbg2       mbp_meta_batheditmanual:%d\n",process->mbp_meta_batheditmanual);
-		fprintf(stderr,"dbg2       mbp_meta_batheditauto:  %d\n",process->mbp_meta_batheditauto);
-		fprintf(stderr,"dbg2       mbp_meta_rollbias:      %f\n",process->mbp_meta_rollbias);
-		fprintf(stderr,"dbg2       mbp_meta_pitchbias:     %f\n",process->mbp_meta_pitchbias);
-		fprintf(stderr,"dbg2       mbp_meta_headingbias:   %f\n",process->mbp_meta_headingbias);
-		fprintf(stderr,"dbg2       mbp_meta_draft:         %f\n",process->mbp_meta_draft);
-		fprintf(stderr,"dbg2       mbp_kluge001:           %d\n",process->mbp_kluge001);
-		fprintf(stderr,"dbg2       mbp_kluge002:           %d\n",process->mbp_kluge002);
-		fprintf(stderr,"dbg2       mbp_kluge003:           %d\n",process->mbp_kluge003);
-		fprintf(stderr,"dbg2       mbp_kluge004:           %d\n",process->mbp_kluge004);
-		fprintf(stderr,"dbg2       mbp_kluge005:           %d\n",process->mbp_kluge005);
-		fprintf(stderr,"dbg2       mbp_kluge006:           %d\n",process->mbp_kluge006);
-		fprintf(stderr,"dbg2       mbp_kluge007:           %d\n",process->mbp_kluge007);
-		fprintf(stderr,"dbg2       mbp_kluge008:           %d\n",process->mbp_kluge008);
-		fprintf(stderr,"dbg2       mbp_kluge009:           %d\n",process->mbp_kluge009);
-		fprintf(stderr,"dbg2       mbp_kluge010:           %d\n",process->mbp_kluge010);
-		}
-
-	/* try to avoid absolute pathnames - get pwd */
-	lastslash = strrchr(file, '/');
-	if (file[0] == '/')
-	    {
-	    strcpy(pwd, file);
-	    pwd[strlen(file) - strlen(lastslash)] = '\0';
-	    }
-	else
-	    {
-	    bufptr = getcwd(pwd, MB_PATH_MAXLINE);
-	    if (lastslash != NULL)
-		{
-		strcat(pwd, "/");
-		strcat(pwd, file);
-		lastslash = strrchr(pwd, '/');
-		pwd[strlen(pwd) - strlen(lastslash)] = '\0';
-		}
-	    }
-	mb_get_shortest_path(verbose, pwd, error);
-
-	/* get expected process parameter file name */
-	strcpy(parfile, file);
-	strcat(parfile, ".par");
-
-	/* open parameter file */
-	if ((fp = fopen(parfile, "w")) != NULL)
-	    {
-	    fprintf(fp,"## MB-System processing parameter file\n");
-	    fprintf(fp,"## Written by %s version %s\n", function_name, rcs_id);
-	    fprintf(fp,"## MB-system Version %s\n",MB_VERSION);
-	    right_now = time((time_t *)0);
-	    strcpy(date,ctime(&right_now));
-            date[strlen(date)-1] = '\0';
-	    if ((user_ptr = getenv("USER")) == NULL)
-		    user_ptr = getenv("LOGNAME");
-	    if (user_ptr != NULL)
-		    strcpy(user,user_ptr);
-	    else
-		    strcpy(user, "unknown");
-	    gethostname(host,MBP_FILENAMESIZE);
-	    fprintf(fp,"## Generated by user <%s> on cpu <%s> at <%s>\n##\n",
-		    user,host,date);
-
-	    /* general parameters */
-	    fprintf(fp, "##\n## Forces explicit reading of parameter modes.\n");
-	    fprintf(fp, "EXPLICIT\n");
-	    fprintf(fp, "##\n## General Parameters:\n");
-	    if (process->mbp_format_specified == MB_YES)
-		{
-		fprintf(fp, "FORMAT %d\n", process->mbp_format);
-		}
-	    else
-		{
-		fprintf(fp, "## FORMAT format\n");
-		}
-	    if (process->mbp_ifile_specified == MB_YES)
-		{
-		strcpy(relative_path, process->mbp_ifile);
-		status = mb_get_relative_path(verbose, relative_path, pwd, error);
-		fprintf(fp, "INFILE %s\n", relative_path);
-		}
-	    else
-		{
-		fprintf(fp, "## INFILE infile\n");
-		}
-	    if (process->mbp_ofile_specified == MB_YES)
-		{
-		strcpy(relative_path, process->mbp_ofile);
-		status = mb_get_relative_path(verbose, relative_path, pwd, error);
-		fprintf(fp, "OUTFILE %s\n", relative_path);
-		}
-	    else
-		{
-		fprintf(fp, "## OUTFILE outfile\n");
-		}
-
-	    /* navigation merging */
-	    fprintf(fp, "##\n## Navigation Merging:\n");
-	    fprintf(fp, "NAVMODE %d\n", process->mbp_nav_mode);
-	    strcpy(relative_path, process->mbp_navfile);
-	    status = mb_get_relative_path(verbose, relative_path, pwd, error);
-	    fprintf(fp, "NAVFILE %s\n", relative_path);
-	    fprintf(fp, "NAVFORMAT %d\n", process->mbp_nav_format);
-	    fprintf(fp, "NAVHEADING %d\n", process->mbp_nav_heading);
-	    fprintf(fp, "NAVSPEED %d\n", process->mbp_nav_speed);
-	    fprintf(fp, "NAVDRAFT %d\n", process->mbp_nav_draft);
-	    fprintf(fp, "NAVATTITUDE %d\n", process->mbp_nav_attitude);
-	    fprintf(fp, "NAVINTERP %d\n", process->mbp_nav_algorithm);
-	    fprintf(fp, "NAVTIMESHIFT %f\n", process->mbp_nav_timeshift);
-
-	    /* navigation offsets and shifts */
-	    fprintf(fp, "##\n## Navigation Offsets and Shifts:\n");
-	    fprintf(fp, "NAVSHIFT %d\n", process->mbp_nav_shift);
-	    fprintf(fp, "NAVOFFSETX %f\n", process->mbp_nav_offsetx);
-	    fprintf(fp, "NAVOFFSETY %f\n", process->mbp_nav_offsety);
-	    fprintf(fp, "NAVOFFSETZ %f\n", process->mbp_nav_offsetz);
-	    fprintf(fp, "NAVSHIFTLON %f\n", process->mbp_nav_shiftlon);
-	    fprintf(fp, "NAVSHIFTLAT %f\n", process->mbp_nav_shiftlat);
-
-	    /* adjusted navigation merging */
-	    fprintf(fp, "##\n## Adjusted Navigation Merging:\n");
-	    fprintf(fp, "NAVADJMODE %d\n", process->mbp_navadj_mode);
-	    strcpy(relative_path, process->mbp_navadjfile);
-	    status = mb_get_relative_path(verbose, relative_path, pwd, error);
-	    fprintf(fp, "NAVADJFILE %s\n", relative_path);
-	    fprintf(fp, "NAVADJINTERP %d\n", process->mbp_navadj_algorithm);
-
-	    /* attitude merging */
-	    fprintf(fp, "##\n## Attitude Merging:\n");
-	    fprintf(fp, "ATTITUDEMODE %d\n", process->mbp_attitude_mode);
-	    strcpy(relative_path, process->mbp_attitudefile);
-	    status = mb_get_relative_path(verbose, relative_path, pwd, error);
-	    fprintf(fp, "ATTITUDEFILE %s\n", relative_path);
-	    fprintf(fp, "ATTITUDEFORMAT %d\n", process->mbp_attitude_format);
-
-	    /* sonardepth merging */
-	    fprintf(fp, "##\n## Sonardepth Merging:\n");
-	    fprintf(fp, "SONARDEPTHMODE %d\n", process->mbp_sonardepth_mode);
-	    strcpy(relative_path, process->mbp_sonardepthfile);
-	    status = mb_get_relative_path(verbose, relative_path, pwd, error);
-	    fprintf(fp, "SONARDEPTHFILE %s\n", relative_path);
-	    fprintf(fp, "SONARDEPTHFORMAT %d\n", process->mbp_sonardepth_format);
-
-	    /* data cutting */
-	    fprintf(fp, "##\n## Data cutting:\n");
-	    if (process->mbp_cut_num == 0)
-	    	fprintf(fp, "DATACUTCLEAR\n");
-	    else
-		{
-		for (i=0;i<process->mbp_cut_num;i++)
-	    		fprintf(fp, "DATACUT %d %d %f %f\n",
-				process->mbp_cut_kind[i],
-				process->mbp_cut_mode[i],
-				process->mbp_cut_min[i],
-				process->mbp_cut_max[i]);
-		}
-
-	    /* bathymetry editing */
-	    fprintf(fp, "##\n## Bathymetry Flagging:\n");
-	    fprintf(fp, "EDITSAVEMODE %d\n", process->mbp_edit_mode);
-	    strcpy(relative_path, process->mbp_editfile);
-	    status = mb_get_relative_path(verbose, relative_path, pwd, error);
-	    fprintf(fp, "EDITSAVEFILE %s\n", relative_path);
-
-	    /* bathymetry recalculation */
-	    fprintf(fp, "##\n## Bathymetry Recalculation:\n");
-	    fprintf(fp, "SVPMODE %d\n", process->mbp_svp_mode);
-	    strcpy(relative_path, process->mbp_svpfile);
-	    status = mb_get_relative_path(verbose, relative_path, pwd, error);
-	    fprintf(fp, "SVPFILE %s\n", relative_path);
-	    fprintf(fp, "SSVMODE %d\n", process->mbp_ssv_mode);
-	    fprintf(fp, "SSV %f\n", process->mbp_ssv);
-	    fprintf(fp, "TTMODE %d\n", process->mbp_tt_mode);
-	    fprintf(fp, "TTMULTIPLY %f\n", process->mbp_tt_mult);
-	    fprintf(fp, "ANGLEMODE %d\n", process->mbp_angle_mode);
-	    fprintf(fp, "SOUNDSPEEDREF %d\n", process->mbp_corrected);
-	    fprintf(fp, "STATICMODE %d\n", process->mbp_static_mode);
-	    strcpy(relative_path, process->mbp_staticfile);
-	    status = mb_get_relative_path(verbose, relative_path, pwd, error);
-	    fprintf(fp, "STATICFILE %s\n", relative_path);
-
-	    /* draft correction */
-	    fprintf(fp, "##\n## Draft Correction:\n");
-	    fprintf(fp, "DRAFTMODE %d\n", process->mbp_draft_mode);
-	    fprintf(fp, "DRAFT %f\n", process->mbp_draft);
-	    fprintf(fp, "DRAFTOFFSET %f\n", process->mbp_draft_offset);
-	    fprintf(fp, "DRAFTMULTIPLY %f\n", process->mbp_draft_mult);
-
-	    /* heave correction */
-	    fprintf(fp, "##\n## Heave Correction:\n");
-	    fprintf(fp, "HEAVEMODE %d\n", process->mbp_heave_mode);
-	    fprintf(fp, "HEAVEOFFSET %f\n", process->mbp_heave);
-	    fprintf(fp, "HEAVEMULTIPLY %f\n", process->mbp_heave_mult);
-
-	    /* lever correction */
-	    fprintf(fp, "##\n## Lever Correction:\n");
-	    fprintf(fp, "LEVERMODE %d\n", process->mbp_lever_mode);
-	    fprintf(fp, "VRUOFFSETX %f\n", process->mbp_vru_offsetx);
-	    fprintf(fp, "VRUOFFSETY %f\n", process->mbp_vru_offsety);
-	    fprintf(fp, "VRUOFFSETZ %f\n", process->mbp_vru_offsetz);
-	    fprintf(fp, "SONAROFFSETX %f\n", process->mbp_sonar_offsetx);
-	    fprintf(fp, "SONAROFFSETY %f\n", process->mbp_sonar_offsety);
-	    fprintf(fp, "SONAROFFSETZ %f\n", process->mbp_sonar_offsetz);
-
-	    /* roll correction */
-	    fprintf(fp, "##\n## Roll Correction:\n");
-	    fprintf(fp, "ROLLBIASMODE %d\n", process->mbp_rollbias_mode);
-	    fprintf(fp, "ROLLBIAS %f\n", process->mbp_rollbias);
-	    fprintf(fp, "ROLLBIASPORT %f\n", process->mbp_rollbias_port);
-	    fprintf(fp, "ROLLBIASSTBD %f\n", process->mbp_rollbias_stbd);
-
-	    /* pitch correction */
-	    fprintf(fp, "##\n## Pitch Correction:\n");
-	    fprintf(fp, "PITCHBIASMODE %d\n", process->mbp_pitchbias_mode);
-	    fprintf(fp, "PITCHBIAS %f\n", process->mbp_pitchbias);
-
-	    /* heading correction */
-	    fprintf(fp, "##\n## Heading Correction:\n");
-	    fprintf(fp, "HEADINGMODE %d\n", process->mbp_heading_mode);
-	    fprintf(fp, "HEADINGOFFSET %f\n", process->mbp_headingbias);
-
-	    /* tide correction */
-	    fprintf(fp, "##\n## Tide Correction:\n");
-	    fprintf(fp, "TIDEMODE %d\n", process->mbp_tide_mode);
-	    strcpy(relative_path, process->mbp_tidefile);
-	    status = mb_get_relative_path(verbose, relative_path, pwd, error);
-	    fprintf(fp, "TIDEFILE %s\n", relative_path);
-	    fprintf(fp, "TIDEFORMAT %d\n", process->mbp_tide_format);
-
-	    /* amplitude correction */
-	    fprintf(fp, "##\n## Amplitude Correction:\n");
-	    fprintf(fp, "AMPCORRMODE %d\n", process->mbp_ampcorr_mode);
-	    strcpy(relative_path, process->mbp_ampcorrfile);
-	    status = mb_get_relative_path(verbose, relative_path, pwd, error);
-	    fprintf(fp, "AMPCORRFILE %s\n", relative_path);
-	    fprintf(fp, "AMPCORRTYPE %d\n", process->mbp_ampcorr_type);
-	    fprintf(fp, "AMPCORRSYMMETRY %d\n", process->mbp_ampcorr_symmetry);
-	    fprintf(fp, "AMPCORRANGLE %f\n", process->mbp_ampcorr_angle);
-	    fprintf(fp, "AMPCORRSLOPE %d\n", process->mbp_ampcorr_slope);
-
-	    /* sidescan correction */
-	    fprintf(fp, "##\n## Sidescan Correction:\n");
-	    fprintf(fp, "SSCORRMODE %d\n", process->mbp_sscorr_mode);
-	    strcpy(relative_path, process->mbp_sscorrfile);
-	    status = mb_get_relative_path(verbose, relative_path, pwd, error);
-	    fprintf(fp, "SSCORRFILE %s\n", relative_path);
-	    fprintf(fp, "SSCORRTYPE %d\n", process->mbp_sscorr_type);
-	    fprintf(fp, "SSCORRSYMMETRY %d\n", process->mbp_sscorr_symmetry);
-	    fprintf(fp, "SSCORRANGLE %f\n", process->mbp_sscorr_angle);
-	    fprintf(fp, "SSCORRSLOPE %d\n", process->mbp_sscorr_slope);
-
-	    /* amplitude/sidescan topography correction */
-	    strcpy(relative_path, process->mbp_ampsscorr_topofile);
-	    status = mb_get_relative_path(verbose, relative_path, pwd, error);
-	    fprintf(fp, "AMPSSCORRTOPOFILE %s\n", relative_path);
-
-	    /* sidescan recalculation */
-	    fprintf(fp, "##\n## Sidescan Recalculation:\n");
-	    fprintf(fp, "SSRECALCMODE %d\n", process->mbp_ssrecalc_mode);
-	    fprintf(fp, "SSPIXELSIZE %f\n", process->mbp_ssrecalc_pixelsize);
-	    fprintf(fp, "SSSWATHWIDTH %f\n", process->mbp_ssrecalc_swathwidth);
-	    fprintf(fp, "SSINTERPOLATE %d\n", process->mbp_ssrecalc_interpolate);
-
-	    /* metadata insertion */
-	    fprintf(fp, "##\n## Metadata Insertion:\n");
-	    fprintf(fp, "METAVESSEL %s\n", process->mbp_meta_vessel);
-	    fprintf(fp, "METAINSTITUTION %s\n", process->mbp_meta_institution);
-	    fprintf(fp, "METAPLATFORM %s\n", process->mbp_meta_platform);
-	    fprintf(fp, "METASONAR %s\n", process->mbp_meta_sonar);
-	    fprintf(fp, "METASONARVERSION %s\n", process->mbp_meta_sonarversion);
-	    fprintf(fp, "METACRUISEID %s\n", process->mbp_meta_cruiseid);
-	    fprintf(fp, "METACRUISENAME %s\n", process->mbp_meta_cruisename);
-	    fprintf(fp, "METAPI %s\n", process->mbp_meta_pi);
-	    fprintf(fp, "METAPIINSTITUTION %s\n", process->mbp_meta_piinstitution);
-	    fprintf(fp, "METACLIENT %s\n", process->mbp_meta_client);
-	    fprintf(fp, "METASVCORRECTED %d\n", process->mbp_meta_svcorrected);
-	    fprintf(fp, "METATIDECORRECTED %d\n", process->mbp_meta_tidecorrected);
-	    fprintf(fp, "METABATHEDITMANUAL %d\n", process->mbp_meta_batheditmanual);
-	    fprintf(fp, "METABATHEDITAUTO %d\n", process->mbp_meta_batheditauto);
-	    fprintf(fp, "METAROLLBIAS %f\n", process->mbp_meta_rollbias);
-	    fprintf(fp, "METAPITCHBIAS %f\n", process->mbp_meta_pitchbias);
-	    fprintf(fp, "METAHEADINGBIAS %f\n", process->mbp_meta_headingbias);
-	    fprintf(fp, "METADRAFT %f\n", process->mbp_meta_draft);
-
-	    /* processing kluges */
-	    fprintf(fp, "##\n## Processing Kluges:\n");
-	    if (process->mbp_kluge001 == MB_YES)
-	    	fprintf(fp, "KLUGE001\n");
-	    if (process->mbp_kluge002 == MB_YES)
-	    	fprintf(fp, "KLUGE002\n");
-	    if (process->mbp_kluge003 == MB_YES)
-	    	fprintf(fp, "KLUGE003\n");
-	    if (process->mbp_kluge004 == MB_YES)
-	    	fprintf(fp, "KLUGE004\n");
-	    if (process->mbp_kluge005 == MB_YES)
-	    	fprintf(fp, "KLUGE005\n");
-	    if (process->mbp_kluge006 == MB_YES)
-	    	fprintf(fp, "KLUGE006\n");
-	    if (process->mbp_kluge007 == MB_YES)
-	    	fprintf(fp, "KLUGE007\n");
-	    if (process->mbp_kluge008 == MB_YES)
-	    	fprintf(fp, "KLUGE008\n");
-	    if (process->mbp_kluge009 == MB_YES)
-	    	fprintf(fp, "KLUGE009\n");
-	    if (process->mbp_kluge010 == MB_YES)
-	    	fprintf(fp, "KLUGE010\n");
-
-	    /* close file */
-	    fclose(fp);
-	    }
-
-	/* set error */
-	else
-	    {
-	    *error = MB_ERROR_OPEN_FAIL;
-	    status = MB_FAILURE;
-	    if (verbose > 0)
-		fprintf(stderr,"\nUnable to Open Parameter File <%s> for writing\n",parfile);
-	    }
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_pr_bathmode(int verbose, struct mb_process_struct *process,
-			int *error)
-{
-	char	*function_name = "mb_pr_bathmode";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:   %d\n",verbose);
-		fprintf(stderr,"dbg2       process:   %p\n",(void *)process);
-		}
-
-	/* figure out bathymetry recalculation mode */
-	if (process->mbp_svp_mode == MBP_SVP_ON)
-	    process->mbp_bathrecalc_mode = MBP_BATHRECALC_RAYTRACE;
-	else if (process->mbp_svp_mode != MBP_SVP_ON
-	    && (process->mbp_rollbias_mode != MBP_ROLLBIAS_OFF
-		|| process->mbp_pitchbias_mode != MBP_PITCHBIAS_OFF
-		|| process->mbp_nav_attitude != MBP_NAV_OFF
-		|| process->mbp_attitude_mode != MBP_ATTITUDE_OFF))
-	    process->mbp_bathrecalc_mode = MBP_BATHRECALC_ROTATE;
-	else if (process->mbp_svp_mode != MBP_SVP_ON
-	    && process->mbp_rollbias_mode == MBP_ROLLBIAS_OFF
-		&& (process->mbp_draft_mode != MBP_DRAFT_OFF
-		    || process->mbp_nav_draft != MBP_NAV_OFF
-		    || process->mbp_sonardepth_mode != MBP_SONARDEPTH_OFF
-		    || process->mbp_lever_mode != MBP_LEVER_OFF
-		    || process->mbp_svp_mode == MBP_SVP_SOUNDSPEEDREF))
-	    process->mbp_bathrecalc_mode = MBP_BATHRECALC_OFFSET;
-	else
-	    process->mbp_bathrecalc_mode = MBP_BATHRECALC_OFF;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_pr_default_output(int verbose, struct mb_process_struct *process,
-			int *error)
-{
-	char	*function_name = "mb_pr_default_output";
-	int	status = MB_SUCCESS;
-	char	fileroot[MBP_FILENAMESIZE];
-	int	format;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:             %d\n",verbose);
-		fprintf(stderr,"dbg2       process:             %p\n",(void *)process);
-		fprintf(stderr,"dbg2       mbp_ifile_specified: %d\n",process->mbp_ifile_specified);
-		fprintf(stderr,"dbg2       mbp_ifile:           %s\n",process->mbp_ifile);
-		fprintf(stderr,"dbg2       mbp_format_specified:%d\n",process->mbp_format_specified);
-		fprintf(stderr,"dbg2       mbp_format:          %d\n",process->mbp_format);
-		}
-
-	/* figure out data format and fileroot if possible */
-	status = mb_get_format(verbose, process->mbp_ifile,
-					fileroot, &format, error);
-
-	/* deal with format */
-	if (status == MB_SUCCESS && format > 0)
-	    {
-	    /* set format if found */
-	    if (process->mbp_format_specified == MB_NO)
-		{
-		process->mbp_format = format;
-		process->mbp_format_specified = MB_YES;
-		}
-
-	    /* set output file if needed */
-	    if (process->mbp_ofile_specified == MB_NO
-		&& process->mbp_format_specified == MB_YES)
-		{
-		/* use .txt suffix if MBARI ROV navigation */
-		if (process->mbp_format == MBF_MBARIROV)
-		    sprintf(process->mbp_ofile, "%sedited.txt",
-			    fileroot);
-		/* else use standard .mbXXX suffix */
-		else
-		    sprintf(process->mbp_ofile, "%sp.mb%d",
-			    fileroot, process->mbp_format);
-		process->mbp_ofile_specified = MB_YES;
-		}
-	    }
-	else if (process->mbp_ofile_specified == MB_NO
-		&& process->mbp_format_specified == MB_YES)
-	    {
-	    status = MB_SUCCESS;
-	    *error = MB_ERROR_NO_ERROR;
-	    strcpy(fileroot, process->mbp_ifile);
-	    if (strncmp(&process->mbp_ifile[strlen(process->mbp_ifile)-4], ".txt", 4) == 0)
-	    	fileroot[strlen(process->mbp_ifile)-4] = '\0';
-	    sprintf(process->mbp_ofile, "%sp.mb%d",
-			fileroot, process->mbp_format);
-	    process->mbp_ofile_specified = MB_YES;
-	    }
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       mbp_ofile_specified: %d\n",process->mbp_ofile_specified);
-		fprintf(stderr,"dbg2       mbp_ofile:           %s\n",process->mbp_ofile);
-		fprintf(stderr,"dbg2       mbp_format_specified:%d\n",process->mbp_format_specified);
-		fprintf(stderr,"dbg2       mbp_format:          %d\n",process->mbp_format);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_pr_get_output(int verbose, int *format,
-			char *ifile, char *ofile,
-			int *error)
-{
-	char	*function_name = "mb_pr_get_output";
-	int	status = MB_SUCCESS;
-	char	fileroot[MBP_FILENAMESIZE];
-	int	tformat;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:	%d\n",verbose);
-		fprintf(stderr,"dbg2       format:	%d\n",*format);
-		fprintf(stderr,"dbg2       ifile:	%s\n",ifile);
-		}
-
-	/* figure out data format and fileroot if possible */
-	status = mb_get_format(verbose, ifile,
-					fileroot, &tformat, error);
-
-	/* use fileroot if possible */
-	if (status == MB_SUCCESS)
-	    {
-	    /* set format if needed */
-	    if (*format <= 0)
-		*format = tformat;
-
-	    /* use .txt suffix if MBARI ROV navigation */
-	    if (*format == MBF_MBARIROV)
-		sprintf(ofile, "%sedited.txt",
-			fileroot);
-
-	    /* else use standard .mbXXX suffix */
-	    else
-		sprintf(ofile, "%sp.mb%d",
-			fileroot, *format);
-	    }
-
-	/* else just add suffix */
-	else if (*format > 0)
-	    {
-	    sprintf(ofile, "%sp.mb%d",
-			ifile, *format);
-	    status = MB_SUCCESS;
-	    *error = MB_ERROR_NO_ERROR;
-	    }
-
-	/* else failure */
-	else
-	    {
-	    sprintf(ofile, "%s.proc",
-		    ifile);
-	    }
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       format:	%d\n",*format);
-		fprintf(stderr,"dbg2       ofile:	%s\n",ofile);
-		fprintf(stderr,"dbg2       error:	%d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:	%d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_pr_check(int verbose, char *ifile,
-			int *nparproblem,
-			int *ndataproblem,
-			int *error)
-{
-	char	*function_name = "mb_pr_check";
-	int	status = MB_SUCCESS;
-	struct mb_process_struct process;
-	char	ofile[MBP_FILENAMESIZE];
-	int	format;
-	char	line[MB_PATH_MAXLINE];
-	FILE	*fp;
-	int	unexpected_format = MB_NO;
-	int	unexpected_output = MB_NO;
-	int	missing_ifile = MB_NO;
-	int	missing_ofile = MB_NO;
-	int	missing_navfile = MB_NO;
-	int	missing_navadjfile = MB_NO;
-	int	missing_attitudefile = MB_NO;
-	int	missing_sonardepthfile = MB_NO;
-	int	missing_svpfile = MB_NO;
-	int	missing_editfile = MB_NO;
-	int	missing_tidefile = MB_NO;
-	struct	stat statbuf;
-
-	/* output stream for basic stuff (stdout if verbose <= 1,
-		output if verbose > 1) */
-	FILE	*output;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:   %d\n",verbose);
-		fprintf(stderr,"dbg2       ifile:     %s\n",ifile);
-		}
-
-	/* set output stream */
-	if (verbose <= 1)
-		output = stdout;
-	else
-		output = stderr;
-
-	/* set no problem */
-	*nparproblem = 0;
-	*ndataproblem = 0;
-	unexpected_format = MB_NO;
-	unexpected_output = MB_NO;
-	missing_ifile = MB_NO;
-	missing_ofile = MB_NO;
-	missing_navfile = MB_NO;
-	missing_navadjfile = MB_NO;
-	missing_attitudefile = MB_NO;
-	missing_sonardepthfile = MB_NO;
-	missing_svpfile = MB_NO;
-	missing_editfile = MB_NO;
-	missing_tidefile = MB_NO;
-
-	/* check if input exists */
-	if (stat(ifile, &statbuf) != 0)
-	    {
-	    missing_ifile = MB_YES;
-	    (*nparproblem)++;
-	    }
-
-	/* only check parameter file if parameter file exists */
-	sprintf(ofile, "%s.par", ifile);
-	if (stat(ofile, &statbuf) == 0)
-	    {
-
-	    /* get known process parameters */
-	    status = mb_pr_readpar(verbose, ifile, MB_NO, &process, error);
-
-	    /* get default data format and output file */
-	    format = 0;
-	    status = mb_pr_get_output(verbose, &format, process.mbp_ifile,
-					    ofile, error);
-
-	    /* check data format */
-	    if (status == MB_SUCCESS
-		&& process.mbp_format_specified == MB_YES
-		&& format != 0
-		&& process.mbp_format != format)
-		{
-		unexpected_format = MB_YES;
-		(*nparproblem)++;
-
-		/* get output file with specified format */
-		status = mb_pr_get_output(verbose, &process.mbp_format, process.mbp_ifile,
-					    ofile, error);
-		}
-
-	    /* check output file */
-	    if (status == MB_SUCCESS
-		&& process.mbp_ofile_specified == MB_YES
-		&& format != 0)
-		{
-		if (strcmp(process.mbp_ofile, ofile) != 0)
-		    {
-		    unexpected_output = MB_YES;
-		    (*nparproblem)++;
-		    }
-		}
-
-	    /* check if output file specified but does not exist */
-	    if (process.mbp_ofile_specified == MB_YES
-		&& stat(process.mbp_ofile, &statbuf) != 0)
-		{
-		missing_ofile = MB_YES;
-		(*nparproblem)++;
-		}
-
-	    /* check if nav file specified but does not exist */
-	    if (process.mbp_nav_mode == MBP_NAV_ON
-		&& stat(process.mbp_navfile, &statbuf) != 0)
-		{
-		missing_navfile = MB_YES;
-		(*nparproblem)++;
-		}
-
-	    /* check if navadj file specified but does not exist */
-	    if (process.mbp_navadj_mode == MBP_NAV_ON
-		&& stat(process.mbp_navadjfile, &statbuf) != 0)
-		{
-		missing_navadjfile = MB_YES;
-		(*nparproblem)++;
-		}
-
-	    /* check if attitude file specified but does not exist */
-	    if (process.mbp_attitude_mode == MBP_ATTITUDE_ON
-		&& stat(process.mbp_attitudefile, &statbuf) != 0)
-		{
-		missing_attitudefile = MB_YES;
-		(*nparproblem)++;
-		}
-
-	    /* check if sonardepth file specified but does not exist */
-	    if (process.mbp_sonardepth_mode == MBP_SONARDEPTH_ON
-		&& stat(process.mbp_sonardepthfile, &statbuf) != 0)
-		{
-		missing_sonardepthfile = MB_YES;
-		(*nparproblem)++;
-		}
-
-	    /* check if svp file specified but does not exist */
-	    if (process.mbp_svp_mode == MBP_SVP_ON
-		&& stat(process.mbp_svpfile, &statbuf) != 0)
-		{
-		missing_svpfile = MB_YES;
-		(*nparproblem)++;
-		}
-
-	    /* check if edit file specified but does not exist */
-	    if (process.mbp_edit_mode == MBP_EDIT_ON
-		&& stat(process.mbp_editfile, &statbuf) != 0)
-		{
-		missing_editfile = MB_YES;
-		(*nparproblem)++;
-		}
-
-	    /* check if tide file specified but does not exist */
-	    if (process.mbp_tide_mode == MBP_TIDE_ON
-		&& stat(process.mbp_tidefile, &statbuf) != 0)
-		{
-		missing_tidefile = MB_YES;
-		(*nparproblem)++;
-		}
-	    }
-
-	/* only check inf file if inf file exists */
-	sprintf(ofile, "%s.inf", ifile);
-	if (stat(ofile, &statbuf) == 0)
-	    {
-	    /* open if possible */
-	    if ((fp = fopen(ofile,"r")) != NULL)
-		    {
-		    /* read the inf file */
-		    while (fgets(line, MB_PATH_MAXLINE, fp) != NULL)
-			{
-			if (strncmp(line, "PN: ", 4) == 0)
-			    {
-			    if (*ndataproblem == 0 && verbose > 0)
-			    	fprintf(output, "\nData File Problems: %s\n", ifile);
-			    fprintf(output, "%s: %s", ifile, &line[4]);
-			    (*ndataproblem)++;
-			    }
-			}
-		    }
-	    }
-
-
-	/* output results */
-	if (*nparproblem > 0 && verbose > 0)
-	    {
-	    fprintf(output, "\nParameter File Problems: %s\n", ifile);
-	    if (unexpected_format == MB_YES)
-		fprintf(output, "\tUnexpected format: %d instead of %d\n",
-			process.mbp_format, format);
-	    if (unexpected_output == MB_YES)
-		fprintf(output, "\tUnexpected output: %s instead of %s\n",
-			process.mbp_ofile, ofile);
-	    if (missing_ifile == MB_YES)
-		fprintf(output, "\tMissing input file: %s does not exist\n",
-			process.mbp_ifile);
-	    if (missing_ofile == MB_YES)
-		fprintf(output, "\tMissing output file: %s does not exist\n",
-			process.mbp_ofile);
-	    if (missing_navfile == MB_YES)
-		fprintf(output, "\tMissing nav file: %s does not exist\n",
-			process.mbp_navfile);
-	    if (missing_navadjfile == MB_YES)
-		fprintf(output, "\tMissing navadj file: %s does not exist\n",
-			process.mbp_navadjfile);
-	    if (missing_attitudefile == MB_YES)
-		fprintf(output, "\tMissing attitude file: %s does not exist\n",
-			process.mbp_attitudefile);
-	    if (missing_sonardepthfile == MB_YES)
-		fprintf(output, "\tMissing sonardepth file: %s does not exist\n",
-			process.mbp_sonardepthfile);
-	    if (missing_svpfile == MB_YES)
-		fprintf(output, "\tMissing svp file: %s does not exist\n",
-			process.mbp_svpfile);
-	    if (missing_editfile == MB_YES)
-		fprintf(output, "\tMissing edit file: %s does not exist\n",
-			process.mbp_editfile);
-	    if (missing_tidefile == MB_YES)
-		fprintf(output, "\tMissing tide file: %s does not exist\n",
-			process.mbp_tidefile);
-	    }
-	else if (*nparproblem > 0)
-	    {
-	    if (unexpected_format == MB_YES)
-		fprintf(output, "%s : Unexpected format : %d\n",
-			process.mbp_ifile, process.mbp_format);
-	    if (unexpected_output == MB_YES)
-		fprintf(output, "%s : Unexpected output : %s\n",
-			process.mbp_ifile, process.mbp_ofile);
-	    if (missing_ifile == MB_YES)
-		fprintf(output, "%s : Missing input file : %s\n",
-			process.mbp_ifile, process.mbp_ifile);
-	    if (missing_ofile == MB_YES)
-		fprintf(output, "%s : Missing output file : %s\n",
-			process.mbp_ifile, process.mbp_ofile);
-	    if (missing_navfile == MB_YES)
-		fprintf(output, "%s : Missing nav file : %s\n",
-			process.mbp_ifile, process.mbp_navfile);
-	    if (missing_navadjfile == MB_YES)
-		fprintf(output, "%s : Missing navadj file : %s\n",
-			process.mbp_ifile, process.mbp_navadjfile);
-	    if (missing_attitudefile == MB_YES)
-		fprintf(output, "%s : Missing attitude file : %s\n",
-			process.mbp_ifile, process.mbp_attitudefile);
-	    if (missing_sonardepthfile == MB_YES)
-		fprintf(output, "%s : Missing sonardepth file : %s\n",
-			process.mbp_ifile, process.mbp_sonardepthfile);
-	    if (missing_svpfile == MB_YES)
-		fprintf(output, "%s : Missing svp file : %s\n",
-			process.mbp_ifile, process.mbp_svpfile);
-	    if (missing_editfile == MB_YES)
-		fprintf(output, "%s : Missing edit file : %s\n",
-			process.mbp_ifile, process.mbp_editfile);
-	    if (missing_tidefile == MB_YES)
-		fprintf(output, "%s : Missing tide file : %s\n",
-			process.mbp_ifile, process.mbp_tidefile);
-	    }
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       nparproblem:  %d\n",*nparproblem);
-		fprintf(stderr,"dbg2       ndataproblem: %d\n",*ndataproblem);
-		fprintf(stderr,"dbg2       error:        %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:       %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_pr_update_ofile(int verbose, char *file,
-			int	mbp_ofile_specified,
-			char	*mbp_ofile,
-			int	*error)
-{
-	char	*function_name = "mb_pr_update_ofile";
-	struct mb_process_struct process;
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:             %d\n",verbose);
-		fprintf(stderr,"dbg2       file:                %s\n",file);
-		fprintf(stderr,"dbg2       mbp_ofile_specified: %d\n",mbp_ofile_specified);
-		fprintf(stderr,"dbg2       ofile:               %s\n",mbp_ofile);
-		}
-
-	/* get known process parameters */
-	status = mb_pr_readpar(verbose, file, MB_YES, &process, error);
-
-	/* set ofile value */
-	if (mbp_ofile != NULL)
-	    {
-	    strcpy(process.mbp_ofile, mbp_ofile);
-	    process.mbp_ofile_specified = mbp_ofile_specified;
-	    }
-	else
-	    {
-	    process.mbp_ofile[0] = '\0';
-	    process.mbp_ofile_specified = MB_NO;
-	    }
-
-	/* write new process parameter file */
-	status = mb_pr_writepar(verbose, file, &process, error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_pr_update_format(int verbose, char *file,
-			int mbp_format_specified,
-			int mbp_format,
-			int *error)
-{
-	char	*function_name = "mb_pr_update_format";
-	struct mb_process_struct process;
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:              %d\n",verbose);
-		fprintf(stderr,"dbg2       file:                 %s\n",file);
-		fprintf(stderr,"dbg2       mbp_format_specified: %d\n",mbp_format_specified);
-		fprintf(stderr,"dbg2       mbp_format:           %d\n",mbp_format);
-		}
-
-	/* get known process parameters */
-	status = mb_pr_readpar(verbose, file, MB_YES, &process, error);
-
-	/* set format value */
-	process.mbp_format_specified = mbp_format_specified;
-	process.mbp_format = mbp_format;
-
-	/* write new process parameter file */
-	status = mb_pr_writepar(verbose, file, &process, error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_pr_update_rollbias(int verbose, char *file,
-			int	mbp_rollbias_mode,
-			double	mbp_rollbias,
-			double	mbp_rollbias_port,
-			double	mbp_rollbias_stbd,
-			int *error)
-{
-	char	*function_name = "mb_pr_update_rollbias";
-	struct mb_process_struct process;
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:           %d\n",verbose);
-		fprintf(stderr,"dbg2       file:              %s\n",file);
-		fprintf(stderr,"dbg2       mbp_rollbias_mode: %d\n",mbp_rollbias_mode);
-		fprintf(stderr,"dbg2       mbp_rollbias:      %f\n",mbp_rollbias);
-		fprintf(stderr,"dbg2       mbp_rollbias_port: %f\n",mbp_rollbias_port);
-		fprintf(stderr,"dbg2       mbp_rollbias_stbd: %f\n",mbp_rollbias_stbd);
-		}
-
-	/* get known process parameters */
-	status = mb_pr_readpar(verbose, file, MB_YES, &process, error);
-
-	/* set rollbias values */
-	process.mbp_rollbias_mode = mbp_rollbias_mode;
-	process.mbp_rollbias = mbp_rollbias;
-	process.mbp_rollbias_port = mbp_rollbias_port;
-	process.mbp_rollbias_stbd = mbp_rollbias_stbd;
-
-	/* update bathymetry recalculation mode */
-	mb_pr_bathmode(verbose, &process, error);
-
-	/* write new process parameter file */
-	status = mb_pr_writepar(verbose, file, &process, error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_pr_update_pitchbias(int verbose, char *file,
-			int	mbp_pitchbias_mode,
-			double	mbp_pitchbias,
-			int *error)
-{
-	char	*function_name = "mb_pr_update_pitchbias";
-	struct mb_process_struct process;
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:           %d\n",verbose);
-		fprintf(stderr,"dbg2       file:              %s\n",file);
-		fprintf(stderr,"dbg2       mbp_pitchbias_mode: %d\n",mbp_pitchbias_mode);
-		fprintf(stderr,"dbg2       mbp_pitchbias:      %f\n",mbp_pitchbias);
-		}
-
-	/* get known process parameters */
-	status = mb_pr_readpar(verbose, file, MB_YES, &process, error);
-
-	/* set pitchbias values */
-	process.mbp_pitchbias_mode = mbp_pitchbias_mode;
-	process.mbp_pitchbias = mbp_pitchbias;
-
-	/* update bathymetry recalculation mode */
-	mb_pr_bathmode(verbose, &process, error);
-
-	/* write new process parameter file */
-	status = mb_pr_writepar(verbose, file, &process, error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_pr_update_draft(int verbose, char *file,
-			int	mbp_draft_mode,
-			double	mbp_draft,
-			double	mbp_draft_offset,
-			double	mbp_draft_mult,
-			int *error)
-{
-	char	*function_name = "mb_pr_update_draft";
-	struct mb_process_struct process;
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:           %d\n",verbose);
-		fprintf(stderr,"dbg2       file:              %s\n",file);
-		fprintf(stderr,"dbg2       mbp_draft_mode:    %d\n",mbp_draft_mode);
-		fprintf(stderr,"dbg2       mbp_draft:         %f\n",mbp_draft);
-		fprintf(stderr,"dbg2       mbp_draft_offset:  %f\n",mbp_draft_offset);
-		fprintf(stderr,"dbg2       mbp_draft_mult:    %f\n",mbp_draft_mult);
-		}
-
-	/* get known process parameters */
-	status = mb_pr_readpar(verbose, file, MB_YES, &process, error);
-
-	/* set draft values */
-	process.mbp_draft_mode = mbp_draft_mode;
-	process.mbp_draft = mbp_draft;
-	process.mbp_draft_offset = mbp_draft_offset;
-	process.mbp_draft_mult = mbp_draft_mult;
-
-	/* update bathymetry recalculation mode */
-	mb_pr_bathmode(verbose, &process, error);
-
-	/* write new process parameter file */
-	status = mb_pr_writepar(verbose, file, &process, error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_pr_update_heave(int verbose, char *file,
-			int	mbp_heave_mode,
-			double	mbp_heave,
-			double	mbp_heave_mult,
-			int *error)
-{
-	char	*function_name = "mb_pr_update_heave";
-	struct mb_process_struct process;
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:           %d\n",verbose);
-		fprintf(stderr,"dbg2       file:              %s\n",file);
-		fprintf(stderr,"dbg2       mbp_heave_mode:    %d\n",mbp_heave_mode);
-		fprintf(stderr,"dbg2       mbp_heave:         %f\n",mbp_heave);
-		fprintf(stderr,"dbg2       mbp_heave_mult:    %f\n",mbp_heave_mult);
-		}
-
-	/* get known process parameters */
-	status = mb_pr_readpar(verbose, file, MB_YES, &process, error);
-
-	/* set heave values */
-	process.mbp_heave_mode = mbp_heave_mode;
-	process.mbp_heave = mbp_heave;
-	process.mbp_heave_mult = mbp_heave_mult;
-
-	/* update bathymetry recalculation mode */
-	mb_pr_bathmode(verbose, &process, error);
-
-	/* write new process parameter file */
-	status = mb_pr_writepar(verbose, file, &process, error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_pr_update_lever(int verbose, char *file,
-			int	mbp_lever_mode,
-			double	mbp_vru_offsetx,
-			double	mbp_vru_offsety,
-			double	mbp_vru_offsetz,
-			double	mbp_sonar_offsetx,
-			double	mbp_sonar_offsety,
-			double	mbp_sonar_offsetz,
-			int *error)
-{
-	char	*function_name = "mb_pr_update_lever";
-	struct mb_process_struct process;
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:           %d\n",verbose);
-		fprintf(stderr,"dbg2       file:              %s\n",file);
-		fprintf(stderr,"dbg2       mbp_lever_mode:    %d\n",mbp_lever_mode);
-		fprintf(stderr,"dbg2       mbp_vru_offsetx:   %f\n",mbp_vru_offsetx);
-		fprintf(stderr,"dbg2       mbp_vru_offsety:   %f\n",mbp_vru_offsety);
-		fprintf(stderr,"dbg2       mbp_vru_offsetz:   %f\n",mbp_vru_offsetz);
-		fprintf(stderr,"dbg2       mbp_sonar_offsetx: %f\n",mbp_sonar_offsetx);
-		fprintf(stderr,"dbg2       mbp_sonar_offsety: %f\n",mbp_sonar_offsety);
-		fprintf(stderr,"dbg2       mbp_sonar_offsetz: %f\n",mbp_sonar_offsetz);
-		}
-
-	/* get known process parameters */
-	status = mb_pr_readpar(verbose, file, MB_YES, &process, error);
-
-	/* set lever values */
-	process.mbp_lever_mode = mbp_lever_mode;
-	process.mbp_vru_offsetx = mbp_vru_offsetx;
-	process.mbp_vru_offsety = mbp_vru_offsety;
-	process.mbp_vru_offsetz = mbp_vru_offsetz;
-	process.mbp_sonar_offsetx = mbp_sonar_offsetx;
-	process.mbp_sonar_offsety = mbp_sonar_offsety;
-	process.mbp_sonar_offsetz = mbp_sonar_offsetz;
-
-	/* update bathymetry recalculation mode */
-	mb_pr_bathmode(verbose, &process, error);
-
-	/* write new process parameter file */
-	status = mb_pr_writepar(verbose, file, &process, error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_pr_update_tide(int verbose, char *file,
-			int	mbp_tide_mode,
-			char *mbp_tidefile,
-			int	mbp_tide_format,
-			int *error)
-{
-	char	*function_name = "mb_pr_update_tide";
-	struct mb_process_struct process;
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:           %d\n",verbose);
-		fprintf(stderr,"dbg2       file:              %s\n",file);
-		fprintf(stderr,"dbg2       mbp_tide_mode:     %d\n",mbp_tide_mode);
-		fprintf(stderr,"dbg2       mbp_tidefile:      %s\n",mbp_tidefile);
-		fprintf(stderr,"dbg2       mbp_tide_format:   %d\n",mbp_tide_format);
-		}
-
-	/* get known process parameters */
-	status = mb_pr_readpar(verbose, file, MB_YES, &process, error);
-
-	/* set lever values */
-	process.mbp_tide_mode = mbp_tide_mode;
-	if (mbp_tidefile != NULL)
-		strcpy(process.mbp_tidefile,mbp_tidefile);
-	process.mbp_tide_format = mbp_tide_format;
-
-	/* update bathymetry recalculation mode */
-	mb_pr_bathmode(verbose, &process, error);
-
-	/* write new process parameter file */
-	status = mb_pr_writepar(verbose, file, &process, error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_pr_update_tt(int verbose, char *file,
-			int	mbp_tt_mode,
-			double	mbp_tt_mult,
-			int *error)
-{
-	char	*function_name = "mb_pr_update_tt";
-	struct mb_process_struct process;
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:           %d\n",verbose);
-		fprintf(stderr,"dbg2       file:              %s\n",file);
-		fprintf(stderr,"dbg2       mbp_tt_mode:       %d\n",mbp_tt_mode);
-		fprintf(stderr,"dbg2       mbp_tt_mult:       %f\n",mbp_tt_mult);
-		}
-
-	/* get known process parameters */
-	status = mb_pr_readpar(verbose, file, MB_YES, &process, error);
-
-	/* set tt values */
-	process.mbp_tt_mode = mbp_tt_mode;
-	process.mbp_tt_mult = mbp_tt_mult;
-
-	/* update bathymetry recalculation mode */
-	mb_pr_bathmode(verbose, &process, error);
-
-	/* write new process parameter file */
-	status = mb_pr_writepar(verbose, file, &process, error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_pr_update_ssv(int verbose, char *file,
-			int	mbp_ssv_mode,
-			double	mbp_ssv,
-			int *error)
-{
-	char	*function_name = "mb_pr_update_ssv";
-	struct mb_process_struct process;
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:           %d\n",verbose);
-		fprintf(stderr,"dbg2       file:              %s\n",file);
-		fprintf(stderr,"dbg2       mbp_ssv_mode:      %d\n",mbp_ssv_mode);
-		fprintf(stderr,"dbg2       mbp_ssv:           %f\n",mbp_ssv);
-		}
-
-	/* get known process parameters */
-	status = mb_pr_readpar(verbose, file, MB_YES, &process, error);
-
-	/* set ssv values */
-	process.mbp_ssv_mode = mbp_ssv_mode;
-	process.mbp_ssv = mbp_ssv;
-
-	/* update bathymetry recalculation mode */
-	mb_pr_bathmode(verbose, &process, error);
-
-	/* write new process parameter file */
-	status = mb_pr_writepar(verbose, file, &process, error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_pr_update_svp(int verbose, char *file,
-			int	mbp_svp_mode,
-			char	*mbp_svpfile,
-			int	mbp_angle_mode,
-			int	mbp_corrected,
-			int *error)
-{
-	char	*function_name = "mb_pr_update_svp";
-	struct mb_process_struct process;
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:           %d\n",verbose);
-		fprintf(stderr,"dbg2       file:              %s\n",file);
-		fprintf(stderr,"dbg2       mbp_svp_mode:      %d\n",mbp_svp_mode);
-		fprintf(stderr,"dbg2       mbp_svpfile:       %s\n",mbp_svpfile);
-		fprintf(stderr,"dbg2       mbp_angle_mode:    %d\n",mbp_angle_mode);
-		fprintf(stderr,"dbg2       mbp_corrected:     %d\n",mbp_corrected);
-		}
-
-	/* get known process parameters */
-	status = mb_pr_readpar(verbose, file, MB_YES, &process, error);
-
-	/* set svp values */
-	process.mbp_svp_mode = mbp_svp_mode;
-	if (mbp_svpfile != NULL)
-	    strcpy(process.mbp_svpfile, mbp_svpfile);
-	process.mbp_angle_mode = mbp_angle_mode;
-	process.mbp_corrected = mbp_corrected;
-
-	/* update bathymetry recalculation mode */
-	mb_pr_bathmode(verbose, &process, error);
-
-	/* write new process parameter file */
-	status = mb_pr_writepar(verbose, file, &process, error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_pr_update_static(int verbose, char *file,
-			int	mbp_static_mode,
-			char	*mbp_staticfile,
-			int *error)
-{
-	char	*function_name = "mb_pr_update_static";
-	struct mb_process_struct process;
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:           %d\n",verbose);
-		fprintf(stderr,"dbg2       file:              %s\n",file);
-		fprintf(stderr,"dbg2       mbp_static_mode:   %d\n",mbp_static_mode);
-		fprintf(stderr,"dbg2       mbp_staticfile:    %s\n",mbp_staticfile);
-		}
-
-	/* get known process parameters */
-	status = mb_pr_readpar(verbose, file, MB_YES, &process, error);
-
-	/* set svp values */
-	process.mbp_static_mode = mbp_static_mode;
-	if (mbp_staticfile != NULL)
-	    strcpy(process.mbp_staticfile, mbp_staticfile);
-
-	/* write new process parameter file */
-	status = mb_pr_writepar(verbose, file, &process, error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_pr_update_navadj(int verbose, char *file,
-			int	mbp_navadj_mode,
-			char	*mbp_navadjfile,
-			int	mbp_navadj_algorithm,
-			int *error)
-{
-	char	*function_name = "mb_pr_update_navadj";
-	struct mb_process_struct process;
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:              %d\n",verbose);
-		fprintf(stderr,"dbg2       file:                 %s\n",file);
-		fprintf(stderr,"dbg2       mbp_navadj_mode:      %d\n",mbp_navadj_mode);
-		fprintf(stderr,"dbg2       mbp_navadjfile:       %s\n",mbp_navadjfile);
-		fprintf(stderr,"dbg2       mbp_navadj_algorithm: %d\n",mbp_navadj_algorithm);
-		}
-
-	/* get known process parameters */
-	status = mb_pr_readpar(verbose, file, MB_YES, &process, error);
-
-	/* set navadj values */
-	process.mbp_navadj_mode = mbp_navadj_mode;
-	if (mbp_navadj_mode == MBP_NAV_OFF)
-		process.mbp_navadjfile[0] = '\0';
-	else if (mbp_navadjfile != NULL)
-	    strcpy(process.mbp_navadjfile, mbp_navadjfile);
-	process.mbp_navadj_algorithm = mbp_navadj_algorithm;
-
-	/* write new process parameter file */
-	status = mb_pr_writepar(verbose, file, &process, error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_pr_update_attitude(int verbose, char *file,
-			int	mbp_attitude_mode,
-			char *mbp_attitudefile,
-			int	mbp_attitude_format,
-			int *error)
-{
-	char	*function_name = "mb_pr_update_attitude";
-	struct mb_process_struct process;
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:           %d\n",verbose);
-		fprintf(stderr,"dbg2       file:              %s\n",file);
-		fprintf(stderr,"dbg2       mbp_attitude_mode: %d\n",mbp_attitude_mode);
-		fprintf(stderr,"dbg2       mbp_attitudefile:  %s\n",mbp_attitudefile);
-		fprintf(stderr,"dbg2       mbp_attitude_format:%d\n",mbp_attitude_format);
-		}
-
-	/* get known process parameters */
-	status = mb_pr_readpar(verbose, file, MB_YES, &process, error);
-
-	/* set lever values */
-	process.mbp_attitude_mode = mbp_attitude_mode;
-	if (mbp_attitudefile != NULL)
-		strcpy(process.mbp_attitudefile,mbp_attitudefile);
-	process.mbp_attitude_format = mbp_attitude_format;
-
-	/* update bathymetry recalculation mode */
-	mb_pr_bathmode(verbose, &process, error);
-
-	/* write new process parameter file */
-	status = mb_pr_writepar(verbose, file, &process, error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_pr_update_sonardepth(int verbose, char *file,
-			int	mbp_sonardepth_mode,
-			char *mbp_sonardepthfile,
-			int	mbp_sonardepth_format,
-			int *error)
-{
-	char	*function_name = "mb_pr_update_sonardepth";
-	struct mb_process_struct process;
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:               %d\n",verbose);
-		fprintf(stderr,"dbg2       file:                  %s\n",file);
-		fprintf(stderr,"dbg2       mbp_sonardepth_mode:   %d\n",mbp_sonardepth_mode);
-		fprintf(stderr,"dbg2       mbp_sonardepthfile:    %s\n",mbp_sonardepthfile);
-		fprintf(stderr,"dbg2       mbp_sonardepth_format: %d\n",mbp_sonardepth_format);
-		}
-
-	/* get known process parameters */
-	status = mb_pr_readpar(verbose, file, MB_YES, &process, error);
-
-	/* set lever values */
-	process.mbp_sonardepth_mode = mbp_sonardepth_mode;
-	if (mbp_sonardepthfile != NULL)
-		strcpy(process.mbp_sonardepthfile,mbp_sonardepthfile);
-	process.mbp_sonardepth_format = mbp_sonardepth_format;
-
-	/* update bathymetry recalculation mode */
-	mb_pr_bathmode(verbose, &process, error);
-
-	/* write new process parameter file */
-	status = mb_pr_writepar(verbose, file, &process, error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_pr_update_nav(int verbose, char *file,
-			int	mbp_nav_mode,
-			char	*mbp_navfile,
-			int	mbp_nav_format,
-			int	mbp_nav_heading,
-			int	mbp_nav_speed,
-			int	mbp_nav_draft,
-			int	mbp_nav_attitude,
-			int	mbp_nav_algorithm,
-			double mbp_nav_timeshift,
-			int *error)
-{
-	char	*function_name = "mb_pr_update_nav";
-	struct mb_process_struct process;
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:           %d\n",verbose);
-		fprintf(stderr,"dbg2       file:              %s\n",file);
-		fprintf(stderr,"dbg2       mbp_nav_mode:      %d\n",mbp_nav_mode);
-		fprintf(stderr,"dbg2       mbp_navfile:       %s\n",mbp_navfile);
-		fprintf(stderr,"dbg2       mbp_nav_format:    %d\n",mbp_nav_format);
-		fprintf(stderr,"dbg2       mbp_nav_heading:   %d\n",mbp_nav_heading);
-		fprintf(stderr,"dbg2       mbp_nav_speed:     %d\n",mbp_nav_speed);
-		fprintf(stderr,"dbg2       mbp_nav_draft:     %d\n",mbp_nav_draft);
-		fprintf(stderr,"dbg2       mbp_nav_attitude:  %d\n",mbp_nav_attitude);
-		fprintf(stderr,"dbg2       mbp_nav_algorithm: %d\n",mbp_nav_algorithm);
-		fprintf(stderr,"dbg2       mbp_nav_timeshift: %f\n",mbp_nav_timeshift);
-		}
-
-	/* get known process parameters */
-	status = mb_pr_readpar(verbose, file, MB_YES, &process, error);
-
-	/* set nav values */
-	process.mbp_nav_mode = mbp_nav_mode;
-	if (mbp_navfile != NULL)
-	    strcpy(process.mbp_navfile, mbp_navfile);
-	process.mbp_nav_format = mbp_nav_format;
-	process.mbp_nav_heading = mbp_nav_heading;
-	process.mbp_nav_speed = mbp_nav_speed;
-	process.mbp_nav_draft = mbp_nav_draft;
-	process.mbp_nav_attitude = mbp_nav_attitude;
-	process.mbp_nav_algorithm = mbp_nav_algorithm;
-	process.mbp_nav_timeshift = mbp_nav_timeshift;
-
-	/* write new process parameter file */
-	status = mb_pr_writepar(verbose, file, &process, error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_pr_update_navshift(int verbose, char *file,
-			int	mbp_nav_shift,
-			double	mbp_nav_offsetx,
-			double	mbp_nav_offsety,
-			double	mbp_nav_offsetz,
-			double	mbp_nav_shiftlon,
-			double	mbp_nav_shiftlat,
-			int *error)
-{
-	char	*function_name = "mb_pr_update_navshift";
-	struct mb_process_struct process;
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:           %d\n",verbose);
-		fprintf(stderr,"dbg2       file:              %s\n",file);
-		fprintf(stderr,"dbg2       mbp_nav_shift:     %d\n",mbp_nav_shift);
-		fprintf(stderr,"dbg2       mbp_nav_offsetx:   %f\n",mbp_nav_offsetx);
-		fprintf(stderr,"dbg2       mbp_nav_offsety:   %f\n",mbp_nav_offsety);
-		fprintf(stderr,"dbg2       mbp_nav_offsetz:   %f\n",mbp_nav_offsetz);
-		fprintf(stderr,"dbg2       mbp_nav_shiftlon:  %f\n",mbp_nav_shiftlon);
-		fprintf(stderr,"dbg2       mbp_nav_shiftlat:  %f\n",mbp_nav_shiftlat);
-		}
-
-	/* get known process parameters */
-	status = mb_pr_readpar(verbose, file, MB_YES, &process, error);
-
-	/* set nav values */
-	process.mbp_nav_shift = mbp_nav_shift;
-	process.mbp_nav_offsetx = mbp_nav_offsetx;
-	process.mbp_nav_offsety = mbp_nav_offsety;
-	process.mbp_nav_offsetz = mbp_nav_offsetz;
-	process.mbp_nav_shiftlon = mbp_nav_shiftlon;
-	process.mbp_nav_shiftlat = mbp_nav_shiftlat;
-
-	/* write new process parameter file */
-	status = mb_pr_writepar(verbose, file, &process, error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_pr_update_heading(int verbose, char *file,
-			int	mbp_heading_mode,
-			double	mbp_headingbias,
-			int *error)
-{
-	char	*function_name = "mb_pr_update_heading";
-	struct mb_process_struct process;
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:           %d\n",verbose);
-		fprintf(stderr,"dbg2       file:              %s\n",file);
-		fprintf(stderr,"dbg2       mbp_heading_mode:  %d\n",mbp_heading_mode);
-		fprintf(stderr,"dbg2       mbp_headingbias:   %f\n",mbp_headingbias);
-		}
-
-	/* get known process parameters */
-	status = mb_pr_readpar(verbose, file, MB_YES, &process, error);
-
-	/* set heading values */
-	process.mbp_heading_mode = mbp_heading_mode;
-	process.mbp_headingbias = mbp_headingbias;
-
-	/* write new process parameter file */
-	status = mb_pr_writepar(verbose, file, &process, error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_pr_update_datacut(int verbose, char *file,
-			int	mbp_cut_num,
-			int	*mbp_cut_kind,
-			int	*mbp_cut_mode,
-			double	*mbp_cut_min,
-			double	*mbp_cut_max,
-			int *error)
-{
-	char	*function_name = "mb_pr_update_datacut";
-	struct mb_process_struct process;
-	int	status = MB_SUCCESS;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:           %d\n",verbose);
-		fprintf(stderr,"dbg2       file:              %s\n",file);
-		fprintf(stderr,"dbg2       mbp_cut_num:       %d\n",mbp_cut_num);
-		for (i=0;i<mbp_cut_num;i++)
-			{
-			fprintf(stderr,"dbg2       mbp_cut_kind[%d]:   %d\n",i,mbp_cut_kind[i]);
-			fprintf(stderr,"dbg2       mbp_cut_mode[%d]:   %d\n",i,mbp_cut_mode[i]);
-			fprintf(stderr,"dbg2       mbp_cut_min[%d]:    %f\n",i,mbp_cut_min[i]);
-			fprintf(stderr,"dbg2       mbp_cut_max[%d]:    %f\n",i,mbp_cut_max[i]);
-			}
-		}
-
-	/* get known process parameters */
-	status = mb_pr_readpar(verbose, file, MB_YES, &process, error);
-
-	/* set datacut values */
-	process.mbp_cut_num = mbp_cut_num;
-	for (i=0;i<mbp_cut_num;i++)
-		{
-		process.mbp_cut_kind[i] = mbp_cut_kind[i];
-		process.mbp_cut_mode[i] = mbp_cut_mode[i];
-		process.mbp_cut_min[i] = mbp_cut_min[i];
-		process.mbp_cut_max[i] = mbp_cut_max[i];
-		}
-
-	/* write new process parameter file */
-	status = mb_pr_writepar(verbose, file, &process, error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_pr_update_edit(int verbose, char *file,
-			int	mbp_edit_mode,
-			char	*mbp_editfile,
-			int *error)
-{
-	char	*function_name = "mb_pr_update_edit";
-	struct mb_process_struct process;
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:           %d\n",verbose);
-		fprintf(stderr,"dbg2       file:              %s\n",file);
-		fprintf(stderr,"dbg2       mbp_edit_mode:     %d\n",mbp_edit_mode);
-		fprintf(stderr,"dbg2       mbp_editfile:      %s\n",mbp_editfile);
-		}
-
-	/* get known process parameters */
-	status = mb_pr_readpar(verbose, file, MB_YES, &process, error);
-
-	/* set edit values */
-	process.mbp_edit_mode = mbp_edit_mode;
-	if (mbp_editfile != NULL)
-		strcpy(process.mbp_editfile, mbp_editfile);
-
-	/* write new process parameter file */
-	status = mb_pr_writepar(verbose, file, &process, error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_pr_update_ampcorr(int verbose, char *file,
-			int	mbp_ampcorr_mode,
-			char	*mbp_ampcorrfile,
-			int	mbp_ampcorr_type,
-			int	mbp_ampcorr_symmetry,
-			double	mbp_ampcorr_angle,
-			int	mbp_ampcorr_slope,
-			char	*mbp_ampsscorr_topofile,
-			int *error)
-{
-	char	*function_name = "mb_pr_update_ampcorr";
-	struct mb_process_struct process;
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:                  %d\n",verbose);
-		fprintf(stderr,"dbg2       file:                     %s\n",file);
-		fprintf(stderr,"dbg2       mbp_ampcorr_mode:          %d\n",mbp_ampcorr_mode);
-		fprintf(stderr,"dbg2       mbp_ampcorrfile:           %s\n",mbp_ampcorrfile);
-		fprintf(stderr,"dbg2       mbp_ampcorr_type:          %d\n",mbp_ampcorr_type);
-		fprintf(stderr,"dbg2       mbp_ampcorr_symmetry:      %d\n",mbp_ampcorr_symmetry);
-		fprintf(stderr,"dbg2       mbp_ampcorr_angle:         %f\n",mbp_ampcorr_angle);
-		fprintf(stderr,"dbg2       mbp_ampcorr_slope:         %d\n",mbp_ampcorr_slope);
-		fprintf(stderr,"dbg2       mbp_ampsscorr_topofile:    %s\n",mbp_ampsscorr_topofile);
-		}
-
-	/* get known process parameters */
-	status = mb_pr_readpar(verbose, file, MB_YES, &process, error);
-
-	/* set ampcorr values */
-	process.mbp_ampcorr_mode = mbp_ampcorr_mode;
-	if (mbp_ampcorrfile != NULL)
-	    strcpy(process.mbp_ampcorrfile, mbp_ampcorrfile);
-	process.mbp_ampcorr_type = mbp_ampcorr_type;
-	process.mbp_ampcorr_symmetry = mbp_ampcorr_symmetry;
-	process.mbp_ampcorr_angle = mbp_ampcorr_angle;
-	process.mbp_ampcorr_slope = mbp_ampcorr_slope;
-	if (mbp_ampsscorr_topofile != NULL)
-	    strcpy(process.mbp_ampsscorr_topofile, mbp_ampsscorr_topofile);
-
-	/* write new process parameter file */
-	status = mb_pr_writepar(verbose, file, &process, error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:                    %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:                   %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_pr_update_sscorr(int verbose, char *file,
-			int	mbp_sscorr_mode,
-			char	*mbp_sscorrfile,
-			int	mbp_sscorr_type,
-			int	mbp_sscorr_symmetry,
-			double	mbp_sscorr_angle,
-			int	mbp_sscorr_slope,
-			char	*mbp_ampsscorr_topofile,
-			int *error)
-{
-	char	*function_name = "mb_pr_update_sscorr";
-	struct mb_process_struct process;
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:                  %d\n",verbose);
-		fprintf(stderr,"dbg2       file:                     %s\n",file);
-		fprintf(stderr,"dbg2       mbp_sscorr_mode:          %d\n",mbp_sscorr_mode);
-		fprintf(stderr,"dbg2       mbp_sscorrfile:           %s\n",mbp_sscorrfile);
-		fprintf(stderr,"dbg2       mbp_sscorr_type:          %d\n",mbp_sscorr_type);
-		fprintf(stderr,"dbg2       mbp_sscorr_symmetry:      %d\n",mbp_sscorr_symmetry);
-		fprintf(stderr,"dbg2       mbp_sscorr_angle:         %f\n",mbp_sscorr_angle);
-		fprintf(stderr,"dbg2       mbp_sscorr_slope:         %d\n",mbp_sscorr_slope);
-		fprintf(stderr,"dbg2       mbp_ampsscorr_topofile:   %s\n",mbp_ampsscorr_topofile);
-		}
-
-	/* get known process parameters */
-	status = mb_pr_readpar(verbose, file, MB_YES, &process, error);
-
-	/* set sscorr values */
-	process.mbp_sscorr_mode = mbp_sscorr_mode;
-	if (mbp_sscorrfile != NULL)
-	    strcpy(process.mbp_sscorrfile, mbp_sscorrfile);
-	process.mbp_sscorr_type = mbp_sscorr_type;
-	process.mbp_sscorr_symmetry = mbp_sscorr_symmetry;
-	process.mbp_sscorr_angle = mbp_sscorr_angle;
-	process.mbp_sscorr_slope = mbp_sscorr_slope;
-	if (mbp_ampsscorr_topofile != NULL)
-	    strcpy(process.mbp_ampsscorr_topofile, mbp_ampsscorr_topofile);
-
-	/* write new process parameter file */
-	status = mb_pr_writepar(verbose, file, &process, error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:                    %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:                   %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_pr_update_ssrecalc(int verbose, char *file,
-			int		mbp_ssrecalc_mode,
-			double	mbp_ssrecalc_pixelsize,
-			double	mbp_ssrecalc_swathwidth,
-			int		mbp_ssrecalc_interpolate,
-			int *error)
-{
-	char	*function_name = "mb_pr_update_ssrecalc";
-	struct mb_process_struct process;
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:                  %d\n",verbose);
-		fprintf(stderr,"dbg2       file:                     %s\n",file);
-		fprintf(stderr,"dbg2       mbp_ssrecalc_mode:        %d\n",mbp_ssrecalc_mode);
-		fprintf(stderr,"dbg2       mbp_ssrecalc_pixelsize:   %f\n",mbp_ssrecalc_pixelsize);
-		fprintf(stderr,"dbg2       mbp_ssrecalc_swathwidth:  %f\n",mbp_ssrecalc_swathwidth);
-		fprintf(stderr,"dbg2       mbp_ssrecalc_interpolate: %d\n",mbp_ssrecalc_interpolate);
-		}
-
-	/* get known process parameters */
-	status = mb_pr_readpar(verbose, file, MB_YES, &process, error);
-
-	/* set ssrecalc values */
-	process.mbp_ssrecalc_mode = mbp_ssrecalc_mode;
-	process.mbp_ssrecalc_pixelsize = mbp_ssrecalc_pixelsize;
-	process.mbp_ssrecalc_swathwidth = mbp_ssrecalc_swathwidth;
-	process.mbp_ssrecalc_interpolate = mbp_ssrecalc_interpolate;
-
-	/* write new process parameter file */
-	status = mb_pr_writepar(verbose, file, &process, error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:                    %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:                   %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_pr_update_metadata(int verbose, char *file,
-			char	*mbp_meta_vessel,
-			char	*mbp_meta_institution,
-			char	*mbp_meta_platform,
-			char	*mbp_meta_sonar,
-			char	*mbp_meta_sonarversion,
-			char	*mbp_meta_cruiseid,
-			char	*mbp_meta_cruisename,
-			char	*mbp_meta_pi,
-			char	*mbp_meta_piinstitution,
-			char	*mbp_meta_client,
-			int	mbp_meta_svcorrected,
-			int	mbp_meta_tidecorrected,
-			int	mbp_meta_batheditmanual,
-			int	mbp_meta_batheditauto,
-			double	mbp_meta_rollbias,
-			double	mbp_meta_pitchbias,
-			double	mbp_meta_headingbias,
-			double	mbp_meta_draft,
-			int *error)
-{
-	char	*function_name = "mb_pr_update_metadata";
-	struct mb_process_struct process;
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:                  %d\n",verbose);
-		fprintf(stderr,"dbg2       file:                     %s\n",file);
-		fprintf(stderr,"dbg2       mbp_meta_vessel:          %s\n",process.mbp_meta_vessel);
-		fprintf(stderr,"dbg2       mbp_meta_institution:     %s\n",process.mbp_meta_institution);
-		fprintf(stderr,"dbg2       mbp_meta_platform:        %s\n",process.mbp_meta_platform);
-		fprintf(stderr,"dbg2       mbp_meta_sonar:           %s\n",process.mbp_meta_sonar);
-		fprintf(stderr,"dbg2       mbp_meta_sonarversion:    %s\n",process.mbp_meta_sonarversion);
-		fprintf(stderr,"dbg2       mbp_meta_cruiseid:        %s\n",process.mbp_meta_cruiseid);
-		fprintf(stderr,"dbg2       mbp_meta_cruisename:      %s\n",process.mbp_meta_cruisename);
-		fprintf(stderr,"dbg2       mbp_meta_p:i              %s\n",process.mbp_meta_pi);
-		fprintf(stderr,"dbg2       mbp_meta_piinstitution:   %s\n",process.mbp_meta_piinstitution);
-		fprintf(stderr,"dbg2       mbp_meta_client:          %s\n",process.mbp_meta_client);
-		fprintf(stderr,"dbg2       mbp_meta_svcorrected:     %d\n",process.mbp_meta_svcorrected);
-		fprintf(stderr,"dbg2       mbp_meta_tidecorrected    %d\n",process.mbp_meta_tidecorrected);
-		fprintf(stderr,"dbg2       mbp_meta_batheditmanual   %d\n",process.mbp_meta_batheditmanual);
-		fprintf(stderr,"dbg2       mbp_meta_batheditauto:    %d\n",process.mbp_meta_batheditauto);
-		fprintf(stderr,"dbg2       mbp_meta_rollbias:        %f\n",process.mbp_meta_rollbias);
-		fprintf(stderr,"dbg2       mbp_meta_pitchbias:       %f\n",process.mbp_meta_pitchbias);
-		fprintf(stderr,"dbg2       mbp_meta_headingbias:     %f\n",process.mbp_meta_headingbias);
-		fprintf(stderr,"dbg2       mbp_meta_draft:           %f\n",process.mbp_meta_draft);
-		}
-
-	/* get known process parameters */
-	status = mb_pr_readpar(verbose, file, MB_YES, &process, error);
-
-	/* set metadata values */
-	strcpy(process.mbp_meta_vessel,mbp_meta_vessel);
-	strcpy(process.mbp_meta_institution,mbp_meta_institution);
-	strcpy(process.mbp_meta_platform,mbp_meta_platform);
-	strcpy(process.mbp_meta_sonar,mbp_meta_sonar);
-	strcpy(process.mbp_meta_sonarversion,mbp_meta_sonarversion);
-	strcpy(process.mbp_meta_cruiseid,mbp_meta_cruiseid);
-	strcpy(process.mbp_meta_cruisename,mbp_meta_cruisename);
-	strcpy(process.mbp_meta_pi,mbp_meta_pi);
-	strcpy(process.mbp_meta_piinstitution,mbp_meta_piinstitution);
-	strcpy(process.mbp_meta_client,mbp_meta_client);
-        process.mbp_meta_svcorrected = mbp_meta_svcorrected;
-        process.mbp_meta_tidecorrected = mbp_meta_tidecorrected;
-        process.mbp_meta_batheditmanual = mbp_meta_batheditmanual;
-        process.mbp_meta_batheditauto = mbp_meta_batheditauto;
-        process.mbp_meta_rollbias = mbp_meta_rollbias;
-        process.mbp_meta_pitchbias = mbp_meta_pitchbias;
-        process.mbp_meta_headingbias = mbp_meta_headingbias;
-        process.mbp_meta_draft = mbp_meta_draft;
-
-	/* write new process parameter file */
-	status = mb_pr_writepar(verbose, file, &process, error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:                    %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:                   %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_pr_update_kluges(int verbose, char *file,
-			int	mbp_kluge001,
-			int	mbp_kluge002,
-			int	mbp_kluge003,
-			int	mbp_kluge004,
-			int	mbp_kluge005,
-			int	mbp_kluge006,
-			int	mbp_kluge007,
-			int	mbp_kluge008,
-			int	mbp_kluge009,
-			int	mbp_kluge010,
-			int *error)
-{
-	char	*function_name = "mb_pr_update_kluges";
-	struct mb_process_struct process;
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:                  %d\n",verbose);
-		fprintf(stderr,"dbg2       file:                     %s\n",file);
-		fprintf(stderr,"dbg2       mbp_kluge001:             %d\n",mbp_kluge001);
-		fprintf(stderr,"dbg2       mbp_kluge002:             %d\n",mbp_kluge002);
-		fprintf(stderr,"dbg2       mbp_kluge003:             %d\n",mbp_kluge003);
-		fprintf(stderr,"dbg2       mbp_kluge004:             %d\n",mbp_kluge004);
-		fprintf(stderr,"dbg2       mbp_kluge005:             %d\n",mbp_kluge005);
-		fprintf(stderr,"dbg2       mbp_kluge006:             %d\n",mbp_kluge006);
-		fprintf(stderr,"dbg2       mbp_kluge007:             %d\n",mbp_kluge007);
-		fprintf(stderr,"dbg2       mbp_kluge008:             %d\n",mbp_kluge008);
-		fprintf(stderr,"dbg2       mbp_kluge009:             %d\n",mbp_kluge009);
-		fprintf(stderr,"dbg2       mbp_kluge010:             %d\n",mbp_kluge010);
-		}
-
-	/* get known process parameters */
-	status = mb_pr_readpar(verbose, file, MB_YES, &process, error);
-
-	/* set metadata values */
-        process.mbp_kluge001 = mbp_kluge001;
-        process.mbp_kluge002 = mbp_kluge002;
-        process.mbp_kluge003 = mbp_kluge003;
-        process.mbp_kluge004 = mbp_kluge004;
-        process.mbp_kluge005 = mbp_kluge005;
-        process.mbp_kluge006 = mbp_kluge006;
-        process.mbp_kluge007 = mbp_kluge007;
-        process.mbp_kluge008 = mbp_kluge008;
-        process.mbp_kluge009 = mbp_kluge009;
-        process.mbp_kluge010 = mbp_kluge010;
-
-	/* write new process parameter file */
-	status = mb_pr_writepar(verbose, file, &process, error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:                    %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:                   %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_pr_get_ofile(int verbose, char *file,
-			int	*mbp_ofile_specified,
-			char	*mbp_ofile,
-			int	*error)
-{
-	char	*function_name = "mb_pr_get_ofile";
-	int	status = MB_SUCCESS;
-	char	parfile[MBP_FILENAMESIZE];
-	char	buffer[MBP_FILENAMESIZE], dummy[MBP_FILENAMESIZE], *result;
-	FILE	*fp;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:             %d\n",verbose);
-		fprintf(stderr,"dbg2       file:                %s\n",file);
-		}
-
-	/* this function looks for the output filename directly
-	 * rather than by calling mb_pr_readpar() in order to
-	 * speed up mbgrid and other programs that parse large
-	 * datalists looking for processed files
-	 */
-
-	/* get expected process parameter file name */
-	strcpy(parfile, file);
-	strcat(parfile, ".par");
-
-	/* open and read parameter file */
-	*mbp_ofile_specified = MB_NO;
-	if (mbp_ofile != NULL)
-	    mbp_ofile[0] = '\0';
-	if ((fp = fopen(parfile, "r")) != NULL)
-	    {
-	    while ((result = fgets(buffer,MBP_FILENAMESIZE,fp)) == buffer
-		&& *mbp_ofile_specified == MB_NO)
-		{
-		if (strncmp(buffer, "OUTFILE", 7) == 0)
-		    {
-		    sscanf(buffer, "%s %s", dummy, mbp_ofile);
-		    *mbp_ofile_specified = MB_YES;
-		    }
-		}
-
-	    /* close file */
-	    fclose(fp);
-	    }
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       mbp_ofile_specified: %d\n",*mbp_ofile_specified);
-		fprintf(stderr,"dbg2       ofile:               %s\n",mbp_ofile);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_pr_get_format(int verbose, char *file,
-			int *mbp_format_specified,
-			int *mbp_format,
-			int *error)
-{
-	char	*function_name = "mb_pr_get_format";
-	struct mb_process_struct process;
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:              %d\n",verbose);
-		fprintf(stderr,"dbg2       file:                 %s\n",file);
-		}
-
-	/* get known process parameters */
-	status = mb_pr_readpar(verbose, file, MB_YES, &process, error);
-
-	/* set format value */
-	*mbp_format_specified = process.mbp_format_specified;
-	*mbp_format = process.mbp_format;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       mbp_format_specified: %d\n",*mbp_format_specified);
-		fprintf(stderr,"dbg2       mbp_format:           %d\n",*mbp_format);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_pr_get_rollbias(int verbose, char *file,
-			int	*mbp_rollbias_mode,
-			double	*mbp_rollbias,
-			double	*mbp_rollbias_port,
-			double	*mbp_rollbias_stbd,
-			int *error)
-{
-	char	*function_name = "mb_pr_get_rollbias";
-	struct mb_process_struct process;
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:           %d\n",verbose);
-		fprintf(stderr,"dbg2       file:              %s\n",file);
-		}
-
-	/* get known process parameters */
-	status = mb_pr_readpar(verbose, file, MB_YES, &process, error);
-
-	/* set rollbias values */
-	*mbp_rollbias_mode = process.mbp_rollbias_mode;
-	*mbp_rollbias = process.mbp_rollbias;
-	*mbp_rollbias_port = process.mbp_rollbias_port;
-	*mbp_rollbias_stbd = process.mbp_rollbias_stbd;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       mbp_rollbias_mode: %d\n",*mbp_rollbias_mode);
-		fprintf(stderr,"dbg2       mbp_rollbias:      %f\n",*mbp_rollbias);
-		fprintf(stderr,"dbg2       mbp_rollbias_port: %f\n",*mbp_rollbias_port);
-		fprintf(stderr,"dbg2       mbp_rollbias_stbd: %f\n",*mbp_rollbias_stbd);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_pr_get_pitchbias(int verbose, char *file,
-			int	*mbp_pitchbias_mode,
-			double	*mbp_pitchbias,
-			int *error)
-{
-	char	*function_name = "mb_pr_get_pitchbias";
-	struct mb_process_struct process;
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:           %d\n",verbose);
-		fprintf(stderr,"dbg2       file:              %s\n",file);
-		}
-
-	/* get known process parameters */
-	status = mb_pr_readpar(verbose, file, MB_YES, &process, error);
-
-	/* set pitchbias values */
-	*mbp_pitchbias_mode = process.mbp_pitchbias_mode;
-	*mbp_pitchbias = process.mbp_pitchbias;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       mbp_pitchbias_mode: %d\n",*mbp_pitchbias_mode);
-		fprintf(stderr,"dbg2       mbp_pitchbias:      %f\n",*mbp_pitchbias);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_pr_get_draft(int verbose, char *file,
-			int	*mbp_draft_mode,
-			double	*mbp_draft,
-			double	*mbp_draft_offset,
-			double	*mbp_draft_mult,
-			int *error)
-{
-	char	*function_name = "mb_pr_get_draft";
-	struct mb_process_struct process;
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:           %d\n",verbose);
-		fprintf(stderr,"dbg2       file:              %s\n",file);
-		}
-
-	/* get known process parameters */
-	status = mb_pr_readpar(verbose, file, MB_YES, &process, error);
-
-	/* set draft values */
-	*mbp_draft_mode = process.mbp_draft_mode;
-	*mbp_draft = process.mbp_draft;
-	*mbp_draft_offset = process.mbp_draft_offset;
-	*mbp_draft_mult = process.mbp_draft_mult;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       mbp_draft_mode:    %d\n",*mbp_draft_mode);
-		fprintf(stderr,"dbg2       mbp_draft:         %f\n",*mbp_draft);
-		fprintf(stderr,"dbg2       mbp_draft_offset:  %f\n",*mbp_draft_offset);
-		fprintf(stderr,"dbg2       mbp_draft_mult:    %f\n",*mbp_draft_mult);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_pr_get_heave(int verbose, char *file,
-			int	*mbp_heave_mode,
-			double	*mbp_heave,
-			double	*mbp_heave_mult,
-			int *error)
-{
-	char	*function_name = "mb_pr_get_heave";
-	struct mb_process_struct process;
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:           %d\n",verbose);
-		fprintf(stderr,"dbg2       file:              %s\n",file);
-		}
-
-	/* get known process parameters */
-	status = mb_pr_readpar(verbose, file, MB_YES, &process, error);
-
-	/* set heave values */
-	*mbp_heave_mode = process.mbp_heave_mode;
-	*mbp_heave = process.mbp_heave;
-	*mbp_heave_mult = process.mbp_heave_mult;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       mbp_heave_mode:    %d\n",*mbp_heave_mode);
-		fprintf(stderr,"dbg2       mbp_heave:         %f\n",*mbp_heave);
-		fprintf(stderr,"dbg2       mbp_heave_mult:    %f\n",*mbp_heave_mult);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_pr_get_lever(int verbose, char *file,
-			int	*mbp_lever_mode,
-			double	*mbp_vru_offsetx,
-			double	*mbp_vru_offsety,
-			double	*mbp_vru_offsetz,
-			double	*mbp_sonar_offsetx,
-			double	*mbp_sonar_offsety,
-			double	*mbp_sonar_offsetz,
-			int *error)
-{
-	char	*function_name = "mb_pr_get_lever";
-	struct mb_process_struct process;
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:           %d\n",verbose);
-		fprintf(stderr,"dbg2       file:              %s\n",file);
-		}
-
-	/* get known process parameters */
-	status = mb_pr_readpar(verbose, file, MB_YES, &process, error);
-
-	/* set lever values */
-	*mbp_lever_mode = process.mbp_lever_mode;
-	*mbp_vru_offsetx = process.mbp_vru_offsetx;
-	*mbp_vru_offsety = process.mbp_vru_offsety;
-	*mbp_vru_offsetz = process.mbp_vru_offsetz;
-	*mbp_sonar_offsetx = process.mbp_sonar_offsetx;
-	*mbp_sonar_offsety = process.mbp_sonar_offsety;
-	*mbp_sonar_offsetz = process.mbp_sonar_offsetz;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       mbp_lever_mode:    %d\n",*mbp_lever_mode);
-		fprintf(stderr,"dbg2       mbp_vru_offsetx:   %f\n",*mbp_vru_offsetx);
-		fprintf(stderr,"dbg2       mbp_vru_offsety:   %f\n",*mbp_vru_offsety);
-		fprintf(stderr,"dbg2       mbp_vru_offsetz:   %f\n",*mbp_vru_offsetz);
-		fprintf(stderr,"dbg2       mbp_sonar_offsetx:   %f\n",*mbp_sonar_offsetx);
-		fprintf(stderr,"dbg2       mbp_sonar_offsety:   %f\n",*mbp_sonar_offsety);
-		fprintf(stderr,"dbg2       mbp_sonar_offsetz:   %f\n",*mbp_sonar_offsetz);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_pr_get_tide(int verbose, char *file,
-			int	*mbp_tide_mode,
-			char *mbp_tidefile,
-			int	*mbp_tide_format,
-			int *error)
-{
-	char	*function_name = "mb_pr_get_tide";
-	struct mb_process_struct process;
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:           %d\n",verbose);
-		fprintf(stderr,"dbg2       file:              %s\n",file);
-		}
-
-	/* get known process parameters */
-	status = mb_pr_readpar(verbose, file, MB_YES, &process, error);
-
-	/* set lever values */
-	*mbp_tide_mode = process.mbp_tide_mode;
-	if (mbp_tidefile != NULL)
-		strcpy(mbp_tidefile,process.mbp_tidefile);
-	*mbp_tide_format = process.mbp_tide_format;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       mbp_tide_mode:     %d\n",*mbp_tide_mode);
-		fprintf(stderr,"dbg2       mbp_tidefile:      %s\n",mbp_tidefile);
-		fprintf(stderr,"dbg2       mbp_tide_format:   %d\n",*mbp_tide_format);
-		fprintf(stderr,"dbg2       error:             %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:            %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_pr_get_tt(int verbose, char *file,
-			int	*mbp_tt_mode,
-			double	*mbp_tt_mult,
-			int *error)
-{
-	char	*function_name = "mb_pr_get_tt";
-	struct mb_process_struct process;
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:           %d\n",verbose);
-		fprintf(stderr,"dbg2       file:              %s\n",file);
-		}
-
-	/* get known process parameters */
-	status = mb_pr_readpar(verbose, file, MB_YES, &process, error);
-
-	/* set tt values */
-	*mbp_tt_mode = process.mbp_tt_mode;
-	*mbp_tt_mult = process.mbp_tt_mult;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       mbp_tt_mode:       %d\n",*mbp_tt_mode);
-		fprintf(stderr,"dbg2       mbp_tt_mult:       %f\n",*mbp_tt_mult);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_pr_get_ssv(int verbose, char *file,
-			int	*mbp_ssv_mode,
-			double	*mbp_ssv,
-			int *error)
-{
-	char	*function_name = "mb_pr_get_ssv";
-	struct mb_process_struct process;
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:           %d\n",verbose);
-		fprintf(stderr,"dbg2       file:              %s\n",file);
-		}
-
-	/* get known process parameters */
-	status = mb_pr_readpar(verbose, file, MB_YES, &process, error);
-
-	/* set ssv values */
-	*mbp_ssv_mode = process.mbp_ssv_mode;
-	*mbp_ssv = process.mbp_ssv;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       mbp_ssv_mode:      %d\n",*mbp_ssv_mode);
-		fprintf(stderr,"dbg2       mbp_ssv:           %f\n",*mbp_ssv);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_pr_get_svp(int verbose, char *file,
-			int	*mbp_svp_mode,
-			char	*mbp_svpfile,
-			int	*mbp_angle_mode,
-			int	*mbp_corrected,
-			int *error)
-{
-	char	*function_name = "mb_pr_get_svp";
-	struct mb_process_struct process;
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:           %d\n",verbose);
-		fprintf(stderr,"dbg2       file:              %s\n",file);
-		}
-
-	/* get known process parameters */
-	status = mb_pr_readpar(verbose, file, MB_YES, &process, error);
-
-	/* set svp values */
-	*mbp_svp_mode = process.mbp_svp_mode;
-	if (mbp_svpfile != NULL)
-	    strcpy(mbp_svpfile, process.mbp_svpfile);
-	*mbp_angle_mode = process.mbp_angle_mode;
-	*mbp_corrected = process.mbp_corrected;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       mbp_svp_mode:      %d\n",*mbp_svp_mode);
-		fprintf(stderr,"dbg2       mbp_svpfile:       %s\n",mbp_svpfile);
-		fprintf(stderr,"dbg2       mbp_angle_mode:    %d\n",*mbp_angle_mode);
-		fprintf(stderr,"dbg2       mbp_corrected:     %d\n",*mbp_corrected);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_pr_get_static(int verbose, char *file,
-			int	*mbp_static_mode,
-			char	*mbp_staticfile,
-			int *error)
-{
-	char	*function_name = "mb_pr_get_static";
-	struct mb_process_struct process;
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:           %d\n",verbose);
-		fprintf(stderr,"dbg2       file:              %s\n",file);
-		}
-
-	/* get known process parameters */
-	status = mb_pr_readpar(verbose, file, MB_YES, &process, error);
-
-	/* set svp values */
-	*mbp_static_mode = process.mbp_static_mode;
-	if (mbp_staticfile != NULL)
-	    strcpy(mbp_staticfile, process.mbp_staticfile);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       mbp_static_mode:   %d\n",*mbp_static_mode);
-		fprintf(stderr,"dbg2       mbp_staticfile:    %s\n",mbp_staticfile);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_pr_get_navadj(int verbose, char *file,
-			int	*mbp_navadj_mode,
-			char	*mbp_navadjfile,
-			int	*mbp_navadj_algorithm,
-			int *error)
-{
-	char	*function_name = "mb_pr_get_navadj";
-	struct mb_process_struct process;
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:              %d\n",verbose);
-		fprintf(stderr,"dbg2       file:                 %s\n",file);
-		}
-
-	/* get known process parameters */
-	status = mb_pr_readpar(verbose, file, MB_YES, &process, error);
-
-	/* set navadj values */
-	*mbp_navadj_mode = process.mbp_navadj_mode;
-	if (mbp_navadjfile != NULL)
-	    strcpy(mbp_navadjfile, process.mbp_navadjfile);
-	*mbp_navadj_algorithm = process.mbp_navadj_algorithm;
-
-	/* write new process parameter file */
-	status = mb_pr_writepar(verbose, file, &process, error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       mbp_navadj_mode:      %d\n",*mbp_navadj_mode);
-		fprintf(stderr,"dbg2       mbp_navadjfile:       %s\n",mbp_navadjfile);
-		fprintf(stderr,"dbg2       mbp_navadj_algorithm: %d\n",*mbp_navadj_algorithm);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_pr_get_attitude(int verbose, char *file,
-			int	*mbp_attitude_mode,
-			char *mbp_attitudefile,
-			int	*mbp_attitude_format,
-			int *error)
-{
-	char	*function_name = "mb_pr_get_attitude";
-	struct mb_process_struct process;
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:           %d\n",verbose);
-		fprintf(stderr,"dbg2       file:              %s\n",file);
-		}
-
-	/* get known process parameters */
-	status = mb_pr_readpar(verbose, file, MB_YES, &process, error);
-
-	/* set lever values */
-	*mbp_attitude_mode = process.mbp_attitude_mode;
-	if (mbp_attitudefile != NULL)
-		strcpy(mbp_attitudefile,process.mbp_attitudefile);
-	*mbp_attitude_format = process.mbp_attitude_format;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       mbp_attitude_mode: %d\n",*mbp_attitude_mode);
-		fprintf(stderr,"dbg2       mbp_attitudefile:  %s\n",mbp_attitudefile);
-		fprintf(stderr,"dbg2       mbp_attitude_format:%d\n",*mbp_attitude_format);
-		fprintf(stderr,"dbg2       error:             %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:            %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_pr_get_sonardepth(int verbose, char *file,
-			int	*mbp_sonardepth_mode,
-			char *mbp_sonardepthfile,
-			int	*mbp_sonardepth_format,
-			int *error)
-{
-	char	*function_name = "mb_pr_get_sonardepth";
-	struct mb_process_struct process;
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:           %d\n",verbose);
-		fprintf(stderr,"dbg2       file:              %s\n",file);
-		}
-
-	/* get known process parameters */
-	status = mb_pr_readpar(verbose, file, MB_YES, &process, error);
-
-	/* set lever values */
-	*mbp_sonardepth_mode = process.mbp_sonardepth_mode;
-	if (mbp_sonardepthfile != NULL)
-		strcpy(mbp_sonardepthfile,process.mbp_sonardepthfile);
-	*mbp_sonardepth_format = process.mbp_sonardepth_format;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       mbp_sonardepth_mode:   %d\n",*mbp_sonardepth_mode);
-		fprintf(stderr,"dbg2       mbp_sonardepthfile:    %s\n",mbp_sonardepthfile);
-		fprintf(stderr,"dbg2       mbp_sonardepth_format: %d\n",*mbp_sonardepth_format);
-		fprintf(stderr,"dbg2       error:                 %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:                %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_pr_get_nav(int verbose, char *file,
-			int	*mbp_nav_mode,
-			char	*mbp_navfile,
-			int	*mbp_nav_format,
-			int	*mbp_nav_heading,
-			int	*mbp_nav_speed,
-			int	*mbp_nav_draft,
-			int	*mbp_nav_attitude,
-			int	*mbp_nav_algorithm,
-			double *mbp_nav_timeshift,
-			int *error)
-{
-	char	*function_name = "mb_pr_get_nav";
-	struct mb_process_struct process;
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:           %d\n",verbose);
-		fprintf(stderr,"dbg2       file:              %s\n",file);
-		}
-
-	/* get known process parameters */
-	status = mb_pr_readpar(verbose, file, MB_YES, &process, error);
-
-	/* set nav values */
-	*mbp_nav_mode = process.mbp_nav_mode;
-	if (mbp_navfile != NULL)
-	    strcpy(mbp_navfile, process.mbp_navfile);
-	*mbp_nav_format = process.mbp_nav_format;
-	*mbp_nav_heading = process.mbp_nav_heading;
-	*mbp_nav_speed = process.mbp_nav_speed;
-	*mbp_nav_draft = process.mbp_nav_draft;
-	*mbp_nav_attitude = process.mbp_nav_attitude;
-	*mbp_nav_algorithm = process.mbp_nav_algorithm;
-	*mbp_nav_timeshift = process.mbp_nav_timeshift;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       mbp_nav_mode:      %d\n",*mbp_nav_mode);
-		fprintf(stderr,"dbg2       mbp_navfile:       %s\n",mbp_navfile);
-		fprintf(stderr,"dbg2       mbp_nav_format:    %d\n",*mbp_nav_format);
-		fprintf(stderr,"dbg2       mbp_nav_heading:   %d\n",*mbp_nav_heading);
-		fprintf(stderr,"dbg2       mbp_nav_speed:     %d\n",*mbp_nav_speed);
-		fprintf(stderr,"dbg2       mbp_nav_draft:     %d\n",*mbp_nav_draft);
-		fprintf(stderr,"dbg2       mbp_nav_attitude:  %d\n",*mbp_nav_attitude);
-		fprintf(stderr,"dbg2       mbp_nav_algorithm: %d\n",*mbp_nav_algorithm);
-		fprintf(stderr,"dbg2       mbp_nav_timeshift: %f\n",*mbp_nav_timeshift);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_pr_get_navshift(int verbose, char *file,
-			int	*mbp_nav_shift,
-			double	*mbp_nav_offsetx,
-			double	*mbp_nav_offsety,
-			double	*mbp_nav_offsetz,
-			double	*mbp_nav_shiftlon,
-			double	*mbp_nav_shiftlat,
-			int *error)
-{
-	char	*function_name = "mb_pr_get_navshift";
-	struct mb_process_struct process;
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:           %d\n",verbose);
-		fprintf(stderr,"dbg2       file:              %s\n",file);
-		}
-
-	/* get known process parameters */
-	status = mb_pr_readpar(verbose, file, MB_YES, &process, error);
-
-	/* set nav values */
-	*mbp_nav_shift = process.mbp_nav_shift;
-	*mbp_nav_offsetx = process.mbp_nav_offsetx;
-	*mbp_nav_offsety = process.mbp_nav_offsety;
-	*mbp_nav_offsetz = process.mbp_nav_offsetz;
-	*mbp_nav_shiftlon = process.mbp_nav_shiftlon;
-	*mbp_nav_shiftlat = process.mbp_nav_shiftlat;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       mbp_nav_shift:     %d\n",*mbp_nav_shift);
-		fprintf(stderr,"dbg2       mbp_nav_offsetx:   %f\n",*mbp_nav_offsetx);
-		fprintf(stderr,"dbg2       mbp_nav_offsety:   %f\n",*mbp_nav_offsety);
-		fprintf(stderr,"dbg2       mbp_nav_offsetz:   %f\n",*mbp_nav_offsetz);
-		fprintf(stderr,"dbg2       mbp_nav_shiftlon:  %f\n",*mbp_nav_shiftlon);
-		fprintf(stderr,"dbg2       mbp_nav_shiftlat:  %f\n",*mbp_nav_shiftlat);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}/*--------------------------------------------------------------------*/
-int mb_pr_get_heading(int verbose, char *file,
-			int	*mbp_heading_mode,
-			double	*mbp_headingbias,
-			int *error)
-{
-	char	*function_name = "mb_pr_get_heading";
-	struct mb_process_struct process;
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:           %d\n",verbose);
-		fprintf(stderr,"dbg2       file:              %s\n",file);
-		}
-
-	/* get known process parameters */
-	status = mb_pr_readpar(verbose, file, MB_YES, &process, error);
-
-	/* set heading values */
-	*mbp_heading_mode = process.mbp_heading_mode;
-	*mbp_headingbias = process.mbp_headingbias;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       mbp_heading_mode:  %d\n",*mbp_heading_mode);
-		fprintf(stderr,"dbg2       mbp_headingbias:   %f\n",*mbp_headingbias);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_pr_get_datacut(int verbose, char *file,
-			int	*mbp_cut_num,
-			int	*mbp_cut_kind,
-			int	*mbp_cut_mode,
-			double	*mbp_cut_min,
-			double	*mbp_cut_max,
-			int *error)
-{
-	char	*function_name = "mb_pr_update_datacut";
-	struct mb_process_struct process;
-	int	status = MB_SUCCESS;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:           %d\n",verbose);
-		fprintf(stderr,"dbg2       file:              %s\n",file);
-		}
-
-	/* get known process parameters */
-	status = mb_pr_readpar(verbose, file, MB_YES, &process, error);
-
-	/* set datacut values */
-	*mbp_cut_num = process.mbp_cut_num;
-	for (i=0;i<*mbp_cut_num;i++)
-		{
-		mbp_cut_kind[i] = process.mbp_cut_kind[i];
-		mbp_cut_mode[i] = process.mbp_cut_mode[i];
-		mbp_cut_min[i] = process.mbp_cut_min[i];
-		mbp_cut_max[i] = process.mbp_cut_max[i];
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       mbp_cut_num:        %d\n",*mbp_cut_num);
-		for (i=0;i<*mbp_cut_num;i++)
-			{
-			fprintf(stderr,"dbg2       mbp_cut_kind[%d]:   %d\n",i,mbp_cut_kind[i]);
-			fprintf(stderr,"dbg2       mbp_cut_mode[%d]:   %d\n",i,mbp_cut_mode[i]);
-			fprintf(stderr,"dbg2       mbp_cut_min[%d]:    %f\n",i,mbp_cut_min[i]);
-			fprintf(stderr,"dbg2       mbp_cut_max[%d]:    %f\n",i,mbp_cut_max[i]);
-			}
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:             %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_pr_get_edit(int verbose, char *file,
-			int	*mbp_edit_mode,
-			char	*mbp_editfile,
-			int *error)
-{
-	char	*function_name = "mb_pr_get_edit";
-	struct mb_process_struct process;
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:           %d\n",verbose);
-		fprintf(stderr,"dbg2       file:              %s\n",file);
-		}
-
-	/* get known process parameters */
-	status = mb_pr_readpar(verbose, file, MB_YES, &process, error);
-
-	/* set edit values */
-	*mbp_edit_mode = process.mbp_edit_mode;
-	if (mbp_editfile != NULL)
-	    strcpy(mbp_editfile, process.mbp_editfile);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       mbp_edit_mode:     %d\n",*mbp_edit_mode);
-		fprintf(stderr,"dbg2       mbp_editfile:      %s\n",mbp_editfile);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_pr_get_ampcorr(int verbose, char *file,
-			int	*mbp_ampcorr_mode,
-			char	*mbp_ampcorrfile,
-			int	*mbp_ampcorr_type,
-			int	*mbp_ampcorr_symmetry,
-			double	*mbp_ampcorr_angle,
-			int	*mbp_ampcorr_slope,
-			char	*mbp_ampsscorr_topofile,
-			int *error)
-{
-	char	*function_name = "mb_pr_get_ampcorr";
-	struct mb_process_struct process;
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:           %d\n",verbose);
-		fprintf(stderr,"dbg2       file:              %s\n",file);
-		}
-
-	/* get known process parameters */
-	status = mb_pr_readpar(verbose, file, MB_YES, &process, error);
-
-	/* set ssrecalc values */
-	*mbp_ampcorr_mode = process.mbp_ampcorr_mode;
-	if (mbp_ampcorrfile != NULL)
-	    strcpy(mbp_ampcorrfile, process.mbp_ampcorrfile);
-	*mbp_ampcorr_type = process.mbp_ampcorr_type;
-	*mbp_ampcorr_symmetry = process.mbp_ampcorr_symmetry;
-	*mbp_ampcorr_angle = process.mbp_ampcorr_angle;
-	*mbp_ampcorr_slope = process.mbp_ampcorr_slope;
-	if (mbp_ampsscorr_topofile != NULL)
-	    strcpy(mbp_ampsscorr_topofile, process.mbp_ampsscorr_topofile);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       mbp_ampcorr_mode:         %d\n",*mbp_ampcorr_mode);
-		fprintf(stderr,"dbg2       mbp_ampcorrfile:          %s\n",mbp_ampcorrfile);
-		fprintf(stderr,"dbg2       mbp_ampcorr_type:         %d\n",*mbp_ampcorr_type);
-		fprintf(stderr,"dbg2       mbp_ampcorr_symmetry:     %d\n",*mbp_ampcorr_symmetry);
-		fprintf(stderr,"dbg2       mbp_ampcorr_angle:        %f\n",*mbp_ampcorr_angle);
-		fprintf(stderr,"dbg2       mbp_ampcorr_slope:        %d\n",*mbp_ampcorr_slope);
-		fprintf(stderr,"dbg2       mbp_ampsscorr_topofile:   %s\n",mbp_ampsscorr_topofile);
-		fprintf(stderr,"dbg2       error:                    %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:                   %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_pr_get_sscorr(int verbose, char *file,
-			int	*mbp_sscorr_mode,
-			char	*mbp_sscorrfile,
-			int	*mbp_sscorr_type,
-			int	*mbp_sscorr_symmetry,
-			double	*mbp_sscorr_angle,
-			int	*mbp_sscorr_slope,
-			char	*mbp_ampsscorr_topofile,
-			int *error)
-{
-	char	*function_name = "mb_pr_get_sscorr";
-	struct mb_process_struct process;
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:           %d\n",verbose);
-		fprintf(stderr,"dbg2       file:              %s\n",file);
-		}
-
-	/* get known process parameters */
-	status = mb_pr_readpar(verbose, file, MB_YES, &process, error);
-
-	/* set ssrecalc values */
-	*mbp_sscorr_mode = process.mbp_sscorr_mode;
-	if (mbp_sscorrfile != NULL)
-	    strcpy(mbp_sscorrfile, process.mbp_sscorrfile);
-	*mbp_sscorr_type = process.mbp_sscorr_type;
-	*mbp_sscorr_symmetry = process.mbp_sscorr_symmetry;
-	*mbp_sscorr_angle = process.mbp_sscorr_angle;
-	*mbp_sscorr_slope = process.mbp_sscorr_slope;
-	if (mbp_ampsscorr_topofile != NULL)
-	    strcpy(mbp_ampsscorr_topofile, process.mbp_ampsscorr_topofile);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       mbp_sscorr_mode:          %d\n",*mbp_sscorr_mode);
-		fprintf(stderr,"dbg2       mbp_sscorrfile:           %s\n",mbp_sscorrfile);
-		fprintf(stderr,"dbg2       mbp_sscorr_type:          %d\n",*mbp_sscorr_type);
-		fprintf(stderr,"dbg2       mbp_sscorr_symmetry:      %d\n",*mbp_sscorr_symmetry);
-		fprintf(stderr,"dbg2       mbp_sscorr_angle:         %f\n",*mbp_sscorr_angle);
-		fprintf(stderr,"dbg2       mbp_sscorr_slope:         %d\n",*mbp_sscorr_slope);
-		fprintf(stderr,"dbg2       mbp_ampsscorr_topofile:   %s\n",mbp_ampsscorr_topofile);
-		fprintf(stderr,"dbg2       error:                    %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:                   %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_pr_get_ssrecalc(int verbose, char *file,
-			int	*mbp_ssrecalc_mode,
-			double	*mbp_ssrecalc_pixelsize,
-			double	*mbp_ssrecalc_swathwidth,
-			int	*mbp_ssrecalc_interpolate,
-			int *error)
-{
-	char	*function_name = "mb_pr_get_ssrecalc";
-	struct mb_process_struct process;
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:           %d\n",verbose);
-		fprintf(stderr,"dbg2       file:              %s\n",file);
-		}
-
-	/* get known process parameters */
-	status = mb_pr_readpar(verbose, file, MB_YES, &process, error);
-
-	/* set ssrecalc values */
-	*mbp_ssrecalc_mode = process.mbp_ssrecalc_mode;
-	*mbp_ssrecalc_pixelsize = process.mbp_ssrecalc_pixelsize;
-	*mbp_ssrecalc_swathwidth = process.mbp_ssrecalc_swathwidth;
-	*mbp_ssrecalc_interpolate = process.mbp_ssrecalc_interpolate;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       mbp_ssrecalc_mode:        %d\n",*mbp_ssrecalc_mode);
-		fprintf(stderr,"dbg2       mbp_ssrecalc_pixelsize:   %f\n",*mbp_ssrecalc_pixelsize);
-		fprintf(stderr,"dbg2       mbp_ssrecalc_swathwidth:  %f\n",*mbp_ssrecalc_swathwidth);
-		fprintf(stderr,"dbg2       mbp_ssrecalc_interpolate: %d\n",*mbp_ssrecalc_interpolate);
-		fprintf(stderr,"dbg2       error:                    %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:                   %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_pr_get_metadata(int verbose, char *file,
-			char	*mbp_meta_vessel,
-			char	*mbp_meta_institution,
-			char	*mbp_meta_platform,
-			char	*mbp_meta_sonar,
-			char	*mbp_meta_sonarversion,
-			char	*mbp_meta_cruiseid,
-			char	*mbp_meta_cruisename,
-			char	*mbp_meta_pi,
-			char	*mbp_meta_piinstitution,
-			char	*mbp_meta_client,
-			int	*mbp_meta_svcorrected,
-			int	*mbp_meta_tidecorrected,
-			int	*mbp_meta_batheditmanual,
-			int	*mbp_meta_batheditauto,
-			double	*mbp_meta_rollbias,
-			double	*mbp_meta_pitchbias,
-			double	*mbp_meta_headingbias,
-			double	*mbp_meta_draft,
-			int *error)
-{
-	char	*function_name = "mb_pr_get_metadata";
-	struct mb_process_struct process;
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:           %d\n",verbose);
-		fprintf(stderr,"dbg2       file:              %s\n",file);
-		}
-
-	/* get known process parameters */
-	status = mb_pr_readpar(verbose, file, MB_YES, &process, error);
-
-	/* set metadata values */
-	strcpy(mbp_meta_vessel,process.mbp_meta_vessel);
-	strcpy(mbp_meta_institution,process.mbp_meta_institution);
-	strcpy(mbp_meta_platform,process.mbp_meta_platform);
-	strcpy(mbp_meta_sonar,process.mbp_meta_sonar);
-	strcpy(mbp_meta_sonarversion,process.mbp_meta_sonarversion);
-	strcpy(mbp_meta_cruiseid,process.mbp_meta_cruiseid);
-	strcpy(mbp_meta_cruisename,process.mbp_meta_cruisename);
-	strcpy(mbp_meta_pi,process.mbp_meta_pi);
-	strcpy(mbp_meta_piinstitution,process.mbp_meta_piinstitution);
-	strcpy(mbp_meta_client,process.mbp_meta_client);
-        *mbp_meta_svcorrected = process.mbp_meta_svcorrected;
-        *mbp_meta_tidecorrected = process.mbp_meta_tidecorrected;
-        *mbp_meta_batheditmanual = process.mbp_meta_batheditmanual;
-        *mbp_meta_batheditauto = process.mbp_meta_batheditauto;
-        *mbp_meta_rollbias = process.mbp_meta_rollbias;
-        *mbp_meta_pitchbias = process.mbp_meta_pitchbias;
-        *mbp_meta_headingbias = process.mbp_meta_headingbias;
-        *mbp_meta_draft = process.mbp_meta_draft;
-
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       mbp_meta_vessel:          %s\n",mbp_meta_vessel);
-		fprintf(stderr,"dbg2       mbp_meta_institution:     %s\n",mbp_meta_institution);
-		fprintf(stderr,"dbg2       mbp_meta_platform:        %s\n",mbp_meta_platform);
-		fprintf(stderr,"dbg2       mbp_meta_sonar:           %s\n",mbp_meta_sonar);
-		fprintf(stderr,"dbg2       mbp_meta_sonarversion:    %s\n",mbp_meta_sonarversion);
-		fprintf(stderr,"dbg2       mbp_meta_cruiseid:        %s\n",mbp_meta_cruiseid);
-		fprintf(stderr,"dbg2       mbp_meta_cruisename:      %s\n",mbp_meta_cruisename);
-		fprintf(stderr,"dbg2       mbp_meta_p:i              %s\n",mbp_meta_pi);
-		fprintf(stderr,"dbg2       mbp_meta_piinstitution:   %s\n",mbp_meta_piinstitution);
-		fprintf(stderr,"dbg2       mbp_meta_client:          %s\n",mbp_meta_client);
-		fprintf(stderr,"dbg2       mbp_meta_svcorrected:     %d\n",*mbp_meta_svcorrected);
-		fprintf(stderr,"dbg2       mbp_meta_tidecorrected    %d\n",*mbp_meta_tidecorrected);
-		fprintf(stderr,"dbg2       mbp_meta_batheditmanual   %d\n",*mbp_meta_batheditmanual);
-		fprintf(stderr,"dbg2       mbp_meta_batheditauto:    %d\n",*mbp_meta_batheditauto);
-		fprintf(stderr,"dbg2       mbp_meta_rollbias:        %f\n",*mbp_meta_rollbias);
-		fprintf(stderr,"dbg2       mbp_meta_pitchbias:       %f\n",*mbp_meta_pitchbias);
-		fprintf(stderr,"dbg2       mbp_meta_headingbias:     %f\n",*mbp_meta_headingbias);
-		fprintf(stderr,"dbg2       mbp_meta_draft:           %f\n",*mbp_meta_draft);
-		fprintf(stderr,"dbg2       error:                    %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:                   %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_pr_get_kluges(int verbose, char *file,
-			int	*mbp_kluge001,
-			int	*mbp_kluge002,
-			int	*mbp_kluge003,
-			int	*mbp_kluge004,
-			int	*mbp_kluge005,
-			int	*mbp_kluge006,
-			int	*mbp_kluge007,
-			int	*mbp_kluge008,
-			int	*mbp_kluge009,
-			int	*mbp_kluge010,
-			int *error)
-{
-	char	*function_name = "mb_pr_get_kluges";
-	struct mb_process_struct process;
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:           %d\n",verbose);
-		fprintf(stderr,"dbg2       file:              %s\n",file);
-		}
-
-	/* get known process parameters */
-	status = mb_pr_readpar(verbose, file, MB_YES, &process, error);
-
-	/* set metadata values */
-        *mbp_kluge001 = process.mbp_kluge001;
-        *mbp_kluge002 = process.mbp_kluge002;
-        *mbp_kluge003 = process.mbp_kluge003;
-        *mbp_kluge004 = process.mbp_kluge004;
-        *mbp_kluge005 = process.mbp_kluge005;
-        *mbp_kluge006 = process.mbp_kluge006;
-        *mbp_kluge007 = process.mbp_kluge007;
-        *mbp_kluge008 = process.mbp_kluge008;
-        *mbp_kluge009 = process.mbp_kluge009;
-        *mbp_kluge010 = process.mbp_kluge010;
-
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       mbp_kluge001:             %d\n",*mbp_kluge001);
-		fprintf(stderr,"dbg2       mbp_kluge002:             %d\n",*mbp_kluge002);
-		fprintf(stderr,"dbg2       mbp_kluge003:             %d\n",*mbp_kluge003);
-		fprintf(stderr,"dbg2       mbp_kluge004:             %d\n",*mbp_kluge004);
-		fprintf(stderr,"dbg2       mbp_kluge005:             %d\n",*mbp_kluge005);
-		fprintf(stderr,"dbg2       mbp_kluge006:             %d\n",*mbp_kluge006);
-		fprintf(stderr,"dbg2       mbp_kluge007:             %d\n",*mbp_kluge007);
-		fprintf(stderr,"dbg2       mbp_kluge008:             %d\n",*mbp_kluge008);
-		fprintf(stderr,"dbg2       mbp_kluge009:             %d\n",*mbp_kluge009);
-		fprintf(stderr,"dbg2       mbp_kluge010:             %d\n",*mbp_kluge010);
-		fprintf(stderr,"dbg2       error:                    %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:                   %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_pr_set_bathyslopenew(int verbose,
-	int nsmooth,
-	int nbath, char *beamflag, double *bath, double *bathacrosstrack,
-	int *ndepths, double *depths, double *depthacrosstrack,
-	int *nslopes, double *slopes, double *slopeacrosstrack,
-	double *depthsmooth,
-	int *error)
-{
-	char	*function_name = "mb_pr_set_bathyslopenew";
-	int	status = MB_SUCCESS;
-	double	dxtrack;
-	double	weight;
-	int	j1, j2;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:         %d\n",verbose);
-		fprintf(stderr,"dbg2       nsmooth:         %d\n",nsmooth);
-		fprintf(stderr,"dbg2       nbath:           %d\n",nbath);
-		fprintf(stderr,"dbg2       beamflag:        %p\n",(void *)beamflag);
-		fprintf(stderr,"dbg2       bath:            %p\n",(void *)bath);
-		fprintf(stderr,"dbg2       bathacrosstrack: %p\n",(void *)bathacrosstrack);
-		fprintf(stderr,"dbg2       bath:\n");
-		for (i=0;i<nbath;i++)
-			fprintf(stderr,"dbg2         %d  %d  %f %f\n",
-				i, beamflag[i], bath[i], bathacrosstrack[i]);
-		fprintf(stderr,"dbg2       depths:           %p\n",(void *)depths);
-		fprintf(stderr,"dbg2       depthacrosstrack: %p\n",(void *)depthacrosstrack);
-		fprintf(stderr,"dbg2       slopes:           %p\n",(void *)slopes);
-		fprintf(stderr,"dbg2       slopeacrosstrack: %p\n",(void *)slopeacrosstrack);
-		}
-
-	/* initialize depths */
-	*ndepths = 0;
-	for (i=0;i<nbath;i++)
-		{
-		depths[i] = 0.0;
-		depthacrosstrack[i] = 0.0;
-		}
-
-	/* decimate by nsmooth, averaging the values used */
-	for (i=0;i<=nbath/nsmooth;i++)
-		{
-		j1 = i * nsmooth;
-		j2 = MIN((i + 1) * nsmooth, nbath);
-		depths[*ndepths] = 0.0;
-		depthacrosstrack[*ndepths] = 0.0;
-		weight = 0.0;
-		for (j=j1;j<j2;j++)
-			{
-			if (mb_beam_ok(beamflag[j]))
-				{
-				depths[*ndepths] += bath[j];
-				depthacrosstrack[*ndepths] += bathacrosstrack[j];
-				weight += 1.0;
-				}
-			}
-		if (weight > 0.0)
-			{
-			depths[*ndepths] /= weight;
-			depthacrosstrack[*ndepths] /= weight;
-			(*ndepths) += 1;
-			}
-		}
-
-	/* now calculate slopes */
-	if (*ndepths > 0)
-		{
-		*nslopes = *ndepths + 1;
-		slopeacrosstrack[0] = depthacrosstrack[0];
-		slopes[0] = 0.0;
-		for (i=1;i<*ndepths;i++)
-			{
-			dxtrack = depthacrosstrack[i] - depthacrosstrack[i-1];
-			slopeacrosstrack[i] = depthacrosstrack[i-1] + 0.5 * dxtrack;
-			if (dxtrack > 0.0)
-				slopes[i] = (depths[i] - depths[i-1])
-					/ dxtrack;
-			else
-				slopes[i] = 0.0;
-/*fprintf(stderr,"SLOPECALC: i:%d depths: %f %f  xtrack: %f %f  slope:%f\n",
-i,depths[i-1],depths[i],depthacrosstrack[i-1],depthacrosstrack[i],slopes[i]);*/
-			}
-		slopeacrosstrack[*ndepths] = depthacrosstrack[*ndepths-1];
-		slopes[*ndepths] = 0.0;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       ndepths:         %d\n",
-			*ndepths);
-		fprintf(stderr,"dbg2       depths:\n");
-		for (i=0;i<*ndepths;i++)
-			fprintf(stderr,"dbg2         %d %f %f\n",
-				i, depths[i], depthacrosstrack[i]);
-		fprintf(stderr,"dbg2       nslopes:         %d\n",
-			*nslopes);
-		fprintf(stderr,"dbg2       slopes:\n");
-		for (i=0;i<*nslopes;i++)
-			fprintf(stderr,"dbg2         %d %f %f\n",
-				i, slopes[i], slopeacrosstrack[i]);
-		fprintf(stderr,"dbg2       error:           %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:          %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_pr_set_bathyslope(int verbose,
-	int nsmooth,
-	int nbath, char *beamflag, double *bath, double *bathacrosstrack,
-	int *ndepths, double *depths, double *depthacrosstrack,
-	int *nslopes, double *slopes, double *slopeacrosstrack,
-	double *depthsmooth,
-	int *error)
-{
-	char	*function_name = "mb_pr_set_bathyslope";
-	int	status = MB_SUCCESS;
-	int	first, next, last;
-	int	nbathgood;
-	double	depthsum;
-	double	dacrosstrack;
-	double	factor;
-	int	j1, j2;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:         %d\n",verbose);
-		fprintf(stderr,"dbg2       nbath:           %d\n",nbath);
-		fprintf(stderr,"dbg2       beamflag:        %p\n",(void *)beamflag);
-		fprintf(stderr,"dbg2       bath:            %p\n",(void *)bath);
-		fprintf(stderr,"dbg2       bathacrosstrack: %p\n",(void *)bathacrosstrack);
-		fprintf(stderr,"dbg2       bath:\n");
-		for (i=0;i<nbath;i++)
-			fprintf(stderr,"dbg2         %d  %d  %f %f\n",
-				i, beamflag[i], bath[i], bathacrosstrack[i]);
-		fprintf(stderr,"dbg2       depths:           %p\n",(void *)depths);
-		fprintf(stderr,"dbg2       depthacrosstrack: %p\n",(void *)depthacrosstrack);
-		fprintf(stderr,"dbg2       slopes:           %p\n",(void *)slopes);
-		fprintf(stderr,"dbg2       slopeacrosstrack: %p\n",(void *)slopeacrosstrack);
-		}
-
-	/* initialize depths */
-	*ndepths = 0;
-	for (i=0;i<nbath;i++)
-		{
-		depths[i] = 0.0;
-		depthacrosstrack[i] = 0.0;
-		}
-
-	/* first fill in the existing depths */
-	first = -1;
-	last = -1;
-	nbathgood = 0;
-	for (i=0;i<nbath;i++)
-		{
-		if (mb_beam_ok(beamflag[i]))
-			{
-			if (first == -1)
-				{
-				first = i;
-				}
-			last = i;
-			depths[i] = bath[i];
-			depthacrosstrack[i] = bathacrosstrack[i];
-			nbathgood++;
-			}
-		}
-
-	/* now interpolate the depths */
-	if (nbathgood > 0)
-	for (i=first;i<last;i++)
-		{
-		if (mb_beam_ok(beamflag[i]))
-			{
-			next = i;
-			j = i + 1;
-			while (next == i && j < nbath)
-				{
-				if (mb_beam_ok(beamflag[j]))
-					next = j;
-				else
-					j++;
-				}
-			if (next > i)
-				{
-				for (j=i+1;j<next;j++)
-					{
-					factor = ((double)(j - i))
-							/ ((double)(next - i));
-					depths[j] = bath[i] +
-						factor * (bath[next] - bath[i]);
-					depthacrosstrack[j] = bathacrosstrack[i] +
-						factor * (bathacrosstrack[next] - bathacrosstrack[i]);
-					}
-				}
-			}
-		}
-
-	/* now smooth the depths */
-	if (nbathgood > 0 && nsmooth > 0)
-		{
-		for (i=first;i<=last;i++)
-			{
-			j1 = i - nsmooth;
-			j2 = i + nsmooth;
-			if (j1 < first)
-				j1 = first;
-			if (j2 > last)
-				j2 = last;
-			depthsum = 0.0;
-			for (j=j1;j<=j2;j++)
-				{
-				depthsum += depths[j];
-				}
-			if (depthsum > 0.0)
-				depthsmooth[i] = depthsum/((double)(j2-j1+1));
-			else
-				depthsmooth[i] = depths[i];
-			}
-		for (i=first;i<=last;i++)
-			depths[i] = depthsmooth[i];
-		}
-
-	/* now extrapolate the depths at the ends of the swath */
-	if (nbathgood > 0)
-		{
-		*ndepths = nbath;
-		if (last - first > 0)
-			dacrosstrack =
-				(depthacrosstrack[last]
-				- depthacrosstrack[first])
-				/ (last - first);
-		else
-			dacrosstrack = 1.0;
-		for (i=0;i<first;i++)
-			{
-			depths[i] = depths[first];
-			depthacrosstrack[i] = depthacrosstrack[first]
-				+ dacrosstrack * (i - first);
-			}
-		for (i=last+1;i<nbath;i++)
-			{
-			depths[i] = depths[last];
-			depthacrosstrack[i] = depthacrosstrack[last]
-				+ dacrosstrack * (i - last);
-			}
-		}
-
-	/* now calculate slopes */
-	if (nbathgood > 0)
-		{
-		*nslopes = nbath + 1;
-		for (i=0;i<nbath-1;i++)
-			{
-			slopes[i+1] = (depths[i+1] - depths[i])
-				/(depthacrosstrack[i+1] - depthacrosstrack[i]);
-			slopeacrosstrack[i+1] = 0.5*(depthacrosstrack[i+1]
-				+ depthacrosstrack[i]);
-/*fprintf(stderr,"SLOPECALC: i:%d depths: %f %f  xtrack: %f %f  slope:%f\n",
-i,depths[i],depths[i+1],depthacrosstrack[i],depthacrosstrack[i+1],slopes[i+1]);*/
-			}
-		slopes[0] = 0.0;
-		slopeacrosstrack[0] = depthacrosstrack[0];
-		slopes[nbath] = 0.0;
-		slopeacrosstrack[nbath] = depthacrosstrack[nbath-1];
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       ndepths:         %d\n",
-			*ndepths);
-		fprintf(stderr,"dbg2       depths:\n");
-		for (i=0;i<nbath;i++)
-			fprintf(stderr,"dbg2         %d %f %f\n",
-				i, depths[i], depthacrosstrack[i]);
-		fprintf(stderr,"dbg2       nslopes:         %d\n",
-			*nslopes);
-		fprintf(stderr,"dbg2       slopes:\n");
-		for (i=0;i<*nslopes;i++)
-			fprintf(stderr,"dbg2         %d %f %f\n",
-				i, slopes[i], slopeacrosstrack[i]);
-		fprintf(stderr,"dbg2       error:           %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:          %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_pr_get_bathyslope(int verbose,
-	int ndepths, double *depths, double *depthacrosstrack,
-	int nslopes, double *slopes, double *slopeacrosstrack,
-	double acrosstrack, double *depth, double *slope,
-	int *error)
-{
-	char	*function_name = "get_bathyslope";
-	int	status = MB_SUCCESS;
-	int	found_depth, found_slope;
-	int	idepth, islope;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:         %d\n",verbose);
-		fprintf(stderr,"dbg2       ndepths:         %d\n",
-			ndepths);
-		fprintf(stderr,"dbg2       depths:\n");
-		for (i=0;i<ndepths;i++)
-			fprintf(stderr,"dbg2         %d %f %f\n",
-				i, depths[i], depthacrosstrack[i]);
-		fprintf(stderr,"dbg2       nslopes:         %d\n",
-			nslopes);
-		fprintf(stderr,"dbg2       slopes:\n");
-		for (i=0;i<nslopes;i++)
-			fprintf(stderr,"dbg2         %d %f %f\n",
-				i, slopes[i], slopeacrosstrack[i]);
-		fprintf(stderr,"dbg2       acrosstrack:     %f\n",acrosstrack);
-		}
-
-	/* check if acrosstrack is in defined interval */
-	found_depth = MB_NO;
-	found_slope = MB_NO;
-	if (ndepths > 1)
-	    {
-
-	    if (acrosstrack < depthacrosstrack[0])
-		{
-		*depth = depths[0];
-		*slope = 0.0;
-		found_depth = MB_YES;
-		found_slope = MB_YES;
-		}
-
-	    else if (acrosstrack > depthacrosstrack[ndepths-1])
-		{
-		*depth = depths[ndepths-1];
-		*slope = 0.0;
-		found_depth = MB_YES;
-		found_slope = MB_YES;
-		}
-
-	    else if (acrosstrack >= depthacrosstrack[0]
-		    && acrosstrack <= depthacrosstrack[ndepths-1])
-		{
-
-		/* look for depth */
-		idepth = -1;
-		while (found_depth == MB_NO && idepth < ndepths - 2)
-		    {
-		    idepth++;
-		    if (acrosstrack >= depthacrosstrack[idepth]
-			&& acrosstrack <= depthacrosstrack[idepth+1])
-			{
-			*depth = depths[idepth]
-				+ (acrosstrack - depthacrosstrack[idepth])
-				/(depthacrosstrack[idepth+1]
-				- depthacrosstrack[idepth])
-				*(depths[idepth+1] - depths[idepth]);
-			found_depth = MB_YES;
-			*error = MB_ERROR_NO_ERROR;
-			}
-		    }
-
-		/* look for slope */
-		islope = -1;
-		while (found_slope == MB_NO && islope < nslopes - 2)
-		    {
-		    islope++;
-		    if (acrosstrack >= slopeacrosstrack[islope]
-			&& acrosstrack <= slopeacrosstrack[islope+1])
-			{
-			*slope = slopes[islope]
-				+ (acrosstrack - slopeacrosstrack[islope])
-				/(slopeacrosstrack[islope+1]
-				- slopeacrosstrack[islope])
-				*(slopes[islope+1] - slopes[islope]);
-			found_slope = MB_YES;
-			*error = MB_ERROR_NO_ERROR;
-			}
-		    }
-		}
-	    }
-
-	/* check for failure */
-	if (found_depth != MB_YES || found_slope != MB_YES)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_OTHER;
-		*depth = 0.0;
-		*slope = 0.0;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       depth:           %f\n",*depth);
-		fprintf(stderr,"dbg2       slope:           %f\n",*slope);
-		fprintf(stderr,"dbg2       error:           %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:          %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_pr_point_in_quad(int verbose,
-	double px, double py, double *x, double *y, int *error)
-{
-	char	*function_name = "mb_pr_point_in_quad";
-	int	inside = MB_YES;
-	double	ax, ay, bx, by;
-	double	z1, z2, z3, z4, z;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:         %d\n",verbose);
-		fprintf(stderr,"dbg2       px:              %f\n",px);
-		fprintf(stderr,"dbg2       py:              %f\n",px);
-		fprintf(stderr,"dbg2       x[0]: %f   y[0]: %f\n",x[0],y[0]);
-		fprintf(stderr,"dbg2       x[1]: %f   y[1]: %f\n",x[1],y[1]);
-		fprintf(stderr,"dbg2       x[2]: %f   y[2]: %f\n",x[2],y[2]);
-		fprintf(stderr,"dbg2       x[3]: %f   y[3]: %f\n",x[3],y[3]);
-		}
-
-	/* check if point is inside defined quadrilateral
-		- the quad should be defined by four points
-		in counterclockwise order
-		- this is accomplished by calculating the
-		z component of the cross product of the vector from
-		each quad point to the next with the vector from the
-		quad point to the candidate point - if all four cross
-		product z components are positive, the point is inside
-		the quad */
-	inside = MB_YES;
-
-	ax = x[1] - x[0];
-	ay = y[1] - y[0];
-	bx = px - x[0];
-	by = py - y[0];
-	z1 = ax * by - ay * bx;
-
-	ax = x[2] - x[1];
-	ay = y[2] - y[1];
-	bx = px - x[1];
-	by = py - y[1];
-	z2 = ax * by - ay * bx;
-
-	ax = x[3] - x[2];
-	ay = y[3] - y[2];
-	bx = px - x[2];
-	by = py - y[2];
-	z3 = ax * by - ay * bx;
-
-	ax = x[0] - x[3];
-	ay = y[0] - y[3];
-	bx = px - x[3];
-	by = py - y[3];
-	z4 = ax * by - ay * bx;
-
-	z = z1 * z2 * z3 *z4;
-	if (z <= 0.0)
-		inside = MB_NO;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:           %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       inside:          %d\n",inside);
-		}
-
-	/* return status */
-	return(inside);
-}
-/*--------------------------------------------------------------------*/
-
-int mb_pr_lockswathfile(int verbose, char *file, int purpose,
-			char *program, int *error)
-{
-	char	*function_name = "mb_pr_lockswathfile";
-	int	status = MB_SUCCESS;
-	mb_path	lockfile;
-	FILE	*fp;
-
-	/* file status variables */
-	struct stat file_status;
-	int	fstat;
-
-	/* time, user, host variables */
-	time_t	right_now;
-	char	date[32], user[MBP_FILENAMESIZE], *user_ptr, host[MBP_FILENAMESIZE];
-
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       file:       %s\n",file);
-		fprintf(stderr,"dbg2       program:    %s\n",program);
-		fprintf(stderr,"dbg2       purpose:    %d\n",purpose);
-		}
-
-	/* proceed only if lock file does not exist */
-	sprintf(lockfile, "%s.lck", file);
-	if ((fstat = stat(lockfile, &file_status)) == -1)
-		{
-		/* proceed only if we create the lockfile */
-	    	if ((fp = fopen(lockfile, "wx")) != NULL)
-			{
-			right_now = time((time_t *)0);
-			strcpy(date,ctime(&right_now));
-			date[strlen(date)-1] = '\0';
-			if ((user_ptr = getenv("USER")) == NULL)
-				user_ptr = getenv("LOGNAME");
-			if (user_ptr != NULL)
-				strcpy(user,user_ptr);
-			else
-				strcpy(user, "unknown");
-			gethostname(host,MBP_FILENAMESIZE);
-			fprintf(fp, "# File %s \n# Locked by user <%s> on cpu <%s> at <%s>\n",
-				file,user,host,date);
-			fprintf(fp, "Locking Program: %s\n", program);
-			fprintf(fp, "Locking User: %s\n", user);
-			fprintf(fp, "Locking CPU: %s\n", host);
-			fprintf(fp, "Locking Time: %s\n", date);
-			fprintf(fp, "Locking Purpose ID: %d\n", purpose);
-			if (purpose == MBP_LOCK_NONE)
-				fprintf(fp, "Locking Purpose Description: None (unknown)\n");
-			else if (purpose == MBP_LOCK_PROCESS)
-				fprintf(fp, "Locking Purpose Description: Process\n");
-			else if (purpose == MBP_LOCK_EDITBATHY)
-				fprintf(fp, "Locking Purpose Description: Edit Bathymetry\n");
-			else if (purpose == MBP_LOCK_EDITNAV)
-				fprintf(fp, "Locking Purpose Description: Edit Navigation\n");
-			fclose(fp);
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		else
-			{
-			*error = MB_ERROR_OPEN_FAIL;
-			status = MB_FAILURE;
-			}
-		}
-	else
-		{
-		*error = MB_ERROR_FILE_LOCKED;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-
-int mb_pr_lockinfo(int verbose, char *file, int *locked,
-			int *purpose, char *program, char *user, char *cpu,
-			char *date, int *error)
-{
-	char	*function_name = "mb_pr_lockinfo";
-	int	status = MB_SUCCESS;
-	mb_path	lockfile;
-	FILE	*fp;
-	mb_path	line;
-
-	/* file status variables */
-	struct stat file_status;
-	int	fstat;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       file:       %s\n",file);
-		}
-
-	/* initialize return parameters */
-	*locked = MB_NO;
-	*purpose = 0;
-	program[0] = '\0';
-	user[0] = '\0';
-	cpu[0] = '\0';
-	date[0] = '\0';
-
-
-	/* check if lock file exists */
-	sprintf(lockfile, "%s.lck", file);
-	if ((fstat = stat(lockfile, &file_status)) == 0)
-		{
-		/* read the lockfile */
-		*locked = MB_YES;
-	    	if ((fp = fopen(lockfile, "r")) != NULL)
-			{
-			while(fgets(line, MBP_FILENAMESIZE, fp) != NULL)
-				{
-				line[strlen(line)-1] = '\0';
-				if (strncmp(line, "Locking Program: ", 17) == 0)
-					{
-					strcpy(program, &(line[17]));
-					}
-				else if (strncmp(line, "Locking User: ", 14) == 0)
-					{
-					strcpy(user, &(line[14]));
-					}
-				else if (strncmp(line, "Locking CPU: ", 13) == 0)
-					{
-					strcpy(cpu, &(line[13]));
-					}
-				else if (strncmp(line, "Locking Time: ", 14) == 0)
-					{
-					strcpy(date, &(line[14]));
-					}
-				else if (strncmp(line, "Locking Purpose ID: ", 20) == 0)
-					{
-					sscanf(&(line[20]), "%d", purpose);
-					}
-				}
-			fclose(fp);
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		else
-			{
-			*error = MB_ERROR_OPEN_FAIL;
-			status = MB_FAILURE;
-			}
-		}
-	else
-		{
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       locked:     %d\n",*locked);
-		fprintf(stderr,"dbg2       purpose:    %d\n",*purpose);
-		fprintf(stderr,"dbg2       program:    %s\n",program);
-		fprintf(stderr,"dbg2       user:       %s\n",user);
-		fprintf(stderr,"dbg2       cpu:        %s\n",cpu);
-		fprintf(stderr,"dbg2       date:       %s\n",date);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_pr_unlockswathfile(int verbose, char *file, int purpose,
-			char *program, int *error)
-{
-	char	*function_name = "mb_pr_unlockswathfile";
-	int	status = MB_SUCCESS;
-	mb_path	lockfile;
-	int	locked;
-	mb_path	lock_program;
-	mb_path	lock_user;
-	mb_path	lock_cpu;
-	mb_path	lock_date;
-	int	lock_purpose;
-	mb_path	command;
-	int	shellstatus;
-
-	/* user, host variables */
-	char	user[MBP_FILENAMESIZE], *user_ptr;
-
-	/* file status variables */
-	struct stat file_status;
-	int	fstat;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       file:       %s\n",file);
-		fprintf(stderr,"dbg2       purpose:    %d\n",purpose);
-		fprintf(stderr,"dbg2       program:    %s\n",program);
-		}
-
-	/* check if lock file exists */
-	sprintf(lockfile, "%s.lck", file);
-	if ((fstat = stat(lockfile, &file_status)) == 0)
-		{
-		/* get lock info */
-		status = mb_pr_lockinfo(verbose, file, &locked, &lock_purpose, lock_program,
-					lock_user, lock_cpu, lock_date, error);
-
-		/* get user and date */
-		if ((user_ptr = getenv("USER")) == NULL)
-			user_ptr = getenv("LOGNAME");
-		if (user_ptr != NULL)
-			strcpy(user,user_ptr);
-		else
-			strcpy(user, "unknown");
-
-		/* if locked and everything matches remove lock file */
-		if (locked == MB_YES
-			&& strncmp(program, lock_program,strlen(program)) == 0
-			&& strncmp(user, lock_user,strlen(user)) == 0
-			&& purpose == lock_purpose)
-			{
-			sprintf(command, "/bin/rm -f %s", lockfile);
-			shellstatus = system(command);
-			status = MB_SUCCESS;
-			*error = MB_ERROR_NO_ERROR;
-			}
-		else
-			{
-			status = MB_SUCCESS;
-			*error = MB_ERROR_FILE_LOCKED;
-			}
-		}
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_FILE_NOT_FOUND;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mb_process.h b/src/mbio/mb_process.h
deleted file mode 100644
index 8bb3ce3..0000000
--- a/src/mbio/mb_process.h
+++ /dev/null
@@ -1,1281 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mb_process.h	9/11/00
- *    $Id: mb_process.h 2247 2015-05-29 21:28:28Z caress $
- *
- *    Copyright (c) 2000-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * MBprocess is a tool for processing swath sonar bathymetry data.
- * This program performs a number of functions, including:
- *   - merging navigation
- *   - recalculating bathymetry from travel time and angle data
- *     by raytracing through a layered water sound velocity model.
- *   - applying changes to ship draft, roll bias and pitch bias
- *   - applying bathymetry edits from edit save files.
- * This file defines processing parameters and structures
- * saved in mbprocess parameter files. The reading, writing, and
- * updating of the mbprocess control parameter values are done
- * using functions in mb_process.c
- *
- * The structures holding beam edit event values associated with
- * edit save files are given here.
- *
- * This file also defines the structure and parameters associated
- * with defining the position and angular offsets between the
- * various sensors on a survey platform (e.g. ship, launch, ROV, AUV).
- *
- * The parameters controlling mbprocess are included in an ascii
- * parameter file. The parameter files consist of single line
- * commands and comment lines beginning with '#'. The commands
- * are given by a keyword and a corresponding value (separated by
- * spaces or tabs). A list of the keywords and values follows,
- * with default values in square brackets:
- *
- * GENERAL PARAMETERS:
- *   EXPLICIT			    # causes mbprocess to set modes implicitely
- *                                  # - e.g. the SVPFILE command will also set
- *                                  #   raytracing on even if the RAYTRACE command
- *                                  #   is not given [explicit mode commands required]
- *   FORMAT constant                # sets format id [no default]
- *   INFILE filename                # sets input file path [no default]
- *   OUTFILE filename               # sets output file path [no default]
- *
- * NAVIGATION MERGING:
- *   NAVMODE boolean                # sets navigation merging [0]
- *                                  #   0: navigation merge off
- *                                  #   1: navigation merge on
- *   NAVFILE filename               # sets navigation file path [no default]
- *   NAVFORMAT constant             # sets navigation file format [9]
- *   NAVHEADING boolean             # sets heading to be merged from navigation file
- *                                  # - note: heading merged from navigation before
- *                                  #   heading correction applied
- *                                  #   0: heading not changed
- *                                  #   1: heading merged from navigation file
- *   NAVSPEED boolean               # sets speed to be merged from navigation file
- *                                  #   0: speed not changed
- *                                  #   1: speed merged from navigation file
- *   NAVDRAFT boolean               # sets draft to be merged from navigation file
- *                                  # - note: draft merged from navigation before
- *                                  #   draft correction applied
- *                                  #   0: draft not changed
- *                                  #   1: draft merged from navigation file
- *   NAVATTITUDE boolean            # sets roll, pitch and heave to be merged from navigation file
- *                                  # - note: roll, pitch, and heave merged from navigation before
- *                                  #   roll bias and pitch bias corrections applied
- *                                  #   0: roll, pitch, and heave not changed
- *                                  #   1: roll, pitch, and heave merged from navigation file
- *   NAVINTERP boolean              # sets navigation interpolation algorithm [0]
- *                                  #   0: linear interpolation (recommended)
- *                                  #   1: spline interpolation
- *   NAVTIMESHIFT constant          # sets navigation time shift (seconds) [0.0]
- *                                  # - note: time shift added to timestamps of
- *                                  #   navigation fixes read in from NAVFILE
- *                                  #   prior to merging
- *
- * NAVIGATION OFFSETS AND SHIFTS:
- *   NAVSHIFT boolean               # sets navigation offset [0]
- *                                  # - note: offsets and shifts are applied to navigation
- *                                  #   values from both survey and navigation records, and
- *                                  #   are applied to navigation read in from
- *                                  #   NAVFILE prior to merging
- *                                  # - note: offsets and shifts are NOT applied to adjusted
- *                                  #   navigation values from NAVADJFILE
- *   NAVOFFSETX constant            # sets navigation athwartship offset (meters) [0.0]
- *                                  # - note: the effective navigation shift is
- *                                  #   (NAVOFFSETX - SONAROFFSETX), and the
- *                                  #   navigation is corrected by subtracting
- *                                  #   this effective shift.
- *                                  # - note: athwartship shift is positive to
- *                                  #   starboard.
- *   NAVOFFSETY constant            # sets navigation fore-aft offset (meters) [0.0]
- *                                  # - note: the effective navigation shift is
- *                                  #   (NAVOFFSETY - SONAROFFSETY), and the
- *                                  #   navigation is corrected by subtracting
- *                                  #   this effective shift.
- *                                  # - note: fore-aft shift is positive forward.
- *   NAVOFFSETZ constant            # sets navigation vertical offset (meters) [0.0]
- *                                  # - note: this value is not yet used for
- *                                  #   anything.
- *                                  # - note: vertical shift is positive down.
- *   NAVSHIFTLON constant           # sets navigation longitude shift (degrees) [0.0]
- *   NAVSHIFTLAT constant           # sets navigation latitude shift (degrees) [0.0]
- *
- * ADJUSTED NAVIGATION MERGING:
- *   NAVADJMODE boolean             # sets navigation merging from mbnavadjust [0]
- *                                  # - longitude and latitude only
- *                                  #   0: adjusted navigation merge off
- *                                  #   1: adjusted navigation merge on
- *   NAVADJFILE filename            # sets adjusted navigation file path
- *                                  # - this file supercedes navigation file for
- *                                  #   lon and lat only
- *                                  # - uses mbnavadjust output
- *   NAVADJINTERP boolean           # sets adjusted navigation interpolation algorithm [0]
- *                                  #   0: linear interpolation (recommended)
- *                                  #   1: spline interpolation
- *
- * ATTITUDE MERGING:
- *   ATTITUDEMODE mode              # sets atttitude (roll, pitch, and heave) merging [0]
- *                                  # - note: roll, pitch, and heave merged before
- *                                  #   roll bias and pitch bias corrections applied
- *                                  # - note: attitude merging from a separate file
- *                                  #   supersedes attitude merging from a navigation file
- *                                  #   0: attitude merging off
- *                                  #   1: attitude merging on
- *   ATTITUDEFILE filename              # sets attitude file path
- *   ATTITUDEFORMAT constant            # sets attitude file format [1]
- *                                  # - attitude files can be in one of four ASCII
- *                                  #   table formats
- *                                  #   1: format is <time_d roll pitch heave>
- *                                  #   2: format is <yr mon day hour min sec roll pitch heave>
- *                                  #   3: format is <yr jday hour min sec roll pitch heave>
- *                                  #   4: format is <yr jday daymin sec roll pitch heave>
- *                                  # - time_d = decimal seconds since 1/1/1970
- *                                  # - daymin = decimal minutes start of day
- *                                  # - roll = positive starboard up, degrees
- *                                  # - pitch = positive forward up, degrees
- *                                  # - heave = positive up, meters
- *
- * SONARDEPTH MERGING:
- *   SONARDEPTHMODE mode            # sets sonardepth merging [0]
- *                                  # - note: sonardepth merged before
- *                                  #   draft corrections applied
- *                                  # - note: sonardepth merging from a separate file
- *                                  #   supersedes draft merging from a navigation file
- *                                  #   0: sonardepth merging off
- *                                  #   1: sonardepth merging on
- *   SONARDEPTHFILE filename        # sets sonardepth file path
- *   SONARDEPTHFORMAT constant      # sets sonardepth file format [1]
- *                                  # - sonardepth files can be in one of four ASCII
- *                                  #   table formats
- *                                  #   1: format is <time_d sonardepth>
- *                                  #   2: format is <yr mon day hour min sec sonardepth>
- *                                  #   3: format is <yr jday hour min sec sonardepth>
- *                                  #   4: format is <yr jday daymin sec sonardepth>
- *                                  # - time_d = decimal seconds since 1/1/1970
- *                                  # - daymin = decimal minutes start of day
- *                                  # - sonardepth = depth of sonar, positive down, meters
- *
- * DATA CUTTING:
- *   DATACUTCLEAR                   # clears all data cutting commands
- *   DATACUT kind mode min max      # adds data cutting command that flags
- *                                  # specified bathymetery and amplitude
- *                                  # beams and zeroes specified sidescan
- *                                  # pixels. Note that cutting bathymetry
- *                                  # means flagging beams, which affects
- *                                  # both bathymetry and amplitude data.
- *                                  # In contrast, cutting amplitude data
- *                                  # means zeroing the values without
- *                                  # affecting the bathymetry, and
- *                                  # cutting sidescan also means zeroing
- *                                  # the values.
- *                                  # - kind:
- *                                  #   0: bathymetry
- *                                  #   1: amplitude
- *                                  #   2: sidescan
- *                                  # - mode:
- *                                  #   0: no cut
- *                                  #   1: cut by beam/pixel number
- *                                  #   2: cut by distance
- *                                  #   3: cut by speed
- *                                  # - min: minimum beam/pixel number
- *                                  #   or acrosstrack distance for data
- *                                  #   data cutting zone.
- *                                  # - max: maximum beam/pixel number
- *                                  #   or acrosstrack distance for data
- *                                  #   data cutting zone.
- *   BATHCUTNUMBER min max          # adds data cutting command to cut
- *                                  #   bathymetry by beam number from
- *                                  #   beam min to beam max.
- *   BATHCUTDISTANCE min max        # adds data cutting command to cut
- *                                  #   bathymetry by beam number from
- *                                  #   acrosstrack distance  min to
- *                                  #   distance max.
- *   BATHCUTSPEED min max           # adds data cutting command to cut
- *                                  #   all bathymetry in pings with
- *                                  #   speed less than min or more
- *                                  #   than max
- *   AMPCUTNUMBER min max           # adds data cutting command to cut
- *                                  #   amplitude by beam number from
- *                                  #   beam min to beam max.
- *   AMPCUTDISTANCE min max         # adds data cutting command to cut
- *                                  #   amplitude by beam number from
- *                                  #   acrosstrack distance  min to
- *                                  #   distance max.
- *   AMPCUTSPEED min max            # adds data cutting command to cut
- *                                  #   all amplitude in pings with
- *                                  #   speed less than min or more
- *                                  #   than max
- *   SSCUTNUMBER min max            # adds data cutting command to cut
- *                                  #   sidescan by beam number from
- *                                  #   beam min to beam max.
- *   SSCUTDISTANCE min max          # adds data cutting command to cut
- *                                  #   sidescan by beam number from
- *                                  #   acrosstrack distance  min to
- *                                  #   distance max.
- *   SSCUTSPEED min max             # adds data cutting command to cut
- *                                  #   all sidescan in pings with
- *                                  #   speed less than min or more
- *                                  #   than max
- *
- * BATHYMETRY EDITING:
- *   EDITSAVEMODE boolean           # turns on reading edit save file (from mbedit) [0]
- *   EDITSAVEFILE filename          # sets edit save file path (from mbedit) [none]
- *
- * BATHYMETRY RECALCULATION:
- *   SVPMODE mode                   # sets bathymetry recalculation by raytracing [0]
- *                                  #  0: raytracing off
- *                                  #  1: raytracing on
- *                                  #  2: translate to/from corrected bathymetry according to CORRECTED
- *   RAYTRACE boolean               # sets bathymetry recalculation by raytracing (obsolete) [0]
- *                                  #  0: raytracing off
- *                                  #  1: raytracing on
- *   SVPFILE filename               # sets svp file path [no default]
- *   SSVMODE mode                   # sets ssv mode [0]
- *                                  #  0: use ssv from file
- *                                  #  1: offset ssv from file (set by SSV)
- *                                  #  2: use constant ssv (set by SSV)
- *   SSV constant/offset            # sets ssv value or offset (m/s) [1500.0]
- *   TTMODE mode                    # sets handling of travel times [0]
- *                                  #  0: do not change travel times.
- *                                  #  1: travel time correction by multiply
- *   TTMULTIPLY multiplier          # sets value multiplied by travel times [1.0]
- *   ANGLEMODE mode                 # sets handling of beam angles [0]
- *                                  #  0: do not change beam angles
- *                                  #  1: adjust beams angles by Snell's law
- *                                  #     ignoring sonar array geometry
- *                                  #  2: adjust beams angles by Snell's law
- *                                  #     using array geometry
- *   SOUNDSPEEDREF boolean          # sets raytraced bathymetry to "corrected" values [1]
- *
- * STATIC BEAM BATHYMETRY OFFSETS:
- *   STATICMODE mode                # sets offsetting of bathymetry by per-beam statics [0]
- *                                  #  0: static correction off
- *                                  #  1: static correction on
- *   STATICFILE filename            # sets static per-beam file path [no default]
- *                                  #   - static files are two-column ascii tables
- *                                  #     with the beam # in the first column and
- *                                  #     the depth offset in m in the second column
- *
- * DRAFT CORRECTION:
- *   DRAFTMODE mode                 # sets draft correction [0]
- *                                  # - note: draft merged from navigation before
- *                                  #   draft correction applied
- *                                  #   0: no draft correction
- *                                  #   1: draft correction by offset
- *                                  #   2: draft correction by multiply
- *                                  #   3: draft correction by offset and multiply
- *                                  #   4: draft set to constant
- *   DRAFT constant                 # sets draft value (m) [0.0]
- *   DRAFTOFFSET offset             # sets value added to draft (m) [0.0]
- *   DRAFTMULTIPLY multiplier       # sets value multiplied by draft [1.0]
- *
- * HEAVE CORRECTION:
- *   HEAVEMODE mode                 # sets heave correction [0]
- *                                  #   0: no heave correction
- *                                  #   1: heave correction by offset
- *                                  #   2: heave correction by multiply
- *                                  #   3: heave correction by offset and multiply
- *   HEAVEOFFSET offset             # sets value added to heave (m)
- *   HEAVEMULTIPLY multiplier       # sets value multiplied by heave
- *
- * LEVER CORRECTION:
- *   LEVERMODE mode                 # sets heave correction by lever correction [0]
- *                                  #   0: no heave correction by lever calculation
- *                                  #   1: heave correction by lever calculation
- *				    # - note: lever calculation finds heave at the
- *                                  #   sonar head location by adding motion
- *                                  #   inferred from roll and pitch projected
- *                                  #   from the vru location.
- *   VRUOFFSETX constant            # sets vru athwartship offset (meters) [0.0]
- *                                  # - note: the effective athwartship distance
- *                                  #   between the vru and the sonar head is
- *                                  #   (VRUOFFSETX - SONAROFFSETX), and the
- *                                  #   lever calculation is made using this
- *                                  #   effective distance.
- *                                  # - note: athwartship distance is positive to
- *                                  #   starboard.
- *   VRUOFFSETY constant            # sets vru fore-aft offset (meters) [0.0]
- *                                  # - note: the effective fore-aft distance
- *                                  #   between the vru and the sonar head is
- *                                  #   (VRUOFFSETY - SONAROFFSETY), and the
- *                                  #   lever calculation is made using this
- *                                  #   effective distance.
- *                                  # - note: fore-aft distance is positive forward.
- *   VRUOFFSETZ constant            # sets vru vertical offset (meters) [0.0]
- *                                  # - note: the effective vertical distance
- *                                  #   between the vru and the sonar head is
- *                                  #   (VRUOFFSETZ - SONAROFFSETZ), and the
- *                                  #   lever calculation is made using this
- *                                  #   effective distance.
- *                                  # - note: vertical distance is positive down.
- *   SONAROFFSETX constant          # sets sonar athwartship offset (meters) [0.0]
- *                                  # - note: this value is used for both
- *                                  #   navigation shifts and lever calculations.
- *                                  # - note: athwartship distance is positive to
- *                                  #   starboard.
- *   SONAROFFSETY constant          # sets vru fore-aft offset (meters) [0.0]
- *                                  # - note: this value is used for both
- *                                  #   navigation shifts and lever calculations.
- *                                  # - note: fore-aft distance is positive forward.
- *   SONAROFFSETZ constant          # sets vru vertical offset (meters) [0.0]
- *                                  # - note: this value is used for lever
- *                                  #   calculations.
- *                                  # - note: vertical distance is positive down.
- *
- * ROLL CORRECTION:
- *   ROLLBIASMODE mode              # sets roll correction [0]
- *                                  #   0: no roll correction
- *                                  #   1: roll correction by single roll bias
- *                                  #   2: roll correction by separate port and starboard roll bias
- *   ROLLBIAS offset                # sets roll bias (degrees)
- *   ROLLBIASPORT offset            # sets port roll bias (degrees)
- *   ROLLBIASSTBD offset            # sets starboard roll bias (degrees)
- *
- * PITCH CORRECTION:
- *   PITCHBIASMODE mode             # sets pitch correction [0]
- *                                  #   0: no pitch correction
- *                                  #   1: pitch correction by pitch bias
- *   PITCHBIAS offset               # sets pitch bias (degrees)
- *
- * HEADING CORRECTION:
- *   HEADINGMODE mode               # sets heading correction [no heading correction]
- *                                  # - note: heading merged from navigation before
- *                                  #   heading correction applied
- *                                  #   0: no heading correction
- *                                  #   1: heading correction using course made good
- *                                  #   2: heading correction by offset
- *                                  #   3: heading correction using course made good and offset
- *   HEADINGOFFSET offset           # sets value added to heading (degrees)
- *
- * TIDE CORRECTION:
- *   TIDEMODE mode                  # sets tide correction [0]
- *                                  # - note: tide added to bathymetry after
- *                                  #   all other calculations and corrections
- *                                  #   0: tide correction off
- *                                  #   1: tide correction on
- *   TIDEFILE filename              # sets tide file path
- *   TIDEFORMAT constant            # sets tide file format [1]
- *                                  # - tide files can be in one of four ASCII
- *                                  #   table formats
- *                                  #   1: format is <time_d tide>
- *                                  #   2: format is <yr mon day hour min sec tide>
- *                                  #   3: format is <yr jday hour min sec tide>
- *                                  #   4: format is <yr jday daymin sec tide>
- *                                  # - time_d = decimal seconds since 1/1/1970
- *                                  # - daymin = decimal minutes start of day
- *
- * AMPLITUDE CORRECTION:
- *   AMPCORRMODE  boolean           # sets correction of amplitude by amplitude vs grazing
- *                                  # angle function
- *                                  #   0: amplitude correction off
- *                                  #   1: amplitude correction on
- *   AMPCORRFILE filename           # sets amplitude correction file path [no default]
- *   AMPCORRTYPE mode               # sets amplitude correction mode [0]
- *                                  #   0: correction is by subtraction
- *                                  #   1: correction is by division
- *   AMPCORRSYMMETRY boolean        # sets amplitude vs grazing angle table symmetry mode [0]
- *                                  #   0: amplitude vs grazing table left asymmetric
- *                                  #   1: amplitude vs grazing table forced to be symmetric
- *   AMPCORRANGLE constant          # sets characteristic angle for amplitude correction (degrees) [30.0]
- *   AMPCORRSLOPE boolean           # sets amplitude correction slope mode [0]
- *                                  #   0: local slope ignored in calculating correction
- *                                  #   1: local slope used in calculating correction
- *                                  #   2: topography grid used in calculating correction
- *                                  #      but slope ignored
- *                                  #   3: local slope from topography grid used in
- *                                  #      calculating correction
- *
- * SIDESCAN CORRECTION:
- *   SSCORRMODE  boolean            # sets correction of sidescan by amplitude vs grazing
- *                                  # angle function
- *                                  #   0: sidescan correction off
- *                                  #   1: sidescan correction on
- *   SSCORRFILE filename            # sets sidescan correction file path [no default]
- *   SSCORRTYPE mode                # sets sidescan correction mode [0]
- *                                  #   0: correction is by subtraction
- *                                  #   1: correction is by division
- *   SSCORRSYMMETRY boolean         # sets amplitude vs grazing angle table symmetry mode [0]
- *                                  #   0: amplitude vs grazing table left asymmetric
- *                                  #   1: amplitude vs grazing table forced to be symmetric
- *   SSCORRANGLE constant           # sets characteristic angle for sidescan correction (degrees) [30.0]
- *   SSCORRSLOPE boolean            # sets sidescan correction slope mode [0]
- *                                  #   0: local slope ignored in calculating correction
- *                                  #   1: local slope used in calculating correction
- *                                  #   2: topography grid used in calculating correction
- *                                  #      but slope ignored
- *                                  #   3: local slope from topography grid used in
- *                                  #      calculating correction
- *
- * AMPLITUDE/SIDESCAN TOPOGRAPHY CORRECTION:
- *    AMPSSCORRTOPOFILE filename    # sets amplitude/sidescan correction topography grid file path
- *
- * SIDESCAN RECALCULATION:
- *   SSRECALCMODE  boolean          # sets recalculation of sidescan for Simrad multibeam data
- *                                  #   0: sidescan recalculation off
- *                                  #   1: sidescan recalculation on
- *   SSPIXELSIZE constant           # sets recalculated sidescan pixel size (m) [0.0]
- *                                  # - a zero value causes the pixel size to be recalculated
- *                                  #   for every data record
- *   SSSWATHWIDTH  constant         # sets sidescan swath width (degrees) [0.0]
- *                                  # - a zero value causes the swath width to be recalculated
- *                                  #   for every data record
- *   SSINTERPOLATE  constant        # sets sidescan interpolation distance (number of pixels)
- *
- * METADATA INSERTION:
- *   METAVESSEL string              # sets mbinfo metadata string for vessel
- *   METAINSTITUTION string         # sets mbinfo metadata string for vessel operator institution or company
- *   METAPLATFORM string            # sets mbinfo metadata string for sonar platform (ship or vehicle)
- *   METASONAR string               # sets mbinfo metadata string for sonar model name
- *   METASONARVERSION string        # sets mbinfo metadata string for sonar version (usually software version)
- *   METACRUISEID string            # sets mbinfo metadata string for institutional cruise id
- *   METACRUISENAME string          # sets mbinfo metadata string for descriptive cruise name
- *   METAPI string                  # sets mbinfo metadata string for principal investigator
- *   METAPIINSTITUTION string       # sets mbinfo metadata string for principal investigator
- *   METACLIENT string              # sets mbinfo metadata string for data owner (usually PI institution)
- *   METASVCORRECTED boolean        # sets mbinfo metadata boolean for sound velocity corrected depths
- *   METATIDECORRECTED boolean      # sets mbinfo metadata boolean for tide corrected bathymetry
- *   METABATHEDITMANUAL boolean     # sets mbinfo metadata boolean for manually edited bathymetry
- *   METABATHEDITAUTO boolean       # sets mbinfo metadata boolean for automatically edited bathymetry
- *   METAROLLBIAS constant          # sets mbinfo metadata constant for roll bias (degrees + to starboard)
- *   METAPITCHBIAS constant         # sets mbinfo metadata constant for pitch bias (degrees + forward)
- *   METAHEADINGBIAS constant       # sets mbinfo metadata constant for heading bias (degrees)
- *   METADRAFT constant             # sets mbinfo metadata constant for vessel draft (m)
- *
- * PROCESSING KLUGES:
- *   KLUGE001                       # processing kluge 001
- *                                  #   - Apply corrections to travel time data in Hydrosweep DS2
- *                                  #     data collected on the R/V Maurice Ewing in 2001/2002
- *   KLUGE002                       # processing kluge 002
- *                                  #   - Apply corrections to travel time data in Hydrosweep DS2
- *                                  #     data collected on the R/V Maurice Ewing in 2001/2002
- *                                  #     enables correction of draft values in Simrad data
- *                                  #   - some Simrad multibeam data has had an
- *                                  #     error in which the heave has bee added
- *                                  #     to the sonar depth (draft for hull
- *                                  #     mounted sonars)
- *                                  #   - this correction subtracts the heave
- *                                  #     value from the sonar depth
- *   KLUGE003                       # processing kluge 003
- *				    #   enables correction of beam angles in SeaBeam 2112 data
- *				    #   - a data sample from the SeaBeam 2112 on
- *				    #     the USCG Icebreaker Healy (collected on
- *				    #     23 July 2003) was found to have an error
- *				    #     in which the beam angles had 0.25 times
- *				    #     the roll added
- *				    #   - this correction subtracts 0.25 * roll
- *				    #     from the beam angles before the bathymetry
- *				    #     is recalculated by raytracing through a
- *				    #     water sound velocity profile
- *				    #   - the mbprocess parameter files must be
- *				    #     set to enable bathymetry recalculation
- *				    #     by raytracing in order to apply this
- *				    #     correction
- *   KLUGE004                       # processing kluge 004
- *				    #   deletes survey data associated with duplicate
- *				    #   or reversed time tags
- *				    #   - if survey data records are encountered
- *				    #     with time tags less than or equal to the
- *				    #     last good time tag, an error is set and
- *				    #     the data record is not output to the
- *				    #     processed data file.
- *   KLUGE005                       # processing kluge 005
- *				    #   replaces survey record timestamps with
- *				    #   timestamps of corresponding merged navigation
- *				    #   records
- *				    #   - this feature allows users to fix
- *				    #     timestamp errors using MBnavedit and
- *				    #     then insert the corrected timestamps
- *				    #     into processed data
- *   KLUGE006                       # processing kluge 006
- *                                  #   changes sonar depth / draft values without
- *                                  #   changing bathymetry values
- *   KLUGE007                       # processing kluge 007
- *				    #   zeros alongtrack values greater than half
- *				    #   the altitude
- *				    #   - this targets some SeaBeam 2112 data originally
- *                                  #     processed using MB-System 4.6.10 that had
- *                                  #     a few pings with bad sidescan alongtrack values
- *				    #   - its not clear if this problem originated with
- *				    #     the data or a bug in MB-System 4.6.10
- *   KLUGE008                       # processing kluge 008 (not yet defined)
- *				    #   - occasionaly odd processing problems will
- *				    #     occur that are specific to a particular
- *				    #     survey or sonar version
- *				    #   - mbprocess will allow one-time fixes to
- *				    #     be defined as "kluges" that can be turned
- *				    #     on through the parameter files.
- *   KLUGE009                       # processing kluge 009 (not yet defined)
- *				    #   - occasionaly odd processing problems will
- *				    #     occur that are specific to a particular
- *				    #     survey or sonar version
- *				    #   - mbprocess will allow one-time fixes to
- *				    #     be defined as "kluges" that can be turned
- *				    #     on through the parameter files.
- *   KLUGE010                       # processing kluge 010 (not yet defined)
- *				    #   - occasionaly odd processing problems will
- *				    #     occur that are specific to a particular
- *				    #     survey or sonar version
- *				    #   - mbprocess will allow one-time fixes to
- *				    #     be defined as "kluges" that can be turned
- *				    #     on through the parameter files.
- *
- * MBprocess and its associated functions and programs use
- * the following file naming convention. The unprocessed swath
- * data file should have a name like "fileroot.mbxxx", where
- * fileroot can be anything and xxx corresponds to the MB-System
- * format id number. Given this kind of filename, we then have:
- *	fileroot.mbxxx.par	    : parameter file
- *	fileroot.mbxxx.nve	    : edited navigation from
- *					mbnavedit
- *	fileroot.mbxxx.nvX	    : adjusted navigation from
- *					mbnavadjust, with
- *					X={0,1,2,3,4,5,6,7,8,9}
- *	fileroot.mbxxx.esf	    : bathymetry edit save file
- *					from mbedit
- *
- * MBprocess and its associated programs utilize a simple file locking
- * mechanism to prevent multiple users or processes from working on
- * the same swath file simultaneously. This mechanism is instituted
- * using two functions: mbp_lockswathfile() and mbp_unlockswathfile().
- * The mbp_lockfile() function creates a *.lck file parallel to a
- * raw swathfile listing the program, purpose, and user locking the
- * file. While this file exists, other MB-System processing programs
- * (e.g. mbprocess, mbedit, mbeditviz, mbnavedit) will not open the
- * file (except in browse mode). The mbp_unlockfile() removes the
- * *.lck file, provided the program, purpose, and user match that
- * contained in the file. MBdatalist includes a capability to remove
- * locks from single files or entire datalist structures, allowing
- * the resetting of files left locked by crashed programs.
- *
- *
- * Author:	D. W. Caress
- * Date:	September 11, 2000
- * Updated:	August 4, 2009 (R/V Zephyr, Cleft Segment, Juan de Fuca Ridge)
- *
- *
- */
-
-/* start this include */
-#ifndef MB_PROCESS_DEF
-
-/* header file flag */
-#define	MB_PROCESS_DEF		1
-
-/* include mb_io.h if needed */
-#ifndef MB_IO_DEF
-#include "mb_io.h"
-#endif
-
-/* mbprocess value defines */
-#define MBP_FILENAMESIZE	MB_PATH_MAXLINE
-#define MBP_METANOVALUE		9999999.
-#define MBP_NAV_OFF		0
-#define MBP_NAV_ON		1
-#define MBP_NAVADJ_OFF		0
-#define MBP_NAVADJ_LL		1
-#define MBP_NAVADJ_LLZ		2
-#define MBP_NAV_LINEAR		0
-#define MBP_NAV_SPLINE		1
-#define MBP_ATTITUDE_OFF	0
-#define MBP_ATTITUDE_ON		1
-#define MBP_SONARDEPTH_OFF	0
-#define MBP_SONARDEPTH_ON	1
-#define	MBP_CUT_DATA_BATH	0
-#define	MBP_CUT_DATA_AMP	1
-#define	MBP_CUT_DATA_SS		2
-#define	MBP_CUT_MODE_NONE	0
-#define	MBP_CUT_MODE_NUMBER   	1
-#define	MBP_CUT_MODE_DISTANCE 	2
-#define	MBP_CUT_MODE_SPEED 	3
-#define	MBP_CUT_NUM_MAX		20
-#define MBP_EDIT_OFF		0
-#define MBP_EDIT_ON		1
-#define MBP_EDIT_FLAG		1
-#define MBP_EDIT_UNFLAG		2
-#define MBP_EDIT_ZERO		3
-#define MBP_EDIT_FILTER		4
-#define MBP_ESF_NOWRITE		0
-#define MBP_ESF_WRITE		1
-#define MBP_ESF_APPEND		2
-#define MBP_BATHRECALC_OFF	0
-#define MBP_BATHRECALC_RAYTRACE	1
-#define MBP_BATHRECALC_ROTATE	2
-#define MBP_BATHRECALC_OFFSET	3
-#define MBP_SVP_OFF		0
-#define MBP_SVP_ON		1
-#define MBP_SVP_SOUNDSPEEDREF	2
-#define MBP_SSV_OFF		0
-#define MBP_SSV_OFFSET		1
-#define MBP_SSV_SET		2
-#define MBP_TT_OFF		0
-#define MBP_TT_MULTIPLY		1
-#define	MBP_ANGLES_OK		0
-#define	MBP_ANGLES_SNELL	1
-#define	MBP_ANGLES_SNELLNULL	2
-#define MBP_STATIC_OFF		0
-#define MBP_STATIC_BEAM_ON	1
-#define MBP_STATIC_ANGLE_ON	2
-#define MBP_DRAFT_OFF		0
-#define MBP_DRAFT_OFFSET	1
-#define MBP_DRAFT_MULTIPLY	2
-#define MBP_DRAFT_MULTIPLYOFFSET	3
-#define MBP_DRAFT_SET		4
-#define MBP_HEAVE_OFF		0
-#define MBP_HEAVE_OFFSET	1
-#define MBP_HEAVE_MULTIPLY	2
-#define MBP_HEAVE_MULTIPLYOFFSET	3
-#define MBP_LEVER_OFF		0
-#define MBP_LEVER_ON		1
-#define MBP_ROLLBIAS_OFF	0
-#define MBP_ROLLBIAS_SINGLE	1
-#define MBP_ROLLBIAS_DOUBLE	2
-#define MBP_PITCHBIAS_OFF	0
-#define MBP_PITCHBIAS_ON	1
-#define MBP_HEADING_OFF         0
-#define MBP_HEADING_CALC        1
-#define MBP_HEADING_OFFSET      2
-#define MBP_HEADING_CALCOFFSET  3
-#define MBP_TIDE_OFF		0
-#define MBP_TIDE_ON		1
-#define MBP_AMPCORR_OFF		0
-#define MBP_AMPCORR_ON		1
-#define MBP_AMPCORR_UNKNOWN	-1
-#define MBP_AMPCORR_SUBTRACTION	0
-#define MBP_AMPCORR_DIVISION	1
-#define MBP_AMPCORR_ASYMMETRIC	0
-#define MBP_AMPCORR_SYMMETRIC	1
-#define MBP_AMPCORR_IGNORESLOPE	0
-#define MBP_AMPCORR_USESLOPE	1
-#define MBP_AMPCORR_USETOPO	2
-#define MBP_AMPCORR_USETOPOSLOPE	3
-#define MBP_SSCORR_OFF		0
-#define MBP_SSCORR_ON		1
-#define MBP_SSCORR_UNKNOWN	-1
-#define MBP_SSCORR_SUBTRACTION	0
-#define MBP_SSCORR_DIVISION	1
-#define MBP_SSCORR_ASYMMETRIC	0
-#define MBP_SSCORR_SYMMETRIC	1
-#define MBP_SSCORR_IGNORESLOPE	0
-#define MBP_SSCORR_USESLOPE	1
-#define MBP_SSCORR_USETOPO	2
-#define MBP_SSCORR_USETOPOSLOPE	3
-#define MBP_SSRECALC_OFF	0
-#define MBP_SSRECALC_ON		1
-#define MBP_CORRECTION_UNKNOWN	-1
-#define MBP_CORRECTION_NO	0
-#define MBP_CORRECTION_YES	1
-
-/* mbprocess file locking defines */
-#define MBP_LOCK_NONE		0
-#define MBP_LOCK_PROCESS	1
-#define MBP_LOCK_EDITBATHY	2
-#define MBP_LOCK_EDITNAV	3
-#define MBP_UNLOCK_OVERRIDE	0
-#define MBP_UNLOCK_PROCESS	1
-#define MBP_UNLOCK_EDITBATHY	2
-#define MBP_UNLOCK_EDITNAV	3
-
-/* mbprocess file checking */
-#define MB_PR_FILE_UP_TO_DATE		0
-#define MB_PR_FILE_NEEDS_PROCESSING	1
-#define MB_PR_FILE_NOT_EXIST		2
-#define MB_PR_NO_PARAMETER_FILE		3
-
-/* structure holding mbprocess parameters */
-struct mb_process_struct
-	{
-	/* general parameters */
-	int	mbp_ifile_specified;
-	char	mbp_ifile[MBP_FILENAMESIZE];
-	int	mbp_ofile_specified;
-	char	mbp_ofile[MBP_FILENAMESIZE];
-	int	mbp_format_specified;
-	int	mbp_format;
-
-	/* navigation merging */
-	int	mbp_nav_mode;
-	char	mbp_navfile[MBP_FILENAMESIZE];
-	int	mbp_nav_format;
-	int	mbp_nav_heading;
-	int	mbp_nav_speed;
-	int	mbp_nav_draft;
-	int	mbp_nav_attitude;
-	int	mbp_nav_algorithm;
-	double	mbp_nav_timeshift;
-	int	mbp_nav_shift;
-	double	mbp_nav_offsetx;
-	double	mbp_nav_offsety;
-	double	mbp_nav_offsetz;
-	double	mbp_nav_shiftlon;
-	double	mbp_nav_shiftlat;
-
-	/* adjusted navigation merging */
-	int	mbp_navadj_mode;
-	char	mbp_navadjfile[MBP_FILENAMESIZE];
-	int	mbp_navadj_algorithm;
-
-	/* attitude merging */
-	int	mbp_attitude_mode;
-	char	mbp_attitudefile[MBP_FILENAMESIZE];
-	int	mbp_attitude_format;
-
-	/* sonardepth merging */
-	int	mbp_sonardepth_mode;
-	char	mbp_sonardepthfile[MBP_FILENAMESIZE];
-	int	mbp_sonardepth_format;
-
-	/* data cutting */
-	int	mbp_cut_num;
-	int	mbp_cut_kind[MBP_CUT_NUM_MAX];
-	int	mbp_cut_mode[MBP_CUT_NUM_MAX];
-	double	mbp_cut_min[MBP_CUT_NUM_MAX];
-	double	mbp_cut_max[MBP_CUT_NUM_MAX];
-
-	/* bathymetry editing */
-	int	mbp_edit_mode;
-	char	mbp_editfile[MBP_FILENAMESIZE];
-
-	/* bathymetry recalculation */
-	int	mbp_bathrecalc_mode;
-	int	mbp_svp_mode;
-	char	mbp_svpfile[MBP_FILENAMESIZE];
-	int	mbp_ssv_mode;
-	double	mbp_ssv;
-	int	mbp_tt_mode;
-	double	mbp_tt_mult;
-	int	mbp_angle_mode;
-	int	mbp_corrected;
-	int	mbp_static_mode;
-	char	mbp_staticfile[MBP_FILENAMESIZE];
-
-	/* draft correction */
-	int	mbp_draft_mode;
-	double	mbp_draft;
-	double	mbp_draft_offset;
-	double	mbp_draft_mult;
-
-	/* heave correction */
-	int	mbp_heave_mode;
-	double	mbp_heave;
-	double	mbp_heave_mult;
-
-	/* lever correction */
-	int	mbp_lever_mode;
-	double	mbp_vru_offsetx;
-	double	mbp_vru_offsety;
-	double	mbp_vru_offsetz;
-	double	mbp_sonar_offsetx;
-	double	mbp_sonar_offsety;
-	double	mbp_sonar_offsetz;
-
-	/* roll correction */
-	int	mbp_rollbias_mode;
-	double	mbp_rollbias;
-	double	mbp_rollbias_port;
-	double	mbp_rollbias_stbd;
-
-	/* pitch correction */
-	int	mbp_pitchbias_mode;
-	double	mbp_pitchbias;
-
-	/* heading correction */
-	int	mbp_heading_mode;
-	double	mbp_headingbias;
-
-	/* tide correction */
-	int	mbp_tide_mode;
-	char	mbp_tidefile[MBP_FILENAMESIZE];
-	int	mbp_tide_format;
-
-	/* amplitude correction */
-	int	mbp_ampcorr_mode;
-	char	mbp_ampcorrfile[MBP_FILENAMESIZE];
-	int	mbp_ampcorr_type;
-	int	mbp_ampcorr_symmetry;
-	double	mbp_ampcorr_angle;
-	int	mbp_ampcorr_slope;
-
-	/* sidescan correction */
-	int	mbp_sscorr_mode;
-	char	mbp_sscorrfile[MBP_FILENAMESIZE];
-	int	mbp_sscorr_type;
-	int	mbp_sscorr_symmetry;
-	double	mbp_sscorr_angle;
-	int	mbp_sscorr_slope;
-
-	/* amplitude and sidescan correction */
-	char	mbp_ampsscorr_topofile[MBP_FILENAMESIZE];
-
-	/* sidescan recalculation */
-	int	mbp_ssrecalc_mode;
-	double	mbp_ssrecalc_pixelsize;
-	double	mbp_ssrecalc_swathwidth;
-	int	mbp_ssrecalc_interpolate;
-
-	/* metadata strings */
-	char	mbp_meta_vessel[MBP_FILENAMESIZE];
-	char	mbp_meta_institution[MBP_FILENAMESIZE];
-	char	mbp_meta_platform[MBP_FILENAMESIZE];
-	char	mbp_meta_sonar[MBP_FILENAMESIZE];
-	char	mbp_meta_sonarversion[MBP_FILENAMESIZE];
-	char	mbp_meta_cruiseid[MBP_FILENAMESIZE];
-	char	mbp_meta_cruisename[MBP_FILENAMESIZE];
-	char	mbp_meta_pi[MBP_FILENAMESIZE];
-	char	mbp_meta_piinstitution[MBP_FILENAMESIZE];
-	char	mbp_meta_client[MBP_FILENAMESIZE];
-	int	mbp_meta_svcorrected;
-	int	mbp_meta_tidecorrected;
-	int	mbp_meta_batheditmanual;
-	int	mbp_meta_batheditauto;
-	double	mbp_meta_rollbias;
-	double	mbp_meta_pitchbias;
-	double	mbp_meta_headingbias;
-	double	mbp_meta_draft;
-
-	/* processing kluges */
-	int	mbp_kluge001;
-	int	mbp_kluge002;
-	int	mbp_kluge003;
-	int	mbp_kluge004;
-	int	mbp_kluge005;
-	int	mbp_kluge006;
-	int	mbp_kluge007;
-	int	mbp_kluge008;
-	int	mbp_kluge009;
-	int	mbp_kluge010;
-	};
-
-/* edit save file definitions */
-#define MB_ESF_MAXTIMEDIFF 0.00011
-#define MB_ESF_MULTIPLICITY_FACTOR	1000000
-struct mb_edit_struct
-	{
-	double	time_d;
-	int	beam;
-	int	action;
-	int	use;
-	};
-struct mb_esf_struct
-	{
-	char	esffile[MB_PATH_MAXLINE];
-	char	esstream[MB_PATH_MAXLINE];
-	int	byteswapped;
-	int	nedit;
-	struct mb_edit_struct	*edit;
-	FILE	*esffp;
-	FILE	*essfp;
-        int     startnextsearch;
-	};
-
-int mb_pr_checkstatus(int verbose, char *file,
-			int *prstatus, int *error);
-int mb_pr_readpar(int verbose, char *file, int lookforfiles,
-			struct mb_process_struct *process,
-			int *error);
-int mb_pr_writepar(int verbose, char *file,
-			struct mb_process_struct *process,
-			int *error);
-int mb_pr_bathmode(int verbose, struct mb_process_struct *process,
-			int *error);
-int mb_pr_default_output(int verbose, struct mb_process_struct *process,
-			int *error);
-int mb_pr_get_output(int verbose, int *format,
-			char *ifile, char *ofile,
-			int *error);
-int mb_pr_check(int verbose, char *ifile,
-			int *nparproblem,
-			int *ndataproblem,
-			int *error);
-int mb_pr_update_ofile(int verbose, char *file,
-			int	mbp_ofile_specified,
-			char	*mbp_ofile,
-			int	*error);
-int mb_pr_update_format(int verbose, char *file,
-			int mbp_format_specified,
-			int mbp_format,
-			int *error);
-int mb_pr_update_rollbias(int verbose, char *file,
-			int	mbp_rollbias_mode,
-			double	mbp_rollbias,
-			double	mbp_rollbias_port,
-			double	mbp_rollbias_stbd,
-			int *error);
-int mb_pr_update_pitchbias(int verbose, char *file,
-			int	mbp_pitchbias_mode,
-			double	mbp_pitchbias,
-			int *error);
-int mb_pr_update_draft(int verbose, char *file,
-			int	mbp_draft_mode,
-			double	mbp_draft,
-			double	mbp_draft_offset,
-			double	mbp_draft_mult,
-			int *error);
-int mb_pr_update_heave(int verbose, char *file,
-			int	mbp_heave_mode,
-			double	mbp_heave,
-			double	mbp_heave_mult,
-			int *error);
-int mb_pr_update_lever(int verbose, char *file,
-			int	mbp_lever_mode,
-			double	mbp_vru_offsetx,
-			double	mbp_vru_offsety,
-			double	mbp_vru_offsetz,
-			double	mbp_sonar_offsetx,
-			double	mbp_sonar_offsety,
-			double	mbp_sonar_offsetz,
-			int *error);
-int mb_pr_update_tide(int verbose, char *file,
-			int	mbp_tide_mode,
-			char *mbp_tidefile,
-			int	mbp_tide_format,
-			int *error);
-int mb_pr_update_tt(int verbose, char *file,
-			int	mbp_tt_mode,
-			double	mbp_tt_mult,
-			int *error);
-int mb_pr_update_ssv(int verbose, char *file,
-			int	mbp_ssv_mode,
-			double	mbp_ssv,
-			int *error);
-int mb_pr_update_svp(int verbose, char *file,
-			int	mbp_svp_mode,
-			char	*mbp_svpfile,
-			int	mbp_angle_mode,
-			int	mbp_corrected,
-			int *error);
-int mb_pr_update_static(int verbose, char *file,
-			int	mbp_static_mode,
-			char	*mbp_staticfile,
-			int *error);
-int mb_pr_update_navadj(int verbose, char *file,
-			int	mbp_navadj_mode,
-			char	*mbp_navadjfile,
-			int	mbp_navadj_algorithm,
-			int *error);
-int mb_pr_update_nav(int verbose, char *file,
-			int	mbp_nav_mode,
-			char	*mbp_navfile,
-			int	mbp_nav_format,
-			int	mbp_nav_heading,
-			int	mbp_nav_speed,
-			int	mbp_nav_draft,
-			int	mbp_nav_attitude,
-			int	mbp_nav_algorithm,
-			double mbp_nav_timeshift,
-			int *error);
-int mb_pr_update_attitude(int verbose, char *file,
-			int	mbp_attitude_mode,
-			char	*mbp_attitudefile,
-			int	mbp_attitude_format,
-			int *error);
-int mb_pr_update_sonardepth(int verbose, char *file,
-			int	mbp_sonardepth_mode,
-			char	*mbp_sonardepthfile,
-			int	mbp_sonardepth_format,
-			int *error);
-int mb_pr_update_navshift(int verbose, char *file,
-			int	mbp_nav_shift,
-			double	mbp_nav_offsetx,
-			double	mbp_nav_offsety,
-			double	mbp_nav_offsetz,
-			double	mbp_nav_shiftlon,
-			double	mbp_nav_shiftlat,
-			int *error);
-int mb_pr_update_heading(int verbose, char *file,
-			int	mbp_heading_mode,
-			double	mbp_headingbias,
-			int *error);
-int mb_pr_update_datacut(int verbose, char *file,
-			int	mbp_cut_num,
-			int	*mbp_cut_kind,
-			int	*mbp_cut_mode,
-			double	*mbp_cut_min,
-			double	*mbp_cut_max,
-			int *error);
-int mb_pr_update_edit(int verbose, char *file,
-			int	mbp_edit_mode,
-			char	*mbp_editfile,
-			int *error);
-int mb_pr_update_ampcorr(int verbose, char *file,
-			int	mbp_ampcorr_mode,
-			char	*mbp_ampcorrfile,
-			int	mbp_ampcorr_type,
-			int	mbp_ampcorr_symmetry,
-			double	mbp_ampcorr_angle,
-			int	mbp_ampcorr_slope,
-			char	*mbp_ampcorr_topofile,
-			int *error);
-int mb_pr_update_sscorr(int verbose, char *file,
-			int	mbp_sscorr_mode,
-			char	*mbp_sscorrfile,
-			int	mbp_sscorr_type,
-			int	mbp_sscorr_symmetry,
-			double	mbp_sscorr_angle,
-			int	mbp_sscorr_slope,
-			char	*mbp_sscorr_topofile,
-			int *error);
-int mb_pr_update_ssrecalc(int verbose, char *file,
-			int	mbp_ssrecalc_mode,
-			double	mbp_ssrecalc_pixelsize,
-			double	mbp_ssrecalc_swathwidth,
-			int	mbp_ssrecalc_interpolate,
-			int *error);
-int mb_pr_update_metadata(int verbose, char *file,
-			char	*mbp_meta_vessel,
-			char	*mbp_meta_institution,
-			char	*mbp_meta_platform,
-			char	*mbp_meta_sonar,
-			char	*mbp_meta_sonarversion,
-			char	*mbp_meta_cruiseid,
-			char	*mbp_meta_cruisename,
-			char	*mbp_meta_pi,
-			char	*mbp_meta_piinstitution,
-			char	*mbp_meta_client,
-			int	mbp_meta_svcorrected,
-			int	mbp_meta_tidecorrected,
-			int	mbp_meta_batheditmanual,
-			int	mbp_meta_batheditauto,
-			double	mbp_meta_rollbias,
-			double	mbp_meta_pitchbias,
-			double	mbp_meta_headingbias,
-			double	mbp_meta_draft,
-			int *error);
-int mb_pr_update_kluges(int verbose, char *file,
-			int	mbp_kluge001,
-			int	mbp_kluge002,
-			int	mbp_kluge003,
-			int	mbp_kluge004,
-			int	mbp_kluge005,
-			int	mbp_kluge006,
-			int	mbp_kluge007,
-			int	mbp_kluge008,
-			int	mbp_kluge009,
-			int	mbp_kluge010,
-			int *error);
-int mb_pr_get_ofile(int verbose, char *file,
-			int	*mbp_ofile_specified,
-			char	*mbp_ofile,
-			int	*error);
-int mb_pr_get_format(int verbose, char *file,
-			int *mbp_format_specified,
-			int *mbp_format,
-			int *error);
-int mb_pr_get_rollbias(int verbose, char *file,
-			int	*mbp_rollbias_mode,
-			double	*mbp_rollbias,
-			double	*mbp_rollbias_port,
-			double	*mbp_rollbias_stbd,
-			int *error);
-int mb_pr_get_pitchbias(int verbose, char *file,
-			int	*mbp_pitchbias_mode,
-			double	*mbp_pitchbias,
-			int *error);
-int mb_pr_get_draft(int verbose, char *file,
-			int	*mbp_draft_mode,
-			double	*mbp_draft,
-			double	*mbp_draft_offset,
-			double	*mbp_draft_mult,
-			int *error);
-int mb_pr_get_heave(int verbose, char *file,
-			int	*mbp_heave_mode,
-			double	*mbp_heave,
-			double	*mbp_heave_mult,
-			int *error);
-int mb_pr_get_lever(int verbose, char *file,
-			int	*mbp_lever_mode,
-			double	*mbp_vru_offsetx,
-			double	*mbp_vru_offsety,
-			double	*mbp_vru_offsetz,
-			double	*mbp_sonar_offsetx,
-			double	*mbp_sonar_offsety,
-			double	*mbp_sonar_offsetz,
-			int *error);
-int mb_pr_get_tide(int verbose, char *file,
-			int	*mbp_tide_mode,
-			char *mbp_tidefile,
-			int	*mbp_tide_format,
-			int *error);
-int mb_pr_get_tt(int verbose, char *file,
-			int	*mbp_tt_mode,
-			double	*mbp_tt_mult,
-			int *error);
-int mb_pr_get_ssv(int verbose, char *file,
-			int	*mbp_ssv_mode,
-			double	*mbp_ssv,
-			int *error);
-int mb_pr_get_svp(int verbose, char *file,
-			int	*mbp_svp_mode,
-			char	*mbp_svpfile,
-			int	*mbp_angle_mode,
-			int	*mbp_corrected,
-			int *error);
-int mb_pr_get_static(int verbose, char *file,
-			int	*mbp_static_mode,
-			char	*mbp_staticfile,
-			int *error);
-int mb_pr_get_navadj(int verbose, char *file,
-			int	*mbp_navadj_mode,
-			char	*mbp_navadjfile,
-			int	*mbp_navadj_algorithm,
-			int *error);
-int mb_pr_get_nav(int verbose, char *file,
-			int	*mbp_nav_mode,
-			char	*mbp_navfile,
-			int	*mbp_nav_format,
-			int	*mbp_nav_heading,
-			int	*mbp_nav_speed,
-			int	*mbp_nav_draft,
-			int	*mbp_nav_attitude,
-			int	*mbp_nav_algorithm,
-			double *mbp_nav_timeshift,
-			int *error);
-int mb_pr_get_attitude(int verbose, char *file,
-			int	*mbp_attitude_mode,
-			char	*mbp_attitudefile,
-			int	*mbp_attitude_format,
-			int *error);
-int mb_pr_get_sonardepth(int verbose, char *file,
-			int	*mbp_sonardepth_mode,
-			char	*mbp_sonardepthfile,
-			int	*mbp_sonardepth_format,
-			int *error);
-int mb_pr_get_navshift(int verbose, char *file,
-			int	*mbp_nav_shift,
-			double	*mbp_nav_offsetx,
-			double	*mbp_nav_offsety,
-			double	*mbp_nav_offsetz,
-			double	*mbp_nav_shiftlon,
-			double	*mbp_nav_shiftlat,
-			int *error);
-int mb_pr_get_heading(int verbose, char *file,
-			int	*mbp_heading_mode,
-			double	*mbp_headingbias,
-			int *error);
-int mb_pr_get_datacut(int verbose, char *file,
-			int	*mbp_cut_num,
-			int	*mbp_cut_kind,
-			int	*mbp_cut_mode,
-			double	*mbp_cut_min,
-			double	*mbp_cut_max,
-			int *error);
-int mb_pr_get_edit(int verbose, char *file,
-			int	*mbp_edit_mode,
-			char	*mbp_editfile,
-			int *error);
-int mb_pr_get_ampcorr(int verbose, char *file,
-			int	*mbp_ampcorr_mode,
-			char	*mbp_ampcorrfile,
-			int	*mbp_ampcorr_type,
-			int	*mbp_ampcorr_symmetry,
-			double	*mbp_ampcorr_angle,
-			int	*mbp_ampcorr_slope,
-			char	*mbp_ampcorr_topofile,
-			int *error);
-int mb_pr_get_sscorr(int verbose, char *file,
-			int	*mbp_sscorr_mode,
-			char	*mbp_sscorrfile,
-			int	*mbp_sscorr_type,
-			int	*mbp_sscorr_symmetry,
-			double	*mbp_sscorr_angle,
-			int	*mbp_sscorr_slope,
-			char	*mbp_sscorr_topofile,
-			int *error);
-int mb_pr_get_ssrecalc(int verbose, char *file,
-			int	*mbp_ssrecalc_mode,
-			double	*mbp_ssrecalc_pixelsize,
-			double	*mbp_ssrecalc_swathwidth,
-			int	*mbp_ssrecalc_interpolate,
-			int *error);
-int mb_pr_get_metadata(int verbose, char *file,
-			char	*mbp_meta_vessel,
-			char	*mbp_meta_institution,
-			char	*mbp_meta_platform,
-			char	*mbp_meta_sonar,
-			char	*mbp_meta_sonarversion,
-			char	*mbp_meta_cruiseid,
-			char	*mbp_meta_cruisename,
-			char	*mbp_meta_pi,
-			char	*mbp_meta_piinstitution,
-			char	*mbp_meta_client,
-			int	*mbp_meta_svcorrected,
-			int	*mbp_meta_tidecorrected,
-			int	*mbp_meta_batheditmanual,
-			int	*mbp_meta_batheditauto,
-			double	*mbp_meta_rollbias,
-			double	*mbp_meta_pitchbias,
-			double	*mbp_meta_headingbias,
-			double	*mbp_meta_draft,
-			int *error);
-int mb_pr_get_kluges(int verbose, char *file,
-			int	*mbp_kluge001,
-			int	*mbp_kluge002,
-			int	*mbp_kluge003,
-			int	*mbp_kluge004,
-			int	*mbp_kluge005,
-			int	*mbp_kluge006,
-			int	*mbp_kluge007,
-			int	*mbp_kluge008,
-			int	*mbp_kluge009,
-			int	*mbp_kluge010,
-			int *error);
-int mb_pr_set_bathyslope(int verbose,
-			int nsmooth,
-			int nbath, char *beamflag, double *bath, double *bathacrosstrack,
-			int *ndepths, double *depths, double *depthacrosstrack,
-			int *nslopes, double *slopes, double *slopeacrosstrack,
-			double *depthsmooth,
-			int *error);
-int mb_pr_set_bathyslopenew(int verbose,
-                        int nsmooth,
-                        int nbath, char *beamflag, double *bath, double *bathacrosstrack,
-                        int *ndepths, double *depths, double *depthacrosstrack,
-                        int *nslopes, double *slopes, double *slopeacrosstrack,
-                        double *depthsmooth,
-                        int *error);
-int mb_pr_get_bathyslope(int verbose,
-			int ndepths, double *depths, double *depthacrosstrack,
-			int nslopes, double *slopes, double *slopeacrosstrack,
-			double acrosstrack, double *depth, double *slope,
-			int *error);
-int mb_pr_point_in_quad(int verbose, double px, double py,
-			double *x, double *y, int *error);
-int mb_esf_check(int verbose, char *swathfile, char *esffile,
-			int *found, int *error);
-int mb_esf_load(int verbose, char *swathfile,
-			int load, int output,
-			char *esffile,
-			struct mb_esf_struct *esf,
-			int *error);
-int mb_esf_open(int verbose, char *esffile,
-			int load, int output,
-			struct mb_esf_struct *esf,
-			int *error);
-int mb_esf_fixtimestamps(int verbose, struct mb_esf_struct *esf,
-			double time_d, double tolerance, int *error);
-int mb_esf_apply(int verbose, struct mb_esf_struct *esf,
-			double time_d, int pingmultiplicity, int nbath, char *beamflag,
-			int *error);
-int mb_esf_save(int verbose, struct mb_esf_struct *esf,
-			double time_d, int beam, int action, int *error);
-int mb_ess_save(int verbose, struct mb_esf_struct *esf,
-		double time_d, int beam, int action, int *error);
-int mb_esf_close(int verbose, struct mb_esf_struct *esf, int *error);
-
-int mb_pr_lockswathfile(int verbose, char *file, int purpose,
-			char *program, int *error);
-int mb_pr_unlockswathfile(int verbose, char *file, int purpose,
-			char *program, int *error);
-int mb_pr_lockinfo(int verbose, char *file, int *locked,
-			int *purpose, char *program, char *user, char *cpu,
-			char *date, int *error);
-
-/* end this include */
-#endif
diff --git a/src/mbio/mb_proj.c b/src/mbio/mb_proj.c
deleted file mode 100644
index 16fce30..0000000
--- a/src/mbio/mb_proj.c
+++ /dev/null
@@ -1,333 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mb_proj.c	7/16/2002
- *    $Id: mb_proj.c 2247 2015-05-29 21:28:28Z caress $
- *
- *    Copyright (c) 2002-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mb_proj.c includes the "mb_" functions used to initialize
- * projections, and then to do forward (mb_proj_forward())
- * and inverse (mb_proj_inverse()) projections
- * between geographic coordinates (longitude and latitude) and
- * projected coordinates (e.g. eastings and northings in meters).
- * One can also tranlate between coordinate systems using mb_proj_transform().
- * This code uses libproj. The code in libproj derives without modification
- * from the PROJ.4 distribution. PROJ was originally developed by
- * Gerard Evandim, and is now maintained and distributed by
- * Frank Warmerdam, <warmerdam at pobox.com>
- *
- * David W. Caress
- * July 16, 2002
- * RVIB Nathaniel B. Palmer
- * Somewhere west of Conception, Chile
- *
- * Author:	D. W. Caress
- * Date:	July 16, 2002
- *
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <math.h>
-#include <sys/stat.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_define.h"
-#include "proj_api.h"
-#include "projections.h"
-
-static char rcs_id[]="$Id: mb_proj.c 2247 2015-05-29 21:28:28Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mb_proj_init(int verbose,
-		char *projection,
-		void **pjptr,
-		int *error)
-{
-	char	*function_name = "mb_proj_init";
-	int	status = MB_SUCCESS;
-	char 	pj_init_args[MB_PATH_MAXLINE];
-	projPJ 	pj;
-	struct stat file_status;
-	int	fstat;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       projection: %s\n",projection);
-		}
-
-	/* check the existence of the projection database */
-	if ((fstat = stat(projectionfile, &file_status)) == 0
-		&& (file_status.st_mode & S_IFMT) != S_IFDIR)
-		{
-		/* initialize the projection */
-		sprintf(pj_init_args, "+init=%s:%s",
-				projectionfile,projection);
-		pj = pj_init_plus(pj_init_args);
-		*pjptr = (void *) pj;
-
-		/* check success */
-		if (*pjptr != NULL)
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		else
-			{
-			*error = MB_ERROR_BAD_PROJECTION;
-			status = MB_FAILURE;
-			}
-		}
-	else
-		{
-		/* cannot initialize the projection */
-		fprintf(stderr,"\nUnable to open projection database at expected location:\n\t%s\n",
-			projectionfile);
-		fprintf(stderr,"Set projection database location using the $MBSYSTEM_HOME and $PROJECTIONS \ntags in the install_makefiles script.\n\n");
-		*error = MB_ERROR_MISSING_PROJECTIONS;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       pjptr:           %p\n",(void *)*pjptr);
-		fprintf(stderr,"dbg2       error:           %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:          %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_proj_free(int verbose,
-		void **pjptr,
-		int *error)
-{
-	char	*function_name = "mb_proj_free";
-	int	status = MB_SUCCESS;
-	projPJ 	pj;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       pjptr:      %p\n",(void *)*pjptr);
-		}
-
-	/* free the projection */
-	if (pjptr != NULL)
-		{
-		pj = (projPJ) *pjptr;
-		pj_free(pj);
-		*pjptr = NULL;
-		}
-
-	/* assume success */
-	*error = MB_ERROR_NO_ERROR;
-	status = MB_SUCCESS;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       pjptr:           %p\n",(void *)*pjptr);
-		fprintf(stderr,"dbg2       error:           %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:          %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_proj_forward(int verbose,
-		void *pjptr,
-		double lon, double lat,
-		double *easting, double *northing,
-		int *error)
-{
-	char	*function_name = "mb_proj_forward";
-	int	status = MB_SUCCESS;
-	projPJ 	pj;
-	projUV	pjxy;
-	projUV	pjll;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       pjptr:      %p\n",(void *)pjptr);
-		fprintf(stderr,"dbg2       lon:        %f\n",lon);
-		fprintf(stderr,"dbg2       lat:        %f\n",lat);
-		}
-
-	/* do forward projection */
-	if (pjptr != NULL)
-		{
-		pj = (projPJ) pjptr;
-		pjll.u = DTR * lon;
-		pjll.v = DTR * lat;
-		pjxy = pj_fwd(pjll, pj);
-		*easting = pjxy.u;
-		*northing = pjxy.v;
-		}
-
-	/* assume success */
-	*error = MB_ERROR_NO_ERROR;
-	status = MB_SUCCESS;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       easting:         %f\n",*easting);
-		fprintf(stderr,"dbg2       northing:        %f\n",*northing);
-		fprintf(stderr,"dbg2       error:           %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:          %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_proj_inverse(int verbose,
-		void *pjptr,
-		double easting, double northing,
-		double *lon, double *lat,
-		int *error)
-{
-	char	*function_name = "mb_proj_inverse";
-	int	status = MB_SUCCESS;
-	projPJ 	pj;
-	projUV	pjxy;
-	projUV	pjll;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       pjptr:      %p\n",(void *)pjptr);
-		fprintf(stderr,"dbg2       easting:    %f\n",easting);
-		fprintf(stderr,"dbg2       northing:   %f\n",northing);
-		}
-
-	/* do forward projection */
-	if (pjptr != NULL)
-		{
-		pj = (projPJ) pjptr;
-		pjxy.u = easting;
-		pjxy.v = northing;
-		pjll = pj_inv(pjxy, pj);
-		*lon = RTD * pjll.u;
-		*lat = RTD * pjll.v;
-		}
-
-	/* assume success */
-	*error = MB_ERROR_NO_ERROR;
-	status = MB_SUCCESS;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       lon:             %f\n",*lon);
-		fprintf(stderr,"dbg2       lat:             %f\n",*lat);
-		fprintf(stderr,"dbg2       error:           %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:          %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mb_proj_transform(int verbose,
-		void *pjsrcptr,
-		void *pjdstptr,
-		int npoint,
-		double *x, double *y, double *z,
-		int *error)
-{
-	char	*function_name = "mb_proj_transform";
-	int	status = MB_SUCCESS;
-	int	i;
-
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       pjptr:      %p\n",(void *)pjsrcptr);
-		fprintf(stderr,"dbg2       pjptr:      %p\n",(void *)pjdstptr);
-		fprintf(stderr,"dbg2       npoint:     %d\n",npoint);
-		for (i=0;i<npoint;i++)
-			fprintf(stderr,"dbg2       point[%d]:  x:%f y:%f z:%f\n", i, x[i], y[i], z[i]);
-		}
-
-	/* do transform */
-	if (pjsrcptr != NULL && pjdstptr != NULL)
-		{
-		pj_transform((projPJ *)pjsrcptr, (projPJ *)pjdstptr, npoint, 1, x, y, z);
-		}
-
-	/* assume success */
-	*error = MB_ERROR_NO_ERROR;
-	status = MB_SUCCESS;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       npoint:     %d\n",npoint);
-		for (i=0;i<npoint;i++)
-			fprintf(stderr,"dbg2       point[%d]:  x:%f y:%f z:%f\n", i, x[i], y[i], z[i]);
-		fprintf(stderr,"dbg2       error:           %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:          %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mb_put_all.c b/src/mbio/mb_put_all.c
deleted file mode 100644
index 700f849..0000000
--- a/src/mbio/mb_put_all.c
+++ /dev/null
@@ -1,242 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mb_put_all.c	2/4/93
- *    $Id: mb_put_all.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1993-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mb_put_all.c writes multibeam data to a file
- * which has been initialized by mb_write_init(). Crosstrack distances
- * are used rather than lon and lat for the beams. Values are also read
- * from a storage data structure including
- * all possible values output by the particular multibeam system
- * associated with the specified format.
- *
- * Author:	D. W. Caress
- * Date:	February 4, 1993
- *
- * $Log: mb_put_all.c,v $
- * Revision 5.4  2006/03/06 21:47:48  caress
- * Implemented changes suggested by Bob Courtney of the Geological Survey of Canada to support translating Reson data to GSF.
- *
- * Revision 5.3  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.2  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.1  2001/07/20 00:31:11  caress
- * Release 5.0.beta03
- *
- * Revision 5.0  2000/12/01 22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.8  2000/10/11  01:02:30  caress
- * Convert to ANSI C
- *
- * Revision 4.7  2000/09/30  06:32:11  caress
- * Snapshot for Dale.
- *
- * Revision 4.6  1998/10/05  17:46:15  caress
- * MB-System version 4.6beta
- *
- * Revision 4.5  1997/04/21  17:02:07  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.4  1996/04/22  13:21:19  caress
- * Now have DTR and MIN/MAX defines in mb_define.h
- *
- * Revision 4.4  1996/04/22  13:21:19  caress
- * Now have DTR and MIN/MAX defines in mb_define.h
- *
- * Revision 4.3  1995/03/06  19:38:54  caress
- * Changed include strings.h to string.h for POSIX compliance.
- *
- * Revision 4.2  1994/10/21  12:11:53  caress
- * Release V4.0
- *
- * Revision 4.1  1994/05/11  18:43:58  caress
- * Fixed debug statement for time_d value.
- *
- * Revision 4.1  1994/05/11  18:43:58  caress
- * Fixed debug statement for time_d value.
- *
- * Revision 4.0  1994/03/06  00:01:56  caress
- * First cut at version 4.0
- *
- * Revision 4.4  1994/03/03  03:39:43  caress
- * Fixed copyright message.
- *
- * Revision 4.3  1994/02/23  00:32:27  caress
- * Fixed several debug messages plus a couple real bugs.
- *
- * Revision 4.2  1994/02/20  03:37:05  caress
- * Fixed a number of bad variable names.
- *
- * Revision 4.1  1994/02/20  02:36:37  caress
- * Fixed the calling parameters.
- *
- * Revision 4.0  1994/02/20  02:33:08  caress
- * First cut at new version. Includes new handling of
- * sidescan and amplitude data.
- *
- * Revision 3.2  1993/06/15  16:00:29  caress
- * Fixed bug which caused mbmerge to change non-survey data
- * records into survey data records.  Code change is on line
- * 142 which used to read:
- *      mb_io_ptr->new_kind = MB_DATA_DATA;
- * but now reads:
- *      mb_io_ptr->new_kind = kind;
- *
- * Revision 3.1  1993/05/14  22:37:56  sohara
- * fixed rcs_id message
- *
- * Revision 3.0  1993/04/23  18:21:17  dale
- * Initial version
- *
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mb_define.h"
-
-/*--------------------------------------------------------------------*/
-int mb_put_all(int verbose, void *mbio_ptr, void *store_ptr,
-		int usevalues, int kind,
-		int time_i[7], double time_d,
-		double navlon, double navlat,
-		double speed, double heading,
-		int nbath, int namp, int nss,
-		char *beamflag, double *bath, double *amp,
-		double *bathacrosstrack, double *bathalongtrack,
-		double *ss, double *ssacrosstrack, double *ssalongtrack,
-		char *comment, int *error)
-{
-  static char rcs_id[]="$Id: mb_put_all.c 2227 2015-02-05 21:12:31Z caress $";
-	char	*function_name = "mb_put_all";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       usevalues:  %d\n",usevalues);
-		fprintf(stderr,"dbg2       kind:       %d\n",kind);
-		}
-	if (verbose >= 2 && usevalues == MB_YES && kind != MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"dbg2       time_i[0]:  %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:  %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:  %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:  %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:  %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:  %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:  %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:     %f\n",time_d);
-		fprintf(stderr,"dbg2       navlon:     %f\n",navlon);
-		fprintf(stderr,"dbg2       navlat:     %f\n",navlat);
-		fprintf(stderr,"dbg2       speed:      %f\n",speed);
-		fprintf(stderr,"dbg2       heading:    %f\n",heading);
-		}
-	if (verbose >= 2 && usevalues == MB_YES && kind == MB_DATA_DATA)
-		{
-		fprintf(stderr,"dbg2       nbath:      %d\n",nbath);
-		if (verbose >= 3 && nbath > 0)
-		  {
-		  fprintf(stderr,"dbg3       beam  flag  bath  crosstrack alongtrack\n");
-		  for (i=0;i<nbath;i++)
-		    fprintf(stderr,"dbg3       %4d   %3d   %f    %f     %f\n",
-			i,beamflag[i],bath[i],
-			bathacrosstrack[i],bathalongtrack[i]);
-		  }
-		fprintf(stderr,"dbg2       namp:       %d\n",namp);
-		if (verbose >= 3 && namp > 0)
-		  {
-		  fprintf(stderr,"dbg3       beam    amp  crosstrack alongtrack\n");
-		  for (i=0;i<namp;i++)
-		    fprintf(stderr,"dbg3       %4d   %f    %f     %f\n",
-			i,amp[i],
-			bathacrosstrack[i],bathalongtrack[i]);
-		  }
-		fprintf(stderr,"dbg2       nss:        %d\n",nss);
-		if (verbose >= 3 && nss > 0)
-		  {
-		  fprintf(stderr,"dbg3       pixel sidescan crosstrack alongtrack\n");
-		  for (i=0;i<nss;i++)
-		    fprintf(stderr,"dbg3       %4d   %f    %f     %f\n",
-			i,ss[i],
-			ssacrosstrack[i],ssalongtrack[i]);
-		  }
-		}
-	if (verbose >= 2 && usevalues == MB_YES && kind == MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"dbg2       comment:    %s\n",comment);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* insert values into structure if requested */
-	if (usevalues == MB_YES)
-		{
-		status = mb_insert(verbose,mbio_ptr,store_ptr,
-			kind,time_i,time_d,navlon,navlat,speed,heading,
-			nbath,namp,nss,
-			beamflag,bath,amp,
-			bathacrosstrack,bathalongtrack,
-			ss,ssacrosstrack,ssalongtrack,
-			comment,error);
-		}
-
-	/* write the data */
-	status = mb_write_ping(verbose,mbio_ptr,store_ptr,error);
-
-	/* increment counters */
-	if (status == MB_SUCCESS)
-		{
-		if (kind == MB_DATA_DATA)
-			mb_io_ptr->ping_count++;
-		else if (kind == MB_DATA_NAV)
-			mb_io_ptr->nav_count++;
-		else if (kind == MB_DATA_COMMENT)
-			mb_io_ptr->comment_count++;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mb_put_comment.c b/src/mbio/mb_put_comment.c
deleted file mode 100644
index 2750f3b..0000000
--- a/src/mbio/mb_put_comment.c
+++ /dev/null
@@ -1,128 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mb_put_comment.c	7/15/97
- *    $Id: mb_put_comment.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1997-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mb_put.c writes comments to a swath sonar data file
- * which has been initialized by mb_write_init().
- *
- * Author:	D. W. Caress
- * Date:	July 15, 1997
- *
- * $Log: mb_put_comment.c,v $
- * Revision 5.3  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.2  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.1  2001/07/20 00:31:11  caress
- * Release 5.0.beta03
- *
- * Revision 5.0  2000/12/01  22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.3  2000/10/11  01:02:30  caress
- * Convert to ANSI C
- *
- * Revision 4.2  2000/09/30  06:32:11  caress
- * Snapshot for Dale.
- *
- * Revision 4.1  1998/10/05  18:32:27  caress
- * MB-System version 4.6beta
- *
- * Revision 4.0  1997/07/25  14:25:40  caress
- * Version 4.5beta2.
- *
- * Revision 4.0  1997/07/25  14:25:40  caress
- * Version 4.5beta2.
- *
- * Revision 1.1  1997/07/25  14:19:53  caress
- * Initial revision
- *
- *
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mb_define.h"
-
-/*--------------------------------------------------------------------*/
-int mb_put_comment(int verbose, void *mbio_ptr, char *comment, int *error)
-{
-  static char rcs_id[]="$Id $";
-	char	*function_name = "mb_put_comment";
-	int	status;
-	struct mb_io_struct *mb_io_ptr;
-	int	time_i[7] = {0, 0, 0, 0, 0, 0, 0};
-	double	time_d = 0.0;
-	double	navlon = 0.0;
-	double	navlat = 0.0;
-	double	speed = 0.0;
-	double	heading = 0.0;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       comment:    %s\n",comment);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* insert comment using mb_insert */
-	for (i=0;i<7;i++)
-	    time_i[i] = 0;
-	time_d = 0.0;
-	navlon = 0.0;
-	status = mb_insert(verbose,mbio_ptr,mb_io_ptr->store_data,
-			MB_DATA_COMMENT,
-			time_i,time_d,navlon,navlat,speed,heading,
-			0,0,0,
-			NULL,NULL,NULL,
-			NULL,NULL,
-			NULL,NULL,NULL,
-			comment,error);
-
-	/* write the data */
-	status = mb_write_ping(verbose,mbio_ptr,mb_io_ptr->store_data,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mb_read.c b/src/mbio/mb_read.c
deleted file mode 100644
index 66c8549..0000000
--- a/src/mbio/mb_read.c
+++ /dev/null
@@ -1,1100 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mb_read.c	2/20/93
- *    $Id: mb_read.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1993-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mb_read.c reads and averages multibeam data from a file
- * which has been initialized by mb_read_init(). Crosstrack distances
- * are mapped into lon and lat.
- *
- * Author:	D. W. Caress
- * Date:	February 20, 1993
- *
- * $Log: mb_read.c,v $
- * Revision 5.8  2005/11/05 00:48:05  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.7  2004/04/27 01:46:13  caress
- * Various updates of April 26, 2004.
- *
- * Revision 5.6  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.5  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.4  2002/05/29 23:36:53  caress
- * Release 5.0.beta18
- *
- * Revision 5.3  2002/05/02 03:55:34  caress
- * Release 5.0.beta17
- *
- * Revision 5.2  2001/07/20 00:31:11  caress
- * Release 5.0.beta03
- *
- * Revision 5.1  2001/03/22 20:45:56  caress
- * Trying to make 5.0.beta0...
- *
- * Revision 5.0  2000/12/01  22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.13  2000/10/11  01:02:30  caress
- * Convert to ANSI C
- *
- * Revision 4.12  2000/09/30  06:32:11  caress
- * Snapshot for Dale.
- *
- * Revision 4.11  1999/08/08  04:12:45  caress
- * Added ELMK2XSE format.
- *
- * Revision 4.10  1998/11/06  23:05:33  caress
- * Fixed problem with calculation of sslon and sslat.
- *
- * Revision 4.9  1998/10/05  17:46:15  caress
- * MB-System version 4.6beta
- *
- * Revision 4.8  1997/04/21  17:02:07  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.7  1996/04/22  13:21:19  caress
- * Now have DTR and MIN/MAX defines in mb_define.h
- *
- * Revision 4.7  1996/04/22  13:21:19  caress
- * Now have DTR and MIN/MAX defines in mb_define.h
- *
- * Revision 4.6  1996/04/22  10:57:09  caress
- * DTR define now in mb_io.h
- *
- * Revision 4.5  1995/04/06  15:03:23  caress
- * Reset mb_io_ptr->error_save to MB_ERROR_NO_ERROR after it is
- * used to fix bug where time gap errors were perpetuated after
- * they occurred.
- *
- * Revision 4.4  1995/03/06  19:38:54  caress
- * Changed include strings.h to string.h for POSIX compliance.
- *
- * Revision 4.3  1994/10/21  12:11:53  caress
- * Release V4.0
- *
- * Revision 4.2  1994/07/29  18:46:51  caress
- * Changes associated with supporting Lynx OS (byte swapped) and
- * using unix second time base (for time_d values).
- *
- * Revision 4.1  1994/06/05  02:42:58  caress
- * Fixed xtrack/ltrack to/from lon/lat conversions.
- *
- * Revision 4.0  1994/03/06  00:01:56  caress
- * First cut at version 4.0
- *
- * Revision 4.6  1994/03/03  03:39:43  caress
- * Fixed copyright message.
- *
- * Revision 4.5  1994/02/26  22:12:17  caress
- * Fixed major bug where input array pointers bath, bathlon, and
- * bathlat were defined as int instead of double.
- *
- * Revision 4.4  1994/02/23  00:32:27  caress
- * Fixed several debug messages plus a couple real bugs.
- *
- * Revision 4.3  1994/02/20  03:37:05  caress
- * Fixed a number of bad variable names.
- *
- * Revision 4.2  1994/02/20  02:44:52  caress
- * Fixed some debug messages.
- *
- * Revision 4.1  1994/02/20  02:38:23  caress
- * Fixed the calling parameter definitions.
- *
- * Revision 4.0  1994/02/20  01:36:13  caress
- * First cut of new version.  Includes new handling of
- * sidescan and amplitude dat.
- *
- * Revision 3.4  1993/06/09  08:16:54  caress
- * Some unknown minor change.
- *
- * Revision 3.3  1993/06/05  07:19:31  caress
- * Fixed heading averaging problem.
- *
- * Revision 3.2  1993/06/02  11:11:07  caress
- * Forced mb_read to overwrite undefined beams with zero
- * depth and position values.
- *
- * Revision 3.1  1993/05/14  22:38:14  sohara
- * fixed rcs_id message
- *
- * Revision 3.0  1993/04/23  18:44:02  dale
- * Initial version
- *
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mb_define.h"
-
-static char rcs_id[]="$Id: mb_read.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mb_read(int verbose, void *mbio_ptr,
-		int *kind, int *pings,
-		int time_i[7], double *time_d,
-		double *navlon, double *navlat,
-		double *speed, double *heading,
-		double *distance, double *altitude, double *sonardepth,
-		int *nbath, int *namp, int *nss,
-		char *beamflag, double *bath, double *amp,
-		double *bathlon, double *bathlat,
-		double *ss, double *sslon, double *sslat,
-		char *comment, int *error)
-{
-
-	char	*function_name = "mb_read";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	char	*store_ptr;
-	int	i;
-	int	done;
-	int	reset_last;
-	double	mtodeglon, mtodeglat;
-	double	headingx, headingy;
-	double	dx, dy;
-	double	delta_time = 0.0;
-	double	denom;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-	store_ptr = (char *) mb_io_ptr->store_data;
-
-	/* initialize binning values */
-	mb_io_ptr->pings_read = 0;
-	mb_io_ptr->pings_binned = 0;
-	mb_io_ptr->time_d = 0.0;
-	mb_io_ptr->lon = 0.0;
-	mb_io_ptr->lat = 0.0;
-	mb_io_ptr->speed = 0.0;
-	mb_io_ptr->heading = 0.0;
-	headingx = 0.0;
-	headingy = 0.0;
-	for (i=0;i<mb_io_ptr->beams_bath_max;i++)
-		{
-		mb_io_ptr->beamflag[i] = MB_FLAG_NULL;
-		mb_io_ptr->bath[i] = 0.0;
-		mb_io_ptr->bath_acrosstrack[i] = 0.0;
-		mb_io_ptr->bath_alongtrack[i] = 0.0;
-		mb_io_ptr->bath_num[i] = 0;
-		}
-	for (i=0;i<mb_io_ptr->beams_amp_max;i++)
-		{
-		mb_io_ptr->amp[i] = 0.0;
-		mb_io_ptr->amp_num[i] = 0;
-		}
-	for (i=0;i<mb_io_ptr->pixels_ss_max;i++)
-		{
-		mb_io_ptr->ss[i] = 0.0;
-		mb_io_ptr->ss_acrosstrack[i] = 0.0;
-		mb_io_ptr->ss_alongtrack[i] = 0.0;
-		mb_io_ptr->ss_num[i] = 0;
-		}
-
-	/* read the data */
-	done = MB_NO;
-	while (done == MB_NO)
-		{
-
-		/* print debug statements */
-		if (verbose >= 2)
-			{
-			fprintf(stderr,"\ndbg2  About to read ping in function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg2       need_new_ping: %d\n",
-				mb_io_ptr->need_new_ping);
-			fprintf(stderr,"dbg2       ping_count:    %d\n",
-				mb_io_ptr->ping_count);
-			fprintf(stderr,"dbg2       pings_read:    %d\n",
-				mb_io_ptr->pings_read);
-			fprintf(stderr,"dbg2       status:        %d\n",status);
-			fprintf(stderr,"dbg2       error:         %d\n",*error);
-			}
-
-		/* get next ping */
-		if (mb_io_ptr->need_new_ping)
-			{
-			status = mb_read_ping(verbose,mbio_ptr,store_ptr,
-						&mb_io_ptr->new_kind,error);
-
-			/* log errors */
-			if (*error < MB_ERROR_NO_ERROR)
-				mb_notice_log_error(verbose, mbio_ptr, *error);
-
-			/* if io arrays have been reallocated, update the
-				pointers of arrays passed into this function,
-				as these pointers may have changed */
-			if (status == MB_SUCCESS
-				&& mb_io_ptr->new_kind == MB_DATA_DATA)
-				{
-				if (mb_io_ptr->bath_arrays_reallocated == MB_YES)
-					{
-					status = mb_update_arrayptr(verbose, mbio_ptr, (void **) &beamflag, error);
-					status = mb_update_arrayptr(verbose, mbio_ptr, (void **) &bath, error);
-					status = mb_update_arrayptr(verbose, mbio_ptr, (void **) &bathlon, error);
-					status = mb_update_arrayptr(verbose, mbio_ptr, (void **) &bathlat, error);
-					mb_io_ptr->bath_arrays_reallocated = MB_NO;
-					}
-				if (mb_io_ptr->amp_arrays_reallocated == MB_YES)
-					{
-					status = mb_update_arrayptr(verbose, mbio_ptr, (void **) &amp, error);
-					mb_io_ptr->amp_arrays_reallocated = MB_NO;
-					}
-				if (mb_io_ptr->ss_arrays_reallocated == MB_YES)
-					{
-					status = mb_update_arrayptr(verbose, mbio_ptr, (void **) &ss, error);
-					status = mb_update_arrayptr(verbose, mbio_ptr, (void **) &sslon, error);
-					status = mb_update_arrayptr(verbose, mbio_ptr, (void **) &sslat, error);
-					mb_io_ptr->ss_arrays_reallocated = MB_NO;
-					}
-				}
-
-			/* if survey data read into storage array */
-			if (status == MB_SUCCESS
-				&& (mb_io_ptr->new_kind == MB_DATA_DATA
-					|| mb_io_ptr->new_kind == MB_DATA_COMMENT))
-				{
-				status = mb_extract(verbose,
-					mbio_ptr, store_ptr,
-					&mb_io_ptr->new_kind,
-					mb_io_ptr->new_time_i,
-					&mb_io_ptr->new_time_d,
-					&mb_io_ptr->new_lon,
-					&mb_io_ptr->new_lat,
-					&mb_io_ptr->new_speed,
-					&mb_io_ptr->new_heading,
-					&mb_io_ptr->new_beams_bath,
-					&mb_io_ptr->new_beams_amp,
-					&mb_io_ptr->new_pixels_ss,
-					mb_io_ptr->new_beamflag,
-					mb_io_ptr->new_bath,
-					mb_io_ptr->new_amp,
-					mb_io_ptr->new_bath_acrosstrack,
-					mb_io_ptr->new_bath_alongtrack,
-					mb_io_ptr->new_ss,
-					mb_io_ptr->new_ss_acrosstrack,
-					mb_io_ptr->new_ss_alongtrack,
-					mb_io_ptr->new_comment,
-					error);
-				}
-			if (status == MB_SUCCESS
-				&& mb_io_ptr->new_kind == MB_DATA_DATA)
-				{
-				status = mb_extract_altitude(verbose,
-					mbio_ptr, store_ptr,
-					&mb_io_ptr->new_kind,
-					sonardepth,
-					altitude,
-					error);
-				}
-
-			/* set errors if not survey data */
-			if (status == MB_SUCCESS)
-				{
-				mb_io_ptr->need_new_ping = MB_NO;
-				if (mb_io_ptr->new_kind == MB_DATA_DATA)
-					mb_io_ptr->ping_count++;
-				else if (mb_io_ptr->new_kind == MB_DATA_COMMENT)
-					{
-					mb_io_ptr->comment_count++;
-					status = MB_FAILURE;
-					*error = MB_ERROR_COMMENT;
-					mb_io_ptr->new_error = *error;
-					mb_notice_log_error(verbose, mbio_ptr, *error);
-					}
-				else if (mb_io_ptr->new_kind == MB_DATA_SUBBOTTOM_MCS
-					|| mb_io_ptr->new_kind == MB_DATA_SUBBOTTOM_CNTRBEAM
-					|| mb_io_ptr->new_kind == MB_DATA_SUBBOTTOM_SUBBOTTOM)
-					{
-					status = MB_FAILURE;
-					*error = MB_ERROR_SUBBOTTOM;
-					mb_io_ptr->new_error = *error;
-					mb_notice_log_error(verbose, mbio_ptr, *error);
-					}
-				else
-					{
-					status = MB_FAILURE;
-					*error = MB_ERROR_OTHER;
-					mb_io_ptr->new_error = *error;
-					mb_notice_log_error(verbose, mbio_ptr, *error);
-					}
-				}
-			}
-		else
-			{
-			*error = mb_io_ptr->new_error;
-			if (*error == MB_ERROR_NO_ERROR)
-				status = MB_SUCCESS;
-			else
-				status = MB_FAILURE;
-			}
-
-		/* if not a fatal error, increment ping counter */
-		if (status == MB_SUCCESS
-			&& mb_io_ptr->new_kind == MB_DATA_DATA)
-			mb_io_ptr->pings_read++;
-
-		/* if first ping read set "old" navigation values */
-		if (status == MB_SUCCESS
-			&& mb_io_ptr->new_kind == MB_DATA_DATA
-			&& mb_io_ptr->ping_count == 1)
-			{
-			mb_io_ptr->old_time_d = mb_io_ptr->new_time_d;
-			mb_io_ptr->old_lon = mb_io_ptr->new_lon;
-			mb_io_ptr->old_lat = mb_io_ptr->new_lat;
-			}
-
-		/* print debug statements */
-		if (verbose >= 2)
-			{
-			fprintf(stderr,"\ndbg2  New ping read in function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg2       need_new_ping: %d\n",
-				mb_io_ptr->need_new_ping);
-			fprintf(stderr,"dbg2       ping_count:    %d\n",
-				mb_io_ptr->ping_count);
-			fprintf(stderr,"dbg2       comment_count: %d\n",
-				mb_io_ptr->comment_count);
-			fprintf(stderr,"dbg2       pings_read:    %d\n",
-				mb_io_ptr->pings_read);
-			fprintf(stderr,"dbg2       status:        %d\n",
-				status);
-			fprintf(stderr,"dbg2       error:         %d\n",
-				*error);
-			fprintf(stderr,"dbg2       new_error:     %d\n",
-				mb_io_ptr->new_error);
-			}
-
-		/* check for out of location or time bounds */
-		if (status == MB_SUCCESS
-			&& mb_io_ptr->new_kind == MB_DATA_DATA)
-			{
-			if (mb_io_ptr->new_lon < mb_io_ptr->bounds[0]
-				|| mb_io_ptr->new_lon > mb_io_ptr->bounds[1]
-				|| mb_io_ptr->new_lat < mb_io_ptr->bounds[2]
-				|| mb_io_ptr->new_lat > mb_io_ptr->bounds[3])
-				{
-				status = MB_FAILURE;
-				*error = MB_ERROR_OUT_BOUNDS;
-				mb_notice_log_error(verbose, mbio_ptr, *error);
-				}
-			else if (mb_io_ptr->etime_d > mb_io_ptr->btime_d
-				&& mb_io_ptr->new_time_d > MB_TIME_D_UNKNOWN
-				&& (mb_io_ptr->new_time_d > mb_io_ptr->etime_d
-					|| mb_io_ptr->new_time_d < mb_io_ptr->btime_d))
-				{
-				status = MB_FAILURE;
-				*error = MB_ERROR_OUT_TIME;
-				mb_notice_log_error(verbose, mbio_ptr, *error);
-				}
-			else if (mb_io_ptr->etime_d < mb_io_ptr->btime_d
-				&& mb_io_ptr->new_time_d > MB_TIME_D_UNKNOWN
-				&& (mb_io_ptr->new_time_d > mb_io_ptr->etime_d
-					&& mb_io_ptr->new_time_d < mb_io_ptr->btime_d))
-				{
-				status = MB_FAILURE;
-				*error = MB_ERROR_OUT_TIME;
-				mb_notice_log_error(verbose, mbio_ptr, *error);
-				}
-			}
-
-		/* check for time gap */
-		if (status == MB_SUCCESS
-			&& mb_io_ptr->new_time_d > MB_TIME_D_UNKNOWN
-			&& mb_io_ptr->new_kind == MB_DATA_DATA
-			&& mb_io_ptr->ping_count > 1)
-			{
-			if ((mb_io_ptr->new_time_d - mb_io_ptr->last_time_d)
-				> 60*mb_io_ptr->timegap)
-				{
-				status = MB_FAILURE;
-				*error = MB_ERROR_TIME_GAP;
-				mb_notice_log_error(verbose, mbio_ptr, *error);
-				}
-			}
-
-		/* print debug statements */
-		if (verbose >= 4)
-			{
-			fprintf(stderr,"\ndbg4  New ping checked by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  New ping values:\n");
-			fprintf(stderr,"dbg4       ping_count:    %d\n",
-				mb_io_ptr->ping_count);
-			fprintf(stderr,"dbg4       comment_count: %d\n",
-				mb_io_ptr->comment_count);
-			fprintf(stderr,"dbg4       pings_avg:     %d\n",
-				mb_io_ptr->pings_avg);
-			fprintf(stderr,"dbg4       pings_read:    %d\n",
-				mb_io_ptr->pings_read);
-			fprintf(stderr,"dbg4       error:         %d\n",
-				mb_io_ptr->new_error);
-			fprintf(stderr,"dbg4       status:        %d\n",
-				status);
-			}
-		if (verbose >= 4
-			&& mb_io_ptr->new_kind == MB_DATA_COMMENT)
-			{
-			fprintf(stderr,"dbg4       comment:     \ndbg4       %s\n",
-				mb_io_ptr->new_comment);
-			}
-		else if (verbose >= 4
-			&& mb_io_ptr->new_kind == MB_DATA_DATA
-			&& *error <= MB_ERROR_NO_ERROR
-			&& *error > MB_ERROR_COMMENT)
-			{
-			fprintf(stderr,"dbg4       time_i[0]:     %d\n",
-				mb_io_ptr->new_time_i[0]);
-			fprintf(stderr,"dbg4       time_i[1]:     %d\n",
-				mb_io_ptr->new_time_i[1]);
-			fprintf(stderr,"dbg4       time_i[2]:     %d\n",
-				mb_io_ptr->new_time_i[2]);
-			fprintf(stderr,"dbg4       time_i[3]:     %d\n",
-				mb_io_ptr->new_time_i[3]);
-			fprintf(stderr,"dbg4       time_i[4]:     %d\n",
-				mb_io_ptr->new_time_i[4]);
-			fprintf(stderr,"dbg4       time_i[5]:     %d\n",
-				mb_io_ptr->new_time_i[5]);
-			fprintf(stderr,"dbg4       time_i[6]:     %d\n",
-				mb_io_ptr->new_time_i[6]);
-			fprintf(stderr,"dbg4       time_d:        %f\n",
-				mb_io_ptr->new_time_d);
-			fprintf(stderr,"dbg4       longitude:     %f\n",
-				mb_io_ptr->new_lon);
-			fprintf(stderr,"dbg4       latitude:      %f\n",
-				mb_io_ptr->new_lat);
-			fprintf(stderr,"dbg4       speed:         %f\n",
-				mb_io_ptr->new_speed);
-			fprintf(stderr,"dbg4       heading:       %f\n",
-				mb_io_ptr->new_heading);
-			fprintf(stderr,"dbg4       beams_bath:    %d\n",
-				mb_io_ptr->new_beams_bath);
-			if (mb_io_ptr->new_beams_bath > 0)
-			  {
-			  fprintf(stderr,"dbg4       beam   bath  crosstrack alongtrack\n");
-			  for (i=0;i<mb_io_ptr->new_beams_bath;i++)
-			    fprintf(stderr,"dbg4       %4d   %3d    %f    %f     %f\n",
-				i,mb_io_ptr->new_beamflag[i],
-				mb_io_ptr->new_bath[i],
-				mb_io_ptr->new_bath_acrosstrack[i],
-				mb_io_ptr->new_bath_alongtrack[i]);
-			  }
-			fprintf(stderr,"dbg4       beams_amp:     %d\n",
-				mb_io_ptr->new_beams_amp);
-			if (mb_io_ptr->new_beams_amp > 0)
-			  {
-			  fprintf(stderr,"dbg4       beam    amp  crosstrack alongtrack\n");
-			  for (i=0;i<mb_io_ptr->new_beams_amp;i++)
-			    fprintf(stderr,"dbg4       %4d   %f    %f     %f\n",
-				i,mb_io_ptr->new_amp[i],
-				mb_io_ptr->new_bath_acrosstrack[i],
-				mb_io_ptr->new_bath_alongtrack[i]);
-			  }
-			fprintf(stderr,"dbg4       pixels_ss:     %d\n",
-				mb_io_ptr->new_pixels_ss);
-			if (mb_io_ptr->new_pixels_ss > 0)
-			  {
-			  fprintf(stderr,"dbg4       pixel sidescan crosstrack alongtrack\n");
-			  for (i=0;i<mb_io_ptr->new_pixels_ss;i++)
-			    fprintf(stderr,"dbg4       %4d   %f    %f     %f\n",
-				i,mb_io_ptr->new_ss[i],
-				mb_io_ptr->new_ss_acrosstrack[i],mb_io_ptr->new_ss_alongtrack[i]);
-			  }
-			}
-
-		/* now bin the data if appropriate */
-		if (mb_io_ptr->new_kind == MB_DATA_DATA &&
-
-			/* if data is ok */
-			(status == MB_SUCCESS
-
-			/* or if nonfatal error and only one ping read,
-				bin the ping */
-			|| (*error < MB_ERROR_NO_ERROR
-			&& *error > MB_ERROR_COMMENT
-			&& mb_io_ptr->pings_read == 1))
-			)
-
-			{
-			/* bin the values */
-			mb_io_ptr->pings_binned++;
-			mb_io_ptr->time_d = mb_io_ptr->time_d
-				+ mb_io_ptr->new_time_d;
-			mb_io_ptr->lon = mb_io_ptr->lon
-				+ mb_io_ptr->new_lon;
-			mb_io_ptr->lat = mb_io_ptr->lat
-				+ mb_io_ptr->new_lat;
-			mb_io_ptr->speed = mb_io_ptr->speed
-				+ mb_io_ptr->new_speed;
-			mb_io_ptr->heading = mb_io_ptr->heading
-				+ mb_io_ptr->new_heading;
-			headingx = headingx + sin(DTR*mb_io_ptr->new_heading);
-			headingy = headingy + cos(DTR*mb_io_ptr->new_heading);
-		        if (mb_io_ptr->pings == 1)
-			  {
-			  for (i=0;i<mb_io_ptr->new_beams_bath;i++)
-			    {
-			    mb_io_ptr->beamflag[i] = mb_io_ptr->new_beamflag[i];
-			    mb_io_ptr->bath[i] = mb_io_ptr->new_bath[i];
-			    mb_io_ptr->bath_acrosstrack[i] = mb_io_ptr->new_bath_acrosstrack[i];
-			    mb_io_ptr->bath_alongtrack[i] = mb_io_ptr->new_bath_alongtrack[i];
-			    mb_io_ptr->bath_num[i] = 1;
-			    }
-			  for (i=0;i<mb_io_ptr->new_beams_amp;i++)
-			    {
-			    mb_io_ptr->amp[i] = mb_io_ptr->new_amp[i];
-			    mb_io_ptr->amp_num[i] = 1;
-			    }
-			  for (i=0;i<mb_io_ptr->new_pixels_ss;i++)
-			    {
-			    mb_io_ptr->ss[i] = mb_io_ptr->new_ss[i];
-			    mb_io_ptr->ss_acrosstrack[i] = mb_io_ptr->new_ss_acrosstrack[i];
-			    mb_io_ptr->ss_alongtrack[i] = mb_io_ptr->new_ss_alongtrack[i];
-			    mb_io_ptr->ss_num[i] = 1;
-			    }
-			  }
-			else
-			  {
-			  for (i=0;i<mb_io_ptr->new_beams_bath;i++)
-			    {
-			    if (!mb_beam_check_flag(mb_io_ptr->new_beamflag[i]))
-			      {
-			      mb_io_ptr->beamflag[i] = MB_FLAG_NONE;
-			      mb_io_ptr->bath[i] = mb_io_ptr->bath[i]
-			                         + mb_io_ptr->new_bath[i];
-			      mb_io_ptr->bath_acrosstrack[i] = mb_io_ptr->bath_acrosstrack[i]
-			                         + mb_io_ptr->new_bath_acrosstrack[i];
-			      mb_io_ptr->bath_alongtrack[i] = mb_io_ptr->bath_alongtrack[i]
-			                         + mb_io_ptr->new_bath_alongtrack[i];
-			      mb_io_ptr->bath_num[i]++;
-			      }
-			    }
-			  for (i=0;i<mb_io_ptr->new_beams_amp;i++)
-			    {
-			    if (!mb_beam_check_flag(mb_io_ptr->new_beamflag[i]))
-			      {
-			      mb_io_ptr->amp[i] = mb_io_ptr->amp[i]
-						     + mb_io_ptr->new_amp[i];
-			      mb_io_ptr->amp_num[i]++;
-			      }
-			    }
-			  for (i=0;i<mb_io_ptr->new_pixels_ss;i++)
-			    {
-			    if (mb_io_ptr->new_ss[i] != MB_SIDESCAN_NULL)
-			      {
-			      mb_io_ptr->ss[i] = mb_io_ptr->ss[i]
-			                         + mb_io_ptr->new_ss[i];
-			      mb_io_ptr->ss_acrosstrack[i] = mb_io_ptr->ss_acrosstrack[i]
-			                         + mb_io_ptr->new_ss_acrosstrack[i];
-			      mb_io_ptr->ss_alongtrack[i] = mb_io_ptr->ss_alongtrack[i]
-			                         + mb_io_ptr->new_ss_alongtrack[i];
-			      mb_io_ptr->ss_num[i]++;
-			      }
-			    }
-			  }
-			}
-
-		/* print debug statements */
-		if (verbose >= 4
-			&& mb_io_ptr->new_kind == MB_DATA_DATA
-			&& (status == MB_SUCCESS
-			|| (*error < MB_ERROR_NO_ERROR
-			&& *error > MB_ERROR_COMMENT
-			&& mb_io_ptr->pings_read == 1)))
-			{
-			fprintf(stderr,"\ndbg4  New ping binned by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  Current binned ping values:\n");
-			fprintf(stderr,"dbg4       pings_binned: %d\n",
-				mb_io_ptr->pings_binned);
-			fprintf(stderr,"dbg4       time_d:       %f\n",
-				mb_io_ptr->time_d);
-			fprintf(stderr,"dbg4       longitude:    %f\n",
-				mb_io_ptr->lon);
-			fprintf(stderr,"dbg4       latitude:     %f\n",
-				mb_io_ptr->lat);
-			fprintf(stderr,"dbg4       speed:        %f\n",
-				mb_io_ptr->speed);
-			fprintf(stderr,"dbg4       heading:      %f\n",
-				mb_io_ptr->heading);
-			fprintf(stderr,"dbg4       beams_bath:    %d\n",
-				mb_io_ptr->beams_bath_max);
-			if (mb_io_ptr->beams_bath_max > 0)
-			  {
-			  fprintf(stderr,"dbg4       beam   nbath bath  crosstrack alongtrack\n");
-			  for (i=0;i<mb_io_ptr->beams_bath_max;i++)
-			    fprintf(stderr,"dbg4       %4d   %4d  %f    %f     %f\n",
-				i,mb_io_ptr->bath_num[i],mb_io_ptr->bath[i],
-				mb_io_ptr->bath_acrosstrack[i],
-				mb_io_ptr->bath_alongtrack[i]);
-			  }
-			fprintf(stderr,"dbg4       beams_amp:    %d\n",
-				mb_io_ptr->beams_amp_max);
-			if (mb_io_ptr->beams_amp_max > 0)
-			  {
-			  fprintf(stderr,"dbg4       beam    namp  amp  crosstrack alongtrack\n");
-			  for (i=0;i<mb_io_ptr->beams_amp_max;i++)
-			    fprintf(stderr,"dbg4       %4d   %4d  %f    %f     %f\n",
-				i,mb_io_ptr->amp_num[i],mb_io_ptr->amp[i],
-				mb_io_ptr->bath_acrosstrack[i],
-				mb_io_ptr->bath_alongtrack[i]);
-			  }
-			fprintf(stderr,"dbg4       pixels_ss:     %d\n",
-				mb_io_ptr->pixels_ss_max);
-			if (mb_io_ptr->pixels_ss_max > 0)
-			  {
-			  fprintf(stderr,"dbg4       pixel nss  sidescan crosstrack alongtrack\n");
-			  for (i=0;i<mb_io_ptr->pixels_ss_max;i++)
-			    fprintf(stderr,"dbg4       %4d   %4d   %f    %f     %f\n",
-				i,mb_io_ptr->ss_num[i],mb_io_ptr->ss[i],
-				mb_io_ptr->ss_acrosstrack[i],
-				mb_io_ptr->ss_alongtrack[i]);
-			  }
-			}
-
-		/* if data is ok but more pings needed keep reading */
-		if (status == MB_SUCCESS
-			&& mb_io_ptr->new_kind == MB_DATA_DATA
-			&& mb_io_ptr->pings_binned < mb_io_ptr->pings_avg)
-			{
-			done = MB_NO;
-			mb_io_ptr->need_new_ping = MB_YES;
-			reset_last = MB_YES;
-			}
-
-		/* if data is ok and enough pings binned then done */
-		else if (status == MB_SUCCESS
-			&& mb_io_ptr->new_kind == MB_DATA_DATA
-			&& mb_io_ptr->pings_binned >= mb_io_ptr->pings_avg)
-			{
-			done = MB_YES;
-			mb_io_ptr->need_new_ping = MB_YES;
-			reset_last = MB_YES;
-			}
-
-		/* if data gap and only one ping read and more
-			pings needed set error save flag and keep reading */
-		else if (*error == MB_ERROR_TIME_GAP
-			&& mb_io_ptr->new_kind == MB_DATA_DATA
-			&& mb_io_ptr->pings_read == 1
-			&& mb_io_ptr->pings_avg > 1)
-			{
-			done = MB_NO;
-			mb_io_ptr->need_new_ping = MB_YES;
-			mb_io_ptr->error_save = *error;
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			reset_last = MB_YES;
-			}
-
-		/* if other kind of data and need more pings
-			then keep reading */
-		else if ((*error == MB_ERROR_OTHER
-			|| *error == MB_ERROR_UNINTELLIGIBLE)
-			&& mb_io_ptr->pings_binned < mb_io_ptr->pings_avg)
-			{
-			done = MB_NO;
-			mb_io_ptr->need_new_ping = MB_YES;
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			reset_last = MB_NO;
-			}
-
-		/* if error and only one ping read then done */
-		else if (*error != MB_ERROR_NO_ERROR
-			&& mb_io_ptr->pings_read <= 1)
-			{
-			done = MB_YES;
-			mb_io_ptr->need_new_ping = MB_YES;
-			if (*error == MB_ERROR_TIME_GAP
-				|| *error == MB_ERROR_OUT_BOUNDS)
-				reset_last = MB_YES;
-			else
-				reset_last = MB_NO;
-			}
-
-		/* if error and more than one ping read,
-			then done but save the ping */
-		else if (*error != MB_ERROR_NO_ERROR)
-			{
-			done = MB_YES;
-			mb_io_ptr->need_new_ping = MB_NO;
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			reset_last = MB_NO;
-			}
-
-		/* if needed reset "last" pings */
-		if (reset_last == MB_YES)
-			{
-			mb_io_ptr->last_time_d = mb_io_ptr->new_time_d;
-			mb_io_ptr->last_lon = mb_io_ptr->new_lon;
-			mb_io_ptr->last_lat = mb_io_ptr->new_lat;
-			}
-
-		/* print debug statements */
-		if (verbose >= 4)
-			{
-			fprintf(stderr,"\ndbg4  End of reading loop in MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  Current status values:\n");
-			fprintf(stderr,"dbg4       done:          %d\n",done);
-			fprintf(stderr,"dbg4       need_new_ping: %d\n",
-					mb_io_ptr->need_new_ping);
-			fprintf(stderr,"dbg4       pings_binned:  %d\n",
-					mb_io_ptr->pings_binned);
-			fprintf(stderr,"dbg4       error:         %d\n",*error);			fprintf(stderr,"dbg4       status:        %d\n",status);
-			}
-		}
-
-	/* set output number of pings */
-	*pings = mb_io_ptr->pings_binned;
-
-	/* set data kind */
-	if (mb_io_ptr->pings_binned > 0)
-		*kind = MB_DATA_DATA;
-	else if (*error == MB_ERROR_COMMENT)
-		*kind = MB_DATA_COMMENT;
-	else
-		*kind = mb_io_ptr->new_kind;
-
-	/* get output time */
-	if (*error <= MB_ERROR_NO_ERROR
-		&& *error > MB_ERROR_COMMENT)
-		{
-		if (mb_io_ptr->pings_binned == 1)
-			{
-			for (i=0;i<7;i++)
-				time_i[i] = mb_io_ptr->new_time_i[i];
-			*time_d = mb_io_ptr->new_time_d;
-			}
-		else if (mb_io_ptr->pings_binned > 1)
-			{
-			*time_d = mb_io_ptr->time_d/mb_io_ptr->pings_binned;
-			mb_get_date(verbose,*time_d,time_i);
-			}
-		else
-			{
-			*error = MB_ERROR_NO_PINGS_BINNED;
-			mb_notice_log_error(verbose, mbio_ptr, *error);
-			}
-		}
-
-	/* get other output values */
-	if (*error <= MB_ERROR_NO_ERROR
-		&& *error > MB_ERROR_COMMENT)
-		{
-		/* get navigation values */
-		*navlon = mb_io_ptr->lon/mb_io_ptr->pings_binned;
-		*navlat = mb_io_ptr->lat/mb_io_ptr->pings_binned;
-		headingx = headingx/mb_io_ptr->pings_binned;
-		headingy = headingy/mb_io_ptr->pings_binned;
-		denom = sqrt(headingx*headingx + headingy*headingy);
-		if (denom > 0.0)
-			{
-			headingx = headingx/denom;
-			headingy = headingy/denom;
-			*heading = RTD*atan2(headingx,headingy);
-			}
-		else
-			{
-			*heading = mb_io_ptr->heading/mb_io_ptr->pings_binned;
-			headingx = sin(*heading*DTR);
-			headingy = cos(*heading*DTR);
-			}
-		if (*heading < 0.0)
-			*heading = *heading + 360.0;
-
-		/* get coordinate scaling */
-		mb_coor_scale(verbose,*navlat,&mtodeglon,&mtodeglat);
-
-		/* get distance value */
-		if (mb_io_ptr->old_time_d > 0.0)
-			{
-			dx = (*navlon - mb_io_ptr->old_lon)/mtodeglon;
-			dy = (*navlat - mb_io_ptr->old_lat)/mtodeglat;
-			*distance = 0.001*sqrt(dx*dx + dy*dy); /* km */
-			}
-		else
-			*distance = 0.0;
-
-		/* get speed value */
-		if (mb_io_ptr->speed > 0.0)
-			*speed = mb_io_ptr->speed/mb_io_ptr->pings_binned;
-		else if (mb_io_ptr->old_time_d > 0.0)
-			{
-			delta_time = 0.000277778*
-				(*time_d - mb_io_ptr->old_time_d); /* hours */
-			if (delta_time > 0.0)
-				*speed = *distance/delta_time; /* km/hr */
-			else
-				*speed = 0.0;
-			}
-		else
-			*speed = 0.0;
-
-		/* check for less than minimum speed */
-		if (*error == MB_ERROR_NO_ERROR
-			|| *error == MB_ERROR_TIME_GAP)
-		{
-		if (mb_io_ptr->ping_count > 1
-			&& *time_d > MB_TIME_D_UNKNOWN
-			&& *speed < mb_io_ptr->speedmin)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_SPEED_TOO_SMALL;
-			mb_notice_log_error(verbose, mbio_ptr, *error);
-			}
-		}
-
-		/* print debug statements */
-		if (verbose >= 4)
-			{
-			fprintf(stderr,"\ndbg4  Distance and Speed Calculated in MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  Speed and Distance Related Values:\n");
-			fprintf(stderr,"dbg4       binned speed: %f\n",
-					mb_io_ptr->speed);
-			fprintf(stderr,"dbg4       pings_binned: %d\n",
-					mb_io_ptr->pings_binned);
-			fprintf(stderr,"dbg4       ping_count:   %d\n",
-					mb_io_ptr->ping_count);
-			fprintf(stderr,"dbg4       time:         %f\n",
-					*time_d);
-			fprintf(stderr,"dbg4       lon:          %f\n",
-					*navlon);
-			fprintf(stderr,"dbg4       lat:          %f\n",
-					*navlat);
-			fprintf(stderr,"dbg4       old time:     %f\n",
-					mb_io_ptr->old_time_d);
-			fprintf(stderr,"dbg4       old lon:      %f\n",
-					mb_io_ptr->old_lon);
-			fprintf(stderr,"dbg4       old lat:      %f\n",
-					mb_io_ptr->old_lat);
-			fprintf(stderr,"dbg4       distance:     %f\n",
-					*distance);
-			fprintf(stderr,"dbg4       altitude:     %f\n",
-					*altitude);
-			fprintf(stderr,"dbg4       sonardepth:   %f\n",
-					*sonardepth);
-			fprintf(stderr,"dbg4       delta_time:   %f\n",
-					delta_time);
-			fprintf(stderr,"dbg4       speed:        %f\n",
-					*speed);
-			fprintf(stderr,"dbg4       error:        %d\n",*error);
-			fprintf(stderr,"dbg4       status:       %d\n",status);
-			}
-
-		/* get swath data */
-		*nbath = 0;
-		*namp = 0;
-		*nss = 0;
-		for (i=0;i<mb_io_ptr->beams_bath_max;i++)
-			{
-			beamflag[i] = mb_io_ptr->beamflag[i];
-			if (mb_io_ptr->bath_num[i] > 0)
-				{
-				bath[i] = (mb_io_ptr->bath[i])
-					/(mb_io_ptr->bath_num[i]);
-				mb_io_ptr->bath_acrosstrack[i]
-					= (mb_io_ptr->bath_acrosstrack[i])
-					/(mb_io_ptr->bath_num[i]);
-				mb_io_ptr->bath_alongtrack[i]
-					= (mb_io_ptr->bath_alongtrack[i])
-					/(mb_io_ptr->bath_num[i]);
-				bathlon[i] = *navlon
-					+ headingy*mtodeglon
-					*mb_io_ptr->bath_acrosstrack[i]
-					+ headingx*mtodeglon
-					*mb_io_ptr->bath_alongtrack[i];
-				bathlat[i] = *navlat
-					- headingx*mtodeglat
-					*mb_io_ptr->bath_acrosstrack[i]
-					+ headingy*mtodeglat
-					*mb_io_ptr->bath_alongtrack[i];
-				*nbath = i + 1;
-				}
-			else
-				{
-				beamflag[i] = MB_FLAG_NULL;
-				bath[i] = 0.0;
-				bathlon[i] = 0.0;
-				bathlat[i] = 0.0;
-				}
-			}
-		for (i=0;i<mb_io_ptr->beams_amp_max;i++)
-			{
-			if (mb_io_ptr->amp_num[i] > 0)
-				{
-				amp[i] = (mb_io_ptr->amp[i])
-					/(mb_io_ptr->amp_num[i]);
-				*namp = i + 1;
-				}
-			else
-				{
-				amp[i] = 0.0;
-				}
-			}
-		for (i=0;i<mb_io_ptr->pixels_ss_max;i++)
-			{
-			if (mb_io_ptr->ss_num[i] > 0)
-				{
-				ss[i] = (mb_io_ptr->ss[i])
-					/(mb_io_ptr->ss_num[i]);
-				mb_io_ptr->ss_acrosstrack[i]
-					= (mb_io_ptr->ss_acrosstrack[i])
-					/(mb_io_ptr->ss_num[i]);
-				mb_io_ptr->ss_alongtrack[i]
-					= (mb_io_ptr->ss_alongtrack[i])
-					/(mb_io_ptr->ss_num[i]);
-				sslon[i] = *navlon
-					+ headingy*mtodeglon
-					*mb_io_ptr->ss_acrosstrack[i]
-					+ headingx*mtodeglon
-					*mb_io_ptr->ss_alongtrack[i];
-				sslat[i] = *navlat
-					- headingx*mtodeglat
-					*mb_io_ptr->ss_acrosstrack[i]
-					+ headingy*mtodeglat
-					*mb_io_ptr->ss_alongtrack[i];
-				*nss = i + 1;
-				}
-			else
-				{
-				ss[i] = MB_SIDESCAN_NULL;
-				sslon[i] = 0.0;
-				sslat[i] = 0.0;
-				}
-			}
-		if (mb_io_ptr->variable_beams == MB_NO)
-			{
-			*nbath = mb_io_ptr->beams_bath_max;
-			*namp = mb_io_ptr->beams_amp_max;
-			*nss = mb_io_ptr->pixels_ss_max;
-			}
-		}
-
-	/* get output comment */
-	if (*error == MB_ERROR_COMMENT)
-		{
-		strcpy(comment,mb_io_ptr->new_comment);
-		}
-
-	/* reset "old" navigation values */
-	if (*error <= MB_ERROR_NO_ERROR
-		&& *error > MB_ERROR_COMMENT)
-		{
-		mb_io_ptr->old_time_d = *time_d;
-		mb_io_ptr->old_lon = *navlon;
-		mb_io_ptr->old_lat = *navlat;
-		}
-
-	/* get saved error flag if needed */
-	if (*error == MB_ERROR_NO_ERROR
-		&& mb_io_ptr->error_save != MB_ERROR_NO_ERROR)
-		{
-		*error = mb_io_ptr->error_save;
-		status = MB_FAILURE;
-		mb_io_ptr->error_save = MB_ERROR_NO_ERROR;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *kind == MB_DATA_DATA)
-		{
-		fprintf(stderr,"dbg2       pings:      %d\n",*pings);
-		fprintf(stderr,"dbg2       time_i[0]:  %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:  %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:  %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:  %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:  %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:  %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:  %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       navlon:     %f\n",*navlon);
-		fprintf(stderr,"dbg2       navlat:     %f\n",*navlat);
-		fprintf(stderr,"dbg2       speed:      %f\n",*speed);
-		fprintf(stderr,"dbg2       heading:    %f\n",*heading);
-		fprintf(stderr,"dbg2       distance:   %f\n",*distance);
-		fprintf(stderr,"dbg2       altitude:   %f\n",*altitude);
-		fprintf(stderr,"dbg2       sonardepth: %f\n",*sonardepth);
-		fprintf(stderr,"dbg2       nbath:      %d\n",*nbath);
-		if (verbose >= 3 && *nbath > 0)
-		  {
-		  fprintf(stderr,"dbg3       beam   nbath flag bath  crosstrack alongtrack\n");
-		  for (i=0;i<*nbath;i++)
-		    fprintf(stderr,"dbg3       %4d   %4d  %3d  %f    %f     %f\n",
-			i,mb_io_ptr->bath_num[i],beamflag[i],bath[i],
-			bathlon[i],bathlat[i]);
-		  }
-		fprintf(stderr,"dbg2       namp:       %d\n",*namp);
-		if (verbose >= 3 && *namp > 0)
-		  {
-		  fprintf(stderr,"dbg3       beam    namp  amp  lon lat\n");
-		  for (i=0;i<*namp;i++)
-		    fprintf(stderr,"dbg3       %4d   %4d  %f    %f     %f\n",
-			i,mb_io_ptr->amp_num[i],amp[i],
-			bathlon[i],bathlat[i]);
-		  }
-		fprintf(stderr,"dbg2       nss:      %d\n",*nss);
-		if (verbose >= 3 && *nss > 0)
-		  {
-		  fprintf(stderr,"dbg3       pixel nss  sidescan crosstrack alongtrack\n");
-		  for (i=0;i<*nss;i++)
-		    fprintf(stderr,"dbg3       %4d   %4d   %f    %f     %f\n",
-			i,mb_io_ptr->ss_num[i],ss[i],
-			sslon[i],sslat[i]);
-		  }
-		}
-	else if (verbose >= 2 && *kind == MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"dbg2       comment:    %s\n",comment);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mb_read_init.c b/src/mbio/mb_read_init.c
deleted file mode 100644
index bc96da3..0000000
--- a/src/mbio/mb_read_init.c
+++ /dev/null
@@ -1,760 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mb_read_init.c	1/25/93
- *    $Id: mb_read_init.c 2239 2015-05-07 00:51:42Z caress $
- *
- *    Copyright (c) 1993-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mb_read_init.c opens and initializes a multibeam data file
- * for reading with mb_read or mb_get.
- *
- * Author:	D. W. Caress
- * Date:	January 25, 1993
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-#include <sys/stat.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mb_define.h"
-#include "../surf/mb_sapi.h"
-#include "mb_segy.h"
-#include "gsf.h"
-#include "netcdf.h"
-
-static char rcs_id[]="$Id: mb_read_init.c 2239 2015-05-07 00:51:42Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mb_read_init(int verbose, char *file,
-		int format, int pings, int lonflip, double bounds[4],
-		int btime_i[7], int etime_i[7],
-		double speedmin, double timegap,
-		void **mbio_ptr, double *btime_d, double *etime_d,
-		int *beams_bath, int *beams_amp, int *pixels_ss,
-		int *error)
-{
-	char	*function_name = "mb_read_init";
-	int	status;
-	struct mb_io_struct *mb_io_ptr;
-	int	status_save;
-	int	error_save;
-	int	sapi_status;
-	char	*lastslash;
-	char	path[MB_PATH_MAXLINE], name[MB_PATH_MAXLINE];
-	char	prjfile[MB_PATH_MAXLINE];
-	char	projection_id[MB_NAME_LENGTH];
-	int	proj_status;
-	FILE	*pfp;
-	struct stat file_status;
-	int	fstat;
-	int	nscan;
-	int	i;
-	char	*stdin_string = "stdin";
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       file:       %s\n",file);
-		fprintf(stderr,"dbg2       format:     %d\n",format);
-		fprintf(stderr,"dbg2       pings:      %d\n",pings);
-		fprintf(stderr,"dbg2       lonflip:    %d\n",lonflip);
-		fprintf(stderr,"dbg2       bounds[0]:  %f\n",bounds[0]);
-		fprintf(stderr,"dbg2       bounds[1]:  %f\n",bounds[1]);
-		fprintf(stderr,"dbg2       bounds[2]:  %f\n",bounds[2]);
-		fprintf(stderr,"dbg2       bounds[3]:  %f\n",bounds[3]);
-		fprintf(stderr,"dbg2       btime_i[0]: %d\n",btime_i[0]);
-		fprintf(stderr,"dbg2       btime_i[1]: %d\n",btime_i[1]);
-		fprintf(stderr,"dbg2       btime_i[2]: %d\n",btime_i[2]);
-		fprintf(stderr,"dbg2       btime_i[3]: %d\n",btime_i[3]);
-		fprintf(stderr,"dbg2       btime_i[4]: %d\n",btime_i[4]);
-		fprintf(stderr,"dbg2       btime_i[5]: %d\n",btime_i[5]);
-		fprintf(stderr,"dbg2       btime_i[6]: %d\n",btime_i[6]);
-		fprintf(stderr,"dbg2       etime_i[0]: %d\n",etime_i[0]);
-		fprintf(stderr,"dbg2       etime_i[1]: %d\n",etime_i[1]);
-		fprintf(stderr,"dbg2       etime_i[2]: %d\n",etime_i[2]);
-		fprintf(stderr,"dbg2       etime_i[3]: %d\n",etime_i[3]);
-		fprintf(stderr,"dbg2       etime_i[4]: %d\n",etime_i[4]);
-		fprintf(stderr,"dbg2       etime_i[5]: %d\n",etime_i[5]);
-		fprintf(stderr,"dbg2       etime_i[6]: %d\n",etime_i[6]);
-		fprintf(stderr,"dbg2       speedmin:   %f\n",speedmin);
-		fprintf(stderr,"dbg2       timegap:    %f\n",timegap);
-		}
-
-	/* allocate memory for mbio descriptor */
-	status = mb_mallocd(verbose,__FILE__, __LINE__,sizeof(struct mb_io_struct),
-				(void **) mbio_ptr,error);
-	if (status == MB_SUCCESS)
-		{
-		memset(*mbio_ptr, 0, sizeof(struct mb_io_struct));
-		mb_io_ptr = (struct mb_io_struct *) *mbio_ptr;
-		}
-
-	/* set system byte order flag */
-	if (status == MB_SUCCESS)
-		{
-		mb_io_ptr->byteswapped = mb_swap_check();
-		}
-
-	/* get format information */
-	if (status == MB_SUCCESS)
-		{
-		status = mb_format_register(verbose, &format,
-					*mbio_ptr, error);
-		}
-
-	/* quit if there is a problem */
-	if (status == MB_FAILURE)
-		{
-		/* free memory for mbio descriptor */
-		if (mbio_ptr != NULL)
-			{
-			status_save = status;
-			error_save = *error;
-			status = mb_freed(verbose,__FILE__, __LINE__,(void **)mbio_ptr,error);
-			status = status_save;
-			*error = error_save;
-			}
-
-		/* output debug information */
-		if (verbose >= 2)
-			{
-			fprintf(stderr,"\ndbg2  MBIO function <%s> terminated with error\n",
-				function_name);
-			fprintf(stderr,"dbg2  Return values:\n");
-			fprintf(stderr,"dbg2       error:      %d\n",*error);
-			fprintf(stderr,"dbg2  Return status:\n");
-			fprintf(stderr,"dbg2       status:  %d\n",status);
-			}
-		return(status);
-		}
-
-	/* initialize file access for the mbio descriptor */
-	mb_io_ptr->filemode = MB_FILEMODE_READ;
-	mb_io_ptr->mbfp = NULL;
-	strcpy(mb_io_ptr->file,file);
-	mb_io_ptr->file_pos = 0;
-	mb_io_ptr->file_bytes = 0;
-	mb_io_ptr->mbfp2 = NULL;
-	strcpy(mb_io_ptr->file2,"\0");
-	mb_io_ptr->file2_pos = 0;
-	mb_io_ptr->file2_bytes = 0;
-	mb_io_ptr->mbfp3 = NULL;
-	strcpy(mb_io_ptr->file3,"\0");
-	mb_io_ptr->file3_pos = 0;
-	mb_io_ptr->file3_bytes = 0;
-	mb_io_ptr->ncid = 0;
-	mb_io_ptr->gsfid = 0;
-	mb_io_ptr->xdrs = NULL;
-	mb_io_ptr->xdrs2 = NULL;
-	mb_io_ptr->xdrs3 = NULL;
-
-	/* load control parameters into the mbio descriptor */
-	mb_io_ptr->format = format;
-	mb_io_ptr->pings = pings;
-	mb_io_ptr->lonflip = lonflip;
-	for (i=0;i<4;i++)
-		mb_io_ptr->bounds[i] = bounds[i];
-	for (i=0;i<7;i++)
-		{
-		mb_io_ptr->btime_i[i] = btime_i[i];
-		mb_io_ptr->etime_i[i] = etime_i[i];
-		}
-	mb_io_ptr->speedmin = speedmin;
-	mb_io_ptr->timegap = timegap;
-
-	/* get mbio internal time */
-	status = mb_get_time(verbose,mb_io_ptr->btime_i,btime_d);
-	status = mb_get_time(verbose,mb_io_ptr->etime_i,etime_d);
-	mb_io_ptr->btime_d = *btime_d;
-	mb_io_ptr->etime_d = *etime_d;
-
-	/* set the number of beams and allocate storage arrays */
-	*beams_bath = mb_io_ptr->beams_bath_max;
-	*beams_amp = mb_io_ptr->beams_amp_max;
-	*pixels_ss = mb_io_ptr->pixels_ss_max;
-	mb_io_ptr->new_beams_bath = 0;
-	mb_io_ptr->new_beams_amp = 0;
-	mb_io_ptr->new_pixels_ss = 0;
-	if (verbose >= 4)
-		{
-		fprintf(stderr,"\ndbg4  Beam and pixel dimensions set in MBIO function <%s>\n",
-				function_name);
-		fprintf(stderr,"dbg4       beams_bath: %d\n",
-			mb_io_ptr->beams_bath_max);
-		fprintf(stderr,"dbg4       beams_amp:  %d\n",
-			mb_io_ptr->beams_amp_max);
-		fprintf(stderr,"dbg4       pixels_ss:  %d\n",
-			mb_io_ptr->pixels_ss_max);
-		}
-
-	/* initialize pointers */
-	mb_io_ptr->raw_data = NULL;
-	mb_io_ptr->store_data = NULL;
-	mb_io_ptr->beamflag = NULL;
-	mb_io_ptr->bath = NULL;
-	mb_io_ptr->amp = NULL;
-	mb_io_ptr->bath_acrosstrack = NULL;
-	mb_io_ptr->bath_alongtrack = NULL;
-	mb_io_ptr->bath_num = NULL;
-	mb_io_ptr->amp_num = NULL;
-	mb_io_ptr->ss = NULL;
-	mb_io_ptr->ss_acrosstrack = NULL;
-	mb_io_ptr->ss_alongtrack = NULL;
-	mb_io_ptr->ss_num = NULL;
-	mb_io_ptr->new_beamflag = NULL;
-	mb_io_ptr->new_bath = NULL;
-	mb_io_ptr->new_amp = NULL;
-	mb_io_ptr->new_bath_acrosstrack = NULL;
-	mb_io_ptr->new_bath_alongtrack = NULL;
-	mb_io_ptr->new_ss = NULL;
-	mb_io_ptr->new_ss_acrosstrack = NULL;
-	mb_io_ptr->new_ss_alongtrack = NULL;
-
-	/* initialize projection parameters */
-	mb_io_ptr->projection_initialized = MB_NO;
-	mb_io_ptr->projection_id[0] = '\0';
-	mb_io_ptr->pjptr = NULL;
-
-	/* initialize ancillary variables used
-		to save information in certain cases */
-	mb_io_ptr->save_flag = MB_NO;
-	mb_io_ptr->save_label_flag = MB_NO;
-	mb_io_ptr->save1 = 0;
-	mb_io_ptr->save2 = 0;
-	mb_io_ptr->save3 = 0;
-	mb_io_ptr->save4 = 0;
-	mb_io_ptr->save5 = 0;
-	mb_io_ptr->save6 = 0;
-	mb_io_ptr->save7 = 0;
-	mb_io_ptr->save8 = 0;
-	mb_io_ptr->save9 = 0;
-	mb_io_ptr->save10 = 0;
-	mb_io_ptr->save11 = 0;
-	mb_io_ptr->save12 = 0;
-	mb_io_ptr->save13 = 0;
-	mb_io_ptr->save14 = 0;
-	mb_io_ptr->saved1 = 0;
-	mb_io_ptr->saved2 = 0;
-	mb_io_ptr->saved3 = 0;
-	mb_io_ptr->saved4 = 0;
-	mb_io_ptr->saved5 = 0;
-	mb_io_ptr->saveptr1 = NULL;
-	mb_io_ptr->saveptr2 = NULL;
-
-	/* allocate arrays */
-	mb_io_ptr->beams_bath_alloc = mb_io_ptr->beams_bath_max;
-	mb_io_ptr->beams_amp_alloc = mb_io_ptr->beams_amp_max;
-	mb_io_ptr->pixels_ss_alloc = mb_io_ptr->pixels_ss_max;
-	if (status == MB_SUCCESS)
-		status = mb_mallocd(verbose,__FILE__, __LINE__,mb_io_ptr->beams_bath_alloc*sizeof(char),
-				(void **) &mb_io_ptr->beamflag,error);
-	if (status == MB_SUCCESS)
-		status = mb_mallocd(verbose,__FILE__, __LINE__,mb_io_ptr->beams_bath_alloc*sizeof(double),
-				(void **) &mb_io_ptr->bath,error);
-	if (status == MB_SUCCESS)
-		status = mb_mallocd(verbose,__FILE__, __LINE__,mb_io_ptr->beams_amp_alloc*sizeof(double),
-				(void **) &mb_io_ptr->amp,error);
-	if (status == MB_SUCCESS)
-		status = mb_mallocd(verbose,__FILE__, __LINE__,mb_io_ptr->beams_bath_alloc*sizeof(double),
-				(void **) &mb_io_ptr->bath_acrosstrack,error);
-	if (status == MB_SUCCESS)
-		status = mb_mallocd(verbose,__FILE__, __LINE__,mb_io_ptr->beams_bath_alloc*sizeof(double),
-				(void **) &mb_io_ptr->bath_alongtrack,error);
-	if (status == MB_SUCCESS)
-		status = mb_mallocd(verbose,__FILE__, __LINE__,mb_io_ptr->beams_bath_alloc*sizeof(int),
-				(void **) &mb_io_ptr->bath_num,error);
-	if (status == MB_SUCCESS)
-		status = mb_mallocd(verbose,__FILE__, __LINE__,mb_io_ptr->beams_amp_alloc*sizeof(int),
-				(void **) &mb_io_ptr->amp_num,error);
-	if (status == MB_SUCCESS)
-		status = mb_mallocd(verbose,__FILE__, __LINE__,mb_io_ptr->pixels_ss_alloc*sizeof(double),
-				(void **) &mb_io_ptr->ss,error);
-	if (status == MB_SUCCESS)
-		status = mb_mallocd(verbose,__FILE__, __LINE__,mb_io_ptr->pixels_ss_alloc*sizeof(double),
-				(void **) &mb_io_ptr->ss_acrosstrack,error);
-	if (status == MB_SUCCESS)
-		status = mb_mallocd(verbose,__FILE__, __LINE__,mb_io_ptr->pixels_ss_alloc*sizeof(double),
-				(void **) &mb_io_ptr->ss_alongtrack,error);
-	if (status == MB_SUCCESS)
-		status = mb_mallocd(verbose,__FILE__, __LINE__,mb_io_ptr->pixels_ss_alloc*sizeof(int),
-				(void **) &mb_io_ptr->ss_num,error);
-	if (status == MB_SUCCESS)
-		status = mb_mallocd(verbose,__FILE__, __LINE__,mb_io_ptr->beams_bath_alloc*sizeof(char),
-				(void **) &mb_io_ptr->new_beamflag,error);
-	if (status == MB_SUCCESS)
-		status = mb_mallocd(verbose,__FILE__, __LINE__,mb_io_ptr->beams_bath_alloc*sizeof(double),
-				(void **) &mb_io_ptr->new_bath,error);
-	if (status == MB_SUCCESS)
-		status = mb_mallocd(verbose,__FILE__, __LINE__,mb_io_ptr->beams_amp_alloc*sizeof(double),
-				(void **) &mb_io_ptr->new_amp,error);
-	if (status == MB_SUCCESS)
-		status = mb_mallocd(verbose,__FILE__, __LINE__,mb_io_ptr->beams_bath_alloc*sizeof(double),
-				(void **) &mb_io_ptr->new_bath_acrosstrack,error);
-	if (status == MB_SUCCESS)
-		status = mb_mallocd(verbose,__FILE__, __LINE__,mb_io_ptr->beams_bath_alloc*sizeof(double),
-				(void **) &mb_io_ptr->new_bath_alongtrack,error);
-	if (status == MB_SUCCESS)
-		status = mb_mallocd(verbose,__FILE__, __LINE__,mb_io_ptr->pixels_ss_alloc*sizeof(double),
-				(void **) &mb_io_ptr->new_ss,error);
-	if (status == MB_SUCCESS)
-		status = mb_mallocd(verbose,__FILE__, __LINE__,mb_io_ptr->pixels_ss_alloc*sizeof(double),
-				(void **) &mb_io_ptr->new_ss_acrosstrack,error);
-	if (status == MB_SUCCESS)
-		status = mb_mallocd(verbose,__FILE__, __LINE__,mb_io_ptr->pixels_ss_alloc*sizeof(double),
-				(void **) &mb_io_ptr->new_ss_alongtrack,error);
-
-	/* call routine to allocate memory for format dependent i/o */
-	if (status == MB_SUCCESS)
-		status = (*mb_io_ptr->mb_io_format_alloc)(verbose,*mbio_ptr,error);
-
-	/* deal with a memory allocation failure */
-	if (status == MB_FAILURE)
-		{
-		status = mb_deall_ioarrays(verbose, mbio_ptr, error);
-		status = mb_freed(verbose,__FILE__, __LINE__,(void **)&mb_io_ptr,error);
-		mb_io_ptr->beams_bath_alloc = 0;
-		mb_io_ptr->beams_amp_alloc = 0;
-		mb_io_ptr->pixels_ss_alloc = 0;
-		status = MB_FAILURE;
-		*error = MB_ERROR_MEMORY_FAIL;
-		if (verbose >= 2)
-			{
-			fprintf(stderr,"\ndbg2  MBIO function <%s> terminated with error\n",
-				function_name);
-			fprintf(stderr,"dbg2  Return values:\n");
-			fprintf(stderr,"dbg2       error:      %d\n",*error);
-			fprintf(stderr,"dbg2  Return status:\n");
-			fprintf(stderr,"dbg2       status:  %d\n",status);
-			}
-		return(status);
-		}
-
-	/* handle normal or xdr files to be opened
-	   directly with fopen */
-	if (mb_io_ptr->filetype == MB_FILETYPE_NORMAL
-	    || mb_io_ptr->filetype == MB_FILETYPE_XDR)
-	    {
-	    /* open the first file */
-	    if (strncmp(file,stdin_string,5) == 0)
-		mb_io_ptr->mbfp = stdin;
-	    else
-		if ((mb_io_ptr->mbfp = fopen(mb_io_ptr->file, "rb")) == NULL)
-		    {
-		    *error = MB_ERROR_OPEN_FAIL;
-		    status = MB_FAILURE;
-		    }
-
-	    /* open the second file if required */
-	    if (status == MB_SUCCESS
-		&& mb_io_ptr->numfile >= 2)
-		{
-		if ((mb_io_ptr->mbfp2 = fopen(mb_io_ptr->file2, "rb")) == NULL)
-		    {
-		    *error = MB_ERROR_OPEN_FAIL;
-		    status = MB_FAILURE;
-		    }
-		}
-
-	    /* or open the second file if desired and possible */
-	    else if (status == MB_SUCCESS
-		&& mb_io_ptr->numfile <= -2)
-		{
-		if ((fstat = stat(mb_io_ptr->file2, &file_status)) == 0
-		    && (file_status.st_mode & S_IFMT) != S_IFDIR
-		    && file_status.st_size > 0)
-			mb_io_ptr->mbfp2 = fopen(mb_io_ptr->file2, "rb");
-		}
-
-	    /* open the third file if required */
-	    if (status == MB_SUCCESS
-		&& mb_io_ptr->numfile >= 3)
-		{
-		if ((mb_io_ptr->mbfp3 = fopen(mb_io_ptr->file3, "rb")) == NULL)
-		    {
-		    *error = MB_ERROR_OPEN_FAIL;
-		    status = MB_FAILURE;
-		    }
-		}
-
-	    /* or open the third file if desired and possible */
-	    else if (status == MB_SUCCESS
-		&& mb_io_ptr->numfile <= -3)
-		{
-		if ((fstat = stat(mb_io_ptr->file2, &file_status)) == 0
-		    && (file_status.st_mode & S_IFMT) != S_IFDIR
-		    && file_status.st_size > 0)
-			mb_io_ptr->mbfp3 = fopen(mb_io_ptr->file3, "rb");
-		}
-
-	    /* if needed, initialize XDR stream */
-	    if (status == MB_SUCCESS
-		&& mb_io_ptr->filetype == MB_FILETYPE_XDR)
-		{
-		status = mb_mallocd(verbose,__FILE__, __LINE__,sizeof(XDR),
-				(void **) &mb_io_ptr->xdrs,error);
-		if (status == MB_SUCCESS)
-		    {
-		    xdrstdio_create((XDR *)mb_io_ptr->xdrs,
-			    mb_io_ptr->mbfp, XDR_DECODE);
-		    }
-		else
-		    {
-		    status = MB_FAILURE;
-		    *error = MB_ERROR_MEMORY_FAIL;
-		    }
-		}
-
-	    /* if needed, initialize second XDR stream */
-	    if (status == MB_SUCCESS
-		&& mb_io_ptr->filetype == MB_FILETYPE_XDR
-		&& (mb_io_ptr->numfile >= 2 || mb_io_ptr->numfile <= -2)
-		&& mb_io_ptr->mbfp2 != NULL)
-		{
-		status = mb_mallocd(verbose,__FILE__, __LINE__,sizeof(XDR),
-				(void **) &mb_io_ptr->xdrs2,error);
-		if (status == MB_SUCCESS)
-		    {
-		    xdrstdio_create((XDR *)mb_io_ptr->xdrs2,
-			    mb_io_ptr->mbfp2, XDR_DECODE);
-		    }
-		else
-		    {
-		    status = MB_FAILURE;
-		    *error = MB_ERROR_MEMORY_FAIL;
-		    }
-		}
-
-	    /* if needed, initialize third XDR stream */
-	    if (status == MB_SUCCESS
-		&& mb_io_ptr->filetype == MB_FILETYPE_XDR
-		&& (mb_io_ptr->numfile >= 3 || mb_io_ptr->numfile <= -3)
-		&& mb_io_ptr->mbfp3 != NULL)
-		{
-		status = mb_mallocd(verbose,__FILE__, __LINE__,sizeof(XDR),
-				(void **) &mb_io_ptr->xdrs3,error);
-		if (status == MB_SUCCESS)
-		    {
-		    xdrstdio_create((XDR *)mb_io_ptr->xdrs3,
-			    mb_io_ptr->mbfp3, XDR_DECODE);
-		    }
-		else
-		    {
-		    status = MB_FAILURE;
-		    *error = MB_ERROR_MEMORY_FAIL;
-		    }
-		}
-	    }
-
-	/* else handle single normal files to be opened with mb_fileio_open() */
-	else if (mb_io_ptr->filetype == MB_FILETYPE_SINGLE)
-	    {
-	    status = mb_fileio_open(verbose, *mbio_ptr, error);
-	    }
-
-	/* else handle gsf files to be opened with gsflib */
-	else if (mb_io_ptr->filetype == MB_FILETYPE_GSF)
-	    {
-	    status = gsfOpen(mb_io_ptr->file,
-				GSF_READONLY,
-				(int *) &(mb_io_ptr->gsfid));
-	    if (status == 0)
-		{
-		status = MB_SUCCESS;
-		*error = MB_ERROR_NO_ERROR;
-		}
-	    else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_OPEN_FAIL;
-		}
-	    }
-
-	/* else handle netcdf files to be opened with libnetcdf */
-	else if (mb_io_ptr->filetype == MB_FILETYPE_NETCDF)
-	    {
-	    status = nc_open(mb_io_ptr->file,
-				NC_NOWRITE,
-				(int *) &(mb_io_ptr->ncid));
-	    if (status == 0)
-		{
-		status = MB_SUCCESS;
-		*error = MB_ERROR_NO_ERROR;
-		}
-	    else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_OPEN_FAIL;
-		}
-	    }
-
-	/* else handle surf files to be opened with libsapi */
-	else if (mb_io_ptr->filetype == MB_FILETYPE_SURF)
-	    {
-	    lastslash = strrchr(file, '/');
-	    if (lastslash != NULL && strlen(lastslash) > 1)
-	    	{
-		strcpy(name,&(lastslash[1]));
-		strcpy(path,file);
-		path[strlen(file) - strlen(lastslash)] = '\0';
-		}
-	    else if (strlen(file) > 0)
-	    	{
-		strcpy(path, ".");
-		strcpy(name, file);
-		}
-	    else
-	     	{
-		status = MB_FAILURE;
-		*error = MB_ERROR_OPEN_FAIL;
-		}
-	    if (status == MB_SUCCESS)
-	    	{
-		if (strcmp(&name[strlen(name)-4],".sda") == 0)
-			name[strlen(name)-4] = '\0';
-		else if (strcmp(&name[strlen(name)-4],".SDA") == 0)
-			name[strlen(name)-4] = '\0';
-		else if (strcmp(&name[strlen(name)-4],".six") == 0)
-			name[strlen(name)-4] = '\0';
-		else if (strcmp(&name[strlen(name)-4],".SIX") == 0)
-			name[strlen(name)-4] = '\0';
-	    	sapi_status = SAPI_open(path,name,verbose);
-	    	if (sapi_status == 0)
-			{
-			status = MB_SUCCESS;
-			*error = MB_ERROR_NO_ERROR;
-			}
-	    	else
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_OPEN_FAIL;
-			}
-		}
-	    else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_OPEN_FAIL;
-		}
-	    }
-
-	/* else handle segy files to be opened with mb_segy */
-	else if (mb_io_ptr->filetype == MB_FILETYPE_SEGY)
-	    {
-	    status = mb_segy_read_init(verbose, mb_io_ptr->file,
-		(void **)&(mb_io_ptr->mbfp), NULL, NULL, error);
-	    if (status != MB_SUCCESS)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_OPEN_FAIL;
-		}
-	    }
-
-	/* if error terminate */
-	if (status == MB_FAILURE)
-		{
-		/* save status and error values */
-		status_save = status;
-		error_save = *error;
-
-		/* free allocated memory */
-		if (mb_io_ptr->filetype == MB_FILETYPE_XDR
-		    && mb_io_ptr->xdrs != NULL)
-			status = mb_freed(verbose,__FILE__, __LINE__,(void **)&mb_io_ptr->xdrs,error);
-		if (mb_io_ptr->filetype == MB_FILETYPE_XDR
-		    && mb_io_ptr->xdrs2 != NULL)
-			status = mb_freed(verbose,__FILE__, __LINE__,(void **)&mb_io_ptr->xdrs2,error);
-		if (mb_io_ptr->filetype == MB_FILETYPE_XDR
-		    && mb_io_ptr->xdrs3 != NULL)
-			status = mb_freed(verbose,__FILE__, __LINE__,(void **)&mb_io_ptr->xdrs3,error);
-		status = mb_freed(verbose,__FILE__, __LINE__,(void **)&mb_io_ptr->beamflag,error);
-		status = mb_freed(verbose,__FILE__, __LINE__,(void **)&mb_io_ptr->bath,error);
-		status = mb_freed(verbose,__FILE__, __LINE__,(void **)&mb_io_ptr->amp,error);
-		status = mb_freed(verbose,__FILE__, __LINE__,(void **)&mb_io_ptr->bath_acrosstrack,error);
-		status = mb_freed(verbose,__FILE__, __LINE__,(void **)&mb_io_ptr->bath_alongtrack,error);
-		status = mb_freed(verbose,__FILE__, __LINE__,(void **)&mb_io_ptr->bath_num,error);
-		status = mb_freed(verbose,__FILE__, __LINE__,(void **)&mb_io_ptr->amp_num,error);
-		status = mb_freed(verbose,__FILE__, __LINE__,(void **)&mb_io_ptr->ss,error);
-		status = mb_freed(verbose,__FILE__, __LINE__,(void **)&mb_io_ptr->ss_acrosstrack,error);
-		status = mb_freed(verbose,__FILE__, __LINE__,(void **)&mb_io_ptr->ss_alongtrack,error);
-		status = mb_freed(verbose,__FILE__, __LINE__,(void **)&mb_io_ptr->ss_num,error);
-		status = mb_freed(verbose,__FILE__, __LINE__,(void **)&mb_io_ptr->new_beamflag,error);
-		status = mb_freed(verbose,__FILE__, __LINE__,(void **)&mb_io_ptr->new_bath,error);
-		status = mb_freed(verbose,__FILE__, __LINE__,(void **)&mb_io_ptr->new_amp,error);
-		status = mb_freed(verbose,__FILE__, __LINE__,(void **)&mb_io_ptr->new_bath_acrosstrack,error);
-		status = mb_freed(verbose,__FILE__, __LINE__,(void **)&mb_io_ptr->new_bath_alongtrack,error);
-		status = mb_freed(verbose,__FILE__, __LINE__,(void **)&mb_io_ptr->new_ss,error);
-		status = mb_freed(verbose,__FILE__, __LINE__,(void **)&mb_io_ptr->new_ss_acrosstrack,error);
-		status = mb_freed(verbose,__FILE__, __LINE__,(void **)&mb_io_ptr->new_ss_alongtrack,error);
-		status = mb_freed(verbose,__FILE__, __LINE__,(void **)&mb_io_ptr,error);
-
-		/* restore error and status values */
-		status = status_save;
-		*error = error_save;
-
-		/* output debug message */
-		if (verbose >= 2)
-			{
-			fprintf(stderr,"\ndbg2  MBIO function <%s> terminated with error\n",
-				function_name);
-			fprintf(stderr,"dbg2  Return values:\n");
-			fprintf(stderr,"dbg2       error:      %d\n",
-				*error);
-			fprintf(stderr,"dbg2  Return status:\n");
-			fprintf(stderr,"dbg2       status:  %d\n",
-				status);
-			}
-		return(status);
-		}
-
-	/* initialize the working variables */
-	mb_io_ptr->ping_count = 0;
-	mb_io_ptr->nav_count = 0;
-	mb_io_ptr->comment_count = 0;
-	if (pings == 0)
-		mb_io_ptr->pings_avg = 2;
-	else
-		mb_io_ptr->pings_avg = pings;
-	mb_io_ptr->pings_read = 0;
-	mb_io_ptr->error_save = MB_ERROR_NO_ERROR;
-	mb_io_ptr->last_time_d = 0.0;
-	mb_io_ptr->last_lon = 0.0;
-	mb_io_ptr->last_lat = 0.0;
-	mb_io_ptr->old_time_d = 0.0;
-	mb_io_ptr->old_lon = 0.0;
-	mb_io_ptr->old_lat = 0.0;
-	mb_io_ptr->old_ntime_d = 0.0;
-	mb_io_ptr->old_nlon = 0.0;
-	mb_io_ptr->old_nlat = 0.0;
-	mb_io_ptr->time_d = 0.0;
-	mb_io_ptr->lon = 0.0;
-	mb_io_ptr->lat = 0.0;
-	mb_io_ptr->speed = 0.0;
-	mb_io_ptr->heading = 0.0;
-	for (i=0;i<mb_io_ptr->beams_bath_max;i++)
-		{
-		mb_io_ptr->beamflag[i] = MB_FLAG_NULL;
-		mb_io_ptr->bath[i] = 0.0;
-		mb_io_ptr->bath_acrosstrack[i] = 0.0;
-		mb_io_ptr->bath_alongtrack[i] = 0.0;
-		mb_io_ptr->bath_num[i] = 0;
-		}
-	for (i=0;i<mb_io_ptr->beams_amp_max;i++)
-		{
-		mb_io_ptr->amp[i] = 0.0;
-		mb_io_ptr->amp_num[i] = 0;
-		}
-	for (i=0;i<mb_io_ptr->pixels_ss_max;i++)
-		{
-		mb_io_ptr->ss[i] = 0.0;
-		mb_io_ptr->ss_acrosstrack[i] = 0.0;
-		mb_io_ptr->ss_alongtrack[i] = 0.0;
-		mb_io_ptr->ss_num[i] = 0;
-		}
-	mb_io_ptr->need_new_ping = MB_YES;
-
-	/* initialize variables for interpolating asynchronous data */
-	mb_io_ptr->nfix = 0;
-	mb_io_ptr->nattitude = 0;
-	mb_io_ptr->nheading = 0;
-	mb_io_ptr->nsonardepth = 0;
-	mb_io_ptr->naltitude = 0;
-	for (i=0;i<MB_ASYNCH_SAVE_MAX;i++)
-		{
-		mb_io_ptr->fix_time_d[i] = 0.0;
-		mb_io_ptr->fix_lon[i] = 0.0;
-		mb_io_ptr->fix_lat[i] = 0.0;
-		mb_io_ptr->attitude_time_d[i] = 0.0;
-		mb_io_ptr->attitude_heave[i] = 0.0;
-		mb_io_ptr->attitude_roll[i] = 0.0;
-		mb_io_ptr->attitude_pitch[i] = 0.0;
-		mb_io_ptr->heading_time_d[i] = 0.0;
-		mb_io_ptr->heading_heading[i] = 0.0;
-		mb_io_ptr->sonardepth_time_d[i] = 0.0;
-		mb_io_ptr->sonardepth_sonardepth[i] = 0.0;
-		mb_io_ptr->altitude_time_d[i] = 0.0;
-		mb_io_ptr->altitude_altitude[i] = 0.0;
-		}
-
-	/* initialize notices */
-	for (i=0;i<MB_NOTICE_MAX;i++)
-		mb_io_ptr->notice_list[i] = 0;
-
-	/* check for projection specification file */
-	sprintf(prjfile, "%s.prj", file);
-	if ((pfp = fopen(prjfile, "r")) != NULL)
-		{
-		nscan = fscanf(pfp,"%s", projection_id);
-		proj_status = mb_proj_init(verbose,projection_id,
-			&(mb_io_ptr->pjptr), error);
-		if (proj_status == MB_SUCCESS)
-			{
-			mb_io_ptr->projection_initialized = MB_YES;
-			strcpy(mb_io_ptr->projection_id, projection_id);
-			}
-		else
-			{
-			fprintf(stderr, "Unable to initialize projection %s from file %s\n\n",
-				projection_id, prjfile);
-			}
-		fclose(pfp);
-		}
-	else
-		{
-		*error = MB_ERROR_OPEN_FAIL;
-		status = MB_FAILURE;
-		}
-
-	/* set error and status (if you got here you succeeded */
-	*error = MB_ERROR_NO_ERROR;
-	status = MB_SUCCESS;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)*mbio_ptr);
-		fprintf(stderr,"dbg2       ->numfile:  %d\n",mb_io_ptr->numfile);
-		fprintf(stderr,"dbg2       ->file:     %s\n",mb_io_ptr->file);
-		if (mb_io_ptr->numfile >= 2 || mb_io_ptr->numfile <= -2)
-		    fprintf(stderr,"dbg2       ->file2:    %s\n",mb_io_ptr->file2);
-		if (mb_io_ptr->numfile >= 3 || mb_io_ptr->numfile <= -3)
-		    fprintf(stderr,"dbg2       ->file3:    %s\n",mb_io_ptr->file3);
-		fprintf(stderr,"dbg2       ->mbfp:     %p\n",(void *)mb_io_ptr->mbfp);
-		if (mb_io_ptr->numfile >= 2 || mb_io_ptr->numfile <= -2)
-		    fprintf(stderr,"dbg2       ->mbfp2:    %p\n",(void *)mb_io_ptr->mbfp2);
-		if (mb_io_ptr->numfile >= 3 || mb_io_ptr->numfile <= -3)
-		    fprintf(stderr,"dbg2       ->mbfp3:    %p\n",(void *)mb_io_ptr->mbfp3);
-		fprintf(stderr,"dbg2       btime_d:    %f\n",*btime_d);
-		fprintf(stderr,"dbg2       etime_d:    %f\n",*etime_d);
-		fprintf(stderr,"dbg2       beams_bath: %d\n",*beams_bath);
-		fprintf(stderr,"dbg2       beams_amp:  %d\n",*beams_amp);
-		fprintf(stderr,"dbg2       pixels_ss:  %d\n",*pixels_ss);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mb_read_ping.c b/src/mbio/mb_read_ping.c
deleted file mode 100644
index 1c96ef7..0000000
--- a/src/mbio/mb_read_ping.c
+++ /dev/null
@@ -1,121 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mb_read_ping.c	2/3/93
- *    $Id: mb_read_ping.c 2227 2015-02-05 21:12:31Z caress $
-
- *    Copyright (c) 1993-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mb_read_ping.c calls the appropriate mbr_ routine for reading
- * the next ping from a multibeam data file.  The new ping data
- * will be placed in the "new_" variables in the mbio structure pointed
- * to by mbio_ptr.
- *
- * Author:	D. W. Caress
- * Date:	February 3, 1993
- *
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mb_define.h"
-
-/*--------------------------------------------------------------------*/
-int mb_read_ping(int verbose, void *mbio_ptr, void *store_ptr, int *kind, int *error)
-{
-  static char rcs_id[]="$Id: mb_read_ping.c 2227 2015-02-05 21:12:31Z caress $";
-	char	*function_name = "mb_read_ping";
-	int	status;
-	struct mb_io_struct *mb_io_ptr;
-	int	localkind;
-	int	beams_bath;
-	int	beams_amp;
-	int	pixels_ss;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* call the appropriate mbr_ read and translate routine */
-	if (mb_io_ptr->mb_io_read_ping != NULL)
-		{
-		status = (*mb_io_ptr->mb_io_read_ping)(verbose,mbio_ptr,store_ptr,error);
-		}
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_BAD_FORMAT;
-		}
-
-	/* set data record kind */
-	if (status == MB_SUCCESS)
-		{
-		*kind = mb_io_ptr->new_kind;
-		mb_notice_log_datatype(verbose, mb_io_ptr, *kind);
-		}
-	else
-		*kind = MB_DATA_NONE;
-
-	/* check that io arrays are large enough, allocate larger arrays if necessary */
-	if (status == MB_SUCCESS
-		&& mb_io_ptr->new_kind == MB_DATA_DATA)
-		{
-		/* check size of arrays needed for newly read data */
-		status = mb_dimensions(verbose,mbio_ptr,store_ptr,&localkind,
-					&beams_bath,&beams_amp,&pixels_ss,error);
-
-		/* if existing allocations are insufficient, allocate larger arrays
-			- this includes both arrays hidden within the mbio_ptr structure
-			and arrays registered by the application */
-		if (beams_bath > mb_io_ptr->beams_bath_alloc
-			|| beams_amp > mb_io_ptr->beams_amp_alloc
-			|| pixels_ss > mb_io_ptr->pixels_ss_alloc)
-			{
-			status = mb_update_arrays(verbose, mbio_ptr,
-				beams_bath, beams_amp, pixels_ss, error);
-			}
-		mb_io_ptr->beams_bath_max = MAX(mb_io_ptr->beams_bath_max, beams_bath);
-		mb_io_ptr->beams_amp_max = MAX(mb_io_ptr->beams_amp_max, beams_amp);
-		mb_io_ptr->pixels_ss_max = MAX(mb_io_ptr->pixels_ss_max, pixels_ss);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mb_rt.c b/src/mbio/mb_rt.c
deleted file mode 100644
index a198f59..0000000
--- a/src/mbio/mb_rt.c
+++ /dev/null
@@ -1,1238 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mb_rt.c	11/14/94
- *    $Id: mb_rt.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1994-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mb_rt.c traces a ray through a gradient velocity structure. The
- * ray's starting position and takeoff angle are provided, as is
- * the velocity structure. The ray is traced until it either exits
- * the model or exhausts the specified travel time.
- *
- * Author:	D. W. Caress
- * Date:	November 14, 1994
- *
- * $Log: mb_rt.c,v $
- * Revision 5.2  2008/07/10 06:43:40  caress
- * Preparing for 5.1.1beta20
- *
- * Revision 5.1  2007/10/08 06:10:15  caress
- * Added function prototypes.
- *
- * Revision 5.0  2000/12/01 22:53:59  caress
- * First cut at Version 5.0.
- *
- * Revision 4.10  2000/10/11  00:54:20  caress
- * Converted to ANSI C
- *
- * Revision 4.9  2000/09/30  06:54:58  caress
- * Snapshot for Dale.
- *
- * Revision 4.8  1999/02/04  23:54:34  caress
- * MB-System version 4.6beta7
- *
- * Revision 4.7  1998/10/05  19:18:30  caress
- * MB-System version 4.6beta
- *
- * Revision 4.6  1997/09/12  18:51:10  caress
- * Moved mb_rt.c to own directory.
- *
- *
- */
-
-/* standard global include files */
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_define.h"
-
-/* raytracing defines */
-#define	MB_RT_GRADIENT_TOLERANCE    0.00001
-#define	MB_RT_LAYER_HOMOGENEOUS	    0
-#define	MB_RT_LAYER_GRADIENT	    1
-#define	MB_RT_ERROR		0
-#define	MB_RT_DOWN		1
-#define	MB_RT_UP		2
-#define	MB_RT_DOWN_TURN		3
-#define	MB_RT_UP_TURN		4
-#define	MB_RT_OUT_BOTTOM	5
-#define	MB_RT_OUT_TOP		6
-#define	MB_RT_NUMBER_SEGMENTS	5
-#define MB_RT_PLOT_MODE_OFF		0
-#define MB_RT_PLOT_MODE_ON 		1
-#define MB_RT_PLOT_MODE_TABLE		2
-#define	MB_SSV_NO_USE	    0
-#define	MB_SSV_CORRECT	    1
-#define	MB_SSV_INCORRECT    2
-
-/* velocity model structure */
-struct	velocity_model
-	{
-	/* velocity model */
-	int	number_node;
-	double	*depth;
-	double	*velocity;
-	int	number_layer;
-	int	*layer_mode;
-	double	*layer_gradient;
-	double	*layer_depth_center;
-	double	*layer_depth_top;
-	double	*layer_depth_bottom;
-	double	*layer_vel_top;
-	double	*layer_vel_bottom;
-
-	/* raytracing bookkeeping variables */
-	int	ray_status;
-	int	done;
-	int	outofbounds;
-	int	layer;
-	int	turned;
-	int	plot_mode;
-	int	number_plot_max;
-	int	number_plot;
-	int	sign_x;
-	double	xx;
-	double	zz;
-	double	xf;
-	double	zf;
-	double	tt;
-	double	dt;
-	double	tt_left;
-	double	vv_source;
-	double	pp;
-	double	xc;
-	double	zc;
-	double	radius;
-	double	*xx_plot;
-	double	*zz_plot;
-	};
-
-/* global raytrace values */
-static struct velocity_model *model;
-
-int mb_rt_init(int verbose, int number_node,
-		double *depth, double *velocity,
-		void **modelptr, int *error);
-int mb_rt_deall(int verbose, void **modelptr, int *error);
-int mb_rt(int verbose, void *modelptr,
-	double source_depth, double source_angle, double end_time,
-	int ssv_mode, double surface_vel, double null_angle,
-	int nplot_max, int *nplot, double *xplot, double *zplot,
-	double *x, double *z, double *travel_time, int *ray_stat, int *error);
-int mb_rt_circular(int verbose, int *error);
-int mb_rt_quad1(int verbose, int *error);
-int mb_rt_quad2(int verbose, int *error);
-int mb_rt_quad3(int verbose, int *error);
-int mb_rt_quad4(int verbose, int *error);
-int mb_rt_get_depth(int verbose, double beta, int dir_sign, int turn_sign,
-		double *depth, int *error);
-int mb_rt_plot_circular(int verbose, int *error);
-int mb_rt_line(int verbose, int *error);
-int mb_rt_vertical(int verbose, int *error);
-
-static char rcs_id[]="$Id: mb_rt.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------------*/
-int mb_rt_init(int verbose, int number_node,
-		double *depth, double *velocity,
-		void **modelptr, int *error)
-{
-	char	*function_name = "mb_rt_init";
-	int	status = MB_SUCCESS;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBBA function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:          %d\n",verbose);
-		fprintf(stderr,"dbg2       number_node:      %d\n",number_node);
-		for (i=0;i<number_node;i++)
-			{
-			fprintf(stderr,"dbg2       depth: %f  velocity:%f\n",
-				depth[i], velocity[i]);
-			}
-		fprintf(stderr,"dbg2       modelptr:         %p\n",(void *)modelptr);
-		}
-
-	/* allocate memory for model structure */
-	status = mb_mallocd(verbose,__FILE__,__LINE__,sizeof(struct velocity_model),(void **)modelptr,error);
-
-	/* set variables and allocate memory for velocity model */
-	model = (struct velocity_model *) *modelptr;
-	model->number_node = number_node;
-	status = mb_mallocd(verbose,__FILE__,__LINE__,number_node*sizeof(double),
-				(void **)&(model->depth),error);
-	status = mb_mallocd(verbose,__FILE__,__LINE__,number_node*sizeof(double),
-				(void **)&(model->velocity),error);
-	model->number_layer = number_node - 1;
-	status = mb_mallocd(verbose,__FILE__,__LINE__,model->number_layer*sizeof(int),
-				(void **)&(model->layer_mode),error);
-	status = mb_mallocd(verbose,__FILE__,__LINE__,model->number_layer*sizeof(double),
-				(void **)&(model->layer_gradient),error);
-	status = mb_mallocd(verbose,__FILE__,__LINE__,model->number_layer*sizeof(double),
-				(void **)&(model->layer_depth_center),error);
-	if (status == MB_SUCCESS)
-		{
-		model->layer_depth_top = &model->depth[0];
-		model->layer_depth_bottom = &model->depth[1];
-		model->layer_vel_top = &model->velocity[0];
-		model->layer_vel_bottom = &model->velocity[1];
-		}
-
-	/* put model into structure */
-	for (i=0;i<number_node;i++)
-		{
-		model->depth[i] = depth[i];
-		model->velocity[i] = velocity[i];
-		}
-	for (i=0;i<model->number_layer;i++)
-		{
-		model->layer_gradient[i] =
-			(model->layer_vel_bottom[i] - model->layer_vel_top[i])/
-			(model->layer_depth_bottom[i] - model->layer_depth_top[i]);
-		if (fabs(model->layer_gradient[i]) > MB_RT_GRADIENT_TOLERANCE)
-			{
-			model->layer_mode[i] = MB_RT_LAYER_GRADIENT;
-			model->layer_depth_center[i] =
-				model->layer_depth_top[i] -
-				model->layer_vel_top[i]/
-				model->layer_gradient[i];
-			}
-		else
-			{
-			model->layer_mode[i] = MB_RT_LAYER_HOMOGENEOUS;
-			model->layer_depth_center[i] = 0.0;
-			}
-		}
-
-	/* initialize raytracing bookkeeping variables */
-	model->ray_status = 0;
-	model->done = 0;
-	model->outofbounds = 0;
-	model->layer = 0;
-	model->turned = 0;
-	model->plot_mode = 0;
-	model->number_plot_max = 0;
-	model->number_plot = 0;
-	model->sign_x = 0;
-	model->xx = 0.0;
-	model->zz = 0.0;
-	model->xf = 0.0;
-	model->zf = 0.0;
-	model->tt = 0.0;
-	model->dt = 0.0;
-	model->tt_left = 0.0;
-	model->vv_source = 0.0;
-	model->pp = 0.0;
-	model->xc = 0.0;
-	model->zc = 0.0;
-	model->radius = 0.0;
-	model->xx_plot = NULL;
-	model->zz_plot = NULL;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       modelptr:   %p\n",(void *)*modelptr);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------------*/
-int mb_rt_deall(int verbose, void **modelptr, int *error)
-{
-	char	*function_name = "mb_rt";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBBA function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:          %d\n",verbose);
-		fprintf(stderr,"dbg2       modelptr:         %p\n",(void *)modelptr);
-		}
-
-	/* deallocate memory for velocity model */
-	model = (struct velocity_model *) *modelptr;
-	status = mb_freed(verbose,__FILE__, __LINE__, (void **)&(model->depth),error);
-	status = mb_freed(verbose,__FILE__, __LINE__, (void **)&(model->velocity),error);
-	status = mb_freed(verbose,__FILE__, __LINE__, (void **)&(model->layer_mode),error);
-	status = mb_freed(verbose,__FILE__, __LINE__, (void **)&(model->layer_gradient),error);
-	status = mb_freed(verbose,__FILE__, __LINE__, (void **)&(model->layer_depth_center),error);
-	status = mb_freed(verbose,__FILE__, __LINE__, (void **)modelptr,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------------*/
-int mb_rt(int verbose, void *modelptr,
-	double source_depth, double source_angle, double end_time,
-	int ssv_mode, double surface_vel, double null_angle,
-	int nplot_max, int *nplot, double *xplot, double *zplot,
-	double *x, double *z, double *travel_time, int *ray_stat, int *error)
-{
-	char	*function_name = "mb_rt";
-	int	status = MB_SUCCESS;
-	double	diff_angle;
-	double	vel_ratio;
-	int	i;
-
-	/* get pointer to velocity model */
-	model = (struct velocity_model *) modelptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBBA function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:          %d\n",verbose);
-		fprintf(stderr,"dbg2       modelptr:         %p\n",(void *)modelptr);
-		fprintf(stderr,"dbg2       number_node:      %d\n",model->number_node);
-		fprintf(stderr,"dbg2       layer depth velocity:\n");
-		for (i=0;i<model->number_node;i++)
-			{
-			fprintf(stderr,"dbg2       %d %f %f\n",
-				i, model->depth[i], model->velocity[i]);
-			}
-		fprintf(stderr,"dbg2       number_layer:     %d\n",model->number_layer);
-		fprintf(stderr,"dbg2       layer top bottom veltop velbot  mode grad zc\n");
-		for (i=0;i<model->number_layer;i++)
-			{
-			fprintf(stderr,"dbg2       %d  %f %f  %f %f  %d %f %f\n",
-				i, model->layer_depth_top[i],
-				model->layer_depth_bottom[i],
-				model->layer_vel_top[i],
-				model->layer_vel_bottom[i],
-				model->layer_mode[i],
-				model->layer_gradient[i],
-				model->layer_depth_center[i]);
-			}
-		fprintf(stderr,"dbg2       source_depth:     %f\n",source_depth);
-		fprintf(stderr,"dbg2       source_angle:     %f\n",source_angle);
-		fprintf(stderr,"dbg2       end_time:         %f\n",end_time);
-		fprintf(stderr,"dbg2       ssv_mode:         %d\n",ssv_mode);
-		fprintf(stderr,"dbg2       surface_vel:      %f\n",surface_vel);
-		fprintf(stderr,"dbg2       null_angle:       %f\n",null_angle);
-		fprintf(stderr,"dbg2       nplot_max:        %d\n",nplot_max);
-		}
-
-	/* prepare the ray */
-	model->layer = -1;
-	for (i=0;i<model->number_layer;i++)
-		{
-		if (source_depth >= model->layer_depth_top[i]
-			&& source_depth <= model->layer_depth_bottom[i])
-			model->layer = i;
-		}
-	if (verbose > 0 && model->layer == -1)
-		{
-		fprintf(stderr,"\nError in MBIO function <%s>\n",
-			function_name);
-		fprintf(stderr,"Ray source depth not within model!!\n");
-		fprintf(stderr,"Raytracing terminated with error!!\n");
-		}
-	if (model->layer == -1)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_BAD_PARAMETER;
-		return(status);
-		}
-	model->vv_source = model->layer_vel_top[model->layer]
-		+ model->layer_gradient[model->layer]*(source_depth - model->layer_depth_top[model->layer]);
-
-	/* reset takeoff angle because of surface sound velocity change:
-	    ssv_mode == MB_SSV_NO_USE:
-	      Do nothing to angles before raytracing.
-	    ssv_mode == MB_SSV_CORRECT:
-	      Adjust the angle assuming the original SSV was correct.
-	      This means use a horizontal layer assumption and Snell's
-	      law to adjust angle as ray goes from original SSV
-	      to the velocity in the SVP at the initial depth. The
-	      null angle is ignored.
-	    ssv_mode == MB_SSV_INCORRECT:
-	      Adjust the angle assuming the original SSV was incorrect.
-	      This means use Snell's law law to adjust angle in a
-	      rotated frame of reference (rotated by null angle) as
-	      ray goes from original SSV to the velocity in the
-	      SVP at the initial depth. This insures that the geometry
-	      of the receiving transducer array is properly handled.
-	 */
-	if (ssv_mode == MB_SSV_CORRECT && surface_vel > 0.0)
-		{
-		model->pp = sin(DTR*source_angle)/surface_vel;
-		vel_ratio = MIN(1.0, model->pp * model->vv_source);
-		source_angle = asin(vel_ratio) * RTD;
-		}
-	else if (ssv_mode == MB_SSV_INCORRECT && surface_vel > 0.0)
-		{
-		diff_angle = source_angle - null_angle;
-		model->pp = sin(DTR*diff_angle)/surface_vel;
-		vel_ratio = MIN(1.0, model->pp * model->vv_source);
-		diff_angle = asin(vel_ratio) * RTD;
-		source_angle = null_angle + diff_angle;
-		}
-
-	/* now initialize ray */
-	if (source_angle > 0.0)
-		model->sign_x = 1;
-	else
-		model->sign_x = -1;
-	source_angle = fabs(source_angle);
-	model->pp = sin(DTR*source_angle)/model->vv_source;
-	if (source_angle < 90.0)
-		{
-		model->turned = MB_NO;
-		model->ray_status = MB_RT_DOWN;
-		}
-	else
-		{
-		model->turned = MB_YES;
-		model->ray_status = MB_RT_UP;
-		}
-	model->xx = 0.0;
-	model->zz = source_depth;
-	model->tt = 0.0;
-	model->tt_left = end_time;
-	model->outofbounds = MB_NO;
-	model->done = MB_NO;
-
-	/* set up raypath plotting */
-	if (nplot_max > 0)
-		{
-		model->plot_mode = MB_RT_PLOT_MODE_ON;
-		model->number_plot_max = nplot_max;
-		}
-	else if (nplot_max < 0)
-		{
-		model->plot_mode = MB_RT_PLOT_MODE_TABLE;
-		model->number_plot_max = -nplot_max;
-		}
-	else
-		{
-		model->plot_mode = MB_RT_PLOT_MODE_OFF;
-		model->number_plot_max = nplot_max;
-		}
-	model->number_plot = 0;
-	if (model->number_plot_max > 0)
-		{
-		model->xx_plot = xplot;
-		model->xx_plot[0] = model->xx;
-		if (model->plot_mode == MB_RT_PLOT_MODE_ON)
-			{
-			model->zz_plot = zplot;
-			model->zz_plot[0] = model->zz;
-			}
-		model->number_plot++;
-		}
-
-	/* print debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  About to trace ray in MB_RT function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2       xx:               %f\n",model->xx);
-		fprintf(stderr,"dbg2       zz:               %f\n",model->zz);
-		fprintf(stderr,"dbg2       layer:            %d\n",model->layer);
-		fprintf(stderr,"dbg2       layer_mode:       %d\n",
-			model->layer_mode[model->layer]);
-		fprintf(stderr,"dbg2       vv_source:        %f\n",model->vv_source);
-		fprintf(stderr,"dbg2       pp:               %f\n",model->pp);
-		fprintf(stderr,"dbg2       tt_left:          %f\n",model->tt_left);
-		}
-
-	/* trace the ray */
-	while (!model->done && !model->outofbounds)
-		{
-		/* trace ray through current layer */
-		if (model->layer_mode[model->layer] == MB_RT_LAYER_GRADIENT
-			&& model->pp > 0.0)
-			status = mb_rt_circular(verbose, error);
-		else if (model->layer_mode[model->layer] == MB_RT_LAYER_GRADIENT)
-			status = mb_rt_vertical(verbose, error);
-		else
-			status = mb_rt_line(verbose, error);
-
-		/* update ray */
-		model->tt = model->tt + model->dt;
-		if (model->layer < 0)
-			{
-			model->outofbounds = MB_YES;
-			model->ray_status = MB_RT_OUT_TOP;
-			}
-		if (model->layer >= model->number_layer)
-			{
-			model->outofbounds = MB_YES;
-			model->ray_status = MB_RT_OUT_BOTTOM;
-			}
-		if (model->tt_left <= 0.0)
-			model->done = MB_YES;
-
-		/* print debug statements */
-		if (verbose >= 2)
-			{
-			fprintf(stderr,"\ndbg2  model->done with ray iteration in MB_RT function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg2       xx:               %f\n",model->xx);
-			fprintf(stderr,"dbg2       zz:               %f\n",model->zz);
-			fprintf(stderr,"dbg2       xf:               %f\n",model->xf);
-			fprintf(stderr,"dbg2       zf:               %f\n",model->zf);
-			fprintf(stderr,"dbg2       layer:            %d\n",model->layer);
-			fprintf(stderr,"dbg2       layer_mode:       %d\n",model->layer_mode[model->layer]);
-			fprintf(stderr,"dbg2       tt:               %f\n",model->tt);
-			fprintf(stderr,"dbg2       dt:               %f\n",model->dt);
-			fprintf(stderr,"dbg2       tt_left:          %f\n",model->tt_left);
-			}
-
-		/* reset position */
-		model->xx = model->xf;
-		model->zz = model->zf;
-		}
-
-	/* report results */
-	*x = model->xx;
-	*z = model->zz;
-	*travel_time = model->tt;
-	*ray_stat = model->ray_status;
-	if (model->number_plot_max > 0)
-		*nplot = model->number_plot;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		if (nplot_max > 0)
-		    fprintf(stderr,"dbg2       nplot:      %d\n",*nplot);
-		fprintf(stderr,"dbg2       x:          %f\n",*x);
-		fprintf(stderr,"dbg2       z:          %f\n",*z);
-		fprintf(stderr,"dbg2       travel_time:%f\n",*travel_time);
-		fprintf(stderr,"dbg2       raystat:    %d\n",*ray_stat);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------------*/
-int mb_rt_circular(int verbose, int *error)
-{
-	char	*function_name = "mb_rt_circular";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBBA function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:          %d\n",verbose);
-		}
-
-	/* decide which case to use */
-	if (model->turned == MB_NO && model->layer_gradient[model->layer] > 0.0)
-		status = mb_rt_quad1(verbose, error);
-	else if (model->turned == MB_NO)
-		status = mb_rt_quad3(verbose, error);
-	else if (model->turned == MB_YES && model->layer_gradient[model->layer] > 0.0)
-		status = mb_rt_quad2(verbose, error);
-	else if (model->turned == MB_YES)
-		status = mb_rt_quad4(verbose, error);
-
-	/* put points in plotting arrays */
-	if (model->number_plot_max > 0)
-		status = mb_rt_plot_circular(verbose, error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------------*/
-int mb_rt_quad1(int verbose, int *error)
-{
-	char	*function_name = "mb_rt_quad1";
-	int	status = MB_SUCCESS;
-	double	vi;
-	double	ip;
-	double	ipvi;
-	double	beta;
-	double	ivf;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBBA function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:          %d\n",verbose);
-		}
-
-	/* find circular path */
-	model->radius = fabs(1.0 / (model->pp * model->layer_gradient[model->layer]));
-	model->zc = model->layer_depth_center[model->layer];
-	model->xc = model->xx + SAFESQRT(model->radius * model->radius - (model->zz - model->zc) * (model->zz - model->zc));
-	vi = model->layer_vel_top[model->layer]
-		+ (model->zz - model->layer_depth_top[model->layer])
-		* model->layer_gradient[model->layer];
-	ip = 1.0 / model->pp;
-	ipvi = ip/vi;
-	beta = log(ipvi + SAFESQRT(ipvi * ipvi - 1.0));
-
-	/* Check if ray turns in layer */
-	if (model->zc + model->radius < model->layer_depth_bottom[model->layer])
-		{
-		/* ray can turn in this layer */
-		model->dt = fabs(beta / model->layer_gradient[model->layer]);
-
-		/* raypath ends before turning */
-		if (model->dt >= model->tt_left)
-			{
-			mb_rt_get_depth(verbose, beta, -1, 1, &model->zf, error);
-			model->xf = model->xc - SAFESQRT(model->radius * model->radius
-				- (model->zf - model->zc) * (model->zf - model->zc));
-			model->dt = model->tt_left;
-			model->tt_left = 0.0;
-			}
-
-		/* raypath turns */
-		else
-			{
-			ivf = 1.0 / model->layer_vel_top[model->layer];
-			model->dt = fabs((log(ip * ivf +
-				ip * SAFESQRT(ivf * ivf - model->pp * model->pp)) + beta)
-				/ model->layer_gradient[model->layer]);
-
-			/* ray turns and exits layer before
-				exhausting tt_left */
-			if (model->dt <= model->tt_left)
-				{
-				model->turned = MB_YES;
-				model->ray_status = MB_RT_UP_TURN;
-				model->zf = model->layer_depth_top[model->layer];
-				model->xf = model->xc + SAFESQRT(model->radius * model->radius
-					- (model->zf - model->zc) * (model->zf - model->zc));
-				model->tt_left = model->tt_left - model->dt;
-				model->layer--;
-				}
-			/* ray turns and exhausts tt_left
-				before exiting layer */
-			else if (model->dt > model->tt_left)
-				{
-				model->turned = MB_YES;
-				model->ray_status = MB_RT_UP_TURN;
-				mb_rt_get_depth(verbose, beta, 1, -1, &model->zf, error);
-				model->xf = model->xc + SAFESQRT(model->radius * model->radius
-					- (model->zf - model->zc) * (model->zf - model->zc));
-				model->dt = model->tt_left;
-				model->tt_left = 0.0;
-				}
-			}
-		}
-	else
-		{
-		/* ray cannot turn in this layer */
-		ivf = 1.0 / model->layer_vel_bottom[model->layer];
-		model->dt = fabs((log(ip * ivf +
-			ip * SAFESQRT(ivf * ivf - model->pp * model->pp)) - beta)
-			/ model->layer_gradient[model->layer]);
-
-
-		/* ray exits layer before exhausting tt_left */
-		if (model->dt <= model->tt_left)
-			{
-			model->zf = model->layer_depth_bottom[model->layer];
-			model->xf = model->xc - SAFESQRT(model->radius * model->radius
-				- (model->zf - model->zc) * (model->zf - model->zc));
-			model->tt_left = model->tt_left - model->dt;
-			model->layer++;
-			}
-		/* ray exhausts tt_left before exiting layer */
-		else if (model->dt > model->tt_left)
-			{
-			model->turned = MB_YES;
-			model->ray_status = MB_RT_UP_TURN;
-			mb_rt_get_depth(verbose, beta, -1, 1, &model->zf, error);
-			model->xf = model->xc - SAFESQRT(model->radius * model->radius
-				- (model->zf - model->zc) * (model->zf - model->zc));
-			model->dt = model->tt_left;
-			model->tt_left = 0.0;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------------*/
-int mb_rt_quad2(int verbose, int *error)
-{
-	char	*function_name = "mb_rt_quad2";
-	int	status = MB_SUCCESS;
-	double	vi;
-	double	ip;
-	double	ipvi;
-	double	beta;
-	double	ivf;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBBA function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:          %d\n",verbose);
-		}
-
-	/* find circular path */
-	model->radius = fabs(1.0 / (model->pp * model->layer_gradient[model->layer]));
-	model->zc = model->layer_depth_center[model->layer];
-	model->xc = model->xx - SAFESQRT(MAX(0.0, model->radius * model->radius - (model->zz - model->zc) * (model->zz - model->zc)));
-
-	vi = model->layer_vel_top[model->layer]
-		+ (model->zz - model->layer_depth_top[model->layer])
-		* model->layer_gradient[model->layer];
-	ip = 1.0 / model->pp;
-	ipvi = ip/vi;
-	beta = log(ipvi + SAFESQRT(ipvi * ipvi - 1.0));
-
-	/* Check if ray ends in layer */
-	ivf = 1.0 / model->layer_vel_top[model->layer];
-	model->dt = fabs((log(ip * ivf +
-		ip * SAFESQRT(ivf * ivf - model->pp * model->pp)) - beta)
-		/ model->layer_gradient[model->layer]);
-
-	/* ray exits layer before exhausting tt_left */
-	if (model->dt <= model->tt_left)
-		{
-		model->zf = model->layer_depth_top[model->layer];
-		model->xf = model->xc + SAFESQRT(model->radius * model->radius
-			- (model->zf - model->zc) * (model->zf - model->zc));
-		model->tt_left = model->tt_left - model->dt;
-		model->layer--;
-		}
-	/* ray exhausts tt_left before exiting layer */
-	else if (model->dt > model->tt_left)
-		{
-		mb_rt_get_depth(verbose, beta, 1, 1, &model->zf, error);
-		model->xf = model->xc + SAFESQRT(model->radius * model->radius
-			- (model->zf - model->zc) * (model->zf - model->zc));
-		model->dt = model->tt_left;
-		model->tt_left = 0.0;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------------*/
-int mb_rt_quad3(int verbose, int *error)
-{
-	char	*function_name = "mb_rt_quad3";
-	int	status = MB_SUCCESS;
-	double	vi;
-	double	ip;
-	double	ipvi;
-	double	beta;
-	double	ivf;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBBA function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:          %d\n",verbose);
-		}
-
-	/* find circular path */
-	model->radius = fabs(1.0 / (model->pp * model->layer_gradient[model->layer]));
-	model->zc = model->layer_depth_center[model->layer];
-	model->xc = model->xx - SAFESQRT(model->radius * model->radius - (model->zz - model->zc) * (model->zz - model->zc));
-	vi = model->layer_vel_top[model->layer]
-		+ (model->zz - model->layer_depth_top[model->layer])
-		* model->layer_gradient[model->layer];
-	ip = 1.0 / model->pp;
-	ipvi = ip/vi;
-	beta = log(ipvi + SAFESQRT(ipvi * ipvi - 1.0));
-
-	/* Check if ray ends in layer */
-	ivf = 1.0 / model->layer_vel_bottom[model->layer];
-	model->dt = fabs((log(ip * ivf +
-		ip * SAFESQRT(ivf * ivf - model->pp * model->pp)) - beta)
-		/ model->layer_gradient[model->layer]);
-
-	/* ray exits layer before exhausting tt_left */
-	if (model->dt <= model->tt_left)
-		{
-		model->zf = model->layer_depth_bottom[model->layer];
-		model->xf = model->xc + SAFESQRT(model->radius * model->radius
-			- (model->zf - model->zc) * (model->zf - model->zc));
-		model->tt_left = model->tt_left - model->dt;
-		model->layer++;
-		}
-	/* ray exhausts tt_left before exiting layer */
-	else if (model->dt > model->tt_left)
-		{
-		mb_rt_get_depth(verbose, beta, 1, 1, &model->zf, error);
-		model->xf = model->xc + SAFESQRT(model->radius * model->radius
-			- (model->zf - model->zc) * (model->zf - model->zc));
-		model->dt = model->tt_left;
-		model->tt_left = 0.0;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------------*/
-int mb_rt_quad4(int verbose, int *error)
-{
-	char	*function_name = "mb_rt_quad4";
-	int	status = MB_SUCCESS;
-	double	vi;
-	double	ip;
-	double	ipvi;
-	double	beta;
-	double	ivf;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBBA function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:          %d\n",verbose);
-		}
-
-	/* find circular path */
-	model->radius = fabs(1.0 / (model->pp * model->layer_gradient[model->layer]));
-	model->zc = model->layer_depth_center[model->layer];
-	model->xc = model->xx + SAFESQRT(model->radius * model->radius - (model->zz - model->zc) * (model->zz - model->zc));
-	vi = model->layer_vel_top[model->layer]
-		+ (model->zz - model->layer_depth_top[model->layer])
-		* model->layer_gradient[model->layer];
-	ip = 1.0 / model->pp;
-	ipvi = ip/vi;
-	beta = log(ipvi + SAFESQRT(ipvi * ipvi - 1.0));
-
-	/* Check if ray turns in layer */
-	if (model->zc - model->radius > model->layer_depth_top[model->layer])
-		{
-		/* ray can turn in this layer */
-		model->dt = fabs(beta / model->layer_gradient[model->layer]);
-
-		/* raypath ends before turning */
-		if (model->dt >= model->tt_left)
-			{
-			mb_rt_get_depth(verbose, beta, -1, 1, &model->zf, error);
-			model->xf = model->xc - SAFESQRT(model->radius * model->radius
-				- (model->zf - model->zc) * (model->zf - model->zc));
-			model->dt = model->tt_left;
-			model->tt_left = 0.0;
-			}
-
-		/* raypath turns */
-		else
-			{
-			ivf = 1.0 / model->layer_vel_bottom[model->layer];
-			model->dt = fabs((log(ip * ivf +
-				ip * SAFESQRT(ivf * ivf - model->pp * model->pp)) + beta)
-				/ model->layer_gradient[model->layer]);
-
-			/* ray turns and exits layer before
-				exhausting tt_left */
-			if (model->dt <= model->tt_left)
-				{
-				model->turned = MB_NO;
-				model->ray_status = MB_RT_DOWN_TURN;
-				model->zf = model->layer_depth_bottom[model->layer];
-				model->xf = model->xc + SAFESQRT(model->radius * model->radius
-					- (model->zf - model->zc) * (model->zf - model->zc));
-				model->tt_left = model->tt_left - model->dt;
-				model->layer++;
-				}
-			/* ray turns and exhausts tt_left
-				before exiting layer */
-			else if (model->dt > model->tt_left)
-				{
-				model->turned = MB_NO;
-				model->ray_status = MB_RT_DOWN_TURN;
-				mb_rt_get_depth(verbose, beta, 1, -1, &model->zf, error);
-				model->xf = model->xc + SAFESQRT(model->radius * model->radius
-					- (model->zf - model->zc) * (model->zf - model->zc));
-				model->dt = model->tt_left;
-				model->tt_left = 0.0;
-				}
-			}
-		}
-	else
-		{
-		/* ray cannot turn in this layer */
-		ivf = 1.0 / model->layer_vel_top[model->layer];
-		model->dt = fabs((log(ip * ivf +
-			ip * SAFESQRT(ivf * ivf - model->pp * model->pp)) - beta)
-			/ model->layer_gradient[model->layer]);
-
-
-		/* ray exits layer before exhausting tt_left */
-		if (model->dt <= model->tt_left)
-			{
-			model->zf = model->layer_depth_top[model->layer];
-			model->xf = model->xc - SAFESQRT(model->radius * model->radius
-				- (model->zf - model->zc) * (model->zf - model->zc));
-			model->tt_left = model->tt_left - model->dt;
-			model->layer--;
-			}
-		/* ray exhausts tt_left before exiting layer */
-		else if (model->dt > model->tt_left)
-			{
-			model->turned = MB_YES;
-			model->ray_status = MB_RT_UP_TURN;
-			mb_rt_get_depth(verbose, beta, -1, 1, &model->zf, error);
-			model->xf = model->xc - SAFESQRT(model->radius * model->radius
-				- (model->zf - model->zc) * (model->zf - model->zc));
-			model->dt = model->tt_left;
-			model->tt_left = 0.0;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------------*/
-int mb_rt_get_depth(int verbose, double beta, int dir_sign, int turn_sign,
-		double *depth, int *error)
-{
-	char	*function_name = "mb_rt_get_depth";
-	int	status = MB_SUCCESS;
-	double	alpha;
-	double	velf;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBBA function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:          %d\n",verbose);
-		fprintf(stderr,"dbg2       beta:             %f\n",beta);
-		fprintf(stderr,"dbg2       dir_sign:         %d\n",dir_sign);
-		fprintf(stderr,"dbg2       turn_sign:        %d\n",turn_sign);
-		}
-
-	/* find depth */
-	alpha = model->pp * exp(dir_sign * model->tt_left
-		* fabs(model->layer_gradient[model->layer])
-		+ turn_sign*beta);
-	velf = 2 * alpha / (alpha * alpha + model->pp * model->pp);
-	*depth = model->layer_depth_top[model->layer]
-		+ (velf - model->layer_vel_top[model->layer])
-		/ model->layer_gradient[model->layer];
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       depth:      %f\n",*depth);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------------*/
-int mb_rt_plot_circular(int verbose, int *error)
-{
-	char	*function_name = "mb_rt_plot_circular";
-	int	status = MB_SUCCESS;
-	double	ai;
-	double	af;
-	double	dang;
-	double	angle;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBBA function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:          %d\n",verbose);
-		}
-
-	/* if full plot do circle segments */
-	if (model->plot_mode == MB_RT_PLOT_MODE_ON)
-		{
-		/* get angle range */
-		ai = atan2((model->xx - model->xc), (model->zz - model->zc));
-		af = atan2((model->xf - model->xc), (model->zf - model->zc));
-		dang = (af - ai)/MB_RT_NUMBER_SEGMENTS;
-
-		/* add points to plotting arrays */
-		for (i=0;i<MB_RT_NUMBER_SEGMENTS;i++)
-			{
-			angle = ai + (i + 1) * dang;
-			if (model->number_plot < model->number_plot_max)
-				{
-				model->xx_plot[model->number_plot] = model->sign_x * (model->xc + model->radius * sin(angle));
-				model->zz_plot[model->number_plot] = model->zc + model->radius * cos(angle);
-				model->number_plot++;
-				}
-			}
-		}
-
-	/* otherwise just add the layer end */
-	else if (model->plot_mode == MB_RT_PLOT_MODE_TABLE)
-		{
-		model->xx_plot[model->number_plot] = model->xf;
-		model->number_plot++;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------------*/
-int mb_rt_line(int verbose, int *error)
-{
-	char	*function_name = "mb_rt_line";
-	int	status = MB_SUCCESS;
-	double	theta;
-	double	xvel;
-	double	zvel;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBBA function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:          %d\n",verbose);
-		}
-
-	/* find linear path */
-	theta = asin(model->pp * model->layer_vel_top[model->layer]);
-	if (model->turned == MB_NO)
-		{
-		model->zf = model->layer_depth_bottom[model->layer];
-		}
-	else
-		{
-		theta = theta + M_PI;
-		model->zf = model->layer_depth_top[model->layer];
-		}
-	xvel = model->layer_vel_top[model->layer] * sin(theta);
-	zvel = model->layer_vel_top[model->layer] * cos(theta);
-	if (zvel != 0.0)
-		model->dt = (model->zf - model->zz) / zvel;
-	else
-		model->dt = 100 * model->tt_left;
-
-	/* ray exhausts tt_left before exiting layer */
-	if (model->dt >= model->tt_left)
-		{
-		model->xf = model->xx + xvel * model->tt_left;
-		model->zf = model->zz + zvel * model->tt_left;
-		model->dt = model->tt_left;
-		model->tt_left = 0.0;
-		}
-
-	/* ray exits layer before exhausting tt_left */
-	else
-		{
-		model->xf = model->xx + xvel*model->dt;
-		model->zf = model->zz + zvel*model->dt;
-		model->tt_left = model->tt_left - model->dt;
-		if (model->turned == MB_YES)
-			model->layer--;
-		else
-			model->layer++;
-		}
-
-	/* put points in plotting arrays */
-	if (model->plot_mode != MB_RT_PLOT_MODE_OFF && model->number_plot < model->number_plot_max)
-		{
-		model->xx_plot[model->number_plot] = model->sign_x * model->xf;
-		if (model->plot_mode == MB_RT_PLOT_MODE_ON)
-			model->zz_plot[model->number_plot] = model->zf;
-		model->number_plot++;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------------*/
-int mb_rt_vertical(int verbose, int *error)
-{
-	char	*function_name = "mb_rt_vertical";
-	int	status = MB_SUCCESS;
-	double	vi;
-	double	vf;
-	double	vfvi;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBBA function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:          %d\n",verbose);
-		}
-
-	/* find linear path */
-	vi = model->layer_vel_top[model->layer]
-		+ (model->zz - model->layer_depth_top[model->layer])
-		* model->layer_gradient[model->layer];
-	if (model->turned == MB_NO)
-		{
-		model->zf = model->layer_depth_bottom[model->layer];
-		vf = model->layer_vel_bottom[model->layer];
-		}
-	else
-		{
-		model->zf = model->layer_depth_top[model->layer];
-		vf = model->layer_vel_top[model->layer];
-		}
-	model->dt = fabs(log(vf / vi) / model->layer_gradient[model->layer]);
-
-	/* ray exhausts tt_left before exiting layer */
-	if (model->dt >= model->tt_left)
-		{
-		model->xf = model->xx;
-		vfvi = exp(model->tt_left * model->layer_gradient[model->layer]);
-		if (model->turned == MB_NO)
-			vf = vi * vfvi;
-		else if (model->turned == MB_YES)
-			vf = vi / vfvi;
-		model->zf = (vf - model->layer_vel_top[model->layer])
-			/ model->layer_gradient[model->layer]
-			+ model->layer_depth_top[model->layer];
-		model->dt = model->tt_left;
-		model->tt_left = 0.0;
-		}
-
-	/* ray exits layer before exhausting tt_left */
-	else
-		{
-		model->xf = model->xx;
-		model->tt_left = model->tt_left - model->dt;
-		if (model->turned == MB_YES)
-			model->layer--;
-		else
-			model->layer++;
-		}
-
-	/* put points in plotting arrays */
-	if (model->plot_mode != MB_RT_PLOT_MODE_OFF && model->number_plot < model->number_plot_max)
-		{
-		model->xx_plot[model->number_plot] = model->sign_x * model->xf;
-		if (model->plot_mode == MB_RT_PLOT_MODE_ON)
-			model->zz_plot[model->number_plot] = model->zf;
-		model->number_plot++;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------------*/
diff --git a/src/mbio/mb_segy.c b/src/mbio/mb_segy.c
deleted file mode 100644
index 0655ea7..0000000
--- a/src/mbio/mb_segy.c
+++ /dev/null
@@ -1,1277 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mb_segy.c	5/25/2004
- *    $Id: mb_segy.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 2004-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mb_segy.c includes the functions used to read, write, and use
- * edit save files.
- *
- * Author:	D. W. Caress
- * Date:	May 25, 2004
- *
- * $Log: mb_segy.c,v $
- * Revision 5.7  2008/09/13 06:08:09  caress
- * Updates to apply suggested patches to segy handling. Also fixes to remove compiler warnings.
- *
- * Revision 5.6  2008/07/10 06:43:40  caress
- * Preparing for 5.1.1beta20
- *
- * Revision 5.5  2006/11/10 22:36:04  caress
- * Working towards release 5.1.0
- *
- * Revision 5.4  2006/01/24 19:11:17  caress
- * Version 5.0.8 beta.
- *
- * Revision 5.3  2004/11/06 03:55:17  caress
- * Working to support the Reson 7k format.
- *
- * Revision 5.2  2004/09/16 19:02:34  caress
- * Changes to better support segy data.
- *
- * Revision 5.1  2004/07/27 19:44:38  caress
- * Working on handling subbottom data.
- *
- * Revision 5.0  2004/06/18 03:03:04  caress
- * Adding support for segy i/o.
- *
- *
- *
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <math.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_define.h"
-#include "mb_segy.h"
-#include "mb_swap.h"
-
-static char rcs_id[]="$Id: mb_segy.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-/* 	function mb_segy_read_init opens an existing segy file for
-	reading. The file headers are returned */
-int mb_segy_read_init(int verbose, char *segyfile,
-		void **mbsegyio_ptr,
-		struct mb_segyasciiheader_struct *segyasciiheader,
-		struct mb_segyfileheader_struct *segyfileheader,
-		int *error)
-{
-  	char	*function_name = "mb_segy_read_init";
-	int	status = MB_SUCCESS;
-	struct mb_segyio_struct *mb_segyio_ptr;
-	struct mb_segyasciiheader_struct *asciiheader;
-	struct mb_segyfileheader_struct *fileheader;
-	char	*buffer;
-	int	index;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:             %d\n",verbose);
-		fprintf(stderr,"dbg2       segyfile:            %s\n",segyfile);
-		fprintf(stderr,"dbg2       mbsegyio_ptr:        %p\n",(void *)mbsegyio_ptr);
-		fprintf(stderr,"dbg2       asciiheader:         %p\n",(void *)segyasciiheader);
-		fprintf(stderr,"dbg2       fileheader:          %p\n",(void *)segyfileheader);
-		}
-
-	/* allocate memory for mbsegyio descriptor */
-	if ((status = mb_mallocd(verbose,__FILE__, __LINE__, sizeof(struct mb_segyio_struct),
-				(void **)mbsegyio_ptr, error)) == MB_SUCCESS)
-		{
-		/* get structure */
-		mb_segyio_ptr = (struct mb_segyio_struct *) *mbsegyio_ptr;
-
-		/* zero the structure */
-		memset(mb_segyio_ptr, 0, sizeof(struct mb_segyio_struct));
-
-		/* allocate buffer memory */
-		status = mb_mallocd(verbose,__FILE__, __LINE__, MB_SEGY_FILEHEADER_LENGTH,
-				(void **)&(mb_segyio_ptr->buffer),error);
-		if (status == MB_SUCCESS)
-			mb_segyio_ptr->bufferalloc = MB_SEGY_FILEHEADER_LENGTH;
-		else
-			mb_segyio_ptr->bufferalloc = 0;
-
-		/* set local pointers */
-		asciiheader = &(mb_segyio_ptr->asciiheader);
-		fileheader = &(mb_segyio_ptr->fileheader);
-		}
-
-	/* if ok then open the segy file */
-	if (status == MB_SUCCESS)
-		{
-		/* open the segy file */
-		strcpy(mb_segyio_ptr->segyfile, segyfile);
-		if ((mb_segyio_ptr->fp = fopen(mb_segyio_ptr->segyfile,"r")) == NULL)
-			{
-			*error = MB_ERROR_OPEN_FAIL;
-			status = MB_FAILURE;
-			fprintf(stderr, "\nUnable to open segy file %s\n", mb_segyio_ptr->segyfile);
-			}
-
-		/* set asciiheader and fileheader flags */
-		mb_segyio_ptr->asciiheader_set = MB_NO;
-		mb_segyio_ptr->fileheader_set = MB_NO;
-		}
-
-	/* if ok then read file headers */
-	if (status == MB_SUCCESS)
-		{
-		/* read ascii header */
-		if (fread((char *) asciiheader,1,MB_SEGY_ASCIIHEADER_LENGTH,mb_segyio_ptr->fp)
-					!= MB_SEGY_ASCIIHEADER_LENGTH)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_EOF;
-			}
-		else
-			mb_segyio_ptr->asciiheader_set = MB_YES;
-
-		/* read file header */
-		if (fread(mb_segyio_ptr->buffer,1,MB_SEGY_FILEHEADER_LENGTH,mb_segyio_ptr->fp)
-					!= MB_SEGY_FILEHEADER_LENGTH)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_EOF;
-			}
-		else
-			mb_segyio_ptr->fileheader_set = MB_YES;
-
-		/* extract file header data */
-		if (status == MB_SUCCESS)
-			{
-			index = 0;
-			buffer = mb_segyio_ptr->buffer;
-			mb_get_binary_int(MB_NO, (void *) &(buffer[index]), &(fileheader->jobid)); index += 4;
-			mb_get_binary_int(MB_NO, (void *) &(buffer[index]), &(fileheader->line)); index += 4;
-			mb_get_binary_int(MB_NO, (void *) &(buffer[index]), &(fileheader->reel)); index += 4;
-			mb_get_binary_short(MB_NO, (void *) &(buffer[index]), &(fileheader->channels)); index += 2;
-			mb_get_binary_short(MB_NO, (void *) &(buffer[index]), &(fileheader->aux_channels)); index += 2;
-			mb_get_binary_short(MB_NO, (void *) &(buffer[index]), &(fileheader->sample_interval)); index += 2;
-			mb_get_binary_short(MB_NO, (void *) &(buffer[index]), &(fileheader->sample_interval_org)); index += 2;
-			mb_get_binary_short(MB_NO, (void *) &(buffer[index]), &(fileheader->number_samples)); index += 2;
-			mb_get_binary_short(MB_NO, (void *) &(buffer[index]), &(fileheader->number_samples_org)); index += 2;
-			mb_get_binary_short(MB_NO, (void *) &(buffer[index]), &(fileheader->format)); index += 2;
-			mb_get_binary_short(MB_NO, (void *) &(buffer[index]), &(fileheader->cdp_fold)); index += 2;
-			mb_get_binary_short(MB_NO, (void *) &(buffer[index]), &(fileheader->trace_sort)); index += 2;
-			mb_get_binary_short(MB_NO, (void *) &(buffer[index]), &(fileheader->vertical_sum)); index += 2;
-			mb_get_binary_short(MB_NO, (void *) &(buffer[index]), &(fileheader->sweep_start)); index += 2;
-			mb_get_binary_short(MB_NO, (void *) &(buffer[index]), &(fileheader->sweep_end)); index += 2;
-			mb_get_binary_short(MB_NO, (void *) &(buffer[index]), &(fileheader->sweep_length)); index += 2;
-			mb_get_binary_short(MB_NO, (void *) &(buffer[index]), &(fileheader->sweep_type)); index += 2;
-			mb_get_binary_short(MB_NO, (void *) &(buffer[index]), &(fileheader->sweep_trace)); index += 2;
-			mb_get_binary_short(MB_NO, (void *) &(buffer[index]), &(fileheader->sweep_taper_start)); index += 2;
-			mb_get_binary_short(MB_NO, (void *) &(buffer[index]), &(fileheader->sweep_taper_end)); index += 2;
-			mb_get_binary_short(MB_NO, (void *) &(buffer[index]), &(fileheader->sweep_taper)); index += 2;
-			mb_get_binary_short(MB_NO, (void *) &(buffer[index]), &(fileheader->correlated)); index += 2;
-			mb_get_binary_short(MB_NO, (void *) &(buffer[index]), &(fileheader->binary_gain)); index += 2;
-			mb_get_binary_short(MB_NO, (void *) &(buffer[index]), &(fileheader->amplitude)); index += 2;
-			mb_get_binary_short(MB_NO, (void *) &(buffer[index]), &(fileheader->units)); index += 2;
-			mb_get_binary_short(MB_NO, (void *) &(buffer[index]), &(fileheader->impulse_polarity)); index += 2;
-			mb_get_binary_short(MB_NO, (void *) &(buffer[index]), &(fileheader->vibrate_polarity)); index += 2;
-			mb_get_binary_short(MB_NO, (void *) &(buffer[index]), &(fileheader->domain)); index += 2;
-			for (i=0;i<238;i++)
-				{
-				fileheader->extra[i] = buffer[index]; index++;
-				}
-			mb_get_binary_short(MB_NO, (void *) &(buffer[index]), &(fileheader->rev)); index += 2;
-			mb_get_binary_short(MB_NO, (void *) &(buffer[index]), &(fileheader->fixed_length)); index += 2;
-			mb_get_binary_short(MB_NO, (void *) &(buffer[index]), &(fileheader->num_ext_headers)); index += 2;
-			for (i=0;i<94;i++)
-				{
-				fileheader->extra[i] = buffer[index]; index++;
-				}
-			}
-
-		/* copy the output structures if pointers provided */
-		if (segyasciiheader != NULL)
-			*segyasciiheader = *asciiheader;
-		if (segyfileheader != NULL)
-			*segyfileheader = *fileheader;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       asciiheader:         %p\n",(void *)asciiheader);
-		fprintf(stderr,"dbg2       fileheader:          %p\n",(void *)fileheader);
-		for (j=0;j<40;j++)
-			{
-			fprintf(stderr,"dbg2       asciiheader[%d]:",j);
-			for (i=0;i<80;i++)
-				fprintf(stderr,"%c",asciiheader->line[j][i]);
-			fprintf(stderr,"\n");
-			}
-		fprintf(stderr,"dbg2       jobid:               %d\n",fileheader->jobid);
-		fprintf(stderr,"dbg2       line:                %d\n",fileheader->line);
-		fprintf(stderr,"dbg2       reel:                %d\n",fileheader->reel);
-		fprintf(stderr,"dbg2       channels:            %d\n",fileheader->channels);
-		fprintf(stderr,"dbg2       aux_channels:        %d\n",fileheader->aux_channels);
-		fprintf(stderr,"dbg2       sample_interval:     %d\n",fileheader->sample_interval);
-		fprintf(stderr,"dbg2       sample_interval_org: %d\n",fileheader->sample_interval_org);
-		fprintf(stderr,"dbg2       number_samples:      %d\n",fileheader->number_samples);
-		fprintf(stderr,"dbg2       number_samples_org:  %d\n",fileheader->number_samples_org);
-		fprintf(stderr,"dbg2       format:              %d\n",fileheader->format);
-		fprintf(stderr,"dbg2       cdp_fold:            %d\n",fileheader->cdp_fold);
-		fprintf(stderr,"dbg2       trace_sort:          %d\n",fileheader->trace_sort);
-		fprintf(stderr,"dbg2       vertical_sum:        %d\n",fileheader->vertical_sum);
-		fprintf(stderr,"dbg2       sweep_start:         %d\n",fileheader->sweep_start);
-		fprintf(stderr,"dbg2       sweep_end:           %d\n",fileheader->sweep_end);
-		fprintf(stderr,"dbg2       sweep_length:        %d\n",fileheader->sweep_length);
-		fprintf(stderr,"dbg2       sweep_type:          %d\n",fileheader->sweep_type);
-		fprintf(stderr,"dbg2       sweep_trace:         %d\n",fileheader->sweep_trace);
-		fprintf(stderr,"dbg2       sweep_taper_start:   %d\n",fileheader->sweep_taper_start);
-		fprintf(stderr,"dbg2       sweep_taper_end:     %d\n",fileheader->sweep_taper_end);
-		fprintf(stderr,"dbg2       sweep_taper:         %d\n",fileheader->sweep_taper);
-		fprintf(stderr,"dbg2       correlated:          %d\n",fileheader->correlated);
-		fprintf(stderr,"dbg2       binary_gain:         %d\n",fileheader->binary_gain);
-		fprintf(stderr,"dbg2       amplitude:           %d\n",fileheader->amplitude);
-		fprintf(stderr,"dbg2       units:               %d\n",fileheader->units);
-		fprintf(stderr,"dbg2       impulse_polarity:    %d\n",fileheader->impulse_polarity);
-		fprintf(stderr,"dbg2       vibrate_polarity:    %d\n",fileheader->vibrate_polarity);
-		fprintf(stderr,"dbg2       domain:              %d\n",fileheader->domain);
-		for (i=0;i<238;i++)
-			fprintf(stderr,"dbg2       extra[%d]:          %d\n",i,fileheader->extra[i]);
-		fprintf(stderr,"dbg2       SEG Y format rev:     %d\n",fileheader->rev);
-		fprintf(stderr,"dbg2       fixed_length flag:    %d\n",fileheader->fixed_length);
-		fprintf(stderr,"dbg2       num extended headers: %d\n",fileheader->num_ext_headers);
-		for (i=238;i<238+94;i++)
-			fprintf(stderr,"dbg2       extra[%d]:          %d\n",i,fileheader->extra[i]);
-		fprintf(stderr,"dbg2       fp:            %p\n",(void *)mb_segyio_ptr->fp);
-		fprintf(stderr,"dbg2       error:         %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:       %d\n",status);
-		}
-
-	/* return success */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-/* 	function mb_segy_write_init opens a new segy file for
-	writing. The file headers are inserted. */
-int mb_segy_write_init(int verbose, char *segyfile,
-		struct mb_segyasciiheader_struct *asciiheader,
-		struct mb_segyfileheader_struct *fileheader,
-		void **mbsegyio_ptr,
-		int *error)
-{
-  	char	*function_name = "mb_segy_write_init";
-	int	status = MB_SUCCESS;
-	struct mb_segyio_struct *mb_segyio_ptr;
-	char	*buffer;
-	int	index;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:             %d\n",verbose);
-		fprintf(stderr,"dbg2       segyfile:            %s\n",segyfile);
-		fprintf(stderr,"dbg2       asciiheader:         %p\n",(void *)asciiheader);
-		fprintf(stderr,"dbg2       fileheader:          %p\n",(void *)fileheader);
-		if (asciiheader != NULL)
-		for (j=0;j<40;j++)
-			{
-			fprintf(stderr,"dbg2       asciiheader[%d]:",j);
-			for (i=0;i<80;j++)
-				fprintf(stderr,"%c",asciiheader->line[j][i]);
-			fprintf(stderr,"\n");
-			}
-		if (fileheader != NULL)
-			{
-			fprintf(stderr,"dbg2       jobid:               %d\n",fileheader->jobid);
-			fprintf(stderr,"dbg2       line:                %d\n",fileheader->line);
-			fprintf(stderr,"dbg2       reel:                %d\n",fileheader->reel);
-			fprintf(stderr,"dbg2       channels:            %d\n",fileheader->channels);
-			fprintf(stderr,"dbg2       aux_channels:        %d\n",fileheader->aux_channels);
-			fprintf(stderr,"dbg2       sample_interval:     %d\n",fileheader->sample_interval);
-			fprintf(stderr,"dbg2       sample_interval_org: %d\n",fileheader->sample_interval_org);
-			fprintf(stderr,"dbg2       number_samples:      %d\n",fileheader->number_samples);
-			fprintf(stderr,"dbg2       number_samples_org:  %d\n",fileheader->number_samples_org);
-			fprintf(stderr,"dbg2       format:              %d\n",fileheader->format);
-			fprintf(stderr,"dbg2       cdp_fold:            %d\n",fileheader->cdp_fold);
-			fprintf(stderr,"dbg2       trace_sort:          %d\n",fileheader->trace_sort);
-			fprintf(stderr,"dbg2       vertical_sum:        %d\n",fileheader->vertical_sum);
-			fprintf(stderr,"dbg2       sweep_start:         %d\n",fileheader->sweep_start);
-			fprintf(stderr,"dbg2       sweep_end:           %d\n",fileheader->sweep_end);
-			fprintf(stderr,"dbg2       sweep_length:        %d\n",fileheader->sweep_length);
-			fprintf(stderr,"dbg2       sweep_type:          %d\n",fileheader->sweep_type);
-			fprintf(stderr,"dbg2       sweep_trace:         %d\n",fileheader->sweep_trace);
-			fprintf(stderr,"dbg2       sweep_taper_start:   %d\n",fileheader->sweep_taper_start);
-			fprintf(stderr,"dbg2       sweep_taper_end:     %d\n",fileheader->sweep_taper_end);
-			fprintf(stderr,"dbg2       sweep_taper:         %d\n",fileheader->sweep_taper);
-			fprintf(stderr,"dbg2       correlated:          %d\n",fileheader->correlated);
-			fprintf(stderr,"dbg2       binary_gain:         %d\n",fileheader->binary_gain);
-			fprintf(stderr,"dbg2       amplitude:           %d\n",fileheader->amplitude);
-			fprintf(stderr,"dbg2       units:               %d\n",fileheader->units);
-			fprintf(stderr,"dbg2       impulse_polarity:    %d\n",fileheader->impulse_polarity);
-			fprintf(stderr,"dbg2       vibrate_polarity:    %d\n",fileheader->vibrate_polarity);
-			fprintf(stderr,"dbg2       domain:              %d\n",fileheader->domain);
-			for (i=0;i<338;i++)
-				fprintf(stderr,"dbg2       extra[%d]::          %d",i,fileheader->extra[i]);
-			}
-		fprintf(stderr,"dbg2       mbsegyio_ptr:        %p\n",(void *)mbsegyio_ptr);
-		}
-
-	/* allocate memory for mbsegyio descriptor */
-	if ((status = mb_mallocd(verbose,__FILE__, __LINE__, sizeof(struct mb_segyio_struct),
-				(void **)mbsegyio_ptr, error)) == MB_SUCCESS)
-		{
-		/* get structure */
-		mb_segyio_ptr = (struct mb_segyio_struct *) *mbsegyio_ptr;
-
-		/* zero the structure */
-		memset(mb_segyio_ptr, 0, sizeof(struct mb_segyio_struct));
-
-		/* allocate buffer memory */
-		status = mb_mallocd(verbose,__FILE__, __LINE__, MB_SEGY_FILEHEADER_LENGTH,
-				(void **)&(mb_segyio_ptr->buffer),error);
-		if (status == MB_SUCCESS)
-			mb_segyio_ptr->bufferalloc = MB_SEGY_FILEHEADER_LENGTH;
-		else
-			mb_segyio_ptr->bufferalloc = 0;
-		}
-
-	/* if ok then open the segy file */
-	if (status == MB_SUCCESS)
-		{
-		/* open the segy file */
-		strcpy(mb_segyio_ptr->segyfile, segyfile);
-		if ((mb_segyio_ptr->fp = fopen(mb_segyio_ptr->segyfile,"w")) == NULL)
-			{
-			*error = MB_ERROR_OPEN_FAIL;
-			status = MB_FAILURE;
-			fprintf(stderr, "\nUnable to open segy file %s\n", mb_segyio_ptr->segyfile);
-			}
-
-		/* set asciiheader and fileheader flags */
-		mb_segyio_ptr->asciiheader_set = MB_NO;
-		mb_segyio_ptr->fileheader_set = MB_NO;
-		}
-
-	/* handle the asciiheader structure */
-	if (status == MB_SUCCESS && asciiheader != NULL)
-		{
-		/* copy the asciiheader structure */
-		mb_segyio_ptr->asciiheader = *asciiheader;
-
-		/* if ok then write ascii header */
-		if (fwrite(asciiheader,1,MB_SEGY_ASCIIHEADER_LENGTH,mb_segyio_ptr->fp)
-					!= MB_SEGY_ASCIIHEADER_LENGTH)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_WRITE_FAIL;
-			}
-		else
-			mb_segyio_ptr->asciiheader_set = MB_YES;
-		}
-
-	/* handle the fileheader structure */
-	if (status == MB_SUCCESS && fileheader != NULL)
-		{
-		/* copy the fileheader structure */
-		mb_segyio_ptr->fileheader = *fileheader;
-
-		/* insert file header */
-		index = 0;
-		buffer = mb_segyio_ptr->buffer;
-		mb_put_binary_int(MB_NO, fileheader->jobid, (void *) &(buffer[index])); index += 4;
-		mb_put_binary_int(MB_NO, fileheader->line, (void *) &(buffer[index])); index += 4;
-		mb_put_binary_int(MB_NO, fileheader->reel, (void *) &(buffer[index])); index += 4;
-		mb_put_binary_short(MB_NO, fileheader->channels, (void *) &(buffer[index])); index += 2;
-		mb_put_binary_short(MB_NO, fileheader->aux_channels, (void *) &(buffer[index])); index += 2;
-		mb_put_binary_short(MB_NO, fileheader->sample_interval, (void *) &(buffer[index])); index += 2;
-		mb_put_binary_short(MB_NO, fileheader->sample_interval_org, (void *) &(buffer[index])); index += 2;
-		mb_put_binary_short(MB_NO, fileheader->number_samples, (void *) &(buffer[index])); index += 2;
-		mb_put_binary_short(MB_NO, fileheader->number_samples_org, (void *) &(buffer[index])); index += 2;
-		mb_put_binary_short(MB_NO, fileheader->format, (void *) &(buffer[index])); index += 2;
-		mb_put_binary_short(MB_NO, fileheader->cdp_fold, (void *) &(buffer[index])); index += 2;
-		mb_put_binary_short(MB_NO, fileheader->trace_sort, (void *) &(buffer[index])); index += 2;
-		mb_put_binary_short(MB_NO, fileheader->vertical_sum, (void *) &(buffer[index])); index += 2;
-		mb_put_binary_short(MB_NO, fileheader->sweep_start, (void *) &(buffer[index])); index += 2;
-		mb_put_binary_short(MB_NO, fileheader->sweep_end, (void *) &(buffer[index])); index += 2;
-		mb_put_binary_short(MB_NO, fileheader->sweep_length, (void *) &(buffer[index])); index += 2;
-		mb_put_binary_short(MB_NO, fileheader->sweep_type, (void *) &(buffer[index])); index += 2;
-		mb_put_binary_short(MB_NO, fileheader->sweep_trace, (void *) &(buffer[index])); index += 2;
-		mb_put_binary_short(MB_NO, fileheader->sweep_taper_start, (void *) &(buffer[index])); index += 2;
-		mb_put_binary_short(MB_NO, fileheader->sweep_taper_end, (void *) &(buffer[index])); index += 2;
-		mb_put_binary_short(MB_NO, fileheader->sweep_taper, (void *) &(buffer[index])); index += 2;
-		mb_put_binary_short(MB_NO, fileheader->correlated, (void *) &(buffer[index])); index += 2;
-		mb_put_binary_short(MB_NO, fileheader->binary_gain, (void *) &(buffer[index])); index += 2;
-		mb_put_binary_short(MB_NO, fileheader->amplitude, (void *) &(buffer[index])); index += 2;
-		mb_put_binary_short(MB_NO, fileheader->units, (void *) &(buffer[index])); index += 2;
-		mb_put_binary_short(MB_NO, fileheader->impulse_polarity, (void *) &(buffer[index])); index += 2;
-		mb_put_binary_short(MB_NO, fileheader->vibrate_polarity, (void *) &(buffer[index])); index += 2;
-		mb_put_binary_short(MB_NO, fileheader->domain, (void *) &(buffer[index])); index += 2;
-		for (i=0;i<338;i++)
-			{
-			buffer[index] = fileheader->extra[i]; index++;
-			}
-
-		/* write file header */
-		if (fwrite(buffer,1,MB_SEGY_FILEHEADER_LENGTH,mb_segyio_ptr->fp)
-					!= MB_SEGY_FILEHEADER_LENGTH)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_WRITE_FAIL;
-			}
-		else
-			mb_segyio_ptr->fileheader_set = MB_YES;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:         %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:       %d\n",status);
-		}
-
-	/* return success */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-/* 	function mb_segy_close closes a segy file that was opened
-	for either reading or writing. */
-int mb_segy_close(int verbose,void **mbsegyio_ptr, int *error)
-{
-  	char	*function_name = "mb_segy_close";
-	int	status = MB_SUCCESS;
-	struct mb_segyio_struct *mb_segyio_ptr;
-
-	/* get pointer to segyio structure */
-	mb_segyio_ptr = (struct mb_segyio_struct *) *mbsegyio_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:     %d\n",verbose);
-		fprintf(stderr,"dbg2       fp:          %p\n",(void *)mb_segyio_ptr->fp);
-		}
-
-	/* deallocate memory */
-	if (mb_segyio_ptr->bufferalloc > 0)
-		mb_freed(verbose,__FILE__, __LINE__,(void **)&(mb_segyio_ptr->buffer), error);
-	if (mb_segyio_ptr->tracealloc > 0)
-		mb_freed(verbose,__FILE__, __LINE__,(void **)&(mb_segyio_ptr->trace), error);
-
-	/* close the segy file */
-	fclose(mb_segyio_ptr->fp);
-	mb_segyio_ptr->fp = NULL;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       fp:            %p\n",(void *)mb_segyio_ptr->fp);
-		fprintf(stderr,"dbg2       error:         %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:       %d\n",status);
-		}
-
-	/* return success */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-/* 	function mb_segy_read_trace reads a trace header and the trace
-	data from an open segy file. The trace data array is passed
-	in as a handle along with the allocated memory so that
-	additional memory can be allocated if necessary */
-int mb_segy_read_trace(int verbose, void *mbsegyio_ptr,
-		struct mb_segytraceheader_struct *traceheaderptr,
-		float **traceptr,
-		int *error)
-{
-  	char	*function_name = "mb_segy_read_trace";
-	int	status = MB_SUCCESS;
-	struct mb_segyio_struct *mb_segyio_ptr;
-	struct mb_segyfileheader_struct *fileheader;
-	struct mb_segytraceheader_struct *traceheader;
-	float	*trace;
-	char	*buffer;
-	int	index;
-	int	bytes_per_sample;
-	int	intval;
-	short	shortval;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:          %d\n",verbose);
-		fprintf(stderr,"dbg2       mbsegyio_ptr:     %p\n",(void *)mbsegyio_ptr);
-		fprintf(stderr,"dbg2       traceheaderptr:   %p\n",(void *)traceheaderptr);
-		fprintf(stderr,"dbg2       traceptr:         %p\n",(void *)traceptr);
-		fprintf(stderr,"dbg2       *traceptr:        %p\n",(void *)*traceptr);
-		}
-
-	/* get segyio pointer */
-	mb_segyio_ptr = (struct mb_segyio_struct *) mbsegyio_ptr;
-	fileheader = (struct mb_segyfileheader_struct *) &(mb_segyio_ptr->fileheader);
-	traceheader = (struct mb_segytraceheader_struct *) &(mb_segyio_ptr->traceheader);
-
-	/* make sure there is adequate memory in the buffer */
-	if (mb_segyio_ptr->bufferalloc < MB_SEGY_TRACEHEADER_LENGTH)
-		{
-		/* allocate buffer memory */
-		status = mb_reallocd(verbose, __FILE__, __LINE__, MB_SEGY_TRACEHEADER_LENGTH,
-				(void **)(void **)&(mb_segyio_ptr->buffer),error);
-		if (status == MB_SUCCESS)
-			mb_segyio_ptr->bufferalloc = MB_SEGY_TRACEHEADER_LENGTH;
-		else
-			mb_segyio_ptr->bufferalloc = 0;
-		}
-
-	/* read trace header */
-	if (status == MB_SUCCESS)
-		{
-		buffer = (char *) mb_segyio_ptr->buffer;
-		if (fread(buffer,1,MB_SEGY_TRACEHEADER_LENGTH,mb_segyio_ptr->fp)
-					!= MB_SEGY_TRACEHEADER_LENGTH)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_EOF;
-			}
-		}
-
-	/* extract trace header data */
-	if (status == MB_SUCCESS)
-		{
-		index = 0;
-		mb_get_binary_int(MB_NO, (void *) &(buffer[index]), &(traceheader->seq_num)); index += 4;
-		mb_get_binary_int(MB_NO, (void *) &(buffer[index]), &(traceheader->seq_reel)); index += 4;
-		mb_get_binary_int(MB_NO, (void *) &(buffer[index]), &(traceheader->shot_num)); index += 4;
-		mb_get_binary_int(MB_NO, (void *) &(buffer[index]), &(traceheader->shot_tr)); index += 4;
-		mb_get_binary_int(MB_NO, (void *) &(buffer[index]), &(traceheader->espn)); index += 4;
-		mb_get_binary_int(MB_NO, (void *) &(buffer[index]), &(traceheader->rp_num)); index += 4;
-		mb_get_binary_int(MB_NO, (void *) &(buffer[index]), &(traceheader->rp_tr)); index += 4;
-		mb_get_binary_short(MB_NO, (void *) &(buffer[index]), &(traceheader->trc_id)); index += 2;
-		mb_get_binary_short(MB_NO, (void *) &(buffer[index]), &(traceheader->num_vstk)); index += 2;
-		mb_get_binary_short(MB_NO, (void *) &(buffer[index]), &(traceheader->cdp_fold)); index += 2;
-		mb_get_binary_short(MB_NO, (void *) &(buffer[index]), &(traceheader->use)); index += 2;
-		mb_get_binary_int(MB_NO, (void *) &(buffer[index]), &(traceheader->range)); index += 4;
-		mb_get_binary_int(MB_NO, (void *) &(buffer[index]), &(traceheader->grp_elev)); index += 4;
-		mb_get_binary_int(MB_NO, (void *) &(buffer[index]), &(traceheader->src_elev)); index += 4;
-		mb_get_binary_int(MB_NO, (void *) &(buffer[index]), &(traceheader->src_depth)); index += 4;
-		mb_get_binary_int(MB_NO, (void *) &(buffer[index]), &(traceheader->grp_datum)); index += 4;
-		mb_get_binary_int(MB_NO, (void *) &(buffer[index]), &(traceheader->src_datum)); index += 4;
-		mb_get_binary_int(MB_NO, (void *) &(buffer[index]), &(traceheader->src_wbd)); index += 4;
-		mb_get_binary_int(MB_NO, (void *) &(buffer[index]), &(traceheader->grp_wbd)); index += 4;
-        	mb_get_binary_short(MB_NO, (void *) &(buffer[index]), &(traceheader->elev_scalar)); index += 2;
-        	mb_get_binary_short(MB_NO, (void *) &(buffer[index]), &(traceheader->coord_scalar)); index += 2;
-		mb_get_binary_int(MB_NO, (void *) &(buffer[index]), &(traceheader->src_long)); index += 4;
-		mb_get_binary_int(MB_NO, (void *) &(buffer[index]), &(traceheader->src_lat)); index += 4;
-		mb_get_binary_int(MB_NO, (void *) &(buffer[index]), &(traceheader->grp_long)); index += 4;
-		mb_get_binary_int(MB_NO, (void *) &(buffer[index]), &(traceheader->grp_lat)); index += 4;
-        	mb_get_binary_short(MB_NO, (void *) &(buffer[index]), &(traceheader->coord_units)); index += 2;
-        	mb_get_binary_short(MB_NO, (void *) &(buffer[index]), &(traceheader->wvel)); index += 2;
-        	mb_get_binary_short(MB_NO, (void *) &(buffer[index]), &(traceheader->sbvel)); index += 2;
-        	mb_get_binary_short(MB_NO, (void *) &(buffer[index]), &(traceheader->src_up_vel)); index += 2;
-        	mb_get_binary_short(MB_NO, (void *) &(buffer[index]), &(traceheader->grp_up_vel)); index += 2;
-        	mb_get_binary_short(MB_NO, (void *) &(buffer[index]), &(traceheader->src_static)); index += 2;
-        	mb_get_binary_short(MB_NO, (void *) &(buffer[index]), &(traceheader->grp_static)); index += 2;
-        	mb_get_binary_short(MB_NO, (void *) &(buffer[index]), &(traceheader->tot_static)); index += 2;
-        	mb_get_binary_short(MB_NO, (void *) &(buffer[index]), &(traceheader->laga)); index += 2;
-		mb_get_binary_int(MB_NO, (void *) &(buffer[index]), &(traceheader->delay_mils)); index += 4;
-        	mb_get_binary_short(MB_NO, (void *) &(buffer[index]), &(traceheader->smute_mils)); index += 2;
-        	mb_get_binary_short(MB_NO, (void *) &(buffer[index]), &(traceheader->emute_mils)); index += 2;
-        	mb_get_binary_short(MB_NO, (void *) &(buffer[index]), &(traceheader->nsamps)); index += 2;
-        	mb_get_binary_short(MB_NO, (void *) &(buffer[index]), &(traceheader->si_micros)); index += 2;
-		for (i=0;i<19;i++)
-			{
-        		mb_get_binary_short(MB_NO, (void *) &(buffer[index]), &(traceheader->other_1[i])); index += 2;
-			}
-        	mb_get_binary_short(MB_NO, (void *) &(buffer[index]), &(traceheader->year)); index += 2;
-        	mb_get_binary_short(MB_NO, (void *) &(buffer[index]), &(traceheader->day_of_yr)); index += 2;
-        	mb_get_binary_short(MB_NO, (void *) &(buffer[index]), &(traceheader->hour)); index += 2;
-        	mb_get_binary_short(MB_NO, (void *) &(buffer[index]), &(traceheader->min)); index += 2;
-        	mb_get_binary_short(MB_NO, (void *) &(buffer[index]), &(traceheader->sec)); index += 2;
-        	mb_get_binary_short(MB_NO, (void *) &(buffer[index]), &(traceheader->mils)); index += 2;
-        	mb_get_binary_short(MB_NO, (void *) &(buffer[index]), &(traceheader->tr_weight)); index += 2;
-		for (i=0;i<5;i++)
-			{
-        		mb_get_binary_short(MB_NO, (void *) &(buffer[index]), &(traceheader->other_2[i])); index += 2;
-			}
-		mb_get_binary_float(MB_NO, (void *) &(buffer[index]), &(traceheader->delay)); index += 4;
-        	mb_get_binary_float(MB_NO, (void *) &(buffer[index]), &(traceheader->smute_sec)); index += 4;
-        	mb_get_binary_float(MB_NO, (void *) &(buffer[index]), &(traceheader->emute_sec)); index += 4;
-        	mb_get_binary_float(MB_NO, (void *) &(buffer[index]), &(traceheader->si_secs)); index += 4;
-        	mb_get_binary_float(MB_NO, (void *) &(buffer[index]), &(traceheader->wbt_secs)); index += 4;
-		mb_get_binary_int(MB_NO, (void *) &(buffer[index]), &(traceheader->end_of_rp)); index += 4;
-        	mb_get_binary_float(MB_NO, (void *) &(buffer[index]), &(traceheader->dummy1)); index += 4;
-        	mb_get_binary_float(MB_NO, (void *) &(buffer[index]), &(traceheader->dummy2)); index += 4;
-        	mb_get_binary_float(MB_NO, (void *) &(buffer[index]), &(traceheader->dummy3)); index += 4;
-        	mb_get_binary_float(MB_NO, (void *) &(buffer[index]), &(traceheader->dummy4)); index += 4;
-        	mb_get_binary_float(MB_NO, (void *) &(buffer[index]), &(traceheader->soundspeed)); index += 4;
-        	mb_get_binary_float(MB_NO, (void *) &(buffer[index]), &(traceheader->distance)); index += 4;
-        	mb_get_binary_float(MB_NO, (void *) &(buffer[index]), &(traceheader->roll)); index += 4;
-        	mb_get_binary_float(MB_NO, (void *) &(buffer[index]), &(traceheader->pitch)); index += 4;
-        	mb_get_binary_float(MB_NO, (void *) &(buffer[index]), &(traceheader->heading)); index += 4;
-		}
-
-	/* make sure there is adequate memory */
-	if (status == MB_SUCCESS)
-		{
-		/* get bytes per sample */
- 		if (fileheader->format == 5 || fileheader->format == 6 || fileheader->format == 11 || fileheader->format == 2)
-       			{
-			bytes_per_sample = 4;
-			}
- 		else if (fileheader->format == 1)
-       			{
-			bytes_per_sample = 4;
-			}
- 		else if (fileheader->format == 3)
-       			{
-			bytes_per_sample = 2;
-			}
- 		else if (fileheader->format == 8)
-       			{
-			bytes_per_sample = 1;
-			}
-		else
-       			{
-			bytes_per_sample = 4;
-			}
-
-		/* check buffer memory */
-		if (mb_segyio_ptr->bufferalloc < bytes_per_sample * traceheader->nsamps)
-			{
-			/* allocate buffer memory */
-			status = mb_reallocd(verbose, __FILE__, __LINE__, bytes_per_sample * traceheader->nsamps,
-					(void **)&(mb_segyio_ptr->buffer),error);
-			if (status == MB_SUCCESS)
-				mb_segyio_ptr->bufferalloc = bytes_per_sample * traceheader->nsamps;
-			else
-				mb_segyio_ptr->bufferalloc = 0;
-			}
-
-		/* check trace memory */
-		if (mb_segyio_ptr->tracealloc < sizeof(float) * traceheader->nsamps)
-			{
-			/* allocate trace memory */
-			status = mb_reallocd(verbose, __FILE__, __LINE__, sizeof(float) * traceheader->nsamps,
-					(void **)&(mb_segyio_ptr->trace),error);
-			if (status == MB_SUCCESS)
-				mb_segyio_ptr->tracealloc = sizeof(float) * traceheader->nsamps;
-			else
-				mb_segyio_ptr->tracealloc = 0;
-			}
-		}
-
-	/* read trace */
-	if (status == MB_SUCCESS)
-		{
-		buffer = mb_segyio_ptr->buffer;
-		if (fread(buffer, 1, bytes_per_sample * traceheader->nsamps, mb_segyio_ptr->fp)
-					!= bytes_per_sample * traceheader->nsamps)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_EOF;
-			}
-		}
-
-	/* extract trace data */
-	if (status == MB_SUCCESS)
-		{
-		trace = (float *) mb_segyio_ptr->trace;
-		index = 0;
-		for (i=0;i<traceheader->nsamps;i++)
-			{
- 			if (fileheader->format == 5 || fileheader->format == 6 || fileheader->format == 1)
-       				{
-				mb_get_binary_float(MB_NO, (void *) &(buffer[index]), &(trace[i]));
-				index += bytes_per_sample;
-				}
- 			else if (fileheader->format == 11)
-       				{
-				mb_get_binary_float(MB_YES, (void *) &(buffer[index]), &(trace[i]));
-				index += bytes_per_sample;
-				}
- 			else if (fileheader->format == 2)
-       				{
-				mb_get_binary_int(MB_NO, (void *) &(buffer[index]), &(intval));
-				trace[i] = (float) intval;
-				index += bytes_per_sample;
-				}
- 			else if (fileheader->format == 3)
-       				{
-				mb_get_binary_short(MB_NO, (void *) &(buffer[index]), &(shortval));
-				trace[i] = (float) shortval;
-				index += bytes_per_sample;
-				}
- 			else if (fileheader->format == 8)
-       				{
-				trace[i] = (float) buffer[i];
-				index++;
-				}
-			}
-		}
-
-	/* set return pointers */
-	if (status == MB_SUCCESS)
-		{
-		*traceheaderptr = *traceheader;
-		*traceptr = trace;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       seq_num:       %d\n",traceheader->seq_num);
-		fprintf(stderr,"dbg2       seq_reel:      %d\n",traceheader->seq_reel);
-		fprintf(stderr,"dbg2       shot_num:      %d\n",traceheader->shot_num);
-		fprintf(stderr,"dbg2       shot_tr:       %d\n",traceheader->shot_tr);
-		fprintf(stderr,"dbg2       espn:          %d\n",traceheader->espn);
-		fprintf(stderr,"dbg2       rp_num:        %d\n",traceheader->rp_num);
-		fprintf(stderr,"dbg2       rp_tr:         %d\n",traceheader->rp_tr);
-		fprintf(stderr,"dbg2       trc_id:        %d\n",traceheader->trc_id);
-		fprintf(stderr,"dbg2       num_vstk:      %d\n",traceheader->num_vstk);
-		fprintf(stderr,"dbg2       cdp_fold:      %d\n",traceheader->cdp_fold);
-		fprintf(stderr,"dbg2       use:           %d\n",traceheader->use);
-		fprintf(stderr,"dbg2       range:         %d\n",traceheader->range);
-		fprintf(stderr,"dbg2       grp_elev:      %d\n",traceheader->grp_elev);
-		fprintf(stderr,"dbg2       src_elev:      %d\n",traceheader->src_elev);
-		fprintf(stderr,"dbg2       src_depth:     %d\n",traceheader->src_depth);
-		fprintf(stderr,"dbg2       grp_datum:     %d\n",traceheader->grp_datum);
-		fprintf(stderr,"dbg2       src_datum:     %d\n",traceheader->src_datum);
-		fprintf(stderr,"dbg2       src_wbd:       %d\n",traceheader->src_wbd);
-		fprintf(stderr,"dbg2       grp_wbd:       %d\n",traceheader->grp_wbd);
-		fprintf(stderr,"dbg2       elev_scalar:   %d\n",traceheader->elev_scalar);
-		fprintf(stderr,"dbg2       coord_scalar:  %d\n",traceheader->coord_scalar);
-		fprintf(stderr,"dbg2       src_long:      %d\n",traceheader->src_long);
-		fprintf(stderr,"dbg2       src_lat:       %d\n",traceheader->src_lat);
-		fprintf(stderr,"dbg2       grp_long:      %d\n",traceheader->grp_long);
-		fprintf(stderr,"dbg2       grp_lat:       %d\n",traceheader->grp_lat);
-		fprintf(stderr,"dbg2       coord_units:   %d\n",traceheader->coord_units);
-		fprintf(stderr,"dbg2       wvel:          %d\n",traceheader->wvel);
-		fprintf(stderr,"dbg2       sbvel:         %d\n",traceheader->sbvel);
-		fprintf(stderr,"dbg2       src_up_vel:    %d\n",traceheader->src_up_vel);
-		fprintf(stderr,"dbg2       grp_up_vel:    %d\n",traceheader->grp_up_vel);
-		fprintf(stderr,"dbg2       src_static:    %d\n",traceheader->src_static);
-		fprintf(stderr,"dbg2       grp_static:    %d\n",traceheader->grp_static);
-		fprintf(stderr,"dbg2       tot_static:    %d\n",traceheader->tot_static);
-		fprintf(stderr,"dbg2       laga:          %d\n",traceheader->laga);
-		fprintf(stderr,"dbg2       delay_mils:    %d\n",traceheader->delay_mils);
-		fprintf(stderr,"dbg2       smute_mils:    %d\n",traceheader->smute_mils);
-		fprintf(stderr,"dbg2       emute_mils:    %d\n",traceheader->emute_mils);
-		fprintf(stderr,"dbg2       nsamps:        %d\n",traceheader->nsamps);
-		fprintf(stderr,"dbg2       si_micros:     %d\n",traceheader->si_micros);
-		for (i=0;i<19;i++)
-			{
-			fprintf(stderr,"dbg2       other_1[%d]:   %d\n",i,traceheader->other_1[i]);
-			}
-		fprintf(stderr,"dbg2       year:          %d\n",traceheader->year);
-		fprintf(stderr,"dbg2       day_of_yr:     %d\n",traceheader->day_of_yr);
-		fprintf(stderr,"dbg2       hour:          %d\n",traceheader->hour);
-		fprintf(stderr,"dbg2       min:           %d\n",traceheader->min);
-		fprintf(stderr,"dbg2       sec:           %d\n",traceheader->sec);
-		fprintf(stderr,"dbg2       mils:          %d\n",traceheader->mils);
-		fprintf(stderr,"dbg2       tr_weight:     %d\n",traceheader->tr_weight);
-		for (i=0;i<5;i++)
-			{
-			fprintf(stderr,"dbg2       other_2[%d]:    %d\n",i,traceheader->other_2[i]);
-			}
-		fprintf(stderr,"dbg2       delay:         %f\n",traceheader->delay);
-		fprintf(stderr,"dbg2       smute_sec:     %f\n",traceheader->smute_sec);
-		fprintf(stderr,"dbg2       emute_sec:     %f\n",traceheader->emute_sec);
-		fprintf(stderr,"dbg2       si_secs:       %f\n",traceheader->si_secs);
-		fprintf(stderr,"dbg2       wbt_secs:      %f\n",traceheader->wbt_secs);
-		fprintf(stderr,"dbg2       end_of_rp:     %d\n",traceheader->end_of_rp);
-		fprintf(stderr,"dbg2       dummy1:        %f\n",traceheader->dummy1);
-		fprintf(stderr,"dbg2       dummy2:        %f\n",traceheader->dummy2);
-		fprintf(stderr,"dbg2       dummy3:        %f\n",traceheader->dummy3);
-		fprintf(stderr,"dbg2       dummy4:        %f\n",traceheader->dummy4);
-		fprintf(stderr,"dbg2       soundspeed:    %f\n",traceheader->soundspeed);
-		fprintf(stderr,"dbg2       distance:      %f\n",traceheader->distance);
-		fprintf(stderr,"dbg2       roll:          %f\n",traceheader->roll);
-		fprintf(stderr,"dbg2       pitch:         %f\n",traceheader->pitch);
-		fprintf(stderr,"dbg2       heading:       %f\n",traceheader->heading);
-		for (i=0;i<traceheader->nsamps;i++)
-			fprintf(stderr,"dbg2       trace[%d]:%f\n",i,trace[i]);
-		fprintf(stderr,"dbg2       error:         %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:       %d\n",status);
-		}
-
-	/* return success */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-/* 	function mb_segy_write_trace writes a trace header and the trace
-	data to an open segy file. The trace data array is passed
-	in as a pointer */
-int mb_segy_write_trace(int verbose, void *mbsegyio_ptr,
-		struct mb_segytraceheader_struct *traceheader,
-		float *trace,
-		int *error)
-{
-  	char	*function_name = "mb_segy_write_trace";
-	int	status = MB_SUCCESS;
-	struct mb_segyio_struct *mb_segyio_ptr;
-	struct mb_segyasciiheader_struct *asciiheader;
-	struct mb_segyfileheader_struct *fileheader;
-	char	*buffer;
-	int	index;
-	int	bytes_per_sample;
-	int	intval;
-	short	shortval;
-	int	i;
-
-	/* get segyio pointer */
-	mb_segyio_ptr = (struct mb_segyio_struct *) mbsegyio_ptr;
-	asciiheader = &(mb_segyio_ptr->asciiheader);
-	fileheader = &(mb_segyio_ptr->fileheader);
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:       %d\n",verbose);
-		fprintf(stderr,"dbg2       mbsegyio_ptr:  %p\n",(void *)mbsegyio_ptr);
-		fprintf(stderr,"dbg2       traceheader:   %p\n",(void *)traceheader);
-		fprintf(stderr,"dbg2       seq_num:       %d\n",traceheader->seq_num);
-		fprintf(stderr,"dbg2       seq_reel:      %d\n",traceheader->seq_reel);
-		fprintf(stderr,"dbg2       shot_num:      %d\n",traceheader->shot_num);
-		fprintf(stderr,"dbg2       shot_tr:       %d\n",traceheader->shot_tr);
-		fprintf(stderr,"dbg2       espn:          %d\n",traceheader->espn);
-		fprintf(stderr,"dbg2       rp_num:        %d\n",traceheader->rp_num);
-		fprintf(stderr,"dbg2       rp_tr:         %d\n",traceheader->rp_tr);
-		fprintf(stderr,"dbg2       trc_id:        %d\n",traceheader->trc_id);
-		fprintf(stderr,"dbg2       num_vstk:      %d\n",traceheader->num_vstk);
-		fprintf(stderr,"dbg2       cdp_fold:      %d\n",traceheader->cdp_fold);
-		fprintf(stderr,"dbg2       use:           %d\n",traceheader->use);
-		fprintf(stderr,"dbg2       range:         %d\n",traceheader->range);
-		fprintf(stderr,"dbg2       grp_elev:      %d\n",traceheader->grp_elev);
-		fprintf(stderr,"dbg2       src_elev:      %d\n",traceheader->src_elev);
-		fprintf(stderr,"dbg2       src_depth:     %d\n",traceheader->src_depth);
-		fprintf(stderr,"dbg2       grp_datum:     %d\n",traceheader->grp_datum);
-		fprintf(stderr,"dbg2       src_datum:     %d\n",traceheader->src_datum);
-		fprintf(stderr,"dbg2       src_wbd:       %d\n",traceheader->src_wbd);
-		fprintf(stderr,"dbg2       grp_wbd:       %d\n",traceheader->grp_wbd);
-		fprintf(stderr,"dbg2       elev_scalar:   %d\n",traceheader->elev_scalar);
-		fprintf(stderr,"dbg2       coord_scalar:  %d\n",traceheader->coord_scalar);
-		fprintf(stderr,"dbg2       src_long:      %d\n",traceheader->src_long);
-		fprintf(stderr,"dbg2       src_lat:       %d\n",traceheader->src_lat);
-		fprintf(stderr,"dbg2       grp_long:      %d\n",traceheader->grp_long);
-		fprintf(stderr,"dbg2       grp_lat:       %d\n",traceheader->grp_lat);
-		fprintf(stderr,"dbg2       coord_units:   %d\n",traceheader->coord_units);
-		fprintf(stderr,"dbg2       wvel:          %d\n",traceheader->wvel);
-		fprintf(stderr,"dbg2       sbvel:         %d\n",traceheader->sbvel);
-		fprintf(stderr,"dbg2       src_up_vel:    %d\n",traceheader->src_up_vel);
-		fprintf(stderr,"dbg2       grp_up_vel:    %d\n",traceheader->grp_up_vel);
-		fprintf(stderr,"dbg2       src_static:    %d\n",traceheader->src_static);
-		fprintf(stderr,"dbg2       grp_static:    %d\n",traceheader->grp_static);
-		fprintf(stderr,"dbg2       tot_static:    %d\n",traceheader->tot_static);
-		fprintf(stderr,"dbg2       laga:          %d\n",traceheader->laga);
-		fprintf(stderr,"dbg2       delay_mils:    %d\n",traceheader->delay_mils);
-		fprintf(stderr,"dbg2       smute_mils:    %d\n",traceheader->smute_mils);
-		fprintf(stderr,"dbg2       emute_mils:    %d\n",traceheader->emute_mils);
-		fprintf(stderr,"dbg2       nsamps:        %d\n",traceheader->nsamps);
-		fprintf(stderr,"dbg2       si_micros:     %d\n",traceheader->si_micros);
-		for (i=0;i<19;i++)
-			{
-			fprintf(stderr,"dbg2       other_1[%d]:   %d\n",i,traceheader->other_1[i]);
-			}
-		fprintf(stderr,"dbg2       year:          %d\n",traceheader->year);
-		fprintf(stderr,"dbg2       day_of_yr:     %d\n",traceheader->day_of_yr);
-		fprintf(stderr,"dbg2       hour:          %d\n",traceheader->hour);
-		fprintf(stderr,"dbg2       min:           %d\n",traceheader->min);
-		fprintf(stderr,"dbg2       sec:           %d\n",traceheader->sec);
-		fprintf(stderr,"dbg2       mils:          %d\n",traceheader->mils);
-		fprintf(stderr,"dbg2       tr_weight:     %d\n",traceheader->tr_weight);
-		for (i=0;i<5;i++)
-			{
-			fprintf(stderr,"dbg2       other_2[%d]:   %d\n",i,traceheader->other_2[i]);
-			}
-		fprintf(stderr,"dbg2       delay:         %f\n",traceheader->delay);
-		fprintf(stderr,"dbg2       smute_sec:     %f\n",traceheader->smute_sec);
-		fprintf(stderr,"dbg2       emute_sec:     %f\n",traceheader->emute_sec);
-		fprintf(stderr,"dbg2       si_secs:       %f\n",traceheader->si_secs);
-		fprintf(stderr,"dbg2       wbt_secs:      %f\n",traceheader->wbt_secs);
-		fprintf(stderr,"dbg2       end_of_rp:     %d\n",traceheader->end_of_rp);
-		fprintf(stderr,"dbg2       dummy1:        %f\n",traceheader->dummy1);
-		fprintf(stderr,"dbg2       dummy2:        %f\n",traceheader->dummy2);
-		fprintf(stderr,"dbg2       dummy3:        %f\n",traceheader->dummy3);
-		fprintf(stderr,"dbg2       dummy4:        %f\n",traceheader->dummy4);
-		fprintf(stderr,"dbg2       soundspeed:    %f\n",traceheader->soundspeed);
-		fprintf(stderr,"dbg2       distance:      %f\n",traceheader->distance);
-		fprintf(stderr,"dbg2       roll:          %f\n",traceheader->roll);
-		fprintf(stderr,"dbg2       pitch:         %f\n",traceheader->pitch);
-		fprintf(stderr,"dbg2       heading:       %f\n",traceheader->heading);
-		for (i=0;i<traceheader->nsamps;i++)
-			fprintf(stderr,"dbg2       trace[%d]:%f\n",i,trace[i]);
-		}
-
-	/* if asciiheader has not yet been written, write it */
-	if (mb_segyio_ptr->asciiheader_set == MB_NO)
-		{
-		if (fwrite(asciiheader,1,MB_SEGY_ASCIIHEADER_LENGTH,mb_segyio_ptr->fp)
-					!= MB_SEGY_ASCIIHEADER_LENGTH)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_WRITE_FAIL;
-			}
-		else
-			mb_segyio_ptr->asciiheader_set = MB_YES;
-		}
-
-	/* if fileheader has not yet been written, write it */
-	if (mb_segyio_ptr->fileheader_set == MB_NO)
-		{
-		/* make sure there is adequate memory in the buffer */
-		if (mb_segyio_ptr->bufferalloc < MB_SEGY_FILEHEADER_LENGTH)
-			{
-			/* allocate buffer memory */
-			status = mb_reallocd(verbose, __FILE__, __LINE__, MB_SEGY_FILEHEADER_LENGTH,
-					(void **)&(mb_segyio_ptr->buffer),error);
-			if (status == MB_SUCCESS)
-				mb_segyio_ptr->bufferalloc = MB_SEGY_FILEHEADER_LENGTH;
-			else
-				mb_segyio_ptr->bufferalloc = 0;
-			}
-
-		index = 0;
-		buffer = mb_segyio_ptr->buffer;
-		mb_put_binary_int(MB_NO, fileheader->jobid, (void *) &(buffer[index])); index += 4;
-		mb_put_binary_int(MB_NO, fileheader->line, (void *) &(buffer[index])); index += 4;
-		mb_put_binary_int(MB_NO, fileheader->reel, (void *) &(buffer[index])); index += 4;
-		mb_put_binary_short(MB_NO, fileheader->channels, (void *) &(buffer[index])); index += 2;
-		mb_put_binary_short(MB_NO, fileheader->aux_channels, (void *) &(buffer[index])); index += 2;
-		mb_put_binary_short(MB_NO, fileheader->sample_interval, (void *) &(buffer[index])); index += 2;
-		mb_put_binary_short(MB_NO, fileheader->sample_interval_org, (void *) &(buffer[index])); index += 2;
-		mb_put_binary_short(MB_NO, fileheader->number_samples, (void *) &(buffer[index])); index += 2;
-		mb_put_binary_short(MB_NO, fileheader->number_samples_org, (void *) &(buffer[index])); index += 2;
-		mb_put_binary_short(MB_NO, fileheader->format, (void *) &(buffer[index])); index += 2;
-		mb_put_binary_short(MB_NO, fileheader->cdp_fold, (void *) &(buffer[index])); index += 2;
-		mb_put_binary_short(MB_NO, fileheader->trace_sort, (void *) &(buffer[index])); index += 2;
-		mb_put_binary_short(MB_NO, fileheader->vertical_sum, (void *) &(buffer[index])); index += 2;
-		mb_put_binary_short(MB_NO, fileheader->sweep_start, (void *) &(buffer[index])); index += 2;
-		mb_put_binary_short(MB_NO, fileheader->sweep_end, (void *) &(buffer[index])); index += 2;
-		mb_put_binary_short(MB_NO, fileheader->sweep_length, (void *) &(buffer[index])); index += 2;
-		mb_put_binary_short(MB_NO, fileheader->sweep_type, (void *) &(buffer[index])); index += 2;
-		mb_put_binary_short(MB_NO, fileheader->sweep_trace, (void *) &(buffer[index])); index += 2;
-		mb_put_binary_short(MB_NO, fileheader->sweep_taper_start, (void *) &(buffer[index])); index += 2;
-		mb_put_binary_short(MB_NO, fileheader->sweep_taper_end, (void *) &(buffer[index])); index += 2;
-		mb_put_binary_short(MB_NO, fileheader->sweep_taper, (void *) &(buffer[index])); index += 2;
-		mb_put_binary_short(MB_NO, fileheader->correlated, (void *) &(buffer[index])); index += 2;
-		mb_put_binary_short(MB_NO, fileheader->binary_gain, (void *) &(buffer[index])); index += 2;
-		mb_put_binary_short(MB_NO, fileheader->amplitude, (void *) &(buffer[index])); index += 2;
-		mb_put_binary_short(MB_NO, fileheader->units, (void *) &(buffer[index])); index += 2;
-		mb_put_binary_short(MB_NO, fileheader->impulse_polarity, (void *) &(buffer[index])); index += 2;
-		mb_put_binary_short(MB_NO, fileheader->vibrate_polarity, (void *) &(buffer[index])); index += 2;
-		mb_put_binary_short(MB_NO, fileheader->domain, (void *) &(buffer[index])); index += 2;
-		for (i=0;i<338;i++)
-			{
-			buffer[index] = fileheader->extra[i]; index++;
-			}
-		if (fwrite(buffer,1,MB_SEGY_FILEHEADER_LENGTH,mb_segyio_ptr->fp)
-					!= MB_SEGY_FILEHEADER_LENGTH)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_WRITE_FAIL;
-			}
-		else
-			mb_segyio_ptr->fileheader_set = MB_YES;
-		}
-
-	/* make sure there is adequate memory in the buffer */
-	if (mb_segyio_ptr->bufferalloc < MB_SEGY_TRACEHEADER_LENGTH)
-		{
-		/* allocate buffer memory */
-		status = mb_reallocd(verbose, __FILE__, __LINE__, MB_SEGY_TRACEHEADER_LENGTH,
-				(void **)&(mb_segyio_ptr->buffer),error);
-		if (status == MB_SUCCESS)
-			mb_segyio_ptr->bufferalloc = MB_SEGY_TRACEHEADER_LENGTH;
-		else
-			mb_segyio_ptr->bufferalloc = 0;
-		}
-
-	/* make sure there is adequate memory */
-	if (status == MB_SUCCESS)
-		{
-		/* get bytes per sample */
- 		if (fileheader->format == 5 || fileheader->format == 6 || fileheader->format == 11 || fileheader->format == 2)
-       			{
-			bytes_per_sample = 4;
-			}
- 		else if (fileheader->format == 3)
-       			{
-			bytes_per_sample = 2;
-			}
- 		else if (fileheader->format == 8)
-       			{
-			bytes_per_sample = 1;
-			}
-		else
-       			{
-			bytes_per_sample = 4;
-			}
-
-		/* check buffer memory */
-		if (mb_segyio_ptr->bufferalloc < bytes_per_sample * traceheader->nsamps)
-			{
-			/* allocate buffer memory */
-			status = mb_reallocd(verbose, __FILE__, __LINE__, bytes_per_sample * traceheader->nsamps,
-					(void **)&(mb_segyio_ptr->buffer),error);
-			if (status == MB_SUCCESS)
-				mb_segyio_ptr->bufferalloc = bytes_per_sample * traceheader->nsamps;
-			else
-				mb_segyio_ptr->bufferalloc = 0;
-			}
-		}
-
-	/* insert trace header data */
-	if (status == MB_SUCCESS)
-		{
-		index = 0;
-		buffer = mb_segyio_ptr->buffer;
-		mb_put_binary_int(MB_NO, traceheader->seq_num, (void *) &buffer[index]); index += 4;
-		mb_put_binary_int(MB_NO, traceheader->seq_reel, (void *) &buffer[index]); index += 4;
-		mb_put_binary_int(MB_NO, traceheader->shot_num, (void *) &buffer[index]); index += 4;
-		mb_put_binary_int(MB_NO, traceheader->shot_tr, (void *) &buffer[index]); index += 4;
-		mb_put_binary_int(MB_NO, traceheader->espn, (void *) &buffer[index]); index += 4;
-		mb_put_binary_int(MB_NO, traceheader->rp_num, (void *) &buffer[index]); index += 4;
-		mb_put_binary_int(MB_NO, traceheader->rp_tr, (void *) &buffer[index]); index += 4;
-		mb_put_binary_short(MB_NO, traceheader->trc_id, (void *) &buffer[index]); index += 2;
-		mb_put_binary_short(MB_NO, traceheader->num_vstk, (void *) &buffer[index]); index += 2;
-		mb_put_binary_short(MB_NO, traceheader->cdp_fold, (void *) &buffer[index]); index += 2;
-		mb_put_binary_short(MB_NO, traceheader->use, (void *) &buffer[index]); index += 2;
-		mb_put_binary_int(MB_NO, traceheader->range, (void *) &buffer[index]); index += 4;
-		mb_put_binary_int(MB_NO, traceheader->grp_elev, (void *) &buffer[index]); index += 4;
-		mb_put_binary_int(MB_NO, traceheader->src_elev, (void *) &buffer[index]); index += 4;
-		mb_put_binary_int(MB_NO, traceheader->src_depth, (void *) &buffer[index]); index += 4;
-		mb_put_binary_int(MB_NO, traceheader->grp_datum, (void *) &buffer[index]); index += 4;
-		mb_put_binary_int(MB_NO, traceheader->src_datum, (void *) &buffer[index]); index += 4;
-		mb_put_binary_int(MB_NO, traceheader->src_wbd, (void *) &buffer[index]); index += 4;
-		mb_put_binary_int(MB_NO, traceheader->grp_wbd, (void *) &buffer[index]); index += 4;
-        	mb_put_binary_short(MB_NO, traceheader->elev_scalar, (void *) &buffer[index]); index += 2;
-        	mb_put_binary_short(MB_NO, traceheader->coord_scalar, (void *) &buffer[index]); index += 2;
-		mb_put_binary_int(MB_NO, traceheader->src_long, (void *) &buffer[index]); index += 4;
-		mb_put_binary_int(MB_NO, traceheader->src_lat, (void *) &buffer[index]); index += 4;
-		mb_put_binary_int(MB_NO, traceheader->grp_long, (void *) &buffer[index]); index += 4;
-		mb_put_binary_int(MB_NO, traceheader->grp_lat, (void *) &buffer[index]); index += 4;
-        	mb_put_binary_short(MB_NO, traceheader->coord_units, (void *) &buffer[index]); index += 2;
-        	mb_put_binary_short(MB_NO, traceheader->wvel, (void *) &buffer[index]); index += 2;
-        	mb_put_binary_short(MB_NO, traceheader->sbvel, (void *) &buffer[index]); index += 2;
-        	mb_put_binary_short(MB_NO, traceheader->src_up_vel, (void *) &buffer[index]); index += 2;
-        	mb_put_binary_short(MB_NO, traceheader->grp_up_vel, (void *) &buffer[index]); index += 2;
-        	mb_put_binary_short(MB_NO, traceheader->src_static, (void *) &buffer[index]); index += 2;
-        	mb_put_binary_short(MB_NO, traceheader->grp_static, (void *) &buffer[index]); index += 2;
-        	mb_put_binary_short(MB_NO, traceheader->tot_static, (void *) &buffer[index]); index += 2;
-        	mb_put_binary_short(MB_NO, traceheader->laga, (void *) &buffer[index]); index += 2;
-		mb_put_binary_int(MB_NO, traceheader->delay_mils, (void *) &buffer[index]); index += 4;
-        	mb_put_binary_short(MB_NO, traceheader->smute_mils, (void *) &buffer[index]); index += 2;
-        	mb_put_binary_short(MB_NO, traceheader->emute_mils, (void *) &buffer[index]); index += 2;
-        	mb_put_binary_short(MB_NO, traceheader->nsamps, (void *) &buffer[index]); index += 2;
-        	mb_put_binary_short(MB_NO, traceheader->si_micros, (void *) &buffer[index]); index += 2;
-		for (i=0;i<19;i++)
-			{
-        		mb_put_binary_short(MB_NO, traceheader->other_1[i], (void *) &buffer[index]); index += 2;
-			}
-        	mb_put_binary_short(MB_NO, traceheader->year, (void *) &buffer[index]); index += 2;
-        	mb_put_binary_short(MB_NO, traceheader->day_of_yr, (void *) &buffer[index]); index += 2;
-        	mb_put_binary_short(MB_NO, traceheader->hour, (void *) &buffer[index]); index += 2;
-        	mb_put_binary_short(MB_NO, traceheader->min, (void *) &buffer[index]); index += 2;
-        	mb_put_binary_short(MB_NO, traceheader->sec, (void *) &buffer[index]); index += 2;
-        	mb_put_binary_short(MB_NO, traceheader->mils, (void *) &buffer[index]); index += 2;
-        	mb_put_binary_short(MB_NO, traceheader->tr_weight, (void *) &buffer[index]); index += 2;
-		for (i=0;i<5;i++)
-			{
-        		mb_put_binary_short(MB_NO, traceheader->other_2[i], (void *) &buffer[index]); index += 2;
-			}
-		mb_put_binary_float(MB_NO, traceheader->delay, (void *) &buffer[index]); index += 4;
-        	mb_put_binary_float(MB_NO, traceheader->smute_sec, (void *) &buffer[index]); index += 4;
-        	mb_put_binary_float(MB_NO, traceheader->emute_sec, (void *) &buffer[index]); index += 4;
-        	mb_put_binary_float(MB_NO, traceheader->si_secs, (void *) &buffer[index]); index += 4;
-        	mb_put_binary_float(MB_NO, traceheader->wbt_secs, (void *) &buffer[index]); index += 4;
-		mb_put_binary_int(MB_NO, traceheader->end_of_rp, (void *) &buffer[index]); index += 4;
-        	mb_put_binary_float(MB_NO, traceheader->dummy1, (void *) &buffer[index]); index += 4;
-        	mb_put_binary_float(MB_NO, traceheader->dummy2, (void *) &buffer[index]); index += 4;
-        	mb_put_binary_float(MB_NO, traceheader->dummy3, (void *) &buffer[index]); index += 4;
-        	mb_put_binary_float(MB_NO, traceheader->dummy4, (void *) &buffer[index]); index += 4;
-        	mb_put_binary_float(MB_NO, traceheader->soundspeed, (void *) &buffer[index]); index += 4;
-        	mb_put_binary_float(MB_NO, traceheader->distance, (void *) &buffer[index]); index += 4;
-        	mb_put_binary_float(MB_NO, traceheader->roll, (void *) &buffer[index]); index += 4;
-        	mb_put_binary_float(MB_NO, traceheader->pitch, (void *) &buffer[index]); index += 4;
-        	mb_put_binary_float(MB_NO, traceheader->heading, (void *) &buffer[index]); index += 4;
-
-		/* write trace header */
-		if (fwrite(buffer,1,MB_SEGY_TRACEHEADER_LENGTH,mb_segyio_ptr->fp)
-					!= MB_SEGY_TRACEHEADER_LENGTH)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_EOF;
-			}
-		}
-
-	/* insert trace data */
-	if (status == MB_SUCCESS)
-		{
-		index = 0;
-		buffer = mb_segyio_ptr->buffer;
-		for (i=0;i<traceheader->nsamps;i++)
-			{
- 			if (fileheader->format == 5 || fileheader->format == 6)
-       				{
-        			mb_put_binary_float(MB_NO, trace[i], (void *) &buffer[index]);
-				index += bytes_per_sample;
-				}
- 			else if (fileheader->format == 11)
-       				{
-        			mb_put_binary_float(MB_YES, trace[i], (void *) &buffer[index]);
-				index += bytes_per_sample;
-				}
- 			else if (fileheader->format == 2)
-       				{
-				intval = (int) trace[i];
-				mb_put_binary_int(MB_NO, intval, (void *) &buffer[index]);
-				index += bytes_per_sample;
-				}
- 			else if (fileheader->format == 3)
-       				{
-				shortval = (short) trace[i];
-				mb_put_binary_short(MB_NO, shortval, (void *) &buffer[index]);
-				index += bytes_per_sample;
-				}
- 			else if (fileheader->format == 8)
-       				{
-				buffer[i] = (char) trace[i];
-				index++;
-				}
-			}
-		}
-
-	/* write trace */
-	if (status == MB_SUCCESS
-		&& fwrite(buffer, 1, bytes_per_sample + traceheader->nsamps, mb_segyio_ptr->fp)
-				!= bytes_per_sample + traceheader->nsamps)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:         %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:       %d\n",status);
-		}
-
-	/* return success */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-/* Code for numerical Hilbert Transform taken from web pages of
-	Per Stoltze:
-		http://www.aue.auc.dk/~stoltze/tools/hilbert/hilbert.htm
-	on 18 August 2004
-   Usage: The input data are in delta and the call
-		hilbert(n, delta, kappa)
-	will return the Hilbert transform of delta in
-	kappa. The values of n and delta are not modified.*/
-void hilbert(int n, double delta[], double kappa[])
-{
-	double d1, d2, d3, d4;
-	int i1, i2;
-
-	for (i1 = 0; i1 < n; i1++)
-	{
-		kappa[i1] = 0.;
-		for (i2 = 1; i2 < n; i2++)
-		{
-			d1 = (i1+i2<n)? delta[i1+i2]: 0.;
-			d2 = (i1-i2>=0)? delta[i1-i2]: 0.;
-			d3 = (i1+i2+1<n)? delta[i1+i2+1]: 0.;
-			d4 = (i1-i2-1>=0)? delta[i1-i2-1]: 0.;
-
-			kappa[i1] -= 0.5 * (d1-d2) / i2 + 0.5 * (d3 - d4) / (i2 + 1);
-		}
-		kappa[i1] /= M_PI;
-	}
-}
-
-/*--------------------------------------------------------------------*/
-/* Code for numerical Hilbert Transform modified from web pages of
-	Per Stoltze:
-		http://www.aue.auc.dk/~stoltze/tools/hilbert/hilbert.htm
-	on 18 August 2004
-   Usage: The input data are in even elements of data
-   		(data[0], data[2], ...data[n-2])
-	and the call
-		hilbert2(n, data)
-	will return the Hilbert transform of delta in
-	the odd elements of data:
-   		(data[1], data[3], ...data[n-1])
-	The values of n and even elements of data are not modified.*/
-void hilbert2(int n, double data[])
-{
-	double d1, d2, d3, d4;
-	int i1, i2;
-
-	for (i1 = 0; i1 < n; i1++)
-	{
-		data[2*i1+1] = 0.;
-		for (i2 = 1; i2 < n; i2++)
-		{
-			d1 = (i1+i2<n)? data[2*(i1+i2)]: 0.;
-			d2 = (i1-i2>=0)? data[2*(i1-i2)]: 0.;
-			d3 = (i1+i2+1<n)? data[2*(i1+i2+1)]: 0.;
-			d4 = (i1-i2-1>=0)? data[2*(i1-i2-1)]: 0.;
-
-			data[2*i1+1] -= 0.5 * (d1-d2) / i2 + 0.5 * (d3 - d4) / (i2 + 1);
-		}
-		data[2*i1+1] /= M_PI;
-	}
-}
-
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mb_segy.h b/src/mbio/mb_segy.h
deleted file mode 100644
index 5b1406a..0000000
--- a/src/mbio/mb_segy.h
+++ /dev/null
@@ -1,233 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mb_io.h	1/19/93
- *    $Id: mb_segy.h 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 2004-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mb_segy.h defines the SEG-Y trace header used by MB-System when
- * extracting seismic reflection or subbottom profiler data from
- * swath mapping data files. The SIOSEIS implementation of the
- * trace header is used because it incorporates a deep water delay
- * value not found in most other implementations.See the SIOSEIS
- * web pages for information:.
- *	http://sioseis.ucsd.edu/
- *	http://sioseis.ucsd.edu/segy.header.html
- *
- * Author:	D. W. Caress
- * Date:	April 13, 2004
- *
- * $Log: mb_segy.h,v $
- * Revision 5.7  2008/09/13 06:08:09  caress
- * Updates to apply suggested patches to segy handling. Also fixes to remove compiler warnings.
- *
- * Revision 5.6  2006/11/10 22:36:04  caress
- * Working towards release 5.1.0
- *
- * Revision 5.5  2005/05/05 23:53:01  caress
- * Just added a space in a line of code...
- *
- * Revision 5.4  2004/09/16 19:02:33  caress
- * Changes to better support segy data.
- *
- * Revision 5.3  2004/07/27 19:44:38  caress
- * Working on handling subbottom data.
- *
- * Revision 5.2  2004/06/18 05:22:32  caress
- * Working on adding support for segy i/o and for Reson 7k format 88.
- *
- * Revision 5.1  2004/05/21 23:44:49  caress
- * Progress supporting Reson 7k data, including support for extracing subbottom profiler data.
- *
- * Revision 5.0  2004/04/27 01:50:15  caress
- * Adding support for Reson 7k sonar data, including segy extensions.
- *
- *
- */
-
-/* Standard SEGY format sizes */
-#define   MB_SEGY_ASCIIHEADER_LENGTH  3200
-#define   MB_SEGY_FILEHEADER_LENGTH  400
-#define   MB_SEGY_TRACEHEADER_LENGTH  240
-
-/* Flags used to specify desired data type in mb_extract_segy() calls */
-#define   MB_SEGY_SAMPLEFORMAT_NONE	1
-#define   MB_SEGY_SAMPLEFORMAT_TRACE	2
-#define   MB_SEGY_SAMPLEFORMAT_ENVELOPE	3
-#define   MB_SEGY_SAMPLEFORMAT_ANALYTIC	4
-
-/* SEGY structures */
-struct mb_segyasciiheader_struct
-	{
-	char line[40][80];
-	};
-struct mb_segyfileheader_struct
-	{
-	int	jobid;
-	int	line;
-	int	reel;
-	unsigned short	channels;
-	unsigned short	aux_channels;
-	unsigned short	sample_interval;
-	unsigned short	sample_interval_org;
-	unsigned short	number_samples;
-	unsigned short	number_samples_org;
-	unsigned short	format; /*  	1 IBM 32 bit floating  point
-				2 32 bit integer
-				3 16 bit integer
-				5 IEEE 32 bit floating point
-				6 IEEE 32 bit floating point
-				8 8 bit integer
-				11 Little-endian IEEE 32 bit floating point */
-	unsigned short	cdp_fold;
-	unsigned short	trace_sort;
-	unsigned short	vertical_sum;
-	unsigned short	sweep_start;
-	unsigned short	sweep_end;
-	unsigned short	sweep_length;
-	unsigned short	sweep_type;
-	unsigned short	sweep_trace;
-	unsigned short	sweep_taper_start;
-	unsigned short	sweep_taper_end;
-	unsigned short	sweep_taper;
-	unsigned short	correlated;
-	unsigned short	binary_gain;
-	unsigned short	amplitude;
-	unsigned short	units;
-	unsigned short	impulse_polarity;
-	unsigned short	vibrate_polarity;
-	short	domain;
-	short	rev;
-	short	fixed_length;
-	short	num_ext_headers;
-	char	extra[338];
-	};
-struct mb_segytraceheader_struct
-	{
-        int            	seq_num;        /* bytes 0-3, trace sequence number in the line */
-        int            	seq_reel;       /* bytes 4-7, trace sequence number in the reel */
-        int            	shot_num;       /* bytes 8-11, shot number or stacked trace number
-                                                   "Original field record number"  */
-        int            	shot_tr;        /* bytes 12-15, trace number within the shot */
-        int            	espn;   	/* bytes 16-19, "Energy source point number -- used
-                                                    when more than one record occurs at
-                                                    the same effective surface location". */
-        int            	rp_num; 	/* bytes 20-23,  rp or cdp number  */
-        int            	rp_tr;  	/* bytes 24-27,  trace number within the cdp */
-        unsigned short	trc_id; 	/* bytes 28-29,  trace id:  1= live, 2=dead  */
-        unsigned short   num_vstk;       /* bytes 30-31,  Number of traces vertically stacked */
-        unsigned short   cdp_fold;       /* bytes 32-33,  cdp fold (coverage)  */
-        unsigned short   use;            /* bytes 34-35,  Data use:  1=production, 2=test  */
-        int            	range;  	/* bytes 36-39,  source to receiver distance (range) */
-        int           	grp_elev;       /* bytes 40-43,  Receiver group elevation w.r.t.
-                                                          sea level (depth is negative)  */
-        int            	src_elev;       /* bytes 44-47,  Source elevation  */
-        int            	src_depth; 	/* bytes 48-51,  Source depth below surface.
-                                                        (depth is a positive number!) */
-        int            	grp_datum; 	/* bytes 51-55,  Datum elevation at receiver group.  */
-        int            	src_datum; 	/* bytes 56-59,  Datum elevation at source */
-        int            	src_wbd;        /* bytes 60-63,  water depth at the source */
-        int            	grp_wbd;        /* bytes 64-67,  water depth at the receiver group. */
-        short   	elev_scalar; 	/* bytes 68-69, Scalar to be applied to elevations
-                                                	and depths in bytes 41-68.
-                                                	If positive use as a multiplier.
-                                                	If negative, use as a divisor.  */
-        short   	coord_scalar; 	/* bytes 70-71, Scalar to be applied to
-                                                	coordinates in bytes 72-87.
-                                                	If positive use as a multiplier.
-                                                	If negative, use as a divisor.  */
-        int            	src_long;       /* bytes 72-75, longitude in seconds of arc.
-                                                	Source X coordinate */
-        int            	src_lat;        /* bytes 76-79, latitude in seconds of arc.
-                                         		Source Y coordinate   */
-        int    		grp_long;       /* bytes 80-83, Receiver longitude or X coordinate */
-        int            	grp_lat;        /* bytes 84-87, Receiver latitude or Y coordinate */
-        short   	coord_units; 	/* bytes 88-89, = 2, coordinate units = seconds of arc */
-        short   	wvel;   	/* bytes 90-91, weathering or water velocity */
-        short   	sbvel;  	/* bytes 92-93, subweathering velocity  */
-        short   	src_up_vel; 	/* bytes 94-95, uphole time at source  */
-        short   	grp_up_vel; 	/* bytes 96-97, uphole time at group  */
-        short   	src_static; 	/* bytes 98-99, Source static correction  */
-        short   	grp_static; 	/* bytes 100-101, Group static correction  */
-        short   	tot_static; 	/* bytes 102-103, Total static applied */
-        short   	laga;   	/* bytes 104-105, Lag time A in ms. before time 0 */
-        short   	lagb;   	/* bytes 106-107, Lag time B in ms. before time 0 */
-        int            	delay_mils; 	/* bytes 106-109, deep water delay in ms. (or meters)  */
-        short   	smute_mils; 	/* bytes 110-111, start mute time in ms. */
-        short   	emute_mils; 	/* bytes 112-113, end mutes time in ms.  */
-        unsigned short  nsamps; 	/* bytes 114-115, "Number of data samples in this
-                                                	trace" - excludes header */
-        unsigned short  si_micros;      /* bytes 116-117, Sample interval in us for this trace  */
-        short   	other_1[19]; 	/* bytes 118-155, Other short integer stuff */
-        short   	year;   	/* bytes 156-157, year data was recorded. */
-        short   	day_of_yr; 	/* bytes 158-159, recording day of year */
-        short   	hour;   	/* bytes 160-161, recording hour of day  */
-        short   	min;            /* bytes 162-163, recording minute of hour  */
-        short   	sec;            /* bytes 164-165, recording second of minute */
-        short   	mils;           /* bytes 166-167, recording millisecond  */
-                                        /* OFFICIAL SEGY says: "time basis code"  */
-        short   	tr_weight; 	/* bytes 168-169, Trace weighting factor  */
-        short   	other_2[5]; 	/* bytes 170-179, Other short integer stuff */
-        float   	delay;  	/* bytes 180-183, deep water delay in seconds (or meters) */
-        float   	smute_sec; 	/* bytes 184-187, start mute time in seconds */
-        float   	emute_sec;      /* bytes 188-191, end mute time in seconds  */
-        float   	si_secs;        /* bytes 192-195, sample interval in seconds */
-        float   	wbt_secs;       /* bytes 196-199, water bottom time in seconds */
-        int             end_of_rp; 	/* bytes 200-203, <0, indicates the end of a gather
-                                                        >0, the number of traces stacked
-                                                        Also EdgeTech's Trace Scalar.  */
-        float   	dummy1; 	/* bytes 204-207 */
-        float   	dummy2; 	/* bytes 208-211 */
-        float   	dummy3; 	/* bytes 212-215 */
-        float   	dummy4; 	/* bytes 216-219 */
-        float   	soundspeed; 	/* bytes 220-223, water sound speed in m/sec (MB-System only) */
-        float   	distance; 	/* bytes 224-227, distance from previous shot along track in meters (MB-System only) */
-        float   	roll; 	        /* bytes 228-231, roll in degrees (MB-System only) */
-        float   	pitch; 	        /* bytes 232-235, pitch in degrees (MB-System only) */
-        float   	heading; 	/* bytes 236-239, heading in degrees (MB-System only) */
-};
-struct mb_segyio_struct
-	{
-	FILE *fp;
-	char 	segyfile[MB_PATH_MAXLINE];
-	int	bufferalloc;
-	char	*buffer;
-	int	asciiheader_set;
-	int	fileheader_set;
-	struct mb_segyasciiheader_struct asciiheader;
-	struct mb_segyfileheader_struct fileheader;
-	struct mb_segytraceheader_struct traceheader;
-	int	tracealloc;
-	float	*trace;
-	};
-
-/* function prototypes */
-int mb_segy_read_init(int verbose, char *segyfile,
-		void **mbsegyio_ptr,
-		struct mb_segyasciiheader_struct *segyasciiheader,
-		struct mb_segyfileheader_struct *segyfileheader,
-		int *error);
-int mb_segy_write_init(int verbose, char *segyfile,
-		struct mb_segyasciiheader_struct *asciiheader,
-		struct mb_segyfileheader_struct *fileheader,
-		void **mbsegyio_ptr,
-		int *error);
-int mb_segy_close(int verbose,void **mbsegyio_ptr, int *error);
-int mb_segy_read_trace(int verbose, void *mbsegyio_ptr,
-		struct mb_segytraceheader_struct *traceheaderptr,
-		float **traceptr,
-		int *error);
-int mb_segy_write_trace(int verbose, void *mbsegyio_ptr,
-		struct mb_segytraceheader_struct *traceheader,
-		float *trace,
-		int *error);
-void hilbert(int n, double delta[], double kappa[]);
-void hilbert2(int n, double data[]);
diff --git a/src/mbio/mb_status.h b/src/mbio/mb_status.h
deleted file mode 100644
index 94062c5..0000000
--- a/src/mbio/mb_status.h
+++ /dev/null
@@ -1,480 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbio_status.h	2/1/93
- *    $Id: mb_status.h 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1993-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbio_status.h defines version, status and error codes used
- * by MBIO functions and programs
- *
- * Author:	D. W. Caress
- * Date:	January 19, 1993
- *
- *
- */
-
-/* include this code only once */
-#ifndef MB_STATUS_DEF
-#define MB_STATUS_DEF
-
-/* MBIO function boolean convention */
-#define	MB_YES	        1
-#define	MB_NO	        0
-#define	MB_MAYBE	-1
-
-/* MBIO topography source types */
-#define	MB_TOPOGRAPHY_TYPE_UNKNOWN		0
-#define	MB_TOPOGRAPHY_TYPE_ECHOSOUNDER	        1
-#define	MB_TOPOGRAPHY_TYPE_MULTIBEAM		2
-#define	MB_TOPOGRAPHY_TYPE_SIDESCAN		3
-#define	MB_TOPOGRAPHY_TYPE_INTERFEROMETRIC	4
-#define	MB_TOPOGRAPHY_TYPE_LIDAR      	        5
-#define	MB_TOPOGRAPHY_TYPE_CAMERA     	        6
-#define	MB_TOPOGRAPHY_TYPE_GRID     	        7
-#define	MB_TOPOGRAPHY_TYPE_POINT       	        8
-
-/* MBIO imagery source types */
-#define	MB_IMAGERY_TYPE_UNKNOWN		        0
-#define	MB_IMAGERY_TYPE_ECHOSOUNDER	        1
-#define	MB_IMAGERY_TYPE_MULTIBEAM		2
-#define	MB_IMAGERY_TYPE_SIDESCAN		3
-#define	MB_IMAGERY_TYPE_INTERFEROMETRIC	        4
-#define	MB_IMAGERY_TYPE_LIDAR      	        5
-#define	MB_IMAGERY_TYPE_CAMERA     	        6
-#define	MB_IMAGERY_TYPE_GRID     	        7
-#define	MB_IMAGERY_TYPE_POINT       	        8
-
-/* MBIO data type ("kind") convention */
-#define	MB_DATA_KINDS			61
-#define	MB_DATA_NONE			0
-#define	MB_DATA_DATA			1	/* general survey data */
-#define	MB_DATA_COMMENT			2	/* general comment */
-#define	MB_DATA_HEADER			3	/* general header */
-#define	MB_DATA_CALIBRATE		4	/* Hydrosweep DS */
-#define	MB_DATA_MEAN_VELOCITY		5	/* Hydrosweep DS */
-#define	MB_DATA_VELOCITY_PROFILE	6	/* general */
-#define	MB_DATA_STANDBY			7	/* Hydrosweep DS */
-#define	MB_DATA_NAV_SOURCE		8	/* Hydrosweep DS */
-#define	MB_DATA_PARAMETER		9	/* general */
-#define	MB_DATA_START			10	/* Simrad */
-#define	MB_DATA_STOP			11	/* Simrad */
-#define	MB_DATA_NAV			12	/* Simrad, Reson 7k */
-#define	MB_DATA_RUN_PARAMETER		13	/* Simrad */
-#define	MB_DATA_CLOCK			14	/* Simrad */
-#define	MB_DATA_TIDE			15	/* Simrad, Reson 7k */
-#define	MB_DATA_HEIGHT			16	/* Simrad */
-#define	MB_DATA_HEADING			17	/* Simrad, Hypack */
-#define	MB_DATA_ATTITUDE		18	/* Simrad, Hypack, Reson 7k */
-#define	MB_DATA_SSV			19	/* Simrad */
-#define	MB_DATA_ANGLE			20	/* HSMD */
-#define	MB_DATA_EVENT			21	/* HSMD */
-#define	MB_DATA_HISTORY			22	/* GSF */
-#define	MB_DATA_SUMMARY			23	/* GSF */
-#define	MB_DATA_PROCESSING_PARAMETERS	24	/* GSF */
-#define	MB_DATA_SENSOR_PARAMETERS	25	/* GSF */
-#define	MB_DATA_NAVIGATION_ERROR	26	/* GSF */
-#define	MB_DATA_RAW_LINE		27	/* uninterpretable line for ascii formats */
-#define	MB_DATA_NAV1			28	/* ancillary nav system 1 */
-#define	MB_DATA_NAV2			29	/* ancillary nav system 2 */
-#define	MB_DATA_NAV3			30	/* ancillary nav system 3 */
-#define	MB_DATA_TILT			31	/* Simrad */
-#define	MB_DATA_MOTION			32	/* Reson 7k */
-#define	MB_DATA_CTD			33	/* Reson 7k */
-#define	MB_DATA_SUBBOTTOM_MCS		34	/* Reson 7k */
-#define	MB_DATA_SUBBOTTOM_CNTRBEAM	35	/* Simrad */
-#define	MB_DATA_SUBBOTTOM_SUBBOTTOM	36	/* Reson 7k, XTF */
-#define	MB_DATA_SIDESCAN2		37	/* Reson 7k, XTF */
-#define	MB_DATA_SIDESCAN3		38	/* Reson 7k, XTF */
-#define	MB_DATA_IMAGE			39	/* Reson 7k */
-#define	MB_DATA_ROLL			40	/* Reson 7k */
-#define	MB_DATA_PITCH			41	/* Reson 7k */
-#define	MB_DATA_ABSORPTIONLOSS		42	/* Reson 7k */
-#define	MB_DATA_SPREADINGLOSS		43	/* Reson 7k */
-#define	MB_DATA_INSTALLATION		44	/* Reson 7k */
-#define	MB_DATA_WATER_COLUMN		45	/* Simrad */
-#define	MB_DATA_STATUS			46	/* Simrad, XTF */
-#define	MB_DATA_DVL			47	/* JSTAR */
-#define	MB_DATA_NMEA_RMC		48	/* NMEA */
-#define	MB_DATA_NMEA_DBT		49	/* NMEA */
-#define	MB_DATA_NMEA_DPT		50	/* NMEA */
-#define	MB_DATA_NMEA_ZDA		51	/* NMEA */
-#define	MB_DATA_NMEA_GLL		52	/* NMEA */
-#define	MB_DATA_NMEA_GGA		53	/* NMEA */
-#define	MB_DATA_SURVEY_LINE		54	/* Reson 7k */
-#define	MB_DATA_ATTITUDE1		55	/* ancillary attitude system 1 */
-#define	MB_DATA_ATTITUDE2		56      /* ancillary attitude system 2 */
-#define	MB_DATA_ATTITUDE3		57	/* ancillary attitude system 3 */
-#define	MB_DATA_SONARDEPTH		58	/* HYSWEEP dynamic draft */
-#define	MB_DATA_ALTITUDE		59	/* HYSWEEP single beam echosounder */
-#define	MB_DATA_GEN_SENS		60	/* WASSP generic sensor data */
-#define	MB_DATA_WC_PICKS 		61	/* WASSP water column picks */
-
-/* MBIO function status convention */
-#define	MB_SUCCESS			1
-#define	MB_FAILURE			0
-
-/* MBIO minimum and maximum error values */
-#define	MB_ERROR_MIN			-24
-#define	MB_ERROR_MAX			16
-
-/* MBIO function fatal error values */
-#define	MB_ERROR_NO_ERROR		0
-#define	MB_ERROR_MEMORY_FAIL		1
-#define	MB_ERROR_OPEN_FAIL		2
-#define	MB_ERROR_BAD_FORMAT		3
-#define	MB_ERROR_EOF			4
-#define	MB_ERROR_WRITE_FAIL		5
-#define	MB_ERROR_NONE_IN_BOUNDS		6
-#define	MB_ERROR_NONE_IN_TIME		7
-#define	MB_ERROR_BAD_DESCRIPTOR		8
-#define	MB_ERROR_BAD_USAGE		9
-#define	MB_ERROR_NO_PINGS_BINNED	10
-#define	MB_ERROR_BAD_KIND		11
-#define MB_ERROR_BAD_PARAMETER		12
-#define	MB_ERROR_BAD_BUFFER_ID		13
-#define	MB_ERROR_BAD_SYSTEM		14
-#define	MB_ERROR_BAD_DATA		15
-#define	MB_ERROR_MISSING_DATA		16
-
-/* MBIO function nonfatal error values */
-#define	MB_ERROR_TIME_GAP		-1
-#define	MB_ERROR_OUT_BOUNDS		-2
-#define	MB_ERROR_OUT_TIME		-3
-#define	MB_ERROR_SPEED_TOO_SMALL	-4
-#define	MB_ERROR_COMMENT		-5
-#define	MB_ERROR_SUBBOTTOM		-6
-#define	MB_ERROR_WATER_COLUMN		-7
-#define	MB_ERROR_OTHER			-8
-#define	MB_ERROR_UNINTELLIGIBLE		-9
-#define	MB_ERROR_IGNORE			-10
-#define	MB_ERROR_NO_DATA_REQUESTED	-11
-#define	MB_ERROR_BUFFER_FULL		-12
-#define	MB_ERROR_NO_DATA_LOADED		-13
-#define	MB_ERROR_BUFFER_EMPTY		-14
-#define	MB_ERROR_NO_DATA_DUMPED		-15
-#define	MB_ERROR_NO_MORE_DATA		-16
-#define	MB_ERROR_DATA_NOT_INSERTED	-17
-#define	MB_ERROR_BAD_PROJECTION		-18
-#define	MB_ERROR_MISSING_PROJECTIONS	-19
-#define	MB_ERROR_MISSING_NAVATTITUDE	-20
-#define	MB_ERROR_NOT_ENOUGH_DATA	-21
-#define	MB_ERROR_FILE_NOT_FOUND		-22
-#define	MB_ERROR_FILE_LOCKED		-23
-#define	MB_ERROR_INIT_FAIL		-24
-
-/* MBIO problem values */
-#define	MB_PROBLEM_MAX			6
-#define	MB_PROBLEM_NO_DATA		1
-#define	MB_PROBLEM_ZERO_NAV		2
-#define	MB_PROBLEM_TOO_FAST		3
-#define	MB_PROBLEM_AVG_TOO_FAST		4
-#define	MB_PROBLEM_TOO_DEEP		5
-#define	MB_PROBLEM_BAD_DATAGRAM		6
-
-/* processing status values returned by mb_datalist_read2() */
-#define MB_PROCESSED_NONE	0
-#define MB_PROCESSED_EXIST	1
-#define MB_PROCESSED_USE	2
-
-/* MBIO maximum notice value */
-#define	MB_NOTICE_MAX	(MB_DATA_KINDS - MB_ERROR_MIN + MB_PROBLEM_MAX + 1)
-
-/* MBIO function error messages */
-#ifdef DEFINE_MB_MESSAGES
-static char *fatal_error_msg[] =
-	{
-	"No error",
-	"Unable to allocate memory, initialization failed",
-	"Unable to open file, initialization failed",
-	"Illegal format identifier, initialization failed",
-	"Read error, probably end-of-file",
-	"Write error",
-	"No data in specified location bounds",
-	"No data in specified time interval",
-	"Invalid mbio i/o descriptor",
-	"Inconsistent usage of mbio i/o descriptor",
-	"No pings binned but no fatal error - this should not happen!",
-	"Invalid data record type specified for writing",
-	"Invalid control parameter specified by user",
-	"Invalid buffer id",
-	"Invalid system id - this should not happen!",
-	"This data file is not in the specified format!",
-	"Required data are missing"
-	};
-static char *nonfatal_error_msg[] =
-	{
-	"No error",
-	"Time gap in data",
-	"Data outside specified location bounds",
-	"Data outside specified time interval",
-	"Ship speed too small",
-	"Comment record",
-	"Subbottom record",
-	"Water column record",
-	"Neither a data record nor a comment record",
-	"Unintelligible data record",
-	"Ignore these data",
-	"No data requested for buffer load",
-	"Data buffer is full",
-	"No data was loaded into the buffer",
-	"Data buffer is empty",
-	"No data was dumped from the buffer",
-	"No more survey data records in buffer",
-	"Data inconsistencies prevented inserting data into storage structure",
-	"UTM projection initialization failed",
-	"Projection database cannot be read",
-	"Missing navigation and/or attitude data",
-	"Not enough data available to perform operation",
-	"Requested file not found",
-	"Requested file locked",
-	"Initialization failed",
-	};
-static char *unknown_error_msg[] =
-	{
-	"Unknown error identifier"
-	};
-
-/* MBIO function notice messages */
-static char *notice_msg[] =
-	{
-	"Unknown notice identifier junk",
-
-	/* notices for data record types */
-	"MB_DATA_DATA (ID=1): survey data",
-	"MB_DATA_COMMENT (ID=2): comment",
-	"MB_DATA_HEADER (ID=3): general header",
-	"MB_DATA_CALIBRATE (ID=4): Hydrosweep DS calibration ping",
-	"MB_DATA_MEAN_VELOCITY (ID=5): Hydrosweep DS mean sound speed",
-	"MB_DATA_VELOCITY_PROFILE (ID=6): SVP",
-	"MB_DATA_STANDBY (ID=7): Hydrosweep DS standby record",
-	"MB_DATA_NAV_SOURCE (ID=8): Hydrosweep DS nav source record",
-	"MB_DATA_PARAMETER (ID=9): Parameter record",
-	"MB_DATA_START (ID=10): Simrad start datagram",
-	"MB_DATA_STOP (ID=11): Simrad stop datagram",
-	"MB_DATA_NAV (ID=12): Navigation record",
-	"MB_DATA_RUN_PARAMETER (ID=13): Simrad runtime parameter datagram",
-	"MB_DATA_CLOCK (ID=14): Simrad clock datagram",
-	"MB_DATA_TIDE (ID=15): Tide record",
-	"MB_DATA_HEIGHT (ID=16): Simrad height datagram",
-	"MB_DATA_HEADING (ID=17): Heading record",
-	"MB_DATA_ATTITUDE (ID=18): Attitude record",
-	"MB_DATA_SSV (ID=19): Surface sound speed record",
-	"MB_DATA_ANGLE (ID=20): Beam angle record",
-	"MB_DATA_EVENT (ID=21): Hydrosweep MD event record",
-	"MB_DATA_HISTORY (ID=22): GSF history record",
-	"MB_DATA_SUMMARY (ID=23): GSF summary record",
-	"MB_DATA_PROCESSING_PARAMETERS (ID=24): GSF processing parameters record",
-	"MB_DATA_SENSOR_PARAMETERS (ID=25): GSF sensor parameter record",
-	"MB_DATA_NAVIGATION_ERROR (ID=26): GSF navigation error record",
-	"MB_DATA_RAW_LINE (ID=27): uninterpretable ASCII line",
-	"MB_DATA_NAV1 (ID=28): Auxiliary nav system 1",
-	"MB_DATA_NAV2 (ID=29): Auxiliary nav system 2",
-	"MB_DATA_NAV3 (ID=30): Auxiliary nav system 3",
-	"MB_DATA_TILT (ID=31): Mechanical tilt record",
-	"MB_DATA_MOTION (ID=32): Motion (DVL) sensor record",
-	"MB_DATA_CTD (ID=33): CTD record",
-	"MB_DATA_SUBBOTTOM_MCS (ID=34): MCS subbottom record",
-	"MB_DATA_SUBBOTTOM_CNTRBEAM (ID=35): Centerbeam subbottom record",
-	"MB_DATA_SUBBOTTOM_SUBBOTTOM (ID=36): Subbottom record",
-	"MB_DATA_SIDESCAN2 (ID=37): Secondary sidescan record",
-	"MB_DATA_SIDESCAN3 (ID=38): Tertiary sidescan record",
-	"MB_DATA_IMAGE (ID=39): Sonar image record",
-	"MB_DATA_ROLL (ID=40): Roll record",
-	"MB_DATA_PITCH (ID=41): Pitch record",
-	"MB_DATA_ABSORPTIONLOSS (ID=42): Absorption loss record",
-	"MB_DATA_SPREADINGLOSS (ID=43): Spreading loss record",
-	"MB_DATA_INSTALLATION (ID=44): Installation parameter record",
-	"MB_DATA_WATER_COLUMN (ID=45): Water column record",
-	"MB_DATA_STATUS (ID=46): Status record",
-	"MB_DATA_DVL (ID=47): DVL record",
-	"MB_DATA_NMEA_RMC (ID=48): NMEA RMC record",
-	"MB_DATA_NMEA_DBT (ID=49): NMEA DBT record",
-	"MB_DATA_NMEA_DPT (ID=50): NMEA DPT record",
-	"MB_DATA_NMEA_ZDA (ID=51): NMEA ZDA record",
-	"MB_DATA_NMEA_GLL (ID=52): NMEA GLL record",
-	"MB_DATA_NMEA_GGA (ID=53): NMEA GGA record",
-	"MB_DATA_SURVEY_LINE (ID=54): Survey line record",
-	"MB_DATA_ATTITUDE1 (55): ancillary attitude system 1",
-	"MB_DATA_ATTITUDE2 (56): ancillary attitude system 2",
-	"MB_DATA_ATTITUDE3 (57): ancillary attitude system 3",
-	"MB_DATA_SONARDEPTH (58): HYSWEEP dynamic draft",
-	"MB_DATA_ALTITUDE (59): HYSWEEP single beam echosounder",
-	"MB_DATA_GEN_SENS (60): WASSP generic sensor data",
-	"MB_DATA_WC_PICKS (61): WASSP water column picks",
-
-	/* notices for nonfatal error messages */
-	"MB_ERROR_TIME_GAP (ID=-1): Time gap in data",
-	"MB_ERROR_OUT_BOUNDS (ID=-2): Data outside specified location bounds",
-	"MB_ERROR_OUT_TIME (ID=-3): Data outside specified time interval",
-	"MB_ERROR_SPEED_TOO_SMALL (ID=-4): Ship speed too small",
-	"MB_ERROR_COMMENT (ID=-5): Comment record",
-	"MB_ERROR_SUBBOTTOM (ID=-6): Subbottom record",
-	"MB_ERROR_WATER_COLUMN (ID=-7): Water column record",
-	"MB_ERROR_OTHER (ID=-8): Neither a data record nor a comment record",
-	"MB_ERROR_UNINTELLIGIBLE (ID=-9): Unintelligible data record",
-	"MB_ERROR_IGNORE (ID=-10): Ignore these data",
-	"MB_ERROR_NO_DATA_REQUESTED (ID=-11): No data requested for buffer load",
-	"MB_ERROR_BUFFER_FULL (ID=-12): Data buffer is full",
-	"MB_ERROR_NO_DATA_LOADED (ID=-13): No data was loaded into the buffer",
-	"MB_ERROR_BUFFER_EMPTY (ID=-14): Data buffer is empty",
-	"MB_ERROR_NO_DATA_DUMPED (ID=-15): No data was dumped from the buffer",
-	"MB_ERROR_NO_MORE_DATA (ID=-16): No more survey data records in buffer",
-	"MB_ERROR_DATA_NOT_INSERTED (ID=-17): Data inconsistencies prevented inserting data into storage structure",
-	"MB_ERROR_BAD_PROJECTION (ID=-18): UTM projection initialization failed",
-	"MB_ERROR_MISSING_PROJECTIONS (ID=-19): Projection database cannot be read",
-	"MB_ERROR_MISSING_NAVATTITUDE (ID=-20): Attitude data are missing for this ping",
-	"MB_ERROR_NOT_ENOUGH_DATA (ID=-21): Not enough data to perform spline interpolation",
-	"MB_ERROR_FILE_NOT_FOUND (ID=-22): Required file cannot be found",
-	"MB_ERROR_FILE_LOCKED (ID=-23): Required file locked",
-
-	/* problem notices */
-	"DATA PROBLEM (ID=1): No survey data found",
-	"DATA PROBLEM (ID=2): Zero longitude or latitude in survey data",
-	"DATA PROBLEM (ID=3): Instantaneous speed exceeds 25 km/hr",
-	"DATA PROBLEM (ID=4): Average speed exceeds 25 km/hr",
-	"DATA PROBLEM (ID=5): Sounding depth exceeds 11000 m",
-	"DATA PROBLEM (ID=6): Unsupported datagram or record",
-	};
-static char *unknown_notice_msg[] =
-	{
-	"Unknown notice identifier detritus"
-	};
-#endif
-
-/* MBIO sidescan types
-	- sidescan values can be logarithmic (dB) or linear (usually voltage) */
-#define MB_SIDESCAN_LOGARITHMIC 0
-#define MB_SIDESCAN_LINEAR	1
-
-/* MBIO null sidescan:
-	- value used to flag sidescan values as undefined */
-#define MB_SIDESCAN_NULL -1000000000.0
-
-/* MBIO unknown time flag:
-	- time_d value used to flag unknown time tag
-	- e.g. for xyz soundings */
-#define MB_TIME_D_UNKNOWN -2209075200.000000
-
-/*
- * The following defines the values used to flag or
- * select individual bathymetry values (soundings). This scheme
- * is very similar to the convention used in the HMPS
- * hydrographic data processing package and the SAIC Hydrobat
- * package. The values passed in MBIO functions are single
- * byte characters.
- *
- * Macros used to identify the flags are also defined here.
- *
- * The flagging scheme is as follows:
- *
- * Beams cannot be both flagged and selected. However, more than
- * one "reason bit" can be set for either flagging or selection.
- *
- * The flag and select bits:
- *   xxxxxx00 => This beam is neither flagged nor selected.
- *   xxxxxx01 => This beam is flagged as bad and should be ignored.
- *   xxxxxx10 => This beam has been selected.
- *
- * Flagging modes:
- *   00000001 => Flagged because no detection was made by the sonar.
- *   xxxxx101 => Flagged by manual editing.
- *   xxxx1x01 => Flagged by automatic filter.
- *   xxx1xx01 => Flagged because uncertainty exceeds 1 X IHO standard.
- *   xx1xxx01 => Flagged because uncertainty exceeds 2 X IHO standard.
- *   x1xxxx01 => Flagged because footprint is too large
- *   1xxxxx01 => Flagged by sonar as unreliable.
- *
- * Selection modes:
- *   00000010 => Selected, no reason specified.
- *   xxxxx110 => Selected as least depth.
- *   xxxx1x10 => Selected as average depth.
- *   xxx1xx10 => Selected as maximum depth.
- *   xx1xxx10 => Selected as location of sidescan contact.
- *   x1xxxx10 => Selected, spare.
- *   1xxxxx10 => Selected, spare.
- *
- */
-
-/* Definitions for FLAG category */
-#define MB_FLAG_NONE			0x00
-#define MB_FLAG_FLAG			0x01
-#define MB_FLAG_NULL			0x01
-#define MB_FLAG_MANUAL			0x04
-#define MB_FLAG_FILTER			0x08
-#define MB_FLAG_FILTER2			0x10
-#define MB_FLAG_GT_1X_IHO		0x10
-#define MB_FLAG_GT_2X_IHO		0x20
-#define MB_FLAG_FOOTPRINT       	0x40
-#define MB_FLAG_SONAR			0x80
-
-/* Definitions for the SELECT category */
-#define MB_SELECT_SELECT		0x02
-#define MB_SELECT_LEAST			0x04
-#define MB_SELECT_MAXIMUM		0x08
-#define MB_SELECT_AVERAGE		0x10
-#define MB_SELECT_CONTACT		0x20
-#define MB_SELECT_SPARE_1		0x40
-#define MB_SELECT_SPARE_2		0x80
-
-/* Definitions for macros applying and testing flags */
-#define mb_beam_ok(F)				((int)(!(F & MB_FLAG_FLAG)))
-#define mb_beam_check_flag(F)			((int)(F & MB_FLAG_FLAG))
-#define mb_beam_check_flag_null(F)		((int)(F == MB_FLAG_NULL))
-#define mb_beam_check_flag_manual(F)		((int)((F & MB_FLAG_MANUAL   ) && (F & MB_FLAG_FLAG)))
-#define mb_beam_check_flag_filter(F)		((int)((F & MB_FLAG_FILTER   ) && (F & MB_FLAG_FLAG)))
-#define mb_beam_check_flag_filter2(F)		((int)((F & MB_FLAG_FILTER2   ) && (F & MB_FLAG_FLAG)))
-#define mb_beam_check_flag_gt_1x_iho(F)		((int)((F & MB_FLAG_GT_1X_IHO) && (F & MB_FLAG_FLAG)))
-#define mb_beam_check_flag_gt_2x_iho(F)		((int)((F & MB_FLAG_GT_2X_IHO) && (F & MB_FLAG_FLAG)))
-#define mb_beam_check_flag_footprint(F)		((int)((F & MB_FLAG_FOOTPRINT) && (F & MB_FLAG_FLAG)))
-#define mb_beam_check_flag_sonar(F)		((int)((F & MB_FLAG_SONAR    ) && (F & MB_FLAG_FLAG)))
-#define mb_beam_set_flag_null(F)		(0x01)
-#define mb_beam_set_flag_none(F)		(0x00)
-#define mb_beam_set_flag_manual(F)		(F | 0x05)
-#define mb_beam_set_flag_filter(F)		(F | 0x09)
-#define mb_beam_set_flag_filter2(F)		(F | 0x11)
-#define mb_beam_set_flag_gt_1x_iho(F)		(F | 0x11)
-#define mb_beam_set_flag_gt_2x_iho(F)		(F | 0x21)
-#define mb_beam_set_flag_footprint(F)		(F | 0x41)
-#define mb_beam_set_flag_sonar(F)		(F | 0x81)
-#define mb_beam_check_select(F)			((int)(F & MB_SELECT_SELECT))
-#define mb_beam_check_select_least(F)		((int)((F & MB_SELECT_LEAST  ) && (F & MB_SELECT_SELECT)))
-#define mb_beam_check_select_maximum(F)		((int)((F & MB_SELECT_MAXIMUM) && (F & MB_SELECT_SELECT)))
-#define mb_beam_check_select_average(F)		((int)((F & MB_SELECT_AVERAGE) && (F & MB_SELECT_SELECT)))
-#define mb_beam_check_select_contact(F)		((int)((F & MB_SELECT_CONTACT) && (F & MB_SELECT_SELECT)))
-#define mb_beam_check_select_spare_1(F)		((int)((F & MB_SELECT_SPARE_1) && (F & MB_SELECT_SELECT)))
-#define mb_beam_check_select_spare_2(F)		((int)((F & MB_SELECT_SPARE_2) && (F & MB_SELECT_SELECT)))
-#define mb_beam_set_select(F)			(F | 0x02)
-#define mb_beam_set_select_least(F)		(F | 0x06)
-#define mb_beam_set_select_maximum(F)		(F | 0x0a)
-#define mb_beam_set_select_average(F)		(F | 0x12)
-#define mb_beam_set_select_contact(F)		(F | 0x22)
-#define mb_beam_set_select_spare_1(F)		(F | 0x42)
-#define mb_beam_set_select_spare_2(F)		(F | 0x82)
-
-/* Bottom detect flags */
-#define MB_DETECT_TYPE_NUM	        5
-#define MB_DETECT_UNKNOWN	        0
-#define MB_DETECT_AMPLITUDE	        1
-#define MB_DETECT_PHASE		        2
-#define MB_DETECT_LIDAR		        3
-#define MB_DETECT_PHOTOGRAMMETRY        4
-
-/* Source pulse type flags */
-#define MB_PULSE_TYPE_NUM	5
-#define MB_PULSE_UNKNOWN	0
-#define MB_PULSE_CW		1
-#define MB_PULSE_UPCHIRP	2
-#define MB_PULSE_DOWNCHIRP	3
-#define MB_PULSE_LIDAR  	4
-
-/* end conditional include */
-#endif
diff --git a/src/mbio/mb_swap.c b/src/mbio/mb_swap.c
deleted file mode 100644
index 2cc61f3..0000000
--- a/src/mbio/mb_swap.c
+++ /dev/null
@@ -1,125 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mb_swap.c	7/6/94
- *    $Id: mb_swap.c 2247 2015-05-29 21:28:28Z caress $
- *
- *    Copyright (c) 1993-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mb_swap.c contains two functions used to swap bytes for 4 byte float
- * and 8 byte double values.  These are used to deal with the
- * differences between "big endian" and "little endian" machines.
- * The usual MBIO debug statements have been left out to avoid
- * slowing the execution of these functions. The functions
- * mb_swap_float() and mb_swap_double() do not handle conversions
- * between IEEE values and other representations.
- * Note that the functions take pointers to float or double values
- * as arguments.
-
- *
- * Author:	D. W. Caress
- * Date:	July 6, 1994
- *
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <stdlib.h>
-
-/* include for byte swapping on little-endian machines */
-#include "mb_status.h"
-#include "mb_swap.h"
-#include "mb_define.h"
-
-/* static	char	rcs_id[]="$Id: mb_swap.c 2247 2015-05-29 21:28:28Z caress $"; */
-
-/*--------------------------------------------------------------------*/
-/* function mb_swap_check determines if the cpu is byteswapped */
-int mb_swap_check()
-{
-	unsigned short testshort = 255;
-	char		*testchar;
-	int	byteswapped;
-	testchar = (char *) &testshort;
-	if (testchar[0] == 0)
-		byteswapped = MB_NO;
-	else
-		byteswapped = MB_YES;
-
-	return(byteswapped);
-}
-
-/*--------------------------------------------------------------------*/
-/* function mb_swap_float swaps the bytes of an 4 byte float value */
-int mb_swap_float(float *a)
-{
-	unsigned int	*t;
-	t = (unsigned int *) a;
-	*t = mb_swap_int(*t);
-
-	return(MB_SUCCESS);
-}
-
-/*--------------------------------------------------------------------*/
-/* function mb_swap_double swaps the bytes of an 8 byte double value */
-int mb_swap_double(double *a)
-{
-	mb_u_char bc[8];
-	mb_u_char *ac;
-
-	ac = (mb_u_char *) a;
-	bc[0] = ac[7];
-	bc[1] = ac[6];
-	bc[2] = ac[5];
-	bc[3] = ac[4];
-	bc[4] = ac[3];
-	bc[5] = ac[2];
-	bc[6] = ac[1];
-	bc[7] = ac[0];
-	ac[0] = bc[0];
-	ac[1] = bc[1];
-	ac[2] = bc[2];
-	ac[3] = bc[3];
-	ac[4] = bc[4];
-	ac[5] = bc[5];
-	ac[6] = bc[6];
-	ac[7] = bc[7];
-
-	return(MB_SUCCESS);
-}
-/*--------------------------------------------------------------------*/
-/* function mb_swap_long swaps the bytes of an 8 byte long value */
-int mb_swap_long(mb_s_long *a)
-{
-	mb_u_char bc[8];
-	mb_u_char *ac;
-
-	ac = (mb_u_char *) a;
-	bc[0] = ac[7];
-	bc[1] = ac[6];
-	bc[2] = ac[5];
-	bc[3] = ac[4];
-	bc[4] = ac[3];
-	bc[5] = ac[2];
-	bc[6] = ac[1];
-	bc[7] = ac[0];
-	ac[0] = bc[0];
-	ac[1] = bc[1];
-	ac[2] = bc[2];
-	ac[3] = bc[3];
-	ac[4] = bc[4];
-	ac[5] = bc[5];
-	ac[6] = bc[6];
-	ac[7] = bc[7];
-
-	return(MB_SUCCESS);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mb_swap.h b/src/mbio/mb_swap.h
deleted file mode 100644
index 4c33b8b..0000000
--- a/src/mbio/mb_swap.h
+++ /dev/null
@@ -1,83 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mb_swap.h	6/21/94
- *    $Id: mb_swap.h 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1993-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mb_swap.h is an include file with macro definitions
- * used to swap bytes for 2 and 4 byte integer values to deal with the
- * differences between "big endian" and "little endian" machines.
- * The two macros mb_swap_short and mb_swap_long come courtesy of
- * Paul Cohen of Sonatech.
- *
- * Author:	D. W. Caress
- * Date:	June 21, 1994
- *
- * $Log: mb_swap.h,v $
- * Revision 5.3  2004/11/06 03:55:15  caress
- * Working to support the Reson 7k format.
- *
- * Revision 5.2  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.1  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.0  2000/12/01 22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.6  2000/09/30  06:29:44  caress
- * Snapshot for Dale.
- *
- * Revision 4.5  1998/12/17  23:01:15  caress
- * MB-System version 4.6beta4
- *
- * Revision 4.4  1998/10/05 17:46:15  caress
- * MB-System version 4.6beta
- *
- * Revision 4.3  1997/04/21  17:02:07  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.2  1994/10/21  12:11:53  caress
- * Release V4.0
- *
- * Revision 4.2  1994/10/21  12:11:53  caress
- * Release V4.0
- *
- * Revision 4.1  1994/07/29  18:46:51  caress
- * Changes associated with supporting Lynx OS (byte swapped) and
- * using unix second time base (for time_d values).
- *
- * Revision 4.0  1994/06/21  23:22:59  caress
- * First cut.
- *
- *
- *
- */
-
-/*--------------------------------------------------------------------*/
-
-/* include this code only once */
-#ifndef MB_SWAP_DEF
-#define MB_SWAP_DEF
-
-#define mb_swap_short(a) ( ((a & 0xff) << 8) | ((unsigned short)(a) >> 8) )
-
-#define mb_swap_int(a) ( ((a) << 24) | \
-                       (((a) << 8) & 0x00ff0000) | \
-                       (((a) >> 8) & 0x0000ff00) | \
-                        ((unsigned int)(a) >>24) )
-
-/* end conditional include */
-#endif
-
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mb_time.c b/src/mbio/mb_time.c
deleted file mode 100644
index 2dcd63e..0000000
--- a/src/mbio/mb_time.c
+++ /dev/null
@@ -1,524 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mb_time.c	1/21/93
- *    $Id: mb_time.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1993-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mb_time.c includes the "mb_" functions used to translate between
- * various time formats.
- *
- * Author:	D. W. Caress
- * Date:	January 21, 1993
- *
- * $Log: mb_time.c,v $
- * Revision 5.3  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.2  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.1  2002/05/29 23:36:53  caress
- * Release 5.0.beta18
- *
- * Revision 5.0  2000/12/01 22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.14  2000/10/11  01:02:30  caress
- * Convert to ANSI C
- *
- * Revision 4.13  2000/09/30  06:32:11  caress
- * Snapshot for Dale.
- *
- * Revision 4.12  2000/03/06  21:53:54  caress
- * Implemented Suzanne Ohara's fixes to Y2K leapday problems.
- *
- * Revision 4.11  1999/03/31  18:11:35  caress
- * MB-System 4.6beta7
- *
- * Revision 4.10  1998/10/05  18:32:27  caress
- * MB-System version 4.6beta
- *
- * Revision 4.9  1997/04/21  17:02:07  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.9  1997/04/21  17:02:07  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.8  1996/04/22  13:21:19  caress
- * Now have DTR and MIN/MAX defines in mb_define.h
- *
- * Revision 4.8  1996/04/22  13:21:19  caress
- * Now have DTR and MIN/MAX defines in mb_define.h
- *
- * Revision 4.7  1996/03/11  15:33:52  caress
- * Fixed handling of leap days as per note from Suzanne O'Hara
- * on the R/V Palmer.
- *
- * Revision 4.6  1995/03/06  19:38:54  caress
- * Changed include strings.h to string.h for POSIX compliance.
- *
- * Revision 4.5  1995/02/14  21:59:53  caress
- * Initialize time_i[1] in mb_get_itime() to avoid core dump when
- * doing mbmerge on format 54 data.
- *
- * Revision 4.4  1995/01/03  22:49:33  caress
- * Fixed bug in mb_get_date() as per David Brock of ASA.
- *
- * Revision 4.3  1994/10/21  12:11:53  caress
- * Release V4.0
- *
- * Revision 4.2  1994/07/29  18:46:51  caress
- * Changes associated with supporting Lynx OS (byte swapped) and
- * using unix second time base (for time_d values).
- *
- * Revision 4.1  1994/04/27  23:37:06  caress
- * Changed reference to time_d value; time_d now defined as
- * minutes since 1/1/1971 00:00:00.
- *
- * Revision 4.0  1994/03/06  00:01:56  caress
- * First cut at version 4.0
- *
- * Revision 4.1  1994/03/03  03:39:43  caress
- * Fixed copyright message.
- *
- * Revision 4.0  1994/02/21  04:04:35  caress
- * First cut at new version.  No changes.
- *
- * Revision 3.2  1993/05/15  14:40:30  caress
- * removed excess rcs_id messages
- *
- * Revision 3.1  1993/05/14  22:43:31  sohara
- * fixed rcs_id message
- *
- * Revision 3.0  1993/04/23  19:00:00  dale
- * Initial version
- *
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_define.h"
-
-/* time conversion constants and variables */
-#define SECINYEAR 31536000.0
-#define SECINDAY     86400.0
-#define SECINHOUR     3600.0
-#define SECINMINUTE     60.0
-#define IMININHOUR 60
-int	yday[] = {0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334};
-static char rcs_id[]="$Id: mb_time.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-/* 	function mb_get_time returns the number of seconds from
- * 	1/1/70 00:00:00 calculated from (yy/mm/dd/hr/mi/sc). */
-int mb_get_time(int verbose, int time_i[7], double *time_d)
-{
-  char	*function_name = "mb_get_time";
-	int	status;
-	int	yearday;
-	int	leapday;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose: %d\n",verbose);
-		fprintf(stderr,"dbg2       year:    %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       month:   %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       day:     %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       hour:    %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       minute:  %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       second:  %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       microsec:%d\n",time_i[6]);
-		}
-
-	/* get time */
-	yearday = yday[time_i[1]-1];
-	if (((time_i[0] % 4 == 0 && time_i[0] % 100 != 0)
-		|| time_i[0]%400==0)
-		&& (time_i[1] > 2))
-		yearday++;
-	leapday = (time_i[0] - 1969)/4;
-	*time_d = (time_i[0] - 1970)*SECINYEAR
-		+ (yearday - 1 + leapday + time_i[2])*SECINDAY
-		+ time_i[3]*SECINHOUR + time_i[4]*SECINMINUTE
-		+ time_i[5] + 0.000001*time_i[6];
-
-	/* assume success */
-	status = MB_SUCCESS;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       time_d:  %f\n",*time_d);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return success */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-/* 	function mb_get_date returns yy/mm/dd/hr/mi/sc calculated
- * 	from the number of seconds after 1/1/70 00:00:0 */
-int mb_get_date(int verbose, double time_d, int time_i[7])
-{
-
-	char	*function_name = "mb_get_date";
-	int	status;
-	int	i;
-	int	daytotal;
-	int	yearday;
-	int	leapday;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose: %d\n",verbose);
-		fprintf(stderr,"dbg2       time_d:  %f\n",time_d);
-		}
-
-	/* get the date */
-	daytotal = (int) (time_d/SECINDAY);
-	time_i[3] = (int) ((time_d - daytotal*SECINDAY)/SECINHOUR);
-	time_i[4] = (int) ((time_d - daytotal*SECINDAY
-			- time_i[3]*SECINHOUR)/SECINMINUTE);
-	time_i[5] = (int) (time_d - daytotal*SECINDAY
-			- time_i[3]*SECINHOUR - time_i[4]*SECINMINUTE);
-	time_i[6] = (int) 1000000*(time_d - daytotal*SECINDAY
-			- time_i[3]*SECINHOUR - time_i[4]*SECINMINUTE
-			- time_i[5]);
-	time_i[0] = (int) (time_d/SECINYEAR) + 1970;
-	leapday = (time_i[0] - 1969)/4;
-	yearday = daytotal - 365*(time_i[0] - 1970) - leapday + 1;
-	if (yearday <= 0)
-		{
-		time_i[0]--;
-		leapday = (time_i[0] - 1969)/4;
-		yearday = daytotal - 365*(time_i[0] - 1970) - leapday + 1;
-		}
-	leapday = 0;
-	if (((time_i[0] % 4 == 0 && time_i[0] % 100 != 0)
-		|| time_i[0]%400 == 0)
-		&& yearday > yday[2])
-		leapday = 1;
-	for (i=0;i<12;i++)
-		if (yearday > (yday[i] + leapday))
-			time_i[1] = i + 1;
-	time_i[2] = yearday - yday[time_i[1]-1] - leapday;
-
-	/* assume success */
-	status = MB_SUCCESS;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\nMBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       year:    %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       month:   %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       day:     %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       hour:    %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       minute:  %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       second:  %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       microsec:%d\n",time_i[6]);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return success */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-/* 	function mb_get_date_string returns a string formated as:
- *          yyyy/mm/dd:hh:mm:ss.ssssss
- * 	from the number of seconds after 1/1/70 00:00:0 */
-int mb_get_date_string(int verbose, double time_d, char *string)
-{
-
-	char	*function_name = "mb_get_date_string";
-	int	status;
-	int	time_i[7];
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose: %d\n",verbose);
-		fprintf(stderr,"dbg2       time_d:  %f\n",time_d);
-		}
-
-	/* get the date */
-	mb_get_date(verbose, time_d, time_i);
-	sprintf(string, "%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d",
-		time_i[0], time_i[1], time_i[2], time_i[3],
-		time_i[4], time_i[5], time_i[6]);
-
-	/* assume success */
-	status = MB_SUCCESS;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\nMBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       string: %s\n",string);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return success */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-/* 	function mb_get_jtime returns the day of year calculated
- *	from (yy/mm/dd/hr/mi/sc). */
-int mb_get_jtime(int verbose, int time_i[7], int time_j[5])
-{
-	char	*function_name = "mb_get_jtime";
-	int	status;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       year:       %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       month:      %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       day:        %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       hour:       %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       minute:     %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       second:     %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       microsecond:%d\n",time_i[6]);
-		}
-
-	/* get time with day of year */
-	time_j[0] = time_i[0];
-	time_j[1] = yday[time_i[1]-1] + time_i[2];
-	if (((time_i[0] % 4 == 0 && time_i[0] % 100 != 0)
-		|| time_i[0] % 400 == 0)
-		&& (time_i[1] > 2))
-		time_j[1]++;
-	time_j[2] = time_i[3]*IMININHOUR + time_i[4];
-	time_j[3] = time_i[5];
-	time_j[4] = time_i[6];
-
-	/* assume success */
-	status = MB_SUCCESS;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       year:       %d\n",time_j[0]);
-		fprintf(stderr,"dbg2       day of year:%d\n",time_j[1]);
-		fprintf(stderr,"dbg2       minute:     %d\n",time_j[2]);
-		fprintf(stderr,"dbg2       second:     %d\n",time_j[3]);
-		fprintf(stderr,"dbg2       microsecond:%d\n",time_j[4]);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return success */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-/* 	function mb_get_itime returns the time in (yy/mm/dd/hr/mi/sc)
- *	calculated from the time in (yy/yd/hr/mi/sc) where yd is the
- *	day of the year.
- */
-int mb_get_itime(int verbose, int time_j[5], int time_i[7])
-{
-	char	*function_name = "mb_get_itime";
-	int	status;
-	int	leapday;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       year:       %d\n",time_j[0]);
-		fprintf(stderr,"dbg2       day of year:%d\n",time_j[1]);
-		fprintf(stderr,"dbg2       minute:     %d\n",time_j[2]);
-		fprintf(stderr,"dbg2       second:     %d\n",time_j[3]);
-		fprintf(stderr,"dbg2       microsecond:%d\n",time_j[4]);
-		}
-
-	/* get the date */
-	time_i[0] = time_j[0];
-	time_i[3] = time_j[2]/IMININHOUR;
-	time_i[4] = time_j[2] - time_i[3]*IMININHOUR;
-	time_i[5] = time_j[3];
-	time_i[6] = time_j[4];
-	if (((time_j[0] % 4 == 0 && time_j[0] % 100 != 0)
-		|| time_j[0] % 400 == 0)
-		&& time_j[1] > yday[2])
-		leapday = 1;
-	else
-		leapday = 0;
-	time_i[1] = 0;
-	for (i=0;i<12;i++)
-		if (time_j[1] > (yday[i] + leapday))
-			time_i[1] = i + 1;
-	if(leapday==1 && time_j[1] == yday[2]+1)
-		leapday=0;
-	time_i[2] = time_j[1] - yday[time_i[1]-1] - leapday;
-
-	/* assume success */
-	status = MB_SUCCESS;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       year:       %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       month:      %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       day:        %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       hour:       %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       minute:     %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       second:     %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       microsecond:%d\n",time_i[6]);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return success */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-/* 	function mb_fix_y2k translates a two digit year value
- *      into a four digit year value using the following rule:
- *          if (year_short >= 62)
- *		year_long = year_short + 1900;
- *          else
- *              year_long = year_short + 2000;
- *      The rationale for this rule is that multibeam sonars were
- *      patented and first built in 1962. Thus, no digital swath
- *      data can have timestamps dating prior to 1962.
- */
-int mb_fix_y2k(int verbose, int year_short, int *year_long)
-{
-	char	*function_name = "mb_fix_y2k";
-	int	status;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       year_short: %d\n",year_short);
-		}
-
-	/* get the four digit year value */
-	if (year_short >= 62)
-	    *year_long = year_short + 1900;
-	else
-	    *year_long = year_short + 2000;
-
-	/* assume success */
-	status = MB_SUCCESS;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       year_long:  %d\n",*year_long);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return success */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-/* 	function mb_unfix_y2k translates a four digit year value
- *      into a two digit year value using the following rule:
- *          if (year_long < 2000)
- *		year_short = year_long - 1900;
- *          else
- *              year_short = year_long - 2000;
- *      The rationale for this rule is that multibeam sonars were
- *      patented and first built in 1962. Thus, no digital swath
- *      data can have timestamps dating prior to 1962.
- *
- *      Of course, if you look below you will see that the
- *      same thing was accomplished using
- *          year_short = year_long % 100;
- */
-int mb_unfix_y2k(int verbose, int year_long, int *year_short)
-{
-	char	*function_name = "mb_unfix_y2k";
-	int	status;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       year_long:  %d\n",year_long);
-		}
-
-	/* get the two digit year value */
-	*year_short = year_long % 100;
-
-	/* assume success */
-	status = MB_SUCCESS;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       year_short: %d\n",*year_short);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return success */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mb_write_init.c b/src/mbio/mb_write_init.c
deleted file mode 100644
index fa47e41..0000000
--- a/src/mbio/mb_write_init.c
+++ /dev/null
@@ -1,679 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mb_write_init.c	1/25/93
- *    $Id: mb_write_init.c 2224 2015-02-04 19:14:05Z caress $
- *
- *    Copyright (c) 1993-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mb_write_init.c opens and initializes a multibeam data file
- * for writing with mb_write or mb_put.
- *
- * Author:	D. W. Caress
- * Date:	January 25, 1993
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mb_define.h"
-#include "mb_segy.h"
-#include "../surf/mb_sapi.h"
-#include "gsf.h"
-#include "netcdf.h"
-
-static char rcs_id[]="$Id: mb_write_init.c 2224 2015-02-04 19:14:05Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mb_write_init(int verbose,
-		char *file, int format, void **mbio_ptr,
-		int *beams_bath, int *beams_amp, int *pixels_ss,
-		int *error)
-{
-	char	*function_name = "mb_write_init";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	int	status_save;
-	int	error_save;
-	int	sapi_status;
-	char	*lastslash;
-	char	path[MB_PATH_MAXLINE], name[MB_PATH_MAXLINE];
-	int	i;
-	char	*stdout_string = "stdout";
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       file:       %s\n",file);
-		fprintf(stderr,"dbg2       format:     %d\n",format);
-		}
-
-	/* allocate memory for mbio descriptor */
-	status = mb_mallocd(verbose,__FILE__, __LINE__,sizeof(struct mb_io_struct),
-				(void **)mbio_ptr,error);
-	if (status == MB_SUCCESS)
-		{
-		memset(*mbio_ptr, 0, sizeof(struct mb_io_struct));
-		mb_io_ptr = (struct mb_io_struct *) *mbio_ptr;
-		}
-
-	/* set system byte order flag */
-	if (status == MB_SUCCESS)
-		{
-		mb_io_ptr->byteswapped = mb_swap_check();
-		}
-
-	/* get format information */
-	if (status == MB_SUCCESS)
-		{
-		status = mb_format_register(verbose, &format,
-					*mbio_ptr, error);
-		}
-
-	/* quit if there is a problem */
-	if (status == MB_FAILURE)
-		{
-			/* free memory for mbio descriptor */
-		if (mbio_ptr != NULL)
-			{
-			status_save = status;
-			error_save = *error;
-			status = mb_freed(verbose,__FILE__, __LINE__,(void **)mbio_ptr,error);
-			status = status_save;
-			*error = error_save;
-			}
-
-		/* output debug information */
-		if (verbose >= 2)
-			{
-			fprintf(stderr,"\ndbg2  MBIO function <%s> terminated with error\n",
-				function_name);
-			fprintf(stderr,"dbg2  Return values:\n");
-			fprintf(stderr,"dbg2       error:      %d\n",*error);
-			fprintf(stderr,"dbg2  Return status:\n");
-			fprintf(stderr,"dbg2       status:  %d\n",status);
-			}
-		return(status);
-		}
-
-	/* initialize file access for the mbio descriptor */
-	mb_io_ptr->filemode = MB_FILEMODE_WRITE;
-	mb_io_ptr->mbfp = NULL;
-	strcpy(mb_io_ptr->file,file);
-	mb_io_ptr->file_pos = 0;
-	mb_io_ptr->file_bytes = 0;
-	mb_io_ptr->mbfp2 = NULL;
-	strcpy(mb_io_ptr->file2,"\0");
-	mb_io_ptr->file2_pos = 0;
-	mb_io_ptr->file2_bytes = 0;
-	mb_io_ptr->mbfp3 = NULL;
-	strcpy(mb_io_ptr->file3,"\0");
-	mb_io_ptr->file3_pos = 0;
-	mb_io_ptr->file3_bytes = 0;
-	mb_io_ptr->ncid = 0;
-	mb_io_ptr->gsfid = 0;
-	mb_io_ptr->xdrs = NULL;
-	mb_io_ptr->xdrs2 = NULL;
-	mb_io_ptr->xdrs3 = NULL;
-
-	/* load control parameters into the mbio descriptor */
-	mb_io_ptr->format = format;
-	mb_io_ptr->pings = 0;
-	mb_io_ptr->lonflip = 0;
-	for (i=0;i<4;i++)
-		mb_io_ptr->bounds[i] = 0;
-	for (i=0;i<7;i++)
-		{
-		mb_io_ptr->btime_i[i] = 0;
-		mb_io_ptr->etime_i[i] = 0;
-		}
-	mb_io_ptr->speedmin = 0.0;
-	mb_io_ptr->timegap = 0.0;
-	mb_io_ptr->btime_d = 0.0;
-	mb_io_ptr->etime_d = 0.0;
-
-	/* set the number of beams */
-	*beams_bath = mb_io_ptr->beams_bath_max;
-	*beams_amp = mb_io_ptr->beams_amp_max;
-	*pixels_ss = mb_io_ptr->pixels_ss_max;
-	mb_io_ptr->new_beams_bath = 0;
-	mb_io_ptr->new_beams_amp = 0;
-	mb_io_ptr->new_pixels_ss = 0;
-	if (verbose >= 4)
-		{
-		fprintf(stderr,"\ndbg4  Beam and pixel dimensions set in MBIO function <%s>\n",
-				function_name);
-		fprintf(stderr,"dbg4       beams_bath: %d\n",
-			mb_io_ptr->beams_bath_max);
-		fprintf(stderr,"dbg4       beams_amp:  %d\n",
-			mb_io_ptr->beams_amp_max);
-		fprintf(stderr,"dbg4       pixels_ss:  %d\n",
-			mb_io_ptr->pixels_ss_max);
-		}
-
-	/* initialize pointers */
-	mb_io_ptr->raw_data = NULL;
-	mb_io_ptr->store_data = NULL;
-	mb_io_ptr->beamflag = NULL;
-	mb_io_ptr->bath = NULL;
-	mb_io_ptr->amp = NULL;
-	mb_io_ptr->bath_acrosstrack = NULL;
-	mb_io_ptr->bath_alongtrack = NULL;
-	mb_io_ptr->bath_num = NULL;
-	mb_io_ptr->amp_num = NULL;
-	mb_io_ptr->ss = NULL;
-	mb_io_ptr->ss_acrosstrack = NULL;
-	mb_io_ptr->ss_alongtrack = NULL;
-	mb_io_ptr->ss_num = NULL;
-	mb_io_ptr->new_beamflag = NULL;
-	mb_io_ptr->new_bath = NULL;
-	mb_io_ptr->new_amp = NULL;
-	mb_io_ptr->new_bath_acrosstrack = NULL;
-	mb_io_ptr->new_bath_alongtrack = NULL;
-	mb_io_ptr->new_ss = NULL;
-	mb_io_ptr->new_ss_acrosstrack = NULL;
-	mb_io_ptr->new_ss_alongtrack = NULL;
-
-	/* initialize projection parameters */
-	mb_io_ptr->projection_initialized = MB_NO;
-	mb_io_ptr->pjptr = NULL;
-
-	/* initialize ancillary variables used
-		to save information in certain cases */
-	mb_io_ptr->save_flag = MB_NO;
-	mb_io_ptr->save_label_flag = MB_NO;
-	mb_io_ptr->save1 = 0;
-	mb_io_ptr->save2 = 0;
-	mb_io_ptr->save3 = 0;
-	mb_io_ptr->save4 = 0;
-	mb_io_ptr->save5 = 0;
-	mb_io_ptr->save6 = 0;
-	mb_io_ptr->save7 = 0;
-	mb_io_ptr->save8 = 0;
-	mb_io_ptr->save9 = 0;
-	mb_io_ptr->save10 = 0;
-	mb_io_ptr->save11 = 0;
-	mb_io_ptr->save12 = 0;
-	mb_io_ptr->save13 = 0;
-	mb_io_ptr->save14 = 0;
-	mb_io_ptr->saved1 = 0;
-	mb_io_ptr->saved2 = 0;
-	mb_io_ptr->saved3 = 0;
-	mb_io_ptr->saved4 = 0;
-	mb_io_ptr->saved5 = 0;
-	mb_io_ptr->saveptr1 = NULL;
-	mb_io_ptr->saveptr2 = NULL;
-
-	/* allocate arrays */
-	mb_io_ptr->beams_bath_alloc = mb_io_ptr->beams_bath_max;
-	mb_io_ptr->beams_amp_alloc = mb_io_ptr->beams_amp_max;
-	mb_io_ptr->pixels_ss_alloc = mb_io_ptr->pixels_ss_max;
-	if (status == MB_SUCCESS)
-		status = mb_mallocd(verbose,__FILE__, __LINE__,mb_io_ptr->beams_bath_alloc*sizeof(char),
-				(void **)&mb_io_ptr->beamflag,error);
-	if (status == MB_SUCCESS)
-		status = mb_mallocd(verbose,__FILE__, __LINE__,mb_io_ptr->beams_bath_alloc*sizeof(double),
-				(void **)&mb_io_ptr->bath,error);
-	if (status == MB_SUCCESS)
-		status = mb_mallocd(verbose,__FILE__, __LINE__,mb_io_ptr->beams_amp_alloc*sizeof(double),
-				(void **)&mb_io_ptr->amp,error);
-	if (status == MB_SUCCESS)
-		status = mb_mallocd(verbose,__FILE__, __LINE__,mb_io_ptr->beams_bath_alloc*sizeof(double),
-				(void **)&mb_io_ptr->bath_acrosstrack,error);
-	if (status == MB_SUCCESS)
-		status = mb_mallocd(verbose,__FILE__, __LINE__,mb_io_ptr->beams_bath_alloc*sizeof(double),
-				(void **)&mb_io_ptr->bath_alongtrack,error);
-	if (status == MB_SUCCESS)
-		status = mb_mallocd(verbose,__FILE__, __LINE__,mb_io_ptr->beams_bath_alloc*sizeof(int),
-				(void **)&mb_io_ptr->bath_num,error);
-	if (status == MB_SUCCESS)
-		status = mb_mallocd(verbose,__FILE__, __LINE__,mb_io_ptr->beams_amp_alloc*sizeof(int),
-				(void **)&mb_io_ptr->amp_num,error);
-	if (status == MB_SUCCESS)
-		status = mb_mallocd(verbose,__FILE__, __LINE__,mb_io_ptr->pixels_ss_alloc*sizeof(double),
-				(void **)&mb_io_ptr->ss,error);
-	if (status == MB_SUCCESS)
-		status = mb_mallocd(verbose,__FILE__, __LINE__,mb_io_ptr->pixels_ss_alloc*sizeof(double),
-				(void **)&mb_io_ptr->ss_acrosstrack,error);
-	if (status == MB_SUCCESS)
-		status = mb_mallocd(verbose,__FILE__, __LINE__,mb_io_ptr->pixels_ss_alloc*sizeof(double),
-				(void **)&mb_io_ptr->ss_alongtrack,error);
-	if (status == MB_SUCCESS)
-		status = mb_mallocd(verbose,__FILE__, __LINE__,mb_io_ptr->pixels_ss_alloc*sizeof(int),
-				(void **)&mb_io_ptr->ss_num,error);
-	if (status == MB_SUCCESS)
-		status = mb_mallocd(verbose,__FILE__, __LINE__,mb_io_ptr->beams_bath_alloc*sizeof(char),
-				(void **)&mb_io_ptr->new_beamflag,error);
-	if (status == MB_SUCCESS)
-		status = mb_mallocd(verbose,__FILE__, __LINE__,mb_io_ptr->beams_bath_alloc*sizeof(double),
-				(void **)&mb_io_ptr->new_bath,error);
-	if (status == MB_SUCCESS)
-		status = mb_mallocd(verbose,__FILE__, __LINE__,mb_io_ptr->beams_amp_alloc*sizeof(double),
-				(void **)&mb_io_ptr->new_amp,error);
-	if (status == MB_SUCCESS)
-		status = mb_mallocd(verbose,__FILE__, __LINE__,mb_io_ptr->beams_bath_alloc*sizeof(double),
-				(void **)&mb_io_ptr->new_bath_acrosstrack,error);
-	if (status == MB_SUCCESS)
-		status = mb_mallocd(verbose,__FILE__, __LINE__,mb_io_ptr->beams_bath_alloc*sizeof(double),
-				(void **)&mb_io_ptr->new_bath_alongtrack,error);
-	if (status == MB_SUCCESS)
-		status = mb_mallocd(verbose,__FILE__, __LINE__,mb_io_ptr->pixels_ss_alloc*sizeof(double),
-				(void **)&mb_io_ptr->new_ss,error);
-	if (status == MB_SUCCESS)
-		status = mb_mallocd(verbose,__FILE__, __LINE__,mb_io_ptr->pixels_ss_alloc*sizeof(double),
-				(void **)&mb_io_ptr->new_ss_acrosstrack,error);
-	if (status == MB_SUCCESS)
-		status = mb_mallocd(verbose,__FILE__, __LINE__,mb_io_ptr->pixels_ss_alloc*sizeof(double),
-				(void **)&mb_io_ptr->new_ss_alongtrack,error);
-
-	/* call routine to allocate memory for format dependent i/o */
-	if (status == MB_SUCCESS)
-		status = (*mb_io_ptr->mb_io_format_alloc)(verbose,*mbio_ptr,error);
-
-	/* deal with a memory allocation failure */
-	if (status == MB_FAILURE)
-		{
-		status = mb_deall_ioarrays(verbose, mbio_ptr, error);
-		status = mb_freed(verbose,__FILE__, __LINE__,(void **)&mb_io_ptr,error);
-		mb_io_ptr->beams_bath_alloc = 0;
-		mb_io_ptr->beams_amp_alloc = 0;
-		mb_io_ptr->pixels_ss_alloc = 0;
-		status = MB_FAILURE;
-		*error = MB_ERROR_MEMORY_FAIL;
-		if (verbose >= 2)
-			{
-			fprintf(stderr,"\ndbg2  MBIO function <%s> terminated with error\n",
-				function_name);
-			fprintf(stderr,"dbg2  Return values:\n");
-			fprintf(stderr,"dbg2       error:      %d\n",*error);
-			fprintf(stderr,"dbg2  Return status:\n");
-			fprintf(stderr,"dbg2       status:  %d\n",status);
-			}
-		return(status);
-		}
-
-	/* handle normal or xdr files to be opened
-	   directly with fopen */
-	if (mb_io_ptr->filetype == MB_FILETYPE_NORMAL
-	    || mb_io_ptr->filetype == MB_FILETYPE_XDR)
-	    {
-	    /* open the first file */
-	    if (strncmp(file,stdout_string,6) == 0)
-		mb_io_ptr->mbfp = stdout;
-	    else
-		if ((mb_io_ptr->mbfp = fopen(mb_io_ptr->file, "wb")) == NULL)
-		    {
-		    *error = MB_ERROR_OPEN_FAIL;
-		    status = MB_FAILURE;
-		    }
-
-	    /* open the second file if required */
-	    if (status == MB_SUCCESS
-		&& mb_io_ptr->numfile >= 2)
-		{
-		if ((mb_io_ptr->mbfp2 = fopen(mb_io_ptr->file2, "wb")) == NULL)
-		    {
-		    *error = MB_ERROR_OPEN_FAIL;
-		    status = MB_FAILURE;
-		    }
-		}
-
-	    /* or open the second file if desired and possible */
-	    else if (status == MB_SUCCESS
-		&& mb_io_ptr->numfile <= -2)
-		mb_io_ptr->mbfp2 = fopen(mb_io_ptr->file2, "wb");
-
-	    /* open the third file if required */
-	    if (status == MB_SUCCESS
-		&& mb_io_ptr->numfile >= 3)
-		{
-		if ((mb_io_ptr->mbfp3 = fopen(mb_io_ptr->file3, "wb")) == NULL)
-		    {
-		    *error = MB_ERROR_OPEN_FAIL;
-		    status = MB_FAILURE;
-		    }
-		}
-
-	    /* or open the third file if desired and possible */
-	    else if (status == MB_SUCCESS
-		&& mb_io_ptr->numfile <= -3)
-		mb_io_ptr->mbfp3 = fopen(mb_io_ptr->file3, "wb");
-
-	    /* if needed, initialize XDR stream */
-	    if (status == MB_SUCCESS && mb_io_ptr->filetype == MB_FILETYPE_XDR)
-		{
-		status = mb_mallocd(verbose,__FILE__, __LINE__,sizeof(XDR),
-				(void **)&mb_io_ptr->xdrs,error);
-		if (status == MB_SUCCESS)
-		    {
-		    xdrstdio_create((XDR *)mb_io_ptr->xdrs,
-			    mb_io_ptr->mbfp, XDR_ENCODE);
-		    }
-		else
-		    {
-		    status = MB_FAILURE;
-		    *error = MB_ERROR_MEMORY_FAIL;
-		    }
-		}
-
-	    /* if needed, initialize second XDR stream */
-	    if (status == MB_SUCCESS
-		&& mb_io_ptr->filetype == MB_FILETYPE_XDR
-		&& (mb_io_ptr->numfile >= 2 || mb_io_ptr->numfile <= -2)
-		&& mb_io_ptr->mbfp2 != NULL)
-		{
-		status = mb_mallocd(verbose,__FILE__, __LINE__,sizeof(XDR),
-				(void **)&mb_io_ptr->xdrs2,error);
-		if (status == MB_SUCCESS)
-		    {
-		    xdrstdio_create((XDR *)mb_io_ptr->xdrs2,
-			    mb_io_ptr->mbfp2, XDR_ENCODE);
-		    }
-		else
-		    {
-		    status = MB_FAILURE;
-		    *error = MB_ERROR_MEMORY_FAIL;
-		    }
-		}
-
-	    /* if needed, initialize third XDR stream */
-	    if (status == MB_SUCCESS
-		&& mb_io_ptr->filetype == MB_FILETYPE_XDR
-		&& (mb_io_ptr->numfile >= 3 || mb_io_ptr->numfile <= -3)
-		&& mb_io_ptr->mbfp3 != NULL)
-		{
-		status = mb_mallocd(verbose,__FILE__, __LINE__,sizeof(XDR),
-				(void **)&mb_io_ptr->xdrs3,error);
-		if (status == MB_SUCCESS)
-		    {
-		    xdrstdio_create((XDR *)mb_io_ptr->xdrs3,
-			    mb_io_ptr->mbfp3, XDR_ENCODE);
-		    }
-		else
-		    {
-		    status = MB_FAILURE;
-		    *error = MB_ERROR_MEMORY_FAIL;
-		    }
-		}
-	    }
-
-	/* else handle single normal files to be opened with mb_fileio_open() */
-	else if (mb_io_ptr->filetype == MB_FILETYPE_SINGLE)
-	    {
-	    status = mb_fileio_open(verbose, *mbio_ptr, error);
-	    }
-
-	/* else handle gsf files to be opened with gsflib */
-	else if (mb_io_ptr->filetype == MB_FILETYPE_GSF)
-	    {
-	    status = gsfOpen(mb_io_ptr->file,
-				GSF_CREATE,
-				(int *) &(mb_io_ptr->gsfid));
-	    if (status == 0)
-		{
-		status = MB_SUCCESS;
-		*error = MB_ERROR_NO_ERROR;
-		}
-	    else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_OPEN_FAIL;
-		}
-	    }
-
-	/* else handle netcdf files to be opened with libnetcdf */
-	else if (mb_io_ptr->filetype == MB_FILETYPE_NETCDF)
-	    {
-	    status = nc_create(mb_io_ptr->file,
-				NC_CLOBBER,
-				(int *) &(mb_io_ptr->ncid));
-	    if (status == 0)
-		{
-		status = MB_SUCCESS;
-		*error = MB_ERROR_NO_ERROR;
-		}
-	    else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_OPEN_FAIL;
-		}
-	    }
-
-	/* else handle surf files to be opened with libsapi */
-	else if (mb_io_ptr->filetype == MB_FILETYPE_SURF)
-	    {
-	    lastslash = strrchr(file, '/');
-	    if (lastslash != NULL && strlen(lastslash) > 1)
-	    	{
-		strcpy(name,&(lastslash[1]));
-		strcpy(path,file);
-		path[strlen(file) - strlen(lastslash)] = '\0';
-		}
-	    else if (strlen(file) > 0)
-	    	{
-		strcpy(path, ".");
-		strcpy(name, file);
-		}
-	    else
-	     	{
-		status = MB_FAILURE;
-		*error = MB_ERROR_OPEN_FAIL;
-		}
-	    if (status == MB_SUCCESS)
-	    	{
-		if (strcmp(&name[strlen(name)-4],".sda") == 0)
-			name[strlen(name)-4] = '\0';
-		else if (strcmp(&name[strlen(name)-4],".SDA") == 0)
-			name[strlen(name)-4] = '\0';
-		else if (strcmp(&name[strlen(name)-4],".six") == 0)
-			name[strlen(name)-4] = '\0';
-		else if (strcmp(&name[strlen(name)-4],".SIX") == 0)
-			name[strlen(name)-4] = '\0';
-	    	sapi_status = SAPI_open(path,name,verbose);
-	    	if (sapi_status == 0)
-			{
-			status = MB_SUCCESS;
-			*error = MB_ERROR_NO_ERROR;
-			}
-	    	else
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_OPEN_FAIL;
-			}
-		}
-	    else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_OPEN_FAIL;
-		}
-	    }
-
-	/* else handle segy files to be opened with mb_segy */
-	else if (mb_io_ptr->filetype == MB_FILETYPE_SEGY)
-	    {
-	    status = mb_segy_write_init(verbose, mb_io_ptr->file,
-		NULL, NULL, (void **)&(mb_io_ptr->mbfp), error);
-	    if (status != MB_SUCCESS)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_OPEN_FAIL;
-		}
-	    }
-
-	/* if error terminate */
-	if (status == MB_FAILURE)
-		{
-		/* save status and error values */
-		status_save = status;
-		error_save = *error;
-
-		/* free allocated memory */
-		if (mb_io_ptr->filetype == MB_FILETYPE_XDR
-		    && mb_io_ptr->xdrs != NULL)
-			status = mb_freed(verbose,__FILE__, __LINE__,(void **)&mb_io_ptr->xdrs,error);
-		if (mb_io_ptr->filetype == MB_FILETYPE_XDR
-		    && mb_io_ptr->xdrs2 != NULL)
-			status = mb_freed(verbose,__FILE__, __LINE__,(void **)&mb_io_ptr->xdrs2,error);
-		if (mb_io_ptr->filetype == MB_FILETYPE_XDR
-		    && mb_io_ptr->xdrs3 != NULL)
-			status = mb_freed(verbose,__FILE__, __LINE__,(void **)&mb_io_ptr->xdrs3,error);
-		status = mb_freed(verbose,__FILE__, __LINE__,(void **)&mb_io_ptr->beamflag,error);
-		status = mb_freed(verbose,__FILE__, __LINE__,(void **)&mb_io_ptr->bath,error);
-		status = mb_freed(verbose,__FILE__, __LINE__,(void **)&mb_io_ptr->amp,error);
-		status = mb_freed(verbose,__FILE__, __LINE__,(void **)&mb_io_ptr->bath_acrosstrack,
-						error);
-		status = mb_freed(verbose,__FILE__, __LINE__,(void **)&mb_io_ptr->bath_alongtrack,
-						error);
-		status = mb_freed(verbose,__FILE__, __LINE__,(void **)&mb_io_ptr->bath_num,error);
-		status = mb_freed(verbose,__FILE__, __LINE__,(void **)&mb_io_ptr->amp_num,error);
-		status = mb_freed(verbose,__FILE__, __LINE__,(void **)&mb_io_ptr->ss,error);
-		status = mb_freed(verbose,__FILE__, __LINE__,(void **)&mb_io_ptr->ss_acrosstrack,
-						error);
-		status = mb_freed(verbose,__FILE__, __LINE__,(void **)&mb_io_ptr->ss_alongtrack,
-						error);
-		status = mb_freed(verbose,__FILE__, __LINE__,(void **)&mb_io_ptr->ss_num,error);
-		status = mb_freed(verbose,__FILE__, __LINE__,(void **)&mb_io_ptr->new_beamflag,error);
-		status = mb_freed(verbose,__FILE__, __LINE__,(void **)&mb_io_ptr->new_bath,error);
-		status = mb_freed(verbose,__FILE__, __LINE__,(void **)&mb_io_ptr->new_amp,error);
-		status = mb_freed(verbose,__FILE__, __LINE__,(void **)&
-					mb_io_ptr->new_bath_acrosstrack,error);
-		status = mb_freed(verbose,__FILE__, __LINE__,(void **)&mb_io_ptr->new_bath_alongtrack,
-					error);
-		status = mb_freed(verbose,__FILE__, __LINE__,(void **)&mb_io_ptr->new_ss,error);
-		status = mb_freed(verbose,__FILE__, __LINE__,(void **)&mb_io_ptr->new_ss_acrosstrack,
-					error);
-		status = mb_freed(verbose,__FILE__, __LINE__,(void **)&mb_io_ptr->new_ss_alongtrack,
-					error);
-		status = mb_freed(verbose,__FILE__, __LINE__,(void **)&mb_io_ptr,error);
-
-		/* restore error and status values */
-		if (status == MB_SUCCESS)
-			{
-			status = status_save;
-			*error = error_save;
-			}
-
-		/* output debug message */
-		if (verbose >= 2)
-			{
-			fprintf(stderr,"\ndbg2  MBIO function <%s> terminated with error\n",
-					function_name);
-			fprintf(stderr,"dbg2  Return values:\n");
-			fprintf(stderr,"dbg2       error:      %d\n",*error);
-			fprintf(stderr,"dbg2  Return status:\n");
-			fprintf(stderr,"dbg2       status:  %d\n",status);
-			}
-		return(status);
-		}
-
-	/* initialize the working variables */
-	mb_io_ptr->ping_count = 0;
-	mb_io_ptr->nav_count = 0;
-	mb_io_ptr->comment_count = 0;
-	mb_io_ptr->pings_avg = 1;
-	mb_io_ptr->pings_read = 0;
-	mb_io_ptr->error_save = MB_ERROR_NO_ERROR;
-	mb_io_ptr->last_time_d = 0.0;
-	mb_io_ptr->last_lon = 0.0;
-	mb_io_ptr->last_lat = 0.0;
-	mb_io_ptr->old_time_d = 0.0;
-	mb_io_ptr->old_lon = 0.0;
-	mb_io_ptr->old_lat = 0.0;
-	mb_io_ptr->old_ntime_d = 0.0;
-	mb_io_ptr->old_nlon = 0.0;
-	mb_io_ptr->old_nlat = 0.0;
-	mb_io_ptr->time_d = 0.0;
-	mb_io_ptr->lon = 0.0;
-	mb_io_ptr->lat = 0.0;
-	mb_io_ptr->speed = 0.0;
-	mb_io_ptr->heading = 0.0;
-	for (i=0;i<mb_io_ptr->beams_bath_max;i++)
-		{
-		mb_io_ptr->beamflag[i] = MB_FLAG_NULL;
-		mb_io_ptr->bath[i] = 0.0;
-		mb_io_ptr->bath_acrosstrack[i] = 0.0;
-		mb_io_ptr->bath_alongtrack[i] = 0.0;
-		mb_io_ptr->bath_num[i] = 0;
-		}
-	for (i=0;i<mb_io_ptr->beams_amp_max;i++)
-		{
-		mb_io_ptr->amp[i] = 0.0;
-		mb_io_ptr->amp_num[i] = 0;
-		}
-	for (i=0;i<mb_io_ptr->pixels_ss_max;i++)
-		{
-		mb_io_ptr->ss[i] = 0.0;
-		mb_io_ptr->ss_acrosstrack[i] = 0.0;
-		mb_io_ptr->ss_alongtrack[i] = 0.0;
-		mb_io_ptr->ss_num[i] = 0;
-		}
-	mb_io_ptr->need_new_ping = MB_YES;
-
-	/* initialize variables for interpolating asynchronous data */
-	mb_io_ptr->nfix = 0;
-	mb_io_ptr->nattitude = 0;
-	mb_io_ptr->nheading = 0;
-	mb_io_ptr->nsonardepth = 0;
-	mb_io_ptr->naltitude = 0;
-	for (i=0;i<MB_ASYNCH_SAVE_MAX;i++)
-		{
-		mb_io_ptr->fix_time_d[i] = 0.0;
-		mb_io_ptr->fix_lon[i] = 0.0;
-		mb_io_ptr->fix_lat[i] = 0.0;
-		mb_io_ptr->attitude_time_d[i] = 0.0;
-		mb_io_ptr->attitude_heave[i] = 0.0;
-		mb_io_ptr->attitude_roll[i] = 0.0;
-		mb_io_ptr->attitude_pitch[i] = 0.0;
-		mb_io_ptr->heading_time_d[i] = 0.0;
-		mb_io_ptr->heading_heading[i] = 0.0;
-		mb_io_ptr->sonardepth_time_d[i] = 0.0;
-		mb_io_ptr->sonardepth_sonardepth[i] = 0.0;
-		mb_io_ptr->altitude_time_d[i] = 0.0;
-		mb_io_ptr->altitude_altitude[i] = 0.0;
-		}
-
-	/* initialize notices */
-	for (i=0;i<MB_NOTICE_MAX;i++)
-		mb_io_ptr->notice_list[i] = 0;
-
-	/* set error and status (if you got here you succeeded */
-	*error = MB_ERROR_NO_ERROR;
-	status = MB_SUCCESS;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)*mbio_ptr);
-		fprintf(stderr,"dbg2       beams_bath: %d\n",*beams_bath);
-		fprintf(stderr,"dbg2       beams_amp:  %d\n",*beams_amp);
-		fprintf(stderr,"dbg2       pixels_ss:  %d\n",*pixels_ss);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mb_write_ping.c b/src/mbio/mb_write_ping.c
deleted file mode 100644
index a1e8d8d..0000000
--- a/src/mbio/mb_write_ping.c
+++ /dev/null
@@ -1,187 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mb_write_ping.c	2/3/93
- *	$Id: mb_write_ping.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1993-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mb_write_ping.c calls the appropriate mbr_ routine for writing
- * the next ping to a multibeam data file.  The current ping data
- * must be in the "new_" variables in the mbio structure pointed
- * to by mbio_ptr.
- *
- * Author:	D. W. Caress
- * Date:	Febrary 3, 1993
- * $Log: mb_write_ping.c,v $
- * Revision 5.3  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.2  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.1  2001/07/20 00:31:11  caress
- * Release 5.0.beta03
- *
- * Revision 5.0  2000/12/01 22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.22  2000/10/11  01:02:30  caress
- * Convert to ANSI C
- *
- * Revision 4.21  2000/09/30  06:32:11  caress
- * Snapshot for Dale.
- *
- * Revision 4.20  1999/10/21  22:38:36  caress
- * Added MBPRONAV format.
- *
- * Revision 4.19  1999/08/08  04:12:45  caress
- * Added ELMK2XSE format.
- *
- * Revision 4.18  1999/07/16  19:24:15  caress
- * Yet another version.
- *
- * Revision 4.17  1999/03/31  18:11:35  caress
- * MB-System 4.6beta7
- *
- * Revision 4.16  1999/01/01  23:41:06  caress
- * MB-System version 4.6beta6
- *
- * Revision 4.15  1998/12/17  23:01:15  caress
- * MB-System version 4.6beta4
- *
- * Revision 4.14  1998/10/05  17:46:15  caress
- * MB-System version 4.6beta
- *
- * Revision 4.13  1997/09/15  19:06:40  caress
- * Real Version 4.5
- *
- * Revision 4.12  1997/07/25  14:19:53  caress
- * Version 4.5beta2.
- * Much mucking, particularly with Simrad formats.
- *
- * Revision 4.11  1997/04/21  17:02:07  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.11  1997/04/17  15:07:36  caress
- * MB-System 4.5 Beta Release
- *
- * Revision 4.10  1996/08/26  17:24:56  caress
- * Release 4.4 revision.
- *
- * Revision 4.9  1996/08/05  15:21:58  caress
- * Just redid i/o for Simrad sonars, including adding EM12S and EM121 support.
- *
- * Revision 4.8  1996/04/22  13:21:19  caress
- * Now have DTR and MIN/MAX defines in mb_define.h
- *
- * Revision 4.7  1996/04/22  10:57:09  caress
- * DTR define now in mb_io.h
- *
- * Revision 4.6  1996/03/12  17:21:55  caress
- * Added format 63, short HMR1 processing format.
- *
- * Revision 4.5  1996/01/26  21:23:30  caress
- * Version 4.3 distribution
- *
- * Revision 4.4  1995/09/28  18:10:48  caress
- * Various bug fixes working toward release 4.3.
- *
- * Revision 4.3  1995/03/06  19:38:54  caress
- * Changed include strings.h to string.h for POSIX compliance.
- *
- * Revision 4.2  1994/10/21  12:11:53  caress
- * Release V4.0
- *
- * Revision 4.1  1994/07/29  18:46:51  caress
- * Changes associated with supporting Lynx OS (byte swapped) and
- * using unix second time base (for time_d values).
- *
- * Revision 4.0  1994/03/06  00:01:56  caress
- * First cut at version 4.0
- *
- * Revision 4.3  1994/03/05  22:51:44  caress
- * Added ability to handle Simrad EM12 system and
- * format MBF_EM12DARW.
- *
- * Revision 4.2  1994/03/05  02:09:29  caress
- * Altered to add MBF_SB2100RW format.
- *
- * Revision 4.1  1994/03/03  03:39:43  caress
- * Fixed copyright message.
- *
- * Revision 4.0  1994/02/20  01:57:11  caress
- * First cut of new version.
- *
- * Revision 3.0  1993/05/14  22:48:53  sohara
- * installed in rcs
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mb_define.h"
-
-static char rcs_id[]="$Id: mb_write_ping.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mb_write_ping(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mb_write_ping";
-	int	status;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* call the appropriate mbr_ write and translate routine */
-	if (mb_io_ptr->mb_io_write_ping != NULL)
-		{
-		status = (*mb_io_ptr->mb_io_write_ping)(verbose,mbio_ptr,store_ptr,error);
-		}
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_BAD_FORMAT;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mbf_bchrtunb.h b/src/mbio/mbf_bchrtunb.h
deleted file mode 100644
index 8388143..0000000
--- a/src/mbio/mbf_bchrtunb.h
+++ /dev/null
@@ -1,216 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbf_bchrtunb.h	8/21/94
- *	$Id: mbf_bchrtunb.h 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1994-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbf_bchrtunb.h defines the data structures used by MBIO functions
- * to store multibeam data read from the MBF_BCHRTUNB format (MBIO id 91).
- *
- * Author:	D. W. Caress
- * Date:	August 21, 1994
- * $Log: mbf_bchrtunb.h,v $
- * Revision 5.2  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.1  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.0  2000/12/01 22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.5  2000/09/30  06:29:44  caress
- * Snapshot for Dale.
- *
- * Revision 4.4  1998/10/05  17:46:15  caress
- * MB-System version 4.6beta
- *
- * Revision 4.3  1997/09/15  19:06:40  caress
- * Real Version 4.5
- *
- * Revision 4.2  1997/04/21  17:02:07  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.1  1995/07/13  19:15:09  caress
- * Intermediate check-in during major bug-fixing flail.
- *
- * Revision 4.1  1995/07/13  19:15:09  caress
- * Intermediate check-in during major bug-fixing flail.
- *
- * Revision 4.0  1994/10/21  12:35:02  caress
- * Release V4.0
- *
- * Revision 1.1  1994/10/21  12:20:01  caress
- * Initial revision
- *
- * Revision 1.1  1994/10/21  12:13:33  caress
- * Initial revision
- *
- *
- *
- */
-/*
- * Notes on the MBF_BCHRTUNB data format:
- *   1. Elac multibeam systems output binary data telegrams.
- *   2. Elac BottomChart sonar systems output both bathymetry
- *      and amplitude information for up to 56 beams per telegram.
- *   3. Each ping produces 8 beams.  A wide swath is constructed
- *      by successively pinging in different directions.
- *   4. Each telegram is preceded by a two byte start code and
- *      followed by a three byte end code consisting of 0x03
- *      followed by two bytes representing the checksum for
- *      the data bytes.  MB-System does not calculate checksums
- *      and puts 0's in the checksum bytes.
- *   5. The relevent telegram start codes, types, and sizes are:
- *         0x0250: Comment (Defined only for MB-System)   200 data bytes
- *         0x0251: Position                                36 data bytes
- *         0x0252: Parameter                               56 data bytes
- *         0x0253: Sound velocity profile                2016 data bytes
- *         0x0254: BottomChart 56 beam bathymetry         848 data bytes
- *         0x0255: BottomChart 40 beam bathymetry         608 data bytes
- *         0x0256: BottomChart 32 beam bathymetry         488 data bytes
- *   6. Elac systems record navigation fixes using the position
- *      telegram; navigation is not always included in the per ping data.
- *      Since speed is not recorded, it is impossible to extrapolate
- *      position from the last navigation fix when processing the
- *      data serially, as MBIO does.  It may thus be necessary to extract
- *      the navigation from the position telegrams and remerge it with
- *      the ping telegrams using the program mbmerge.
- *
- */
-
-/* maximum number of beams and pixels */
-#define	MBF_BCHRTUNB_MAXBEAMS	56
-#define	MBF_BCHRTUNB_COMMENT_LENGTH	200
-
-struct mbf_bchrtunb_profile_struct
-	{
-	int	year;
-	int	month;
-	int	day;
-	int	hour;
-	int	minute;
-	int	second;
-	int	hundredth_sec;
-	int	thousandth_sec;
-	int	latitude;		/* 180 deg = 2*pi*e9 */
-	int	longitude;		/* 180 deg = 2*pi*e9 */
-	int	roll;			/* 0.005 degrees */
-	int	pitch;			/* 0.005 degrees */
-	int	heading;		/* PI/180 degrees */
-	int	heave;			/* 0.001 meters */
-	short bath[8];		/* depths:  0.01 meters */
-	short int bath_acrosstrack[8];
-				/* acrosstrack distances: 0.01 meters */
-	short int bath_alongtrack[8];
-				/* alongtrack distances: 0.01 meters */
-	short int tt[8];	/* travel times:         0.05 msec */
-	short int angle[8];	/* 0.005 degrees */
-	short int quality[8];	/* 1 (good) to 8 (bad)
-				    extension:	10: flag by manual edit
-						20: flag by filter edit */
-	short int amp[8];	/* ??? */
-
-	};
-
-struct mbf_bchrtunb_struct
-	{
-	/* type of data record */
-	int	kind;			/* Data vs Comment */
-
-	/* type of sonar */
-	int	sonar;			/* Type of Elac sonar */
-
-	/* parameter info (parameter telegrams) */
-	int	par_year;
-	int	par_month;
-	int	par_day;
-	int	par_hour;
-	int	par_minute;
-	int	par_second;
-	int	par_hundredth_sec;
-	int	par_thousandth_sec;
-	short	roll_offset;	/* roll offset (degrees) */
-	short	pitch_offset;	/* pitch offset (degrees) */
-	short	heading_offset;	/* heading offset (degrees) */
-	short	time_delay;	/* positioning system delay (sec) */
-	short	transducer_port_height;
-	short	transducer_starboard_height;
-	short	transducer_port_depth;
-	short	transducer_starboard_depth;
-	short	transducer_port_x;
-	short	transducer_starboard_x;
-	short	transducer_port_y;
-	short	transducer_starboard_y;
-	short	transducer_port_error;
-	short	transducer_starboard_error;
-	short	antenna_height;
-	short	antenna_x;
-	short	antenna_y;
-	short	vru_height;
-	short	vru_x;
-	short	vru_y;
-	short	heave_offset;
-	short	line_number;
-	short	start_or_stop;
-	short	transducer_serial_number;
-
-	/* comment */
-	char	comment[MBF_BCHRTUNB_COMMENT_LENGTH];
-
-	/* position (position telegrams) */
-	int	pos_year;
-	int	pos_month;
-	int	pos_day;
-	int	pos_hour;
-	int	pos_minute;
-	int	pos_second;
-	int	pos_hundredth_sec;
-	int	pos_thousandth_sec;
-	int	pos_latitude;		/* 180 deg = 2e9 */
-	int	pos_longitude;		/* 180 deg = 2e9 */
-	unsigned int	utm_northing;
-	unsigned int	utm_easting;
-	int	utm_zone_lon;		/* 180 deg = 2e9 */
-	char	utm_zone;
-	char	hemisphere;
-	char	ellipsoid;
-	char	pos_spare;
-	int	semi_major_axis;
-	int	other_quality;
-
-	/* sound velocity profile */
-	int	svp_year;
-	int	svp_month;
-	int	svp_day;
-	int	svp_hour;
-	int	svp_minute;
-	int	svp_second;
-	int	svp_hundredth_sec;
-	int	svp_thousandth_sec;
-	int	svp_latitude;		/* 180 deg = 2e9 */
-	int	svp_longitude;		/* 180 deg = 2e9 */
-	int	svp_num;
-	int	svp_depth[500]; /* 0.1 meters */
-	int	svp_vel[500];	/* 0.1 meters/sec */
-
-	/* bathymetry */
-	int	ping_num;
-	int	sound_vel;
-	int	mode;
-	int	pulse_length;
-	int	source_power;
-	int	receiver_gain;
-	int	profile_num;	/* number of profiles stored */
-	int	beams_bath;	/* number of beams stored */
-	struct mbf_bchrtunb_profile_struct profile[7];
-	};
diff --git a/src/mbio/mbf_bchrxunb.h b/src/mbio/mbf_bchrxunb.h
deleted file mode 100644
index fa5fa2c..0000000
--- a/src/mbio/mbf_bchrxunb.h
+++ /dev/null
@@ -1,204 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbf_bchrxunb.h	8/29/97
- *	$Id: mbf_bchrxunb.h 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1997-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbf_bchrxunb.h defines the data structures used by MBIO functions
- * to store multibeam data read from the MBF_BCHRXUNB format (MBIO id 92).
- *
- * Author:	D. W. Caress
- * Date:	August 29, 1997
- * $Log: mbf_bchrxunb.h,v $
- * Revision 5.2  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.1  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.0  2000/12/01 22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.2  2000/09/30  06:29:44  caress
- * Snapshot for Dale.
- *
- * Revision 4.1  1998/10/05  17:46:15  caress
- * MB-System version 4.6beta
- *
- * Revision 4.0  1997/09/15  19:09:17  caress
- * Real Version 4.5
- *
- * Revision 1.1  1997/09/15  19:06:40  caress
- * Initial revision
- *
- *
- */
-/*
- * Notes on the MBF_BCHRXUNB data format:
- *   1. Elac multibeam systems output binary data telegrams.
- *      This format differs from the original "UNB" format in
- *      that the depth values are in 4-byte rather than 2-byte
- *      integers. This "extended" format supports deeper depths
- *      than the original format.
- *   2. Elac BottomChart sonar systems output both bathymetry
- *      and amplitude information for up to 56 beams per telegram.
- *   3. Each ping produces 8 beams.  A wide swath is constructed
- *      by successively pinging in different directions.
- *   4. Each telegram is preceded by a two byte start code and
- *      followed by a three byte end code consisting of 0x03
- *      followed by two bytes representing the checksum for
- *      the data bytes.  MB-System does not calculate checksums
- *      and puts 0's in the checksum bytes.
- *   5. The relevent telegram start codes, types, and sizes are:
- *         0x0250: Comment (Defined only for MB-System)   200 data bytes
- *         0x0251: Position                                36 data bytes
- *         0x0252: Parameter                               54 data bytes
- *         0x0253: Sound velocity profile                2016 data bytes
- *         0x0254: BottomChart 56 beam bathymetry         848 data bytes
- *         0x0255: BottomChart 40 beam bathymetry         608 data bytes
- *         0x0256: BottomChart 32 beam bathymetry         488 data bytes
- *   6. Elac systems record navigation fixes using the position
- *      telegram; navigation is not always included in the per ping data.
- *      Since speed is not recorded, it is impossible to extrapolate
- *      position from the last navigation fix when processing the
- *      data serially, as MBIO does.  It may thus be necessary to extract
- *      the navigation from the position telegrams and remerge it with
- *      the ping telegrams using the program mbmerge.
- *
- */
-
-/* maximum number of beams and pixels */
-#define	MBF_BCHRXUNB_MAXBEAMS	56
-#define	MBF_BCHRXUNB_COMMENT_LENGTH	200
-
-struct mbf_bchrxunb_profile_struct
-	{
-	int	year;
-	int	month;
-	int	day;
-	int	hour;
-	int	minute;
-	int	second;
-	int	hundredth_sec;
-	int	thousandth_sec;
-	int	latitude;		/* 180 deg = 2*pi*e9 */
-	int	longitude;		/* 180 deg = 2*pi*e9 */
-	int	roll;			/* 0.005 degrees */
-	int	pitch;			/* 0.005 degrees */
-	int	heading;		/* PI/180 degrees */
-	int	heave;			/* 0.001 meters */
-	int	bath[8];		/* depths:  0.01 meters */
-	int	bath_acrosstrack[8];
-				/* acrosstrack distances: 0.01 meters */
-	short int bath_alongtrack[8];
-				/* alongtrack distances: 0.01 meters */
-	short int tt[8];	/* travel times:         0.05 msec */
-	short int angle[8];	/* 0.005 degrees */
-	short int quality[8];	/* 1 (good) to 8 (bad)
-				    extension:	10: flag by manual edit
-						20: flag by filter edit */
-	short int amp[8];	/* ??? */
-
-	};
-
-struct mbf_bchrxunb_struct
-	{
-	/* type of data record */
-	int	kind;			/* Data vs Comment */
-
-	/* type of sonar */
-	int	sonar;			/* Type of Elac sonar */
-
-	/* parameter info (parameter telegrams) */
-	int	par_year;
-	int	par_month;
-	int	par_day;
-	int	par_hour;
-	int	par_minute;
-	int	par_second;
-	int	par_hundredth_sec;
-	int	par_thousandth_sec;
-	short	roll_offset;	/* roll offset (degrees) */
-	short	pitch_offset;	/* pitch offset (degrees) */
-	short	heading_offset;	/* heading offset (degrees) */
-	short	time_delay;	/* positioning system delay (sec) */
-	short	transducer_port_height;
-	short	transducer_starboard_height;
-	short	transducer_port_depth;
-	short	transducer_starboard_depth;
-	short	transducer_port_x;
-	short	transducer_starboard_x;
-	short	transducer_port_y;
-	short	transducer_starboard_y;
-	short	transducer_port_error;
-	short	transducer_starboard_error;
-	short	antenna_height;
-	short	antenna_x;
-	short	antenna_y;
-	short	vru_height;
-	short	vru_x;
-	short	vru_y;
-	short	heave_offset;
-	short	line_number;
-	short	start_or_stop;
-	short	transducer_serial_number;
-
-	/* comment */
-	char	comment[MBF_BCHRXUNB_COMMENT_LENGTH];
-
-	/* position (position telegrams) */
-	int	pos_year;
-	int	pos_month;
-	int	pos_day;
-	int	pos_hour;
-	int	pos_minute;
-	int	pos_second;
-	int	pos_hundredth_sec;
-	int	pos_thousandth_sec;
-	int	pos_latitude;		/* 180 deg = 2e9 */
-	int	pos_longitude;		/* 180 deg = 2e9 */
-	unsigned int	utm_northing;
-	unsigned int	utm_easting;
-	int	utm_zone_lon;		/* 180 deg = 2e9 */
-	char	utm_zone;
-	char	hemisphere;
-	char	ellipsoid;
-	char	pos_spare;
-	int	semi_major_axis;
-	int	other_quality;
-
-	/* sound velocity profile */
-	int	svp_year;
-	int	svp_month;
-	int	svp_day;
-	int	svp_hour;
-	int	svp_minute;
-	int	svp_second;
-	int	svp_hundredth_sec;
-	int	svp_thousandth_sec;
-	int	svp_latitude;		/* 180 deg = 2e9 */
-	int	svp_longitude;		/* 180 deg = 2e9 */
-	int	svp_num;
-	int	svp_depth[500]; /* 0.1 meters */
-	int	svp_vel[500];	/* 0.1 meters/sec */
-
-	/* bathymetry */
-	int	ping_num;
-	int	sound_vel;
-	int	mode;
-	int	pulse_length;
-	int	source_power;
-	int	receiver_gain;
-	int	profile_num;	/* number of profiles stored */
-	int	beams_bath;	/* number of beams stored */
-	struct mbf_bchrxunb_profile_struct profile[7];
-	};
diff --git a/src/mbio/mbf_cbat8101.h b/src/mbio/mbf_cbat8101.h
deleted file mode 100644
index 32c2f78..0000000
--- a/src/mbio/mbf_cbat8101.h
+++ /dev/null
@@ -1,547 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbf_cbat8101.h	8/21/94
- *	$Id: mbf_cbat8101.h 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1998-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbf_cbat8101.h defines the data structures used by MBIO functions
- * to store multibeam data read from the MBF_CBAT8101 format (MBIO id 82).
- *
- * Author:	D. W. Caress
- * Date:	December 10, 1998
- *
- * $Log: mbf_cbat8101.h,v $
- * Revision 5.2  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.1  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.0  2000/12/01 22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.1  2000/09/30  06:29:44  caress
- * Snapshot for Dale.
- *
- * Revision 4.0  1999/01/01  23:38:01  caress
- * MB-System version 4.6beta6
- *
- *
- */
-/*
- * Notes on the MBF_CBAT8101 data format:
- *   1. Reson SeaBat products are high frequency,
- *      shallow water multibeam sonars.
- *      Reson SeaBat 8101 systems output both bathymetry
- *      and amplitude information for 60 beams.
- *      Reson SeaBat 8101 systems output both bathymetry
- *      and amplitude information for up to 101 beams.
- *      These sonars use fixed, analog beamforming followed
- *      by a combination of amplitude and phase bottom
- *      detection.
- *   2. Reson multibeam systems output raw range and amplitude
- *      data in a binary format. The data acquisition systems
- *      associated with the sonars calculate bathymetry using
- *      a water sound velocity, roll, pitch, and heave data.
- *   3. Generally, Reson data acquisition systems record
- *      navigation asynchronously in the data stream, without
- *      providing speed information. This means that the
- *      navigation must be interpolated on the fly as the
- *      data is read.
- *   4. The navigation is frequently provided in projected
- *      coordinates (eastings and northings) rather than in
- *      longitude and latitude. Since MB-System operates solely
- *      in longitude and latitude, the original navigation must
- *      be unprojected.
- *   5. The Reson data formats supported by MB-System include:
- *        MBF_CBAT8101 - a binary format designed by John Hughes Clarke
- *           of the University of New Brunswick. Parameter and
- *           sound velocity profile records are included.
- *        MBF_CBAT8101 - a clone of the above format supporting
- *           Reson 8101 data.
- *        MBF_HYPC8101 - the ASCII format used by the HYPACK system
- *           of Coastal Oceanographics in conjunction with
- *           Reson 8101 data. This format is supported as read-only
- *           by MB-System.
- *        MBF_GSFGENMB - the generic sensor format of SAIC which
- *           supports data from a large number of sonars, including
- *           Reson sonars. MB-System handles GSF separately from
- *           other formats.
- *   6. For the UNB-style formats MBF_CBAT8101 and MBF_CBAT8101,
- *      each data telegram is preceded by a two byte start code and
- *      followed by a three byte end code consisting of 0x03
- *      followed by two bytes representing the checksum for
- *      the data bytes.  MB-System does not calculate checksums
- *      and puts 0's in the checksum bytes.
- *      The relevent telegram start codes, types, and sizes are:
- *         0x0240: Comment***                             200 data bytes
- *         0x0241: Position                                36 data bytes
- *         0x0242: Parameter                               44 data bytes
- *         0x0243: Sound velocity profile                2016 data bytes
- *         0x0244: SeaBat 9001 bathymetry                 752 data bytes
- *         0x0245: Short sound velocity profile           816 data bytes
- *         0x0246: SeaBat 8101 bathymetry***             1244 data bytes
- *         0x0247: Heading***                             752 data bytes
- *         0x0248: Attitude***                            752 data bytes
- *            *** Defined only for MB-System
- *   7. For the ASCII HYPACK format, the following information
- *      is take verbatim from Coastal Oceanographics documentation:
- *
- *        Coastal Oceanographics, Inc.
- *        Technical Note: Hypack Raw Data Format
- *
- *        Data collected by the Hypack Survey program is recorded
- *        in Raw format, one file per survey line. Raw files are
- *        recorded as text, allowing them to be loaded into any
- *        text editor that reads large files (Windows Notepad, Write
- *        and Wordpad for example).
- *
- *        When inspecting raw files, one of the first things noticed
- *        is that the format is not tabular. That is, there is not a record for
- *        each sounding containing depth, position, tide corrections,
- *        etc. Instead, there are separate records for each device
- *        measurement and the correlation between measurements is
- *        through time tags.
- *
- *        Every raw file contains two section; a header, which is
- *        written when data logging starts, and a data section, which is
- *        written as data is collected. Each record starts with a
- *        three character tag. The tags are:
- *
- *        Header
- *        ------
- *        DEV - Device Information
- *        EOH - End of Header
- *        EOL - End of Planned Line
- *        FTP - File Type
- *        INF - General Information
- *        LBP - Planned Line Begin Point
- *        LIN - Planned Line Data follows
- *        LNN - Planned Line Name
- *        OFF - Device Offsets
- *        PRD - Private Device Data
- *        PRI - Primary Navigation Device
- *        PTS - Planned Line Waypoint
- *        TND - Survey Time and Date
- *
- *        Data
- *        ----
- *        FIX - Fix (Event) Mark
- *        HCP - Heave Compensation
- *        EC1 - Echo Sounding (single frequency)
- *        EC2 - Echo Sounding (dual frequency)
- *        ECM - Echo Soundings (multiple transducer system)
- *        GYR - Gyro Data (Heading)
- *        POS - Position
- *        ROX - Roxann data
- *        SB2 - Multibeam data
- *
- *        --------------
- *        Header Section
- *        --------------
- *
- *        DEV - Device Information
- *        ------------------------
- *        DEV dn dc "Device Name"
- *        dn: Device Number
- *        dc: Device Capabilities is a bit coded field. The bit definitions are:
- *        Bit Mask Meaning
- *        0 1 Device provides Range/Range positions
- *        1 2 Device provides Range/Azimuth positions
- *        2 4 Device provides Lat/Long (e.g. GPS)
- *        3 8 Device provides grid positions XY
- *        4 16 Device provides echo soundings
- *        5 32 Device provides heading
- *        6 64 Device provides ship speed
- *        7 128 Hypack clock is synched to device clock
- *        8 256 Device provides tides
- *        9 512 Device provides heave, pitch and roll
- *        10 1024 Device is an ROV
- *        11 2048 Device is a Left/Right Indicator
- *        12 4096 Device accepts annotation strings
- *        13 8192 Device accepts output from Hypack
- *        14 16384 xxx
- *        15 32768 Device has extended capabilities
- *
- *        Example:
- *        DEV 0 100 "GPS"
- *
- *        INF - General Information
- *        -------------------------
- *        INF "surveyor" "boat" "project" "area" tc dc sv
- *        tc: initial tide correction
- *        dc: initial draft correction
- *        sv: sound velocity
- *
- *        Example:
- *        INF "steve" "LCH 19" "mcmillen" "617.6 to 618.2" -0.7 0 1500.0
- *
- *        EOH - End of Header
- *        -------------------
- *        This tag simply indicates end of header and has no data.
- *
- *        EOL - End of Planned Line
- *        -------------------------
- *        This tag simply indicates end of planned line information no data.
- *
- *        LBP - Planned Line Begin Point.
- *        -------------------------------
- *        LBP x y
- *        x: x grid position
- *        y: y grid position
- *
- *        Example:
- *        LBP 5567222.42 3771640.72
- *
- *        LIN - Planned Line Data follows
- *        -------------------------------
- *        LIN nw
- *        nw: Number of waypoints
- *
- *        Example:
- *        LIN 5
- *
- *        LNN - Planned Line Name
- *        -----------------------
- *        LNN text
- *        text: line name or number
- *
- *        Example:
- *        LNN 14
- *
- *        OFF - Device Offsets
- *        --------------------
- *        OFF dn n1 n2 n3 n4 n5 n6 n7
- *        dn: device number
- *        n1: starboard, port offset. Positive starboard.
- *        n2: forward, aft offset. Positive forward
- *        n3: height (antenna) or depth (transducer draft) offset. Always positive.
- *        n4: yaw rotation angle. Positive for clockwise rotation.
- *        n5: roll rotation angle. Port side up is positive.
- *        n6: pitch rotation angle. Bow up is positive.
- *        n7: device latency in seconds.
- *
- *        Example:
- *        OFF 0 0 0 13.35 0 0 0 0.86
- *
- *        PRD - Private Device Data
- *        -------------------------
- *        PRD - Multiple transducer offset
- *        PRD dn OFF n1 n2 n3
- *        dn: device number
- *        n1: transducer starboard offset
- *        n2: transducer forward offset
- *        n3: transducer depth offset (draft)
- *
- *        Example:
- *        PRD 1 OFF -25.60 0.00 0.40
- *
- *        PRD - Odom Echoscan II Multibeam Identifier
- *        -------------------------------------------
- *        PRD dn ECHOSCN2 n1 n2
- *        dn: device number
- *        n1: Not used
- *        n2: Beam width
- *
- *        Example:
- *        PRD 1 ECHOSCN2 -43.5 3.0
- *
- *        PRD - Reson Seabat 9001 Multibeam Identifier
- *        --------------------------------------------
- *        PRD dn SEABAT n1 n2
- *        dn: device number
- *        n1: Not used
- *        n2: Beam width
- *
- *        Example:
- *        PRD 1 SEABAT -44.2 1.5
- *
- *        PRD - Reson Seabat 9003 Multibeam Identifier
- *        --------------------------------------------
- *        PRD dn SEA9003 n1 n2
- *        dn: device number
- *        n1: Not used
- *        n2: Beam width
- *
- *        Example:
- *        PRD 1 SEA9003 -60.0 3.0
- *
- *        PRD - Reson Seabat 8101 Multibeam Identifier
- *        --------------------------------------------
- *        PRD dn SEA8101 n1 n2 n3
- *        dn: device number
- *        n1: Beam 1 angle
- *        n2: Angle increment
- *        n3: Number of beams
- *
- *        Example:
- *        PRD 1 SEA8101 -75.00 1.50 101
- *
- *        PRI - Primary Navigation Device
- *        -------------------------------
- *        PRI dn
- *        dn: device number
- *
- *        Example:
- *        PRI 0
- *
- *        PTS - Planned Line Waypoint
- *        ---------------------------
- *        PTS x y
- *        x: waypoint easting
- *        y: waypoint northing
- *
- *        Example:
- *        PTS 5569134.63 3774182.61
- *
- *        TND - Survey Time and Date
- *        --------------------------
- *        TND t d
- *        t: time string
- *        d: date string
- *
- *        Example:
- *        TND 15:54:33 08/28/95
- *
- *        --------------------------
- *        Data Section
- *        --------------------------
- *
- *        FIX - Fix (Event) Mark
- *        ----------------------
- *        FIX n
- *        n: event number
- *
- *        Example:
- *        FIX 152
- *
- *        HCP - Heave Compensation
- *        ------------------------
- *        HCP dn t h r p
- *        dn: device number
- *        t: time tag (seconds past midnight)
- *        h: heave in meters
- *        r: roll in degrees (+ port side up)
- *        p: pitch in degrees (+ bow up)
- *
- *        Example:
- *        HCP 2 57273.81 0 3.61 0
- *
- *        EC1 - Echo Sounding (single frequency)
- *        --------------------------------------
- *        EC1 dn t rd
- *        dn: device number
- *        t: time tag (seconds past midnight)
- *        rd: raw depth
- *
- *        Example:
- *        EC1 0 48077.365 3.20
- *
- *        EC2 - Echo Sounding (dual frequency)
- *        ------------------------------------
- *        EC2 dn t rd1 rd2
- *        dn: device number
- *        t: time tag (seconds past midnight)
- *        rd1: raw depth 1
- *        rd2: raw depth 2
- *
- *        Example:
- *        EC2 0 48077.365 3.20 3.15
- *
- *        ECM - Echo Soundings (multiple transducer system)
- *        -------------------------------------------------
- *        ECM dn t n rd1 rd2 ... rdn
- *        dn: device number
- *        t: time tag (seconds past midnight)
- *        n: number of transducers
- *        rd1: raw depth 1
- *        rd2: raw depth 2
- *        ...
- *        rdn: raw depth, transducer n
- *
- *        Example:
- *        ECM 1 57274.82 9 11 10.8 10.7 11.4 11.8 13 15.1 15.5 15.6
- *
- *        GYR - Gyro Data (Heading)
- *        -------------------------
- *        GYR dn t h
- *        dn: device number
- *        t: time tag (seconds past midnight)
- *        h: ship heading angle
- *
- *        Example:
- *        GYR 0 57274.04 193
- *
- *        POS - Position
- *        --------------
- *        POS dn t x y
- *        dn: device number
- *        t: time tag (seconds past midnight)
- *        x: easting
- *        y: northing
- *
- *        Example:
- *        POS 0 57274.04 5569070.02 3774080.46
- *
- *        ROX - Roxann data
- *        -----------------
- *        ROX dn t n e1 e2
- *        dn: device number
- *        t: time tag (seconds past midnight)
- *        n: number of values to follow (always 2)
- *        e1: roxann e1 measurement
- *        e2: roxann e2 measurement
- *
- *        Example:
- *        ROX 2 48077.474 2 0.03 0.13
- *
- *        SB2 - Multibeam data
- *        --------------------
- *        SB2 dn t n sv r1 r2 r3 ... rn q1 q2 ... qn
- *        dn: device number
- *        t: time tag (seconds past midnight)
- *        n: number of values to follow. Depends on device type.
- *        sv: sound velocity from device.
- *        r1-n: ranges in device units.
- *        q1-n: quality codes (0 to 3 range, 0=bad). Packed 4 per number.
- *
- *        Example (Echoscan II):
- *        SB2 1 48077.474 39 1500.00 19.50 19.31 ...
- *
- *        Example (Seabat 9001):
- *        SB2 1 48077.474 76 1500.00 19.50 19.31 ...
- *
- *        Example (Seabat 9003):
- *        SB2 1 48077.474 51 1500.00 19.50 19.31 ...
- *
- *        Example (Seabat 8101 using 101 beams):
- *        SB2 1 48077.474 51 1500.00 19.50 19.31 ...
- *
- */
-
-/* maximum number of beams and pixels */
-#define	MBF_CBAT8101_MAXBEAMS	101
-#define	MBF_CBAT8101_COMMENT_LENGTH	200
-
-struct mbf_cbat8101_struct
-	{
-	/* type of data record */
-	int	kind;			/* Data vs Comment */
-
-	/* type of sonar */
-	int	sonar;			/* Type of Reson sonar */
-
-	/* parameter info (parameter telegrams) */
-	int	par_year;
-	int	par_month;
-	int	par_day;
-	int	par_hour;
-	int	par_minute;
-	int	par_second;
-	int	par_hundredth_sec;
-	int	par_thousandth_sec;
-	short	roll_offset;	/* roll offset (degrees) */
-	short	pitch_offset;	/* pitch offset (degrees) */
-	short	heading_offset;	/* heading offset (degrees) */
-	short	time_delay;	/* positioning system delay (sec) */
-	short	transducer_depth;	/* tranducer depth (meters) */
-	short	transducer_height;	/* reference height (meters) */
-	short	transducer_x;	/* reference fore-aft offset (meters) */
-	short	transducer_y;	/* reference athwartships offset (meters) */
-	short	antenna_x;	/* antenna athwartships offset (meters) */
-	short	antenna_y;	/* antenna athwartships offset (meters) */
-	short	antenna_z;	/* antenna height (meters) */
-	short	motion_sensor_x;/* motion sensor athwartships offset (meters) */
-	short	motion_sensor_y;/* motion sensor athwartships offset (meters) */
-	short	motion_sensor_z;/* motion sensor height offset (meters) */
-	short	spare;
-	short	line_number;
-	short	start_or_stop;
-	short	transducer_serial_number;
-
-	/* comment */
-	char	comment[MBSYS_RESON_COMMENT_LENGTH];
-
-	/* position (position telegrams) */
-	int	pos_year;
-	int	pos_month;
-	int	pos_day;
-	int	pos_hour;
-	int	pos_minute;
-	int	pos_second;
-	int	pos_hundredth_sec;
-	int	pos_thousandth_sec;
-	int	pos_latitude;		/* 180 deg = 2e9 */
-	int	pos_longitude;		/* 180 deg = 2e9 */
-	int	utm_northing;		/* 0.01 m */
-	int	utm_easting;		/* 0.01 m */
-	int	utm_zone_lon;		/* 180 deg = 2e9 */
-	char	utm_zone;
-	char	hemisphere;
-	char	ellipsoid;
-	char	pos_spare;
-	int	semi_major_axis;
-	int	other_quality;
-
-	/* sound velocity profile */
-	int	svp_year;
-	int	svp_month;
-	int	svp_day;
-	int	svp_hour;
-	int	svp_minute;
-	int	svp_second;
-	int	svp_hundredth_sec;
-	int	svp_thousandth_sec;
-	int	svp_latitude;		/* 180 deg = 2e9 */
-	int	svp_longitude;		/* 180 deg = 2e9 */
-	int	svp_num;
-	int	svp_depth[500]; /* 0.1 meters */
-	int	svp_vel[500];	/* 0.1 meters/sec */
-
-	/* bathymetry */
-	int	year;
-	int	month;
-	int	day;
-	int	hour;
-	int	minute;
-	int	second;
-	int	hundredth_sec;
-	int	thousandth_sec;
-	int	latitude;		/* 180 deg = 2e9 */
-	int	longitude;		/* 180 deg = 2e9 */
-	int	roll;			/* 0.005 degrees */
-	int	pitch;			/* 0.005 degrees */
-	int	heading;		/* 0.01 degrees */
-	int	heave;			/* 0.001 meters */
-	int	ping_number;
-	int	sound_vel;	/* 0.1 meters/sec */
-	int	mode;		/* unused */
-	int	gain1;		/* unused */
-	int	gain2;		/* unused */
-	int	gain3;		/* unused */
-	int	beams_bath;
-	short bath[MBSYS_RESON_MAXBEAMS];
-				/* depths:  0.01 meters */
-	short int bath_acrosstrack[MBSYS_RESON_MAXBEAMS];
-				/* acrosstrack distances: 0.01 meters */
-	short int bath_alongtrack[MBSYS_RESON_MAXBEAMS];
-				/* alongtrack distances: 0.01 meters */
-	short int tt[MBSYS_RESON_MAXBEAMS];
-				/* travel times:         0.05 msec */
-	short int angle[MBSYS_RESON_MAXBEAMS];
-				/* 0.005 degrees */
-	short int quality[MBSYS_RESON_MAXBEAMS];
-				/* 0 (bad) to 3 (good) */
-	short int amp[MBSYS_RESON_MAXBEAMS];
-				/* ??? */
-
-	};
diff --git a/src/mbio/mbf_cbat9001.h b/src/mbio/mbf_cbat9001.h
deleted file mode 100644
index fdbbfa8..0000000
--- a/src/mbio/mbf_cbat9001.h
+++ /dev/null
@@ -1,233 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbf_cbat9001.h	8/21/94
- *	$Id: mbf_cbat9001.h 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1994-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbf_cbat9001.h defines the data structures used by MBIO functions
- * to store multibeam data read from the MBF_CBAT9001 format (MBIO id 81).
- *
- * Author:	D. W. Caress
- * Date:	August 21, 1994
- * $Log: mbf_cbat9001.h,v $
- * Revision 5.2  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.1  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.0  2000/12/01 22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.4  2000/09/30  06:29:44  caress
- * Snapshot for Dale.
- *
- * Revision 4.3  1999/01/01  23:41:06  caress
- * MB-System version 4.6beta6
- *
- * Revision 4.2  1998/10/05 17:46:15  caress
- * MB-System version 4.6beta
- *
- * Revision 4.1  1997/04/21  17:02:07  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.0  1994/10/21  12:35:04  caress
- * Release V4.0
- *
- * Revision 4.0  1994/10/21  12:35:04  caress
- * Release V4.0
- *
- * Revision 1.1  1994/10/21  12:20:01  caress
- * Initial revision
- *
- * Revision 1.1  1994/10/21  12:13:33  caress
- * Initial revision
- *
- *
- *
- */
-/*
- * Notes on the MBF_CBAT9001 data format:
- *   1. Reson SeaBat products are high frequency,
- *      shallow water multibeam sonars.
- *      Reson SeaBat 9001 systems output both bathymetry
- *      and amplitude information for 60 beams.
- *      Reson SeaBat 8101 systems output both bathymetry
- *      and amplitude information for up to 128 beams.
- *      These sonars use fixed, analog beamforming followed
- *      by a combination of amplitude and phase bottom
- *      detection.
- *   2. Reson multibeam systems output raw range and amplitude
- *      data in a binary format. The data acquisition systems
- *      associated with the sonars calculate bathymetry using
- *      a water sound velocity, roll, pitch, and heave data.
- *   3. Generally, Reson data acquisition systems record
- *      navigation asynchronously in the data stream, without
- *      providing speed information. This means that the
- *      navigation must be interpolated on the fly as the
- *      data is read.
- *   4. The navigation is frequently provided in projected
- *      coordinates (eastings and northings) rather than in
- *      longitude and latitude. Since MB-System operates solely
- *      in longitude and latitude, the original navigation must
- *      be unprojected.
- *   5. The Reson data formats supported by MB-System include:
- *        MBF_CBAT9001 - a binary format designed by John Hughes Clarke
- *           of the University of New Brunswick. Parameter and
- *           sound velocity profile records are included.
- *        MBF_CBAT8101 - a clone of the above format supporting
- *           Reson 8101 data.
- *        MBF_HYPC8101 - the ASCII format used by the HYPACK system
- *           of Coastal Oceanographics in conjunction with
- *           Reson 8101 data. This format is supported as read-only
- *           by MB-System.
- *        MBF_GSFGENMB - the generic sensor format of SAIC which
- *           supports data from a large number of sonars, including
- *           Reson sonars. MB-System handles GSF separately from
- *           other formats.
- *   6. For the UNB-style formats MBF_CBAT9001 and MBF_CBAT8101,
- *      each data telegram is preceded by a two byte start code and
- *      followed by a three byte end code consisting of 0x03
- *      followed by two bytes representing the checksum for
- *      the data bytes.  MB-System does not calculate checksums
- *      and puts 0's in the checksum bytes.
- *      The relevent telegram start codes, types, and sizes are:
- *         0x0240: Comment***                             200 data bytes
- *         0x0241: Position                                36 data bytes
- *         0x0242: Parameter                               44 data bytes
- *         0x0243: Sound velocity profile                2016 data bytes
- *         0x0244: SeaBat 9001 bathymetry                 752 data bytes
- *         0x0245: Short sound velocity profile           816 data bytes
- *         0x0246: SeaBat 8101 bathymetry***             1244 data bytes
- *         0x0247: Heading***                             752 data bytes
- *         0x0248: Attitude***                            752 data bytes
- *            *** Defined only for MB-System
- *
- */
-
-/* maximum number of beams and pixels */
-#define	MBF_CBAT9001_MAXBEAMS	60
-#define	MBF_CBAT9001_COMMENT_LENGTH	200
-
-struct mbf_cbat9001_struct
-	{
-	/* type of data record */
-	int	kind;			/* Data vs Comment */
-
-	/* type of sonar */
-	int	sonar;			/* Type of Reson sonar */
-
-	/* parameter info (parameter telegrams) */
-	int	par_year;
-	int	par_month;
-	int	par_day;
-	int	par_hour;
-	int	par_minute;
-	int	par_second;
-	int	par_hundredth_sec;
-	int	par_thousandth_sec;
-	short	roll_offset;	/* roll offset (degrees) */
-	short	pitch_offset;	/* pitch offset (degrees) */
-	short	heading_offset;	/* heading offset (degrees) */
-	short	time_delay;	/* positioning system delay (sec) */
-	short	transducer_depth;	/* tranducer depth (meters) */
-	short	transducer_height;	/* reference height (meters) */
-	short	transducer_x;	/* reference fore-aft offset (meters) */
-	short	transducer_y;	/* reference athwartships offset (meters) */
-	short	antenna_x;	/* antenna athwartships offset (meters) */
-	short	antenna_y;	/* antenna athwartships offset (meters) */
-	short	antenna_z;	/* antenna height (meters) */
-	short	motion_sensor_x;/* motion sensor athwartships offset (meters) */
-	short	motion_sensor_y;/* motion sensor athwartships offset (meters) */
-	short	motion_sensor_z;/* motion sensor height offset (meters) */
-	short	spare;
-	short	line_number;
-	short	start_or_stop;
-	short	transducer_serial_number;
-
-	/* comment */
-	char	comment[MBSYS_RESON_COMMENT_LENGTH];
-
-	/* position (position telegrams) */
-	int	pos_year;
-	int	pos_month;
-	int	pos_day;
-	int	pos_hour;
-	int	pos_minute;
-	int	pos_second;
-	int	pos_hundredth_sec;
-	int	pos_thousandth_sec;
-	int	pos_latitude;		/* 180 deg = 2e9 */
-	int	pos_longitude;		/* 180 deg = 2e9 */
-	unsigned int	utm_northing;
-	unsigned int	utm_easting;
-	int	utm_zone_lon;		/* 180 deg = 2e9 */
-	char	utm_zone;
-	char	hemisphere;
-	char	ellipsoid;
-	char	pos_spare;
-	int	semi_major_axis;
-	int	other_quality;
-
-	/* sound velocity profile */
-	int	svp_year;
-	int	svp_month;
-	int	svp_day;
-	int	svp_hour;
-	int	svp_minute;
-	int	svp_second;
-	int	svp_hundredth_sec;
-	int	svp_thousandth_sec;
-	int	svp_latitude;		/* 180 deg = 2e9 */
-	int	svp_longitude;		/* 180 deg = 2e9 */
-	int	svp_num;
-	int	svp_depth[500]; /* 0.1 meters */
-	int	svp_vel[500];	/* 0.1 meters/sec */
-
-	/* bathymetry */
-	int	year;
-	int	month;
-	int	day;
-	int	hour;
-	int	minute;
-	int	second;
-	int	hundredth_sec;
-	int	thousandth_sec;
-	int	latitude;		/* 180 deg = 2e9 */
-	int	longitude;		/* 180 deg = 2e9 */
-	int	roll;			/* 0.005 degrees */
-	int	pitch;			/* 0.005 degrees */
-	int	heading;		/* 0.01 degrees */
-	int	heave;			/* 0.001 meters */
-	int	ping_number;
-	int	sound_vel;	/* 0.1 meters/sec */
-	int	mode;		/* unused */
-	int	gain1;		/* unused */
-	int	gain2;		/* unused */
-	int	gain3;		/* unused */
-	int	beams_bath;
-	short bath[MBSYS_RESON_MAXBEAMS];
-				/* depths:  0.01 meters */
-	short int bath_acrosstrack[MBSYS_RESON_MAXBEAMS];
-				/* acrosstrack distances: 0.01 meters */
-	short int bath_alongtrack[MBSYS_RESON_MAXBEAMS];
-				/* alongtrack distances: 0.01 meters */
-	short int tt[MBSYS_RESON_MAXBEAMS];
-				/* travel times:         0.05 msec */
-	short int angle[MBSYS_RESON_MAXBEAMS];
-				/* 0.005 degrees */
-	short int quality[MBSYS_RESON_MAXBEAMS];
-				/* 0 (bad) to 3 (good) */
-	short int amp[MBSYS_RESON_MAXBEAMS];
-				/* ??? */
-
-	};
diff --git a/src/mbio/mbf_dsl120pf.h b/src/mbio/mbf_dsl120pf.h
deleted file mode 100644
index 75924bb..0000000
--- a/src/mbio/mbf_dsl120pf.h
+++ /dev/null
@@ -1,190 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbf_dsl120pf.h	8/5/96
- *	$Id: mbf_dsl120pf.h 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1994-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbf_dsl120pf.h defines the data structures used by MBIO functions
- * to store data in the MBF_DSL120PF format (MBIO id 111).
- * These data are collected using the WHOI DSL AMS-120, a 120 khz
- * deep-towed sonar which produces both sidescan and bathymetry.
- * The data formats used to store the DSL AMS-120 data are:
- *      MBF_DSL120PF : MBIO ID 111
- *      MBF_DSL120SF : MBIO ID 112
- *
- *
- * Author:	D. W. Caress
- * Date:	August 5, 1996
- * $Log: mbf_dsl120pf.h,v $
- * Revision 5.3  2006/09/11 18:55:52  caress
- * Changes during Western Flyer and Thomas Thompson cruises, August-September
- * 2006.
- *
- * Revision 5.2  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.1  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.0  2000/12/01 22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.3  2000/09/30  06:29:44  caress
- * Snapshot for Dale.
- *
- * Revision 4.2  1998/10/05  18:32:27  caress
- * MB-System version 4.6beta
- *
- * Revision 4.1  1997/04/21  17:02:07  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.1  1997/04/21  17:02:07  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.1  1997/04/17  15:07:36  caress
- * MB-System 4.5 Beta Release
- *
- * Revision 4.0  1996/08/26  17:29:56  caress
- * Release 4.4 revision.
- *
- * Revision 1.1  1996/08/26  17:24:56  caress
- * Initial revision
- *
- *
- */
-/*
- * Notes on the MBF_DSL120PF data format:
- *   1. The DSL processing system used a parallel file scheme
- *      in which bathymetry, sidescan, and navigation are kept
- *      in separate files. Some examples of the filenames are:
- *         DSL120.940630_1100.bat.dat	- bathymetry
- *         DSL120.940630_1100.amp.dat	- sidescan
- *         DSL120.940630_1100.nav	- navigation
- *   2. The DSL parallel file scheme is supported under MB-System
- *      data format 111 (MBF_DSL120PF); a single file scheme is
- *      supported under data format 112 (MBF_DSL120SF). The
- *      single file scheme is within the DSL format specification.
- *   3. The bathymetry and sidescan data are stored in binary
- *      data structures; the navigation is stored in ASCII.
- *   4. The DSL format supports arbitrary numbers of bathymetry
- *      and sidescan values. The MB-System implementation has
- *      maximum numbers of values hardwired in the #defines
- *      below.
- *   5. The bathymetry and sidescan data have navigation
- *      fields,  but these navigation values typically repeat
- *      for many pings, often being the same for entire files.
- *      The separate navigation files contain the post-processed
- *      navigation with distinct values for each ping.
- *   6. The original navigation values supplied by WHOI/DSL
- *      so far are in projected eastings and northings rather
- *      than in longitude and latitude. Since MB-System only
- *      works with longitude and latitude, a special program
- *      will need to be used to translate the navigation to
- *      longitude and latitude.
- *   7. Due to the above problem, the following scheme will
- *      be used to handle MBF_DSL120DT data in MB-System:
- *        a) Run a perl macro called mbdslnavfix on the
- *           DSL120.*.nav files,  producing DSL.*.mbnav
- *           files in a format understood by mbmerge.
- *        b) Run mbmerge on the DSL120.*.bat.dat and DSL120.*.amp.dat
- *           files to merge the navigation from the DSL120.*.mbnav
- *           in with the bathymetry and sidescan data.
- *   8. The parallel file structure is difficult to deal with
- *      in the MB-System world where programs expect a single
- *      input and a single output file name. Handling the two
- *      files (bat.dat and amp.dat) will be handled in low level
- *      i/o routines. If the input file name has a "bat" in it,
- *      the code will attempt to open a second file with the
- *      same name except that "amp" is substituted for "bat".
- *      If the specified input file has "amp" in it,  then the
- *      second file will have "bat". The same will be true for
- *      the output files.
- *   9. The comment records reside only in the "bat" files in
- *      the parallel file scheme of format 111.
- *      The comment records are an MB-System extension to the
- *      DSL format. The program mbcopy can be used to strip
- *      the comments out of the data files prior to reusing
- *      DSL processing software.
- *
- */
-
-/* maximum number of beams and pixels */
-#define	MBF_DSL120PF_MAXBEAMS_SIDE	    1024
-#define	MBF_DSL120PF_MAXBEAMS	    2 * MBF_DSL120PF_MAXBEAMS_SIDE
-#define	MBF_DSL120PF_MAXPIXELS_SIDE    4096
-#define	MBF_DSL120PF_MAXPIXELS	    2 * MBF_DSL120PF_MAXPIXELS_SIDE
-#define	MBF_DSL120PF_COMMENT_LENGTH	80
-
-/* internal data structure */
-struct mbf_dsl120pf_struct
-	{
-	/* type of data record */
-	int	kind;			/* Data vs Comment */
-
-	/* record header */
-	int	rec_type;		/* always "DSL " */
-	int	rec_len;
-	int	rec_hdr_len;
-	unsigned int p_flags;		/* processing flags */
-	int	num_data_types;		/* number of data types in rec */
-   	int	ping;			/* ping number */
-   	char	sonar_cmd[4];		/* sonar parameters */
-   	char	time_stamp[24];		/* ascii event time */
-  	float	nav_x;			/* x position */
-   	float	nav_y;			/* y position */
-   	float	depth;			/* depth - meters */
-   	float	heading;		/* heading of vehicle - degrees */
-   	float	pitch;			/* pitch - degrees */
-   	float	roll;			/* roll - degrees */
-   	float	alt;			/* altitude - meters */
-   	float	ang_offset;	 	/* pointing ang relative to nose - deg*/
-   	int	transmit_pwr;  		/* transmit power decibels */
-   	int	gain_port;		/* db - not sure if belongs here */
-   	int	gain_starbd;		/* db - not sure if belongs here */
-   	float	pulse_width;		/* pulse width */
-   	int	swath_width;		/* meters */
-   	char	side;			/* 0 - port, 1 - stbd for fwd scan */
-   	char	swapped;		/* data,header: 00-PC 01-SunHdr 11-Sun*/
-	int	tv_sec;			/* seconds */
-	int	tv_usec;		/* and microseconds */
-   	short	digitalinterface;	/* digital interface: 0,1,or 2 -
-					 * must be specified in config file */
-    	short reserved[5];
-
-	/* bathymetry record */
-	int	bat_type;		/* always "BATH" */
-	int	bat_len;
-	int	bat_hdr_len;
-	int	bat_num_bins;
-	float	bat_sampleSize;
-	unsigned int bat_p_flags;
-	float	bat_max_range; /* meters */
-	int	bat_future[9];
-	float	bat_port[MBF_DSL120PF_MAXBEAMS_SIDE];
-	float	bat_stbd[MBF_DSL120PF_MAXBEAMS_SIDE];
-
-	/* amplitude record */
-	int	amp_type;		/* always "AMP " */
-	int	amp_len;
-	int	amp_hdr_len;
-	int	amp_num_samp;
-	float	amp_sampleSize;
-	unsigned int amp_p_flags; /* offset/slr, ... */
-	float	amp_max_range; /* meters */
-	int	amp_channel;     /* 1-upper/0-lower */
-	int	amp_future[8];
-	float	amp_port[MBF_DSL120PF_MAXPIXELS];
-	float	amp_stbd[MBF_DSL120PF_MAXPIXELS_SIDE];
-
-	/* comment */
-	char	comment[MBF_DSL120PF_COMMENT_LENGTH];
-	};
diff --git a/src/mbio/mbf_dsl120sf.h b/src/mbio/mbf_dsl120sf.h
deleted file mode 100644
index 9838857..0000000
--- a/src/mbio/mbf_dsl120sf.h
+++ /dev/null
@@ -1,190 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbf_dsl120sf.h	8/9/96
- *	$Id: mbf_dsl120sf.h 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1994-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbf_dsl120sf.h defines the data structures used by MBIO functions
- * to store data in the MBF_DSL120SF format (MBIO id 111).
- * These data are collected using the WHOI DSL AMS-120, a 120 khz
- * deep-towed sonar which produces both sidescan and bathymetry.
- * The data formats used to store the DSL AMS-120 data are:
- *      MBF_DSL120SF : MBIO ID 111
- *      MBF_DSL120SF : MBIO ID 112
- *
- *
- * Author:	D. W. Caress
- * Date:	August 9, 1996
- * $Log: mbf_dsl120sf.h,v $
- * Revision 5.3  2006/09/11 18:55:52  caress
- * Changes during Western Flyer and Thomas Thompson cruises, August-September
- * 2006.
- *
- * Revision 5.2  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.1  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.0  2000/12/01 22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.3  2000/09/30  06:29:44  caress
- * Snapshot for Dale.
- *
- * Revision 4.2  1998/10/05  18:32:27  caress
- * MB-System version 4.6beta
- *
- * Revision 4.1  1997/04/21  17:02:07  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.1  1997/04/21  17:02:07  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.1  1997/04/17  15:07:36  caress
- * MB-System 4.5 Beta Release
- *
- * Revision 4.0  1996/08/26  17:29:56  caress
- * Release 4.4 revision.
- *
- * Revision 1.1  1996/08/26  17:24:56  caress
- * Initial revision
- *
- *
- */
-/*
- * Notes on the MBF_DSL120SF data format:
- *   1. The DSL processing system used a parallel file scheme
- *      in which bathymetry, sidescan, and navigation are kept
- *      in separate files. Some examples of the filenames are:
- *         DSL120.940630_1100.bat.dat	- bathymetry
- *         DSL120.940630_1100.amp.dat	- sidescan
- *         DSL120.940630_1100.nav	- navigation
- *   2. The DSL parallel file scheme is supported under MB-System
- *      data format 111 (MBF_DSL120SF); a single file scheme is
- *      supported under data format 112 (MBF_DSL120SF). The
- *      single file scheme is within the DSL format specification.
- *   3. The bathymetry and sidescan data are stored in binary
- *      data structures; the navigation is stored in ASCII.
- *   4. The DSL format supports arbitrary numbers of bathymetry
- *      and sidescan values. The MB-System implementation has
- *      maximum numbers of values hardwired in the #defines
- *      below.
- *   5. The bathymetry and sidescan data have navigation
- *      fields,  but these navigation values typically repeat
- *      for many pings, often being the same for entire files.
- *      The separate navigation files contain the post-processed
- *      navigation with distinct values for each ping.
- *   6. The original navigation values supplied by WHOI/DSL
- *      so far are in projected eastings and northings rather
- *      than in longitude and latitude. Since MB-System only
- *      works with longitude and latitude, a special program
- *      will need to be used to translate the navigation to
- *      longitude and latitude.
- *   7. Due to the above problem, the following scheme will
- *      be used to handle MBF_DSL120DT data in MB-System:
- *        a) Run a perl macro called mbdslnavfix on the
- *           DSL120.*.nav files,  producing DSL.*.mbnav
- *           files in a format understood by mbmerge.
- *        b) Run mbmerge on the DSL120.*.bat.dat and DSL120.*.amp.dat
- *           files to merge the navigation from the DSL120.*.mbnav
- *           in with the bathymetry and sidescan data.
- *   8. The parallel file structure is difficult to deal with
- *      in the MB-System world where programs expect a single
- *      input and a single output file name. Handling the two
- *      files (bat.dat and amp.dat) will be handled in low level
- *      i/o routines. If the input file name has a "bat" in it,
- *      the code will attempt to open a second file with the
- *      same name except that "amp" is substituted for "bat".
- *      If the specified input file has "amp" in it,  then the
- *      second file will have "bat". The same will be true for
- *      the output files.
- *   9. The comment records reside only in the "bat" files in
- *      the parallel file scheme of format 111.
- *      The comment records are an MB-System extension to the
- *      DSL format. The program mbcopy can be used to strip
- *      the comments out of the data files prior to reusing
- *      DSL processing software.
- *
- */
-
-/* maximum number of beams and pixels */
-#define	MBF_DSL120SF_MAXBEAMS_SIDE	    1024
-#define	MBF_DSL120SF_MAXBEAMS	    2 * MBF_DSL120SF_MAXBEAMS_SIDE
-#define	MBF_DSL120SF_MAXPIXELS_SIDE    4096
-#define	MBF_DSL120SF_MAXPIXELS	    2 * MBF_DSL120SF_MAXPIXELS_SIDE
-#define	MBF_DSL120SF_COMMENT_LENGTH	80
-
-/* internal data structure */
-struct mbf_dsl120sf_struct
-	{
-	/* type of data record */
-	int	kind;			/* Data vs Comment */
-
-	/* record header */
-	int	rec_type;		/* always "DSL " */
-	int	rec_len;
-	int	rec_hdr_len;
-	unsigned int p_flags;		/* processing flags */
-	int	num_data_types;		/* number of data types in rec */
-   	int	ping;			/* ping number */
-   	char	sonar_cmd[4];		/* sonar parameters */
-   	char	time_stamp[24];		/* ascii event time */
-  	float	nav_x;			/* x position */
-   	float	nav_y;			/* y position */
-   	float	depth;			/* depth - meters */
-   	float	heading;		/* heading of vehicle - degrees */
-   	float	pitch;			/* pitch - degrees */
-   	float	roll;			/* roll - degrees */
-   	float	alt;			/* altitude - meters */
-   	float	ang_offset;	 	/* pointing ang relative to nose - deg*/
-   	int	transmit_pwr;  		/* transmit power decibels */
-   	int	gain_port;		/* db - not sure if belongs here */
-   	int	gain_starbd;		/* db - not sure if belongs here */
-   	float	pulse_width;		/* pulse width */
-   	int	swath_width;		/* meters */
-   	char	side;			/* 0 - port, 1 - stbd for fwd scan */
-   	char	swapped;		/* data,header: 00-PC 01-SunHdr 11-Sun*/
-	int	tv_sec;			/* seconds */
-	int	tv_usec;		/* and microseconds */
-   	short	digitalinterface;	/* digital interface: 0,1,or 2 -
-					 * must be specified in config file */
-    	short reserved[5];
-
-	/* bathymetry record */
-	int	bat_type;		/* always "BATH" */
-	int	bat_len;
-	int	bat_hdr_len;
-	int	bat_num_bins;
-	float	bat_sampleSize;
-	unsigned int bat_p_flags;
-	float	bat_max_range; /* meters */
-	int	bat_future[9];
-	float	bat_port[MBF_DSL120SF_MAXBEAMS_SIDE];
-	float	bat_stbd[MBF_DSL120SF_MAXBEAMS_SIDE];
-
-	/* amplitude record */
-	int	amp_type;		/* always "AMP " */
-	int	amp_len;
-	int	amp_hdr_len;
-	int	amp_num_samp;
-	float	amp_sampleSize;
-	unsigned int amp_p_flags; /* offset/slr, ... */
-	float	amp_max_range; /* meters */
-	int	amp_channel;     /* 1-upper/0-lower */
-	int	amp_future[8];
-	float	amp_port[MBF_DSL120SF_MAXPIXELS];
-	float	amp_stbd[MBF_DSL120SF_MAXPIXELS_SIDE];
-
-	/* comment */
-	char	comment[MBF_DSL120SF_COMMENT_LENGTH];
-	};
diff --git a/src/mbio/mbf_elmk2unb.h b/src/mbio/mbf_elmk2unb.h
deleted file mode 100644
index be0fa48..0000000
--- a/src/mbio/mbf_elmk2unb.h
+++ /dev/null
@@ -1,198 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbf_elmk2unb.h	6/6/97
- *	$Id: mbf_elmk2unb.h 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1997-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbf_elmk2unb.h defines the data structures used by MBIO functions
- * to store multibeam data read from the MBF_ELMK2UNB format (MBIO id 92).
- *
- * Author:	D. W. Caress
- * Date:	June 6, 1997
- *
- * $Log: mbf_elmk2unb.h,v $
- * Revision 5.2  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.1  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.0  2000/12/01 22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.2  2000/09/30  06:29:44  caress
- * Snapshot for Dale.
- *
- * Revision 4.1  1998/10/05  17:46:15  caress
- * MB-System version 4.6beta
- *
- * Revision 4.0  1997/07/25  14:25:40  caress
- * Version 4.5beta2.
- *
- * Revision 1.1  1997/07/25  14:19:53  caress
- * Initial revision
- *
- *
- *
- *
- */
-/*
- * Notes on the MBF_ELMK2UNB data format:
- *   1. Elac multibeam systems output binary data telegrams.
- *   2. Elac BottomChart Mark II sonar systems output both bathymetry
- *      and amplitude information for 126 beams per telegram.
- *   3. Each ping produces 42 beams.  A wide swath is constructed
- *      by successively pinging in different directions.
- *   4. Each telegram is preceded by a two byte start code and
- *      followed by a three byte end code consisting of 0x03
- *      followed by two bytes representing the checksum for
- *      the data bytes.  MB-System does not calculate checksums
- *      and puts 0's in the checksum bytes.
- *   5. The relevent telegram start codes, types, and sizes are:
- *         0x0250: Comment (Defined only for MB-System)   200 data bytes
- *         0x0251: Position                                36 data bytes
- *         0x0252: Parameter                               54 data bytes
- *         0x0253: Sound velocity profile                2016 data bytes
- *         0x0258: Mark II general bathymetry wrapper      24 data bytes
- *                 Mark II general bathymetry beam         28 data bytes
- *   6. Elac systems record navigation fixes using the position
- *      telegram; navigation is not included in the per ping data.
- *      Since speed is not recorded, it is impossible to extrapolate
- *      position from the last navigation fix when processing the
- *      data serially, as MBIO does.  It may thus be necessary to extract
- *      the navigation from the position telegrams and remerge it with
- *      the ping telegrams using the program mbmerge.
- *
- */
-
-/* maximum number of beams and pixels */
-#define	MBF_ELMK2UNB_MAXBEAMS	126
-#define	MBF_ELMK2UNB_COMMENT_LENGTH	200
-
-struct mbf_elmk2unb_beam_struct
-	{
-	unsigned int	bath;		/* 0.01 m */
-	int	bath_acrosstrack;	/* 0.01 m */
-	int	bath_alongtrack;	/* 0.01 m */
-	unsigned int	tt;		/* 0.05 ms */
-	int	quality;		/* 1 (best) to 8 (worst) */
-	int	amplitude;		/* dB + 128 */
-	unsigned short	time_offset;	/* 0.5 ms */
-	short	heave;			/* 0.001 meters */
-	short	roll;			/* 0.005 degrees */
-	short	pitch;			/* 0.005 degrees */
-	short	angle;			/* 0.005 degrees */
-	};
-
-struct mbf_elmk2unb_struct
-	{
-	/* type of data record */
-	int	kind;			/* Data vs Comment */
-
-	/* type of sonar */
-	int	sonar;			/* Type of Elac sonar */
-
-	/* parameter info (parameter telegrams) */
-	int	par_year;
-	int	par_month;
-	int	par_day;
-	int	par_hour;
-	int	par_minute;
-	int	par_second;
-	int	par_hundredth_sec;
-	int	par_thousandth_sec;
-	short	roll_offset;	/* roll offset (degrees) */
-	short	pitch_offset;	/* pitch offset (degrees) */
-	short	heading_offset;	/* heading offset (degrees) */
-	short	time_delay;	/* positioning system delay (sec) */
-	short	transducer_port_height;
-	short	transducer_starboard_height;
-	short	transducer_port_depth;
-	short	transducer_starboard_depth;
-	short	transducer_port_x;
-	short	transducer_starboard_x;
-	short	transducer_port_y;
-	short	transducer_starboard_y;
-	short	transducer_port_error;
-	short	transducer_starboard_error;
-	short	antenna_height;
-	short	antenna_x;
-	short	antenna_y;
-	short	vru_height;
-	short	vru_x;
-	short	vru_y;
-	short	line_number;
-	short	start_or_stop;
-	short	transducer_serial_number;
-
-	/* comment */
-	char	comment[MBF_ELMK2UNB_COMMENT_LENGTH];
-
-	/* position (position telegrams) */
-	int	pos_year;
-	int	pos_month;
-	int	pos_day;
-	int	pos_hour;
-	int	pos_minute;
-	int	pos_second;
-	int	pos_hundredth_sec;
-	int	pos_thousandth_sec;
-	int	pos_latitude;		/* 180 deg = 2e9 */
-	int	pos_longitude;		/* 180 deg = 2e9 */
-	unsigned int	utm_northing;
-	unsigned int	utm_easting;
-	int	utm_zone_lon;		/* 180 deg = 2e9 */
-	char	utm_zone;
-	char	hemisphere;
-	char	ellipsoid;
-	char	pos_spare;
-	int	semi_major_axis;
-	int	other_quality;
-
-	/* sound velocity profile */
-	int	svp_year;
-	int	svp_month;
-	int	svp_day;
-	int	svp_hour;
-	int	svp_minute;
-	int	svp_second;
-	int	svp_hundredth_sec;
-	int	svp_thousandth_sec;
-	int	svp_latitude;		/* 180 deg = 2e9 */
-	int	svp_longitude;		/* 180 deg = 2e9 */
-	int	svp_num;
-	int	svp_depth[500]; /* 0.1 meters */
-	int	svp_vel[500];	/* 0.1 meters/sec */
-
-	/* general bathymetry */
-	int	year;
-	int	month;
-	int	day;
-	int	hour;
-	int	minute;
-	int	second;
-	int	hundredth_sec;
-	int	thousandth_sec;
-	int	latitude;		/* 180 deg = 2e9 */
-	int	longitude;		/* 180 deg = 2e9 */
-	int	ping_num;
-	int	sound_vel;		/* 0.1 m/s */
-	int	heading;		/* 0.01 deg */
-	int	pulse_length;		/* 0.01 ms */
-	int	mode;			/* 0: omni, 1: RDT (def) */
-	int	source_power;		/* 0: low, 1: high */
-	int	receiver_gain_stbd;	/* db */
-	int	receiver_gain_port;	/* db */
-	int	reserved;
-	int	beams_bath;		/* number of beams stored */
-	struct mbf_elmk2unb_beam_struct beams[MBF_ELMK2UNB_MAXBEAMS];
-	};
diff --git a/src/mbio/mbf_em12darw.h b/src/mbio/mbf_em12darw.h
deleted file mode 100644
index 1bf2dfd..0000000
--- a/src/mbio/mbf_em12darw.h
+++ /dev/null
@@ -1,127 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbf_em12darw.h	1/20/93
- *	$Id: mbf_em12darw.h 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1994-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbf_em12darw.h defines the data structure used by MBIO functions
- * to store multibeam data read from the  MBF_EM12DARW format (MBIO id 51).
- *
- * Authors:	D. W. Caress (L-DEO)
- *		R. B. Owens (University of Oxford)
- * Date:	January 20, 1994
- * $Log: mbf_em12darw.h,v $
- * Revision 5.3  2003/12/04 23:10:22  caress
- * Fixed problems with format 54 EM12DARW due to old code assuming how internal structure was packed. Also changed handling of beamflags for formats that don't support beamflags. Now flagged beams will always be nulled in such cases.
- *
- * Revision 5.2  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.1  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.0  2000/12/01 22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.3  2000/09/30  06:29:44  caress
- * Snapshot for Dale.
- *
- * Revision 4.2  1998/10/05  18:32:27  caress
- * MB-System version 4.6beta
- *
- * Revision 4.1  1997/04/21  17:02:07  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.1  1997/04/21  17:02:07  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.0  1994/10/21  12:35:05  caress
- * Release V4.0
- *
- * Revision 4.0  1994/10/21  12:35:05  caress
- * Release V4.0
- *
- * Revision 1.1  1994/10/21  12:20:01  caress
- * Initial revision
- *
- * Revision 4.0  1994/03/06  00:01:56  caress
- * First cut at version 4.0
- *
- * Revision 4.0  1994/03/05  22:54:09  caress
- * First cut.
- *
- *
- */
-/*
- * Notes on the MBF_EM12DARW data format:
- *   1. This data format is used to store 81 beam SIMRAD EM12 bathymetry
- *      data.  This format was created and used by R.B.Owens for
- *      SIMRAD EM12 data collected on the RRS Charles Darwin;
- *   2. The data consist of 1056-byte records including 1-byte characters,
- *      2-byte and 4-byte integers, 4-byte floats and 8-byte doubles.
- *   3. The 81 depth values are stored centered in 81 value arrays.  The
- *      center beam is in word 40 of the depth and distance arrays.
- *   4. The "range" is the two-way pulse travel time for each beam (81 values)
- *   5. The "reflectivity" is the mean backscattering strength (in dB)
- *      over each beam, corrected for beam patterns, echo sounder
- *      parameters and Lambert's law.  In the context of MB-System, the
- *	backscatter values are considered to be amplitudes rather than
- *	sidescan because they are coincident with the bathymetry values.
- *   6. Comments can be embedded in the data as N-byte ascii strings,
- *	where "func" = 100. Comment lines are stored as 1-byte characters
- *      in the "depth" array. For data, "func" = 150.
- *   7. Mode; 1 = Shallow, 2 = Deep. Controls scaling factors, e.g. Depth is
- *      scaled 1/0.1 for mode 1 and scaled 1/0.2 for mode 2.
- *
- */
-
-/* record length in bytes */
-#define MBF_EM12DARW_RECORD_LENGTH 1056
-
-/* number of beams for EM12 */
-#define MBF_EM12DARW_BEAMS 81
-
-struct mbf_em12darw_struct {
-	short	func;		/* record type; 100=comment, 150=data */
-	short	year;		/* TWO-digit year */
-	short 	jday;		/* Julian day  */
-	short 	minute;		/* minute of day */
-	short	secs;		/* seconds x 100 */
-	double	latitude;	/* latitude (for units see corflag) */
-	double	longitude;	/* longitude (for units see corflag) */
-	short	corflag;	/* Co-ordinate flag: 0=Lat/Long, 1=UTM North,
-					2=UTM South  */
-	float	utm_merd;	/* UTM Meridian if corflag=1,2  */
-	short	utm_zone;	/* UTM Zone if corflag=1,2  */
-	short	posq;		/* Quality factor of Position data */
-	int	pingno;		/* ping number */
-	short	mode;		/* resolution mode */
-	float	depthl;		/* depth of centrebeam */
-	float	speed;		/* Ship's speed */
-	float	gyro;		/* Ship's Heading */
-	float	roll;		/* Ship's Roll */
-	float	pitch;		/* Ship's Pitch */
-	float	heave;		/* Ship's Heave */
-	float	sndval;		/* Sound Velocity */
-	short	depth[MBF_EM12DARW_BEAMS];
-				/* Beam Depth scaled (0.1/0.2) */
-	short	distacr[MBF_EM12DARW_BEAMS];
-				/* Beam Across Distance, scaled (0.2/0.5) */
-	short	distalo[MBF_EM12DARW_BEAMS];
-				/* Beam Along Distance, scaled (0.2/0.5) */
-	short	range[MBF_EM12DARW_BEAMS];
-				/* Beam Range, scaled (0.2/0.8) */
-	short	refl[MBF_EM12DARW_BEAMS];
-				/* Beam Reflectivity, scaled 0.5 */
-	short	beamq[MBF_EM12DARW_BEAMS];
-				/* Beam Quality, unscaled */
-};
diff --git a/src/mbio/mbf_em12ifrm.h b/src/mbio/mbf_em12ifrm.h
deleted file mode 100644
index b29d41e..0000000
--- a/src/mbio/mbf_em12ifrm.h
+++ /dev/null
@@ -1,265 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbf_em12ifrm.h	12/5/00
- *	$Id: mbf_em12ifrm.h 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 2000-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbf_em12ifrm.h defines the data structures used by MBIO functions
- * to store multibeam data read from the MBF_EM12IFRM format (MBIO id 58).
- *
- * Author:	D. W. Caress
- * Date:	December 5, 2000
- * $Log: mbf_em12ifrm.h,v $
- * Revision 5.4  2004/10/18 04:15:46  caress
- * Minor change.
- *
- * Revision 5.3  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.2  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.1  2001/03/22 20:50:02  caress
- * Trying to make version 5.0.beta0
- *
- * Revision 5.0  2000/12/10  20:24:25  caress
- * Initial revision.
- *
- *
- *
- */
-/*
- * Notes on the MBF_EM12IFRM data format:
- *   1. IFREMER uses their own software to process swath data.
- *      Currently (2004) the software is called CARAIBES, but
- *      during the 1990's they used an earlier package called
- *      TRISMUS to process multibeam data. This format was used
- *      and generated as part of TRISMUS processing of EM12S and
- *      EM12D multibeam data. TRISMUS recast the data as parallel
- *      files for bathymetry (.SO suffix), imagery (.IM suffix),
- *      and asynchronous navigation (.NA suffix). We recommend
- *      that users translate the TRISMUS data to the current
- *      mbsystem format for processing Simrad multibeam data
- *      (EM300MBA - format 57) before processing.
- *   2. This format is supported read-only in MB-System.
- *   3. The systems of interest:
- *         EM-12S:   Deep water 12kHz multibeam sonar with up to
- *                   81 beams of bathymetry and up to 523 sidescan
- *                   samples per bathymetry beam.
- *         EM-12D:   Deep water 12kHz multibeam sonar with up to
- *                   81 beams of bathymetry and up to 523 sidescan
- *                   samples per bathymetry beam. This is a dual
- *                   system which produces alternating port and
- *                   starboard pings to provide a 150 degree swath.
- *   4. The navigation data contain NMEA type ascii strings
- *      beginning with "$CASTM". The sources of these strings
- *      include "NACOU", "NAGP1",  and "NAGP2".
- *      MB-System uses only the "NACOU" strings.
- *   5. Each bathymetry record is 1032 bytes long and begins
- *      with a 35 character string containing the identifier
- *      and time stamp. The first six characters are one of
- *      the following:
- *           "$12SOC": EM12S ping
- *           "$12SOB": EM12D port ping
- *           "$12SOT": EM12S starboard ping
- *           "$COMM:": Comment (MB-System only)
- *   6. The imagery records are of variable length and begin
- *      with a 35 character string containing the identifier
- *      and time stamp. The first six characters are one of
- *      the following:
- *           "$12IMC": EM12S ping
- *           "$12IMB": EM12D port ping
- *           "$12IMT": EM12S starboard ping
- *      As with the Simrad vendor formats, multiple sidescan
- *      datagrams are recorded for each ping.
- *
- */
-
-/* maximum number of beams and pixels */
-#define	MBF_EM12IFRM_MAXBEAMS	81
-#define	MBF_EM12IFRM_MAXRAWPIXELS	50*MBF_EM12IFRM_MAXBEAMS
-#define	MBF_EM12IFRM_MAXPIXELS	1024
-
-struct mbf_em12ifrm_struct
-	{
-	/* type of data record */
-	int	kind;			/* Data vs Comment */
-
-	/* type of sonar */
-	int	sonar;			/* Type of Simrad sonar */
-
-	/* parameter info (start, stop and parameter datagrams) */
-	int	par_year;
-	int	par_month;
-	int	par_day;
-	int	par_hour;
-	int	par_minute;
-	int	par_second;
-	int	par_centisecond;
-	int	pos_type;	/* positioning system type */
-	double	pos_delay;	/* positioning system delay (sec) */
-	double	roll_offset;	/* roll offset (degrees) */
-	double	pitch_offset;	/* pitch offset (degrees) */
-	double	heading_offset;	/* heading offset (degrees) */
-	double	em100_td;	/* EM-100 tranducer depth (meters) */
-	double	em100_tx;	/* EM-100 tranducer fore-aft
-					offset (meters) */
-	double	em100_ty;	/* EM-100 tranducer athwartships
-					offset (meters) */
-	double	em12_td;	/* EM-12 tranducer depth (meters) */
-	double	em12_tx;	/* EM-12 tranducer fore-aft
-					offset (meters) */
-	double	em12_ty;	/* EM-12 tranducer athwartships
-					offset (meters) */
-	double	em1000_td;	/* EM-1000 tranducer depth (meters) */
-	double	em1000_tx;	/* EM-1000 tranducer fore-aft
-					offset (meters) */
-	double	em1000_ty;	/* EM-1000 tranducer athwartships
-					offset (meters) */
-	char	spare_parameter[128];
-	int	survey_line;
-	char	comment[80];
-
-	/* position (position datagrams) */
-	int	pos_year;
-	int	pos_month;
-	int	pos_day;
-	int	pos_hour;
-	int	pos_minute;
-	int	pos_second;
-	int	pos_centisecond;
-	double	latitude;
-	double	longitude;
-	double	utm_northing;
-	double	utm_easting;
-	int	utm_zone;
-	double	utm_zone_lon;
-	int	utm_system;
-	int	pos_quality;
-	double	speed;			/* meters/second */
-	double	line_heading;		/* degrees */
-
-	/* sound velocity profile */
-	int	svp_year;
-	int	svp_month;
-	int	svp_day;
-	int	svp_hour;
-	int	svp_minute;
-	int	svp_second;
-	int	svp_centisecond;
-	int	svp_num;
-	int	svp_depth[100]; /* meters */
-	int	svp_vel[100];	/* 0.1 meters/sec */
-
-	/* time stamp */
-	int	year;
-	int	month;
-	int	day;
-	int	hour;
-	int	minute;
-	int	second;
-	int	centisecond;
-
-	/* swath id */
-	int	swath_id;	/* EM_SWATH_CENTER:	0
-				   EM_SWATH_PORT:	-1  (EM12D only)
-				   EM_SWATH_STARBOARD:	1   (EM12D only) */
-
-	/* bathymetry */
-	int	ping_number;
-	int	beams_bath;	/* EM-1000:  60
-				   EM12S:    81
-				   EM12D:    81 */
-	int	bath_mode;	/* EM-1000: 1=deep; 2=medium; 3=shallow
-				   EM-12S:  1=shallow equiangle spacing
-				            2=deep equiangle spacing
-				            3=shallow equidistant spacing
-				            4=deep 120 degree equidistant
-				            5=deep 105 degree equidistant
-				            6=deep 90 degree equidistant
-				   EM-12D:  1=shallow equiangle spacing
-				            2=deep equiangle spacing
-				            3=shallow equidistant spacing
-				            4=deep 150 degree equidistant
-				            5=deep 140 degree equidistant
-				            6=deep 128 degree equidistant
-				            7=deep 114 degree equidistant
-				            8=deep 98 degree equidistant */
-	int	bath_res;	/* EM-12 only: 1=high res; 2=low res */
-	int	bath_quality;	/* number of good beams,
-					negative if ping rejected */
-	int	keel_depth;	/* depth of most vertical beam:
-					EM-1000:        0.02 meters
-					EM-12 high res: 0.10 meters
-					EM-12 low res:  0.20 meters */
-	int	heading;	/* 0.1 degrees */
-	int	roll;		/* 0.01 degrees */
-	int	pitch;		/* 0.01 degrees */
-	int	xducer_pitch;	/* 0.01 degrees */
-	int	ping_heave;	/* 0.01 meters */
-	int	sound_vel;	/* 0.1 meters/sec */
-	short int bath[MBF_EM12IFRM_MAXBEAMS];
-				/* depths:
-					EM-1000:        0.02 meters
-					EM-12 high res: 0.10 meters
-					EM-12 low res:  0.20 meters */
-	short int bath_acrosstrack[MBF_EM12IFRM_MAXBEAMS];
-				/* acrosstrack distances:
-					EM-1000:         0.1 meters
-					EM-12 high res:  0.2 meters
-					EM-12 low res:   0.5 meters */
-	short int bath_alongtrack[MBF_EM12IFRM_MAXBEAMS];
-				/* alongtrack distances:
-					EM-1000:         0.1 meters
-					EM-12 high res:  0.2 meters
-					EM-12 low res:   0.5 meters */
-	short int tt[MBF_EM12IFRM_MAXBEAMS];	/* meters */
-				/* travel times:
-					EM-1000:         0.05 msec
-					EM-12 high res:  0.20 msec
-					EM-12 low res:   0.80 msec */
-	mb_s_char	amp[MBF_EM12IFRM_MAXBEAMS];	    /* 0.5 dB */
-	mb_u_char	quality[MBF_EM12IFRM_MAXBEAMS];	    /* meters */
-	mb_s_char	heave[MBF_EM12IFRM_MAXBEAMS];	    /* 0.1 meters */
-
-	/* sidescan */
-	int	pixels_ssraw;	/* total number of samples for this ping */
-	int	ss_mode;	/* 1 = EM-12 shallow:   0.6 m/sample
-				   2 = EM-12 deep:      2.4 m/sample
-				   3 = EM-1000 deep:    0.3 m/sample
-				   4 = EM-1000 medium:  0.3 m/sample
-				   5 = EM-1000 shallow: 0.15 m/sample */
-	short int beam_frequency[MBF_EM12IFRM_MAXBEAMS];
-				/*	0 = 12.67 kHz
-					1 = 13.00 kHz
-					2 = 13.33 kHz
-					3 = 95.00 kHz */
-	short int beam_samples[MBF_EM12IFRM_MAXBEAMS];
-				/* number of sidescan samples derived from
-					each beam */
-	short int beam_center_sample[MBF_EM12IFRM_MAXBEAMS];
-				/* center beam sample number among samples
-					from one beam */
-	short int beam_start_sample[MBF_EM12IFRM_MAXBEAMS];
-				/* start beam sample number among samples
-					from entire ping */
-	mb_s_char ssraw[MBF_EM12IFRM_MAXRAWPIXELS];
-	short int ssp[MBF_EM12IFRM_MAXRAWPIXELS];
-	int	pixel_size;	/* processed sidescan pixel size in cm */
-	int	pixels_ss;	/* number of processed sidescan pixels stored */
-	short	ss[MBF_EM12IFRM_MAXPIXELS];
-				/* the processed sidescan ordered port to starboard */
-	short	ssalongtrack[MBF_EM12IFRM_MAXPIXELS];
-				/* the processed sidescan alongtrack distances
-					in distance resolution units */
-
-};
diff --git a/src/mbio/mbf_gsfgenmb.h b/src/mbio/mbf_gsfgenmb.h
deleted file mode 100644
index 20f3345..0000000
--- a/src/mbio/mbf_gsfgenmb.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbf_gsfgenmb.h	2/27/98
- *	$Id: mbf_gsfgenmb.h 2226 2015-02-05 20:38:55Z caress $
- *
- *    Copyright (c) 1998-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbf_gsfgenmb.h defines the data structures used by MBIO functions
- * to store multibeam data read from the  MBF_GSFGENMB format (MBIO id 121).
- *
- * Author:	D. W. Caress
- * Date:	February 27, 1998
- *
- */
-/*
- * Notes on the MBF_GSFGENMB data format:
- *   1. The underlying data format is the Generic Sensor Format (GSF)
- *      developed by Shannon Byrne of SAIC. The GSF format stores swath
- *      bathymetry, single beam bathymetry, and other data.
- *   2. This MBIO i/o module accesses swath bathymtry data stored in
- *      the GSF format using the gsflib library also written at SAIC.
- *      The gsflib calls translate the data from scaled short integers
- *      (big endian) stored in the file to double values. The sensor
- *      specific values held in the GSF data stream are not
- *      accessed by this module. However, all of the GSF records
- *      and the included information are passed when mb_get_all,
- *      mb_put_all, and the mb_buffer routines are used for
- *      reading and writing.
- */
-
-#include "gsf.h"
-
-struct mbf_gsfgenmb_struct
-	{
-	int	    kind;
-	gsfDataID   dataID;
-	gsfRecords  records;
-	};
diff --git a/src/mbio/mbf_hs10jams.h b/src/mbio/mbf_hs10jams.h
deleted file mode 100644
index 5b4d9d7..0000000
--- a/src/mbio/mbf_hs10jams.h
+++ /dev/null
@@ -1,150 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbf_hs10jams.h	12/4/00
- *	$Id: mbf_hs10jams.h 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 2000-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbf_hs10jams.h defines the data structures used by MBIO functions
- * to store Furuno HS-10 multibeam sonar data read from the
- * MBF_HS10JAMS format.
- *
- * Author:	D. W. Caress
- * Date:	December 4, 2000
- *
- * $Log: mbf_hs10jams.h,v $
- * Revision 5.2  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.1  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.0  2000/12/10 20:24:25  caress
- * Initial revision.
- *
- *
- */
-/*
- * Notes on the MBF_HS10JAMS data format:
- *   1. The Furuno HS-10 multibeam sonar generated 45 beams
- *      of bathymetry and amplitude.
- *   2. To my knowledge, only one Furuno HS-10 multibeam sonar
- *      has been operated. It was installed on S/V Yokosuka,
- *      a JAMSTEC research vessel. The Furuno HS-10 has since been
- *      replaced by a SeaBeam 2112 multibeam sonar.
- *   3. A specification for the raw HS-10 data format was
- *      provided by JAMSTEC, and is included below. The raw format
- *      consists of 800 byte binary records in which only the
- *      lower 4 bits of each byte are used.
- *   4. The actual data files provided to WHOI seem to be simple
- *      716 byte ASCII records with time, lat, lon, heading,
- *      center beam depth, 45 depths, 45 acrosstrack distances,
- *      45 beam amplitudes. Format 171 supports the actual data
- *      received.
- *   5. The data received use 5 characters each for depth,
- *      acrosstrack, and amplitude values. Null beams have
- *      depth values of 29999 and acrosstrack values of 99999.
- *      MB-System supports beam flagging by setting flagged
- *      beams negative.
- *   6. The internal data structure supports the data included
- *      in the format 171 files, and does not yet include values
- *      listed in the raw format spec but not seen in the data
- *      provided.
- *   7. Comment records are supported as an MB-System extension
- *      where the first two bytes of the 716 byte ASCII records
- *      are "##"
- *   8. The raw data format specification is as follows:
- *
- *      ----------------------------------------------------------
- *      HS-10 MNBES Data Format - JAMSTEC
- *
- *      800 bytes/record, 10 records/block
- *
- *      Note: 4 bits from LSB is effective in each byte.
- *           zB. 30 30 35 39 ---> 0 0 5 9 (HEX) = 89 (DEC)
- *               30 30 32 3D ---> 0 0 2 D (HEX) = 45 (DEC)
- *      The HS-10 processor calculates the water depth by use of
- *      average sound velocity and by correcting the difference
- *      between the true angle of the sound path (obtained by the
- *      true sound velocity profile) and the nominal angle of each
- *      beam (every 2 degrees). The horizontal distance of the n-th
- *      beam is
- *              Distance(n) = Depth(n) * tan[T(n)],
- *      where T(n) is the nominal angle of the n-th beam:
- *              ( T(n) = 2 * (n-23) degrees, n=1,45 ).
- *
- *      No.  Bytes  Data
- *       1.    4    Year
- *       2.    4    Month
- *       3.    4    Day
- *       4.    4    Hour
- *       5.    4    Minute
- *       6.    4    Second
- *       7.    8    Latitude in 1/10000 minute
- *       8.    8    Longitude in 1/10000 minute
- *       9.    8    X in 1/10 metre
- *      10.    8    Y in 1/10 metre
- *      11.    4    Ship's speed in 1/10 knot
- *      12.    4    Ship's heading in 1/10 degree
- *      13. 4x45    45 Water depths in metre
- *      14. 4x45    45 Intensity of reflection in dB
- *      15.    4    Selection of navigation
- *                    0:HYB, 1:ANS, 2:MANU(L/L) 3:MANU(X/Y)
- *      16.    4    Surface sound velocity in 1/10 m/sec
- *      17.    8    Initial latitude in 1/10000 minute
- *      18.    8    Initial longitude in 1/10000 minute
- *      19.    8    Initial X in 1/10 metre
- *      20.    8    Initial Y in 1/10 metre
- *      21.    4    Manual bearing in 1/10 degree
- *      22.    4    Manual ship's speed in 1/10 knot
- *      23.    4    Ship's draft in 1/10 metre
- *      24.    4    Offset X in 1/10 metre
- *      25.    4    Offset Y in 1/10 metre
- *      26.    4    Selection of sound velocity
- *                    0:no correction, 1:manual input, 2:calculation correction
- *      27.    4    Average sound velocity in 1/10 m/sec
- *      28.    4    Input selection of water temperature
- *                    0:AUTO, 1:MANUAL
- *      29.    4    Water temperature in 1/10 degree
- *      30.    4    Tide level in 1/10 metre
- *      31. 4x10    10 Depth of layer in metre
- *      32. 4x10    10 Temperature of layer in 1/10 degree
- *      33. 4x10    10 Salinity in 1/10 per mille
- *      34. 4x10    10 Sound velocity in 1/10 m/sec
- *      35.    4    Transmitted pulse width
- *                    0:1m, 1:2m, 2:4m, 3:8m
- *      36.    4    Level of transmission [1-16]
- *                    1:Off, 16:Max, -2dB in each step
- *      37.    4    Selection of period of tranmission
- *                    0:Auto, 1:Manual
- *      38:    4    Period of tranmission in second
- *      39:    4    Pre-amp ATT
- *                    0:OFF, 1:ON
- *      40:    4    Receiving gain [1-16]
- *                    1:Off, 16:Max, -2dB in each step
- *      41.    4    TVG [1-4]
- *      42.    4    AVG [1-4]
- *      43.    4    Threshold [1-16]
- *      44.    4    Gate width (R/L) [1-4]
- *      45.    4    Gate width (F/B) [1-4]
- *      46.    4    Selection of beam pattern [1-3]
- *      47.    4    Interferance removal
- *                    0:OFF, 1:ON
- *      48.    4    KP shift [1-32]
- *      49.    4    Sonar mode [0]
- *      50.         not used
- *      ----------------------------------------------------------
- *
- */
- *
- */
-
-#define	MBF_HS10JAMS_MAXLINE	716
diff --git a/src/mbio/mbf_hsatlraw.h b/src/mbio/mbf_hsatlraw.h
deleted file mode 100644
index d14ab5b..0000000
--- a/src/mbio/mbf_hsatlraw.h
+++ /dev/null
@@ -1,223 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbf_hsatlraw.h	1/20/93
- *	$Id: mbf_hsatlraw.h 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1993-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbf_hsatlraw.h defines the data structures used by MBIO functions
- * to store multibeam data read from the MBF_HSATLRAW format (MBIO id 21).
- *
- * Author:	D. W. Caress
- * Date:	January 20, 1993
- * $Log: mbf_hsatlraw.h,v $
- * Revision 5.2  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.1  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.0  2000/12/01 22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.4  2000/09/30  06:34:20  caress
- * Snapshot for Dale.
- *
- * Revision 4.3  1998/10/05  18:32:27  caress
- * MB-System version 4.6beta
- *
- * Revision 4.2  1997/04/21  17:02:07  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.2  1997/04/21  17:02:07  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.1  1994/10/21  12:20:01  caress
- * Release V4.0
- *
- * Revision 4.1  1994/10/21  12:20:01  caress
- * Release V4.0
- *
- * Revision 4.0  1994/03/06  00:01:56  caress
- * First cut at version 4.0
- *
- * Revision 4.2  1994/03/03  03:39:43  caress
- * Fixed copyright message.
- *
- * Revision 4.1  1994/02/17  21:19:08  caress
- * Updated associated MBIO format id in comments.
- *
- * Revision 4.0  1994/02/17  20:59:54  caress
- * First cut at new version. No changes.
- *
- * Revision 3.0  1993/05/14  22:50:34  sohara
- * initial version
- *
- */
-/*
- * Notes on the MBF_HSATLRAW data format:
- *   1. Hydrosweep DS multibeam systems output raw data in this
- *      ascii format.  The data consists of a number of different
- *      multi-line ascii records.
- *   2. The DS systems output 59 beams of bathymetry and 59 beams
- *      of backscatter measurements, along with a plethora of other
- *      information.
- *   3. The records all include navigation and time stamp information.
- *      The record types are:
- *        ERGNHYDI:  mean and keel water velocity values
- *        ERGNPARA:  navigation when system in standby
- *        ERGNPOSI:  navigation source
- *        ERGNMESS:  across-track "survey" bathymetry
- *        ERGNEICH:  along-track "calibration" bathymetry
- *        ERGNLSZT:  travel times associated with
- *                   ERGNMESS or ERGNEICH records
- *        ERGNCTDS:  water sound velocity profile
- *        ERGNAMPL:  amplitudes associated with
- *                   ERGNMESS or ERGNEICH records
- *        LDEOCOMM:  comment records (an L-DEO extension)
- *   4. A single ping usually results in the following series of
- *      of records:
- *        1. ERGNMESS or ERGNEICH
- *        2. ERGNSLZT
- *        3. ERGNAMPL
- *      The ERGNHYDI, ERGNPARA, ERGNPOSI and ERGNCTDS records occur
- *      at system startup and when the associated operational
- *      parameters of the Hydrosweep are changed.
- *   5. The kind value in the mbf_hsatlraw_struct indicates whether the
- *      mbf_hsatlraw_data_struct structure holds data from a ping or
- *      data from some other record:
- *        kind = 1 : data from a survey ping
- *                   (ERGNMESS + ERGNSLZT + ERGNAMPL)
- *        kind = 2 : comment (LDEOCOMM)
- *        kind = 3 : data from a calibrate ping
- *                   (ERGNEICH + ERGNSLZT + ERGNAMPL)
- *        kind = 4 : mean and keel velocity (ERGNHYDI)
- *        kind = 5 : water velocity profile (ERGNCTDS)
- *        kind = 6 : standby navigation (ERGNPARA)
- *        kind = 7 : navigation source (ERGNPOSI)
- *   6. The data structure defined below includes all of the values
- *      which are passed in Hydrosweep records.
- */
-
-/* maximum number of depth-velocity pairs */
-#define MBF_HSATLRAW_MAXVEL 30
-
-/* maximum line length in characters */
-#define MBF_HSATLRAW_MAXLINE 200
-
-/* number of beams for hydrosweep */
-#define MBF_HSATLRAW_BEAMS 59
-
-/* define id's for the different types of raw Hydrosweep records */
-#define MBF_HSATLRAW_RECORDS	11
-#define	MBF_HSATLRAW_NONE	0
-#define	MBF_HSATLRAW_RAW_LINE	1
-#define	MBF_HSATLRAW_ERGNHYDI	2
-#define	MBF_HSATLRAW_ERGNPARA	3
-#define	MBF_HSATLRAW_ERGNPOSI	4
-#define	MBF_HSATLRAW_ERGNEICH	5
-#define	MBF_HSATLRAW_ERGNMESS	6
-#define	MBF_HSATLRAW_ERGNSLZT	7
-#define	MBF_HSATLRAW_ERGNCTDS	8
-#define	MBF_HSATLRAW_ERGNAMPL	9
-#define	MBF_HSATLRAW_LDEOCMNT	10
-char *mbf_hsatlraw_labels[] = {
-	"NONE    ", "RAW_LINE", "ERGNHYDI", "ERGNPARA", "ERGNPOSI",
-	"ERGNEICH", "ERGNMESS", "ERGNSLZT", "ERGNCTDS", "ERGNAMPL",
-	"LDEOCMNT"};
-
-struct mbf_hsatlraw_struct
-	{
-	/* type of data record */
-	int	kind;
-
-	/* position (all records ) */
-	double	lon;
-	double	lat;
-
-	/* time stamp (all records ) */
-	int	year;
-	int	month;
-	int	day;
-	int	hour;
-	int	minute;
-	int	second;
-	int	alt_minute;
-	int	alt_second;
-
-	/* additional navigation and depths (ERGNMESS and ERGNEICH) */
-	double	course_true;
-	double	speed_transverse;
-	double	speed;
-	char	speed_reference[2];
-	double	pitch;
-	int	track;
-	double	depth_center;
-	double	depth_scale;
-	int	spare;
-	int	distance[MBF_HSATLRAW_BEAMS];
-	int	depth[MBF_HSATLRAW_BEAMS];
-
-	/* travel time data (ERGNSLZT) */
-	double	course_ground;
-	double	speed_ground;
-	double	heave;
-	double	roll;
-	double	time_center;
-	double	time_scale;
-	int	time[MBF_HSATLRAW_BEAMS];
-	double	gyro[11];
-
-	/* amplitude data (ERGNAMPL) */
-	char	mode[2];
-	int	trans_strbd;
-	int	trans_vert;
-	int	trans_port;
-	int	pulse_len_strbd;
-	int	pulse_len_vert;
-	int	pulse_len_port;
-	int	gain_start;
-	int	r_compensation_factor;
-	int	compensation_start;
-	int	increase_start;
-	int	tvc_near;
-	int	tvc_far;
-	int	increase_int_near;
-	int	increase_int_far;
-	int	gain_center;
-	double	filter_gain;
-	int	amplitude_center;
-	int	echo_duration_center;
-	int	echo_scale_center;
-	int	gain[16];
-	int	amplitude[MBF_HSATLRAW_BEAMS];
-	int	echo_scale[16];
-	int	echo_duration[MBF_HSATLRAW_BEAMS];
-
-	/* mean velocity (ERGNHYDI) */
-	double	draught;
-	double	vel_mean;
-	double	vel_keel;
-	double	tide;
-
-	/* water velocity profile (HS_ERGNCTDS) */
-	int	num_vel;
-	double	vdepth[MBF_HSATLRAW_MAXVEL];
-	double	velocity[MBF_HSATLRAW_MAXVEL];
-
-	/* navigation source (ERGNPOSI) */
-	double	pos_corr_x;
-	double	pos_corr_y;
-	char	sensors[10];
-
-	/* comment (LDEOCMNT) */
-	char	comment[MBF_HSATLRAW_MAXLINE];
-	};
diff --git a/src/mbio/mbf_hsldedmb.h b/src/mbio/mbf_hsldedmb.h
deleted file mode 100644
index 138602a..0000000
--- a/src/mbio/mbf_hsldedmb.h
+++ /dev/null
@@ -1,122 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbf_hsldedmb.h	1/20/93
- *	$Id: mbf_hsldedmb.h 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1993-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbf_hsldedmb.h defines the data structure used by MBIO functions
- * to store multibeam data read from the  MBF_HSLDEDMB format (MBIO id 22).
- *
- * Author:	D. W. Caress
- * Date:	January 20, 1993
- * $Log: mbf_hsldedmb.h,v $
- * Revision 5.2  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.1  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.0  2000/12/01 22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.6  2000/09/30  06:34:20  caress
- * Snapshot for Dale.
- *
- * Revision 4.5  1998/10/05  17:46:15  caress
- * MB-System version 4.6beta
- *
- * Revision 4.4  1997/09/15  19:06:40  caress
- * Real Version 4.5
- *
- * Revision 4.3  1997/04/21  17:02:07  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.2  1994/10/21  12:20:01  caress
- * Release V4.0
- *
- * Revision 4.2  1994/10/21  12:20:01  caress
- * Release V4.0
- *
- * Revision 4.1  1994/07/29  18:46:51  caress
- * Changes associated with supporting Lynx OS (byte swapped) and
- * using unix second time base (for time_d values).
- *
- * Revision 4.0  1994/03/06  00:01:56  caress
- * First cut at version 4.0
- *
- * Revision 4.2  1994/03/03  03:39:43  caress
- * Fixed copyright message.
- *
- * Revision 4.1  1994/02/17  21:19:08  caress
- * Updated associated MBIO format id in comments.
- *
- * Revision 4.0  1994/02/17  20:59:54  caress
- * First cut at new version. No changes.
- *
- * Revision 3.0  1993/05/14  22:51:24  sohara
- * initial version
- *
- */
-/*
- * Notes on the MBF_HSLDEDMB data format:
- *   1. This data format is used to store 59 beam Hydrosweep DS bathymetry
- *      data.  This format was created by Dale Chayes of L-DEO and Dan
- *      Chayes of NRL for use with an early version of a ping editor.
- *      Most data files in this format consist of Hydrosweep DS data
- *      collected on the R/V Maurice Ewing or the R/V Thomas Thompson.
- *   2. The data consist of 328 byte records including 1-byte characters,
- *      2-byte integers, and 8-byte integers.
- *   3. The 59 depth values are stored centered in 59 value arrays.  The
- *      center beam is in word 30 of the depth and distance arrays.
- *   4. There is no provision for embedding comments in the data.
- *   4. Comments can be embedded in the data as 328 byte ascii strings,
- *	where the first four characters must always be "zzzz" so that the
- *      seconds value is 2054847098.
- *   5. We expect the use of this format to be superceded by format
- *      MBF_MBLDEOIH.
- *
- * The kind value in the mbf_hsldedmb_struct indicates whether the
- * mbf_hsldedmb_data_struct structure holds data (kind = 1) or an
- * ascii comment record (kind = 2).
- *
- * The mbf_hsldedmb_data_struct structure is a direct representation
- * of the binary data structure used in the MBF_HSLDEDMB format.
- */
-
-struct mbf_hsldedmb_data_struct
-	{
-	unsigned int	seconds;	/* seconds since 1/1/70 00:00:00 */
-	unsigned int	microseconds;	/* microseconds */
-	unsigned int	alt_seconds;	/* seconds since last survey header */
-	unsigned int	alt_microseconds;	/* microseconds */
-	int	lat;		/* latitude in degrees times 10000000 */
-	int	lon;		/* latitude in degrees times 10000000 */
-	short	heading;	/* heading in degrees times 10 */
-	short	course;		/* course in degrees times 10 */
-	short	speed;		/* speed in m/s times 10 */
-	short	pitch;		/* pitch in degrees times 10 */
-	short	scale;		/* multiplicative scale times 100 for depth
-					and range values */
-	short	depth[59];	/* depths in scaled meters assuming
-					1500 m/s water velocity */
-	short	range[59];	/* cross track distances in meters */
-	mb_u_char	speed_ref;	/* speed reference
-					("B": bottom track) */
-	mb_u_char	quality;	/* quality flag */
-	unsigned int	flag[4];
-	};
-
-struct mbf_hsldedmb_struct
-	{
-	int	kind;
-	struct mbf_hsldedmb_data_struct data;
-	};
diff --git a/src/mbio/mbf_hsldeoih.h b/src/mbio/mbf_hsldeoih.h
deleted file mode 100644
index b9d52e6..0000000
--- a/src/mbio/mbf_hsldeoih.h
+++ /dev/null
@@ -1,502 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbf_hsldeoih.h	3/11/93
- *	$Id: mbf_hsldeoih.h 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1993-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbf_hsldeoih.h defines the data structures used by MBIO functions
- * to store multibeam data read from the MBF_HSLDEOIH format (MBIO id 24).
- *
- * Author:	D. W. Caress
- * Date:	March 11, 1993
- * $Log: mbf_hsldeoih.h,v $
- * Revision 5.2  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.1  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.0  2000/12/01 22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.4  2000/09/30  06:34:20  caress
- * Snapshot for Dale.
- *
- * Revision 4.3  1998/10/05  18:32:27  caress
- * MB-System version 4.6beta
- *
- * Revision 4.2  1997/04/21  17:02:07  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.2  1997/04/21  17:02:07  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.1  1994/10/21  12:20:01  caress
- * Release V4.0
- *
- * Revision 4.1  1994/10/21  12:20:01  caress
- * Release V4.0
- *
- * Revision 4.0  1994/03/06  00:01:56  caress
- * First cut at version 4.0
- *
- * Revision 4.2  1994/03/03  03:39:43  caress
- * Fixed copyright message.
- *
- * Revision 4.1  1994/02/17  21:19:08  caress
- * Updated associated MBIO format id in comments.
- *
- * Revision 4.0  1994/02/17  20:59:54  caress
- * First cut at new version. No changes.
- *
- * Revision 3.0  1993/05/14  22:51:50  sohara
- * initial version
- *
- */
-/*
- * Notes on the MBF_HSLDEOIH data format:
- *   1. Hydrosweep DS multibeam systems output raw data in an
- *      ascii format.  The data consists of a number of different
- *      multi-line ascii records.
- *   2. The DS systems output 59 beams of bathymetry and 59 beams
- *      of backscatter measurements, along with a plethora of other
- *      information.
- *   3. The records all include navigation and time stamp information.
- *      The record types are:
- *        ERGNHYDI:  mean and keel water velocity values
- *        ERGNPARA:  navigation when system in standby
- *        ERGNPOSI:  navigation source
- *        ERGNMESS:  across-track "survey" bathymetry
- *        ERGNEICH:  along-track "calibration" bathymetry
- *        ERGNLSZT:  travel times associated with
- *                   ERGNMESS or ERGNEICH records
- *        ERGNCTDS:  water sound velocity profile
- *        ERGNAMPL:  amplitudes associated with
- *                   ERGNMESS or ERGNEICH records
- *        LDEOCOMM:  comment records (an L-DEO extension)
- *   4. A single ping usually results in the following series of
- *      of records:
- *        1. ERGNMESS or ERGNEICH
- *        2. ERGNSLZT
- *        3. ERGNAMPL
- *      The ERGNHYDI, ERGNPARA, ERGNPOSI and ERGNCTDS records occur
- *      at system startup and when the associated operational
- *      parameters of the Hydrosweep are changed.
- *   5. The kind value in the mbf_hsldeoih_struct indicates whether the
- *      mbf_hsldeoih_data_struct structure holds data from a ping or
- *      data from some other record:
- *        kind = 1 : data from a survey ping
- *                   (ERGNMESS + ERGNSLZT + ERGNAMPL)
- *        kind = 2 : comment (LDEOCOMM)
- *        kind = 4 : data from a calibrate ping
- *                   (ERGNEICH + ERGNSLZT + ERGNAMPL)
- *        kind = 5 : mean and keel velocity (ERGNHYDI)
- *        kind = 6 : water velocity profile (ERGNCTDS)
- *        kind = 7 : standby navigation (ERGNPARA)
- *        kind = 8 : navigation source (ERGNPOSI)
- *   6. The data structure defined below includes all of the values
- *      which are passed in Hydrosweep records.
- *   7. The data structure defined below also includes backscatter values
- *      obtained by processing the amplitude information.
- *   8. The first four bytes of every data record consist of the characters
- *      "data" which has a four byte integer equivalent value of 1684108385.
- *   9. Following the "data" flag is a two byte integer value containing
- *      the kind of data contained in the record.  The length of the
- *      record will depend on the kind.  The data structures associated
- *      with the different data records are defined below.
- *   10. This format is envisioned as the L-DEO in-house archive format
- *      for processed Hydrosweep DS data.
- *   11. The kind values have changed. In older versions the definitions
- *      where:
- *        kind = 1 : data from a survey ping
- *                   (ERGNMESS + ERGNSLZT + ERGNAMPL)
- *        kind = 2 : comment (LDEOCOMM)
- *        kind = 3 : data from a calibrate ping
- *                   (ERGNEICH + ERGNSLZT + ERGNAMPL)
- *        kind = 4 : mean and keel velocity (ERGNHYDI)
- *        kind = 5 : water velocity profile (ERGNCTDS)
- *        kind = 6 : standby navigation (ERGNPARA)
- *        kind = 7 : navigation source (ERGNPOSI)
- *      The code checks for and fixes older data files on read,
- *      using the record size values to check for bad kind values.
- */
-
-/* maximum number of depth-velocity pairs */
-#define MBF_HSLDEOIH_MAXVEL 30
-
-/* maximum line length in characters */
-#define MBF_HSLDEOIH_MAXLINE 200
-
-/* number of beams for hydrosweep */
-#define MBF_HSLDEOIH_BEAMS 59
-
-/* record label value (integer equivalent to "data" */
-#define MBF_HSLDEOIH_LABEL 1684108385
-
-/* data record kind values */
-#define MBF_HSLDEOIH_KIND_DATA			1
-#define MBF_HSLDEOIH_KIND_COMMENT		2
-#define MBF_HSLDEOIH_KIND_CALIBRATE		4
-#define MBF_HSLDEOIH_KIND_MEAN_VELOCITY		5
-#define MBF_HSLDEOIH_KIND_VELOCITY_PROFILE	6
-#define MBF_HSLDEOIH_KIND_STANDBY		7
-#define MBF_HSLDEOIH_KIND_NAV_SOURCE		8
-#define MBF_HSLDEOIH_OLDKIND_CALIBRATE		3
-#define MBF_HSLDEOIH_OLDKIND_MEAN_VELOCITY	4
-#define MBF_HSLDEOIH_OLDKIND_VELOCITY_PROFILE	5
-#define MBF_HSLDEOIH_OLDKIND_STANDBY		6
-#define MBF_HSLDEOIH_OLDKIND_NAV_SOURCE		7
-
-/* array matching gain values to appropriate beam */
-static int which_gain[MBSYS_HSDS_BEAMS] =
-			{ 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3,
-			  4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6,
-			  7, 7, 7, 7, 8, 8, 8, 8, 9, 9, 9, 9,
-			 10,10,10,10,11,11,11,11,12,12,12,12,
-			 13,13,13,13,14,14,14,14,15 };
-
-/* complete data structure containing everything */
-struct mbf_hsldeoih_struct
-	{
-	/* type of data record */
-	int	kind;
-
-	/* position (all records ) */
-	double	lon;
-	double	lat;
-
-	/* time stamp (all records ) */
-	int	year;
-	int	month;
-	int	day;
-	int	hour;
-	int	minute;
-	int	second;
-	int	alt_minute;
-	int	alt_second;
-
-	/* additional navigation and depths (ERGNMESS and ERGNEICH) */
-	double	course_true;
-	double	speed_transverse;
-	double	speed;
-	char	speed_reference[2];
-	double	pitch;
-	int	track;
-	double	depth_center;
-	double	depth_scale;
-	int	spare;
-	int	distance[MBF_HSLDEOIH_BEAMS];
-	int	depth[MBF_HSLDEOIH_BEAMS];
-
-	/* travel time data (ERGNSLZT) */
-	double	course_ground;
-	double	speed_ground;
-	double	heave;
-	double	roll;
-	double	time_center;
-	double	time_scale;
-	int	time[MBF_HSLDEOIH_BEAMS];
-	double	gyro[11];
-
-	/* amplitude data (ERGNAMPL) */
-	char	mode[2];
-	int	trans_strbd;
-	int	trans_vert;
-	int	trans_port;
-	int	pulse_len_strbd;
-	int	pulse_len_vert;
-	int	pulse_len_port;
-	int	gain_start;
-	int	r_compensation_factor;
-	int	compensation_start;
-	int	increase_start;
-	int	tvc_near;
-	int	tvc_far;
-	int	increase_int_near;
-	int	increase_int_far;
-	int	gain_center;
-	double	filter_gain;
-	int	amplitude_center;
-	int	echo_duration_center;
-	int	echo_scale_center;
-	int	gain[16];
-	int	amplitude[MBF_HSLDEOIH_BEAMS];
-	int	echo_scale[16];
-	int	echo_duration[MBF_HSLDEOIH_BEAMS];
-
-	/* mean velocity (ERGNHYDI) */
-	double	draught;
-	double	vel_mean;
-	double	vel_keel;
-	double	tide;
-
-	/* water velocity profile (HS_ERGNCTDS) */
-	int	num_vel;
-	double	vdepth[MBF_HSLDEOIH_MAXVEL];
-	double	velocity[MBF_HSLDEOIH_MAXVEL];
-
-	/* navigation source (ERGNPOSI) */
-	double	pos_corr_x;
-	double	pos_corr_y;
-	char	sensors[10];
-
-	/* comment (LDEOCMNT) */
-	char	comment[MBF_HSLDEOIH_MAXLINE];
-
-	/* processed backscatter data */
-	double	back_scale;
-	int	back[MBF_HSLDEOIH_BEAMS];
-	};
-
-/* data structure for navigation source records */
-struct mbf_hsldeoih_nav_source_struct
-	{
-	/* position */
-	float		lon;
-	float		lat;
-
-	/* time stamp */
-	short int	year;
-	short int	month;
-	short int	day;
-	short int	hour;
-	short int	minute;
-	short int	second;
-	short int	alt_minute;
-	short int	alt_second;
-
-	/* navigation source */
-	float	pos_corr_x;
-	float	pos_corr_y;
-	char	sensors[10];
-	};
-
-/* data structure for mean velocity records */
-struct mbf_hsldeoih_mean_velocity_struct
-	{
-	/* position */
-	float		lon;
-	float		lat;
-
-	/* time stamp */
-	short int	year;
-	short int	month;
-	short int	day;
-	short int	hour;
-	short int	minute;
-	short int	second;
-	short int	alt_minute;
-	short int	alt_second;
-
-	/* mean velocity */
-	float		draught;
-	float		vel_mean;
-	float		vel_keel;
-	float		tide;
-	};
-
-/* data structure for velocity profile records */
-struct mbf_hsldeoih_velocity_profile_struct
-	{
-	/* position */
-	float		lon;
-	float		lat;
-
-	/* time stamp */
-	short int	year;
-	short int	month;
-	short int	day;
-	short int	hour;
-	short int	minute;
-	short int	second;
-
-	/* water velocity profile */
-	int	num_vel;
-	float	vdepth[MBF_HSLDEOIH_MAXVEL];
-	float	velocity[MBF_HSLDEOIH_MAXVEL];
-	};
-
-/* data structure for standby records */
-struct mbf_hsldeoih_standby_struct
-	{
-	/* position */
-	float		lon;
-	float		lat;
-
-	/* time stamp */
-	short int	year;
-	short int	month;
-	short int	day;
-	short int	hour;
-	short int	minute;
-	short int	second;
-	short int	alt_minute;
-	short int	alt_second;
-
-	/* additional navigation */
-	float		course_true;
-	float		speed_transverse;
-	float		speed;
-	char		speed_reference[2];
-	float		pitch;
-	short int	track;
-	float		depth_center;
-	};
-
-/* data structure for survey data records */
-struct mbf_hsldeoih_survey_struct
-	{
-	/* position */
-	float		lon;
-	float		lat;
-
-	/* time stamp */
-	short int	year;
-	short int	month;
-	short int	day;
-	short int	hour;
-	short int	minute;
-	short int	second;
-	short int	alt_minute;
-	short int	alt_second;
-
-	/* additional navigation and depths */
-	float		course_true;
-	float		speed_transverse;
-	float		speed;
-	char		speed_reference[2];
-	float		pitch;
-	short int	track;
-	float		depth_center;
-	float		depth_scale;
-	short int	spare;
-	short int	distance[MBF_HSLDEOIH_BEAMS];
-	short int	depth[MBF_HSLDEOIH_BEAMS];
-
-	/* travel time data */
-	float		course_ground;
-	float		speed_ground;
-	float		heave;
-	float		roll;
-	float		time_center;
-	float		time_scale;
-	short int	time[MBF_HSLDEOIH_BEAMS];
-	float		gyro[11];
-
-	/* amplitude data */
-	char		mode[2];
-	short int	trans_strbd;
-	short int	trans_vert;
-	short int	trans_port;
-	short int	pulse_len_strbd;
-	short int	pulse_len_vert;
-	short int	pulse_len_port;
-	short int	gain_start;
-	short int	r_compensation_factor;
-	short int	compensation_start;
-	short int	increase_start;
-	short int	tvc_near;
-	short int	tvc_far;
-	short int	increase_int_near;
-	short int	increase_int_far;
-	short int	gain_center;
-	float		filter_gain;
-	short int	amplitude_center;
-	short int	echo_duration_center;
-	short int	echo_scale_center;
-	short int	gain[16];
-	short int	amplitude[MBF_HSLDEOIH_BEAMS];
-	short int	echo_scale[16];
-	short int	echo_duration[MBF_HSLDEOIH_BEAMS];
-
-	/* processed backscatter data */
-	float		back_scale;
-	short int	back[MBF_HSLDEOIH_BEAMS];
-	};
-
-/* data structure for calibrate data records */
-struct mbf_hsldeoih_calibrate_struct
-	{
-	/* position */
-	float		lon;
-	float		lat;
-
-	/* time stamp */
-	short int	year;
-	short int	month;
-	short int	day;
-	short int	hour;
-	short int	minute;
-	short int	second;
-	short int	alt_minute;
-	short int	alt_second;
-
-	/* additional navigation and depths */
-	float		course_true;
-	float		speed_transverse;
-	float		speed;
-	char		speed_reference[2];
-	float		pitch;
-	short int	track;
-	float		depth_center;
-	float		depth_scale;
-	short int	spare;
-	short int	distance[MBF_HSLDEOIH_BEAMS];
-	short int	depth[MBF_HSLDEOIH_BEAMS];
-
-	/* travel time data */
-	float		course_ground;
-	float		speed_ground;
-	float		heave;
-	float		roll;
-	float		time_center;
-	float		time_scale;
-	short int	time[MBF_HSLDEOIH_BEAMS];
-	float		gyro[11];
-
-	/* amplitude data */
-	char		mode[2];
-	short int	trans_strbd;
-	short int	trans_vert;
-	short int	trans_port;
-	short int	pulse_len_strbd;
-	short int	pulse_len_vert;
-	short int	pulse_len_port;
-	short int	gain_start;
-	short int	r_compensation_factor;
-	short int	compensation_start;
-	short int	increase_start;
-	short int	tvc_near;
-	short int	tvc_far;
-	short int	increase_int_near;
-	short int	increase_int_far;
-	short int	gain_center;
-	float		filter_gain;
-	short int	amplitude_center;
-	short int	echo_duration_center;
-	short int	echo_scale_center;
-	short int	gain[16];
-	short int	amplitude[MBF_HSLDEOIH_BEAMS];
-	short int	echo_scale[16];
-	short int	echo_duration[MBF_HSLDEOIH_BEAMS];
-
-	/* processed backscatter data */
-	float		back_scale;
-	short int	back[MBF_HSLDEOIH_BEAMS];
-	};
-
-/* data structure for comment records */
-struct mbf_hsldeoih_comment_struct
-	{
-	/* comment */
-	char	comment[MBF_HSLDEOIH_MAXLINE];
-	};
diff --git a/src/mbio/mbf_hsmdaraw.h b/src/mbio/mbf_hsmdaraw.h
deleted file mode 100644
index ab779df..0000000
--- a/src/mbio/mbf_hsmdaraw.h
+++ /dev/null
@@ -1,305 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbf_hsmdaraw.h	8/11/95
- *	$Header: /system/link/server/cvs/root/mbsystem/src/mbio/mbf_hsmdaraw.h,v 5.2 2003/04/17 21:05:23 caress Exp $
- *
- *    Copyright (c) 1995-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbf_hsmdaraw.h defines the data structures used by MBIO functions
- * to store multibeam data read from the MBF_HSMDARAW format (MBIO id 101).
- *
- * Author:	Dale Chayes
- *      	David W. Caress
- * Date:	August 11, 1995
- *
- * $Log: mbf_hsmdaraw.h,v $
- * Revision 5.2  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.1  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.0  2000/12/01 22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.4  2000/09/30  06:34:20  caress
- * Snapshot for Dale.
- *
- * Revision 4.3  1998/10/05  18:32:27  caress
- * MB-System version 4.6beta
- *
- * Revision 4.2  1997/09/15  19:06:40  caress
- * Real Version 4.5
- *
- * Revision 4.2  1997/09/15  19:06:40  caress
- * Real Version 4.5
- *
- * Revision 4.1  1997/04/21  17:02:07  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.0  1995/09/28  18:14:11  caress
- * First cut.
- *
- * Revision 4.0  1995/09/28  18:14:11  caress
- * First cut.
- *
- * Revision 1.1  1995/09/28  18:10:48  caress
- * Initial revision
- *
- * Revision 4.2  95/08/16  07:07:41  07:07:41  dale (Dale Chayes)
- * This one works to some extent.
- *
- * Revision 4.1  95/08/14  20:54:33  20:54:33  dale (Dale Chayes)
- * Its partially working. HSMD is partially working.
- *
- * Revision 4.0  95/08/11  13:59:40  13:59:40  dale (Dale Chayes)
- * First attempt, not ready for use.
- * Copied from (and slightly modified) mbf_hsatlraw.h
- *
- *
- *
- * Notes on the MBSYS_HSMD data structure:
- *   1. The Atlas Hydrosweep MD generates several types of data files
- *      including:
- *           "*.P"    Profile data files that contain bathy data
- *           "*.W"    Wreck data files with info about obstructions
- *           "*.R"    Raw data files. At present, this is the only
- *                    data file format that is supported by MB. These
- *                    files are written in XDR format. Code to assist
- *                    in parsing these files was provided by STN Atlas.
- *
- *   2. The MD systems output 40 beams of bathymetry on one side and
- *      160 beams of amplitude measurements, along with a moras of other
- *      information.  MD systems ping to one side (making 40 beams & 160
- *      sidescan measurements), wait for all the returns and then ping
- *      to the other side. The "Raw.beamside" variable indicates which side
- *      the current ping is pointed.
- *
- *   3. The records all include navigation and time stamp information.
- *      There is a Header block in front of every data record. The
- *      record types are:
- *        - Raw Event (RAW in the case statement) which contains the
- *          travel time and amplitude data along with other interesting
- *          parameters.
- *        - Navigation (NAV -------"------------) which contains one
- *          input record from the NAV system.
- *        - MD Event
- *        - Beam angle data (ANG) which contains the pointing angles
- *          of the beams. The MD system is supposed to be able to operate
- *          in a beam hopping mode where the beam angles shift from ping
- *          to ping, but this is not yet enabled. The Raw.noho variable
- *          indicated the "hopping" state.
- *        - Sound Velocity (SVP) can contain a sound speed profile.
- *        - Raw Event (REV) which seems to happen at the beginging of
- *          each data file.
- *
- *   4. A single ping usually insonifies one side of the track and results
- *      in RAW data record. Sequential RAW records occur for alternating
- *      sides. NAV records appear to happen at the rate at which they are
- *      supplied by either of the possible Navigation inputs. In early legs
- *      (1994) on the Alliance, two different nav systems were inserting
- *      records, one flagged with an "I" for Integrated Nav and the other
- *      using a "G" to signify GPS. Some time early in 1995, the onboard
- *      nav system was changed and now there appears to be only one type
- *      "I" of input nav data. It appears to happen once per second.
- *
- *   5. The data structure defined below includes all of the values
- *      which are passed in Hydrosweep MD records.
- *
- *   6. Comment records have been implemented for use with MB-System
- *      programs. Comment records are NOT part of the vendor format
- *      definition and are NOT supported by Atlas software. Using
- *      mbcopy with the -N option will remove all comments and make
- *      the data compatible with Atlas software.
- */
-
-/* HSMD defines */
-
-/* maximum number of depth/sound speed data pairs allowed */
-#define MBF_HSMDARAW_MAXVEL		20
-
-/* maximum number of nonzero beams per ping */
-#define MBF_HSMDARAW_BEAMS_PING		40
-
-/* Stores both sides of swath, either starboard or port is nonzero in a ping. */
-#define MBF_HSMDARAW_BEAMS		79
-
-/* maximum number of sidescan pixels in a single ping */
-#define MBF_HSMDARAW_PIXELS_PING		160
-
-/* Stores both sides of swath, either starboard or port is nonzero in a ping. */
-#define MBF_HSMDARAW_PIXELS		319
-
-/* length of a comment string */
-#define MBF_HSMDARAW_COMMENT (128)
-
-/* define id's for the different types of raw Hydrosweep records */
-
-#define MBF_HSMDARAW_RECORDS	8 /* Zero, plus 6 from Atlas, plus comment */
-
- /* For HSMD, these (the 1-6 at least) are the "transid" fields */
-#define	MBF_HSMDARAW_NONE	0
-#define	MBF_HSMDARAW_RAW 	1 /* Raw data */
-#define MBF_HSMDARAW_NAV        2 /* Navigation data */
-#define	MBF_HSMDARAW_MDE 	3 /* MD Event */
-#define	MBF_HSMDARAW_ANG 	4 /* Beam angle data */
-#define	MBF_HSMDARAW_SVP 	5 /* Sound speed profile */
-#define	MBF_HSMDARAW_REV 	6 /* Raw event eg. start of file */
-#define MBF_HSMDARAW_COM        7 /* LDEO comment */
-#define MBF_HSMDARAW_BAT        8 /* LDEO bathymetry + raw data */
-
-char *mbf_hsmdaraw_labels[] = {
-  "NONE",
-  "RAW",			/* a Raw data record */
-  "NAV",			/* Navigation data */
-  "MDE",			/* Poke of the "Event button?" */
-  "ANG",			/* Beam angle data */
-  "SVP",			/* Sound Speed Profile */
-  "REV",			/* Raw Event (like start and stop) */
-  "COM"				/* an LDEO comment */
-};
-
-#define HEADER_ADJUST 12        /* magic offset to subract from scslng to
-                                 * account for the header record
-                                 */
-
-/*********** HSMD Raw data file record types **************************/
-#define RAW    1                /* Raw data */
-#define NAV    2                /* Nav data */
-#define MDE    3                /* MD Event */
-#define ANG    4                /* Beam Angle */
-#define SVP    5                /* Sound Velocity Profile */
-#define REV    6                /* Raw EVent */
-#define COM    7		/* LDEO comment */
-
-/* This structure is an amalgamation of the individual strucutres used in
- * the Atlas example code and propageted into scan_md. MB requires (works
- * better with) a single structure. */
-
-struct  mbf_hsmdaraw_struct {
-	int	kind;
-
-	/* ------------------------------- Header data */
-	char	scsid[4];		/* Typically "DXT" */
-	char	scsart[4];		/* Typically "REI" or "RMM" */
-	int	scslng;			/* length of subsequent data */
-	int	scsext;			/* seems to be 0 */
-	int	scsblcnt;		/* seems to be ping number */
-	double	scsres1;		/* seems to be 0 */
-	int	transid;		/* ID of the type of data to follow */
-	double	reftime;		/* Internal time of day reference */
-
-					/* data from a "Raw Event" */
-	double	datuhr;			/* Unix epoch time + decimal seconds */
-	char	mksysint[8];		/* Text message eg. "START" */
-	char	mktext[84];		/* Text message eg.  "KAE HMS Start-Marke" */
-
-	/* -------------------------------- Navigation data */
-	int	navid;			/* Which nav input  */
-	int	year;			/* "Date" type */
-	int	month;			/* month */
-	int	day;			/* day of the month */
-	int	hour;			/* hour of the day */
-	int	minute;			/* minute of the hour */
-	int	second;			/* seconds of the minute */
-	double	secf;			/* seconds of the minute */
-	int	millisecond;
-	double	PingTime;		/* floating point time */
-
-	double	lat;			/* Position, decimal degrees */
-	double	lon;			/* North and East are positive */
-	char	pos_sens[2];		/* "G"== GPS,  "I"== Integrated */
-
-	/* ------------------------------- From "Raw" data record */
-	double	ckeel;			/* sound speed at the keel */
-	double	cmean;			/* mean sound speed for water column */
-	int	Port;			/* Port or Starboard ping (beamside)*/
-	int	noho;			/* Indicates beam "hopping" mode */
-	int	skals;			/* scale factor flag (0 -> .1, else .01 */
-	int	spfb[MBF_HSMDARAW_BEAMS_PING];	/* unscaled travel times */
-	double	depth[MBF_HSMDARAW_BEAMS_PING];		/* cross track depths */
-	double	distance[MBF_HSMDARAW_BEAMS_PING];	/* cross track distances */
-	double	ss_range;				/* distance to outermost
-								sidescan
-								sample (meters) */
-	mb_u_char	ss[MBF_HSMDARAW_PIXELS_PING];	/* sidescan pixels */
-	double	heading_tx;		/* Heading at transmit */
-	double	heading_rx[5];		/* Heading during the receive window */
-	double	roll_tx;		/* Roll at transmit */
-	double	roll_rx[5];		/* Roll during receive window */
-	double	pitch_tx;		/* Pitch at transmit */
-	double	pitch_rx[5];		/* Pitch during receive window */
-
-	/* ------------------------------- From the Angle data record */
-	double	angle[MBF_HSMDARAW_BEAMS_PING];	/* Table of beam angles */
-
-	int	evid;			/* from MD Events */
-	char	evtext[84];
-
-	/* ------------------------------- Theoretical data from Sound Speed record */
-
-	int	num_vel;		/* number of Depth/Sound Speed pairs */
-	double	vdepth[20];		/* array of depths */
-	double	velocity[20];		/* array of sound speeds */
-
-	/* ----------------- derived data --------------------------------  */
-
-	char	comment[MBSYS_HSMD_COMMENT]; /* I guess we will have comments
-						    for MB records some day? */
-	double	heave;
-	double	speed;			/* not provided in HSMD */
-	};
-
-/* Atlas has expressed an intention to support "beam hopping" in the
-future but all existing systems and data do not exhibit "hopping",
-so we use a simple table of angles */
-double mbf_hsmdaraw_beamangle[] = {
-   0.000,
-   4.395,
-   8.740,
-  12.991,
-  17.095,
-  21.028,
-  24.769,
-  28.295,
-  31.597,
-  34.684,
-  37.562,
-  40.226,
-  42.698,
-  44.989,
-  47.115,
-  49.076,
-  50.900,
-  52.586,
-  54.152,
-  55.613,
-  56.970,
-  58.233,
-  59.414,
-  60.518,
-  61.551,
-  62.518,
-  63.430,
-  65.028,
-  66.462,
-  67.742,
-  68.901,
-  69.950,
-  70.900,
-  71.768,
-  72.565,
-  73.295,
-  73.965,
-  74.592,
-  75.168,
-  75.701
-};
diff --git a/src/mbio/mbf_hsmdldih.h b/src/mbio/mbf_hsmdldih.h
deleted file mode 100644
index 4eb0bf3..0000000
--- a/src/mbio/mbf_hsmdldih.h
+++ /dev/null
@@ -1,300 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbf_hsmdldih.h	9/26/95
- *	$Header: /system/link/server/cvs/root/mbsystem/src/mbio/mbf_hsmdldih.h,v 5.3 2003/04/17 21:05:23 caress Exp $
- *
- *    Copyright (c) 1995-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbf_hsmdldih.h defines the data structures used by MBIO functions
- * to store multibeam data read from the MBF_HSMDLDIH format (MBIO id 102).
- *
- * Author:	David W. Caress
- * Date:	September 26, 1995
- *
- * $Log: mbf_hsmdldih.h,v $
- * Revision 5.3  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.2  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.1  2002/07/20 20:42:40  caress
- * Release 5.0.beta20
- *
- * Revision 5.0  2000/12/01 22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.4  2000/09/30  06:34:20  caress
- * Snapshot for Dale.
- *
- * Revision 4.3  1998/10/05  18:32:27  caress
- * MB-System version 4.6beta
- *
- * Revision 4.2  1997/09/15  19:06:40  caress
- * Real Version 4.5
- *
- * Revision 4.2  1997/09/15  19:06:40  caress
- * Real Version 4.5
- *
- * Revision 4.1  1997/04/21  17:02:07  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.0  1995/09/28  18:14:11  caress
- * First cut.
- *
- * Revision 4.0  1995/09/28  18:14:11  caress
- * First cut.
- *
- * Revision 1.1  1995/09/28  18:10:48  caress
- * Initial revision
- *
- *
- *
- *
- * Notes on the MBSYS_HSMD data structure:
- *   1. The Atlas Hydrosweep MD generates several types of data files
- *      including:
- *           "*.P"    Profile data files that contain bathy data
- *           "*.W"    Wreck data files with info about obstructions
- *           "*.R"    Raw data files. At present, this is the only
- *                    data file format that is supported by MB. These
- *                    files are written in XDR format. Code to assist
- *                    in parsing these files was provided by STN Atlas.
- *
- *   2. The MD systems output 40 beams of bathymetry on one side and
- *      160 beams of amplitude measurements, along with a moras of other
- *      information.  MD systems ping to one side (making 40 beams & 160
- *      sidescan measurements), wait for all the returns and then ping
- *      to the other side. The "Raw.beamside" variable indicates which side
- *      the current ping is pointed.
- *
- *   3. The records all include navigation and time stamp information.
- *      There is a Header block in front of every data record. The
- *      record types are:
- *        - Raw Event (RAW in the case statement) which contains the
- *          travel time and amplitude data along with other interesting
- *          parameters.
- *        - Navigation (NAV -------"------------) which contains one
- *          input record from the NAV system.
- *        - MD Event
- *        - Beam angle data (ANG) which contains the pointing angles
- *          of the beams. The MD system is supposed to be able to operate
- *          in a beam hopping mode where the beam angles shift from ping
- *          to ping, but this is not yet enabled. The Raw.noho variable
- *          indicated the "hopping" state.
- *        - Sound Velocity (SVP) can contain a sound speed profile.
- *        - Raw Event (REV) which seems to happen at the beginging of
- *          each data file.
- *
- *   4. A single ping usually insonifies one side of the track and results
- *      in RAW data record. Sequential RAW records occur for alternating
- *      sides. NAV records appear to happen at the rate at which they are
- *      supplied by either of the possible Navigation inputs. In early legs
- *      (1994) on the Alliance, two different nav systems were inserting
- *      records, one flagged with an "I" for Integrated Nav and the other
- *      using a "G" to signify GPS. Some time early in 1995, the onboard
- *      nav system was changed and now there appears to be only one type
- *      "I" of input nav data. It appears to happen once per second.
- *
- *   5. The data structure defined below includes all of the values
- *      which are passed in raw Hydrosweep MD records. It also
- *      includes depth and acrosstrack distances calculated from
- *      the travel times, which are stored in the MBF_HSMDLDIH format.
- *
- *   6. Comment records have been implemented for use with MB-System
- *      programs. Comment records are NOT part of the vendor format
- *      definition and are NOT supported by Atlas software. Using
- *      mbcopy with the -N option will remove all comments and make
- *      the data compatible with Atlas software.
- */
-
-/* HSMD defines */
-
-/* maximum number of depth/sound speed data pairs allowed */
-#define MBF_HSMDLDIH_MAXVEL		20
-
-/* maximum number of nonzero beams per ping */
-#define MBF_HSMDLDIH_BEAMS_PING		40
-
-/* Stores both sides of swath, either starboard or port is nonzero in a ping. */
-#define MBF_HSMDLDIH_BEAMS		79
-
-/* maximum number of sidescan pixels in a single ping */
-#define MBF_HSMDLDIH_PIXELS_PING		160
-
-/* Stores both sides of swath, either starboard or port is nonzero in a ping. */
-#define MBF_HSMDLDIH_PIXELS		319
-
-/* length of a comment string */
-#define MBF_HSMDLDIH_COMMENT (128)
-
-/* define id's for the different types of raw Hydrosweep records */
-
-#define MBF_HSMDLDIH_RECORDS	8 /* Zero, plus 6 from Atlas, plus comment */
-
- /* For HSMD, these (the 1-6 at least) are the "transid" fields */
-#define	MBF_HSMDLDIH_NONE	0
-#define	MBF_HSMDLDIH_RAW 	1 /* Raw data */
-#define MBF_HSMDLDIH_NAV        2 /* Navigation data */
-#define	MBF_HSMDLDIH_MDE 	3 /* MD Event */
-#define	MBF_HSMDLDIH_ANG 	4 /* Beam angle data */
-#define	MBF_HSMDLDIH_SVP 	5 /* Sound speed profile */
-#define	MBF_HSMDLDIH_REV 	6 /* Raw event eg. start of file */
-#define MBF_HSMDLDIH_COM        7 /* LDEO comment */
-#define MBF_HSMDLDIH_BAT        8 /* LDEO bathymetry + raw data */
-
-char *mbf_hsmdldih_labels[] = {
-  "NONE",
-  "RAW",			/* a Raw data record */
-  "NAV",			/* Navigation data */
-  "MDE",			/* Poke of the "Event button?" */
-  "ANG",			/* Beam angle data */
-  "SVP",			/* Sound Speed Profile */
-  "REV",			/* Raw Event (like start and stop) */
-  "COM"				/* an LDEO comment */
-};
-
-#define HEADER_ADJUST 12        /* magic offset to subract from scslng to
-                                 * account for the header record
-                                 */
-
-/*********** HSMD Raw data file record types **************************/
-#define RAW    1                /* Raw data */
-#define NAV    2                /* Nav data */
-#define MDE    3                /* MD Event */
-#define ANG    4                /* Beam Angle */
-#define SVP    5                /* Sound Velocity Profile */
-#define REV    6                /* Raw EVent */
-#define COM    7		/* LDEO comment */
-
-/* This structure is an amalgamation of the individual strucutres used in
- * the Atlas example code and propageted into scan_md. MB requires (works
- * better with) a single structure. */
-
-struct  mbf_hsmdldih_struct {
-	int	kind;
-
-	/* ------------------------------- Header data */
-	char	scsid[4];		/* Typically "DXT" */
-	char	scsart[4];		/* Typically "REI" or "RMM" */
-	int	scslng;			/* length of subsequent data */
-	int	scsext;			/* seems to be 0 */
-	int	scsblcnt;		/* seems to be ping number */
-	double	scsres1;		/* seems to be 0 */
-	int	transid;		/* ID of the type of data to follow */
-	double	reftime;		/* Internal time of day reference */
-
-					/* data from a "Raw Event" */
-	double	datuhr;			/* Unix epoch time + decimal seconds */
-	char	mksysint[8];		/* Text message eg. "START" */
-	char	mktext[84];		/* Text message eg.  "KAE HMS Start-Marke" */
-
-	/* -------------------------------- Navigation data */
-	int	navid;			/* Which nav input  */
-	int	year;			/* "Date" type */
-	int	month;			/* month */
-	int	day;			/* day of the month */
-	int	hour;			/* hour of the day */
-	int	minute;			/* minute of the hour */
-	int	second;			/* seconds of the minute */
-	double	secf;			/* seconds of the minute */
-	int	millisecond;
-	double	PingTime;		/* floating point time */
-
-	double	lat;			/* Position, decimal degrees */
-	double	lon;			/* North and East are positive */
-	char	pos_sens[2];		/* "G"== GPS,  "I"== Integrated */
-
-	/* ------------------------------- From "Raw" data record */
-	double	ckeel;			/* sound speed at the keel */
-	double	cmean;			/* mean sound speed for water column */
-	int	Port;			/* Port or Starboard ping (beamside)*/
-	int	noho;			/* Indicates beam "hopping" mode */
-	int	skals;			/* scale factor flag (0 -> .1, else .01 */
-	int	spfb[MBF_HSMDLDIH_BEAMS_PING];	/* unscaled travel times */
-	double	depth[MBF_HSMDLDIH_BEAMS_PING];		/* cross track depths */
-	double	distance[MBF_HSMDLDIH_BEAMS_PING];	/* cross track distances */
-	double	ss_range;				/* distance to outermost
-								sidescan
-								sample (meters) */
-	mb_u_char	ss[MBF_HSMDLDIH_PIXELS_PING];	/* sidescan pixels */
-	double	heading_tx;		/* Heading at transmit */
-	double	heading_rx[5];		/* Heading during the receive window */
-	double	roll_tx;		/* Roll at transmit */
-	double	roll_rx[5];		/* Roll during receive window */
-	double	pitch_tx;		/* Pitch at transmit */
-	double	pitch_rx[5];		/* Pitch during receive window */
-
-	/* ------------------------------- From the Angle data record */
-	double	angle[MBF_HSMDLDIH_BEAMS_PING];	/* Table of beam angles */
-
-	int	evid;			/* from MD Events */
-	char	evtext[84];
-
-	/* ------------------------------- Theoretical data from Sound Speed record */
-
-	int	num_vel;		/* number of Depth/Sound Speed pairs */
-	double	vdepth[MBF_HSMDLDIH_MAXVEL];		/* array of depths */
-	double	velocity[MBF_HSMDLDIH_MAXVEL];		/* array of sound speeds */
-
-	/* ----------------- derived data --------------------------------  */
-
-	char	comment[MBSYS_HSMD_COMMENT]; /* I guess we will have comments
-						    for MB records some day? */
-	double	heave;
-	double	speed;			/* not provided in HSMD */
-	};
-
-/* Atlas has expressed an intention to support "beam hopping" in the
-future but all existing systems and data do not exhibit "hopping",
-so we use a simple table of angles */
-double mbf_hsmdldih_beamangle[] = {
-   0.000,
-   4.395,
-   8.740,
-  12.991,
-  17.095,
-  21.028,
-  24.769,
-  28.295,
-  31.597,
-  34.684,
-  37.562,
-  40.226,
-  42.698,
-  44.989,
-  47.115,
-  49.076,
-  50.900,
-  52.586,
-  54.152,
-  55.613,
-  56.970,
-  58.233,
-  59.414,
-  60.518,
-  61.551,
-  62.518,
-  63.430,
-  65.028,
-  66.462,
-  67.742,
-  68.901,
-  69.950,
-  70.900,
-  71.768,
-  72.565,
-  73.295,
-  73.965,
-  74.592,
-  75.168,
-  75.701
-};
diff --git a/src/mbio/mbf_hsuricen.h b/src/mbio/mbf_hsuricen.h
deleted file mode 100644
index 907de52..0000000
--- a/src/mbio/mbf_hsuricen.h
+++ /dev/null
@@ -1,114 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbf_hsuricen.h	1/20/93
- *	$Id: mbf_hsuricen.h 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1993-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbf_hsuricen.h defines the data structure used by MBIO functions
- * to store multibeam data read from the  MBF_HSURICEN format (MBIO id 23).
- *
- * Author:	D. W. Caress
- * Date:	January 20, 1993
- * $Log: mbf_hsuricen.h,v $
- * Revision 5.2  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.1  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.0  2000/12/01 22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.5  2000/09/30  06:34:20  caress
- * Snapshot for Dale.
- *
- * Revision 4.4  1998/10/05  17:46:15  caress
- * MB-System version 4.6beta
- *
- * Revision 4.3  1997/09/15  19:06:40  caress
- * Real Version 4.5
- *
- * Revision 4.2  1997/04/21  17:02:07  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.1  1994/10/21  12:20:01  caress
- * Release V4.0
- *
- * Revision 4.1  1994/10/21  12:20:01  caress
- * Release V4.0
- *
- * Revision 4.0  1994/03/06  00:01:56  caress
- * First cut at version 4.0
- *
- * Revision 4.2  1994/03/03  03:39:43  caress
- * Fixed copyright message.
- *
- * Revision 4.1  1994/02/17  21:19:08  caress
- * Updated associated MBIO format id in comments.
- *
- * Revision 4.0  1994/02/17  20:59:54  caress
- * First cut at new version. No changes.
- *
- * Revision 3.0  1993/05/14  22:52:10  sohara
- * initial version
- *
- */
-/*
- * Notes on the MBF_HSURICEN data format:
- *   1. This data format is used to store 59 beam Hydrosweep DS bathymetry
- *      data.  This format was created and used by the Ocean Mapping
- *      Development Center at the Graduate School of Oceanography of
- *      the University of Rhode Islande; most data files in this format
- *      consist of Hydrosweep DS data collected on the R/V Maurice Ewing.
- *   2. The data consist of 328 byte records including 1-byte characters,
- *      2-byte integers, and 8-byte integers.
- *   3. The 59 depth values are stored centered in 59 value arrays.  The
- *      center beam is in word 30 of the depth and distance arrays.
- *   4. Comments can be embedded in the data as 100 byte ascii strings,
- *	where the first two characters must always be "cc" so that the
- *      sec value is 25443.
- *   5. This format was deciphered from examples of data.
- *
- * The kind value in the mbf_hsuricen_struct indicates whether the
- * mbf_hsuricen_data_struct structure holds data (kind = 1) or an
- * ascii comment record (kind = 2).
- *
- * The mbf_hsuricen_data_struct structure is a direct representation
- * of the binary data structure used in the MBF_HSURICEN format.
- */
-
-struct mbf_hsuricen_data_struct
-	{
-	short	sec;		/* seconds x 100 */
-	short	min;		/* minute of the day */
-	short	day;		/* day of the year */
-	short	year;		/* 4-digit year */
-	int	lat;		/* latitude in degrees times 10^7 */
-	int	lon;		/* longitude in degrees times 10^7 */
-	short	hdg;		/* heading in degrees x 10 */
-	short	course;		/* course in degrees x 10 */
-	short	speed;		/* speed in knots x 100 */
-	short	pitch;		/* pitch in degrees x 10 */
-	short	scale;		/* scale factor x 100 */
-	mb_u_char	speed_ref;	/* 'B' or 'W' */
-	mb_u_char	quality;
-	short	deph[59];	/* scaled depths in meters
-					portmost to stbdmost */
-	short	dist[59];	/* scaled cross track distances,
-					port ranges are negative */
-	};
-
-struct mbf_hsuricen_struct
-	{
-	int	kind;
-	struct mbf_hsuricen_data_struct data;
-	};
diff --git a/src/mbio/mbf_hypc8101.h b/src/mbio/mbf_hypc8101.h
deleted file mode 100644
index b1968f8..0000000
--- a/src/mbio/mbf_hypc8101.h
+++ /dev/null
@@ -1,576 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbf_hypc8101.h	8/21/94
- *	$Id: mbf_hypc8101.h 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1994-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbf_hypc8101.h defines the data structures used by MBIO functions
- * to store multibeam data read from the MBF_HYPC8101 format (MBIO id 83).
- *
- * Author:	D. W. Caress
- * Date:	August 21, 1994
- * $Log: mbf_hypc8101.h,v $
- * Revision 5.3  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.2  2003/01/15 20:51:48  caress
- * Release 5.0.beta28
- *
- * Revision 5.1  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.0  2000/12/01 22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.1  2000/09/30  06:34:20  caress
- * Snapshot for Dale.
- *
- * Revision 4.0  1999/01/01  23:38:01  caress
- * MB-System version 4.6beta6
- *
- * Revision 4.2  1998/10/05 17:46:15  caress
- * MB-System version 4.6beta
- *
- * Revision 4.1  1997/04/21  17:02:07  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.0  1994/10/21  12:35:04  caress
- * Release V4.0
- *
- * Revision 4.0  1994/10/21  12:35:04  caress
- * Release V4.0
- *
- * Revision 1.1  1994/10/21  12:20:01  caress
- * Initial revision
- *
- * Revision 1.1  1994/10/21  12:13:33  caress
- * Initial revision
- *
- *
- *
- */
-/*
- * Notes on the MBF_HYPC8101 data format:
- *   1. Reson SeaBat products are high frequency,
- *      shallow water multibeam sonars.
- *      Reson SeaBat 9001 systems output both bathymetry
- *      and amplitude information for 60 beams.
- *      Reson SeaBat 8101 systems output both bathymetry
- *      and amplitude information for up to 101 beams.
- *      These sonars use fixed, analog beamforming followed
- *      by a combination of amplitude and phase bottom
- *      detection.
- *   2. Reson multibeam systems output raw range and amplitude
- *      data in a binary format. The data acquisition systems
- *      associated with the sonars calculate bathymetry using
- *      a water sound velocity, roll, pitch, and heave data.
- *   3. Generally, Reson data acquisition systems record
- *      navigation asynchronously in the data stream, without
- *      providing speed information. This means that the
- *      navigation must be interpolated on the fly as the
- *      data is read.
- *   4. The navigation is frequently provided in projected
- *      coordinates (eastings and northings) rather than in
- *      longitude and latitude. Since MB-System operates solely
- *      in longitude and latitude, the original navigation must
- *      be unprojected.
- *   5. The Reson data formats supported by MB-System include:
- *        MBF_HYPC8101 - a binary format designed by John Hughes Clarke
- *           of the University of New Brunswick. Parameter and
- *           sound velocity profile records are included.
- *        MBF_CBAT8101 - a clone of the above format supporting
- *           Reson 8101 data.
- *        MBF_HYPC8101 - the ASCII format used by the HYPACK system
- *           of Coastal Oceanographics in conjunction with
- *           Reson 8101 data. This format is supported as read-only
- *           by MB-System.
- *        MBF_GSFGENMB - the generic sensor format of SAIC which
- *           supports data from a large number of sonars, including
- *           Reson sonars. MB-System handles GSF separately from
- *           other formats.
- *   6. For the UNB-style formats MBF_HYPC8101 and MBF_CBAT8101,
- *      each data telegram is preceded by a two byte start code and
- *      followed by a three byte end code consisting of 0x03
- *      followed by two bytes representing the checksum for
- *      the data bytes.  MB-System does not calculate checksums
- *      and puts 0's in the checksum bytes.
- *      The relevent telegram start codes, types, and sizes are:
- *         0x0240: Comment***                             200 data bytes
- *         0x0241: Position                                36 data bytes
- *         0x0242: Parameter                               44 data bytes
- *         0x0243: Sound velocity profile                2016 data bytes
- *         0x0244: SeaBat 9001 bathymetry                 752 data bytes
- *         0x0245: Short sound velocity profile           816 data bytes
- *         0x0246: SeaBat 8101 bathymetry***             1244 data bytes
- *         0x0247: Heading***                             752 data bytes
- *         0x0248: Attitude***                            752 data bytes
- *            *** Defined only for MB-System
- *   7. For the ASCII HYPACK format, the following information
- *      is take verbatim from Coastal Oceanographics documentation:
- *
- *        Coastal Oceanographics, Inc.
- *        Technical Note: Hypack Raw Data Format
- *
- *        Data collected by the Hypack Survey program is recorded
- *        in Raw format, one file per survey line. Raw files are
- *        recorded as text, allowing them to be loaded into any
- *        text editor that reads large files (Windows Notepad, Write
- *        and Wordpad for example).
- *
- *        When inspecting raw files, one of the first things noticed
- *        is that the format is not tabular. That is, there is not a record for
- *        each sounding containing depth, position, tide corrections,
- *        etc. Instead, there are separate records for each device
- *        measurement and the correlation between measurements is
- *        through time tags.
- *
- *        Every raw file contains two section; a header, which is
- *        written when data logging starts, and a data section, which is
- *        written as data is collected. Each record starts with a
- *        three character tag. The tags are:
- *
- *        Header
- *        ------
- *        DEV - Device Information
- *        EOH - End of Header
- *        EOL - End of Planned Line
- *        FTP - File Type
- *        INF - General Information
- *        LBP - Planned Line Begin Point
- *        LIN - Planned Line Data follows
- *        LNN - Planned Line Name
- *        OFF - Device Offsets
- *        PRD - Private Device Data
- *        PRI - Primary Navigation Device
- *        PTS - Planned Line Waypoint
- *        TND - Survey Time and Date
- *
- *        Data
- *        ----
- *        FIX - Fix (Event) Mark
- *        HCP - Heave Compensation
- *        EC1 - Echo Sounding (single frequency)
- *        EC2 - Echo Sounding (dual frequency)
- *        ECM - Echo Soundings (multiple transducer system)
- *        GYR - Gyro Data (Heading)
- *        POS - Position
- *        ROX - Roxann data
- *        SB2 - Multibeam data
- *
- *        --------------
- *        Header Section
- *        --------------
- *
- *        DEV - Device Information
- *        ------------------------
- *        DEV dn dc "Device Name"
- *        dn: Device Number
- *        dc: Device Capabilities is a bit coded field. The bit definitions are:
- *        Bit Mask Meaning
- *        0 1 Device provides Range/Range positions
- *        1 2 Device provides Range/Azimuth positions
- *        2 4 Device provides Lat/Long (e.g. GPS)
- *        3 8 Device provides grid positions XY
- *        4 16 Device provides echo soundings
- *        5 32 Device provides heading
- *        6 64 Device provides ship speed
- *        7 128 Hypack clock is synched to device clock
- *        8 256 Device provides tides
- *        9 512 Device provides heave, pitch and roll
- *        10 1024 Device is an ROV
- *        11 2048 Device is a Left/Right Indicator
- *        12 4096 Device accepts annotation strings
- *        13 8192 Device accepts output from Hypack
- *        14 16384 xxx
- *        15 32768 Device has extended capabilities
- *
- *        Example:
- *        DEV 0 100 "GPS"
- *
- *        INF - General Information
- *        -------------------------
- *        INF "surveyor" "boat" "project" "area" tc dc sv
- *        tc: initial tide correction
- *        dc: initial draft correction
- *        sv: sound velocity
- *
- *        Example:
- *        INF "steve" "LCH 19" "mcmillen" "617.6 to 618.2" -0.7 0 1500.0
- *
- *        EOH - End of Header
- *        -------------------
- *        This tag simply indicates end of header and has no data.
- *
- *        EOL - End of Planned Line
- *        -------------------------
- *        This tag simply indicates end of planned line information no data.
- *
- *        LBP - Planned Line Begin Point.
- *        -------------------------------
- *        LBP x y
- *        x: x grid position
- *        y: y grid position
- *
- *        Example:
- *        LBP 5567222.42 3771640.72
- *
- *        LIN - Planned Line Data follows
- *        -------------------------------
- *        LIN nw
- *        nw: Number of waypoints
- *
- *        Example:
- *        LIN 5
- *
- *        LNN - Planned Line Name
- *        -----------------------
- *        LNN text
- *        text: line name or number
- *
- *        Example:
- *        LNN 14
- *
- *        OFF - Device Offsets
- *        --------------------
- *        OFF dn n1 n2 n3 n4 n5 n6 n7
- *        dn: device number
- *        n1: starboard, port offset. Positive starboard.
- *        n2: forward, aft offset. Positive forward
- *        n3: height (antenna) or depth (transducer draft) offset. Always positive.
- *        n4: yaw rotation angle. Positive for clockwise rotation.
- *        n5: roll rotation angle. Port side up is positive.
- *        n6: pitch rotation angle. Bow up is positive.
- *        n7: device latency in seconds.
- *
- *        Example:
- *        OFF 0 0 0 13.35 0 0 0 0.86
- *
- *        PRD - Private Device Data
- *        -------------------------
- *        PRD - Multiple transducer offset
- *        PRD dn OFF n1 n2 n3
- *        dn: device number
- *        n1: transducer starboard offset
- *        n2: transducer forward offset
- *        n3: transducer depth offset (draft)
- *
- *        Example:
- *        PRD 1 OFF -25.60 0.00 0.40
- *
- *        PRD - Odom Echoscan II Multibeam Identifier
- *        -------------------------------------------
- *        PRD dn ECHOSCN2 n1 n2
- *        dn: device number
- *        n1: Not used
- *        n2: Beam width
- *
- *        Example:
- *        PRD 1 ECHOSCN2 -43.5 3.0
- *
- *        PRD - Reson Seabat 9001 Multibeam Identifier
- *        --------------------------------------------
- *        PRD dn SEABAT n1 n2
- *        dn: device number
- *        n1: Not used
- *        n2: Beam width
- *
- *        Example:
- *        PRD 1 SEABAT -44.2 1.5
- *
- *        PRD - Reson Seabat 9003 Multibeam Identifier
- *        --------------------------------------------
- *        PRD dn SEA9003 n1 n2
- *        dn: device number
- *        n1: Not used
- *        n2: Beam width
- *
- *        Example:
- *        PRD 1 SEA9003 -60.0 3.0
- *
- *        PRD - Reson Seabat 8101 Multibeam Identifier
- *        --------------------------------------------
- *        PRD dn SEA8101 n1 n2 n3
- *        dn: device number
- *        n1: Beam 1 angle
- *        n2: Angle increment
- *        n3: Number of beams
- *
- *        Example:
- *        PRD 1 SEA8101 -75.00 1.50 101
- *
- *        PRI - Primary Navigation Device
- *        -------------------------------
- *        PRI dn
- *        dn: device number
- *
- *        Example:
- *        PRI 0
- *
- *        PTS - Planned Line Waypoint
- *        ---------------------------
- *        PTS x y
- *        x: waypoint easting
- *        y: waypoint northing
- *
- *        Example:
- *        PTS 5569134.63 3774182.61
- *
- *        TND - Survey Time and Date
- *        --------------------------
- *        TND t d
- *        t: time string
- *        d: date string
- *
- *        Example:
- *        TND 15:54:33 08/28/95
- *
- *        --------------------------
- *        Data Section
- *        --------------------------
- *
- *        FIX - Fix (Event) Mark
- *        ----------------------
- *        FIX n
- *        n: event number
- *
- *        Example:
- *        FIX 152
- *
- *        HCP - Heave Compensation
- *        ------------------------
- *        HCP dn t h r p
- *        dn: device number
- *        t: time tag (seconds past midnight)
- *        h: heave in meters
- *        r: roll in degrees (+ port side up)
- *        p: pitch in degrees (+ bow up)
- *
- *        Example:
- *        HCP 2 57273.81 0 3.61 0
- *
- *        EC1 - Echo Sounding (single frequency)
- *        --------------------------------------
- *        EC1 dn t rd
- *        dn: device number
- *        t: time tag (seconds past midnight)
- *        rd: raw depth
- *
- *        Example:
- *        EC1 0 48077.365 3.20
- *
- *        EC2 - Echo Sounding (dual frequency)
- *        ------------------------------------
- *        EC2 dn t rd1 rd2
- *        dn: device number
- *        t: time tag (seconds past midnight)
- *        rd1: raw depth 1
- *        rd2: raw depth 2
- *
- *        Example:
- *        EC2 0 48077.365 3.20 3.15
- *
- *        ECM - Echo Soundings (multiple transducer system)
- *        -------------------------------------------------
- *        ECM dn t n rd1 rd2 ... rdn
- *        dn: device number
- *        t: time tag (seconds past midnight)
- *        n: number of transducers
- *        rd1: raw depth 1
- *        rd2: raw depth 2
- *        ...
- *        rdn: raw depth, transducer n
- *
- *        Example:
- *        ECM 1 57274.82 9 11 10.8 10.7 11.4 11.8 13 15.1 15.5 15.6
- *
- *        GYR - Gyro Data (Heading)
- *        -------------------------
- *        GYR dn t h
- *        dn: device number
- *        t: time tag (seconds past midnight)
- *        h: ship heading angle
- *
- *        Example:
- *        GYR 0 57274.04 193
- *
- *        POS - Position
- *        --------------
- *        POS dn t x y
- *        dn: device number
- *        t: time tag (seconds past midnight)
- *        x: easting
- *        y: northing
- *
- *        Example:
- *        POS 0 57274.04 5569070.02 3774080.46
- *
- *        ROX - Roxann data
- *        -----------------
- *        ROX dn t n e1 e2
- *        dn: device number
- *        t: time tag (seconds past midnight)
- *        n: number of values to follow (always 2)
- *        e1: roxann e1 measurement
- *        e2: roxann e2 measurement
- *
- *        Example:
- *        ROX 2 48077.474 2 0.03 0.13
- *
- *        SB2 - Multibeam data
- *        --------------------
- *        SB2 dn t n sv r1 r2 r3 ... rn q1 q2 ... qn
- *        dn: device number
- *        t: time tag (seconds past midnight)
- *        n: number of values to follow. Depends on device type.
- *        sv: sound velocity from device.
- *        r1-n: ranges in device units.
- *        q1-n: quality codes (0 to 3 range, 0=bad). Packed 4 per number.
- *
- *        Example (Echoscan II):
- *        SB2 1 48077.474 39 1500.00 19.50 19.31 ...
- *
- *        Example (Seabat 9001):
- *        SB2 1 48077.474 76 1500.00 19.50 19.31 ...
- *
- *        Example (Seabat 9003):
- *        SB2 1 48077.474 51 1500.00 19.50 19.31 ...
- *
- *        Example (Seabat 8101 using 101 beams):
- *        SB2 1 48077.474 51 1500.00 19.50 19.31 ...
- *
- */
-
-/* maximum number of beams and pixels */
-#define	MBF_HYPC8101_MAXBEAMS	101
-#define	MBF_HYPC8101_COMMENT_LENGTH	200
-#define	MBF_HYPC8101_NHCP_MAX		20
-#define	MBF_HYPC8101_NGYR_MAX		20
-#define	MBF_HYPC8101_NPOS_MAX		20
-#define	MBF_HYPC8101_NRAW_MAX		20
-#define	MBF_HYPC8101_MAXLINE		1024
-struct mbf_hypc8101_struct
-	{
-	/* type of data record */
-	int	kind;			/* Data vs Comment */
-
-	/* type of sonar */
-	int	sonar;			/* Type of Reson sonar */
-
-	/* parameter info (parameter telegrams) */
-	int	par_year;
-	int	par_month;
-	int	par_day;
-	int	par_hour;
-	int	par_minute;
-	int	par_second;
-	int	par_hundredth_sec;
-	int	par_thousandth_sec;
-	short	roll_offset;	/* roll offset (0.01 degrees) */
-	short	pitch_offset;	/* pitch offset (0.01 degrees) */
-	short	heading_offset;	/* heading offset (0.01 degrees) */
-	short	time_delay;	/* positioning system delay (0.001 sec) */
-	short	transducer_depth;	/* tranducer depth (0.01 meters) */
-	short	transducer_height;	/* reference height (0.01 meters) */
-	short	transducer_x;	/* reference athwartships offset (0.01 meters) */
-	short	transducer_y;	/* reference fore-aft offset (0.01 meters) */
-	short	antenna_x;	/* antenna athwartships offset (0.01 meters) */
-	short	antenna_y;	/* antenna fore-aft offset (0.01 meters) */
-	short	antenna_z;	/* antenna height (0.01 meters) */
-	short	motion_sensor_x;/* motion sensor athwartships offset (0.01 meters) */
-	short	motion_sensor_y;/* motion sensor fore-aft offset (0.01 meters) */
-	short	motion_sensor_z;/* motion sensor height offset (0.01 meters) */
-	short	spare;
-	short	line_number;
-	short	start_or_stop;
-	short	transducer_serial_number;
-
-	/* comment */
-	char	comment[MBSYS_RESON_COMMENT_LENGTH];
-
-	/* position (position telegrams) */
-	int	pos_year;
-	int	pos_month;
-	int	pos_day;
-	int	pos_hour;
-	int	pos_minute;
-	int	pos_second;
-	int	pos_hundredth_sec;
-	int	pos_thousandth_sec;
-	int	pos_latitude;		/* 180 deg = 2e9 */
-	int	pos_longitude;		/* 180 deg = 2e9 */
-	int	utm_northing;		/* 0.01 m */
-	int	utm_easting;		/* 0.01 m */
-	int	utm_zone_lon;		/* 180 deg = 2e9 */
-	char	utm_zone;
-	char	hemisphere;
-	char	ellipsoid;
-	char	pos_spare;
-	int	semi_major_axis;
-	int	other_quality;
-
-	/* sound velocity profile */
-	int	svp_year;
-	int	svp_month;
-	int	svp_day;
-	int	svp_hour;
-	int	svp_minute;
-	int	svp_second;
-	int	svp_hundredth_sec;
-	int	svp_thousandth_sec;
-	int	svp_latitude;		/* 180 deg = 2e9 */
-	int	svp_longitude;		/* 180 deg = 2e9 */
-	int	svp_num;
-	int	svp_depth[500]; /* 0.1 meters */
-	int	svp_vel[500];	/* 0.1 meters/sec */
-
-	/* bathymetry */
-	int	year;
-	int	month;
-	int	day;
-	int	hour;
-	int	minute;
-	int	second;
-	int	hundredth_sec;
-	int	thousandth_sec;
-	int	latitude;		/* 180 deg = 2e9 */
-	int	longitude;		/* 180 deg = 2e9 */
-	int	roll;			/* 0.005 degrees */
-	int	pitch;			/* 0.005 degrees */
-	int	heading;		/* 0.01 degrees */
-	int	heave;			/* 0.001 meters */
-	int	ping_number;
-	int	sound_vel;	/* 0.1 meters/sec */
-	int	mode;		/* unused */
-	int	gain1;		/* unused */
-	int	gain2;		/* unused */
-	int	gain3;		/* unused */
-	int	beams_bath;
-	short bath[MBF_HYPC8101_MAXBEAMS];
-				/* depths:  0.01 meters */
-	short int bath_acrosstrack[MBF_HYPC8101_MAXBEAMS];
-				/* acrosstrack distances: 0.01 meters */
-	short int bath_alongtrack[MBF_HYPC8101_MAXBEAMS];
-				/* alongtrack distances: 0.01 meters */
-	short int tt[MBF_HYPC8101_MAXBEAMS];
-				/* travel times:         0.01 msec */
-	short int angle[MBF_HYPC8101_MAXBEAMS];
-				/* 0.005 degrees */
-	short int quality[MBF_HYPC8101_MAXBEAMS];
-				/* 0 (bad) to 3 (good) */
-	short int amp[MBF_HYPC8101_MAXBEAMS];
-				/* ??? */
-
-	/* record keeping variables */
-	double	start_time_d;
-	double	angle0;
-	double	angle_inc;
-	};
diff --git a/src/mbio/mbf_mbarirov.h b/src/mbio/mbf_mbarirov.h
deleted file mode 100644
index 2cff0c8..0000000
--- a/src/mbio/mbf_mbarirov.h
+++ /dev/null
@@ -1,91 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbf_mbarirov.h	5/20/99
- *	$Id: mbf_mbarirov.h 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1999-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbf_mbarirov.h defines the data structures used by MBIO functions
- * to store multibeam data read from the MBF_MBARIROV format (MBIO id 21).
- *
- * Author:	D. W. Caress
- * Date:	May 20, 1999
- *
- * $Log: mbf_mbarirov.h,v $
- * Revision 5.3  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.2  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.1  2001/03/22 20:50:02  caress
- * Trying to make version 5.0.beta0
- *
- * Revision 5.0  2000/12/01  22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.3  2000/09/30  06:34:20  caress
- * Snapshot for Dale.
- *
- * Revision 4.2  1999/09/24  23:10:12  caress
- * Made this module work with older variant of format.
- *
- * Revision 4.1  1999/07/16  19:29:09  caress
- * First revision.
- *
- * Revision 1.1  1999/07/16  19:24:15  caress
- * Initial revision
- *
- *
- */
-/*
- * Notes on the MBF_MBARIROV data format:
- *   1. MBARI ROV navigation is stored as ascii tables with
- *      commas separating the fields.
- *   2. The MB-System implementation includes the support of
- *      an arbitrary number of comment records at the beginning
- *      of each file. The comment records begin with the character '#'.
- *
- */
-
-#define	MBF_MBARIROV_MAXLINE	256
-
-struct mbf_mbarirov_struct
-	{
-	/* type of data record */
-	int	kind;
-
-	/* time stamp */
-	double	time_d;
-	int	time_i[7];
-
-	/* navigation */
-	double	longitude;
-	double	latitude;
-	double	easting;
-	double	northing;
-	double	rov_depth;	/* m */
-	double	rov_pressure;	/* decibars */
-	double	rov_heading;	/* degrees */
-	double	rov_altitude;	/* m */
-	double	rov_pitch;	/* degrees */
-	double	rov_roll;	/* degrees */
-
-	/* flags */
-	int	position_flag;
-	int	pressure_flag;
-	int	heading_flag;
-	int	altitude_flag;
-	int	attitude_flag;
-
-	/* comment */
-	char	comment[MBF_MBARIROV_MAXLINE];
-	};
diff --git a/src/mbio/mbf_mbarrov2.h b/src/mbio/mbf_mbarrov2.h
deleted file mode 100644
index c6ce99b..0000000
--- a/src/mbio/mbf_mbarrov2.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbf_mbarrov2.h	10/3/2006
- *	$Id: mbf_mbarrov2.h 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1999-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbf_mbarrov2.h defines the data structures used by MBIO functions
- * to store multibeam data read from the MBF_MBARROV2 format (MBIO id 170).
- *
- * Author:	D. W. Caress
- * Date:	October 3, 2006
- *
- * $Log: mbf_mbarrov2.h,v $
- * Revision 5.0  2006/10/05 18:56:44  caress
- * New files for 5.1.0
- *
- */
-/*
- * Notes on the MBF_MBARROV2 data format:
- *   1. MBARI ROV navigation is stored as ascii tables with
- *      commas separating the fields.
- *   2. The MB-System implementation includes the support of
- *      an arbitrary number of comment records at the beginning
- *      of each file. The comment records begin with the character '#'.
- *
- */
-
-#define	MBF_MBARROV2_MAXLINE	1024
-
-struct mbf_mbarrov2_struct
-	{
-	/* type of data record */
-	int	kind;
-
-	/* RovName */
-	char	rovname[8];
-	int	divenumber;
-
-	/* time stamp */
-	double	time_d;
-	int	time_i[7];
-
-	/* navigation */
-	double	longitude;	/* degrees */
-	double	latitude;	/* degrees */
-	double	rov_depth;	/* m */
-	double	rov_pressure;	/* decibars */
-	double	rov_heading;	/* degrees */
-	double	rov_altitude;	/* m */
-	double	rov_pitch;	/* degrees */
-	double	rov_roll;	/* degrees */
-	double	ship_longitude;	/* degrees */
-	double	ship_latitude;	/* degrees */
-	double	ship_heading;	/* degrees */
-
-	/* flags */
-	int	qc_flag;
-
-	/* comment */
-	char	comment[MBF_MBARROV2_MAXLINE];
-	};
diff --git a/src/mbio/mbf_mbpronav.h b/src/mbio/mbf_mbpronav.h
deleted file mode 100644
index 8fab7f1..0000000
--- a/src/mbio/mbf_mbpronav.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbf_mbpronav.h	5/20/99
- *	$Id: mbf_mbpronav.h 2239 2015-05-07 00:51:42Z caress $
- *
- *    Copyright (c) 1999-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbf_mbpronav.h defines the data structures used by MBIO functions
- * to store navigation data read from the MBF_MBPRONAV format.
- *
- * Author:	D. W. Caress
- * Date:	May 20, 1999
- *
- */
-/*
- * Notes on the MBF_MBPRONAV data format:
- *   1. This is a simple ascii navigation format which includes
- *      time, longitude, latitude, heading, and speed.
- *   2. The MB-System implementation includes the support of
- *      an arbitrary number of comment records at the beginning
- *      of each file. The comment records begin with the character '#'.
- *   3. Navigation files in the this format may be generated using
- *      mblist with the -OtMXYHS option.
- *
- */
-
-#define	MBF_MBPRONAV_MAXLINE	256
-
-struct mbf_mbpronav_struct
-	{
-	/* type of data record */
-	int	kind;
-
-	/* time stamp */
-	double	time_d;
-	int	time_i[7];
-
-	/* navigation */
-	double	longitude;
-	double	latitude;
-	double  heading;
-	double  speed;
-	double  sonardepth;
-	double  roll;
-	double  pitch;
-	double  heave;
-
-	/* swathbounds */
-	double	portlon;
-	double	portlat;
-	double	stbdlon;
-	double	stbdlat;
-
-	/* comment */
-	char	comment[MBF_MBPRONAV_MAXLINE];
-	};
diff --git a/src/mbio/mbf_mgd77dat.h b/src/mbio/mbf_mgd77dat.h
deleted file mode 100644
index 252679a..0000000
--- a/src/mbio/mbf_mgd77dat.h
+++ /dev/null
@@ -1,187 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbf_mgd77dat.h	5/19/99
- *	$Id: mbf_mgd77dat.h 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1999-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbf_mgd77dat.h defines the data structures used by MBIO functions
- * to store multibeam data read from the MBF_MGD77DAT format (MBIO id 21).
- *
- * Author:	D. W. Caress
- * Date:	May 19, 1999
- *
- * $Log: mbf_mgd77dat.h,v $
- * Revision 5.2  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.1  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.0  2000/12/01 22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.2  2000/09/30  06:34:20  caress
- * Snapshot for Dale.
- *
- * Revision 4.1  1999/07/16  19:29:09  caress
- * First revision.
- *
- * Revision 1.1  1999/07/16  19:24:15  caress
- * Initial revision
- *
- *
- */
-/*
- * Notes on the MBF_MGD77DAT data format:
- *   1. The MGD77 format is is an exchange format for marine
- *	geophysical data (bathymetry, magnetics, and gravity).
- *      The format standard is maintained by the National
- *      Geophysical Data Center of NOAA.
- *   2. The standard MGD77 format includes a 1920 byte header
- *      followed by 120 byte data records. The header consists
- *      of 24 80 byte records. The first character of the first
- *      header record is either 1 (pre-Y2K fix) or 4 (post-Y2K fix).
- *      MB-System treats the header as 16 120 byte records and
- *      provides no means of modifying the header.
- *   3. The data records are each 120 bytes long. The first
- *      character of each data record is either
- *      3 (pre-Y2K fix) or 5 (post-Y2K fix).
- *   4. The MB-System implementation includes the support of
- *      an arbitrary number of comment records at the beginning
- *      of each file. The comment records are 120 bytes each
- *      and begin with the character '#'.
- *
- */
-
-/* header and data record in bytes */
-#define MBF_MGD77DAT_HEADER_NUM	    16
-#define MBF_MGD77DAT_DATA_LEN	    120
-
-struct mbf_mgd77dat_struct
-	{
-	/* type of data record */
-	int	kind;
-
-	/* survey id */
-	char	survey_id[8];
-			    /* Identifier supplied by the contributing
-				 organization, else given by NGDC in
-				 a manner which represents the data. */
-
-	/* time stamp */
-	double	time_d;
-	int	time_i[7];
-	int	timezone;   /* Corrects time (in characters 13-27)
-				 to GMT when added: equals zero when
-				 time is GMT.  Timezone normally falls
-				 between -13 and +12 inclusively. */
-	/* navigation */
-	double	longitude;
-	double	latitude;
-	double	heading;    /* degrees */
-	double	speed;	    /* km/hr */
-	int	nav_type;   /* Indicates how lat/lon was obtained:
-				1 = Observed fix
-				3 = Interpolated
-				9 = Unspecified	*/
-	int	nav_quality;
-			    /* QUALITY CODE FOR NAVIGATION -
-                             5 - Suspected, by the
-                                 originating institution
-                             6 - Suspected, by the data
-                                 center
-                             9 - No identifiable problem
-                                 found */
-
-	/* motion sensor data */
-	double	roll;
-	double	pitch;
-	double	heave;
-
-	/* bathymetry */
-	int	flag;	    /* MB-System style beamflag */
-	double	tt;	    /* two way travel time in sec */
-	double	bath;	    /* corrected depth in m */
-	int	bath_corr;  /* BATHYMETRIC CORRECTION CODE
-			       This code details the procedure
-			       used for determining the sound
-			       velocity correction to depth:
-				01-55  Matthews' Zones with zone
-				59     Matthews' Zones, no zone
-				60     S. Kuwahara Formula
-				61     Wilson Formula
-				62     Del Grosso Formula
-				63     Carter's Tables
-				88     Other (see Add. Doc.)
-				99     Unspecified */
-	int	bath_type;  /* BATHYMETRIC TYPE CODE
-				 Indicates how the data record's
-				 bathymetric value was obtained:
-				 1 =    Observed
-				 3 =    Interpolated
-				 9 =    Unspecified */
-
-	/* magnetics */
-	double	mag_tot_1;  /* MAGNETICS TOTAL FIELD, 1ST SENSOR
-				In tenths of nanoteslas (gammas).
-				For leading sensor.  Use this field
-				for single sensor. */
-	double	mag_tot_2;  /* MAGNETICS TOTAL FIELD, 2ND SENSOR
-				In tenths of nanoteslas (gammas).
-				For trailing sensor. */
-	double	mag_res;    /* MAGNETICS RESIDUAL FIELD
-				In tenths of nanoteslas (gammas). */
-	int	mag_res_sensor;
-			    /* SENSOR FOR RESIDUAL FIELD
-				1 = 1st or leading sensor
-				2 = 2nd or trailing sensor
-				9 = Unspecified */
-	double	mag_diurnal;
-			    /* MAGNETICS DIURNAL CORRECTION -
-				In tenths of nanoteslas (gammas).
-				(In nanoteslas) if 9-filled
-				(i.e., set to "+9999"), total
-				and residual fields are assumed
-				to be uncorrected; if used,
-				total and residuals are assumed
-				to have been already corrected. */
-	double	mag_altitude;
-			    /* DEPTH OR ALTITUDE OF MAGNETICS SENSOR
-				In meters.
-				+ = Below sealevel
-				- = Above sealevel */
-
-	/* gravity */
-	double	gravity;    /* OBSERVED GRAVITY
-                             In milligals.
-                             Corrected for Eotvos, drift, and
-                             tares */
-	double	eotvos;	    /* EOTVOS CORRECTION
-                             In milligals.
-                             E = 7.5 V cos phi sin alpha +
-                             0.0042 V*V */
-	double	free_air;   /* FREE-AIR ANOMALY
-                             In milligals.
-                             Free-air Anomaly = G(observed) -
-                             G(theoretical) */
-
-	/* seismic */
-	int	seismic_line;
-			    /* SEISMIC LINE NUMBER
-                             Used for cross referencing with
-                             seismic data. */
-	int	seismic_shot;
-			    /* SEISMIC SHOT-POINT NUMBER */
-
-	/* comment */
-	char	comment[MBF_MGD77DAT_DATA_LEN];
-	};
diff --git a/src/mbio/mbf_mr1aldeo.h b/src/mbio/mbf_mr1aldeo.h
deleted file mode 100644
index c698120..0000000
--- a/src/mbio/mbf_mr1aldeo.h
+++ /dev/null
@@ -1,143 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbf_mr1aldeo.h	3/3/94
- *	$Id: mbf_mr1aldeo.h 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1994-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbf_mr1aldeo.h defines the data structures used by MBIO functions
- * to store multibeam data read from the MBF_MR1ALDEO format (MBIO id 61).
- *
- * Author:	D. W. Caress
- * Date:	October 23, 1995
- * $Log: mbf_mr1aldeo.h,v $
- * Revision 5.2  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.1  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.0  2000/12/01 22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 1.3  2000/09/30  06:34:20  caress
- * Snapshot for Dale.
- *
- * Revision 1.2  1998/10/05  18:32:27  caress
- * MB-System version 4.6beta
- *
- * Revision 1.1  1996/01/26  21:27:27  caress
- * Initial revision
- *
- * Revision 1.1  1996/01/26  21:27:27  caress
- * Initial revision
- *
- *
- */
-/*
- * Notes on the MBF_MR1ALDEO data format:
- *   1. The MR1 post processing format uses the xdr external
- *      data representation for portability.
- *   2. The data stream consists of a file header followed
- *      by individual pings.
- *   3. The file header contains a comment string and the
- *      number of pings. The comment string is broken up
- *      into multiple comments by MBIO on reading; the comments
- *      are concatenated into a single string on writing.
- *   4. The pings each contain a header plus the bathymetry and/or
- *      sidescan data.
- *   6. The data structure defined below includes all of the values
- *      which are passed in the MR1 post processing format.
- *   7. The data structure defined below also includes travel
- *      time values for each bathymetry beam - this is an
- *      addition to the HIG MR1 post processing format.
- */
-
-/* maximum number of bathymetry beams per side for MR1 */
-#define MBF_MR1ALDEO_BEAMS_SIDE 1500
-
-/* maximum number of sidescan pixels per side for MR1 */
-#define MBF_MR1ALDEO_PIXELS_SIDE 3500
-
-/* maximum number of bathymetry beams for MR1 */
-#define MBF_MR1ALDEO_BEAMS (2*MBF_MR1ALDEO_BEAMS_SIDE + 3)
-
-/* maximum number of sidescan pixels output for MR1 */
-#define MBF_MR1ALDEO_PIXELS (2*MBF_MR1ALDEO_PIXELS_SIDE + 3)
-
-/* maximum length of comment */
-#define	MBF_MR1ALDEO_MAXLINE 200
-
-struct mbf_mr1aldeo_struct
-	{
-	/* type of data record */
-	int	kind;
-
-	/* file header info */
-	int mf_magic;		/* magic cookie */
-	int mf_count;		/* number of objects */
-	char *mf_log;		/* processing log */
-
-	/* ping header */
-	int sec;		/* timestamp */
-	int usec;		/* timestamp */
-	double png_lon;		/* longitude (deg) */
-	double png_lat;		/* latitude (deg) */
-	float png_course;	/* course determined from nav (deg) */
-	float png_compass;	/* compass heading of vehicle
-					0=N,90=E, etc. (deg) */
-	float png_prdepth;	/* pressure depth (m) */
-	float png_alt;		/* altitude of vehicle (m) */
-	float png_pitch;	/* vehicle pitch (deg) */
-	float png_roll;		/* vehicle roll (deg) */
-	float png_temp;		/* water temperature (deg) */
-	float png_atssincr;	/* across-track sidescan increment (m) */
-	float png_tt;		/* nadir travel time (s) */
-
-	/* port settings */
-	float port_trans[2];	/* transmitter settings (units?) */
-	float port_gain;	/* gain setting (units?) */
-	float port_pulse;	/* pulse length (units?) */
-	int port_btycount;	/* number of valid bathymetry samples */
-	int port_btypad;	/* number of invalid trailing pad samples */
-	float port_ssoffset;	/* across-track distance to
-					first sidescan sample */
-	int port_sscount;	/* number of valid sidescan samples */
-	int port_sspad;		/* number of invalid trailing pad samples */
-
-	/* starboard settings */
-	float stbd_trans[2];	/* transmitter settings (units?) */
-	float stbd_gain;	/* gain setting (units?) */
-	float stbd_pulse;	/* pulse length (units?) */
-	int stbd_btycount;	/* number of valid bathymetry samples */
-	int stbd_btypad;	/* number of invalid trailing pad samples */
-	float stbd_ssoffset;	/* across-track distance to
-					first sidescan sample */
-	int stbd_sscount;	/* number of valid sidescan samples */
-	int stbd_sspad;		/* number of invalid trailing pad samples */
-
-	/* bathymetry */
-	float	bath_acrosstrack_port[MBF_MR1ALDEO_BEAMS_SIDE];
-	float	bath_port[MBF_MR1ALDEO_BEAMS_SIDE];
-	float	tt_port[MBF_MR1ALDEO_BEAMS_SIDE];
-	float	angle_port[MBF_MR1ALDEO_BEAMS_SIDE];
-	float	bath_acrosstrack_stbd[MBF_MR1ALDEO_BEAMS_SIDE];
-	float	bath_stbd[MBF_MR1ALDEO_BEAMS_SIDE];
-	float	tt_stbd[MBF_MR1ALDEO_BEAMS_SIDE];
-	float	angle_stbd[MBF_MR1ALDEO_BEAMS_SIDE];
-
-	/* sidescan */
-	float	ss_port[MBF_MR1ALDEO_PIXELS_SIDE];
-	float	ss_stbd[MBF_MR1ALDEO_PIXELS_SIDE];
-
-	/* comment */
-	char	comment[MBF_MR1ALDEO_MAXLINE];
-};
diff --git a/src/mbio/mbf_mr1bldeo.h b/src/mbio/mbf_mr1bldeo.h
deleted file mode 100644
index 63508db..0000000
--- a/src/mbio/mbf_mr1bldeo.h
+++ /dev/null
@@ -1,145 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbf_mr1bldeo.h	3/3/94
- *	$Id: mbf_mr1bldeo.h 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1994-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbf_mr1bldeo.h defines the data structures used by MBIO functions
- * to store multibeam data read from the MBF_MR1BLDEO format (MBIO id 61).
- *
- * Author:	D. W. Caress
- * Date:	October 23, 1995
- *
- * $Log: mbf_mr1bldeo.h,v $
- * Revision 5.2  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.1  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.0  2000/12/01 22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.2  2000/09/30  06:34:20  caress
- * Snapshot for Dale.
- *
- * Revision 4.1  1998/10/05  18:32:27  caress
- * MB-System version 4.6beta
- *
- * Revision 4.0  1996/03/12  17:20:05  caress
- * Initial version.
- *
- * Revision 4.0  1996/03/12  17:20:05  caress
- * Initial version.
- *
- *
- *
- */
-/*
- * Notes on the MBF_MR1BLDEO data format:
- *   1. The MR1 post processing format uses the xdr external
- *      data representation for portability.
- *   2. The data stream consists of a file header followed
- *      by individual pings.
- *   3. The file header contains a comment string and the
- *      number of pings. The comment string is broken up
- *      into multiple comments by MBIO on reading; the comments
- *      are concatenated into a single string on writing.
- *   4. The pings each contain a header plus the bathymetry and/or
- *      sidescan data.
- *   6. The data structure defined below includes all of the values
- *      which are passed in the MR1 post processing format.
- *   7. The data structure defined below also includes travel
- *      time values for each bathymetry beam - this is an
- *      addition to the HIG MR1 post processing format.
- */
-
-/* maximum number of bathymetry beams per side for MR1 */
-#define MBF_MR1BLDEO_BEAMS_SIDE 75
-
-/* maximum number of sidescan pixels per side for MR1 */
-#define MBF_MR1BLDEO_PIXELS_SIDE 2000
-
-/* maximum number of bathymetry beams for MR1 */
-#define MBF_MR1BLDEO_BEAMS (2*MBF_MR1BLDEO_BEAMS_SIDE + 3)
-
-/* maximum number of sidescan pixels output for MR1 */
-#define MBF_MR1BLDEO_PIXELS (2*MBF_MR1BLDEO_PIXELS_SIDE + 3)
-
-/* maximum length of comment */
-#define	MBF_MR1BLDEO_MAXLINE 200
-
-struct mbf_mr1bldeo_struct
-	{
-	/* type of data record */
-	int	kind;
-
-	/* file header info */
-	int mf_magic;		/* magic cookie */
-	int mf_count;		/* number of objects */
-	char *mf_log;		/* processing log */
-
-	/* ping header */
-	int sec;		/* timestamp */
-	int usec;		/* timestamp */
-	double png_lon;		/* longitude (deg) */
-	double png_lat;		/* latitude (deg) */
-	float png_course;	/* course determined from nav (deg) */
-	float png_compass;	/* compass heading of vehicle
-					0=N,90=E, etc. (deg) */
-	float png_prdepth;	/* pressure depth (m) */
-	float png_alt;		/* altitude of vehicle (m) */
-	float png_pitch;	/* vehicle pitch (deg) */
-	float png_roll;		/* vehicle roll (deg) */
-	float png_temp;		/* water temperature (deg) */
-	float png_atssincr;	/* across-track sidescan increment (m) */
-	float png_tt;		/* nadir travel time (s) */
-
-	/* port settings */
-	float port_trans[2];	/* transmitter settings (units?) */
-	float port_gain;	/* gain setting (units?) */
-	float port_pulse;	/* pulse length (units?) */
-	int port_btycount;	/* number of valid bathymetry samples */
-	int port_btypad;	/* number of invalid trailing pad samples */
-	float port_ssoffset;	/* across-track distance to
-					first sidescan sample */
-	int port_sscount;	/* number of valid sidescan samples */
-	int port_sspad;		/* number of invalid trailing pad samples */
-
-	/* starboard settings */
-	float stbd_trans[2];	/* transmitter settings (units?) */
-	float stbd_gain;	/* gain setting (units?) */
-	float stbd_pulse;	/* pulse length (units?) */
-	int stbd_btycount;	/* number of valid bathymetry samples */
-	int stbd_btypad;	/* number of invalid trailing pad samples */
-	float stbd_ssoffset;	/* across-track distance to
-					first sidescan sample */
-	int stbd_sscount;	/* number of valid sidescan samples */
-	int stbd_sspad;		/* number of invalid trailing pad samples */
-
-	/* bathymetry */
-	float	bath_acrosstrack_port[MBF_MR1BLDEO_BEAMS_SIDE];
-	float	bath_port[MBF_MR1BLDEO_BEAMS_SIDE];
-	float	tt_port[MBF_MR1BLDEO_BEAMS_SIDE];
-	float	angle_port[MBF_MR1BLDEO_BEAMS_SIDE];
-	float	bath_acrosstrack_stbd[MBF_MR1BLDEO_BEAMS_SIDE];
-	float	bath_stbd[MBF_MR1BLDEO_BEAMS_SIDE];
-	float	tt_stbd[MBF_MR1BLDEO_BEAMS_SIDE];
-	float	angle_stbd[MBF_MR1BLDEO_BEAMS_SIDE];
-
-	/* sidescan */
-	float	ss_port[MBF_MR1BLDEO_PIXELS_SIDE];
-	float	ss_stbd[MBF_MR1BLDEO_PIXELS_SIDE];
-
-	/* comment */
-	char	comment[MBF_MR1BLDEO_MAXLINE];
-};
diff --git a/src/mbio/mbf_mr1prhig.h b/src/mbio/mbf_mr1prhig.h
deleted file mode 100644
index 8c6ac64..0000000
--- a/src/mbio/mbf_mr1prhig.h
+++ /dev/null
@@ -1,148 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbf_mr1prhig.h	3/3/94
- *	$Id: mbf_mr1prhig.h 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1994-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbf_mr1prhig.h defines the data structures used by MBIO functions
- * to store multibeam data read from the MBF_MR1PRHIG format (MBIO id 61).
- *
- * Author:	D. W. Caress
- * Date:	July 15, 1994
- * $Log: mbf_mr1prhig.h,v $
- * Revision 5.2  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.1  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.0  2000/12/01 22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.4  2000/09/30  06:34:20  caress
- * Snapshot for Dale.
- *
- * Revision 4.3  1998/10/05  18:32:27  caress
- * MB-System version 4.6beta
- *
- * Revision 4.2  1996/01/26  21:27:27  caress
- * Version 4.3 distribution.
- *
- * Revision 4.2  1996/01/26  21:27:27  caress
- * Version 4.3 distribution.
- *
- * Revision 4.1  1995/09/28  18:10:48  caress
- * Various bug fixes working toward release 4.3.
- *
- * Revision 4.0  1994/10/21  12:35:05  caress
- * Release V4.0
- *
- * Revision 1.2  1994/10/21  12:20:01  caress
- * Release V4.0
- *
- * Revision 1.1  1994/07/29  18:46:51  caress
- * Initial revision
- *
- *
- *
- */
-/*
- * Notes on the MBF_MR1PRHIG data format:
- *   1. The MR1 post processing format uses the xdr external
- *      data representation for portability.
- *   2. The data stream consists of a file header followed
- *      by individual pings.
- *   3. The file header contains a comment string and the
- *      number of pings. The comment string is broken up
- *      into multiple comments by MBIO on reading; the comments
- *      are concatenated into a single string on writing.
- *   4. The pings each contain a header plus the bathymetry and/or
- *      sidescan data.
- *   6. The data structure defined below includes all of the values
- *      which are passed in the MR1 post processing format.
- */
-
-/* maximum number of bathymetry beams per side for MR1 */
-#define MBF_MR1PRHIG_BEAMS_SIDE 1500
-
-/* maximum number of sidescan pixels per side for MR1 */
-#define MBF_MR1PRHIG_PIXELS_SIDE 3500
-
-/* maximum number of bathymetry beams for MR1 */
-#define MBF_MR1PRHIG_BEAMS (2*MBF_MR1PRHIG_BEAMS_SIDE + 3)
-
-/* maximum number of sidescan pixels output for MR1 */
-#define MBF_MR1PRHIG_PIXELS (2*MBF_MR1PRHIG_PIXELS_SIDE + 3)
-
-/* maximum length of comment */
-#define	MBF_MR1PRHIG_MAXLINE 200
-
-struct mbf_mr1prhig_struct
-	{
-	/* type of data record */
-	int	kind;
-
-	/* file header info */
-	int mf_magic;		/* magic cookie */
-	int mf_count;		/* number of objects */
-	char *mf_log;		/* processing log */
-
-	/* ping header */
-	int sec;		/* timestamp */
-	int usec;		/* timestamp */
-	double png_lon;		/* longitude (deg) */
-	double png_lat;		/* latitude (deg) */
-	float png_course;	/* course determined from nav (deg) */
-	float png_compass;	/* compass heading of vehicle
-					0=N,90=E, etc. (deg) */
-	float png_prdepth;	/* pressure depth (m) */
-	float png_alt;		/* altitude of vehicle (m) */
-	float png_pitch;	/* vehicle pitch (deg) */
-	float png_roll;		/* vehicle roll (deg) */
-	float png_temp;		/* water temperature (deg) */
-	float png_atssincr;	/* across-track sidescan increment (m) */
-
-	/* port settings */
-	float port_trans[2];	/* transmitter settings (units?) */
-	float port_gain;	/* gain setting (units?) */
-	float port_pulse;	/* pulse length (units?) */
-	int port_btycount;	/* number of valid bathymetry samples */
-	int port_btypad;	/* number of invalid trailing pad samples */
-	float port_ssoffset;	/* across-track distance to
-					first sidescan sample */
-	int port_sscount;	/* number of valid sidescan samples */
-	int port_sspad;		/* number of invalid trailing pad samples */
-
-	/* starboard settings */
-	float stbd_trans[2];	/* transmitter settings (units?) */
-	float stbd_gain;	/* gain setting (units?) */
-	float stbd_pulse;	/* pulse length (units?) */
-	int stbd_btycount;	/* number of valid bathymetry samples */
-	int stbd_btypad;	/* number of invalid trailing pad samples */
-	float stbd_ssoffset;	/* across-track distance to
-					first sidescan sample */
-	int stbd_sscount;	/* number of valid sidescan samples */
-	int stbd_sspad;		/* number of invalid trailing pad samples */
-
-	/* bathymetry */
-	float	bath_acrosstrack_port[MBF_MR1PRHIG_BEAMS_SIDE];
-	float	bath_port[MBF_MR1PRHIG_BEAMS_SIDE];
-	float	bath_acrosstrack_stbd[MBF_MR1PRHIG_BEAMS_SIDE];
-	float	bath_stbd[MBF_MR1PRHIG_BEAMS_SIDE];
-
-	/* sidescan */
-	float	ss_port[MBF_MR1PRHIG_PIXELS_SIDE];
-	float	ss_stbd[MBF_MR1PRHIG_PIXELS_SIDE];
-
-	/* comment */
-	char	comment[MBF_MR1PRHIG_MAXLINE];
-};
diff --git a/src/mbio/mbf_mstiffss.h b/src/mbio/mbf_mstiffss.h
deleted file mode 100644
index 867ad11..0000000
--- a/src/mbio/mbf_mstiffss.h
+++ /dev/null
@@ -1,232 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbf_mstiffss.h	10/14/94
- *	$Id: mbf_mstiffss.h 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1998-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbf_mstiffss.h defines the data structure used by MBIO functions
- * to store sidescan data read from the MBF_MSTIFFSS format (MBIO id 131).
- *
- * Author:	D. W. Caress
- * Date:	April 7,  1998
- *
- * $Log: mbf_mstiffss.h,v $
- * Revision 5.3  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.2  2003/01/15 20:51:48  caress
- * Release 5.0.beta28
- *
- * Revision 5.1  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.0  2000/12/01 22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.1  2000/09/30  06:34:20  caress
- * Snapshot for Dale.
- *
- * Revision 4.0  1998/10/05  18:30:03  caress
- * MB-System version 4.6beta
- *
- * Revision 1.1  1998/10/05  18:22:40  caress
- * Initial revision
- *
- * Revision 1.1  1998/10/05  17:46:15  caress
- * Initial revision
- *
- *
- *
- */
-/*
- * Notes on the MBF_MSTIFFSS data format:
- *   1. The MSTIFF data format is used to store raw sidescan data from
- *      Sea Scan sidescan sonars. This format is a variant of
- *      the TIFF image format with navigation and other information
- *      embedded within the file.
- *   2. The file structure consists of a bunch of pointers to
- *      data objects at various arbitrary locations within the
- *      file. The header contains a pointer to the location of
- *      the "image file directory", which in turn contains
- *      pointers to the locations of data arrays within the file.
- *   3. As far as MB-System is concerned,  this is a read-only
- *      data format.
- *   4. The raw sidescan data in the file consists of 1000 pings.
- *      Each ping produces two 512 sample arrays - one for
- *      each side (port and starboard).
- *   5. The sidescan data is not slant range corrected - the
- *      bottom detect and slant range correction is done on
- *      input by MBIO. The data stored internally by MBIO
- *      is slant range corrected.
- *   6. The MSTIFF files contain lots of information not used by
- *      MBIO,  including images of the data derived from a
- *      realtime display.
- *   7. Comments are not supported in this format.
- *   8. Each of the possible data fields is identified by a
- *      unique tag:
- *          Tag        Field Type                Default
- *          ---        ----------                -------
- *          273        Annotation
- *          272        AnnotationCount
- *          279        Annotation2
- *          278        Annotation2Count
- *          281        Annotation3
- *          280        Annotation3Count
- *          260        BinsPerChannel#
- *          258        BitsPerBin#                8 bits per sample (2 MSB = 0)
- *          254        Compression               1 (no compression)
- *          255        CondensedImage
- *          301        CreatorVersion
- *          256        Description
- *          287        Fathometer
- *          296        Fathometer2
- *          286        FathometerCount
- *          257        History
- *          263        LeftChannel#
- *          299        LeftChannel2#
- *          289        Magnetometer
- *          288        MagnetometerCount
- *          291        MagnetometerParms
- *          303        MagnetometerParms2
- *          269        Marker
- *          268        MarkerCount
- *          277        Marker2
- *          276        Marker2Count
- *          284        Marker3
- *          283        Marker3Count
- *          295        Marker4
- *          294        Marker4Count
- *          307        Marker5
- *          306        Marker5Count
- *          267        NavInfo#
- *          275        NavInfo2#
- *          282        NavInfo3#
- *          293        NavInfo4#
- *          297        NavInfo5#
- *          308        NavInfo6#
- *          266        NavInfoCount
- *          304        NavInterpolationTimeout
- *          274        PingNavInfo
- *          264        RightChannel#
- *          300        RightChannel2#
- *          261        ScrollDirection
- *          265        SonarDataInfo#
- *          292        SonarDataInfo2#
- *          298        SonarDataInfo3#
- *          259        SonarLines#
- *          271        SurveyPlotterImage
- *          270        SurveyPlotterParms
- *          290        SurveyPlotterParms2
- *          302        SurveyPlotterParms3
- *          305        SurveyPlotterParms4
- *          262        TimeCorrelation#
- *          285        Y2KTimeCorrelation#
- */
-
-/* size of MSTIFFSS reading buffer */
-#define MBF_MSTIFFSS_BUFFERSIZE 1024
-
-/* number of sidescan pixels for Sea Scan sidescan sonars */
-#define MBF_MSTIFFSS_PIXELS	1024
-
-/* threshold of sidescan values for detecting bottom return */
-#define MBF_MSTIFF_TRANSMIT_BINS	10
-#define MBF_MSTIFF_BOTTOM_THRESHOLD	10
-
-/* MSTIFF data field tags */
-#define Annotation	273
-#define AnnotationCount	272
-#define Annotation2	279
-#define Annotation2Count	278
-#define Annotation3	281
-#define Annotation3Count	280
-#define BinsPerChannel	260
-#define BitsPerBin	258
-#define Compression	254
-#define CondensedImage	255
-#define CreatorVersion	301
-#define Description	256
-#define Fathometer	287
-#define Fathometer2	296
-#define FathometerCount	286
-#define History	257
-#define LeftChannel	263
-#define LeftChannel2	299
-#define Magnetometer	289
-#define MagnetometerCount	288
-#define MagnetometerParms	291
-#define MagnetometerParms2	303
-#define Marker	269
-#define MarkerCount	268
-#define Marker2	277
-#define Marker2Count	276
-#define Marker3	284
-#define Marker3Count	283
-#define Marker4	295
-#define Marker4Count	294
-#define Marker5	307
-#define Marker5Count	306
-#define NavInfo	267
-#define NavInfo2	275
-#define NavInfo3	282
-#define NavInfo4	293
-#define NavInfo5	297
-#define NavInfo6	308
-#define NavInfoCount	266
-#define NavInterpolationTimeout	304
-#define PingNavInfo	274
-#define RightChannel	264
-#define RightChannel2	300
-#define ScrollDirection	261
-#define SonarDataInfo	265
-#define SonarDataInfo2	292
-#define SonarDataInfo3	298
-#define SonarLines	259
-#define SurveyPlotterImage	271
-#define SurveyPlotterParms	270
-#define SurveyPlotterParms2	290
-#define SurveyPlotterParms3	302
-#define SurveyPlotterParms4	305
-#define TimeCorrelation	262
-#define Y2KTimeCorrelation	285
-
-#define FREQ_150 0
-#define FREQ_300 1
-#define FREQ_600 2
-#define FREQ_1200 3
-#define FREQ_UNKNOWN 4
-
-struct mbf_mstiffss_struct
-	{
-	/* time stamp */
-	double	time_d;		/* unix time */
-
-	/* position */
-	double	lat;		/* latitude in degrees */
-	double	lon;		/* longitude in degrees */
-
-	/* other values */
-	double	heading;	    /* heading in degrees */
-	double	course;	    	    /* course made good in degrees */
-	double	speed;		    /* fore-aft speed in km/hr */
-	double	altitude;	    /* altitude in meters */
-	double	slant_range_max;    /* meters */
-	double	range_delay;	    /* meters */
-	double	sample_interval;    /* meters */
-	double	sonar_depth;	    /* sonar depth in meters */
-	double	frequency;    /* sonar frequency in Hz */
-
-	/* sidescan data */
-	int	pixels_ss;	/* number of pixels */
-	unsigned char	ss[MBF_MSTIFFSS_PIXELS];
-	double	ssacrosstrack[MBF_MSTIFFSS_PIXELS];
-	};
diff --git a/src/mbio/mbf_oicgeoda.h b/src/mbio/mbf_oicgeoda.h
deleted file mode 100644
index 3e8c219..0000000
--- a/src/mbio/mbf_oicgeoda.h
+++ /dev/null
@@ -1,208 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbf_oicgeoda.h	1/8/99
- *	$Id: mbf_oicgeoda.h 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1999-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbf_oicgeoda.h defines the data structures used by MBIO functions
- * to store multibeam data read from the  MBF_OICGEODA format (MBIO id 141).
- *
- * Author:	D. W. Caress
- * Date:	January 8, 1999
- *
- * $Log: mbf_oicgeoda.h,v $
- * Revision 5.2  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.1  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.0  2000/12/01 22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.1  2000/09/30  06:34:20  caress
- * Snapshot for Dale.
- *
- * Revision 4.0  1999/03/31  18:29:20  caress
- * MB-System 4.6beta7
- *
- * Revision 1.1  1999/03/31  18:11:35  caress
- * Initial revision
- *
-
- *
- */
-/*
- * Notes on the MBF_OICGEODA data format:
- *   1. This data format is used to store swath sonar data
- *      collected and recorded using the GeoDAS-SV1 system
- *      developed and sold by Ocean Imaging Consultants.
- *      In particular, the Deep Submergence Lab (DSL) of
- *      the Woods Hole Oceanographic Institution (WHOI) now
- *      uses an OIC GeoDAS-SV1 package as the front end for
- *      their deep towed 120 kHz interferometry sonar (AMS-120).
- *   2. The data consist of variable length binary records.
- *   3. Each data record has three parts.  First there is a 248-byte
- *      header section containing the time stamp, navigation, a
- *      variety of other values, the numbers and sizes of sonar
- *      data included in the record.  The second, optional, part of
- *      the record is "client specific information" of arbitrary
- *      length. The third part contains up to eight arrays of
- *      sonar data.
- *   4. The header begins with a four byte magic number. The first
- *      three bytes are 'G', 'E', and 'O'. The fourth byte is
- *      the id number for the data source.
- *   5. The maximum numbers of beams and pixels defined below are
- *      limitations specific to this I/O module - the format itself
- *      contains no limits on the amount of data per record.
- *   6. Comment records are encoded in MBIO using the "client
- *      specific information" section of the record and an unused
- *      sonar type value.
- *
- */
-
-/* defines sizes of things */
-#define	MBF_OICGEODA_HEADER_SIZE	248
-#define	MBF_OICGEODA_MAX_CLIENT		252
-#define	MBF_OICGEODA_MAX_COMMENT	MBF_OICGEODA_MAX_CLIENT
-#define	MBF_OICGEODA_MAX_CHANNELS	8
-
-/* define maximum number of beams */
-#define	MBF_OICGEODA_MAX_BEAMS		1024
-#define	MBF_OICGEODA_MAX_PIXELS		2048
-
-struct mbf_oicgeoda_channel_struct
-	{
-	int		offset;		/* offset in bytes to channel data */
-	mb_u_char	type;		/* sonar type:
-					    0 = sidescan
-					    1 = angle
-					    2 = multibeam */
-	mb_u_char	side;		/* sonar side:
-					    0 = port
-					    1 = starboard */
-	mb_u_char	size;		/* data sample type and size:
-					    0 = 1 byte integer
-					    1 = 2 byte integer
-					    2 = 4 byte integer
-					    3 = 4 byte float
-					    4 = 12 byte set of three
-						floats - range, theta, amp */
-	mb_u_char	empty;		/* spare */
-	int		frequency;	/* Hz */
-	int		num_samples;	/* number of samples stored for
-					    sidescan and angle sonar types,
-					    number of beams for multibeam */
-	};
-
-struct mbf_oicgeoda_data_struct
-	{
-	int		rawsize[MBF_OICGEODA_MAX_CHANNELS];
-	char		*raw[MBF_OICGEODA_MAX_CHANNELS];
-	int		beams_bath_alloc;
-	int		beams_amp_alloc;
-	int		pixels_ss_alloc;
-	float		*bath;
-	float		*amp;
-	float		*bathacrosstrack;
-	float		*bathalongtrack;
-	float		*tt;
-	float		*angle;
-	float		*ss;
-	float		*ssacrosstrack;
-	float		*ssalongtrack;
-	};
-
-struct mbf_oicgeoda_seaview_struct
-	{
-	double		longitude;	/* longitude in degrees */
-	double		latitude;	/* latitude in degrees */
-	int		x;		/* local x coordinates in yards */
-	int		y;		/* local y coordinates in yards */
-	int		uncertainty;	/* navigation uncertainty in yards */
-	float		speed;		/* speed over ground in knots */
-	float		altitude;	/* platform altitude in feet */
-	float		depth;		/* platform depth in feet */
-	float		sound_velocity;	/* sound velocity in feet/sec */
-	char		id[20];		/* client id string */
-	};
-
-struct mbf_oicgeoda_header_struct
-	{
-	mb_u_char	type;		/* Magic number:
-					    0 - EG&G sonar
-					    1 - SEAVIEW sonar
-					    2 - DEEPSCAN sonar
-					    3 - STEST SEAVIEW test
-					    4 - QTEST QMIPs test
-					    5 - SM2 SeaMARC2 test
-					    22 - WHOI DSL AMS120 */
-	int		proc_status;	/* OIC processing status in
-					    bit mask form */
-	int		data_size;
-	mb_u_char	client_size;
-	mb_u_char	fish_status;	/* status bit field:
-						0:  FocusAutoManual
-						1:  FocusManualDisableEnable
-						2:  PingRate AutoManual
-						3:  TvgAutoManual
-						4:  CalibOffOn
-						5:  OutputModeProcRaw
-						6:  ShadowMask
-						7:  QualityBit */
-	mb_s_char	nav_used;
-	mb_s_char	nav_type;	/*  0 = UTM coordinates in m
-					    1 = Local coordinates in m
-					    2 = Latitude and longitude */
-	int		utm_zone;
-	float		ship_x;		/* meters or degrees  */
-	float		ship_y;		/* meters or degrees  */
-	float		ship_course;	/* degrees */
-	float		ship_speed;	/* m/sec */
-	int		sec;
-	int		usec;
-	float		spare_gain;
-	float		fish_heading;	/* degrees */
-	float		fish_depth;	/* meters */
-	float		fish_range;	/* meters */
-	float		fish_pulse_width;   /* msec */
-	float		gain_c0;
-	float		gain_c1;
-	float		gain_c2;
-	float		fish_pitch;	/* degrees */
-	float		fish_roll;	/* degrees */
-	float		fish_yaw;	/* degrees */
-	float		fish_x;		/* meters or degrees  */
-	float		fish_y;		/* meters or degrees  */
-	float		fish_layback;	/* meters */
-	float		fish_altitude;	/* meters */
-	int		fish_altitude_samples;
-	float		fish_ping_period;   /* seconds per ping */
-	float		sound_velocity;	/* m/sec */
-	int		num_chan;
-	int		beams_bath;
-	int		beams_amp;
-	int		bath_chan_port;
-	int		bath_chan_stbd;
-	int		pixels_ss;
-	int		ss_chan_port;
-	int		ss_chan_stbd;
-	struct mbf_oicgeoda_channel_struct channel[MBF_OICGEODA_MAX_CHANNELS];
-	};
-
-struct mbf_oicgeoda_struct
-	{
-	int	kind;
-	struct mbf_oicgeoda_header_struct header;
-	char	client[MBF_OICGEODA_MAX_CLIENT];
-	struct mbf_oicgeoda_data_struct data;
-	};
diff --git a/src/mbio/mbf_oicmbari.h b/src/mbio/mbf_oicmbari.h
deleted file mode 100644
index 22eac1f..0000000
--- a/src/mbio/mbf_oicmbari.h
+++ /dev/null
@@ -1,213 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbf_oicmbari.h	1/8/99
- *	$Id: mbf_oicmbari.h 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1999-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbf_oicmbari.h defines the data structures used by MBIO functions
- * to store multibeam data read from the  MBF_OICMBARI format (MBIO id 141).
- *
- * Author:	D. W. Caress
- * Date:	January 8, 1999
- *
- * $Log: mbf_oicmbari.h,v $
- * Revision 5.2  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.1  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.0  2000/12/01 22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.1  2000/09/30  06:34:20  caress
- * Snapshot for Dale.
- *
- * Revision 4.0  1999/03/31  18:29:20  caress
- * MB-System 4.6beta7
- *
- * Revision 1.1  1999/03/31  18:11:35  caress
- * Initial revision
- *
-
- *
- */
-/*
- * Notes on the MBF_OICMBARI data format:
- *   1. This data format is an extended version of the vendor
- *      format used to store swath sonar data
- *      collected and recorded using the GeoDAS-SV1 system
- *      developed and sold by Ocean Imaging Consultants.
- *      In particular, the Deep Submergence Lab (DSL) of
- *      the Woods Hole Oceanographic Institution (WHOI) now
- *      uses an OIC GeoDAS-SV1 package as the front end for
- *      their deep towed 120 kHz interferometry sonar (AMS-120).
- *      This format stores processed bathymetry and sidescan
- *      data in addition to the "raw" data found in the
- *      original data files.
- *   2. The data consist of variable length binary records.
- *   3. Each data record has three parts.  First there is a 248-byte
- *      header section containing the time stamp, navigation, a
- *      variety of other values, the numbers and sizes of sonar
- *      data included in the record.  The second, optional, part of
- *      the record is "client specific information" of arbitrary
- *      length. The third part contains up to eight arrays of
- *      sonar data.
- *   4. The header begins with a four byte magic number. The first
- *      three bytes are 'G', 'E', and '2'. The fourth byte is
- *      the id number for the data source.
- *   5. The maximum numbers of beams and pixels defined below are
- *      limitations specific to this I/O module - the format itself
- *      contains no limits on the amount of data per record.
- *   6. Comment records are encoded in MBIO using the "client
- *      specific information" section of the record and an unused
- *      sonar type value.
- *
- */
-
-/* defines sizes of things */
-#define	MBF_OICMBARI_HEADER_SIZE	276
-#define	MBF_OICMBARI_MAX_CLIENT		252
-#define	MBF_OICMBARI_MAX_COMMENT	MBF_OICMBARI_MAX_CLIENT
-#define	MBF_OICMBARI_MAX_CHANNELS	8
-
-/* define maximum number of beams */
-#define	MBF_OICMBARI_MAX_BEAMS		1024
-#define	MBF_OICMBARI_MAX_PIXELS		2048
-
-struct mbf_oicmbari_channel_struct
-	{
-	int		offset;		/* offset in bytes to channel data */
-	mb_u_char	type;		/* sonar type:
-					    0 = sidescan
-					    1 = angle
-					    2 = multibeam */
-	mb_u_char	side;		/* sonar side:
-					    0 = port
-					    1 = starboard */
-	mb_u_char	size;		/* data sample type and size:
-					    0 = 1 byte integer
-					    1 = 2 byte integer
-					    2 = 4 byte integer
-					    3 = 4 byte float
-					    4 = 12 byte set of three
-						floats - range, theta, amp */
-	mb_u_char	empty;		/* spare */
-	int		frequency;	/* Hz */
-	int		num_samples;	/* number of samples stored for
-					    sidescan and angle sonar types,
-					    number of beams for multibeam */
-	};
-
-struct mbf_oicmbari_data_struct
-	{
-	int		rawsize[MBF_OICMBARI_MAX_CHANNELS];
-	char		*raw[MBF_OICMBARI_MAX_CHANNELS];
-	int		beams_bath_alloc;
-	int		beams_amp_alloc;
-	int		pixels_ss_alloc;
-	char		*beamflag;
-	float		*bath;
-	float		*amp;
-	float		*bathacrosstrack;
-	float		*bathalongtrack;
-	float		*tt;
-	float		*angle;
-	float		*ss;
-	float		*ssacrosstrack;
-	float		*ssalongtrack;
-	};
-
-struct mbf_oicmbari_seaview_struct
-	{
-	double		longitude;	/* longitude in degrees */
-	double		latitude;	/* latitude in degrees */
-	int		x;		/* local x coordinates in yards */
-	int		y;		/* local y coordinates in yards */
-	int		uncertainty;	/* navigation uncertainty in yards */
-	float		speed;		/* speed over ground in knots */
-	float		altitude;	/* platform altitude in feet */
-	float		depth;		/* platform depth in feet */
-	float		sound_velocity;	/* sound velocity in feet/sec */
-	char		id[20];		/* client id string */
-	};
-
-struct mbf_oicmbari_header_struct
-	{
-	mb_u_char	type;		/* Magic number:
-					    0 - EG&G sonar
-					    1 - SEAVIEW sonar
-					    2 - DEEPSCAN sonar
-					    3 - STEST SEAVIEW test
-					    4 - QTEST QMIPs test
-					    5 - SM2 SeaMARC2 test
-					    22 - WHOI DSL AMS120 */
-	int		proc_status;	/* OIC processing status in
-					    bit mask form */
-	int		data_size;
-	mb_u_char	client_size;
-	mb_u_char	fish_status;	/* status bit field:
-						0:  FocusAutoManual
-						1:  FocusManualDisableEnable
-						2:  PingRate AutoManual
-						3:  TvgAutoManual
-						4:  CalibOffOn
-						5:  OutputModeProcRaw
-						6:  ShadowMask
-						7:  QualityBit */
-	mb_s_char	nav_used;
-	mb_s_char	nav_type;	/*  0 = UTM coordinates in m
-					    1 = Local coordinates in m
-					    2 = Latitude and longitude */
-	int		utm_zone;
-	float		ship_x;		/* meters or degrees  */
-	float		ship_y;		/* meters or degrees  */
-	float		ship_course;	/* degrees */
-	float		ship_speed;	/* m/sec */
-	int		sec;
-	int		usec;
-	float		spare_gain;
-	float		fish_heading;	/* degrees */
-	float		fish_depth;	/* meters */
-	float		fish_range;	/* meters */
-	float		fish_pulse_width;   /* msec */
-	float		gain_c0;
-	float		gain_c1;
-	float		gain_c2;
-	float		fish_pitch;	/* degrees */
-	float		fish_roll;	/* degrees */
-	float		fish_yaw;	/* degrees */
-	float		fish_x;		/* meters or degrees  */
-	float		fish_y;		/* meters or degrees  */
-	float		fish_layback;	/* meters */
-	float		fish_altitude;	/* meters */
-	int		fish_altitude_samples;
-	float		fish_ping_period;   /* seconds per ping */
-	float		sound_velocity;	/* m/sec */
-	int		num_chan;
-	int		beams_bath;
-	int		beams_amp;
-	int		bath_chan_port;
-	int		bath_chan_stbd;
-	int		pixels_ss;
-	int		ss_chan_port;
-	int		ss_chan_stbd;
-	struct mbf_oicmbari_channel_struct channel[MBF_OICMBARI_MAX_CHANNELS];
-	};
-
-struct mbf_oicmbari_struct
-	{
-	int	kind;
-	struct mbf_oicmbari_header_struct header;
-	char	client[MBF_OICMBARI_MAX_CLIENT];
-	struct mbf_oicmbari_data_struct data;
-	};
diff --git a/src/mbio/mbf_omghdcsj.h b/src/mbio/mbf_omghdcsj.h
deleted file mode 100644
index 3a4a20b..0000000
--- a/src/mbio/mbf_omghdcsj.h
+++ /dev/null
@@ -1,762 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbf_omghdcsj.h	3/10/99
- *	$Id: mbf_omghdcsj.h 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1999-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbf_omghdcsj.h defines the data structures used by MBIO functions
- * to store multibeam data read from the  MBF_OMGHDCSJ format (MBIO id 141).
- *
- * Author:	D. W. Caress
- * Date:	March 10, 1999
- *
- * $Log: mbf_omghdcsj.h,v $
- * Revision 5.3  2008/03/14 18:33:21  caress
- * Updated support for JHC format 151.
- *
- * Revision 5.2  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.1  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.0  2000/12/01 22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.1  2000/09/30  06:34:20  caress
- * Snapshot for Dale.
- *
- * Revision 4.0  1999/03/31  18:29:20  caress
- * MB-System 4.6beta7
- *
- * Revision 1.1  1999/03/31  18:11:35  caress
- * Initial revision
- *
-
- *
- */
-/*
- * Notes on the MBF_OMGHDCSJ data format:
- *   1. The OMG-HDCS format is a collection of similar data
- *      formats used by the seafloor mapping software
- *      developed by Dr. John Hughes Clarke (Ocean Mapping
- *      Group of the University of New Brunswick). A variety
- *      of sonars are supported in OMG-HDCS.
- *   2. OMG-HDCS files all begin with a summary header that
- *      specifies the format version, the data source
- *      (type of sonar), the number of records,  and the
- *      minimum and maximum values of position and data
- *      values.
- *   3. The summary header is followed by a set of uniformly
- *      sized data records. The data record size is determined
- *      by the format version and data source. Ecch record is
- *      is divided into a profile (header) and an array of
- *      beam structures.
- *   4. Sidescan imagery can be stored in parallel files in
- *      the same directory as the primary bathymetry and
- *      amplitude files. The sidescan files have the suffix
- *      ".ss_data" added to the end of the primary file's name.
- *   5. Comment records are encoded in MBIO by setting the first
- *      eight bytes of the data record header (profile) to '#'
- *      values. The profile part of the comment record will have
- *      the same size as expected for data from the tool type
- *      listed in the summary. However, the data section for
- *      comment records will always be 256 bytes long regardless
- *      of the tool type. This mechanism is supported only by
- *      MB-System.
- *
- */
-
-/* defines sizes and maximums */
-#define	MBF_OMGHDCSJ_SUMMARY_SIZE	96
-#define	MBF_OMGHDCSJ_SUMMARY_V4EXTRA_SIZE  168
-#define	MBF_OMGHDCSJ_MAX_COMMENT	252
-#define	MBF_OMGHDCSJ_MAX_BEAMS		1440
-#define	MBF_OMGHDCSJ_MAX_PIXELS		1024
-
-/* define tables of data record sizes */
-#define MBF_OMGHDCSJ_PROFILE_LENGTH	0
-#define MBF_OMGHDCSJ_MAX_NO_BEAMS	1
-#define MBF_OMGHDCSJ_BEAM_LENGTH	2
-#define MBF_OMGHDCSJ_IMAGE_LENGTH	3
-
-static int mbf_omghdcsj_tooldefs1[MBSYS_HDCS_NUM_TOOLS][4] =
-		    {/*                            PRS     no. DRS  IRS */
-                    /*   0:SingleBeam,        */  { 44,     1,   8, 0},
-                    /*   1:ELAC BottomChartMk1*/  { 64,    56,  44, 0},
-                    /*   2:EM12(dual)         */  { 64,   162,  64, 0},
-                    /*   3:EM100 (just depths)*/  { 44,    32,  36, 0},
-                    /*   4:FanSweep10 (old)   */  { 44,    52,  36, 0},
-                    /*   5:Seabeam "Classic"  */  { 24,    19,  24, 0},
-                    /*   6:EM3000S            */  { 64,   128,  64, 0},
-                    /*   7:ROSS sweep         */  { 44,    16,  12, 0},
-                    /*   8:EM12(single)       */  { 64,    81,  64, 0},
-                    /*   9:EM100+Amplitudes   */  { 64,    32,  44, 0},
-                    /*  10:EM1000             */  { 64,    60,  64, 0},
-                    /*  11:LADS secondary     */  { 44,    24,  36, 0},
-                    /*  12:EM3000D            */  { 64,   256,  64, 0},
-                    /*  13:Seabeam 2100       */  { 44,   151,  44, 0},
-                    /*  14:ISIS Submetrix     */  { 44,   128,  44, 0},
-                    /*  15:EM-1000 (justampl) */  { 44,    60,  44, 0},
-                    /*  16:SB2K               */  { 64,   121,  64, 0},
-                    /*  17:Seabat9001         */  { 44,    60,  44, 0},
-                    /*  18:FanSweep 10 A      */  { 64,    52,  64, 0},
-                    /*  19:FanSweep 20        */  { 64,   600,  64, 0},
-                    /*  20:ISIS SWA format    */  { 64,  1280,  64, 0},
-                    /*  21:SeaBeam 1180 Mk II */  { 64,    42,  64, 0},
-                    /*  22:SeaBat 8101        */  { 64,   101,  64, 0},
-                    /*  23:EM300              */  { 88,   137,  76, 0},
-                    /*  24:EM121A             */  { 64,   121,  64, 0},
-		    /*  25:SM2000             */  { 64,   128,  64, 0},
-		    /*  26:HydroSweep MD2     */  {280,   320,  76, 0},
-		    /*  23:EM1002             */  { 88,   111,  76, 0},
-		    /*  28:HUMMIN'BIRD        */  { 64,     6,  44, 0},
-		    /*  29:Knudsen 320        */  { 88,     2,  76, 0},
-		    /*  30: EM 120            */  { 88,   191,  76, 0},
-		    /*  31:SeaBat 8125        */  { 64,   240,  64, 0},
-		    /*  32:SeaBat 8111        */  { 64,   101,  64, 0},
-		    /*  33:SeaBat 8150        */  { 64,   234,  64, 0},
-		    /*  34:EM3002             */  { 64,   256,  64, 0},
-		    /*  35:Optech Laser       */  { 64,   100,  64, 0},
-		    /*  36:EM710 400 beam     */  { 64,   400,  64, 0},
-		    /*  37:EM3002D            */  { 64,   512,  64, 0},
-		    /*  38:SeaBat 8160        */  { 64,   126,  64, 0},
-		    /*  39:SEA SwathPlus      */  { 64,   600,  64, 0},
-		    /*  40:EM122	      */  { 64,   432,  64, 0},
-		    /*  41:EM302 432??	      */  { 64,   432,  64, 0},
-		    /*  42:SeaBat 7125	      */  { 64,   512,  64, 0},
-		    /*  43:R2Sonic 2024       */  { 64,   256,  64, 0},
-		    /*  44:SeaBat 7150	      */  { 64,   880,  64, 0},
-		    /*  45:OMG GLORIA	      */  { 1,    1024, 1,  0},
-		    /*  46:ODOM ES3           */  {64,    480,  64, 0},
-		    /*  47:EM2040             */  {64,    400,  64, 0},
-		    /*  48:HC5K               */  {64,   1000,  64, 0},
-		    /*  49:R2Sonic 2022       */  {64,    256,  64, 0},
-		    /*  50:SeaBat 7111        */  {64,    301,  64, 0},
-		    /*  51:EdgeTech 4600      */  {64,   1000,  64, 0},
-		    /*  52:ME70               */  {64,   1000,  64, 0},
-		    /*  53:SeaBat 7101        */  {64,    511,  64, 0},
-		    /*  54:EM2040D            */  {64,    800,  64, 0}
-		    };
-static int mbf_omghdcsj_tooldefs2[MBSYS_HDCS_NUM_TOOLS][4] =
-		    {/*                            PRS     no. DRS  IRS */
-                    /*   0:SingleBeam,        */  { 32,     1,  20, 0},
-                    /*   1:ELAC Bottom_Chart  */  { 32,    56,  12, 0},
-                    /*   2:EM12(dual)         */  { 32,   162,  00, 0},
-                    /*   3:EM100 (just depths)*/  { 32,    32,  00, 0},
-                    /*   4:FanSweep           */  { 32,    52,  00, 0},
-                    /*   5:Seabeam            */  { 32,    19,  10, 0},
-                    /*   6:EM3000S            */  { 32,   128,  20, 0},
-                    /*   7:ROSS sweep         */  { 32,    16,  10, 0},
-                    /*   8:EM12(single)       */  { 32,    81,  20, 0},
-                    /*   9:EM100+Amplitudes   */  { 32,    32,  12, 0},
-                    /*  10:EM1000             */  { 32,    60,  20, 0},
-                    /*  11:LADS secondary     */  { 32,    24,  12, 0},
-                    /*  12:EM3000D            */  { 32,   256,  20, 0},
-                    /*  13:Seabeam 2100       */  { 32,   151,  12, 0},
-                    /*  14:ISIS Submetrix     */  { 32,   128,  20, 0},
-                    /*  15:EM-1000 (justampl) */  { 32,    60,  00, 0},
-                    /*  16:SB2K               */  { 32,   121,  00, 0},
-                    /*  17:Seabat9001         */  { 32,    60,  12, 0},
-                    /*  18:FanSweep 10 A      */  { 32,    52,  20, 0},
-                    /*  19:FanSweep 20        */  { 32,   600,  12, 0},
-                    /*  20:ISIS SWA format    */  { 32,  1280,   8, 0},
-                    /*  21:SeaBeam 1180 Mk II */  { 32,    42,  12, 0},
-                    /*  22:SeaBat 8101        */  { 32,   101,  12, 0},
-                    /*  23:EM300              */  { 32,   137,  20, 0},
-                    /*  24:EM121A             */  { 32,   121,  20, 0},
-		    /*  25:SM2000             */  { 32,   128,  20, 0},
-		    /*  26:HydroSweep MD2     */  { 32,   320,  20, 0},
-		    /*  27:EM1002             */  { 32,   111,  20, 0},
-		    /*  28:HUMMIN'BIRD        */  { 32,     6,  12, 0},
-		    /*  29:Knudsen 320        */  { 32,     2,  20, 0},
-		    /*  30: EM 120            */  { 32,   191,  20, 0},
-		    /*  31:SeaBat 8125        */  { 32,   240,  12, 0},
-		    /*  32:SeaBat 8111        */  { 32,   101,  12, 0},
-		    /*  33:SeaBat 8150        */  { 32,   234,  12, 0},
-		    /*  34:EM3002             */  { 32,   256,  20, 0},
-		    /*  35:Optech Laser       */  { 32,   100,  20, 0},
-		    /*  36:EM710 400 beam     */  { 32,   400,  20, 0},
-		    /*  37:EM3002D            */  { 32,   512,  20, 0},
-		    /*  38:SeaBat 8160        */  { 32,   126,  12, 0},
-		    /*  39:SEA SwathPlus      */  { 32,   600,  12, 0},
-                    /*  40:EM122 432 beam     */  { 32,   432,  20, 0},
-                    /*  41:EM302 432??????    */  { 32,   432,  20, 0},
-                    /*  42:SeaBat 7125        */  { 64,   512,  64, 0},
-                    /*  43:R2Sonic 2024        */ { 32,   256,  12, 0},
-                    /*  44:SeaBat 7150        */  { 32,   880,  12, 0},
-                    /*  45:OMG GLORIA        */   {  1,   1024,  1, 0},
-                    /*  46:ODOM ES3           */  {64,    480, 64, 0},
-                    /*  47:EM2040             */  {32,    400, 20, 0},
-                    /*  48:HC5K               */  {32,   1000, 20, 0},
-                    /*  49:R2Sonic 2024       */  {32,    256, 12, 0},
-                    /*  50:SeaBat 7111        */  {32,    301, 12, 0},
-                    /*  51:EdgeTech 4600      */  {32,   1000, 20, 0},
-                    /*  52:ME70               */  {32,   1000, 20, 0},
-                    /*  53:SeaBat 7101        */  {32,    511, 12, 0},
-                    /*  54:EM2040D            */  {32,    800, 20, 0}
-		    };
-static int mbf_omghdcsj_tooldefs3[MBSYS_HDCS_NUM_TOOLS][4] =
-		    {/*                            PRS     no. DRS  IRS */
-                    /*   0:SingleBeam,        */  { 32,     1,  20, 0},
-                    /*   1:ELAC Bottom_Chart  */  { 32,    56,  12, 0},
-                    /*   2:EM12(dual)         */  { 32,   162,  00, 0},
-                    /*   3:EM100 (just depths)*/  { 32,    32,  00, 0},
-                    /*   4:FanSweep           */  { 32,    52,  00, 0},
-                    /*   5:Seabeam            */  { 32,    19,  10, 0},
-                    /*   6:EM3000S            */  { 32,   128,  28, 0},
-                    /*   7:ROSS sweep         */  { 32,    16,  10, 0},
-                    /*   8:EM12(single)       */  { 32,    81,  28, 0},
-                    /*   9:EM100+Amplitudes   */  { 32,    32,  12, 0},
-                    /*  10:EM1000             */  { 56,    60,  28, 0},
-                    /*  11:LADS secondary     */  { 32,    24,  12, 0},
-                    /*  12:EM3000D            */  { 32,   256,  28, 0},
-                    /*  13:Seabeam 2100       */  { 56,   151,  28, 0},
-                    /*  14:ISIS Submetrix     */  { 36,   128,  28, 0},
-                    /*  15:EM-1000 (justampl) */  { 32,    60,  00, 0},
-                    /*  16:SB2K               */  { 32,   121,  00, 0},
-                    /*  17:Seabat9001         */  { 32,    60,  20, 0},
-                    /*  18:FanSweep 10 A      */  { 32,    52,  20, 0},
-                    /*  19:FanSweep 20        */  {272,   600,  28, 0},
-                    /*  20:ISIS SWA format    */  { 32,  1280,   8, 0},
-                    /*  21:SeaBeam 1180 Mk II */  {272,    42,  28, 0},
-                    /*  22:SeaBat 8101        */  {272,   101,  28, 0},
-                    /*  23:EM300              */  { 56,   135,  28, 0},
-                    /*  24:EM121A             */  { 32,   121,  28, 0},
-		    /*  25:SM2000             */  { 56,   128,  28, 0},
-		    /*  26:HydroSweep MD2     */  {272,   320,  28, 0},
-		    /*  27:EM1002             */  { 56,   111,  28, 0},
-		    /*  28:HUMMIN'BIRD        */  { 32,     6,  28, 0},
-		    /*  29:Knudsen 320        */  { 36,     2,  28, 0},
-		    /*  30: EM 120            */  { 56,   191,  28, 0},
-		    /*  31:SeaBat 8125        */  {272,   240,  28, 0},
-		    /*  32:SeaBat 8111        */  {272,   101,  28, 0},
-		    /*  33:SeaBat 8150        */  {272,   234,  28, 0},
-		    /*  34:EM3002             */  { 32,   256,  28, 0},
-		    /*  35:Optech Laser       */  { 32,   100,  28, 0},
-		    /*  36:EM710 400 beam     */  { 32,   400,  28, 0},
-		    /*  37:EM3002D            */  { 32,   512,  28, 0},
-		    /*  38:SeaBat 8160        */  {272,   126,  28, 0},
-		    /*  39:SEA SwathPlus      */  { 32,   600,  28, 0},
-                    /*  40:EM122 432 beam     */  { 32,   432,  28, 0},
-                    /*  41:EM302 432??????    */  { 32,   432,  28, 0},
-                    /*  42:SeaBat 7125        */  { 272,  512,  28, 0}, /* Using 272 for now until v4 setup for it */
-                    /*  43:R2Sonic 2024       */  { 272,  256,  28, 0},
-                    /*  44:SeaBat 7150        */  { 272,  880,  28, 0},
-                    /*  45:OMG GLORIA         */  {   1, 1024,   1, 0},
-                    /*  46:ODOM ES3           */  { 32,   480,  32, 0},
-                    /*  47:EM2040             */  { 32,   400,  28, 0},
-                    /*  48:HC5K               */  { 32,  1000,  28, 0},
-                    /*  49:R2Sonic 2024       */  {272,   256,  28, 0},
-                    /*  50:SeaBat 7111        */  {272,   301,  28, 0},
-                    /*  51:EdgeTech 4600      */  { 32,  1000,  28, 0},
-                    /*  52:ME70               */  { 32,  1000,  28, 0},
-                    /*  53:SeaBat 7101        */  {272,   511,  28, 0},
-                    /*  54:EM2040D            */  { 32,   800,  28, 0}
-		    };
-
-/* define OMG-HDCS summary header structure */
-struct mbf_omghdcsj_summary_struct
-        {
-        int    sensorNumber;	/*  1 = depth file */
-        int    subFileID;	/*  1 = data (as opposed to index) */
-        int    fileVersion;	/* 1 = original format */
-				/* 2 = packed format for EM1000 and others */
-				/* 3 = packed format for EM300 */
-        int    toolType;	/* Tool Type implies Profile Record Size
-					and Depth Record Size
-					and Image Record Size */
-        int    numProfiles;	/* # of profiles in the file             */
-        int    numDepths;	/* # of depths in the file             */
-        int    timeScale;	/* time scale (# of uSec. units) */
-        int    refTime;		/* Reference time (100 sec. units)       */
-        int    minTime;		/* Minimum time (offset wrt. ref.)       */
-        int    maxTime;		/* Maximum time (offset wrt. ref.)       */
-        int    positionType;	/* Geographic(1)/ UTM(2) */
-        int    positionScale;	/* Position scale (# of nRad. units)     */
-        int    refLat;		/* Reference latitude (100 nRadians)     */
-        int    minLat;		/* Minimum latitude (offset wrt. ref.)   */
-        int    maxLat;		/* Maximum latitude (offset wrt. ref.)   */
-        int    refLong;		/* Reference longitude (100 nRadians)    */
-        int    minLong;		/* Minimum longitude (offset wrt. ref.)  */
-        int    maxLong;		/* Maximum longitude (offset wrt. ref.)  */
-        int    minObsDepth;	/* Minimum depth (mm)                    */
-        int    maxObsDepth;	/* Maximum depth (mm)                    */
-        int    minProcDepth;	/* Minimum depth (mm)                    */
-        int    maxProcDepth;	/* Maximum depth (mm)                    */
-        int    status;		/* status not actually used at all ....  */
-
-	/*** V4 ***/
-	int totalProfileBytes;
-	int Profile_BitsDefining[20];
-	int totalBeamBytes;
-	int Beam_BitsDefining[20];
-
-        };
-
-
-/* specific FOR ATLAS SAPI data */
-struct mbf_omghdcs_profile_subparams_struct
-{
-
-  unsigned short txBeamIndex;
-  unsigned short txLevel;
-  short txBeamAngle;
-  unsigned short txPulseLength;
-
-  unsigned int ss_offset;
-  unsigned short no_skipped_ss;
-  unsigned short no_acquired_ss;
-  unsigned short ss_sample_interval;
-
-  unsigned short bscatClass;
-  unsigned short nrActualGainSets;
-  short rxGup;
-  short rxGain;
-  short ar;
-  unsigned short rxtime[20];
-  short rxgain[20];
-
-};
-
-
-/* define profile record structure */
-struct mbf_omghdcsj_profile_struct{
-        int    status;		/* status is either OK (0)
-					or no nav (1)
-					or unwanted for gridding (2)
-					or comment record (999) (MB-System only) */
-        int    numDepths;	/* Number of depths in profile        */
-        int    numSamples;	/* Number of sidescan samples in parallel file        */
-        int    timeOffset;	/* Time offset  wrt. header           */
-        int    vesselLatOffset;	/* Latitude offset wrt. header        */
-        int    vesselLongOffset;/* Longitude offset wrt. header       */
-        int    vesselHeading;	/* Heading (100 nRadians)             */
-        int    vesselHeave;	/* Heave (mm)                         */
-        int    vesselPitch;	/* Vessel pitch (100 nRadians)        */
-        int    vesselRoll;	/* Vessel roll (100 nRadians)         */
-        int    tide;		/* Tide (mm)                          */
-        int    vesselVelocity;	/* Vessel Velocity (mm/s)
-					note - transducer pitch is
-					generally tucked into the vel field     */
-
-	/* the above fields are sufficient for original EM100 data without imagery
-		but later data often requires more fields below */
-	char    power;
-	char    TVG;
-	char    attenuation;
-	char    edflag;
-        int	soundVelocity; 	/* mm/s */
-	int	lengthImageDataField;
-        int	pingNo;
-	char	mode;
-	char	Q_factor;
-	char	pulseLength;   /* centisecs*/
-	mb_u_char unassigned;
-
-	/* the fields below were added to cope with EM300 */
-	unsigned short td_sound_speed;
-	unsigned short samp_rate;
-	mb_u_char z_res_cm;
-	mb_u_char xy_res_cm;
-	mb_u_char ssp_source;
-	mb_u_char filter_ID;
-	unsigned short absorp_coeff;
-	unsigned short tx_pulse_len;
-	unsigned short tx_beam_width;
-	unsigned short max_swath_width;
-	mb_u_char tx_power_reduction;
-	mb_u_char rx_beam_width;
-	mb_u_char rx_bandwidth;
-	mb_u_char rx_gain_reduction;
-	mb_u_char tvg_crossover;
-	mb_u_char beam_spacing;
-	mb_u_char coverage_sector;
-	mb_u_char yaw_stab_mode;
-
-	/* V4 */
-	/* extra from HydroSweep MD2 Surf data */
-  	struct mbf_omghdcs_profile_subparams_struct params[2];
-
-  	int transducerDepth;		/* transducer or  towfish depth */
-  	int transducerPitch;		/* Transducer pitch (100 nRadians)    */
-  	int transducerRoll;		/* Transducer roll (100 nRadians)     */
-  	/* enough for dyn. stab transducer */
-  	int transducerHeading;	/* Transducer pitch (100 nRadians)    */
-  	int transducerLatOffset;	/* Latitude offset wrt. vessel        */
-  	int transducerLongOffset;	/* Longitude offset wrt. vessel       */
-  	int transducerSlantRange;	/*slantRange(mm) wrt. vessel (cable out) */
-  	int transducerAcross;		/* horizontal Range (mm) wrt. vessel */
-  	int transducerAlong;		/* horizontal Range (mm) wrt. vessel */
-  	int transducerBearing;	/* Bearing (100nRads) wrt. vessel       */
-
-  	/* NEW EXTRA Fields that can be added in V4  based on bits in the extended summary header */
-  	short longperiod_heaveCorrection;
-  	short dynamic_draftCorrection;
-
-  	short deepdraftoffset_in_metres;
-  	short draft_at_Tx;
-
-  	short alternateRoll;
-  	short alternatePitch;
-  	short alternateHeave;
-  	short alternateHeading;
-
-  	short standaloneHeading;
-
-  	short RTK_at_RP;  /* in cm units so that can support +/- 320m. */
-  	short Lowpass_RTK_at_RP;  /* in cm units so that can support +/- 320m. */
-  	short WLZ;
-  	unsigned short samp_rate_SecondHead;
-
-  	signed int clock_drift_millis;
-
-  	/* added June 2005 to support EM3002, EM710 water column telegrams */
-  	unsigned int watercol_offset;
-  	unsigned int watercol_size;
-
-  	/* added June 2008 to support second head of EM3002D water column telegrams */
-  	unsigned int watercol_offset_2nd;
-  	unsigned int watercol_size_2nd;
-
-  	/* New fields to accomodate un-TVG-ing kongsberg data */
-  	unsigned short range_to_normal_incidence;
-
-	/* units of 1,000,000,000 of the Optech laser microsecond(?) time stamp */
-  	unsigned int laser_timestampRef;
-
-  	/* Added to accomodate EM710 (and EM302/EM122) transmit sector info */
-
-  	unsigned int tx_sector_offset;
-  	unsigned short num_tx_sectors;
-
-  	/* New fields for Reson 7K systems */
-  	unsigned int sonar_settings_offset;
-  	unsigned int ping_number;
-
-  	/* These aren't done yet */
-  	unsigned short multi_ping_sequence;
-  	unsigned int num_beams;	/* Which is different than numDepths... */
-					/* (which is usually the number of possible depths and not ACTUAL depths */
-					/* e.g. high-density vs. low-density mode in KM systems) */
-  	unsigned char layer_compensation_flag;
-  	float    bs_beam_position;
-  	unsigned int bs_control_flags;
-  	unsigned short bs_num_beams_per_side;
-  	unsigned short bs_current_beam_number;
-  	unsigned char bs_sample_descriptor;
-  	unsigned int snippet_sample_descriptor;
-	};
-
-/* define beam record structure */
-struct mbf_omghdcsj_beam_struct {
-        int	status;           /* status is either OK (0) or bad (other) */
-        /* V4 Only */
-        mb_u_char scaling_factor;
-        /* unsigned char nothing[3]; */
-        /* Done V4 */
-        int	observedDepth;    /* Depth (mm)                            */
-        int	acrossTrack;      /* Across track position of depth (mm)   */
-        int	alongTrack;       /* Along track position of depth (mm)    */
-        int	latOffset;        /* Latitude offset wrt. profile          */
-        int	longOffset;       /* Longitude offset wrt. profile         */
-        int	processedDepth;    /* Depth (mm)                            */
-	int	timeOffset;
-        int	depthAccuracy;    /* Depth accuracy (mm)                   */
-	mb_u_char reflectivity;
-	char	Q_factor;  /* phase or amplitude detection */
-	char	beam_no;
-	char	freq;   /* 12.7, 13.0, 13.3, 95.0, Smii, GLORIA */
-
-	char	calibratedBackscatter; /* effects of power/TVG and atten.
-					    removed*/
-	char	mindB;
-	char	maxdB;
-	mb_u_char	pseudoAngleIndependentBackscatter;
-					/* corrected for mean angular dependence
-					    for geological visualisation */
-	int	range;   /* other option on EM 12 */
-	int	no_samples;
-	int	offset;
-	int	centre_no;
-	char	sample_unit; /* whether in time or distance */
-	char	sample_interval; /* seconds or metres */
-	char	dummy[2];
-	mb_u_char	samp_win_length;
-	short	beam_depress_angle;
-	unsigned short	beam_heading_angle;
-
-	/* NEW EXTRA Fields that can be added depending on bits in the V4 summary header */
-	unsigned short other_range;
-	signed short Tx_steer;
-	signed short Rc_steer;
-
-	mb_u_char TxSector;
-	float Ifremer_qfactor;
-	unsigned int timestampOffset; /* really is a 64 bit integer, trying to compress */
-				/* would'nt even need if didn't have to relate wavefile
-			 	by this number */
-	unsigned short no_RAMAN;
-	unsigned short no_IR;
-	unsigned short no_GAPD;
-	unsigned short no_PMT;
-	mb_u_char prim_depth_conf;
-	mb_u_char seco_depth_conf;
-	signed short scan_azimuth; 	/* 100ths of degree */
-	unsigned short nadir_angle; 	/* 100ths of degree */
-				/* always dynamically compressed for v4 using scaling factor */
-	signed int secondaryDepth;	/* Depth (mm) remember can be +ve or -ve  */
-	signed short wave_height;
-
-  /* even NEWER stuff to support custom Pim extra bottom detect solution for Optech laser trace data. */
-	signed int opaqueDepth_PMT;		/* Depth (mm)                            */
-	signed int extinctionDepth_PMT;	/* Depth (mm)                            */
-	signed int pimDepth_PMT;		/* Depth (mm)                            */
-
-	signed int opaqueDepth_GAPD;		/* Depth (mm)                            */
-	signed int extinctionDepth_GAPD;	/* Depth (mm)                            */
-	signed int pimDepth_GAPD;		/* Depth (mm)                            */
-
-	/*A few extras for Reson 7k systems */
-	float twtt;
-	unsigned int snippet_first_sample;
-	unsigned int snippet_last_sample;
-	float intensity;
-	};
-
-/* define data holding structure */
-struct mbf_omghdcsj_data_struct
-	{
-	struct mbf_omghdcsj_beam_struct *beams;
-	mb_s_char	*ss_raw;
-	int	pixel_size;	/* processed sidescan pixel size in mm */
-	int	pixels_ss;	/* number of processed sidescan pixels stored */
-	short	ss_proc[MBF_OMGHDCSJ_MAX_PIXELS];
-				/* the processed sidescan ordered port to starboard */
-	int	ssalongtrack[MBF_OMGHDCSJ_MAX_PIXELS];
-				/* the processed sidescan alongtrack distances
-					in mm */
-	};
-
-/* structure to hold everything */
-struct mbf_omghdcsj_struct
-	{
-	int	kind;
-	struct mbf_omghdcsj_summary_struct summary;
-	struct mbf_omghdcsj_profile_struct profile;
-	char	comment[MBF_OMGHDCSJ_MAX_COMMENT];
-	struct mbf_omghdcsj_data_struct	    data;
-	char	*buffer;
-	};
-
-/* BIT Masks */
-/* ZEROTH LONG WORD */
-/* ---------------------------------------------------------------------- */
-#define BEAM_ui_status					0x00000001
-#define BEAM_uc_scaling_factor				0x00000002
-#define BEAM_si_observedDepth				0x00000004
-#define BEAM_si_acrossTrack				0x00000008
-#define BEAM_si_alongTrack				0x00000010
-#define BEAM_si_latOffset				0x00000020
-#define BEAM_si_longOffset				0x00000040
-#define BEAM_si_processedDepth				0x00000080
-#define BEAM_si_timeOffset				0x00000100
-#define BEAM_si_depthAccuracy				0x00000200
-
-/* ---------------------------------------------------------------------- */
-/* ONE'TH LONG WORD */
-/* this is stuff you'd only have if you have a single value per beam */
-#define BEAM_uc_reflectivity				0x00000001
-#define BEAM_sc_Q_factor				0x00000002
-#define BEAM_uc_beam_no					0x00000004
-#define BEAM_uc_freq					0x00000008
-#define BEAM_uc_calibratedBackscatter			0x00000010
-#define BEAM_uc_mindB					0x00000020
-#define BEAM_uc_maxdB					0x00000040
-#define BEAM_uc_pseudoAngleIndependentBackscatter	0x00000080
-
-
-/* ---------------------------------------------------------------------- */
-/* TWO'TH LONG WORD */
-/* this is stuff you'd only have if you have snippets */
-#define BEAM_ui_range					0x00000001
-#define BEAM_ui_no_samples				0x00000002
-#define BEAM_ui_offset					0x00000004
-#define BEAM_si_centre_no				0x00000008
-#define BEAM_uc_sample_unit				0x00000010
-#define BEAM_uc_sample_interval				0x00000020
-#define BEAM_uc_dummy0					0x00000040
-#define BEAM_uc_dummy1					0x00000080
-#define BEAM_uc_samp_win_length				0x00000100
-
-/*---------------------------------------------------------------------- */
-/* THREE'TH LONG WORD */
-/* this is stuff you'd only have if you are serious about recalcuating the beam vector */
-#define	BEAM_ss_beam_depress_angle			0x00000001
-#define BEAM_us_beam_heading_angle			0x00000002
-#define BEAM_us_other_range  				0x00000004
-#define BEAM_ss_Tx_steer  				0x00000008
-#define BEAM_ss_Rc_steer  				0x00000010
-#define BEAM_uc_TxSector				0x00000020
-#define BEAM_f_Ifremer_qfactor				0x00000040 /* Add Sept. 2013 */
-
-/* ---------------------------------------------------------------------- */
-/* FOUR'TH LONG WORD */
-/* this is stuff for SHOAL/CHARTS laser bathymetry */
-#define	BEAM_ui_timestampOffset			0x00000001
-#define	BEAM_us_no_RAMAN			0x00000002
-#define	BEAM_us_no_IR				0x00000004
-#define	BEAM_us_no_GAPD				0x00000008
-#define	BEAM_us_no_PMT				0x00000010
-#define	BEAM_uc_prim_depth_conf			0x00000020
-#define	BEAM_uc_seco_depth_conf			0x00000040
-#define	BEAM_ss_scan_azimuth			0x00000080
-#define	BEAM_us_nadir_angle			0x00000100
-#define	BEAM_si_secondaryDepth			0x00000200
-#define	BEAM_ss_wave_height			0x00000400
-#define BEAM_si_opaqueDepth_PMT			0x00000800
-#define BEAM_si_extinctionDepth_PMT		0x00001000
-#define BEAM_si_pimDepth_PMT			0x00002000
-#define BEAM_si_opaqueDepth_GAPD		0x00004000
-#define BEAM_si_extinctionDepth_GAPD		0x00008000
-#define BEAM_si_pimDepth_GAPD			0x00010000
-
-/* ---------------------------------------------------------------------- */
-/* FIFTH LONG WORD */
-/* Stuff for Reson 7K systems */
-#define	BEAM_f_twtt				0x00000001
-#define	BEAM_ui_snippet_first_sample		0x00000002
-#define	BEAM_ui_snippet_last_sample		0x00000004
-#define	BEAM_f_intensity			0x00000008
-
-
-/***************************************************************************
- * Profile BitFlags
-****************************************************************************/
-/* ZEROTH 32 BITS ------------------------------------------------------- */
-#define PROF_ui_status  		0x00000001
-#define PROF_ui_numDepths		0x00000002	/* Number of depths in profile        */
-#define PROF_ui_timeOffset		0x00000004	/* Time offset  wrt. header           */
-#define PROF_ui_vesselLatOffset		0x00000008	/* Latitude offset wrt. header        */
-#define PROF_ui_vesselLongOffset	0x00000010	/* Longitude offset wrt. header       */
-#define PROF_ui_vesselHeading		0x00000020	/* Heading (100 nRadians)             */
-#define PROF_si_vesselHeave		0x00000040	/* Heave (mm)                   */
-#define PROF_si_vesselPitch		0x00000080	/* Vessel pitch (100 nRadians)        */
-#define PROF_si_vesselRoll		0x00000100	/* Vessel roll (100 nRadians)         */
-#define PROF_si_tide			0x00000200	/* Tide (mm)                          */
-#define PROF_ui_vesselVelocity		0x00000400	/* Vessel Velocity (mm/s)             */
-
-/* FIRST 32 BITS ------------------------------------------------------- */
-#define PROF_uc_power			0x00000001
-#define PROF_uc_TVG			0x00000002
-#define PROF_uc_attenuation	 	0x00000004
-#define PROF_uc_edflag			0x00000008
-#define PROF_ui_soundVelocity 		0x00000010	/* mm/s */
-#define PROF_ui_lengthImageDataField	0x00000020
-#define PROF_ui_pingNo 			0x00000040
-#define PROF_uc_mode			0x00000080
-#define PROF_uc_Q_factor		0x00000100
-#define PROF_uc_pulseLength		0x00000200
-#define PROF_uc_unassigned		0x00000400
-#define PROF_us_td_sound_speed		0x00000800
-#define PROF_us_samp_rate		0x00001000
-#define PROF_uc_z_res_cm		0x00002000
-#define PROF_uc_xy_res_cm		0x00004000
-
-/* SECOND 32 BITS ------------------------------------------------------- */
-/* extra from runtime telegram */
-#define PROF_uc_ssp_source		0x00000001
-#define PROF_uc_filter_ID		0x00000002
-#define PROF_us_absorp_coeff		0x00000004
-#define PROF_us_tx_pulse_len		0x00000008
-#define PROF_us_tx_beam_width		0x00000010
-#define PROF_us_max_swath_width		0x00000020
-#define PROF_uc_tx_power_reduction	0x00000040
-#define PROF_uc_rx_beam_width		0x00000080
-#define PROF_uc_rx_bandwidth		0x00000100
-#define PROF_uc_rx_gain_reduction	0x00000200
-#define PROF_uc_tvg_crossover		0x00000400
-#define PROF_uc_beam_spacing		0x00000800
-#define PROF_uc_coverage_sector		0x00001000
-#define PROF_uc_yaw_stab_mode		0x00002000
-
-
-/* THIRD 32 BITS ------------------------------------------------------- */
-#define PROF_ss_longperiod_heaveCorrection 	0x00000100	/* was 32 not anymore */
-#define PROF_ss_dynamic_draftCorrection 	0x00000200
-#define PROF_ss_deepdraftoffset_in_metres	0x00000400
-#define PROF_ss_draft_at_Tx			0x00000800
-#define PROF_ss_alternateRoll 			0x00001000
-#define PROF_ss_alternatePitch 			0x00002000
-#define PROF_ss_alternateHeave 			0x00004000
-#define PROF_us_alternateHeading 		0x00008000
-#define PROF_us_standaloneHeading 		0x00010000
-#define PROF_ss_RTK_at_RP 			0x00020000
-#define PROF_ss_Lowpass_RTK_at_RP 		0x00040000
-#define PROF_ss_WLZ 				0x00080000
-#define PROF_us_samp_rate_SecondHead 		0x00100000
-#define PROF_si_clock_drift_millis 		0x00200000
-#define PROF_ui_watercol_offset 		0x00400000
-#define PROF_ui_watercol_size	 		0x00800000
-#define PROF_us_range_to_normal_incidence	0x01000000
-#define PROF_ui_laser_timestampRef		0x02000000
-#define PROF_ui_tx_sector_offset		0x04000000
-#define PROF_us_num_tx_sectors			0x08000000
-#define PROF_ui_watercol_offset_2nd 		0x10000000
-#define PROF_ui_watercol_size_2nd 		0x20000000
-
-/* FOURTH 32 BITS ------------------------------------------------------- */
-/* extra from HydroSweep MD2 Surf data */
-#define PROF_st_params_PORT		0x00000001	/* presence of port time series */
-#define PROF_st_params_STBD		0x00000002	/* presence of stbd time series */
-
-#define PROF_us_txBeamIndex		0x00000004
-#define PROF_us_txLevel			0x00000008
-#define PROF_ss_txBeamAngle		0x00000010
-#define PROF_us_txPulseLength		0x00000020
-#define PROF_ui_ss_offset		0x00000040
-#define PROF_us_no_skipped_ss		0x00000080
-#define PROF_us_no_acquired_ss		0x00000100
-#define PROF_us_ss_sample_interval	0x00000200
-#define PROF_us_bscatClass		0x00000400
-#define PROF_us_nrActualGainSets	0x00000800
-#define PROF_ss_rxGup			0x00001000
-#define PROF_ss_rxGain			0x00002000
-#define PROF_ss_ar			0x00004000
-#define PROF_us_rxtimeARRAY		0x00008000
-#define PROF_ss_rxgainARRAY		0x00010000
-
-/* FIFTH 32 BITS ------------------------------------------------------- */
-#define PROF_si_transducerDepth		0x00000001
-#define PROF_si_transducerPitch		0x00000002
-#define PROF_si_transducerRoll		0x00000004
-#define PROF_ui_transducerHeading	0x00000008
-#define PROF_si_transducerLatOffset	0x00000010
-#define PROF_si_transducerLongOffset	0x00000020
-#define PROF_ui_transducerSlantRange	0x00000040
-#define PROF_si_transducerAcross 	0x00000080
-#define PROF_si_transducerAlong	 	0x00000100
-#define PROF_ui_transducerBearing 	0x00000200
-
-/* SIXTH 32 BITS ------------------------------------------------------- */
-/* Added for Reson 7K systems */
-#define PROF_ui_sonar_settings_offset	0x00000001
-#define PROF_ui_ping_number		0x00000002
-#define PROF_us_multi_ping_sequence	0x00000004
-#define PROF_ui_num_beams		0x00000008
-#define PROF_uc_layer_compensation_flag 0x00000010
-#define PROF_f_bs_beam_position		0x00000020
-#define PROF_ui_bs_control_flags	0x00000040
-#define PROF_us_bs_num_beams_per_side	0x00000080
-#define PROF_us_bs_current_beam_number  0x00000100
-#define PROF_uc_bs_sample_descriptor	0x00000200
-#define PROF_ui_snippet_sample_descriptor 0x00000400
diff --git a/src/mbio/mbf_sb2100rw.h b/src/mbio/mbf_sb2100rw.h
deleted file mode 100644
index 3fc6f1a..0000000
--- a/src/mbio/mbf_sb2100rw.h
+++ /dev/null
@@ -1,235 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	MBF_SB2100RW.h	3/3/94
- *	$Id: mbf_sb2100rw.h 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1994-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbf_sb2100rw.h defines the data structures used by MBIO functions
- * to store multibeam data read from the MBF_SB2100RW format (MBIO id 41).
- *
- * Author:	D. W. Caress
- * Date:	March 3, 1994
- * $Log: mbf_sb2100rw.h,v $
- * Revision 5.2  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.1  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.0  2000/12/01 22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.10  2000/09/30  06:34:20  caress
- * Snapshot for Dale.
- *
- * Revision 4.9  1998/10/05  17:46:15  caress
- * MB-System version 4.6beta
- *
- * Revision 4.8  1997/04/21  17:02:07  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.7  1995/06/07  20:41:47  caress
- * Fixed some typos.
- *
- * Revision 4.7  1995/06/07  20:41:47  caress
- * Fixed some typos.
- *
- * Revision 4.6  1995/05/08  21:26:28  caress
- * Made changes consistent with new i/o spec for SB2100 data.
- *
- * Revision 4.5  1995/02/14  22:01:39  caress
- * Version 4.2
- *
- * Revision 4.4  1994/10/21  12:20:01  caress
- * Release V4.0
- *
- * Revision 4.3  1994/06/21  22:54:21  caress
- * Added #ifdef statements to handle byte swapping.
- *
- * Revision 4.2  1994/04/09  15:49:21  caress
- * Altered to fit latest iteration of SeaBeam 2100 vendor format.
- *
- * Revision 4.1  1994/03/25  14:02:38  caress
- * Made changes in accordance with latest iteration of
- * SeaBeam 2100 vendor format.
- *
- * Revision 4.0  1994/03/06  00:01:56  caress
- * First cut at version 4.0
- *
- * Revision 4.0  1994/03/06  00:01:56  caress
- * First cut at version 4.0
- *
- * Revision 4.0  1994/03/05  02:12:07  caress
- * First cut for SeaBeam 2100 i/o.
- *
- *
- */
-/*
- * Notes on the MBF_SB2100RW data format:
- *   1. SeaBeam 1000/2100 multibeam systems output raw data in an
- *      ascii format.  The data consists of a number of different
- *      multi-line ascii records.
- *   2. The 2100/2100 systems output up to 151 beams of bathymetry
- *      and 2000 pixels of sidescan measurements, along with a plethora
- *      of other information.
- *   3. The records all include navigation and time stamp information.
- *      The record types are:
- *        PR:  sonar parameter record (roll bias, pitch bias, sound velocity profile)
- *        TR:  sonar text record (comments)
- *        SB:  sub-bottom data record (undefined as yet)
- *        DR:  bathymetry data record (bathymetry and per-beam amplitudes)
- *        SS:  side scan data record
- *   4. A single ping usually results in both DR and SS records.  The PR record
- *      occurs every 30 minutes or when the sound velocity profile is changed.
- *   5. The kind value in the mbsys_sb2k_struct indicates whether the
- *      mbsys_sb2k_data_struct structure holds data from a ping or
- *      data from some other record:
- *        kind = 1 : data from a ping
- *                   (DR + SS)
- *        kind = 2 : comment (TR)
- *        kind = 8 : sonar parameter (PR)
- *   6. The data structure defined below includes all of the values
- *      which are passed in SeaBeam 1000/2100 records.
- */
-
-/* maximum number of depth-velocity pairs */
-#define MBF_SB2100RW_MAXVEL 30
-
-/* maximum line length in characters */
-#define MBF_SB2100RW_MAXLINE 1944
-
-/* maximum number of formed beams for SeaBeam 1000/2100 */
-#define MBF_SB2100RW_BEAMS 151
-
-/* maximum number of sidescan pixels for SeaBeam 1000/2100 */
-#define MBF_SB2100RW_PIXELS 2000
-
-/* maximum value of beam amplitudes for SeaBeam 1000/2100 */
-#define MBF_SB2100RW_AMP_MAX 999
-
-/* maximum value of sidescan pixels for SeaBeam 1000/2100 */
-#define MBF_SB2100RW_SS_MAX 65535
-
-/* center beam for SeaBeam 1000/2100 */
-#define MBF_SB2100RW_CENTER_BEAM 75
-
-/* center pixel for SeaBeam 1000/2100 */
-#define MBF_SB2100RW_CENTER_PIXEL 1000
-
-/* define id's for the different types of raw Hydrosweep records */
-#define	MBF_SB2100RW_RECORDS	6
-#define	MBF_SB2100RW_NONE	0
-#define	MBF_SB2100RW_RAW_LINE	1
-#define	MBF_SB2100RW_PR		2
-#define	MBF_SB2100RW_TR		3
-#define	MBF_SB2100RW_DR		4
-#define	MBF_SB2100RW_SS		5
-char *mbf_sb2100rw_labels[] = {
-	"NONE    ", "RAW_LINE", "SB2100PR",
-	"SB2100TR", "SB2100DR", "SB2100SS"};
-
-struct mbf_sb2100rw_struct
-	{
-	/* type of data record */
-	int	kind;
-
-	/* time stamp (all records ) */
-	int	year;
-	int	jday;
-	int	hour;
-	int	minute;
-	int	msec;			/* msec */
-
-	/* sonar parameters (PR) */
-	int	roll_bias_port;			/* 0.01 deg */
-	int	roll_bias_starboard;		/* 0.01 deg */
-	int	pitch_bias;			/* 0.01 deg */
-	int	ship_draft;			/* 0.01 m */
-	int	num_svp;
-	int	vdepth[MBF_SB2100RW_MAXVEL];	/* 0.01 m */
-	int	velocity[MBF_SB2100RW_MAXVEL];	/* 0.01 m/sec */
-
-	/* DR and SS header info */
-	double	longitude;
-	double	latitude;
-	int	speed;			/* 0.001 m/sec */
-	int	heave; 			/* 0.001 m; + up */
-	char	range_scale; 		/* D = m; I = 0.1 m; S = 0.01 m */
-	int	surface_sound_velocity;	/* 0.01 m/sec */
-	char	ssv_source;		/* V=Velocimeter, M=Manual,
-						T=Temperature */
-	char	depth_gate_mode;	/* A=Auto, M=Manual */
-
-	/* DR header info */
-	int	num_beams;		/* number of formed beams recorded */
-	char	svp_corr_beams;		/* 0=None; A=True Xtrack
-						and Apparent Depth;
-						T=True Xtrack and True Depth */
-	char	spare_dr[2];
-	int	num_algorithms;		/* If 1 then only "best" algorithm
-						recorded, else multiple
-						algorithm results recorded */
-	char	algorithm_order[4];	/* blank if num_algorithms=1;
-						W=WMT and B=BDI */
-
-	/* SS header info */
-	int	num_pixels;		/* number of sidescan pixels recorded */
-	char	svp_corr_ss;		/* 0=off; 1=on */
-	int	ss_data_length;		/* number of bytes of sidescan data */
-	char	pixel_algorithm;	/* pixel intensity algorithm
-						D = logarithm, L = linear */
-	int	num_pixels_12khz;
-	double	pixel_size_12khz;	/* meters */
-	int	num_pixels_36khz;
-	double	pixel_size_36khz;	/* meters */
-	char	spare_ss;
-	char	pixel_size_scale;
-
-	/* transmit parameters and navigation (DR and SS) */
-	char	frequency[2];		/* LL=12kHz; HH=36kHz; number=36kHz
-						until this angle
-						in degrees then 12kHz */
-	int	ping_gain_12khz;			/* dB */
-	int	ping_pulse_width_12khz;			/* msec */
-	int	transmitter_attenuation_12khz;		/* dB */
-	int	pitch_12khz;				/* 0.001 deg */
-	int	roll_12khz;				/* 0.001 deg */
-	int	heading_12khz;				/* 0.001 deg */
-	int	ping_gain_36khz;			/* dB */
-	int	ping_pulse_width_36khz;			/* msec */
-	int	transmitter_attenuation_36khz;		/* dB */
-	int	pitch_36khz;				/* 0.001 deg */
-	int	roll_36khz;				/* 0.001 deg */
-	int	heading_36khz;				/* 0.001 deg */
-
-	/* formed beam data (DR) */
-	char	source[MBF_SB2100RW_BEAMS];		/* B=BDI, W=WMT */
-	int	travel_time[MBF_SB2100RW_BEAMS];	/*  msec */
-	int	angle_across[MBF_SB2100RW_BEAMS];	/* 0.001 deg */
-	int	angle_forward[MBF_SB2100RW_BEAMS];	/* 0.01 deg */
-	int	depth[MBF_SB2100RW_BEAMS];		/* m or cm */
-	int	acrosstrack_beam[MBF_SB2100RW_BEAMS];	/* m or cm */
-	int	alongtrack_beam[MBF_SB2100RW_BEAMS];	/* m or cm */
-	int	amplitude_beam[MBF_SB2100RW_BEAMS];	/* 0.25 dB */
-	int	signal_to_noise[MBF_SB2100RW_BEAMS];	/* dB */
-	int	echo_length[MBF_SB2100RW_BEAMS];	/* samples */
-	char	quality[MBF_SB2100RW_BEAMS];		/* 0=no data,
-							Q=poor quality,
-							blank otherwise */
-
-	/* sidescan data (SS) */
-	int	amplitude_ss[MBF_SB2100RW_PIXELS];	/* range 0-65535 */
-	int	alongtrack_ss[MBF_SB2100RW_PIXELS];	/* m or cm */
-
-	/* comment (TR) */
-	char	comment[MBF_SB2100RW_MAXLINE ];
-};
diff --git a/src/mbio/mbf_sb2120xs.h b/src/mbio/mbf_sb2120xs.h
deleted file mode 100644
index e1d7ef7..0000000
--- a/src/mbio/mbf_sb2120xs.h
+++ /dev/null
@@ -1,309 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbf_sb2120xs.h	3/20/2000
- *	$Id: mbf_sb2120xs.h 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 2000-2015 by
- *    D. W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and D. N. Chayes (dale at lamont.ldgo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY  10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbf_sb2120xs.h defines the data structures used by MBIO functions
- * to store multibeam data read from the MBF_SB2120XSE format (MBIO id 44).
- *
- * Author:	P. A. Cohen
- * Date:	March 20, 2000
- * Author:	D. W. Caress
- * Date:	December 8,  2000
- *
- * $Log: mbf_sb2120xs.h,v $
- * Revision 5.0  2000/12/10 20:24:25  caress
- * Initial revision.
- *
- *
- *
- */
-/*
- * Notes on the MBF_SB2120XS (XSE) data format:
- *   1. SeaBeam Instruments introduced a new format called XSE in 1999.
- *      This "Data Exchange Format" is associated with the new
- *      version of "Hydrostar ONLINE" and represents the intended
- *      data format for both ELAC Bottomchart Compact MK II sonars
- *      (50 kHz and/or 180 kHz) and SeaBeam 2100 series sonars
- *      (12 kHz, 20 kHz, 36 kHz). This follows the purchase of
- *      SeaBeam Instruments by L3 Communications, the parent
- *      company of ELAC Nautik.
- *   2. The XSE format implements a well defined binary format
- *      structure in which each data record is represented as
- *      a "frame" with the following structure:
- *          -------------------------------------------------------
- *          Item     Bytes   Format   Value   Units   Description
- *          -------------------------------------------------------
- *          Start      4     ulong    $HSF            Frame start
- *          Byte Count 4     ulong            bytes   Between byte count
- *                                                      and frame end
- *          Id         4     ulong                    Frame id - see below
- *          Source     4     ulong                    Sensor id
- *          Seconds    4     ulong            seconds Seconds since
- *                                                      1/1/1901 00:00:00
- *          Microsec   4     ulong            usec    Microseconds
- *          ...        ...   ...      ...     ...     Frame specific groups
- *          End        4     ulong    #HSF            Frame end
- *          -------------------------------------------------------
- *      Within each frame are "groups", each with the following structure:
- *          -------------------------------------------------------
- *          Item     Bytes   Format   Value   Units   Description
- *          -------------------------------------------------------
- *          Start      4     ulong    $HSG            Group start
- *          Byte Count 4     ulong            bytes   Between byte count
- *                                                      and group end
- *          Id         4     ulong                    Group id - see below
- *          ...        ...   ...      ...     ...     Group specific data
- *          End        4     ulong    #HSG            Group end
- *          -------------------------------------------------------
- *   2. The valid frames include:
- *        Frame Name    Id   Groups w/ group id's in ()
- *        ---------------------------------------------------------
- *        Navigation    1    General(1), Position(2),
- *                           MotionGroundTruth(4), MotionThroughWater(5),
- *                           CurrentTrack(6), HeaveRollPitch (7), Heave(8),
- *			     Roll(9), Pitch(10), Heading(11), Log(12)
- *        Sidescan      5    General(1), Amplitude(4), Phase(5)
- *        Multibeam     6    General(1), Traveltime(3), Quality(4),
- *                           Amplitude(5), Delay(6), Lateral(7),
- *                           Along(8), Depth(9), Angle(10), Beam(1)
- *        Comment       99   General(1) **MB-System ONLY!!!!**
- *   3. An additional set of SeaBeam 2100 specific frames are defined,
- *      but are not supported in this i/o module. Many other frames
- *      are defined, but not supported here. These are read and passed
- *      through MB-System as MB_DATA_OTHER type data records.
- *   4. SeaBeam Instruments 2120 20KHz sonar systems output both bathymetry
- *      and amplitude information for up to 151 beams per multibeam frame.
- *      Each ping produces a variable number of beams.
- *   5. The XSE format uses asynchronous navigation only; navigation
- *      is not included in the multibeam or sidescan pings.
- *      MB-System interpolates or extrapolates the available
- *      navigation as necessary.
- *
- */
-
-/* maximum number of beams and pixels */
-#define	MBF_SB2120XS_MAXBEAMS	151
-#define	MBF_SB2120XS_MAXPIXELS	2000
-#define	MBF_SB2120XS_MAXSVP	200
-#define MBF_SB2120XS_MAXDRAFT	200
-#define	MBF_SB2120XS_COMMENT_LENGTH	200
-#define	MBF_SB2120XS_BUFFER_SIZE		32000
-#define	MBF_SB2120XS_DESCRIPTION_LENGTH	64
-
-/* frame and group id's */
-#define MBF_SB2120XS_NONE_FRAME		0
-
-#define MBF_SB2120XS_NAV_FRAME			1
-#define MBF_SB2120XS_NAV_GROUP_GEN		1
-#define MBF_SB2120XS_NAV_GROUP_POS		2
-#define MBF_SB2120XS_NAV_GROUP_ACCURACY		3
-#define MBF_SB2120XS_NAV_GROUP_MOTIONGT		4
-#define MBF_SB2120XS_NAV_GROUP_MOTIONTW		5
-#define MBF_SB2120XS_NAV_GROUP_TRACK		6
-#define MBF_SB2120XS_NAV_GROUP_HRP		7
-#define MBF_SB2120XS_NAV_GROUP_HEAVE		8
-#define MBF_SB2120XS_NAV_GROUP_ROLL		9
-#define MBF_SB2120XS_NAV_GROUP_PITCH		10
-#define MBF_SB2120XS_NAV_GROUP_HEADING		11
-#define MBF_SB2120XS_NAV_GROUP_LOG		12
-#define MBF_SB2120XS_NAV_GROUP_GPS		13
-
-#define MBF_SB2120XS_SVP_FRAME			2
-#define MBF_SB2120XS_SVP_GROUP_GEN		1
-#define MBF_SB2120XS_SVP_GROUP_DEPTH		2
-#define MBF_SB2120XS_SVP_GROUP_VELOCITY		3
-#define MBF_SB2120XS_SVP_GROUP_CONDUCTIVITY	4
-#define MBF_SB2120XS_SVP_GROUP_SALINITY		5
-#define MBF_SB2120XS_SVP_GROUP_TEMP		6
-#define MBF_SB2120XS_SVP_GROUP_PRESSURE		7
-#define MBF_SB2120XS_SVP_GROUP_SSV		8
-#define MBF_SB2120XS_SVP_GROUP_POS		9
-
-#define MBF_SB2120XS_TID_FRAME			3
-#define MBF_SB2120XS_TID_GROUP_GEN		1
-#define MBF_SB2120XS_TID_GROUP_POS		2
-#define MBF_SB2120XS_TID_GROUP_TIME		3
-#define MBF_SB2120XS_TID_GROUP_TIDE		4
-
-#define MBF_SB2120XS_SHP_FRAME			4
-#define MBF_SB2120XS_SHP_GROUP_GEN		1
-#define MBF_SB2120XS_SHP_GROUP_ATTITUDE		2
-#define MBF_SB2120XS_SHP_GROUP_POS		3
-#define MBF_SB2120XS_SHP_GROUP_DYNAMICS		4
-#define MBF_SB2120XS_SHP_GROUP_MOTION		5
-#define MBF_SB2120XS_SHP_GROUP_GEOMETRY		6
-#define MBF_SB2120XS_SHP_GROUP_DESCRIPTION	7
-#define MBF_SB2120XS_SHP_GROUP_PARAMETER		8
-
-#define MBF_SB2120XS_SSN_FRAME			5
-#define MBF_SB2120XS_SSN_GROUP_GEN		1
-#define MBF_SB2120XS_SSN_GROUP_AMPVSTT		2
-#define MBF_SB2120XS_SSN_GROUP_PHASEVSTT		3
-#define MBF_SB2120XS_SSN_GROUP_AMPVSLAT		4
-#define MBF_SB2120XS_SSN_GROUP_PHASEVSLAT		5
-
-#define MBF_SB2120XS_MBM_FRAME			6
-#define MBF_SB2120XS_MBM_GROUP_GEN		1
-#define MBF_SB2120XS_MBM_GROUP_BEAM		2
-#define MBF_SB2120XS_MBM_GROUP_TT			3
-#define MBF_SB2120XS_MBM_GROUP_QUALITY		4
-#define MBF_SB2120XS_MBM_GROUP_AMP		5
-#define MBF_SB2120XS_MBM_GROUP_DELAY		6
-#define MBF_SB2120XS_MBM_GROUP_LATERAL		7
-#define MBF_SB2120XS_MBM_GROUP_ALONG		8
-#define MBF_SB2120XS_MBM_GROUP_DEPTH		9
-#define MBF_SB2120XS_MBM_GROUP_ANGLE		10
-#define MBF_SB2120XS_MBM_GROUP_HEAVE		11
-#define MBF_SB2120XS_MBM_GROUP_ROLL		12
-#define MBF_SB2120XS_MBM_GROUP_PITCH		13
-#define MBF_SB2120XS_MBM_GROUP_GATES		14
-#define MBF_SB2120XS_MBM_GROUP_NOISE		15
-#define MBF_SB2120XS_MBM_GROUP_LENGTH		16
-#define MBF_SB2120XS_MBM_GROUP_HITS		17
-
-#define MBF_SB2120XS_COM_FRAME			99
-#define MBF_SB2120XS_COM_GROUP_GEN		1
-
-struct mbf_sb2120xs_beam_struct
-	{
-	double	    tt;
-	double	    delay;
-	double	    lateral;
-	double	    along;
-	double	    depth;
-	double	    angle;
-	double	    heave;
-	double	    roll;
-	double	    pitch;
-	short	    beam;
-	char	    quality;
-	short	    amplitude;
-	};
-
-struct mbf_sb2120xs_struct
-	{
-	/* type of data record */
-	int	kind;			/* Survey, nav, Comment */
-
-	/* parameter (ship frames) */
-	int	par_source;		/* sensor id */
-	unsigned int	par_sec;	/* sec since 1/1/1901 00:00 */
-	unsigned int	par_usec;	/* microseconds */
-	float	par_roll_bias;		/* radians */
-	float	par_pitch_bias;		/* radians */
-	float	par_heading_bias;	/* radians */
-	float	par_time_delay;		/* nav time lag, seconds */
-	float	par_trans_x_port;	/* port transducer x position, meters */
-	float	par_trans_y_port;	/* port transducer y position, meters */
-	float	par_trans_z_port;	/* port transducer z position, meters */
-	float	par_trans_x_stbd;	/* starboard transducer x position, meters */
-	float	par_trans_y_stbd;	/* starboard transducer y position, meters */
-	float	par_trans_z_stbd;	/* starboard transducer z position, meters */
-	float	par_trans_err_port;	/* port transducer rotation in roll direction, radians */
-	float	par_trans_err_stbd;	/* starboard transducer rotation in roll direction, radians */
-	float	par_nav_x;		/* navigation antenna x position, meters */
-	float	par_nav_y;		/* navigation antenna y position, meters */
-	float	par_nav_z;		/* navigation antenna z position, meters */
-	float	par_hrp_x;		/* motion sensor x position, meters */
-	float	par_hrp_y;		/* motion sensor y position, meters */
-	float	par_hrp_z;		/* motion sensor z position, meters */
-
-	/* svp (sound velocity frames) */
-	int	svp_source;		/* sensor id */
-	unsigned int	svp_sec;	/* sec since 1/1/1901 00:00 */
-	unsigned int	svp_usec;	/* microseconds */
-	int	svp_nsvp;		/* number of depth values */
-	int	svp_nctd;		/* number of ctd values */
-	double	svp_depth[MBF_SB2120XS_MAXSVP];		/* m */
-	double	svp_velocity[MBF_SB2120XS_MAXSVP];	/* m/s */
-	double	svp_conductivity[MBF_SB2120XS_MAXSVP];	/* mmho/cm */
-	double	svp_salinity[MBF_SB2120XS_MAXSVP];	/* o/oo */
-	double	svp_temperature[MBF_SB2120XS_MAXSVP];	/* degree celcius */
-	double	svp_pressure[MBF_SB2120XS_MAXSVP];	/* bar */
-	double	svp_ssv;		/* m/s */
-
-	/* position (navigation frames) */
-	int	nav_source;		/* sensor id */
-	unsigned int	nav_sec;	/* sec since 1/1/1901 00:00 */
-	unsigned int	nav_usec;	/* microseconds */
-	int	nav_quality;
-	int	nav_status;
-	int	nav_description_len;
-	char	nav_description[MBF_SB2120XS_DESCRIPTION_LENGTH];
-	double	nav_x;			/* eastings (m) or
-					    longitude (radians) */
-	double	nav_y;			/* northings (m) or
-					    latitude (radians) */
-	double	nav_z;			/* height (m) or
-					    ellipsoidal height (m) */
-	double	nav_speed_ground;	/* m/s */
-	double	nav_course_ground;	/* radians */
-	double	nav_speed_water;	/* m/s */
-	double	nav_course_water;	/* radians */
-
-	/* survey depth (multibeam frames) */
-	int	mul_frame;		/* boolean flag - multibeam frame read */
-	int	mul_group_beam;		/* boolean flag - beam group read */
-	int	mul_group_tt;		/* boolean flag - tt group read */
-	int	mul_group_quality;	/* boolean flag - quality group read */
-	int	mul_group_amp;		/* boolean flag - amp group read */
-	int	mul_group_delay;	/* boolean flag - delay group read */
-	int	mul_group_lateral;	/* boolean flag - lateral group read */
-	int	mul_group_along;	/* boolean flag - along group read */
-	int	mul_group_depth;	/* boolean flag - depth group read */
-	int	mul_group_angle;	/* boolean flag - angle group read */
-	int	mul_group_heave;	/* boolean flag - heave group read */
-	int	mul_group_roll;		/* boolean flag - roll group read */
-	int	mul_group_pitch;	/* boolean flag - pitch group read */
-	int	mul_source;		/* sensor id */
-	unsigned int	mul_sec;	/* sec since 1/1/1901 00:00 */
-	unsigned int	mul_usec;	/* microseconds */
-	int	mul_ping;		/* ping number */
-	float	mul_frequency;		/* transducer frequency (Hz) */
-	float	mul_pulse;		/* transmit pulse length (sec) */
-	float	mul_power;		/* transmit power (dB) */
-	float	mul_bandwidth;		/* receive bandwidth (Hz) */
-	float	mul_sample;		/* receive sample interval (sec) */
-	float	mul_swath;		/* swath width (radians) */
-	int	mul_num_beams;		/* number of beams */
-	double	mul_x;			/* longitude in degrees */
-	double	mul_y;			/* latitude in degrees */
-	struct mbf_sb2120xs_beam_struct beams[MBF_SB2120XS_MAXBEAMS];
-
-	/* survey sidescan (sidescan frames) */
-	int	sid_frame;		/* boolean flag - sidescan frame read */
-	int	sid_source;		/* sensor id */
-	unsigned int	sid_sec;	/* sec since 1/1/1901 00:00 */
-	unsigned int	sid_usec;	/* microseconds */
-	int	sid_ping;		/* ping number */
-	float	sid_frequency;		/* transducer frequency (Hz) */
-	float	sid_pulse;		/* transmit pulse length (sec) */
-	float	sid_power;		/* transmit power (dB) */
-	float	sid_bandwidth;		/* receive bandwidth (Hz) */
-	float	sid_sample;		/* receive sample interval (sec) */
-	int	sid_bin_size;		/* bin size in mm */
-	int	sid_offset;		/* lateral offset in mm */
-	int	sid_num_pixels;		/* number of pixels */
-	short	ss[MBF_SB2120XS_MAXPIXELS]; /* sidescan amplitude in dB */
-
-	/* comment */
-	int	com_source;		/* sensor id */
-	unsigned int	com_sec;	/* sec since 1/1/1901 00:00 */
-	unsigned int	com_usec;	/* microseconds */
-	char	comment[MBF_SB2120XS_COMMENT_LENGTH];
-
-	/* unsupported frames */
-	int	rawsize;		/* size of unknown frame in bytes */
-	char	raw[MBF_SB2120XS_BUFFER_SIZE];
-	};
diff --git a/src/mbio/mbf_sbifremr.h b/src/mbio/mbf_sbifremr.h
deleted file mode 100644
index a5e5dc8..0000000
--- a/src/mbio/mbf_sbifremr.h
+++ /dev/null
@@ -1,117 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbf_sbifremr.h	3/29/96
- *	$Id: mbf_sbifremr.h 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1996-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbf_sbifremr.h defines the data structure used by MBIO functions
- * to store multibeam data read from the  MBF_SBIFREMR format (MBIO id 17).
- *
- * Author:	D. W. Caress
- * Date:	March 29, 1996
- * Location:	152 39.061W; 34 09.150S on R/V Ewing
- *
- * $Log: mbf_sbifremr.h,v $
- * Revision 5.2  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.1  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.0  2000/12/01 22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.2  2000/09/30  06:34:20  caress
- * Snapshot for Dale.
- *
- * Revision 4.1  1998/10/05  18:32:27  caress
- * MB-System version 4.6beta
- *
- * Revision 4.0  1996/04/22  10:59:51  caress
- * Initial version.
- *
- * Revision 4.0  1996/04/22  10:59:51  caress
- * Initial version.
- *
- *
- */
-/*
- * Notes on the MBF_SBIFREMR data format:
- *   1. This data format is used to store 16 beam Sea Beam bathymetry
- *      data.  This format was created and used by IFREMER in Brest,
- *      France. IFREMER archives SeaBeam "Classic" data from the
- *      R/V Jean Charcot and the R/V Sonne (and probably other
- *      vessels) in this format.
- *   2. The data consist of ASCII text. The data is stored in a
- *      sounding oriented rather than swath oriented fashion, with
- *      a separate record for each beam value.
- *   3. Each 108 character line contains the beam position, depth,
- *      ping number, beam number, sounding number, and ping time.
- *      The ship's position can be obtained as that of the
- *      the center beam (beam 10 out of beams 1-19) and the heading
- *      can be calculated from the orientation of the starboard
- *      and port outer beams. When the center beam and its location
- *      are missing, the ping is ignored. Thus, DATA CAN BE LOST
- *      when this format is read with MB-System programs.
- *   4. Comments can be embedded in the data as lines beginning
- *      with "##".
- *   5. The depth values are stored as negative numbers (topography
- *      rather than bathymetry). In order to accomodate flagging
- *      of suspect depths, the flagged depths are stored as
- *      positive numbers. This does not affect the internal
- *      MB-System convention of flagging depths with negative
- *      numbers.
- *   6. Information on this format was obtained from IFREMER.
- *
- * The kind value in the mbf_sbifremr_struct indicates whether the
- * mbf_sbifremr_data_struct structure holds data (kind = 1) or an
- * ascii comment record (kind = 2).
- */
-
-/* maximum comment length in characters */
-#define MBF_SBIFREMR_MAXLINE 200
-
-/* number of beams in format */
-#define MBF_SBIFREMR_NUM_BEAMS	19
-
-/* angle spacing for SeaBeam Classic */
-#define MBF_SBIFREMR_ANGLE_SPACING	2.62
-
-struct mbf_sbifremr_struct
-	{
-	int	kind;		/* comment flag (comment if != 1) */
-	short	year;		/* year (4 digits) */
-	short	day;		/* julian day (1-366) */
-	short	min;		/* minutes from beginning of day (0-1439) */
-	short	sec;		/* seconds from beginning of minute (0-59) */
-	short	lat2u;		/* number of minutes north of 90S */
-	short	lat2b;		/* fraction of minute times 10000 */
-	short	lon2u;		/* minutes east of prime meridian */
-	short	lon2b;		/* fraction of minute times 10000 */
-	unsigned short	sbhdg;	/* SeaBeam gyro heading
-					0 = 0 degrees
-					1 = 0.0055 degrees
-					16384 = 90 degrees
-					65535 = 359.9945 degrees
-					0 = 360 degrees */
-	short	deph[MBF_SBIFREMR_NUM_BEAMS];
-				/* 16 depths from Sea Beam in meters
-					assuming 1500 m/s water velocity */
-	short	dist[MBF_SBIFREMR_NUM_BEAMS];
-				/* 16 cross track distances in meters from port
-					(negative) to starboard (positive) */
-	double	lon[MBF_SBIFREMR_NUM_BEAMS];
-				/* longitudes of beam values */
-	double	lat[MBF_SBIFREMR_NUM_BEAMS];
-				/* latitudes of beam values */
-	char	comment[MBF_SBIFREMR_MAXLINE];
-	};
diff --git a/src/mbio/mbf_sbsiocen.h b/src/mbio/mbf_sbsiocen.h
deleted file mode 100644
index 77a5e72..0000000
--- a/src/mbio/mbf_sbsiocen.h
+++ /dev/null
@@ -1,122 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbf_sbsiocen.h	1/20/93
- *	$Id: mbf_sbsiocen.h 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1993-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbf_sbsiocen.h defines the data structure used by MBIO functions
- * to store multibeam data read from the  MBF_SBSIOCEN format (MBIO id 12).
- *
- * Author:	D. W. Caress
- * Date:	January 20, 1993
- * $Log: mbf_sbsiocen.h,v $
- * Revision 5.2  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.1  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.0  2000/12/01 22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.4  2000/09/30  06:34:20  caress
- * Snapshot for Dale.
- *
- * Revision 4.3  1998/10/05  18:32:27  caress
- * MB-System version 4.6beta
- *
- * Revision 4.2  1997/04/21  17:02:07  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.2  1997/04/21  17:02:07  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.1  1994/10/21  12:20:01  caress
- * Release V4.0
- *
- * Revision 4.1  1994/10/21  12:20:01  caress
- * Release V4.0
- *
- * Revision 4.0  1994/03/06  00:01:56  caress
- * First cut at version 4.0
- *
- * Revision 4.2  1994/03/03  03:39:43  caress
- * Fixed copyright message.
- *
- * Revision 4.1  1994/02/17  21:19:08  caress
- * Updated associated MBIO format id in comments.
- *
- * Revision 4.0  1994/02/17  20:59:54  caress
- * First cut at new version. No changes.
- *
- * Revision 3.0  1993/05/14  22:52:50  sohara
- * initial version
- *
- */
-/*
- * Notes on the MBF_SBSIOCEN data format:
- *   1. This data format is used to store 16 beam Sea Beam bathymetry
- *      data.  This format was created and used by the Scripps
- *      Institution of Oceanography; most data files in this format
- *      consist of Sea Beam data collected on the R/V Thomas Washington.
- *   2. The data consist of 112 byte records including a 4-character
- *      string, 2-byte integers, and 4-byte integers.
- *   3. The 16 depth values are stored centered in 19 value arrays.  The
- *      center beam is in word 10 of the depth and distance arrays.
- *   4. Comments can be embedded in the data as 112 byte ascii strings,
- *	where the first two characters must always be "##" to set
- *      the comment flag.
- *   5. Information on this format was obtained from the Geological
- *      Data Center at the Scripps Institution of Oceanography
- *
- * The kind value in the mbf_sbsiocen_struct indicates whether the
- * mbf_sbsiocen_data_struct structure holds data (kind = 1) or an
- * ascii comment record (kind = 2).
- *
- * The mbf_sbsiocen_data_struct structure is a direct representation of
- * the binary data structure used in the MBF_SBSIOCEN format.
- */
-
-struct mbf_sbsiocen_data_struct
-	{
-	char	flag[4];	/* comment flag (## flags comment record) */
-	short	year;		/* year (4 digits) */
-	short	day;		/* julian day (1-366) */
-	short	min;		/* minutes from beginning of day (0-1439) */
-	short	sec;		/* seconds from beginning of minute (0-59) */
-	int	major;		/* navigation error ellipse major axis */
-	int	minor;		/* navigation error ellipse minor axis */
-	short	axis;		/* navigation error ellipse major axis angle */
-	short	lat2u;		/* number of minutes north of 90S */
-	short	lat2b;		/* fraction of minute times 10000 */
-	short	lon2u;		/* minutes east of prime meridian */
-	short	lon2b;		/* fraction of minute times 10000 */
-	unsigned short	sbtim;	/* Sea Beam computer clock time in 10ths of
-					seconds from start of hour (0-3600) */
-	unsigned short	sbhdg;	/* Sea Beam gyro heading
-					0 = 0 degrees
-					1 = 0.0055 degrees
-					16384 = 90 degrees
-					65535 = 359.9945 degrees
-					0 = 360 degrees */
-	short	deph[19];	/* 16 depths from Sea Beam in meters
-					assuming 1500 m/s water velocity */
-	short	dist[19];	/* 16 cross track distances in meters from port
-					(negative) to starboard (positive) */
-	short	spare;		/* unused */
-	};
-
-struct mbf_sbsiocen_struct
-	{
-	int	kind;
-	struct mbf_sbsiocen_data_struct data;
-	};
diff --git a/src/mbio/mbf_sbsiolsi.h b/src/mbio/mbf_sbsiolsi.h
deleted file mode 100644
index 44d929f..0000000
--- a/src/mbio/mbf_sbsiolsi.h
+++ /dev/null
@@ -1,121 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbf_sbsiolsi.h	1/20/93
- *	$Id: mbf_sbsiolsi.h 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1993-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbf_sbsiolsi.h defines the data structure used by MBIO functions
- * to store multibeam data read from the  MBF_SBSIOLSI format (MBIO id 13).
- *
- * Author:	D. W. Caress
- * Date:	January 20, 1993
- * $Log: mbf_sbsiolsi.h,v $
- * Revision 5.2  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.1  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.0  2000/12/01 22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.4  2000/09/30  06:34:20  caress
- * Snapshot for Dale.
- *
- * Revision 4.3  1998/10/05  18:32:27  caress
- * MB-System version 4.6beta
- *
- * Revision 4.2  1997/04/21  17:02:07  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.2  1997/04/21  17:02:07  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.1  1994/10/21  12:20:01  caress
- * Release V4.0
- *
- * Revision 4.1  1994/10/21  12:20:01  caress
- * Release V4.0
- *
- * Revision 4.0  1994/03/06  00:01:56  caress
- * First cut at version 4.0
- *
- * Revision 4.2  1994/03/03  03:39:43  caress
- * Fixed copyright message.
- *
- * Revision 4.1  1994/02/17  21:19:08  caress
- * Updated associated MBIO format id in comments.
- *
- * Revision 4.0  1994/02/17  20:59:54  caress
- * First cut at new version. No changes.
- *
- * Revision 3.0  1993/05/14  22:53:31  sohara
- * initial version
- *
- */
-/*
- * Notes on the MBF_SBSIOLSI data format:
- *   1. This data format is used to store 16 beam Sea Beam bathymetry
- *      data.  This format was created and used by the Scripps
- *      Institution of Oceanography; most data files in this format
- *      consist of Sea Beam data collected on the R/V Thomas Washington.
- *   2. This data format is no longer in use and is supported only to
- *      provide a means of dealing with a few old data tapes.
- *   3. The data consist of 100 byte records consisting entirely of
- *      2-byte integers.
- *   4. The 16 depth values are stored centered in 19 value arrays.  The
- *      center beam is in word 10 of the depth and distance arrays.
- *   5. Comments can be embedded in the data as 100 byte ascii strings,
- *	where the first two characters must always be "cc" so that the
- *      first depth value is 25443.
- *   6. Information on this format was obtained by deciphering some
- *      old data tapes; there could be more to know about this format,
- *      but its probably not worth worrying about.
- *
- * The kind value in the mbf_sbsiolsi_struct indicates whether the
- * mbf_sbsiolsi_data_struct structure holds data (kind = 1) or an
- * ascii comment record (kind = 2).
- *
- * The mbf_sbsiolsi_data_struct structure is a direct representation
- * of the binary data structure used in the MBF_SBSIOLSI format.
- */
-
-struct mbf_sbsiolsi_data_struct
-	{
-	short	deph[19];	/* 16 depths from Sea Beam in meters
-					assuming 1500 m/s water velocity */
-	short	dist[19];	/* 16 cross track distances in meters from port
-					(negative) to starboard (positive) */
-	short	axis;		/* navigation error ellipse major axis angle */
-	short	major;		/* navigation error ellipse major axis */
-	short	minor;		/* navigation error ellipse minor axis */
-	unsigned short	sbhdg;	/* Sea Beam gyro heading
-					0 = 0 degrees
-					1 = 0.0055 degrees
-					16384 = 90 degrees
-					65535 = 359.9945 degrees
-					0 = 360 degrees */
-	short	lat2b;		/* fraction of minute times 10000 */
-	short	lat2u;		/* number of minutes north of 90S */
-	short	lon2b;		/* fraction of minute times 10000 */
-	short	lon2u;		/* minutes east of prime meridian */
-	short	sec;		/* seconds from beginning of minute (0-59) */
-	short	min;		/* minutes from beginning of day (0-1439) */
-	short	day;		/* julian day (1-366) */
-	short	year;		/* year (4 digits) */
-	};
-
-struct mbf_sbsiolsi_struct
-	{
-	int	kind;
-	struct mbf_sbsiolsi_data_struct data;
-	};
diff --git a/src/mbio/mbf_sbsiomrg.h b/src/mbio/mbf_sbsiomrg.h
deleted file mode 100644
index 13d91e0..0000000
--- a/src/mbio/mbf_sbsiomrg.h
+++ /dev/null
@@ -1,132 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbf_sbsiomrg.h	1/20/93
- *	$Id: mbf_sbsiomrg.h 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1993-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbf_sbsiomrg.h defines the data structure used by MBIO functions
- * to store multibeam data read from the  MBF_SBSIOMRG format (MBIO id 11).
- *
- * Author:	D. W. Caress
- * Date:	January 20, 1993
- * $Log: mbf_sbsiomrg.h,v $
- * Revision 5.3  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.2  2002/10/15 18:34:58  caress
- * Release 5.0.beta25
- *
- * Revision 5.1  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.0  2000/12/01 22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.4  2000/09/30  06:34:20  caress
- * Snapshot for Dale.
- *
- * Revision 4.3  1998/10/05  18:32:27  caress
- * MB-System version 4.6beta
- *
- * Revision 4.2  1997/04/21  17:02:07  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.2  1997/04/21  17:02:07  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.1  1994/10/21  12:20:01  caress
- * Release V4.0
- *
- * Revision 4.1  1994/10/21  12:20:01  caress
- * Release V4.0
- *
- * Revision 4.0  1994/03/06  00:01:56  caress
- * First cut at version 4.0
- *
- * Revision 4.2  1994/03/03  03:39:43  caress
- * Fixed copyright message.
- *
- * Revision 4.1  1994/02/17  21:19:08  caress
- * Updated associated MBIO format id in comments.
- *
- * Revision 4.0  1994/02/17  20:59:54  caress
- * First cut at new version. No changes.
- *
- * Revision 3.0  1993/05/14  22:53:48  sohara
- * initial version
- *
- */
-/*
- * Notes on the MBF_SBSIOMRG data format:
- *   1. This data format is used to store 16 beam Sea Beam bathymetry
- *      data.  This format was created and used by the Scripps
- *      Institution of Oceanography; most data files in this format
- *      consist of Sea Beam data collected on the R/V Thomas Washington.
- *   2. The data consist of 100 byte records with 50 2-byte signed
- *      integer words.
- *   3. The 16 depth values are stored uncentered (the depth values
- *      are centered in most formats).
- *   4. Comments can be embedded in the data as 100 byte ascii strings,
- *	where the first two characters must always be "##" so that
- *      the year value is greater than 7000.
- *   5. Data files created in the early 1980's on an IBM 1800 may have
- *      padding records consisting entirely of zeros; these may be
- *      recognized by the year being 0 and should be ignored.
- *   6. Information on this format was obtained from the Geological
- *      Data Center at the Scripps Institution of Oceanography
- *
- * The kind value in the mbf_sbsiomrg_struct indicates whether the
- * mbf_sbsiomrg_data_struct structure holds data (kind = 1) or an
- * ascii comment record (kind = 2).
- *
- * The mbf_sbsiomrg_data_struct structure is a direct representation
- * of the binary data structure used in the MBF_SBSIOMRG format.
- */
-
- /* size of data records */
-#define MBF_SBSIOMRG_RECORD_SIZE	100
-
-/* number of beams in raw and processed pings */
-#define	MB_BEAMS_RAW_SBSIOMRG	16
-#define	MB_BEAMS_PROC_SBSIOMRG	19
-
-struct mbf_sbsiomrg_data_struct
-	{
-	short	year;		/* year (4 digits) */
-	short	day;		/* julian day (1-366) */
-	short	min;		/* minutes from beginning of day (0-1439) */
-	short	sec;		/* seconds from beginning of minute (0-59) */
-	short	lon2u;		/* minutes east of prime meridian */
-	short	lon2b;		/* fraction of minute times 10000 */
-	short	lat2u;		/* number of minutes north of 90S */
-	short	lat2b;		/* fraction of minute times 10000 */
-	short	spare1[3];	/* unused */
-	unsigned short	sbtim;	/* Sea Beam computer clock time in 10ths of
-					seconds from start of hour (0-3600) */
-	unsigned short	sbhdg;	/* Sea Beam gyro heading
-					0 = 0 degrees
-					1 = 0.0055 degrees
-					16384 = 90 degrees
-					65535 = 359.9945 degrees
-					0 = 360 degrees */
-	short	deph[16];	/* 16 depths from Sea Beam in meters
-					assuming 1500 m/s water velocity */
-	short	dist[16];	/* 16 cross track distances in meters from port
-					(negative) to starboard (positive) */
-	short	spare2[5];	/* unused */
-	};
-
-struct mbf_sbsiomrg_struct
-	{
-	int	kind;
-	struct mbf_sbsiomrg_data_struct data;
-	};
diff --git a/src/mbio/mbf_sbsioswb.h b/src/mbio/mbf_sbsioswb.h
deleted file mode 100644
index 08db784..0000000
--- a/src/mbio/mbf_sbsioswb.h
+++ /dev/null
@@ -1,122 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbf_sbsioswb.h	9/18/94
- *	$Id: mbf_sbsioswb.h 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1994-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbf_sbsioswb.h defines the data structure used by MBIO functions
- * to store multibeam data read from the  MBF_SBSIOSWB format (MBIO id 16).
- *
- * Author:	D. W. Caress
- * Date:	January 20, 1993
- * $Log: mbf_sbsioswb.h,v $
- * Revision 5.3  2009/03/08 09:21:00  caress
- * Fixed problem reading and writing format 16 (MBF_SBSIOSWB) data on little endian systems.
- *
- * Revision 5.2  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.1  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.0  2000/12/01 22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.3  2000/09/30  06:34:20  caress
- * Snapshot for Dale.
- *
- * Revision 4.2  1998/10/05  18:32:27  caress
- * MB-System version 4.6beta
- *
- * Revision 4.1  1997/04/21  17:02:07  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.1  1997/04/21  17:02:07  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.0  1994/10/21  12:35:07  caress
- * Release V4.0
- *
- * Revision 4.0  1994/10/21  12:35:07  caress
- * Release V4.0
- *
- * Revision 1.1  1994/10/21  12:20:01  caress
- * Initial revision
- *
- *
- */
-/*
- * Notes on the MBF_SBSIOSWB data format:
- *   1. This data format is used to store 16 beam Sea Beam bathymetry
- *      data.  This format was created and used by the Scripps
- *      Institution of Oceanography; most data files in this format
- *      consist of Sea Beam data collected on the R/V Thomas Washington.
- *      This format is one of the "swathbathy" formats created by
- *      Jim Charters of Scripps.
- *   2. The data records consist of three logical records: the header
- *      record, the sensor specific record and the data record.
- *   3. The header record consists of 36 bytes, including the sizes
- *      of the following sensor specific and data records.
- *   4. The sensor specific records are 4 bytes long.
- *   5. The data record lengths are variable.
- *   6. Comments are included in text records, which are of variable
- *      length.
- *   7. Information on this format was obtained from the Geological
- *      Data Center and the Shipboard Computer Group at the Scripps
- *      Institution of Oceanography
- *
- * The kind value in the mbf_sbsioswb_struct indicates whether the
- * mbf_sbsioswb_data_struct structure holds data (kind = 1) or an
- * ascii comment record (kind = 2).
- *
- * The mbf_sbsioswb_data_struct structure is a direct representation
- * of the binary data structure used in the MBF_SBSIOSWB format.
- */
-
-/* number of beams in pings */
-#define	MB_BEAMS_SBSIOSWB	19
-
-/* size in bytes of header records */
-#define	MB_SBSIOSWB_HEADER_SIZE	36
-
-struct mbf_sbsioswb_bath_struct
-	{
-	short	bath;
-	short	bath_acrosstrack;
-	};
-
-struct mbf_sbsioswb_struct
-	{
-	int	kind;
-	short	year;		/* year (4 digits) */
-	short	day;		/* julian day (1-366) */
-	short	min;		/* minutes from beginning of day (0-1439) */
-	short	sec;		/* seconds from beginning of minute (0-59) */
-	int	lat;		/* 1e-7 degrees from equator */
-	int	lon;		/* 1e-7 degrees from prime meridian */
-	short	heading;	/* heading in 0.1 degrees */
-	short	course;		/* course in 0.1 degrees */
-	short	speed;		/* fore-aft speed in 0.1 knots */
-	short	speed_ps;	/* port-starboard speed in 0.1 knots */
-	short	quality;	/* quality value, 0 good, bigger bad */
-	short	sensor_size;	/* size of sensor specific record in bytes */
-	short	data_size;	/* size of data record in bytes */
-	char	speed_ref[2];	/* speed reference */
-	char	sensor_type[2];	/* sensor type */
-	char	data_type[2];	/* type of data recorded */
-	short	eclipse_time;	/* time of day from eclipse computer */
-	short	eclipse_heading;	/* heading at time of ping */
-	short	beams_bath;	/* number of bathymetry beams */
-	short	scale_factor;	/* scale factor */
-	struct mbf_sbsioswb_bath_struct bath_struct[MB_BEAMS_SBSIOSWB];
-	char	comment[MBSYS_SB_MAXLINE];
-	};
diff --git a/src/mbio/mbf_sburicen.h b/src/mbio/mbf_sburicen.h
deleted file mode 100644
index 0843f6b..0000000
--- a/src/mbio/mbf_sburicen.h
+++ /dev/null
@@ -1,122 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbf_sburicen.h	1/20/93
- *	$Id: mbf_sburicen.h 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1993-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbf_sburicen.h defines the data structure used by MBIO functions
- * to store multibeam data read from the  MBF_SBURICEN format (MBIO id 14).
- *
- * Author:	D. W. Caress
- * Date:	January 20, 1993
- * $Log: mbf_sburicen.h,v $
- * Revision 5.2  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.1  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.0  2000/12/01 22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.4  2000/09/30  06:34:20  caress
- * Snapshot for Dale.
- *
- * Revision 4.3  1998/10/05  18:32:27  caress
- * MB-System version 4.6beta
- *
- * Revision 4.2  1997/04/21  17:02:07  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.2  1997/04/21  17:02:07  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.1  1994/10/21  12:20:01  caress
- * Release V4.0
- *
- * Revision 4.1  1994/10/21  12:20:01  caress
- * Release V4.0
- *
- * Revision 4.0  1994/03/06  00:01:56  caress
- * First cut at version 4.0
- *
- * Revision 4.2  1994/03/03  03:39:43  caress
- * Fixed copyright message.
- *
- * Revision 4.1  1994/02/17  21:19:08  caress
- * Updated associated MBIO format id in comments.
- *
- * Revision 4.0  1994/02/17  20:59:54  caress
- * First cut at new version. No changes.
- *
- * Revision 3.0  1993/05/14  22:54:13  sohara
- * initial version
- *
- */
-/*
- * Notes on the MBF_SBURICEN data format:
- *   1. This data format is used to store 16 beam Sea Beam bathymetry
- *      data.  This format was created and used by the Ocean Mapping
- *      Development Center at the Graduate School of Oceanography of
- *      the University of Rhode Islande; most data files in this format
- *      consist of Sea Beam data collected on the R/V Robert Conrad or
- *      the R/V Atlantis II.
- *   2. The data consist of 102 byte records consisting entirely of
- *      2-byte integers.
- *   3. The 16 depth values are stored centered in 19 value arrays.  The
- *      center beam is in word 10 of the depth and distance arrays.
- *   4. Comments can be embedded in the data as 100 byte ascii strings,
- *	where the first two characters must always be "cc" so that the
- *      first depth value is 25443.
- *   5. Information on this format was obtained from the Geological
- *      Data Center at the Scripps Institution of Oceanography
- *
- * The kind value in the mbf_sburicen_struct indicates whether the
- * mbf_sburicen_data_struct structure holds data (kind = 1) or an
- * ascii comment record (kind = 2).
- *
- * The mbf_sburicen_data_struct structure is a direct representation
- * of the binary data structure used in the MBF_SBURICEN format.
- */
-
-struct mbf_sburicen_data_struct
-	{
-	short	deph[19];	/* 16 depths from Sea Beam in meters
-					assuming 1500 m/s water velocity */
-	short	dist[19];	/* 16 cross track distances in meters from port
-					(negative) to starboard (positive) */
-	short	axis;		/* navigation error ellipse major axis angle */
-	short	major;		/* navigation error ellipse major axis */
-	short	minor;		/* navigation error ellipse minor axis */
-	unsigned short	sbhdg;	/* Sea Beam gyro heading
-					0 = 0 degrees
-					1 = 0.0055 degrees
-					16384 = 90 degrees
-					65535 = 359.9945 degrees
-					0 = 360 degrees */
-	short	lat2b;		/* fraction of minute times 10000 */
-	short	lat2u;		/* number of minutes north of 90S */
-	short	lon2b;		/* fraction of minute times 10000 */
-	short	lon2u;		/* minutes east of prime meridian */
-	short	sec;		/* seconds from beginning of minute (0-59) */
-	short	min;		/* minutes from beginning of day (0-1439) */
-	short	day;		/* julian day (1-366) */
-	short	year;		/* year (4 digits) */
-	unsigned short	sbtim;	/* Sea Beam computer clock time in 10ths of
-					seconds from start of hour (0-3600) */
-	};
-
-struct mbf_sburicen_struct
-	{
-	int	kind;
-	struct mbf_sburicen_data_struct data;
-	};
diff --git a/src/mbio/mbf_xtfr8101.h b/src/mbio/mbf_xtfr8101.h
deleted file mode 100644
index 829ca57..0000000
--- a/src/mbio/mbf_xtfr8101.h
+++ /dev/null
@@ -1,615 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbf_xtfr8101.h	8/24/01
- *	$Id: mbf_xtfr8101.h 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 2001-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbf_xtfr8101.h defines the data structures used by MBIO functions
- * to store multibeam data read from the MBF_XTFR8101 format (MBIO id 83).
- *
- * Author:	D. W. Caress
- * Date:	August 24, 2001
- *
- * $Log: mbf_xtfr8101.h,v $
- * Revision 5.2  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.1  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.0  2001/09/17 23:24:10  caress
- * Added XTF format.
- *
- *
- *
- *
- */
-/*
- * Notes on the MBF_XTFR8101 data format:
- *   1. Reson SeaBat products are high frequency,
- *
- */
-
-/* maximum number of beams and pixels */
-#define	MBF_XTFR8101_MAXBEAMS		240
-#define	MBF_XTFR8101_MAXRAWPIXELS	8192
-#define	MBF_XTFR8101_COMMENT_LENGTH	200
-#define	MBF_XTFR8101_MAXLINE		16384
-#define	MBF_XTFR8101_FILEHEADERLEN	1024
-#define XTF_MAGIC_NUMBER		0xFACE
-#define XTF_DATA_SIDESCAN		0
-#define XTF_DATA_ANNOTATION		1
-#define XTF_DATA_BATHYMETRY		2
-#define XTF_DATA_ATTITUDE		3
-#define XTF_DATA_POSITION		100
-
-#define RESON_PACKETID_RT_VERY_OLD	0x11
-#define RESON_PACKETID_RIT_VERY_OLD	0x12
-#define RESON_PACKETID_RT_OLD		0x13
-#define RESON_PACKETID_RIT_OLD		0x14
-#define RESON_PACKETID_RT		0x17
-#define RESON_PACKETID_RIT		0x18
-
-struct mbf_xtfr8101_xtfchaninfo
-	{
-	char		TypeOfChannel;
-	char		SubChannelNumber;
-	unsigned short	CorrectionFlags;
-	unsigned short	UniPolar;
-	unsigned short	BytesPerSample;
-	unsigned int	SamplesPerChannel;
-	char		ChannelName[16];
-	float		VoltScale;		/* maximum value (V) */
-	float		Frequency;		/* Hz */
-	float		HorizBeamAngle;		/* degrees */
-	float		TiltAngle;
-	float		BeamWidth;
-	float		OffsetX;
-	float		OffsetY;
-	float		OffsetZ;
-	float		OffsetYaw;
-	float		OffsetPitch;
-	float		OffsetRoll;
-	char		ReservedArea[56];
-	};
-
-struct mbf_xtfr8101_xtffileheader
-	{
-	char		FileFormat;		/* Set to 123 (0x7B */
-	char		SystemType;		/* Set to 1 */
-	char		RecordingProgramName[8];
-	char		RecordingProgramVersion[8];
-	char		SonarName[16];
-	unsigned short	SonarType;		/* 	0 = Reserved
-							1 = JAMSTEC
-							2 = Analog_c31
-							3 = SIS1000
-							4 = Analog_32chan
-							5 = Klein2000
-							6 = RWS
-							7 = DF1000
-							8 = SeaBat 9001
-							9 = Klein595
-							10 = EGG260
-							11 = Sonatech_DDS
-							12 = Echoscan
-							13 = Elac Bottomchart 1180
-							14 = Klein 5000
-							15 = Reson SeaBat 8101
-							16 = Imagenex model 858
-							17 = USN SILOS with 3-channel analog
-							18 = Sonatech super high res sidescan sonar
-							19 = Delph AU32 Analog input (2 channel)
-							20 = Generic sonar using the memory-mapped
-								file interface
-							21 = Simrad SM2000
-							22 = Standard multibedia audio
-							23 = Edgetech ACI card for 260 sonar throug PC31 card
-							24 = Edgetech black box
-							25 = Fugro deeptow
-							26 = C&C Edgetech chirp conversion program
-							27 = DTI SAS synthetic aperture processor (mmap file)
-							*/
-	char		NoteString[64];
-	char		ThisFileName[64];
-	unsigned short	NavUnits;		/* 0 = meters, 3 = degrees */
-	unsigned short	NumberOfSonarChannels;	/* if <= 6 use 1024 byte header,
-							if > 6 use 2048 byte header */
-	unsigned short	NumberOfBathymetryChannels;
-	unsigned short	Reserved1;
-	unsigned short	Reserved2;
-	unsigned short	Reserved3;
-	unsigned short	Reserved4;
-	unsigned short	Reserved5;
-	unsigned short	Reserved6;
-	char		ProjectionType[12];	/* not currently used */
-	char		SpheroidType[10];	/* not currently used */
-	int		NavigationLatency;	/* GPS_time_received - GPS_time_sent (msec) */
-	float		OriginY;		/* not currently used */
-	float		OriginX; 		/* not currently used */
-	float		NavOffsetY;		/* Multibeam nav offset (m) */
-	float		NavOffsetX;		/* Multibeam nav offset (m) */
-	float		NavOffsetZ; 		/* Multibeam nav z offset (m) */
-	float		NavOffsetYaw;		/* Multibeam heading offset (m) */
-	float		MRUOffsetY;		/* Multibeam MRU y offset (m) */
-	float		MRUOffsetX;		/* Multibeam MRU x offset (m) */
-	float		MRUOffsetZ; 		/* Multibeam MRU z offset (m) */
-	float		MRUOffsetYaw;		/* Multibeam MRU heading offset (m) */
-	float		MRUOffsetPitch; 	/* Multibeam MRU pitch offset (degrees) */
-	float		MRUOffsetRoll;		/* Multibeam MRU roll offset (degrees) */
-	struct mbf_xtfr8101_xtfchaninfo chaninfo[6];
-
-	};
-
-struct mbf_xtfpacketheader
-	{
-	mb_u_char	MagicNumber[2];		/* 0xFACE */
-	mb_u_char	HeaderType;		/* 0 = sonar ping, 1 = annotation, 2 = bathymetry, 3 = attitude */
-	mb_u_char	SubChannelNumber;	/* which multibeam head */
-	unsigned short	NumChansToFollow;	/* Number of beams to follow */
-	unsigned short	Reserved1[2];
-	unsigned int	NumBytesThisRecord;	/* total byte count including this header */
-	};
-
-struct mbf_xtfattitudeheader
-	{
-	struct mbf_xtfpacketheader packetheader;
-	unsigned int	Reserved2[4];
-	float		Pitch;
-	float		Roll;
-	float		Heave;
-	float		Yaw;
-	unsigned int	TimeTag;		/* time tag (msec) */
-	float		Heading;
-	char		Reserved3[10];
-	};
-
-struct mbf_xtfbathheader
-	{
-	struct mbf_xtfpacketheader packetheader;
-	unsigned short	Year;
-	mb_u_char	Month;
-	mb_u_char	Day;
-	mb_u_char	Hour;
-	mb_u_char	Minute;
-	mb_u_char	Second;
-	mb_u_char	HSeconds;
-	unsigned short	JulianDay;
-	unsigned short	CurrentLineID;
-	unsigned short	EventNumber;
-	unsigned int	PingNumber;
-	float		SoundVelocity;		/* Half sound speed (e.g. 750 m/sec instead of 1500 m/sec) */
-	float		OceanTide;		/* (m) */
-	unsigned int	Reserved2;
-	float		ConductivityFreq;	/* Raw CTD conductivity frequency (Hz) */
-	float		TemperatureFreq;	/* Raw CTD temperature frequency (Hz) */
-	float		PressureFreq;		/* Raw CTD pressure frequency (Hz) */
-	float		PressureTemp;		/* Raw CTD pressure temperature (deg C) */
-	float		Conductivity;		/* computed CTD conductivity (siemens/m) */
-	float		WaterTemperature;	/* computed CTD temperature (deg C) */
-	float		Pressure;		/* computed CTD water pressure (psia) */
-	float		ComputedSoundVelocity;	/* water sound velocity (m/sec) */
-	float		MagX;			/* X-axis magnetometer (mGauss) */
-	float		MagY;			/* Y-axis magnetometer (mGauss) */
-	float		MagZ;			/* Z-axis magnetometer (mGauss) */
-	float		AuxVal1;
-	float		AuxVal2;
-	float		AuxVal3;
-	float		AuxVal4;
-	float		AuxVal5;
-	float		AuxVal6;
-	float		SpeedLog;	/* towfish speed (kts) */
-	float		Turbidity;	/* turbity (0-5V * 10000) */
-	float		ShipSpeed;	/* ship speed (kts) */
-	float		ShipGyro;	/* ship heading (deg) */
-	double		ShipYcoordinate;/* ship latitude or northing */
-	double		ShipXcoordinate;/* ship longitude or easting */
-	short		ShipAltitude;	/* ship altitude (decimeters) */
-	short		ShipDepth;	/* ship depth (decimeters) */
-	mb_u_char	FixTimeHour;	/* last nav fix time (hour) */
-	mb_u_char	FixTimeMinute;	/* last nav fix time (min) */
-	mb_u_char	FixTimeSecond;	/* last nav fix time (sec) */
-	char		Reserved4;
-	float		SensorSpeed; 	/* towfish speed (kts) */
-	float		KP;		/* kilometers pipe (km) */
-	double		SensorYcoordinate; /* towfish latitude or northing */
-	double		SensorXcoordinate; /* towfish longitude or easting */
-	short		Reserved6;
-	short		RangeToSensor;	/* slant range to towfish * 10 */
-	short		BearingToSensor;/* bearing to towfish * 100 */
-	short		CableOut;	/* cable out (m) */
-	float		Layback;	/* distance from ship to sensor (m) */
-	float		CableTension;	/* cable tension */
-	float		SensorDepth;	/* towfish depth (m) */
-	float		SensorPrimaryAltitude; /* towfish altitude (m) */
-	float		SensorAuxAltitude; /* towfish altitude (m) */
-	float		SensorPitch;	/* sensor pitch (deg) */
-	float		SensorRoll;	/* sensor roll (deg) */
-	float		SensorHeading;	/* sensor heading (deg) */
-	float		Heave;		/* sensor heave (m) */
-	float		Yaw;		/* sensor yaw (deg) */
-	int		AttitudeTimeTag;/* time tag from MRU */
-	float		DOT;		/* distance off track */
-	char		ReservedSpace[20];
-	};
-
-struct mbf_xtfpingchanheader {
-
-   unsigned short	ChannelNumber;	/* Typically,  */
-					/* 0=port (low frequency) */
-					/* 1=stbd (low frequency) */
-					/* 2=port (high frequency) */
-					/* 3=stbd (high frequency) */
-
-   unsigned short	DownsampleMethod;   /* 2=MAX, 4=RMS */
-   float		SlantRange;	/* Slant range of the data in meters */
-   float		GroundRange;	/* Ground range of the data in meters */
-					/*   (SlantRange^2 - Altitude^2) */
-   float		TimeDelay;	/* Amount of time (in seconds) to the start of recorded data */
-					/*   almost always 0.0 */
-   float		TimeDuration;	/* Amount of time (in seconds) recorded */
-   float		SecondsPerPing;	/* Amount of time (in seconds) from ping to ping */
-
-   unsigned short	ProcessingFlags;/* 4=TVG, 8=BAC&GAC, 16=Filter, etc... */
-					/*   almost always 0 */
-   unsigned short	Frequency;	/* Center transmit frequency for this channel. */
-					/*   when non-zero, replaces value found in file */
-					/*   header CHANINFO struct ChanInfo->SamplesPerChannel. */
-					/*   This allows samples per channel to change on the fly. */
-
-   unsigned short	InitialGainCode;/* Settings as transmitted by sonar */
-   unsigned short	GainCode;
-   unsigned short	BandWidth;
-
-   /* Contact information - updated when contacts are saved through Target.exe */
-   unsigned int		ContactNumber;
-   unsigned short	ContactClassification;
-   mb_u_char		ContactSubNumber;
-   mb_u_char		ContactType;
-
-
-   unsigned int		NumSamples;	/* Number of samples that will follow this structure.  The */
-					/* number of bytes will be this value multipied by the */
-					/* number of bytes per sample (given in the file header) */
-
-   unsigned short	Reserved;	/* Obsolete. */
-   float		ContactTimeOffTrack;	/* Time off track to this contact (stored in milliseconds) */
-   mb_u_char	ContactCloseNumber;
-   mb_u_char	Reserved2;
-
-   float		FixedVSOP;	/* Fixed along-track size of each ping, stored in cm. */
-					/*  on multibeam system with zero beam spread, this value */
-					/*  needs to be filled in to prevent Isis from calculating */
-					/*  along-track ground coverage based on beam spread and  */
-					/*  speed over ground.  In order for */
-					/* Target to use this number, "223" */
-					/* or later must be set in */
-					/* XTFFILEHEADER.RecordingProgramVersion */
-
-   mb_u_char	ReservedSpace[6];   /* reserved for future expansion */
-
-};
-
-struct 	RESON8100_RT_VERY_OLD
-{
-   	char		synch_header[4];		/* synch header {0xff, 0xff, 0x00, 0x00 */
-   	char      	packet_type;      		/* identifier for packet type (0x11) */
-   	char           	packet_subtype;   		/* identifier for packet subtype */
-	unsigned int	Seconds;	/* seconds since 00:00:00, 1 January 1970 */
-	unsigned int	Millisecs;	/* milliseconds, LSB = 1 ms */
-   	unsigned short 	latency;          		/* time from ping to output (milliseconds) */
-   	unsigned short 	velocity;         		/* programmed sound velocity (LSB = 1 m/sec) */
-   	unsigned short 	sample_rate;      		/* A/D sample rate (samples per second) */
-   	mb_u_char  	pulse_width;      		/* transmit pulse width (microseconds) */
-   	unsigned short 	ping_rate;        		/* Ping rate (pings per second * 1000) */
-   	unsigned short 	range_set;        		/* range setting for SeaBat (meters ) */
-   	unsigned short 	power;            		/* power setting for SeaBat  	 */
-						/* bits	0-4 -	power (0 - 8) */
-						/* bit	15	(0 = manual, 1 = auto) */
-	unsigned short 	gain;             		/* gain setting for SeaBat */
-					/* bits	0-6 -	gain (1 - 45) */
-					/* bit 	14	(0 = fixed, 1 = tvg) */
-					/* bit	15	(0 = manual, 1 = auto) */
-	short          	projector;        		/* projector setting */
-	mb_u_char  	beam_width;       		/* cross track receive beam width (degrees * 10) */
-	short          	beam_count;       		/* number of sets of beam data in packet */
-	unsigned short 	range[MBF_XTFR8101_MAXBEAMS]; 		/* range for beam where n = Beam Count */
-	mb_u_char  	quality[MBF_XTFR8101_MAXBEAMS/2];   		/* packed quality array (two 4 bit values/char) */
-						/* bit 0 - brightness test (0=failed, 1=passed) */
-						/* bit 1 - colinearity test (0=failed, 1=passed) */
-						/* bit 2 - amplitude bottom detect used */
-						/* bit 3 - phase bottom detect used */
-						/* bottom detect can be amplitude, phase or both */
-	unsigned short 	checksum;         		/* checksum for data packet */
-};
-
-struct 	RESON8100_RIT_VERY_OLD
-{
-	char		synch_header[4];		/* synch header {0xff, 0xff, 0x00, 0x00 */
-   	char      	packet_type;      		/* identifier for packet type (0x12) */
-   	char           	packet_subtype;   		/* identifier for packet subtype */
-	unsigned int	Seconds;	/* seconds since 00:00:00, 1 January 1970 */
-	unsigned int	Millisecs;	/* milliseconds, LSB = 1 ms */
-   	unsigned short 	latency;          		/* time from ping to output (milliseconds) */
-   	unsigned short 	velocity;         		/* programmed sound velocity (LSB = 1 m/sec) */
-   	unsigned short 	sample_rate;      		/* A/D sample rate (samples per second) */
-   	mb_u_char  	pulse_width;      		/* transmit pulse width (microseconds) */
-   	unsigned short 	ping_rate;        		/* Ping rate (pings per second * 1000) */
-   	unsigned short 	range_set;        		/* range setting for SeaBat (meters ) */
-   	unsigned short 	power;            		/* power setting for SeaBat */
-						/* bits	0-4 -	power (0 - 8) */
-						/* bit	15	(0 = manual, 1 = auto) */
-  	unsigned short 	gain;             		/* gain setting for SeaBat */
-					/* bits	0-6 -	gain (1 - 45) */
-					/* bit 	14	(0 = fixed, 1 = tvg) */
-					/* bit	15	(0 = manual, 1 = auto) */
-  	short          	projector;        		/* projector setting */
-	mb_u_char  	beam_width;       		/* cross track receive beam width (degrees * 10) */
-	short          	beam_count;       		/* number of sets of beam data in packet */
-	unsigned short 	range[MBF_XTFR8101_MAXBEAMS]; 		/* range for beam where n = Beam Count */
-	mb_u_char  	quality[MBF_XTFR8101_MAXBEAMS/2];   		/* packed quality array (two 4 bit values/char) */
-						/* bit 0 - brightness test (0=failed, 1=passed) */
-						/* bit 1 - colinearity test (0=failed, 1=passed) */
-						/* bit 2 - amplitude bottom detect used */
-						/* bit 3 - phase bottom detect used */
-						/* bottom detect can be amplitude, phase or both */
-	mb_u_char	intensity[MBF_XTFR8101_MAXBEAMS];   		/* intensities at bottom detect */
-	unsigned short 	checksum;         		/* checksum for data packet */
-};
-
-struct 	RESON8100_RT_OLD
-{
-   	char		synch_header[4];		/* synch header {0xff, 0xff, 0x00, 0x00 */
-   	char      	packet_type;      		/* identifier for packet type (0x13) */
-   	char           	packet_subtype;   		/* identifier for packet subtype */
-	unsigned int	Seconds;	/* seconds since 00:00:00, 1 January 1970 */
-	unsigned int	Millisecs;	/* milliseconds, LSB = 1 ms */
-   	unsigned short 	latency;          		/* time from ping to output (milliseconds) */
-   	unsigned short 	velocity;         		/* programmed sound velocity (LSB = 1 m/sec) */
-   	unsigned short 	sample_rate;      		/* A/D sample rate (samples per second) */
-   	mb_u_char  	pulse_width;      		/* transmit pulse width (microseconds) */
-   	unsigned short 	ping_rate;        		/* Ping rate (pings per second * 1000) */
-   	unsigned short 	range_set;        		/* range setting for SeaBat (meters ) */
-   	unsigned short 	power;            		/* power setting for SeaBat  	 */
-						/* bits	0-4 -	power (0 - 8) */
-						/* bit	15	(0 = manual, 1 = auto) */
-	unsigned short 	gain;             		/* gain setting for SeaBat */
-					/* bits	0-6 -	gain (1 - 45) */
-					/* bit 	14	(0 = fixed, 1 = tvg) */
-					/* bit	15	(0 = manual, 1 = auto) */
-	short          	projector;        		/* projector setting  */
-	mb_u_char	tvg_spread;		/* spreading coefficient for tvg * 4  */
-						/* valid values = 0 to 240 (0.0 to 60.0 in 0.25 steps) */
-	mb_u_char	tvg_absorp;		/* absorption coefficient for tvg */
-	mb_u_char  	beam_width;       		/* cross track receive beam width (degrees * 10) */
-	short          	beam_count;       		/* number of sets of beam data in packet */
-	unsigned short 	range[MBF_XTFR8101_MAXBEAMS]; 		/* range for beam where n = Beam Count */
-						/* range units = sample cells * 4 */
-	mb_u_char  	quality[MBF_XTFR8101_MAXBEAMS/2];   		/* packed quality array (two 4 bit values/char) */
-						/* bit 0 - brightness test (0=failed, 1=passed) */
-						/* bit 1 - colinearity test (0=failed, 1=passed) */
-						/* bit 2 - amplitude bottom detect used */
-						/* bit 3 - phase bottom detect used */
-						/* bottom detect can be amplitude, phase or both */
-	unsigned short 	checksum;         		/* checksum for data packet */
-};
-
-struct 	RESON8100_RIT_OLD
-{
-   	char		synch_header[4];		/* synch header {0xff, 0xff, 0x00, 0x00 */
-   	char      		packet_type;      		/* identifier for packet type (0x14) */
-   	char           	packet_subtype;   	/* identifier for packet subtype */
-	unsigned int	Seconds;	/* seconds since 00:00:00, 1 January 1970 */
-	unsigned int	Millisecs;	/* milliseconds, LSB = 1 ms */
-   	unsigned short 	latency;          		/* time from ping to output (milliseconds) */
-   	unsigned short 	velocity;         		/* programmed sound velocity (LSB = 1 m/sec) */
-   	unsigned short 	sample_rate;      		/* A/D sample rate (samples per second) */
-   	mb_u_char  	pulse_width;      		/* transmit pulse width (microseconds) */
-   	unsigned short 	ping_rate;        		/* Ping rate (pings per second * 1000) */
-   	unsigned short 	range_set;        		/* range setting for SeaBat (meters ) */
-   	unsigned short 	power;            		/* power setting for SeaBat  	 */
-						/* bits	0-4 -	power (0 - 8) */
-						/* bit	15	(0 = manual, 1 = auto) */
-	unsigned short 	gain;             		/* gain setting for SeaBat */
-					/* bits	0-6 -	gain (1 - 45) */
-					/* bit 	14	(0 = fixed, 1 = tvg) */
-					/* bit	15	(0 = manual, 1 = auto) */
-	short          	projector;        		/* projector setting  */
-	mb_u_char	tvg_spread;		/* spreading coefficient for tvg * 4  */
-						/* valid values = 0 to 240 (0.0 to 60.0 in 0.25 steps) */
-	mb_u_char	tvg_absorp;		/* absorption coefficient for tvg */
-	mb_u_char  	beam_width;       		/* cross track receive beam width (degrees * 10) */
-	short          	beam_count;       		/* number of sets of beam data in packet */
-	unsigned short 	range[MBF_XTFR8101_MAXBEAMS]; 		/* range for beam where n = Beam Count */
-						/* range units = sample cells * 4 */
-	mb_u_char  	quality[MBF_XTFR8101_MAXBEAMS];   		/* unpacked quality array (one 8 bit value/char) */
-						/* bit 0 - brightness test (0=failed, 1=passed) */
-						/* bit 1 - colinearity test (0=failed, 1=passed) */
-						/* bit 2 - amplitude bottom detect used */
-						/* bit 3 - phase bottom detect used */
-						/* bottom detect can be amplitude, phase or both */
-	unsigned short	intensity[MBF_XTFR8101_MAXBEAMS];   		/* intensities at bottom detect * 8 */
-	unsigned short 	checksum;         		/* checksum for data packet */
-};
-
-struct 	RESON8100_RT
-{
-   	char		synch_header[4];		/* synch header {0xff, 0xff, 0x00, 0x00 */
-   	char      		packet_type;      		/* identifier for packet type (0x17) */
-   	char           	packet_subtype;   	/* identifier for packet subtype */
-						/* for dual head system, most significant bit (bit 7) */
-						/* indicates which sonar head to associate with packet */
-						/* 	head 1 - bit 7 set to 0 */
-						/* 	head 2 -	bit 7 set to 1 	 */
-	unsigned short 	latency;          		/* time from ping to output (milliseconds) */
-	unsigned int	Seconds;	/* seconds since 00:00:00, 1 January 1970 */
-	unsigned int	Millisecs;	/* milliseconds, LSB = 1 ms */
-	unsigned int	ping_number;		/* sequential ping number from sonar startup/reset */
-	unsigned int	sonar_id;		/* least significant four bytes of Ethernet address */
-	unsigned short     sonar_model;		/* coded model number of sonar */
-	unsigned short	frequency;		/* sonar frequency in KHz */
-	unsigned short 	velocity;         		/* programmed sound velocity (LSB = 1 m/sec) */
-   	unsigned short 	sample_rate;      		/* A/D sample rate (samples per second) */
-	unsigned short 	ping_rate;        		/* Ping rate (pings per second * 1000) */
-   	unsigned short 	range_set;        		/* range setting for SeaBat (meters ) */
-   	unsigned short 	power;            		/* power setting for SeaBat  	 */
-						/* bits	0-4 -	power (0 - 8) */
-	unsigned short 	gain;             		/* gain setting for SeaBat */
-					/* bits	0-6 -	gain (1 - 45) */
-					/* bit 	14	(0 = fixed, 1 = tvg) */
-					/* bit	15	(0 = manual, 1 = auto) */
-	unsigned short  	pulse_width;      		/* transmit pulse width (microseconds) */
-	mb_u_char	tvg_spread;		/* spreading coefficient for tvg * 4  */
-						/* valid values = 0 to 240 (0.0 to 60.0 in 0.25 steps) */
-	mb_u_char	tvg_absorp;		/* absorption coefficient for tvg */
-	mb_u_char     	projector_type;      	/* bits 0-4 = projector type */
-						/* 0 = stick projector */
-						/* 1 = array face */
-						/* 2 = ER projector */
-						/* bit 7 - pitch steering (1=enabled, 0=disabled) */
-	mb_u_char      projector_beam_width;	/* along track transmit beam width (degrees * 10) */
-	unsigned short  	beam_width_num;   	/* cross track receive beam width numerator */
-	unsigned short 	beam_width_denom; 	/* cross track receive beam width denominator */
-						/* beam width degrees = numerator / denominator */
-	short		projector_angle;		/* projector pitch steering angle (degrees * 100) */
-	unsigned short	min_range;		/* sonar filter settings */
-	unsigned short	max_range;
-	unsigned short	min_depth;
-	unsigned short	max_depth;
-	mb_u_char	filters_active;		/* range/depth filters active  */
-						/* bit 0 - range filter (0 = off, 1 = active) */
-						/* bit 1 - depth filter (0 = off, 1 = active) */
-	mb_u_char	spare[3];			/* spare field for future growth */
-	short		temperature;		/* temperature at sonar head (deg C * 10) */
-	short          	beam_count;       		/* number of sets of beam data in packet */
-	unsigned short 	range[MBF_XTFR8101_MAXBEAMS]; 		/* range for beam where n = Beam Count */
-						/* range units = sample cells * 4 */
-	mb_u_char  	quality[MBF_XTFR8101_MAXBEAMS/2+1];   		/* packed quality array (two 4 bit values/char) */
-						/* cnt = n/2 if beam count even, n/2+1 if odd */
-						/* cnt then rounded up to next even number */
-						/* e.g. if beam count=101, cnt=52  */
-						/* unused trailing quality values set to zero */
-						/* bit 0 - brightness test (0=failed, 1=passed) */
-						/* bit 1 - colinearity test (0=failed, 1=passed) */
-						/* bit 2 - amplitude bottom detect used */
-						/* bit 3 - phase bottom detect used */
-						/* bottom detect can be amplitude, phase or both */
-	unsigned short 	checksum;         		/* checksum for data packet */
-};
-
-struct 	RESON8100_RIT
-{
-	char		synch_header[4];		/* synch header {0xff, 0xff, 0x00, 0x00 */
-   	char      	packet_type;      		/* identifier for packet type (0x18) */
-	char           	packet_subtype;   	/* identifier for packet subtype */
-						/* for dual head system, most significant bit (bit 7) */
-						/* indicates which sonar head to associate with packet */
-						/* 	head 1 - bit 7 set to 0 */
-						/* 	head 2 -	bit 7 set to 1 		 */
-	unsigned short 	latency;          		/* time from ping to output (milliseconds) */
-	unsigned int	Seconds;	/* seconds since 00:00:00, 1 January 1970 */
-	unsigned int	Millisecs;	/* milliseconds, LSB = 1 ms */
-	unsigned int	ping_number;		/* sequential ping number from sonar startup/reset */
-	unsigned int	sonar_id;		/* least significant four bytes of Ethernet address */
-	unsigned short     sonar_model;		/* coded model number of sonar */
-	unsigned short	frequency;		/* sonar frequency in KHz */
-	unsigned short 	velocity;         		/* programmed sound velocity (LSB = 1 m/sec) */
-   	unsigned short 	sample_rate;      		/* A/D sample rate (samples per second) */
-	unsigned short 	ping_rate;        		/* Ping rate (pings per second * 1000) */
-   	unsigned short 	range_set;        		/* range setting for SeaBat (meters ) */
-   	unsigned short 	power;            		/* power setting for SeaBat  	 */
-						/* bits	0-4 -	power (0 - 8) */
-	unsigned short 	gain;             		/* gain setting for SeaBat */
-					/* bits	0-6 -	gain (1 - 45) */
-					/* bit 	14	(0 = fixed, 1 = tvg) */
-					/* bit	15	(0 = manual, 1 = auto) */
-	unsigned short  	pulse_width;      		/* transmit pulse width (microseconds) */
-	mb_u_char	tvg_spread;		/* spreading coefficient for tvg * 4  */
-						/* valid values = 0 to 240 (0.0 to 60.0 in 0.25 steps) */
-	mb_u_char	tvg_absorp;		/* absorption coefficient for tvg */
-	mb_u_char     	projector_type;      	/* bits 0-4 = projector type */
-						/* 0 = stick projector */
-						/* 1 = array face */
-						/* 2 = ER projector */
-						/* bit 7 - pitch steering (1=enabled, 0=disabled) */
-	mb_u_char      projector_beam_width;	/* along track transmit beam width (degrees * 10) */
-	unsigned short  	beam_width_num;   	/* cross track receive beam width numerator */
-	unsigned short 	beam_width_denom; 	/* cross track receive beam width denominator */
-						/* beam width degrees = numerator / denominator */
-	short		projector_angle;		/* projector pitch steering angle (degrees * 100) */
-	unsigned short	min_range;		/* sonar filter settings */
-	unsigned short	max_range;
-	unsigned short	min_depth;
-	unsigned short	max_depth;
-	mb_u_char	filters_active;		/* range/depth filters active  */
-						/* bit 0 - range filter (0 = off, 1 = active) */
-						/* bit 1 - depth filter (0 = off, 1 = active) */
-	mb_u_char	spare[3];			/* spare field for future growth */
-	short		temperature;		/* temperature at sonar head (deg C * 10) */
-	short          	beam_count;       		/* number of sets of beam data in packet */
-	unsigned short 	range[MBF_XTFR8101_MAXBEAMS]; 		/* range for beam where n = Beam Count */
-						/* range units = sample cells * 4 */
-	mb_u_char  	quality[MBF_XTFR8101_MAXBEAMS/2+1];   		/* packed quality array (two 4 bit values/char) */
-						/* cnt = n/2 if beam count even, n/2+1 if odd */
-						/* cnt then rounded up to next even number */
-						/* e.g. if beam count=101, cnt=52  */
-						/* unused trailing quality values set to zero */
-						/* bit 0 - brightness test (0=failed, 1=passed) */
-						/* bit 1 - colinearity test (0=failed, 1=passed) */
-						/* bit 2 - amplitude bottom detect used */
-						/* bit 3 - phase bottom detect used */
-						/* bottom detect can be amplitude, phase or both */
-	unsigned short	intensity[MBF_XTFR8101_MAXBEAMS];   		/* intensities at bottom detect * 8 */
-	unsigned short 	checksum;         		/* checksum for data packet */
-};
-
-struct	RESON_STATUS
-{
-	char			Synch[4];	/* synch header {0xff, 0xff, 0x00, 0x00 } */
-	char			PacketType;	/* identifier for packet type (0x70) */
-	unsigned short		ErrorCode;	/* bit mapped error codes */
-						/* bit 0	=	leak sensor */
-						/* bit 1	=	power supply fault */
-	unsigned int	Seconds;	/* seconds since 00:00:00, 1 January 1970 */
-	unsigned int	Millisecs;	/* milliseconds, LSB = 1 ms */
-	unsigned short		Temperature;	/* temperature reported by SeaBat (deg C) */
-	char			Message[40];	/* ASCII message describing fault */
-	char			Spare[40];	/* spare fields */
-	unsigned short		Checksum;	/* checksum for data packet */
-};
-
-struct mbf_xtfr8101_struct
-	{
-	/* type of data record */
-	int	kind;			/* Data vs Comment */
-
-	/* type of sonar */
-	int	sonar;			/* Type of Reson sonar */
-
-	/* xtf file header */
-	struct mbf_xtfr8101_xtffileheader fileheader;
-
-	/* xtf attitude record */
-	struct mbf_xtfattitudeheader attitudeheader;
-
-	/* xtf Reson multibeam bathymetry record */
-	struct mbf_xtfbathheader bathheader;
-	struct RESON8100_RIT reson8100rit;
-	struct mbf_xtfbathheader sidescanheader;
-	struct mbf_xtfpingchanheader pingchanportheader;
-	unsigned short ssrawport[MBF_XTFR8101_MAXRAWPIXELS];
-	struct mbf_xtfpingchanheader pingchanstbdheader;
-	unsigned short ssrawstbd[MBF_XTFR8101_MAXRAWPIXELS];
-
-	/* comment */
-	char comment[MBF_XTFR8101_COMMENT_LENGTH];
-	};
diff --git a/src/mbio/mbr_3ddepthp.c b/src/mbio/mbr_3ddepthp.c
deleted file mode 100644
index 5f60721..0000000
--- a/src/mbio/mbr_3ddepthp.c
+++ /dev/null
@@ -1,1410 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbr_3ddepthp.c	2/11/93
- *	$Id: mbr_3ddepthp.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1993-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbr_3ddepthp.c contains the functions for reading and writing
- * multibeam data in the MBF_3DDEPTHP format.
- * These functions include:
- *   mbr_alm_3ddepthp	- allocate read/write memory
- *   mbr_dem_3ddepthp	- deallocate read/write memory
- *   mbr_rt_3ddepthp	- read and translate data
- *   mbr_wt_3ddepthp	- translate and write data
- *
- * Author:	D. W. Caress
- * Date:	December 27, 2013
- * 
- * $Log: mbr_3ddepthp.c,v $
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-#include <assert.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mb_define.h"
-#include "mbsys_3datdepthlidar.h"
-
-/* include for byte swapping on little-endian machines */
-#ifdef BYTESWAPPED
-#include "mb_swap.h"
-#endif
-
-/* local defines */
-#define ZERO_ALL    0
-#define ZERO_SOME   1
-#define	MBF_3DDEPTHP_BUFFER_SIZE	MB_COMMENT_MAXLINE
-
-/* essential function prototypes */
-int mbr_register_3ddepthp(int verbose, void *mbio_ptr,
-		int *error);
-int mbr_info_3ddepthp(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_alm_3ddepthp(int verbose, void *mbio_ptr, int *error);
-int mbr_dem_3ddepthp(int verbose, void *mbio_ptr, int *error);
-int mbr_rt_3ddepthp(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_wt_3ddepthp(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_3ddepthp_rd_data(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_3ddepthp_wr_data(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-
-static char rcs_id[]="$Id: mbr_3ddepthp.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mbr_register_3ddepthp(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_register_3ddepthp";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* check for non-null structure pointers */
-	assert(mbio_ptr != NULL);
-
-	/* get mb_io_ptr */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set format info parameters */
-	status = mbr_info_3ddepthp(verbose,
-			&mb_io_ptr->system,
-			&mb_io_ptr->beams_bath_max,
-			&mb_io_ptr->beams_amp_max,
-			&mb_io_ptr->pixels_ss_max,
-			mb_io_ptr->format_name,
-			mb_io_ptr->system_name,
-			mb_io_ptr->format_description,
-			&mb_io_ptr->numfile,
-			&mb_io_ptr->filetype,
-			&mb_io_ptr->variable_beams,
-			&mb_io_ptr->traveltime,
-			&mb_io_ptr->beam_flagging,
-			&mb_io_ptr->nav_source,
-			&mb_io_ptr->heading_source,
-			&mb_io_ptr->vru_source,
-			&mb_io_ptr->svp_source,
-			&mb_io_ptr->beamwidth_xtrack,
-			&mb_io_ptr->beamwidth_ltrack,
-			error);
-
-	/* set format and system specific function pointers */
-	mb_io_ptr->mb_io_format_alloc = &mbr_alm_3ddepthp;
-	mb_io_ptr->mb_io_format_free = &mbr_dem_3ddepthp;
-	mb_io_ptr->mb_io_store_alloc = &mbsys_3datdepthlidar_alloc;
-	mb_io_ptr->mb_io_store_free = &mbsys_3datdepthlidar_deall;
-	mb_io_ptr->mb_io_read_ping = &mbr_rt_3ddepthp;
-	mb_io_ptr->mb_io_write_ping = &mbr_wt_3ddepthp;
-	mb_io_ptr->mb_io_dimensions = &mbsys_3datdepthlidar_dimensions;
-	mb_io_ptr->mb_io_preprocess = &mbsys_3datdepthlidar_preprocess;
-	mb_io_ptr->mb_io_extract = &mbsys_3datdepthlidar_extract;
-	mb_io_ptr->mb_io_insert = &mbsys_3datdepthlidar_insert;
-	mb_io_ptr->mb_io_extract_nav = &mbsys_3datdepthlidar_extract_nav;
-	mb_io_ptr->mb_io_insert_nav = &mbsys_3datdepthlidar_insert_nav;
-	mb_io_ptr->mb_io_extract_altitude = &mbsys_3datdepthlidar_extract_altitude;
-	mb_io_ptr->mb_io_insert_altitude = NULL;
-	mb_io_ptr->mb_io_extract_svp = &mbsys_3datdepthlidar_extract_svp;
-	mb_io_ptr->mb_io_insert_svp = &mbsys_3datdepthlidar_insert_svp;
-	mb_io_ptr->mb_io_ttimes = &mbsys_3datdepthlidar_ttimes;
-	mb_io_ptr->mb_io_detects = &mbsys_3datdepthlidar_detects;
-	mb_io_ptr->mb_io_copyrecord = &mbsys_3datdepthlidar_copy;
-	mb_io_ptr->mb_io_extract_rawss = NULL;
-	mb_io_ptr->mb_io_insert_rawss = NULL;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",mb_io_ptr->system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",mb_io_ptr->beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",mb_io_ptr->beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",mb_io_ptr->pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",mb_io_ptr->format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",mb_io_ptr->system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",mb_io_ptr->format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",mb_io_ptr->numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",mb_io_ptr->filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",mb_io_ptr->variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",mb_io_ptr->traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",mb_io_ptr->beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",mb_io_ptr->nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",mb_io_ptr->heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",mb_io_ptr->vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",mb_io_ptr->svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",mb_io_ptr->beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",mb_io_ptr->beamwidth_ltrack);
-		fprintf(stderr,"dbg2       format_alloc:       %p\n",(void *)mb_io_ptr->mb_io_format_alloc);
-		fprintf(stderr,"dbg2       format_free:        %p\n",(void *)mb_io_ptr->mb_io_format_free);
-		fprintf(stderr,"dbg2       store_alloc:        %p\n",(void *)mb_io_ptr->mb_io_store_alloc);
-		fprintf(stderr,"dbg2       store_free:         %p\n",(void *)mb_io_ptr->mb_io_store_free);
-		fprintf(stderr,"dbg2       read_ping:          %p\n",(void *)mb_io_ptr->mb_io_read_ping);
-		fprintf(stderr,"dbg2       write_ping:         %p\n",(void *)mb_io_ptr->mb_io_write_ping);
-		fprintf(stderr,"dbg2       preprocess:         %p\n",(void *)mb_io_ptr->mb_io_preprocess);
-		fprintf(stderr,"dbg2       extract:            %p\n",(void *)mb_io_ptr->mb_io_extract);
-		fprintf(stderr,"dbg2       insert:             %p\n",(void *)mb_io_ptr->mb_io_insert);
-		fprintf(stderr,"dbg2       extract_nav:        %p\n",(void *)mb_io_ptr->mb_io_extract_nav);
-		fprintf(stderr,"dbg2       insert_nav:         %p\n",(void *)mb_io_ptr->mb_io_insert_nav);
-		fprintf(stderr,"dbg2       extract_altitude:   %p\n",(void *)mb_io_ptr->mb_io_extract_altitude);
-		fprintf(stderr,"dbg2       insert_altitude:    %p\n",(void *)mb_io_ptr->mb_io_insert_altitude);
-		fprintf(stderr,"dbg2       extract_svp:        %p\n",(void *)mb_io_ptr->mb_io_extract_svp);
-		fprintf(stderr,"dbg2       insert_svp:         %p\n",(void *)mb_io_ptr->mb_io_insert_svp);
-		fprintf(stderr,"dbg2       ttimes:             %p\n",(void *)mb_io_ptr->mb_io_ttimes);
-		fprintf(stderr,"dbg2       detects:            %p\n",(void *)mb_io_ptr->mb_io_detects);
-		fprintf(stderr,"dbg2       extract_rawss:      %p\n",(void *)mb_io_ptr->mb_io_extract_rawss);
-		fprintf(stderr,"dbg2       insert_rawss:       %p\n",(void *)mb_io_ptr->mb_io_insert_rawss);
-		fprintf(stderr,"dbg2       copyrecord:         %p\n",(void *)mb_io_ptr->mb_io_copyrecord);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbr_info_3ddepthp(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error)
-{
-	char	*function_name = "mbr_info_3ddepthp";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* set format info parameters */
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-	*system = MB_SYS_3DATDEPTHLIDAR;
-	*beams_bath_max = 0;
-	*beams_amp_max = 0;
-	*pixels_ss_max = 0;
-	strncpy(format_name, "3DDEPTHP", MB_NAME_LENGTH);
-	strncpy(system_name, "3DATDEPTHLIDAR", MB_NAME_LENGTH);
-	strncpy(format_description, "Format name:          MBF_3DDEPTHP\nInformal Description: 3DatDepth prototype binary swath mapping LIDAR format\nAttributes:           3DatDepth LIDAR, variable pulses, bathymetry and amplitude, \n                      binary, 3DatDepth.\n", MB_DESCRIPTION_LENGTH);
-	*numfile = 1;
-	*filetype = MB_FILETYPE_NORMAL;
-	*variable_beams = MB_YES;
-	*traveltime = MB_NO;
-	*beam_flagging = MB_YES;
-	*nav_source = MB_DATA_DATA;
-	*heading_source = MB_DATA_DATA;
-	*vru_source = MB_DATA_DATA;
-	*svp_source = MB_DATA_NONE;
-	*beamwidth_xtrack = 0.02;
-	*beamwidth_ltrack = 0.02;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",*system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",*beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",*beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",*pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",*numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",*filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",*variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",*traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",*beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",*nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",*heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",*vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",*svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",*beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",*beamwidth_ltrack);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_alm_3ddepthp(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_alm_3ddepthp";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	int	*file_header_readwritten;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* check for non-null pointers */
-	assert(mbio_ptr != NULL);
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set initial status */
-	status = MB_SUCCESS;
-
-	/* allocate memory for data structure */
-	status = mbsys_3datdepthlidar_alloc(verbose, mbio_ptr, &mb_io_ptr->store_data, error);
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-	
-	/* set file header read flag */
-	file_header_readwritten = (int *) &mb_io_ptr->save1;
-	*file_header_readwritten = MB_NO;
-	
-	/* set saved bytes flag */
-	mb_io_ptr->save2 = MB_NO;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_dem_3ddepthp(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_dem_3ddepthp";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* check for non-null pointers */
-	assert(mbio_ptr != NULL);
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* deallocate memory  */
-	status = mbsys_3datdepthlidar_deall(verbose,mbio_ptr,&mb_io_ptr->store_data,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_rt_3ddepthp(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_rt_3ddepthp";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_3datdepthlidar_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* check for non-null pointers */
-	assert(mbio_ptr != NULL);
-	assert(store_ptr != NULL);
-
-	/* get pointers to mbio descriptor and data structure */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-	store = (struct mbsys_3datdepthlidar_struct *) store_ptr;
-
-	/* read next data from file */
-	status = mbr_3ddepthp_rd_data(verbose,mbio_ptr,store_ptr,error);
-	
-	/* if needed calculate bathymetry */
-	if (status == MB_SUCCESS && store->kind == MB_DATA_DATA
-	    && store->bathymetry_calculated == MB_NO)
-		{
-		mbsys_3datdepthlidar_calculatebathymetry(verbose, mbio_ptr, store_ptr, error);
-		}
-		
-	/* print out status info */
-	if (verbose > 1)
-		mbsys_3datdepthlidar_print_store(verbose, store_ptr, error);
-
-	/* set error and kind in mb_io_ptr */
-	mb_io_ptr->new_error = *error;
-	mb_io_ptr->new_kind = store->kind;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_wt_3ddepthp(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_wt_3ddepthp";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_3datdepthlidar_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* check for non-null pointers */
-	assert(mbio_ptr != NULL);
-	assert(store_ptr != NULL);
-
-	/* get pointers to mbio descriptor and data structure */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-	store = (struct mbsys_3datdepthlidar_struct *) store_ptr;
-
-	/* write next data to file */
-	status = mbr_3ddepthp_wr_data(verbose,mbio_ptr,store_ptr,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_3ddepthp_rd_data(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_3ddepthp_rd_data";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_3datdepthlidar_struct *store;
-	struct mbsys_3datdepthlidar_pulse_struct *pulse;
-	int	*file_header_readwritten;
-	char	buffer[MBF_3DDEPTHP_BUFFER_SIZE];
-	size_t	read_len;
-	size_t	index;
-	unsigned short magic_number;
-	unsigned int *newscancheck, newscancheckvalue;
-	int	done;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* check for non-null pointers */
-	assert(mbio_ptr != NULL);
-	assert(store_ptr != NULL);
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-	store = (struct mbsys_3datdepthlidar_struct *) store_ptr;
-
-	/* get saved values */
-	file_header_readwritten = (int *) &mb_io_ptr->save1;
-
-	/* set file position */
-	mb_io_ptr->file_pos = mb_io_ptr->file_bytes;
-	
-	/* set status */
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-	done = MB_NO;
-
-	/* if first read then read 2 byte magic number at start of file */
-	if (*file_header_readwritten == MB_NO)
-		{
-		/* read and check the first two bytes */
-		read_len = (size_t)2;
-		status = mb_fileio_get(verbose, mbio_ptr, buffer, &read_len, error);
-		if (status == MB_SUCCESS)
-			{
-			index = 0;
-			mb_get_binary_short(MB_YES, (void *) &buffer[index], &(magic_number)); index += 2;
-			}
-		
-		/* if ok and magic_number == 0x3D46 then this is version 1.1 */
-		if (status == MB_SUCCESS && magic_number == MBF_3DDEPTHP_MAGICNUMBER)
-			{
-			store->file_version = 1;
-			store->sub_version = 1;
-			*file_header_readwritten = MB_YES;
-			}
-		
-		/* if ok and magic_number == 0x3D07 then this is the obsolete version 1.0
-			- this file always starts with a parameter record */
-		else if (status == MB_SUCCESS && magic_number == MBF_3DDEPTHP_RECORD_PARAMETER)
-			{
-			/* read file header into buffer */
-			read_len = (size_t)MBF_3DDEPTHP_VERSION_1_0_PARAMETER_SIZE;
-			status = mb_fileio_get(verbose, mbio_ptr, buffer, &read_len, error);
-			
-			/* if read ok then get values */
-			if (status == MB_SUCCESS)
-				{
-				index = 0;
-				store->record_id = MBF_3DDEPTHP_RECORD_PARAMETER;
-				mb_get_binary_short(MB_YES, (void *) &buffer[index], &(store->file_version)); index += 2;
-				mb_get_binary_short(MB_YES, (void *) &buffer[index], &(store->sub_version)); index += 2;
-				mb_get_binary_short(MB_YES, (void *) &buffer[index], &(store->scan_type)); index += 2;
-				mb_get_binary_float(MB_YES, (void *) &buffer[index], &(store->cross_track_angle_start)); index += 4;
-				mb_get_binary_float(MB_YES, (void *) &buffer[index], &(store->cross_track_angle_end)); index += 4;
-				mb_get_binary_float(MB_YES, (void *) &buffer[index], &(store->forward_track_angle_start)); index += 4;
-				mb_get_binary_float(MB_YES, (void *) &buffer[index], &(store->forward_track_angle_end)); index += 4;
-				mb_get_binary_short(MB_YES, (void *) &buffer[index], &(store->counts_per_scan)); index += 2;
-				mb_get_binary_short(MB_YES, (void *) &buffer[index], &(store->counts_per_cross_track)); index += 2;
-				mb_get_binary_short(MB_YES, (void *) &buffer[index], &(store->counts_per_forward_track)); index += 2;
-				mb_get_binary_short(MB_YES, (void *) &buffer[index], &(store->scanner_efficiency)); index += 2;
-				mb_get_binary_short(MB_YES, (void *) &buffer[index], &(store->scans_per_file)); index += 2;
-				mb_get_binary_int(MB_YES, (void *) &buffer[index], &(store->scan_count)); index += 4;
-				store->current_scan = -1;
-
-				/* calculate number of pulses per scan according to mode */
-				if (store->counts_per_scan <= 0)
-					{
-					if (store->counts_per_forward_track == 0)
-						store->counts_per_scan = store->counts_per_cross_track;
-					else if (store->counts_per_cross_track == 0)
-						store->counts_per_scan = store->counts_per_forward_track;
-					else
-						store->counts_per_scan = store->counts_per_cross_track * store->counts_per_forward_track;
-					}
-				store->num_pulses_alloc = store->counts_per_scan;
-					
-				/* allocate memory for pulses */
-				status = mb_mallocd(verbose, __FILE__, __LINE__,
-							store->num_pulses_alloc * sizeof(struct mbsys_3datdepthlidar_pulse_struct),
-							(void **)&store->pulses, error);
-				if (status != MB_SUCCESS)
-					store->num_pulses_alloc = 0;
-				store->num_pulses = 0;
-				
-				/* success */
-				if (status == MB_SUCCESS)
-					{
-					*file_header_readwritten = MB_YES;
-					store->kind = MB_DATA_PARAMETER;
-					done = MB_YES;
-					}
-				}	
-			}
-			
-		/* else this isn't a known way for the file to start */
-		else
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_UNINTELLIGIBLE;
-			done = MB_YES;
-			}
-		}
-		
-	/* read next record in format version 1.1 */
-	if (status == MB_SUCCESS && done == MB_NO
-		&& store->file_version == 1 && store->sub_version == 1)
-		{
-//fprintf(stderr,"READ NEXT RECORD verions %d %d\n",store->file_version,store->sub_version);
-
-		/* read the next record header */
-		read_len = (size_t)sizeof(short);
-		status = mb_fileio_get(verbose, mbio_ptr, (void *) &(store->record_id), &read_len, error);
-//fprintf(stderr,"RECORD ID: %x %d\n",store->record_id,store->record_id);
-		
-		/* read parameter record */
-		if (store->record_id == MBF_3DDEPTHP_RECORD_PARAMETER)
-			{
-			/* read file header into buffer */
-			read_len = (size_t)MBF_3DDEPTHP_VERSION_1_1_PARAMETER_SIZE - 2;
-			status = mb_fileio_get(verbose, mbio_ptr, buffer, &read_len, error);
-			
-			/* if read ok then get values */
-			if (status == MB_SUCCESS)
-				{
-				index = 0;
-				mb_get_binary_short(MB_YES, (void *) &buffer[index], &(store->file_version)); index += 2;
-				mb_get_binary_short(MB_YES, (void *) &buffer[index], &(store->sub_version)); index += 2;
-				mb_get_binary_short(MB_YES, (void *) &buffer[index], &(store->scan_type)); index += 2;
-				mb_get_binary_float(MB_YES, (void *) &buffer[index], &(store->cross_track_angle_start)); index += 4;
-				mb_get_binary_float(MB_YES, (void *) &buffer[index], &(store->cross_track_angle_end)); index += 4;
-				mb_get_binary_float(MB_YES, (void *) &buffer[index], &(store->forward_track_angle_start)); index += 4;
-				mb_get_binary_float(MB_YES, (void *) &buffer[index], &(store->forward_track_angle_end)); index += 4;
-				mb_get_binary_short(MB_YES, (void *) &buffer[index], &(store->counts_per_scan)); index += 2;
-				mb_get_binary_short(MB_YES, (void *) &buffer[index], &(store->counts_per_cross_track)); index += 2;
-				mb_get_binary_short(MB_YES, (void *) &buffer[index], &(store->counts_per_forward_track)); index += 2;
-				mb_get_binary_short(MB_YES, (void *) &buffer[index], &(store->scanner_efficiency)); index += 2;
-				mb_get_binary_short(MB_YES, (void *) &buffer[index], &(store->scans_per_file)); index += 2;
-				mb_get_binary_int(MB_YES, (void *) &buffer[index], &(store->scan_count)); index += 4;
-				store->current_scan = -1;
-
-				/* calculate number of pulses per scan according to mode */
-				if (store->counts_per_scan <= 0)
-					{
-					if (store->counts_per_forward_track == 0)
-						store->counts_per_scan = store->counts_per_cross_track;
-					else if (store->counts_per_cross_track == 0)
-						store->counts_per_scan = store->counts_per_forward_track;
-					else
-						store->counts_per_scan = store->counts_per_cross_track * store->counts_per_forward_track;
-					}
-				store->num_pulses_alloc = store->counts_per_scan;
-					
-				/* allocate memory for pulses */
-				status = mb_mallocd(verbose, __FILE__, __LINE__,
-							store->num_pulses_alloc * sizeof(struct mbsys_3datdepthlidar_pulse_struct),
-							(void **)&store->pulses, error);
-				if (status != MB_SUCCESS)
-					store->num_pulses_alloc = 0;
-				store->num_pulses = 0;
-				
-				/* success */
-				if (status == MB_SUCCESS)
-					{
-					*file_header_readwritten = MB_YES;
-					store->kind = MB_DATA_PARAMETER;
-					}
-				}
-			}
-		
-		/* read comment record */
-		else if (store->record_id == MBF_3DDEPTHP_RECORD_COMMENT)
-			{
-			/* read the comment data */
-			read_len = (size_t) sizeof(short);
-			status = mb_fileio_get(verbose, mbio_ptr, (void *) &store->comment_len, &read_len, error);
-			if (status == MB_SUCCESS)
-				{
-				read_len = (size_t) store->comment_len;
-				status = mb_fileio_get(verbose, mbio_ptr, (void *) &store->comment, &read_len, error);
-			
-				store->kind = MB_DATA_COMMENT;
-				}
-			}
-		
-		/* read position record */
-		else if (store->record_id == MBF_3DDEPTHP_RECORD_POSITION)
-			{
-			/* read the position data */
-			read_len = (size_t) (3 * sizeof(double));
-			status = mb_fileio_get(verbose, mbio_ptr, (void *) buffer, &read_len, error);
-			
-			/* decode the data */
-			if (status == MB_SUCCESS)
-				{
-				index = 0;
-				mb_get_binary_double(MB_YES, (void *) &buffer[index], &(store->pos_time_d)); index += sizeof(double);
-				mb_get_binary_double(MB_YES, (void *) &buffer[index], &(store->pos_longitude)); index += sizeof(double);
-				mb_get_binary_double(MB_YES, (void *) &buffer[index], &(store->pos_latitude)); index += sizeof(double);
-			
-				store->kind = MB_DATA_NAV;
-				}
-			}
-
-		/* read attitude record */
-		else if (store->record_id == MBF_3DDEPTHP_RECORD_ATTITUDE)
-			{
-			/* read the attitude data */
-			read_len = (size_t) (4 * sizeof(double));
-			status = mb_fileio_get(verbose, mbio_ptr, (void *) buffer, &read_len, error);
-			
-			/* decode the data */
-			if (status == MB_SUCCESS)
-				{
-				index = 0;
-				mb_get_binary_double(MB_YES, (void *) &buffer[index], &(store->att_time_d)); index += sizeof(double);
-				mb_get_binary_double(MB_YES, (void *) &buffer[index], &(store->att_roll)); index += sizeof(double);
-				mb_get_binary_double(MB_YES, (void *) &buffer[index], &(store->att_pitch)); index += sizeof(double);
-				mb_get_binary_double(MB_YES, (void *) &buffer[index], &(store->att_heave)); index += sizeof(double);
-			
-				store->kind = MB_DATA_ATTITUDE;
-				}
-			}
-
-		/* read heading record */
-		else if (store->record_id == MBF_3DDEPTHP_RECORD_HEADING)
-			{
-			/* read the heading data */
-			read_len = (size_t) (2 * sizeof(double));
-			status = mb_fileio_get(verbose, mbio_ptr, (void *) buffer, &read_len, error);
-			
-			/* decode the data */
-			if (status == MB_SUCCESS)
-				{
-				index = 0;
-				mb_get_binary_double(MB_YES, (void *) &buffer[index], &(store->hdg_time_d)); index += sizeof(double);
-				mb_get_binary_double(MB_YES, (void *) &buffer[index], &(store->hdg_heading)); index += sizeof(double);
-			
-				store->kind = MB_DATA_HEADING;
-				}
-			}
-
-		/* read sensordepth record */
-		else if (store->record_id == MBF_3DDEPTHP_RECORD_SENSORDEPTH)
-			{
-			/* read the sensordepth data */
-			read_len = (size_t) (2 * sizeof(double));
-			status = mb_fileio_get(verbose, mbio_ptr, (void *) buffer, &read_len, error);
-			
-			/* decode the data */
-			if (status == MB_SUCCESS)
-				{
-				index = 0;
-				mb_get_binary_double(MB_YES, (void *) &buffer[index], &(store->sdp_time_d)); index += sizeof(double);
-				mb_get_binary_double(MB_YES, (void *) &buffer[index], &(store->sdp_sensordepth)); index += sizeof(double);
-			
-				store->kind = MB_DATA_SONARDEPTH;
-				}
-			}
-
-			
-		/* read raw LIDAR scan record */
-		else if (store->record_id == MBF_3DDEPTHP_RECORD_RAWLIDAR)
-			{
-			/* read the next scan header */
-			read_len = (size_t)MBF_3DDEPTHP_VERSION_1_1_RAWSCANHEADER_SIZE;
-			status = mb_fileio_get(verbose, mbio_ptr, (void *) buffer, &read_len, error);
-		
-			/* decode the data */
-			if (status == MB_SUCCESS)
-				{
-				store->current_scan++;
-				index = 0;
-				mb_get_binary_short(MB_YES, (void *) &buffer[index], &(store->year)); index += 2;
-				store->month = (mb_u_char) buffer[index]; index++;
-				store->day = (mb_u_char) buffer[index]; index++;
-				mb_get_binary_short(MB_YES, (void *) &buffer[index], &(store->days_since_jan_1)); index += 2;
-				mb_get_binary_short(MB_YES, (void *) &buffer[index], &(store->hour)); index += 2;
-				store->minutes = (mb_u_char) buffer[index]; index++;
-				store->seconds = (mb_u_char) buffer[index]; index++;
-				mb_get_binary_int(MB_YES, (void *) &buffer[index], &(store->nanoseconds)); index += 4;
-				mb_get_binary_int(MB_YES, (void *) &buffer[index], &(store->num_pulses)); index += 4;
-				store->bathymetry_calculated = MB_NO;
-//fprintf(stderr,"   %4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%9.9d\n",
-//store->year,store->month,store->day,store->hour,store->minutes,store->seconds,store->nanoseconds);
-
-				store->time_d = 0.0;
-				store->navlon = 0.0;
-				store->navlat = 0.0;
-				store->sensordepth = 0.0;
-				store->heading = 0.0;
-				store->roll = 0.0;
-				store->pitch = 0.0;
-				store->speed = 0.0;
-				
-				/* read all of the pulses */
-				for (i=0;i<store->num_pulses;i++)
-					{
-					/* read the next pulse */
-					read_len = (size_t)MBF_3DDEPTHP_VERSION_1_1_RAWPULSE_SIZE;
-					status = mb_fileio_get(verbose, mbio_ptr, (void *) buffer, &read_len, error);
-				
-					/* if read ok then get values */
-					if (status == MB_SUCCESS)
-						{
-						pulse = (struct mbsys_3datdepthlidar_pulse_struct *)&store->pulses[i];
-						index = 0;
-						mb_get_binary_float(MB_YES, (void *) &buffer[index], &(pulse->range)); index += 4;
-						mb_get_binary_short(MB_YES, (void *) &buffer[index], &(pulse->amplitude)); index += 2;
-						mb_get_binary_float(MB_YES, (void *) &buffer[index], &(pulse->snr)); index += 4;
-						mb_get_binary_float(MB_YES, (void *) &buffer[index], &(pulse->cross_track_angle)); index += 4;
-						mb_get_binary_float(MB_YES, (void *) &buffer[index], &(pulse->forward_track_angle)); index += 4;
-						mb_get_binary_float(MB_YES, (void *) &buffer[index], &(pulse->cross_track_offset)); index += 4;
-						mb_get_binary_float(MB_YES, (void *) &buffer[index], &(pulse->forward_track_offset)); index += 4;
-						mb_get_binary_int(MB_YES, (void *) &buffer[index], &(pulse->pulse_time_offset)); index += 4;
-						pulse->saturated = buffer[index]; index++;
-						
-						pulse->time_d = 0.0;
-						pulse->beamflag = MB_FLAG_NULL;
-						pulse->acrosstrack = 0.0;
-						pulse->alongtrack = 0.0;
-						pulse->depth = 0.0;
-						pulse->navlon = 0.0;
-						pulse->navlat = 0.0;
-						pulse->sensordepth = 0.0;
-						pulse->heading = 0.0;
-						pulse->roll = 0.0;
-						pulse->pitch = 0.0;
-						}
-					}
-				for (i=store->num_pulses;i<store->counts_per_scan;i++)
-					{
-					pulse = (struct mbsys_3datdepthlidar_pulse_struct *)&store->pulses[i];
-					pulse->range = 0.0;
-					pulse->amplitude = 0;
-					pulse->snr = 0.0;
-					pulse->cross_track_angle = 0.0;
-					pulse->forward_track_angle = 0.0;
-					pulse->cross_track_offset = 0.0;
-					pulse->forward_track_offset = 0.0;
-					pulse->pulse_time_offset = 0;
-					pulse->saturated = 0;
-					pulse->time_d = 0.0;
-					pulse->beamflag = MB_FLAG_NULL;
-					pulse->acrosstrack = 0.0;
-					pulse->alongtrack = 0.0;
-					pulse->depth = 0.0;
-					pulse->navlon = 0.0;
-					pulse->navlat = 0.0;
-					pulse->sensordepth = 0.0;
-					pulse->heading = 0.0;
-					pulse->roll = 0.0;
-					pulse->pitch = 0.0;
-					}
-				}
-			
-			store->kind = MB_DATA_DATA;
-			}
-			
-		/* read processed LIDAR scan record */
-		else if (store->record_id == MBF_3DDEPTHP_RECORD_LIDAR)
-			{			
-			/* read the next scan header */
-			read_len = (size_t)MBF_3DDEPTHP_VERSION_1_1_SCANHEADER_SIZE;
-			status = mb_fileio_get(verbose, mbio_ptr, (void *) buffer, &read_len, error);
-		
-			/* decode the data */
-			if (status == MB_SUCCESS)
-				{
-				store->current_scan++;
-				index = 0;
-				mb_get_binary_short(MB_YES, (void *) &buffer[index], &(store->year)); index += 2;
-				store->month = (mb_u_char) buffer[index]; index++;
-				store->day = (mb_u_char) buffer[index]; index++;
-				mb_get_binary_short(MB_YES, (void *) &buffer[index], &(store->days_since_jan_1)); index += 2;
-				mb_get_binary_short(MB_YES, (void *) &buffer[index], &(store->hour)); index += 2;
-				store->minutes = (mb_u_char) buffer[index]; index++;
-				store->seconds = (mb_u_char) buffer[index]; index++;
-				mb_get_binary_int(MB_YES, (void *) &buffer[index], &(store->nanoseconds)); index += 4;
-				mb_get_binary_double(MB_YES, (void *) &buffer[index], &(store->time_d)); index += 8;
-				mb_get_binary_double(MB_YES, (void *) &buffer[index], &(store->navlon)); index += 8;
-				mb_get_binary_double(MB_YES, (void *) &buffer[index], &(store->navlat)); index += 8;
-				mb_get_binary_double(MB_YES, (void *) &buffer[index], &(store->sensordepth)); index += 8;
-				mb_get_binary_float(MB_YES, (void *) &buffer[index], &(store->heading)); index += 4;
-				mb_get_binary_float(MB_YES, (void *) &buffer[index], &(store->roll)); index += 4;
-				mb_get_binary_float(MB_YES, (void *) &buffer[index], &(store->pitch)); index += 4;
-				mb_get_binary_float(MB_YES, (void *) &buffer[index], &(store->speed)); index += 4;
-				mb_get_binary_int(MB_YES, (void *) &buffer[index], &(store->num_pulses)); index += 4;
-				store->bathymetry_calculated = MB_YES;
-//fprintf(stderr,"   %4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%9.9d\n",
-//store->year,store->month,store->day,store->hour,store->minutes,store->seconds,store->nanoseconds);
-				}
-				
-			/* read all of the pulses */
-			if (status == MB_SUCCESS)
-				{
-				for (i=0;i<store->num_pulses;i++)
-					{
-					/* read the next pulse */
-					read_len = (size_t)MBF_3DDEPTHP_VERSION_1_1_PULSE_SIZE;
-					status = mb_fileio_get(verbose, mbio_ptr, (void *) buffer, &read_len, error);
-				
-					/* if read ok then get values */
-					if (status == MB_SUCCESS)
-						{
-						pulse = (struct mbsys_3datdepthlidar_pulse_struct *)&store->pulses[i];
-						index = 0;
-						mb_get_binary_float(MB_YES, (void *) &buffer[index], &(pulse->range)); index += 4;
-						mb_get_binary_short(MB_YES, (void *) &buffer[index], &(pulse->amplitude)); index += 2;
-						mb_get_binary_float(MB_YES, (void *) &buffer[index], &(pulse->snr)); index += 4;
-						mb_get_binary_float(MB_YES, (void *) &buffer[index], &(pulse->cross_track_angle)); index += 4;
-						mb_get_binary_float(MB_YES, (void *) &buffer[index], &(pulse->forward_track_angle)); index += 4;
-						mb_get_binary_float(MB_YES, (void *) &buffer[index], &(pulse->cross_track_offset)); index += 4;
-						mb_get_binary_float(MB_YES, (void *) &buffer[index], &(pulse->forward_track_offset)); index += 4;
-						mb_get_binary_int(MB_YES, (void *) &buffer[index], &(pulse->pulse_time_offset)); index += 4;
-						pulse->saturated = buffer[index]; index++;
-						mb_get_binary_double(MB_YES, (void *) &buffer[index], &(pulse->time_d)); index += 8;
-						pulse->beamflag = buffer[index]; index++;
-						mb_get_binary_double(MB_YES, (void *) &buffer[index], &(pulse->acrosstrack)); index += 8;
-						mb_get_binary_double(MB_YES, (void *) &buffer[index], &(pulse->alongtrack)); index += 8;
-						mb_get_binary_double(MB_YES, (void *) &buffer[index], &(pulse->depth)); index += 8;
-						mb_get_binary_double(MB_YES, (void *) &buffer[index], &(pulse->navlon)); index += 8;
-						mb_get_binary_double(MB_YES, (void *) &buffer[index], &(pulse->navlat)); index += 8;
-						mb_get_binary_double(MB_YES, (void *) &buffer[index], &(pulse->sensordepth)); index += 8;
-						mb_get_binary_float(MB_YES, (void *) &buffer[index], &(pulse->heading)); index += 4;
-						mb_get_binary_float(MB_YES, (void *) &buffer[index], &(pulse->roll)); index += 4;
-						mb_get_binary_float(MB_YES, (void *) &buffer[index], &(pulse->pitch)); index += 4;
-						}
-					}
-				for (i=store->num_pulses;i<store->counts_per_scan;i++)
-					{
-					pulse = (struct mbsys_3datdepthlidar_pulse_struct *)&store->pulses[i];
-					pulse->range = 0.0;
-					pulse->amplitude = 0;
-					pulse->snr = 0.0;
-					pulse->cross_track_angle = 0.0;
-					pulse->forward_track_angle = 0.0;
-					pulse->cross_track_offset = 0.0;
-					pulse->forward_track_offset = 0.0;
-					pulse->pulse_time_offset = 0;
-					pulse->saturated = 0;
-					pulse->time_d = 0.0;
-					pulse->beamflag = MB_FLAG_NULL;
-					pulse->acrosstrack = 0.0;
-					pulse->alongtrack = 0.0;
-					pulse->depth = 0.0;
-					pulse->navlon = 0.0;
-					pulse->navlat = 0.0;
-					pulse->sensordepth = 0.0;
-					pulse->heading = 0.0;
-					pulse->roll = 0.0;
-					pulse->pitch = 0.0;
-					}
-				}
-			
-			store->kind = MB_DATA_DATA;
-			}
-		}
-		
-	/* else read next record in the obsolete format version 1.0
-			- LIDAR scans only with no record id's */
-	else if (status == MB_SUCCESS && done == MB_NO
-		&& store->file_version == 1 && store->sub_version == 0)
-		{
-//fprintf(stderr,"READ NEXT RECORD version %d %d\n",store->file_version,store->sub_version);
-			
-		/* read the next scan header */
-		if (mb_io_ptr->save2 == MB_NO)
-			{
-//fprintf(stderr,"No save, read full scan\n");
-			read_len = (size_t)MBF_3DDEPTHP_VERSION_1_0_SCANHEADER_SIZE;
-			status = mb_fileio_get(verbose, mbio_ptr, (void *) buffer, &read_len, error);
-			}
-		else
-			{
-//fprintf(stderr,"Bytes saved, read rest of scan\n");
-			for (i=0;i<4;i++)
-				buffer[i] = mb_io_ptr->save_label[i];
-			read_len = (size_t)(MBF_3DDEPTHP_VERSION_1_0_SCANHEADER_SIZE - 4);
-			status = mb_fileio_get(verbose, mbio_ptr, (void *) &buffer[4], &read_len, error);
-			mb_io_ptr->save2 = MB_NO;
-			}
-	
-		/* if read ok then get values */
-		if (status == MB_SUCCESS)
-			{
-			newscancheck = (unsigned int *) buffer;
-			newscancheckvalue = *newscancheck;
-			
-			store->current_scan++;
-			index = 0;
-			store->record_id = MBF_3DDEPTHP_RECORD_RAWLIDAR;
-			mb_get_binary_short(MB_YES, (void *) &buffer[index], &(store->year)); index += 2;
-			store->month = (mb_u_char) buffer[index]; index++;
-			store->day = (mb_u_char) buffer[index]; index++;
-			mb_get_binary_short(MB_YES, (void *) &buffer[index], &(store->days_since_jan_1)); index += 2;
-			mb_get_binary_short(MB_YES, (void *) &buffer[index], &(store->hour)); index += 2;
-			store->minutes = (mb_u_char) buffer[index]; index++;
-			store->seconds = (mb_u_char) buffer[index]; index++;
-			mb_get_binary_int(MB_YES, (void *) &buffer[index], &(store->nanoseconds)); index += 4;
-//fprintf(stderr,"DATE: %d %d %d  %d  %d %d %d  %d\n",store->year,store->month,store->day,store->days_since_jan_1,store->hour,store->minutes,store->seconds,store->nanoseconds);
-			store->bathymetry_calculated = MB_NO;
-			
-			/* fix timestamp problem with the original data files */
-			if (store->year < 2000)
-				{
-				store->year += 1900;
-				store->month++;
-				}
-
-			store->time_d = 0.0;
-			store->navlon = 0.0;
-			store->navlat = 0.0;
-			store->sensordepth = 0.0;
-			store->heading = 0.0;
-			store->roll = 0.0;
-			store->pitch = 0.0;
-			store->speed = 0.0;
-			}
-			
-		/* read all of the pulses */
-		if (status == MB_SUCCESS)
-			{
-			store->num_pulses = 0;
-			done = MB_NO;
-			while (done == MB_NO)
-				{
-				/* read the next four bytes */
-				read_len = (size_t)4;
-				status = mb_fileio_get(verbose, mbio_ptr, (void *) buffer, &read_len, error);
-				
-				/* if end of file reached handle it gracefully
-				   else check to see if the new pulse is valid or is really the start of a new scan
-				   by checking the first four bytes */
-				newscancheck = (unsigned int *) buffer;
-//fprintf(stderr,"Pulse %d header:%x  %f\n",store->num_pulses,*newscancheck, *((float *)newscancheck));
-				if (status == MB_FAILURE)
-					{
-					done = MB_YES;
-					status = MB_SUCCESS;
-					*error = MB_ERROR_NO_ERROR;
-					}
-				else if (*newscancheck == newscancheckvalue)
-					{
-					done = MB_YES;
-					mb_io_ptr->save2 = MB_YES;
-					for (i=0;i<4;i++)
-						mb_io_ptr->save_label[i] = buffer[i];
-					}
-				else
-					{
-					read_len = (size_t)(MBF_3DDEPTHP_VERSION_1_0_PULSE_SIZE - 4);
-					status = mb_fileio_get(verbose, mbio_ptr, (void *) &buffer[4], &read_len, error);							
-					if (status == MB_FAILURE)
-						done = MB_YES;
-					}
-			
-				/* if read ok and consistent with new pulse then get values */
-				if (status == MB_SUCCESS && done == MB_NO)
-					{
-					pulse = (struct mbsys_3datdepthlidar_pulse_struct *)&store->pulses[store->num_pulses];
-					index = 0;
-					mb_get_binary_float(MB_YES, (void *) &buffer[index], &(pulse->range)); index += 4;
-					mb_get_binary_short(MB_YES, (void *) &buffer[index], &(pulse->amplitude)); index += 2;
-					mb_get_binary_float(MB_YES, (void *) &buffer[index], &(pulse->snr)); index += 4;
-					mb_get_binary_float(MB_YES, (void *) &buffer[index], &(pulse->cross_track_angle)); index += 4;
-					mb_get_binary_float(MB_YES, (void *) &buffer[index], &(pulse->forward_track_angle)); index += 4;
-					mb_get_binary_float(MB_YES, (void *) &buffer[index], &(pulse->cross_track_offset)); index += 4;
-					mb_get_binary_float(MB_YES, (void *) &buffer[index], &(pulse->forward_track_offset)); index += 4;
-					mb_get_binary_int(MB_YES, (void *) &buffer[index], &(pulse->pulse_time_offset)); index += 4;
-					pulse->saturated = buffer[index]; index++;
-
-					pulse->time_d = 0.0;
-					pulse->beamflag = MB_FLAG_NULL;
-					pulse->acrosstrack = 0.0;
-					pulse->alongtrack = 0.0;
-					pulse->depth = 0.0;
-					pulse->navlon = 0.0;
-					pulse->navlat = 0.0;
-					pulse->sensordepth = 0.0;
-					pulse->heading = 0.0;
-					pulse->roll = 0.0;
-					pulse->pitch = 0.0;
-					
-					store->num_pulses++;
-					if (store->num_pulses >= store->counts_per_scan)
-						done = MB_YES;
-					}
-				}
-			for (i=store->num_pulses;i<store->counts_per_scan;i++)
-				{
-				pulse = (struct mbsys_3datdepthlidar_pulse_struct *)&store->pulses[i];
-				pulse->range = 0.0;
-				pulse->amplitude = 0;
-				pulse->snr = 0.0;
-				pulse->cross_track_angle = 0.0;
-				pulse->forward_track_angle = 0.0;
-				pulse->cross_track_offset = 0.0;
-				pulse->forward_track_offset = 0.0;
-				pulse->pulse_time_offset = 0;
-				pulse->saturated = 0;
-				pulse->time_d = 0.0;
-				pulse->beamflag = MB_FLAG_NULL;
-				pulse->acrosstrack = 0.0;
-				pulse->alongtrack = 0.0;
-				pulse->depth = 0.0;
-				pulse->navlon = 0.0;
-				pulse->navlat = 0.0;
-				pulse->sensordepth = 0.0;
-				pulse->heading = 0.0;
-				pulse->roll = 0.0;
-				pulse->pitch = 0.0;
-				}
-			
-			store->kind = MB_DATA_DATA;
-//fprintf(stderr,"READ %d pulses, save status:%d current_scan:%d\n",store->num_pulses,mb_io_ptr->save2,store->current_scan);
-			}
-		}
-
-	/* print out status info */
-	if (verbose >= 3 && status == MB_SUCCESS)
-		mbsys_3datdepthlidar_print_store(verbose, store_ptr, error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_3ddepthp_wr_data(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_3ddepthp_wr_data";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_3datdepthlidar_struct *store;
-	struct mbsys_3datdepthlidar_pulse_struct *pulse;
-	int	*file_header_readwritten;
-	char	buffer[MBF_3DDEPTHP_BUFFER_SIZE];
-	size_t	write_len;
-	size_t	index;
-	unsigned short record_id;
-	unsigned short magic_number;
-	unsigned short file_version;
-	unsigned short sub_version;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-
-	/* check for non-null pointers */
-	assert(mbio_ptr != NULL);
-	assert(store_ptr != NULL);
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-	store = (struct mbsys_3datdepthlidar_struct *) store_ptr;
-
-	/* get saved values */
-	file_header_readwritten = (int *) &mb_io_ptr->save1;
-
-	/* print output debug statements */
-	if (verbose >= 4)
-		{
-		fprintf(stderr,"\ndbg4  Data record kind in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg4       kind:       %d\n",store->kind);
-		}
-	
-	/* set status */
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-
-	/* if first write then write the magic number file header */
-	if (*file_header_readwritten == MB_NO)
-		{
-		/* write magic_number */
-		magic_number = MBF_3DDEPTHP_MAGICNUMBER;
-		
-		/* encode the header data */
-		index = 0;
-		mb_put_binary_short(MB_YES, magic_number, &buffer[index]); index += 2;
-
-		/* write file header from buffer */
-		write_len = (size_t)2;
-		status = mb_fileio_put(verbose, mbio_ptr, (void *) buffer, &write_len, error);
-		
-		/* set that header has been written */
-		*file_header_readwritten = MB_YES;
-		}
-
-	/* write next record */
-	if (status == MB_SUCCESS)
-		{
-		/* write comment record */
-		if (store->kind == MB_DATA_PARAMETER)
-			{
-			/* encode the data */
-			index = 0;
-			record_id = MBF_3DDEPTHP_RECORD_PARAMETER;
-			file_version = 1;
-			sub_version = 1;
-			mb_put_binary_short(MB_YES, record_id, &buffer[index]); index += 2;
-			mb_put_binary_short(MB_YES, file_version, &buffer[index]); index += 2;
-			mb_put_binary_short(MB_YES, sub_version, &buffer[index]); index += 2;
-			mb_put_binary_short(MB_YES, store->scan_type, &buffer[index]); index += 2;
-			mb_put_binary_float(MB_YES, store->cross_track_angle_start, &buffer[index]); index += 4;
-			mb_put_binary_float(MB_YES, store->cross_track_angle_end, &buffer[index]); index += 4;
-			mb_put_binary_float(MB_YES, store->forward_track_angle_start, &buffer[index]); index += 4;
-			mb_put_binary_float(MB_YES, store->forward_track_angle_end, &buffer[index]); index += 4;
-			mb_put_binary_short(MB_YES, store->counts_per_scan, &buffer[index]); index += 2;
-			mb_put_binary_short(MB_YES, store->counts_per_cross_track, &buffer[index]); index += 2;
-			mb_put_binary_short(MB_YES, store->counts_per_forward_track, &buffer[index]); index += 2;
-			mb_put_binary_short(MB_YES, store->scanner_efficiency, &buffer[index]); index += 2;
-			mb_put_binary_short(MB_YES, store->scans_per_file, &buffer[index]); index += 2;
-			mb_put_binary_int(MB_YES, store->scan_count, &buffer[index]); index += 4;
-	
-			/* write file header from buffer */
-			write_len = (size_t)MBF_3DDEPTHP_VERSION_1_1_PARAMETER_SIZE;
-			status = mb_fileio_put(verbose, mbio_ptr, (void *) buffer, &write_len, error);
-			}
-
-		/* write comment record */
-		else if (store->kind == MB_DATA_COMMENT)
-			{
-			/* encode the data */
-			index = 0;
-			store->record_id = MBF_3DDEPTHP_RECORD_COMMENT;
-			mb_put_binary_short(MB_YES, store->record_id, &buffer[index]); index += 2;
-			mb_put_binary_short(MB_YES, store->comment_len, &buffer[index]); index += 2;
-			
-			/* write comment record */
-			write_len = (size_t) index;
-			status = mb_fileio_put(verbose, mbio_ptr, (void *) buffer, &write_len, error);
-			write_len = (size_t) store->comment_len;
-			status = mb_fileio_put(verbose, mbio_ptr, (void *) &store->comment, &write_len, error);
-			}
-
-		/* write position record */
-		else if (store->kind == MB_DATA_NAV)
-			{
-			/* encode the data */
-			index = 0;
-			store->record_id = MBF_3DDEPTHP_RECORD_POSITION;
-			mb_put_binary_short(MB_YES, store->record_id, &buffer[index]); index += 2;
-			mb_put_binary_double(MB_YES, store->pos_time_d, &buffer[index]); index += sizeof(double);
-			mb_put_binary_double(MB_YES, store->pos_longitude, &buffer[index]); index += sizeof(double);
-			mb_put_binary_double(MB_YES, store->pos_latitude, &buffer[index]); index += sizeof(double);
-			
-			/* write position record */
-			write_len = (size_t) index;
-			status = mb_fileio_put(verbose, mbio_ptr, (void *) buffer, &write_len, error);
-			}
-
-		/* write attitude record */
-		else if (store->kind == MB_DATA_ATTITUDE)
-			{
-			/* encode the data */
-			index = 0;
-			store->record_id = MBF_3DDEPTHP_RECORD_ATTITUDE;
-			mb_put_binary_short(MB_YES, store->record_id, &buffer[index]); index += 2;
-			mb_put_binary_double(MB_YES, store->att_time_d, &buffer[index]); index += sizeof(double);
-			mb_put_binary_double(MB_YES, store->att_roll, &buffer[index]); index += sizeof(double);
-			mb_put_binary_double(MB_YES, store->att_pitch, &buffer[index]); index += sizeof(double);
-			mb_put_binary_double(MB_YES, store->att_heave, &buffer[index]); index += sizeof(double);
-			
-			/* write attitude record */
-			write_len = (size_t) index;
-			status = mb_fileio_put(verbose, mbio_ptr, (void *) buffer, &write_len, error);
-			}
-
-		/* write heading record */
-		else if (store->kind == MB_DATA_HEADING)
-			{
-			/* encode the data */
-			index = 0;
-			store->record_id = MBF_3DDEPTHP_RECORD_HEADING;
-			mb_put_binary_short(MB_YES, store->record_id, &buffer[index]); index += 2;
-			mb_put_binary_double(MB_YES, store->hdg_time_d, &buffer[index]); index += sizeof(double);
-			mb_put_binary_double(MB_YES, store->hdg_heading, &buffer[index]); index += sizeof(double);
-			
-			/* write heading record */
-			write_len = (size_t) index;
-			status = mb_fileio_put(verbose, mbio_ptr, (void *) buffer, &write_len, error);
-			}
-
-		/* write sensordepth record */
-		else if (store->kind == MB_DATA_SONARDEPTH)
-			{
-			/* encode the data */
-			index = 0;
-			store->record_id = MBF_3DDEPTHP_RECORD_SENSORDEPTH;
-			mb_put_binary_short(MB_YES, store->record_id, &buffer[index]); index += 2;
-			mb_put_binary_double(MB_YES, store->sdp_time_d, &buffer[index]); index += sizeof(double);
-			mb_put_binary_double(MB_YES, store->sdp_sensordepth, &buffer[index]); index += sizeof(double);
-			
-			/* write sensordepth record */
-			write_len = (size_t) index;
-			status = mb_fileio_put(verbose, mbio_ptr, (void *) buffer, &write_len, error);
-			}
-
-		/* write LIDAR scan record */
-		else if (store->kind == MB_DATA_DATA)
-			{
-			/* encode the data */
-			index = 0;
-			store->record_id = MBF_3DDEPTHP_RECORD_LIDAR;
-			mb_put_binary_short(MB_YES, store->record_id, &buffer[index]); index += 2;
-			mb_put_binary_short(MB_YES, store->year, &buffer[index]); index += 2;
-			buffer[index] = (mb_u_char) store->month; index++;
-			buffer[index] = (mb_u_char) store->day; index++;
-			mb_put_binary_short(MB_YES, store->days_since_jan_1, &buffer[index]); index += 2;
-			mb_put_binary_short(MB_YES, store->hour, &buffer[index]); index += 2;
-			buffer[index] = (mb_u_char) store->minutes; index++;
-			buffer[index] = (mb_u_char) store->seconds; index++;
-			mb_put_binary_int(MB_YES, store->nanoseconds, &buffer[index]); index += 4;
-			mb_put_binary_double(MB_YES, store->time_d, &buffer[index]); index += 8;
-			mb_put_binary_double(MB_YES, store->navlon, &buffer[index]); index += 8;
-			mb_put_binary_double(MB_YES, store->navlat, &buffer[index]); index += 8;
-			mb_put_binary_double(MB_YES, store->sensordepth, &buffer[index]); index += 8;
-			mb_put_binary_float(MB_YES, store->heading, &buffer[index]); index += 4;
-			mb_put_binary_float(MB_YES, store->roll, &buffer[index]); index += 4;
-			mb_put_binary_float(MB_YES, store->pitch, &buffer[index]); index += 4;
-			mb_put_binary_float(MB_YES, store->speed, &buffer[index]); index += 4;
-			mb_put_binary_int(MB_YES, store->num_pulses, &buffer[index]); index += 4;
-			
-			/* write LIDAR scan record header */
-			write_len = (size_t) index;
-			status = mb_fileio_put(verbose, mbio_ptr, (void *) buffer, &write_len, error);
-			
-			/* write LIDAR scan pulses */
-			if (status == MB_SUCCESS)
-				{
-				for (i=0;i<store->num_pulses;i++)
-					{
-					/* encode the data */
-					pulse = (struct mbsys_3datdepthlidar_pulse_struct *)&store->pulses[i];
-					index = 0;
-					mb_put_binary_float(MB_YES, pulse->range, &buffer[index]); index += 4;
-					mb_put_binary_short(MB_YES, pulse->amplitude, &buffer[index]); index += 2;
-					mb_put_binary_float(MB_YES, pulse->snr, &buffer[index]); index += 4;
-					mb_put_binary_float(MB_YES, pulse->cross_track_angle, &buffer[index]); index += 4;
-					mb_put_binary_float(MB_YES, pulse->forward_track_angle, &buffer[index]); index += 4;
-					mb_put_binary_float(MB_YES, pulse->cross_track_offset, &buffer[index]); index += 4;
-					mb_put_binary_float(MB_YES, pulse->forward_track_offset, &buffer[index]); index += 4;
-					mb_put_binary_int(MB_YES, pulse->pulse_time_offset, &buffer[index]); index += 4;
-					buffer[index] = pulse->saturated; index++;
-					mb_put_binary_double(MB_YES, pulse->time_d, &buffer[index]); index += 8;
-					buffer[index] = pulse->beamflag; index++;
-					mb_put_binary_double(MB_YES, pulse->acrosstrack, &buffer[index]); index += 8;
-					mb_put_binary_double(MB_YES, pulse->alongtrack, &buffer[index]); index += 8;
-					mb_put_binary_double(MB_YES, pulse->depth, &buffer[index]); index += 8;
-					mb_put_binary_double(MB_YES, pulse->navlon, &buffer[index]); index += 8;
-					mb_put_binary_double(MB_YES, pulse->navlat, &buffer[index]); index += 8;
-					mb_put_binary_double(MB_YES, pulse->sensordepth, &buffer[index]); index += 8;
-					mb_put_binary_float(MB_YES, pulse->heading, &buffer[index]); index += 4;
-					mb_put_binary_float(MB_YES, pulse->roll, &buffer[index]); index += 4;
-					mb_put_binary_float(MB_YES, pulse->pitch, &buffer[index]); index += 4;
-			
-					/* write LIDAR scan pulse record */
-					write_len = (size_t) index;
-					status = mb_fileio_put(verbose, mbio_ptr, (void *) buffer, &write_len, error);
-					}
-				}
-			}
-		}
-		
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mbr_asciixyz.c b/src/mbio/mbr_asciixyz.c
deleted file mode 100644
index 201182f..0000000
--- a/src/mbio/mbr_asciixyz.c
+++ /dev/null
@@ -1,1305 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbr_asciixyz.c	5/8/2002
- *	$Id: mbr_asciixyz.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 2002-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbr_asciixyz.c contains the functions for reading and writing
- * simple ASCII lon lat depth sounding files in four configurations:
- *    xyz: (longitude latitude  depth)          Format MBF_ASCIIXYZ 162
- *    yxz: (latitude  longitude depth)          Format MBF_ASCIIYXZ 163
- *    xyz: (longitude latitude  topography)     Format MBF_ASCIIXYT 168
- *    yxz: (latitude  longitude topography)     Format MBF_ASCIIYXT 169
- * These functions include:
- *   mbr_alm_asciixyz	- allocate read/write memory
- *   mbr_dem_asciixyz	- deallocate read/write memory
- *   mbr_rt_asciixyz	- read and translate data
- *   mbr_wt_asciixyz	- translate and write data
- *
- * Author:	D. W. Caress
- * Date:	May 8, 2002
- *
- * $Log: mbr_asciixyz.c,v $
- * Revision 5.7  2008/07/10 06:43:40  caress
- * Preparing for 5.1.1beta20
- *
- * Revision 5.6  2006/04/11 19:14:46  caress
- * Various fixes.
- *
- * Revision 5.5  2006/03/06 21:47:48  caress
- * Implemented changes suggested by Bob Courtney of the Geological Survey of Canada to support translating Reson data to GSF.
- *
- * Revision 5.4  2005/11/05 00:48:03  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.3  2003/09/23 21:05:12  caress
- * Added formats 168 and 169 for reading xyt and yxt triples (topography instead of depth).
- *
- * Revision 5.2  2003/05/20 18:05:32  caress
- * Added svp_source to data source parameters.
- *
- * Revision 5.1  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.0  2002/05/29 23:37:38  caress
- * Release 5.0.beta18
- *
- *
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mb_define.h"
-#include "mbsys_singlebeam.h"
-
-/* get NaN detector */
-#if defined(isnand)
-#define check_dnan(x) isnand((x))
-#elif defined(isnan)
-#define check_dnan(x) isnan((double)(x))
-#elif HAVE_ISNAND == 1
-#define check_dnan(x) isnand(x)
-extern int isnand(float x);
-#elif HAVE_ISNAN == 1
-#define check_dnan(x) isnan(x)
-#elif HAVE_ISNAND == 1
-#define check_dnan(x) isnand(x)
-#else
-#define check_dnan(x) ((x) != (x))
-#endif
-
-/* essential function prototypes */
-int mbr_register_asciixyz(int verbose, void *mbio_ptr,
-		int *error);
-int mbr_info_asciixyz(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_alm_asciixyz(int verbose, void *mbio_ptr, int *error);
-int mbr_dem_asciixyz(int verbose, void *mbio_ptr, int *error);
-int mbr_rt_asciixyz(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_wt_asciixyz(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-
-static char rcs_id[]="$Id: mbr_asciixyz.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mbr_register_asciixyz(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_register_asciixyz";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* get mb_io_ptr */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set format info parameters */
-	status = mbr_info_asciixyz(verbose,
-			&mb_io_ptr->system,
-			&mb_io_ptr->beams_bath_max,
-			&mb_io_ptr->beams_amp_max,
-			&mb_io_ptr->pixels_ss_max,
-			mb_io_ptr->format_name,
-			mb_io_ptr->system_name,
-			mb_io_ptr->format_description,
-			&mb_io_ptr->numfile,
-			&mb_io_ptr->filetype,
-			&mb_io_ptr->variable_beams,
-			&mb_io_ptr->traveltime,
-			&mb_io_ptr->beam_flagging,
-			&mb_io_ptr->nav_source,
-			&mb_io_ptr->heading_source,
-			&mb_io_ptr->vru_source,
-			&mb_io_ptr->svp_source,
-			&mb_io_ptr->beamwidth_xtrack,
-			&mb_io_ptr->beamwidth_ltrack,
-			error);
-
-	/* set format and system specific function pointers */
-	mb_io_ptr->mb_io_format_alloc = &mbr_alm_asciixyz;
-	mb_io_ptr->mb_io_format_free = &mbr_dem_asciixyz;
-	mb_io_ptr->mb_io_store_alloc = &mbsys_singlebeam_alloc;
-	mb_io_ptr->mb_io_store_free = &mbsys_singlebeam_deall;
-	mb_io_ptr->mb_io_read_ping = &mbr_rt_asciixyz;
-	mb_io_ptr->mb_io_write_ping = &mbr_wt_asciixyz;
-	mb_io_ptr->mb_io_dimensions = &mbsys_singlebeam_dimensions;
-	mb_io_ptr->mb_io_extract = &mbsys_singlebeam_extract;
-	mb_io_ptr->mb_io_insert = &mbsys_singlebeam_insert;
-	mb_io_ptr->mb_io_extract_nav = &mbsys_singlebeam_extract_nav;
-	mb_io_ptr->mb_io_insert_nav = &mbsys_singlebeam_insert_nav;
-	mb_io_ptr->mb_io_extract_altitude = &mbsys_singlebeam_extract_altitude;
-	mb_io_ptr->mb_io_insert_altitude = NULL;
-	mb_io_ptr->mb_io_extract_svp = NULL;
-	mb_io_ptr->mb_io_insert_svp = NULL;
-	mb_io_ptr->mb_io_ttimes = &mbsys_singlebeam_ttimes;
-	mb_io_ptr->mb_io_detects = &mbsys_singlebeam_detects;
-	mb_io_ptr->mb_io_copyrecord = &mbsys_singlebeam_copy;
-	mb_io_ptr->mb_io_extract_rawss = NULL;
-	mb_io_ptr->mb_io_insert_rawss = NULL;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",mb_io_ptr->system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",mb_io_ptr->beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",mb_io_ptr->beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",mb_io_ptr->pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",mb_io_ptr->format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",mb_io_ptr->system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",mb_io_ptr->format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",mb_io_ptr->numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",mb_io_ptr->filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",mb_io_ptr->variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",mb_io_ptr->traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",mb_io_ptr->beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",mb_io_ptr->nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",mb_io_ptr->heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",mb_io_ptr->vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",mb_io_ptr->svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",mb_io_ptr->beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",mb_io_ptr->beamwidth_ltrack);
-		fprintf(stderr,"dbg2       format_alloc:       %p\n",(void *)mb_io_ptr->mb_io_format_alloc);
-		fprintf(stderr,"dbg2       format_free:        %p\n",(void *)mb_io_ptr->mb_io_format_free);
-		fprintf(stderr,"dbg2       store_alloc:        %p\n",(void *)mb_io_ptr->mb_io_store_alloc);
-		fprintf(stderr,"dbg2       store_free:         %p\n",(void *)mb_io_ptr->mb_io_store_free);
-		fprintf(stderr,"dbg2       read_ping:          %p\n",(void *)mb_io_ptr->mb_io_read_ping);
-		fprintf(stderr,"dbg2       write_ping:         %p\n",(void *)mb_io_ptr->mb_io_write_ping);
-		fprintf(stderr,"dbg2       extract:            %p\n",(void *)mb_io_ptr->mb_io_extract);
-		fprintf(stderr,"dbg2       insert:             %p\n",(void *)mb_io_ptr->mb_io_insert);
-		fprintf(stderr,"dbg2       extract_nav:        %p\n",(void *)mb_io_ptr->mb_io_extract_nav);
-		fprintf(stderr,"dbg2       insert_nav:         %p\n",(void *)mb_io_ptr->mb_io_insert_nav);
-		fprintf(stderr,"dbg2       extract_altitude:   %p\n",(void *)mb_io_ptr->mb_io_extract_altitude);
-		fprintf(stderr,"dbg2       insert_altitude:    %p\n",(void *)mb_io_ptr->mb_io_insert_altitude);
-		fprintf(stderr,"dbg2       extract_svp:        %p\n",(void *)mb_io_ptr->mb_io_extract_svp);
-		fprintf(stderr,"dbg2       insert_svp:         %p\n",(void *)mb_io_ptr->mb_io_insert_svp);
-		fprintf(stderr,"dbg2       ttimes:             %p\n",(void *)mb_io_ptr->mb_io_ttimes);
-		fprintf(stderr,"dbg2       detects:            %p\n",(void *)mb_io_ptr->mb_io_detects);
-		fprintf(stderr,"dbg2       extract_rawss:      %p\n",(void *)mb_io_ptr->mb_io_extract_rawss);
-		fprintf(stderr,"dbg2       insert_rawss:       %p\n",(void *)mb_io_ptr->mb_io_insert_rawss);
-		fprintf(stderr,"dbg2       copyrecord:         %p\n",(void *)mb_io_ptr->mb_io_copyrecord);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbr_info_asciixyz(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error)
-{
-	char	*function_name = "mbr_info_asciixyz";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* set format info parameters */
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-	*system = MB_SYS_SINGLEBEAM;
-	*beams_bath_max = 1;
-	*beams_amp_max = 0;
-	*pixels_ss_max = 0;
-	strncpy(format_name, "ASCIIXYZ", MB_NAME_LENGTH);
-	strncpy(system_name, "SINGLEBEAM", MB_NAME_LENGTH);
-	strncpy(format_description, "Format name:          MBF_ASCIIXYZ\nInformal Description: Generic XYZ sounding format\nAttributes:           XYZ (lon lat depth) ASCII soundings, generic\n", MB_DESCRIPTION_LENGTH);
-	*numfile = 1;
-	*filetype = MB_FILETYPE_NORMAL;
-	*variable_beams = MB_NO;
-	*traveltime = MB_NO;
-	*beam_flagging = MB_YES;
-	*nav_source = MB_DATA_DATA;
-	*heading_source = MB_DATA_DATA;
-	*vru_source = MB_DATA_DATA;
-	*svp_source = MB_DATA_NONE;
-	*beamwidth_xtrack = 4.0;
-	*beamwidth_ltrack = 4.0;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",*system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",*beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",*beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",*pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",*numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",*filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",*variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",*traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",*beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",*nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",*heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",*vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",*svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",*beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",*beamwidth_ltrack);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_register_asciiyxz(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_register_asciiyxz";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* get mb_io_ptr */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set format info parameters */
-	status = mbr_info_asciiyxz(verbose,
-			&mb_io_ptr->system,
-			&mb_io_ptr->beams_bath_max,
-			&mb_io_ptr->beams_amp_max,
-			&mb_io_ptr->pixels_ss_max,
-			mb_io_ptr->format_name,
-			mb_io_ptr->system_name,
-			mb_io_ptr->format_description,
-			&mb_io_ptr->numfile,
-			&mb_io_ptr->filetype,
-			&mb_io_ptr->variable_beams,
-			&mb_io_ptr->traveltime,
-			&mb_io_ptr->beam_flagging,
-			&mb_io_ptr->nav_source,
-			&mb_io_ptr->heading_source,
-			&mb_io_ptr->vru_source,
-			&mb_io_ptr->svp_source,
-			&mb_io_ptr->beamwidth_xtrack,
-			&mb_io_ptr->beamwidth_ltrack,
-			error);
-
-	/* set format and system specific function pointers */
-	mb_io_ptr->mb_io_format_alloc = &mbr_alm_asciixyz;
-	mb_io_ptr->mb_io_format_free = &mbr_dem_asciixyz;
-	mb_io_ptr->mb_io_store_alloc = &mbsys_singlebeam_alloc;
-	mb_io_ptr->mb_io_store_free = &mbsys_singlebeam_deall;
-	mb_io_ptr->mb_io_read_ping = &mbr_rt_asciixyz;
-	mb_io_ptr->mb_io_write_ping = &mbr_wt_asciixyz;
-	mb_io_ptr->mb_io_dimensions = &mbsys_singlebeam_dimensions;
-	mb_io_ptr->mb_io_extract = &mbsys_singlebeam_extract;
-	mb_io_ptr->mb_io_insert = &mbsys_singlebeam_insert;
-	mb_io_ptr->mb_io_extract_nav = &mbsys_singlebeam_extract_nav;
-	mb_io_ptr->mb_io_insert_nav = &mbsys_singlebeam_insert_nav;
-	mb_io_ptr->mb_io_extract_altitude = &mbsys_singlebeam_extract_altitude;
-	mb_io_ptr->mb_io_insert_altitude = NULL;
-	mb_io_ptr->mb_io_extract_svp = NULL;
-	mb_io_ptr->mb_io_insert_svp = NULL;
-	mb_io_ptr->mb_io_ttimes = &mbsys_singlebeam_ttimes;
-	mb_io_ptr->mb_io_copyrecord = &mbsys_singlebeam_copy;
-	mb_io_ptr->mb_io_extract_rawss = NULL;
-	mb_io_ptr->mb_io_insert_rawss = NULL;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",mb_io_ptr->system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",mb_io_ptr->beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",mb_io_ptr->beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",mb_io_ptr->pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",mb_io_ptr->format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",mb_io_ptr->system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",mb_io_ptr->format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",mb_io_ptr->numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",mb_io_ptr->filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",mb_io_ptr->variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",mb_io_ptr->traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",mb_io_ptr->beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",mb_io_ptr->nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",mb_io_ptr->heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",mb_io_ptr->vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",mb_io_ptr->svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",mb_io_ptr->beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",mb_io_ptr->beamwidth_ltrack);
-		fprintf(stderr,"dbg2       format_alloc:       %p\n",(void *)mb_io_ptr->mb_io_format_alloc);
-		fprintf(stderr,"dbg2       format_free:        %p\n",(void *)mb_io_ptr->mb_io_format_free);
-		fprintf(stderr,"dbg2       store_alloc:        %p\n",(void *)mb_io_ptr->mb_io_store_alloc);
-		fprintf(stderr,"dbg2       store_free:         %p\n",(void *)mb_io_ptr->mb_io_store_free);
-		fprintf(stderr,"dbg2       read_ping:          %p\n",(void *)mb_io_ptr->mb_io_read_ping);
-		fprintf(stderr,"dbg2       write_ping:         %p\n",(void *)mb_io_ptr->mb_io_write_ping);
-		fprintf(stderr,"dbg2       extract:            %p\n",(void *)mb_io_ptr->mb_io_extract);
-		fprintf(stderr,"dbg2       insert:             %p\n",(void *)mb_io_ptr->mb_io_insert);
-		fprintf(stderr,"dbg2       extract_nav:        %p\n",(void *)mb_io_ptr->mb_io_extract_nav);
-		fprintf(stderr,"dbg2       insert_nav:         %p\n",(void *)mb_io_ptr->mb_io_insert_nav);
-		fprintf(stderr,"dbg2       extract_altitude:   %p\n",(void *)mb_io_ptr->mb_io_extract_altitude);
-		fprintf(stderr,"dbg2       insert_altitude:    %p\n",(void *)mb_io_ptr->mb_io_insert_altitude);
-		fprintf(stderr,"dbg2       extract_svp:        %p\n",(void *)mb_io_ptr->mb_io_extract_svp);
-		fprintf(stderr,"dbg2       insert_svp:         %p\n",(void *)mb_io_ptr->mb_io_insert_svp);
-		fprintf(stderr,"dbg2       ttimes:             %p\n",(void *)mb_io_ptr->mb_io_ttimes);
-		fprintf(stderr,"dbg2       extract_rawss:      %p\n",(void *)mb_io_ptr->mb_io_extract_rawss);
-		fprintf(stderr,"dbg2       insert_rawss:       %p\n",(void *)mb_io_ptr->mb_io_insert_rawss);
-		fprintf(stderr,"dbg2       copyrecord:         %p\n",(void *)mb_io_ptr->mb_io_copyrecord);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbr_info_asciiyxz(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error)
-{
-	char	*function_name = "mbr_info_asciiyxz";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* set format info parameters */
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-	*system = MB_SYS_SINGLEBEAM;
-	*beams_bath_max = 1;
-	*beams_amp_max = 0;
-	*pixels_ss_max = 0;
-	strncpy(format_name, "ASCIIYXZ", MB_NAME_LENGTH);
-	strncpy(system_name, "SINGLEBEAM", MB_NAME_LENGTH);
-	strncpy(format_description, "Format name:          MBF_ASCIIYXZ\nInformal Description: Generic YXZ sounding format\nAttributes:           YXZ (lat lon depth) ASCII soundings, generic\n", MB_DESCRIPTION_LENGTH);
-	*numfile = 1;
-	*filetype = MB_FILETYPE_NORMAL;
-	*variable_beams = MB_NO;
-	*traveltime = MB_NO;
-	*beam_flagging = MB_YES;
-	*nav_source = MB_DATA_DATA;
-	*heading_source = MB_DATA_DATA;
-	*vru_source = MB_DATA_DATA;
-	*svp_source = MB_DATA_NONE;
-	*beamwidth_xtrack = 4.0;
-	*beamwidth_ltrack = 4.0;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",*system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",*beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",*beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",*pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",*numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",*filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",*variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",*traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",*beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",*nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",*heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",*vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",*svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",*beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",*beamwidth_ltrack);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_register_asciixyt(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_register_asciixyt";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* get mb_io_ptr */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set format info parameters */
-	status = mbr_info_asciixyt(verbose,
-			&mb_io_ptr->system,
-			&mb_io_ptr->beams_bath_max,
-			&mb_io_ptr->beams_amp_max,
-			&mb_io_ptr->pixels_ss_max,
-			mb_io_ptr->format_name,
-			mb_io_ptr->system_name,
-			mb_io_ptr->format_description,
-			&mb_io_ptr->numfile,
-			&mb_io_ptr->filetype,
-			&mb_io_ptr->variable_beams,
-			&mb_io_ptr->traveltime,
-			&mb_io_ptr->beam_flagging,
-			&mb_io_ptr->nav_source,
-			&mb_io_ptr->heading_source,
-			&mb_io_ptr->vru_source,
-			&mb_io_ptr->svp_source,
-			&mb_io_ptr->beamwidth_xtrack,
-			&mb_io_ptr->beamwidth_ltrack,
-			error);
-
-	/* set format and system specific function pointers */
-	mb_io_ptr->mb_io_format_alloc = &mbr_alm_asciixyz;
-	mb_io_ptr->mb_io_format_free = &mbr_dem_asciixyz;
-	mb_io_ptr->mb_io_store_alloc = &mbsys_singlebeam_alloc;
-	mb_io_ptr->mb_io_store_free = &mbsys_singlebeam_deall;
-	mb_io_ptr->mb_io_read_ping = &mbr_rt_asciixyz;
-	mb_io_ptr->mb_io_write_ping = &mbr_wt_asciixyz;
-	mb_io_ptr->mb_io_dimensions = &mbsys_singlebeam_dimensions;
-	mb_io_ptr->mb_io_extract = &mbsys_singlebeam_extract;
-	mb_io_ptr->mb_io_insert = &mbsys_singlebeam_insert;
-	mb_io_ptr->mb_io_extract_nav = &mbsys_singlebeam_extract_nav;
-	mb_io_ptr->mb_io_insert_nav = &mbsys_singlebeam_insert_nav;
-	mb_io_ptr->mb_io_extract_altitude = &mbsys_singlebeam_extract_altitude;
-	mb_io_ptr->mb_io_insert_altitude = NULL;
-	mb_io_ptr->mb_io_extract_svp = NULL;
-	mb_io_ptr->mb_io_insert_svp = NULL;
-	mb_io_ptr->mb_io_ttimes = &mbsys_singlebeam_ttimes;
-	mb_io_ptr->mb_io_copyrecord = &mbsys_singlebeam_copy;
-	mb_io_ptr->mb_io_extract_rawss = NULL;
-	mb_io_ptr->mb_io_insert_rawss = NULL;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",mb_io_ptr->system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",mb_io_ptr->beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",mb_io_ptr->beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",mb_io_ptr->pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",mb_io_ptr->format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",mb_io_ptr->system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",mb_io_ptr->format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",mb_io_ptr->numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",mb_io_ptr->filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",mb_io_ptr->variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",mb_io_ptr->traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",mb_io_ptr->beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",mb_io_ptr->nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",mb_io_ptr->heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",mb_io_ptr->vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",mb_io_ptr->svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",mb_io_ptr->beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",mb_io_ptr->beamwidth_ltrack);
-		fprintf(stderr,"dbg2       format_alloc:       %p\n",(void *)mb_io_ptr->mb_io_format_alloc);
-		fprintf(stderr,"dbg2       format_free:        %p\n",(void *)mb_io_ptr->mb_io_format_free);
-		fprintf(stderr,"dbg2       store_alloc:        %p\n",(void *)mb_io_ptr->mb_io_store_alloc);
-		fprintf(stderr,"dbg2       store_free:         %p\n",(void *)mb_io_ptr->mb_io_store_free);
-		fprintf(stderr,"dbg2       read_ping:          %p\n",(void *)mb_io_ptr->mb_io_read_ping);
-		fprintf(stderr,"dbg2       write_ping:         %p\n",(void *)mb_io_ptr->mb_io_write_ping);
-		fprintf(stderr,"dbg2       extract:            %p\n",(void *)mb_io_ptr->mb_io_extract);
-		fprintf(stderr,"dbg2       insert:             %p\n",(void *)mb_io_ptr->mb_io_insert);
-		fprintf(stderr,"dbg2       extract_nav:        %p\n",(void *)mb_io_ptr->mb_io_extract_nav);
-		fprintf(stderr,"dbg2       insert_nav:         %p\n",(void *)mb_io_ptr->mb_io_insert_nav);
-		fprintf(stderr,"dbg2       extract_altitude:   %p\n",(void *)mb_io_ptr->mb_io_extract_altitude);
-		fprintf(stderr,"dbg2       insert_altitude:    %p\n",(void *)mb_io_ptr->mb_io_insert_altitude);
-		fprintf(stderr,"dbg2       extract_svp:        %p\n",(void *)mb_io_ptr->mb_io_extract_svp);
-		fprintf(stderr,"dbg2       insert_svp:         %p\n",(void *)mb_io_ptr->mb_io_insert_svp);
-		fprintf(stderr,"dbg2       ttimes:             %p\n",(void *)mb_io_ptr->mb_io_ttimes);
-		fprintf(stderr,"dbg2       extract_rawss:      %p\n",(void *)mb_io_ptr->mb_io_extract_rawss);
-		fprintf(stderr,"dbg2       insert_rawss:       %p\n",(void *)mb_io_ptr->mb_io_insert_rawss);
-		fprintf(stderr,"dbg2       copyrecord:         %p\n",(void *)mb_io_ptr->mb_io_copyrecord);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbr_info_asciixyt(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error)
-{
-	char	*function_name = "mbr_info_asciixyt";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* set format info parameters */
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-	*system = MB_SYS_SINGLEBEAM;
-	*beams_bath_max = 1;
-	*beams_amp_max = 0;
-	*pixels_ss_max = 0;
-	strncpy(format_name, "ASCIIXYT", MB_NAME_LENGTH);
-	strncpy(system_name, "SINGLEBEAM", MB_NAME_LENGTH);
-	strncpy(format_description, "Format name:          MBF_ASCIIXYT\nInformal Description: Generic XYT sounding format\nAttributes:           XYT (lon lat topography) ASCII soundings, generic\n", MB_DESCRIPTION_LENGTH);
-	*numfile = 1;
-	*filetype = MB_FILETYPE_NORMAL;
-	*variable_beams = MB_NO;
-	*traveltime = MB_NO;
-	*beam_flagging = MB_YES;
-	*nav_source = MB_DATA_DATA;
-	*heading_source = MB_DATA_DATA;
-	*vru_source = MB_DATA_DATA;
-	*svp_source = MB_DATA_NONE;
-	*beamwidth_xtrack = 4.0;
-	*beamwidth_ltrack = 4.0;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",*system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",*beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",*beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",*pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",*numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",*filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",*variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",*traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",*beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",*nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",*heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",*vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",*svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",*beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",*beamwidth_ltrack);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_register_asciiyxt(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_register_asciiyxt";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* get mb_io_ptr */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set format info parameters */
-	status = mbr_info_asciiyxt(verbose,
-			&mb_io_ptr->system,
-			&mb_io_ptr->beams_bath_max,
-			&mb_io_ptr->beams_amp_max,
-			&mb_io_ptr->pixels_ss_max,
-			mb_io_ptr->format_name,
-			mb_io_ptr->system_name,
-			mb_io_ptr->format_description,
-			&mb_io_ptr->numfile,
-			&mb_io_ptr->filetype,
-			&mb_io_ptr->variable_beams,
-			&mb_io_ptr->traveltime,
-			&mb_io_ptr->beam_flagging,
-			&mb_io_ptr->nav_source,
-			&mb_io_ptr->heading_source,
-			&mb_io_ptr->vru_source,
-			&mb_io_ptr->svp_source,
-			&mb_io_ptr->beamwidth_xtrack,
-			&mb_io_ptr->beamwidth_ltrack,
-			error);
-
-	/* set format and system specific function pointers */
-	mb_io_ptr->mb_io_format_alloc = &mbr_alm_asciixyz;
-	mb_io_ptr->mb_io_format_free = &mbr_dem_asciixyz;
-	mb_io_ptr->mb_io_store_alloc = &mbsys_singlebeam_alloc;
-	mb_io_ptr->mb_io_store_free = &mbsys_singlebeam_deall;
-	mb_io_ptr->mb_io_read_ping = &mbr_rt_asciixyz;
-	mb_io_ptr->mb_io_write_ping = &mbr_wt_asciixyz;
-	mb_io_ptr->mb_io_dimensions = &mbsys_singlebeam_dimensions;
-	mb_io_ptr->mb_io_extract = &mbsys_singlebeam_extract;
-	mb_io_ptr->mb_io_insert = &mbsys_singlebeam_insert;
-	mb_io_ptr->mb_io_extract_nav = &mbsys_singlebeam_extract_nav;
-	mb_io_ptr->mb_io_insert_nav = &mbsys_singlebeam_insert_nav;
-	mb_io_ptr->mb_io_extract_altitude = &mbsys_singlebeam_extract_altitude;
-	mb_io_ptr->mb_io_insert_altitude = NULL;
-	mb_io_ptr->mb_io_extract_svp = NULL;
-	mb_io_ptr->mb_io_insert_svp = NULL;
-	mb_io_ptr->mb_io_ttimes = &mbsys_singlebeam_ttimes;
-	mb_io_ptr->mb_io_copyrecord = &mbsys_singlebeam_copy;
-	mb_io_ptr->mb_io_extract_rawss = NULL;
-	mb_io_ptr->mb_io_insert_rawss = NULL;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",mb_io_ptr->system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",mb_io_ptr->beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",mb_io_ptr->beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",mb_io_ptr->pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",mb_io_ptr->format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",mb_io_ptr->system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",mb_io_ptr->format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",mb_io_ptr->numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",mb_io_ptr->filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",mb_io_ptr->variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",mb_io_ptr->traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",mb_io_ptr->beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",mb_io_ptr->nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",mb_io_ptr->heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",mb_io_ptr->vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",mb_io_ptr->svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",mb_io_ptr->beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",mb_io_ptr->beamwidth_ltrack);
-		fprintf(stderr,"dbg2       format_alloc:       %p\n",(void *)mb_io_ptr->mb_io_format_alloc);
-		fprintf(stderr,"dbg2       format_free:        %p\n",(void *)mb_io_ptr->mb_io_format_free);
-		fprintf(stderr,"dbg2       store_alloc:        %p\n",(void *)mb_io_ptr->mb_io_store_alloc);
-		fprintf(stderr,"dbg2       store_free:         %p\n",(void *)mb_io_ptr->mb_io_store_free);
-		fprintf(stderr,"dbg2       read_ping:          %p\n",(void *)mb_io_ptr->mb_io_read_ping);
-		fprintf(stderr,"dbg2       write_ping:         %p\n",(void *)mb_io_ptr->mb_io_write_ping);
-		fprintf(stderr,"dbg2       extract:            %p\n",(void *)mb_io_ptr->mb_io_extract);
-		fprintf(stderr,"dbg2       insert:             %p\n",(void *)mb_io_ptr->mb_io_insert);
-		fprintf(stderr,"dbg2       extract_nav:        %p\n",(void *)mb_io_ptr->mb_io_extract_nav);
-		fprintf(stderr,"dbg2       insert_nav:         %p\n",(void *)mb_io_ptr->mb_io_insert_nav);
-		fprintf(stderr,"dbg2       extract_altitude:   %p\n",(void *)mb_io_ptr->mb_io_extract_altitude);
-		fprintf(stderr,"dbg2       insert_altitude:    %p\n",(void *)mb_io_ptr->mb_io_insert_altitude);
-		fprintf(stderr,"dbg2       extract_svp:        %p\n",(void *)mb_io_ptr->mb_io_extract_svp);
-		fprintf(stderr,"dbg2       insert_svp:         %p\n",(void *)mb_io_ptr->mb_io_insert_svp);
-		fprintf(stderr,"dbg2       ttimes:             %p\n",(void *)mb_io_ptr->mb_io_ttimes);
-		fprintf(stderr,"dbg2       extract_rawss:      %p\n",(void *)mb_io_ptr->mb_io_extract_rawss);
-		fprintf(stderr,"dbg2       insert_rawss:       %p\n",(void *)mb_io_ptr->mb_io_insert_rawss);
-		fprintf(stderr,"dbg2       copyrecord:         %p\n",(void *)mb_io_ptr->mb_io_copyrecord);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbr_info_asciiyxt(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error)
-{
-	char	*function_name = "mbr_info_asciiyxt";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* set format info parameters */
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-	*system = MB_SYS_SINGLEBEAM;
-	*beams_bath_max = 1;
-	*beams_amp_max = 0;
-	*pixels_ss_max = 0;
-	strncpy(format_name, "ASCIIYXT", MB_NAME_LENGTH);
-	strncpy(system_name, "SINGLEBEAM", MB_NAME_LENGTH);
-	strncpy(format_description, "Format name:          MBF_ASCIIYXT\nInformal Description: Generic YXT sounding format\nAttributes:           YXT (lat lon topograpy) ASCII soundings, generic\n", MB_DESCRIPTION_LENGTH);
-	*numfile = 1;
-	*filetype = MB_FILETYPE_NORMAL;
-	*variable_beams = MB_NO;
-	*traveltime = MB_NO;
-	*beam_flagging = MB_YES;
-	*nav_source = MB_DATA_DATA;
-	*heading_source = MB_DATA_DATA;
-	*vru_source = MB_DATA_DATA;
-	*svp_source = MB_DATA_NONE;
-	*beamwidth_xtrack = 4.0;
-	*beamwidth_ltrack = 4.0;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",*system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",*beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",*beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",*pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",*numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",*filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",*variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",*traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",*beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",*nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",*heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",*vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",*svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",*beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",*beamwidth_ltrack);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_alm_asciixyz(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_alm_asciixyz";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set initial status */
-	status = MB_SUCCESS;
-
-	/* allocate memory for data structure */
-	mb_io_ptr->structure_size = 0;
-	mb_io_ptr->data_structure_size = 0;
-	status = mb_mallocd(verbose,__FILE__,__LINE__,sizeof(struct mbsys_singlebeam_struct),
-				(void **)&mb_io_ptr->store_data,error);
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set number of header records read to zero */
-	mb_io_ptr->save1 = 0;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_dem_asciixyz(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_dem_asciixyz";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* deallocate memory for data descriptor */
-	status = mb_freed(verbose,__FILE__, __LINE__, (void **)&mb_io_ptr->store_data,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_rt_asciixyz(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_rt_asciixyz";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_singlebeam_struct *store;
-	char	line[MB_COMMENT_MAXLINE+1];
-	char	flag;
-	char	*line_ptr;
-	int	nread;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointers to mbio descriptor and data structures */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-	store = (struct mbsys_singlebeam_struct *) store_ptr;
-
-	/* set file position */
-	mb_io_ptr->file_bytes = ftell(mb_io_ptr->mbfp);
-	mb_io_ptr->file_pos = mb_io_ptr->file_bytes;
-
-	/* read next record */
-	if ((line_ptr = fgets(line, MB_COMMENT_MAXLINE,
-			mb_io_ptr->mbfp)) != NULL)
-		{
-		mb_io_ptr->file_bytes += strlen(line);
-		status = MB_SUCCESS;
-		*error = MB_ERROR_NO_ERROR;
-		}
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-	mb_io_ptr->file_bytes = ftell(mb_io_ptr->mbfp);
-
-	/* handle the data */
-	if (status == MB_SUCCESS
-	    && (line[0] < '0' || line[0] > '9')
-	    && line[0] != ' '
-	    && line[0] != '+'
-	    && line[0] != '-')
-	    {
-	    store->kind = MB_DATA_COMMENT;
-            strncpy(store->comment,&line[1],MB_COMMENT_MAXLINE);
-	    }
-	else if (status == MB_SUCCESS)
-	    {
-	    store->kind = MB_DATA_DATA;
-
-	    /* read data */
-	    if (mb_io_ptr->format == MBF_ASCIIXYZ
-	    	|| mb_io_ptr->format == MBF_ASCIIXYT)
-		{
-		nread = sscanf(line,
-			"%lf %lf %lf %c",
-			&store->longitude,
-			&store->latitude,
-			&store->bath,
-			&flag);
-		if (nread < 3)
-		nread = sscanf(line,
-			"%lf,%lf,%lf",
-			&store->longitude,
-			&store->latitude,
-			&store->bath);
-		store->flag = MB_FLAG_NONE;
-		}
-	    else
-		{
-		nread = sscanf(line,
-			"%lf %lf %lf %c",
-			&store->latitude,
-			&store->longitude,
-			&store->bath,
-			&flag);
-		if (nread < 3)
-		nread = sscanf(line,
-			"%lf,%lf,%lf",
-			&store->latitude,
-			&store->longitude,
-			&store->bath);
-		store->flag = MB_FLAG_NONE;
-		}
-
-	    /* check for NaN value - must be skipped */
-	    if (check_dnan(store->bath))
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_UNINTELLIGIBLE;
-		}
-
-	    /* else handle the good data */
-	    else
-		{
-		if (mb_io_ptr->format == MBF_ASCIIXYT
-		    || mb_io_ptr->format == MBF_ASCIIYXT)
-		    store->bath = -store->bath;
-		if (nread == 3)
-		    {
-		    store->flag = MB_FLAG_NONE;
-		    status = MB_SUCCESS;
-		    *error = MB_ERROR_NO_ERROR;
-		    }
-		if (nread == 4)
-		    {
-		    if (flag == 'M' || flag == 'm')
-			store->flag = MB_FLAG_MANUAL;
-		    else if (flag == 'F' || flag == 'f')
-			store->flag = MB_FLAG_FILTER;
-		    else if (flag == 'N' || flag == 'n')
-			store->flag = MB_FLAG_NULL;
-		    else
-			store->flag = MB_FLAG_NONE;
-		    }
-		store->time_d = MB_TIME_D_UNKNOWN;
-		mb_get_date(verbose, store->time_d, store->time_i);
-
-		store->heading = 0.0;
-		store->speed = 0.0;
-		store->roll = 0.0;
-		store->pitch = 0.0;
-		store->heave = 0.0;
-		}
-
-	    if (status == MB_SUCCESS)
-	        {
-		/* print output debug statements */
-		if (verbose >= 4)
-			{
-			fprintf(stderr,"\ndbg4  Data read in MBIO function <%s>\n",function_name);
-			fprintf(stderr,"dbg4  Values,read:\n");
-			fprintf(stderr,"dbg4       time_i[0]:    %d\n",store->time_i[0]);
-			fprintf(stderr,"dbg4       time_i[1]:    %d\n",store->time_i[1]);
-			fprintf(stderr,"dbg4       time_i[2]:    %d\n",store->time_i[2]);
-			fprintf(stderr,"dbg4       time_i[3]:    %d\n",store->time_i[3]);
-			fprintf(stderr,"dbg4       time_i[4]:    %d\n",store->time_i[4]);
-			fprintf(stderr,"dbg4       time_i[5]:    %d\n",store->time_i[5]);
-			fprintf(stderr,"dbg4       time_i[6]:    %d\n",store->time_i[6]);
-			fprintf(stderr,"dbg4       time_d:       %f\n",store->time_d);
-			fprintf(stderr,"dbg4       latitude:     %f\n",store->latitude);
-			fprintf(stderr,"dbg4       longitude:    %f\n",store->longitude);
-			fprintf(stderr,"dbg4       heading:      %f\n",store->heading);
-			fprintf(stderr,"dbg4       speed:        %f\n",store->speed);
-			fprintf(stderr,"dbg4       roll:         %f\n",store->roll);
-			fprintf(stderr,"dbg4       pitch:        %f\n",store->pitch);
-			fprintf(stderr,"dbg4       heave:        %f\n",store->heave);
-			fprintf(stderr,"dbg4       error:        %d\n",*error);
-			fprintf(stderr,"dbg4       status:       %d\n",status);
-			}
-	    	}
-
-	    else
-	    	{
-	    	status = MB_FAILURE;
-	   	*error = MB_ERROR_UNINTELLIGIBLE;
-	    	}
-
-	    }
-
-	/* set error and kind in mb_io_ptr */
-	mb_io_ptr->new_error = *error;
-	mb_io_ptr->new_kind = store->kind;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_wt_asciixyz(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_wt_asciixyz";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_singlebeam_struct *store;
-	char	line[MB_COMMENT_MAXLINE+1];
-	int	len;
-	char	flag;
-	double	depth;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_singlebeam_struct *) store_ptr;
-
-	/* handle the data */
-	if (store->kind == MB_DATA_COMMENT)
-	    {
-	    line[0] = '#';
-            strncpy(&line[1],store->comment,MB_COMMENT_MAXLINE-2);
-            len = strlen(line);
-            line[len] = '\n';
-            line[len+1] = '\0';
-	    }
-	else if (store->kind == MB_DATA_DATA)
-	    {
-	    /* print output debug statements */
-	    if (verbose >= 4)
-		    {
-		    fprintf(stderr,"\ndbg4  Data to be written in MBIO function <%s>\n",
-			    function_name);
-		    fprintf(stderr,"dbg4  Values,read:\n");
-		    fprintf(stderr,"dbg4       latitude:     %f\n",store->latitude);
-		    fprintf(stderr,"dbg4       longitude:    %f\n",store->longitude);
-		    fprintf(stderr,"dbg4       bath:         %f\n",store->bath);
-		    fprintf(stderr,"dbg4       flag:         %d\n",store->flag);
-		    fprintf(stderr,"dbg4       error:        %d\n",*error);
-		    fprintf(stderr,"dbg4       status:       %d\n",status);
-		    }
-
-	    /* set flag */
-	    if (store->flag == MB_FLAG_NONE)
-		flag = ' ';
-	    else if (store->flag == MB_FLAG_MANUAL)
-		flag = 'M';
-	    else if (store->flag == MB_FLAG_FILTER)
-		flag = 'F';
-	    else if (store->flag == MB_FLAG_NULL)
-		flag = 'N';
-	    else
-		flag = 'M';
-
-	    /* write the sounding */
-	    depth = store->bath;
-	    if (mb_io_ptr->format == MBF_ASCIIXYT
-	    	|| mb_io_ptr->format == MBF_ASCIIYXT)
-		depth = -depth;
-            if (mb_io_ptr->format == MBF_ASCIIXYZ
-	    	|| mb_io_ptr->format == MBF_ASCIIXYT)
-		sprintf(line,"%.6f %.6f %.2f %c\n",
-			store->longitude,
-			store->latitude,
-			depth,
-			flag);
-            else
-		sprintf(line,"%.6f %.6f %.2f %c\n",
-			store->latitude,
-			store->longitude,
-			depth,
-			flag);
-	    }
-
-	if (fputs(line,mb_io_ptr->mbfp) == EOF)
-		{
-		*error = MB_ERROR_WRITE_FAIL;
-		status = MB_FAILURE;
-		}
-	else
-		{
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-		}
-
-
-	/* print output debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Data record kind in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       kind:       %d\n",store->kind);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mbr_bchrtunb.c b/src/mbio/mbr_bchrtunb.c
deleted file mode 100644
index 5c6b4bd..0000000
--- a/src/mbio/mbr_bchrtunb.c
+++ /dev/null
@@ -1,3769 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbr_bchrtunb.c	8/8/94
- *	$Id: mbr_bchrtunb.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1994-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbr_bchrtunb.c contains the functions for reading and writing
- * multibeam data in the BCHRTUNB format.
- * These functions include:
- *   mbr_alm_bchrtunb	- allocate read/write memory
- *   mbr_dem_bchrtunb	- deallocate read/write memory
- *   mbr_rt_bchrtunb	- read and translate data
- *   mbr_wt_bchrtunb	- translate and write data
- *
- * Author:	D. W. Caress
- * Date:	August 8, 1994
- * $Log: mbr_bchrtunb.c,v $
- * Revision 5.8  2005/11/05 00:48:04  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.7  2003/05/20 18:05:32  caress
- * Added svp_source to data source parameters.
- *
- * Revision 5.6  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.5  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.4  2001/07/20 00:31:11  caress
- * Release 5.0.beta03
- *
- * Revision 5.3  2001/06/08  21:44:01  caress
- * Version 5.0.beta01
- *
- * Revision 5.2  2001/03/22  20:45:56  caress
- * Trying to make 5.0.beta0...
- *
- * Revision 5.1  2001/01/22  07:43:34  caress
- * Version 5.0.beta01
- *
- * Revision 5.0  2000/12/01  22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.13  2000/10/11  01:02:30  caress
- * Convert to ANSI C
- *
- * Revision 4.12  2000/09/30  06:34:20  caress
- * Snapshot for Dale.
- *
- * Revision 4.11  1999/03/31  18:11:35  caress
- * MB-System 4.6beta7
- *
- * Revision 4.10  1998/10/05  17:46:15  caress
- * MB-System version 4.6beta
- *
- * Revision 4.9  1997/09/15  19:06:40  caress
- * Real Version 4.5
- *
- * Revision 4.8  1997/07/28  14:58:19  caress
- * Fixed typos.
- *
- * Revision 4.7  1997/07/25  14:19:53  caress
- * Version 4.5beta2.
- * Much mucking, particularly with Simrad formats.
- *
- * Revision 4.6  1997/04/21  17:02:07  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.5  1996/08/05  15:21:58  caress
- * Just redid i/o for Simrad sonars, including adding EM12S and EM121 support.
- *
- * Revision 4.5  1996/08/05  15:21:58  caress
- * Just redid i/o for Simrad sonars, including adding EM12S and EM121 support.
- *
- * Revision 4.4  1996/04/22  13:21:19  caress
- * Now have DTR and MIN/MAX defines in mb_define.h
- *
- * Revision 4.3  1996/04/22  10:57:09  caress
- * DTR define now in mb_io.h
- *
- * Revision 4.2  1995/07/13  19:13:36  caress
- * Intermediate check-in during major bug-fixing flail.
- *
- * Revision 4.1  1995/03/06  19:38:54  caress
- * Changed include strings.h to string.h for POSIX compliance.
- *
- * Revision 4.0  1994/10/21  12:34:53  caress
- * Release V4.0
- *
- * Revision 1.1  1994/10/21  12:20:01  caress
- * Initial revision
- *
- *
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mb_define.h"
-#include "mbsys_elac.h"
-#include "mbf_bchrtunb.h"
-
-/* include for byte swapping */
-#include "mb_swap.h"
-
-/* essential function prototypes */
-int mbr_register_bchrtunb(int verbose, void *mbio_ptr,
-		int *error);
-int mbr_info_bchrtunb(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_alm_bchrtunb(int verbose, void *mbio_ptr, int *error);
-int mbr_dem_bchrtunb(int verbose, void *mbio_ptr, int *error);
-int mbr_zero_bchrtunb(int verbose, void *data_ptr, int *error);
-int mbr_rt_bchrtunb(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_wt_bchrtunb(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_bchrtunb_rd_data(int verbose, void *mbio_ptr, int *error);
-int mbr_bchrtunb_rd_comment(int verbose, FILE *mbfp,
-		struct mbf_bchrtunb_struct *data, int *error);
-int mbr_bchrtunb_rd_parameter(int verbose, FILE *mbfp,
-		struct mbf_bchrtunb_struct *data, int *error);
-int mbr_bchrtunb_rd_pos(int verbose, FILE *mbfp,
-		struct mbf_bchrtunb_struct *data, int *error);
-int mbr_bchrtunb_rd_svp(int verbose, FILE *mbfp,
-		struct mbf_bchrtunb_struct *data, int *error);
-int mbr_bchrtunb_rd_bath56(int verbose, FILE *mbfp,
-		struct mbf_bchrtunb_struct *data, int *error);
-int mbr_bchrtunb_rd_bath40(int verbose, FILE *mbfp,
-		struct mbf_bchrtunb_struct *data, int *error);
-int mbr_bchrtunb_rd_bath32(int verbose, FILE *mbfp,
-		struct mbf_bchrtunb_struct *data, int *error);
-int mbr_bchrtunb_wr_data(int verbose, void *mbio_ptr,
-		struct mbf_bchrtunb_struct *data, int *error);
-int mbr_bchrtunb_wr_comment(int verbose, FILE *mbfp,
-		struct mbf_bchrtunb_struct *data, int *error);
-int mbr_bchrtunb_wr_parameter(int verbose, FILE *mbfp,
-		struct mbf_bchrtunb_struct *data, int *error);
-int mbr_bchrtunb_wr_pos(int verbose, FILE *mbfp,
-		struct mbf_bchrtunb_struct *data, int *error);
-int mbr_bchrtunb_wr_svp(int verbose, FILE *mbfp,
-		struct mbf_bchrtunb_struct *data, int *error);
-int mbr_bchrtunb_wr_bath56(int verbose, FILE *mbfp,
-		struct mbf_bchrtunb_struct *data, int *error);
-int mbr_bchrtunb_wr_bath40(int verbose, FILE *mbfp,
-		struct mbf_bchrtunb_struct *data, int *error);
-int mbr_bchrtunb_wr_bath32(int verbose, FILE *mbfp,
-		struct mbf_bchrtunb_struct *data, int *error);
-
-static char rcs_id[]="$Id: mbr_bchrtunb.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mbr_register_bchrtunb(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_register_bchrtunb";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* get mb_io_ptr */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set format info parameters */
-	status = mbr_info_bchrtunb(verbose,
-			&mb_io_ptr->system,
-			&mb_io_ptr->beams_bath_max,
-			&mb_io_ptr->beams_amp_max,
-			&mb_io_ptr->pixels_ss_max,
-			mb_io_ptr->format_name,
-			mb_io_ptr->system_name,
-			mb_io_ptr->format_description,
-			&mb_io_ptr->numfile,
-			&mb_io_ptr->filetype,
-			&mb_io_ptr->variable_beams,
-			&mb_io_ptr->traveltime,
-			&mb_io_ptr->beam_flagging,
-			&mb_io_ptr->nav_source,
-			&mb_io_ptr->heading_source,
-			&mb_io_ptr->vru_source,
-			&mb_io_ptr->svp_source,
-			&mb_io_ptr->beamwidth_xtrack,
-			&mb_io_ptr->beamwidth_ltrack,
-			error);
-
-	/* set format and system specific function pointers */
-	mb_io_ptr->mb_io_format_alloc = &mbr_alm_bchrtunb;
-	mb_io_ptr->mb_io_format_free = &mbr_dem_bchrtunb;
-	mb_io_ptr->mb_io_store_alloc = &mbsys_elac_alloc;
-	mb_io_ptr->mb_io_store_free = &mbsys_elac_deall;
-	mb_io_ptr->mb_io_read_ping = &mbr_rt_bchrtunb;
-	mb_io_ptr->mb_io_write_ping = &mbr_wt_bchrtunb;
-	mb_io_ptr->mb_io_dimensions = &mbsys_elac_dimensions;
-	mb_io_ptr->mb_io_extract = &mbsys_elac_extract;
-	mb_io_ptr->mb_io_insert = &mbsys_elac_insert;
-	mb_io_ptr->mb_io_extract_nav = &mbsys_elac_extract_nav;
-	mb_io_ptr->mb_io_insert_nav = &mbsys_elac_insert_nav;
-	mb_io_ptr->mb_io_extract_altitude = &mbsys_elac_extract_altitude;
-	mb_io_ptr->mb_io_insert_altitude = NULL;
-	mb_io_ptr->mb_io_extract_svp = &mbsys_elac_extract_svp;
-	mb_io_ptr->mb_io_insert_svp = &mbsys_elac_insert_svp;
-	mb_io_ptr->mb_io_ttimes = &mbsys_elac_ttimes;
-	mb_io_ptr->mb_io_detects = &mbsys_elac_detects;
-	mb_io_ptr->mb_io_copyrecord = &mbsys_elac_copy;
-	mb_io_ptr->mb_io_extract_rawss = NULL;
-	mb_io_ptr->mb_io_insert_rawss = NULL;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",mb_io_ptr->system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",mb_io_ptr->beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",mb_io_ptr->beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",mb_io_ptr->pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",mb_io_ptr->format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",mb_io_ptr->system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",mb_io_ptr->format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",mb_io_ptr->numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",mb_io_ptr->filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",mb_io_ptr->variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",mb_io_ptr->traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",mb_io_ptr->beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",mb_io_ptr->nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",mb_io_ptr->heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",mb_io_ptr->vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",mb_io_ptr->svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",mb_io_ptr->beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",mb_io_ptr->beamwidth_ltrack);
-		fprintf(stderr,"dbg2       format_alloc:       %p\n",(void *)mb_io_ptr->mb_io_format_alloc);
-		fprintf(stderr,"dbg2       format_free:        %p\n",(void *)mb_io_ptr->mb_io_format_free);
-		fprintf(stderr,"dbg2       store_alloc:        %p\n",(void *)mb_io_ptr->mb_io_store_alloc);
-		fprintf(stderr,"dbg2       store_free:         %p\n",(void *)mb_io_ptr->mb_io_store_free);
-		fprintf(stderr,"dbg2       read_ping:          %p\n",(void *)mb_io_ptr->mb_io_read_ping);
-		fprintf(stderr,"dbg2       write_ping:         %p\n",(void *)mb_io_ptr->mb_io_write_ping);
-		fprintf(stderr,"dbg2       extract:            %p\n",(void *)mb_io_ptr->mb_io_extract);
-		fprintf(stderr,"dbg2       insert:             %p\n",(void *)mb_io_ptr->mb_io_insert);
-		fprintf(stderr,"dbg2       extract_nav:        %p\n",(void *)mb_io_ptr->mb_io_extract_nav);
-		fprintf(stderr,"dbg2       insert_nav:         %p\n",(void *)mb_io_ptr->mb_io_insert_nav);
-		fprintf(stderr,"dbg2       extract_altitude:   %p\n",(void *)mb_io_ptr->mb_io_extract_altitude);
-		fprintf(stderr,"dbg2       insert_altitude:    %p\n",(void *)mb_io_ptr->mb_io_insert_altitude);
-		fprintf(stderr,"dbg2       extract_svp:        %p\n",(void *)mb_io_ptr->mb_io_extract_svp);
-		fprintf(stderr,"dbg2       insert_svp:         %p\n",(void *)mb_io_ptr->mb_io_insert_svp);
-		fprintf(stderr,"dbg2       ttimes:             %p\n",(void *)mb_io_ptr->mb_io_ttimes);
-		fprintf(stderr,"dbg2       detects:            %p\n",(void *)mb_io_ptr->mb_io_detects);
-		fprintf(stderr,"dbg2       extract_rawss:      %p\n",(void *)mb_io_ptr->mb_io_extract_rawss);
-		fprintf(stderr,"dbg2       insert_rawss:       %p\n",(void *)mb_io_ptr->mb_io_insert_rawss);
-		fprintf(stderr,"dbg2       copyrecord:         %p\n",(void *)mb_io_ptr->mb_io_copyrecord);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbr_info_bchrtunb(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error)
-{
-	char	*function_name = "mbr_info_bchrtunb";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* set format info parameters */
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-	*system = MB_SYS_ELAC;
-	*beams_bath_max = 56;
-	*beams_amp_max = 56;
-	*pixels_ss_max = 0;
-	strncpy(format_name, "BCHRTUNB", MB_NAME_LENGTH);
-	strncpy(system_name, "ELAC", MB_NAME_LENGTH);
-	strncpy(format_description, "Format name:          MBF_BCHRTUNB\nInformal Description: Elac BottomChart shallow water multibeam\nAttributes:           56 beam bathymetry and amplitude,\n                      binary, University of New Brunswick.\n", MB_DESCRIPTION_LENGTH);
-	*numfile = 1;
-	*filetype = MB_FILETYPE_NORMAL;
-	*variable_beams = MB_YES;
-	*traveltime = MB_YES;
-	*beam_flagging = MB_YES;
-	*nav_source = MB_DATA_NAV;
-	*heading_source = MB_DATA_DATA;
-	*vru_source = MB_DATA_DATA;
-	*svp_source = MB_DATA_VELOCITY_PROFILE;
-	*beamwidth_xtrack = 3.0;
-	*beamwidth_ltrack = 6.0;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",*system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",*beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",*beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",*pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",*numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",*filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",*variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",*traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",*beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",*nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",*heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",*vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",*svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",*beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",*beamwidth_ltrack);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbr_alm_bchrtunb(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_alm_bchrtunb";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set initial status */
-	status = MB_SUCCESS;
-
-	/* allocate memory for data structure */
-	mb_io_ptr->structure_size = sizeof(struct mbf_bchrtunb_struct);
-	mb_io_ptr->data_structure_size = 0;
-	status = mb_malloc(verbose,mb_io_ptr->structure_size,
-				&mb_io_ptr->raw_data,error);
-	status = mb_malloc(verbose,sizeof(struct mbsys_elac_struct),
-				&mb_io_ptr->store_data,error);
-
-	/* initialize everything to zeros */
-	mbr_zero_bchrtunb(verbose,mb_io_ptr->raw_data,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_dem_bchrtunb(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_dem_bchrtunb";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointers to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* deallocate memory for data descriptor */
-	status = mb_free(verbose,&mb_io_ptr->raw_data,error);
-	status = mb_free(verbose,&mb_io_ptr->store_data,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_zero_bchrtunb(int verbose, void *data_ptr, int *error)
-{
-	char	*function_name = "mbr_zero_bchrtunb";
-	int	status = MB_SUCCESS;
-	struct mbf_bchrtunb_struct *data;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       data_ptr:   %p\n",(void *)data_ptr);
-		}
-
-	/* get pointer to data descriptor */
-	data = (struct mbf_bchrtunb_struct *) data_ptr;
-
-	/* initialize everything to zeros */
-	if (data != NULL)
-		{
-		data->kind = MB_DATA_NONE;
-		data->sonar = MBSYS_ELAC_BOTTOMCHART;
-		data->par_year = 0;
-		data->par_month = 0;
-		data->par_day = 0;
-		data->par_hour = 0;
-		data->par_minute = 0;
-		data->par_second = 0;
-		data->par_hundredth_sec = 0;
-		data->par_thousandth_sec = 0;
-		data->roll_offset = 0;	/* roll offset (degrees) */
-		data->pitch_offset = 0;	/* pitch offset (degrees) */
-		data->heading_offset = 0;	/* heading offset (degrees) */
-		data->time_delay = 0;		/* positioning system
-							delay (sec) */
-		data->transducer_port_height = 0;
-		data->transducer_starboard_height = 0;
-		data->transducer_port_depth = 0;
-		data->transducer_starboard_depth = 0;
-		data->transducer_port_x = 0;
-		data->transducer_starboard_x = 0;
-		data->transducer_port_y = 0;
-		data->transducer_starboard_y = 0;
-		data->transducer_port_error = 0;
-		data->transducer_starboard_error = 0;
-		data->antenna_height = 0;
-		data->antenna_x = 0;
-		data->antenna_y = 0;
-		data->vru_height = 0;
-		data->vru_x = 0;
-		data->vru_y = 0;
-		data->heave_offset = 0;
-		data->line_number = 0;
-		data->start_or_stop = 0;
-		data->transducer_serial_number = 0;
-		for (i=0;i<MBF_BCHRTUNB_COMMENT_LENGTH;i++)
-			data->comment[i] = '\0';
-
-		/* position (position telegrams) */
-		data->pos_year = 0;
-		data->pos_month = 0;
-		data->pos_day = 0;
-		data->pos_hour = 0;
-		data->pos_minute = 0;
-		data->pos_second = 0;
-		data->par_hundredth_sec = 0;
-		data->pos_thousandth_sec = 0;
-		data->pos_latitude = 0;
-		data->pos_longitude = 0;
-		data->utm_northing = 0;
-		data->utm_easting = 0;
-		data->utm_zone_lon = 0;
-		data->utm_zone = 0;
-		data->hemisphere = 0;
-		data->ellipsoid = 0;
-		data->pos_spare = 0;
-		data->semi_major_axis = 0;
-		data->other_quality = 0;
-
-		/* sound velocity profile */
-		data->svp_year = 0;
-		data->svp_month = 0;
-		data->svp_day = 0;
-		data->svp_hour = 0;
-		data->svp_minute = 0;
-		data->svp_second = 0;
-		data->svp_hundredth_sec = 0;
-		data->svp_thousandth_sec = 0;
-		data->svp_num = 0;
-		for (i=0;i<100;i++)
-			{
-			data->svp_depth[i] = 0; /* 0.1 meters */
-			data->svp_vel[i] = 0;	/* 0.1 meters/sec */
-			}
-
-		/* depth telegram */
-		data->ping_num = 0;
-		data->sound_vel = 0;
-		data->mode = 0;
-		data->pulse_length = 0;
-		data->source_power = 0;
-		data->receiver_gain = 0;
-		data->profile_num = 0;
-		data->beams_bath = 0;
-		for (i=0;i<7;i++)
-			{
-			data->profile[i].year = 0;
-			data->profile[i].month = 0;
-			data->profile[i].day = 0;
-			data->profile[i].hour = 0;
-			data->profile[i].minute = 0;
-			data->profile[i].second = 0;
-			data->profile[i].hundredth_sec = 0;
-			data->profile[i].thousandth_sec = 0;
-			data->profile[i].longitude = 0;
-			data->profile[i].latitude = 0;
-			data->profile[i].roll = 0;
-			data->profile[i].pitch = 0;
-			data->profile[i].heading = 0;
-			data->profile[i].heave = 0;
-			for (j=0;j<8;j++)
-				{
-				data->profile[i].bath[j] = 0;
-				data->profile[i].bath_acrosstrack[j] = 0;
-				data->profile[i].bath_alongtrack[j] = 0;
-				data->profile[i].tt[j] = 0;
-				data->profile[i].angle[j] = 0;
-				data->profile[i].quality[j] = 0;
-				data->profile[i].amp[j] = 0;
-				}
-			}
-
-		}
-
-	/* assume success */
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_rt_bchrtunb(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_rt_bchrtunb";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_bchrtunb_struct *data;
-	struct mbsys_elac_struct *store;
-	int	time_i[7];
-	double	time_d;
-	double	lon, lat, heading, speed;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointers to mbio descriptor and data structures */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-	data = (struct mbf_bchrtunb_struct *) mb_io_ptr->raw_data;
-	store = (struct mbsys_elac_struct *) store_ptr;
-
-	/* read next data from file */
-	status = mbr_bchrtunb_rd_data(verbose,mbio_ptr,error);
-
-	/* set error and kind in mb_io_ptr */
-	mb_io_ptr->new_error = *error;
-	mb_io_ptr->new_kind = data->kind;
-
-	/* add nav records to list for interpolation */
-	if (status == MB_SUCCESS
-		&& data->kind == MB_DATA_NAV)
-		{
-		mb_fix_y2k(verbose, data->pos_year,&time_i[0]);
-		time_i[1] = data->pos_month;
-		time_i[2] = data->pos_day;
-		time_i[3] = data->pos_hour;
-		time_i[4] = data->pos_minute;
-		time_i[5] = data->pos_second;
-		time_i[6] = 10000*data->pos_hundredth_sec
-			+ 100*data->pos_thousandth_sec;
-		mb_get_time(verbose,time_i, &time_d);
-		lon = data->pos_longitude*0.00000009;
-		lat = data->pos_latitude*0.00000009;
-		mb_navint_add(verbose, mbio_ptr, time_d, lon, lat, error);
-		}
-
-	/* interpolate navigation for survey pings if needed */
-	if (status == MB_SUCCESS
-		&& data->kind == MB_DATA_DATA
-		&& data->profile[0].longitude == 0
-		&& data->profile[0].latitude == 0
-		&& mb_io_ptr->nfix >= 1)
-		{
-		mb_fix_y2k(verbose, data->profile[0].year,&time_i[0]);
-		time_i[1] = data->profile[0].month;
-		time_i[2] = data->profile[0].day;
-		time_i[3] = data->profile[0].hour;
-		time_i[4] = data->profile[0].minute;
-		time_i[5] = data->profile[0].second;
-		time_i[6] = 10000*data->profile[0].hundredth_sec
-			+ 100*data->profile[0].thousandth_sec;
-		mb_get_time(verbose,time_i, &time_d);
-		heading = 0.01 * data->profile[0].heading;
-		mb_navint_interp(verbose, mbio_ptr, time_d, heading, 0.0,
-				    &lon, &lat, &speed, error);
-		data->profile[0].longitude = (int) (lon / 0.00000009);
-		data->profile[0].latitude = (int) (lat / 0.00000009);
-		}
-
-	/* translate values to elac data storage structure */
-	if (status == MB_SUCCESS
-		&& store != NULL)
-		{
-		store->kind = data->kind;
-		store->sonar = data->sonar;
-
-		/* parameter telegram */
-		store->par_year = data->par_year;
-		store->par_month = data->par_month;
-		store->par_day = data->par_day;
-		store->par_hour = data->par_hour;
-		store->par_minute = data->par_minute;
-		store->par_second = data->par_second;
-		store->par_hundredth_sec = data->par_hundredth_sec;
-		store->par_thousandth_sec = data->par_thousandth_sec;
-		store->roll_offset = data->roll_offset;
-		store->pitch_offset = data->pitch_offset;
-		store->heading_offset = data->heading_offset;
-		store->time_delay = data->time_delay;
-		store->transducer_port_height = data->transducer_port_height;
-		store->transducer_starboard_height
-			= data->transducer_starboard_height;
-		store->transducer_port_depth = data->transducer_port_depth;
-		store->transducer_starboard_depth
-			= data->transducer_starboard_depth;
-		store->transducer_port_x = data->transducer_port_x;
-		store->transducer_starboard_x = data->transducer_starboard_x;
-		store->transducer_port_y = data->transducer_port_y;
-		store->transducer_starboard_y = data->transducer_starboard_y;
-		store->transducer_port_error = data->transducer_port_error;
-		store->transducer_starboard_error
-			= data->transducer_starboard_error;
-		store->antenna_height = data->antenna_height;
-		store->antenna_x = data->antenna_x;
-		store->antenna_y = data->antenna_y;
-		store->vru_height = data->vru_height;
-		store->vru_x = data->vru_x;
-		store->vru_y = data->vru_y;
-		store->heave_offset = data->heave_offset;
-		store->line_number = data->line_number;
-		store->start_or_stop = data->start_or_stop;
-		store->transducer_serial_number
-			= data->transducer_serial_number;
-		for (i=0;i<MBF_BCHRTUNB_COMMENT_LENGTH;i++)
-			store->comment[i] = data->comment[i];
-
-		/* position (position telegrams) */
-		store->pos_year = data->pos_year;
-		store->pos_month = data->pos_month;
-		store->pos_day = data->pos_day;
-		store->pos_hour = data->pos_hour;
-		store->pos_minute = data->pos_minute;
-		store->pos_second = data->pos_second;
-		store->pos_hundredth_sec = data->pos_hundredth_sec;
-		store->pos_thousandth_sec = data->pos_thousandth_sec;
-		store->pos_latitude = data->pos_latitude;
-		store->pos_longitude = data->pos_longitude;
-		store->utm_northing = data->utm_northing;
-		store->utm_easting = data->utm_easting;
-		store->utm_zone_lon = data->utm_zone_lon;
-		store->utm_zone = data->utm_zone;
-		store->hemisphere = data->hemisphere;
-		store->ellipsoid = data->ellipsoid;
-		store->pos_spare = data->pos_spare;
-		store->semi_major_axis = data->semi_major_axis;
-		store->other_quality = data->other_quality;
-
-		/* sound velocity profile */
-		store->svp_year = data->svp_year;
-		store->svp_month = data->svp_month;
-		store->svp_day = data->svp_day;
-		store->svp_hour = data->svp_hour;
-		store->svp_minute = data->svp_minute;
-		store->svp_second = data->svp_second;
-		store->svp_hundredth_sec = data->svp_hundredth_sec;
-		store->svp_thousandth_sec = data->svp_thousandth_sec;
-		store->svp_num = data->svp_num;
-		for (i=0;i<500;i++)
-			{
-			store->svp_depth[i] = data->svp_depth[i];
-			store->svp_vel[i] = data->svp_vel[i];
-			}
-
-		/* depth telegram */
-		store->ping_num = data->ping_num;
-		store->sound_vel = data->sound_vel;
-		store->mode = data->mode;
-		store->pulse_length = data->pulse_length;
-		store->source_power = data->source_power;
-		store->receiver_gain = data->receiver_gain;
-		store->profile_num = data->profile_num;
-		store->beams_bath = data->beams_bath;
-		for (i=0;i<7;i++)
-			{
-			store->profile[i].year = data->profile[i].year;
-			store->profile[i].month = data->profile[i].month;
-			store->profile[i].day = data->profile[i].day;
-			store->profile[i].hour = data->profile[i].hour;
-			store->profile[i].minute = data->profile[i].minute;
-			store->profile[i].second = data->profile[i].second;
-			store->profile[i].hundredth_sec
-				= data->profile[i].hundredth_sec;
-			store->profile[i].thousandth_sec
-				= data->profile[i].thousandth_sec;
-			store->profile[i].longitude = data->profile[i].longitude;
-			store->profile[i].latitude = data->profile[i].latitude;
-			store->profile[i].roll = data->profile[i].roll;
-			store->profile[i].pitch = data->profile[i].pitch;
-			store->profile[i].heading = data->profile[i].heading;
-			store->profile[i].heave = data->profile[i].heave;
-			for (j=0;j<8;j++)
-				{
-				store->profile[i].bath[j]
-					= data->profile[i].bath[j];
-				store->profile[i].bath_acrosstrack[j]
-					= 2 * data->profile[i].bath_acrosstrack[j];
-				store->profile[i].bath_alongtrack[j]
-					= data->profile[i].bath_alongtrack[j];
-				store->profile[i].tt[j]
-					= data->profile[i].tt[j];
-				store->profile[i].angle[j]
-					= data->profile[i].angle[j];
-				store->profile[i].quality[j]
-					= data->profile[i].quality[j];
-				store->profile[i].amp[j]
-					= data->profile[i].amp[j];
-				}
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_wt_bchrtunb(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_wt_bchrtunb";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_bchrtunb_struct *data;
-	char	*data_ptr;
-	struct mbsys_elac_struct *store;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_bchrtunb_struct *) mb_io_ptr->raw_data;
-	data_ptr = (char *) data;
-	store = (struct mbsys_elac_struct *) store_ptr;
-
-	/* first translate values from data storage structure */
-	if (store != NULL)
-		{
-		data->kind = store->kind;
-		data->sonar = store->sonar;
-
-		/* parameter telegram */
-		data->par_year = store->par_year;
-		data->par_month = store->par_month;
-		data->par_day = store->par_day;
-		data->par_hour = store->par_hour;
-		data->par_minute = store->par_minute;
-		data->par_second = store->par_second;
-		data->par_hundredth_sec = store->par_hundredth_sec;
-		data->par_thousandth_sec = store->par_thousandth_sec;
-		data->roll_offset = store->roll_offset;
-		data->pitch_offset = store->pitch_offset;
-		data->heading_offset = store->heading_offset;
-		data->time_delay = store->time_delay;
-		data->transducer_port_height = store->transducer_port_height;
-		data->transducer_starboard_height
-			= store->transducer_starboard_height;
-		data->transducer_port_depth = store->transducer_port_depth;
-		data->transducer_starboard_depth
-			= store->transducer_starboard_depth;
-		data->transducer_port_x = store->transducer_port_x;
-		data->transducer_starboard_x = store->transducer_starboard_x;
-		data->transducer_port_y = store->transducer_port_y;
-		data->transducer_starboard_y = store->transducer_starboard_y;
-		data->transducer_port_error = store->transducer_port_error;
-		data->transducer_starboard_error
-			= store->transducer_starboard_error;
-		data->antenna_height = store->antenna_height;
-		data->antenna_x = store->antenna_x;
-		data->antenna_y = store->antenna_y;
-		data->vru_height = store->vru_height;
-		data->vru_x = store->vru_x;
-		data->vru_y = store->vru_y;
-		data->heave_offset = store->heave_offset;
-		data->line_number = store->line_number;
-		data->start_or_stop = store->start_or_stop;
-		data->transducer_serial_number
-			= store->transducer_serial_number;
-		for (i=0;i<MBF_BCHRTUNB_COMMENT_LENGTH;i++)
-			data->comment[i] = store->comment[i];
-
-		/* position (position telegrams) */
-		data->pos_year = store->pos_year;
-		data->pos_month = store->pos_month;
-		data->pos_day = store->pos_day;
-		data->pos_hour = store->pos_hour;
-		data->pos_minute = store->pos_minute;
-		data->pos_second = store->pos_second;
-		data->pos_hundredth_sec = store->pos_hundredth_sec;
-		data->pos_thousandth_sec = store->pos_thousandth_sec;
-		data->pos_latitude = store->pos_latitude;
-		data->pos_longitude = store->pos_longitude;
-		data->utm_northing = store->utm_northing;
-		data->utm_easting = store->utm_easting;
-		data->utm_zone_lon = store->utm_zone_lon;
-		data->utm_zone = store->utm_zone;
-		data->hemisphere = store->hemisphere;
-		data->ellipsoid = store->ellipsoid;
-		data->pos_spare = store->pos_spare;
-		data->semi_major_axis = store->semi_major_axis;
-		data->other_quality = store->other_quality;
-
-		/* sound velocity profile */
-		data->svp_year = store->svp_year;
-		data->svp_month = store->svp_month;
-		data->svp_day = store->svp_day;
-		data->svp_hour = store->svp_hour;
-		data->svp_minute = store->svp_minute;
-		data->svp_second = store->svp_second;
-		data->svp_hundredth_sec = store->svp_hundredth_sec;
-		data->svp_thousandth_sec = store->svp_thousandth_sec;
-		data->svp_num = store->svp_num;
-		for (i=0;i<500;i++)
-			{
-			data->svp_depth[i] = store->svp_depth[i];
-			data->svp_vel[i] = store->svp_vel[i];
-			}
-
-		/* depth telegram */
-		data->ping_num = store->ping_num;
-		data->sound_vel = store->sound_vel;
-		data->mode = store->mode;
-		data->pulse_length = store->pulse_length;
-		data->source_power = store->source_power;
-		data->receiver_gain = store->receiver_gain;
-		data->profile_num = store->profile_num;
-		data->beams_bath = store->beams_bath;
-		for (i=0;i<7;i++)
-			{
-			data->profile[i].year = store->profile[i].year;
-			data->profile[i].month = store->profile[i].month;
-			data->profile[i].day = store->profile[i].day;
-			data->profile[i].hour = store->profile[i].hour;
-			data->profile[i].minute = store->profile[i].minute;
-			data->profile[i].second = store->profile[i].second;
-			data->profile[i].hundredth_sec
-				= store->profile[i].hundredth_sec;
-			data->profile[i].thousandth_sec
-				= store->profile[i].thousandth_sec;
-			data->profile[i].longitude = store->profile[i].longitude;
-			data->profile[i].latitude = store->profile[i].latitude;
-			data->profile[i].roll = store->profile[i].roll;
-			data->profile[i].pitch = store->profile[i].pitch;
-			data->profile[i].heading = store->profile[i].heading;
-			data->profile[i].heave = store->profile[i].heave;
-			for (j=0;j<8;j++)
-				{
-				data->profile[i].bath[j]
-					= store->profile[i].bath[j];
-				data->profile[i].bath_acrosstrack[j]
-					= store->profile[i].bath_acrosstrack[j]
-					    / 2;
-				data->profile[i].bath_alongtrack[j]
-					= store->profile[i].bath_alongtrack[j];
-				data->profile[i].tt[j]
-					= store->profile[i].tt[j];
-				data->profile[i].angle[j]
-					= store->profile[i].angle[j];
-				data->profile[i].quality[j]
-					= store->profile[i].quality[j];
-				data->profile[i].amp[j]
-					= store->profile[i].amp[j];
-				}
-			}
-		}
-
-	/* write next data to file */
-	status = mbr_bchrtunb_wr_data(verbose,mbio_ptr,data,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_bchrtunb_rd_data(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_bchrtunb_rd_data";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_bchrtunb_struct *data;
-	char	*data_ptr;
-	FILE	*mbfp;
-	int	done;
-	short int *type;
-	static char label[2];
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_bchrtunb_struct *) mb_io_ptr->raw_data;
-	data_ptr = (char *) data;
-	mbfp = mb_io_ptr->mbfp;
-
-	/* set file position */
-	mb_io_ptr->file_pos = mb_io_ptr->file_bytes;
-
-	done = MB_NO;
-	type = (short int *) label;
-	*error = MB_ERROR_NO_ERROR;
-	while (done == MB_NO)
-		{
-		/* get next record label */
-		if ((status = fread(&label[0],1,1,mb_io_ptr->mbfp)) != 1)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_EOF;
-			}
-		if (label[0] == 0x02)
-		if ((status = fread(&label[1],1,1,mb_io_ptr->mbfp)) != 1)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_EOF;
-			}
-
-		/* swap bytes if necessary */
-#ifdef BYTESWAPPED
-		*type = (short int) mb_swap_short(*type);
-#endif
-
-		/* read the appropriate data records */
-		if (status == MB_FAILURE)
-			{
-			done = MB_YES;
-			}
-		else if (*type == ELAC_COMMENT)
-			{
-			status = mbr_bchrtunb_rd_comment(
-				verbose,mbfp,data,error);
-			if (status == MB_SUCCESS)
-				{
-				done = MB_YES;
-				data->kind = MB_DATA_COMMENT;
-				}
-			}
-		else if (*type == ELAC_PARAMETER)
-			{
-			status = mbr_bchrtunb_rd_parameter(
-				verbose,mbfp,data,error);
-			if (status == MB_SUCCESS)
-				{
-				done = MB_YES;
-				data->kind = MB_DATA_PARAMETER;
-				}
-			}
-		else if (*type == ELAC_POS)
-			{
-			status = mbr_bchrtunb_rd_pos(
-				verbose,mbfp,data,error);
-			if (status == MB_SUCCESS)
-				{
-				done = MB_YES;
-				data->kind = MB_DATA_NAV;
-				}
-			}
-		else if (*type == ELAC_SVP)
-			{
-			status = mbr_bchrtunb_rd_svp(
-				verbose,mbfp,data,error);
-			if (status == MB_SUCCESS)
-				{
-				done = MB_YES;
-				data->kind = MB_DATA_VELOCITY_PROFILE;
-				}
-			}
-		else if (*type == ELAC_BATH56)
-			{
-			status = mbr_bchrtunb_rd_bath56(
-				verbose,mbfp,data,error);
-			if (status == MB_SUCCESS)
-				{
-				done = MB_YES;
-				data->kind = MB_DATA_DATA;
-				}
-			}
-		else if (*type == ELAC_BATH40)
-			{
-			status = mbr_bchrtunb_rd_bath40(
-				verbose,mbfp,data,error);
-			if (status == MB_SUCCESS)
-				{
-				done = MB_YES;
-				data->kind = MB_DATA_DATA;
-				}
-			}
-		else if (*type == ELAC_BATH32)
-			{
-			status = mbr_bchrtunb_rd_bath32(
-				verbose,mbfp,data,error);
-			if (status == MB_SUCCESS)
-				{
-				done = MB_YES;
-				data->kind = MB_DATA_DATA;
-				}
-			}
-		else
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_UNINTELLIGIBLE;
-			}
-
-		/* bail out if there is an error */
-		if (status == MB_FAILURE)
-			done = MB_YES;
-
-		}
-
-	/* get file position */
-	mb_io_ptr->file_bytes = ftell(mbfp);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_bchrtunb_rd_comment(int verbose, FILE *mbfp,
-		struct mbf_bchrtunb_struct *data, int *error)
-{
-	char	*function_name = "mbr_bchrtunb_rd_comment";
-	int	status = MB_SUCCESS;
-	char	line[ELAC_COMMENT_SIZE+3];
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       data:       %p\n",(void *)data);
-		}
-
-	/* read record into char array */
-	status = fread(line,1,ELAC_COMMENT_SIZE+3,mbfp);
-	if (status == ELAC_COMMENT_SIZE+3)
-		status = MB_SUCCESS;
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	/* get data */
-	if (status == MB_SUCCESS)
-		{
-		data->kind = MB_DATA_COMMENT;
-		strncpy(data->comment,line,MBF_BCHRTUNB_COMMENT_LENGTH-1);
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       comment:          %s\n",data->comment);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_bchrtunb_rd_parameter(int verbose, FILE *mbfp,
-		struct mbf_bchrtunb_struct *data, int *error)
-{
-	char	*function_name = "mbr_bchrtunb_rd_parameter";
-	int	status = MB_SUCCESS;
-	char	line[ELAC_PARAMETER_SIZE+3];
-	short int *short_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       data:       %p\n",(void *)data);
-		}
-
-	/* read record into char array */
-	status = fread(line,1,ELAC_PARAMETER_SIZE+3,mbfp);
-	if (status == ELAC_PARAMETER_SIZE+3)
-		status = MB_SUCCESS;
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	/* get data */
-	if (status == MB_SUCCESS)
-		{
-		data->kind = MB_DATA_PARAMETER;
-		data->par_day =            (int) line[0];
-		data->par_month =          (int) line[1];
-		data->par_year =           (int) line[2];
-		data->par_hour =           (int) line[3];
-		data->par_minute =         (int) line[4];
-		data->par_second =         (int) line[5];
-		data->par_hundredth_sec =  (int) line[6];
-		data->par_thousandth_sec = (int) line[7];
-#ifndef BYTESWAPPED
-		short_ptr = (short int *) &line[8];
-		data->roll_offset = *short_ptr;
-		short_ptr = (short int *) &line[10];
-		data->pitch_offset = *short_ptr;
-		short_ptr = (short int *) &line[12];
-		data->heading_offset = *short_ptr;
-		short_ptr = (short int *) &line[14];
-		data->time_delay = *short_ptr;
-		short_ptr = (short int *) &line[16];
-		data->transducer_port_height = *short_ptr;
-		short_ptr = (short int *) &line[18];
-		data->transducer_starboard_height = *short_ptr;
-		short_ptr = (short int *) &line[20];
-		data->transducer_port_depth = *short_ptr;
-		short_ptr = (short int *) &line[22];
-		data->transducer_starboard_depth = *short_ptr;
-		short_ptr = (short int *) &line[24];
-		data->transducer_port_x = *short_ptr;
-		short_ptr = (short int *) &line[26];
-		data->transducer_starboard_x = *short_ptr;
-		short_ptr = (short int *) &line[28];
-		data->transducer_port_y = *short_ptr;
-		short_ptr = (short int *) &line[30];
-		data->transducer_starboard_y = *short_ptr;
-		short_ptr = (short int *) &line[32];
-		data->transducer_port_error = *short_ptr;
-		short_ptr = (short int *) &line[34];
-		data->transducer_starboard_error = *short_ptr;
-		short_ptr = (short int *) &line[36];
-		data->antenna_height = *short_ptr;
-		short_ptr = (short int *) &line[38];
-		data->antenna_x = *short_ptr;
-		short_ptr = (short int *) &line[40];
-		data->antenna_y = *short_ptr;
-		short_ptr = (short int *) &line[42];
-		data->vru_height = *short_ptr;
-		short_ptr = (short int *) &line[44];
-		data->vru_x = *short_ptr;
-		short_ptr = (short int *) &line[46];
-		data->vru_y = *short_ptr;
-		short_ptr = (short int *) &line[48];
-		data->heave_offset = *short_ptr;
-		short_ptr = (short int *) &line[50];
-		data->line_number = *short_ptr;
-		short_ptr = (short int *) &line[52];
-		data->start_or_stop = *short_ptr;
-		short_ptr = (short int *) &line[54];
-		data->transducer_serial_number = *short_ptr;
-#else
-		short_ptr = (short int *) &line[8];
-		data->roll_offset = (short int) mb_swap_short(*short_ptr);
-		short_ptr = (short int *) &line[10];
-		data->pitch_offset = (short int) mb_swap_short(*short_ptr);
-		short_ptr = (short int *) &line[12];
-		data->heading_offset = (short int) mb_swap_short(*short_ptr);
-		short_ptr = (short int *) &line[14];
-		data->time_delay = (short int) mb_swap_short(*short_ptr);
-		short_ptr = (short int *) &line[16];
-		data->transducer_port_height
-			= (short int) mb_swap_short(*short_ptr);
-		short_ptr = (short int *) &line[18];
-		data->transducer_starboard_height
-			= (short int) mb_swap_short(*short_ptr);
-		short_ptr = (short int *) &line[20];
-		data->transducer_port_depth
-			= (short int) mb_swap_short(*short_ptr);
-		short_ptr = (short int *) &line[22];
-		data->transducer_starboard_depth
-			= (short int) mb_swap_short(*short_ptr);
-		short_ptr = (short int *) &line[24];
-		data->transducer_port_x
-			= (short int) mb_swap_short(*short_ptr);
-		short_ptr = (short int *) &line[26];
-		data->transducer_starboard_x
-			= (short int) mb_swap_short(*short_ptr);
-		short_ptr = (short int *) &line[28];
-		data->transducer_port_y
-			= (short int) mb_swap_short(*short_ptr);
-		short_ptr = (short int *) &line[30];
-		data->transducer_starboard_y
-			= (short int) mb_swap_short(*short_ptr);
-		short_ptr = (short int *) &line[32];
-		data->transducer_port_error
-			= (short int) mb_swap_short(*short_ptr);
-		short_ptr = (short int *) &line[34];
-		data->transducer_starboard_error
-			= (short int) mb_swap_short(*short_ptr);
-		short_ptr = (short int *) &line[36];
-		data->antenna_height = (short int) mb_swap_short(*short_ptr);
-		short_ptr = (short int *) &line[38];
-		data->antenna_x = (short int) mb_swap_short(*short_ptr);
-		short_ptr = (short int *) &line[40];
-		data->antenna_y = (short int) mb_swap_short(*short_ptr);
-		short_ptr = (short int *) &line[42];
-		data->vru_height = (short int) mb_swap_short(*short_ptr);
-		short_ptr = (short int *) &line[44];
-		data->vru_x = (short int) mb_swap_short(*short_ptr);
-		short_ptr = (short int *) &line[46];
-		data->vru_y = (short int) mb_swap_short(*short_ptr);
-		short_ptr = (short int *) &line[48];
-		data->heave_offset = (short int) mb_swap_short(*short_ptr);
-		short_ptr = (short int *) &line[50];
-		data->line_number = (short int) mb_swap_short(*short_ptr);
-		short_ptr = (short int *) &line[52];
-		data->start_or_stop = (short int) mb_swap_short(*short_ptr);
-		short_ptr = (short int *) &line[54];
-		data->transducer_serial_number
-			= (short int) mb_swap_short(*short_ptr);
-#endif
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       year:             %d\n",data->par_year);
-		fprintf(stderr,"dbg5       month:            %d\n",data->par_month);
-		fprintf(stderr,"dbg5       day:              %d\n",data->par_day);
-		fprintf(stderr,"dbg5       hour:             %d\n",data->par_hour);
-		fprintf(stderr,"dbg5       minute:           %d\n",data->par_minute);
-		fprintf(stderr,"dbg5       sec:              %d\n",data->par_second);
-		fprintf(stderr,"dbg5       hundredth_sec:    %d\n",data->par_hundredth_sec);
-		fprintf(stderr,"dbg5       thousandth_sec:   %d\n",data->par_thousandth_sec);
-		fprintf(stderr,"dbg5       roll_offset:      %d\n",data->roll_offset);
-		fprintf(stderr,"dbg5       pitch_offset:     %d\n",data->pitch_offset);
-		fprintf(stderr,"dbg5       heading_offset:   %d\n",data->heading_offset);
-		fprintf(stderr,"dbg5       time_delay:       %d\n",data->time_delay);
-		fprintf(stderr,"dbg5       transducer_port_height: %d\n",
-			data->transducer_port_height);
-		fprintf(stderr,"dbg5       transducer_starboard_height:%d\n",
-			data->transducer_starboard_height);
-		fprintf(stderr,"dbg5       transducer_port_depth:     %d\n",
-			data->transducer_port_depth);
-		fprintf(stderr,"dbg5       transducer_starboard_depth:     %d\n",
-			data->transducer_starboard_depth);
-		fprintf(stderr,"dbg5       transducer_port_x:        %d\n",
-			data->transducer_port_x);
-		fprintf(stderr,"dbg5       transducer_starboard_x:        %d\n",
-			data->transducer_starboard_x);
-		fprintf(stderr,"dbg5       transducer_port_y:        %d\n",
-			data->transducer_port_y);
-		fprintf(stderr,"dbg5       transducer_starboard_y:  %d\n",
-			data->transducer_starboard_y);
-		fprintf(stderr,"dbg5       transducer_port_error:  %d\n",
-			data->transducer_port_error);
-		fprintf(stderr,"dbg5       transducer_starboard_error:  %d\n",
-			data->transducer_starboard_error);
-		fprintf(stderr,"dbg5       antenna_height:            %d\n",data->antenna_height);
-		fprintf(stderr,"dbg5       antenna_x:      %d\n",data->antenna_x);
-		fprintf(stderr,"dbg5       antenna_y:    %d\n",data->antenna_y);
-		fprintf(stderr,"dbg5       vru_height:%d\n",data->vru_height);
-		fprintf(stderr,"dbg5       vru_x:%d\n",data->vru_x);
-		fprintf(stderr,"dbg5       vru_y:%d\n",data->vru_y);
-		fprintf(stderr,"dbg5       heave_offset:%d\n",data->heave_offset);
-		fprintf(stderr,"dbg5       line_number:%d\n",data->line_number);
-		fprintf(stderr,"dbg5       start_or_stop:%d\n",data->start_or_stop);
-		fprintf(stderr,"dbg5       transducer_serial_number:%d\n",
-			data->transducer_serial_number);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_bchrtunb_rd_pos(int verbose, FILE *mbfp,
-		struct mbf_bchrtunb_struct *data, int *error)
-{
-	char	*function_name = "mbr_bchrtunb_rd_pos";
-	int	status = MB_SUCCESS;
-	char	line[ELAC_POS_SIZE+3];
-	short int *short_ptr;
-	int	*int_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       data:       %p\n",(void *)data);
-		}
-
-	/* read record into char array */
-	status = fread(line,1,ELAC_POS_SIZE+3,mbfp);
-	if (status == ELAC_POS_SIZE+3)
-		status = MB_SUCCESS;
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	/* get data */
-	if (status == MB_SUCCESS)
-		{
-		data->kind = MB_DATA_NAV;
-		data->pos_day =            (int) line[0];
-		data->pos_month =          (int) line[1];
-		data->pos_year =           (int) line[2];
-		data->pos_hour =           (int) line[3];
-		data->pos_minute =         (int) line[4];
-		data->pos_second =         (int) line[5];
-		data->pos_hundredth_sec =  (int) line[6];
-		data->pos_thousandth_sec = (int) line[7];
-#ifndef BYTESWAPPED
-		int_ptr = (int *) &line[8];
-		data->pos_latitude = *int_ptr;
-		int_ptr = (int *) &line[12];
-		data->pos_longitude = *int_ptr;
-		int_ptr = (int *) &line[16];
-		data->utm_northing = *int_ptr;
-		int_ptr = (int *) &line[20];
-		data->utm_easting = *int_ptr;
-		int_ptr = (int *) &line[24];
-		data->utm_zone_lon = *int_ptr;
-		data->utm_zone = line[28];
-		data->hemisphere = line[29];
-		data->ellipsoid = line[30];
-		data->pos_spare = line[31];
-		short_ptr = (short int *) &line[32];
-		data->semi_major_axis = (int) *short_ptr;
-		short_ptr = (short int *) &line[34];
-		data->other_quality = (int) *short_ptr;
-#else
-		int_ptr = (int *) &line[8];
-		data->pos_latitude = (int) mb_swap_int(*int_ptr);
-		int_ptr = (int *) &line[12];
-		data->pos_longitude = (int) mb_swap_int(*int_ptr);
-		int_ptr = (int *) &line[16];
-		data->utm_northing = (int) mb_swap_int(*int_ptr);
-		int_ptr = (int *) &line[20];
-		data->utm_easting = (int) mb_swap_int(*int_ptr);
-		int_ptr = (int *) &line[24];
-		data->utm_zone_lon = (int) mb_swap_int(*int_ptr);
-		data->utm_zone = line[28];
-		data->hemisphere = line[29];
-		data->ellipsoid = line[30];
-		data->pos_spare = line[31];
-		short_ptr = (short int *) &line[32];
-		data->semi_major_axis = (int) mb_swap_short(*short_ptr);
-		short_ptr = (short int *) &line[34];
-		data->other_quality = (int) mb_swap_short(*short_ptr);
-#endif
-		}
-
-	/* KLUGE for 1996 UNB TRAINING COURSE - FLIP LONGITUDE */
-	if (data->pos_year == 96
-	    && data->pos_month >= 6
-	    && data->pos_month <= 8)
-		data->pos_longitude = -data->pos_longitude;
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       year:             %d\n",data->pos_year);
-		fprintf(stderr,"dbg5       month:            %d\n",data->pos_month);
-		fprintf(stderr,"dbg5       day:              %d\n",data->pos_day);
-		fprintf(stderr,"dbg5       hour:             %d\n",data->pos_hour);
-		fprintf(stderr,"dbg5       minute:           %d\n",data->pos_minute);
-		fprintf(stderr,"dbg5       sec:              %d\n",data->pos_second);
-		fprintf(stderr,"dbg5       hundredth_sec:    %d\n",data->pos_hundredth_sec);
-		fprintf(stderr,"dbg5       thousandth_sec:   %d\n",data->pos_thousandth_sec);
-		fprintf(stderr,"dbg5       pos_latitude:     %d\n",data->pos_latitude);
-		fprintf(stderr,"dbg5       pos_longitude:    %d\n",data->pos_longitude);
-		fprintf(stderr,"dbg5       utm_northing:     %d\n",data->utm_northing);
-		fprintf(stderr,"dbg5       utm_easting:      %d\n",data->utm_easting);
-		fprintf(stderr,"dbg5       utm_zone_lon:     %d\n",data->utm_zone_lon);
-		fprintf(stderr,"dbg5       utm_zone:         %c\n",data->utm_zone);
-		fprintf(stderr,"dbg5       hemisphere:       %c\n",data->hemisphere);
-		fprintf(stderr,"dbg5       ellipsoid:        %c\n",data->ellipsoid);
-		fprintf(stderr,"dbg5       pos_spare:        %c\n",data->pos_spare);
-		fprintf(stderr,"dbg5       semi_major_axis:  %d\n",data->semi_major_axis);
-		fprintf(stderr,"dbg5       other_quality:    %d\n",data->other_quality);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_bchrtunb_rd_svp(int verbose, FILE *mbfp,
-		struct mbf_bchrtunb_struct *data, int *error)
-{
-	char	*function_name = "mbr_bchrtunb_rd_svp";
-	int	status = MB_SUCCESS;
-	char	line[ELAC_SVP_SIZE+3];
-	short int *short_ptr;
-	short int *short_ptr2;
-	int	*int_ptr;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       data:       %p\n",(void *)data);
-		}
-
-	/* read record into char array */
-	status = fread(line,1,ELAC_SVP_SIZE+3,mbfp);
-	if (status == ELAC_SVP_SIZE+3)
-		status = MB_SUCCESS;
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	/* get data */
-	if (status == MB_SUCCESS)
-		{
-		data->kind = MB_DATA_VELOCITY_PROFILE;
-		data->svp_day =            (int) line[0];
-		data->svp_month =          (int) line[1];
-		data->svp_year =           (int) line[2];
-		data->svp_hour =           (int) line[3];
-		data->svp_minute =         (int) line[4];
-		data->svp_second =         (int) line[5];
-		data->svp_hundredth_sec =  (int) line[6];
-		data->svp_thousandth_sec = (int) line[7];
-#ifndef BYTESWAPPED
-		int_ptr = (int *) &line[8];
-		data->svp_latitude = *int_ptr;
-		int_ptr = (int *) &line[12];
-		data->svp_longitude = *int_ptr;
-#else
-		int_ptr = (int *) &line[8];
-		data->svp_latitude = (int) mb_swap_int(*int_ptr);
-		int_ptr = (int *) &line[12];
-		data->svp_latitude = (int) mb_swap_int(*int_ptr);
-#endif
-		data->svp_num = 0;
-		for (i=0;i<500;i++)
-			{
-			short_ptr = (short int *) &line[16+4*i];
-			short_ptr2 = (short int *) &line[18+4*i];
-#ifndef BYTESWAPPED
-			data->svp_depth[i] = *short_ptr;
-			data->svp_vel[i] = *short_ptr2;
-#else
-			data->svp_depth[i] = (short int) mb_swap_short(*short_ptr);
-			data->svp_vel[i] = (short int) mb_swap_short(*short_ptr2);
-#endif
-			if (data->svp_vel[i] > 0) data->svp_num = i + 1;
-			}
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       year:             %d\n",data->svp_year);
-		fprintf(stderr,"dbg5       month:            %d\n",data->svp_month);
-		fprintf(stderr,"dbg5       day:              %d\n",data->svp_day);
-		fprintf(stderr,"dbg5       hour:             %d\n",data->svp_hour);
-		fprintf(stderr,"dbg5       minute:           %d\n",data->svp_minute);
-		fprintf(stderr,"dbg5       sec:              %d\n",data->svp_second);
-		fprintf(stderr,"dbg5       hundredth_sec:    %d\n",data->svp_hundredth_sec);
-		fprintf(stderr,"dbg5       thousandth_sec:   %d\n",data->svp_thousandth_sec);
-		fprintf(stderr,"dbg5       svp_latitude:     %d\n",data->svp_latitude);
-		fprintf(stderr,"dbg5       svp_longitude:    %d\n",data->svp_longitude);
-		fprintf(stderr,"dbg5       svp_num:          %d\n",data->svp_num);
-		for (i=0;i<data->svp_num;i++)
-			fprintf(stderr,"dbg5       depth: %d     vel: %d\n",
-				data->svp_depth[i],data->svp_vel[i]);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_bchrtunb_rd_bath56(int verbose, FILE *mbfp,
-		struct mbf_bchrtunb_struct *data, int *error)
-{
-	char	*function_name = "mbr_bchrtunb_rd_bath56";
-	int	status = MB_SUCCESS;
-	char	line[ELAC_BATH56_SIZE+3];
-	char	*profile;
-	char	*beam;
-	short int *short_ptr;
-	int	*int_ptr;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       data:       %p\n",(void *)data);
-		}
-
-	/* read record into char array */
-	status = fread(line,1,ELAC_BATH56_SIZE+3,mbfp);
-	if (status == ELAC_BATH56_SIZE+3)
-		status = MB_SUCCESS;
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	/* get data */
-	if (status == MB_SUCCESS)
-		{
-		data->kind = MB_DATA_DATA;
-#ifndef BYTESWAPPED
-		short_ptr = (short int *) &line[0];
-		data->ping_num = (int) *short_ptr;
-		short_ptr = (short int *) &line[2];
-		data->sound_vel = (int) *short_ptr;
-#else
-		short_ptr = (short int *) &line[0];
-		data->ping_num = (int) mb_swap_short(*short_ptr);
-		short_ptr = (short int *) &line[2];
-		data->sound_vel = (int) mb_swap_short(*short_ptr);
-#endif
-		data->mode = (int) line[4];
-		data->pulse_length = (int) line[5];
-		data->source_power = (int) line[6];
-		data->receiver_gain = (int) line[7];
-		data->profile_num = 7;
-		data->beams_bath = 56;
-		for (i=0;i<data->profile_num;i++)
-			{
-			profile = &line[8+i*120];
-			data->profile[i].day =            (int) profile[0];
-			data->profile[i].month =          (int) profile[1];
-			data->profile[i].year =           (int) profile[2];
-			data->profile[i].hour =           (int) profile[3];
-			data->profile[i].minute =         (int) profile[4];
-			data->profile[i].second =         (int) profile[5];
-			data->profile[i].hundredth_sec =  (int) profile[6];
-			data->profile[i].thousandth_sec = (int) profile[7];
-#ifndef BYTESWAPPED
-			int_ptr = (int *) &profile[8];
-			data->profile[i].latitude = (int) *int_ptr;
-			int_ptr = (int *) &profile[12];
-			data->profile[i].longitude = (int) *int_ptr;
-			short_ptr = (short int *) &profile[16];
-			data->profile[i].roll = (int) *short_ptr;
-			short_ptr = (short int *) &profile[18];
-			data->profile[i].pitch = (int) *short_ptr;
-			short_ptr = (short int *) &profile[20];
-			data->profile[i].heading = (int)(unsigned short) *short_ptr;
-			short_ptr = (short int *) &profile[22];
-			data->profile[i].heave = (int) *short_ptr;
-			for (j=0;j<8;j++)
-				{
-				beam = &profile[24 + 12*j];
-				short_ptr = (short *) &beam[0];
-				data->profile[i].bath[j] = (short int) *short_ptr;
-				short_ptr = (short *) &beam[2];
-				data->profile[i].bath_acrosstrack[j]
-					= (short int) *short_ptr;
-				short_ptr = (short *) &beam[4];
-				data->profile[i].bath_alongtrack[j]
-					= (short int) *short_ptr;
-				short_ptr = (short *) &beam[6];
-				data->profile[i].tt[j] = (short int) *short_ptr;
-				short_ptr = (short *) &beam[8];
-				data->profile[i].angle[j] = (short int) *short_ptr;
-				data->profile[i].quality[j] = (short int) beam[10];
-				data->profile[i].amp[j] = (short int) beam[11];
-				}
-#else
-			int_ptr = (int *) &profile[8];
-			data->profile[i].latitude
-				= (int) mb_swap_int(*int_ptr);
-			int_ptr = (int *) &profile[12];
-			data->profile[i].longitude
-				= (int) mb_swap_int(*int_ptr);
-			short_ptr = (short int *) &profile[16];
-			data->profile[i].roll
-				= (int) mb_swap_short(*short_ptr);
-			short_ptr = (short int *) &profile[18];
-			data->profile[i].pitch
-				= (int) mb_swap_short(*short_ptr);
-			short_ptr = (short int *) &profile[20];
-			data->profile[i].heading
-				= (int)(unsigned short) mb_swap_short(*short_ptr);
-			short_ptr = (short int *) &profile[22];
-			data->profile[i].heave
-				= (int) mb_swap_short(*short_ptr);
-			for (j=0;j<8;j++)
-				{
-				beam = &profile[24 + 12*j];
-				short_ptr = (short *) &beam[0];
-				data->profile[i].bath[j]
-					= (short int) mb_swap_short(*short_ptr);
-				short_ptr = (short *) &beam[2];
-				data->profile[i].bath_acrosstrack[j]
-					= (short int) mb_swap_short(*short_ptr);
-				short_ptr = (short *) &beam[4];
-				data->profile[i].bath_alongtrack[j]
-					= (short int) mb_swap_short(*short_ptr);
-				short_ptr = (short *) &beam[6];
-				data->profile[i].tt[j]
-					= (short int) mb_swap_short(*short_ptr);
-				short_ptr = (short *) &beam[8];
-				data->profile[i].angle[j]
-					= (short int) mb_swap_short(*short_ptr);
-				data->profile[i].quality[j] = (short int) beam[10];
-				data->profile[i].amp[j] = (short int) beam[11];
-				}
-#endif
-			}
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       ping_num:         %d\n",data->ping_num);
-		fprintf(stderr,"dbg5       sound_vel:        %d\n",data->sound_vel);
-		fprintf(stderr,"dbg5       mode:             %d\n",data->mode);
-		fprintf(stderr,"dbg5       pulse_length:     %d\n",
-			data->pulse_length);
-		fprintf(stderr,"dbg5       source_power:     %d\n",
-			data->source_power);
-		fprintf(stderr,"dbg5       receiver_gain:    %d\n",
-			data->receiver_gain);
-		fprintf(stderr,"dbg5       profile_num:      %d\n",
-			data->profile_num);
-		fprintf(stderr,"dbg5       beams_bath:       %d\n",
-			data->beams_bath);
-		for (i=0;i<data->profile_num;i++)
-			{
-			fprintf(stderr,"dbg5       profile:          %d\n",i);
-			fprintf(stderr,"dbg5       year:             %d\n",
-				data->profile[i].year);
-			fprintf(stderr,"dbg5       month:            %d\n",
-				data->profile[i].month);
-			fprintf(stderr,"dbg5       day:              %d\n",
-				data->profile[i].day);
-			fprintf(stderr,"dbg5       hour:             %d\n",
-				data->profile[i].hour);
-			fprintf(stderr,"dbg5       minute:           %d\n",
-				data->profile[i].minute);
-			fprintf(stderr,"dbg5       sec:              %d\n",
-				data->profile[i].second);
-			fprintf(stderr,"dbg5       hundredth_sec:    %d\n",
-				data->profile[i].hundredth_sec);
-			fprintf(stderr,"dbg5       thousandth_sec:   %d\n",
-				data->profile[i].thousandth_sec);
-			fprintf(stderr,"dbg5       latitude:         %d\n",
-				data->profile[i].latitude);
-			fprintf(stderr,"dbg5       longitude:        %d\n",
-				data->profile[i].longitude);
-			fprintf(stderr,"dbg5       roll:             %d\n",
-				data->profile[i].roll);
-			fprintf(stderr,"dbg5       pitch:            %d\n",
-				data->profile[i].pitch);
-			fprintf(stderr,"dbg5       heading:          %d\n",
-				data->profile[i].heading);
-			fprintf(stderr,"dbg5       heave:            %d\n",
-				data->profile[i].heave);
-			for (j=0;j<8;j++)
-				{
-				fprintf(stderr,"dbg5       bath[%2d][%d]:             %d\n",
-					i,j,data->profile[i].bath[j]);
-				fprintf(stderr,"dbg5       bath_acrosstrack[%2d][%d]: %d\n",
-					i,j,data->profile[i].bath_acrosstrack[j]);
-				fprintf(stderr,"dbg5       bath_alongtrack[%2d][%d]:  %d\n",
-					i,j,data->profile[i].bath_alongtrack[j]);
-				fprintf(stderr,"dbg5       tt[%2d][%d]:               %d\n",
-					i,j,data->profile[i].tt[j]);
-				fprintf(stderr,"dbg5       angle[%2d][%d]:            %d\n",
-					i,j,data->profile[i].angle[j]);
-				fprintf(stderr,"dbg5       quality[%2d][%d]:          %d\n",
-					i,j,data->profile[i].quality[j]);
-				fprintf(stderr,"dbg5       amp[%2d][%d]:              %d\n",
-					i,j,data->profile[i].amp[j]);
-				}
-			fprintf(stderr,"dbg5       \n");
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_bchrtunb_rd_bath40(int verbose, FILE *mbfp,
-		struct mbf_bchrtunb_struct *data, int *error)
-{
-	char	*function_name = "mbr_bchrtunb_rd_bath40";
-	int	status = MB_SUCCESS;
-	char	line[ELAC_BATH40_SIZE+3];
-	char	*profile;
-	char	*beam;
-	short int *short_ptr;
-	int	*int_ptr;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       data:       %p\n",(void *)data);
-		}
-
-	/* read record into char array */
-	status = fread(line,1,ELAC_BATH40_SIZE+3,mbfp);
-	if (status == ELAC_BATH40_SIZE+3)
-		status = MB_SUCCESS;
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	/* get data */
-	if (status == MB_SUCCESS)
-		{
-		data->kind = MB_DATA_DATA;
-#ifndef BYTESWAPPED
-		short_ptr = (short int *) &line[0];
-		data->ping_num = (int) *short_ptr;
-		short_ptr = (short int *) &line[2];
-		data->sound_vel = (int) *short_ptr;
-#else
-		short_ptr = (short int *) &line[0];
-		data->ping_num = (int) mb_swap_short(*short_ptr);
-		short_ptr = (short int *) &line[2];
-		data->sound_vel = (int) mb_swap_short(*short_ptr);
-#endif
-		data->mode = (int) line[4];
-		data->pulse_length = (int) line[5];
-		data->source_power = (int) line[6];
-		data->receiver_gain = (int) line[7];
-		data->profile_num = 5;
-		data->beams_bath = 40;
-		for (i=0;i<data->profile_num;i++)
-			{
-			profile = &line[8+i*120];
-			data->profile[i].day =            (int) profile[0];
-			data->profile[i].month =          (int) profile[1];
-			data->profile[i].year =           (int) profile[2];
-			data->profile[i].hour =           (int) profile[3];
-			data->profile[i].minute =         (int) profile[4];
-			data->profile[i].second =         (int) profile[5];
-			data->profile[i].hundredth_sec =  (int) profile[6];
-			data->profile[i].thousandth_sec = (int) profile[7];
-#ifndef BYTESWAPPED
-			int_ptr = (int *) &profile[8];
-			data->profile[i].latitude = (int) *int_ptr;
-			int_ptr = (int *) &profile[12];
-			data->profile[i].longitude = (int) *int_ptr;
-			short_ptr = (short int *) &profile[16];
-			data->profile[i].roll = (int) *short_ptr;
-			short_ptr = (short int *) &profile[18];
-			data->profile[i].pitch = (int) *short_ptr;
-			short_ptr = (short int *) &profile[20];
-			data->profile[i].heading = (int)(unsigned short) *short_ptr;
-			short_ptr = (short int *) &profile[22];
-			data->profile[i].heave = (int) *short_ptr;
-			for (j=0;j<8;j++)
-				{
-				beam = &profile[24 + 12*j];
-				short_ptr = (short *) &beam[0];
-				data->profile[i].bath[j] = (short int) *short_ptr;
-				short_ptr = (short *) &beam[2];
-				data->profile[i].bath_acrosstrack[j]
-					= (short int) *short_ptr;
-				short_ptr = (short *) &beam[4];
-				data->profile[i].bath_alongtrack[j]
-					= (short int) *short_ptr;
-				short_ptr = (short *) &beam[6];
-				data->profile[i].tt[j] = (short int) *short_ptr;
-				short_ptr = (short *) &beam[8];
-				data->profile[i].angle[j] = (short int) *short_ptr;
-				data->profile[i].quality[j] = (short int) beam[10];
-				data->profile[i].amp[j] = (short int) beam[11];
-				}
-#else
-			int_ptr = (int *) &profile[8];
-			data->profile[i].latitude
-				= (int) mb_swap_int(*int_ptr);
-			int_ptr = (int *) &profile[12];
-			data->profile[i].longitude
-				= (int) mb_swap_int(*int_ptr);
-			short_ptr = (short int *) &profile[16];
-			data->profile[i].roll
-				= (int) mb_swap_short(*short_ptr);
-			short_ptr = (short int *) &profile[18];
-			data->profile[i].pitch
-				= (int) mb_swap_short(*short_ptr);
-			short_ptr = (short int *) &profile[20];
-			data->profile[i].heading
-				= (int)(unsigned short) mb_swap_short(*short_ptr);
-			short_ptr = (short int *) &profile[22];
-			data->profile[i].heave
-				= (int) mb_swap_short(*short_ptr);
-			for (j=0;j<8;j++)
-				{
-				beam = &profile[24 + 12*j];
-				short_ptr = (short *) &beam[0];
-				data->profile[i].bath[j]
-					= (short int) mb_swap_short(*short_ptr);
-				short_ptr = (short *) &beam[2];
-				data->profile[i].bath_acrosstrack[j]
-					= (short int) mb_swap_short(*short_ptr);
-				short_ptr = (short *) &beam[4];
-				data->profile[i].bath_alongtrack[j]
-					= (short int) mb_swap_short(*short_ptr);
-				short_ptr = (short *) &beam[6];
-				data->profile[i].tt[j]
-					= (short int) mb_swap_short(*short_ptr);
-				short_ptr = (short *) &beam[8];
-				data->profile[i].angle[j]
-					= (short int) mb_swap_short(*short_ptr);
-				data->profile[i].quality[j] = (short int) beam[10];
-				data->profile[i].amp[j] = (short int) beam[11];
-				}
-#endif
-			}
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       ping_num:         %d\n",data->ping_num);
-		fprintf(stderr,"dbg5       sound_vel:        %d\n",data->sound_vel);
-		fprintf(stderr,"dbg5       mode:             %d\n",data->mode);
-		fprintf(stderr,"dbg5       pulse_length:     %d\n",
-			data->pulse_length);
-		fprintf(stderr,"dbg5       source_power:     %d\n",
-			data->source_power);
-		fprintf(stderr,"dbg5       receiver_gain:    %d\n",
-			data->receiver_gain);
-		fprintf(stderr,"dbg5       profile_num:      %d\n",
-			data->profile_num);
-		fprintf(stderr,"dbg5       beams_bath:       %d\n",
-			data->beams_bath);
-		for (i=0;i<data->profile_num;i++)
-			{
-			fprintf(stderr,"dbg5       profile:          %d\n",i);
-			fprintf(stderr,"dbg5       year:             %d\n",
-				data->profile[i].year);
-			fprintf(stderr,"dbg5       month:            %d\n",
-				data->profile[i].month);
-			fprintf(stderr,"dbg5       day:              %d\n",
-				data->profile[i].day);
-			fprintf(stderr,"dbg5       hour:             %d\n",
-				data->profile[i].hour);
-			fprintf(stderr,"dbg5       minute:           %d\n",
-				data->profile[i].minute);
-			fprintf(stderr,"dbg5       sec:              %d\n",
-				data->profile[i].second);
-			fprintf(stderr,"dbg5       hundredth_sec:    %d\n",
-				data->profile[i].hundredth_sec);
-			fprintf(stderr,"dbg5       thousandth_sec:   %d\n",
-				data->profile[i].thousandth_sec);
-			fprintf(stderr,"dbg5       latitude:         %d\n",
-				data->profile[i].latitude);
-			fprintf(stderr,"dbg5       longitude:        %d\n",
-				data->profile[i].longitude);
-			fprintf(stderr,"dbg5       roll:             %d\n",
-				data->profile[i].roll);
-			fprintf(stderr,"dbg5       pitch:            %d\n",
-				data->profile[i].pitch);
-			fprintf(stderr,"dbg5       heading:          %d\n",
-				data->profile[i].heading);
-			fprintf(stderr,"dbg5       heave:            %d\n",
-				data->profile[i].heave);
-			for (j=0;j<8;j++)
-				{
-				fprintf(stderr,"dbg5       bath:             %d\n",
-					data->profile[i].bath[j]);
-				fprintf(stderr,"dbg5       bath_acrosstrack: %d\n",
-					data->profile[i].bath_acrosstrack[j]);
-				fprintf(stderr,"dbg5       bath_alongtrack:  %d\n",
-					data->profile[i].bath_alongtrack[j]);
-				fprintf(stderr,"dbg5       tt:               %d\n",
-					data->profile[i].tt[j]);
-				fprintf(stderr,"dbg5       angle:            %d\n",
-					data->profile[i].angle[j]);
-				fprintf(stderr,"dbg5       quality:          %d\n",
-					data->profile[i].quality[j]);
-				fprintf(stderr,"dbg5       amp:              %d\n",
-					data->profile[i].amp[j]);
-				}
-			fprintf(stderr,"dbg5       \n");
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_bchrtunb_rd_bath32(int verbose, FILE *mbfp,
-		struct mbf_bchrtunb_struct *data, int *error)
-{
-	char	*function_name = "mbr_bchrtunb_rd_bath32";
-	int	status = MB_SUCCESS;
-	char	line[ELAC_BATH32_SIZE+3];
-	char	*profile;
-	char	*beam;
-	short int *short_ptr;
-	int	*int_ptr;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       data:       %p\n",(void *)data);
-		}
-
-	/* read record into char array */
-	status = fread(line,1,ELAC_BATH32_SIZE+3,mbfp);
-	if (status == ELAC_BATH32_SIZE+3)
-		status = MB_SUCCESS;
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	/* get data */
-	if (status == MB_SUCCESS)
-		{
-		data->kind = MB_DATA_DATA;
-#ifndef BYTESWAPPED
-		short_ptr = (short int *) &line[0];
-		data->ping_num = (int) *short_ptr;
-		short_ptr = (short int *) &line[2];
-		data->sound_vel = (int) *short_ptr;
-#else
-		short_ptr = (short int *) &line[0];
-		data->ping_num = (int) mb_swap_short(*short_ptr);
-		short_ptr = (short int *) &line[2];
-		data->sound_vel = (int) mb_swap_short(*short_ptr);
-#endif
-		data->mode = (int) line[4];
-		data->pulse_length = (int) line[5];
-		data->source_power = (int) line[6];
-		data->receiver_gain = (int) line[7];
-		data->profile_num = 4;
-		data->beams_bath = 32;
-		for (i=0;i<data->profile_num;i++)
-			{
-			profile = &line[8+i*120];
-			data->profile[i].day =            (int) profile[0];
-			data->profile[i].month =          (int) profile[1];
-			data->profile[i].year =           (int) profile[2];
-			data->profile[i].hour =           (int) profile[3];
-			data->profile[i].minute =         (int) profile[4];
-			data->profile[i].second =         (int) profile[5];
-			data->profile[i].hundredth_sec =  (int) profile[6];
-			data->profile[i].thousandth_sec = (int) profile[7];
-#ifndef BYTESWAPPED
-			int_ptr = (int *) &profile[8];
-			data->profile[i].latitude = (int) *int_ptr;
-			int_ptr = (int *) &profile[12];
-			data->profile[i].longitude = (int) *int_ptr;
-			short_ptr = (short int *) &profile[16];
-			data->profile[i].roll = (int) *short_ptr;
-			short_ptr = (short int *) &profile[18];
-			data->profile[i].pitch = (int) *short_ptr;
-			short_ptr = (short int *) &profile[20];
-			data->profile[i].heading = (int)(unsigned short) *short_ptr;
-			short_ptr = (short int *) &profile[22];
-			data->profile[i].heave = (int) *short_ptr;
-			for (j=0;j<8;j++)
-				{
-				beam = &profile[24 + 12*j];
-				short_ptr = (short *) &beam[0];
-				data->profile[i].bath[j] = (short int) *short_ptr;
-				short_ptr = (short *) &beam[2];
-				data->profile[i].bath_acrosstrack[j]
-					= (short int) *short_ptr;
-				short_ptr = (short *) &beam[4];
-				data->profile[i].bath_alongtrack[j]
-					= (short int) *short_ptr;
-				short_ptr = (short *) &beam[6];
-				data->profile[i].tt[j] = (short int) *short_ptr;
-				short_ptr = (short *) &beam[8];
-				data->profile[i].angle[j] = (short int) *short_ptr;
-				data->profile[i].quality[j] = (short int) beam[10];
-				data->profile[i].amp[j] = (short int) beam[11];
-				}
-#else
-			int_ptr = (int *) &profile[8];
-			data->profile[i].latitude
-				= (int) mb_swap_int(*int_ptr);
-			int_ptr = (int *) &profile[12];
-			data->profile[i].longitude
-				= (int) mb_swap_int(*int_ptr);
-			short_ptr = (short int *) &profile[16];
-			data->profile[i].roll
-				= (int) mb_swap_short(*short_ptr);
-			short_ptr = (short int *) &profile[18];
-			data->profile[i].pitch
-				= (int) mb_swap_short(*short_ptr);
-			short_ptr = (short int *) &profile[20];
-			data->profile[i].heading
-				= (int)(unsigned short) mb_swap_short(*short_ptr);
-			short_ptr = (short int *) &profile[22];
-			data->profile[i].heave
-				= (int) mb_swap_short(*short_ptr);
-			for (j=0;j<8;j++)
-				{
-				beam = &profile[24 + 12*j];
-				short_ptr = (short *) &beam[0];
-				data->profile[i].bath[j]
-					= (short int) mb_swap_short(*short_ptr);
-				short_ptr = (short *) &beam[2];
-				data->profile[i].bath_acrosstrack[j]
-					= (short int) mb_swap_short(*short_ptr);
-				short_ptr = (short *) &beam[4];
-				data->profile[i].bath_alongtrack[j]
-					= (short int) mb_swap_short(*short_ptr);
-				short_ptr = (short *) &beam[6];
-				data->profile[i].tt[j]
-					= (short int) mb_swap_short(*short_ptr);
-				short_ptr = (short *) &beam[8];
-				data->profile[i].angle[j]
-					= (short int) mb_swap_short(*short_ptr);
-				data->profile[i].quality[j] = (short int) beam[10];
-				data->profile[i].amp[j] = (short int) beam[11];
-				}
-#endif
-			}
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       ping_num:         %d\n",data->ping_num);
-		fprintf(stderr,"dbg5       sound_vel:        %d\n",data->sound_vel);
-		fprintf(stderr,"dbg5       mode:             %d\n",data->mode);
-		fprintf(stderr,"dbg5       pulse_length:     %d\n",
-			data->pulse_length);
-		fprintf(stderr,"dbg5       source_power:     %d\n",
-			data->source_power);
-		fprintf(stderr,"dbg5       receiver_gain:    %d\n",
-			data->receiver_gain);
-		fprintf(stderr,"dbg5       profile_num:      %d\n",
-			data->profile_num);
-		fprintf(stderr,"dbg5       beams_bath:       %d\n",
-			data->beams_bath);
-		for (i=0;i<data->profile_num;i++)
-			{
-			fprintf(stderr,"dbg5       profile:          %d\n",i);
-			fprintf(stderr,"dbg5       year:             %d\n",
-				data->profile[i].year);
-			fprintf(stderr,"dbg5       month:            %d\n",
-				data->profile[i].month);
-			fprintf(stderr,"dbg5       day:              %d\n",
-				data->profile[i].day);
-			fprintf(stderr,"dbg5       hour:             %d\n",
-				data->profile[i].hour);
-			fprintf(stderr,"dbg5       minute:           %d\n",
-				data->profile[i].minute);
-			fprintf(stderr,"dbg5       sec:              %d\n",
-				data->profile[i].second);
-			fprintf(stderr,"dbg5       hundredth_sec:    %d\n",
-				data->profile[i].hundredth_sec);
-			fprintf(stderr,"dbg5       thousandth_sec:   %d\n",
-				data->profile[i].thousandth_sec);
-			fprintf(stderr,"dbg5       latitude:         %d\n",
-				data->profile[i].latitude);
-			fprintf(stderr,"dbg5       longitude:        %d\n",
-				data->profile[i].longitude);
-			fprintf(stderr,"dbg5       roll:             %d\n",
-				data->profile[i].roll);
-			fprintf(stderr,"dbg5       pitch:            %d\n",
-				data->profile[i].pitch);
-			fprintf(stderr,"dbg5       heading:          %d\n",
-				data->profile[i].heading);
-			fprintf(stderr,"dbg5       heave:            %d\n",
-				data->profile[i].heave);
-			for (j=0;j<8;j++)
-				{
-				fprintf(stderr,"dbg5       bath:             %d\n",
-					data->profile[i].bath[j]);
-				fprintf(stderr,"dbg5       bath_acrosstrack: %d\n",
-					data->profile[i].bath_acrosstrack[j]);
-				fprintf(stderr,"dbg5       bath_alongtrack:  %d\n",
-					data->profile[i].bath_alongtrack[j]);
-				fprintf(stderr,"dbg5       tt:               %d\n",
-					data->profile[i].tt[j]);
-				fprintf(stderr,"dbg5       angle:            %d\n",
-					data->profile[i].angle[j]);
-				fprintf(stderr,"dbg5       quality:          %d\n",
-					data->profile[i].quality[j]);
-				fprintf(stderr,"dbg5       amp:              %d\n",
-					data->profile[i].amp[j]);
-				}
-			fprintf(stderr,"dbg5       \n");
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_bchrtunb_wr_data(int verbose, void *mbio_ptr,
-		struct mbf_bchrtunb_struct *data, int *error)
-{
-
-	char	*function_name = "mbr_bchrtunb_wr_data";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	FILE	*mbfp;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       data:        %p\n",(void *)data);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-	mbfp = mb_io_ptr->mbfp;
-
-	if (data->kind == MB_DATA_COMMENT)
-		{
-		status = mbr_bchrtunb_wr_comment(verbose,mbfp,data,error);
-		}
-	else if (data->kind == MB_DATA_PARAMETER)
-		{
-		status = mbr_bchrtunb_wr_parameter(verbose,mbfp,data,error);
-		}
-	else if (data->kind == MB_DATA_NAV)
-		{
-		status = mbr_bchrtunb_wr_pos(verbose,mbfp,data,error);
-		}
-	else if (data->kind == MB_DATA_VELOCITY_PROFILE)
-		{
-		status = mbr_bchrtunb_wr_svp(verbose,mbfp,data,error);
-		}
-	else if (data->kind == MB_DATA_DATA && data->profile_num == 7)
-		{
-		status = mbr_bchrtunb_wr_bath56(verbose,mbfp,data,error);
-		}
-	else if (data->kind == MB_DATA_DATA && data->profile_num == 5)
-		{
-		status = mbr_bchrtunb_wr_bath40(verbose,mbfp,data,error);
-		}
-	else if (data->kind == MB_DATA_DATA && data->profile_num == 4)
-		{
-		status = mbr_bchrtunb_wr_bath32(verbose,mbfp,data,error);
-		}
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_BAD_KIND;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Data record kind in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       kind:       %d\n",data->kind);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_bchrtunb_wr_comment(int verbose, FILE *mbfp,
-		struct mbf_bchrtunb_struct *data, int *error)
-{
-
-	char	*function_name = "mbr_bchrtunb_wr_comment";
-	int	status = MB_SUCCESS;
-	char	line[ELAC_COMMENT_SIZE+3];
-	short int label;
-	int	len;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       data:       %p\n",(void *)data);
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       comment:          %s\n",data->comment);
-		}
-
-	/* write the record label */
-	label = ELAC_COMMENT;
-#ifdef BYTESWAPPED
-	label = (short) mb_swap_short(label);
-#endif
-	status = fwrite(&label,1,2,mbfp);
-	if (status != 2)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	else
-		status = MB_SUCCESS;
-
-	/* write out the data */
-	if (status == MB_SUCCESS)
-		{
-		/* construct record */
-		len = strlen(data->comment);
-		if (len > MBSYS_ELAC_COMMENT_LENGTH)
-			len = MBSYS_ELAC_COMMENT_LENGTH;
-		for (i=0;i<len;i++)
-			line[i] = data->comment[i];
-		for (i=len;i<MBSYS_ELAC_COMMENT_LENGTH;i++)
-			line[i] = '\0';
-		line[ELAC_COMMENT_SIZE] = 0x03;
-		line[ELAC_COMMENT_SIZE+1] = '\0';
-		line[ELAC_COMMENT_SIZE+2] = '\0';
-
-		/* write out data */
-		status = fwrite(line,1,ELAC_COMMENT_SIZE+3,mbfp);
-		if (status != ELAC_COMMENT_SIZE+3)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_bchrtunb_wr_parameter(int verbose, FILE *mbfp,
-		struct mbf_bchrtunb_struct *data, int *error)
-{
-
-	char	*function_name = "mbr_bchrtunb_wr_parameter";
-	int	status = MB_SUCCESS;
-	char	line[ELAC_PARAMETER_SIZE+3];
-	short int label;
-	short int *short_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       data:       %p\n",(void *)data);
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       year:             %d\n",data->par_year);
-		fprintf(stderr,"dbg5       month:            %d\n",data->par_month);
-		fprintf(stderr,"dbg5       day:              %d\n",data->par_day);
-		fprintf(stderr,"dbg5       hour:             %d\n",data->par_hour);
-		fprintf(stderr,"dbg5       minute:           %d\n",data->par_minute);
-		fprintf(stderr,"dbg5       sec:              %d\n",data->par_second);
-		fprintf(stderr,"dbg5       hundredth_sec:    %d\n",data->par_hundredth_sec);
-		fprintf(stderr,"dbg5       thousandth_sec:   %d\n",data->par_thousandth_sec);
-		fprintf(stderr,"dbg5       roll_offset:      %d\n",data->roll_offset);
-		fprintf(stderr,"dbg5       pitch_offset:     %d\n",data->pitch_offset);
-		fprintf(stderr,"dbg5       heading_offset:   %d\n",data->heading_offset);
-		fprintf(stderr,"dbg5       time_delay:       %d\n",data->time_delay);
-		fprintf(stderr,"dbg5       transducer_port_height: %d\n",
-			data->transducer_port_height);
-		fprintf(stderr,"dbg5       transducer_starboard_height:%d\n",
-			data->transducer_starboard_height);
-		fprintf(stderr,"dbg5       transducer_port_depth:     %d\n",
-			data->transducer_port_depth);
-		fprintf(stderr,"dbg5       transducer_starboard_depth:     %d\n",
-			data->transducer_starboard_depth);
-		fprintf(stderr,"dbg5       transducer_port_x:        %d\n",
-			data->transducer_port_x);
-		fprintf(stderr,"dbg5       transducer_starboard_x:        %d\n",
-			data->transducer_starboard_x);
-		fprintf(stderr,"dbg5       transducer_port_y:        %d\n",
-			data->transducer_port_y);
-		fprintf(stderr,"dbg5       transducer_starboard_y:  %d\n",
-			data->transducer_starboard_y);
-		fprintf(stderr,"dbg5       transducer_port_error:  %d\n",
-			data->transducer_port_error);
-		fprintf(stderr,"dbg5       transducer_starboard_error:  %d\n",
-			data->transducer_starboard_error);
-		fprintf(stderr,"dbg5       antenna_height:            %d\n",data->antenna_height);
-		fprintf(stderr,"dbg5       antenna_x:      %d\n",data->antenna_x);
-		fprintf(stderr,"dbg5       antenna_y:    %d\n",data->antenna_y);
-		fprintf(stderr,"dbg5       vru_height:%d\n",data->vru_height);
-		fprintf(stderr,"dbg5       vru_x:%d\n",data->vru_x);
-		fprintf(stderr,"dbg5       vru_y:%d\n",data->vru_y);
-		fprintf(stderr,"dbg5       heave_offset:%d\n",data->heave_offset);
-		fprintf(stderr,"dbg5       line_number:%d\n",data->line_number);
-		fprintf(stderr,"dbg5       start_or_stop:%d\n",data->start_or_stop);
-		fprintf(stderr,"dbg5       transducer_serial_number:%d\n",
-			data->transducer_serial_number);
-		}
-
-	/* write the record label */
-	label = ELAC_PARAMETER;
-#ifdef BYTESWAPPED
-	label = (short) mb_swap_short(label);
-#endif
-	status = fwrite(&label,1,2,mbfp);
-	if (status != 2)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	else
-		status = MB_SUCCESS;
-
-	/* write out the data */
-	if (status == MB_SUCCESS)
-		{
-		/* construct record */
-		line[0] = (char) data->par_day;
-		line[1] = (char) data->par_month;
-		line[2] = (char) data->par_year;
-		line[3] = (char) data->par_hour;
-		line[4] = (char) data->par_minute;
-		line[5] = (char) data->par_second;
-		line[6] = (char) data->par_hundredth_sec;
-		line[7] = (char) data->par_thousandth_sec;
-#ifndef BYTESWAPPED
-		short_ptr = (short int *) &line[8];
-		*short_ptr = data->roll_offset;
-		short_ptr = (short int *) &line[10];
-		*short_ptr = data->pitch_offset;
-		short_ptr = (short int *) &line[12];
-		*short_ptr = data->heading_offset;
-		short_ptr = (short int *) &line[14];
-		*short_ptr = data->time_delay;
-		short_ptr = (short int *) &line[16];
-		*short_ptr = data->transducer_port_height;
-		short_ptr = (short int *) &line[18];
-		*short_ptr = data->transducer_starboard_height;
-		short_ptr = (short int *) &line[20];
-		*short_ptr = data->transducer_port_depth;
-		short_ptr = (short int *) &line[22];
-		*short_ptr = data->transducer_starboard_depth;
-		short_ptr = (short int *) &line[24];
-		*short_ptr = data->transducer_port_x;
-		short_ptr = (short int *) &line[26];
-		*short_ptr = data->transducer_starboard_x;
-		short_ptr = (short int *) &line[28];
-		*short_ptr = data->transducer_port_y;
-		short_ptr = (short int *) &line[30];
-		*short_ptr = data->transducer_starboard_y;
-		short_ptr = (short int *) &line[32];
-		*short_ptr = data->transducer_port_error;
-		short_ptr = (short int *) &line[34];
-		*short_ptr = data->transducer_starboard_error;
-		short_ptr = (short int *) &line[36];
-		*short_ptr = data->antenna_height;
-		short_ptr = (short int *) &line[38];
-		*short_ptr = data->antenna_x;
-		short_ptr = (short int *) &line[40];
-		*short_ptr = data->antenna_y;
-		short_ptr = (short int *) &line[42];
-		*short_ptr = data->vru_height;
-		short_ptr = (short int *) &line[44];
-		*short_ptr = data->vru_x;
-		short_ptr = (short int *) &line[46];
-		*short_ptr = data->vru_y;
-		short_ptr = (short int *) &line[48];
-		*short_ptr = data->heave_offset;
-		short_ptr = (short int *) &line[50];
-		*short_ptr = data->line_number;
-		short_ptr = (short int *) &line[52];
-		*short_ptr = data->start_or_stop;
-		short_ptr = (short int *) &line[54];
-		*short_ptr = data->transducer_serial_number;
-#else
-		short_ptr = (short int *) &line[8];
-		*short_ptr = (short int) mb_swap_short(data->roll_offset);
-		short_ptr = (short int *) &line[10];
-		*short_ptr = (short int) mb_swap_short(data->pitch_offset);
-		short_ptr = (short int *) &line[12];
-		*short_ptr = (short int) mb_swap_short(data->heading_offset);
-		short_ptr = (short int *) &line[14];
-		*short_ptr = (short int) mb_swap_short(data->time_delay);
-		short_ptr = (short int *) &line[16];
-		*short_ptr = (short int)
-			mb_swap_short(data->transducer_port_height);
-		short_ptr = (short int *) &line[18];
-		*short_ptr = (short int)
-			mb_swap_short(data->transducer_starboard_height);
-		short_ptr = (short int *) &line[20];
-		*short_ptr = (short int) mb_swap_short(data->transducer_port_depth);
-		short_ptr = (short int *) &line[22];
-		*short_ptr = (short int)
-			mb_swap_short(data->transducer_starboard_depth);
-		short_ptr = (short int *) &line[24];
-		*short_ptr = (short int) mb_swap_short(data->transducer_port_x);
-		short_ptr = (short int *) &line[26];
-		*short_ptr = (short int)
-			mb_swap_short(data->transducer_starboard_x);
-		short_ptr = (short int *) &line[28];
-		*short_ptr = (short int) mb_swap_short(data->transducer_port_y);
-		short_ptr = (short int *) &line[30];
-		*short_ptr = (short int)
-			mb_swap_short(data->transducer_starboard_y);
-		short_ptr = (short int *) &line[32];
-		*short_ptr = (short int) mb_swap_short(data->transducer_port_error);
-		short_ptr = (short int *) &line[34];
-		*short_ptr = (short int)
-			mb_swap_short(data->transducer_starboard_error);
-		short_ptr = (short int *) &line[36];
-		*short_ptr = (short int) mb_swap_short(data->antenna_height);
-		short_ptr = (short int *) &line[38];
-		*short_ptr = (short int) mb_swap_short(data->antenna_x);
-		short_ptr = (short int *) &line[40];
-		*short_ptr = (short int) mb_swap_short(data->antenna_y);
-		short_ptr = (short int *) &line[42];
-		*short_ptr = (short int) mb_swap_short(data->vru_height);
-		short_ptr = (short int *) &line[44];
-		*short_ptr = (short int) mb_swap_short(data->vru_x);
-		short_ptr = (short int *) &line[46];
-		*short_ptr = (short int) mb_swap_short(data->vru_y);
-		short_ptr = (short int *) &line[48];
-		*short_ptr = (short int) mb_swap_short(data->heave_offset);
-		short_ptr = (short int *) &line[50];
-		*short_ptr = (short int) mb_swap_short(data->line_number);
-		short_ptr = (short int *) &line[52];
-		*short_ptr = (short int) mb_swap_short(data->start_or_stop);
-		short_ptr = (short int *) &line[54];
-		*short_ptr = (short int)
-			mb_swap_short(data->transducer_serial_number);
-#endif
-		line[ELAC_PARAMETER_SIZE] = 0x03;
-		line[ELAC_PARAMETER_SIZE+1] = '\0';
-		line[ELAC_PARAMETER_SIZE+2] = '\0';
-
-		/* write out data */
-		status = fwrite(line,1,ELAC_PARAMETER_SIZE+3,mbfp);
-		if (status != ELAC_PARAMETER_SIZE+3)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_bchrtunb_wr_pos(int verbose, FILE *mbfp,
-		struct mbf_bchrtunb_struct *data, int *error)
-{
-
-	char	*function_name = "mbr_bchrtunb_wr_pos";
-	int	status = MB_SUCCESS;
-	char	line[ELAC_POS_SIZE+3];
-	short int label;
-	short int *short_ptr;
-	int	*int_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       data:       %p\n",(void *)data);
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       year:             %d\n",data->pos_year);
-		fprintf(stderr,"dbg5       month:            %d\n",data->pos_month);
-		fprintf(stderr,"dbg5       day:              %d\n",data->pos_day);
-		fprintf(stderr,"dbg5       hour:             %d\n",data->pos_hour);
-		fprintf(stderr,"dbg5       minute:           %d\n",data->pos_minute);
-		fprintf(stderr,"dbg5       sec:              %d\n",data->pos_second);
-		fprintf(stderr,"dbg5       hundredth_sec:    %d\n",data->pos_hundredth_sec);
-		fprintf(stderr,"dbg5       thousandth_sec:   %d\n",data->pos_thousandth_sec);
-		fprintf(stderr,"dbg5       pos_latitude:     %d\n",data->pos_latitude);
-		fprintf(stderr,"dbg5       pos_longitude:    %d\n",data->pos_longitude);
-		fprintf(stderr,"dbg5       utm_northing:     %d\n",data->utm_northing);
-		fprintf(stderr,"dbg5       utm_easting:      %d\n",data->utm_easting);
-		fprintf(stderr,"dbg5       utm_zone_lon:     %d\n",data->utm_zone_lon);
-		fprintf(stderr,"dbg5       utm_zone:         %c\n",data->utm_zone);
-		fprintf(stderr,"dbg5       hemisphere:       %c\n",data->hemisphere);
-		fprintf(stderr,"dbg5       ellipsoid:        %c\n",data->ellipsoid);
-		fprintf(stderr,"dbg5       pos_spare:        %c\n",data->pos_spare);
-		fprintf(stderr,"dbg5       semi_major_axis:  %d\n",data->semi_major_axis);
-		fprintf(stderr,"dbg5       other_quality:    %d\n",data->other_quality);
-		}
-
-	/* write the record label */
-	label = ELAC_POS;
-#ifdef BYTESWAPPED
-	label = (short) mb_swap_short(label);
-#endif
-	status = fwrite(&label,1,2,mbfp);
-	if (status != 2)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	else
-		status = MB_SUCCESS;
-
-	/* write out the data */
-	if (status == MB_SUCCESS)
-		{
-		/* construct record */
-		line[0] = (char) data->pos_day;
-		line[1] = (char) data->pos_month;
-		line[2] = (char) data->pos_year;
-		line[3] = (char) data->pos_hour;
-		line[4] = (char) data->pos_minute;
-		line[5] = (char) data->pos_second;
-		line[6] = (char) data->pos_hundredth_sec;
-		line[7] = (char) data->pos_thousandth_sec;
-#ifndef BYTESWAPPED
-		int_ptr = (int *) &line[8];
-		*int_ptr = data->pos_latitude;
-		int_ptr = (int *) &line[12];
-		*int_ptr = data->pos_longitude;
-		int_ptr = (int *) &line[16];
-		*int_ptr = data->utm_northing;
-		int_ptr = (int *) &line[20];
-		*int_ptr = data->utm_easting;
-		int_ptr = (int *) &line[24];
-		*int_ptr = data->utm_zone_lon;
-		line[28] = data->utm_zone;
-		line[29] = data->hemisphere;
-		line[30] = data->ellipsoid;
-		line[31] = data->pos_spare;
-		short_ptr = (short int *) &line[32];
-		*short_ptr = (short int) data->semi_major_axis;
-		short_ptr = (short int *) &line[34];
-		*short_ptr = (short int) data->other_quality;
-#else
-		int_ptr = (int *) &line[8];
-		*int_ptr = (int) mb_swap_int(data->pos_latitude);
-		int_ptr = (int *) &line[12];
-		*int_ptr = (int) mb_swap_int(data->pos_longitude);
-		int_ptr = (int *) &line[16];
-		*int_ptr = (int) mb_swap_int(data->utm_northing);
-		int_ptr = (int *) &line[20];
-		*int_ptr = (int) mb_swap_int(data->utm_easting);
-		int_ptr = (int *) &line[24];
-		*int_ptr = (int) mb_swap_int(data->utm_zone_lon);
-		line[28] = data->utm_zone;
-		line[29] = data->hemisphere;
-		line[30] = data->ellipsoid;
-		line[31] = data->pos_spare;
-		short_ptr = (short int *) &line[32];
-		*short_ptr = (int) mb_swap_short(data->semi_major_axis);
-		short_ptr = (short int *) &line[34];
-		*short_ptr = (int) mb_swap_short(data->other_quality);
-#endif
-		line[ELAC_POS_SIZE] = 0x03;
-		line[ELAC_POS_SIZE+1] = '\0';
-		line[ELAC_POS_SIZE+2] = '\0';
-
-		/* write out data */
-		status = fwrite(line,1,ELAC_POS_SIZE+3,mbfp);
-		if (status != ELAC_POS_SIZE+3)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_bchrtunb_wr_svp(int verbose, FILE *mbfp,
-		struct mbf_bchrtunb_struct *data, int *error)
-{
-
-	char	*function_name = "mbr_bchrtunb_wr_svp";
-	int	status = MB_SUCCESS;
-	char	line[ELAC_SVP_SIZE+3];
-	short int label;
-	short int *short_ptr;
-	short int *short_ptr2;
-	int	*int_ptr;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       data:       %p\n",(void *)data);
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       year:             %d\n",data->svp_year);
-		fprintf(stderr,"dbg5       month:            %d\n",data->svp_month);
-		fprintf(stderr,"dbg5       day:              %d\n",data->svp_day);
-		fprintf(stderr,"dbg5       hour:             %d\n",data->svp_hour);
-		fprintf(stderr,"dbg5       minute:           %d\n",data->svp_minute);
-		fprintf(stderr,"dbg5       sec:              %d\n",data->svp_second);
-		fprintf(stderr,"dbg5       hundredth_sec:    %d\n",data->svp_hundredth_sec);
-		fprintf(stderr,"dbg5       thousandth_sec:   %d\n",data->svp_thousandth_sec);
-		fprintf(stderr,"dbg5       svp_latitude:     %d\n",data->svp_latitude);
-		fprintf(stderr,"dbg5       svp_longitude:    %d\n",data->svp_longitude);
-		fprintf(stderr,"dbg5       svp_num:          %d\n",data->svp_num);
-		for (i=0;i<data->svp_num;i++)
-			fprintf(stderr,"dbg5       depth: %d     vel: %d\n",
-				data->svp_depth[i],data->svp_vel[i]);
-		}
-
-	/* write the record label */
-	label = ELAC_SVP;
-#ifdef BYTESWAPPED
-	label = (short) mb_swap_short(label);
-#endif
-	status = fwrite(&label,1,2,mbfp);
-	if (status != 2)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	else
-		status = MB_SUCCESS;
-
-	/* write out the data */
-	if (status == MB_SUCCESS)
-		{
-		/* construct record */
-		line[0] = (char) data->svp_day;
-		line[1] = (char) data->svp_month;
-		line[2] = (char) data->svp_year;
-		line[3] = (char) data->svp_hour;
-		line[4] = (char) data->svp_minute;
-		line[5] = (char) data->svp_second;
-		line[6] = (char) data->svp_hundredth_sec;
-		line[7] = (char) data->svp_thousandth_sec;
-#ifndef BYTESWAPPED
-		int_ptr = (int *) &line[8];
-		*int_ptr = data->svp_latitude;
-		int_ptr = (int *) &line[12];
-		*int_ptr = data->svp_longitude;
-#else
-		int_ptr = (int *) &line[8];
-		*int_ptr = (int) mb_swap_int(data->svp_latitude);
-		int_ptr = (int *) &line[12];
-		*int_ptr = (int) mb_swap_int(data->svp_longitude);
-#endif
-		for (i=0;i<data->svp_num;i++)
-			{
-			short_ptr = (short int *) &line[16+4*i];
-			short_ptr2 = (short int *) &line[18+4*i];
-#ifndef BYTESWAPPED
-			*short_ptr = (short int) data->svp_depth[i];
-			*short_ptr2 = (short int) data->svp_vel[i];
-#else
-			*short_ptr = (short int)
-				mb_swap_short((short int)data->svp_depth[i]);
-			*short_ptr2 = (short int)
-				mb_swap_short((short int)data->svp_vel[i]);
-#endif
-			}
-		for (i=data->svp_num;i<500;i++)
-			{
-			short_ptr = (short int *) &line[16+4*i];
-			short_ptr2 = (short int *) &line[18+4*i];
-			*short_ptr = 0;
-			*short_ptr2 = 0;
-			}
-		line[ELAC_SVP_SIZE] = 0x03;
-		line[ELAC_SVP_SIZE+1] = '\0';
-		line[ELAC_SVP_SIZE+2] = '\0';
-
-		/* write out data */
-		status = fwrite(line,1,ELAC_SVP_SIZE+3,mbfp);
-		if (status != ELAC_SVP_SIZE+3)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_bchrtunb_wr_bath56(int verbose, FILE *mbfp,
-		struct mbf_bchrtunb_struct *data, int *error)
-{
-	char	*function_name = "mbr_bchrtunb_wr_bath56";
-	int	status = MB_SUCCESS;
-	char	line[ELAC_BATH56_SIZE+3];
-	char	*profile;
-	char	*beam;
-	short int label;
-	short int *short_ptr;
-	int	*int_ptr;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       data:       %p\n",(void *)data);
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       ping_num:         %d\n",data->ping_num);
-		fprintf(stderr,"dbg5       sound_vel:        %d\n",data->sound_vel);
-		fprintf(stderr,"dbg5       mode:             %d\n",data->mode);
-		fprintf(stderr,"dbg5       pulse_length:     %d\n",
-			data->pulse_length);
-		fprintf(stderr,"dbg5       source_power:     %d\n",
-			data->source_power);
-		fprintf(stderr,"dbg5       receiver_gain:    %d\n",
-			data->receiver_gain);
-		fprintf(stderr,"dbg5       profile_num:      %d\n",
-			data->profile_num);
-		fprintf(stderr,"dbg5       beams_bath:       %d\n",
-			data->beams_bath);
-		for (i=0;i<data->profile_num;i++)
-			{
-			fprintf(stderr,"dbg5       profile:          %d\n",i);
-			fprintf(stderr,"dbg5       year:             %d\n",
-				data->profile[i].year);
-			fprintf(stderr,"dbg5       month:            %d\n",
-				data->profile[i].month);
-			fprintf(stderr,"dbg5       day:              %d\n",
-				data->profile[i].day);
-			fprintf(stderr,"dbg5       hour:             %d\n",
-				data->profile[i].hour);
-			fprintf(stderr,"dbg5       minute:           %d\n",
-				data->profile[i].minute);
-			fprintf(stderr,"dbg5       sec:              %d\n",
-				data->profile[i].second);
-			fprintf(stderr,"dbg5       hundredth_sec:    %d\n",
-				data->profile[i].hundredth_sec);
-			fprintf(stderr,"dbg5       thousandth_sec:   %d\n",
-				data->profile[i].thousandth_sec);
-			fprintf(stderr,"dbg5       latitude:         %d\n",
-				data->profile[i].latitude);
-			fprintf(stderr,"dbg5       longitude:        %d\n",
-				data->profile[i].longitude);
-			fprintf(stderr,"dbg5       roll:             %d\n",
-				data->profile[i].roll);
-			fprintf(stderr,"dbg5       pitch:            %d\n",
-				data->profile[i].pitch);
-			fprintf(stderr,"dbg5       heading:          %d\n",
-				data->profile[i].heading);
-			fprintf(stderr,"dbg5       heave:            %d\n",
-				data->profile[i].heave);
-			for (j=0;j<8;j++)
-				{
-				fprintf(stderr,"dbg5       bath:             %d\n",
-					data->profile[i].bath[j]);
-				fprintf(stderr,"dbg5       bath_acrosstrack: %d\n",
-					data->profile[i].bath_acrosstrack[j]);
-				fprintf(stderr,"dbg5       bath_alongtrack:  %d\n",
-					data->profile[i].bath_alongtrack[j]);
-				fprintf(stderr,"dbg5       tt:               %d\n",
-					data->profile[i].tt[j]);
-				fprintf(stderr,"dbg5       angle:            %d\n",
-					data->profile[i].angle[j]);
-				fprintf(stderr,"dbg5       quality:          %d\n",
-					data->profile[i].quality[j]);
-				fprintf(stderr,"dbg5       amp:              %d\n",
-					data->profile[i].amp[j]);
-				}
-			fprintf(stderr,"dbg5       \n");
-			}
-		}
-
-	/* write the record label */
-	label = ELAC_BATH56;
-#ifdef BYTESWAPPED
-	label = (short) mb_swap_short(label);
-#endif
-	status = fwrite(&label,1,2,mbfp);
-	if (status != 2)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	else
-		status = MB_SUCCESS;
-
-	/* write out the data */
-	if (status == MB_SUCCESS)
-		{
-		/* construct record */
-#ifndef BYTESWAPPED
-		short_ptr = (short int *) &line[0];
-		*short_ptr = (short int) data->ping_num;
-		short_ptr = (short int *) &line[2];
-		*short_ptr = (short int) data->sound_vel;
-#else
-		short_ptr = (short int *) &line[0];
-		*short_ptr = (short int)
-			mb_swap_short((short int) data->ping_num);
-		short_ptr = (short int *) &line[2];
-		*short_ptr = (short int)
-			mb_swap_short((short int) data->sound_vel);
-#endif
-		line[4] = (char) data->mode;
-		line[5] = (char) data->pulse_length;
-		line[6] = (char) data->source_power;
-		line[7] = (char) data->receiver_gain;
-		for (i=0;i<data->profile_num;i++)
-			{
-			profile = &line[8+i*120];
-			profile[0] = (char) data->profile[i].day;
-			profile[1] = (char) data->profile[i].month;
-			profile[2] = (char) data->profile[i].year;
-			profile[3] = (char) data->profile[i].hour;
-			profile[4] = (char) data->profile[i].minute;
-			profile[5] = (char) data->profile[i].second;
-			profile[6] = (char) data->profile[i].hundredth_sec;
-			profile[7] = (char) data->profile[i].thousandth_sec;
-#ifndef BYTESWAPPED
-			int_ptr = (int *) &profile[8];
-			*int_ptr = (int) data->profile[i].latitude;
-			int_ptr = (int *) &profile[12];
-			*int_ptr = (int) data->profile[i].longitude;
-			short_ptr = (short int *) &profile[16];
-			*short_ptr = (short int) data->profile[i].roll;
-			short_ptr = (short int *) &profile[18];
-			*short_ptr = (short int) data->profile[i].pitch;
-			short_ptr = (short int *) &profile[20];
-			*short_ptr = (short int)(unsigned short) data->profile[i].heading;
-			short_ptr = (short int *) &profile[22];
-			*short_ptr = (short int) data->profile[i].heave;
-			for (j=0;j<8;j++)
-				{
-				beam = &profile[24 + 12*j];
-				short_ptr = (short *) &beam[0];
-				*short_ptr = (short int) data->profile[i].bath[j];
-				short_ptr = (short *) &beam[2];
-				*short_ptr = (short int)
-					data->profile[i].bath_acrosstrack[j];
-				short_ptr = (short *) &beam[4];
-				*short_ptr = (short int)
-					data->profile[i].bath_alongtrack[j];
-				short_ptr = (short *) &beam[6];
-				*short_ptr = (short int) data->profile[i].tt[j];
-				short_ptr = (short *) &beam[8];
-				*short_ptr = (short int) data->profile[i].angle[j];
-				beam[10] = (char) data->profile[i].quality[j];
-				beam[11] = (char) data->profile[i].amp[j];
-				}
-#else
-			int_ptr = (int *) &profile[8];
-			*int_ptr
-				= (int) mb_swap_int(data->profile[i].latitude);
-			int_ptr = (int *) &profile[12];
-			*int_ptr
-				= (int) mb_swap_int(data->profile[i].longitude);
-			short_ptr = (short int *) &profile[16];
-			*short_ptr = (short int)
-				mb_swap_short((short int) data->profile[i].roll);
-			short_ptr = (short int *) &profile[18];
-			*short_ptr = (short int)
-				mb_swap_short((short int) data->profile[i].pitch);
-			short_ptr = (short int *) &profile[20];
-			*short_ptr = (short int)
-				mb_swap_short((short int)(unsigned short) data->profile[i].heading);
-			short_ptr = (short int *) &profile[22];
-			*short_ptr = (short int)
-				mb_swap_short((short int) data->profile[i].heave);
-			for (j=0;j<8;j++)
-				{
-				beam = &profile[24 + 12*j];
-				short_ptr = (short *) &beam[0];
-				*short_ptr = (short int)
-					mb_swap_short(data->profile[i].bath[j]);
-				short_ptr = (short *) &beam[2];
-				*short_ptr = (short int)
-				mb_swap_short(data->profile[i].bath_acrosstrack[j]);
-				short_ptr = (short *) &beam[4];
-				*short_ptr = (short int)
-				mb_swap_short(data->profile[i].bath_alongtrack[j]);
-				short_ptr = (short *) &beam[6];
-				*short_ptr = (short int)
-					mb_swap_short(data->profile[i].tt[j]);
-				short_ptr = (short *) &beam[8];
-				*short_ptr = (short int)
-					mb_swap_short(data->profile[i].angle[j]);
-				beam[10] = (char) data->profile[i].quality[j];
-				beam[11] = (char) data->profile[i].amp[j];
-				}
-#endif
-			}
-		line[ELAC_BATH56_SIZE] = 0x03;
-		line[ELAC_BATH56_SIZE+1] = '\0';
-		line[ELAC_BATH56_SIZE+2] = '\0';
-
-		/* write out data */
-		status = fwrite(line,1,ELAC_BATH56_SIZE+3,mbfp);
-		if (status != ELAC_BATH56_SIZE+3)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_bchrtunb_wr_bath40(int verbose, FILE *mbfp,
-		struct mbf_bchrtunb_struct *data, int *error)
-{
-
-	char	*function_name = "mbr_bchrtunb_wr_bath40";
-	int	status = MB_SUCCESS;
-	char	line[ELAC_BATH40_SIZE+3];
-	char	*profile;
-	char	*beam;
-	short int label;
-	short int *short_ptr;
-	int	*int_ptr;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       data:       %p\n",(void *)data);
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       ping_num:         %d\n",data->ping_num);
-		fprintf(stderr,"dbg5       sound_vel:        %d\n",data->sound_vel);
-		fprintf(stderr,"dbg5       mode:             %d\n",data->mode);
-		fprintf(stderr,"dbg5       pulse_length:     %d\n",
-			data->pulse_length);
-		fprintf(stderr,"dbg5       source_power:     %d\n",
-			data->source_power);
-		fprintf(stderr,"dbg5       receiver_gain:    %d\n",
-			data->receiver_gain);
-		fprintf(stderr,"dbg5       profile_num:      %d\n",
-			data->profile_num);
-		fprintf(stderr,"dbg5       beams_bath:       %d\n",
-			data->beams_bath);
-		for (i=0;i<data->profile_num;i++)
-			{
-			fprintf(stderr,"dbg5       profile:          %d\n",i);
-			fprintf(stderr,"dbg5       year:             %d\n",
-				data->profile[i].year);
-			fprintf(stderr,"dbg5       month:            %d\n",
-				data->profile[i].month);
-			fprintf(stderr,"dbg5       day:              %d\n",
-				data->profile[i].day);
-			fprintf(stderr,"dbg5       hour:             %d\n",
-				data->profile[i].hour);
-			fprintf(stderr,"dbg5       minute:           %d\n",
-				data->profile[i].minute);
-			fprintf(stderr,"dbg5       sec:              %d\n",
-				data->profile[i].second);
-			fprintf(stderr,"dbg5       hundredth_sec:    %d\n",
-				data->profile[i].hundredth_sec);
-			fprintf(stderr,"dbg5       thousandth_sec:   %d\n",
-				data->profile[i].thousandth_sec);
-			fprintf(stderr,"dbg5       latitude:         %d\n",
-				data->profile[i].latitude);
-			fprintf(stderr,"dbg5       longitude:        %d\n",
-				data->profile[i].longitude);
-			fprintf(stderr,"dbg5       roll:             %d\n",
-				data->profile[i].roll);
-			fprintf(stderr,"dbg5       pitch:            %d\n",
-				data->profile[i].pitch);
-			fprintf(stderr,"dbg5       heading:          %d\n",
-				data->profile[i].heading);
-			fprintf(stderr,"dbg5       heave:            %d\n",
-				data->profile[i].heave);
-			for (j=0;j<8;j++)
-				{
-				fprintf(stderr,"dbg5       bath:             %d\n",
-					data->profile[i].bath[j]);
-				fprintf(stderr,"dbg5       bath_acrosstrack: %d\n",
-					data->profile[i].bath_acrosstrack[j]);
-				fprintf(stderr,"dbg5       bath_alongtrack:  %d\n",
-					data->profile[i].bath_alongtrack[j]);
-				fprintf(stderr,"dbg5       tt:               %d\n",
-					data->profile[i].tt[j]);
-				fprintf(stderr,"dbg5       angle:            %d\n",
-					data->profile[i].angle[j]);
-				fprintf(stderr,"dbg5       quality:          %d\n",
-					data->profile[i].quality[j]);
-				fprintf(stderr,"dbg5       amp:              %d\n",
-					data->profile[i].amp[j]);
-				}
-			fprintf(stderr,"dbg5       \n");
-			}
-		}
-
-	/* write the record label */
-	label = ELAC_BATH40;
-#ifdef BYTESWAPPED
-	label = (short) mb_swap_short(label);
-#endif
-	status = fwrite(&label,1,2,mbfp);
-	if (status != 2)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	else
-		status = MB_SUCCESS;
-
-	/* write out the data */
-	if (status == MB_SUCCESS)
-		{
-		/* construct record */
-#ifndef BYTESWAPPED
-		short_ptr = (short int *) &line[0];
-		*short_ptr = (short int) data->ping_num;
-		short_ptr = (short int *) &line[2];
-		*short_ptr = (short int) data->sound_vel;
-#else
-		short_ptr = (short int *) &line[0];
-		*short_ptr = (short int)
-			mb_swap_short((short int) data->ping_num);
-		short_ptr = (short int *) &line[2];
-		*short_ptr = (short int)
-			mb_swap_short((short int) data->sound_vel);
-#endif
-		line[4] = (char) data->mode;
-		line[5] = (char) data->pulse_length;
-		line[6] = (char) data->source_power;
-		line[7] = (char) data->receiver_gain;
-		for (i=0;i<data->profile_num;i++)
-			{
-			profile = &line[8+i*120];
-			profile[0] = (char) data->profile[i].day;
-			profile[1] = (char) data->profile[i].month;
-			profile[2] = (char) data->profile[i].year;
-			profile[3] = (char) data->profile[i].hour;
-			profile[4] = (char) data->profile[i].minute;
-			profile[5] = (char) data->profile[i].second;
-			profile[6] = (char) data->profile[i].hundredth_sec;
-			profile[7] = (char) data->profile[i].thousandth_sec;
-#ifndef BYTESWAPPED
-			int_ptr = (int *) &profile[8];
-			*int_ptr = (int) data->profile[i].latitude;
-			int_ptr = (int *) &profile[12];
-			*int_ptr = (int) data->profile[i].longitude;
-			short_ptr = (short int *) &profile[16];
-			*short_ptr = (short int) data->profile[i].roll;
-			short_ptr = (short int *) &profile[18];
-			*short_ptr = (short int) data->profile[i].pitch;
-			short_ptr = (short int *) &profile[20];
-			*short_ptr = (short int)(unsigned short) data->profile[i].heading;
-			short_ptr = (short int *) &profile[22];
-			*short_ptr = (short int) data->profile[i].heave;
-			for (j=0;j<8;j++)
-				{
-				beam = &profile[24 + 12*j];
-				short_ptr = (short *) &beam[0];
-				*short_ptr = (short int) data->profile[i].bath[j];
-				short_ptr = (short *) &beam[2];
-				*short_ptr = (short int)
-					data->profile[i].bath_acrosstrack[j];
-				short_ptr = (short *) &beam[4];
-				*short_ptr = (short int)
-					data->profile[i].bath_alongtrack[j];
-				short_ptr = (short *) &beam[6];
-				*short_ptr = (short int) data->profile[i].tt[j];
-				short_ptr = (short *) &beam[8];
-				*short_ptr = (short int) data->profile[i].angle[j];
-				beam[10] = (char) data->profile[i].quality[j];
-				beam[11] = (char) data->profile[i].amp[j];
-				}
-#else
-			int_ptr = (int *) &profile[8];
-			*int_ptr
-				= (int) mb_swap_int(data->profile[i].latitude);
-			int_ptr = (int *) &profile[12];
-			*int_ptr
-				= (int) mb_swap_int(data->profile[i].longitude);
-			short_ptr = (short int *) &profile[16];
-			*short_ptr = (short int)
-				mb_swap_short((short int) data->profile[i].roll);
-			short_ptr = (short int *) &profile[18];
-			*short_ptr = (short int)
-				mb_swap_short((short int) data->profile[i].pitch);
-			short_ptr = (short int *) &profile[20];
-			*short_ptr = (short int)
-				mb_swap_short((short int)(unsigned short) data->profile[i].heading);
-			short_ptr = (short int *) &profile[22];
-			*short_ptr = (short int)
-				mb_swap_short((short int) data->profile[i].heave);
-			for (j=0;j<8;j++)
-				{
-				beam = &profile[24 + 12*j];
-				short_ptr = (short *) &beam[0];
-				*short_ptr = (short int)
-					mb_swap_short(data->profile[i].bath[j]);
-				short_ptr = (short *) &beam[2];
-				*short_ptr = (short int)
-				mb_swap_short(data->profile[i].bath_acrosstrack[j]);
-				short_ptr = (short *) &beam[4];
-				*short_ptr = (short int)
-				mb_swap_short(data->profile[i].bath_alongtrack[j]);
-				short_ptr = (short *) &beam[6];
-				*short_ptr = (short int)
-					mb_swap_short(data->profile[i].tt[j]);
-				short_ptr = (short *) &beam[8];
-				*short_ptr = (short int)
-					mb_swap_short(data->profile[i].angle[j]);
-				beam[10] = (char) data->profile[i].quality[j];
-				beam[11] = (char) data->profile[i].amp[j];
-				}
-#endif
-			}
-		line[ELAC_BATH40_SIZE] = 0x03;
-		line[ELAC_BATH40_SIZE+1] = '\0';
-		line[ELAC_BATH40_SIZE+2] = '\0';
-
-		/* write out data */
-		status = fwrite(line,1,ELAC_BATH40_SIZE+3,mbfp);
-		if (status != ELAC_BATH40_SIZE+3)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_bchrtunb_wr_bath32(int verbose, FILE *mbfp,
-		struct mbf_bchrtunb_struct *data, int *error)
-{
-
-	char	*function_name = "mbr_bchrtunb_wr_bath32";
-	int	status = MB_SUCCESS;
-	char	line[ELAC_BATH32_SIZE+3];
-	char	*profile;
-	char	*beam;
-	short int label;
-	short int *short_ptr;
-	int	*int_ptr;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       data:       %p\n",(void *)data);
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       ping_num:         %d\n",data->ping_num);
-		fprintf(stderr,"dbg5       sound_vel:        %d\n",data->sound_vel);
-		fprintf(stderr,"dbg5       mode:             %d\n",data->mode);
-		fprintf(stderr,"dbg5       pulse_length:     %d\n",
-			data->pulse_length);
-		fprintf(stderr,"dbg5       source_power:     %d\n",
-			data->source_power);
-		fprintf(stderr,"dbg5       receiver_gain:    %d\n",
-			data->receiver_gain);
-		fprintf(stderr,"dbg5       profile_num:      %d\n",
-			data->profile_num);
-		fprintf(stderr,"dbg5       beams_bath:       %d\n",
-			data->beams_bath);
-		for (i=0;i<data->profile_num;i++)
-			{
-			fprintf(stderr,"dbg5       profile:          %d\n",i);
-			fprintf(stderr,"dbg5       year:             %d\n",
-				data->profile[i].year);
-			fprintf(stderr,"dbg5       month:            %d\n",
-				data->profile[i].month);
-			fprintf(stderr,"dbg5       day:              %d\n",
-				data->profile[i].day);
-			fprintf(stderr,"dbg5       hour:             %d\n",
-				data->profile[i].hour);
-			fprintf(stderr,"dbg5       minute:           %d\n",
-				data->profile[i].minute);
-			fprintf(stderr,"dbg5       sec:              %d\n",
-				data->profile[i].second);
-			fprintf(stderr,"dbg5       hundredth_sec:    %d\n",
-				data->profile[i].hundredth_sec);
-			fprintf(stderr,"dbg5       thousandth_sec:   %d\n",
-				data->profile[i].thousandth_sec);
-			fprintf(stderr,"dbg5       latitude:         %d\n",
-				data->profile[i].latitude);
-			fprintf(stderr,"dbg5       longitude:        %d\n",
-				data->profile[i].longitude);
-			fprintf(stderr,"dbg5       roll:             %d\n",
-				data->profile[i].roll);
-			fprintf(stderr,"dbg5       pitch:            %d\n",
-				data->profile[i].pitch);
-			fprintf(stderr,"dbg5       heading:          %d\n",
-				data->profile[i].heading);
-			fprintf(stderr,"dbg5       heave:            %d\n",
-				data->profile[i].heave);
-			for (j=0;j<8;j++)
-				{
-				fprintf(stderr,"dbg5       bath:             %d\n",
-					data->profile[i].bath[j]);
-				fprintf(stderr,"dbg5       bath_acrosstrack: %d\n",
-					data->profile[i].bath_acrosstrack[j]);
-				fprintf(stderr,"dbg5       bath_alongtrack:  %d\n",
-					data->profile[i].bath_alongtrack[j]);
-				fprintf(stderr,"dbg5       tt:               %d\n",
-					data->profile[i].tt[j]);
-				fprintf(stderr,"dbg5       angle:            %d\n",
-					data->profile[i].angle[j]);
-				fprintf(stderr,"dbg5       quality:          %d\n",
-					data->profile[i].quality[j]);
-				fprintf(stderr,"dbg5       amp:              %d\n",
-					data->profile[i].amp[j]);
-				}
-			fprintf(stderr,"dbg5       \n");
-			}
-		}
-
-	/* write the record label */
-	label = ELAC_BATH32;
-#ifdef BYTESWAPPED
-	label = (short) mb_swap_short(label);
-#endif
-	status = fwrite(&label,1,2,mbfp);
-	if (status != 2)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	else
-		status = MB_SUCCESS;
-
-	/* write out the data */
-	if (status == MB_SUCCESS)
-		{
-		/* construct record */
-#ifndef BYTESWAPPED
-		short_ptr = (short int *) &line[0];
-		*short_ptr = (short int) data->ping_num;
-		short_ptr = (short int *) &line[2];
-		*short_ptr = (short int) data->sound_vel;
-#else
-		short_ptr = (short int *) &line[0];
-		*short_ptr = (short int)
-			mb_swap_short((short int) data->ping_num);
-		short_ptr = (short int *) &line[2];
-		*short_ptr = (short int)
-			mb_swap_short((short int) data->sound_vel);
-#endif
-		line[4] = (char) data->mode;
-		line[5] = (char) data->pulse_length;
-		line[6] = (char) data->source_power;
-		line[7] = (char) data->receiver_gain;
-		for (i=0;i<data->profile_num;i++)
-			{
-			profile = &line[8+i*120];
-			profile[0] = (char) data->profile[i].day;
-			profile[1] = (char) data->profile[i].month;
-			profile[2] = (char) data->profile[i].year;
-			profile[3] = (char) data->profile[i].hour;
-			profile[4] = (char) data->profile[i].minute;
-			profile[5] = (char) data->profile[i].second;
-			profile[6] = (char) data->profile[i].hundredth_sec;
-			profile[7] = (char) data->profile[i].thousandth_sec;
-#ifndef BYTESWAPPED
-			int_ptr = (int *) &profile[8];
-			*int_ptr = (int) data->profile[i].latitude;
-			int_ptr = (int *) &profile[12];
-			*int_ptr = (int) data->profile[i].longitude;
-			short_ptr = (short int *) &profile[16];
-			*short_ptr = (short int) data->profile[i].roll;
-			short_ptr = (short int *) &profile[18];
-			*short_ptr = (short int) data->profile[i].pitch;
-			short_ptr = (short int *) &profile[20];
-			*short_ptr = (short int)(unsigned short) data->profile[i].heading;
-			short_ptr = (short int *) &profile[22];
-			*short_ptr = (short int) data->profile[i].heave;
-			for (j=0;j<8;j++)
-				{
-				beam = &profile[24 + 12*j];
-				short_ptr = (short *) &beam[0];
-				*short_ptr = (short int) data->profile[i].bath[j];
-				short_ptr = (short *) &beam[2];
-				*short_ptr = (short int)
-					data->profile[i].bath_acrosstrack[j];
-				short_ptr = (short *) &beam[4];
-				*short_ptr = (short int)
-					data->profile[i].bath_alongtrack[j];
-				short_ptr = (short *) &beam[6];
-				*short_ptr = (short int) data->profile[i].tt[j];
-				short_ptr = (short *) &beam[8];
-				*short_ptr = (short int) data->profile[i].angle[j];
-				beam[10] = (char) data->profile[i].quality[j];
-				beam[11] = (char) data->profile[i].amp[j];
-				}
-#else
-			int_ptr = (int *) &profile[8];
-			*int_ptr
-				= (int) mb_swap_int(data->profile[i].latitude);
-			int_ptr = (int *) &profile[12];
-			*int_ptr
-				= (int) mb_swap_int(data->profile[i].longitude);
-			short_ptr = (short int *) &profile[16];
-			*short_ptr = (short int)
-				mb_swap_short((short int) data->profile[i].roll);
-			short_ptr = (short int *) &profile[18];
-			*short_ptr = (short int)
-				mb_swap_short((short int) data->profile[i].pitch);
-			short_ptr = (short int *) &profile[20];
-			*short_ptr = (short int)
-				mb_swap_short((short int)(unsigned short) data->profile[i].heading);
-			short_ptr = (short int *) &profile[22];
-			*short_ptr = (short int)
-				mb_swap_short((short int) data->profile[i].heave);
-			for (j=0;j<8;j++)
-				{
-				beam = &profile[24 + 12*j];
-				short_ptr = (short *) &beam[0];
-				*short_ptr = (short int)
-					mb_swap_short(data->profile[i].bath[j]);
-				short_ptr = (short *) &beam[2];
-				*short_ptr = (short int)
-				mb_swap_short(data->profile[i].bath_acrosstrack[j]);
-				short_ptr = (short *) &beam[4];
-				*short_ptr = (short int)
-				mb_swap_short(data->profile[i].bath_alongtrack[j]);
-				short_ptr = (short *) &beam[6];
-				*short_ptr = (short int)
-					mb_swap_short(data->profile[i].tt[j]);
-				short_ptr = (short *) &beam[8];
-				*short_ptr = (short int)
-					mb_swap_short(data->profile[i].angle[j]);
-				beam[10] = (char) data->profile[i].quality[j];
-				beam[11] = (char) data->profile[i].amp[j];
-				}
-#endif
-			}
-		line[ELAC_BATH32_SIZE] = 0x03;
-		line[ELAC_BATH32_SIZE+1] = '\0';
-		line[ELAC_BATH32_SIZE+2] = '\0';
-
-		/* write out data */
-		status = fwrite(line,1,ELAC_BATH32_SIZE+3,mbfp);
-		if (status != ELAC_BATH32_SIZE+3)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mbr_bchrxunb.c b/src/mbio/mbr_bchrxunb.c
deleted file mode 100644
index 57a94e4..0000000
--- a/src/mbio/mbr_bchrxunb.c
+++ /dev/null
@@ -1,3736 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbr_bchrxunb.c	8/29/97
- *	$Id: mbr_bchrxunb.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1997-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbr_bchrxunb.c contains the functions for reading and writing
- * multibeam data in the BCHRXUNB format.
- * These functions include:
- *   mbr_alm_bchrxunb	- allocate read/write memory
- *   mbr_dem_bchrxunb	- deallocate read/write memory
- *   mbr_rt_bchrxunb	- read and translate data
- *   mbr_wt_bchrxunb	- translate and write data
- *
- * Author:	D. W. Caress
- * Date:	August 29, 1997
- * $Log: mbr_bchrxunb.c,v $
- * Revision 5.8  2005/11/05 00:48:03  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.7  2003/05/20 18:05:32  caress
- * Added svp_source to data source parameters.
- *
- * Revision 5.6  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.5  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.4  2001/07/20 00:31:11  caress
- * Release 5.0.beta03
- *
- * Revision 5.3  2001/06/08  21:44:01  caress
- * Version 5.0.beta01
- *
- * Revision 5.2  2001/03/22  20:45:56  caress
- * Trying to make 5.0.beta0...
- *
- * Revision 5.1  2001/01/22  07:43:34  caress
- * Version 5.0.beta01
- *
- * Revision 5.0  2000/12/01  22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.4  2000/10/11  01:02:30  caress
- * Convert to ANSI C
- *
- * Revision 4.3  2000/09/30  06:34:20  caress
- * Snapshot for Dale.
- *
- * Revision 4.2  1999/03/31  18:11:35  caress
- * MB-System 4.6beta7
- *
- * Revision 4.1  1998/10/05  17:46:15  caress
- * MB-System version 4.6beta
- *
- * Revision 4.0  1997/09/15  19:09:17  caress
- * Real Version 4.5
- *
- * Revision 1.1  1997/09/15  19:06:40  caress
- * Initial revision
- *
- *
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mb_define.h"
-#include "mbsys_elac.h"
-#include "mbf_bchrxunb.h"
-
-/* include for byte swapping */
-#include "mb_swap.h"
-
-/* essential function prototypes */
-int mbr_register_bchrxunb(int verbose, void *mbio_ptr,
-		int *error);
-int mbr_info_bchrxunb(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_alm_bchrxunb(int verbose, void *mbio_ptr, int *error);
-int mbr_dem_bchrxunb(int verbose, void *mbio_ptr, int *error);
-int mbr_zero_bchrxunb(int verbose, void *data_ptr, int *error);
-int mbr_rt_bchrxunb(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_wt_bchrxunb(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_bchrxunb_rd_data(int verbose, void *mbio_ptr, int *error);
-int mbr_bchrxunb_rd_comment(int verbose, FILE *mbfp,
-		struct mbf_bchrxunb_struct *data, int *error);
-int mbr_bchrxunb_rd_parameter(int verbose, FILE *mbfp,
-		struct mbf_bchrxunb_struct *data, int *error);
-int mbr_bchrxunb_rd_pos(int verbose, FILE *mbfp,
-		struct mbf_bchrxunb_struct *data, int *error);
-int mbr_bchrxunb_rd_svp(int verbose, FILE *mbfp,
-		struct mbf_bchrxunb_struct *data, int *error);
-int mbr_bchrxunb_rd_bath56(int verbose, FILE *mbfp,
-		struct mbf_bchrxunb_struct *data, int *error);
-int mbr_bchrxunb_rd_bath40(int verbose, FILE *mbfp,
-		struct mbf_bchrxunb_struct *data, int *error);
-int mbr_bchrxunb_rd_bath32(int verbose, FILE *mbfp,
-		struct mbf_bchrxunb_struct *data, int *error);
-int mbr_bchrxunb_wr_data(int verbose, void *mbio_ptr, void *data_ptr, int *error);
-int mbr_bchrxunb_wr_comment(int verbose, FILE *mbfp, void *data_ptr, int *error);
-int mbr_bchrxunb_wr_parameter(int verbose, FILE *mbfp, void *data_ptr, int *error);
-int mbr_bchrxunb_wr_pos(int verbose, FILE *mbfp, void *data_ptr, int *error);
-int mbr_bchrxunb_wr_svp(int verbose, FILE *mbfp, void *data_ptr, int *error);
-int mbr_bchrxunb_wr_bath56(int verbose, FILE *mbfp, void *data_ptr, int *error);
-int mbr_bchrxunb_wr_bath40(int verbose, FILE *mbfp, void *data_ptr, int *error);
-int mbr_bchrxunb_wr_bath32(int verbose, FILE *mbfp, void *data_ptr, int *error);
-
-static char rcs_id[]="$Id: mbr_bchrxunb.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mbr_register_bchrxunb(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_register_bchrxunb";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* get mb_io_ptr */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set format info parameters */
-	status = mbr_info_bchrxunb(verbose,
-			&mb_io_ptr->system,
-			&mb_io_ptr->beams_bath_max,
-			&mb_io_ptr->beams_amp_max,
-			&mb_io_ptr->pixels_ss_max,
-			mb_io_ptr->format_name,
-			mb_io_ptr->system_name,
-			mb_io_ptr->format_description,
-			&mb_io_ptr->numfile,
-			&mb_io_ptr->filetype,
-			&mb_io_ptr->variable_beams,
-			&mb_io_ptr->traveltime,
-			&mb_io_ptr->beam_flagging,
-			&mb_io_ptr->nav_source,
-			&mb_io_ptr->heading_source,
-			&mb_io_ptr->vru_source,
-			&mb_io_ptr->svp_source,
-			&mb_io_ptr->beamwidth_xtrack,
-			&mb_io_ptr->beamwidth_ltrack,
-			error);
-
-	/* set format and system specific function pointers */
-	mb_io_ptr->mb_io_format_alloc = &mbr_alm_bchrxunb;
-	mb_io_ptr->mb_io_format_free = &mbr_dem_bchrxunb;
-	mb_io_ptr->mb_io_store_alloc = &mbsys_elac_alloc;
-	mb_io_ptr->mb_io_store_free = &mbsys_elac_deall;
-	mb_io_ptr->mb_io_read_ping = &mbr_rt_bchrxunb;
-	mb_io_ptr->mb_io_write_ping = &mbr_wt_bchrxunb;
-	mb_io_ptr->mb_io_dimensions = &mbsys_elac_dimensions;
-	mb_io_ptr->mb_io_extract = &mbsys_elac_extract;
-	mb_io_ptr->mb_io_insert = &mbsys_elac_insert;
-	mb_io_ptr->mb_io_extract_nav = &mbsys_elac_extract_nav;
-	mb_io_ptr->mb_io_insert_nav = &mbsys_elac_insert_nav;
-	mb_io_ptr->mb_io_extract_altitude = &mbsys_elac_extract_altitude;
-	mb_io_ptr->mb_io_insert_altitude = NULL;
-	mb_io_ptr->mb_io_extract_svp = &mbsys_elac_extract_svp;
-	mb_io_ptr->mb_io_insert_svp = &mbsys_elac_insert_svp;
-	mb_io_ptr->mb_io_ttimes = &mbsys_elac_ttimes;
-	mb_io_ptr->mb_io_detects = &mbsys_elac_detects;
-	mb_io_ptr->mb_io_copyrecord = &mbsys_elac_copy;
-	mb_io_ptr->mb_io_extract_rawss = NULL;
-	mb_io_ptr->mb_io_insert_rawss = NULL;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",mb_io_ptr->system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",mb_io_ptr->beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",mb_io_ptr->beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",mb_io_ptr->pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",mb_io_ptr->format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",mb_io_ptr->system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",mb_io_ptr->format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",mb_io_ptr->numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",mb_io_ptr->filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",mb_io_ptr->variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",mb_io_ptr->traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",mb_io_ptr->beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",mb_io_ptr->nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",mb_io_ptr->heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",mb_io_ptr->vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",mb_io_ptr->svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",mb_io_ptr->beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",mb_io_ptr->beamwidth_ltrack);
-		fprintf(stderr,"dbg2       format_alloc:       %p\n",(void *)mb_io_ptr->mb_io_format_alloc);
-		fprintf(stderr,"dbg2       format_free:        %p\n",(void *)mb_io_ptr->mb_io_format_free);
-		fprintf(stderr,"dbg2       store_alloc:        %p\n",(void *)mb_io_ptr->mb_io_store_alloc);
-		fprintf(stderr,"dbg2       store_free:         %p\n",(void *)mb_io_ptr->mb_io_store_free);
-		fprintf(stderr,"dbg2       read_ping:          %p\n",(void *)mb_io_ptr->mb_io_read_ping);
-		fprintf(stderr,"dbg2       write_ping:         %p\n",(void *)mb_io_ptr->mb_io_write_ping);
-		fprintf(stderr,"dbg2       extract:            %p\n",(void *)mb_io_ptr->mb_io_extract);
-		fprintf(stderr,"dbg2       insert:             %p\n",(void *)mb_io_ptr->mb_io_insert);
-		fprintf(stderr,"dbg2       extract_nav:        %p\n",(void *)mb_io_ptr->mb_io_extract_nav);
-		fprintf(stderr,"dbg2       insert_nav:         %p\n",(void *)mb_io_ptr->mb_io_insert_nav);
-		fprintf(stderr,"dbg2       extract_altitude:   %p\n",(void *)mb_io_ptr->mb_io_extract_altitude);
-		fprintf(stderr,"dbg2       insert_altitude:    %p\n",(void *)mb_io_ptr->mb_io_insert_altitude);
-		fprintf(stderr,"dbg2       extract_svp:        %p\n",(void *)mb_io_ptr->mb_io_extract_svp);
-		fprintf(stderr,"dbg2       insert_svp:         %p\n",(void *)mb_io_ptr->mb_io_insert_svp);
-		fprintf(stderr,"dbg2       ttimes:             %p\n",(void *)mb_io_ptr->mb_io_ttimes);
-		fprintf(stderr,"dbg2       detects:            %p\n",(void *)mb_io_ptr->mb_io_detects);
-		fprintf(stderr,"dbg2       extract_rawss:      %p\n",(void *)mb_io_ptr->mb_io_extract_rawss);
-		fprintf(stderr,"dbg2       insert_rawss:       %p\n",(void *)mb_io_ptr->mb_io_insert_rawss);
-		fprintf(stderr,"dbg2       copyrecord:         %p\n",(void *)mb_io_ptr->mb_io_copyrecord);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbr_info_bchrxunb(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error)
-{
-	char	*function_name = "mbr_info_bchrxunb";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* set format info parameters */
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-	*system = MB_SYS_ELAC;
-	*beams_bath_max = 56;
-	*beams_amp_max = 56;
-	*pixels_ss_max = 0;
-	strncpy(format_name, "BCHRXUNB", MB_NAME_LENGTH);
-	strncpy(system_name, "ELAC", MB_NAME_LENGTH);
-	strncpy(format_description, "Format name:          MBF_BCHRXUNB\nInformal Description: Elac BottomChart shallow water multibeam\nAttributes:           56 beam bathymetry and amplitude,\n                      binary, University of New Brunswick.\n", MB_DESCRIPTION_LENGTH);
-	*numfile = 1;
-	*filetype = MB_FILETYPE_NORMAL;
-	*variable_beams = MB_YES;
-	*traveltime = MB_YES;
-	*beam_flagging = MB_YES;
-	*nav_source = MB_DATA_NAV;
-	*heading_source = MB_DATA_DATA;
-	*vru_source = MB_DATA_DATA;
-	*svp_source = MB_DATA_VELOCITY_PROFILE;
-	*beamwidth_xtrack = 3.0;
-	*beamwidth_ltrack = 6.0;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",*system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",*beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",*beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",*pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",*numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",*filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",*variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",*traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",*beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",*nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",*heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",*vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",*svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",*beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",*beamwidth_ltrack);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbr_alm_bchrxunb(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_alm_bchrxunb";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set initial status */
-	status = MB_SUCCESS;
-
-	/* allocate memory for data structure */
-	mb_io_ptr->structure_size = sizeof(struct mbf_bchrxunb_struct);
-	mb_io_ptr->data_structure_size = 0;
-	status = mb_malloc(verbose,mb_io_ptr->structure_size,
-				&mb_io_ptr->raw_data,error);
-	status = mb_malloc(verbose,sizeof(struct mbsys_elac_struct),
-				&mb_io_ptr->store_data,error);
-
-	/* initialize everything to zeros */
-	mbr_zero_bchrxunb(verbose,mb_io_ptr->raw_data,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_dem_bchrxunb(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_dem_bchrxunb";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointers to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* deallocate memory for data descriptor */
-	status = mb_free(verbose,&mb_io_ptr->raw_data,error);
-	status = mb_free(verbose,&mb_io_ptr->store_data,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_zero_bchrxunb(int verbose, void *data_ptr, int *error)
-{
-	char	*function_name = "mbr_zero_bchrxunb";
-	int	status = MB_SUCCESS;
-	struct mbf_bchrxunb_struct *data;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       data_ptr:   %p\n",(void *)data_ptr);
-		}
-
-	/* get pointer to data descriptor */
-	data = (struct mbf_bchrxunb_struct *) data_ptr;
-
-	/* initialize everything to zeros */
-	if (data != NULL)
-		{
-		data->kind = MB_DATA_NONE;
-		data->sonar = MBSYS_ELAC_BOTTOMCHART;
-		data->par_year = 0;
-		data->par_month = 0;
-		data->par_day = 0;
-		data->par_hour = 0;
-		data->par_minute = 0;
-		data->par_second = 0;
-		data->par_hundredth_sec = 0;
-		data->par_thousandth_sec = 0;
-		data->roll_offset = 0;	/* roll offset (degrees) */
-		data->pitch_offset = 0;	/* pitch offset (degrees) */
-		data->heading_offset = 0;	/* heading offset (degrees) */
-		data->time_delay = 0;		/* positioning system
-							delay (sec) */
-		data->transducer_port_height = 0;
-		data->transducer_starboard_height = 0;
-		data->transducer_port_depth = 0;
-		data->transducer_starboard_depth = 0;
-		data->transducer_port_x = 0;
-		data->transducer_starboard_x = 0;
-		data->transducer_port_y = 0;
-		data->transducer_starboard_y = 0;
-		data->transducer_port_error = 0;
-		data->transducer_starboard_error = 0;
-		data->antenna_height = 0;
-		data->antenna_x = 0;
-		data->antenna_y = 0;
-		data->vru_height = 0;
-		data->vru_x = 0;
-		data->vru_y = 0;
-		data->heave_offset = 0;
-		data->line_number = 0;
-		data->start_or_stop = 0;
-		data->transducer_serial_number = 0;
-		for (i=0;i<MBF_BCHRXUNB_COMMENT_LENGTH;i++)
-			data->comment[i] = '\0';
-
-		/* position (position telegrams) */
-		data->pos_year = 0;
-		data->pos_month = 0;
-		data->pos_day = 0;
-		data->pos_hour = 0;
-		data->pos_minute = 0;
-		data->pos_second = 0;
-		data->par_hundredth_sec = 0;
-		data->pos_thousandth_sec = 0;
-		data->pos_latitude = 0;
-		data->pos_longitude = 0;
-		data->utm_northing = 0;
-		data->utm_easting = 0;
-		data->utm_zone_lon = 0;
-		data->utm_zone = 0;
-		data->hemisphere = 0;
-		data->ellipsoid = 0;
-		data->pos_spare = 0;
-		data->semi_major_axis = 0;
-		data->other_quality = 0;
-
-		/* sound velocity profile */
-		data->svp_year = 0;
-		data->svp_month = 0;
-		data->svp_day = 0;
-		data->svp_hour = 0;
-		data->svp_minute = 0;
-		data->svp_second = 0;
-		data->svp_hundredth_sec = 0;
-		data->svp_thousandth_sec = 0;
-		data->svp_num = 0;
-		for (i=0;i<100;i++)
-			{
-			data->svp_depth[i] = 0; /* 0.1 meters */
-			data->svp_vel[i] = 0;	/* 0.1 meters/sec */
-			}
-
-		/* depth telegram */
-		data->ping_num = 0;
-		data->sound_vel = 0;
-		data->mode = 0;
-		data->pulse_length = 0;
-		data->source_power = 0;
-		data->receiver_gain = 0;
-		data->profile_num = 0;
-		data->beams_bath = 0;
-		for (i=0;i<7;i++)
-			{
-			data->profile[i].year = 0;
-			data->profile[i].month = 0;
-			data->profile[i].day = 0;
-			data->profile[i].hour = 0;
-			data->profile[i].minute = 0;
-			data->profile[i].second = 0;
-			data->profile[i].hundredth_sec = 0;
-			data->profile[i].thousandth_sec = 0;
-			data->profile[i].longitude = 0;
-			data->profile[i].latitude = 0;
-			data->profile[i].roll = 0;
-			data->profile[i].pitch = 0;
-			data->profile[i].heading = 0;
-			data->profile[i].heave = 0;
-			for (j=0;j<8;j++)
-				{
-				data->profile[i].bath[j] = 0;
-				data->profile[i].bath_acrosstrack[j] = 0;
-				data->profile[i].bath_alongtrack[j] = 0;
-				data->profile[i].tt[j] = 0;
-				data->profile[i].angle[j] = 0;
-				data->profile[i].quality[j] = 0;
-				data->profile[i].amp[j] = 0;
-				}
-			}
-
-		}
-
-	/* assume success */
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_rt_bchrxunb(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_rt_bchrxunb";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_bchrxunb_struct *data;
-	struct mbsys_elac_struct *store;
-	int	time_i[7];
-	double	time_d;
-	double	lon, lat, heading, speed;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointers to mbio descriptor and data structures */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-	data = (struct mbf_bchrxunb_struct *) mb_io_ptr->raw_data;
-	store = (struct mbsys_elac_struct *) store_ptr;
-
-	/* read next data from file */
-	status = mbr_bchrxunb_rd_data(verbose,mbio_ptr,error);
-
-	/* set error and kind in mb_io_ptr */
-	mb_io_ptr->new_error = *error;
-	mb_io_ptr->new_kind = data->kind;
-
-	/* add nav records to list for interpolation */
-	if (status == MB_SUCCESS
-		&& data->kind == MB_DATA_NAV)
-		{
-		mb_fix_y2k(verbose, data->pos_year,&time_i[0]);
-		time_i[1] = data->pos_month;
-		time_i[2] = data->pos_day;
-		time_i[3] = data->pos_hour;
-		time_i[4] = data->pos_minute;
-		time_i[5] = data->pos_second;
-		time_i[6] = 10000*data->pos_hundredth_sec
-			+ 100*data->pos_thousandth_sec;
-		mb_get_time(verbose,time_i, &time_d);
-		lon = data->pos_longitude*0.00000009;
-		lat = data->pos_latitude*0.00000009;
-		mb_navint_add(verbose, mbio_ptr, time_d, lon, lat, error);
-		}
-
-	/* interpolate navigation for survey pings if needed */
-	if (status == MB_SUCCESS
-		&& data->kind == MB_DATA_DATA
-		&& data->profile[0].longitude == 0
-		&& data->profile[0].latitude == 0
-		&& mb_io_ptr->nfix >= 1)
-		{
-		mb_fix_y2k(verbose, data->profile[0].year,&time_i[0]);
-		time_i[1] = data->profile[0].month;
-		time_i[2] = data->profile[0].day;
-		time_i[3] = data->profile[0].hour;
-		time_i[4] = data->profile[0].minute;
-		time_i[5] = data->profile[0].second;
-		time_i[6] = 10000*data->profile[0].hundredth_sec
-			+ 100*data->profile[0].thousandth_sec;
-		mb_get_time(verbose,time_i, &time_d);
-		heading = 0.01 * data->profile[0].heading;
-		mb_navint_interp(verbose, mbio_ptr, time_d, heading, 0.0,
-				    &lon, &lat, &speed, error);
-		data->profile[0].longitude = (int) (lon / 0.00000009);
-		data->profile[0].latitude = (int) (lat / 0.00000009);
-		}
-
-	/* translate values to elac data storage structure */
-	if (status == MB_SUCCESS
-		&& store != NULL)
-		{
-		store->kind = data->kind;
-		store->sonar = data->sonar;
-
-		/* parameter telegram */
-		store->par_year = data->par_year;
-		store->par_month = data->par_month;
-		store->par_day = data->par_day;
-		store->par_hour = data->par_hour;
-		store->par_minute = data->par_minute;
-		store->par_second = data->par_second;
-		store->par_hundredth_sec = data->par_hundredth_sec;
-		store->par_thousandth_sec = data->par_thousandth_sec;
-		store->roll_offset = data->roll_offset;
-		store->pitch_offset = data->pitch_offset;
-		store->heading_offset = data->heading_offset;
-		store->time_delay = data->time_delay;
-		store->transducer_port_height = data->transducer_port_height;
-		store->transducer_starboard_height
-			= data->transducer_starboard_height;
-		store->transducer_port_depth = data->transducer_port_depth;
-		store->transducer_starboard_depth
-			= data->transducer_starboard_depth;
-		store->transducer_port_x = data->transducer_port_x;
-		store->transducer_starboard_x = data->transducer_starboard_x;
-		store->transducer_port_y = data->transducer_port_y;
-		store->transducer_starboard_y = data->transducer_starboard_y;
-		store->transducer_port_error = data->transducer_port_error;
-		store->transducer_starboard_error
-			= data->transducer_starboard_error;
-		store->antenna_height = data->antenna_height;
-		store->antenna_x = data->antenna_x;
-		store->antenna_y = data->antenna_y;
-		store->vru_height = data->vru_height;
-		store->vru_x = data->vru_x;
-		store->vru_y = data->vru_y;
-		store->heave_offset = data->heave_offset;
-		store->line_number = data->line_number;
-		store->start_or_stop = data->start_or_stop;
-		store->transducer_serial_number
-			= data->transducer_serial_number;
-		for (i=0;i<MBF_BCHRXUNB_COMMENT_LENGTH;i++)
-			store->comment[i] = data->comment[i];
-
-		/* position (position telegrams) */
-		store->pos_year = data->pos_year;
-		store->pos_month = data->pos_month;
-		store->pos_day = data->pos_day;
-		store->pos_hour = data->pos_hour;
-		store->pos_minute = data->pos_minute;
-		store->pos_second = data->pos_second;
-		store->pos_hundredth_sec = data->pos_hundredth_sec;
-		store->pos_thousandth_sec = data->pos_thousandth_sec;
-		store->pos_latitude = data->pos_latitude;
-		store->pos_longitude = data->pos_longitude;
-		store->utm_northing = data->utm_northing;
-		store->utm_easting = data->utm_easting;
-		store->utm_zone_lon = data->utm_zone_lon;
-		store->utm_zone = data->utm_zone;
-		store->hemisphere = data->hemisphere;
-		store->ellipsoid = data->ellipsoid;
-		store->pos_spare = data->pos_spare;
-		store->semi_major_axis = data->semi_major_axis;
-		store->other_quality = data->other_quality;
-
-		/* sound velocity profile */
-		store->svp_year = data->svp_year;
-		store->svp_month = data->svp_month;
-		store->svp_day = data->svp_day;
-		store->svp_hour = data->svp_hour;
-		store->svp_minute = data->svp_minute;
-		store->svp_second = data->svp_second;
-		store->svp_hundredth_sec = data->svp_hundredth_sec;
-		store->svp_thousandth_sec = data->svp_thousandth_sec;
-		store->svp_num = data->svp_num;
-		for (i=0;i<500;i++)
-			{
-			store->svp_depth[i] = data->svp_depth[i];
-			store->svp_vel[i] = data->svp_vel[i];
-			}
-
-		/* depth telegram */
-		store->ping_num = data->ping_num;
-		store->sound_vel = data->sound_vel;
-		store->mode = data->mode;
-		store->pulse_length = data->pulse_length;
-		store->source_power = data->source_power;
-		store->receiver_gain = data->receiver_gain;
-		store->profile_num = data->profile_num;
-		store->beams_bath = data->beams_bath;
-		for (i=0;i<7;i++)
-			{
-			store->profile[i].year = data->profile[i].year;
-			store->profile[i].month = data->profile[i].month;
-			store->profile[i].day = data->profile[i].day;
-			store->profile[i].hour = data->profile[i].hour;
-			store->profile[i].minute = data->profile[i].minute;
-			store->profile[i].second = data->profile[i].second;
-			store->profile[i].hundredth_sec
-				= data->profile[i].hundredth_sec;
-			store->profile[i].thousandth_sec
-				= data->profile[i].thousandth_sec;
-			store->profile[i].longitude = data->profile[i].longitude;
-			store->profile[i].latitude = data->profile[i].latitude;
-			store->profile[i].roll = data->profile[i].roll;
-			store->profile[i].pitch = data->profile[i].pitch;
-			store->profile[i].heading = data->profile[i].heading;
-			store->profile[i].heave = data->profile[i].heave;
-			for (j=0;j<8;j++)
-				{
-				store->profile[i].bath[j]
-					= data->profile[i].bath[j];
-				store->profile[i].bath_acrosstrack[j]
-					= data->profile[i].bath_acrosstrack[j];
-				store->profile[i].bath_alongtrack[j]
-					= data->profile[i].bath_alongtrack[j];
-				store->profile[i].tt[j]
-					= data->profile[i].tt[j];
-				store->profile[i].angle[j]
-					= data->profile[i].angle[j];
-				store->profile[i].quality[j]
-					= data->profile[i].quality[j];
-				store->profile[i].amp[j]
-					= data->profile[i].amp[j];
-				}
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_wt_bchrxunb(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_wt_bchrxunb";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_bchrxunb_struct *data;
-	char	*data_ptr;
-	struct mbsys_elac_struct *store;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_bchrxunb_struct *) mb_io_ptr->raw_data;
-	data_ptr = (char *) data;
-	store = (struct mbsys_elac_struct *) store_ptr;
-
-	/* first translate values from data storage structure */
-	if (store != NULL)
-		{
-		data->kind = store->kind;
-		data->sonar = store->sonar;
-
-		/* parameter telegram */
-		data->par_year = store->par_year;
-		data->par_month = store->par_month;
-		data->par_day = store->par_day;
-		data->par_hour = store->par_hour;
-		data->par_minute = store->par_minute;
-		data->par_second = store->par_second;
-		data->par_hundredth_sec = store->par_hundredth_sec;
-		data->par_thousandth_sec = store->par_thousandth_sec;
-		data->roll_offset = store->roll_offset;
-		data->pitch_offset = store->pitch_offset;
-		data->heading_offset = store->heading_offset;
-		data->time_delay = store->time_delay;
-		data->transducer_port_height = store->transducer_port_height;
-		data->transducer_starboard_height
-			= store->transducer_starboard_height;
-		data->transducer_port_depth = store->transducer_port_depth;
-		data->transducer_starboard_depth
-			= store->transducer_starboard_depth;
-		data->transducer_port_x = store->transducer_port_x;
-		data->transducer_starboard_x = store->transducer_starboard_x;
-		data->transducer_port_y = store->transducer_port_y;
-		data->transducer_starboard_y = store->transducer_starboard_y;
-		data->transducer_port_error = store->transducer_port_error;
-		data->transducer_starboard_error
-			= store->transducer_starboard_error;
-		data->antenna_height = store->antenna_height;
-		data->antenna_x = store->antenna_x;
-		data->antenna_y = store->antenna_y;
-		data->vru_height = store->vru_height;
-		data->vru_x = store->vru_x;
-		data->vru_y = store->vru_y;
-		data->heave_offset = store->heave_offset;
-		data->line_number = store->line_number;
-		data->start_or_stop = store->start_or_stop;
-		data->transducer_serial_number
-			= store->transducer_serial_number;
-		for (i=0;i<MBF_BCHRXUNB_COMMENT_LENGTH;i++)
-			data->comment[i] = store->comment[i];
-
-		/* position (position telegrams) */
-		data->pos_year = store->pos_year;
-		data->pos_month = store->pos_month;
-		data->pos_day = store->pos_day;
-		data->pos_hour = store->pos_hour;
-		data->pos_minute = store->pos_minute;
-		data->pos_second = store->pos_second;
-		data->pos_hundredth_sec = store->pos_hundredth_sec;
-		data->pos_thousandth_sec = store->pos_thousandth_sec;
-		data->pos_latitude = store->pos_latitude;
-		data->pos_longitude = store->pos_longitude;
-		data->utm_northing = store->utm_northing;
-		data->utm_easting = store->utm_easting;
-		data->utm_zone_lon = store->utm_zone_lon;
-		data->utm_zone = store->utm_zone;
-		data->hemisphere = store->hemisphere;
-		data->ellipsoid = store->ellipsoid;
-		data->pos_spare = store->pos_spare;
-		data->semi_major_axis = store->semi_major_axis;
-		data->other_quality = store->other_quality;
-
-		/* sound velocity profile */
-		data->svp_year = store->svp_year;
-		data->svp_month = store->svp_month;
-		data->svp_day = store->svp_day;
-		data->svp_hour = store->svp_hour;
-		data->svp_minute = store->svp_minute;
-		data->svp_second = store->svp_second;
-		data->svp_hundredth_sec = store->svp_hundredth_sec;
-		data->svp_thousandth_sec = store->svp_thousandth_sec;
-		data->svp_num = store->svp_num;
-		for (i=0;i<500;i++)
-			{
-			data->svp_depth[i] = store->svp_depth[i];
-			data->svp_vel[i] = store->svp_vel[i];
-			}
-
-		/* depth telegram */
-		data->ping_num = store->ping_num;
-		data->sound_vel = store->sound_vel;
-		data->mode = store->mode;
-		data->pulse_length = store->pulse_length;
-		data->source_power = store->source_power;
-		data->receiver_gain = store->receiver_gain;
-		data->profile_num = store->profile_num;
-		data->beams_bath = store->beams_bath;
-		for (i=0;i<7;i++)
-			{
-			data->profile[i].year = store->profile[i].year;
-			data->profile[i].month = store->profile[i].month;
-			data->profile[i].day = store->profile[i].day;
-			data->profile[i].hour = store->profile[i].hour;
-			data->profile[i].minute = store->profile[i].minute;
-			data->profile[i].second = store->profile[i].second;
-			data->profile[i].hundredth_sec
-				= store->profile[i].hundredth_sec;
-			data->profile[i].thousandth_sec
-				= store->profile[i].thousandth_sec;
-			data->profile[i].longitude = store->profile[i].longitude;
-			data->profile[i].latitude = store->profile[i].latitude;
-			data->profile[i].roll = store->profile[i].roll;
-			data->profile[i].pitch = store->profile[i].pitch;
-			data->profile[i].heading = store->profile[i].heading;
-			data->profile[i].heave = store->profile[i].heave;
-			for (j=0;j<8;j++)
-				{
-				data->profile[i].bath[j]
-					= store->profile[i].bath[j];
-				data->profile[i].bath_acrosstrack[j]
-					= store->profile[i].bath_acrosstrack[j];
-				data->profile[i].bath_alongtrack[j]
-					= store->profile[i].bath_alongtrack[j];
-				data->profile[i].tt[j]
-					= store->profile[i].tt[j];
-				data->profile[i].angle[j]
-					= store->profile[i].angle[j];
-				data->profile[i].quality[j]
-					= store->profile[i].quality[j];
-				data->profile[i].amp[j]
-					= store->profile[i].amp[j];
-				}
-			}
-		}
-
-	/* write next data to file */
-	status = mbr_bchrxunb_wr_data(verbose,mbio_ptr,data_ptr,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_bchrxunb_rd_data(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_bchrxunb_rd_data";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_bchrxunb_struct *data;
-	char	*data_ptr;
-	FILE	*mbfp;
-	int	done;
-	short int *type;
-	static char label[2];
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_bchrxunb_struct *) mb_io_ptr->raw_data;
-	data_ptr = (char *) data;
-	mbfp = mb_io_ptr->mbfp;
-
-	/* set file position */
-	mb_io_ptr->file_pos = mb_io_ptr->file_bytes;
-
-	done = MB_NO;
-	type = (short int *) label;
-	*error = MB_ERROR_NO_ERROR;
-	while (done == MB_NO)
-		{
-		/* get next record label */
-		if ((status = fread(&label[0],1,1,mb_io_ptr->mbfp)) != 1)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_EOF;
-			}
-		if (label[0] == 0x02)
-		if ((status = fread(&label[1],1,1,mb_io_ptr->mbfp)) != 1)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_EOF;
-			}
-
-		/* swap bytes if necessary */
-#ifdef BYTESWAPPED
-		*type = (short int) mb_swap_short(*type);
-#endif
-
-		/* read the appropriate data records */
-		if (status == MB_FAILURE)
-			{
-			done = MB_YES;
-			}
-		else if (*type == ELAC_COMMENT)
-			{
-			status = mbr_bchrxunb_rd_comment(
-				verbose,mbfp,data,error);
-			if (status == MB_SUCCESS)
-				{
-				done = MB_YES;
-				data->kind = MB_DATA_COMMENT;
-				}
-			}
-		else if (*type == ELAC_PARAMETER)
-			{
-			status = mbr_bchrxunb_rd_parameter(
-				verbose,mbfp,data,error);
-			if (status == MB_SUCCESS)
-				{
-				done = MB_YES;
-				data->kind = MB_DATA_PARAMETER;
-				}
-			}
-		else if (*type == ELAC_POS)
-			{
-			status = mbr_bchrxunb_rd_pos(
-				verbose,mbfp,data,error);
-			if (status == MB_SUCCESS)
-				{
-				done = MB_YES;
-				data->kind = MB_DATA_NAV;
-				}
-			}
-		else if (*type == ELAC_SVP)
-			{
-			status = mbr_bchrxunb_rd_svp(
-				verbose,mbfp,data,error);
-			if (status == MB_SUCCESS)
-				{
-				done = MB_YES;
-				data->kind = MB_DATA_VELOCITY_PROFILE;
-				}
-			}
-		else if (*type == ELAC_XBATH56)
-			{
-			status = mbr_bchrxunb_rd_bath56(
-				verbose,mbfp,data,error);
-			if (status == MB_SUCCESS)
-				{
-				done = MB_YES;
-				data->kind = MB_DATA_DATA;
-				}
-			}
-		else if (*type == ELAC_XBATH40)
-			{
-			status = mbr_bchrxunb_rd_bath40(
-				verbose,mbfp,data,error);
-			if (status == MB_SUCCESS)
-				{
-				done = MB_YES;
-				data->kind = MB_DATA_DATA;
-				}
-			}
-		else if (*type == ELAC_XBATH32)
-			{
-			status = mbr_bchrxunb_rd_bath32(
-				verbose,mbfp,data,error);
-			if (status == MB_SUCCESS)
-				{
-				done = MB_YES;
-				data->kind = MB_DATA_DATA;
-				}
-			}
-		else
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_UNINTELLIGIBLE;
-			}
-
-		/* bail out if there is an error */
-		if (status == MB_FAILURE)
-			done = MB_YES;
-
-		}
-
-	/* get file position */
-	mb_io_ptr->file_bytes = ftell(mbfp);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_bchrxunb_rd_comment(int verbose, FILE *mbfp,
-		struct mbf_bchrxunb_struct *data, int *error)
-{
-	char	*function_name = "mbr_bchrxunb_rd_comment";
-	int	status = MB_SUCCESS;
-	char	line[ELAC_COMMENT_SIZE+3];
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       data:       %p\n",(void *)data);
-		}
-
-	/* read record into char array */
-	status = fread(line,1,ELAC_COMMENT_SIZE+3,mbfp);
-	if (status == ELAC_COMMENT_SIZE+3)
-		status = MB_SUCCESS;
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	/* get data */
-	if (status == MB_SUCCESS)
-		{
-		data->kind = MB_DATA_COMMENT;
-		strncpy(data->comment,line,MBF_BCHRXUNB_COMMENT_LENGTH-1);
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       comment:          %s\n",data->comment);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_bchrxunb_rd_parameter(int verbose, FILE *mbfp,
-		struct mbf_bchrxunb_struct *data, int *error)
-{
-	char	*function_name = "mbr_bchrxunb_rd_parameter";
-	int	status = MB_SUCCESS;
-	char	line[ELAC_XPARAMETER_SIZE+3];
-	short int *short_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       data:       %p\n",(void *)data);
-		}
-
-	/* read record into char array */
-	status = fread(line,1,ELAC_XPARAMETER_SIZE+3,mbfp);
-	if (status == ELAC_XPARAMETER_SIZE+3)
-		status = MB_SUCCESS;
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	/* get data */
-	if (status == MB_SUCCESS)
-		{
-		data->kind = MB_DATA_PARAMETER;
-		data->par_day =            (int) line[0];
-		data->par_month =          (int) line[1];
-		data->par_year =           (int) line[2];
-		data->par_hour =           (int) line[3];
-		data->par_minute =         (int) line[4];
-		data->par_second =         (int) line[5];
-		data->par_hundredth_sec =  (int) line[6];
-		data->par_thousandth_sec = (int) line[7];
-#ifndef BYTESWAPPED
-		short_ptr = (short int *) &line[8];
-		data->roll_offset = *short_ptr;
-		short_ptr = (short int *) &line[10];
-		data->pitch_offset = *short_ptr;
-		short_ptr = (short int *) &line[12];
-		data->heading_offset = *short_ptr;
-		short_ptr = (short int *) &line[14];
-		data->time_delay = *short_ptr;
-		short_ptr = (short int *) &line[16];
-		data->transducer_port_height = *short_ptr;
-		short_ptr = (short int *) &line[18];
-		data->transducer_starboard_height = *short_ptr;
-		short_ptr = (short int *) &line[20];
-		data->transducer_port_depth = *short_ptr;
-		short_ptr = (short int *) &line[22];
-		data->transducer_starboard_depth = *short_ptr;
-		short_ptr = (short int *) &line[24];
-		data->transducer_port_x = *short_ptr;
-		short_ptr = (short int *) &line[26];
-		data->transducer_starboard_x = *short_ptr;
-		short_ptr = (short int *) &line[28];
-		data->transducer_port_y = *short_ptr;
-		short_ptr = (short int *) &line[30];
-		data->transducer_starboard_y = *short_ptr;
-		short_ptr = (short int *) &line[32];
-		data->transducer_port_error = *short_ptr;
-		short_ptr = (short int *) &line[34];
-		data->transducer_starboard_error = *short_ptr;
-		short_ptr = (short int *) &line[36];
-		data->antenna_height = *short_ptr;
-		short_ptr = (short int *) &line[38];
-		data->antenna_x = *short_ptr;
-		short_ptr = (short int *) &line[40];
-		data->antenna_y = *short_ptr;
-		short_ptr = (short int *) &line[42];
-		data->vru_height = *short_ptr;
-		short_ptr = (short int *) &line[44];
-		data->vru_x = *short_ptr;
-		short_ptr = (short int *) &line[46];
-		data->vru_y = *short_ptr;
-		short_ptr = (short int *) &line[48];
-		data->line_number = *short_ptr;
-		short_ptr = (short int *) &line[50];
-		data->start_or_stop = *short_ptr;
-		short_ptr = (short int *) &line[52];
-		data->transducer_serial_number = *short_ptr;
-#else
-		short_ptr = (short int *) &line[8];
-		data->roll_offset = (short int) mb_swap_short(*short_ptr);
-		short_ptr = (short int *) &line[10];
-		data->pitch_offset = (short int) mb_swap_short(*short_ptr);
-		short_ptr = (short int *) &line[12];
-		data->heading_offset = (short int) mb_swap_short(*short_ptr);
-		short_ptr = (short int *) &line[14];
-		data->time_delay = (short int) mb_swap_short(*short_ptr);
-		short_ptr = (short int *) &line[16];
-		data->transducer_port_height
-			= (short int) mb_swap_short(*short_ptr);
-		short_ptr = (short int *) &line[18];
-		data->transducer_starboard_height
-			= (short int) mb_swap_short(*short_ptr);
-		short_ptr = (short int *) &line[20];
-		data->transducer_port_depth
-			= (short int) mb_swap_short(*short_ptr);
-		short_ptr = (short int *) &line[22];
-		data->transducer_starboard_depth
-			= (short int) mb_swap_short(*short_ptr);
-		short_ptr = (short int *) &line[24];
-		data->transducer_port_x
-			= (short int) mb_swap_short(*short_ptr);
-		short_ptr = (short int *) &line[26];
-		data->transducer_starboard_x
-			= (short int) mb_swap_short(*short_ptr);
-		short_ptr = (short int *) &line[28];
-		data->transducer_port_y
-			= (short int) mb_swap_short(*short_ptr);
-		short_ptr = (short int *) &line[30];
-		data->transducer_starboard_y
-			= (short int) mb_swap_short(*short_ptr);
-		short_ptr = (short int *) &line[32];
-		data->transducer_port_error
-			= (short int) mb_swap_short(*short_ptr);
-		short_ptr = (short int *) &line[34];
-		data->transducer_starboard_error
-			= (short int) mb_swap_short(*short_ptr);
-		short_ptr = (short int *) &line[36];
-		data->antenna_height = (short int) mb_swap_short(*short_ptr);
-		short_ptr = (short int *) &line[38];
-		data->antenna_x = (short int) mb_swap_short(*short_ptr);
-		short_ptr = (short int *) &line[40];
-		data->antenna_y = (short int) mb_swap_short(*short_ptr);
-		short_ptr = (short int *) &line[42];
-		data->vru_height = (short int) mb_swap_short(*short_ptr);
-		short_ptr = (short int *) &line[44];
-		data->vru_x = (short int) mb_swap_short(*short_ptr);
-		short_ptr = (short int *) &line[46];
-		data->vru_y = (short int) mb_swap_short(*short_ptr);
-		short_ptr = (short int *) &line[48];
-		data->line_number = (short int) mb_swap_short(*short_ptr);
-		short_ptr = (short int *) &line[50];
-		data->start_or_stop = (short int) mb_swap_short(*short_ptr);
-		short_ptr = (short int *) &line[52];
-		data->transducer_serial_number
-			= (short int) mb_swap_short(*short_ptr);
-#endif
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       year:             %d\n",data->par_year);
-		fprintf(stderr,"dbg5       month:            %d\n",data->par_month);
-		fprintf(stderr,"dbg5       day:              %d\n",data->par_day);
-		fprintf(stderr,"dbg5       hour:             %d\n",data->par_hour);
-		fprintf(stderr,"dbg5       minute:           %d\n",data->par_minute);
-		fprintf(stderr,"dbg5       sec:              %d\n",data->par_second);
-		fprintf(stderr,"dbg5       hundredth_sec:    %d\n",data->par_hundredth_sec);
-		fprintf(stderr,"dbg5       thousandth_sec:   %d\n",data->par_thousandth_sec);
-		fprintf(stderr,"dbg5       roll_offset:      %d\n",data->roll_offset);
-		fprintf(stderr,"dbg5       pitch_offset:     %d\n",data->pitch_offset);
-		fprintf(stderr,"dbg5       heading_offset:   %d\n",data->heading_offset);
-		fprintf(stderr,"dbg5       time_delay:       %d\n",data->time_delay);
-		fprintf(stderr,"dbg5       transducer_port_height: %d\n",
-			data->transducer_port_height);
-		fprintf(stderr,"dbg5       transducer_starboard_height:%d\n",
-			data->transducer_starboard_height);
-		fprintf(stderr,"dbg5       transducer_port_depth:     %d\n",
-			data->transducer_port_depth);
-		fprintf(stderr,"dbg5       transducer_starboard_depth:     %d\n",
-			data->transducer_starboard_depth);
-		fprintf(stderr,"dbg5       transducer_port_x:        %d\n",
-			data->transducer_port_x);
-		fprintf(stderr,"dbg5       transducer_starboard_x:        %d\n",
-			data->transducer_starboard_x);
-		fprintf(stderr,"dbg5       transducer_port_y:        %d\n",
-			data->transducer_port_y);
-		fprintf(stderr,"dbg5       transducer_starboard_y:  %d\n",
-			data->transducer_starboard_y);
-		fprintf(stderr,"dbg5       transducer_port_error:  %d\n",
-			data->transducer_port_error);
-		fprintf(stderr,"dbg5       transducer_starboard_error:  %d\n",
-			data->transducer_starboard_error);
-		fprintf(stderr,"dbg5       antenna_height:            %d\n",data->antenna_height);
-		fprintf(stderr,"dbg5       antenna_x:      %d\n",data->antenna_x);
-		fprintf(stderr,"dbg5       antenna_y:    %d\n",data->antenna_y);
-		fprintf(stderr,"dbg5       vru_height:%d\n",data->vru_height);
-		fprintf(stderr,"dbg5       vru_x:%d\n",data->vru_x);
-		fprintf(stderr,"dbg5       vru_y:%d\n",data->vru_y);
-		fprintf(stderr,"dbg5       line_number:%d\n",data->line_number);
-		fprintf(stderr,"dbg5       start_or_stop:%d\n",data->start_or_stop);
-		fprintf(stderr,"dbg5       transducer_serial_number:%d\n",
-			data->transducer_serial_number);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_bchrxunb_rd_pos(int verbose, FILE *mbfp,
-		struct mbf_bchrxunb_struct *data, int *error)
-{
-	char	*function_name = "mbr_bchrxunb_rd_pos";
-	int	status = MB_SUCCESS;
-	char	line[ELAC_POS_SIZE+3];
-	short int *short_ptr;
-	int	*int_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       data:       %p\n",(void *)data);
-		}
-
-	/* read record into char array */
-	status = fread(line,1,ELAC_POS_SIZE+3,mbfp);
-	if (status == ELAC_POS_SIZE+3)
-		status = MB_SUCCESS;
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	/* get data */
-	if (status == MB_SUCCESS)
-		{
-		data->kind = MB_DATA_NAV;
-		data->pos_day =            (int) line[0];
-		data->pos_month =          (int) line[1];
-		data->pos_year =           (int) line[2];
-		data->pos_hour =           (int) line[3];
-		data->pos_minute =         (int) line[4];
-		data->pos_second =         (int) line[5];
-		data->pos_hundredth_sec =  (int) line[6];
-		data->pos_thousandth_sec = (int) line[7];
-#ifndef BYTESWAPPED
-		int_ptr = (int *) &line[8];
-		data->pos_latitude = *int_ptr;
-		int_ptr = (int *) &line[12];
-		data->pos_longitude = *int_ptr;
-		int_ptr = (int *) &line[16];
-		data->utm_northing = *int_ptr;
-		int_ptr = (int *) &line[20];
-		data->utm_easting = *int_ptr;
-		int_ptr = (int *) &line[24];
-		data->utm_zone_lon = *int_ptr;
-		data->utm_zone = line[28];
-		data->hemisphere = line[29];
-		data->ellipsoid = line[30];
-		data->pos_spare = line[31];
-		short_ptr = (short int *) &line[32];
-		data->semi_major_axis = (int) *short_ptr;
-		short_ptr = (short int *) &line[34];
-		data->other_quality = (int) *short_ptr;
-#else
-		int_ptr = (int *) &line[8];
-		data->pos_latitude = (int) mb_swap_int(*int_ptr);
-		int_ptr = (int *) &line[12];
-		data->pos_longitude = (int) mb_swap_int(*int_ptr);
-		int_ptr = (int *) &line[16];
-		data->utm_northing = (int) mb_swap_int(*int_ptr);
-		int_ptr = (int *) &line[20];
-		data->utm_easting = (int) mb_swap_int(*int_ptr);
-		int_ptr = (int *) &line[24];
-		data->utm_zone_lon = (int) mb_swap_int(*int_ptr);
-		data->utm_zone = line[28];
-		data->hemisphere = line[29];
-		data->ellipsoid = line[30];
-		data->pos_spare = line[31];
-		short_ptr = (short int *) &line[32];
-		data->semi_major_axis = (int) mb_swap_short(*short_ptr);
-		short_ptr = (short int *) &line[34];
-		data->other_quality = (int) mb_swap_short(*short_ptr);
-#endif
-		}
-
-	/* KLUGE for 1996 UNB TRAINING COURSE - FLIP LONGITUDE */
-	if (data->pos_year == 96
-	    && data->pos_month >= 6
-	    && data->pos_month <= 8)
-		data->pos_longitude = -data->pos_longitude;
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       year:             %d\n",data->pos_year);
-		fprintf(stderr,"dbg5       month:            %d\n",data->pos_month);
-		fprintf(stderr,"dbg5       day:              %d\n",data->pos_day);
-		fprintf(stderr,"dbg5       hour:             %d\n",data->pos_hour);
-		fprintf(stderr,"dbg5       minute:           %d\n",data->pos_minute);
-		fprintf(stderr,"dbg5       sec:              %d\n",data->pos_second);
-		fprintf(stderr,"dbg5       hundredth_sec:    %d\n",data->pos_hundredth_sec);
-		fprintf(stderr,"dbg5       thousandth_sec:   %d\n",data->pos_thousandth_sec);
-		fprintf(stderr,"dbg5       pos_latitude:     %d\n",data->pos_latitude);
-		fprintf(stderr,"dbg5       pos_longitude:    %d\n",data->pos_longitude);
-		fprintf(stderr,"dbg5       utm_northing:     %d\n",data->utm_northing);
-		fprintf(stderr,"dbg5       utm_easting:      %d\n",data->utm_easting);
-		fprintf(stderr,"dbg5       utm_zone_lon:     %d\n",data->utm_zone_lon);
-		fprintf(stderr,"dbg5       utm_zone:         %c\n",data->utm_zone);
-		fprintf(stderr,"dbg5       hemisphere:       %c\n",data->hemisphere);
-		fprintf(stderr,"dbg5       ellipsoid:        %c\n",data->ellipsoid);
-		fprintf(stderr,"dbg5       pos_spare:        %c\n",data->pos_spare);
-		fprintf(stderr,"dbg5       semi_major_axis:  %d\n",data->semi_major_axis);
-		fprintf(stderr,"dbg5       other_quality:    %d\n",data->other_quality);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_bchrxunb_rd_svp(int verbose, FILE *mbfp,
-		struct mbf_bchrxunb_struct *data, int *error)
-{
-	char	*function_name = "mbr_bchrxunb_rd_svp";
-	int	status = MB_SUCCESS;
-	char	line[ELAC_SVP_SIZE+3];
-	short int *short_ptr;
-	short int *short_ptr2;
-	int	*int_ptr;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       data:       %p\n",(void *)data);
-		}
-
-	/* read record into char array */
-	status = fread(line,1,ELAC_SVP_SIZE+3,mbfp);
-	if (status == ELAC_SVP_SIZE+3)
-		status = MB_SUCCESS;
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	/* get data */
-	if (status == MB_SUCCESS)
-		{
-		data->kind = MB_DATA_VELOCITY_PROFILE;
-		data->svp_day =            (int) line[0];
-		data->svp_month =          (int) line[1];
-		data->svp_year =           (int) line[2];
-		data->svp_hour =           (int) line[3];
-		data->svp_minute =         (int) line[4];
-		data->svp_second =         (int) line[5];
-		data->svp_hundredth_sec =  (int) line[6];
-		data->svp_thousandth_sec = (int) line[7];
-#ifndef BYTESWAPPED
-		int_ptr = (int *) &line[8];
-		data->svp_latitude = *int_ptr;
-		int_ptr = (int *) &line[12];
-		data->svp_longitude = *int_ptr;
-#else
-		int_ptr = (int *) &line[8];
-		data->svp_latitude = (int) mb_swap_int(*int_ptr);
-		int_ptr = (int *) &line[12];
-		data->svp_latitude = (int) mb_swap_int(*int_ptr);
-#endif
-		data->svp_num = 0;
-		for (i=0;i<500;i++)
-			{
-			short_ptr = (short int *) &line[16+4*i];
-			short_ptr2 = (short int *) &line[18+4*i];
-#ifndef BYTESWAPPED
-			data->svp_depth[i] = *short_ptr;
-			data->svp_vel[i] = *short_ptr2;
-#else
-			data->svp_depth[i] = (short int) mb_swap_short(*short_ptr);
-			data->svp_vel[i] = (short int) mb_swap_short(*short_ptr2);
-#endif
-			if (data->svp_vel[i] > 0) data->svp_num = i + 1;
-			}
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       year:             %d\n",data->svp_year);
-		fprintf(stderr,"dbg5       month:            %d\n",data->svp_month);
-		fprintf(stderr,"dbg5       day:              %d\n",data->svp_day);
-		fprintf(stderr,"dbg5       hour:             %d\n",data->svp_hour);
-		fprintf(stderr,"dbg5       minute:           %d\n",data->svp_minute);
-		fprintf(stderr,"dbg5       sec:              %d\n",data->svp_second);
-		fprintf(stderr,"dbg5       hundredth_sec:    %d\n",data->svp_hundredth_sec);
-		fprintf(stderr,"dbg5       thousandth_sec:   %d\n",data->svp_thousandth_sec);
-		fprintf(stderr,"dbg5       svp_latitude:     %d\n",data->svp_latitude);
-		fprintf(stderr,"dbg5       svp_longitude:    %d\n",data->svp_longitude);
-		fprintf(stderr,"dbg5       svp_num:          %d\n",data->svp_num);
-		for (i=0;i<data->svp_num;i++)
-			fprintf(stderr,"dbg5       depth: %d     vel: %d\n",
-				data->svp_depth[i],data->svp_vel[i]);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_bchrxunb_rd_bath56(int verbose, FILE *mbfp,
-		struct mbf_bchrxunb_struct *data, int *error)
-{
-	char	*function_name = "mbr_bchrxunb_rd_bath56";
-	int	status = MB_SUCCESS;
-	char	line[ELAC_XBATH56_SIZE+3];
-	char	*profile;
-	char	*beam;
-	short int *short_ptr;
-	int	*int_ptr;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       data:       %p\n",(void *)data);
-		}
-
-	/* read record into char array */
-	status = fread(line,1,ELAC_XBATH56_SIZE+3,mbfp);
-	if (status == ELAC_XBATH56_SIZE+3)
-		status = MB_SUCCESS;
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	/* get data */
-	if (status == MB_SUCCESS)
-		{
-		data->kind = MB_DATA_DATA;
-#ifndef BYTESWAPPED
-		short_ptr = (short int *) &line[0];
-		data->ping_num = (int) *short_ptr;
-		short_ptr = (short int *) &line[2];
-		data->sound_vel = (int) *short_ptr;
-#else
-		short_ptr = (short int *) &line[0];
-		data->ping_num = (int) mb_swap_short(*short_ptr);
-		short_ptr = (short int *) &line[2];
-		data->sound_vel = (int) mb_swap_short(*short_ptr);
-#endif
-		data->mode = (int) line[4];
-		data->pulse_length = (int) line[5];
-		data->source_power = (int) line[6];
-		data->receiver_gain = (int) line[7];
-		data->profile_num = 7;
-		data->beams_bath = 56;
-		for (i=0;i<data->profile_num;i++)
-			{
-			profile = &line[8+i*152];
-			data->profile[i].day =            (int) profile[0];
-			data->profile[i].month =          (int) profile[1];
-			data->profile[i].year =           (int) profile[2];
-			data->profile[i].hour =           (int) profile[3];
-			data->profile[i].minute =         (int) profile[4];
-			data->profile[i].second =         (int) profile[5];
-			data->profile[i].hundredth_sec =  (int) profile[6];
-			data->profile[i].thousandth_sec = (int) profile[7];
-#ifndef BYTESWAPPED
-			int_ptr = (int *) &profile[8];
-			data->profile[i].latitude = (int) *int_ptr;
-			int_ptr = (int *) &profile[12];
-			data->profile[i].longitude = (int) *int_ptr;
-			short_ptr = (short int *) &profile[16];
-			data->profile[i].roll = (int) *short_ptr;
-			short_ptr = (short int *) &profile[18];
-			data->profile[i].pitch = (int) *short_ptr;
-			short_ptr = (short int *) &profile[20];
-			data->profile[i].heading = (int)(unsigned short) *short_ptr;
-			short_ptr = (short int *) &profile[22];
-			data->profile[i].heave = (int) *short_ptr;
-			for (j=0;j<8;j++)
-				{
-				beam = &profile[24 + 16*j];
-				int_ptr = (int *) &beam[0];
-				data->profile[i].bath[j] = (int) *int_ptr;
-				int_ptr = (int *) &beam[4];
-				data->profile[i].bath_acrosstrack[j]
-					= (int) *int_ptr;
-				short_ptr = (short *) &beam[8];
-				data->profile[i].bath_alongtrack[j]
-					= (short int) *short_ptr;
-				short_ptr = (short *) &beam[10];
-				data->profile[i].tt[j] = (short int) *short_ptr;
-				short_ptr = (short *) &beam[12];
-				data->profile[i].angle[j] = (short int) *short_ptr;
-				data->profile[i].quality[j] = (short int) beam[14];
-				data->profile[i].amp[j] = (short int) beam[15];
-				}
-#else
-			int_ptr = (int *) &profile[8];
-			data->profile[i].latitude
-				= (int) mb_swap_int(*int_ptr);
-			int_ptr = (int *) &profile[12];
-			data->profile[i].longitude
-				= (int) mb_swap_int(*int_ptr);
-			short_ptr = (short int *) &profile[16];
-			data->profile[i].roll
-				= (int) mb_swap_short(*short_ptr);
-			short_ptr = (short int *) &profile[18];
-			data->profile[i].pitch
-				= (int) mb_swap_short(*short_ptr);
-			short_ptr = (short int *) &profile[20];
-			data->profile[i].heading
-				= (int)(unsigned short) mb_swap_short(*short_ptr);
-			short_ptr = (short int *) &profile[22];
-			data->profile[i].heave
-				= (int) mb_swap_short(*short_ptr);
-			for (j=0;j<8;j++)
-				{
-				beam = &profile[24 + 16*j];
-				int_ptr = (int *) &beam[0];
-				data->profile[i].bath[j]
-					= (int) mb_swap_int(*int_ptr);
-				int_ptr = (int *) &beam[4];
-				data->profile[i].bath_acrosstrack[j]
-					= (int) mb_swap_int(*int_ptr);
-				short_ptr = (short *) &beam[8];
-				data->profile[i].bath_alongtrack[j]
-					= (short int) mb_swap_short(*short_ptr);
-				short_ptr = (short *) &beam[10];
-				data->profile[i].tt[j]
-					= (short int) mb_swap_short(*short_ptr);
-				short_ptr = (short *) &beam[12];
-				data->profile[i].angle[j]
-					= (short int) mb_swap_short(*short_ptr);
-				data->profile[i].quality[j] = (short int) beam[14];
-				data->profile[i].amp[j] = (short int) beam[15];
-				}
-#endif
-			}
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       ping_num:         %d\n",data->ping_num);
-		fprintf(stderr,"dbg5       sound_vel:        %d\n",data->sound_vel);
-		fprintf(stderr,"dbg5       mode:             %d\n",data->mode);
-		fprintf(stderr,"dbg5       pulse_length:     %d\n",
-			data->pulse_length);
-		fprintf(stderr,"dbg5       source_power:     %d\n",
-			data->source_power);
-		fprintf(stderr,"dbg5       receiver_gain:    %d\n",
-			data->receiver_gain);
-		fprintf(stderr,"dbg5       profile_num:      %d\n",
-			data->profile_num);
-		fprintf(stderr,"dbg5       beams_bath:       %d\n",
-			data->beams_bath);
-		for (i=0;i<data->profile_num;i++)
-			{
-			fprintf(stderr,"dbg5       profile:          %d\n",i);
-			fprintf(stderr,"dbg5       year:             %d\n",
-				data->profile[i].year);
-			fprintf(stderr,"dbg5       month:            %d\n",
-				data->profile[i].month);
-			fprintf(stderr,"dbg5       day:              %d\n",
-				data->profile[i].day);
-			fprintf(stderr,"dbg5       hour:             %d\n",
-				data->profile[i].hour);
-			fprintf(stderr,"dbg5       minute:           %d\n",
-				data->profile[i].minute);
-			fprintf(stderr,"dbg5       sec:              %d\n",
-				data->profile[i].second);
-			fprintf(stderr,"dbg5       hundredth_sec:    %d\n",
-				data->profile[i].hundredth_sec);
-			fprintf(stderr,"dbg5       thousandth_sec:   %d\n",
-				data->profile[i].thousandth_sec);
-			fprintf(stderr,"dbg5       latitude:         %d\n",
-				data->profile[i].latitude);
-			fprintf(stderr,"dbg5       longitude:        %d\n",
-				data->profile[i].longitude);
-			fprintf(stderr,"dbg5       roll:             %d\n",
-				data->profile[i].roll);
-			fprintf(stderr,"dbg5       pitch:            %d\n",
-				data->profile[i].pitch);
-			fprintf(stderr,"dbg5       heading:          %d\n",
-				data->profile[i].heading);
-			fprintf(stderr,"dbg5       heave:            %d\n",
-				data->profile[i].heave);
-			for (j=0;j<8;j++)
-				{
-				fprintf(stderr,"dbg5       bath[%2d][%d]:             %d\n",
-					i,j,data->profile[i].bath[j]);
-				fprintf(stderr,"dbg5       bath_acrosstrack[%2d][%d]: %d\n",
-					i,j,data->profile[i].bath_acrosstrack[j]);
-				fprintf(stderr,"dbg5       bath_alongtrack[%2d][%d]:  %d\n",
-					i,j,data->profile[i].bath_alongtrack[j]);
-				fprintf(stderr,"dbg5       tt[%2d][%d]:               %d\n",
-					i,j,data->profile[i].tt[j]);
-				fprintf(stderr,"dbg5       angle[%2d][%d]:            %d\n",
-					i,j,data->profile[i].angle[j]);
-				fprintf(stderr,"dbg5       quality[%2d][%d]:          %d\n",
-					i,j,data->profile[i].quality[j]);
-				fprintf(stderr,"dbg5       amp[%2d][%d]:              %d\n",
-					i,j,data->profile[i].amp[j]);
-				}
-			fprintf(stderr,"dbg5       \n");
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_bchrxunb_rd_bath40(int verbose, FILE *mbfp,
-		struct mbf_bchrxunb_struct *data, int *error)
-{
-	char	*function_name = "mbr_bchrxunb_rd_bath40";
-	int	status = MB_SUCCESS;
-	char	line[ELAC_XBATH40_SIZE+3];
-	char	*profile;
-	char	*beam;
-	short int *short_ptr;
-	int	*int_ptr;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       data:       %p\n",(void *)data);
-		}
-
-	/* read record into char array */
-	status = fread(line,1,ELAC_XBATH40_SIZE+3,mbfp);
-	if (status == ELAC_XBATH40_SIZE+3)
-		status = MB_SUCCESS;
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	/* get data */
-	if (status == MB_SUCCESS)
-		{
-		data->kind = MB_DATA_DATA;
-#ifndef BYTESWAPPED
-		short_ptr = (short int *) &line[0];
-		data->ping_num = (int) *short_ptr;
-		short_ptr = (short int *) &line[2];
-		data->sound_vel = (int) *short_ptr;
-#else
-		short_ptr = (short int *) &line[0];
-		data->ping_num = (int) mb_swap_short(*short_ptr);
-		short_ptr = (short int *) &line[2];
-		data->sound_vel = (int) mb_swap_short(*short_ptr);
-#endif
-		data->mode = (int) line[4];
-		data->pulse_length = (int) line[5];
-		data->source_power = (int) line[6];
-		data->receiver_gain = (int) line[7];
-		data->profile_num = 5;
-		data->beams_bath = 40;
-		for (i=0;i<data->profile_num;i++)
-			{
-			profile = &line[8+i*152];
-			data->profile[i].day =            (int) profile[0];
-			data->profile[i].month =          (int) profile[1];
-			data->profile[i].year =           (int) profile[2];
-			data->profile[i].hour =           (int) profile[3];
-			data->profile[i].minute =         (int) profile[4];
-			data->profile[i].second =         (int) profile[5];
-			data->profile[i].hundredth_sec =  (int) profile[6];
-			data->profile[i].thousandth_sec = (int) profile[7];
-#ifndef BYTESWAPPED
-			int_ptr = (int *) &profile[8];
-			data->profile[i].latitude = (int) *int_ptr;
-			int_ptr = (int *) &profile[12];
-			data->profile[i].longitude = (int) *int_ptr;
-			short_ptr = (short int *) &profile[16];
-			data->profile[i].roll = (int) *short_ptr;
-			short_ptr = (short int *) &profile[18];
-			data->profile[i].pitch = (int) *short_ptr;
-			short_ptr = (short int *) &profile[20];
-			data->profile[i].heading = (int)(unsigned short) *short_ptr;
-			short_ptr = (short int *) &profile[22];
-			data->profile[i].heave = (int) *short_ptr;
-			for (j=0;j<8;j++)
-				{
-				beam = &profile[24 + 16*j];
-				int_ptr = (int *) &beam[0];
-				data->profile[i].bath[j] = (int) *int_ptr;
-				int_ptr = (int *) &beam[4];
-				data->profile[i].bath_acrosstrack[j]
-					= (int) *int_ptr;
-				short_ptr = (short *) &beam[8];
-				data->profile[i].bath_alongtrack[j]
-					= (short int) *short_ptr;
-				short_ptr = (short *) &beam[10];
-				data->profile[i].tt[j] = (short int) *short_ptr;
-				short_ptr = (short *) &beam[12];
-				data->profile[i].angle[j] = (short int) *short_ptr;
-				data->profile[i].quality[j] = (short int) beam[14];
-				data->profile[i].amp[j] = (short int) beam[15];
-				}
-#else
-			int_ptr = (int *) &profile[8];
-			data->profile[i].latitude
-				= (int) mb_swap_int(*int_ptr);
-			int_ptr = (int *) &profile[12];
-			data->profile[i].longitude
-				= (int) mb_swap_int(*int_ptr);
-			short_ptr = (short int *) &profile[16];
-			data->profile[i].roll
-				= (int) mb_swap_short(*short_ptr);
-			short_ptr = (short int *) &profile[18];
-			data->profile[i].pitch
-				= (int) mb_swap_short(*short_ptr);
-			short_ptr = (short int *) &profile[20];
-			data->profile[i].heading
-				= (int)(unsigned short) mb_swap_short(*short_ptr);
-			short_ptr = (short int *) &profile[22];
-			data->profile[i].heave
-				= (int) mb_swap_short(*short_ptr);
-			for (j=0;j<8;j++)
-				{
-				beam = &profile[24 + 16*j];
-				int_ptr = (int *) &beam[0];
-				data->profile[i].bath[j]
-					= (int) mb_swap_int(*int_ptr);
-				int_ptr = (int *) &beam[4];
-				data->profile[i].bath_acrosstrack[j]
-					= (int) mb_swap_int(*int_ptr);
-				short_ptr = (short *) &beam[8];
-				data->profile[i].bath_alongtrack[j]
-					= (short int) mb_swap_short(*short_ptr);
-				short_ptr = (short *) &beam[10];
-				data->profile[i].tt[j]
-					= (short int) mb_swap_short(*short_ptr);
-				short_ptr = (short *) &beam[12];
-				data->profile[i].angle[j]
-					= (short int) mb_swap_short(*short_ptr);
-				data->profile[i].quality[j] = (short int) beam[14];
-				data->profile[i].amp[j] = (short int) beam[15];
-				}
-#endif
-			}
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       ping_num:         %d\n",data->ping_num);
-		fprintf(stderr,"dbg5       sound_vel:        %d\n",data->sound_vel);
-		fprintf(stderr,"dbg5       mode:             %d\n",data->mode);
-		fprintf(stderr,"dbg5       pulse_length:     %d\n",
-			data->pulse_length);
-		fprintf(stderr,"dbg5       source_power:     %d\n",
-			data->source_power);
-		fprintf(stderr,"dbg5       receiver_gain:    %d\n",
-			data->receiver_gain);
-		fprintf(stderr,"dbg5       profile_num:      %d\n",
-			data->profile_num);
-		fprintf(stderr,"dbg5       beams_bath:       %d\n",
-			data->beams_bath);
-		for (i=0;i<data->profile_num;i++)
-			{
-			fprintf(stderr,"dbg5       profile:          %d\n",i);
-			fprintf(stderr,"dbg5       year:             %d\n",
-				data->profile[i].year);
-			fprintf(stderr,"dbg5       month:            %d\n",
-				data->profile[i].month);
-			fprintf(stderr,"dbg5       day:              %d\n",
-				data->profile[i].day);
-			fprintf(stderr,"dbg5       hour:             %d\n",
-				data->profile[i].hour);
-			fprintf(stderr,"dbg5       minute:           %d\n",
-				data->profile[i].minute);
-			fprintf(stderr,"dbg5       sec:              %d\n",
-				data->profile[i].second);
-			fprintf(stderr,"dbg5       hundredth_sec:    %d\n",
-				data->profile[i].hundredth_sec);
-			fprintf(stderr,"dbg5       thousandth_sec:   %d\n",
-				data->profile[i].thousandth_sec);
-			fprintf(stderr,"dbg5       latitude:         %d\n",
-				data->profile[i].latitude);
-			fprintf(stderr,"dbg5       longitude:        %d\n",
-				data->profile[i].longitude);
-			fprintf(stderr,"dbg5       roll:             %d\n",
-				data->profile[i].roll);
-			fprintf(stderr,"dbg5       pitch:            %d\n",
-				data->profile[i].pitch);
-			fprintf(stderr,"dbg5       heading:          %d\n",
-				data->profile[i].heading);
-			fprintf(stderr,"dbg5       heave:            %d\n",
-				data->profile[i].heave);
-			for (j=0;j<8;j++)
-				{
-				fprintf(stderr,"dbg5       bath:             %d\n",
-					data->profile[i].bath[j]);
-				fprintf(stderr,"dbg5       bath_acrosstrack: %d\n",
-					data->profile[i].bath_acrosstrack[j]);
-				fprintf(stderr,"dbg5       bath_alongtrack:  %d\n",
-					data->profile[i].bath_alongtrack[j]);
-				fprintf(stderr,"dbg5       tt:               %d\n",
-					data->profile[i].tt[j]);
-				fprintf(stderr,"dbg5       angle:            %d\n",
-					data->profile[i].angle[j]);
-				fprintf(stderr,"dbg5       quality:          %d\n",
-					data->profile[i].quality[j]);
-				fprintf(stderr,"dbg5       amp:              %d\n",
-					data->profile[i].amp[j]);
-				}
-			fprintf(stderr,"dbg5       \n");
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_bchrxunb_rd_bath32(int verbose, FILE *mbfp,
-		struct mbf_bchrxunb_struct *data, int *error)
-{
-	char	*function_name = "mbr_bchrxunb_rd_bath32";
-	int	status = MB_SUCCESS;
-	char	line[ELAC_XBATH32_SIZE+3];
-	char	*profile;
-	char	*beam;
-	short int *short_ptr;
-	int	*int_ptr;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       data:       %p\n",(void *)data);
-		}
-
-	/* read record into char array */
-	status = fread(line,1,ELAC_XBATH32_SIZE+3,mbfp);
-	if (status == ELAC_XBATH32_SIZE+3)
-		status = MB_SUCCESS;
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	/* get data */
-	if (status == MB_SUCCESS)
-		{
-		data->kind = MB_DATA_DATA;
-#ifndef BYTESWAPPED
-		short_ptr = (short int *) &line[0];
-		data->ping_num = (int) *short_ptr;
-		short_ptr = (short int *) &line[2];
-		data->sound_vel = (int) *short_ptr;
-#else
-		short_ptr = (short int *) &line[0];
-		data->ping_num = (int) mb_swap_short(*short_ptr);
-		short_ptr = (short int *) &line[2];
-		data->sound_vel = (int) mb_swap_short(*short_ptr);
-#endif
-		data->mode = (int) line[4];
-		data->pulse_length = (int) line[5];
-		data->source_power = (int) line[6];
-		data->receiver_gain = (int) line[7];
-		data->profile_num = 4;
-		data->beams_bath = 32;
-		for (i=0;i<data->profile_num;i++)
-			{
-			profile = &line[8+i*152];
-			data->profile[i].day =            (int) profile[0];
-			data->profile[i].month =          (int) profile[1];
-			data->profile[i].year =           (int) profile[2];
-			data->profile[i].hour =           (int) profile[3];
-			data->profile[i].minute =         (int) profile[4];
-			data->profile[i].second =         (int) profile[5];
-			data->profile[i].hundredth_sec =  (int) profile[6];
-			data->profile[i].thousandth_sec = (int) profile[7];
-#ifndef BYTESWAPPED
-			int_ptr = (int *) &profile[8];
-			data->profile[i].latitude = (int) *int_ptr;
-			int_ptr = (int *) &profile[12];
-			data->profile[i].longitude = (int) *int_ptr;
-			short_ptr = (short int *) &profile[16];
-			data->profile[i].roll = (int) *short_ptr;
-			short_ptr = (short int *) &profile[18];
-			data->profile[i].pitch = (int) *short_ptr;
-			short_ptr = (short int *) &profile[20];
-			data->profile[i].heading = (int)(unsigned short) *short_ptr;
-			short_ptr = (short int *) &profile[22];
-			data->profile[i].heave = (int) *short_ptr;
-			for (j=0;j<8;j++)
-				{
-				beam = &profile[24 + 16*j];
-				int_ptr = (int *) &beam[0];
-				data->profile[i].bath[j] = (int) *int_ptr;
-				int_ptr = (int *) &beam[4];
-				data->profile[i].bath_acrosstrack[j]
-					= (int) *int_ptr;
-				short_ptr = (short *) &beam[8];
-				data->profile[i].bath_alongtrack[j]
-					= (short int) *short_ptr;
-				short_ptr = (short *) &beam[10];
-				data->profile[i].tt[j] = (short int) *short_ptr;
-				short_ptr = (short *) &beam[12];
-				data->profile[i].angle[j] = (short int) *short_ptr;
-				data->profile[i].quality[j] = (short int) beam[14];
-				data->profile[i].amp[j] = (short int) beam[15];
-				}
-#else
-			int_ptr = (int *) &profile[8];
-			data->profile[i].latitude
-				= (int) mb_swap_int(*int_ptr);
-			int_ptr = (int *) &profile[12];
-			data->profile[i].longitude
-				= (int) mb_swap_int(*int_ptr);
-			short_ptr = (short int *) &profile[16];
-			data->profile[i].roll
-				= (int) mb_swap_short(*short_ptr);
-			short_ptr = (short int *) &profile[18];
-			data->profile[i].pitch
-				= (int) mb_swap_short(*short_ptr);
-			short_ptr = (short int *) &profile[20];
-			data->profile[i].heading
-				= (int)(unsigned short) mb_swap_short(*short_ptr);
-			short_ptr = (short int *) &profile[22];
-			data->profile[i].heave
-				= (int) mb_swap_short(*short_ptr);
-			for (j=0;j<8;j++)
-				{
-				beam = &profile[24 + 16*j];
-				int_ptr = (int *) &beam[0];
-				data->profile[i].bath[j]
-					= (int) mb_swap_int(*int_ptr);
-				int_ptr = (int *) &beam[4];
-				data->profile[i].bath_acrosstrack[j]
-					= (int) mb_swap_int(*int_ptr);
-				short_ptr = (short *) &beam[8];
-				data->profile[i].bath_alongtrack[j]
-					= (short int) mb_swap_short(*short_ptr);
-				short_ptr = (short *) &beam[10];
-				data->profile[i].tt[j]
-					= (short int) mb_swap_short(*short_ptr);
-				short_ptr = (short *) &beam[12];
-				data->profile[i].angle[j]
-					= (short int) mb_swap_short(*short_ptr);
-				data->profile[i].quality[j] = (short int) beam[14];
-				data->profile[i].amp[j] = (short int) beam[15];
-				}
-#endif
-			}
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       ping_num:         %d\n",data->ping_num);
-		fprintf(stderr,"dbg5       sound_vel:        %d\n",data->sound_vel);
-		fprintf(stderr,"dbg5       mode:             %d\n",data->mode);
-		fprintf(stderr,"dbg5       pulse_length:     %d\n",
-			data->pulse_length);
-		fprintf(stderr,"dbg5       source_power:     %d\n",
-			data->source_power);
-		fprintf(stderr,"dbg5       receiver_gain:    %d\n",
-			data->receiver_gain);
-		fprintf(stderr,"dbg5       profile_num:      %d\n",
-			data->profile_num);
-		fprintf(stderr,"dbg5       beams_bath:       %d\n",
-			data->beams_bath);
-		for (i=0;i<data->profile_num;i++)
-			{
-			fprintf(stderr,"dbg5       profile:          %d\n",i);
-			fprintf(stderr,"dbg5       year:             %d\n",
-				data->profile[i].year);
-			fprintf(stderr,"dbg5       month:            %d\n",
-				data->profile[i].month);
-			fprintf(stderr,"dbg5       day:              %d\n",
-				data->profile[i].day);
-			fprintf(stderr,"dbg5       hour:             %d\n",
-				data->profile[i].hour);
-			fprintf(stderr,"dbg5       minute:           %d\n",
-				data->profile[i].minute);
-			fprintf(stderr,"dbg5       sec:              %d\n",
-				data->profile[i].second);
-			fprintf(stderr,"dbg5       hundredth_sec:    %d\n",
-				data->profile[i].hundredth_sec);
-			fprintf(stderr,"dbg5       thousandth_sec:   %d\n",
-				data->profile[i].thousandth_sec);
-			fprintf(stderr,"dbg5       latitude:         %d\n",
-				data->profile[i].latitude);
-			fprintf(stderr,"dbg5       longitude:        %d\n",
-				data->profile[i].longitude);
-			fprintf(stderr,"dbg5       roll:             %d\n",
-				data->profile[i].roll);
-			fprintf(stderr,"dbg5       pitch:            %d\n",
-				data->profile[i].pitch);
-			fprintf(stderr,"dbg5       heading:          %d\n",
-				data->profile[i].heading);
-			fprintf(stderr,"dbg5       heave:            %d\n",
-				data->profile[i].heave);
-			for (j=0;j<8;j++)
-				{
-				fprintf(stderr,"dbg5       bath:             %d\n",
-					data->profile[i].bath[j]);
-				fprintf(stderr,"dbg5       bath_acrosstrack: %d\n",
-					data->profile[i].bath_acrosstrack[j]);
-				fprintf(stderr,"dbg5       bath_alongtrack:  %d\n",
-					data->profile[i].bath_alongtrack[j]);
-				fprintf(stderr,"dbg5       tt:               %d\n",
-					data->profile[i].tt[j]);
-				fprintf(stderr,"dbg5       angle:            %d\n",
-					data->profile[i].angle[j]);
-				fprintf(stderr,"dbg5       quality:          %d\n",
-					data->profile[i].quality[j]);
-				fprintf(stderr,"dbg5       amp:              %d\n",
-					data->profile[i].amp[j]);
-				}
-			fprintf(stderr,"dbg5       \n");
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_bchrxunb_wr_data(int verbose, void *mbio_ptr, void *data_ptr, int *error)
-{
-	char	*function_name = "mbr_bchrxunb_wr_data";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_bchrxunb_struct *data;
-	FILE	*mbfp;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       data_ptr:   %p\n",(void *)data_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_bchrxunb_struct *) data_ptr;
-	mbfp = mb_io_ptr->mbfp;
-
-	if (data->kind == MB_DATA_COMMENT)
-		{
-		status = mbr_bchrxunb_wr_comment(verbose,mbfp,data,error);
-		}
-	else if (data->kind == MB_DATA_PARAMETER)
-		{
-		status = mbr_bchrxunb_wr_parameter(verbose,mbfp,data,error);
-		}
-	else if (data->kind == MB_DATA_NAV)
-		{
-		status = mbr_bchrxunb_wr_pos(verbose,mbfp,data,error);
-		}
-	else if (data->kind == MB_DATA_VELOCITY_PROFILE)
-		{
-		status = mbr_bchrxunb_wr_svp(verbose,mbfp,data,error);
-		}
-	else if (data->kind == MB_DATA_DATA && data->profile_num == 7)
-		{
-		status = mbr_bchrxunb_wr_bath56(verbose,mbfp,data,error);
-		}
-	else if (data->kind == MB_DATA_DATA && data->profile_num == 5)
-		{
-		status = mbr_bchrxunb_wr_bath40(verbose,mbfp,data,error);
-		}
-	else if (data->kind == MB_DATA_DATA && data->profile_num == 4)
-		{
-		status = mbr_bchrxunb_wr_bath32(verbose,mbfp,data,error);
-		}
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_BAD_KIND;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Data record kind in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       kind:       %d\n",data->kind);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_bchrxunb_wr_comment(int verbose, FILE *mbfp, void *data_ptr, int *error)
-{
-	char	*function_name = "mbr_bchrxunb_wr_comment";
-	int	status = MB_SUCCESS;
-	struct mbf_bchrxunb_struct *data;
-	char	line[ELAC_COMMENT_SIZE+3];
-	short int label;
-	int	len;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       data_ptr:   %p\n",(void *)data_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_bchrxunb_struct *) data_ptr;
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       comment:          %s\n",data->comment);
-		}
-
-	/* write the record label */
-	label = ELAC_COMMENT;
-#ifdef BYTESWAPPED
-	label = (short) mb_swap_short(label);
-#endif
-	status = fwrite(&label,1,2,mbfp);
-	if (status != 2)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	else
-		status = MB_SUCCESS;
-
-	/* write out the data */
-	if (status == MB_SUCCESS)
-		{
-		/* construct record */
-		len = strlen(data->comment);
-		if (len > MBSYS_ELAC_COMMENT_LENGTH)
-			len = MBSYS_ELAC_COMMENT_LENGTH;
-		for (i=0;i<len;i++)
-			line[i] = data->comment[i];
-		for (i=len;i<MBSYS_ELAC_COMMENT_LENGTH;i++)
-			line[i] = '\0';
-		line[ELAC_COMMENT_SIZE] = 0x03;
-		line[ELAC_COMMENT_SIZE+1] = '\0';
-		line[ELAC_COMMENT_SIZE+2] = '\0';
-
-		/* write out data */
-		status = fwrite(line,1,ELAC_COMMENT_SIZE+3,mbfp);
-		if (status != ELAC_COMMENT_SIZE+3)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_bchrxunb_wr_parameter(int verbose, FILE *mbfp, void *data_ptr, int *error)
-{
-	char	*function_name = "mbr_bchrxunb_wr_parameter";
-	int	status = MB_SUCCESS;
-	struct mbf_bchrxunb_struct *data;
-	char	line[ELAC_XPARAMETER_SIZE+3];
-	short int label;
-	short int *short_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       data_ptr:   %p\n",(void *)data_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_bchrxunb_struct *) data_ptr;
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       year:             %d\n",data->par_year);
-		fprintf(stderr,"dbg5       month:            %d\n",data->par_month);
-		fprintf(stderr,"dbg5       day:              %d\n",data->par_day);
-		fprintf(stderr,"dbg5       hour:             %d\n",data->par_hour);
-		fprintf(stderr,"dbg5       minute:           %d\n",data->par_minute);
-		fprintf(stderr,"dbg5       sec:              %d\n",data->par_second);
-		fprintf(stderr,"dbg5       hundredth_sec:    %d\n",data->par_hundredth_sec);
-		fprintf(stderr,"dbg5       thousandth_sec:   %d\n",data->par_thousandth_sec);
-		fprintf(stderr,"dbg5       roll_offset:      %d\n",data->roll_offset);
-		fprintf(stderr,"dbg5       pitch_offset:     %d\n",data->pitch_offset);
-		fprintf(stderr,"dbg5       heading_offset:   %d\n",data->heading_offset);
-		fprintf(stderr,"dbg5       time_delay:       %d\n",data->time_delay);
-		fprintf(stderr,"dbg5       transducer_port_height: %d\n",
-			data->transducer_port_height);
-		fprintf(stderr,"dbg5       transducer_starboard_height:%d\n",
-			data->transducer_starboard_height);
-		fprintf(stderr,"dbg5       transducer_port_depth:     %d\n",
-			data->transducer_port_depth);
-		fprintf(stderr,"dbg5       transducer_starboard_depth:     %d\n",
-			data->transducer_starboard_depth);
-		fprintf(stderr,"dbg5       transducer_port_x:        %d\n",
-			data->transducer_port_x);
-		fprintf(stderr,"dbg5       transducer_starboard_x:        %d\n",
-			data->transducer_starboard_x);
-		fprintf(stderr,"dbg5       transducer_port_y:        %d\n",
-			data->transducer_port_y);
-		fprintf(stderr,"dbg5       transducer_starboard_y:  %d\n",
-			data->transducer_starboard_y);
-		fprintf(stderr,"dbg5       transducer_port_error:  %d\n",
-			data->transducer_port_error);
-		fprintf(stderr,"dbg5       transducer_starboard_error:  %d\n",
-			data->transducer_starboard_error);
-		fprintf(stderr,"dbg5       antenna_height:            %d\n",data->antenna_height);
-		fprintf(stderr,"dbg5       antenna_x:      %d\n",data->antenna_x);
-		fprintf(stderr,"dbg5       antenna_y:    %d\n",data->antenna_y);
-		fprintf(stderr,"dbg5       vru_height:%d\n",data->vru_height);
-		fprintf(stderr,"dbg5       vru_x:%d\n",data->vru_x);
-		fprintf(stderr,"dbg5       vru_y:%d\n",data->vru_y);
-		fprintf(stderr,"dbg5       line_number:%d\n",data->line_number);
-		fprintf(stderr,"dbg5       start_or_stop:%d\n",data->start_or_stop);
-		fprintf(stderr,"dbg5       transducer_serial_number:%d\n",
-			data->transducer_serial_number);
-		}
-
-	/* write the record label */
-	label = ELAC_PARAMETER;
-#ifdef BYTESWAPPED
-	label = (short) mb_swap_short(label);
-#endif
-	status = fwrite(&label,1,2,mbfp);
-	if (status != 2)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	else
-		status = MB_SUCCESS;
-
-	/* write out the data */
-	if (status == MB_SUCCESS)
-		{
-		/* construct record */
-		line[0] = (char) data->par_day;
-		line[1] = (char) data->par_month;
-		line[2] = (char) data->par_year;
-		line[3] = (char) data->par_hour;
-		line[4] = (char) data->par_minute;
-		line[5] = (char) data->par_second;
-		line[6] = (char) data->par_hundredth_sec;
-		line[7] = (char) data->par_thousandth_sec;
-#ifndef BYTESWAPPED
-		short_ptr = (short int *) &line[8];
-		*short_ptr = data->roll_offset;
-		short_ptr = (short int *) &line[10];
-		*short_ptr = data->pitch_offset;
-		short_ptr = (short int *) &line[12];
-		*short_ptr = data->heading_offset;
-		short_ptr = (short int *) &line[14];
-		*short_ptr = data->time_delay;
-		short_ptr = (short int *) &line[16];
-		*short_ptr = data->transducer_port_height;
-		short_ptr = (short int *) &line[18];
-		*short_ptr = data->transducer_starboard_height;
-		short_ptr = (short int *) &line[20];
-		*short_ptr = data->transducer_port_depth;
-		short_ptr = (short int *) &line[22];
-		*short_ptr = data->transducer_starboard_depth;
-		short_ptr = (short int *) &line[24];
-		*short_ptr = data->transducer_port_x;
-		short_ptr = (short int *) &line[26];
-		*short_ptr = data->transducer_starboard_x;
-		short_ptr = (short int *) &line[28];
-		*short_ptr = data->transducer_port_y;
-		short_ptr = (short int *) &line[30];
-		*short_ptr = data->transducer_starboard_y;
-		short_ptr = (short int *) &line[32];
-		*short_ptr = data->transducer_port_error;
-		short_ptr = (short int *) &line[34];
-		*short_ptr = data->transducer_starboard_error;
-		short_ptr = (short int *) &line[36];
-		*short_ptr = data->antenna_height;
-		short_ptr = (short int *) &line[38];
-		*short_ptr = data->antenna_x;
-		short_ptr = (short int *) &line[40];
-		*short_ptr = data->antenna_y;
-		short_ptr = (short int *) &line[42];
-		*short_ptr = data->vru_height;
-		short_ptr = (short int *) &line[44];
-		*short_ptr = data->vru_x;
-		short_ptr = (short int *) &line[46];
-		*short_ptr = data->vru_y;
-		short_ptr = (short int *) &line[48];
-		*short_ptr = data->line_number;
-		short_ptr = (short int *) &line[50];
-		*short_ptr = data->start_or_stop;
-		short_ptr = (short int *) &line[52];
-		*short_ptr = data->transducer_serial_number;
-#else
-		short_ptr = (short int *) &line[8];
-		*short_ptr = (short int) mb_swap_short(data->roll_offset);
-		short_ptr = (short int *) &line[10];
-		*short_ptr = (short int) mb_swap_short(data->pitch_offset);
-		short_ptr = (short int *) &line[12];
-		*short_ptr = (short int) mb_swap_short(data->heading_offset);
-		short_ptr = (short int *) &line[14];
-		*short_ptr = (short int) mb_swap_short(data->time_delay);
-		short_ptr = (short int *) &line[16];
-		*short_ptr = (short int)
-			mb_swap_short(data->transducer_port_height);
-		short_ptr = (short int *) &line[18];
-		*short_ptr = (short int)
-			mb_swap_short(data->transducer_starboard_height);
-		short_ptr = (short int *) &line[20];
-		*short_ptr = (short int) mb_swap_short(data->transducer_port_depth);
-		short_ptr = (short int *) &line[22];
-		*short_ptr = (short int)
-			mb_swap_short(data->transducer_starboard_depth);
-		short_ptr = (short int *) &line[24];
-		*short_ptr = (short int) mb_swap_short(data->transducer_port_x);
-		short_ptr = (short int *) &line[26];
-		*short_ptr = (short int)
-			mb_swap_short(data->transducer_starboard_x);
-		short_ptr = (short int *) &line[28];
-		*short_ptr = (short int) mb_swap_short(data->transducer_port_y);
-		short_ptr = (short int *) &line[30];
-		*short_ptr = (short int)
-			mb_swap_short(data->transducer_starboard_y);
-		short_ptr = (short int *) &line[32];
-		*short_ptr = (short int) mb_swap_short(data->transducer_port_error);
-		short_ptr = (short int *) &line[34];
-		*short_ptr = (short int)
-			mb_swap_short(data->transducer_starboard_error);
-		short_ptr = (short int *) &line[36];
-		*short_ptr = (short int) mb_swap_short(data->antenna_height);
-		short_ptr = (short int *) &line[38];
-		*short_ptr = (short int) mb_swap_short(data->antenna_x);
-		short_ptr = (short int *) &line[40];
-		*short_ptr = (short int) mb_swap_short(data->antenna_y);
-		short_ptr = (short int *) &line[42];
-		*short_ptr = (short int) mb_swap_short(data->vru_height);
-		short_ptr = (short int *) &line[44];
-		*short_ptr = (short int) mb_swap_short(data->vru_x);
-		short_ptr = (short int *) &line[46];
-		*short_ptr = (short int) mb_swap_short(data->vru_y);
-		short_ptr = (short int *) &line[48];
-		*short_ptr = (short int) mb_swap_short(data->line_number);
-		short_ptr = (short int *) &line[50];
-		*short_ptr = (short int) mb_swap_short(data->start_or_stop);
-		short_ptr = (short int *) &line[52];
-		*short_ptr = (short int)
-			mb_swap_short(data->transducer_serial_number);
-#endif
-		line[ELAC_XPARAMETER_SIZE] = 0x03;
-		line[ELAC_XPARAMETER_SIZE+1] = '\0';
-		line[ELAC_XPARAMETER_SIZE+2] = '\0';
-
-		/* write out data */
-		status = fwrite(line,1,ELAC_XPARAMETER_SIZE+3,mbfp);
-		if (status != ELAC_XPARAMETER_SIZE+3)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_bchrxunb_wr_pos(int verbose, FILE *mbfp, void *data_ptr, int *error)
-{
-	char	*function_name = "mbr_bchrxunb_wr_pos";
-	int	status = MB_SUCCESS;
-	struct mbf_bchrxunb_struct *data;
-	char	line[ELAC_POS_SIZE+3];
-	short int label;
-	short int *short_ptr;
-	int	*int_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       data_ptr:   %p\n",(void *)data_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_bchrxunb_struct *) data_ptr;
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       year:             %d\n",data->pos_year);
-		fprintf(stderr,"dbg5       month:            %d\n",data->pos_month);
-		fprintf(stderr,"dbg5       day:              %d\n",data->pos_day);
-		fprintf(stderr,"dbg5       hour:             %d\n",data->pos_hour);
-		fprintf(stderr,"dbg5       minute:           %d\n",data->pos_minute);
-		fprintf(stderr,"dbg5       sec:              %d\n",data->pos_second);
-		fprintf(stderr,"dbg5       hundredth_sec:    %d\n",data->pos_hundredth_sec);
-		fprintf(stderr,"dbg5       thousandth_sec:   %d\n",data->pos_thousandth_sec);
-		fprintf(stderr,"dbg5       pos_latitude:     %d\n",data->pos_latitude);
-		fprintf(stderr,"dbg5       pos_longitude:    %d\n",data->pos_longitude);
-		fprintf(stderr,"dbg5       utm_northing:     %d\n",data->utm_northing);
-		fprintf(stderr,"dbg5       utm_easting:      %d\n",data->utm_easting);
-		fprintf(stderr,"dbg5       utm_zone_lon:     %d\n",data->utm_zone_lon);
-		fprintf(stderr,"dbg5       utm_zone:         %c\n",data->utm_zone);
-		fprintf(stderr,"dbg5       hemisphere:       %c\n",data->hemisphere);
-		fprintf(stderr,"dbg5       ellipsoid:        %c\n",data->ellipsoid);
-		fprintf(stderr,"dbg5       pos_spare:        %c\n",data->pos_spare);
-		fprintf(stderr,"dbg5       semi_major_axis:  %d\n",data->semi_major_axis);
-		fprintf(stderr,"dbg5       other_quality:    %d\n",data->other_quality);
-		}
-
-	/* write the record label */
-	label = ELAC_POS;
-#ifdef BYTESWAPPED
-	label = (short) mb_swap_short(label);
-#endif
-	status = fwrite(&label,1,2,mbfp);
-	if (status != 2)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	else
-		status = MB_SUCCESS;
-
-	/* write out the data */
-	if (status == MB_SUCCESS)
-		{
-		/* construct record */
-		line[0] = (char) data->pos_day;
-		line[1] = (char) data->pos_month;
-		line[2] = (char) data->pos_year;
-		line[3] = (char) data->pos_hour;
-		line[4] = (char) data->pos_minute;
-		line[5] = (char) data->pos_second;
-		line[6] = (char) data->pos_hundredth_sec;
-		line[7] = (char) data->pos_thousandth_sec;
-#ifndef BYTESWAPPED
-		int_ptr = (int *) &line[8];
-		*int_ptr = data->pos_latitude;
-		int_ptr = (int *) &line[12];
-		*int_ptr = data->pos_longitude;
-		int_ptr = (int *) &line[16];
-		*int_ptr = data->utm_northing;
-		int_ptr = (int *) &line[20];
-		*int_ptr = data->utm_easting;
-		int_ptr = (int *) &line[24];
-		*int_ptr = data->utm_zone_lon;
-		line[28] = data->utm_zone;
-		line[29] = data->hemisphere;
-		line[30] = data->ellipsoid;
-		line[31] = data->pos_spare;
-		short_ptr = (short int *) &line[32];
-		*short_ptr = (short int) data->semi_major_axis;
-		short_ptr = (short int *) &line[34];
-		*short_ptr = (short int) data->other_quality;
-#else
-		int_ptr = (int *) &line[8];
-		*int_ptr = (int) mb_swap_int(data->pos_latitude);
-		int_ptr = (int *) &line[12];
-		*int_ptr = (int) mb_swap_int(data->pos_longitude);
-		int_ptr = (int *) &line[16];
-		*int_ptr = (int) mb_swap_int(data->utm_northing);
-		int_ptr = (int *) &line[20];
-		*int_ptr = (int) mb_swap_int(data->utm_easting);
-		int_ptr = (int *) &line[24];
-		*int_ptr = (int) mb_swap_int(data->utm_zone_lon);
-		line[28] = data->utm_zone;
-		line[29] = data->hemisphere;
-		line[30] = data->ellipsoid;
-		line[31] = data->pos_spare;
-		short_ptr = (short int *) &line[32];
-		*short_ptr = (int) mb_swap_short(data->semi_major_axis);
-		short_ptr = (short int *) &line[34];
-		*short_ptr = (int) mb_swap_short(data->other_quality);
-#endif
-		line[ELAC_POS_SIZE] = 0x03;
-		line[ELAC_POS_SIZE+1] = '\0';
-		line[ELAC_POS_SIZE+2] = '\0';
-
-		/* write out data */
-		status = fwrite(line,1,ELAC_POS_SIZE+3,mbfp);
-		if (status != ELAC_POS_SIZE+3)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_bchrxunb_wr_svp(int verbose, FILE *mbfp, void *data_ptr, int *error)
-{
-	char	*function_name = "mbr_bchrxunb_wr_svp";
-	int	status = MB_SUCCESS;
-	struct mbf_bchrxunb_struct *data;
-	char	line[ELAC_SVP_SIZE+3];
-	short int label;
-	short int *short_ptr;
-	short int *short_ptr2;
-	int	*int_ptr;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       data_ptr:   %p\n",(void *)data_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_bchrxunb_struct *) data_ptr;
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       year:             %d\n",data->svp_year);
-		fprintf(stderr,"dbg5       month:            %d\n",data->svp_month);
-		fprintf(stderr,"dbg5       day:              %d\n",data->svp_day);
-		fprintf(stderr,"dbg5       hour:             %d\n",data->svp_hour);
-		fprintf(stderr,"dbg5       minute:           %d\n",data->svp_minute);
-		fprintf(stderr,"dbg5       sec:              %d\n",data->svp_second);
-		fprintf(stderr,"dbg5       hundredth_sec:    %d\n",data->svp_hundredth_sec);
-		fprintf(stderr,"dbg5       thousandth_sec:   %d\n",data->svp_thousandth_sec);
-		fprintf(stderr,"dbg5       svp_latitude:     %d\n",data->svp_latitude);
-		fprintf(stderr,"dbg5       svp_longitude:    %d\n",data->svp_longitude);
-		fprintf(stderr,"dbg5       svp_num:          %d\n",data->svp_num);
-		for (i=0;i<data->svp_num;i++)
-			fprintf(stderr,"dbg5       depth: %d     vel: %d\n",
-				data->svp_depth[i],data->svp_vel[i]);
-		}
-
-	/* write the record label */
-	label = ELAC_SVP;
-#ifdef BYTESWAPPED
-	label = (short) mb_swap_short(label);
-#endif
-	status = fwrite(&label,1,2,mbfp);
-	if (status != 2)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	else
-		status = MB_SUCCESS;
-
-	/* write out the data */
-	if (status == MB_SUCCESS)
-		{
-		/* construct record */
-		line[0] = (char) data->svp_day;
-		line[1] = (char) data->svp_month;
-		line[2] = (char) data->svp_year;
-		line[3] = (char) data->svp_hour;
-		line[4] = (char) data->svp_minute;
-		line[5] = (char) data->svp_second;
-		line[6] = (char) data->svp_hundredth_sec;
-		line[7] = (char) data->svp_thousandth_sec;
-#ifndef BYTESWAPPED
-		int_ptr = (int *) &line[8];
-		*int_ptr = data->svp_latitude;
-		int_ptr = (int *) &line[12];
-		*int_ptr = data->svp_longitude;
-#else
-		int_ptr = (int *) &line[8];
-		*int_ptr = (int) mb_swap_int(data->svp_latitude);
-		int_ptr = (int *) &line[12];
-		*int_ptr = (int) mb_swap_int(data->svp_longitude);
-#endif
-		for (i=0;i<data->svp_num;i++)
-			{
-			short_ptr = (short int *) &line[16+4*i];
-			short_ptr2 = (short int *) &line[18+4*i];
-#ifndef BYTESWAPPED
-			*short_ptr = (short int) data->svp_depth[i];
-			*short_ptr2 = (short int) data->svp_vel[i];
-#else
-			*short_ptr = (short int)
-				mb_swap_short((short int)data->svp_depth[i]);
-			*short_ptr2 = (short int)
-				mb_swap_short((short int)data->svp_vel[i]);
-#endif
-			}
-		for (i=data->svp_num;i<500;i++)
-			{
-			short_ptr = (short int *) &line[16+4*i];
-			short_ptr2 = (short int *) &line[18+4*i];
-			*short_ptr = 0;
-			*short_ptr2 = 0;
-			}
-		line[ELAC_SVP_SIZE] = 0x03;
-		line[ELAC_SVP_SIZE+1] = '\0';
-		line[ELAC_SVP_SIZE+2] = '\0';
-
-		/* write out data */
-		status = fwrite(line,1,ELAC_SVP_SIZE+3,mbfp);
-		if (status != ELAC_SVP_SIZE+3)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_bchrxunb_wr_bath56(int verbose, FILE *mbfp, void *data_ptr, int *error)
-{
-	char	*function_name = "mbr_bchrxunb_wr_bath56";
-	int	status = MB_SUCCESS;
-	struct mbf_bchrxunb_struct *data;
-	char	line[ELAC_XBATH56_SIZE+3];
-	char	*profile;
-	char	*beam;
-	short int label;
-	short int *short_ptr;
-	int	*int_ptr;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       data_ptr:   %p\n",(void *)data_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_bchrxunb_struct *) data_ptr;
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       ping_num:         %d\n",data->ping_num);
-		fprintf(stderr,"dbg5       sound_vel:        %d\n",data->sound_vel);
-		fprintf(stderr,"dbg5       mode:             %d\n",data->mode);
-		fprintf(stderr,"dbg5       pulse_length:     %d\n",
-			data->pulse_length);
-		fprintf(stderr,"dbg5       source_power:     %d\n",
-			data->source_power);
-		fprintf(stderr,"dbg5       receiver_gain:    %d\n",
-			data->receiver_gain);
-		fprintf(stderr,"dbg5       profile_num:      %d\n",
-			data->profile_num);
-		fprintf(stderr,"dbg5       beams_bath:       %d\n",
-			data->beams_bath);
-		for (i=0;i<data->profile_num;i++)
-			{
-			fprintf(stderr,"dbg5       profile:          %d\n",i);
-			fprintf(stderr,"dbg5       year:             %d\n",
-				data->profile[i].year);
-			fprintf(stderr,"dbg5       month:            %d\n",
-				data->profile[i].month);
-			fprintf(stderr,"dbg5       day:              %d\n",
-				data->profile[i].day);
-			fprintf(stderr,"dbg5       hour:             %d\n",
-				data->profile[i].hour);
-			fprintf(stderr,"dbg5       minute:           %d\n",
-				data->profile[i].minute);
-			fprintf(stderr,"dbg5       sec:              %d\n",
-				data->profile[i].second);
-			fprintf(stderr,"dbg5       hundredth_sec:    %d\n",
-				data->profile[i].hundredth_sec);
-			fprintf(stderr,"dbg5       thousandth_sec:   %d\n",
-				data->profile[i].thousandth_sec);
-			fprintf(stderr,"dbg5       latitude:         %d\n",
-				data->profile[i].latitude);
-			fprintf(stderr,"dbg5       longitude:        %d\n",
-				data->profile[i].longitude);
-			fprintf(stderr,"dbg5       roll:             %d\n",
-				data->profile[i].roll);
-			fprintf(stderr,"dbg5       pitch:            %d\n",
-				data->profile[i].pitch);
-			fprintf(stderr,"dbg5       heading:          %d\n",
-				data->profile[i].heading);
-			fprintf(stderr,"dbg5       heave:            %d\n",
-				data->profile[i].heave);
-			for (j=0;j<8;j++)
-				{
-				fprintf(stderr,"dbg5       bath:             %d\n",
-					data->profile[i].bath[j]);
-				fprintf(stderr,"dbg5       bath_acrosstrack: %d\n",
-					data->profile[i].bath_acrosstrack[j]);
-				fprintf(stderr,"dbg5       bath_alongtrack:  %d\n",
-					data->profile[i].bath_alongtrack[j]);
-				fprintf(stderr,"dbg5       tt:               %d\n",
-					data->profile[i].tt[j]);
-				fprintf(stderr,"dbg5       angle:            %d\n",
-					data->profile[i].angle[j]);
-				fprintf(stderr,"dbg5       quality:          %d\n",
-					data->profile[i].quality[j]);
-				fprintf(stderr,"dbg5       amp:              %d\n",
-					data->profile[i].amp[j]);
-				}
-			fprintf(stderr,"dbg5       \n");
-			}
-		}
-
-	/* write the record label */
-	label = ELAC_XBATH56;
-#ifdef BYTESWAPPED
-	label = (short) mb_swap_short(label);
-#endif
-	status = fwrite(&label,1,2,mbfp);
-	if (status != 2)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	else
-		status = MB_SUCCESS;
-
-	/* write out the data */
-	if (status == MB_SUCCESS)
-		{
-		/* construct record */
-#ifndef BYTESWAPPED
-		short_ptr = (short int *) &line[0];
-		*short_ptr = (short int) data->ping_num;
-		short_ptr = (short int *) &line[2];
-		*short_ptr = (short int) data->sound_vel;
-#else
-		short_ptr = (short int *) &line[0];
-		*short_ptr = (short int)
-			mb_swap_short((short int) data->ping_num);
-		short_ptr = (short int *) &line[2];
-		*short_ptr = (short int)
-			mb_swap_short((short int) data->sound_vel);
-#endif
-		line[4] = (char) data->mode;
-		line[5] = (char) data->pulse_length;
-		line[6] = (char) data->source_power;
-		line[7] = (char) data->receiver_gain;
-		for (i=0;i<data->profile_num;i++)
-			{
-			profile = &line[8+i*152];
-			profile[0] = (char) data->profile[i].day;
-			profile[1] = (char) data->profile[i].month;
-			profile[2] = (char) data->profile[i].year;
-			profile[3] = (char) data->profile[i].hour;
-			profile[4] = (char) data->profile[i].minute;
-			profile[5] = (char) data->profile[i].second;
-			profile[6] = (char) data->profile[i].hundredth_sec;
-			profile[7] = (char) data->profile[i].thousandth_sec;
-#ifndef BYTESWAPPED
-			int_ptr = (int *) &profile[8];
-			*int_ptr = (int) data->profile[i].latitude;
-			int_ptr = (int *) &profile[12];
-			*int_ptr = (int) data->profile[i].longitude;
-			short_ptr = (short int *) &profile[16];
-			*short_ptr = (short int) data->profile[i].roll;
-			short_ptr = (short int *) &profile[18];
-			*short_ptr = (short int) data->profile[i].pitch;
-			short_ptr = (short int *) &profile[20];
-			*short_ptr = (short int)(unsigned short) data->profile[i].heading;
-			short_ptr = (short int *) &profile[22];
-			*short_ptr = (short int) data->profile[i].heave;
-			for (j=0;j<8;j++)
-				{
-				beam = &profile[24 + 16*j];
-				int_ptr = (int *) &beam[0];
-				*int_ptr = (int) data->profile[i].bath[j];
-				int_ptr = (int *) &beam[4];
-				*int_ptr = (int)
-					data->profile[i].bath_acrosstrack[j];
-				short_ptr = (short *) &beam[8];
-				*short_ptr = (short int)
-					data->profile[i].bath_alongtrack[j];
-				short_ptr = (short *) &beam[10];
-				*short_ptr = (short int) data->profile[i].tt[j];
-				short_ptr = (short *) &beam[12];
-				*short_ptr = (short int) data->profile[i].angle[j];
-				beam[14] = (char) data->profile[i].quality[j];
-				beam[15] = (char) data->profile[i].amp[j];
-				}
-#else
-			int_ptr = (int *) &profile[8];
-			*int_ptr
-				= (int) mb_swap_int(data->profile[i].latitude);
-			int_ptr = (int *) &profile[12];
-			*int_ptr
-				= (int) mb_swap_int(data->profile[i].longitude);
-			short_ptr = (short int *) &profile[16];
-			*short_ptr = (short int)
-				mb_swap_short((short int) data->profile[i].roll);
-			short_ptr = (short int *) &profile[18];
-			*short_ptr = (short int)
-				mb_swap_short((short int) data->profile[i].pitch);
-			short_ptr = (short int *) &profile[20];
-			*short_ptr = (short int)
-				mb_swap_short((short int)(unsigned short) data->profile[i].heading);
-			short_ptr = (short int *) &profile[22];
-			*short_ptr = (short int)
-				mb_swap_short((short int) data->profile[i].heave);
-			for (j=0;j<8;j++)
-				{
-				beam = &profile[24 + 16*j];
-				int_ptr = (int *) &beam[0];
-				*int_ptr = (int)
-					mb_swap_int(data->profile[i].bath[j]);
-				int_ptr = (int *) &beam[4];
-				*int_ptr = (int)
-					mb_swap_int(data->profile[i].bath_acrosstrack[j]);
-				short_ptr = (short *) &beam[8];
-				*short_ptr = (short int)
-					mb_swap_short(data->profile[i].bath_alongtrack[j]);
-				short_ptr = (short *) &beam[10];
-				*short_ptr = (short int)
-					mb_swap_short(data->profile[i].tt[j]);
-				short_ptr = (short *) &beam[12];
-				*short_ptr = (short int)
-					mb_swap_short(data->profile[i].angle[j]);
-				beam[14] = (char) data->profile[i].quality[j];
-				beam[15] = (char) data->profile[i].amp[j];
-				}
-#endif
-			}
-		line[ELAC_XBATH56_SIZE] = 0x03;
-		line[ELAC_XBATH56_SIZE+1] = '\0';
-		line[ELAC_XBATH56_SIZE+2] = '\0';
-
-		/* write out data */
-		status = fwrite(line,1,ELAC_XBATH56_SIZE+3,mbfp);
-		if (status != ELAC_XBATH56_SIZE+3)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_bchrxunb_wr_bath40(int verbose, FILE *mbfp, void *data_ptr, int *error)
-{
-	char	*function_name = "mbr_bchrxunb_wr_bath40";
-	int	status = MB_SUCCESS;
-	struct mbf_bchrxunb_struct *data;
-	char	line[ELAC_XBATH40_SIZE+3];
-	char	*profile;
-	char	*beam;
-	short int label;
-	short int *short_ptr;
-	int	*int_ptr;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       data_ptr:   %p\n",(void *)data_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_bchrxunb_struct *) data_ptr;
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       ping_num:         %d\n",data->ping_num);
-		fprintf(stderr,"dbg5       sound_vel:        %d\n",data->sound_vel);
-		fprintf(stderr,"dbg5       mode:             %d\n",data->mode);
-		fprintf(stderr,"dbg5       pulse_length:     %d\n",
-			data->pulse_length);
-		fprintf(stderr,"dbg5       source_power:     %d\n",
-			data->source_power);
-		fprintf(stderr,"dbg5       receiver_gain:    %d\n",
-			data->receiver_gain);
-		fprintf(stderr,"dbg5       profile_num:      %d\n",
-			data->profile_num);
-		fprintf(stderr,"dbg5       beams_bath:       %d\n",
-			data->beams_bath);
-		for (i=0;i<data->profile_num;i++)
-			{
-			fprintf(stderr,"dbg5       profile:          %d\n",i);
-			fprintf(stderr,"dbg5       year:             %d\n",
-				data->profile[i].year);
-			fprintf(stderr,"dbg5       month:            %d\n",
-				data->profile[i].month);
-			fprintf(stderr,"dbg5       day:              %d\n",
-				data->profile[i].day);
-			fprintf(stderr,"dbg5       hour:             %d\n",
-				data->profile[i].hour);
-			fprintf(stderr,"dbg5       minute:           %d\n",
-				data->profile[i].minute);
-			fprintf(stderr,"dbg5       sec:              %d\n",
-				data->profile[i].second);
-			fprintf(stderr,"dbg5       hundredth_sec:    %d\n",
-				data->profile[i].hundredth_sec);
-			fprintf(stderr,"dbg5       thousandth_sec:   %d\n",
-				data->profile[i].thousandth_sec);
-			fprintf(stderr,"dbg5       latitude:         %d\n",
-				data->profile[i].latitude);
-			fprintf(stderr,"dbg5       longitude:        %d\n",
-				data->profile[i].longitude);
-			fprintf(stderr,"dbg5       roll:             %d\n",
-				data->profile[i].roll);
-			fprintf(stderr,"dbg5       pitch:            %d\n",
-				data->profile[i].pitch);
-			fprintf(stderr,"dbg5       heading:          %d\n",
-				data->profile[i].heading);
-			fprintf(stderr,"dbg5       heave:            %d\n",
-				data->profile[i].heave);
-			for (j=0;j<8;j++)
-				{
-				fprintf(stderr,"dbg5       bath:             %d\n",
-					data->profile[i].bath[j]);
-				fprintf(stderr,"dbg5       bath_acrosstrack: %d\n",
-					data->profile[i].bath_acrosstrack[j]);
-				fprintf(stderr,"dbg5       bath_alongtrack:  %d\n",
-					data->profile[i].bath_alongtrack[j]);
-				fprintf(stderr,"dbg5       tt:               %d\n",
-					data->profile[i].tt[j]);
-				fprintf(stderr,"dbg5       angle:            %d\n",
-					data->profile[i].angle[j]);
-				fprintf(stderr,"dbg5       quality:          %d\n",
-					data->profile[i].quality[j]);
-				fprintf(stderr,"dbg5       amp:              %d\n",
-					data->profile[i].amp[j]);
-				}
-			fprintf(stderr,"dbg5       \n");
-			}
-		}
-
-	/* write the record label */
-	label = ELAC_XBATH40;
-#ifdef BYTESWAPPED
-	label = (short) mb_swap_short(label);
-#endif
-	status = fwrite(&label,1,2,mbfp);
-	if (status != 2)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	else
-		status = MB_SUCCESS;
-
-	/* write out the data */
-	if (status == MB_SUCCESS)
-		{
-		/* construct record */
-#ifndef BYTESWAPPED
-		short_ptr = (short int *) &line[0];
-		*short_ptr = (short int) data->ping_num;
-		short_ptr = (short int *) &line[2];
-		*short_ptr = (short int) data->sound_vel;
-#else
-		short_ptr = (short int *) &line[0];
-		*short_ptr = (short int)
-			mb_swap_short((short int) data->ping_num);
-		short_ptr = (short int *) &line[2];
-		*short_ptr = (short int)
-			mb_swap_short((short int) data->sound_vel);
-#endif
-		line[4] = (char) data->mode;
-		line[5] = (char) data->pulse_length;
-		line[6] = (char) data->source_power;
-		line[7] = (char) data->receiver_gain;
-		for (i=0;i<data->profile_num;i++)
-			{
-			profile = &line[8+i*152];
-			profile[0] = (char) data->profile[i].day;
-			profile[1] = (char) data->profile[i].month;
-			profile[2] = (char) data->profile[i].year;
-			profile[3] = (char) data->profile[i].hour;
-			profile[4] = (char) data->profile[i].minute;
-			profile[5] = (char) data->profile[i].second;
-			profile[6] = (char) data->profile[i].hundredth_sec;
-			profile[7] = (char) data->profile[i].thousandth_sec;
-#ifndef BYTESWAPPED
-			int_ptr = (int *) &profile[8];
-			*int_ptr = (int) data->profile[i].latitude;
-			int_ptr = (int *) &profile[12];
-			*int_ptr = (int) data->profile[i].longitude;
-			short_ptr = (short int *) &profile[16];
-			*short_ptr = (short int) data->profile[i].roll;
-			short_ptr = (short int *) &profile[18];
-			*short_ptr = (short int) data->profile[i].pitch;
-			short_ptr = (short int *) &profile[20];
-			*short_ptr = (short int)(unsigned short) data->profile[i].heading;
-			short_ptr = (short int *) &profile[22];
-			*short_ptr = (short int) data->profile[i].heave;
-			for (j=0;j<8;j++)
-				{
-				beam = &profile[24 + 16*j];
-				int_ptr = (int *) &beam[0];
-				*int_ptr = (int) data->profile[i].bath[j];
-				int_ptr = (int *) &beam[4];
-				*int_ptr = (int)
-					data->profile[i].bath_acrosstrack[j];
-				short_ptr = (short *) &beam[8];
-				*short_ptr = (short int)
-					data->profile[i].bath_alongtrack[j];
-				short_ptr = (short *) &beam[10];
-				*short_ptr = (short int) data->profile[i].tt[j];
-				short_ptr = (short *) &beam[12];
-				*short_ptr = (short int) data->profile[i].angle[j];
-				beam[14] = (char) data->profile[i].quality[j];
-				beam[15] = (char) data->profile[i].amp[j];
-				}
-#else
-			int_ptr = (int *) &profile[8];
-			*int_ptr
-				= (int) mb_swap_int(data->profile[i].latitude);
-			int_ptr = (int *) &profile[12];
-			*int_ptr
-				= (int) mb_swap_int(data->profile[i].longitude);
-			short_ptr = (short int *) &profile[16];
-			*short_ptr = (short int)
-				mb_swap_short((short int) data->profile[i].roll);
-			short_ptr = (short int *) &profile[18];
-			*short_ptr = (short int)
-				mb_swap_short((short int) data->profile[i].pitch);
-			short_ptr = (short int *) &profile[20];
-			*short_ptr = (short int)
-				mb_swap_short((short int)(unsigned short) data->profile[i].heading);
-			short_ptr = (short int *) &profile[22];
-			*short_ptr = (short int)
-				mb_swap_short((short int) data->profile[i].heave);
-			for (j=0;j<8;j++)
-				{
-				beam = &profile[24 + 16*j];
-				int_ptr = (int *) &beam[0];
-				*int_ptr = (int)
-					mb_swap_int(data->profile[i].bath[j]);
-				int_ptr = (int *) &beam[4];
-				*int_ptr = (int)
-					mb_swap_int(data->profile[i].bath_acrosstrack[j]);
-				short_ptr = (short *) &beam[8];
-				*short_ptr = (short int)
-					mb_swap_short(data->profile[i].bath_alongtrack[j]);
-				short_ptr = (short *) &beam[10];
-				*short_ptr = (short int)
-					mb_swap_short(data->profile[i].tt[j]);
-				short_ptr = (short *) &beam[12];
-				*short_ptr = (short int)
-					mb_swap_short(data->profile[i].angle[j]);
-				beam[14] = (char) data->profile[i].quality[j];
-				beam[15] = (char) data->profile[i].amp[j];
-				}
-#endif
-			}
-		line[ELAC_XBATH40_SIZE] = 0x03;
-		line[ELAC_XBATH40_SIZE+1] = '\0';
-		line[ELAC_XBATH40_SIZE+2] = '\0';
-
-		/* write out data */
-		status = fwrite(line,1,ELAC_XBATH40_SIZE+3,mbfp);
-		if (status != ELAC_XBATH40_SIZE+3)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_bchrxunb_wr_bath32(int verbose, FILE *mbfp, void *data_ptr, int *error)
-{
-	char	*function_name = "mbr_bchrxunb_wr_bath32";
-	int	status = MB_SUCCESS;
-	struct mbf_bchrxunb_struct *data;
-	char	line[ELAC_XBATH32_SIZE+3];
-	char	*profile;
-	char	*beam;
-	short int label;
-	short int *short_ptr;
-	int	*int_ptr;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       data_ptr:   %p\n",(void *)data_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_bchrxunb_struct *) data_ptr;
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       ping_num:         %d\n",data->ping_num);
-		fprintf(stderr,"dbg5       sound_vel:        %d\n",data->sound_vel);
-		fprintf(stderr,"dbg5       mode:             %d\n",data->mode);
-		fprintf(stderr,"dbg5       pulse_length:     %d\n",
-			data->pulse_length);
-		fprintf(stderr,"dbg5       source_power:     %d\n",
-			data->source_power);
-		fprintf(stderr,"dbg5       receiver_gain:    %d\n",
-			data->receiver_gain);
-		fprintf(stderr,"dbg5       profile_num:      %d\n",
-			data->profile_num);
-		fprintf(stderr,"dbg5       beams_bath:       %d\n",
-			data->beams_bath);
-		for (i=0;i<data->profile_num;i++)
-			{
-			fprintf(stderr,"dbg5       profile:          %d\n",i);
-			fprintf(stderr,"dbg5       year:             %d\n",
-				data->profile[i].year);
-			fprintf(stderr,"dbg5       month:            %d\n",
-				data->profile[i].month);
-			fprintf(stderr,"dbg5       day:              %d\n",
-				data->profile[i].day);
-			fprintf(stderr,"dbg5       hour:             %d\n",
-				data->profile[i].hour);
-			fprintf(stderr,"dbg5       minute:           %d\n",
-				data->profile[i].minute);
-			fprintf(stderr,"dbg5       sec:              %d\n",
-				data->profile[i].second);
-			fprintf(stderr,"dbg5       hundredth_sec:    %d\n",
-				data->profile[i].hundredth_sec);
-			fprintf(stderr,"dbg5       thousandth_sec:   %d\n",
-				data->profile[i].thousandth_sec);
-			fprintf(stderr,"dbg5       latitude:         %d\n",
-				data->profile[i].latitude);
-			fprintf(stderr,"dbg5       longitude:        %d\n",
-				data->profile[i].longitude);
-			fprintf(stderr,"dbg5       roll:             %d\n",
-				data->profile[i].roll);
-			fprintf(stderr,"dbg5       pitch:            %d\n",
-				data->profile[i].pitch);
-			fprintf(stderr,"dbg5       heading:          %d\n",
-				data->profile[i].heading);
-			fprintf(stderr,"dbg5       heave:            %d\n",
-				data->profile[i].heave);
-			for (j=0;j<8;j++)
-				{
-				fprintf(stderr,"dbg5       bath:             %d\n",
-					data->profile[i].bath[j]);
-				fprintf(stderr,"dbg5       bath_acrosstrack: %d\n",
-					data->profile[i].bath_acrosstrack[j]);
-				fprintf(stderr,"dbg5       bath_alongtrack:  %d\n",
-					data->profile[i].bath_alongtrack[j]);
-				fprintf(stderr,"dbg5       tt:               %d\n",
-					data->profile[i].tt[j]);
-				fprintf(stderr,"dbg5       angle:            %d\n",
-					data->profile[i].angle[j]);
-				fprintf(stderr,"dbg5       quality:          %d\n",
-					data->profile[i].quality[j]);
-				fprintf(stderr,"dbg5       amp:              %d\n",
-					data->profile[i].amp[j]);
-				}
-			fprintf(stderr,"dbg5       \n");
-			}
-		}
-
-	/* write the record label */
-	label = ELAC_XBATH32;
-#ifdef BYTESWAPPED
-	label = (short) mb_swap_short(label);
-#endif
-	status = fwrite(&label,1,2,mbfp);
-	if (status != 2)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	else
-		status = MB_SUCCESS;
-
-	/* write out the data */
-	if (status == MB_SUCCESS)
-		{
-		/* construct record */
-#ifndef BYTESWAPPED
-		short_ptr = (short int *) &line[0];
-		*short_ptr = (short int) data->ping_num;
-		short_ptr = (short int *) &line[2];
-		*short_ptr = (short int) data->sound_vel;
-#else
-		short_ptr = (short int *) &line[0];
-		*short_ptr = (short int)
-			mb_swap_short((short int) data->ping_num);
-		short_ptr = (short int *) &line[2];
-		*short_ptr = (short int)
-			mb_swap_short((short int) data->sound_vel);
-#endif
-		line[4] = (char) data->mode;
-		line[5] = (char) data->pulse_length;
-		line[6] = (char) data->source_power;
-		line[7] = (char) data->receiver_gain;
-		for (i=0;i<data->profile_num;i++)
-			{
-			profile = &line[8+i*152];
-			profile[0] = (char) data->profile[i].day;
-			profile[1] = (char) data->profile[i].month;
-			profile[2] = (char) data->profile[i].year;
-			profile[3] = (char) data->profile[i].hour;
-			profile[4] = (char) data->profile[i].minute;
-			profile[5] = (char) data->profile[i].second;
-			profile[6] = (char) data->profile[i].hundredth_sec;
-			profile[7] = (char) data->profile[i].thousandth_sec;
-#ifndef BYTESWAPPED
-			int_ptr = (int *) &profile[8];
-			*int_ptr = (int) data->profile[i].latitude;
-			int_ptr = (int *) &profile[12];
-			*int_ptr = (int) data->profile[i].longitude;
-			short_ptr = (short int *) &profile[16];
-			*short_ptr = (short int) data->profile[i].roll;
-			short_ptr = (short int *) &profile[18];
-			*short_ptr = (short int) data->profile[i].pitch;
-			short_ptr = (short int *) &profile[20];
-			*short_ptr = (short int)(unsigned short) data->profile[i].heading;
-			short_ptr = (short int *) &profile[22];
-			*short_ptr = (short int) data->profile[i].heave;
-			for (j=0;j<8;j++)
-				{
-				beam = &profile[24 + 16*j];
-				int_ptr = (int *) &beam[0];
-				*int_ptr = (int) data->profile[i].bath[j];
-				int_ptr = (int *) &beam[4];
-				*int_ptr = (int)
-					data->profile[i].bath_acrosstrack[j];
-				short_ptr = (short *) &beam[8];
-				*short_ptr = (short int)
-					data->profile[i].bath_alongtrack[j];
-				short_ptr = (short *) &beam[10];
-				*short_ptr = (short int) data->profile[i].tt[j];
-				short_ptr = (short *) &beam[12];
-				*short_ptr = (short int) data->profile[i].angle[j];
-				beam[14] = (char) data->profile[i].quality[j];
-				beam[15] = (char) data->profile[i].amp[j];
-				}
-#else
-			int_ptr = (int *) &profile[8];
-			*int_ptr
-				= (int) mb_swap_int(data->profile[i].latitude);
-			int_ptr = (int *) &profile[12];
-			*int_ptr
-				= (int) mb_swap_int(data->profile[i].longitude);
-			short_ptr = (short int *) &profile[16];
-			*short_ptr = (short int)
-				mb_swap_short((short int) data->profile[i].roll);
-			short_ptr = (short int *) &profile[18];
-			*short_ptr = (short int)
-				mb_swap_short((short int) data->profile[i].pitch);
-			short_ptr = (short int *) &profile[20];
-			*short_ptr = (short int)
-				mb_swap_short((short int)(unsigned short) data->profile[i].heading);
-			short_ptr = (short int *) &profile[22];
-			*short_ptr = (short int)
-				mb_swap_short((short int) data->profile[i].heave);
-			for (j=0;j<8;j++)
-				{
-				beam = &profile[24 + 16*j];
-				int_ptr = (int *) &beam[0];
-				*int_ptr = (int)
-					mb_swap_int(data->profile[i].bath[j]);
-				int_ptr = (int *) &beam[4];
-				*int_ptr = (int)
-					mb_swap_int(data->profile[i].bath_acrosstrack[j]);
-				short_ptr = (short *) &beam[8];
-				*short_ptr = (short int)
-					mb_swap_short(data->profile[i].bath_alongtrack[j]);
-				short_ptr = (short *) &beam[10];
-				*short_ptr = (short int)
-					mb_swap_short(data->profile[i].tt[j]);
-				short_ptr = (short *) &beam[12];
-				*short_ptr = (short int)
-					mb_swap_short(data->profile[i].angle[j]);
-				beam[14] = (char) data->profile[i].quality[j];
-				beam[15] = (char) data->profile[i].amp[j];
-				}
-#endif
-			}
-		line[ELAC_XBATH32_SIZE] = 0x03;
-		line[ELAC_XBATH32_SIZE+1] = '\0';
-		line[ELAC_XBATH32_SIZE+2] = '\0';
-
-		/* write out data */
-		status = fwrite(line,1,ELAC_XBATH32_SIZE+3,mbfp);
-		if (status != ELAC_XBATH32_SIZE+3)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mbr_cbat8101.c b/src/mbio/mbr_cbat8101.c
deleted file mode 100644
index d6d0e68..0000000
--- a/src/mbio/mbr_cbat8101.c
+++ /dev/null
@@ -1,3193 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbr_cbat8101.c	8/8/94
- *	$Id: mbr_cbat8101.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1998-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbr_cbat8101.c contains the functions for reading and writing
- * multibeam data in the CBAT8101 format.
- * These functions include:
- *   mbr_alm_cbat8101	- allocate read/write memory
- *   mbr_dem_cbat8101	- deallocate read/write memory
- *   mbr_rt_cbat8101	- read and translate data
- *   mbr_wt_cbat8101	- translate and write data
- *
- * Author:	D. W. Caress
- * Date:	December 10, 1998
- *
- * $Log: mbr_cbat8101.c,v $
- * Revision 5.11  2008/09/13 06:08:09  caress
- * Updates to apply suggested patches to segy handling. Also fixes to remove compiler warnings.
- *
- * Revision 5.10  2008/07/10 06:43:40  caress
- * Preparing for 5.1.1beta20
- *
- * Revision 5.9  2006/01/06 18:27:19  caress
- * Working towards 5.0.8
- *
- * Revision 5.8  2005/11/05 00:48:04  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.7  2003/05/20 18:05:32  caress
- * Added svp_source to data source parameters.
- *
- * Revision 5.6  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.5  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.4  2001/07/20 00:31:11  caress
- * Release 5.0.beta03
- *
- * Revision 5.3  2001/06/08  21:44:01  caress
- * Version 5.0.beta01
- *
- * Revision 5.2  2001/03/22  20:45:56  caress
- * Trying to make 5.0.beta0...
- *
- * Revision 5.1  2001/01/22  07:43:34  caress
- * Version 5.0.beta01
- *
- * Revision 5.0  2000/12/01  22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.3  2000/10/11  01:02:30  caress
- * Convert to ANSI C
- *
- * Revision 4.2  2000/09/30  06:34:20  caress
- * Snapshot for Dale.
- *
- * Revision 4.1  1999/03/31  18:11:35  caress
- * MB-System 4.6beta7
- *
- * Revision 4.0  1999/01/01  23:38:01  caress
- * MB-System version 4.6beta6
- *
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mb_define.h"
-#include "mbsys_reson.h"
-#include "mbf_cbat8101.h"
-
-/* include for byte swapping on little-endian machines */
-#include "mb_swap.h"
-
-/* essential function prototypes */
-int mbr_register_cbat8101(int verbose, void *mbio_ptr,
-		int *error);
-int mbr_info_cbat8101(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_alm_cbat8101(int verbose, void *mbio_ptr, int *error);
-int mbr_dem_cbat8101(int verbose, void *mbio_ptr, int *error);
-int mbr_zero_cbat8101(int verbose, void *data_ptr, int *error);
-int mbr_rt_cbat8101(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_wt_cbat8101(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_cbat8101_rd_data(int verbose, void *mbio_ptr, int *error);
-int mbr_cbat8101_rd_comment(int verbose, FILE *mbfp, int swap,
-		struct mbf_cbat8101_struct *data, int *error);
-int mbr_cbat8101_rd_parameter(int verbose, FILE *mbfp, int swap,
-		struct mbf_cbat8101_struct *data, int *error);
-int mbr_cbat8101_rd_nav(int verbose, FILE *mbfp, int swap,
-		struct mbf_cbat8101_struct *data, int *error);
-int mbr_cbat8101_rd_svp(int verbose, FILE *mbfp, int swap,
-		struct mbf_cbat8101_struct *data, int *error);
-int mbr_cbat8101_rd_short_svp(int verbose, FILE *mbfp, int swap,
-		struct mbf_cbat8101_struct *data, int *error);
-int mbr_cbat8101_rd_bath(int verbose, FILE *mbfp, int swap,
-		struct mbf_cbat8101_struct *data, int *error);
-int mbr_cbat8101_rd_heading(int verbose, FILE *mbfp, int swap,
-		struct mbf_cbat8101_struct *data, int *error);
-int mbr_cbat8101_rd_attitude(int verbose, FILE *mbfp, int swap,
-		struct mbf_cbat8101_struct *data, int *error);
-int mbr_cbat8101_wr_data(int verbose, void *mbio_ptr, void *data_ptr, int *error);
-int mbr_cbat8101_wr_comment(int verbose, FILE *mbfp, int swap, void *data_ptr, int *error);
-int mbr_cbat8101_wr_parameter(int verbose, FILE *mbfp, int swap, void *data_ptr, int *error);
-int mbr_cbat8101_wr_nav(int verbose, FILE *mbfp, int swap, void *data_ptr, int *error);
-int mbr_cbat8101_wr_svp(int verbose, FILE *mbfp, int swap, void *data_ptr, int *error);
-int mbr_cbat8101_wr_bath(int verbose, FILE *mbfp, int swap, void *data_ptr, int *error);
-int mbr_cbat8101_wr_heading(int verbose, FILE *mbfp, int swap, void *data_ptr, int *error);
-int mbr_cbat8101_wr_attitude(int verbose, FILE *mbfp, int swap, void *data_ptr, int *error);
-
-static char rcs_id[]="$Id: mbr_cbat8101.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mbr_register_cbat8101(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_register_cbat8101";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* get mb_io_ptr */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set format info parameters */
-	status = mbr_info_cbat8101(verbose,
-			&mb_io_ptr->system,
-			&mb_io_ptr->beams_bath_max,
-			&mb_io_ptr->beams_amp_max,
-			&mb_io_ptr->pixels_ss_max,
-			mb_io_ptr->format_name,
-			mb_io_ptr->system_name,
-			mb_io_ptr->format_description,
-			&mb_io_ptr->numfile,
-			&mb_io_ptr->filetype,
-			&mb_io_ptr->variable_beams,
-			&mb_io_ptr->traveltime,
-			&mb_io_ptr->beam_flagging,
-			&mb_io_ptr->nav_source,
-			&mb_io_ptr->heading_source,
-			&mb_io_ptr->vru_source,
-			&mb_io_ptr->svp_source,
-			&mb_io_ptr->beamwidth_xtrack,
-			&mb_io_ptr->beamwidth_ltrack,
-			error);
-
-	/* set format and system specific function pointers */
-	mb_io_ptr->mb_io_format_alloc = &mbr_alm_cbat8101;
-	mb_io_ptr->mb_io_format_free = &mbr_dem_cbat8101;
-	mb_io_ptr->mb_io_store_alloc = &mbsys_reson_alloc;
-	mb_io_ptr->mb_io_store_free = &mbsys_reson_deall;
-	mb_io_ptr->mb_io_read_ping = &mbr_rt_cbat8101;
-	mb_io_ptr->mb_io_write_ping = &mbr_wt_cbat8101;
-	mb_io_ptr->mb_io_dimensions = &mbsys_reson_dimensions;
-	mb_io_ptr->mb_io_extract = &mbsys_reson_extract;
-	mb_io_ptr->mb_io_insert = &mbsys_reson_insert;
-	mb_io_ptr->mb_io_extract_nav = &mbsys_reson_extract_nav;
-	mb_io_ptr->mb_io_insert_nav = &mbsys_reson_insert_nav;
-	mb_io_ptr->mb_io_extract_altitude = &mbsys_reson_extract_altitude;
-	mb_io_ptr->mb_io_insert_altitude = NULL;
-	mb_io_ptr->mb_io_extract_svp = &mbsys_reson_extract_svp;
-	mb_io_ptr->mb_io_insert_svp = &mbsys_reson_insert_svp;
-	mb_io_ptr->mb_io_ttimes = &mbsys_reson_ttimes;
-	mb_io_ptr->mb_io_detects = &mbsys_reson_detects;
-	mb_io_ptr->mb_io_copyrecord = &mbsys_reson_copy;
-	mb_io_ptr->mb_io_extract_rawss = NULL;
-	mb_io_ptr->mb_io_insert_rawss = NULL;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",mb_io_ptr->system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",mb_io_ptr->beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",mb_io_ptr->beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",mb_io_ptr->pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",mb_io_ptr->format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",mb_io_ptr->system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",mb_io_ptr->format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",mb_io_ptr->numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",mb_io_ptr->filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",mb_io_ptr->variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",mb_io_ptr->traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",mb_io_ptr->beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",mb_io_ptr->nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",mb_io_ptr->heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",mb_io_ptr->vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",mb_io_ptr->svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",mb_io_ptr->beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",mb_io_ptr->beamwidth_ltrack);
-		fprintf(stderr,"dbg2       format_alloc:       %p\n",(void *)mb_io_ptr->mb_io_format_alloc);
-		fprintf(stderr,"dbg2       format_free:        %p\n",(void *)mb_io_ptr->mb_io_format_free);
-		fprintf(stderr,"dbg2       store_alloc:        %p\n",(void *)mb_io_ptr->mb_io_store_alloc);
-		fprintf(stderr,"dbg2       store_free:         %p\n",(void *)mb_io_ptr->mb_io_store_free);
-		fprintf(stderr,"dbg2       read_ping:          %p\n",(void *)mb_io_ptr->mb_io_read_ping);
-		fprintf(stderr,"dbg2       write_ping:         %p\n",(void *)mb_io_ptr->mb_io_write_ping);
-		fprintf(stderr,"dbg2       extract:            %p\n",(void *)mb_io_ptr->mb_io_extract);
-		fprintf(stderr,"dbg2       insert:             %p\n",(void *)mb_io_ptr->mb_io_insert);
-		fprintf(stderr,"dbg2       extract_nav:        %p\n",(void *)mb_io_ptr->mb_io_extract_nav);
-		fprintf(stderr,"dbg2       insert_nav:         %p\n",(void *)mb_io_ptr->mb_io_insert_nav);
-		fprintf(stderr,"dbg2       extract_altitude:   %p\n",(void *)mb_io_ptr->mb_io_extract_altitude);
-		fprintf(stderr,"dbg2       insert_altitude:    %p\n",(void *)mb_io_ptr->mb_io_insert_altitude);
-		fprintf(stderr,"dbg2       extract_svp:        %p\n",(void *)mb_io_ptr->mb_io_extract_svp);
-		fprintf(stderr,"dbg2       insert_svp:         %p\n",(void *)mb_io_ptr->mb_io_insert_svp);
-		fprintf(stderr,"dbg2       ttimes:             %p\n",(void *)mb_io_ptr->mb_io_ttimes);
-		fprintf(stderr,"dbg2       detects:            %p\n",(void *)mb_io_ptr->mb_io_detects);
-		fprintf(stderr,"dbg2       extract_rawss:      %p\n",(void *)mb_io_ptr->mb_io_extract_rawss);
-		fprintf(stderr,"dbg2       insert_rawss:       %p\n",(void *)mb_io_ptr->mb_io_insert_rawss);
-		fprintf(stderr,"dbg2       copyrecord:         %p\n",(void *)mb_io_ptr->mb_io_copyrecord);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbr_info_cbat8101(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error)
-{
-	char	*function_name = "mbr_info_cbat8101";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* set format info parameters */
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-	*system = MB_SYS_RESON;
-	*beams_bath_max = 101;
-	*beams_amp_max = 101;
-	*pixels_ss_max = 0;
-	strncpy(format_name, "CBAT8101", MB_NAME_LENGTH);
-	strncpy(system_name, "RESON", MB_NAME_LENGTH);
-	strncpy(format_description, "Format name:          MBF_CBAT8101\nInformal Description: Reson SeaBat 8101 shallow water multibeam\nAttributes:           101 beam bathymetry and amplitude,\n                      binary, SeaBeam Instruments.\n", MB_DESCRIPTION_LENGTH);
-	*numfile = 1;
-	*filetype = MB_FILETYPE_NORMAL;
-	*variable_beams = MB_NO;
-	*traveltime = MB_YES;
-	*beam_flagging = MB_YES;
-	*nav_source = MB_DATA_NAV;
-	*heading_source = MB_DATA_DATA;
-	*vru_source = MB_DATA_DATA;
-	*svp_source = MB_DATA_VELOCITY_PROFILE;
-	*beamwidth_xtrack = 2.0;
-	*beamwidth_ltrack = 2.0;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",*system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",*beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",*beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",*pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",*numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",*filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",*variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",*traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",*beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",*nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",*heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",*vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",*svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",*beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",*beamwidth_ltrack);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_alm_cbat8101(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_alm_cbat8101";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set initial status */
-	status = MB_SUCCESS;
-
-	/* allocate memory for data structure */
-	mb_io_ptr->structure_size = sizeof(struct mbf_cbat8101_struct);
-	mb_io_ptr->data_structure_size = 0;
-	status = mb_mallocd(verbose,__FILE__,__LINE__,mb_io_ptr->structure_size,
-				(void **)&mb_io_ptr->raw_data,error);
-	status = mb_mallocd(verbose,__FILE__,__LINE__,sizeof(struct mbsys_reson_struct),
-				(void **)&mb_io_ptr->store_data,error);
-
-	/* initialize everything to zeros */
-	mbr_zero_cbat8101(verbose,mb_io_ptr->raw_data,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_dem_cbat8101(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_dem_cbat8101";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointers to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* deallocate memory for data descriptor */
-	status = mb_freed(verbose,__FILE__, __LINE__,&mb_io_ptr->raw_data,error);
-	status = mb_freed(verbose,__FILE__, __LINE__,&mb_io_ptr->store_data,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_zero_cbat8101(int verbose, void *data_ptr, int *error)
-{
-	char	*function_name = "mbr_zero_cbat8101";
-	int	status = MB_SUCCESS;
-	struct mbf_cbat8101_struct *data;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       data_ptr:   %p\n",(void *)data_ptr);
-		}
-
-	/* get pointer to data descriptor */
-	data = (struct mbf_cbat8101_struct *) data_ptr;
-
-	/* initialize everything to zeros */
-	if (data != NULL)
-		{
-		data->kind = MB_DATA_NONE;
-		data->sonar = MBSYS_RESON_SEABAT8101;
-		data->par_year = 0;
-		data->par_month = 0;
-		data->par_day = 0;
-		data->par_hour = 0;
-		data->par_minute = 0;
-		data->par_second = 0;
-		data->par_hundredth_sec = 0;
-		data->par_thousandth_sec = 0;
-		data->roll_offset = 0;	/* roll offset (degrees) */
-		data->pitch_offset = 0;	/* pitch offset (degrees) */
-		data->heading_offset = 0;	/* heading offset (degrees) */
-		data->time_delay = 0;		/* positioning system
-							delay (sec) */
-		data->transducer_depth = 0;	/* tranducer depth (meters) */
-		data->transducer_height = 0;	/* reference height (meters) */
-		data->transducer_x = 0;	/* reference athwartships
-							offset (meters) */
-		data->transducer_y = 0;	/* reference  fore-aft
-							offset (meters) */
-		data->antenna_x = 0;		/* antenna athwartships
-							offset (meters) */
-		data->antenna_y = 0;		/* antenna fore-aft
-							offset (meters) */
-		data->antenna_z = 0;		/* antenna height (meters) */
-		data->motion_sensor_x = 0;	/* motion sensor athwartships
-							offset (meters) */
-		data->motion_sensor_y = 0;	/* motion sensor fore-aft
-							offset (meters) */
-		data->motion_sensor_z = 0;	/* motion sensor height
-							offset (meters) */
-		data->spare = 0;
-		data->line_number = 0;
-		data->start_or_stop = 0;
-		data->transducer_serial_number = 0;
-		for (i=0;i<MBF_CBAT8101_COMMENT_LENGTH;i++)
-			data->comment[i] = '\0';
-
-		/* position (position telegrams) */
-		data->pos_year = 0;
-		data->pos_month = 0;
-		data->pos_day = 0;
-		data->pos_hour = 0;
-		data->pos_minute = 0;
-		data->pos_second = 0;
-		data->par_hundredth_sec = 0;
-		data->pos_thousandth_sec = 0;
-		data->pos_latitude = 0;
-		data->pos_longitude = 0;
-		data->utm_northing = 0;
-		data->utm_easting = 0;
-		data->utm_zone_lon = 0;
-		data->utm_zone = 0;
-		data->hemisphere = 0;
-		data->ellipsoid = 0;
-		data->pos_spare = 0;
-		data->semi_major_axis = 0;
-		data->other_quality = 0;
-
-		/* sound velocity profile */
-		data->svp_year = 0;
-		data->svp_month = 0;
-		data->svp_day = 0;
-		data->svp_hour = 0;
-		data->svp_minute = 0;
-		data->svp_second = 0;
-		data->svp_hundredth_sec = 0;
-		data->svp_thousandth_sec = 0;
-		data->svp_num = 0;
-		for (i=0;i<100;i++)
-			{
-			data->svp_depth[i] = 0; /* 0.1 meters */
-			data->svp_vel[i] = 0;	/* 0.1 meters/sec */
-			}
-
-		/* time stamp */
-		data->year = 0;
-		data->month = 0;
-		data->day = 0;
-		data->hour = 0;
-		data->minute = 0;
-		data->second = 0;
-		data->hundredth_sec = 0;
-		data->thousandth_sec = 0;
-		data->roll = 0;
-		data->pitch = 0;
-		data->heading = 0;
-		data->heave = 0;
-		data->ping_number = 0;
-		data->sound_vel = 0;
-		data->mode = 0;
-		data->gain1 = 0;
-		data->gain2 = 0;
-		data->gain3 = 0;
-		data->beams_bath = MBF_CBAT8101_MAXBEAMS;
-		for (i=0;i<MBF_CBAT8101_MAXBEAMS;i++)
-			{
-			data->bath[i] = 0;
-			data->bath_acrosstrack[i] = 0;
-			data->bath_alongtrack[i] = 0;
-			data->tt[i] = 0;
-			data->angle[i] = 0;
-			data->quality[i] = 0;
-			data->amp[i] = 0;
-			}
-		}
-
-	/* assume success */
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_rt_cbat8101(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_rt_cbat8101";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_cbat8101_struct *data;
-	struct mbsys_reson_struct *store;
-	int	time_i[7];
-	double	time_d;
-	double	lon, lat, heading, speed;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointers to mbio descriptor and data structures */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-	data = (struct mbf_cbat8101_struct *) mb_io_ptr->raw_data;
-	store = (struct mbsys_reson_struct *) store_ptr;
-
-	/* read next data from file */
-	status = mbr_cbat8101_rd_data(verbose,mbio_ptr,error);
-
-	/* set error and kind in mb_io_ptr */
-	mb_io_ptr->new_error = *error;
-	mb_io_ptr->new_kind = data->kind;
-
-	/* add nav records to list for interpolation */
-	if (status == MB_SUCCESS
-		&& data->kind == MB_DATA_NAV)
-		{
-		mb_fix_y2k(verbose, data->pos_year,&time_i[0]);
-		time_i[1] = data->pos_month;
-		time_i[2] = data->pos_day;
-		time_i[3] = data->pos_hour;
-		time_i[4] = data->pos_minute;
-		time_i[5] = data->pos_second;
-		time_i[6] = 10000*data->pos_hundredth_sec
-			+ 100*data->pos_thousandth_sec;
-		mb_get_time(verbose,time_i, &time_d);
-		lon = data->pos_longitude*0.00000009;
-		lat = data->pos_latitude*0.00000009;
-		mb_navint_add(verbose, mbio_ptr, time_d, lon, lat, error);
-		}
-
-	/* interpolate navigation for survey pings if needed */
-	if (status == MB_SUCCESS
-		&& data->kind == MB_DATA_DATA
-		&& data->longitude == 0
-		&& data->latitude == 0
-		&& mb_io_ptr->nfix >= 1)
-		{
-		mb_fix_y2k(verbose, data->year,&time_i[0]);
-		time_i[1] = data->month;
-		time_i[2] = data->day;
-		time_i[3] = data->hour;
-		time_i[4] = data->minute;
-		time_i[5] = data->second;
-		time_i[6] = 10000*data->hundredth_sec
-			+ 100*data->thousandth_sec;
-		mb_get_time(verbose,time_i, &time_d);
-		heading = 0.01 * data->heading;
-		mb_navint_interp(verbose, mbio_ptr, time_d, heading, 0.0,
-				    &lon, &lat, &speed, error);
-		data->longitude = (int) (lon / 0.00000009);
-		data->latitude = (int) (lat / 0.00000009);
-		}
-
-	/* translate values to reson data storage structure */
-	if (status == MB_SUCCESS
-		&& store != NULL)
-		{
-		store->kind = data->kind;
-		store->sonar = data->sonar;
-
-		/* parameter telegram */
-		store->par_year = data->par_year;
-		store->par_month = data->par_month;
-		store->par_day = data->par_day;
-		store->par_hour = data->par_hour;
-		store->par_minute = data->par_minute;
-		store->par_second = data->par_second;
-		store->par_hundredth_sec = data->par_hundredth_sec;
-		store->par_thousandth_sec = data->par_thousandth_sec;
-		store->roll_offset = data->roll_offset;
-		store->pitch_offset = data->pitch_offset;
-		store->heading_offset = data->heading_offset;
-		store->time_delay = data->time_delay;
-		store->transducer_depth = data->transducer_depth;
-		store->transducer_height = data->transducer_height;
-		store->transducer_x = data->transducer_x;
-		store->transducer_y = data->transducer_y;
-		store->antenna_x = data->antenna_x;
-		store->antenna_y = data->antenna_y;
-		store->antenna_z = data->antenna_z;
-		store->motion_sensor_x = data->motion_sensor_x;
-		store->motion_sensor_y = data->motion_sensor_y;
-		store->motion_sensor_z = data->motion_sensor_z;
-		store->spare = data->spare;
-		store->line_number = data->line_number;
-		store->start_or_stop = data->start_or_stop;
-		store->transducer_serial_number
-			= data->transducer_serial_number;
-		for (i=0;i<MBSYS_RESON_COMMENT_LENGTH;i++)
-			store->comment[i] = data->comment[i];
-
-		/* position (position telegrams) */
-		store->pos_year = data->pos_year;
-		store->pos_month = data->pos_month;
-		store->pos_day = data->pos_day;
-		store->pos_hour = data->pos_hour;
-		store->pos_minute = data->pos_minute;
-		store->pos_second = data->pos_second;
-		store->pos_hundredth_sec = data->pos_hundredth_sec;
-		store->pos_thousandth_sec = data->pos_thousandth_sec;
-		store->pos_latitude = data->pos_latitude;
-		store->pos_longitude = data->pos_longitude;
-		store->utm_northing = data->utm_northing;
-		store->utm_easting = data->utm_easting;
-		store->utm_zone_lon = data->utm_zone_lon;
-		store->utm_zone = data->utm_zone;
-		store->hemisphere = data->hemisphere;
-		store->ellipsoid = data->ellipsoid;
-		store->pos_spare = data->pos_spare;
-		store->semi_major_axis = data->semi_major_axis;
-		store->other_quality = data->other_quality;
-
-		/* sound velocity profile */
-		store->svp_year = data->svp_year;
-		store->svp_month = data->svp_month;
-		store->svp_day = data->svp_day;
-		store->svp_hour = data->svp_hour;
-		store->svp_minute = data->svp_minute;
-		store->svp_second = data->svp_second;
-		store->svp_hundredth_sec = data->svp_hundredth_sec;
-		store->svp_thousandth_sec = data->svp_thousandth_sec;
-		store->svp_num = data->svp_num;
-		for (i=0;i<500;i++)
-			{
-			store->svp_depth[i] = data->svp_depth[i];
-			store->svp_vel[i] = data->svp_vel[i];
-			}
-
-		/* bathymetry */
-		store->year = data->year;
-		store->month = data->month;
-		store->day = data->day;
-		store->hour = data->hour;
-		store->minute = data->minute;
-		store->second = data->second;
-		store->hundredth_sec = data->hundredth_sec;
-		store->thousandth_sec = data->thousandth_sec;
-		store->longitude = data->longitude;
-		store->latitude = data->latitude;
-		store->roll = data->roll;
-		store->pitch = data->pitch;
-		store->heading = data->heading;
-		store->heave = data->heave;
-		store->ping_number = data->ping_number;
-		store->sound_vel = data->sound_vel;
-		store->mode = data->mode;
-		store->gain1 = data->gain1;
-		store->gain2 = data->gain2;
-		store->gain3 = data->gain3;
-		store->beams_bath = data->beams_bath;
-		for (i=0;i<store->beams_bath;i++)
-			{
-			store->bath[i] = data->bath[i];
-			store->bath_acrosstrack[i] = data->bath_acrosstrack[i];
-			store->bath_alongtrack[i] = data->bath_alongtrack[i];
-			store->tt[i] = data->tt[i];
-			store->angle[i] = data->angle[i];
-			store->quality[i] = data->quality[i];
-			store->amp[i] = data->amp[i];
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_wt_cbat8101(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_wt_cbat8101";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_cbat8101_struct *data;
-	char	*data_ptr;
-	struct mbsys_reson_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_cbat8101_struct *) mb_io_ptr->raw_data;
-	data_ptr = (char *) data;
-	store = (struct mbsys_reson_struct *) store_ptr;
-
-	/* first translate values from data storage structure */
-	if (store != NULL)
-		{
-		data->kind = store->kind;
-		data->sonar = store->sonar;
-
-		/* parameter telegram */
-		data->par_year = store->par_year;
-		data->par_month = store->par_month;
-		data->par_day = store->par_day;
-		data->par_hour = store->par_hour;
-		data->par_minute = store->par_minute;
-		data->par_second = store->par_second;
-		data->par_hundredth_sec = store->par_hundredth_sec;
-		data->par_thousandth_sec = store->par_thousandth_sec;
-		data->roll_offset = store->roll_offset;
-		data->pitch_offset = store->pitch_offset;
-		data->heading_offset = store->heading_offset;
-		data->time_delay = store->time_delay;
-		data->transducer_depth = store->transducer_depth;
-		data->transducer_height = store->transducer_height;
-		data->transducer_x = store->transducer_x;
-		data->transducer_y = store->transducer_y;
-		data->antenna_x = store->antenna_x;
-		data->antenna_y = store->antenna_y;
-		data->antenna_z = store->antenna_z;
-		data->motion_sensor_x = store->motion_sensor_x;
-		data->motion_sensor_y = store->motion_sensor_y;
-		data->motion_sensor_z = store->motion_sensor_z;
-		data->spare = store->spare;
-		data->line_number = store->line_number;
-		data->start_or_stop = store->start_or_stop;
-		data->transducer_serial_number
-			= store->transducer_serial_number;
-		for (i=0;i<MBF_CBAT8101_COMMENT_LENGTH;i++)
-			data->comment[i] = store->comment[i];
-
-		/* position (position telegrams) */
-		data->pos_year = store->pos_year;
-		data->pos_month = store->pos_month;
-		data->pos_day = store->pos_day;
-		data->pos_hour = store->pos_hour;
-		data->pos_minute = store->pos_minute;
-		data->pos_second = store->pos_second;
-		data->pos_hundredth_sec = store->pos_hundredth_sec;
-		data->pos_thousandth_sec = store->pos_thousandth_sec;
-		data->pos_latitude = store->pos_latitude;
-		data->pos_longitude = store->pos_longitude;
-		data->utm_northing = store->utm_northing;
-		data->utm_easting = store->utm_easting;
-		data->utm_zone_lon = store->utm_zone_lon;
-		data->utm_zone = store->utm_zone;
-		data->hemisphere = store->hemisphere;
-		data->ellipsoid = store->ellipsoid;
-		data->pos_spare = store->pos_spare;
-		data->semi_major_axis = store->semi_major_axis;
-		data->other_quality = store->other_quality;
-
-		/* sound velocity profile */
-		data->svp_year = store->svp_year;
-		data->svp_month = store->svp_month;
-		data->svp_day = store->svp_day;
-		data->svp_hour = store->svp_hour;
-		data->svp_minute = store->svp_minute;
-		data->svp_second = store->svp_second;
-		data->svp_hundredth_sec = store->svp_hundredth_sec;
-		data->svp_thousandth_sec = store->svp_thousandth_sec;
-		data->svp_num = store->svp_num;
-		for (i=0;i<500;i++)
-			{
-			data->svp_depth[i] = store->svp_depth[i];
-			data->svp_vel[i] = store->svp_vel[i];
-			}
-
-		/* bathymetry */
-		data->year = store->year;
-		data->month = store->month;
-		data->day = store->day;
-		data->hour = store->hour;
-		data->minute = store->minute;
-		data->second = store->second;
-		data->hundredth_sec = store->hundredth_sec;
-		data->thousandth_sec = store->thousandth_sec;
-		data->longitude = store->longitude;
-		data->latitude = store->latitude;
-		data->roll = store->roll;
-		data->pitch = store->pitch;
-		data->heading = store->heading;
-		data->heave = store->heave;
-		data->ping_number = store->ping_number;
-		data->sound_vel = store->sound_vel;
-		data->mode = store->mode;
-		data->gain1 = store->gain1;
-		data->gain2 = store->gain2;
-		data->gain3 = store->gain3;
-		data->beams_bath = store->beams_bath;
-		for (i=0;i<data->beams_bath;i++)
-			{
-			data->bath[i] = store->bath[i];
-			data->bath_acrosstrack[i]
-			    = store->bath_acrosstrack[i];
-			data->bath_alongtrack[i]
-			    = store->bath_alongtrack[i];
-			data->tt[i] = store->tt[i];
-			data->angle[i] = store->angle[i];
-			data->quality[i] = store->quality[i];
-			data->amp[i] = store->amp[i];
-			}
-		}
-
-	/* write next data to file */
-	status = mbr_cbat8101_wr_data(verbose,mbio_ptr,data_ptr,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_cbat8101_rd_data(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_cbat8101_rd_data";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_cbat8101_struct *data;
-	char	*data_ptr;
-	FILE	*mbfp;
-	int	done;
-	int	first;
-	short *type;
-	char label[2];
-	char label_save[2];
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_cbat8101_struct *) mb_io_ptr->raw_data;
-	data_ptr = (char *) data;
-	mbfp = mb_io_ptr->mbfp;
-
-	/* set file position */
-	mb_io_ptr->file_pos = mb_io_ptr->file_bytes;
-
-	done = MB_NO;
-	type = (short *) label;
-	first = MB_YES;
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-	while (done == MB_NO)
-		{
-		if (mb_io_ptr->byteswapped == MB_NO)
-			{
-			/* get first part of next record label */
-			if ((status = fread(&label[0],1,1,mb_io_ptr->mbfp)) != 1)
-				{
-				status = MB_FAILURE;
-				*error = MB_ERROR_EOF;
-				}
-
-			/* if first part is good read second part */
-			if (status == MB_SUCCESS && label[0] == 0x02)
-				{
-				if ((status = fread(&label[1],1,1,mb_io_ptr->mbfp)) != 1)
-					{
-					status = MB_FAILURE;
-					*error = MB_ERROR_EOF;
-					}
-				}
-			}
-		else
-			{
-			/* byteswapped case */
-			/* get second part of next record label */
-			if ((status = fread(&label[1],1,1,mb_io_ptr->mbfp)) != 1)
-				{
-				status = MB_FAILURE;
-				*error = MB_ERROR_EOF;
-				}
-
-			/* if not first and second part looks like first
-				get other piece from last label */
-			if (status == MB_SUCCESS && first == MB_NO
-				&& label[1] == 0x02)
-				{
-				label[0] = label[1];
-				label[1] = label_save[0];
-				}
-
-			/* else get first part of next record label */
-			else if (status == MB_SUCCESS)
-				{
-				if ((status = fread(&label[0],1,1,mb_io_ptr->mbfp)) != 1)
-					{
-					status = MB_FAILURE;
-					*error = MB_ERROR_EOF;
-					}
-				}
-
-			/* save label */
-			label_save[0] = label[0];
-			label_save[1] = label[1];
-			}
-
-		/* reset first flag */
-		first = MB_NO;
-
-/*		fprintf(stderr,"\nstart of mbr_cbat8101_rd_data loop:\n");
-		fprintf(stderr,"done:%d\n",done);
-		fprintf(stderr,"type:%x\n",*type);
-		fprintf(stderr,"comment:   %x\n",RESON_COMMENT);
-		fprintf(stderr,"nav:       %x\n",RESON_NAV);
-		fprintf(stderr,"parameter: %x\n",RESON_PARAMETER);
-		fprintf(stderr,"svp:       %x\n",RESON_SVP);
-		fprintf(stderr,"bath:      %x\n",RESON_BATH_8101);
-		fprintf(stderr,"short svp: %x\n",RESON_SHORT_SVP);
-		fprintf(stderr,"status:%d\n",status);*/
-
-		/* read the appropriate data records */
-		if (status == MB_FAILURE)
-			{
-			done = MB_YES;
-			}
-		else if (*type == RESON_COMMENT)
-			{
-			status = mbr_cbat8101_rd_comment(
-				verbose,mbfp,mb_io_ptr->byteswapped,data,error);
-			if (status == MB_SUCCESS)
-				{
-				done = MB_YES;
-				data->kind = MB_DATA_COMMENT;
-				}
-			}
-		else if (*type == RESON_PARAMETER)
-			{
-			status = mbr_cbat8101_rd_parameter(
-				verbose,mbfp,mb_io_ptr->byteswapped,data,error);
-			if (status == MB_SUCCESS)
-				{
-				done = MB_YES;
-				data->kind = MB_DATA_PARAMETER;
-				}
-			}
-		else if (*type == RESON_NAV)
-			{
-			status = mbr_cbat8101_rd_nav(
-				verbose,mbfp,mb_io_ptr->byteswapped,data,error);
-			if (status == MB_SUCCESS)
-				{
-				done = MB_YES;
-				data->kind = MB_DATA_NAV;
-				}
-			}
-		else if (*type == RESON_SVP)
-			{
-			status = mbr_cbat8101_rd_svp(
-				verbose,mbfp,mb_io_ptr->byteswapped,data,error);
-			if (status == MB_SUCCESS)
-				{
-				done = MB_YES;
-				data->kind = MB_DATA_VELOCITY_PROFILE;
-				}
-			}
-		else if (*type == RESON_BATH_8101)
-			{
-			status = mbr_cbat8101_rd_bath(
-				verbose,mbfp,mb_io_ptr->byteswapped,data,error);
-			if (status == MB_SUCCESS)
-				{
-				done = MB_YES;
-				data->kind = MB_DATA_DATA;
-				}
-			}
-		else if (*type == RESON_SHORT_SVP)
-			{
-			status = mbr_cbat8101_rd_short_svp(
-				verbose,mbfp,mb_io_ptr->byteswapped,data,error);
-			if (status == MB_SUCCESS)
-				{
-				done = MB_YES;
-				data->kind = MB_DATA_VELOCITY_PROFILE;
-				}
-			}
-		else if (*type == RESON_HEADING)
-			{
-			status = mbr_cbat8101_rd_heading(
-				verbose,mbfp,mb_io_ptr->byteswapped,data,error);
-			if (status == MB_SUCCESS)
-				{
-				done = MB_YES;
-				data->kind = MB_DATA_HEADING;
-				}
-			}
-		else if (*type == RESON_ATTITUDE)
-			{
-			status = mbr_cbat8101_rd_attitude(
-				verbose,mbfp,mb_io_ptr->byteswapped,data,error);
-			if (status == MB_SUCCESS)
-				{
-				done = MB_YES;
-				data->kind = MB_DATA_ATTITUDE;
-				}
-			}
-
-		/* bail out if there is an error */
-		if (status == MB_FAILURE)
-			done = MB_YES;
-
-/*		fprintf(stderr,"end of mbr_cbat8101_rd_data loop:\n");
-		fprintf(stderr,"done:%d\n",done);
-		fprintf(stderr,"type:%x\n",*type);*/
-		}
-
-	/* get file position */
-	mb_io_ptr->file_bytes = ftell(mbfp);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_cbat8101_rd_comment(int verbose, FILE *mbfp, int swap,
-		struct mbf_cbat8101_struct *data, int *error)
-{
-	char	*function_name = "mbr_cbat8101_rd_comment";
-	int	status = MB_SUCCESS;
-	char	line[RESON_COMMENT_SIZE+3];
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       data:       %p\n",(void *)data);
-		}
-
-	/* read record into char array */
-	status = fread(line,1,RESON_COMMENT_SIZE+3,mbfp);
-	if (status == RESON_COMMENT_SIZE+3)
-		status = MB_SUCCESS;
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	/* get data */
-	if (status == MB_SUCCESS)
-		{
-		data->kind = MB_DATA_COMMENT;
-		strncpy(data->comment,line,MBF_CBAT8101_COMMENT_LENGTH-1);
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       comment:          %s\n",data->comment);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_cbat8101_rd_parameter(int verbose, FILE *mbfp, int swap,
-		struct mbf_cbat8101_struct *data, int *error)
-{
-	char	*function_name = "mbr_cbat8101_rd_parameter";
-	int	status = MB_SUCCESS;
-	char	line[RESON_PARAMETER_SIZE+3];
-	short *short_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       data:       %p\n",(void *)data);
-		}
-
-	/* read record into char array */
-	status = fread(line,1,RESON_PARAMETER_SIZE+3,mbfp);
-	if (status == RESON_PARAMETER_SIZE+3)
-		status = MB_SUCCESS;
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	/* get data */
-	if (status == MB_SUCCESS)
-		{
-		data->kind = MB_DATA_PARAMETER;
-		data->par_day =            (int) line[0];
-		data->par_month =          (int) line[1];
-		data->par_year =           (int) line[2];
-		data->par_hour =           (int) line[3];
-		data->par_minute =         (int) line[4];
-		data->par_second =         (int) line[5];
-		data->par_hundredth_sec =  (int) line[6];
-		data->par_thousandth_sec = (int) line[7];
-		if (swap == MB_NO)
-			{
-			short_ptr = (short *) &line[8];
-			data->roll_offset = *short_ptr;
-			short_ptr = (short *) &line[10];
-			data->pitch_offset = *short_ptr;
-			short_ptr = (short *) &line[12];
-			data->heading_offset = *short_ptr;
-			short_ptr = (short *) &line[14];
-			data->time_delay = *short_ptr;
-			short_ptr = (short *) &line[16];
-			data->transducer_depth = *short_ptr;
-			short_ptr = (short *) &line[18];
-			data->transducer_height = *short_ptr;
-			short_ptr = (short *) &line[20];
-			data->transducer_x = *short_ptr;
-			short_ptr = (short *) &line[22];
-			data->transducer_y = *short_ptr;
-			short_ptr = (short *) &line[24];
-			data->antenna_z = *short_ptr;
-			short_ptr = (short *) &line[26];
-			data->antenna_x = *short_ptr;
-			short_ptr = (short *) &line[28];
-			data->antenna_y = *short_ptr;
-			short_ptr = (short *) &line[30];
-			data->motion_sensor_x = *short_ptr;
-			short_ptr = (short *) &line[32];
-			data->motion_sensor_y = *short_ptr;
-			short_ptr = (short *) &line[34];
-			data->motion_sensor_z = *short_ptr;
-			short_ptr = (short *) &line[36];
-			data->spare = *short_ptr;
-			short_ptr = (short *) &line[38];
-			data->line_number = *short_ptr;
-			short_ptr = (short *) &line[40];
-			data->start_or_stop = *short_ptr;
-			short_ptr = (short *) &line[42];
-			data->transducer_serial_number = *short_ptr;
-			}
-		else
-			{
-			short_ptr = (short *) &line[8];
-			data->roll_offset = (short) mb_swap_short(*short_ptr);
-			short_ptr = (short *) &line[10];
-			data->pitch_offset = (short) mb_swap_short(*short_ptr);
-			short_ptr = (short *) &line[12];
-			data->heading_offset = (short) mb_swap_short(*short_ptr);
-			short_ptr = (short *) &line[14];
-			data->time_delay = (short) mb_swap_short(*short_ptr);
-			short_ptr = (short *) &line[16];
-			data->transducer_depth = (short) mb_swap_short(*short_ptr);
-			short_ptr = (short *) &line[18];
-			data->transducer_height = (short) mb_swap_short(*short_ptr);
-			short_ptr = (short *) &line[20];
-			data->transducer_x = (short) mb_swap_short(*short_ptr);
-			short_ptr = (short *) &line[22];
-			data->transducer_y = (short) mb_swap_short(*short_ptr);
-			short_ptr = (short *) &line[24];
-			data->antenna_z = (short) mb_swap_short(*short_ptr);
-			short_ptr = (short *) &line[26];
-			data->antenna_x = (short) mb_swap_short(*short_ptr);
-			short_ptr = (short *) &line[28];
-			data->antenna_y = (short) mb_swap_short(*short_ptr);
-			short_ptr = (short *) &line[30];
-			data->motion_sensor_x = (short) mb_swap_short(*short_ptr);
-			short_ptr = (short *) &line[32];
-			data->motion_sensor_y = (short) mb_swap_short(*short_ptr);
-			short_ptr = (short *) &line[34];
-			data->motion_sensor_z = (short) mb_swap_short(*short_ptr);
-			short_ptr = (short *) &line[36];
-			data->spare = (short) mb_swap_short(*short_ptr);
-			short_ptr = (short *) &line[38];
-			data->line_number = (short) mb_swap_short(*short_ptr);
-			short_ptr = (short *) &line[40];
-			data->start_or_stop = (short) mb_swap_short(*short_ptr);
-			short_ptr = (short *) &line[42];
-			data->transducer_serial_number = (short) mb_swap_short(*short_ptr);
-			}
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       year:             %d\n",data->par_year);
-		fprintf(stderr,"dbg5       month:            %d\n",data->par_month);
-		fprintf(stderr,"dbg5       day:              %d\n",data->par_day);
-		fprintf(stderr,"dbg5       hour:             %d\n",data->par_hour);
-		fprintf(stderr,"dbg5       minute:           %d\n",data->par_minute);
-		fprintf(stderr,"dbg5       sec:              %d\n",data->par_second);
-		fprintf(stderr,"dbg5       hundredth_sec:    %d\n",data->par_hundredth_sec);
-		fprintf(stderr,"dbg5       thousandth_sec:   %d\n",data->par_thousandth_sec);
-		fprintf(stderr,"dbg5       roll_offset:      %d\n",data->roll_offset);
-		fprintf(stderr,"dbg5       pitch_offset:     %d\n",data->pitch_offset);
-		fprintf(stderr,"dbg5       heading_offset:   %d\n",data->heading_offset);
-		fprintf(stderr,"dbg5       time_delay:       %d\n",data->time_delay);
-		fprintf(stderr,"dbg5       transducer_depth: %d\n",data->transducer_depth);
-		fprintf(stderr,"dbg5       transducer_height:%d\n",data->transducer_height);
-		fprintf(stderr,"dbg5       transducer_x:     %d\n",data->transducer_x);
-		fprintf(stderr,"dbg5       transducer_y:     %d\n",data->transducer_y);
-		fprintf(stderr,"dbg5       antenna_x:        %d\n",data->antenna_x);
-		fprintf(stderr,"dbg5       antenna_y:        %d\n",data->antenna_y);
-		fprintf(stderr,"dbg5       antenna_z:        %d\n",data->antenna_z);
-		fprintf(stderr,"dbg5       motion_sensor_x:  %d\n",data->motion_sensor_x);
-		fprintf(stderr,"dbg5       motion_sensor_y:  %d\n",data->motion_sensor_y);
-		fprintf(stderr,"dbg5       motion_sensor_z:  %d\n",data->motion_sensor_z);
-		fprintf(stderr,"dbg5       spare:            %d\n",data->spare);
-		fprintf(stderr,"dbg5       line_number:      %d\n",data->line_number);
-		fprintf(stderr,"dbg5       start_or_stop:    %d\n",data->start_or_stop);
-		fprintf(stderr,"dbg5       xducer_serial_num:%d\n",
-				data->transducer_serial_number);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_cbat8101_rd_nav(int verbose, FILE *mbfp, int swap,
-		struct mbf_cbat8101_struct *data, int *error)
-{
-	char	*function_name = "mbr_cbat8101_rd_nav";
-	int	status = MB_SUCCESS;
-	char	line[RESON_NAV_SIZE+3];
-	short *short_ptr;
-	int	*int_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       data:       %p\n",(void *)data);
-		}
-
-	/* read record into char array */
-	status = fread(line,1,RESON_NAV_SIZE+3,mbfp);
-	if (status == RESON_NAV_SIZE+3)
-		status = MB_SUCCESS;
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	/* get data */
-	if (status == MB_SUCCESS)
-		{
-		data->kind = MB_DATA_NAV;
-		data->pos_day =            (int) line[0];
-		data->pos_month =          (int) line[1];
-		data->pos_year =           (int) line[2];
-		data->pos_hour =           (int) line[3];
-		data->pos_minute =         (int) line[4];
-		data->pos_second =         (int) line[5];
-		data->pos_hundredth_sec =  (int) line[6];
-		data->pos_thousandth_sec = (int) line[7];
-		if (swap == MB_NO)
-			{
-			int_ptr = (int *) &line[8];
-			data->pos_latitude = *int_ptr;
-			int_ptr = (int *) &line[12];
-			data->pos_longitude = *int_ptr;
-			int_ptr = (int *) &line[16];
-			data->utm_northing = *int_ptr;
-			int_ptr = (int *) &line[20];
-			data->utm_easting = *int_ptr;
-			int_ptr = (int *) &line[24];
-			data->utm_zone_lon = *int_ptr;
-			data->utm_zone = line[28];
-			data->hemisphere = line[29];
-			data->ellipsoid = line[30];
-			data->pos_spare = line[31];
-			short_ptr = (short *) &line[32];
-			data->semi_major_axis = (int) *short_ptr;
-			short_ptr = (short *) &line[34];
-			data->other_quality = (int) *short_ptr;
-			}
-		else
-			{
-			int_ptr = (int *) &line[8];
-			data->pos_latitude = (int) mb_swap_int(*int_ptr);
-			int_ptr = (int *) &line[12];
-			data->pos_longitude = (int) mb_swap_int(*int_ptr);
-			int_ptr = (int *) &line[16];
-			data->utm_northing = (int) mb_swap_int(*int_ptr);
-			int_ptr = (int *) &line[20];
-			data->utm_easting = (int) mb_swap_int(*int_ptr);
-			int_ptr = (int *) &line[24];
-			data->utm_zone_lon = (int) mb_swap_int(*int_ptr);
-			data->utm_zone = line[28];
-			data->hemisphere = line[29];
-			data->ellipsoid = line[30];
-			data->pos_spare = line[31];
-			short_ptr = (short *) &line[32];
-			data->semi_major_axis = (int) mb_swap_short(*short_ptr);
-			short_ptr = (short *) &line[34];
-			data->other_quality = (int) mb_swap_short(*short_ptr);
-			}
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       year:             %d\n",data->pos_year);
-		fprintf(stderr,"dbg5       month:            %d\n",data->pos_month);
-		fprintf(stderr,"dbg5       day:              %d\n",data->pos_day);
-		fprintf(stderr,"dbg5       hour:             %d\n",data->pos_hour);
-		fprintf(stderr,"dbg5       minute:           %d\n",data->pos_minute);
-		fprintf(stderr,"dbg5       sec:              %d\n",data->pos_second);
-		fprintf(stderr,"dbg5       hundredth_sec:    %d\n",data->pos_hundredth_sec);
-		fprintf(stderr,"dbg5       thousandth_sec:   %d\n",data->pos_thousandth_sec);
-		fprintf(stderr,"dbg5       pos_latitude:     %d\n",data->pos_latitude);
-		fprintf(stderr,"dbg5       pos_longitude:    %d\n",data->pos_longitude);
-		fprintf(stderr,"dbg5       utm_northing:     %d\n",data->utm_northing);
-		fprintf(stderr,"dbg5       utm_easting:      %d\n",data->utm_easting);
-		fprintf(stderr,"dbg5       utm_zone_lon:     %d\n",data->utm_zone_lon);
-		fprintf(stderr,"dbg5       utm_zone:         %c\n",data->utm_zone);
-		fprintf(stderr,"dbg5       hemisphere:       %c\n",data->hemisphere);
-		fprintf(stderr,"dbg5       ellipsoid:        %c\n",data->ellipsoid);
-		fprintf(stderr,"dbg5       pos_spare:        %c\n",data->pos_spare);
-		fprintf(stderr,"dbg5       semi_major_axis:  %d\n",data->semi_major_axis);
-		fprintf(stderr,"dbg5       other_quality:    %d\n",data->other_quality);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_cbat8101_rd_svp(int verbose, FILE *mbfp, int swap,
-		struct mbf_cbat8101_struct *data, int *error)
-{
-	char	*function_name = "mbr_cbat8101_rd_svp";
-	int	status = MB_SUCCESS;
-	char	line[RESON_SVP_SIZE+3];
-	short *short_ptr;
-	short *short_ptr2;
-	int	*int_ptr;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       data:       %p\n",(void *)data);
-		}
-
-	/* read record into char array */
-	status = fread(line,1,RESON_SVP_SIZE+3,mbfp);
-	if (status == RESON_SVP_SIZE+3)
-		status = MB_SUCCESS;
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	/* get data */
-	if (status == MB_SUCCESS)
-		{
-		data->kind = MB_DATA_VELOCITY_PROFILE;
-		data->svp_day =            (int) line[0];
-		data->svp_month =          (int) line[1];
-		data->svp_year =           (int) line[2];
-		data->svp_hour =           (int) line[3];
-		data->svp_minute =         (int) line[4];
-		data->svp_second =         (int) line[5];
-		data->svp_hundredth_sec =  (int) line[6];
-		data->svp_thousandth_sec = (int) line[7];
-		if (swap == MB_NO)
-			{
-			int_ptr = (int *) &line[8];
-			data->svp_latitude = *int_ptr;
-			int_ptr = (int *) &line[12];
-			data->svp_longitude = *int_ptr;
-			}
-		else
-			{
-			int_ptr = (int *) &line[8];
-			data->svp_latitude = (int) mb_swap_int(*int_ptr);
-			int_ptr = (int *) &line[12];
-			data->svp_latitude = (int) mb_swap_int(*int_ptr);
-			}
-		data->svp_num = 0;
-		for (i=0;i<500;i++)
-			{
-			short_ptr = (short *) &line[16+4*i];
-			short_ptr2 = (short *) &line[18+4*i];
-			if (swap == MB_NO)
-				{
-				data->svp_depth[i] = *short_ptr;
-				data->svp_vel[i] = *short_ptr2;
-				}
-			else
-				{
-				data->svp_depth[i] = (short) mb_swap_short(*short_ptr);
-				data->svp_vel[i] = (short) mb_swap_short(*short_ptr2);
-				}
-			if (data->svp_vel[i] > 0) data->svp_num = i + 1;
-			}
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       year:             %d\n",data->svp_year);
-		fprintf(stderr,"dbg5       month:            %d\n",data->svp_month);
-		fprintf(stderr,"dbg5       day:              %d\n",data->svp_day);
-		fprintf(stderr,"dbg5       hour:             %d\n",data->svp_hour);
-		fprintf(stderr,"dbg5       minute:           %d\n",data->svp_minute);
-		fprintf(stderr,"dbg5       sec:              %d\n",data->svp_second);
-		fprintf(stderr,"dbg5       hundredth_sec:    %d\n",data->svp_hundredth_sec);
-		fprintf(stderr,"dbg5       thousandth_sec:   %d\n",data->svp_thousandth_sec);
-		fprintf(stderr,"dbg5       svp_latitude:     %d\n",data->svp_latitude);
-		fprintf(stderr,"dbg5       svp_longitude:    %d\n",data->svp_longitude);
-		fprintf(stderr,"dbg5       svp_num:          %d\n",data->svp_num);
-		for (i=0;i<data->svp_num;i++)
-			fprintf(stderr,"dbg5       depth: %d     vel: %d\n",
-				data->svp_depth[i],data->svp_vel[i]);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_cbat8101_rd_short_svp(int verbose, FILE *mbfp, int swap,
-		struct mbf_cbat8101_struct *data, int *error)
-{
-	char	*function_name = "mbr_cbat8101_rd_svp";
-	int	status = MB_SUCCESS;
-	char	line[RESON_SHORT_SVP_SIZE+3];
-	short *short_ptr;
-	short *short_ptr2;
-	int	*int_ptr;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       data:       %p\n",(void *)data);
-		}
-
-	/* read record into char array */
-	status = fread(line,1,RESON_SHORT_SVP_SIZE+3,mbfp);
-	if (status == RESON_SHORT_SVP_SIZE+3)
-		status = MB_SUCCESS;
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	/* get data */
-	if (status == MB_SUCCESS)
-		{
-		data->kind = MB_DATA_VELOCITY_PROFILE;
-		data->svp_day =            (int) line[0];
-		data->svp_month =          (int) line[1];
-		data->svp_year =           (int) line[2];
-		data->svp_hour =           (int) line[3];
-		data->svp_minute =         (int) line[4];
-		data->svp_second =         (int) line[5];
-		data->svp_hundredth_sec =  (int) line[6];
-		data->svp_thousandth_sec = (int) line[7];
-		if (swap == MB_NO)
-			{
-			int_ptr = (int *) &line[8];
-			data->svp_latitude = *int_ptr;
-			int_ptr = (int *) &line[12];
-			data->svp_longitude = *int_ptr;
-			}
-		else
-			{
-			int_ptr = (int *) &line[8];
-			data->svp_latitude = (int) mb_swap_int(*int_ptr);
-			int_ptr = (int *) &line[12];
-			data->svp_latitude = (int) mb_swap_int(*int_ptr);
-			}
-		data->svp_num = 0;
-		for (i=0;i<200;i++)
-			{
-			short_ptr = (short *) &line[16+4*i];
-			short_ptr2 = (short *) &line[18+4*i];
-			if (swap == MB_NO)
-				{
-				data->svp_depth[i] = *short_ptr;
-				data->svp_vel[i] = *short_ptr2;
-				}
-			else
-				{
-				data->svp_depth[i] = (short) mb_swap_short(*short_ptr);
-				data->svp_vel[i] = (short) mb_swap_short(*short_ptr2);
-				}
-			if (data->svp_vel[i] > 0) data->svp_num = i + 1;
-			}
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       year:             %d\n",data->svp_year);
-		fprintf(stderr,"dbg5       month:            %d\n",data->svp_month);
-		fprintf(stderr,"dbg5       day:              %d\n",data->svp_day);
-		fprintf(stderr,"dbg5       hour:             %d\n",data->svp_hour);
-		fprintf(stderr,"dbg5       minute:           %d\n",data->svp_minute);
-		fprintf(stderr,"dbg5       sec:              %d\n",data->svp_second);
-		fprintf(stderr,"dbg5       hundredth_sec:    %d\n",data->svp_hundredth_sec);
-		fprintf(stderr,"dbg5       thousandth_sec:   %d\n",data->svp_thousandth_sec);
-		fprintf(stderr,"dbg5       svp_latitude:     %d\n",data->svp_latitude);
-		fprintf(stderr,"dbg5       svp_longitude:    %d\n",data->svp_longitude);
-		fprintf(stderr,"dbg5       svp_num:          %d\n",data->svp_num);
-		for (i=0;i<data->svp_num;i++)
-			fprintf(stderr,"dbg5       depth: %d     vel: %d\n",
-				data->svp_depth[i],data->svp_vel[i]);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_cbat8101_rd_bath(int verbose, FILE *mbfp, int swap,
-		struct mbf_cbat8101_struct *data, int *error)
-{
-	char	*function_name = "mbr_cbat8101_rd_bath";
-	int	status = MB_SUCCESS;
-	char	line[RESON_BATH_8101_SIZE+3];
-	char	*beamarray;
-	unsigned char *char_ptr;
-	short *short_ptr;
-	int	*int_ptr;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       data:       %p\n",(void *)data);
-		}
-
-	/* read record into char array */
-	status = fread(line,1,RESON_BATH_8101_SIZE+3,mbfp);
-	if (status == RESON_BATH_8101_SIZE+3)
-		status = MB_SUCCESS;
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	/* get data */
-	if (status == MB_SUCCESS)
-		{
-		data->kind = MB_DATA_DATA;
-		data->day =            (int) line[0];
-		data->month =          (int) line[1];
-		data->year =           (int) line[2];
-		data->hour =           (int) line[3];
-		data->minute =         (int) line[4];
-		data->second =         (int) line[5];
-		data->hundredth_sec =  (int) line[6];
-		data->thousandth_sec = (int) line[7];
-		if (swap == MB_NO)
-			{
-			int_ptr = (int *) &line[8];
-			data->latitude = *int_ptr;
-			int_ptr = (int *) &line[12];
-			data->longitude = *int_ptr;
-			short_ptr = (short *) &line[16];
-			data->roll = (int) *short_ptr;
-			short_ptr = (short *) &line[18];
-			data->pitch = (int) *short_ptr;
-			short_ptr = (short *) &line[20];
-			data->heading = (unsigned short) *short_ptr;
-			short_ptr = (short *) &line[22];
-			data->heave = (int) *short_ptr;
-			short_ptr = (short *) &line[24];
-			data->ping_number = (int) *short_ptr;
-			short_ptr = (short *) &line[26];
-			data->sound_vel = (int) *short_ptr;
-			}
-		else
-			{
-			int_ptr = (int *) &line[8];
-			data->latitude = (int) mb_swap_int(*int_ptr);
-			int_ptr = (int *) &line[12];
-			data->latitude = (int) mb_swap_int(*int_ptr);
-			short_ptr = (short *) &line[16];
-			data->roll = (int) mb_swap_short(*short_ptr);
-			short_ptr = (short *) &line[18];
-			data->pitch = (int) mb_swap_short(*short_ptr);
-			short_ptr = (short *) &line[20];
-			data->heading = (unsigned short) mb_swap_short(*short_ptr);
-			short_ptr = (short *) &line[22];
-			data->heave = (int) mb_swap_short(*short_ptr);
-			short_ptr = (short *) &line[24];
-			data->ping_number = (int) mb_swap_short(*short_ptr);
-			short_ptr = (short *) &line[26];
-			data->sound_vel = (int) mb_swap_short(*short_ptr);
-			}
-		data->mode = (int) line[28];
-		data->gain1 = (int) line[29];
-		data->gain2 = (int) line[30];
-		data->gain3 = (int) line[31];
-		data->beams_bath = MBF_CBAT8101_MAXBEAMS;
-		if (swap == MB_NO)
-			{
-			for (i=0;i<data->beams_bath;i++)
-				{
-				beamarray = line + 32 + 12*i;
-				short_ptr = (short *) beamarray;
-				data->bath[i] = *short_ptr;
-				short_ptr = ((short *) beamarray) + 1;
-				data->bath_acrosstrack[i] = *short_ptr;
-				short_ptr = ((short *) beamarray) + 2;
-				data->bath_alongtrack[i] = *short_ptr;
-				short_ptr = ((short *) beamarray) + 3;
-				data->tt[i] = *short_ptr;
-				short_ptr = ((short *) beamarray) + 4;
-				data->angle[i] = *short_ptr;
-				char_ptr = (unsigned char *) (beamarray + 10);
-				data->quality[i] = (short) *char_ptr;
-				char_ptr = (unsigned char *) (beamarray + 11);
-				data->amp[i] = (short) *char_ptr;
-				}
-			}
-		else
-			{
-			for (i=0;i<data->beams_bath;i++)
-				{
-				beamarray = line + 32 + 12*i;
-				short_ptr = (short *) beamarray;
-				data->bath[i] =
-					(short) mb_swap_short(*short_ptr);
-				short_ptr = ((short *) beamarray) + 1;
-				data->bath_acrosstrack[i] =
-					(short) mb_swap_short(*short_ptr);
-				short_ptr = ((short *) beamarray) + 2;
-				data->bath_alongtrack[i] =
-					(short) mb_swap_short(*short_ptr);
-				short_ptr = ((short *) beamarray) + 3;
-				data->tt[i] = (short) mb_swap_short(*short_ptr);
-				short_ptr = ((short *) beamarray) + 4;
-				data->angle[i] = (short) mb_swap_short(*short_ptr);
-				char_ptr = (unsigned char *) (beamarray + 10);
-				data->quality[i] = (short) *char_ptr;
-				char_ptr = (unsigned char *) (beamarray + 11);
-				data->amp[i] = (short) *char_ptr;
-				}
-			}
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       year:             %d\n",data->year);
-		fprintf(stderr,"dbg5       month:            %d\n",data->month);
-		fprintf(stderr,"dbg5       day:              %d\n",data->day);
-		fprintf(stderr,"dbg5       hour:             %d\n",data->hour);
-		fprintf(stderr,"dbg5       minute:           %d\n",data->minute);
-		fprintf(stderr,"dbg5       sec:              %d\n",data->second);
-		fprintf(stderr,"dbg5       hundredth_sec:    %d\n",data->hundredth_sec);
-		fprintf(stderr,"dbg5       thousandth_sec:   %d\n",data->thousandth_sec);
-		fprintf(stderr,"dbg5       latitude:         %d\n",data->latitude);
-		fprintf(stderr,"dbg5       longitude:        %d\n",data->longitude);
-		fprintf(stderr,"dbg5       roll:             %d\n",data->roll);
-		fprintf(stderr,"dbg5       pitch:            %d\n",data->pitch);
-		fprintf(stderr,"dbg5       heading:          %d\n",data->heading);
-		fprintf(stderr,"dbg5       heave:            %d\n",data->heave);
-		fprintf(stderr,"dbg5       ping_number:      %d\n",data->ping_number);
-		fprintf(stderr,"dbg5       sound_vel:        %d\n",data->sound_vel);
-		fprintf(stderr,"dbg5       mode:             %d\n",data->mode);
-		fprintf(stderr,"dbg5       gain1:            %d\n",data->gain1);
-		fprintf(stderr,"dbg5       gain2:            %d\n",data->gain2);
-		fprintf(stderr,"dbg5       gain3:            %d\n",data->gain3);
-		fprintf(stderr,"dbg5       beams_bath:       %d\n",data->beams_bath);
-		fprintf(stderr,"dbg5       beam bath xtrack ltrack tt amp qual heave\n");
-		for (i=0;i<data->beams_bath;i++)
-			fprintf(stderr,"dbg5       beam:%d  bath:%d  xtrck:%d  ltrck:%d tt:%d  angle:%d amp:%d  qual:%d\n",
-				i,data->bath[i],data->bath_acrosstrack[i],
-				data->bath_alongtrack[i],data->tt[i],
-				data->angle[i],data->amp[i],data->quality[i]);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_cbat8101_rd_heading(int verbose, FILE *mbfp, int swap,
-		struct mbf_cbat8101_struct *data, int *error)
-{
-	char	*function_name = "mbr_cbat8101_rd_heading";
-	int	status = MB_SUCCESS;
-	char	line[RESON_HEADING_SIZE+3];
-	short *short_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       data:       %p\n",(void *)data);
-		}
-
-	/* read record into char array */
-	status = fread(line,1,RESON_HEADING_SIZE+3,mbfp);
-	if (status == RESON_HEADING_SIZE+3)
-		status = MB_SUCCESS;
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	/* get data */
-	if (status == MB_SUCCESS)
-		{
-		data->kind = MB_DATA_HEADING;
-		data->day =            (int) line[0];
-		data->month =          (int) line[1];
-		data->year =           (int) line[2];
-		data->hour =           (int) line[3];
-		data->minute =         (int) line[4];
-		data->second =         (int) line[5];
-		data->hundredth_sec =  (int) line[6];
-		data->thousandth_sec = (int) line[7];
-		if (swap == MB_NO)
-			{
-			short_ptr = (short *) &line[8];
-			data->heading = (int) *short_ptr;
-			}
-		else
-			{
-			short_ptr = (short *) &line[8];
-			data->heading = (int) mb_swap_short(*short_ptr);
-			}
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       year:             %d\n",data->year);
-		fprintf(stderr,"dbg5       month:            %d\n",data->month);
-		fprintf(stderr,"dbg5       day:              %d\n",data->day);
-		fprintf(stderr,"dbg5       hour:             %d\n",data->hour);
-		fprintf(stderr,"dbg5       minute:           %d\n",data->minute);
-		fprintf(stderr,"dbg5       sec:              %d\n",data->second);
-		fprintf(stderr,"dbg5       hundredth_sec:    %d\n",data->hundredth_sec);
-		fprintf(stderr,"dbg5       thousandth_sec:   %d\n",data->thousandth_sec);
-		fprintf(stderr,"dbg5       heading:          %d\n",data->heading);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_cbat8101_rd_attitude(int verbose, FILE *mbfp, int swap,
-		struct mbf_cbat8101_struct *data, int *error)
-{
-	char	*function_name = "mbr_cbat8101_rd_attitude";
-	int	status = MB_SUCCESS;
-	char	line[RESON_ATTITUDE_SIZE+3];
-	short *short_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       data:       %p\n",(void *)data);
-		}
-
-	/* read record into char array */
-	status = fread(line,1,RESON_ATTITUDE_SIZE+3,mbfp);
-	if (status == RESON_ATTITUDE_SIZE+3)
-		status = MB_SUCCESS;
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	/* get data */
-	if (status == MB_SUCCESS)
-		{
-		data->kind = MB_DATA_ATTITUDE;
-		data->day =            (int) line[0];
-		data->month =          (int) line[1];
-		data->year =           (int) line[2];
-		data->hour =           (int) line[3];
-		data->minute =         (int) line[4];
-		data->second =         (int) line[5];
-		data->hundredth_sec =  (int) line[6];
-		data->thousandth_sec = (int) line[7];
-		if (swap == MB_NO)
-			{
-			short_ptr = (short *) &line[8];
-			data->heave = (int) *short_ptr;
-			short_ptr = (short *) &line[10];
-			data->roll = (int) *short_ptr;
-			short_ptr = (short *) &line[12];
-			data->pitch = (int) *short_ptr;
-			}
-		else
-			{
-			short_ptr = (short *) &line[8];
-			data->heave = (int) mb_swap_short(*short_ptr);
-			short_ptr = (short *) &line[10];
-			data->roll = (int) mb_swap_short(*short_ptr);
-			short_ptr = (short *) &line[12];
-			data->pitch = (int) mb_swap_short(*short_ptr);
-			}
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       year:             %d\n",data->year);
-		fprintf(stderr,"dbg5       month:            %d\n",data->month);
-		fprintf(stderr,"dbg5       day:              %d\n",data->day);
-		fprintf(stderr,"dbg5       hour:             %d\n",data->hour);
-		fprintf(stderr,"dbg5       minute:           %d\n",data->minute);
-		fprintf(stderr,"dbg5       sec:              %d\n",data->second);
-		fprintf(stderr,"dbg5       hundredth_sec:    %d\n",data->hundredth_sec);
-		fprintf(stderr,"dbg5       thousandth_sec:   %d\n",data->thousandth_sec);
-		fprintf(stderr,"dbg5       heading:          %d\n",data->heading);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_cbat8101_wr_data(int verbose, void *mbio_ptr, void *data_ptr, int *error)
-{
-	char	*function_name = "mbr_cbat8101_wr_data";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_cbat8101_struct *data;
-	FILE	*mbfp;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       data_ptr:   %p\n",(void *)data_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_cbat8101_struct *) data_ptr;
-	mbfp = mb_io_ptr->mbfp;
-
-	if (data->kind == MB_DATA_COMMENT)
-		{
-		status = mbr_cbat8101_wr_comment(verbose,mbfp,mb_io_ptr->byteswapped,data_ptr,error);
-		}
-	else if (data->kind == MB_DATA_PARAMETER)
-		{
-		status = mbr_cbat8101_wr_parameter(verbose,mbfp,mb_io_ptr->byteswapped,data_ptr,error);
-		}
-	else if (data->kind == MB_DATA_NAV)
-		{
-		status = mbr_cbat8101_wr_nav(verbose,mbfp,mb_io_ptr->byteswapped,data_ptr,error);
-		}
-	else if (data->kind == MB_DATA_VELOCITY_PROFILE)
-		{
-		status = mbr_cbat8101_wr_svp(verbose,mbfp,mb_io_ptr->byteswapped,data_ptr,error);
-		}
-	else if (data->kind == MB_DATA_DATA)
-		{
-		status = mbr_cbat8101_wr_bath(verbose,mbfp,mb_io_ptr->byteswapped,data_ptr,error);
-		}
-	else if (data->kind == MB_DATA_HEADING)
-		{
-		status = mbr_cbat8101_wr_heading(verbose,mbfp,mb_io_ptr->byteswapped,data_ptr,error);
-		}
-	else if (data->kind == MB_DATA_ATTITUDE)
-		{
-		status = mbr_cbat8101_wr_attitude(verbose,mbfp,mb_io_ptr->byteswapped,data_ptr,error);
-		}
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_BAD_KIND;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Data record kind in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       kind:       %d\n",data->kind);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_cbat8101_wr_comment(int verbose, FILE *mbfp, int swap, void *data_ptr, int *error)
-{
-	char	*function_name = "mbr_cbat8101_wr_comment";
-	int	status = MB_SUCCESS;
-	struct mbf_cbat8101_struct *data;
-	char	line[RESON_COMMENT_SIZE+3];
-	short label;
-	int	len;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       data_ptr:   %p\n",(void *)data_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_cbat8101_struct *) data_ptr;
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       comment:          %s\n",data->comment);
-		}
-
-	/* write the record label */
-	label = RESON_COMMENT;
-	if (swap == MB_YES)
-		label = (short) mb_swap_short(label);
-	status = fwrite(&label,1,2,mbfp);
-	if (status != 2)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	else
-		status = MB_SUCCESS;
-
-	/* write out the data */
-	if (status == MB_SUCCESS)
-		{
-		/* construct record */
-		len = strlen(data->comment);
-		if (len > MBF_CBAT8101_COMMENT_LENGTH)
-			len = MBF_CBAT8101_COMMENT_LENGTH;
-		for (i=0;i<len;i++)
-			line[i] = data->comment[i];
-		for (i=len;i<MBF_CBAT8101_COMMENT_LENGTH;i++)
-			line[i] = '\0';
-		line[RESON_COMMENT_SIZE] = 0x03;
-		line[RESON_COMMENT_SIZE+1] = '\0';
-		line[RESON_COMMENT_SIZE+2] = '\0';
-
-		/* write out data */
-		status = fwrite(line,1,RESON_COMMENT_SIZE+3,mbfp);
-		if (status != RESON_COMMENT_SIZE+3)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_cbat8101_wr_parameter(int verbose, FILE *mbfp, int swap, void *data_ptr, int *error)
-{
-	char	*function_name = "mbr_cbat8101_wr_parameter";
-	int	status = MB_SUCCESS;
-	struct mbf_cbat8101_struct *data;
-	char	line[RESON_PARAMETER_SIZE+3];
-	short label;
-	short *short_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       data_ptr:   %p\n",(void *)data_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_cbat8101_struct *) data_ptr;
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       year:             %d\n",data->par_year);
-		fprintf(stderr,"dbg5       month:            %d\n",data->par_month);
-		fprintf(stderr,"dbg5       day:              %d\n",data->par_day);
-		fprintf(stderr,"dbg5       hour:             %d\n",data->par_hour);
-		fprintf(stderr,"dbg5       minute:           %d\n",data->par_minute);
-		fprintf(stderr,"dbg5       sec:              %d\n",data->par_second);
-		fprintf(stderr,"dbg5       hundredth_sec:    %d\n",data->par_hundredth_sec);
-		fprintf(stderr,"dbg5       thousandth_sec:   %d\n",data->par_thousandth_sec);
-		fprintf(stderr,"dbg5       roll_offset:      %d\n",data->roll_offset);
-		fprintf(stderr,"dbg5       pitch_offset:     %d\n",data->pitch_offset);
-		fprintf(stderr,"dbg5       heading_offset:   %d\n",data->heading_offset);
-		fprintf(stderr,"dbg5       time_delay:       %d\n",data->time_delay);
-		fprintf(stderr,"dbg5       transducer_depth: %d\n",data->transducer_depth);
-		fprintf(stderr,"dbg5       transducer_height:%d\n",data->transducer_height);
-		fprintf(stderr,"dbg5       transducer_x:     %d\n",data->transducer_x);
-		fprintf(stderr,"dbg5       transducer_y:     %d\n",data->transducer_y);
-		fprintf(stderr,"dbg5       antenna_x:        %d\n",data->antenna_x);
-		fprintf(stderr,"dbg5       antenna_y:        %d\n",data->antenna_y);
-		fprintf(stderr,"dbg5       antenna_z:        %d\n",data->antenna_z);
-		fprintf(stderr,"dbg5       motion_sensor_x:  %d\n",data->motion_sensor_x);
-		fprintf(stderr,"dbg5       motion_sensor_y:  %d\n",data->motion_sensor_y);
-		fprintf(stderr,"dbg5       motion_sensor_z:  %d\n",data->motion_sensor_z);
-		fprintf(stderr,"dbg5       spare:            %d\n",data->spare);
-		fprintf(stderr,"dbg5       line_number:      %d\n",data->line_number);
-		fprintf(stderr,"dbg5       start_or_stop:    %d\n",data->start_or_stop);
-		fprintf(stderr,"dbg5       xducer_serial_num:%d\n",
-				data->transducer_serial_number);
-		}
-
-	/* write the record label */
-	label = RESON_PARAMETER;
-	if (swap == MB_YES)
-		label = (short) mb_swap_short(label);
-	status = fwrite(&label,1,2,mbfp);
-	if (status != 2)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	else
-		status = MB_SUCCESS;
-
-	/* write out the data */
-	if (status == MB_SUCCESS)
-		{
-		/* construct record */
-		line[0] = (char) data->par_day;
-		line[1] = (char) data->par_month;
-		line[2] = (char) data->par_year;
-		line[3] = (char) data->par_hour;
-		line[4] = (char) data->par_minute;
-		line[5] = (char) data->par_second;
-		line[6] = (char) data->par_hundredth_sec;
-		line[7] = (char) data->par_thousandth_sec;
-		if (swap == MB_NO)
-			{
-			short_ptr = (short *) &line[8];
-			*short_ptr = data->roll_offset;
-			short_ptr = (short *) &line[10];
-			*short_ptr = data->pitch_offset;
-			short_ptr = (short *) &line[12];
-			*short_ptr = data->heading_offset;
-			short_ptr = (short *) &line[14];
-			*short_ptr = data->time_delay;
-			short_ptr = (short *) &line[16];
-			*short_ptr = data->transducer_depth;
-			short_ptr = (short *) &line[18];
-			*short_ptr = data->transducer_height;
-			short_ptr = (short *) &line[20];
-			*short_ptr = data->transducer_x;
-			short_ptr = (short *) &line[22];
-			*short_ptr = data->transducer_y;
-			short_ptr = (short *) &line[24];
-			*short_ptr = data->antenna_z;
-			short_ptr = (short *) &line[26];
-			*short_ptr = data->antenna_x;
-			short_ptr = (short *) &line[28];
-			*short_ptr = data->antenna_y;
-			short_ptr = (short *) &line[30];
-			*short_ptr = data->motion_sensor_x;
-			short_ptr = (short *) &line[32];
-			*short_ptr = data->motion_sensor_y;
-			short_ptr = (short *) &line[34];
-			*short_ptr = data->motion_sensor_z;
-			short_ptr = (short *) &line[36];
-			*short_ptr = data->spare;
-			short_ptr = (short *) &line[38];
-			*short_ptr = data->line_number;
-			short_ptr = (short *) &line[40];
-			*short_ptr = data->start_or_stop;
-			short_ptr = (short *) &line[42];
-			*short_ptr = data->transducer_serial_number;
-			}
-		else
-			{
-			short_ptr = (short *) &line[8];
-			*short_ptr = (short) mb_swap_short(data->roll_offset);
-			short_ptr = (short *) &line[10];
-			*short_ptr = (short) mb_swap_short(data->pitch_offset);
-			short_ptr = (short *) &line[12];
-			*short_ptr = (short) mb_swap_short(data->heading_offset);
-			short_ptr = (short *) &line[14];
-			*short_ptr = (short) mb_swap_short(data->time_delay);
-			short_ptr = (short *) &line[16];
-			*short_ptr = (short) mb_swap_short(data->transducer_depth);
-			short_ptr = (short *) &line[18];
-			*short_ptr = (short) mb_swap_short(data->transducer_height);
-			short_ptr = (short *) &line[20];
-			*short_ptr = (short) mb_swap_short(data->transducer_x);
-			short_ptr = (short *) &line[22];
-			*short_ptr = (short) mb_swap_short(data->transducer_y);
-			short_ptr = (short *) &line[24];
-			*short_ptr = (short) mb_swap_short(data->antenna_z);
-			short_ptr = (short *) &line[26];
-			*short_ptr = (short) mb_swap_short(data->antenna_x);
-			short_ptr = (short *) &line[28];
-			*short_ptr = (short) mb_swap_short(data->antenna_y);
-			short_ptr = (short *) &line[30];
-			*short_ptr = (short) mb_swap_short(data->motion_sensor_x);
-			short_ptr = (short *) &line[32];
-			*short_ptr = (short) mb_swap_short(data->motion_sensor_y);
-			short_ptr = (short *) &line[34];
-			*short_ptr = (short) mb_swap_short(data->motion_sensor_z);
-			short_ptr = (short *) &line[36];
-			*short_ptr = (short) mb_swap_short(data->spare);
-			short_ptr = (short *) &line[38];
-			*short_ptr = (short) mb_swap_short(data->line_number);
-			short_ptr = (short *) &line[40];
-			*short_ptr = (short) mb_swap_short(data->start_or_stop);
-			short_ptr = (short *) &line[42];
-			*short_ptr = (short) mb_swap_short(data->transducer_serial_number);
-			}
-		line[RESON_PARAMETER_SIZE] = 0x03;
-		line[RESON_PARAMETER_SIZE+1] = '\0';
-		line[RESON_PARAMETER_SIZE+2] = '\0';
-
-		/* write out data */
-		status = fwrite(line,1,RESON_PARAMETER_SIZE+3,mbfp);
-		if (status != RESON_PARAMETER_SIZE+3)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_cbat8101_wr_nav(int verbose, FILE *mbfp, int swap, void *data_ptr, int *error)
-{
-	char	*function_name = "mbr_cbat8101_wr_nav";
-	int	status = MB_SUCCESS;
-	struct mbf_cbat8101_struct *data;
-	char	line[RESON_NAV_SIZE+3];
-	short label;
-	short *short_ptr;
-	int	*int_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       data_ptr:   %p\n",(void *)data_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_cbat8101_struct *) data_ptr;
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       year:             %d\n",data->pos_year);
-		fprintf(stderr,"dbg5       month:            %d\n",data->pos_month);
-		fprintf(stderr,"dbg5       day:              %d\n",data->pos_day);
-		fprintf(stderr,"dbg5       hour:             %d\n",data->pos_hour);
-		fprintf(stderr,"dbg5       minute:           %d\n",data->pos_minute);
-		fprintf(stderr,"dbg5       sec:              %d\n",data->pos_second);
-		fprintf(stderr,"dbg5       hundredth_sec:    %d\n",data->pos_hundredth_sec);
-		fprintf(stderr,"dbg5       thousandth_sec:   %d\n",data->pos_thousandth_sec);
-		fprintf(stderr,"dbg5       pos_latitude:     %d\n",data->pos_latitude);
-		fprintf(stderr,"dbg5       pos_longitude:    %d\n",data->pos_longitude);
-		fprintf(stderr,"dbg5       utm_northing:     %d\n",data->utm_northing);
-		fprintf(stderr,"dbg5       utm_easting:      %d\n",data->utm_easting);
-		fprintf(stderr,"dbg5       utm_zone_lon:     %d\n",data->utm_zone_lon);
-		fprintf(stderr,"dbg5       utm_zone:         %c\n",data->utm_zone);
-		fprintf(stderr,"dbg5       hemisphere:       %c\n",data->hemisphere);
-		fprintf(stderr,"dbg5       ellipsoid:        %c\n",data->ellipsoid);
-		fprintf(stderr,"dbg5       pos_spare:        %c\n",data->pos_spare);
-		fprintf(stderr,"dbg5       semi_major_axis:  %d\n",data->semi_major_axis);
-		fprintf(stderr,"dbg5       other_quality:    %d\n",data->other_quality);
-		}
-
-	/* write the record label */
-	label = RESON_NAV;
-	if (swap == MB_YES)
-		label = (short) mb_swap_short(label);
-
-	status = fwrite(&label,1,2,mbfp);
-	if (status != 2)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	else
-		status = MB_SUCCESS;
-
-	/* write out the data */
-	if (status == MB_SUCCESS)
-		{
-		/* construct record */
-		line[0] = (char) data->pos_day;
-		line[1] = (char) data->pos_month;
-		line[2] = (char) data->pos_year;
-		line[3] = (char) data->pos_hour;
-		line[4] = (char) data->pos_minute;
-		line[5] = (char) data->pos_second;
-		line[6] = (char) data->pos_hundredth_sec;
-		line[7] = (char) data->pos_thousandth_sec;
-		if (swap == MB_NO)
-			{
-			int_ptr = (int *) &line[8];
-			*int_ptr = data->pos_latitude;
-			int_ptr = (int *) &line[12];
-			*int_ptr = data->pos_longitude;
-			int_ptr = (int *) &line[16];
-			*int_ptr = data->utm_northing;
-			int_ptr = (int *) &line[20];
-			*int_ptr = data->utm_easting;
-			int_ptr = (int *) &line[24];
-			*int_ptr = data->utm_zone_lon;
-			line[28] = data->utm_zone;
-			line[29] = data->hemisphere;
-			line[30] = data->ellipsoid;
-			line[31] = data->pos_spare;
-			short_ptr = (short *) &line[32];
-			*short_ptr = (short) data->semi_major_axis;
-			short_ptr = (short *) &line[34];
-			*short_ptr = (short) data->other_quality;
-			}
-		else
-			{
-			int_ptr = (int *) &line[8];
-			*int_ptr = (int) mb_swap_int(data->pos_latitude);
-			int_ptr = (int *) &line[12];
-			*int_ptr = (int) mb_swap_int(data->pos_longitude);
-			int_ptr = (int *) &line[16];
-			*int_ptr = (int) mb_swap_int(data->utm_northing);
-			int_ptr = (int *) &line[20];
-			*int_ptr = (int) mb_swap_int(data->utm_easting);
-			int_ptr = (int *) &line[24];
-			*int_ptr = (int) mb_swap_int(data->utm_zone_lon);
-			line[28] = data->utm_zone;
-			line[29] = data->hemisphere;
-			line[30] = data->ellipsoid;
-			line[31] = data->pos_spare;
-			short_ptr = (short *) &line[32];
-			*short_ptr = (short) mb_swap_short(data->semi_major_axis);
-			short_ptr = (short *) &line[34];
-			*short_ptr = (short) mb_swap_short(data->other_quality);
-			}
-		line[RESON_NAV_SIZE] = 0x03;
-		line[RESON_NAV_SIZE+1] = '\0';
-		line[RESON_NAV_SIZE+2] = '\0';
-
-		/* write out data */
-		status = fwrite(line,1,RESON_NAV_SIZE+3,mbfp);
-		if (status != RESON_NAV_SIZE+3)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_cbat8101_wr_svp(int verbose, FILE *mbfp, int swap, void *data_ptr, int *error)
-{
-	char	*function_name = "mbr_cbat8101_wr_svp";
-	int	status = MB_SUCCESS;
-	struct mbf_cbat8101_struct *data;
-	char	line[RESON_SVP_SIZE+3];
-	short label;
-	int	size;
-	int	svp_num_max;
-	short *short_ptr;
-	short *short_ptr2;
-	int	*int_ptr;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       data_ptr:   %p\n",(void *)data_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_cbat8101_struct *) data_ptr;
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       year:             %d\n",data->svp_year);
-		fprintf(stderr,"dbg5       month:            %d\n",data->svp_month);
-		fprintf(stderr,"dbg5       day:              %d\n",data->svp_day);
-		fprintf(stderr,"dbg5       hour:             %d\n",data->svp_hour);
-		fprintf(stderr,"dbg5       minute:           %d\n",data->svp_minute);
-		fprintf(stderr,"dbg5       sec:              %d\n",data->svp_second);
-		fprintf(stderr,"dbg5       hundredth_sec:    %d\n",data->svp_hundredth_sec);
-		fprintf(stderr,"dbg5       thousandth_sec:   %d\n",data->svp_thousandth_sec);
-		fprintf(stderr,"dbg5       svp_latitude:     %d\n",data->svp_latitude);
-		fprintf(stderr,"dbg5       svp_longitude:    %d\n",data->svp_longitude);
-		fprintf(stderr,"dbg5       svp_num:          %d\n",data->svp_num);
-		for (i=0;i<data->svp_num;i++)
-			fprintf(stderr,"dbg5       depth: %d     vel: %d\n",
-				data->svp_depth[i],data->svp_vel[i]);
-		}
-
-	/* figure out which svp record to output */
-	if (data->svp_num > 200)
-		{
-		label = RESON_SVP;
-		size = RESON_SVP_SIZE;
-		svp_num_max = 500;
-		}
-	else
-		{
-		label = RESON_SHORT_SVP;
-		size = RESON_SHORT_SVP_SIZE;
-		svp_num_max = 200;
-		}
-
-	/* write the record label */
-	if (swap == MB_YES)
-		label = (short) mb_swap_short(label);
-	status = fwrite(&label,1,2,mbfp);
-	if (status != 2)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	else
-		status = MB_SUCCESS;
-
-	/* write out the data */
-	if (status == MB_SUCCESS)
-		{
-		/* construct record */
-		line[0] = (char) data->svp_day;
-		line[1] = (char) data->svp_month;
-		line[2] = (char) data->svp_year;
-		line[3] = (char) data->svp_hour;
-		line[4] = (char) data->svp_minute;
-		line[5] = (char) data->svp_second;
-		line[6] = (char) data->svp_hundredth_sec;
-		line[7] = (char) data->svp_thousandth_sec;
-		if (swap == MB_NO)
-			{
-			int_ptr = (int *) &line[8];
-			*int_ptr = data->svp_latitude;
-			int_ptr = (int *) &line[12];
-			*int_ptr = data->svp_longitude;
-			}
-		else
-			{
-			int_ptr = (int *) &line[8];
-			*int_ptr = (int) mb_swap_int(data->svp_latitude);
-			int_ptr = (int *) &line[12];
-			*int_ptr = (int) mb_swap_int(data->svp_longitude);
-			}
-		for (i=0;i<data->svp_num;i++)
-			{
-			short_ptr = (short *) &line[16+4*i];
-			short_ptr2 = (short *) &line[18+4*i];
-			if (swap == MB_NO)
-				{
-				*short_ptr = (short) data->svp_depth[i];
-				*short_ptr2 = (short) data->svp_vel[i];
-				}
-			else
-				{
-				*short_ptr = (short)
-					mb_swap_short((short)data->svp_depth[i]);
-				*short_ptr2 = (short)
-					mb_swap_short((short)data->svp_vel[i]);
-				}
-			}
-		for (i=data->svp_num;i<svp_num_max;i++)
-			{
-			short_ptr = (short *) &line[16+4*i];
-			short_ptr2 = (short *) &line[18+4*i];
-			*short_ptr = 0;
-			*short_ptr2 = 0;
-			}
-		line[size] = 0x03;
-		line[size+1] = '\0';
-		line[size+2] = '\0';
-
-		/* write out data */
-		status = fwrite(line,1,size+3,mbfp);
-		if (status != size+3)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_cbat8101_wr_bath(int verbose, FILE *mbfp, int swap, void *data_ptr, int *error)
-{
-	char	*function_name = "mbr_cbat8101_wr_bath";
-	int	status = MB_SUCCESS;
-	struct mbf_cbat8101_struct *data;
-	char	line[RESON_BATH_8101_SIZE+3];
-	char	*beamarray;
-	short label;
-	unsigned char *char_ptr;
-	short *short_ptr;
-	int	*int_ptr;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       data_ptr:   %p\n",(void *)data_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_cbat8101_struct *) data_ptr;
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       year:             %d\n",data->year);
-		fprintf(stderr,"dbg5       month:            %d\n",data->month);
-		fprintf(stderr,"dbg5       day:              %d\n",data->day);
-		fprintf(stderr,"dbg5       hour:             %d\n",data->hour);
-		fprintf(stderr,"dbg5       minute:           %d\n",data->minute);
-		fprintf(stderr,"dbg5       sec:              %d\n",data->second);
-		fprintf(stderr,"dbg5       hundredth_sec:    %d\n",data->hundredth_sec);
-		fprintf(stderr,"dbg5       thousandth_sec:   %d\n",data->thousandth_sec);
-		fprintf(stderr,"dbg5       latitude:         %d\n",data->latitude);
-		fprintf(stderr,"dbg5       longitude:        %d\n",data->longitude);
-		fprintf(stderr,"dbg5       roll:             %d\n",data->roll);
-		fprintf(stderr,"dbg5       pitch:            %d\n",data->pitch);
-		fprintf(stderr,"dbg5       heading:          %d\n",data->heading);
-		fprintf(stderr,"dbg5       heave:            %d\n",data->heave);
-		fprintf(stderr,"dbg5       ping_number:      %d\n",data->ping_number);
-		fprintf(stderr,"dbg5       sound_vel:        %d\n",data->sound_vel);
-		fprintf(stderr,"dbg5       mode:             %d\n",data->mode);
-		fprintf(stderr,"dbg5       gain1:            %d\n",data->gain1);
-		fprintf(stderr,"dbg5       gain2:            %d\n",data->gain2);
-		fprintf(stderr,"dbg5       gain3:            %d\n",data->gain3);
-		fprintf(stderr,"dbg5       beams_bath:       %d\n",data->beams_bath);
-		fprintf(stderr,"dbg5       beam bath xtrack ltrack tt amp qual heave\n");
-		for (i=0;i<data->beams_bath;i++)
-			fprintf(stderr,"dbg5       beam:%d  bath:%d  xtrck:%d  ltrck:%d tt:%d  angle:%d amp:%d  qual:%d\n",
-				i,data->bath[i],data->bath_acrosstrack[i],
-				data->bath_alongtrack[i],data->tt[i],
-				data->angle[i],data->amp[i],data->quality[i]);
-		}
-
-	/* write the record label */
-	label = RESON_BATH_8101;
-	if (swap == MB_YES)
-		label = (short) mb_swap_short(label);
-	status = fwrite(&label,1,2,mbfp);
-	if (status != 2)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	else
-		status = MB_SUCCESS;
-
-	/* write out the data */
-	if (status == MB_SUCCESS)
-		{
-		/* construct record */
-		line[0] = (char) data->day;
-		line[1] = (char) data->month;
-		line[2] = (char) data->year;
-		line[3] = (char) data->hour;
-		line[4] = (char) data->minute;
-		line[5] = (char) data->second;
-		line[6] = (char) data->hundredth_sec;
-		line[7] = (char) data->thousandth_sec;
-		if (swap == MB_NO)
-			{
-			int_ptr = (int *) &line[8];
-			*int_ptr = data->latitude;
-			int_ptr = (int *) &line[12];
-			*int_ptr = data->longitude;
-			short_ptr = (short *) &line[16];
-			*short_ptr = (short) data->roll;
-			short_ptr = (short *) &line[18];
-			*short_ptr = (short) data->pitch;
-			short_ptr = (short *) &line[20];
-			*short_ptr = (unsigned short) data->heading;
-			short_ptr = (short *) &line[22];
-			*short_ptr = (short) data->heave;
-			short_ptr = (short *) &line[24];
-			*short_ptr = (short) data->ping_number;
-			short_ptr = (short *) &line[26];
-			*short_ptr = (short) data->sound_vel;
-			}
-		else
-			{
-			int_ptr = (int *) &line[8];
-			*int_ptr = (int) mb_swap_int(data->latitude);
-			int_ptr = (int *) &line[12];
-			*int_ptr = (int) mb_swap_int(data->longitude);
-			short_ptr = (short *) &line[16];
-			*short_ptr = (short) mb_swap_short(data->roll);
-			short_ptr = (short *) &line[18];
-			*short_ptr = (short) mb_swap_short(data->pitch);
-			short_ptr = (short *) &line[20];
-			*short_ptr = (unsigned short) mb_swap_short(data->heading);
-			short_ptr = (short *) &line[22];
-			*short_ptr = (short) mb_swap_short(data->heave);
-			short_ptr = (short *) &line[24];
-			*short_ptr = (short) mb_swap_short(data->ping_number);
-			short_ptr = (short *) &line[26];
-			*short_ptr = (short) mb_swap_short(data->sound_vel);
-			}
-		line[28] = (char) data->mode;
-		line[29] = (char) data->gain1;
-		line[30] = (char) data->gain2;
-		line[31] = (char) data->gain3;
-
-
-		if (swap == MB_NO)
-			{
-			for (i=0;i<MBF_CBAT8101_MAXBEAMS;i++)
-				{
-				beamarray = line + 32 + 12*i;
-				short_ptr = (short *) beamarray;
-				*short_ptr = (short) data->bath[i];
-				short_ptr = ((short *) beamarray) + 1;
-				*short_ptr = (short) data->bath_acrosstrack[i];
-				short_ptr = ((short *) beamarray) + 2;
-				*short_ptr = (short) data->bath_alongtrack[i];
-				short_ptr = ((short *) beamarray) + 3;
-				*short_ptr = (short) data->tt[i];
-				short_ptr = ((short *) beamarray) + 4;
-				*short_ptr = (short) data->angle[i];
-				char_ptr = (unsigned char *) (beamarray + 10);
-				*char_ptr = (char) data->quality[i];
-				char_ptr = (unsigned char *) (beamarray + 11);
-				*char_ptr = (unsigned char) data->amp[i];
-				}
-			}
-		else
-			{
-			for (i=0;i<MBF_CBAT8101_MAXBEAMS;i++)
-				{
-				beamarray = line + 32 + 12*i;
-				short_ptr = (short *) beamarray;
-				*short_ptr = (short)
-					mb_swap_short((short)data->bath[i]);
-				short_ptr = ((short *) beamarray) + 1;
-				*short_ptr = (short)
-					mb_swap_short((short)data->bath_acrosstrack[i]);
-				short_ptr = ((short *) beamarray) + 2;
-				*short_ptr = (short)
-					mb_swap_short((short)data->bath_alongtrack[i]);
-				short_ptr = ((short *) beamarray) + 3;
-				*short_ptr = (short)
-					mb_swap_short((short)data->tt[i]);
-				short_ptr = ((short *) beamarray) + 4;
-				*short_ptr = (short)
-					mb_swap_short((short)data->angle[i]);
-				char_ptr = (unsigned char *) (beamarray + 10);
-				*char_ptr = (char) data->quality[i];
-				char_ptr = (unsigned char *) (beamarray + 11);
-				*char_ptr = (unsigned char) data->amp[i];
-				}
-			}
-		line[RESON_BATH_8101_SIZE] = 0x03;
-		line[RESON_BATH_8101_SIZE+1] = '\0';
-		line[RESON_BATH_8101_SIZE+2] = '\0';
-
-		/* write out data */
-		status = fwrite(line,1,RESON_BATH_8101_SIZE+3,mbfp);
-		if (status != RESON_BATH_8101_SIZE+3)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_cbat8101_wr_heading(int verbose, FILE *mbfp, int swap, void *data_ptr, int *error)
-{
-	char	*function_name = "mbr_cbat8101_wr_heading";
-	int	status = MB_SUCCESS;
-	struct mbf_cbat8101_struct *data;
-	char	line[RESON_HEADING_SIZE+3];
-	short label;
-	short *short_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       data_ptr:   %p\n",(void *)data_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_cbat8101_struct *) data_ptr;
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       year:             %d\n",data->year);
-		fprintf(stderr,"dbg5       month:            %d\n",data->month);
-		fprintf(stderr,"dbg5       day:              %d\n",data->day);
-		fprintf(stderr,"dbg5       hour:             %d\n",data->hour);
-		fprintf(stderr,"dbg5       minute:           %d\n",data->minute);
-		fprintf(stderr,"dbg5       sec:              %d\n",data->second);
-		fprintf(stderr,"dbg5       hundredth_sec:    %d\n",data->hundredth_sec);
-		fprintf(stderr,"dbg5       thousandth_sec:   %d\n",data->thousandth_sec);
-		fprintf(stderr,"dbg5       heading:          %d\n",data->heading);
-		}
-
-	/* write the record label */
-	label = RESON_HEADING;
-	if (swap == MB_YES)
-		label = (short) mb_swap_short(label);
-	status = fwrite(&label,1,2,mbfp);
-	if (status != 2)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	else
-		status = MB_SUCCESS;
-
-	/* write out the data */
-	if (status == MB_SUCCESS)
-		{
-		/* construct record */
-		line[0] = (char) data->day;
-		line[1] = (char) data->month;
-		line[2] = (char) data->year;
-		line[3] = (char) data->hour;
-		line[4] = (char) data->minute;
-		line[5] = (char) data->second;
-		line[6] = (char) data->hundredth_sec;
-		line[7] = (char) data->thousandth_sec;
-		if (swap == MB_NO)
-			{
-			short_ptr = (short *) &line[8];
-			*short_ptr = (short) data->heading;
-			}
-		else
-			{
-			short_ptr = (short *) &line[8];
-			*short_ptr = (short) mb_swap_short(data->heading);
-			}
-		line[RESON_HEADING_SIZE] = 0x03;
-		line[RESON_HEADING_SIZE+1] = '\0';
-		line[RESON_HEADING_SIZE+2] = '\0';
-
-		/* write out data */
-		status = fwrite(line,1,RESON_HEADING_SIZE+3,mbfp);
-		if (status != RESON_HEADING_SIZE+3)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_cbat8101_wr_attitude(int verbose, FILE *mbfp, int swap, void *data_ptr, int *error)
-{
-	char	*function_name = "mbr_cbat8101_wr_attitude";
-	int	status = MB_SUCCESS;
-	struct mbf_cbat8101_struct *data;
-	char	line[RESON_ATTITUDE_SIZE+3];
-	short label;
-	short *short_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       data_ptr:   %p\n",(void *)data_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_cbat8101_struct *) data_ptr;
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       year:             %d\n",data->year);
-		fprintf(stderr,"dbg5       month:            %d\n",data->month);
-		fprintf(stderr,"dbg5       day:              %d\n",data->day);
-		fprintf(stderr,"dbg5       hour:             %d\n",data->hour);
-		fprintf(stderr,"dbg5       minute:           %d\n",data->minute);
-		fprintf(stderr,"dbg5       sec:              %d\n",data->second);
-		fprintf(stderr,"dbg5       hundredth_sec:    %d\n",data->hundredth_sec);
-		fprintf(stderr,"dbg5       thousandth_sec:   %d\n",data->thousandth_sec);
-		fprintf(stderr,"dbg5       heave:            %d\n",data->heave);
-		fprintf(stderr,"dbg5       roll:             %d\n",data->roll);
-		fprintf(stderr,"dbg5       pitch:            %d\n",data->pitch);
-		}
-
-	/* write the record label */
-	label = RESON_ATTITUDE;
-	if (swap == MB_YES)
-		label = (short) mb_swap_short(label);
-	status = fwrite(&label,1,2,mbfp);
-	if (status != 2)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	else
-		status = MB_SUCCESS;
-
-	/* write out the data */
-	if (status == MB_SUCCESS)
-		{
-		/* construct record */
-		line[0] = (char) data->day;
-		line[1] = (char) data->month;
-		line[2] = (char) data->year;
-		line[3] = (char) data->hour;
-		line[4] = (char) data->minute;
-		line[5] = (char) data->second;
-		line[6] = (char) data->hundredth_sec;
-		line[7] = (char) data->thousandth_sec;
-		if (swap == MB_NO)
-			{
-			short_ptr = (short *) &line[8];
-			*short_ptr = (short) data->heave;
-			short_ptr = (short *) &line[10];
-			*short_ptr = (short) data->roll;
-			short_ptr = (short *) &line[12];
-			*short_ptr = (short) data->pitch;
-			}
-		else
-			{
-			short_ptr = (short *) &line[8];
-			*short_ptr = (short) mb_swap_short(data->heave);
-			short_ptr = (short *) &line[10];
-			*short_ptr = (short) mb_swap_short(data->roll);
-			short_ptr = (short *) &line[12];
-			*short_ptr = (short) mb_swap_short(data->pitch);
-			}
-		line[RESON_ATTITUDE_SIZE] = 0x03;
-		line[RESON_ATTITUDE_SIZE+1] = '\0';
-		line[RESON_ATTITUDE_SIZE+2] = '\0';
-
-		/* write out data */
-		status = fwrite(line,1,RESON_ATTITUDE_SIZE+3,mbfp);
-		if (status != RESON_ATTITUDE_SIZE+3)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mbr_cbat9001.c b/src/mbio/mbr_cbat9001.c
deleted file mode 100644
index b9df882..0000000
--- a/src/mbio/mbr_cbat9001.c
+++ /dev/null
@@ -1,2796 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbr_cbat9001.c	8/8/94
- *	$Id: mbr_cbat9001.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1994-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbr_cbat9001.c contains the functions for reading and writing
- * multibeam data in the CBAT9001 format.
- * These functions include:
- *   mbr_alm_cbat9001	- allocate read/write memory
- *   mbr_dem_cbat9001	- deallocate read/write memory
- *   mbr_rt_cbat9001	- read and translate data
- *   mbr_wt_cbat9001	- translate and write data
- *
- * Author:	D. W. Caress
- * Date:	August 8, 1994
- * $Log: mbr_cbat9001.c,v $
- * Revision 5.11  2008/09/13 06:08:09  caress
- * Updates to apply suggested patches to segy handling. Also fixes to remove compiler warnings.
- *
- * Revision 5.10  2008/07/10 06:43:40  caress
- * Preparing for 5.1.1beta20
- *
- * Revision 5.9  2006/01/06 18:27:18  caress
- * Working towards 5.0.8
- *
- * Revision 5.8  2005/11/05 00:48:03  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.7  2003/05/20 18:05:32  caress
- * Added svp_source to data source parameters.
- *
- * Revision 5.6  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.5  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.4  2001/07/20 00:31:11  caress
- * Release 5.0.beta03
- *
- * Revision 5.3  2001/06/08  21:44:01  caress
- * Version 5.0.beta01
- *
- * Revision 5.2  2001/03/22  20:45:56  caress
- * Trying to make 5.0.beta0...
- *
- * Revision 5.1  2001/01/22  07:43:34  caress
- * Version 5.0.beta01
- *
- * Revision 5.0  2000/12/01  22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.12  2000/10/11  01:02:30  caress
- * Convert to ANSI C
- *
- * Revision 4.11  2000/09/30  06:34:20  caress
- * Snapshot for Dale.
- *
- * Revision 4.10  1999/03/31  18:11:35  caress
- * MB-System 4.6beta7
- *
- * Revision 4.9  1999/01/01  23:41:06  caress
- * MB-System version 4.6beta6
- *
- * Revision 4.8  1998/10/05 17:46:15  caress
- * MB-System version 4.6beta
- *
- * Revision 4.7  1997/07/28  14:58:19  caress
- * Fixed typos.
- *
- * Revision 4.6  1997/07/25  14:19:53  caress
- * Version 4.5beta2.
- * Much mucking, particularly with Simrad formats.
- *
- * Revision 4.5  1997/04/21  17:02:07  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.4  1996/04/22  13:21:19  caress
- * Now have DTR and MIN/MAX defines in mb_define.h
- *
- * Revision 4.4  1996/04/22  13:21:19  caress
- * Now have DTR and MIN/MAX defines in mb_define.h
- *
- * Revision 4.3  1996/04/22  10:57:09  caress
- * DTR define now in mb_io.h
- *
- * Revision 4.2  1995/07/13  19:13:36  caress
- * Intermediate check-in during major bug-fixing flail.
- *
- * Revision 4.1  1995/03/06  19:38:54  caress
- * Changed include strings.h to string.h for POSIX compliance.
- *
- * Revision 4.0  1994/10/21  12:34:54  caress
- * Release V4.0
- *
- * Revision 1.1  1994/10/21  12:20:01  caress
- * Initial revision
- *
- *
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mb_define.h"
-#include "mbsys_reson.h"
-#include "mbf_cbat9001.h"
-
-/* include for byte swapping on little-endian machines */
-#include "mb_swap.h"
-
-/* essential function prototypes */
-int mbr_register_cbat9001(int verbose, void *mbio_ptr,
-		int *error);
-int mbr_info_cbat9001(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_alm_cbat9001(int verbose, void *mbio_ptr, int *error);
-int mbr_dem_cbat9001(int verbose, void *mbio_ptr, int *error);
-int mbr_zero_cbat9001(int verbose, void *data_ptr, int *error);
-int mbr_rt_cbat9001(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_wt_cbat9001(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_cbat9001_rd_data(int verbose, void *mbio_ptr, int *error);
-int mbr_cbat9001_rd_comment(int verbose, FILE *mbfp, int swap,
-		struct mbf_cbat9001_struct *data, int *error);
-int mbr_cbat9001_rd_parameter(int verbose, FILE *mbfp, int swap,
-		struct mbf_cbat9001_struct *data, int *error);
-int mbr_cbat9001_rd_nav(int verbose, FILE *mbfp, int swap,
-		struct mbf_cbat9001_struct *data, int *error);
-int mbr_cbat9001_rd_svp(int verbose, FILE *mbfp, int swap,
-		struct mbf_cbat9001_struct *data, int *error);
-int mbr_cbat9001_rd_short_svp(int verbose, FILE *mbfp, int swap,
-		struct mbf_cbat9001_struct *data, int *error);
-int mbr_cbat9001_rd_bath(int verbose, FILE *mbfp, int swap,
-		struct mbf_cbat9001_struct *data, int *error);
-int mbr_cbat9001_wr_data(int verbose, void *mbio_ptr, void *data_ptr, int *error);
-int mbr_cbat9001_wr_comment(int verbose, FILE *mbfp, int swap, void *data_ptr, int *error);
-int mbr_cbat9001_wr_parameter(int verbose, FILE *mbfp, int swap, void *data_ptr, int *error);
-int mbr_cbat9001_wr_nav(int verbose, FILE *mbfp, int swap, void *data_ptr, int *error);
-int mbr_cbat9001_wr_svp(int verbose, FILE *mbfp, int swap, void *data_ptr, int *error);
-int mbr_cbat9001_wr_bath(int verbose, FILE *mbfp, int swap, void *data_ptr, int *error);
-
-static char rcs_id[]="$Id: mbr_cbat9001.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mbr_register_cbat9001(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_register_cbat9001";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* get mb_io_ptr */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set format info parameters */
-	status = mbr_info_cbat9001(verbose,
-			&mb_io_ptr->system,
-			&mb_io_ptr->beams_bath_max,
-			&mb_io_ptr->beams_amp_max,
-			&mb_io_ptr->pixels_ss_max,
-			mb_io_ptr->format_name,
-			mb_io_ptr->system_name,
-			mb_io_ptr->format_description,
-			&mb_io_ptr->numfile,
-			&mb_io_ptr->filetype,
-			&mb_io_ptr->variable_beams,
-			&mb_io_ptr->traveltime,
-			&mb_io_ptr->beam_flagging,
-			&mb_io_ptr->nav_source,
-			&mb_io_ptr->heading_source,
-			&mb_io_ptr->vru_source,
-			&mb_io_ptr->svp_source,
-			&mb_io_ptr->beamwidth_xtrack,
-			&mb_io_ptr->beamwidth_ltrack,
-			error);
-
-	/* set format and system specific function pointers */
-	mb_io_ptr->mb_io_format_alloc = &mbr_alm_cbat9001;
-	mb_io_ptr->mb_io_format_free = &mbr_dem_cbat9001;
-	mb_io_ptr->mb_io_store_alloc = &mbsys_reson_alloc;
-	mb_io_ptr->mb_io_store_free = &mbsys_reson_deall;
-	mb_io_ptr->mb_io_read_ping = &mbr_rt_cbat9001;
-	mb_io_ptr->mb_io_write_ping = &mbr_wt_cbat9001;
-	mb_io_ptr->mb_io_dimensions = &mbsys_reson_dimensions;
-	mb_io_ptr->mb_io_extract = &mbsys_reson_extract;
-	mb_io_ptr->mb_io_insert = &mbsys_reson_insert;
-	mb_io_ptr->mb_io_extract_nav = &mbsys_reson_extract_nav;
-	mb_io_ptr->mb_io_insert_nav = &mbsys_reson_insert_nav;
-	mb_io_ptr->mb_io_extract_altitude = &mbsys_reson_extract_altitude;
-	mb_io_ptr->mb_io_insert_altitude = NULL;
-	mb_io_ptr->mb_io_extract_svp = &mbsys_reson_extract_svp;
-	mb_io_ptr->mb_io_insert_svp = &mbsys_reson_insert_svp;
-	mb_io_ptr->mb_io_ttimes = &mbsys_reson_ttimes;
-	mb_io_ptr->mb_io_detects = &mbsys_reson_detects;
-	mb_io_ptr->mb_io_copyrecord = &mbsys_reson_copy;
-	mb_io_ptr->mb_io_extract_rawss = NULL;
-	mb_io_ptr->mb_io_insert_rawss = NULL;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",mb_io_ptr->system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",mb_io_ptr->beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",mb_io_ptr->beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",mb_io_ptr->pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",mb_io_ptr->format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",mb_io_ptr->system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",mb_io_ptr->format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",mb_io_ptr->numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",mb_io_ptr->filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",mb_io_ptr->variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",mb_io_ptr->traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",mb_io_ptr->beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",mb_io_ptr->nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",mb_io_ptr->heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",mb_io_ptr->vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",mb_io_ptr->svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",mb_io_ptr->beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",mb_io_ptr->beamwidth_ltrack);
-		fprintf(stderr,"dbg2       format_alloc:       %p\n",(void *)mb_io_ptr->mb_io_format_alloc);
-		fprintf(stderr,"dbg2       format_free:        %p\n",(void *)mb_io_ptr->mb_io_format_free);
-		fprintf(stderr,"dbg2       store_alloc:        %p\n",(void *)mb_io_ptr->mb_io_store_alloc);
-		fprintf(stderr,"dbg2       store_free:         %p\n",(void *)mb_io_ptr->mb_io_store_free);
-		fprintf(stderr,"dbg2       read_ping:          %p\n",(void *)mb_io_ptr->mb_io_read_ping);
-		fprintf(stderr,"dbg2       write_ping:         %p\n",(void *)mb_io_ptr->mb_io_write_ping);
-		fprintf(stderr,"dbg2       extract:            %p\n",(void *)mb_io_ptr->mb_io_extract);
-		fprintf(stderr,"dbg2       insert:             %p\n",(void *)mb_io_ptr->mb_io_insert);
-		fprintf(stderr,"dbg2       extract_nav:        %p\n",(void *)mb_io_ptr->mb_io_extract_nav);
-		fprintf(stderr,"dbg2       insert_nav:         %p\n",(void *)mb_io_ptr->mb_io_insert_nav);
-		fprintf(stderr,"dbg2       extract_altitude:   %p\n",(void *)mb_io_ptr->mb_io_extract_altitude);
-		fprintf(stderr,"dbg2       insert_altitude:    %p\n",(void *)mb_io_ptr->mb_io_insert_altitude);
-		fprintf(stderr,"dbg2       extract_svp:        %p\n",(void *)mb_io_ptr->mb_io_extract_svp);
-		fprintf(stderr,"dbg2       insert_svp:         %p\n",(void *)mb_io_ptr->mb_io_insert_svp);
-		fprintf(stderr,"dbg2       ttimes:             %p\n",(void *)mb_io_ptr->mb_io_ttimes);
-		fprintf(stderr,"dbg2       detects:            %p\n",(void *)mb_io_ptr->mb_io_detects);
-		fprintf(stderr,"dbg2       extract_rawss:      %p\n",(void *)mb_io_ptr->mb_io_extract_rawss);
-		fprintf(stderr,"dbg2       insert_rawss:       %p\n",(void *)mb_io_ptr->mb_io_insert_rawss);
-		fprintf(stderr,"dbg2       copyrecord:         %p\n",(void *)mb_io_ptr->mb_io_copyrecord);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbr_info_cbat9001(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error)
-{
-	char	*function_name = "mbr_info_cbat9001";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* set format info parameters */
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-	*system = MB_SYS_RESON;
-	*beams_bath_max = 60;
-	*beams_amp_max = 60;
-	*pixels_ss_max = 0;
-	strncpy(format_name, "CBAT9001", MB_NAME_LENGTH);
-	strncpy(system_name, "RESON", MB_NAME_LENGTH);
-	strncpy(format_description, "Format name:          MBF_CBAT9001\nInformal Description: Reson SeaBat 9001 shallow water multibeam\nAttributes:           60 beam bathymetry and amplitude,\n                      binary, University of New Brunswick.\n", MB_DESCRIPTION_LENGTH);
-	*numfile = 1;
-	*filetype = MB_FILETYPE_NORMAL;
-	*variable_beams = MB_NO;
-	*traveltime = MB_YES;
-	*beam_flagging = MB_YES;
-	*nav_source = MB_DATA_NAV;
-	*heading_source = MB_DATA_DATA;
-	*vru_source = MB_DATA_DATA;
-	*svp_source = MB_DATA_VELOCITY_PROFILE;
-	*beamwidth_xtrack = 2.0;
-	*beamwidth_ltrack = 2.0;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",*system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",*beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",*beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",*pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",*numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",*filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",*variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",*traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",*beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",*nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",*heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",*vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",*svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",*beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",*beamwidth_ltrack);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_alm_cbat9001(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_alm_cbat9001";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set initial status */
-	status = MB_SUCCESS;
-
-	/* allocate memory for data structure */
-	mb_io_ptr->structure_size = sizeof(struct mbf_cbat9001_struct);
-	mb_io_ptr->data_structure_size = 0;
-	status = mb_mallocd(verbose,__FILE__,__LINE__,mb_io_ptr->structure_size,
-				(void **)&mb_io_ptr->raw_data,error);
-	status = mb_mallocd(verbose,__FILE__,__LINE__,sizeof(struct mbsys_reson_struct),
-				(void **)&mb_io_ptr->store_data,error);
-
-	/* initialize everything to zeros */
-	mbr_zero_cbat9001(verbose,mb_io_ptr->raw_data,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_dem_cbat9001(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_dem_cbat9001";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointers to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* deallocate memory for data descriptor */
-	status = mb_freed(verbose,__FILE__, __LINE__, (void **)&mb_io_ptr->raw_data,error);
-	status = mb_freed(verbose,__FILE__, __LINE__, (void **)&mb_io_ptr->store_data,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_zero_cbat9001(int verbose, void *data_ptr, int *error)
-{
-	char	*function_name = "mbr_zero_cbat9001";
-	int	status = MB_SUCCESS;
-	struct mbf_cbat9001_struct *data;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       data_ptr:   %p\n",(void *)data_ptr);
-		}
-
-	/* get pointer to data descriptor */
-	data = (struct mbf_cbat9001_struct *) data_ptr;
-
-	/* initialize everything to zeros */
-	if (data != NULL)
-		{
-		data->kind = MB_DATA_NONE;
-		data->sonar = MBSYS_RESON_SEABAT9001;
-		data->par_year = 0;
-		data->par_month = 0;
-		data->par_day = 0;
-		data->par_hour = 0;
-		data->par_minute = 0;
-		data->par_second = 0;
-		data->par_hundredth_sec = 0;
-		data->par_thousandth_sec = 0;
-		data->roll_offset = 0;	/* roll offset (degrees) */
-		data->pitch_offset = 0;	/* pitch offset (degrees) */
-		data->heading_offset = 0;	/* heading offset (degrees) */
-		data->time_delay = 0;		/* positioning system
-							delay (sec) */
-		data->transducer_depth = 0;	/* tranducer depth (meters) */
-		data->transducer_height = 0;	/* reference height (meters) */
-		data->transducer_x = 0;	/* reference athwartships
-							offset (meters) */
-		data->transducer_y = 0;	/* reference  fore-aft
-							offset (meters) */
-		data->antenna_x = 0;		/* antenna athwartships
-							offset (meters) */
-		data->antenna_y = 0;		/* antenna fore-aft
-							offset (meters) */
-		data->antenna_z = 0;		/* antenna height (meters) */
-		data->motion_sensor_x = 0;	/* motion sensor athwartships
-							offset (meters) */
-		data->motion_sensor_y = 0;	/* motion sensor fore-aft
-							offset (meters) */
-		data->motion_sensor_z = 0;	/* motion sensor height
-							offset (meters) */
-		data->spare = 0;
-		data->line_number = 0;
-		data->start_or_stop = 0;
-		data->transducer_serial_number = 0;
-		for (i=0;i<MBF_CBAT9001_COMMENT_LENGTH;i++)
-			data->comment[i] = '\0';
-
-		/* position (position telegrams) */
-		data->pos_year = 0;
-		data->pos_month = 0;
-		data->pos_day = 0;
-		data->pos_hour = 0;
-		data->pos_minute = 0;
-		data->pos_second = 0;
-		data->par_hundredth_sec = 0;
-		data->pos_thousandth_sec = 0;
-		data->pos_latitude = 0;
-		data->pos_longitude = 0;
-		data->utm_northing = 0;
-		data->utm_easting = 0;
-		data->utm_zone_lon = 0;
-		data->utm_zone = 0;
-		data->hemisphere = 0;
-		data->ellipsoid = 0;
-		data->pos_spare = 0;
-		data->semi_major_axis = 0;
-		data->other_quality = 0;
-
-		/* sound velocity profile */
-		data->svp_year = 0;
-		data->svp_month = 0;
-		data->svp_day = 0;
-		data->svp_hour = 0;
-		data->svp_minute = 0;
-		data->svp_second = 0;
-		data->svp_hundredth_sec = 0;
-		data->svp_thousandth_sec = 0;
-		data->svp_num = 0;
-		for (i=0;i<100;i++)
-			{
-			data->svp_depth[i] = 0; /* 0.1 meters */
-			data->svp_vel[i] = 0;	/* 0.1 meters/sec */
-			}
-
-		/* time stamp */
-		data->year = 0;
-		data->month = 0;
-		data->day = 0;
-		data->hour = 0;
-		data->minute = 0;
-		data->second = 0;
-		data->hundredth_sec = 0;
-		data->thousandth_sec = 0;
-		data->roll = 0;
-		data->pitch = 0;
-		data->heading = 0;
-		data->heave = 0;
-		data->ping_number = 0;
-		data->sound_vel = 0;
-		data->mode = 0;
-		data->gain1 = 0;
-		data->gain2 = 0;
-		data->gain3 = 0;
-		data->beams_bath = MBF_CBAT9001_MAXBEAMS;
-		for (i=0;i<MBF_CBAT9001_MAXBEAMS;i++)
-			{
-			data->bath[i] = 0;
-			data->bath_acrosstrack[i] = 0;
-			data->bath_alongtrack[i] = 0;
-			data->tt[i] = 0;
-			data->angle[i] = 0;
-			data->quality[i] = 0;
-			data->amp[i] = 0;
-			}
-		}
-
-	/* assume success */
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_rt_cbat9001(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_rt_cbat9001";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_cbat9001_struct *data;
-	struct mbsys_reson_struct *store;
-	int	time_i[7];
-	double	time_d;
-	double	lon, lat, heading, speed;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointers to mbio descriptor and data structures */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-	data = (struct mbf_cbat9001_struct *) mb_io_ptr->raw_data;
-	store = (struct mbsys_reson_struct *) store_ptr;
-
-	/* read next data from file */
-	status = mbr_cbat9001_rd_data(verbose,mbio_ptr,error);
-
-	/* set error and kind in mb_io_ptr */
-	mb_io_ptr->new_error = *error;
-	mb_io_ptr->new_kind = data->kind;
-
-	/* add nav records to list for interpolation */
-	if (status == MB_SUCCESS
-		&& data->kind == MB_DATA_NAV)
-		{
-		mb_fix_y2k(verbose, data->pos_year,&time_i[0]);
-		time_i[1] = data->pos_month;
-		time_i[2] = data->pos_day;
-		time_i[3] = data->pos_hour;
-		time_i[4] = data->pos_minute;
-		time_i[5] = data->pos_second;
-		time_i[6] = 10000*data->pos_hundredth_sec
-			+ 100*data->pos_thousandth_sec;
-		mb_get_time(verbose,time_i, &time_d);
-		lon = data->pos_longitude*0.00000009;
-		lat = data->pos_latitude*0.00000009;
-		mb_navint_add(verbose, mbio_ptr, time_d, lon, lat, error);
-		}
-
-	/* interpolate navigation for survey pings if needed */
-	if (status == MB_SUCCESS
-		&& data->kind == MB_DATA_DATA
-		&& data->longitude == 0
-		&& data->latitude == 0
-		&& mb_io_ptr->nfix >= 1)
-		{
-		mb_fix_y2k(verbose, data->year,&time_i[0]);
-		time_i[1] = data->month;
-		time_i[2] = data->day;
-		time_i[3] = data->hour;
-		time_i[4] = data->minute;
-		time_i[5] = data->second;
-		time_i[6] = 10000*data->hundredth_sec
-			+ 100*data->thousandth_sec;
-		mb_get_time(verbose,time_i, &time_d);
-		heading = 0.01 * data->heading;
-		mb_navint_interp(verbose, mbio_ptr, time_d, heading, 0.0,
-				    &lon, &lat, &speed, error);
-		data->longitude = (int) (lon / 0.00000009);
-		data->latitude = (int) (lat / 0.00000009);
-		}
-
-	/* translate values to reson data storage structure */
-	if (status == MB_SUCCESS
-		&& store != NULL)
-		{
-		store->kind = data->kind;
-		store->sonar = data->sonar;
-
-		/* parameter telegram */
-		store->par_year = data->par_year;
-		store->par_month = data->par_month;
-		store->par_day = data->par_day;
-		store->par_hour = data->par_hour;
-		store->par_minute = data->par_minute;
-		store->par_second = data->par_second;
-		store->par_hundredth_sec = data->par_hundredth_sec;
-		store->par_thousandth_sec = data->par_thousandth_sec;
-		store->roll_offset = data->roll_offset;
-		store->pitch_offset = data->pitch_offset;
-		store->heading_offset = data->heading_offset;
-		store->time_delay = data->time_delay;
-		store->transducer_depth = data->transducer_depth;
-		store->transducer_height = data->transducer_height;
-		store->transducer_x = data->transducer_x;
-		store->transducer_y = data->transducer_y;
-		store->antenna_x = data->antenna_x;
-		store->antenna_y = data->antenna_y;
-		store->antenna_z = data->antenna_z;
-		store->motion_sensor_x = data->motion_sensor_x;
-		store->motion_sensor_y = data->motion_sensor_y;
-		store->motion_sensor_z = data->motion_sensor_z;
-		store->spare = data->spare;
-		store->line_number = data->line_number;
-		store->start_or_stop = data->start_or_stop;
-		store->transducer_serial_number
-			= data->transducer_serial_number;
-		for (i=0;i<MBSYS_RESON_COMMENT_LENGTH;i++)
-			store->comment[i] = data->comment[i];
-
-		/* position (position telegrams) */
-		store->pos_year = data->pos_year;
-		store->pos_month = data->pos_month;
-		store->pos_day = data->pos_day;
-		store->pos_hour = data->pos_hour;
-		store->pos_minute = data->pos_minute;
-		store->pos_second = data->pos_second;
-		store->pos_hundredth_sec = data->pos_hundredth_sec;
-		store->pos_thousandth_sec = data->pos_thousandth_sec;
-		store->pos_latitude = data->pos_latitude;
-		store->pos_longitude = data->pos_longitude;
-		store->utm_northing = data->utm_northing;
-		store->utm_easting = data->utm_easting;
-		store->utm_zone_lon = data->utm_zone_lon;
-		store->utm_zone = data->utm_zone;
-		store->hemisphere = data->hemisphere;
-		store->ellipsoid = data->ellipsoid;
-		store->pos_spare = data->pos_spare;
-		store->semi_major_axis = data->semi_major_axis;
-		store->other_quality = data->other_quality;
-
-		/* sound velocity profile */
-		store->svp_year = data->svp_year;
-		store->svp_month = data->svp_month;
-		store->svp_day = data->svp_day;
-		store->svp_hour = data->svp_hour;
-		store->svp_minute = data->svp_minute;
-		store->svp_second = data->svp_second;
-		store->svp_hundredth_sec = data->svp_hundredth_sec;
-		store->svp_thousandth_sec = data->svp_thousandth_sec;
-		store->svp_num = data->svp_num;
-		for (i=0;i<500;i++)
-			{
-			store->svp_depth[i] = data->svp_depth[i];
-			store->svp_vel[i] = data->svp_vel[i];
-			}
-
-		/* bathymetry */
-		store->year = data->year;
-		store->month = data->month;
-		store->day = data->day;
-		store->hour = data->hour;
-		store->minute = data->minute;
-		store->second = data->second;
-		store->hundredth_sec = data->hundredth_sec;
-		store->thousandth_sec = data->thousandth_sec;
-		store->longitude = data->longitude;
-		store->latitude = data->latitude;
-		store->roll = data->roll;
-		store->pitch = data->pitch;
-		store->heading = data->heading;
-		store->heave = data->heave;
-		store->ping_number = data->ping_number;
-		store->sound_vel = data->sound_vel;
-		store->mode = data->mode;
-		store->gain1 = data->gain1;
-		store->gain2 = data->gain2;
-		store->gain3 = data->gain3;
-		store->beams_bath = data->beams_bath;
-		for (i=0;i<store->beams_bath;i++)
-			{
-			store->bath[i] = data->bath[i];
-			store->bath_acrosstrack[i] = data->bath_acrosstrack[i];
-			store->bath_alongtrack[i] = data->bath_alongtrack[i];
-			store->tt[i] = 5 * data->tt[i];
-			store->angle[i] = data->angle[i];
-			store->quality[i] = data->quality[i];
-			store->amp[i] = data->amp[i];
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_wt_cbat9001(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_wt_cbat9001";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_cbat9001_struct *data;
-	char	*data_ptr;
-	struct mbsys_reson_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_cbat9001_struct *) mb_io_ptr->raw_data;
-	data_ptr = (char *) data;
-	store = (struct mbsys_reson_struct *) store_ptr;
-
-	/* first translate values from data storage structure */
-	if (store != NULL)
-		{
-		data->kind = store->kind;
-		data->sonar = store->sonar;
-
-		/* parameter telegram */
-		data->par_year = store->par_year;
-		data->par_month = store->par_month;
-		data->par_day = store->par_day;
-		data->par_hour = store->par_hour;
-		data->par_minute = store->par_minute;
-		data->par_second = store->par_second;
-		data->par_hundredth_sec = store->par_hundredth_sec;
-		data->par_thousandth_sec = store->par_thousandth_sec;
-		data->roll_offset = store->roll_offset;
-		data->pitch_offset = store->pitch_offset;
-		data->heading_offset = store->heading_offset;
-		data->time_delay = store->time_delay;
-		data->transducer_depth = store->transducer_depth;
-		data->transducer_height = store->transducer_height;
-		data->transducer_x = store->transducer_x;
-		data->transducer_y = store->transducer_y;
-		data->antenna_x = store->antenna_x;
-		data->antenna_y = store->antenna_y;
-		data->antenna_z = store->antenna_z;
-		data->motion_sensor_x = store->motion_sensor_x;
-		data->motion_sensor_y = store->motion_sensor_y;
-		data->motion_sensor_z = store->motion_sensor_z;
-		data->spare = store->spare;
-		data->line_number = store->line_number;
-		data->start_or_stop = store->start_or_stop;
-		data->transducer_serial_number
-			= store->transducer_serial_number;
-		for (i=0;i<MBF_CBAT9001_COMMENT_LENGTH;i++)
-			data->comment[i] = store->comment[i];
-
-		/* position (position telegrams) */
-		data->pos_year = store->pos_year;
-		data->pos_month = store->pos_month;
-		data->pos_day = store->pos_day;
-		data->pos_hour = store->pos_hour;
-		data->pos_minute = store->pos_minute;
-		data->pos_second = store->pos_second;
-		data->pos_hundredth_sec = store->pos_hundredth_sec;
-		data->pos_thousandth_sec = store->pos_thousandth_sec;
-		data->pos_latitude = store->pos_latitude;
-		data->pos_longitude = store->pos_longitude;
-		data->utm_northing = store->utm_northing;
-		data->utm_easting = store->utm_easting;
-		data->utm_zone_lon = store->utm_zone_lon;
-		data->utm_zone = store->utm_zone;
-		data->hemisphere = store->hemisphere;
-		data->ellipsoid = store->ellipsoid;
-		data->pos_spare = store->pos_spare;
-		data->semi_major_axis = store->semi_major_axis;
-		data->other_quality = store->other_quality;
-
-		/* sound velocity profile */
-		data->svp_year = store->svp_year;
-		data->svp_month = store->svp_month;
-		data->svp_day = store->svp_day;
-		data->svp_hour = store->svp_hour;
-		data->svp_minute = store->svp_minute;
-		data->svp_second = store->svp_second;
-		data->svp_hundredth_sec = store->svp_hundredth_sec;
-		data->svp_thousandth_sec = store->svp_thousandth_sec;
-		data->svp_num = store->svp_num;
-		for (i=0;i<500;i++)
-			{
-			data->svp_depth[i] = store->svp_depth[i];
-			data->svp_vel[i] = store->svp_vel[i];
-			}
-
-		/* bathymetry */
-		data->year = store->year;
-		data->month = store->month;
-		data->day = store->day;
-		data->hour = store->hour;
-		data->minute = store->minute;
-		data->second = store->second;
-		data->hundredth_sec = store->hundredth_sec;
-		data->thousandth_sec = store->thousandth_sec;
-		data->longitude = store->longitude;
-		data->latitude = store->latitude;
-		data->roll = store->roll;
-		data->pitch = store->pitch;
-		data->heading = store->heading;
-		data->heave = store->heave;
-		data->ping_number = store->ping_number;
-		data->sound_vel = store->sound_vel;
-		data->mode = store->mode;
-		data->gain1 = store->gain1;
-		data->gain2 = store->gain2;
-		data->gain3 = store->gain3;
-		data->beams_bath = store->beams_bath;
-		for (i=0;i<data->beams_bath;i++)
-			{
-			data->bath[i] = store->bath[i];
-			data->bath_acrosstrack[i] = store->bath_acrosstrack[i];
-			data->bath_alongtrack[i] = store->bath_alongtrack[i];
-			data->tt[i] = store->tt[i] / 5;
-			data->angle[i] = store->angle[i];
-			data->quality[i] = store->quality[i];
-			data->amp[i] = store->amp[i];
-			}
-		}
-
-	/* write next data to file */
-	status = mbr_cbat9001_wr_data(verbose,mbio_ptr,data_ptr,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_cbat9001_rd_data(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_cbat9001_rd_data";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_cbat9001_struct *data;
-	char	*data_ptr;
-	FILE	*mbfp;
-	int	done;
-	int	first;
-	short *type;
-	char label[2];
-	char label_save[2];
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_cbat9001_struct *) mb_io_ptr->raw_data;
-	data_ptr = (char *) data;
-	mbfp = mb_io_ptr->mbfp;
-
-	/* set file position */
-	mb_io_ptr->file_pos = mb_io_ptr->file_bytes;
-
-	done = MB_NO;
-	type = (short *) label;
-	first = MB_YES;
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-	while (done == MB_NO)
-		{
-		if (mb_io_ptr->byteswapped == MB_NO)
-			{
-			/* get first part of next record label */
-			if ((status = fread(&label[0],1,1,mb_io_ptr->mbfp)) != 1)
-				{
-				status = MB_FAILURE;
-				*error = MB_ERROR_EOF;
-				}
-
-			/* if first part is good read second part */
-			if (status == MB_SUCCESS && label[0] == 0x02)
-				{
-				if ((status = fread(&label[1],1,1,mb_io_ptr->mbfp)) != 1)
-					{
-					status = MB_FAILURE;
-					*error = MB_ERROR_EOF;
-					}
-				}
-			}
-
-		else
-			{
-			/* byteswapped case */
-			/* get second part of next record label */
-			if ((status = fread(&label[1],1,1,mb_io_ptr->mbfp)) != 1)
-				{
-				status = MB_FAILURE;
-				*error = MB_ERROR_EOF;
-				}
-
-			/* if not first and second part looks like first
-				get other piece from last label */
-			if (status == MB_SUCCESS && first == MB_NO
-				&& label[1] == 0x02)
-				{
-				label[0] = label[1];
-				label[1] = label_save[0];
-				}
-
-			/* else get first part of next record label */
-			else if (status == MB_SUCCESS)
-				{
-				if ((status = fread(&label[0],1,1,mb_io_ptr->mbfp)) != 1)
-					{
-					status = MB_FAILURE;
-					*error = MB_ERROR_EOF;
-					}
-				}
-
-			/* save label */
-			label_save[0] = label[0];
-			label_save[1] = label[1];
-			}
-
-		/* reset first flag */
-		first = MB_NO;
-
-/*		fprintf(stderr,"\nstart of mbr_cbat9001_rd_data loop:\n");
-		fprintf(stderr,"done:%d\n",done);
-		fprintf(stderr,"type:%x\n",*type);
-		fprintf(stderr,"comment:   %x\n",RESON_COMMENT);
-		fprintf(stderr,"pos:       %x\n",RESON_NAV);
-		fprintf(stderr,"parameter: %x\n",RESON_PARAMETER);
-		fprintf(stderr,"svp:       %x\n",RESON_SVP);
-		fprintf(stderr,"bath:      %x\n",RESON_BATH_9001);
-		fprintf(stderr,"short svp: %x\n",RESON_SHORT_SVP);
-		fprintf(stderr,"status:%d\n",status);*/
-
-		/* read the appropriate data records */
-		if (status == MB_FAILURE)
-			{
-			done = MB_YES;
-			}
-		else if (*type == RESON_COMMENT)
-			{
-			status = mbr_cbat9001_rd_comment(
-				verbose,mbfp,mb_io_ptr->byteswapped,data,error);
-			if (status == MB_SUCCESS)
-				{
-				done = MB_YES;
-				data->kind = MB_DATA_COMMENT;
-				}
-			}
-		else if (*type == RESON_PARAMETER)
-			{
-			status = mbr_cbat9001_rd_parameter(
-				verbose,mbfp,mb_io_ptr->byteswapped,data,error);
-			if (status == MB_SUCCESS)
-				{
-				done = MB_YES;
-				data->kind = MB_DATA_PARAMETER;
-				}
-			}
-		else if (*type == RESON_NAV)
-			{
-			status = mbr_cbat9001_rd_nav(
-				verbose,mbfp,mb_io_ptr->byteswapped,data,error);
-			if (status == MB_SUCCESS)
-				{
-				done = MB_YES;
-				data->kind = MB_DATA_NAV;
-				}
-			}
-		else if (*type == RESON_SVP)
-			{
-			status = mbr_cbat9001_rd_svp(
-				verbose,mbfp,mb_io_ptr->byteswapped,data,error);
-			if (status == MB_SUCCESS)
-				{
-				done = MB_YES;
-				data->kind = MB_DATA_VELOCITY_PROFILE;
-				}
-			}
-		else if (*type == RESON_BATH_9001)
-			{
-			status = mbr_cbat9001_rd_bath(
-				verbose,mbfp,mb_io_ptr->byteswapped,data,error);
-			if (status == MB_SUCCESS)
-				{
-				done = MB_YES;
-				data->kind = MB_DATA_DATA;
-				}
-			}
-		else if (*type == RESON_SHORT_SVP)
-			{
-			status = mbr_cbat9001_rd_short_svp(
-				verbose,mbfp,mb_io_ptr->byteswapped,data,error);
-			if (status == MB_SUCCESS)
-				{
-				done = MB_YES;
-				data->kind = MB_DATA_VELOCITY_PROFILE;
-				}
-			}
-
-		/* bail out if there is an error */
-		if (status == MB_FAILURE)
-			done = MB_YES;
-
-/*		fprintf(stderr,"end of mbr_cbat9001_rd_data loop:\n");
-		fprintf(stderr,"done:%d\n",done);
-		fprintf(stderr,"type:%x\n",*type);*/
-		}
-
-	/* get file position */
-	mb_io_ptr->file_bytes = ftell(mbfp);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_cbat9001_rd_comment(int verbose, FILE *mbfp, int swap,
-		struct mbf_cbat9001_struct *data, int *error)
-{
-	char	*function_name = "mbr_cbat9001_rd_comment";
-	int	status = MB_SUCCESS;
-	char	line[RESON_COMMENT_SIZE+3];
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       data:       %p\n",(void *)data);
-		}
-
-	/* read record into char array */
-	status = fread(line,1,RESON_COMMENT_SIZE+3,mbfp);
-	if (status == RESON_COMMENT_SIZE+3)
-		status = MB_SUCCESS;
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	/* get data */
-	if (status == MB_SUCCESS)
-		{
-		data->kind = MB_DATA_COMMENT;
-		strncpy(data->comment,line,MBF_CBAT9001_COMMENT_LENGTH-1);
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       comment:          %s\n",data->comment);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_cbat9001_rd_parameter(int verbose, FILE *mbfp, int swap,
-		struct mbf_cbat9001_struct *data, int *error)
-{
-	char	*function_name = "mbr_cbat9001_rd_parameter";
-	int	status = MB_SUCCESS;
-	char	line[RESON_PARAMETER_SIZE+3];
-	short *short_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       data:       %p\n",(void *)data);
-		}
-
-	/* read record into char array */
-	status = fread(line,1,RESON_PARAMETER_SIZE+3,mbfp);
-	if (status == RESON_PARAMETER_SIZE+3)
-		status = MB_SUCCESS;
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	/* get data */
-	if (status == MB_SUCCESS)
-		{
-		data->kind = MB_DATA_PARAMETER;
-		data->par_day =            (int) line[0];
-		data->par_month =          (int) line[1];
-		data->par_year =           (int) line[2];
-		data->par_hour =           (int) line[3];
-		data->par_minute =         (int) line[4];
-		data->par_second =         (int) line[5];
-		data->par_hundredth_sec =  (int) line[6];
-		data->par_thousandth_sec = (int) line[7];
-		if (swap == MB_NO)
-			{
-			short_ptr = (short *) &line[8];
-			data->roll_offset = *short_ptr;
-			short_ptr = (short *) &line[10];
-			data->pitch_offset = *short_ptr;
-			short_ptr = (short *) &line[12];
-			data->heading_offset = *short_ptr;
-			short_ptr = (short *) &line[14];
-			data->time_delay = *short_ptr;
-			short_ptr = (short *) &line[16];
-			data->transducer_depth = *short_ptr;
-			short_ptr = (short *) &line[18];
-			data->transducer_height = *short_ptr;
-			short_ptr = (short *) &line[20];
-			data->transducer_x = *short_ptr;
-			short_ptr = (short *) &line[22];
-			data->transducer_y = *short_ptr;
-			short_ptr = (short *) &line[24];
-			data->antenna_z = *short_ptr;
-			short_ptr = (short *) &line[26];
-			data->antenna_x = *short_ptr;
-			short_ptr = (short *) &line[28];
-			data->antenna_y = *short_ptr;
-			short_ptr = (short *) &line[30];
-			data->motion_sensor_x = *short_ptr;
-			short_ptr = (short *) &line[32];
-			data->motion_sensor_y = *short_ptr;
-			short_ptr = (short *) &line[34];
-			data->motion_sensor_z = *short_ptr;
-			short_ptr = (short *) &line[36];
-			data->spare = *short_ptr;
-			short_ptr = (short *) &line[38];
-			data->line_number = *short_ptr;
-			short_ptr = (short *) &line[40];
-			data->start_or_stop = *short_ptr;
-			short_ptr = (short *) &line[42];
-			data->transducer_serial_number = *short_ptr;
-			}
-		else
-			{
-			short_ptr = (short *) &line[8];
-			data->roll_offset = (short) mb_swap_short(*short_ptr);
-			short_ptr = (short *) &line[10];
-			data->pitch_offset = (short) mb_swap_short(*short_ptr);
-			short_ptr = (short *) &line[12];
-			data->heading_offset = (short) mb_swap_short(*short_ptr);
-			short_ptr = (short *) &line[14];
-			data->time_delay = (short) mb_swap_short(*short_ptr);
-			short_ptr = (short *) &line[16];
-			data->transducer_depth = (short) mb_swap_short(*short_ptr);
-			short_ptr = (short *) &line[18];
-			data->transducer_height = (short) mb_swap_short(*short_ptr);
-			short_ptr = (short *) &line[20];
-			data->transducer_x = (short) mb_swap_short(*short_ptr);
-			short_ptr = (short *) &line[22];
-			data->transducer_y = (short) mb_swap_short(*short_ptr);
-			short_ptr = (short *) &line[24];
-			data->antenna_z = (short) mb_swap_short(*short_ptr);
-			short_ptr = (short *) &line[26];
-			data->antenna_x = (short) mb_swap_short(*short_ptr);
-			short_ptr = (short *) &line[28];
-			data->antenna_y = (short) mb_swap_short(*short_ptr);
-			short_ptr = (short *) &line[30];
-			data->motion_sensor_x = (short) mb_swap_short(*short_ptr);
-			short_ptr = (short *) &line[32];
-			data->motion_sensor_y = (short) mb_swap_short(*short_ptr);
-			short_ptr = (short *) &line[34];
-			data->motion_sensor_z = (short) mb_swap_short(*short_ptr);
-			short_ptr = (short *) &line[36];
-			data->spare = (short) mb_swap_short(*short_ptr);
-			short_ptr = (short *) &line[38];
-			data->line_number = (short) mb_swap_short(*short_ptr);
-			short_ptr = (short *) &line[40];
-			data->start_or_stop = (short) mb_swap_short(*short_ptr);
-			short_ptr = (short *) &line[42];
-			data->transducer_serial_number = (short) mb_swap_short(*short_ptr);
-			}
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       year:             %d\n",data->par_year);
-		fprintf(stderr,"dbg5       month:            %d\n",data->par_month);
-		fprintf(stderr,"dbg5       day:              %d\n",data->par_day);
-		fprintf(stderr,"dbg5       hour:             %d\n",data->par_hour);
-		fprintf(stderr,"dbg5       minute:           %d\n",data->par_minute);
-		fprintf(stderr,"dbg5       sec:              %d\n",data->par_second);
-		fprintf(stderr,"dbg5       hundredth_sec:    %d\n",data->par_hundredth_sec);
-		fprintf(stderr,"dbg5       thousandth_sec:   %d\n",data->par_thousandth_sec);
-		fprintf(stderr,"dbg5       roll_offset:      %d\n",data->roll_offset);
-		fprintf(stderr,"dbg5       pitch_offset:     %d\n",data->pitch_offset);
-		fprintf(stderr,"dbg5       heading_offset:   %d\n",data->heading_offset);
-		fprintf(stderr,"dbg5       time_delay:       %d\n",data->time_delay);
-		fprintf(stderr,"dbg5       transducer_depth: %d\n",data->transducer_depth);
-		fprintf(stderr,"dbg5       transducer_height:%d\n",data->transducer_height);
-		fprintf(stderr,"dbg5       transducer_x:     %d\n",data->transducer_x);
-		fprintf(stderr,"dbg5       transducer_y:     %d\n",data->transducer_y);
-		fprintf(stderr,"dbg5       antenna_x:        %d\n",data->antenna_x);
-		fprintf(stderr,"dbg5       antenna_y:        %d\n",data->antenna_y);
-		fprintf(stderr,"dbg5       antenna_z:        %d\n",data->antenna_z);
-		fprintf(stderr,"dbg5       motion_sensor_x:  %d\n",data->motion_sensor_x);
-		fprintf(stderr,"dbg5       motion_sensor_y:  %d\n",data->motion_sensor_y);
-		fprintf(stderr,"dbg5       motion_sensor_z:  %d\n",data->motion_sensor_z);
-		fprintf(stderr,"dbg5       spare:            %d\n",data->spare);
-		fprintf(stderr,"dbg5       line_number:      %d\n",data->line_number);
-		fprintf(stderr,"dbg5       start_or_stop:    %d\n",data->start_or_stop);
-		fprintf(stderr,"dbg5       xducer_serial_num:%d\n",
-				data->transducer_serial_number);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_cbat9001_rd_nav(int verbose, FILE *mbfp, int swap,
-		struct mbf_cbat9001_struct *data, int *error)
-{
-	char	*function_name = "mbr_cbat9001_rd_nav";
-	int	status = MB_SUCCESS;
-	char	line[RESON_NAV_SIZE+3];
-	short *short_ptr;
-	int	*int_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       data:       %p\n",(void *)data);
-		}
-
-	/* read record into char array */
-	status = fread(line,1,RESON_NAV_SIZE+3,mbfp);
-	if (status == RESON_NAV_SIZE+3)
-		status = MB_SUCCESS;
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	/* get data */
-	if (status == MB_SUCCESS)
-		{
-		data->kind = MB_DATA_NAV;
-		data->pos_day =            (int) line[0];
-		data->pos_month =          (int) line[1];
-		data->pos_year =           (int) line[2];
-		data->pos_hour =           (int) line[3];
-		data->pos_minute =         (int) line[4];
-		data->pos_second =         (int) line[5];
-		data->pos_hundredth_sec =  (int) line[6];
-		data->pos_thousandth_sec = (int) line[7];
-		if (swap == MB_NO)
-			{
-			int_ptr = (int *) &line[8];
-			data->pos_latitude = *int_ptr;
-			int_ptr = (int *) &line[12];
-			data->pos_longitude = *int_ptr;
-			int_ptr = (int *) &line[16];
-			data->utm_northing = *int_ptr;
-			int_ptr = (int *) &line[20];
-			data->utm_easting = *int_ptr;
-			int_ptr = (int *) &line[24];
-			data->utm_zone_lon = *int_ptr;
-			data->utm_zone = line[28];
-			data->hemisphere = line[29];
-			data->ellipsoid = line[30];
-			data->pos_spare = line[31];
-			short_ptr = (short *) &line[32];
-			data->semi_major_axis = (int) *short_ptr;
-			short_ptr = (short *) &line[34];
-			data->other_quality = (int) *short_ptr;
-			}
-		else
-			{
-			int_ptr = (int *) &line[8];
-			data->pos_latitude = (int) mb_swap_int(*int_ptr);
-			int_ptr = (int *) &line[12];
-			data->pos_longitude = (int) mb_swap_int(*int_ptr);
-			int_ptr = (int *) &line[16];
-			data->utm_northing = (int) mb_swap_int(*int_ptr);
-			int_ptr = (int *) &line[20];
-			data->utm_easting = (int) mb_swap_int(*int_ptr);
-			int_ptr = (int *) &line[24];
-			data->utm_zone_lon = (int) mb_swap_int(*int_ptr);
-			data->utm_zone = line[28];
-			data->hemisphere = line[29];
-			data->ellipsoid = line[30];
-			data->pos_spare = line[31];
-			short_ptr = (short *) &line[32];
-			data->semi_major_axis = (int) mb_swap_short(*short_ptr);
-			short_ptr = (short *) &line[34];
-			data->other_quality = (int) mb_swap_short(*short_ptr);
-			}
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       year:             %d\n",data->pos_year);
-		fprintf(stderr,"dbg5       month:            %d\n",data->pos_month);
-		fprintf(stderr,"dbg5       day:              %d\n",data->pos_day);
-		fprintf(stderr,"dbg5       hour:             %d\n",data->pos_hour);
-		fprintf(stderr,"dbg5       minute:           %d\n",data->pos_minute);
-		fprintf(stderr,"dbg5       sec:              %d\n",data->pos_second);
-		fprintf(stderr,"dbg5       hundredth_sec:    %d\n",data->pos_hundredth_sec);
-		fprintf(stderr,"dbg5       thousandth_sec:   %d\n",data->pos_thousandth_sec);
-		fprintf(stderr,"dbg5       pos_latitude:     %d\n",data->pos_latitude);
-		fprintf(stderr,"dbg5       pos_longitude:    %d\n",data->pos_longitude);
-		fprintf(stderr,"dbg5       utm_northing:     %d\n",data->utm_northing);
-		fprintf(stderr,"dbg5       utm_easting:      %d\n",data->utm_easting);
-		fprintf(stderr,"dbg5       utm_zone_lon:     %d\n",data->utm_zone_lon);
-		fprintf(stderr,"dbg5       utm_zone:         %c\n",data->utm_zone);
-		fprintf(stderr,"dbg5       hemisphere:       %c\n",data->hemisphere);
-		fprintf(stderr,"dbg5       ellipsoid:        %c\n",data->ellipsoid);
-		fprintf(stderr,"dbg5       pos_spare:        %c\n",data->pos_spare);
-		fprintf(stderr,"dbg5       semi_major_axis:  %d\n",data->semi_major_axis);
-		fprintf(stderr,"dbg5       other_quality:    %d\n",data->other_quality);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_cbat9001_rd_svp(int verbose, FILE *mbfp, int swap,
-		struct mbf_cbat9001_struct *data, int *error)
-{
-	char	*function_name = "mbr_cbat9001_rd_svp";
-	int	status = MB_SUCCESS;
-	char	line[RESON_SVP_SIZE+3];
-	short *short_ptr;
-	short *short_ptr2;
-	int	*int_ptr;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       data:       %p\n",(void *)data);
-		}
-
-	/* read record into char array */
-	status = fread(line,1,RESON_SVP_SIZE+3,mbfp);
-	if (status == RESON_SVP_SIZE+3)
-		status = MB_SUCCESS;
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	/* get data */
-	if (status == MB_SUCCESS)
-		{
-		data->kind = MB_DATA_VELOCITY_PROFILE;
-		data->svp_day =            (int) line[0];
-		data->svp_month =          (int) line[1];
-		data->svp_year =           (int) line[2];
-		data->svp_hour =           (int) line[3];
-		data->svp_minute =         (int) line[4];
-		data->svp_second =         (int) line[5];
-		data->svp_hundredth_sec =  (int) line[6];
-		data->svp_thousandth_sec = (int) line[7];
-		if (swap == MB_NO)
-			{
-			int_ptr = (int *) &line[8];
-			data->svp_latitude = *int_ptr;
-			int_ptr = (int *) &line[12];
-			data->svp_longitude = *int_ptr;
-			}
-		else
-			{
-			int_ptr = (int *) &line[8];
-			data->svp_latitude = (int) mb_swap_int(*int_ptr);
-			int_ptr = (int *) &line[12];
-			data->svp_latitude = (int) mb_swap_int(*int_ptr);
-			}
-		data->svp_num = 0;
-		for (i=0;i<500;i++)
-			{
-			short_ptr = (short *) &line[16+4*i];
-			short_ptr2 = (short *) &line[18+4*i];
-			if (swap == MB_NO)
-				{
-				data->svp_depth[i] = *short_ptr;
-				data->svp_vel[i] = *short_ptr2;
-				}
-			else
-				{
-				data->svp_depth[i] = (short) mb_swap_short(*short_ptr);
-				data->svp_vel[i] = (short) mb_swap_short(*short_ptr2);
-				}
-			if (data->svp_vel[i] > 0) data->svp_num = i + 1;
-			}
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       year:             %d\n",data->svp_year);
-		fprintf(stderr,"dbg5       month:            %d\n",data->svp_month);
-		fprintf(stderr,"dbg5       day:              %d\n",data->svp_day);
-		fprintf(stderr,"dbg5       hour:             %d\n",data->svp_hour);
-		fprintf(stderr,"dbg5       minute:           %d\n",data->svp_minute);
-		fprintf(stderr,"dbg5       sec:              %d\n",data->svp_second);
-		fprintf(stderr,"dbg5       hundredth_sec:    %d\n",data->svp_hundredth_sec);
-		fprintf(stderr,"dbg5       thousandth_sec:   %d\n",data->svp_thousandth_sec);
-		fprintf(stderr,"dbg5       svp_latitude:     %d\n",data->svp_latitude);
-		fprintf(stderr,"dbg5       svp_longitude:    %d\n",data->svp_longitude);
-		fprintf(stderr,"dbg5       svp_num:          %d\n",data->svp_num);
-		for (i=0;i<data->svp_num;i++)
-			fprintf(stderr,"dbg5       depth: %d     vel: %d\n",
-				data->svp_depth[i],data->svp_vel[i]);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_cbat9001_rd_short_svp(int verbose, FILE *mbfp, int swap,
-		struct mbf_cbat9001_struct *data, int *error)
-{
-	char	*function_name = "mbr_cbat9001_rd_svp";
-	int	status = MB_SUCCESS;
-	char	line[RESON_SHORT_SVP_SIZE+3];
-	short *short_ptr;
-	short *short_ptr2;
-	int	*int_ptr;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       data:       %p\n",(void *)data);
-		}
-
-	/* read record into char array */
-	status = fread(line,1,RESON_SHORT_SVP_SIZE+3,mbfp);
-	if (status == RESON_SHORT_SVP_SIZE+3)
-		status = MB_SUCCESS;
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	/* get data */
-	if (status == MB_SUCCESS)
-		{
-		data->kind = MB_DATA_VELOCITY_PROFILE;
-		data->svp_day =            (int) line[0];
-		data->svp_month =          (int) line[1];
-		data->svp_year =           (int) line[2];
-		data->svp_hour =           (int) line[3];
-		data->svp_minute =         (int) line[4];
-		data->svp_second =         (int) line[5];
-		data->svp_hundredth_sec =  (int) line[6];
-		data->svp_thousandth_sec = (int) line[7];
-		if (swap == MB_NO)
-			{
-			int_ptr = (int *) &line[8];
-			data->svp_latitude = *int_ptr;
-			int_ptr = (int *) &line[12];
-			data->svp_longitude = *int_ptr;
-			}
-		else
-			{
-			int_ptr = (int *) &line[8];
-			data->svp_latitude = (int) mb_swap_int(*int_ptr);
-			int_ptr = (int *) &line[12];
-			data->svp_latitude = (int) mb_swap_int(*int_ptr);
-			}
-		data->svp_num = 0;
-		for (i=0;i<200;i++)
-			{
-			short_ptr = (short *) &line[16+4*i];
-			short_ptr2 = (short *) &line[18+4*i];
-			if (swap == MB_NO)
-				{
-				data->svp_depth[i] = *short_ptr;
-				data->svp_vel[i] = *short_ptr2;
-				}
-			else
-				{
-				data->svp_depth[i] = (short) mb_swap_short(*short_ptr);
-				data->svp_vel[i] = (short) mb_swap_short(*short_ptr2);
-				}
-			if (data->svp_vel[i] > 0) data->svp_num = i + 1;
-			}
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       year:             %d\n",data->svp_year);
-		fprintf(stderr,"dbg5       month:            %d\n",data->svp_month);
-		fprintf(stderr,"dbg5       day:              %d\n",data->svp_day);
-		fprintf(stderr,"dbg5       hour:             %d\n",data->svp_hour);
-		fprintf(stderr,"dbg5       minute:           %d\n",data->svp_minute);
-		fprintf(stderr,"dbg5       sec:              %d\n",data->svp_second);
-		fprintf(stderr,"dbg5       hundredth_sec:    %d\n",data->svp_hundredth_sec);
-		fprintf(stderr,"dbg5       thousandth_sec:   %d\n",data->svp_thousandth_sec);
-		fprintf(stderr,"dbg5       svp_latitude:     %d\n",data->svp_latitude);
-		fprintf(stderr,"dbg5       svp_longitude:    %d\n",data->svp_longitude);
-		fprintf(stderr,"dbg5       svp_num:          %d\n",data->svp_num);
-		for (i=0;i<data->svp_num;i++)
-			fprintf(stderr,"dbg5       depth: %d     vel: %d\n",
-				data->svp_depth[i],data->svp_vel[i]);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_cbat9001_rd_bath(int verbose, FILE *mbfp, int swap,
-		struct mbf_cbat9001_struct *data, int *error)
-{
-	char	*function_name = "mbr_cbat9001_rd_bath";
-	int	status = MB_SUCCESS;
-	char	line[RESON_BATH_9001_SIZE+3];
-	char	*beamarray;
-	unsigned char *char_ptr;
-	short *short_ptr;
-	int	*int_ptr;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       data:       %p\n",(void *)data);
-		}
-
-	/* read record into char array */
-	status = fread(line,1,RESON_BATH_9001_SIZE+3,mbfp);
-	if (status == RESON_BATH_9001_SIZE+3)
-		status = MB_SUCCESS;
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	/* get data */
-	if (status == MB_SUCCESS)
-		{
-		data->kind = MB_DATA_DATA;
-		data->day =            (int) line[0];
-		data->month =          (int) line[1];
-		data->year =           (int) line[2];
-		data->hour =           (int) line[3];
-		data->minute =         (int) line[4];
-		data->second =         (int) line[5];
-		data->hundredth_sec =  (int) line[6];
-		data->thousandth_sec = (int) line[7];
-		if (swap == MB_NO)
-			{
-			int_ptr = (int *) &line[8];
-			data->latitude = *int_ptr;
-			int_ptr = (int *) &line[12];
-			data->longitude = *int_ptr;
-			short_ptr = (short *) &line[16];
-			data->roll = (int) *short_ptr;
-			short_ptr = (short *) &line[18];
-			data->pitch = (int) *short_ptr;
-			short_ptr = (short *) &line[20];
-			data->heading = (unsigned short) *short_ptr;
-			short_ptr = (short *) &line[22];
-			data->heave = (int) *short_ptr;
-			short_ptr = (short *) &line[24];
-			data->ping_number = (int) *short_ptr;
-			short_ptr = (short *) &line[26];
-			data->sound_vel = (int) *short_ptr;
-			}
-		else
-			{
-			int_ptr = (int *) &line[8];
-			data->latitude = (int) mb_swap_int(*int_ptr);
-			int_ptr = (int *) &line[12];
-			data->latitude = (int) mb_swap_int(*int_ptr);
-			short_ptr = (short *) &line[16];
-			data->roll = (int) mb_swap_short(*short_ptr);
-			short_ptr = (short *) &line[18];
-			data->pitch = (int) mb_swap_short(*short_ptr);
-			short_ptr = (short *) &line[20];
-			data->heading = (unsigned short) mb_swap_short(*short_ptr);
-			short_ptr = (short *) &line[22];
-			data->heave = (int) mb_swap_short(*short_ptr);
-			short_ptr = (short *) &line[24];
-			data->ping_number = (int) mb_swap_short(*short_ptr);
-			short_ptr = (short *) &line[26];
-			data->sound_vel = (int) mb_swap_short(*short_ptr);
-			}
-		data->mode = (int) line[28];
-		data->gain1 = (int) line[29];
-		data->gain2 = (int) line[30];
-		data->gain3 = (int) line[31];
-		data->beams_bath = MBF_CBAT9001_MAXBEAMS;
-		if (swap == MB_NO)
-			{
-			for (i=0;i<data->beams_bath;i++)
-				{
-				beamarray = line + 32 + 12*i;
-				short_ptr = (short *) beamarray;
-				data->bath[i] = *short_ptr;
-				short_ptr = ((short *) beamarray) + 1;
-				data->bath_acrosstrack[i] = *short_ptr;
-				short_ptr = ((short *) beamarray) + 2;
-				data->bath_alongtrack[i] = *short_ptr;
-				short_ptr = ((short *) beamarray) + 3;
-				data->tt[i] = *short_ptr;
-				short_ptr = ((short *) beamarray) + 4;
-				data->angle[i] = *short_ptr;
-				char_ptr = (unsigned char *) (beamarray + 10);
-				data->quality[i] = (short) *char_ptr;
-				char_ptr = (unsigned char *) (beamarray + 11);
-				data->amp[i] = (short) *char_ptr;
-				}
-			}
-		else
-			{
-			for (i=0;i<data->beams_bath;i++)
-				{
-				beamarray = line + 32 + 12*i;
-				short_ptr = (short *) beamarray;
-				data->bath[i] =
-					(short) mb_swap_short(*short_ptr);
-				short_ptr = ((short *) beamarray) + 1;
-				data->bath_acrosstrack[i] =
-					(short) mb_swap_short(*short_ptr);
-				short_ptr = ((short *) beamarray) + 2;
-				data->bath_alongtrack[i] =
-					(short) mb_swap_short(*short_ptr);
-				short_ptr = ((short *) beamarray) + 3;
-				data->tt[i] = (short) mb_swap_short(*short_ptr);
-				short_ptr = ((short *) beamarray) + 4;
-				data->angle[i] = (short) mb_swap_short(*short_ptr);
-				char_ptr = (unsigned char *) (beamarray + 10);
-				data->quality[i] = (short) *char_ptr;
-				char_ptr = (unsigned char *) (beamarray + 11);
-				data->amp[i] = (short) *char_ptr;
-				}
-			}
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       year:             %d\n",data->year);
-		fprintf(stderr,"dbg5       month:            %d\n",data->month);
-		fprintf(stderr,"dbg5       day:              %d\n",data->day);
-		fprintf(stderr,"dbg5       hour:             %d\n",data->hour);
-		fprintf(stderr,"dbg5       minute:           %d\n",data->minute);
-		fprintf(stderr,"dbg5       sec:              %d\n",data->second);
-		fprintf(stderr,"dbg5       hundredth_sec:    %d\n",data->hundredth_sec);
-		fprintf(stderr,"dbg5       thousandth_sec:   %d\n",data->thousandth_sec);
-		fprintf(stderr,"dbg5       latitude:         %d\n",data->latitude);
-		fprintf(stderr,"dbg5       longitude:        %d\n",data->longitude);
-		fprintf(stderr,"dbg5       roll:             %d\n",data->roll);
-		fprintf(stderr,"dbg5       pitch:            %d\n",data->pitch);
-		fprintf(stderr,"dbg5       heading:          %d\n",data->heading);
-		fprintf(stderr,"dbg5       heave:            %d\n",data->heave);
-		fprintf(stderr,"dbg5       ping_number:      %d\n",data->ping_number);
-		fprintf(stderr,"dbg5       sound_vel:        %d\n",data->sound_vel);
-		fprintf(stderr,"dbg5       mode:             %d\n",data->mode);
-		fprintf(stderr,"dbg5       gain1:            %d\n",data->gain1);
-		fprintf(stderr,"dbg5       gain2:            %d\n",data->gain2);
-		fprintf(stderr,"dbg5       gain3:            %d\n",data->gain3);
-		fprintf(stderr,"dbg5       beams_bath:       %d\n",data->beams_bath);
-		fprintf(stderr,"dbg5       beam bath xtrack ltrack tt amp qual heave\n");
-		for (i=0;i<data->beams_bath;i++)
-			fprintf(stderr,"dbg5       beam:%d  bath:%d  xtrck:%d  ltrck:%d tt:%d  angle:%d amp:%d  qual:%d\n",
-				i,data->bath[i],data->bath_acrosstrack[i],
-				data->bath_alongtrack[i],data->tt[i],
-				data->angle[i],data->amp[i],data->quality[i]);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_cbat9001_wr_data(int verbose, void *mbio_ptr, void *data_ptr, int *error)
-{
-	char	*function_name = "mbr_cbat9001_wr_data";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_cbat9001_struct *data;
-	FILE	*mbfp;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       data_ptr:   %p\n",(void *)data_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_cbat9001_struct *) data_ptr;
-	mbfp = mb_io_ptr->mbfp;
-
-	if (data->kind == MB_DATA_COMMENT)
-		{
-		status = mbr_cbat9001_wr_comment(verbose,mbfp,mb_io_ptr->byteswapped,data_ptr,error);
-		}
-	else if (data->kind == MB_DATA_PARAMETER)
-		{
-		status = mbr_cbat9001_wr_parameter(verbose,mbfp,mb_io_ptr->byteswapped,data_ptr,error);
-		}
-	else if (data->kind == MB_DATA_NAV)
-		{
-		status = mbr_cbat9001_wr_nav(verbose,mbfp,mb_io_ptr->byteswapped,data_ptr,error);
-		}
-	else if (data->kind == MB_DATA_VELOCITY_PROFILE)
-		{
-		status = mbr_cbat9001_wr_svp(verbose,mbfp,mb_io_ptr->byteswapped,data_ptr,error);
-		}
-	else if (data->kind == MB_DATA_DATA)
-		{
-		status = mbr_cbat9001_wr_bath(verbose,mbfp,mb_io_ptr->byteswapped,data_ptr,error);
-		}
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_BAD_KIND;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Data record kind in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       kind:       %d\n",data->kind);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_cbat9001_wr_comment(int verbose, FILE *mbfp, int swap, void *data_ptr, int *error)
-{
-	char	*function_name = "mbr_cbat9001_wr_comment";
-	int	status = MB_SUCCESS;
-	struct mbf_cbat9001_struct *data;
-	char	line[RESON_COMMENT_SIZE+3];
-	short label;
-	int	len;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       data_ptr:   %p\n",(void *)data_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_cbat9001_struct *) data_ptr;
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       comment:          %s\n",data->comment);
-		}
-
-	/* write the record label */
-	label = RESON_COMMENT;
-	if (swap == MB_YES)
-		label = (short) mb_swap_short(label);
-	status = fwrite(&label,1,2,mbfp);
-	if (status != 2)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	else
-		status = MB_SUCCESS;
-
-	/* write out the data */
-	if (status == MB_SUCCESS)
-		{
-		/* construct record */
-		len = strlen(data->comment);
-		if (len > MBF_CBAT9001_COMMENT_LENGTH)
-			len = MBF_CBAT9001_COMMENT_LENGTH;
-		for (i=0;i<len;i++)
-			line[i] = data->comment[i];
-		for (i=len;i<MBF_CBAT9001_COMMENT_LENGTH;i++)
-			line[i] = '\0';
-		line[RESON_COMMENT_SIZE] = 0x03;
-		line[RESON_COMMENT_SIZE+1] = '\0';
-		line[RESON_COMMENT_SIZE+2] = '\0';
-
-		/* write out data */
-		status = fwrite(line,1,RESON_COMMENT_SIZE+3,mbfp);
-		if (status != RESON_COMMENT_SIZE+3)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_cbat9001_wr_parameter(int verbose, FILE *mbfp, int swap, void *data_ptr, int *error)
-{
-	char	*function_name = "mbr_cbat9001_wr_parameter";
-	int	status = MB_SUCCESS;
-	struct mbf_cbat9001_struct *data;
-	char	line[RESON_PARAMETER_SIZE+3];
-	short label;
-	short *short_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       data_ptr:   %p\n",(void *)data_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_cbat9001_struct *) data_ptr;
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       year:             %d\n",data->par_year);
-		fprintf(stderr,"dbg5       month:            %d\n",data->par_month);
-		fprintf(stderr,"dbg5       day:              %d\n",data->par_day);
-		fprintf(stderr,"dbg5       hour:             %d\n",data->par_hour);
-		fprintf(stderr,"dbg5       minute:           %d\n",data->par_minute);
-		fprintf(stderr,"dbg5       sec:              %d\n",data->par_second);
-		fprintf(stderr,"dbg5       hundredth_sec:    %d\n",data->par_hundredth_sec);
-		fprintf(stderr,"dbg5       thousandth_sec:   %d\n",data->par_thousandth_sec);
-		fprintf(stderr,"dbg5       roll_offset:      %d\n",data->roll_offset);
-		fprintf(stderr,"dbg5       pitch_offset:     %d\n",data->pitch_offset);
-		fprintf(stderr,"dbg5       heading_offset:   %d\n",data->heading_offset);
-		fprintf(stderr,"dbg5       time_delay:       %d\n",data->time_delay);
-		fprintf(stderr,"dbg5       transducer_depth: %d\n",data->transducer_depth);
-		fprintf(stderr,"dbg5       transducer_height:%d\n",data->transducer_height);
-		fprintf(stderr,"dbg5       transducer_x:     %d\n",data->transducer_x);
-		fprintf(stderr,"dbg5       transducer_y:     %d\n",data->transducer_y);
-		fprintf(stderr,"dbg5       antenna_x:        %d\n",data->antenna_x);
-		fprintf(stderr,"dbg5       antenna_y:        %d\n",data->antenna_y);
-		fprintf(stderr,"dbg5       antenna_z:        %d\n",data->antenna_z);
-		fprintf(stderr,"dbg5       motion_sensor_x:  %d\n",data->motion_sensor_x);
-		fprintf(stderr,"dbg5       motion_sensor_y:  %d\n",data->motion_sensor_y);
-		fprintf(stderr,"dbg5       motion_sensor_z:  %d\n",data->motion_sensor_z);
-		fprintf(stderr,"dbg5       spare:            %d\n",data->spare);
-		fprintf(stderr,"dbg5       line_number:      %d\n",data->line_number);
-		fprintf(stderr,"dbg5       start_or_stop:    %d\n",data->start_or_stop);
-		fprintf(stderr,"dbg5       xducer_serial_num:%d\n",
-				data->transducer_serial_number);
-		}
-
-	/* write the record label */
-	label = RESON_PARAMETER;
-	if (swap == MB_YES)
-		label = (short) mb_swap_short(label);
-	status = fwrite(&label,1,2,mbfp);
-	if (status != 2)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	else
-		status = MB_SUCCESS;
-
-	/* write out the data */
-	if (status == MB_SUCCESS)
-		{
-		/* construct record */
-		line[0] = (char) data->par_day;
-		line[1] = (char) data->par_month;
-		line[2] = (char) data->par_year;
-		line[3] = (char) data->par_hour;
-		line[4] = (char) data->par_minute;
-		line[5] = (char) data->par_second;
-		line[6] = (char) data->par_hundredth_sec;
-		line[7] = (char) data->par_thousandth_sec;
-		if (swap == MB_NO)
-			{
-			short_ptr = (short *) &line[8];
-			*short_ptr = data->roll_offset;
-			short_ptr = (short *) &line[10];
-			*short_ptr = data->pitch_offset;
-			short_ptr = (short *) &line[12];
-			*short_ptr = data->heading_offset;
-			short_ptr = (short *) &line[14];
-			*short_ptr = data->time_delay;
-			short_ptr = (short *) &line[16];
-			*short_ptr = data->transducer_depth;
-			short_ptr = (short *) &line[18];
-			*short_ptr = data->transducer_height;
-			short_ptr = (short *) &line[20];
-			*short_ptr = data->transducer_x;
-			short_ptr = (short *) &line[22];
-			*short_ptr = data->transducer_y;
-			short_ptr = (short *) &line[24];
-			*short_ptr = data->antenna_z;
-			short_ptr = (short *) &line[26];
-			*short_ptr = data->antenna_x;
-			short_ptr = (short *) &line[28];
-			*short_ptr = data->antenna_y;
-			short_ptr = (short *) &line[30];
-			*short_ptr = data->motion_sensor_x;
-			short_ptr = (short *) &line[32];
-			*short_ptr = data->motion_sensor_y;
-			short_ptr = (short *) &line[34];
-			*short_ptr = data->motion_sensor_z;
-			short_ptr = (short *) &line[36];
-			*short_ptr = data->spare;
-			short_ptr = (short *) &line[38];
-			*short_ptr = data->line_number;
-			short_ptr = (short *) &line[40];
-			*short_ptr = data->start_or_stop;
-			short_ptr = (short *) &line[42];
-			*short_ptr = data->transducer_serial_number;
-			}
-		else
-			{
-			short_ptr = (short *) &line[8];
-			*short_ptr = (short) mb_swap_short(data->roll_offset);
-			short_ptr = (short *) &line[10];
-			*short_ptr = (short) mb_swap_short(data->pitch_offset);
-			short_ptr = (short *) &line[12];
-			*short_ptr = (short) mb_swap_short(data->heading_offset);
-			short_ptr = (short *) &line[14];
-			*short_ptr = (short) mb_swap_short(data->time_delay);
-			short_ptr = (short *) &line[16];
-			*short_ptr = (short) mb_swap_short(data->transducer_depth);
-			short_ptr = (short *) &line[18];
-			*short_ptr = (short) mb_swap_short(data->transducer_height);
-			short_ptr = (short *) &line[20];
-			*short_ptr = (short) mb_swap_short(data->transducer_x);
-			short_ptr = (short *) &line[22];
-			*short_ptr = (short) mb_swap_short(data->transducer_y);
-			short_ptr = (short *) &line[24];
-			*short_ptr = (short) mb_swap_short(data->antenna_z);
-			short_ptr = (short *) &line[26];
-			*short_ptr = (short) mb_swap_short(data->antenna_x);
-			short_ptr = (short *) &line[28];
-			*short_ptr = (short) mb_swap_short(data->antenna_y);
-			short_ptr = (short *) &line[30];
-			*short_ptr = (short) mb_swap_short(data->motion_sensor_x);
-			short_ptr = (short *) &line[32];
-			*short_ptr = (short) mb_swap_short(data->motion_sensor_y);
-			short_ptr = (short *) &line[34];
-			*short_ptr = (short) mb_swap_short(data->motion_sensor_z);
-			short_ptr = (short *) &line[36];
-			*short_ptr = (short) mb_swap_short(data->spare);
-			short_ptr = (short *) &line[38];
-			*short_ptr = (short) mb_swap_short(data->line_number);
-			short_ptr = (short *) &line[40];
-			*short_ptr = (short) mb_swap_short(data->start_or_stop);
-			short_ptr = (short *) &line[42];
-			*short_ptr = (short) mb_swap_short(data->transducer_serial_number);
-			}
-		line[RESON_PARAMETER_SIZE] = 0x03;
-		line[RESON_PARAMETER_SIZE+1] = '\0';
-		line[RESON_PARAMETER_SIZE+2] = '\0';
-
-		/* write out data */
-		status = fwrite(line,1,RESON_PARAMETER_SIZE+3,mbfp);
-		if (status != RESON_PARAMETER_SIZE+3)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_cbat9001_wr_nav(int verbose, FILE *mbfp, int swap, void *data_ptr, int *error)
-{
-	char	*function_name = "mbr_cbat9001_wr_nav";
-	int	status = MB_SUCCESS;
-	struct mbf_cbat9001_struct *data;
-	char	line[RESON_NAV_SIZE+3];
-	short label;
-	short *short_ptr;
-	int	*int_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       data_ptr:   %p\n",(void *)data_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_cbat9001_struct *) data_ptr;
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       year:             %d\n",data->pos_year);
-		fprintf(stderr,"dbg5       month:            %d\n",data->pos_month);
-		fprintf(stderr,"dbg5       day:              %d\n",data->pos_day);
-		fprintf(stderr,"dbg5       hour:             %d\n",data->pos_hour);
-		fprintf(stderr,"dbg5       minute:           %d\n",data->pos_minute);
-		fprintf(stderr,"dbg5       sec:              %d\n",data->pos_second);
-		fprintf(stderr,"dbg5       hundredth_sec:    %d\n",data->pos_hundredth_sec);
-		fprintf(stderr,"dbg5       thousandth_sec:   %d\n",data->pos_thousandth_sec);
-		fprintf(stderr,"dbg5       pos_latitude:     %d\n",data->pos_latitude);
-		fprintf(stderr,"dbg5       pos_longitude:    %d\n",data->pos_longitude);
-		fprintf(stderr,"dbg5       utm_northing:     %d\n",data->utm_northing);
-		fprintf(stderr,"dbg5       utm_easting:      %d\n",data->utm_easting);
-		fprintf(stderr,"dbg5       utm_zone_lon:     %d\n",data->utm_zone_lon);
-		fprintf(stderr,"dbg5       utm_zone:         %c\n",data->utm_zone);
-		fprintf(stderr,"dbg5       hemisphere:       %c\n",data->hemisphere);
-		fprintf(stderr,"dbg5       ellipsoid:        %c\n",data->ellipsoid);
-		fprintf(stderr,"dbg5       pos_spare:        %c\n",data->pos_spare);
-		fprintf(stderr,"dbg5       semi_major_axis:  %d\n",data->semi_major_axis);
-		fprintf(stderr,"dbg5       other_quality:    %d\n",data->other_quality);
-		}
-
-	/* write the record label */
-	label = RESON_NAV;
-	if (swap == MB_YES)
-		label = (short) mb_swap_short(label);
-	status = fwrite(&label,1,2,mbfp);
-	if (status != 2)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	else
-		status = MB_SUCCESS;
-
-	/* write out the data */
-	if (status == MB_SUCCESS)
-		{
-		/* construct record */
-		line[0] = (char) data->pos_day;
-		line[1] = (char) data->pos_month;
-		line[2] = (char) data->pos_year;
-		line[3] = (char) data->pos_hour;
-		line[4] = (char) data->pos_minute;
-		line[5] = (char) data->pos_second;
-		line[6] = (char) data->pos_hundredth_sec;
-		line[7] = (char) data->pos_thousandth_sec;
-		if (swap == MB_NO)
-			{
-			int_ptr = (int *) &line[8];
-			*int_ptr = data->pos_latitude;
-			int_ptr = (int *) &line[12];
-			*int_ptr = data->pos_longitude;
-			int_ptr = (int *) &line[16];
-			*int_ptr = data->utm_northing;
-			int_ptr = (int *) &line[20];
-			*int_ptr = data->utm_easting;
-			int_ptr = (int *) &line[24];
-			*int_ptr = data->utm_zone_lon;
-			line[28] = data->utm_zone;
-			line[29] = data->hemisphere;
-			line[30] = data->ellipsoid;
-			line[31] = data->pos_spare;
-			short_ptr = (short *) &line[32];
-			*short_ptr = (short) data->semi_major_axis;
-			short_ptr = (short *) &line[34];
-			*short_ptr = (short) data->other_quality;
-			}
-		else
-			{
-			int_ptr = (int *) &line[8];
-			*int_ptr = (int) mb_swap_int(data->pos_latitude);
-			int_ptr = (int *) &line[12];
-			*int_ptr = (int) mb_swap_int(data->pos_longitude);
-			int_ptr = (int *) &line[16];
-			*int_ptr = (int) mb_swap_int(data->utm_northing);
-			int_ptr = (int *) &line[20];
-			*int_ptr = (int) mb_swap_int(data->utm_easting);
-			int_ptr = (int *) &line[24];
-			*int_ptr = (int) mb_swap_int(data->utm_zone_lon);
-			line[28] = data->utm_zone;
-			line[29] = data->hemisphere;
-			line[30] = data->ellipsoid;
-			line[31] = data->pos_spare;
-			short_ptr = (short *) &line[32];
-			*short_ptr = (short) mb_swap_short(data->semi_major_axis);
-			short_ptr = (short *) &line[34];
-			*short_ptr = (short) mb_swap_short(data->other_quality);
-			}
-		line[RESON_NAV_SIZE] = 0x03;
-		line[RESON_NAV_SIZE+1] = '\0';
-		line[RESON_NAV_SIZE+2] = '\0';
-
-		/* write out data */
-		status = fwrite(line,1,RESON_NAV_SIZE+3,mbfp);
-		if (status != RESON_NAV_SIZE+3)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_cbat9001_wr_svp(int verbose, FILE *mbfp, int swap, void *data_ptr, int *error)
-{
-	char	*function_name = "mbr_cbat9001_wr_svp";
-	int	status = MB_SUCCESS;
-	struct mbf_cbat9001_struct *data;
-	char	line[RESON_SVP_SIZE+3];
-	short label;
-	int	size;
-	int	svp_num_max;
-	short *short_ptr;
-	short *short_ptr2;
-	int	*int_ptr;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       data_ptr:   %p\n",(void *)data_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_cbat9001_struct *) data_ptr;
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       year:             %d\n",data->svp_year);
-		fprintf(stderr,"dbg5       month:            %d\n",data->svp_month);
-		fprintf(stderr,"dbg5       day:              %d\n",data->svp_day);
-		fprintf(stderr,"dbg5       hour:             %d\n",data->svp_hour);
-		fprintf(stderr,"dbg5       minute:           %d\n",data->svp_minute);
-		fprintf(stderr,"dbg5       sec:              %d\n",data->svp_second);
-		fprintf(stderr,"dbg5       hundredth_sec:    %d\n",data->svp_hundredth_sec);
-		fprintf(stderr,"dbg5       thousandth_sec:   %d\n",data->svp_thousandth_sec);
-		fprintf(stderr,"dbg5       svp_latitude:     %d\n",data->svp_latitude);
-		fprintf(stderr,"dbg5       svp_longitude:    %d\n",data->svp_longitude);
-		fprintf(stderr,"dbg5       svp_num:          %d\n",data->svp_num);
-		for (i=0;i<data->svp_num;i++)
-			fprintf(stderr,"dbg5       depth: %d     vel: %d\n",
-				data->svp_depth[i],data->svp_vel[i]);
-		}
-
-	/* figure out which svp record to output */
-	if (data->svp_num > 200)
-		{
-		label = RESON_SVP;
-		size = RESON_SVP_SIZE;
-		svp_num_max = 500;
-		}
-	else
-		{
-		label = RESON_SHORT_SVP;
-		size = RESON_SHORT_SVP_SIZE;
-		svp_num_max = 200;
-		}
-
-	/* write the record label */
-	if (swap == MB_YES)
-		label = (short) mb_swap_short(label);
-	status = fwrite(&label,1,2,mbfp);
-	if (status != 2)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	else
-		status = MB_SUCCESS;
-
-	/* write out the data */
-	if (status == MB_SUCCESS)
-		{
-		/* construct record */
-		line[0] = (char) data->svp_day;
-		line[1] = (char) data->svp_month;
-		line[2] = (char) data->svp_year;
-		line[3] = (char) data->svp_hour;
-		line[4] = (char) data->svp_minute;
-		line[5] = (char) data->svp_second;
-		line[6] = (char) data->svp_hundredth_sec;
-		line[7] = (char) data->svp_thousandth_sec;
-		if (swap == MB_NO)
-			{
-			int_ptr = (int *) &line[8];
-			*int_ptr = data->svp_latitude;
-			int_ptr = (int *) &line[12];
-			*int_ptr = data->svp_longitude;
-			}
-		else
-			{
-			int_ptr = (int *) &line[8];
-			*int_ptr = (int) mb_swap_int(data->svp_latitude);
-			int_ptr = (int *) &line[12];
-			*int_ptr = (int) mb_swap_int(data->svp_longitude);
-			}
-		for (i=0;i<data->svp_num;i++)
-			{
-			short_ptr = (short *) &line[16+4*i];
-			short_ptr2 = (short *) &line[18+4*i];
-			if (swap == MB_NO)
-				{
-
-				*short_ptr = (short) data->svp_depth[i];
-				*short_ptr2 = (short) data->svp_vel[i];
-				}
-			else
-				{
-				*short_ptr = (short)
-					mb_swap_short((short)data->svp_depth[i]);
-				*short_ptr2 = (short)
-					mb_swap_short((short)data->svp_vel[i]);
-				}
-			}
-		for (i=data->svp_num;i<svp_num_max;i++)
-			{
-			short_ptr = (short *) &line[16+4*i];
-			short_ptr2 = (short *) &line[18+4*i];
-			*short_ptr = 0;
-			*short_ptr2 = 0;
-			}
-		line[size] = 0x03;
-		line[size+1] = '\0';
-		line[size+2] = '\0';
-
-		/* write out data */
-		status = fwrite(line,1,size+3,mbfp);
-		if (status != size+3)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_cbat9001_wr_bath(int verbose, FILE *mbfp, int swap, void *data_ptr, int *error)
-{
-	char	*function_name = "mbr_cbat9001_wr_bath";
-	int	status = MB_SUCCESS;
-	struct mbf_cbat9001_struct *data;
-	char	line[RESON_BATH_9001_SIZE+3];
-	char	*beamarray;
-	short label;
-	unsigned char *char_ptr;
-	short *short_ptr;
-	int	*int_ptr;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       data_ptr:   %p\n",(void *)data_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_cbat9001_struct *) data_ptr;
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       year:             %d\n",data->year);
-		fprintf(stderr,"dbg5       month:            %d\n",data->month);
-		fprintf(stderr,"dbg5       day:              %d\n",data->day);
-		fprintf(stderr,"dbg5       hour:             %d\n",data->hour);
-		fprintf(stderr,"dbg5       minute:           %d\n",data->minute);
-		fprintf(stderr,"dbg5       sec:              %d\n",data->second);
-		fprintf(stderr,"dbg5       hundredth_sec:    %d\n",data->hundredth_sec);
-		fprintf(stderr,"dbg5       thousandth_sec:   %d\n",data->thousandth_sec);
-		fprintf(stderr,"dbg5       latitude:         %d\n",data->latitude);
-		fprintf(stderr,"dbg5       longitude:        %d\n",data->longitude);
-		fprintf(stderr,"dbg5       roll:             %d\n",data->roll);
-		fprintf(stderr,"dbg5       pitch:            %d\n",data->pitch);
-		fprintf(stderr,"dbg5       heading:          %d\n",data->heading);
-		fprintf(stderr,"dbg5       heave:            %d\n",data->heave);
-		fprintf(stderr,"dbg5       ping_number:      %d\n",data->ping_number);
-		fprintf(stderr,"dbg5       sound_vel:        %d\n",data->sound_vel);
-		fprintf(stderr,"dbg5       mode:             %d\n",data->mode);
-		fprintf(stderr,"dbg5       gain1:            %d\n",data->gain1);
-		fprintf(stderr,"dbg5       gain2:            %d\n",data->gain2);
-		fprintf(stderr,"dbg5       gain3:            %d\n",data->gain3);
-		fprintf(stderr,"dbg5       beams_bath:       %d\n",data->beams_bath);
-		fprintf(stderr,"dbg5       beam bath xtrack ltrack tt amp qual heave\n");
-		for (i=0;i<data->beams_bath;i++)
-			fprintf(stderr,"dbg5       beam:%d  bath:%d  xtrck:%d  ltrck:%d tt:%d  angle:%d amp:%d  qual:%d\n",
-				i,data->bath[i],data->bath_acrosstrack[i],
-				data->bath_alongtrack[i],data->tt[i],
-				data->angle[i],data->amp[i],data->quality[i]);
-		}
-
-	/* write the record label */
-	label = RESON_BATH_9001;
-	if (swap == MB_YES)
-		label = (short) mb_swap_short(label);
-	status = fwrite(&label,1,2,mbfp);
-	if (status != 2)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	else
-		status = MB_SUCCESS;
-
-	/* write out the data */
-	if (status == MB_SUCCESS)
-		{
-		/* construct record */
-		line[0] = (char) data->day;
-		line[1] = (char) data->month;
-		line[2] = (char) data->year;
-		line[3] = (char) data->hour;
-		line[4] = (char) data->minute;
-		line[5] = (char) data->second;
-		line[6] = (char) data->hundredth_sec;
-		line[7] = (char) data->thousandth_sec;
-		if (swap == MB_NO)
-			{
-			int_ptr = (int *) &line[8];
-			*int_ptr = data->latitude;
-			int_ptr = (int *) &line[12];
-			*int_ptr = data->longitude;
-			short_ptr = (short *) &line[16];
-			*short_ptr = (short) data->roll;
-			short_ptr = (short *) &line[18];
-			*short_ptr = (short) data->pitch;
-			short_ptr = (short *) &line[20];
-			*short_ptr = (unsigned short) data->heading;
-			short_ptr = (short *) &line[22];
-			*short_ptr = (short) data->heave;
-			short_ptr = (short *) &line[24];
-			*short_ptr = (short) data->ping_number;
-			short_ptr = (short *) &line[26];
-			*short_ptr = (short) data->sound_vel;
-			}
-		else
-			{
-			int_ptr = (int *) &line[8];
-			*int_ptr = (int) mb_swap_int(data->latitude);
-			int_ptr = (int *) &line[12];
-			*int_ptr = (int) mb_swap_int(data->longitude);
-			short_ptr = (short *) &line[16];
-			*short_ptr = (short) mb_swap_short(data->roll);
-			short_ptr = (short *) &line[18];
-			*short_ptr = (short) mb_swap_short(data->pitch);
-			short_ptr = (short *) &line[20];
-			*short_ptr = (unsigned short) mb_swap_short(data->heading);
-			short_ptr = (short *) &line[22];
-			*short_ptr = (short) mb_swap_short(data->heave);
-			short_ptr = (short *) &line[24];
-			*short_ptr = (short) mb_swap_short(data->ping_number);
-			short_ptr = (short *) &line[26];
-			*short_ptr = (short) mb_swap_short(data->sound_vel);
-			}
-		line[28] = (char) data->mode;
-		line[29] = (char) data->gain1;
-		line[30] = (char) data->gain2;
-		line[31] = (char) data->gain3;
-
-
-		if (swap == MB_NO)
-			{
-			for (i=0;i<MBF_CBAT9001_MAXBEAMS;i++)
-				{
-				beamarray = line + 32 + 12*i;
-				short_ptr = (short *) beamarray;
-				*short_ptr = (short) data->bath[i];
-				short_ptr = ((short *) beamarray) + 1;
-				*short_ptr = (short) data->bath_acrosstrack[i];
-				short_ptr = ((short *) beamarray) + 2;
-				*short_ptr = (short) data->bath_alongtrack[i];
-				short_ptr = ((short *) beamarray) + 3;
-				*short_ptr = (short) data->tt[i];
-				short_ptr = ((short *) beamarray) + 4;
-				*short_ptr = (short) data->angle[i];
-				char_ptr = (unsigned char *) (beamarray + 10);
-				*char_ptr = (char) data->quality[i];
-				char_ptr = (unsigned char *) (beamarray + 11);
-				*char_ptr = (char) data->amp[i];
-				}
-			}
-		else
-			{
-			for (i=0;i<MBF_CBAT9001_MAXBEAMS;i++)
-				{
-				beamarray = line + 32 + 12*i;
-				short_ptr = (short *) beamarray;
-				*short_ptr = (short)
-					mb_swap_short((short)data->bath[i]);
-				short_ptr = ((short *) beamarray) + 1;
-				*short_ptr = (short)
-					mb_swap_short((short)data->bath_acrosstrack[i]);
-				short_ptr = ((short *) beamarray) + 2;
-				*short_ptr = (short)
-					mb_swap_short((short)data->bath_alongtrack[i]);
-				short_ptr = ((short *) beamarray) + 3;
-				*short_ptr = (short)
-					mb_swap_short((short)data->tt[i]);
-				short_ptr = ((short *) beamarray) + 4;
-				*short_ptr = (short)
-					mb_swap_short((short)data->angle[i]);
-				char_ptr = (unsigned char *) (beamarray + 10);
-				*char_ptr = (char) data->quality[i];
-				char_ptr = (unsigned char *) (beamarray + 11);
-				*char_ptr = (unsigned char) data->amp[i];
-				}
-			}
-		line[RESON_BATH_9001_SIZE] = 0x03;
-		line[RESON_BATH_9001_SIZE+1] = '\0';
-		line[RESON_BATH_9001_SIZE+2] = '\0';
-
-		/* write out data */
-		status = fwrite(line,1,RESON_BATH_9001_SIZE+3,mbfp);
-		if (status != RESON_BATH_9001_SIZE+3)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mbr_dsl120pf.c b/src/mbio/mbr_dsl120pf.c
deleted file mode 100644
index cafabbe..0000000
--- a/src/mbio/mbr_dsl120pf.c
+++ /dev/null
@@ -1,2137 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbr_dsl120pf.c	8/6/96
- *	$Id: mbr_dsl120pf.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1996-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbr_dsl120pf.c contains the functions for reading and writing
- * multibeam data in the DSL120SF format.
- * These functions include:
- *   mbr_alm_dsl120pf	- allocate read/write memory
- *   mbr_dem_dsl120pf	- deallocate read/write memory
- *   mbr_rt_dsl120pf	- read and translate data
- *   mbr_wt_dsl120pf	- translate and write data
- *
- * Author:	D. W. Caress
- * Date:	August 6, 1996
- * $Log: mbr_dsl120pf.c,v $
- * Revision 5.9  2005/11/05 00:48:03  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.8  2003/05/20 18:05:32  caress
- * Added svp_source to data source parameters.
- *
- * Revision 5.7  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.6  2002/09/25 20:41:04  caress
- * Fixed old DSL120 format.
- *
- * Revision 5.5  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.4  2001/07/20 00:31:11  caress
- * Release 5.0.beta03
- *
- * Revision 5.3  2001/03/22  20:45:56  caress
- * Trying to make 5.0.beta0...
- *
- * Revision 5.2  2001/01/22  07:43:34  caress
- * Version 5.0.beta01
- *
- * Revision 5.1  2000/12/10  20:26:50  caress
- * Version 5.0.alpha02
- *
- * Revision 5.0  2000/12/01  22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.5  2000/10/11  01:02:30  caress
- * Convert to ANSI C
- *
- * Revision 4.4  2000/09/30  06:34:20  caress
- * Snapshot for Dale.
- *
- * Revision 4.3  1999/12/29  00:34:06  caress
- * Release 4.6.8
- *
- * Revision 4.2  1998/10/05 17:46:15  caress
- * MB-System version 4.6beta
- *
- * Revision 4.1  1997/04/21  17:02:07  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.1  1997/04/17  15:07:36  caress
- * MB-System 4.5 Beta Release
- *
- * Revision 4.0  1996/08/26  17:29:56  caress
- * Release 4.4 revision.
- *
- * Revision 1.1  1996/08/26  17:24:56  caress
- * Initial revision
- *
- *
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mb_define.h"
-#include "mbsys_dsl.h"
-#include "mbf_dsl120pf.h"
-
-/* essential function prototypes */
-int mbr_register_dsl120pf(int verbose, void *mbio_ptr,
-		int *error);
-int mbr_info_dsl120pf(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_alm_dsl120pf(int verbose, void *mbio_ptr, int *error);
-int mbr_dem_dsl120pf(int verbose, void *mbio_ptr, int *error);
-int mbr_zero_dsl120pf(int verbose, char *data_ptr, int *error);
-int mbr_rt_dsl120pf(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_wt_dsl120pf(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_dsl120pf_rd_data(int verbose, void *mbio_ptr, int *error);
-int mbr_dsl120pf_rd_header(int verbose, void *mbio_ptr, FILE *mbfp, int *error);
-int mbr_dsl120pf_rd_dataheader(int verbose, void *mbio_ptr, FILE *mbfp,
-	char *type, int *len, int *hdr_len, int *error);
-int mbr_dsl120pf_rd_bath(int verbose, void *mbio_ptr, FILE *mbfp, int *error);
-int mbr_dsl120pf_rd_amp(int verbose, void *mbio_ptr, FILE *mbfp, int *error);
-int mbr_dsl120pf_rd_comment(int verbose, void *mbio_ptr, FILE *mbfp, int *error);
-int mbr_dsl120pf_wr_data(int verbose, void *mbio_ptr, char *data_ptr, int *error);
-int mbr_dsl120pf_wr_bath(int verbose, void *mbio_ptr, FILE *mbfp, int *error);
-int mbr_dsl120pf_wr_amp(int verbose, void *mbio_ptr, FILE *mbfp, int *error);
-int mbr_dsl120pf_wr_comment(int verbose, void *mbio_ptr, FILE *mbfp, int *error);
-
-static char rcs_id[]="$Id: mbr_dsl120pf.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mbr_register_dsl120pf(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_register_dsl120pf";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* get mb_io_ptr */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set format info parameters */
-	status = mbr_info_dsl120pf(verbose,
-			&mb_io_ptr->system,
-			&mb_io_ptr->beams_bath_max,
-			&mb_io_ptr->beams_amp_max,
-			&mb_io_ptr->pixels_ss_max,
-			mb_io_ptr->format_name,
-			mb_io_ptr->system_name,
-			mb_io_ptr->format_description,
-			&mb_io_ptr->numfile,
-			&mb_io_ptr->filetype,
-			&mb_io_ptr->variable_beams,
-			&mb_io_ptr->traveltime,
-			&mb_io_ptr->beam_flagging,
-			&mb_io_ptr->nav_source,
-			&mb_io_ptr->heading_source,
-			&mb_io_ptr->vru_source,
-			&mb_io_ptr->svp_source,
-			&mb_io_ptr->beamwidth_xtrack,
-			&mb_io_ptr->beamwidth_ltrack,
-			error);
-
-	/* set format and system specific function pointers */
-	mb_io_ptr->mb_io_format_alloc = &mbr_alm_dsl120pf;
-	mb_io_ptr->mb_io_format_free = &mbr_dem_dsl120pf;
-	mb_io_ptr->mb_io_store_alloc = &mbsys_dsl_alloc;
-	mb_io_ptr->mb_io_store_free = &mbsys_dsl_deall;
-	mb_io_ptr->mb_io_read_ping = &mbr_rt_dsl120pf;
-	mb_io_ptr->mb_io_write_ping = &mbr_wt_dsl120pf;
-	mb_io_ptr->mb_io_dimensions = &mbsys_dsl_dimensions;
-	mb_io_ptr->mb_io_extract = &mbsys_dsl_extract;
-	mb_io_ptr->mb_io_insert = &mbsys_dsl_insert;
-	mb_io_ptr->mb_io_extract_nav = &mbsys_dsl_extract_nav;
-	mb_io_ptr->mb_io_insert_nav = &mbsys_dsl_insert_nav;
-	mb_io_ptr->mb_io_extract_altitude = &mbsys_dsl_extract_altitude;
-	mb_io_ptr->mb_io_insert_altitude = NULL;
-	mb_io_ptr->mb_io_extract_svp = NULL;
-	mb_io_ptr->mb_io_insert_svp = NULL;
-	mb_io_ptr->mb_io_ttimes = &mbsys_dsl_ttimes;
-	mb_io_ptr->mb_io_detects = &mbsys_dsl_detects;
-	mb_io_ptr->mb_io_copyrecord = &mbsys_dsl_copy;
-	mb_io_ptr->mb_io_extract_rawss = NULL;
-	mb_io_ptr->mb_io_insert_rawss = NULL;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",mb_io_ptr->system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",mb_io_ptr->beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",mb_io_ptr->beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",mb_io_ptr->pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",mb_io_ptr->format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",mb_io_ptr->system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",mb_io_ptr->format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",mb_io_ptr->numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",mb_io_ptr->filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",mb_io_ptr->variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",mb_io_ptr->traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",mb_io_ptr->beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",mb_io_ptr->nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",mb_io_ptr->heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",mb_io_ptr->vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",mb_io_ptr->svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",mb_io_ptr->beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",mb_io_ptr->beamwidth_ltrack);
-		fprintf(stderr,"dbg2       format_alloc:       %p\n",(void *)mb_io_ptr->mb_io_format_alloc);
-		fprintf(stderr,"dbg2       format_free:        %p\n",(void *)mb_io_ptr->mb_io_format_free);
-		fprintf(stderr,"dbg2       store_alloc:        %p\n",(void *)mb_io_ptr->mb_io_store_alloc);
-		fprintf(stderr,"dbg2       store_free:         %p\n",(void *)mb_io_ptr->mb_io_store_free);
-		fprintf(stderr,"dbg2       read_ping:          %p\n",(void *)mb_io_ptr->mb_io_read_ping);
-		fprintf(stderr,"dbg2       write_ping:         %p\n",(void *)mb_io_ptr->mb_io_write_ping);
-		fprintf(stderr,"dbg2       extract:            %p\n",(void *)mb_io_ptr->mb_io_extract);
-		fprintf(stderr,"dbg2       insert:             %p\n",(void *)mb_io_ptr->mb_io_insert);
-		fprintf(stderr,"dbg2       extract_nav:        %p\n",(void *)mb_io_ptr->mb_io_extract_nav);
-		fprintf(stderr,"dbg2       insert_nav:         %p\n",(void *)mb_io_ptr->mb_io_insert_nav);
-		fprintf(stderr,"dbg2       extract_altitude:   %p\n",(void *)mb_io_ptr->mb_io_extract_altitude);
-		fprintf(stderr,"dbg2       insert_altitude:    %p\n",(void *)mb_io_ptr->mb_io_insert_altitude);
-		fprintf(stderr,"dbg2       extract_svp:        %p\n",(void *)mb_io_ptr->mb_io_extract_svp);
-		fprintf(stderr,"dbg2       insert_svp:         %p\n",(void *)mb_io_ptr->mb_io_insert_svp);
-		fprintf(stderr,"dbg2       ttimes:             %p\n",(void *)mb_io_ptr->mb_io_ttimes);
-		fprintf(stderr,"dbg2       detects:            %p\n",(void *)mb_io_ptr->mb_io_detects);
-		fprintf(stderr,"dbg2       extract_rawss:      %p\n",(void *)mb_io_ptr->mb_io_extract_rawss);
-		fprintf(stderr,"dbg2       insert_rawss:       %p\n",(void *)mb_io_ptr->mb_io_insert_rawss);
-		fprintf(stderr,"dbg2       copyrecord:         %p\n",(void *)mb_io_ptr->mb_io_copyrecord);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbr_info_dsl120pf(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error)
-{
-	char	*function_name = "mbr_info_dsl120pf";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* set format info parameters */
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-	*system = MB_SYS_DSL;
-	*beams_bath_max = 2048;
-	*beams_amp_max = 0;
-	*pixels_ss_max = 8192;
-	strncpy(format_name, "DSL120PF", MB_NAME_LENGTH);
-	strncpy(system_name, "DSL", MB_NAME_LENGTH);
-	strncpy(format_description, "Format name:          MBF_DSL120PF\nInformal Description: WHOI DSL AMS-120 processed format\nAttributes:           2048 beam bathymetry, 8192 pixel sidescan,\n                      binary, parallel bathymetry and amplitude files, WHOI DSL.\n", MB_DESCRIPTION_LENGTH);
-	*numfile = -2;
-	*filetype = MB_FILETYPE_NORMAL;
-	*variable_beams = MB_NO;
-	*traveltime = MB_NO;
-	*beam_flagging = MB_YES;
-	*nav_source = MB_DATA_DATA;
-	*heading_source = MB_DATA_DATA;
-	*vru_source = MB_DATA_DATA;
-	*svp_source = MB_DATA_NONE;
-	*beamwidth_xtrack = 0.0;
-	*beamwidth_ltrack = 0.0;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",*system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",*beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",*beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",*pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",*numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",*filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",*variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",*traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",*beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",*nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",*heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",*vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",*svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",*beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",*beamwidth_ltrack);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_alm_dsl120pf(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_alm_dsl120pf";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_dsl120pf_struct *data;
-	char	*tag_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set initial status */
-	status = MB_SUCCESS;
-
-	/* allocate memory for data structure */
-	mb_io_ptr->structure_size = sizeof(struct mbf_dsl120pf_struct);
-	mb_io_ptr->data_structure_size = 0;
-	status = mb_malloc(verbose,mb_io_ptr->structure_size,
-				&mb_io_ptr->raw_data,error);
-	status = mbsys_dsl_alloc(
-			verbose,mbio_ptr,
-			&mb_io_ptr->store_data,error);
-
-	/* initialize everything to zeros */
-	mbr_zero_dsl120pf(verbose,mb_io_ptr->raw_data,error);
-
-	/* get pointer to data descriptor */
-	data = (struct mbf_dsl120pf_struct *) mb_io_ptr->raw_data;
-
-	/* now handle parallel files
-	   - find if the user specified file is the
-	     bathymetry or amplitude and construct the second
-	     filename from the first
-	   - files actually opened in mb_read_init.c and
-	     mb_write_init.c */
-	if ((tag_ptr = strstr(mb_io_ptr->file, "bat")) != NULL)
-		{
-		/* get the corresponding amp file name */
-		strcpy(mb_io_ptr->file2, mb_io_ptr->file);
-		tag_ptr = strstr(mb_io_ptr->file2, "bat");
-		tag_ptr[0] = 'a';
-		tag_ptr[1] = 'm';
-		tag_ptr[2] = 'p';
-		}
-	else if ((tag_ptr = strstr(mb_io_ptr->file, "amp")) != NULL)
-		{
-		/* move the amp file name to second position */
-		strcpy(mb_io_ptr->file2, mb_io_ptr->file);
-
-		/* get the corresponding amp file name */
-		tag_ptr = strstr(mb_io_ptr->file, "amp");
-		tag_ptr[0] = 'b';
-		tag_ptr[1] = 'a';
-		tag_ptr[2] = 't';
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_dem_dsl120pf(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_dem_dsl120pf";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointers to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* deallocate memory for data descriptor */
-	status = mb_free(verbose,&mb_io_ptr->raw_data,error);
-	status = mbsys_dsl_deall(
-			verbose,mbio_ptr,
-			&mb_io_ptr->store_data,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_zero_dsl120pf(int verbose, char *data_ptr, int *error)
-{
-	char	*function_name = "mbr_zero_dsl120pf";
-	int	status = MB_SUCCESS;
-	struct mbf_dsl120pf_struct *data;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       data_ptr:   %p\n",(void *)data_ptr);
-		}
-
-	/* get pointer to data descriptor */
-	data = (struct mbf_dsl120pf_struct *) data_ptr;
-
-	/* initialize everything to zeros */
-	if (data != NULL)
-		{
-
-		/* initialize everything */
-		data->kind = MB_DATA_NONE;
-		data->rec_type = DSL_NONE;
-		data->rec_len = 0;
-		data->rec_hdr_len = 0;
-		data->p_flags = 0;
-		data->num_data_types = 0;
-		data->ping = 0;
-		for (i=0;i<4;i++)
-			data->sonar_cmd[i] = '\0';
-		for (i=0;i<24;i++)
-			data->time_stamp[i] = '\0';
-		data->nav_x = 0.0;
-		data->nav_y = 0.0;
-		data->depth = 0.0;
-		data->heading = 0.0;
-		data->pitch = 0.0;
-		data->roll = 0.0;
-		data->alt = 0.0;
-		data->ang_offset = 0.0;
-		data->transmit_pwr = 0;
-		data->gain_port = 0;
-		data->gain_starbd = 0;
-		data->pulse_width = 0.0;
-		data->swath_width = 0;
-		data->side = 0;
-		data->swapped = 3;
-		data->tv_sec = 0;
-		data->tv_usec = 0;
-		data->digitalinterface = 0;
-		for (i=0;i<5;i++)
-			data->reserved[i] = 0;
-		data->bat_type = DSL_BATH;
-		data->bat_len = 0;
-		data->bat_hdr_len = 0;
-		data->bat_num_bins = 0;
-		data->bat_sampleSize = 0.0;
-		data->bat_p_flags = 0;
-		data->bat_max_range = 0.0;
-		for (i=0;i<10;i++)
-			data->bat_future[i] = 0;
-		for (i=0;i<MBSYS_DSL_MAXBEAMS_SIDE;i++)
-			{
-			data->bat_port[i] = 0.0;
-			data->bat_stbd[i] = 0.0;
-			}
-		data->amp_type = DSL_AMP;
-		data->amp_len = 0;
-		data->amp_hdr_len = 0;
-		data->amp_num_samp = 0;
-		data->amp_sampleSize = 0.0;
-		data->amp_p_flags = 0;
-		data->amp_max_range = 0.0;
-		data->amp_channel = 0.0;
-		for (i=0;i<9;i++)
-			data->amp_future[i] = 0;
-		for (i=0;i<MBSYS_DSL_MAXBEAMS_SIDE;i++)
-			{
-			data->amp_port[i] = 0.0;
-			data->amp_stbd[i] = 0.0;
-			}
-		for (i=0;i<MBF_DSL120PF_COMMENT_LENGTH;i++)
-			data->comment[i] = '\0';
-		}
-
-	/* assume success */
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_rt_dsl120pf(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_rt_dsl120pf";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_dsl120pf_struct *data;
-	struct mbsys_dsl_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointers to mbio descriptor and data structures */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-	data = (struct mbf_dsl120pf_struct *) mb_io_ptr->raw_data;
-	store = (struct mbsys_dsl_struct *) store_ptr;
-
-	/* read next data from file */
-	status = mbr_dsl120pf_rd_data(verbose,mbio_ptr,error);
-
-	/* set error and kind in mb_io_ptr */
-	mb_io_ptr->new_error = *error;
-	mb_io_ptr->new_kind = data->kind;
-
-	/* translate values to dsl data storage structure */
-	if (status == MB_SUCCESS
-		&& store != NULL)
-		{
-		store->kind = data->kind;
-		store->rec_type = data->rec_type;
-		store->rec_len = data->rec_len;
-		store->rec_hdr_len = data->rec_hdr_len;
-		store->p_flags = data->p_flags;
-		store->num_data_types = data->num_data_types;
-		store->ping = data->ping;
-		for (i=0;i<4;i++)
-			store->sonar_cmd[i] = data->sonar_cmd[i];
-		for (i=0;i<24;i++)
-			store->time_stamp[i] = data->time_stamp[i];
-		store->nav_x = data->nav_x;
-		store->nav_y = data->nav_y;
-		store->depth = data->depth;
-		store->heading = data->heading;
-		store->pitch = data->pitch;
-		store->roll = data->roll;
-		store->alt = data->alt;
-		store->ang_offset = data->ang_offset;
-		store->transmit_pwr = data->transmit_pwr;
-		store->gain_port = data->gain_port;
-		store->gain_starbd = data->gain_starbd;
-		store->pulse_width = data->pulse_width;
-		store->swath_width = data->swath_width;
-		store->side = data->side;
-		store->swapped = data->swapped;
-		store->tv_sec = data->tv_sec;
-		store->tv_usec = data->tv_usec;
-		store->digitalinterface = data->digitalinterface;
-		for (i=0;i<5;i++)
-			store->reserved[i] = data->reserved[i];
-		store->bat_type = data->bat_type;
-		store->bat_len = data->bat_len;
-		store->bat_hdr_len = data->bat_hdr_len;
-		store->bat_num_bins = data->bat_num_bins;
-		store->bat_sampleSize = data->bat_sampleSize;
-		store->bat_p_flags = data->bat_p_flags;
-		store->bat_max_range = data->bat_max_range;
-		for (i=0;i<10;i++)
-			store->bat_future[i] = data->bat_future[i];
-		for (i=0;i<MBSYS_DSL_MAXBEAMS_SIDE;i++)
-			{
-			store->bat_port[i] = data->bat_port[i];
-			store->bat_stbd[i] = data->bat_stbd[i];
-			}
-		store->amp_type = data->amp_type;
-		store->amp_len = data->amp_len;
-		store->amp_hdr_len = data->amp_hdr_len;
-		store->amp_num_samp = data->amp_num_samp;
-		store->amp_sampleSize = data->amp_sampleSize;
-		store->amp_p_flags = data->amp_p_flags;
-		store->amp_max_range = data->amp_max_range;
-		store->amp_channel = data->amp_channel;
-		for (i=0;i<9;i++)
-			store->amp_future[i] = data->amp_future[i];
-		for (i=0;i<MBSYS_DSL_MAXBEAMS_SIDE;i++)
-			{
-			store->amp_port[i] = data->amp_port[i];
-			store->amp_stbd[i] = data->amp_stbd[i];
-			}
-		strncpy(store->comment, data->comment,
-			MBSYS_DSL_COMMENT_LENGTH - 1);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_wt_dsl120pf(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_wt_dsl120pf";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_dsl120pf_struct *data;
-	struct mbsys_dsl_struct *store;
-	char	*data_ptr;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_dsl120pf_struct *) mb_io_ptr->raw_data;
-	data_ptr = (char *) data;
-	store = (struct mbsys_dsl_struct *) store_ptr;
-
-	/* first translate values from data storage structure */
-	if (store != NULL)
-		{
-		data->kind = store->kind;
-		data->rec_type = store->rec_type;
-		data->rec_len = store->rec_len;
-		data->rec_hdr_len = store->rec_hdr_len;
-		data->p_flags = store->p_flags;
-		data->num_data_types = store->num_data_types;
-		data->ping = store->ping;
-		for (i=0;i<4;i++)
-			data->sonar_cmd[i] = store->sonar_cmd[i];
-		for (i=0;i<24;i++)
-			data->time_stamp[i] = store->time_stamp[i];
-		data->nav_x = store->nav_x;
-		data->nav_y = store->nav_y;
-		data->depth = store->depth;
-		data->heading = store->heading;
-		data->pitch = store->pitch;
-		data->roll = store->roll;
-		data->alt = store->alt;
-		data->ang_offset = store->ang_offset;
-		data->transmit_pwr = store->transmit_pwr;
-		data->gain_port = store->gain_port;
-		data->gain_starbd = store->gain_starbd;
-		data->pulse_width = store->pulse_width;
-		data->swath_width = store->swath_width;
-		data->side = store->side;
-		data->swapped = store->swapped;
-		data->tv_sec = store->tv_sec;
-		data->tv_usec = store->tv_usec;
-		data->digitalinterface = store->digitalinterface;
-		for (i=0;i<5;i++)
-			data->reserved[i] = store->reserved[i];
-		data->bat_type = store->bat_type;
-		data->bat_len = store->bat_len;
-		data->bat_hdr_len = store->bat_hdr_len;
-		data->bat_num_bins = store->bat_num_bins;
-		data->bat_sampleSize = store->bat_sampleSize;
-		data->bat_p_flags = store->bat_p_flags;
-		data->bat_max_range = store->bat_max_range;
-		for (i=0;i<10;i++)
-			data->bat_future[i] = store->bat_future[i];
-		for (i=0;i<MBSYS_DSL_MAXBEAMS_SIDE;i++)
-			{
-			data->bat_port[i] = store->bat_port[i];
-			data->bat_stbd[i] = store->bat_stbd[i];
-			}
-		data->amp_type = store->amp_type;
-		data->amp_len = store->amp_len;
-		data->amp_hdr_len = store->amp_hdr_len;
-		data->amp_num_samp = store->amp_num_samp;
-		data->amp_sampleSize = store->amp_sampleSize;
-		data->amp_p_flags = store->amp_p_flags;
-		data->amp_max_range = store->amp_max_range;
-		data->amp_channel = store->amp_channel;
-		for (i=0;i<9;i++)
-			data->amp_future[i] = store->amp_future[i];
-		for (i=0;i<MBSYS_DSL_MAXBEAMS_SIDE;i++)
-			{
-			data->amp_port[i] = store->amp_port[i];
-			data->amp_stbd[i] = store->amp_stbd[i];
-			}
-		strncpy(data->comment, store->comment,
-			MBF_DSL120PF_COMMENT_LENGTH - 1);
-		}
-
-	/* write next data to file */
-	status = mbr_dsl120pf_wr_data(verbose,mbio_ptr,data_ptr,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_dsl120pf_rd_data(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_dsl120pf_rd_data";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_dsl120pf_struct *data;
-	char	*data_ptr;
-	char	tag[5];
-	char	type[5];
-	int	len;
-	int	hdr_len;
-	int	found;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_dsl120pf_struct *) mb_io_ptr->raw_data;
-	data_ptr = (char *) data;
-
-	/* read first file */
-	if (mb_io_ptr->mbfp != NULL)
-		{
-		/* read next four bytes */
-		found = MB_NO;
-		status = fread(tag, 1, 4, mb_io_ptr->mbfp);
-		if (status == 4)
-			status = MB_SUCCESS;
-		else
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_EOF;
-			}
-
-		/* if tag not found read single bytes until found
-			or end of file */
-		while (found == MB_NO && status == MB_SUCCESS)
-			{
-			/* look for "DSL " tag at start of record */
-			if (strncmp(tag, "DSL ", 4) == 0)
-				found = MB_YES;
-
-			/* read next byte */
-			if (found == MB_NO)
-				{
-				for (i=0;i<3;i++)
-					tag[i] = tag[i+1];
-				status = fread(&tag[3], 1, 1, mb_io_ptr->mbfp);
-				if (status == 1)
-					status = MB_SUCCESS;
-				else
-					{
-					status = MB_FAILURE;
-					*error = MB_ERROR_EOF;
-					}
-				}
-			}
-
-		/* now read the rest of the header */
-		if (status == MB_SUCCESS)
-			status = mbr_dsl120pf_rd_header(verbose,mbio_ptr,
-				mb_io_ptr->mbfp,error);
-
-		/* now read each of the data records */
-		if (status == MB_SUCCESS)
-			for (i=0;i<data->num_data_types;i++)
-				{
-				status = mbr_dsl120pf_rd_dataheader(
-					verbose,mbio_ptr,
-					mb_io_ptr->mbfp,
-					type,&len,&hdr_len,error);
-
-				if (status == MB_SUCCESS
-					&& strncmp(type, "BATH", 4) == 0)
-					{
-					data->bat_len = len;
-					data->bat_hdr_len = hdr_len;
-					status = mbr_dsl120pf_rd_bath(
-						verbose,mbio_ptr,
-						mb_io_ptr->mbfp,error);
-					if (status == MB_SUCCESS)
-						data->kind = MB_DATA_DATA;
-					}
-				else if (status == MB_SUCCESS
-					&& strncmp(type, "AMP ", 4) == 0)
-					{
-					data->amp_len = len;
-					data->amp_hdr_len = hdr_len;
-					status = mbr_dsl120pf_rd_amp(
-						verbose,mbio_ptr,
-						mb_io_ptr->mbfp,error);
-					if (status == MB_SUCCESS)
-						data->kind = MB_DATA_DATA;
-					}
-				else if (status == MB_SUCCESS
-					&& strncmp(type, "COMM", 4) == 0)
-					{
-					status = mbr_dsl120pf_rd_comment(
-						verbose,mbio_ptr,
-						mb_io_ptr->mbfp,error);
-					if (status == MB_SUCCESS)
-						data->kind = MB_DATA_COMMENT;
-					}
-				}
-
-		}
-
-	/* read second file */
-	if (status == MB_SUCCESS
-		&& data->kind == MB_DATA_DATA
-		&& mb_io_ptr->mbfp2 != NULL)
-		{
-		/* read next four bytes */
-		found = MB_NO;
-		status = fread(tag, 1, 4, mb_io_ptr->mbfp2);
-		if (status == 4)
-			status = MB_SUCCESS;
-		else
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_EOF;
-			}
-
-		/* if tag not found read single bytes until found
-			or end of file */
-		while (found == MB_NO && status == MB_SUCCESS)
-			{
-			/* look for "DSL " tag at start of record */
-			if (strncmp(tag, "DSL ", 4) == 0)
-				found = MB_YES;
-
-			/* read next byte */
-			if (found == MB_NO)
-				{
-				for (i=0;i<3;i++)
-					tag[i] = tag[i+1];
-				status = fread(&tag[3], 1, 1, mb_io_ptr->mbfp2);
-				if (status == 1)
-					status = MB_SUCCESS;
-				else
-					{
-					status = MB_FAILURE;
-					*error = MB_ERROR_EOF;
-					}
-				}
-			}
-
-		/* now read the rest of the header */
-		if (status == MB_SUCCESS)
-			status = mbr_dsl120pf_rd_header(verbose,mbio_ptr,
-				mb_io_ptr->mbfp2,error);
-
-		/* now read each of the data records */
-		if (status == MB_SUCCESS)
-			for (i=0;i<data->num_data_types;i++)
-				{
-				status = mbr_dsl120pf_rd_dataheader(
-					verbose,mbio_ptr,
-					mb_io_ptr->mbfp2,
-					type,&len,&hdr_len,error);
-
-				if (status == MB_SUCCESS
-					&& strncmp(type, "BATH", 4) == 0)
-					{
-					data->bat_len = len;
-					data->bat_hdr_len = hdr_len;
-					status = mbr_dsl120pf_rd_bath(
-						verbose,mbio_ptr,
-						mb_io_ptr->mbfp2,error);
-					if (status == MB_SUCCESS)
-						data->kind = MB_DATA_DATA;
-					}
-				else if (status == MB_SUCCESS
-					&& strncmp(type, "AMP ", 4) == 0)
-					{
-					data->amp_len = len;
-					data->amp_hdr_len = hdr_len;
-					status = mbr_dsl120pf_rd_amp(
-						verbose,mbio_ptr,
-						mb_io_ptr->mbfp2,error);
-					if (status == MB_SUCCESS)
-						data->kind = MB_DATA_DATA;
-					}
-				else if (status == MB_SUCCESS
-					&& strncmp(type, "COMM", 4) == 0)
-					{
-					status = mbr_dsl120pf_rd_comment(
-						verbose,mbio_ptr,
-						mb_io_ptr->mbfp2,error);
-					if (status == MB_SUCCESS)
-						data->kind = MB_DATA_COMMENT;
-					}
-				}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_dsl120pf_rd_header(int verbose, void *mbio_ptr, FILE *mbfp, int *error)
-{
-	char	*function_name = "mbr_dsl120pf_rd_header";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_dsl120pf_struct *data;
-	char	*data_ptr;
-	char	buffer[124];
-	int	tmp_int;
-	float	tmp_float;
-	int	index;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_dsl120pf_struct *) mb_io_ptr->raw_data;
-	data_ptr = (char *) data;
-
-	/* read header */
-	status = fread(buffer, 1, 124, mbfp);
-	if (status == 124)
-		{
-		status = MB_SUCCESS;
-		*error = MB_ERROR_NO_ERROR;
-		}
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	/* translate header */
-	if (status == MB_SUCCESS)
-		{
-		data->rec_type = DSL_HEADER;
-
- 		index = 0;
-		mb_get_binary_int(MB_NO, &buffer[index], (int *)&data->rec_len);
-		index += 4;
- 		mb_get_binary_int(MB_NO, &buffer[index], (int *)&data->rec_hdr_len);
-		index += 4;
- 		mb_get_binary_int(MB_NO, &buffer[index], (int *)&tmp_int);
- 		if (tmp_int != 0)
-		    data->p_flags = tmp_int;
-		index += 4;
- 		mb_get_binary_int(MB_NO, &buffer[index], (int *)&data->num_data_types);
-		index += 4;
- 		mb_get_binary_int(MB_NO, &buffer[index], (int *)&data->ping);
-		index += 4;
-		for (i=0;i<4;i++)
-			{
-			data->sonar_cmd[i] = buffer[index];
-			index++;
-			}
-		for (i=0;i<24;i++)
-			{
-			data->time_stamp[i] = buffer[index];
-			index++;
-			}
- 		mb_get_binary_float(MB_NO, &buffer[index], &data->nav_x);
-		index += 4;
- 		mb_get_binary_float(MB_NO, &buffer[index], &data->nav_y);
-		index += 4;
- 		mb_get_binary_float(MB_NO, &buffer[index], &data->depth);
-		index += 4;
- 		mb_get_binary_float(MB_NO, &buffer[index], &data->heading);
-		index += 4;
- 		mb_get_binary_float(MB_NO, &buffer[index], &data->pitch);
-		index += 4;
- 		mb_get_binary_float(MB_NO, &buffer[index], &data->roll);
-		index += 4;
- 		mb_get_binary_float(MB_NO, &buffer[index], &tmp_float);
- 		if (tmp_int != 0)
-		    data->alt = tmp_float;
-		index += 4;
- 		mb_get_binary_float(MB_NO, &buffer[index], &data->ang_offset);
-		index += 4;
- 		mb_get_binary_int(MB_NO, &buffer[index], (int *)&data->transmit_pwr);
-		index += 4;
- 		mb_get_binary_int(MB_NO, &buffer[index], (int *)&data->gain_port);
-		index += 4;
- 		mb_get_binary_int(MB_NO, &buffer[index], (int *)&data->gain_starbd);
-		index += 4;
- 		mb_get_binary_float(MB_NO, &buffer[index], &data->pulse_width);
-		index += 4;
- 		mb_get_binary_int(MB_NO, &buffer[index], (int *)&data->swath_width);
-		index += 4;
-		data->side = buffer[index];
-		index++;
-		data->swapped = buffer[index];
-		index++;
-		index += 2;
-		mb_get_binary_int(MB_NO, &buffer[index], (int *)&data->tv_sec);
-		index += 4;
-		mb_get_binary_int(MB_NO, &buffer[index], (int *)&data->tv_usec);
-		index += 4;
-		mb_get_binary_short(MB_NO,&buffer[index],&data->digitalinterface);
-		index += 2;
-		for (i=0;i<5;i++)
-			{
-			mb_get_binary_short(MB_NO,&buffer[index],&data->reserved[i]);
-			index += 2;
-			}
-		}
-
-	/* print debug statements */
-	if (verbose >= 5 && status == MB_SUCCESS)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       rec_type:         %d\n",data->rec_type);
-		fprintf(stderr,"dbg5       rec_len:          %d\n",data->rec_len);
-		fprintf(stderr,"dbg5       rec_hdr_len:      %d\n",data->rec_hdr_len);
-		fprintf(stderr,"dbg5       p_flags:          %d (actually: %d)\n",data->p_flags, tmp_int);
-		fprintf(stderr,"dbg5       num_data_types:   %d\n",data->num_data_types);
-		fprintf(stderr,"dbg5       ping:             %d\n",data->ping);
-		fprintf(stderr,"dbg5       sonar_cmd:        %c%c%c%c\n",
-			data->sonar_cmd[0], data->sonar_cmd[1],
-			data->sonar_cmd[2], data->sonar_cmd[3]);
-		fprintf(stderr,"dbg5       time_stamp:       ");
-		for (i=0;i<24;i++)
-			fprintf(stderr,"%c", data->time_stamp[i]);
-		fprintf(stderr, "\n");
-		fprintf(stderr,"dbg5       nav_x:            %f\n",data->nav_x);
-		fprintf(stderr,"dbg5       nav_y:            %f\n",data->nav_y);
-		fprintf(stderr,"dbg5       depth:            %f\n",data->depth);
-		fprintf(stderr,"dbg5       heading:          %f\n",data->heading);
-		fprintf(stderr,"dbg5       pitch:            %f\n",data->pitch);
-		fprintf(stderr,"dbg5       roll:             %f\n",data->roll);
-		fprintf(stderr,"dbg5       alt:              %f (actually: %f)\n", data->alt, tmp_float);
-		fprintf(stderr,"dbg5       ang_offset:       %f\n",data->ang_offset);
-		fprintf(stderr,"dbg5       transmit_pwr:     %d\n",data->transmit_pwr);
-		fprintf(stderr,"dbg5       gain_port:        %d\n",data->gain_port);
-		fprintf(stderr,"dbg5       gain_starbd:      %d\n",data->gain_starbd);
-		fprintf(stderr,"dbg5       pulse_width:      %f\n",data->pulse_width);
-		fprintf(stderr,"dbg5       swath_width:      %d\n",data->swath_width);
-		fprintf(stderr,"dbg5       side:             %c\n",data->side);
-		fprintf(stderr,"dbg5       swapped:          %c\n",data->swapped);
-		fprintf(stderr,"dbg5       tv_sec:           %d\n",data->tv_sec);
-		fprintf(stderr,"dbg5       tv_usec:          %d\n",data->tv_usec);
-		fprintf(stderr,"dbg5       digitalinterface: %d\n",data->digitalinterface);
-		for (i=0;i<5;i++)
-			fprintf(stderr,"dbg5       reserved:         %d\n", data->reserved[i]);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_dsl120pf_rd_dataheader(int verbose, void *mbio_ptr, FILE *mbfp,
-	char *type, int *len, int *hdr_len, int *error)
-{
-	char	*function_name = "mbr_dsl120pf_rd_dataheader";
-	int	status = MB_SUCCESS;
-	char	buffer[12];
-	int	index;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		}
-
-	/* read header */
-	status = fread(buffer, 1, 12, mbfp);
-	if (status == 12)
-		{
-		status = MB_SUCCESS;
-		*error = MB_ERROR_NO_ERROR;
-		}
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	/* translate header */
-	if (status == MB_SUCCESS)
-		{
-		strncpy(type, buffer, 4);
-		index = 4;
-		mb_get_binary_int(MB_NO,&buffer[index],len);
-		index += 4;
-		mb_get_binary_int(MB_NO,&buffer[index],hdr_len);
-		index += 4;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       type:      %s\n",type);
-		fprintf(stderr,"dbg2       len:       %d\n",*len);
-		fprintf(stderr,"dbg2       hdr_len:   %d\n",*hdr_len);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_dsl120pf_rd_bath(int verbose, void *mbio_ptr, FILE *mbfp, int *error)
-{
-	char	*function_name = "mbr_dsl120pf_rd_bath";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_dsl120pf_struct *data;
-	int	read_bytes;
-	char	*data_ptr;
-	char	buffer[10000];
-	int	index;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_dsl120pf_struct *) mb_io_ptr->raw_data;
-	data_ptr = (char *) data;
-
-	/* read bath record */
-	read_bytes = data->bat_len - 12;
-	status = fread(buffer, 1, read_bytes, mbfp);
-	if (status == read_bytes)
-		{
-		status = MB_SUCCESS;
-		*error = MB_ERROR_NO_ERROR;
-		}
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	/* translate header and data */
-	if (status == MB_SUCCESS)
-		{
-		index = 0;
-		mb_get_binary_int(MB_NO, &buffer[index], (int *)&data->bat_num_bins);
-		index += 4;
-		mb_get_binary_float(MB_NO, &buffer[index], &data->bat_sampleSize);
-		index += 4;
-		mb_get_binary_int(MB_NO, &buffer[index], (int *)&data->bat_p_flags);
-		index += 4;
-		mb_get_binary_float(MB_NO, &buffer[index], &data->bat_max_range);
-		index += 4;
-		for (i=0;i<9;i++)
-			{
-			mb_get_binary_int(MB_NO,&buffer[index],
-					&data->bat_future[i]);
-			index += 4;
-			}
-		for (i=0;i<data->bat_num_bins;i++)
-			{
-			mb_get_binary_float(MB_NO,&buffer[index],
-					&data->bat_port[i]);
-			index += 4;
-			mb_get_binary_float(MB_NO,&buffer[index],
-					&data->bat_stbd[i]);
-			index += 4;
-			}
-		}
-
-	/* print debug statements */
-	if (verbose >= 5 && status == MB_SUCCESS)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       bat_type:         %d\n",data->bat_type);
-		fprintf(stderr,"dbg5       bat_len:          %d\n",data->bat_len);
-		fprintf(stderr,"dbg5       bat_hdr_len:      %d\n",data->bat_hdr_len);
-		fprintf(stderr,"dbg5       bat_num_bins:     %d\n",data->bat_num_bins);
-		fprintf(stderr,"dbg5       bat_sampleSize:   %f\n",data->bat_sampleSize);
-		fprintf(stderr,"dbg5       bat_p_flags:      %d\n",data->bat_p_flags);
-		fprintf(stderr,"dbg5       bat_max_range:    %f\n",data->bat_max_range);
-		for (i=0;i<9;i++)
-			fprintf(stderr,"dbg5       bat_future:       %d\n", data->bat_future[i]);
-		for (i=0;i<data->bat_num_bins;i++)
-			fprintf(stderr,"dbg5       bath[%d]:         %f\t%f\n",
-				i, data->bat_port[i], data->bat_stbd[i]);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_dsl120pf_rd_amp(int verbose, void *mbio_ptr, FILE *mbfp, int *error)
-{
-	char	*function_name = "mbr_dsl120pf_rd_amp";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_dsl120pf_struct *data;
-	int	read_bytes;
-	char	*data_ptr;
-	char	buffer[10000];
-	int	index;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_dsl120pf_struct *) mb_io_ptr->raw_data;
-	data_ptr = (char *) data;
-
-	/* read amp record */
-	read_bytes = data->amp_len - 12;
-	status = fread(buffer, 1, read_bytes, mbfp);
-	if (status == read_bytes)
-		{
-		status = MB_SUCCESS;
-		*error = MB_ERROR_NO_ERROR;
-		}
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	/* translate header and data */
-	if (status == MB_SUCCESS)
-		{
-		index = 0;
-		mb_get_binary_int(MB_NO, &buffer[index], (int *)&data->amp_num_samp);
-		index += 4;
-		mb_get_binary_float(MB_NO, &buffer[index], &data->amp_sampleSize);
-		index += 4;
-		mb_get_binary_int(MB_NO, &buffer[index], (int *)&data->amp_p_flags);
-		index += 4;
-		mb_get_binary_float(MB_NO, &buffer[index], &data->amp_max_range);
-		index += 4;
-		mb_get_binary_int(MB_NO, &buffer[index], (int *)&data->amp_channel);
-		index += 4;
-		for (i=0;i<8;i++)
-			{
-			mb_get_binary_int(MB_NO,&buffer[index],
-					&data->amp_future[i]);
-			index += 4;
-			}
-		for (i=0;i<data->bat_num_bins;i++)
-			{
-			mb_get_binary_float(MB_NO,&buffer[index],
-					&data->amp_port[i]);
-			index += 4;
-			mb_get_binary_float(MB_NO,&buffer[index],
-					&data->amp_stbd[i]);
-			index += 4;
-			}
-		}
-
-	/* print debug statements */
-	if (verbose >= 5 && status == MB_SUCCESS)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       amp_type:         %d\n",data->amp_type);
-		fprintf(stderr,"dbg5       amp_len:          %d\n",data->amp_len);
-		fprintf(stderr,"dbg5       amp_hdr_len:      %d\n",data->amp_hdr_len);
-		fprintf(stderr,"dbg5       amp_num_samp:     %d\n",data->amp_num_samp);
-		fprintf(stderr,"dbg5       amp_sampleSize:   %f\n",data->amp_sampleSize);
-		fprintf(stderr,"dbg5       amp_p_flags:      %d\n",data->amp_p_flags);
-		fprintf(stderr,"dbg5       amp_max_range:    %f\n",data->amp_max_range);
-		fprintf(stderr,"dbg5       amp_channel:      %d\n",data->amp_channel);
-		for (i=0;i<8;i++)
-			fprintf(stderr,"dbg5       amp_future:       %d\n", data->amp_future[i]);
-		for (i=0;i<data->amp_num_samp;i++)
-			fprintf(stderr,"dbg5       amp[%d]:          %f\t%f\n",
-				i, data->amp_port[i], data->amp_stbd[i]);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_dsl120pf_rd_comment(int verbose, void *mbio_ptr, FILE *mbfp, int *error)
-{
-	char	*function_name = "mbr_dsl120pf_rd_comment";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_dsl120pf_struct *data;
-	int	read_bytes;
-	char	*data_ptr;
-	char	buffer[80];
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_dsl120pf_struct *) mb_io_ptr->raw_data;
-	data_ptr = (char *) data;
-
-	/* read comment record */
-	read_bytes = 80;
-	status = fread(buffer, 1, read_bytes, mbfp);
-	if (status == read_bytes)
-		{
-		status = MB_SUCCESS;
-		*error = MB_ERROR_NO_ERROR;
-		}
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	/* copy comment */
-	if (status == MB_SUCCESS)
-		{
-		strncpy(data->comment, buffer, 79);
-		data->comment[79] = '\0';
-		}
-
-	/* print debug statements */
-	if (verbose >= 5 && status == MB_SUCCESS)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       comment:          %s\n",data->comment);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_dsl120pf_wr_data(int verbose, void *mbio_ptr, char *data_ptr, int *error)
-{
-	char	*function_name = "mbr_dsl120pf_wr_data";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_dsl120pf_struct *data;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       data_ptr:   %p\n",(void *)data_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_dsl120pf_struct *) data_ptr;
-
-	if (data->kind == MB_DATA_COMMENT)
-		{
-		status = mbr_dsl120pf_wr_comment(verbose,mbio_ptr,mb_io_ptr->mbfp,error);
-		}
-	else if (data->kind == MB_DATA_DATA)
-		{
-		if (data->bat_num_bins > 0)
-			status = mbr_dsl120pf_wr_bath(verbose,
-				mbio_ptr,mb_io_ptr->mbfp,error);
-		else if (data->amp_num_samp > 0)
-			status = mbr_dsl120pf_wr_amp(verbose,
-				mbio_ptr,mb_io_ptr->mbfp,error);
-		if (mb_io_ptr->mbfp2 != NULL
-			&& data->amp_num_samp > 0)
-			status = mbr_dsl120pf_wr_amp(verbose,
-				mbio_ptr,mb_io_ptr->mbfp2,error);
-		}
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_BAD_KIND;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Data record kind in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       kind:       %d\n",data->kind);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_dsl120pf_wr_bath(int verbose, void *mbio_ptr, FILE *mbfp, int *error)
-{
-	char	*function_name = "mbr_dsl120pf_wr_bath";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_dsl120pf_struct *data;
-	char	*data_ptr;
-	char	buffer[10000];
-	int	index;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_dsl120pf_struct *) mb_io_ptr->raw_data;
-	data_ptr = (char *) data;
-
-	/* print debug statements */
-	if (verbose >= 5 && status == MB_SUCCESS)
-		{
-		fprintf(stderr,"\ndbg5  Values to write in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       rec_type:         %d\n",data->rec_type);
-		fprintf(stderr,"dbg5       rec_len:          %d\n",data->rec_len);
-		fprintf(stderr,"dbg5       rec_hdr_len:      %d\n",data->rec_hdr_len);
-		fprintf(stderr,"dbg5       p_flags:          %d\n",data->p_flags);
-		fprintf(stderr,"dbg5       num_data_types:   %d\n",data->num_data_types);
-		fprintf(stderr,"dbg5       ping:             %d\n",data->ping);
-		fprintf(stderr,"dbg5       sonar_cmd:        %c%c%c%c\n",
-			data->sonar_cmd[0], data->sonar_cmd[1],
-			data->sonar_cmd[2], data->sonar_cmd[3]);
-		fprintf(stderr,"dbg5       time_stamp:       ");
-		for (i=0;i<24;i++)
-			fprintf(stderr,"%c", data->time_stamp[i]);
-		fprintf(stderr, "\n");
-		fprintf(stderr,"dbg5       nav_x:            %f\n",data->nav_x);
-		fprintf(stderr,"dbg5       nav_y:            %f\n",data->nav_y);
-		fprintf(stderr,"dbg5       depth:            %f\n",data->depth);
-		fprintf(stderr,"dbg5       heading:          %f\n",data->heading);
-		fprintf(stderr,"dbg5       pitch:            %f\n",data->pitch);
-		fprintf(stderr,"dbg5       roll:             %f\n",data->roll);
-		fprintf(stderr,"dbg5       alt:              %f\n",data->alt);
-		fprintf(stderr,"dbg5       ang_offset:       %f\n",data->ang_offset);
-		fprintf(stderr,"dbg5       transmit_pwr:     %d\n",data->transmit_pwr);
-		fprintf(stderr,"dbg5       gain_port:        %d\n",data->gain_port);
-		fprintf(stderr,"dbg5       gain_starbd:      %d\n",data->gain_starbd);
-		fprintf(stderr,"dbg5       pulse_width:      %f\n",data->pulse_width);
-		fprintf(stderr,"dbg5       swath_width:      %d\n",data->swath_width);
-		fprintf(stderr,"dbg5       side:             %c\n",data->side);
-		fprintf(stderr,"dbg5       swapped:          %c\n",data->swapped);
-		fprintf(stderr,"dbg5       tv_sec:           %d\n",data->tv_sec);
-		fprintf(stderr,"dbg5       tv_usec:          %d\n",data->tv_usec);
-		fprintf(stderr,"dbg5       digitalinterface: %d\n",data->digitalinterface);
-		for (i=0;i<5;i++)
-			fprintf(stderr,"dbg5       reserved:         %d\n", data->reserved[i]);
-		fprintf(stderr,"dbg5       bat_type:         %d\n",data->bat_type);
-		fprintf(stderr,"dbg5       bat_len:          %d\n",data->bat_len);
-		fprintf(stderr,"dbg5       bat_hdr_len:      %d\n",data->bat_hdr_len);
-		fprintf(stderr,"dbg5       bat_num_bins:     %d\n",data->bat_num_bins);
-		fprintf(stderr,"dbg5       bat_sampleSize:   %f\n",data->bat_sampleSize);
-		fprintf(stderr,"dbg5       bat_p_flags:      %d\n",data->bat_p_flags);
-		fprintf(stderr,"dbg5       bat_max_range:    %f\n",data->bat_max_range);
-		for (i=0;i<9;i++)
-			fprintf(stderr,"dbg5       bat_future:       %d\n", data->bat_future[i]);
-		for (i=0;i<data->bat_num_bins;i++)
-			fprintf(stderr,"dbg5       bath[%d]:         %f\t%f\n",
-				i, data->bat_port[i], data->bat_stbd[i]);
-		}
-
- 	/* construct header record */
-	index = 0;
-	mb_put_binary_int(MB_NO,DSL_HEADER,&buffer[index]);
-	index += 4;
-	mb_put_binary_int(MB_NO,data->rec_len,&buffer[index]);
-	index += 4;
- 	mb_put_binary_int(MB_NO,data->rec_hdr_len,&buffer[index]);
-	index += 4;
- 	mb_put_binary_int(MB_NO,data->p_flags,&buffer[index]);
-	index += 4;
- 	mb_put_binary_int(MB_NO,data->num_data_types,&buffer[index]);
-	index += 4;
- 	mb_put_binary_int(MB_NO,data->ping,&buffer[index]);
-	index += 4;
-	for (i=0;i<4;i++)
-		{
-		buffer[index] = data->sonar_cmd[i];
-		index++;
-		}
-	for (i=0;i<24;i++)
-		{
-		buffer[index] = data->time_stamp[i];
-		index++;
-		}
- 	mb_put_binary_float(MB_NO,data->nav_x,&buffer[index]);
-	index += 4;
- 	mb_put_binary_float(MB_NO,data->nav_y,&buffer[index]);
-	index += 4;
- 	mb_put_binary_float(MB_NO,data->depth,&buffer[index]);
-	index += 4;
- 	mb_put_binary_float(MB_NO,data->heading,&buffer[index]);
-	index += 4;
- 	mb_put_binary_float(MB_NO,data->pitch,&buffer[index]);
-	index += 4;
- 	mb_put_binary_float(MB_NO,data->roll,&buffer[index]);
-	index += 4;
- 	mb_put_binary_float(MB_NO,data->alt,&buffer[index]);
-	index += 4;
- 	mb_put_binary_float(MB_NO,data->ang_offset,&buffer[index]);
-	index += 4;
- 	mb_put_binary_int(MB_NO,data->transmit_pwr,&buffer[index]);
-	index += 4;
- 	mb_put_binary_int(MB_NO,data->gain_port,&buffer[index]);
-	index += 4;
- 	mb_put_binary_int(MB_NO,data->gain_starbd,&buffer[index]);
-	index += 4;
- 	mb_put_binary_float(MB_NO,data->pulse_width,&buffer[index]);
-	index += 4;
- 	mb_put_binary_int(MB_NO,data->swath_width,&buffer[index]);
-	index += 4;
-	buffer[index] = data->side;
-	index++;
-	buffer[index] = data->swapped;
-	index++;
-	index += 2;
-	mb_put_binary_int(MB_NO,data->tv_sec,&buffer[index]);
-	index += 4;
-	mb_put_binary_int(MB_NO,data->tv_usec,&buffer[index]);
-	index += 4;
-	mb_put_binary_short(MB_NO,data->digitalinterface,&buffer[index]);
-	index += 2;
-	for (i=0;i<5;i++)
-		{
-		mb_put_binary_short(MB_NO,data->reserved[i],&buffer[index]);
-		index += 2;
-		}
-
-	/* construct bathymetry record */
-	mb_put_binary_int(MB_NO,data->bat_type,&buffer[index]);
-	index += 4;
-	mb_put_binary_int(MB_NO,data->bat_len,&buffer[index]);
-	index += 4;
-	mb_put_binary_int(MB_NO,data->bat_hdr_len,&buffer[index]);
-	index += 4;
-	mb_put_binary_int(MB_NO,data->bat_num_bins,&buffer[index]);
-	index += 4;
-	mb_put_binary_float(MB_NO,data->bat_sampleSize,&buffer[index]);
-	index += 4;
-	mb_put_binary_int(MB_NO,data->bat_p_flags,&buffer[index]);
-	index += 4;
-	mb_put_binary_float(MB_NO,data->bat_max_range,&buffer[index]);
-	index += 4;
-	for (i=0;i<9;i++)
-		{
-		mb_put_binary_int(MB_NO,data->bat_future[i],&buffer[index]);
-		index += 4;
-		}
-	for (i=0;i<data->bat_num_bins;i++)
-		{
-		mb_put_binary_float(MB_NO,data->bat_port[i],&buffer[index]);
-		index += 4;
-		mb_put_binary_float(MB_NO,data->bat_stbd[i],&buffer[index]);
-		index += 4;
-		}
-
-	/* write the record */
-	status = fwrite(buffer,1,data->rec_len,mbfp);
-	if (status != data->rec_len)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	else
-		status = MB_SUCCESS;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_dsl120pf_wr_amp(int verbose, void *mbio_ptr, FILE *mbfp, int *error)
-{
-	char	*function_name = "mbr_dsl120pf_wr_amp";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_dsl120pf_struct *data;
-	char	*data_ptr;
-	char	buffer[10000];
-	int	index;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_dsl120pf_struct *) mb_io_ptr->raw_data;
-	data_ptr = (char *) data;
-
-	/* print debug statements */
-	if (verbose >= 5 && status == MB_SUCCESS)
-		{
-		fprintf(stderr,"\ndbg5  Values to write in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       rec_type:         %d\n",data->rec_type);
-		fprintf(stderr,"dbg5       rec_len:          %d\n",data->rec_len);
-		fprintf(stderr,"dbg5       rec_hdr_len:      %d\n",data->rec_hdr_len);
-		fprintf(stderr,"dbg5       p_flags:          %d\n",data->p_flags);
-		fprintf(stderr,"dbg5       num_data_types:   %d\n",data->num_data_types);
-		fprintf(stderr,"dbg5       ping:             %d\n",data->ping);
-		fprintf(stderr,"dbg5       sonar_cmd:        %c%c%c%c\n",
-			data->sonar_cmd[0], data->sonar_cmd[1],
-			data->sonar_cmd[2], data->sonar_cmd[3]);
-		fprintf(stderr,"dbg5       time_stamp:       ");
-		for (i=0;i<24;i++)
-			fprintf(stderr,"%c", data->time_stamp[i]);
-		fprintf(stderr, "\n");
-		fprintf(stderr,"dbg5       nav_x:            %f\n",data->nav_x);
-		fprintf(stderr,"dbg5       nav_y:            %f\n",data->nav_y);
-		fprintf(stderr,"dbg5       depth:            %f\n",data->depth);
-		fprintf(stderr,"dbg5       heading:          %f\n",data->heading);
-		fprintf(stderr,"dbg5       pitch:            %f\n",data->pitch);
-		fprintf(stderr,"dbg5       roll:             %f\n",data->roll);
-		fprintf(stderr,"dbg5       alt:              %f\n",data->alt);
-		fprintf(stderr,"dbg5       ang_offset:       %f\n",data->ang_offset);
-		fprintf(stderr,"dbg5       transmit_pwr:     %d\n",data->transmit_pwr);
-		fprintf(stderr,"dbg5       gain_port:        %d\n",data->gain_port);
-		fprintf(stderr,"dbg5       gain_starbd:      %d\n",data->gain_starbd);
-		fprintf(stderr,"dbg5       pulse_width:      %f\n",data->pulse_width);
-		fprintf(stderr,"dbg5       swath_width:      %d\n",data->swath_width);
-		fprintf(stderr,"dbg5       side:             %c\n",data->side);
-		fprintf(stderr,"dbg5       swapped:          %c\n",data->swapped);
-		fprintf(stderr,"dbg5       tv_sec:           %d\n",data->tv_sec);
-		fprintf(stderr,"dbg5       tv_usec:          %d\n",data->tv_usec);
-		fprintf(stderr,"dbg5       digitalinterface: %d\n",data->digitalinterface);
-		for (i=0;i<5;i++)
-			fprintf(stderr,"dbg5       reserved:         %d\n", data->reserved[i]);
-		fprintf(stderr,"dbg5       amp_type:         %d\n",data->amp_type);
-		fprintf(stderr,"dbg5       amp_len:          %d\n",data->amp_len);
-		fprintf(stderr,"dbg5       amp_hdr_len:      %d\n",data->amp_hdr_len);
-		fprintf(stderr,"dbg5       amp_num_samp:     %d\n",data->amp_num_samp);
-		fprintf(stderr,"dbg5       amp_sampleSize:   %f\n",data->amp_sampleSize);
-		fprintf(stderr,"dbg5       amp_p_flags:      %d\n",data->amp_p_flags);
-		fprintf(stderr,"dbg5       amp_max_range:    %f\n",data->amp_max_range);
-		fprintf(stderr,"dbg5       amp_channel:      %d\n",data->amp_channel);
-		for (i=0;i<8;i++)
-			fprintf(stderr,"dbg5       amp_future:       %d\n", data->amp_future[i]);
-		for (i=0;i<data->amp_num_samp;i++)
-			fprintf(stderr,"dbg5       amp[%d]:          %f\t%f\n",
-				i, data->amp_port[i], data->amp_stbd[i]);
-		}
-
- 	/* construct header record */
-	index = 0;
- 	mb_put_binary_int(MB_NO,DSL_HEADER,&buffer[index]);
-	index += 4;
-	mb_put_binary_int(MB_NO,data->rec_len,&buffer[index]);
-	index += 4;
- 	mb_put_binary_int(MB_NO,data->rec_hdr_len,&buffer[index]);
-	index += 4;
- 	mb_put_binary_int(MB_NO,(int)0,&buffer[index]);
-	index += 4;
- 	mb_put_binary_int(MB_NO,data->num_data_types,&buffer[index]);
-	index += 4;
- 	mb_put_binary_int(MB_NO,data->ping,&buffer[index]);
-	index += 4;
-	for (i=0;i<4;i++)
-		{
-		buffer[index] = data->sonar_cmd[i];
-		index++;
-		}
-	for (i=0;i<24;i++)
-		{
-		buffer[index] = data->time_stamp[i];
-		index++;
-		}
- 	mb_put_binary_float(MB_NO,data->nav_x,&buffer[index]);
-	index += 4;
- 	mb_put_binary_float(MB_NO,data->nav_y,&buffer[index]);
-	index += 4;
- 	mb_put_binary_float(MB_NO,data->depth,&buffer[index]);
-	index += 4;
- 	mb_put_binary_float(MB_NO,data->heading,&buffer[index]);
-	index += 4;
- 	mb_put_binary_float(MB_NO,data->pitch,&buffer[index]);
-	index += 4;
- 	mb_put_binary_float(MB_NO,data->roll,&buffer[index]);
-	index += 4;
- 	mb_put_binary_float(MB_NO,(float)-0.1,&buffer[index]);
-	index += 4;
- 	mb_put_binary_float(MB_NO,data->ang_offset,&buffer[index]);
-	index += 4;
- 	mb_put_binary_int(MB_NO,data->transmit_pwr,&buffer[index]);
-	index += 4;
- 	mb_put_binary_int(MB_NO,data->gain_port,&buffer[index]);
-	index += 4;
- 	mb_put_binary_int(MB_NO,data->gain_starbd,&buffer[index]);
-	index += 4;
- 	mb_put_binary_float(MB_NO,data->pulse_width,&buffer[index]);
-	index += 4;
- 	mb_put_binary_int(MB_NO,data->swath_width,&buffer[index]);
-	index += 4;
-	buffer[index] = data->side;
-	index++;
-	buffer[index] = data->swapped;
-	index++;
-	index += 2;
-	mb_put_binary_int(MB_NO,data->tv_sec,&buffer[index]);
-	index += 4;
-	mb_put_binary_int(MB_NO,data->tv_usec,&buffer[index]);
-	index += 4;
-	mb_put_binary_short(MB_NO,data->digitalinterface,&buffer[index]);
-	index += 2;
-	for (i=0;i<5;i++)
-		{
-		mb_put_binary_short(MB_NO,data->reserved[i],&buffer[index]);
-		index += 2;
-		}
-
-	/* construct amplitude record */
-	mb_put_binary_int(MB_NO,data->amp_type,&buffer[index]);
-	index += 4;
-	mb_put_binary_int(MB_NO,data->amp_len,&buffer[index]);
-	index += 4;
-	mb_put_binary_int(MB_NO,data->amp_hdr_len,&buffer[index]);
-	index += 4;
- 	mb_put_binary_int(MB_NO,data->amp_num_samp,&buffer[index]);
-	index += 4;
-	mb_put_binary_float(MB_NO,data->amp_sampleSize,&buffer[index]);
-	index += 4;
-	mb_put_binary_int(MB_NO,data->amp_p_flags,&buffer[index]);
-	index += 4;
-	mb_put_binary_float(MB_NO,data->amp_max_range,&buffer[index]);
-	index += 4;
-	mb_put_binary_int(MB_NO,data->amp_channel,&buffer[index]);
-	index += 4;
-	for (i=0;i<8;i++)
-		{
-		mb_put_binary_int(MB_NO,data->amp_future[i],&buffer[index]);
-		index += 4;
-		}
-	for (i=0;i<data->bat_num_bins;i++)
-		{
-		mb_put_binary_float(MB_NO,data->amp_port[i],&buffer[index]);
-		index += 4;
-		mb_put_binary_float(MB_NO,data->amp_stbd[i],&buffer[index]);
-		index += 4;
-		}
-
-	/* write the record */
-	status = fwrite(buffer,1,data->rec_len,mbfp);
-	if (status != data->rec_len)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	else
-		status = MB_SUCCESS;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_dsl120pf_wr_comment(int verbose, void *mbio_ptr, FILE *mbfp, int *error)
-{
-	char	*function_name = "mbr_dsl120pf_wr_comment";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_dsl120pf_struct *data;
-	char	*data_ptr;
-	char	buffer[10000];
-	int	index;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_dsl120pf_struct *) mb_io_ptr->raw_data;
-	data_ptr = (char *) data;
-
-	/* print debug statements */
-	if (verbose >= 5 && status == MB_SUCCESS)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       comment:          %s\n",data->comment);
-		}
-
-	/* set record and header sizes */
-	data->num_data_types = 1;
-	data->rec_len = 128 + 12 + 80;
-	data->rec_hdr_len = 128;
-
- 	/* construct header record */
-	index = 0;
-	mb_put_binary_int(MB_NO,DSL_HEADER,&buffer[index]);
-	index += 4;
-	mb_put_binary_int(MB_NO,data->rec_len,&buffer[index]);
-	index += 4;
- 	mb_put_binary_int(MB_NO,data->rec_hdr_len,&buffer[index]);
-	index += 4;
- 	mb_put_binary_int(MB_NO,data->p_flags,&buffer[index]);
-	index += 4;
- 	mb_put_binary_int(MB_NO,data->num_data_types,&buffer[index]);
-	index += 4;
- 	mb_put_binary_int(MB_NO,data->ping,&buffer[index]);
-	index += 4;
-	for (i=0;i<4;i++)
-		{
-		buffer[index] = data->sonar_cmd[i];
-		index++;
-		}
-	for (i=0;i<24;i++)
-		{
-		buffer[index] = data->time_stamp[i];
-		index++;
-		}
- 	mb_put_binary_float(MB_NO,data->nav_x,&buffer[index]);
-	index += 4;
- 	mb_put_binary_float(MB_NO,data->nav_y,&buffer[index]);
-	index += 4;
- 	mb_put_binary_float(MB_NO,data->depth,&buffer[index]);
-	index += 4;
- 	mb_put_binary_float(MB_NO,data->heading,&buffer[index]);
-	index += 4;
- 	mb_put_binary_float(MB_NO,data->pitch,&buffer[index]);
-	index += 4;
- 	mb_put_binary_float(MB_NO,data->roll,&buffer[index]);
-	index += 4;
- 	mb_put_binary_float(MB_NO,data->alt,&buffer[index]);
-	index += 4;
- 	mb_put_binary_float(MB_NO,data->ang_offset,&buffer[index]);
-	index += 4;
- 	mb_put_binary_int(MB_NO,data->transmit_pwr,&buffer[index]);
-	index += 4;
- 	mb_put_binary_int(MB_NO,data->gain_port,&buffer[index]);
-	index += 4;
- 	mb_put_binary_int(MB_NO,data->gain_starbd,&buffer[index]);
-	index += 4;
- 	mb_put_binary_float(MB_NO,data->pulse_width,&buffer[index]);
-	index += 4;
- 	mb_put_binary_int(MB_NO,data->swath_width,&buffer[index]);
-	index += 4;
-	buffer[index] = data->side;
-	index++;
-	buffer[index] = data->swapped;
-	index++;
-	index += 2;
-	mb_put_binary_int(MB_NO,data->tv_sec,&buffer[index]);
-	index += 4;
-	mb_put_binary_int(MB_NO,data->tv_usec,&buffer[index]);
-	index += 4;
-	mb_put_binary_short(MB_NO,data->digitalinterface,&buffer[index]);
-	index += 2;
-	for (i=0;i<5;i++)
-		{
-		mb_put_binary_short(MB_NO,data->reserved[i],&buffer[index]);
-		index += 2;
-		}
-
-	/* construct comment record */
-	mb_put_binary_int(MB_NO,DSL_COMMENT,&buffer[index]);
-	index += 4;
-	mb_put_binary_int(MB_NO,12+80,&buffer[index]);
-	index += 4;
-	mb_put_binary_int(MB_NO,12,&buffer[index]);
-	index += 4;
- 	strncpy(&buffer[index], data->comment, 79);
- 	index += 79;
-	buffer[index] = '\0';
-	index++;
-
-	/* write the record */
-	status = fwrite(buffer,1,data->rec_len,mbfp);
-	if (status != data->rec_len)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	else
-		status = MB_SUCCESS;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mbr_dsl120sf.c b/src/mbio/mbr_dsl120sf.c
deleted file mode 100644
index 147fa86..0000000
--- a/src/mbio/mbr_dsl120sf.c
+++ /dev/null
@@ -1,1855 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbr_dsl120sf.c	8/6/96
- *	$Id: mbr_dsl120sf.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1996-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbr_dsl120sf.c contains the functions for reading and writing
- * multibeam data in the DSL120SF format.
- * These functions include:
- *   mbr_alm_dsl120sf	- allocate read/write memory
- *   mbr_dem_dsl120sf	- deallocate read/write memory
- *   mbr_rt_dsl120sf	- read and translate data
- *   mbr_wt_dsl120sf	- translate and write data
- *
- * Author:	D. W. Caress
- * Date:	August 6, 1996
- * $Log: mbr_dsl120sf.c,v $
- * Revision 5.8  2005/11/05 00:48:04  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.7  2003/05/20 18:05:32  caress
- * Added svp_source to data source parameters.
- *
- * Revision 5.6  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.5  2002/09/25 20:41:04  caress
- * Fixed old DSL120 format.
- *
- * Revision 5.4  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.3  2001/07/20 00:31:11  caress
- * Release 5.0.beta03
- *
- * Revision 5.2  2001/03/22  20:45:56  caress
- * Trying to make 5.0.beta0...
- *
- * Revision 5.1  2001/01/22  07:43:34  caress
- * Version 5.0.beta01
- *
- * Revision 5.0  2000/12/01  22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.5  2000/10/11  01:02:30  caress
- * Convert to ANSI C
- *
- * Revision 4.4  2000/09/30  06:34:20  caress
- * Snapshot for Dale.
- *
- * Revision 4.3  1999/12/29  00:34:06  caress
- * Release 4.6.8
- *
- * Revision 4.2  1998/10/05  17:46:15  caress
- * MB-System version 4.6beta
- *
- * Revision 4.1  1997/04/21  17:02:07  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.1  1997/04/17  15:07:36  caress
- * MB-System 4.5 Beta Release
- *
- * Revision 4.0  1996/08/26  17:29:56  caress
- * Release 4.4 revision.
- *
- * Revision 1.1  1996/08/26  17:24:56  caress
- * Initial revision
- *
- *
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mb_define.h"
-#include "mbsys_dsl.h"
-#include "mbf_dsl120sf.h"
-
-/* essential function prototypes */
-int mbr_register_dsl120sf(int verbose, void *mbio_ptr,
-		int *error);
-int mbr_info_dsl120sf(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_alm_dsl120sf(int verbose, void *mbio_ptr, int *error);
-int mbr_dem_dsl120sf(int verbose, void *mbio_ptr, int *error);
-int mbr_zero_dsl120sf(int verbose, char *data_ptr, int *error);
-int mbr_rt_dsl120sf(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_wt_dsl120sf(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_dsl120sf_rd_data(int verbose, void *mbio_ptr, int *error);
-int mbr_dsl120sf_rd_header(int verbose, void *mbio_ptr, FILE *mbfp, int *error);
-int mbr_dsl120sf_rd_dataheader(int verbose, void *mbio_ptr, FILE *mbfp,
-	char *type, int *len, int *hdr_len, int *error);
-int mbr_dsl120sf_rd_bath(int verbose, void *mbio_ptr, FILE *mbfp, int *error);
-int mbr_dsl120sf_rd_amp(int verbose, void *mbio_ptr, FILE *mbfp, int *error);
-int mbr_dsl120sf_rd_comment(int verbose, void *mbio_ptr, FILE *mbfp, int *error);
-int mbr_dsl120sf_wr_data(int verbose, void *mbio_ptr, char *data_ptr, int *error);
-int mbr_dsl120sf_wr_bathamp(int verbose, void *mbio_ptr, FILE *mbfp, int *error);
-int mbr_dsl120sf_wr_amp(int verbose, void *mbio_ptr, FILE *mbfp, int *error);
-int mbr_dsl120sf_wr_comment(int verbose, void *mbio_ptr, FILE *mbfp, int *error);
-
-static char rcs_id[]="$Id: mbr_dsl120sf.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mbr_register_dsl120sf(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_register_dsl120sf";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* get mb_io_ptr */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set format info parameters */
-	status = mbr_info_dsl120sf(verbose,
-			&mb_io_ptr->system,
-			&mb_io_ptr->beams_bath_max,
-			&mb_io_ptr->beams_amp_max,
-			&mb_io_ptr->pixels_ss_max,
-			mb_io_ptr->format_name,
-			mb_io_ptr->system_name,
-			mb_io_ptr->format_description,
-			&mb_io_ptr->numfile,
-			&mb_io_ptr->filetype,
-			&mb_io_ptr->variable_beams,
-			&mb_io_ptr->traveltime,
-			&mb_io_ptr->beam_flagging,
-			&mb_io_ptr->nav_source,
-			&mb_io_ptr->heading_source,
-			&mb_io_ptr->vru_source,
-			&mb_io_ptr->svp_source,
-			&mb_io_ptr->beamwidth_xtrack,
-			&mb_io_ptr->beamwidth_ltrack,
-			error);
-
-	/* set format and system specific function pointers */
-	mb_io_ptr->mb_io_format_alloc = &mbr_alm_dsl120sf;
-	mb_io_ptr->mb_io_format_free = &mbr_dem_dsl120sf;
-	mb_io_ptr->mb_io_store_alloc = &mbsys_dsl_alloc;
-	mb_io_ptr->mb_io_store_free = &mbsys_dsl_deall;
-	mb_io_ptr->mb_io_read_ping = &mbr_rt_dsl120sf;
-	mb_io_ptr->mb_io_write_ping = &mbr_wt_dsl120sf;
-	mb_io_ptr->mb_io_dimensions = &mbsys_dsl_dimensions;
-	mb_io_ptr->mb_io_extract = &mbsys_dsl_extract;
-	mb_io_ptr->mb_io_insert = &mbsys_dsl_insert;
-	mb_io_ptr->mb_io_extract_nav = &mbsys_dsl_extract_nav;
-	mb_io_ptr->mb_io_insert_nav = &mbsys_dsl_insert_nav;
-	mb_io_ptr->mb_io_extract_altitude = &mbsys_dsl_extract_altitude;
-	mb_io_ptr->mb_io_insert_altitude = NULL;
-	mb_io_ptr->mb_io_extract_svp = NULL;
-	mb_io_ptr->mb_io_insert_svp = NULL;
-	mb_io_ptr->mb_io_ttimes = &mbsys_dsl_ttimes;
-	mb_io_ptr->mb_io_detects = &mbsys_dsl_detects;
-	mb_io_ptr->mb_io_copyrecord = &mbsys_dsl_copy;
-	mb_io_ptr->mb_io_extract_rawss = NULL;
-	mb_io_ptr->mb_io_insert_rawss = NULL;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",mb_io_ptr->system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",mb_io_ptr->beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",mb_io_ptr->beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",mb_io_ptr->pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",mb_io_ptr->format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",mb_io_ptr->system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",mb_io_ptr->format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",mb_io_ptr->numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",mb_io_ptr->filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",mb_io_ptr->variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",mb_io_ptr->traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",mb_io_ptr->beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",mb_io_ptr->nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",mb_io_ptr->heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",mb_io_ptr->vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",mb_io_ptr->svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",mb_io_ptr->beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",mb_io_ptr->beamwidth_ltrack);
-		fprintf(stderr,"dbg2       format_alloc:       %p\n",(void *)mb_io_ptr->mb_io_format_alloc);
-		fprintf(stderr,"dbg2       format_free:        %p\n",(void *)mb_io_ptr->mb_io_format_free);
-		fprintf(stderr,"dbg2       store_alloc:        %p\n",(void *)mb_io_ptr->mb_io_store_alloc);
-		fprintf(stderr,"dbg2       store_free:         %p\n",(void *)mb_io_ptr->mb_io_store_free);
-		fprintf(stderr,"dbg2       read_ping:          %p\n",(void *)mb_io_ptr->mb_io_read_ping);
-		fprintf(stderr,"dbg2       write_ping:         %p\n",(void *)mb_io_ptr->mb_io_write_ping);
-		fprintf(stderr,"dbg2       extract:            %p\n",(void *)mb_io_ptr->mb_io_extract);
-		fprintf(stderr,"dbg2       insert:             %p\n",(void *)mb_io_ptr->mb_io_insert);
-		fprintf(stderr,"dbg2       extract_nav:        %p\n",(void *)mb_io_ptr->mb_io_extract_nav);
-		fprintf(stderr,"dbg2       insert_nav:         %p\n",(void *)mb_io_ptr->mb_io_insert_nav);
-		fprintf(stderr,"dbg2       extract_altitude:   %p\n",(void *)mb_io_ptr->mb_io_extract_altitude);
-		fprintf(stderr,"dbg2       insert_altitude:    %p\n",(void *)mb_io_ptr->mb_io_insert_altitude);
-		fprintf(stderr,"dbg2       extract_svp:        %p\n",(void *)mb_io_ptr->mb_io_extract_svp);
-		fprintf(stderr,"dbg2       insert_svp:         %p\n",(void *)mb_io_ptr->mb_io_insert_svp);
-		fprintf(stderr,"dbg2       ttimes:             %p\n",(void *)mb_io_ptr->mb_io_ttimes);
-		fprintf(stderr,"dbg2       detects:            %p\n",(void *)mb_io_ptr->mb_io_detects);
-		fprintf(stderr,"dbg2       extract_rawss:      %p\n",(void *)mb_io_ptr->mb_io_extract_rawss);
-		fprintf(stderr,"dbg2       insert_rawss:       %p\n",(void *)mb_io_ptr->mb_io_insert_rawss);
-		fprintf(stderr,"dbg2       copyrecord:         %p\n",(void *)mb_io_ptr->mb_io_copyrecord);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbr_info_dsl120sf(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error)
-{
-	char	*function_name = "mbr_info_dsl120sf";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* set format info parameters */
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-	*system = MB_SYS_DSL;
-	*beams_bath_max = 2048;
-	*beams_amp_max = 0;
-	*pixels_ss_max = 8192;
-	strncpy(format_name, "DSL120SF", MB_NAME_LENGTH);
-	strncpy(system_name, "DSL", MB_NAME_LENGTH);
-	strncpy(format_description, "Format name:          MBF_DSL120SF\nInformal Description: WHOI DSL AMS-120 processed format\nAttributes:           2048 beam bathymetry, 8192 pixel sidescan,\n                      binary, single files, WHOI DSL.\n", MB_DESCRIPTION_LENGTH);
-	*numfile = 1;
-	*filetype = MB_FILETYPE_NORMAL;
-	*variable_beams = MB_NO;
-	*traveltime = MB_NO;
-	*beam_flagging = MB_YES;
-	*nav_source = MB_DATA_DATA;
-	*heading_source = MB_DATA_DATA;
-	*vru_source = MB_DATA_DATA;
-	*svp_source = MB_DATA_NONE;
-	*beamwidth_xtrack = 0.0;
-	*beamwidth_ltrack = 0.0;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",*system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",*beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",*beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",*pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",*numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",*filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",*variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",*traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",*beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",*nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",*heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",*vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",*svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",*beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",*beamwidth_ltrack);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_alm_dsl120sf(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_alm_dsl120sf";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_dsl120sf_struct *data;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set initial status */
-	status = MB_SUCCESS;
-
-	/* allocate memory for data structure */
-	mb_io_ptr->structure_size = sizeof(struct mbf_dsl120sf_struct);
-	mb_io_ptr->data_structure_size = 0;
-	status = mb_malloc(verbose,mb_io_ptr->structure_size,
-				&mb_io_ptr->raw_data,error);
-	status = mbsys_dsl_alloc(
-			verbose,mbio_ptr,
-			&mb_io_ptr->store_data,error);
-
-	/* initialize everything to zeros */
-	mbr_zero_dsl120sf(verbose,mb_io_ptr->raw_data,error);
-
-	/* get pointer to data descriptor */
-	data = (struct mbf_dsl120sf_struct *) mb_io_ptr->raw_data;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_dem_dsl120sf(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_dem_dsl120sf";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointers to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* deallocate memory for data descriptor */
-	status = mb_free(verbose,&mb_io_ptr->raw_data,error);
-	status = mbsys_dsl_deall(
-			verbose,mbio_ptr,
-			&mb_io_ptr->store_data,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_zero_dsl120sf(int verbose, char *data_ptr, int *error)
-{
-	char	*function_name = "mbr_zero_dsl120sf";
-	int	status = MB_SUCCESS;
-	struct mbf_dsl120sf_struct *data;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       data_ptr:   %p\n",(void *)data_ptr);
-		}
-
-	/* get pointer to data descriptor */
-	data = (struct mbf_dsl120sf_struct *) data_ptr;
-
-	/* initialize everything to zeros */
-	if (data != NULL)
-		{
-
-		/* initialize everything */
-		data->kind = MB_DATA_NONE;
-		data->rec_type = DSL_NONE;
-		data->rec_len = 0;
-		data->rec_hdr_len = 0;
-		data->p_flags = 0;
-		data->num_data_types = 0;
-		data->ping = 0;
-		for (i=0;i<4;i++)
-			data->sonar_cmd[i] = '\0';
-		for (i=0;i<24;i++)
-			data->time_stamp[i] = '\0';
-		data->nav_x = 0.0;
-		data->nav_y = 0.0;
-		data->depth = 0.0;
-		data->heading = 0.0;
-		data->pitch = 0.0;
-		data->roll = 0.0;
-		data->alt = 0.0;
-		data->ang_offset = 0.0;
-		data->transmit_pwr = 0;
-		data->gain_port = 0;
-		data->gain_starbd = 0;
-		data->pulse_width = 0.0;
-		data->swath_width = 0;
-		data->side = 0;
-		data->swapped = 3;
-		data->tv_sec = 0;
-		data->tv_usec = 0;
-		data->digitalinterface = 0;
-		for (i=0;i<5;i++)
-			data->reserved[i] = 0;
-		data->bat_type = DSL_BATH;
-		data->bat_len = 0;
-		data->bat_hdr_len = 0;
-		data->bat_num_bins = 0;
-		data->bat_sampleSize = 0.0;
-		data->bat_p_flags = 0;
-		data->bat_max_range = 0.0;
-		for (i=0;i<10;i++)
-			data->bat_future[i] = 0;
-		for (i=0;i<MBSYS_DSL_MAXBEAMS_SIDE;i++)
-			{
-			data->bat_port[i] = 0.0;
-			data->bat_stbd[i] = 0.0;
-			}
-		data->amp_type = DSL_AMP;
-		data->amp_len = 0;
-		data->amp_hdr_len = 0;
-		data->amp_num_samp = 0;
-		data->amp_sampleSize = 0.0;
-		data->amp_p_flags = 0;
-		data->amp_max_range = 0.0;
-		data->amp_channel = 0.0;
-		for (i=0;i<9;i++)
-			data->amp_future[i] = 0;
-		for (i=0;i<MBSYS_DSL_MAXBEAMS_SIDE;i++)
-			{
-			data->amp_port[i] = 0.0;
-			data->amp_stbd[i] = 0.0;
-			}
-		for (i=0;i<MBF_DSL120SF_COMMENT_LENGTH;i++)
-			data->comment[i] = '\0';
-		}
-
-	/* assume success */
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_rt_dsl120sf(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_rt_dsl120sf";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_dsl120sf_struct *data;
-	struct mbsys_dsl_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointers to mbio descriptor and data structures */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-	data = (struct mbf_dsl120sf_struct *) mb_io_ptr->raw_data;
-	store = (struct mbsys_dsl_struct *) store_ptr;
-
-	/* read next data from file */
-	status = mbr_dsl120sf_rd_data(verbose,mbio_ptr,error);
-
-	/* set error and kind in mb_io_ptr */
-	mb_io_ptr->new_error = *error;
-	mb_io_ptr->new_kind = data->kind;
-
-	/* translate values to dsl data storage structure */
-	if (status == MB_SUCCESS
-		&& store != NULL)
-		{
-		store->kind = data->kind;
-		store->rec_type = data->rec_type;
-		store->rec_len = data->rec_len;
-		store->rec_hdr_len = data->rec_hdr_len;
-		store->p_flags = data->p_flags;
-		store->num_data_types = data->num_data_types;
-		store->ping = data->ping;
-		for (i=0;i<4;i++)
-			store->sonar_cmd[i] = data->sonar_cmd[i];
-		for (i=0;i<24;i++)
-			store->time_stamp[i] = data->time_stamp[i];
-		store->nav_x = data->nav_x;
-		store->nav_y = data->nav_y;
-		store->depth = data->depth;
-		store->heading = data->heading;
-		store->pitch = data->pitch;
-		store->roll = data->roll;
-		store->alt = data->alt;
-		store->ang_offset = data->ang_offset;
-		store->transmit_pwr = data->transmit_pwr;
-		store->gain_port = data->gain_port;
-		store->gain_starbd = data->gain_starbd;
-		store->pulse_width = data->pulse_width;
-		store->swath_width = data->swath_width;
-		store->side = data->side;
-		store->swapped = data->swapped;
-		store->tv_sec = data->tv_sec;
-		store->tv_usec = data->tv_usec;
-		store->digitalinterface = data->digitalinterface;
-		for (i=0;i<5;i++)
-			store->reserved[i] = data->reserved[i];
-		store->bat_type = data->bat_type;
-		store->bat_len = data->bat_len;
-		store->bat_hdr_len = data->bat_hdr_len;
-		store->bat_num_bins = data->bat_num_bins;
-		store->bat_sampleSize = data->bat_sampleSize;
-		store->bat_p_flags = data->bat_p_flags;
-		store->bat_max_range = data->bat_max_range;
-		for (i=0;i<10;i++)
-			store->bat_future[i] = data->bat_future[i];
-		for (i=0;i<MBSYS_DSL_MAXBEAMS_SIDE;i++)
-			{
-			store->bat_port[i] = data->bat_port[i];
-			store->bat_stbd[i] = data->bat_stbd[i];
-			}
-		store->amp_type = data->amp_type;
-		store->amp_len = data->amp_len;
-		store->amp_hdr_len = data->amp_hdr_len;
-		store->amp_num_samp = data->amp_num_samp;
-		store->amp_sampleSize = data->amp_sampleSize;
-		store->amp_p_flags = data->amp_p_flags;
-		store->amp_max_range = data->amp_max_range;
-		store->amp_channel = data->amp_channel;
-		for (i=0;i<9;i++)
-			store->amp_future[i] = data->amp_future[i];
-		for (i=0;i<MBSYS_DSL_MAXBEAMS_SIDE;i++)
-			{
-			store->amp_port[i] = data->amp_port[i];
-			store->amp_stbd[i] = data->amp_stbd[i];
-			}
-		strncpy(store->comment, data->comment,
-			MBSYS_DSL_COMMENT_LENGTH - 1);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_wt_dsl120sf(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_wt_dsl120sf";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_dsl120sf_struct *data;
-	struct mbsys_dsl_struct *store;
-	char	*data_ptr;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_dsl120sf_struct *) mb_io_ptr->raw_data;
-	data_ptr = (char *) data;
-	store = (struct mbsys_dsl_struct *) store_ptr;
-
-	/* first translate values from data storage structure */
-	if (store != NULL)
-		{
-		data->kind = store->kind;
-		data->rec_type = store->rec_type;
-		data->rec_len = store->rec_len;
-		data->rec_hdr_len = store->rec_hdr_len;
-		data->p_flags = store->p_flags;
-		data->num_data_types = store->num_data_types;
-		data->ping = store->ping;
-		for (i=0;i<4;i++)
-			data->sonar_cmd[i] = store->sonar_cmd[i];
-		for (i=0;i<24;i++)
-			data->time_stamp[i] = store->time_stamp[i];
-		data->nav_x = store->nav_x;
-		data->nav_y = store->nav_y;
-		data->depth = store->depth;
-		data->heading = store->heading;
-		data->pitch = store->pitch;
-		data->roll = store->roll;
-		data->alt = store->alt;
-		data->ang_offset = store->ang_offset;
-		data->transmit_pwr = store->transmit_pwr;
-		data->gain_port = store->gain_port;
-		data->gain_starbd = store->gain_starbd;
-		data->pulse_width = store->pulse_width;
-		data->swath_width = store->swath_width;
-		data->side = store->side;
-		data->swapped = store->swapped;
-		data->tv_sec = store->tv_sec;
-		data->tv_usec = store->tv_usec;
-		data->digitalinterface = store->digitalinterface;
-		for (i=0;i<5;i++)
-			data->reserved[i] = store->reserved[i];
-		data->bat_type = store->bat_type;
-		data->bat_len = store->bat_len;
-		data->bat_hdr_len = store->bat_hdr_len;
-		data->bat_num_bins = store->bat_num_bins;
-		data->bat_sampleSize = store->bat_sampleSize;
-		data->bat_p_flags = store->bat_p_flags;
-		data->bat_max_range = store->bat_max_range;
-		for (i=0;i<10;i++)
-			data->bat_future[i] = store->bat_future[i];
-		for (i=0;i<MBSYS_DSL_MAXBEAMS_SIDE;i++)
-			{
-			data->bat_port[i] = store->bat_port[i];
-			data->bat_stbd[i] = store->bat_stbd[i];
-			}
-		data->amp_type = store->amp_type;
-		data->amp_len = store->amp_len;
-		data->amp_hdr_len = store->amp_hdr_len;
-		data->amp_num_samp = store->amp_num_samp;
-		data->amp_sampleSize = store->amp_sampleSize;
-		data->amp_p_flags = store->amp_p_flags;
-		data->amp_max_range = store->amp_max_range;
-		data->amp_channel = store->amp_channel;
-		for (i=0;i<9;i++)
-			data->amp_future[i] = store->amp_future[i];
-		for (i=0;i<MBSYS_DSL_MAXBEAMS_SIDE;i++)
-			{
-			data->amp_port[i] = store->amp_port[i];
-			data->amp_stbd[i] = store->amp_stbd[i];
-			}
-		strncpy(data->comment, store->comment,
-			MBF_DSL120SF_COMMENT_LENGTH - 1);
-		}
-
-	/* write next data to file */
-	status = mbr_dsl120sf_wr_data(verbose,mbio_ptr,data_ptr,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_dsl120sf_rd_data(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_dsl120sf_rd_data";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_dsl120sf_struct *data;
-	char	*data_ptr;
-	char	tag[5];
-	char	type[5];
-	int	len;
-	int	hdr_len;
-	int	found;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_dsl120sf_struct *) mb_io_ptr->raw_data;
-	data_ptr = (char *) data;
-
-	/* read data */
-	if (mb_io_ptr->mbfp != NULL)
-		{
-		/* read next four bytes */
-		found = MB_NO;
-		status = fread(tag, 1, 4, mb_io_ptr->mbfp);
-		if (status == 4)
-			status = MB_SUCCESS;
-		else
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_EOF;
-			}
-
-		/* if tag not found read single bytes until found
-			or end of file */
-		while (found == MB_NO && status == MB_SUCCESS)
-			{
-			/* look for "DSL " tag at start of record */
-			if (strncmp(tag, "DSL ", 4) == 0)
-				found = MB_YES;
-
-			/* read next byte */
-			if (found == MB_NO)
-				{
-				for (i=0;i<3;i++)
-					tag[i] = tag[i+1];
-				status = fread(&tag[3], 1, 1, mb_io_ptr->mbfp);
-				if (status == 1)
-					status = MB_SUCCESS;
-				else
-					{
-					status = MB_FAILURE;
-					*error = MB_ERROR_EOF;
-					}
-				}
-			}
-
-		/* now read the rest of the header */
-		if (status == MB_SUCCESS)
-			status = mbr_dsl120sf_rd_header(verbose,mbio_ptr,
-				mb_io_ptr->mbfp,error);
-
-		/* now read each of the data records */
-		if (status == MB_SUCCESS)
-			for (i=0;i<data->num_data_types;i++)
-				{
-				status = mbr_dsl120sf_rd_dataheader(
-					verbose,mbio_ptr,
-					mb_io_ptr->mbfp,
-					type,&len,&hdr_len,error);
-
-				if (status == MB_SUCCESS
-					&& strncmp(type, "BATH", 4) == 0)
-					{
-					data->bat_len = len;
-					data->bat_hdr_len = hdr_len;
-					status = mbr_dsl120sf_rd_bath(
-						verbose,mbio_ptr,
-						mb_io_ptr->mbfp,error);
-					if (status == MB_SUCCESS)
-						data->kind = MB_DATA_DATA;
-					}
-				else if (status == MB_SUCCESS
-					&& strncmp(type, "AMP ", 4) == 0)
-					{
-					data->amp_len = len;
-					data->amp_hdr_len = hdr_len;
-					status = mbr_dsl120sf_rd_amp(
-						verbose,mbio_ptr,
-						mb_io_ptr->mbfp,error);
-					if (status == MB_SUCCESS)
-						data->kind = MB_DATA_DATA;
-					}
-				else if (status == MB_SUCCESS
-					&& strncmp(type, "COMM", 4) == 0)
-					{
-					status = mbr_dsl120sf_rd_comment(
-						verbose,mbio_ptr,
-						mb_io_ptr->mbfp,error);
-					if (status == MB_SUCCESS)
-						data->kind = MB_DATA_COMMENT;
-					}
-				}
-
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_dsl120sf_rd_header(int verbose, void *mbio_ptr, FILE *mbfp, int *error)
-{
-	char	*function_name = "mbr_dsl120sf_rd_header";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_dsl120sf_struct *data;
-	char	*data_ptr;
-	char	buffer[124];
-	int	index;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_dsl120sf_struct *) mb_io_ptr->raw_data;
-	data_ptr = (char *) data;
-
-	/* read header */
-	status = fread(buffer, 1, 124, mbfp);
-	if (status == 124)
-		{
-		status = MB_SUCCESS;
-		*error = MB_ERROR_NO_ERROR;
-		}
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	/* translate header */
-	if (status == MB_SUCCESS)
-		{
-		data->rec_type = DSL_HEADER;
-
- 		index = 0;
-		mb_get_binary_int(MB_NO, &buffer[index], (int *) &data->rec_len);
-		index += 4;
- 		mb_get_binary_int(MB_NO, &buffer[index], (int *) &data->rec_hdr_len);
-		index += 4;
- 		mb_get_binary_int(MB_NO, &buffer[index], (int *) &data->p_flags);
-		index += 4;
- 		mb_get_binary_int(MB_NO, &buffer[index], (int *) &data->num_data_types);
-		index += 4;
- 		mb_get_binary_int(MB_NO, &buffer[index], (int *) &data->ping);
-		index += 4;
-		for (i=0;i<4;i++)
-			{
-			data->sonar_cmd[i] = buffer[index];
-			index++;
-			}
-		for (i=0;i<24;i++)
-			{
-			data->time_stamp[i] = buffer[index];
-			index++;
-			}
- 		mb_get_binary_float(MB_NO, &buffer[index], &data->nav_x);
-		index += 4;
- 		mb_get_binary_float(MB_NO, &buffer[index], &data->nav_y);
-		index += 4;
- 		mb_get_binary_float(MB_NO, &buffer[index], &data->depth);
-		index += 4;
- 		mb_get_binary_float(MB_NO, &buffer[index], &data->heading);
-		index += 4;
- 		mb_get_binary_float(MB_NO, &buffer[index], &data->pitch);
-		index += 4;
- 		mb_get_binary_float(MB_NO, &buffer[index], &data->roll);
-		index += 4;
- 		mb_get_binary_float(MB_NO, &buffer[index], &data->alt);
-		index += 4;
- 		mb_get_binary_float(MB_NO, &buffer[index], &data->ang_offset);
-		index += 4;
- 		mb_get_binary_int(MB_NO, &buffer[index], (int *) &data->transmit_pwr);
-		index += 4;
- 		mb_get_binary_int(MB_NO, &buffer[index], (int *) &data->gain_port);
-		index += 4;
- 		mb_get_binary_int(MB_NO, &buffer[index], (int *) &data->gain_starbd);
-		index += 4;
- 		mb_get_binary_float(MB_NO, &buffer[index], &data->pulse_width);
-		index += 4;
- 		mb_get_binary_int(MB_NO, &buffer[index], (int *) &data->swath_width);
-		index += 4;
-		data->side = buffer[index];
-		index++;
-		data->swapped = buffer[index];
-		index++;
-		index += 2;
-		mb_get_binary_int(MB_NO, &buffer[index], (int *) &data->tv_sec);
-		index += 4;
-		mb_get_binary_int(MB_NO, &buffer[index], (int *) &data->tv_usec);
-		index += 4;
-		mb_get_binary_short(MB_NO,&buffer[index],&data->digitalinterface);
-		index += 2;
-		for (i=0;i<5;i++)
-			{
-			mb_get_binary_short(MB_NO,&buffer[index],&data->reserved[i]);
-			index += 2;
-			}
-		}
-
-	/* print debug statements */
-	if (verbose >= 5 && status == MB_SUCCESS)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       rec_type:         %d\n",data->rec_type);
-		fprintf(stderr,"dbg5       rec_len:          %d\n",data->rec_len);
-		fprintf(stderr,"dbg5       rec_hdr_len:      %d\n",data->rec_hdr_len);
-		fprintf(stderr,"dbg5       p_flags:          %d\n",data->p_flags);
-		fprintf(stderr,"dbg5       num_data_types:   %d\n",data->num_data_types);
-		fprintf(stderr,"dbg5       ping:             %d\n",data->ping);
-		fprintf(stderr,"dbg5       sonar_cmd:        %c%c%c%c\n",
-			data->sonar_cmd[0], data->sonar_cmd[1],
-			data->sonar_cmd[2], data->sonar_cmd[3]);
-		fprintf(stderr,"dbg5       time_stamp:       ");
-		for (i=0;i<24;i++)
-			fprintf(stderr,"%c", data->time_stamp[i]);
-		fprintf(stderr, "\n");
-		fprintf(stderr,"dbg5       nav_x:            %f\n",data->nav_x);
-		fprintf(stderr,"dbg5       nav_y:            %f\n",data->nav_y);
-		fprintf(stderr,"dbg5       depth:            %f\n",data->depth);
-		fprintf(stderr,"dbg5       heading:          %f\n",data->heading);
-		fprintf(stderr,"dbg5       pitch:            %f\n",data->pitch);
-		fprintf(stderr,"dbg5       roll:             %f\n",data->roll);
-		fprintf(stderr,"dbg5       alt:              %f\n",data->alt);
-		fprintf(stderr,"dbg5       ang_offset:       %f\n",data->ang_offset);
-		fprintf(stderr,"dbg5       transmit_pwr:     %d\n",data->transmit_pwr);
-		fprintf(stderr,"dbg5       gain_port:        %d\n",data->gain_port);
-		fprintf(stderr,"dbg5       gain_starbd:      %d\n",data->gain_starbd);
-		fprintf(stderr,"dbg5       pulse_width:      %f\n",data->pulse_width);
-		fprintf(stderr,"dbg5       swath_width:      %d\n",data->swath_width);
-		fprintf(stderr,"dbg5       side:             %c\n",data->side);
-		fprintf(stderr,"dbg5       swapped:          %c\n",data->swapped);
-		fprintf(stderr,"dbg5       tv_sec:           %d\n",data->tv_sec);
-		fprintf(stderr,"dbg5       tv_usec:          %d\n",data->tv_usec);
-		fprintf(stderr,"dbg5       digitalinterface: %d\n",data->digitalinterface);
-		for (i=0;i<5;i++)
-			fprintf(stderr,"dbg5       reserved:         %d\n", data->reserved[i]);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_dsl120sf_rd_dataheader(int verbose, void *mbio_ptr, FILE *mbfp,
-	char *type, int *len, int *hdr_len, int *error)
-{
-	char	*function_name = "mbr_dsl120sf_rd_dataheader";
-	int	status = MB_SUCCESS;
-	char	buffer[12];
-	int	index;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		}
-
-	/* read header */
-	status = fread(buffer, 1, 12, mbfp);
-	if (status == 12)
-		{
-		status = MB_SUCCESS;
-		*error = MB_ERROR_NO_ERROR;
-		}
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	/* translate header */
-	if (status == MB_SUCCESS)
-		{
-		strncpy(type, buffer, 4);
-		index = 4;
-		mb_get_binary_int(MB_NO,&buffer[index],len);
-		index += 4;
-		mb_get_binary_int(MB_NO,&buffer[index],hdr_len);
-		index += 4;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       type:      %s\n",type);
-		fprintf(stderr,"dbg2       len:       %d\n",*len);
-		fprintf(stderr,"dbg2       hdr_len:   %d\n",*hdr_len);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_dsl120sf_rd_bath(int verbose, void *mbio_ptr, FILE *mbfp, int *error)
-{
-	char	*function_name = "mbr_dsl120sf_rd_bath";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_dsl120sf_struct *data;
-	int	read_bytes;
-	char	*data_ptr;
-	char	buffer[10000];
-	int	index;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_dsl120sf_struct *) mb_io_ptr->raw_data;
-	data_ptr = (char *) data;
-
-	/* read bath record */
-	read_bytes = data->bat_len - 12;
-	status = fread(buffer, 1, read_bytes, mbfp);
-	if (status == read_bytes)
-		{
-		status = MB_SUCCESS;
-		*error = MB_ERROR_NO_ERROR;
-		}
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	/* translate header and data */
-	if (status == MB_SUCCESS)
-		{
-		index = 0;
-		mb_get_binary_int(MB_NO, &buffer[index], (int *) &data->bat_num_bins);
-		index += 4;
-		mb_get_binary_float(MB_NO, &buffer[index], &data->bat_sampleSize);
-		index += 4;
-		mb_get_binary_int(MB_NO, &buffer[index], (int *) &data->bat_p_flags);
-		index += 4;
-		mb_get_binary_float(MB_NO, &buffer[index], &data->bat_max_range);
-		index += 4;
-		for (i=0;i<9;i++)
-			{
-			mb_get_binary_int(MB_NO,&buffer[index],
-					&data->bat_future[i]);
-			index += 4;
-			}
-		for (i=0;i<data->bat_num_bins;i++)
-			{
-			mb_get_binary_float(MB_NO,&buffer[index],
-					&data->bat_port[i]);
-			index += 4;
-			mb_get_binary_float(MB_NO,&buffer[index],
-					&data->bat_stbd[i]);
-			index += 4;
-			}
-		}
-
-	/* print debug statements */
-	if (verbose >= 5 && status == MB_SUCCESS)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       bat_type:         %d\n",data->bat_type);
-		fprintf(stderr,"dbg5       bat_len:          %d\n",data->bat_len);
-		fprintf(stderr,"dbg5       bat_hdr_len:      %d\n",data->bat_hdr_len);
-		fprintf(stderr,"dbg5       bat_num_bins:     %d\n",data->bat_num_bins);
-		fprintf(stderr,"dbg5       bat_sampleSize:   %f\n",data->bat_sampleSize);
-		fprintf(stderr,"dbg5       bat_p_flags:      %d\n",data->bat_p_flags);
-		fprintf(stderr,"dbg5       bat_max_range:    %f\n",data->bat_max_range);
-		for (i=0;i<9;i++)
-			fprintf(stderr,"dbg5       bat_future:       %d\n", data->bat_future[i]);
-		for (i=0;i<data->bat_num_bins;i++)
-			fprintf(stderr,"dbg5       bath[%d]:         %f\t%f\n",
-				i, data->bat_port[i], data->bat_stbd[i]);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_dsl120sf_rd_amp(int verbose, void *mbio_ptr, FILE *mbfp, int *error)
-{
-	char	*function_name = "mbr_dsl120sf_rd_amp";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_dsl120sf_struct *data;
-	int	read_bytes;
-	char	*data_ptr;
-	char	buffer[10000];
-	int	index;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_dsl120sf_struct *) mb_io_ptr->raw_data;
-	data_ptr = (char *) data;
-
-	/* read amp record */
-	read_bytes = data->amp_len - 12;
-	status = fread(buffer, 1, read_bytes, mbfp);
-	if (status == read_bytes)
-		{
-		status = MB_SUCCESS;
-		*error = MB_ERROR_NO_ERROR;
-		}
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	/* translate header and data */
-	if (status == MB_SUCCESS)
-		{
-		index = 0;
-		mb_get_binary_int(MB_NO, &buffer[index], (int *) &data->amp_num_samp);
-		index += 4;
-		mb_get_binary_float(MB_NO, &buffer[index], &data->amp_sampleSize);
-		index += 4;
-		mb_get_binary_int(MB_NO, &buffer[index], (int *) &data->amp_p_flags);
-		index += 4;
-		mb_get_binary_float(MB_NO, &buffer[index], &data->amp_max_range);
-		index += 4;
-		mb_get_binary_int(MB_NO, &buffer[index], (int *) &data->amp_channel);
-		index += 4;
-		for (i=0;i<8;i++)
-			{
-			mb_get_binary_int(MB_NO,&buffer[index],
-					&data->amp_future[i]);
-			index += 4;
-			}
-		for (i=0;i<data->bat_num_bins;i++)
-			{
-			mb_get_binary_float(MB_NO,&buffer[index],
-					&data->amp_port[i]);
-			index += 4;
-			mb_get_binary_float(MB_NO,&buffer[index],
-					&data->amp_stbd[i]);
-			index += 4;
-			}
-		}
-
-	/* print debug statements */
-	if (verbose >= 5 && status == MB_SUCCESS)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       amp_type:         %d\n",data->amp_type);
-		fprintf(stderr,"dbg5       amp_len:          %d\n",data->amp_len);
-		fprintf(stderr,"dbg5       amp_hdr_len:      %d\n",data->amp_hdr_len);
-		fprintf(stderr,"dbg5       amp_num_samp:     %d\n",data->amp_num_samp);
-		fprintf(stderr,"dbg5       amp_sampleSize:   %f\n",data->amp_sampleSize);
-		fprintf(stderr,"dbg5       amp_p_flags:      %d\n",data->amp_p_flags);
-		fprintf(stderr,"dbg5       amp_max_range:    %f\n",data->amp_max_range);
-		fprintf(stderr,"dbg5       amp_channel:      %d\n",data->amp_channel);
-		for (i=0;i<8;i++)
-			fprintf(stderr,"dbg5       amp_future:       %d\n", data->amp_future[i]);
-		for (i=0;i<data->amp_num_samp;i++)
-			fprintf(stderr,"dbg5       amp[%d]:          %f\t%f\n",
-				i, data->amp_port[i], data->amp_stbd[i]);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_dsl120sf_rd_comment(int verbose, void *mbio_ptr, FILE *mbfp, int *error)
-{
-	char	*function_name = "mbr_dsl120sf_rd_comment";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_dsl120sf_struct *data;
-	int	read_bytes;
-	char	*data_ptr;
-	char	buffer[80];
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_dsl120sf_struct *) mb_io_ptr->raw_data;
-	data_ptr = (char *) data;
-
-	/* read comment record */
-	read_bytes = 80;
-	status = fread(buffer, 1, read_bytes, mbfp);
-	if (status == read_bytes)
-		{
-		status = MB_SUCCESS;
-		*error = MB_ERROR_NO_ERROR;
-		}
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	/* copy comment */
-	if (status == MB_SUCCESS)
-		{
-		strncpy(data->comment, buffer, 79);
-		data->comment[79] = '\0';
-		}
-
-	/* print debug statements */
-	if (verbose >= 5 && status == MB_SUCCESS)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       comment:          %s\n",data->comment);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_dsl120sf_wr_data(int verbose, void *mbio_ptr, char *data_ptr, int *error)
-{
-	char	*function_name = "mbr_dsl120sf_wr_data";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_dsl120sf_struct *data;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       data_ptr:   %p\n",(void *)data_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_dsl120sf_struct *) data_ptr;
-
-	if (data->kind == MB_DATA_COMMENT)
-		{
-		status = mbr_dsl120sf_wr_comment(verbose,mbio_ptr,mb_io_ptr->mbfp,error);
-		}
-	else if (data->kind == MB_DATA_DATA)
-		{
-		status = mbr_dsl120sf_wr_bathamp(verbose,
-				mbio_ptr,mb_io_ptr->mbfp,error);
-		}
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_BAD_KIND;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Data record kind in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       kind:       %d\n",data->kind);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_dsl120sf_wr_bathamp(int verbose, void *mbio_ptr, FILE *mbfp, int *error)
-{
-	char	*function_name = "mbr_dsl120sf_wr_bathamp";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_dsl120sf_struct *data;
-	char	*data_ptr;
-	char	buffer[17000];
-	int	index;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_dsl120sf_struct *) mb_io_ptr->raw_data;
-	data_ptr = (char *) data;
-
-	/* print debug statements */
-	if (verbose >= 5 && status == MB_SUCCESS)
-		{
-		fprintf(stderr,"\ndbg5  Values to write in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       rec_type:         %d\n",data->rec_type);
-		fprintf(stderr,"dbg5       rec_len:          %d\n",data->rec_len);
-		fprintf(stderr,"dbg5       rec_hdr_len:      %d\n",data->rec_hdr_len);
-		fprintf(stderr,"dbg5       p_flags:          %d\n",data->p_flags);
-		fprintf(stderr,"dbg5       num_data_types:   %d\n",data->num_data_types);
-		fprintf(stderr,"dbg5       ping:             %d\n",data->ping);
-		fprintf(stderr,"dbg5       sonar_cmd:        %c%c%c%c\n",
-			data->sonar_cmd[0], data->sonar_cmd[1],
-			data->sonar_cmd[2], data->sonar_cmd[3]);
-		fprintf(stderr,"dbg5       time_stamp:       ");
-		for (i=0;i<24;i++)
-			fprintf(stderr,"%c", data->time_stamp[i]);
-		fprintf(stderr, "\n");
-		fprintf(stderr,"dbg5       nav_x:            %f\n",data->nav_x);
-		fprintf(stderr,"dbg5       nav_y:            %f\n",data->nav_y);
-		fprintf(stderr,"dbg5       depth:            %f\n",data->depth);
-		fprintf(stderr,"dbg5       heading:          %f\n",data->heading);
-		fprintf(stderr,"dbg5       pitch:            %f\n",data->pitch);
-		fprintf(stderr,"dbg5       roll:             %f\n",data->roll);
-		fprintf(stderr,"dbg5       alt:              %f\n",data->alt);
-		fprintf(stderr,"dbg5       ang_offset:       %f\n",data->ang_offset);
-		fprintf(stderr,"dbg5       transmit_pwr:     %d\n",data->transmit_pwr);
-		fprintf(stderr,"dbg5       gain_port:        %d\n",data->gain_port);
-		fprintf(stderr,"dbg5       gain_starbd:      %d\n",data->gain_starbd);
-		fprintf(stderr,"dbg5       pulse_width:      %f\n",data->pulse_width);
-		fprintf(stderr,"dbg5       swath_width:      %d\n",data->swath_width);
-		fprintf(stderr,"dbg5       side:             %c\n",data->side);
-		fprintf(stderr,"dbg5       swapped:          %c\n",data->swapped);
-		fprintf(stderr,"dbg5       tv_sec:           %d\n",data->tv_sec);
-		fprintf(stderr,"dbg5       tv_usec:          %d\n",data->tv_usec);
-		fprintf(stderr,"dbg5       digitalinterface: %d\n",data->digitalinterface);
-		for (i=0;i<5;i++)
-			fprintf(stderr,"dbg5       reserved:         %d\n", data->reserved[i]);
-		fprintf(stderr,"dbg5       bat_type:         %d\n",data->bat_type);
-		fprintf(stderr,"dbg5       bat_len:          %d\n",data->bat_len);
-		fprintf(stderr,"dbg5       bat_hdr_len:      %d\n",data->bat_hdr_len);
-		fprintf(stderr,"dbg5       bat_num_bins:     %d\n",data->bat_num_bins);
-		fprintf(stderr,"dbg5       bat_sampleSize:   %f\n",data->bat_sampleSize);
-		fprintf(stderr,"dbg5       bat_p_flags:      %d\n",data->bat_p_flags);
-		fprintf(stderr,"dbg5       bat_max_range:    %f\n",data->bat_max_range);
-		for (i=0;i<9;i++)
-			fprintf(stderr,"dbg5       bat_future:       %d\n", data->bat_future[i]);
-		for (i=0;i<data->bat_num_bins;i++)
-			fprintf(stderr,"dbg5       bath[%d]:         %f\t%f\n",
-				i, data->bat_port[i], data->bat_stbd[i]);
-		fprintf(stderr,"dbg5       amp_type:         %d\n",data->amp_type);
-		fprintf(stderr,"dbg5       amp_len:          %d\n",data->amp_len);
-		fprintf(stderr,"dbg5       amp_hdr_len:      %d\n",data->amp_hdr_len);
-		fprintf(stderr,"dbg5       amp_num_samp:     %d\n",data->amp_num_samp);
-		fprintf(stderr,"dbg5       amp_sampleSize:   %f\n",data->amp_sampleSize);
-		fprintf(stderr,"dbg5       amp_p_flags:      %d\n",data->amp_p_flags);
-		fprintf(stderr,"dbg5       amp_max_range:    %f\n",data->amp_max_range);
-		fprintf(stderr,"dbg5       amp_channel:      %d\n",data->amp_channel);
-		for (i=0;i<8;i++)
-			fprintf(stderr,"dbg5       amp_future:       %d\n", data->amp_future[i]);
-		for (i=0;i<data->amp_num_samp;i++)
-			fprintf(stderr,"dbg5       amp[%d]:          %f\t%f\n",
-				i, data->amp_port[i], data->amp_stbd[i]);
-		}
-
-	/* make sure both bath and amp are included */
-	data->num_data_types = 2;
-	data->rec_len = data->rec_hdr_len
-			+ data->bat_len
-			+ data->bat_hdr_len
-			+ data->amp_len
-			+ data->amp_hdr_len;
-
-	/* construct header record */
-	index = 0;
-	mb_put_binary_int(MB_NO,DSL_HEADER,&buffer[index]);
-	index += 4;
-	mb_put_binary_int(MB_NO,data->rec_len,&buffer[index]);
-	index += 4;
- 	mb_put_binary_int(MB_NO,data->rec_hdr_len,&buffer[index]);
-	index += 4;
- 	mb_put_binary_int(MB_NO,data->p_flags,&buffer[index]);
-	index += 4;
- 	mb_put_binary_int(MB_NO,data->num_data_types,&buffer[index]);
-	index += 4;
- 	mb_put_binary_int(MB_NO,data->ping,&buffer[index]);
-	index += 4;
-	for (i=0;i<4;i++)
-		{
-		buffer[index] = data->sonar_cmd[i];
-		index++;
-		}
-	for (i=0;i<24;i++)
-		{
-		buffer[index] = data->time_stamp[i];
-		index++;
-		}
- 	mb_put_binary_float(MB_NO,data->nav_x,&buffer[index]);
-	index += 4;
- 	mb_put_binary_float(MB_NO,data->nav_y,&buffer[index]);
-	index += 4;
- 	mb_put_binary_float(MB_NO,data->depth,&buffer[index]);
-	index += 4;
- 	mb_put_binary_float(MB_NO,data->heading,&buffer[index]);
-	index += 4;
- 	mb_put_binary_float(MB_NO,data->pitch,&buffer[index]);
-	index += 4;
- 	mb_put_binary_float(MB_NO,data->roll,&buffer[index]);
-	index += 4;
- 	mb_put_binary_float(MB_NO,data->alt,&buffer[index]);
-	index += 4;
- 	mb_put_binary_float(MB_NO,data->ang_offset,&buffer[index]);
-	index += 4;
- 	mb_put_binary_int(MB_NO,data->transmit_pwr,&buffer[index]);
-	index += 4;
- 	mb_put_binary_int(MB_NO,data->gain_port,&buffer[index]);
-	index += 4;
- 	mb_put_binary_int(MB_NO,data->gain_starbd,&buffer[index]);
-	index += 4;
- 	mb_put_binary_float(MB_NO,data->pulse_width,&buffer[index]);
-	index += 4;
- 	mb_put_binary_int(MB_NO,data->swath_width,&buffer[index]);
-	index += 4;
-	buffer[index] = data->side;
-	index++;
-	buffer[index] = data->swapped;
-	index++;
-	index += 2;
-	mb_put_binary_int(MB_NO,data->tv_sec,&buffer[index]);
-	index += 4;
-	mb_put_binary_int(MB_NO,data->tv_usec,&buffer[index]);
-	index += 4;
-	mb_put_binary_short(MB_NO,data->digitalinterface,&buffer[index]);
-	index += 2;
-	for (i=0;i<5;i++)
-		{
-		mb_put_binary_short(MB_NO,data->reserved[i],&buffer[index]);
-		index += 2;
-		}
-
-	/* construct bathymetry record */
-	mb_put_binary_int(MB_NO,data->bat_type,&buffer[index]);
-	index += 4;
-	mb_put_binary_int(MB_NO,data->bat_len,&buffer[index]);
-	index += 4;
-	mb_put_binary_int(MB_NO,data->bat_hdr_len,&buffer[index]);
-	index += 4;
-	mb_put_binary_int(MB_NO,data->bat_num_bins,&buffer[index]);
-	index += 4;
-	mb_put_binary_float(MB_NO,data->bat_sampleSize,&buffer[index]);
-	index += 4;
-	mb_put_binary_int(MB_NO,data->bat_p_flags,&buffer[index]);
-	index += 4;
-	mb_put_binary_float(MB_NO,data->bat_max_range,&buffer[index]);
-	index += 4;
-	for (i=0;i<9;i++)
-		{
-		mb_put_binary_int(MB_NO,data->bat_future[i],&buffer[index]);
-		index += 4;
-		}
-	for (i=0;i<data->bat_num_bins;i++)
-		{
-		mb_put_binary_float(MB_NO,data->bat_port[i],&buffer[index]);
-		index += 4;
-		mb_put_binary_float(MB_NO,data->bat_stbd[i],&buffer[index]);
-		index += 4;
-		}
-
-	/* construct amplitude record */
-	mb_put_binary_int(MB_NO,data->amp_type,&buffer[index]);
-	index += 4;
-	mb_put_binary_int(MB_NO,data->amp_len,&buffer[index]);
-	index += 4;
-	mb_put_binary_int(MB_NO,data->amp_hdr_len,&buffer[index]);
-	index += 4;
-	mb_put_binary_int(MB_NO,data->amp_num_samp,&buffer[index]);
-	index += 4;
-	mb_put_binary_float(MB_NO,data->amp_sampleSize,&buffer[index]);
-	index += 4;
-	mb_put_binary_int(MB_NO,data->amp_p_flags,&buffer[index]);
-	index += 4;
-	mb_put_binary_float(MB_NO,data->amp_max_range,&buffer[index]);
-	index += 4;
-	mb_put_binary_int(MB_NO,data->amp_channel,&buffer[index]);
-	index += 4;
-	for (i=0;i<8;i++)
-		{
-		mb_put_binary_int(MB_NO,data->amp_future[i],&buffer[index]);
-		index += 4;
-		}
-	for (i=0;i<data->bat_num_bins;i++)
-		{
-		mb_put_binary_float(MB_NO,data->amp_port[i],&buffer[index]);
-		index += 4;
-		mb_put_binary_float(MB_NO,data->amp_stbd[i],&buffer[index]);
-		index += 4;
-		}
-
-	/* write the record */
-	status = fwrite(buffer,1,data->rec_len,mbfp);
-	if (status != data->rec_len)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	else
-		status = MB_SUCCESS;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_dsl120sf_wr_comment(int verbose, void *mbio_ptr, FILE *mbfp, int *error)
-{
-	char	*function_name = "mbr_dsl120sf_wr_comment";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_dsl120sf_struct *data;
-	char	*data_ptr;
-	char	buffer[10000];
-	int	index;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_dsl120sf_struct *) mb_io_ptr->raw_data;
-	data_ptr = (char *) data;
-
-	/* print debug statements */
-	if (verbose >= 5 && status == MB_SUCCESS)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       comment:          %s\n",data->comment);
-		}
-
-	/* set record and header sizes */
-	data->num_data_types = 1;
-	data->rec_len = 128 + 12 + 80;
-	data->rec_hdr_len = 128;
-
-	index = 0;
-	mb_put_binary_int(MB_NO,DSL_HEADER,&buffer[index]);
-	index += 4;
-	mb_put_binary_int(MB_NO,data->rec_len,&buffer[index]);
-	index += 4;
- 	mb_put_binary_int(MB_NO,data->rec_hdr_len,&buffer[index]);
-	index += 4;
- 	mb_put_binary_int(MB_NO,data->p_flags,&buffer[index]);
-	index += 4;
- 	mb_put_binary_int(MB_NO,data->num_data_types,&buffer[index]);
-	index += 4;
- 	mb_put_binary_int(MB_NO,data->ping,&buffer[index]);
-	index += 4;
-	for (i=0;i<4;i++)
-		{
-		buffer[index] = data->sonar_cmd[i];
-		index++;
-		}
-	for (i=0;i<24;i++)
-		{
-		buffer[index] = data->time_stamp[i];
-		index++;
-		}
- 	mb_put_binary_float(MB_NO,data->nav_x,&buffer[index]);
-	index += 4;
- 	mb_put_binary_float(MB_NO,data->nav_y,&buffer[index]);
-	index += 4;
- 	mb_put_binary_float(MB_NO,data->depth,&buffer[index]);
-	index += 4;
- 	mb_put_binary_float(MB_NO,data->heading,&buffer[index]);
-	index += 4;
- 	mb_put_binary_float(MB_NO,data->pitch,&buffer[index]);
-	index += 4;
- 	mb_put_binary_float(MB_NO,data->roll,&buffer[index]);
-	index += 4;
- 	mb_put_binary_float(MB_NO,data->alt,&buffer[index]);
-	index += 4;
- 	mb_put_binary_float(MB_NO,data->ang_offset,&buffer[index]);
-	index += 4;
- 	mb_put_binary_int(MB_NO,data->transmit_pwr,&buffer[index]);
-	index += 4;
- 	mb_put_binary_int(MB_NO,data->gain_port,&buffer[index]);
-	index += 4;
- 	mb_put_binary_int(MB_NO,data->gain_starbd,&buffer[index]);
-	index += 4;
- 	mb_put_binary_float(MB_NO,data->pulse_width,&buffer[index]);
-	index += 4;
- 	mb_put_binary_int(MB_NO,data->swath_width,&buffer[index]);
-	index += 4;
-	buffer[index] = data->side;
-	index++;
-	buffer[index] = data->swapped;
-	index++;
-	index += 2;
-	mb_put_binary_int(MB_NO,data->tv_sec,&buffer[index]);
-	index += 4;
-	mb_put_binary_int(MB_NO,data->tv_usec,&buffer[index]);
-	index += 4;
-	mb_put_binary_short(MB_NO,data->digitalinterface,&buffer[index]);
-	index += 2;
-	for (i=0;i<5;i++)
-		{
-		mb_put_binary_short(MB_NO,data->reserved[i],&buffer[index]);
-		index += 2;
-		}
-
-	/* construct comment record */
-	mb_put_binary_int(MB_NO,DSL_COMMENT,&buffer[index]);
-	index += 4;
-	mb_put_binary_int(MB_NO,12+80,&buffer[index]);
-	index += 4;
-	mb_put_binary_int(MB_NO,12,&buffer[index]);
-	index += 4;
- 	strncpy(&buffer[index], data->comment, 79);
- 	index += 79;
-	buffer[index] = '\0';
-	index++;
-
-	/* write the record */
-	status = fwrite(buffer,1,data->rec_len,mbfp);
-	if (status != data->rec_len)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	else
-		{
-		status = MB_SUCCESS;
-		*error = MB_ERROR_NO_ERROR;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mbr_edgjstar.c b/src/mbio/mbr_edgjstar.c
deleted file mode 100644
index 00180b3..0000000
--- a/src/mbio/mbr_edgjstar.c
+++ /dev/null
@@ -1,3802 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbr_edgjstar.c	5/2/2005
- *	$Id: mbr_edgjstar.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 2005-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbr_edgjstar.c contains the functions for reading
- * sidescan data in the EDGJSTAR format.
- * These functions include:
- *   mbr_alm_edgjstar	- allocate read/write memory
- *   mbr_dem_edgjstar	- deallocate read/write memory
- *   mbr_rt_edgjstar	- read and translate data
- *   mbr_wt_edgjstar	- translate and write data
- *
- * Author:	D. W. Caress
- * Date:	May 2, 2005
- * $Log: mbr_edgjstar.c,v $
- * Revision 5.4  2008/07/10 06:43:40  caress
- * Preparing for 5.1.1beta20
- *
- * Revision 5.3  2006/11/10 22:36:04  caress
- * Working towards release 5.1.0
- *
- * Revision 5.2  2006/04/11 19:14:46  caress
- * Various fixes.
- *
- * Revision 5.1  2005/11/05 00:48:04  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.0  2005/06/04 04:11:35  caress
- * Support for Edgetech Jstar format (id 132 and 133).
- *
- *
- *
- */
-
-/* Debug flag */
-/* #define MBF_EDGJSTAR_DEBUG 1 */
-
-/* standard include files */
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mb_define.h"
-#include "mb_swap.h"
-#include "mbsys_jstar.h"
-
-/* essential function prototypes */
-int mbr_register_edgjstar(int verbose, void *mbio_ptr,
-		int *error);
-int mbr_info_edgjstar(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_register_edgjstr2(int verbose, void *mbio_ptr,
-		int *error);
-int mbr_info_edgjstr2(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_alm_edgjstar(int verbose, void *mbio_ptr, int *error);
-int mbr_dem_edgjstar(int verbose, void *mbio_ptr, int *error);
-int mbr_rt_edgjstar(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_wt_edgjstar(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-
-static char rcs_id[]="$Id: mbr_edgjstar.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mbr_register_edgjstar(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_register_edgjstar";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* get mb_io_ptr */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set format info parameters */
-	status = mbr_info_edgjstar(verbose,
-			&mb_io_ptr->system,
-			&mb_io_ptr->beams_bath_max,
-			&mb_io_ptr->beams_amp_max,
-			&mb_io_ptr->pixels_ss_max,
-			mb_io_ptr->format_name,
-			mb_io_ptr->system_name,
-			mb_io_ptr->format_description,
-			&mb_io_ptr->numfile,
-			&mb_io_ptr->filetype,
-			&mb_io_ptr->variable_beams,
-			&mb_io_ptr->traveltime,
-			&mb_io_ptr->beam_flagging,
-			&mb_io_ptr->nav_source,
-			&mb_io_ptr->heading_source,
-			&mb_io_ptr->vru_source,
-			&mb_io_ptr->svp_source,
-			&mb_io_ptr->beamwidth_xtrack,
-			&mb_io_ptr->beamwidth_ltrack,
-			error);
-
-	/* set format and system specific function pointers */
-	mb_io_ptr->mb_io_format_alloc = &mbr_alm_edgjstar;
-	mb_io_ptr->mb_io_format_free = &mbr_dem_edgjstar;
-	mb_io_ptr->mb_io_store_alloc = &mbsys_jstar_alloc;
-	mb_io_ptr->mb_io_store_free = &mbsys_jstar_deall;
-	mb_io_ptr->mb_io_read_ping = &mbr_rt_edgjstar;
-	mb_io_ptr->mb_io_write_ping = &mbr_wt_edgjstar;
-	mb_io_ptr->mb_io_dimensions = &mbsys_jstar_dimensions;
-	mb_io_ptr->mb_io_pingnumber = &mbsys_jstar_pingnumber;
-	mb_io_ptr->mb_io_preprocess = &mbsys_jstar_preprocess;
-	mb_io_ptr->mb_io_extract = &mbsys_jstar_extract;
-	mb_io_ptr->mb_io_insert = &mbsys_jstar_insert;
-	mb_io_ptr->mb_io_extract_nav = &mbsys_jstar_extract_nav;
-	mb_io_ptr->mb_io_insert_nav = &mbsys_jstar_insert_nav;
-	mb_io_ptr->mb_io_extract_altitude = &mbsys_jstar_extract_altitude;
-	mb_io_ptr->mb_io_insert_altitude = &mbsys_jstar_insert_altitude;
-	mb_io_ptr->mb_io_extract_svp = NULL;
-	mb_io_ptr->mb_io_insert_svp = NULL;
-	mb_io_ptr->mb_io_ttimes = &mbsys_jstar_ttimes;
-	mb_io_ptr->mb_io_detects = &mbsys_jstar_detects;
-	mb_io_ptr->mb_io_extract_rawssdimensions = &mbsys_jstar_extract_rawssdimensions;
-	mb_io_ptr->mb_io_extract_rawss = &mbsys_jstar_extract_rawss;
-	mb_io_ptr->mb_io_insert_rawss = &mbsys_jstar_insert_rawss;
-	mb_io_ptr->mb_io_extract_segytraceheader = &mbsys_jstar_extract_segytraceheader;
-	mb_io_ptr->mb_io_extract_segy = &mbsys_jstar_extract_segy;
-	mb_io_ptr->mb_io_insert_segy = &mbsys_jstar_insert_segy;
-	mb_io_ptr->mb_io_ctd = &mbsys_jstar_ctd;
-	mb_io_ptr->mb_io_copyrecord = &mbsys_jstar_copyrecord;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",mb_io_ptr->system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",mb_io_ptr->beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",mb_io_ptr->beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",mb_io_ptr->pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",mb_io_ptr->format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",mb_io_ptr->system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",mb_io_ptr->format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",mb_io_ptr->numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",mb_io_ptr->filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",mb_io_ptr->variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",mb_io_ptr->traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",mb_io_ptr->beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",mb_io_ptr->nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",mb_io_ptr->heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",mb_io_ptr->vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",mb_io_ptr->svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",mb_io_ptr->beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",mb_io_ptr->beamwidth_ltrack);
-		fprintf(stderr,"dbg2       format_alloc:       %p\n",(void *)mb_io_ptr->mb_io_format_alloc);
-		fprintf(stderr,"dbg2       format_free:        %p\n",(void *)mb_io_ptr->mb_io_format_free);
-		fprintf(stderr,"dbg2       store_alloc:        %p\n",(void *)mb_io_ptr->mb_io_store_alloc);
-		fprintf(stderr,"dbg2       store_free:         %p\n",(void *)mb_io_ptr->mb_io_store_free);
-		fprintf(stderr,"dbg2       read_ping:          %p\n",(void *)mb_io_ptr->mb_io_read_ping);
-		fprintf(stderr,"dbg2       write_ping:         %p\n",(void *)mb_io_ptr->mb_io_write_ping);
-		fprintf(stderr,"dbg2       extract:            %p\n",(void *)mb_io_ptr->mb_io_extract);
-		fprintf(stderr,"dbg2       insert:             %p\n",(void *)mb_io_ptr->mb_io_insert);
-		fprintf(stderr,"dbg2       extract_nav:        %p\n",(void *)mb_io_ptr->mb_io_extract_nav);
-		fprintf(stderr,"dbg2       insert_nav:         %p\n",(void *)mb_io_ptr->mb_io_insert_nav);
-		fprintf(stderr,"dbg2       extract_altitude:   %p\n",(void *)mb_io_ptr->mb_io_extract_altitude);
-		fprintf(stderr,"dbg2       insert_altitude:    %p\n",(void *)mb_io_ptr->mb_io_insert_altitude);
-		fprintf(stderr,"dbg2       extract_svp:        %p\n",(void *)mb_io_ptr->mb_io_extract_svp);
-		fprintf(stderr,"dbg2       insert_svp:         %p\n",(void *)mb_io_ptr->mb_io_insert_svp);
-		fprintf(stderr,"dbg2       ttimes:             %p\n",(void *)mb_io_ptr->mb_io_ttimes);
-		fprintf(stderr,"dbg2       detects:            %p\n",(void *)mb_io_ptr->mb_io_detects);
-		fprintf(stderr,"dbg2       extract_rawssdimensions: %p\n",(void *)mb_io_ptr->mb_io_extract_rawssdimensions);
-		fprintf(stderr,"dbg2       extract_rawss:      %p\n",(void *)mb_io_ptr->mb_io_extract_rawss);
-		fprintf(stderr,"dbg2       insert_rawss:       %p\n",(void *)mb_io_ptr->mb_io_insert_rawss);
-		fprintf(stderr,"dbg2       extract_segytraceheader: %p\n",(void *)mb_io_ptr->mb_io_extract_segytraceheader);
-		fprintf(stderr,"dbg2       extract_segy:       %p\n",(void *)mb_io_ptr->mb_io_extract_segy);
-		fprintf(stderr,"dbg2       insert_segy:        %p\n",(void *)mb_io_ptr->mb_io_insert_segy);
-		fprintf(stderr,"dbg2       ctd:                %p\n",(void *)mb_io_ptr->mb_io_ctd);
-		fprintf(stderr,"dbg2       copyrecord:         %p\n",(void *)mb_io_ptr->mb_io_copyrecord);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbr_info_edgjstar(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error)
-{
-	char	*function_name = "mbr_info_edgjstar";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* set format info parameters */
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-	*system = MB_SYS_JSTAR;
-	*beams_bath_max = 1;
-	*beams_amp_max = 0;
-	*pixels_ss_max = MBSYS_JSTAR_PIXELS_MAX;
-	strncpy(format_name, "EDGJSTAR", MB_NAME_LENGTH);
-	strncpy(system_name, "JSTAR", MB_NAME_LENGTH);
-	strncpy(format_description, "Format name:          MBF_EDGJSTAR\nInformal Description: Edgetech Jstar format\nAttributes:           variable pixels, dual frequency sidescan and subbottom,\n                      binary SEGY variant, single files,\n                      low frequency sidescan returned as\n                      survey data, Edgetech. \n", MB_DESCRIPTION_LENGTH);
-	*numfile = 1;
-	*filetype = MB_FILETYPE_NORMAL;
-	*variable_beams = MB_NO;
-	*traveltime = MB_NO;
-	*beam_flagging = MB_NO;
-	*nav_source = MB_DATA_DATA;
-	*heading_source = MB_DATA_DATA;
-	*vru_source = MB_DATA_DATA;
-	*svp_source = MB_DATA_NONE;
-	*beamwidth_xtrack = 0.0;
-	*beamwidth_ltrack = 0.0;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",*system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",*beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",*beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",*pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",*numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",*filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",*variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",*traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",*beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",*nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",*heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",*vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",*svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",*beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",*beamwidth_ltrack);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_register_edgjstr2(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_register_edgjstr2";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* get mb_io_ptr */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set format info parameters */
-	status = mbr_info_edgjstr2(verbose,
-			&mb_io_ptr->system,
-			&mb_io_ptr->beams_bath_max,
-			&mb_io_ptr->beams_amp_max,
-			&mb_io_ptr->pixels_ss_max,
-			mb_io_ptr->format_name,
-			mb_io_ptr->system_name,
-			mb_io_ptr->format_description,
-			&mb_io_ptr->numfile,
-			&mb_io_ptr->filetype,
-			&mb_io_ptr->variable_beams,
-			&mb_io_ptr->traveltime,
-			&mb_io_ptr->beam_flagging,
-			&mb_io_ptr->nav_source,
-			&mb_io_ptr->heading_source,
-			&mb_io_ptr->vru_source,
-			&mb_io_ptr->svp_source,
-			&mb_io_ptr->beamwidth_xtrack,
-			&mb_io_ptr->beamwidth_ltrack,
-			error);
-
-	/* set format and system specific function pointers */
-	mb_io_ptr->mb_io_format_alloc = &mbr_alm_edgjstar;
-	mb_io_ptr->mb_io_format_free = &mbr_dem_edgjstar;
-	mb_io_ptr->mb_io_store_alloc = &mbsys_jstar_alloc;
-	mb_io_ptr->mb_io_store_free = &mbsys_jstar_deall;
-	mb_io_ptr->mb_io_read_ping = &mbr_rt_edgjstar;
-	mb_io_ptr->mb_io_write_ping = &mbr_wt_edgjstar;
-	mb_io_ptr->mb_io_dimensions = &mbsys_jstar_dimensions;
-	mb_io_ptr->mb_io_pingnumber = &mbsys_jstar_pingnumber;
-	mb_io_ptr->mb_io_preprocess = &mbsys_jstar_preprocess;
-	mb_io_ptr->mb_io_extract = &mbsys_jstar_extract;
-	mb_io_ptr->mb_io_insert = &mbsys_jstar_insert;
-	mb_io_ptr->mb_io_extract_nav = &mbsys_jstar_extract_nav;
-	mb_io_ptr->mb_io_insert_nav = &mbsys_jstar_insert_nav;
-	mb_io_ptr->mb_io_extract_altitude = &mbsys_jstar_extract_altitude;
-	mb_io_ptr->mb_io_insert_altitude = NULL;
-	mb_io_ptr->mb_io_extract_svp = NULL;
-	mb_io_ptr->mb_io_insert_svp = NULL;
-	mb_io_ptr->mb_io_ttimes = &mbsys_jstar_ttimes;
-	mb_io_ptr->mb_io_detects = &mbsys_jstar_detects;
-	mb_io_ptr->mb_io_extract_rawssdimensions = &mbsys_jstar_extract_rawssdimensions;
-	mb_io_ptr->mb_io_extract_rawss = &mbsys_jstar_extract_rawss;
-	mb_io_ptr->mb_io_insert_rawss = &mbsys_jstar_insert_rawss;
-	mb_io_ptr->mb_io_extract_segytraceheader = &mbsys_jstar_extract_segytraceheader;
-	mb_io_ptr->mb_io_extract_segy = &mbsys_jstar_extract_segy;
-	mb_io_ptr->mb_io_insert_segy = &mbsys_jstar_insert_segy;
-	mb_io_ptr->mb_io_ctd = &mbsys_jstar_ctd;
-	mb_io_ptr->mb_io_copyrecord = &mbsys_jstar_copyrecord;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",mb_io_ptr->system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",mb_io_ptr->beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",mb_io_ptr->beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",mb_io_ptr->pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",mb_io_ptr->format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",mb_io_ptr->system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",mb_io_ptr->format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",mb_io_ptr->numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",mb_io_ptr->filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",mb_io_ptr->variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",mb_io_ptr->traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",mb_io_ptr->beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",mb_io_ptr->nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",mb_io_ptr->heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",mb_io_ptr->vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",mb_io_ptr->svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",mb_io_ptr->beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",mb_io_ptr->beamwidth_ltrack);
-		fprintf(stderr,"dbg2       format_alloc:       %p\n",(void *)mb_io_ptr->mb_io_format_alloc);
-		fprintf(stderr,"dbg2       format_free:        %p\n",(void *)mb_io_ptr->mb_io_format_free);
-		fprintf(stderr,"dbg2       store_alloc:        %p\n",(void *)mb_io_ptr->mb_io_store_alloc);
-		fprintf(stderr,"dbg2       store_free:         %p\n",(void *)mb_io_ptr->mb_io_store_free);
-		fprintf(stderr,"dbg2       read_ping:          %p\n",(void *)mb_io_ptr->mb_io_read_ping);
-		fprintf(stderr,"dbg2       write_ping:         %p\n",(void *)mb_io_ptr->mb_io_write_ping);
-		fprintf(stderr,"dbg2       extract:            %p\n",(void *)mb_io_ptr->mb_io_extract);
-		fprintf(stderr,"dbg2       insert:             %p\n",(void *)mb_io_ptr->mb_io_insert);
-		fprintf(stderr,"dbg2       extract_nav:        %p\n",(void *)mb_io_ptr->mb_io_extract_nav);
-		fprintf(stderr,"dbg2       insert_nav:         %p\n",(void *)mb_io_ptr->mb_io_insert_nav);
-		fprintf(stderr,"dbg2       extract_altitude:   %p\n",(void *)mb_io_ptr->mb_io_extract_altitude);
-		fprintf(stderr,"dbg2       insert_altitude:    %p\n",(void *)mb_io_ptr->mb_io_insert_altitude);
-		fprintf(stderr,"dbg2       extract_svp:        %p\n",(void *)mb_io_ptr->mb_io_extract_svp);
-		fprintf(stderr,"dbg2       insert_svp:         %p\n",(void *)mb_io_ptr->mb_io_insert_svp);
-		fprintf(stderr,"dbg2       ttimes:             %p\n",(void *)mb_io_ptr->mb_io_ttimes);
-		fprintf(stderr,"dbg2       detects:            %p\n",(void *)mb_io_ptr->mb_io_detects);
-		fprintf(stderr,"dbg2       extract_rawssdimensions: %p\n",(void *)mb_io_ptr->mb_io_extract_rawssdimensions);
-		fprintf(stderr,"dbg2       extract_rawss:      %p\n",(void *)mb_io_ptr->mb_io_extract_rawss);
-		fprintf(stderr,"dbg2       insert_rawss:       %p\n",(void *)mb_io_ptr->mb_io_insert_rawss);
-		fprintf(stderr,"dbg2       extract_segytraceheader: %p\n",(void *)mb_io_ptr->mb_io_extract_segytraceheader);
-		fprintf(stderr,"dbg2       extract_segy:       %p\n",(void *)mb_io_ptr->mb_io_extract_segy);
-		fprintf(stderr,"dbg2       insert_segy:        %p\n",(void *)mb_io_ptr->mb_io_insert_segy);
-		fprintf(stderr,"dbg2       ctd:                %p\n",(void *)mb_io_ptr->mb_io_ctd);
-		fprintf(stderr,"dbg2       copyrecord:         %p\n",(void *)mb_io_ptr->mb_io_copyrecord);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbr_info_edgjstr2(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error)
-{
-	char	*function_name = "mbr_info_edgjstr2";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* set format info parameters */
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-	*system = MB_SYS_JSTAR;
-	*beams_bath_max = 1;
-	*beams_amp_max = 0;
-	*pixels_ss_max = MBSYS_JSTAR_PIXELS_MAX;
-	strncpy(format_name, "EDGJSTR2", MB_NAME_LENGTH);
-	strncpy(system_name, "EDGJSTR2", MB_NAME_LENGTH);
-	strncpy(format_description, "Format name:          MBF_EDGJSTR2\nInformal Description: Edgetech Jstar format\nAttributes:           variable pixels, dual frequency sidescan and subbottom,\n                      binary SEGY variant, single files,\n                      high frequency sidescan returned as\n                      survey data, Edgetech. \n", MB_DESCRIPTION_LENGTH);
-	*numfile = 1;
-	*filetype = MB_FILETYPE_NORMAL;
-	*variable_beams = MB_NO;
-	*traveltime = MB_NO;
-	*beam_flagging = MB_NO;
-	*nav_source = MB_DATA_DATA;
-	*heading_source = MB_DATA_DATA;
-	*vru_source = MB_DATA_DATA;
-	*svp_source = MB_DATA_NONE;
-	*beamwidth_xtrack = 0.0;
-	*beamwidth_ltrack = 0.0;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",*system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",*beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",*beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",*pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",*numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",*filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",*variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",*traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",*beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",*nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",*heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",*vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",*svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",*beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",*beamwidth_ltrack);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_alm_edgjstar(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_alm_edgjstar";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set initial status */
-	status = MB_SUCCESS;
-
-	/* allocate memory for data structure */
-	mb_io_ptr->structure_size = 0;
-	mbsys_jstar_alloc(verbose, mbio_ptr, &mb_io_ptr->store_data, error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_dem_edgjstar(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_dem_edgjstar";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* deallocate memory for data structure */
-	status = mbsys_jstar_deall(verbose, mbio_ptr, &mb_io_ptr->store_data, error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_rt_edgjstar(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_rt_edgjstar";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_jstar_message_struct message;
-	struct mbsys_jstar_struct *store;
-	struct mbsys_jstar_channel_struct *sbp;
-	struct mbsys_jstar_channel_struct *ss;
-	struct mbsys_jstar_nmea_struct *nmea;
-	struct mbsys_jstar_pitchroll_struct *pitchroll;
-	struct mbsys_jstar_dvl_struct *dvl;
-	struct mbsys_jstar_pressure_struct *pressure;
-	struct mbsys_jstar_sysinfo_struct *sysinfo;
-	struct mbsys_jstar_comment_struct *comment;
-	struct mbsys_jstar_ssold_struct ssold_tmp;
-	char	buffer[MBSYS_JSTAR_SYSINFO_MAX];
-	char	nmeastring[MB_COMMENT_MAXLINE];
-	int	index;
-	int	done;
-	int	read_status;
-	int	shortspersample;
-	int	trace_size;
-	double	time_d;
-	double	navlon, navlat, heading;
-	double	speed, sonardepth, altitude;
-	double	heave, roll, pitch;
-	double	rawvalue;
-	int	time_i[7];
-	int	time_j[5];
-	double	depthofsensor, offset;
-	char	**nap, *nargv[25], *string;
-	int	nargc;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_jstar_struct *) store_ptr;
-	
-	/* have a local struct mbsys_jstar_ss_struct ss_tmp for
-	 * reading old "sidescan" records and translating them
-	 * to the current form - initialize the trace to null */
-	ssold_tmp.trace_alloc = 0;
-	ssold_tmp.trace = NULL;
-	
-	/* make sure the sidescan ping numbers and channels are initialized so
-	 * that it is impossible to mistakenly report a full ping read when only
-	 * one channel has been read */
-	store->ssport.pingNum = -1;
-	store->ssstbd.pingNum = -1;
-	store->ssport.message.subsystem = -1;
-	store->ssstbd.message.subsystem = -1;
-
-	/* loop over reading data until a full record of some sort is read */
-	done = MB_NO;
-	while (done == MB_NO)
-		{
-		/* read message header */
-		if ((read_status = fread(buffer, MBSYS_JSTAR_MESSAGE_SIZE,
-				    1, mb_io_ptr->mbfp)) == 1)
-			{
-			/* extract the message header values */
-			index = 0;
-			mb_get_binary_short(MB_YES, &buffer[index], &(message.start_marker)); index += 2;
-			message.version = (mb_u_char) buffer[index]; index++;
-			message.session = (mb_u_char) buffer[index]; index++;
-			mb_get_binary_short(MB_YES, &buffer[index], &(message.type)); index += 2;
-			message.command = (mb_u_char) buffer[index]; index++;
-			message.subsystem = (mb_u_char) buffer[index]; index++;
-			message.channel = (mb_u_char) buffer[index]; index++;
-			message.sequence = (mb_u_char) buffer[index]; index++;
-			mb_get_binary_short(MB_YES, &buffer[index], &(message.reserved)); index += 2;
-			mb_get_binary_int(MB_YES, &buffer[index], &(message.size)); index += 4;
-
-			store->subsystem = message.subsystem;
-			
-			status = MB_SUCCESS;
-#ifdef MBF_EDGJSTAR_DEBUG
-fprintf(stderr,"NEW MESSAGE HEADER: status:%d message.type:%d message.subsystem:%d channel:%d message.size:%d\n",
-status,message.type,message.subsystem,message.channel,message.size);
-#endif
-			}
-
-		/* end of file */
-		else
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_EOF;
-			done = MB_YES;
-			store->kind = MB_DATA_NONE;
-#ifdef MBF_EDGJSTAR_DEBUG
-fprintf(stderr,"REACHED END OF FILE: status:%d\n", status);
-#endif
-			}
-
-		/* if comment proceed to get data */
-		if (status == MB_SUCCESS && message.type == MBSYS_JSTAR_DATA_COMMENT
-			&& message.size < MB_COMMENT_MAXLINE)
-			{
-			/* comment channel */
-			comment = (struct mbsys_jstar_comment_struct *) &(store->comment);
-			comment->message = message;
-
-			/* read the comment */
-			if ((read_status = fread(comment->comment, message.size,
-			    		1, mb_io_ptr->mbfp)) == 1)
-				{
-				comment->comment[message.size] = 0;
-				done = MB_YES;
-				store->kind = MB_DATA_COMMENT;
-				}
-
-			/* end of file */
-			else
-				{
-				status = MB_FAILURE;
-				*error = MB_ERROR_EOF;
-				done = MB_YES;
-				store->kind = MB_DATA_NONE;
-				}
-			}
-
-		/* if subbottom data and sonar trace 80 proceed to get data */
-		else if (status == MB_SUCCESS
-			&& message.type == MBSYS_JSTAR_DATA_SONAR
-			&& message.subsystem == MBSYS_JSTAR_SUBSYSTEM_SBP)
-			{
-			/* sbp channel */
-			sbp = (struct mbsys_jstar_channel_struct *) &(store->sbp);
-			sbp->message = message;
-
-			/* read the 240 byte trace header */
-			if ((read_status = fread(buffer, MBSYS_JSTAR_SBPHEADER_SIZE,
-			    		1, mb_io_ptr->mbfp)) == 1)
-				{
-				index = 0;
-				mb_get_binary_int(MB_YES, &buffer[index], &(sbp->sequenceNumber)); index += 4;
-				mb_get_binary_int(MB_YES, &buffer[index], &(sbp->startDepth)); index += 4;
-				mb_get_binary_int(MB_YES, &buffer[index], &(sbp->pingNum)); index += 4;
-				mb_get_binary_int(MB_YES, &buffer[index], &(sbp->channelNum)); index += 4;
-				for (i=0;i<6;i++)
-					{
-					mb_get_binary_short(MB_YES, &buffer[index], &(sbp->unused1[i])); index += 2;
-					}
-				mb_get_binary_short(MB_YES, &buffer[index], &(sbp->traceIDCode)); index += 2;
-				for (i=0;i<2;i++)
-					{
-					mb_get_binary_short(MB_YES, &buffer[index], &(sbp->unused2[i])); index += 2;
-					}
-				mb_get_binary_short(MB_YES, &buffer[index], &(sbp->dataFormat)); index += 2;
-				mb_get_binary_short(MB_YES, &buffer[index], &(sbp->NMEAantennaeR)); index += 2;
-				mb_get_binary_short(MB_YES, &buffer[index], &(sbp->NMEAantennaeO)); index += 2;
-				for (i=0;i<32;i++)
-					{
-					sbp->RS232[i] = buffer[index]; index++;
-					}
-				mb_get_binary_int(MB_YES, &buffer[index], &(sbp->sourceCoordX)); index += 4;
-				mb_get_binary_int(MB_YES, &buffer[index], &(sbp->sourceCoordY)); index += 4;
-				mb_get_binary_int(MB_YES, &buffer[index], &(sbp->groupCoordX)); index += 4;
-				mb_get_binary_int(MB_YES, &buffer[index], &(sbp->groupCoordY)); index += 4;
-				mb_get_binary_short(MB_YES, &buffer[index], &(sbp->coordUnits)); index += 2;
-				for (i=0;i<24;i++)
-					{
-					sbp->annotation[i] = buffer[index]; index++;
-					}
- 				mb_get_binary_short(MB_YES, &buffer[index], &(sbp->samples)); index += 2;
-				mb_get_binary_int(MB_YES, &buffer[index], &(sbp->sampleInterval)); index += 4;
- 				mb_get_binary_short(MB_YES, &buffer[index], &(sbp->ADCGain)); index += 2;
-				mb_get_binary_short(MB_YES, &buffer[index], &(sbp->pulsePower)); index += 2;
-				mb_get_binary_short(MB_YES, &buffer[index], &(sbp->correlated)); index += 2;
- 				mb_get_binary_short(MB_YES, &buffer[index], &(sbp->startFreq)); index += 2;
- 				mb_get_binary_short(MB_YES, &buffer[index], &(sbp->endFreq)); index += 2;
- 				mb_get_binary_short(MB_YES, &buffer[index], &(sbp->sweepLength)); index += 2;
-				for (i=0;i<4;i++)
-					{
-					mb_get_binary_short(MB_YES, &buffer[index], &(sbp->unused7[i])); index += 2;
-					}
- 				mb_get_binary_short(MB_YES, &buffer[index], &(sbp->aliasFreq)); index += 2;
- 				mb_get_binary_short(MB_YES, &buffer[index], &(sbp->pulseID)); index += 2;
-				for (i=0;i<6;i++)
-					{
-					mb_get_binary_short(MB_YES, &buffer[index], &(sbp->unused8[i])); index += 2;
-					}
-				mb_get_binary_short(MB_YES, &buffer[index], &(sbp->year)); index += 2;
-				mb_get_binary_short(MB_YES, &buffer[index], &(sbp->day)); index += 2;
-				mb_get_binary_short(MB_YES, &buffer[index], &(sbp->hour)); index += 2;
-				mb_get_binary_short(MB_YES, &buffer[index], &(sbp->minute)); index += 2;
-				mb_get_binary_short(MB_YES, &buffer[index], &(sbp->second)); index += 2;
-				mb_get_binary_short(MB_YES, &buffer[index], &(sbp->timeBasis)); index += 2;
-				mb_get_binary_short(MB_YES, &buffer[index], &(sbp->weightingFactor)); index += 2;
-				mb_get_binary_short(MB_YES, &buffer[index], &(sbp->unused9)); index += 2;
-				mb_get_binary_short(MB_YES, &buffer[index], &(sbp->heading)); index += 2;
-				mb_get_binary_short(MB_YES, &buffer[index], &(sbp->pitch)); index += 2;
-				mb_get_binary_short(MB_YES, &buffer[index], &(sbp->roll)); index += 2;
-				mb_get_binary_short(MB_YES, &buffer[index], &(sbp->temperature)); index += 2;
-				mb_get_binary_short(MB_YES, &buffer[index], &(sbp->heaveCompensation)); index += 2;
-				mb_get_binary_short(MB_YES, &buffer[index], &(sbp->trigSource)); index += 2;
- 				mb_get_binary_short(MB_YES, &buffer[index], &(sbp->markNumber)); index += 2;
-				mb_get_binary_short(MB_YES, &buffer[index], &(sbp->NMEAHour)); index += 2;
-				mb_get_binary_short(MB_YES, &buffer[index], &(sbp->NMEAMinutes)); index += 2;
-				mb_get_binary_short(MB_YES, &buffer[index], &(sbp->NMEASeconds)); index += 2;
-				mb_get_binary_short(MB_YES, &buffer[index], &(sbp->NMEACourse)); index += 2;
-				mb_get_binary_short(MB_YES, &buffer[index], &(sbp->NMEASpeed)); index += 2;
-				mb_get_binary_short(MB_YES, &buffer[index], &(sbp->NMEADay)); index += 2;
-				mb_get_binary_short(MB_YES, &buffer[index], &(sbp->NMEAYear)); index += 2;
-				mb_get_binary_int(MB_YES, &buffer[index], &(sbp->millisecondsToday)); index += 4;
- 				mb_get_binary_short(MB_YES, &buffer[index], &(sbp->ADCMax)); index += 2;
-				mb_get_binary_short(MB_YES, &buffer[index], &(sbp->calConst)); index += 2;
-				mb_get_binary_short(MB_YES, &buffer[index], &(sbp->vehicleID)); index += 2;
-				for (i=0;i<6;i++)
-					{
-					sbp->softwareVersion[i] = buffer[index]; index++;
-					}
-				mb_get_binary_int(MB_YES, &buffer[index], &(sbp->sphericalCorrection)); index += 4;
- 				mb_get_binary_short(MB_YES, &buffer[index], &(sbp->packetNum)); index += 2;
-				mb_get_binary_short(MB_YES, &buffer[index], &(sbp->ADCDecimation)); index += 2;
-				mb_get_binary_short(MB_YES, &buffer[index], &(sbp->decimation)); index += 2;
-				mb_get_binary_short(MB_YES, &buffer[index], &(sbp->unuseda)); index += 2;
-				mb_get_binary_int(MB_YES, &buffer[index], &(sbp->depth)); index += 4;
-				mb_get_binary_int(MB_YES, &buffer[index], &(sbp->sonardepth)); index += 4;
-				mb_get_binary_int(MB_YES, &buffer[index], &(sbp->sonaraltitude)); index += 4;
-
-				/* allocate memory for the trace */
-				if (sbp->dataFormat == 1)
-					shortspersample = 2;
-				else
-					shortspersample = 1;
-				trace_size = shortspersample * sbp->samples * sizeof(short);
-				if (sbp->trace_alloc < trace_size)
-					{
-					if ((status = mb_reallocd(verbose, __FILE__, __LINE__,
-								trace_size, (void **)&(sbp->trace), error))
-						== MB_SUCCESS)
-						{
-						sbp->trace_alloc = trace_size;
-						}
-					else
-						fprintf(stderr,"TRACE ALLOCATION FAILED %s Line:%d Size:%d\n",
-							__FILE__, __LINE__, trace_size);
-					}
-
-				/* read the trace */
-				if (status == MB_SUCCESS
-					&& (read_status = fread(sbp->trace, trace_size,
-			    			1, mb_io_ptr->mbfp)) == 1)
-					{
-#ifndef BYTESWAPPED
-					for (i=0;i<shortspersample * sbp->samples;i++)
-						{
-						sbp->trace[i] = mb_swap_short(sbp->trace[i]);;
-						}
-#endif
-					}
-				else
-					{
-					status = MB_FAILURE;
-					*error = MB_ERROR_EOF;
-					done = MB_YES;
-					store->kind = MB_DATA_NONE;
-					}
-
-				/* get time */
-				time_j[0] = sbp->year;
-				time_j[1] = sbp->day;
-				time_j[2] = 60 * sbp->hour + sbp->minute;
-				time_j[3] = sbp->second;
-				time_j[4] = (int)1000 * (sbp->millisecondsToday
-						- 1000 * floor(0.001 * ((double)sbp->millisecondsToday)));
-				mb_get_itime(verbose, time_j, time_i);
-				mb_get_time(verbose, time_i, &time_d);
-
-				/* set navigation and attitude if needed and available */
-				if (sbp->heading == 0 && mb_io_ptr->nheading > 0)
-					{
-					mb_hedint_interp(verbose, mbio_ptr, time_d, &heading, error);
-					sbp->heading = (short) (100.0 * heading);
-					}
-				if ((sbp->groupCoordX == 0 || sbp->groupCoordY == 0 || sbp->coordUnits == 2)
-					&& mb_io_ptr->nfix > 0)
-					{
-					mb_navint_interp(verbose, mbio_ptr, time_d, heading, 0.0,
-								&navlon, &navlat, &speed, error);
-					sbp->sourceCoordX = (int) (600000.0 * navlon);
-					sbp->sourceCoordY = (int) (600000.0 * navlat);
-					sbp->groupCoordX = (int) (600000.0 * navlon);
-					sbp->groupCoordY = (int) (600000.0 * navlat);
-					}
-				if ((sbp->roll == 0 || sbp->pitch == 0 || sbp->heaveCompensation == 0)
-					&& mb_io_ptr->nattitude > 0)
-					{
-					mb_attint_interp(verbose, mbio_ptr, time_d, &heave, &roll, &pitch, error);
-					sbp->roll = 32768 * roll / 180.0;
-					sbp->pitch = 32768 * pitch / 180.0;
-					sbp->heaveCompensation = heave /
-							sbp->sampleInterval / 0.00000075;
-					}
-				if (sbp->sonaraltitude == 0 && mb_io_ptr->naltitude > 0)
-					{
-					mb_altint_interp(verbose, mbio_ptr, time_d, &altitude, error);
-					sbp->sonaraltitude = altitude / 1000.0;
-					}
-				if (sbp->sonardepth == 0 && mb_io_ptr->nsonardepth > 0)
-					{
-					mb_depint_interp(verbose, mbio_ptr, time_d, &sonardepth, error);
-					sbp->sonardepth = sonardepth / 1000.0;
-					}
-
-				/* set kind */
-				store->kind = MB_DATA_SUBBOTTOM_SUBBOTTOM;
-				done = MB_YES;
-				}
-
-			/* end of file */
-			else
-				{
-				status = MB_FAILURE;
-				*error = MB_ERROR_EOF;
-				done = MB_YES;
-				store->kind = MB_DATA_NONE;
-				}
-			}
-
-		/* if sidescan data and sonar trace 80 proceed to get data */
-		else if (status == MB_SUCCESS
-			&& message.type == MBSYS_JSTAR_DATA_SONAR
-			&& message.subsystem != MBSYS_JSTAR_SUBSYSTEM_SBP)
-			{
-			/* sidescan channel */
-			if (message.channel == 0)
-				{
-				ss = (struct mbsys_jstar_channel_struct *) &(store->ssport);
-				}
-			else
-				{
-				ss = (struct mbsys_jstar_channel_struct *) &(store->ssstbd);
-				}
-			ss->message = message;
-
-			/* read the 240 byte trace header */
-			if ((read_status = fread(buffer, MBSYS_JSTAR_SBPHEADER_SIZE,
-			    		1, mb_io_ptr->mbfp)) == 1)
-				{
-				index = 0;
-				mb_get_binary_int(MB_YES, &buffer[index], &(ss->sequenceNumber)); index += 4;
-				mb_get_binary_int(MB_YES, &buffer[index], &(ss->startDepth)); index += 4;
-				mb_get_binary_int(MB_YES, &buffer[index], &(ss->pingNum)); index += 4;
-				mb_get_binary_int(MB_YES, &buffer[index], &(ss->channelNum)); index += 4;
-				for (i=0;i<6;i++)
-					{
-					mb_get_binary_short(MB_YES, &buffer[index], &(ss->unused1[i])); index += 2;
-					}
-				mb_get_binary_short(MB_YES, &buffer[index], &(ss->traceIDCode)); index += 2;
-				for (i=0;i<2;i++)
-					{
-					mb_get_binary_short(MB_YES, &buffer[index], &(ss->unused2[i])); index += 2;
-					}
-				mb_get_binary_short(MB_YES, &buffer[index], &(ss->dataFormat)); index += 2;
-				mb_get_binary_short(MB_YES, &buffer[index], &(ss->NMEAantennaeR)); index += 2;
-				mb_get_binary_short(MB_YES, &buffer[index], &(ss->NMEAantennaeO)); index += 2;
-				for (i=0;i<32;i++)
-					{
-					ss->RS232[i] = buffer[index]; index++;
-					}
-				mb_get_binary_int(MB_YES, &buffer[index], &(ss->sourceCoordX)); index += 4;
-				mb_get_binary_int(MB_YES, &buffer[index], &(ss->sourceCoordY)); index += 4;
-				mb_get_binary_int(MB_YES, &buffer[index], &(ss->groupCoordX)); index += 4;
-				mb_get_binary_int(MB_YES, &buffer[index], &(ss->groupCoordY)); index += 4;
-				mb_get_binary_short(MB_YES, &buffer[index], &(ss->coordUnits)); index += 2;
-				for (i=0;i<24;i++)
-					{
-					ss->annotation[i] = buffer[index]; index++;
-					}
- 				mb_get_binary_short(MB_YES, &buffer[index], &(ss->samples)); index += 2;
-				mb_get_binary_int(MB_YES, &buffer[index], &(ss->sampleInterval)); index += 4;
- 				mb_get_binary_short(MB_YES, &buffer[index], &(ss->ADCGain)); index += 2;
-				mb_get_binary_short(MB_YES, &buffer[index], &(ss->pulsePower)); index += 2;
-				mb_get_binary_short(MB_YES, &buffer[index], &(ss->correlated)); index += 2;
- 				mb_get_binary_short(MB_YES, &buffer[index], &(ss->startFreq)); index += 2;
- 				mb_get_binary_short(MB_YES, &buffer[index], &(ss->endFreq)); index += 2;
- 				mb_get_binary_short(MB_YES, &buffer[index], &(ss->sweepLength)); index += 2;
-				for (i=0;i<4;i++)
-					{
-					mb_get_binary_short(MB_YES, &buffer[index], &(ss->unused7[i])); index += 2;
-					}
- 				mb_get_binary_short(MB_YES, &buffer[index], &(ss->aliasFreq)); index += 2;
- 				mb_get_binary_short(MB_YES, &buffer[index], &(ss->pulseID)); index += 2;
-				for (i=0;i<6;i++)
-					{
-					mb_get_binary_short(MB_YES, &buffer[index], &(ss->unused8[i])); index += 2;
-					}
-				mb_get_binary_short(MB_YES, &buffer[index], &(ss->year)); index += 2;
-				mb_get_binary_short(MB_YES, &buffer[index], &(ss->day)); index += 2;
-				mb_get_binary_short(MB_YES, &buffer[index], &(ss->hour)); index += 2;
-				mb_get_binary_short(MB_YES, &buffer[index], &(ss->minute)); index += 2;
-				mb_get_binary_short(MB_YES, &buffer[index], &(ss->second)); index += 2;
-				mb_get_binary_short(MB_YES, &buffer[index], &(ss->timeBasis)); index += 2;
-				mb_get_binary_short(MB_YES, &buffer[index], &(ss->weightingFactor)); index += 2;
-				mb_get_binary_short(MB_YES, &buffer[index], &(ss->unused9)); index += 2;
-				mb_get_binary_short(MB_YES, &buffer[index], &(ss->heading)); index += 2;
-				mb_get_binary_short(MB_YES, &buffer[index], &(ss->pitch)); index += 2;
-				mb_get_binary_short(MB_YES, &buffer[index], &(ss->roll)); index += 2;
-				mb_get_binary_short(MB_YES, &buffer[index], &(ss->temperature)); index += 2;
-				mb_get_binary_short(MB_YES, &buffer[index], &(ss->heaveCompensation)); index += 2;
-				mb_get_binary_short(MB_YES, &buffer[index], &(ss->trigSource)); index += 2;
- 				mb_get_binary_short(MB_YES, &buffer[index], &(ss->markNumber)); index += 2;
-				mb_get_binary_short(MB_YES, &buffer[index], &(ss->NMEAHour)); index += 2;
-				mb_get_binary_short(MB_YES, &buffer[index], &(ss->NMEAMinutes)); index += 2;
-				mb_get_binary_short(MB_YES, &buffer[index], &(ss->NMEASeconds)); index += 2;
-				mb_get_binary_short(MB_YES, &buffer[index], &(ss->NMEACourse)); index += 2;
-				mb_get_binary_short(MB_YES, &buffer[index], &(ss->NMEASpeed)); index += 2;
-				mb_get_binary_short(MB_YES, &buffer[index], &(ss->NMEADay)); index += 2;
-				mb_get_binary_short(MB_YES, &buffer[index], &(ss->NMEAYear)); index += 2;
-				mb_get_binary_int(MB_YES, &buffer[index], &(ss->millisecondsToday)); index += 4;
- 				mb_get_binary_short(MB_YES, &buffer[index], &(ss->ADCMax)); index += 2;
-				mb_get_binary_short(MB_YES, &buffer[index], &(ss->calConst)); index += 2;
-				mb_get_binary_short(MB_YES, &buffer[index], &(ss->vehicleID)); index += 2;
-				for (i=0;i<6;i++)
-					{
-					ss->softwareVersion[i] = buffer[index]; index++;
-					}
-				mb_get_binary_int(MB_YES, &buffer[index], &(ss->sphericalCorrection)); index += 4;
- 				mb_get_binary_short(MB_YES, &buffer[index], &(ss->packetNum)); index += 2;
-				mb_get_binary_short(MB_YES, &buffer[index], &(ss->ADCDecimation)); index += 2;
-				mb_get_binary_short(MB_YES, &buffer[index], &(ss->decimation)); index += 2;
-				mb_get_binary_short(MB_YES, &buffer[index], &(ss->unuseda)); index += 2;
-				mb_get_binary_int(MB_YES, &buffer[index], &(ss->depth)); index += 4;
-				mb_get_binary_int(MB_YES, &buffer[index], &(ss->sonardepth)); index += 4;
-				mb_get_binary_int(MB_YES, &buffer[index], &(ss->sonaraltitude)); index += 4;
-
-				/* allocate memory for the trace */
-				if (ss->dataFormat == 1)
-					shortspersample = 2;
-				else
-					shortspersample = 1;
-				trace_size = shortspersample * ss->samples * sizeof(short);
-				if (ss->trace_alloc < trace_size)
-					{
-					if ((status = mb_reallocd(verbose, __FILE__, __LINE__,
-								trace_size, (void **)&(ss->trace), error))
-						== MB_SUCCESS)
-						{
-						ss->trace_alloc = trace_size;
-						}
-					else
-						fprintf(stderr,"TRACE ALLOCATION FAILED %s Line:%d Size:%d\n",
-							__FILE__, __LINE__, trace_size);
-					}
-
-				/* read the trace */
-				if (status == MB_SUCCESS
-					&& (read_status = fread(ss->trace, trace_size,
-			    			1, mb_io_ptr->mbfp)) == 1)
-					{
-#ifndef BYTESWAPPED
-					for (i=0;i<shortspersample * ss->samples;i++)
-						{
-						ss->trace[i] = mb_swap_short(ss->trace[i]);;
-						}
-#endif
-					}
-				else
-					{
-					status = MB_FAILURE;
-					*error = MB_ERROR_EOF;
-					done = MB_YES;
-					store->kind = MB_DATA_NONE;
-					}
-
-				/* get time */
-				time_j[0] = ss->year;
-				time_j[1] = ss->day;
-				time_j[2] = 60 * ss->hour + ss->minute;
-				time_j[3] = ss->second;
-				time_j[4] = (int)1000 * (ss->millisecondsToday
-						- 1000 * floor(0.001 * ((double)ss->millisecondsToday)));
-				mb_get_itime(verbose, time_j, time_i);
-				mb_get_time(verbose, time_i, &time_d);
-
-				/* set navigation and attitude if needed and available */
-				if (ss->heading == 0 && mb_io_ptr->nheading > 0)
-					{
-					mb_hedint_interp(verbose, mbio_ptr, time_d, &heading, error);
-					ss->heading = (short) (100.0 * heading);
-					}
-				if ((ss->groupCoordX == 0 || ss->groupCoordY == 0 || ss->coordUnits == 2)
-					&& mb_io_ptr->nfix > 0)
-					{
-					mb_navint_interp(verbose, mbio_ptr, time_d, heading, 0.0,
-								&navlon, &navlat, &speed, error);
-					ss->sourceCoordX = (int) (600000.0 * navlon);
-					ss->sourceCoordY = (int) (600000.0 * navlat);
-					ss->groupCoordX = (int) (600000.0 * navlon);
-					ss->groupCoordY = (int) (600000.0 * navlat);
-					}
-				if ((ss->roll == 0 || ss->pitch == 0 || ss->heaveCompensation == 0)
-					&& mb_io_ptr->nattitude > 0)
-					{
-					mb_attint_interp(verbose, mbio_ptr, time_d, &heave, &roll, &pitch, error);
-					ss->roll = 32768 * roll / 180.0;
-					ss->pitch = 32768 * pitch / 180.0;
-					ss->heaveCompensation = heave /
-							ss->sampleInterval / 0.00000075;
-					}
-				if (ss->sonaraltitude == 0 && mb_io_ptr->naltitude > 0)
-					{
-					mb_altint_interp(verbose, mbio_ptr, time_d, &altitude, error);
-					ss->sonaraltitude = 1000 * altitude;
-					}
-				if (ss->sonardepth == 0 && mb_io_ptr->nsonardepth > 0)
-					{
-					mb_depint_interp(verbose, mbio_ptr, time_d, &sonardepth, error);
-					ss->sonardepth = 1000 * sonardepth;
-					}
-
-				/* set kind */
-				if (mb_io_ptr->format == MBF_EDGJSTAR)
-					{
-					if (message.subsystem == MBSYS_JSTAR_SUBSYSTEM_SSLOW)
-						store->kind = MB_DATA_DATA;
-					else if (message.subsystem == MBSYS_JSTAR_SUBSYSTEM_SSHIGH)
-						store->kind = MB_DATA_SIDESCAN2;
-					}
-				else
-					{
-					if (message.subsystem == MBSYS_JSTAR_SUBSYSTEM_SSHIGH)
-						store->kind = MB_DATA_DATA;
-					else if (message.subsystem == MBSYS_JSTAR_SUBSYSTEM_SSLOW)
-						store->kind = MB_DATA_SIDESCAN2;
-					}
-				if (store->ssport.pingNum == store->ssstbd.pingNum
-							&& store->ssport.message.subsystem
-								== store->ssstbd.message.subsystem)
-					{
-					done = MB_YES;
-					}
-#ifdef MBF_EDGJSTAR_DEBUG
-fprintf(stderr,"Done reading 1: %d  pingNum:%d %d   subsystem:%d %d\n",
-done,store->ssport.pingNum,store->ssstbd.pingNum,
-store->ssport.message.subsystem,store->ssstbd.message.subsystem);
-#endif
-				}
-
-			/* else end of file */
-			else
-				{
-				status = MB_FAILURE;
-				*error = MB_ERROR_EOF;
-				done = MB_YES;
-				store->kind = MB_DATA_NONE;
-				}
-			}
-
-		/* if subbottom data and sonar trace 82 proceed to get data
-			- translate to current form */
-		else if (status == MB_SUCCESS
-			&& message.type == MBSYS_JSTAR_DATA_SONAR2
-			&& message.subsystem == MBSYS_JSTAR_SUBSYSTEM_SBP)
-			{
-			/* reset message type to current sonar trace 80 */
-			message.type = MBSYS_JSTAR_DATA_SONAR;
-
-			/* sbp channel */
-			sbp = (struct mbsys_jstar_channel_struct *) &(store->sbp);
-			sbp->message = message;
-			
-			/* temporary old format structure */
-			ssold_tmp.message = message;
-
-			/* read the 80 byte trace header */
-			if ((read_status = fread(buffer, MBSYS_JSTAR_SSOLDHEADER_SIZE,
-			    		1, mb_io_ptr->mbfp)) == 1)
-				{
-				index = 0;
-				mb_get_binary_short(MB_YES, &buffer[index], &(ssold_tmp.subsystem)); index += 2;
-				mb_get_binary_short(MB_YES, &buffer[index], &(ssold_tmp.channelNum)); index += 2;
-				mb_get_binary_int(MB_YES, &buffer[index], &(ssold_tmp.pingNum)); index += 4;
-				mb_get_binary_short(MB_YES, &buffer[index], &(ssold_tmp.packetNum)); index += 2;
-				mb_get_binary_short(MB_YES, &buffer[index], &(ssold_tmp.trigSource)); index += 2;
-				mb_get_binary_int(MB_YES, &buffer[index], &(ssold_tmp.samples)); index += 4;
-				mb_get_binary_int(MB_YES, &buffer[index], &(ssold_tmp.sampleInterval)); index += 4;
-				mb_get_binary_int(MB_YES, &buffer[index], &(ssold_tmp.startDepth)); index += 4;
-				mb_get_binary_short(MB_YES, &buffer[index], &(ssold_tmp.weightingFactor)); index += 2;
-				mb_get_binary_short(MB_YES, &buffer[index], &(ssold_tmp.ADCGain)); index += 2;
-				mb_get_binary_short(MB_YES, &buffer[index], &(ssold_tmp.ADCMax)); index += 2;
-				mb_get_binary_short(MB_YES, &buffer[index], &(ssold_tmp.rangeSetting)); index += 2;
-				mb_get_binary_short(MB_YES, &buffer[index], &(ssold_tmp.pulseID)); index += 2;
-				mb_get_binary_short(MB_YES, &buffer[index], &(ssold_tmp.markNumber)); index += 2;
-				mb_get_binary_short(MB_YES, &buffer[index], &(ssold_tmp.dataFormat)); index += 2;
-				mb_get_binary_short(MB_YES, &buffer[index], &(ssold_tmp.reserved)); index += 2;
-				mb_get_binary_int(MB_YES, &buffer[index], &(ssold_tmp.millisecondsToday)); index += 4;
-				mb_get_binary_short(MB_YES, &buffer[index], &(ssold_tmp.year)); index += 2;
-				mb_get_binary_short(MB_YES, &buffer[index], &(ssold_tmp.day)); index += 2;
-				mb_get_binary_short(MB_YES, &buffer[index], &(ssold_tmp.hour)); index += 2;
-				mb_get_binary_short(MB_YES, &buffer[index], &(ssold_tmp.minute)); index += 2;
-				mb_get_binary_short(MB_YES, &buffer[index], &(ssold_tmp.second)); index += 2;
-				mb_get_binary_short(MB_YES, &buffer[index], &(ssold_tmp.heading)); index += 2;
-				mb_get_binary_short(MB_YES, &buffer[index], &(ssold_tmp.pitch)); index += 2;
-				mb_get_binary_short(MB_YES, &buffer[index], &(ssold_tmp.roll)); index += 2;
-				mb_get_binary_short(MB_YES, &buffer[index], &(ssold_tmp.heave)); index += 2;
-				mb_get_binary_short(MB_YES, &buffer[index], &(ssold_tmp.yaw)); index += 2;
-				mb_get_binary_int(MB_YES, &buffer[index], &(ssold_tmp.depth)); index += 4;
-				mb_get_binary_short(MB_YES, &buffer[index], &(ssold_tmp.temperature)); index += 2;
-				for (i=0;i<10;i++)
-					{
-					ssold_tmp.reserved2[i] = buffer[index]; index++;
-					}
-					
-				/* translate traceheader to the current form */
-				sbp->sequenceNumber = 0;
-				sbp->startDepth = ssold_tmp.startDepth;
-				sbp->pingNum = ssold_tmp.pingNum;
-				sbp->channelNum = ssold_tmp.channelNum;
-				for (i=0;i<6;i++)
-					{
-					sbp->unused1[i] = 0;
-					}
-				sbp->traceIDCode = 1;
-				for (i=0;i<2;i++)
-					{
-					sbp->unused2[i] = 0;
-					}
-				sbp->dataFormat = ssold_tmp.dataFormat;
-				sbp->NMEAantennaeR = 0;
-				sbp->NMEAantennaeO= 0;
-				for (i=0;i<32;i++)
-					{
-					sbp->RS232[i] = 0;
-					}
-				sbp->sourceCoordX = 0;
-				sbp->sourceCoordY = 0;
-				sbp->groupCoordX = 0;
-				sbp->groupCoordY = 0;
-				sbp->coordUnits = 2;
-				for (i=0;i<24;i++)
-					{
-					sbp->annotation[i] = 0;
-					}
-				sbp->samples = ssold_tmp.samples;
-				sbp->sampleInterval = ssold_tmp.sampleInterval;
-				sbp->ADCGain = ssold_tmp.ADCGain;
-				sbp->pulsePower = 0;
-				sbp->correlated = 0;
-				sbp->startFreq = 0;
-				sbp->endFreq = 0;
-				sbp->sweepLength = 0;
-				for (i=0;i<4;i++)
-					{
-					sbp->unused7[i] = 0;
-					}
-				sbp->aliasFreq = (unsigned short)(500000000.0 / sbp->sampleInterval);
-				sbp->pulseID = ssold_tmp.pulseID;
-				for (i=0;i<6;i++)
-					{
-					sbp->unused8[i] = 0;
-					}
-				sbp->year = ssold_tmp.year;
-				sbp->day = ssold_tmp.day;
-				sbp->hour = ssold_tmp.hour;
-				sbp->minute = ssold_tmp.minute;
-				sbp->second = ssold_tmp.second;
-				sbp->timeBasis = 3;
-				sbp->weightingFactor = ssold_tmp.weightingFactor;
-				sbp->unused9 = 0;
-				sbp->heading = (short)(100.0 * ssold_tmp.heading / 60.0);
-				sbp->pitch = (short)(100.0 * ssold_tmp.pitch / 60.0);
-				sbp->roll = (short)(100.0 * ssold_tmp.roll / 60.0);
-				sbp->temperature = ssold_tmp.temperature;
-				sbp->heaveCompensation = 0;
-				sbp->trigSource = 0;
-				sbp->markNumber = 0;
-				sbp->NMEAHour = 0;
-				sbp->NMEAMinutes = 0;
-				sbp->NMEASeconds = 0;
-				sbp->NMEACourse = 0;
-				sbp->NMEASpeed = 0;
-				sbp->NMEADay = 0;
-				sbp->NMEAYear = 0;
-				sbp->millisecondsToday = ssold_tmp.millisecondsToday;
-				sbp->ADCMax = ssold_tmp.ADCMax;
-				sbp->calConst = 0;
-				sbp->vehicleID = 0;
-				for (i=0;i<6;i++)
-					{
-					sbp->softwareVersion[i] = 0;
-					}
-				sbp->sphericalCorrection = 0;
-				sbp->packetNum = 1;
-				sbp->ADCDecimation = 0;
-				sbp->decimation = 0;
-				sbp->unuseda = 0;
-				sbp->depth = 0;
-				sbp->sonardepth = 0;
-				sbp->sonaraltitude = 0;
-				
-				/* allocate memory for the trace */
-				if (sbp->dataFormat == 1)
-					shortspersample = 2;
-				else
-					shortspersample = 1;
-				trace_size = shortspersample * sbp->samples * sizeof(short);
-				if (sbp->trace_alloc < trace_size)
-					{
-					if ((status = mb_reallocd(verbose, __FILE__, __LINE__,
-								trace_size, (void **)&(sbp->trace), error))
-						== MB_SUCCESS)
-						{
-						sbp->trace_alloc = trace_size;
-						}
-					else
-						fprintf(stderr,"TRACE ALLOCATION FAILED %s Line:%d Size:%d\n",
-							__FILE__, __LINE__, trace_size);
-					}
-
-				/* read the trace */
-				if (status == MB_SUCCESS
-					&& (read_status = fread(sbp->trace, trace_size,
-			    			1, mb_io_ptr->mbfp)) == 1)
-					{
-#ifndef BYTESWAPPED
-					for (i=0;i<shortspersample * sbp->samples;i++)
-						{
-						sbp->trace[i] = mb_swap_short(sbp->trace[i]);;
-						}
-#endif
-					}
-				else
-					{
-					status = MB_FAILURE;
-					*error = MB_ERROR_EOF;
-					done = MB_YES;
-					store->kind = MB_DATA_NONE;
-					}
-
-				/* get time */
-				time_j[0] = sbp->year;
-				time_j[1] = sbp->day;
-				time_j[2] = 60 * sbp->hour + sbp->minute;
-				time_j[3] = sbp->second;
-				time_j[4] = (int)1000 * (sbp->millisecondsToday
-						- 1000 * floor(0.001 * ((double)sbp->millisecondsToday)));
-				mb_get_itime(verbose, time_j, time_i);
-				mb_get_time(verbose, time_i, &time_d);
-
-				/* set navigation and attitude if needed and available */
-				if (sbp->heading == 0 && mb_io_ptr->nheading > 0)
-					{
-					mb_hedint_interp(verbose, mbio_ptr, time_d, &heading, error);
-					sbp->heading = (short) (100.0 * heading);
-					}
-				if ((sbp->groupCoordX == 0 || sbp->groupCoordY == 0 || sbp->coordUnits == 2)
-					&& mb_io_ptr->nfix > 0)
-					{
-					mb_navint_interp(verbose, mbio_ptr, time_d, heading, 0.0,
-								&navlon, &navlat, &speed, error);
-					sbp->sourceCoordX = (int) (600000.0 * navlon);
-					sbp->sourceCoordY = (int) (600000.0 * navlat);
-					sbp->groupCoordX = (int) (600000.0 * navlon);
-					sbp->groupCoordY = (int) (600000.0 * navlat);
-					}
-				if ((sbp->roll == 0 || sbp->pitch == 0 || sbp->heaveCompensation == 0)
-					&& mb_io_ptr->nattitude > 0)
-					{
-					mb_attint_interp(verbose, mbio_ptr, time_d, &heave, &roll, &pitch, error);
-					sbp->roll = 32768 * roll / 180.0;
-					sbp->pitch = 32768 * pitch / 180.0;
-					sbp->heaveCompensation = heave /
-							sbp->sampleInterval / 0.00000075;
-					}
-				if (sbp->sonaraltitude == 0 && mb_io_ptr->naltitude > 0)
-					{
-					mb_altint_interp(verbose, mbio_ptr, time_d, &altitude, error);
-					sbp->sonaraltitude = altitude / 1000.0;
-					}
-				if (sbp->sonardepth == 0 && mb_io_ptr->nsonardepth > 0)
-					{
-					mb_depint_interp(verbose, mbio_ptr, time_d, &sonardepth, error);
-					sbp->sonardepth = sonardepth / 1000.0;
-					}
-
-				/* set kind */
-				store->kind = MB_DATA_SUBBOTTOM_SUBBOTTOM;
-				done = MB_YES;
-				}
-
-			/* end of file */
-			else
-				{
-				status = MB_FAILURE;
-				*error = MB_ERROR_EOF;
-				done = MB_YES;
-				store->kind = MB_DATA_NONE;
-				}
-			}
-
-		/* if sidescan data and sonar trace 82 proceed to get data
-			- translate to current form */
-		else if (status == MB_SUCCESS
-			&& message.type == MBSYS_JSTAR_DATA_SONAR2
-			&& message.subsystem != MBSYS_JSTAR_SUBSYSTEM_SBP)
-			{
-			/* reset message type to current sonar trace 80 */
-			message.type = MBSYS_JSTAR_DATA_SONAR;
-
-			/* sidescan channel */
-			if (message.channel == 0)
-				ss = (struct mbsys_jstar_channel_struct *) &(store->ssport);
-			else
-				ss = (struct mbsys_jstar_channel_struct *) &(store->ssstbd);
-			ss->message = message;
-	
-			/* temporary old format structure */
-			ssold_tmp.message = message;
-
-			/* read the 80 byte trace header */
-			if ((read_status = fread(buffer, MBSYS_JSTAR_SSOLDHEADER_SIZE,
-			    		1, mb_io_ptr->mbfp)) == 1)
-				{
-				index = 0;
-				mb_get_binary_short(MB_YES, &buffer[index], &(ssold_tmp.subsystem)); index += 2;
-				mb_get_binary_short(MB_YES, &buffer[index], &(ssold_tmp.channelNum)); index += 2;
-				mb_get_binary_int(MB_YES, &buffer[index], &(ssold_tmp.pingNum)); index += 4;
-				mb_get_binary_short(MB_YES, &buffer[index], &(ssold_tmp.packetNum)); index += 2;
-				mb_get_binary_short(MB_YES, &buffer[index], &(ssold_tmp.trigSource)); index += 2;
-				mb_get_binary_int(MB_YES, &buffer[index], &(ssold_tmp.samples)); index += 4;
-				mb_get_binary_int(MB_YES, &buffer[index], &(ssold_tmp.sampleInterval)); index += 4;
-				mb_get_binary_int(MB_YES, &buffer[index], &(ssold_tmp.startDepth)); index += 4;
-				mb_get_binary_short(MB_YES, &buffer[index], &(ssold_tmp.weightingFactor)); index += 2;
-				mb_get_binary_short(MB_YES, &buffer[index], &(ssold_tmp.ADCGain)); index += 2;
-				mb_get_binary_short(MB_YES, &buffer[index], &(ssold_tmp.ADCMax)); index += 2;
-				mb_get_binary_short(MB_YES, &buffer[index], &(ssold_tmp.rangeSetting)); index += 2;
-				mb_get_binary_short(MB_YES, &buffer[index], &(ssold_tmp.pulseID)); index += 2;
-				mb_get_binary_short(MB_YES, &buffer[index], &(ssold_tmp.markNumber)); index += 2;
-				mb_get_binary_short(MB_YES, &buffer[index], &(ssold_tmp.dataFormat)); index += 2;
-				mb_get_binary_short(MB_YES, &buffer[index], &(ssold_tmp.reserved)); index += 2;
-				mb_get_binary_int(MB_YES, &buffer[index], &(ssold_tmp.millisecondsToday)); index += 4;
-				mb_get_binary_short(MB_YES, &buffer[index], &(ssold_tmp.year)); index += 2;
-				mb_get_binary_short(MB_YES, &buffer[index], &(ssold_tmp.day)); index += 2;
-				mb_get_binary_short(MB_YES, &buffer[index], &(ssold_tmp.hour)); index += 2;
-				mb_get_binary_short(MB_YES, &buffer[index], &(ssold_tmp.minute)); index += 2;
-				mb_get_binary_short(MB_YES, &buffer[index], &(ssold_tmp.second)); index += 2;
-				mb_get_binary_short(MB_YES, &buffer[index], &(ssold_tmp.heading)); index += 2;
-				mb_get_binary_short(MB_YES, &buffer[index], &(ssold_tmp.pitch)); index += 2;
-				mb_get_binary_short(MB_YES, &buffer[index], &(ssold_tmp.roll)); index += 2;
-				mb_get_binary_short(MB_YES, &buffer[index], &(ssold_tmp.heave)); index += 2;
-				mb_get_binary_short(MB_YES, &buffer[index], &(ssold_tmp.yaw)); index += 2;
-				mb_get_binary_int(MB_YES, &buffer[index], &(ssold_tmp.depth)); index += 4;
-				mb_get_binary_short(MB_YES, &buffer[index], &(ssold_tmp.temperature)); index += 2;
-				for (i=0;i<10;i++)
-					{
-					ssold_tmp.reserved2[i] = buffer[index]; index++;
-					}
-					
-				/* translate traceheader to the current form */
-				ss->sequenceNumber = 0;
-				ss->startDepth = ssold_tmp.startDepth;
-				ss->pingNum = ssold_tmp.pingNum;
-				ss->channelNum = ssold_tmp.channelNum;
-				for (i=0;i<6;i++)
-					{
-					ss->unused1[i] = 0;
-					}
-				ss->traceIDCode = 1;
-				for (i=0;i<2;i++)
-					{
-					ss->unused2[i] = 0;
-					}
-				ss->dataFormat = ssold_tmp.dataFormat;
-				ss->NMEAantennaeR = 0;
-				ss->NMEAantennaeO= 0;
-				for (i=0;i<32;i++)
-					{
-					ss->RS232[i] = 0;
-					}
-				ss->sourceCoordX = 0;
-				ss->sourceCoordY = 0;
-				ss->groupCoordX = 0;
-				ss->groupCoordY = 0;
-				ss->coordUnits = 2;
-				for (i=0;i<24;i++)
-					{
-					ss->annotation[i] = 0;
-					}
-				ss->samples = ssold_tmp.samples;
-				ss->sampleInterval = ssold_tmp.sampleInterval;
-				ss->ADCGain = ssold_tmp.ADCGain;
-				ss->pulsePower = 0;
-				ss->correlated = 0;
-				ss->startFreq = 0;
-				ss->endFreq = 0;
-				ss->sweepLength = 0;
-				for (i=0;i<4;i++)
-					{
-					ss->unused7[i] = 0;
-					}
-				ss->aliasFreq = (unsigned short)(500000000.0 / ss->sampleInterval);
-				ss->pulseID = ssold_tmp.pulseID;
-				for (i=0;i<6;i++)
-					{
-					ss->unused8[i] = 0;
-					}
-				ss->year = ssold_tmp.year;
-				ss->day = ssold_tmp.day;
-				ss->hour = ssold_tmp.hour;
-				ss->minute = ssold_tmp.minute;
-				ss->second = ssold_tmp.second;
-				ss->timeBasis = 3;
-				ss->weightingFactor = ssold_tmp.weightingFactor;
-				ss->unused9 = 0;
-				ss->heading = (short)(100.0 * ssold_tmp.heading / 60.0);
-				ss->pitch = (short)(100.0 * ssold_tmp.pitch / 60.0);
-				ss->roll = (short)(100.0 * ssold_tmp.roll / 60.0);
-				ss->temperature = ssold_tmp.temperature;
-				ss->heaveCompensation = 0;
-				ss->trigSource = 0;
-				ss->markNumber = 0;
-				ss->NMEAHour = 0;
-				ss->NMEAMinutes = 0;
-				ss->NMEASeconds = 0;
-				ss->NMEACourse = 0;
-				ss->NMEASpeed = 0;
-				ss->NMEADay = 0;
-				ss->NMEAYear = 0;
-				ss->millisecondsToday = ssold_tmp.millisecondsToday;
-				ss->ADCMax = ssold_tmp.ADCMax;
-				ss->calConst = 0;
-				ss->vehicleID = 0;
-				for (i=0;i<6;i++)
-					{
-					ss->softwareVersion[i] = 0;
-					}
-				ss->sphericalCorrection = 0;
-				ss->packetNum = 1;
-				ss->ADCDecimation = 0;
-				ss->decimation = 0;
-				ss->unuseda = 0;
-				ss->depth = 0;
-				ss->sonardepth = 0;
-				ss->sonaraltitude = 0;
-
-				/* allocate memory for the trace */
-				if (ss->dataFormat == 1)
-					shortspersample = 2;
-				else
-					shortspersample = 1;
-				trace_size = shortspersample * ss->samples * sizeof(short);
-				if (ss->trace_alloc < trace_size)
-					{
-					if ((status = mb_reallocd(verbose, __FILE__, __LINE__,
-								trace_size, (void **)&(ss->trace), error))
-						== MB_SUCCESS)
-						{
-						ss->trace_alloc = trace_size;
-						}
-					else
-						fprintf(stderr,"TRACE ALLOCATION FAILED %s Line:%d Size:%d\n",
-							__FILE__, __LINE__, trace_size);
-					}
-
-				/* read the trace */
-				if (status == MB_SUCCESS
-					&& (read_status = fread(ss->trace, trace_size,
-			    			1, mb_io_ptr->mbfp)) == 1)
-					{
-#ifndef BYTESWAPPED
-					for (i=0;i<shortspersample * ss->samples;i++)
-						{
-						ss->trace[i] = mb_swap_short(ss->trace[i]);;
-						}
-#endif
-					}
-				else
-					{
-					status = MB_FAILURE;
-					*error = MB_ERROR_EOF;
-					done = MB_YES;
-					store->kind = MB_DATA_NONE;
-					}
-
-				/* get time */
-				time_j[0] = ss->year;
-				time_j[1] = ss->day;
-				time_j[2] = 60 * ss->hour + ss->minute;
-				time_j[3] = ss->second;
-				time_j[4] = (int)1000 * (ss->millisecondsToday
-						- 1000 * floor(0.001 * ((double)ss->millisecondsToday)));
-				mb_get_itime(verbose, time_j, time_i);
-				mb_get_time(verbose, time_i, &time_d);
-
-				/* set navigation and attitude if needed and available */
-				if (ss->heading == 0 && mb_io_ptr->nheading > 0)
-					{
-					mb_hedint_interp(verbose, mbio_ptr, time_d, &heading, error);
-					ss->heading = (short) (100.0 * heading);
-					}
-				if ((ss->groupCoordX == 0 || ss->groupCoordY == 0 || ss->coordUnits == 2)
-					&& mb_io_ptr->nfix > 0)
-					{
-					mb_navint_interp(verbose, mbio_ptr, time_d, heading, 0.0,
-								&navlon, &navlat, &speed, error);
-					ss->sourceCoordX = (int) (600000.0 * navlon);
-					ss->sourceCoordY = (int) (600000.0 * navlat);
-					ss->groupCoordX = (int) (600000.0 * navlon);
-					ss->groupCoordY = (int) (600000.0 * navlat);
-					}
-				if ((ss->roll == 0 || ss->pitch == 0 || ss->heaveCompensation == 0)
-					&& mb_io_ptr->nattitude > 0)
-					{
-					mb_attint_interp(verbose, mbio_ptr, time_d, &heave, &roll, &pitch, error);
-					ss->roll = 32768 * roll / 180.0;
-					ss->pitch = 32768 * pitch / 180.0;
-					ss->heaveCompensation = heave /
-							ss->sampleInterval / 0.00000075;
-					}
-				if (ss->sonaraltitude == 0 && mb_io_ptr->naltitude > 0)
-					{
-					mb_altint_interp(verbose, mbio_ptr, time_d, &altitude, error);
-					ss->sonaraltitude = 1000 * altitude;
-					}
-				if (ss->sonardepth == 0 && mb_io_ptr->nsonardepth > 0)
-					{
-					mb_depint_interp(verbose, mbio_ptr, time_d, &sonardepth, error);
-					ss->sonardepth = 1000 * sonardepth;
-					}
-
-				/* set kind */
-				if (mb_io_ptr->format == MBF_EDGJSTAR)
-					{
-					if (message.subsystem == MBSYS_JSTAR_SUBSYSTEM_SSLOW)
-						store->kind = MB_DATA_DATA;
-					else if (message.subsystem == MBSYS_JSTAR_SUBSYSTEM_SSHIGH)
-						store->kind = MB_DATA_SIDESCAN2;
-					}
-				else
-					{
-					if (message.subsystem == MBSYS_JSTAR_SUBSYSTEM_SSHIGH)
-						store->kind = MB_DATA_DATA;
-					else if (message.subsystem == MBSYS_JSTAR_SUBSYSTEM_SSLOW)
-						store->kind = MB_DATA_SIDESCAN2;
-					}
-				if (store->ssport.pingNum == store->ssstbd.pingNum
-							&& store->ssport.message.subsystem
-								== store->ssstbd.message.subsystem)
-					{
-					done = MB_YES;
-					}
-#ifdef MBF_EDGJSTAR_DEBUG
-fprintf(stderr,"Done reading 1: %d  pingNum:%d %d   subsystem:%d %d\n",
-done,store->ssport.pingNum,store->ssstbd.pingNum,
-store->ssport.message.subsystem,store->ssstbd.message.subsystem);
-#endif
-				}
-
-			/* else end of file */
-			else
-				{
-				status = MB_FAILURE;
-				*error = MB_ERROR_EOF;
-				done = MB_YES;
-				store->kind = MB_DATA_NONE;
-				}
-			}
-
-		/* if pitchroll data read it */
-		else if (status == MB_SUCCESS && message.type == MBSYS_JSTAR_DATA_PITCHROLL
-			&& message.size < MB_COMMENT_MAXLINE)
-			{
-			/* nmea channel */
-			pitchroll = (struct mbsys_jstar_pitchroll_struct *) &(store->pitchroll);
-			pitchroll->message = message;
-
-			/* read the pitchroll record */
-			if ((read_status = fread(buffer, message.size,
-			    		1, mb_io_ptr->mbfp)) == 1)
-				{
-				index = 0;
-				mb_get_binary_int(MB_YES, &buffer[index], &(pitchroll->seconds)); index += 4;
-				mb_get_binary_int(MB_YES, &buffer[index], &(pitchroll->msec)); index += 4;
-				pitchroll->reserve1[0] = buffer[index]; index++;
-				pitchroll->reserve1[1] = buffer[index]; index++;
-				pitchroll->reserve1[2] = buffer[index]; index++;
-				pitchroll->reserve1[3] = buffer[index]; index++;
-				mb_get_binary_short(MB_YES, &buffer[index], &(pitchroll->accelerationx)); index += 2;
-				mb_get_binary_short(MB_YES, &buffer[index], &(pitchroll->accelerationy)); index += 2;
-				mb_get_binary_short(MB_YES, &buffer[index], &(pitchroll->accelerationz)); index += 2;
-				mb_get_binary_short(MB_YES, &buffer[index], &(pitchroll->gyroratex)); index += 2;
-				mb_get_binary_short(MB_YES, &buffer[index], &(pitchroll->gyroratey)); index += 2;
-				mb_get_binary_short(MB_YES, &buffer[index], &(pitchroll->gyroratez)); index += 2;
-				mb_get_binary_short(MB_YES, &buffer[index], &(pitchroll->pitch)); index += 2;
-				mb_get_binary_short(MB_YES, &buffer[index], &(pitchroll->roll)); index += 2;
-				mb_get_binary_short(MB_YES, &buffer[index], &(pitchroll->temperature)); index += 2;
-				mb_get_binary_short(MB_YES, &buffer[index], &(pitchroll->deviceinfo)); index += 2;
-				mb_get_binary_short(MB_YES, &buffer[index], &(pitchroll->heave)); index += 2;
-				mb_get_binary_short(MB_YES, &buffer[index], &(pitchroll->heading)); index += 2;
-				mb_get_binary_int(MB_YES, &buffer[index], &(pitchroll->datavalidflags)); index += 4;
-				mb_get_binary_int(MB_YES, &buffer[index], &(pitchroll->reserve2)); index += 4;
-
-				done = MB_YES;
-				store->kind = MB_DATA_ATTITUDE;
-				}
-			}
-
-		/* if dvl data read it */
-		else if (status == MB_SUCCESS && message.type == MBSYS_JSTAR_DATA_DVL
-			&& message.size < MB_COMMENT_MAXLINE)
-			{
-			/* nmea channel */
-			dvl = (struct mbsys_jstar_dvl_struct *) &(store->dvl);
-			dvl->message = message;
-
-			/* read the dvl record */
-			if ((read_status = fread(buffer, message.size,
-			    		1, mb_io_ptr->mbfp)) == 1)
-				{
-				index = 0;
-				mb_get_binary_int(MB_YES, &buffer[index], &(dvl->seconds)); index += 4;
-				mb_get_binary_int(MB_YES, &buffer[index], &(dvl->msec)); index += 4;
-				dvl->reserve1[0] = buffer[index]; index++;
-				dvl->reserve1[1] = buffer[index]; index++;
-				dvl->reserve1[2] = buffer[index]; index++;
-				dvl->reserve1[3] = buffer[index]; index++;
-				mb_get_binary_int(MB_YES, &buffer[index], &(dvl->datavalidflags)); index += 4;
-				mb_get_binary_int(MB_YES, &buffer[index], &(dvl->beam1range)); index += 4;
-				mb_get_binary_int(MB_YES, &buffer[index], &(dvl->beam2range)); index += 4;
-				mb_get_binary_int(MB_YES, &buffer[index], &(dvl->beam3range)); index += 4;
-				mb_get_binary_int(MB_YES, &buffer[index], &(dvl->beam4range)); index += 4;
-				mb_get_binary_short(MB_YES, &buffer[index], &(dvl->velocitybottomx)); index += 2;
-				mb_get_binary_short(MB_YES, &buffer[index], &(dvl->velocitybottomy)); index += 2;
-				mb_get_binary_short(MB_YES, &buffer[index], &(dvl->velocitybottomz)); index += 2;
-				mb_get_binary_short(MB_YES, &buffer[index], &(dvl->velocitywaterx)); index += 2;
-				mb_get_binary_short(MB_YES, &buffer[index], &(dvl->velocitywatery)); index += 2;
-				mb_get_binary_short(MB_YES, &buffer[index], &(dvl->velocitywaterz)); index += 2;
-				mb_get_binary_short(MB_YES, &buffer[index], &(dvl->depth)); index += 2;
-				mb_get_binary_short(MB_YES, &buffer[index], &(dvl->pitch)); index += 2;
-				mb_get_binary_short(MB_YES, &buffer[index], &(dvl->roll)); index += 2;
-				mb_get_binary_short(MB_YES, &buffer[index], &(dvl->heading)); index += 2;
-				mb_get_binary_short(MB_YES, &buffer[index], &(dvl->salinity)); index += 2;
-				mb_get_binary_short(MB_YES, &buffer[index], &(dvl->temperature)); index += 2;
-				mb_get_binary_short(MB_YES, &buffer[index], &(dvl->soundspeed)); index += 2;
-				for (i=0;i<7;i++)
-					{
-					mb_get_binary_short(MB_YES, &buffer[index], &(dvl->reserve2[i])); index += 2;
-					}
-
-				done = MB_YES;
-				store->kind = MB_DATA_DVL;
-#ifdef MBF_EDGJSTAR_DEBUG
-fprintf(stderr,"DVL: %4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d  beams:%d %d %d %d   velocity:%d %d %d  depth:%d pitch:%d roll:%d heading:%d soundspeed:%d\n",
-time_i[0],time_i[1],time_i[2],time_i[3],time_i[4],time_i[5],time_i[6],
-dvl->beam1range,dvl->beam2range,dvl->beam3range,dvl->beam4range,
-dvl->velocitybottomx,dvl->velocitybottomy,dvl->velocitybottomz,
-dvl->depth,dvl->pitch,dvl->roll,dvl->heading,dvl->soundspeed);
-#endif
-				}
-			}
-
-		/* if nmea data read it, parse it, and and store values for interpolation */
-		else if (status == MB_SUCCESS && message.type == MBSYS_JSTAR_DATA_NMEA
-			&& message.size < MB_COMMENT_MAXLINE)
-			{
-			/* nmea channel */
-			nmea = (struct mbsys_jstar_nmea_struct *) &(store->nmea);
-			nmea->message = message;
-
-			/* read the NMEA string */
-			if ((read_status = fread(buffer, message.size,
-			    		1, mb_io_ptr->mbfp)) == 1)
-				{
-				index = 0;
-				mb_get_binary_int(MB_YES, &buffer[index], &(nmea->seconds)); index += 4;
-				mb_get_binary_int(MB_YES, &buffer[index], &(nmea->msec)); index += 4;
-				nmea->source = buffer[index]; index++;
-				nmea->reserve[0] = buffer[index]; index++;
-				nmea->reserve[1] = buffer[index]; index++;
-				nmea->reserve[2] = buffer[index]; index++;
-				for (i=0;i<message.size-12;i++)
-					{
-					nmea->nmea[i] = buffer[index]; index++;
-					}
-				nmea->nmea[message.size-12] = 0;
-				strcpy(nmeastring,nmea->nmea);
-
-				time_d = ((double)nmea->seconds) + 0.001 * ((double)nmea->msec);
-				mb_get_date(verbose, time_d, time_i);
-
-				/* break up NMEA string into arguments */
-				nargc = 0;
-				string = (char *) nmeastring;
-				for (nap = nargv; (*nap = strtok(string, ",*")) != NULL;)
-					{
-					if (++nap >= &nargv[25])
-						break;
-					else
-						nargc++;
-					}
-
-				/* parse NMEA string if possible */
-				if (strncmp(&(nargv[0][3]), "RMC", 3) == 0)
-					{
-					rawvalue = atof(nargv[3]);
-					navlat = floor(0.01 * rawvalue)
-						+ (rawvalue - 100.0 * floor(0.01 * rawvalue)) / 60.0;
-					if (nargv[4][0] == 'S')
-						navlat *= -1.0;
-					rawvalue = atof(nargv[5]);
-					navlon = floor(0.01 * rawvalue)
-						+ (rawvalue - 100.0 * floor(0.01 * rawvalue)) / 60.0;
-					if (nargv[6][0] == 'W')
-						navlon *= -1.0;
-					heading = atof(nargv[8]);
-#ifdef MBF_EDGJSTAR_DEBUG
-fprintf(stderr,"RMC: %4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d navlon:%f navlat:%f heading:%f    %s\n",
-time_i[0],time_i[1],time_i[2],time_i[3],time_i[4],time_i[5],time_i[6],navlon,navlat,heading,nmea->nmea);
-#endif
-
-					mb_navint_add(verbose, mbio_ptr, time_d, navlon, navlat, error);
-					mb_hedint_add(verbose, mbio_ptr, time_d, heading, error);
-
-					store->kind = MB_DATA_NMEA_RMC;
-					}
-
-				/* parse NMEA string if possible */
-				else if (strncmp(&(nargv[0][3]), "DBT", 3) == 0)
-					{
-					altitude = atof(nargv[3]);
-					mb_altint_add(verbose, mbio_ptr, time_d, altitude, error);
-#ifdef MBF_EDGJSTAR_DEBUG
-fprintf(stderr,"DBT: %4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d altitude:%f    %s\n",
-time_i[0],time_i[1],time_i[2],time_i[3],time_i[4],time_i[5],time_i[6],altitude,nmea->nmea);
-#endif
-
-					store->kind = MB_DATA_NMEA_DBT;
-					}
-
-				/* parse NMEA string if possible */
-				else if (strncmp(&(nargv[0][3]), "DPT", 3) == 0)
-					{
-					depthofsensor = atof(nargv[1]);
-					offset = atof(nargv[2]);
-					sonardepth = depthofsensor + offset;
-					mb_depint_add(verbose, mbio_ptr, time_d, sonardepth, error);
-#ifdef MBF_EDGJSTAR_DEBUG
-fprintf(stderr,"DPT: %4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d depthofsensor:%f offset:%f sonardepth:%f    %s\n",
-time_i[0],time_i[1],time_i[2],time_i[3],time_i[4],time_i[5],time_i[6],depthofsensor,offset,sonardepth,nmea->nmea);
-#endif
-
-					store->kind = MB_DATA_NMEA_DPT;
-					}
-
-				done = MB_YES;
-				}
-			}
-
-		/* if pressure data read it */
-		else if (status == MB_SUCCESS && message.type == MBSYS_JSTAR_DATA_PRESSURE
-			&& message.size < MB_COMMENT_MAXLINE)
-			{
-			/* nmea channel */
-			pressure = (struct mbsys_jstar_pressure_struct *) &(store->pressure);
-			pressure->message = message;
-
-			/* read the pressure record */
-			if ((read_status = fread(buffer, message.size,
-			    		1, mb_io_ptr->mbfp)) == 1)
-				{
-				index = 0;
-				mb_get_binary_int(MB_YES, &buffer[index], &(pressure->seconds)); index += 4;
-				mb_get_binary_int(MB_YES, &buffer[index], &(pressure->msec)); index += 4;
-				pressure->reserve1[0] = buffer[index]; index++;
-				pressure->reserve1[1] = buffer[index]; index++;
-				pressure->reserve1[2] = buffer[index]; index++;
-				pressure->reserve1[3] = buffer[index]; index++;
-				mb_get_binary_int(MB_YES, &buffer[index], &(pressure->pressure)); index += 4;
-				mb_get_binary_int(MB_YES, &buffer[index], &(pressure->salinity)); index += 4;
-				mb_get_binary_int(MB_YES, &buffer[index], &(pressure->datavalidflags)); index += 4;
-				mb_get_binary_int(MB_YES, &buffer[index], &(pressure->conductivity)); index += 4;
-				mb_get_binary_int(MB_YES, &buffer[index], &(pressure->soundspeed)); index += 4;
-				for (i=0;i<10;i++)
-					{
-					mb_get_binary_int(MB_YES, &buffer[index], &(pressure->reserve2[i])); index += 4;
-					}
-#ifdef MBF_EDGJSTAR_DEBUG
-fprintf(stderr,"PRESSURE: %4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d pressure:%d soundspeed:%d\n",
-time_i[0],time_i[1],time_i[2],time_i[3],time_i[4],time_i[5],time_i[6],pressure->pressure,pressure->soundspeed);
-#endif
-
-				done = MB_YES;
-				store->kind = MB_DATA_CTD;
-				}
-
-			/* end of file */
-			else
-				{
-				status = MB_FAILURE;
-				*error = MB_ERROR_EOF;
-				done = MB_YES;
-				store->kind = MB_DATA_NONE;
-				}
-			}
-			
-		/* system info record */
-		else if (status == MB_SUCCESS && message.type == MBSYS_JSTAR_DATA_SYSINFO)
-			{
-			/* get message */
-			sysinfo = (struct mbsys_jstar_sysinfo_struct *) &(store->sysinfo);
-			sysinfo->message = message;
-
-			/* read the pressure record */
-			if ((read_status = fread(buffer, message.size,
-			    		1, mb_io_ptr->mbfp)) == 1)
-				{
-				index = 0;
-				mb_get_binary_int(MB_YES, &buffer[index], &(sysinfo->system_type)); index += 4;
-				mb_get_binary_int(MB_YES, &buffer[index], &(sysinfo->reserved1)); index += 4;
-				mb_get_binary_int(MB_YES, &buffer[index], &(sysinfo->version)); index += 4;
-				mb_get_binary_int(MB_YES, &buffer[index], &(sysinfo->reserved2)); index += 4;
-				mb_get_binary_int(MB_YES, &buffer[index], &(sysinfo->platformserialnumber)); index += 4;
-				sysinfo->sysinfosize = MIN((message.size - index), MBSYS_JSTAR_SYSINFO_MAX-1);
-				for (i=0;i<sysinfo->sysinfosize;i++)
-					{
-					sysinfo->sysinfo[i] = buffer[index]; index++;
-					}
-				sysinfo->sysinfo[sysinfo->sysinfosize] = '\0';
-#ifdef MBF_EDGJSTAR_DEBUG
-fprintf(stderr,"SYSINFO: system_type:%d version:%d platformserialnumber:%d sysinfosize:%d\n",
-sysinfo->system_type,sysinfo->version,sysinfo->platformserialnumber,sysinfo->sysinfosize);
-#endif
-
-				done = MB_YES;
-				store->kind = MB_DATA_HEADER;
-				}
-			}
-
-		/* if not supported data read it and throw it away */
-		else if (status == MB_SUCCESS)
-			{
-#ifdef MBF_EDGJSTAR_DEBUG
-fprintf(stderr,"UNKNOWN: throwing away %d bytes\n", message.size);
-#endif
-			for (i=0;i<message.size;i++)
-				{
-				read_status = fread(buffer, 1, 1, mb_io_ptr->mbfp);
-				}
-			done = MB_YES;
-			store->kind = MB_DATA_NONE;
-			*error = MB_ERROR_UNINTELLIGIBLE;
-			}
-
-		/* end of file */
-		else
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_EOF;
-			done = MB_YES;
-			store->kind = MB_DATA_NONE;
-			}
-
-		}
-
-	/* set kind and error in mb_io_ptr */
-	mb_io_ptr->new_kind = store->kind;
-	mb_io_ptr->new_error = *error;
-#ifdef MBF_EDGJSTAR_DEBUG
-fprintf(stderr,"kind:%d error:%d status:%d\n",store->kind,*error,status);
-#endif
-
-	/* print debug statements */
-	if (status == MB_SUCCESS && verbose >= 5 && store->kind == MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"\ndbg5  New comment read by MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5  Subsystem ID:\n");
-		fprintf(stderr,"dbg5       subsystem:        %d ", store->subsystem);
-		if (store->subsystem == 0)
-			fprintf(stderr,"(subbottom)\n");
-		else if (store->subsystem == MBSYS_JSTAR_SUBSYSTEM_SSLOW)
-			fprintf(stderr,"(75 or 120 kHz sidescan)\n");
-		else if (store->subsystem == MBSYS_JSTAR_SUBSYSTEM_SSHIGH)
-			fprintf(stderr,"(410 kHz sidescan)\n");
-
-		fprintf(stderr,"\ndbg5  Comment:\n");
-		comment = (struct mbsys_jstar_comment_struct *) &(store->comment);
-		fprintf(stderr,"dbg5     start_marker:                %d\n",comment->message.start_marker);
-		fprintf(stderr,"dbg5     version:                     %d\n",comment->message.version);
-		fprintf(stderr,"dbg5     session:                     %d\n",comment->message.session);
-		fprintf(stderr,"dbg5     type:                        %d\n",comment->message.type);
-		fprintf(stderr,"dbg5     command:                     %d\n",comment->message.command);
-		fprintf(stderr,"dbg5     subsystem:                   %d\n",comment->message.subsystem);
-		fprintf(stderr,"dbg5     channel:                     %d\n",comment->message.channel);
-		fprintf(stderr,"dbg5     sequence:                    %d\n",comment->message.sequence);
-		fprintf(stderr,"dbg5     reserved:                    %d\n",comment->message.reserved);
-		fprintf(stderr,"dbg5     size:                        %d\n",comment->message.size);
-
-		fprintf(stderr,"dbg5     comment:                     %s\n",store->comment.comment);
-		}
-	else if (status == MB_SUCCESS && verbose >= 5 && store->kind == MB_DATA_SUBBOTTOM_SUBBOTTOM)
-		{
-		sbp = (struct mbsys_jstar_channel_struct *) &(store->sbp);
-		fprintf(stderr,"\ndbg5  New subbottom data record read by MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5  Subsystem ID:\n");
-		fprintf(stderr,"dbg5       subsystem:        %d (subbottom)\n", store->subsystem);
-		fprintf(stderr,"\ndbg5  Channel:\n");
-		fprintf(stderr,"dbg5     start_marker:                %d\n",sbp->message.start_marker);
-		fprintf(stderr,"dbg5     version:                     %d\n",sbp->message.version);
-		fprintf(stderr,"dbg5     session:                     %d\n",sbp->message.session);
-		fprintf(stderr,"dbg5     type:                        %d\n",sbp->message.type);
-		fprintf(stderr,"dbg5     command:                     %d\n",sbp->message.command);
-		fprintf(stderr,"dbg5     subsystem:                   %d\n",sbp->message.subsystem);
-		fprintf(stderr,"dbg5     channel:                     %d\n",sbp->message.channel);
-		fprintf(stderr,"dbg5     sequence:                    %d\n",sbp->message.sequence);
-		fprintf(stderr,"dbg5     reserved:                    %d\n",sbp->message.reserved);
-		fprintf(stderr,"dbg5     size:                        %d\n",sbp->message.size);
-
-		fprintf(stderr,"dbg5     sequenceNumber:              %d\n",sbp->sequenceNumber);
-		fprintf(stderr,"dbg5     startDepth:                  %d\n",sbp->startDepth);
-		fprintf(stderr,"dbg5     pingNum:                     %d\n",sbp->pingNum);
-		fprintf(stderr,"dbg5     channelNum:                  %d\n",sbp->channelNum);
-		for (i=0;i<6;i++)
-			fprintf(stderr,"dbg5     unused1[%d]:                  %d\n",i,sbp->unused1[i]);
-		fprintf(stderr,"dbg5     traceIDCode:                 %d\n",sbp->traceIDCode);
-		for (i=0;i<2;i++)
-			fprintf(stderr,"dbg5     unused2[%d]:                  %d\n",i,sbp->unused2[i]);
-		fprintf(stderr,"dbg5     dataFormat:                  %d\n",sbp->dataFormat);
-		fprintf(stderr,"dbg5     NMEAantennaeR:               %d\n",sbp->NMEAantennaeR);
-		fprintf(stderr,"dbg5     NMEAantennaeO:               %d\n",sbp->NMEAantennaeO);
-		for (i=0;i<32;i++)
-			fprintf(stderr,"dbg5     RS232[%d]:                   %d\n",i,sbp->RS232[i]);
-		fprintf(stderr,"dbg5     sourceCoordX:                %d\n",sbp->sourceCoordX);
-		fprintf(stderr,"dbg5     sourceCoordY:                %d\n",sbp->sourceCoordY);
-		fprintf(stderr,"dbg5     groupCoordX:                 %d\n",sbp->groupCoordX);
-		fprintf(stderr,"dbg5     groupCoordY:                 %d\n",sbp->groupCoordY);
-		fprintf(stderr,"dbg5     coordUnits:                  %d\n",sbp->coordUnits);
-		fprintf(stderr,"dbg5     annotation:                  %s\n",sbp->annotation);
-		fprintf(stderr,"dbg5     samples:                     %d\n",sbp->samples);
-		fprintf(stderr,"dbg5     sampleInterval:              %d\n",sbp->sampleInterval);
-		fprintf(stderr,"dbg5     ADCGain:                     %d\n",sbp->ADCGain);
-		fprintf(stderr,"dbg5     pulsePower:                  %d\n",sbp->pulsePower);
-		fprintf(stderr,"dbg5     correlated:                  %d\n",sbp->correlated);
-		fprintf(stderr,"dbg5     startFreq:                   %d\n",sbp->startFreq);
-		fprintf(stderr,"dbg5     endFreq:                     %d\n",sbp->endFreq);
-		fprintf(stderr,"dbg5     sweepLength:                 %d\n",sbp->sweepLength);
-		for (i=0;i<4;i++)
-			fprintf(stderr,"dbg5     unused7[%d]:                  %d\n",i,sbp->unused7[i]);
-		fprintf(stderr,"dbg5     aliasFreq:                   %d\n",sbp->aliasFreq);
-		fprintf(stderr,"dbg5     pulseID:                     %d\n",sbp->pulseID);
-		for (i=0;i<6;i++)
-			fprintf(stderr,"dbg5     unused8[%d]:                  %d\n",i,sbp->unused8[i]);
-		fprintf(stderr,"dbg5     year:                        %d\n",sbp->year);
-		fprintf(stderr,"dbg5     day:                         %d\n",sbp->day);
-		fprintf(stderr,"dbg5     hour:                        %d\n",sbp->hour);
-		fprintf(stderr,"dbg5     minute:                      %d\n",sbp->minute);
-		fprintf(stderr,"dbg5     second:                      %d\n",sbp->second);
-		fprintf(stderr,"dbg5     timeBasis:                   %d\n",sbp->timeBasis);
-		fprintf(stderr,"dbg5     weightingFactor:             %d\n",sbp->weightingFactor);
-		fprintf(stderr,"dbg5     unused9:                     %d\n",sbp->unused9);
-		fprintf(stderr,"dbg5     heading:                     %d\n",sbp->heading);
-		fprintf(stderr,"dbg5     pitch:                       %d\n",sbp->pitch);
-		fprintf(stderr,"dbg5     roll:                        %d\n",sbp->roll);
-		fprintf(stderr,"dbg5     temperature:                 %d\n",sbp->temperature);
-		fprintf(stderr,"dbg5     heaveCompensation:           %d\n",sbp->heaveCompensation);
-		fprintf(stderr,"dbg5     trigSource:                  %d\n",sbp->trigSource);
-		fprintf(stderr,"dbg5     markNumber:                  %d\n",sbp->markNumber);
-		fprintf(stderr,"dbg5     NMEAHour:                    %d\n",sbp->NMEAHour);
-		fprintf(stderr,"dbg5     NMEAMinutes:                 %d\n",sbp->NMEAMinutes);
-		fprintf(stderr,"dbg5     NMEASeconds:                 %d\n",sbp->NMEASeconds);
-		fprintf(stderr,"dbg5     NMEACourse:                  %d\n",sbp->NMEACourse);
-		fprintf(stderr,"dbg5     NMEASpeed:                   %d\n",sbp->NMEASpeed);
-		fprintf(stderr,"dbg5     NMEADay:                     %d\n",sbp->NMEADay);
-		fprintf(stderr,"dbg5     NMEAYear:                    %d\n",sbp->NMEAYear);
-		fprintf(stderr,"dbg5     millisecondsToday:           %d\n",sbp->millisecondsToday);
-		fprintf(stderr,"dbg5     ADCMax:                      %d\n",sbp->ADCMax);
-		fprintf(stderr,"dbg5     calConst:                    %d\n",sbp->calConst);
-		fprintf(stderr,"dbg5     vehicleID:                   %d\n",sbp->vehicleID);
-		fprintf(stderr,"dbg5     softwareVersion:             %s\n",sbp->softwareVersion);
-		fprintf(stderr,"dbg5     sphericalCorrection:         %d\n",sbp->sphericalCorrection);
-		fprintf(stderr,"dbg5     packetNum:                   %d\n",sbp->packetNum);
-		fprintf(stderr,"dbg5     ADCDecimation:               %d\n",sbp->ADCDecimation);
-		fprintf(stderr,"dbg5     decimation:                  %d\n",sbp->decimation);
-		fprintf(stderr,"dbg5     unuseda:                     %d\n",sbp->unuseda);
-		fprintf(stderr,"dbg5     depth:                       %d\n",sbp->depth);
-		fprintf(stderr,"dbg5     sonardepth:                  %d\n",sbp->sonardepth);
-		fprintf(stderr,"dbg5     sonaraltitude:               %d\n",sbp->sonaraltitude);
-		if (sbp->dataFormat == 1)
-			{
-			for (i=0;i<sbp->samples;i++)
-				fprintf(stderr,"dbg5     Channel[%d]: %10d %10d\n",i,sbp->trace[2*i],sbp->trace[2*i+1]);
-			}
-		else
-			{
-			for (i=0;i<sbp->samples;i++)
-				fprintf(stderr,"dbg5     Channel[%d]: %10d\n",i,sbp->trace[i]);
-			}
-		}
-	else if (status == MB_SUCCESS && verbose >= 5
-	&& (store->kind == MB_DATA_DATA || store->kind == MB_DATA_SIDESCAN2))
-		{
-		fprintf(stderr,"\ndbg5  New sidescan data record read by MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5  Subsystem ID:\n");
-		fprintf(stderr,"dbg5       subsystem:        %d ", store->subsystem);
-		if (store->subsystem == MBSYS_JSTAR_SUBSYSTEM_SSLOW)
-			fprintf(stderr,"(75 or 120 kHz sidescan)\n");
-		else if (store->subsystem == MBSYS_JSTAR_SUBSYSTEM_SSHIGH)
-			fprintf(stderr,"(410 kHz sidescan)\n");
-
-		ss = (struct mbsys_jstar_channel_struct *) &(store->ssport);
-		fprintf(stderr,"\ndbg5  Channel 0 (Port):\n");
-		fprintf(stderr,"dbg5     start_marker:                %d\n",ss->message.start_marker);
-		fprintf(stderr,"dbg5     version:                     %d\n",ss->message.version);
-		fprintf(stderr,"dbg5     session:                     %d\n",ss->message.session);
-		fprintf(stderr,"dbg5     type:                        %d\n",ss->message.type);
-		fprintf(stderr,"dbg5     command:                     %d\n",ss->message.command);
-		fprintf(stderr,"dbg5     subsystem:                   %d\n",ss->message.subsystem);
-		fprintf(stderr,"dbg5     channel:                     %d\n",ss->message.channel);
-		fprintf(stderr,"dbg5     sequence:                    %d\n",ss->message.sequence);
-		fprintf(stderr,"dbg5     reserved:                    %d\n",ss->message.reserved);
-		fprintf(stderr,"dbg5     size:                        %d\n",ss->message.size);
-
-		fprintf(stderr,"dbg5     sequenceNumber:              %d\n",ss->sequenceNumber);
-		fprintf(stderr,"dbg5     startDepth:                  %d\n",ss->startDepth);
-		fprintf(stderr,"dbg5     pingNum:                     %d\n",ss->pingNum);
-		fprintf(stderr,"dbg5     channelNum:                  %d\n",ss->channelNum);
-		for (i=0;i<6;i++)
-			fprintf(stderr,"dbg5     unused1[%d]:                  %d\n",i,ss->unused1[i]);
-		fprintf(stderr,"dbg5     traceIDCode:                 %d\n",ss->traceIDCode);
-		for (i=0;i<2;i++)
-			fprintf(stderr,"dbg5     unused2[%d]:                  %d\n",i,ss->unused2[i]);
-		fprintf(stderr,"dbg5     dataFormat:                  %d\n",ss->dataFormat);
-		fprintf(stderr,"dbg5     NMEAantennaeR:               %d\n",ss->NMEAantennaeR);
-		fprintf(stderr,"dbg5     NMEAantennaeO:               %d\n",ss->NMEAantennaeO);
-		for (i=0;i<32;i++)
-			fprintf(stderr,"dbg5     RS232[%d]:                   %d\n",i,ss->RS232[i]);
-		fprintf(stderr,"dbg5     sourceCoordX:                %d\n",ss->sourceCoordX);
-		fprintf(stderr,"dbg5     sourceCoordY:                %d\n",ss->sourceCoordY);
-		fprintf(stderr,"dbg5     groupCoordX:                 %d\n",ss->groupCoordX);
-		fprintf(stderr,"dbg5     groupCoordY:                 %d\n",ss->groupCoordY);
-		fprintf(stderr,"dbg5     coordUnits:                  %d\n",ss->coordUnits);
-		fprintf(stderr,"dbg5     annotation:                  %s\n",ss->annotation);
-		fprintf(stderr,"dbg5     samples:                     %d\n",ss->samples);
-		fprintf(stderr,"dbg5     sampleInterval:              %d\n",ss->sampleInterval);
-		fprintf(stderr,"dbg5     ADCGain:                     %d\n",ss->ADCGain);
-		fprintf(stderr,"dbg5     pulsePower:                  %d\n",ss->pulsePower);
-		fprintf(stderr,"dbg5     correlated:                  %d\n",ss->correlated);
-		fprintf(stderr,"dbg5     startFreq:                   %d\n",ss->startFreq);
-		fprintf(stderr,"dbg5     endFreq:                     %d\n",ss->endFreq);
-		fprintf(stderr,"dbg5     sweepLength:                 %d\n",ss->sweepLength);
-		for (i=0;i<4;i++)
-			fprintf(stderr,"dbg5     unused7[%d]:                  %d\n",i,ss->unused7[i]);
-		fprintf(stderr,"dbg5     aliasFreq:                   %d\n",ss->aliasFreq);
-		fprintf(stderr,"dbg5     pulseID:                     %d\n",ss->pulseID);
-		for (i=0;i<6;i++)
-			fprintf(stderr,"dbg5     unused8[%d]:                  %d\n",i,ss->unused8[i]);
-		fprintf(stderr,"dbg5     year:                        %d\n",ss->year);
-		fprintf(stderr,"dbg5     day:                         %d\n",ss->day);
-		fprintf(stderr,"dbg5     hour:                        %d\n",ss->hour);
-		fprintf(stderr,"dbg5     minute:                      %d\n",ss->minute);
-		fprintf(stderr,"dbg5     second:                      %d\n",ss->second);
-		fprintf(stderr,"dbg5     timeBasis:                   %d\n",ss->timeBasis);
-		fprintf(stderr,"dbg5     weightingFactor:             %d\n",ss->weightingFactor);
-		fprintf(stderr,"dbg5     unused9:                     %d\n",ss->unused9);
-		fprintf(stderr,"dbg5     heading:                     %d\n",ss->heading);
-		fprintf(stderr,"dbg5     pitch:                       %d\n",ss->pitch);
-		fprintf(stderr,"dbg5     roll:                        %d\n",ss->roll);
-		fprintf(stderr,"dbg5     temperature:                 %d\n",ss->temperature);
-		fprintf(stderr,"dbg5     heaveCompensation:           %d\n",ss->heaveCompensation);
-		fprintf(stderr,"dbg5     trigSource:                  %d\n",ss->trigSource);
-		fprintf(stderr,"dbg5     markNumber:                  %d\n",ss->markNumber);
-		fprintf(stderr,"dbg5     NMEAHour:                    %d\n",ss->NMEAHour);
-		fprintf(stderr,"dbg5     NMEAMinutes:                 %d\n",ss->NMEAMinutes);
-		fprintf(stderr,"dbg5     NMEASeconds:                 %d\n",ss->NMEASeconds);
-		fprintf(stderr,"dbg5     NMEACourse:                  %d\n",ss->NMEACourse);
-		fprintf(stderr,"dbg5     NMEASpeed:                   %d\n",ss->NMEASpeed);
-		fprintf(stderr,"dbg5     NMEADay:                     %d\n",ss->NMEADay);
-		fprintf(stderr,"dbg5     NMEAYear:                    %d\n",ss->NMEAYear);
-		fprintf(stderr,"dbg5     millisecondsToday:           %d\n",ss->millisecondsToday);
-		fprintf(stderr,"dbg5     ADCMax:                      %d\n",ss->ADCMax);
-		fprintf(stderr,"dbg5     calConst:                    %d\n",ss->calConst);
-		fprintf(stderr,"dbg5     vehicleID:                   %d\n",ss->vehicleID);
-		fprintf(stderr,"dbg5     softwareVersion:             %s\n",ss->softwareVersion);
-		fprintf(stderr,"dbg5     sphericalCorrection:         %d\n",ss->sphericalCorrection);
-		fprintf(stderr,"dbg5     packetNum:                   %d\n",ss->packetNum);
-		fprintf(stderr,"dbg5     ADCDecimation:               %d\n",ss->ADCDecimation);
-		fprintf(stderr,"dbg5     decimation:                  %d\n",ss->decimation);
-		fprintf(stderr,"dbg5     unuseda:                     %d\n",ss->unuseda);
-		fprintf(stderr,"dbg5     depth:                       %d\n",ss->depth);
-		fprintf(stderr,"dbg5     sonardepth:                  %d\n",ss->sonardepth);
-		fprintf(stderr,"dbg5     sonaraltitude:               %d\n",ss->sonaraltitude);
-		if (ss->dataFormat == 1)
-			{
-			for (i=0;i<ss->samples;i++)
-				fprintf(stderr,"dbg5     Channel 0[%d]: %10d %10d\n",i,ss->trace[2*i],ss->trace[2*i+1]);
-			}
-		else
-			{
-			for (i=0;i<ss->samples;i++)
-				fprintf(stderr,"dbg5     Channel 0[%d]: %10d\n",i,ss->trace[i]);
-			}
-
-		ss = (struct mbsys_jstar_channel_struct *) &(store->ssstbd);
-		fprintf(stderr,"\ndbg5  Channel 1 (Starboard):\n");
-		fprintf(stderr,"dbg5     start_marker:                %d\n",ss->message.start_marker);
-		fprintf(stderr,"dbg5     version:                     %d\n",ss->message.version);
-		fprintf(stderr,"dbg5     session:                     %d\n",ss->message.session);
-		fprintf(stderr,"dbg5     type:                        %d\n",ss->message.type);
-		fprintf(stderr,"dbg5     command:                     %d\n",ss->message.command);
-		fprintf(stderr,"dbg5     subsystem:                   %d\n",ss->message.subsystem);
-		fprintf(stderr,"dbg5     channel:                     %d\n",ss->message.channel);
-		fprintf(stderr,"dbg5     sequence:                    %d\n",ss->message.sequence);
-		fprintf(stderr,"dbg5     reserved:                    %d\n",ss->message.reserved);
-		fprintf(stderr,"dbg5     size:                        %d\n",ss->message.size);
-
-		fprintf(stderr,"dbg5     sequenceNumber:              %d\n",ss->sequenceNumber);
-		fprintf(stderr,"dbg5     startDepth:                  %d\n",ss->startDepth);
-		fprintf(stderr,"dbg5     pingNum:                     %d\n",ss->pingNum);
-		fprintf(stderr,"dbg5     channelNum:                  %d\n",ss->channelNum);
-		for (i=0;i<6;i++)
-			fprintf(stderr,"dbg5     unused1[%d]:                  %d\n",i,ss->unused1[i]);
-		fprintf(stderr,"dbg5     traceIDCode:                 %d\n",ss->traceIDCode);
-		for (i=0;i<2;i++)
-			fprintf(stderr,"dbg5     unused2[%d]:                  %d\n",i,ss->unused2[i]);
-		fprintf(stderr,"dbg5     dataFormat:                  %d\n",ss->dataFormat);
-		fprintf(stderr,"dbg5     NMEAantennaeR:               %d\n",ss->NMEAantennaeR);
-		fprintf(stderr,"dbg5     NMEAantennaeO:               %d\n",ss->NMEAantennaeO);
-		for (i=0;i<32;i++)
-			fprintf(stderr,"dbg5     RS232[%d]:                   %d\n",i,ss->RS232[i]);
-		fprintf(stderr,"dbg5     sourceCoordX:                %d\n",ss->sourceCoordX);
-		fprintf(stderr,"dbg5     sourceCoordY:                %d\n",ss->sourceCoordY);
-		fprintf(stderr,"dbg5     groupCoordX:                 %d\n",ss->groupCoordX);
-		fprintf(stderr,"dbg5     groupCoordY:                 %d\n",ss->groupCoordY);
-		fprintf(stderr,"dbg5     coordUnits:                  %d\n",ss->coordUnits);
-		fprintf(stderr,"dbg5     annotation:                  %s\n",ss->annotation);
-		fprintf(stderr,"dbg5     samples:                     %d\n",ss->samples);
-		fprintf(stderr,"dbg5     sampleInterval:              %d\n",ss->sampleInterval);
-		fprintf(stderr,"dbg5     ADCGain:                     %d\n",ss->ADCGain);
-		fprintf(stderr,"dbg5     pulsePower:                  %d\n",ss->pulsePower);
-		fprintf(stderr,"dbg5     correlated:                  %d\n",ss->correlated);
-		fprintf(stderr,"dbg5     startFreq:                   %d\n",ss->startFreq);
-		fprintf(stderr,"dbg5     endFreq:                     %d\n",ss->endFreq);
-		fprintf(stderr,"dbg5     sweepLength:                 %d\n",ss->sweepLength);
-		for (i=0;i<4;i++)
-			fprintf(stderr,"dbg5     unused7[%d]:                  %d\n",i,ss->unused7[i]);
-		fprintf(stderr,"dbg5     aliasFreq:                   %d\n",ss->aliasFreq);
-		fprintf(stderr,"dbg5     pulseID:                     %d\n",ss->pulseID);
-		for (i=0;i<6;i++)
-			fprintf(stderr,"dbg5     unused8[%d]:                  %d\n",i,ss->unused8[i]);
-		fprintf(stderr,"dbg5     year:                        %d\n",ss->year);
-		fprintf(stderr,"dbg5     day:                         %d\n",ss->day);
-		fprintf(stderr,"dbg5     hour:                        %d\n",ss->hour);
-		fprintf(stderr,"dbg5     minute:                      %d\n",ss->minute);
-		fprintf(stderr,"dbg5     second:                      %d\n",ss->second);
-		fprintf(stderr,"dbg5     timeBasis:                   %d\n",ss->timeBasis);
-		fprintf(stderr,"dbg5     weightingFactor:             %d\n",ss->weightingFactor);
-		fprintf(stderr,"dbg5     unused9:                     %d\n",ss->unused9);
-		fprintf(stderr,"dbg5     heading:                     %d\n",ss->heading);
-		fprintf(stderr,"dbg5     pitch:                       %d\n",ss->pitch);
-		fprintf(stderr,"dbg5     roll:                        %d\n",ss->roll);
-		fprintf(stderr,"dbg5     temperature:                 %d\n",ss->temperature);
-		fprintf(stderr,"dbg5     heaveCompensation:           %d\n",ss->heaveCompensation);
-		fprintf(stderr,"dbg5     trigSource:                  %d\n",ss->trigSource);
-		fprintf(stderr,"dbg5     markNumber:                  %d\n",ss->markNumber);
-		fprintf(stderr,"dbg5     NMEAHour:                    %d\n",ss->NMEAHour);
-		fprintf(stderr,"dbg5     NMEAMinutes:                 %d\n",ss->NMEAMinutes);
-		fprintf(stderr,"dbg5     NMEASeconds:                 %d\n",ss->NMEASeconds);
-		fprintf(stderr,"dbg5     NMEACourse:                  %d\n",ss->NMEACourse);
-		fprintf(stderr,"dbg5     NMEASpeed:                   %d\n",ss->NMEASpeed);
-		fprintf(stderr,"dbg5     NMEADay:                     %d\n",ss->NMEADay);
-		fprintf(stderr,"dbg5     NMEAYear:                    %d\n",ss->NMEAYear);
-		fprintf(stderr,"dbg5     millisecondsToday:           %d\n",ss->millisecondsToday);
-		fprintf(stderr,"dbg5     ADCMax:                      %d\n",ss->ADCMax);
-		fprintf(stderr,"dbg5     calConst:                    %d\n",ss->calConst);
-		fprintf(stderr,"dbg5     vehicleID:                   %d\n",ss->vehicleID);
-		fprintf(stderr,"dbg5     softwareVersion:             %s\n",ss->softwareVersion);
-		fprintf(stderr,"dbg5     sphericalCorrection:         %d\n",ss->sphericalCorrection);
-		fprintf(stderr,"dbg5     packetNum:                   %d\n",ss->packetNum);
-		fprintf(stderr,"dbg5     ADCDecimation:               %d\n",ss->ADCDecimation);
-		fprintf(stderr,"dbg5     decimation:                  %d\n",ss->decimation);
-		fprintf(stderr,"dbg5     unuseda:                     %d\n",ss->unuseda);
-		fprintf(stderr,"dbg5     depth:                       %d\n",ss->depth);
-		fprintf(stderr,"dbg5     sonardepth:                  %d\n",ss->sonardepth);
-		fprintf(stderr,"dbg5     sonaraltitude:               %d\n",ss->sonaraltitude);
-		if (ss->dataFormat == 1)
-			{
-			for (i=0;i<ss->samples;i++)
-				fprintf(stderr,"dbg5     Channel 1[%d]: %10d %10d\n",i,ss->trace[2*i],ss->trace[2*i+1]);
-			}
-		else
-			{
-			for (i=0;i<ss->samples;i++)
-				fprintf(stderr,"dbg5     Channel 1[%d]: %10d\n",i,ss->trace[i]);
-			}
-		}
-	else if (status == MB_SUCCESS && verbose >= 5 && store->kind == MB_DATA_ATTITUDE)
-		{
-		fprintf(stderr,"\ndbg5  New roll pitch data record read by MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5  Subsystem ID:\n");
-		fprintf(stderr,"dbg5       subsystem:        %d ", store->subsystem);
-		if (store->subsystem == MBSYS_JSTAR_SUBSYSTEM_SSLOW)
-			fprintf(stderr,"(75 or 120 kHz sidescan)\n");
-		else if (store->subsystem == MBSYS_JSTAR_SUBSYSTEM_SSHIGH)
-			fprintf(stderr,"(410 kHz sidescan)\n");
-
-		pitchroll = (struct mbsys_jstar_pitchroll_struct *) &(store->pitchroll);
-		fprintf(stderr,"\ndbg5  Roll and Pitch:\n");
-		fprintf(stderr,"dbg5     start_marker:                %d\n",pitchroll->message.start_marker);
-		fprintf(stderr,"dbg5     version:                     %d\n",pitchroll->message.version);
-		fprintf(stderr,"dbg5     session:                     %d\n",pitchroll->message.session);
-		fprintf(stderr,"dbg5     type:                        %d\n",pitchroll->message.type);
-		fprintf(stderr,"dbg5     command:                     %d\n",pitchroll->message.command);
-		fprintf(stderr,"dbg5     subsystem:                   %d\n",pitchroll->message.subsystem);
-		fprintf(stderr,"dbg5     channel:                     %d\n",pitchroll->message.channel);
-		fprintf(stderr,"dbg5     sequence:                    %d\n",pitchroll->message.sequence);
-		fprintf(stderr,"dbg5     reserved:                    %d\n",pitchroll->message.reserved);
-		fprintf(stderr,"dbg5     size:                        %d\n",pitchroll->message.size);
-
-		fprintf(stderr,"dbg5     seconds:                     %d\n",pitchroll->seconds);
-		fprintf(stderr,"dbg5     msec:                        %d\n",pitchroll->msec);
-		fprintf(stderr,"dbg5     reserve1[0]:                 %d\n",pitchroll->reserve1[0]);
-		fprintf(stderr,"dbg5     reserve1[1]:                 %d\n",pitchroll->reserve1[1]);
-		fprintf(stderr,"dbg5     reserve1[2]:                 %d\n",pitchroll->reserve1[2]);
-		fprintf(stderr,"dbg5     reserve1[3]:                 %d\n",pitchroll->reserve1[3]);
-		fprintf(stderr,"dbg5     accelerationx:               %d\n",pitchroll->accelerationx);
-		fprintf(stderr,"dbg5     accelerationy:               %d\n",pitchroll->accelerationy);
-		fprintf(stderr,"dbg5     accelerationz:               %d\n",pitchroll->accelerationz);
-		fprintf(stderr,"dbg5     gyroratex:                   %d\n",pitchroll->gyroratex);
-		fprintf(stderr,"dbg5     gyroratey:                   %d\n",pitchroll->gyroratey);
-		fprintf(stderr,"dbg5     gyroratez:                   %d\n",pitchroll->gyroratez);
-		fprintf(stderr,"dbg5     pitch:                       %d\n",pitchroll->pitch);
-		fprintf(stderr,"dbg5     roll:                        %d\n",pitchroll->roll);
-		fprintf(stderr,"dbg5     temperature:                 %d\n",pitchroll->temperature);
-		fprintf(stderr,"dbg5     deviceinfo:                  %d\n",pitchroll->deviceinfo);
-		fprintf(stderr,"dbg5     heave:                       %d\n",pitchroll->heave);
-		fprintf(stderr,"dbg5     heading:                     %d\n",pitchroll->heading);
-		fprintf(stderr,"dbg5     datavalidflags:              %d\n",pitchroll->datavalidflags);
-		fprintf(stderr,"dbg5     reserve2:                    %d\n",pitchroll->reserve2);
-		}
-	else if (status == MB_SUCCESS && verbose >= 5 && store->kind == MB_DATA_DVL)
-		{
-		fprintf(stderr,"\ndbg5  New dvl data record read by MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5  Subsystem ID:\n");
-		fprintf(stderr,"dbg5       subsystem:        %d ", store->subsystem);
-		if (store->subsystem == MBSYS_JSTAR_SUBSYSTEM_SSLOW)
-			fprintf(stderr,"(75 or 120 kHz sidescan)\n");
-		else if (store->subsystem == MBSYS_JSTAR_SUBSYSTEM_SSHIGH)
-			fprintf(stderr,"(410 kHz sidescan)\n");
-
-		dvl = (struct mbsys_jstar_dvl_struct *) &(store->dvl);
-		fprintf(stderr,"\ndbg5  Roll and Pitch:\n");
-		fprintf(stderr,"dbg5     start_marker:                %d\n",dvl->message.start_marker);
-		fprintf(stderr,"dbg5     version:                     %d\n",dvl->message.version);
-		fprintf(stderr,"dbg5     session:                     %d\n",dvl->message.session);
-		fprintf(stderr,"dbg5     type:                        %d\n",dvl->message.type);
-		fprintf(stderr,"dbg5     command:                     %d\n",dvl->message.command);
-		fprintf(stderr,"dbg5     subsystem:                   %d\n",dvl->message.subsystem);
-		fprintf(stderr,"dbg5     channel:                     %d\n",dvl->message.channel);
-		fprintf(stderr,"dbg5     sequence:                    %d\n",dvl->message.sequence);
-		fprintf(stderr,"dbg5     reserved:                    %d\n",dvl->message.reserved);
-		fprintf(stderr,"dbg5     size:                        %d\n",dvl->message.size);
-
-		fprintf(stderr,"dbg5     seconds:                     %d\n",dvl->seconds);
-		fprintf(stderr,"dbg5     msec:                        %d\n",dvl->msec);
-		fprintf(stderr,"dbg5     reserve1[0]:                 %d\n",dvl->reserve1[0]);
-		fprintf(stderr,"dbg5     reserve1[1]:                 %d\n",dvl->reserve1[1]);
-		fprintf(stderr,"dbg5     reserve1[2]:                 %d\n",dvl->reserve1[2]);
-		fprintf(stderr,"dbg5     reserve1[3]:                 %d\n",dvl->reserve1[3]);
-		fprintf(stderr,"dbg5     datavalidflags:              %d\n",dvl->datavalidflags);
-		fprintf(stderr,"dbg5     beam1range:                  %d\n",dvl->beam1range);
-		fprintf(stderr,"dbg5     beam2range:                  %d\n",dvl->beam2range);
-		fprintf(stderr,"dbg5     beam3range:                  %d\n",dvl->beam3range);
-		fprintf(stderr,"dbg5     beam4range:                  %d\n",dvl->beam4range);
-		fprintf(stderr,"dbg5     velocitybottomx:             %d\n",dvl->velocitybottomx);
-		fprintf(stderr,"dbg5     velocitybottomy:             %d\n",dvl->velocitybottomy);
-		fprintf(stderr,"dbg5     velocitybottomz:             %d\n",dvl->velocitybottomz);
-		fprintf(stderr,"dbg5     velocitywaterx:              %d\n",dvl->velocitywaterx);
-		fprintf(stderr,"dbg5     velocitywatery:              %d\n",dvl->velocitywatery);
-		fprintf(stderr,"dbg5     velocitywaterz:              %d\n",dvl->velocitywaterz);
-		fprintf(stderr,"dbg5     depth:                       %d\n",dvl->depth);
-		fprintf(stderr,"dbg5     pitch:                       %d\n",dvl->pitch);
-		fprintf(stderr,"dbg5     roll:                        %d\n",dvl->roll);
-		fprintf(stderr,"dbg5     heading:                     %d\n",dvl->heading);
-		fprintf(stderr,"dbg5     salinity:                    %d\n",dvl->salinity);
-		fprintf(stderr,"dbg5     temperature:                 %d\n",dvl->temperature);
-		fprintf(stderr,"dbg5     soundspeed:                  %d\n",dvl->soundspeed);
-		for (i=0;i<7;i++)
-		fprintf(stderr,"dbg5     reserve2[%d]:                %d\n",i,dvl->reserve2[i]);
-		}
-	else if (status == MB_SUCCESS && verbose >= 5 && store->kind == MB_DATA_CTD)
-		{
-		pressure = (struct mbsys_jstar_pressure_struct *) &(store->pressure);
-		fprintf(stderr,"\ndbg5  New pressure data record read by MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5     start_marker:                %d\n",pressure->message.start_marker);
-		fprintf(stderr,"dbg5     version:                     %d\n",pressure->message.version);
-		fprintf(stderr,"dbg5     session:                     %d\n",pressure->message.session);
-		fprintf(stderr,"dbg5     type:                        %d\n",pressure->message.type);
-		fprintf(stderr,"dbg5     command:                     %d\n",pressure->message.command);
-		fprintf(stderr,"dbg5     subsystem:                   %d\n",pressure->message.subsystem);
-		fprintf(stderr,"dbg5     channel:                     %d\n",pressure->message.channel);
-		fprintf(stderr,"dbg5     sequence:                    %d\n",pressure->message.sequence);
-		fprintf(stderr,"dbg5     reserved:                    %d\n",pressure->message.reserved);
-		fprintf(stderr,"dbg5     size:                        %d\n",pressure->message.size);
-
-		fprintf(stderr,"dbg5     seconds:                     %d\n",pressure->seconds);
-		fprintf(stderr,"dbg5     msec:                        %d\n",pressure->msec);
-		fprintf(stderr,"dbg5     reserve1[0]:                 %d\n",pressure->reserve1[0]);
-		fprintf(stderr,"dbg5     reserve1[1]:                 %d\n",pressure->reserve1[1]);
-		fprintf(stderr,"dbg5     reserve1[2]:                 %d\n",pressure->reserve1[2]);
-		fprintf(stderr,"dbg5     reserve1[3]:                 %d\n",pressure->reserve1[3]);
-		fprintf(stderr,"dbg5     pressure:                    %d\n",pressure->pressure);
-		fprintf(stderr,"dbg5     salinity:                    %d\n",pressure->salinity);
-		fprintf(stderr,"dbg5     datavalidflags:              %d\n",pressure->datavalidflags);
-		fprintf(stderr,"dbg5     conductivity:                %d\n",pressure->conductivity);
-		fprintf(stderr,"dbg5     soundspeed:                  %d\n",pressure->soundspeed);
-		for(i=0;i<10;i++)
-			fprintf(stderr,"dbg5     reserve2[%2d]:                 %d\n",i,pitchroll->reserve2);
-		}
-	else if (status == MB_SUCCESS && verbose >= 5 &&
-		(store->kind == MB_DATA_NMEA_RMC || store->kind == MB_DATA_NMEA_DBT || store->kind == MB_DATA_NMEA_DPT))
-		{
-		nmea = (struct mbsys_jstar_nmea_struct *) &(store->nmea);
-		fprintf(stderr,"\ndbg5  New NMEA data record read by MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5     start_marker:                %d\n",nmea->message.start_marker);
-		fprintf(stderr,"dbg5     version:                     %d\n",nmea->message.version);
-		fprintf(stderr,"dbg5     session:                     %d\n",nmea->message.session);
-		fprintf(stderr,"dbg5     type:                        %d\n",nmea->message.type);
-		fprintf(stderr,"dbg5     command:                     %d\n",nmea->message.command);
-		fprintf(stderr,"dbg5     subsystem:                   %d\n",nmea->message.subsystem);
-		fprintf(stderr,"dbg5     channel:                     %d\n",nmea->message.channel);
-		fprintf(stderr,"dbg5     sequence:                    %d\n",nmea->message.sequence);
-		fprintf(stderr,"dbg5     reserved:                    %d\n",nmea->message.reserved);
-		fprintf(stderr,"dbg5     size:                        %d\n",nmea->message.size);
-
-		fprintf(stderr,"dbg5     seconds:                     %d\n",nmea->seconds);
-		fprintf(stderr,"dbg5     msec:                        %d\n",nmea->msec);
-		fprintf(stderr,"dbg5     source:                      %d\n",nmea->source);
-		fprintf(stderr,"dbg5     reserve[0]:                  %d\n",nmea->reserve[0]);
-		fprintf(stderr,"dbg5     reserve[1]:                  %d\n",nmea->reserve[1]);
-		fprintf(stderr,"dbg5     reserve[2]:                  %d\n",nmea->reserve[2]);
-		fprintf(stderr,"dbg5     nmea:                        %s\n",nmea->nmea);
-		}
-	else if (status == MB_SUCCESS && verbose >= 5 &&
-		(store->kind == MB_DATA_HEADER))
-		{
-		sysinfo = (struct mbsys_jstar_sysinfo_struct *) &(store->sysinfo);
-		fprintf(stderr,"\ndbg5  New sysinfo data record read by MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5     start_marker:                %d\n",sysinfo->message.start_marker);
-		fprintf(stderr,"dbg5     version:                     %d\n",sysinfo->message.version);
-		fprintf(stderr,"dbg5     session:                     %d\n",sysinfo->message.session);
-		fprintf(stderr,"dbg5     type:                        %d\n",sysinfo->message.type);
-		fprintf(stderr,"dbg5     command:                     %d\n",sysinfo->message.command);
-		fprintf(stderr,"dbg5     subsystem:                   %d\n",sysinfo->message.subsystem);
-		fprintf(stderr,"dbg5     channel:                     %d\n",sysinfo->message.channel);
-		fprintf(stderr,"dbg5     sequence:                    %d\n",sysinfo->message.sequence);
-		fprintf(stderr,"dbg5     reserved:                    %d\n",sysinfo->message.reserved);
-		fprintf(stderr,"dbg5     size:                        %d\n",sysinfo->message.size);
-
-		fprintf(stderr,"dbg5     system_type:                 %d\n",sysinfo->system_type);
-		fprintf(stderr,"dbg5     reserved1:                   %d\n",sysinfo->reserved1);
-		fprintf(stderr,"dbg5     version:                     %d\n",sysinfo->version);
-		fprintf(stderr,"dbg5     reserved2:                   %d\n",sysinfo->reserved2);
-		fprintf(stderr,"dbg5     platformserialnumber:        %d\n",sysinfo->platformserialnumber);
-		fprintf(stderr,"dbg5     sysinfosize:                 %d\n",sysinfo->sysinfosize);
-		fprintf(stderr,"dbg5     sysinfo:                     \n%s\n",sysinfo->sysinfo);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_wt_edgjstar(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_wt_edgjstar";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_jstar_struct *store;
-	struct mbsys_jstar_channel_struct *sbp;
-	struct mbsys_jstar_channel_struct *ss;
-	struct mbsys_jstar_nmea_struct *nmea;
-	struct mbsys_jstar_pitchroll_struct *pitchroll;
-	struct mbsys_jstar_dvl_struct *dvl;
-	struct mbsys_jstar_pressure_struct *pressure;
-	struct mbsys_jstar_sysinfo_struct *sysinfo;
-	struct mbsys_jstar_comment_struct *comment;
-	char	buffer[MBSYS_JSTAR_SBPHEADER_SIZE];
-	int	index;
-	int	write_len;
-	int	shortspersample;
-	int	trace_size;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 3)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_jstar_struct *) store_ptr;
-
-	/* print debug statements */
-	if (status == MB_SUCCESS && verbose >= 5 && store->kind == MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"\ndbg5  New comment to be written by MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5  Subsystem ID:\n");
-		fprintf(stderr,"dbg5       subsystem:        %d ", store->subsystem);
-		if (store->subsystem == 0)
-			fprintf(stderr,"(subbottom)\n");
-		else if (store->subsystem == MBSYS_JSTAR_SUBSYSTEM_SSLOW)
-			fprintf(stderr,"(75 or 120 kHz sidescan)\n");
-		else if (store->subsystem == MBSYS_JSTAR_SUBSYSTEM_SSHIGH)
-			fprintf(stderr,"(410 kHz sidescan)\n");
-
-		fprintf(stderr,"\ndbg5  Comment:\n");
-		comment = (struct mbsys_jstar_comment_struct *) &(store->comment);
-		fprintf(stderr,"dbg5     start_marker:                %d\n",comment->message.start_marker);
-		fprintf(stderr,"dbg5     version:                     %d\n",comment->message.version);
-		fprintf(stderr,"dbg5     session:                     %d\n",comment->message.session);
-		fprintf(stderr,"dbg5     type:                        %d\n",comment->message.type);
-		fprintf(stderr,"dbg5     command:                     %d\n",comment->message.command);
-		fprintf(stderr,"dbg5     subsystem:                   %d\n",comment->message.subsystem);
-		fprintf(stderr,"dbg5     channel:                     %d\n",comment->message.channel);
-		fprintf(stderr,"dbg5     sequence:                    %d\n",comment->message.sequence);
-		fprintf(stderr,"dbg5     reserved:                    %d\n",comment->message.reserved);
-		fprintf(stderr,"dbg5     size:                        %d\n",comment->message.size);
-
-		fprintf(stderr,"dbg5     comment:                     %s\n",store->comment.comment);
-		}
-	else if (status == MB_SUCCESS && verbose >= 5 && store->kind == MB_DATA_SUBBOTTOM_SUBBOTTOM)
-		{
-		sbp = (struct mbsys_jstar_channel_struct *) &(store->sbp);
-		fprintf(stderr,"\ndbg5  New subbottom data record to be written by MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5  Subsystem ID:\n");
-		fprintf(stderr,"dbg5       subsystem:        %d (subbottom)\n", store->subsystem);
-		fprintf(stderr,"\ndbg5  Channel:\n");
-		fprintf(stderr,"dbg5     start_marker:                %d\n",sbp->message.start_marker);
-		fprintf(stderr,"dbg5     version:                     %d\n",sbp->message.version);
-		fprintf(stderr,"dbg5     session:                     %d\n",sbp->message.session);
-		fprintf(stderr,"dbg5     type:                        %d\n",sbp->message.type);
-		fprintf(stderr,"dbg5     command:                     %d\n",sbp->message.command);
-		fprintf(stderr,"dbg5     subsystem:                   %d\n",sbp->message.subsystem);
-		fprintf(stderr,"dbg5     channel:                     %d\n",sbp->message.channel);
-		fprintf(stderr,"dbg5     sequence:                    %d\n",sbp->message.sequence);
-		fprintf(stderr,"dbg5     reserved:                    %d\n",sbp->message.reserved);
-		fprintf(stderr,"dbg5     size:                        %d\n",sbp->message.size);
-
-		fprintf(stderr,"dbg5     sequenceNumber:              %d\n",sbp->sequenceNumber);
-		fprintf(stderr,"dbg5     startDepth:                  %d\n",sbp->startDepth);
-		fprintf(stderr,"dbg5     pingNum:                     %d\n",sbp->pingNum);
-		fprintf(stderr,"dbg5     channelNum:                  %d\n",sbp->channelNum);
-		for (i=0;i<6;i++)
-			fprintf(stderr,"dbg5     unused1[%d]:                  %d\n",i,sbp->unused1[i]);
-		fprintf(stderr,"dbg5     traceIDCode:                 %d\n",sbp->traceIDCode);
-		for (i=0;i<2;i++)
-			fprintf(stderr,"dbg5     unused2[%d]:                  %d\n",i,sbp->unused2[i]);
-		fprintf(stderr,"dbg5     dataFormat:                  %d\n",sbp->dataFormat);
-		fprintf(stderr,"dbg5     NMEAantennaeR:               %d\n",sbp->NMEAantennaeR);
-		fprintf(stderr,"dbg5     NMEAantennaeO:               %d\n",sbp->NMEAantennaeO);
-		for (i=0;i<32;i++)
-			fprintf(stderr,"dbg5     RS232[%d]:                   %d\n",i,sbp->RS232[i]);
-		fprintf(stderr,"dbg5     sourceCoordX:                %d\n",sbp->sourceCoordX);
-		fprintf(stderr,"dbg5     sourceCoordY:                %d\n",sbp->sourceCoordY);
-		fprintf(stderr,"dbg5     groupCoordX:                 %d\n",sbp->groupCoordX);
-		fprintf(stderr,"dbg5     groupCoordY:                 %d\n",sbp->groupCoordY);
-		fprintf(stderr,"dbg5     coordUnits:                  %d\n",sbp->coordUnits);
-		fprintf(stderr,"dbg5     annotation:                  %s\n",sbp->annotation);
-		fprintf(stderr,"dbg5     samples:                     %d\n",sbp->samples);
-		fprintf(stderr,"dbg5     sampleInterval:              %d\n",sbp->sampleInterval);
-		fprintf(stderr,"dbg5     ADCGain:                     %d\n",sbp->ADCGain);
-		fprintf(stderr,"dbg5     pulsePower:                  %d\n",sbp->pulsePower);
-		fprintf(stderr,"dbg5     correlated:                  %d\n",sbp->correlated);
-		fprintf(stderr,"dbg5     startFreq:                   %d\n",sbp->startFreq);
-		fprintf(stderr,"dbg5     endFreq:                     %d\n",sbp->endFreq);
-		fprintf(stderr,"dbg5     sweepLength:                 %d\n",sbp->sweepLength);
-		for (i=0;i<4;i++)
-			fprintf(stderr,"dbg5     unused7[%d]:                  %d\n",i,sbp->unused7[i]);
-		fprintf(stderr,"dbg5     aliasFreq:                   %d\n",sbp->aliasFreq);
-		fprintf(stderr,"dbg5     pulseID:                     %d\n",sbp->pulseID);
-		for (i=0;i<6;i++)
-			fprintf(stderr,"dbg5     unused8[%d]:                  %d\n",i,sbp->unused8[i]);
-		fprintf(stderr,"dbg5     year:                        %d\n",sbp->year);
-		fprintf(stderr,"dbg5     day:                         %d\n",sbp->day);
-		fprintf(stderr,"dbg5     hour:                        %d\n",sbp->hour);
-		fprintf(stderr,"dbg5     minute:                      %d\n",sbp->minute);
-		fprintf(stderr,"dbg5     second:                      %d\n",sbp->second);
-		fprintf(stderr,"dbg5     timeBasis:                   %d\n",sbp->timeBasis);
-		fprintf(stderr,"dbg5     weightingFactor:             %d\n",sbp->weightingFactor);
-		fprintf(stderr,"dbg5     unused9:                     %d\n",sbp->unused9);
-		fprintf(stderr,"dbg5     heading:                     %d\n",sbp->heading);
-		fprintf(stderr,"dbg5     pitch:                       %d\n",sbp->pitch);
-		fprintf(stderr,"dbg5     roll:                        %d\n",sbp->roll);
-		fprintf(stderr,"dbg5     temperature:                 %d\n",sbp->temperature);
-		fprintf(stderr,"dbg5     heaveCompensation:           %d\n",sbp->heaveCompensation);
-		fprintf(stderr,"dbg5     trigSource:                  %d\n",sbp->trigSource);
-		fprintf(stderr,"dbg5     markNumber:                  %d\n",sbp->markNumber);
-		fprintf(stderr,"dbg5     NMEAHour:                    %d\n",sbp->NMEAHour);
-		fprintf(stderr,"dbg5     NMEAMinutes:                 %d\n",sbp->NMEAMinutes);
-		fprintf(stderr,"dbg5     NMEASeconds:                 %d\n",sbp->NMEASeconds);
-		fprintf(stderr,"dbg5     NMEACourse:                  %d\n",sbp->NMEACourse);
-		fprintf(stderr,"dbg5     NMEASpeed:                   %d\n",sbp->NMEASpeed);
-		fprintf(stderr,"dbg5     NMEADay:                     %d\n",sbp->NMEADay);
-		fprintf(stderr,"dbg5     NMEAYear:                    %d\n",sbp->NMEAYear);
-		fprintf(stderr,"dbg5     millisecondsToday:           %d\n",sbp->millisecondsToday);
-		fprintf(stderr,"dbg5     ADCMax:                      %d\n",sbp->ADCMax);
-		fprintf(stderr,"dbg5     calConst:                    %d\n",sbp->calConst);
-		fprintf(stderr,"dbg5     vehicleID:                   %d\n",sbp->vehicleID);
-		fprintf(stderr,"dbg5     softwareVersion:             %s\n",sbp->softwareVersion);
-		fprintf(stderr,"dbg5     sphericalCorrection:         %d\n",sbp->sphericalCorrection);
-		fprintf(stderr,"dbg5     packetNum:                   %d\n",sbp->packetNum);
-		fprintf(stderr,"dbg5     ADCDecimation:               %d\n",sbp->ADCDecimation);
-		fprintf(stderr,"dbg5     decimation:                  %d\n",sbp->decimation);
-		fprintf(stderr,"dbg5     unuseda:                     %d\n",sbp->unuseda);
-		fprintf(stderr,"dbg5     depth:                       %d\n",sbp->depth);
-		fprintf(stderr,"dbg5     sonardepth:                  %d\n",sbp->sonardepth);
-		fprintf(stderr,"dbg5     sonaraltitude:               %d\n",sbp->sonaraltitude);
-		if (sbp->dataFormat == 1)
-			{
-			for (i=0;i<sbp->samples;i++)
-				fprintf(stderr,"dbg5     Channel[%d]: %10d %10d\n",i,sbp->trace[2*i],sbp->trace[2*i+1]);
-			}
-		else
-			{
-			for (i=0;i<sbp->samples;i++)
-				fprintf(stderr,"dbg5     Channel[%d]: %10d\n",i,sbp->trace[i]);
-			}
-		}
-	else if (status == MB_SUCCESS && verbose >= 5
-	&& (store->kind == MB_DATA_DATA || store->kind == MB_DATA_SIDESCAN2))
-		{
-		fprintf(stderr,"\ndbg5  New sidescan data record to be written by MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5  Subsystem ID:\n");
-		fprintf(stderr,"dbg5       subsystem:        %d ", store->subsystem);
-		if (store->subsystem == MBSYS_JSTAR_SUBSYSTEM_SSLOW)
-			fprintf(stderr,"(75 or 120 kHz sidescan)\n");
-		else if (store->subsystem == MBSYS_JSTAR_SUBSYSTEM_SSHIGH)
-			fprintf(stderr,"(410 kHz sidescan)\n");
-
-		ss = (struct mbsys_jstar_channel_struct *) &(store->ssport);
-		fprintf(stderr,"\ndbg5  Channel 0 (Port):\n");
-		fprintf(stderr,"dbg5     start_marker:                %d\n",ss->message.start_marker);
-		fprintf(stderr,"dbg5     version:                     %d\n",ss->message.version);
-		fprintf(stderr,"dbg5     session:                     %d\n",ss->message.session);
-		fprintf(stderr,"dbg5     type:                        %d\n",ss->message.type);
-		fprintf(stderr,"dbg5     command:                     %d\n",ss->message.command);
-		fprintf(stderr,"dbg5     subsystem:                   %d\n",ss->message.subsystem);
-		fprintf(stderr,"dbg5     channel:                     %d\n",ss->message.channel);
-		fprintf(stderr,"dbg5     sequence:                    %d\n",ss->message.sequence);
-		fprintf(stderr,"dbg5     reserved:                    %d\n",ss->message.reserved);
-		fprintf(stderr,"dbg5     size:                        %d\n",ss->message.size);
-
-		fprintf(stderr,"dbg5     sequenceNumber:              %d\n",ss->sequenceNumber);
-		fprintf(stderr,"dbg5     startDepth:                  %d\n",ss->startDepth);
-		fprintf(stderr,"dbg5     pingNum:                     %d\n",ss->pingNum);
-		fprintf(stderr,"dbg5     channelNum:                  %d\n",ss->channelNum);
-		for (i=0;i<6;i++)
-			fprintf(stderr,"dbg5     unused1[%d]:                  %d\n",i,ss->unused1[i]);
-		fprintf(stderr,"dbg5     traceIDCode:                 %d\n",ss->traceIDCode);
-		for (i=0;i<2;i++)
-			fprintf(stderr,"dbg5     unused2[%d]:                  %d\n",i,ss->unused2[i]);
-		fprintf(stderr,"dbg5     dataFormat:                  %d\n",ss->dataFormat);
-		fprintf(stderr,"dbg5     NMEAantennaeR:               %d\n",ss->NMEAantennaeR);
-		fprintf(stderr,"dbg5     NMEAantennaeO:               %d\n",ss->NMEAantennaeO);
-		for (i=0;i<32;i++)
-			fprintf(stderr,"dbg5     RS232[%d]:                   %d\n",i,ss->RS232[i]);
-		fprintf(stderr,"dbg5     sourceCoordX:                %d\n",ss->sourceCoordX);
-		fprintf(stderr,"dbg5     sourceCoordY:                %d\n",ss->sourceCoordY);
-		fprintf(stderr,"dbg5     groupCoordX:                 %d\n",ss->groupCoordX);
-		fprintf(stderr,"dbg5     groupCoordY:                 %d\n",ss->groupCoordY);
-		fprintf(stderr,"dbg5     coordUnits:                  %d\n",ss->coordUnits);
-		fprintf(stderr,"dbg5     annotation:                  %s\n",ss->annotation);
-		fprintf(stderr,"dbg5     samples:                     %d\n",ss->samples);
-		fprintf(stderr,"dbg5     sampleInterval:              %d\n",ss->sampleInterval);
-		fprintf(stderr,"dbg5     ADCGain:                     %d\n",ss->ADCGain);
-		fprintf(stderr,"dbg5     pulsePower:                  %d\n",ss->pulsePower);
-		fprintf(stderr,"dbg5     correlated:                  %d\n",ss->correlated);
-		fprintf(stderr,"dbg5     startFreq:                   %d\n",ss->startFreq);
-		fprintf(stderr,"dbg5     endFreq:                     %d\n",ss->endFreq);
-		fprintf(stderr,"dbg5     sweepLength:                 %d\n",ss->sweepLength);
-		for (i=0;i<4;i++)
-			fprintf(stderr,"dbg5     unused7[%d]:                  %d\n",i,ss->unused7[i]);
-		fprintf(stderr,"dbg5     aliasFreq:                   %d\n",ss->aliasFreq);
-		fprintf(stderr,"dbg5     pulseID:                     %d\n",ss->pulseID);
-		for (i=0;i<6;i++)
-			fprintf(stderr,"dbg5     unused8[%d]:                  %d\n",i,ss->unused8[i]);
-		fprintf(stderr,"dbg5     year:                        %d\n",ss->year);
-		fprintf(stderr,"dbg5     day:                         %d\n",ss->day);
-		fprintf(stderr,"dbg5     hour:                        %d\n",ss->hour);
-		fprintf(stderr,"dbg5     minute:                      %d\n",ss->minute);
-		fprintf(stderr,"dbg5     second:                      %d\n",ss->second);
-		fprintf(stderr,"dbg5     timeBasis:                   %d\n",ss->timeBasis);
-		fprintf(stderr,"dbg5     weightingFactor:             %d\n",ss->weightingFactor);
-		fprintf(stderr,"dbg5     unused9:                     %d\n",ss->unused9);
-		fprintf(stderr,"dbg5     heading:                     %d\n",ss->heading);
-		fprintf(stderr,"dbg5     pitch:                       %d\n",ss->pitch);
-		fprintf(stderr,"dbg5     roll:                        %d\n",ss->roll);
-		fprintf(stderr,"dbg5     temperature:                 %d\n",ss->temperature);
-		fprintf(stderr,"dbg5     heaveCompensation:           %d\n",ss->heaveCompensation);
-		fprintf(stderr,"dbg5     trigSource:                  %d\n",ss->trigSource);
-		fprintf(stderr,"dbg5     markNumber:                  %d\n",ss->markNumber);
-		fprintf(stderr,"dbg5     NMEAHour:                    %d\n",ss->NMEAHour);
-		fprintf(stderr,"dbg5     NMEAMinutes:                 %d\n",ss->NMEAMinutes);
-		fprintf(stderr,"dbg5     NMEASeconds:                 %d\n",ss->NMEASeconds);
-		fprintf(stderr,"dbg5     NMEACourse:                  %d\n",ss->NMEACourse);
-		fprintf(stderr,"dbg5     NMEASpeed:                   %d\n",ss->NMEASpeed);
-		fprintf(stderr,"dbg5     NMEADay:                     %d\n",ss->NMEADay);
-		fprintf(stderr,"dbg5     NMEAYear:                    %d\n",ss->NMEAYear);
-		fprintf(stderr,"dbg5     millisecondsToday:           %d\n",ss->millisecondsToday);
-		fprintf(stderr,"dbg5     ADCMax:                      %d\n",ss->ADCMax);
-		fprintf(stderr,"dbg5     calConst:                    %d\n",ss->calConst);
-		fprintf(stderr,"dbg5     vehicleID:                   %d\n",ss->vehicleID);
-		fprintf(stderr,"dbg5     softwareVersion:             %s\n",ss->softwareVersion);
-		fprintf(stderr,"dbg5     sphericalCorrection:         %d\n",ss->sphericalCorrection);
-		fprintf(stderr,"dbg5     packetNum:                   %d\n",ss->packetNum);
-		fprintf(stderr,"dbg5     ADCDecimation:               %d\n",ss->ADCDecimation);
-		fprintf(stderr,"dbg5     decimation:                  %d\n",ss->decimation);
-		fprintf(stderr,"dbg5     unuseda:                     %d\n",ss->unuseda);
-		fprintf(stderr,"dbg5     depth:                       %d\n",ss->depth);
-		fprintf(stderr,"dbg5     sonardepth:                  %d\n",ss->sonardepth);
-		fprintf(stderr,"dbg5     sonaraltitude:               %d\n",ss->sonaraltitude);
-		if (ss->dataFormat == 1)
-			{
-			for (i=0;i<ss->samples;i++)
-				fprintf(stderr,"dbg5     Channel 0[%d]: %10d %10d\n",i,ss->trace[2*i],ss->trace[2*i+1]);
-			}
-		else
-			{
-			for (i=0;i<ss->samples;i++)
-				fprintf(stderr,"dbg5     Channel 0[%d]: %10d\n",i,ss->trace[i]);
-			}
-
-		ss = (struct mbsys_jstar_channel_struct *) &(store->ssstbd);
-		fprintf(stderr,"\ndbg5  Channel 1 (Starboard):\n");
-		fprintf(stderr,"dbg5     start_marker:                %d\n",ss->message.start_marker);
-		fprintf(stderr,"dbg5     version:                     %d\n",ss->message.version);
-		fprintf(stderr,"dbg5     session:                     %d\n",ss->message.session);
-		fprintf(stderr,"dbg5     type:                        %d\n",ss->message.type);
-		fprintf(stderr,"dbg5     command:                     %d\n",ss->message.command);
-		fprintf(stderr,"dbg5     subsystem:                   %d\n",ss->message.subsystem);
-		fprintf(stderr,"dbg5     channel:                     %d\n",ss->message.channel);
-		fprintf(stderr,"dbg5     sequence:                    %d\n",ss->message.sequence);
-		fprintf(stderr,"dbg5     reserved:                    %d\n",ss->message.reserved);
-		fprintf(stderr,"dbg5     size:                        %d\n",ss->message.size);
-
-		fprintf(stderr,"dbg5     sequenceNumber:              %d\n",ss->sequenceNumber);
-		fprintf(stderr,"dbg5     startDepth:                  %d\n",ss->startDepth);
-		fprintf(stderr,"dbg5     pingNum:                     %d\n",ss->pingNum);
-		fprintf(stderr,"dbg5     channelNum:                  %d\n",ss->channelNum);
-		for (i=0;i<6;i++)
-			fprintf(stderr,"dbg5     unused1[%d]:                  %d\n",i,ss->unused1[i]);
-		fprintf(stderr,"dbg5     traceIDCode:                 %d\n",ss->traceIDCode);
-		for (i=0;i<2;i++)
-			fprintf(stderr,"dbg5     unused2[%d]:                  %d\n",i,ss->unused2[i]);
-		fprintf(stderr,"dbg5     dataFormat:                  %d\n",ss->dataFormat);
-		fprintf(stderr,"dbg5     NMEAantennaeR:               %d\n",ss->NMEAantennaeR);
-		fprintf(stderr,"dbg5     NMEAantennaeO:               %d\n",ss->NMEAantennaeO);
-		for (i=0;i<32;i++)
-			fprintf(stderr,"dbg5     RS232[%d]:                   %d\n",i,ss->RS232[i]);
-		fprintf(stderr,"dbg5     sourceCoordX:                %d\n",ss->sourceCoordX);
-		fprintf(stderr,"dbg5     sourceCoordY:                %d\n",ss->sourceCoordY);
-		fprintf(stderr,"dbg5     groupCoordX:                 %d\n",ss->groupCoordX);
-		fprintf(stderr,"dbg5     groupCoordY:                 %d\n",ss->groupCoordY);
-		fprintf(stderr,"dbg5     coordUnits:                  %d\n",ss->coordUnits);
-		fprintf(stderr,"dbg5     annotation:                  %s\n",ss->annotation);
-		fprintf(stderr,"dbg5     samples:                     %d\n",ss->samples);
-		fprintf(stderr,"dbg5     sampleInterval:              %d\n",ss->sampleInterval);
-		fprintf(stderr,"dbg5     ADCGain:                     %d\n",ss->ADCGain);
-		fprintf(stderr,"dbg5     pulsePower:                  %d\n",ss->pulsePower);
-		fprintf(stderr,"dbg5     correlated:                  %d\n",ss->correlated);
-		fprintf(stderr,"dbg5     startFreq:                   %d\n",ss->startFreq);
-		fprintf(stderr,"dbg5     endFreq:                     %d\n",ss->endFreq);
-		fprintf(stderr,"dbg5     sweepLength:                 %d\n",ss->sweepLength);
-		for (i=0;i<4;i++)
-			fprintf(stderr,"dbg5     unused7[%d]:                  %d\n",i,ss->unused7[i]);
-		fprintf(stderr,"dbg5     aliasFreq:                   %d\n",ss->aliasFreq);
-		fprintf(stderr,"dbg5     pulseID:                     %d\n",ss->pulseID);
-		for (i=0;i<6;i++)
-			fprintf(stderr,"dbg5     unused8[%d]:                  %d\n",i,ss->unused8[i]);
-		fprintf(stderr,"dbg5     year:                        %d\n",ss->year);
-		fprintf(stderr,"dbg5     day:                         %d\n",ss->day);
-		fprintf(stderr,"dbg5     hour:                        %d\n",ss->hour);
-		fprintf(stderr,"dbg5     minute:                      %d\n",ss->minute);
-		fprintf(stderr,"dbg5     second:                      %d\n",ss->second);
-		fprintf(stderr,"dbg5     timeBasis:                   %d\n",ss->timeBasis);
-		fprintf(stderr,"dbg5     weightingFactor:             %d\n",ss->weightingFactor);
-		fprintf(stderr,"dbg5     unused9:                     %d\n",ss->unused9);
-		fprintf(stderr,"dbg5     heading:                     %d\n",ss->heading);
-		fprintf(stderr,"dbg5     pitch:                       %d\n",ss->pitch);
-		fprintf(stderr,"dbg5     roll:                        %d\n",ss->roll);
-		fprintf(stderr,"dbg5     temperature:                 %d\n",ss->temperature);
-		fprintf(stderr,"dbg5     heaveCompensation:           %d\n",ss->heaveCompensation);
-		fprintf(stderr,"dbg5     trigSource:                  %d\n",ss->trigSource);
-		fprintf(stderr,"dbg5     markNumber:                  %d\n",ss->markNumber);
-		fprintf(stderr,"dbg5     NMEAHour:                    %d\n",ss->NMEAHour);
-		fprintf(stderr,"dbg5     NMEAMinutes:                 %d\n",ss->NMEAMinutes);
-		fprintf(stderr,"dbg5     NMEASeconds:                 %d\n",ss->NMEASeconds);
-		fprintf(stderr,"dbg5     NMEACourse:                  %d\n",ss->NMEACourse);
-		fprintf(stderr,"dbg5     NMEASpeed:                   %d\n",ss->NMEASpeed);
-		fprintf(stderr,"dbg5     NMEADay:                     %d\n",ss->NMEADay);
-		fprintf(stderr,"dbg5     NMEAYear:                    %d\n",ss->NMEAYear);
-		fprintf(stderr,"dbg5     millisecondsToday:           %d\n",ss->millisecondsToday);
-		fprintf(stderr,"dbg5     ADCMax:                      %d\n",ss->ADCMax);
-		fprintf(stderr,"dbg5     calConst:                    %d\n",ss->calConst);
-		fprintf(stderr,"dbg5     vehicleID:                   %d\n",ss->vehicleID);
-		fprintf(stderr,"dbg5     softwareVersion:             %s\n",ss->softwareVersion);
-		fprintf(stderr,"dbg5     sphericalCorrection:         %d\n",ss->sphericalCorrection);
-		fprintf(stderr,"dbg5     packetNum:                   %d\n",ss->packetNum);
-		fprintf(stderr,"dbg5     ADCDecimation:               %d\n",ss->ADCDecimation);
-		fprintf(stderr,"dbg5     decimation:                  %d\n",ss->decimation);
-		fprintf(stderr,"dbg5     unuseda:                     %d\n",ss->unuseda);
-		fprintf(stderr,"dbg5     depth:                       %d\n",ss->depth);
-		fprintf(stderr,"dbg5     sonardepth:                  %d\n",ss->sonardepth);
-		fprintf(stderr,"dbg5     sonaraltitude:               %d\n",ss->sonaraltitude);
-		if (ss->dataFormat == 1)
-			{
-			for (i=0;i<ss->samples;i++)
-				fprintf(stderr,"dbg5     Channel 1[%d]: %10d %10d\n",i,ss->trace[2*i],ss->trace[2*i+1]);
-			}
-		else
-			{
-			for (i=0;i<ss->samples;i++)
-				fprintf(stderr,"dbg5     Channel 1[%d]: %10d\n",i,ss->trace[i]);
-			}
-		}
-	else if (status == MB_SUCCESS && verbose >= 5 && store->kind == MB_DATA_ATTITUDE)
-		{
-		fprintf(stderr,"\ndbg5  New roll pitch data record to be written by MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5  Subsystem ID:\n");
-		fprintf(stderr,"dbg5       subsystem:        %d ", store->subsystem);
-		if (store->subsystem == MBSYS_JSTAR_SUBSYSTEM_SSLOW)
-			fprintf(stderr,"(75 or 120 kHz sidescan)\n");
-		else if (store->subsystem == MBSYS_JSTAR_SUBSYSTEM_SSHIGH)
-			fprintf(stderr,"(410 kHz sidescan)\n");
-
-		pitchroll = (struct mbsys_jstar_pitchroll_struct *) &(store->pitchroll);
-		fprintf(stderr,"\ndbg5  Roll and Pitch:\n");
-		fprintf(stderr,"dbg5     start_marker:                %d\n",pitchroll->message.start_marker);
-		fprintf(stderr,"dbg5     version:                     %d\n",pitchroll->message.version);
-		fprintf(stderr,"dbg5     session:                     %d\n",pitchroll->message.session);
-		fprintf(stderr,"dbg5     type:                        %d\n",pitchroll->message.type);
-		fprintf(stderr,"dbg5     command:                     %d\n",pitchroll->message.command);
-		fprintf(stderr,"dbg5     subsystem:                   %d\n",pitchroll->message.subsystem);
-		fprintf(stderr,"dbg5     channel:                     %d\n",pitchroll->message.channel);
-		fprintf(stderr,"dbg5     sequence:                    %d\n",pitchroll->message.sequence);
-		fprintf(stderr,"dbg5     reserved:                    %d\n",pitchroll->message.reserved);
-		fprintf(stderr,"dbg5     size:                        %d\n",pitchroll->message.size);
-
-		fprintf(stderr,"dbg5     seconds:                     %d\n",pitchroll->seconds);
-		fprintf(stderr,"dbg5     msec:                        %d\n",pitchroll->msec);
-		fprintf(stderr,"dbg5     reserve1[0]:                 %d\n",pitchroll->reserve1[0]);
-		fprintf(stderr,"dbg5     reserve1[1]:                 %d\n",pitchroll->reserve1[1]);
-		fprintf(stderr,"dbg5     reserve1[2]:                 %d\n",pitchroll->reserve1[2]);
-		fprintf(stderr,"dbg5     reserve1[3]:                 %d\n",pitchroll->reserve1[3]);
-		fprintf(stderr,"dbg5     accelerationx:               %d\n",pitchroll->accelerationx);
-		fprintf(stderr,"dbg5     accelerationy:               %d\n",pitchroll->accelerationy);
-		fprintf(stderr,"dbg5     accelerationz:               %d\n",pitchroll->accelerationz);
-		fprintf(stderr,"dbg5     gyroratex:                   %d\n",pitchroll->gyroratex);
-		fprintf(stderr,"dbg5     gyroratey:                   %d\n",pitchroll->gyroratey);
-		fprintf(stderr,"dbg5     gyroratez:                   %d\n",pitchroll->gyroratez);
-		fprintf(stderr,"dbg5     pitch:                       %d\n",pitchroll->pitch);
-		fprintf(stderr,"dbg5     roll:                        %d\n",pitchroll->roll);
-		fprintf(stderr,"dbg5     temperature:                 %d\n",pitchroll->temperature);
-		fprintf(stderr,"dbg5     deviceinfo:                  %d\n",pitchroll->deviceinfo);
-		fprintf(stderr,"dbg5     heave:                       %d\n",pitchroll->heave);
-		fprintf(stderr,"dbg5     heading:                     %d\n",pitchroll->heading);
-		fprintf(stderr,"dbg5     datavalidflags:              %d\n",pitchroll->datavalidflags);
-		fprintf(stderr,"dbg5     reserve2:                    %d\n",pitchroll->reserve2);
-		}
-	else if (status == MB_SUCCESS && verbose >= 5 && store->kind == MB_DATA_DVL)
-		{
-		fprintf(stderr,"\ndbg5  New dvl data record to be written by MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5  Subsystem ID:\n");
-		fprintf(stderr,"dbg5       subsystem:        %d ", store->subsystem);
-		if (store->subsystem == MBSYS_JSTAR_SUBSYSTEM_SSLOW)
-			fprintf(stderr,"(75 or 120 kHz sidescan)\n");
-		else if (store->subsystem == MBSYS_JSTAR_SUBSYSTEM_SSHIGH)
-			fprintf(stderr,"(410 kHz sidescan)\n");
-
-		dvl = (struct mbsys_jstar_dvl_struct *) &(store->dvl);
-		fprintf(stderr,"\ndbg5  Roll and Pitch:\n");
-		fprintf(stderr,"dbg5     start_marker:                %d\n",dvl->message.start_marker);
-		fprintf(stderr,"dbg5     version:                     %d\n",dvl->message.version);
-		fprintf(stderr,"dbg5     session:                     %d\n",dvl->message.session);
-		fprintf(stderr,"dbg5     type:                        %d\n",dvl->message.type);
-		fprintf(stderr,"dbg5     command:                     %d\n",dvl->message.command);
-		fprintf(stderr,"dbg5     subsystem:                   %d\n",dvl->message.subsystem);
-		fprintf(stderr,"dbg5     channel:                     %d\n",dvl->message.channel);
-		fprintf(stderr,"dbg5     sequence:                    %d\n",dvl->message.sequence);
-		fprintf(stderr,"dbg5     reserved:                    %d\n",dvl->message.reserved);
-		fprintf(stderr,"dbg5     size:                        %d\n",dvl->message.size);
-
-		fprintf(stderr,"dbg5     seconds:                     %d\n",dvl->seconds);
-		fprintf(stderr,"dbg5     msec:                        %d\n",dvl->msec);
-		fprintf(stderr,"dbg5     reserve1[0]:                 %d\n",dvl->reserve1[0]);
-		fprintf(stderr,"dbg5     reserve1[1]:                 %d\n",dvl->reserve1[1]);
-		fprintf(stderr,"dbg5     reserve1[2]:                 %d\n",dvl->reserve1[2]);
-		fprintf(stderr,"dbg5     reserve1[3]:                 %d\n",dvl->reserve1[3]);
-		fprintf(stderr,"dbg5     datavalidflags:              %d\n",dvl->datavalidflags);
-		fprintf(stderr,"dbg5     beam1range:                  %d\n",dvl->beam1range);
-		fprintf(stderr,"dbg5     beam2range:                  %d\n",dvl->beam2range);
-		fprintf(stderr,"dbg5     beam3range:                  %d\n",dvl->beam3range);
-		fprintf(stderr,"dbg5     beam4range:                  %d\n",dvl->beam4range);
-		fprintf(stderr,"dbg5     velocitybottomx:             %d\n",dvl->velocitybottomx);
-		fprintf(stderr,"dbg5     velocitybottomy:             %d\n",dvl->velocitybottomy);
-		fprintf(stderr,"dbg5     velocitybottomz:             %d\n",dvl->velocitybottomz);
-		fprintf(stderr,"dbg5     velocitywaterx:              %d\n",dvl->velocitywaterx);
-		fprintf(stderr,"dbg5     velocitywatery:              %d\n",dvl->velocitywatery);
-		fprintf(stderr,"dbg5     velocitywaterz:              %d\n",dvl->velocitywaterz);
-		fprintf(stderr,"dbg5     depth:                       %d\n",dvl->depth);
-		fprintf(stderr,"dbg5     pitch:                       %d\n",dvl->pitch);
-		fprintf(stderr,"dbg5     roll:                        %d\n",dvl->roll);
-		fprintf(stderr,"dbg5     heading:                     %d\n",dvl->heading);
-		fprintf(stderr,"dbg5     salinity:                    %d\n",dvl->salinity);
-		fprintf(stderr,"dbg5     temperature:                 %d\n",dvl->temperature);
-		fprintf(stderr,"dbg5     soundspeed:                  %d\n",dvl->soundspeed);
-		for (i=0;i<7;i++)
-			fprintf(stderr,"dbg5     reserve2[%d]:                %d\n",i,dvl->reserve2[i]);
-		}
-	else if (status == MB_SUCCESS && verbose >= 5 && store->kind == MB_DATA_CTD)
-		{
-		pressure = (struct mbsys_jstar_pressure_struct *) &(store->pressure);
-		fprintf(stderr,"\ndbg5  New pressure data record to be written by MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5     start_marker:                %d\n",pressure->message.start_marker);
-		fprintf(stderr,"dbg5     version:                     %d\n",pressure->message.version);
-		fprintf(stderr,"dbg5     session:                     %d\n",pressure->message.session);
-		fprintf(stderr,"dbg5     type:                        %d\n",pressure->message.type);
-		fprintf(stderr,"dbg5     command:                     %d\n",pressure->message.command);
-		fprintf(stderr,"dbg5     subsystem:                   %d\n",pressure->message.subsystem);
-		fprintf(stderr,"dbg5     channel:                     %d\n",pressure->message.channel);
-		fprintf(stderr,"dbg5     sequence:                    %d\n",pressure->message.sequence);
-		fprintf(stderr,"dbg5     reserved:                    %d\n",pressure->message.reserved);
-		fprintf(stderr,"dbg5     size:                        %d\n",pressure->message.size);
-
-		fprintf(stderr,"dbg5     seconds:                     %d\n",pressure->seconds);
-		fprintf(stderr,"dbg5     msec:                        %d\n",pressure->msec);
-		fprintf(stderr,"dbg5     reserve1[0]:                 %d\n",pressure->reserve1[0]);
-		fprintf(stderr,"dbg5     reserve1[1]:                 %d\n",pressure->reserve1[1]);
-		fprintf(stderr,"dbg5     reserve1[2]:                 %d\n",pressure->reserve1[2]);
-		fprintf(stderr,"dbg5     reserve1[3]:                 %d\n",pressure->reserve1[3]);
-		fprintf(stderr,"dbg5     pressure:                    %d\n",pressure->pressure);
-		fprintf(stderr,"dbg5     salinity:                    %d\n",pressure->salinity);
-		fprintf(stderr,"dbg5     datavalidflags:              %d\n",pressure->datavalidflags);
-		fprintf(stderr,"dbg5     conductivity:                %d\n",pressure->conductivity);
-		fprintf(stderr,"dbg5     soundspeed:                  %d\n",pressure->soundspeed);
-		for(i=0;i<10;i++)
-			fprintf(stderr,"dbg5     reserve2[%2d]:                 %d\n",i,pressure->reserve2[i]);
-		}
-	else if (status == MB_SUCCESS && verbose >= 5 &&
-		(store->kind == MB_DATA_NMEA_RMC || store->kind == MB_DATA_NMEA_DBT || store->kind == MB_DATA_NMEA_DPT))
-		{
-		nmea = (struct mbsys_jstar_nmea_struct *) &(store->nmea);
-		fprintf(stderr,"\ndbg5  New NMEA data record to be written by MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5     start_marker:                %d\n",nmea->message.start_marker);
-		fprintf(stderr,"dbg5     version:                     %d\n",nmea->message.version);
-		fprintf(stderr,"dbg5     session:                     %d\n",nmea->message.session);
-		fprintf(stderr,"dbg5     type:                        %d\n",nmea->message.type);
-		fprintf(stderr,"dbg5     command:                     %d\n",nmea->message.command);
-		fprintf(stderr,"dbg5     subsystem:                   %d\n",nmea->message.subsystem);
-		fprintf(stderr,"dbg5     channel:                     %d\n",nmea->message.channel);
-		fprintf(stderr,"dbg5     sequence:                    %d\n",nmea->message.sequence);
-		fprintf(stderr,"dbg5     reserved:                    %d\n",nmea->message.reserved);
-		fprintf(stderr,"dbg5     size:                        %d\n",nmea->message.size);
-
-		fprintf(stderr,"dbg5     seconds:                     %d\n",nmea->seconds);
-		fprintf(stderr,"dbg5     msec:                        %d\n",nmea->msec);
-		fprintf(stderr,"dbg5     source:                      %d\n",nmea->source);
-		fprintf(stderr,"dbg5     reserve[0]:                  %d\n",nmea->reserve[0]);
-		fprintf(stderr,"dbg5     reserve[1]:                  %d\n",nmea->reserve[1]);
-		fprintf(stderr,"dbg5     reserve[2]:                  %d\n",nmea->reserve[2]);
-		fprintf(stderr,"dbg5     nmea:                        %s\n",nmea->nmea);
-		}
-	else if (status == MB_SUCCESS && verbose >= 5 &&
-		(store->kind == MB_DATA_HEADER))
-		{
-		sysinfo = (struct mbsys_jstar_sysinfo_struct *) &(store->sysinfo);
-		fprintf(stderr,"\ndbg5  New sysinfo data record to be written by MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5     start_marker:                %d\n",sysinfo->message.start_marker);
-		fprintf(stderr,"dbg5     version:                     %d\n",sysinfo->message.version);
-		fprintf(stderr,"dbg5     session:                     %d\n",sysinfo->message.session);
-		fprintf(stderr,"dbg5     type:                        %d\n",sysinfo->message.type);
-		fprintf(stderr,"dbg5     command:                     %d\n",sysinfo->message.command);
-		fprintf(stderr,"dbg5     subsystem:                   %d\n",sysinfo->message.subsystem);
-		fprintf(stderr,"dbg5     channel:                     %d\n",sysinfo->message.channel);
-		fprintf(stderr,"dbg5     sequence:                    %d\n",sysinfo->message.sequence);
-		fprintf(stderr,"dbg5     reserved:                    %d\n",sysinfo->message.reserved);
-		fprintf(stderr,"dbg5     size:                        %d\n",sysinfo->message.size);
-
-		fprintf(stderr,"dbg5     system_type:                 %d\n",sysinfo->system_type);
-		fprintf(stderr,"dbg5     reserved1:                   %d\n",sysinfo->reserved1);
-		fprintf(stderr,"dbg5     version:                     %d\n",sysinfo->version);
-		fprintf(stderr,"dbg5     reserved2:                   %d\n",sysinfo->reserved2);
-		fprintf(stderr,"dbg5     platformserialnumber:        %d\n",sysinfo->platformserialnumber);
-		fprintf(stderr,"dbg5     sysinfosize:                 %d\n",sysinfo->sysinfosize);
-		fprintf(stderr,"dbg5     sysinfo:                     \n%s\n",sysinfo->sysinfo);
-		}
-
-	/* write out comment */
-	if (store->kind == MB_DATA_COMMENT)
-		{
-		/* insert the message header values */
-		index = 0;
-		comment = (struct mbsys_jstar_comment_struct *) &(store->comment);
-		comment->message.start_marker = 0x1601;
-		comment->message.version = 0;
-		comment->message.session = 0;
-		comment->message.type = MBSYS_JSTAR_DATA_COMMENT;
-		comment->message.subsystem = 0;
-		comment->message.channel = 0;
-		comment->message.sequence = 0;
-		comment->message.reserved = 0;
-		comment->message.size = strlen(comment->comment) + 1;
-		mb_put_binary_short(MB_YES, comment->message.start_marker, &buffer[index]); index += 2;
-		buffer[index] = comment->message.version; index++;
-		buffer[index] = comment->message.session; index++;
-		mb_put_binary_short(MB_YES, comment->message.type, &buffer[index]); index += 2;
-		buffer[index] = comment->message.command; index++;
-		buffer[index] = comment->message.subsystem; index++;
-		buffer[index] = comment->message.channel; index++;
-		buffer[index] = comment->message.sequence; index++;
-		mb_put_binary_short(MB_YES, comment->message.reserved, &buffer[index]); index += 2;
-		mb_put_binary_int(MB_YES, comment->message.size, &buffer[index]); index += 4;
-
-		/* write the message header */
-		if ((write_len = fwrite(buffer,1,MBSYS_JSTAR_MESSAGE_SIZE,mb_io_ptr->mbfp))
-			!= MBSYS_JSTAR_MESSAGE_SIZE)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-
-		/* write the comment */
-		if ((write_len = fwrite(comment->comment,1,comment->message.size,mb_io_ptr->mbfp))
-			!= comment->message.size)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		}
-
-	/* write out subbottom data */
-	else if (store->kind == MB_DATA_SUBBOTTOM_SUBBOTTOM)
-		{
-		/* get the sbp structure */
-		sbp = (struct mbsys_jstar_channel_struct *) &(store->sbp);
-
-		/* insert the message header values */
-		index = 0;
-		if (sbp->dataFormat == 1)
-			shortspersample = 2;
-		else
-			shortspersample = 1;
-		sbp->message.size = shortspersample * sbp->samples * sizeof(short) + MBSYS_JSTAR_SBPHEADER_SIZE;
-		mb_put_binary_short(MB_YES, sbp->message.start_marker, &buffer[index]); index += 2;
-		buffer[index] = sbp->message.version; index++;
-		buffer[index] = sbp->message.session; index++;
-		mb_put_binary_short(MB_YES, sbp->message.type, &buffer[index]); index += 2;
-		buffer[index] = sbp->message.command; index++;
-		buffer[index] = sbp->message.subsystem; index++;
-		buffer[index] = sbp->message.channel; index++;
-		buffer[index] = sbp->message.sequence; index++;
-		mb_put_binary_short(MB_YES, sbp->message.reserved, &buffer[index]); index += 2;
-		mb_put_binary_int(MB_YES, sbp->message.size, &buffer[index]); index += 4;
-
-		/* write the messsage header */
-		if ((write_len = fwrite(buffer,1,MBSYS_JSTAR_MESSAGE_SIZE,mb_io_ptr->mbfp))
-			!= MBSYS_JSTAR_MESSAGE_SIZE)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-
-		/* insert the trace header values */
-		index = 0;
-		mb_put_binary_int(MB_YES, sbp->sequenceNumber, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, sbp->startDepth, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, sbp->pingNum, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, sbp->channelNum, &buffer[index]); index += 4;
-		for (i=0;i<6;i++)
-			{
-			mb_put_binary_short(MB_YES, sbp->unused1[i], &buffer[index]); index += 2;
-			}
-		mb_put_binary_short(MB_YES, sbp->traceIDCode, &buffer[index]); index += 2;
-		for (i=0;i<2;i++)
-			{
-			mb_put_binary_short(MB_YES, sbp->unused2[i], &buffer[index]); index += 2;
-			}
-		mb_put_binary_short(MB_YES, sbp->dataFormat, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, sbp->NMEAantennaeR, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, sbp->NMEAantennaeO, &buffer[index]); index += 2;
-		for (i=0;i<32;i++)
-			{
-			buffer[index] = sbp->RS232[i]; index++;
-			}
-		mb_put_binary_int(MB_YES, sbp->sourceCoordX, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, sbp->sourceCoordY, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, sbp->groupCoordX, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, sbp->groupCoordY, &buffer[index]); index += 4;
-		mb_put_binary_short(MB_YES, sbp->coordUnits, &buffer[index]); index += 2;
-		for (i=0;i<24;i++)
-			{
-			buffer[index] = sbp->annotation[i]; index++;
-			}
- 		mb_put_binary_short(MB_YES, sbp->samples, &buffer[index]); index += 2;
-		mb_put_binary_int(MB_YES, sbp->sampleInterval, &buffer[index]); index += 4;
- 		mb_put_binary_short(MB_YES, sbp->ADCGain, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, sbp->pulsePower, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, sbp->correlated, &buffer[index]); index += 2;
- 		mb_put_binary_short(MB_YES, sbp->startFreq, &buffer[index]); index += 2;
- 		mb_put_binary_short(MB_YES, sbp->endFreq, &buffer[index]); index += 2;
- 		mb_put_binary_short(MB_YES, sbp->sweepLength, &buffer[index]); index += 2;
-		for (i=0;i<4;i++)
-			{
-			mb_put_binary_short(MB_YES, sbp->unused7[i], &buffer[index]); index += 2;
-			}
- 		mb_put_binary_short(MB_YES, sbp->aliasFreq, &buffer[index]); index += 2;
- 		mb_put_binary_short(MB_YES, sbp->pulseID, &buffer[index]); index += 2;
-		for (i=0;i<6;i++)
-			{
-			mb_put_binary_short(MB_YES, sbp->unused8[i], &buffer[index]); index += 2;
-			}
-		mb_put_binary_short(MB_YES, sbp->year, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, sbp->day, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, sbp->hour, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, sbp->minute, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, sbp->second, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, sbp->timeBasis, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, sbp->weightingFactor, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, sbp->unused9, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, sbp->heading, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, sbp->pitch, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, sbp->roll, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, sbp->temperature, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, sbp->heaveCompensation, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, sbp->trigSource, &buffer[index]); index += 2;
- 		mb_put_binary_short(MB_YES, sbp->markNumber, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, sbp->NMEAHour, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, sbp->NMEAMinutes, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, sbp->NMEASeconds, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, sbp->NMEACourse, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, sbp->NMEASpeed, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, sbp->NMEADay, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, sbp->NMEAYear, &buffer[index]); index += 2;
-		mb_put_binary_int(MB_YES, sbp->millisecondsToday, &buffer[index]); index += 4;
- 		mb_put_binary_short(MB_YES, sbp->ADCMax, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, sbp->calConst, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, sbp->vehicleID, &buffer[index]); index += 2;
-		for (i=0;i<6;i++)
-			{
-			buffer[index] = sbp->softwareVersion[i]; index++;
-			}
-		mb_put_binary_int(MB_YES, sbp->sphericalCorrection, &buffer[index]); index += 4;
- 		mb_put_binary_short(MB_YES, sbp->packetNum, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, sbp->ADCDecimation, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, sbp->decimation, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, sbp->unuseda, &buffer[index]); index += 2;
-		mb_put_binary_int(MB_YES, sbp->depth, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, sbp->sonardepth, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, sbp->sonaraltitude, &buffer[index]); index += 4;
-
-		/* write the trace header */
-		if ((write_len = fwrite(buffer,1,MBSYS_JSTAR_SBPHEADER_SIZE,mb_io_ptr->mbfp))
-			!= MBSYS_JSTAR_SBPHEADER_SIZE)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-
-		/* byteswap the trace if necessary */
-#ifndef BYTESWAPPED
-		if (sbp->dataFormat == 1)
-			shortspersample = 2;
-		else
-			shortspersample = 1;
-		for (i=0;i<shortspersample * sbp->samples;i++)
-			{
-			sbp->trace[i] = mb_swap_short(sbp->trace[i]);;
-			}
-#endif
-
-		/* write the trace */
-		trace_size = shortspersample * sbp->samples * sizeof(short);
-		if ((write_len = fwrite(sbp->trace,1,trace_size,mb_io_ptr->mbfp))
-			!= trace_size)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		}
-
-	/* write out sidescan data */
-	else if (store->kind == MB_DATA_DATA || store->kind == MB_DATA_SIDESCAN2)
-		{
-		/* get the port ss structure */
-		ss = (struct mbsys_jstar_channel_struct *) &(store->ssport);
-
-		/* insert the message header values */
-		index = 0;
-		if (ss->dataFormat == 1)
-			shortspersample = 2;
-		else
-			shortspersample = 1;
-		ss->message.size = shortspersample * ss->samples * sizeof(short) + MBSYS_JSTAR_SSHEADER_SIZE;
-		mb_put_binary_short(MB_YES, ss->message.start_marker, &buffer[index]); index += 2;
-		buffer[index] = ss->message.version; index++;
-		buffer[index] = ss->message.session; index++;
-		mb_put_binary_short(MB_YES, ss->message.type, &buffer[index]); index += 2;
-		buffer[index] = ss->message.command; index++;
-		buffer[index] = ss->message.subsystem; index++;
-		buffer[index] = ss->message.channel; index++;
-		buffer[index] = ss->message.sequence; index++;
-		mb_put_binary_short(MB_YES, ss->message.reserved, &buffer[index]); index += 2;
-		mb_put_binary_int(MB_YES, ss->message.size, &buffer[index]); index += 4;
-
-		/* write the messsage header */
-		if ((write_len = fwrite(buffer,1,MBSYS_JSTAR_MESSAGE_SIZE,mb_io_ptr->mbfp))
-			!= MBSYS_JSTAR_MESSAGE_SIZE)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-
-		/* insert the trace header values */
-		index = 0;
-		mb_put_binary_int(MB_YES, ss->sequenceNumber, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, ss->startDepth, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, ss->pingNum, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, ss->channelNum, &buffer[index]); index += 4;
-		for (i=0;i<6;i++)
-			{
-			mb_put_binary_short(MB_YES, ss->unused1[i], &buffer[index]); index += 2;
-			}
-		mb_put_binary_short(MB_YES, ss->traceIDCode, &buffer[index]); index += 2;
-		for (i=0;i<2;i++)
-			{
-			mb_put_binary_short(MB_YES, ss->unused2[i], &buffer[index]); index += 2;
-			}
-		mb_put_binary_short(MB_YES, ss->dataFormat, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, ss->NMEAantennaeR, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, ss->NMEAantennaeO, &buffer[index]); index += 2;
-		for (i=0;i<32;i++)
-			{
-			buffer[index] = ss->RS232[i]; index++;
-			}
-		mb_put_binary_int(MB_YES, ss->sourceCoordX, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, ss->sourceCoordY, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, ss->groupCoordX, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, ss->groupCoordY, &buffer[index]); index += 4;
-		mb_put_binary_short(MB_YES, ss->coordUnits, &buffer[index]); index += 2;
-		for (i=0;i<24;i++)
-			{
-			buffer[index] = ss->annotation[i]; index++;
-			}
- 		mb_put_binary_short(MB_YES, ss->samples, &buffer[index]); index += 2;
-		mb_put_binary_int(MB_YES, ss->sampleInterval, &buffer[index]); index += 4;
- 		mb_put_binary_short(MB_YES, ss->ADCGain, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, ss->pulsePower, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, ss->correlated, &buffer[index]); index += 2;
- 		mb_put_binary_short(MB_YES, ss->startFreq, &buffer[index]); index += 2;
- 		mb_put_binary_short(MB_YES, ss->endFreq, &buffer[index]); index += 2;
- 		mb_put_binary_short(MB_YES, ss->sweepLength, &buffer[index]); index += 2;
-		for (i=0;i<4;i++)
-			{
-			mb_put_binary_short(MB_YES, ss->unused7[i], &buffer[index]); index += 2;
-			}
- 		mb_put_binary_short(MB_YES, ss->aliasFreq, &buffer[index]); index += 2;
- 		mb_put_binary_short(MB_YES, ss->pulseID, &buffer[index]); index += 2;
-		for (i=0;i<6;i++)
-			{
-			mb_put_binary_short(MB_YES, ss->unused8[i], &buffer[index]); index += 2;
-			}
-		mb_put_binary_short(MB_YES, ss->year, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, ss->day, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, ss->hour, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, ss->minute, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, ss->second, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, ss->timeBasis, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, ss->weightingFactor, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, ss->unused9, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, ss->heading, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, ss->pitch, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, ss->roll, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, ss->temperature, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, ss->heaveCompensation, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, ss->trigSource, &buffer[index]); index += 2;
- 		mb_put_binary_short(MB_YES, ss->markNumber, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, ss->NMEAHour, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, ss->NMEAMinutes, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, ss->NMEASeconds, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, ss->NMEACourse, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, ss->NMEASpeed, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, ss->NMEADay, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, ss->NMEAYear, &buffer[index]); index += 2;
-		mb_put_binary_int(MB_YES, ss->millisecondsToday, &buffer[index]); index += 4;
- 		mb_put_binary_short(MB_YES, ss->ADCMax, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, ss->calConst, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, ss->vehicleID, &buffer[index]); index += 2;
-		for (i=0;i<6;i++)
-			{
-			buffer[index] = ss->softwareVersion[i]; index++;
-			}
-		mb_put_binary_int(MB_YES, ss->sphericalCorrection, &buffer[index]); index += 4;
- 		mb_put_binary_short(MB_YES, ss->packetNum, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, ss->ADCDecimation, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, ss->decimation, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, ss->unuseda, &buffer[index]); index += 2;
-		mb_put_binary_int(MB_YES, ss->depth, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, ss->sonardepth, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, ss->sonaraltitude, &buffer[index]); index += 4;
-
-		/* write the trace header */
-		if ((write_len = fwrite(buffer,1,MBSYS_JSTAR_SSHEADER_SIZE,mb_io_ptr->mbfp))
-			!= MBSYS_JSTAR_SSHEADER_SIZE)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-
-		/* byteswap the trace if necessary */
-#ifndef BYTESWAPPED
-		if (ss->dataFormat == 1)
-			shortspersample = 2;
-		else
-			shortspersample = 1;
-		for (i=0;i<shortspersample * ss->samples;i++)
-			{
-			ss->trace[i] = mb_swap_short(ss->trace[i]);;
-			}
-#endif
-
-		/* write the trace */
-		trace_size = shortspersample * ss->samples * sizeof(short);
-		if ((write_len = fwrite(ss->trace,1,trace_size,mb_io_ptr->mbfp))
-			!= trace_size)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-
-		/* get the starboard ss structure */
-		ss = (struct mbsys_jstar_channel_struct *) &(store->ssstbd);
-
-		/* insert the message header values */
-		index = 0;
-		if (ss->dataFormat == 1)
-			shortspersample = 2;
-		else
-			shortspersample = 1;
-		ss->message.size = shortspersample * ss->samples * sizeof(short) + MBSYS_JSTAR_SSHEADER_SIZE;
-		mb_put_binary_short(MB_YES, ss->message.start_marker, &buffer[index]); index += 2;
-		buffer[index] = ss->message.version; index++;
-		buffer[index] = ss->message.session; index++;
-		mb_put_binary_short(MB_YES, ss->message.type, &buffer[index]); index += 2;
-		buffer[index] = ss->message.command; index++;
-		buffer[index] = ss->message.subsystem; index++;
-		buffer[index] = ss->message.channel; index++;
-		buffer[index] = ss->message.sequence; index++;
-		mb_put_binary_short(MB_YES, ss->message.reserved, &buffer[index]); index += 2;
-		mb_put_binary_int(MB_YES, ss->message.size, &buffer[index]); index += 4;
-
-		/* write the messsage header */
-		if ((write_len = fwrite(buffer,1,MBSYS_JSTAR_MESSAGE_SIZE,mb_io_ptr->mbfp))
-			!= MBSYS_JSTAR_MESSAGE_SIZE)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-
-		/* insert the trace header values */
-		index = 0;
-		mb_put_binary_int(MB_YES, ss->sequenceNumber, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, ss->startDepth, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, ss->pingNum, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, ss->channelNum, &buffer[index]); index += 4;
-		for (i=0;i<6;i++)
-			{
-			mb_put_binary_short(MB_YES, ss->unused1[i], &buffer[index]); index += 2;
-			}
-		mb_put_binary_short(MB_YES, ss->traceIDCode, &buffer[index]); index += 2;
-		for (i=0;i<2;i++)
-			{
-			mb_put_binary_short(MB_YES, ss->unused2[i], &buffer[index]); index += 2;
-			}
-		mb_put_binary_short(MB_YES, ss->dataFormat, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, ss->NMEAantennaeR, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, ss->NMEAantennaeO, &buffer[index]); index += 2;
-		for (i=0;i<32;i++)
-			{
-			buffer[index] = ss->RS232[i]; index++;
-			}
-		mb_put_binary_int(MB_YES, ss->sourceCoordX, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, ss->sourceCoordY, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, ss->groupCoordX, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, ss->groupCoordY, &buffer[index]); index += 4;
-		mb_put_binary_short(MB_YES, ss->coordUnits, &buffer[index]); index += 2;
-		for (i=0;i<24;i++)
-			{
-			buffer[index] = ss->annotation[i]; index++;
-			}
- 		mb_put_binary_short(MB_YES, ss->samples, &buffer[index]); index += 2;
-		mb_put_binary_int(MB_YES, ss->sampleInterval, &buffer[index]); index += 4;
- 		mb_put_binary_short(MB_YES, ss->ADCGain, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, ss->pulsePower, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, ss->correlated, &buffer[index]); index += 2;
- 		mb_put_binary_short(MB_YES, ss->startFreq, &buffer[index]); index += 2;
- 		mb_put_binary_short(MB_YES, ss->endFreq, &buffer[index]); index += 2;
- 		mb_put_binary_short(MB_YES, ss->sweepLength, &buffer[index]); index += 2;
-		for (i=0;i<4;i++)
-			{
-			mb_put_binary_short(MB_YES, ss->unused7[i], &buffer[index]); index += 2;
-			}
- 		mb_put_binary_short(MB_YES, ss->aliasFreq, &buffer[index]); index += 2;
- 		mb_put_binary_short(MB_YES, ss->pulseID, &buffer[index]); index += 2;
-		for (i=0;i<6;i++)
-			{
-			mb_put_binary_short(MB_YES, ss->unused8[i], &buffer[index]); index += 2;
-			}
-		mb_put_binary_short(MB_YES, ss->year, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, ss->day, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, ss->hour, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, ss->minute, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, ss->second, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, ss->timeBasis, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, ss->weightingFactor, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, ss->unused9, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, ss->heading, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, ss->pitch, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, ss->roll, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, ss->temperature, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, ss->heaveCompensation, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, ss->trigSource, &buffer[index]); index += 2;
- 		mb_put_binary_short(MB_YES, ss->markNumber, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, ss->NMEAHour, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, ss->NMEAMinutes, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, ss->NMEASeconds, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, ss->NMEACourse, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, ss->NMEASpeed, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, ss->NMEADay, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, ss->NMEAYear, &buffer[index]); index += 2;
-		mb_put_binary_int(MB_YES, ss->millisecondsToday, &buffer[index]); index += 4;
- 		mb_put_binary_short(MB_YES, ss->ADCMax, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, ss->calConst, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, ss->vehicleID, &buffer[index]); index += 2;
-		for (i=0;i<6;i++)
-			{
-			buffer[index] = ss->softwareVersion[i]; index++;
-			}
-		mb_put_binary_int(MB_YES, ss->sphericalCorrection, &buffer[index]); index += 4;
- 		mb_put_binary_short(MB_YES, ss->packetNum, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, ss->ADCDecimation, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, ss->decimation, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, ss->unuseda, &buffer[index]); index += 2;
-		mb_put_binary_int(MB_YES, ss->depth, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, ss->sonardepth, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, ss->sonaraltitude, &buffer[index]); index += 4;
-
-		/* write the trace header */
-		if ((write_len = fwrite(buffer,1,MBSYS_JSTAR_SSHEADER_SIZE,mb_io_ptr->mbfp))
-			!= MBSYS_JSTAR_SSHEADER_SIZE)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-
-		/* byteswap the trace if necessary */
-#ifndef BYTESWAPPED
-		if (ss->dataFormat == 1)
-			shortspersample = 2;
-		else
-			shortspersample = 1;
-		for (i=0;i<shortspersample * ss->samples;i++)
-			{
-			ss->trace[i] = mb_swap_short(ss->trace[i]);;
-			}
-#endif
-
-		/* write the trace */
-		trace_size = shortspersample * ss->samples * sizeof(short);
-		if ((write_len = fwrite(ss->trace,1,trace_size,mb_io_ptr->mbfp))
-			!= trace_size)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		}
-
-	/* write out pitch roll data */
-	else if (store->kind == MB_DATA_ATTITUDE)
-		{
-		/* insert the message header values */
-		index = 0;
-		pitchroll = (struct mbsys_jstar_pitchroll_struct *) &(store->pitchroll);
-		mb_put_binary_short(MB_YES, pitchroll->message.start_marker, &buffer[index]); index += 2;
-		buffer[index] = pitchroll->message.version; index++;
-		buffer[index] = pitchroll->message.session; index++;
-		mb_put_binary_short(MB_YES, pitchroll->message.type, &buffer[index]); index += 2;
-		buffer[index] = pitchroll->message.command; index++;
-		buffer[index] = pitchroll->message.subsystem; index++;
-		buffer[index] = pitchroll->message.channel; index++;
-		buffer[index] = pitchroll->message.sequence; index++;
-		mb_put_binary_short(MB_YES, pitchroll->message.reserved, &buffer[index]); index += 2;
-		mb_put_binary_int(MB_YES, pitchroll->message.size, &buffer[index]); index += 4;
-
-		/* write the message header */
-		if ((write_len = fwrite(buffer,1,MBSYS_JSTAR_MESSAGE_SIZE,mb_io_ptr->mbfp))
-			!= MBSYS_JSTAR_MESSAGE_SIZE)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-
-		index = 0;
-		mb_put_binary_int(MB_YES, pitchroll->seconds, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, pitchroll->msec, &buffer[index]); index += 4;
-		buffer[index] = pitchroll->reserve1[0]; index++;
-		buffer[index] = pitchroll->reserve1[1]; index++;
-		buffer[index] = pitchroll->reserve1[2]; index++;
-		buffer[index] = pitchroll->reserve1[3]; index++;
-		mb_put_binary_short(MB_YES, pitchroll->accelerationx, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, pitchroll->accelerationy, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, pitchroll->accelerationz, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, pitchroll->gyroratex, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, pitchroll->gyroratey, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, pitchroll->gyroratez, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, pitchroll->pitch, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, pitchroll->roll, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, pitchroll->temperature, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, pitchroll->deviceinfo, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, pitchroll->heave, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, pitchroll->heading, &buffer[index]); index += 2;
-		mb_put_binary_int(MB_YES, pitchroll->datavalidflags, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, pitchroll->reserve2, &buffer[index]); index += 4;
-
-		/* write the pitchroll data */
-		if ((write_len = fwrite(buffer,1,pitchroll->message.size,mb_io_ptr->mbfp))
-			!= pitchroll->message.size)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		}
-
-	/* write out dvl data */
-	else if (store->kind == MB_DATA_DVL)
-		{
-		/* insert the message header values */
-		index = 0;
-		dvl = (struct mbsys_jstar_dvl_struct *) &(store->dvl);
-		mb_put_binary_short(MB_YES, dvl->message.start_marker, &buffer[index]); index += 2;
-		buffer[index] = dvl->message.version; index++;
-		buffer[index] = dvl->message.session; index++;
-		mb_put_binary_short(MB_YES, dvl->message.type, &buffer[index]); index += 2;
-		buffer[index] = dvl->message.command; index++;
-		buffer[index] = dvl->message.subsystem; index++;
-		buffer[index] = dvl->message.channel; index++;
-		buffer[index] = dvl->message.sequence; index++;
-		mb_put_binary_short(MB_YES, dvl->message.reserved, &buffer[index]); index += 2;
-		mb_put_binary_int(MB_YES, dvl->message.size, &buffer[index]); index += 4;
-
-		/* write the message header */
-		if ((write_len = fwrite(buffer,1,MBSYS_JSTAR_MESSAGE_SIZE,mb_io_ptr->mbfp))
-			!= MBSYS_JSTAR_MESSAGE_SIZE)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-
-		index = 0;
-		mb_put_binary_int(MB_YES, dvl->seconds, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, dvl->msec, &buffer[index]); index += 4;
-		buffer[index] = dvl->reserve1[0]; index++;
-		buffer[index] = dvl->reserve1[1]; index++;
-		buffer[index] = dvl->reserve1[2]; index++;
-		buffer[index] = dvl->reserve1[3]; index++;
-		mb_put_binary_int(MB_YES, dvl->datavalidflags, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, dvl->beam1range, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, dvl->beam2range, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, dvl->beam3range, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, dvl->beam4range, &buffer[index]); index += 4;
-		mb_put_binary_short(MB_YES, dvl->velocitybottomx, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, dvl->velocitybottomy, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, dvl->velocitybottomz, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, dvl->velocitywaterx, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, dvl->velocitywatery, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, dvl->velocitywaterz, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, dvl->depth, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, dvl->pitch, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, dvl->roll, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, dvl->heading, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, dvl->salinity, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, dvl->temperature, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, dvl->soundspeed, &buffer[index]); index += 2;
-		for (i=0;i<7;i++)
-			{
-			mb_put_binary_short(MB_YES, dvl->reserve2[i], &buffer[index]); index += 2;
-			}
-
-		/* write the dvl data */
-		if ((write_len = fwrite(buffer,1,dvl->message.size,mb_io_ptr->mbfp))
-			!= dvl->message.size)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		}
-
-	/* write out NMEA data */
-	else if (store->kind == MB_DATA_NMEA_RMC || store->kind == MB_DATA_NMEA_DBT || store->kind == MB_DATA_NMEA_DPT)
-		{
-		/* insert the message header values */
-		index = 0;
-		nmea = (struct mbsys_jstar_nmea_struct *) &(store->nmea);
-		mb_put_binary_short(MB_YES, nmea->message.start_marker, &buffer[index]); index += 2;
-		buffer[index] = nmea->message.version; index++;
-		buffer[index] = nmea->message.session; index++;
-		mb_put_binary_short(MB_YES, nmea->message.type, &buffer[index]); index += 2;
-		buffer[index] = nmea->message.command; index++;
-		buffer[index] = nmea->message.subsystem; index++;
-		buffer[index] = nmea->message.channel; index++;
-		buffer[index] = nmea->message.sequence; index++;
-		mb_put_binary_short(MB_YES, nmea->message.reserved, &buffer[index]); index += 2;
-		mb_put_binary_int(MB_YES, nmea->message.size, &buffer[index]); index += 4;
-
-		/* write the message header */
-		if ((write_len = fwrite(buffer,1,MBSYS_JSTAR_MESSAGE_SIZE,mb_io_ptr->mbfp))
-			!= MBSYS_JSTAR_MESSAGE_SIZE)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-
-		index = 0;
-		mb_put_binary_int(MB_YES, nmea->seconds, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, nmea->msec, &buffer[index]); index += 4;
-		buffer[index] = nmea->source; index++;
-		buffer[index] = nmea->reserve[0]; index++;
-		buffer[index] = nmea->reserve[1]; index++;
-		buffer[index] = nmea->reserve[2]; index++;
-		for (i=0;i<(nmea->message.size-12);i++)
-			{
-			buffer[index] = nmea->nmea[i]; index++;
-			}
-
-		/* write the NMEA data */
-		if ((write_len = fwrite(buffer,1,nmea->message.size,mb_io_ptr->mbfp))
-			!= nmea->message.size)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		}
-
-	/* write out pressure data */
-	else if (store->kind == MB_DATA_CTD)
-		{
-		/* insert the message header values */
-		index = 0;
-		pressure = (struct mbsys_jstar_pressure_struct *) &(store->pressure);
-		mb_put_binary_short(MB_YES, pressure->message.start_marker, &buffer[index]); index += 2;
-		buffer[index] = pressure->message.version; index++;
-		buffer[index] = pressure->message.session; index++;
-		mb_put_binary_short(MB_YES, pressure->message.type, &buffer[index]); index += 2;
-		buffer[index] = pressure->message.command; index++;
-		buffer[index] = pressure->message.subsystem; index++;
-		buffer[index] = pressure->message.channel; index++;
-		buffer[index] = pressure->message.sequence; index++;
-		mb_put_binary_short(MB_YES, pressure->message.reserved, &buffer[index]); index += 2;
-		mb_put_binary_int(MB_YES, pressure->message.size, &buffer[index]); index += 4;
-
-		/* write the message header */
-		if ((write_len = fwrite(buffer,1,MBSYS_JSTAR_MESSAGE_SIZE,mb_io_ptr->mbfp))
-			!= MBSYS_JSTAR_MESSAGE_SIZE)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-
-		index = 0;
-		mb_put_binary_int(MB_YES, pressure->seconds, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, pressure->msec, &buffer[index]); index += 4;
-		buffer[index] = pressure->reserve1[0]; index++;
-		buffer[index] = pressure->reserve1[1]; index++;
-		buffer[index] = pressure->reserve1[2]; index++;
-		buffer[index] = pressure->reserve1[3]; index++;
-		mb_put_binary_int(MB_YES, pressure->pressure, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, pressure->salinity, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, pressure->datavalidflags, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, pressure->conductivity, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, pressure->soundspeed, &buffer[index]); index += 4;
-		for (i=0;i<10;i++)
-			{
-			mb_put_binary_int(MB_YES, pressure->reserve2[i], &buffer[index]); index += 4;
-			}
-
-		/* write the pressure data */
-		if ((write_len = fwrite(buffer,1,pressure->message.size,mb_io_ptr->mbfp))
-			!= pressure->message.size)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		}
-
-	/* write out sysinfo data */
-	else if (store->kind == MB_DATA_HEADER)
-		{
-		/* insert the message header values */
-		index = 0;
-		sysinfo = (struct mbsys_jstar_sysinfo_struct *) &(store->sysinfo);
-		mb_put_binary_short(MB_YES, sysinfo->message.start_marker, &buffer[index]); index += 2;
-		buffer[index] = sysinfo->message.version; index++;
-		buffer[index] = sysinfo->message.session; index++;
-		mb_put_binary_short(MB_YES, sysinfo->message.type, &buffer[index]); index += 2;
-		buffer[index] = sysinfo->message.command; index++;
-		buffer[index] = sysinfo->message.subsystem; index++;
-		buffer[index] = sysinfo->message.channel; index++;
-		buffer[index] = sysinfo->message.sequence; index++;
-		mb_put_binary_short(MB_YES, sysinfo->message.reserved, &buffer[index]); index += 2;
-		mb_put_binary_int(MB_YES, sysinfo->message.size, &buffer[index]); index += 4;
-
-		/* write the message header */
-		if ((write_len = fwrite(buffer,1,MBSYS_JSTAR_MESSAGE_SIZE,mb_io_ptr->mbfp))
-			!= MBSYS_JSTAR_MESSAGE_SIZE)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-
-		index = 0;
-		mb_put_binary_int(MB_YES, sysinfo->system_type, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, sysinfo->reserved1, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, sysinfo->version, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, sysinfo->reserved2, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, sysinfo->platformserialnumber, &buffer[index]); index += 4;
-		for (i=0;i<sysinfo->sysinfosize;i++)
-			{
-			buffer[index] = sysinfo->sysinfo[i];
-			}
-
-		/* write the sysinfo data */
-		if ((write_len = fwrite(buffer,1,sysinfo->message.size,mb_io_ptr->mbfp))
-			!= sysinfo->message.size)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mbr_elmk2unb.c b/src/mbio/mbr_elmk2unb.c
deleted file mode 100644
index 91827e0..0000000
--- a/src/mbio/mbr_elmk2unb.c
+++ /dev/null
@@ -1,2835 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbr_elmk2unb.c	6/6/97
- *	$Id: mbr_elmk2unb.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1997-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbr_elmk2unb.c contains the functions for reading and writing
- * multibeam data in the ELMK2UNB format.
- * These functions include:
- *   mbr_alm_elmk2unb	- allocate read/write memory
- *   mbr_dem_elmk2unb	- deallocate read/write memory
- *   mbr_rt_elmk2unb	- read and translate data
- *   mbr_wt_elmk2unb	- translate and write data
- *
- * Author:	D. W. Caress
- * Date:	June 6, 1997
- *
- * $Log: mbr_elmk2unb.c,v $
- * Revision 5.9  2005/11/05 00:48:05  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.8  2003/05/20 18:05:32  caress
- * Added svp_source to data source parameters.
- *
- * Revision 5.7  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.6  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.5  2001/08/10 22:41:19  dcaress
- * Release 5.0.beta07
- *
- * Revision 5.4  2001-07-19 17:31:11-07  caress
- * Release 5.0.beta03
- *
- * Revision 5.3  2001/06/08  21:44:01  caress
- * Version 5.0.beta01
- *
- * Revision 5.2  2001/03/22  20:45:56  caress
- * Trying to make 5.0.beta0...
- *
- * Revision 5.1  2001/01/22  07:43:34  caress
- * Version 5.0.beta01
- *
- * Revision 5.0  2000/12/01  22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.8  2000/10/11  01:02:30  caress
- * Convert to ANSI C
- *
- * Revision 4.7  2000/09/30  06:34:20  caress
- * Snapshot for Dale.
- *
- * Revision 4.6  1999/04/07  20:38:24  caress
- * Fixes related to building under Linux.
- *
- * Revision 4.6  1999/04/03 07:36:16  caress
- * Fix bugs in byteswapped code.
- *
- * Revision 4.5  1999/04/02 00:55:11  caress
- * Handles nav and nav records more properly.
- *
- * Revision 4.4  1999/03/31  18:11:35  caress
- * MB-System 4.6beta7
- *
- * Revision 4.3  1998/10/05  17:46:15  caress
- * MB-System version 4.6beta
- *
- * Revision 4.2  1997/09/15  19:06:40  caress
- * Real Version 4.5
- *
- * Revision 4.1  1997/07/28  14:58:19  caress
- * Fixed typos.
- *
- * Revision 4.0  1997/07/25  14:25:40  caress
- * Version 4.5beta2.
- *
- * Revision 1.1  1997/07/25  14:19:53  caress
- * Initial revision
- *
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mb_define.h"
-#include "mbsys_elacmk2.h"
-#include "mbf_elmk2unb.h"
-
-/* include for byte swapping */
-#include "mb_swap.h"
-
-/* essential function prototypes */
-int mbr_register_elmk2unb(int verbose, void *mbio_ptr,
-		int *error);
-int mbr_info_elmk2unb(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_alm_elmk2unb(int verbose, void *mbio_ptr, int *error);
-int mbr_dem_elmk2unb(int verbose, void *mbio_ptr, int *error);
-int mbr_zero_elmk2unb(int verbose, void *data_ptr, int *error);
-int mbr_rt_elmk2unb(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_wt_elmk2unb(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_elmk2unb_rd_data(int verbose, void *mbio_ptr, int *error);
-int mbr_elmk2unb_rd_comment(int verbose, FILE *mbfp,
-		struct mbf_elmk2unb_struct *data, int *error);
-int mbr_elmk2unb_rd_parameter(int verbose, FILE *mbfp,
-		struct mbf_elmk2unb_struct *data, int *error);
-int mbr_elmk2unb_rd_pos(int verbose, FILE *mbfp,
-		struct mbf_elmk2unb_struct *data, int *error);
-int mbr_elmk2unb_rd_svp(int verbose, FILE *mbfp,
-		struct mbf_elmk2unb_struct *data, int *error);
-int mbr_elmk2unb_rd_bathgen(int verbose, FILE *mbfp,
-		struct mbf_elmk2unb_struct *data, int *error);
-int mbr_elmk2unb_wr_data(int verbose, void *mbio_ptr, void *data_ptr, int *error);
-int mbr_elmk2unb_wr_comment(int verbose, FILE *mbfp, void *data_ptr, int *error);
-int mbr_elmk2unb_wr_parameter(int verbose, FILE *mbfp, void *data_ptr, int *error);
-int mbr_elmk2unb_wr_pos(int verbose, FILE *mbfp, void *data_ptr, int *error);
-int mbr_elmk2unb_wr_svp(int verbose, FILE *mbfp, void *data_ptr, int *error);
-int mbr_elmk2unb_wr_bathgen(int verbose, FILE *mbfp, void *data_ptr, int *error);
-
-static char rcs_id[]="$Id: mbr_elmk2unb.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mbr_register_elmk2unb(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_register_elmk2unb";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* get mb_io_ptr */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set format info parameters */
-	status = mbr_info_elmk2unb(verbose,
-			&mb_io_ptr->system,
-			&mb_io_ptr->beams_bath_max,
-			&mb_io_ptr->beams_amp_max,
-			&mb_io_ptr->pixels_ss_max,
-			mb_io_ptr->format_name,
-			mb_io_ptr->system_name,
-			mb_io_ptr->format_description,
-			&mb_io_ptr->numfile,
-			&mb_io_ptr->filetype,
-			&mb_io_ptr->variable_beams,
-			&mb_io_ptr->traveltime,
-			&mb_io_ptr->beam_flagging,
-			&mb_io_ptr->nav_source,
-			&mb_io_ptr->heading_source,
-			&mb_io_ptr->vru_source,
-			&mb_io_ptr->svp_source,
-			&mb_io_ptr->beamwidth_xtrack,
-			&mb_io_ptr->beamwidth_ltrack,
-			error);
-
-	/* set format and system specific function pointers */
-	mb_io_ptr->mb_io_format_alloc = &mbr_alm_elmk2unb;
-	mb_io_ptr->mb_io_format_free = &mbr_dem_elmk2unb;
-	mb_io_ptr->mb_io_store_alloc = &mbsys_elacmk2_alloc;
-	mb_io_ptr->mb_io_store_free = &mbsys_elacmk2_deall;
-	mb_io_ptr->mb_io_read_ping = &mbr_rt_elmk2unb;
-	mb_io_ptr->mb_io_write_ping = &mbr_wt_elmk2unb;
-	mb_io_ptr->mb_io_dimensions = &mbsys_elacmk2_dimensions;
-	mb_io_ptr->mb_io_extract = &mbsys_elacmk2_extract;
-	mb_io_ptr->mb_io_insert = &mbsys_elacmk2_insert;
-	mb_io_ptr->mb_io_extract_nav = &mbsys_elacmk2_extract_nav;
-	mb_io_ptr->mb_io_insert_nav = &mbsys_elacmk2_insert_nav;
-	mb_io_ptr->mb_io_extract_altitude = &mbsys_elacmk2_extract_altitude;
-	mb_io_ptr->mb_io_insert_altitude = NULL;
-	mb_io_ptr->mb_io_extract_svp = &mbsys_elacmk2_extract_svp;
-	mb_io_ptr->mb_io_insert_svp = &mbsys_elacmk2_insert_svp;
-	mb_io_ptr->mb_io_ttimes = &mbsys_elacmk2_ttimes;
-	mb_io_ptr->mb_io_detects = &mbsys_elacmk2_detects;
-	mb_io_ptr->mb_io_copyrecord = &mbsys_elacmk2_copy;
-	mb_io_ptr->mb_io_extract_rawss = NULL;
-	mb_io_ptr->mb_io_insert_rawss = NULL;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",mb_io_ptr->system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",mb_io_ptr->beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",mb_io_ptr->beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",mb_io_ptr->pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",mb_io_ptr->format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",mb_io_ptr->system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",mb_io_ptr->format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",mb_io_ptr->numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",mb_io_ptr->filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",mb_io_ptr->variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",mb_io_ptr->traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",mb_io_ptr->beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",mb_io_ptr->nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",mb_io_ptr->heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",mb_io_ptr->vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",mb_io_ptr->svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",mb_io_ptr->beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",mb_io_ptr->beamwidth_ltrack);
-		fprintf(stderr,"dbg2       format_alloc:       %p\n",(void *)mb_io_ptr->mb_io_format_alloc);
-		fprintf(stderr,"dbg2       format_free:        %p\n",(void *)mb_io_ptr->mb_io_format_free);
-		fprintf(stderr,"dbg2       store_alloc:        %p\n",(void *)mb_io_ptr->mb_io_store_alloc);
-		fprintf(stderr,"dbg2       store_free:         %p\n",(void *)mb_io_ptr->mb_io_store_free);
-		fprintf(stderr,"dbg2       read_ping:          %p\n",(void *)mb_io_ptr->mb_io_read_ping);
-		fprintf(stderr,"dbg2       write_ping:         %p\n",(void *)mb_io_ptr->mb_io_write_ping);
-		fprintf(stderr,"dbg2       extract:            %p\n",(void *)mb_io_ptr->mb_io_extract);
-		fprintf(stderr,"dbg2       insert:             %p\n",(void *)mb_io_ptr->mb_io_insert);
-		fprintf(stderr,"dbg2       extract_nav:        %p\n",(void *)mb_io_ptr->mb_io_extract_nav);
-		fprintf(stderr,"dbg2       insert_nav:         %p\n",(void *)mb_io_ptr->mb_io_insert_nav);
-		fprintf(stderr,"dbg2       extract_altitude:   %p\n",(void *)mb_io_ptr->mb_io_extract_altitude);
-		fprintf(stderr,"dbg2       insert_altitude:    %p\n",(void *)mb_io_ptr->mb_io_insert_altitude);
-		fprintf(stderr,"dbg2       extract_svp:        %p\n",(void *)mb_io_ptr->mb_io_extract_svp);
-		fprintf(stderr,"dbg2       insert_svp:         %p\n",(void *)mb_io_ptr->mb_io_insert_svp);
-		fprintf(stderr,"dbg2       ttimes:             %p\n",(void *)mb_io_ptr->mb_io_ttimes);
-		fprintf(stderr,"dbg2       detects:            %p\n",(void *)mb_io_ptr->mb_io_detects);
-		fprintf(stderr,"dbg2       extract_rawss:      %p\n",(void *)mb_io_ptr->mb_io_extract_rawss);
-		fprintf(stderr,"dbg2       insert_rawss:       %p\n",(void *)mb_io_ptr->mb_io_insert_rawss);
-		fprintf(stderr,"dbg2       copyrecord:         %p\n",(void *)mb_io_ptr->mb_io_copyrecord);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbr_info_elmk2unb(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error)
-{
-	char	*function_name = "mbr_info_elmk2unb";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* set format info parameters */
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-	*system = MB_SYS_ELACMK2;
-	*beams_bath_max = 126;
-	*beams_amp_max = 126;
-	*pixels_ss_max = 0;
-	strncpy(format_name, "ELMK2UNB", MB_NAME_LENGTH);
-	strncpy(system_name, "ELACMK2", MB_NAME_LENGTH);
-	strncpy(format_description, "Format name:          MBF_ELMK2UNB\nInformal Description: Elac BottomChart MkII shallow water multibeam\nAttributes:           126 beam bathymetry and amplitude,\n                      binary, University of New Brunswick.\n", MB_DESCRIPTION_LENGTH);
-	*numfile = 1;
-	*filetype = MB_FILETYPE_NORMAL;
-	*variable_beams = MB_YES;
-	*traveltime = MB_YES;
-	*beam_flagging = MB_YES;
-	*nav_source = MB_DATA_NAV;
-	*heading_source = MB_DATA_DATA;
-	*vru_source = MB_DATA_DATA;
-	*svp_source = MB_DATA_VELOCITY_PROFILE;
-	*beamwidth_xtrack = 3.0;
-	*beamwidth_ltrack = 3.0;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",*system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",*beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",*beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",*pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",*numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",*filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",*variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",*traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",*beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",*nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",*heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",*vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",*svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",*beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",*beamwidth_ltrack);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_alm_elmk2unb(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_alm_elmk2unb";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set initial status */
-	status = MB_SUCCESS;
-
-	/* allocate memory for data structure */
-	mb_io_ptr->structure_size = sizeof(struct mbf_elmk2unb_struct);
-	mb_io_ptr->data_structure_size = 0;
-	status = mb_malloc(verbose,mb_io_ptr->structure_size,
-				&mb_io_ptr->raw_data,error);
-	mbsys_elacmk2_alloc(verbose,mbio_ptr,
-				&mb_io_ptr->store_data,error);
-
-	/* initialize everything to zeros */
-	mbr_zero_elmk2unb(verbose,mb_io_ptr->raw_data,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_dem_elmk2unb(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_dem_elmk2unb";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointers to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* deallocate memory for data descriptor */
-	status = mb_free(verbose,&mb_io_ptr->raw_data,error);
-	status = mb_free(verbose,&mb_io_ptr->store_data,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_zero_elmk2unb(int verbose, void *data_ptr, int *error)
-{
-	char	*function_name = "mbr_zero_elmk2unb";
-	int	status = MB_SUCCESS;
-	struct mbf_elmk2unb_struct *data;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       data_ptr:   %p\n",(void *)data_ptr);
-		}
-
-	/* get pointer to data descriptor */
-	data = (struct mbf_elmk2unb_struct *) data_ptr;
-
-	/* initialize everything to zeros */
-	if (data != NULL)
-		{
-		data->kind = MB_DATA_NONE;
-		data->sonar = MBSYS_ELACMK2_BOTTOMCHART_MARKII;
-		data->par_year = 0;
-		data->par_month = 0;
-		data->par_day = 0;
-		data->par_hour = 0;
-		data->par_minute = 0;
-		data->par_second = 0;
-		data->par_hundredth_sec = 0;
-		data->par_thousandth_sec = 0;
-		data->roll_offset = 0;	/* roll offset (degrees) */
-		data->pitch_offset = 0;	/* pitch offset (degrees) */
-		data->heading_offset = 0;	/* heading offset (degrees) */
-		data->time_delay = 0;		/* positioning system
-							delay (sec) */
-		data->transducer_port_height = 0;
-		data->transducer_starboard_height = 0;
-		data->transducer_port_depth = 192;
-		data->transducer_starboard_depth = 192;
-		data->transducer_port_x = 0;
-		data->transducer_starboard_x = 0;
-		data->transducer_port_y = 0;
-		data->transducer_starboard_y = 0;
-		data->transducer_port_error = 0;
-		data->transducer_starboard_error = 0;
-		data->antenna_height = 0;
-		data->antenna_x = 0;
-		data->antenna_y = 0;
-		data->vru_height = 0;
-		data->vru_x = 0;
-		data->vru_y = 0;
-		data->line_number = 0;
-		data->start_or_stop = 0;
-		data->transducer_serial_number = 0;
-		for (i=0;i<MBF_ELMK2UNB_COMMENT_LENGTH;i++)
-			data->comment[i] = '\0';
-
-		/* position (position telegrams) */
-		data->pos_year = 0;
-		data->pos_month = 0;
-		data->pos_day = 0;
-		data->pos_hour = 0;
-		data->pos_minute = 0;
-		data->pos_second = 0;
-		data->par_hundredth_sec = 0;
-		data->pos_thousandth_sec = 0;
-		data->pos_latitude = 0;
-		data->pos_longitude = 0;
-		data->utm_northing = 0;
-		data->utm_easting = 0;
-		data->utm_zone_lon = 0;
-		data->utm_zone = 0;
-		data->hemisphere = 0;
-		data->ellipsoid = 0;
-		data->pos_spare = 0;
-		data->semi_major_axis = 0;
-		data->other_quality = 0;
-
-		/* sound velocity profile */
-		data->svp_year = 0;
-		data->svp_month = 0;
-		data->svp_day = 0;
-		data->svp_hour = 0;
-		data->svp_minute = 0;
-		data->svp_second = 0;
-		data->svp_hundredth_sec = 0;
-		data->svp_thousandth_sec = 0;
-		data->svp_num = 0;
-		for (i=0;i<100;i++)
-			{
-			data->svp_depth[i] = 0; /* 0.1 meters */
-			data->svp_vel[i] = 0;	/* 0.1 meters/sec */
-			}
-
-		/* depth telegram */
-		data->year = 0;
-		data->month = 0;
-		data->day = 0;
-		data->hour = 0;
-		data->minute = 0;
-		data->second = 0;
-		data->hundredth_sec = 0;
-		data->thousandth_sec = 0;
-		data->latitude = 0;
-		data->longitude = 0;
-		data->ping_num = 0;
-		data->sound_vel = 0;
-		data->heading = 0;
-		data->pulse_length = 0;
-		data->mode = 0;
-		data->pulse_length = 0;
-		data->source_power = 0;
-		data->receiver_gain_stbd = 0;
-		data->receiver_gain_port = 0;
-		data->reserved = 0;
-		data->beams_bath = 0;
-		for (i=0;i<MBF_ELMK2UNB_MAXBEAMS;i++)
-			{
-			data->beams[i].bath = 0;
-			data->beams[i].bath_acrosstrack = 0;
-			data->beams[i].bath_alongtrack = 0;
-			data->beams[i].tt = 0;
-			data->beams[i].quality = 0;
-			data->beams[i].amplitude = 0;
-			data->beams[i].time_offset = 0;
-			data->beams[i].heave = 0;
-			data->beams[i].roll = 0;
-			data->beams[i].pitch = 0;
-			data->beams[i].angle = 0;
-			}
-		}
-
-	/* assume success */
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_rt_elmk2unb(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_rt_elmk2unb";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_elmk2unb_struct *data;
-	struct mbsys_elacmk2_struct *store;
-	int	time_i[7];
-	double	time_d;
-	double	lon, lat, heading, speed;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointers to mbio descriptor and data structures */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-	data = (struct mbf_elmk2unb_struct *) mb_io_ptr->raw_data;
-	store = (struct mbsys_elacmk2_struct *) store_ptr;
-
-	/* read next data from file */
-	status = mbr_elmk2unb_rd_data(verbose,mbio_ptr,error);
-
-	/* set error and kind in mb_io_ptr */
-	mb_io_ptr->new_error = *error;
-	mb_io_ptr->new_kind = data->kind;
-
-	/* add nav records to list for interpolation */
-	if (status == MB_SUCCESS
-		&& data->kind == MB_DATA_NAV)
-		{
-		mb_fix_y2k(verbose, data->pos_year,&time_i[0]);
-		time_i[1] = data->pos_month;
-		time_i[2] = data->pos_day;
-		time_i[3] = data->pos_hour;
-		time_i[4] = data->pos_minute;
-		time_i[5] = data->pos_second;
-		time_i[6] = 10000*data->pos_hundredth_sec
-			+ 100*data->pos_thousandth_sec;
-		mb_get_time(verbose,time_i, &time_d);
-		lon = data->pos_longitude*0.00000009;
-		lat = data->pos_latitude*0.00000009;
-		mb_navint_add(verbose, mbio_ptr, time_d, lon, lat, error);
-		}
-
-	/* interpolate navigation for survey pings if needed */
-	if (status == MB_SUCCESS
-		&& data->kind == MB_DATA_DATA
-		&& mb_io_ptr->nfix >= 1)
-		{
-		mb_fix_y2k(verbose, data->year,&time_i[0]);
-		time_i[1] = data->month;
-		time_i[2] = data->day;
-		time_i[3] = data->hour;
-		time_i[4] = data->minute;
-		time_i[5] = data->second;
-		time_i[6] = 10000*data->hundredth_sec
-			+ 100*data->thousandth_sec;
-		mb_get_time(verbose,time_i, &time_d);
-		heading = 0.01 * data->heading;
-		mb_navint_interp(verbose, mbio_ptr, time_d, heading, 0.0,
-				    &lon, &lat, &speed, error);
-		data->longitude = (int) (lon / 0.00000009);
-		data->latitude = (int) (lat / 0.00000009);
-		}
-
-	/* translate values to elac data storage structure */
-	if (status == MB_SUCCESS
-		&& store != NULL)
-		{
-		store->kind = data->kind;
-		store->sonar = data->sonar;
-
-		/* parameter telegram */
-		if (store->kind == MB_DATA_PARAMETER)
-		    {
-		    store->par_year = data->par_year;
-		    store->par_month = data->par_month;
-		    store->par_day = data->par_day;
-		    store->par_hour = data->par_hour;
-		    store->par_minute = data->par_minute;
-		    store->par_second = data->par_second;
-		    store->par_hundredth_sec = data->par_hundredth_sec;
-		    store->par_thousandth_sec = data->par_thousandth_sec;
-		    store->roll_offset = data->roll_offset;
-		    store->pitch_offset = data->pitch_offset;
-		    store->heading_offset = data->heading_offset;
-		    store->time_delay = data->time_delay;
-		    store->transducer_port_height = data->transducer_port_height;
-		    store->transducer_starboard_height
-			    = data->transducer_starboard_height;
-		    store->transducer_port_depth = data->transducer_port_depth;
-		    store->transducer_starboard_depth
-			    = data->transducer_starboard_depth;
-		    store->transducer_port_x = data->transducer_port_x;
-		    store->transducer_starboard_x = data->transducer_starboard_x;
-		    store->transducer_port_y = data->transducer_port_y;
-		    store->transducer_starboard_y = data->transducer_starboard_y;
-		    store->transducer_port_error = data->transducer_port_error;
-		    store->transducer_starboard_error
-			    = data->transducer_starboard_error;
-		    store->antenna_height = data->antenna_height;
-		    store->antenna_x = data->antenna_x;
-		    store->antenna_y = data->antenna_y;
-		    store->vru_height = data->vru_height;
-		    store->vru_x = data->vru_x;
-		    store->vru_y = data->vru_y;
-		    store->line_number = data->line_number;
-		    store->start_or_stop = data->start_or_stop;
-		    store->transducer_serial_number
-			    = data->transducer_serial_number;
-		    }
-
-		/* comment */
-		if (store->kind == MB_DATA_COMMENT)
-		    {
-		    for (i=0;i<MBF_ELMK2UNB_COMMENT_LENGTH;i++)
-			    store->comment[i] = data->comment[i];
-		    }
-
-		/* position (position telegrams) */
-		if (store->kind == MB_DATA_NAV)
-		    {
-		    store->pos_year = data->pos_year;
-		    store->pos_month = data->pos_month;
-		    store->pos_day = data->pos_day;
-		    store->pos_hour = data->pos_hour;
-		    store->pos_minute = data->pos_minute;
-		    store->pos_second = data->pos_second;
-		    store->pos_hundredth_sec = data->pos_hundredth_sec;
-		    store->pos_thousandth_sec = data->pos_thousandth_sec;
-		    store->pos_latitude = data->pos_latitude;
-		    store->pos_longitude = data->pos_longitude;
-		    store->utm_northing = data->utm_northing;
-		    store->utm_easting = data->utm_easting;
-		    store->utm_zone_lon = data->utm_zone_lon;
-		    store->utm_zone = data->utm_zone;
-		    store->hemisphere = data->hemisphere;
-		    store->ellipsoid = data->ellipsoid;
-		    store->pos_spare = data->pos_spare;
-		    store->semi_major_axis = data->semi_major_axis;
-		    store->other_quality = data->other_quality;
-		    }
-
-		/* sound velocity profile */
-		if (store->kind == MB_DATA_VELOCITY_PROFILE)
-		    {
-		    store->svp_year = data->svp_year;
-		    store->svp_month = data->svp_month;
-		    store->svp_day = data->svp_day;
-		    store->svp_hour = data->svp_hour;
-		    store->svp_minute = data->svp_minute;
-		    store->svp_second = data->svp_second;
-		    store->svp_hundredth_sec = data->svp_hundredth_sec;
-		    store->svp_thousandth_sec = data->svp_thousandth_sec;
-		    store->svp_num = data->svp_num;
-		    for (i=0;i<500;i++)
-			    {
-			    store->svp_depth[i] = data->svp_depth[i];
-			    store->svp_vel[i] = data->svp_vel[i];
-			    }
-		    }
-
-		/* depth telegram */
-		if (store->kind == MB_DATA_DATA)
-		    {
-		    store->year = data->year;
-		    store->month = data->month;
-		    store->day = data->day;
-		    store->hour = data->hour;
-		    store->minute = data->minute;
-		    store->second = data->second;
-		    store->hundredth_sec
-			    = data->hundredth_sec;
-		    store->thousandth_sec
-			    = data->thousandth_sec;
-		    store->longitude = lon;
-		    store->latitude = lat;
-		    store->speed = speed / 3.6;
-		    store->ping_num = data->ping_num;
-		    store->sound_vel = data->sound_vel;
-		    store->heading = data->heading;
-		    store->pulse_length = data->pulse_length;
-		    store->mode = data->mode;
-		    store->source_power = data->source_power;
-		    store->receiver_gain_stbd = data->receiver_gain_stbd;
-		    store->receiver_gain_port = data->receiver_gain_port;
-		    store->reserved = data->reserved;
-		    store->beams_bath = data->beams_bath;
-		    for (i=0;i<data->beams_bath;i++)
-			    {
-			    store->beams[i].bath = data->beams[i].bath;
-			    store->beams[i].bath_acrosstrack = data->beams[i].bath_acrosstrack;
-			    store->beams[i].bath_alongtrack = data->beams[i].bath_alongtrack;
-			    store->beams[i].tt = data->beams[i].tt;
-			    store->beams[i].quality = data->beams[i].quality;
-			    store->beams[i].amplitude = data->beams[i].amplitude;
-			    store->beams[i].time_offset = data->beams[i].time_offset;
-			    store->beams[i].heave = data->beams[i].heave;
-			    store->beams[i].roll = data->beams[i].roll;
-			    store->beams[i].pitch = data->beams[i].pitch;
-			    store->beams[i].angle = data->beams[i].angle;
-			    }
-		    }
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_wt_elmk2unb(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_wt_elmk2unb";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_elmk2unb_struct *data;
-	char	*data_ptr;
-	struct mbsys_elacmk2_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_elmk2unb_struct *) mb_io_ptr->raw_data;
-	data_ptr = (char *) data;
-	store = (struct mbsys_elacmk2_struct *) store_ptr;
-
-	/* first translate values from data storage structure */
-	if (store != NULL)
-		{
-		data->kind = store->kind;
-		data->sonar = store->sonar;
-
-		/* parameter telegram */
-		data->par_year = store->par_year;
-		data->par_month = store->par_month;
-		data->par_day = store->par_day;
-		data->par_hour = store->par_hour;
-		data->par_minute = store->par_minute;
-		data->par_second = store->par_second;
-		data->par_hundredth_sec = store->par_hundredth_sec;
-		data->par_thousandth_sec = store->par_thousandth_sec;
-		data->roll_offset = store->roll_offset;
-		data->pitch_offset = store->pitch_offset;
-		data->heading_offset = store->heading_offset;
-		data->time_delay = store->time_delay;
-		data->transducer_port_height = store->transducer_port_height;
-		data->transducer_starboard_height
-			= store->transducer_starboard_height;
-		data->transducer_port_depth = store->transducer_port_depth;
-		data->transducer_starboard_depth
-			= store->transducer_starboard_depth;
-		data->transducer_port_x = store->transducer_port_x;
-		data->transducer_starboard_x = store->transducer_starboard_x;
-		data->transducer_port_y = store->transducer_port_y;
-		data->transducer_starboard_y = store->transducer_starboard_y;
-		data->transducer_port_error = store->transducer_port_error;
-		data->transducer_starboard_error
-			= store->transducer_starboard_error;
-		data->antenna_height = store->antenna_height;
-		data->antenna_x = store->antenna_x;
-		data->antenna_y = store->antenna_y;
-		data->vru_height = store->vru_height;
-		data->vru_x = store->vru_x;
-		data->vru_y = store->vru_y;
-		data->line_number = store->line_number;
-		data->start_or_stop = store->start_or_stop;
-		data->transducer_serial_number
-			= store->transducer_serial_number;
-		for (i=0;i<MBF_ELMK2UNB_COMMENT_LENGTH;i++)
-			data->comment[i] = store->comment[i];
-
-		/* position (position telegrams) */
-		data->pos_year = store->pos_year;
-		data->pos_month = store->pos_month;
-		data->pos_day = store->pos_day;
-		data->pos_hour = store->pos_hour;
-		data->pos_minute = store->pos_minute;
-		data->pos_second = store->pos_second;
-		data->pos_hundredth_sec = store->pos_hundredth_sec;
-		data->pos_thousandth_sec = store->pos_thousandth_sec;
-		data->pos_latitude = store->pos_latitude;
-		data->pos_longitude = store->pos_longitude;
-		data->utm_northing = store->utm_northing;
-		data->utm_easting = store->utm_easting;
-		data->utm_zone_lon = store->utm_zone_lon;
-		data->utm_zone = store->utm_zone;
-		data->hemisphere = store->hemisphere;
-		data->ellipsoid = store->ellipsoid;
-		data->pos_spare = store->pos_spare;
-		data->semi_major_axis = store->semi_major_axis;
-		data->other_quality = store->other_quality;
-
-		/* sound velocity profile */
-		data->svp_year = store->svp_year;
-		data->svp_month = store->svp_month;
-		data->svp_day = store->svp_day;
-		data->svp_hour = store->svp_hour;
-		data->svp_minute = store->svp_minute;
-		data->svp_second = store->svp_second;
-		data->svp_hundredth_sec = store->svp_hundredth_sec;
-		data->svp_thousandth_sec = store->svp_thousandth_sec;
-		data->svp_num = store->svp_num;
-		for (i=0;i<500;i++)
-			{
-			data->svp_depth[i] = store->svp_depth[i];
-			data->svp_vel[i] = store->svp_vel[i];
-			}
-
-		/* depth telegram */
-		data->year = store->year;
-		data->month = store->month;
-		data->day = store->day;
-		data->hour = store->hour;
-		data->minute = store->minute;
-		data->second = store->second;
-		data->hundredth_sec
-			= store->hundredth_sec;
-		data->thousandth_sec
-			= store->thousandth_sec;
-		data->ping_num = store->ping_num;
-		data->sound_vel = store->sound_vel;
-		data->heading = store->heading;
-		data->pulse_length = store->pulse_length;
-		data->mode = store->mode;
-		data->source_power = store->source_power;
-		data->receiver_gain_stbd = store->receiver_gain_stbd;
-		data->receiver_gain_port = store->receiver_gain_port;
-		data->reserved = store->reserved;
-		data->beams_bath = store->beams_bath;
-		for (i=0;i<store->beams_bath;i++)
-			{
-			data->beams[i].bath = store->beams[i].bath;
-			data->beams[i].bath_acrosstrack = store->beams[i].bath_acrosstrack;
-			data->beams[i].bath_alongtrack = store->beams[i].bath_alongtrack;
-			data->beams[i].tt = store->beams[i].tt;
-			data->beams[i].quality = store->beams[i].quality;
-			data->beams[i].amplitude = store->beams[i].amplitude;
-			data->beams[i].time_offset = store->beams[i].time_offset;
-			data->beams[i].heave = store->beams[i].heave;
-			data->beams[i].roll = store->beams[i].roll;
-			data->beams[i].pitch = store->beams[i].pitch;
-			data->beams[i].angle = store->beams[i].angle;
-			}
-		}
-
-	/* write next data to file */
-	status = mbr_elmk2unb_wr_data(verbose,mbio_ptr,data_ptr,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_elmk2unb_rd_data(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_elmk2unb_rd_data";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_elmk2unb_struct *data;
-	char	*data_ptr;
-	FILE	*mbfp;
-	int	done;
-	short int *type;
-	static char label[2];
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_elmk2unb_struct *) mb_io_ptr->raw_data;
-	data_ptr = (char *) data;
-	mbfp = mb_io_ptr->mbfp;
-
-	/* set file position */
-	mb_io_ptr->file_pos = mb_io_ptr->file_bytes;
-
-	done = MB_NO;
-	type = (short int *) label;
-	*error = MB_ERROR_NO_ERROR;
-	while (done == MB_NO)
-		{
-		/* get next record label */
-		if ((status = fread(&label[0],1,1,mb_io_ptr->mbfp)) != 1)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_EOF;
-			}
-		if (label[0] == 0x02)
-		if ((status = fread(&label[1],1,1,mb_io_ptr->mbfp)) != 1)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_EOF;
-			}
-
-		/* swap bytes if necessary */
-#ifdef BYTESWAPPED
-		*type = (short int) mb_swap_short(*type);
-#endif
-
-		/* read the appropriate data records */
-		if (status == MB_FAILURE)
-			{
-			done = MB_YES;
-			}
-		else if (*type == ELACMK2_COMMENT)
-			{
-			status = mbr_elmk2unb_rd_comment(
-				verbose,mbfp,data,error);
-			if (status == MB_SUCCESS)
-				{
-				done = MB_YES;
-				data->kind = MB_DATA_COMMENT;
-				}
-			}
-		else if (*type == ELACMK2_PARAMETER)
-			{
-			status = mbr_elmk2unb_rd_parameter(
-				verbose,mbfp,data,error);
-			if (status == MB_SUCCESS)
-				{
-				done = MB_YES;
-				data->kind = MB_DATA_PARAMETER;
-				}
-			}
-		else if (*type == ELACMK2_POS)
-			{
-			status = mbr_elmk2unb_rd_pos(
-				verbose,mbfp,data,error);
-			if (status == MB_SUCCESS)
-				{
-				done = MB_YES;
-				data->kind = MB_DATA_NAV;
-				}
-			}
-		else if (*type == ELACMK2_SVP)
-			{
-			status = mbr_elmk2unb_rd_svp(
-				verbose,mbfp,data,error);
-			if (status == MB_SUCCESS)
-				{
-				done = MB_YES;
-				data->kind = MB_DATA_VELOCITY_PROFILE;
-				}
-			}
-		else if (*type == ELACMK2_BATHGEN)
-			{
-			status = mbr_elmk2unb_rd_bathgen(
-				verbose,mbfp,data,error);
-			if (status == MB_SUCCESS)
-				{
-				done = MB_YES;
-				data->kind = MB_DATA_DATA;
-				}
-			}
-		else
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_UNINTELLIGIBLE;
-			}
-
-		/* bail out if there is an error */
-		if (status == MB_FAILURE)
-			done = MB_YES;
-
-		}
-
-	/* get file position */
-	mb_io_ptr->file_bytes = ftell(mbfp);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_elmk2unb_rd_comment(int verbose, FILE *mbfp,
-		struct mbf_elmk2unb_struct *data, int *error)
-{
-	char	*function_name = "mbr_elmk2unb_rd_comment";
-	int	status = MB_SUCCESS;
-	char	line[ELACMK2_COMMENT_SIZE+3];
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       data:       %p\n",(void *)data);
-		}
-
-	/* read record into char array */
-	status = fread(line,1,ELACMK2_COMMENT_SIZE+3,mbfp);
-	if (status == ELACMK2_COMMENT_SIZE+3)
-		status = MB_SUCCESS;
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	/* get data */
-	if (status == MB_SUCCESS)
-		{
-		data->kind = MB_DATA_COMMENT;
-		strncpy(data->comment,line,MBF_ELMK2UNB_COMMENT_LENGTH-1);
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       comment:          %s\n",data->comment);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_elmk2unb_rd_parameter(int verbose, FILE *mbfp,
-		struct mbf_elmk2unb_struct *data, int *error)
-{
-	char	*function_name = "mbr_elmk2unb_rd_parameter";
-	int	status = MB_SUCCESS;
-	char	line[ELACMK2_PARAMETER_SIZE+3];
-	short int *short_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       data:       %p\n",(void *)data);
-		}
-
-	/* read record into char array */
-	status = fread(line,1,ELACMK2_PARAMETER_SIZE+3,mbfp);
-	if (status == ELACMK2_PARAMETER_SIZE+3)
-		status = MB_SUCCESS;
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	/* get data */
-	if (status == MB_SUCCESS)
-		{
-		data->kind = MB_DATA_PARAMETER;
-		data->par_day =            (int) line[0];
-		data->par_month =          (int) line[1];
-		data->par_year =           (int) line[2];
-		data->par_hour =           (int) line[3];
-		data->par_minute =         (int) line[4];
-		data->par_second =         (int) line[5];
-		data->par_hundredth_sec =  (int) line[6];
-		data->par_thousandth_sec = (int) line[7];
-#ifndef BYTESWAPPED
-		short_ptr = (short int *) &line[8];
-		data->roll_offset = *short_ptr;
-		short_ptr = (short int *) &line[10];
-		data->pitch_offset = *short_ptr;
-		short_ptr = (short int *) &line[12];
-		data->heading_offset = *short_ptr;
-		short_ptr = (short int *) &line[14];
-		data->time_delay = *short_ptr;
-		short_ptr = (short int *) &line[16];
-		data->transducer_port_height = *short_ptr;
-		short_ptr = (short int *) &line[18];
-		data->transducer_starboard_height = *short_ptr;
-		short_ptr = (short int *) &line[20];
-		data->transducer_port_depth = *short_ptr;
-		short_ptr = (short int *) &line[22];
-		data->transducer_starboard_depth = *short_ptr;
-		short_ptr = (short int *) &line[24];
-		data->transducer_port_x = *short_ptr;
-		short_ptr = (short int *) &line[26];
-		data->transducer_starboard_x = *short_ptr;
-		short_ptr = (short int *) &line[28];
-		data->transducer_port_y = *short_ptr;
-		short_ptr = (short int *) &line[30];
-		data->transducer_starboard_y = *short_ptr;
-		short_ptr = (short int *) &line[32];
-		data->transducer_port_error = *short_ptr;
-		short_ptr = (short int *) &line[34];
-		data->transducer_starboard_error = *short_ptr;
-		short_ptr = (short int *) &line[36];
-		data->antenna_height = *short_ptr;
-		short_ptr = (short int *) &line[38];
-		data->antenna_x = *short_ptr;
-		short_ptr = (short int *) &line[40];
-		data->antenna_y = *short_ptr;
-		short_ptr = (short int *) &line[42];
-		data->vru_height = *short_ptr;
-		short_ptr = (short int *) &line[44];
-		data->vru_x = *short_ptr;
-		short_ptr = (short int *) &line[46];
-		data->vru_y = *short_ptr;
-		short_ptr = (short int *) &line[48];
-		data->line_number = *short_ptr;
-		short_ptr = (short int *) &line[50];
-		data->start_or_stop = *short_ptr;
-		short_ptr = (short int *) &line[52];
-		data->transducer_serial_number = *short_ptr;
-#else
-		short_ptr = (short int *) &line[8];
-		data->roll_offset = (short int) mb_swap_short(*short_ptr);
-		short_ptr = (short int *) &line[10];
-		data->pitch_offset = (short int) mb_swap_short(*short_ptr);
-		short_ptr = (short int *) &line[12];
-		data->heading_offset = (short int) mb_swap_short(*short_ptr);
-		short_ptr = (short int *) &line[14];
-		data->time_delay = (short int) mb_swap_short(*short_ptr);
-		short_ptr = (short int *) &line[16];
-		data->transducer_port_height
-			= (short int) mb_swap_short(*short_ptr);
-		short_ptr = (short int *) &line[18];
-		data->transducer_starboard_height
-			= (short int) mb_swap_short(*short_ptr);
-		short_ptr = (short int *) &line[20];
-		data->transducer_port_depth
-			= (short int) mb_swap_short(*short_ptr);
-		short_ptr = (short int *) &line[22];
-		data->transducer_starboard_depth
-			= (short int) mb_swap_short(*short_ptr);
-		short_ptr = (short int *) &line[24];
-		data->transducer_port_x
-			= (short int) mb_swap_short(*short_ptr);
-		short_ptr = (short int *) &line[26];
-		data->transducer_starboard_x
-			= (short int) mb_swap_short(*short_ptr);
-		short_ptr = (short int *) &line[28];
-		data->transducer_port_y
-			= (short int) mb_swap_short(*short_ptr);
-		short_ptr = (short int *) &line[30];
-		data->transducer_starboard_y
-			= (short int) mb_swap_short(*short_ptr);
-		short_ptr = (short int *) &line[32];
-		data->transducer_port_error
-			= (short int) mb_swap_short(*short_ptr);
-		short_ptr = (short int *) &line[34];
-		data->transducer_starboard_error
-			= (short int) mb_swap_short(*short_ptr);
-		short_ptr = (short int *) &line[36];
-		data->antenna_height = (short int) mb_swap_short(*short_ptr);
-		short_ptr = (short int *) &line[38];
-		data->antenna_x = (short int) mb_swap_short(*short_ptr);
-		short_ptr = (short int *) &line[40];
-		data->antenna_y = (short int) mb_swap_short(*short_ptr);
-		short_ptr = (short int *) &line[42];
-		data->vru_height = (short int) mb_swap_short(*short_ptr);
-		short_ptr = (short int *) &line[44];
-		data->vru_x = (short int) mb_swap_short(*short_ptr);
-		short_ptr = (short int *) &line[46];
-		data->vru_y = (short int) mb_swap_short(*short_ptr);
-		short_ptr = (short int *) &line[48];
-		data->line_number = (short int) mb_swap_short(*short_ptr);
-		short_ptr = (short int *) &line[50];
-		data->start_or_stop = (short int) mb_swap_short(*short_ptr);
-		short_ptr = (short int *) &line[52];
-		data->transducer_serial_number
-			= (short int) mb_swap_short(*short_ptr);
-#endif
-		}
-
-	/* print debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       year:             %d\n",data->par_year);
-		fprintf(stderr,"dbg5       month:            %d\n",data->par_month);
-		fprintf(stderr,"dbg5       day:              %d\n",data->par_day);
-		fprintf(stderr,"dbg5       hour:             %d\n",data->par_hour);
-		fprintf(stderr,"dbg5       minute:           %d\n",data->par_minute);
-		fprintf(stderr,"dbg5       sec:              %d\n",data->par_second);
-		fprintf(stderr,"dbg5       hundredth_sec:    %d\n",data->par_hundredth_sec);
-		fprintf(stderr,"dbg5       thousandth_sec:   %d\n",data->par_thousandth_sec);
-		fprintf(stderr,"dbg5       roll_offset:      %d\n",data->roll_offset);
-		fprintf(stderr,"dbg5       pitch_offset:     %d\n",data->pitch_offset);
-		fprintf(stderr,"dbg5       heading_offset:   %d\n",data->heading_offset);
-		fprintf(stderr,"dbg5       time_delay:       %d\n",data->time_delay);
-		fprintf(stderr,"dbg5       transducer_port_height: %d\n",
-			data->transducer_port_height);
-		fprintf(stderr,"dbg5       transducer_starboard_height:%d\n",
-			data->transducer_starboard_height);
-		fprintf(stderr,"dbg5       transducer_port_depth:     %d\n",
-			data->transducer_port_depth);
-		fprintf(stderr,"dbg5       transducer_starboard_depth:     %d\n",
-			data->transducer_starboard_depth);
-		fprintf(stderr,"dbg5       transducer_port_x:        %d\n",
-			data->transducer_port_x);
-		fprintf(stderr,"dbg5       transducer_starboard_x:        %d\n",
-			data->transducer_starboard_x);
-		fprintf(stderr,"dbg5       transducer_port_y:        %d\n",
-			data->transducer_port_y);
-		fprintf(stderr,"dbg5       transducer_starboard_y:  %d\n",
-			data->transducer_starboard_y);
-		fprintf(stderr,"dbg5       transducer_port_error:  %d\n",
-			data->transducer_port_error);
-		fprintf(stderr,"dbg5       transducer_starboard_error:  %d\n",
-			data->transducer_starboard_error);
-		fprintf(stderr,"dbg5       antenna_height:            %d\n",data->antenna_height);
-		fprintf(stderr,"dbg5       antenna_x:      %d\n",data->antenna_x);
-		fprintf(stderr,"dbg5       antenna_y:    %d\n",data->antenna_y);
-		fprintf(stderr,"dbg5       vru_height:%d\n",data->vru_height);
-		fprintf(stderr,"dbg5       vru_x:%d\n",data->vru_x);
-		fprintf(stderr,"dbg5       vru_y:%d\n",data->vru_y);
-		fprintf(stderr,"dbg5       line_number:%d\n",data->line_number);
-		fprintf(stderr,"dbg5       start_or_stop:%d\n",data->start_or_stop);
-		fprintf(stderr,"dbg5       transducer_serial_number:%d\n",
-			data->transducer_serial_number);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_elmk2unb_rd_pos(int verbose, FILE *mbfp,
-		struct mbf_elmk2unb_struct *data, int *error)
-{
-	char	*function_name = "mbr_elmk2unb_rd_pos";
-	int	status = MB_SUCCESS;
-	char	line[ELACMK2_POS_SIZE+3];
-	short int *short_ptr;
-	int	*int_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       data:       %p\n",(void *)data);
-		}
-
-	/* read record into char array */
-	status = fread(line,1,ELACMK2_POS_SIZE+3,mbfp);
-	if (status == ELACMK2_POS_SIZE+3)
-		status = MB_SUCCESS;
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	/* get data */
-	if (status == MB_SUCCESS)
-		{
-		data->kind = MB_DATA_NAV;
-		data->pos_day =            (int) line[0];
-		data->pos_month =          (int) line[1];
-		data->pos_year =           (int) line[2];
-		data->pos_hour =           (int) line[3];
-		data->pos_minute =         (int) line[4];
-		data->pos_second =         (int) line[5];
-		data->pos_hundredth_sec =  (int) line[6];
-		data->pos_thousandth_sec = (int) line[7];
-#ifndef BYTESWAPPED
-		int_ptr = (int *) &line[8];
-		data->pos_latitude = *int_ptr;
-		int_ptr = (int *) &line[12];
-		data->pos_longitude = *int_ptr;
-		int_ptr = (int *) &line[16];
-		data->utm_northing = *int_ptr;
-		int_ptr = (int *) &line[20];
-		data->utm_easting = *int_ptr;
-		int_ptr = (int *) &line[24];
-		data->utm_zone_lon = *int_ptr;
-		data->utm_zone = line[28];
-		data->hemisphere = line[29];
-		data->ellipsoid = line[30];
-		data->pos_spare = line[31];
-		short_ptr = (short int *) &line[32];
-		data->semi_major_axis = (int) *short_ptr;
-		short_ptr = (short int *) &line[34];
-		data->other_quality = (int) *short_ptr;
-#else
-		int_ptr = (int *) &line[8];
-		data->pos_latitude = (int) mb_swap_int(*int_ptr);
-		int_ptr = (int *) &line[12];
-		data->pos_longitude = (int) mb_swap_int(*int_ptr);
-		int_ptr = (int *) &line[16];
-		data->utm_northing = (int) mb_swap_int(*int_ptr);
-		int_ptr = (int *) &line[20];
-		data->utm_easting = (int) mb_swap_int(*int_ptr);
-		int_ptr = (int *) &line[24];
-		data->utm_zone_lon = (int) mb_swap_int(*int_ptr);
-		data->utm_zone = line[28];
-		data->hemisphere = line[29];
-		data->ellipsoid = line[30];
-		data->pos_spare = line[31];
-		short_ptr = (short int *) &line[32];
-		data->semi_major_axis = (int) mb_swap_short(*short_ptr);
-		short_ptr = (short int *) &line[34];
-		data->other_quality = (int) mb_swap_short(*short_ptr);
-#endif
-		}
-
-	/* KLUGE for 1996 UNB TRAINING COURSE - FLIP LONGITUDE */
-	if (data->pos_year == 96
-	    && data->pos_month >= 6
-	    && data->pos_month <= 8)
-		data->pos_longitude = -data->pos_longitude;
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       year:             %d\n",data->pos_year);
-		fprintf(stderr,"dbg5       month:            %d\n",data->pos_month);
-		fprintf(stderr,"dbg5       day:              %d\n",data->pos_day);
-		fprintf(stderr,"dbg5       hour:             %d\n",data->pos_hour);
-		fprintf(stderr,"dbg5       minute:           %d\n",data->pos_minute);
-		fprintf(stderr,"dbg5       sec:              %d\n",data->pos_second);
-		fprintf(stderr,"dbg5       hundredth_sec:    %d\n",data->pos_hundredth_sec);
-		fprintf(stderr,"dbg5       thousandth_sec:   %d\n",data->pos_thousandth_sec);
-		fprintf(stderr,"dbg5       pos_latitude:     %d\n",data->pos_latitude);
-		fprintf(stderr,"dbg5       pos_longitude:    %d\n",data->pos_longitude);
-		fprintf(stderr,"dbg5       utm_northing:     %d\n",data->utm_northing);
-		fprintf(stderr,"dbg5       utm_easting:      %d\n",data->utm_easting);
-		fprintf(stderr,"dbg5       utm_zone_lon:     %d\n",data->utm_zone_lon);
-		fprintf(stderr,"dbg5       utm_zone:         %c\n",data->utm_zone);
-		fprintf(stderr,"dbg5       hemisphere:       %c\n",data->hemisphere);
-		fprintf(stderr,"dbg5       ellipsoid:        %c\n",data->ellipsoid);
-		fprintf(stderr,"dbg5       pos_spare:        %c\n",data->pos_spare);
-		fprintf(stderr,"dbg5       semi_major_axis:  %d\n",data->semi_major_axis);
-		fprintf(stderr,"dbg5       other_quality:    %d\n",data->other_quality);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_elmk2unb_rd_svp(int verbose, FILE *mbfp,
-		struct mbf_elmk2unb_struct *data, int *error)
-{
-	char	*function_name = "mbr_elmk2unb_rd_svp";
-	int	status = MB_SUCCESS;
-	char	line[ELACMK2_SVP_SIZE+3];
-	short int *short_ptr;
-	short int *short_ptr2;
-	int	*int_ptr;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       data:       %p\n",(void *)data);
-		}
-
-	/* read record into char array */
-	status = fread(line,1,ELACMK2_SVP_SIZE+3,mbfp);
-	if (status == ELACMK2_SVP_SIZE+3)
-		status = MB_SUCCESS;
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	/* get data */
-	if (status == MB_SUCCESS)
-		{
-		data->kind = MB_DATA_VELOCITY_PROFILE;
-		data->svp_day =            (int) line[0];
-		data->svp_month =          (int) line[1];
-		data->svp_year =           (int) line[2];
-		data->svp_hour =           (int) line[3];
-		data->svp_minute =         (int) line[4];
-		data->svp_second =         (int) line[5];
-		data->svp_hundredth_sec =  (int) line[6];
-		data->svp_thousandth_sec = (int) line[7];
-#ifndef BYTESWAPPED
-		int_ptr = (int *) &line[8];
-		data->svp_latitude = *int_ptr;
-		int_ptr = (int *) &line[12];
-		data->svp_longitude = *int_ptr;
-#else
-		int_ptr = (int *) &line[8];
-		data->svp_latitude = (int) mb_swap_int(*int_ptr);
-		int_ptr = (int *) &line[12];
-		data->svp_latitude = (int) mb_swap_int(*int_ptr);
-#endif
-		data->svp_num = 0;
-		for (i=0;i<500;i++)
-			{
-			short_ptr = (short int *) &line[16+4*i];
-			short_ptr2 = (short int *) &line[18+4*i];
-#ifndef BYTESWAPPED
-			data->svp_depth[i] = *short_ptr;
-			data->svp_vel[i] = *short_ptr2;
-#else
-			data->svp_depth[i] = (short int) mb_swap_short(*short_ptr);
-			data->svp_vel[i] = (short int) mb_swap_short(*short_ptr2);
-#endif
-			if (data->svp_vel[i] > 0) data->svp_num = i + 1;
-			}
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       year:             %d\n",data->svp_year);
-		fprintf(stderr,"dbg5       month:            %d\n",data->svp_month);
-		fprintf(stderr,"dbg5       day:              %d\n",data->svp_day);
-		fprintf(stderr,"dbg5       hour:             %d\n",data->svp_hour);
-		fprintf(stderr,"dbg5       minute:           %d\n",data->svp_minute);
-		fprintf(stderr,"dbg5       sec:              %d\n",data->svp_second);
-		fprintf(stderr,"dbg5       hundredth_sec:    %d\n",data->svp_hundredth_sec);
-		fprintf(stderr,"dbg5       thousandth_sec:   %d\n",data->svp_thousandth_sec);
-		fprintf(stderr,"dbg5       svp_latitude:     %d\n",data->svp_latitude);
-		fprintf(stderr,"dbg5       svp_longitude:    %d\n",data->svp_longitude);
-		fprintf(stderr,"dbg5       svp_num:          %d\n",data->svp_num);
-		for (i=0;i<data->svp_num;i++)
-			fprintf(stderr,"dbg5       depth: %d     vel: %d\n",
-				data->svp_depth[i],data->svp_vel[i]);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_elmk2unb_rd_bathgen(int verbose, FILE *mbfp,
-		struct mbf_elmk2unb_struct *data, int *error)
-{
-	char	*function_name = "mbr_elmk2unb_rd_bathgen";
-	int	status = MB_SUCCESS;
-	char	line[ELACMK2_COMMENT_SIZE];
-	short int *short_ptr;
-	int	*int_ptr;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       data:       %p\n",(void *)data);
-		}
-
-	/* read record into char array */
-	status = fread(line,1,ELACMK2_BATHGEN_HDR_SIZE,mbfp);
-	if (status == ELACMK2_BATHGEN_HDR_SIZE)
-		status = MB_SUCCESS;
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	/* get data */
-	if (status == MB_SUCCESS)
-		{
-		data->kind = MB_DATA_DATA;
-
-		data->day =            (int) line[0];
-		data->month =          (int) line[1];
-		data->year =           (int) line[2];
-		data->hour =           (int) line[3];
-		data->minute =         (int) line[4];
-		data->second =         (int) line[5];
-		data->hundredth_sec =  (int) line[6];
-		data->thousandth_sec = (int) line[7];
-#ifndef BYTESWAPPED
-		short_ptr = (short int *) &line[8];
-		data->ping_num = (int) (unsigned short) *short_ptr;
-		short_ptr = (short int *) &line[10];
-		data->sound_vel = (int) (unsigned short) *short_ptr;
-		short_ptr = (short int *) &line[12];
-		data->heading = (int) (unsigned short) *short_ptr;
-		short_ptr = (short int *) &line[14];
-		data->pulse_length = (int) (unsigned short) *short_ptr;
-#else
-		short_ptr = (short int *) &line[8];
-		data->ping_num = (int) (unsigned short) mb_swap_short(*short_ptr);
-		short_ptr = (short int *) &line[10];
-		data->sound_vel = (int) (unsigned short) mb_swap_short(*short_ptr);
-		short_ptr = (short int *) &line[12];
-		data->heading = (int) (unsigned short) mb_swap_short(*short_ptr);
-		short_ptr = (short int *) &line[14];
-		data->pulse_length = (int) (unsigned short) mb_swap_short(*short_ptr);
-#endif
-		data->mode = (int) line[16];
-		data->source_power = (int) line[17];
-		data->receiver_gain_stbd = (int) line[18];
-		data->receiver_gain_port = (int) line[19];
-#ifndef BYTESWAPPED
-		short_ptr = (short int *) &line[20];
-		data->reserved = (int) *short_ptr;
-		short_ptr = (short int *) &line[22];
-		data->beams_bath = (int) *short_ptr;
-#else
-		short_ptr = (short int *) &line[20];
-		data->reserved = (int) mb_swap_short(*short_ptr);
-		short_ptr = (short int *) &line[22];
-		data->beams_bath = (int) mb_swap_short(*short_ptr);
-#endif
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       year:             %d\n",
-			data->year);
-		fprintf(stderr,"dbg5       month:            %d\n",
-			data->month);
-		fprintf(stderr,"dbg5       day:              %d\n",
-			data->day);
-		fprintf(stderr,"dbg5       hour:             %d\n",
-			data->hour);
-		fprintf(stderr,"dbg5       minute:           %d\n",
-			data->minute);
-		fprintf(stderr,"dbg5       sec:              %d\n",
-			data->second);
-		fprintf(stderr,"dbg5       hundredth_sec:    %d\n",
-			data->hundredth_sec);
-		fprintf(stderr,"dbg5       thousandth_sec:   %d\n",
-			data->thousandth_sec);
-		fprintf(stderr,"dbg5       ping_num:         %d\n",data->ping_num);
-		fprintf(stderr,"dbg5       sound_vel:        %d\n",data->sound_vel);
-		fprintf(stderr,"dbg5       heading:          %d\n",data->heading);
-		fprintf(stderr,"dbg5       pulse_length:     %d\n",
-			data->pulse_length);
-		fprintf(stderr,"dbg5       mode:             %d\n",data->mode);
-		fprintf(stderr,"dbg5       source_power:     %d\n",
-			data->source_power);
-		fprintf(stderr,"dbg5       receiver_gain_stbd:%d\n",
-			data->receiver_gain_stbd);
-		fprintf(stderr,"dbg5       receiver_gain_port:%d\n",
-			data->receiver_gain_port);
-		fprintf(stderr,"dbg5       reserved:         %d\n",
-			data->reserved);
-		fprintf(stderr,"dbg5       beams_bath:       %d\n",
-			data->beams_bath);
-		}
-
-	/* now read each of the beams */
-	if (status == MB_SUCCESS)
-		{
-		for (i=0;i<data->beams_bath;i++)
-		    {
-		    /* read record into char array */
-		    status = fread(line,1,ELACMK2_BATHGEN_BEAM_SIZE,mbfp);
-		    if (status == ELACMK2_BATHGEN_BEAM_SIZE)
-			status = MB_SUCCESS;
-		    else
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_EOF;
-			}
-		    /* get data */
-		    if (status == MB_SUCCESS)
-			{
-#ifndef BYTESWAPPED
-			int_ptr = (int *) &line[0];
-			data->beams[i].bath = (unsigned int) *int_ptr;
-			int_ptr = (int *) &line[4];
-			data->beams[i].bath_acrosstrack = (int) *int_ptr;
-			int_ptr = (int *) &line[8];
-			data->beams[i].bath_alongtrack = (int) *int_ptr;
-			int_ptr = (int *) &line[12];
-			data->beams[i].tt = (unsigned int) *int_ptr;
-#else
-			int_ptr = (int *) &line[0];
-			data->beams[i].bath = (unsigned int)
-					mb_swap_int(*int_ptr);
-			int_ptr = (int *) &line[4];
-			data->beams[i].bath_acrosstrack = (int)
-					mb_swap_int(*int_ptr);
-			int_ptr = (int *) &line[8];
-			data->beams[i].bath_alongtrack = (int)
-					mb_swap_int(*int_ptr);
-			int_ptr = (int *) &line[12];
-			data->beams[i].tt = (unsigned int)
-					mb_swap_int(*int_ptr);
-#endif
-			data->beams[i].quality = line[16];
-			if (data->beams[i].quality <= 0)
-			    data->beams[i].quality = 8;
-			data->beams[i].amplitude
-				= (int) ((mb_s_char) line[17] + 128);
-#ifndef BYTESWAPPED
-			short_ptr = (short *) &line[18];
-			data->beams[i].time_offset = (unsigned short)
-				*short_ptr;
-			short_ptr = (short *) &line[20];
-			data->beams[i].heave = (short) *short_ptr;
-			short_ptr = (short *) &line[22];
-			data->beams[i].roll = (short) *short_ptr;
-			short_ptr = (short *) &line[24];
-			data->beams[i].pitch = (short) *short_ptr;
-			short_ptr = (short *) &line[26];
-			data->beams[i].angle = (short) *short_ptr;
-#else
-			short_ptr = (short *) &line[18];
-			data->beams[i].time_offset = (unsigned short)
-				mb_swap_short(*short_ptr);
-			short_ptr = (short *) &line[20];
-			data->beams[i].heave = (short)
-				mb_swap_short(*short_ptr);
-			short_ptr = (short *) &line[22];
-			data->beams[i].roll = (short)
-				mb_swap_short(*short_ptr);
-			short_ptr = (short *) &line[24];
-			data->beams[i].pitch = (short)
-				mb_swap_short(*short_ptr);
-			short_ptr = (short *) &line[26];
-			data->beams[i].angle = (short)
-				mb_swap_short(*short_ptr);
-#endif
-			}
-
-		    /* print debug statements */
-		    if (status == MB_SUCCESS
-			&& verbose >= 5)
-			{
-			fprintf(stderr,"\ndbg5       beam:             %d\n",
-				i);
-			fprintf(stderr,"dbg5       bath:             %d\n",
-				data->beams[i].bath);
-			fprintf(stderr,"dbg5       bath_acrosstrack: %d\n",
-				data->beams[i].bath_acrosstrack);
-			fprintf(stderr,"dbg5       bath_alongtrack: %d\n",
-				data->beams[i].bath_alongtrack);
-			fprintf(stderr,"dbg5       tt:              %d\n",
-				data->beams[i].tt);
-			fprintf(stderr,"dbg5       quality:         %d\n",
-				data->beams[i].quality);
-			fprintf(stderr,"dbg5       amplitude:       %d\n",
-				data->beams[i].amplitude);
-			fprintf(stderr,"dbg5       time_offset:     %d\n",
-				data->beams[i].time_offset);
-			fprintf(stderr,"dbg5       heave:           %d\n",
-				data->beams[i].heave);
-			fprintf(stderr,"dbg5       roll:            %d\n",
-				data->beams[i].roll);
-			fprintf(stderr,"dbg5       pitch:           %d\n",
-				data->beams[i].pitch);
-			fprintf(stderr,"dbg5       angle:           %d\n",
-				data->beams[i].angle);
-			}
-		    }
-		}
-
-	/* read end of record into char array */
-	status = fread(line,1,3,mbfp);
-	if (status == 3)
-		status = MB_SUCCESS;
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_elmk2unb_wr_data(int verbose, void *mbio_ptr, void *data_ptr, int *error)
-{
-	char	*function_name = "mbr_elmk2unb_wr_data";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_elmk2unb_struct *data;
-	FILE	*mbfp;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       data_ptr:   %p\n",(void *)data_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_elmk2unb_struct *) data_ptr;
-	mbfp = mb_io_ptr->mbfp;
-
-	if (data->kind == MB_DATA_COMMENT)
-		{
-		status = mbr_elmk2unb_wr_comment(verbose,mbfp,data,error);
-		}
-	else if (data->kind == MB_DATA_PARAMETER)
-		{
-		status = mbr_elmk2unb_wr_parameter(verbose,mbfp,data,error);
-		}
-	else if (data->kind == MB_DATA_NAV)
-		{
-		status = mbr_elmk2unb_wr_pos(verbose,mbfp,data,error);
-		}
-	else if (data->kind == MB_DATA_VELOCITY_PROFILE)
-		{
-		status = mbr_elmk2unb_wr_svp(verbose,mbfp,data,error);
-		}
-	else if (data->kind == MB_DATA_DATA)
-		{
-		status = mbr_elmk2unb_wr_bathgen(verbose,mbfp,data,error);
-		}
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_BAD_KIND;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Data record kind in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       kind:       %d\n",data->kind);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_elmk2unb_wr_comment(int verbose, FILE *mbfp, void *data_ptr, int *error)
-{
-	char	*function_name = "mbr_elmk2unb_wr_comment";
-	int	status = MB_SUCCESS;
-	struct mbf_elmk2unb_struct *data;
-	char	line[ELACMK2_COMMENT_SIZE+3];
-	short int label;
-	int	len;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       data_ptr:   %p\n",(void *)data_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_elmk2unb_struct *) data_ptr;
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       comment:          %s\n",data->comment);
-		}
-
-	/* write the record label */
-	label = ELACMK2_COMMENT;
-#ifdef BYTESWAPPED
-	label = (short) mb_swap_short(label);
-#endif
-	status = fwrite(&label,1,2,mbfp);
-	if (status != 2)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	else
-		status = MB_SUCCESS;
-
-	/* write out the data */
-	if (status == MB_SUCCESS)
-		{
-		/* construct record */
-		len = strlen(data->comment);
-		if (len > MBSYS_ELACMK2_COMMENT_LENGTH)
-			len = MBSYS_ELACMK2_COMMENT_LENGTH;
-		for (i=0;i<len;i++)
-			line[i] = data->comment[i];
-		for (i=len;i<MBSYS_ELACMK2_COMMENT_LENGTH;i++)
-			line[i] = '\0';
-		line[ELACMK2_COMMENT_SIZE] = 0x03;
-		line[ELACMK2_COMMENT_SIZE+1] = '\0';
-		line[ELACMK2_COMMENT_SIZE+2] = '\0';
-
-		/* write out data */
-		status = fwrite(line,1,ELACMK2_COMMENT_SIZE+3,mbfp);
-		if (status != ELACMK2_COMMENT_SIZE+3)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_elmk2unb_wr_parameter(int verbose, FILE *mbfp, void *data_ptr, int *error)
-{
-	char	*function_name = "mbr_elmk2unb_wr_parameter";
-	int	status = MB_SUCCESS;
-	struct mbf_elmk2unb_struct *data;
-	char	line[ELACMK2_PARAMETER_SIZE+3];
-	short int label;
-	short int *short_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       data_ptr:   %p\n",(void *)data_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_elmk2unb_struct *) data_ptr;
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       year:             %d\n",data->par_year);
-		fprintf(stderr,"dbg5       month:            %d\n",data->par_month);
-		fprintf(stderr,"dbg5       day:              %d\n",data->par_day);
-		fprintf(stderr,"dbg5       hour:             %d\n",data->par_hour);
-		fprintf(stderr,"dbg5       minute:           %d\n",data->par_minute);
-		fprintf(stderr,"dbg5       sec:              %d\n",data->par_second);
-		fprintf(stderr,"dbg5       hundredth_sec:    %d\n",data->par_hundredth_sec);
-		fprintf(stderr,"dbg5       thousandth_sec:   %d\n",data->par_thousandth_sec);
-		fprintf(stderr,"dbg5       roll_offset:      %d\n",data->roll_offset);
-		fprintf(stderr,"dbg5       pitch_offset:     %d\n",data->pitch_offset);
-		fprintf(stderr,"dbg5       heading_offset:   %d\n",data->heading_offset);
-		fprintf(stderr,"dbg5       time_delay:       %d\n",data->time_delay);
-		fprintf(stderr,"dbg5       transducer_port_height: %d\n",
-			data->transducer_port_height);
-		fprintf(stderr,"dbg5       transducer_starboard_height:%d\n",
-			data->transducer_starboard_height);
-		fprintf(stderr,"dbg5       transducer_port_depth:     %d\n",
-			data->transducer_port_depth);
-		fprintf(stderr,"dbg5       transducer_starboard_depth:     %d\n",
-			data->transducer_starboard_depth);
-		fprintf(stderr,"dbg5       transducer_port_x:        %d\n",
-			data->transducer_port_x);
-		fprintf(stderr,"dbg5       transducer_starboard_x:        %d\n",
-			data->transducer_starboard_x);
-		fprintf(stderr,"dbg5       transducer_port_y:        %d\n",
-			data->transducer_port_y);
-		fprintf(stderr,"dbg5       transducer_starboard_y:  %d\n",
-			data->transducer_starboard_y);
-		fprintf(stderr,"dbg5       transducer_port_error:  %d\n",
-			data->transducer_port_error);
-		fprintf(stderr,"dbg5       transducer_starboard_error:  %d\n",
-			data->transducer_starboard_error);
-		fprintf(stderr,"dbg5       antenna_height:            %d\n",data->antenna_height);
-		fprintf(stderr,"dbg5       antenna_x:      %d\n",data->antenna_x);
-		fprintf(stderr,"dbg5       antenna_y:    %d\n",data->antenna_y);
-		fprintf(stderr,"dbg5       vru_height:%d\n",data->vru_height);
-		fprintf(stderr,"dbg5       vru_x:%d\n",data->vru_x);
-		fprintf(stderr,"dbg5       vru_y:%d\n",data->vru_y);
-		fprintf(stderr,"dbg5       line_number:%d\n",data->line_number);
-		fprintf(stderr,"dbg5       start_or_stop:%d\n",data->start_or_stop);
-		fprintf(stderr,"dbg5       transducer_serial_number:%d\n",
-			data->transducer_serial_number);
-		}
-
-	/* write the record label */
-	label = ELACMK2_PARAMETER;
-#ifdef BYTESWAPPED
-	label = (short) mb_swap_short(label);
-#endif
-	status = fwrite(&label,1,2,mbfp);
-	if (status != 2)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	else
-		status = MB_SUCCESS;
-
-	/* write out the data */
-	if (status == MB_SUCCESS)
-		{
-		/* construct record */
-		line[0] = (char) data->par_day;
-		line[1] = (char) data->par_month;
-		line[2] = (char) data->par_year;
-		line[3] = (char) data->par_hour;
-		line[4] = (char) data->par_minute;
-		line[5] = (char) data->par_second;
-		line[6] = (char) data->par_hundredth_sec;
-		line[7] = (char) data->par_thousandth_sec;
-#ifndef BYTESWAPPED
-		short_ptr = (short int *) &line[8];
-		*short_ptr = data->roll_offset;
-		short_ptr = (short int *) &line[10];
-		*short_ptr = data->pitch_offset;
-		short_ptr = (short int *) &line[12];
-		*short_ptr = data->heading_offset;
-		short_ptr = (short int *) &line[14];
-		*short_ptr = data->time_delay;
-		short_ptr = (short int *) &line[16];
-		*short_ptr = data->transducer_port_height;
-		short_ptr = (short int *) &line[18];
-		*short_ptr = data->transducer_starboard_height;
-		short_ptr = (short int *) &line[20];
-		*short_ptr = data->transducer_port_depth;
-		short_ptr = (short int *) &line[22];
-		*short_ptr = data->transducer_starboard_depth;
-		short_ptr = (short int *) &line[24];
-		*short_ptr = data->transducer_port_x;
-		short_ptr = (short int *) &line[26];
-		*short_ptr = data->transducer_starboard_x;
-		short_ptr = (short int *) &line[28];
-		*short_ptr = data->transducer_port_y;
-		short_ptr = (short int *) &line[30];
-		*short_ptr = data->transducer_starboard_y;
-		short_ptr = (short int *) &line[32];
-		*short_ptr = data->transducer_port_error;
-		short_ptr = (short int *) &line[34];
-		*short_ptr = data->transducer_starboard_error;
-		short_ptr = (short int *) &line[36];
-		*short_ptr = data->antenna_height;
-		short_ptr = (short int *) &line[38];
-		*short_ptr = data->antenna_x;
-		short_ptr = (short int *) &line[40];
-		*short_ptr = data->antenna_y;
-		short_ptr = (short int *) &line[42];
-		*short_ptr = data->vru_height;
-		short_ptr = (short int *) &line[44];
-		*short_ptr = data->vru_x;
-		short_ptr = (short int *) &line[46];
-		*short_ptr = data->vru_y;
-		short_ptr = (short int *) &line[48];
-		*short_ptr = data->line_number;
-		short_ptr = (short int *) &line[50];
-		*short_ptr = data->start_or_stop;
-		short_ptr = (short int *) &line[52];
-		*short_ptr = data->transducer_serial_number;
-#else
-		short_ptr = (short int *) &line[8];
-		*short_ptr = (short int) mb_swap_short(data->roll_offset);
-		short_ptr = (short int *) &line[10];
-		*short_ptr = (short int) mb_swap_short(data->pitch_offset);
-		short_ptr = (short int *) &line[12];
-		*short_ptr = (short int) mb_swap_short(data->heading_offset);
-		short_ptr = (short int *) &line[14];
-		*short_ptr = (short int) mb_swap_short(data->time_delay);
-		short_ptr = (short int *) &line[16];
-		*short_ptr = (short int)
-			mb_swap_short(data->transducer_port_height);
-		short_ptr = (short int *) &line[18];
-		*short_ptr = (short int)
-			mb_swap_short(data->transducer_starboard_height);
-		short_ptr = (short int *) &line[20];
-		*short_ptr = (short int) mb_swap_short(data->transducer_port_depth);
-		short_ptr = (short int *) &line[22];
-		*short_ptr = (short int)
-			mb_swap_short(data->transducer_starboard_depth);
-		short_ptr = (short int *) &line[24];
-		*short_ptr = (short int) mb_swap_short(data->transducer_port_x);
-		short_ptr = (short int *) &line[26];
-		*short_ptr = (short int)
-			mb_swap_short(data->transducer_starboard_x);
-		short_ptr = (short int *) &line[28];
-		*short_ptr = (short int) mb_swap_short(data->transducer_port_y);
-		short_ptr = (short int *) &line[30];
-		*short_ptr = (short int)
-			mb_swap_short(data->transducer_starboard_y);
-		short_ptr = (short int *) &line[32];
-		*short_ptr = (short int) mb_swap_short(data->transducer_port_error);
-		short_ptr = (short int *) &line[34];
-		*short_ptr = (short int)
-			mb_swap_short(data->transducer_starboard_error);
-		short_ptr = (short int *) &line[36];
-		*short_ptr = (short int) mb_swap_short(data->antenna_height);
-		short_ptr = (short int *) &line[38];
-		*short_ptr = (short int) mb_swap_short(data->antenna_x);
-		short_ptr = (short int *) &line[40];
-		*short_ptr = (short int) mb_swap_short(data->antenna_y);
-		short_ptr = (short int *) &line[42];
-		*short_ptr = (short int) mb_swap_short(data->vru_height);
-		short_ptr = (short int *) &line[44];
-		*short_ptr = (short int) mb_swap_short(data->vru_x);
-		short_ptr = (short int *) &line[46];
-		*short_ptr = (short int) mb_swap_short(data->vru_y);
-		short_ptr = (short int *) &line[48];
-		*short_ptr = (short int) mb_swap_short(data->line_number);
-		short_ptr = (short int *) &line[50];
-		*short_ptr = (short int) mb_swap_short(data->start_or_stop);
-		short_ptr = (short int *) &line[52];
-		*short_ptr = (short int)
-			mb_swap_short(data->transducer_serial_number);
-#endif
-		line[ELACMK2_PARAMETER_SIZE] = 0x03;
-		line[ELACMK2_PARAMETER_SIZE+1] = '\0';
-		line[ELACMK2_PARAMETER_SIZE+2] = '\0';
-
-		/* write out data */
-		status = fwrite(line,1,ELACMK2_PARAMETER_SIZE+3,mbfp);
-		if (status != ELACMK2_PARAMETER_SIZE+3)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_elmk2unb_wr_pos(int verbose, FILE *mbfp, void *data_ptr, int *error)
-{
-	char	*function_name = "mbr_elmk2unb_wr_pos";
-	int	status = MB_SUCCESS;
-	struct mbf_elmk2unb_struct *data;
-	char	line[ELACMK2_POS_SIZE+3];
-	short int label;
-	short int *short_ptr;
-	int	*int_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       data_ptr:   %p\n",(void *)data_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_elmk2unb_struct *) data_ptr;
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       year:             %d\n",data->pos_year);
-		fprintf(stderr,"dbg5       month:            %d\n",data->pos_month);
-		fprintf(stderr,"dbg5       day:              %d\n",data->pos_day);
-		fprintf(stderr,"dbg5       hour:             %d\n",data->pos_hour);
-		fprintf(stderr,"dbg5       minute:           %d\n",data->pos_minute);
-		fprintf(stderr,"dbg5       sec:              %d\n",data->pos_second);
-		fprintf(stderr,"dbg5       hundredth_sec:    %d\n",data->pos_hundredth_sec);
-		fprintf(stderr,"dbg5       thousandth_sec:   %d\n",data->pos_thousandth_sec);
-		fprintf(stderr,"dbg5       pos_latitude:     %d\n",data->pos_latitude);
-		fprintf(stderr,"dbg5       pos_longitude:    %d\n",data->pos_longitude);
-		fprintf(stderr,"dbg5       utm_northing:     %d\n",data->utm_northing);
-		fprintf(stderr,"dbg5       utm_easting:      %d\n",data->utm_easting);
-		fprintf(stderr,"dbg5       utm_zone_lon:     %d\n",data->utm_zone_lon);
-		fprintf(stderr,"dbg5       utm_zone:         %c\n",data->utm_zone);
-		fprintf(stderr,"dbg5       hemisphere:       %c\n",data->hemisphere);
-		fprintf(stderr,"dbg5       ellipsoid:        %c\n",data->ellipsoid);
-		fprintf(stderr,"dbg5       pos_spare:        %c\n",data->pos_spare);
-		fprintf(stderr,"dbg5       semi_major_axis:  %d\n",data->semi_major_axis);
-		fprintf(stderr,"dbg5       other_quality:    %d\n",data->other_quality);
-		}
-
-	/* write the record label */
-	label = ELACMK2_POS;
-#ifdef BYTESWAPPED
-	label = (short) mb_swap_short(label);
-#endif
-	status = fwrite(&label,1,2,mbfp);
-	if (status != 2)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	else
-		status = MB_SUCCESS;
-
-	/* write out the data */
-	if (status == MB_SUCCESS)
-		{
-		/* construct record */
-		line[0] = (char) data->pos_day;
-		line[1] = (char) data->pos_month;
-		line[2] = (char) data->pos_year;
-		line[3] = (char) data->pos_hour;
-		line[4] = (char) data->pos_minute;
-		line[5] = (char) data->pos_second;
-		line[6] = (char) data->pos_hundredth_sec;
-		line[7] = (char) data->pos_thousandth_sec;
-#ifndef BYTESWAPPED
-		int_ptr = (int *) &line[8];
-		*int_ptr = data->pos_latitude;
-		int_ptr = (int *) &line[12];
-		*int_ptr = data->pos_longitude;
-		int_ptr = (int *) &line[16];
-		*int_ptr = data->utm_northing;
-		int_ptr = (int *) &line[20];
-		*int_ptr = data->utm_easting;
-		int_ptr = (int *) &line[24];
-		*int_ptr = data->utm_zone_lon;
-		line[28] = data->utm_zone;
-		line[29] = data->hemisphere;
-		line[30] = data->ellipsoid;
-		line[31] = data->pos_spare;
-		short_ptr = (short int *) &line[32];
-		*short_ptr = (short int) data->semi_major_axis;
-		short_ptr = (short int *) &line[34];
-		*short_ptr = (short int) data->other_quality;
-#else
-		int_ptr = (int *) &line[8];
-		*int_ptr = (int) mb_swap_int(data->pos_latitude);
-		int_ptr = (int *) &line[12];
-		*int_ptr = (int) mb_swap_int(data->pos_longitude);
-		int_ptr = (int *) &line[16];
-		*int_ptr = (int) mb_swap_int(data->utm_northing);
-		int_ptr = (int *) &line[20];
-		*int_ptr = (int) mb_swap_int(data->utm_easting);
-		int_ptr = (int *) &line[24];
-		*int_ptr = (int) mb_swap_int(data->utm_zone_lon);
-		line[28] = data->utm_zone;
-		line[29] = data->hemisphere;
-		line[30] = data->ellipsoid;
-		line[31] = data->pos_spare;
-		short_ptr = (short int *) &line[32];
-		*short_ptr = (int) mb_swap_short(data->semi_major_axis);
-		short_ptr = (short int *) &line[34];
-		*short_ptr = (int) mb_swap_short(data->other_quality);
-#endif
-		line[ELACMK2_POS_SIZE] = 0x03;
-		line[ELACMK2_POS_SIZE+1] = '\0';
-		line[ELACMK2_POS_SIZE+2] = '\0';
-
-		/* write out data */
-		status = fwrite(line,1,ELACMK2_POS_SIZE+3,mbfp);
-		if (status != ELACMK2_POS_SIZE+3)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_elmk2unb_wr_svp(int verbose, FILE *mbfp, void *data_ptr, int *error)
-{
-	char	*function_name = "mbr_elmk2unb_wr_svp";
-	int	status = MB_SUCCESS;
-	struct mbf_elmk2unb_struct *data;
-	char	line[ELACMK2_SVP_SIZE+3];
-	short int label;
-	short int *short_ptr;
-	short int *short_ptr2;
-	int	*int_ptr;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       data_ptr:   %p\n",(void *)data_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_elmk2unb_struct *) data_ptr;
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       year:             %d\n",data->svp_year);
-		fprintf(stderr,"dbg5       month:            %d\n",data->svp_month);
-		fprintf(stderr,"dbg5       day:              %d\n",data->svp_day);
-		fprintf(stderr,"dbg5       hour:             %d\n",data->svp_hour);
-		fprintf(stderr,"dbg5       minute:           %d\n",data->svp_minute);
-		fprintf(stderr,"dbg5       sec:              %d\n",data->svp_second);
-		fprintf(stderr,"dbg5       hundredth_sec:    %d\n",data->svp_hundredth_sec);
-		fprintf(stderr,"dbg5       thousandth_sec:   %d\n",data->svp_thousandth_sec);
-		fprintf(stderr,"dbg5       svp_latitude:     %d\n",data->svp_latitude);
-		fprintf(stderr,"dbg5       svp_longitude:    %d\n",data->svp_longitude);
-		fprintf(stderr,"dbg5       svp_num:          %d\n",data->svp_num);
-		for (i=0;i<data->svp_num;i++)
-			fprintf(stderr,"dbg5       depth: %d     vel: %d\n",
-				data->svp_depth[i],data->svp_vel[i]);
-		}
-
-	/* write the record label */
-	label = ELACMK2_SVP;
-#ifdef BYTESWAPPED
-	label = (short) mb_swap_short(label);
-#endif
-	status = fwrite(&label,1,2,mbfp);
-	if (status != 2)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	else
-		status = MB_SUCCESS;
-
-	/* write out the data */
-	if (status == MB_SUCCESS)
-		{
-		/* construct record */
-		line[0] = (char) data->svp_day;
-		line[1] = (char) data->svp_month;
-		line[2] = (char) data->svp_year;
-		line[3] = (char) data->svp_hour;
-		line[4] = (char) data->svp_minute;
-		line[5] = (char) data->svp_second;
-		line[6] = (char) data->svp_hundredth_sec;
-		line[7] = (char) data->svp_thousandth_sec;
-#ifndef BYTESWAPPED
-		int_ptr = (int *) &line[8];
-		*int_ptr = data->svp_latitude;
-		int_ptr = (int *) &line[12];
-		*int_ptr = data->svp_longitude;
-#else
-		int_ptr = (int *) &line[8];
-		*int_ptr = (int) mb_swap_int(data->svp_latitude);
-		int_ptr = (int *) &line[12];
-		*int_ptr = (int) mb_swap_int(data->svp_longitude);
-#endif
-		for (i=0;i<data->svp_num;i++)
-			{
-			short_ptr = (short int *) &line[16+4*i];
-			short_ptr2 = (short int *) &line[18+4*i];
-#ifndef BYTESWAPPED
-			*short_ptr = (short int) data->svp_depth[i];
-			*short_ptr2 = (short int) data->svp_vel[i];
-#else
-			*short_ptr = (short int)
-				mb_swap_short((short int)data->svp_depth[i]);
-			*short_ptr2 = (short int)
-				mb_swap_short((short int)data->svp_vel[i]);
-#endif
-			}
-		for (i=data->svp_num;i<500;i++)
-			{
-			short_ptr = (short int *) &line[16+4*i];
-			short_ptr2 = (short int *) &line[18+4*i];
-			*short_ptr = 0;
-			*short_ptr2 = 0;
-			}
-		line[ELACMK2_SVP_SIZE] = 0x03;
-		line[ELACMK2_SVP_SIZE+1] = '\0';
-		line[ELACMK2_SVP_SIZE+2] = '\0';
-
-		/* write out data */
-		status = fwrite(line,1,ELACMK2_SVP_SIZE+3,mbfp);
-		if (status != ELACMK2_SVP_SIZE+3)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_elmk2unb_wr_bathgen(int verbose, FILE *mbfp, void *data_ptr, int *error)
-{
-	char	*function_name = "mbr_elmk2unb_wr_bathgen";
-	int	status = MB_SUCCESS;
-	struct mbf_elmk2unb_struct *data;
-	char	line[ELACMK2_COMMENT_SIZE];
-	short int label;
-	short int *short_ptr;
-	int	*int_ptr;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       data_ptr:   %p\n",(void *)data_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_elmk2unb_struct *) data_ptr;
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       year:             %d\n",
-			data->year);
-		fprintf(stderr,"dbg5       month:            %d\n",
-			data->month);
-		fprintf(stderr,"dbg5       day:              %d\n",
-			data->day);
-		fprintf(stderr,"dbg5       hour:             %d\n",
-			data->hour);
-		fprintf(stderr,"dbg5       minute:           %d\n",
-			data->minute);
-		fprintf(stderr,"dbg5       sec:              %d\n",
-			data->second);
-		fprintf(stderr,"dbg5       hundredth_sec:    %d\n",
-			data->hundredth_sec);
-		fprintf(stderr,"dbg5       thousandth_sec:   %d\n",
-			data->thousandth_sec);
-		fprintf(stderr,"dbg5       ping_num:         %d\n",data->ping_num);
-		fprintf(stderr,"dbg5       sound_vel:        %d\n",data->sound_vel);
-		fprintf(stderr,"dbg5       heading:          %d\n",data->heading);
-		fprintf(stderr,"dbg5       pulse_length:     %d\n",
-			data->pulse_length);
-		fprintf(stderr,"dbg5       mode:             %d\n",data->mode);
-		fprintf(stderr,"dbg5       source_power:     %d\n",
-			data->source_power);
-		fprintf(stderr,"dbg5       receiver_gain_stbd:%d\n",
-			data->receiver_gain_stbd);
-		fprintf(stderr,"dbg5       receiver_gain_port:%d\n",
-			data->receiver_gain_port);
-		fprintf(stderr,"dbg5       reserved:         %d\n",
-			data->reserved);
-		fprintf(stderr,"dbg5       beams_bath:       %d\n",
-			data->beams_bath);
-		for (i=0;i<data->beams_bath;i++)
-			{
-			fprintf(stderr,"\ndbg5       beam:             %d\n",
-				i);
-			fprintf(stderr,"dbg5       bath:             %d\n",
-				data->beams[i].bath);
-			fprintf(stderr,"dbg5       bath_acrosstrack: %d\n",
-				data->beams[i].bath_acrosstrack);
-			fprintf(stderr,"dbg5       bath_alongtrack: %d\n",
-				data->beams[i].bath_alongtrack);
-			fprintf(stderr,"dbg5       tt:              %d\n",
-				data->beams[i].tt);
-			fprintf(stderr,"dbg5       quality:         %d\n",
-				data->beams[i].quality);
-			fprintf(stderr,"dbg5       amplitude:       %d\n",
-				data->beams[i].amplitude);
-			fprintf(stderr,"dbg5       time_offset:     %d\n",
-				data->beams[i].time_offset);
-			fprintf(stderr,"dbg5       heave:           %d\n",
-				data->beams[i].heave);
-			fprintf(stderr,"dbg5       roll:            %d\n",
-				data->beams[i].roll);
-			fprintf(stderr,"dbg5       pitch:           %d\n",
-				data->beams[i].pitch);
-			fprintf(stderr,"dbg5       angle:           %d\n",
-				data->beams[i].angle);
-			}
-		}
-
-	/* write the record label */
-	label = ELACMK2_BATHGEN;
-#ifdef BYTESWAPPED
-	label = (short) mb_swap_short(label);
-#endif
-	status = fwrite(&label,1,2,mbfp);
-	if (status != 2)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	else
-		status = MB_SUCCESS;
-
-	/* write out the header data */
-	if (status == MB_SUCCESS)
-		{
-		/* construct record */
-		line[0] = (char) data->day;
-		line[1] = (char) data->month;
-		line[2] = (char) data->year;
-		line[3] = (char) data->hour;
-		line[4] = (char) data->minute;
-		line[5] = (char) data->second;
-		line[6] = (char) data->hundredth_sec;
-		line[7] = (char) data->thousandth_sec;
-#ifndef BYTESWAPPED
-		short_ptr = (short int *) &line[8];
-		*short_ptr =  (unsigned short) data->ping_num;
-		short_ptr = (short int *) &line[10];
-		*short_ptr =  (unsigned short) data->sound_vel;
-		short_ptr = (short int *) &line[12];
-		*short_ptr =  (unsigned short) data->heading;
-		short_ptr = (short int *) &line[14];
-		*short_ptr =  (unsigned short) data->pulse_length;
-#else
-		short_ptr = (short int *) &line[8];
-		*short_ptr =  (unsigned short)
-			mb_swap_short( (unsigned short) data->ping_num);
-		short_ptr = (short int *) &line[10];
-		*short_ptr =  (unsigned short)
-			mb_swap_short( (unsigned short) data->sound_vel);
-		short_ptr = (short int *) &line[12];
-		*short_ptr =  (unsigned short)
-			mb_swap_short( (unsigned short) data->heading);
-		short_ptr = (short int *) &line[14];
-		*short_ptr =  (unsigned short)
-			mb_swap_short( (unsigned short) data->pulse_length);
-#endif
-		line[16] = (char) data->mode;
-		line[17] = (char) data->source_power;
-		line[18] = (char) data->receiver_gain_stbd;
-		line[19] = (char) data->receiver_gain_port;
-#ifndef BYTESWAPPED
-		short_ptr = (short int *) &line[20];
-		*short_ptr = (short int) data->reserved;
-		short_ptr = (short int *) &line[22];
-		*short_ptr = (short int) data->beams_bath;
-#else
-		short_ptr = (short int *) &line[20];
-		*short_ptr = (short int)
-			mb_swap_short((short int) data->reserved);
-		short_ptr = (short int *) &line[22];
-		*short_ptr = (short int)
-			mb_swap_short((short int) data->beams_bath);
-#endif
-
-		/* write out data */
-		status = fwrite(line,1,ELACMK2_BATHGEN_HDR_SIZE,mbfp);
-		if (status != ELACMK2_BATHGEN_HDR_SIZE)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* write out the beam data */
-	if (status == MB_SUCCESS)
-		{
-		for (i=0;i<data->beams_bath;i++)
-		    {
-#ifndef BYTESWAPPED
-		    int_ptr = (int *) &line[0];
-		    *int_ptr = (unsigned int) data->beams[i].bath;
-		    int_ptr = (int *) &line[4];
-		    *int_ptr = (int) data->beams[i].bath_acrosstrack;
-		    int_ptr = (int *) &line[8];
-		    *int_ptr = (int) data->beams[i].bath_alongtrack;
-		    int_ptr = (int *) &line[12];
-		    *int_ptr = (unsigned int) data->beams[i].tt;
-#else
-		    int_ptr = (int *) &line[0];
-		    *int_ptr = (unsigned int)
-				    mb_swap_int(data->beams[i].bath);
-		    int_ptr = (int *) &line[4];
-		     *int_ptr = (int)
-				    mb_swap_int(data->beams[i].bath_acrosstrack);
-		    int_ptr = (int *) &line[8];
-		     *int_ptr = (int)
-				    mb_swap_int(data->beams[i].bath_alongtrack);
-		    int_ptr = (int *) &line[12];
-		     *int_ptr = (unsigned int)
-				    mb_swap_int(data->beams[i].tt);
-#endif
-		    line[16] = data->beams[i].quality;
-		    line[17] = (char)
-			    ((mb_s_char) (data->beams[i].amplitude - 128));
-#ifndef BYTESWAPPED
-		    short_ptr = (short *) &line[18];
-		    *short_ptr = (unsigned short)
-			    data->beams[i].time_offset;
-		    short_ptr = (short *) &line[20];
-		    *short_ptr = (short) data->beams[i].heave;
-		    short_ptr = (short *) &line[22];
-		    *short_ptr = (short) data->beams[i].roll;
-		    short_ptr = (short *) &line[24];
-		    *short_ptr = (short) data->beams[i].pitch;
-		    short_ptr = (short *) &line[26];
-		    *short_ptr = (short) data->beams[i].angle;
-#else
-		    short_ptr = (short *) &line[18];
-		    *short_ptr = (unsigned short)
-			    mb_swap_short(data->beams[i].time_offset);
-		    short_ptr = (short *) &line[20];
-		    *short_ptr = (short)
-			    mb_swap_short(data->beams[i].heave);
-		    short_ptr = (short *) &line[22];
-		    *short_ptr = (short)
-			    mb_swap_short(data->beams[i].roll);
-		    short_ptr = (short *) &line[24];
-		    *short_ptr = (short)
-			    mb_swap_short(data->beams[i].pitch);
-		    short_ptr = (short *) &line[26];
-		    *short_ptr = (short)
-			    mb_swap_short(data->beams[i].angle);
-#endif
-
-		    /* write out data */
-		    status = fwrite(line,1,ELACMK2_BATHGEN_BEAM_SIZE,mbfp);
-		    if (status != ELACMK2_BATHGEN_BEAM_SIZE)
-			    {
-			    *error = MB_ERROR_WRITE_FAIL;
-			    status = MB_FAILURE;
-			    }
-		    else
-			    {
-			    *error = MB_ERROR_NO_ERROR;
-			    status = MB_SUCCESS;
-			    }
-		    }
-		}
-
-	/* write out the eor data */
-	if (status == MB_SUCCESS)
-		{
-		line[0] = 0x03;
-		line[1] = '\0';
-		line[2] = '\0';
-
-		/* write out data */
-		status = fwrite(line,1,3,mbfp);
-		if (status != 3)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mbr_em12darw.c b/src/mbio/mbr_em12darw.c
deleted file mode 100644
index fd77dfd..0000000
--- a/src/mbio/mbr_em12darw.c
+++ /dev/null
@@ -1,1145 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbr_em12darw.c	2/2/93
- *	$Id: mbr_em12darw.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1994-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbr_em12darw.c contains the functions for reading and writing
- * multibeam data in the EM12DARW format.
- * These functions include:
- *   mbr_alm_em12darw	- allocate read/write memory
- *   mbr_dem_em12darw	- deallocate read/write memory
- *   mbr_rt_em12darw	- read and translate data
- *   mbr_wt_em12darw	- translate and write data
- *
- * Author:	R. B. Owens
- * Date:	January 24, 1994
- * $Log: mbr_em12darw.c,v $
- * Revision 5.12  2008/03/01 09:14:02  caress
- * Some housekeeping changes.
- *
- * Revision 5.11  2005/11/05 00:48:05  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.10  2003/12/04 23:10:22  caress
- * Fixed problems with format 54 EM12DARW due to old code assuming how internal structure was packed. Also changed handling of beamflags for formats that don't support beamflags. Now flagged beams will always be nulled in such cases.
- *
- * Revision 5.9  2003/05/20 18:05:32  caress
- * Added svp_source to data source parameters.
- *
- * Revision 5.8  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.7  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.6  2002/07/20 20:42:40  caress
- * Release 5.0.beta20
- *
- * Revision 5.5  2002/02/26 07:50:41  caress
- * Release 5.0.beta14
- *
- * Revision 5.4  2001/07/20 00:31:11  caress
- * Release 5.0.beta03
- *
- * Revision 5.3  2001/03/22  20:45:56  caress
- * Trying to make 5.0.beta0...
- *
- * Revision 5.2  2001/01/22  07:43:34  caress
- * Version 5.0.beta01
- *
- * Revision 5.1  2000/12/10  20:26:50  caress
- * Version 5.0.alpha02
- *
- * Revision 5.0  2000/12/01  22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.14  2000/10/11  01:02:30  caress
- * Convert to ANSI C
- *
- * Revision 4.13  2000/09/30  06:34:20  caress
- * Snapshot for Dale.
- *
- * Revision 4.12  1999/03/31  18:11:35  caress
- * MB-System 4.6beta7
- *
- * Revision 4.11  1998/10/05  17:46:15  caress
- * MB-System version 4.6beta
- *
- * Revision 4.10  1997/09/15  19:06:40  caress
- * Real Version 4.5
- *
- * Revision 4.9  1997/07/25  14:19:53  caress
- * Version 4.5beta2.
- * Much mucking, particularly with Simrad formats.
- *
- * Revision 4.8  1997/04/21  17:02:07  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.7  1996/08/26  20:05:02  caress
- * Changed "signed char" to "char".
- *
- * Revision 4.7  1996/08/26  20:05:02  caress
- * Changed "signed char" to "char".
- *
- * Revision 4.6  1996/08/05  15:21:58  caress
- * Just redid i/o for Simrad sonars, including adding EM12S and EM121 support.
- *
- * Revision 4.5  1996/07/26  21:09:33  caress
- * Version after first cut of handling em12s and em121 data.
- *
- * Revision 4.4  1996/04/22  13:21:19  caress
- * Now have DTR and MIN/MAX defines in mb_define.h
- *
- * Revision 4.3  1995/03/06  19:38:54  caress
- * Changed include strings.h to string.h for POSIX compliance.
- *
- * Revision 4.2  1994/10/21  12:20:01  caress
- * Release V4.0
- *
- * Revision 4.1  1994/07/29  18:46:51  caress
- * Changes associated with supporting Lynx OS (byte swapped) and
- * using unix second time base (for time_d values).
- *
- * Revision 4.0  1994/03/06  00:01:56  caress
- * First cut at version 4.0
- *
- * Revision 4.0  1994/03/05  22:54:09  caress
- * First cut.
- *
- * Revision 3.0  1993/05/14  22:56:29  sohara
- * initial version
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mb_define.h"
-#include "mbf_em12darw.h"
-#include "mbsys_simrad.h"
-
-/* include for byte swapping on little-endian machines */
-#ifdef BYTESWAPPED
-#include "mb_swap.h"
-#endif
-
-/* essential function prototypes */
-int mbr_register_em12darw(int verbose, void *mbio_ptr,
-		int *error);
-int mbr_info_em12darw(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_alm_em12darw(int verbose, void *mbio_ptr, int *error);
-int mbr_dem_em12darw(int verbose, void *mbio_ptr, int *error);
-int mbr_zero_em12darw(int verbose, char *data_ptr, int *error);
-int mbr_rt_em12darw(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_wt_em12darw(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-
-static char rcs_id[]="$Id: mbr_em12darw.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mbr_register_em12darw(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_register_em12darw";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* get mb_io_ptr */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set format info parameters */
-	status = mbr_info_em12darw(verbose,
-			&mb_io_ptr->system,
-			&mb_io_ptr->beams_bath_max,
-			&mb_io_ptr->beams_amp_max,
-			&mb_io_ptr->pixels_ss_max,
-			mb_io_ptr->format_name,
-			mb_io_ptr->system_name,
-			mb_io_ptr->format_description,
-			&mb_io_ptr->numfile,
-			&mb_io_ptr->filetype,
-			&mb_io_ptr->variable_beams,
-			&mb_io_ptr->traveltime,
-			&mb_io_ptr->beam_flagging,
-			&mb_io_ptr->nav_source,
-			&mb_io_ptr->heading_source,
-			&mb_io_ptr->vru_source,
-			&mb_io_ptr->svp_source,
-			&mb_io_ptr->beamwidth_xtrack,
-			&mb_io_ptr->beamwidth_ltrack,
-			error);
-
-	/* set format and system specific function pointers */
-	mb_io_ptr->mb_io_format_alloc = &mbr_alm_em12darw;
-	mb_io_ptr->mb_io_format_free = &mbr_dem_em12darw;
-	mb_io_ptr->mb_io_store_alloc = &mbsys_simrad_alloc;
-	mb_io_ptr->mb_io_store_free = &mbsys_simrad_deall;
-	mb_io_ptr->mb_io_read_ping = &mbr_rt_em12darw;
-	mb_io_ptr->mb_io_write_ping = &mbr_wt_em12darw;
-	mb_io_ptr->mb_io_dimensions = &mbsys_simrad_dimensions;
-	mb_io_ptr->mb_io_extract = &mbsys_simrad_extract;
-	mb_io_ptr->mb_io_insert = &mbsys_simrad_insert;
-	mb_io_ptr->mb_io_extract_nav = &mbsys_simrad_extract_nav;
-	mb_io_ptr->mb_io_insert_nav = &mbsys_simrad_insert_nav;
-	mb_io_ptr->mb_io_extract_altitude = &mbsys_simrad_extract_altitude;
-	mb_io_ptr->mb_io_insert_altitude = NULL;
-	mb_io_ptr->mb_io_extract_svp = NULL;
-	mb_io_ptr->mb_io_insert_svp = NULL;
-	mb_io_ptr->mb_io_ttimes = &mbsys_simrad_ttimes;
-	mb_io_ptr->mb_io_detects = &mbsys_simrad_detects;
-	mb_io_ptr->mb_io_gains = &mbsys_simrad_gains;
-	mb_io_ptr->mb_io_copyrecord = &mbsys_simrad_copy;
-	mb_io_ptr->mb_io_extract_rawss = NULL;
-	mb_io_ptr->mb_io_insert_rawss = NULL;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",mb_io_ptr->system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",mb_io_ptr->beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",mb_io_ptr->beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",mb_io_ptr->pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",mb_io_ptr->format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",mb_io_ptr->system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",mb_io_ptr->format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",mb_io_ptr->numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",mb_io_ptr->filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",mb_io_ptr->variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",mb_io_ptr->traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",mb_io_ptr->beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",mb_io_ptr->nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",mb_io_ptr->heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",mb_io_ptr->vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",mb_io_ptr->svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",mb_io_ptr->beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",mb_io_ptr->beamwidth_ltrack);
-		fprintf(stderr,"dbg2       format_alloc:       %p\n",(void *)mb_io_ptr->mb_io_format_alloc);
-		fprintf(stderr,"dbg2       format_free:        %p\n",(void *)mb_io_ptr->mb_io_format_free);
-		fprintf(stderr,"dbg2       store_alloc:        %p\n",(void *)mb_io_ptr->mb_io_store_alloc);
-		fprintf(stderr,"dbg2       store_free:         %p\n",(void *)mb_io_ptr->mb_io_store_free);
-		fprintf(stderr,"dbg2       read_ping:          %p\n",(void *)mb_io_ptr->mb_io_read_ping);
-		fprintf(stderr,"dbg2       write_ping:         %p\n",(void *)mb_io_ptr->mb_io_write_ping);
-		fprintf(stderr,"dbg2       extract:            %p\n",(void *)mb_io_ptr->mb_io_extract);
-		fprintf(stderr,"dbg2       insert:             %p\n",(void *)mb_io_ptr->mb_io_insert);
-		fprintf(stderr,"dbg2       extract_nav:        %p\n",(void *)mb_io_ptr->mb_io_extract_nav);
-		fprintf(stderr,"dbg2       insert_nav:         %p\n",(void *)mb_io_ptr->mb_io_insert_nav);
-		fprintf(stderr,"dbg2       extract_altitude:   %p\n",(void *)mb_io_ptr->mb_io_extract_altitude);
-		fprintf(stderr,"dbg2       insert_altitude:    %p\n",(void *)mb_io_ptr->mb_io_insert_altitude);
-		fprintf(stderr,"dbg2       extract_svp:        %p\n",(void *)mb_io_ptr->mb_io_extract_svp);
-		fprintf(stderr,"dbg2       insert_svp:         %p\n",(void *)mb_io_ptr->mb_io_insert_svp);
-		fprintf(stderr,"dbg2       ttimes:             %p\n",(void *)mb_io_ptr->mb_io_ttimes);
-		fprintf(stderr,"dbg2       detects:            %p\n",(void *)mb_io_ptr->mb_io_detects);
-		fprintf(stderr,"dbg2       extract_rawss:      %p\n",(void *)mb_io_ptr->mb_io_extract_rawss);
-		fprintf(stderr,"dbg2       insert_rawss:       %p\n",(void *)mb_io_ptr->mb_io_insert_rawss);
-		fprintf(stderr,"dbg2       copyrecord:         %p\n",(void *)mb_io_ptr->mb_io_copyrecord);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbr_info_em12darw(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error)
-{
-	char	*function_name = "mbr_info_em12darw";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* set format info parameters */
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-	*system = MB_SYS_SIMRAD;
-	*beams_bath_max = MBF_EM12DARW_BEAMS;
-	*beams_amp_max = MBF_EM12DARW_BEAMS;
-	*pixels_ss_max = 0;
-	strncpy(format_name, "EM12DARW", MB_NAME_LENGTH);
-	strncpy(system_name, "SIMRAD", MB_NAME_LENGTH);
-	strncpy(format_description, "Format name:          MBF_EM12DARW\nInformal Description: Simrad EM12S RRS Darwin processed format\nAttributes:           Simrad EM12S, bathymetry and amplitude,\n                      81 beams, binary, Oxford University.\n", MB_DESCRIPTION_LENGTH);
-	*numfile = 1;
-	*filetype = MB_FILETYPE_NORMAL;
-	*variable_beams = MB_NO;
-	*traveltime = MB_YES;
-	*beam_flagging = MB_YES;
-	*nav_source = MB_DATA_DATA;
-	*heading_source = MB_DATA_DATA;
-	*vru_source = MB_DATA_DATA;
-	*svp_source = MB_DATA_NONE;
-	*beamwidth_xtrack = 2.0;
-	*beamwidth_ltrack = 2.0;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",*system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",*beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",*beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",*pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",*numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",*filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",*variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",*traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",*beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",*nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",*heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",*vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",*svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",*beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",*beamwidth_ltrack);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_alm_em12darw(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_alm_em12darw";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_em12darw_struct *data;
-	char	*data_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set initial status */
-	status = MB_SUCCESS;
-
-	/* allocate memory for data structure */
-	mb_io_ptr->structure_size = sizeof(struct mbf_em12darw_struct);
-	status = mb_malloc(verbose,mb_io_ptr->structure_size,
-				&mb_io_ptr->raw_data,error);
-	status = mbsys_simrad_alloc(
-			verbose,mbio_ptr,
-			&mb_io_ptr->store_data,error);
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-	data = (struct mbf_em12darw_struct *) mb_io_ptr->raw_data;
-	data_ptr = (char *) data;
-
-	/* initialize everything to zeros */
-	mbr_zero_em12darw(verbose,data_ptr,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_dem_em12darw(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_dem_em12darw";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_simrad_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointers to mbio descriptor and data structures */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-	store = (struct mbsys_simrad_struct *) mb_io_ptr->store_data;
-
-	/* deallocate memory for data descriptor */
-	status = mb_free(verbose,&mb_io_ptr->raw_data,error);
-	status = mbsys_simrad_deall(
-			verbose,mbio_ptr,
-			&mb_io_ptr->store_data,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_zero_em12darw(int verbose, char *data_ptr, int *error)
-{
-	char	*function_name = "mbr_zero_em12darw";
-	int	status = MB_SUCCESS;
-	struct mbf_em12darw_struct *data;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       data_ptr:   %p\n",(void *)data_ptr);
-		}
-
-	/* get pointer to data descriptor */
-	data = (struct mbf_em12darw_struct *) data_ptr;
-
-	/* initialize everything to zeros */
-	if (data != NULL)
-		{
-		/* record type */
-		data->func = 150;
-
-		/* time */
-		data->year = 0;
-		data->jday = 0;
-		data->minute = 0;
-		data->secs = 0;
-
-		/* navigation */
-		data->latitude = 0.0;
-		data->longitude = 0.0;
-		data->speed = 0.0;
-		data->gyro = 0.0;
-		data->roll = 0.0;
-		data->pitch = 0.0;
-		data->heave = 0.0;
-
-		/* other parameters */
-		data->corflag = 0;
-		data->utm_merd = 0.0;
-		data->utm_zone = 0;
-		data->posq = 0;
-		data->pingno = 0;
-		data->mode = 0;
-		data->depthl = 0.0;
-		data->sndval = 0.0;
-
-		/* beam values */
-		for (i=0;i<MBF_EM12DARW_BEAMS;i++)
-			{
-			data->depth[i] = 0;
-			data->distacr[i] = 0;
-			data->distalo[i] = 0;
-			data->range[i] = 0;
-			data->refl[i] = 0;
-			data->beamq[i] = 0;
-			}
-		}
-
-	/* assume success */
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_rt_em12darw(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_rt_em12darw";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_em12darw_struct *data;
-	struct mbsys_simrad_struct *store;
-	struct mbsys_simrad_survey_struct *ping;
-	char	line[MBF_EM12DARW_RECORD_LENGTH];
-	int	index;
-	char	*datacomment;
-	int	time_j[5];
-	int	time_i[7];
-	int	kind;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_em12darw_struct *) mb_io_ptr->raw_data;
-	datacomment = (char *) &line[80];
-	store = (struct mbsys_simrad_struct *) store_ptr;
-
-	/* set file position */
-	mb_io_ptr->file_pos = mb_io_ptr->file_bytes;
-
-	/* read next record from file */
-	if ((status = fread(line,1,MBF_EM12DARW_RECORD_LENGTH,
-			mb_io_ptr->mbfp)) == MBF_EM12DARW_RECORD_LENGTH)
-		{
-		mb_io_ptr->file_bytes += status;
-		status = MB_SUCCESS;
-		*error = MB_ERROR_NO_ERROR;
-		}
-	else
-		{
-		mb_io_ptr->file_bytes += status;
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	/* get data type */
-	kind = MB_DATA_NONE;
-	if (status == MB_SUCCESS)
-		{
-		mb_get_binary_short(MB_NO, &line[0], &(data->func));
-		}
-
-	/* deal with comment */
-	if (status == MB_SUCCESS && data->func == 100)
-		{
-		kind = MB_DATA_COMMENT;
-
-		strncpy(store->comment,datacomment,
-			MBSYS_SIMRAD_COMMENT_LENGTH);
-		}
-
-	/* deal with data */
-	else if (status == MB_SUCCESS && data->func == 150)
-		{
-		kind = MB_DATA_DATA;
-
-		index = 2;
-		mb_get_binary_short(MB_NO, &line[index], &(data->year)); index += 2;
-		mb_get_binary_short(MB_NO, &line[index], &(data->jday)); index += 2;
-		mb_get_binary_short(MB_NO, &line[index], &(data->minute)); index += 2;
-		mb_get_binary_short(MB_NO, &line[index], &(data->secs)); index += 8;
-		mb_get_binary_double(MB_NO, &line[index], &(data->latitude)); index += 8;
-		mb_get_binary_double(MB_NO, &line[index], &(data->longitude)); index += 8;
-		mb_get_binary_short(MB_NO, &line[index], &(data->corflag)); index += 4;
-		mb_get_binary_float(MB_NO, &line[index], &(data->utm_merd)); index += 4;
-		mb_get_binary_short(MB_NO, &line[index], &(data->utm_zone)); index += 2;
-		mb_get_binary_short(MB_NO, &line[index], &(data->posq)); index += 2;
-		mb_get_binary_int(MB_NO, &line[index], &(data->pingno)); index += 4;
-		mb_get_binary_short(MB_NO, &line[index], &(data->mode)); index += 4;
-		mb_get_binary_float(MB_NO, &line[index], &(data->depthl)); index += 4;
-		mb_get_binary_float(MB_NO, &line[index], &(data->speed)); index += 4;
-		mb_get_binary_float(MB_NO, &line[index], &(data->gyro)); index += 4;
-		mb_get_binary_float(MB_NO, &line[index], &(data->roll)); index += 4;
-		mb_get_binary_float(MB_NO, &line[index], &(data->pitch)); index += 4;
-		mb_get_binary_float(MB_NO, &line[index], &(data->heave)); index += 4;
-		mb_get_binary_float(MB_NO, &line[index], &(data->sndval)); index += 4;
-		for (i=0;i<MBF_EM12DARW_BEAMS;i++)
-			{
-			mb_get_binary_short(MB_NO, &line[index], &(data->depth[i])); index += 2;
-			}
-		for (i=0;i<MBF_EM12DARW_BEAMS;i++)
-			{
-			mb_get_binary_short(MB_NO, &line[index], &(data->distacr[i])); index += 2;
-			}
-		for (i=0;i<MBF_EM12DARW_BEAMS;i++)
-			{
-			mb_get_binary_short(MB_NO, &line[index], &(data->distalo[i])); index += 2;
-			}
-		for (i=0;i<MBF_EM12DARW_BEAMS;i++)
-			{
-			mb_get_binary_short(MB_NO, &line[index], &(data->range[i])); index += 2;
-			}
-		for (i=0;i<MBF_EM12DARW_BEAMS;i++)
-			{
-			mb_get_binary_short(MB_NO, &line[index], &(data->refl[i])); index += 2;
-			}
-		for (i=0;i<MBF_EM12DARW_BEAMS;i++)
-			{
-			mb_get_binary_short(MB_NO, &line[index], &(data->beamq[i])); index += 2;
-			}
-
-
-		/* print debug statements */
-		if (verbose >= 4)
-			{
-			fprintf(stderr,"\ndbg4  Data read by MBIO function <%s>\n",function_name);
-			fprintf(stderr,"dbg4  Read values:\n");
-			fprintf(stderr,"dbg4       kind:       %d\n", kind);
-			fprintf(stderr,"dbg4       error:      %d\n", *error);
-			fprintf(stderr,"dbg4       year:       %d\n", data->year);
-			fprintf(stderr,"dbg4       jday:       %d\n", data->jday);
-			fprintf(stderr,"dbg4       minute:     %d\n", data->minute);
-			fprintf(stderr,"dbg4       secs:       %d\n", data->secs);
-			fprintf(stderr,"dbg4       latitude:   %f\n", data->latitude);
-			fprintf(stderr,"dbg4       longitude:  %f\n", data->longitude);
-			fprintf(stderr,"dbg4       corflag:    %d\n", data->corflag);
-			fprintf(stderr,"dbg4       utm_merd:   %f\n", data->utm_merd);
-			fprintf(stderr,"dbg4       utm_zone:   %d\n", data->utm_zone);
-			fprintf(stderr,"dbg4       posq:       %d\n", data->posq);
-			fprintf(stderr,"dbg4       pingno:     %d\n", data->pingno);
-			fprintf(stderr,"dbg4       mode:       %d\n", data->mode);
-			fprintf(stderr,"dbg4       depthl:     %f\n", data->depthl);
-			fprintf(stderr,"dbg4       speed:      %f\n", data->speed);
-			fprintf(stderr,"dbg4       gyro:       %f\n", data->gyro);
-			fprintf(stderr,"dbg4       roll:       %f\n", data->roll);
-			fprintf(stderr,"dbg4       pitch:      %f\n", data->pitch);
-			fprintf(stderr,"dbg4       heave:      %f\n", data->heave);
-			fprintf(stderr,"dbg4       sndval:     %f\n", data->sndval);
-			for (i=0;i<MBF_EM12DARW_BEAMS;i++)
-			  fprintf(stderr,"dbg4       beam:%d  depth:%d  distacr:%d  distalo:%d  range:%d refl:%d beamq:%d\n",
-				i,data->depth[i],data->distacr[i],
-				data->distalo[i],data->range[i],
-				data->refl[i],data->beamq[i]);
-			}
-
-		}
-
-	/* else unintelligible */
-	else if (status == MB_SUCCESS)
-		{
-		kind = MB_DATA_NONE;
-		status = MB_FAILURE;
-		*error = MB_ERROR_UNINTELLIGIBLE;
-		}
-
-	/* set kind and error in mb_io_ptr */
-	mb_io_ptr->new_kind = kind;
-	mb_io_ptr->new_error = *error;
-
-	/* translate values to em12 data storage structure */
-	if (status == MB_SUCCESS
-		&& store != NULL)
-		{
-		/* type of data record */
-		store->kind = kind;
-		store->sonar = MBSYS_SIMRAD_EM12S;
-
-		/* time */
-		mb_fix_y2k(verbose, (int)data->year,
-				&time_j[0]);
-		time_j[1] = data->jday;
-		time_j[2] = data->minute;
-		time_j[3] = data->secs/100;
-		time_j[4] = 0.0001*(100*time_j[3] - data->secs);
-		mb_get_itime(verbose,time_j,time_i);
-		store->year = data->year;
-		store->month = time_i[1];
-		store->day = time_i[2];
-		store->hour = time_i[3];
-		store->minute = time_i[4];
-		store->second = time_i[5];
-		store->centisecond = 0.0001*time_i[6];
-		store->pos_year = store->year;
-		store->pos_month = store->month;
-		store->pos_day = store->day;
-		store->pos_hour = store->hour;
-		store->pos_minute = store->minute;
-		store->pos_second = store->second;
-		store->pos_centisecond = store->centisecond;
-
-		/* navigation */
-		if (data->corflag == 0)
-			{
-			store->pos_latitude = data->latitude;
-			store->pos_longitude = data->longitude;
-			store->utm_northing = 0.0;
-			store->utm_easting = 0.0;
-			}
-		else
-			{
-			store->pos_latitude = 0.0;
-			store->pos_longitude = 0.0;
-			store->utm_northing = data->latitude;
-			store->utm_easting = data->longitude;
-			}
-		store->utm_zone = data->utm_zone;
-		store->utm_zone_lon = data->utm_merd;
-		store->utm_system = data->corflag;
-		store->pos_quality = data->posq;
-		store->speed = data->speed;
-		store->line_heading = 10*data->gyro;
-
-		/* allocate secondary data structure for
-			survey data if needed */
-		if (kind == MB_DATA_DATA
-			&& store->ping == NULL)
-			{
-			status = mbsys_simrad_survey_alloc(
-					verbose,mbio_ptr,
-					store_ptr,error);
-			}
-
-		/* deal with putting survey data into
-		secondary data structure */
-		if (status == MB_SUCCESS
-			&& kind == MB_DATA_DATA)
-			{
-			/* get data structure pointer */
-			ping = (struct mbsys_simrad_survey_struct *)
-				store->ping;
-
-			/* copy data */
-			ping->longitude = data->longitude;
-			ping->latitude = data->latitude;
-			ping->swath_id = EM_SWATH_CENTER;
-			ping->ping_number = data->pingno;
-			ping->beams_bath = MBF_EM12DARW_BEAMS;
-			ping->bath_mode = 0;
-			ping->bath_res = data->mode;
-			ping->bath_quality = 0;
-			ping->keel_depth = data->depthl;
-			ping->heading = (int) 10*data->gyro;
-			ping->roll = (int) 100*data->roll;
-			ping->pitch = (int) 100*data->pitch;
-			ping->xducer_pitch = (int) 100*data->pitch;
-			ping->ping_heave = (int) 100*data->heave;
-			ping->sound_vel = (int) 10*data->sndval;
-			ping->pixels_ss = 0;
-			ping->ss_mode = 0;
-			for (i=0;i<ping->beams_bath;i++)
-				{
-				if (data->depth[i] > 0)
-					{
-					ping->bath[i] = data->depth[i];
-					ping->beamflag[i] = MB_FLAG_NONE;
-					}
-				else if (data->depth[i] < 0)
-					{
-					ping->bath[i] = -data->depth[i];
-					ping->beamflag[i] = MB_FLAG_FLAG + MB_FLAG_MANUAL;
-					}
-				else
-					{
-					ping->bath[i] = data->depth[i];
-					ping->beamflag[i] = MB_FLAG_NULL;
-					}
-				ping->bath_acrosstrack[i] = data->distacr[i];
-				ping->bath_alongtrack[i] = data->distalo[i];
-				ping->tt[i] = data->range[i];
-				ping->amp[i] = (mb_s_char) data->refl[i];
-				ping->quality[i] = (mb_u_char) data->beamq[i];
-				ping->heave[i] = (mb_s_char) 0;
-				ping->beam_frequency[i] = 0;
-				ping->beam_samples[i] = 0;
-				ping->beam_center_sample[i] = 0;
-				}
-			}
-
-		else if (status == MB_SUCCESS
-			&& kind == MB_DATA_COMMENT)
-			{
-			/* comment */
-			strncpy(store->comment,datacomment,
-				MBSYS_SIMRAD_COMMENT_LENGTH);
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_wt_em12darw(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_wt_em12darw";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_em12darw_struct *data;
-	struct mbsys_simrad_struct *store;
-	struct mbsys_simrad_survey_struct *ping;
-	char	line[MBF_EM12DARW_RECORD_LENGTH];
-	int	index;
-	char	*datacomment;
-	int	time_i[7];
-	int	time_j[5];
-	int	year;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_em12darw_struct *) mb_io_ptr->raw_data;
-	datacomment = (char *) &line[80];
-	store = (struct mbsys_simrad_struct *) store_ptr;
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Status at beginning of MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       store->kind:    %d\n",store->kind);
-		fprintf(stderr,"dbg5       error:          %d\n",*error);
-		fprintf(stderr,"dbg5       status:         %d\n",status);
-		}
-
-
-	/*  translate values from em12 data storage structure */
-	if (store->kind == MB_DATA_DATA)
-		{
-		/* record type */
-		data->func = 150;
-
-		/* time */
-		time_i[0] = store->year;
-		time_i[1] = store->month;
-		time_i[2] = store->day;
-		time_i[3] = store->hour;
-		time_i[4] = store->minute;
-		time_i[5] = store->second;
-		time_i[6] = store->centisecond;
-		mb_get_jtime(verbose,time_i,time_j);
-		mb_unfix_y2k(verbose, time_j[0], &year);
-		data->year = (short)year;
-		data->jday = time_j[1];
-		data->minute = time_j[2];
-		data->secs = 100*time_j[3] + 0.0001*time_j[4];
-
-		/* navigation */
-		data->utm_zone = store->utm_zone;
-		data->utm_merd = store->utm_zone_lon;
-		data->corflag = store->utm_system;
-		data->posq = store->pos_quality;
-		data->speed = store->speed;
-		if (data->corflag == 0)
-			{
-			data->latitude = store->pos_latitude;
-			data->longitude = store->pos_longitude;
-			}
-		else
-			{
-			data->latitude = store->utm_northing;
-			data->longitude = store->utm_easting;
-			}
-
-
-		/* deal with survey data
-			in secondary data structure */
-		if (store->ping != NULL)
-			{
-			/* get data structure pointer */
-			ping = (struct mbsys_simrad_survey_struct *)
-				store->ping;
-
-			/* copy survey data */
-			data->latitude = ping->latitude;
-			data->longitude = ping->longitude;
-			data->pingno = ping->ping_number;
-			data->mode = ping->bath_res;
-			data->depthl = ping->keel_depth;
-			data->gyro = 0.1*ping->heading;
-			data->roll = 0.01*ping->roll;
-			data->pitch = 0.01*ping->pitch;
-			data->heave = 0.01*ping->ping_heave;
-			data->sndval = 0.1*ping->sound_vel;
-			for (i=0;i<ping->beams_bath;i++)
-				{
-				if (ping->beamflag[i] == MB_FLAG_NULL)
-					data->depth[i] = 0;
-				else if (!mb_beam_ok(ping->beamflag[i]))
-					data->depth[i] = -ping->bath[i];
-				else
-					data->depth[i] = ping->bath[i];
-				data->distacr[i]
-					= ping->bath_acrosstrack[i];
-				data->distalo[i]
-					= ping->bath_alongtrack[i];
-				data->range[i]
-					= ping->tt[i];
-				data->refl[i]
-					= (short int) ping->amp[i];
-				data->beamq[i]
-					= (short int) ping->quality[i];
-				}
-			}
-		}
-
-	/* comment */
-	else if (store->kind == MB_DATA_COMMENT)
-		{
-		data->func = 100;
-		strncpy(datacomment,store->comment,
-			MBSYS_SIMRAD_COMMENT_LENGTH);
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Ready to write data in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       store->kind:       %d\n",store->kind);
-		fprintf(stderr,"dbg5       error:             %d\n",*error);
-		fprintf(stderr,"dbg5       status:            %d\n",status);
-		}
-
-	/* print debug statements */
-	if (verbose >= 4 && status == MB_SUCCESS)
-		{
-		fprintf(stderr,"\ndbg4  Data to be written by MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg4  Status values:\n");
-		fprintf(stderr,"dbg4       store->kind:%d\n", store->kind);
-		fprintf(stderr,"dbg4       error:      %d\n", *error);
-		fprintf(stderr,"dbg4       status:     %d\n",status);
-		if (store->kind == MB_DATA_DATA)
-			{
-			fprintf(stderr,"dbg4  Survey values:\n");
-			fprintf(stderr,"dbg4       year:       %d\n", data->year);
-			fprintf(stderr,"dbg4       jday:       %d\n", data->jday);
-			fprintf(stderr,"dbg4       minute:     %d\n", data->minute);
-			fprintf(stderr,"dbg4       secs:       %d\n", data->secs);
-			fprintf(stderr,"dbg4       latitude:   %f\n", data->latitude);
-			fprintf(stderr,"dbg4       longitude:  %f\n", data->longitude);
-			fprintf(stderr,"dbg4       corflag:    %d\n", data->corflag);
-			fprintf(stderr,"dbg4       utm_merd:   %f\n", data->utm_merd);
-			fprintf(stderr,"dbg4       utm_zone:   %d\n", data->utm_zone);
-			fprintf(stderr,"dbg4       posq:       %d\n", data->posq);
-			fprintf(stderr,"dbg4       pingno:     %d\n", data->pingno);
-			fprintf(stderr,"dbg4       mode:       %d\n", data->mode);
-			fprintf(stderr,"dbg4       depthl:     %f\n", data->depthl);
-			fprintf(stderr,"dbg4       speed:      %f\n", data->speed);
-			fprintf(stderr,"dbg4       gyro:       %f\n", data->gyro);
-			fprintf(stderr,"dbg4       roll:       %f\n", data->roll);
-			fprintf(stderr,"dbg4       pitch:      %f\n", data->pitch);
-			fprintf(stderr,"dbg4       heave:      %f\n", data->heave);
-			fprintf(stderr,"dbg4       sndval:     %f\n", data->sndval);
-			for (i=0;i<MBF_EM12DARW_BEAMS;i++)
-			  fprintf(stderr,"dbg4       beam:%d  depth:%d  distacr:%d  distalo:%d  range:%d refl:%d beamq:%d\n",
-				i,data->depth[i],data->distacr[i],
-				data->distalo[i],data->range[i],
-				data->refl[i],data->beamq[i]);
-			}
-		else if (store->kind == MB_DATA_COMMENT)
-			{
-			fprintf(stderr,"dbg4  Comment:\n");
-			fprintf(stderr,"dbg4       comment:    %s\n", datacomment);
-			}
-		}
-
-	/* deal with comment */
-	if (status == MB_SUCCESS && store->kind == MB_DATA_COMMENT)
-		{
-		index = 0;
-		for (i=0;i<MBF_EM12DARW_RECORD_LENGTH;i++)
-			line[i] = 0;
-		mb_put_binary_short(MB_NO, data->func, &line[0]); index+= 2;
-		strncpy(datacomment, store->comment,
-			MBSYS_SIMRAD_COMMENT_LENGTH);
-		}
-
-	/* deal with data */
-	else if (status == MB_SUCCESS && store->kind == MB_DATA_DATA)
-		{
-		index = 0;
-		mb_put_binary_short(MB_NO, data->func, &line[0]); index+= 2;
-		mb_put_binary_short(MB_NO, data->year, &line[index]); index+= 2;
-		mb_put_binary_short(MB_NO, data->jday, &line[index]); index+= 2;
-		mb_put_binary_short(MB_NO, data->minute, &line[index]); index+= 2;
-		mb_put_binary_short(MB_NO, data->secs, &line[index]); index+= 8;
-		mb_put_binary_double(MB_NO, data->latitude, &line[index]); index+= 8;
-		mb_put_binary_double(MB_NO, data->longitude, &line[index]); index+= 8;
-		mb_put_binary_short(MB_NO, data->corflag, &line[index]); index+= 4;
-		mb_put_binary_float(MB_NO, data->utm_merd, &line[index]); index+= 4;
-		mb_put_binary_short(MB_NO, data->utm_zone, &line[index]); index+= 2;
-		mb_put_binary_short(MB_NO, data->posq, &line[index]); index+= 2;
-		mb_put_binary_int(MB_NO, data->pingno, &line[index]); index+= 4;
-		mb_put_binary_short(MB_NO, data->mode, &line[index]); index+= 4;
-		mb_put_binary_float(MB_NO, data->depthl, &line[index]); index+= 4;
-		mb_put_binary_float(MB_NO, data->speed, &line[index]); index+= 4;
-		mb_put_binary_float(MB_NO, data->gyro, &line[index]); index+= 4;
-		mb_put_binary_float(MB_NO, data->roll, &line[index]); index+= 4;
-		mb_put_binary_float(MB_NO, data->pitch, &line[index]); index+= 4;
-		mb_put_binary_float(MB_NO, data->heave, &line[index]); index+= 4;
-		mb_put_binary_float(MB_NO, data->sndval, &line[index]); index+= 4;
-		for (i=0;i<MBF_EM12DARW_BEAMS;i++)
-			{
-			mb_put_binary_short(MB_NO, data->depth[i], &line[index]); index+= 2;
-			}
-		for (i=0;i<MBF_EM12DARW_BEAMS;i++)
-			{
-			mb_put_binary_short(MB_NO, data->distacr[i], &line[index]); index+= 2;
-			}
-		for (i=0;i<MBF_EM12DARW_BEAMS;i++)
-			{
-			mb_put_binary_short(MB_NO, data->distalo[i], &line[index]); index+= 2;
-			}
-		for (i=0;i<MBF_EM12DARW_BEAMS;i++)
-			{
-			mb_put_binary_short(MB_NO, data->range[i], &line[index]); index+= 2;
-			}
-		for (i=0;i<MBF_EM12DARW_BEAMS;i++)
-			{
-			mb_put_binary_short(MB_NO, data->refl[i], &line[index]); index+= 2;
-			}
-		for (i=0;i<MBF_EM12DARW_BEAMS;i++)
-			{
-			mb_put_binary_short(MB_NO, data->beamq[i], &line[index]); index+= 2;
-			}
-		}
-
-	/* write next record to file */
-	if (store->kind == MB_DATA_DATA || store->kind == MB_DATA_COMMENT)
-		{
-		if ((status = fwrite(line,1,MBF_EM12DARW_RECORD_LENGTH,
-				mb_io_ptr->mbfp))
-				== MBF_EM12DARW_RECORD_LENGTH)
-			{
-			status = MB_SUCCESS;
-			*error = MB_ERROR_NO_ERROR;
-			}
-		else
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_WRITE_FAIL;
-			}
-		}
-	else
-		{
-		status = MB_SUCCESS;
-		*error = MB_ERROR_NO_ERROR;
-		if (verbose >= 5)
-			fprintf(stderr,"\ndbg5  No data written in MBIO function <%s>\n",function_name);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mbr_em12ifrm.c b/src/mbio/mbr_em12ifrm.c
deleted file mode 100644
index 14dd6e3..0000000
--- a/src/mbio/mbr_em12ifrm.c
+++ /dev/null
@@ -1,1866 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbr_em12ifrm.c	12/4/00
- *	$Id: mbr_em12ifrm.c 2247 2015-05-29 21:28:28Z caress $
- *
- *    Copyright (c) 2000-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbr_em12ifrm.c contains the functions for reading and writing
- * multibeam data in the EM12IFRM format.
- * These functions include:
- *   mbr_alm_em12ifrm	- allocate read/write memory
- *   mbr_dem_em12ifrm	- deallocate read/write memory
- *   mbr_rt_em12ifrm	- read and translate data
- *   mbr_wt_em12ifrm	- translate and write data
- *
- * Author:	D. W. Caress
- * Date:	December 4, 2000
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mb_define.h"
-#include "mbsys_simrad.h"
-#include "mbf_em12ifrm.h"
-
-/* include for byte swapping on little-endian machines */
-#ifdef BYTESWAPPED
-#include "mb_swap.h"
-#endif
-
-/* define IFREMER EM12 Archive format record size */
-#define MBF_EM12IFRM_RECORD_SIZE    1032
-#define MBF_EM12IFRM_SSHEADER_SIZE   42
-#define MBF_EM12IFRM_SSBEAMHEADER_SIZE   6
-
-/* essential function prototypes */
-int mbr_register_em12ifrm(int verbose, void *mbio_ptr,
-		int *error);
-int mbr_info_em12ifrm(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_alm_em12ifrm(int verbose, void *mbio_ptr, int *error);
-int mbr_dem_em12ifrm(int verbose, void *mbio_ptr, int *error);
-int mbr_zero_em12ifrm(int verbose, char *data_ptr, int *error);
-int mbr_rt_em12ifrm(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_wt_em12ifrm(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_em12ifrm_rd_data(int verbose, void *mbio_ptr, int *error);
-int mbr_em12ifrm_wr_data(int verbose, void *mbio_ptr, char *data_ptr, int *error);
-
-static char rcs_id[]="$Id: mbr_em12ifrm.c 2247 2015-05-29 21:28:28Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mbr_register_em12ifrm(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_register_em12ifrm";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* get mb_io_ptr */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set format info parameters */
-	status = mbr_info_em12ifrm(verbose,
-			&mb_io_ptr->system,
-			&mb_io_ptr->beams_bath_max,
-			&mb_io_ptr->beams_amp_max,
-			&mb_io_ptr->pixels_ss_max,
-			mb_io_ptr->format_name,
-			mb_io_ptr->system_name,
-			mb_io_ptr->format_description,
-			&mb_io_ptr->numfile,
-			&mb_io_ptr->filetype,
-			&mb_io_ptr->variable_beams,
-			&mb_io_ptr->traveltime,
-			&mb_io_ptr->beam_flagging,
-			&mb_io_ptr->nav_source,
-			&mb_io_ptr->heading_source,
-			&mb_io_ptr->vru_source,
-			&mb_io_ptr->svp_source,
-			&mb_io_ptr->beamwidth_xtrack,
-			&mb_io_ptr->beamwidth_ltrack,
-			error);
-
-	/* set format and system specific function pointers */
-	mb_io_ptr->mb_io_format_alloc = &mbr_alm_em12ifrm;
-	mb_io_ptr->mb_io_format_free = &mbr_dem_em12ifrm;
-	mb_io_ptr->mb_io_store_alloc = &mbsys_simrad_alloc;
-	mb_io_ptr->mb_io_store_free = &mbsys_simrad_deall;
-	mb_io_ptr->mb_io_read_ping = &mbr_rt_em12ifrm;
-	mb_io_ptr->mb_io_write_ping = &mbr_wt_em12ifrm;
-	mb_io_ptr->mb_io_dimensions = &mbsys_simrad_dimensions;
-	mb_io_ptr->mb_io_extract = &mbsys_simrad_extract;
-	mb_io_ptr->mb_io_insert = &mbsys_simrad_insert;
-	mb_io_ptr->mb_io_extract_nav = &mbsys_simrad_extract_nav;
-	mb_io_ptr->mb_io_insert_nav = &mbsys_simrad_insert_nav;
-	mb_io_ptr->mb_io_extract_altitude = &mbsys_simrad_extract_altitude;
-	mb_io_ptr->mb_io_insert_altitude = NULL;
-	mb_io_ptr->mb_io_extract_svp = NULL;
-	mb_io_ptr->mb_io_insert_svp = NULL;
-	mb_io_ptr->mb_io_ttimes = &mbsys_simrad_ttimes;
-	mb_io_ptr->mb_io_detects = &mbsys_simrad_detects;
-	mb_io_ptr->mb_io_gains = &mbsys_simrad_gains;
-	mb_io_ptr->mb_io_copyrecord = &mbsys_simrad_copy;
-	mb_io_ptr->mb_io_extract_rawss = NULL;
-	mb_io_ptr->mb_io_insert_rawss = NULL;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",mb_io_ptr->system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",mb_io_ptr->beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",mb_io_ptr->beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",mb_io_ptr->pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",mb_io_ptr->format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",mb_io_ptr->system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",mb_io_ptr->format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",mb_io_ptr->numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",mb_io_ptr->filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",mb_io_ptr->variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",mb_io_ptr->traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",mb_io_ptr->beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",mb_io_ptr->nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",mb_io_ptr->heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",mb_io_ptr->vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",mb_io_ptr->svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",mb_io_ptr->beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",mb_io_ptr->beamwidth_ltrack);
-		fprintf(stderr,"dbg2       format_alloc:       %p\n",(void *)mb_io_ptr->mb_io_format_alloc);
-		fprintf(stderr,"dbg2       format_free:        %p\n",(void *)mb_io_ptr->mb_io_format_free);
-		fprintf(stderr,"dbg2       store_alloc:        %p\n",(void *)mb_io_ptr->mb_io_store_alloc);
-		fprintf(stderr,"dbg2       store_free:         %p\n",(void *)mb_io_ptr->mb_io_store_free);
-		fprintf(stderr,"dbg2       read_ping:          %p\n",(void *)mb_io_ptr->mb_io_read_ping);
-		fprintf(stderr,"dbg2       write_ping:         %p\n",(void *)mb_io_ptr->mb_io_write_ping);
-		fprintf(stderr,"dbg2       extract:            %p\n",(void *)mb_io_ptr->mb_io_extract);
-		fprintf(stderr,"dbg2       insert:             %p\n",(void *)mb_io_ptr->mb_io_insert);
-		fprintf(stderr,"dbg2       extract_nav:        %p\n",(void *)mb_io_ptr->mb_io_extract_nav);
-		fprintf(stderr,"dbg2       insert_nav:         %p\n",(void *)mb_io_ptr->mb_io_insert_nav);
-		fprintf(stderr,"dbg2       extract_altitude:   %p\n",(void *)mb_io_ptr->mb_io_extract_altitude);
-		fprintf(stderr,"dbg2       insert_altitude:    %p\n",(void *)mb_io_ptr->mb_io_insert_altitude);
-		fprintf(stderr,"dbg2       extract_svp:        %p\n",(void *)mb_io_ptr->mb_io_extract_svp);
-		fprintf(stderr,"dbg2       insert_svp:         %p\n",(void *)mb_io_ptr->mb_io_insert_svp);
-		fprintf(stderr,"dbg2       ttimes:             %p\n",(void *)mb_io_ptr->mb_io_ttimes);
-		fprintf(stderr,"dbg2       detects:            %p\n",(void *)mb_io_ptr->mb_io_detects);
-		fprintf(stderr,"dbg2       extract_rawss:      %p\n",(void *)mb_io_ptr->mb_io_extract_rawss);
-		fprintf(stderr,"dbg2       insert_rawss:       %p\n",(void *)mb_io_ptr->mb_io_insert_rawss);
-		fprintf(stderr,"dbg2       copyrecord:         %p\n",(void *)mb_io_ptr->mb_io_copyrecord);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbr_info_em12ifrm(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error)
-{
-	char	*function_name = "mbr_info_em12ifrm";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* set format info parameters */
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-	*system = MB_SYS_SIMRAD;
-	*beams_bath_max = MBF_EM12IFRM_MAXBEAMS;
-	*beams_amp_max = MBF_EM12IFRM_MAXBEAMS;
-	*pixels_ss_max = MBF_EM12IFRM_MAXPIXELS;
-	strncpy(format_name, "EM12IFRM", MB_NAME_LENGTH);
-	strncpy(system_name, "SIMRAD", MB_NAME_LENGTH);
-	strncpy(format_description, "Format name:          MBF_EM12IFRM\nInformal Description: IFREMER TRISMUS format for Simrad EM12\nAttributes:           Simrad EM12S and EM12D,\n                     bathymetry, amplitude, and sidescan\n                      81 beams, variable pixels, binary,\n                      read-only, IFREMER.\n", MB_DESCRIPTION_LENGTH);
-	*numfile = -3;
-	*filetype = MB_FILETYPE_NORMAL;
-	*variable_beams = MB_NO;
-	*traveltime = MB_YES;
-	*beam_flagging = MB_YES;
-	*nav_source = MB_DATA_NAV;
-	*heading_source = MB_DATA_DATA;
-	*vru_source = MB_DATA_DATA;
-	*svp_source = MB_DATA_NONE;
-	*beamwidth_xtrack = 2.0;
-	*beamwidth_ltrack = 2.0;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",*system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",*beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",*beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",*pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",*numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",*filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",*variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",*traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",*beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",*nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",*heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",*vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",*svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",*beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",*beamwidth_ltrack);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_alm_em12ifrm(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_alm_em12ifrm";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct stat imgfile_status, navfile_status;
-	int	imgfile_stat, navfile_stat;
-	char	path[MB_PATH_MAXLINE];
-	char	imgtest[MB_PATH_MAXLINE];
-	char	navtest[MB_PATH_MAXLINE];
-	char	*tag_ptr;
-	char	*name;
-	double	*pixel_size;
-	double	*swath_width;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* allocate memory for data structure */
-	mb_io_ptr->structure_size = sizeof(struct mbf_em12ifrm_struct);
-	mb_io_ptr->data_structure_size = 0;
-	status = mb_malloc(verbose,mb_io_ptr->structure_size,
-				&mb_io_ptr->raw_data,error);
-	status = mbsys_simrad_alloc(
-			verbose,mbio_ptr,
-			&mb_io_ptr->store_data,error);
-
-	/* initialize everything to zeros */
-	mbr_zero_em12ifrm(verbose,mb_io_ptr->raw_data,error);
-	mb_io_ptr->save1 = MB_DATA_NONE;
-	mb_io_ptr->save2 = MB_YES;
-	mb_io_ptr->save3 = MB_YES;
-	mb_io_ptr->save4 = MB_NO;
-	pixel_size = &mb_io_ptr->saved1;
-	swath_width = &mb_io_ptr->saved2;
-	*pixel_size = 0.0;
-	*swath_width = 0.0;
-
-	/* now handle parallel files
-	   - works only if main input is *.SO
-	   - nav file is then *.NA
-	   - imagery file is then *.IM */
-
-	/* first look for imagery file */
-	if ((tag_ptr = strstr(mb_io_ptr->file, ".SO")) != NULL)
-		{
-		/* get the corresponding imagery file name */
-		strcpy(imgtest, mb_io_ptr->file);
-		tag_ptr = strstr(imgtest, ".SO");
-		tag_ptr[0] = '.';
-		tag_ptr[1] = 'I';
-		tag_ptr[2] = 'M';
-
-		/* check if imagery files are in same directory */
-		imgfile_stat = stat(imgtest, &imgfile_status);
-		if (imgfile_stat == 0
-		    && (imgfile_status.st_mode & S_IFMT) != S_IFDIR)
-		    {
-		    strcpy(mb_io_ptr->file2, imgtest);
-		    }
-		/* if imagery files don't exist then check if
-		   files in IFREMER TRISMUS archive directories */
-		else
-		    {
-		    /* get path */
-		    if ((name = strrchr(mb_io_ptr->file, '/')) != NULL)
-			{
-			strcpy(path, mb_io_ptr->file);
-			path[strlen(path) - strlen(name)] = '\0';
-			sprintf(imgtest, "%s/../imag%s", path, name);
-			}
-		    else
-			{
-			sprintf(imgtest, "../imag/%s", mb_io_ptr->file);
-			}
-		    tag_ptr = strstr(imgtest, ".SO");
-		    tag_ptr[0] = '.';
-		    tag_ptr[1] = 'I';
-		    tag_ptr[2] = 'M';
-
-		    /* check if files exist */
-		    imgfile_stat = stat(imgtest, &imgfile_status);
-		    if (imgfile_stat == 0
-			&& (imgfile_status.st_mode & S_IFMT) != S_IFDIR)
-			{
-			strcpy(mb_io_ptr->file2, imgtest);
-			}
-		    }
-		}
-
-	/* now look for nav file */
-	if ((tag_ptr = strstr(mb_io_ptr->file, ".SO")) != NULL)
-		{
-		/* get the corresponding nav file name */
-		strcpy(navtest, mb_io_ptr->file);
-		tag_ptr = strstr(navtest, ".SO");
-		tag_ptr[0] = '.';
-		tag_ptr[1] = 'N';
-		tag_ptr[2] = 'A';
-
-		/* check if nav files are in same directory */
-		navfile_stat = stat(navtest, &navfile_status);
-		if (navfile_stat == 0
-		    && (navfile_status.st_mode & S_IFMT) != S_IFDIR)
-		    {
-		    strcpy(mb_io_ptr->file3, navtest);
-		    }
-		/* if nav files don't exist then check if
-		   files in IFREMER TRISMUS archive directories */
-		else
-		    {
-		    /* get path */
-		    if ((name = strrchr(mb_io_ptr->file, '/')) != NULL)
-			{
-			strcpy(path, mb_io_ptr->file);
-			path[strlen(path) - strlen(name)] = '\0';
-			sprintf(navtest, "%s/../nav%s", path, name);
-			}
-		    else
-			{
-			sprintf(navtest, "../nav/%s", mb_io_ptr->file);
-			}
-		    tag_ptr = strstr(navtest, ".SO");
-		    tag_ptr[0] = '.';
-		    tag_ptr[1] = 'N';
-		    tag_ptr[2] = 'A';
-
-		    /* check if files exist */
-		    navfile_stat = stat(navtest, &navfile_status);
-		    if (navfile_stat == 0
-			&& (navfile_status.st_mode & S_IFMT) != S_IFDIR)
-			{
-			strcpy(mb_io_ptr->file3, navtest);
-			}
-		    }
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_dem_em12ifrm(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_dem_em12ifrm";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* deallocate memory for data descriptor */
-	status = mb_free(verbose,&mb_io_ptr->raw_data,error);
-	status = mbsys_simrad_deall(
-			verbose,mbio_ptr,
-			&mb_io_ptr->store_data,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_zero_em12ifrm(int verbose, char *data_ptr, int *error)
-{
-	char	*function_name = "mbr_zero_em12ifrm";
-	int	status = MB_SUCCESS;
-	struct mbf_em12ifrm_struct *data;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       data_ptr:   %p\n",(void *)data_ptr);
-		}
-
-	/* get pointer to data descriptor */
-	data = (struct mbf_em12ifrm_struct *) data_ptr;
-
-	/* initialize everything to zeros */
-	if (data != NULL)
-		{
-		data->kind = MB_DATA_NONE;
-		data->sonar = MBSYS_SIMRAD_EM12S;
-
-		/* parameter datagram */
-		data->par_year = 0;
-		data->par_month = 0;
-		data->par_day = 0;
-		data->par_hour = 0;
-		data->par_minute = 0;
-		data->par_second = 0;
-		data->par_centisecond = 0;
-		data->pos_type = 0;	/* positioning system type */
-		data->pos_delay = 0.0;	/* positioning system delay (sec) */
-		data->roll_offset = 0.0;	/* roll offset (degrees) */
-		data->pitch_offset = 0.0;	/* pitch offset (degrees) */
-		data->heading_offset = 0.0;	/* heading offset (degrees) */
-		data->em100_td = 0.0;	/* EM-100 tranducer depth (meters) */
-		data->em100_tx = 0.0;	/* EM-100 tranducer fore-aft
-						offset (meters) */
-		data->em100_ty = 0.0;	/* EM-100 tranducer athwartships
-						offset (meters) */
-		data->em12_td = 0.0;	/* EM-12 tranducer depth (meters) */
-		data->em12_tx = 0.0;	/* EM-12 tranducer fore-aft
-						offset (meters) */
-		data->em12_ty = 0.0;	/* EM-12 tranducer athwartships
-						offset (meters) */
-		data->em1000_td = 0.0;	/* EM-1000 tranducer depth (meters) */
-		data->em1000_tx = 0.0;	/* EM-1000 tranducer fore-aft
-						offset (meters) */
-		data->em1000_ty = 0.0;	/* EM-1000 tranducer athwartships
-						offset (meters) */
-		for (i=0;i<128;i++)
-			data->spare_parameter[i] = '\0';
-		data->survey_line = 0;
-		for (i=0;i<80;i++)
-			data->comment[i] = '\0';
-
-		/* position (position datagrams) */
-		data->pos_year = 0;
-		data->pos_month = 0;
-		data->pos_day = 0;
-		data->pos_hour = 0;
-		data->pos_minute = 0;
-		data->pos_second = 0;
-		data->pos_centisecond = 0;
-		data->latitude = 0.0;
-		data->longitude = 0.0;
-		data->utm_northing = 0.0;
-		data->utm_easting = 0.0;
-		data->utm_zone = 0;
-		data->utm_zone_lon = 0.0;
-		data->utm_system = 0;
-		data->pos_quality = 0;
-		data->speed = 0.0;			/* meters/second */
-		data->line_heading = 0.0;		/* degrees */
-
-		/* sound velocity profile */
-		data->svp_year = 0;
-		data->svp_month = 0;
-		data->svp_day = 0;
-		data->svp_hour = 0;
-		data->svp_minute = 0;
-		data->svp_second = 0;
-		data->svp_centisecond = 0;
-		data->svp_num = 0;
-		for (i=0;i<100;i++)
-			{
-			data->svp_depth[i] = 0; /* meters */
-			data->svp_vel[i] = 0;	/* 0.1 meters/sec */
-			}
-
-		/* time stamp */
-		data->year = 0;
-		data->month = 0;
-		data->day = 0;
-		data->hour = 0;
-		data->minute = 0;
-		data->second = 0;
-		data->centisecond = 0;
-		data->swath_id = EM_SWATH_CENTER;
-		data->ping_number = 0;
-		data->beams_bath = MBF_EM12IFRM_MAXBEAMS;
-		data->bath_mode = 0;
-		data->bath_res = 0;
-		data->bath_quality = 0;
-		data->keel_depth = 0;
-		data->heading = 0;
-		data->roll = 0;
-		data->pitch = 0;
-		data->xducer_pitch = 0;
-		data->ping_heave = 0;
-		data->sound_vel = 0;
-		data->pixels_ssraw = 0;
-		data->ss_mode = 0;
-		for (i=0;i<MBF_EM12IFRM_MAXBEAMS;i++)
-			{
-			data->bath[i] = 0;
-			data->bath_acrosstrack[i] = 0;
-			data->bath_alongtrack[i] = 0;
-			data->tt[i] = 0;
-			data->amp[i] = 0;
-			data->quality[i] = 0;
-			data->heave[i] = 0;
-			data->beam_frequency[i] = 0;
-			data->beam_samples[i] = 0;
-			data->beam_center_sample[i] = 0;
-			data->beam_start_sample[i] = 0;
-			}
-		for (i=0;i<MBF_EM12IFRM_MAXRAWPIXELS;i++)
-			{
-			data->ssraw[i] = 0;
-			data->ssp[i] = 0;
-			}
-		data->pixel_size = 0.0;
-		data->pixels_ss = 0;
-		for (i=0;i<MBF_EM12IFRM_MAXPIXELS;i++)
-			{
-			data->ss[i] = 0.0;
-			data->ssalongtrack[i] = 0.0;
-			}
-		}
-
-	/* assume success */
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_rt_em12ifrm(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_rt_em12ifrm";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_em12ifrm_struct *data;
-	struct mbsys_simrad_struct *store;
-	struct mbsys_simrad_survey_struct *ping;
-	int	*save_ss;
-	int	ntime_i[7];
-	double	ntime_d;
-	int	ptime_i[7];
-	double	ptime_d;
-	double	plon, plat, pspeed;
-	double	*pixel_size, *swath_width;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_em12ifrm_struct *) mb_io_ptr->raw_data;
-	store = (struct mbsys_simrad_struct *) store_ptr;
-	save_ss = (int *) &mb_io_ptr->save4;
-	pixel_size = (double *) &mb_io_ptr->saved1;
-	swath_width = (double *) &mb_io_ptr->saved2;
-
-	/* read next data from file */
-	status = mbr_em12ifrm_rd_data(verbose,mbio_ptr,error);
-
-	/* set error and kind in mb_io_ptr */
-	mb_io_ptr->new_error = *error;
-	mb_io_ptr->new_kind = data->kind;
-
-	/* save fix if nav data */
-	if (status == MB_SUCCESS
-		&& data->kind == MB_DATA_NAV)
-		{
-		/* get nav time */
-		mb_fix_y2k(verbose, data->pos_year,
-			    &ntime_i[0]);
-		ntime_i[1] = data->pos_month;
-		ntime_i[2] = data->pos_day;
-		ntime_i[3] = data->pos_hour;
-		ntime_i[4] = data->pos_minute;
-		ntime_i[5] = data->pos_second;
-		ntime_i[6] = 10000 * data->pos_centisecond;
-		mb_get_time(verbose, ntime_i, &ntime_d);
-
-		/* add latest fix */
-		mb_navint_add(verbose, mbio_ptr,
-				ntime_d,
-				(double)(data->longitude),
-				(double)(data->latitude),
-				error);
-		}
-
-	/* handle navigation interpolation */
-	if (status == MB_SUCCESS
-		&& data->kind == MB_DATA_DATA)
-		{
-		/* get ping time */
-		mb_fix_y2k(verbose, data->year,
-			    &ptime_i[0]);
-		ptime_i[1] = data->month;
-		ptime_i[2] = data->day;
-		ptime_i[3] = data->hour;
-		ptime_i[4] = data->minute;
-		ptime_i[5] = data->second;
-		ptime_i[6] = 10000*data->centisecond;
-		mb_get_time(verbose, ptime_i, &ptime_d);
-
-		/* interpolate from saved nav */
-		mb_navint_interp(verbose, mbio_ptr, ptime_d,
-				    (double)data->line_heading, 0.0,
-				    &plon, &plat, &pspeed, error);
-		data->speed = pspeed / 3.6;
-\
-		/* print debug statements */
-		if (verbose >= 4)
-			{
-			fprintf(stderr,"dbg4     Interpolated Navigation:\n");
-			fprintf(stderr,"dbg4       longitude:  %f\n", plon);
-			fprintf(stderr,"dbg4       latitude:   %f\n", plat);
-			fprintf(stderr,"dbg4       speed:      %f\n", pspeed);
-			}
-		}
-
-	/* translate values to simrad data storage structure */
-	if (status == MB_SUCCESS
-		&& store != NULL)
-		{
-		store->kind = data->kind;
-		store->sonar = data->sonar;
-
-		/* parameter datagram */
-		store->par_year = data->par_year;
-		store->par_month = data->par_month;
-		store->par_day = data->par_day;
-		store->par_hour = data->par_hour;
-		store->par_minute = data->par_minute;
-		store->par_second = data->par_second;
-		store->par_centisecond = data->par_centisecond;
-		store->pos_type = data->pos_type;
-		store->pos_delay = data->pos_delay;
-		store->roll_offset = data->roll_offset;
-		store->pitch_offset = data->pitch_offset;
-		store->heading_offset = data->heading_offset;
-		store->em100_td = data->em100_td;
-		store->em100_tx = data->em100_tx;
-		store->em100_ty = data->em100_ty;
-		store->em12_td = data->em12_td;
-		store->em12_tx = data->em12_tx;
-		store->em12_ty = data->em12_ty;
-		store->em1000_td = data->em1000_td;
-		store->em1000_tx = data->em1000_tx;
-		store->em1000_ty = data->em1000_ty;
-		for (i=0;i<128;i++)
-			store->spare_parameter[i] = data->spare_parameter[i];
-		store->survey_line = data->survey_line;
-		for (i=0;i<80;i++)
-			store->comment[i] = data->comment[i];
-
-		/* position (position datagrams) */
-		store->pos_year = data->pos_year;
-		store->pos_month = data->pos_month;
-		store->pos_day = data->pos_day;
-		store->pos_hour = data->pos_hour;
-		store->pos_minute = data->pos_minute;
-		store->pos_second = data->pos_second;
-		store->pos_centisecond = data->pos_centisecond;
-		store->pos_latitude = data->latitude;
-		store->pos_longitude = data->longitude;
-		store->utm_northing = data->utm_northing;
-		store->utm_easting = data->utm_easting;
-		store->utm_zone = data->utm_zone;
-		store->utm_zone_lon = data->utm_zone_lon;
-		store->utm_system = data->utm_system;
-		store->pos_quality = data->pos_quality;
-		store->speed = data->speed;
-		store->line_heading = data->line_heading;
-
-		/* sound velocity profile */
-		store->svp_year = data->svp_year;
-		store->svp_month = data->svp_month;
-		store->svp_day = data->svp_day;
-		store->svp_hour = data->svp_hour;
-		store->svp_minute = data->svp_minute;
-		store->svp_second = data->svp_second;
-		store->svp_centisecond = data->svp_centisecond;
-		store->svp_num = data->svp_num;
-		for (i=0;i<100;i++)
-			{
-			store->svp_depth[i] = data->svp_depth[i];
-			store->svp_vel[i] = data->svp_vel[i];
-			}
-
-		/* time stamp */
-		store->year = data->year;
-		store->month = data->month;
-		store->day = data->day;
-		store->hour = data->hour;
-		store->minute = data->minute;
-		store->second = data->second;
-		store->centisecond = data->centisecond;
-
-		/* allocate secondary data structure for
-			survey data if needed */
-		if (data->kind == MB_DATA_DATA
-			&& store->ping == NULL)
-			{
-			status = mbsys_simrad_survey_alloc(
-					verbose,mbio_ptr,
-					store_ptr,error);
-			}
-
-		/* deal with putting survey data into
-		secondary data structure */
-		if (status == MB_SUCCESS
-			&& data->kind == MB_DATA_DATA)
-			{
-			/* get data structure pointer */
-			ping = (struct mbsys_simrad_survey_struct *)
-				store->ping;
-
-			/* copy data */
-			ping->longitude = plon;
-			ping->latitude = plat;
-			ping->swath_id = data->swath_id;
-			ping->ping_number = data->ping_number;
-			ping->beams_bath = data->beams_bath;
-			ping->bath_mode = data->bath_mode;
-			ping->bath_res = data->bath_res;
-			ping->bath_quality = data->bath_quality;
-			ping->keel_depth = data->keel_depth;
-			ping->heading = data->heading;
-			ping->roll = data->roll;
-			ping->pitch = data->pitch;
-			ping->xducer_pitch = data->xducer_pitch;
-			ping->ping_heave = data->ping_heave;
-			ping->sound_vel = data->sound_vel;
-			ping->pixels_ssraw = 0;
-			ping->ss_mode = 0;
-			for (i=0;i<ping->beams_bath;i++)
-				{
-				if (data->bath[i] > 0)
-					{
-					ping->bath[i] = data->bath[i];
-					ping->beamflag[i] = MB_FLAG_NONE;
-					}
-				else if (data->bath[i] < 0)
-					{
-					ping->bath[i] = -data->bath[i];
-					ping->beamflag[i] = MB_FLAG_FLAG + MB_FLAG_MANUAL;
-					}
-				else
-					{
-					ping->bath[i] = data->bath[i];
-					ping->beamflag[i] = MB_FLAG_NULL;
-					}
-				ping->bath_acrosstrack[i] = data->bath_acrosstrack[i];
-				ping->bath_alongtrack[i] = data->bath_alongtrack[i];
-				ping->tt[i] = data->tt[i];
-				ping->amp[i] = data->amp[i];
-				ping->quality[i] = data->quality[i];
-				ping->heave[i] = data->heave[i];
-				ping->beam_frequency[i] = 0;
-				ping->beam_samples[i] = 0;
-				ping->beam_center_sample[i] = 0;
-				ping->beam_start_sample[i] = 0;
-				}
-			if (*save_ss == MB_NO)
-				{
-				ping->pixels_ssraw = data->pixels_ssraw;
-				ping->ss_mode = data->ss_mode;
-				for (i=0;i<ping->beams_bath;i++)
-					{
-					ping->beam_frequency[i] = data->beam_frequency[i];
-					ping->beam_samples[i] = data->beam_samples[i];
-					ping->beam_center_sample[i]
-						= data->beam_center_sample[i];
-					ping->beam_start_sample[i]
-						= data->beam_start_sample[i];
-					}
-				for (i=0;i<ping->pixels_ssraw;i++)
-					{
-					ping->ssraw[i] = data->ssraw[i];
-					ping->ssp[i] = data->ssp[i];
-					}
-				}
-
-			/* generate sidescan */
-			ping->pixel_size = 0.0;
-			ping->pixels_ss = 0;
-			status = mbsys_simrad_makess(verbose,
-					mbio_ptr, store_ptr,
-					MB_NO, pixel_size,
-					MB_NO, swath_width,
-					0,
-					error);
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_wt_em12ifrm(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_wt_em12ifrm";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_em12ifrm_struct *data;
-	char	*data_ptr;
-	struct mbsys_simrad_struct *store;
-	struct mbsys_simrad_survey_struct *ping;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_em12ifrm_struct *) mb_io_ptr->raw_data;
-	data_ptr = (char *) data;
-	store = (struct mbsys_simrad_struct *) store_ptr;
-
-	/* first translate values from data storage structure */
-	if (store != NULL)
-		{
-		data->kind = store->kind;
-		data->sonar = store->sonar;
-
-		/* parameter datagram */
-		data->par_year = store->par_year;
-		data->par_month = store->par_month;
-		data->par_day = store->par_day;
-		data->par_hour = store->par_hour;
-		data->par_minute = store->par_minute;
-		data->par_second = store->par_second;
-		data->par_centisecond = store->par_centisecond;
-		data->pos_type = store->pos_type;
-		data->pos_delay = store->pos_delay;
-		data->roll_offset = store->roll_offset;
-		data->pitch_offset = store->pitch_offset;
-		data->heading_offset = store->heading_offset;
-		data->em100_td = store->em100_td;
-		data->em100_tx = store->em100_tx;
-		data->em100_ty = store->em100_ty;
-		data->em12_td = store->em12_td;
-		data->em12_tx = store->em12_tx;
-		data->em12_ty = store->em12_ty;
-		data->em1000_td = store->em1000_td;
-		data->em1000_tx = store->em1000_tx;
-		data->em1000_ty = store->em1000_ty;
-		for (i=0;i<128;i++)
-			data->spare_parameter[i] = store->spare_parameter[i];
-		data->survey_line = store->survey_line;
-		for (i=0;i<80;i++)
-			data->comment[i] = store->comment[i];
-
-		/* position (position datagrams) */
-		data->pos_year = store->pos_year;
-		data->pos_month = store->pos_month;
-		data->pos_day = store->pos_day;
-		data->pos_hour = store->pos_hour;
-		data->pos_minute = store->pos_minute;
-		data->pos_second = store->pos_second;
-		data->pos_centisecond = store->pos_centisecond;
-		data->latitude = store->pos_latitude;
-		data->longitude = store->pos_longitude;
-		data->utm_northing = store->utm_northing;
-		data->utm_easting = store->utm_easting;
-		data->utm_zone = store->utm_zone;
-		data->utm_zone_lon = store->utm_zone_lon;
-		data->utm_system = store->utm_system;
-		data->pos_quality = store->pos_quality;
-		data->speed = store->speed;
-		data->line_heading = store->line_heading;
-
-		/* sound velocity profile */
-		data->svp_year = store->svp_year;
-		data->svp_month = store->svp_month;
-		data->svp_day = store->svp_day;
-		data->svp_hour = store->svp_hour;
-		data->svp_minute = store->svp_minute;
-		data->svp_second = store->svp_second;
-		data->svp_centisecond = store->svp_centisecond;
-		data->svp_num = store->svp_num;
-		for (i=0;i<100;i++)
-			{
-			data->svp_depth[i] = store->svp_depth[i];
-			data->svp_vel[i] = store->svp_vel[i];
-			}
-
-		/* time stamp */
-		data->year = store->year;
-		data->month = store->month;
-		data->day = store->day;
-		data->hour = store->hour;
-		data->minute = store->minute;
-		data->second = store->second;
-		data->centisecond = store->centisecond;
-
-		/* deal with survey data
-			in secondary data structure */
-		if (store->ping != NULL)
-			{
-			/* get data structure pointer */
-			ping = (struct mbsys_simrad_survey_struct *)
-				store->ping;
-
-			/* copy survey data */
-			data->swath_id = ping->swath_id;
-			data->ping_number = ping->ping_number;
-			data->beams_bath = ping->beams_bath;
-			data->bath_mode = ping->bath_mode;
-			data->bath_res = ping->bath_res;
-			data->bath_quality = ping->bath_quality;
-			data->keel_depth = ping->keel_depth;
-			data->heading = ping->heading;
-			data->roll = ping->roll;
-			data->pitch = ping->pitch;
-			data->xducer_pitch = ping->xducer_pitch;
-			data->ping_heave = ping->ping_heave;
-			data->sound_vel = ping->sound_vel;
-			data->pixels_ssraw = ping->pixels_ssraw;
-			data->ss_mode = ping->ss_mode;
-			for (i=0;i<data->beams_bath;i++)
-				{
-				if (ping->beamflag[i] == MB_FLAG_NULL)
-					data->bath[i] = 0;
-				else if (!mb_beam_ok(ping->beamflag[i]))
-					data->bath[i] = -ping->bath[i];
-				else
-					data->bath[i] = ping->bath[i];
-				data->bath_acrosstrack[i] = ping->bath_acrosstrack[i];
-				data->bath_alongtrack[i] = ping->bath_alongtrack[i];
-				data->tt[i] = ping->tt[i];
-				data->amp[i] = ping->amp[i];
-				data->quality[i] = ping->quality[i];
-				data->heave[i] = ping->heave[i];
-				data->beam_frequency[i] = ping->beam_frequency[i];
-				data->beam_samples[i] = ping->beam_samples[i];
-				data->beam_center_sample[i]
-					= ping->beam_center_sample[i];
-				data->beam_start_sample[i]
-					= ping->beam_start_sample[i];
-				}
-			for (i=0;i<data->pixels_ssraw;i++)
-				{
-				data->ssraw[i] = ping->ssraw[i];
-				data->ssp[i] = ping->ssp[i];
-				}
-			}
-		}
-
-	/* set error as this is a read only format */
-	status = MB_FAILURE;
-	*error = MB_ERROR_WRITE_FAIL;
-
-	/* write next data to file */
-	/*status = mbr_em12ifrm_wr_data(verbose,mbio_ptr,data_ptr,error);*/
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-
-int mbr_em12ifrm_rd_data(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_em12ifrm_rd_data";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_em12ifrm_struct *data;
-	int	*save_data;
-	int	*nav_available;
-	int	*ss_available;
-	int	*save_ss;
-	int	done;
-	int	ptime_i[7];
-	double	ptime_d;
-	int	read_status;
-	char	line[MBF_EM12IFRM_RECORD_SIZE];
-	int	shift;
-	short	short_value;
-	int	len;
-	int	beamlist[MBF_EM12IFRM_MAXBEAMS];
-	mb_s_char *beam_ss;
-	int	*ss_swath_id;
-	int	*ss_day;
-	int	*ss_month;
-	int	*ss_year;
-	int	*ss_hour;
-	int	*ss_minute;
-	int	*ss_second;
-	int	*ss_centisecond;
-	int	*ss_ping_number;
-	int	*ss_num_beams;
-	int	navdone;
-	char	*result;
-	char	NorS, EorW;
-	int	latdeg, londeg;
-	double	latmin, lonmin;
-	int	i, j, k;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_em12ifrm_struct *) mb_io_ptr->raw_data;
-
-	/* set file position */
-	mb_io_ptr->file_pos = mb_io_ptr->file_bytes;
-
-	/* check if any data is required */
-	done = MB_NO;
-	save_data = (int *) &mb_io_ptr->save1;
-	nav_available = (int *) &mb_io_ptr->save2;
-	ss_available = (int *) &mb_io_ptr->save3;
-	save_ss = (int *) &mb_io_ptr->save4;
-	ss_swath_id = (int *) &mb_io_ptr->save5;
-	ss_day = (int *) &mb_io_ptr->save6;
-	ss_month = (int *) &mb_io_ptr->save7;
-	ss_year = (int *) &mb_io_ptr->save8;
-	ss_hour = (int *) &mb_io_ptr->save9;
-	ss_minute = (int *) &mb_io_ptr->save10;
-	ss_second = (int *) &mb_io_ptr->save11;
-	ss_centisecond = (int *) &mb_io_ptr->save12;
-	ss_ping_number = (int *) &mb_io_ptr->save13;
-	ss_num_beams = (int *) &mb_io_ptr->save14;
-	if (*save_data == MB_DATA_DATA)
-		{
-		data->kind = MB_DATA_DATA;
-		*save_data = MB_DATA_NONE;
-		done = MB_YES;
-		status = MB_SUCCESS;
-		*error = MB_ERROR_NO_ERROR;
-		}
-	else if (*save_data == MB_DATA_NAV)
-		{
-		data->kind = MB_DATA_NAV;
-		*save_data = MB_DATA_NONE;
-		done = MB_YES;
-		status = MB_SUCCESS;
-		*error = MB_ERROR_NO_ERROR;
-		}
-
-	/* if not done and no data saved then read next primary record */
-	if (done == MB_NO && *save_data == MB_DATA_NONE)
-		{
-		if ((read_status = fread(line,1,MBF_EM12IFRM_RECORD_SIZE,
-				mb_io_ptr->mbfp)) == MBF_EM12IFRM_RECORD_SIZE)
-			{
-			mb_io_ptr->file_bytes += read_status;
-			status = MB_SUCCESS;
-			*error = MB_ERROR_NO_ERROR;
-			}
-		else
-			{
-			mb_io_ptr->file_bytes += read_status;
-			status = MB_FAILURE;
-			*error = MB_ERROR_EOF;
-			}
-
-		/* translate values to em12 data storage structure */
-		if (status == MB_SUCCESS)
-			{
-			/* figure out type of data record */
-			if (strncmp(line, "$12SOC", 6) == 0)
-				{
-				data->kind = MB_DATA_DATA;
-				data->sonar = MBSYS_SIMRAD_EM12S;
-				}
-			else if (strncmp(line, "$12SOB", 6) == 0)
-				{
-				data->kind = MB_DATA_DATA;
-				data->sonar = MBSYS_SIMRAD_EM12D;
-				}
-			else if (strncmp(line, "$12SOT", 6) == 0)
-				{
-				data->kind = MB_DATA_DATA;
-				data->sonar = MBSYS_SIMRAD_EM12D;
-				}
-			else if (strncmp(line, "$COMM:", 6) == 0)
-				{
-				data->kind = MB_DATA_COMMENT;
-				data->sonar = MBSYS_SIMRAD_EM12S;
-				}
-			else
-				{
-				*error = MB_ERROR_UNINTELLIGIBLE;
-				status = MB_FAILURE;
-				}
-			}
-
-		/* deal with data record */
-		if (status == MB_SUCCESS
-			&& data->kind == MB_DATA_DATA)
-			{
-			/* get kind of ping */
-			shift = 5;
-			if (line[shift] == 'C')
-				data->swath_id = EM_SWATH_CENTER;
-			else if (line[shift] == 'B')
-				data->swath_id = EM_SWATH_PORT;
-			else if (line[shift] == 'T')
-				data->swath_id = EM_SWATH_STARBOARD;
-			shift += 2;
-
-			/* get time */
-			mb_get_int(&data->day, &line[shift], 2); shift += 3;
-			mb_get_int(&data->month, &line[shift], 2); shift += 3;
-			mb_get_int(&data->year, &line[shift], 2); shift += 3;
-			mb_get_int(&data->hour, &line[shift], 2); shift += 3;
-			mb_get_int(&data->minute, &line[shift], 2); shift += 3;
-			mb_get_int(&data->second, &line[shift], 2); shift += 3;
-			mb_get_int(&data->centisecond, &line[shift], 2); shift += 11;
-
-			/* no navigation in this format - imagine that!!!! */
-			data->longitude = 0.0;
-			data->latitude = 0.0;
-
-			/* get binary header */
-			mb_get_binary_short(MB_NO, &line[shift], &short_value);
-			data->ping_number = (int) short_value; shift += 2;
-			data->bath_res = (int) line[shift]; shift += 1;
-			data->bath_quality = (int) line[shift]; shift += 1;
-			mb_get_binary_short(MB_NO, &line[shift], &short_value);
-			data->keel_depth = (int) short_value; shift += 2;
-			mb_get_binary_short(MB_NO, &line[shift], &short_value);
-			data->heading = (int) short_value; shift += 2;
-			mb_get_binary_short(MB_NO, &line[shift], &short_value);
-			data->roll = (int) short_value; shift += 2;
-			mb_get_binary_short(MB_NO, &line[shift], &short_value);
-			data->pitch = (int) short_value; shift += 2;
-			data->xducer_pitch = data->pitch;
-			mb_get_binary_short(MB_NO, &line[shift], &short_value);
-			data->ping_heave = (int) short_value; shift += 2;
-			mb_get_binary_short(MB_NO, &line[shift], &short_value);
-			data->sound_vel = (int) short_value; shift += 2;
-			data->bath_mode = (int) line[shift]; shift += 2;
-
-			/* get bathymetry */
-			data->beams_bath = MBF_EM12IFRM_MAXBEAMS;
-			for (i=0;i<MBF_EM12IFRM_MAXBEAMS;i++)
-				{
-				mb_get_binary_short(MB_NO, &line[shift], &short_value);
-				data->bath[i] = (int) short_value; shift += 2;
-				mb_get_binary_short(MB_NO, &line[shift], &short_value);
-				data->bath_acrosstrack[i] = (int) short_value; shift += 2;
-				mb_get_binary_short(MB_NO, &line[shift], &short_value);
-				data->bath_alongtrack[i] = (int) short_value; shift += 2;
-				mb_get_binary_short(MB_NO, &line[shift], &short_value);
-				data->tt[i] = (int) short_value; shift += 2;
-				data->amp[i] = (int) line[shift]; shift += 1;
-				data->quality[i] = (int) line[shift]; shift += 1;
-				data->heave[i] = (int) line[shift]; shift += 2;
-				}
-
-			/* use sidescan if saved */
-			if (*save_ss == MB_YES
-				&& *ss_ping_number == data->ping_number
-				&& *ss_swath_id == data->swath_id)
-				{
-				done = MB_YES;
-				}
-
-			/* initialize sidescan if none saved */
-			else if (*save_ss == MB_NO)
-				{
-				data->pixels_ssraw = 0;
-				for (i=0;i<MBF_EM12IFRM_MAXBEAMS;i++)
-					{
-					beamlist[i] = 0;
-					data->beam_frequency[i] = 0;
-					data->beam_samples[i] = 0;
-					data->beam_start_sample[i] = 0;
-					data->beam_start_sample[i] = 0;
-					}
-				for (i=0;i<MBF_EM12IFRM_MAXRAWPIXELS;i++)
-					{
-					data->ssraw[i] = 0;
-					data->ssp[i] = 0;
-					}
-				}
-			}
-
-		/* deal with comment */
-		else if (status == MB_SUCCESS
-			&& data->kind == MB_DATA_COMMENT)
-			{
-			shift = 6;
-			mb_get_int(&len, &line[shift], 3); shift += 4;
-			strncpy(data->comment, &line[shift],
-				MIN(len, MBSYS_SIMRAD_COMMENT_LENGTH-1));
-			data->comment[MIN(len+1, MBSYS_SIMRAD_COMMENT_LENGTH)] = '\0';
-			done = MB_YES;
-			}
-		}
-
-	/* if not done and no data saved and good bathy record read
-	    then read next sidescan record if available */
-	if (status == MB_SUCCESS
-		&& mb_io_ptr->mbfp2 != NULL
-		&& done == MB_NO && *save_data == MB_DATA_NONE)
-		{
-		/* read sidescan until it matches ping number and side */
-		*ss_ping_number = 0;
-		while (done == MB_NO
-		    && *ss_available == MB_YES
-		    && *ss_ping_number <= data->ping_number)
-		    {
-		    /* read sidescan header from sidescan file */
-		    if ((read_status = fread(line,1,MBF_EM12IFRM_SSHEADER_SIZE,
-				mb_io_ptr->mbfp2)) == MBF_EM12IFRM_SSHEADER_SIZE)
-			{
-			mb_io_ptr->file2_bytes += read_status;
-			status = MB_SUCCESS;
-			*error = MB_ERROR_NO_ERROR;
-			}
-		    else
-			{
-			mb_io_ptr->file2_bytes += read_status;
-			status = MB_FAILURE;
-			*error = MB_ERROR_EOF;
-			}
-
-		    /* deal with data record */
-		    if (status == MB_SUCCESS)
-			{
-			/* get kind of ping */
-			shift = 5;
-			if (line[shift] == 'C')
-				*ss_swath_id = EM_SWATH_CENTER;
-			else if (line[shift] == 'B')
-				*ss_swath_id = EM_SWATH_PORT;
-			else if (line[shift] == 'T')
-				*ss_swath_id = EM_SWATH_STARBOARD;
-			shift += 2;
-
-			/* get time */
-			mb_get_int(ss_day, &line[shift], 2); shift += 3;
-			mb_get_int(ss_month, &line[shift], 2); shift += 3;
-			mb_get_int(ss_year, &line[shift], 2); shift += 3;
-			mb_get_int(ss_hour, &line[shift], 2); shift += 3;
-			mb_get_int(ss_minute, &line[shift], 2); shift += 3;
-			mb_get_int(ss_second, &line[shift], 2); shift += 3;
-			mb_get_int(ss_centisecond, &line[shift], 2); shift += 11;
-
-			/* get binary header */
-			mb_get_binary_short(MB_NO, &line[shift], &short_value);
-			*ss_ping_number = (int) short_value; shift += 2;
-			data->ss_mode = (int) line[shift]; shift += 1;
-			shift += 1;
-			shift += 1;
-			*ss_num_beams = (int) line[shift]; shift += 1;
-
-			/* loop over all beams */
-			for (i=0;i<*ss_num_beams;i++)
-				{
-				if ((read_status = fread(line,1,MBF_EM12IFRM_SSBEAMHEADER_SIZE,
-						mb_io_ptr->mbfp2)) != MBF_EM12IFRM_SSBEAMHEADER_SIZE)
-					{
-					status = MB_FAILURE;
-					*error = MB_ERROR_EOF;
-					}
-				shift = 0;
-				beamlist[i] = ((int) line[shift]) - 1; shift += 1;
-				data->beam_frequency[beamlist[i]] = (int) line[shift]; shift += 1;
-				mb_get_binary_short(MB_NO, &line[shift], &short_value);
-				data->beam_samples[beamlist[i]] = (int) short_value; shift += 2;
-				mb_get_binary_short(MB_NO, &line[shift], &short_value);
-				data->beam_center_sample[beamlist[i]] = (int) short_value; shift += 2;
-				}
-
-			/* load up the sidescan for each beam */
-			for (i=0;i<*ss_num_beams;i++)
-				{
-				if ((read_status = fread(line,1,data->beam_samples[beamlist[i]],
-						mb_io_ptr->mbfp2)) != data->beam_samples[beamlist[i]])
-					{
-					status = MB_FAILURE;
-					*error = MB_ERROR_EOF;
-					}
-				mb_io_ptr->file2_bytes += read_status;
-
-				/* do not ever load more data than we can store */
-				if (data->pixels_ssraw + data->beam_samples[beamlist[i]]
-					> MBF_EM12IFRM_MAXRAWPIXELS)
-					data->beam_samples[beamlist[i]] = 0;
-
-				/* get the sidescan */
-				data->beam_start_sample[beamlist[i]] = data->pixels_ssraw;
-				shift = 0;
-				for (j=0;j<data->beam_samples[beamlist[i]];j++)
-					{
-					data->ssraw[data->pixels_ssraw] = (mb_s_char) line[shift];
-					shift++;
-					data->pixels_ssraw++;
-					}
-				}
-
-			/* read last few bytes of record */
-			line[0] = 0;
-			while (status == MB_SUCCESS && line[0] != '\n')
-				{
-				if ((read_status = fread(line,1,1,
-						mb_io_ptr->mbfp2)) != 1)
-					{
-					status = MB_FAILURE;
-					*error = MB_ERROR_EOF;
-					}
-				}
-			}
-
-		    /* now check status */
-		    if (status == MB_SUCCESS
-			&& *ss_ping_number == data->ping_number
-			&& *ss_swath_id == data->swath_id)
-			{
-			done = MB_YES;
-			*save_ss = MB_NO;
-			}
-		    else if (status == MB_SUCCESS
-			&& *ss_ping_number > data->ping_number)
-			{
-			done = MB_YES;
-			*save_ss = MB_YES;
-			}
-		    else if (status == MB_SUCCESS)
-			{
-			done = MB_NO;
-			*save_ss = MB_NO;
-			}
-		    else if (status == MB_FAILURE)
-			{
-			done = MB_YES;
-			*ss_available = MB_NO;
-			status = MB_SUCCESS;
-			*error = MB_ERROR_NO_ERROR;
-			}
-		    }
-		}
-
-	/* now check if nav needed */
-	if (status == MB_SUCCESS
-		&& data->kind == MB_DATA_DATA
-		&& (mb_io_ptr->mbfp2 == NULL || done == MB_YES)
-		&& mb_io_ptr->mbfp3 != NULL)
-		{
-		/* get ping time */
-		mb_fix_y2k(verbose, data->year,
-			    &ptime_i[0]);
-		ptime_i[1] = data->month;
-		ptime_i[2] = data->day;
-		ptime_i[3] = data->hour;
-		ptime_i[4] = data->minute;
-		ptime_i[5] = data->second;
-		ptime_i[6] = 10000*data->centisecond;
-		mb_get_time(verbose, ptime_i, &ptime_d);
-
-		/* see if nav is needed and potentially available */
-		if (*nav_available == MB_YES
-		    && (mb_io_ptr->nfix == 0
-			    || mb_io_ptr->fix_time_d[mb_io_ptr->nfix-1]
-				< ptime_d))
-			{
-			navdone = MB_NO;
-			while (navdone == MB_NO)
-			    {
-			    if ((result = fgets(line,MBF_EM12IFRM_RECORD_SIZE,
-						mb_io_ptr->mbfp3)) != line)
-				{
-				navdone = MB_YES;
-				*nav_available = MB_NO;
-				}
-			    else
-				{
-				mb_io_ptr->file3_bytes += strlen(line);
-				shift = 29;
-				if (strncmp(&line[shift], "NACOU", 5) == 0)
-				    {
-				    /* get time */
-				    shift = 7;
-				    mb_get_int(&data->pos_day, &line[shift], 2); shift += 3;
-				    mb_get_int(&data->pos_month, &line[shift], 2); shift += 3;
-				    mb_get_int(&data->pos_year, &line[shift], 2); shift += 3;
-				    mb_get_int(&data->pos_hour, &line[shift], 2); shift += 3;
-				    mb_get_int(&data->pos_minute, &line[shift], 2); shift += 3;
-				    mb_get_int(&data->pos_second, &line[shift], 2); shift += 3;
-				    mb_get_int(&data->pos_centisecond, &line[shift], 2); shift += 10;
-
-				    /* get navigation */
-				    NorS = line[shift]; shift += 2;
-				    mb_get_int(&latdeg, &line[shift], 2); shift += 3;
-				    mb_get_double(&latmin, &line[shift], 8); shift += 9;
-				    EorW = line[shift]; shift += 2;
-				    mb_get_int(&londeg, &line[shift], 3); shift += 4;
-				    mb_get_double(&lonmin, &line[shift], 8); shift += 42;
-				    mb_get_double(&data->line_heading, &line[shift], 6); shift += 6;
-				    data->latitude = latdeg + latmin / 60.0;
-				    if (NorS == 'S')
-					data->latitude = -data->latitude;
-				    data->longitude = londeg + lonmin / 60.0;
-				    if (EorW == 'W')
-					data->longitude = -data->longitude;
-				    data->speed = 0.0;
-/*fprintf(stderr, "time: %2.2d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%2.2d lat: %c %2d %8.5f  lon: %c %3d %9.5f\n",
-data->pos_day, data->pos_month, data->pos_year,
-data->pos_hour, data->pos_minute, data->pos_second, data->pos_centisecond,
-NorS, latdeg, latmin, EorW, londeg, lonmin);*/
-
-				    navdone = MB_YES;
-				    data->kind = MB_DATA_NAV;
-				    *save_data = MB_DATA_DATA;
-				    done = MB_YES;
-				    status = MB_SUCCESS;
-				    *error = MB_ERROR_NO_ERROR;
-				    }
-				}
-			    }
-			}
-		}
-
-	/* print debug statements */
-	if (verbose >= 5
-		&& data->kind == MB_DATA_DATA)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       year:             %d\n",data->year);
-		fprintf(stderr,"dbg5       month:            %d\n",data->month);
-		fprintf(stderr,"dbg5       day:              %d\n",data->day);
-		fprintf(stderr,"dbg5       hour:             %d\n",data->hour);
-		fprintf(stderr,"dbg5       minute:           %d\n",data->minute);
-		fprintf(stderr,"dbg5       sec:              %d\n",data->second);
-		fprintf(stderr,"dbg5       centisecond:      %d\n",data->centisecond);
-		fprintf(stderr,"dbg5       ping_number:      %d\n",data->ping_number);
-		fprintf(stderr,"dbg5       beams_bath:       %d\n",data->beams_bath);
-		fprintf(stderr,"dbg5       bath_res:         %d\n",data->bath_res);
-		fprintf(stderr,"dbg5       bath_quality:     %d\n",data->bath_quality);
-		fprintf(stderr,"dbg5       keel_depth:       %d\n",data->keel_depth);
-		fprintf(stderr,"dbg5       heading:          %d\n",data->heading);
-		fprintf(stderr,"dbg5       roll:             %d\n",data->roll);
-		fprintf(stderr,"dbg5       pitch:            %d\n",data->pitch);
-		fprintf(stderr,"dbg5       ping_heave:       %d\n",data->ping_heave);
-		fprintf(stderr,"dbg5       sound_vel:        %d\n",data->sound_vel);
-		fprintf(stderr,"dbg5       bath_mode:        %d\n",data->bath_mode);
-		fprintf(stderr,"dbg5       beam bath xtrack ltrack tt amp qual heave\n");
-		for (i=0;i<data->beams_bath;i++)
-			fprintf(stderr,"dbg5       beam:%d  bath:%d  xtrck:%d  ltrck:%d tt:%d  amp:%d  qual:%d  heave:%d\n",
-				i,data->bath[i],data->bath_acrosstrack[i],
-				data->bath_alongtrack[i],data->tt[i],
-				data->amp[i],data->quality[i],data->heave[i]);
-		fprintf(stderr,"dbg5       year:             %d\n",*ss_year);
-		fprintf(stderr,"dbg5       month:            %d\n",*ss_month);
-		fprintf(stderr,"dbg5       day:              %d\n",*ss_day);
-		fprintf(stderr,"dbg5       hour:             %d\n",*ss_hour);
-		fprintf(stderr,"dbg5       minute:           %d\n",*ss_minute);
-		fprintf(stderr,"dbg5       sec:              %d\n",*ss_second);
-		fprintf(stderr,"dbg5       centisecond:      %d\n",*ss_centisecond);
-		fprintf(stderr,"dbg5       ping_number:      %d\n",*ss_ping_number);
-		fprintf(stderr,"dbg5       ss_mode:          %d\n",data->ss_mode);
-		fprintf(stderr,"dbg5       ss_num_beams:     %d\n",*ss_num_beams);
-		fprintf(stderr,"dbg5       beam frequency samples center\n");
-		for (i=0;i<*ss_num_beams;i++)
-			fprintf(stderr,"dbg5       beam:%d  frequency:%d  samples:%d  center:%d  start:%d\n",
-				beamlist[i],data->beam_frequency[beamlist[i]],
-				data->beam_samples[beamlist[i]],
-				data->beam_center_sample[beamlist[i]],
-				data->beam_start_sample[beamlist[i]]);
-		k = 0;
-		for (i=0;i<*ss_num_beams;i++)
-			{
-			beam_ss = &data->ssraw[data->beam_start_sample[beamlist[i]]];
-			for (j=0;j<data->beam_samples[beamlist[i]];j++)
-				{
-				fprintf(stderr,"dbg5       beam:%d pixel:%d  amp:%d\n",
-					beamlist[i],k,beam_ss[j]);
-				k++;
-				}
-			}
-		}
-
-	/* print debug statements */
-	if (verbose >= 5
-		&& data->kind == MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       comment:          %s\n",data->comment);
-		}
-
-	/* set kind and error in mb_io_ptr */
-	mb_io_ptr->new_kind = data->kind;
-	mb_io_ptr->new_error = *error;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em12ifrm_wr_data(int verbose, void *mbio_ptr, char *data_ptr, int *error)
-{
-	char	*function_name = "mbr_em12ifrm_wr_data";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_em12ifrm_struct *data;
-	char	line[MBF_EM12IFRM_RECORD_SIZE];
-	int	shift;
-	short	short_value;
-	char	char_value;
-	int	len;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       data_ptr:   %p\n",(void *)data_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_em12ifrm_struct *) data_ptr;
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Ready to write data in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       kind:       %d\n", mb_io_ptr->new_kind);
-		fprintf(stderr,"dbg5       error:      %d\n",*error);
-		fprintf(stderr,"dbg5       status:     %d\n",status);
-		}
-
-	/* print debug statements */
-	if (verbose >= 5
-		&& data->kind == MB_DATA_DATA)
-		{
-		fprintf(stderr,"\ndbg5  Values to write in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       year:             %d\n",data->year);
-		fprintf(stderr,"dbg5       month:            %d\n",data->month);
-		fprintf(stderr,"dbg5       day:              %d\n",data->day);
-		fprintf(stderr,"dbg5       hour:             %d\n",data->hour);
-		fprintf(stderr,"dbg5       minute:           %d\n",data->minute);
-		fprintf(stderr,"dbg5       sec:              %d\n",data->second);
-		fprintf(stderr,"dbg5       centisecond:      %d\n",data->centisecond);
-		fprintf(stderr,"dbg5       ping_number:      %d\n",data->ping_number);
-		fprintf(stderr,"dbg5       beams_bath:       %d\n",data->beams_bath);
-		fprintf(stderr,"dbg5       bath_mode:        %d\n",data->bath_mode);
-		fprintf(stderr,"dbg5       bath_res:         %d\n",data->bath_res);
-		fprintf(stderr,"dbg5       bath_quality:     %d\n",data->ping_number);
-		fprintf(stderr,"dbg5       keel_depth:       %d\n",data->keel_depth);
-		fprintf(stderr,"dbg5       heading:          %d\n",data->heading);
-		fprintf(stderr,"dbg5       roll:             %d\n",data->roll);
-		fprintf(stderr,"dbg5       pitch:            %d\n",data->pitch);
-		fprintf(stderr,"dbg5       ping_heave:       %d\n",data->ping_heave);
-		fprintf(stderr,"dbg5       sound_vel:        %d\n",data->sound_vel);
-		fprintf(stderr,"dbg5       beam bath xtrack ltrack tt amp qual heave\n");
-		for (i=0;i<data->beams_bath;i++)
-			fprintf(stderr,"dbg5       beam:%d  bath:%d  xtrck:%d  ltrck:%d tt:%d  amp:%d  qual:%d  heave:%d\n",
-				i,data->bath[i],data->bath_acrosstrack[i],
-				data->bath_alongtrack[i],data->tt[i],
-				data->amp[i],data->quality[i],data->heave[i]);
-		}
-
-	/* handle survey ping record */
-	if (data->kind == MB_DATA_DATA)
-		{
-		/* set ascii header */
-		shift = 0;
-		if (data->swath_id == EM_SWATH_CENTER)
-			char_value = 'C';
-		else if (data->swath_id == EM_SWATH_PORT)
-			char_value = 'B';
-		else if (data->swath_id == EM_SWATH_STARBOARD)
-			char_value = 'T';
-		else
-			char_value = 'C';
-		sprintf(&line[shift], "$12SO%c,%2.2d/%2.2d/%2.2d,%2.2d:%2.2d:%2.2d.%2.2d0,VOIE%c,",
-				char_value, data->day, data->month, data->year,
-				data->hour, data->minute, data->second,
-				data->centisecond, char_value); shift += 35;
-
-		/* set binary header */
-		line[shift] = '\0'; shift += 1;
-		short_value = (short) data->ping_number;
-		mb_put_binary_short(MB_NO, short_value, &line[shift]); shift += 2;
-		line[shift] = (char) data->bath_res; shift += 1;
-		line[shift] = (char) data->bath_quality; shift += 1;
-		short_value = (short) data->keel_depth;
-		mb_put_binary_short(MB_NO, short_value, &line[shift]); shift += 2;
-		short_value = (short) data->heading;
-		mb_put_binary_short(MB_NO, short_value, &line[shift]); shift += 2;
-		short_value = (short) data->roll;
-		mb_put_binary_short(MB_NO, short_value, &line[shift]); shift += 2;
-		short_value = (short) data->pitch;
-		mb_put_binary_short(MB_NO, short_value, &line[shift]); shift += 2;
-		short_value = (short) data->ping_heave;
-		mb_put_binary_short(MB_NO, short_value, &line[shift]); shift += 2;
-		short_value = (short) data->sound_vel;
-		mb_put_binary_short(MB_NO, short_value, &line[shift]); shift += 2;
-		line[shift] = (char) data->bath_mode; shift += 1;
-		line[shift] = ','; shift += 1;
-
-		/* set bathymetry */
-		data->beams_bath = MBF_EM12IFRM_MAXBEAMS;
-		for (i=0;i<data->beams_bath;i++)
-			{
-			short_value = (short) data->bath[i];
-			mb_put_binary_short(MB_NO, short_value, &line[shift]); shift += 2;
-			short_value = (short) data->bath_acrosstrack[i];
-			mb_put_binary_short(MB_NO, short_value, &line[shift]); shift += 2;
-			short_value = (short) data->bath_alongtrack[i];
-			mb_put_binary_short(MB_NO, short_value, &line[shift]); shift += 2;
-			short_value = (short) data->tt[i];
-			mb_put_binary_short(MB_NO, short_value, &line[shift]); shift += 2;
-			line[shift] = (char) data->amp[i]; shift += 1;
-			line[shift] = (char) data->quality[i]; shift += 1;
-			line[shift] = (char) data->heave[i]; shift += 1;
-			line[shift] = (char) 0; shift += 1;
-			}
-		line[shift] = (char) 0; shift += 1;
-		line[shift] = (char) 0; shift += 1;
-		line[shift] = (char) 0; shift += 1;
-		line[shift] = ','; shift += 1;
-		line[shift] = '\r'; shift += 1;
-		line[shift] = '\n'; shift += 1;
-		}
-
-	/* handle comment record */
-	else if (data->kind == MB_DATA_COMMENT)
-		{
-		shift = 0;
-		len = MIN(strlen(data->comment), MBSYS_SIMRAD_COMMENT_LENGTH - 1);
-		sprintf(&line[shift], "$COMM:%3.3d:", len);
-		shift += 10;
-		strncpy(&line[shift], data->comment, len);
-		shift += len;
-		for (i=shift;i<MBF_EM12IFRM_RECORD_SIZE-6;i++)
-		    line[i] = '\0';
-		shift = MBF_EM12IFRM_RECORD_SIZE - 6;
-		line[shift] = (char) 0; shift += 1;
-		line[shift] = (char) 0; shift += 1;
-		line[shift] = (char) 0; shift += 1;
-		line[shift] = ','; shift += 1;
-		line[shift] = '\r'; shift += 1;
-		line[shift] = '\n'; shift += 1;
-		}
-
-	/* write next record to file */
-	if (status == MB_SUCCESS)
-		{
-		if ((status = fwrite(line,1,MBF_EM12IFRM_RECORD_SIZE,
-				mb_io_ptr->mbfp))
-				== MBF_EM12IFRM_RECORD_SIZE)
-			{
-			status = MB_SUCCESS;
-			*error = MB_ERROR_NO_ERROR;
-			}
-		else
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_WRITE_FAIL;
-			}
-		}
-	else
-		{
-		status = MB_SUCCESS;
-		*error = MB_ERROR_NO_ERROR;
-		if (verbose >= 5)
-			fprintf(stderr,"\ndbg5  No data written in MBIO function <%s>\n",function_name);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mbr_em300mba.c b/src/mbio/mbr_em300mba.c
deleted file mode 100644
index c0974d0..0000000
--- a/src/mbio/mbr_em300mba.c
+++ /dev/null
@@ -1,9435 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbr_em300mba.c	10/16/98
- *	$Id: mbr_em300mba.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1998-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbr_em300mba.c contains the functions for reading and writing
- * multibeam data in the EM300MBA format.
- * These functions include:
- *   mbr_alm_em300mba	- allocate read/write memory
- *   mbr_dem_em300mba	- deallocate read/write memory
- *   mbr_rt_em300mba	- read and translate data
- *   mbr_wt_em300mba	- translate and write data
- *
- * Author:	D. W. Caress
- * Date:	October 16,  1998
- * $Log: mbr_em300mba.c,v $
- * Revision 5.38  2008/09/13 06:08:09  caress
- * Updates to apply suggested patches to segy handling. Also fixes to remove compiler warnings.
- *
- * Revision 5.37  2008/07/10 06:43:40  caress
- * Preparing for 5.1.1beta20
- *
- * Revision 5.36  2008/03/01 09:14:03  caress
- * Some housekeeping changes.
- *
- * Revision 5.35  2007/07/03 17:31:03  caress
- * Fixed handling of EM121A data.
- *
- * Revision 5.34  2006/11/10 22:36:04  caress
- * Working towards release 5.1.0
- *
- * Revision 5.33  2006/07/27 18:42:51  caress
- * Working towards 5.1.0
- *
- * Revision 5.32  2006/02/07 03:12:14  caress
- * Another shot at dealing with broken simrad sidescan records. Now we will keep the raw sidescan data but not use it to make the binned sidescan returned by the standard mbio extract functions.
- *
- * Revision 5.31  2006/02/06 16:54:50  caress
- * Set the Simrad i/o modules to output error messages with verbose > 0 when
- * sidescan is zeroed because of mismatch between bathymetry and sidescan records.
- *
- * Revision 5.30  2006/02/06 06:18:06  caress
- * Commented out checks for beam mismatches between bathy and sidescan records - Barry Eakins of SIO has complained of dropped pings in Revelle data.
- *
- * Revision 5.29  2006/02/03 21:08:51  caress
- * Working on supporting water column datagrams in Simrad formats.
- *
- * Revision 5.28  2006/02/02 19:42:09  caress
- * Fixed handling of unknown datagrams on little-endian systems.
- *
- * Revision 5.27  2006/02/01 18:32:05  caress
- * Fixed problem reading RAWBEAM3 records.
- *
- * Revision 5.26  2006/01/27 20:09:47  caress
- * Added support for EM3002
- *
- * Revision 5.25  2006/01/27 19:09:38  caress
- * Version 5.0.8beta2
- *
- * Revision 5.24  2006/01/11 07:37:29  caress
- * Working towards 5.0.8
- *
- * Revision 5.23  2006/01/06 18:27:19  caress
- * Working towards 5.0.8
- *
- * Revision 5.22  2005/11/05 00:48:04  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.21  2005/03/25 04:18:14  caress
- * Fixed problems with the debug mode being on in mbr_em300mba.c and problems with the debug output in both mbr_em300mba.c and mbr_em300mba.c.
- *
- * Revision 5.20  2004/07/15 19:25:04  caress
- * Progress in supporting Reson 7k data.
- *
- * Revision 5.19  2004/02/24 22:29:02  caress
- * Fixed errors in handling Simrad datagrams and edit save files on byteswapped machines (e.g. Intel or AMD processors).
- *
- * Revision 5.18  2003/11/24 20:44:51  caress
- * Fixes to more gracefully handle unsupported datagrams.
- *
- * Revision 5.17  2003/05/20 18:05:32  caress
- * Added svp_source to data source parameters.
- *
- * Revision 5.16  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.15  2003/04/16 16:47:41  caress
- * Release 5.0.beta30
- *
- * Revision 5.14  2002/09/16 05:51:53  caress
- * Really fixed bug...
- *
- * Revision 5.13  2002/09/16 04:50:47  caress
- * Fixed mis-dimensioned array in rd_rawbeam functions.
- *
- * Revision 5.12  2002/08/21 00:55:46  caress
- * Release 5.0.beta22
- *
- * Revision 5.11  2002/07/20 20:42:40  caress
- * Release 5.0.beta20
- *
- * Revision 5.10  2002/05/29 23:38:53  caress
- * Release 5.0.beta18
- *
- * Revision 5.9  2001/08/10 22:41:19  dcaress
- * Release 5.0.beta07
- *
- * Revision 5.8  2001-08-03 18:00:02-07  caress
- * Applied mods from Gordon Keith.
- *
- * Revision 5.7  2001/07/20  00:31:11  caress
- * Release 5.0.beta03
- *
- * Revision 5.6  2001/06/08  21:44:01  caress
- * Version 5.0.beta01
- *
- * Revision 5.5  2001/06/01  00:14:06  caress
- * Redid support for current Simrad multibeam data.
- *
- * Revision 5.4  2001/05/30  17:57:26  caress
- * Fixed New Simrad data handling, plus removed use of
- * intermediate data structure. Still need to reduce use
- * of #ifdefs related to byteswapping.
- *
- * Revision 5.3  2001/05/24  23:18:07  caress
- * Fixed handling of Revelle EM120 data (first cut).
- *
- * Revision 5.2  2001/03/22  20:45:56  caress
- * Trying to make 5.0.beta0...
- *
- * Revision 5.1  2001/01/22  07:43:34  caress
- * Version 5.0.beta01
- *
- * Revision 5.0  2000/12/01  22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.9  2000/10/11  01:03:21  caress
- * Convert to ANSI C
- *
- * Revision 4.8  2000/09/30  06:34:20  caress
- * Snapshot for Dale.
- *
- * Revision 4.7  2000/09/19  23:13:26  caress
- * Applied fixes from Gordon Keith at AGSO.
- *
- * Revision 4.6  2000/07/20  20:24:59  caress
- * First cut at supporting both EM120 and EM1002.
- *
- * Revision 4.5  2000/07/17  23:36:24  caress
- * Added support for EM120.
- *
- * Revision 4.4  2000/02/07  22:59:47  caress
- * Fixed problem with depth_offset_multiplier
- *
- * Revision 4.3  1999/04/21  05:45:32  caress
- * Fixed handling of bad sidescan data.
- *
- * Revision 4.2  1999/04/07  20:38:24  caress
- * Fixes related to building under Linux.
- *
- * Revision 4.2  1999/04/03 07:36:16  caress
- * Fix bugs in byteswapped code.
- *
- * Revision 4.1  1999/02/04 23:52:54  caress
- * MB-System version 4.6beta7
- *
- * Revision 4.0  1998/12/17  22:59:14  caress
- * MB-System version 4.6beta4
- *
- *
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mb_define.h"
-#include "mbsys_simrad2.h"
-
-/* include for byte swapping */
-#include "mb_swap.h"
-
-/* turn on debug statements here */
-/* #define MBR_EM300MBA_DEBUG 1 */
-
-/* essential function prototypes */
-int mbr_register_em300mba(int verbose, void *mbio_ptr,
-		int *error);
-int mbr_info_em300mba(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_alm_em300mba(int verbose, void *mbio_ptr, int *error);
-int mbr_dem_em300mba(int verbose, void *mbio_ptr, int *error);
-int mbr_rt_em300mba(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_wt_em300mba(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_em300mba_rd_data(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_em300mba_chk_label(int verbose, void *mbio_ptr, char *label, short *type, short *sonar);
-int mbr_em300mba_rd_start(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store,
-		short type, short sonar, int *version, int *error);
-int mbr_em300mba_rd_run_parameter(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store,
-		short sonar, int *error);
-int mbr_em300mba_rd_clock(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store,
-		short sonar, int *error);
-int mbr_em300mba_rd_tide(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store,
-		short sonar, int *error);
-int mbr_em300mba_rd_height(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store,
-		short sonar, int *error);
-int mbr_em300mba_rd_heading(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store,
-		short sonar, int *error);
-int mbr_em300mba_rd_ssv(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store,
-		short sonar, int *error);
-int mbr_em300mba_rd_tilt(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store,
-		short sonar, int *error);
-int mbr_em300mba_rd_attitude(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store,
-		short sonar, int *error);
-int mbr_em300mba_rd_pos(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store,
-		short sonar, int *error);
-int mbr_em300mba_rd_svp(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store,
-		short sonar, int *error);
-int mbr_em300mba_rd_svp2(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store,
-		short sonar, int *error);
-int mbr_em300mba_rd_bath(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store,
-		int *match, short sonar, int version, int *error);
-int mbr_em300mba_rd_rawbeam(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store,
-		short sonar, int *error);
-int mbr_em300mba_rd_rawbeam2(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store,
-		short sonar, int *error);
-int mbr_em300mba_rd_rawbeam3(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store,
-		short sonar, int *error);
-int mbr_em300mba_rd_ss(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store,
- 		short sonar, int length, int *match, int *error);
-int mbr_em300mba_rd_wc(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store,
-		short sonar, int *error);
-int mbr_em300mba_wr_data(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_em300mba_wr_start(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store, int *error);
-int mbr_em300mba_wr_run_parameter(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store, int *error);
-int mbr_em300mba_wr_clock(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store, int *error);
-int mbr_em300mba_wr_tide(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store, int *error);
-int mbr_em300mba_wr_height(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store, int *error);
-int mbr_em300mba_wr_heading(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store, int *error);
-int mbr_em300mba_wr_ssv(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store, int *error);
-int mbr_em300mba_wr_tilt(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store, int *error);
-int mbr_em300mba_wr_attitude(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store, int *error);
-int mbr_em300mba_wr_pos(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store, int *error);
-int mbr_em300mba_wr_svp(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store, int *error);
-int mbr_em300mba_wr_bath(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store, int head, int *error);
-int mbr_em300mba_wr_rawbeam(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store, int *error);
-int mbr_em300mba_wr_rawbeam2(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store, int *error);
-int mbr_em300mba_wr_rawbeam3(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store, int head, int *error);
-int mbr_em300mba_wr_ss(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store, int head, int *error);
-int mbr_em300mba_wr_wc(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store, int *error);
-
-static char rcs_id[]="$Id: mbr_em300mba.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mbr_register_em300mba(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_register_em300mba";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* get mb_io_ptr */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set format info parameters */
-	status = mbr_info_em300mba(verbose,
-			&mb_io_ptr->system,
-			&mb_io_ptr->beams_bath_max,
-			&mb_io_ptr->beams_amp_max,
-			&mb_io_ptr->pixels_ss_max,
-			mb_io_ptr->format_name,
-			mb_io_ptr->system_name,
-			mb_io_ptr->format_description,
-			&mb_io_ptr->numfile,
-			&mb_io_ptr->filetype,
-			&mb_io_ptr->variable_beams,
-			&mb_io_ptr->traveltime,
-			&mb_io_ptr->beam_flagging,
-			&mb_io_ptr->nav_source,
-			&mb_io_ptr->heading_source,
-			&mb_io_ptr->vru_source,
-			&mb_io_ptr->svp_source,
-			&mb_io_ptr->beamwidth_xtrack,
-			&mb_io_ptr->beamwidth_ltrack,
-			error);
-
-	/* set format and system specific function pointers */
-	mb_io_ptr->mb_io_format_alloc = &mbr_alm_em300mba;
-	mb_io_ptr->mb_io_format_free = &mbr_dem_em300mba;
-	mb_io_ptr->mb_io_store_alloc = &mbsys_simrad2_alloc;
-	mb_io_ptr->mb_io_store_free = &mbsys_simrad2_deall;
-	mb_io_ptr->mb_io_read_ping = &mbr_rt_em300mba;
-	mb_io_ptr->mb_io_write_ping = &mbr_wt_em300mba;
-	mb_io_ptr->mb_io_dimensions = &mbsys_simrad2_dimensions;
-	mb_io_ptr->mb_io_pingnumber = &mbsys_simrad2_pingnumber;
-	mb_io_ptr->mb_io_extract = &mbsys_simrad2_extract;
-	mb_io_ptr->mb_io_insert = &mbsys_simrad2_insert;
-	mb_io_ptr->mb_io_extract_nnav = &mbsys_simrad2_extract_nnav;
-	mb_io_ptr->mb_io_extract_nav = &mbsys_simrad2_extract_nav;
-	mb_io_ptr->mb_io_insert_nav = &mbsys_simrad2_insert_nav;
-	mb_io_ptr->mb_io_extract_altitude = &mbsys_simrad2_extract_altitude;
-	mb_io_ptr->mb_io_insert_altitude = NULL;
-	mb_io_ptr->mb_io_extract_svp = &mbsys_simrad2_extract_svp;
-	mb_io_ptr->mb_io_insert_svp = &mbsys_simrad2_insert_svp;
-	mb_io_ptr->mb_io_ttimes = &mbsys_simrad2_ttimes;
-	mb_io_ptr->mb_io_detects = &mbsys_simrad2_detects;
-	mb_io_ptr->mb_io_gains = &mbsys_simrad2_gains;
-	mb_io_ptr->mb_io_copyrecord = &mbsys_simrad2_copy;
-	mb_io_ptr->mb_io_extract_rawss = NULL;
-	mb_io_ptr->mb_io_insert_rawss = NULL;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",mb_io_ptr->system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",mb_io_ptr->beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",mb_io_ptr->beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",mb_io_ptr->pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",mb_io_ptr->format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",mb_io_ptr->system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",mb_io_ptr->format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",mb_io_ptr->numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",mb_io_ptr->filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",mb_io_ptr->variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",mb_io_ptr->traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",mb_io_ptr->beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",mb_io_ptr->nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",mb_io_ptr->heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",mb_io_ptr->vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",mb_io_ptr->svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",mb_io_ptr->beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",mb_io_ptr->beamwidth_ltrack);
-		fprintf(stderr,"dbg2       format_alloc:       %p\n",(void *)mb_io_ptr->mb_io_format_alloc);
-		fprintf(stderr,"dbg2       format_free:        %p\n",(void *)mb_io_ptr->mb_io_format_free);
-		fprintf(stderr,"dbg2       store_alloc:        %p\n",(void *)mb_io_ptr->mb_io_store_alloc);
-		fprintf(stderr,"dbg2       store_free:         %p\n",(void *)mb_io_ptr->mb_io_store_free);
-		fprintf(stderr,"dbg2       read_ping:          %p\n",(void *)mb_io_ptr->mb_io_read_ping);
-		fprintf(stderr,"dbg2       write_ping:         %p\n",(void *)mb_io_ptr->mb_io_write_ping);
-		fprintf(stderr,"dbg2       extract:            %p\n",(void *)mb_io_ptr->mb_io_extract);
-		fprintf(stderr,"dbg2       insert:             %p\n",(void *)mb_io_ptr->mb_io_insert);
-		fprintf(stderr,"dbg2       extract_nav:        %p\n",(void *)mb_io_ptr->mb_io_extract_nav);
-		fprintf(stderr,"dbg2       insert_nav:         %p\n",(void *)mb_io_ptr->mb_io_insert_nav);
-		fprintf(stderr,"dbg2       extract_altitude:   %p\n",(void *)mb_io_ptr->mb_io_extract_altitude);
-		fprintf(stderr,"dbg2       insert_altitude:    %p\n",(void *)mb_io_ptr->mb_io_insert_altitude);
-		fprintf(stderr,"dbg2       extract_svp:        %p\n",(void *)mb_io_ptr->mb_io_extract_svp);
-		fprintf(stderr,"dbg2       insert_svp:         %p\n",(void *)mb_io_ptr->mb_io_insert_svp);
-		fprintf(stderr,"dbg2       ttimes:             %p\n",(void *)mb_io_ptr->mb_io_ttimes);
-		fprintf(stderr,"dbg2       detects:            %p\n",(void *)mb_io_ptr->mb_io_detects);
-		fprintf(stderr,"dbg2       extract_rawss:      %p\n",(void *)mb_io_ptr->mb_io_extract_rawss);
-		fprintf(stderr,"dbg2       insert_rawss:       %p\n",(void *)mb_io_ptr->mb_io_insert_rawss);
-		fprintf(stderr,"dbg2       copyrecord:         %p\n",(void *)mb_io_ptr->mb_io_copyrecord);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbr_info_em300mba(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error)
-{
-	char	*function_name = "mbr_info_em300mba";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* set format info parameters */
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-	*system = MB_SYS_SIMRAD2;
-	*beams_bath_max = 254;
-	*beams_amp_max = 254;
-	*pixels_ss_max = 1024;
-	strncpy(format_name, "EM300MBA", MB_NAME_LENGTH);
-	strncpy(system_name, "SIMRAD2", MB_NAME_LENGTH);
-	strncpy(format_description, "Format name:          MBF_EM300MBA\nInformal Description: Simrad multibeam processing format\nAttributes:           Old and new Simrad multibeams, \n                      EM12S, EM12D, EM121, EM120, EM300, \n                      EM100, EM1000, EM950, EM1002, EM3000, \n                      bathymetry, amplitude, and sidescan,\n                      up to 254 beams, variable pixels, ascii + binary, MBARI.\n", MB_DESCRIPTION_LENGTH);
-	*numfile = 1;
-	*filetype = MB_FILETYPE_NORMAL;
-	*variable_beams = MB_YES;
-	*traveltime = MB_YES;
-	*beam_flagging = MB_YES;
-	*nav_source = MB_DATA_DATA;
-	*heading_source = MB_DATA_DATA;
-	*vru_source = MB_DATA_ATTITUDE;
-	*svp_source = MB_DATA_VELOCITY_PROFILE;
-	*beamwidth_xtrack = 2.0;
-	*beamwidth_ltrack = 2.0;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",*system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",*beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",*beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",*pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",*numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",*filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",*variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",*traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",*beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",*nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",*heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",*vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",*svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",*beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",*beamwidth_ltrack);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_alm_em300mba(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_alm_em300mba";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	int	*databyteswapped;
-	double	*pixel_size;
-	double	*swath_width;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set initial status */
-	status = MB_SUCCESS;
-
-	/* allocate memory for data structure */
-	mb_io_ptr->structure_size = 0;
-	mb_io_ptr->data_structure_size = 0;
-	status = mbsys_simrad2_alloc(
-			verbose,mbio_ptr,
-			&mb_io_ptr->store_data,error);
-
-	/* initialize everything to zeros */
-	databyteswapped = (int *) &mb_io_ptr->save10;
-	pixel_size = &mb_io_ptr->saved1;
-	swath_width = &mb_io_ptr->saved2;
-	*databyteswapped = -1;
-	*pixel_size = 0.0;
-	*swath_width = 0.0;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_dem_em300mba(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_dem_em300mba";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointers to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* deallocate memory for data descriptor */
-	status = mbsys_simrad2_deall(
-			verbose,mbio_ptr,
-			&mb_io_ptr->store_data,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_rt_em300mba(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_rt_em300mba";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_simrad2_struct *store;
-	struct mbsys_simrad2_attitude_struct *attitude;
-	struct mbsys_simrad2_heading_struct *heading;
-	struct mbsys_simrad2_ssv_struct *ssv;
-	struct mbsys_simrad2_ping_struct *ping;
-	int	time_i[7];
-	double	ptime_d, ntime_d, atime_d;
-	double	bath_time_d, ss_time_d;
-	double	roll, pitch, heave;
-	double	att_time_d[MBSYS_SIMRAD2_MAXATTITUDE];
-	double	att_roll[MBSYS_SIMRAD2_MAXATTITUDE];
-	double	att_pitch[MBSYS_SIMRAD2_MAXATTITUDE];
-	double	att_heave[MBSYS_SIMRAD2_MAXATTITUDE];
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointers to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* read next data from file */
-	status = mbr_em300mba_rd_data(verbose,mbio_ptr,store_ptr,error);
-
-	/* get pointers to data structures */
-	store = (struct mbsys_simrad2_struct *) store_ptr;
-	attitude = (struct mbsys_simrad2_attitude_struct *) store->attitude;
-	heading = (struct mbsys_simrad2_heading_struct *) store->heading;
-	ssv = (struct mbsys_simrad2_ssv_struct *) store->ssv;
-	ping = (struct mbsys_simrad2_ping_struct *) store->ping;
-
-	/* save attitude if attitude data */
-	if (status == MB_SUCCESS
-		&& store->kind == MB_DATA_ATTITUDE)
-		{
-		/* get attitude time */
-		time_i[0] = attitude->att_date / 10000;
-		time_i[1] = (attitude->att_date % 10000) / 100;
-		time_i[2] = attitude->att_date % 100;
-		time_i[3] = attitude->att_msec / 3600000;
-		time_i[4] = (attitude->att_msec % 3600000) / 60000;
-		time_i[5] = (attitude->att_msec % 60000) / 1000;
-		time_i[6] = (attitude->att_msec % 1000) * 1000;
-		mb_get_time(verbose, time_i, &atime_d);
-
-		/* add latest attitude samples */
-		for (i=0;i<MIN(attitude->att_ndata,MBSYS_SIMRAD2_MAXATTITUDE);i++)
-			{
-			att_time_d[i] = (double)(atime_d + 0.001 * attitude->att_time[i]);
-			att_heave[i] = (double)(0.01 * attitude->att_heave[i]);
-			att_roll[i] = (double)(0.01 * attitude->att_roll[i]);
-			att_pitch[i] = (double)(0.01 * attitude->att_pitch[i]);
-			}
-		mb_attint_nadd(verbose, mbio_ptr,
-				attitude->att_ndata,att_time_d,att_heave,att_roll,att_pitch,
-				error);
-		}
-
-	/* if no sidescan read then zero sidescan data */
-	if (status == MB_SUCCESS
-		&& store->kind == MB_DATA_DATA
-		&& ping->png_ss_read == MB_NO)
-		{
-		status = mbsys_simrad2_zero_ss(verbose,store_ptr,error);
-		}
-
-	/* else check that bath and sidescan data record time stamps
-	   match for survey data - we can have bath without
-	   sidescan but not sidescan without bath */
-	else if (status == MB_SUCCESS
-		&& store->kind == MB_DATA_DATA)
-		{
-		/* get times of bath and sidescan records */
-		time_i[0] = ping->png_date / 10000;
-		time_i[1] = (ping->png_date % 10000) / 100;
-		time_i[2] = ping->png_date % 100;
-		time_i[3] = ping->png_msec / 3600000;
-		time_i[4] = (ping->png_msec % 3600000) / 60000;
-		time_i[5] = (ping->png_msec % 60000) / 1000;
-		time_i[6] = (ping->png_msec % 1000) * 1000;
-		mb_get_time(verbose, time_i, &bath_time_d);
-		time_i[0] = ping->png_ss_date / 10000;
-		time_i[1] = (ping->png_ss_date % 10000) / 100;
-		time_i[2] = ping->png_ss_date % 100;
-		time_i[3] = ping->png_ss_msec / 3600000;
-		time_i[4] = (ping->png_ss_msec % 3600000) / 60000;
-		time_i[5] = (ping->png_ss_msec % 60000) / 1000;
-		time_i[6] = (ping->png_ss_msec % 1000) * 1000;
-		mb_get_time(verbose, time_i, &ss_time_d);
-
-		/* check for time match - if bath newer than
-		   sidescan then zero sidescan,  if sidescan
-		   newer than bath then set error,  if ok then
-		   check that beam ids are the same */
-		if (ping->png_ss_date == 0
-			|| ping->png_nbeams_ss == 0
-			|| bath_time_d > ss_time_d)
-		    {
-		    status = mbsys_simrad2_zero_ss(verbose,store_ptr,error);
-		    }
-		else if (bath_time_d > ss_time_d)
-		    {
-		    if (verbose > 0)
-		    	fprintf(stderr,"%s: %4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d Sidescan zeroed, bathtime:%f >  sstime:%f\n",
-				function_name, time_i[0], time_i[1], time_i[2],
-					time_i[3], time_i[4], time_i[5], time_i[6],
-					bath_time_d, ss_time_d);
-		    status = mbsys_simrad2_zero_ss(verbose,store_ptr,error);
-		    }
-		else if (bath_time_d < ss_time_d)
-		    {
-		    if (verbose > 0)
-		    	fprintf(stderr,"%s: %4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d Ping unintelligible bathtime:%f < sstime%f\n",
-				function_name, time_i[0], time_i[1], time_i[2],
-					time_i[3], time_i[4], time_i[5], time_i[6],
-					bath_time_d, ss_time_d);
-		    *error = MB_ERROR_UNINTELLIGIBLE;
-		    status = MB_FAILURE;
-		    }
-		else
-		    {
-		    /* check for some indicators of broken records */
-		    if (ping->png_nbeams < ping->png_nbeams_ss
-			|| ping->png_nbeams > ping->png_nbeams_ss + 1)
-			{
-		    	if (verbose > 1)
-			    	fprintf(stderr,"%s: %4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d Sidescan ignored: num bath beams != num ss beams: %d %d\n",
-					function_name, time_i[0], time_i[1], time_i[2],
-					time_i[3], time_i[4], time_i[5], time_i[6],
-					ping->png_nbeams, ping->png_nbeams_ss);
-			}
-		    else if (ping->png_nbeams == ping->png_nbeams_ss)
-			{
-			for (i=0;i<ping->png_nbeams;i++)
-			    {
-			    if (ping->png_beam_num[i] !=
-				    ping->png_beam_index[i] + 1
-				&& ping->png_beam_num[i] !=
-				    ping->png_beam_index[i] - 1)
-				{
-		    		if (verbose > 1)
-				    	fprintf(stderr,"%s: %4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d Sidescan ignored: bath and ss beam indexes don't match: : %d %d %d\n",
-						function_name, time_i[0], time_i[1], time_i[2],
-						time_i[3], time_i[4], time_i[5], time_i[6],
-						i, ping->png_beam_num[i], ping->png_beam_index[i]);
-				}
-			    }
-			}
-		    }
-		}
-
-	if (status == MB_SUCCESS
-		&& store->kind == MB_DATA_DATA)
-		{
-		/* get ping time */
-		time_i[0] = ping->png_date / 10000;
-		time_i[1] = (ping->png_date % 10000) / 100;
-		time_i[2] = ping->png_date % 100;
-		time_i[3] = ping->png_msec / 3600000;
-		time_i[4] = (ping->png_msec % 3600000) / 60000;
-		time_i[5] = (ping->png_msec % 60000) / 1000;
-		time_i[6] = (ping->png_msec % 1000) * 1000;
-		mb_get_time(verbose, time_i, &ptime_d);
-
-		/* interpolate from saved attitude */
-		mb_attint_interp(verbose, mbio_ptr, ptime_d,
-				    &heave, &roll, &pitch, error);
-		ping->png_roll = (int) rint(roll / 0.01);
-		ping->png_pitch = (int) rint(pitch / 0.01);
-		ping->png_heave = (int) rint(heave / 0.01);
-		}
-
-	if (status == MB_SUCCESS
-		&& (store->kind == MB_DATA_NAV
-			|| store->kind == MB_DATA_NAV1
-			|| store->kind == MB_DATA_NAV2
-			|| store->kind == MB_DATA_NAV3))
-		{
-		/* get nav time */
-		time_i[0] = store->pos_date / 10000;
-		time_i[1] = (store->pos_date % 10000) / 100;
-		time_i[2] = store->pos_date % 100;
-		time_i[3] = store->pos_msec / 3600000;
-		time_i[4] = (store->pos_msec % 3600000) / 60000;
-		time_i[5] = (store->pos_msec % 60000) / 1000;
-		time_i[6] = (store->pos_msec % 1000) * 1000;
-		mb_get_time(verbose, time_i, &ntime_d);
-
-		/* interpolate from saved attitude */
-		mb_attint_interp(verbose, mbio_ptr, ntime_d,
-				    &heave, &roll, &pitch, error);
-		store->pos_roll = (int) rint(roll / 0.01);
-		store->pos_pitch = (int) rint(pitch / 0.01);
-		store->pos_heave = (int) rint(heave / 0.01);
-		}
-
-	/* set error and kind in mb_io_ptr */
-	mb_io_ptr->new_error = *error;
-	mb_io_ptr->new_kind = store->kind;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_wt_em300mba(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_wt_em300mba";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_simrad2_struct *store;
-	struct mbsys_simrad2_ping_struct *ping;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_simrad2_struct *) store_ptr;
-	ping = (struct mbsys_simrad2_ping_struct *) store->ping;
-
-	/* write next data to file */
-	status = mbr_em300mba_wr_data(verbose,mbio_ptr,store_ptr,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em300mba_rd_data(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_em300mba_rd_data";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_simrad2_struct *store;
-	struct mbsys_simrad2_ping_struct *ping;
-	FILE	*mbfp;
-	int	swap = -1;
-	int	done;
-	int	*databyteswapped;
-	int	record_size;
-	int	*record_size_save;
-	char	*label;
-	int	*label_save_flag;
-	char	*record_size_char;
-	short	expect;
-	short	type;
-	short	sonar;
-	int	*version;
-	short	first_type;
-	short	*expect_save;
-	int	*expect_save_flag;
-	short	*first_type_save;
-	short	*typelast;
-	short	*sonarlast;
-	int	*nbadrec;
-	int     *length;
-	int	match;
-	int	read_len;
-	int	skip = 0;
-	char	junk;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_simrad2_struct *) store_ptr;
-	ping = (struct mbsys_simrad2_ping_struct *) store->ping;
-	mbfp = mb_io_ptr->mbfp;
-
-	/* get saved values */
-	databyteswapped = (int *) &mb_io_ptr->save10;
-	record_size_save = (int *) &mb_io_ptr->save5;
-	label = (char *) mb_io_ptr->save_label;
-	version = (int *) (&mb_io_ptr->save3);
-	label_save_flag = (int *) &mb_io_ptr->save_label_flag;
-	expect_save_flag = (int *) &mb_io_ptr->save_flag;
-	expect_save = (short *) &mb_io_ptr->save1;
-	first_type_save = (short *) &mb_io_ptr->save2;
-	typelast = (short *) &mb_io_ptr->save6;
-	sonarlast = (short *) &mb_io_ptr->save9;
-	nbadrec = (int *) &mb_io_ptr->save7;
-	length = (int *) &mb_io_ptr->save8;
-	record_size_char = (char *) &record_size;
-	if (*expect_save_flag == MB_YES)
-		{
-		expect = *expect_save;
-		first_type = *first_type_save;
-		*expect_save_flag = MB_NO;
-		}
-	else
-		{
-		expect = EM2_NONE;
-		first_type = EM2_NONE;
-		if (ping != NULL)
-		    {
-		    ping->png_raw1_read = MB_NO;
-		    ping->png_raw2_read = MB_NO;
-		    ping->png_ss_read = MB_NO;
-		    ping->png_raw_nbeams = 0;
-		    ping->png_nbeams_ss = 0;
-		    }
-		}
-
-	/* set file position */
-	mb_io_ptr->file_pos = mb_io_ptr->file_bytes;
-
-	/* set flag to swap bytes if necessary */
-	swap = *databyteswapped;
-
-	/* loop over reading data until a record is ready for return */
-	done = MB_NO;
-	*error = MB_ERROR_NO_ERROR;
-	while (done == MB_NO)
-		{
-		/* if no label saved get next record label */
-		if (*label_save_flag == MB_NO)
-			{
-			/* read four byte record size */
-			if ((read_len = fread(&record_size,
-				1,4,mb_io_ptr->mbfp)) != 4)
-				{
-				status = MB_FAILURE;
-				*error = MB_ERROR_EOF;
-				}
-
-			/* read label */
-			if ((read_len = fread(label,
-				1,4,mb_io_ptr->mbfp)) != 4)
-				{
-				status = MB_FAILURE;
-				*error = MB_ERROR_EOF;
-				}
-
-			/* check label - if not a good label read a byte
-				at a time until a good label is found */
-			skip = 0;
-			while (status == MB_SUCCESS
-				&& mbr_em300mba_chk_label(verbose,
-					mbio_ptr, label, &type, &sonar) != MB_SUCCESS)
-			    {
-			    /* get next byte */
-			    for (i=0;i<3;i++)
-				record_size_char[i] = record_size_char[i+1];
-			    record_size_char[3] = label[0];
-			    for (i=0;i<3;i++)
-				label[i] = label[i+1];
-			    if ((read_len = fread(&label[3],
-				    1,1,mb_io_ptr->mbfp)) != 1)
-				{
-				status = MB_FAILURE;
-				*error = MB_ERROR_EOF;
-				}
-			    skip++;
-			    }
-
-			/* report problem */
-			if (skip > 0 && verbose > 0)
-			    {
-			    if (*nbadrec == 0)
-			    	fprintf(stderr,
-"\nThe MBF_EM300MBA module skipped data between identified\n\
-data records. Something is broken, most probably the data...\n\
-However, the data may include a data record type that we\n\
-haven't seen yet, or there could be an error in the code.\n\
-If skipped data are reported multiple times, \n\
-we recommend you send a data sample and problem \n\
-description to the MB-System team \n\
-(caress at mbari.org and dale at ldeo.columbia.edu)\n\
-Have a nice day...\n");
-				fprintf(stderr,
-						"MBF_EM300MBA skipped %d bytes between records %4.4hX:%d and %4.4hX:%d\n",
-						skip, *typelast, *typelast, type, type);
-				(*nbadrec)++;
-			    }
-			*typelast = type;
-			*sonarlast = sonar;
-
-			/* set flag to swap bytes if necessary */
-			swap = *databyteswapped;
-
-			/* get record_size */
-			if (*databyteswapped != mb_io_ptr->byteswapped)
-				record_size = mb_swap_int(record_size);
-			*record_size_save = record_size;
-			}
-
-		/* else use saved label */
-		else
-			{
-			*label_save_flag = MB_NO;
-			type = *typelast;
-			sonar = *sonarlast;
-			record_size = *record_size_save;
-			}
-
-#ifdef MBR_EM300MBA_DEBUG
-	fprintf(stderr,"\nstart of mbr_em300mba_rd_data loop:\n");
-	fprintf(stderr,"skip:%d expect:%x type:%x first_type:%x sonar:%d recsize:%u done:%d\n",
-		skip, expect, type, first_type, sonar, *record_size_save, done);
-#endif
-
-		/* allocate secondary data structure for
-			heading data if needed */
-		if (status == MB_SUCCESS &&
-			(type == EM2_HEADING)
-			&& store->heading == NULL)
-			{
-			status = mbsys_simrad2_heading_alloc(
-					verbose,mbio_ptr,
-					store_ptr,error);
-			}
-
-		/* allocate secondary data structure for
-			attitude data if needed */
-		if (status == MB_SUCCESS &&
-			(type == EM2_ATTITUDE)
-			&& store->attitude == NULL)
-			{
-			status = mbsys_simrad2_attitude_alloc(
-					verbose,mbio_ptr,
-					store_ptr,error);
-			}
-
-		/* allocate secondary data structure for
-			ssv data if needed */
-		if (status == MB_SUCCESS &&
-			(type == EM2_SSV)
-			&& store->ssv == NULL)
-			{
-			status = mbsys_simrad2_ssv_alloc(
-					verbose,mbio_ptr,
-					store_ptr,error);
-			}
-
-		/* allocate secondary data structure for
-			tilt data if needed */
-		if (status == MB_SUCCESS &&
-			(type == EM2_TILT)
-			&& store->tilt == NULL)
-			{
-			status = mbsys_simrad2_tilt_alloc(
-					verbose,mbio_ptr,
-					store_ptr,error);
-			}
-
-		/* allocate secondary data structure for
-			survey data if needed */
-		if (status == MB_SUCCESS &&
-			(type == EM2_BATH_MBA
-			|| type == EM2_RAWBEAM
-			|| type == EM2_RAWBEAM2
-			|| type == EM2_RAWBEAM3
-			|| type == EM2_SS_MBA))
-			{
-			if (store->ping == NULL)
-			    status = mbsys_simrad2_survey_alloc(
-					verbose,mbio_ptr,
-					store_ptr,error);
-			ping = (struct mbsys_simrad2_ping_struct *) store->ping;
-			}
-
-		/* allocate secondary data structure for
-			water column data if needed */
-		if (status == MB_SUCCESS &&
-			(type == EM2_WATERCOLUMN))
-			{
-			if (store->wc == NULL)
-			    status = mbsys_simrad2_wc_alloc(
-					verbose,mbio_ptr,
-					store_ptr,error);
-			}
-
-		/* read the appropriate data records */
-		if (status == MB_FAILURE && expect == EM2_NONE)
-			{
-#ifdef MBR_EM300MBA_DEBUG
-	fprintf(stderr,"call nothing, read failure, no expect\n");
-#endif
-			done = MB_YES;
-			record_size = 0;
-			*record_size_save = record_size;
-			}
-		else if (status == MB_FAILURE && expect != EM2_NONE)
-			{
-#ifdef MBR_EM300MBA_DEBUG
-	fprintf(stderr,"call nothing, read failure, expect %x\n",expect);
-#endif
-			done = MB_YES;
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		else if (type !=  EM2_STOP2
-			&& type != EM2_STATUS
-			&& type != EM2_ON
-			&& type != EM2_ATTITUDE
-			&& type != EM2_CLOCK
-			&& type != EM2_BATH
-			&& type != EM2_SBDEPTH
-			&& type != EM2_RAWBEAM
-			&& type != EM2_SSV
-			&& type != EM2_HEADING
-			&& type != EM2_START
-			&& type != EM2_TILT
-			&& type != EM2_CBECHO
-			&& type != EM2_POS
-			&& type != EM2_RUN_PARAMETER
-			&& type != EM2_SS
-			&& type != EM2_TIDE
-			&& type != EM2_SVP2
-			&& type != EM2_SVP
-			&& type != EM2_SSPINPUT
-			&& type != EM2_RAWBEAM2
-			&& type != EM2_RAWBEAM3
-			&& type != EM2_HEIGHT
-			&& type != EM2_STOP
-			&& type != EM2_WATERCOLUMN
-			&& type != EM2_REMOTE
-			&& type != EM2_SSP
-			&& type != EM2_BATH_MBA
-			&& type != EM2_SS_MBA)
-			{
-#ifdef MBR_EM300MBA_DEBUG
-	fprintf(stderr,"call nothing, try again\n");
-#endif
-			done = MB_NO;
-			}
-		else if ((type == EM2_START
-			    || type == EM2_STOP)
-			&& expect != EM2_NONE)
-			{
-#ifdef MBR_EM300MBA_DEBUG
-	fprintf(stderr,"call nothing, expect %x but got type %x\n",expect,type);
-#endif
-			done = MB_YES;
-			expect = EM2_NONE;
-			type = first_type;
-			*label_save_flag = MB_YES;
-			store->kind = MB_DATA_DATA;
-			}
-		else if (type == EM2_START
-			|| type == EM2_STOP)
-			{
-#ifdef MBR_EM300MBA_DEBUG
-	fprintf(stderr,"call mbr_em300mba_rd_start type %x\n",type);
-#endif
-			status = mbr_em300mba_rd_start(
-				verbose,mbfp,swap,store,type,sonar,version,error);
-			if (status == MB_SUCCESS)
-			    {
-			    done = MB_YES;
-			    if (expect != EM2_NONE)
-				{
-				*expect_save = expect;
-				*expect_save_flag = MB_YES;
-				*first_type_save = first_type;
-				}
-			    else
-				*expect_save_flag = MB_NO;
-			    }
-			}
-		else if (type == EM2_RUN_PARAMETER)
-			{
-#ifdef MBR_EM300MBA_DEBUG
-	fprintf(stderr,"call mbr_em300mba_rd_run_parameter type %x\n",type);
-#endif
-			status = mbr_em300mba_rd_run_parameter(
-				verbose,mbfp,swap,store,sonar,error);
-			if (status == MB_SUCCESS)
-				{
-				done = MB_YES;
-				if (expect != EM2_NONE)
-					{
-					*expect_save = expect;
-					*expect_save_flag = MB_YES;
-					*first_type_save = first_type;
-					}
-				else
-					*expect_save_flag = MB_NO;
-				}
-			}
-		else if (type == EM2_CLOCK)
-			{
-#ifdef MBR_EM300MBA_DEBUG
-	fprintf(stderr,"call mbr_em300mba_rd_clock type %x\n",type);
-#endif
-			status = mbr_em300mba_rd_clock(
-				verbose,mbfp,swap,store,sonar,error);
-			if (status == MB_SUCCESS)
-				{
-				done = MB_YES;
-				if (expect != EM2_NONE)
-					{
-					*expect_save = expect;
-					*expect_save_flag = MB_YES;
-					*first_type_save = first_type;
-					}
-				else
-					*expect_save_flag = MB_NO;
-				}
-			}
-		else if (type == EM2_TIDE)
-			{
-#ifdef MBR_EM300MBA_DEBUG
-	fprintf(stderr,"call mbr_em300mba_rd_tide type %x\n",type);
-#endif
-			status = mbr_em300mba_rd_tide(
-				verbose,mbfp,swap,store,sonar,error);
-			if (status == MB_SUCCESS)
-				{
-				done = MB_YES;
-				if (expect != EM2_NONE)
-					{
-					*expect_save = expect;
-					*expect_save_flag = MB_YES;
-					*first_type_save = first_type;
-					}
-				else
-					*expect_save_flag = MB_NO;
-				}
-			}
-		else if (type == EM2_HEIGHT)
-			{
-#ifdef MBR_EM300MBA_DEBUG
-	fprintf(stderr,"call mbr_em300mba_rd_height type %x\n",type);
-#endif
-			status = mbr_em300mba_rd_height(
-				verbose,mbfp,swap,store,sonar,error);
-			if (status == MB_SUCCESS)
-				{
-				done = MB_YES;
-				if (expect != EM2_NONE)
-					{
-					*expect_save = expect;
-					*expect_save_flag = MB_YES;
-					*first_type_save = first_type;
-					}
-				else
-					*expect_save_flag = MB_NO;
-				}
-			}
-		else if (type == EM2_HEADING)
-			{
-#ifdef MBR_EM300MBA_DEBUG
-	fprintf(stderr,"call mbr_em300mba_rd_heading type %x\n",type);
-#endif
-			status = mbr_em300mba_rd_heading(
-				verbose,mbfp,swap,store,sonar,error);
-			if (status == MB_SUCCESS)
-				{
-				done = MB_YES;
-				if (expect != EM2_NONE)
-					{
-					*expect_save = expect;
-					*expect_save_flag = MB_YES;
-					*first_type_save = first_type;
-					}
-				else
-					*expect_save_flag = MB_NO;
-				}
-			}
-		else if (type == EM2_SSV)
-			{
-#ifdef MBR_EM300MBA_DEBUG
-	fprintf(stderr,"call mbr_em300mba_rd_ssv type %x\n",type);
-#endif
-			status = mbr_em300mba_rd_ssv(
-				verbose,mbfp,swap,store,sonar,error);
-			if (status == MB_SUCCESS)
-				{
-				done = MB_YES;
-				if (expect != EM2_NONE)
-					{
-					*expect_save = expect;
-					*expect_save_flag = MB_YES;
-					*first_type_save = first_type;
-					}
-				else
-					*expect_save_flag = MB_NO;
-				}
-			}
-		else if (type == EM2_TILT)
-			{
-#ifdef MBR_EM300MBA_DEBUG
-	fprintf(stderr,"call mbr_em300mba_rd_tilt type %x\n",type);
-#endif
-			status = mbr_em300mba_rd_tilt(
-				verbose,mbfp,swap,store,sonar,error);
-			if (status == MB_SUCCESS)
-				{
-				done = MB_YES;
-				if (expect != EM2_NONE)
-					{
-					*expect_save = expect;
-					*expect_save_flag = MB_YES;
-					*first_type_save = first_type;
-					}
-				else
-					*expect_save_flag = MB_NO;
-				}
-			}
-		else if (type == EM2_ATTITUDE)
-			{
-#ifdef MBR_EM300MBA_DEBUG
-	fprintf(stderr,"call mbr_em300mba_rd_attitude type %x\n",type);
-#endif
-			status = mbr_em300mba_rd_attitude(
-				verbose,mbfp,swap,store,sonar,error);
-			if (status == MB_SUCCESS)
-				{
-				done = MB_YES;
-				if (expect != EM2_NONE)
-					{
-					*expect_save = expect;
-					*expect_save_flag = MB_YES;
-					*first_type_save = first_type;
-					}
-				else
-					*expect_save_flag = MB_NO;
-				}
-			}
-		else if (type == EM2_POS)
-			{
-#ifdef MBR_EM300MBA_DEBUG
-	fprintf(stderr,"call mbr_em300mba_rd_pos type %x\n",type);
-#endif
-			status = mbr_em300mba_rd_pos(
-				verbose,mbfp,swap,store,sonar,error);
-			if (status == MB_SUCCESS)
-				{
-				done = MB_YES;
-				if (expect != EM2_NONE)
-					{
-					*expect_save = expect;
-					*expect_save_flag = MB_YES;
-					*first_type_save = first_type;
-					}
-				else
-					*expect_save_flag = MB_NO;
-				}
-			}
-		else if (type == EM2_SVP)
-			{
-#ifdef MBR_EM300MBA_DEBUG
-	fprintf(stderr,"call mbr_em300mba_rd_svp type %x\n",type);
-#endif
-			status = mbr_em300mba_rd_svp(
-				verbose,mbfp,swap,store,sonar,error);
-			if (status == MB_SUCCESS)
-				{
-				done = MB_YES;
-				if (expect != EM2_NONE)
-					{
-					*expect_save = expect;
-					*expect_save_flag = MB_YES;
-					*first_type_save = first_type;
-					}
-				else
-					*expect_save_flag = MB_NO;
-				}
-			}
-		else if (type == EM2_SVP2)
-			{
-#ifdef MBR_EM300MBA_DEBUG
-	fprintf(stderr,"call mbr_em300mba_rd_svp2 type %x\n",type);
-#endif
-			status = mbr_em300mba_rd_svp2(
-				verbose,mbfp,swap,store,sonar,error);
-			if (status == MB_SUCCESS)
-				{
-				done = MB_YES;
-				if (expect != EM2_NONE)
-					{
-					*expect_save = expect;
-					*expect_save_flag = MB_YES;
-					*first_type_save = first_type;
-					}
-				else
-					*expect_save_flag = MB_NO;
-				}
-			}
-		else if (type == EM2_BATH_MBA
-			&& sonar == MBSYS_SIMRAD2_EM3002
-			&& store->numberheads == 2)
-			{
-			if (expect == EM2_SS_MBA
-				&& store->ping->png_count == store->ping2->png_count
-				&& store->ping->png_serial != store->ping2->png_serial)
-				{
-#ifdef MBR_EM300MBA_DEBUG
-	fprintf(stderr,"call nothing, expect %x but got type %x\n",expect,type);
-#endif
-				done = MB_YES;
-				expect = EM2_NONE;
-				type = first_type;
-				*label_save_flag = MB_YES;
-				store->kind = MB_DATA_DATA;
-				}
-			else
-				{
-#ifdef MBR_EM300MBA_DEBUG
-	fprintf(stderr,"call mbr_em300mba_rd_bath type %x\n",type);
-#endif
-				status = mbr_em300mba_rd_bath(
-					verbose,mbfp,swap,store,&match,sonar,*version,error);
-				if (status == MB_SUCCESS)
-					{
-					if (first_type == EM2_NONE
-						|| match == MB_NO
-						|| store->ping->png_count != store->ping2->png_count
-						|| store->ping->png_serial != store->ping2->png_serial)
-						{
-						done = MB_NO;
-						first_type = EM2_BATH_MBA;
-						expect = EM2_SS_MBA;
-						}
-					else
-						{
-						done = MB_YES;
-						expect = EM2_NONE;
-						}
-					}
-				}
-
-
-			}
-		else if (type == EM2_BATH_MBA
-			&& expect == EM2_SS_MBA)
-			{
-#ifdef MBR_EM300MBA_DEBUG
-	fprintf(stderr,"call nothing, expect %x but got type %x\n",expect,type);
-#endif
-			done = MB_YES;
-			expect = EM2_NONE;
-			type = first_type;
-			*label_save_flag = MB_YES;
-			store->kind = MB_DATA_DATA;
-			}
-		else if (type == EM2_BATH_MBA)
-			{
-#ifdef MBR_EM300MBA_DEBUG
-	fprintf(stderr,"call mbr_em300mba_rd_bath type %x\n",type);
-#endif
-			status = mbr_em300mba_rd_bath(
-				verbose,mbfp,swap,store,&match,sonar,*version,error);
-			if (status == MB_SUCCESS)
-				{
-				if (first_type == EM2_NONE
-					|| match == MB_NO)
-					{
-					done = MB_NO;
-					first_type = EM2_BATH_MBA;
-					expect = EM2_SS_MBA;
-					}
-				else
-					{
-					done = MB_YES;
-					expect = EM2_NONE;
-					}
-				}
-			}
-		else if (type == EM2_RAWBEAM)
-			{
-#ifdef MBR_EM300MBA_DEBUG
-	fprintf(stderr,"call mbr_em300mba_rd_rawbeam type %x\n",type);
-#endif
-			status = mbr_em300mba_rd_rawbeam(
-				verbose,mbfp,swap,store,sonar,error);
-			if (status == MB_SUCCESS)
-				ping->png_raw1_read = MB_YES;
-			if (expect == EM2_SS_MBA
-				&& ping->png_nbeams == 0)
-				{
-				done = MB_YES;
-				expect = EM2_NONE;
-				}
-			}
-		else if (type == EM2_RAWBEAM2)
-			{
-#ifdef MBR_EM300MBA_DEBUG
-	fprintf(stderr,"call mbr_em300mba_rd_rawbeam2 type %x\n",type);
-#endif
-			status = mbr_em300mba_rd_rawbeam2(
-				verbose,mbfp,swap,store,sonar,error);
-			if (status == MB_SUCCESS)
-				ping->png_raw2_read = MB_YES;
-			if (expect == EM2_SS_MBA
-				&& ping->png_nbeams == 0)
-				{
-				done = MB_YES;
-				expect = EM2_NONE;
-				}
-			}
-		else if (type == EM2_RAWBEAM3
-			&& sonar == MBSYS_SIMRAD2_EM3002
-			&& store->numberheads == 2)
-			{
-#ifdef MBR_EM300MBA_DEBUG
-	fprintf(stderr,"call mbr_em300mba_rd_rawbeam3 type %x\n",type);
-#endif
-			status = mbr_em300mba_rd_rawbeam3(
-				verbose,mbfp,swap,store,sonar,error);
-			if (status == MB_SUCCESS)
-				ping->png_raw3_read = MB_YES;
-			}
-		else if (type == EM2_RAWBEAM3)
-			{
-#ifdef MBR_EM300MBA_DEBUG
-	fprintf(stderr,"call mbr_em300mba_rd_rawbeam3 type %x\n",type);
-#endif
-			status = mbr_em300mba_rd_rawbeam3(
-				verbose,mbfp,swap,store,sonar,error);
-			if (status == MB_SUCCESS)
-				ping->png_raw3_read = MB_YES;
-			if (expect == EM2_SS_MBA
-				&& ping->png_nbeams == 0)
-				{
-				done = MB_YES;
-				expect = EM2_NONE;
-				}
-			}
-		else if (type == EM2_SS_MBA
-			&& sonar == MBSYS_SIMRAD2_EM3002
-			&& store->numberheads == 2)
-			{
-#ifdef MBR_EM300MBA_DEBUG
-	fprintf(stderr,"call mbr_em300mba_rd_ss type %x\n",type);
-#endif
-			status = mbr_em300mba_rd_ss(
-				verbose,mbfp,swap,store,sonar,*length,&match,error);
-			if (status == MB_SUCCESS)
-			    ping->png_ss_read = MB_YES;
-			if (status == MB_SUCCESS
-				&& ping->png_count == store->ping2->png_count
-				&& ping->png_count == ping->png_raw3_count
-				&& ping->png_count == ping->png_ss_count
-				&& store->ping2->png_count == store->ping2->png_raw3_count
-				&& store->ping2->png_count == store->ping2->png_ss_count)
-			    {
-			    done = MB_YES;
-			    expect = EM2_NONE;
-			    }
-			}
-		else if (type == EM2_SS_MBA
-			&& expect != EM2_NONE
-			&& expect != EM2_SS_MBA)
-			{
-#ifdef MBR_EM300MBA_DEBUG
-	fprintf(stderr,"call nothing, expect %x but got type %x\n",expect,type);
-#endif
-			done = MB_YES;
-			expect = EM2_NONE;
-			type = first_type;
-			*label_save_flag = MB_YES;
-			store->kind = MB_DATA_DATA;
-			}
-		else if (type == EM2_SS_MBA)
-			{
-#ifdef MBR_EM300MBA_DEBUG
-	fprintf(stderr,"call mbr_em300mba_rd_ss type %x\n",type);
-#endif
-			status = mbr_em300mba_rd_ss(
-				verbose,mbfp,swap,store,sonar,*length,&match,error);
-			if (status == MB_SUCCESS)
-			    {
-			    ping->png_ss_read = MB_YES;
-			    if (first_type == EM2_NONE
-				|| match == MB_NO)
-				{
-				done = MB_NO;
-				first_type = EM2_SS_MBA;
-				expect = EM2_BATH_MBA;
-				}
-			    else
-				{
-				done = MB_YES;
-				expect = EM2_NONE;
-				}
-			    }
-
-                        /* salvage bath even if sidescan is corrupt */
-			else
-			    {
-			    if (first_type == EM2_BATH_MBA
-				&& match == MB_YES)
-				{
-				status = MB_SUCCESS;
-				done = MB_YES;
-				expect = EM2_NONE;
-				}
-			    }
-			}
-		else if (type == EM2_WATERCOLUMN)
-			{
-#ifdef MBR_EM300MBA_DEBUG
-	fprintf(stderr,"call mbr_em300mba_rd_wc type %x\n",type);
-#endif
-			status = mbr_em300mba_rd_wc(
-				verbose,mbfp,swap,store,sonar,error);
-			if (status == MB_SUCCESS)
-				{
-				done = MB_YES;
-				if (expect != EM2_NONE)
-					{
-					*expect_save = expect;
-					*expect_save_flag = MB_YES;
-					*first_type_save = first_type;
-					}
-				else
-					*expect_save_flag = MB_NO;
-				}
-			}
-		else
-			{
-#ifdef MBR_EM300MBA_DEBUG
-	fprintf(stderr,"skip over %d bytes of unsupported datagram type %x\n",
-			*record_size_save, type);
-#endif
-			for (i=0;i<*record_size_save-4;i++)
-				{
-				if ((read_len = fread(&junk,
-					1,1,mb_io_ptr->mbfp)) != 1)
-					{
-					status = MB_FAILURE;
-					*error = MB_ERROR_EOF;
-					expect = EM2_NONE;
-					}
-				}
-			done = MB_NO;
-			}
-
-		/* bail out if there is an error */
-		if (status == MB_FAILURE)
-			done = MB_YES;
-
-#ifdef MBR_EM300MBA_DEBUG
-	fprintf(stderr,"record_size:%d bytes read:%d file_pos old:%d new:%d\n",
-		record_size, ftell(mbfp) - mb_io_ptr->file_bytes, mb_io_ptr->file_bytes, ftell(mbfp));
-	fprintf(stderr,"done:%d expect:%x status:%d error:%d\n",
-		done, expect, status, *error);
-	fprintf(stderr,"end of mbr_em300mba_rd_data loop:\n\n");
-#endif
-
-		/* get file position */
-		if (*label_save_flag == MB_YES)
-			mb_io_ptr->file_bytes = ftell(mbfp) - 2;
-		else if (*expect_save_flag != MB_YES)
-			mb_io_ptr->file_bytes = ftell(mbfp);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em300mba_chk_label(int verbose, void *mbio_ptr, char *label, short *type, short *sonar)
-{
-	char	*function_name = "mbr_em300mba_chk_label";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	mb_u_char	startbyte;
-	mb_u_char	typebyte;
-	short	*sonar_save;
-	short	sonarunswap;
-	short	sonarswap;
-	int	swap;
-	int	*databyteswapped;
-	int	typegood;
-	int	sonargood;
-	int	sonarswapgood;
-	int	sonarunswapgood;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       label:      %x%x%x%x\n",label[0],label[1],label[2],label[3]);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-	sonar_save = (short *) (&mb_io_ptr->save4);
-	databyteswapped = (int *) &mb_io_ptr->save10;
-
-#ifdef MBR_EM300MBA_DEBUG
-	fprintf(stderr, "Check label: %x|%x|%x|%x\n", label[0],label[1],label[2],label[3]);
-#endif
-
-	/* check for valid start byte and type */
-	startbyte = label[0];
-	typebyte = label[1];
-	if (startbyte ==  EM2_START_BYTE &&
-		(typebyte == EM2_ID_STOP2
-		|| typebyte == EM2_ID_STATUS
-		|| typebyte == EM2_ID_ON
-		|| typebyte == EM2_ID_ATTITUDE
-		|| typebyte == EM2_ID_CLOCK
-		|| typebyte == EM2_ID_BATH
-		|| typebyte == EM2_ID_SBDEPTH
-		|| typebyte == EM2_ID_RAWBEAM
-		|| typebyte == EM2_ID_SSV
-		|| typebyte == EM2_ID_HEADING
-		|| typebyte == EM2_ID_START
-		|| typebyte == EM2_ID_TILT
-		|| typebyte == EM2_ID_CBECHO
-		|| typebyte == EM2_ID_POS
-		|| typebyte == EM2_ID_RUN_PARAMETER
-		|| typebyte == EM2_ID_SS
-		|| typebyte == EM2_ID_TIDE
-		|| typebyte == EM2_ID_SVP2
-		|| typebyte == EM2_ID_SVP
-		|| typebyte == EM2_ID_SSPINPUT
-		|| typebyte == EM2_ID_RAWBEAM2
-		|| typebyte == EM2_ID_RAWBEAM3
-		|| typebyte == EM2_ID_HEIGHT
-		|| typebyte == EM2_ID_STOP
-		|| typebyte == EM2_ID_WATERCOLUMN
-		|| typebyte == EM2_ID_REMOTE
-		|| typebyte == EM2_ID_SSP
-		|| typebyte == EM2_ID_BATH_MBA
-		|| typebyte == EM2_ID_SS_MBA))
-		{
-		typegood = MB_YES;
-		}
-	else
-		{
-		typegood = MB_NO;
-		}
-
-	/* check for data byte swapping if necessary */
-	if (typegood == MB_YES && *databyteswapped == -1)
-		{
-		sonarunswap = *((short *)&label[2]);
-		sonarswap = mb_swap_short(sonarunswap);
-
-		/* check for valid sonarunswap */
-		if (sonarunswap == MBSYS_SIMRAD2_EM120
-			|| sonarunswap == MBSYS_SIMRAD2_EM300
-			|| sonarunswap == MBSYS_SIMRAD2_EM1002
-			|| sonarunswap == MBSYS_SIMRAD2_EM2000
-			|| sonarunswap == MBSYS_SIMRAD2_EM3000
-			|| sonarunswap == MBSYS_SIMRAD2_EM3000D_1
-			|| sonarunswap == MBSYS_SIMRAD2_EM3000D_2
-			|| sonarunswap == MBSYS_SIMRAD2_EM3000D_3
-			|| sonarunswap == MBSYS_SIMRAD2_EM3000D_4
-			|| sonarunswap == MBSYS_SIMRAD2_EM3000D_5
-			|| sonarunswap == MBSYS_SIMRAD2_EM3000D_6
-			|| sonarunswap == MBSYS_SIMRAD2_EM3000D_7
-			|| sonarunswap == MBSYS_SIMRAD2_EM3000D_8
-			|| sonarunswap == MBSYS_SIMRAD2_EM3002
-			|| sonarunswap == MBSYS_SIMRAD2_EM710)
-			{
-			sonarunswapgood = MB_YES;
-			}
-		else
-			{
-			sonarunswapgood = MB_NO;
-			}
-
-		/* check for valid sonarswap */
-		if (sonarswap == MBSYS_SIMRAD2_EM120
-			|| sonarswap == MBSYS_SIMRAD2_EM300
-			|| sonarswap == MBSYS_SIMRAD2_EM1002
-			|| sonarswap == MBSYS_SIMRAD2_EM2000
-			|| sonarswap == MBSYS_SIMRAD2_EM3000
-			|| sonarswap == MBSYS_SIMRAD2_EM3000D_1
-			|| sonarswap == MBSYS_SIMRAD2_EM3000D_2
-			|| sonarswap == MBSYS_SIMRAD2_EM3000D_3
-			|| sonarswap == MBSYS_SIMRAD2_EM3000D_4
-			|| sonarswap == MBSYS_SIMRAD2_EM3000D_5
-			|| sonarswap == MBSYS_SIMRAD2_EM3000D_6
-			|| sonarswap == MBSYS_SIMRAD2_EM3000D_7
-			|| sonarswap == MBSYS_SIMRAD2_EM3000D_8
-			|| sonarswap == MBSYS_SIMRAD2_EM3002
-			|| sonarswap == MBSYS_SIMRAD2_EM710)
-			{
-			sonarswapgood = MB_YES;
-			}
-		else
-			{
-			sonarswapgood = MB_NO;
-			}
-
-		if (sonarunswapgood == MB_YES && sonarswapgood == MB_NO)
-			{
-			if (mb_io_ptr->byteswapped == MB_YES)
-				*databyteswapped = MB_YES;
-			else
-				*databyteswapped = MB_NO;
-			}
-		else if (sonarunswapgood == MB_NO && sonarswapgood == MB_YES)
-			{
-			if (mb_io_ptr->byteswapped == MB_YES)
-				*databyteswapped = MB_NO;
-			else
-				*databyteswapped = MB_YES;
-			}
-
-		}
-
-	/* set flag to swap bytes if necessary */
-	swap = *databyteswapped;
-
-	*type = *((short *)&label[0]);
-	*sonar = *((short *)&label[2]);
-	if (mb_io_ptr->byteswapped == MB_YES)
-		*type = mb_swap_short(*type);
-	if (*databyteswapped != mb_io_ptr->byteswapped)
-		{
-		*sonar = mb_swap_short(*sonar);
-		}
-
-	/* check for valid sonar */
-	if (*sonar == MBSYS_SIMRAD2_EM120
-		|| *sonar == MBSYS_SIMRAD2_EM300
-		|| *sonar == MBSYS_SIMRAD2_EM1002
-		|| *sonar == MBSYS_SIMRAD2_EM2000
-		|| *sonar == MBSYS_SIMRAD2_EM3000
-		|| *sonar == MBSYS_SIMRAD2_EM3000D_1
-		|| *sonar == MBSYS_SIMRAD2_EM3000D_2
-		|| *sonar == MBSYS_SIMRAD2_EM3000D_3
-		|| *sonar == MBSYS_SIMRAD2_EM3000D_4
-		|| *sonar == MBSYS_SIMRAD2_EM3000D_5
-		|| *sonar == MBSYS_SIMRAD2_EM3000D_6
-		|| *sonar == MBSYS_SIMRAD2_EM3000D_7
-		|| *sonar == MBSYS_SIMRAD2_EM3000D_8
-		|| *sonar == MBSYS_SIMRAD2_EM3002
-		|| *sonar == MBSYS_SIMRAD2_EM710
-		|| *sonar == MBSYS_SIMRAD2_EM12S
-		|| *sonar == MBSYS_SIMRAD2_EM12D
-		|| *sonar == MBSYS_SIMRAD2_EM121
-		|| *sonar == MBSYS_SIMRAD2_EM100
-		|| *sonar == MBSYS_SIMRAD2_EM1000)
-		{
-		sonargood = MB_YES;
-		}
-	else
-		{
-		sonargood = MB_NO;
-		}
-
-	if (startbyte == EM2_START_BYTE && typegood == MB_NO && sonargood == MB_YES)
-		{
-		mb_notice_log_problem(verbose, mbio_ptr,
-			MB_PROBLEM_BAD_DATAGRAM);
-		if (verbose >= 1)
-		    fprintf(stderr, "Bad datagram type: %4.4hX %4.4hX | %d %d\n", *type, *sonar, *type, *sonar);
-		}
-	if (typegood != MB_YES || sonargood != MB_YES)
-		{
-		status = MB_FAILURE;
-		}
-
-#ifdef MBR_EM300MBA_DEBUG
-fprintf(stderr,"typegood:%d sonargood:%d mb_io_ptr->byteswapped:%d sonarswapgood:%d *databyteswapped:%d *type:%d *sonar:%d\n",
-typegood,sonargood,mb_io_ptr->byteswapped,sonarswapgood,*databyteswapped,*type,*sonar);
-#endif
-
-	/* save sonar if successful */
-	if (status == MB_SUCCESS)
-	    *sonar_save = *sonar;
-
-	/* allow exception found in some EM3000 data */
-	if (*type == EM2_SVP && *sonar == 0 && *sonar_save == MBSYS_SIMRAD2_EM3000)
-		{
-		status = MB_SUCCESS;
-		*sonar = *sonar_save;
-		}
-
-	/* allow exception found in some data */
-	if (*type == EM2_SSV && *sonar == 0 && *sonar_save != 0)
-		{
-		status = MB_SUCCESS;
-		*sonar = *sonar_save;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       type:       %d\n",*type);
-		fprintf(stderr,"dbg2       sonar:      %d\n",*sonar);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em300mba_rd_start(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store,
-		short type, short sonar, int *version, int *error)
-{
-	char	*function_name = "mbr_em300mba_rd_start";
-	int	status = MB_SUCCESS;
-	char	line[MBSYS_SIMRAD2_BUFFER_SIZE];
-	short	short_val;
-	int	read_len, len;
-	int	done;
-	char	*comma_ptr;
-	int	i1, i2, i3;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		fprintf(stderr,"dbg2       type:       %d\n",type);
-		fprintf(stderr,"dbg2       sonar:      %d\n",sonar);
-		}
-
-	/* make sure comment is initialized */
-	store->par_com[0] = '\0';
-
-	/* set type value */
-	store->type = type;
-	store->sonar = sonar;
-
-	/* read binary values into char array */
-	read_len = fread(line,1,EM2_START_HEADER_SIZE,mbfp);
-	if (read_len == EM2_START_HEADER_SIZE)
-		status = MB_SUCCESS;
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	/* get binary header data */
-	if (status == MB_SUCCESS)
-		{
-		mb_get_binary_int(swap, &line[0], &store->par_date);
-		    store->date = store->par_date;
-		mb_get_binary_int(swap, &line[4], &store->par_msec);
-		    store->msec = store->par_msec;
-		mb_get_binary_short(swap, &line[8], &short_val);
-		    store->par_line_num = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[10], &short_val);
-		    store->par_serial_1 = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[12], &short_val);
-		    store->par_serial_2 = (int) ((unsigned short) short_val);
-		}
-
-	/* check for dual head sonars */
-	if (store->par_serial_1 != 0 && store->par_serial_2 != 0)
-		store->numberheads = 2;
-
-	/* now loop over reading individual characters to
-	    handle ASCII parameter values */
-	done = MB_NO;
-	len = 0;
-	while (status == MB_SUCCESS && done == MB_NO)
-		{
-		read_len = fread(&line[len],1,1,mbfp);
-		if (read_len == 1)
-			{
-			status = MB_SUCCESS;
-			len++;
-			}
-		else
-			{
-			done = MB_YES;
-			status = MB_FAILURE;
-			*error = MB_ERROR_EOF;
-			}
-
-		if (status == MB_SUCCESS
-			&& (((mb_u_char)(line[len-1])) < 32
-			    || ((mb_u_char)(line[len-1])) > 127)
-			&& ((mb_u_char)(line[len-1])) != '\r'
-			&& ((mb_u_char)(line[len-1])) != '\n')
-			{
-			done = MB_YES;
-			if (len > 1)
-			    line[0] = line[len-1];
-			}
-		else if (status == MB_SUCCESS
-			&& line[len-1] == ','
-			&& len > 5)
-			{
-			line[len] = 0;
-			if (strncmp("WLZ=", line, 4) == 0)
-			    mb_get_double(&(store->par_wlz), &line[4], len-5);
-			else if (strncmp("SMH=", line, 4) == 0)
-			    mb_get_int(&(store->par_smh), &line[4], len-5);
-			else if (strncmp("S1Z=", line, 4) == 0)
-			    mb_get_double(&(store->par_s1z), &line[4], len-5);
-			else if (strncmp("S1X=", line, 4) == 0)
-			    mb_get_double(&(store->par_s1x), &line[4], len-5);
-			else if (strncmp("S1Y=", line, 4) == 0)
-			    mb_get_double(&(store->par_s1y), &line[4], len-5);
-			else if (strncmp("S1H=", line, 4) == 0)
-			    mb_get_double(&(store->par_s1h), &line[4], len-5);
-			else if (strncmp("S1R=", line, 4) == 0)
-			    mb_get_double(&(store->par_s1r), &line[4], len-5);
-			else if (strncmp("S1P=", line, 4) == 0)
-			    mb_get_double(&(store->par_s1p), &line[4], len-5);
-			else if (strncmp("S1N=", line, 4) == 0)
-			    mb_get_int(&(store->par_s1n), &line[4], len-5);
-			else if (strncmp("S2Z=", line, 4) == 0)
-			    mb_get_double(&(store->par_s2z), &line[4], len-5);
-			else if (strncmp("S2X=", line, 4) == 0)
-			    mb_get_double(&(store->par_s2x), &line[4], len-5);
-			else if (strncmp("S2Y=", line, 4) == 0)
-			    mb_get_double(&(store->par_s2y), &line[4], len-5);
-			else if (strncmp("S2H=", line, 4) == 0)
-			    mb_get_double(&(store->par_s2h), &line[4], len-5);
-			else if (strncmp("S2R=", line, 4) == 0)
-			    mb_get_double(&(store->par_s2r), &line[4], len-5);
-			else if (strncmp("S2P=", line, 4) == 0)
-			    mb_get_double(&(store->par_s2p), &line[4], len-5);
-			else if (strncmp("S2N=", line, 4) == 0)
-			    mb_get_int(&(store->par_s2n), &line[4], len-5);
-			else if (strncmp("GO1=", line, 4) == 0)
-			    mb_get_double(&(store->par_go1), &line[4], len-5);
-			else if (strncmp("GO2=", line, 4) == 0)
-			    mb_get_double(&(store->par_go2), &line[4], len-5);
-			else if (strncmp("TSV=", line, 4) == 0)
-			    strncpy(store->par_tsv, &line[4], MIN(len-5, 15));
-			else if (strncmp("RSV=", line, 4) == 0)
-			    strncpy(store->par_rsv, &line[4], MIN(len-5, 15));
-			else if (strncmp("BSV=", line, 4) == 0)
-			    strncpy(store->par_bsv, &line[4], MIN(len-5, 15));
-			else if (strncmp("PSV=", line, 4) == 0)
-			    {
-			    /* save the processor software version to use
-			       in tracking changes to the data format */
-			    strncpy(store->par_psv, &line[4], MIN(len-5, 15));
-			    if (sscanf(store->par_psv, "%d.%d.%d", &i1, &i2, &i3)
-				== 3)
-				*version = i3 + 100 * i2 + 10000 * i1;
-			    }
-			else if (strncmp("OSV=", line, 4) == 0)
-			    strncpy(store->par_osv, &line[4], MIN(len-5, 15));
-			else if (strncmp("DSD=", line, 4) == 0)
-			    mb_get_double(&(store->par_dsd), &line[4], len-5);
-			else if (strncmp("DSO=", line, 4) == 0)
-			    mb_get_double(&(store->par_dso), &line[4], len-5);
-			else if (strncmp("DSF=", line, 4) == 0)
-			    mb_get_double(&(store->par_dsf), &line[4], len-5);
-			else if (strncmp("DSH=", line, 4) == 0)
-			    {
-			    store->par_dsh[0] = line[4];
-			    store->par_dsh[1] = line[5];
-			    }
-			else if (strncmp("APS=", line, 4) == 0)
-			    mb_get_int(&(store->par_aps), &line[4], len-5);
-			else if (strncmp("P1M=", line, 4) == 0)
-			    mb_get_int(&(store->par_p1m), &line[4], len-5);
-			else if (strncmp("P1T=", line, 4) == 0)
-			    mb_get_int(&(store->par_p1t), &line[4], len-5);
-			else if (strncmp("P1Z=", line, 4) == 0)
-			    mb_get_double(&(store->par_p1z), &line[4], len-5);
-			else if (strncmp("P1X=", line, 4) == 0)
-			    mb_get_double(&(store->par_p1x), &line[4], len-5);
-			else if (strncmp("P1Y=", line, 4) == 0)
-			    mb_get_double(&(store->par_p1y), &line[4], len-5);
-			else if (strncmp("P1D=", line, 4) == 0)
-			    mb_get_double(&(store->par_p1d), &line[4], len-5);
-			else if (strncmp("P1G=", line, 4) == 0)
-			    strncpy(store->par_p1g, &line[4], MIN(len-5, 15));
-			else if (strncmp("P2M=", line, 4) == 0)
-			    mb_get_int(&(store->par_p2m), &line[4], len-5);
-			else if (strncmp("P2T=", line, 4) == 0)
-			    mb_get_int(&(store->par_p2t), &line[4], len-5);
-			else if (strncmp("P2Z=", line, 4) == 0)
-			    mb_get_double(&(store->par_p2z), &line[4], len-5);
-			else if (strncmp("P2X=", line, 4) == 0)
-			    mb_get_double(&(store->par_p2x), &line[4], len-5);
-			else if (strncmp("P2Y=", line, 4) == 0)
-			    mb_get_double(&(store->par_p2y), &line[4], len-5);
-			else if (strncmp("P2D=", line, 4) == 0)
-			    mb_get_double(&(store->par_p2d), &line[4], len-5);
-			else if (strncmp("P2G=", line, 4) == 0)
-			    strncpy(store->par_p2g, &line[4], MIN(len-5, 15));
-			else if (strncmp("P3M=", line, 4) == 0)
-			    mb_get_int(&(store->par_p3m), &line[4], len-5);
-			else if (strncmp("P3T=", line, 4) == 0)
-			    mb_get_int(&(store->par_p3t), &line[4], len-5);
-			else if (strncmp("P3Z=", line, 4) == 0)
-			    mb_get_double(&(store->par_p3z), &line[4], len-5);
-			else if (strncmp("P3X=", line, 4) == 0)
-			    mb_get_double(&(store->par_p3x), &line[4], len-5);
-			else if (strncmp("P3Y=", line, 4) == 0)
-			    mb_get_double(&(store->par_p3y), &line[4], len-5);
-			else if (strncmp("P3D=", line, 4) == 0)
-			    mb_get_double(&(store->par_p3d), &line[4], len-5);
-			else if (strncmp("P3G=", line, 4) == 0)
-			    strncpy(store->par_p3g, &line[4], MIN(len-5, 15));
-			else if (strncmp("MSZ=", line, 4) == 0)
-			    mb_get_double(&(store->par_msz), &line[4], len-5);
-			else if (strncmp("MSX=", line, 4) == 0)
-			    mb_get_double(&(store->par_msx), &line[4], len-5);
-			else if (strncmp("MSY=", line, 4) == 0)
-			    mb_get_double(&(store->par_msy), &line[4], len-5);
-			else if (strncmp("MRP=", line, 4) == 0)
-			    {
-			    store->par_mrp[0] = line[4];
-			    store->par_mrp[1] = line[5];
-			    }
-			else if (strncmp("MSD=", line, 4) == 0)
-			    mb_get_double(&(store->par_msd), &line[4], len-5);
-			else if (strncmp("MSR=", line, 4) == 0)
-			    mb_get_double(&(store->par_msr), &line[4], len-5);
-			else if (strncmp("MSP=", line, 4) == 0)
-			    mb_get_double(&(store->par_msp), &line[4], len-5);
-			else if (strncmp("MSG=", line, 4) == 0)
-			    mb_get_double(&(store->par_msg), &line[4], len-5);
-			else if (strncmp("GCG=", line, 4) == 0)
-			    mb_get_double(&(store->par_gcg), &line[4], len-5);
-			else if (strncmp("CPR=", line, 4) == 0)
-			    strncpy(store->par_cpr, &line[4], MIN(len-5, 3));
-			else if (strncmp("ROP=", line, 4) == 0)
-			    strncpy(store->par_rop, &line[4], MIN(len-5, MBSYS_SIMRAD2_COMMENT_LENGTH-1));
-			else if (strncmp("SID=", line, 4) == 0)
-			    strncpy(store->par_sid, &line[4], MIN(len-5, MBSYS_SIMRAD2_COMMENT_LENGTH-1));
-			else if (strncmp("PLL=", line, 4) == 0)
-			    strncpy(store->par_pll, &line[4], MIN(len-5, MBSYS_SIMRAD2_COMMENT_LENGTH-1));
-			else if (strncmp("COM=", line, 4) == 0)
-			    {
-			    strncpy(store->par_com, &line[4], MIN(len-5, MBSYS_SIMRAD2_COMMENT_LENGTH-1));
-			    store->par_com[MIN(len-5, MBSYS_SIMRAD2_COMMENT_LENGTH-1)] = 0;
-			    /* replace caret (^) values with commas (,) to circumvent
-			       the format's inability to store commas in comments */
-			    while ((comma_ptr = strchr(store->par_com, '^')) != NULL)
-				{
-				comma_ptr[0] = ',';
-				}
-			    }
-			len = 0;
-			}
-		else if (status == MB_SUCCESS
-			&& line[len-1] == ','
-			&& len <= 5)
-			{
-			len = 0;
-			}
-		}
-
-	/* now set the data kind */
-	if (status == MB_SUCCESS)
-		{
-		if (strlen(store->par_com) > 0)
-		    store->kind = MB_DATA_COMMENT;
-		else if (store->type == EM2_START)
-		    store->kind = MB_DATA_START;
-		else if (store->type == EM2_STOP)
-		    store->kind = MB_DATA_STOP;
-		else if (store->type == EM2_STOP2)
-		    store->kind = MB_DATA_STOP;
-		else if (store->type == EM2_STATUS)
-		    store->kind = MB_DATA_STATUS;
-		else if (store->type == EM2_ON)
-		    store->kind = MB_DATA_START;
-		}
-
-	/* read end of record and last two check sum bytes */
-	if (status == MB_SUCCESS)
-	    {
-	    /* if EM2_END not yet found then the
-		next byte should be EM2_END */
-	    if (line[0] != EM2_END)
-		{
-		read_len = fread(&line[0],1,1,mbfp);
-		}
-
-	    /* if EM2_END not yet found then the
-		next byte should be EM2_END */
-	    if (line[0] != EM2_END)
-		{
-		read_len = fread(&line[0],1,1,mbfp);
-		}
-
-	    /* if we got the end byte then get check sum bytes */
-	    if (line[0] == EM2_END)
-		{
-		read_len = fread(&line[1],2,1,mbfp);
-	    /* don't check success of read
-	        - return success here even if read fails
-	        because all of the
-		important information in this record has
-		already been read - next attempt to read
-		file will return error */
-#ifdef MBR_EM300MBA_DEBUG
-	fprintf(stderr, "End Bytes: %2.2hX %d | %2.2hX %d | %2.2hX %d\n",
-		line[0], line[0],
-		line[1], line[1],
-		line[2], line[2]);
-#endif
-		}
-#ifdef MBR_EM300MBA_DEBUG
-	fprintf(stderr, "\n");
-#endif
-	    }
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       par_date:        %d\n",store->par_date);
-		fprintf(stderr,"dbg5       par_msec:        %d\n",store->par_msec);
-		fprintf(stderr,"dbg5       par_line_num:    %d\n",store->par_line_num);
-		fprintf(stderr,"dbg5       par_serial_1:    %d\n",store->par_serial_1);
-		fprintf(stderr,"dbg5       par_serial_2:    %d\n",store->par_serial_2);
-		fprintf(stderr,"dbg5       par_wlz:         %f\n",store->par_wlz);
-		fprintf(stderr,"dbg5       par_smh:         %d\n",store->par_smh);
-		fprintf(stderr,"dbg5       par_s1z:         %f\n",store->par_s1z);
-		fprintf(stderr,"dbg5       par_s1x:         %f\n",store->par_s1x);
-		fprintf(stderr,"dbg5       par_s1y:         %f\n",store->par_s1y);
-		fprintf(stderr,"dbg5       par_s1h:         %f\n",store->par_s1h);
-		fprintf(stderr,"dbg5       par_s1r:         %f\n",store->par_s1r);
-		fprintf(stderr,"dbg5       par_s1p:         %f\n",store->par_s1p);
-		fprintf(stderr,"dbg5       par_s1n:         %d\n",store->par_s1n);
-		fprintf(stderr,"dbg5       par_s2z:         %f\n",store->par_s2z);
-		fprintf(stderr,"dbg5       par_s2x:         %f\n",store->par_s2x);
-		fprintf(stderr,"dbg5       par_s2y:         %f\n",store->par_s2y);
-		fprintf(stderr,"dbg5       par_s2h:         %f\n",store->par_s2h);
-		fprintf(stderr,"dbg5       par_s2r:         %f\n",store->par_s2r);
-		fprintf(stderr,"dbg5       par_s2p:         %f\n",store->par_s2p);
-		fprintf(stderr,"dbg5       par_s2n:         %d\n",store->par_s2n);
-		fprintf(stderr,"dbg5       par_go1:         %f\n",store->par_go1);
-		fprintf(stderr,"dbg5       par_go2:         %f\n",store->par_go2);
-		fprintf(stderr,"dbg5       par_tsv:         %s\n",store->par_tsv);
-		fprintf(stderr,"dbg5       par_rsv:         %s\n",store->par_rsv);
-		fprintf(stderr,"dbg5       par_bsv:         %s\n",store->par_bsv);
-		fprintf(stderr,"dbg5       par_psv:         %s\n",store->par_psv);
-		fprintf(stderr,"dbg5       par_osv:         %s\n",store->par_osv);
-		fprintf(stderr,"dbg5       par_dsd:         %f\n",store->par_dsd);
-		fprintf(stderr,"dbg5       par_dso:         %f\n",store->par_dso);
-		fprintf(stderr,"dbg5       par_dsf:         %f\n",store->par_dsf);
-		fprintf(stderr,"dbg5       par_dsh:         %c%c\n",
-			store->par_dsh[0],store->par_dsh[1]);
-		fprintf(stderr,"dbg5       par_aps:         %d\n",store->par_aps);
-		fprintf(stderr,"dbg5       par_p1m:         %d\n",store->par_p1m);
-		fprintf(stderr,"dbg5       par_p1t:         %d\n",store->par_p1t);
-		fprintf(stderr,"dbg5       par_p1z:         %f\n",store->par_p1z);
-		fprintf(stderr,"dbg5       par_p1x:         %f\n",store->par_p1x);
-		fprintf(stderr,"dbg5       par_p1y:         %f\n",store->par_p1y);
-		fprintf(stderr,"dbg5       par_p1d:         %f\n",store->par_p1d);
-		fprintf(stderr,"dbg5       par_p1g:         %s\n",store->par_p1g);
-		fprintf(stderr,"dbg5       par_p2m:         %d\n",store->par_p2m);
-		fprintf(stderr,"dbg5       par_p2t:         %d\n",store->par_p2t);
-		fprintf(stderr,"dbg5       par_p2z:         %f\n",store->par_p2z);
-		fprintf(stderr,"dbg5       par_p2x:         %f\n",store->par_p2x);
-		fprintf(stderr,"dbg5       par_p2y:         %f\n",store->par_p2y);
-		fprintf(stderr,"dbg5       par_p2d:         %f\n",store->par_p2d);
-		fprintf(stderr,"dbg5       par_p2g:         %s\n",store->par_p2g);
-		fprintf(stderr,"dbg5       par_p3m:         %d\n",store->par_p3m);
-		fprintf(stderr,"dbg5       par_p3t:         %d\n",store->par_p3t);
-		fprintf(stderr,"dbg5       par_p3z:         %f\n",store->par_p3z);
-		fprintf(stderr,"dbg5       par_p3x:         %f\n",store->par_p3x);
-		fprintf(stderr,"dbg5       par_p3y:         %f\n",store->par_p3y);
-		fprintf(stderr,"dbg5       par_p3d:         %f\n",store->par_p3d);
-		fprintf(stderr,"dbg5       par_p3g:         %s\n",store->par_p3g);
-		fprintf(stderr,"dbg5       par_msz:         %f\n",store->par_msz);
-		fprintf(stderr,"dbg5       par_msx:         %f\n",store->par_msx);
-		fprintf(stderr,"dbg5       par_msy:         %f\n",store->par_msy);
-		fprintf(stderr,"dbg5       par_mrp:         %c%c\n",
-			store->par_mrp[0],store->par_mrp[1]);
-		fprintf(stderr,"dbg5       par_msd:         %f\n",store->par_msd);
-		fprintf(stderr,"dbg5       par_msr:         %f\n",store->par_msr);
-		fprintf(stderr,"dbg5       par_msp:         %f\n",store->par_msp);
-		fprintf(stderr,"dbg5       par_msg:         %f\n",store->par_msg);
-		fprintf(stderr,"dbg5       par_gcg:         %f\n",store->par_gcg);
-		fprintf(stderr,"dbg5       par_cpr:         %s\n",store->par_cpr);
-		fprintf(stderr,"dbg5       par_rop:         %s\n",store->par_rop);
-		fprintf(stderr,"dbg5       par_sid:         %s\n",store->par_sid);
-		fprintf(stderr,"dbg5       par_pll:         %s\n",store->par_pll);
-		fprintf(stderr,"dbg5       par_com:         %s\n",store->par_com);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       version:    %d\n",*version);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em300mba_rd_run_parameter(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store,
-		short sonar, int *error)
-{
-	char	*function_name = "mbr_em300mba_rd_run_parameter";
-	int	status = MB_SUCCESS;
-	char	line[EM2_RUN_PARAMETER_SIZE];
-	short	short_val;
-	int	read_len;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		fprintf(stderr,"dbg2       sonar:      %d\n",sonar);
-		}
-
-	/* set kind and type values */
-	store->kind = MB_DATA_RUN_PARAMETER;
-	store->type = EM2_RUN_PARAMETER;
-	store->sonar = sonar;
-
-	/* read binary values into char array */
-	read_len = fread(line,1,EM2_RUN_PARAMETER_SIZE-4,mbfp);
-	if (read_len == EM2_RUN_PARAMETER_SIZE-4)
-		status = MB_SUCCESS;
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	/* get binary data */
-	if (status == MB_SUCCESS)
-		{
-		mb_get_binary_int(swap, &line[0], &store->run_date);
-		    if (store->run_date != 0) store->date = store->run_date;
-		mb_get_binary_int(swap, &line[4], &store->run_msec);
-		    if (store->run_date != 0) store->msec = store->run_msec;
-		mb_get_binary_short(swap, &line[8], &short_val);
-		    store->run_ping_count = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[10], &short_val);
-		    store->run_serial = (int) ((unsigned short) short_val);
-		mb_get_binary_int(swap, &line[12], &store->run_status);
-		store->run_mode = (mb_u_char) line[16];
-		store->run_filter_id = (mb_u_char) line[17];
-		mb_get_binary_short(swap, &line[18], &short_val);
-		    store->run_min_depth = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[20], &short_val);
-		    store->run_max_depth = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[22], &short_val);
-		    store->run_absorption = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[24], &short_val);
-		    store->run_tran_pulse = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[26], &short_val);
-		    store->run_tran_beam = (int) ((unsigned short) short_val);
-		store->run_tran_pow = (mb_u_char) line[28];
-		store->run_rec_beam = (mb_u_char) line[29];
-		store->run_rec_band = (mb_u_char) line[30];
-		store->run_rec_gain = (mb_u_char) line[31];
-		store->run_tvg_cross = (mb_u_char) line[32];
-		store->run_ssv_source = (mb_u_char) line[33];
-		mb_get_binary_short(swap, &line[34], &short_val);
-		    store->run_max_swath = (int) ((unsigned short) short_val);
-		store->run_beam_space = (mb_u_char) line[36];
-		store->run_swath_angle = (mb_u_char) line[37];
-		store->run_stab_mode = (mb_u_char) line[38];
-		for (i=0;i<6;i++)
-		    store->run_spare[i] = line[39+i];
-#ifdef MBR_EM300MBA_DEBUG
-	fprintf(stderr, "End Bytes: %2.2hX %d | %2.2hX %d | %2.2hX %d\n",
-		line[EM2_RUN_PARAMETER_SIZE-7], line[EM2_RUN_PARAMETER_SIZE-7],
-		line[EM2_RUN_PARAMETER_SIZE-6], line[EM2_RUN_PARAMETER_SIZE-6],
-		line[EM2_RUN_PARAMETER_SIZE-5], line[EM2_RUN_PARAMETER_SIZE-5]);
-#endif
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       run_date:        %d\n",store->run_date);
-		fprintf(stderr,"dbg5       run_msec:        %d\n",store->run_msec);
-		fprintf(stderr,"dbg5       run_ping_count:  %d\n",store->run_ping_count);
-		fprintf(stderr,"dbg5       run_serial:      %d\n",store->run_serial);
-		fprintf(stderr,"dbg5       run_status:      %d\n",store->run_status);
-		fprintf(stderr,"dbg5       run_mode:        %d\n",store->run_mode);
-		fprintf(stderr,"dbg5       run_filter_id:   %d\n",store->run_filter_id);
-		fprintf(stderr,"dbg5       run_min_depth:   %d\n",store->run_min_depth);
-		fprintf(stderr,"dbg5       run_max_depth:   %d\n",store->run_max_depth);
-		fprintf(stderr,"dbg5       run_absorption:  %d\n",store->run_absorption);
-		fprintf(stderr,"dbg5       run_tran_pulse:  %d\n",store->run_tran_pulse);
-		fprintf(stderr,"dbg5       run_tran_beam:   %d\n",store->run_tran_beam);
-		fprintf(stderr,"dbg5       run_tran_pow:    %d\n",store->run_tran_pow);
-		fprintf(stderr,"dbg5       run_rec_beam:    %d\n",store->run_rec_beam);
-		fprintf(stderr,"dbg5       run_rec_band:    %d\n",store->run_rec_band);
-		fprintf(stderr,"dbg5       run_rec_gain:    %d\n",store->run_rec_gain);
-		fprintf(stderr,"dbg5       run_tvg_cross:   %d\n",store->run_tvg_cross);
-		fprintf(stderr,"dbg5       run_ssv_source:  %d\n",store->run_ssv_source);
-		fprintf(stderr,"dbg5       run_max_swath:   %d\n",store->run_max_swath);
-		fprintf(stderr,"dbg5       run_beam_space:  %d\n",store->run_beam_space);
-		fprintf(stderr,"dbg5       run_swath_angle: %d\n",store->run_swath_angle);
-		fprintf(stderr,"dbg5       run_stab_mode:   %d\n",store->run_stab_mode);
-		for (i=0;i<6;i++)
-			fprintf(stderr,"dbg5       run_spare[%d]:    %d\n",i,store->run_spare[i]);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em300mba_rd_clock(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store,
-		short sonar, int *error)
-{
-	char	*function_name = "mbr_em300mba_rd_clock";
-	int	status = MB_SUCCESS;
-	char	line[EM2_CLOCK_SIZE];
-	short	short_val;
-	int	read_len;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		fprintf(stderr,"dbg2       sonar:      %d\n",sonar);
-		}
-
-	/* set kind and type values */
-	store->kind = MB_DATA_CLOCK;
-	store->type = EM2_CLOCK;
-	store->sonar = sonar;
-
-	/* read binary values into char array */
-	read_len = fread(line,1,EM2_CLOCK_SIZE-4,mbfp);
-	if (read_len == EM2_CLOCK_SIZE-4)
-		status = MB_SUCCESS;
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	/* get binary data */
-	if (status == MB_SUCCESS)
-		{
-		mb_get_binary_int(swap, &line[0], &store->clk_date);
-		    store->date = store->clk_date;
-		mb_get_binary_int(swap, &line[4], &store->clk_msec);
-		    store->msec = store->clk_msec;
-		mb_get_binary_short(swap, &line[8], &short_val);
-		    store->clk_count = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[10], &short_val);
-		    store->clk_serial = (int) ((unsigned short) short_val);
-		mb_get_binary_int(swap, &line[12], &store->clk_origin_date);
-		mb_get_binary_int(swap, &line[16], &store->clk_origin_msec);
-		store->clk_1_pps_use = (mb_u_char) line[20];
-#ifdef MBR_EM300MBA_DEBUG
-	fprintf(stderr, "End Bytes: %2.2hX %d | %2.2hX %d | %2.2hX %d\n",
-		line[EM2_CLOCK_SIZE-7], line[EM2_CLOCK_SIZE-7],
-		line[EM2_CLOCK_SIZE-6], line[EM2_CLOCK_SIZE-6],
-		line[EM2_CLOCK_SIZE-5], line[EM2_CLOCK_SIZE-5]);
-#endif
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       clk_date:        %d\n",store->clk_date);
-		fprintf(stderr,"dbg5       clk_msec:        %d\n",store->clk_msec);
-		fprintf(stderr,"dbg5       clk_count:       %d\n",store->clk_count);
-		fprintf(stderr,"dbg5       clk_serial:      %d\n",store->clk_serial);
-		fprintf(stderr,"dbg5       clk_origin_date: %d\n",store->clk_origin_date);
-		fprintf(stderr,"dbg5       clk_origin_msec: %d\n",store->clk_origin_msec);
-		fprintf(stderr,"dbg5       clk_1_pps_use:   %d\n",store->clk_1_pps_use);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em300mba_rd_tide(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store,
-		short sonar, int *error)
-{
-	char	*function_name = "mbr_em300mba_rd_tide";
-	int	status = MB_SUCCESS;
-	char	line[EM2_TIDE_SIZE];
-	short	short_val;
-	int	read_len;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		fprintf(stderr,"dbg2       sonar:      %d\n",sonar);
-		}
-
-	/* set kind and type values */
-	store->kind = MB_DATA_TIDE;
-	store->type = EM2_TIDE;
-	store->sonar = sonar;
-
-	/* read binary values into char array */
-	read_len = fread(line,1,EM2_TIDE_SIZE-4,mbfp);
-	if (read_len == EM2_TIDE_SIZE-4)
-		status = MB_SUCCESS;
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	/* get binary data */
-	if (status == MB_SUCCESS)
-		{
-		mb_get_binary_int(swap, &line[0], &store->tid_date);
-		    store->date = store->tid_date;
-		mb_get_binary_int(swap, &line[4], &store->tid_msec);
-		    store->msec = store->tid_msec;
-		mb_get_binary_short(swap, &line[8], &short_val);
-		    store->tid_count = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[10], &short_val);
-		    store->tid_serial = (int) ((unsigned short) short_val);
-		mb_get_binary_int(swap, &line[12], &store->tid_origin_date);
-		mb_get_binary_int(swap, &line[16], &store->tid_origin_msec);
-		mb_get_binary_short(swap, &line[20], &short_val);
-		    store->tid_tide = (int) short_val;
-#ifdef MBR_EM300MBA_DEBUG
-	fprintf(stderr, "End Bytes: %2.2hX %d | %2.2hX %d | %2.2hX %d\n",
-		line[EM2_TIDE_SIZE-7], line[EM2_TIDE_SIZE-7],
-		line[EM2_TIDE_SIZE-6], line[EM2_TIDE_SIZE-6],
-		line[EM2_TIDE_SIZE-5], line[EM2_TIDE_SIZE-5]);
-#endif
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       tid_date:        %d\n",store->tid_date);
-		fprintf(stderr,"dbg5       tid_msec:        %d\n",store->tid_msec);
-		fprintf(stderr,"dbg5       tid_count:       %d\n",store->tid_count);
-		fprintf(stderr,"dbg5       tid_serial:      %d\n",store->tid_serial);
-		fprintf(stderr,"dbg5       tid_origin_date: %d\n",store->tid_origin_date);
-		fprintf(stderr,"dbg5       tid_origin_msec: %d\n",store->tid_origin_msec);
-		fprintf(stderr,"dbg5       tid_tide:        %d\n",store->tid_tide);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em300mba_rd_height(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store,
-		short sonar, int *error)
-{
-	char	*function_name = "mbr_em300mba_rd_height";
-	int	status = MB_SUCCESS;
-	char	line[EM2_HEIGHT_SIZE];
-	short	short_val;
-	int	read_len;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		fprintf(stderr,"dbg2       sonar:      %d\n",sonar);
-		}
-
-	/* set kind and type values */
-	store->kind = MB_DATA_HEIGHT;
-	store->type = EM2_HEIGHT;
-	store->sonar = sonar;
-
-	/* read binary values into char array */
-	read_len = fread(line,1,EM2_HEIGHT_SIZE-4,mbfp);
-	if (read_len == EM2_HEIGHT_SIZE-4)
-		status = MB_SUCCESS;
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	/* get binary data */
-	if (status == MB_SUCCESS)
-		{
-		mb_get_binary_int(swap, &line[0], &store->hgt_date);
-		    store->date = store->hgt_date;
-		mb_get_binary_int(swap, &line[4], &store->hgt_msec);
-		    store->msec = store->hgt_msec;
-		mb_get_binary_short(swap, &line[8], &short_val);
-		    store->hgt_count = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[10], &short_val);
-		    store->hgt_serial = (int) ((unsigned short) short_val);
-		mb_get_binary_int(swap, &line[12], &store->hgt_height);
-		store->hgt_type = (mb_u_char) line[16];
-#ifdef MBR_EM300MBA_DEBUG
-	fprintf(stderr, "End Bytes: %2.2hX %d | %2.2hX %d | %2.2hX %d\n",
-		line[EM2_HEIGHT_SIZE-7], line[EM2_HEIGHT_SIZE-7],
-		line[EM2_HEIGHT_SIZE-6], line[EM2_HEIGHT_SIZE-6],
-		line[EM2_HEIGHT_SIZE-5], line[EM2_HEIGHT_SIZE-5]);
-#endif
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       hgt_date:        %d\n",store->hgt_date);
-		fprintf(stderr,"dbg5       hgt_msec:        %d\n",store->hgt_msec);
-		fprintf(stderr,"dbg5       hgt_count:       %d\n",store->hgt_count);
-		fprintf(stderr,"dbg5       hgt_serial:      %d\n",store->hgt_serial);
-		fprintf(stderr,"dbg5       hgt_height:      %d\n",store->hgt_height);
-		fprintf(stderr,"dbg5       hgt_type:        %d\n",store->hgt_type);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em300mba_rd_heading(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store,
-		short sonar, int *error)
-{
-	char	*function_name = "mbr_em300mba_rd_heading";
-	int	status = MB_SUCCESS;
-	struct mbsys_simrad2_heading_struct *heading;
-	char	line[EM2_HEADING_HEADER_SIZE];
-	short	short_val;
-	int	read_len;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		fprintf(stderr,"dbg2       sonar:      %d\n",sonar);
-		}
-
-	/* get  storage structure */
-	heading = (struct mbsys_simrad2_heading_struct *) store->heading;
-
-	/* set kind and type values */
-	store->kind = MB_DATA_HEADING;
-	store->type = EM2_HEADING;
-	store->sonar = sonar;
-
-	/* read binary header values into char array */
-	read_len = fread(line,1,EM2_HEADING_HEADER_SIZE,mbfp);
-	if (read_len == EM2_HEADING_HEADER_SIZE)
-		status = MB_SUCCESS;
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	/* get binary header data */
-	if (status == MB_SUCCESS)
-		{
-		mb_get_binary_int(swap, &line[0], &heading->hed_date);
-		    store->date = heading->hed_date;
-		mb_get_binary_int(swap, &line[4], &heading->hed_msec);
-		    store->msec = heading->hed_msec;
-		mb_get_binary_short(swap, &line[8], &short_val);
-		    heading->hed_count = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[10], &short_val);
-		    heading->hed_serial = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[12], &short_val);
-		    heading->hed_ndata = (int) ((unsigned short) short_val);
-		}
-
-	/* read binary heading values */
-	if (status == MB_SUCCESS)
-	    {
-	    for (i=0;i<heading->hed_ndata && status == MB_SUCCESS;i++)
-		{
-		read_len = fread(line,1,EM2_HEADING_SLICE_SIZE,mbfp);
-		if (read_len == EM2_HEADING_SLICE_SIZE
-			&& i < MBSYS_SIMRAD2_MAXHEADING)
-			{
-			status = MB_SUCCESS;
-			mb_get_binary_short(swap, &line[0], &short_val);
-			    heading->hed_time[i] = (int) ((unsigned short) short_val);
-			mb_get_binary_short(swap, &line[2], &short_val);
-			    heading->hed_heading[i] = (int) ((unsigned short) short_val);
-			}
-		else
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_EOF;
-			}
-		}
-	    heading->hed_ndata = MIN(heading->hed_ndata, MBSYS_SIMRAD2_MAXHEADING);
-	    }
-
-	/* now get last bytes of record */
-	if (status == MB_SUCCESS)
-		{
-		read_len = fread(&line[0],1,4,mbfp);
-		if (read_len == 4)
-			{
-			status = MB_SUCCESS;
-			heading->hed_heading_status = (mb_u_char) line[0];
-			}
-		else
-			{
-			/* return success here because all of the
-			    important information in this record has
-			    already been read - next attempt to read
-			    file will return error */
-			status = MB_SUCCESS;
-			}
-#ifdef MBR_EM300MBA_DEBUG
-	fprintf(stderr, "End Bytes: %2.2hX %d | %2.2hX %d | %2.2hX %d\n",
-		line[1], line[1],
-		line[2], line[2],
-		line[3], line[3]);
-#endif
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       hed_date:        %d\n",heading->hed_date);
-		fprintf(stderr,"dbg5       hed_msec:        %d\n",heading->hed_msec);
-		fprintf(stderr,"dbg5       hed_count:       %d\n",heading->hed_count);
-		fprintf(stderr,"dbg5       hed_serial:      %d\n",heading->hed_serial);
-		fprintf(stderr,"dbg5       hed_ndata:       %d\n",heading->hed_ndata);
-		fprintf(stderr,"dbg5       count    time (msec)    heading (0.01 deg)\n");
-		fprintf(stderr,"dbg5       -----    -----------    ------------------\n");
-		for (i=0;i<heading->hed_ndata;i++)
-			fprintf(stderr,"dbg5        %4d      %7d          %7d\n",
-				i, heading->hed_time[i], heading->hed_heading[i]);
-		fprintf(stderr,"dbg5       hed_heading_status: %d\n",heading->hed_heading_status);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em300mba_rd_ssv(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store,
-		short sonar, int *error)
-{
-	char	*function_name = "mbr_em300mba_rd_ssv";
-	int	status = MB_SUCCESS;
-	struct mbsys_simrad2_ssv_struct *ssv;
-	char	line[EM2_SSV_HEADER_SIZE];
-	short	short_val;
-	int	read_len;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		fprintf(stderr,"dbg2       sonar:      %d\n",sonar);
-		}
-
-	/* get  storage structure */
-	ssv = (struct mbsys_simrad2_ssv_struct *) store->ssv;
-
-	/* set kind and type values */
-	store->kind = MB_DATA_SSV;
-	store->type = EM2_SSV;
-	store->sonar = sonar;
-
-	/* read binary header values into char array */
-	read_len = fread(line,1,EM2_SSV_HEADER_SIZE,mbfp);
-	if (read_len == EM2_SSV_HEADER_SIZE)
-		status = MB_SUCCESS;
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	/* get binary header data */
-	if (status == MB_SUCCESS)
-		{
-		mb_get_binary_int(swap, &line[0], &ssv->ssv_date);
-		    store->date = ssv->ssv_date;
-		mb_get_binary_int(swap, &line[4], &ssv->ssv_msec);
-		    store->msec = ssv->ssv_msec;
-		mb_get_binary_short(swap, &line[8], &short_val);
-		    ssv->ssv_count = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[10], &short_val);
-		    ssv->ssv_serial = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[12], &short_val);
-		    ssv->ssv_ndata = (int) ((unsigned short) short_val);
-		}
-
-	/* read binary heading values */
-	if (status == MB_SUCCESS)
-	    {
-	    for (i=0;i<ssv->ssv_ndata && status == MB_SUCCESS;i++)
-		{
-		read_len = fread(line,1,EM2_SSV_SLICE_SIZE,mbfp);
-		if (read_len == EM2_SSV_SLICE_SIZE
-			&& i < MBSYS_SIMRAD2_MAXSSV)
-			{
-			status = MB_SUCCESS;
-			mb_get_binary_short(swap, &line[0], &short_val);
-			    ssv->ssv_time[i] = (int) ((unsigned short) short_val);
-			mb_get_binary_short(swap, &line[2], &short_val);
-			    ssv->ssv_ssv[i] = (int) ((unsigned short) short_val);
-			}
-		else
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_EOF;
-			}
-		}
-	    ssv->ssv_ndata = MIN(ssv->ssv_ndata, MBSYS_SIMRAD2_MAXSSV);
-	    }
-
-	/* now get last bytes of record */
-	if (status == MB_SUCCESS)
-		{
-		read_len = fread(&line[0],1,4,mbfp);
-		if (read_len == 4)
-			{
-			status = MB_SUCCESS;
-			}
-		else
-			{
-			/* return success here because all of the
-			    important information in this record has
-			    already been read - next attempt to read
-			    file will return error */
-			status = MB_SUCCESS;
-			}
-#ifdef MBR_EM300MBA_DEBUG
-	fprintf(stderr, "End Bytes: %2.2hX %d | %2.2hX %d | %2.2hX %d\n",
-		line[1], line[1],
-		line[2], line[2],
-		line[3], line[3]);
-#endif
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       ssv_date:        %d\n",ssv->ssv_date);
-		fprintf(stderr,"dbg5       ssv_msec:        %d\n",ssv->ssv_msec);
-		fprintf(stderr,"dbg5       ssv_count:       %d\n",ssv->ssv_count);
-		fprintf(stderr,"dbg5       ssv_serial:      %d\n",ssv->ssv_serial);
-		fprintf(stderr,"dbg5       ssv_ndata:       %d\n",ssv->ssv_ndata);
-		fprintf(stderr,"dbg5       count    time (msec)    ssv (0.1 m/s)\n");
-		fprintf(stderr,"dbg5       -----    -----------    ------------------\n");
-		for (i=0;i<ssv->ssv_ndata;i++)
-			fprintf(stderr,"dbg5        %4d      %7d          %7d\n",
-				i, ssv->ssv_time[i], ssv->ssv_ssv[i]);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em300mba_rd_tilt(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store,
-		short sonar, int *error)
-{
-	char	*function_name = "mbr_em300mba_rd_tilt";
-	int	status = MB_SUCCESS;
-	struct mbsys_simrad2_tilt_struct *tilt;
-	char	line[EM2_TILT_HEADER_SIZE];
-	short	short_val;
-	int	read_len;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		fprintf(stderr,"dbg2       sonar:      %d\n",sonar);
-		}
-
-	/* get  storage structure */
-	tilt = (struct mbsys_simrad2_tilt_struct *) store->tilt;
-
-	/* set kind and type values */
-	store->kind = MB_DATA_TILT;
-	store->type = EM2_TILT;
-	store->sonar = sonar;
-
-	/* read binary header values into char array */
-	read_len = fread(line,1,EM2_TILT_HEADER_SIZE,mbfp);
-	if (read_len == EM2_TILT_HEADER_SIZE)
-		status = MB_SUCCESS;
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	/* get binary header data */
-	if (status == MB_SUCCESS)
-		{
-		mb_get_binary_int(swap, &line[0], &tilt->tlt_date);
-		    store->date = tilt->tlt_date;
-		mb_get_binary_int(swap, &line[4], &tilt->tlt_msec);
-		    store->msec = tilt->tlt_msec;
-		mb_get_binary_short(swap, &line[8], &short_val);
-		    tilt->tlt_count = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[10], &short_val);
-		    tilt->tlt_serial = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[12], &short_val);
-		    tilt->tlt_ndata = (int) ((unsigned short) short_val);
-		}
-
-	/* read binary tilt values */
-	if (status == MB_SUCCESS)
-	    {
-	    for (i=0;i<tilt->tlt_ndata && status == MB_SUCCESS;i++)
-		{
-		read_len = fread(line,1,EM2_TILT_SLICE_SIZE,mbfp);
-		if (read_len == EM2_TILT_SLICE_SIZE
-			&& i < MBSYS_SIMRAD2_MAXTILT)
-			{
-			status = MB_SUCCESS;
-			mb_get_binary_short(swap, &line[0], &short_val);
-			    tilt->tlt_time[i] = (int) ((unsigned short) short_val);
-			mb_get_binary_short(swap, &line[2], &short_val);
-			    tilt->tlt_tilt[i] = (int) ((unsigned short) short_val);
-			}
-		else
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_EOF;
-			}
-		}
-	    tilt->tlt_ndata = MIN(tilt->tlt_ndata, MBSYS_SIMRAD2_MAXTILT);
-	    }
-
-	/* now get last bytes of record */
-	if (status == MB_SUCCESS)
-		{
-		read_len = fread(&line[0],1,4,mbfp);
-		if (read_len == 4)
-			{
-			status = MB_SUCCESS;
-			}
-		else
-			{
-			/* return success here because all of the
-			    important information in this record has
-			    already been read - next attempt to read
-			    file will return error */
-			status = MB_SUCCESS;
-			}
-#ifdef MBR_EM300MBA_DEBUG
-	fprintf(stderr, "End Bytes: %2.2hX %d | %2.2hX %d | %2.2hX %d\n",
-		line[1], line[1],
-		line[2], line[2],
-		line[3], line[3]);
-#endif
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       tlt_date:        %d\n",tilt->tlt_date);
-		fprintf(stderr,"dbg5       tlt_msec:        %d\n",tilt->tlt_msec);
-		fprintf(stderr,"dbg5       tlt_count:       %d\n",tilt->tlt_count);
-		fprintf(stderr,"dbg5       tlt_serial:      %d\n",tilt->tlt_serial);
-		fprintf(stderr,"dbg5       tlt_ndata:       %d\n",tilt->tlt_ndata);
-		fprintf(stderr,"dbg5       count    time (msec)    tilt (0.01 deg)\n");
-		fprintf(stderr,"dbg5       -----    -----------    ------------------\n");
-		for (i=0;i<tilt->tlt_ndata;i++)
-			fprintf(stderr,"dbg5        %4d      %7d          %7d\n",
-				i, tilt->tlt_time[i], tilt->tlt_tilt[i]);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em300mba_rd_attitude(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store,
-		short sonar, int *error)
-{
-	char	*function_name = "mbr_em300mba_rd_attitude";
-	int	status = MB_SUCCESS;
-	struct mbsys_simrad2_attitude_struct *attitude;
-	char	line[EM2_ATTITUDE_HEADER_SIZE];
-	short	short_val;
-	int	read_len;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		fprintf(stderr,"dbg2       sonar:      %d\n",sonar);
-		}
-
-	/* get  storage structure */
-	attitude = (struct mbsys_simrad2_attitude_struct *) store->attitude;
-
-	/* set kind and type values */
-	store->kind = MB_DATA_ATTITUDE;
-	store->type = EM2_ATTITUDE;
-	store->sonar = sonar;
-
-	/* read binary header values into char array */
-	read_len = fread(line,1,EM2_ATTITUDE_HEADER_SIZE,mbfp);
-	if (read_len == EM2_ATTITUDE_HEADER_SIZE)
-		status = MB_SUCCESS;
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	/* get binary header data */
-	if (status == MB_SUCCESS)
-		{
-		mb_get_binary_int(swap, &line[0], &attitude->att_date);
-		    store->date = attitude->att_date;
-		mb_get_binary_int(swap, &line[4], &attitude->att_msec);
-		    store->msec = attitude->att_msec;
-		mb_get_binary_short(swap, &line[8], &short_val);
-		    attitude->att_count = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[10], &short_val);
-		    attitude->att_serial = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[12], &short_val);
-		    attitude->att_ndata = (int) ((unsigned short) short_val);
-		}
-
-	/* read binary attitude values */
-	if (status == MB_SUCCESS)
-	    {
-	    for (i=0;i<attitude->att_ndata && status == MB_SUCCESS;i++)
-		{
-		read_len = fread(line,1,EM2_ATTITUDE_SLICE_SIZE,mbfp);
-		if (read_len == EM2_ATTITUDE_SLICE_SIZE
-			&& i < MBSYS_SIMRAD2_MAXATTITUDE)
-			{
-			status = MB_SUCCESS;
-			mb_get_binary_short(swap, &line[0], &short_val);
-			    attitude->att_time[i] = (int) ((unsigned short) short_val);
-			mb_get_binary_short(swap, &line[2], &short_val);
-			    attitude->att_sensor_status[i] = (int) ((unsigned short) short_val);
-			mb_get_binary_short(swap, &line[4], &short_val);
-			    attitude->att_roll[i] = (int) short_val;
-			mb_get_binary_short(swap, &line[6], &short_val);
-			    attitude->att_pitch[i] = (int) short_val;
-			mb_get_binary_short(swap, &line[8], &short_val);
-			    attitude->att_heave[i] = (int) short_val;
-			mb_get_binary_short(swap, &line[10], &short_val);
-			    attitude->att_heading[i] = (int) ((unsigned short) short_val);
-			}
-		else
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_EOF;
-			}
-		}
-	    attitude->att_ndata = MIN(attitude->att_ndata, MBSYS_SIMRAD2_MAXATTITUDE);
-	    }
-
-	/* now get last bytes of record */
-	if (status == MB_SUCCESS)
-		{
-		read_len = fread(&line[0],1,4,mbfp);
-		if (read_len == 4)
-			{
-			status = MB_SUCCESS;
-			attitude->att_heading_status = (mb_u_char) line[0];
-			}
-		else
-			{
-			/* return success here because all of the
-			    important information in this record has
-			    already been read - next attempt to read
-			    file will return error */
-			status = MB_SUCCESS;
-			}
-#ifdef MBR_EM300MBA_DEBUG
-	fprintf(stderr, "End Bytes: %2.2hX %d | %2.2hX %d | %2.2hX %d\n",
-		line[1], line[1],
-		line[2], line[2],
-		line[3], line[3]);
-#endif
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       att_date:        %d\n",attitude->att_date);
-		fprintf(stderr,"dbg5       att_msec:        %d\n",attitude->att_msec);
-		fprintf(stderr,"dbg5       att_count:       %d\n",attitude->att_count);
-		fprintf(stderr,"dbg5       att_serial:      %d\n",attitude->att_serial);
-		fprintf(stderr,"dbg5       att_ndata:       %d\n",attitude->att_ndata);
-		fprintf(stderr,"dbg5       cnt   time   roll pitch heave heading\n");
-		fprintf(stderr,"dbg5       -------------------------------------\n");
-		for (i=0;i<attitude->att_ndata;i++)
-			fprintf(stderr,"dbg5        %3d  %d  %d %d %d %d\n",
-				i, attitude->att_time[i], attitude->att_roll[i],
-				attitude->att_pitch[i], attitude->att_heave[i],
-				attitude->att_heading[i]);
-		fprintf(stderr,"dbg5       att_heading_status: %d\n",attitude->att_heading_status);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em300mba_rd_pos(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store,
-		short sonar, int *error)
-{
-	char	*function_name = "mbr_em300mba_rd_pos";
-	int	status = MB_SUCCESS;
-	char	line[MBSYS_SIMRAD2_COMMENT_LENGTH];
-	short	short_val;
-	int	read_len;
-	int	done;
-	int	navchannel;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		fprintf(stderr,"dbg2       sonar:      %d\n",sonar);
-		}
-
-	/* set kind and type values */
-	store->kind = MB_DATA_NAV;
-	store->type = EM2_POS;
-	store->sonar = sonar;
-
-	/* read binary header values into char array */
-	read_len = fread(line,1,EM2_POS_HEADER_SIZE,mbfp);
-	if (read_len == EM2_POS_HEADER_SIZE)
-		status = MB_SUCCESS;
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	/* get binary header data */
-	if (status == MB_SUCCESS)
-		{
-		mb_get_binary_int(swap, &line[0], &store->pos_date);
-		    store->date = store->pos_date;
-		mb_get_binary_int(swap, &line[4], &store->pos_msec);
-		    store->msec = store->pos_msec;
-		mb_get_binary_short(swap, &line[8], &short_val);
-		    store->pos_count = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[10], &short_val);
-		    store->pos_serial = (int) ((unsigned short) short_val);
-		mb_get_binary_int(swap, &line[12], &store->pos_latitude);
-		mb_get_binary_int(swap, &line[16], &store->pos_longitude);
-		mb_get_binary_short(swap, &line[20], &short_val);
-		    store->pos_quality = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[22], &short_val);
-		    store->pos_speed = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[24], &short_val);
-		    store->pos_course = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[26], &short_val);
-		    store->pos_heading = (int) ((unsigned short) short_val);
-		store->pos_system = (mb_u_char) line[28];
-		store->pos_input_size = (mb_u_char) line[29];
-		}
-
-	/* read input position string */
-	if (status == MB_SUCCESS && store->pos_input_size < 256)
-		{
-		read_len = fread(store->pos_input,1,store->pos_input_size,mbfp);
-		if (read_len == store->pos_input_size)
-			{
-			status = MB_SUCCESS;
-			store->pos_input[store->pos_input_size] = '\0';
-			}
-		else
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_EOF;
-			}
-		}
-
-	/* now loop over reading individual characters to
-	    get last bytes of record */
-	if (status == MB_SUCCESS)
-	    {
-	    done = MB_NO;
-	    while (done == MB_NO)
-		{
-		read_len = fread(&line[0],1,1,mbfp);
-		if (read_len == 1 && line[0] == EM2_END)
-			{
-			done = MB_YES;
-			status = MB_SUCCESS;
-			/* get last two check sum bytes */
-			read_len = fread(&line[1],2,1,mbfp);
-#ifdef MBR_EM300MBA_DEBUG
-	fprintf(stderr, "End Bytes: %2.2hX %d | %2.2hX %d | %2.2hX %d\n",
-		line[0], line[0],
-		line[1], line[1],
-		line[2], line[2]);
-#endif
-			}
-		else if (read_len == 1)
-			{
-			status = MB_SUCCESS;
-			}
-		else
-			{
-			done = MB_YES;
-			/* return success here because all of the
-			    important information in this record has
-			    already been read - next attempt to read
-			    file will return error */
-			status = MB_SUCCESS;
-			}
-		}
-#ifdef MBR_EM300MBA_DEBUG
-	fprintf(stderr, "\n");
-#endif
-	    }
-
-	/* check for navigation source */
-	if (status == MB_SUCCESS)
-		{
-		/* "active" nav system has first bit set in store->pos_system */
-		if (store->pos_system & 128)
-		    {
-		    store->kind = MB_DATA_NAV;
-		    }
-
-		/* otherwise its from a secondary nav system */
-		else
-		    {
-		    navchannel = (store->pos_system & 0x03);
-		    if (navchannel == 1)
-			{
-			store->kind = MB_DATA_NAV1;
-			}
-		    else if (navchannel == 2)
-			{
-			store->kind = MB_DATA_NAV2;
-			}
-		    else if (navchannel == 3)
-			{
-			store->kind = MB_DATA_NAV3;
-			}
-
-		    /* otherwise its an error */
-		    else
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_UNINTELLIGIBLE;
-			}
-		    }
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       pos_date:        %d\n",store->pos_date);
-		fprintf(stderr,"dbg5       pos_msec:        %d\n",store->pos_msec);
-		fprintf(stderr,"dbg5       pos_count:       %d\n",store->pos_count);
-		fprintf(stderr,"dbg5       pos_serial:      %d\n",store->pos_serial);
-		fprintf(stderr,"dbg5       pos_latitude:    %d\n",store->pos_latitude);
-		fprintf(stderr,"dbg5       pos_longitude:   %d\n",store->pos_longitude);
-		fprintf(stderr,"dbg5       pos_quality:     %d\n",store->pos_quality);
-		fprintf(stderr,"dbg5       pos_speed:       %d\n",store->pos_speed);
-		fprintf(stderr,"dbg5       pos_course:      %d\n",store->pos_course);
-		fprintf(stderr,"dbg5       pos_heading:     %d\n",store->pos_heading);
-		fprintf(stderr,"dbg5       pos_system:      %d\n",store->pos_system);
-		fprintf(stderr,"dbg5       pos_input_size:  %d\n",store->pos_input_size);
-		fprintf(stderr,"dbg5       pos_input:\ndbg5            %s\n",store->pos_input);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em300mba_rd_svp(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store,
-		short sonar, int *error)
-{
-	char	*function_name = "mbr_em300mba_rd_svp";
-	int	status = MB_SUCCESS;
-	char	line[EM2_SVP_HEADER_SIZE];
-	short	short_val;
-	int	read_len;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		fprintf(stderr,"dbg2       sonar:      %d\n",sonar);
-		}
-
-	/* set kind and type values */
-	store->kind = MB_DATA_VELOCITY_PROFILE;
-	store->type = EM2_SVP;
-	store->sonar = sonar;
-
-	/* read binary header values into char array */
-	read_len = fread(line,1,EM2_SVP_HEADER_SIZE,mbfp);
-	if (read_len == EM2_SVP_HEADER_SIZE)
-		status = MB_SUCCESS;
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	/* get binary header data */
-	if (status == MB_SUCCESS)
-		{
-		mb_get_binary_int(swap, &line[0], &store->svp_use_date);
-		    store->date = store->svp_use_date;
-		mb_get_binary_int(swap, &line[4], &store->svp_use_msec);
-		    store->msec = store->svp_use_msec;
-		mb_get_binary_short(swap, &line[8], &short_val);
-		    store->svp_count = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[10], &short_val);
-		    store->svp_serial = (int) ((unsigned short) short_val);
-		mb_get_binary_int(swap, &line[12], &store->svp_origin_date);
-		mb_get_binary_int(swap, &line[16], &store->svp_origin_msec);
-		mb_get_binary_short(swap, &line[20], &short_val);
-		    store->svp_num = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[22], &short_val);
-		    store->svp_depth_res = (int) ((unsigned short) short_val);
-		}
-
-	/* read binary svp values */
-	if (status == MB_SUCCESS)
-	    {
-	    for (i=0;i<store->svp_num && status == MB_SUCCESS;i++)
-		{
-		read_len = fread(line,1,EM2_SVP_SLICE_SIZE,mbfp);
-		if (read_len != EM2_SVP_SLICE_SIZE)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_EOF;
-			}
-		else if (i < MBSYS_SIMRAD2_MAXSVP)
-			{
-			status = MB_SUCCESS;
-			mb_get_binary_short(swap, &line[0], &short_val);
-			    store->svp_depth[i] = (int) ((unsigned short) short_val);
-			mb_get_binary_short(swap, &line[2], &short_val);
-			    store->svp_vel[i] = (int) ((unsigned short) short_val);
-			}
-		}
-	    store->svp_num = MIN(store->svp_num, MBSYS_SIMRAD2_MAXSVP);
-	    }
-
-	/* now get last bytes of record */
-	if (status == MB_SUCCESS)
-		{
-		read_len = fread(&line[0],1,4,mbfp);
-		if (read_len == 4)
-			{
-			status = MB_SUCCESS;
-			}
-		else
-			{
-			/* return success here because all of the
-			    important information in this record has
-			    already been read - next attempt to read
-			    file will return error */
-			status = MB_SUCCESS;
-			}
-#ifdef MBR_EM300MBA_DEBUG
-	fprintf(stderr, "End Bytes: %2.2hX %d | %2.2hX %d | %2.2hX %d\n",
-		line[1], line[1],
-		line[2], line[2],
-		line[3], line[3]);
-#endif
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       svp_use_date:    %d\n",store->svp_use_date);
-		fprintf(stderr,"dbg5       svp_use_msec:    %d\n",store->svp_use_msec);
-		fprintf(stderr,"dbg5       svp_count:       %d\n",store->svp_count);
-		fprintf(stderr,"dbg5       svp_serial:      %d\n",store->svp_serial);
-		fprintf(stderr,"dbg5       svp_origin_date: %d\n",store->svp_origin_date);
-		fprintf(stderr,"dbg5       svp_origin_msec: %d\n",store->svp_origin_msec);
-		fprintf(stderr,"dbg5       svp_num:         %d\n",store->svp_num);
-		fprintf(stderr,"dbg5       svp_depth_res:   %d\n",store->svp_depth_res);
-		fprintf(stderr,"dbg5       count    depth    speed\n");
-		fprintf(stderr,"dbg5       -----------------------\n");
-		for (i=0;i<store->svp_num;i++)
-			fprintf(stderr,"dbg5        %d   %d  %d\n",
-				i, store->svp_depth[i], store->svp_vel[i]);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em300mba_rd_svp2(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store,
-		short sonar, int *error)
-{
-	char	*function_name = "mbr_em300mba_rd_svp2";
-	int	status = MB_SUCCESS;
-	char	line[EM2_SVP2_HEADER_SIZE];
-	short	short_val;
-	int	read_len;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		fprintf(stderr,"dbg2       sonar:      %d\n",sonar);
-		}
-
-	/* set kind and type values */
-	store->kind = MB_DATA_VELOCITY_PROFILE;
-	store->type = EM2_SVP2;
-	store->sonar = sonar;
-
-	/* read binary header values into char array */
-	read_len = fread(line,1,EM2_SVP_HEADER_SIZE,mbfp);
-	if (read_len == EM2_SVP_HEADER_SIZE)
-		status = MB_SUCCESS;
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	/* get binary header data */
-	if (status == MB_SUCCESS)
-		{
-		mb_get_binary_int(swap, &line[0], &store->svp_use_date);
-		    store->date = store->svp_use_date;
-		mb_get_binary_int(swap, &line[4], &store->svp_use_msec);
-		    store->msec = store->svp_use_msec;
-		mb_get_binary_short(swap, &line[8], &short_val);
-		    store->svp_count = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[10], &short_val);
-		    store->svp_serial = (int) ((unsigned short) short_val);
-		mb_get_binary_int(swap, &line[12], &store->svp_origin_date);
-		mb_get_binary_int(swap, &line[16], &store->svp_origin_msec);
-		mb_get_binary_short(swap, &line[20], &short_val);
-		    store->svp_num = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[22], &short_val);
-		    store->svp_depth_res = (int) ((unsigned short) short_val);
-		}
-
-	/* read binary svp values */
-	if (status == MB_SUCCESS)
-	    {
-	    for (i=0;i<store->svp_num && status == MB_SUCCESS;i++)
-		{
-		read_len = fread(line,1,EM2_SVP2_SLICE_SIZE,mbfp);
-		if (read_len != EM2_SVP2_SLICE_SIZE)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_EOF;
-			}
-		else if (i < MBSYS_SIMRAD2_MAXSVP)
-			{
-			status = MB_SUCCESS;
-			mb_get_binary_int(swap, &line[0], &store->svp_depth[i]);
-			mb_get_binary_int(swap, &line[4], &store->svp_vel[i]);
-			}
-		}
-	    store->svp_num = MIN(store->svp_num, MBSYS_SIMRAD2_MAXSVP);
-	    }
-
-	/* now get last bytes of record */
-	if (status == MB_SUCCESS)
-		{
-		read_len = fread(&line[0],1,4,mbfp);
-		if (read_len == 4)
-			{
-			status = MB_SUCCESS;
-			}
-		else
-			{
-			/* return success here because all of the
-			    important information in this record has
-			    already been read - next attempt to read
-			    file will return error */
-			status = MB_SUCCESS;
-			}
-#ifdef MBR_EM300MBA_DEBUG
-	fprintf(stderr, "End Bytes: %2.2hX %d | %2.2hX %d | %2.2hX %d\n",
-		line[1], line[1],
-		line[2], line[2],
-		line[3], line[3]);
-#endif
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       svp_use_date:    %d\n",store->svp_use_date);
-		fprintf(stderr,"dbg5       svp_use_msec:    %d\n",store->svp_use_msec);
-		fprintf(stderr,"dbg5       svp_count:       %d\n",store->svp_count);
-		fprintf(stderr,"dbg5       svp_serial:      %d\n",store->svp_serial);
-		fprintf(stderr,"dbg5       svp_origin_date: %d\n",store->svp_origin_date);
-		fprintf(stderr,"dbg5       svp_origin_msec: %d\n",store->svp_origin_msec);
-		fprintf(stderr,"dbg5       svp_num:         %d\n",store->svp_num);
-		fprintf(stderr,"dbg5       svp_depth_res:   %d\n",store->svp_depth_res);
-		fprintf(stderr,"dbg5       count    depth    speed\n");
-		fprintf(stderr,"dbg5       -----------------------\n");
-		for (i=0;i<store->svp_num;i++)
-			fprintf(stderr,"dbg5        %d   %d  %d\n",
-				i, store->svp_depth[i], store->svp_vel[i]);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em300mba_rd_bath(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store,
-		int *match, short sonar, int version, int *error)
-{
-	char	*function_name = "mbr_em300mba_rd_bath";
-	int	status = MB_SUCCESS;
-	struct mbsys_simrad2_ping_struct *ping;
-	char	line[EM2_BATH_MBA_HEADER_SIZE];
-	short	short_val;
-	int	png_count;
-	int	png_serial;
-	int	head;
-	int	read_len;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		fprintf(stderr,"dbg2       sonar:      %d\n",sonar);
-		fprintf(stderr,"dbg2       version:    %d\n",version);
-		}
-
-	/* get  storage structure */
-	ping = (struct mbsys_simrad2_ping_struct *) store->ping;
-	head = 0;
-
-	/* set kind and type values */
-	store->kind = MB_DATA_DATA;
-	store->type = EM2_BATH_MBA;
-	store->sonar = sonar;
-
-	/* read binary header values into char array */
-	read_len = fread(line,1,EM2_BATH_MBA_HEADER_SIZE,mbfp);
-	if (read_len == EM2_BATH_MBA_HEADER_SIZE)
-		status = MB_SUCCESS;
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	/* in case of EM3002 check if the data are from the second head and switch ping structure if so */
-	if (status == MB_SUCCESS && sonar == MBSYS_SIMRAD2_EM3002
-			&& store->numberheads == 2)
-		{
-		mb_get_binary_short(swap, &line[8], &short_val);
-		    png_count = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[10], &short_val);
-		    png_serial = (int) ((unsigned short) short_val);
-
-		if (png_count == ping->png_count && png_serial != ping->png_serial)
-			{
-			ping = (struct mbsys_simrad2_ping_struct *) store->ping2;
-			head = 1;
-			}
-		}
-
-	/* get binary header data */
-	if (status == MB_SUCCESS)
-		{
-		mb_get_binary_int(swap, &line[0], &ping->png_date);
-		    store->date = ping->png_date;
-		mb_get_binary_int(swap, &line[4], &ping->png_msec);
-		    store->msec = ping->png_msec;
-		mb_get_binary_short(swap, &line[8], &short_val);
-		    ping->png_count = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[10], &short_val);
-		    ping->png_serial = (int) ((unsigned short) short_val);
-		mb_get_binary_int(swap, &line[12], &ping->png_latitude);
-		mb_get_binary_int(swap, &line[16], &ping->png_longitude);
-		mb_get_binary_short(swap, &line[20], &short_val);
-		    ping->png_speed = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[22], &short_val);
-		    ping->png_heading = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[24], &short_val);
-		    ping->png_ssv = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[26], &short_val);
-		    ping->png_xducer_depth = (int) ((unsigned short) short_val);
-		ping->png_nbeams_max = (mb_u_char) line[28];
-		ping->png_nbeams = (mb_u_char) line[29];
-		ping->png_depth_res = (mb_u_char) line[30];
-		ping->png_distance_res = (mb_u_char) line[31];
-		mb_get_binary_short(swap, &line[32], &short_val);
-		    ping->png_sample_rate = (int) ((unsigned short) short_val);
-		}
-
-	/* check for some indicators of a broken record
-	    - these do happen!!!! */
-	if (status == MB_SUCCESS)
-		{
-		if (ping->png_nbeams > ping->png_nbeams_max
-			|| ping->png_nbeams < 0
-			|| ping->png_nbeams_max < 0
-			|| ping->png_nbeams > MBSYS_SIMRAD2_MAXBEAMS
-			|| ping->png_nbeams_max > MBSYS_SIMRAD2_MAXBEAMS)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_UNINTELLIGIBLE;
-			}
-		}
-
-	/* read binary beam values */
-	if (status == MB_SUCCESS)
-	    {
-	    for (i=0;i<ping->png_nbeams && status == MB_SUCCESS;i++)
-		{
-		read_len = fread(line,1,EM2_BATH_MBA_BEAM_SIZE,mbfp);
-		if (read_len == EM2_BATH_MBA_BEAM_SIZE
-			&& i < MBSYS_SIMRAD2_MAXBEAMS)
-			{
-			status = MB_SUCCESS;
-			mb_get_binary_short(swap, &line[0], &short_val);
-			if (store->sonar == MBSYS_SIMRAD2_EM120
-				|| store->sonar == MBSYS_SIMRAD2_EM300
-				|| store->sonar == MBSYS_SIMRAD2_EM12S
-				|| store->sonar == MBSYS_SIMRAD2_EM12D
-				|| store->sonar == MBSYS_SIMRAD2_EM121
-				|| store->sonar == MBSYS_SIMRAD2_EM100
-				|| store->sonar == MBSYS_SIMRAD2_EM1000)
-				ping->png_depth[i] = (int) ((unsigned short) short_val);
-			else
-				ping->png_depth[i] = (int) short_val;
-			mb_get_binary_short(swap, &line[2], &short_val);
-			    ping->png_acrosstrack[i] = (int) short_val;
-			mb_get_binary_short(swap, &line[4], &short_val);
-			    ping->png_alongtrack[i] = (int) short_val;
-			mb_get_binary_short(swap, &line[6], &short_val);
-			    ping->png_depression[i] = (int) short_val;
-			mb_get_binary_short(swap, &line[8], &short_val);
-			    ping->png_azimuth[i] = (int) ((unsigned short) short_val);
-			mb_get_binary_short(swap, &line[10], &short_val);
-			    ping->png_range[i] = (int) ((unsigned short) short_val);
-			ping->png_quality[i] = (mb_u_char) line[12];
-			ping->png_window[i] = (mb_u_char) line[13];
-			mb_get_binary_short(swap, &line[14], &short_val);
-			    ping->png_amp[i] = (int) ((short) short_val);
-			ping->png_beam_num[i] = (mb_u_char) line[16];
-			ping->png_beamflag[i] = (char) line[17];
-			}
-		else
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_EOF;
-			}
-		}
-	    }
-
-	/* now get last bytes of record */
-	if (status == MB_SUCCESS)
-		{
-		read_len = fread(&line[0],1,4,mbfp);
-		if (read_len == 4)
-			{
-			status = MB_SUCCESS;
-			ping->png_offset_multiplier = (mb_s_char) line[0];
-			}
-		else
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_EOF;
-			}
-#ifdef MBR_EM300MBA_DEBUG
-	fprintf(stderr, "End Bytes: %2.2hX %d | %2.2hX %d | %2.2hX %d\n",
-		line[1], line[1],
-		line[2], line[2],
-		line[3], line[3]);
-#endif
-		}
-
-	/* check for some other indicators of a broken record
-	    - these do happen!!!! */
-	if (status == MB_SUCCESS)
-		{
-		if (ping->png_nbeams > 0
-		    && ping->png_beam_num[0] > ping->png_nbeams_max)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_UNINTELLIGIBLE;
-			}
-		for (i=1;i<ping->png_nbeams;i++)
-			{
-			if (ping->png_beam_num[i] < ping->png_beam_num[i-1]
-				|| ping->png_beam_num[i] > ping->png_nbeams_max)
-				{
-				status = MB_FAILURE;
-				*error = MB_ERROR_UNINTELLIGIBLE;
-				}
-			}
-		}
-
-	/* check if bath and sidescan time tags agree
-	   - we cannot pair bath
-	   and sidescan records from different pings */
-	if (status == MB_SUCCESS)
-		{
-		if (ping->png_date == ping->png_ss_date
-		    && ping->png_msec == ping->png_ss_msec)
-		    *match = MB_YES;
-		else
-		    *match = MB_NO;
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       png_date:        %d\n",ping->png_date);
-		fprintf(stderr,"dbg5       png_msec:        %d\n",ping->png_msec);
-		fprintf(stderr,"dbg5       png_count:       %d\n",ping->png_count);
-		fprintf(stderr,"dbg5       png_serial:      %d\n",ping->png_serial);
-		fprintf(stderr,"dbg5       png_latitude:    %d\n",ping->png_latitude);
-		fprintf(stderr,"dbg5       png_longitude:   %d\n",ping->png_longitude);
-		fprintf(stderr,"dbg5       png_speed:       %d\n",ping->png_speed);
-		fprintf(stderr,"dbg5       png_heading:     %d\n",ping->png_heading);
-		fprintf(stderr,"dbg5       png_ssv:         %d\n",ping->png_ssv);
-		fprintf(stderr,"dbg5       png_xducer_depth:      %d\n",ping->png_xducer_depth);
-		fprintf(stderr,"dbg5       png_offset_multiplier: %d\n",ping->png_offset_multiplier);
-		fprintf(stderr,"dbg5       png_nbeams_max:        %d\n",ping->png_nbeams_max);
-		fprintf(stderr,"dbg5       png_nbeams:            %d\n",ping->png_nbeams);
-		fprintf(stderr,"dbg5       png_depth_res:         %d\n",ping->png_depth_res);
-		fprintf(stderr,"dbg5       png_distance_res:      %d\n",ping->png_distance_res);
-		fprintf(stderr,"dbg5       png_sample_rate:       %d\n",ping->png_sample_rate);
-		fprintf(stderr,"dbg5       cnt  depth xtrack ltrack dprsn   azi   rng  qual wnd  amp num flag\n");
-		fprintf(stderr,"dbg5       ------------------------------------------------------------\n");
-		for (i=0;i<ping->png_nbeams;i++)
-			fprintf(stderr,"dbg5       %3d %6d %6d %6d %5d %5d %5d %4d %3d %4d %3d %4d\n",
-				i, ping->png_depth[i], ping->png_acrosstrack[i],
-				ping->png_alongtrack[i], ping->png_depression[i],
-				ping->png_azimuth[i], ping->png_range[i],
-				ping->png_quality[i], ping->png_window[i],
-				ping->png_amp[i], ping->png_beam_num[i],
-				ping->png_beamflag[i]);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       match:      %d\n",*match);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em300mba_rd_rawbeam(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store,
-		short sonar, int *error)
-{
-	char	*function_name = "mbr_em300mba_rd_rawbeam";
-	int	status = MB_SUCCESS;
-	struct mbsys_simrad2_ping_struct *ping;
-	char	line[EM2_RAWBEAM_HEADER_SIZE];
-	short	short_val;
-	int	read_len;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		fprintf(stderr,"dbg2       sonar:      %d\n",sonar);
-		}
-
-	/* get  storage structure */
-	ping = (struct mbsys_simrad2_ping_struct *) store->ping;
-
-	/* read binary header values into char array */
-	read_len = fread(line,1,EM2_RAWBEAM_HEADER_SIZE,mbfp);
-	if (read_len == EM2_RAWBEAM_HEADER_SIZE)
-		status = MB_SUCCESS;
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	/* get binary header data */
-	if (status == MB_SUCCESS)
-		{
-		mb_get_binary_int(swap, &line[0], &ping->png_raw_date);
-		    store->date = ping->png_raw_date;
-		mb_get_binary_int(swap, &line[4], &ping->png_raw_msec);
-		    store->msec = ping->png_raw_msec;
-		mb_get_binary_short(swap, &line[8], &short_val);
-		    ping->png_raw_count = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[10], &short_val);
-		    ping->png_raw_serial = (int) ((unsigned short) short_val);
-		ping->png_raw_nbeams_max = (mb_u_char) line[12];
-		ping->png_raw_nbeams = (mb_u_char) line[13];
-		mb_get_binary_short(swap, &line[14], &short_val);
-		    ping->png_raw_ssv = (int) ((unsigned short) short_val);
-		}
-
-	/* check for some indicators of a broken record
-	    - these do happen!!!! */
-	if (status == MB_SUCCESS)
-		{
-		if (ping->png_raw_nbeams > ping->png_raw_nbeams_max
-			|| ping->png_raw_nbeams < 0
-			|| ping->png_raw_nbeams_max < 0
-			|| ping->png_raw_nbeams > MBSYS_SIMRAD2_MAXBEAMS
-			|| ping->png_raw_nbeams_max > MBSYS_SIMRAD2_MAXBEAMS)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_UNINTELLIGIBLE;
-			}
-		}
-
-	/* read binary beam values */
-	if (status == MB_SUCCESS)
-	    {
-	    for (i=0;i<ping->png_raw_nbeams && status == MB_SUCCESS;i++)
-		{
-		read_len = fread(line,1,EM2_RAWBEAM_BEAM_SIZE,mbfp);
-		if (read_len == EM2_RAWBEAM_BEAM_SIZE
-			&& i < MBSYS_SIMRAD2_MAXBEAMS)
-			{
-			status = MB_SUCCESS;
-			mb_get_binary_short(swap, &line[0], &short_val);
-			    ping->png_raw_rxpointangle[i] = (int) short_val;
-			mb_get_binary_short(swap, &line[2], &short_val);
-			    ping->png_raw_rxtiltangle[i] = (int) short_val;
-			mb_get_binary_short(swap, &line[4], &short_val);
-			    ping->png_raw_rxrange[i] = (int) ((unsigned short) short_val);
-			ping->png_raw_rxamp[i] = (mb_s_char) line[6];
-			ping->png_raw_rxbeam_num[i] = (mb_u_char) line[7];
-			}
-		else
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_EOF;
-			}
-		}
-	    }
-
-	/* now get last bytes of record */
-	if (status == MB_SUCCESS)
-		{
-		read_len = fread(&line[0],1,4,mbfp);
-		if (read_len == 4)
-			{
-			status = MB_SUCCESS;
-			}
-		else
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_EOF;
-			}
-#ifdef MBR_EM300MBA_DEBUG
-	fprintf(stderr, "End Bytes: %2.2hX %d | %2.2hX %d | %2.2hX %d\n",
-		line[1], line[1],
-		line[2], line[2],
-		line[3], line[3]);
-#endif
-		}
-
-	/* check for some other indicators of a broken record
-	    - these do happen!!!! */
-	if (status == MB_SUCCESS)
-		{
-		if (ping->png_raw_nbeams > 0
-		    && ping->png_raw_rxbeam_num[0] > ping->png_raw_nbeams_max)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_UNINTELLIGIBLE;
-			}
-		for (i=1;i<ping->png_raw_nbeams;i++)
-			{
-			if (ping->png_raw_rxbeam_num[i] < ping->png_raw_rxbeam_num[i-1]
-				|| ping->png_raw_rxbeam_num[i] > ping->png_raw_nbeams_max)
-				{
-				status = MB_FAILURE;
-				*error = MB_ERROR_UNINTELLIGIBLE;
-				}
-			}
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       png_raw_date:        %d\n",ping->png_raw_date);
-		fprintf(stderr,"dbg5       png_raw_msec:        %d\n",ping->png_raw_msec);
-		fprintf(stderr,"dbg5       png_raw_count:       %d\n",ping->png_raw_count);
-		fprintf(stderr,"dbg5       png_raw_serial:      %d\n",ping->png_raw_serial);
-		fprintf(stderr,"dbg5       png_raw_nbeams_max:  %d\n",ping->png_raw_nbeams_max);
-		fprintf(stderr,"dbg5       png_raw_nbeams:      %d\n",ping->png_raw_nbeams);
-		fprintf(stderr,"dbg5       png_raw_ssv:         %d\n",ping->png_raw_ssv);
-		fprintf(stderr,"dbg5       cnt  point   tilt   rng  amp num\n");
-		fprintf(stderr,"dbg5       ------------------------------------------------------------\n");
-		for (i=0;i<ping->png_raw_nbeams;i++)
-			fprintf(stderr,"dbg5       %3d %5d %5d %5d %3d %3d\n",
-				i, ping->png_raw_rxpointangle[i], ping->png_raw_rxtiltangle[i],
-				ping->png_raw_rxrange[i], ping->png_raw_rxamp[i],
-				ping->png_raw_rxbeam_num[i]);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em300mba_rd_rawbeam2(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store,
-		short sonar, int *error)
-{
-	char	*function_name = "mbr_em300mba_rd_rawbeam2";
-	int	status = MB_SUCCESS;
-	struct mbsys_simrad2_ping_struct *ping;
-	char	line[EM2_RAWBEAM2_HEADER_SIZE];
-	short	short_val;
-	int	read_len;
-	int	spare;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		fprintf(stderr,"dbg2       sonar:      %d\n",sonar);
-		}
-
-	/* get  storage structure */
-	ping = (struct mbsys_simrad2_ping_struct *) store->ping;
-
-	/* read binary header values into char array */
-	read_len = fread(line,1,EM2_RAWBEAM2_HEADER_SIZE,mbfp);
-	if (read_len == EM2_RAWBEAM2_HEADER_SIZE)
-		status = MB_SUCCESS;
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	/* get binary header data */
-	if (status == MB_SUCCESS)
-		{
-		mb_get_binary_int(swap, &line[0], &ping->png_raw_date);
-		    store->date = ping->png_raw_date;
-		mb_get_binary_int(swap, &line[4], &ping->png_raw_msec);
-		    store->msec = ping->png_raw_msec;
-		mb_get_binary_short(swap, &line[8], &short_val);
-		    ping->png_raw_count = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[10], &short_val);
-		    ping->png_raw_serial = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[12], &short_val);
-		    ping->png_raw_heading = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[14], &short_val);
-		    ping->png_raw_ssv = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[16], &short_val);
-		    ping->png_raw_xducer_depth = (int) ((unsigned short) short_val);
-		ping->png_raw_nbeams_max = (mb_u_char) line[18];
-		ping->png_raw_nbeams = (mb_u_char) line[19];
-		ping->png_raw_depth_res = (mb_u_char) line[20];
-		ping->png_raw_distance_res = (mb_u_char) line[21];
-		mb_get_binary_short(swap, &line[22], &short_val);
-		    ping->png_raw_sample_rate = (int) ((unsigned short) short_val);
-		mb_get_binary_int(swap, &line[24], &ping->png_raw_status);
-		mb_get_binary_short(swap, &line[28], &short_val);
-		    ping->png_raw_rangenormal = (int) ((unsigned short) short_val);
-		ping->png_raw_normalbackscatter = (mb_s_char) line[30];
-		ping->png_raw_obliquebackscatter = (mb_s_char) line[31];
-		ping->png_raw_fixedgain = (mb_u_char) line[32];
-		ping->png_raw_txpower = (mb_s_char) line[33];
-		ping->png_raw_mode = (mb_u_char) line[34];
-		ping->png_raw_coverage = (mb_u_char) line[35];
-		mb_get_binary_short(swap, &line[36], &short_val);
-		    ping->png_raw_yawstabheading = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[38], &short_val);
-		    ping->png_raw_ntx = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[40], &short_val);
-		    spare = (int) ((unsigned short) short_val);
-		}
-
-	/* check for some indicators of a broken record
-	    - these do happen!!!! */
-	if (status == MB_SUCCESS)
-		{
-		if (ping->png_raw_nbeams > ping->png_raw_nbeams_max
-			|| ping->png_raw_nbeams < 0
-			|| ping->png_raw_nbeams_max < 0
-			|| ping->png_raw_nbeams > MBSYS_SIMRAD2_MAXBEAMS
-			|| ping->png_raw_nbeams_max > MBSYS_SIMRAD2_MAXBEAMS
-			|| ping->png_raw_ntx > MBSYS_SIMRAD2_MAXTX)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_UNINTELLIGIBLE;
-			}
-		}
-
-	/* read binary tx values */
-	if (status == MB_SUCCESS)
-	    {
-	    for (i=0;i<ping->png_raw_ntx && status == MB_SUCCESS;i++)
-		{
-		read_len = fread(line,1,EM2_RAWBEAM2_TX_SIZE,mbfp);
-		if (read_len == EM2_RAWBEAM2_TX_SIZE
-			&& i < MBSYS_SIMRAD2_MAXTX)
-			{
-			status = MB_SUCCESS;
-			mb_get_binary_short(swap, &line[0], &short_val);
-			    ping->png_raw_txlastbeam[i] = (int) ((unsigned short) short_val);
-			mb_get_binary_short(swap, &line[2], &short_val);
-			    ping->png_raw_txtiltangle[i] = (int) short_val;
-			mb_get_binary_short(swap, &line[4], &short_val);
-			    ping->png_raw_txheading[i] = (int) ((unsigned short) short_val);
-			mb_get_binary_short(swap, &line[6], &short_val);
-			    ping->png_raw_txroll[i] = (int) short_val;
-			mb_get_binary_short(swap, &line[8], &short_val);
-			    ping->png_raw_txpitch[i] = (int) short_val;
-			mb_get_binary_short(swap, &line[10], &short_val);
-			    ping->png_raw_txheave[i] = (int) short_val;
-			}
-		else
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_EOF;
-			}
-		}
-	    }
-
-	/* read binary beam values */
-	if (status == MB_SUCCESS)
-	    {
-	    for (i=0;i<ping->png_raw_nbeams && status == MB_SUCCESS;i++)
-		{
-		read_len = fread(line,1,EM2_RAWBEAM2_BEAM_SIZE,mbfp);
-		if (read_len == EM2_RAWBEAM2_BEAM_SIZE
-			&& i < MBSYS_SIMRAD2_MAXBEAMS)
-			{
-			status = MB_SUCCESS;
-			mb_get_binary_short(swap, &line[0], &short_val);
-			    ping->png_raw_rxrange[i] = (int) ((unsigned short) short_val);
-			ping->png_raw_rxquality[i] = (mb_u_char) line[2];
-			ping->png_raw_rxwindow[i] = (mb_u_char) line[3];
-			ping->png_raw_rxamp[i] = (mb_s_char) line[4];
-			ping->png_raw_rxbeam_num[i] = (mb_u_char) line[5];
-			mb_get_binary_short(swap, &line[6], &short_val);
-			    ping->png_raw_rxpointangle[i] = (int) short_val;
-			mb_get_binary_short(swap, &line[8], &short_val);
-			    ping->png_raw_rxheading[i] = (int) ((unsigned short) short_val);
-			mb_get_binary_short(swap, &line[10], &short_val);
-			    ping->png_raw_rxroll[i] = (int) short_val;
-			mb_get_binary_short(swap, &line[12], &short_val);
-			    ping->png_raw_rxpitch[i] = (int) short_val;
-			mb_get_binary_short(swap, &line[14], &short_val);
-			    ping->png_raw_rxheave[i] = (int) short_val;
-			}
-		else
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_EOF;
-			}
-		}
-	    }
-
-	/* now get last bytes of record */
-	if (status == MB_SUCCESS)
-		{
-		read_len = fread(&line[0],1,4,mbfp);
-		if (read_len == 4)
-			{
-			status = MB_SUCCESS;
-			}
-		else
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_EOF;
-			}
-#ifdef MBR_EM300MBA_DEBUG
-	fprintf(stderr, "End Bytes: %2.2hX %d | %2.2hX %d | %2.2hX %d\n",
-		line[1], line[1],
-		line[2], line[2],
-		line[3], line[3]);
-#endif
-		}
-
-	/* check for some other indicators of a broken record
-	    - these do happen!!!! */
-	if (status == MB_SUCCESS)
-		{
-		if (ping->png_raw_nbeams > 0
-		    && ping->png_raw_rxbeam_num[0] > ping->png_raw_nbeams_max)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_UNINTELLIGIBLE;
-			}
-		for (i=1;i<ping->png_raw_nbeams;i++)
-			{
-			if (ping->png_raw_rxbeam_num[i] < ping->png_raw_rxbeam_num[i-1]
-				|| ping->png_raw_rxbeam_num[i] > ping->png_raw_nbeams_max)
-				{
-				status = MB_FAILURE;
-				*error = MB_ERROR_UNINTELLIGIBLE;
-				}
-			}
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       png_raw_date:                %d\n",ping->png_raw_date);
-		fprintf(stderr,"dbg5       png_raw_msec:                %d\n",ping->png_raw_msec);
-		fprintf(stderr,"dbg5       png_raw_count:               %d\n",ping->png_raw_count);
-		fprintf(stderr,"dbg5       png_raw_serial:              %d\n",ping->png_raw_serial);
-		fprintf(stderr,"dbg5       png_raw_heading:             %d\n",ping->png_raw_heading);
-		fprintf(stderr,"dbg5       png_raw_ssv:                 %d\n",ping->png_raw_ssv);
-		fprintf(stderr,"dbg5       png_raw_xducer_depth:        %d\n",ping->png_raw_xducer_depth);
-		fprintf(stderr,"dbg5       png_raw_nbeams_max:          %d\n",ping->png_raw_nbeams_max);
-		fprintf(stderr,"dbg5       png_raw_nbeams:              %d\n",ping->png_raw_nbeams);
-		fprintf(stderr,"dbg5       png_raw_depth_res:           %d\n",ping->png_raw_depth_res);
-		fprintf(stderr,"dbg5       png_raw_distance_res:        %d\n",ping->png_raw_distance_res);
-		fprintf(stderr,"dbg5       png_raw_sample_rate:         %d\n",ping->png_raw_sample_rate);
-		fprintf(stderr,"dbg5       png_raw_status:              %d\n",ping->png_raw_status);
-		fprintf(stderr,"dbg5       png_raw_rangenormal:         %d\n",ping->png_raw_rangenormal);
-		fprintf(stderr,"dbg5       png_raw_normalbackscatter:   %d\n",ping->png_raw_normalbackscatter);
-		fprintf(stderr,"dbg5       png_raw_obliquebackscatter:  %d\n",ping->png_raw_obliquebackscatter);
-		fprintf(stderr,"dbg5       png_raw_fixedgain:           %d\n",ping->png_raw_fixedgain);
-		fprintf(stderr,"dbg5       png_raw_txpower:             %d\n",ping->png_raw_txpower);
-		fprintf(stderr,"dbg5       png_raw_mode:                %d\n",ping->png_raw_mode);
-		fprintf(stderr,"dbg5       png_raw_coverage:            %d\n",ping->png_raw_coverage);
-		fprintf(stderr,"dbg5       png_raw_yawstabheading:      %d\n",ping->png_raw_yawstabheading);
-		fprintf(stderr,"dbg5       png_raw_ntx:                 %d\n",ping->png_raw_ntx);
-		fprintf(stderr,"dbg5       ------------------------------------------------------------\n");
-		fprintf(stderr,"dbg5       transmit pulse values:\n");
-		fprintf(stderr,"dbg5       cnt lastbeam tiltangle heading roll pitch heave\n");
-		fprintf(stderr,"dbg5       ------------------------------------------------------------\n");
-		for (i=0;i<ping->png_raw_ntx;i++)
-			fprintf(stderr,"dbg5       %3d %3d %4d %5d %4d %4d %4d\n",
-				i, ping->png_raw_txlastbeam[i], ping->png_raw_txtiltangle[i],
-				ping->png_raw_txheading[i], ping->png_raw_txroll[i],
-				ping->png_raw_txpitch[i], ping->png_raw_txheave[i]);
-		fprintf(stderr,"dbg5       ------------------------------------------------------------\n");
-		fprintf(stderr,"dbg5       beam values:\n");
-		fprintf(stderr,"dbg5       cnt range quality window amp beam angle heading roll pitch heave\n");
-		fprintf(stderr,"dbg5       ------------------------------------------------------------\n");
-		for (i=0;i<ping->png_raw_nbeams;i++)
-			fprintf(stderr,"dbg5       %3d %5d %3d %3d %4d %3d %5d %5d %4d %4d %4d\n",
-				i, ping->png_raw_rxrange[i], ping->png_raw_rxquality[i],
-				ping->png_raw_rxwindow[i], ping->png_raw_rxamp[i],
-				ping->png_raw_rxbeam_num[i], ping->png_raw_rxpointangle[i],
-				ping->png_raw_rxheading[i], ping->png_raw_rxroll[i],
-				ping->png_raw_rxpitch[i], ping->png_raw_rxheave[i]);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em300mba_rd_rawbeam3(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store,
-		short sonar, int *error)
-{
-	char	*function_name = "mbr_em300mba_rd_rawbeam3";
-	int	status = MB_SUCCESS;
-	struct mbsys_simrad2_ping_struct *ping;
-	char	line[EM2_RAWBEAM3_HEADER_SIZE];
-	short	short_val;
-	int	int_val;
-	int	png_raw3_count;
-	int	png_raw3_serial;
-	int	head;
-	int	read_len;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		fprintf(stderr,"dbg2       sonar:      %d\n",sonar);
-		}
-
-	/* get  storage structure */
-	ping = (struct mbsys_simrad2_ping_struct *) store->ping;
-	head = 0;
-
-	/* read binary header values into char array */
-	read_len = fread(line,1,EM2_RAWBEAM3_HEADER_SIZE,mbfp);
-	if (read_len == EM2_RAWBEAM3_HEADER_SIZE)
-		status = MB_SUCCESS;
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	/* in case of EM3002 check if the data are from the second head and if so switch ping structure */
-	if (status == MB_SUCCESS && sonar == MBSYS_SIMRAD2_EM3002
-			&& store->numberheads == 2)
-		{
-		mb_get_binary_short(swap, &line[8], &short_val);
-		    png_raw3_count = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[10], &short_val);
-		    png_raw3_serial = (int) ((unsigned short) short_val);
-
-		if (png_raw3_count == ping->png_raw3_count && png_raw3_serial != ping->png_raw3_serial)
-			{
-			ping = (struct mbsys_simrad2_ping_struct *) store->ping2;
-			head = 1;
-			}
-		}
-
-	/* get binary header data */
-	if (status == MB_SUCCESS)
-		{
-		mb_get_binary_int(swap, &line[0], &ping->png_raw3_date);
-		    store->date = ping->png_raw3_date;
-		mb_get_binary_int(swap, &line[4], &ping->png_raw3_msec);
-		    store->msec = ping->png_raw3_msec;
-		mb_get_binary_short(swap, &line[8], &short_val);
-		    ping->png_raw3_count = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[10], &short_val);
-		    ping->png_raw3_serial = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[12], &short_val);
-		    ping->png_raw3_ntx = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[14], &short_val);
-		    ping->png_raw3_nbeams = (int) ((unsigned short) short_val);
-		mb_get_binary_int(swap, &line[16], &int_val);
-		    ping->png_raw3_sample_rate = (int) (int_val);
-		mb_get_binary_int(swap, &line[20], &int_val);
-		    ping->png_raw3_xducer_depth = (int) (int_val);
-		mb_get_binary_short(swap, &line[24], &short_val);
-		    ping->png_raw3_ssv = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[26], &short_val);
-		    ping->png_raw3_nbeams_max = (int) ((unsigned short) short_val);
-		}
-
-	/* check for some indicators of a broken record
-	    - these do happen!!!! */
-	if (status == MB_SUCCESS)
-		{
-		if (ping->png_raw3_nbeams > ping->png_raw3_nbeams_max
-			|| ping->png_raw3_nbeams < 0
-			|| ping->png_raw3_nbeams_max < 0
-			|| ping->png_raw3_nbeams > MBSYS_SIMRAD2_MAXBEAMS
-			|| ping->png_raw3_nbeams_max > MBSYS_SIMRAD2_MAXBEAMS
-			|| ping->png_raw3_ntx > MBSYS_SIMRAD2_MAXTX)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_UNINTELLIGIBLE;
-			}
-		}
-
-	/* read binary tx values */
-	if (status == MB_SUCCESS)
-	    {
-	    for (i=0;i<ping->png_raw3_ntx && status == MB_SUCCESS;i++)
-		{
-		read_len = fread(line,1,EM2_RAWBEAM3_TX_SIZE,mbfp);
-		if (read_len == EM2_RAWBEAM3_TX_SIZE
-			&& i < MBSYS_SIMRAD2_MAXTX)
-			{
-			status = MB_SUCCESS;
-			mb_get_binary_short(swap, &line[0], &short_val);
-			    ping->png_raw3_txtiltangle[i] = (int) short_val;
-			mb_get_binary_short(swap, &line[2], &short_val);
-			    ping->png_raw3_txfocus[i] = (int) short_val;
-			mb_get_binary_int(swap, &line[4], &int_val);
-			    ping->png_raw3_txsignallength[i] = int_val;
-			mb_get_binary_int(swap, &line[8], &int_val);
-			    ping->png_raw3_txoffset[i] = int_val;
-			mb_get_binary_int(swap, &line[12], &int_val);
-			    ping->png_raw3_txcenter[i] = int_val;
-			mb_get_binary_short(swap, &line[16], &short_val);
-			    ping->png_raw3_txbandwidth[i] = (int) short_val;
-			ping->png_raw3_txwaveform[i] = (int) line[18];
-			ping->png_raw3_txsector[i] = (int) line[19];
-			}
-		else
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_EOF;
-			}
-		}
-	    }
-
-	/* read binary beam values */
-	if (status == MB_SUCCESS)
-	    {
-	    for (i=0;i<ping->png_raw3_nbeams && status == MB_SUCCESS;i++)
-		{
-		read_len = fread(line,1,EM2_RAWBEAM3_BEAM_SIZE,mbfp);
-		if (read_len == EM2_RAWBEAM3_BEAM_SIZE
-			&& i < MBSYS_SIMRAD2_MAXBEAMS)
-			{
-			status = MB_SUCCESS;
-			mb_get_binary_short(swap, &line[0], &short_val);
-			    ping->png_raw3_rxpointangle[i] = (int) short_val;
-			mb_get_binary_short(swap, &line[2], &short_val);
-			    ping->png_raw3_rxrange[i] = (int) ((unsigned short) short_val);
-			ping->png_raw3_rxsector[i] = (mb_u_char) line[4];
-			ping->png_raw3_rxamp[i] = (mb_s_char) line[5];
-			ping->png_raw3_rxquality[i] = (mb_u_char) line[6];
-			ping->png_raw3_rxwindow[i] = (mb_u_char) line[7];
-			mb_get_binary_short(swap, &line[8], &short_val);
-			    ping->png_raw3_rxbeam_num[i] = (int) ((short) short_val);
-			mb_get_binary_short(swap, &line[8], &short_val);
-			    ping->png_raw3_rxspare[i] = (int) ((unsigned short) short_val);
-			}
-		else
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_EOF;
-			}
-		}
-	    }
-
-	/* now get last bytes of record */
-	if (status == MB_SUCCESS)
-		{
-		read_len = fread(&line[0],1,4,mbfp);
-		if (read_len == 4)
-			{
-			status = MB_SUCCESS;
-			}
-		else
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_EOF;
-			}
-#ifdef MBR_EM300MBA_DEBUG
-	fprintf(stderr, "End Bytes: %2.2hX %d | %2.2hX %d | %2.2hX %d\n",
-		line[1], line[1],
-		line[2], line[2],
-		line[3], line[3]);
-#endif
-		}
-
-	/* check for some other indicators of a broken record
-	    - these do happen!!!! */
-	if (status == MB_SUCCESS)
-		{
-		if (ping->png_raw3_nbeams > 0
-		    && ping->png_raw3_rxbeam_num[0] > ping->png_raw3_nbeams_max)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_UNINTELLIGIBLE;
-			}
-		for (i=1;i<ping->png_raw3_nbeams;i++)
-			{
-			if (ping->png_raw3_rxbeam_num[i] < ping->png_raw3_rxbeam_num[i-1]
-				|| ping->png_raw3_rxbeam_num[i] > ping->png_raw3_nbeams_max)
-				{
-				status = MB_FAILURE;
-				*error = MB_ERROR_UNINTELLIGIBLE;
-				}
-			}
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       png_raw3_date:                %d\n",ping->png_raw3_date);
-		fprintf(stderr,"dbg5       png_raw3_msec:                %d\n",ping->png_raw3_msec);
-		fprintf(stderr,"dbg5       png_raw3_count:               %d\n",ping->png_raw3_count);
-		fprintf(stderr,"dbg5       png_raw3_serial:              %d\n",ping->png_raw3_serial);
-		fprintf(stderr,"dbg5       png_raw3_ntx:                 %d\n",ping->png_raw3_ntx);
-		fprintf(stderr,"dbg5       png_raw3_nbeams:              %d\n",ping->png_raw3_nbeams);
-		fprintf(stderr,"dbg5       png_raw3_sample_rate:         %d\n",ping->png_raw3_sample_rate);
-		fprintf(stderr,"dbg5       png_raw3_xducer_depth:        %d\n",ping->png_raw3_xducer_depth);
-		fprintf(stderr,"dbg5       png_raw3_ssv:                 %d\n",ping->png_raw3_ssv);
-		fprintf(stderr,"dbg5       png_raw3_nbeams_max:          %d\n",ping->png_raw3_nbeams_max);
-		fprintf(stderr,"dbg5       ------------------------------------------------------------\n");
-		fprintf(stderr,"dbg5       transmit pulse values:\n");
-		fprintf(stderr,"dbg5       tiltangle focus length offset center bandwidth waveform sector\n");
-		fprintf(stderr,"dbg5       ------------------------------------------------------------\n");
-		for (i=0;i<ping->png_raw3_ntx;i++)
-			fprintf(stderr,"dbg5       %3d %5d %5d %6d %4d %4d %4d %4d %4d\n",
-				i, ping->png_raw3_txtiltangle[i],
-				ping->png_raw3_txfocus[i], ping->png_raw3_txsignallength[i],
-				ping->png_raw3_txoffset[i], ping->png_raw3_txcenter[i],
-				ping->png_raw3_txbandwidth[i], ping->png_raw3_txwaveform[i],
-				ping->png_raw3_txsector[i]);
-		fprintf(stderr,"dbg5       ------------------------------------------------------------\n");
-		fprintf(stderr,"dbg5       beam values:\n");
-		fprintf(stderr,"dbg5       angle range sector amp quality window beam\n");
-		fprintf(stderr,"dbg5       ------------------------------------------------------------\n");
-		for (i=0;i<ping->png_raw3_nbeams;i++)
-			fprintf(stderr,"dbg5       %3d %5d %3d %3d %4d %3d %5d %5d\n",
-				i, ping->png_raw3_rxpointangle[i], ping->png_raw3_rxrange[i],
-				ping->png_raw3_rxsector[i], ping->png_raw3_rxamp[i],
-				ping->png_raw3_rxquality[i], ping->png_raw3_rxwindow[i],
-				ping->png_raw3_rxbeam_num[i]);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em300mba_rd_ss(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store,
-		short sonar, int length, int *match, int *error)
-{
-	char	*function_name = "mbr_em300mba_rd_ss";
-	int	status = MB_SUCCESS;
-	struct mbsys_simrad2_ping_struct *ping;
-	char	line[2 * MBSYS_SIMRAD2_BUFFER_SIZE];
-	short	short_val;
-	int	png_ss_count;
-	int	png_ss_serial;
-	int	head;
-	int	read_len;
-	int	done;
-	int	junk_bytes;
-	int	read_size;
-	int	offset;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		fprintf(stderr,"dbg2       sonar:      %d\n",sonar);
-		fprintf(stderr,"dbg2       length:     %d\n",length);
-		}
-
-	/* get  storage structure */
-	ping = (struct mbsys_simrad2_ping_struct *) store->ping;
-	head = 0;
-
-	/* set kind and type values */
-	store->kind = MB_DATA_DATA;
-	store->type = EM2_SS_MBA;
-	store->sonar = sonar;
-
-	/* read binary header values into char array */
-	read_len = fread(line,1,EM2_SS_MBA_HEADER_SIZE,mbfp);
-	if (read_len == EM2_SS_MBA_HEADER_SIZE)
-		status = MB_SUCCESS;
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	/* in case of EM3002 check if the data are from the second head and if so switch ping structure */
-	if (status == MB_SUCCESS && sonar == MBSYS_SIMRAD2_EM3002
-			&& store->numberheads == 2)
-		{
-		mb_get_binary_short(swap, &line[8], &short_val);
-		    png_ss_count = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[10], &short_val);
-		    png_ss_serial = (int) ((unsigned short) short_val);
-
-		if ((png_ss_count == ping->png_ss_count && png_ss_serial != ping->png_ss_serial)
-			|| (png_ss_count == store->ping2->png_count && png_ss_serial == store->ping2->png_serial))
-			{
-			ping = (struct mbsys_simrad2_ping_struct *) store->ping2;
-			head = 1;
-			}
-		}
-
-	/* get binary header data */
-	if (status == MB_SUCCESS)
-		{
-		mb_get_binary_int(swap, &line[0], &ping->png_ss_date);
-		    store->date = ping->png_ss_date;
-		mb_get_binary_int(swap, &line[4], & ping->png_ss_msec);
-		    store->msec = ping->png_ss_msec;
-		mb_get_binary_short(swap, &line[8], &short_val);
-		    ping->png_ss_count = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[10], &short_val);
-		    ping->png_ss_serial = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[12], &short_val);
-		    ping->png_max_range = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[14], &short_val);
-		    ping->png_r_zero = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[16], &short_val);
-		    ping->png_r_zero_corr = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[18], &short_val);
-		    ping->png_tvg_start = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[20], &short_val);
-		    ping->png_tvg_stop = (int) ((unsigned short) short_val);
-		ping->png_bsn = (mb_s_char) line[22];
-		ping->png_bso = (mb_s_char) line[23];
-		mb_get_binary_short(swap, &line[24], &short_val);
-		    ping->png_tx = (int) ((unsigned short) short_val);
-		ping->png_tvg_crossover = (mb_u_char) line[26];
-		ping->png_nbeams_ss = (mb_u_char) line[27];
-		mb_get_binary_short(swap, &line[28], &short_val);
-		    ping->png_pixel_size = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[30], &short_val);
-		    ping->png_pixels_ss = (int) ((unsigned short) short_val);
-		}
-
-	/* check for some indicators of a broken record
-	    - these do happen!!!! */
-	if (status == MB_SUCCESS)
-		{
-		if (ping->png_nbeams_ss < 0
-			|| ping->png_nbeams_ss > MBSYS_SIMRAD2_MAXBEAMS)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_UNINTELLIGIBLE;
-			}
-		}
-
-	/* read binary beam values */
-	if (status == MB_SUCCESS)
-	    {
-	    ping->png_npixels = 0;
-	    for (i=0;i<ping->png_nbeams_ss && status == MB_SUCCESS;i++)
-		{
-		read_len = fread(line,1,EM2_SS_MBA_BEAM_SIZE,mbfp);
-		if (read_len == EM2_SS_MBA_BEAM_SIZE
-			&& i < MBSYS_SIMRAD2_MAXBEAMS)
-			{
-			status = MB_SUCCESS;
-			ping->png_beam_index[i] = (mb_u_char) line[0];
-			ping->png_sort_direction[i] = (mb_s_char) line[1];
-			mb_get_binary_short(swap, &line[2], &short_val);
-			    ping->png_beam_samples[i] = (int) ((unsigned short) short_val);
-			ping->png_start_sample[i] = ping->png_npixels;
-			mb_get_binary_short(swap, &line[4], &short_val);
-			    ping->png_center_sample[i] = (int) ((unsigned short) short_val);
-			}
-		else
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_EOF;
-			}
-		ping->png_npixels += ping->png_beam_samples[i];
-		if (ping->png_npixels > MBSYS_SIMRAD2_MAXRAWPIXELS)
-			{
-			ping->png_beam_samples[i]
-				-= (ping->png_npixels
-					- MBSYS_SIMRAD2_MAXRAWPIXELS);
-			if (ping->png_beam_samples[i] < 0)
-				ping->png_beam_samples[i] = 0;
-			}
-		}
-
-	    /* check for no pixel data - frequently occurs with EM1002 */
-	    if (length == EM2_SS_MBA_HEADER_SIZE + ping->png_nbeams_ss * EM2_SS_MBA_BEAM_SIZE + 8)
-		{
-		if (verbose > 0)
-		    fprintf(stderr, "WARNING: No Simrad multibeam sidescan pixels in data record!\n");
-		junk_bytes = 0;
-		ping->png_npixels = 0;
-		}
-
-	    /* check for too much pixel data */
-	    if (ping->png_npixels > MBSYS_SIMRAD2_MAXRAWPIXELS)
-		{
-		if (verbose > 0)
-		    fprintf(stderr, "WARNING: Simrad multibeam sidescan pixels %d exceed maximum %d!\n",
-			    ping->png_npixels, MBSYS_SIMRAD2_MAXRAWPIXELS);
-		junk_bytes = ping->png_npixels - MBSYS_SIMRAD2_MAXRAWPIXELS;
-		ping->png_npixels = MBSYS_SIMRAD2_MAXRAWPIXELS;
-		status = MB_FAILURE;
-		*error = MB_ERROR_UNINTELLIGIBLE;
-		}
-	    else
-		junk_bytes = 0;
-	    }
-
-	/* check for some other indicators of a broken record
-	    - these do happen!!!! */
-	if (status == MB_SUCCESS)
-		{
-		if (ping->png_nbeams_ss > 0
-		    && ping->png_beam_index[0] > MBSYS_SIMRAD2_MAXBEAMS)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_UNINTELLIGIBLE;
-			}
-		for (i=1;i<ping->png_nbeams_ss;i++)
-			{
-			if (ping->png_beam_index[i] < ping->png_beam_index[i-1]
-				|| ping->png_beam_index[0] > MBSYS_SIMRAD2_MAXBEAMS)
-				{
-				status = MB_FAILURE;
-				*error = MB_ERROR_UNINTELLIGIBLE;
-				}
-			}
-		}
-
-	/* read binary sidescan values */
-	if (status == MB_SUCCESS)
-		{
-		read_size = ping->png_npixels + 1 - (ping->png_npixels % 2);
-		read_len = fread(ping->png_ssraw,1,read_size,mbfp);
-		if (read_len == read_size)
-			{
-			status = MB_SUCCESS;
-			}
-		else
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_EOF;
-			}
-		}
-
-	/* read any leftover binary sidescan values */
-	if (status == MB_SUCCESS)
-		{
-		for (i=0;i<junk_bytes;i++)
-		    read_len = fread(&line[0],1,1,mbfp);
-		}
-
-	/* read processed sidescan data */
-	if (status == MB_SUCCESS)
-		{
-		for (i=0;i<MBSYS_SIMRAD2_MAXPIXELS;i++)
-			{
-			ping->png_ss[i] = 0;
-			}
-		read_len = fread(line, 1, ping->png_pixels_ss * sizeof(short),mbfp);
-		if (read_len == ping->png_pixels_ss * sizeof(short))
-			status = MB_SUCCESS;
-		else
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_EOF;
-			}
-		}
-
-	/* get processed sidescan data */
-	if (status == MB_SUCCESS)
-		{
-		offset = (MBSYS_SIMRAD2_MAXPIXELS - ping->png_pixels_ss) / 2;
-		for (i=0;i<ping->png_pixels_ss;i++)
-		    {
-		    mb_get_binary_short(swap, &line[2*i], &short_val);
-			ping->png_ss[offset+i] = (int) ((short) short_val);
-		    }
-		}
-
-	/* read processed sidescan alongtrack data */
-	if (status == MB_SUCCESS)
-		{
-		for (i=0;i<MBSYS_SIMRAD2_MAXPIXELS;i++)
-			{
-			ping->png_ssalongtrack[i] = 0;
-			}
-		read_len = fread(line,1,
-				    ping->png_pixels_ss * sizeof(short),mbfp);
-		if (read_len == ping->png_pixels_ss * sizeof(short))
-			status = MB_SUCCESS;
-		else
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_EOF;
-			}
-		}
-
-	/* get processed sidescan alongtrack data */
-	if (status == MB_SUCCESS)
-		{
-		offset = (MBSYS_SIMRAD2_MAXPIXELS - ping->png_pixels_ss) / 2;
-		for (i=0;i<ping->png_pixels_ss;i++)
-		    {
-		    mb_get_binary_short(swap, &line[2*i], &short_val);
-			ping->png_ssalongtrack[offset+i] = (int) ((short) short_val);
-		    }
-		}
-
-	/* now loop over reading individual characters to
-	    get last bytes of record */
-	if (status == MB_SUCCESS)
-	    {
-	    done = MB_NO;
-	    while (done == MB_NO)
-		{
-		read_len = fread(&line[0],1,1,mbfp);
-		if (read_len == 1 && line[0] == EM2_END)
-			{
-			done = MB_YES;
-			status = MB_SUCCESS;
-			/* get last two check sum bytes */
-			read_len = fread(&line[1],2,1,mbfp);
-#ifdef MBR_EM300MBA_DEBUG
-	fprintf(stderr, "End Bytes: %2.2hX %d | %2.2hX %d | %2.2hX %d\n",
-		line[0], line[0],
-		line[1], line[1],
-		line[2], line[2]);
-#endif
-			}
-		else if (read_len == 1)
-			{
-			status = MB_SUCCESS;
-			}
-		else
-			{
-			done = MB_YES;
-			/* return success here because all of the
-			    important information in this record has
-			    already been read - next attempt to read
-			    file will return error */
-			status = MB_SUCCESS;
-			}
-		}
-#ifdef MBR_EM300MBA_DEBUG
-	fprintf(stderr, "\n");
-#endif
-	    }
-
-	/* check if bath and sidescan time tags agree
-	   - we cannot pair bath
-	   and sidescan records from different pings */
-	if (status == MB_SUCCESS)
-		{
-		if (ping->png_date == ping->png_ss_date
-		    && ping->png_msec == ping->png_ss_msec)
-		    *match = MB_YES;
-		else
-		    *match = MB_NO;
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       png_date:        %d\n",ping->png_date);
-		fprintf(stderr,"dbg5       png_msec:        %d\n",ping->png_msec);
-		fprintf(stderr,"dbg5       png_ss_date:     %d\n",ping->png_ss_date);
-		fprintf(stderr,"dbg5       png_ss_msec:     %d\n",ping->png_ss_msec);
-		fprintf(stderr,"dbg5       png_ss_count:    %d\n",ping->png_ss_count);
-		fprintf(stderr,"dbg5       png_ss_serial:   %d\n",ping->png_ss_serial);
-		fprintf(stderr,"dbg5       png_heading:     %d\n",ping->png_heading);
-		fprintf(stderr,"dbg5       png_ssv:         %d\n",ping->png_ssv);
-		fprintf(stderr,"dbg5       png_xducer_depth:      %d\n",ping->png_xducer_depth);
-		fprintf(stderr,"dbg5       png_offset_multiplier: %d\n",ping->png_offset_multiplier);
-		fprintf(stderr,"dbg5       png_nbeams_max:        %d\n",ping->png_nbeams_max);
-		fprintf(stderr,"dbg5       png_nbeams:            %d\n",ping->png_nbeams);
-		fprintf(stderr,"dbg5       png_depth_res:         %d\n",ping->png_depth_res);
-		fprintf(stderr,"dbg5       png_distance_res:      %d\n",ping->png_distance_res);
-		fprintf(stderr,"dbg5       png_sample_rate:       %d\n",ping->png_sample_rate);
-		fprintf(stderr,"dbg5       cnt  depth xtrack ltrack dprsn   azi   rng  qual wnd  amp num flag\n");
-		fprintf(stderr,"dbg5       ------------------------------------------------------------\n");
-		for (i=0;i<ping->png_nbeams;i++)
-			fprintf(stderr,"dbg5       %3d %6d %6d %6d %5d %5d %5d %4d %3d %4d %3d %4d\n",
-				i, ping->png_depth[i], ping->png_acrosstrack[i],
-				ping->png_alongtrack[i], ping->png_depression[i],
-				ping->png_azimuth[i], ping->png_range[i],
-				ping->png_quality[i], ping->png_window[i],
-				ping->png_amp[i], ping->png_beam_num[i],
-				ping->png_beamflag[i]);
-		fprintf(stderr,"dbg5       png_max_range:   %d\n",ping->png_max_range);
-		fprintf(stderr,"dbg5       png_r_zero:      %d\n",ping->png_r_zero);
-		fprintf(stderr,"dbg5       png_r_zero_corr: %d\n",ping->png_r_zero_corr);
-		fprintf(stderr,"dbg5       png_tvg_start:   %d\n",ping->png_tvg_start);
-		fprintf(stderr,"dbg5       png_tvg_stop:    %d\n",ping->png_tvg_stop);
-		fprintf(stderr,"dbg5       png_bsn:         %d\n",ping->png_bsn);
-		fprintf(stderr,"dbg5       png_bso:         %d\n",ping->png_bso);
-		fprintf(stderr,"dbg5       png_tx:          %d\n",ping->png_tx);
-		fprintf(stderr,"dbg5       png_tvg_crossover: %d\n",ping->png_tvg_crossover);
-		fprintf(stderr,"dbg5       png_nbeams_ss:     %d\n",ping->png_nbeams_ss);
-		fprintf(stderr,"dbg5       png_npixels:       %d\n",ping->png_npixels);
-		fprintf(stderr,"dbg5       cnt  index sort samples start center\n");
-		fprintf(stderr,"dbg5       --------------------------------------------------\n");
-		for (i=0;i<ping->png_nbeams_ss;i++)
-			fprintf(stderr,"dbg5        %4d %3d %2d %4d %4d %4d\n",
-				i, ping->png_beam_index[i], ping->png_sort_direction[i],
-				ping->png_beam_samples[i], ping->png_start_sample[i],
-				ping->png_center_sample[i]);
-		fprintf(stderr,"dbg5       cnt  ss\n");
-		fprintf(stderr,"dbg5       --------------------------------------------------\n");
-		for (i=0;i<ping->png_npixels;i++)
-			fprintf(stderr,"dbg5        %d %d\n",
-				i, ping->png_ssraw[i]);
-		fprintf(stderr,"dbg5       png_pixel_size:    %d\n",ping->png_pixel_size);
-		fprintf(stderr,"dbg5       png_pixels_ss:     %d\n",ping->png_pixels_ss);
-		fprintf(stderr,"dbg5       pixel  ss  ltrack\n");
-		fprintf(stderr,"dbg5       --------------------------------------------------\n");
-		for (i=0;i<MBSYS_SIMRAD2_MAXPIXELS;i++)
-			fprintf(stderr,"dbg5        %4d %6d %6d\n",
-				i, ping->png_ss[i], ping->png_ssalongtrack[i]);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       match:      %d\n",*match);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em300mba_rd_wc(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store,
-		short sonar, int *error)
-{
-	char	*function_name = "mbr_em300mba_rd_wc";
-	int	status = MB_SUCCESS;
-	struct mbsys_simrad2_watercolumn_struct *wc;
-	char	line[EM2_WC_HEADER_SIZE];
-	short	short_val;
-	int	read_len;
-	int	done;
-	int	file_bytes;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		fprintf(stderr,"dbg2       sonar:      %d\n",sonar);
-		}
-
-	/* get  storage structure */
-	wc = (struct mbsys_simrad2_watercolumn_struct *) store->wc;
-
-	/* set kind and type values */
-	store->kind = MB_DATA_WATER_COLUMN;
-	store->type = EM2_WATERCOLUMN;
-	store->sonar = sonar;
-	file_bytes = ftell(mbfp);
-
-	/* read binary header values into char array */
-	read_len = fread(line,1,EM2_WC_HEADER_SIZE,mbfp);
-	if (read_len == EM2_WC_HEADER_SIZE)
-		status = MB_SUCCESS;
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	/* get binary header data */
-	if (status == MB_SUCCESS)
-		{
-		mb_get_binary_int(swap, &line[0], &wc->wtc_date);
-		    store->date = wc->wtc_date;
-		mb_get_binary_int(swap, &line[4], & wc->wtc_msec);
-		    store->msec = wc->wtc_msec;
-		mb_get_binary_short(swap, &line[8], &short_val);
-		    wc->wtc_count = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[10], &short_val);
-		    wc->wtc_serial = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[12], &short_val);
-		    wc->wtc_ndatagrams = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[14], &short_val);
-		    wc->wtc_datagram = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[16], &short_val);
-		    wc->wtc_ntx = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[18], &short_val);
-		    wc->wtc_nrx = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[20], &short_val);
-		    wc->wtc_nbeam = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[22], &short_val);
-		    wc->wtc_ssv = (int) ((unsigned short) short_val);
-		mb_get_binary_int(swap, &line[24], &(wc->wtc_sfreq));
-		mb_get_binary_short(swap, &line[28], &short_val);
-		    wc->wtc_heave = (int) ((short) short_val);
-		mb_get_binary_short(swap, &line[30], &short_val);
-		    wc->wtc_spare1 = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[32], &short_val);
-		    wc->wtc_spare2 = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[34], &short_val);
-		    wc->wtc_spare3 = (int) ((unsigned short) short_val);
-		}
-
-	/* check for some indicators of a broken record
-	    - these do happen!!!! */
-	if (status == MB_SUCCESS)
-		{
-		if (wc->wtc_nbeam < 0
-			|| wc->wtc_nbeam > MBSYS_SIMRAD2_MAXBEAMS
-			|| wc->wtc_ntx < 0
-			|| wc->wtc_ntx > MBSYS_SIMRAD2_MAXTX)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_UNINTELLIGIBLE;
-			}
-		}
-
-	/* read binary beam values */
-	if (status == MB_SUCCESS)
-	    {
-	    for (i=0;i<wc->wtc_ntx && status == MB_SUCCESS;i++)
-		{
-		read_len = fread(line,1,EM2_WC_TX_SIZE,mbfp);
-		if (read_len == EM2_WC_TX_SIZE
-			&& i < MBSYS_SIMRAD2_MAXTX)
-			{
-			mb_get_binary_short(swap, &line[0], &short_val);
-			    wc->wtc_txtiltangle[i] = (int) (short_val);
-			mb_get_binary_short(swap, &line[2], &short_val);
-			    wc->wtc_txcenter[i] = (int) (short_val);
-			wc->wtc_txsector[i] = (int) ((mb_u_char) line[4]);
-			}
-		else
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_EOF;
-			}
-		}
-	    for (i=0;i<wc->wtc_nbeam && status == MB_SUCCESS;i++)
-		{
-		read_len = fread(line,1,EM2_WC_BEAM_SIZE,mbfp);
-		if (read_len == EM2_WC_BEAM_SIZE
-			&& i < MBSYS_SIMRAD2_MAXBEAMS)
-			{
-			mb_get_binary_short(swap, &line[0], &short_val);
-			    wc->beam[i].wtc_rxpointangle = (int) (short_val);
-			mb_get_binary_short(swap, &line[2], &short_val);
-			    wc->beam[i].wtc_start_sample = (int) (short_val);
-			mb_get_binary_short(swap, &line[4], &short_val);
-			    wc->beam[i].wtc_beam_samples = (int) (unsigned short)(short_val);
-			mb_get_binary_short(swap, &line[6], &short_val);
-			    wc->beam[i].wtc_beam_spare = (int) (unsigned short)(short_val);
-			wc->beam[i].wtc_sector = (int) (mb_u_char) (line[8]);
-			wc->beam[i].wtc_beam = (int) (mb_u_char) (line[9]);
-			}
-		read_len = fread(wc->beam[i].wtc_amp,1,wc->beam[i].wtc_beam_samples,mbfp);
-		}
-	    }
-
-	/* now loop over reading individual characters to
-	    get last bytes of record */
-	if (status == MB_SUCCESS)
-	    {
-	    done = MB_NO;
-	    while (done == MB_NO)
-		{
-		read_len = fread(&line[0],1,1,mbfp);
-		if (read_len == 1 && line[0] == EM2_END)
-			{
-			done = MB_YES;
-			status = MB_SUCCESS;
-			/* get last two check sum bytes */
-			read_len = fread(&line[1],2,1,mbfp);
-#ifdef MBR_EM300MBA_DEBUG
-	fprintf(stderr, "End Bytes: %2.2hX %d | %2.2hX %d | %2.2hX %d\n",
-		line[0], line[0],
-		line[1], line[1],
-		line[2], line[2]);
-#endif
-			}
-		else if (read_len == 1)
-			{
-			status = MB_SUCCESS;
-			}
-		else
-			{
-			done = MB_YES;
-			/* return success here because all of the
-			    important information in this record has
-			    already been read - next attempt to read
-			    file will return error */
-			status = MB_SUCCESS;
-			}
-		}
-#ifdef MBR_EM300MBA_DEBUG
-	fprintf(stderr, "\n");
-#endif
-	    }
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       wtc_date:        %d\n",wc->wtc_date);
-		fprintf(stderr,"dbg5       wtc_msec:        %d\n",wc->wtc_msec);
-		fprintf(stderr,"dbg5       wtc_count:       %d\n",wc->wtc_count);
-		fprintf(stderr,"dbg5       wtc_serial:      %d\n",wc->wtc_serial);
-		fprintf(stderr,"dbg5       wtc_ndatagrams:  %d\n",wc->wtc_ndatagrams);
-		fprintf(stderr,"dbg5       wtc_datagram:    %d\n",wc->wtc_datagram);
-		fprintf(stderr,"dbg5       wtc_ntx:         %d\n",wc->wtc_ntx);
-		fprintf(stderr,"dbg5       wtc_nrx:         %d\n",wc->wtc_nrx);
-		fprintf(stderr,"dbg5       wtc_nbeam:       %d\n",wc->wtc_nbeam);
-		fprintf(stderr,"dbg5       wtc_ssv:         %d\n",wc->wtc_ssv);
-		fprintf(stderr,"dbg5       wtc_sfreq:       %d\n",wc->wtc_sfreq);
-		fprintf(stderr,"dbg5       wtc_heave:       %d\n",wc->wtc_heave);
-		fprintf(stderr,"dbg5       wtc_spare1:      %d\n",wc->wtc_spare1);
-		fprintf(stderr,"dbg5       wtc_spare2:      %d\n",wc->wtc_spare2);
-		fprintf(stderr,"dbg5       wtc_spare3:      %d\n",wc->wtc_spare3);
-		fprintf(stderr,"dbg5       ---------------------------\n");
-		fprintf(stderr,"dbg5       cnt  tilt center sector\n");
-		fprintf(stderr,"dbg5       ---------------------------\n");
-		for (i=0;i<wc->wtc_ntx;i++)
-			fprintf(stderr,"dbg5       %3d %6d %6d %6d\n",
-				i, wc->wtc_txtiltangle[i], wc->wtc_txcenter[i],
-				wc->wtc_txsector[i]);
-		for (i=0;i<wc->wtc_nbeam;i++)
-			{
-			fprintf(stderr,"dbg5       --------------------------------------------------\n");
-			fprintf(stderr,"dbg5       cnt  angle start samples unknown sector beam\n");
-			fprintf(stderr,"dbg5       --------------------------------------------------\n");
-			fprintf(stderr,"dbg5        %4d %3d %2d %4d %4d %4d %4d\n",
-				i, wc->beam[i].wtc_rxpointangle,
-				wc->beam[i].wtc_start_sample,
-				wc->beam[i].wtc_beam_samples,
-				wc->beam[i].wtc_beam_spare,
-				wc->beam[i].wtc_sector,
-				wc->beam[i].wtc_beam);
-/*			fprintf(stderr,"dbg5       --------------------------------------------------\n");
-			fprintf(stderr,"dbg5       beam[%d]: sample amplitude\n",i);
-			fprintf(stderr,"dbg5       --------------------------------------------------\n");
-			for (j=0;j<wc->beam[i].wtc_beam_samples;j++)
-				fprintf(stderr,"dbg5        %4d %4d\n",
-					j, wc->beam[i].wtc_amp[j]);*/
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em300mba_wr_data(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_em300mba_wr_data";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_simrad2_struct *store;
-	struct mbsys_simrad2_ping_struct *ping;
-	FILE	*mbfp;
-	int	swap;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_simrad2_struct *) store_ptr;
-	ping = (struct mbsys_simrad2_ping_struct *) store->ping;
-	mbfp = mb_io_ptr->mbfp;
-
-#ifdef MBR_EM300MBA_DEBUG
-	fprintf(stderr,"\nstart of mbr_em300mba_wr_data:\n");
-	fprintf(stderr,"kind:%d %d\n", store->kind, mb_io_ptr->new_kind);
-#endif
-
-	/* set swap flag */
-	swap = MB_NO;
-
-	if (store->kind == MB_DATA_COMMENT
-		|| store->kind == MB_DATA_START
-		|| store->kind == MB_DATA_STOP)
-		{
-#ifdef MBR_EM300MBA_DEBUG
-	fprintf(stderr,"call mbr_em300mba_wr_start kind:%d type %x\n",store->kind,EM2_START);
-#endif
-		status = mbr_em300mba_wr_start(verbose,mbfp,swap,store,error);
-		}
-	else if (store->kind == MB_DATA_RUN_PARAMETER)
-		{
-#ifdef MBR_EM300MBA_DEBUG
-	fprintf(stderr,"call mbr_em300mba_wr_run_parameter kind:%d type %x\n",store->kind,EM2_RUN_PARAMETER);
-#endif
-		status = mbr_em300mba_wr_run_parameter(verbose,mbfp,swap,store,error);
-		}
-	else if (store->kind == MB_DATA_CLOCK)
-		{
-#ifdef MBR_EM300MBA_DEBUG
-	fprintf(stderr,"call mbr_em300mba_wr_clock kind:%d type %x\n",store->kind,EM2_CLOCK);
-#endif
-		status = mbr_em300mba_wr_clock(verbose,mbfp,swap,store,error);
-		}
-	else if (store->kind == MB_DATA_TIDE)
-		{
-#ifdef MBR_EM300MBA_DEBUG
-	fprintf(stderr,"call mbr_em300mba_wr_tide kind:%d type %x\n",store->kind,EM2_TIDE);
-#endif
-		status = mbr_em300mba_wr_tide(verbose,mbfp,swap,store,error);
-		}
-	else if (store->kind == MB_DATA_HEIGHT)
-		{
-#ifdef MBR_EM300MBA_DEBUG
-	fprintf(stderr,"call mbr_em300mba_wr_height kind:%d type %x\n",store->kind,EM2_HEIGHT);
-#endif
-		status = mbr_em300mba_wr_height(verbose,mbfp,swap,store,error);
-		}
-	else if (store->kind == MB_DATA_HEADING)
-		{
-#ifdef MBR_EM300MBA_DEBUG
-	fprintf(stderr,"call mbr_em300mba_wr_heading kind:%d type %x\n",store->kind,EM2_HEADING);
-#endif
-		status = mbr_em300mba_wr_heading(verbose,mbfp,swap,store,error);
-		}
-	else if (store->kind == MB_DATA_SSV)
-		{
-#ifdef MBR_EM300MBA_DEBUG
-	fprintf(stderr,"call mbr_em300mba_wr_ssv kind:%d type %x\n",store->kind,EM2_SSV);
-#endif
-		status = mbr_em300mba_wr_ssv(verbose,mbfp,swap,store,error);
-		}
-	else if (store->kind == MB_DATA_TILT)
-		{
-#ifdef MBR_EM300MBA_DEBUG
-	fprintf(stderr,"call mbr_em300mba_wr_tilt kind:%d type %x\n",store->kind,store->type);
-#endif
-		status = mbr_em300mba_wr_tilt(verbose,mbfp,swap,store,error);
-		}
-	else if (store->kind == MB_DATA_ATTITUDE)
-		{
-#ifdef MBR_EM300MBA_DEBUG
-	fprintf(stderr,"call mbr_em300mba_wr_attitude kind:%d type %x\n",store->kind,EM2_ATTITUDE);
-#endif
-		status = mbr_em300mba_wr_attitude(verbose,mbfp,swap,store,error);
-		}
-	else if (store->kind == MB_DATA_NAV
-		|| store->kind == MB_DATA_NAV1
-		|| store->kind == MB_DATA_NAV2
-		|| store->kind == MB_DATA_NAV3)
-		{
-#ifdef MBR_EM300MBA_DEBUG
-	fprintf(stderr,"call mbr_em300mba_wr_pos kind:%d type %x\n",store->kind,EM2_POS);
-#endif
-		status = mbr_em300mba_wr_pos(verbose,mbfp,swap,store,error);
-		}
-	else if (store->kind == MB_DATA_VELOCITY_PROFILE)
-		{
-#ifdef MBR_EM300MBA_DEBUG
-	fprintf(stderr,"call mbr_em300mba_wr_svp kind:%d type %x\n",store->kind,EM2_SVP2);
-#endif
-		status = mbr_em300mba_wr_svp(verbose,mbfp,swap,store,error);
-		}
-	else if (store->kind == MB_DATA_DATA)
-		{
-		/* write out data from first head for all sonars */
-#ifdef MBR_EM300MBA_DEBUG
-	fprintf(stderr,"call mbr_em300mba_wr_bath kind:%d type %x\n",store->kind,EM2_BATH_MBA);
-#endif
-		status = mbr_em300mba_wr_bath(verbose,mbfp,swap,store,0,error);
-		if (ping->png_raw1_read == MB_YES)
-		    {
-#ifdef MBR_EM300MBA_DEBUG
-	fprintf(stderr,"call mbr_em300mba_wr_rawbeam kind:%d type %x\n",store->kind,store->type);
-#endif
-		    status = mbr_em300mba_wr_rawbeam(verbose,mbfp,swap,store,error);
-		    }
-		if (ping->png_raw2_read == MB_YES)
-		    {
-#ifdef MBR_EM300MBA_DEBUG
-	fprintf(stderr,"call mbr_em300mba_wr_rawbeam2 kind:%d type %x\n",store->kind,store->type);
-#endif
-		    status = mbr_em300mba_wr_rawbeam2(verbose,mbfp,swap,store,error);
-		    }
-		if (ping->png_raw3_read == MB_YES)
-		    {
-#ifdef MBR_EM300MBA_DEBUG
-	fprintf(stderr,"call mbr_em300mba_wr_rawbeam3 kind:%d type %x\n",store->kind,store->type);
-#endif
-		    status = mbr_em300mba_wr_rawbeam3(verbose,mbfp,swap,store,0,error);
-		    }
-#ifdef MBR_EM300MBA_DEBUG
-	if (ping->png_raw1_read == MB_NO && ping->png_raw2_read == MB_NO && ping->png_raw3_read == MB_NO)
-	fprintf(stderr,"NOT call mbr_em300mba_wr_rawbeam kind:%d type %x\n",store->kind,store->type);
-#endif
-		if (ping->png_ss_read == MB_YES)
-		    {
-#ifdef MBR_EM300MBA_DEBUG
-	fprintf(stderr,"call mbr_em300mba_wr_ss kind:%d type %x\n",store->kind,EM2_SS_MBA);
-#endif
-		    status = mbr_em300mba_wr_ss(verbose,mbfp,swap,store,0,error);
-		    }
-#ifdef MBR_EM300MBA_DEBUG
-	else fprintf(stderr,"NOT call mbr_em300mba_wr_ss kind:%d type %x\n",store->kind,EM2_SS_MBA);
-#endif
-
-		/* write out data from second head for EM3002 */
-		if (store->sonar == MBSYS_SIMRAD2_EM3002
-			&& store->numberheads == 2
-			&& store->ping2 != NULL
-			&& store->ping2->png_count ==store->ping->png_count)
-			{
-#ifdef MBR_EM300MBA_DEBUG
-	fprintf(stderr,"call mbr_em300mba_wr_bath kind:%d type %x\n",store->kind,store->type);
-#endif
-			status = mbr_em300mba_wr_bath(verbose,mbfp,swap,store,1,error);
-			if (ping->png_raw3_read == MB_YES)
-			    {
-#ifdef MBR_EM300MBA_DEBUG
-	fprintf(stderr,"call mbr_em300mba_wr_rawbeam3 kind:%d type %x\n",store->kind,store->type);
-#endif
-			    status = mbr_em300mba_wr_rawbeam3(verbose,mbfp,swap,store,1,error);
-			    }
-#ifdef MBR_EM300MBA_DEBUG
-	if (ping->png_raw3_read == MB_NO)
-	fprintf(stderr,"NOT call mbr_em300mba_wr_rawbeam kind:%d type %x\n",store->kind,store->type);
-#endif
-			if (ping->png_ss_read == MB_YES)
-			    {
-#ifdef MBR_EM300MBA_DEBUG
-	fprintf(stderr,"call mbr_em300mba_wr_ss kind:%d type %x\n",store->kind,store->type);
-#endif
-			    status = mbr_em300mba_wr_ss(verbose,mbfp,swap,store,1,error);
-			    }
-#ifdef MBR_EM300MBA_DEBUG
-	else fprintf(stderr,"NOT call mbr_em300mba_wr_ss kind:%d type %x\n",store->kind,store->type);
-#endif
-			}
-		}
-	else if (store->kind == MB_DATA_WATER_COLUMN)
-		{
-#ifdef MBR_EM300MBA_DEBUG
-	fprintf(stderr,"call mbr_em300mba_wr_wc kind:%d type %x\n",store->kind,store->type);
-#endif
-	        status = mbr_em300mba_wr_wc(verbose,mbfp,swap,store,error);
-		}
-	else
-		{
-#ifdef MBR_EM300MBA_DEBUG
-	fprintf(stderr,"call nothing bad kind: %d type %x\n", store->kind, store->type);
-#endif
-		status = MB_FAILURE;
-		*error = MB_ERROR_BAD_KIND;
-		}
-
-#ifdef MBR_EM300MBA_DEBUG
-	fprintf(stderr,"status:%d error:%d\n", status, *error);
-	fprintf(stderr,"end of mbr_em300mba_wr_data:\n");
-#endif
-
-	/* print output debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Data record kind in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       kind:       %d\n",store->kind);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em300mba_wr_start(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store, int *error)
-{
-	char	*function_name = "mbr_em300mba_wr_start";
-	int	status = MB_SUCCESS;
-	char	line[MBSYS_SIMRAD2_BUFFER_SIZE], *buff;
-	int	buff_len, write_len;
-	int	write_size;
-	unsigned short checksum;
-	char	*comma_ptr;
-	mb_u_char   *uchar_ptr;
-	int	j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       par_date:        %d\n",store->par_date);
-		fprintf(stderr,"dbg5       par_msec:        %d\n",store->par_msec);
-		fprintf(stderr,"dbg5       par_line_num:    %d\n",store->par_line_num);
-		fprintf(stderr,"dbg5       par_serial_1:    %d\n",store->par_serial_1);
-		fprintf(stderr,"dbg5       par_serial_2:    %d\n",store->par_serial_2);
-		fprintf(stderr,"dbg5       par_wlz:         %f\n",store->par_wlz);
-		fprintf(stderr,"dbg5       par_smh:         %d\n",store->par_smh);
-		fprintf(stderr,"dbg5       par_s1z:         %f\n",store->par_s1z);
-		fprintf(stderr,"dbg5       par_s1x:         %f\n",store->par_s1x);
-		fprintf(stderr,"dbg5       par_s1y:         %f\n",store->par_s1y);
-		fprintf(stderr,"dbg5       par_s1h:         %f\n",store->par_s1h);
-		fprintf(stderr,"dbg5       par_s1r:         %f\n",store->par_s1r);
-		fprintf(stderr,"dbg5       par_s1p:         %f\n",store->par_s1p);
-		fprintf(stderr,"dbg5       par_s1n:         %d\n",store->par_s1n);
-		fprintf(stderr,"dbg5       par_s2z:         %f\n",store->par_s2z);
-		fprintf(stderr,"dbg5       par_s2x:         %f\n",store->par_s2x);
-		fprintf(stderr,"dbg5       par_s2y:         %f\n",store->par_s2y);
-		fprintf(stderr,"dbg5       par_s2h:         %f\n",store->par_s2h);
-		fprintf(stderr,"dbg5       par_s2r:         %f\n",store->par_s2r);
-		fprintf(stderr,"dbg5       par_s2p:         %f\n",store->par_s2p);
-		fprintf(stderr,"dbg5       par_s2n:         %d\n",store->par_s2n);
-		fprintf(stderr,"dbg5       par_go1:         %f\n",store->par_go1);
-		fprintf(stderr,"dbg5       par_go2:         %f\n",store->par_go2);
-		fprintf(stderr,"dbg5       par_tsv:         %s\n",store->par_tsv);
-		fprintf(stderr,"dbg5       par_rsv:         %s\n",store->par_rsv);
-		fprintf(stderr,"dbg5       par_bsv:         %s\n",store->par_bsv);
-		fprintf(stderr,"dbg5       par_psv:         %s\n",store->par_psv);
-		fprintf(stderr,"dbg5       par_osv:         %s\n",store->par_osv);
-		fprintf(stderr,"dbg5       par_dsd:         %f\n",store->par_dsd);
-		fprintf(stderr,"dbg5       par_dso:         %f\n",store->par_dso);
-		fprintf(stderr,"dbg5       par_dsf:         %f\n",store->par_dsf);
-		fprintf(stderr,"dbg5       par_dsh:         %c%c\n",
-			store->par_dsh[0],store->par_dsh[1]);
-		fprintf(stderr,"dbg5       par_aps:         %d\n",store->par_aps);
-		fprintf(stderr,"dbg5       par_p1m:         %d\n",store->par_p1m);
-		fprintf(stderr,"dbg5       par_p1t:         %d\n",store->par_p1t);
-		fprintf(stderr,"dbg5       par_p1z:         %f\n",store->par_p1z);
-		fprintf(stderr,"dbg5       par_p1x:         %f\n",store->par_p1x);
-		fprintf(stderr,"dbg5       par_p1y:         %f\n",store->par_p1y);
-		fprintf(stderr,"dbg5       par_p1d:         %f\n",store->par_p1d);
-		fprintf(stderr,"dbg5       par_p1g:         %s\n",store->par_p1g);
-		fprintf(stderr,"dbg5       par_p2m:         %d\n",store->par_p2m);
-		fprintf(stderr,"dbg5       par_p2t:         %d\n",store->par_p2t);
-		fprintf(stderr,"dbg5       par_p2z:         %f\n",store->par_p2z);
-		fprintf(stderr,"dbg5       par_p2x:         %f\n",store->par_p2x);
-		fprintf(stderr,"dbg5       par_p2y:         %f\n",store->par_p2y);
-		fprintf(stderr,"dbg5       par_p2d:         %f\n",store->par_p2d);
-		fprintf(stderr,"dbg5       par_p2g:         %s\n",store->par_p2g);
-		fprintf(stderr,"dbg5       par_p3m:         %d\n",store->par_p3m);
-		fprintf(stderr,"dbg5       par_p3t:         %d\n",store->par_p3t);
-		fprintf(stderr,"dbg5       par_p3z:         %f\n",store->par_p3z);
-		fprintf(stderr,"dbg5       par_p3x:         %f\n",store->par_p3x);
-		fprintf(stderr,"dbg5       par_p3y:         %f\n",store->par_p3y);
-		fprintf(stderr,"dbg5       par_p3d:         %f\n",store->par_p3d);
-		fprintf(stderr,"dbg5       par_p3g:         %s\n",store->par_p3g);
-		fprintf(stderr,"dbg5       par_msz:         %f\n",store->par_msz);
-		fprintf(stderr,"dbg5       par_msx:         %f\n",store->par_msx);
-		fprintf(stderr,"dbg5       par_msy:         %f\n",store->par_msy);
-		fprintf(stderr,"dbg5       par_mrp:         %c%c\n",
-			store->par_mrp[0],store->par_mrp[1]);
-		fprintf(stderr,"dbg5       par_msd:         %f\n",store->par_msd);
-		fprintf(stderr,"dbg5       par_msr:         %f\n",store->par_msr);
-		fprintf(stderr,"dbg5       par_msp:         %f\n",store->par_msp);
-		fprintf(stderr,"dbg5       par_msg:         %f\n",store->par_msg);
-		fprintf(stderr,"dbg5       par_gcg:         %f\n",store->par_gcg);
-		fprintf(stderr,"dbg5       par_cpr:         %s\n",store->par_cpr);
-		fprintf(stderr,"dbg5       par_rop:         %s\n",store->par_rop);
-		fprintf(stderr,"dbg5       par_sid:         %s\n",store->par_sid);
-		fprintf(stderr,"dbg5       par_pll:         %s\n",store->par_pll);
-		fprintf(stderr,"dbg5       par_com:         %s\n",store->par_com);
-		}
-
-	/* zero checksum */
-	checksum = 0;
-
-	/* if data type not set - use start */
-	if (store->type == EM2_NONE)
-	    store->type = EM2_START;
-
-	/* if sonar not set use EM300 */
-	if (store->sonar == 0)
-	    store->sonar = MBSYS_SIMRAD2_EM300;
-
-	/* set up start of output buffer - we handle this
-	   record differently because of the ascii data */
-	memset(line, 0, MBSYS_SIMRAD2_BUFFER_SIZE);
-
-	/* put binary header data into buffer */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_short(swap, (short) store->type, (void *) &line[4]);
-		mb_put_binary_short(swap, (unsigned short) store->sonar, (void *) &line[6]);
-		mb_put_binary_int(swap, (int) store->par_date, (void *) &line[8]);
-		mb_put_binary_int(swap, (int) store->par_msec, (void *) &line[12]);
-		mb_put_binary_short(swap, (unsigned short) store->par_line_num, (void *) &line[16]);
-		mb_put_binary_short(swap, (unsigned short) store->par_serial_1, (void *) &line[18]);
-		mb_put_binary_short(swap, (unsigned short) store->par_serial_2, (void *) &line[20]);
-		}
-
-	/* construct ASCII parameter buffer */
-	buff = &line[22];
-	sprintf(&buff[0], "WLZ=%.2f,", store->par_wlz);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "SMH=%d,", store->par_smh);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "S1Z=%.2f,", store->par_s1z);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "S1X=%.2f,", store->par_s1x);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "S1Y=%.2f,", store->par_s1y);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "S1H=%.2f,", store->par_s1h);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "S1R=%.2f,", store->par_s1r);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "S1P=%.2f,", store->par_s1p);
-	buff_len = strlen(buff);
-	if (store->par_s1n > 0)
-	    {
-	    sprintf(&buff[buff_len], "S1N=%d,", store->par_s1n);
-	    buff_len = strlen(buff);
-	    }
-	sprintf(&buff[buff_len], "S2Z=%.2f,", store->par_s2z);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "S2X=%.2f,", store->par_s2x);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "S2Y=%.2f,", store->par_s2y);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "S2H=%.2f,", store->par_s2h);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "S2R=%.2f,", store->par_s2r);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "S2P=%.2f,", store->par_s2p);
-	buff_len = strlen(buff);
-	if (store->par_s2n > 0)
-	    {
-	    sprintf(&buff[buff_len], "S2N=%d,", store->par_s2n);
-	    buff_len = strlen(buff);
-	    }
-	if (store->par_go1 != 0.0)
-	    {
-	    sprintf(&buff[buff_len], "GO1=%.2f,", store->par_go1);
-	    buff_len = strlen(buff);
-	    }
-	if (store->par_go2 != 0.0)
-	    {
-	    sprintf(&buff[buff_len], "GO2=%.2f,", store->par_go2);
-	    buff_len = strlen(buff);
-	    }
-	sprintf(&buff[buff_len], "TSV=%s,", store->par_tsv);
-	buff_len = strlen(buff);
-	if (strlen(store->par_rsv) > 0)
-	    {
-	    sprintf(&buff[buff_len], "RSV=%s,", store->par_rsv);
-	    buff_len = strlen(buff);
-	    }
-	sprintf(&buff[buff_len], "BSV=%s,", store->par_bsv);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "PSV=%s,", store->par_tsv);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "OSV=%s,", store->par_osv);
-	buff_len = strlen(buff);
-	if (store->par_dsd != 0.0)
-	    {
-	    sprintf(&buff[buff_len], "DSD=%.1f,", store->par_dsd);
-	    buff_len = strlen(buff);
-	    }
-	else
-	    {
-	    sprintf(&buff[buff_len], "DSD=,");
-	    buff_len = strlen(buff);
-	    }
-	sprintf(&buff[buff_len], "DSO=%.6f,", store->par_dso);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "DSF=%.6f,", store->par_dsf);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "DSH=%c%c,",
-		store->par_dsh[0], store->par_dsh[1]);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "APS=%d,",store->par_aps);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "P1M=%d,",store->par_p1m);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "P1T=%d,",store->par_p1t);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "P1Z=%.2f,", store->par_p1z);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "P1X=%.2f,", store->par_p1x);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "P1Y=%.2f,", store->par_p1y);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "P1D=%.1f,", store->par_p1d);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "P1G=%s,", store->par_p1g);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "P2M=%d,",store->par_p2m);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "P2T=%d,",store->par_p2t);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "P2Z=%.2f,", store->par_p2z);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "P2X=%.2f,", store->par_p2x);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "P2Y=%.2f,", store->par_p2y);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "P2D=%.1f,", store->par_p2d);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "P2G=%s,", store->par_p2g);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "P3M=%d,",store->par_p3m);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "P3T=%d,",store->par_p3t);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "P3Z=%.2f,", store->par_p3z);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "P3X=%.2f,", store->par_p3x);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "P3Y=%.2f,", store->par_p3y);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "P3D=%.1f,", store->par_p3d);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "P3G=%s,", store->par_p3g);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "MSZ=%.2f,", store->par_msz);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "MSX=%.2f,", store->par_msx);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "MSY=%.2f,", store->par_msy);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "MRP=%c%c,",
-		store->par_mrp[0], store->par_mrp[1]);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "MSD=%.2f,", store->par_msd);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "MSR=%.2f,", store->par_msr);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "MSP=%.2f,", store->par_msp);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "MSG=%.2f,", store->par_msg);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "GCG=%.2f,", store->par_gcg);
-	buff_len = strlen(buff);
-	if (strlen(store->par_cpr) > 0)
-	    {
-	    sprintf(&buff[buff_len], "CPR=%s,", store->par_cpr);
-	    buff_len = strlen(buff);
-	    }
-	if (strlen(store->par_rop) > 0)
-	    {
-	    sprintf(&buff[buff_len], "ROP=%s,", store->par_rop);
-	    buff_len = strlen(buff);
-	    }
-	if (strlen(store->par_sid) > 0)
-	    {
-	    sprintf(&buff[buff_len], "SID=%s,", store->par_sid);
-	    buff_len = strlen(buff);
-	    }
-	if (strlen(store->par_pll) > 0)
-	    {
-	    sprintf(&buff[buff_len], "PLL=%s,", store->par_pll);
-	    buff_len = strlen(buff);
-	    }
-	if (strlen(store->par_com) > 0)
-	    {
-	    /* replace commas (,) with caret (^) values to circumvent
-	       the format's inability to store commas in comments */
-	    while ((comma_ptr = strchr(store->par_com, ',')) != NULL)
-		{
-		comma_ptr[0] = '^';
-		}
-	    sprintf(&buff[buff_len], "COM=%s,", store->par_com);
-	    buff_len = strlen(buff);
-	    }
-	buff[buff_len] = ',';
-	buff_len++;
-	if (buff_len % 2 == 0)
-	    buff_len++;
-
-	/* put end of record in buffer */
-	line[buff_len + 22] = EM2_END;
-
-	/* get size of record */
-	write_size = 25 + buff_len;
-	mb_put_binary_int(swap, (int) (write_size - 4), (void *) &line[0]);
-
-	/* compute checksum */
-	uchar_ptr = (mb_u_char *) line;
-	for (j=5;j<write_size-3;j++)
-	    checksum += uchar_ptr[j];
-
-	/* set checksum */
-	mb_put_binary_short(swap, (unsigned short) checksum, (void *) &line[buff_len + 23]);
-
-	/* finally write out the data */
-	write_len = fwrite(&line,1,write_size,mbfp);
-	if (write_len != write_size)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	else
-		status = MB_SUCCESS;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em300mba_wr_run_parameter(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store, int *error)
-{
-	char	*function_name = "mbr_em300mba_wr_run_parameter";
-	int	status = MB_SUCCESS;
-	char	line[EM2_RUN_PARAMETER_SIZE];
-	short	label;
-	int	write_len;
-	int	write_size;
-	unsigned short checksum;
-	mb_u_char   *uchar_ptr;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       run_date:        %d\n",store->run_date);
-		fprintf(stderr,"dbg5       run_msec:        %d\n",store->run_msec);
-		fprintf(stderr,"dbg5       run_ping_count:  %d\n",store->run_ping_count);
-		fprintf(stderr,"dbg5       run_serial:      %d\n",store->run_serial);
-		fprintf(stderr,"dbg5       run_status:      %d\n",store->run_status);
-		fprintf(stderr,"dbg5       run_mode:        %d\n",store->run_mode);
-		fprintf(stderr,"dbg5       run_filter_id:   %d\n",store->run_filter_id);
-		fprintf(stderr,"dbg5       run_min_depth:   %d\n",store->run_min_depth);
-		fprintf(stderr,"dbg5       run_max_depth:   %d\n",store->run_max_depth);
-		fprintf(stderr,"dbg5       run_absorption:  %d\n",store->run_absorption);
-		fprintf(stderr,"dbg5       run_tran_pulse:  %d\n",store->run_tran_pulse);
-		fprintf(stderr,"dbg5       run_tran_beam:   %d\n",store->run_tran_beam);
-		fprintf(stderr,"dbg5       run_tran_pow:    %d\n",store->run_tran_pow);
-		fprintf(stderr,"dbg5       run_rec_beam:    %d\n",store->run_rec_beam);
-		fprintf(stderr,"dbg5       run_rec_band:    %d\n",store->run_rec_band);
-		fprintf(stderr,"dbg5       run_rec_gain:    %d\n",store->run_rec_gain);
-		fprintf(stderr,"dbg5       run_tvg_cross:   %d\n",store->run_tvg_cross);
-		fprintf(stderr,"dbg5       run_ssv_source:  %d\n",store->run_ssv_source);
-		fprintf(stderr,"dbg5       run_max_swath:   %d\n",store->run_max_swath);
-		fprintf(stderr,"dbg5       run_beam_space:  %d\n",store->run_beam_space);
-		fprintf(stderr,"dbg5       run_swath_angle: %d\n",store->run_swath_angle);
-		fprintf(stderr,"dbg5       run_stab_mode:   %d\n",store->run_stab_mode);
-		for (i=0;i<6;i++)
-			fprintf(stderr,"dbg5       run_spare[%d]:    %d\n",i,store->run_spare[i]);
-		}
-
-	/* zero checksum */
-	checksum = 0;
-
-	/* write the record size */
-	mb_put_binary_int(swap, (int) (EM2_RUN_PARAMETER_SIZE), (void *) &write_size);
-	write_len = fwrite(&write_size,1,4,mbfp);
-	if (write_len != 4)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	else
-		status = MB_SUCCESS;
-
-	/* write the record label */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_short(swap, (short) (EM2_RUN_PARAMETER), (void *) &label);
-		write_len = fwrite(&label,1,2,mbfp);
-		if (write_len != 2)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_WRITE_FAIL;
-			}
-		else
-			status = MB_SUCCESS;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[1];
-		}
-
-	/* write the sonar id */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_short(swap, (short) (store->sonar), (void *) &label);
-		write_len = fwrite(&label,1,2,mbfp);
-		if (write_len != 2)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_WRITE_FAIL;
-			}
-		else
-			status = MB_SUCCESS;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[0];
-		checksum += uchar_ptr[1];
-		}
-
-	/* construct binary data */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_int(swap, (int) store->run_date, (void *) &line[0]);
-		mb_put_binary_int(swap, (int) store->run_msec, (void *) &line[4]);
-		mb_put_binary_short(swap, (unsigned short) store->run_ping_count, (void *) &line[8]);
-		mb_put_binary_short(swap, (unsigned short) store->run_serial, (void *) &line[10]);
-		mb_put_binary_int(swap, (int) store->run_status, (void *) &line[12]);
-		line[16] = store->run_mode;
-		line[17] = store->run_filter_id;
-		mb_put_binary_short(swap, (unsigned short) store->run_min_depth, (void *) &line[18]);
-		mb_put_binary_short(swap, (unsigned short) store->run_max_depth, (void *) &line[20]);
-		mb_put_binary_short(swap, (unsigned short) store->run_absorption, (void *) &line[22]);
-		mb_put_binary_short(swap, (unsigned short) store->run_tran_pulse, (void *) &line[24]);
-		mb_put_binary_short(swap, (unsigned short) store->run_tran_beam, (void *) &line[26]);
-		line[28] = store->run_tran_pow;
-		line[29] = store->run_rec_beam;
-		line[30] = store->run_rec_band;
-		line[31] = store->run_rec_gain;
-		line[32] = store->run_tvg_cross;
-		line[33] = store->run_ssv_source;
-		mb_put_binary_short(swap, (unsigned short) store->run_max_swath, (void *) &line[34]);
-		line[36] = store->run_beam_space;
-		line[37] = store->run_swath_angle;
-		line[38] = store->run_stab_mode;
-		for (i=0;i<6;i++)
-		    line[39+i] = store->run_spare[i];
-		line[EM2_RUN_PARAMETER_SIZE-7] = 0x03;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM2_RUN_PARAMETER_SIZE-7;j++)
-		    checksum += uchar_ptr[j];
-
-		/* set checksum */
-		mb_put_binary_short(swap, (unsigned short) checksum, (void *) &line[EM2_RUN_PARAMETER_SIZE-6]);
-
-		/* write out data */
-		write_len = fwrite(line,1,EM2_RUN_PARAMETER_SIZE-4,mbfp);
-		if (write_len != EM2_RUN_PARAMETER_SIZE-4)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em300mba_wr_clock(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store, int *error)
-{
-	char	*function_name = "mbr_em300mba_wr_clock";
-	int	status = MB_SUCCESS;
-	char	line[EM2_CLOCK_SIZE];
-	short	label;
-	int	write_len;
-	int	write_size;
-	unsigned short checksum;
-	mb_u_char   *uchar_ptr;
-	int	j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       clk_date:        %d\n",store->clk_date);
-		fprintf(stderr,"dbg5       clk_msec:        %d\n",store->clk_msec);
-		fprintf(stderr,"dbg5       clk_count:       %d\n",store->clk_count);
-		fprintf(stderr,"dbg5       clk_serial:      %d\n",store->clk_serial);
-		fprintf(stderr,"dbg5       clk_origin_date: %d\n",store->clk_origin_date);
-		fprintf(stderr,"dbg5       clk_origin_msec: %d\n",store->clk_origin_msec);
-		fprintf(stderr,"dbg5       clk_1_pps_use:   %d\n",store->clk_1_pps_use);
-		}
-
-	/* zero checksum */
-	checksum = 0;
-
-	/* write the record size */
-	mb_put_binary_int(swap, (int) (EM2_CLOCK_SIZE), (void *) &write_size);
-	write_len = fwrite(&write_size,1,4,mbfp);
-	if (write_len != 4)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	else
-		status = MB_SUCCESS;
-
-	/* write the record label */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_short(swap, (short) (EM2_CLOCK), (void *) &label);
-		write_len = fwrite(&label,1,2,mbfp);
-		if (write_len != 2)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_WRITE_FAIL;
-			}
-		else
-			status = MB_SUCCESS;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[1];
-		}
-
-	/* write the sonar id */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_short(swap, (short) (store->sonar), (void *) &label);
-		write_len = fwrite(&label,1,2,mbfp);
-		if (write_len != 2)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_WRITE_FAIL;
-			}
-		else
-			status = MB_SUCCESS;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[0];
-		checksum += uchar_ptr[1];
-		}
-
-	/* construct binary data */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_int(swap, (int) store->clk_date, (void *) &line[0]);
-		mb_put_binary_int(swap, (int) store->clk_msec, (void *) &line[4]);
-		mb_put_binary_short(swap, (unsigned short) store->clk_count, (void *) &line[8]);
-		mb_put_binary_short(swap, (unsigned short) store->clk_serial, (void *) &line[10]);
-		mb_put_binary_int(swap, (int) store->clk_origin_date, (void *) &line[12]);
-		mb_put_binary_int(swap, (int) store->clk_origin_msec, (void *) &line[16]);
-		line[20] = store->clk_1_pps_use;
-		line[EM2_CLOCK_SIZE-7] = 0x03;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM2_CLOCK_SIZE-7;j++)
-		    checksum += uchar_ptr[j];
-
-		/* set checksum */
-		mb_put_binary_short(swap, (unsigned short) checksum, (void *) &line[EM2_CLOCK_SIZE-6]);
-
-		/* write out data */
-		write_len = fwrite(line,1,EM2_CLOCK_SIZE-4,mbfp);
-		if (write_len != EM2_CLOCK_SIZE-4)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em300mba_wr_tide(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store, int *error)
-{
-	char	*function_name = "mbr_em300mba_wr_tide";
-	int	status = MB_SUCCESS;
-	char	line[EM2_TIDE_SIZE];
-	short	label;
-	int	write_len;
-	int	write_size;
-	unsigned short checksum;
-	mb_u_char   *uchar_ptr;
-	int	j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       tid_date:        %d\n",store->tid_date);
-		fprintf(stderr,"dbg5       tid_msec:        %d\n",store->tid_msec);
-		fprintf(stderr,"dbg5       tid_count:       %d\n",store->tid_count);
-		fprintf(stderr,"dbg5       tid_serial:      %d\n",store->tid_serial);
-		fprintf(stderr,"dbg5       tid_origin_date: %d\n",store->tid_origin_date);
-		fprintf(stderr,"dbg5       tid_origin_msec: %d\n",store->tid_origin_msec);
-		fprintf(stderr,"dbg5       tid_tide:        %d\n",store->tid_tide);
-		}
-
-	/* zero checksum */
-	checksum = 0;
-
-	/* write the record size */
-	mb_put_binary_int(swap, (int) (EM2_TIDE_SIZE), (void *) &write_size);
-	write_len = fwrite(&write_size,1,4,mbfp);
-	if (write_len != 4)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	else
-		status = MB_SUCCESS;
-
-	/* write the record label */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_short(swap, (short) (EM2_TIDE), (void *) &label);
-		write_len = fwrite(&label,1,2,mbfp);
-		if (write_len != 2)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_WRITE_FAIL;
-			}
-		else
-			status = MB_SUCCESS;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[1];
-		}
-
-	/* write the sonar id */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_short(swap, (short) (store->sonar), (void *) &label);
-		write_len = fwrite(&label,1,2,mbfp);
-		if (write_len != 2)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_WRITE_FAIL;
-			}
-		else
-			status = MB_SUCCESS;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[0];
-		checksum += uchar_ptr[1];
-		}
-
-	/* construct binary data */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_int(swap, (int) store->tid_date, (void *) &line[0]);
-		mb_put_binary_int(swap, (int) store->tid_msec, (void *) &line[4]);
-		mb_put_binary_short(swap, (unsigned short) store->tid_count, (void *) &line[8]);
-		mb_put_binary_short(swap, (unsigned short) store->tid_serial, (void *) &line[10]);
-		mb_put_binary_int(swap, (int) store->tid_origin_date, (void *) &line[12]);
-		mb_put_binary_int(swap, (int) store->tid_origin_msec, (void *) &line[16]);
-		mb_put_binary_short(swap, (short) store->tid_tide, (void *) &line[20]);
-		line[EM2_TIDE_SIZE-8] = '\0';
-		line[EM2_TIDE_SIZE-7] = 0x03;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM2_TIDE_SIZE-7;j++)
-		    checksum += uchar_ptr[j];
-
-		/* set checksum */
-		mb_put_binary_short(swap, (unsigned short) checksum, (void *) &line[EM2_TIDE_SIZE-6]);
-
-		/* write out data */
-		write_len = fwrite(line,1,EM2_TIDE_SIZE-4,mbfp);
-		if (write_len != EM2_TIDE_SIZE-4)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em300mba_wr_height(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store, int *error)
-{
-	char	*function_name = "mbr_em300mba_wr_height";
-	int	status = MB_SUCCESS;
-	char	line[EM2_HEIGHT_SIZE];
-	short	label;
-	int	write_len;
-	int	write_size;
-	unsigned short checksum;
-	mb_u_char   *uchar_ptr;
-	int	j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       hgt_date:        %d\n",store->hgt_date);
-		fprintf(stderr,"dbg5       hgt_msec:        %d\n",store->hgt_msec);
-		fprintf(stderr,"dbg5       hgt_count:       %d\n",store->hgt_count);
-		fprintf(stderr,"dbg5       hgt_serial:      %d\n",store->hgt_serial);
-		fprintf(stderr,"dbg5       hgt_height:      %d\n",store->hgt_height);
-		fprintf(stderr,"dbg5       hgt_type:        %d\n",store->hgt_type);
-		}
-
-	/* zero checksum */
-	checksum = 0;
-
-	/* write the record size */
-	mb_put_binary_int(swap, (int) (EM2_HEIGHT_SIZE), (void *) &write_size);
-	write_len = fwrite(&write_size,1,4,mbfp);
-	if (write_len != 4)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	else
-		status = MB_SUCCESS;
-
-	/* write the record label */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_short(swap, (short) (EM2_HEIGHT), (void *) &label);
-		write_len = fwrite(&label,1,2,mbfp);
-		if (write_len != 2)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_WRITE_FAIL;
-			}
-		else
-			status = MB_SUCCESS;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[1];
-		}
-
-	/* write the sonar id */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_short(swap, (short) (store->sonar), (void *) &label);
-		write_len = fwrite(&label,1,2,mbfp);
-		if (write_len != 2)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_WRITE_FAIL;
-			}
-		else
-			status = MB_SUCCESS;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[0];
-		checksum += uchar_ptr[1];
-		}
-
-	/* construct binary data */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_int(swap, (int) store->hgt_date, (void *) &line[0]);
-		mb_put_binary_int(swap, (int) store->hgt_msec, (void *) &line[4]);
-		mb_put_binary_short(swap, (unsigned short) store->hgt_count, (void *) &line[8]);
-		mb_put_binary_short(swap, (unsigned short) store->hgt_serial, (void *) &line[10]);
-		mb_put_binary_int(swap, (int) store->hgt_height, (void *) &line[12]);
-		line[16] = (mb_u_char) store->hgt_type;
-		line[EM2_HEIGHT_SIZE-7] = 0x03;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM2_HEIGHT_SIZE-7;j++)
-		    checksum += uchar_ptr[j];
-
-		/* set checksum */
-		mb_put_binary_short(swap, (unsigned short) checksum, (void *) &line[EM2_HEIGHT_SIZE-6]);
-
-		/* write out data */
-		write_len = fwrite(line,1,EM2_HEIGHT_SIZE-4,mbfp);
-		if (write_len != EM2_HEIGHT_SIZE-4)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em300mba_wr_heading(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store, int *error)
-{
-	char	*function_name = "mbr_em300mba_wr_heading";
-	int	status = MB_SUCCESS;
-	struct mbsys_simrad2_heading_struct *heading;
-	char	line[EM2_HEADING_HEADER_SIZE];
-	short	label;
-	int	write_len;
-	int	write_size;
-	unsigned short checksum;
-	mb_u_char   *uchar_ptr;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		}
-
-	/* get storage structure */
-	heading = (struct mbsys_simrad2_heading_struct *) store->heading;
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       hed_date:        %d\n",heading->hed_date);
-		fprintf(stderr,"dbg5       hed_msec:        %d\n",heading->hed_msec);
-		fprintf(stderr,"dbg5       hed_count:       %d\n",heading->hed_count);
-		fprintf(stderr,"dbg5       hed_serial:      %d\n",heading->hed_serial);
-		fprintf(stderr,"dbg5       hed_ndata:       %d\n",heading->hed_ndata);
-		fprintf(stderr,"dbg5       count    time (msec)    heading (0.01 deg)\n");
-		fprintf(stderr,"dbg5       -----    -----------    ------------------\n");
-		for (i=0;i<heading->hed_ndata;i++)
-			fprintf(stderr,"dbg5        %4d      %7d          %7d\n",
-				i, heading->hed_time[i], heading->hed_heading[i]);
-		fprintf(stderr,"dbg5       hed_heading_status: %d\n",heading->hed_heading_status);
-		}
-
-	/* zero checksum */
-	checksum = 0;
-
-	/* write the record size */
-	mb_put_binary_int(swap, (int) (EM2_HEADING_HEADER_SIZE
-			+ EM2_HEADING_SLICE_SIZE * heading->hed_ndata + 8), (void *) &write_size);
-	write_len = fwrite(&write_size,1,4,mbfp);
-	if (write_len != 4)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	else
-		status = MB_SUCCESS;
-
-	/* write the record label */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_short(swap, (short) (EM2_HEADING), (void *) &label);
-		write_len = fwrite(&label,1,2,mbfp);
-		if (write_len != 2)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_WRITE_FAIL;
-			}
-		else
-			status = MB_SUCCESS;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[1];
-		}
-
-	/* write the sonar id */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_short(swap, (short) (store->sonar), (void *) &label);
-		write_len = fwrite(&label,1,2,mbfp);
-		if (write_len != 2)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_WRITE_FAIL;
-			}
-		else
-			status = MB_SUCCESS;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[0];
-		checksum += uchar_ptr[1];
-		}
-
-	/* output binary header data */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_int(swap, (int) heading->hed_date, (void *) &line[0]);
-		mb_put_binary_int(swap, (int) heading->hed_msec, (void *) &line[4]);
-		mb_put_binary_short(swap, (unsigned short) heading->hed_count, (void *) &line[8]);
-		mb_put_binary_short(swap, (unsigned short) heading->hed_serial, (void *) &line[10]);
-		mb_put_binary_short(swap, (unsigned short) heading->hed_ndata, (void *) &line[12]);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM2_HEADING_HEADER_SIZE;j++)
-		    checksum += uchar_ptr[j];
-
-		/* write out data */
-		write_len = fwrite(line,1,EM2_HEADING_HEADER_SIZE,mbfp);
-		if (write_len != EM2_HEADING_HEADER_SIZE)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* output binary heading data */
-	if (status == MB_SUCCESS)
-	    for (i=0;i<heading->hed_ndata;i++)
-		{
-		mb_put_binary_short(swap, (unsigned short) heading->hed_time[i], (void *) &line[0]);
-		mb_put_binary_short(swap, (unsigned short) heading->hed_heading[i], (void *) &line[2]);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM2_HEADING_SLICE_SIZE;j++)
-		    checksum += uchar_ptr[j];
-
-		/* write out data */
-		write_len = fwrite(line,1,EM2_HEADING_SLICE_SIZE,mbfp);
-		if (write_len != EM2_HEADING_SLICE_SIZE)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* output end of record */
-	if (status == MB_SUCCESS)
-		{
-		line[0] = (mb_u_char) heading->hed_heading_status;
-		line[1] = 0x03;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		checksum += uchar_ptr[0];
-
-		/* set checksum */
-		mb_put_binary_short(swap, (unsigned short) checksum, (void *) &line[2]);
-
-		/* write out data */
-		write_len = fwrite(line,1,4,mbfp);
-		if (write_len != 4)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em300mba_wr_ssv(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store, int *error)
-{
-	char	*function_name = "mbr_em300mba_wr_ssv";
-	int	status = MB_SUCCESS;
-	struct mbsys_simrad2_ssv_struct *ssv;
-	char	line[EM2_SSV_HEADER_SIZE];
-	short	label;
-	int	write_len;
-	int	write_size;
-	unsigned short checksum;
-	mb_u_char   *uchar_ptr;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		}
-
-	/* get storage structure */
-	ssv = (struct mbsys_simrad2_ssv_struct *) store->ssv;
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       ssv_date:        %d\n",ssv->ssv_date);
-		fprintf(stderr,"dbg5       ssv_msec:        %d\n",ssv->ssv_msec);
-		fprintf(stderr,"dbg5       ssv_count:       %d\n",ssv->ssv_count);
-		fprintf(stderr,"dbg5       ssv_serial:      %d\n",ssv->ssv_serial);
-		fprintf(stderr,"dbg5       ssv_ndata:       %d\n",ssv->ssv_ndata);
-		fprintf(stderr,"dbg5       count    time (msec)    ssv (0.1 m/s)\n");
-		fprintf(stderr,"dbg5       -----    -----------    ------------------\n");
-		for (i=0;i<ssv->ssv_ndata;i++)
-			fprintf(stderr,"dbg5        %4d      %7d          %7d\n",
-				i, ssv->ssv_time[i], ssv->ssv_ssv[i]);
-		}
-
-	/* zero checksum */
-	checksum = 0;
-
-	/* write the record size */
-	mb_put_binary_int(swap, (int) (EM2_SSV_HEADER_SIZE
-			+ EM2_SSV_SLICE_SIZE * ssv->ssv_ndata + 8), (void *) &write_size);
-	write_len = fwrite(&write_size,1,4,mbfp);
-	if (write_len != 4)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	else
-		status = MB_SUCCESS;
-
-	/* write the record label */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_short(swap, (short) (EM2_SSV), (void *) &label);
-		write_len = fwrite(&label,1,2,mbfp);
-		if (write_len != 2)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_WRITE_FAIL;
-			}
-		else
-			status = MB_SUCCESS;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[1];
-		}
-
-	/* write the sonar id */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_short(swap, (short) (store->sonar), (void *) &label);
-		write_len = fwrite(&label,1,2,mbfp);
-		if (write_len != 2)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_WRITE_FAIL;
-			}
-		else
-			status = MB_SUCCESS;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[0];
-		checksum += uchar_ptr[1];
-		}
-
-	/* output binary header data */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_int(swap, (int) ssv->ssv_date, (void *) &line[0]);
-		mb_put_binary_int(swap, (int) ssv->ssv_msec, (void *) &line[4]);
-		mb_put_binary_short(swap, (unsigned short) ssv->ssv_count, (void *) &line[8]);
-		mb_put_binary_short(swap, (unsigned short) ssv->ssv_serial, (void *) &line[10]);
-		mb_put_binary_short(swap, (unsigned short) ssv->ssv_ndata, (void *) &line[12]);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM2_SSV_HEADER_SIZE;j++)
-		    checksum += uchar_ptr[j];
-
-		/* write out data */
-		write_len = fwrite(line,1,EM2_SSV_HEADER_SIZE,mbfp);
-		if (write_len != EM2_SSV_HEADER_SIZE)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* output binary ssv data */
-	if (status == MB_SUCCESS)
-	    for (i=0;i<ssv->ssv_ndata;i++)
-		{
-		mb_put_binary_short(swap, (unsigned short) ssv->ssv_time[i], (void *) &line[0]);
-		mb_put_binary_short(swap, (unsigned short) ssv->ssv_ssv[i], (void *) &line[2]);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM2_SSV_SLICE_SIZE;j++)
-		    checksum += uchar_ptr[j];
-
-		/* write out data */
-		write_len = fwrite(line,1,EM2_SSV_SLICE_SIZE,mbfp);
-		if (write_len != EM2_SSV_SLICE_SIZE)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* output end of record */
-	if (status == MB_SUCCESS)
-		{
-		line[0] = 0;
-		line[1] = 0x03;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		checksum += uchar_ptr[0];
-
-		/* set checksum */
-		mb_put_binary_short(swap, (unsigned short) checksum, (void *) &line[2]);
-
-		/* write out data */
-		write_len = fwrite(line,1,4,mbfp);
-		if (write_len != 4)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em300mba_wr_tilt(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store, int *error)
-{
-	char	*function_name = "mbr_em300mba_wr_tilt";
-	int	status = MB_SUCCESS;
-	struct mbsys_simrad2_tilt_struct *tilt;
-	char	line[EM2_TILT_HEADER_SIZE];
-	short	label;
-	int	write_len;
-	int	write_size;
-	unsigned short checksum;
-	mb_u_char   *uchar_ptr;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		}
-
-	/* get storage structure */
-	tilt = (struct mbsys_simrad2_tilt_struct *) store->tilt;
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       tlt_date:        %d\n",tilt->tlt_date);
-		fprintf(stderr,"dbg5       tlt_msec:        %d\n",tilt->tlt_msec);
-		fprintf(stderr,"dbg5       tlt_count:       %d\n",tilt->tlt_count);
-		fprintf(stderr,"dbg5       tlt_serial:      %d\n",tilt->tlt_serial);
-		fprintf(stderr,"dbg5       tlt_ndata:       %d\n",tilt->tlt_ndata);
-		fprintf(stderr,"dbg5       count    time (msec)    tilt (0.01 deg)\n");
-		fprintf(stderr,"dbg5       -----    -----------    ------------------\n");
-		for (i=0;i<tilt->tlt_ndata;i++)
-			fprintf(stderr,"dbg5        %4d      %7d          %7d\n",
-				i, tilt->tlt_time[i], tilt->tlt_tilt[i]);
-		}
-
-	/* zero checksum */
-	checksum = 0;
-
-	/* write the record size */
-	mb_put_binary_int(swap, (int) (EM2_TILT_HEADER_SIZE
-			+ EM2_TILT_SLICE_SIZE * tilt->tlt_ndata + 8), (void *) &write_size);
-	write_len = fwrite(&write_size,1,4,mbfp);
-	if (write_len != 4)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	else
-		status = MB_SUCCESS;
-
-	/* write the record label */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_short(swap, (short) (EM2_TILT), (void *) &label);
-		write_len = fwrite(&label,1,2,mbfp);
-		if (write_len != 2)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_WRITE_FAIL;
-			}
-		else
-			status = MB_SUCCESS;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[1];
-		}
-
-	/* write the sonar id */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_short(swap, (short) (store->sonar), (void *) &label);
-		write_len = fwrite(&label,1,2,mbfp);
-		if (write_len != 2)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_WRITE_FAIL;
-			}
-		else
-			status = MB_SUCCESS;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[0];
-		checksum += uchar_ptr[1];
-		}
-
-	/* output binary header data */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_int(swap, (int) tilt->tlt_date, (void *) &line[0]);
-		mb_put_binary_int(swap, (int) tilt->tlt_msec, (void *) &line[4]);
-		mb_put_binary_short(swap, (unsigned short) tilt->tlt_count, (void *) &line[8]);
-		mb_put_binary_short(swap, (unsigned short) tilt->tlt_serial, (void *) &line[10]);
-		mb_put_binary_short(swap, (unsigned short) tilt->tlt_ndata, (void *) &line[12]);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM2_TILT_HEADER_SIZE;j++)
-		    checksum += uchar_ptr[j];
-
-		/* write out data */
-		write_len = fwrite(line,1,EM2_TILT_HEADER_SIZE,mbfp);
-		if (write_len != EM2_TILT_HEADER_SIZE)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* output binary tilt data */
-	if (status == MB_SUCCESS)
-	    for (i=0;i<tilt->tlt_ndata;i++)
-		{
-		mb_put_binary_short(swap, (unsigned short) tilt->tlt_time[i], (void *) &line[0]);
-		mb_put_binary_short(swap, (unsigned short) tilt->tlt_tilt[i], (void *) &line[2]);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM2_TILT_SLICE_SIZE;j++)
-		    checksum += uchar_ptr[j];
-
-		/* write out data */
-		write_len = fwrite(line,1,EM2_TILT_SLICE_SIZE,mbfp);
-		if (write_len != EM2_TILT_SLICE_SIZE)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* output end of record */
-	if (status == MB_SUCCESS)
-		{
-		line[0] = 0;
-		line[1] = 0x03;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		checksum += uchar_ptr[0];
-
-		/* set checksum */
-		mb_put_binary_short(swap, (unsigned short) checksum, (void *) &line[2]);
-
-		/* write out data */
-		write_len = fwrite(line,1,4,mbfp);
-		if (write_len != 4)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em300mba_wr_attitude(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store, int *error)
-{
-	char	*function_name = "mbr_em300mba_wr_attitude";
-	int	status = MB_SUCCESS;
-	struct mbsys_simrad2_attitude_struct *attitude;
-	char	line[EM2_ATTITUDE_HEADER_SIZE];
-	short	label;
-	int	write_len;
-	int	write_size;
-	unsigned short checksum;
-	mb_u_char   *uchar_ptr;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		}
-
-	/* get storage structure */
-	attitude = (struct mbsys_simrad2_attitude_struct *) store->attitude;
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       att_date:        %d\n",attitude->att_date);
-		fprintf(stderr,"dbg5       att_msec:        %d\n",attitude->att_msec);
-		fprintf(stderr,"dbg5       att_count:       %d\n",attitude->att_count);
-		fprintf(stderr,"dbg5       att_serial:      %d\n",attitude->att_serial);
-		fprintf(stderr,"dbg5       att_ndata:       %d\n",attitude->att_ndata);
-		fprintf(stderr,"dbg5       cnt   time   roll pitch heave heading\n");
-		fprintf(stderr,"dbg5       -------------------------------------\n");
-		for (i=0;i<attitude->att_ndata;i++)
-			fprintf(stderr,"dbg5        %3d  %d  %d %d %d %d\n",
-				i, attitude->att_time[i], attitude->att_roll[i],
-				attitude->att_pitch[i], attitude->att_heave[i],
-				attitude->att_heading[i]);
-		fprintf(stderr,"dbg5       att_heading_status: %d\n",attitude->att_heading_status);
-		}
-
-	/* zero checksum */
-	checksum = 0;
-
-	/* write the record size */
-	mb_put_binary_int(swap, (int) (EM2_ATTITUDE_HEADER_SIZE
-			+ EM2_ATTITUDE_SLICE_SIZE * attitude->att_ndata + 8), (void *) &write_size);
-	write_len = fwrite(&write_size,1,4,mbfp);
-	if (write_len != 4)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	else
-		status = MB_SUCCESS;
-
-	/* write the record label */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_short(swap, (short) (EM2_ATTITUDE), (void *) &label);
-		write_len = fwrite(&label,1,2,mbfp);
-		if (write_len != 2)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_WRITE_FAIL;
-			}
-		else
-			status = MB_SUCCESS;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[1];
-		}
-
-	/* write the sonar id */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_short(swap, (short) (store->sonar), (void *) &label);
-		write_len = fwrite(&label,1,2,mbfp);
-		if (write_len != 2)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_WRITE_FAIL;
-			}
-		else
-			status = MB_SUCCESS;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[0];
-		checksum += uchar_ptr[1];
-		}
-
-	/* output binary header data */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_int(swap, (int) attitude->att_date, (void *) &line[0]);
-		mb_put_binary_int(swap, (int) attitude->att_msec, (void *) &line[4]);
-		mb_put_binary_short(swap, (unsigned short) attitude->att_count, (void *) &line[8]);
-		mb_put_binary_short(swap, (unsigned short) attitude->att_serial, (void *) &line[10]);
-		mb_put_binary_short(swap, (unsigned short) attitude->att_ndata, (void *) &line[12]);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM2_ATTITUDE_HEADER_SIZE;j++)
-		    checksum += uchar_ptr[j];
-
-		/* write out data */
-		write_len = fwrite(line,1,EM2_ATTITUDE_HEADER_SIZE,mbfp);
-		if (write_len != EM2_ATTITUDE_HEADER_SIZE)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* output binary heading data */
-	if (status == MB_SUCCESS)
-	    for (i=0;i<attitude->att_ndata;i++)
-		{
-		mb_put_binary_short(swap, (unsigned short) attitude->att_time[i], (void *) &line[0]);
-		mb_put_binary_short(swap, (unsigned short) attitude->att_sensor_status[i], (void *) &line[2]);
-		mb_put_binary_short(swap, (short) attitude->att_roll[i], (void *) &line[4]);
-		mb_put_binary_short(swap, (short) attitude->att_pitch[i], (void *) &line[6]);
-		mb_put_binary_short(swap, (short) attitude->att_heave[i], (void *) &line[8]);
-		mb_put_binary_short(swap, (unsigned short) attitude->att_heading[i], (void *) &line[10]);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM2_ATTITUDE_SLICE_SIZE;j++)
-		    checksum += uchar_ptr[j];
-
-		/* write out data */
-		write_len = fwrite(line,1,EM2_ATTITUDE_SLICE_SIZE,mbfp);
-		if (write_len != EM2_ATTITUDE_SLICE_SIZE)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* output end of record */
-	if (status == MB_SUCCESS)
-		{
-		line[0] = (mb_u_char) attitude->att_heading_status;
-		line[1] = 0x03;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		checksum += uchar_ptr[0];
-
-		/* set checksum */
-		mb_put_binary_short(swap, (unsigned short) checksum, (void *) &line[2]);
-
-		/* write out data */
-		write_len = fwrite(line,1,4,mbfp);
-		if (write_len != 4)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em300mba_wr_pos(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store, int *error)
-{
-	char	*function_name = "mbr_em300mba_wr_pos";
-	int	status = MB_SUCCESS;
-	char	line[EM2_POS_HEADER_SIZE];
-	short	label;
-	int	write_len;
-	int	write_size;
-	unsigned short checksum;
-	mb_u_char   *uchar_ptr;
-	int	j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       pos_date:        %d\n",store->pos_date);
-		fprintf(stderr,"dbg5       pos_msec:        %d\n",store->pos_msec);
-		fprintf(stderr,"dbg5       pos_count:       %d\n",store->pos_count);
-		fprintf(stderr,"dbg5       pos_serial:      %d\n",store->pos_serial);
-		fprintf(stderr,"dbg5       pos_latitude:    %d\n",store->pos_latitude);
-		fprintf(stderr,"dbg5       pos_longitude:   %d\n",store->pos_longitude);
-		fprintf(stderr,"dbg5       pos_quality:     %d\n",store->pos_quality);
-		fprintf(stderr,"dbg5       pos_speed:       %d\n",store->pos_speed);
-		fprintf(stderr,"dbg5       pos_course:      %d\n",store->pos_course);
-		fprintf(stderr,"dbg5       pos_heading:     %d\n",store->pos_heading);
-		fprintf(stderr,"dbg5       pos_system:      %d\n",store->pos_system);
-		fprintf(stderr,"dbg5       pos_input_size:  %d\n",store->pos_input_size);
-		fprintf(stderr,"dbg5       pos_input:\ndbg5            %s\n",store->pos_input);
-		}
-
-	/* zero checksum */
-	checksum = 0;
-
-	/* write the record size */
-	mb_put_binary_int(swap, (int) (EM2_POS_HEADER_SIZE
-			+ store->pos_input_size
-			- (store->pos_input_size % 2) + 8), (void *) &write_size);
-	write_len = fwrite(&write_size,1,4,mbfp);
-	if (write_len != 4)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	else
-		status = MB_SUCCESS;
-
-	/* write the record label */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_short(swap, (short) (EM2_POS), (void *) &label);
-		write_len = fwrite(&label,1,2,mbfp);
-		if (write_len != 2)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_WRITE_FAIL;
-			}
-		else
-			status = MB_SUCCESS;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[1];
-		}
-
-	/* write the sonar id */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_short(swap, (short) (store->sonar), (void *) &label);
-		write_len = fwrite(&label,1,2,mbfp);
-		if (write_len != 2)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_WRITE_FAIL;
-			}
-		else
-			status = MB_SUCCESS;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[0];
-		checksum += uchar_ptr[1];
-		}
-
-	/* output binary header data */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_int(swap, (int) store->pos_date, (void *) &line[0]);
-		mb_put_binary_int(swap, (int) store->pos_msec, (void *) &line[4]);
-		mb_put_binary_short(swap, (unsigned short) store->pos_count, (void *) &line[8]);
-		mb_put_binary_short(swap, (unsigned short) store->pos_serial, (void *) &line[10]);
-		mb_put_binary_int(swap, (int) store->pos_latitude, (void *) &line[12]);
-		mb_put_binary_int(swap, (int) store->pos_longitude, (void *) &line[16]);
-		mb_put_binary_short(swap, (unsigned short) store->pos_quality, (void *) &line[20]);
-		mb_put_binary_short(swap, (unsigned short) store->pos_speed, (void *) &line[22]);
-		mb_put_binary_short(swap, (unsigned short) store->pos_course, (void *) &line[24]);
-		mb_put_binary_short(swap, (unsigned short) store->pos_heading, (void *) &line[26]);
-		line[28] = (mb_u_char) store->pos_system;
-		line[29] = (mb_u_char) store->pos_input_size;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM2_POS_HEADER_SIZE;j++)
-		    checksum += uchar_ptr[j];
-
-		/* write out data */
-		write_len = fwrite(line,1,EM2_POS_HEADER_SIZE,mbfp);
-		if (write_len != EM2_POS_HEADER_SIZE)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* output original ascii nav data */
-	if (status == MB_SUCCESS)
-		{
-		write_size = store->pos_input_size
-				- (store->pos_input_size % 2) + 1;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) store->pos_input;
-		for (j=0;j<write_size;j++)
-		    checksum += uchar_ptr[j];
-
-		/* write out data */
-		write_len = fwrite(store->pos_input,1,write_size,mbfp);
-		if (write_len != write_size)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* output end of record */
-	if (status == MB_SUCCESS)
-		{
-		line[1] = 0x03;
-
-		/* set checksum */
-		mb_put_binary_short(swap, (unsigned short) checksum, (void *) &line[2]);
-
-		/* write out data */
-		write_len = fwrite(&line[1],1,3,mbfp);
-		if (write_len != 3)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em300mba_wr_svp(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store, int *error)
-{
-	char	*function_name = "mbr_em300mba_wr_svp";
-	int	status = MB_SUCCESS;
-	char	line[EM2_SVP2_HEADER_SIZE];
-	short	label;
-	int	write_len;
-	int	write_size;
-	unsigned short checksum;
-	mb_u_char   *uchar_ptr;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       svp_use_date:    %d\n",store->svp_use_date);
-		fprintf(stderr,"dbg5       svp_use_msec:    %d\n",store->svp_use_msec);
-		fprintf(stderr,"dbg5       svp_count:       %d\n",store->svp_count);
-		fprintf(stderr,"dbg5       svp_serial:      %d\n",store->svp_serial);
-		fprintf(stderr,"dbg5       svp_origin_date: %d\n",store->svp_origin_date);
-		fprintf(stderr,"dbg5       svp_origin_msec: %d\n",store->svp_origin_msec);
-		fprintf(stderr,"dbg5       svp_num:         %d\n",store->svp_num);
-		fprintf(stderr,"dbg5       svp_depth_res:   %d\n",store->svp_depth_res);
-		fprintf(stderr,"dbg5       count    depth    speed\n");
-		fprintf(stderr,"dbg5       -----------------------\n");
-		for (i=0;i<store->svp_num;i++)
-			fprintf(stderr,"dbg5        %d   %d  %d\n",
-				i, store->svp_depth[i], store->svp_vel[i]);
-		}
-
-	/* zero checksum */
-	checksum = 0;
-
-	/* write the record size */
-	mb_put_binary_int(swap, (int) (EM2_SVP2_HEADER_SIZE
-			+ EM2_SVP2_SLICE_SIZE * store->svp_num + 8), (void *) &write_size);
-	write_len = fwrite(&write_size,1,4,mbfp);
-	if (write_len != 4)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	else
-		status = MB_SUCCESS;
-
-	/* write the record label */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_short(swap, (short) (EM2_SVP2), (void *) &label);
-		write_len = fwrite(&label,1,2,mbfp);
-		if (write_len != 2)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_WRITE_FAIL;
-			}
-		else
-			status = MB_SUCCESS;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[1];
-		}
-
-	/* write the sonar id */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_short(swap, (short) (store->sonar), (void *) &label);
-		write_len = fwrite(&label,1,2,mbfp);
-		if (write_len != 2)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_WRITE_FAIL;
-			}
-		else
-			status = MB_SUCCESS;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[0];
-		checksum += uchar_ptr[1];
-		}
-
-	/* output binary header data */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_int(swap, (int) store->svp_use_date, (void *) &line[0]);
-		mb_put_binary_int(swap, (int) store->svp_use_msec, (void *) &line[4]);
-		mb_put_binary_short(swap, (unsigned short) store->svp_count, (void *) &line[8]);
-		mb_put_binary_short(swap, (unsigned short) store->svp_serial, (void *) &line[10]);
-		mb_put_binary_int(swap, (int) store->svp_origin_date, (void *) &line[12]);
-		mb_put_binary_int(swap, (int) store->svp_origin_msec, (void *) &line[16]);
-		mb_put_binary_short(swap, (unsigned short) store->svp_num, (void *) &line[20]);
-		mb_put_binary_short(swap, (unsigned short) store->svp_depth_res, (void *) &line[22]);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM2_SVP2_HEADER_SIZE;j++)
-		    checksum += uchar_ptr[j];
-
-		/* write out data */
-		write_len = fwrite(line,1,EM2_SVP2_HEADER_SIZE,mbfp);
-		if (write_len != EM2_SVP2_HEADER_SIZE)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* output binary svp data */
-	if (status == MB_SUCCESS)
-	    for (i=0;i<store->svp_num;i++)
-		{
-		mb_put_binary_int(swap, (int) store->svp_depth[i], (void *) &line[0]);
-		mb_put_binary_int(swap, (int) store->svp_vel[i], (void *) &line[4]);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM2_SVP2_SLICE_SIZE;j++)
-		    checksum += uchar_ptr[j];
-
-		/* write out data */
-		write_len = fwrite(line,1,EM2_SVP2_SLICE_SIZE,mbfp);
-		if (write_len != EM2_SVP2_SLICE_SIZE)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* output end of record */
-	if (status == MB_SUCCESS)
-		{
-		line[0] = '\0';
-		line[1] = 0x03;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		checksum += uchar_ptr[0];
-
-		/* set checksum */
-		mb_put_binary_short(swap, (unsigned short) checksum, (void *) &line[2]);
-
-		/* write out data */
-		write_len = fwrite(line,1,4,mbfp);
-		if (write_len != 4)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em300mba_wr_bath(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store, int head, int *error)
-{
-	char	*function_name = "mbr_em300mba_wr_bath";
-	int	status = MB_SUCCESS;
-	struct mbsys_simrad2_ping_struct *ping;
-	char	line[EM2_BATH_MBA_HEADER_SIZE];
-	short	label;
-	int	write_len;
-	int	write_size;
-	unsigned short checksum;
-	mb_u_char   *uchar_ptr;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		fprintf(stderr,"dbg2       head:       %d\n",head);
-		}
-
-	/* get storage structure */
-	if (store->sonar == MBSYS_SIMRAD2_EM3002
-			&& store->numberheads == 2 && head == 1)
-		ping = (struct mbsys_simrad2_ping_struct *) store->ping2;
-	else
-		ping = (struct mbsys_simrad2_ping_struct *) store->ping;
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       png_date:        %d\n",ping->png_date);
-		fprintf(stderr,"dbg5       png_msec:        %d\n",ping->png_msec);
-		fprintf(stderr,"dbg5       png_count:       %d\n",ping->png_count);
-		fprintf(stderr,"dbg5       png_serial:      %d\n",ping->png_serial);
-		fprintf(stderr,"dbg5       png_latitude:    %d\n",ping->png_latitude);
-		fprintf(stderr,"dbg5       png_longitude:   %d\n",ping->png_longitude);
-		fprintf(stderr,"dbg5       png_speed:       %d\n",ping->png_speed);
-		fprintf(stderr,"dbg5       png_heading:     %d\n",ping->png_heading);
-		fprintf(stderr,"dbg5       png_ssv:         %d\n",ping->png_ssv);
-		fprintf(stderr,"dbg5       png_xducer_depth:      %d\n",ping->png_xducer_depth);
-		fprintf(stderr,"dbg5       png_offset_multiplier: %d\n",ping->png_offset_multiplier);
-		fprintf(stderr,"dbg5       png_nbeams_max:        %d\n",ping->png_nbeams_max);
-		fprintf(stderr,"dbg5       png_nbeams:            %d\n",ping->png_nbeams);
-		fprintf(stderr,"dbg5       png_depth_res:         %d\n",ping->png_depth_res);
-		fprintf(stderr,"dbg5       png_distance_res:      %d\n",ping->png_distance_res);
-		fprintf(stderr,"dbg5       png_sample_rate:       %d\n",ping->png_sample_rate);
-		fprintf(stderr,"dbg5       cnt  depth xtrack ltrack dprsn   azi   rng  qual wnd  amp num flag\n");
-		fprintf(stderr,"dbg5       ------------------------------------------------------------\n");
-		for (i=0;i<ping->png_nbeams;i++)
-			fprintf(stderr,"dbg5       %3d %6d %6d %6d %5d %5d %5d %4d %3d %4d %3d %4d\n",
-				i, ping->png_depth[i], ping->png_acrosstrack[i],
-				ping->png_alongtrack[i], ping->png_depression[i],
-				ping->png_azimuth[i], ping->png_range[i],
-				ping->png_quality[i], ping->png_window[i],
-				ping->png_amp[i], ping->png_beam_num[i],
-				ping->png_beamflag[i]);
-		}
-
-	/* zero checksum */
-	checksum = 0;
-
-	/* write the record size */
-	mb_put_binary_int(swap, (int) (EM2_BATH_MBA_HEADER_SIZE
-			+ EM2_BATH_MBA_BEAM_SIZE * ping->png_nbeams + 8), (void *) &write_size);
-	write_len = fwrite(&write_size,1,4,mbfp);
-	if (write_len != 4)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	else
-		status = MB_SUCCESS;
-
-	/* write the record label */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_short(swap, (short) (EM2_BATH_MBA), (void *) &label);
-		write_len = fwrite(&label,1,2,mbfp);
-		if (write_len != 2)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_WRITE_FAIL;
-			}
-		else
-			status = MB_SUCCESS;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[1];
-		}
-
-	/* write the sonar id */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_short(swap, (short) (store->sonar), (void *) &label);
-		write_len = fwrite(&label,1,2,mbfp);
-		if (write_len != 2)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_WRITE_FAIL;
-			}
-		else
-			status = MB_SUCCESS;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[0];
-		checksum += uchar_ptr[1];
-		}
-
-	/* output binary header data */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_int(swap, (int) ping->png_date, (void *) &line[0]);
-		mb_put_binary_int(swap, (int) ping->png_msec, (void *) &line[4]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_count, (void *) &line[8]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_serial, (void *) &line[10]);
-		mb_put_binary_int(swap, (int) ping->png_latitude, (void *) &line[12]);
-		mb_put_binary_int(swap, (int) ping->png_longitude, (void *) &line[16]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_speed, (void *) &line[20]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_heading, (void *) &line[22]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_ssv, (void *) &line[24]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_xducer_depth, (void *) &line[26]);
-		line[28] = (mb_u_char) ping->png_nbeams_max;
-		line[29] = (mb_u_char) ping->png_nbeams;
-		line[30] = (mb_u_char) ping->png_depth_res;
-		line[31] = (mb_u_char) ping->png_distance_res;
-		mb_put_binary_short(swap, (unsigned short) ping->png_sample_rate, (void *) &line[32]);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM2_BATH_MBA_HEADER_SIZE;j++)
-		    checksum += uchar_ptr[j];
-
-		/* write out data */
-		write_len = fwrite(line,1,EM2_BATH_MBA_HEADER_SIZE,mbfp);
-		if (write_len != EM2_BATH_MBA_HEADER_SIZE)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* output binary beam data */
-	if (status == MB_SUCCESS)
-	    for (i=0;i<ping->png_nbeams;i++)
-		{
-		if (store->sonar == MBSYS_SIMRAD2_EM120
-				|| store->sonar == MBSYS_SIMRAD2_EM300
-				|| store->sonar == MBSYS_SIMRAD2_EM12S
-				|| store->sonar == MBSYS_SIMRAD2_EM12D
-				|| store->sonar == MBSYS_SIMRAD2_EM121
-				|| store->sonar == MBSYS_SIMRAD2_EM100
-				|| store->sonar == MBSYS_SIMRAD2_EM1000)
-		    mb_put_binary_short(swap, (unsigned short) ping->png_depth[i], (void *) &line[0]);
-		else
-		    mb_put_binary_short(swap, (short) ping->png_depth[i], (void *) &line[0]);
-		mb_put_binary_short(swap, (short) ping->png_acrosstrack[i], (void *) &line[2]);
-		mb_put_binary_short(swap, (short) ping->png_alongtrack[i], (void *) &line[4]);
-		mb_put_binary_short(swap, (short) ping->png_depression[i], (void *) &line[6]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_azimuth[i], (void *) &line[8]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_range[i], (void *) &line[10]);
-		line[12] = (mb_u_char) ping->png_quality[i];
-		line[13] = (mb_u_char) ping->png_window[i];
-		mb_put_binary_short(swap, (short) ping->png_amp[i], (void *) &line[14]);
-		line[16] = (mb_u_char) ping->png_beam_num[i];
-		line[17] = (char) ping->png_beamflag[i];
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM2_BATH_MBA_BEAM_SIZE;j++)
-		    checksum += uchar_ptr[j];
-
-		/* write out data */
-		write_len = fwrite(line,1,EM2_BATH_MBA_BEAM_SIZE,mbfp);
-		if (write_len != EM2_BATH_MBA_BEAM_SIZE)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* output end of record */
-	if (status == MB_SUCCESS)
-		{
-		line[0] = (mb_s_char) ping->png_offset_multiplier;
-		line[1] = 0x03;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		checksum += uchar_ptr[0];
-
-		/* set checksum */
-		mb_put_binary_short(swap, (unsigned short) checksum, (void *) &line[2]);
-
-		/* write out data */
-		write_len = fwrite(line,1,4,mbfp);
-		if (write_len != 4)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em300mba_wr_rawbeam(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store, int *error)
-{
-	char	*function_name = "mbr_em300mba_wr_rawbeam";
-	int	status = MB_SUCCESS;
-	struct mbsys_simrad2_ping_struct *ping;
-	char	line[EM2_RAWBEAM_HEADER_SIZE];
-	short	label;
-	int	write_len;
-	int	write_size;
-	unsigned short checksum;
-	mb_u_char   *uchar_ptr;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		}
-
-	/* get storage structure */
-	ping = (struct mbsys_simrad2_ping_struct *) store->ping;
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       png_date:        %d\n",ping->png_date);
-		fprintf(stderr,"dbg5       png_msec:        %d\n",ping->png_msec);
-		fprintf(stderr,"dbg5       png_count:       %d\n",ping->png_count);
-		fprintf(stderr,"dbg5       png_serial:      %d\n",ping->png_serial);
-		fprintf(stderr,"dbg5       png_nbeams_max:  %d\n",ping->png_nbeams_max);
-		fprintf(stderr,"dbg5       png_raw_nbeams:   %d\n",ping->png_raw_nbeams);
-		fprintf(stderr,"dbg5       png_raw_ssv:         %d\n",ping->png_raw_ssv);
-		fprintf(stderr,"dbg5       cnt  point   tilt   rng  amp num\n");
-		fprintf(stderr,"dbg5       ------------------------------------------------------------\n");
-		for (i=0;i<ping->png_raw_nbeams;i++)
-			fprintf(stderr,"dbg5       %3d %5d %5d %5d %3d %3d\n",
-				i, ping->png_raw_rxpointangle[i], ping->png_raw_rxtiltangle[i],
-				ping->png_raw_rxrange[i], ping->png_raw_rxamp[i],
-				ping->png_raw_rxbeam_num[i]);
-		}
-
-	/* zero checksum */
-	checksum = 0;
-
-	/* write the record size */
-	mb_put_binary_int(swap, (int) (EM2_RAWBEAM_HEADER_SIZE
-			+ EM2_RAWBEAM_BEAM_SIZE * ping->png_raw_nbeams + 8), (void *) &write_size);
-	write_len = fwrite(&write_size,1,4,mbfp);
-	if (write_len != 4)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	else
-		status = MB_SUCCESS;
-
-	/* write the record label */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_short(swap, (short) (EM2_RAWBEAM), (void *) &label);
-		write_len = fwrite(&label,1,2,mbfp);
-		if (write_len != 2)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_WRITE_FAIL;
-			}
-		else
-			status = MB_SUCCESS;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[1];
-		}
-
-	/* write the sonar id */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_short(swap, (short) (store->sonar), (void *) &label);
-		write_len = fwrite(&label,1,2,mbfp);
-		if (write_len != 2)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_WRITE_FAIL;
-			}
-		else
-			status = MB_SUCCESS;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[0];
-		checksum += uchar_ptr[1];
-		}
-
-	/* output binary header data */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_int(swap, (int) ping->png_date, (void *) &line[0]);
-		mb_put_binary_int(swap, (int) ping->png_msec, (void *) &line[4]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_count, (void *) &line[8]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_serial, (void *) &line[10]);
-		line[12] = (mb_u_char) ping->png_nbeams_max;
-		line[13] = (mb_u_char) ping->png_raw_nbeams;
-		mb_put_binary_short(swap, (unsigned short) ping->png_raw_ssv, (void *) &line[14]);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM2_RAWBEAM_HEADER_SIZE;j++)
-		    checksum += uchar_ptr[j];
-
-		/* write out data */
-		write_len = fwrite(line,1,EM2_RAWBEAM_HEADER_SIZE,mbfp);
-		if (write_len != EM2_RAWBEAM_HEADER_SIZE)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* output binary beam data */
-	if (status == MB_SUCCESS)
-	    for (i=0;i<ping->png_raw_nbeams;i++)
-		{
-		mb_put_binary_short(swap, (short) ping->png_raw_rxpointangle[i], (void *) &line[0]);
-		mb_put_binary_short(swap, (short) ping->png_raw_rxtiltangle[i], (void *) &line[2]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_raw_rxrange[i], (void *) &line[4]);
-		line[6] = (mb_s_char) ping->png_raw_rxamp[i];
-		line[7] = (mb_u_char) ping->png_raw_rxbeam_num[i];
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM2_RAWBEAM_BEAM_SIZE;j++)
-		    checksum += uchar_ptr[j];
-
-		/* write out data */
-		write_len = fwrite(line,1,EM2_RAWBEAM_BEAM_SIZE,mbfp);
-		if (write_len != EM2_RAWBEAM_BEAM_SIZE)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* output end of record */
-	if (status == MB_SUCCESS)
-		{
-		line[0] = 0;
-		line[1] = 0x03;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		checksum += uchar_ptr[0];
-
-		/* set checksum */
-		mb_put_binary_short(swap, (unsigned short) checksum, (void *) &line[2]);
-
-		/* write out data */
-		write_len = fwrite(line,1,4,mbfp);
-		if (write_len != 4)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em300mba_wr_rawbeam2(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store, int *error)
-{
-	char	*function_name = "mbr_em300mba_wr_rawbeam2";
-	int	status = MB_SUCCESS;
-	struct mbsys_simrad2_ping_struct *ping;
-	char	line[EM2_RAWBEAM2_HEADER_SIZE];
-	short	label;
-	int	write_len;
-	int	write_size;
-	unsigned short checksum;
-	mb_u_char   *uchar_ptr;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		}
-
-	/* get storage structure */
-	ping = (struct mbsys_simrad2_ping_struct *) store->ping;
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       png_raw_date:                %d\n",ping->png_raw_date);
-		fprintf(stderr,"dbg5       png_raw_msec:                %d\n",ping->png_raw_msec);
-		fprintf(stderr,"dbg5       png_raw_count:               %d\n",ping->png_raw_count);
-		fprintf(stderr,"dbg5       png_raw_serial:              %d\n",ping->png_raw_serial);
-		fprintf(stderr,"dbg5       png_raw_heading:             %d\n",ping->png_raw_heading);
-		fprintf(stderr,"dbg5       png_raw_ssv:                 %d\n",ping->png_raw_ssv);
-		fprintf(stderr,"dbg5       png_raw_xducer_depth:        %d\n",ping->png_raw_xducer_depth);
-		fprintf(stderr,"dbg5       png_raw_nbeams_max:          %d\n",ping->png_raw_nbeams_max);
-		fprintf(stderr,"dbg5       png_raw_nbeams:              %d\n",ping->png_raw_nbeams);
-		fprintf(stderr,"dbg5       png_raw_depth_res:           %d\n",ping->png_raw_depth_res);
-		fprintf(stderr,"dbg5       png_raw_distance_res:        %d\n",ping->png_raw_distance_res);
-		fprintf(stderr,"dbg5       png_raw_sample_rate:         %d\n",ping->png_raw_sample_rate);
-		fprintf(stderr,"dbg5       png_raw_status:              %d\n",ping->png_raw_status);
-		fprintf(stderr,"dbg5       png_raw_rangenormal:         %d\n",ping->png_raw_rangenormal);
-		fprintf(stderr,"dbg5       png_raw_normalbackscatter:   %d\n",ping->png_raw_normalbackscatter);
-		fprintf(stderr,"dbg5       png_raw_obliquebackscatter:  %d\n",ping->png_raw_obliquebackscatter);
-		fprintf(stderr,"dbg5       png_raw_fixedgain:           %d\n",ping->png_raw_fixedgain);
-		fprintf(stderr,"dbg5       png_raw_txpower:             %d\n",ping->png_raw_txpower);
-		fprintf(stderr,"dbg5       png_raw_mode:                %d\n",ping->png_raw_mode);
-		fprintf(stderr,"dbg5       png_raw_coverage:            %d\n",ping->png_raw_coverage);
-		fprintf(stderr,"dbg5       png_raw_yawstabheading:      %d\n",ping->png_raw_yawstabheading);
-		fprintf(stderr,"dbg5       png_raw_ntx:                 %d\n",ping->png_raw_ntx);
-		fprintf(stderr,"dbg5       ------------------------------------------------------------\n");
-		fprintf(stderr,"dbg5       transmit pulse values:\n");
-		fprintf(stderr,"dbg5       cnt lastbeam tiltangle heading roll pitch heave\n");
-		fprintf(stderr,"dbg5       ------------------------------------------------------------\n");
-		for (i=0;i<ping->png_raw_ntx;i++)
-			fprintf(stderr,"dbg5       %3d %3d %4d %5d %4d %4d %4d\n",
-				i, ping->png_raw_txlastbeam[i], ping->png_raw_txtiltangle[i],
-				ping->png_raw_txheading[i], ping->png_raw_txroll[i],
-				ping->png_raw_txpitch[i], ping->png_raw_txheave[i]);
-		fprintf(stderr,"dbg5       ------------------------------------------------------------\n");
-		fprintf(stderr,"dbg5       beam values:\n");
-		fprintf(stderr,"dbg5       cnt range quality window amp beam angle heading roll pitch heave\n");
-		fprintf(stderr,"dbg5       ------------------------------------------------------------\n");
-		for (i=0;i<ping->png_raw_nbeams;i++)
-			fprintf(stderr,"dbg5       %3d %5d %3d %3d %4d %3d %5d %5d %4d %4d %4d\n",
-				i, ping->png_raw_rxrange[i], ping->png_raw_rxquality[i],
-				ping->png_raw_rxwindow[i], ping->png_raw_rxamp[i],
-				ping->png_raw_rxbeam_num[i], ping->png_raw_rxpointangle[i],
-				ping->png_raw_rxheading[i], ping->png_raw_rxroll[i],
-				ping->png_raw_rxpitch[i], ping->png_raw_rxheave[i]);
-		}
-
-	/* zero checksum */
-	checksum = 0;
-
-	/* write the record size */
-	mb_put_binary_int(swap, (int) (EM2_RAWBEAM2_HEADER_SIZE
-			+ EM2_RAWBEAM2_TX_SIZE * ping->png_raw_ntx
-			+ EM2_RAWBEAM2_BEAM_SIZE * ping->png_raw_nbeams + 8), (void *) &write_size);
-	write_len = fwrite(&write_size,1,4,mbfp);
-	if (write_len != 4)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	else
-		status = MB_SUCCESS;
-
-	/* write the record label */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_short(swap, (short) (EM2_RAWBEAM2), (void *) &label);
-		write_len = fwrite(&label,1,2,mbfp);
-		if (write_len != 2)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_WRITE_FAIL;
-			}
-		else
-			status = MB_SUCCESS;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[1];
-		}
-
-	/* write the sonar id */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_short(swap, (short) (store->sonar), (void *) &label);
-		write_len = fwrite(&label,1,2,mbfp);
-		if (write_len != 2)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_WRITE_FAIL;
-			}
-		else
-			status = MB_SUCCESS;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[0];
-		checksum += uchar_ptr[1];
-		}
-
-	/* output binary header data */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_int(swap, (int) ping->png_raw_date, (void *) &line[0]);
-		mb_put_binary_int(swap, (int) ping->png_raw_msec, (void *) &line[4]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_raw_count, (void *) &line[8]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_raw_serial, (void *) &line[10]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_raw_heading, (void *) &line[12]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_raw_ssv, (void *) &line[14]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_raw_xducer_depth, (void *) &line[16]);
-		line[18] = (mb_u_char) ping->png_raw_nbeams_max;
-		line[19] = (mb_u_char) ping->png_raw_nbeams;
-		line[20] = (mb_u_char) ping->png_raw_depth_res;
-		line[21] = (mb_u_char) ping->png_raw_distance_res;
-		mb_put_binary_short(swap, (unsigned short) ping->png_raw_sample_rate, (void *) &line[22]);
-		mb_put_binary_int(swap, (int) ping->png_raw_status, (void *) &line[24]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_raw_rangenormal, (void *) &line[28]);
-		line[30] = (mb_s_char) ping->png_raw_normalbackscatter;
-		line[31] = (mb_s_char) ping->png_raw_obliquebackscatter;
-		line[32] = (mb_u_char) ping->png_raw_fixedgain;
-		line[33] = (mb_s_char) ping->png_raw_txpower;
-		line[34] = (mb_u_char) ping->png_raw_mode;
-		line[35] = (mb_u_char) ping->png_raw_coverage;
-		mb_put_binary_short(swap, (unsigned short) ping->png_raw_yawstabheading, (void *) &line[36]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_raw_ntx, (void *) &line[38]);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM2_RAWBEAM2_HEADER_SIZE;j++)
-		    checksum += uchar_ptr[j];
-
-		/* write out data */
-		write_len = fwrite(line,1,EM2_RAWBEAM2_HEADER_SIZE,mbfp);
-		if (write_len != EM2_RAWBEAM2_HEADER_SIZE)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* output binary tx data */
-	if (status == MB_SUCCESS)
-	    for (i=0;i<ping->png_raw_ntx;i++)
-		{
-		mb_put_binary_short(swap, (unsigned short) ping->png_raw_txlastbeam[i], (void *) &line[0]);
-		mb_put_binary_short(swap, (short) ping->png_raw_txtiltangle[i], (void *) &line[2]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_raw_txheading[i], (void *) &line[4]);
-		mb_put_binary_short(swap, (short) ping->png_raw_txroll[i], (void *) &line[6]);
-		mb_put_binary_short(swap, (short) ping->png_raw_txpitch[i], (void *) &line[8]);
-		mb_put_binary_short(swap, (short) ping->png_raw_txheave[i], (void *) &line[10]);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM2_RAWBEAM2_TX_SIZE;j++)
-		    checksum += uchar_ptr[j];
-
-		/* write out data */
-		write_len = fwrite(line,1,EM2_RAWBEAM2_TX_SIZE,mbfp);
-		if (write_len != EM2_RAWBEAM2_TX_SIZE)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* output binary beam data */
-	if (status == MB_SUCCESS)
-	    for (i=0;i<ping->png_raw_nbeams;i++)
-		{
-		mb_put_binary_short(swap, (unsigned short) ping->png_raw_rxrange[i], (void *) &line[0]);
-		line[2] = (mb_u_char) ping->png_raw_rxquality[i];
-		line[3] = (mb_u_char) ping->png_raw_rxwindow[i];
-		line[4] = (mb_s_char) ping->png_raw_rxamp[i];
-		line[5] = (mb_u_char) ping->png_raw_rxbeam_num[i];
-		mb_put_binary_short(swap, (short) ping->png_raw_rxpointangle[i], (void *) &line[6]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_raw_rxheading[i], (void *) &line[8]);
-		mb_put_binary_short(swap, (short) ping->png_raw_rxroll[i], (void *) &line[10]);
-		mb_put_binary_short(swap, (short) ping->png_raw_rxpitch[i], (void *) &line[12]);
-		mb_put_binary_short(swap, (short) ping->png_raw_rxheave[i], (void *) &line[14]);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM2_RAWBEAM2_BEAM_SIZE;j++)
-		    checksum += uchar_ptr[j];
-
-		/* write out data */
-		write_len = fwrite(line,1,EM2_RAWBEAM2_BEAM_SIZE,mbfp);
-		if (write_len != EM2_RAWBEAM2_BEAM_SIZE)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* output end of record */
-	if (status == MB_SUCCESS)
-		{
-		line[0] = 0;
-		line[1] = 0x03;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		checksum += uchar_ptr[0];
-
-		/* set checksum */
-		mb_put_binary_short(swap, (unsigned short) checksum, (void *) &line[2]);
-
-		/* write out data */
-		write_len = fwrite(line,1,4,mbfp);
-		if (write_len != 4)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em300mba_wr_rawbeam3(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store, int head, int *error)
-{
-	char	*function_name = "mbr_em300mba_wr_rawbeam3";
-	int	status = MB_SUCCESS;
-	struct mbsys_simrad2_ping_struct *ping;
-	char	line[EM2_RAWBEAM3_HEADER_SIZE];
-	short	label;
-	int	write_len;
-	int	write_size;
-	unsigned short checksum;
-	mb_u_char   *uchar_ptr;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		fprintf(stderr,"dbg2       head:       %d\n",head);
-		}
-
-	/* get storage structure */
-	if (store->sonar == MBSYS_SIMRAD2_EM3002
-			&& store->numberheads == 2 && head == 1)
-		ping = (struct mbsys_simrad2_ping_struct *) store->ping2;
-	else
-		ping = (struct mbsys_simrad2_ping_struct *) store->ping;
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       png_raw3_date:                %d\n",ping->png_raw3_date);
-		fprintf(stderr,"dbg5       png_raw3_msec:                %d\n",ping->png_raw3_msec);
-		fprintf(stderr,"dbg5       png_raw3_count:               %d\n",ping->png_raw3_count);
-		fprintf(stderr,"dbg5       png_raw3_serial:              %d\n",ping->png_raw3_serial);
-		fprintf(stderr,"dbg5       png_raw3_ntx:                 %d\n",ping->png_raw3_ntx);
-		fprintf(stderr,"dbg5       png_raw3_nbeams:              %d\n",ping->png_raw3_nbeams);
-		fprintf(stderr,"dbg5       png_raw3_sample_rate:         %d\n",ping->png_raw3_sample_rate);
-		fprintf(stderr,"dbg5       png_raw3_xducer_depth:        %d\n",ping->png_raw3_xducer_depth);
-		fprintf(stderr,"dbg5       png_raw3_ssv:                 %d\n",ping->png_raw3_ssv);
-		fprintf(stderr,"dbg5       png_raw3_nbeams_max:          %d\n",ping->png_raw3_nbeams_max);
-		fprintf(stderr,"dbg5       ------------------------------------------------------------\n");
-		fprintf(stderr,"dbg5       transmit pulse values:\n");
-		fprintf(stderr,"dbg5       tiltangle focus length offset center bandwidth waveform sector\n");
-		fprintf(stderr,"dbg5       ------------------------------------------------------------\n");
-		for (i=0;i<ping->png_raw3_ntx;i++)
-			fprintf(stderr,"dbg5       %3d %5d %5d %6d %4d %4d %4d %4d %4d\n",
-				i, ping->png_raw3_txtiltangle[i],
-				ping->png_raw3_txfocus[i], ping->png_raw3_txsignallength[i],
-				ping->png_raw3_txoffset[i], ping->png_raw3_txcenter[i],
-				ping->png_raw3_txbandwidth[i], ping->png_raw3_txwaveform[i],
-				ping->png_raw3_txsector[i]);
-		fprintf(stderr,"dbg5       ------------------------------------------------------------\n");
-		fprintf(stderr,"dbg5       beam values:\n");
-		fprintf(stderr,"dbg5       angle range sector amp quality window beam\n");
-		fprintf(stderr,"dbg5       ------------------------------------------------------------\n");
-		for (i=0;i<ping->png_raw3_nbeams;i++)
-			fprintf(stderr,"dbg5       %3d %5d %3d %3d %4d %3d %5d %5d\n",
-				i, ping->png_raw3_rxpointangle[i], ping->png_raw3_rxrange[i],
-				ping->png_raw3_rxsector[i], ping->png_raw3_rxamp[i],
-				ping->png_raw3_rxquality[i], ping->png_raw3_rxwindow[i],
-				ping->png_raw3_rxbeam_num[i]);
-		}
-
-	/* zero checksum */
-	checksum = 0;
-
-	/* write the record size */
-	mb_put_binary_int(swap, (int) (EM2_RAWBEAM3_HEADER_SIZE
-			+ EM2_RAWBEAM3_TX_SIZE * ping->png_raw3_ntx
-			+ EM2_RAWBEAM3_BEAM_SIZE * ping->png_raw3_nbeams + 8), (void *) &write_size);
-	write_len = fwrite(&write_size,1,4,mbfp);
-	if (write_len != 4)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	else
-		status = MB_SUCCESS;
-
-	/* write the record label */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_short(swap, (short) (EM2_RAWBEAM3), (void *) &label);
-		write_len = fwrite(&label,1,2,mbfp);
-		if (write_len != 2)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_WRITE_FAIL;
-			}
-		else
-			status = MB_SUCCESS;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[1];
-		}
-
-	/* write the sonar id */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_short(swap, (short) (store->sonar), (void *) &label);
-		write_len = fwrite(&label,1,2,mbfp);
-		if (write_len != 2)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_WRITE_FAIL;
-			}
-		else
-			status = MB_SUCCESS;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[0];
-		checksum += uchar_ptr[1];
-		}
-
-	/* output binary header data */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_int(swap, (int) ping->png_raw3_date, (void *) &line[0]);
-		mb_put_binary_int(swap, (int) ping->png_raw3_msec, (void *) &line[4]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_raw3_count, (void *) &line[8]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_raw3_serial, (void *) &line[10]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_raw3_ntx, (void *) &line[12]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_raw3_nbeams, (void *) &line[14]);
-		mb_put_binary_int(swap, (unsigned int) ping->png_raw3_sample_rate, (void *) &line[16]);
-		mb_put_binary_int(swap, (int) ping->png_raw3_xducer_depth, (void *) &line[20]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_raw3_ssv, (void *) &line[24]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_raw3_nbeams_max, (void *) &line[26]);
-		mb_put_binary_short(swap, (unsigned short) 0, (void *) &line[28]);
-		mb_put_binary_short(swap, (unsigned short) 0, (void *) &line[30]);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM2_RAWBEAM3_HEADER_SIZE;j++)
-		    checksum += uchar_ptr[j];
-
-		/* write out data */
-		write_len = fwrite(line,1,EM2_RAWBEAM3_HEADER_SIZE,mbfp);
-		if (write_len != EM2_RAWBEAM3_HEADER_SIZE)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* output binary tx data */
-	if (status == MB_SUCCESS)
-	    for (i=0;i<ping->png_raw3_ntx;i++)
-		{
-		mb_put_binary_short(swap, (short) ping->png_raw3_txtiltangle[i], (void *) &line[0]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_raw3_txfocus[i], (void *) &line[2]);
-		mb_put_binary_int(swap, (int) ping->png_raw3_txsignallength[i], (void *) &line[4]);
-		mb_put_binary_int(swap, (int) ping->png_raw3_txoffset[i], (void *) &line[8]);
-		mb_put_binary_int(swap, (int) ping->png_raw3_txcenter[i], (void *) &line[12]);
-		mb_put_binary_short(swap, (short) ping->png_raw3_txbandwidth[i], (void *) &line[16]);
-		line[18] = (mb_u_char) ping->png_raw3_txwaveform[i];
-		line[19] = (mb_u_char) ping->png_raw3_txsector[i];
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM2_RAWBEAM3_TX_SIZE;j++)
-		    checksum += uchar_ptr[j];
-
-		/* write out data */
-		write_len = fwrite(line,1,EM2_RAWBEAM3_TX_SIZE,mbfp);
-		if (write_len != EM2_RAWBEAM3_TX_SIZE)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* output binary beam data */
-	if (status == MB_SUCCESS)
-	    for (i=0;i<ping->png_raw3_nbeams;i++)
-		{
-		mb_put_binary_short(swap, (short) ping->png_raw3_rxpointangle[i], (void *) &line[0]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_raw3_rxrange[i], (void *) &line[2]);
-		line[4] = (mb_u_char) ping->png_raw3_rxsector[i];
-		line[5] = (mb_s_char) ping->png_raw3_rxamp[i];
-		line[6] = (mb_u_char) ping->png_raw3_rxquality[i];
-		line[7] = (mb_u_char) ping->png_raw3_rxwindow[i];
-		mb_put_binary_short(swap, (short) ping->png_raw3_rxbeam_num[i], (void *) &line[8]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_raw3_rxspare[i], (void *) &line[10]);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM2_RAWBEAM3_BEAM_SIZE;j++)
-		    checksum += uchar_ptr[j];
-
-		/* write out data */
-		write_len = fwrite(line,1,EM2_RAWBEAM3_BEAM_SIZE,mbfp);
-		if (write_len != EM2_RAWBEAM3_BEAM_SIZE)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* output end of record */
-	if (status == MB_SUCCESS)
-		{
-		line[0] = 0;
-		line[1] = 0x03;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		checksum += uchar_ptr[0];
-
-		/* set checksum */
-		mb_put_binary_short(swap, (unsigned short) checksum, (void *) &line[2]);
-
-		/* write out data */
-		write_len = fwrite(line,1,4,mbfp);
-		if (write_len != 4)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em300mba_wr_ss(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store, int head, int *error)
-{
-	char	*function_name = "mbr_em300mba_wr_ss";
-	int	status = MB_SUCCESS;
-	struct mbsys_simrad2_ping_struct *ping;
-	char	line[2 * MBSYS_SIMRAD2_BUFFER_SIZE];
-	short	label;
-	int	write_len;
-	int	write_size;
-	unsigned short checksum;
-	mb_u_char   *uchar_ptr;
-	int	offset;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		fprintf(stderr,"dbg2       head:       %d\n",head);
-		}
-
-	/* get storage structure */
-	if (store->sonar == MBSYS_SIMRAD2_EM3002
-			&& store->numberheads == 2 && head == 1)
-		ping = (struct mbsys_simrad2_ping_struct *) store->ping2;
-	else
-		ping = (struct mbsys_simrad2_ping_struct *) store->ping;
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       png_ss_date:     %d\n",ping->png_ss_date);
-		fprintf(stderr,"dbg5       png_ss_msec:     %d\n",ping->png_ss_msec);
-		fprintf(stderr,"dbg5       png_ss_count:    %d\n",ping->png_ss_count);
-		fprintf(stderr,"dbg5       png_ss_serial:   %d\n",ping->png_ss_serial);
-		fprintf(stderr,"dbg5       png_max_range:   %d\n",ping->png_max_range);
-		fprintf(stderr,"dbg5       png_r_zero:      %d\n",ping->png_r_zero);
-		fprintf(stderr,"dbg5       png_r_zero_corr: %d\n",ping->png_r_zero_corr);
-		fprintf(stderr,"dbg5       png_tvg_start:   %d\n",ping->png_tvg_start);
-		fprintf(stderr,"dbg5       png_tvg_stop:    %d\n",ping->png_tvg_stop);
-		fprintf(stderr,"dbg5       png_bsn:         %d\n",ping->png_bsn);
-		fprintf(stderr,"dbg5       png_bso:         %d\n",ping->png_bso);
-		fprintf(stderr,"dbg5       png_tx:          %d\n",ping->png_tx);
-		fprintf(stderr,"dbg5       png_tvg_crossover: %d\n",ping->png_tvg_crossover);
-		fprintf(stderr,"dbg5       png_nbeams_ss:     %d\n",ping->png_nbeams_ss);
-		fprintf(stderr,"dbg5       png_npixels:       %d\n",ping->png_npixels);
-		fprintf(stderr,"dbg5       cnt  index sort samples start center\n");
-		fprintf(stderr,"dbg5       --------------------------------------------------\n");
-		for (i=0;i<ping->png_nbeams_ss;i++)
-			fprintf(stderr,"dbg5        %4d %3d %2d %4d %4d %4d\n",
-				i, ping->png_beam_index[i], ping->png_sort_direction[i],
-				ping->png_beam_samples[i], ping->png_start_sample[i],
-				ping->png_center_sample[i]);
-		fprintf(stderr,"dbg5       cnt  ss\n");
-		fprintf(stderr,"dbg5       --------------------------------------------------\n");
-		for (i=0;i<ping->png_npixels;i++)
-			fprintf(stderr,"dbg5        %d %d\n",
-				i, ping->png_ssraw[i]);
-		fprintf(stderr,"dbg5       png_pixel_size:    %d\n",ping->png_pixel_size);
-		fprintf(stderr,"dbg5       png_pixels_ss:     %d\n",ping->png_pixels_ss);
-		fprintf(stderr,"dbg5       pixel  ss  ltrack\n");
-		fprintf(stderr,"dbg5       --------------------------------------------------\n");
-		for (i=0;i<MBSYS_SIMRAD2_MAXPIXELS;i++)
-			fprintf(stderr,"dbg5        %4d %6d %6d\n",
-				i, ping->png_ss[i], ping->png_ssalongtrack[i]);
-		}
-
-	/* zero checksum */
-	checksum = 0;
-
-	/* write the record size */
-	mb_put_binary_int(swap, (int) (EM2_SS_MBA_HEADER_SIZE
-			+ EM2_SS_MBA_BEAM_SIZE * ping->png_nbeams_ss
-			+ 2 * sizeof(short) * ping->png_pixels_ss
-			+ ping->png_npixels - (ping->png_npixels % 2) + 8), (void *) &write_size);
-	write_len = fwrite(&write_size,1,4,mbfp);
-	if (write_len != 4)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	else
-		status = MB_SUCCESS;
-
-	/* write the record label */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_short(swap, (short) (EM2_SS_MBA), (void *) &label);
-		write_len = fwrite(&label,1,2,mbfp);
-		if (write_len != 2)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_WRITE_FAIL;
-			}
-		else
-			status = MB_SUCCESS;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[1];
-		}
-
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_short(swap, (short) (store->sonar), (void *) &label);
-		write_len = fwrite(&label,1,2,mbfp);
-		if (write_len != 2)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_WRITE_FAIL;
-			}
-		else
-			status = MB_SUCCESS;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[0];
-		checksum += uchar_ptr[1];
-		}
-
-	/* output binary header data */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_int(swap, (int) ping->png_ss_date, (void *) &line[0]);
-		mb_put_binary_int(swap, (int) ping->png_ss_msec, (void *) &line[4]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_ss_count, (void *) &line[8]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_ss_serial, (void *) &line[10]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_max_range, (void *) &line[12]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_r_zero, (void *) &line[14]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_r_zero_corr, (void *) &line[16]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_tvg_start, (void *) &line[18]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_tvg_stop, (void *) &line[20]);
-		line[22] = (mb_s_char) ping->png_bsn;
-		line[23] = (mb_s_char) ping->png_bso;
-		mb_put_binary_short(swap, (unsigned short) ping->png_tx, (void *) &line[24]);
-		line[26] = (mb_u_char) ping->png_tvg_crossover;
-		line[27] = (mb_u_char) ping->png_nbeams_ss;
-		mb_put_binary_short(swap, (short) ping->png_pixel_size, (void *) &line[28]);
-		mb_put_binary_short(swap, (short) ping->png_pixels_ss, (void *) &line[30]);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM2_SS_MBA_HEADER_SIZE;j++)
-		    checksum += uchar_ptr[j];
-
-		/* write out data */
-		write_len = fwrite(line,1,EM2_SS_MBA_HEADER_SIZE,mbfp);
-		if (write_len != EM2_SS_MBA_HEADER_SIZE)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* output binary beam data */
-	if (status == MB_SUCCESS)
-	    for (i=0;i<ping->png_nbeams_ss;i++)
-		{
-		line[0] = (mb_u_char) ping->png_beam_index[i];
-		line[1] = (mb_s_char) ping->png_sort_direction[i];
-		mb_put_binary_short(swap, (unsigned short) ping->png_beam_samples[i], (void *) &line[2]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_center_sample[i], (void *) &line[4]);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM2_SS_MBA_BEAM_SIZE;j++)
-		    checksum += uchar_ptr[j];
-
-		/* write out data */
-		write_len = fwrite(line,1,EM2_SS_MBA_BEAM_SIZE,mbfp);
-		if (write_len != EM2_SS_MBA_BEAM_SIZE)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* output sidescan data */
-	if (status == MB_SUCCESS)
-		{
-		write_size = ping->png_npixels + 1 - (ping->png_npixels % 2);
-		if (ping->png_npixels % 2 == 0)
-		    ping->png_ssraw[ping->png_npixels] = 0;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) ping->png_ssraw;
-		for (j=0;j<write_size;j++)
-		    checksum += uchar_ptr[j];
-
-		write_len = fwrite(ping->png_ssraw,1,write_size,mbfp);
-		if (write_len != write_size)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* output processed sidescan data */
-	if (status == MB_SUCCESS)
-	    {
-	    offset = (MBSYS_SIMRAD2_MAXPIXELS - ping->png_pixels_ss) / 2;
-	    for (i=0;i<ping->png_pixels_ss;i++)
-		{
-		mb_put_binary_short(swap, (short) ping->png_ss[offset+i], (void *) &line[2*i]);
-		}
-
-	    /* compute checksum */
-	    write_size = ping->png_pixels_ss * sizeof(short);
-	    uchar_ptr = (mb_u_char *) &line[0];
-	    for (j=0;j<write_size;j++)
-		checksum += uchar_ptr[j];
-
-	    /* write out data */
-	    write_len = fwrite(line,1,write_size,mbfp);
-	    if (write_len != write_size)
-		    {
-		    *error = MB_ERROR_WRITE_FAIL;
-		    status = MB_FAILURE;
-		    }
-	    else
-		    {
-		    *error = MB_ERROR_NO_ERROR;
-		    status = MB_SUCCESS;
-		    }
-	    }
-
-	/* output processed sidescan alongtrack data */
-	if (status == MB_SUCCESS)
-	    {
-	    offset = (MBSYS_SIMRAD2_MAXPIXELS - ping->png_pixels_ss) / 2;
-	    for (i=0;i<ping->png_pixels_ss;i++)
-		{
-		mb_put_binary_short(swap, (short) ping->png_ssalongtrack[offset+i], (void *) &line[2*i]);
-		}
-
-	    /* compute checksum */
-	    write_size = ping->png_pixels_ss * sizeof(short);
-	    uchar_ptr = (mb_u_char *) &line[0];
-	    for (j=0;j<write_size;j++)
-		checksum += uchar_ptr[j];
-
-	    /* write out data */
-	    write_len = fwrite(line,1,write_size,mbfp);
-	    if (write_len != write_size)
-		    {
-		    *error = MB_ERROR_WRITE_FAIL;
-		    status = MB_FAILURE;
-		    }
-	    else
-		    {
-		    *error = MB_ERROR_NO_ERROR;
-		    status = MB_SUCCESS;
-		    }
-	    }
-
-	/* output end of record */
-	if (status == MB_SUCCESS)
-		{
-		line[1] = 0x03;
-
-		/* set checksum */
-		mb_put_binary_short(swap, (unsigned short) checksum, (void *) &line[2]);
-
-		/* write out data */
-		write_len = fwrite(&line[1],1,3,mbfp);
-		if (write_len != 3)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em300mba_wr_wc(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store, int *error)
-{
-	char	*function_name = "mbr_em300mba_wr_wc";
-	int	status = MB_SUCCESS;
-	struct mbsys_simrad2_watercolumn_struct *wc;
-	char	line[EM2_WC_HEADER_SIZE];
-	short	label;
-	int	write_len;
-	int	write_size;
-	unsigned short checksum;
-	mb_u_char   *uchar_ptr;
-	int	record_size;
-	int	pad;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		}
-
-	/* get storage structure */
-	wc = (struct mbsys_simrad2_watercolumn_struct *) store->wc;
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       wtc_date:        %d\n",wc->wtc_date);
-		fprintf(stderr,"dbg5       wtc_msec:        %d\n",wc->wtc_msec);
-		fprintf(stderr,"dbg5       wtc_count:       %d\n",wc->wtc_count);
-		fprintf(stderr,"dbg5       wtc_serial:      %d\n",wc->wtc_serial);
-		fprintf(stderr,"dbg5       wtc_ndatagrams:  %d\n",wc->wtc_ndatagrams);
-		fprintf(stderr,"dbg5       wtc_datagram:    %d\n",wc->wtc_datagram);
-		fprintf(stderr,"dbg5       wtc_ntx:         %d\n",wc->wtc_ntx);
-		fprintf(stderr,"dbg5       wtc_nrx:         %d\n",wc->wtc_nrx);
-		fprintf(stderr,"dbg5       wtc_nbeam:       %d\n",wc->wtc_nbeam);
-		fprintf(stderr,"dbg5       wtc_ssv:         %d\n",wc->wtc_ssv);
-		fprintf(stderr,"dbg5       wtc_sfreq:       %d\n",wc->wtc_sfreq);
-		fprintf(stderr,"dbg5       wtc_heave:       %d\n",wc->wtc_heave);
-		fprintf(stderr,"dbg5       wtc_spare1:      %d\n",wc->wtc_spare1);
-		fprintf(stderr,"dbg5       wtc_spare2:      %d\n",wc->wtc_spare2);
-		fprintf(stderr,"dbg5       wtc_spare3:      %d\n",wc->wtc_spare3);
-		fprintf(stderr,"dbg5       ---------------------------\n");
-		fprintf(stderr,"dbg5       cnt  tilt center sector\n");
-		fprintf(stderr,"dbg5       ---------------------------\n");
-		for (i=0;i<wc->wtc_ntx;i++)
-			fprintf(stderr,"dbg5       %3d %6d %6d %6d\n",
-				i, wc->wtc_txtiltangle[i], wc->wtc_txcenter[i],
-				wc->wtc_txsector[i]);
-		for (i=0;i<wc->wtc_nbeam;i++)
-			{
-			fprintf(stderr,"dbg5       --------------------------------------------------\n");
-			fprintf(stderr,"dbg5       cnt  angle start samples unknown sector beam\n");
-			fprintf(stderr,"dbg5       --------------------------------------------------\n");
-			fprintf(stderr,"dbg5        %4d %3d %2d %4d %4d %4d %4d\n",
-				i, wc->beam[i].wtc_rxpointangle,
-				wc->beam[i].wtc_start_sample,
-				wc->beam[i].wtc_beam_samples,
-				wc->beam[i].wtc_beam_spare,
-				wc->beam[i].wtc_sector,
-				wc->beam[i].wtc_beam);
-/*			fprintf(stderr,"dbg5       --------------------------------------------------\n");
-			fprintf(stderr,"dbg5       beam[%d]: sample amplitude\n",i);
-			fprintf(stderr,"dbg5       --------------------------------------------------\n");
-			for (j=0;j<wc->beam[i].wtc_beam_samples;j++)
-				fprintf(stderr,"dbg5        %4d %4d\n",
-					j, wc->beam[i].wtc_amp[j]);*/
-			}
-		}
-
-	/* zero checksum */
-	checksum = 0;
-
-	/* write the record size */
-	record_size = EM2_WC_HEADER_SIZE
-			+ EM2_WC_BEAM_SIZE * wc->wtc_nbeam
-			+ EM2_WC_TX_SIZE * wc->wtc_ntx + 8;
-	for (i=0;i<wc->wtc_nbeam;i++)
-		{
-		record_size += wc->beam[i].wtc_beam_samples;
-		}
-	pad = (record_size % 2);
-	record_size += pad;
-	mb_put_binary_int(swap, record_size, (void *) &write_size);
-	write_len = fwrite(&write_size,1,4,mbfp);
-	if (write_len != 4)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	else
-		status = MB_SUCCESS;
-
-	/* write the record label */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_short(swap, (short) (EM2_WATERCOLUMN), (void *) &label);
-		write_len = fwrite(&label,1,2,mbfp);
-		if (write_len != 2)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_WRITE_FAIL;
-			}
-		else
-			status = MB_SUCCESS;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[1];
-		}
-
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_short(swap, (short) (store->sonar), (void *) &label);
-		write_len = fwrite(&label,1,2,mbfp);
-		if (write_len != 2)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_WRITE_FAIL;
-			}
-		else
-			status = MB_SUCCESS;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[0];
-		checksum += uchar_ptr[1];
-		}
-
-	/* output binary header data */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_int(swap, (int) wc->wtc_date, (void *) &line[0]);
-		mb_put_binary_int(swap, (int) wc->wtc_msec, (void *) &line[4]);
-		mb_put_binary_short(swap, (unsigned short) wc->wtc_count, (void *) &line[8]);
-		mb_put_binary_short(swap, (unsigned short) wc->wtc_serial, (void *) &line[10]);
-		mb_put_binary_short(swap, (unsigned short) wc->wtc_ndatagrams, (void *) &line[12]);
-		mb_put_binary_short(swap, (unsigned short) wc->wtc_datagram, (void *) &line[14]);
-		mb_put_binary_short(swap, (unsigned short) wc->wtc_ntx, (void *) &line[16]);
-		mb_put_binary_short(swap, (unsigned short) wc->wtc_nrx, (void *) &line[18]);
-		mb_put_binary_short(swap, (unsigned short) wc->wtc_nbeam, (void *) &line[20]);
-		mb_put_binary_short(swap, (unsigned short) wc->wtc_ssv, (void *) &line[22]);
-		mb_put_binary_int(swap, (int) wc->wtc_sfreq, (void *) &line[24]);
-		mb_put_binary_short(swap, (short) wc->wtc_heave, (void *) &line[28]);
-		mb_put_binary_short(swap, (unsigned short) wc->wtc_spare1, (void *) &line[30]);
-		mb_put_binary_short(swap, (unsigned short) wc->wtc_spare2, (void *) &line[32]);
-		mb_put_binary_short(swap, (unsigned short) wc->wtc_spare3, (void *) &line[34]);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM2_WC_HEADER_SIZE;j++)
-		    checksum += uchar_ptr[j];
-
-		/* write out data */
-		write_len = fwrite(line,1,EM2_WC_HEADER_SIZE,mbfp);
-		if (write_len != EM2_WC_HEADER_SIZE)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* output binary beam data */
-	if (status == MB_SUCCESS)
-	    {
-	    for (i=0;i<wc->wtc_ntx;i++)
-		{
-		mb_put_binary_short(swap, (short) wc->wtc_txtiltangle[i], (void *) &line[0]);
-		mb_put_binary_short(swap, (unsigned short) wc->wtc_txcenter[i], (void *) &line[2]);
-		line[4] = (mb_u_char) wc->wtc_txsector[i];
-		line[5] = (mb_u_char) 0;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM2_WC_TX_SIZE;j++)
-		    checksum += uchar_ptr[j];
-
-		/* write out data */
-		write_len = fwrite(line,1,EM2_WC_TX_SIZE,mbfp);
-		if (write_len != EM2_WC_TX_SIZE)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-	    for (i=0;i<wc->wtc_nbeam;i++)
-		{
-		mb_put_binary_short(swap, (short) wc->beam[i].wtc_rxpointangle, (void *) &line[0]);
-		mb_put_binary_short(swap, (unsigned short) wc->beam[i].wtc_start_sample, (void *) &line[2]);
-		mb_put_binary_short(swap, (unsigned short) wc->beam[i].wtc_beam_samples, (void *) &line[4]);
-		mb_put_binary_short(swap, (unsigned short) wc->beam[i].wtc_beam_spare, (void *) &line[6]);
-		line[8] = (mb_u_char) wc->beam[i].wtc_sector;
-		line[9] = (mb_u_char) wc->beam[i].wtc_beam;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM2_WC_BEAM_SIZE;j++)
-		    checksum += uchar_ptr[j];
-
-		/* write out data */
-		write_len = fwrite(line,1,EM2_WC_BEAM_SIZE,mbfp);
-		if (write_len != EM2_WC_BEAM_SIZE)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) wc->beam[i].wtc_amp;
-		for (j=0;j<wc->beam[i].wtc_beam_samples;j++)
-		    checksum += uchar_ptr[j];
-
-		/* write out data */
-		write_len = fwrite(wc->beam[i].wtc_amp,1,wc->beam[i].wtc_beam_samples,mbfp);
-		if (write_len != wc->beam[i].wtc_beam_samples)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-	    }
-
-	/* output end of record */
-	if (status == MB_SUCCESS)
-		{
-		if (pad == 1)
-			{
-			line[0] = 0;
-			checksum += line[0];
-			}
-		line[1] = 0x03;
-
-		/* set checksum */
-		mb_put_binary_short(swap, (unsigned short) checksum, (void *) &line[2]);
-
-		/* write out data */
-		write_len = fwrite(&line[!pad],1,3+pad,mbfp);
-		if (write_len != 3+pad)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mbr_em300raw.c b/src/mbio/mbr_em300raw.c
deleted file mode 100644
index aa5e985..0000000
--- a/src/mbio/mbr_em300raw.c
+++ /dev/null
@@ -1,9720 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbr_em300raw.c	10/16/98
- *	$Id: mbr_em300raw.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1998-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbr_em300raw.c contains the functions for reading and writing
- * multibeam data in the EM300RAW format.
- * These functions include:
- *   mbr_alm_em300raw	- allocate read/write memory
- *   mbr_dem_em300raw	- deallocate read/write memory
- *   mbr_rt_em300raw	- read and translate data
- *   mbr_wt_em300raw	- translate and write data
- *
- * Author:	D. W. Caress
- * Date:	October 16,  1998
- * $Log: mbr_em300raw.c,v $
- * Revision 5.41  2008/03/01 09:14:03  caress
- * Some housekeeping changes.
- *
- * Revision 5.40  2007/10/31 18:38:41  caress
- * Fixed handling of null sidescan values.
- *
- * Revision 5.39  2006/11/26 09:37:09  caress
- * Making distribution 5.1.0.
- *
- * Revision 5.38  2006/11/10 22:36:05  caress
- * Working towards release 5.1.0
- *
- * Revision 5.37  2006/07/27 18:42:51  caress
- * Working towards 5.1.0
- *
- * Revision 5.36  2006/02/14 01:57:25  caress
- * Added checks to handle case where Simrad multibeam constructs rawbeam3 datagram with an incorrect size. This happens when the number of transmit sectors is 3 rather than 9 in R/V Revelle data following a January 2006 firmware upgrade.
- *
- * Revision 5.35  2006/02/07 03:12:14  caress
- * Another shot at dealing with broken simrad sidescan records. Now we will keep the raw sidescan data but not use it to make the binned sidescan returned by the standard mbio extract functions.
- *
- * Revision 5.34  2006/02/06 16:54:50  caress
- * Set the Simrad i/o modules to output error messages with verbose > 0 when
- * sidescan is zeroed because of mismatch between bathymetry and sidescan records.
- *
- * Revision 5.33  2006/02/06 06:18:07  caress
- * Commented out checks for beam mismatches between bathy and sidescan records - Barry Eakins of SIO has complained of dropped pings in Revelle data.
- *
- * Revision 5.32  2006/02/03 21:08:51  caress
- * Working on supporting water column datagrams in Simrad formats.
- *
- * Revision 5.31  2006/02/02 19:42:09  caress
- * Fixed handling of unknown datagrams on little-endian systems.
- *
- * Revision 5.30  2006/02/01 18:32:05  caress
- * Fixed problem reading RAWBEAM3 records.
- *
- * Revision 5.29  2006/01/27 20:09:47  caress
- * Added support for EM3002
- *
- * Revision 5.28  2006/01/27 19:09:38  caress
- * Version 5.0.8beta2
- *
- * Revision 5.27  2006/01/06 18:27:19  caress
- * Working towards 5.0.8
- *
- * Revision 5.26  2005/11/05 00:48:04  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.25  2005/03/25 04:18:14  caress
- * Fixed problems with the debug mode being on in mbr_em300raw.c and problems with the debug output in both mbr_em300raw.c and mbr_em300mba.c.
- *
- * Revision 5.24  2005/02/08 22:37:38  caress
- * Heading towards 5.0.6 release.
- *
- * Revision 5.23  2004/06/20 18:40:47  caress
- * Fixed problem reading EM3000D data.
- *
- * Revision 5.22  2004/02/24 22:29:02  caress
- * Fixed errors in handling Simrad datagrams and edit save files on byteswapped machines (e.g. Intel or AMD processors).
- *
- * Revision 5.21  2003/12/04 23:10:23  caress
- * Fixed problems with format 54 EM12DARW due to old code assuming how internal structure was packed. Also changed handling of beamflags for formats that don't support beamflags. Now flagged beams will always be nulled in such cases.
- *
- * Revision 5.20  2003/11/24 20:44:51  caress
- * Fixes to more gracefully handle unsupported datagrams.
- *
- * Revision 5.19  2003/05/20 18:05:32  caress
- * Added svp_source to data source parameters.
- *
- * Revision 5.18  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.17  2003/04/16 16:47:41  caress
- * Release 5.0.beta30
- *
- * Revision 5.16  2002/10/02 23:55:42  caress
- * Release 5.0.beta24
- *
- * Revision 5.15  2002/09/16 05:51:53  caress
- * Really fixed bug...
- *
- * Revision 5.14  2002/09/16 04:50:47  caress
- * Fixed mis-dimensioned array in rd_rawbeam functions.
- *
- * Revision 5.13  2002/08/21 00:55:46  caress
- * Release 5.0.beta22
- *
- * Revision 5.12  2002/07/20 20:42:40  caress
- * Release 5.0.beta20
- *
- * Revision 5.11  2002/05/29 23:38:53  caress
- * Release 5.0.beta18
- *
- * Revision 5.10  2001/08/10 22:41:19  dcaress
- * Release 5.0.beta07
- *
- * Revision 5.9  2001-08-03 18:00:02-07  caress
- * Applied mods from Gordon Keith.
- *
- * Revision 5.8  2001/07/20  00:31:11  caress
- * Release 5.0.beta03
- *
- * Revision 5.7  2001/06/08  21:44:01  caress
- * Version 5.0.beta01
- *
- * Revision 5.6  2001/06/01  23:01:22  caress
- * Turned off debugging.
- *
- * Revision 5.5  2001/06/01  00:14:06  caress
- * Redid support for current Simrad multibeam data.
- *
- * Revision 5.4  2001/05/30  17:57:26  caress
- * Fixed New Simrad data handling, plus removed use of
- * intermediate data structure. Still need to reduce use
- * of #ifdefs related to byteswapping.
- *
- * Revision 5.3  2001/05/24  23:18:07  caress
- * Fixed handling of Revelle EM120 data (first cut).
- *
- * Revision 5.2  2001/03/22  20:45:56  caress
- * Trying to make 5.0.beta0...
- *
- * Revision 5.1  2001/01/22  07:43:34  caress
- * Version 5.0.beta01
- *
- * Revision 5.0  2000/12/01  22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.10  2000/10/11  01:03:21  caress
- * Convert to ANSI C
- *
- * Revision 4.9  2000/09/30  06:34:20  caress
- * Snapshot for Dale.
- *
- * Revision 4.8  2000/09/19  23:13:26  caress
- * Applied fixes from Gordon Keith at AGSO.
- *
- * Revision 4.7  2000/07/20  20:24:59  caress
- * First cut at supporting both EM120 and EM1002.
- *
- * Revision 4.6  2000/07/17  23:36:24  caress
- * Added support for EM120.
- *
- * Revision 4.5  2000/02/07  22:59:47  caress
- * Fixed problem with depth_offset_multiplier
- *
- * Revision 4.4  1999/04/21  05:45:32  caress
- * Fixed handling of bad sidescan data.
- *
- * Revision 4.3  1999/04/07  20:38:24  caress
- * Fixes related to building under Linux.
- *
- * Revision 4.3  1999/04/03 07:36:16  caress
- * Fix bugs in byteswapped code.
- *
- * Revision 4.2  1999/02/04 23:52:54  caress
- * MB-System version 4.6beta7
- *
- * Revision 4.1  1999/01/01  23:41:06  caress
- * MB-System version 4.6beta6
- *
- * Revision 4.0  1998/12/17  22:59:14  caress
- * MB-System version 4.6beta4
- *
- *
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mb_define.h"
-#include "mbsys_simrad2.h"
-
-/* include for byte swapping */
-#include "mb_swap.h"
-
-/* turn on debug statements here */
-/* #define MBR_EM300RAW_DEBUG 1 */
-
-/* essential function prototypes */
-int mbr_register_em300raw(int verbose, void *mbio_ptr,
-		int *error);
-int mbr_info_em300raw(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_alm_em300raw(int verbose, void *mbio_ptr, int *error);
-int mbr_dem_em300raw(int verbose, void *mbio_ptr, int *error);
-int mbr_rt_em300raw(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_wt_em300raw(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_em300raw_rd_data(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_em300raw_chk_label(int verbose, void *mbio_ptr, char *label,
-		short *type, short *sonar);
-int mbr_em300raw_rd_start(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store,
-		short type, short sonar, int *version, int *goodend, int *error);
-int mbr_em300raw_rd_run_parameter(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store,
-		short sonar, int *goodend, int *error);
-int mbr_em300raw_rd_clock(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store,
-		short sonar, int *goodend, int *error);
-int mbr_em300raw_rd_tide(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store,
-		short sonar, int *goodend, int *error);
-int mbr_em300raw_rd_height(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store,
-		short sonar, int *goodend, int *error);
-int mbr_em300raw_rd_heading(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store,
-		short sonar, int *goodend, int *error);
-int mbr_em300raw_rd_ssv(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store,
-		short sonar, int *goodend, int *error);
-int mbr_em300raw_rd_tilt(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store,
-		short sonar, int *goodend, int *error);
-int mbr_em300raw_rd_attitude(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store,
-		short sonar, int *goodend, int *error);
-int mbr_em300raw_rd_pos(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store,
-		short sonar, int *goodend, int *error);
-int mbr_em300raw_rd_svp(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store,
-		short sonar, int *goodend, int *error);
-int mbr_em300raw_rd_svp2(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store,
-		short sonar, int *goodend, int *error);
-int mbr_em300raw_rd_bath(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store,
-		int *match, short sonar, int version, int *goodend, int *error);
-int mbr_em300raw_rd_rawbeam(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store,
-		short sonar, int *goodend, int *error);
-int mbr_em300raw_rd_rawbeam2(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store,
-		short sonar, int *goodend, int *error);
-int mbr_em300raw_rd_rawbeam3(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store,
-		short sonar, int *goodend, int *error);
-int mbr_em300raw_rd_ss(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store,
-		short sonar, int length, int *match, int *goodend, int *error);
-int mbr_em300raw_rd_wc(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store,
-		short sonar, int *goodend, int *error);
-int mbr_em300raw_wr_data(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_em300raw_wr_start(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store, int *error);
-int mbr_em300raw_wr_run_parameter(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store, int *error);
-int mbr_em300raw_wr_clock(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store, int *error);
-int mbr_em300raw_wr_tide(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store, int *error);
-int mbr_em300raw_wr_height(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store, int *error);
-int mbr_em300raw_wr_heading(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store, int *error);
-int mbr_em300raw_wr_ssv(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store, int *error);
-int mbr_em300raw_wr_tilt(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store, int *error);
-int mbr_em300raw_wr_attitude(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store, int *error);
-int mbr_em300raw_wr_pos(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store, int *error);
-int mbr_em300raw_wr_svp(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store, int *error);
-int mbr_em300raw_wr_svp2(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store, int *error);
-int mbr_em300raw_wr_bath(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store, int head, int *error);
-int mbr_em300raw_wr_rawbeam(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store, int *error);
-int mbr_em300raw_wr_rawbeam2(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store, int *error);
-int mbr_em300raw_wr_rawbeam3(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store, int head, int *error);
-int mbr_em300raw_wr_ss(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store, int head, int *error);
-int mbr_em300raw_wr_wc(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store, int *error);
-
-static char rcs_id[]="$Id: mbr_em300raw.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mbr_register_em300raw(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_register_em300raw";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* get mb_io_ptr */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set format info parameters */
-	status = mbr_info_em300raw(verbose,
-			&mb_io_ptr->system,
-			&mb_io_ptr->beams_bath_max,
-			&mb_io_ptr->beams_amp_max,
-			&mb_io_ptr->pixels_ss_max,
-			mb_io_ptr->format_name,
-			mb_io_ptr->system_name,
-			mb_io_ptr->format_description,
-			&mb_io_ptr->numfile,
-			&mb_io_ptr->filetype,
-			&mb_io_ptr->variable_beams,
-			&mb_io_ptr->traveltime,
-			&mb_io_ptr->beam_flagging,
-			&mb_io_ptr->nav_source,
-			&mb_io_ptr->heading_source,
-			&mb_io_ptr->vru_source,
-			&mb_io_ptr->svp_source,
-			&mb_io_ptr->beamwidth_xtrack,
-			&mb_io_ptr->beamwidth_ltrack,
-			error);
-
-	/* set format and system specific function pointers */
-	mb_io_ptr->mb_io_format_alloc = &mbr_alm_em300raw;
-	mb_io_ptr->mb_io_format_free = &mbr_dem_em300raw;
-	mb_io_ptr->mb_io_store_alloc = &mbsys_simrad2_alloc;
-	mb_io_ptr->mb_io_store_free = &mbsys_simrad2_deall;
-	mb_io_ptr->mb_io_read_ping = &mbr_rt_em300raw;
-	mb_io_ptr->mb_io_write_ping = &mbr_wt_em300raw;
-	mb_io_ptr->mb_io_dimensions = &mbsys_simrad2_dimensions;
-	mb_io_ptr->mb_io_pingnumber = &mbsys_simrad2_pingnumber;
-	mb_io_ptr->mb_io_extract = &mbsys_simrad2_extract;
-	mb_io_ptr->mb_io_insert = &mbsys_simrad2_insert;
-	mb_io_ptr->mb_io_extract_nnav = &mbsys_simrad2_extract_nnav;
-	mb_io_ptr->mb_io_extract_nav = &mbsys_simrad2_extract_nav;
-	mb_io_ptr->mb_io_insert_nav = &mbsys_simrad2_insert_nav;
-	mb_io_ptr->mb_io_extract_altitude = &mbsys_simrad2_extract_altitude;
-	mb_io_ptr->mb_io_insert_altitude = NULL;
-	mb_io_ptr->mb_io_extract_svp = &mbsys_simrad2_extract_svp;
-	mb_io_ptr->mb_io_insert_svp = &mbsys_simrad2_insert_svp;
-	mb_io_ptr->mb_io_ttimes = &mbsys_simrad2_ttimes;
-	mb_io_ptr->mb_io_detects = &mbsys_simrad2_detects;
-	mb_io_ptr->mb_io_gains = &mbsys_simrad2_gains;
-	mb_io_ptr->mb_io_copyrecord = &mbsys_simrad2_copy;
-	mb_io_ptr->mb_io_extract_rawss = NULL;
-	mb_io_ptr->mb_io_insert_rawss = NULL;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",mb_io_ptr->system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",mb_io_ptr->beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",mb_io_ptr->beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",mb_io_ptr->pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",mb_io_ptr->format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",mb_io_ptr->system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",mb_io_ptr->format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",mb_io_ptr->numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",mb_io_ptr->filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",mb_io_ptr->variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",mb_io_ptr->traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",mb_io_ptr->beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",mb_io_ptr->nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",mb_io_ptr->heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",mb_io_ptr->vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",mb_io_ptr->svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",mb_io_ptr->beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",mb_io_ptr->beamwidth_ltrack);
-		fprintf(stderr,"dbg2       format_alloc:       %p\n",(void *)mb_io_ptr->mb_io_format_alloc);
-		fprintf(stderr,"dbg2       format_free:        %p\n",(void *)mb_io_ptr->mb_io_format_free);
-		fprintf(stderr,"dbg2       store_alloc:        %p\n",(void *)mb_io_ptr->mb_io_store_alloc);
-		fprintf(stderr,"dbg2       store_free:         %p\n",(void *)mb_io_ptr->mb_io_store_free);
-		fprintf(stderr,"dbg2       read_ping:          %p\n",(void *)mb_io_ptr->mb_io_read_ping);
-		fprintf(stderr,"dbg2       write_ping:         %p\n",(void *)mb_io_ptr->mb_io_write_ping);
-		fprintf(stderr,"dbg2       extract:            %p\n",(void *)mb_io_ptr->mb_io_extract);
-		fprintf(stderr,"dbg2       insert:             %p\n",(void *)mb_io_ptr->mb_io_insert);
-		fprintf(stderr,"dbg2       extract_nav:        %p\n",(void *)mb_io_ptr->mb_io_extract_nav);
-		fprintf(stderr,"dbg2       insert_nav:         %p\n",(void *)mb_io_ptr->mb_io_insert_nav);
-		fprintf(stderr,"dbg2       extract_altitude:   %p\n",(void *)mb_io_ptr->mb_io_extract_altitude);
-		fprintf(stderr,"dbg2       insert_altitude:    %p\n",(void *)mb_io_ptr->mb_io_insert_altitude);
-		fprintf(stderr,"dbg2       extract_svp:        %p\n",(void *)mb_io_ptr->mb_io_extract_svp);
-		fprintf(stderr,"dbg2       insert_svp:         %p\n",(void *)mb_io_ptr->mb_io_insert_svp);
-		fprintf(stderr,"dbg2       ttimes:             %p\n",(void *)mb_io_ptr->mb_io_ttimes);
-		fprintf(stderr,"dbg2       detects:            %p\n",(void *)mb_io_ptr->mb_io_detects);
-		fprintf(stderr,"dbg2       extract_rawss:      %p\n",(void *)mb_io_ptr->mb_io_extract_rawss);
-		fprintf(stderr,"dbg2       insert_rawss:       %p\n",(void *)mb_io_ptr->mb_io_insert_rawss);
-		fprintf(stderr,"dbg2       copyrecord:         %p\n",(void *)mb_io_ptr->mb_io_copyrecord);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbr_info_em300raw(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error)
-{
-	char	*function_name = "mbr_info_em300raw";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* set format info parameters */
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-	*system = MB_SYS_SIMRAD2;
-	*beams_bath_max = 254;
-	*beams_amp_max = 254;
-	*pixels_ss_max = 1024;
-	strncpy(format_name, "EM300RAW", MB_NAME_LENGTH);
-	strncpy(system_name, "SIMRAD2", MB_NAME_LENGTH);
-	strncpy(format_description, "Format name:          MBF_EM300RAW\nInformal Description: Simrad current multibeam vendor format\nAttributes:           Simrad EM120, EM300, EM1002, EM3000, \n                      bathymetry, amplitude, and sidescan,\n                      up to 254 beams, variable pixels, ascii + binary, Simrad.\n", MB_DESCRIPTION_LENGTH);
-	*numfile = 1;
-	*filetype = MB_FILETYPE_NORMAL;
-	*variable_beams = MB_YES;
-	*traveltime = MB_YES;
-	*beam_flagging = MB_NO;
-	*nav_source = MB_DATA_NAV;
-	*heading_source = MB_DATA_DATA;
-	*vru_source = MB_DATA_ATTITUDE;
-	*svp_source = MB_DATA_VELOCITY_PROFILE;
-	*beamwidth_xtrack = 2.0;
-	*beamwidth_ltrack = 2.0;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",*system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",*beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",*beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",*pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",*numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",*filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",*variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",*traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",*beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",*nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",*heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",*vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",*svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",*beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",*beamwidth_ltrack);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_alm_em300raw(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_alm_em300raw";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	int	*databyteswapped;
-	double	*pixel_size;
-	double	*swath_width;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set initial status */
-	status = MB_SUCCESS;
-
-	/* allocate memory for data structure */
-	mb_io_ptr->structure_size = 0;
-	mb_io_ptr->data_structure_size = 0;
-	status = mbsys_simrad2_alloc(
-			verbose,mbio_ptr,
-			&mb_io_ptr->store_data,error);
-
-	/* initialize saved values */
-	databyteswapped = (int *) &mb_io_ptr->save10;
-	pixel_size = &mb_io_ptr->saved1;
-	swath_width = &mb_io_ptr->saved2;
-	*databyteswapped = -1;
-	*pixel_size = 0.0;
-	*swath_width = 0.0;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_dem_em300raw(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_dem_em300raw";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointers to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* deallocate memory for data descriptor */
-	status = mbsys_simrad2_deall(
-			verbose,mbio_ptr,
-			&mb_io_ptr->store_data,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_rt_em300raw(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_rt_em300raw";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_simrad2_struct *store;
-	struct mbsys_simrad2_attitude_struct *attitude;
-	struct mbsys_simrad2_heading_struct *heading;
-	struct mbsys_simrad2_ssv_struct *ssv;
-	struct mbsys_simrad2_ping_struct *ping;
-	int	time_i[7];
-	double	ntime_d, ptime_d, atime_d;
-	double	bath_time_d, ss_time_d;
-	double	rawspeed, pheading;
-	double	plon, plat, pspeed, roll, pitch, heave;
-	double	att_time_d[MBSYS_SIMRAD2_MAXATTITUDE];
-	double	att_roll[MBSYS_SIMRAD2_MAXATTITUDE];
-	double	att_pitch[MBSYS_SIMRAD2_MAXATTITUDE];
-	double	att_heave[MBSYS_SIMRAD2_MAXATTITUDE];
-	double	*pixel_size, *swath_width;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointers to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* read next data from file */
-	status = mbr_em300raw_rd_data(verbose,mbio_ptr,store_ptr,error);
-
-	/* get pointers to data structures */
-	store = (struct mbsys_simrad2_struct *) store_ptr;
-	attitude = (struct mbsys_simrad2_attitude_struct *) store->attitude;
-	heading = (struct mbsys_simrad2_heading_struct *) store->heading;
-	ssv = (struct mbsys_simrad2_ssv_struct *) store->ssv;
-	ping = (struct mbsys_simrad2_ping_struct *) store->ping;
-	pixel_size = (double *) &mb_io_ptr->saved1;
-	swath_width = (double *) &mb_io_ptr->saved2;
-
-	/* save fix if nav data */
-	if (status == MB_SUCCESS
-		&& store->kind == MB_DATA_NAV)
-		{
-		/* get nav time */
-		time_i[0] = store->pos_date / 10000;
-		time_i[1] = (store->pos_date % 10000) / 100;
-		time_i[2] = store->pos_date % 100;
-		time_i[3] = store->pos_msec / 3600000;
-		time_i[4] = (store->pos_msec % 3600000) / 60000;
-		time_i[5] = (store->pos_msec % 60000) / 1000;
-		time_i[6] = (store->pos_msec % 1000) * 1000;
-		mb_get_time(verbose, time_i, &ntime_d);
-
-		/* add latest fix */
-		if (store->pos_longitude != EM2_INVALID_INT
-			&& store->pos_latitude != EM2_INVALID_INT)
-			mb_navint_add(verbose, mbio_ptr,
-				ntime_d,
-				(double)(0.0000001 * store->pos_longitude),
-				(double)(0.00000005 * store->pos_latitude),
-				error);
-		}
-
-	/* save attitude if attitude data */
-	if (status == MB_SUCCESS
-		&& store->kind == MB_DATA_ATTITUDE)
-		{
-		/* get attitude time */
-		time_i[0] = attitude->att_date / 10000;
-		time_i[1] = (attitude->att_date % 10000) / 100;
-		time_i[2] = attitude->att_date % 100;
-		time_i[3] = attitude->att_msec / 3600000;
-		time_i[4] = (attitude->att_msec % 3600000) / 60000;
-		time_i[5] = (attitude->att_msec % 60000) / 1000;
-		time_i[6] = (attitude->att_msec % 1000) * 1000;
-		mb_get_time(verbose, time_i, &atime_d);
-
-		/* add latest attitude samples */
-		for (i=0;i<MIN(attitude->att_ndata,MBSYS_SIMRAD2_MAXATTITUDE);i++)
-			{
-			att_time_d[i] = (double)(atime_d + 0.001 * attitude->att_time[i]);
-			att_heave[i] = (double)(0.01 * attitude->att_heave[i]);
-			att_roll[i] = (double)(0.01 * attitude->att_roll[i]);
-			att_pitch[i] = (double)(0.01 * attitude->att_pitch[i]);
-			}
-		mb_attint_nadd(verbose, mbio_ptr,
-				attitude->att_ndata,att_time_d,att_heave,att_roll,att_pitch,
-				error);
-		}
-
-	/* if no sidescan read then zero sidescan data */
-	if (status == MB_SUCCESS
-		&& store->kind == MB_DATA_DATA
-		&& ping->png_ss_read == MB_NO)
-		{
-		status = mbsys_simrad2_zero_ss(verbose,store_ptr,error);
-		}
-
-	/* else check that bath and sidescan data record time stamps
-	   match for survey data - we can have bath without
-	   sidescan but not sidescan without bath */
-	else if (status == MB_SUCCESS
-		&& store->kind == MB_DATA_DATA)
-		{
-		/* get times of bath and sidescan records */
-		time_i[0] = ping->png_date / 10000;
-		time_i[1] = (ping->png_date % 10000) / 100;
-		time_i[2] = ping->png_date % 100;
-		time_i[3] = ping->png_msec / 3600000;
-		time_i[4] = (ping->png_msec % 3600000) / 60000;
-		time_i[5] = (ping->png_msec % 60000) / 1000;
-		time_i[6] = (ping->png_msec % 1000) * 1000;
-		mb_get_time(verbose, time_i, &bath_time_d);
-		time_i[0] = ping->png_ss_date / 10000;
-		time_i[1] = (ping->png_ss_date % 10000) / 100;
-		time_i[2] = ping->png_ss_date % 100;
-		time_i[3] = ping->png_ss_msec / 3600000;
-		time_i[4] = (ping->png_ss_msec % 3600000) / 60000;
-		time_i[5] = (ping->png_ss_msec % 60000) / 1000;
-		time_i[6] = (ping->png_ss_msec % 1000) * 1000;
-		mb_get_time(verbose, time_i, &ss_time_d);
-/* fprintf(stderr,"Check: png_count:%d png_raw3_count:%d png_ss_count:%d    Beams:%d %d %d\n",
-ping->png_count,ping->png_raw3_count,ping->png_ss_count,ping->png_nbeams,ping->png_raw3_nbeams,ping->png_nbeams_ss);*/
-
-		/* check for time match - if bath newer than
-		   sidescan then zero sidescan,  if sidescan
-		   newer than bath then set error,  if ok then
-		   check that beam ids are the same */
-		if (ping->png_ss_date == 0
-			|| ping->png_nbeams_ss == 0
-			|| bath_time_d > ss_time_d)
-		    {
-		    status = mbsys_simrad2_zero_ss(verbose,store_ptr,error);
-		    }
-		else if (bath_time_d > ss_time_d)
-		    {
-		    if (verbose > 0)
-		    	fprintf(stderr,"%s: %4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d Sidescan zeroed, bathtime:%f >  sstime:%f\n",
-				function_name, time_i[0], time_i[1], time_i[2],
-					time_i[3], time_i[4], time_i[5], time_i[6],
-					bath_time_d, ss_time_d);
-		    status = mbsys_simrad2_zero_ss(verbose,store_ptr,error);
-		    }
-		else if (bath_time_d < ss_time_d)
-		    {
-		    if (verbose > 0)
-		    	fprintf(stderr,"%s: %4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d Ping unintelligible bathtime:%f < sstime%f\n",
-				function_name, time_i[0], time_i[1], time_i[2],
-					time_i[3], time_i[4], time_i[5], time_i[6],
-					bath_time_d, ss_time_d);
-		    *error = MB_ERROR_UNINTELLIGIBLE;
-		    status = MB_FAILURE;
-		    }
-		else
-		    {
-		    /* check for some indicators of broken records */
-		    if (ping->png_nbeams < ping->png_nbeams_ss
-			|| ping->png_nbeams > ping->png_nbeams_ss + 1)
-			{
-		    	if (verbose > 1)
-			    	fprintf(stderr,"%s: %4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d Sidescan ignored: num bath beams != num ss beams: %d %d\n",
-					function_name, time_i[0], time_i[1], time_i[2],
-					time_i[3], time_i[4], time_i[5], time_i[6],
-					ping->png_nbeams, ping->png_nbeams_ss);
-			}
-		    else if (ping->png_nbeams == ping->png_nbeams_ss)
-			{
-			for (i=0;i<ping->png_nbeams;i++)
-			    {
-			    if (ping->png_beam_num[i] !=
-				    ping->png_beam_index[i] + 1
-				&& ping->png_beam_num[i] !=
-				    ping->png_beam_index[i] - 1)
-				{
-		    		if (verbose > 1)
-				    	fprintf(stderr,"%s: %4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d Sidescan ignored: bath and ss beam indexes don't match: : %d %d %d\n",
-						function_name, time_i[0], time_i[1], time_i[2],
-						time_i[3], time_i[4], time_i[5], time_i[6],
-						i, ping->png_beam_num[i], ping->png_beam_index[i]);
-				}
-			    }
-			}
-		    }
-		}
-
-	if (status == MB_SUCCESS
-		&& store->kind == MB_DATA_DATA)
-		{
-/*fprintf(stderr, "mode:%d absorption:%d tran_pulse:%d tran_beam:%d tran_pow:%d rec_beam:%d rec_band:%d rec_gain:%d tvg_cross:%d\n",
-store->run_mode, store->run_absorption,
-store->run_tran_pulse, store->run_tran_pow,
-store->run_rec_beam, store->run_rec_band,
-store->run_rec_gain, store->run_tvg_cross);
-fprintf(stderr, "max_range:%d r_zero:%d r_zero_corr:%d tvg_start:%d tvg_stop:%d bsn:%d bso:%d tx:%d tvg_crossover:%d\n",
-ping->png_max_range, ping->png_r_zero,
-ping->png_r_zero_corr, ping->png_tvg_start,
-ping->png_tvg_stop, ping->png_bsn,
-ping->png_bso, ping->png_tx,
-ping->png_tvg_crossover);
-fprintf(stderr, "mode:%d depth:%11f max_range:%d r_zero:%d r_zero_corr:%d bsn:%d bso:%d\n",
-store->run_mode,
-0.01 * ping->png_depth_res * ping->png_depth[ping->png_nbeams/2],
-ping->png_max_range, ping->png_r_zero,
-ping->png_r_zero_corr, ping->png_bsn,
-ping->png_bso);*/
-
-		/* get ping time */
-		time_i[0] = ping->png_date / 10000;
-		time_i[1] = (ping->png_date % 10000) / 100;
-		time_i[2] = ping->png_date % 100;
-		time_i[3] = ping->png_msec / 3600000;
-		time_i[4] = (ping->png_msec % 3600000) / 60000;
-		time_i[5] = (ping->png_msec % 60000) / 1000;
-		time_i[6] = (ping->png_msec % 1000) * 1000;
-		mb_get_time(verbose, time_i, &ptime_d);
-
-		/* interpolate from saved nav */
-		if (store->pos_speed == 0
-		    || store->pos_speed == EM2_INVALID_SHORT)
-			rawspeed = 0.0;
-		else
-			rawspeed =  0.036 * store->pos_speed;
-		pheading = 0.01 * ping->png_heading;
-		mb_navint_interp(verbose, mbio_ptr, ptime_d, pheading, rawspeed,
-				    &plon, &plat, &pspeed, error);
-		if (plon == 0.0
-		    && plat == 0.0)
-		    {
-		    ping->png_longitude = (int) EM2_INVALID_INT;
-		    ping->png_latitude = (int) EM2_INVALID_INT;
-		    }
-		else
-		    {
-		    ping->png_longitude = (int) rint(10000000 * plon);
-		    ping->png_latitude =  (int) rint(20000000 * plat);
-		    }
-		ping->png_speed = (int) rint(pspeed / 0.036);
-
-		/* interpolate from saved attitude */
-		mb_attint_interp(verbose, mbio_ptr, ptime_d,
-				    &heave, &roll, &pitch, error);
-		ping->png_roll = (int) rint(roll / 0.01);
-		ping->png_pitch = (int) rint(pitch / 0.01);
-		ping->png_heave = (int) rint(heave / 0.01);
-
-		/* generate processed sidescan */
-		ping->png_pixel_size = 0;
-		ping->png_pixels_ss = 0;
-		status = mbsys_simrad2_makess(verbose,
-				mbio_ptr, store_ptr,
-				MB_NO, pixel_size,
-				MB_NO, swath_width,
-				0,
-				error);
-		}
-
-	if (status == MB_SUCCESS
-		&& (store->kind == MB_DATA_NAV
-			|| store->kind == MB_DATA_NAV1
-			|| store->kind == MB_DATA_NAV2
-			|| store->kind == MB_DATA_NAV3))
-		{
-		/* get nav time */
-		time_i[0] = store->pos_date / 10000;
-		time_i[1] = (store->pos_date % 10000) / 100;
-		time_i[2] = store->pos_date % 100;
-		time_i[3] = store->pos_msec / 3600000;
-		time_i[4] = (store->pos_msec % 3600000) / 60000;
-		time_i[5] = (store->pos_msec % 60000) / 1000;
-		time_i[6] = (store->pos_msec % 1000) * 1000;
-		mb_get_time(verbose, time_i, &ntime_d);
-
-		/* interpolate from saved attitude */
-		mb_attint_interp(verbose, mbio_ptr, ntime_d,
-				    &heave, &roll, &pitch, error);
-		store->pos_roll = (int) rint(roll / 0.01);
-		store->pos_pitch = (int) rint(pitch / 0.01);
-		store->pos_heave = (int) rint(heave / 0.01);
-		}
-
-	/* set error and kind in mb_io_ptr */
-	mb_io_ptr->new_error = *error;
-	mb_io_ptr->new_kind = store->kind;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_wt_em300raw(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_wt_em300raw";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_simrad2_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_simrad2_struct *) store_ptr;
-
-	/* write next data to file */
-	status = mbr_em300raw_wr_data(verbose,mbio_ptr,store_ptr,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em300raw_rd_data(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_em300raw_rd_data";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_simrad2_struct *store;
-	struct mbsys_simrad2_ping_struct *ping;
-	struct mbsys_simrad2_ping_struct *ping2;
-	FILE	*mbfp;
-	int	swap = -1;
-	int	done;
-	int	*databyteswapped;
-	int	record_size;
-	int	*record_size_save;
-	int	bytes_read;
-	char	*label;
-	int	*label_save_flag;
-	char	*record_size_char;
-	short	expect;
-	short	type;
-	short	sonar;
-	int	*version;
-	short	first_type;
-	short	*expect_save;
-	int	*expect_save_flag;
-	short	*first_type_save;
-	short	*typelast;
-	short	*sonarlast;
-	int	*nbadrec;
-	int     *length;
-	int	good_end_bytes;
-	int	match;
-	int	read_len;
-	int	skip = 0;
-	char	junk;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_simrad2_struct *) store_ptr;
-	ping = (struct mbsys_simrad2_ping_struct *) store->ping;
-	ping2 = (struct mbsys_simrad2_ping_struct *) store->ping2;
-	mbfp = mb_io_ptr->mbfp;
-
-	/* get saved values */
-	databyteswapped = (int *) &mb_io_ptr->save10;
-	record_size_save = (int *) &mb_io_ptr->save5;
-	label = (char *) mb_io_ptr->save_label;
-	version = (int *) (&mb_io_ptr->save3);
-	label_save_flag = (int *) &mb_io_ptr->save_label_flag;
-	expect_save_flag = (int *) &mb_io_ptr->save_flag;
-	expect_save = (short *) &mb_io_ptr->save1;
-	first_type_save = (short *) &mb_io_ptr->save2;
-	typelast = (short *) &mb_io_ptr->save6;
-	sonarlast = (short *) &mb_io_ptr->save9;
-	nbadrec = (int *) &mb_io_ptr->save7;
-	length = (int *) &mb_io_ptr->save8;
-	record_size_char = (char *) &record_size;
-	if (*expect_save_flag == MB_YES)
-		{
-		expect = *expect_save;
-		first_type = *first_type_save;
-		*expect_save_flag = MB_NO;
-		}
-	else
-		{
-		expect = EM2_NONE;
-		first_type = EM2_NONE;
-		if (ping != NULL)
-		    {
-		    ping->png_raw1_read = MB_NO;
-		    ping->png_raw2_read = MB_NO;
-		    ping->png_ss_read = MB_NO;
-		    ping->png_raw_nbeams = 0;
-		    ping->png_nbeams_ss = 0;
-		    }
-		if (ping2 != NULL)
-		    {
-		    ping2->png_raw1_read = MB_NO;
-		    ping2->png_raw2_read = MB_NO;
-		    ping2->png_ss_read = MB_NO;
-		    ping2->png_raw_nbeams = 0;
-		    ping2->png_nbeams_ss = 0;
-		    }
-		}
-
-	/* set file position */
-	mb_io_ptr->file_pos = mb_io_ptr->file_bytes;
-
-	/* set flag to swap bytes if necessary */
-	swap =  *databyteswapped;
-
-	/* loop over reading data until a record is ready for return */
-	done = MB_NO;
-	*error = MB_ERROR_NO_ERROR;
-	while (done == MB_NO)
-		{
-		/* if no label saved get next record label */
-		if (*label_save_flag == MB_NO)
-			{
-			/* read four byte record size */
-			if ((read_len = fread(&record_size,
-				1,4,mb_io_ptr->mbfp)) != 4)
-				{
-				status = MB_FAILURE;
-				*error = MB_ERROR_EOF;
-				}
-
-			/* read label */
-			if ((read_len = fread(label,
-				1,4,mb_io_ptr->mbfp)) != 4)
-				{
-				status = MB_FAILURE;
-				*error = MB_ERROR_EOF;
-				}
-
-			/* check label - if not a good label read a byte
-				at a time until a good label is found */
-			skip = 0;
-			while (status == MB_SUCCESS
-				&& mbr_em300raw_chk_label(verbose,
-					mbio_ptr, label, &type, &sonar) != MB_SUCCESS)
-			    {
-			    /* get next byte */
-			    for (i=0;i<3;i++)
-				record_size_char[i] = record_size_char[i+1];
-			    record_size_char[3] = label[0];
-			    for (i=0;i<3;i++)
-				label[i] = label[i+1];
-			    if ((read_len = fread(&label[3],
-				    1,1,mb_io_ptr->mbfp)) != 1)
-				{
-				status = MB_FAILURE;
-				*error = MB_ERROR_EOF;
-				}
-			    skip++;
-			    }
-
-			/* report problem */
-			if (skip > 0 && verbose > 0)
-			    {
-			    if (*nbadrec == 0)
-			    	fprintf(stderr,
-"\nThe MBF_EM300RAW module skipped data between identified\n\
-data records. Something is broken, most probably the data...\n\
-However, the data may include a data record type that we\n\
-haven't seen yet, or there could be an error in the code.\n\
-If skipped data are reported multiple times, \n\
-we recommend you send a data sample and problem \n\
-description to the MB-System team \n\
-(caress at mbari.org and dale at ldeo.columbia.edu)\n\
-Have a nice day...\n");
-				fprintf(stderr,
-						"MBF_EM300RAW skipped %d bytes between records %4.4hX:%d and %4.4hX:%d\n",
-						skip, *typelast, *typelast, type, type);
-				(*nbadrec)++;
-			    }
-			*typelast = type;
-			*sonarlast = sonar;
-
-			/* set flag to swap MBR_EM300RAW_DEBUGbytes if necessary */
-			swap = *databyteswapped;
-
-			/* get record_size */
-			if (*databyteswapped != mb_io_ptr->byteswapped)
-				record_size = mb_swap_int(record_size);
-			*record_size_save = record_size;
-			}
-
-		/* else use saved label */
-		else
-			{
-			*label_save_flag = MB_NO;
-			type = *typelast;
-			sonar = *sonarlast;
-			record_size = *record_size_save;
-			}
-
-#ifdef MBR_EM300RAW_DEBUG
-	fprintf(stderr,"\nstart of mbr_em300raw_rd_data loop:\n");
-	fprintf(stderr,"skip:%d expect:%x type:%x first_type:%x sonar:%d recsize:%u done:%d\n",
-		skip, expect, type, first_type, sonar, *record_size_save, done);
-#endif
-
-		/* allocate secondary data structure for
-			heading data if needed */
-		if (status == MB_SUCCESS &&
-			(type == EM2_HEADING)
-			&& store->heading == NULL)
-			{
-			status = mbsys_simrad2_heading_alloc(
-					verbose,mbio_ptr,
-					store_ptr,error);
-			}
-
-		/* allocate secondary data structure for
-			attitude data if needed */
-		if (status == MB_SUCCESS &&
-			(type == EM2_ATTITUDE)
-			&& store->attitude == NULL)
-			{
-			status = mbsys_simrad2_attitude_alloc(
-					verbose,mbio_ptr,
-					store_ptr,error);
-			}
-
-		/* allocate secondary data structure for
-			ssv data if needed */
-		if (status == MB_SUCCESS &&
-			(type == EM2_SSV)
-			&& store->ssv == NULL)
-			{
-			status = mbsys_simrad2_ssv_alloc(
-					verbose,mbio_ptr,
-					store_ptr,error);
-			}
-
-		/* allocate secondary data structure for
-			tilt data if needed */
-		if (status == MB_SUCCESS &&
-			(type == EM2_TILT)
-			&& store->tilt == NULL)
-			{
-			status = mbsys_simrad2_tilt_alloc(
-					verbose,mbio_ptr,
-					store_ptr,error);
-			}
-
-		/* allocate secondary data structure for
-			survey data if needed */
-		if (status == MB_SUCCESS &&
-			(type == EM2_BATH
-			|| type == EM2_RAWBEAM
-			|| type == EM2_RAWBEAM2
-			|| type == EM2_RAWBEAM3
-			|| type == EM2_SS))
-			{
-			if (store->ping == NULL)
-			    status = mbsys_simrad2_survey_alloc(
-					verbose,mbio_ptr,
-					store_ptr,error);
-			ping = (struct mbsys_simrad2_ping_struct *) store->ping;
-			ping2 = (struct mbsys_simrad2_ping_struct *) store->ping2;
-			}
-
-		/* allocate secondary data structure for
-			water column data if needed */
-		if (status == MB_SUCCESS &&
-			(type == EM2_WATERCOLUMN))
-			{
-			if (store->wc == NULL)
-			    status = mbsys_simrad2_wc_alloc(
-					verbose,mbio_ptr,
-					store_ptr,error);
-			}
-
-		/* read the appropriate data records */
-		if (status == MB_FAILURE && expect == EM2_NONE)
-			{
-#ifdef MBR_EM300RAW_DEBUG
-	fprintf(stderr,"call nothing, read failure, no expect\n");
-#endif
-			done = MB_YES;
-			record_size = 0;
-			*record_size_save = record_size;
-			}
-		else if (status == MB_FAILURE && expect != EM2_NONE)
-			{
-#ifdef MBR_EM300RAW_DEBUG
-	fprintf(stderr,"call nothing, read failure, expect %x\n",expect);
-#endif
-			done = MB_YES;
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		else if (type !=  EM2_STOP2
-			&& type != EM2_OFF
-			&& type != EM2_ON
-			&& type != EM2_ATTITUDE
-			&& type != EM2_CLOCK
-			&& type != EM2_BATH
-			&& type != EM2_SBDEPTH
-			&& type != EM2_RAWBEAM
-			&& type != EM2_SSV
-			&& type != EM2_HEADING
-			&& type != EM2_START
-			&& type != EM2_TILT
-			&& type != EM2_CBECHO
-			&& type != EM2_POS
-			&& type != EM2_RUN_PARAMETER
-			&& type != EM2_SS
-			&& type != EM2_TIDE
-			&& type != EM2_SVP2
-			&& type != EM2_SVP
-			&& type != EM2_SSPINPUT
-			&& type != EM2_RAWBEAM2
-			&& type != EM2_RAWBEAM3
-			&& type != EM2_HEIGHT
-			&& type != EM2_STOP
-			&& type != EM2_WATERCOLUMN
-			&& type != EM2_REMOTE
-			&& type != EM2_SSP
-			&& type != EM2_BATH_MBA
-			&& type != EM2_SS_MBA)
-			{
-#ifdef MBR_EM300RAW_DEBUG
-	fprintf(stderr,"call nothing, try again\n");
-#endif
-			done = MB_NO;
-			}
-		else if ((type == EM2_START
-			    || type == EM2_STOP)
-			&& expect != EM2_NONE)
-			{
-#ifdef MBR_EM300RAW_DEBUG
-	fprintf(stderr,"call nothing, expect %x but got type %x\n",expect,type);
-#endif
-			done = MB_YES;
-			expect = EM2_NONE;
-			type = first_type;
-			*label_save_flag = MB_YES;
-			store->kind = MB_DATA_DATA;
-			}
-		else if (type == EM2_START
-			|| type == EM2_STOP)
-			{
-#ifdef MBR_EM300RAW_DEBUG
-	fprintf(stderr,"call mbr_em300raw_rd_start type %x\n",type);
-#endif
-			status = mbr_em300raw_rd_start(
-				verbose,mbfp,swap,store,type,sonar,version,&good_end_bytes,error);
-			if (status == MB_SUCCESS)
-			    {
-			    done = MB_YES;
-			    if (expect != EM2_NONE)
-				{
-				*expect_save = expect;
-				*expect_save_flag = MB_YES;
-				*first_type_save = first_type;
-				}
-			    else
-				*expect_save_flag = MB_NO;
-			    }
-			}
-		else if (type == EM2_RUN_PARAMETER)
-			{
-#ifdef MBR_EM300RAW_DEBUG
-	fprintf(stderr,"call mbr_em300raw_rd_run_parameter type %x\n",type);
-#endif
-			status = mbr_em300raw_rd_run_parameter(
-				verbose,mbfp,swap,store,sonar,&good_end_bytes,error);
-			if (status == MB_SUCCESS)
-				{
-				done = MB_YES;
-				if (expect != EM2_NONE)
-					{
-					*expect_save = expect;
-					*expect_save_flag = MB_YES;
-					*first_type_save = first_type;
-					}
-				else
-					*expect_save_flag = MB_NO;
-				}
-			}
-		else if (type == EM2_CLOCK)
-			{
-#ifdef MBR_EM300RAW_DEBUG
-	fprintf(stderr,"call mbr_em300raw_rd_clock type %x\n",type);
-#endif
-			status = mbr_em300raw_rd_clock(
-				verbose,mbfp,swap,store,sonar,&good_end_bytes,error);
-			if (status == MB_SUCCESS)
-				{
-				done = MB_YES;
-				if (expect != EM2_NONE)
-					{
-					*expect_save = expect;
-					*expect_save_flag = MB_YES;
-					*first_type_save = first_type;
-					}
-				else
-					*expect_save_flag = MB_NO;
-				}
-			}
-		else if (type == EM2_TIDE)
-			{
-#ifdef MBR_EM300RAW_DEBUG
-	fprintf(stderr,"call mbr_em300raw_rd_tide type %x\n",type);
-#endif
-			status = mbr_em300raw_rd_tide(
-				verbose,mbfp,swap,store,sonar,&good_end_bytes,error);
-			if (status == MB_SUCCESS)
-				{
-				done = MB_YES;
-				if (expect != EM2_NONE)
-					{
-					*expect_save = expect;
-					*expect_save_flag = MB_YES;
-					*first_type_save = first_type;
-					}
-				else
-					*expect_save_flag = MB_NO;
-				}
-			}
-		else if (type == EM2_HEIGHT)
-			{
-#ifdef MBR_EM300RAW_DEBUG
-	fprintf(stderr,"call mbr_em300raw_rd_height type %x\n",type);
-#endif
-			status = mbr_em300raw_rd_height(
-				verbose,mbfp,swap,store,sonar,&good_end_bytes,error);
-			if (status == MB_SUCCESS)
-				{
-				done = MB_YES;
-				if (expect != EM2_NONE)
-					{
-					*expect_save = expect;
-					*expect_save_flag = MB_YES;
-					*first_type_save = first_type;
-					}
-				else
-					*expect_save_flag = MB_NO;
-				}
-			}
-		else if (type == EM2_HEADING)
-			{
-#ifdef MBR_EM300RAW_DEBUG
-	fprintf(stderr,"call mbr_em300raw_rd_heading type %x\n",type);
-#endif
-			status = mbr_em300raw_rd_heading(
-				verbose,mbfp,swap,store,sonar,&good_end_bytes,error);
-			if (status == MB_SUCCESS)
-				{
-				done = MB_YES;
-				if (expect != EM2_NONE)
-					{
-					*expect_save = expect;
-					*expect_save_flag = MB_YES;
-					*first_type_save = first_type;
-					}
-				else
-					*expect_save_flag = MB_NO;
-				}
-			}
-		else if (type == EM2_SSV)
-			{
-#ifdef MBR_EM300RAW_DEBUG
-	fprintf(stderr,"call mbr_em300raw_rd_ssv type %x\n",type);
-#endif
-			status = mbr_em300raw_rd_ssv(
-				verbose,mbfp,swap,store,sonar,&good_end_bytes,error);
-			if (status == MB_SUCCESS)
-				{
-				done = MB_YES;
-				if (expect != EM2_NONE)
-					{
-					*expect_save = expect;
-					*expect_save_flag = MB_YES;
-					*first_type_save = first_type;
-					}
-				else
-					*expect_save_flag = MB_NO;
-				}
-			}
-		else if (type == EM2_TILT)
-			{
-#ifdef MBR_EM300RAW_DEBUG
-	fprintf(stderr,"call mbr_em300raw_rd_tilt type %x\n",type);
-#endif
-			status = mbr_em300raw_rd_tilt(
-				verbose,mbfp,swap,store,sonar,&good_end_bytes,error);
-			if (status == MB_SUCCESS)
-				{
-				done = MB_YES;
-				if (expect != EM2_NONE)
-					{
-					*expect_save = expect;
-					*expect_save_flag = MB_YES;
-					*first_type_save = first_type;
-					}
-				else
-					*expect_save_flag = MB_NO;
-				}
-			}
-		else if (type == EM2_ATTITUDE)
-			{
-#ifdef MBR_EM300RAW_DEBUG
-	fprintf(stderr,"call mbr_em300raw_rd_attitude type %x\n",type);
-#endif
-			status = mbr_em300raw_rd_attitude(
-				verbose,mbfp,swap,store,sonar,&good_end_bytes,error);
-			if (status == MB_SUCCESS)
-				{
-				done = MB_YES;
-				if (expect != EM2_NONE)
-					{
-					*expect_save = expect;
-					*expect_save_flag = MB_YES;
-					*first_type_save = first_type;
-					}
-				else
-					*expect_save_flag = MB_NO;
-				}
-			}
-		else if (type == EM2_POS)
-			{
-#ifdef MBR_EM300RAW_DEBUG
-	fprintf(stderr,"call mbr_em300raw_rd_pos type %x\n",type);
-#endif
-			status = mbr_em300raw_rd_pos(
-				verbose,mbfp,swap,store,sonar,&good_end_bytes,error);
-			if (status == MB_SUCCESS)
-				{
-				done = MB_YES;
-				if (expect != EM2_NONE)
-					{
-					*expect_save = expect;
-					*expect_save_flag = MB_YES;
-					*first_type_save = first_type;
-					}
-				else
-					*expect_save_flag = MB_NO;
-				}
-			}
-		else if (type == EM2_SVP)
-			{
-#ifdef MBR_EM300RAW_DEBUG
-	fprintf(stderr,"call mbr_em300raw_rd_svp type %x\n",type);
-#endif
-			status = mbr_em300raw_rd_svp(
-				verbose,mbfp,swap,store,sonar,&good_end_bytes,error);
-			if (status == MB_SUCCESS)
-				{
-				done = MB_YES;
-				if (expect != EM2_NONE)
-					{
-					*expect_save = expect;
-					*expect_save_flag = MB_YES;
-					*first_type_save = first_type;
-					}
-				else
-					*expect_save_flag = MB_NO;
-				}
-			}
-		else if (type == EM2_SVP2)
-			{
-#ifdef MBR_EM300RAW_DEBUG
-	fprintf(stderr,"call mbr_em300raw_rd_svp2 type %x\n",type);
-#endif
-			status = mbr_em300raw_rd_svp2(
-				verbose,mbfp,swap,store,sonar,&good_end_bytes,error);
-			if (status == MB_SUCCESS)
-				{
-				done = MB_YES;
-				if (expect != EM2_NONE)
-					{
-					*expect_save = expect;
-					*expect_save_flag = MB_YES;
-					*first_type_save = first_type;
-					}
-				else
-					*expect_save_flag = MB_NO;
-				}
-			}
-		else if (type == EM2_BATH
-			&& sonar == MBSYS_SIMRAD2_EM3002
-			&& store->numberheads == 2)
-			{
-			if (expect == EM2_SS
-				&& store->ping->png_count == store->ping2->png_count
-				&& store->ping->png_serial != store->ping2->png_serial)
-				{
-#ifdef MBR_EM300RAW_DEBUG
-	fprintf(stderr,"call nothing, expect %x but got type %x\n",expect,type);
-#endif
-				done = MB_YES;
-				expect = EM2_NONE;
-				type = first_type;
-				*label_save_flag = MB_YES;
-				store->kind = MB_DATA_DATA;
-				}
-			else
-				{
-#ifdef MBR_EM300RAW_DEBUG
-	fprintf(stderr,"call mbr_em300raw_rd_bath type %x\n",type);
-#endif
-				status = mbr_em300raw_rd_bath(
-					verbose,mbfp,swap,store,&match,sonar,*version,&good_end_bytes,error);
-				if (status == MB_SUCCESS)
-					{
-					if (first_type == EM2_NONE
-						|| match == MB_NO
-						|| store->ping->png_count != store->ping2->png_count
-						|| store->ping->png_serial != store->ping2->png_serial)
-						{
-						done = MB_NO;
-						first_type = EM2_BATH;
-						expect = EM2_SS;
-						}
-					else
-						{
-						done = MB_YES;
-						expect = EM2_NONE;
-						}
-					}
-				}
-
-
-			}
-		else if (type == EM2_BATH
-			&& expect == EM2_SS)
-			{
-#ifdef MBR_EM300RAW_DEBUG
-	fprintf(stderr,"call nothing, expect %x but got type %x\n",expect,type);
-#endif
-			done = MB_YES;
-			expect = EM2_NONE;
-			type = first_type;
-			*label_save_flag = MB_YES;
-			store->kind = MB_DATA_DATA;
-			}
-		else if (type == EM2_BATH)
-			{
-#ifdef MBR_EM300RAW_DEBUG
-	fprintf(stderr,"call mbr_em300raw_rd_bath type %x\n",type);
-#endif
-			status = mbr_em300raw_rd_bath(
-				verbose,mbfp,swap,store,&match,sonar,*version,&good_end_bytes,error);
-			if (status == MB_SUCCESS)
-				{
-				if (first_type == EM2_NONE
-					|| match == MB_NO)
-					{
-					done = MB_NO;
-					first_type = EM2_BATH;
-					expect = EM2_SS;
-					}
-				else
-					{
-					done = MB_YES;
-					expect = EM2_NONE;
-					}
-				}
-			}
-		else if (type == EM2_RAWBEAM)
-			{
-#ifdef MBR_EM300RAW_DEBUG
-	fprintf(stderr,"call mbr_em300raw_rd_rawbeam type %x\n",type);
-#endif
-			status = mbr_em300raw_rd_rawbeam(
-				verbose,mbfp,swap,store,sonar,&good_end_bytes,error);
-			if (status == MB_SUCCESS)
-				ping->png_raw1_read = MB_YES;
-			if (expect == EM2_SS
-				&& ping->png_nbeams == 0)
-				{
-				done = MB_YES;
-				expect = EM2_NONE;
-				}
-			}
-		else if (type == EM2_RAWBEAM2)
-			{
-#ifdef MBR_EM300RAW_DEBUG
-	fprintf(stderr,"call mbr_em300raw_rd_rawbeam2 type %x\n",type);
-#endif
-			status = mbr_em300raw_rd_rawbeam2(
-				verbose,mbfp,swap,store,sonar,&good_end_bytes,error);
-			if (status == MB_SUCCESS)
-				ping->png_raw2_read = MB_YES;
-			if (expect == EM2_SS
-				&& ping->png_nbeams == 0)
-				{
-				done = MB_YES;
-				expect = EM2_NONE;
-				}
-			}
-		else if (type == EM2_RAWBEAM3
-			&& sonar == MBSYS_SIMRAD2_EM3002
-			&& store->numberheads == 2)
-			{
-#ifdef MBR_EM300RAW_DEBUG
-	fprintf(stderr,"call mbr_em300raw_rd_rawbeam3 type %x\n",type);
-#endif
-			status = mbr_em300raw_rd_rawbeam3(
-				verbose,mbfp,swap,store,sonar,&good_end_bytes,error);
-			if (status == MB_SUCCESS)
-				ping->png_raw3_read = MB_YES;
-			}
-		else if (type == EM2_RAWBEAM3)
-			{
-#ifdef MBR_EM300RAW_DEBUG
-	fprintf(stderr,"call mbr_em300raw_rd_rawbeam3 type %x\n",type);
-#endif
-			status = mbr_em300raw_rd_rawbeam3(
-				verbose,mbfp,swap,store,sonar,&good_end_bytes,error);
-			if (status == MB_SUCCESS)
-				ping->png_raw3_read = MB_YES;
-			if (expect == EM2_SS
-				&& ping->png_nbeams == 0)
-				{
-				done = MB_YES;
-				expect = EM2_NONE;
-				}
-			}
-		else if (type == EM2_SS
-			&& sonar == MBSYS_SIMRAD2_EM3002
-			&& store->numberheads == 2)
-			{
-#ifdef MBR_EM300RAW_DEBUG
-	fprintf(stderr,"call mbr_em300raw_rd_ss a type %x\n",type);
-#endif
-			status = mbr_em300raw_rd_ss(
-				verbose,mbfp,swap,store,sonar,*length,&match,&good_end_bytes,error);
-			if (status == MB_SUCCESS)
-			    ping->png_ss_read = MB_YES;
-			if (status == MB_SUCCESS
-				&& ping->png_count == store->ping2->png_count
-				&& ping->png_count == ping->png_raw3_count
-				&& ping->png_count == ping->png_ss_count
-				&& store->ping2->png_count == store->ping2->png_raw3_count
-				&& store->ping2->png_count == store->ping2->png_ss_count)
-			    {
-			    done = MB_YES;
-			    expect = EM2_NONE;
-			    }
-			}
-		else if (type == EM2_SS
-			&& expect != EM2_NONE
-			&& expect != EM2_SS)
-			{
-#ifdef MBR_EM300RAW_DEBUG
-	fprintf(stderr,"call nothing, expect %x but got type %x\n",expect,type);
-#endif
-			done = MB_YES;
-			expect = EM2_NONE;
-			type = first_type;
-			*label_save_flag = MB_YES;
-			store->kind = MB_DATA_DATA;
-			}
-		else if (type == EM2_SS)
-			{
-#ifdef MBR_EM300RAW_DEBUG
-	fprintf(stderr,"call mbr_em300raw_rd_ss b type %x\n",type);
-#endif
-			status = mbr_em300raw_rd_ss(
-				verbose,mbfp,swap,store,sonar,*length,&match,&good_end_bytes,error);
-			if (status == MB_SUCCESS)
-			    {
-			    ping->png_ss_read = MB_YES;
-			    if (first_type == EM2_NONE
-				|| match == MB_NO)
-				{
-				done = MB_NO;
-				first_type = EM2_SS;
-				expect = EM2_BATH;
-				}
-			    else
-				{
-				done = MB_YES;
-				expect = EM2_NONE;
-				}
-			    }
-
-                        /* salvage bath even if sidescan is corrupt */
-			else
-			    {
-			    if (first_type == EM2_BATH
-				&& match == MB_YES)
-				{
-				status = MB_SUCCESS;
-				done = MB_YES;
-				expect = EM2_NONE;
-				}
-			    }
-			}
-		else if (type == EM2_WATERCOLUMN)
-			{
-#ifdef MBR_EM300RAW_DEBUG
-	fprintf(stderr,"call mbr_em300raw_rd_wc type %x\n",type);
-#endif
-			status = mbr_em300raw_rd_wc(
-				verbose,mbfp,swap,store,sonar,&good_end_bytes,error);
-			if (status == MB_SUCCESS)
-				{
-				done = MB_YES;
-				if (expect != EM2_NONE)
-					{
-					*expect_save = expect;
-					*expect_save_flag = MB_YES;
-					*first_type_save = first_type;
-					}
-				else
-					*expect_save_flag = MB_NO;
-				}
-			}
-		else
-			{
-#ifdef MBR_EM300RAW_DEBUG
-	fprintf(stderr,"skip over %d bytes of unsupported datagram type %x\n",
-			*record_size_save, type);
-#endif
-			for (i=0;i<*record_size_save-4;i++)
-				{
-				if ((read_len = fread(&junk,
-					1,1,mb_io_ptr->mbfp)) != 1)
-					{
-					status = MB_FAILURE;
-					*error = MB_ERROR_EOF;
-					expect = EM2_NONE;
-					}
-				}
-			done = MB_NO;
-			}
-
-		/* bail out if there is an error */
-		if (status == MB_FAILURE)
-			done = MB_YES;
-
-		/* if necessary read over unread but expected bytes */
-		bytes_read = ftell(mbfp) - mb_io_ptr->file_bytes - 4;
-		if (*label_save_flag == MB_NO && good_end_bytes == MB_NO
-			&& bytes_read < record_size)
-			{
-#ifdef MBR_EM300RAW_DEBUG
-	fprintf(stderr,"skip over %d unread bytes of supported datagram type %x\n",
-			record_size - bytes_read, type);
-#endif
-			for (i=0;i<record_size - bytes_read;i++)
-				{
-				if ((read_len = fread(&junk,
-					1,1,mb_io_ptr->mbfp)) != 1)
-					{
-					status = MB_FAILURE;
-					*error = MB_ERROR_EOF;
-					expect = EM2_NONE;
-					}
-				}
-			}
-
-#ifdef MBR_EM300RAW_DEBUG
-	fprintf(stderr,"record_size:%d bytes read:%ld file_pos old:%ld new:%ld\n",
-		record_size, ftell(mbfp) - mb_io_ptr->file_bytes, mb_io_ptr->file_bytes, ftell(mbfp));
-	fprintf(stderr,"done:%d expect:%x status:%d error:%d\n",
-		done, expect, status, *error);
-	fprintf(stderr,"end of mbr_em300raw_rd_data loop:\n\n");
-#endif
-
-		/* get file position */
-		if (*label_save_flag == MB_YES)
-			mb_io_ptr->file_bytes = ftell(mbfp) - 2;
-		else
-			mb_io_ptr->file_bytes = ftell(mbfp);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em300raw_chk_label(int verbose, void *mbio_ptr, char *label, short *type, short *sonar)
-{
-	char	*function_name = "mbr_em300raw_chk_label";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	mb_u_char	startbyte;
-	mb_u_char	typebyte;
-	short	*sonar_save;
-	short	sonarunswap;
-	short	sonarswap;
-	int	swap;
-	int	*databyteswapped;
-	int	typegood;
-	int	sonargood;
-	int	sonarswapgood;
-	int	sonarunswapgood;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       label:      %x%x%x%x\n",label[0],label[1],label[2],label[3]);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-	sonar_save = (short *) (&mb_io_ptr->save4);
-	databyteswapped = (int *) &mb_io_ptr->save10;
-
-#ifdef MBR_EM300RAW_DEBUG
-	fprintf(stderr, "Check label: %x|%x|%x|%x\n", label[0],label[1],label[2],label[3]);
-#endif
-
-	/* check for valid start byte and type */
-	startbyte = label[0];
-	typebyte = label[1];
-	if (startbyte ==  EM2_START_BYTE &&
-		(typebyte == EM2_ID_STOP2
-		|| typebyte == EM2_ID_OFF
-		|| typebyte == EM2_ID_ON
-		|| typebyte == EM2_ID_ATTITUDE
-		|| typebyte == EM2_ID_CLOCK
-		|| typebyte == EM2_ID_BATH
-		|| typebyte == EM2_ID_SBDEPTH
-		|| typebyte == EM2_ID_RAWBEAM
-		|| typebyte == EM2_ID_SSV
-		|| typebyte == EM2_ID_HEADING
-		|| typebyte == EM2_ID_START
-		|| typebyte == EM2_ID_TILT
-		|| typebyte == EM2_ID_CBECHO
-		|| typebyte == EM2_ID_POS
-		|| typebyte == EM2_ID_RUN_PARAMETER
-		|| typebyte == EM2_ID_SS
-		|| typebyte == EM2_ID_TIDE
-		|| typebyte == EM2_ID_SVP2
-		|| typebyte == EM2_ID_SVP
-		|| typebyte == EM2_ID_SSPINPUT
-		|| typebyte == EM2_ID_RAWBEAM2
-		|| typebyte == EM2_ID_RAWBEAM3
-		|| typebyte == EM2_ID_HEIGHT
-		|| typebyte == EM2_ID_STOP
-		|| typebyte == EM2_ID_WATERCOLUMN
-		|| typebyte == EM2_ID_REMOTE
-		|| typebyte == EM2_ID_SSP
-		|| typebyte == EM2_ID_BATH_MBA
-		|| typebyte == EM2_ID_SS_MBA))
-		{
-		typegood = MB_YES;
-		}
-	else
-		{
-		typegood = MB_NO;
-		}
-
-	/* check for data byte swapping if necessary */
-	if (typegood == MB_YES && *databyteswapped == -1)
-		{
-		sonarunswap = *((short *)&label[2]);
-		sonarswap = mb_swap_short(sonarunswap);
-
-		/* check for valid sonarunswap */
-		if (sonarunswap == MBSYS_SIMRAD2_EM120
-			|| sonarunswap == MBSYS_SIMRAD2_EM300
-			|| sonarunswap == MBSYS_SIMRAD2_EM1002
-			|| sonarunswap == MBSYS_SIMRAD2_EM2000
-			|| sonarunswap == MBSYS_SIMRAD2_EM3000
-			|| sonarunswap == MBSYS_SIMRAD2_EM3000D_1
-			|| sonarunswap == MBSYS_SIMRAD2_EM3000D_2
-			|| sonarunswap == MBSYS_SIMRAD2_EM3000D_3
-			|| sonarunswap == MBSYS_SIMRAD2_EM3000D_4
-			|| sonarunswap == MBSYS_SIMRAD2_EM3000D_5
-			|| sonarunswap == MBSYS_SIMRAD2_EM3000D_6
-			|| sonarunswap == MBSYS_SIMRAD2_EM3000D_7
-			|| sonarunswap == MBSYS_SIMRAD2_EM3000D_8
-			|| sonarunswap == MBSYS_SIMRAD2_EM3002
-			|| sonarunswap == MBSYS_SIMRAD2_EM710)
-			{
-			sonarunswapgood = MB_YES;
-			}
-		else
-			{
-			sonarunswapgood = MB_NO;
-			}
-
-		/* check for valid sonarswap */
-		if (sonarswap == MBSYS_SIMRAD2_EM120
-			|| sonarswap == MBSYS_SIMRAD2_EM300
-			|| sonarswap == MBSYS_SIMRAD2_EM1002
-			|| sonarswap == MBSYS_SIMRAD2_EM2000
-			|| sonarswap == MBSYS_SIMRAD2_EM3000
-			|| sonarswap == MBSYS_SIMRAD2_EM3000D_1
-			|| sonarswap == MBSYS_SIMRAD2_EM3000D_2
-			|| sonarswap == MBSYS_SIMRAD2_EM3000D_3
-			|| sonarswap == MBSYS_SIMRAD2_EM3000D_4
-			|| sonarswap == MBSYS_SIMRAD2_EM3000D_5
-			|| sonarswap == MBSYS_SIMRAD2_EM3000D_6
-			|| sonarswap == MBSYS_SIMRAD2_EM3000D_7
-			|| sonarswap == MBSYS_SIMRAD2_EM3000D_8
-			|| sonarswap == MBSYS_SIMRAD2_EM3002
-			|| sonarswap == MBSYS_SIMRAD2_EM710)
-			{
-			sonarswapgood = MB_YES;
-			}
-		else
-			{
-			sonarswapgood = MB_NO;
-			}
-
-		if (sonarunswapgood == MB_YES && sonarswapgood == MB_NO)
-			{
-			if (mb_io_ptr->byteswapped == MB_YES)
-				*databyteswapped = MB_YES;
-			else
-				*databyteswapped = MB_NO;
-			}
-		else if (sonarunswapgood == MB_NO && sonarswapgood == MB_YES)
-			{
-			if (mb_io_ptr->byteswapped == MB_YES)
-				*databyteswapped = MB_NO;
-			else
-				*databyteswapped = MB_YES;
-			}
-
-		}
-
-	/* set flag to swap bytes if necessary */
-	swap =  *databyteswapped;
-
-	*type = *((short *)&label[0]);
-	*sonar = *((short *)&label[2]);
-	if (mb_io_ptr->byteswapped == MB_YES)
-		*type = mb_swap_short(*type);
-	if (*databyteswapped != mb_io_ptr->byteswapped)
-		{
-		*sonar = mb_swap_short(*sonar);
-		}
-
-#ifdef MBR_EM300RAW_DEBUG
-fprintf(stderr,"typegood:%d mb_io_ptr->byteswapped:%d sonarswapgood:%d *databyteswapped:%d *type:%d *sonar:%d\n",typegood,mb_io_ptr->byteswapped,sonarswapgood,*databyteswapped,*type,*sonar);
-#endif
-
-	/* check for valid sonar */
-	if (*sonar != MBSYS_SIMRAD2_EM120
-		&& *sonar != MBSYS_SIMRAD2_EM300
-		&& *sonar != MBSYS_SIMRAD2_EM1002
-		&& *sonar != MBSYS_SIMRAD2_EM2000
-		&& *sonar != MBSYS_SIMRAD2_EM3000
-		&& *sonar != MBSYS_SIMRAD2_EM3000D_1
-		&& *sonar != MBSYS_SIMRAD2_EM3000D_2
-		&& *sonar != MBSYS_SIMRAD2_EM3000D_3
-		&& *sonar != MBSYS_SIMRAD2_EM3000D_4
-		&& *sonar != MBSYS_SIMRAD2_EM3000D_5
-		&& *sonar != MBSYS_SIMRAD2_EM3000D_6
-		&& *sonar != MBSYS_SIMRAD2_EM3000D_7
-		&& *sonar != MBSYS_SIMRAD2_EM3000D_8
-		&& *sonar != MBSYS_SIMRAD2_EM3002
-		&& *sonar != MBSYS_SIMRAD2_EM710)
-		{
-		sonargood = MB_NO;
-		}
-	else
-		{
-		sonargood = MB_YES;
-		}
-
-	if (startbyte == EM2_START_BYTE && typegood == MB_NO && sonargood == MB_YES)
-		{
-		mb_notice_log_problem(verbose, mbio_ptr,
-			MB_PROBLEM_BAD_DATAGRAM);
-		if (verbose >= 1)
-		    fprintf(stderr, "Bad datagram type: %4.4hX %4.4hX | %d %d\n", *type, *sonar, *type, *sonar);
-		}
-	if (typegood != MB_YES || sonargood != MB_YES)
-		{
-		status = MB_FAILURE;
-		}
-
-	/* save sonar if successful */
-	if (status == MB_SUCCESS)
-	    *sonar_save = *sonar;
-
-	/* allow exception found in some EM3000 data */
-	if (*type == EM2_SVP && *sonar == 0 && *sonar_save == MBSYS_SIMRAD2_EM3000)
-		{
-		status = MB_SUCCESS;
-		*sonar = *sonar_save;
-		}
-
-	/* allow exception found in some data */
-	if (*type == EM2_SSV && *sonar == 0 && *sonar_save != 0)
-		{
-		status = MB_SUCCESS;
-		*sonar = *sonar_save;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       type:       %d\n",*type);
-		fprintf(stderr,"dbg2       sonar:      %d\n",*sonar);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em300raw_rd_start(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store,
-		short type, short sonar, int *version, int *goodend, int *error)
-{
-	char	*function_name = "mbr_em300raw_rd_start";
-	int	status = MB_SUCCESS;
-	char	line[MBSYS_SIMRAD2_BUFFER_SIZE];
-	short	short_val;
-	int	read_len, len;
-	int	done;
-	char	*comma_ptr;
-	int	i1, i2, i3;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		fprintf(stderr,"dbg2       type:       %d\n",type);
-		fprintf(stderr,"dbg2       sonar:      %d\n",sonar);
-		}
-
-	/* set goodend false until a good end is found */
-	*goodend = MB_NO;
-
-	/* make sure comment is initialized */
-	store->par_com[0] = '\0';
-
-	/* set type value */
-	store->type = type;
-	store->sonar = sonar;
-
-	/* read binary values into char array */
-	read_len = fread(line,1,EM2_START_HEADER_SIZE,mbfp);
-	if (read_len == EM2_START_HEADER_SIZE)
-		status = MB_SUCCESS;
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	/* get binary header data */
-	if (status == MB_SUCCESS)
-		{
-		mb_get_binary_int(swap, &line[0], &store->par_date);
-		    store->date = store->par_date;
-		mb_get_binary_int(swap, &line[4], &store->par_msec);
-		    store->msec = store->par_msec;
-		mb_get_binary_short(swap, &line[8], &short_val);
-		    store->par_line_num = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[10], &short_val);
-		    store->par_serial_1 = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[12], &short_val);
-		    store->par_serial_2 = (int) ((unsigned short) short_val);
-		}
-
-	/* check for dual head sonars */
-	if (store->par_serial_1 != 0 && store->par_serial_2 != 0)
-		store->numberheads = 2;
-
-	/* now loop over reading individual characters to
-	    handle ASCII parameter values */
-	done = MB_NO;
-	len = 0;
-	while (status == MB_SUCCESS && done == MB_NO)
-		{
-		read_len = fread(&line[len],1,1,mbfp);
-		if (read_len == 1)
-			{
-			status = MB_SUCCESS;
-			len++;
-			}
-		else
-			{
-			done = MB_YES;
-			status = MB_FAILURE;
-			*error = MB_ERROR_EOF;
-			}
-
-		if (status == MB_SUCCESS
-			&& (((mb_u_char)(line[len-1])) < 32
-			    || ((mb_u_char)(line[len-1])) > 127)
-			&& ((mb_u_char)(line[len-1])) != '\r'
-			&& ((mb_u_char)(line[len-1])) != '\n')
-			{
-			done = MB_YES;
-			if (len > 1)
-			    line[0] = line[len-1];
-			}
-		else if (status == MB_SUCCESS
-			&& line[len-1] == ','
-			&& len > 5)
-			{
-			line[len] = 0;
-			if (strncmp("WLZ=", line, 4) == 0)
-			    mb_get_double(&(store->par_wlz), &line[4], len-5);
-			else if (strncmp("SMH=", line, 4) == 0)
-			    mb_get_int(&(store->par_smh), &line[4], len-5);
-			else if (strncmp("S1Z=", line, 4) == 0)
-			    mb_get_double(&(store->par_s1z), &line[4], len-5);
-			else if (strncmp("S1X=", line, 4) == 0)
-			    mb_get_double(&(store->par_s1x), &line[4], len-5);
-			else if (strncmp("S1Y=", line, 4) == 0)
-			    mb_get_double(&(store->par_s1y), &line[4], len-5);
-			else if (strncmp("S1H=", line, 4) == 0)
-			    mb_get_double(&(store->par_s1h), &line[4], len-5);
-			else if (strncmp("S1R=", line, 4) == 0)
-			    mb_get_double(&(store->par_s1r), &line[4], len-5);
-			else if (strncmp("S1P=", line, 4) == 0)
-			    mb_get_double(&(store->par_s1p), &line[4], len-5);
-			else if (strncmp("S1N=", line, 4) == 0)
-			    mb_get_int(&(store->par_s1n), &line[4], len-5);
-			else if (strncmp("S2Z=", line, 4) == 0)
-			    mb_get_double(&(store->par_s2z), &line[4], len-5);
-			else if (strncmp("S2X=", line, 4) == 0)
-			    mb_get_double(&(store->par_s2x), &line[4], len-5);
-			else if (strncmp("S2Y=", line, 4) == 0)
-			    mb_get_double(&(store->par_s2y), &line[4], len-5);
-			else if (strncmp("S2H=", line, 4) == 0)
-			    mb_get_double(&(store->par_s2h), &line[4], len-5);
-			else if (strncmp("S2R=", line, 4) == 0)
-			    mb_get_double(&(store->par_s2r), &line[4], len-5);
-			else if (strncmp("S2P=", line, 4) == 0)
-			    mb_get_double(&(store->par_s2p), &line[4], len-5);
-			else if (strncmp("S2N=", line, 4) == 0)
-			    mb_get_int(&(store->par_s2n), &line[4], len-5);
-			else if (strncmp("GO1=", line, 4) == 0)
-			    mb_get_double(&(store->par_go1), &line[4], len-5);
-			else if (strncmp("GO2=", line, 4) == 0)
-			    mb_get_double(&(store->par_go2), &line[4], len-5);
-			else if (strncmp("TSV=", line, 4) == 0)
-			    strncpy(store->par_tsv, &line[4], MIN(len-5, 15));
-			else if (strncmp("RSV=", line, 4) == 0)
-			    strncpy(store->par_rsv, &line[4], MIN(len-5, 15));
-			else if (strncmp("BSV=", line, 4) == 0)
-			    strncpy(store->par_bsv, &line[4], MIN(len-5, 15));
-			else if (strncmp("PSV=", line, 4) == 0)
-			    {
-			    /* save the processor software version to use
-			       in tracking changes to the data format */
-			    strncpy(store->par_psv, &line[4], MIN(len-5, 15));
-			    if (sscanf(store->par_psv, "%d.%d.%d", &i1, &i2, &i3)
-				== 3)
-				*version = i3 + 100 * i2 + 10000 * i1;
-			    }
-			else if (strncmp("OSV=", line, 4) == 0)
-			    strncpy(store->par_osv, &line[4], MIN(len-5, 15));
-			else if (strncmp("DSD=", line, 4) == 0)
-			    mb_get_double(&(store->par_dsd), &line[4], len-5);
-			else if (strncmp("DSO=", line, 4) == 0)
-			    mb_get_double(&(store->par_dso), &line[4], len-5);
-			else if (strncmp("DSF=", line, 4) == 0)
-			    mb_get_double(&(store->par_dsf), &line[4], len-5);
-			else if (strncmp("DSH=", line, 4) == 0)
-			    {
-			    store->par_dsh[0] = line[4];
-			    store->par_dsh[1] = line[5];
-			    }
-			else if (strncmp("APS=", line, 4) == 0)
-			    mb_get_int(&(store->par_aps), &line[4], len-5);
-			else if (strncmp("P1M=", line, 4) == 0)
-			    mb_get_int(&(store->par_p1m), &line[4], len-5);
-			else if (strncmp("P1T=", line, 4) == 0)
-			    mb_get_int(&(store->par_p1t), &line[4], len-5);
-			else if (strncmp("P1Z=", line, 4) == 0)
-			    mb_get_double(&(store->par_p1z), &line[4], len-5);
-			else if (strncmp("P1X=", line, 4) == 0)
-			    mb_get_double(&(store->par_p1x), &line[4], len-5);
-			else if (strncmp("P1Y=", line, 4) == 0)
-			    mb_get_double(&(store->par_p1y), &line[4], len-5);
-			else if (strncmp("P1D=", line, 4) == 0)
-			    mb_get_double(&(store->par_p1d), &line[4], len-5);
-			else if (strncmp("P1G=", line, 4) == 0)
-			    strncpy(store->par_p1g, &line[4], MIN(len-5, 15));
-			else if (strncmp("P2M=", line, 4) == 0)
-			    mb_get_int(&(store->par_p2m), &line[4], len-5);
-			else if (strncmp("P2T=", line, 4) == 0)
-			    mb_get_int(&(store->par_p2t), &line[4], len-5);
-			else if (strncmp("P2Z=", line, 4) == 0)
-			    mb_get_double(&(store->par_p2z), &line[4], len-5);
-			else if (strncmp("P2X=", line, 4) == 0)
-			    mb_get_double(&(store->par_p2x), &line[4], len-5);
-			else if (strncmp("P2Y=", line, 4) == 0)
-			    mb_get_double(&(store->par_p2y), &line[4], len-5);
-			else if (strncmp("P2D=", line, 4) == 0)
-			    mb_get_double(&(store->par_p2d), &line[4], len-5);
-			else if (strncmp("P2G=", line, 4) == 0)
-			    strncpy(store->par_p2g, &line[4], MIN(len-5, 15));
-			else if (strncmp("P3M=", line, 4) == 0)
-			    mb_get_int(&(store->par_p3m), &line[4], len-5);
-			else if (strncmp("P3T=", line, 4) == 0)
-			    mb_get_int(&(store->par_p3t), &line[4], len-5);
-			else if (strncmp("P3Z=", line, 4) == 0)
-			    mb_get_double(&(store->par_p3z), &line[4], len-5);
-			else if (strncmp("P3X=", line, 4) == 0)
-			    mb_get_double(&(store->par_p3x), &line[4], len-5);
-			else if (strncmp("P3Y=", line, 4) == 0)
-			    mb_get_double(&(store->par_p3y), &line[4], len-5);
-			else if (strncmp("P3D=", line, 4) == 0)
-			    mb_get_double(&(store->par_p3d), &line[4], len-5);
-			else if (strncmp("P3G=", line, 4) == 0)
-			    strncpy(store->par_p3g, &line[4], MIN(len-5, 15));
-			else if (strncmp("MSZ=", line, 4) == 0)
-			    mb_get_double(&(store->par_msz), &line[4], len-5);
-			else if (strncmp("MSX=", line, 4) == 0)
-			    mb_get_double(&(store->par_msx), &line[4], len-5);
-			else if (strncmp("MSY=", line, 4) == 0)
-			    mb_get_double(&(store->par_msy), &line[4], len-5);
-			else if (strncmp("MRP=", line, 4) == 0)
-			    {
-			    store->par_mrp[0] = line[4];
-			    store->par_mrp[1] = line[5];
-			    }
-			else if (strncmp("MSD=", line, 4) == 0)
-			    mb_get_double(&(store->par_msd), &line[4], len-5);
-			else if (strncmp("MSR=", line, 4) == 0)
-			    mb_get_double(&(store->par_msr), &line[4], len-5);
-			else if (strncmp("MSP=", line, 4) == 0)
-			    mb_get_double(&(store->par_msp), &line[4], len-5);
-			else if (strncmp("MSG=", line, 4) == 0)
-			    mb_get_double(&(store->par_msg), &line[4], len-5);
-			else if (strncmp("GCG=", line, 4) == 0)
-			    mb_get_double(&(store->par_gcg), &line[4], len-5);
-			else if (strncmp("CPR=", line, 4) == 0)
-			    strncpy(store->par_cpr, &line[4], MIN(len-5, 3));
-			else if (strncmp("ROP=", line, 4) == 0)
-			    strncpy(store->par_rop, &line[4], MIN(len-5, MBSYS_SIMRAD2_COMMENT_LENGTH-1));
-			else if (strncmp("SID=", line, 4) == 0)
-			    strncpy(store->par_sid, &line[4], MIN(len-5, MBSYS_SIMRAD2_COMMENT_LENGTH-1));
-			else if (strncmp("PLL=", line, 4) == 0)
-			    strncpy(store->par_pll, &line[4], MIN(len-5, MBSYS_SIMRAD2_COMMENT_LENGTH-1));
-			else if (strncmp("COM=", line, 4) == 0)
-			    {
-			    strncpy(store->par_com, &line[4], MIN(len-5, MBSYS_SIMRAD2_COMMENT_LENGTH-1));
-			    store->par_com[MIN(len-5, MBSYS_SIMRAD2_COMMENT_LENGTH-1)] = 0;
-			    /* replace caret (^) values with commas (,) to circumvent
-			       the format's inability to store commas in comments */
-			    while ((comma_ptr = strchr(store->par_com, '^')) != NULL)
-				{
-				comma_ptr[0] = ',';
-				}
-			    }
-			len = 0;
-			}
-		else if (status == MB_SUCCESS
-			&& line[len-1] == ','
-			&& len <= 5)
-			{
-			len = 0;
-			}
-		}
-
-	/* now set the data kind */
-	if (status == MB_SUCCESS)
-		{
-		if (strlen(store->par_com) > 0)
-		    store->kind = MB_DATA_COMMENT;
-		else if (store->type == EM2_START)
-		    store->kind = MB_DATA_START;
-		else if (store->type == EM2_STOP)
-		    store->kind = MB_DATA_STOP;
-		else if (store->type == EM2_STOP2)
-		    store->kind = MB_DATA_STOP;
-		else if (store->type == EM2_OFF)
-		    store->kind = MB_DATA_STOP;
-		else if (store->type == EM2_ON)
-		    store->kind = MB_DATA_START;
-		}
-
-	/* read end of record and last two check sum bytes */
-	if (status == MB_SUCCESS)
-	    {
-	    /* if EM2_END not yet found then the
-		next byte should be EM2_END */
-	    if (line[0] != EM2_END)
-		{
-		read_len = fread(&line[0],1,1,mbfp);
-		}
-
-	    /* if EM2_END not yet found then the
-		next byte should be EM2_END */
-	    if (line[0] != EM2_END)
-		{
-		read_len = fread(&line[0],1,1,mbfp);
-		}
-
-	    /* if we got the end byte then get check sum bytes */
-	    if (line[0] == EM2_END)
-		{
-		if (line[0] == EM2_END)
-			*goodend = MB_YES;
-		read_len = fread(&line[1],2,1,mbfp);
-	    /* don't check success of read
-	        - return success here even if read fails
-	        because all of the
-		important information in this record has
-		already been read - next attempt to read
-		file will return error */
-#ifdef MBR_EM300RAW_DEBUG
-	fprintf(stderr, "End Bytes: %2.2hX %d | %2.2hX %d | %2.2hX %d\n",
-		line[0], line[0],
-		line[1], line[1],
-		line[2], line[2]);
-#endif
-		}
-#ifdef MBR_EM300RAW_DEBUG
-	fprintf(stderr, "\n");
-#endif
-	    }
-
-	/* print debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       par_date:        %d\n",store->par_date);
-		fprintf(stderr,"dbg5       par_msec:        %d\n",store->par_msec);
-		fprintf(stderr,"dbg5       par_line_num:    %d\n",store->par_line_num);
-		fprintf(stderr,"dbg5       par_serial_1:    %d\n",store->par_serial_1);
-		fprintf(stderr,"dbg5       par_serial_2:    %d\n",store->par_serial_2);
-		fprintf(stderr,"dbg5       par_wlz:         %f\n",store->par_wlz);
-		fprintf(stderr,"dbg5       par_smh:         %d\n",store->par_smh);
-		fprintf(stderr,"dbg5       par_s1z:         %f\n",store->par_s1z);
-		fprintf(stderr,"dbg5       par_s1x:         %f\n",store->par_s1x);
-		fprintf(stderr,"dbg5       par_s1y:         %f\n",store->par_s1y);
-		fprintf(stderr,"dbg5       par_s1h:         %f\n",store->par_s1h);
-		fprintf(stderr,"dbg5       par_s1r:         %f\n",store->par_s1r);
-		fprintf(stderr,"dbg5       par_s1p:         %f\n",store->par_s1p);
-		fprintf(stderr,"dbg5       par_s1n:         %d\n",store->par_s1n);
-		fprintf(stderr,"dbg5       par_s2z:         %f\n",store->par_s2z);
-		fprintf(stderr,"dbg5       par_s2x:         %f\n",store->par_s2x);
-		fprintf(stderr,"dbg5       par_s2y:         %f\n",store->par_s2y);
-		fprintf(stderr,"dbg5       par_s2h:         %f\n",store->par_s2h);
-		fprintf(stderr,"dbg5       par_s2r:         %f\n",store->par_s2r);
-		fprintf(stderr,"dbg5       par_s2p:         %f\n",store->par_s2p);
-		fprintf(stderr,"dbg5       par_s2n:         %d\n",store->par_s2n);
-		fprintf(stderr,"dbg5       par_go1:         %f\n",store->par_go1);
-		fprintf(stderr,"dbg5       par_go2:         %f\n",store->par_go2);
-		fprintf(stderr,"dbg5       par_tsv:         %s\n",store->par_tsv);
-		fprintf(stderr,"dbg5       par_rsv:         %s\n",store->par_rsv);
-		fprintf(stderr,"dbg5       par_bsv:         %s\n",store->par_bsv);
-		fprintf(stderr,"dbg5       par_psv:         %s\n",store->par_psv);
-		fprintf(stderr,"dbg5       par_osv:         %s\n",store->par_osv);
-		fprintf(stderr,"dbg5       par_dsd:         %f\n",store->par_dsd);
-		fprintf(stderr,"dbg5       par_dso:         %f\n",store->par_dso);
-		fprintf(stderr,"dbg5       par_dsf:         %f\n",store->par_dsf);
-		fprintf(stderr,"dbg5       par_dsh:         %c%c\n",
-			store->par_dsh[0],store->par_dsh[1]);
-		fprintf(stderr,"dbg5       par_aps:         %d\n",store->par_aps);
-		fprintf(stderr,"dbg5       par_p1m:         %d\n",store->par_p1m);
-		fprintf(stderr,"dbg5       par_p1t:         %d\n",store->par_p1t);
-		fprintf(stderr,"dbg5       par_p1z:         %f\n",store->par_p1z);
-		fprintf(stderr,"dbg5       par_p1x:         %f\n",store->par_p1x);
-		fprintf(stderr,"dbg5       par_p1y:         %f\n",store->par_p1y);
-		fprintf(stderr,"dbg5       par_p1d:         %f\n",store->par_p1d);
-		fprintf(stderr,"dbg5       par_p1g:         %s\n",store->par_p1g);
-		fprintf(stderr,"dbg5       par_p2m:         %d\n",store->par_p2m);
-		fprintf(stderr,"dbg5       par_p2t:         %d\n",store->par_p2t);
-		fprintf(stderr,"dbg5       par_p2z:         %f\n",store->par_p2z);
-		fprintf(stderr,"dbg5       par_p2x:         %f\n",store->par_p2x);
-		fprintf(stderr,"dbg5       par_p2y:         %f\n",store->par_p2y);
-		fprintf(stderr,"dbg5       par_p2d:         %f\n",store->par_p2d);
-		fprintf(stderr,"dbg5       par_p2g:         %s\n",store->par_p2g);
-		fprintf(stderr,"dbg5       par_p3m:         %d\n",store->par_p3m);
-		fprintf(stderr,"dbg5       par_p3t:         %d\n",store->par_p3t);
-		fprintf(stderr,"dbg5       par_p3z:         %f\n",store->par_p3z);
-		fprintf(stderr,"dbg5       par_p3x:         %f\n",store->par_p3x);
-		fprintf(stderr,"dbg5       par_p3y:         %f\n",store->par_p3y);
-		fprintf(stderr,"dbg5       par_p3d:         %f\n",store->par_p3d);
-		fprintf(stderr,"dbg5       par_p3g:         %s\n",store->par_p3g);
-		fprintf(stderr,"dbg5       par_msz:         %f\n",store->par_msz);
-		fprintf(stderr,"dbg5       par_msx:         %f\n",store->par_msx);
-		fprintf(stderr,"dbg5       par_msy:         %f\n",store->par_msy);
-		fprintf(stderr,"dbg5       par_mrp:         %c%c\n",
-			store->par_mrp[0],store->par_mrp[1]);
-		fprintf(stderr,"dbg5       par_msd:         %f\n",store->par_msd);
-		fprintf(stderr,"dbg5       par_msr:         %f\n",store->par_msr);
-		fprintf(stderr,"dbg5       par_msp:         %f\n",store->par_msp);
-		fprintf(stderr,"dbg5       par_msg:         %f\n",store->par_msg);
-		fprintf(stderr,"dbg5       par_gcg:         %f\n",store->par_gcg);
-		fprintf(stderr,"dbg5       par_cpr:         %s\n",store->par_cpr);
-		fprintf(stderr,"dbg5       par_rop:         %s\n",store->par_rop);
-		fprintf(stderr,"dbg5       par_sid:         %s\n",store->par_sid);
-		fprintf(stderr,"dbg5       par_pll:         %s\n",store->par_pll);
-		fprintf(stderr,"dbg5       par_com:         %s\n",store->par_com);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       version:    %d\n",*version);
-		fprintf(stderr,"dbg2       goodend:    %d\n",*goodend);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em300raw_rd_run_parameter(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store,
-		short sonar, int *goodend, int *error)
-{
-	char	*function_name = "mbr_em300raw_rd_run_parameter";
-	int	status = MB_SUCCESS;
-	char	line[EM2_RUN_PARAMETER_SIZE];
-	short	short_val;
-	int	read_len;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		fprintf(stderr,"dbg2       sonar:      %d\n",sonar);
-		}
-
-	/* set goodend false until a good end is found */
-	*goodend = MB_NO;
-
-	/* set kind and type values */
-	store->kind = MB_DATA_RUN_PARAMETER;
-	store->type = EM2_RUN_PARAMETER;
-	store->sonar = sonar;
-
-	/* read binary values into char array */
-	read_len = fread(line,1,EM2_RUN_PARAMETER_SIZE-4,mbfp);
-	if (read_len == EM2_RUN_PARAMETER_SIZE-4)
-		status = MB_SUCCESS;
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	/* get binary data */
-	if (status == MB_SUCCESS)
-		{
-		mb_get_binary_int(swap, &line[0], &store->run_date);
-		    if (store->run_date != 0) store->date = store->run_date;
-		mb_get_binary_int(swap, &line[4], &store->run_msec);
-		    if (store->run_date != 0) store->msec = store->run_msec;
-		mb_get_binary_short(swap, &line[8], &short_val);
-		    store->run_ping_count = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[10], &short_val);
-		    store->run_serial = (int) ((unsigned short) short_val);
-		mb_get_binary_int(swap, &line[12], &store->run_status);
-		store->run_mode = (mb_u_char) line[16];
-		store->run_filter_id = (mb_u_char) line[17];
-		mb_get_binary_short(swap, &line[18], &short_val);
-		    store->run_min_depth = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[20], &short_val);
-		    store->run_max_depth = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[22], &short_val);
-		    store->run_absorption = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[24], &short_val);
-		    store->run_tran_pulse = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[26], &short_val);
-		    store->run_tran_beam = (int) ((unsigned short) short_val);
-		store->run_tran_pow = (mb_u_char) line[28];
-		store->run_rec_beam = (mb_u_char) line[29];
-		store->run_rec_band = (mb_u_char) line[30];
-		store->run_rec_gain = (mb_u_char) line[31];
-		store->run_tvg_cross = (mb_u_char) line[32];
-		store->run_ssv_source = (mb_u_char) line[33];
-		mb_get_binary_short(swap, &line[34], &short_val);
-		    store->run_max_swath = (int) ((unsigned short) short_val);
-		store->run_beam_space = (mb_u_char) line[36];
-		store->run_swath_angle = (mb_u_char) line[37];
-		store->run_stab_mode = (mb_u_char) line[38];
-		for (i=0;i<6;i++)
-		    store->run_spare[i] = line[39+i];
-		if (line[EM2_RUN_PARAMETER_SIZE-7] == EM2_END)
-			*goodend = MB_YES;
-#ifdef MBR_EM300RAW_DEBUG
-	fprintf(stderr, "End Bytes: %2.2hX %d | %2.2hX %d | %2.2hX %d\n",
-		line[EM2_RUN_PARAMETER_SIZE-7], line[EM2_RUN_PARAMETER_SIZE-7],
-		line[EM2_RUN_PARAMETER_SIZE-6], line[EM2_RUN_PARAMETER_SIZE-6],
-		line[EM2_RUN_PARAMETER_SIZE-5], line[EM2_RUN_PARAMETER_SIZE-5]);
-#endif
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       run_date:        %d\n",store->run_date);
-		fprintf(stderr,"dbg5       run_msec:        %d\n",store->run_msec);
-		fprintf(stderr,"dbg5       run_ping_count:  %d\n",store->run_ping_count);
-		fprintf(stderr,"dbg5       run_serial:      %d\n",store->run_serial);
-		fprintf(stderr,"dbg5       run_status:      %d\n",store->run_status);
-		fprintf(stderr,"dbg5       run_mode:        %d\n",store->run_mode);
-		fprintf(stderr,"dbg5       run_filter_id:   %d\n",store->run_filter_id);
-		fprintf(stderr,"dbg5       run_min_depth:   %d\n",store->run_min_depth);
-		fprintf(stderr,"dbg5       run_max_depth:   %d\n",store->run_max_depth);
-		fprintf(stderr,"dbg5       run_absorption:  %d\n",store->run_absorption);
-		fprintf(stderr,"dbg5       run_tran_pulse:  %d\n",store->run_tran_pulse);
-		fprintf(stderr,"dbg5       run_tran_beam:   %d\n",store->run_tran_beam);
-		fprintf(stderr,"dbg5       run_tran_pow:    %d\n",store->run_tran_pow);
-		fprintf(stderr,"dbg5       run_rec_beam:    %d\n",store->run_rec_beam);
-		fprintf(stderr,"dbg5       run_rec_band:    %d\n",store->run_rec_band);
-		fprintf(stderr,"dbg5       run_rec_gain:    %d\n",store->run_rec_gain);
-		fprintf(stderr,"dbg5       run_tvg_cross:   %d\n",store->run_tvg_cross);
-		fprintf(stderr,"dbg5       run_ssv_source:  %d\n",store->run_ssv_source);
-		fprintf(stderr,"dbg5       run_max_swath:   %d\n",store->run_max_swath);
-		fprintf(stderr,"dbg5       run_beam_space:  %d\n",store->run_beam_space);
-		fprintf(stderr,"dbg5       run_swath_angle: %d\n",store->run_swath_angle);
-		fprintf(stderr,"dbg5       run_stab_mode:   %d\n",store->run_stab_mode);
-		for (i=0;i<6;i++)
-			fprintf(stderr,"dbg5       run_spare[%d]:    %d\n",i,store->run_spare[i]);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       goodend:    %d\n",*goodend);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em300raw_rd_clock(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store,
-		short sonar, int *goodend, int *error)
-{
-	char	*function_name = "mbr_em300raw_rd_clock";
-	int	status = MB_SUCCESS;
-	char	line[EM2_CLOCK_SIZE];
-	short	short_val;
-	int	read_len;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		fprintf(stderr,"dbg2       sonar:      %d\n",sonar);
-		}
-
-	/* set goodend false until a good end is found */
-	*goodend = MB_NO;
-
-	/* set kind and type values */
-	store->kind = MB_DATA_CLOCK;
-	store->type = EM2_CLOCK;
-	store->sonar = sonar;
-
-	/* read binary values into char array */
-	read_len = fread(line,1,EM2_CLOCK_SIZE-4,mbfp);
-	if (read_len == EM2_CLOCK_SIZE-4)
-		status = MB_SUCCESS;
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	/* get binary data */
-	if (status == MB_SUCCESS)
-		{
-		mb_get_binary_int(swap, &line[0], &store->clk_date);
-		    store->date = store->clk_date;
-		mb_get_binary_int(swap, &line[4], &store->clk_msec);
-		    store->msec = store->clk_msec;
-		mb_get_binary_short(swap, &line[8], &short_val);
-		    store->clk_count = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[10], &short_val);
-		    store->clk_serial = (int) ((unsigned short) short_val);
-		mb_get_binary_int(swap, &line[12], &store->clk_origin_date);
-		mb_get_binary_int(swap, &line[16], &store->clk_origin_msec);
-		store->clk_1_pps_use = (mb_u_char) line[20];
-		if (line[EM2_CLOCK_SIZE-7] == EM2_END)
-			*goodend = MB_YES;
-#ifdef MBR_EM300RAW_DEBUG
-	fprintf(stderr, "End Bytes: %2.2hX %d | %2.2hX %d | %2.2hX %d\n",
-		line[EM2_CLOCK_SIZE-7], line[EM2_CLOCK_SIZE-7],
-		line[EM2_CLOCK_SIZE-6], line[EM2_CLOCK_SIZE-6],
-		line[EM2_CLOCK_SIZE-5], line[EM2_CLOCK_SIZE-5]);
-#endif
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       clk_date:        %d\n",store->clk_date);
-		fprintf(stderr,"dbg5       clk_msec:        %d\n",store->clk_msec);
-		fprintf(stderr,"dbg5       clk_count:       %d\n",store->clk_count);
-		fprintf(stderr,"dbg5       clk_serial:      %d\n",store->clk_serial);
-		fprintf(stderr,"dbg5       clk_origin_date: %d\n",store->clk_origin_date);
-		fprintf(stderr,"dbg5       clk_origin_msec: %d\n",store->clk_origin_msec);
-		fprintf(stderr,"dbg5       clk_1_pps_use:   %d\n",store->clk_1_pps_use);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       goodend:    %d\n",*goodend);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em300raw_rd_tide(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store,
-		short sonar, int *goodend, int *error)
-{
-	char	*function_name = "mbr_em300raw_rd_tide";
-	int	status = MB_SUCCESS;
-	char	line[EM2_TIDE_SIZE];
-	short	short_val;
-	int	read_len;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		fprintf(stderr,"dbg2       sonar:      %d\n",sonar);
-		}
-
-	/* set goodend false until a good end is found */
-	*goodend = MB_NO;
-
-	/* set kind and type values */
-	store->kind = MB_DATA_TIDE;
-	store->type = EM2_TIDE;
-	store->sonar = sonar;
-
-	/* read binary values into char array */
-	read_len = fread(line,1,EM2_TIDE_SIZE-4,mbfp);
-	if (read_len == EM2_TIDE_SIZE-4)
-		status = MB_SUCCESS;
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	/* get binary data */
-	if (status == MB_SUCCESS)
-		{
-		mb_get_binary_int(swap, &line[0], &store->tid_date);
-		    store->date = store->tid_date;
-		mb_get_binary_int(swap, &line[4], &store->tid_msec);
-		    store->msec = store->tid_msec;
-		mb_get_binary_short(swap, &line[8], &short_val);
-		    store->tid_count = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[10], &short_val);
-		    store->tid_serial = (int) ((unsigned short) short_val);
-		mb_get_binary_int(swap, &line[12], &store->tid_origin_date);
-		mb_get_binary_int(swap, &line[16], &store->tid_origin_msec);
-		mb_get_binary_short(swap, &line[20], &short_val);
-		    store->tid_tide = (int) short_val;
-		if (line[EM2_TIDE_SIZE-7] == 0x03)
-			*goodend = MB_YES;
-#ifdef MBR_EM300RAW_DEBUG
-	fprintf(stderr, "End Bytes: %2.2hX %d | %2.2hX %d | %2.2hX %d\n",
-		line[EM2_TIDE_SIZE-7], line[EM2_TIDE_SIZE-7],
-		line[EM2_TIDE_SIZE-6], line[EM2_TIDE_SIZE-6],
-		line[EM2_TIDE_SIZE-5], line[EM2_TIDE_SIZE-5]);
-#endif
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       tid_date:        %d\n",store->tid_date);
-		fprintf(stderr,"dbg5       tid_msec:        %d\n",store->tid_msec);
-		fprintf(stderr,"dbg5       tid_count:       %d\n",store->tid_count);
-		fprintf(stderr,"dbg5       tid_serial:      %d\n",store->tid_serial);
-		fprintf(stderr,"dbg5       tid_origin_date: %d\n",store->tid_origin_date);
-		fprintf(stderr,"dbg5       tid_origin_msec: %d\n",store->tid_origin_msec);
-		fprintf(stderr,"dbg5       tid_tide:        %d\n",store->tid_tide);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       goodend:    %d\n",*goodend);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em300raw_rd_height(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store,
-		short sonar, int *goodend, int *error)
-{
-	char	*function_name = "mbr_em300raw_rd_height";
-	int	status = MB_SUCCESS;
-	char	line[EM2_HEIGHT_SIZE];
-	short	short_val;
-	int	read_len;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		fprintf(stderr,"dbg2       sonar:      %d\n",sonar);
-		}
-
-	/* set goodend false until a good end is found */
-	*goodend = MB_NO;
-
-	/* set kind and type values */
-	store->kind = MB_DATA_HEIGHT;
-	store->type = EM2_HEIGHT;
-	store->sonar = sonar;
-
-	/* read binary values into char array */
-	read_len = fread(line,1,EM2_HEIGHT_SIZE-4,mbfp);
-	if (read_len == EM2_HEIGHT_SIZE-4)
-		status = MB_SUCCESS;
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	/* get binary data */
-	if (status == MB_SUCCESS)
-		{
-		mb_get_binary_int(swap, &line[0], &store->hgt_date);
-		    store->date = store->hgt_date;
-		mb_get_binary_int(swap, &line[4], &store->hgt_msec);
-		    store->msec = store->hgt_msec;
-		mb_get_binary_short(swap, &line[8], &short_val);
-		    store->hgt_count = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[10], &short_val);
-		    store->hgt_serial = (int) ((unsigned short) short_val);
-		mb_get_binary_int(swap, &line[12], &store->hgt_height);
-		store->hgt_type = (mb_u_char) line[16];
-		if (line[EM2_HEIGHT_SIZE-7] == EM2_END)
-			*goodend = MB_YES;
-#ifdef MBR_EM300RAW_DEBUG
-	fprintf(stderr, "End Bytes: %2.2hX %d | %2.2hX %d | %2.2hX %d\n",
-		line[EM2_HEIGHT_SIZE-7], line[EM2_HEIGHT_SIZE-7],
-		line[EM2_HEIGHT_SIZE-6], line[EM2_HEIGHT_SIZE-6],
-		line[EM2_HEIGHT_SIZE-5], line[EM2_HEIGHT_SIZE-5]);
-#endif
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       hgt_date:        %d\n",store->hgt_date);
-		fprintf(stderr,"dbg5       hgt_msec:        %d\n",store->hgt_msec);
-		fprintf(stderr,"dbg5       hgt_count:       %d\n",store->hgt_count);
-		fprintf(stderr,"dbg5       hgt_serial:      %d\n",store->hgt_serial);
-		fprintf(stderr,"dbg5       hgt_height:      %d\n",store->hgt_height);
-		fprintf(stderr,"dbg5       hgt_type:        %d\n",store->hgt_type);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       goodend:    %d\n",*goodend);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em300raw_rd_heading(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store,
-		short sonar, int *goodend, int *error)
-{
-	char	*function_name = "mbr_em300raw_rd_heading";
-	int	status = MB_SUCCESS;
-	struct mbsys_simrad2_heading_struct *heading;
-	char	line[EM2_HEADING_HEADER_SIZE];
-	short	short_val;
-	int	read_len;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		fprintf(stderr,"dbg2       sonar:      %d\n",sonar);
-		}
-
-	/* set goodend false until a good end is found */
-	*goodend = MB_NO;
-
-	/* get  storage structure */
-	heading = (struct mbsys_simrad2_heading_struct *) store->heading;
-
-	/* set kind and type values */
-	store->kind = MB_DATA_HEADING;
-	store->type = EM2_HEADING;
-	store->sonar = sonar;
-
-	/* read binary header values into char array */
-	read_len = fread(line,1,EM2_HEADING_HEADER_SIZE,mbfp);
-	if (read_len == EM2_HEADING_HEADER_SIZE)
-		status = MB_SUCCESS;
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	/* get binary header data */
-	if (status == MB_SUCCESS)
-		{
-		mb_get_binary_int(swap, &line[0], &heading->hed_date);
-		    store->date = heading->hed_date;
-		mb_get_binary_int(swap, &line[4], &heading->hed_msec);
-		    store->msec = heading->hed_msec;
-		mb_get_binary_short(swap, &line[8], &short_val);
-		    heading->hed_count = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[10], &short_val);
-		    heading->hed_serial = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[12], &short_val);
-		    heading->hed_ndata = (int) ((unsigned short) short_val);
-		}
-
-	/* read binary heading values */
-	if (status == MB_SUCCESS)
-	    {
-	    for (i=0;i<heading->hed_ndata && status == MB_SUCCESS;i++)
-		{
-		read_len = fread(line,1,EM2_HEADING_SLICE_SIZE,mbfp);
-		if (read_len == EM2_HEADING_SLICE_SIZE
-			&& i < MBSYS_SIMRAD2_MAXHEADING)
-			{
-			status = MB_SUCCESS;
-			mb_get_binary_short(swap, &line[0], &short_val);
-			    heading->hed_time[i] = (int) ((unsigned short) short_val);
-			mb_get_binary_short(swap, &line[2], &short_val);
-			    heading->hed_heading[i] = (int) ((unsigned short) short_val);
-			}
-		else
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_EOF;
-			}
-		}
-	    heading->hed_ndata = MIN(heading->hed_ndata, MBSYS_SIMRAD2_MAXHEADING);
-	    }
-
-	/* now get last bytes of record */
-	if (status == MB_SUCCESS)
-		{
-		read_len = fread(&line[0],1,4,mbfp);
-		if (read_len == 4)
-			{
-			status = MB_SUCCESS;
-			heading->hed_heading_status = (mb_u_char) line[0];
-			}
-		else
-			{
-			/* return success here because all of the
-			    important information in this record has
-			    already been read - next attempt to read
-			    file will return error */
-			status = MB_SUCCESS;
-			}
-		if (line[1] == EM2_END)
-			*goodend = MB_YES;
-#ifdef MBR_EM300RAW_DEBUG
-	fprintf(stderr, "End Bytes: %2.2hX %d | %2.2hX %d | %2.2hX %d\n",
-		line[1], line[1],
-		line[2], line[2],
-		line[3], line[3]);
-#endif
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       hed_date:        %d\n",heading->hed_date);
-		fprintf(stderr,"dbg5       hed_msec:        %d\n",heading->hed_msec);
-		fprintf(stderr,"dbg5       hed_count:       %d\n",heading->hed_count);
-		fprintf(stderr,"dbg5       hed_serial:      %d\n",heading->hed_serial);
-		fprintf(stderr,"dbg5       hed_ndata:       %d\n",heading->hed_ndata);
-		fprintf(stderr,"dbg5       count    time (msec)    heading (0.01 deg)\n");
-		fprintf(stderr,"dbg5       -----    -----------    ------------------\n");
-		for (i=0;i<heading->hed_ndata;i++)
-			fprintf(stderr,"dbg5        %4d      %7d          %7d\n",
-				i, heading->hed_time[i], heading->hed_heading[i]);
-		fprintf(stderr,"dbg5       hed_heading_status: %d\n",heading->hed_heading_status);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       goodend:    %d\n",*goodend);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em300raw_rd_ssv(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store,
-		short sonar, int *goodend, int *error)
-{
-	char	*function_name = "mbr_em300raw_rd_ssv";
-	int	status = MB_SUCCESS;
-	struct mbsys_simrad2_ssv_struct *ssv;
-	char	line[EM2_SSV_HEADER_SIZE];
-	short	short_val;
-	int	read_len;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		fprintf(stderr,"dbg2       sonar:      %d\n",sonar);
-		}
-
-	/* set goodend false until a good end is found */
-	*goodend = MB_NO;
-
-	/* get  storage structure */
-	ssv = (struct mbsys_simrad2_ssv_struct *) store->ssv;
-
-	/* set kind and type values */
-	store->kind = MB_DATA_SSV;
-	store->type = EM2_SSV;
-	store->sonar = sonar;
-
-	/* read binary header values into char array */
-	read_len = fread(line,1,EM2_SSV_HEADER_SIZE,mbfp);
-	if (read_len == EM2_SSV_HEADER_SIZE)
-		status = MB_SUCCESS;
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	/* get binary header data */
-	if (status == MB_SUCCESS)
-		{
-		mb_get_binary_int(swap, &line[0], &ssv->ssv_date);
-		    store->date = ssv->ssv_date;
-		mb_get_binary_int(swap, &line[4], &ssv->ssv_msec);
-		    store->msec = ssv->ssv_msec;
-		mb_get_binary_short(swap, &line[8], &short_val);
-		    ssv->ssv_count = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[10], &short_val);
-		    ssv->ssv_serial = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[12], &short_val);
-		    ssv->ssv_ndata = (int) ((unsigned short) short_val);
-		}
-
-	/* read binary ssv values */
-	if (status == MB_SUCCESS)
-	    {
-	    for (i=0;i<ssv->ssv_ndata && status == MB_SUCCESS;i++)
-		{
-		read_len = fread(line,1,EM2_SSV_SLICE_SIZE,mbfp);
-		if (read_len == EM2_SSV_SLICE_SIZE
-			&& i < MBSYS_SIMRAD2_MAXSSV)
-			{
-			status = MB_SUCCESS;
-			mb_get_binary_short(swap, &line[0], &short_val);
-			    ssv->ssv_time[i] = (int) ((unsigned short) short_val);
-			mb_get_binary_short(swap, &line[2], &short_val);
-			    ssv->ssv_ssv[i] = (int) ((unsigned short) short_val);
-			}
-		else
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_EOF;
-			}
-		}
-	    ssv->ssv_ndata = MIN(ssv->ssv_ndata, MBSYS_SIMRAD2_MAXSSV);
-	    }
-
-	/* now get last bytes of record */
-	if (status == MB_SUCCESS)
-		{
-		read_len = fread(&line[0],1,4,mbfp);
-		if (read_len == 4)
-			{
-			status = MB_SUCCESS;
-			}
-		else
-			{
-			/* return success here because all of the
-			    important information in this record has
-			    already been read - next attempt to read
-			    file will return error */
-			status = MB_SUCCESS;
-			}
-		if (line[1] == EM2_END)
-			*goodend = MB_YES;
-#ifdef MBR_EM300RAW_DEBUG
-	fprintf(stderr, "End Bytes: %2.2hX %d | %2.2hX %d | %2.2hX %d\n",
-		line[1], line[1],
-		line[2], line[2],
-		line[3], line[3]);
-#endif
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       ssv_date:        %d\n",ssv->ssv_date);
-		fprintf(stderr,"dbg5       ssv_msec:        %d\n",ssv->ssv_msec);
-		fprintf(stderr,"dbg5       ssv_count:       %d\n",ssv->ssv_count);
-		fprintf(stderr,"dbg5       ssv_serial:      %d\n",ssv->ssv_serial);
-		fprintf(stderr,"dbg5       ssv_ndata:       %d\n",ssv->ssv_ndata);
-		fprintf(stderr,"dbg5       count    time (msec)    ssv (0.1 m/s)\n");
-		fprintf(stderr,"dbg5       -----    -----------    ------------------\n");
-		for (i=0;i<ssv->ssv_ndata;i++)
-			fprintf(stderr,"dbg5        %4d      %7d          %7d\n",
-				i, ssv->ssv_time[i], ssv->ssv_ssv[i]);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       goodend:    %d\n",*goodend);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em300raw_rd_tilt(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store,
-		short sonar, int *goodend, int *error)
-{
-	char	*function_name = "mbr_em300raw_rd_tilt";
-	int	status = MB_SUCCESS;
-	struct mbsys_simrad2_tilt_struct *tilt;
-	char	line[EM2_TILT_HEADER_SIZE];
-	short	short_val;
-	int	read_len;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		fprintf(stderr,"dbg2       sonar:      %d\n",sonar);
-		}
-
-	/* set goodend false until a good end is found */
-	*goodend = MB_NO;
-
-	/* get  storage structure */
-	tilt = (struct mbsys_simrad2_tilt_struct *) store->tilt;
-
-	/* set kind and type values */
-	store->kind = MB_DATA_TILT;
-	store->type = EM2_TILT;
-	store->sonar = sonar;
-
-	/* read binary header values into char array */
-	read_len = fread(line,1,EM2_TILT_HEADER_SIZE,mbfp);
-	if (read_len == EM2_TILT_HEADER_SIZE)
-		status = MB_SUCCESS;
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	/* get binary header data */
-	if (status == MB_SUCCESS)
-		{
-		mb_get_binary_int(swap, &line[0], &tilt->tlt_date);
-		    store->date = tilt->tlt_date;
-		mb_get_binary_int(swap, &line[4], &tilt->tlt_msec);
-		    store->msec = tilt->tlt_msec;
-		mb_get_binary_short(swap, &line[8], &short_val);
-		    tilt->tlt_count = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[10], &short_val);
-		    tilt->tlt_serial = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[12], &short_val);
-		    tilt->tlt_ndata = (int) ((unsigned short) short_val);
-		}
-
-	/* read binary tilt values */
-	if (status == MB_SUCCESS)
-	    {
-	    for (i=0;i<tilt->tlt_ndata && status == MB_SUCCESS;i++)
-		{
-		read_len = fread(line,1,EM2_TILT_SLICE_SIZE,mbfp);
-		if (read_len == EM2_TILT_SLICE_SIZE
-			&& i < MBSYS_SIMRAD2_MAXTILT)
-			{
-			status = MB_SUCCESS;
-			mb_get_binary_short(swap, &line[0], &short_val);
-			    tilt->tlt_time[i] = (int) ((unsigned short) short_val);
-			mb_get_binary_short(swap, &line[2], &short_val);
-			    tilt->tlt_tilt[i] = (int) ((unsigned short) short_val);
-			}
-		else
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_EOF;
-			}
-		}
-	    tilt->tlt_ndata = MIN(tilt->tlt_ndata, MBSYS_SIMRAD2_MAXTILT);
-	    }
-
-	/* now get last bytes of record */
-	if (status == MB_SUCCESS)
-		{
-		read_len = fread(&line[0],1,4,mbfp);
-		if (read_len == 4)
-			{
-			status = MB_SUCCESS;
-			}
-		else
-			{
-			/* return success here because all of the
-			    important information in this record has
-			    already been read - next attempt to read
-			    file will return error */
-			status = MB_SUCCESS;
-			}
-		if (line[1] == EM2_END)
-			*goodend = MB_YES;
-#ifdef MBR_EM300RAW_DEBUG
-	fprintf(stderr, "End Bytes: %2.2hX %d | %2.2hX %d | %2.2hX %d\n",
-		line[1], line[1],
-		line[2], line[2],
-		line[3], line[3]);
-#endif
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       tlt_date:        %d\n",tilt->tlt_date);
-		fprintf(stderr,"dbg5       tlt_msec:        %d\n",tilt->tlt_msec);
-		fprintf(stderr,"dbg5       tlt_count:       %d\n",tilt->tlt_count);
-		fprintf(stderr,"dbg5       tlt_serial:      %d\n",tilt->tlt_serial);
-		fprintf(stderr,"dbg5       tlt_ndata:       %d\n",tilt->tlt_ndata);
-		fprintf(stderr,"dbg5       count    time (msec)    tilt (0.01 deg)\n");
-		fprintf(stderr,"dbg5       -----    -----------    ------------------\n");
-		for (i=0;i<tilt->tlt_ndata;i++)
-			fprintf(stderr,"dbg5        %4d      %7d          %7d\n",
-				i, tilt->tlt_time[i], tilt->tlt_tilt[i]);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       goodend:    %d\n",*goodend);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em300raw_rd_attitude(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store,
-		short sonar, int *goodend, int *error)
-{
-	char	*function_name = "mbr_em300raw_rd_attitude";
-	int	status = MB_SUCCESS;
-	struct mbsys_simrad2_attitude_struct *attitude;
-	char	line[EM2_ATTITUDE_HEADER_SIZE];
-	short	short_val;
-	int	read_len;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		fprintf(stderr,"dbg2       sonar:      %d\n",sonar);
-		}
-
-	/* set goodend false until a good end is found */
-	*goodend = MB_NO;
-
-	/* get  storage structure */
-	attitude = (struct mbsys_simrad2_attitude_struct *) store->attitude;
-
-	/* set kind and type values */
-	store->kind = MB_DATA_ATTITUDE;
-	store->type = EM2_ATTITUDE;
-	store->sonar = sonar;
-
-	/* read binary header values into char array */
-	read_len = fread(line,1,EM2_ATTITUDE_HEADER_SIZE,mbfp);
-	if (read_len == EM2_ATTITUDE_HEADER_SIZE)
-		status = MB_SUCCESS;
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	/* get binary header data */
-	if (status == MB_SUCCESS)
-		{
-		mb_get_binary_int(swap, &line[0], &attitude->att_date);
-		    store->date = attitude->att_date;
-		mb_get_binary_int(swap, &line[4], &attitude->att_msec);
-		    store->msec = attitude->att_msec;
-		mb_get_binary_short(swap, &line[8], &short_val);
-		    attitude->att_count = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[10], &short_val);
-		    attitude->att_serial = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[12], &short_val);
-		    attitude->att_ndata = (int) ((unsigned short) short_val);
-		}
-
-	/* read binary attitude values */
-	if (status == MB_SUCCESS)
-	    {
-	    for (i=0;i<attitude->att_ndata && status == MB_SUCCESS;i++)
-		{
-		read_len = fread(line,1,EM2_ATTITUDE_SLICE_SIZE,mbfp);
-		if (read_len == EM2_ATTITUDE_SLICE_SIZE
-			&& i < MBSYS_SIMRAD2_MAXATTITUDE)
-			{
-			status = MB_SUCCESS;
-			mb_get_binary_short(swap, &line[0], &short_val);
-			    attitude->att_time[i] = (int) ((unsigned short) short_val);
-			mb_get_binary_short(swap, &line[2], &short_val);
-			    attitude->att_sensor_status[i] = (int) ((unsigned short) short_val);
-			mb_get_binary_short(swap, &line[4], &short_val);
-			    attitude->att_roll[i] = (int) short_val;
-			mb_get_binary_short(swap, &line[6], &short_val);
-			    attitude->att_pitch[i] = (int) short_val;
-			mb_get_binary_short(swap, &line[8], &short_val);
-			    attitude->att_heave[i] = (int) short_val;
-			mb_get_binary_short(swap, &line[10], &short_val);
-			    attitude->att_heading[i] = (int) ((unsigned short) short_val);
-			}
-		else
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_EOF;
-			}
-		}
-	    attitude->att_ndata = MIN(attitude->att_ndata, MBSYS_SIMRAD2_MAXATTITUDE);
-	    }
-
-	/* now get last bytes of record */
-	if (status == MB_SUCCESS)
-		{
-		read_len = fread(&line[0],1,4,mbfp);
-		if (read_len == 4)
-			{
-			status = MB_SUCCESS;
-			attitude->att_heading_status = (mb_u_char) line[0];
-			}
-		else
-			{
-			/* return success here because all of the
-			    important information in this record has
-			    already been read - next attempt to read
-			    file will return error */
-			status = MB_SUCCESS;
-			}
-		if (line[1] == EM2_END)
-			*goodend = MB_YES;
-#ifdef MBR_EM300RAW_DEBUG
-	fprintf(stderr, "End Bytes: %2.2hX %d | %2.2hX %d | %2.2hX %d\n",
-		line[1], line[1],
-		line[2], line[2],
-		line[3], line[3]);
-#endif
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       att_date:        %d\n",attitude->att_date);
-		fprintf(stderr,"dbg5       att_msec:        %d\n",attitude->att_msec);
-		fprintf(stderr,"dbg5       att_count:       %d\n",attitude->att_count);
-		fprintf(stderr,"dbg5       att_serial:      %d\n",attitude->att_serial);
-		fprintf(stderr,"dbg5       att_ndata:       %d\n",attitude->att_ndata);
-		fprintf(stderr,"dbg5       cnt   time   roll pitch heave heading\n");
-		fprintf(stderr,"dbg5       -------------------------------------\n");
-		for (i=0;i<attitude->att_ndata;i++)
-			fprintf(stderr,"dbg5        %3d  %d  %d %d %d %d\n",
-				i, attitude->att_time[i], attitude->att_roll[i],
-				attitude->att_pitch[i], attitude->att_heave[i],
-				attitude->att_heading[i]);
-		fprintf(stderr,"dbg5       att_heading_status: %d\n",attitude->att_heading_status);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       goodend:    %d\n",*goodend);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em300raw_rd_pos(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store,
-		short sonar, int *goodend, int *error)
-{
-	char	*function_name = "mbr_em300raw_rd_pos";
-	int	status = MB_SUCCESS;
-	char	line[MBSYS_SIMRAD2_COMMENT_LENGTH];
-	short	short_val;
-	int	read_len;
-	int	done;
-	int	navchannel;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		fprintf(stderr,"dbg2       sonar:      %d\n",sonar);
-		}
-
-	/* set goodend false until a good end is found */
-	*goodend = MB_NO;
-
-	/* set kind and type values */
-	store->kind = MB_DATA_NAV;
-	store->type = EM2_POS;
-	store->sonar = sonar;
-
-	/* read binary header values into char array */
-	read_len = fread(line,1,EM2_POS_HEADER_SIZE,mbfp);
-	if (read_len == EM2_POS_HEADER_SIZE)
-		status = MB_SUCCESS;
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	/* get binary header data */
-	if (status == MB_SUCCESS)
-		{
-		mb_get_binary_int(swap, &line[0], &store->pos_date);
-		    store->date = store->pos_date;
-		mb_get_binary_int(swap, &line[4], &store->pos_msec);
-		    store->msec = store->pos_msec;
-		mb_get_binary_short(swap, &line[8], &short_val);
-		    store->pos_count = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[10], &short_val);
-		    store->pos_serial = (int) ((unsigned short) short_val);
-		mb_get_binary_int(swap, &line[12], &store->pos_latitude);
-		mb_get_binary_int(swap, &line[16], &store->pos_longitude);
-		mb_get_binary_short(swap, &line[20], &short_val);
-		    store->pos_quality = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[22], &short_val);
-		    store->pos_speed = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[24], &short_val);
-		    store->pos_course = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[26], &short_val);
-		    store->pos_heading = (int) ((unsigned short) short_val);
-		store->pos_system = (mb_u_char) line[28];
-		store->pos_input_size = (mb_u_char) line[29];
-		}
-
-	/* read input position string */
-	if (status == MB_SUCCESS && store->pos_input_size < 256)
-		{
-		read_len = fread(store->pos_input,1,store->pos_input_size,mbfp);
-		if (read_len == store->pos_input_size)
-			{
-			status = MB_SUCCESS;
-			store->pos_input[store->pos_input_size] = '\0';
-			}
-		else
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_EOF;
-			}
-		}
-
-	/* now loop over reading individual characters to
-	    get last bytes of record */
-	if (status == MB_SUCCESS)
-	    {
-	    done = MB_NO;
-	    while (done == MB_NO)
-		{
-		read_len = fread(&line[0],1,1,mbfp);
-		if (read_len == 1 && line[0] == EM2_END)
-			{
-			done = MB_YES;
-			status = MB_SUCCESS;
-			/* get last two check sum bytes */
-			if (sonar != MBSYS_SIMRAD2_EM3000)
-				read_len = fread(&line[1],2,1,mbfp);
-		if (line[0] == EM2_END)
-			*goodend = MB_YES;
-#ifdef MBR_EM300RAW_DEBUG
-	if (sonar != MBSYS_SIMRAD2_EM3000)
-	fprintf(stderr, "End Bytes: %2.2hX %d | %2.2hX %d | %2.2hX %d\n",
-		line[0], line[0],
-		line[1], line[1],
-		line[2], line[2]);
-#endif
-			}
-		else if (read_len == 1)
-			{
-			status = MB_SUCCESS;
-			}
-		else
-			{
-			done = MB_YES;
-			/* return success here because all of the
-			    important information in this record has
-			    already been read - next attempt to read
-			    file will return error */
-			status = MB_SUCCESS;
-			}
-		}
-#ifdef MBR_EM300RAW_DEBUG
-	fprintf(stderr, "\n");
-#endif
-	    }
-
-	/* check for navigation source */
-	if (status == MB_SUCCESS)
-		{
-		/* "active" nav system has first bit set in store->pos_system */
-		if (store->pos_system & 128)
-		    {
-		    store->kind = MB_DATA_NAV;
-		    }
-
-		/* otherwise its from a secondary nav system */
-		else
-		    {
-		    navchannel = (store->pos_system & 0x03);
-		    if (navchannel == 1)
-			{
-			store->kind = MB_DATA_NAV1;
-			}
-		    else if (navchannel == 2)
-			{
-			store->kind = MB_DATA_NAV2;
-			}
-		    else if (navchannel == 3)
-			{
-			store->kind = MB_DATA_NAV3;
-			}
-
-		    /* otherwise its an error */
-		    else
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_UNINTELLIGIBLE;
-			}
-		    }
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       pos_date:        %d\n",store->pos_date);
-		fprintf(stderr,"dbg5       pos_msec:        %d\n",store->pos_msec);
-		fprintf(stderr,"dbg5       pos_count:       %d\n",store->pos_count);
-		fprintf(stderr,"dbg5       pos_serial:      %d\n",store->pos_serial);
-		fprintf(stderr,"dbg5       pos_latitude:    %d\n",store->pos_latitude);
-		fprintf(stderr,"dbg5       pos_longitude:   %d\n",store->pos_longitude);
-		fprintf(stderr,"dbg5       pos_quality:     %d\n",store->pos_quality);
-		fprintf(stderr,"dbg5       pos_speed:       %d\n",store->pos_speed);
-		fprintf(stderr,"dbg5       pos_course:      %d\n",store->pos_course);
-		fprintf(stderr,"dbg5       pos_heading:     %d\n",store->pos_heading);
-		fprintf(stderr,"dbg5       pos_system:      %d\n",store->pos_system);
-		fprintf(stderr,"dbg5       pos_input_size:  %d\n",store->pos_input_size);
-		fprintf(stderr,"dbg5       pos_input:\ndbg5            %s\n",store->pos_input);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       goodend:    %d\n",*goodend);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em300raw_rd_svp(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store,
-		short sonar, int *goodend, int *error)
-{
-	char	*function_name = "mbr_em300raw_rd_svp";
-	int	status = MB_SUCCESS;
-	char	line[EM2_SVP_HEADER_SIZE];
-	short	short_val;
-	int	read_len;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		fprintf(stderr,"dbg2       sonar:      %d\n",sonar);
-		}
-
-	/* set goodend false until a good end is found */
-	*goodend = MB_NO;
-
-	/* set kind and type values */
-	store->kind = MB_DATA_VELOCITY_PROFILE;
-	store->type = EM2_SVP;
-	store->sonar = sonar;
-
-	/* read binary header values into char array */
-	read_len = fread(line,1,EM2_SVP_HEADER_SIZE,mbfp);
-	if (read_len == EM2_SVP_HEADER_SIZE)
-		status = MB_SUCCESS;
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	/* get binary header data */
-	if (status == MB_SUCCESS)
-		{
-		mb_get_binary_int(swap, &line[0], &store->svp_use_date);
-		    store->date = store->svp_use_date;
-		mb_get_binary_int(swap, &line[4], &store->svp_use_msec);
-		    store->msec = store->svp_use_msec;
-		mb_get_binary_short(swap, &line[8], &short_val);
-		    store->svp_count = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[10], &short_val);
-		    store->svp_serial = (int) ((unsigned short) short_val);
-		mb_get_binary_int(swap, &line[12], &store->svp_origin_date);
-		mb_get_binary_int(swap, &line[16], &store->svp_origin_msec);
-		mb_get_binary_short(swap, &line[20], &short_val);
-		    store->svp_num = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[22], &short_val);
-		    store->svp_depth_res = (int) ((unsigned short) short_val);
-		}
-
-	/* read binary svp values */
-	if (status == MB_SUCCESS)
-	    {
-	    for (i=0;i<store->svp_num && status == MB_SUCCESS;i++)
-		{
-		read_len = fread(line,1,EM2_SVP_SLICE_SIZE,mbfp);
-		if (read_len != EM2_SVP_SLICE_SIZE)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_EOF;
-			}
-		else if (i < MBSYS_SIMRAD2_MAXSVP)
-			{
-			status = MB_SUCCESS;
-			mb_get_binary_short(swap, &line[0], &short_val);
-			    store->svp_depth[i] = (int) ((unsigned short) short_val);
-			mb_get_binary_short(swap, &line[2], &short_val);
-			    store->svp_vel[i] = (int) ((unsigned short) short_val);
-			}
-		}
-	    store->svp_num = MIN(store->svp_num, MBSYS_SIMRAD2_MAXSVP);
-	    }
-
-	/* now get last bytes of record */
-	if (status == MB_SUCCESS)
-		{
-		read_len = fread(&line[0],1,4,mbfp);
-		if (read_len == 4)
-			{
-			status = MB_SUCCESS;
-			}
-		else
-			{
-			/* return success here because all of the
-			    important information in this record has
-			    already been read - next attempt to read
-			    file will return error */
-			status = MB_SUCCESS;
-			}
-		if (line[1] == EM2_END)
-			*goodend = MB_YES;
-#ifdef MBR_EM300RAW_DEBUG
-	fprintf(stderr, "End Bytes: %2.2hX %d | %2.2hX %d | %2.2hX %d\n",
-		line[1], line[1],
-		line[2], line[2],
-		line[3], line[3]);
-#endif
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       svp_use_date:    %d\n",store->svp_use_date);
-		fprintf(stderr,"dbg5       svp_use_msec:    %d\n",store->svp_use_msec);
-		fprintf(stderr,"dbg5       svp_count:       %d\n",store->svp_count);
-		fprintf(stderr,"dbg5       svp_serial:      %d\n",store->svp_serial);
-		fprintf(stderr,"dbg5       svp_origin_date: %d\n",store->svp_origin_date);
-		fprintf(stderr,"dbg5       svp_origin_msec: %d\n",store->svp_origin_msec);
-		fprintf(stderr,"dbg5       svp_num:         %d\n",store->svp_num);
-		fprintf(stderr,"dbg5       svp_depth_res:   %d\n",store->svp_depth_res);
-		fprintf(stderr,"dbg5       count    depth    speed\n");
-		fprintf(stderr,"dbg5       -----------------------\n");
-		for (i=0;i<store->svp_num;i++)
-			fprintf(stderr,"dbg5        %d   %d  %d\n",
-				i, store->svp_depth[i], store->svp_vel[i]);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       goodend:    %d\n",*goodend);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em300raw_rd_svp2(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store,
-		short sonar, int *goodend, int *error)
-{
-	char	*function_name = "mbr_em300raw_rd_svp2";
-	int	status = MB_SUCCESS;
-	char	line[EM2_SVP2_HEADER_SIZE];
-	short	short_val;
-	int	read_len;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		fprintf(stderr,"dbg2       sonar:      %d\n",sonar);
-		}
-
-	/* set goodend false until a good end is found */
-	*goodend = MB_NO;
-
-	/* set kind and type values */
-	store->kind = MB_DATA_VELOCITY_PROFILE;
-	store->type = EM2_SVP2;
-	store->sonar = sonar;
-
-	/* read binary header values into char array */
-	read_len = fread(line,1,EM2_SVP_HEADER_SIZE,mbfp);
-	if (read_len == EM2_SVP_HEADER_SIZE)
-		status = MB_SUCCESS;
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	/* get binary header data */
-	if (status == MB_SUCCESS)
-		{
-		mb_get_binary_int(swap, &line[0], &store->svp_use_date);
-		    store->date = store->svp_use_date;
-		mb_get_binary_int(swap, &line[4], &store->svp_use_msec);
-		    store->msec = store->svp_use_msec;
-		mb_get_binary_short(swap, &line[8], &short_val);
-		    store->svp_count = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[10], &short_val);
-		    store->svp_serial = (int) ((unsigned short) short_val);
-		mb_get_binary_int(swap, &line[12], &store->svp_origin_date);
-		mb_get_binary_int(swap, &line[16], &store->svp_origin_msec);
-		mb_get_binary_short(swap, &line[20], &short_val);
-		    store->svp_num = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[22], &short_val);
-		    store->svp_depth_res = (int) ((unsigned short) short_val);
-		}
-
-	/* read binary svp values */
-	if (status == MB_SUCCESS)
-	    {
-	    for (i=0;i<store->svp_num && status == MB_SUCCESS;i++)
-		{
-		read_len = fread(line,1,EM2_SVP2_SLICE_SIZE,mbfp);
-		if (read_len != EM2_SVP2_SLICE_SIZE)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_EOF;
-			}
-		else if (i < MBSYS_SIMRAD2_MAXSVP)
-			{
-			status = MB_SUCCESS;
-			mb_get_binary_int(swap, &line[0], &store->svp_depth[i]);
-			mb_get_binary_int(swap, &line[4], &store->svp_vel[i]);
-			}
-		}
-	    store->svp_num = MIN(store->svp_num, MBSYS_SIMRAD2_MAXSVP);
-	    }
-
-	/* now get last bytes of record */
-	if (status == MB_SUCCESS)
-		{
-		read_len = fread(&line[0],1,4,mbfp);
-		if (read_len == 4)
-			{
-			status = MB_SUCCESS;
-			}
-		else
-			{
-			/* return success here because all of the
-			    important information in this record has
-			    already been read - next attempt to read
-			    file will return error */
-			status = MB_SUCCESS;
-			}
-		if (line[1] == EM2_END)
-			*goodend = MB_YES;
-#ifdef MBR_EM300RAW_DEBUG
-	fprintf(stderr, "End Bytes: %2.2hX %d | %2.2hX %d | %2.2hX %d\n",
-		line[1], line[1],
-		line[2], line[2],
-		line[3], line[3]);
-#endif
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       svp_use_date:    %d\n",store->svp_use_date);
-		fprintf(stderr,"dbg5       svp_use_msec:    %d\n",store->svp_use_msec);
-		fprintf(stderr,"dbg5       svp_count:       %d\n",store->svp_count);
-		fprintf(stderr,"dbg5       svp_serial:      %d\n",store->svp_serial);
-		fprintf(stderr,"dbg5       svp_origin_date: %d\n",store->svp_origin_date);
-		fprintf(stderr,"dbg5       svp_origin_msec: %d\n",store->svp_origin_msec);
-		fprintf(stderr,"dbg5       svp_num:         %d\n",store->svp_num);
-		fprintf(stderr,"dbg5       svp_depth_res:   %d\n",store->svp_depth_res);
-		fprintf(stderr,"dbg5       count    depth    speed\n");
-		fprintf(stderr,"dbg5       -----------------------\n");
-		for (i=0;i<store->svp_num;i++)
-			fprintf(stderr,"dbg5        %d   %d  %d\n",
-				i, store->svp_depth[i], store->svp_vel[i]);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       goodend:    %d\n",*goodend);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em300raw_rd_bath(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store,
-		int *match, short sonar, int version, int *goodend, int *error)
-{
-	char	*function_name = "mbr_em300raw_rd_bath";
-	int	status = MB_SUCCESS;
-	struct mbsys_simrad2_ping_struct *ping;
-	char	line[EM2_BATH_HEADER_SIZE];
-	short	short_val;
-	int	png_count;
-	int	png_serial;
-	int	head;
-	int	read_len;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		fprintf(stderr,"dbg2       sonar:      %d\n",sonar);
-		fprintf(stderr,"dbg2       version:    %d\n",version);
-		}
-
-	/* set goodend false until a good end is found */
-	*goodend = MB_NO;
-
-	/* get  storage structure */
-	ping = (struct mbsys_simrad2_ping_struct *) store->ping;
-	head = 0;
-
-	/* set kind and type values */
-	store->kind = MB_DATA_DATA;
-	store->type = EM2_BATH;
-	store->sonar = sonar;
-
-	/* read binary header values into char array */
-	read_len = fread(line,1,EM2_BATH_HEADER_SIZE,mbfp);
-	if (read_len == EM2_BATH_HEADER_SIZE)
-		status = MB_SUCCESS;
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	/* in case of dual head EM3002 check if the data are from the second head and switch ping structure if so */
-	if (status == MB_SUCCESS && sonar == MBSYS_SIMRAD2_EM3002
-			&& store->numberheads == 2)
-		{
-		mb_get_binary_short(swap, &line[8], &short_val);
-		    png_count = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[10], &short_val);
-		    png_serial = (int) ((unsigned short) short_val);
-
-		if (png_count == ping->png_count && png_serial != ping->png_serial)
-			{
-			ping = (struct mbsys_simrad2_ping_struct *) store->ping2;
-			head = 1;
-			}
-		}
-
-	/* get binary header data */
-	if (status == MB_SUCCESS)
-		{
-		mb_get_binary_int(swap, &line[0], &ping->png_date);
-		    store->date = ping->png_date;
-		mb_get_binary_int(swap, &line[4], &ping->png_msec);
-		    store->msec = ping->png_msec;
-		mb_get_binary_short(swap, &line[8], &short_val);
-		    ping->png_count = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[10], &short_val);
-		    ping->png_serial = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[12], &short_val);
-		    ping->png_heading = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[14], &short_val);
-		    ping->png_ssv = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[16], &short_val);
-		    ping->png_xducer_depth = (int) ((unsigned short) short_val);
-		ping->png_nbeams_max = (mb_u_char) line[18];
-		ping->png_nbeams = (mb_u_char) line[19];
-		ping->png_depth_res = (mb_u_char) line[20];
-		ping->png_distance_res = (mb_u_char) line[21];
-		mb_get_binary_short(swap, &line[22], &short_val);
-		    ping->png_sample_rate = (int) ((unsigned short) short_val);
-/*fprintf(stderr,"    ping->png_date:%d     ping->png_msec:%d     ping->png_count:%d     ping->png_nbeams:%d\n",
-ping->png_date,ping->png_msec,ping->png_count,ping->png_nbeams);*/
-		}
-
-	/* check for some indicators of a broken record
-	    - these do happen!!!! */
-	if (status == MB_SUCCESS)
-		{
-		if (ping->png_nbeams > ping->png_nbeams_max
-			|| ping->png_nbeams < 0
-			|| ping->png_nbeams_max < 0
-			|| ping->png_nbeams > MBSYS_SIMRAD2_MAXBEAMS
-			|| ping->png_nbeams_max > MBSYS_SIMRAD2_MAXBEAMS)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_UNINTELLIGIBLE;
-			}
-		}
-
-	/* read binary beam values */
-	if (status == MB_SUCCESS)
-	    {
-	    for (i=0;i<ping->png_nbeams && status == MB_SUCCESS;i++)
-		{
-		read_len = fread(line,1,EM2_BATH_BEAM_SIZE,mbfp);
-		if (read_len == EM2_BATH_BEAM_SIZE
-			&& i < MBSYS_SIMRAD2_MAXBEAMS)
-			{
-			status = MB_SUCCESS;
-			mb_get_binary_short(swap, &line[0], &short_val);
-			    if (store->sonar == MBSYS_SIMRAD2_EM120
-				|| store->sonar == MBSYS_SIMRAD2_EM300)
-				ping->png_depth[i] = (int) ((unsigned short) short_val);
-			    else
-				ping->png_depth[i] = (int) short_val;
-
-			mb_get_binary_short(swap, &line[2], &short_val);
-			    ping->png_acrosstrack[i] = (int) short_val;
-			mb_get_binary_short(swap, &line[4], &short_val);
-			    ping->png_alongtrack[i] = (int) short_val;
-			mb_get_binary_short(swap, &line[6], &short_val);
-			    ping->png_depression[i] = (int) short_val;
-			mb_get_binary_short(swap, &line[8], &short_val);
-			    ping->png_azimuth[i] = (int) ((unsigned short) short_val);
-			mb_get_binary_short(swap, &line[10], &short_val);
-			    ping->png_range[i] = (int) ((unsigned short) short_val);
-			ping->png_quality[i] = (mb_u_char) line[12];
-			ping->png_window[i] = (mb_u_char) line[13];
-			ping->png_amp[i] = (mb_s_char) line[14];
-			ping->png_beam_num[i] = (mb_u_char) line[15];
-			if (ping->png_depth[i] == 0)
-				ping->png_beamflag[i] = MB_FLAG_NULL;
-			else
-				ping->png_beamflag[i] = MB_FLAG_NONE;
-			}
-		else
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_EOF;
-			}
-		}
-	    }
-
-	/* now get last bytes of record */
-	if (status == MB_SUCCESS)
-		{
-		read_len = fread(&line[0],1,4,mbfp);
-		if (read_len == 4)
-			{
-			status = MB_SUCCESS;
-			ping->png_offset_multiplier = (mb_s_char) line[0];
-			}
-		else
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_EOF;
-			}
-		if (line[1] == EM2_END)
-			*goodend = MB_YES;
-#ifdef MBR_EM300RAW_DEBUG
-	fprintf(stderr, "End Bytes: %2.2hX %d | %2.2hX %d | %2.2hX %d\n",
-		line[1], line[1],
-		line[2], line[2],
-		line[3], line[3]);
-#endif
-		}
-
-	/* check sonar version and adjust data as necessary */
-	if (status == MB_SUCCESS
-		&& sonar >= MBSYS_SIMRAD2_EM3000
-		&& version != 0
-		&& version < 20000 )
-		{
-		ping->png_offset_multiplier = 0;
-		}
-
-	/* check for some other indicators of a broken record
-	    - these do happen!!!! */
-	if (status == MB_SUCCESS)
-		{
-		if (ping->png_nbeams > 0
-		    && ping->png_beam_num[0] > ping->png_nbeams_max)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_UNINTELLIGIBLE;
-			}
-		for (i=1;i<ping->png_nbeams;i++)
-			{
-			if (ping->png_beam_num[i] < ping->png_beam_num[i-1]
-				|| ping->png_beam_num[i] > ping->png_nbeams_max)
-				{
-				status = MB_FAILURE;
-				*error = MB_ERROR_UNINTELLIGIBLE;
-				}
-			}
-		}
-
-	/* check if bath and sidescan time tags agree
-	   - we cannot pair bath
-	   and sidescan records from different pings */
-	if (status == MB_SUCCESS)
-		{
-		if (ping->png_date == ping->png_ss_date
-		    && ping->png_msec == ping->png_ss_msec)
-		    *match = MB_YES;
-		else
-		    *match = MB_NO;
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       png_date:        %d\n",ping->png_date);
-		fprintf(stderr,"dbg5       png_msec:        %d\n",ping->png_msec);
-		fprintf(stderr,"dbg5       png_count:       %d\n",ping->png_count);
-		fprintf(stderr,"dbg5       png_serial:      %d\n",ping->png_serial);
-		fprintf(stderr,"dbg5       png_heading:     %d\n",ping->png_heading);
-		fprintf(stderr,"dbg5       png_ssv:         %d\n",ping->png_ssv);
-		fprintf(stderr,"dbg5       png_xducer_depth:      %d\n",ping->png_xducer_depth);
-		fprintf(stderr,"dbg5       png_offset_multiplier: %d\n",ping->png_offset_multiplier);
-		fprintf(stderr,"dbg5       png_nbeams_max:        %d\n",ping->png_nbeams_max);
-		fprintf(stderr,"dbg5       png_nbeams:            %d\n",ping->png_nbeams);
-		fprintf(stderr,"dbg5       png_depth_res:         %d\n",ping->png_depth_res);
-		fprintf(stderr,"dbg5       png_distance_res:      %d\n",ping->png_distance_res);
-		fprintf(stderr,"dbg5       png_sample_rate:       %d\n",ping->png_sample_rate);
-		fprintf(stderr,"dbg5       cnt  depth xtrack ltrack dprsn   azi   rng  qual wnd amp num\n");
-		fprintf(stderr,"dbg5       ------------------------------------------------------------\n");
-		for (i=0;i<ping->png_nbeams;i++)
-			fprintf(stderr,"dbg5       %3d %6d %6d %6d %5d %5d %5d %4d %3d %3d %3d\n",
-				i, ping->png_depth[i], ping->png_acrosstrack[i],
-				ping->png_alongtrack[i], ping->png_depression[i],
-				ping->png_azimuth[i], ping->png_range[i],
-				ping->png_quality[i], ping->png_window[i],
-				ping->png_amp[i], ping->png_beam_num[i]);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       match:      %d\n",*match);
-		fprintf(stderr,"dbg2       goodend:    %d\n",*goodend);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em300raw_rd_rawbeam(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store,
-		short sonar, int *goodend, int *error)
-{
-	char	*function_name = "mbr_em300raw_rd_rawbeam";
-	int	status = MB_SUCCESS;
-	struct mbsys_simrad2_ping_struct *ping;
-	char	line[EM2_RAWBEAM_HEADER_SIZE];
-	short	short_val;
-	int	read_len;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		fprintf(stderr,"dbg2       sonar:      %d\n",sonar);
-		}
-
-	/* set goodend false until a good end is found */
-	*goodend = MB_NO;
-
-	/* get  storage structure */
-	ping = (struct mbsys_simrad2_ping_struct *) store->ping;
-
-	/* read binary header values into char array */
-	read_len = fread(line,1,EM2_RAWBEAM_HEADER_SIZE,mbfp);
-	if (read_len == EM2_RAWBEAM_HEADER_SIZE)
-		status = MB_SUCCESS;
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	/* get binary header data */
-	if (status == MB_SUCCESS)
-		{
-		mb_get_binary_int(swap, &line[0], &ping->png_raw_date);
-		    store->date = ping->png_raw_date;
-		mb_get_binary_int(swap, &line[4], &ping->png_raw_msec);
-		    store->msec = ping->png_raw_msec;
-		mb_get_binary_short(swap, &line[8], &short_val);
-		    ping->png_raw_count = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[10], &short_val);
-		    ping->png_raw_serial = (int) ((unsigned short) short_val);
-		ping->png_raw_nbeams_max = (mb_u_char) line[12];
-		ping->png_raw_nbeams = (mb_u_char) line[13];
-		mb_get_binary_short(swap, &line[14], &short_val);
-		    ping->png_raw_ssv = (int) ((unsigned short) short_val);
-		}
-
-	/* check for some indicators of a broken record
-	    - these do happen!!!! */
-	if (status == MB_SUCCESS)
-		{
-		if (ping->png_raw_nbeams > ping->png_nbeams_max
-			|| ping->png_raw_nbeams < 0
-			|| ping->png_raw_nbeams_max < 0
-			|| ping->png_raw_nbeams > MBSYS_SIMRAD2_MAXBEAMS
-			|| ping->png_raw_nbeams_max > MBSYS_SIMRAD2_MAXBEAMS)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_UNINTELLIGIBLE;
-			}
-		}
-
-	/* read binary beam values */
-	if (status == MB_SUCCESS)
-	    {
-	    for (i=0;i<ping->png_raw_nbeams && status == MB_SUCCESS;i++)
-		{
-		read_len = fread(line,1,EM2_RAWBEAM_BEAM_SIZE,mbfp);
-		if (read_len == EM2_RAWBEAM_BEAM_SIZE
-			&& i < MBSYS_SIMRAD2_MAXBEAMS)
-			{
-			status = MB_SUCCESS;
-			mb_get_binary_short(swap, &line[0], &short_val);
-			    ping->png_raw_rxpointangle[i] = (int) short_val;
-			mb_get_binary_short(swap, &line[2], &short_val);
-			    ping->png_raw_rxtiltangle[i] = (int) short_val;
-			mb_get_binary_short(swap, &line[4], &short_val);
-			    ping->png_raw_rxrange[i] = (int) ((unsigned short) short_val);
-			ping->png_raw_rxamp[i] = (mb_s_char) line[6];
-			ping->png_raw_rxbeam_num[i] = (mb_u_char) line[7];
-			}
-		else
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_EOF;
-			}
-		}
-	    }
-
-	/* now get last bytes of record */
-	if (status == MB_SUCCESS)
-		{
-		read_len = fread(&line[0],1,4,mbfp);
-		if (read_len == 4)
-			{
-			status = MB_SUCCESS;
-			}
-		else
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_EOF;
-			}
-		if (line[1] == EM2_END)
-			*goodend = MB_YES;
-#ifdef MBR_EM300RAW_DEBUG
-	fprintf(stderr, "End Bytes: %2.2hX %d | %2.2hX %d | %2.2hX %d\n",
-		line[1], line[1],
-		line[2], line[2],
-		line[3], line[3]);
-#endif
-		}
-
-	/* check for some other indicators of a broken record
-	    - these do happen!!!! */
-	if (status == MB_SUCCESS)
-		{
-		if (ping->png_raw_nbeams > 0
-		    && ping->png_raw_rxbeam_num[0] > ping->png_raw_nbeams_max)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_UNINTELLIGIBLE;
-			}
-		for (i=1;i<ping->png_raw_nbeams;i++)
-			{
-			if (ping->png_raw_rxbeam_num[i] < ping->png_raw_rxbeam_num[i-1]
-				|| ping->png_raw_rxbeam_num[i] > ping->png_raw_nbeams_max)
-				{
-				status = MB_FAILURE;
-				*error = MB_ERROR_UNINTELLIGIBLE;
-				}
-			}
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       png_raw_date:        %d\n",ping->png_raw_date);
-		fprintf(stderr,"dbg5       png_raw_msec:        %d\n",ping->png_raw_msec);
-		fprintf(stderr,"dbg5       png_raw_count:       %d\n",ping->png_raw_count);
-		fprintf(stderr,"dbg5       png_raw_serial:      %d\n",ping->png_raw_serial);
-		fprintf(stderr,"dbg5       png_raw_nbeams_max:  %d\n",ping->png_raw_nbeams_max);
-		fprintf(stderr,"dbg5       png_raw_nbeams:      %d\n",ping->png_raw_nbeams);
-		fprintf(stderr,"dbg5       png_raw_ssv:         %d\n",ping->png_raw_ssv);
-		fprintf(stderr,"dbg5       cnt  point   tilt   rng  amp num\n");
-		fprintf(stderr,"dbg5       ------------------------------------------------------------\n");
-		for (i=0;i<ping->png_raw_nbeams;i++)
-			fprintf(stderr,"dbg5       %3d %5d %5d %5d %3d %3d\n",
-				i, ping->png_raw_rxpointangle[i], ping->png_raw_rxtiltangle[i],
-				ping->png_raw_rxrange[i], ping->png_raw_rxamp[i],
-				ping->png_raw_rxbeam_num[i]);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       goodend:    %d\n",*goodend);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em300raw_rd_rawbeam2(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store,
-		short sonar, int *goodend, int *error)
-{
-	char	*function_name = "mbr_em300raw_rd_rawbeam2";
-	int	status = MB_SUCCESS;
-	struct mbsys_simrad2_ping_struct *ping;
-	char	line[EM2_RAWBEAM2_HEADER_SIZE];
-	short	short_val;
-	int	read_len;
-	int	spare;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		fprintf(stderr,"dbg2       sonar:      %d\n",sonar);
-		}
-
-	/* set goodend false until a good end is found */
-	*goodend = MB_NO;
-
-	/* get  storage structure */
-	ping = (struct mbsys_simrad2_ping_struct *) store->ping;
-
-	/* read binary header values into char array */
-	read_len = fread(line,1,EM2_RAWBEAM2_HEADER_SIZE,mbfp);
-	if (read_len == EM2_RAWBEAM2_HEADER_SIZE)
-		status = MB_SUCCESS;
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	/* get binary header data */
-	if (status == MB_SUCCESS)
-		{
-		mb_get_binary_int(swap, &line[0], &ping->png_raw_date);
-		    store->date = ping->png_raw_date;
-		mb_get_binary_int(swap, &line[4], &ping->png_raw_msec);
-		    store->msec = ping->png_raw_msec;
-		mb_get_binary_short(swap, &line[8], &short_val);
-		    ping->png_raw_count = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[10], &short_val);
-		    ping->png_raw_serial = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[12], &short_val);
-		    ping->png_raw_heading = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[14], &short_val);
-		    ping->png_raw_ssv = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[16], &short_val);
-		    ping->png_raw_xducer_depth = (int) ((unsigned short) short_val);
-		ping->png_raw_nbeams_max = (mb_u_char) line[18];
-		ping->png_raw_nbeams = (mb_u_char) line[19];
-		ping->png_raw_depth_res = (mb_u_char) line[20];
-		ping->png_raw_distance_res = (mb_u_char) line[21];
-		mb_get_binary_short(swap, &line[22], &short_val);
-		    ping->png_raw_sample_rate = (int) ((unsigned short) short_val);
-		mb_get_binary_int(swap, &line[24], &ping->png_raw_status);
-		mb_get_binary_short(swap, &line[28], &short_val);
-		    ping->png_raw_rangenormal = (int) ((unsigned short) short_val);
-		ping->png_raw_normalbackscatter = (mb_s_char) line[30];
-		ping->png_raw_obliquebackscatter = (mb_s_char) line[31];
-		ping->png_raw_fixedgain = (mb_u_char) line[32];
-		ping->png_raw_txpower = (mb_s_char) line[33];
-		ping->png_raw_mode = (mb_u_char) line[34];
-		ping->png_raw_coverage = (mb_u_char) line[35];
-		mb_get_binary_short(swap, &line[36], &short_val);
-		    ping->png_raw_yawstabheading = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[38], &short_val);
-		    ping->png_raw_ntx = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[40], &short_val);
-		    spare = (int) ((unsigned short) short_val);
-		}
-
-	/* check for some indicators of a broken record
-	    - these do happen!!!! */
-	if (status == MB_SUCCESS)
-		{
-		if (ping->png_raw_nbeams > ping->png_raw_nbeams_max
-			|| ping->png_raw_nbeams < 0
-			|| ping->png_raw_nbeams_max < 0
-			|| ping->png_raw_nbeams > MBSYS_SIMRAD2_MAXBEAMS
-			|| ping->png_raw_nbeams_max > MBSYS_SIMRAD2_MAXBEAMS
-			|| ping->png_raw_ntx > MBSYS_SIMRAD2_MAXTX)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_UNINTELLIGIBLE;
-			}
-		}
-
-	/* read binary tx values */
-	if (status == MB_SUCCESS)
-	    {
-	    for (i=0;i<ping->png_raw_ntx && status == MB_SUCCESS;i++)
-		{
-		read_len = fread(line,1,EM2_RAWBEAM2_TX_SIZE,mbfp);
-		if (read_len == EM2_RAWBEAM2_TX_SIZE
-			&& i < MBSYS_SIMRAD2_MAXTX)
-			{
-			status = MB_SUCCESS;
-			mb_get_binary_short(swap, &line[0], &short_val);
-			    ping->png_raw_txlastbeam[i] = (int) ((unsigned short) short_val);
-			mb_get_binary_short(swap, &line[2], &short_val);
-			    ping->png_raw_txtiltangle[i] = (int) short_val;
-			mb_get_binary_short(swap, &line[4], &short_val);
-			    ping->png_raw_txheading[i] = (int) ((unsigned short) short_val);
-			mb_get_binary_short(swap, &line[6], &short_val);
-			    ping->png_raw_txroll[i] = (int) short_val;
-			mb_get_binary_short(swap, &line[8], &short_val);
-			    ping->png_raw_txpitch[i] = (int) short_val;
-			mb_get_binary_short(swap, &line[10], &short_val);
-			    ping->png_raw_txheave[i] = (int) short_val;
-			}
-		else
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_EOF;
-			}
-		}
-	    }
-
-	/* read binary beam values */
-	if (status == MB_SUCCESS)
-	    {
-	    for (i=0;i<ping->png_raw_nbeams && status == MB_SUCCESS;i++)
-		{
-		read_len = fread(line,1,EM2_RAWBEAM2_BEAM_SIZE,mbfp);
-		if (read_len == EM2_RAWBEAM2_BEAM_SIZE
-			&& i < MBSYS_SIMRAD2_MAXBEAMS)
-			{
-			status = MB_SUCCESS;
-			mb_get_binary_short(swap, &line[0], &short_val);
-			    ping->png_raw_rxrange[i] = (int) ((unsigned short) short_val);
-			ping->png_raw_rxquality[i] = (mb_u_char) line[2];
-			ping->png_raw_rxwindow[i] = (mb_u_char) line[3];
-			ping->png_raw_rxamp[i] = (mb_s_char) line[4];
-			ping->png_raw_rxbeam_num[i] = (mb_u_char) line[5];
-			mb_get_binary_short(swap, &line[6], &short_val);
-			    ping->png_raw_rxpointangle[i] = (int) short_val;
-			mb_get_binary_short(swap, &line[8], &short_val);
-			    ping->png_raw_rxheading[i] = (int) ((unsigned short) short_val);
-			mb_get_binary_short(swap, &line[10], &short_val);
-			    ping->png_raw_rxroll[i] = (int) short_val;
-			mb_get_binary_short(swap, &line[12], &short_val);
-			    ping->png_raw_rxpitch[i] = (int) short_val;
-			mb_get_binary_short(swap, &line[14], &short_val);
-			    ping->png_raw_rxheave[i] = (int) short_val;
-			}
-		else
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_EOF;
-			}
-		}
-	    }
-
-	/* now get last bytes of record */
-	if (status == MB_SUCCESS)
-		{
-		read_len = fread(&line[0],1,4,mbfp);
-		if (read_len == 4)
-			{
-			status = MB_SUCCESS;
-			}
-		else
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_EOF;
-			}
-		if (line[1] == EM2_END)
-			*goodend = MB_YES;
-#ifdef MBR_EM300RAW_DEBUG
-	fprintf(stderr, "End Bytes: %2.2hX %d | %2.2hX %d | %2.2hX %d\n",
-		line[1], line[1],
-		line[2], line[2],
-		line[3], line[3]);
-#endif
-		}
-
-	/* check for some other indicators of a broken record
-	    - these do happen!!!! */
-	if (status == MB_SUCCESS)
-		{
-		if (ping->png_raw_nbeams > 0
-		    && ping->png_raw_rxbeam_num[0] > ping->png_raw_nbeams_max)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_UNINTELLIGIBLE;
-			}
-		for (i=1;i<ping->png_raw_nbeams;i++)
-			{
-			if (ping->png_raw_rxbeam_num[i] < ping->png_raw_rxbeam_num[i-1]
-				|| ping->png_raw_rxbeam_num[i] > ping->png_raw_nbeams_max)
-				{
-				status = MB_FAILURE;
-				*error = MB_ERROR_UNINTELLIGIBLE;
-				}
-			}
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       png_raw_date:                %d\n",ping->png_raw_date);
-		fprintf(stderr,"dbg5       png_raw_msec:                %d\n",ping->png_raw_msec);
-		fprintf(stderr,"dbg5       png_raw_count:               %d\n",ping->png_raw_count);
-		fprintf(stderr,"dbg5       png_raw_serial:              %d\n",ping->png_raw_serial);
-		fprintf(stderr,"dbg5       png_raw_heading:             %d\n",ping->png_raw_heading);
-		fprintf(stderr,"dbg5       png_raw_ssv:                 %d\n",ping->png_raw_ssv);
-		fprintf(stderr,"dbg5       png_raw_xducer_depth:        %d\n",ping->png_raw_xducer_depth);
-		fprintf(stderr,"dbg5       png_raw_nbeams_max:          %d\n",ping->png_raw_nbeams_max);
-		fprintf(stderr,"dbg5       png_raw_nbeams:              %d\n",ping->png_raw_nbeams);
-		fprintf(stderr,"dbg5       png_raw_depth_res:           %d\n",ping->png_raw_depth_res);
-		fprintf(stderr,"dbg5       png_raw_distance_res:        %d\n",ping->png_raw_distance_res);
-		fprintf(stderr,"dbg5       png_raw_sample_rate:         %d\n",ping->png_raw_sample_rate);
-		fprintf(stderr,"dbg5       png_raw_status:              %d\n",ping->png_raw_status);
-		fprintf(stderr,"dbg5       png_raw_rangenormal:         %d\n",ping->png_raw_rangenormal);
-		fprintf(stderr,"dbg5       png_raw_normalbackscatter:   %d\n",ping->png_raw_normalbackscatter);
-		fprintf(stderr,"dbg5       png_raw_obliquebackscatter:  %d\n",ping->png_raw_obliquebackscatter);
-		fprintf(stderr,"dbg5       png_raw_fixedgain:           %d\n",ping->png_raw_fixedgain);
-		fprintf(stderr,"dbg5       png_raw_txpower:             %d\n",ping->png_raw_txpower);
-		fprintf(stderr,"dbg5       png_raw_mode:                %d\n",ping->png_raw_mode);
-		fprintf(stderr,"dbg5       png_raw_coverage:            %d\n",ping->png_raw_coverage);
-		fprintf(stderr,"dbg5       png_raw_yawstabheading:      %d\n",ping->png_raw_yawstabheading);
-		fprintf(stderr,"dbg5       png_raw_ntx:                 %d\n",ping->png_raw_ntx);
-		fprintf(stderr,"dbg5       ------------------------------------------------------------\n");
-		fprintf(stderr,"dbg5       transmit pulse values:\n");
-		fprintf(stderr,"dbg5       cnt lastbeam tiltangle heading roll pitch heave\n");
-		fprintf(stderr,"dbg5       ------------------------------------------------------------\n");
-		for (i=0;i<ping->png_raw_ntx;i++)
-			fprintf(stderr,"dbg5       %3d %3d %4d %5d %4d %4d %4d\n",
-				i, ping->png_raw_txlastbeam[i], ping->png_raw_txtiltangle[i],
-				ping->png_raw_txheading[i], ping->png_raw_txroll[i],
-				ping->png_raw_txpitch[i], ping->png_raw_txheave[i]);
-		fprintf(stderr,"dbg5       ------------------------------------------------------------\n");
-		fprintf(stderr,"dbg5       beam values:\n");
-		fprintf(stderr,"dbg5       cnt range quality window amp beam angle heading roll pitch heave\n");
-		fprintf(stderr,"dbg5       ------------------------------------------------------------\n");
-		for (i=0;i<ping->png_raw_nbeams;i++)
-			fprintf(stderr,"dbg5       %3d %5d %3d %3d %4d %3d %5d %5d %4d %4d %4d\n",
-				i, ping->png_raw_rxrange[i], ping->png_raw_rxquality[i],
-				ping->png_raw_rxwindow[i], ping->png_raw_rxamp[i],
-				ping->png_raw_rxbeam_num[i], ping->png_raw_rxpointangle[i],
-				ping->png_raw_rxheading[i], ping->png_raw_rxroll[i],
-				ping->png_raw_rxpitch[i], ping->png_raw_rxheave[i]);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       goodend:    %d\n",*goodend);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em300raw_rd_rawbeam3(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store,
-		short sonar, int *goodend, int *error)
-{
-	char	*function_name = "mbr_em300raw_rd_rawbeam3";
-	int	status = MB_SUCCESS;
-	struct mbsys_simrad2_ping_struct *ping;
-	char	line[EM2_RAWBEAM3_HEADER_SIZE];
-	short	short_val;
-	int	int_val;
-	int	png_raw3_count;
-	int	png_raw3_serial;
-	int	head;
-	int	read_len;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		fprintf(stderr,"dbg2       sonar:      %d\n",sonar);
-		}
-
-	/* set goodend false until a good end is found */
-	*goodend = MB_NO;
-
-	/* get  storage structure */
-	ping = (struct mbsys_simrad2_ping_struct *) store->ping;
-	head = 0;
-
-	/* read binary header values into char array */
-	read_len = fread(line,1,EM2_RAWBEAM3_HEADER_SIZE,mbfp);
-	if (read_len == EM2_RAWBEAM3_HEADER_SIZE)
-		status = MB_SUCCESS;
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	/* in case of dual head EM3002 check if the data are from the second head and if so switch ping structure */
-	if (status == MB_SUCCESS && sonar == MBSYS_SIMRAD2_EM3002
-			&& store->numberheads == 2)
-		{
-		mb_get_binary_short(swap, &line[8], &short_val);
-		    png_raw3_count = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[10], &short_val);
-		    png_raw3_serial = (int) ((unsigned short) short_val);
-
-		if (png_raw3_count == ping->png_raw3_count && png_raw3_serial != ping->png_raw3_serial)
-			{
-			ping = (struct mbsys_simrad2_ping_struct *) store->ping2;
-			head = 1;
-			}
-		}
-
-	/* get binary header data */
-	if (status == MB_SUCCESS)
-		{
-		mb_get_binary_int(swap, &line[0], &ping->png_raw3_date);
-		    store->date = ping->png_raw3_date;
-		mb_get_binary_int(swap, &line[4], &ping->png_raw3_msec);
-		    store->msec = ping->png_raw3_msec;
-		mb_get_binary_short(swap, &line[8], &short_val);
-		    ping->png_raw3_count = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[10], &short_val);
-		    ping->png_raw3_serial = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[12], &short_val);
-		    ping->png_raw3_ntx = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[14], &short_val);
-		    ping->png_raw3_nbeams = (int) ((unsigned short) short_val);
-		mb_get_binary_int(swap, &line[16], &int_val);
-		    ping->png_raw3_sample_rate = (int) (int_val);
-		mb_get_binary_int(swap, &line[20], &int_val);
-		    ping->png_raw3_xducer_depth = (int) (int_val);
-		mb_get_binary_short(swap, &line[24], &short_val);
-		    ping->png_raw3_ssv = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[26], &short_val);
-		    ping->png_raw3_nbeams_max = (int) ((unsigned short) short_val);
-/*fprintf(stderr,"ping->png_raw_date:%d ping->png_raw_msec:%d ping->png_raw_count:%d ping->png_raw_nbeams:%d\n",
-ping->png_raw3_date,ping->png_raw3_msec,ping->png_raw3_count,ping->png_raw3_nbeams);*/
-		}
-
-	/* check for some indicators of a broken record
-	    - these do happen!!!! */
-	if (status == MB_SUCCESS)
-		{
-		if (ping->png_raw3_nbeams > ping->png_raw3_nbeams_max
-			|| ping->png_raw3_nbeams < 0
-			|| ping->png_raw3_nbeams_max < 0
-			|| ping->png_raw3_nbeams > MBSYS_SIMRAD2_MAXBEAMS
-			|| ping->png_raw3_nbeams_max > MBSYS_SIMRAD2_MAXBEAMS
-			|| ping->png_raw3_ntx > MBSYS_SIMRAD2_MAXTX)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_UNINTELLIGIBLE;
-			}
-		}
-
-	/* read binary tx values */
-	if (status == MB_SUCCESS)
-	    {
-	    for (i=0;i<ping->png_raw3_ntx && status == MB_SUCCESS;i++)
-		{
-		read_len = fread(line,1,EM2_RAWBEAM3_TX_SIZE,mbfp);
-		if (read_len == EM2_RAWBEAM3_TX_SIZE
-			&& i < MBSYS_SIMRAD2_MAXTX)
-			{
-			status = MB_SUCCESS;
-			mb_get_binary_short(swap, &line[0], &short_val);
-			    ping->png_raw3_txtiltangle[i] = (int) short_val;
-			mb_get_binary_short(swap, &line[2], &short_val);
-			    ping->png_raw3_txfocus[i] = (int) short_val;
-			mb_get_binary_int(swap, &line[4], &int_val);
-			    ping->png_raw3_txsignallength[i] = int_val;
-			mb_get_binary_int(swap, &line[8], &int_val);
-			    ping->png_raw3_txoffset[i] = int_val;
-			mb_get_binary_int(swap, &line[12], &int_val);
-			    ping->png_raw3_txcenter[i] = int_val;
-			mb_get_binary_short(swap, &line[16], &short_val);
-			    ping->png_raw3_txbandwidth[i] = (int) short_val;
-			ping->png_raw3_txwaveform[i] = (int) line[18];
-			ping->png_raw3_txsector[i] = (int) line[19];
-			}
-		else
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_EOF;
-			}
-		}
-	    }
-
-	/* read binary beam values */
-	if (status == MB_SUCCESS)
-	    {
-	    for (i=0;i<ping->png_raw3_nbeams && status == MB_SUCCESS;i++)
-		{
-		read_len = fread(line,1,EM2_RAWBEAM3_BEAM_SIZE,mbfp);
-		if (read_len == EM2_RAWBEAM3_BEAM_SIZE
-			&& i < MBSYS_SIMRAD2_MAXBEAMS)
-			{
-			status = MB_SUCCESS;
-			mb_get_binary_short(swap, &line[0], &short_val);
-			    ping->png_raw3_rxpointangle[i] = (int) short_val;
-			mb_get_binary_short(swap, &line[2], &short_val);
-			    ping->png_raw3_rxrange[i] = (int) ((unsigned short) short_val);
-			ping->png_raw3_rxsector[i] = (mb_u_char) line[4];
-			ping->png_raw3_rxamp[i] = (mb_s_char) line[5];
-			ping->png_raw3_rxquality[i] = (mb_u_char) line[6];
-			ping->png_raw3_rxwindow[i] = (mb_u_char) line[7];
-			mb_get_binary_short(swap, &line[8], &short_val);
-			    ping->png_raw3_rxbeam_num[i] = (int) ((short) short_val);
-			mb_get_binary_short(swap, &line[10], &short_val);
-			    ping->png_raw3_rxspare[i] = (int) ((unsigned short) short_val);
-			}
-		else
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_EOF;
-			}
-		}
-	    }
-
-	/* now get last bytes of record */
-	if (status == MB_SUCCESS)
-		{
-		read_len = fread(&line[0],1,4,mbfp);
-		if (read_len == 4)
-			{
-			status = MB_SUCCESS;
-			}
-		else
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_EOF;
-			}
-		if (line[1] == EM2_END)
-			*goodend = MB_YES;
-#ifdef MBR_EM300RAW_DEBUG
-	fprintf(stderr, "End Bytes: %2.2hX %d | %2.2hX %d | %2.2hX %d\n",
-		line[1], line[1],
-		line[2], line[2],
-		line[3], line[3]);
-#endif
-		}
-
-	/* check for some other indicators of a broken record
-	    - these do happen!!!! */
-	if (status == MB_SUCCESS)
-		{
-		if (ping->png_raw3_nbeams > 0
-		    && ping->png_raw3_rxbeam_num[0] > ping->png_raw3_nbeams_max)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_UNINTELLIGIBLE;
-			}
-		for (i=1;i<ping->png_raw3_nbeams;i++)
-			{
-			if (ping->png_raw3_rxbeam_num[i] < ping->png_raw3_rxbeam_num[i-1]
-				|| ping->png_raw3_rxbeam_num[i] > ping->png_raw3_nbeams_max)
-				{
-				status = MB_FAILURE;
-				*error = MB_ERROR_UNINTELLIGIBLE;
-				}
-			}
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       png_raw3_date:                %d\n",ping->png_raw3_date);
-		fprintf(stderr,"dbg5       png_raw3_msec:                %d\n",ping->png_raw3_msec);
-		fprintf(stderr,"dbg5       png_raw3_count:               %d\n",ping->png_raw3_count);
-		fprintf(stderr,"dbg5       png_raw3_serial:              %d\n",ping->png_raw3_serial);
-		fprintf(stderr,"dbg5       png_raw3_ntx:                 %d\n",ping->png_raw3_ntx);
-		fprintf(stderr,"dbg5       png_raw3_nbeams:              %d\n",ping->png_raw3_nbeams);
-		fprintf(stderr,"dbg5       png_raw3_sample_rate:         %d\n",ping->png_raw3_sample_rate);
-		fprintf(stderr,"dbg5       png_raw3_xducer_depth:        %d\n",ping->png_raw3_xducer_depth);
-		fprintf(stderr,"dbg5       png_raw3_ssv:                 %d\n",ping->png_raw3_ssv);
-		fprintf(stderr,"dbg5       png_raw3_nbeams_max:          %d\n",ping->png_raw3_nbeams_max);
-		fprintf(stderr,"dbg5       ------------------------------------------------------------\n");
-		fprintf(stderr,"dbg5       transmit pulse values:\n");
-		fprintf(stderr,"dbg5       tiltangle focus length offset center bandwidth waveform sector\n");
-		fprintf(stderr,"dbg5       ------------------------------------------------------------\n");
-		for (i=0;i<ping->png_raw3_ntx;i++)
-			fprintf(stderr,"dbg5       %3d %5d %5d %6d %4d %4d %4d %4d %4d\n",
-				i, ping->png_raw3_txtiltangle[i],
-				ping->png_raw3_txfocus[i], ping->png_raw3_txsignallength[i],
-				ping->png_raw3_txoffset[i], ping->png_raw3_txcenter[i],
-				ping->png_raw3_txbandwidth[i], ping->png_raw3_txwaveform[i],
-				ping->png_raw3_txsector[i]);
-		fprintf(stderr,"dbg5       ------------------------------------------------------------\n");
-		fprintf(stderr,"dbg5       beam values:\n");
-		fprintf(stderr,"dbg5       angle range sector amp quality window beam\n");
-		fprintf(stderr,"dbg5       ------------------------------------------------------------\n");
-		for (i=0;i<ping->png_raw3_nbeams;i++)
-			fprintf(stderr,"dbg5       %3d %5d %3d %3d %4d %3d %5d %5d %5d\n",
-				i, ping->png_raw3_rxpointangle[i], ping->png_raw3_rxrange[i],
-				ping->png_raw3_rxsector[i], ping->png_raw3_rxamp[i],
-				ping->png_raw3_rxquality[i], ping->png_raw3_rxwindow[i],
-				ping->png_raw3_rxbeam_num[i],ping->png_raw3_rxspare[i]);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       goodend:    %d\n",*goodend);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em300raw_rd_ss(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store,
-		short sonar, int length, int *match, int *goodend, int *error)
-{
-	char	*function_name = "mbr_em300raw_rd_ss";
-	int	status = MB_SUCCESS;
-	struct mbsys_simrad2_ping_struct *ping;
-	char	line[EM2_SS_HEADER_SIZE];
-	short	short_val;
-	int	png_ss_count;
-	int	png_ss_serial;
-	int	head;
-	int	read_len;
-	int	done;
-	int	junk_bytes;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		fprintf(stderr,"dbg2       sonar:      %d\n",sonar);
-		fprintf(stderr,"dbg2       length:     %d\n",length);
-		}
-
-	/* set goodend false until a good end is found */
-	*goodend = MB_NO;
-
-	/* get  storage structure */
-	ping = (struct mbsys_simrad2_ping_struct *) store->ping;
-	head = 0;
-
-	/* set kind and type values */
-	store->kind = MB_DATA_DATA;
-	store->type = EM2_SS;
-	store->sonar = sonar;
-
-	/* read binary header values into char array */
-	read_len = fread(line,1,EM2_SS_HEADER_SIZE,mbfp);
-	if (read_len == EM2_SS_HEADER_SIZE)
-		status = MB_SUCCESS;
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	/* in case of dual head EM3002 check if the data are from the second head and if so switch ping structure */
-	if (status == MB_SUCCESS && sonar == MBSYS_SIMRAD2_EM3002
-			&& store->numberheads == 2)
-		{
-		mb_get_binary_short(swap, &line[8], &short_val);
-		    png_ss_count = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[10], &short_val);
-		    png_ss_serial = (int) ((unsigned short) short_val);
-
-		if ((png_ss_count == ping->png_ss_count && png_ss_serial != ping->png_ss_serial)
-			|| (png_ss_count == store->ping2->png_count && png_ss_serial == store->ping2->png_serial))
-			{
-			ping = (struct mbsys_simrad2_ping_struct *) store->ping2;
-			head = 1;
-			}
-		}
-
-	/* get binary header data */
-	if (status == MB_SUCCESS)
-		{
-		mb_get_binary_int(swap, &line[0], &ping->png_ss_date);
-		    store->date = ping->png_ss_date;
-		mb_get_binary_int(swap, &line[4], & ping->png_ss_msec);
-		    store->msec = ping->png_ss_msec;
-		mb_get_binary_short(swap, &line[8], &short_val);
-		    ping->png_ss_count = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[10], &short_val);
-		    ping->png_ss_serial = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[12], &short_val);
-		    ping->png_max_range = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[14], &short_val);
-		    ping->png_r_zero = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[16], &short_val);
-		    ping->png_r_zero_corr = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[18], &short_val);
-		    ping->png_tvg_start = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[20], &short_val);
-		    ping->png_tvg_stop = (int) ((unsigned short) short_val);
-		ping->png_bsn = (mb_s_char) line[22];
-		ping->png_bso = (mb_s_char) line[23];
-		mb_get_binary_short(swap, &line[24], &short_val);
-		    ping->png_tx = (int) ((unsigned short) short_val);
-		ping->png_tvg_crossover = (mb_u_char) line[26];
-		ping->png_nbeams_ss = (mb_u_char) line[27];
-/*fprintf(stderr," ping->png_ss_date:%d  ping->png_ss_msec:%d  ping->png_ss_count:%d  ping->png_nbeams_ss:%d\n",
-ping->png_ss_date,ping->png_ss_msec,ping->png_ss_count,ping->png_nbeams_ss);*/
-		}
-
-	/* check for some indicators of a broken record
-	    - these do happen!!!! */
-	if (status == MB_SUCCESS)
-		{
-		if (ping->png_nbeams_ss < 0
-			|| ping->png_nbeams_ss > MBSYS_SIMRAD2_MAXBEAMS)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_UNINTELLIGIBLE;
-			}
-		}
-
-	/* read binary beam values */
-	if (status == MB_SUCCESS)
-	    {
-	    ping->png_npixels = 0;
-	    for (i=0;i<ping->png_nbeams_ss && status == MB_SUCCESS;i++)
-		{
-		read_len = fread(line,1,EM2_SS_BEAM_SIZE,mbfp);
-		if (read_len == EM2_SS_BEAM_SIZE
-			&& i < MBSYS_SIMRAD2_MAXBEAMS)
-			{
-			status = MB_SUCCESS;
-			ping->png_beam_index[i] = (mb_u_char) line[0];
-			ping->png_sort_direction[i] = (mb_s_char) line[1];
-			mb_get_binary_short(swap, &line[2], &short_val);
-			    ping->png_beam_samples[i] = (int) ((unsigned short) short_val);
-			ping->png_start_sample[i] = ping->png_npixels;
-			mb_get_binary_short(swap, &line[4], &short_val);
-			    ping->png_center_sample[i] = (int) ((unsigned short) short_val);
-			}
-		else
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_EOF;
-			}
-		ping->png_npixels += ping->png_beam_samples[i];
-		if (ping->png_npixels > MBSYS_SIMRAD2_MAXRAWPIXELS)
-			{
-			ping->png_beam_samples[i]
-				-= (ping->png_npixels
-					- MBSYS_SIMRAD2_MAXRAWPIXELS);
-			if (ping->png_beam_samples[i] < 0)
-				ping->png_beam_samples[i] = 0;
-			}
-		}
-
-	    /* check for no pixel data - frequently occurs with EM1002 */
-	    if (length == EM2_SS_HEADER_SIZE + ping->png_nbeams_ss * EM2_SS_BEAM_SIZE + 8)
-		{
-		if (verbose > 0)
-		    fprintf(stderr, "WARNING: No Simrad multibeam sidescan pixels in data record!\n");
-		junk_bytes = 0;
-		ping->png_npixels = 0;
-		}
-
-	    /* check for too much pixel data */
-	    if (ping->png_npixels > MBSYS_SIMRAD2_MAXRAWPIXELS)
-		{
-		if (verbose > 0)
-		    fprintf(stderr, "WARNING: Simrad multibeam sidescan pixels %d exceed maximum %d!\n",
-			    ping->png_npixels, MBSYS_SIMRAD2_MAXRAWPIXELS);
-		junk_bytes = ping->png_npixels - MBSYS_SIMRAD2_MAXRAWPIXELS;
-		ping->png_npixels = MBSYS_SIMRAD2_MAXRAWPIXELS;
-		status = MB_FAILURE;
-		*error = MB_ERROR_UNINTELLIGIBLE;
-		}
-	    else
-		junk_bytes = 0;
-	    }
-
-	/* check for some other indicators of a broken record
-	    - these do happen!!!! */
-	if (status == MB_SUCCESS)
-		{
-		if (ping->png_nbeams_ss > 0
-		    && ping->png_beam_index[0] > MBSYS_SIMRAD2_MAXBEAMS)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_UNINTELLIGIBLE;
-			}
-		for (i=1;i<ping->png_nbeams_ss;i++)
-			{
-			if (ping->png_beam_index[i] < ping->png_beam_index[i-1]
-				|| ping->png_beam_index[0] > MBSYS_SIMRAD2_MAXBEAMS)
-				{
-				status = MB_FAILURE;
-				*error = MB_ERROR_UNINTELLIGIBLE;
-				}
-			}
-		}
-
-	/* read binary sidescan values */
-	if (status == MB_SUCCESS)
-		{
-		read_len = fread(ping->png_ssraw,1,ping->png_npixels,mbfp);
-		if (read_len == ping->png_npixels )
-			{
-			status = MB_SUCCESS;
-			}
-		else
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_EOF;
-			}
-		}
-
-	/* read any leftover binary sidescan values */
-	if (status == MB_SUCCESS)
-		{
-		for (i=0;i<junk_bytes;i++)
-		    read_len = fread(&line[0],1,1,mbfp);
-		}
-
-	/* now loop over reading individual characters to
-	    get last bytes of record */
-	if (status == MB_SUCCESS)
-	    {
-	    done = MB_NO;
-	    while (done == MB_NO)
-		{
-		read_len = fread(&line[0],1,1,mbfp);
-		if (read_len == 1 && line[0] == EM2_END)
-			{
-			done = MB_YES;
-			status = MB_SUCCESS;
-			/* get last two check sum bytes */
-			read_len = fread(&line[1],2,1,mbfp);
-			*goodend = MB_YES;
-#ifdef MBR_EM300RAW_DEBUG
-	fprintf(stderr, "End Bytes: %2.2hX %d | %2.2hX %d | %2.2hX %d\n",
-		line[0], line[0],
-		line[1], line[1],
-		line[2], line[2]);
-#endif
-			}
-		else if (read_len == 1)
-			{
-			status = MB_SUCCESS;
-			}
-		else
-			{
-			done = MB_YES;
-			/* return success here because all of the
-			    important information in this record has
-			    already been read - next attempt to read
-			    file will return error */
-			status = MB_SUCCESS;
-			}
-		}
-#ifdef MBR_EM300RAW_DEBUG
-	fprintf(stderr, "\n");
-#endif
-	    }
-
-	/* check if bath and sidescan time tags agree
-	   - we cannot pair bath
-	   and sidescan records from different pings */
-	if (status == MB_SUCCESS)
-		{
-		if (ping->png_date == ping->png_ss_date
-		    && ping->png_msec == ping->png_ss_msec)
-		    *match = MB_YES;
-		else
-		    *match = MB_NO;
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       png_date:        %d\n",ping->png_date);
-		fprintf(stderr,"dbg5       png_msec:        %d\n",ping->png_msec);
-		fprintf(stderr,"dbg5       png_ss_date:     %d\n",ping->png_ss_date);
-		fprintf(stderr,"dbg5       png_ss_msec:     %d\n",ping->png_ss_msec);
-		fprintf(stderr,"dbg5       png_ss_count:    %d\n",ping->png_ss_count);
-		fprintf(stderr,"dbg5       png_ss_serial:   %d\n",ping->png_ss_serial);
-
-		fprintf(stderr,"dbg5       png_heading:     %d\n",ping->png_heading);
-		fprintf(stderr,"dbg5       png_ssv:         %d\n",ping->png_ssv);
-		fprintf(stderr,"dbg5       png_xducer_depth:      %d\n",ping->png_xducer_depth);
-		fprintf(stderr,"dbg5       png_offset_multiplier: %d\n",ping->png_offset_multiplier);
-		fprintf(stderr,"dbg5       png_nbeams_max:        %d\n",ping->png_nbeams_max);
-		fprintf(stderr,"dbg5       png_nbeams:            %d\n",ping->png_nbeams);
-		fprintf(stderr,"dbg5       png_depth_res:         %d\n",ping->png_depth_res);
-		fprintf(stderr,"dbg5       png_distance_res:      %d\n",ping->png_distance_res);
-		fprintf(stderr,"dbg5       png_sample_rate:       %d\n",ping->png_sample_rate);
-		fprintf(stderr,"dbg5       cnt  depth xtrack ltrack dprsn   azi   rng  qual wnd amp num\n");
-		fprintf(stderr,"dbg5       ----------------------------------------------------------------\n");
-		for (i=0;i<ping->png_nbeams;i++)
-			fprintf(stderr,"dbg5       %3d %6d %6d %6d %5d %5d %5d %4d %3d %3d %3d\n",
-				i, ping->png_depth[i], ping->png_acrosstrack[i],
-				ping->png_alongtrack[i], ping->png_depression[i],
-				ping->png_azimuth[i], ping->png_range[i],
-				ping->png_quality[i], ping->png_window[i],
-				ping->png_amp[i], ping->png_beam_num[i]);
-		fprintf(stderr,"dbg5       png_max_range:   %d\n",ping->png_max_range);
-		fprintf(stderr,"dbg5       png_r_zero:      %d\n",ping->png_r_zero);
-		fprintf(stderr,"dbg5       png_r_zero_corr: %d\n",ping->png_r_zero_corr);
-		fprintf(stderr,"dbg5       png_tvg_start:   %d\n",ping->png_tvg_start);
-		fprintf(stderr,"dbg5       png_tvg_stop:    %d\n",ping->png_tvg_stop);
-		fprintf(stderr,"dbg5       png_bsn:         %d\n",ping->png_bsn);
-		fprintf(stderr,"dbg5       png_bso:         %d\n",ping->png_bso);
-		fprintf(stderr,"dbg5       png_tx:          %d\n",ping->png_tx);
-		fprintf(stderr,"dbg5       png_tvg_crossover: %d\n",ping->png_tvg_crossover);
-		fprintf(stderr,"dbg5       png_nbeams_ss:     %d\n",ping->png_nbeams_ss);
-		fprintf(stderr,"dbg5       png_npixels:       %d\n",ping->png_npixels);
-		fprintf(stderr,"dbg5       cnt  index sort samples start center\n");
-		fprintf(stderr,"dbg5       --------------------------------------------------\n");
-		for (i=0;i<ping->png_nbeams_ss;i++)
-			fprintf(stderr,"dbg5        %4d %3d %2d %4d %4d %4d\n",
-				i, ping->png_beam_index[i], ping->png_sort_direction[i],
-				ping->png_beam_samples[i], ping->png_start_sample[i],
-				ping->png_center_sample[i]);
-		fprintf(stderr,"dbg5       cnt  ss\n");
-		fprintf(stderr,"dbg5       --------------------------------------------------\n");
-		for (i=0;i<ping->png_npixels;i++)
-			fprintf(stderr,"dbg5        %d %d\n",
-				i, ping->png_ssraw[i]);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       match:      %d\n",*match);
-		fprintf(stderr,"dbg2       goodend:    %d\n",*goodend);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em300raw_rd_wc(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store,
-		short sonar, int *goodend, int *error)
-{
-	char	*function_name = "mbr_em300raw_rd_wc";
-	int	status = MB_SUCCESS;
-	struct mbsys_simrad2_watercolumn_struct *wc;
-	char	line[EM2_WC_HEADER_SIZE];
-	short	short_val;
-	int	read_len;
-	int	done;
-	int	file_bytes;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		fprintf(stderr,"dbg2       sonar:      %d\n",sonar);
-		}
-
-	/* set goodend false until a good end is found */
-	*goodend = MB_NO;
-
-	/* get  storage structure */
-	wc = (struct mbsys_simrad2_watercolumn_struct *) store->wc;
-
-	/* set kind and type values */
-	store->kind = MB_DATA_WATER_COLUMN;
-	store->type = EM2_WATERCOLUMN;
-	store->sonar = sonar;
-	file_bytes = ftell(mbfp);
-
-	/* read binary header values into char array */
-	read_len = fread(line,1,EM2_WC_HEADER_SIZE,mbfp);
-	if (read_len == EM2_WC_HEADER_SIZE)
-		status = MB_SUCCESS;
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	/* get binary header data */
-	if (status == MB_SUCCESS)
-		{
-		mb_get_binary_int(swap, &line[0], &wc->wtc_date);
-		    store->date = wc->wtc_date;
-		mb_get_binary_int(swap, &line[4], & wc->wtc_msec);
-		    store->msec = wc->wtc_msec;
-		mb_get_binary_short(swap, &line[8], &short_val);
-		    wc->wtc_count = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[10], &short_val);
-		    wc->wtc_serial = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[12], &short_val);
-		    wc->wtc_ndatagrams = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[14], &short_val);
-		    wc->wtc_datagram = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[16], &short_val);
-		    wc->wtc_ntx = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[18], &short_val);
-		    wc->wtc_nrx = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[20], &short_val);
-		    wc->wtc_nbeam = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[22], &short_val);
-		    wc->wtc_ssv = (int) ((unsigned short) short_val);
-		mb_get_binary_int(swap, &line[24], &(wc->wtc_sfreq));
-		mb_get_binary_short(swap, &line[28], &short_val);
-		    wc->wtc_heave = (int) ((short) short_val);
-		mb_get_binary_short(swap, &line[30], &short_val);
-		    wc->wtc_spare1 = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[32], &short_val);
-		    wc->wtc_spare2 = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[34], &short_val);
-		    wc->wtc_spare3 = (int) ((unsigned short) short_val);
-		}
-
-	/* check for some indicators of a broken record
-	    - these do happen!!!! */
-	if (status == MB_SUCCESS)
-		{
-		if (wc->wtc_nbeam < 0
-			|| wc->wtc_nbeam > MBSYS_SIMRAD2_MAXBEAMS
-			|| wc->wtc_ntx < 0
-			|| wc->wtc_ntx > MBSYS_SIMRAD2_MAXTX)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_UNINTELLIGIBLE;
-			}
-		}
-
-	/* read binary beam values */
-	if (status == MB_SUCCESS)
-	    {
-	    for (i=0;i<wc->wtc_ntx && status == MB_SUCCESS;i++)
-		{
-		read_len = fread(line,1,EM2_WC_TX_SIZE,mbfp);
-		if (read_len == EM2_WC_TX_SIZE
-			&& i < MBSYS_SIMRAD2_MAXTX)
-			{
-			mb_get_binary_short(swap, &line[0], &short_val);
-			    wc->wtc_txtiltangle[i] = (int) (short_val);
-			mb_get_binary_short(swap, &line[2], &short_val);
-			    wc->wtc_txcenter[i] = (int) (short_val);
-			wc->wtc_txsector[i] = (int) ((mb_u_char) line[4]);
-			}
-		else
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_EOF;
-			}
-		}
-	    for (i=0;i<wc->wtc_nbeam && status == MB_SUCCESS;i++)
-		{
-		read_len = fread(line,1,EM2_WC_BEAM_SIZE,mbfp);
-		if (read_len == EM2_WC_BEAM_SIZE
-			&& i < MBSYS_SIMRAD2_MAXBEAMS)
-			{
-			mb_get_binary_short(swap, &line[0], &short_val);
-			    wc->beam[i].wtc_rxpointangle = (int) (short_val);
-			mb_get_binary_short(swap, &line[2], &short_val);
-			    wc->beam[i].wtc_start_sample = (int) (short_val);
-			mb_get_binary_short(swap, &line[4], &short_val);
-			    wc->beam[i].wtc_beam_samples = (int) (unsigned short)(short_val);
-			mb_get_binary_short(swap, &line[6], &short_val);
-			    wc->beam[i].wtc_beam_spare = (int) (unsigned short)(short_val);
-			wc->beam[i].wtc_sector = (int) (mb_u_char) (line[8]);
-			wc->beam[i].wtc_beam = (int) (mb_u_char) (line[9]);
-			}
-		read_len = fread(wc->beam[i].wtc_amp,1,wc->beam[i].wtc_beam_samples,mbfp);
-		}
-	    }
-
-	/* now loop over reading individual characters to
-	    get last bytes of record */
-	if (status == MB_SUCCESS)
-	    {
-	    done = MB_NO;
-	    while (done == MB_NO)
-		{
-		read_len = fread(&line[0],1,1,mbfp);
-		if (read_len == 1 && line[0] == EM2_END)
-			{
-			done = MB_YES;
-			status = MB_SUCCESS;
-			/* get last two check sum bytes */
-			read_len = fread(&line[1],2,1,mbfp);
-			*goodend = MB_YES;
-#ifdef MBR_EM300RAW_DEBUG
-	fprintf(stderr, "End Bytes: %2.2hX %d | %2.2hX %d | %2.2hX %d\n",
-		line[0], line[0],
-		line[1], line[1],
-		line[2], line[2]);
-#endif
-			}
-		else if (read_len == 1)
-			{
-			status = MB_SUCCESS;
-			}
-		else
-			{
-			done = MB_YES;
-			/* return success here because all of the
-			    important information in this record has
-			    already been read - next attempt to read
-			    file will return error */
-			status = MB_SUCCESS;
-			}
-		}
-#ifdef MBR_EM300RAW_DEBUG
-	fprintf(stderr, "\n");
-#endif
-	    }
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       wtc_date:        %d\n",wc->wtc_date);
-		fprintf(stderr,"dbg5       wtc_msec:        %d\n",wc->wtc_msec);
-		fprintf(stderr,"dbg5       wtc_count:       %d\n",wc->wtc_count);
-		fprintf(stderr,"dbg5       wtc_serial:      %d\n",wc->wtc_serial);
-		fprintf(stderr,"dbg5       wtc_ndatagrams:  %d\n",wc->wtc_ndatagrams);
-		fprintf(stderr,"dbg5       wtc_datagram:    %d\n",wc->wtc_datagram);
-		fprintf(stderr,"dbg5       wtc_ntx:         %d\n",wc->wtc_ntx);
-		fprintf(stderr,"dbg5       wtc_nrx:         %d\n",wc->wtc_nrx);
-		fprintf(stderr,"dbg5       wtc_nbeam:       %d\n",wc->wtc_nbeam);
-		fprintf(stderr,"dbg5       wtc_ssv:         %d\n",wc->wtc_ssv);
-		fprintf(stderr,"dbg5       wtc_sfreq:       %d\n",wc->wtc_sfreq);
-		fprintf(stderr,"dbg5       wtc_heave:       %d\n",wc->wtc_heave);
-		fprintf(stderr,"dbg5       wtc_spare1:      %d\n",wc->wtc_spare1);
-		fprintf(stderr,"dbg5       wtc_spare2:      %d\n",wc->wtc_spare2);
-		fprintf(stderr,"dbg5       wtc_spare3:      %d\n",wc->wtc_spare3);
-		fprintf(stderr,"dbg5       ---------------------------\n");
-		fprintf(stderr,"dbg5       cnt  tilt center sector\n");
-		fprintf(stderr,"dbg5       ---------------------------\n");
-		for (i=0;i<wc->wtc_ntx;i++)
-			fprintf(stderr,"dbg5       %3d %6d %6d %6d\n",
-				i, wc->wtc_txtiltangle[i], wc->wtc_txcenter[i],
-				wc->wtc_txsector[i]);
-		for (i=0;i<wc->wtc_nbeam;i++)
-			{
-			fprintf(stderr,"dbg5       --------------------------------------------------\n");
-			fprintf(stderr,"dbg5       cnt  angle start samples unknown sector beam\n");
-			fprintf(stderr,"dbg5       --------------------------------------------------\n");
-			fprintf(stderr,"dbg5        %4d %3d %2d %4d %4d %4d %4d\n",
-				i, wc->beam[i].wtc_rxpointangle,
-				wc->beam[i].wtc_start_sample,
-				wc->beam[i].wtc_beam_samples,
-				wc->beam[i].wtc_beam_spare,
-				wc->beam[i].wtc_sector,
-				wc->beam[i].wtc_beam);
-/*			fprintf(stderr,"dbg5       --------------------------------------------------\n");
-			fprintf(stderr,"dbg5       beam[%d]: sample amplitude\n",i);
-			fprintf(stderr,"dbg5       --------------------------------------------------\n");
-			for (j=0;j<wc->beam[i].wtc_beam_samples;j++)
-				fprintf(stderr,"dbg5        %4d %4d\n",
-					j, wc->beam[i].wtc_amp[j]);*/
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       goodend:    %d\n",*goodend);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em300raw_wr_data(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_em300raw_wr_data";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_simrad2_struct *store;
-	struct mbsys_simrad2_ping_struct *ping;
-	FILE	*mbfp;
-	int	swap;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_simrad2_struct *) store_ptr;
-	ping = (struct mbsys_simrad2_ping_struct *) store->ping;
-	mbfp = mb_io_ptr->mbfp;
-
-#ifdef MBR_EM300RAW_DEBUG
-	fprintf(stderr,"\nstart of mbr_em300raw_wr_data:\n");
-	fprintf(stderr,"kind:%d %d type:%x\n", store->kind, mb_io_ptr->new_kind, store->type);
-#endif
-
-	/* set swap flag */
-	swap = MB_NO;
-
-	if (store->kind == MB_DATA_COMMENT
-		|| store->kind == MB_DATA_START
-		|| store->kind == MB_DATA_STOP)
-		{
-#ifdef MBR_EM300RAW_DEBUG
-	fprintf(stderr,"call mbr_em300raw_wr_start kind:%d type %x\n",store->kind,store->type);
-#endif
-		status = mbr_em300raw_wr_start(verbose,mbfp,swap,store,error);
-		}
-	else if (store->kind == MB_DATA_RUN_PARAMETER)
-		{
-#ifdef MBR_EM300RAW_DEBUG
-	fprintf(stderr,"call mbr_em300raw_wr_run_parameter kind:%d type %x\n",store->kind,store->type);
-#endif
-		status = mbr_em300raw_wr_run_parameter(verbose,mbfp,swap,store,error);
-		}
-	else if (store->kind == MB_DATA_CLOCK)
-		{
-#ifdef MBR_EM300RAW_DEBUG
-	fprintf(stderr,"call mbr_em300raw_wr_clock kind:%d type %x\n",store->kind,store->type);
-#endif
-		status = mbr_em300raw_wr_clock(verbose,mbfp,swap,store,error);
-		}
-	else if (store->kind == MB_DATA_TIDE)
-		{
-#ifdef MBR_EM300RAW_DEBUG
-	fprintf(stderr,"call mbr_em300raw_wr_tide kind:%d type %x\n",store->kind,store->type);
-#endif
-		status = mbr_em300raw_wr_tide(verbose,mbfp,swap,store,error);
-		}
-	else if (store->kind == MB_DATA_HEIGHT)
-		{
-#ifdef MBR_EM300RAW_DEBUG
-	fprintf(stderr,"call mbr_em300raw_wr_height kind:%d type %x\n",store->kind,store->type);
-#endif
-		status = mbr_em300raw_wr_height(verbose,mbfp,swap,store,error);
-		}
-	else if (store->kind == MB_DATA_HEADING)
-		{
-#ifdef MBR_EM300RAW_DEBUG
-	fprintf(stderr,"call mbr_em300raw_wr_heading kind:%d type %x\n",store->kind,store->type);
-#endif
-		status = mbr_em300raw_wr_heading(verbose,mbfp,swap,store,error);
-		}
-	else if (store->kind == MB_DATA_SSV)
-		{
-#ifdef MBR_EM300RAW_DEBUG
-	fprintf(stderr,"call mbr_em300raw_wr_ssv kind:%d type %x\n",store->kind,store->type);
-#endif
-		status = mbr_em300raw_wr_ssv(verbose,mbfp,swap,store,error);
-		}
-	else if (store->kind == MB_DATA_TILT)
-		{
-#ifdef MBR_EM300RAW_DEBUG
-	fprintf(stderr,"call mbr_em300raw_wr_tilt kind:%d type %x\n",store->kind,store->type);
-#endif
-		status = mbr_em300raw_wr_tilt(verbose,mbfp,swap,store,error);
-		}
-	else if (store->kind == MB_DATA_ATTITUDE)
-		{
-#ifdef MBR_EM300RAW_DEBUG
-	fprintf(stderr,"call mbr_em300raw_wr_attitude kind:%d type %x\n",store->kind,store->type);
-#endif
-		status = mbr_em300raw_wr_attitude(verbose,mbfp,swap,store,error);
-		}
-	else if (store->kind == MB_DATA_NAV
-		|| store->kind == MB_DATA_NAV1
-		|| store->kind == MB_DATA_NAV2
-		|| store->kind == MB_DATA_NAV3)
-		{
-#ifdef MBR_EM300RAW_DEBUG
-	fprintf(stderr,"call mbr_em300raw_wr_pos kind:%d type %x\n",store->kind,store->type);
-#endif
-		status = mbr_em300raw_wr_pos(verbose,mbfp,swap,store,error);
-		}
-	else if (store->kind == MB_DATA_VELOCITY_PROFILE)
-		{
-#ifdef MBR_EM300RAW_DEBUG
-	fprintf(stderr,"call mbr_em300raw_wr_svp kind:%d type %x\n",store->kind,store->type);
-#endif
-	        if (store->type == EM2_SVP)
-		  status = mbr_em300raw_wr_svp(verbose,mbfp,swap,store,error);
-		else
-		  status = mbr_em300raw_wr_svp2(verbose,mbfp,swap,store,error);
-		}
-	else if (store->kind == MB_DATA_DATA)
-		{
-		/* write out data from first head for all sonars */
-#ifdef MBR_EM300RAW_DEBUG
-	fprintf(stderr,"call mbr_em300raw_wr_bath kind:%d type %x\n",store->kind,store->type);
-#endif
-		status = mbr_em300raw_wr_bath(verbose,mbfp,swap,store,0,error);
-		if (ping->png_raw1_read == MB_YES)
-		    {
-#ifdef MBR_EM300RAW_DEBUG
-	fprintf(stderr,"call mbr_em300raw_wr_rawbeam kind:%d type %x\n",store->kind,store->type);
-#endif
-		    status = mbr_em300raw_wr_rawbeam(verbose,mbfp,swap,store,error);
-		    }
-		if (ping->png_raw2_read == MB_YES)
-		    {
-#ifdef MBR_EM300RAW_DEBUG
-	fprintf(stderr,"call mbr_em300raw_wr_rawbeam2 kind:%d type %x\n",store->kind,store->type);
-#endif
-		    status = mbr_em300raw_wr_rawbeam2(verbose,mbfp,swap,store,error);
-		    }
-		if (ping->png_raw3_read == MB_YES)
-		    {
-#ifdef MBR_EM300RAW_DEBUG
-	fprintf(stderr,"call mbr_em300raw_wr_rawbeam3 kind:%d type %x\n",store->kind,store->type);
-#endif
-		    status = mbr_em300raw_wr_rawbeam3(verbose,mbfp,swap,store,0,error);
-		    }
-#ifdef MBR_EM300RAW_DEBUG
-	if (ping->png_raw1_read == MB_NO && ping->png_raw2_read == MB_NO && ping->png_raw3_read == MB_NO)
-	fprintf(stderr,"NOT call mbr_em300raw_wr_rawbeam kind:%d type %x\n",store->kind,store->type);
-#endif
-		if (ping->png_ss_read == MB_YES)
-		    {
-#ifdef MBR_EM300RAW_DEBUG
-	fprintf(stderr,"call mbr_em300raw_wr_ss kind:%d type %x\n",store->kind,store->type);
-#endif
-		    status = mbr_em300raw_wr_ss(verbose,mbfp,swap,store,0,error);
-		    }
-#ifdef MBR_EM300RAW_DEBUG
-	else fprintf(stderr,"NOT call mbr_em300raw_wr_ss kind:%d type %x\n",store->kind,store->type);
-#endif
-
-		/* write out data from second head for EM3002 */
-		if (store->sonar == MBSYS_SIMRAD2_EM3002
-			&& store->numberheads == 2
-			&& store->ping2 != NULL
-			&& store->ping2->png_count ==store->ping->png_count)
-			{
-#ifdef MBR_EM300RAW_DEBUG
-	fprintf(stderr,"call mbr_em300raw_wr_bath kind:%d type %x\n",store->kind,store->type);
-#endif
-			status = mbr_em300raw_wr_bath(verbose,mbfp,swap,store,1,error);
-			if (ping->png_raw3_read == MB_YES)
-			    {
-#ifdef MBR_EM300RAW_DEBUG
-	fprintf(stderr,"call mbr_em300raw_wr_rawbeam3 kind:%d type %x\n",store->kind,store->type);
-#endif
-			    status = mbr_em300raw_wr_rawbeam3(verbose,mbfp,swap,store,1,error);
-			    }
-#ifdef MBR_EM300RAW_DEBUG
-	if (ping->png_raw3_read == MB_NO)
-	fprintf(stderr,"NOT call mbr_em300raw_wr_rawbeam kind:%d type %x\n",store->kind,store->type);
-#endif
-			if (ping->png_ss_read == MB_YES)
-			    {
-#ifdef MBR_EM300RAW_DEBUG
-	fprintf(stderr,"call mbr_em300raw_wr_ss kind:%d type %x\n",store->kind,store->type);
-#endif
-			    status = mbr_em300raw_wr_ss(verbose,mbfp,swap,store,1,error);
-			    }
-#ifdef MBR_EM300RAW_DEBUG
-	else fprintf(stderr,"NOT call mbr_em300raw_wr_ss kind:%d type %x\n",store->kind,store->type);
-#endif
-			}
-		}
-	else if (store->kind == MB_DATA_WATER_COLUMN)
-		{
-#ifdef MBR_EM300RAW_DEBUG
-	fprintf(stderr,"call mbr_em300raw_wr_wc kind:%d type %x\n",store->kind,store->type);
-#endif
-	        status = mbr_em300raw_wr_wc(verbose,mbfp,swap,store,error);
-		}
-	else
-		{
-#ifdef MBR_EM300RAW_DEBUG
-	fprintf(stderr,"call nothing bad kind: %d type %x\n", store->kind, store->type);
-#endif
-		status = MB_FAILURE;
-		*error = MB_ERROR_BAD_KIND;
-		}
-
-#ifdef MBR_EM300RAW_DEBUG
-	fprintf(stderr,"status:%d error:%d\n", status, *error);
-	fprintf(stderr,"end of mbr_em300raw_wr_data:\n");
-#endif
-
-	/* print output debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Data record kind in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       kind:       %d\n",store->kind);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em300raw_wr_start(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store, int *error)
-{
-	char	*function_name = "mbr_em300raw_wr_start";
-	int	status = MB_SUCCESS;
-	char	line[MBSYS_SIMRAD2_BUFFER_SIZE], *buff;
-	int	buff_len, write_len;
-	int	write_size;
-	unsigned short checksum;
-	char	*comma_ptr;
-	mb_u_char   *uchar_ptr;
-	int	j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       par_date:        %d\n",store->par_date);
-		fprintf(stderr,"dbg5       par_msec:        %d\n",store->par_msec);
-		fprintf(stderr,"dbg5       par_line_num:    %d\n",store->par_line_num);
-		fprintf(stderr,"dbg5       par_serial_1:    %d\n",store->par_serial_1);
-		fprintf(stderr,"dbg5       par_serial_2:    %d\n",store->par_serial_2);
-		fprintf(stderr,"dbg5       par_wlz:         %f\n",store->par_wlz);
-		fprintf(stderr,"dbg5       par_smh:         %d\n",store->par_smh);
-		fprintf(stderr,"dbg5       par_s1z:         %f\n",store->par_s1z);
-		fprintf(stderr,"dbg5       par_s1x:         %f\n",store->par_s1x);
-		fprintf(stderr,"dbg5       par_s1y:         %f\n",store->par_s1y);
-		fprintf(stderr,"dbg5       par_s1h:         %f\n",store->par_s1h);
-		fprintf(stderr,"dbg5       par_s1r:         %f\n",store->par_s1r);
-		fprintf(stderr,"dbg5       par_s1p:         %f\n",store->par_s1p);
-		fprintf(stderr,"dbg5       par_s1n:         %d\n",store->par_s1n);
-		fprintf(stderr,"dbg5       par_s2z:         %f\n",store->par_s2z);
-		fprintf(stderr,"dbg5       par_s2x:         %f\n",store->par_s2x);
-		fprintf(stderr,"dbg5       par_s2y:         %f\n",store->par_s2y);
-		fprintf(stderr,"dbg5       par_s2h:         %f\n",store->par_s2h);
-		fprintf(stderr,"dbg5       par_s2r:         %f\n",store->par_s2r);
-		fprintf(stderr,"dbg5       par_s2p:         %f\n",store->par_s2p);
-		fprintf(stderr,"dbg5       par_s2n:         %d\n",store->par_s2n);
-		fprintf(stderr,"dbg5       par_go1:         %f\n",store->par_go1);
-		fprintf(stderr,"dbg5       par_go2:         %f\n",store->par_go2);
-		fprintf(stderr,"dbg5       par_tsv:         %s\n",store->par_tsv);
-		fprintf(stderr,"dbg5       par_rsv:         %s\n",store->par_rsv);
-		fprintf(stderr,"dbg5       par_bsv:         %s\n",store->par_bsv);
-		fprintf(stderr,"dbg5       par_psv:         %s\n",store->par_psv);
-		fprintf(stderr,"dbg5       par_osv:         %s\n",store->par_osv);
-		fprintf(stderr,"dbg5       par_dsd:         %f\n",store->par_dsd);
-		fprintf(stderr,"dbg5       par_dso:         %f\n",store->par_dso);
-		fprintf(stderr,"dbg5       par_dsf:         %f\n",store->par_dsf);
-		fprintf(stderr,"dbg5       par_dsh:         %c%c\n",
-			store->par_dsh[0],store->par_dsh[1]);
-		fprintf(stderr,"dbg5       par_aps:         %d\n",store->par_aps);
-		fprintf(stderr,"dbg5       par_p1m:         %d\n",store->par_p1m);
-		fprintf(stderr,"dbg5       par_p1t:         %d\n",store->par_p1t);
-		fprintf(stderr,"dbg5       par_p1z:         %f\n",store->par_p1z);
-		fprintf(stderr,"dbg5       par_p1x:         %f\n",store->par_p1x);
-		fprintf(stderr,"dbg5       par_p1y:         %f\n",store->par_p1y);
-		fprintf(stderr,"dbg5       par_p1d:         %f\n",store->par_p1d);
-		fprintf(stderr,"dbg5       par_p1g:         %s\n",store->par_p1g);
-		fprintf(stderr,"dbg5       par_p2m:         %d\n",store->par_p2m);
-		fprintf(stderr,"dbg5       par_p2t:         %d\n",store->par_p2t);
-		fprintf(stderr,"dbg5       par_p2z:         %f\n",store->par_p2z);
-		fprintf(stderr,"dbg5       par_p2x:         %f\n",store->par_p2x);
-		fprintf(stderr,"dbg5       par_p2y:         %f\n",store->par_p2y);
-		fprintf(stderr,"dbg5       par_p2d:         %f\n",store->par_p2d);
-		fprintf(stderr,"dbg5       par_p2g:         %s\n",store->par_p2g);
-		fprintf(stderr,"dbg5       par_p3m:         %d\n",store->par_p3m);
-		fprintf(stderr,"dbg5       par_p3t:         %d\n",store->par_p3t);
-		fprintf(stderr,"dbg5       par_p3z:         %f\n",store->par_p3z);
-		fprintf(stderr,"dbg5       par_p3x:         %f\n",store->par_p3x);
-		fprintf(stderr,"dbg5       par_p3y:         %f\n",store->par_p3y);
-		fprintf(stderr,"dbg5       par_p3d:         %f\n",store->par_p3d);
-		fprintf(stderr,"dbg5       par_p3g:         %s\n",store->par_p3g);
-		fprintf(stderr,"dbg5       par_msz:         %f\n",store->par_msz);
-		fprintf(stderr,"dbg5       par_msx:         %f\n",store->par_msx);
-		fprintf(stderr,"dbg5       par_msy:         %f\n",store->par_msy);
-		fprintf(stderr,"dbg5       par_mrp:         %c%c\n",
-			store->par_mrp[0],store->par_mrp[1]);
-		fprintf(stderr,"dbg5       par_msd:         %f\n",store->par_msd);
-		fprintf(stderr,"dbg5       par_msr:         %f\n",store->par_msr);
-		fprintf(stderr,"dbg5       par_msp:         %f\n",store->par_msp);
-		fprintf(stderr,"dbg5       par_msg:         %f\n",store->par_msg);
-		fprintf(stderr,"dbg5       par_gcg:         %f\n",store->par_gcg);
-		fprintf(stderr,"dbg5       par_cpr:         %s\n",store->par_cpr);
-		fprintf(stderr,"dbg5       par_rop:         %s\n",store->par_rop);
-		fprintf(stderr,"dbg5       par_sid:         %s\n",store->par_sid);
-		fprintf(stderr,"dbg5       par_pll:         %s\n",store->par_pll);
-		fprintf(stderr,"dbg5       par_com:         %s\n",store->par_com);
-		}
-
-	/* zero checksum */
-	checksum = 0;
-
-	/* if data type not set - use start */
-	if (store->type == EM2_NONE)
-	    store->type = EM2_START;
-
-	/* if sonar not set use EM300 */
-	if (store->sonar == 0)
-	    store->sonar = MBSYS_SIMRAD2_EM300;
-
-	/* set up start of output buffer - we handle this
-	   record differently because of the ascii data */
-	memset(line, 0, MBSYS_SIMRAD2_BUFFER_SIZE);
-
-	/* put binary header data into buffer */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_short(swap, (short) store->type, (void *) &line[4]);
-		mb_put_binary_short(swap, (unsigned short) store->sonar, (void *) &line[6]);
-		mb_put_binary_int(swap, (int) store->par_date, (void *) &line[8]);
-		mb_put_binary_int(swap, (int) store->par_msec, (void *) &line[12]);
-		mb_put_binary_short(swap, (unsigned short) store->par_line_num, (void *) &line[16]);
-		mb_put_binary_short(swap, (unsigned short) store->par_serial_1, (void *) &line[18]);
-		mb_put_binary_short(swap, (unsigned short) store->par_serial_2, (void *) &line[20]);
-		}
-
-	/* construct ASCII parameter buffer */
-	buff = &line[22];
-	sprintf(&buff[0], "WLZ=%.2f,", store->par_wlz);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "SMH=%d,", store->par_smh);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "S1Z=%.2f,", store->par_s1z);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "S1X=%.2f,", store->par_s1x);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "S1Y=%.2f,", store->par_s1y);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "S1H=%.2f,", store->par_s1h);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "S1R=%.2f,", store->par_s1r);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "S1P=%.2f,", store->par_s1p);
-	buff_len = strlen(buff);
-	if (store->par_s1n > 0)
-	    {
-	    sprintf(&buff[buff_len], "S1N=%d,", store->par_s1n);
-	    buff_len = strlen(buff);
-	    }
-	sprintf(&buff[buff_len], "S2Z=%.2f,", store->par_s2z);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "S2X=%.2f,", store->par_s2x);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "S2Y=%.2f,", store->par_s2y);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "S2H=%.2f,", store->par_s2h);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "S2R=%.2f,", store->par_s2r);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "S2P=%.2f,", store->par_s2p);
-	buff_len = strlen(buff);
-	if (store->par_s2n > 0)
-	    {
-	    sprintf(&buff[buff_len], "S2N=%d,", store->par_s2n);
-	    buff_len = strlen(buff);
-	    }
-	if (store->par_go1 != 0.0)
-	    {
-	    sprintf(&buff[buff_len], "GO1=%.2f,", store->par_go1);
-	    buff_len = strlen(buff);
-	    }
-	if (store->par_go2 != 0.0)
-	    {
-	    sprintf(&buff[buff_len], "GO2=%.2f,", store->par_go2);
-	    buff_len = strlen(buff);
-	    }
-	sprintf(&buff[buff_len], "TSV=%s,", store->par_tsv);
-	buff_len = strlen(buff);
-	if (strlen(store->par_rsv) > 0)
-	    {
-	    sprintf(&buff[buff_len], "RSV=%s,", store->par_rsv);
-	    buff_len = strlen(buff);
-	    }
-	sprintf(&buff[buff_len], "BSV=%s,", store->par_bsv);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "PSV=%s,", store->par_tsv);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "OSV=%s,", store->par_osv);
-	buff_len = strlen(buff);
-	if (store->par_dsd != 0.0)
-	    {
-	    sprintf(&buff[buff_len], "DSD=%.1f,", store->par_dsd);
-	    buff_len = strlen(buff);
-	    }
-	else
-	    {
-	    sprintf(&buff[buff_len], "DSD=,");
-	    buff_len = strlen(buff);
-	    }
-	sprintf(&buff[buff_len], "DSO=%.6f,", store->par_dso);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "DSF=%.6f,", store->par_dsf);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "DSH=%c%c,",
-		store->par_dsh[0], store->par_dsh[1]);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "APS=%d,",store->par_aps);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "P1M=%d,",store->par_p1m);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "P1T=%d,",store->par_p1t);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "P1Z=%.2f,", store->par_p1z);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "P1X=%.2f,", store->par_p1x);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "P1Y=%.2f,", store->par_p1y);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "P1D=%.1f,", store->par_p1d);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "P1G=%s,", store->par_p1g);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "P2M=%d,",store->par_p2m);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "P2T=%d,",store->par_p2t);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "P2Z=%.2f,", store->par_p2z);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "P2X=%.2f,", store->par_p2x);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "P2Y=%.2f,", store->par_p2y);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "P2D=%.1f,", store->par_p2d);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "P2G=%s,", store->par_p2g);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "P3M=%d,",store->par_p3m);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "P3T=%d,",store->par_p3t);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "P3Z=%.2f,", store->par_p3z);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "P3X=%.2f,", store->par_p3x);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "P3Y=%.2f,", store->par_p3y);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "P3D=%.1f,", store->par_p3d);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "P3G=%s,", store->par_p3g);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "MSZ=%.2f,", store->par_msz);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "MSX=%.2f,", store->par_msx);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "MSY=%.2f,", store->par_msy);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "MRP=%c%c,",
-		store->par_mrp[0], store->par_mrp[1]);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "MSD=%.2f,", store->par_msd);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "MSR=%.2f,", store->par_msr);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "MSP=%.2f,", store->par_msp);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "MSG=%.2f,", store->par_msg);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "GCG=%.2f,", store->par_gcg);
-	buff_len = strlen(buff);
-	if (strlen(store->par_cpr) > 0)
-	    {
-	    sprintf(&buff[buff_len], "CPR=%s,", store->par_cpr);
-	    buff_len = strlen(buff);
-	    }
-	if (strlen(store->par_rop) > 0)
-	    {
-	    sprintf(&buff[buff_len], "ROP=%s,", store->par_rop);
-	    buff_len = strlen(buff);
-	    }
-	if (strlen(store->par_sid) > 0)
-	    {
-	    sprintf(&buff[buff_len], "SID=%s,", store->par_sid);
-	    buff_len = strlen(buff);
-	    }
-	if (strlen(store->par_pll) > 0)
-	    {
-	    sprintf(&buff[buff_len], "PLL=%s,", store->par_pll);
-	    buff_len = strlen(buff);
-	    }
-	if (strlen(store->par_com) > 0)
-	    {
-	    /* replace commas (,) with caret (^) values to circumvent
-	       the format's inability to store commas in comments */
-	    while ((comma_ptr = strchr(store->par_com, ',')) != NULL)
-		{
-		comma_ptr[0] = '^';
-		}
-	    sprintf(&buff[buff_len], "COM=%s,", store->par_com);
-	    buff_len = strlen(buff);
-	    }
-	buff[buff_len] = ',';
-	buff_len++;
-	if (buff_len % 2 == 0)
-	    buff_len++;
-
-	/* put end of record in buffer */
-	line[buff_len + 22] = EM2_END;
-
-	/* get size of record */
-	write_size = 25 + buff_len;
-	mb_put_binary_int(swap, (int) (write_size - 4), (void *) &line[0]);
-
-	/* compute checksum */
-	uchar_ptr = (mb_u_char *) line;
-	for (j=5;j<write_size-3;j++)
-	    checksum += uchar_ptr[j];
-
-	/* set checksum */
-	mb_put_binary_short(swap, (unsigned short) checksum, (void *) &line[buff_len + 23]);
-
-	/* finally write out the data */
-	write_len = fwrite(&line,1,write_size,mbfp);
-	if (write_len != write_size)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	else
-		status = MB_SUCCESS;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em300raw_wr_run_parameter(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store, int *error)
-{
-	char	*function_name = "mbr_em300raw_wr_run_parameter";
-	int	status = MB_SUCCESS;
-	char	line[EM2_RUN_PARAMETER_SIZE];
-	short	label;
-	int	write_len;
-	int	write_size;
-	unsigned short checksum;
-	mb_u_char   *uchar_ptr;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       run_date:        %d\n",store->run_date);
-		fprintf(stderr,"dbg5       run_msec:        %d\n",store->run_msec);
-		fprintf(stderr,"dbg5       run_ping_count:  %d\n",store->run_ping_count);
-		fprintf(stderr,"dbg5       run_serial:      %d\n",store->run_serial);
-		fprintf(stderr,"dbg5       run_status:      %d\n",store->run_status);
-		fprintf(stderr,"dbg5       run_mode:        %d\n",store->run_mode);
-		fprintf(stderr,"dbg5       run_filter_id:   %d\n",store->run_filter_id);
-		fprintf(stderr,"dbg5       run_min_depth:   %d\n",store->run_min_depth);
-		fprintf(stderr,"dbg5       run_max_depth:   %d\n",store->run_max_depth);
-		fprintf(stderr,"dbg5       run_absorption:  %d\n",store->run_absorption);
-		fprintf(stderr,"dbg5       run_tran_pulse:  %d\n",store->run_tran_pulse);
-		fprintf(stderr,"dbg5       run_tran_beam:   %d\n",store->run_tran_beam);
-		fprintf(stderr,"dbg5       run_tran_pow:    %d\n",store->run_tran_pow);
-		fprintf(stderr,"dbg5       run_rec_beam:    %d\n",store->run_rec_beam);
-		fprintf(stderr,"dbg5       run_rec_band:    %d\n",store->run_rec_band);
-		fprintf(stderr,"dbg5       run_rec_gain:    %d\n",store->run_rec_gain);
-		fprintf(stderr,"dbg5       run_tvg_cross:   %d\n",store->run_tvg_cross);
-		fprintf(stderr,"dbg5       run_ssv_source:  %d\n",store->run_ssv_source);
-		fprintf(stderr,"dbg5       run_max_swath:   %d\n",store->run_max_swath);
-		fprintf(stderr,"dbg5       run_beam_space:  %d\n",store->run_beam_space);
-		fprintf(stderr,"dbg5       run_swath_angle: %d\n",store->run_swath_angle);
-		fprintf(stderr,"dbg5       run_stab_mode:   %d\n",store->run_stab_mode);
-		for (i=0;i<6;i++)
-			fprintf(stderr,"dbg5       run_spare[%d]:    %d\n",i,store->run_spare[i]);
-		}
-
-	/* zero checksum */
-	checksum = 0;
-
-	/* write the record size */
-	mb_put_binary_int(swap, (int) (EM2_RUN_PARAMETER_SIZE), (void *) &write_size);
-	write_len = fwrite(&write_size,1,4,mbfp);
-	if (write_len != 4)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	else
-		status = MB_SUCCESS;
-
-	/* write the record label */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_short(swap, (short) (EM2_RUN_PARAMETER), (void *) &label);
-		write_len = fwrite(&label,1,2,mbfp);
-		if (write_len != 2)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_WRITE_FAIL;
-			}
-		else
-			status = MB_SUCCESS;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[1];
-		}
-
-	/* write the sonar id */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_short(swap, (short) (store->sonar), (void *) &label);
-		write_len = fwrite(&label,1,2,mbfp);
-		if (write_len != 2)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_WRITE_FAIL;
-			}
-		else
-			status = MB_SUCCESS;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[0];
-		checksum += uchar_ptr[1];
-		}
-
-	/* construct binary data */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_int(swap, (int) store->run_date, (void *) &line[0]);
-		mb_put_binary_int(swap, (int) store->run_msec, (void *) &line[4]);
-		mb_put_binary_short(swap, (unsigned short) store->run_ping_count, (void *) &line[8]);
-		mb_put_binary_short(swap, (unsigned short) store->run_serial, (void *) &line[10]);
-		mb_put_binary_int(swap, (int) store->run_status, (void *) &line[12]);
-		line[16] = store->run_mode;
-		line[17] = store->run_filter_id;
-		mb_put_binary_short(swap, (unsigned short) store->run_min_depth, (void *) &line[18]);
-		mb_put_binary_short(swap, (unsigned short) store->run_max_depth, (void *) &line[20]);
-		mb_put_binary_short(swap, (unsigned short) store->run_absorption, (void *) &line[22]);
-		mb_put_binary_short(swap, (unsigned short) store->run_tran_pulse, (void *) &line[24]);
-		mb_put_binary_short(swap, (unsigned short) store->run_tran_beam, (void *) &line[26]);
-		line[28] = store->run_tran_pow;
-		line[29] = store->run_rec_beam;
-		line[30] = store->run_rec_band;
-		line[31] = store->run_rec_gain;
-		line[32] = store->run_tvg_cross;
-		line[33] = store->run_ssv_source;
-		mb_put_binary_short(swap, (unsigned short) store->run_max_swath, (void *) &line[34]);
-		line[36] = store->run_beam_space;
-		line[37] = store->run_swath_angle;
-		line[38] = store->run_stab_mode;
-		for (i=0;i<6;i++)
-		    line[39+i] = store->run_spare[i];
-		line[EM2_RUN_PARAMETER_SIZE-7] = 0x03;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM2_RUN_PARAMETER_SIZE-7;j++)
-		    checksum += uchar_ptr[j];
-
-		/* set checksum */
-		mb_put_binary_short(swap, (unsigned short) checksum, (void *) &line[EM2_RUN_PARAMETER_SIZE-6]);
-
-		/* write out data */
-		write_len = fwrite(line,1,EM2_RUN_PARAMETER_SIZE-4,mbfp);
-		if (write_len != EM2_RUN_PARAMETER_SIZE-4)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em300raw_wr_clock(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store, int *error)
-{
-	char	*function_name = "mbr_em300raw_wr_clock";
-	int	status = MB_SUCCESS;
-	char	line[EM2_CLOCK_SIZE];
-	short	label;
-	int	write_len;
-	int	write_size;
-	unsigned short checksum;
-	mb_u_char   *uchar_ptr;
-	int	j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       clk_date:        %d\n",store->clk_date);
-		fprintf(stderr,"dbg5       clk_msec:        %d\n",store->clk_msec);
-		fprintf(stderr,"dbg5       clk_count:       %d\n",store->clk_count);
-		fprintf(stderr,"dbg5       clk_serial:      %d\n",store->clk_serial);
-		fprintf(stderr,"dbg5       clk_origin_date: %d\n",store->clk_origin_date);
-		fprintf(stderr,"dbg5       clk_origin_msec: %d\n",store->clk_origin_msec);
-		fprintf(stderr,"dbg5       clk_1_pps_use:   %d\n",store->clk_1_pps_use);
-		}
-
-	/* zero checksum */
-	checksum = 0;
-
-	/* write the record size */
-	mb_put_binary_int(swap, (int) (EM2_CLOCK_SIZE), (void *) &write_size);
-	write_len = fwrite(&write_size,1,4,mbfp);
-	if (write_len != 4)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	else
-		status = MB_SUCCESS;
-
-	/* write the record label */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_short(swap, (short) (EM2_CLOCK), (void *) &label);
-		write_len = fwrite(&label,1,2,mbfp);
-		if (write_len != 2)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_WRITE_FAIL;
-			}
-		else
-			status = MB_SUCCESS;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[1];
-		}
-
-	/* write the sonar id */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_short(swap, (short) (store->sonar), (void *) &label);
-		write_len = fwrite(&label,1,2,mbfp);
-		if (write_len != 2)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_WRITE_FAIL;
-			}
-		else
-			status = MB_SUCCESS;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[0];
-		checksum += uchar_ptr[1];
-		}
-
-	/* construct binary data */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_int(swap, (int) store->clk_date, (void *) &line[0]);
-		mb_put_binary_int(swap, (int) store->clk_msec, (void *) &line[4]);
-		mb_put_binary_short(swap, (unsigned short) store->clk_count, (void *) &line[8]);
-		mb_put_binary_short(swap, (unsigned short) store->clk_serial, (void *) &line[10]);
-		mb_put_binary_int(swap, (int) store->clk_origin_date, (void *) &line[12]);
-		mb_put_binary_int(swap, (int) store->clk_origin_msec, (void *) &line[16]);
-		line[20] = store->clk_1_pps_use;
-		line[EM2_CLOCK_SIZE-7] = 0x03;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM2_CLOCK_SIZE-7;j++)
-		    checksum += uchar_ptr[j];
-
-		/* set checksum */
-		mb_put_binary_short(swap, (unsigned short) checksum, (void *) &line[EM2_CLOCK_SIZE-6]);
-
-		/* write out data */
-		write_len = fwrite(line,1,EM2_CLOCK_SIZE-4,mbfp);
-		if (write_len != EM2_CLOCK_SIZE-4)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em300raw_wr_tide(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store, int *error)
-{
-	char	*function_name = "mbr_em300raw_wr_tide";
-	int	status = MB_SUCCESS;
-	char	line[EM2_TIDE_SIZE];
-	short	label;
-	int	write_len;
-	int	write_size;
-	unsigned short checksum;
-	mb_u_char   *uchar_ptr;
-	int	j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       tid_date:        %d\n",store->tid_date);
-		fprintf(stderr,"dbg5       tid_msec:        %d\n",store->tid_msec);
-		fprintf(stderr,"dbg5       tid_count:       %d\n",store->tid_count);
-		fprintf(stderr,"dbg5       tid_serial:      %d\n",store->tid_serial);
-		fprintf(stderr,"dbg5       tid_origin_date: %d\n",store->tid_origin_date);
-		fprintf(stderr,"dbg5       tid_origin_msec: %d\n",store->tid_origin_msec);
-		fprintf(stderr,"dbg5       tid_tide:        %d\n",store->tid_tide);
-		}
-
-	/* zero checksum */
-	checksum = 0;
-
-	/* write the record size */
-	mb_put_binary_int(swap, (int) (EM2_TIDE_SIZE), (void *) &write_size);
-	write_len = fwrite(&write_size,1,4,mbfp);
-	if (write_len != 4)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	else
-		status = MB_SUCCESS;
-
-	/* write the record label */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_short(swap, (short) (EM2_TIDE), (void *) &label);
-		write_len = fwrite(&label,1,2,mbfp);
-		if (write_len != 2)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_WRITE_FAIL;
-			}
-		else
-			status = MB_SUCCESS;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[1];
-		}
-
-	/* write the sonar id */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_short(swap, (short) (store->sonar), (void *) &label);
-		write_len = fwrite(&label,1,2,mbfp);
-		if (write_len != 2)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_WRITE_FAIL;
-			}
-		else
-			status = MB_SUCCESS;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[0];
-		checksum += uchar_ptr[1];
-		}
-
-	/* construct binary data */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_int(swap, (int) store->tid_date, (void *) &line[0]);
-		mb_put_binary_int(swap, (int) store->tid_msec, (void *) &line[4]);
-		mb_put_binary_short(swap, (unsigned short) store->tid_count, (void *) &line[8]);
-		mb_put_binary_short(swap, (unsigned short) store->tid_serial, (void *) &line[10]);
-		mb_put_binary_int(swap, (int) store->tid_origin_date, (void *) &line[12]);
-		mb_put_binary_int(swap, (int) store->tid_origin_msec, (void *) &line[16]);
-		mb_put_binary_short(swap, (short) store->tid_tide, (void *) &line[20]);
-		line[EM2_TIDE_SIZE-8] = '\0';
-		line[EM2_TIDE_SIZE-7] = 0x03;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM2_TIDE_SIZE-7;j++)
-		    checksum += uchar_ptr[j];
-
-		/* set checksum */
-		mb_put_binary_short(swap, (unsigned short) checksum, (void *) &line[EM2_TIDE_SIZE-6]);
-
-		/* write out data */
-		write_len = fwrite(line,1,EM2_TIDE_SIZE-4,mbfp);
-		if (write_len != EM2_TIDE_SIZE-4)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em300raw_wr_height(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store, int *error)
-{
-	char	*function_name = "mbr_em300raw_wr_height";
-	int	status = MB_SUCCESS;
-	char	line[EM2_HEIGHT_SIZE];
-	short	label;
-	int	write_len;
-	int	write_size;
-	unsigned short checksum;
-	mb_u_char   *uchar_ptr;
-	int	j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       hgt_date:        %d\n",store->hgt_date);
-		fprintf(stderr,"dbg5       hgt_msec:        %d\n",store->hgt_msec);
-		fprintf(stderr,"dbg5       hgt_count:       %d\n",store->hgt_count);
-		fprintf(stderr,"dbg5       hgt_serial:      %d\n",store->hgt_serial);
-		fprintf(stderr,"dbg5       hgt_height:      %d\n",store->hgt_height);
-		fprintf(stderr,"dbg5       hgt_type:        %d\n",store->hgt_type);
-		}
-
-	/* zero checksum */
-	checksum = 0;
-
-	/* write the record size */
-	mb_put_binary_int(swap, (int) (EM2_HEIGHT_SIZE), (void *) &write_size);
-	write_len = fwrite(&write_size,1,4,mbfp);
-	if (write_len != 4)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	else
-		status = MB_SUCCESS;
-
-	/* write the record label */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_short(swap, (short) (EM2_HEIGHT), (void *) &label);
-		write_len = fwrite(&label,1,2,mbfp);
-		if (write_len != 2)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_WRITE_FAIL;
-			}
-		else
-			status = MB_SUCCESS;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[1];
-		}
-
-	/* write the sonar id */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_short(swap, (short) (store->sonar), (void *) &label);
-		write_len = fwrite(&label,1,2,mbfp);
-		if (write_len != 2)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_WRITE_FAIL;
-			}
-		else
-			status = MB_SUCCESS;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[0];
-		checksum += uchar_ptr[1];
-		}
-
-	/* construct binary data */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_int(swap, (int) store->hgt_date, (void *) &line[0]);
-		mb_put_binary_int(swap, (int) store->hgt_msec, (void *) &line[4]);
-		mb_put_binary_short(swap, (unsigned short) store->hgt_count, (void *) &line[8]);
-		mb_put_binary_short(swap, (unsigned short) store->hgt_serial, (void *) &line[10]);
-		mb_put_binary_int(swap, (int) store->hgt_height, (void *) &line[12]);
-		line[16] = (mb_u_char) store->hgt_type;
-		line[EM2_HEIGHT_SIZE-7] = 0x03;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM2_HEIGHT_SIZE-7;j++)
-		    checksum += uchar_ptr[j];
-
-		/* set checksum */
-		mb_put_binary_short(swap, (unsigned short) checksum, (void *) &line[EM2_HEIGHT_SIZE-6]);
-
-		/* write out data */
-		write_len = fwrite(line,1,EM2_HEIGHT_SIZE-4,mbfp);
-		if (write_len != EM2_HEIGHT_SIZE-4)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em300raw_wr_heading(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store, int *error)
-{
-	char	*function_name = "mbr_em300raw_wr_heading";
-	int	status = MB_SUCCESS;
-	struct mbsys_simrad2_heading_struct *heading;
-	char	line[EM2_HEADING_HEADER_SIZE];
-	short	label;
-	int	write_len;
-	int	write_size;
-	unsigned short checksum;
-	mb_u_char   *uchar_ptr;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		}
-
-	/* get storage structure */
-	heading = (struct mbsys_simrad2_heading_struct *) store->heading;
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       hed_date:        %d\n",heading->hed_date);
-		fprintf(stderr,"dbg5       hed_msec:        %d\n",heading->hed_msec);
-		fprintf(stderr,"dbg5       hed_count:       %d\n",heading->hed_count);
-		fprintf(stderr,"dbg5       hed_serial:      %d\n",heading->hed_serial);
-		fprintf(stderr,"dbg5       hed_ndata:       %d\n",heading->hed_ndata);
-		fprintf(stderr,"dbg5       count    time (msec)    heading (0.01 deg)\n");
-		fprintf(stderr,"dbg5       -----    -----------    ------------------\n");
-		for (i=0;i<heading->hed_ndata;i++)
-			fprintf(stderr,"dbg5        %4d      %7d          %7d\n",
-				i, heading->hed_time[i], heading->hed_heading[i]);
-		fprintf(stderr,"dbg5       hed_heading_status: %d\n",heading->hed_heading_status);
-		}
-
-	/* zero checksum */
-	checksum = 0;
-
-	/* write the record size */
-	mb_put_binary_int(swap, (int) (EM2_HEADING_HEADER_SIZE
-			+ EM2_HEADING_SLICE_SIZE * heading->hed_ndata + 8), (void *) &write_size);
-	write_len = fwrite(&write_size,1,4,mbfp);
-	if (write_len != 4)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	else
-		status = MB_SUCCESS;
-
-	/* write the record label */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_short(swap, (short) (EM2_HEADING), (void *) &label);
-		write_len = fwrite(&label,1,2,mbfp);
-		if (write_len != 2)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_WRITE_FAIL;
-			}
-		else
-			status = MB_SUCCESS;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[1];
-		}
-
-	/* write the sonar id */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_short(swap, (short) (store->sonar), (void *) &label);
-		write_len = fwrite(&label,1,2,mbfp);
-		if (write_len != 2)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_WRITE_FAIL;
-			}
-		else
-			status = MB_SUCCESS;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[0];
-		checksum += uchar_ptr[1];
-		}
-
-	/* output binary header data */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_int(swap, (int) heading->hed_date, (void *) &line[0]);
-		mb_put_binary_int(swap, (int) heading->hed_msec, (void *) &line[4]);
-		mb_put_binary_short(swap, (unsigned short) heading->hed_count, (void *) &line[8]);
-		mb_put_binary_short(swap, (unsigned short) heading->hed_serial, (void *) &line[10]);
-		mb_put_binary_short(swap, (unsigned short) heading->hed_ndata, (void *) &line[12]);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM2_HEADING_HEADER_SIZE;j++)
-		    checksum += uchar_ptr[j];
-
-		/* write out data */
-		write_len = fwrite(line,1,EM2_HEADING_HEADER_SIZE,mbfp);
-		if (write_len != EM2_HEADING_HEADER_SIZE)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* output binary heading data */
-	if (status == MB_SUCCESS)
-	    for (i=0;i<heading->hed_ndata;i++)
-		{
-		mb_put_binary_short(swap, (unsigned short) heading->hed_time[i], (void *) &line[0]);
-		mb_put_binary_short(swap, (unsigned short) heading->hed_heading[i], (void *) &line[2]);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM2_HEADING_SLICE_SIZE;j++)
-		    checksum += uchar_ptr[j];
-
-		/* write out data */
-		write_len = fwrite(line,1,EM2_HEADING_SLICE_SIZE,mbfp);
-		if (write_len != EM2_HEADING_SLICE_SIZE)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* output end of record */
-	if (status == MB_SUCCESS)
-		{
-		line[0] = (mb_u_char) heading->hed_heading_status;
-		line[1] = 0x03;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		checksum += uchar_ptr[0];
-
-		/* set checksum */
-		mb_put_binary_short(swap, (unsigned short) checksum, (void *) &line[2]);
-
-		/* write out data */
-		write_len = fwrite(line,1,4,mbfp);
-		if (write_len != 4)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em300raw_wr_ssv(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store, int *error)
-{
-	char	*function_name = "mbr_em300raw_wr_ssv";
-	int	status = MB_SUCCESS;
-	struct mbsys_simrad2_ssv_struct *ssv;
-	char	line[EM2_SSV_HEADER_SIZE];
-	short	label;
-	int	write_len;
-	int	write_size;
-	unsigned short checksum;
-	mb_u_char   *uchar_ptr;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		}
-
-	/* get storage structure */
-	ssv = (struct mbsys_simrad2_ssv_struct *) store->ssv;
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       ssv_date:        %d\n",ssv->ssv_date);
-		fprintf(stderr,"dbg5       ssv_msec:        %d\n",ssv->ssv_msec);
-		fprintf(stderr,"dbg5       ssv_count:       %d\n",ssv->ssv_count);
-		fprintf(stderr,"dbg5       ssv_serial:      %d\n",ssv->ssv_serial);
-		fprintf(stderr,"dbg5       ssv_ndata:       %d\n",ssv->ssv_ndata);
-		fprintf(stderr,"dbg5       count    time (msec)    ssv (0.1 m/s)\n");
-		fprintf(stderr,"dbg5       -----    -----------    ------------------\n");
-		for (i=0;i<ssv->ssv_ndata;i++)
-			fprintf(stderr,"dbg5        %4d      %7d          %7d\n",
-				i, ssv->ssv_time[i], ssv->ssv_ssv[i]);
-		}
-
-	/* zero checksum */
-	checksum = 0;
-
-	/* write the record size */
-	mb_put_binary_int(swap, (int) (EM2_SSV_HEADER_SIZE
-			+ EM2_SSV_SLICE_SIZE * ssv->ssv_ndata + 8), (void *) &write_size);
-	write_len = fwrite(&write_size,1,4,mbfp);
-	if (write_len != 4)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	else
-		status = MB_SUCCESS;
-
-	/* write the record label */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_short(swap, (short) (EM2_SSV), (void *) &label);
-		write_len = fwrite(&label,1,2,mbfp);
-		if (write_len != 2)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_WRITE_FAIL;
-			}
-		else
-			status = MB_SUCCESS;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[1];
-		}
-
-	/* write the sonar id */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_short(swap, (short) (store->sonar), (void *) &label);
-		write_len = fwrite(&label,1,2,mbfp);
-		if (write_len != 2)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_WRITE_FAIL;
-			}
-		else
-			status = MB_SUCCESS;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[0];
-		checksum += uchar_ptr[1];
-		}
-
-	/* output binary header data */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_int(swap, (int) ssv->ssv_date, (void *) &line[0]);
-		mb_put_binary_int(swap, (int) ssv->ssv_msec, (void *) &line[4]);
-		mb_put_binary_short(swap, (unsigned short) ssv->ssv_count, (void *) &line[8]);
-		mb_put_binary_short(swap, (unsigned short) ssv->ssv_serial, (void *) &line[10]);
-		mb_put_binary_short(swap, (unsigned short) ssv->ssv_ndata, (void *) &line[12]);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM2_SSV_HEADER_SIZE;j++)
-		    checksum += uchar_ptr[j];
-
-		/* write out data */
-		write_len = fwrite(line,1,EM2_SSV_HEADER_SIZE,mbfp);
-		if (write_len != EM2_SSV_HEADER_SIZE)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* output binary ssv data */
-	if (status == MB_SUCCESS)
-	    for (i=0;i<ssv->ssv_ndata;i++)
-		{
-		mb_put_binary_short(swap, (unsigned short) ssv->ssv_time[i], (void *) &line[0]);
-		mb_put_binary_short(swap, (unsigned short) ssv->ssv_ssv[i], (void *) &line[2]);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM2_SSV_SLICE_SIZE;j++)
-		    checksum += uchar_ptr[j];
-
-		/* write out data */
-		write_len = fwrite(line,1,EM2_SSV_SLICE_SIZE,mbfp);
-		if (write_len != EM2_SSV_SLICE_SIZE)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* output end of record */
-	if (status == MB_SUCCESS)
-		{
-		line[0] = 0;
-		line[1] = 0x03;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		checksum += uchar_ptr[0];
-
-		/* set checksum */
-		mb_put_binary_short(swap, (unsigned short) checksum, (void *) &line[2]);
-
-		/* write out data */
-		write_len = fwrite(line,1,4,mbfp);
-		if (write_len != 4)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em300raw_wr_tilt(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store, int *error)
-{
-	char	*function_name = "mbr_em300raw_wr_tilt";
-	int	status = MB_SUCCESS;
-	struct mbsys_simrad2_tilt_struct *tilt;
-	char	line[EM2_TILT_HEADER_SIZE];
-	short	label;
-	int	write_len;
-	int	write_size;
-	unsigned short checksum;
-	mb_u_char   *uchar_ptr;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		}
-
-	/* get storage structure */
-	tilt = (struct mbsys_simrad2_tilt_struct *) store->tilt;
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       tlt_date:        %d\n",tilt->tlt_date);
-		fprintf(stderr,"dbg5       tlt_msec:        %d\n",tilt->tlt_msec);
-		fprintf(stderr,"dbg5       tlt_count:       %d\n",tilt->tlt_count);
-		fprintf(stderr,"dbg5       tlt_serial:      %d\n",tilt->tlt_serial);
-		fprintf(stderr,"dbg5       tlt_ndata:       %d\n",tilt->tlt_ndata);
-		fprintf(stderr,"dbg5       count    time (msec)    tilt (0.01 deg)\n");
-		fprintf(stderr,"dbg5       -----    -----------    ------------------\n");
-		for (i=0;i<tilt->tlt_ndata;i++)
-			fprintf(stderr,"dbg5        %4d      %7d          %7d\n",
-				i, tilt->tlt_time[i], tilt->tlt_tilt[i]);
-		}
-
-	/* zero checksum */
-	checksum = 0;
-
-	/* write the record size */
-	mb_put_binary_int(swap, (int) (EM2_TILT_HEADER_SIZE
-			+ EM2_TILT_SLICE_SIZE * tilt->tlt_ndata + 8), (void *) &write_size);
-	write_len = fwrite(&write_size,1,4,mbfp);
-	if (write_len != 4)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	else
-		status = MB_SUCCESS;
-
-	/* write the record label */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_short(swap, (short) (EM2_TILT), (void *) &label);
-		write_len = fwrite(&label,1,2,mbfp);
-		if (write_len != 2)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_WRITE_FAIL;
-			}
-		else
-			status = MB_SUCCESS;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[1];
-		}
-
-	/* write the sonar id */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_short(swap, (short) (store->sonar), (void *) &label);
-		write_len = fwrite(&label,1,2,mbfp);
-		if (write_len != 2)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_WRITE_FAIL;
-			}
-		else
-			status = MB_SUCCESS;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[0];
-		checksum += uchar_ptr[1];
-		}
-
-	/* output binary header data */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_int(swap, (int) tilt->tlt_date, (void *) &line[0]);
-		mb_put_binary_int(swap, (int) tilt->tlt_msec, (void *) &line[4]);
-		mb_put_binary_short(swap, (unsigned short) tilt->tlt_count, (void *) &line[8]);
-		mb_put_binary_short(swap, (unsigned short) tilt->tlt_serial, (void *) &line[10]);
-		mb_put_binary_short(swap, (unsigned short) tilt->tlt_ndata, (void *) &line[12]);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM2_TILT_HEADER_SIZE;j++)
-		    checksum += uchar_ptr[j];
-
-		/* write out data */
-		write_len = fwrite(line,1,EM2_TILT_HEADER_SIZE,mbfp);
-		if (write_len != EM2_TILT_HEADER_SIZE)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* output binary tilt data */
-	if (status == MB_SUCCESS)
-	    for (i=0;i<tilt->tlt_ndata;i++)
-		{
-		mb_put_binary_short(swap, (unsigned short) tilt->tlt_time[i], (void *) &line[0]);
-		mb_put_binary_short(swap, (unsigned short) tilt->tlt_tilt[i], (void *) &line[2]);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM2_TILT_SLICE_SIZE;j++)
-		    checksum += uchar_ptr[j];
-
-		/* write out data */
-		write_len = fwrite(line,1,EM2_TILT_SLICE_SIZE,mbfp);
-		if (write_len != EM2_TILT_SLICE_SIZE)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* output end of record */
-	if (status == MB_SUCCESS)
-		{
-		line[0] = 0;
-		line[1] = 0x03;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		checksum += uchar_ptr[0];
-
-		/* set checksum */
-		mb_put_binary_short(swap, (unsigned short) checksum, (void *) &line[2]);
-
-		/* write out data */
-		write_len = fwrite(line,1,4,mbfp);
-		if (write_len != 4)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em300raw_wr_attitude(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store, int *error)
-{
-	char	*function_name = "mbr_em300raw_wr_attitude";
-	int	status = MB_SUCCESS;
-	struct mbsys_simrad2_attitude_struct *attitude;
-	char	line[EM2_ATTITUDE_HEADER_SIZE];
-	short	label;
-	int	write_len;
-	int	write_size;
-	unsigned short checksum;
-	mb_u_char   *uchar_ptr;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		}
-
-	/* get storage structure */
-	attitude = (struct mbsys_simrad2_attitude_struct *) store->attitude;
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       att_date:        %d\n",attitude->att_date);
-		fprintf(stderr,"dbg5       att_msec:        %d\n",attitude->att_msec);
-		fprintf(stderr,"dbg5       att_count:       %d\n",attitude->att_count);
-		fprintf(stderr,"dbg5       att_serial:      %d\n",attitude->att_serial);
-		fprintf(stderr,"dbg5       att_ndata:       %d\n",attitude->att_ndata);
-		fprintf(stderr,"dbg5       cnt   time   roll pitch heave heading\n");
-		fprintf(stderr,"dbg5       -------------------------------------\n");
-		for (i=0;i<attitude->att_ndata;i++)
-			fprintf(stderr,"dbg5        %3d  %d  %d %d %d %d\n",
-				i, attitude->att_time[i], attitude->att_roll[i],
-				attitude->att_pitch[i], attitude->att_heave[i],
-				attitude->att_heading[i]);
-		fprintf(stderr,"dbg5       att_heading_status: %d\n",attitude->att_heading_status);
-		}
-
-	/* zero checksum */
-	checksum = 0;
-
-	/* write the record size */
-	mb_put_binary_int(swap, (int) (EM2_ATTITUDE_HEADER_SIZE
-			+ EM2_ATTITUDE_SLICE_SIZE * attitude->att_ndata + 8), (void *) &write_size);
-	write_len = fwrite(&write_size,1,4,mbfp);
-	if (write_len != 4)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	else
-		status = MB_SUCCESS;
-
-	/* write the record label */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_short(swap, (short) (EM2_ATTITUDE), (void *) &label);
-		write_len = fwrite(&label,1,2,mbfp);
-		if (write_len != 2)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_WRITE_FAIL;
-			}
-		else
-			status = MB_SUCCESS;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[1];
-		}
-
-	/* write the sonar id */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_short(swap, (short) (store->sonar), (void *) &label);
-		write_len = fwrite(&label,1,2,mbfp);
-		if (write_len != 2)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_WRITE_FAIL;
-			}
-		else
-			status = MB_SUCCESS;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[0];
-		checksum += uchar_ptr[1];
-		}
-
-	/* output binary header data */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_int(swap, (int) attitude->att_date, (void *) &line[0]);
-		mb_put_binary_int(swap, (int) attitude->att_msec, (void *) &line[4]);
-		mb_put_binary_short(swap, (unsigned short) attitude->att_count, (void *) &line[8]);
-		mb_put_binary_short(swap, (unsigned short) attitude->att_serial, (void *) &line[10]);
-		mb_put_binary_short(swap, (unsigned short) attitude->att_ndata, (void *) &line[12]);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM2_ATTITUDE_HEADER_SIZE;j++)
-		    checksum += uchar_ptr[j];
-
-		/* write out data */
-		write_len = fwrite(line,1,EM2_ATTITUDE_HEADER_SIZE,mbfp);
-		if (write_len != EM2_ATTITUDE_HEADER_SIZE)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* output binary heading data */
-	if (status == MB_SUCCESS)
-	    for (i=0;i<attitude->att_ndata;i++)
-		{
-		mb_put_binary_short(swap, (unsigned short) attitude->att_time[i], (void *) &line[0]);
-		mb_put_binary_short(swap, (unsigned short) attitude->att_sensor_status[i], (void *) &line[2]);
-		mb_put_binary_short(swap, (short) attitude->att_roll[i], (void *) &line[4]);
-		mb_put_binary_short(swap, (short) attitude->att_pitch[i], (void *) &line[6]);
-		mb_put_binary_short(swap, (short) attitude->att_heave[i], (void *) &line[8]);
-		mb_put_binary_short(swap, (unsigned short) attitude->att_heading[i], (void *) &line[10]);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM2_ATTITUDE_SLICE_SIZE;j++)
-		    checksum += uchar_ptr[j];
-
-		/* write out data */
-		write_len = fwrite(line,1,EM2_ATTITUDE_SLICE_SIZE,mbfp);
-		if (write_len != EM2_ATTITUDE_SLICE_SIZE)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* output end of record */
-	if (status == MB_SUCCESS)
-		{
-		line[0] = (mb_u_char) attitude->att_heading_status;
-		line[1] = 0x03;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		checksum += uchar_ptr[0];
-
-		/* set checksum */
-		mb_put_binary_short(swap, (unsigned short) checksum, (void *) &line[2]);
-
-		/* write out data */
-		write_len = fwrite(line,1,4,mbfp);
-		if (write_len != 4)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em300raw_wr_pos(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store, int *error)
-{
-	char	*function_name = "mbr_em300raw_wr_pos";
-	int	status = MB_SUCCESS;
-	char	line[EM2_POS_HEADER_SIZE];
-	short	label;
-	int	write_len;
-	int	write_size;
-	unsigned short checksum;
-	mb_u_char   *uchar_ptr;
-	int	j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       pos_date:        %d\n",store->pos_date);
-		fprintf(stderr,"dbg5       pos_msec:        %d\n",store->pos_msec);
-		fprintf(stderr,"dbg5       pos_count:       %d\n",store->pos_count);
-		fprintf(stderr,"dbg5       pos_serial:      %d\n",store->pos_serial);
-		fprintf(stderr,"dbg5       pos_latitude:    %d\n",store->pos_latitude);
-		fprintf(stderr,"dbg5       pos_longitude:   %d\n",store->pos_longitude);
-		fprintf(stderr,"dbg5       pos_quality:     %d\n",store->pos_quality);
-		fprintf(stderr,"dbg5       pos_speed:       %d\n",store->pos_speed);
-		fprintf(stderr,"dbg5       pos_course:      %d\n",store->pos_course);
-		fprintf(stderr,"dbg5       pos_heading:     %d\n",store->pos_heading);
-		fprintf(stderr,"dbg5       pos_system:      %d\n",store->pos_system);
-		fprintf(stderr,"dbg5       pos_input_size:  %d\n",store->pos_input_size);
-		fprintf(stderr,"dbg5       pos_input:\ndbg5            %s\n",store->pos_input);
-		}
-
-	/* zero checksum */
-	checksum = 0;
-
-	/* write the record size */
-	mb_put_binary_int(swap, (int) (EM2_POS_HEADER_SIZE
-			+ store->pos_input_size
-			- (store->pos_input_size % 2) + 8), (void *) &write_size);
-	write_len = fwrite(&write_size,1,4,mbfp);
-	if (write_len != 4)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	else
-		status = MB_SUCCESS;
-
-	/* write the record label */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_short(swap, (short) (EM2_POS), (void *) &label);
-		write_len = fwrite(&label,1,2,mbfp);
-		if (write_len != 2)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_WRITE_FAIL;
-			}
-		else
-			status = MB_SUCCESS;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[1];
-		}
-
-	/* write the sonar id */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_short(swap, (short) (store->sonar), (void *) &label);
-		write_len = fwrite(&label,1,2,mbfp);
-		if (write_len != 2)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_WRITE_FAIL;
-			}
-		else
-			status = MB_SUCCESS;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[0];
-		checksum += uchar_ptr[1];
-		}
-
-	/* output binary header data */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_int(swap, (int) store->pos_date, (void *) &line[0]);
-		mb_put_binary_int(swap, (int) store->pos_msec, (void *) &line[4]);
-		mb_put_binary_short(swap, (unsigned short) store->pos_count, (void *) &line[8]);
-		mb_put_binary_short(swap, (unsigned short) store->pos_serial, (void *) &line[10]);
-		mb_put_binary_int(swap, (int) store->pos_latitude, (void *) &line[12]);
-		mb_put_binary_int(swap, (int) store->pos_longitude, (void *) &line[16]);
-		mb_put_binary_short(swap, (unsigned short) store->pos_quality, (void *) &line[20]);
-		mb_put_binary_short(swap, (unsigned short) store->pos_speed, (void *) &line[22]);
-		mb_put_binary_short(swap, (unsigned short) store->pos_course, (void *) &line[24]);
-		mb_put_binary_short(swap, (unsigned short) store->pos_heading, (void *) &line[26]);
-		line[28] = (mb_u_char) store->pos_system;
-		line[29] = (mb_u_char) store->pos_input_size;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM2_POS_HEADER_SIZE;j++)
-		    checksum += uchar_ptr[j];
-
-		/* write out data */
-		write_len = fwrite(line,1,EM2_POS_HEADER_SIZE,mbfp);
-		if (write_len != EM2_POS_HEADER_SIZE)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* output original ascii nav data */
-	if (status == MB_SUCCESS)
-		{
-		write_size = store->pos_input_size
-				- (store->pos_input_size % 2) + 1;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) store->pos_input;
-		for (j=0;j<write_size;j++)
-		    checksum += uchar_ptr[j];
-
-		/* write out data */
-		write_len = fwrite(store->pos_input,1,write_size,mbfp);
-		if (write_len != write_size)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* output end of record */
-	if (status == MB_SUCCESS)
-		{
-		line[1] = 0x03;
-
-		/* set checksum */
-		mb_put_binary_short(swap, (unsigned short) checksum, (void *) &line[2]);
-
-		/* write out data */
-		write_len = fwrite(&line[1],1,3,mbfp);
-		if (write_len != 3)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em300raw_wr_svp(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store, int *error)
-{
-	char	*function_name = "mbr_em300raw_wr_svp";
-	int	status = MB_SUCCESS;
-	char	line[EM2_SVP_HEADER_SIZE];
-	short	label;
-	int	write_len;
-	int	write_size;
-	unsigned short checksum;
-	mb_u_char   *uchar_ptr;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       svp_use_date:    %d\n",store->svp_use_date);
-		fprintf(stderr,"dbg5       svp_use_msec:    %d\n",store->svp_use_msec);
-		fprintf(stderr,"dbg5       svp_count:       %d\n",store->svp_count);
-		fprintf(stderr,"dbg5       svp_serial:      %d\n",store->svp_serial);
-		fprintf(stderr,"dbg5       svp_origin_date: %d\n",store->svp_origin_date);
-		fprintf(stderr,"dbg5       svp_origin_msec: %d\n",store->svp_origin_msec);
-		fprintf(stderr,"dbg5       svp_num:         %d\n",store->svp_num);
-		fprintf(stderr,"dbg5       svp_depth_res:   %d\n",store->svp_depth_res);
-		fprintf(stderr,"dbg5       count    depth    speed\n");
-		fprintf(stderr,"dbg5       -----------------------\n");
-		for (i=0;i<store->svp_num;i++)
-			fprintf(stderr,"dbg5        %d   %d  %d\n",
-				i, store->svp_depth[i], store->svp_vel[i]);
-		}
-
-	/* zero checksum */
-	checksum = 0;
-
-	/* write the record size */
-	mb_put_binary_int(swap, (int) (EM2_SVP_HEADER_SIZE
-			+ EM2_SVP_SLICE_SIZE * store->svp_num + 8), (void *) &write_size);
-	write_len = fwrite(&write_size,1,4,mbfp);
-	if (write_len != 4)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	else
-		status = MB_SUCCESS;
-
-	/* write the record label */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_short(swap, (short) (EM2_SVP), (void *) &label);
-		write_len = fwrite(&label,1,2,mbfp);
-		if (write_len != 2)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_WRITE_FAIL;
-			}
-		else
-			status = MB_SUCCESS;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[1];
-		}
-
-	/* write the sonar id */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_short(swap, (short) (store->sonar), (void *) &label);
-		write_len = fwrite(&label,1,2,mbfp);
-		if (write_len != 2)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_WRITE_FAIL;
-			}
-		else
-			status = MB_SUCCESS;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[0];
-		checksum += uchar_ptr[1];
-		}
-
-	/* output binary header data */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_int(swap, (int) store->svp_use_date, (void *) &line[0]);
-		mb_put_binary_int(swap, (int) store->svp_use_msec, (void *) &line[4]);
-		mb_put_binary_short(swap, (unsigned short) store->svp_count, (void *) &line[8]);
-		mb_put_binary_short(swap, (unsigned short) store->svp_serial, (void *) &line[10]);
-		mb_put_binary_int(swap, (int) store->svp_origin_date, (void *) &line[12]);
-		mb_put_binary_int(swap, (int) store->svp_origin_msec, (void *) &line[16]);
-		mb_put_binary_short(swap, (unsigned short) store->svp_num, (void *) &line[20]);
-		mb_put_binary_short(swap, (unsigned short) store->svp_depth_res, (void *) &line[22]);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM2_SVP_HEADER_SIZE;j++)
-		    checksum += uchar_ptr[j];
-
-		/* write out data */
-		write_len = fwrite(line,1,EM2_SVP_HEADER_SIZE,mbfp);
-		if (write_len != EM2_SVP_HEADER_SIZE)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* output binary svp data */
-	if (status == MB_SUCCESS)
-	    for (i=0;i<store->svp_num;i++)
-		{
-		mb_put_binary_short(swap, (unsigned short) store->svp_depth[i], (void *) &line[0]);
-		mb_put_binary_short(swap, (unsigned short) store->svp_vel[i], (void *) &line[4]);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM2_SVP_SLICE_SIZE;j++)
-		    checksum += uchar_ptr[j];
-
-		/* write out data */
-		write_len = fwrite(line,1,EM2_SVP_SLICE_SIZE,mbfp);
-		if (write_len != EM2_SVP_SLICE_SIZE)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* output end of record */
-	if (status == MB_SUCCESS)
-		{
-		line[0] = '\0';
-		line[1] = 0x03;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		checksum += uchar_ptr[0];
-
-		/* set checksum */
-		mb_put_binary_short(swap, (unsigned short) checksum, (void *) &line[2]);
-
-		/* write out data */
-		write_len = fwrite(line,1,4,mbfp);
-		if (write_len != 4)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em300raw_wr_svp2(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store, int *error)
-{
-	char	*function_name = "mbr_em300raw_wr_svp2";
-	int	status = MB_SUCCESS;
-	char	line[EM2_SVP2_HEADER_SIZE];
-	short	label;
-	int	write_len;
-	int	write_size;
-	unsigned short checksum;
-	mb_u_char   *uchar_ptr;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       svp_use_date:    %d\n",store->svp_use_date);
-		fprintf(stderr,"dbg5       svp_use_msec:    %d\n",store->svp_use_msec);
-		fprintf(stderr,"dbg5       svp_count:       %d\n",store->svp_count);
-		fprintf(stderr,"dbg5       svp_serial:      %d\n",store->svp_serial);
-		fprintf(stderr,"dbg5       svp_origin_date: %d\n",store->svp_origin_date);
-		fprintf(stderr,"dbg5       svp_origin_msec: %d\n",store->svp_origin_msec);
-		fprintf(stderr,"dbg5       svp_num:         %d\n",store->svp_num);
-		fprintf(stderr,"dbg5       svp_depth_res:   %d\n",store->svp_depth_res);
-		fprintf(stderr,"dbg5       count    depth    speed\n");
-		fprintf(stderr,"dbg5       -----------------------\n");
-		for (i=0;i<store->svp_num;i++)
-			fprintf(stderr,"dbg5        %d   %d  %d\n",
-				i, store->svp_depth[i], store->svp_vel[i]);
-		}
-
-	/* zero checksum */
-	checksum = 0;
-
-	/* write the record size */
-	mb_put_binary_int(swap, (int) (EM2_SVP2_HEADER_SIZE
-			+ EM2_SVP2_SLICE_SIZE * store->svp_num + 8), (void *) &write_size);
-	write_len = fwrite(&write_size,1,4,mbfp);
-	if (write_len != 4)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	else
-		status = MB_SUCCESS;
-
-	/* write the record label */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_short(swap, (short) (EM2_SVP2), (void *) &label);
-		write_len = fwrite(&label,1,2,mbfp);
-		if (write_len != 2)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_WRITE_FAIL;
-			}
-		else
-			status = MB_SUCCESS;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[1];
-		}
-
-	/* write the sonar id */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_short(swap, (short) (store->sonar), (void *) &label);
-		write_len = fwrite(&label,1,2,mbfp);
-		if (write_len != 2)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_WRITE_FAIL;
-			}
-		else
-			status = MB_SUCCESS;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[0];
-		checksum += uchar_ptr[1];
-		}
-
-	/* output binary header data */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_int(swap, (int) store->svp_use_date, (void *) &line[0]);
-		mb_put_binary_int(swap, (int) store->svp_use_msec, (void *) &line[4]);
-		mb_put_binary_short(swap, (unsigned short) store->svp_count, (void *) &line[8]);
-		mb_put_binary_short(swap, (unsigned short) store->svp_serial, (void *) &line[10]);
-		mb_put_binary_int(swap, (int) store->svp_origin_date, (void *) &line[12]);
-		mb_put_binary_int(swap, (int) store->svp_origin_msec, (void *) &line[16]);
-		mb_put_binary_short(swap, (unsigned short) store->svp_num, (void *) &line[20]);
-		mb_put_binary_short(swap, (unsigned short) store->svp_depth_res, (void *) &line[22]);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM2_SVP2_HEADER_SIZE;j++)
-		    checksum += uchar_ptr[j];
-
-		/* write out data */
-		write_len = fwrite(line,1,EM2_SVP2_HEADER_SIZE,mbfp);
-		if (write_len != EM2_SVP2_HEADER_SIZE)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* output binary svp data */
-	if (status == MB_SUCCESS)
-	    for (i=0;i<store->svp_num;i++)
-		{
-		mb_put_binary_int(swap, (int) store->svp_depth[i], (void *) &line[0]);
-		mb_put_binary_int(swap, (int) store->svp_vel[i], (void *) &line[4]);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM2_SVP2_SLICE_SIZE;j++)
-		    checksum += uchar_ptr[j];
-
-		/* write out data */
-		write_len = fwrite(line,1,EM2_SVP2_SLICE_SIZE,mbfp);
-		if (write_len != EM2_SVP2_SLICE_SIZE)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* output end of record */
-	if (status == MB_SUCCESS)
-		{
-		line[0] = '\0';
-		line[1] = 0x03;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		checksum += uchar_ptr[0];
-
-		/* set checksum */
-		mb_put_binary_short(swap, (unsigned short) checksum, (void *) &line[2]);
-
-		/* write out data */
-		write_len = fwrite(line,1,4,mbfp);
-		if (write_len != 4)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em300raw_wr_bath(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store, int head, int *error)
-{
-	char	*function_name = "mbr_em300raw_wr_bath";
-	int	status = MB_SUCCESS;
-	struct mbsys_simrad2_ping_struct *ping;
-	char	line[EM2_BATH_HEADER_SIZE];
-	short	label;
-	int	write_len;
-	int	write_size;
-	unsigned short checksum;
-	mb_u_char   *uchar_ptr;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		fprintf(stderr,"dbg2       head:       %d\n",head);
-		}
-
-	/* get storage structure */
-	if (store->sonar == MBSYS_SIMRAD2_EM3002
-			&& store->numberheads == 2 && head == 1)
-		ping = (struct mbsys_simrad2_ping_struct *) store->ping2;
-	else
-		ping = (struct mbsys_simrad2_ping_struct *) store->ping;
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       png_date:        %d\n",ping->png_date);
-		fprintf(stderr,"dbg5       png_msec:        %d\n",ping->png_msec);
-		fprintf(stderr,"dbg5       png_count:       %d\n",ping->png_count);
-		fprintf(stderr,"dbg5       png_serial:      %d\n",ping->png_serial);
-		fprintf(stderr,"dbg5       png_heading:     %d\n",ping->png_heading);
-		fprintf(stderr,"dbg5       png_ssv:         %d\n",ping->png_ssv);
-		fprintf(stderr,"dbg5       png_xducer_depth:      %d\n",ping->png_xducer_depth);
-		fprintf(stderr,"dbg5       png_offset_multiplier: %d\n",ping->png_offset_multiplier);
-		fprintf(stderr,"dbg5       png_nbeams_max:        %d\n",ping->png_nbeams_max);
-		fprintf(stderr,"dbg5       png_nbeams:            %d\n",ping->png_nbeams);
-		fprintf(stderr,"dbg5       png_depth_res:         %d\n",ping->png_depth_res);
-		fprintf(stderr,"dbg5       png_distance_res:      %d\n",ping->png_distance_res);
-		fprintf(stderr,"dbg5       png_sample_rate:       %d\n",ping->png_sample_rate);
-		fprintf(stderr,"dbg5       cnt  depth xtrack ltrack dprsn   azi   rng  qual wnd amp num\n");
-		fprintf(stderr,"dbg5       ------------------------------------------------------------\n");
-		for (i=0;i<ping->png_nbeams;i++)
-			fprintf(stderr,"dbg5       %3d %6d %6d %6d %5d %5d %5d %4d %3d %3d %3d\n",
-				i, ping->png_depth[i], ping->png_acrosstrack[i],
-				ping->png_alongtrack[i], ping->png_depression[i],
-				ping->png_azimuth[i], ping->png_range[i],
-				ping->png_quality[i], ping->png_window[i],
-				ping->png_amp[i], ping->png_beam_num[i]);
-		}
-
-	/* zero checksum */
-	checksum = 0;
-
-	/* write the record size */
-	mb_put_binary_int(swap, (int) (EM2_BATH_HEADER_SIZE
-			+ EM2_BATH_BEAM_SIZE * ping->png_nbeams + 8), (void *) &write_size);
-	write_len = fwrite(&write_size,1,4,mbfp);
-	if (write_len != 4)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	else
-		status = MB_SUCCESS;
-
-	/* write the record label */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_short(swap, (short) (EM2_BATH), (void *) &label);
-		write_len = fwrite(&label,1,2,mbfp);
-		if (write_len != 2)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_WRITE_FAIL;
-			}
-		else
-			status = MB_SUCCESS;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[1];
-		}
-
-	/* write the sonar id */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_short(swap, (short) (store->sonar), (void *) &label);
-		write_len = fwrite(&label,1,2,mbfp);
-		if (write_len != 2)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_WRITE_FAIL;
-			}
-		else
-			status = MB_SUCCESS;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[0];
-		checksum += uchar_ptr[1];
-		}
-
-	/* output binary header data */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_int(swap, (int) ping->png_date, (void *) &line[0]);
-		mb_put_binary_int(swap, (int) ping->png_msec, (void *) &line[4]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_count, (void *) &line[8]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_serial, (void *) &line[10]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_heading, (void *) &line[12]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_ssv, (void *) &line[14]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_xducer_depth, (void *) &line[16]);
-		line[18] = (mb_u_char) ping->png_nbeams_max;
-		line[19] = (mb_u_char) ping->png_nbeams;
-		line[20] = (mb_u_char) ping->png_depth_res;
-		line[21] = (mb_u_char) ping->png_distance_res;
-		mb_put_binary_short(swap, (unsigned short) ping->png_sample_rate, (void *) &line[22]);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM2_BATH_HEADER_SIZE;j++)
-		    checksum += uchar_ptr[j];
-
-		/* write out data */
-		write_len = fwrite(line,1,EM2_BATH_HEADER_SIZE,mbfp);
-		if (write_len != EM2_BATH_HEADER_SIZE)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* output binary beam data */
-	if (status == MB_SUCCESS)
-	    for (i=0;i<ping->png_nbeams;i++)
-		{
-		if (!mb_beam_ok(ping->png_beamflag[i]))
-			ping->png_depth[i] = 0;
-		if (store->sonar == MBSYS_SIMRAD2_EM120
-			|| store->sonar == MBSYS_SIMRAD2_EM300)
-		    mb_put_binary_short(swap, (unsigned short) ping->png_depth[i], (void *) &line[0]);
-		else
-		    mb_put_binary_short(swap, (short) ping->png_depth[i], (void *) &line[0]);
-		mb_put_binary_short(swap, (short) ping->png_acrosstrack[i], (void *) &line[2]);
-		mb_put_binary_short(swap, (short) ping->png_alongtrack[i], (void *) &line[4]);
-		mb_put_binary_short(swap, (short) ping->png_depression[i], (void *) &line[6]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_azimuth[i], (void *) &line[8]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_range[i], (void *) &line[10]);
-		line[12] = (mb_u_char) ping->png_quality[i];
-		line[13] = (mb_u_char) ping->png_window[i];
-		line[14] = (mb_s_char) ping->png_amp[i];
-		line[15] = (mb_u_char) ping->png_beam_num[i];
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM2_BATH_BEAM_SIZE;j++)
-		    checksum += uchar_ptr[j];
-
-		/* write out data */
-		write_len = fwrite(line,1,EM2_BATH_BEAM_SIZE,mbfp);
-		if (write_len != EM2_BATH_BEAM_SIZE)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* output end of record */
-	if (status == MB_SUCCESS)
-		{
-		line[0] = (mb_s_char) ping->png_offset_multiplier;
-		line[1] = 0x03;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		checksum += uchar_ptr[0];
-
-		/* set checksum */
-		mb_put_binary_short(swap, (unsigned short) checksum, (void *) &line[2]);
-
-		/* write out data */
-		write_len = fwrite(line,1,4,mbfp);
-		if (write_len != 4)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em300raw_wr_rawbeam(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store, int *error)
-{
-	char	*function_name = "mbr_em300raw_wr_rawbeam";
-	int	status = MB_SUCCESS;
-	struct mbsys_simrad2_ping_struct *ping;
-	char	line[EM2_RAWBEAM_HEADER_SIZE];
-	short	label;
-	int	write_len;
-	int	write_size;
-	unsigned short checksum;
-	mb_u_char   *uchar_ptr;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		}
-
-	/* get storage structure */
-	ping = (struct mbsys_simrad2_ping_struct *) store->ping;
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       png_raw_date:        %d\n",ping->png_raw_date);
-		fprintf(stderr,"dbg5       png_raw_msec:        %d\n",ping->png_raw_msec);
-		fprintf(stderr,"dbg5       png_raw_count:       %d\n",ping->png_raw_count);
-		fprintf(stderr,"dbg5       png_raw_serial:      %d\n",ping->png_raw_serial);
-		fprintf(stderr,"dbg5       png_raw_nbeams_max:  %d\n",ping->png_raw_nbeams_max);
-		fprintf(stderr,"dbg5       png_raw_nbeams:      %d\n",ping->png_raw_nbeams);
-		fprintf(stderr,"dbg5       png_raw_ssv:         %d\n",ping->png_raw_ssv);
-		fprintf(stderr,"dbg5       cnt  point   tilt   rng  amp num\n");
-		fprintf(stderr,"dbg5       ------------------------------------------------------------\n");
-		for (i=0;i<ping->png_raw_nbeams;i++)
-			fprintf(stderr,"dbg5       %3d %5d %5d %5d %3d %3d\n",
-				i, ping->png_raw_rxpointangle[i], ping->png_raw_rxtiltangle[i],
-				ping->png_raw_rxrange[i], ping->png_raw_rxamp[i],
-				ping->png_raw_rxbeam_num[i]);
-		}
-
-	/* zero checksum */
-	checksum = 0;
-
-	/* write the record size */
-	mb_put_binary_int(swap, (int) (EM2_RAWBEAM_HEADER_SIZE
-			+ EM2_RAWBEAM_BEAM_SIZE * ping->png_raw_nbeams + 8), (void *) &write_size);
-	write_len = fwrite(&write_size,1,4,mbfp);
-	if (write_len != 4)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	else
-		status = MB_SUCCESS;
-
-	/* write the record label */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_short(swap, (short) (EM2_RAWBEAM), (void *) &label);
-		write_len = fwrite(&label,1,2,mbfp);
-		if (write_len != 2)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_WRITE_FAIL;
-			}
-		else
-			status = MB_SUCCESS;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[1];
-		}
-
-	/* write the sonar id */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_short(swap, (short) (store->sonar), (void *) &label);
-		write_len = fwrite(&label,1,2,mbfp);
-		if (write_len != 2)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_WRITE_FAIL;
-			}
-		else
-			status = MB_SUCCESS;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[0];
-		checksum += uchar_ptr[1];
-		}
-
-	/* output binary header data */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_int(swap, (int) ping->png_raw_date, (void *) &line[0]);
-		mb_put_binary_int(swap, (int) ping->png_raw_msec, (void *) &line[4]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_raw_count, (void *) &line[8]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_raw_serial, (void *) &line[10]);
-		line[12] = (mb_u_char) ping->png_raw_nbeams_max;
-		line[13] = (mb_u_char) ping->png_raw_nbeams;
-		mb_put_binary_short(swap, (unsigned short) ping->png_raw_ssv, (void *) &line[14]);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM2_RAWBEAM_HEADER_SIZE;j++)
-		    checksum += uchar_ptr[j];
-
-		/* write out data */
-		write_len = fwrite(line,1,EM2_RAWBEAM_HEADER_SIZE,mbfp);
-		if (write_len != EM2_RAWBEAM_HEADER_SIZE)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* output binary beam data */
-	if (status == MB_SUCCESS)
-	    for (i=0;i<ping->png_raw_nbeams;i++)
-		{
-		mb_put_binary_short(swap, (short) ping->png_raw_rxpointangle[i], (void *) &line[0]);
-		mb_put_binary_short(swap, (short) ping->png_raw_rxtiltangle[i], (void *) &line[2]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_raw_rxrange[i], (void *) &line[4]);
-		line[6] = (mb_s_char) ping->png_raw_rxamp[i];
-		line[7] = (mb_u_char) ping->png_raw_rxbeam_num[i];
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM2_RAWBEAM_BEAM_SIZE;j++)
-		    checksum += uchar_ptr[j];
-
-		/* write out data */
-		write_len = fwrite(line,1,EM2_RAWBEAM_BEAM_SIZE,mbfp);
-		if (write_len != EM2_RAWBEAM_BEAM_SIZE)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* output end of record */
-	if (status == MB_SUCCESS)
-		{
-		line[0] = 0;
-		line[1] = 0x03;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		checksum += uchar_ptr[0];
-
-		/* set checksum */
-		mb_put_binary_short(swap, (unsigned short) checksum, (void *) &line[2]);
-
-		/* write out data */
-		write_len = fwrite(line,1,4,mbfp);
-		if (write_len != 4)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em300raw_wr_rawbeam2(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store, int *error)
-{
-	char	*function_name = "mbr_em300raw_wr_rawbeam2";
-	int	status = MB_SUCCESS;
-	struct mbsys_simrad2_ping_struct *ping;
-	char	line[EM2_RAWBEAM2_HEADER_SIZE];
-	short	label;
-	int	write_len;
-	int	write_size;
-	unsigned short checksum;
-	mb_u_char   *uchar_ptr;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		}
-
-	/* get storage structure */
-	ping = (struct mbsys_simrad2_ping_struct *) store->ping;
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       png_raw_date:                %d\n",ping->png_raw_date);
-		fprintf(stderr,"dbg5       png_raw_msec:                %d\n",ping->png_raw_msec);
-		fprintf(stderr,"dbg5       png_raw_count:               %d\n",ping->png_raw_count);
-		fprintf(stderr,"dbg5       png_raw_serial:              %d\n",ping->png_raw_serial);
-		fprintf(stderr,"dbg5       png_raw_heading:             %d\n",ping->png_raw_heading);
-		fprintf(stderr,"dbg5       png_raw_ssv:                 %d\n",ping->png_raw_ssv);
-		fprintf(stderr,"dbg5       png_raw_xducer_depth:        %d\n",ping->png_raw_xducer_depth);
-		fprintf(stderr,"dbg5       png_raw_nbeams_max:          %d\n",ping->png_raw_nbeams_max);
-		fprintf(stderr,"dbg5       png_raw_nbeams:              %d\n",ping->png_raw_nbeams);
-		fprintf(stderr,"dbg5       png_raw_depth_res:           %d\n",ping->png_raw_depth_res);
-		fprintf(stderr,"dbg5       png_raw_distance_res:        %d\n",ping->png_raw_distance_res);
-		fprintf(stderr,"dbg5       png_raw_sample_rate:         %d\n",ping->png_raw_sample_rate);
-		fprintf(stderr,"dbg5       png_raw_status:              %d\n",ping->png_raw_status);
-		fprintf(stderr,"dbg5       png_raw_rangenormal:         %d\n",ping->png_raw_rangenormal);
-		fprintf(stderr,"dbg5       png_raw_normalbackscatter:   %d\n",ping->png_raw_normalbackscatter);
-		fprintf(stderr,"dbg5       png_raw_obliquebackscatter:  %d\n",ping->png_raw_obliquebackscatter);
-		fprintf(stderr,"dbg5       png_raw_fixedgain:           %d\n",ping->png_raw_fixedgain);
-		fprintf(stderr,"dbg5       png_raw_txpower:             %d\n",ping->png_raw_txpower);
-		fprintf(stderr,"dbg5       png_raw_mode:                %d\n",ping->png_raw_mode);
-		fprintf(stderr,"dbg5       png_raw_coverage:            %d\n",ping->png_raw_coverage);
-		fprintf(stderr,"dbg5       png_raw_yawstabheading:      %d\n",ping->png_raw_yawstabheading);
-		fprintf(stderr,"dbg5       png_raw_ntx:                 %d\n",ping->png_raw_ntx);
-		fprintf(stderr,"dbg5       ------------------------------------------------------------\n");
-		fprintf(stderr,"dbg5       transmit pulse values:\n");
-		fprintf(stderr,"dbg5       cnt lastbeam tiltangle heading roll pitch heave\n");
-		fprintf(stderr,"dbg5       ------------------------------------------------------------\n");
-		for (i=0;i<ping->png_raw_ntx;i++)
-			fprintf(stderr,"dbg5       %3d %3d %4d %5d %4d %4d %4d\n",
-				i, ping->png_raw_txlastbeam[i], ping->png_raw_txtiltangle[i],
-				ping->png_raw_txheading[i], ping->png_raw_txroll[i],
-				ping->png_raw_txpitch[i], ping->png_raw_txheave[i]);
-		fprintf(stderr,"dbg5       ------------------------------------------------------------\n");
-		fprintf(stderr,"dbg5       beam values:\n");
-		fprintf(stderr,"dbg5       cnt range quality window amp beam angle heading roll pitch heave\n");
-		fprintf(stderr,"dbg5       ------------------------------------------------------------\n");
-		for (i=0;i<ping->png_raw_nbeams;i++)
-			fprintf(stderr,"dbg5       %3d %5d %3d %3d %4d %3d %5d %5d %4d %4d %4d\n",
-				i, ping->png_raw_rxrange[i], ping->png_raw_rxquality[i],
-				ping->png_raw_rxwindow[i], ping->png_raw_rxamp[i],
-				ping->png_raw_rxbeam_num[i], ping->png_raw_rxpointangle[i],
-				ping->png_raw_rxheading[i], ping->png_raw_rxroll[i],
-				ping->png_raw_rxpitch[i], ping->png_raw_rxheave[i]);
-		}
-
-	/* zero checksum */
-	checksum = 0;
-
-	/* write the record size */
-	mb_put_binary_int(swap, (int) (EM2_RAWBEAM2_HEADER_SIZE
-			+ EM2_RAWBEAM2_TX_SIZE * ping->png_raw_ntx
-			+ EM2_RAWBEAM2_BEAM_SIZE * ping->png_raw_nbeams + 8), (void *) &write_size);
-	write_len = fwrite(&write_size,1,4,mbfp);
-	if (write_len != 4)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	else
-		status = MB_SUCCESS;
-
-	/* write the record label */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_short(swap, (short) (EM2_RAWBEAM2), (void *) &label);
-		write_len = fwrite(&label,1,2,mbfp);
-		if (write_len != 2)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_WRITE_FAIL;
-			}
-		else
-			status = MB_SUCCESS;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[1];
-		}
-
-	/* write the sonar id */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_short(swap, (short) (store->sonar), (void *) &label);
-		write_len = fwrite(&label,1,2,mbfp);
-		if (write_len != 2)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_WRITE_FAIL;
-			}
-		else
-			status = MB_SUCCESS;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[0];
-		checksum += uchar_ptr[1];
-		}
-
-	/* output binary header data */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_int(swap, (int) ping->png_raw_date, (void *) &line[0]);
-		mb_put_binary_int(swap, (int) ping->png_raw_msec, (void *) &line[4]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_raw_count, (void *) &line[8]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_raw_serial, (void *) &line[10]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_raw_heading, (void *) &line[12]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_raw_ssv, (void *) &line[14]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_raw_xducer_depth, (void *) &line[16]);
-		line[18] = (mb_u_char) ping->png_raw_nbeams_max;
-		line[19] = (mb_u_char) ping->png_raw_nbeams;
-		line[20] = (mb_u_char) ping->png_raw_depth_res;
-		line[21] = (mb_u_char) ping->png_raw_distance_res;
-		mb_put_binary_short(swap, (unsigned short) ping->png_raw_sample_rate, (void *) &line[22]);
-		mb_put_binary_int(swap, (int) ping->png_raw_status, (void *) &line[24]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_raw_rangenormal, (void *) &line[28]);
-		line[30] = (mb_s_char) ping->png_raw_normalbackscatter;
-		line[31] = (mb_s_char) ping->png_raw_obliquebackscatter;
-		line[32] = (mb_u_char) ping->png_raw_fixedgain;
-		line[33] = (mb_s_char) ping->png_raw_txpower;
-		line[34] = (mb_u_char) ping->png_raw_mode;
-		line[35] = (mb_u_char) ping->png_raw_coverage;
-		mb_put_binary_short(swap, (unsigned short) ping->png_raw_yawstabheading, (void *) &line[36]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_raw_ntx, (void *) &line[38]);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM2_RAWBEAM2_HEADER_SIZE;j++)
-		    checksum += uchar_ptr[j];
-
-		/* write out data */
-		write_len = fwrite(line,1,EM2_RAWBEAM2_HEADER_SIZE,mbfp);
-		if (write_len != EM2_RAWBEAM2_HEADER_SIZE)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* output binary tx data */
-	if (status == MB_SUCCESS)
-	    for (i=0;i<ping->png_raw_ntx;i++)
-		{
-		mb_put_binary_short(swap, (unsigned short) ping->png_raw_txlastbeam[i], (void *) &line[0]);
-		mb_put_binary_short(swap, (short) ping->png_raw_txtiltangle[i], (void *) &line[2]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_raw_txheading[i], (void *) &line[4]);
-		mb_put_binary_short(swap, (short) ping->png_raw_txroll[i], (void *) &line[6]);
-		mb_put_binary_short(swap, (short) ping->png_raw_txpitch[i], (void *) &line[8]);
-		mb_put_binary_short(swap, (short) ping->png_raw_txheave[i], (void *) &line[10]);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM2_RAWBEAM2_TX_SIZE;j++)
-		    checksum += uchar_ptr[j];
-
-		/* write out data */
-		write_len = fwrite(line,1,EM2_RAWBEAM2_TX_SIZE,mbfp);
-		if (write_len != EM2_RAWBEAM2_TX_SIZE)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* output binary beam data */
-	if (status == MB_SUCCESS)
-	    for (i=0;i<ping->png_raw_nbeams;i++)
-		{
-		mb_put_binary_short(swap, (unsigned short) ping->png_raw_rxrange[i], (void *) &line[0]);
-		line[2] = (mb_u_char) ping->png_raw_rxquality[i];
-		line[3] = (mb_u_char) ping->png_raw_rxwindow[i];
-		line[4] = (mb_s_char) ping->png_raw_rxamp[i];
-		line[5] = (mb_u_char) ping->png_raw_rxbeam_num[i];
-		mb_put_binary_short(swap, (short) ping->png_raw_rxpointangle[i], (void *) &line[6]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_raw_rxheading[i], (void *) &line[8]);
-		mb_put_binary_short(swap, (short) ping->png_raw_rxroll[i], (void *) &line[10]);
-		mb_put_binary_short(swap, (short) ping->png_raw_rxpitch[i], (void *) &line[12]);
-		mb_put_binary_short(swap, (short) ping->png_raw_rxheave[i], (void *) &line[14]);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM2_RAWBEAM2_BEAM_SIZE;j++)
-		    checksum += uchar_ptr[j];
-
-		/* write out data */
-		write_len = fwrite(line,1,EM2_RAWBEAM2_BEAM_SIZE,mbfp);
-		if (write_len != EM2_RAWBEAM2_BEAM_SIZE)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* output end of record */
-	if (status == MB_SUCCESS)
-		{
-		line[0] = 0;
-		line[1] = 0x03;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		checksum += uchar_ptr[0];
-
-		/* set checksum */
-		mb_put_binary_short(swap, (unsigned short) checksum, (void *) &line[2]);
-
-		/* write out data */
-		write_len = fwrite(line,1,4,mbfp);
-		if (write_len != 4)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em300raw_wr_rawbeam3(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store, int head, int *error)
-{
-	char	*function_name = "mbr_em300raw_wr_rawbeam3";
-	int	status = MB_SUCCESS;
-	struct mbsys_simrad2_ping_struct *ping;
-	char	line[EM2_RAWBEAM3_HEADER_SIZE];
-	short	label;
-	int	write_len;
-	int	write_size;
-	unsigned short checksum;
-	mb_u_char   *uchar_ptr;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		fprintf(stderr,"dbg2       head:       %d\n",head);
-		}
-
-	/* get storage structure */
-	if (store->sonar == MBSYS_SIMRAD2_EM3002
-			&& store->numberheads == 2 && head == 1)
-		ping = (struct mbsys_simrad2_ping_struct *) store->ping2;
-	else
-		ping = (struct mbsys_simrad2_ping_struct *) store->ping;
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       png_raw3_date:                %d\n",ping->png_raw3_date);
-		fprintf(stderr,"dbg5       png_raw3_msec:                %d\n",ping->png_raw3_msec);
-		fprintf(stderr,"dbg5       png_raw3_count:               %d\n",ping->png_raw3_count);
-		fprintf(stderr,"dbg5       png_raw3_serial:              %d\n",ping->png_raw3_serial);
-		fprintf(stderr,"dbg5       png_raw3_ntx:                 %d\n",ping->png_raw3_ntx);
-		fprintf(stderr,"dbg5       png_raw3_nbeams:              %d\n",ping->png_raw3_nbeams);
-		fprintf(stderr,"dbg5       png_raw3_sample_rate:         %d\n",ping->png_raw3_sample_rate);
-		fprintf(stderr,"dbg5       png_raw3_xducer_depth:        %d\n",ping->png_raw3_xducer_depth);
-		fprintf(stderr,"dbg5       png_raw3_ssv:                 %d\n",ping->png_raw3_ssv);
-		fprintf(stderr,"dbg5       png_raw3_nbeams_max:          %d\n",ping->png_raw3_nbeams_max);
-		fprintf(stderr,"dbg5       ------------------------------------------------------------\n");
-		fprintf(stderr,"dbg5       transmit pulse values:\n");
-		fprintf(stderr,"dbg5       tiltangle focus length offset center bandwidth waveform sector\n");
-		fprintf(stderr,"dbg5       ------------------------------------------------------------\n");
-		for (i=0;i<ping->png_raw3_ntx;i++)
-			fprintf(stderr,"dbg5       %3d %5d %5d %6d %4d %4d %4d %4d %4d\n",
-				i, ping->png_raw3_txtiltangle[i],
-				ping->png_raw3_txfocus[i], ping->png_raw3_txsignallength[i],
-				ping->png_raw3_txoffset[i], ping->png_raw3_txcenter[i],
-				ping->png_raw3_txbandwidth[i], ping->png_raw3_txwaveform[i],
-				ping->png_raw3_txsector[i]);
-		fprintf(stderr,"dbg5       ------------------------------------------------------------\n");
-		fprintf(stderr,"dbg5       beam values:\n");
-		fprintf(stderr,"dbg5       angle range sector amp quality window beam\n");
-		fprintf(stderr,"dbg5       ------------------------------------------------------------\n");
-		for (i=0;i<ping->png_raw3_nbeams;i++)
-			fprintf(stderr,"dbg5       %3d %5d %3d %3d %4d %3d %5d %5d %5d\n",
-				i, ping->png_raw3_rxpointangle[i], ping->png_raw3_rxrange[i],
-				ping->png_raw3_rxsector[i], ping->png_raw3_rxamp[i],
-				ping->png_raw3_rxquality[i], ping->png_raw3_rxwindow[i],
-				ping->png_raw3_rxbeam_num[i],ping->png_raw3_rxspare[i]);
-		}
-
-	/* zero checksum */
-	checksum = 0;
-
-	/* write the record size */
-	mb_put_binary_int(swap, (int) (EM2_RAWBEAM3_HEADER_SIZE
-			+ EM2_RAWBEAM3_TX_SIZE * ping->png_raw3_ntx
-			+ EM2_RAWBEAM3_BEAM_SIZE * ping->png_raw3_nbeams + 8), (void *) &write_size);
-	write_len = fwrite(&write_size,1,4,mbfp);
-	if (write_len != 4)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	else
-		status = MB_SUCCESS;
-
-	/* write the record label */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_short(swap, (short) (EM2_RAWBEAM3), (void *) &label);
-		write_len = fwrite(&label,1,2,mbfp);
-		if (write_len != 2)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_WRITE_FAIL;
-			}
-		else
-			status = MB_SUCCESS;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[1];
-		}
-
-	/* write the sonar id */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_short(swap, (short) (store->sonar), (void *) &label);
-		write_len = fwrite(&label,1,2,mbfp);
-		if (write_len != 2)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_WRITE_FAIL;
-			}
-		else
-			status = MB_SUCCESS;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[0];
-		checksum += uchar_ptr[1];
-		}
-
-	/* output binary header data */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_int(swap, (int) ping->png_raw3_date, (void *) &line[0]);
-		mb_put_binary_int(swap, (int) ping->png_raw3_msec, (void *) &line[4]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_raw3_count, (void *) &line[8]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_raw3_serial, (void *) &line[10]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_raw3_ntx, (void *) &line[12]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_raw3_nbeams, (void *) &line[14]);
-		mb_put_binary_int(swap, (unsigned int) ping->png_raw3_sample_rate, (void *) &line[16]);
-		mb_put_binary_int(swap, (int) ping->png_raw3_xducer_depth, (void *) &line[20]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_raw3_ssv, (void *) &line[24]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_raw3_nbeams_max, (void *) &line[26]);
-		mb_put_binary_short(swap, (unsigned short) 0, (void *) &line[28]);
-		mb_put_binary_short(swap, (unsigned short) 0, (void *) &line[30]);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM2_RAWBEAM3_HEADER_SIZE;j++)
-		    checksum += uchar_ptr[j];
-
-		/* write out data */
-		write_len = fwrite(line,1,EM2_RAWBEAM3_HEADER_SIZE,mbfp);
-		if (write_len != EM2_RAWBEAM3_HEADER_SIZE)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* output binary tx data */
-	if (status == MB_SUCCESS)
-	    for (i=0;i<ping->png_raw3_ntx;i++)
-		{
-		mb_put_binary_short(swap, (short) ping->png_raw3_txtiltangle[i], (void *) &line[0]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_raw3_txfocus[i], (void *) &line[2]);
-		mb_put_binary_int(swap, (int) ping->png_raw3_txsignallength[i], (void *) &line[4]);
-		mb_put_binary_int(swap, (int) ping->png_raw3_txoffset[i], (void *) &line[8]);
-		mb_put_binary_int(swap, (int) ping->png_raw3_txcenter[i], (void *) &line[12]);
-		mb_put_binary_short(swap, (short) ping->png_raw3_txbandwidth[i], (void *) &line[16]);
-		line[18] = (mb_u_char) ping->png_raw3_txwaveform[i];
-		line[19] = (mb_u_char) ping->png_raw3_txsector[i];
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM2_RAWBEAM3_TX_SIZE;j++)
-		    checksum += uchar_ptr[j];
-
-		/* write out data */
-		write_len = fwrite(line,1,EM2_RAWBEAM3_TX_SIZE,mbfp);
-		if (write_len != EM2_RAWBEAM3_TX_SIZE)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* output binary beam data */
-	if (status == MB_SUCCESS)
-	    for (i=0;i<ping->png_raw3_nbeams;i++)
-		{
-		mb_put_binary_short(swap, (short) ping->png_raw3_rxpointangle[i], (void *) &line[0]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_raw3_rxrange[i], (void *) &line[2]);
-		line[4] = (mb_u_char) ping->png_raw3_rxsector[i];
-		line[5] = (mb_s_char) ping->png_raw3_rxamp[i];
-		line[6] = (mb_u_char) ping->png_raw3_rxquality[i];
-		line[7] = (mb_u_char) ping->png_raw3_rxwindow[i];
-		mb_put_binary_short(swap, (short) ping->png_raw3_rxbeam_num[i], (void *) &line[8]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_raw3_rxspare[i], (void *) &line[10]);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM2_RAWBEAM3_BEAM_SIZE;j++)
-		    checksum += uchar_ptr[j];
-
-		/* write out data */
-		write_len = fwrite(line,1,EM2_RAWBEAM3_BEAM_SIZE,mbfp);
-		if (write_len != EM2_RAWBEAM3_BEAM_SIZE)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* output end of record */
-	if (status == MB_SUCCESS)
-		{
-		line[0] = 0;
-		line[1] = 0x03;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		checksum += uchar_ptr[0];
-
-		/* set checksum */
-		mb_put_binary_short(swap, (unsigned short) checksum, (void *) &line[2]);
-
-		/* write out data */
-		write_len = fwrite(line,1,4,mbfp);
-		if (write_len != 4)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em300raw_wr_ss(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store, int head, int *error)
-{
-	char	*function_name = "mbr_em300raw_wr_ss";
-	int	status = MB_SUCCESS;
-	struct mbsys_simrad2_ping_struct *ping;
-	char	line[EM2_SS_HEADER_SIZE];
-	short	label;
-	int	write_len;
-	int	write_size;
-	unsigned short checksum;
-	mb_u_char   *uchar_ptr;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		fprintf(stderr,"dbg2       head:       %d\n",head);
-		}
-
-	/* get storage structure */
-	if (store->sonar == MBSYS_SIMRAD2_EM3002
-			&& store->numberheads == 2 && head == 1)
-		ping = (struct mbsys_simrad2_ping_struct *) store->ping2;
-	else
-		ping = (struct mbsys_simrad2_ping_struct *) store->ping;
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       png_ss_date:     %d\n",ping->png_ss_date);
-		fprintf(stderr,"dbg5       png_ss_msec:     %d\n",ping->png_ss_msec);
-		fprintf(stderr,"dbg5       png_ss_count:    %d\n",ping->png_ss_count);
-		fprintf(stderr,"dbg5       png_ss_serial    %d\n",ping->png_ss_serial);
-		fprintf(stderr,"dbg5       png_max_range:   %d\n",ping->png_max_range);
-		fprintf(stderr,"dbg5       png_r_zero:      %d\n",ping->png_r_zero);
-		fprintf(stderr,"dbg5       png_r_zero_corr: %d\n",ping->png_r_zero_corr);
-		fprintf(stderr,"dbg5       png_tvg_start:   %d\n",ping->png_tvg_start);
-		fprintf(stderr,"dbg5       png_tvg_stop:    %d\n",ping->png_tvg_stop);
-		fprintf(stderr,"dbg5       png_bsn:         %d\n",ping->png_bsn);
-		fprintf(stderr,"dbg5       png_bso:         %d\n",ping->png_bso);
-		fprintf(stderr,"dbg5       png_tx:          %d\n",ping->png_tx);
-		fprintf(stderr,"dbg5       png_tvg_crossover: %d\n",ping->png_tvg_crossover);
-		fprintf(stderr,"dbg5       png_nbeams_ss:     %d\n",ping->png_nbeams_ss);
-		fprintf(stderr,"dbg5       png_npixels:       %d\n",ping->png_npixels);
-		fprintf(stderr,"dbg5       cnt  index sort samples start center\n");
-		fprintf(stderr,"dbg5       --------------------------------------------------\n");
-		for (i=0;i<ping->png_nbeams_ss;i++)
-			fprintf(stderr,"dbg5        %4d %3d %2d %4d %4d %4d\n",
-				i, ping->png_beam_index[i], ping->png_sort_direction[i],
-				ping->png_beam_samples[i], ping->png_start_sample[i],
-				ping->png_center_sample[i]);
-		fprintf(stderr,"dbg5       cnt  ss\n");
-		fprintf(stderr,"dbg5       --------------------------------------------------\n");
-		for (i=0;i<ping->png_npixels;i++)
-			fprintf(stderr,"dbg5        %d %d\n",
-				i, ping->png_ssraw[i]);
-		}
-
-	/* zero checksum */
-	checksum = 0;
-
-	/* write the record size */
-	mb_put_binary_int(swap, (int) (EM2_SS_HEADER_SIZE
-			+ EM2_SS_BEAM_SIZE * ping->png_nbeams_ss
-			+ ping->png_npixels - (ping->png_npixels % 2) + 8), (void *) &write_size);
-	write_len = fwrite(&write_size,1,4,mbfp);
-	if (write_len != 4)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	else
-		status = MB_SUCCESS;
-
-	/* write the record label */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_short(swap, (short) (EM2_SS), (void *) &label);
-		write_len = fwrite(&label,1,2,mbfp);
-		if (write_len != 2)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_WRITE_FAIL;
-			}
-		else
-			status = MB_SUCCESS;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[1];
-		}
-
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_short(swap, (short) (store->sonar), (void *) &label);
-		write_len = fwrite(&label,1,2,mbfp);
-		if (write_len != 2)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_WRITE_FAIL;
-			}
-		else
-			status = MB_SUCCESS;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[0];
-		checksum += uchar_ptr[1];
-		}
-
-	/* output binary header data */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_int(swap, (int) ping->png_ss_date, (void *) &line[0]);
-		mb_put_binary_int(swap, (int) ping->png_ss_msec, (void *) &line[4]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_ss_count, (void *) &line[8]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_ss_serial, (void *) &line[10]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_max_range, (void *) &line[12]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_r_zero, (void *) &line[14]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_r_zero_corr, (void *) &line[16]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_tvg_start, (void *) &line[18]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_tvg_stop, (void *) &line[20]);
-		line[22] = (mb_s_char) ping->png_bsn;
-		line[23] = (mb_s_char) ping->png_bso;
-		mb_put_binary_short(swap, (unsigned short) ping->png_tx, (void *) &line[24]);
-		line[26] = (mb_u_char) ping->png_tvg_crossover;
-		line[27] = (mb_u_char) ping->png_nbeams_ss;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM2_SS_HEADER_SIZE;j++)
-		    checksum += uchar_ptr[j];
-
-		/* write out data */
-		write_len = fwrite(line,1,EM2_SS_HEADER_SIZE,mbfp);
-		if (write_len != EM2_SS_HEADER_SIZE)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* output binary beam data */
-	if (status == MB_SUCCESS)
-	    for (i=0;i<ping->png_nbeams_ss;i++)
-		{
-		line[0] = (mb_u_char) ping->png_beam_index[i];
-		line[1] = (mb_s_char) ping->png_sort_direction[i];
-		mb_put_binary_short(swap, (unsigned short) ping->png_beam_samples[i], (void *) &line[2]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_center_sample[i], (void *) &line[4]);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM2_SS_BEAM_SIZE;j++)
-		    checksum += uchar_ptr[j];
-
-		/* write out data */
-		write_len = fwrite(line,1,EM2_SS_BEAM_SIZE,mbfp);
-		if (write_len != EM2_SS_BEAM_SIZE)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* output sidescan data */
-	if (status == MB_SUCCESS)
-		{
-		write_size = ping->png_npixels + 1 - (ping->png_npixels % 2);
-		if (ping->png_npixels % 2 == 0)
-		    ping->png_ssraw[ping->png_npixels] = 0;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) ping->png_ssraw;
-		for (j=0;j<write_size;j++)
-		    checksum += uchar_ptr[j];
-
-		write_len = fwrite(ping->png_ssraw,1,write_size,mbfp);
-		if (write_len != write_size)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* output end of record */
-	if (status == MB_SUCCESS)
-		{
-		line[1] = 0x03;
-
-		/* set checksum */
-		mb_put_binary_short(swap, (unsigned short) checksum, (void *) &line[2]);
-
-		/* write out data */
-		write_len = fwrite(&line[1],1,3,mbfp);
-		if (write_len != 3)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em300raw_wr_wc(int verbose, FILE *mbfp, int swap,
-		struct mbsys_simrad2_struct *store, int *error)
-{
-	char	*function_name = "mbr_em300raw_wr_wc";
-	int	status = MB_SUCCESS;
-	struct mbsys_simrad2_watercolumn_struct *wc;
-	char	line[EM2_WC_HEADER_SIZE];
-	short	label;
-	int	write_len;
-	int	write_size;
-	unsigned short checksum;
-	mb_u_char   *uchar_ptr;
-	int	record_size;
-	int	pad;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		}
-
-	/* get storage structure */
-	wc = (struct mbsys_simrad2_watercolumn_struct *) store->wc;
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       wtc_date:        %d\n",wc->wtc_date);
-		fprintf(stderr,"dbg5       wtc_msec:        %d\n",wc->wtc_msec);
-		fprintf(stderr,"dbg5       wtc_count:       %d\n",wc->wtc_count);
-		fprintf(stderr,"dbg5       wtc_serial:      %d\n",wc->wtc_serial);
-		fprintf(stderr,"dbg5       wtc_ndatagrams:  %d\n",wc->wtc_ndatagrams);
-		fprintf(stderr,"dbg5       wtc_datagram:    %d\n",wc->wtc_datagram);
-		fprintf(stderr,"dbg5       wtc_ntx:         %d\n",wc->wtc_ntx);
-		fprintf(stderr,"dbg5       wtc_nrx:         %d\n",wc->wtc_nrx);
-		fprintf(stderr,"dbg5       wtc_nbeam:       %d\n",wc->wtc_nbeam);
-		fprintf(stderr,"dbg5       wtc_ssv:         %d\n",wc->wtc_ssv);
-		fprintf(stderr,"dbg5       wtc_sfreq:       %d\n",wc->wtc_sfreq);
-		fprintf(stderr,"dbg5       wtc_heave:       %d\n",wc->wtc_heave);
-		fprintf(stderr,"dbg5       wtc_spare1:      %d\n",wc->wtc_spare1);
-		fprintf(stderr,"dbg5       wtc_spare2:      %d\n",wc->wtc_spare2);
-		fprintf(stderr,"dbg5       wtc_spare3:      %d\n",wc->wtc_spare3);
-		fprintf(stderr,"dbg5       ---------------------------\n");
-		fprintf(stderr,"dbg5       cnt  tilt center sector\n");
-		fprintf(stderr,"dbg5       ---------------------------\n");
-		for (i=0;i<wc->wtc_ntx;i++)
-			fprintf(stderr,"dbg5       %3d %6d %6d %6d\n",
-				i, wc->wtc_txtiltangle[i], wc->wtc_txcenter[i],
-				wc->wtc_txsector[i]);
-		for (i=0;i<wc->wtc_nbeam;i++)
-			{
-			fprintf(stderr,"dbg5       --------------------------------------------------\n");
-			fprintf(stderr,"dbg5       cnt  angle start samples unknown sector beam\n");
-			fprintf(stderr,"dbg5       --------------------------------------------------\n");
-			fprintf(stderr,"dbg5        %4d %3d %2d %4d %4d %4d %4d\n",
-				i, wc->beam[i].wtc_rxpointangle,
-				wc->beam[i].wtc_start_sample,
-				wc->beam[i].wtc_beam_samples,
-				wc->beam[i].wtc_beam_spare,
-				wc->beam[i].wtc_sector,
-				wc->beam[i].wtc_beam);
-/*			fprintf(stderr,"dbg5       --------------------------------------------------\n");
-			fprintf(stderr,"dbg5       beam[%d]: sample amplitude\n",i);
-			fprintf(stderr,"dbg5       --------------------------------------------------\n");
-			for (j=0;j<wc->beam[i].wtc_beam_samples;j++)
-				fprintf(stderr,"dbg5        %4d %4d\n",
-					j, wc->beam[i].wtc_amp[j]);*/
-			}
-		}
-
-	/* zero checksum */
-	checksum = 0;
-
-	/* write the record size */
-	record_size = EM2_WC_HEADER_SIZE
-			+ EM2_WC_BEAM_SIZE * wc->wtc_nbeam
-			+ EM2_WC_TX_SIZE * wc->wtc_ntx + 8;
-	for (i=0;i<wc->wtc_nbeam;i++)
-		{
-		record_size += wc->beam[i].wtc_beam_samples;
-		}
-	pad = (record_size % 2);
-	record_size += pad;
-	mb_put_binary_int(swap, record_size, (void *) &write_size);
-	write_len = fwrite(&write_size,1,4,mbfp);
-	if (write_len != 4)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	else
-		status = MB_SUCCESS;
-
-	/* write the record label */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_short(swap, (short) (EM2_WATERCOLUMN), (void *) &label);
-		write_len = fwrite(&label,1,2,mbfp);
-		if (write_len != 2)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_WRITE_FAIL;
-			}
-		else
-			status = MB_SUCCESS;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[1];
-		}
-
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_short(swap, (short) (store->sonar), (void *) &label);
-		write_len = fwrite(&label,1,2,mbfp);
-		if (write_len != 2)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_WRITE_FAIL;
-			}
-		else
-			status = MB_SUCCESS;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[0];
-		checksum += uchar_ptr[1];
-		}
-
-	/* output binary header data */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_int(swap, (int) wc->wtc_date, (void *) &line[0]);
-		mb_put_binary_int(swap, (int) wc->wtc_msec, (void *) &line[4]);
-		mb_put_binary_short(swap, (unsigned short) wc->wtc_count, (void *) &line[8]);
-		mb_put_binary_short(swap, (unsigned short) wc->wtc_serial, (void *) &line[10]);
-		mb_put_binary_short(swap, (unsigned short) wc->wtc_ndatagrams, (void *) &line[12]);
-		mb_put_binary_short(swap, (unsigned short) wc->wtc_datagram, (void *) &line[14]);
-		mb_put_binary_short(swap, (unsigned short) wc->wtc_ntx, (void *) &line[16]);
-		mb_put_binary_short(swap, (unsigned short) wc->wtc_nrx, (void *) &line[18]);
-		mb_put_binary_short(swap, (unsigned short) wc->wtc_nbeam, (void *) &line[20]);
-		mb_put_binary_short(swap, (unsigned short) wc->wtc_ssv, (void *) &line[22]);
-		mb_put_binary_int(swap, (int) wc->wtc_sfreq, (void *) &line[24]);
-		mb_put_binary_short(swap, (short) wc->wtc_heave, (void *) &line[28]);
-		mb_put_binary_short(swap, (unsigned short) wc->wtc_spare1, (void *) &line[30]);
-		mb_put_binary_short(swap, (unsigned short) wc->wtc_spare2, (void *) &line[32]);
-		mb_put_binary_short(swap, (unsigned short) wc->wtc_spare3, (void *) &line[34]);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM2_WC_HEADER_SIZE;j++)
-		    checksum += uchar_ptr[j];
-
-		/* write out data */
-		write_len = fwrite(line,1,EM2_WC_HEADER_SIZE,mbfp);
-		if (write_len != EM2_WC_HEADER_SIZE)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* output binary beam data */
-	if (status == MB_SUCCESS)
-	    {
-	    for (i=0;i<wc->wtc_ntx;i++)
-		{
-		mb_put_binary_short(swap, (short) wc->wtc_txtiltangle[i], (void *) &line[0]);
-		mb_put_binary_short(swap, (unsigned short) wc->wtc_txcenter[i], (void *) &line[2]);
-		line[4] = (mb_u_char) wc->wtc_txsector[i];
-		line[5] = (mb_u_char) 0;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM2_WC_TX_SIZE;j++)
-		    checksum += uchar_ptr[j];
-
-		/* write out data */
-		write_len = fwrite(line,1,EM2_WC_TX_SIZE,mbfp);
-		if (write_len != EM2_WC_TX_SIZE)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-	    for (i=0;i<wc->wtc_nbeam;i++)
-		{
-		mb_put_binary_short(swap, (short) wc->beam[i].wtc_rxpointangle, (void *) &line[0]);
-		mb_put_binary_short(swap, (unsigned short) wc->beam[i].wtc_start_sample, (void *) &line[2]);
-		mb_put_binary_short(swap, (unsigned short) wc->beam[i].wtc_beam_samples, (void *) &line[4]);
-		mb_put_binary_short(swap, (unsigned short) wc->beam[i].wtc_beam_spare, (void *) &line[6]);
-		line[8] = (mb_u_char) wc->beam[i].wtc_sector;
-		line[9] = (mb_u_char) wc->beam[i].wtc_beam;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM2_WC_BEAM_SIZE;j++)
-		    checksum += uchar_ptr[j];
-
-		/* write out data */
-		write_len = fwrite(line,1,EM2_WC_BEAM_SIZE,mbfp);
-		if (write_len != EM2_WC_BEAM_SIZE)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) wc->beam[i].wtc_amp;
-		for (j=0;j<wc->beam[i].wtc_beam_samples;j++)
-		    checksum += uchar_ptr[j];
-
-		/* write out data */
-		write_len = fwrite(wc->beam[i].wtc_amp,1,wc->beam[i].wtc_beam_samples,mbfp);
-		if (write_len != wc->beam[i].wtc_beam_samples)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-	    }
-
-	/* output end of record */
-	if (status == MB_SUCCESS)
-		{
-		if (pad == 1)
-			{
-			line[0] = 0;
-			checksum += line[0];
-			}
-		line[1] = 0x03;
-
-		/* set checksum */
-		mb_put_binary_short(swap, (unsigned short) checksum, (void *) &line[2]);
-
-		/* write out data */
-		write_len = fwrite(&line[!pad],1,3+pad,mbfp);
-		if (write_len != 3+pad)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mbr_em710mba.c b/src/mbio/mbr_em710mba.c
deleted file mode 100644
index 0348ce8..0000000
--- a/src/mbio/mbr_em710mba.c
+++ /dev/null
@@ -1,10658 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbr_em710mba.c	2/26/2008
- *	$Id: mbr_em710mba.c 2241 2015-05-12 21:00:35Z caress $
- *
- *    Copyright (c) 2008-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbr_em710mba.c contains the functions for reading and writing
- * multibeam data in the EM710MBA format.
- * These functions include:
- *   mbr_alm_em710mba	- allocate read/write memory
- *   mbr_dem_em710mba	- deallocate read/write memory
- *   mbr_rt_em710mba	- read and translate data
- *   mbr_wt_em710mba	- translate and write data
- *
- * Author:	D. W. Caress
- * Date:	February 26, 2008
- *
- * $Log: mbr_em710mba.c,v $
- * Revision 5.3  2009/03/02 18:51:52  caress
- * Fixed problems with formats 58 and 59, and also updated copyright dates in several source files.
- *
- * Revision 5.2  2008/11/16 21:51:18  caress
- * Updating all recent changes, including time lag analysis using mbeditviz and improvements to the mbgrid footprint gridding algorithm.
- *
- * Revision 5.1  2008/07/10 06:41:31  caress
- * Fixed support for EM122
- *
- * Revision 5.0  2008/03/01 09:11:35  caress
- * Added support for Simrad EM710 multibeam in new formats 58 and 59.
- *
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_define.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mbsys_simrad3.h"
-
-/* include for byte swapping */
-#include "mb_swap.h"
-
-/* get NaN detector */
-#if defined(isnanf)
-#define check_fnan(x) isnanf((x))
-#elif defined(isnan)
-#define check_fnan(x) isnan((double)(x))
-#elif HAVE_ISNANF == 1
-#define check_fnan(x) isnanf(x)
-extern int isnanf(float x);
-#elif HAVE_ISNAN == 1
-#define check_fnan(x) isnan((double)(x))
-#elif HAVE_ISNAND == 1
-#define check_fnan(x) isnand((double)(x))
-#else
-#define check_fnan(x) ((x) != (x))
-#endif
-
-/* set precision of iterative raytracing depth & distance matching */
-#define MBR_EM710MBA_BATH_RECALC_PRECISION 0.0001
-#define MBR_EM710MBA_BATH_RECALC_NCALCMAX 50
-#define MBR_EM710MBA_BATH_RECALC_ANGLEMODE 0
-
-/* control method of estimating range and angles for bathymetry recalculation
-	- by default the code solves for the angles and heave offsets that come
-	  close to matching the original reported bathymetry by raytracing through
-	  the original water sound speed model.
-	- if the define below is uncommented, then the code will instead adjust
-	  the angles and ranges to match the original bathymetry - this will
-	  generally achieve bathymetry closer to that reported by the sonar, but
-	  requires modifying the travel times (an unsavory and unsatisfactory
-	  approach). */
-/* #define MBR_EM710MBA_BATH_RECALC_TWEAK_ANGLE_RANGE 1 */
-
-/* turn on debug statements here */
-/* #define MBR_EM710MBA_DEBUG 1 */
-/* #define MBR_EM710MBA_DEBUG2 1 */
-/* #define MBR_EM710MBA_DEBUG3 1 */
-
-/* essential function prototypes */
-int mbr_register_em710mba(int verbose, void *mbio_ptr,
-		int *error);
-int mbr_info_em710mba(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_alm_em710mba(int verbose, void *mbio_ptr, int *error);
-int mbr_dem_em710mba(int verbose, void *mbio_ptr, int *error);
-int mbr_rt_em710mba(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_wt_em710mba(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_em710mba_rd_data(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_em710mba_chk_label(int verbose, void *mbio_ptr, char *label,
-		short *type, short *sonar);
-int mbr_em710mba_rd_status(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store,
-		short type, short sonar, int *goodend, int *error);
-int mbr_em710mba_rd_start(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store,
-		short type, short sonar, int *version, int *num_sonars,
-		int *goodend, int *error);
-int mbr_em710mba_rd_run_parameter(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store,
-		short sonar, int *goodend, int *error);
-int mbr_em710mba_rd_clock(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store,
-		short sonar, int *goodend, int *error);
-int mbr_em710mba_rd_tide(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store,
-		short sonar, int *goodend, int *error);
-int mbr_em710mba_rd_height(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store,
-		short sonar, int *goodend, int *error);
-int mbr_em710mba_rd_heading(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store,
-		short sonar, int *goodend, int *error);
-int mbr_em710mba_rd_ssv(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store,
-		short sonar, int *goodend, int *error);
-int mbr_em710mba_rd_tilt(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store,
-		short sonar, int *goodend, int *error);
-int mbr_em710mba_rd_extraparameters(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store,
-		short sonar, int *goodend, int *error);
-int mbr_em710mba_rd_attitude(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store,
-		short sonar, int *goodend, int *error);
-int mbr_em710mba_rd_netattitude(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store,
-		short sonar, int *goodend, int *error);
-int mbr_em710mba_rd_pos(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store,
-		short sonar, int *goodend, int *error);
-int mbr_em710mba_rd_svp(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store,
-		short sonar, int *goodend, int *error);
-int mbr_em710mba_rd_svp2(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store,
-		short sonar, int *goodend, int *error);
-int mbr_em710mba_rd_bath2(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store,
-		short sonar, int version,
-		int *goodend, int *error);
-int mbr_em710mba_rd_bath2_mba(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store,
-		short sonar, int version,
-		int *goodend, int *error);
-int mbr_em710mba_rd_bath3_mba(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store,
-		short sonar, int version,
-		int *goodend, int *error);
-int mbr_em710mba_rd_rawbeam4(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store,
-		short sonar, int *goodend, int *error);
-int mbr_em710mba_rd_quality(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store,
-		short sonar, int *goodend, int *error);
-int mbr_em710mba_rd_ss2_mba(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store,
-		short sonar,
-		int *goodend, int *error);
-int mbr_em710mba_rd_wc(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store,
-		short sonar, int *goodend, int *error);
-int mbr_em710mba_wr_data(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_em710mba_wr_status(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store, int *error);
-int mbr_em710mba_wr_start(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store, int *error);
-int mbr_em710mba_wr_run_parameter(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store, int *error);
-int mbr_em710mba_wr_clock(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store, int *error);
-int mbr_em710mba_wr_tide(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store, int *error);
-int mbr_em710mba_wr_height(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store, int *error);
-int mbr_em710mba_wr_heading(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store, int *error);
-int mbr_em710mba_wr_ssv(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store, int *error);
-int mbr_em710mba_wr_tilt(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store, int *error);
-int mbr_em710mba_wr_extraparameters(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store, int *error);
-int mbr_em710mba_wr_attitude(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store, int *error);
-int mbr_em710mba_wr_netattitude(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store, int *error);
-int mbr_em710mba_wr_pos(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store, int *error);
-int mbr_em710mba_wr_svp(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store, int *error);
-int mbr_em710mba_wr_svp2(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store, int *error);
-int mbr_em710mba_wr_bath2(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store, int *error);
-int mbr_em710mba_wr_bath3_mba(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store, int *error);
-int mbr_em710mba_wr_rawbeam4(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store, int *error);
-int mbr_em710mba_wr_quality(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store, int *error);
-int mbr_em710mba_wr_ss2_mba(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store, int *error);
-int mbr_em710mba_wr_wc(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store, int *error);
-
-static char rcs_id[]="$Id: mbr_em710mba.c 2241 2015-05-12 21:00:35Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mbr_register_em710mba(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_register_em710mba";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* get mb_io_ptr */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set format info parameters */
-	status = mbr_info_em710mba(verbose,
-			&mb_io_ptr->system,
-			&mb_io_ptr->beams_bath_max,
-			&mb_io_ptr->beams_amp_max,
-			&mb_io_ptr->pixels_ss_max,
-			mb_io_ptr->format_name,
-			mb_io_ptr->system_name,
-			mb_io_ptr->format_description,
-			&mb_io_ptr->numfile,
-			&mb_io_ptr->filetype,
-			&mb_io_ptr->variable_beams,
-			&mb_io_ptr->traveltime,
-			&mb_io_ptr->beam_flagging,
-			&mb_io_ptr->nav_source,
-			&mb_io_ptr->heading_source,
-			&mb_io_ptr->vru_source,
-			&mb_io_ptr->svp_source,
-			&mb_io_ptr->beamwidth_xtrack,
-			&mb_io_ptr->beamwidth_ltrack,
-			error);
-
-	/* set format and system specific function pointers */
-	mb_io_ptr->mb_io_format_alloc = &mbr_alm_em710mba;
-	mb_io_ptr->mb_io_format_free = &mbr_dem_em710mba;
-	mb_io_ptr->mb_io_store_alloc = &mbsys_simrad3_alloc;
-	mb_io_ptr->mb_io_store_free = &mbsys_simrad3_deall;
-	mb_io_ptr->mb_io_read_ping = &mbr_rt_em710mba;
-	mb_io_ptr->mb_io_write_ping = &mbr_wt_em710mba;
-	mb_io_ptr->mb_io_dimensions = &mbsys_simrad3_dimensions;
-	mb_io_ptr->mb_io_pingnumber = &mbsys_simrad3_pingnumber;
-	mb_io_ptr->mb_io_extract = &mbsys_simrad3_extract;
-	mb_io_ptr->mb_io_insert = &mbsys_simrad3_insert;
-	mb_io_ptr->mb_io_extract_nnav = &mbsys_simrad3_extract_nnav;
-	mb_io_ptr->mb_io_extract_nav = &mbsys_simrad3_extract_nav;
-	mb_io_ptr->mb_io_insert_nav = &mbsys_simrad3_insert_nav;
-	mb_io_ptr->mb_io_extract_altitude = &mbsys_simrad3_extract_altitude;
-	mb_io_ptr->mb_io_insert_altitude = NULL;
-	mb_io_ptr->mb_io_extract_svp = &mbsys_simrad3_extract_svp;
-	mb_io_ptr->mb_io_insert_svp = &mbsys_simrad3_insert_svp;
-	mb_io_ptr->mb_io_ttimes = &mbsys_simrad3_ttimes;
-	mb_io_ptr->mb_io_detects = &mbsys_simrad3_detects;
-	mb_io_ptr->mb_io_pulses = &mbsys_simrad3_pulses;
-	mb_io_ptr->mb_io_gains = &mbsys_simrad3_gains;
-	mb_io_ptr->mb_io_copyrecord = &mbsys_simrad3_copy;
-	mb_io_ptr->mb_io_extract_rawss = NULL;
-	mb_io_ptr->mb_io_insert_rawss = NULL;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",mb_io_ptr->system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",mb_io_ptr->beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",mb_io_ptr->beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",mb_io_ptr->pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",mb_io_ptr->format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",mb_io_ptr->system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",mb_io_ptr->format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",mb_io_ptr->numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",mb_io_ptr->filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",mb_io_ptr->variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",mb_io_ptr->traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",mb_io_ptr->beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",mb_io_ptr->nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",mb_io_ptr->heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",mb_io_ptr->vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",mb_io_ptr->svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",mb_io_ptr->beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",mb_io_ptr->beamwidth_ltrack);
-		fprintf(stderr,"dbg2       format_alloc:       %p\n",(void *)mb_io_ptr->mb_io_format_alloc);
-		fprintf(stderr,"dbg2       format_free:        %p\n",(void *)mb_io_ptr->mb_io_format_free);
-		fprintf(stderr,"dbg2       store_alloc:        %p\n",(void *)mb_io_ptr->mb_io_store_alloc);
-		fprintf(stderr,"dbg2       store_free:         %p\n",(void *)mb_io_ptr->mb_io_store_free);
-		fprintf(stderr,"dbg2       read_ping:          %p\n",(void *)mb_io_ptr->mb_io_read_ping);
-		fprintf(stderr,"dbg2       write_ping:         %p\n",(void *)mb_io_ptr->mb_io_write_ping);
-		fprintf(stderr,"dbg2       extract:            %p\n",(void *)mb_io_ptr->mb_io_extract);
-		fprintf(stderr,"dbg2       insert:             %p\n",(void *)mb_io_ptr->mb_io_insert);
-		fprintf(stderr,"dbg2       extract_nav:        %p\n",(void *)mb_io_ptr->mb_io_extract_nav);
-		fprintf(stderr,"dbg2       insert_nav:         %p\n",(void *)mb_io_ptr->mb_io_insert_nav);
-		fprintf(stderr,"dbg2       extract_altitude:   %p\n",(void *)mb_io_ptr->mb_io_extract_altitude);
-		fprintf(stderr,"dbg2       insert_altitude:    %p\n",(void *)mb_io_ptr->mb_io_insert_altitude);
-		fprintf(stderr,"dbg2       extract_svp:        %p\n",(void *)mb_io_ptr->mb_io_extract_svp);
-		fprintf(stderr,"dbg2       insert_svp:         %p\n",(void *)mb_io_ptr->mb_io_insert_svp);
-		fprintf(stderr,"dbg2       ttimes:             %p\n",(void *)mb_io_ptr->mb_io_ttimes);
-		fprintf(stderr,"dbg2       detects:            %p\n",(void *)mb_io_ptr->mb_io_detects);
-		fprintf(stderr,"dbg2       pulses:             %p\n",(void *)mb_io_ptr->mb_io_pulses);
-		fprintf(stderr,"dbg2       extract_rawss:      %p\n",(void *)mb_io_ptr->mb_io_extract_rawss);
-		fprintf(stderr,"dbg2       insert_rawss:       %p\n",(void *)mb_io_ptr->mb_io_insert_rawss);
-		fprintf(stderr,"dbg2       copyrecord:         %p\n",(void *)mb_io_ptr->mb_io_copyrecord);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbr_info_em710mba(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error)
-{
-	char	*function_name = "mbr_info_em710mba";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* set format info parameters */
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-	*system = MB_SYS_SIMRAD3;
-	*beams_bath_max = 400;
-	*beams_amp_max = 400;
-	*pixels_ss_max = 1024;
-	strncpy(format_name, "EM710MBA", MB_NAME_LENGTH);
-	strncpy(system_name, "SIMRAD3", MB_NAME_LENGTH);
-	strncpy(format_description, "Format name:          MBF_EM710MBA\nInformal Description: Kongsberg current multibeam vendor format\nAttributes:           Kongsberg EM122, EM302, EM710,\n                      bathymetry, amplitude, and sidescan,\n                      up to 400 beams, variable pixels, binary, Kongsberg.\n", MB_DESCRIPTION_LENGTH);
-	*numfile = 1;
-	*filetype = MB_FILETYPE_SINGLE;
-	*variable_beams = MB_YES;
-	*traveltime = MB_YES;
-	*beam_flagging = MB_YES;
-	*nav_source = MB_DATA_DATA;
-	*heading_source = MB_DATA_DATA;
-	*vru_source = MB_DATA_DATA;
-	*svp_source = MB_DATA_VELOCITY_PROFILE;
-	*beamwidth_xtrack = 2.0;
-	*beamwidth_ltrack = 2.0;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",*system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",*beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",*beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",*pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",*numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",*filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",*variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",*traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",*beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",*nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",*heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",*vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",*svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",*beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",*beamwidth_ltrack);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_alm_em710mba(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_alm_em710mba";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	int	*databyteswapped;
-	double	*pixel_size;
-	double	*swath_width;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set initial status */
-	status = MB_SUCCESS;
-
-	/* allocate memory for data structure */
-	mb_io_ptr->structure_size = 0;
-	mb_io_ptr->data_structure_size = 0;
-	status = mbsys_simrad3_alloc(
-			verbose,mbio_ptr,
-			&mb_io_ptr->store_data,error);
-
-	/* initialize saved values */
-	databyteswapped = (int *) &mb_io_ptr->save1;
-	pixel_size = &mb_io_ptr->saved1;
-	swath_width = &mb_io_ptr->saved2;
-	*databyteswapped = -1;
-	*pixel_size = 0.0;
-	*swath_width = 0.0;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_dem_em710mba(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_dem_em710mba";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointers to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* deallocate old raytracing structure if it exists */
-	if (mb_io_ptr->saveptr1 != NULL)
-		{
-		status = mb_rt_deall(verbose, &(mb_io_ptr->saveptr1), error);
-		}
-
-	/* deallocate memory for data descriptor */
-	status = mbsys_simrad3_deall(
-			verbose,mbio_ptr,
-			&mb_io_ptr->store_data,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_rt_em710mba(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_rt_em710mba";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_simrad3_struct *store;
-	struct mbsys_simrad3_attitude_struct *attitude;
-	struct mbsys_simrad3_netattitude_struct *netattitude;
-	struct mbsys_simrad3_heading_struct *heading;
-	struct mbsys_simrad3_ssv_struct *ssv;
-	struct mbsys_simrad3_ping_struct *ping;
-	int	time_i[7];
-	double	ntime_d, btime_d;
-	double	bath_time_d, ss_time_d;
-	double	roll, pitch, heave;
-	double	*pixel_size, *swath_width;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointers to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* read next data from file */
-	status = mbr_em710mba_rd_data(verbose,mbio_ptr,store_ptr,error);
-
-	/* get pointers to data structures */
-	store = (struct mbsys_simrad3_struct *) store_ptr;
-	ping = (struct mbsys_simrad3_ping_struct *) &(store->pings[store->ping_index]);
-	attitude = (struct mbsys_simrad3_attitude_struct *) store->attitude;
-	netattitude = (struct mbsys_simrad3_netattitude_struct *) store->netattitude;
-	heading = (struct mbsys_simrad3_heading_struct *) store->heading;
-	ssv = (struct mbsys_simrad3_ssv_struct *) store->ssv;
-	pixel_size = (double *) &mb_io_ptr->saved1;
-	swath_width = (double *) &mb_io_ptr->saved2;
-
-	/* save position, heading, attitude, sonar depth if survey data */
-	if (status == MB_SUCCESS
-		&& store->kind == MB_DATA_DATA)
-		{
-		/* get ping time */
-		time_i[0] = ping->png_date / 10000;
-		time_i[1] = (ping->png_date % 10000) / 100;
-		time_i[2] = ping->png_date % 100;
-		time_i[3] = ping->png_msec / 3600000;
-		time_i[4] = (ping->png_msec % 3600000) / 60000;
-		time_i[5] = (ping->png_msec % 60000) / 1000;
-		time_i[6] = (ping->png_msec % 1000) * 1000;
-		mb_get_time(verbose, time_i, &btime_d);
-
-		if (ping->png_longitude != EM3_INVALID_INT
-			&& ping->png_latitude != EM3_INVALID_INT)
-			mb_navint_add(verbose, mbio_ptr,
-				btime_d,
-				(double)(0.0000001 * ping->png_longitude),
-				(double)(0.00000005 * ping->png_latitude),
-				error);
-		mb_hedint_add(verbose, mbio_ptr,
-				btime_d, 0.01 * ping->png_heading,
-				error);
-		mb_attint_add(verbose, mbio_ptr,
-				btime_d, 0.01 * ping->png_heave,
-				0.01 * ping->png_roll, 0.01 * ping->png_pitch,
-				error);
-		mb_depint_add(verbose, mbio_ptr,
-				btime_d,(double)ping->png_xducer_depth,
-				error);
-
-		}
-
-	/* interpolate attitude data into navigation records */
-	if (status == MB_SUCCESS
-		&& (store->kind == MB_DATA_NAV
-			|| store->kind == MB_DATA_NAV1
-			|| store->kind == MB_DATA_NAV2
-			|| store->kind == MB_DATA_NAV3))
-		{
-		/* get nav time */
-		time_i[0] = store->pos_date / 10000;
-		time_i[1] = (store->pos_date % 10000) / 100;
-		time_i[2] = store->pos_date % 100;
-		time_i[3] = store->pos_msec / 3600000;
-		time_i[4] = (store->pos_msec % 3600000) / 60000;
-		time_i[5] = (store->pos_msec % 60000) / 1000;
-		time_i[6] = (store->pos_msec % 1000) * 1000;
-		mb_get_time(verbose, time_i, &ntime_d);
-
-		/* interpolate from saved attitude */
-		mb_attint_interp(verbose, mbio_ptr, ntime_d,
-				    &heave, &roll, &pitch, error);
-		store->pos_roll = (int) rint(roll / 0.01);
-		store->pos_pitch = (int) rint(pitch / 0.01);
-		store->pos_heave = (int) rint(heave / 0.01);
-		}
-
-	/* if no sidescan read then zero sidescan data */
-	if (status == MB_SUCCESS
-		&& store->kind == MB_DATA_DATA
-		&& ping->png_ss_read == MB_NO)
-		{
-		status = mbsys_simrad3_zero_ss(verbose,store_ptr,error);
-		}
-
-	/* else check that bath and sidescan data record time stamps
-	   match for survey data - we can have bath without
-	   sidescan but not sidescan without bath */
-	else if (status == MB_SUCCESS
-		&& store->kind == MB_DATA_DATA)
-		{
-		/* get times of bath and sidescan records */
-		time_i[0] = ping->png_date / 10000;
-		time_i[1] = (ping->png_date % 10000) / 100;
-		time_i[2] = ping->png_date % 100;
-		time_i[3] = ping->png_msec / 3600000;
-		time_i[4] = (ping->png_msec % 3600000) / 60000;
-		time_i[5] = (ping->png_msec % 60000) / 1000;
-		time_i[6] = (ping->png_msec % 1000) * 1000;
-		mb_get_time(verbose, time_i, &bath_time_d);
-		time_i[0] = ping->png_ss_date / 10000;
-		time_i[1] = (ping->png_ss_date % 10000) / 100;
-		time_i[2] = ping->png_ss_date % 100;
-		time_i[3] = ping->png_ss_msec / 3600000;
-		time_i[4] = (ping->png_ss_msec % 3600000) / 60000;
-		time_i[5] = (ping->png_ss_msec % 60000) / 1000;
-		time_i[6] = (ping->png_ss_msec % 1000) * 1000;
-		mb_get_time(verbose, time_i, &ss_time_d);
-/* fprintf(stderr,"Check: png_count:%d png_raw_count:%d png_ss_count:%d    Beams:%d %d %d\n",
-ping->png_count,ping->png_raw_count,ping->png_ss_count,ping->png_nbeams,ping->png_raw_nbeams,ping->png_nbeams_ss);*/
-
-		/* check for time match - if bath newer than
-		   sidescan then zero sidescan,  if sidescan
-		   newer than bath then set error,  if ok then
-		   check that beam ids are the same */
-		if (ping->png_ss_date == 0
-			|| ping->png_nbeams_ss == 0
-			|| bath_time_d > ss_time_d)
-		    {
-		    status = mbsys_simrad3_zero_ss(verbose,store_ptr,error);
-		    }
-		else if (bath_time_d > ss_time_d)
-		    {
-		    if (verbose > 0)
-		    	fprintf(stderr,"%s: %4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d Sidescan zeroed, bathtime:%f >  sstime:%f\n",
-				function_name, time_i[0], time_i[1], time_i[2],
-					time_i[3], time_i[4], time_i[5], time_i[6],
-					bath_time_d, ss_time_d);
-		    status = mbsys_simrad3_zero_ss(verbose,store_ptr,error);
-		    }
-		else if (bath_time_d < ss_time_d)
-		    {
-		    if (verbose > 0)
-		    	fprintf(stderr,"%s: %4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d Ping unintelligible bathtime:%f < sstime%f\n",
-				function_name, time_i[0], time_i[1], time_i[2],
-					time_i[3], time_i[4], time_i[5], time_i[6],
-					bath_time_d, ss_time_d);
-		    *error = MB_ERROR_UNINTELLIGIBLE;
-		    status = MB_FAILURE;
-		    }
-		else
-		    {
-		    /* check for some indicators of broken records */
-		    if (ping->png_nbeams < ping->png_nbeams_ss
-			|| ping->png_nbeams > ping->png_nbeams_ss + 1)
-			{
-		    	if (verbose > 1)
-			    	fprintf(stderr,"%s: %4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d Sidescan ignored: num bath beams != num ss beams: %d %d\n",
-					function_name, time_i[0], time_i[1], time_i[2],
-					time_i[3], time_i[4], time_i[5], time_i[6],
-					ping->png_nbeams, ping->png_nbeams_ss);
-			}
-		    }
-		}
-
-	/* set error and kind in mb_io_ptr */
-	mb_io_ptr->new_error = *error;
-	mb_io_ptr->new_kind = store->kind;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_wt_em710mba(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_wt_em710mba";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_simrad3_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_simrad3_struct *) store_ptr;
-
-	/* write next data to file */
-	status = mbr_em710mba_wr_data(verbose,mbio_ptr,store_ptr,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em710mba_rd_data(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_em710mba_rd_data";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_simrad3_struct *store;
-	FILE	*mbfp;
-	int	swap = -1;
-	int	done;
-	int	*databyteswapped;
-	int	record_size;
-	int	*record_size_save;
-	int	bytes_read;
-	char	*label;
-	int	*label_save_flag;
-	char	*record_size_char;
-	short	type;
-	short	sonar;
-	int	*version;
-	short	*typelast;
-	short	*sonarlast;
-	int	*nbadrec;
-	int	good_end_bytes;
-	size_t	read_len;
-	int	skip = 0;
-	int	*num_sonars;
-	char	junk;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_simrad3_struct *) store_ptr;
-	mbfp = mb_io_ptr->mbfp;
-
-	/* get saved values */
-	databyteswapped = (int *) &mb_io_ptr->save1;
-	record_size_save = (int *) &mb_io_ptr->save2;
-	label = (char *) mb_io_ptr->save_label;
-	version = (int *) (&mb_io_ptr->save3);
-	label_save_flag = (int *) &mb_io_ptr->save_label_flag;
-	typelast = (short *) &mb_io_ptr->save6;
-	sonarlast = (short *) &mb_io_ptr->save7;
-	nbadrec = (int *) &mb_io_ptr->save8;
-	num_sonars = (int *) &mb_io_ptr->save10;
-	record_size_char = (char *) &record_size;
-
-	/* set file position */
-	mb_io_ptr->file_pos = mb_io_ptr->file_bytes;
-
-	/* set flag to swap bytes if necessary */
-	swap =  *databyteswapped;
-	
-	/* if a ping structure was previously flagged as complete then reset the structure to empty */
-	for (i=0;i<MBSYS_SIMRAD3_NUM_PING_STRUCTURES;i++)
-		{
-		if (store->pings[i].read_status == MBSYS_SIMRAD3_PING_COMPLETE)
-			{
-			store->pings[i].read_status = MBSYS_SIMRAD3_PING_NO_DATA;
-			store->pings[i].png_bath_read = MB_NO;
-			store->pings[i].png_raw_read = MB_NO;
-			store->pings[i].png_quality_read = MB_NO;
-			store->pings[i].png_ss_read = MB_NO;
-			}
-		}
-
-	/* loop over reading data until a record is ready for return */
-	done = MB_NO;
-	*error = MB_ERROR_NO_ERROR;
-	while (done == MB_NO)
-		{
-#ifdef MBR_EM710MBA_DEBUG
-	fprintf(stderr,"\nabove mbr_em710mba_rd_data loop:\n");
-	fprintf(stderr,"label_save_flag:%d status:%d\n",*label_save_flag,status);
-#endif
-		/* if no label saved get next record label */
-		if (*label_save_flag == MB_NO)
-			{
-			/* read four byte record size */
-			read_len = 4;
-			status = mb_fileio_get(verbose, mbio_ptr, (char *)&record_size, &read_len, error);
-#ifdef MBR_EM710MBA_DEBUG
-	fprintf(stderr,"read record size:%d status:%d\n",record_size,status);
-#endif
-
-			/* read label */
-			read_len = 4;
-			status = mb_fileio_get(verbose, mbio_ptr, (char *)label, &read_len, error);
-
-			/* check label - if not a good label read a byte
-				at a time until a good label is found */
-			skip = 0;
-#ifdef MBR_EM710MBA_DEBUG
-	fprintf(stderr,"read label:%x%x%x%x skip:%d status:%d\n",label[0],label[1],label[2],label[3],skip,status);
-#endif
-			while (status == MB_SUCCESS
-				&& mbr_em710mba_chk_label(verbose,
-					mbio_ptr, label, &type, &sonar) != MB_SUCCESS)
-			    {
-			    /* get next byte */
-			    for (i=0;i<3;i++)
-				record_size_char[i] = record_size_char[i+1];
-			    record_size_char[3] = label[0];
-			    for (i=0;i<3;i++)
-				label[i] = label[i+1];
-			    read_len = 1;
-			    status = mb_fileio_get(verbose, mbio_ptr, (char *)(&label[3]), &read_len, error);
-			    skip++;
-#ifdef MBR_EM710MBA_DEBUG
-	fprintf(stderr,"read label:%x%x%x%x skip:%d status:%d\n",label[0],label[1],label[2],label[3],skip,status);
-#endif
-			    }
-
-			/* report problem */
-			if (skip > 0 && verbose > 0)
-			    {
-			    if (*nbadrec == 0)
-			    	fprintf(stderr,
-"\nThe MBF_EM710MBA module skipped data between identified\n\
-data records. Something is broken, most probably the data...\n\
-However, the data may include a data record type that we\n\
-haven't seen yet, or there could be an error in the code.\n\
-If skipped data are reported multiple times, \n\
-we recommend you send a data sample and problem \n\
-description to the MB-System team \n\
-(caress at mbari.org and dale at ldeo.columbia.edu)\n\
-Have a nice day...\n");
-				fprintf(stderr,
-						"MBF_EM710MBA skipped %d bytes between records %4.4hX:%d and %4.4hX:%d\n",
-						skip, *typelast, *typelast, type, type);
-				(*nbadrec)++;
-			    }
-			*typelast = type;
-			*sonarlast = sonar;
-
-			/* set flag to swap bytes if necessary */
-			swap = *databyteswapped;
-
-			/* get record_size */
-			if (*databyteswapped != mb_io_ptr->byteswapped)
-				record_size = mb_swap_int(record_size);
-			*record_size_save = record_size;
-			}
-
-		/* else use saved label */
-		else
-			{
-			*label_save_flag = MB_NO;
-			type = *typelast;
-			sonar = *sonarlast;
-			record_size = *record_size_save;
-#ifdef MBR_EM710MBA_DEBUG
-	fprintf(stderr,"use previously read label:%x%x%x%x skip:%d status:%d\n",label[0],label[1],label[2],label[3],skip,status);
-#endif
-			}
-
-#ifdef MBR_EM710MBA_DEBUG
-	fprintf(stderr,"\nstart of mbr_em710mba_rd_data loop:\n");
-	fprintf(stderr,"skip:%d type:%x sonar:%d recsize:%u done:%d\n",
-		skip, type, sonar, *record_size_save, done);
-#endif
-#ifdef MBR_EM710MBA_DEBUG3
-	if (skip > 0)
-	fprintf(stderr,"SKIPPED BYTES: %d\n", skip);
-	fprintf(stderr,"type:%x sonar:%d recsize:%u done:%d   ",
-	type, sonar, *record_size_save, done);
-#endif
-
-		/* allocate secondary data structure for
-			extraparameters data if needed */
-		if (status == MB_SUCCESS &&
-			(type == EM3_EXTRAPARAMETERS)
-			&& store->extraparameters == NULL)
-			{
-			status = mbsys_simrad3_extraparameters_alloc(
-					verbose,mbio_ptr,
-					store_ptr,error);
-			}
-
-		/* allocate secondary data structure for
-			heading data if needed */
-		if (status == MB_SUCCESS &&
-			(type == EM3_HEADING)
-			&& store->heading == NULL)
-			{
-			status = mbsys_simrad3_heading_alloc(
-					verbose,mbio_ptr,
-					store_ptr,error);
-			}
-
-		/* allocate secondary data structure for
-			attitude data if needed */
-		if (status == MB_SUCCESS &&
-			(type == EM3_ATTITUDE)
-			&& store->attitude == NULL)
-			{
-			status = mbsys_simrad3_attitude_alloc(
-					verbose,mbio_ptr,
-					store_ptr,error);
-			}
-
-		/* allocate secondary data structure for
-			netattitude data if needed */
-		if (status == MB_SUCCESS &&
-			(type == EM3_NETATTITUDE)
-			&& store->netattitude == NULL)
-			{
-			status = mbsys_simrad3_netattitude_alloc(
-					verbose,mbio_ptr,
-					store_ptr,error);
-			}
-
-		/* allocate secondary data structure for
-			ssv data if needed */
-		if (status == MB_SUCCESS &&
-			(type == EM3_SSV)
-			&& store->ssv == NULL)
-			{
-			status = mbsys_simrad3_ssv_alloc(
-					verbose,mbio_ptr,
-					store_ptr,error);
-			}
-
-		/* allocate secondary data structure for
-			tilt data if needed */
-		if (status == MB_SUCCESS &&
-			(type == EM3_TILT)
-			&& store->tilt == NULL)
-			{
-			status = mbsys_simrad3_tilt_alloc(
-					verbose,mbio_ptr,
-					store_ptr,error);
-			}
-
-		/* allocate secondary data structure for
-			water column data if needed */
-		if (status == MB_SUCCESS &&
-			(type == EM3_WATERCOLUMN))
-			{
-			if (store->wc == NULL)
-			    status = mbsys_simrad3_wc_alloc(
-					verbose,mbio_ptr,
-					store_ptr,error);
-			}
-
-		/* read the appropriate data records */
-		if (status == MB_FAILURE)
-			{
-#ifdef MBR_EM710MBA_DEBUG
-	fprintf(stderr,"call nothing, read failure\n");
-#endif
-			done = MB_YES;
-			record_size = 0;
-			*record_size_save = record_size;
-			}
-		else if (type !=  EM3_PU_ID
-			&& type != EM3_PU_STATUS
-			&& type != EM3_PU_BIST
-			&& type != EM3_EXTRAPARAMETERS
-			&& type != EM3_ATTITUDE
-			&& type != EM3_CLOCK
-			&& type != EM3_BATH
-			&& type != EM3_SBDEPTH
-			&& type != EM3_RAWBEAM
-			&& type != EM3_SSV
-			&& type != EM3_HEADING
-			&& type != EM3_START
-			&& type != EM3_TILT
-			&& type != EM3_CBECHO
-			&& type != EM3_RAWBEAM4
-			&& type != EM3_QUALITY
-			&& type != EM3_POS
-			&& type != EM3_RUN_PARAMETER
-			&& type != EM3_SS
-			&& type != EM3_TIDE
-			&& type != EM3_SVP2
-			&& type != EM3_SVP
-			&& type != EM3_SSPINPUT
-			&& type != EM3_BATH2
-			&& type != EM3_SS2
-			&& type != EM3_RAWBEAM2
-			&& type != EM3_RAWBEAM3
-			&& type != EM3_HEIGHT
-			&& type != EM3_STOP
-			&& type != EM3_WATERCOLUMN
-			&& type != EM3_NETATTITUDE
-			&& type != EM3_REMOTE
-			&& type != EM3_SSP
-			&& type != EM3_BATH_MBA
-			&& type != EM3_SS_MBA
-			&& type != EM3_BATH2_MBA
-			&& type != EM3_SS2_MBA
-			&& type != EM3_BATH3_MBA)
-			{
-#ifdef MBR_EM710MBA_DEBUG
-	fprintf(stderr,"call nothing, try again\n");
-#endif
-			done = MB_NO;
-			}
-		else if (type == EM3_PU_STATUS)
-			{
-#ifdef MBR_EM710MBA_DEBUG
-	fprintf(stderr,"call mbr_em710mba_rd_status type %x\n",type);
-#endif
-
-			status = mbr_em710mba_rd_status(
-				verbose,mbio_ptr,swap,store,type,sonar,&good_end_bytes,error);
-			if (status == MB_SUCCESS)
-				{
-				done = MB_YES;
-				}
-#ifdef MBR_EM710MBA_DEBUG3
-	fprintf(stderr,"mbr_em710mba_rd_status\n");
-#endif
-			}
-		else if (type == EM3_START
-			|| type == EM3_STOP)
-			{
-#ifdef MBR_EM710MBA_DEBUG
-	fprintf(stderr,"call mbr_em710mba_rd_start type %x\n",type);
-#endif
-			status = mbr_em710mba_rd_start(
-				verbose,mbio_ptr,swap,store,type,sonar,version,num_sonars,&good_end_bytes,error);
-			if (status == MB_SUCCESS)
-				{
-				done = MB_YES;
-				}
-#ifdef MBR_EM710MBA_DEBUG3
-	fprintf(stderr,"mbr_em710mba_rd_start\n");
-#endif
-			}
-		else if (type == EM3_RUN_PARAMETER)
-			{
-#ifdef MBR_EM710MBA_DEBUG
-	fprintf(stderr,"call mbr_em710mba_rd_run_parameter type %x\n",type);
-#endif
-			status = mbr_em710mba_rd_run_parameter(
-				verbose,mbio_ptr,swap,store,sonar,&good_end_bytes,error);
-			if (status == MB_SUCCESS)
-				{
-				done = MB_YES;
-				}
-#ifdef MBR_EM710MBA_DEBUG3
-	fprintf(stderr,"mbr_em710mba_rd_run_parameter\n");
-#endif
-			}
-		else if (type == EM3_CLOCK)
-			{
-#ifdef MBR_EM710MBA_DEBUG
-	fprintf(stderr,"call mbr_em710mba_rd_clock type %x\n",type);
-#endif
-			status = mbr_em710mba_rd_clock(
-				verbose,mbio_ptr,swap,store,sonar,&good_end_bytes,error);
-			if (status == MB_SUCCESS)
-				{
-				done = MB_YES;
-				}
-#ifdef MBR_EM710MBA_DEBUG3
-	fprintf(stderr,"mbr_em710mba_rd_clock\n");
-#endif
-			}
-		else if (type == EM3_TIDE)
-			{
-#ifdef MBR_EM710MBA_DEBUG
-	fprintf(stderr,"call mbr_em710mba_rd_tide type %x\n",type);
-#endif
-			status = mbr_em710mba_rd_tide(
-				verbose,mbio_ptr,swap,store,sonar,&good_end_bytes,error);
-			if (status == MB_SUCCESS)
-				{
-				done = MB_YES;
-				}
-#ifdef MBR_EM710MBA_DEBUG3
-	fprintf(stderr,"mbr_em710mba_rd_tide\n");
-#endif
-			}
-		else if (type == EM3_HEIGHT)
-			{
-#ifdef MBR_EM710MBA_DEBUG
-	fprintf(stderr,"call mbr_em710mba_rd_height type %x\n",type);
-#endif
-			status = mbr_em710mba_rd_height(
-				verbose,mbio_ptr,swap,store,sonar,&good_end_bytes,error);
-			if (status == MB_SUCCESS)
-				{
-				done = MB_YES;
-				}
-#ifdef MBR_EM710MBA_DEBUG3
-	fprintf(stderr,"mbr_em710mba_rd_height\n");
-#endif
-			}
-		else if (type == EM3_HEADING)
-			{
-#ifdef MBR_EM710MBA_DEBUG
-	fprintf(stderr,"call mbr_em710mba_rd_heading type %x\n",type);
-#endif
-			status = mbr_em710mba_rd_heading(
-				verbose,mbio_ptr,swap,store,sonar,&good_end_bytes,error);
-			if (status == MB_SUCCESS)
-				{
-				done = MB_YES;
-				}
-#ifdef MBR_EM710MBA_DEBUG3
-	fprintf(stderr,"mbr_em710mba_rd_heading\n");
-#endif
-			}
-		else if (type == EM3_SSV)
-			{
-#ifdef MBR_EM710MBA_DEBUG
-	fprintf(stderr,"call mbr_em710mba_rd_ssv type %x\n",type);
-#endif
-			status = mbr_em710mba_rd_ssv(
-				verbose,mbio_ptr,swap,store,sonar,&good_end_bytes,error);
-			if (status == MB_SUCCESS)
-				{
-				done = MB_YES;
-				}
-#ifdef MBR_EM710MBA_DEBUG3
-	fprintf(stderr,"mbr_em710mba_rd_ssv\n");
-#endif
-			}
-		else if (type == EM3_TILT)
-			{
-#ifdef MBR_EM710MBA_DEBUG
-	fprintf(stderr,"call mbr_em710mba_rd_tilt type %x\n",type);
-#endif
-			status = mbr_em710mba_rd_tilt(
-				verbose,mbio_ptr,swap,store,sonar,&good_end_bytes,error);
-			if (status == MB_SUCCESS)
-				{
-				done = MB_YES;
-				}
-#ifdef MBR_EM710MBA_DEBUG3
-	fprintf(stderr,"mbr_em710mba_rd_tilt\n");
-#endif
-			}
-		else if (type == EM3_EXTRAPARAMETERS)
-			{
-#ifdef MBR_EM710MBA_DEBUG
-	fprintf(stderr,"call mbr_em710mba_rd_extraparameters type %x\n",type);
-#endif
-			status = mbr_em710mba_rd_extraparameters(
-				verbose,mbio_ptr,swap,store,sonar,&good_end_bytes,error);
-			if (status == MB_SUCCESS)
-				{
-				done = MB_YES;
-				}
-#ifdef MBR_EM710MBA_DEBUG3
-	fprintf(stderr,"mbr_em710mba_rd_extraparameters\n");
-#endif
-			}
-		else if (type == EM3_ATTITUDE)
-			{
-#ifdef MBR_EM710MBA_DEBUG
-	fprintf(stderr,"call mbr_em710mba_rd_attitude type %x\n",type);
-#endif
-			status = mbr_em710mba_rd_attitude(
-				verbose,mbio_ptr,swap,store,sonar,&good_end_bytes,error);
-			if (status == MB_SUCCESS)
-				{
-				done = MB_YES;
-				}
-#ifdef MBR_EM710MBA_DEBUG3
-	fprintf(stderr,"mbr_em710mba_rd_attitude\n");
-#endif
-			}
-		else if (type == EM3_NETATTITUDE)
-			{
-#ifdef MBR_EM710MBA_DEBUG
-	fprintf(stderr,"call mbr_em710mba_rd_netattitude type %x\n",type);
-#endif
-			status = mbr_em710mba_rd_netattitude(
-				verbose,mbio_ptr,swap,store,sonar,&good_end_bytes,error);
-			if (status == MB_SUCCESS)
-				{
-				done = MB_YES;
-				}
-#ifdef MBR_EM710MBA_DEBUG3
-	fprintf(stderr,"mbr_em710mba_rd_netattitude\n");
-#endif
-			}
-		else if (type == EM3_POS)
-			{
-#ifdef MBR_EM710MBA_DEBUG
-	fprintf(stderr,"call mbr_em710mba_rd_pos type %x\n",type);
-#endif
-			status = mbr_em710mba_rd_pos(
-				verbose,mbio_ptr,swap,store,sonar,&good_end_bytes,error);
-			if (status == MB_SUCCESS)
-				{
-				done = MB_YES;
-				}
-#ifdef MBR_EM710MBA_DEBUG3
-	fprintf(stderr,"mbr_em710mba_rd_pos\n");
-#endif
-			}
-		else if (type == EM3_SVP)
-			{
-#ifdef MBR_EM710MBA_DEBUG
-	fprintf(stderr,"call mbr_em710mba_rd_svp type %x\n",type);
-#endif
-			status = mbr_em710mba_rd_svp(
-				verbose,mbio_ptr,swap,store,sonar,&good_end_bytes,error);
-			if (status == MB_SUCCESS)
-				{
-				done = MB_YES;
-				}
-#ifdef MBR_EM710MBA_DEBUG3
-	fprintf(stderr,"mbr_em710mba_rd_svp\n");
-#endif
-			}
-		else if (type == EM3_SVP2)
-			{
-#ifdef MBR_EM710MBA_DEBUG
-	fprintf(stderr,"call mbr_em710mba_rd_svp2 type %x\n",type);
-#endif
-			status = mbr_em710mba_rd_svp2(
-				verbose,mbio_ptr,swap,store,sonar,&good_end_bytes,error);
-			if (status == MB_SUCCESS)
-				{
-				done = MB_YES;
-				}
-#ifdef MBR_EM710MBA_DEBUG3
-	fprintf(stderr,"mbr_em710mba_rd_svp2\n");
-#endif
-			}
-		else if (type == EM3_BATH2)
-			{
-#ifdef MBR_EM710MBA_DEBUG
-	fprintf(stderr,"call mbr_em710mba_rd_bath2 type %x\n",type);
-#endif
-			status = mbr_em710mba_rd_bath2(
-				verbose,mbio_ptr,swap,store,sonar,*version,&good_end_bytes,error);
-			if (status == MB_SUCCESS)
-				{
-				store->pings[store->ping_index].read_status = MBSYS_SIMRAD3_PING_PARTIAL;
-				store->pings[store->ping_index].png_bath_read = MB_YES;
-				done = MB_NO;
-				}
-			if (status == MB_SUCCESS && sonar == MBSYS_SIMRAD3_M3)
-				{
-				if (store->pings[store->ping_index].png_bath_read == MB_YES
-					&& store->pings[store->ping_index].png_raw_read == MB_YES
-					&& store->pings[store->ping_index].png_count == store->pings[store->ping_index].png_raw_count)
-					{
-					store->pings[store->ping_index].read_status = MBSYS_SIMRAD3_PING_COMPLETE;
-					done = MB_YES;
-					}
-				}
-			else if (status == MB_SUCCESS)
-				{
-				if (store->pings[store->ping_index].png_bath_read == MB_YES
-					&& store->pings[store->ping_index].png_ss_read == MB_YES
-					&& store->pings[store->ping_index].png_count == store->pings[store->ping_index].png_ss_count)
-					{
-					store->pings[store->ping_index].read_status = MBSYS_SIMRAD3_PING_COMPLETE;
-					done = MB_YES;
-					}
-				}
-#ifdef MBR_EM710MBA_DEBUG3
-	fprintf(stderr,"mbr_em710mba_rd_bath2: ping_index:%d ping:%d serial:%d\n",
-			store->ping_index,store->pings[store->ping_index].png_count,
-			store->pings[store->ping_index].png_serial);
-#endif
-			}
-		else if (type == EM3_BATH2_MBA)
-			{
-#ifdef MBR_EM710MBA_DEBUG
-	fprintf(stderr,"call mbr_em710mba_rd_bath2_mba type %x\n",type);
-#endif
-			status = mbr_em710mba_rd_bath2_mba(
-				verbose,mbio_ptr,swap,store,sonar,*version,&good_end_bytes,error);
-			if (status == MB_SUCCESS)
-				{
-				store->pings[store->ping_index].read_status = MBSYS_SIMRAD3_PING_PARTIAL;
-				store->pings[store->ping_index].png_bath_read = MB_YES;
-				done = MB_NO;
-				}
-			if (status == MB_SUCCESS && sonar == MBSYS_SIMRAD3_M3)
-				{
-				if (store->pings[store->ping_index].png_bath_read == MB_YES
-					&& store->pings[store->ping_index].png_raw_read == MB_YES
-					&& store->pings[store->ping_index].png_count == store->pings[store->ping_index].png_raw_count)
-					{
-					store->pings[store->ping_index].read_status = MBSYS_SIMRAD3_PING_COMPLETE;
-					done = MB_YES;
-					}
-				}
-			else if (status == MB_SUCCESS)
-				{
-				if (store->pings[store->ping_index].png_bath_read == MB_YES
-					&& store->pings[store->ping_index].png_ss_read == MB_YES
-					&& store->pings[store->ping_index].png_count == store->pings[store->ping_index].png_ss_count)
-					{
-					store->pings[store->ping_index].read_status = MBSYS_SIMRAD3_PING_COMPLETE;
-					done = MB_YES;
-					}
-				}
-#ifdef MBR_EM710MBA_DEBUG3
-	fprintf(stderr,"mbr_em710mba_rd_bath2_mba: ping_index:%d ping:%d serial:%d\n",
-			store->ping_index,store->pings[store->ping_index].png_count,
-			store->pings[store->ping_index].png_serial);
-#endif
-			}
-		else if (type == EM3_BATH3_MBA)
-			{
-#ifdef MBR_EM710MBA_DEBUG
-	fprintf(stderr,"call mbr_em710mba_rd_bath3_mba type %x\n",type);
-#endif
-			status = mbr_em710mba_rd_bath3_mba(
-				verbose,mbio_ptr,swap,store,sonar,*version,&good_end_bytes,error);
-			if (status == MB_SUCCESS)
-				{
-				store->pings[store->ping_index].read_status = MBSYS_SIMRAD3_PING_PARTIAL;
-				store->pings[store->ping_index].png_bath_read = MB_YES;
-				done = MB_NO;
-				}
-			if (status == MB_SUCCESS && sonar == MBSYS_SIMRAD3_M3)
-				{
-				if (store->pings[store->ping_index].png_bath_read == MB_YES
-					&& store->pings[store->ping_index].png_raw_read == MB_YES
-					&& store->pings[store->ping_index].png_count == store->pings[store->ping_index].png_raw_count)
-					{
-					store->pings[store->ping_index].read_status = MBSYS_SIMRAD3_PING_COMPLETE;
-					done = MB_YES;
-					}
-				}
-			else if (status == MB_SUCCESS)
-				{
-				if (store->pings[store->ping_index].png_bath_read == MB_YES
-					&& store->pings[store->ping_index].png_ss_read == MB_YES
-					&& store->pings[store->ping_index].png_count == store->pings[store->ping_index].png_ss_count)
-					{
-					store->pings[store->ping_index].read_status = MBSYS_SIMRAD3_PING_COMPLETE;
-					done = MB_YES;
-					}
-				}
-#ifdef MBR_EM710MBA_DEBUG3
-	fprintf(stderr,"mbr_em710mba_rd_bath3_mba: ping_index:%d ping:%d serial:%d\n",
-			store->ping_index,store->pings[store->ping_index].png_count,
-			store->pings[store->ping_index].png_serial);
-#endif
-			}
-		else if (type == EM3_RAWBEAM4)
-			{
-#ifdef MBR_EM710MBA_DEBUG
-	fprintf(stderr,"call mbr_em710mba_rd_rawbeam4 type %x\n",type);
-#endif
-			status = mbr_em710mba_rd_rawbeam4(
-				verbose,mbio_ptr,swap,store,sonar,&good_end_bytes,error);
-			if (status == MB_SUCCESS)
-				{
-				store->pings[store->ping_index].read_status = MBSYS_SIMRAD3_PING_PARTIAL;
-				store->pings[store->ping_index].png_raw_read = MB_YES;
-				done = MB_NO;
-				}
-#ifdef MBR_EM710MBA_DEBUG3
-	fprintf(stderr,"mbr_em710raw_rd_rawbeam4: ping_index:%d ping:%d serial:%d\n",
-			store->ping_index,store->pings[store->ping_index].png_raw_count,
-			store->pings[store->ping_index].png_raw_serial);
-#endif
-			}
-		else if (type == EM3_QUALITY)
-			{
-#ifdef MBR_EM710MBA_DEBUG
-	fprintf(stderr,"call mbr_em710mba_rd_quality type %x\n",type);
-#endif
-			status = mbr_em710mba_rd_quality(
-				verbose,mbio_ptr,swap,store,sonar,&good_end_bytes,error);
-			if (status == MB_SUCCESS)
-				{
-				store->pings[store->ping_index].read_status = MBSYS_SIMRAD3_PING_PARTIAL;
-				store->pings[store->ping_index].png_quality_read = MB_YES;
-				done = MB_NO;
-				}
-#ifdef MBR_EM710MBA_DEBUG3
-	fprintf(stderr,"mbr_em710raw_rd_quality: ping_index:%d ping:%d serial:%d\n",
-			store->ping_index,store->pings[store->ping_index].png_quality_count,
-			store->pings[store->ping_index].png_quality_serial);
-#endif
-			}
-		else if (type == EM3_SS2 || type == EM3_SS2_MBA)
-			{
-#ifdef MBR_EM710MBA_DEBUG
-	fprintf(stderr,"call mbr_em710mba_rd_ss2_mba type %x\n",type);
-#endif
-			status = mbr_em710mba_rd_ss2_mba(
-				verbose,mbio_ptr,swap,store,sonar,&good_end_bytes,error);
-			if (status == MB_SUCCESS)
-				{
-				store->pings[store->ping_index].read_status = MBSYS_SIMRAD3_PING_PARTIAL;
-				store->pings[store->ping_index].png_ss_read = MB_YES;
-				done = MB_NO;
-				}
-			if (status == MB_SUCCESS)
-				{
-				if (store->pings[store->ping_index].png_bath_read == MB_YES
-					&& store->pings[store->ping_index].png_ss_read == MB_YES
-					&& store->pings[store->ping_index].png_count == store->pings[store->ping_index].png_ss_count)
-					{
-					store->pings[store->ping_index].read_status = MBSYS_SIMRAD3_PING_COMPLETE;
-					done = MB_YES;
-					}
-				}
-#ifdef MBR_EM710MBA_DEBUG3
-	fprintf(stderr,"mbr_em710raw_rd_ss2: ping_index:%d ping:%d serial:%d\n",
-			store->ping_index,store->pings[store->ping_index].png_ss_count,
-			store->pings[store->ping_index].png_ss_serial);
-#endif
-			}
-		else if (type == EM3_WATERCOLUMN)
-			{
-#ifdef MBR_EM710MBA_DEBUG
-	fprintf(stderr,"call mbr_em710mba_rd_wc type %x\n",type);
-#endif
-			status = mbr_em710mba_rd_wc(
-				verbose,mbio_ptr,swap,store,sonar,&good_end_bytes,error);
-			if (status == MB_SUCCESS)
-				{
-				done = MB_YES;
-				}
-#ifdef MBR_EM710MBA_DEBUG3
-	fprintf(stderr,"mbr_em710mba_rd_wc ping:%d\n", store->wc->wtc_count);
-#endif
-			}
-		else
-			{
-#ifdef MBR_EM710MBA_DEBUG
-	fprintf(stderr,"skip over %d bytes of unsupported datagram type %x\n",
-			*record_size_save, type);
-#endif
-			for (i=0;i<*record_size_save-4;i++)
-				{
-				read_len = 1;
-				status = mb_fileio_get(verbose, mbio_ptr, (char *)&junk, &read_len, error);
-				}
-			if (status == MB_FAILURE)
-				{
-				done = MB_YES;
-				good_end_bytes = MB_NO;
-				}
-			else
-				{
-				done = MB_NO;
-				good_end_bytes = MB_YES;
-				}
-#ifdef MBR_EM710MBA_DEBUG3
-	fprintf(stderr,"skip over %d bytes of unsupported datagram type %x\n",
-			*record_size_save, type);
-#endif
-			}
-
-		/* bail out if there is an error */
-		if (status == MB_FAILURE)
-			done = MB_YES;
-
-		/* if necessary read over unread but expected bytes */
-		bytes_read = ftell(mbfp) - mb_io_ptr->file_bytes - 4;
-		if (*label_save_flag == MB_NO && good_end_bytes == MB_NO
-			&& bytes_read < record_size)
-			{
-#ifdef MBR_EM710MBA_DEBUG
-	fprintf(stderr,"skip over %d unread bytes of supported datagram type %x\n",
-			record_size - bytes_read, type);
-#endif
-			for (i=0;i<record_size - bytes_read;i++)
-				{
-				read_len = 1;
-				status = mb_fileio_get(verbose, mbio_ptr, (char *)&junk, &read_len, error);
-				}
-			}
-
-#ifdef MBR_EM710MBA_DEBUG
-	fprintf(stderr,"record_size:%d bytes read:%ld file_pos old:%ld new:%ld\n",
-		record_size, ftell(mbfp) - mb_io_ptr->file_bytes, mb_io_ptr->file_bytes, ftell(mbfp));
-	fprintf(stderr,"done:%d status:%d error:%d\n",
-		done, status, *error);
-	fprintf(stderr,"end of mbr_em710mba_rd_data loop:\n\n");
-#endif
-#ifdef MBR_EM710MBA_DEBUG3
-	if (done == MB_YES)
-	fprintf(stderr,"DONE! type:%x kind:%d status:%d error:%d\n\n", type, store->kind, status, *error);
-#endif
-
-		/* get file position */
-		if (*label_save_flag == MB_YES)
-			mb_io_ptr->file_bytes = ftell(mbfp) - 2;
-		else
-			mb_io_ptr->file_bytes = ftell(mbfp);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em710mba_chk_label(int verbose, void *mbio_ptr, char *label, short *type, short *sonar)
-{
-	char	*function_name = "mbr_em710mba_chk_label";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	mb_u_char	startbyte;
-	mb_u_char	typebyte;
-	short	*sonar_save;
-	short	sonarunswap;
-	short	sonarswap;
-	int	swap;
-	int	*databyteswapped;
-	int	typegood;
-	int	sonargood;
-	int	sonarswapgood;
-	int	sonarunswapgood;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       label:      %x%x%x%x\n",label[0],label[1],label[2],label[3]);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-	sonar_save = (short *) (&mb_io_ptr->save11);
-	databyteswapped = (int *) &mb_io_ptr->save1;
-
-#ifdef MBR_EM710MBA_DEBUG
-	fprintf(stderr, "Check label: %x|%x|%x|%x\n", label[0],label[1],label[2],label[3]);
-#endif
-
-	/* check for valid start byte and type */
-	startbyte = label[0];
-	typebyte = label[1];
-	if (startbyte ==  EM3_START_BYTE &&
-		(typebyte == EM3_ID_PU_ID
-		|| typebyte == EM3_ID_PU_STATUS
-		|| typebyte == EM3_ID_PU_BIST
-		|| typebyte == EM3_ID_EXTRAPARAMETERS
-		|| typebyte == EM3_ID_ATTITUDE
-		|| typebyte == EM3_ID_NETATTITUDE
-		|| typebyte == EM3_ID_CLOCK
-		|| typebyte == EM3_ID_BATH
-		|| typebyte == EM3_ID_SBDEPTH
-		|| typebyte == EM3_ID_RAWBEAM
-		|| typebyte == EM3_ID_SSV
-		|| typebyte == EM3_ID_HEADING
-		|| typebyte == EM3_ID_START
-		|| typebyte == EM3_ID_TILT
-		|| typebyte == EM3_ID_CBECHO
-		|| typebyte == EM3_ID_RAWBEAM4
-		|| typebyte == EM3_ID_QUALITY
-		|| typebyte == EM3_ID_POS
-		|| typebyte == EM3_ID_RUN_PARAMETER
-		|| typebyte == EM3_ID_SS
-		|| typebyte == EM3_ID_TIDE
-		|| typebyte == EM3_ID_SVP2
-		|| typebyte == EM3_ID_SVP
-		|| typebyte == EM3_ID_SSPINPUT
-		|| typebyte == EM3_ID_BATH2
-		|| typebyte == EM3_ID_SS2
-		|| typebyte == EM3_ID_RAWBEAM2
-		|| typebyte == EM3_ID_RAWBEAM3
-		|| typebyte == EM3_ID_HEIGHT
-		|| typebyte == EM3_ID_STOP
-		|| typebyte == EM3_ID_WATERCOLUMN
-		|| typebyte == EM3_ID_REMOTE
-		|| typebyte == EM3_ID_SSP
-		|| typebyte == EM3_ID_BATH_MBA
-		|| typebyte == EM3_ID_SS_MBA
-		|| typebyte == EM3_ID_BATH2_MBA
-		|| typebyte == EM3_ID_SS2_MBA
-		|| typebyte == EM3_ID_BATH3_MBA))
-		{
-		typegood = MB_YES;
-		}
-	else
-		{
-		typegood = MB_NO;
-		}
-
-	/* check for data byte swapping if necessary */
-	sonarswapgood = MB_NO;
-	sonarunswapgood = MB_NO;
-	if (typegood == MB_YES && *databyteswapped == -1)
-		{
-		sonarunswap = *((short *)&label[2]);
-		sonarswap = mb_swap_short(sonarunswap);
-
-		/* check for valid sonarunswap */
-		if (sonarunswap == MBSYS_SIMRAD3_EM710
-			|| sonarunswap == MBSYS_SIMRAD3_EM3002
-			|| sonarunswap == MBSYS_SIMRAD3_EM302
-			|| sonarunswap == MBSYS_SIMRAD3_EM122
-			|| sonarunswap == MBSYS_SIMRAD3_EM2040
-			|| sonarunswap == MBSYS_SIMRAD3_EM2045
-			|| sonarunswap == MBSYS_SIMRAD3_M3)
-			{
-			sonarunswapgood = MB_YES;
-			}
-		else
-			{
-			sonarunswapgood = MB_NO;
-			}
-
-		/* check for valid sonarswap */
-		if (sonarswap == MBSYS_SIMRAD3_EM710
-			|| sonarswap == MBSYS_SIMRAD3_EM3002
-			|| sonarswap == MBSYS_SIMRAD3_EM302
-			|| sonarswap == MBSYS_SIMRAD3_EM122
-			|| sonarswap == MBSYS_SIMRAD3_EM2040
-			|| sonarswap == MBSYS_SIMRAD3_EM2045
-			|| sonarswap == MBSYS_SIMRAD3_M3)
-			{
-			sonarswapgood = MB_YES;
-			}
-		else
-			{
-			sonarswapgood = MB_NO;
-			}
-		if (sonarunswapgood == MB_YES && sonarswapgood == MB_NO)
-			{
-			if (mb_io_ptr->byteswapped == MB_YES)
-				*databyteswapped = MB_YES;
-			else
-				*databyteswapped = MB_NO;
-			}
-		else if (sonarunswapgood == MB_NO && sonarswapgood == MB_YES)
-			{
-			if (mb_io_ptr->byteswapped == MB_YES)
-				*databyteswapped = MB_NO;
-			else
-				*databyteswapped = MB_YES;
-			}
-		}
-
-	/* set flag to swap bytes if necessary */
-	swap =  *databyteswapped;
-
-	*type = *((short *)&label[0]);
-	*sonar = *((short *)&label[2]);
-	if (mb_io_ptr->byteswapped == MB_YES)
-		*type = mb_swap_short(*type);
-	if (*databyteswapped != mb_io_ptr->byteswapped)
-		{
-		*sonar = mb_swap_short(*sonar);
-		}
-
-#ifdef MBR_EM710MBA_DEBUG
-fprintf(stderr,"typegood:%d mb_io_ptr->byteswapped:%d sonarswapgood:%d *databyteswapped:%d *type:%d *sonar:%d\n",typegood,mb_io_ptr->byteswapped,sonarswapgood,*databyteswapped,*type,*sonar);
-#endif
-
-	/* check for valid sonar */
-	if (*sonar != MBSYS_SIMRAD3_EM710
-		&& *sonar != MBSYS_SIMRAD3_EM3002
-		&& *sonar != MBSYS_SIMRAD3_EM302
-		&& *sonar != MBSYS_SIMRAD3_EM122
-		&& *sonar != MBSYS_SIMRAD3_EM2040
-		&& *sonar != MBSYS_SIMRAD3_EM2045
-		&& *sonar != MBSYS_SIMRAD3_M3)
-		{
-		sonargood = MB_NO;
-		}
-	else
-		{
-		sonargood = MB_YES;
-		}
-
-	if (startbyte == EM3_START_BYTE && typegood == MB_NO && sonargood == MB_YES)
-		{
-		mb_notice_log_problem(verbose, mbio_ptr,
-			MB_PROBLEM_BAD_DATAGRAM);
-		if (verbose >= 1)
-		    fprintf(stderr, "Bad datagram type: %4.4hX %4.4hX | %d %d\n", *type, *sonar, *type, *sonar);
-		}
-	if (typegood != MB_YES || sonargood != MB_YES)
-		{
-		status = MB_FAILURE;
-		}
-
-	/* save sonar if successful */
-	if (status == MB_SUCCESS)
-	    *sonar_save = *sonar;
-
-	/* allow exception found in some data */
-	if (*type == EM3_SSV && *sonar == 0 && *sonar_save != 0)
-		{
-		status = MB_SUCCESS;
-		*sonar = *sonar_save;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       type:       %d\n",*type);
-		fprintf(stderr,"dbg2       sonar:      %d\n",*sonar);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em710mba_rd_status(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store,
-		short type, short sonar, int *goodend, int *error)
-{
-	char	*function_name = "mbr_em710mba_rd_status";
-	int	status = MB_SUCCESS;
-	char	line[EM3_PU_STATUS_SIZE];
-	short	short_val;
-	size_t	read_len;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		fprintf(stderr,"dbg2       sonar:      %d\n",sonar);
-		}
-
-	/* set goodend false until a good end is found */
-	*goodend = MB_NO;
-
-	/* set kind and type values */
-	store->kind = MB_DATA_STATUS;
-	store->type = EM3_PU_STATUS;
-	store->sonar = sonar;
-
-	/* read binary values into char array */
-	read_len = (size_t)(EM3_PU_STATUS_SIZE-4);
-	status = mb_fileio_get(verbose, mbio_ptr, (char *)line, &read_len, error);
-
-	/* get binary data */
-	if (status == MB_SUCCESS)
-		{
-		mb_get_binary_int(swap, &line[0], &store->sts_date);
-		    if (store->sts_date != 0) store->date = store->sts_date;
-		mb_get_binary_int(swap, &line[4], &store->sts_msec);
-		    if (store->sts_date != 0) store->msec = store->sts_msec;
-		mb_get_binary_short(swap, &line[8], &short_val);
-		    store->sts_status_count = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[10], &short_val);
-		    store->sts_serial = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[12], &short_val);
-		    store->sts_pingrate = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[14], &short_val);
-		    store->sts_ping_count = (int) ((unsigned short) short_val);
-		mb_get_binary_int(swap, &line[16], &store->sts_load);
-		mb_get_binary_int(swap, &line[20], &store->sts_udp_status);
-		mb_get_binary_int(swap, &line[24], &store->sts_serial1_status);
-		mb_get_binary_int(swap, &line[28], &store->sts_serial2_status);
-		mb_get_binary_int(swap, &line[32], &store->sts_serial3_status);
-		mb_get_binary_int(swap, &line[36], &store->sts_serial4_status);
-		store->sts_pps_status = (mb_u_char) line[40];
-		store->sts_position_status = (mb_s_char) line[41];
-		store->sts_attitude_status = (mb_s_char) line[42];
-		store->sts_clock_status = (mb_s_char) line[43];
-		store->sts_heading_status = (mb_s_char) line[44];
-		store->sts_pu_status = (mb_u_char) line[45];
-		mb_get_binary_short(swap, &line[46], &short_val);
-		    store->sts_last_heading = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[48], &short_val);
-		    store->sts_last_roll = (int) ((short) short_val);
-		mb_get_binary_short(swap, &line[50], &short_val);
-		    store->sts_last_pitch = (int) ((short) short_val);
-		mb_get_binary_short(swap, &line[52], &short_val);
-		    store->sts_last_heave = (int) ((short) short_val);
-		mb_get_binary_short(swap, &line[54], &short_val);
-		    store->sts_last_ssv = (int) ((unsigned short) short_val);
-		mb_get_binary_int(swap, &line[56], &store->sts_last_depth);
-		mb_get_binary_int(swap, &line[60], &store->sts_spare);
-		store->sts_bso = (mb_s_char) line[64];
-		store->sts_bsn = (mb_s_char) line[65];
-		store->sts_gain = (mb_s_char) line[66];
-		store->sts_dno = (mb_u_char) line[67];
-		mb_get_binary_short(swap, &line[68], &short_val);
-		    store->sts_rno = (int) ((unsigned short) short_val);
-		store->sts_port = (mb_s_char) line[70];
-		store->sts_stbd = (mb_u_char) line[71];
-		mb_get_binary_short(swap, &line[72], &short_val);
-		    store->sts_ssp = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[74], &short_val);
-		    store->sts_yaw = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[76], &short_val);
-		    store->sts_port2 = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[78], &short_val);
-		    store->sts_stbd2 = (int) ((unsigned short) short_val);
-		store->sts_spare2 = (mb_u_char) line[80];
-		if (line[EM3_PU_STATUS_SIZE-7] == EM3_END)
-			*goodend = MB_YES;
-#ifdef MBR_EM710MBA_DEBUG
-	fprintf(stderr, "End Bytes: %2.2hhX %d | %2.2hhX %d | %2.2hhX %d\n",
-		line[EM3_PU_STATUS_SIZE-7], line[EM3_PU_STATUS_SIZE-7],
-		line[EM3_PU_STATUS_SIZE-6], line[EM3_PU_STATUS_SIZE-6],
-		line[EM3_PU_STATUS_SIZE-5], line[EM3_PU_STATUS_SIZE-5]);
-#endif
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:                %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:               %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:                %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:                %d\n",store->msec);
-		fprintf(stderr,"dbg5       run_date:            %d\n",store->sts_date);
-		fprintf(stderr,"dbg5       run_msec:            %d\n",store->sts_msec);
-		fprintf(stderr,"dbg5       sts_status_count:    %d\n",store->sts_status_count);
-		fprintf(stderr,"dbg5       run_serial:          %d\n",store->sts_serial);
-		fprintf(stderr,"dbg5       sts_pingrate:        %d\n",store->sts_pingrate);
-		fprintf(stderr,"dbg5       sts_ping_count:      %d\n",store->sts_ping_count);
-		fprintf(stderr,"dbg5       sts_load:            %d\n",store->sts_load);
-		fprintf(stderr,"dbg5       sts_udp_status:      %d\n",store->sts_udp_status);
-		fprintf(stderr,"dbg5       sts_serial1_status:  %d\n",store->sts_serial1_status);
-		fprintf(stderr,"dbg5       sts_serial2_status:  %d\n",store->sts_serial2_status);
-		fprintf(stderr,"dbg5       sts_serial3_status:  %d\n",store->sts_serial3_status);
-		fprintf(stderr,"dbg5       sts_serial4_status:  %d\n",store->sts_serial4_status);
-		fprintf(stderr,"dbg5       sts_pps_status:      %d\n",store->sts_pps_status);
-		fprintf(stderr,"dbg5       sts_position_status: %d\n",store->sts_position_status);
-		fprintf(stderr,"dbg5       sts_attitude_status: %d\n",store->sts_attitude_status);
-		fprintf(stderr,"dbg5       sts_clock_status:    %d\n",store->sts_clock_status);
-		fprintf(stderr,"dbg5       sts_heading_status:  %d\n",store->sts_heading_status);
-		fprintf(stderr,"dbg5       sts_pu_status:       %d\n",store->sts_pu_status);
-		fprintf(stderr,"dbg5       sts_last_heading:    %d\n",store->sts_last_heading);
-		fprintf(stderr,"dbg5       sts_last_roll:       %d\n",store->sts_last_roll);
-		fprintf(stderr,"dbg5       sts_last_pitch:      %d\n",store->sts_last_pitch);
-		fprintf(stderr,"dbg5       sts_last_heave:      %d\n",store->sts_last_heave);
-		fprintf(stderr,"dbg5       sts_last_ssv:        %d\n",store->sts_last_ssv);
-		fprintf(stderr,"dbg5       sts_last_heave:      %d\n",store->sts_last_heave);
-		fprintf(stderr,"dbg5       sts_last_depth:      %d\n",store->sts_last_depth);
-		fprintf(stderr,"dbg5       sts_spare:           %d\n",store->sts_spare);
-		fprintf(stderr,"dbg5       sts_bso:             %d\n",store->sts_bso);
-		fprintf(stderr,"dbg5       sts_bsn:             %d\n",store->sts_bsn);
-		fprintf(stderr,"dbg5       sts_gain:            %d\n",store->sts_gain);
-		fprintf(stderr,"dbg5       sts_dno:             %d\n",store->sts_dno);
-		fprintf(stderr,"dbg5       sts_rno:             %d\n",store->sts_rno);
-		fprintf(stderr,"dbg5       sts_port:            %d\n",store->sts_port);
-		fprintf(stderr,"dbg5       sts_stbd:            %d\n",store->sts_stbd);
-		fprintf(stderr,"dbg5       sts_ssp:             %d\n",store->sts_ssp);
-		fprintf(stderr,"dbg5       sts_yaw:             %d\n",store->sts_yaw);
-		fprintf(stderr,"dbg5       sts_port2:           %d\n",store->sts_port2);
-		fprintf(stderr,"dbg5       sts_stbd2:           %d\n",store->sts_stbd2);
-		fprintf(stderr,"dbg5       sts_spare2:          %d\n",store->sts_spare2);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       goodend:    %d\n",*goodend);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em710mba_rd_start(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store,
-		short type, short sonar, int *version, int *num_sonars, int *goodend, int *error)
-{
-	char	*function_name = "mbr_em710mba_rd_start";
-	int	status = MB_SUCCESS;
-	char	line[MBSYS_SIMRAD3_BUFFER_SIZE];
-	short	short_val;
-	size_t	read_len;
-	int	len;
-	int	done;
-	char	*comma_ptr;
-	int	i1, i2, i3;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		fprintf(stderr,"dbg2       type:       %d\n",type);
-		fprintf(stderr,"dbg2       sonar:      %d\n",sonar);
-		}
-
-	/* set goodend false until a good end is found */
-	*goodend = MB_NO;
-
-	/* make sure comment is initialized */
-	store->par_com[0] = '\0';
-
-	/* set type value */
-	store->type = type;
-	store->sonar = sonar;
-
-	/* read binary values into char array */
-	read_len = (size_t)(EM3_START_HEADER_SIZE);
-	status = mb_fileio_get(verbose, mbio_ptr, (char *)line, &read_len, error);
-
-	/* get binary header data */
-	if (status == MB_SUCCESS)
-		{
-		mb_get_binary_int(swap, &line[0], &store->par_date);
-		    store->date = store->par_date;
-		mb_get_binary_int(swap, &line[4], &store->par_msec);
-		    store->msec = store->par_msec;
-		mb_get_binary_short(swap, &line[8], &short_val);
-		    store->par_line_num = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[10], &short_val);
-		    store->par_serial_1 = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[12], &short_val);
-		    store->par_serial_2 = (int) ((unsigned short) short_val);
-		    
-		/* set the number of sonars */
-		if (store->par_serial_2 != 0)
-			*num_sonars = 2;
-		else
-			*num_sonars = 1;
-		}
-
-	/* now loop over reading individual characters to
-	    handle ASCII parameter values */
-	done = MB_NO;
-	len = 0;
-	while (status == MB_SUCCESS && done == MB_NO)
-		{
-		read_len = (size_t)1;
-		status = mb_fileio_get(verbose, mbio_ptr, (char *)&line[len], &read_len, error);
-		if (status == MB_SUCCESS)
-			{
-			len++;
-			}
-		else
-			{
-			done = MB_YES;
-			}
-
-		if (status == MB_SUCCESS
-			&& (((mb_u_char)(line[len-1])) < 32
-			    || ((mb_u_char)(line[len-1])) > 127)
-			&& ((mb_u_char)(line[len-1])) != '\r'
-			&& ((mb_u_char)(line[len-1])) != '\n')
-			{
-			done = MB_YES;
-			if (len > 1)
-			    line[0] = line[len-1];
-			}
-		else if (status == MB_SUCCESS
-			&& line[len-1] == ','
-			&& len > 5)
-			{
-			line[len] = 0;
-			if (strncmp("WLZ=", line, 4) == 0)
-			    mb_get_double(&(store->par_wlz), &line[4], len-5);
-			else if (strncmp("SMH=", line, 4) == 0)
-			    mb_get_int(&(store->par_smh), &line[4], len-5);
-			    
-			else if (strncmp("HUN=", line, 4) == 0)
-			    mb_get_int(&(store->par_hun), &line[4], len-5);
-			else if (strncmp("HUT=", line, 4) == 0)
-			    mb_get_double(&(store->par_hut), &line[4], len-5);
-			else if (strncmp("TXS=", line, 4) == 0)
-			    mb_get_int(&(store->par_txs), &line[4], len-5);
-			else if (strncmp("T2X=", line, 4) == 0)
-			    mb_get_int(&(store->par_t2x), &line[4], len-5);
-			else if (strncmp("R1S=", line, 4) == 0)
-			    mb_get_int(&(store->par_r1s), &line[4], len-5);
-			else if (strncmp("R2S=", line, 4) == 0)
-			    mb_get_int(&(store->par_r2s), &line[4], len-5);
-			else if (strncmp("STC=", line, 4) == 0)
-			    mb_get_int(&(store->par_stc), &line[4], len-5);
-			    
-			else if (strncmp("S0Z=", line, 4) == 0)
-			    mb_get_double(&(store->par_s0z), &line[4], len-5);
-			else if (strncmp("S0X=", line, 4) == 0)
-			    mb_get_double(&(store->par_s0x), &line[4], len-5);
-			else if (strncmp("S0Y=", line, 4) == 0)
-			    mb_get_double(&(store->par_s0y), &line[4], len-5);
-			else if (strncmp("S0H=", line, 4) == 0)
-			    mb_get_double(&(store->par_s0h), &line[4], len-5);
-			else if (strncmp("S0R=", line, 4) == 0)
-			    mb_get_double(&(store->par_s0r), &line[4], len-5);
-			else if (strncmp("S0P=", line, 4) == 0)
-			    mb_get_double(&(store->par_s0p), &line[4], len-5);
-			    
-			else if (strncmp("S1Z=", line, 4) == 0)
-			    mb_get_double(&(store->par_s1z), &line[4], len-5);
-			else if (strncmp("S1X=", line, 4) == 0)
-			    mb_get_double(&(store->par_s1x), &line[4], len-5);
-			else if (strncmp("S1Y=", line, 4) == 0)
-			    mb_get_double(&(store->par_s1y), &line[4], len-5);
-			else if (strncmp("S1H=", line, 4) == 0)
-			    mb_get_double(&(store->par_s1h), &line[4], len-5);
-			else if (strncmp("S1R=", line, 4) == 0)
-			    mb_get_double(&(store->par_s1r), &line[4], len-5);
-			else if (strncmp("S1P=", line, 4) == 0)
-			    mb_get_double(&(store->par_s1p), &line[4], len-5);
-			else if (strncmp("S1N=", line, 4) == 0)
-			    mb_get_int(&(store->par_s1n), &line[4], len-5);
-			    
-			else if (strncmp("S2Z=", line, 4) == 0)
-			    mb_get_double(&(store->par_s2z), &line[4], len-5);
-			else if (strncmp("S2X=", line, 4) == 0)
-			    mb_get_double(&(store->par_s2x), &line[4], len-5);
-			else if (strncmp("S2Y=", line, 4) == 0)
-			    mb_get_double(&(store->par_s2y), &line[4], len-5);
-			else if (strncmp("S2H=", line, 4) == 0)
-			    mb_get_double(&(store->par_s2h), &line[4], len-5);
-			else if (strncmp("S2R=", line, 4) == 0)
-			    mb_get_double(&(store->par_s2r), &line[4], len-5);
-			else if (strncmp("S2P=", line, 4) == 0)
-			    mb_get_double(&(store->par_s2p), &line[4], len-5);
-			else if (strncmp("S2N=", line, 4) == 0)
-			    mb_get_int(&(store->par_s2n), &line[4], len-5);
-			    
-			else if (strncmp("S3Z=", line, 4) == 0)
-			    mb_get_double(&(store->par_s3z), &line[4], len-5);
-			else if (strncmp("S3X=", line, 4) == 0)
-			    mb_get_double(&(store->par_s3x), &line[4], len-5);
-			else if (strncmp("S3Y=", line, 4) == 0)
-			    mb_get_double(&(store->par_s3y), &line[4], len-5);
-			else if (strncmp("S3H=", line, 4) == 0)
-			    mb_get_double(&(store->par_s3h), &line[4], len-5);
-			else if (strncmp("S3R=", line, 4) == 0)
-			    mb_get_double(&(store->par_s3r), &line[4], len-5);
-			else if (strncmp("S3P=", line, 4) == 0)
-			    mb_get_double(&(store->par_s3p), &line[4], len-5);
-			    
-			else if (strncmp("S1S=", line, 4) == 0)
-			    mb_get_int(&(store->par_s1s), &line[4], len-5);
-			else if (strncmp("S2S=", line, 4) == 0)
-			    mb_get_int(&(store->par_s2s), &line[4], len-5);
-			    
-			else if (strncmp("GO1=", line, 4) == 0)
-			    mb_get_double(&(store->par_go1), &line[4], len-5);
-			else if (strncmp("GO2=", line, 4) == 0)
-			    mb_get_double(&(store->par_go2), &line[4], len-5);
-			else if (strncmp("OBO=", line, 4) == 0)
-			    mb_get_double(&(store->par_obo), &line[4], len-5);
-			else if (strncmp("FGD=", line, 4) == 0)
-			    mb_get_double(&(store->par_fgd), &line[4], len-5);
-			    
-			else if (strncmp("TSV=", line, 4) == 0)
-			    strncpy(store->par_tsv, &line[4], MIN(len-5, 15));
-			else if (strncmp("RSV=", line, 4) == 0)
-			    strncpy(store->par_rsv, &line[4], MIN(len-5, 15));
-			else if (strncmp("BSV=", line, 4) == 0)
-			    strncpy(store->par_bsv, &line[4], MIN(len-5, 15));
-			else if (strncmp("PSV=", line, 4) == 0)
-			    {
-			    /* save the processor software version to use
-			       in tracking changes to the data format */
-			    strncpy(store->par_psv, &line[4], MIN(len-5, 15));
-			    if (sscanf(store->par_psv, "%d.%d.%d", &i1, &i2, &i3)
-				== 3)
-				*version = i3 + 100 * i2 + 10000 * i1;
-			    }
-			else if (strncmp("DDS=", line, 4) == 0)
-			    strncpy(store->par_dds, &line[4], MIN(len-5, 15));
-			else if (strncmp("OSV=", line, 4) == 0)
-			    strncpy(store->par_osv, &line[4], MIN(len-5, 15));
-			else if (strncmp("DSV=", line, 4) == 0)
-			    strncpy(store->par_dsv, &line[4], MIN(len-5, 15));
-			else if (strncmp("DSX=", line, 4) == 0)
-			    mb_get_double(&(store->par_dsx), &line[4], len-5);
-			else if (strncmp("DSY=", line, 4) == 0)
-			    mb_get_double(&(store->par_dsy), &line[4], len-5);
-			else if (strncmp("DSZ=", line, 4) == 0)
-			    mb_get_double(&(store->par_dsz), &line[4], len-5);
-			    
-			else if (strncmp("DSD=", line, 4) == 0)
-			    mb_get_int(&(store->par_dsd), &line[4], len-5);
-			else if (strncmp("DSO=", line, 4) == 0)
-			    mb_get_double(&(store->par_dso), &line[4], len-5);
-			else if (strncmp("DSF=", line, 4) == 0)
-			    mb_get_double(&(store->par_dsf), &line[4], len-5);
-			else if (strncmp("DSH=", line, 4) == 0)
-			    {
-			    store->par_dsh[0] = line[4];
-			    store->par_dsh[1] = line[5];
-			    }
-			else if (strncmp("APS=", line, 4) == 0)
-			    mb_get_int(&(store->par_aps), &line[4], len-5);
-			else if (strncmp("P1Q=", line, 4) == 0)
-			    mb_get_int(&(store->par_p1q), &line[4], len-5);
-			else if (strncmp("P1M=", line, 4) == 0)
-			    mb_get_int(&(store->par_p1m), &line[4], len-5);
-			else if (strncmp("P1T=", line, 4) == 0)
-			    mb_get_int(&(store->par_p1t), &line[4], len-5);
-			else if (strncmp("P1Z=", line, 4) == 0)
-			    mb_get_double(&(store->par_p1z), &line[4], len-5);
-			else if (strncmp("P1X=", line, 4) == 0)
-			    mb_get_double(&(store->par_p1x), &line[4], len-5);
-			else if (strncmp("P1Y=", line, 4) == 0)
-			    mb_get_double(&(store->par_p1y), &line[4], len-5);
-			else if (strncmp("P1D=", line, 4) == 0)
-			    mb_get_double(&(store->par_p1d), &line[4], len-5);
-			else if (strncmp("P1G=", line, 4) == 0)
-			    strncpy(store->par_p1g, &line[4], MIN(len-5, 15));
-			else if (strncmp("P2Q=", line, 4) == 0)
-			    mb_get_int(&(store->par_p2q), &line[4], len-5);
-			else if (strncmp("P2M=", line, 4) == 0)
-			    mb_get_int(&(store->par_p2m), &line[4], len-5);
-			else if (strncmp("P2T=", line, 4) == 0)
-			    mb_get_int(&(store->par_p2t), &line[4], len-5);
-			else if (strncmp("P2Z=", line, 4) == 0)
-			    mb_get_double(&(store->par_p2z), &line[4], len-5);
-			else if (strncmp("P2X=", line, 4) == 0)
-			    mb_get_double(&(store->par_p2x), &line[4], len-5);
-			else if (strncmp("P2Y=", line, 4) == 0)
-			    mb_get_double(&(store->par_p2y), &line[4], len-5);
-			else if (strncmp("P2D=", line, 4) == 0)
-			    mb_get_double(&(store->par_p2d), &line[4], len-5);
-			else if (strncmp("P2G=", line, 4) == 0)
-			    strncpy(store->par_p2g, &line[4], MIN(len-5, 15));
-			else if (strncmp("P3Q=", line, 4) == 0)
-			    mb_get_int(&(store->par_p3q), &line[4], len-5);
-			else if (strncmp("P3M=", line, 4) == 0)
-			    mb_get_int(&(store->par_p3m), &line[4], len-5);
-			else if (strncmp("P3T=", line, 4) == 0)
-			    mb_get_int(&(store->par_p3t), &line[4], len-5);
-			else if (strncmp("P3Z=", line, 4) == 0)
-			    mb_get_double(&(store->par_p3z), &line[4], len-5);
-			else if (strncmp("P3X=", line, 4) == 0)
-			    mb_get_double(&(store->par_p3x), &line[4], len-5);
-			else if (strncmp("P3Y=", line, 4) == 0)
-			    mb_get_double(&(store->par_p3y), &line[4], len-5);
-			else if (strncmp("P3D=", line, 4) == 0)
-			    mb_get_double(&(store->par_p3d), &line[4], len-5);
-			else if (strncmp("P3G=", line, 4) == 0)
-			    strncpy(store->par_p3g, &line[4], MIN(len-5, 15));
-			else if (strncmp("P3S=", line, 4) == 0)
-			    mb_get_int(&(store->par_p3s), &line[4], len-5);
-			    
-			else if (strncmp("MSZ=", line, 4) == 0)
-			    mb_get_double(&(store->par_msz), &line[4], len-5);
-			else if (strncmp("MSX=", line, 4) == 0)
-			    mb_get_double(&(store->par_msx), &line[4], len-5);
-			else if (strncmp("MSY=", line, 4) == 0)
-			    mb_get_double(&(store->par_msy), &line[4], len-5);
-			else if (strncmp("MRP=", line, 4) == 0)
-			    {
-			    store->par_mrp[0] = line[4];
-			    store->par_mrp[1] = line[5];
-			    }
-			else if (strncmp("MSD=", line, 4) == 0)
-			    mb_get_double(&(store->par_msd), &line[4], len-5);
-			else if (strncmp("MSR=", line, 4) == 0)
-			    mb_get_double(&(store->par_msr), &line[4], len-5);
-			else if (strncmp("MSP=", line, 4) == 0)
-			    mb_get_double(&(store->par_msp), &line[4], len-5);
-			else if (strncmp("MSG=", line, 4) == 0)
-			    mb_get_double(&(store->par_msg), &line[4], len-5);
-			    
-			else if (strncmp("NSZ=", line, 4) == 0)
-			    mb_get_double(&(store->par_nsz), &line[4], len-5);
-			else if (strncmp("NSX=", line, 4) == 0)
-			    mb_get_double(&(store->par_nsx), &line[4], len-5);
-			else if (strncmp("NSY=", line, 4) == 0)
-			    mb_get_double(&(store->par_nsy), &line[4], len-5);
-			else if (strncmp("NRP=", line, 4) == 0)
-			    {
-			    store->par_nrp[0] = line[4];
-			    store->par_nrp[1] = line[5];
-			    }
-			else if (strncmp("NSD=", line, 4) == 0)
-			    mb_get_double(&(store->par_nsd), &line[4], len-5);
-			else if (strncmp("NSR=", line, 4) == 0)
-			    mb_get_double(&(store->par_nsr), &line[4], len-5);
-			else if (strncmp("NSP=", line, 4) == 0)
-			    mb_get_double(&(store->par_nsp), &line[4], len-5);
-			else if (strncmp("NSG=", line, 4) == 0)
-			    mb_get_double(&(store->par_nsg), &line[4], len-5);
-			    
-			else if (strncmp("GCG=", line, 4) == 0)
-			    mb_get_double(&(store->par_gcg), &line[4], len-5);
-			else if (strncmp("MAS=", line, 4) == 0)
-			    mb_get_double(&(store->par_mas), &line[4], len-5);
-			else if (strncmp("SHC=", line, 4) == 0)
-			    mb_get_int(&(store->par_shc), &line[4], len-5);
-			else if (strncmp("PPS=", line, 4) == 0)
-			    mb_get_int(&(store->par_pps), &line[4], len-5);
-			else if (strncmp("CLS=", line, 4) == 0)
-			    mb_get_int(&(store->par_cls), &line[4], len-5);
-			else if (strncmp("CLO=", line, 4) == 0)
-			    mb_get_int(&(store->par_clo), &line[4], len-5);
-			else if (strncmp("VSN=", line, 4) == 0)
-			    mb_get_int(&(store->par_vsn), &line[4], len-5);
-			else if (strncmp("VSU=", line, 4) == 0)
-			    mb_get_int(&(store->par_vsu), &line[4], len-5);
-			else if (strncmp("VSE=", line, 4) == 0)
-			    mb_get_int(&(store->par_vse), &line[4], len-5);
-			else if (strncmp("VTU=", line, 4) == 0)
-			    mb_get_int(&(store->par_vtu), &line[4], len-5);
-			else if (strncmp("VTE=", line, 4) == 0)
-			    mb_get_int(&(store->par_vte), &line[4], len-5);
-			else if (strncmp("ARO=", line, 4) == 0)
-			    mb_get_int(&(store->par_aro), &line[4], len-5);
-			else if (strncmp("AHE=", line, 4) == 0)
-			    mb_get_int(&(store->par_ahe), &line[4], len-5);
-			else if (strncmp("AHS=", line, 4) == 0)
-			    mb_get_int(&(store->par_ahs), &line[4], len-5);
-			else if (strncmp("VSI=", line, 4) == 0)
-			    strncpy(store->par_vsi, &line[4], MIN(len-5, 15));
-			else if (strncmp("VSM=", line, 4) == 0)
-			    strncpy(store->par_vsm, &line[4], MIN(len-5, 15));
-
-			else if (strncmp("MCA1=", line, 5) == 0)
-			    strncpy(store->par_mca1, &line[5], MIN(len-6, 15));
-			else if (strncmp("MCU1=", line, 5) == 0)
-			    mb_get_int(&(store->par_mcu1), &line[5], len-6);
-			else if (strncmp("MCI1=", line, 5) == 0)
-			    strncpy(store->par_mci1, &line[5], MIN(len-6, 15));
-			else if (strncmp("MCP1=", line, 5) == 0)
-			    mb_get_int(&(store->par_mcp1), &line[5], len-6);
-
-			else if (strncmp("MCA2=", line, 5) == 0)
-			    strncpy(store->par_mca2, &line[5], MIN(len-6, 15));
-			else if (strncmp("MCU2=", line, 5) == 0)
-			    mb_get_int(&(store->par_mcu2), &line[5], len-6);
-			else if (strncmp("MCI2=", line, 5) == 0)
-			    strncpy(store->par_mci2, &line[5], MIN(len-6, 15));
-			else if (strncmp("MCP2=", line, 5) == 0)
-			    mb_get_int(&(store->par_mcp2), &line[5], len-6);
-
-			else if (strncmp("MCA3=", line, 5) == 0)
-			    strncpy(store->par_mca3, &line[5], MIN(len-6, 15));
-			else if (strncmp("MCU3=", line, 5) == 0)
-			    mb_get_int(&(store->par_mcu3), &line[5], len-6);
-			else if (strncmp("MCI3=", line, 5) == 0)
-			    strncpy(store->par_mci3, &line[5], MIN(len-6, 15));
-			else if (strncmp("MCP3=", line, 5) == 0)
-			    mb_get_int(&(store->par_mcp3), &line[5], len-6);
-
-			else if (strncmp("MCA4=", line, 5) == 0)
-			    strncpy(store->par_mca4, &line[5], MIN(len-6, 15));
-			else if (strncmp("MCU4=", line, 5) == 0)
-			    mb_get_int(&(store->par_mcu4), &line[5], len-6);
-			else if (strncmp("MCI4=", line, 5) == 0)
-			    strncpy(store->par_mci4, &line[5], MIN(len-6, 15));
-			else if (strncmp("MCP4=", line, 5) == 0)
-			    mb_get_int(&(store->par_mcp4), &line[5], len-6);
-			else if (strncmp("SNL=", line, 4) == 0)
-			    mb_get_int(&(store->par_snl), &line[4], len-5);
-			    
-			else if (strncmp("CPR=", line, 4) == 0)
-			    strncpy(store->par_cpr, &line[4], MIN(len-5, 3));
-			else if (strncmp("ROP=", line, 4) == 0)
-			    strncpy(store->par_rop, &line[4], MIN(len-5, MBSYS_SIMRAD3_COMMENT_LENGTH-1));
-			else if (strncmp("SID=", line, 4) == 0)
-			    strncpy(store->par_sid, &line[4], MIN(len-5, MBSYS_SIMRAD3_COMMENT_LENGTH-1));
-			else if (strncmp("RFN=", line, 4) == 0)
-			    strncpy(store->par_rfn, &line[4], MIN(len-5, MBSYS_SIMRAD3_COMMENT_LENGTH-1));
-			else if (strncmp("PLL=", line, 4) == 0)
-			    strncpy(store->par_pll, &line[4], MIN(len-5, MBSYS_SIMRAD3_COMMENT_LENGTH-1));
-			else if (strncmp("COM=", line, 4) == 0)
-			    {
-			    strncpy(store->par_com, &line[4], MIN(len-5, MBSYS_SIMRAD3_COMMENT_LENGTH-1));
-			    store->par_com[MIN(len-5, MBSYS_SIMRAD3_COMMENT_LENGTH-1)] = 0;
-			    /* replace caret (^) values with commas (,) to circumvent
-			       the format's inability to store commas in comments */
-			    while ((comma_ptr = strchr(store->par_com, '^')) != NULL)
-				{
-				comma_ptr[0] = ',';
-				}
-			    }
-			len = 0;
-			}
-		else if (status == MB_SUCCESS
-			&& line[len-1] == ','
-			&& len <= 5)
-			{
-			len = 0;
-			}
-		}
-
-	/* now set the data kind */
-	if (status == MB_SUCCESS)
-		{
-		if (strlen(store->par_com) > 0)
-		    store->kind = MB_DATA_COMMENT;
-		else if (store->type == EM3_START)
-		    store->kind = MB_DATA_START;
-		else if (store->type == EM3_STOP)
-		    store->kind = MB_DATA_STOP;
-		}
-
-	/* read end of record and last two check sum bytes */
-	if (status == MB_SUCCESS)
-	    {
-	    /* if EM3_END not yet found then the
-		next byte should be EM3_END */
-	    if (line[0] != EM3_END)
-		{
-		read_len = (size_t)1;
-		status = mb_fileio_get(verbose, mbio_ptr, (char *)&line[0], &read_len, error);
-		}
-
-	    /* if EM3_END not yet found then the
-		next byte should be EM3_END */
-	    if (line[0] != EM3_END)
-		{
-		read_len = (size_t)1;
-		status = mb_fileio_get(verbose, mbio_ptr, (char *)&line[0], &read_len, error);
-		}
-
-	    /* if we got the end byte then get check sum bytes */
-	    if (line[0] == EM3_END)
-		{
-		if (line[0] == EM3_END)
-			*goodend = MB_YES;
-		read_len = (size_t)2;
-		status = mb_fileio_get(verbose, mbio_ptr, (char *)&line[1], &read_len, error);
-	    /* don't check success of read
-	        - return success here even if read fails
-	        because all of the
-		important information in this record has
-		already been read - next attempt to read
-		file will return error */
-#ifdef MBR_EM710MBA_DEBUG
-	fprintf(stderr, "End Bytes: %2.2hhX %d | %2.2hhX %d | %2.2hhX %d\n",
-		line[0], line[0],
-		line[1], line[1],
-		line[2], line[2]);
-#endif
-		}
-#ifdef MBR_EM71MBA_DEBUG
-	fprintf(stderr, "\n");
-#endif
-	    }
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       par_date:        %d\n",store->par_date);
-		fprintf(stderr,"dbg5       par_msec:        %d\n",store->par_msec);
-		fprintf(stderr,"dbg5       par_line_num:    %d\n",store->par_line_num);
-		fprintf(stderr,"dbg5       par_serial_1:    %d\n",store->par_serial_1);
-		fprintf(stderr,"dbg5       par_serial_2:    %d\n",store->par_serial_2);
-		fprintf(stderr,"dbg5       par_wlz:         %f\n",store->par_wlz);
-		fprintf(stderr,"dbg5       par_smh:         %d\n",store->par_smh);
-		fprintf(stderr,"dbg5       par_hun:         %d\n",store->par_hun);
-		fprintf(stderr,"dbg5       par_hut:         %f\n",store->par_hut);
-		fprintf(stderr,"dbg5       par_txs:         %d\n",store->par_txs);
-		fprintf(stderr,"dbg5       par_t2x:         %d\n",store->par_t2x);
-		fprintf(stderr,"dbg5       par_r1s:         %d\n",store->par_r1s);
-		fprintf(stderr,"dbg5       par_r2s:         %d\n",store->par_r2s);
-		fprintf(stderr,"dbg5       par_stc:         %d\n",store->par_stc);
-		fprintf(stderr,"dbg5       par_s0z:         %f\n",store->par_s0z);
-		fprintf(stderr,"dbg5       par_s0x:         %f\n",store->par_s0x);
-		fprintf(stderr,"dbg5       par_s0y:         %f\n",store->par_s0y);
-		fprintf(stderr,"dbg5       par_s0h:         %f\n",store->par_s0h);
-		fprintf(stderr,"dbg5       par_s0r:         %f\n",store->par_s0r);
-		fprintf(stderr,"dbg5       par_s0p:         %f\n",store->par_s0p);
-		fprintf(stderr,"dbg5       par_s1z:         %f\n",store->par_s1z);
-		fprintf(stderr,"dbg5       par_s1x:         %f\n",store->par_s1x);
-		fprintf(stderr,"dbg5       par_s1y:         %f\n",store->par_s1y);
-		fprintf(stderr,"dbg5       par_s1h:         %f\n",store->par_s1h);
-		fprintf(stderr,"dbg5       par_s1r:         %f\n",store->par_s1r);
-		fprintf(stderr,"dbg5       par_s1p:         %f\n",store->par_s1p);
-		fprintf(stderr,"dbg5       par_s1n:         %d\n",store->par_s1n);
-		fprintf(stderr,"dbg5       par_s2z:         %f\n",store->par_s2z);
-		fprintf(stderr,"dbg5       par_s2x:         %f\n",store->par_s2x);
-		fprintf(stderr,"dbg5       par_s2y:         %f\n",store->par_s2y);
-		fprintf(stderr,"dbg5       par_s2h:         %f\n",store->par_s2h);
-		fprintf(stderr,"dbg5       par_s2r:         %f\n",store->par_s2r);
-		fprintf(stderr,"dbg5       par_s2p:         %f\n",store->par_s2p);
-		fprintf(stderr,"dbg5       par_s2n:         %d\n",store->par_s2n);
-		fprintf(stderr,"dbg5       par_s3z:         %f\n",store->par_s3z);
-		fprintf(stderr,"dbg5       par_s3x:         %f\n",store->par_s3x);
-		fprintf(stderr,"dbg5       par_s3y:         %f\n",store->par_s3y);
-		fprintf(stderr,"dbg5       par_s3h:         %f\n",store->par_s3h);
-		fprintf(stderr,"dbg5       par_s3r:         %f\n",store->par_s3r);
-		fprintf(stderr,"dbg5       par_s3p:         %f\n",store->par_s3p);
-		fprintf(stderr,"dbg5       par_s1s:         %d\n",store->par_s1s);
-		fprintf(stderr,"dbg5       par_s2s:         %d\n",store->par_s2s);
-		fprintf(stderr,"dbg5       par_go1:         %f\n",store->par_go1);
-		fprintf(stderr,"dbg5       par_go2:         %f\n",store->par_go2);
-		fprintf(stderr,"dbg5       par_obo:         %f\n",store->par_obo);
-		fprintf(stderr,"dbg5       par_fgd:         %f\n",store->par_fgd);
-		fprintf(stderr,"dbg5       par_tsv:         %s\n",store->par_tsv);
-		fprintf(stderr,"dbg5       par_rsv:         %s\n",store->par_rsv);
-		fprintf(stderr,"dbg5       par_bsv:         %s\n",store->par_bsv);
-		fprintf(stderr,"dbg5       par_psv:         %s\n",store->par_psv);
-		fprintf(stderr,"dbg5       par_dds:         %s\n",store->par_dds);
-		fprintf(stderr,"dbg5       par_osv:         %s\n",store->par_osv);
-		fprintf(stderr,"dbg5       par_dsv:         %s\n",store->par_dsv);
-		fprintf(stderr,"dbg5       par_dsx:         %f\n",store->par_dsx);
-		fprintf(stderr,"dbg5       par_dsy:         %f\n",store->par_dsy);
-		fprintf(stderr,"dbg5       par_dsz:         %f\n",store->par_dsz);
-		fprintf(stderr,"dbg5       par_dsd:         %d\n",store->par_dsd);
-		fprintf(stderr,"dbg5       par_dso:         %f\n",store->par_dso);
-		fprintf(stderr,"dbg5       par_dsf:         %f\n",store->par_dsf);
-		fprintf(stderr,"dbg5       par_dsh:         %c%c\n",store->par_dsh[0],store->par_dsh[1]);
-		fprintf(stderr,"dbg5       par_aps:         %d\n",store->par_aps);
-		fprintf(stderr,"dbg5       par_p1q:         %d\n",store->par_p1q);
-		fprintf(stderr,"dbg5       par_p1m:         %d\n",store->par_p1m);
-		fprintf(stderr,"dbg5       par_p1t:         %d\n",store->par_p1t);
-		fprintf(stderr,"dbg5       par_p1z:         %f\n",store->par_p1z);
-		fprintf(stderr,"dbg5       par_p1x:         %f\n",store->par_p1x);
-		fprintf(stderr,"dbg5       par_p1y:         %f\n",store->par_p1y);
-		fprintf(stderr,"dbg5       par_p1d:         %f\n",store->par_p1d);
-		fprintf(stderr,"dbg5       par_p1g:         %s\n",store->par_p1g);
-		fprintf(stderr,"dbg5       par_p2q:         %d\n",store->par_p2q);
-		fprintf(stderr,"dbg5       par_p2m:         %d\n",store->par_p2m);
-		fprintf(stderr,"dbg5       par_p2t:         %d\n",store->par_p2t);
-		fprintf(stderr,"dbg5       par_p2z:         %f\n",store->par_p2z);
-		fprintf(stderr,"dbg5       par_p2x:         %f\n",store->par_p2x);
-		fprintf(stderr,"dbg5       par_p2y:         %f\n",store->par_p2y);
-		fprintf(stderr,"dbg5       par_p2d:         %f\n",store->par_p2d);
-		fprintf(stderr,"dbg5       par_p2g:         %s\n",store->par_p2g);
-		fprintf(stderr,"dbg5       par_p3q:         %d\n",store->par_p3q);
-		fprintf(stderr,"dbg5       par_p3m:         %d\n",store->par_p3m);
-		fprintf(stderr,"dbg5       par_p3t:         %d\n",store->par_p3t);
-		fprintf(stderr,"dbg5       par_p3z:         %f\n",store->par_p3z);
-		fprintf(stderr,"dbg5       par_p3x:         %f\n",store->par_p3x);
-		fprintf(stderr,"dbg5       par_p3y:         %f\n",store->par_p3y);
-		fprintf(stderr,"dbg5       par_p3d:         %f\n",store->par_p3d);
-		fprintf(stderr,"dbg5       par_p3g:         %s\n",store->par_p3g);
-		fprintf(stderr,"dbg5       par_p3s:         %d\n",store->par_p3s);
-		fprintf(stderr,"dbg5       par_msz:         %f\n",store->par_msz);
-		fprintf(stderr,"dbg5       par_msx:         %f\n",store->par_msx);
-		fprintf(stderr,"dbg5       par_msy:         %f\n",store->par_msy);
-		fprintf(stderr,"dbg5       par_mrp:         %c%c\n",store->par_mrp[0],store->par_mrp[1]);
-		fprintf(stderr,"dbg5       par_msd:         %f\n",store->par_msd);
-		fprintf(stderr,"dbg5       par_msr:         %f\n",store->par_msr);
-		fprintf(stderr,"dbg5       par_msp:         %f\n",store->par_msp);
-		fprintf(stderr,"dbg5       par_msg:         %f\n",store->par_msg);
-		fprintf(stderr,"dbg5       par_nsz:         %f\n",store->par_nsz);
-		fprintf(stderr,"dbg5       par_nsx:         %f\n",store->par_nsx);
-		fprintf(stderr,"dbg5       par_nsy:         %f\n",store->par_nsy);
-		fprintf(stderr,"dbg5       par_nrp:         %c%c\n",store->par_nrp[0],store->par_nrp[1]);
-		fprintf(stderr,"dbg5       par_nsd:         %f\n",store->par_nsd);
-		fprintf(stderr,"dbg5       par_nsr:         %f\n",store->par_nsr);
-		fprintf(stderr,"dbg5       par_nsp:         %f\n",store->par_nsp);
-		fprintf(stderr,"dbg5       par_nsg:         %f\n",store->par_nsg);
-		fprintf(stderr,"dbg5       par_gcg:         %f\n",store->par_gcg);
-		fprintf(stderr,"dbg5       par_mas:         %f\n",store->par_mas);
-		fprintf(stderr,"dbg5       par_shc:         %d\n",store->par_shc);
-		fprintf(stderr,"dbg5       par_pps:         %d\n",store->par_pps);
-		fprintf(stderr,"dbg5       par_cls:         %d\n",store->par_cls);
-		fprintf(stderr,"dbg5       par_clo:         %d\n",store->par_clo);
-		fprintf(stderr,"dbg5       par_vsn:         %d\n",store->par_vsn);
-		fprintf(stderr,"dbg5       par_vsu:         %d\n",store->par_vsu);
-		fprintf(stderr,"dbg5       par_vse:         %d\n",store->par_vse);
-		fprintf(stderr,"dbg5       par_vtu:         %d\n",store->par_vtu);
-		fprintf(stderr,"dbg5       par_vte:         %d\n",store->par_vte);
-		fprintf(stderr,"dbg5       par_aro:         %d\n",store->par_aro);
-		fprintf(stderr,"dbg5       par_ahe:         %d\n",store->par_ahe);
-		fprintf(stderr,"dbg5       par_ahs:         %d\n",store->par_ahs);
-		fprintf(stderr,"dbg5       par_vsi:         %s\n",store->par_vsi);
-		fprintf(stderr,"dbg5       par_vsm:         %s\n",store->par_vsm);
-		fprintf(stderr,"dbg5       par_mca1:        %s\n",store->par_mca1);
-		fprintf(stderr,"dbg5       par_mcu1:        %d\n",store->par_mcu1);
-		fprintf(stderr,"dbg5       par_mci1:        %s\n",store->par_mci1);
-		fprintf(stderr,"dbg5       par_mcp1:        %d\n",store->par_mcp1);
-		fprintf(stderr,"dbg5       par_mca2:        %s\n",store->par_mca2);
-		fprintf(stderr,"dbg5       par_mcu2:        %d\n",store->par_mcu2);
-		fprintf(stderr,"dbg5       par_mci2:        %s\n",store->par_mci2);
-		fprintf(stderr,"dbg5       par_mcp2:        %d\n",store->par_mcp2);
-		fprintf(stderr,"dbg5       par_mca3:        %s\n",store->par_mca3);
-		fprintf(stderr,"dbg5       par_mcu3:        %d\n",store->par_mcu3);
-		fprintf(stderr,"dbg5       par_mci3:        %s\n",store->par_mci3);
-		fprintf(stderr,"dbg5       par_mcp3:        %d\n",store->par_mcp3);
-		fprintf(stderr,"dbg5       par_mca4:        %s\n",store->par_mca4);
-		fprintf(stderr,"dbg5       par_mcu4:        %d\n",store->par_mcu4);
-		fprintf(stderr,"dbg5       par_mci4:        %s\n",store->par_mci4);
-		fprintf(stderr,"dbg5       par_mcp4:        %d\n",store->par_mcp4);
-		fprintf(stderr,"dbg5       par_snl:         %d\n",store->par_snl);
-		fprintf(stderr,"dbg5       par_cpr:         %s\n",store->par_cpr);
-		fprintf(stderr,"dbg5       par_rop:         %s\n",store->par_rop);
-		fprintf(stderr,"dbg5       par_sid:         %s\n",store->par_sid);
-		fprintf(stderr,"dbg5       par_rfn:         %s\n",store->par_rfn);
-		fprintf(stderr,"dbg5       par_pll:         %s\n",store->par_pll);
-		fprintf(stderr,"dbg5       par_com:         %s\n",store->par_com);
-		}
-
-		
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       version:    %d\n",*version);
-		fprintf(stderr,"dbg2       num_sonars: %d\n",*num_sonars);
-		fprintf(stderr,"dbg2       goodend:    %d\n",*goodend);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em710mba_rd_run_parameter(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store,
-		short sonar, int *goodend, int *error)
-{
-	char	*function_name = "mbr_em710mba_rd_run_parameter";
-	int	status = MB_SUCCESS;
-	char	line[EM3_RUN_PARAMETER_SIZE];
-	short	short_val;
-	size_t	read_len;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		fprintf(stderr,"dbg2       sonar:      %d\n",sonar);
-		}
-
-	/* set goodend false until a good end is found */
-	*goodend = MB_NO;
-
-	/* set kind and type values */
-	store->kind = MB_DATA_RUN_PARAMETER;
-	store->type = EM3_RUN_PARAMETER;
-	store->sonar = sonar;
-
-	/* read binary values into char array */
-	read_len = (size_t)(EM3_RUN_PARAMETER_SIZE-4);
-	status = mb_fileio_get(verbose, mbio_ptr, (char *)line, &read_len, error);
-
-	/* get binary data */
-	if (status == MB_SUCCESS)
-		{
-		mb_get_binary_int(swap, &line[0], &store->run_date);
-		    if (store->run_date != 0) store->date = store->run_date;
-		mb_get_binary_int(swap, &line[4], &store->run_msec);
-		    if (store->run_date != 0) store->msec = store->run_msec;
-		mb_get_binary_short(swap, &line[8], &short_val);
-		    store->run_ping_count = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[10], &short_val);
-		    store->run_serial = (int) ((unsigned short) short_val);
-		mb_get_binary_int(swap, &line[12], &store->run_status);
-		store->run_mode = (mb_u_char) line[16];
-		store->run_filter_id = (mb_u_char) line[17];
-		mb_get_binary_short(swap, &line[18], &short_val);
-		    store->run_min_depth = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[20], &short_val);
-		    store->run_max_depth = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[22], &short_val);
-		    store->run_absorption = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[24], &short_val);
-		    store->run_tran_pulse = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[26], &short_val);
-		    store->run_tran_beam = (int) ((unsigned short) short_val);
-		store->run_tran_pow = (mb_u_char) line[28];
-		store->run_rec_beam = (mb_u_char) line[29];
-		store->run_rec_band = (mb_u_char) line[30];
-		store->run_rec_gain = (mb_u_char) line[31];
-		store->run_tvg_cross = (mb_u_char) line[32];
-		store->run_ssv_source = (mb_u_char) line[33];
-		mb_get_binary_short(swap, &line[34], &short_val);
-		    store->run_max_swath = (int) ((unsigned short) short_val);
-		store->run_beam_space = (mb_u_char) line[36];
-		store->run_swath_angle = (mb_u_char) line[37];
-		store->run_stab_mode = (mb_u_char) line[38];
-		for (i=0;i<6;i++)
-		    store->run_spare[i] = line[39+i];
-		if (line[EM3_RUN_PARAMETER_SIZE-7] == EM3_END)
-			*goodend = MB_YES;
-#ifdef MBR_EM710MBA_DEBUG
-	fprintf(stderr, "End Bytes: %2.2hhX %d | %2.2hhX %d | %2.2hhX %d\n",
-		line[EM3_RUN_PARAMETER_SIZE-7], line[EM3_RUN_PARAMETER_SIZE-7],
-		line[EM3_RUN_PARAMETER_SIZE-6], line[EM3_RUN_PARAMETER_SIZE-6],
-		line[EM3_RUN_PARAMETER_SIZE-5], line[EM3_RUN_PARAMETER_SIZE-5]);
-#endif
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       run_date:        %d\n",store->run_date);
-		fprintf(stderr,"dbg5       run_msec:        %d\n",store->run_msec);
-		fprintf(stderr,"dbg5       run_ping_count:  %d\n",store->run_ping_count);
-		fprintf(stderr,"dbg5       run_serial:      %d\n",store->run_serial);
-		fprintf(stderr,"dbg5       run_status:      %d\n",store->run_status);
-		fprintf(stderr,"dbg5       run_mode:        %d\n",store->run_mode);
-		fprintf(stderr,"dbg5       run_filter_id:   %d\n",store->run_filter_id);
-		fprintf(stderr,"dbg5       run_min_depth:   %d\n",store->run_min_depth);
-		fprintf(stderr,"dbg5       run_max_depth:   %d\n",store->run_max_depth);
-		fprintf(stderr,"dbg5       run_absorption:  %d\n",store->run_absorption);
-		fprintf(stderr,"dbg5       run_tran_pulse:  %d\n",store->run_tran_pulse);
-		fprintf(stderr,"dbg5       run_tran_beam:   %d\n",store->run_tran_beam);
-		fprintf(stderr,"dbg5       run_tran_pow:    %d\n",store->run_tran_pow);
-		fprintf(stderr,"dbg5       run_rec_beam:    %d\n",store->run_rec_beam);
-		fprintf(stderr,"dbg5       run_rec_band:    %d\n",store->run_rec_band);
-		fprintf(stderr,"dbg5       run_rec_gain:    %d\n",store->run_rec_gain);
-		fprintf(stderr,"dbg5       run_tvg_cross:   %d\n",store->run_tvg_cross);
-		fprintf(stderr,"dbg5       run_ssv_source:  %d\n",store->run_ssv_source);
-		fprintf(stderr,"dbg5       run_max_swath:   %d\n",store->run_max_swath);
-		fprintf(stderr,"dbg5       run_beam_space:  %d\n",store->run_beam_space);
-		fprintf(stderr,"dbg5       run_swath_angle: %d\n",store->run_swath_angle);
-		fprintf(stderr,"dbg5       run_stab_mode:   %d\n",store->run_stab_mode);
-		for (i=0;i<6;i++)
-			fprintf(stderr,"dbg5       run_spare[%d]:    %d\n",i,store->run_spare[i]);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       goodend:    %d\n",*goodend);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em710mba_rd_clock(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store,
-		short sonar, int *goodend, int *error)
-{
-	char	*function_name = "mbr_em710mba_rd_clock";
-	int	status = MB_SUCCESS;
-	char	line[EM3_CLOCK_SIZE];
-	short	short_val;
-	size_t	read_len;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		fprintf(stderr,"dbg2       sonar:      %d\n",sonar);
-		}
-
-	/* set goodend false until a good end is found */
-	*goodend = MB_NO;
-
-	/* set kind and type values */
-	store->kind = MB_DATA_CLOCK;
-	store->type = EM3_CLOCK;
-	store->sonar = sonar;
-
-	/* read binary values into char array */
-	read_len = (size_t)(EM3_CLOCK_SIZE-4);
-	status = mb_fileio_get(verbose, mbio_ptr, (char *)line, &read_len, error);
-
-	/* get binary data */
-	if (status == MB_SUCCESS)
-		{
-		mb_get_binary_int(swap, &line[0], &store->clk_date);
-		    store->date = store->clk_date;
-		mb_get_binary_int(swap, &line[4], &store->clk_msec);
-		    store->msec = store->clk_msec;
-		mb_get_binary_short(swap, &line[8], &short_val);
-		    store->clk_count = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[10], &short_val);
-		    store->clk_serial = (int) ((unsigned short) short_val);
-		mb_get_binary_int(swap, &line[12], &store->clk_origin_date);
-		mb_get_binary_int(swap, &line[16], &store->clk_origin_msec);
-		store->clk_1_pps_use = (mb_u_char) line[20];
-		if (line[EM3_CLOCK_SIZE-7] == EM3_END)
-			*goodend = MB_YES;
-#ifdef MBR_EM710MBA_DEBUG
-	fprintf(stderr, "End Bytes: %2.2hhX %d | %2.2hhX %d | %2.2hhX %d\n",
-		line[EM3_CLOCK_SIZE-7], line[EM3_CLOCK_SIZE-7],
-		line[EM3_CLOCK_SIZE-6], line[EM3_CLOCK_SIZE-6],
-		line[EM3_CLOCK_SIZE-5], line[EM3_CLOCK_SIZE-5]);
-#endif
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       clk_date:        %d\n",store->clk_date);
-		fprintf(stderr,"dbg5       clk_msec:        %d\n",store->clk_msec);
-		fprintf(stderr,"dbg5       clk_count:       %d\n",store->clk_count);
-		fprintf(stderr,"dbg5       clk_serial:      %d\n",store->clk_serial);
-		fprintf(stderr,"dbg5       clk_origin_date: %d\n",store->clk_origin_date);
-		fprintf(stderr,"dbg5       clk_origin_msec: %d\n",store->clk_origin_msec);
-		fprintf(stderr,"dbg5       clk_1_pps_use:   %d\n",store->clk_1_pps_use);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       goodend:    %d\n",*goodend);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em710mba_rd_tide(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store,
-		short sonar, int *goodend, int *error)
-{
-	char	*function_name = "mbr_em710mba_rd_tide";
-	int	status = MB_SUCCESS;
-	char	line[EM3_TIDE_SIZE];
-	short	short_val;
-	size_t	read_len;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		fprintf(stderr,"dbg2       sonar:      %d\n",sonar);
-		}
-
-	/* set goodend false until a good end is found */
-	*goodend = MB_NO;
-
-	/* set kind and type values */
-	store->kind = MB_DATA_TIDE;
-	store->type = EM3_TIDE;
-	store->sonar = sonar;
-
-	/* read binary values into char array */
-	read_len = (size_t)(EM3_TIDE_SIZE-4);
-	status = mb_fileio_get(verbose, mbio_ptr, (char *)line, &read_len, error);
-
-	/* get binary data */
-	if (status == MB_SUCCESS)
-		{
-		mb_get_binary_int(swap, &line[0], &store->tid_date);
-		    store->date = store->tid_date;
-		mb_get_binary_int(swap, &line[4], &store->tid_msec);
-		    store->msec = store->tid_msec;
-		mb_get_binary_short(swap, &line[8], &short_val);
-		    store->tid_count = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[10], &short_val);
-		    store->tid_serial = (int) ((unsigned short) short_val);
-		mb_get_binary_int(swap, &line[12], &store->tid_origin_date);
-		mb_get_binary_int(swap, &line[16], &store->tid_origin_msec);
-		mb_get_binary_short(swap, &line[20], &short_val);
-		    store->tid_tide = (int) short_val;
-		if (line[EM3_TIDE_SIZE-7] == 0x03)
-			*goodend = MB_YES;
-#ifdef MBR_EM710MBA_DEBUG
-	fprintf(stderr, "End Bytes: %2.2hhX %d | %2.2hhX %d | %2.2hhX %d\n",
-		line[EM3_TIDE_SIZE-7], line[EM3_TIDE_SIZE-7],
-		line[EM3_TIDE_SIZE-6], line[EM3_TIDE_SIZE-6],
-		line[EM3_TIDE_SIZE-5], line[EM3_TIDE_SIZE-5]);
-#endif
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       tid_date:        %d\n",store->tid_date);
-		fprintf(stderr,"dbg5       tid_msec:        %d\n",store->tid_msec);
-		fprintf(stderr,"dbg5       tid_count:       %d\n",store->tid_count);
-		fprintf(stderr,"dbg5       tid_serial:      %d\n",store->tid_serial);
-		fprintf(stderr,"dbg5       tid_origin_date: %d\n",store->tid_origin_date);
-		fprintf(stderr,"dbg5       tid_origin_msec: %d\n",store->tid_origin_msec);
-		fprintf(stderr,"dbg5       tid_tide:        %d\n",store->tid_tide);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       goodend:    %d\n",*goodend);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em710mba_rd_height(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store,
-		short sonar, int *goodend, int *error)
-{
-	char	*function_name = "mbr_em710mba_rd_height";
-	int	status = MB_SUCCESS;
-	char	line[EM3_HEIGHT_SIZE];
-	short	short_val;
-	size_t	read_len;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		fprintf(stderr,"dbg2       sonar:      %d\n",sonar);
-		}
-
-	/* set goodend false until a good end is found */
-	*goodend = MB_NO;
-
-	/* set kind and type values */
-	store->kind = MB_DATA_HEIGHT;
-	store->type = EM3_HEIGHT;
-	store->sonar = sonar;
-
-	/* read binary values into char array */
-	read_len = (size_t)(EM3_HEIGHT_SIZE-4);
-	status = mb_fileio_get(verbose, mbio_ptr, (char *)line, &read_len, error);
-
-	/* get binary data */
-	if (status == MB_SUCCESS)
-		{
-		mb_get_binary_int(swap, &line[0], &store->hgt_date);
-		    store->date = store->hgt_date;
-		mb_get_binary_int(swap, &line[4], &store->hgt_msec);
-		    store->msec = store->hgt_msec;
-		mb_get_binary_short(swap, &line[8], &short_val);
-		    store->hgt_count = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[10], &short_val);
-		    store->hgt_serial = (int) ((unsigned short) short_val);
-		mb_get_binary_int(swap, &line[12], &store->hgt_height);
-		store->hgt_type = (mb_u_char) line[16];
-		if (line[EM3_HEIGHT_SIZE-7] == EM3_END)
-			*goodend = MB_YES;
-#ifdef MBR_EM710MBA_DEBUG
-	fprintf(stderr, "End Bytes: %2.2hhX %d | %2.2hhX %d | %2.2hhX %d\n",
-		line[EM3_HEIGHT_SIZE-7], line[EM3_HEIGHT_SIZE-7],
-		line[EM3_HEIGHT_SIZE-6], line[EM3_HEIGHT_SIZE-6],
-		line[EM3_HEIGHT_SIZE-5], line[EM3_HEIGHT_SIZE-5]);
-#endif
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       hgt_date:        %d\n",store->hgt_date);
-		fprintf(stderr,"dbg5       hgt_msec:        %d\n",store->hgt_msec);
-		fprintf(stderr,"dbg5       hgt_count:       %d\n",store->hgt_count);
-		fprintf(stderr,"dbg5       hgt_serial:      %d\n",store->hgt_serial);
-		fprintf(stderr,"dbg5       hgt_height:      %d\n",store->hgt_height);
-		fprintf(stderr,"dbg5       hgt_type:        %d\n",store->hgt_type);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       goodend:    %d\n",*goodend);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em710mba_rd_heading(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store,
-		short sonar, int *goodend, int *error)
-{
-	char	*function_name = "mbr_em710mba_rd_heading";
-	int	status = MB_SUCCESS;
-	struct mbsys_simrad3_heading_struct *heading;
-	char	line[EM3_HEADING_HEADER_SIZE];
-	short	short_val;
-	size_t	read_len;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		fprintf(stderr,"dbg2       sonar:      %d\n",sonar);
-		}
-
-	/* set goodend false until a good end is found */
-	*goodend = MB_NO;
-
-	/* get  storage structure */
-	heading = (struct mbsys_simrad3_heading_struct *) store->heading;
-
-	/* set kind and type values */
-	store->kind = MB_DATA_HEADING;
-	store->type = EM3_HEADING;
-	store->sonar = sonar;
-
-	/* read binary header values into char array */
-	read_len = (size_t)(EM3_HEADING_HEADER_SIZE);
-	status = mb_fileio_get(verbose, mbio_ptr, (char *)line, &read_len, error);
-
-	/* get binary header data */
-	if (status == MB_SUCCESS)
-		{
-		mb_get_binary_int(swap, &line[0], &heading->hed_date);
-		    store->date = heading->hed_date;
-		mb_get_binary_int(swap, &line[4], &heading->hed_msec);
-		    store->msec = heading->hed_msec;
-		mb_get_binary_short(swap, &line[8], &short_val);
-		    heading->hed_count = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[10], &short_val);
-		    heading->hed_serial = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[12], &short_val);
-		    heading->hed_ndata = (int) ((unsigned short) short_val);
-		}
-
-	/* read binary heading values */
-	if (status == MB_SUCCESS)
-	    {
-	    for (i=0;i<heading->hed_ndata && status == MB_SUCCESS;i++)
-		{
-		read_len = (size_t)(EM3_HEADING_SLICE_SIZE);
-		status = mb_fileio_get(verbose, mbio_ptr, (char *)line, &read_len, error);
-		if (status == MB_SUCCESS
-			&& i < MBSYS_SIMRAD3_MAXHEADING)
-			{
-			mb_get_binary_short(swap, &line[0], &short_val);
-			    heading->hed_time[i] = (int) ((unsigned short) short_val);
-			mb_get_binary_short(swap, &line[2], &short_val);
-			    heading->hed_heading[i] = (int) ((unsigned short) short_val);
-			}
-		}
-	    heading->hed_ndata = MIN(heading->hed_ndata, MBSYS_SIMRAD3_MAXHEADING);
-	    }
-
-	/* now get last bytes of record */
-	if (status == MB_SUCCESS)
-		{
-		read_len = (size_t)4;
-		status = mb_fileio_get(verbose, mbio_ptr, (char *)line, &read_len, error);
-		if (status == MB_SUCCESS)
-			{
-			heading->hed_heading_status = (mb_u_char) line[0];
-			}
-		else
-			{
-			/* return success here because all of the
-			    important information in this record has
-			    already been read - next attempt to read
-			    file will return error */
-			status = MB_SUCCESS;
-			*error = MB_ERROR_NO_ERROR;
-			}
-		if (line[1] == EM3_END)
-			*goodend = MB_YES;
-#ifdef MBR_EM710MBA_DEBUG
-	fprintf(stderr, "End Bytes: %2.2hhX %d | %2.2hhX %d | %2.2hhX %d\n",
-		line[1], line[1],
-		line[2], line[2],
-		line[3], line[3]);
-#endif
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       hed_date:        %d\n",heading->hed_date);
-		fprintf(stderr,"dbg5       hed_msec:        %d\n",heading->hed_msec);
-		fprintf(stderr,"dbg5       hed_count:       %d\n",heading->hed_count);
-		fprintf(stderr,"dbg5       hed_serial:      %d\n",heading->hed_serial);
-		fprintf(stderr,"dbg5       hed_ndata:       %d\n",heading->hed_ndata);
-		fprintf(stderr,"dbg5       count    time (msec)    heading (0.01 deg)\n");
-		fprintf(stderr,"dbg5       -----    -----------    ------------------\n");
-		for (i=0;i<heading->hed_ndata;i++)
-			fprintf(stderr,"dbg5        %4d      %7d          %7d\n",
-				i, heading->hed_time[i], heading->hed_heading[i]);
-		fprintf(stderr,"dbg5       hed_heading_status: %d\n",heading->hed_heading_status);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       goodend:    %d\n",*goodend);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em710mba_rd_ssv(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store,
-		short sonar, int *goodend, int *error)
-{
-	char	*function_name = "mbr_em710mba_rd_ssv";
-	int	status = MB_SUCCESS;
-	struct mbsys_simrad3_ssv_struct *ssv;
-	char	line[EM3_SSV_HEADER_SIZE];
-	short	short_val;
-	size_t	read_len;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		fprintf(stderr,"dbg2       sonar:      %d\n",sonar);
-		}
-
-	/* set goodend false until a good end is found */
-	*goodend = MB_NO;
-
-	/* get  storage structure */
-	ssv = (struct mbsys_simrad3_ssv_struct *) store->ssv;
-
-	/* set kind and type values */
-	store->kind = MB_DATA_SSV;
-	store->type = EM3_SSV;
-	store->sonar = sonar;
-
-	/* read binary header values into char array */
-	read_len = (size_t)EM3_SSV_HEADER_SIZE;
-	status = mb_fileio_get(verbose, mbio_ptr, (char *)line, &read_len, error);
-
-	/* get binary header data */
-	if (status == MB_SUCCESS)
-		{
-		mb_get_binary_int(swap, &line[0], &ssv->ssv_date);
-		    store->date = ssv->ssv_date;
-		mb_get_binary_int(swap, &line[4], &ssv->ssv_msec);
-		    store->msec = ssv->ssv_msec;
-		mb_get_binary_short(swap, &line[8], &short_val);
-		    ssv->ssv_count = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[10], &short_val);
-		    ssv->ssv_serial = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[12], &short_val);
-		    ssv->ssv_ndata = (int) ((unsigned short) short_val);
-		}
-
-	/* read binary ssv values */
-	if (status == MB_SUCCESS)
-	    {
-	    for (i=0;i<ssv->ssv_ndata && status == MB_SUCCESS;i++)
-		{
-		read_len = (size_t)EM3_SSV_SLICE_SIZE;
-		status = mb_fileio_get(verbose, mbio_ptr, (char *)line, &read_len, error);
-		if (status == MB_SUCCESS
-			&& i < MBSYS_SIMRAD3_MAXSSV)
-			{
-			mb_get_binary_short(swap, &line[0], &short_val);
-			    ssv->ssv_time[i] = (int) ((unsigned short) short_val);
-			mb_get_binary_short(swap, &line[2], &short_val);
-			    ssv->ssv_ssv[i] = (int) ((unsigned short) short_val);
-			}
-		}
-	    ssv->ssv_ndata = MIN(ssv->ssv_ndata, MBSYS_SIMRAD3_MAXSSV);
-	    }
-
-	/* now get last bytes of record */
-	if (status == MB_SUCCESS)
-		{
-		read_len = (size_t)4;
-		status = mb_fileio_get(verbose, mbio_ptr, (char *)line, &read_len, error);
-		if (status != MB_SUCCESS)
-			{
-			/* return success here because all of the
-			    important information in this record has
-			    already been read - next attempt to read
-			    file will return error */
-			status = MB_SUCCESS;
-			*error = MB_ERROR_NO_ERROR;
-			}
-		if (line[1] == EM3_END)
-			*goodend = MB_YES;
-#ifdef MBR_EM710MBA_DEBUG
-	fprintf(stderr, "End Bytes: %2.2hhX %d | %2.2hhX %d | %2.2hhX %d\n",
-		line[1], line[1],
-		line[2], line[2],
-		line[3], line[3]);
-#endif
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       ssv_date:        %d\n",ssv->ssv_date);
-		fprintf(stderr,"dbg5       ssv_msec:        %d\n",ssv->ssv_msec);
-		fprintf(stderr,"dbg5       ssv_count:       %d\n",ssv->ssv_count);
-		fprintf(stderr,"dbg5       ssv_serial:      %d\n",ssv->ssv_serial);
-		fprintf(stderr,"dbg5       ssv_ndata:       %d\n",ssv->ssv_ndata);
-		fprintf(stderr,"dbg5       count    time (msec)    ssv (0.1 m/s)\n");
-		fprintf(stderr,"dbg5       -----    -----------    ------------------\n");
-		for (i=0;i<ssv->ssv_ndata;i++)
-			fprintf(stderr,"dbg5        %4d      %7d          %7d\n",
-				i, ssv->ssv_time[i], ssv->ssv_ssv[i]);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       goodend:    %d\n",*goodend);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em710mba_rd_tilt(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store,
-		short sonar, int *goodend, int *error)
-{
-	char	*function_name = "mbr_em710mba_rd_tilt";
-	int	status = MB_SUCCESS;
-	struct mbsys_simrad3_tilt_struct *tilt;
-	char	line[EM3_TILT_HEADER_SIZE];
-	short	short_val;
-	size_t	read_len;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		fprintf(stderr,"dbg2       sonar:      %d\n",sonar);
-		}
-
-	/* set goodend false until a good end is found */
-	*goodend = MB_NO;
-
-	/* get  storage structure */
-	tilt = (struct mbsys_simrad3_tilt_struct *) store->tilt;
-
-	/* set kind and type values */
-	store->kind = MB_DATA_TILT;
-	store->type = EM3_TILT;
-	store->sonar = sonar;
-
-	/* read binary header values into char array */
-	read_len = (size_t)EM3_TILT_HEADER_SIZE;
-	status = mb_fileio_get(verbose, mbio_ptr, (char *)line, &read_len, error);
-
-	/* get binary header data */
-	if (status == MB_SUCCESS)
-		{
-		mb_get_binary_int(swap, &line[0], &tilt->tlt_date);
-		    store->date = tilt->tlt_date;
-		mb_get_binary_int(swap, &line[4], &tilt->tlt_msec);
-		    store->msec = tilt->tlt_msec;
-		mb_get_binary_short(swap, &line[8], &short_val);
-		    tilt->tlt_count = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[10], &short_val);
-		    tilt->tlt_serial = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[12], &short_val);
-		    tilt->tlt_ndata = (int) ((unsigned short) short_val);
-		}
-
-	/* read binary tilt values */
-	if (status == MB_SUCCESS)
-	    {
-	    for (i=0;i<tilt->tlt_ndata && status == MB_SUCCESS;i++)
-		{
-		read_len = (size_t)EM3_TILT_SLICE_SIZE;
-		status = mb_fileio_get(verbose, mbio_ptr, (char *)line, &read_len, error);
-		if (status == MB_SUCCESS
-			&& i < MBSYS_SIMRAD3_MAXTILT)
-			{
-			mb_get_binary_short(swap, &line[0], &short_val);
-			    tilt->tlt_time[i] = (int) ((unsigned short) short_val);
-			mb_get_binary_short(swap, &line[2], &short_val);
-			    tilt->tlt_tilt[i] = (int) ((unsigned short) short_val);
-			}
-		}
-	    tilt->tlt_ndata = MIN(tilt->tlt_ndata, MBSYS_SIMRAD3_MAXTILT);
-	    }
-
-	/* now get last bytes of record */
-	if (status == MB_SUCCESS)
-		{
-		read_len = (size_t)4;
-		status = mb_fileio_get(verbose, mbio_ptr, (char *)line, &read_len, error);
-		if (status != MB_SUCCESS)
-			{
-			/* return success here because all of the
-			    important information in this record has
-			    already been read - next attempt to read
-			    file will return error */
-			status = MB_SUCCESS;
-			*error = MB_ERROR_NO_ERROR;
-			}
-		if (line[1] == EM3_END)
-			*goodend = MB_YES;
-#ifdef MBR_EM710MBA_DEBUG
-	fprintf(stderr, "End Bytes: %2.2hhX %d | %2.2hhX %d | %2.2hhX %d\n",
-		line[1], line[1],
-		line[2], line[2],
-		line[3], line[3]);
-#endif
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       tlt_date:        %d\n",tilt->tlt_date);
-		fprintf(stderr,"dbg5       tlt_msec:        %d\n",tilt->tlt_msec);
-		fprintf(stderr,"dbg5       tlt_count:       %d\n",tilt->tlt_count);
-		fprintf(stderr,"dbg5       tlt_serial:      %d\n",tilt->tlt_serial);
-		fprintf(stderr,"dbg5       tlt_ndata:       %d\n",tilt->tlt_ndata);
-		fprintf(stderr,"dbg5       count    time (msec)    tilt (0.01 deg)\n");
-		fprintf(stderr,"dbg5       -----    -----------    ------------------\n");
-		for (i=0;i<tilt->tlt_ndata;i++)
-			fprintf(stderr,"dbg5        %4d      %7d          %7d\n",
-				i, tilt->tlt_time[i], tilt->tlt_tilt[i]);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       goodend:    %d\n",*goodend);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em710mba_rd_extraparameters(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store,
-		short sonar, int *goodend, int *error)
-{
-	char	*function_name = "mbr_em710mba_rd_extraparameters";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_simrad3_extraparameters_struct *extraparameters;
-	char	line[EM3_EXTRAPARAMETERS_HEADER_SIZE];
-	short	short_val;
-	size_t	read_len;
-	int	*record_size_save;
-	int	index;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		fprintf(stderr,"dbg2       sonar:      %d\n",sonar);
-		}
-
-	/* set goodend false until a good end is found */
-	*goodend = MB_NO;
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get  storage structure */
-	extraparameters = (struct mbsys_simrad3_extraparameters_struct *) store->extraparameters;
-
-	/* set kind and type values */
-	store->kind = MB_DATA_PARAMETER;
-	store->type = EM3_EXTRAPARAMETERS;
-	store->sonar = sonar;
-
-	/* read binary header values into char array */
-	read_len = (size_t)EM3_EXTRAPARAMETERS_HEADER_SIZE;
-	status = mb_fileio_get(verbose, mbio_ptr, (char *)line, &read_len, error);
-
-	/* get binary header data */
-	if (status == MB_SUCCESS)
-		{
-		mb_get_binary_int(swap, &line[0], &extraparameters->xtr_date);
-		    store->date = extraparameters->xtr_date;
-		mb_get_binary_int(swap, &line[4], &extraparameters->xtr_msec);
-		    store->msec = extraparameters->xtr_msec;
-		mb_get_binary_short(swap, &line[8], &short_val);
-		    extraparameters->xtr_count = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[10], &short_val);
-		    extraparameters->xtr_serial = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[12], &short_val);
-		    extraparameters->xtr_id = (int) ((unsigned short) short_val);
-		}
-
-	/* calculate length of data array */
-	if (status == MB_SUCCESS)
-		{
-		record_size_save = (int *) &mb_io_ptr->save2;
-		extraparameters->xtr_data_size = *record_size_save - 22;
-		}
-
-	/* allocate memory if necessary */
-	if (status == MB_SUCCESS && extraparameters->xtr_data_size > extraparameters->xtr_nalloc)
-		{
-		status = mb_mallocd(verbose, __FILE__, __LINE__, extraparameters->xtr_data_size,
-							(void **)&extraparameters->xtr_data, error);
-		if (status == MB_SUCCESS)
-			extraparameters->xtr_nalloc = extraparameters->xtr_data_size;
-		else
-			extraparameters->xtr_nalloc = 0;
-		}
-
-	/* read data */
-	if (status == MB_SUCCESS)
-		{
-		read_len = (size_t)extraparameters->xtr_data_size;
-		status = mb_fileio_get(verbose, mbio_ptr, (char *)extraparameters->xtr_data, &read_len, error);
-		}
-
-	/* parse data if possible */
-	if (status == MB_SUCCESS && extraparameters->xtr_id == 2)
-		{
-		index = 0;
-		mb_get_binary_int(swap, &(extraparameters->xtr_data[index]), &extraparameters->xtr_pqf_activepositioning);
-		for (i=0;i<3;i++)
-			{
-			mb_get_binary_short(swap, &(extraparameters->xtr_data[index]), &extraparameters->xtr_pqf_qfsetting[i]); index += 2;
-			}
-		for (i=0;i<3;i++)
-			{
-			mb_get_binary_int(swap, &(extraparameters->xtr_data[index]), &extraparameters->xtr_pqf_nqualityfactors[i]); index += 4;
-			}
-		for (i=0;i<3;i++)
-			{
-			for (j=0;j<extraparameters->xtr_pqf_nqualityfactors[i];j++)
-				{
-				mb_get_binary_int(swap, &(extraparameters->xtr_data[index]), &extraparameters->xtr_pqf_qfvalues[i][j]); index += 4;
-				mb_get_binary_int(swap, &(extraparameters->xtr_data[index]), &extraparameters->xtr_pqf_qflimits[i][j]); index += 4;
-				}
-			}
-		}
-
-	/* now get last bytes of record */
-	if (status == MB_SUCCESS)
-		{
-		read_len = (size_t)4;
-		status = mb_fileio_get(verbose, mbio_ptr, (char *)line, &read_len, error);
-		if (status != MB_SUCCESS)
-			{
-			/* return success here because all of the
-			    important information in this record has
-			    already been read - next attempt to read
-			    file will return error */
-			status = MB_SUCCESS;
-			*error = MB_ERROR_NO_ERROR;
-			}
-		if (line[1] == EM3_END)
-			*goodend = MB_YES;
-#ifdef MBR_EM710MBA_DEBUG
-	fprintf(stderr, "End Bytes: %2.2hhX %d | %2.2hhX %d | %2.2hhX %d\n",
-		line[1], line[1],
-		line[2], line[2],
-		line[3], line[3]);
-#endif
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       xtr_date:        %d\n",extraparameters->xtr_date);
-		fprintf(stderr,"dbg5       xtr_msec:        %d\n",extraparameters->xtr_msec);
-		fprintf(stderr,"dbg5       xtr_count:       %d\n",extraparameters->xtr_count);
-		fprintf(stderr,"dbg5       xtr_serial:      %d\n",extraparameters->xtr_serial);
-		fprintf(stderr,"dbg5       xtr_id:          %d\n",extraparameters->xtr_id);
-		fprintf(stderr,"dbg5       xtr_data_size:   %d\n",extraparameters->xtr_data_size);
-		fprintf(stderr,"dbg5       xtr_nalloc:      %d\n",extraparameters->xtr_nalloc);
-		if (extraparameters->xtr_id == 2)
-			{
-			fprintf(stderr,"dbg5       xtr_pqf_activepositioning:          %d\n",extraparameters->xtr_pqf_activepositioning);
-			for (i=0;i<3;i++)
-				{
-				fprintf(stderr,"dbg5       positioning system:%d qfsetting:%d nqf:%d\n",
-					i,extraparameters->xtr_pqf_qfsetting[i],extraparameters->xtr_pqf_nqualityfactors[i]);
-				for (j=0;j<extraparameters->xtr_pqf_nqualityfactors[i];j++)
-				fprintf(stderr,"dbg5       quality factor:%d value:%d limit:%d\n",
-					j,extraparameters->xtr_pqf_qfvalues[i][j],extraparameters->xtr_pqf_qflimits[i][j]);
-				}
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       goodend:    %d\n",*goodend);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em710mba_rd_attitude(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store,
-		short sonar, int *goodend, int *error)
-{
-	char	*function_name = "mbr_em710mba_rd_attitude";
-	int	status = MB_SUCCESS;
-	struct mbsys_simrad3_attitude_struct *attitude;
-	char	line[EM3_ATTITUDE_HEADER_SIZE];
-	short	short_val;
-	size_t	read_len;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		fprintf(stderr,"dbg2       sonar:      %d\n",sonar);
-		}
-
-	/* set goodend false until a good end is found */
-	*goodend = MB_NO;
-
-	/* get  storage structure */
-	attitude = (struct mbsys_simrad3_attitude_struct *) store->attitude;
-
-	/* set type values
-		- kind has to wait for the sensor descriptor value at the end of the record */
-	store->type = EM3_ATTITUDE;
-	store->sonar = sonar;
-
-	/* read binary header values into char array */
-	read_len = (size_t)EM3_ATTITUDE_HEADER_SIZE;
-	status = mb_fileio_get(verbose, mbio_ptr, (char *)line, &read_len, error);
-
-	/* get binary header data */
-	if (status == MB_SUCCESS)
-		{
-		mb_get_binary_int(swap, &line[0], &attitude->att_date);
-		    store->date = attitude->att_date;
-		mb_get_binary_int(swap, &line[4], &attitude->att_msec);
-		    store->msec = attitude->att_msec;
-		mb_get_binary_short(swap, &line[8], &short_val);
-		    attitude->att_count = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[10], &short_val);
-		    attitude->att_serial = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[12], &short_val);
-		    attitude->att_ndata = (int) ((unsigned short) short_val);
-		}
-
-	/* read binary attitude values */
-	if (status == MB_SUCCESS)
-	    {
-	    for (i=0;i<attitude->att_ndata && status == MB_SUCCESS;i++)
-		{
-		read_len = (size_t)EM3_ATTITUDE_SLICE_SIZE;
-		status = mb_fileio_get(verbose, mbio_ptr, (char *)line, &read_len, error);
-		if (status == MB_SUCCESS
-			&& i < MBSYS_SIMRAD3_MAXATTITUDE)
-			{
-			mb_get_binary_short(swap, &line[0], &short_val);
-			    attitude->att_time[i] = (int) ((unsigned short) short_val);
-			mb_get_binary_short(swap, &line[2], &short_val);
-			    attitude->att_sensor_status[i] = (int) ((unsigned short) short_val);
-			mb_get_binary_short(swap, &line[4], &short_val);
-			    attitude->att_roll[i] = (int) short_val;
-			mb_get_binary_short(swap, &line[6], &short_val);
-			    attitude->att_pitch[i] = (int) short_val;
-			mb_get_binary_short(swap, &line[8], &short_val);
-			    attitude->att_heave[i] = (int) short_val;
-			mb_get_binary_short(swap, &line[10], &short_val);
-			    attitude->att_heading[i] = (int) ((unsigned short) short_val);
-			}
-		}
-	    attitude->att_ndata = MIN(attitude->att_ndata, MBSYS_SIMRAD3_MAXATTITUDE);
-	    }
-
-	/* now get last bytes of record */
-	if (status == MB_SUCCESS)
-		{
-		read_len = (size_t)4;
-		status = mb_fileio_get(verbose, mbio_ptr, (char *)line, &read_len, error);
-		if (status == MB_SUCCESS)
-			{
-			attitude->att_sensordescriptor = (mb_u_char) line[0];
-			}
-		else
-			{
-			/* return success here because all of the
-			    important information in this record has
-			    already been read - next attempt to read
-			    file will return error */
-			status = MB_SUCCESS;
-			*error = MB_ERROR_NO_ERROR;
-			}
-		if (line[1] == EM3_END)
-			*goodend = MB_YES;
-#ifdef MBR_EM710MBA_DEBUG
-	fprintf(stderr, "End Bytes: %2.2hhX %d | %2.2hhX %d | %2.2hhX %d\n",
-		line[1], line[1],
-		line[2], line[2],
-		line[3], line[3]);
-#endif
-		}
-
-	/* Set data kind */
-	if (status == MB_SUCCESS)
-		{
-		/* set data kind */
-		if ((attitude->att_sensordescriptor & 48) == 0)
-			store->kind = MB_DATA_ATTITUDE;
-		else if ((attitude->att_sensordescriptor & 48) == 16)
-			store->kind = MB_DATA_ATTITUDE1;
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       kind:            %d\n",store->kind);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       att_date:        %d\n",attitude->att_date);
-		fprintf(stderr,"dbg5       att_msec:        %d\n",attitude->att_msec);
-		fprintf(stderr,"dbg5       att_count:       %d\n",attitude->att_count);
-		fprintf(stderr,"dbg5       att_serial:      %d\n",attitude->att_serial);
-		fprintf(stderr,"dbg5       att_ndata:       %d\n",attitude->att_ndata);
-		fprintf(stderr,"dbg5       cnt   time   roll pitch heave heading\n");
-		fprintf(stderr,"dbg5       -------------------------------------\n");
-		for (i=0;i<attitude->att_ndata;i++)
-			fprintf(stderr,"dbg5        %3d  %d  %d %d %d %d\n",
-				i, attitude->att_time[i], attitude->att_roll[i],
-				attitude->att_pitch[i], attitude->att_heave[i],
-				attitude->att_heading[i]);
-		fprintf(stderr,"dbg5       att_sensordescriptor: %d\n",attitude->att_sensordescriptor);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       goodend:    %d\n",*goodend);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em710mba_rd_netattitude(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store,
-		short sonar, int *goodend, int *error)
-{
-	char	*function_name = "mbr_em710mba_rd_netattitude";
-	int	status = MB_SUCCESS;
-	struct mbsys_simrad3_netattitude_struct *netattitude;
-	char	line[MBSYS_SIMRAD3_BUFFER_SIZE];
-	short	short_val;
-	size_t	read_len;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		fprintf(stderr,"dbg2       sonar:      %d\n",sonar);
-		}
-
-	/* set goodend false until a good end is found */
-	*goodend = MB_NO;
-
-	/* get  storage structure */
-	netattitude = (struct mbsys_simrad3_netattitude_struct *) store->netattitude;
-
-	/* set type values */
-	store->type = EM3_NETATTITUDE;
-	store->sonar = sonar;
-
-	/* read binary header values into char array */
-	read_len = (size_t)EM3_NETATTITUDE_HEADER_SIZE;
-	status = mb_fileio_get(verbose, mbio_ptr, (char *)line, &read_len, error);
-
-	/* get binary header data */
-	if (status == MB_SUCCESS)
-		{
-		mb_get_binary_int(swap, &line[0], &netattitude->nat_date);
-		    store->date = netattitude->nat_date;
-		mb_get_binary_int(swap, &line[4], &netattitude->nat_msec);
-		    store->msec = netattitude->nat_msec;
-		mb_get_binary_short(swap, &line[8], &short_val);
-		    netattitude->nat_count = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[10], &short_val);
-		    netattitude->nat_serial = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[12], &short_val);
-		    netattitude->nat_ndata = (int) ((unsigned short) short_val);
-		netattitude->nat_sensordescriptor = line[14];
-		}
-
-	/* Set data kind */
-	if (status == MB_SUCCESS)
-		{
-		/* set data kind */
-		store->kind = MB_DATA_ATTITUDE2;
-		}
-
-	/* read binary netattitude values */
-	if (status == MB_SUCCESS)
-	    {
-	    for (i=0;i<netattitude->nat_ndata && status == MB_SUCCESS;i++)
-		{
-		read_len = (size_t)EM3_NETATTITUDE_SLICE_SIZE;
-		status = mb_fileio_get(verbose, mbio_ptr, (char *)line, &read_len, error);
-		if (status == MB_SUCCESS
-			&& i < MBSYS_SIMRAD3_MAXATTITUDE)
-			{
-			mb_get_binary_short(swap, &line[0], &short_val);
-			    netattitude->nat_time[i] = (int) ((unsigned short) short_val);
-			mb_get_binary_short(swap, &line[2], &short_val);
-			    netattitude->nat_roll[i] = (int) short_val;
-			mb_get_binary_short(swap, &line[4], &short_val);
-			    netattitude->nat_pitch[i] = (int) short_val;
-			mb_get_binary_short(swap, &line[6], &short_val);
-			    netattitude->nat_heave[i] = (int) short_val;
-			mb_get_binary_short(swap, &line[8], &short_val);
-			    netattitude->nat_heading[i] = (int) ((unsigned short) short_val);
-			netattitude->nat_nbyte_raw[i] = (mb_u_char) line[10];
-			if (netattitude->nat_nbyte_raw[i] <= MBSYS_SIMRAD3_BUFFER_SIZE)
-				{
-				read_len = (size_t)(netattitude->nat_nbyte_raw[i]);
-				status = mb_fileio_get(verbose, mbio_ptr, (char *)line, &read_len, error);
-				if (status == MB_SUCCESS)
-					{
-					for (j=0;j<netattitude->nat_nbyte_raw[i];j++)
-						netattitude->nat_raw[i*MBSYS_SIMRAD3_BUFFER_SIZE+j] = line[j];
-					}
-				}
-			else
-				{
-				for (j=0;j<netattitude->nat_nbyte_raw[i];j++)
-					{
-					read_len = (size_t)1;
-					status = mb_fileio_get(verbose, mbio_ptr, (char *)line, &read_len, error);
-					}
-				netattitude->nat_nbyte_raw[i] = 0;
-				}
-			}
-		}
-	    netattitude->nat_ndata = MIN(netattitude->nat_ndata, MBSYS_SIMRAD3_MAXATTITUDE);
-	    }
-
-	/* now get last bytes of record */
-	if (status == MB_SUCCESS)
-		{
-		read_len = (size_t)1;
-		status = mb_fileio_get(verbose, mbio_ptr, (char *)line, &read_len, error);
-		if (line[0] != EM3_END)
-			{
-			read_len = (size_t)1;
-			status = mb_fileio_get(verbose, mbio_ptr, (char *)&line[1], &read_len, error);
-			}
-		else
-			line[1] = EM3_END;
-		read_len = (size_t)2;
-		status = mb_fileio_get(verbose, mbio_ptr, (char *)&line[2], &read_len, error);
-		if (status != MB_SUCCESS)
-			{
-			/* return success here because all of the
-			    important information in this record has
-			    already been read - next attempt to read
-			    file will return error */
-			status = MB_SUCCESS;
-			*error = MB_ERROR_NO_ERROR;
-			}
-		if (line[1] == EM3_END)
-			*goodend = MB_YES;
-#ifdef MBR_EM710MBA_DEBUG
-	fprintf(stderr, "End Bytes: %2.2hhX %d | %2.2hhX %d | %2.2hhX %d\n",
-		line[1], line[1],
-		line[2], line[2],
-		line[3], line[3]);
-#endif
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       kind:                 %d\n",store->kind);
-		fprintf(stderr,"dbg5       type:                 %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:                %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:                 %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:                 %d\n",store->msec);
-		fprintf(stderr,"dbg5       nat_date:             %d\n",netattitude->nat_date);
-		fprintf(stderr,"dbg5       nat_msec:             %d\n",netattitude->nat_msec);
-		fprintf(stderr,"dbg5       nat_count:            %d\n",netattitude->nat_count);
-		fprintf(stderr,"dbg5       nat_serial:           %d\n",netattitude->nat_serial);
-		fprintf(stderr,"dbg5       nat_ndata:            %d\n",netattitude->nat_ndata);
-		fprintf(stderr,"dbg5       nat_sensordescriptor: %d\n",netattitude->nat_sensordescriptor);
-		fprintf(stderr,"dbg5       cnt   time   roll pitch heave heading nraw\n");
-		fprintf(stderr,"dbg5       -------------------------------------\n");
-		for (i=0;i<netattitude->nat_ndata;i++)
-			{
-			fprintf(stderr,"dbg5        %3d  %d  %d %d %d %d %d\n",
-				i, netattitude->nat_time[i], netattitude->nat_roll[i],
-				netattitude->nat_pitch[i], netattitude->nat_heave[i],
-				netattitude->nat_heading[i],netattitude->nat_nbyte_raw[i]);
-			fprintf(stderr,"dbg5        nat_raw[%d]: ",netattitude->nat_nbyte_raw[i]);
-			for (j=0;j<netattitude->nat_nbyte_raw[i];j++)
-				fprintf(stderr,"%x",netattitude->nat_raw[i*MBSYS_SIMRAD3_BUFFER_SIZE+j]);
-			fprintf(stderr,"\n");
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       goodend:    %d\n",*goodend);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em710mba_rd_pos(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store,
-		short sonar, int *goodend, int *error)
-{
-	char	*function_name = "mbr_em710mba_rd_pos";
-	int	status = MB_SUCCESS;
-	char	line[MBSYS_SIMRAD3_COMMENT_LENGTH];
-	short	short_val;
-	size_t	read_len;
-	int	done;
-	int	navchannel;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		fprintf(stderr,"dbg2       sonar:      %d\n",sonar);
-		}
-
-	/* set goodend false until a good end is found */
-	*goodend = MB_NO;
-
-	/* set kind and type values */
-	store->kind = MB_DATA_NAV;
-	store->type = EM3_POS;
-	store->sonar = sonar;
-
-	/* read binary header values into char array */
-	read_len = (size_t)EM3_POS_HEADER_SIZE;
-	status = mb_fileio_get(verbose, mbio_ptr, (char *)line, &read_len, error);
-
-	/* get binary header data */
-	if (status == MB_SUCCESS)
-		{
-		mb_get_binary_int(swap, &line[0], &store->pos_date);
-		    store->date = store->pos_date;
-		mb_get_binary_int(swap, &line[4], &store->pos_msec);
-		    store->msec = store->pos_msec;
-		mb_get_binary_short(swap, &line[8], &short_val);
-		    store->pos_count = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[10], &short_val);
-		    store->pos_serial = (int) ((unsigned short) short_val);
-		mb_get_binary_int(swap, &line[12], &store->pos_latitude);
-		mb_get_binary_int(swap, &line[16], &store->pos_longitude);
-		mb_get_binary_short(swap, &line[20], &short_val);
-		    store->pos_quality = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[22], &short_val);
-		    store->pos_speed = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[24], &short_val);
-		    store->pos_course = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[26], &short_val);
-		    store->pos_heading = (int) ((unsigned short) short_val);
-		store->pos_system = (mb_u_char) line[28];
-		store->pos_input_size = (mb_u_char) line[29];
-		}
-
-	/* read input position string */
-	if (status == MB_SUCCESS && store->pos_input_size < 256)
-		{
-		read_len = (size_t)store->pos_input_size;
-		status = mb_fileio_get(verbose, mbio_ptr, (char *)store->pos_input, &read_len, error);
-		if (status == MB_SUCCESS)
-			{
-			store->pos_input[store->pos_input_size] = '\0';
-			}
-		}
-
-	/* now loop over reading individual characters to
-	    get last bytes of record */
-	if (status == MB_SUCCESS)
-	    {
-	    done = MB_NO;
-	    while (done == MB_NO)
-		{
-		read_len = (size_t)1;
-		status = mb_fileio_get(verbose, mbio_ptr, (char *)line, &read_len, error);
-		if (status == MB_SUCCESS && line[0] == EM3_END)
-			{
-			done = MB_YES;
-
-			/* get last two check sum bytes */
-			read_len = (size_t)2;
-			status = mb_fileio_get(verbose, mbio_ptr, (char *)&line[1], &read_len, error);
-
-			*goodend = MB_YES;
-#ifdef MBR_EM710MBA_DEBUG
-	fprintf(stderr, "End Bytes: %2.2hhX %d | %2.2hhX %d | %2.2hhX %d\n",
-		line[0], line[0],
-		line[1], line[1],
-		line[2], line[2]);
-#endif
-			}
-		else if (status != MB_SUCCESS)
-			{
-			done = MB_YES;
-			/* return success here because all of the
-			    important information in this record has
-			    already been read - next attempt to read
-			    file will return error */
-			status = MB_SUCCESS;
-			*error = MB_ERROR_NO_ERROR;
-			}
-		}
-#ifdef MBR_EM710MBA_DEBUG
-	fprintf(stderr, "\n");
-#endif
-	    }
-
-	/* check for navigation source */
-	if (status == MB_SUCCESS)
-		{
-		/* "active" nav system has first bit set in store->pos_system */
-		if (store->pos_system & 128)
-		    {
-		    store->kind = MB_DATA_NAV;
-		    }
-
-		/* otherwise its from a secondary nav system */
-		else
-		    {
-		    navchannel = (store->pos_system & 0x03);
-		    if (navchannel == 1)
-			{
-			store->kind = MB_DATA_NAV1;
-			}
-		    else if (navchannel == 2)
-			{
-			store->kind = MB_DATA_NAV2;
-			}
-		    else if (navchannel == 3)
-			{
-			store->kind = MB_DATA_NAV3;
-			}
-
-		    /* otherwise its an error */
-		    else
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_UNINTELLIGIBLE;
-			}
-		    }
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       pos_date:        %d\n",store->pos_date);
-		fprintf(stderr,"dbg5       pos_msec:        %d\n",store->pos_msec);
-		fprintf(stderr,"dbg5       pos_count:       %d\n",store->pos_count);
-		fprintf(stderr,"dbg5       pos_serial:      %d\n",store->pos_serial);
-		fprintf(stderr,"dbg5       pos_latitude:    %d\n",store->pos_latitude);
-		fprintf(stderr,"dbg5       pos_longitude:   %d\n",store->pos_longitude);
-		fprintf(stderr,"dbg5       pos_quality:     %d\n",store->pos_quality);
-		fprintf(stderr,"dbg5       pos_speed:       %d\n",store->pos_speed);
-		fprintf(stderr,"dbg5       pos_course:      %d\n",store->pos_course);
-		fprintf(stderr,"dbg5       pos_heading:     %d\n",store->pos_heading);
-		fprintf(stderr,"dbg5       pos_system:      %d\n",store->pos_system);
-		fprintf(stderr,"dbg5       pos_input_size:  %d\n",store->pos_input_size);
-		fprintf(stderr,"dbg5       pos_input:\ndbg5            %s\n",store->pos_input);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       goodend:    %d\n",*goodend);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em710mba_rd_svp(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store,
-		short sonar, int *goodend, int *error)
-{
-	char	*function_name = "mbr_em710mba_rd_svp";
-	int	status = MB_SUCCESS;
-	char	line[EM3_SVP_HEADER_SIZE];
-	short	short_val;
-	size_t	read_len;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		fprintf(stderr,"dbg2       sonar:      %d\n",sonar);
-		}
-
-	/* set goodend false until a good end is found */
-	*goodend = MB_NO;
-
-	/* set kind and type values */
-	store->kind = MB_DATA_VELOCITY_PROFILE;
-	store->type = EM3_SVP;
-	store->sonar = sonar;
-
-	/* read binary header values into char array */
-	read_len = (size_t)EM3_SVP_HEADER_SIZE;
-	status = mb_fileio_get(verbose, mbio_ptr, (char *)line, &read_len, error);
-
-	/* get binary header data */
-	if (status == MB_SUCCESS)
-		{
-		mb_get_binary_int(swap, &line[0], &store->svp_use_date);
-		    store->date = store->svp_use_date;
-		mb_get_binary_int(swap, &line[4], &store->svp_use_msec);
-		    store->msec = store->svp_use_msec;
-		mb_get_binary_short(swap, &line[8], &short_val);
-		    store->svp_count = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[10], &short_val);
-		    store->svp_serial = (int) ((unsigned short) short_val);
-		mb_get_binary_int(swap, &line[12], &store->svp_origin_date);
-		mb_get_binary_int(swap, &line[16], &store->svp_origin_msec);
-		mb_get_binary_short(swap, &line[20], &short_val);
-		    store->svp_num = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[22], &short_val);
-		    store->svp_depth_res = (int) ((unsigned short) short_val);
-		}
-
-	/* read binary svp values */
-	if (status == MB_SUCCESS)
-	    {
-	    for (i=0;i<store->svp_num && status == MB_SUCCESS;i++)
-		{
-		read_len = (size_t)EM3_SVP_SLICE_SIZE;
-		status = mb_fileio_get(verbose, mbio_ptr, (char *)line, &read_len, error);
-		if (status == MB_SUCCESS && i < MBSYS_SIMRAD3_MAXSVP)
-			{
-			mb_get_binary_short(swap, &line[0], &short_val);
-			    store->svp_depth[i] = (int) ((unsigned short) short_val);
-			mb_get_binary_short(swap, &line[2], &short_val);
-			    store->svp_vel[i] = (int) ((unsigned short) short_val);
-			}
-		}
-	    store->svp_num = MIN(store->svp_num, MBSYS_SIMRAD3_MAXSVP);
-	    }
-
-	/* now get last bytes of record */
-	if (status == MB_SUCCESS)
-		{
-		read_len = (size_t)4;
-		status = mb_fileio_get(verbose, mbio_ptr, (char *)line, &read_len, error);
-		if (status != MB_SUCCESS)
-			{
-			/* return success here because all of the
-			    important information in this record has
-			    already been read - next attempt to read
-			    file will return error */
-			status = MB_SUCCESS;
-			*error = MB_ERROR_NO_ERROR;
-			}
-		if (line[1] == EM3_END)
-			*goodend = MB_YES;
-#ifdef MBR_EM710MBA_DEBUG
-	fprintf(stderr, "End Bytes: %2.2hhX %d | %2.2hhX %d | %2.2hhX %d\n",
-		line[1], line[1],
-		line[2], line[2],
-		line[3], line[3]);
-#endif
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       svp_use_date:    %d\n",store->svp_use_date);
-		fprintf(stderr,"dbg5       svp_use_msec:    %d\n",store->svp_use_msec);
-		fprintf(stderr,"dbg5       svp_count:       %d\n",store->svp_count);
-		fprintf(stderr,"dbg5       svp_serial:      %d\n",store->svp_serial);
-		fprintf(stderr,"dbg5       svp_origin_date: %d\n",store->svp_origin_date);
-		fprintf(stderr,"dbg5       svp_origin_msec: %d\n",store->svp_origin_msec);
-		fprintf(stderr,"dbg5       svp_num:         %d\n",store->svp_num);
-		fprintf(stderr,"dbg5       svp_depth_res:   %d\n",store->svp_depth_res);
-		fprintf(stderr,"dbg5       count    depth    speed\n");
-		fprintf(stderr,"dbg5       -----------------------\n");
-		for (i=0;i<store->svp_num;i++)
-			fprintf(stderr,"dbg5        %d   %d  %d\n",
-				i, store->svp_depth[i], store->svp_vel[i]);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       goodend:    %d\n",*goodend);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em710mba_rd_svp2(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store,
-		short sonar, int *goodend, int *error)
-{
-	char	*function_name = "mbr_em710mba_rd_svp2";
-	int	status = MB_SUCCESS;
-	char	line[EM3_SVP2_HEADER_SIZE];
-	short	short_val;
-	size_t	read_len;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		fprintf(stderr,"dbg2       sonar:      %d\n",sonar);
-		}
-
-	/* set goodend false until a good end is found */
-	*goodend = MB_NO;
-
-	/* set kind and type values */
-	store->kind = MB_DATA_VELOCITY_PROFILE;
-	store->type = EM3_SVP2;
-	store->sonar = sonar;
-
-	/* read binary header values into char array */
-	read_len = (size_t)EM3_SVP2_HEADER_SIZE;
-	status = mb_fileio_get(verbose, mbio_ptr, (char *)line, &read_len, error);
-
-	/* get binary header data */
-	if (status == MB_SUCCESS)
-		{
-		mb_get_binary_int(swap, &line[0], &store->svp_use_date);
-		    store->date = store->svp_use_date;
-		mb_get_binary_int(swap, &line[4], &store->svp_use_msec);
-		    store->msec = store->svp_use_msec;
-		mb_get_binary_short(swap, &line[8], &short_val);
-		    store->svp_count = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[10], &short_val);
-		    store->svp_serial = (int) ((unsigned short) short_val);
-		mb_get_binary_int(swap, &line[12], &store->svp_origin_date);
-		mb_get_binary_int(swap, &line[16], &store->svp_origin_msec);
-		mb_get_binary_short(swap, &line[20], &short_val);
-		    store->svp_num = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[22], &short_val);
-		    store->svp_depth_res = (int) ((unsigned short) short_val);
-		}
-
-	/* read binary svp values */
-	if (status == MB_SUCCESS)
-	    {
-	    for (i=0;i<store->svp_num && status == MB_SUCCESS;i++)
-		{
-		read_len = (size_t)EM3_SVP2_SLICE_SIZE;
-		status = mb_fileio_get(verbose, mbio_ptr, (char *)line, &read_len, error);
-		if (status == MB_SUCCESS && i < MBSYS_SIMRAD3_MAXSVP)
-			{
-			mb_get_binary_int(swap, &line[0], &store->svp_depth[i]);
-			mb_get_binary_int(swap, &line[4], &store->svp_vel[i]);
-			}
-		}
-	    store->svp_num = MIN(store->svp_num, MBSYS_SIMRAD3_MAXSVP);
-	    }
-
-	/* now get last bytes of record */
-	if (status == MB_SUCCESS)
-		{
-		read_len = (size_t)4;
-		status = mb_fileio_get(verbose, mbio_ptr, (char *)line, &read_len, error);
-		if (status != MB_SUCCESS)
-			{
-			/* return success here because all of the
-			    important information in this record has
-			    already been read - next attempt to read
-			    file will return error */
-			status = MB_SUCCESS;
-			*error = MB_ERROR_NO_ERROR;
-			}
-		if (line[1] == EM3_END)
-			*goodend = MB_YES;
-#ifdef MBR_EM710MBA_DEBUG
-	fprintf(stderr, "End Bytes: %2.2hhX %d | %2.2hhX %d | %2.2hhX %d\n",
-		line[1], line[1],
-		line[2], line[2],
-		line[3], line[3]);
-#endif
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       svp_use_date:    %d\n",store->svp_use_date);
-		fprintf(stderr,"dbg5       svp_use_msec:    %d\n",store->svp_use_msec);
-		fprintf(stderr,"dbg5       svp_count:       %d\n",store->svp_count);
-		fprintf(stderr,"dbg5       svp_serial:      %d\n",store->svp_serial);
-		fprintf(stderr,"dbg5       svp_origin_date: %d\n",store->svp_origin_date);
-		fprintf(stderr,"dbg5       svp_origin_msec: %d\n",store->svp_origin_msec);
-		fprintf(stderr,"dbg5       svp_num:         %d\n",store->svp_num);
-		fprintf(stderr,"dbg5       svp_depth_res:   %d\n",store->svp_depth_res);
-		fprintf(stderr,"dbg5       count    depth    speed\n");
-		fprintf(stderr,"dbg5       -----------------------\n");
-		for (i=0;i<store->svp_num;i++)
-			fprintf(stderr,"dbg5        %d   %d  %d\n",
-				i, store->svp_depth[i], store->svp_vel[i]);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       goodend:    %d\n",*goodend);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em710mba_rd_bath2(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store,
-		short sonar, int version, int *goodend, int *error)
-{
-	char	*function_name = "mbr_em710mba_rd_bath2";
-	int	status = MB_SUCCESS;
-	struct mbsys_simrad3_ping_struct *ping;
-	char	line[EM3_BATH2_HEADER_SIZE];
-	short	short_val;
-	float	float_val;
-	int	int_val;
-	size_t	read_len;
-	int	png_count;
-	int	serial;
-	int	oldest_ping;
-	int	oldest_ping_index;
-	int	found;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		fprintf(stderr,"dbg2       sonar:      %d\n",sonar);
-		fprintf(stderr,"dbg2       version:    %d\n",version);
-		}
-
-	/* set goodend false until a good end is found */
-	*goodend = MB_NO;
-
-	/* set kind and type values */
-	store->kind = MB_DATA_DATA;
-	store->type = EM3_BATH;
-	store->sonar = sonar;
-
-	/* read binary header values into char array */
-	read_len = (size_t)EM3_BATH2_HEADER_SIZE;
-	status = mb_fileio_get(verbose, mbio_ptr, (char *)line, &read_len, error);
-
-	/* figure out which storage structure to use */
-	mb_get_binary_short(swap, &line[8], &short_val);
-	png_count = (int) ((unsigned short) short_val);
-	mb_get_binary_short(swap, &line[10], &short_val);
-	serial = (int) ((unsigned short) short_val);
-	found = MB_NO;
-	oldest_ping = 999999999;
-	oldest_ping_index = -1;
-	for (i=0;i<MBSYS_SIMRAD3_NUM_PING_STRUCTURES && found == MB_NO;i++)
-		{
-		/* look for this ping by ping number and sonar serial number - if we already read
-		 * a record from this ping it has to be stored in one of the structures */
-		if (store->pings[i].read_status > 0 && png_count == store->pings[i].count && serial == store->pings[i].serial)
-			{
-			found = MB_YES;
-			store->ping_index = i;
-			}
-			
-		/* figure out which structure is holding the oldest ping in case we need to drop one
-		 * from memory to make room for the new ping. */
-		else if (store->pings[i].read_status > 0)
-			{
-			if (png_count < oldest_ping)
-				{
-				oldest_ping = png_count;
-				oldest_ping_index = i;
-				}
-			}
-			
-		/* if one of the ping structures is unused, set it to be used if we need to store
-		 * this ping */
-		else if (oldest_ping > 0)
-			{
-			oldest_ping = 0;
-			oldest_ping_index = i;
-			}
-		}
-	if (found == MB_NO)
-		{
-		store->ping_index = oldest_ping_index;
-		}
-	ping = (struct mbsys_simrad3_ping_struct *) &store->pings[store->ping_index];
-	ping->count = png_count;
-	ping->serial = serial;
-
-	/* get binary header data */
-	if (status == MB_SUCCESS)
-		{
-		mb_get_binary_int(swap, &line[0], &ping->png_date);
-		    store->date = ping->png_date;
-		mb_get_binary_int(swap, &line[4], &ping->png_msec);
-		    store->msec = ping->png_msec;
-		mb_get_binary_short(swap, &line[8], &short_val);
-		    ping->png_count = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[10], &short_val);
-		    ping->png_serial = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[12], &short_val);
-		    ping->png_heading = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[14], &short_val);
-		    ping->png_ssv = (int) ((unsigned short) short_val);
-		mb_get_binary_float(swap, &line[16], &float_val);
-		    ping->png_xducer_depth = float_val;
-		mb_get_binary_short(swap, &line[20], &short_val);
-		    ping->png_nbeams = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[22], &short_val);
-		    ping->png_nbeams_valid = (int) ((unsigned short) short_val);
-		mb_get_binary_float(swap, &line[24], &float_val);
-		    ping->png_sample_rate = float_val;
-		mb_get_binary_int(swap, &line[28], &int_val);
-		    ping->png_spare = int_val;
-#ifdef MBR_EM710MBA_DEBUG
-fprintf(stderr,"mbr_em710mba_rd_bath2:    ping->png_date:%d     ping->png_msec:%d     ping->png_count:%d     ping->png_nbeams:%d\n",
-ping->png_date,ping->png_msec,ping->png_count,ping->png_nbeams);
-#endif
-		}
-
-	/* check for some indicators of a broken record
-	    - these do happen!!!! */
-	if (status == MB_SUCCESS)
-		{
-		if (ping->png_nbeams_valid > ping->png_nbeams
-			|| ping->png_nbeams < 0
-			|| ping->png_nbeams_valid < 0
-			|| ping->png_nbeams > MBSYS_SIMRAD3_MAXBEAMS
-			|| ping->png_nbeams_valid > MBSYS_SIMRAD3_MAXBEAMS)
-			{
-#ifdef MBR_EM710MBA_DEBUG
-fprintf(stderr,"mbr_em710mba_rd_bath2: ERROR SET: ping->png_nbeams:%d ping->png_nbeams_valid:%d MBSYS_SIMRAD3_MAXBEAMS:%d\n",
-ping->png_nbeams,ping->png_nbeams_valid,MBSYS_SIMRAD3_MAXBEAMS);
-#endif
-			status = MB_FAILURE;
-			*error = MB_ERROR_UNINTELLIGIBLE;
-			}
-		}
-
-	/* read binary beam values */
-	if (status == MB_SUCCESS)
-	    {
-	    for (i=0;i<ping->png_nbeams && status == MB_SUCCESS;i++)
-		{
-		read_len = (size_t)EM3_BATH2_BEAM_SIZE;
-		status = mb_fileio_get(verbose, mbio_ptr, (char *)line, &read_len, error);
-		if (status == MB_SUCCESS
-			&& i < MBSYS_SIMRAD3_MAXBEAMS)
-			{
-			mb_get_binary_float(swap, &line[0], &float_val);
-			    ping->png_depth[i] = float_val;
-			mb_get_binary_float(swap, &line[4], &float_val);
-			    ping->png_acrosstrack[i] = float_val;
-			mb_get_binary_float(swap, &line[8], &float_val);
-			    ping->png_alongtrack[i] = float_val;
-			mb_get_binary_short(swap, &line[12], &short_val);
-			    ping->png_window[i] = (int) ((unsigned short) short_val);
-			ping->png_quality[i] = (int)((mb_u_char) line[14]);
-			ping->png_iba[i] = (int)((mb_s_char) line[15]);
-			ping->png_detection[i] = (int)((mb_u_char) line[16]);
-			ping->png_clean[i] = (int)((mb_s_char) line[17]);
-			mb_get_binary_short(swap, &line[18], &short_val);
-			    ping->png_amp[i] = (int) short_val;
-			}
-		}
-	    }
-
-	/* now get last bytes of record */
-	if (status == MB_SUCCESS)
-		{
-		read_len = (size_t)4;
-		status = mb_fileio_get(verbose, mbio_ptr, (char *)line, &read_len, error);
-		if (line[1] == EM3_END)
-			*goodend = MB_YES;
-#ifdef MBR_EM710MBA_DEBUG
-	fprintf(stderr, "End Bytes: %2.2hhX %d | %2.2hhX %d | %2.2hhX %d\n",
-		line[1], line[1],
-		line[2], line[2],
-		line[3], line[3]);
-#endif
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:                  %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:                 %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:                  %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:                  %d\n",store->msec);
-		fprintf(stderr,"dbg5       png_date:              %d\n",ping->png_date);
-		fprintf(stderr,"dbg5       png_msec:              %d\n",ping->png_msec);
-		fprintf(stderr,"dbg5       png_count:             %d\n",ping->png_count);
-		fprintf(stderr,"dbg5       png_serial:            %d\n",ping->png_serial);
-		fprintf(stderr,"dbg5       png_heading:           %d\n",ping->png_heading);
-		fprintf(stderr,"dbg5       png_ssv:               %d\n",ping->png_ssv);
-		fprintf(stderr,"dbg5       png_xducer_depth:      %f\n",ping->png_xducer_depth);
-		fprintf(stderr,"dbg5       png_nbeams:            %d\n",ping->png_nbeams);
-		fprintf(stderr,"dbg5       png_nbeams_valid:      %d\n",ping->png_nbeams_valid);
-		fprintf(stderr,"dbg5       png_sample_rate:       %f\n",ping->png_sample_rate);
-		fprintf(stderr,"dbg5       png_spare:             %d\n",ping->png_spare);
-		fprintf(stderr,"dbg5       cnt  depth xtrack ltrack win  qual  iba det cln amp\n");
-		fprintf(stderr,"dbg5       ------------------------------------------------------------\n");
-		for (i=0;i<ping->png_nbeams;i++)
-			fprintf(stderr,"dbg5       %3d %7.2f %7.2f %7.2f %5d %5d %5d %4d %3d %3d\n",
-				i, ping->png_depth[i], ping->png_acrosstrack[i],
-				ping->png_alongtrack[i], ping->png_window[i],
-				ping->png_quality[i], ping->png_iba[i],
-				ping->png_detection[i], ping->png_clean[i],
-				ping->png_amp[i]);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       goodend:    %d\n",*goodend);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em710mba_rd_bath2_mba(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store,
-		short sonar, int version, int *goodend, int *error)
-{
-	char	*function_name = "mbr_em710mba_rd_bath2_mba";
-	int	status = MB_SUCCESS;
-	struct mbsys_simrad3_ping_struct *ping;
-	char	line[EM3_BATH2_MBA_HEADER_SIZE];
-	short	short_val;
-	float	float_val;
-	int	int_val;
-	size_t	read_len;
-	int	png_count;
-	int	serial;
-	int	oldest_ping;
-	int	oldest_ping_index;
-	int	found;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		fprintf(stderr,"dbg2       sonar:      %d\n",sonar);
-		fprintf(stderr,"dbg2       version:    %d\n",version);
-		}
-
-	/* set goodend false until a good end is found */
-	*goodend = MB_NO;
-
-	/* set kind and type values */
-	store->kind = MB_DATA_DATA;
-	store->type = EM3_BATH;
-	store->sonar = sonar;
-
-	/* read binary header values into char array */
-	read_len = (size_t)EM3_BATH2_MBA_HEADER_SIZE;
-	status = mb_fileio_get(verbose, mbio_ptr, (char *)line, &read_len, error);
-
-	/* figure out which storage structure to use */
-	mb_get_binary_short(swap, &line[8], &short_val);
-	png_count = (int) ((unsigned short) short_val);
-	mb_get_binary_short(swap, &line[10], &short_val);
-	serial = (int) ((unsigned short) short_val);
-	found = MB_NO;
-	oldest_ping = 999999999;
-	oldest_ping_index = -1;
-	for (i=0;i<MBSYS_SIMRAD3_NUM_PING_STRUCTURES && found == MB_NO;i++)
-		{
-		/* look for this ping by ping number and sonar serial number - if we already read
-		 * a record from this ping it has to be stored in one of the structures */
-		if (store->pings[i].read_status > 0 && png_count == store->pings[i].count && serial == store->pings[i].serial)
-			{
-			found = MB_YES;
-			store->ping_index = i;
-			}
-			
-		/* figure out which structure is holding the oldest ping in case we need to drop one
-		 * from memory to make room for the new ping. */
-		else if (store->pings[i].read_status > 0)
-			{
-			if (png_count < oldest_ping)
-				{
-				oldest_ping = png_count;
-				oldest_ping_index = i;
-				}
-			}
-			
-		/* if one of the ping structures is unused, set it to be used if we need to store
-		 * this ping */
-		else if (oldest_ping > 0)
-			{
-			oldest_ping = 0;
-			oldest_ping_index = i;
-			}
-		}
-	if (found == MB_NO)
-		{
-		store->ping_index = oldest_ping_index;
-		}
-	ping = (struct mbsys_simrad3_ping_struct *) &store->pings[store->ping_index];
-	ping->count = png_count;
-	ping->serial = serial;
-
-	/* get binary header data */
-	if (status == MB_SUCCESS)
-		{
-		mb_get_binary_int(swap, &line[0], &ping->png_date);
-		    store->date = ping->png_date;
-		mb_get_binary_int(swap, &line[4], &ping->png_msec);
-		    store->msec = ping->png_msec;
-		mb_get_binary_short(swap, &line[8], &short_val);
-		    ping->png_count = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[10], &short_val);
-		    ping->png_serial = (int) ((unsigned short) short_val);
-		mb_get_binary_int(swap, &line[12], &int_val);
-		    ping->png_latitude = int_val;
-		mb_get_binary_int(swap, &line[16], &int_val);
-		    ping->png_longitude = int_val;
-		mb_get_binary_short(swap, &line[20], &short_val);
-		    ping->png_heading = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[22], &short_val);
-		    ping->png_heave = (int) ((short) short_val);
-		mb_get_binary_short(swap, &line[24], &short_val);
-		    ping->png_roll = (int) ((short) short_val);
-		mb_get_binary_short(swap, &line[26], &short_val);
-		    ping->png_pitch = (int) ((short) short_val);
-		mb_get_binary_short(swap, &line[28], &short_val);
-		    ping->png_speed = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[30], &short_val);
-		    ping->png_ssv = (int) ((unsigned short) short_val);
-		mb_get_binary_float(swap, &line[32], &float_val);
-		    ping->png_xducer_depth = float_val;
-		mb_get_binary_short(swap, &line[36], &short_val);
-		    ping->png_nbeams = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[38], &short_val);
-		    ping->png_nbeams_valid = (int) ((unsigned short) short_val);
-		mb_get_binary_float(swap, &line[40], &float_val);
-		    ping->png_sample_rate = float_val;
-		mb_get_binary_int(swap, &line[44], &int_val);
-		    ping->png_spare = int_val;
-#ifdef MBR_EM710MBA_DEBUG
-fprintf(stderr,"mbr_em710mba_rd_bath2_mba:    ping->png_date:%d     ping->png_msec:%d     ping->png_count:%d     ping->png_nbeams:%d\n",
-ping->png_date,ping->png_msec,ping->png_count,ping->png_nbeams);
-#endif
-		}
-
-	/* check for some indicators of a broken record
-	    - these do happen!!!! */
-	if (status == MB_SUCCESS)
-		{
-		if (ping->png_nbeams_valid > ping->png_nbeams
-			|| ping->png_nbeams < 0
-			|| ping->png_nbeams_valid < 0
-			|| ping->png_nbeams > MBSYS_SIMRAD3_MAXBEAMS
-			|| ping->png_nbeams_valid > MBSYS_SIMRAD3_MAXBEAMS)
-			{
-#ifdef MBR_EM710MBA_DEBUG
-fprintf(stderr,"mbr_em710mba_rd_bath2_mba: ERROR SET: ping->png_nbeams:%d ping->png_nbeams_valid:%d MBSYS_SIMRAD3_MAXBEAMS:%d\n",
-ping->png_nbeams,ping->png_nbeams_valid,MBSYS_SIMRAD3_MAXBEAMS);
-#endif
-			status = MB_FAILURE;
-			*error = MB_ERROR_UNINTELLIGIBLE;
-			}
-		}
-
-	/* read binary beam values */
-	if (status == MB_SUCCESS)
-	    {
-	    for (i=0;i<ping->png_nbeams && status == MB_SUCCESS;i++)
-		{
-		read_len = (size_t)EM3_BATH2_MBA_BEAM_SIZE;
-		status = mb_fileio_get(verbose, mbio_ptr, (char *)line, &read_len, error);
-		if (status == MB_SUCCESS
-			&& i < MBSYS_SIMRAD3_MAXBEAMS)
-			{
-			mb_get_binary_float(swap, &line[0], &float_val);
-			    ping->png_depth[i] = float_val;
-			mb_get_binary_float(swap, &line[4], &float_val);
-			    ping->png_acrosstrack[i] = float_val;
-			mb_get_binary_float(swap, &line[8], &float_val);
-			    ping->png_alongtrack[i] = float_val;
-			mb_get_binary_short(swap, &line[12], &short_val);
-			    ping->png_window[i] = (int) ((unsigned short) short_val);
-			ping->png_quality[i] = (int)((mb_u_char) line[14]);
-			ping->png_iba[i] = (int)((mb_s_char) line[15]);
-			ping->png_detection[i] = (int)((mb_u_char) line[16]);
-			ping->png_clean[i] = (int)((mb_s_char) line[17]);
-			mb_get_binary_short(swap, &line[18], &short_val);
-			    ping->png_amp[i] = (int) short_val;
-			mb_get_binary_float(swap, &line[20], &float_val);
-			    ping->png_depression[i] = float_val;
-			mb_get_binary_float(swap, &line[24], &float_val);
-			    ping->png_azimuth[i] = float_val;
-			mb_get_binary_float(swap, &line[28], &float_val);
-			    ping->png_range[i] = float_val;
-			    ping->png_bheave[i] = 0.01 * (float)ping->png_heave;
-			ping->png_beamflag[i] = (int)((mb_s_char) line[32]);
-			/* ignore line[33] */
-			}
-		}
-	    }
-
-	/* now get last bytes of record */
-	if (status == MB_SUCCESS)
-		{
-		read_len = (size_t)4;
-		status = mb_fileio_get(verbose, mbio_ptr, (char *)line, &read_len, error);
-		if (line[1] == EM3_END)
-			*goodend = MB_YES;
-#ifdef MBR_EM710MBA_DEBUG
-	fprintf(stderr, "End Bytes: %2.2hX %d | %2.2hX %d | %2.2hX %d\n",
-		line[1], line[1],
-		line[2], line[2],
-		line[3], line[3]);
-#endif
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:                  %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:                 %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:                  %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:                  %d\n",store->msec);
-		fprintf(stderr,"dbg5       png_date:              %d\n",ping->png_date);
-		fprintf(stderr,"dbg5       png_msec:              %d\n",ping->png_msec);
-		fprintf(stderr,"dbg5       png_count:             %d\n",ping->png_count);
-		fprintf(stderr,"dbg5       png_serial:            %d\n",ping->png_serial);
-		fprintf(stderr,"dbg5       png_latitude:          %d\n",ping->png_latitude);
-		fprintf(stderr,"dbg5       png_longitude:         %d\n",ping->png_longitude);
-		fprintf(stderr,"dbg5       png_heading:           %d\n",ping->png_heading);
-		fprintf(stderr,"dbg5       png_heave:             %d\n",ping->png_heave);
-		fprintf(stderr,"dbg5       png_roll:              %d\n",ping->png_roll);
-		fprintf(stderr,"dbg5       png_pitch:             %d\n",ping->png_pitch);
-		fprintf(stderr,"dbg5       png_speed:             %d\n",ping->png_speed);
-		fprintf(stderr,"dbg5       png_ssv:               %d\n",ping->png_ssv);
-		fprintf(stderr,"dbg5       png_xducer_depth:      %f\n",ping->png_xducer_depth);
-		fprintf(stderr,"dbg5       png_nbeams:            %d\n",ping->png_nbeams);
-		fprintf(stderr,"dbg5       png_nbeams_valid:      %d\n",ping->png_nbeams_valid);
-		fprintf(stderr,"dbg5       png_sample_rate:       %f\n",ping->png_sample_rate);
-		fprintf(stderr,"dbg5       png_spare:             %d\n",ping->png_spare);
-		fprintf(stderr,"dbg5       cnt  depth xtrack ltrack win  qual  iba det cln amp depression azimuth range heave flag\n");
-		fprintf(stderr,"dbg5       ------------------------------------------------------------\n");
-		for (i=0;i<ping->png_nbeams;i++)
-			fprintf(stderr,"dbg5       %3d %7.2f %7.2f %7.2f %5d %5d %5d %4d %3d %3d %7.2f %7.2f %7.2f %7.2f %3u\n",
-				i, ping->png_depth[i], ping->png_acrosstrack[i],
-				ping->png_alongtrack[i], ping->png_window[i],
-				ping->png_quality[i], ping->png_iba[i],
-				ping->png_detection[i], ping->png_clean[i],
-				ping->png_amp[i], ping->png_depression[i],
-				ping->png_azimuth[i], ping->png_range[i], ping->png_bheave[i],
-				ping->png_beamflag[i]);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       goodend:    %d\n",*goodend);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em710mba_rd_bath3_mba(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store,
-		short sonar, int version, int *goodend, int *error)
-{
-	char	*function_name = "mbr_em710mba_rd_bath3_mba";
-	int	status = MB_SUCCESS;
-	struct mbsys_simrad3_ping_struct *ping;
-	char	line[EM3_BATH3_MBA_HEADER_SIZE];
-	short	short_val;
-	float	float_val;
-	int	int_val;
-	size_t	read_len;
-	int	png_count;
-	int	serial;
-	int	oldest_ping;
-	int	oldest_ping_index;
-	int	found;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		fprintf(stderr,"dbg2       sonar:      %d\n",sonar);
-		fprintf(stderr,"dbg2       version:    %d\n",version);
-		}
-
-	/* set goodend false until a good end is found */
-	*goodend = MB_NO;
-
-	/* set kind and type values */
-	store->kind = MB_DATA_DATA;
-	store->type = EM3_BATH;
-	store->sonar = sonar;
-
-	/* read binary header values into char array */
-	read_len = (size_t)EM3_BATH3_MBA_HEADER_SIZE;
-	status = mb_fileio_get(verbose, mbio_ptr, (char *)line, &read_len, error);
-
-	/* figure out which storage structure to use */
-	mb_get_binary_short(swap, &line[8], &short_val);
-	png_count = (int) ((unsigned short) short_val);
-	mb_get_binary_short(swap, &line[10], &short_val);
-	serial = (int) ((unsigned short) short_val);
-	found = MB_NO;
-	oldest_ping = 999999999;
-	oldest_ping_index = -1;
-	for (i=0;i<MBSYS_SIMRAD3_NUM_PING_STRUCTURES && found == MB_NO;i++)
-		{
-		/* look for this ping by ping number and sonar serial number - if we already read
-		 * a record from this ping it has to be stored in one of the structures */
-		if (store->pings[i].read_status > 0 && png_count == store->pings[i].count && serial == store->pings[i].serial)
-			{
-			found = MB_YES;
-			store->ping_index = i;
-			}
-			
-		/* figure out which structure is holding the oldest ping in case we need to drop one
-		 * from memory to make room for the new ping. */
-		else if (store->pings[i].read_status > 0)
-			{
-			if (png_count < oldest_ping)
-				{
-				oldest_ping = png_count;
-				oldest_ping_index = i;
-				}
-			}
-			
-		/* if one of the ping structures is unused, set it to be used if we need to store
-		 * this ping */
-		else if (oldest_ping > 0)
-			{
-			oldest_ping = 0;
-			oldest_ping_index = i;
-			}
-		}
-	if (found == MB_NO)
-		{
-		store->ping_index = oldest_ping_index;
-		}
-	ping = (struct mbsys_simrad3_ping_struct *) &store->pings[store->ping_index];
-	ping->count = png_count;
-	ping->serial = serial;
-
-	/* get binary header data */
-	if (status == MB_SUCCESS)
-		{
-		mb_get_binary_int(swap, &line[0], &ping->png_date);
-		    store->date = ping->png_date;
-		mb_get_binary_int(swap, &line[4], &ping->png_msec);
-		    store->msec = ping->png_msec;
-		mb_get_binary_short(swap, &line[8], &short_val);
-		    ping->png_count = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[10], &short_val);
-		    ping->png_serial = (int) ((unsigned short) short_val);
-		mb_get_binary_int(swap, &line[12], &int_val);
-		    ping->png_latitude = int_val;
-		mb_get_binary_int(swap, &line[16], &int_val);
-		    ping->png_longitude = int_val;
-		mb_get_binary_short(swap, &line[20], &short_val);
-		    ping->png_heading = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[22], &short_val);
-		    ping->png_heave = (int) ((short) short_val);
-		mb_get_binary_short(swap, &line[24], &short_val);
-		    ping->png_roll = (int) ((short) short_val);
-		mb_get_binary_short(swap, &line[26], &short_val);
-		    ping->png_pitch = (int) ((short) short_val);
-		mb_get_binary_short(swap, &line[28], &short_val);
-		    ping->png_speed = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[30], &short_val);
-		    ping->png_ssv = (int) ((unsigned short) short_val);
-		mb_get_binary_float(swap, &line[32], &float_val);
-		    ping->png_xducer_depth = float_val;
-		mb_get_binary_short(swap, &line[36], &short_val);
-		    ping->png_nbeams = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[38], &short_val);
-		    ping->png_nbeams_valid = (int) ((unsigned short) short_val);
-		mb_get_binary_float(swap, &line[40], &float_val);
-		    ping->png_sample_rate = float_val;
-		mb_get_binary_int(swap, &line[44], &int_val);
-		    ping->png_spare = int_val;
-#ifdef MBR_EM710MBA_DEBUG
-fprintf(stderr,"mbr_em710mba_rd_bath3_mba:    ping->png_date:%d     ping->png_msec:%d     ping->png_count:%d     ping->png_nbeams:%d\n",
-ping->png_date,ping->png_msec,ping->png_count,ping->png_nbeams);
-#endif
-		}
-
-	/* check for some indicators of a broken record
-	    - these do happen!!!! */
-	if (status == MB_SUCCESS)
-		{
-		if (ping->png_nbeams_valid > ping->png_nbeams
-			|| ping->png_nbeams < 0
-			|| ping->png_nbeams_valid < 0
-			|| ping->png_nbeams > MBSYS_SIMRAD3_MAXBEAMS
-			|| ping->png_nbeams_valid > MBSYS_SIMRAD3_MAXBEAMS)
-			{
-#ifdef MBR_EM710MBA_DEBUG
-fprintf(stderr,"mbr_em710mba_rd_bath3_mba: ERROR SET: ping->png_nbeams:%d ping->png_nbeams_valid:%d MBSYS_SIMRAD3_MAXBEAMS:%d\n",
-ping->png_nbeams,ping->png_nbeams_valid,MBSYS_SIMRAD3_MAXBEAMS);
-#endif
-			status = MB_FAILURE;
-			*error = MB_ERROR_UNINTELLIGIBLE;
-			}
-		}
-
-	/* read binary beam values */
-	if (status == MB_SUCCESS)
-	    {
-	    for (i=0;i<ping->png_nbeams && status == MB_SUCCESS;i++)
-		{
-		read_len = (size_t)EM3_BATH3_MBA_BEAM_SIZE;
-		status = mb_fileio_get(verbose, mbio_ptr, (char *)line, &read_len, error);
-		if (status == MB_SUCCESS
-			&& i < MBSYS_SIMRAD3_MAXBEAMS)
-			{
-			mb_get_binary_float(swap, &line[0], &float_val);
-			    ping->png_depth[i] = float_val;
-			mb_get_binary_float(swap, &line[4], &float_val);
-			    ping->png_acrosstrack[i] = float_val;
-			mb_get_binary_float(swap, &line[8], &float_val);
-			    ping->png_alongtrack[i] = float_val;
-			mb_get_binary_short(swap, &line[12], &short_val);
-			    ping->png_window[i] = (int) ((unsigned short) short_val);
-			ping->png_quality[i] = (int)((mb_u_char) line[14]);
-			ping->png_iba[i] = (int)((mb_s_char) line[15]);
-			ping->png_detection[i] = (int)((mb_u_char) line[16]);
-			ping->png_clean[i] = (int)((mb_s_char) line[17]);
-			mb_get_binary_short(swap, &line[18], &short_val);
-			    ping->png_amp[i] = (int) short_val;
-			mb_get_binary_float(swap, &line[20], &float_val);
-			    ping->png_depression[i] = float_val;
-			mb_get_binary_float(swap, &line[24], &float_val);
-			    ping->png_azimuth[i] = float_val;
-			mb_get_binary_float(swap, &line[28], &float_val);
-			    ping->png_range[i] = float_val;
-			mb_get_binary_float(swap, &line[32], &float_val);
-			    ping->png_bheave[i] = float_val;
-			ping->png_beamflag[i] = (int)((mb_s_char) line[36]);
-/* fprintf(stderr,"READ ping:%d beam %d  png_depression:%f ",ping->png_count,i,ping->png_depression[i]);
-fprintf(stderr,"png_azimuth:%f ",ping->png_azimuth[i]);
-fprintf(stderr,"png_range:%f ",ping->png_range[i]);
-fprintf(stderr,"png_bheave:%f ",ping->png_bheave[i]);
-fprintf(stderr,"png_beamflag:%d\n",ping->png_beamflag[i]); */
-			/* ignore line[37] */
-			}
-		}
-	    }
-
-	/* now get last bytes of record */
-	if (status == MB_SUCCESS)
-		{
-		read_len = (size_t)4;
-		status = mb_fileio_get(verbose, mbio_ptr, (char *)line, &read_len, error);
-		if (line[1] == EM3_END)
-			*goodend = MB_YES;
-#ifdef MBR_EM710MBA_DEBUG
-	fprintf(stderr, "End Bytes: %2.2hX %d | %2.2hX %d | %2.2hX %d\n",
-		line[1], line[1],
-		line[2], line[2],
-		line[3], line[3]);
-#endif
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:                  %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:                 %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:                  %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:                  %d\n",store->msec);
-		fprintf(stderr,"dbg5       png_date:              %d\n",ping->png_date);
-		fprintf(stderr,"dbg5       png_msec:              %d\n",ping->png_msec);
-		fprintf(stderr,"dbg5       png_count:             %d\n",ping->png_count);
-		fprintf(stderr,"dbg5       png_serial:            %d\n",ping->png_serial);
-		fprintf(stderr,"dbg5       png_latitude:          %d\n",ping->png_latitude);
-		fprintf(stderr,"dbg5       png_longitude:         %d\n",ping->png_longitude);
-		fprintf(stderr,"dbg5       png_heading:           %d\n",ping->png_heading);
-		fprintf(stderr,"dbg5       png_heave:             %d\n",ping->png_heave);
-		fprintf(stderr,"dbg5       png_roll:              %d\n",ping->png_roll);
-		fprintf(stderr,"dbg5       png_pitch:             %d\n",ping->png_pitch);
-		fprintf(stderr,"dbg5       png_speed:             %d\n",ping->png_speed);
-		fprintf(stderr,"dbg5       png_ssv:               %d\n",ping->png_ssv);
-		fprintf(stderr,"dbg5       png_xducer_depth:      %f\n",ping->png_xducer_depth);
-		fprintf(stderr,"dbg5       png_nbeams:            %d\n",ping->png_nbeams);
-		fprintf(stderr,"dbg5       png_nbeams_valid:      %d\n",ping->png_nbeams_valid);
-		fprintf(stderr,"dbg5       png_sample_rate:       %f\n",ping->png_sample_rate);
-		fprintf(stderr,"dbg5       png_spare:             %d\n",ping->png_spare);
-		fprintf(stderr,"dbg5       cnt  depth xtrack ltrack win  qual  iba det cln amp depression azimuth range heave flag\n");
-		fprintf(stderr,"dbg5       ------------------------------------------------------------\n");
-		for (i=0;i<ping->png_nbeams;i++)
-			fprintf(stderr,"dbg5       %3d %7.2f %7.2f %7.2f %5d %5d %5d %4d %3d %3d %7.2f %7.2f %7.2f %7.2f %3u\n",
-				i, ping->png_depth[i], ping->png_acrosstrack[i],
-				ping->png_alongtrack[i], ping->png_window[i],
-				ping->png_quality[i], ping->png_iba[i],
-				ping->png_detection[i], ping->png_clean[i],
-				ping->png_amp[i], ping->png_depression[i],
-				ping->png_azimuth[i], ping->png_range[i], ping->png_bheave[i],
-				ping->png_beamflag[i]);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       goodend:    %d\n",*goodend);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em710mba_rd_rawbeam4(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store,
-		short sonar, int *goodend, int *error)
-{
-	char	*function_name = "mbr_em710mba_rd_rawbeam4";
-	int	status = MB_SUCCESS;
-	struct mbsys_simrad3_ping_struct *ping;
-	char	line[EM3_RAWBEAM4_HEADER_SIZE];
-	short	short_val;
-	int	int_val;
-	float	float_val;
-	size_t	read_len;
-	int	png_count;
-	int	serial;
-	int	oldest_ping;
-	int	oldest_ping_index;
-	int	found;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		fprintf(stderr,"dbg2       sonar:      %d\n",sonar);
-		}
-
-	/* set goodend false until a good end is found */
-	*goodend = MB_NO;
-
-	/* read binary header values into char array */
-	read_len = (size_t)EM3_RAWBEAM4_HEADER_SIZE;
-	status = mb_fileio_get(verbose, mbio_ptr, (char *)line, &read_len, error);
-
-	/* figure out which storage structure to use */
-	mb_get_binary_short(swap, &line[8], &short_val);
-	png_count = (int) ((unsigned short) short_val);
-	mb_get_binary_short(swap, &line[10], &short_val);
-	serial = (int) ((unsigned short) short_val);
-	found = MB_NO;
-	oldest_ping = 999999999;
-	oldest_ping_index = -1;
-	for (i=0;i<MBSYS_SIMRAD3_NUM_PING_STRUCTURES && found == MB_NO;i++)
-		{
-		/* look for this ping by ping number and sonar serial number - if we already read
-		 * a record from this ping it has to be stored in one of the structures */
-		if (store->pings[i].read_status > 0 && png_count == store->pings[i].count && serial == store->pings[i].serial)
-			{
-			found = MB_YES;
-			store->ping_index = i;
-			}
-			
-		/* figure out which structure is holding the oldest ping in case we need to drop one
-		 * from memory to make room for the new ping. */
-		else if (store->pings[i].read_status > 0)
-			{
-			if (png_count < oldest_ping)
-				{
-				oldest_ping = png_count;
-				oldest_ping_index = i;
-				}
-			}
-			
-		/* if one of the ping structures is unused, set it to be used if we need to store
-		 * this ping */
-		else if (oldest_ping > 0)
-			{
-			oldest_ping = 0;
-			oldest_ping_index = i;
-			}
-		}
-	if (found == MB_NO)
-		{
-		store->ping_index = oldest_ping_index;
-		}
-	ping = (struct mbsys_simrad3_ping_struct *) &store->pings[store->ping_index];
-	ping->count = png_count;
-	ping->serial = serial;
-
-	/* get binary header data */
-	if (status == MB_SUCCESS)
-		{
-		mb_get_binary_int(swap, &line[0], &ping->png_raw_date);
-		    store->date = ping->png_raw_date;
-		mb_get_binary_int(swap, &line[4], &ping->png_raw_msec);
-		    store->msec = ping->png_raw_msec;
-		mb_get_binary_short(swap, &line[8], &short_val);
-		    ping->png_raw_count = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[10], &short_val);
-		    ping->png_raw_serial = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[12], &short_val);
-		    ping->png_raw_ssv = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[14], &short_val);
-		    ping->png_raw_ntx = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[16], &short_val);
-		    ping->png_raw_nbeams = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[18], &short_val);
-		    ping->png_raw_detections = (int) ((unsigned short) short_val);
-		mb_get_binary_float(swap, &line[20], &float_val);
-		    ping->png_raw_sample_rate = float_val;
-		mb_get_binary_int(swap, &line[24], &int_val);
-		    ping->png_raw_spare = (int) (int_val);
-/*fprintf(stderr,"ping->png_raw_date:%d ping->png_raw_msec:%d ping->png_raw_count:%d ping->png_raw_nbeams:%d\n",
-ping->png_raw_date,ping->png_raw_msec,ping->png_raw_count,ping->png_raw_nbeams);*/
-		}
-
-	/* check for some indicators of a broken record
-	    - these do happen!!!! */
-	if (status == MB_SUCCESS)
-		{
-		if (ping->png_raw_detections > ping->png_raw_nbeams
-			|| ping->png_raw_nbeams < 0
-			|| ping->png_raw_detections < 0
-			|| ping->png_raw_nbeams > MBSYS_SIMRAD3_MAXBEAMS
-			|| ping->png_raw_detections > MBSYS_SIMRAD3_MAXBEAMS
-			|| ping->png_raw_ntx > MBSYS_SIMRAD3_MAXTX)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_UNINTELLIGIBLE;
-			}
-		}
-
-	/* read binary tx values */
-	if (status == MB_SUCCESS)
-	    {
-	    for (i=0;i<ping->png_raw_ntx && status == MB_SUCCESS;i++)
-		{
-		read_len = (size_t)EM3_RAWBEAM4_TX_SIZE;
-		status = mb_fileio_get(verbose, mbio_ptr, (char *)line, &read_len, error);
-		if (status == MB_SUCCESS
-			&& i < MBSYS_SIMRAD3_MAXTX)
-			{
-			mb_get_binary_short(swap, &line[0], &short_val);
-			    ping->png_raw_txtiltangle[i] = (int) short_val;
-			mb_get_binary_short(swap, &line[2], &short_val);
-			    ping->png_raw_txfocus[i] = (int) ((unsigned short) short_val);
-			mb_get_binary_float(swap, &line[4], &float_val);
-			    ping->png_raw_txsignallength[i] = float_val;
-			mb_get_binary_float(swap, &line[8], &float_val);
-			    ping->png_raw_txoffset[i] = float_val;
-			mb_get_binary_float(swap, &line[12], &float_val);
-			    ping->png_raw_txcenter[i] = float_val;
-			mb_get_binary_short(swap, &line[16], &short_val);
-			    ping->png_raw_txabsorption[i] = (int) ((unsigned short) short_val);
-			ping->png_raw_txwaveform[i] = (int) line[18];
-			ping->png_raw_txsector[i] = (int) line[19];
-			mb_get_binary_float(swap, &line[20], &float_val);
-			    ping->png_raw_txbandwidth[i] = float_val;
-			}
-		}
-	    }
-
-	/* read binary beam values */
-	if (status == MB_SUCCESS)
-	    {
-	    for (i=0;i<ping->png_raw_nbeams && status == MB_SUCCESS;i++)
-		{
-		read_len = (size_t)EM3_RAWBEAM4_BEAM_SIZE;
-		status = mb_fileio_get(verbose, mbio_ptr, (char *)line, &read_len, error);
-		if (status == MB_SUCCESS
-			&& i < MBSYS_SIMRAD3_MAXBEAMS)
-			{
-			mb_get_binary_short(swap, &line[0], &short_val);
-			    ping->png_raw_rxpointangle[i] = (int) short_val;
-			ping->png_raw_rxsector[i] = (mb_u_char) line[2];
-			ping->png_raw_rxdetection[i] = (mb_u_char) line[3];
-			mb_get_binary_short(swap, &line[4], &short_val);
-			    ping->png_raw_rxwindow[i] = (int) ((unsigned short) short_val);
-			ping->png_raw_rxquality[i] = (mb_u_char) line[6];
-			ping->png_raw_rxspare1[i] = (mb_s_char) line[7];
-			mb_get_binary_float(swap, &line[8], &float_val);
-			    ping->png_raw_rxrange[i] = float_val;
-			mb_get_binary_short(swap, &line[12], &short_val);
-			    ping->png_raw_rxamp[i] = (int) ((short) short_val);
-			ping->png_raw_rxcleaning[i] = (mb_s_char) line[14];
-			ping->png_raw_rxspare2[i] = (mb_u_char) line[15];
-			}
-		}
-
-	    /* zero out ranges that are NaN values - unfortunately this has actually
-	    	happened in some R/V Langseth EM122 data from 20100616 */
-	    for (i=0;i<ping->png_raw_nbeams;i++)
-		{
-		if (check_fnan(ping->png_raw_rxrange[i]))
-			ping->png_raw_rxrange[i]  = 0.0;
-		}
-	    }
-
-	/* now get last bytes of record */
-	if (status == MB_SUCCESS)
-		{
-		read_len = (size_t)4;
-		status = mb_fileio_get(verbose, mbio_ptr, (char *)line, &read_len, error);
-		if (line[1] == EM3_END)
-			*goodend = MB_YES;
-#ifdef MBR_EM710MBA_DEBUG
-	fprintf(stderr, "End Bytes: %2.2hhX %d | %2.2hhX %d | %2.2hhX %d\n",
-		line[1], line[1],
-		line[2], line[2],
-		line[3], line[3]);
-#endif
-		}
-
-	/* check for some other indicators of a broken record
-	    - these do happen!!!! */
-	if (status == MB_SUCCESS)
-		{
-		if (ping->png_raw_nbeams > 0
-		    && ping->png_raw_detections > ping->png_raw_nbeams)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_UNINTELLIGIBLE;
-			}
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       png_raw_read:               %d\n",ping->png_raw_read);
-		fprintf(stderr,"dbg5       png_raw_date:                %d\n",ping->png_raw_date);
-		fprintf(stderr,"dbg5       png_raw_msec:                %d\n",ping->png_raw_msec);
-		fprintf(stderr,"dbg5       png_raw_count:               %d\n",ping->png_raw_count);
-		fprintf(stderr,"dbg5       png_raw_serial:              %d\n",ping->png_raw_serial);
-		fprintf(stderr,"dbg5       png_raw_ssv:                 %d\n",ping->png_raw_ssv);
-		fprintf(stderr,"dbg5       png_raw_ntx:                 %d\n",ping->png_raw_ntx);
-		fprintf(stderr,"dbg5       png_raw_nbeams:              %d\n",ping->png_raw_nbeams);
-		fprintf(stderr,"dbg5       png_raw_detections:          %d\n",ping->png_raw_detections);
-		fprintf(stderr,"dbg5       png_raw_sample_rate:         %f\n",ping->png_raw_sample_rate);
-		fprintf(stderr,"dbg5       png_raw_spare:               %d\n",ping->png_raw_spare);
-		fprintf(stderr,"dbg5       ------------------------------------------------------------\n");
-		fprintf(stderr,"dbg5       transmit pulse values:\n");
-		fprintf(stderr,"dbg5       tiltangle focus length offset center bandwidth waveform sector\n");
-		fprintf(stderr,"dbg5       ------------------------------------------------------------\n");
-		for (i=0;i<ping->png_raw_ntx;i++)
-			fprintf(stderr,"dbg5       %3d %5d %5d %f %f %f %4d %4d %4d %f\n",
-				i, ping->png_raw_txtiltangle[i],
-				ping->png_raw_txfocus[i], ping->png_raw_txsignallength[i],
-				ping->png_raw_txoffset[i], ping->png_raw_txcenter[i],
-				ping->png_raw_txabsorption[i], ping->png_raw_txwaveform[i],
-				ping->png_raw_txsector[i], ping->png_raw_txbandwidth[i]);
-		fprintf(stderr,"dbg5       ------------------------------------------------------------\n");
-		fprintf(stderr,"dbg5       beam values:\n");
-		fprintf(stderr,"dbg5       beam angle sector detection window quality spare1 range amp clean spare2\n");
-		fprintf(stderr,"dbg5       ------------------------------------------------------------\n");
-		for (i=0;i<ping->png_raw_nbeams;i++)
-			fprintf(stderr,"dbg5       %3d %5d %3d %3d %4d %3d %5d %f %5d %5d %5d\n",
-				i, ping->png_raw_rxpointangle[i], ping->png_raw_rxsector[i],
-				ping->png_raw_rxdetection[i], ping->png_raw_rxwindow[i],
-				ping->png_raw_rxquality[i], ping->png_raw_rxspare1[i],
-				ping->png_raw_rxrange[i],ping->png_raw_rxamp[i],
-				ping->png_raw_rxcleaning[i],ping->png_raw_rxspare2[i]);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       goodend:    %d\n",*goodend);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em710mba_rd_quality(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store,
-		short sonar, int *goodend, int *error)
-{
-	char	*function_name = "mbr_em710mba_rd_quality";
-	int	status = MB_SUCCESS;
-	struct mbsys_simrad3_ping_struct *ping;
-	char	line[EM3_QUALITY_HEADER_SIZE];
-	short	short_val;
-	float	float_val;
-	size_t	read_len;
-	int	png_count;
-	int	serial;
-	int	oldest_ping;
-	int	oldest_ping_index;
-	int	found;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		fprintf(stderr,"dbg2       sonar:      %d\n",sonar);
-		}
-
-	/* set goodend false until a good end is found */
-	*goodend = MB_NO;
-
-	/* set kind and type values */
-	store->kind = MB_DATA_DATA;
-	store->type = EM3_QUALITY;
-	store->sonar = sonar;
-
-	/* read binary header values into char array */
-	read_len = (size_t)EM3_QUALITY_HEADER_SIZE;
-	status = mb_fileio_get(verbose, mbio_ptr, (char *)line, &read_len, error);
-
-	/* figure out which storage structure to use */
-	mb_get_binary_short(swap, &line[8], &short_val);
-	png_count = (int) ((unsigned short) short_val);
-	mb_get_binary_short(swap, &line[10], &short_val);
-	serial = (int) ((unsigned short) short_val);
-	found = MB_NO;
-	oldest_ping = 999999999;
-	oldest_ping_index = -1;
-	for (i=0;i<MBSYS_SIMRAD3_NUM_PING_STRUCTURES && found == MB_NO;i++)
-		{
-		/* look for this ping by ping number and sonar serial number - if we already read
-		 * a record from this ping it has to be stored in one of the structures */
-		if (store->pings[i].read_status > 0 && png_count == store->pings[i].count && serial == store->pings[i].serial)
-			{
-			found = MB_YES;
-			store->ping_index = i;
-			}
-			
-		/* figure out which structure is holding the oldest ping in case we need to drop one
-		 * from memory to make room for the new ping. */
-		else if (store->pings[i].read_status > 0)
-			{
-			if (png_count < oldest_ping)
-				{
-				oldest_ping = png_count;
-				oldest_ping_index = i;
-				}
-			}
-			
-		/* if one of the ping structures is unused, set it to be used if we need to store
-		 * this ping */
-		else if (oldest_ping > 0)
-			{
-			oldest_ping = 0;
-			oldest_ping_index = i;
-			}
-		}
-	if (found == MB_NO)
-		{
-		store->ping_index = oldest_ping_index;
-		}
-	ping = (struct mbsys_simrad3_ping_struct *) &store->pings[store->ping_index];
-	ping->count = png_count;
-	ping->serial = serial;
-
-	/* get binary header data */
-	if (status == MB_SUCCESS)
-		{
-		mb_get_binary_int(swap, &line[0], &ping->png_quality_date);
-		    store->date = ping->png_quality_date;
-		mb_get_binary_int(swap, &line[4], &ping->png_quality_msec);
-		    store->msec = ping->png_quality_msec;
-		mb_get_binary_short(swap, &line[8], &short_val);
-		    ping->png_quality_count = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[10], &short_val);
-		    ping->png_quality_serial = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[12], &short_val);
-		    ping->png_quality_nbeams = (int) ((unsigned short) short_val);
-		ping->png_quality_nparameters = (int) line[14];
-		ping->png_quality_spare = (int) line[15];
-		    
-#ifdef MBR_EM710MBA_DEBUG
-fprintf(stderr,"mbr_em710mba_rd_quality:    ping->png_quality_date:%d     ping->png_quality_msec:%d     ping->png_quality_count:%d     ping->png_quality_nbeams:%d\n",
-ping->png_quality_date,ping->png_quality_msec,ping->png_quality_count,ping->png_quality_nbeams);
-#endif
-		}
-
-	/* read binary beam values */
-	if (status == MB_SUCCESS)
-		{
-		for (i=0;i<ping->png_quality_nbeams && status == MB_SUCCESS;i++)
-			{
-			if (status == MB_SUCCESS
-				&& i < MBSYS_SIMRAD3_MAXBEAMS)
-				{
-				read_len = (size_t)(ping->png_quality_nparameters * sizeof(float));
-				status = mb_fileio_get(verbose, mbio_ptr, (char *)line, &read_len, error);
-				for (j=0;j<ping->png_quality_nparameters;j++)
-					{
-					mb_get_binary_float(swap, &line[j * sizeof(float)], &float_val);
-					    ping->png_quality_parameters[i][j] = float_val;				
-					}
-				}
-			}
-		}
-
-	/* now get last bytes of record */
-	if (status == MB_SUCCESS)
-		{
-		read_len = (size_t)4;
-		status = mb_fileio_get(verbose, mbio_ptr, (char *)line, &read_len, error);
-		if (line[1] == EM3_END)
-			*goodend = MB_YES;
-#ifdef MBR_EM710MBA_DEBUG
-	fprintf(stderr, "End Bytes: %2.2hhX %d | %2.2hhX %d | %2.2hhX %d\n",
-		line[1], line[1],
-		line[2], line[2],
-		line[3], line[3]);
-#endif
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:                  %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:                 %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:                  %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:                  %d\n",store->msec);
-		fprintf(stderr,"dbg5       png_quality_date:              %d\n",ping->png_quality_date);
-		fprintf(stderr,"dbg5       png_quality_msec:              %d\n",ping->png_quality_msec);
-		fprintf(stderr,"dbg5       png_quality_count:             %d\n",ping->png_quality_count);
-		fprintf(stderr,"dbg5       png_quality_serial:            %d\n",ping->png_quality_serial);
-		fprintf(stderr,"dbg5       png_quality_nbeams:            %d\n",ping->png_quality_nbeams);
-		fprintf(stderr,"dbg5       png_quality_nparameters:       %d\n",ping->png_quality_nparameters);
-		fprintf(stderr,"dbg5       png_quality_spare:             %d\n",ping->png_quality_spare);
-		fprintf(stderr,"dbg5       cnt  quality parameters\n");
-		fprintf(stderr,"dbg5       ------------------------------------------------------------\n");
-		for (i=0;i<ping->png_quality_nbeams;i++)
-			{
-			fprintf(stderr,"dbg5       %3d ", i);
-			for (j=0;j<ping->png_quality_nparameters;j++)
-				fprintf(stderr,"%f", ping->png_quality_parameters[i][j]);
-			fprintf(stderr,"\n");
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       goodend:    %d\n",*goodend);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em710mba_rd_ss2_mba(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store,
-		short sonar, int *goodend, int *error)
-{
-	char	*function_name = "mbr_em710mba_rd_ss2_mba";
-	int	status = MB_SUCCESS;
-	struct mbsys_simrad3_ping_struct *ping;
-	char	line[2 * MBSYS_SIMRAD3_BUFFER_SIZE];
-	short	short_val;
-	int	int_val;
-	float	float_val;
-	size_t	read_len;
-	int	done;
-	int	junk_bytes;
-	int	offset;
-	int	png_count;
-	int	serial;
-	int	oldest_ping;
-	int	oldest_ping_index;
-	int	found;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		fprintf(stderr,"dbg2       sonar:      %d\n",sonar);
-		}
-
-	/* set goodend false until a good end is found */
-	*goodend = MB_NO;
-
-	/* set kind and type values */
-	store->kind = MB_DATA_DATA;
-	store->type = EM3_SS2_MBA;
-	store->sonar = sonar;
-
-	/* read binary header values into char array */
-	read_len = (size_t)EM3_SS2_MBA_HEADER_SIZE;
-	status = mb_fileio_get(verbose, mbio_ptr, (char *)line, &read_len, error);
-
-	/* figure out which storage structure to use */
-	mb_get_binary_short(swap, &line[8], &short_val);
-	png_count = (int) ((unsigned short) short_val);
-	mb_get_binary_short(swap, &line[10], &short_val);
-	serial = (int) ((unsigned short) short_val);
-	found = MB_NO;
-	oldest_ping = 999999999;
-	oldest_ping_index = -1;
-	for (i=0;i<MBSYS_SIMRAD3_NUM_PING_STRUCTURES && found == MB_NO;i++)
-		{
-		/* look for this ping by ping number and sonar serial number - if we already read
-		 * a record from this ping it has to be stored in one of the structures */
-		if (store->pings[i].read_status > 0 && png_count == store->pings[i].count && serial == store->pings[i].serial)
-			{
-			found = MB_YES;
-			store->ping_index = i;
-			}
-			
-		/* figure out which structure is holding the oldest ping in case we need to drop one
-		 * from memory to make room for the new ping. */
-		else if (store->pings[i].read_status > 0)
-			{
-			if (png_count < oldest_ping)
-				{
-				oldest_ping = png_count;
-				oldest_ping_index = i;
-				}
-			}
-			
-		/* if one of the ping structures is unused, set it to be used if we need to store
-		 * this ping */
-		else if (oldest_ping > 0)
-			{
-			oldest_ping = 0;
-			oldest_ping_index = i;
-			}
-		}
-	if (found == MB_NO)
-		{
-		store->ping_index = oldest_ping_index;
-		}
-	ping = (struct mbsys_simrad3_ping_struct *) &store->pings[store->ping_index];
-	ping->count = png_count;
-	ping->serial = serial;
-
-	/* get binary header data */
-	if (status == MB_SUCCESS)
-		{
-		mb_get_binary_int(swap, &line[0], &ping->png_ss_date);
-		    store->date = ping->png_ss_date;
-		mb_get_binary_int(swap, &line[4], & ping->png_ss_msec);
-		    store->msec = ping->png_ss_msec;
-		mb_get_binary_short(swap, &line[8], &short_val);
-		    ping->png_ss_count = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[10], &short_val);
-		    ping->png_ss_serial = (int) ((unsigned short) short_val);
-		mb_get_binary_float(swap, &line[12], &float_val);
-		    ping->png_ss_sample_rate = float_val;
-		mb_get_binary_short(swap, &line[16], &short_val);
-		    ping->png_r_zero = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[18], &short_val);
-		    ping->png_bsn = (int) ((short) short_val);
-		mb_get_binary_short(swap, &line[20], &short_val);
-		    ping->png_bso = (int) ((short) short_val);
-		mb_get_binary_short(swap, &line[22], &short_val);
-		    ping->png_tx = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[24], &short_val);
-		    ping->png_tvg_crossover = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[26], &short_val);
-		    ping->png_nbeams_ss = (int) ((unsigned short) short_val);
-		mb_get_binary_float(swap, &line[28], &float_val);
-		    ping->png_pixel_size = float_val;
-		mb_get_binary_int(swap, &line[32], &int_val);
-		    ping->png_pixels_ss = int_val;
-/*fprintf(stderr," ping->png_ss_date:%d  ping->png_ss_msec:%d  ping->png_ss_count:%d  ping->png_nbeams_ss:%d\n",
-ping->png_ss_date,ping->png_ss_msec,ping->png_ss_count,ping->png_nbeams_ss);*/
-		}
-
-	/* check for some indicators of a broken record
-	    - these do happen!!!! */
-	if (status == MB_SUCCESS)
-		{
-		if (ping->png_nbeams_ss < 0
-			|| ping->png_nbeams_ss > MBSYS_SIMRAD3_MAXBEAMS)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_UNINTELLIGIBLE;
-			}
-		}
-
-	/* read binary beam values */
-	if (status == MB_SUCCESS)
-	    {
-	    ping->png_npixels = 0;
-	    for (i=0;i<ping->png_nbeams_ss && status == MB_SUCCESS;i++)
-		{
-		read_len = (size_t)EM3_SS2_BEAM_SIZE;
-		status = mb_fileio_get(verbose, mbio_ptr, (char *)line, &read_len, error);
-		if (status == MB_SUCCESS
-			&& i < MBSYS_SIMRAD3_MAXBEAMS)
-			{
-			ping->png_sort_direction[i] = (mb_s_char) line[0];
-			ping->png_ssdetection[i] = (mb_u_char) line[1];
-			mb_get_binary_short(swap, &line[2], &short_val);
-			    ping->png_beam_samples[i] = (int) ((unsigned short) short_val);
-			mb_get_binary_short(swap, &line[4], &short_val);
-			    ping->png_center_sample[i] = (int) ((unsigned short) short_val);
-
-			ping->png_start_sample[i] = ping->png_npixels;
-			ping->png_npixels += ping->png_beam_samples[i];
-			if (ping->png_npixels > MBSYS_SIMRAD3_MAXRAWPIXELS)
-				{
-				ping->png_beam_samples[i]
-					-= (ping->png_npixels
-						- MBSYS_SIMRAD3_MAXRAWPIXELS);
-				if (ping->png_beam_samples[i] < 0)
-					ping->png_beam_samples[i] = 0;
-				}
-			}
-		}
-
-	    /* check for too much pixel data */
-	    if (ping->png_npixels > MBSYS_SIMRAD3_MAXRAWPIXELS)
-		{
-		if (verbose > 0)
-		    fprintf(stderr, "WARNING: Simrad multibeam sidescan pixels %d exceed maximum %d!\n",
-			    ping->png_npixels, MBSYS_SIMRAD3_MAXRAWPIXELS);
-		junk_bytes = ping->png_npixels - MBSYS_SIMRAD3_MAXRAWPIXELS;
-		ping->png_npixels = MBSYS_SIMRAD3_MAXRAWPIXELS;
-		status = MB_FAILURE;
-		*error = MB_ERROR_UNINTELLIGIBLE;
-		}
-	    else
-		junk_bytes = 0;
-	    }
-
-	/* read binary sidescan values */
-	if (status == MB_SUCCESS)
-		{
-		read_len = (size_t)(2 * ping->png_npixels);
-		status = mb_fileio_get(verbose, mbio_ptr, (char *)ping->png_ssraw, &read_len, error);
-		}
-
-	/* read any leftover binary sidescan values */
-	if (status == MB_SUCCESS)
-		{
-		for (i=0;i<junk_bytes;i++)
-			{
-			read_len = (size_t)1;
-			status = mb_fileio_get(verbose, mbio_ptr, (char *)line, &read_len, error);
-			}
-		}
-
-
-	/* read processed sidescan data */
-	if (status == MB_SUCCESS)
-		{
-		for (i=0;i<MBSYS_SIMRAD3_MAXPIXELS;i++)
-			{
-			ping->png_ss[i] = EM3_INVALID_SS;
-			}
-		read_len = (size_t)(ping->png_pixels_ss * sizeof(short));
-		status = mb_fileio_get(verbose, mbio_ptr, (char *)line, &read_len, error);
-		}
-
-	/* get processed sidescan data */
-	if (status == MB_SUCCESS)
-		{
-		offset = (MBSYS_SIMRAD3_MAXPIXELS - ping->png_pixels_ss) / 2;
-		for (i=0;i<ping->png_pixels_ss;i++)
-		    {
-		    mb_get_binary_short(swap, &line[2*i], &short_val);
-			ping->png_ss[offset+i] = (short) short_val;
-		    }
-		}
-
-	/* read processed sidescan alongtrack data */
-	if (status == MB_SUCCESS)
-		{
-		for (i=0;i<MBSYS_SIMRAD3_MAXPIXELS;i++)
-			{
-			ping->png_ssalongtrack[i] = 0;
-			}
-		read_len = (size_t)(ping->png_pixels_ss * sizeof(short));
-		status = mb_fileio_get(verbose, mbio_ptr, (char *)line, &read_len, error);
-		}
-
-	/* get processed sidescan alongtrack data */
-	if (status == MB_SUCCESS)
-		{
-		offset = (MBSYS_SIMRAD3_MAXPIXELS - ping->png_pixels_ss) / 2;
-		for (i=0;i<ping->png_pixels_ss;i++)
-		    {
-		    mb_get_binary_short(swap, &line[2*i], &short_val);
-			ping->png_ssalongtrack[offset+i] = (short) short_val;
-		    }
-		}
-
-	/* now loop over reading individual characters to
-	    get last bytes of record */
-	if (status == MB_SUCCESS)
-	    {
-	    done = MB_NO;
-	    while (done == MB_NO)
-		{
-		read_len = (size_t)1;
-		status = mb_fileio_get(verbose, mbio_ptr, (char *)line, &read_len, error);
-		if (status == MB_SUCCESS && line[0] == EM3_END)
-			{
-			done = MB_YES;
-			status = MB_SUCCESS;
-
-			/* get last two check sum bytes */
-			read_len = (size_t)2;
-			status = mb_fileio_get(verbose, mbio_ptr, (char *)&line[1], &read_len, error);
-
-			*goodend = MB_YES;
-#ifdef MBR_EM710MBA_DEBUG
-	fprintf(stderr, "End Bytes: %2.2hX %d | %2.2hX %d | %2.2hX %d\n",
-		line[0], line[0],
-		line[1], line[1],
-		line[2], line[2]);
-#endif
-			}
-		else if (read_len == 1)
-			{
-			status = MB_SUCCESS;
-			}
-		else
-			{
-			done = MB_YES;
-			/* return success here because all of the
-			    important information in this record has
-			    already been read - next attempt to read
-			    file will return error */
-			status = MB_SUCCESS;
-			}
-		}
-#ifdef MBR_EM710MBA_DEBUG
-	fprintf(stderr, "\n");
-#endif
-	    }
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:                  %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:                 %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:                  %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:                  %d\n",store->msec);
-		fprintf(stderr,"dbg5       png_date:              %d\n",ping->png_date);
-		fprintf(stderr,"dbg5       png_msec:              %d\n",ping->png_msec);
-		fprintf(stderr,"dbg5       png_count:             %d\n",ping->png_count);
-		fprintf(stderr,"dbg5       png_serial:            %d\n",ping->png_serial);
-		fprintf(stderr,"dbg5       png_latitude:          %d\n",ping->png_latitude);
-		fprintf(stderr,"dbg5       png_longitude:         %d\n",ping->png_longitude);
-		fprintf(stderr,"dbg5       png_heading:           %d\n",ping->png_heading);
-		fprintf(stderr,"dbg5       png_heave:             %d\n",ping->png_heave);
-		fprintf(stderr,"dbg5       png_roll:              %d\n",ping->png_roll);
-		fprintf(stderr,"dbg5       png_pitch:             %d\n",ping->png_pitch);
-		fprintf(stderr,"dbg5       png_speed:             %d\n",ping->png_speed);
-		fprintf(stderr,"dbg5       png_ssv:               %d\n",ping->png_ssv);
-		fprintf(stderr,"dbg5       png_xducer_depth:      %f\n",ping->png_xducer_depth);
-		fprintf(stderr,"dbg5       png_nbeams:            %d\n",ping->png_nbeams);
-		fprintf(stderr,"dbg5       png_nbeams_valid:      %d\n",ping->png_nbeams_valid);
-		fprintf(stderr,"dbg5       png_sample_rate:       %f\n",ping->png_sample_rate);
-		fprintf(stderr,"dbg5       png_spare:             %d\n",ping->png_spare);
-		fprintf(stderr,"dbg5       cnt  depth xtrack ltrack win  qual  iba det cln amp depression azimuth range heave flag\n");
-		fprintf(stderr,"dbg5       ------------------------------------------------------------\n");
-		for (i=0;i<ping->png_nbeams;i++)
-			fprintf(stderr,"dbg5       %3d %7.2f %7.2f %7.2f %5d %5d %5d %4d %3d %3d %7.2f %7.2f %7.2f %7.2f %3u\n",
-				i, ping->png_depth[i], ping->png_acrosstrack[i],
-				ping->png_alongtrack[i], ping->png_window[i],
-				ping->png_quality[i], ping->png_iba[i],
-				ping->png_detection[i], ping->png_clean[i],
-				ping->png_amp[i], ping->png_depression[i],
-				ping->png_azimuth[i], ping->png_range[i], ping->png_bheave[i],
-				ping->png_beamflag[i]);
-
-		fprintf(stderr,"dbg5       png_ss_date:        %d\n",ping->png_ss_date);
-		fprintf(stderr,"dbg5       png_ss_msec:        %d\n",ping->png_ss_msec);
-		fprintf(stderr,"dbg5       png_ss_count:       %d\n",ping->png_ss_count);
-		fprintf(stderr,"dbg5       png_ss_serial:      %d\n",ping->png_ss_serial);
-		fprintf(stderr,"dbg5       png_ss_sample_rate: %f\n",ping->png_ss_sample_rate);
-		fprintf(stderr,"dbg5       png_r_zero:         %d\n",ping->png_r_zero);
-		fprintf(stderr,"dbg5       png_bsn:            %d\n",ping->png_bsn);
-		fprintf(stderr,"dbg5       png_bso:            %d\n",ping->png_bso);
-		fprintf(stderr,"dbg5       png_tx:             %d\n",ping->png_tx);
-		fprintf(stderr,"dbg5       png_tvg_crossover:  %d\n",ping->png_tvg_crossover);
-		fprintf(stderr,"dbg5       png_nbeams_ss:      %d\n",ping->png_nbeams_ss);
-		fprintf(stderr,"dbg5       png_pixel_size:     %f\n",ping->png_pixel_size);
-		fprintf(stderr,"dbg5       png_pixels_ss:      %d\n",ping->png_pixels_ss);
-		fprintf(stderr,"dbg5       png_npixels:        %d\n",ping->png_npixels);
-		fprintf(stderr,"dbg5       cnt  index sort samples start center\n");
-		fprintf(stderr,"dbg5       --------------------------------------------------\n");
-		for (i=0;i<ping->png_nbeams_ss;i++)
-			fprintf(stderr,"dbg5        %4d %2d %4d %4d %4d %4d\n",
-				i, ping->png_sort_direction[i], ping->png_ssdetection[i],
-				ping->png_beam_samples[i], ping->png_start_sample[i],
-				ping->png_center_sample[i]);
-		fprintf(stderr,"dbg5       cnt  ss\n");
-		fprintf(stderr,"dbg5       --------------------------------------------------\n");
-		for (i=0;i<ping->png_npixels;i++)
-			fprintf(stderr,"dbg5        %d %d\n",
-				i, ping->png_ssraw[i]);
-		fprintf(stderr,"dbg5       cnt  ss ssalongtrack\n");
-		fprintf(stderr,"dbg5       --------------------------------------------------\n");
-		for (i=0;i<ping->png_pixels_ss;i++)
-			fprintf(stderr,"dbg5        %d %d %d\n",
-				i, ping->png_ss[i], ping->png_ssalongtrack[i]);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       goodend:    %d\n",*goodend);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em710mba_rd_wc(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store,
-		short sonar, int *goodend, int *error)
-{
-	char	*function_name = "mbr_em710mba_rd_wc";
-	int	status = MB_SUCCESS;
-	struct mbsys_simrad3_watercolumn_struct *wc;
-	char	line[EM3_WC_HEADER_SIZE];
-	short	short_val;
-	size_t	read_len;
-	int	done;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		fprintf(stderr,"dbg2       sonar:      %d\n",sonar);
-		}
-
-	/* set goodend false until a good end is found */
-	*goodend = MB_NO;
-
-	/* get  storage structure */
-	wc = (struct mbsys_simrad3_watercolumn_struct *) store->wc;
-
-	/* set kind and type values */
-	store->kind = MB_DATA_WATER_COLUMN;
-	store->type = EM3_WATERCOLUMN;
-	store->sonar = sonar;
-
-	/* read binary header values into char array */
-	read_len = (size_t)EM3_WC_HEADER_SIZE;
-	status = mb_fileio_get(verbose, mbio_ptr, (char *)line, &read_len, error);
-
-	/* get binary header data */
-	if (status == MB_SUCCESS)
-		{
-		mb_get_binary_int(swap, &line[0], &wc->wtc_date);
-		    store->date = wc->wtc_date;
-		mb_get_binary_int(swap, &line[4], & wc->wtc_msec);
-		    store->msec = wc->wtc_msec;
-		mb_get_binary_short(swap, &line[8], &short_val);
-		    wc->wtc_count = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[10], &short_val);
-		    wc->wtc_serial = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[12], &short_val);
-		    wc->wtc_ndatagrams = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[14], &short_val);
-		    wc->wtc_datagram = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[16], &short_val);
-		    wc->wtc_ntx = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[18], &short_val);
-		    wc->wtc_nrx = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[20], &short_val);
-		    wc->wtc_nbeam = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[22], &short_val);
-		    wc->wtc_ssv = (int) ((unsigned short) short_val);
-		mb_get_binary_int(swap, &line[24], &(wc->wtc_sfreq));
-		mb_get_binary_short(swap, &line[28], &short_val);
-		    wc->wtc_heave = (int) ((short) short_val);
-		mb_get_binary_short(swap, &line[30], &short_val);
-		    wc->wtc_spare1 = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[32], &short_val);
-		    wc->wtc_spare2 = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[34], &short_val);
-		    wc->wtc_spare3 = (int) ((unsigned short) short_val);
-		}
-
-	/* check for some indicators of a broken record
-	    - these do happen!!!! */
-	if (status == MB_SUCCESS)
-		{
-		if (wc->wtc_nbeam < 0
-			|| wc->wtc_nbeam > MBSYS_SIMRAD3_MAXBEAMS
-			|| wc->wtc_ntx < 0
-			|| wc->wtc_ntx > MBSYS_SIMRAD3_MAXTX)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_UNINTELLIGIBLE;
-			}
-		}
-
-	/* read binary beam values */
-	if (status == MB_SUCCESS)
-	    {
-	    for (i=0;i<wc->wtc_ntx && status == MB_SUCCESS;i++)
-		{
-		read_len = (size_t)EM3_WC_TX_SIZE;
-		status = mb_fileio_get(verbose, mbio_ptr, (char *)line, &read_len, error);
-		if (status == MB_SUCCESS
-			&& i < MBSYS_SIMRAD3_MAXTX)
-			{
-			mb_get_binary_short(swap, &line[0], &short_val);
-			    wc->wtc_txtiltangle[i] = (int) (short_val);
-			mb_get_binary_short(swap, &line[2], &short_val);
-			    wc->wtc_txcenter[i] = (int) (short_val);
-			wc->wtc_txsector[i] = (int) ((mb_u_char) line[4]);
-			}
-		}
-	    for (i=0;i<wc->wtc_nbeam && status == MB_SUCCESS;i++)
-		{
-		read_len = (size_t)EM3_WC_BEAM_SIZE;
-		status = mb_fileio_get(verbose, mbio_ptr, (char *)line, &read_len, error);
-		if (status == MB_SUCCESS
-			&& i < MBSYS_SIMRAD3_MAXBEAMS)
-			{
-			mb_get_binary_short(swap, &line[0], &short_val);
-			    wc->beam[i].wtc_rxpointangle = (int) (short_val);
-			mb_get_binary_short(swap, &line[2], &short_val);
-			    wc->beam[i].wtc_start_sample = (int) (short_val);
-			mb_get_binary_short(swap, &line[4], &short_val);
-			    wc->beam[i].wtc_beam_samples = (int) (unsigned short)(short_val);
-			mb_get_binary_short(swap, &line[6], &short_val);
-			    wc->beam[i].wtc_beam_spare = (int) (unsigned short)(short_val);
-			wc->beam[i].wtc_sector = (int) (mb_u_char) (line[8]);
-			wc->beam[i].wtc_beam = (int) (mb_u_char) (line[9]);
-			}
-		read_len = (size_t)wc->beam[i].wtc_beam_samples;
-		status = mb_fileio_get(verbose, mbio_ptr, (char *)wc->beam[i].wtc_amp, &read_len, error);
-		}
-	    }
-
-	/* now loop over reading individual characters to
-	    get last bytes of record */
-	if (status == MB_SUCCESS)
-	    {
-	    done = MB_NO;
-	    while (done == MB_NO)
-		{
-		read_len = (size_t)1;
-		status = mb_fileio_get(verbose, mbio_ptr, (char *)line, &read_len, error);
-		if (status == MB_SUCCESS && line[0] == EM3_END)
-			{
-			done = MB_YES;
-
-			/* get last two check sum bytes */
-			read_len = (size_t)2;
-			status = mb_fileio_get(verbose, mbio_ptr, (char *)&line[1], &read_len, error);
-			*goodend = MB_YES;
-#ifdef MBR_EM710MBA_DEBUG
-	fprintf(stderr, "End Bytes: %2.2hhX %d | %2.2hhX %d | %2.2hhX %d\n",
-		line[0], line[0],
-		line[1], line[1],
-		line[2], line[2]);
-#endif
-			}
-		else if (status != MB_SUCCESS)
-			{
-			done = MB_YES;
-			/* return success here because all of the
-			    important information in this record has
-			    already been read - next attempt to read
-			    file will return error */
-			status = MB_SUCCESS;
-			*error = MB_ERROR_NO_ERROR;
-			}
-		}
-#ifdef MBR_EM710MBA_DEBUG
-	fprintf(stderr, "\n");
-#endif
-	    }
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       wtc_date:        %d\n",wc->wtc_date);
-		fprintf(stderr,"dbg5       wtc_msec:        %d\n",wc->wtc_msec);
-		fprintf(stderr,"dbg5       wtc_count:       %d\n",wc->wtc_count);
-		fprintf(stderr,"dbg5       wtc_serial:      %d\n",wc->wtc_serial);
-		fprintf(stderr,"dbg5       wtc_ndatagrams:  %d\n",wc->wtc_ndatagrams);
-		fprintf(stderr,"dbg5       wtc_datagram:    %d\n",wc->wtc_datagram);
-		fprintf(stderr,"dbg5       wtc_ntx:         %d\n",wc->wtc_ntx);
-		fprintf(stderr,"dbg5       wtc_nrx:         %d\n",wc->wtc_nrx);
-		fprintf(stderr,"dbg5       wtc_nbeam:       %d\n",wc->wtc_nbeam);
-		fprintf(stderr,"dbg5       wtc_ssv:         %d\n",wc->wtc_ssv);
-		fprintf(stderr,"dbg5       wtc_sfreq:       %d\n",wc->wtc_sfreq);
-		fprintf(stderr,"dbg5       wtc_heave:       %d\n",wc->wtc_heave);
-		fprintf(stderr,"dbg5       wtc_spare1:      %d\n",wc->wtc_spare1);
-		fprintf(stderr,"dbg5       wtc_spare2:      %d\n",wc->wtc_spare2);
-		fprintf(stderr,"dbg5       wtc_spare3:      %d\n",wc->wtc_spare3);
-		fprintf(stderr,"dbg5       ---------------------------\n");
-		fprintf(stderr,"dbg5       cnt  tilt center sector\n");
-		fprintf(stderr,"dbg5       ---------------------------\n");
-		for (i=0;i<wc->wtc_ntx;i++)
-			fprintf(stderr,"dbg5       %3d %6d %6d %6d\n",
-				i, wc->wtc_txtiltangle[i], wc->wtc_txcenter[i],
-				wc->wtc_txsector[i]);
-		for (i=0;i<wc->wtc_nbeam;i++)
-			{
-			fprintf(stderr,"dbg5       --------------------------------------------------\n");
-			fprintf(stderr,"dbg5       cnt  angle start samples unknown sector beam\n");
-			fprintf(stderr,"dbg5       --------------------------------------------------\n");
-			fprintf(stderr,"dbg5        %4d %3d %2d %4d %4d %4d %4d\n",
-				i, wc->beam[i].wtc_rxpointangle,
-				wc->beam[i].wtc_start_sample,
-				wc->beam[i].wtc_beam_samples,
-				wc->beam[i].wtc_beam_spare,
-				wc->beam[i].wtc_sector,
-				wc->beam[i].wtc_beam);
-/*			fprintf(stderr,"dbg5       --------------------------------------------------\n");
-			fprintf(stderr,"dbg5       beam[%d]: sample amplitude\n",i);
-			fprintf(stderr,"dbg5       --------------------------------------------------\n");
-			for (j=0;j<wc->beam[i].wtc_beam_samples;j++)
-				fprintf(stderr,"dbg5        %4d %4d\n",
-					j, wc->beam[i].wtc_amp[j]);*/
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       goodend:    %d\n",*goodend);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em710mba_wr_data(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_em710mba_wr_data";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_simrad3_struct *store;
-	struct mbsys_simrad3_ping_struct *ping;
-	FILE	*mbfp;
-	int	swap;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_simrad3_struct *) store_ptr;
-	mbfp = mb_io_ptr->mbfp;
-
-#ifdef MBR_EM710MBA_DEBUG
-	fprintf(stderr,"\nstart of mbr_em710mba_wr_data:\n");
-	fprintf(stderr,"kind:%d %d type:%x\n", store->kind, mb_io_ptr->new_kind, store->type);
-#endif
-	
-	/* figure out which storage structure to use */
-	ping = (struct mbsys_simrad3_ping_struct *) &(store->pings[store->ping_index]);
-
-	/* set swap flag */
-	swap = MB_YES;
-
-	if (store->kind == MB_DATA_COMMENT
-		|| store->kind == MB_DATA_START
-		|| store->kind == MB_DATA_STOP)
-		{
-#ifdef MBR_EM710MBA_DEBUG
-	fprintf(stderr,"call mbr_em710mba_wr_start kind:%d type %x\n",store->kind,store->type);
-#else
-#ifdef MBR_EM710MBA_DEBUG3
-	fprintf(stderr,"type:%x sonar:%d                      mbr_em710mba_wr_start\n\n",store->type,store->sonar);
-#endif
-#endif
-		status = mbr_em710mba_wr_start(verbose,mbio_ptr,swap,store,error);
-		}
-	else if (store->kind == MB_DATA_STATUS)
-		{
-#ifdef MBR_EM710MBA_DEBUG
-	fprintf(stderr,"call mbr_em710mba_wr_status kind:%d type %x\n",store->kind,store->type);
-#else
-#ifdef MBR_EM710MBA_DEBUG3
-	fprintf(stderr,"type:%x sonar:%d                      mbr_em710mba_wr_status\n\n",store->type,store->sonar);
-#endif
-#endif
-		status = mbr_em710mba_wr_status(verbose,mbio_ptr,swap,store,error);
-		}
-	else if (store->kind == MB_DATA_RUN_PARAMETER)
-		{
-#ifdef MBR_EM710MBA_DEBUG
-	fprintf(stderr,"call mbr_em710mba_wr_run_parameter kind:%d type %x\n",store->kind,store->type);
-#else
-#ifdef MBR_EM710MBA_DEBUG3
-	fprintf(stderr,"type:%x sonar:%d                      mbr_em710mba_wr_run_parameter\n\n",store->type,store->sonar);
-#endif
-#endif
-		status = mbr_em710mba_wr_run_parameter(verbose,mbio_ptr,swap,store,error);
-		}
-	else if (store->kind == MB_DATA_CLOCK)
-		{
-#ifdef MBR_EM710MBA_DEBUG
-	fprintf(stderr,"call mbr_em710mba_wr_clock kind:%d type %x\n",store->kind,store->type);
-#else
-#ifdef MBR_EM710MBA_DEBUG3
-	fprintf(stderr,"type:%x sonar:%d                      mbr_em710mba_wr_clock\n\n",store->type,store->sonar);
-#endif
-#endif
-		status = mbr_em710mba_wr_clock(verbose,mbio_ptr,swap,store,error);
-		}
-	else if (store->kind == MB_DATA_TIDE)
-		{
-#ifdef MBR_EM710MBA_DEBUG
-	fprintf(stderr,"call mbr_em710mba_wr_tide kind:%d type %x\n",store->kind,store->type);
-#else
-#ifdef MBR_EM710MBA_DEBUG3
-	fprintf(stderr,"type:%x sonar:%d                      mbr_em710mba_wr_tide\n\n",store->type,store->sonar);
-#endif
-#endif
-		status = mbr_em710mba_wr_tide(verbose,mbio_ptr,swap,store,error);
-		}
-	else if (store->kind == MB_DATA_HEIGHT)
-		{
-#ifdef MBR_EM710MBA_DEBUG
-	fprintf(stderr,"call mbr_em710mba_wr_height kind:%d type %x\n",store->kind,store->type);
-#else
-#ifdef MBR_EM710MBA_DEBUG3
-	fprintf(stderr,"type:%x sonar:%d                      mbr_em710mba_wr_height\n\n",store->type,store->sonar);
-#endif
-#endif
-		status = mbr_em710mba_wr_height(verbose,mbio_ptr,swap,store,error);
-		}
-	else if (store->kind == MB_DATA_HEADING)
-		{
-#ifdef MBR_EM710MBA_DEBUG
-	fprintf(stderr,"call mbr_em710mba_wr_heading kind:%d type %x\n",store->kind,store->type);
-#else
-#ifdef MBR_EM710MBA_DEBUG3
-	fprintf(stderr,"type:%x sonar:%d                      mbr_em710mba_wr_heading\n\n",store->type,store->sonar);
-#endif
-#endif
-		status = mbr_em710mba_wr_heading(verbose,mbio_ptr,swap,store,error);
-		}
-	else if (store->kind == MB_DATA_SSV)
-		{
-#ifdef MBR_EM710MBA_DEBUG
-	fprintf(stderr,"call mbr_em710mba_wr_ssv kind:%d type %x\n",store->kind,store->type);
-#else
-#ifdef MBR_EM710MBA_DEBUG3
-	fprintf(stderr,"type:%x sonar:%d                      mbr_em710mba_wr_ssv\n\n",store->type,store->sonar);
-#endif
-#endif
-		status = mbr_em710mba_wr_ssv(verbose,mbio_ptr,swap,store,error);
-		}
-	else if (store->kind == MB_DATA_TILT)
-		{
-#ifdef MBR_EM710MBA_DEBUG
-	fprintf(stderr,"call mbr_em710mba_wr_tilt kind:%d type %x\n",store->kind,store->type);
-#else
-#ifdef MBR_EM710MBA_DEBUG3
-	fprintf(stderr,"type:%x sonar:%d                      mbr_em710mba_wr_tilt\n\n",store->type,store->sonar);
-#endif
-#endif
-		status = mbr_em710mba_wr_tilt(verbose,mbio_ptr,swap,store,error);
-		}
-	else if (store->kind == MB_DATA_PARAMETER)
-		{
-#ifdef MBR_EM710MBA_DEBUG
-	fprintf(stderr,"call mbr_em710mba_wr_extraparameters kind:%d type %x\n",store->kind,store->type);
-#else
-#ifdef MBR_EM710MBA_DEBUG3
-	fprintf(stderr,"type:%x sonar:%d                      mbr_em710mba_wr_extraparameters\n\n",store->type,store->sonar);
-#endif
-#endif
-		status = mbr_em710mba_wr_extraparameters(verbose,mbio_ptr,swap,store,error);
-		}
-	else if ((store->kind == MB_DATA_ATTITUDE
-			|| store->kind == MB_DATA_ATTITUDE1)
-		 && store->type == EM3_ATTITUDE)
-		{
-#ifdef MBR_EM710MBA_DEBUG
-	fprintf(stderr,"call mbr_em710mba_wr_attitude kind:%d type %x\n",store->kind,store->type);
-#else
-#ifdef MBR_EM710MBA_DEBUG3
-	fprintf(stderr,"type:%x sonar:%d                      mbr_em710mba_wr_attitude\n\n",store->type,store->sonar);
-#endif
-#endif
-		status = mbr_em710mba_wr_attitude(verbose,mbio_ptr,swap,store,error);
-		}
-	else if (store->kind == MB_DATA_ATTITUDE2
-		 && store->type == EM3_NETATTITUDE)
-		{
-#ifdef MBR_EM710MBA_DEBUG
-	fprintf(stderr,"call mbr_em710mba_wr_netattitude kind:%d type %x\n",store->kind,store->type);
-#else
-#ifdef MBR_EM710MBA_DEBUG3
-	fprintf(stderr,"type:%x sonar:%d                      mbr_em710mba_wr_netattitude\n\n",store->type,store->sonar);
-#endif
-#endif
-		status = mbr_em710mba_wr_netattitude(verbose,mbio_ptr,swap,store,error);
-		}
-	else if (store->kind == MB_DATA_NAV
-		|| store->kind == MB_DATA_NAV1
-		|| store->kind == MB_DATA_NAV2
-		|| store->kind == MB_DATA_NAV3)
-		{
-#ifdef MBR_EM710MBA_DEBUG
-	fprintf(stderr,"call mbr_em710mba_wr_pos kind:%d type %x\n",store->kind,store->type);
-#else
-#ifdef MBR_EM710MBA_DEBUG3
-	fprintf(stderr,"type:%x sonar:%d                      mbr_em710mba_wr_pos\n\n",store->type,store->sonar);
-#endif
-#endif
-		status = mbr_em710mba_wr_pos(verbose,mbio_ptr,swap,store,error);
-		}
-	else if (store->kind == MB_DATA_VELOCITY_PROFILE)
-		{
-#ifdef MBR_EM710MBA_DEBUG
-	fprintf(stderr,"call mbr_em710mba_wr_svp kind:%d type %x\n",store->kind,store->type);
-#else
-#ifdef MBR_EM710MBA_DEBUG3
-	fprintf(stderr,"type:%x sonar:%d                      mbr_em710mba_wr_svp\n\n",store->type,store->sonar);
-#endif
-#endif
-	        if (store->type == EM3_SVP)
-		  status = mbr_em710mba_wr_svp(verbose,mbio_ptr,swap,store,error);
-		else
-		  status = mbr_em710mba_wr_svp2(verbose,mbio_ptr,swap,store,error);
-		}
-	else if (store->kind == MB_DATA_DATA)
-		{
-		if (ping->png_raw_read == MB_YES)
-		    {
-#ifdef MBR_EM710MBA_DEBUG
-	fprintf(stderr,"call mbr_em710mba_wr_rawbeam4 kind:%d type %x\n",store->kind,store->type);
-#else
-#ifdef MBR_EM710MBA_DEBUG3
-	fprintf(stderr,"type:%x sonar:%d                      mbr_em710mba_wr_rawbeam4: sonar 1 ping:%d\n",
-		store->type,store->sonar,store->pings[store->ping_index].png_count);
-#endif
-#endif
-		    status = mbr_em710mba_wr_rawbeam4(verbose,mbio_ptr,swap,store,error);
-		    }
-#ifdef MBR_EM710MBA_DEBUG
-	else fprintf(stderr,"NOT call mbr_em710mba_wr_rawbeam4 kind:%d type %x\n",store->kind,store->type);
-#else
-#ifdef MBR_EM710MBA_DEBUG3
-	else fprintf(stderr,"NOT call mbr_em710mba_wr_rawbeam4\n");
-#endif
-#endif
-
-		if (ping->png_quality_read == MB_YES)
-		    {
-#ifdef MBR_EM710MBA_DEBUG
-	fprintf(stderr,"call mbr_em710mba_wr_quality kind:%d type %x\n",store->kind,store->type);
-#else
-#ifdef MBR_EM710MBA_DEBUG3
-	fprintf(stderr,"type:%x sonar:%d                      mbr_em710mba_wr_quality: sonar 1 ping:%d\n",
-		store->type,store->sonar,store->pings[store->ping_index].png_count);
-#endif
-#endif
-		    status = mbr_em710mba_wr_quality(verbose,mbio_ptr,swap,store,error);
-		    }
-#ifdef MBR_EM710MBA_DEBUG
-	else fprintf(stderr,"NOT call mbr_em710mba_wr_quality kind:%d type %x\n",store->kind,store->type);
-#else
-#ifdef MBR_EM710MBA_DEBUG3
-	else fprintf(stderr,"NOT call mbr_em710mba_wr_quality\n");
-#endif
-#endif
-
-#ifdef MBR_EM710MBA_DEBUG
-	fprintf(stderr,"call mbr_em710mba_wr_bath3_mba kind:%d type %x\n",store->kind,store->type);
-#else
-#ifdef MBR_EM710MBA_DEBUG3
-	fprintf(stderr,"type:%x sonar:%d                      mbr_em710mba_wr_bath3_mba: sonar 1 ping:%d\n",
-		store->type,store->sonar,store->pings[store->ping_index].png_count);
-#endif
-#endif
-		status = mbr_em710mba_wr_bath3_mba(verbose,mbio_ptr,swap,store,error);
-		if (ping->png_ss_read == MB_YES)
-		    {
-#ifdef MBR_EM710MBA_DEBUG
-	fprintf(stderr,"call mbr_em710mba_wr_ss2_mba kind:%d type %x\n",store->kind,store->type);
-#else
-#ifdef MBR_EM710MBA_DEBUG3
-	fprintf(stderr,"type:%x sonar:%d                      mbr_em710mba_wr_ss2_mba: sonar 1 ping:%d\n\n",
-		store->type,store->sonar,store->pings[store->ping_index].png_count);
-#endif
-#endif
-		    status = mbr_em710mba_wr_ss2_mba(verbose,mbio_ptr,swap,store,error);
-		    }
-#ifdef MBR_EM710MBA_DEBUG
-	else fprintf(stderr,"NOT call mbr_em710mba_wr_ss2_mba kind:%d type %x\n",store->kind,store->type);
-#else
-#ifdef MBR_EM710MBA_DEBUG3
-	else fprintf(stderr,"NOT call mbr_em710mba_wr_ss2_mba\n\n");
-#endif
-#endif
-		}
-	else if (store->kind == MB_DATA_WATER_COLUMN)
-		{
-#ifdef MBR_EM710MBA_DEBUG
-	fprintf(stderr,"call mbr_em710mba_wr_wc kind:%d type %x\n",store->kind,store->type);
-#else
-#ifdef MBR_EM710MBA_DEBUG3
-	fprintf(stderr,"type:%x sonar:%d                      mbr_em710mba_wr_wc\n\n",store->type,store->sonar);
-#endif
-#endif
-	        status = mbr_em710mba_wr_wc(verbose,mbio_ptr,swap,store,error);
-		}
-	else
-		{
-#ifdef MBR_EM710MBA_DEBUG
-	fprintf(stderr,"call nothing bad kind: %d type %x\n", store->kind, store->type);
-#else
-#ifdef MBR_EM710MBA_DEBUG3
-	fprintf(stderr,"call nothing bad kind: %d type %x\n\n", store->kind, store->type);
-#endif
-#endif
-		status = MB_FAILURE;
-		*error = MB_ERROR_BAD_KIND;
-		}
-
-#ifdef MBR_EM710MBA_DEBUG
-	fprintf(stderr,"status:%d error:%d\n", status, *error);
-	fprintf(stderr,"end of mbr_em710mba_wr_data:\n");
-#endif
-
-	/* print output debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Data record kind in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       kind:       %d\n",store->kind);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em710mba_wr_start(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store, int *error)
-{
-	char	*function_name = "mbr_em710mba_wr_start";
-	int	status = MB_SUCCESS;
-	char	line[MBSYS_SIMRAD3_BUFFER_SIZE], *buff;
-	int	buff_len;
-	size_t	write_len;
-	int	write_size;
-	unsigned short checksum;
-	char	*comma_ptr;
-	mb_u_char   *uchar_ptr;
-	int	j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       par_date:        %d\n",store->par_date);
-		fprintf(stderr,"dbg5       par_msec:        %d\n",store->par_msec);
-		fprintf(stderr,"dbg5       par_line_num:    %d\n",store->par_line_num);
-		fprintf(stderr,"dbg5       par_serial_1:    %d\n",store->par_serial_1);
-		fprintf(stderr,"dbg5       par_serial_2:    %d\n",store->par_serial_2);
-		fprintf(stderr,"dbg5       par_wlz:         %f\n",store->par_wlz);
-		fprintf(stderr,"dbg5       par_smh:         %d\n",store->par_smh);
-		fprintf(stderr,"dbg5       par_hun:         %d\n",store->par_hun);
-		fprintf(stderr,"dbg5       par_hut:         %f\n",store->par_hut);
-		fprintf(stderr,"dbg5       par_txs:         %d\n",store->par_txs);
-		fprintf(stderr,"dbg5       par_t2x:         %d\n",store->par_t2x);
-		fprintf(stderr,"dbg5       par_r1s:         %d\n",store->par_r1s);
-		fprintf(stderr,"dbg5       par_r2s:         %d\n",store->par_r2s);
-		fprintf(stderr,"dbg5       par_stc:         %d\n",store->par_stc);
-		fprintf(stderr,"dbg5       par_s0z:         %f\n",store->par_s0z);
-		fprintf(stderr,"dbg5       par_s0x:         %f\n",store->par_s0x);
-		fprintf(stderr,"dbg5       par_s0y:         %f\n",store->par_s0y);
-		fprintf(stderr,"dbg5       par_s0h:         %f\n",store->par_s0h);
-		fprintf(stderr,"dbg5       par_s0r:         %f\n",store->par_s0r);
-		fprintf(stderr,"dbg5       par_s0p:         %f\n",store->par_s0p);
-		fprintf(stderr,"dbg5       par_s1z:         %f\n",store->par_s1z);
-		fprintf(stderr,"dbg5       par_s1x:         %f\n",store->par_s1x);
-		fprintf(stderr,"dbg5       par_s1y:         %f\n",store->par_s1y);
-		fprintf(stderr,"dbg5       par_s1h:         %f\n",store->par_s1h);
-		fprintf(stderr,"dbg5       par_s1r:         %f\n",store->par_s1r);
-		fprintf(stderr,"dbg5       par_s1p:         %f\n",store->par_s1p);
-		fprintf(stderr,"dbg5       par_s1n:         %d\n",store->par_s1n);
-		fprintf(stderr,"dbg5       par_s2z:         %f\n",store->par_s2z);
-		fprintf(stderr,"dbg5       par_s2x:         %f\n",store->par_s2x);
-		fprintf(stderr,"dbg5       par_s2y:         %f\n",store->par_s2y);
-		fprintf(stderr,"dbg5       par_s2h:         %f\n",store->par_s2h);
-		fprintf(stderr,"dbg5       par_s2r:         %f\n",store->par_s2r);
-		fprintf(stderr,"dbg5       par_s2p:         %f\n",store->par_s2p);
-		fprintf(stderr,"dbg5       par_s2n:         %d\n",store->par_s2n);
-		fprintf(stderr,"dbg5       par_s3z:         %f\n",store->par_s3z);
-		fprintf(stderr,"dbg5       par_s3x:         %f\n",store->par_s3x);
-		fprintf(stderr,"dbg5       par_s3y:         %f\n",store->par_s3y);
-		fprintf(stderr,"dbg5       par_s3h:         %f\n",store->par_s3h);
-		fprintf(stderr,"dbg5       par_s3r:         %f\n",store->par_s3r);
-		fprintf(stderr,"dbg5       par_s3p:         %f\n",store->par_s3p);
-		fprintf(stderr,"dbg5       par_s1s:         %d\n",store->par_s1s);
-		fprintf(stderr,"dbg5       par_s2s:         %d\n",store->par_s2s);
-		fprintf(stderr,"dbg5       par_go1:         %f\n",store->par_go1);
-		fprintf(stderr,"dbg5       par_go2:         %f\n",store->par_go2);
-		fprintf(stderr,"dbg5       par_obo:         %f\n",store->par_obo);
-		fprintf(stderr,"dbg5       par_fgd:         %f\n",store->par_fgd);
-		fprintf(stderr,"dbg5       par_tsv:         %s\n",store->par_tsv);
-		fprintf(stderr,"dbg5       par_rsv:         %s\n",store->par_rsv);
-		fprintf(stderr,"dbg5       par_bsv:         %s\n",store->par_bsv);
-		fprintf(stderr,"dbg5       par_psv:         %s\n",store->par_psv);
-		fprintf(stderr,"dbg5       par_dds:         %s\n",store->par_dds);
-		fprintf(stderr,"dbg5       par_osv:         %s\n",store->par_osv);
-		fprintf(stderr,"dbg5       par_dsv:         %s\n",store->par_dsv);
-		fprintf(stderr,"dbg5       par_dsx:         %f\n",store->par_dsx);
-		fprintf(stderr,"dbg5       par_dsy:         %f\n",store->par_dsy);
-		fprintf(stderr,"dbg5       par_dsz:         %f\n",store->par_dsz);
-		fprintf(stderr,"dbg5       par_dsd:         %d\n",store->par_dsd);
-		fprintf(stderr,"dbg5       par_dso:         %f\n",store->par_dso);
-		fprintf(stderr,"dbg5       par_dsf:         %f\n",store->par_dsf);
-		fprintf(stderr,"dbg5       par_dsh:         %c%c\n",store->par_dsh[0],store->par_dsh[1]);
-		fprintf(stderr,"dbg5       par_aps:         %d\n",store->par_aps);
-		fprintf(stderr,"dbg5       par_p1q:         %d\n",store->par_p1q);
-		fprintf(stderr,"dbg5       par_p1m:         %d\n",store->par_p1m);
-		fprintf(stderr,"dbg5       par_p1t:         %d\n",store->par_p1t);
-		fprintf(stderr,"dbg5       par_p1z:         %f\n",store->par_p1z);
-		fprintf(stderr,"dbg5       par_p1x:         %f\n",store->par_p1x);
-		fprintf(stderr,"dbg5       par_p1y:         %f\n",store->par_p1y);
-		fprintf(stderr,"dbg5       par_p1d:         %f\n",store->par_p1d);
-		fprintf(stderr,"dbg5       par_p1g:         %s\n",store->par_p1g);
-		fprintf(stderr,"dbg5       par_p2q:         %d\n",store->par_p2q);
-		fprintf(stderr,"dbg5       par_p2m:         %d\n",store->par_p2m);
-		fprintf(stderr,"dbg5       par_p2t:         %d\n",store->par_p2t);
-		fprintf(stderr,"dbg5       par_p2z:         %f\n",store->par_p2z);
-		fprintf(stderr,"dbg5       par_p2x:         %f\n",store->par_p2x);
-		fprintf(stderr,"dbg5       par_p2y:         %f\n",store->par_p2y);
-		fprintf(stderr,"dbg5       par_p2d:         %f\n",store->par_p2d);
-		fprintf(stderr,"dbg5       par_p2g:         %s\n",store->par_p2g);
-		fprintf(stderr,"dbg5       par_p3q:         %d\n",store->par_p3q);
-		fprintf(stderr,"dbg5       par_p3m:         %d\n",store->par_p3m);
-		fprintf(stderr,"dbg5       par_p3t:         %d\n",store->par_p3t);
-		fprintf(stderr,"dbg5       par_p3z:         %f\n",store->par_p3z);
-		fprintf(stderr,"dbg5       par_p3x:         %f\n",store->par_p3x);
-		fprintf(stderr,"dbg5       par_p3y:         %f\n",store->par_p3y);
-		fprintf(stderr,"dbg5       par_p3d:         %f\n",store->par_p3d);
-		fprintf(stderr,"dbg5       par_p3g:         %s\n",store->par_p3g);
-		fprintf(stderr,"dbg5       par_p3s:         %d\n",store->par_p3s);
-		fprintf(stderr,"dbg5       par_msz:         %f\n",store->par_msz);
-		fprintf(stderr,"dbg5       par_msx:         %f\n",store->par_msx);
-		fprintf(stderr,"dbg5       par_msy:         %f\n",store->par_msy);
-		fprintf(stderr,"dbg5       par_mrp:         %c%c\n",store->par_mrp[0],store->par_mrp[1]);
-		fprintf(stderr,"dbg5       par_msd:         %f\n",store->par_msd);
-		fprintf(stderr,"dbg5       par_msr:         %f\n",store->par_msr);
-		fprintf(stderr,"dbg5       par_msp:         %f\n",store->par_msp);
-		fprintf(stderr,"dbg5       par_msg:         %f\n",store->par_msg);
-		fprintf(stderr,"dbg5       par_nsz:         %f\n",store->par_nsz);
-		fprintf(stderr,"dbg5       par_nsx:         %f\n",store->par_nsx);
-		fprintf(stderr,"dbg5       par_nsy:         %f\n",store->par_nsy);
-		fprintf(stderr,"dbg5       par_nrp:         %c%c\n",store->par_nrp[0],store->par_nrp[1]);
-		fprintf(stderr,"dbg5       par_nsd:         %f\n",store->par_nsd);
-		fprintf(stderr,"dbg5       par_nsr:         %f\n",store->par_nsr);
-		fprintf(stderr,"dbg5       par_nsp:         %f\n",store->par_nsp);
-		fprintf(stderr,"dbg5       par_nsg:         %f\n",store->par_nsg);
-		fprintf(stderr,"dbg5       par_gcg:         %f\n",store->par_gcg);
-		fprintf(stderr,"dbg5       par_mas:         %f\n",store->par_mas);
-		fprintf(stderr,"dbg5       par_shc:         %d\n",store->par_shc);
-		fprintf(stderr,"dbg5       par_pps:         %d\n",store->par_pps);
-		fprintf(stderr,"dbg5       par_cls:         %d\n",store->par_cls);
-		fprintf(stderr,"dbg5       par_clo:         %d\n",store->par_clo);
-		fprintf(stderr,"dbg5       par_vsn:         %d\n",store->par_vsn);
-		fprintf(stderr,"dbg5       par_vsu:         %d\n",store->par_vsu);
-		fprintf(stderr,"dbg5       par_vse:         %d\n",store->par_vse);
-		fprintf(stderr,"dbg5       par_vtu:         %d\n",store->par_vtu);
-		fprintf(stderr,"dbg5       par_vte:         %d\n",store->par_vte);
-		fprintf(stderr,"dbg5       par_aro:         %d\n",store->par_aro);
-		fprintf(stderr,"dbg5       par_ahe:         %d\n",store->par_ahe);
-		fprintf(stderr,"dbg5       par_ahs:         %d\n",store->par_ahs);
-		fprintf(stderr,"dbg5       par_vsi:         %s\n",store->par_vsi);
-		fprintf(stderr,"dbg5       par_vsm:         %s\n",store->par_vsm);
-		fprintf(stderr,"dbg5       par_mca1:        %s\n",store->par_mca1);
-		fprintf(stderr,"dbg5       par_mcu1:        %d\n",store->par_mcu1);
-		fprintf(stderr,"dbg5       par_mci1:        %s\n",store->par_mci1);
-		fprintf(stderr,"dbg5       par_mcp1:        %d\n",store->par_mcp1);
-		fprintf(stderr,"dbg5       par_mca2:        %s\n",store->par_mca2);
-		fprintf(stderr,"dbg5       par_mcu2:        %d\n",store->par_mcu2);
-		fprintf(stderr,"dbg5       par_mci2:        %s\n",store->par_mci2);
-		fprintf(stderr,"dbg5       par_mcp2:        %d\n",store->par_mcp2);
-		fprintf(stderr,"dbg5       par_mca3:        %s\n",store->par_mca3);
-		fprintf(stderr,"dbg5       par_mcu3:        %d\n",store->par_mcu3);
-		fprintf(stderr,"dbg5       par_mci3:        %s\n",store->par_mci3);
-		fprintf(stderr,"dbg5       par_mcp3:        %d\n",store->par_mcp3);
-		fprintf(stderr,"dbg5       par_mca4:        %s\n",store->par_mca4);
-		fprintf(stderr,"dbg5       par_mcu4:        %d\n",store->par_mcu4);
-		fprintf(stderr,"dbg5       par_mci4:        %s\n",store->par_mci4);
-		fprintf(stderr,"dbg5       par_mcp4:        %d\n",store->par_mcp4);
-		fprintf(stderr,"dbg5       par_snl:         %d\n",store->par_snl);
-		fprintf(stderr,"dbg5       par_cpr:         %s\n",store->par_cpr);
-		fprintf(stderr,"dbg5       par_rop:         %s\n",store->par_rop);
-		fprintf(stderr,"dbg5       par_sid:         %s\n",store->par_sid);
-		fprintf(stderr,"dbg5       par_rfn:         %s\n",store->par_rfn);
-		fprintf(stderr,"dbg5       par_pll:         %s\n",store->par_pll);
-		fprintf(stderr,"dbg5       par_com:         %s\n",store->par_com);
-		}
-
-	/* zero checksum */
-	checksum = 0;
-
-	/* if data type not set - use start */
-	if (store->type == EM3_NONE)
-	    store->type = EM3_START;
-
-	/* if sonar not set use EM710 */
-	if (store->sonar == 0)
-	    store->sonar = MBSYS_SIMRAD3_EM710;
-
-	/* set up start of output buffer - we handle this
-	   record differently because of the ascii data */
-	memset(line, 0, MBSYS_SIMRAD3_BUFFER_SIZE);
-
-	/* put binary header data into buffer */
-	if (status == MB_SUCCESS)
-		{
-		line[4] = EM3_START_BYTE;
-		line[5] = EM3_ID_START;
-		mb_put_binary_short(swap, (unsigned short) store->sonar, (void *) &line[6]);
-		mb_put_binary_int(swap, (int) store->par_date, (void *) &line[8]);
-		mb_put_binary_int(swap, (int) store->par_msec, (void *) &line[12]);
-		mb_put_binary_short(swap, (unsigned short) store->par_line_num, (void *) &line[16]);
-		mb_put_binary_short(swap, (unsigned short) store->par_serial_1, (void *) &line[18]);
-		mb_put_binary_short(swap, (unsigned short) store->par_serial_2, (void *) &line[20]);
-		}
-		
-	/* construct ascii parameter buffer */
-	buff = &line[22];
-	buff_len = 0;
-	
-	if (store->par_wlz != 0.0)
-		{
-		sprintf(&buff[buff_len], "WLZ=%.3f,", store->par_wlz);
-		buff_len = strlen(buff);		
-		}
-	if (store->par_smh != 0)
-		{
-		sprintf(&buff[buff_len], "SMH=%d,", store->par_smh);
-		buff_len = strlen(buff);		
-		}
-	if (store->par_hut != 0.0)
-		{
-		sprintf(&buff[buff_len], "HUN=%d,", store->par_hun);
-		buff_len = strlen(buff);		
-		sprintf(&buff[buff_len], "HUT=%f,", store->par_hut);
-		buff_len = strlen(buff);		
-		}
-	if (store->par_txs != 0)
-		{
-		sprintf(&buff[buff_len], "TXS=%d,", store->par_txs);
-		buff_len = strlen(buff);		
-		}
-	if (store->par_t2x != 0)
-		{
-		sprintf(&buff[buff_len], "T2X=%d,", store->par_t2x);
-		buff_len = strlen(buff);		
-		}
-	if (store->par_r1s != 0)
-		{
-		sprintf(&buff[buff_len], "R1S=%d,", store->par_r1s);
-		buff_len = strlen(buff);		
-		}
-	if (store->par_r2s != 0)
-		{
-		sprintf(&buff[buff_len], "R2S=%d,", store->par_r2s);
-		buff_len = strlen(buff);		
-		}
-	sprintf(&buff[buff_len], "STC=%d,", store->par_stc);
-	buff_len = strlen(buff);
-	if (store->par_stc == 4)
-		{
-		sprintf(&buff[buff_len], "S0Z=%.3f,", store->par_s0z);
-		buff_len = strlen(buff);		
-		sprintf(&buff[buff_len], "S0X=%.3f,", store->par_s0x);
-		buff_len = strlen(buff);		
-		sprintf(&buff[buff_len], "S0Y=%.3f,", store->par_s0y);
-		buff_len = strlen(buff);		
-		sprintf(&buff[buff_len], "S0H=%.3f,", store->par_s0h);
-		buff_len = strlen(buff);		
-		sprintf(&buff[buff_len], "S0R=%.3f,", store->par_s0r);
-		buff_len = strlen(buff);		
-		sprintf(&buff[buff_len], "S0P=%.3f,", store->par_s0p);
-		buff_len = strlen(buff);		
-		}
-	sprintf(&buff[buff_len], "S1Z=%.3f,", store->par_s1z);
-	buff_len = strlen(buff);		
-	sprintf(&buff[buff_len], "S1X=%.3f,", store->par_s1x);
-	buff_len = strlen(buff);		
-	sprintf(&buff[buff_len], "S1Y=%.3f,", store->par_s1y);
-	buff_len = strlen(buff);		
-	sprintf(&buff[buff_len], "S1H=%.3f,", store->par_s1h);
-	buff_len = strlen(buff);		
-	sprintf(&buff[buff_len], "S1R=%.3f,", store->par_s1r);
-	buff_len = strlen(buff);		
-	sprintf(&buff[buff_len], "S1P=%.3f,", store->par_s1p);
-	buff_len = strlen(buff);		
-	sprintf(&buff[buff_len], "S1S=%d,", store->par_s1s);
-	buff_len = strlen(buff);		
-	if (store->par_stc != 1)
-		{
-		sprintf(&buff[buff_len], "S2Z=%.3f,", store->par_s2z);
-		buff_len = strlen(buff);		
-		sprintf(&buff[buff_len], "S2X=%.3f,", store->par_s2x);
-		buff_len = strlen(buff);		
-		sprintf(&buff[buff_len], "S2Y=%.3f,", store->par_s2y);
-		buff_len = strlen(buff);		
-		sprintf(&buff[buff_len], "S2H=%.3f,", store->par_s2h);
-		buff_len = strlen(buff);		
-		sprintf(&buff[buff_len], "S2R=%.3f,", store->par_s2r);
-		buff_len = strlen(buff);		
-		sprintf(&buff[buff_len], "S2P=%.3f,", store->par_s2p);
-		buff_len = strlen(buff);		
-		sprintf(&buff[buff_len], "S2S=%d,", store->par_s2s);
-		buff_len = strlen(buff);
-		}
-	if (store->par_stc >= 3)
-		{
-		sprintf(&buff[buff_len], "S3Z=%.3f,", store->par_s3z);
-		buff_len = strlen(buff);		
-		sprintf(&buff[buff_len], "S3X=%.3f,", store->par_s3x);
-		buff_len = strlen(buff);		
-		sprintf(&buff[buff_len], "S3Y=%.3f,", store->par_s3y);
-		buff_len = strlen(buff);		
-		sprintf(&buff[buff_len], "S3H=%.3f,", store->par_s3h);
-		buff_len = strlen(buff);		
-		sprintf(&buff[buff_len], "S3R=%.3f,", store->par_s3r);
-		buff_len = strlen(buff);		
-		sprintf(&buff[buff_len], "S3P=%.3f,", store->par_s3p);
-		buff_len = strlen(buff);		
-		}
-	if (store->par_go1 != 0.0)
-		{
-		sprintf(&buff[buff_len], "GO1=%.3f,", store->par_go1);
-		buff_len = strlen(buff);
-		}
-	if (store->par_go2 != 0.0)
-		{
-		sprintf(&buff[buff_len], "GO2=%.3f,", store->par_go1);
-		buff_len = strlen(buff);
-		}
-	if (store->par_obo != 0.0)
-		{
-		sprintf(&buff[buff_len], "OBO=%.3f,", store->par_obo);
-		buff_len = strlen(buff);
-		}
-	if (store->par_fgd != 0.0)
-		{
-		sprintf(&buff[buff_len], "FGD=%.3f,", store->par_fgd);
-		buff_len = strlen(buff);
-		}
-	if (strlen(store->par_tsv) > 0)
-		{
-		sprintf(&buff[buff_len], "TSV=%s,", store->par_tsv);
-		buff_len = strlen(buff);
-		}
-	if (strlen(store->par_rsv) > 0)
-		{
-		sprintf(&buff[buff_len], "RSV=%s,", store->par_rsv);
-		buff_len = strlen(buff);
-		}
-	if (strlen(store->par_bsv) > 0)
-		{
-		sprintf(&buff[buff_len], "BSV=%s,", store->par_bsv);
-		buff_len = strlen(buff);
-		}
-	if (strlen(store->par_psv) > 0)
-		{
-		sprintf(&buff[buff_len], "PSV=%s,", store->par_psv);
-		buff_len = strlen(buff);
-		}
-	if (strlen(store->par_dds) > 0)
-		{
-		sprintf(&buff[buff_len], "DDS=%s,", store->par_dds);
-		buff_len = strlen(buff);
-		}
-	if (strlen(store->par_osv) > 0)
-		{
-		sprintf(&buff[buff_len], "OSV=%s,", store->par_osv);
-		buff_len = strlen(buff);
-		}
-	if (strlen(store->par_dsv) > 0)
-		{
-		sprintf(&buff[buff_len], "DSV=%s,", store->par_dsv);
-		buff_len = strlen(buff);
-		}
-
-	sprintf(&buff[buff_len], "DSX=%.6f,", store->par_dsx);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "DSY=%.6f,", store->par_dsy);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "DSZ=%.6f,", store->par_dsz);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "DSD=%d,", store->par_dsd);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "DSO=%.6f,", store->par_dso);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "DSF=%.6f,", store->par_dsf);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "DSH=%c%c,",store->par_dsh[0], store->par_dsh[1]);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "APS=%d,",store->par_aps);
-	buff_len = strlen(buff);
-	
-	if (store->par_p1q)
-		{
-		sprintf(&buff[buff_len], "P1Q=%d,",store->par_p1q);
-		buff_len = strlen(buff);
-		sprintf(&buff[buff_len], "P1M=%d,",store->par_p1m);
-		buff_len = strlen(buff);
-		sprintf(&buff[buff_len], "P1T=%d,",store->par_p1t);
-		buff_len = strlen(buff);
-		sprintf(&buff[buff_len], "P1Z=%.3f,", store->par_p1z);
-		buff_len = strlen(buff);
-		sprintf(&buff[buff_len], "P1X=%.3f,", store->par_p1x);
-		buff_len = strlen(buff);
-		sprintf(&buff[buff_len], "P1Y=%.3f,", store->par_p1y);
-		buff_len = strlen(buff);
-		sprintf(&buff[buff_len], "P1D=%.1f,", store->par_p1d);
-		buff_len = strlen(buff);
-		sprintf(&buff[buff_len], "P1G=%s,", store->par_p1g);
-		buff_len = strlen(buff);
-		}
-	if (store->par_p2q)
-		{
-		sprintf(&buff[buff_len], "P2Q=%d,",store->par_p2q);
-		buff_len = strlen(buff);
-		sprintf(&buff[buff_len], "P2M=%d,",store->par_p2m);
-		buff_len = strlen(buff);
-		sprintf(&buff[buff_len], "P2T=%d,",store->par_p2t);
-		buff_len = strlen(buff);
-		sprintf(&buff[buff_len], "P2Z=%.3f,", store->par_p2z);
-		buff_len = strlen(buff);
-		sprintf(&buff[buff_len], "P2X=%.3f,", store->par_p2x);
-		buff_len = strlen(buff);
-		sprintf(&buff[buff_len], "P2Y=%.3f,", store->par_p2y);
-		buff_len = strlen(buff);
-		sprintf(&buff[buff_len], "P2D=%.3f,", store->par_p2d);
-		buff_len = strlen(buff);
-		sprintf(&buff[buff_len], "P2G=%s,", store->par_p2g);
-		buff_len = strlen(buff);
-		}
-	if (store->par_p3q)
-		{
-		sprintf(&buff[buff_len], "P3Q=%d,",store->par_p3q);
-		buff_len = strlen(buff);
-		sprintf(&buff[buff_len], "P3M=%d,",store->par_p3m);
-		buff_len = strlen(buff);
-		sprintf(&buff[buff_len], "P3T=%d,",store->par_p3t);
-		buff_len = strlen(buff);
-		sprintf(&buff[buff_len], "P3Z=%.3f,", store->par_p3z);
-		buff_len = strlen(buff);
-		sprintf(&buff[buff_len], "P3X=%.3f,", store->par_p3x);
-		buff_len = strlen(buff);
-		sprintf(&buff[buff_len], "P3Y=%.3f,", store->par_p3y);
-		buff_len = strlen(buff);
-		sprintf(&buff[buff_len], "P3D=%.3f,", store->par_p3d);
-		buff_len = strlen(buff);
-		sprintf(&buff[buff_len], "P3G=%s,", store->par_p3g);
-		buff_len = strlen(buff);
-		sprintf(&buff[buff_len], "P3S=%d,",store->par_p3s);
-		buff_len = strlen(buff);
-		}
-	
-	sprintf(&buff[buff_len], "MSZ=%.3f,", store->par_msz);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "MSX=%.3f,", store->par_msx);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "MSY=%.3f,", store->par_msy);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "MRP=%c%c,",
-		store->par_mrp[0], store->par_mrp[1]);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "MSD=%.3f,", store->par_msd);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "MSR=%.3f,", store->par_msr);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "MSP=%.3f,", store->par_msp);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "MSG=%.3f,", store->par_msg);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "NSZ=%.3f,", store->par_nsz);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "NSX=%.3f,", store->par_nsx);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "NSY=%.3f,", store->par_nsy);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "NRP=%c%c,",
-		store->par_nrp[0], store->par_nrp[1]);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "NSD=%.3f,", store->par_nsd);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "NSR=%.3f,", store->par_nsr);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "NSP=%.3f,", store->par_nsp);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "NSG=%.3f,", store->par_nsg);
-	buff_len = strlen(buff);
-	
-	sprintf(&buff[buff_len], "GCG=%.3f,", store->par_gcg);
-	buff_len = strlen(buff);
-	if (store->par_mas != 0.0)
-	    {
-	    sprintf(&buff[buff_len], "MAS=%.3f,", store->par_mas);
-	    buff_len = strlen(buff);
-	    }
-	sprintf(&buff[buff_len], "SHC=%d,", store->par_shc);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "PPS=%d,", store->par_pps);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "CLS=%d,", store->par_cls);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "CLO=%d,", store->par_clo);
-	buff_len = strlen(buff);
-	
-	sprintf(&buff[buff_len], "VSN=%d,", store->par_vsn);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "VSU=%d,", store->par_vsu);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "VSE=%d,", store->par_vse);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "VTU=%d,", store->par_vtu);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "VTE=%d,", store->par_vte);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "ARO=%d,", store->par_aro);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "AHE=%d,", store->par_ahe);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "AHS=%d,", store->par_ahs);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "VSI=%s,", store->par_vsi);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "VSM=%s,", store->par_vsm);
-	buff_len = strlen(buff);
-	
-	if (store->par_mcp1 > 0)
-		{
-		sprintf(&buff[buff_len], "MCA1=%s,", store->par_mca1);
-		buff_len = strlen(buff);
-		sprintf(&buff[buff_len], "MCU1=%d,", store->par_mcu1);
-		buff_len = strlen(buff);
-		sprintf(&buff[buff_len], "MCI1=%s,", store->par_mci1);
-		buff_len = strlen(buff);
-		sprintf(&buff[buff_len], "MCP1=%d,", store->par_mcp1);
-		buff_len = strlen(buff);
-		}
-	if (store->par_mcp2 > 0)
-		{
-		sprintf(&buff[buff_len], "MCA2=%s,", store->par_mca2);
-		buff_len = strlen(buff);
-		sprintf(&buff[buff_len], "MCU2=%d,", store->par_mcu2);
-		buff_len = strlen(buff);
-		sprintf(&buff[buff_len], "MCI2=%s,", store->par_mci2);
-		buff_len = strlen(buff);
-		sprintf(&buff[buff_len], "MCP2=%d,", store->par_mcp2);
-		buff_len = strlen(buff);
-		}
-	if (store->par_mcp3 > 0)
-		{
-		sprintf(&buff[buff_len], "MCA3=%s,", store->par_mca3);
-		buff_len = strlen(buff);
-		sprintf(&buff[buff_len], "MCU3=%d,", store->par_mcu3);
-		buff_len = strlen(buff);
-		sprintf(&buff[buff_len], "MCI3=%s,", store->par_mci3);
-		buff_len = strlen(buff);
-		sprintf(&buff[buff_len], "MCP3=%d,", store->par_mcp3);
-		buff_len = strlen(buff);
-		}
-	if (store->par_mcp4 > 0)
-		{
-		sprintf(&buff[buff_len], "MCA4=%s,", store->par_mca4);
-		buff_len = strlen(buff);
-		sprintf(&buff[buff_len], "MCU4=%d,", store->par_mcu4);
-		buff_len = strlen(buff);
-		sprintf(&buff[buff_len], "MCI4=%s,", store->par_mci4);
-		buff_len = strlen(buff);
-		sprintf(&buff[buff_len], "MCP4=%d,", store->par_mcp4);
-		buff_len = strlen(buff);
-		}
-	sprintf(&buff[buff_len], "SNL=%d,", store->par_snl);
-	buff_len = strlen(buff);
-	
-	if (strlen(store->par_cpr) > 0)
-	    {
-	    sprintf(&buff[buff_len], "CPR=%s,", store->par_cpr);
-	    buff_len = strlen(buff);
-	    }
-	if (strlen(store->par_rop) > 0)
-	    {
-	    sprintf(&buff[buff_len], "ROP=%s,", store->par_rop);
-	    buff_len = strlen(buff);
-	    }
-	if (strlen(store->par_sid) > 0)
-	    {
-	    sprintf(&buff[buff_len], "SID=%s,", store->par_sid);
-	    buff_len = strlen(buff);
-	    }
-	if (strlen(store->par_rfn) > 0)
-	    {
-	    sprintf(&buff[buff_len], "RFN=%s,", store->par_rfn);
-	    buff_len = strlen(buff);
-	    }
-	if (strlen(store->par_pll) > 0)
-	    {
-	    sprintf(&buff[buff_len], "PLL=%s,", store->par_pll);
-	    buff_len = strlen(buff);
-	    }
-	if (strlen(store->par_com) > 0)
-	    {
-	    /* replace commas (,) with caret (^) values to circumvent
-	       the format's inability to store commas in comments */
-	    while ((comma_ptr = strchr(store->par_com, ',')) != NULL)
-		{
-		comma_ptr[0] = '^';
-		}
-	    sprintf(&buff[buff_len], "COM=%s,", store->par_com);
-	    buff_len = strlen(buff);
-	    }
-	buff[buff_len] = ',';
-	buff_len++;
-	if (buff_len % 2 == 0)
-	    buff_len++;
-
-	/* put end of record in buffer */
-	line[buff_len + 22] = EM3_END;
-
-	/* get size of record */
-	write_size = 25 + buff_len;
-	mb_put_binary_int(swap, (int) (write_size - 4), (void *) &line[0]);
-
-	/* compute checksum */
-	uchar_ptr = (mb_u_char *) line;
-	for (j=5;j<write_size-3;j++)
-	    checksum += uchar_ptr[j];
-
-	/* set checksum */
-	mb_put_binary_short(swap, (unsigned short) checksum, (void *) &line[buff_len + 23]);
-
-	/* finally write out the data */
-	write_len = write_size;
-	status = mb_fileio_put(verbose, mbio_ptr, line, &write_len, error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em710mba_wr_status(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store, int *error)
-{
-	char	*function_name = "mbr_em710mba_wr_status";
-	int	status = MB_SUCCESS;
-	char	line[EM3_PU_STATUS_SIZE];
-	short	label;
-	char	*labelchar;
-	size_t	write_len;
-	int	write_size;
-	unsigned short checksum;
-	mb_u_char   *uchar_ptr;
-	int	j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:                %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:               %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:                %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:                %d\n",store->msec);
-		fprintf(stderr,"dbg5       run_date:            %d\n",store->sts_date);
-		fprintf(stderr,"dbg5       run_msec:            %d\n",store->sts_msec);
-		fprintf(stderr,"dbg5       sts_status_count:    %d\n",store->sts_status_count);
-		fprintf(stderr,"dbg5       run_serial:          %d\n",store->sts_serial);
-		fprintf(stderr,"dbg5       sts_pingrate:        %d\n",store->sts_pingrate);
-		fprintf(stderr,"dbg5       sts_ping_count:      %d\n",store->sts_ping_count);
-		fprintf(stderr,"dbg5       sts_load:            %d\n",store->sts_load);
-		fprintf(stderr,"dbg5       sts_udp_status:      %d\n",store->sts_udp_status);
-		fprintf(stderr,"dbg5       sts_serial1_status:  %d\n",store->sts_serial1_status);
-		fprintf(stderr,"dbg5       sts_serial2_status:  %d\n",store->sts_serial2_status);
-		fprintf(stderr,"dbg5       sts_serial3_status:  %d\n",store->sts_serial3_status);
-		fprintf(stderr,"dbg5       sts_serial4_status:  %d\n",store->sts_serial4_status);
-		fprintf(stderr,"dbg5       sts_pps_status:      %d\n",store->sts_pps_status);
-		fprintf(stderr,"dbg5       sts_position_status: %d\n",store->sts_position_status);
-		fprintf(stderr,"dbg5       sts_attitude_status: %d\n",store->sts_attitude_status);
-		fprintf(stderr,"dbg5       sts_clock_status:    %d\n",store->sts_clock_status);
-		fprintf(stderr,"dbg5       sts_heading_status:  %d\n",store->sts_heading_status);
-		fprintf(stderr,"dbg5       sts_pu_status:       %d\n",store->sts_pu_status);
-		fprintf(stderr,"dbg5       sts_last_heading:    %d\n",store->sts_last_heading);
-		fprintf(stderr,"dbg5       sts_last_roll:       %d\n",store->sts_last_roll);
-		fprintf(stderr,"dbg5       sts_last_pitch:      %d\n",store->sts_last_pitch);
-		fprintf(stderr,"dbg5       sts_last_heave:      %d\n",store->sts_last_heave);
-		fprintf(stderr,"dbg5       sts_last_ssv:        %d\n",store->sts_last_ssv);
-		fprintf(stderr,"dbg5       sts_last_heave:      %d\n",store->sts_last_heave);
-		fprintf(stderr,"dbg5       sts_last_depth:      %d\n",store->sts_last_depth);
-		fprintf(stderr,"dbg5       sts_spare:           %d\n",store->sts_spare);
-		fprintf(stderr,"dbg5       sts_bso:             %d\n",store->sts_bso);
-		fprintf(stderr,"dbg5       sts_bsn:             %d\n",store->sts_bsn);
-		fprintf(stderr,"dbg5       sts_gain:            %d\n",store->sts_gain);
-		fprintf(stderr,"dbg5       sts_dno:             %d\n",store->sts_dno);
-		fprintf(stderr,"dbg5       sts_rno:             %d\n",store->sts_rno);
-		fprintf(stderr,"dbg5       sts_port:            %d\n",store->sts_port);
-		fprintf(stderr,"dbg5       sts_stbd:            %d\n",store->sts_stbd);
-		fprintf(stderr,"dbg5       sts_ssp:             %d\n",store->sts_ssp);
-		fprintf(stderr,"dbg5       sts_yaw:             %d\n",store->sts_yaw);
-		fprintf(stderr,"dbg5       sts_port2:           %d\n",store->sts_port2);
-		fprintf(stderr,"dbg5       sts_stbd2:           %d\n",store->sts_stbd2);
-		fprintf(stderr,"dbg5       sts_spare2:          %d\n",store->sts_spare2);
-		}
-
-	/* zero checksum */
-	checksum = 0;
-
-	/* write the record size */
-	mb_put_binary_int(swap, (int) (EM3_PU_STATUS_SIZE), (void *) &write_size);
-	write_len = 4;
-	mb_fileio_put(verbose, mbio_ptr, (char *)&write_size, &write_len, error);
-
-	/* write the record label */
-	if (status == MB_SUCCESS)
-		{
-		labelchar = (char *) &label;
-		labelchar[0] = EM3_START_BYTE;
-		labelchar[1] = EM3_ID_PU_STATUS;
-		write_len = 2;
-		status = mb_fileio_put(verbose, mbio_ptr, (char *)&label, &write_len, error);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[1];
-		}
-
-	/* write the sonar id */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_short(swap, (short) (store->sonar), (void *) &label);
-		write_len = 2;
-		status = mb_fileio_put(verbose, mbio_ptr, (char *)&label, &write_len, error);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[0];
-		checksum += uchar_ptr[1];
-		}
-
-	/* construct binary data */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_int(swap, (int) store->sts_date, (void *) &line[0]);
-		mb_put_binary_int(swap, (int) store->sts_msec, (void *) &line[4]);
-		mb_put_binary_short(swap, (unsigned short) store->sts_status_count, (void *) &line[8]);
-		mb_put_binary_short(swap, (unsigned short) store->run_serial, (void *) &line[10]);
-		mb_put_binary_short(swap, (unsigned short) store->sts_pingrate, (void *) &line[12]);
-		mb_put_binary_short(swap, (unsigned short) store->sts_ping_count, (void *) &line[14]);
-		mb_put_binary_int(swap, (int) store->sts_load, (void *) &line[16]);
-		mb_put_binary_int(swap, (int) store->sts_udp_status, (void *) &line[20]);
-		mb_put_binary_int(swap, (int) store->sts_serial1_status, (void *) &line[24]);
-		mb_put_binary_int(swap, (int) store->sts_serial2_status, (void *) &line[28]);
-		mb_put_binary_int(swap, (int) store->sts_serial3_status, (void *) &line[32]);
-		mb_put_binary_int(swap, (int) store->sts_serial3_status, (void *) &line[36]);
-		line[40] = store->sts_pps_status;
-		line[41] = store->sts_position_status;
-		line[42] = store->sts_attitude_status;
-		line[43] = store->sts_clock_status;
-		line[44] = store->sts_heading_status;
-		line[45] = store->sts_pu_status;
-		mb_put_binary_short(swap, (unsigned short) store->sts_last_heading, (void *) &line[46]);
-		mb_put_binary_short(swap, (short) store->sts_last_roll, (void *) &line[48]);
-		mb_put_binary_short(swap, (short) store->sts_last_pitch, (void *) &line[50]);
-		mb_put_binary_short(swap, (short) store->sts_last_heave, (void *) &line[52]);
-		mb_put_binary_short(swap, (unsigned short) store->sts_last_ssv, (void *) &line[54]);
-		mb_put_binary_int(swap, (int) store->sts_last_depth, (void *) &line[56]);
-		mb_put_binary_int(swap, (int) store->sts_spare, (void *) &line[60]);
-		line[64] = store->sts_bso;
-		line[65] = store->sts_bsn;
-		line[66] = store->sts_gain;
-		line[67] = store->sts_dno;
-		mb_put_binary_short(swap, (unsigned short) store->sts_rno, (void *) &line[68]);
-		line[70] = store->sts_port;
-		line[71] = store->sts_stbd;
-		mb_put_binary_short(swap, (unsigned short) store->sts_ssp, (void *) &line[72]);
-		mb_put_binary_short(swap, (unsigned short) store->sts_yaw, (void *) &line[74]);
-		mb_put_binary_short(swap, (unsigned short) store->sts_port2, (void *) &line[76]);
-		mb_put_binary_short(swap, (unsigned short) store->sts_stbd2, (void *) &line[78]);
-		line[80] = store->sts_spare2;
-		line[EM3_PU_STATUS_SIZE-7] = 0x03;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM3_PU_STATUS_SIZE-7;j++)
-		    checksum += uchar_ptr[j];
-
-		/* set checksum */
-		mb_put_binary_short(swap, (unsigned short) checksum, (void *) &line[EM3_PU_STATUS_SIZE-6]);
-
-		/* write out data */
-		write_len = EM3_PU_STATUS_SIZE-4;
-		status = mb_fileio_put(verbose, mbio_ptr, line, &write_len, error);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em710mba_wr_run_parameter(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store, int *error)
-{
-	char	*function_name = "mbr_em710mba_wr_run_parameter";
-	int	status = MB_SUCCESS;
-	char	line[EM3_RUN_PARAMETER_SIZE];
-	short	label;
-	char	*labelchar;
-	size_t	write_len;
-	int	write_size;
-	unsigned short checksum;
-	mb_u_char   *uchar_ptr;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       run_date:        %d\n",store->run_date);
-		fprintf(stderr,"dbg5       run_msec:        %d\n",store->run_msec);
-		fprintf(stderr,"dbg5       run_ping_count:  %d\n",store->run_ping_count);
-		fprintf(stderr,"dbg5       run_serial:      %d\n",store->run_serial);
-		fprintf(stderr,"dbg5       run_status:      %d\n",store->run_status);
-		fprintf(stderr,"dbg5       run_mode:        %d\n",store->run_mode);
-		fprintf(stderr,"dbg5       run_filter_id:   %d\n",store->run_filter_id);
-		fprintf(stderr,"dbg5       run_min_depth:   %d\n",store->run_min_depth);
-		fprintf(stderr,"dbg5       run_max_depth:   %d\n",store->run_max_depth);
-		fprintf(stderr,"dbg5       run_absorption:  %d\n",store->run_absorption);
-		fprintf(stderr,"dbg5       run_tran_pulse:  %d\n",store->run_tran_pulse);
-		fprintf(stderr,"dbg5       run_tran_beam:   %d\n",store->run_tran_beam);
-		fprintf(stderr,"dbg5       run_tran_pow:    %d\n",store->run_tran_pow);
-		fprintf(stderr,"dbg5       run_rec_beam:    %d\n",store->run_rec_beam);
-		fprintf(stderr,"dbg5       run_rec_band:    %d\n",store->run_rec_band);
-		fprintf(stderr,"dbg5       run_rec_gain:    %d\n",store->run_rec_gain);
-		fprintf(stderr,"dbg5       run_tvg_cross:   %d\n",store->run_tvg_cross);
-		fprintf(stderr,"dbg5       run_ssv_source:  %d\n",store->run_ssv_source);
-		fprintf(stderr,"dbg5       run_max_swath:   %d\n",store->run_max_swath);
-		fprintf(stderr,"dbg5       run_beam_space:  %d\n",store->run_beam_space);
-		fprintf(stderr,"dbg5       run_swath_angle: %d\n",store->run_swath_angle);
-		fprintf(stderr,"dbg5       run_stab_mode:   %d\n",store->run_stab_mode);
-		for (i=0;i<6;i++)
-			fprintf(stderr,"dbg5       run_spare[%d]:    %d\n",i,store->run_spare[i]);
-		}
-
-	/* zero checksum */
-	checksum = 0;
-
-	/* write the record size */
-	mb_put_binary_int(swap, (int) (EM3_RUN_PARAMETER_SIZE), (void *) &write_size);
-	write_len = 4;mb_fileio_put(verbose, mbio_ptr, (char *)&write_size, &write_len, error);
-	if (write_len != 4)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	else
-		status = MB_SUCCESS;
-
-	/* write the record label */
-	if (status == MB_SUCCESS)
-		{
-		labelchar = (char *) &label;
-		labelchar[0] = EM3_START_BYTE;
-		labelchar[1] = EM3_ID_RUN_PARAMETER;
-		write_len = 2;
-		status = mb_fileio_put(verbose, mbio_ptr, (char *)&label, &write_len, error);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[1];
-		}
-
-	/* write the sonar id */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_short(swap, (short) (store->sonar), (void *) &label);
-		write_len = 2;
-		status = mb_fileio_put(verbose, mbio_ptr, (char *)&label, &write_len, error);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[0];
-		checksum += uchar_ptr[1];
-		}
-
-	/* construct binary data */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_int(swap, (int) store->run_date, (void *) &line[0]);
-		mb_put_binary_int(swap, (int) store->run_msec, (void *) &line[4]);
-		mb_put_binary_short(swap, (unsigned short) store->run_ping_count, (void *) &line[8]);
-		mb_put_binary_short(swap, (unsigned short) store->run_serial, (void *) &line[10]);
-		mb_put_binary_int(swap, (int) store->run_status, (void *) &line[12]);
-		line[16] = store->run_mode;
-		line[17] = store->run_filter_id;
-		mb_put_binary_short(swap, (unsigned short) store->run_min_depth, (void *) &line[18]);
-		mb_put_binary_short(swap, (unsigned short) store->run_max_depth, (void *) &line[20]);
-		mb_put_binary_short(swap, (unsigned short) store->run_absorption, (void *) &line[22]);
-		mb_put_binary_short(swap, (unsigned short) store->run_tran_pulse, (void *) &line[24]);
-		mb_put_binary_short(swap, (unsigned short) store->run_tran_beam, (void *) &line[26]);
-		line[28] = store->run_tran_pow;
-		line[29] = store->run_rec_beam;
-		line[30] = store->run_rec_band;
-		line[31] = store->run_rec_gain;
-		line[32] = store->run_tvg_cross;
-		line[33] = store->run_ssv_source;
-		mb_put_binary_short(swap, (unsigned short) store->run_max_swath, (void *) &line[34]);
-		line[36] = store->run_beam_space;
-		line[37] = store->run_swath_angle;
-		line[38] = store->run_stab_mode;
-		for (i=0;i<6;i++)
-		    line[39+i] = store->run_spare[i];
-		line[EM3_RUN_PARAMETER_SIZE-7] = 0x03;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM3_RUN_PARAMETER_SIZE-7;j++)
-		    checksum += uchar_ptr[j];
-
-		/* set checksum */
-		mb_put_binary_short(swap, (unsigned short) checksum, (void *) &line[EM3_RUN_PARAMETER_SIZE-6]);
-
-		/* write out data */
-		write_len = EM3_RUN_PARAMETER_SIZE-4;
-		status = mb_fileio_put(verbose, mbio_ptr, line, &write_len, error);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em710mba_wr_clock(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store, int *error)
-{
-	char	*function_name = "mbr_em710mba_wr_clock";
-	int	status = MB_SUCCESS;
-	char	line[EM3_CLOCK_SIZE];
-	short	label;
-	char	*labelchar;
-	size_t	write_len;
-	int	write_size;
-	unsigned short checksum;
-	mb_u_char   *uchar_ptr;
-	int	j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       clk_date:        %d\n",store->clk_date);
-		fprintf(stderr,"dbg5       clk_msec:        %d\n",store->clk_msec);
-		fprintf(stderr,"dbg5       clk_count:       %d\n",store->clk_count);
-		fprintf(stderr,"dbg5       clk_serial:      %d\n",store->clk_serial);
-		fprintf(stderr,"dbg5       clk_origin_date: %d\n",store->clk_origin_date);
-		fprintf(stderr,"dbg5       clk_origin_msec: %d\n",store->clk_origin_msec);
-		fprintf(stderr,"dbg5       clk_1_pps_use:   %d\n",store->clk_1_pps_use);
-		}
-
-	/* zero checksum */
-	checksum = 0;
-
-	/* write the record size */
-	mb_put_binary_int(swap, (int) (EM3_CLOCK_SIZE), (void *) &write_size);
-	write_len = 4;
-	mb_fileio_put(verbose, mbio_ptr, (char *)&write_size, &write_len, error);
-	if (write_len != 4)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	else
-		status = MB_SUCCESS;
-
-	/* write the record label */
-	if (status == MB_SUCCESS)
-		{
-		labelchar = (char *) &label;
-		labelchar[0] = EM3_START_BYTE;
-		labelchar[1] = EM3_ID_CLOCK;
-		write_len = 2;
-		status = mb_fileio_put(verbose, mbio_ptr, (char *)&label, &write_len, error);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[1];
-		}
-
-	/* write the sonar id */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_short(swap, (short) (store->sonar), (void *) &label);
-		write_len = 2;
-		status = mb_fileio_put(verbose, mbio_ptr, (char *)&label, &write_len, error);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[0];
-		checksum += uchar_ptr[1];
-		}
-
-	/* construct binary data */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_int(swap, (int) store->clk_date, (void *) &line[0]);
-		mb_put_binary_int(swap, (int) store->clk_msec, (void *) &line[4]);
-		mb_put_binary_short(swap, (unsigned short) store->clk_count, (void *) &line[8]);
-		mb_put_binary_short(swap, (unsigned short) store->clk_serial, (void *) &line[10]);
-		mb_put_binary_int(swap, (int) store->clk_origin_date, (void *) &line[12]);
-		mb_put_binary_int(swap, (int) store->clk_origin_msec, (void *) &line[16]);
-		line[20] = store->clk_1_pps_use;
-		line[EM3_CLOCK_SIZE-7] = 0x03;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM3_CLOCK_SIZE-7;j++)
-		    checksum += uchar_ptr[j];
-
-		/* set checksum */
-		mb_put_binary_short(swap, (unsigned short) checksum, (void *) &line[EM3_CLOCK_SIZE-6]);
-
-		/* write out data */
-		write_len = EM3_CLOCK_SIZE-4;
-		status = mb_fileio_put(verbose, mbio_ptr, line, &write_len, error);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em710mba_wr_tide(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store, int *error)
-{
-	char	*function_name = "mbr_em710mba_wr_tide";
-	int	status = MB_SUCCESS;
-	char	line[EM3_TIDE_SIZE];
-	short	label;
-	char	*labelchar;
-	size_t	write_len;
-	int	write_size;
-	unsigned short checksum;
-	mb_u_char   *uchar_ptr;
-	int	j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       tid_date:        %d\n",store->tid_date);
-		fprintf(stderr,"dbg5       tid_msec:        %d\n",store->tid_msec);
-		fprintf(stderr,"dbg5       tid_count:       %d\n",store->tid_count);
-		fprintf(stderr,"dbg5       tid_serial:      %d\n",store->tid_serial);
-		fprintf(stderr,"dbg5       tid_origin_date: %d\n",store->tid_origin_date);
-		fprintf(stderr,"dbg5       tid_origin_msec: %d\n",store->tid_origin_msec);
-		fprintf(stderr,"dbg5       tid_tide:        %d\n",store->tid_tide);
-		}
-
-	/* zero checksum */
-	checksum = 0;
-
-	/* write the record size */
-	mb_put_binary_int(swap, (int) (EM3_TIDE_SIZE), (void *) &write_size);
-	write_len = 4;
-	status = mb_fileio_put(verbose, mbio_ptr, (char *)&write_size, &write_len, error);
-
-	/* write the record label */
-	if (status == MB_SUCCESS)
-		{
-		labelchar = (char *) &label;
-		labelchar[0] = EM3_START_BYTE;
-		labelchar[1] = EM3_ID_TIDE;
-		write_len = 2;
-		status = mb_fileio_put(verbose, mbio_ptr, (char *)&label, &write_len, error);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[1];
-		}
-
-	/* write the sonar id */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_short(swap, (short) (store->sonar), (void *) &label);
-		write_len = 2;
-		status = mb_fileio_put(verbose, mbio_ptr, (char *)&label, &write_len, error);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[0];
-		checksum += uchar_ptr[1];
-		}
-
-	/* construct binary data */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_int(swap, (int) store->tid_date, (void *) &line[0]);
-		mb_put_binary_int(swap, (int) store->tid_msec, (void *) &line[4]);
-		mb_put_binary_short(swap, (unsigned short) store->tid_count, (void *) &line[8]);
-		mb_put_binary_short(swap, (unsigned short) store->tid_serial, (void *) &line[10]);
-		mb_put_binary_int(swap, (int) store->tid_origin_date, (void *) &line[12]);
-		mb_put_binary_int(swap, (int) store->tid_origin_msec, (void *) &line[16]);
-		mb_put_binary_short(swap, (short) store->tid_tide, (void *) &line[20]);
-		line[EM3_TIDE_SIZE-8] = '\0';
-		line[EM3_TIDE_SIZE-7] = 0x03;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM3_TIDE_SIZE-7;j++)
-		    checksum += uchar_ptr[j];
-
-		/* set checksum */
-		mb_put_binary_short(swap, (unsigned short) checksum, (void *) &line[EM3_TIDE_SIZE-6]);
-
-		/* write out data */
-		write_len = EM3_TIDE_SIZE-4;
-		status = mb_fileio_put(verbose, mbio_ptr, line, &write_len, error);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em710mba_wr_height(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store, int *error)
-{
-	char	*function_name = "mbr_em710mba_wr_height";
-	int	status = MB_SUCCESS;
-	char	line[EM3_HEIGHT_SIZE];
-	short	label;
-	char	*labelchar;
-	size_t	write_len;
-	int	write_size;
-	unsigned short checksum;
-	mb_u_char   *uchar_ptr;
-	int	j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       hgt_date:        %d\n",store->hgt_date);
-		fprintf(stderr,"dbg5       hgt_msec:        %d\n",store->hgt_msec);
-		fprintf(stderr,"dbg5       hgt_count:       %d\n",store->hgt_count);
-		fprintf(stderr,"dbg5       hgt_serial:      %d\n",store->hgt_serial);
-		fprintf(stderr,"dbg5       hgt_height:      %d\n",store->hgt_height);
-		fprintf(stderr,"dbg5       hgt_type:        %d\n",store->hgt_type);
-		}
-
-	/* zero checksum */
-	checksum = 0;
-
-	/* write the record size */
-	mb_put_binary_int(swap, (int) (EM3_HEIGHT_SIZE), (void *) &write_size);
-	write_len = 4;
-	mb_fileio_put(verbose, mbio_ptr, (char *)&write_size, &write_len, error);
-	if (write_len != 4)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	else
-		status = MB_SUCCESS;
-
-	/* write the record label */
-	if (status == MB_SUCCESS)
-		{
-		labelchar = (char *) &label;
-		labelchar[0] = EM3_START_BYTE;
-		labelchar[1] = EM3_ID_HEIGHT;
-		write_len = 2;
-		status = mb_fileio_put(verbose, mbio_ptr, (char *)&label, &write_len, error);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[1];
-		}
-
-	/* write the sonar id */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_short(swap, (short) (store->sonar), (void *) &label);
-		write_len = 2;
-		status = mb_fileio_put(verbose, mbio_ptr, (char *)&label, &write_len, error);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[0];
-		checksum += uchar_ptr[1];
-		}
-
-	/* construct binary data */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_int(swap, (int) store->hgt_date, (void *) &line[0]);
-		mb_put_binary_int(swap, (int) store->hgt_msec, (void *) &line[4]);
-		mb_put_binary_short(swap, (unsigned short) store->hgt_count, (void *) &line[8]);
-		mb_put_binary_short(swap, (unsigned short) store->hgt_serial, (void *) &line[10]);
-		mb_put_binary_int(swap, (int) store->hgt_height, (void *) &line[12]);
-		line[16] = (mb_u_char) store->hgt_type;
-		line[EM3_HEIGHT_SIZE-7] = 0x03;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM3_HEIGHT_SIZE-7;j++)
-		    checksum += uchar_ptr[j];
-
-		/* set checksum */
-		mb_put_binary_short(swap, (unsigned short) checksum, (void *) &line[EM3_HEIGHT_SIZE-6]);
-
-		/* write out data */
-		write_len = EM3_HEIGHT_SIZE-4;
-		status = mb_fileio_put(verbose, mbio_ptr, line, &write_len, error);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em710mba_wr_heading(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store, int *error)
-{
-	char	*function_name = "mbr_em710mba_wr_heading";
-	int	status = MB_SUCCESS;
-	struct mbsys_simrad3_heading_struct *heading;
-	char	line[EM3_HEADING_HEADER_SIZE];
-	short	label;
-	char	*labelchar;
-	size_t	write_len;
-	int	write_size;
-	unsigned short checksum;
-	mb_u_char   *uchar_ptr;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		}
-
-	/* get storage structure */
-	heading = (struct mbsys_simrad3_heading_struct *) store->heading;
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       hed_date:        %d\n",heading->hed_date);
-		fprintf(stderr,"dbg5       hed_msec:        %d\n",heading->hed_msec);
-		fprintf(stderr,"dbg5       hed_count:       %d\n",heading->hed_count);
-		fprintf(stderr,"dbg5       hed_serial:      %d\n",heading->hed_serial);
-		fprintf(stderr,"dbg5       hed_ndata:       %d\n",heading->hed_ndata);
-		fprintf(stderr,"dbg5       count    time (msec)    heading (0.01 deg)\n");
-		fprintf(stderr,"dbg5       -----    -----------    ------------------\n");
-		for (i=0;i<heading->hed_ndata;i++)
-			fprintf(stderr,"dbg5        %4d      %7d          %7d\n",
-				i, heading->hed_time[i], heading->hed_heading[i]);
-		fprintf(stderr,"dbg5       hed_heading_status: %d\n",heading->hed_heading_status);
-		}
-
-	/* zero checksum */
-	checksum = 0;
-
-	/* write the record size */
-	mb_put_binary_int(swap, (int) (EM3_HEADING_HEADER_SIZE
-			+ EM3_HEADING_SLICE_SIZE * heading->hed_ndata + 8), (void *) &write_size);
-	write_len = 4;
-	mb_fileio_put(verbose, mbio_ptr, (char *)&write_size, &write_len, error);
-	if (write_len != 4)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	else
-		status = MB_SUCCESS;
-
-	/* write the record label */
-	if (status == MB_SUCCESS)
-		{
-		labelchar = (char *) &label;
-		labelchar[0] = EM3_START_BYTE;
-		labelchar[1] = EM3_ID_HEADING;
-		write_len = 2;
-		status = mb_fileio_put(verbose, mbio_ptr, (char *)&label, &write_len, error);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[1];
-		}
-
-	/* write the sonar id */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_short(swap, (short) (store->sonar), (void *) &label);
-		write_len = 2;
-		status = mb_fileio_put(verbose, mbio_ptr, (char *)&label, &write_len, error);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[0];
-		checksum += uchar_ptr[1];
-		}
-
-	/* output binary header data */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_int(swap, (int) heading->hed_date, (void *) &line[0]);
-		mb_put_binary_int(swap, (int) heading->hed_msec, (void *) &line[4]);
-		mb_put_binary_short(swap, (unsigned short) heading->hed_count, (void *) &line[8]);
-		mb_put_binary_short(swap, (unsigned short) heading->hed_serial, (void *) &line[10]);
-		mb_put_binary_short(swap, (unsigned short) heading->hed_ndata, (void *) &line[12]);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM3_HEADING_HEADER_SIZE;j++)
-		    checksum += uchar_ptr[j];
-
-		/* write out data */
-		write_len = EM3_HEADING_HEADER_SIZE;
-		status = mb_fileio_put(verbose, mbio_ptr, line, &write_len, error);
-		}
-
-	/* output binary heading data */
-	if (status == MB_SUCCESS)
-	    for (i=0;i<heading->hed_ndata;i++)
-		{
-		mb_put_binary_short(swap, (unsigned short) heading->hed_time[i], (void *) &line[0]);
-		mb_put_binary_short(swap, (unsigned short) heading->hed_heading[i], (void *) &line[2]);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM3_HEADING_SLICE_SIZE;j++)
-		    checksum += uchar_ptr[j];
-
-		/* write out data */
-		write_len = EM3_HEADING_SLICE_SIZE;
-		status = mb_fileio_put(verbose, mbio_ptr, line, &write_len, error);
-		}
-
-	/* output end of record */
-	if (status == MB_SUCCESS)
-		{
-		line[0] = (mb_u_char) heading->hed_heading_status;
-		line[1] = 0x03;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		checksum += uchar_ptr[0];
-
-		/* set checksum */
-		mb_put_binary_short(swap, (unsigned short) checksum, (void *) &line[2]);
-
-		/* write out data */
-		write_len = 4;
-		status = mb_fileio_put(verbose, mbio_ptr, line, &write_len, error);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em710mba_wr_ssv(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store, int *error)
-{
-	char	*function_name = "mbr_em710mba_wr_ssv";
-	int	status = MB_SUCCESS;
-	struct mbsys_simrad3_ssv_struct *ssv;
-	char	line[EM3_SSV_HEADER_SIZE];
-	short	label;
-	char	*labelchar;
-	size_t	write_len;
-	int	write_size;
-	unsigned short checksum;
-	mb_u_char   *uchar_ptr;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		}
-
-	/* get storage structure */
-	ssv = (struct mbsys_simrad3_ssv_struct *) store->ssv;
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       ssv_date:        %d\n",ssv->ssv_date);
-		fprintf(stderr,"dbg5       ssv_msec:        %d\n",ssv->ssv_msec);
-		fprintf(stderr,"dbg5       ssv_count:       %d\n",ssv->ssv_count);
-		fprintf(stderr,"dbg5       ssv_serial:      %d\n",ssv->ssv_serial);
-		fprintf(stderr,"dbg5       ssv_ndata:       %d\n",ssv->ssv_ndata);
-		fprintf(stderr,"dbg5       count    time (msec)    ssv (0.1 m/s)\n");
-		fprintf(stderr,"dbg5       -----    -----------    ------------------\n");
-		for (i=0;i<ssv->ssv_ndata;i++)
-			fprintf(stderr,"dbg5        %4d      %7d          %7d\n",
-				i, ssv->ssv_time[i], ssv->ssv_ssv[i]);
-		}
-
-	/* zero checksum */
-	checksum = 0;
-
-	/* write the record size */
-	mb_put_binary_int(swap, (int) (EM3_SSV_HEADER_SIZE
-			+ EM3_SSV_SLICE_SIZE * ssv->ssv_ndata + 8), (void *) &write_size);
-	write_len = 4;
-	mb_fileio_put(verbose, mbio_ptr, (char *)&write_size, &write_len, error);
-	if (write_len != 4)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	else
-		status = MB_SUCCESS;
-
-	/* write the record label */
-	if (status == MB_SUCCESS)
-		{
-		labelchar = (char *) &label;
-		labelchar[0] = EM3_START_BYTE;
-		labelchar[1] = EM3_ID_SSV;
-		write_len = 2;
-		status = mb_fileio_put(verbose, mbio_ptr, (char *)&label, &write_len, error);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[1];
-		}
-
-	/* write the sonar id */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_short(swap, (short) (store->sonar), (void *) &label);
-		write_len = 2;
-		status = mb_fileio_put(verbose, mbio_ptr, (char *)&label, &write_len, error);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[0];
-		checksum += uchar_ptr[1];
-		}
-
-	/* output binary header data */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_int(swap, (int) ssv->ssv_date, (void *) &line[0]);
-		mb_put_binary_int(swap, (int) ssv->ssv_msec, (void *) &line[4]);
-		mb_put_binary_short(swap, (unsigned short) ssv->ssv_count, (void *) &line[8]);
-		mb_put_binary_short(swap, (unsigned short) ssv->ssv_serial, (void *) &line[10]);
-		mb_put_binary_short(swap, (unsigned short) ssv->ssv_ndata, (void *) &line[12]);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM3_SSV_HEADER_SIZE;j++)
-		    checksum += uchar_ptr[j];
-
-		/* write out data */
-		write_len = EM3_SSV_HEADER_SIZE;
-		status = mb_fileio_put(verbose, mbio_ptr, line, &write_len, error);
-		}
-
-	/* output binary ssv data */
-	if (status == MB_SUCCESS)
-	    for (i=0;i<ssv->ssv_ndata;i++)
-		{
-		mb_put_binary_short(swap, (unsigned short) ssv->ssv_time[i], (void *) &line[0]);
-		mb_put_binary_short(swap, (unsigned short) ssv->ssv_ssv[i], (void *) &line[2]);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM3_SSV_SLICE_SIZE;j++)
-		    checksum += uchar_ptr[j];
-
-		/* write out data */
-		write_len = EM3_SSV_SLICE_SIZE;
-		status = mb_fileio_put(verbose, mbio_ptr, line, &write_len, error);
-		}
-
-	/* output end of record */
-	if (status == MB_SUCCESS)
-		{
-		line[0] = 0;
-		line[1] = 0x03;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		checksum += uchar_ptr[0];
-
-		/* set checksum */
-		mb_put_binary_short(swap, (unsigned short) checksum, (void *) &line[2]);
-
-		/* write out data */
-		write_len = 4;
-		status = mb_fileio_put(verbose, mbio_ptr, line, &write_len, error);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em710mba_wr_tilt(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store, int *error)
-{
-	char	*function_name = "mbr_em710mba_wr_tilt";
-	int	status = MB_SUCCESS;
-	struct mbsys_simrad3_tilt_struct *tilt;
-	char	line[EM3_TILT_HEADER_SIZE];
-	short	label;
-	char	*labelchar;
-	size_t	write_len;
-	int	write_size;
-	unsigned short checksum;
-	mb_u_char   *uchar_ptr;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		}
-
-	/* get storage structure */
-	tilt = (struct mbsys_simrad3_tilt_struct *) store->tilt;
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       tlt_date:        %d\n",tilt->tlt_date);
-		fprintf(stderr,"dbg5       tlt_msec:        %d\n",tilt->tlt_msec);
-		fprintf(stderr,"dbg5       tlt_count:       %d\n",tilt->tlt_count);
-		fprintf(stderr,"dbg5       tlt_serial:      %d\n",tilt->tlt_serial);
-		fprintf(stderr,"dbg5       tlt_ndata:       %d\n",tilt->tlt_ndata);
-		fprintf(stderr,"dbg5       count    time (msec)    tilt (0.01 deg)\n");
-		fprintf(stderr,"dbg5       -----    -----------    ------------------\n");
-		for (i=0;i<tilt->tlt_ndata;i++)
-			fprintf(stderr,"dbg5        %4d      %7d          %7d\n",
-				i, tilt->tlt_time[i], tilt->tlt_tilt[i]);
-		}
-
-	/* zero checksum */
-	checksum = 0;
-
-	/* write the record size */
-	mb_put_binary_int(swap, (int) (EM3_TILT_HEADER_SIZE
-			+ EM3_TILT_SLICE_SIZE * tilt->tlt_ndata + 8), (void *) &write_size);
-	write_len = 4;
-	mb_fileio_put(verbose, mbio_ptr, (char *)&write_size, &write_len, error);
-	if (write_len != 4)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	else
-		status = MB_SUCCESS;
-
-	/* write the record label */
-	if (status == MB_SUCCESS)
-		{
-		labelchar = (char *) &label;
-		labelchar[0] = EM3_START_BYTE;
-		labelchar[1] = EM3_ID_TILT;
-		write_len = 2;
-		status = mb_fileio_put(verbose, mbio_ptr, (char *)&label, &write_len, error);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[1];
-		}
-
-	/* write the sonar id */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_short(swap, (short) (store->sonar), (void *) &label);
-		write_len = 2;
-		status = mb_fileio_put(verbose, mbio_ptr, (char *)&label, &write_len, error);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[0];
-		checksum += uchar_ptr[1];
-		}
-
-	/* output binary header data */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_int(swap, (int) tilt->tlt_date, (void *) &line[0]);
-		mb_put_binary_int(swap, (int) tilt->tlt_msec, (void *) &line[4]);
-		mb_put_binary_short(swap, (unsigned short) tilt->tlt_count, (void *) &line[8]);
-		mb_put_binary_short(swap, (unsigned short) tilt->tlt_serial, (void *) &line[10]);
-		mb_put_binary_short(swap, (unsigned short) tilt->tlt_ndata, (void *) &line[12]);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM3_TILT_HEADER_SIZE;j++)
-		    checksum += uchar_ptr[j];
-
-		/* write out data */
-		write_len = EM3_TILT_HEADER_SIZE;
-		status = mb_fileio_put(verbose, mbio_ptr, line, &write_len, error);
-		}
-
-	/* output binary tilt data */
-	if (status == MB_SUCCESS)
-	    for (i=0;i<tilt->tlt_ndata;i++)
-		{
-		mb_put_binary_short(swap, (unsigned short) tilt->tlt_time[i], (void *) &line[0]);
-		mb_put_binary_short(swap, (unsigned short) tilt->tlt_tilt[i], (void *) &line[2]);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM3_TILT_SLICE_SIZE;j++)
-		    checksum += uchar_ptr[j];
-
-		/* write out data */
-		write_len = EM3_TILT_SLICE_SIZE;
-		status = mb_fileio_put(verbose, mbio_ptr, line, &write_len, error);
-		}
-
-	/* output end of record */
-	if (status == MB_SUCCESS)
-		{
-		line[0] = 0;
-		line[1] = 0x03;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		checksum += uchar_ptr[0];
-
-		/* set checksum */
-		mb_put_binary_short(swap, (unsigned short) checksum, (void *) &line[2]);
-
-		/* write out data */
-		write_len = 4;
-		status = mb_fileio_put(verbose, mbio_ptr, line, &write_len, error);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em710mba_wr_extraparameters(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store, int *error)
-{
-	char	*function_name = "mbr_em710mba_wr_extraparameters";
-	int	status = MB_SUCCESS;
-	struct mbsys_simrad3_extraparameters_struct *extraparameters;
-	char	line[EM3_EXTRAPARAMETERS_HEADER_SIZE];
-	short	label;
-	char	*labelchar;
-	size_t	write_len;
-	int	write_size;
-	unsigned short checksum;
-	mb_u_char   *uchar_ptr;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		}
-
-	/* get storage structure */
-	extraparameters = (struct mbsys_simrad3_extraparameters_struct *) store->extraparameters;
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       xtr_date:        %d\n",extraparameters->xtr_date);
-		fprintf(stderr,"dbg5       xtr_msec:        %d\n",extraparameters->xtr_msec);
-		fprintf(stderr,"dbg5       xtr_count:       %d\n",extraparameters->xtr_count);
-		fprintf(stderr,"dbg5       xtr_serial:      %d\n",extraparameters->xtr_serial);
-		fprintf(stderr,"dbg5       xtr_id:          %d\n",extraparameters->xtr_id);
-		fprintf(stderr,"dbg5       xtr_data_size:   %d\n",extraparameters->xtr_data_size);
-		fprintf(stderr,"dbg5       xtr_nalloc:      %d\n",extraparameters->xtr_nalloc);
-		if (extraparameters->xtr_id == 2)
-			{
-			fprintf(stderr,"dbg5       xtr_pqf_activepositioning:          %d\n",extraparameters->xtr_pqf_activepositioning);
-			for (i=0;i<3;i++)
-				{
-				fprintf(stderr,"dbg5       positioning system:%d qfsetting:%d nqf:%d\n",
-					i,extraparameters->xtr_pqf_qfsetting[i],extraparameters->xtr_pqf_nqualityfactors[i]);
-				for (j=0;j<extraparameters->xtr_pqf_nqualityfactors[i];j++)
-				fprintf(stderr,"dbg5       quality factor:%d value:%d limit:%d\n",
-					j,extraparameters->xtr_pqf_qfvalues[i][j],extraparameters->xtr_pqf_qflimits[i][j]);
-				}
-			}
-		}
-
-	/* zero checksum */
-	checksum = 0;
-
-	/* write the record size */
-	mb_put_binary_int(swap, (int) (EM3_EXTRAPARAMETERS_HEADER_SIZE
-			+ extraparameters->xtr_data_size + 8), (void *) &write_size);
-	write_len = 4;
-	mb_fileio_put(verbose, mbio_ptr, (char *)&write_size, &write_len, error);
-	if (write_len != 4)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	else
-		status = MB_SUCCESS;
-
-	/* write the record label */
-	if (status == MB_SUCCESS)
-		{
-		labelchar = (char *) &label;
-		labelchar[0] = EM3_START_BYTE;
-		labelchar[1] = EM3_ID_EXTRAPARAMETERS;
-		write_len = 2;
-		status = mb_fileio_put(verbose, mbio_ptr, (char *)&label, &write_len, error);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[1];
-		}
-
-	/* write the sonar id */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_short(swap, (short) (store->sonar), (void *) &label);
-		write_len = 2;
-		status = mb_fileio_put(verbose, mbio_ptr, (char *)&label, &write_len, error);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[0];
-		checksum += uchar_ptr[1];
-		}
-
-	/* output binary header data */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_int(swap, (int) extraparameters->xtr_date, (void *) &line[0]);
-		mb_put_binary_int(swap, (int) extraparameters->xtr_msec, (void *) &line[4]);
-		mb_put_binary_short(swap, (unsigned short) extraparameters->xtr_count, (void *) &line[8]);
-		mb_put_binary_short(swap, (unsigned short) extraparameters->xtr_serial, (void *) &line[10]);
-		mb_put_binary_short(swap, (unsigned short) extraparameters->xtr_id, (void *) &line[12]);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM3_EXTRAPARAMETERS_HEADER_SIZE;j++)
-		    checksum += uchar_ptr[j];
-
-		/* write out data */
-		write_len = EM3_EXTRAPARAMETERS_HEADER_SIZE;
-		status = mb_fileio_put(verbose, mbio_ptr, line, &write_len, error);
-		}
-
-	/* output binary extraparameters data */
-	if (status == MB_SUCCESS)
-		{
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) extraparameters->xtr_data;
-		for (j=0;j<extraparameters->xtr_data_size;j++)
-		    checksum += uchar_ptr[j];
-
-		/* write out data */
-		write_len = extraparameters->xtr_data_size;
-		status = mb_fileio_put(verbose, mbio_ptr, extraparameters->xtr_data, &write_len, error);
-		}
-
-	/* output end of record */
-	if (status == MB_SUCCESS)
-		{
-		line[0] = 0;
-		line[1] = 0x03;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		checksum += uchar_ptr[0];
-
-		/* set checksum */
-		mb_put_binary_short(swap, (unsigned short) checksum, (void *) &line[2]);
-
-		/* write out data */
-		write_len = 4;
-		status = mb_fileio_put(verbose, mbio_ptr, line, &write_len, error);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em710mba_wr_attitude(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store, int *error)
-{
-	char	*function_name = "mbr_em710mba_wr_attitude";
-	int	status = MB_SUCCESS;
-	struct mbsys_simrad3_attitude_struct *attitude;
-	char	line[EM3_ATTITUDE_HEADER_SIZE];
-	short	label;
-	char	*labelchar;
-	size_t	write_len;
-	int	write_size;
-	unsigned short checksum;
-	mb_u_char   *uchar_ptr;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		}
-
-	/* get storage structure */
-	attitude = (struct mbsys_simrad3_attitude_struct *) store->attitude;
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       att_date:        %d\n",attitude->att_date);
-		fprintf(stderr,"dbg5       att_msec:        %d\n",attitude->att_msec);
-		fprintf(stderr,"dbg5       att_count:       %d\n",attitude->att_count);
-		fprintf(stderr,"dbg5       att_serial:      %d\n",attitude->att_serial);
-		fprintf(stderr,"dbg5       att_ndata:       %d\n",attitude->att_ndata);
-		fprintf(stderr,"dbg5       cnt   time   roll pitch heave heading\n");
-		fprintf(stderr,"dbg5       -------------------------------------\n");
-		for (i=0;i<attitude->att_ndata;i++)
-			fprintf(stderr,"dbg5        %3d  %d  %d %d %d %d\n",
-				i, attitude->att_time[i], attitude->att_roll[i],
-				attitude->att_pitch[i], attitude->att_heave[i],
-				attitude->att_heading[i]);
-		fprintf(stderr,"dbg5       att_sensordescriptor: %d\n",attitude->att_sensordescriptor);
-		}
-
-	/* zero checksum */
-	checksum = 0;
-
-	/* write the record size */
-	mb_put_binary_int(swap, (int) (EM3_ATTITUDE_HEADER_SIZE
-			+ EM3_ATTITUDE_SLICE_SIZE * attitude->att_ndata + 8), (void *) &write_size);
-	write_len = 4;
-	mb_fileio_put(verbose, mbio_ptr, (char *)&write_size, &write_len, error);
-	if (write_len != 4)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	else
-		status = MB_SUCCESS;
-
-	/* write the record label */
-	if (status == MB_SUCCESS)
-		{
-		labelchar = (char *) &label;
-		labelchar[0] = EM3_START_BYTE;
-		labelchar[1] = EM3_ID_ATTITUDE;
-		write_len = 2;
-		status = mb_fileio_put(verbose, mbio_ptr, (char *)&label, &write_len, error);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[1];
-		}
-
-	/* write the sonar id */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_short(swap, (short) (store->sonar), (void *) &label);
-		write_len = 2;
-		status = mb_fileio_put(verbose, mbio_ptr, (char *)&label, &write_len, error);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[0];
-		checksum += uchar_ptr[1];
-		}
-
-	/* output binary header data */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_int(swap, (int) attitude->att_date, (void *) &line[0]);
-		mb_put_binary_int(swap, (int) attitude->att_msec, (void *) &line[4]);
-		mb_put_binary_short(swap, (unsigned short) attitude->att_count, (void *) &line[8]);
-		mb_put_binary_short(swap, (unsigned short) attitude->att_serial, (void *) &line[10]);
-		mb_put_binary_short(swap, (unsigned short) attitude->att_ndata, (void *) &line[12]);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM3_ATTITUDE_HEADER_SIZE;j++)
-		    checksum += uchar_ptr[j];
-
-		/* write out data */
-		write_len = EM3_ATTITUDE_HEADER_SIZE;
-		status = mb_fileio_put(verbose, mbio_ptr, line, &write_len, error);
-		}
-
-	/* output binary heading data */
-	if (status == MB_SUCCESS)
-	    for (i=0;i<attitude->att_ndata;i++)
-		{
-		mb_put_binary_short(swap, (unsigned short) attitude->att_time[i], (void *) &line[0]);
-		mb_put_binary_short(swap, (unsigned short) attitude->att_sensor_status[i], (void *) &line[2]);
-		mb_put_binary_short(swap, (short) attitude->att_roll[i], (void *) &line[4]);
-		mb_put_binary_short(swap, (short) attitude->att_pitch[i], (void *) &line[6]);
-		mb_put_binary_short(swap, (short) attitude->att_heave[i], (void *) &line[8]);
-		mb_put_binary_short(swap, (unsigned short) attitude->att_heading[i], (void *) &line[10]);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM3_ATTITUDE_SLICE_SIZE;j++)
-		    checksum += uchar_ptr[j];
-
-		/* write out data */
-		write_len = EM3_ATTITUDE_SLICE_SIZE;
-		status = mb_fileio_put(verbose, mbio_ptr, line, &write_len, error);
-		}
-
-	/* output end of record */
-	if (status == MB_SUCCESS)
-		{
-		line[0] = (mb_u_char) attitude->att_sensordescriptor;
-		line[1] = 0x03;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		checksum += uchar_ptr[0];
-
-		/* set checksum */
-		mb_put_binary_short(swap, (unsigned short) checksum, (void *) &line[2]);
-
-		/* write out data */
-		write_len = 4;
-		status = mb_fileio_put(verbose, mbio_ptr, line, &write_len, error);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em710mba_wr_netattitude(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store, int *error)
-{
-	char	*function_name = "mbr_em710mba_wr_netattitude";
-	int	status = MB_SUCCESS;
-	struct mbsys_simrad3_netattitude_struct *netattitude;
-	char	line[EM3_NETATTITUDE_SLICE_SIZE+MBSYS_SIMRAD3_BUFFER_SIZE];
-	short	label;
-	char	*labelchar;
-	size_t	write_len;
-	int	write_size;
-	int	extrabyte;
-	unsigned short checksum;
-	mb_u_char   *uchar_ptr;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		}
-
-	/* get storage structure */
-	netattitude = (struct mbsys_simrad3_netattitude_struct *) store->netattitude;
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:                 %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:                %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:                 %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:                 %d\n",store->msec);
-		fprintf(stderr,"dbg5       nat_date:             %d\n",netattitude->nat_date);
-		fprintf(stderr,"dbg5       nat_msec:             %d\n",netattitude->nat_msec);
-		fprintf(stderr,"dbg5       nat_count:            %d\n",netattitude->nat_count);
-		fprintf(stderr,"dbg5       nat_serial:           %d\n",netattitude->nat_serial);
-		fprintf(stderr,"dbg5       nat_ndata:            %d\n",netattitude->nat_ndata);
-		fprintf(stderr,"dbg5       nat_sensordescriptor: %d\n",netattitude->nat_sensordescriptor);
-		fprintf(stderr,"dbg5       cnt   time   roll pitch heave heading\n");
-		fprintf(stderr,"dbg5       -------------------------------------\n");
-		for (i=0;i<netattitude->nat_ndata;i++)
-			{
-			fprintf(stderr,"dbg5        %3d  %d  %d %d %d %d %d\n",
-				i, netattitude->nat_time[i], netattitude->nat_roll[i],
-				netattitude->nat_pitch[i], netattitude->nat_heave[i],
-				netattitude->nat_heading[i],netattitude->nat_nbyte_raw[i]);
-			fprintf(stderr,"dbg5        nat_raw[%d]: ",netattitude->nat_nbyte_raw[i]);
-			for (j=0;j<netattitude->nat_nbyte_raw[i];j++)
-				fprintf(stderr,"%x",netattitude->nat_raw[i*MBSYS_SIMRAD3_BUFFER_SIZE+j]);
-			fprintf(stderr,"\n");
-			}
-		}
-
-	/* zero checksum */
-	checksum = 0;
-
-	/* write the record size */
-	write_size = EM3_NETATTITUDE_HEADER_SIZE + 8;
-	for (i=0;i<netattitude->nat_ndata;i++)
-		{
-		write_size += EM3_NETATTITUDE_SLICE_SIZE + netattitude->nat_nbyte_raw[i];
-		}
-	extrabyte = 0;
-	if (write_size%2)
-		{
-		extrabyte++;
-		write_size--;
-		}
-	mb_put_binary_int(swap, (int)write_size, (void *) line);
-	write_len = 4;
-	status = mb_fileio_put(verbose, mbio_ptr, line, &write_len, error);
-
-	/* write the record label */
-	if (status == MB_SUCCESS)
-		{
-		labelchar = (char *) &label;
-		labelchar[0] = EM3_START_BYTE;
-		labelchar[1] = EM3_ID_NETATTITUDE;
-		write_len = 2;
-		status = mb_fileio_put(verbose, mbio_ptr, (char *)&label, &write_len, error);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[1];
-		}
-
-	/* write the sonar id */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_short(swap, (short) (store->sonar), (void *) &label);
-		write_len = 2;
-		status = mb_fileio_put(verbose, mbio_ptr, (char *)&label, &write_len, error);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[0];
-		checksum += uchar_ptr[1];
-		}
-
-	/* output binary header data */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_int(swap, (int) netattitude->nat_date, (void *) &line[0]);
-		mb_put_binary_int(swap, (int) netattitude->nat_msec, (void *) &line[4]);
-		mb_put_binary_short(swap, (unsigned short) netattitude->nat_count, (void *) &line[8]);
-		mb_put_binary_short(swap, (unsigned short) netattitude->nat_serial, (void *) &line[10]);
-		mb_put_binary_short(swap, (unsigned short) netattitude->nat_ndata, (void *) &line[12]);
-		line[14] = (mb_u_char) netattitude->nat_sensordescriptor;
-		line[15] = (mb_u_char) 0;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM3_NETATTITUDE_HEADER_SIZE;j++)
-		    checksum += uchar_ptr[j];
-
-		/* write out data */
-		write_len = EM3_NETATTITUDE_HEADER_SIZE;
-		status = mb_fileio_put(verbose, mbio_ptr, line, &write_len, error);
-		}
-
-	/* output binary attitude data */
-	if (status == MB_SUCCESS)
-	    for (i=0;i<netattitude->nat_ndata;i++)
-		{
-		mb_put_binary_short(swap, (unsigned short) netattitude->nat_time[i], (void *) &line[0]);
-		mb_put_binary_short(swap, (short) netattitude->nat_roll[i], (void *) &line[2]);
-		mb_put_binary_short(swap, (short) netattitude->nat_pitch[i], (void *) &line[4]);
-		mb_put_binary_short(swap, (short) netattitude->nat_heave[i], (void *) &line[6]);
-		mb_put_binary_short(swap, (unsigned short) netattitude->nat_heading[i], (void *) &line[8]);
-		line[10] = (mb_u_char) netattitude->nat_nbyte_raw[i];
-		for (j=0;j<netattitude->nat_nbyte_raw[i];j++)
-			line[j+11] = netattitude->nat_raw[i*MBSYS_SIMRAD3_BUFFER_SIZE+j];
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM3_NETATTITUDE_SLICE_SIZE+netattitude->nat_nbyte_raw[i];j++)
-		    checksum += uchar_ptr[j];
-
-		/* write out data */
-		write_len = EM3_NETATTITUDE_SLICE_SIZE+netattitude->nat_nbyte_raw[i];
-		status = mb_fileio_put(verbose, mbio_ptr, line, &write_len, error);
-		}
-
-	/* output end of record */
-	if (status == MB_SUCCESS)
-		{
-		line[0] = 0;
-		line[1] = 0x03;
-
-		/* set checksum */
-		mb_put_binary_short(swap, (unsigned short) checksum, (void *) &line[2]);
-
-		/* write out data */
-		if (extrabyte)
-			{
-			write_len = 3;
-			status = mb_fileio_put(verbose, mbio_ptr, &line[1], &write_len, error);
-			}
-		else
-			{
-			write_len = 4;
-			status = mb_fileio_put(verbose, mbio_ptr, line, &write_len, error);
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em710mba_wr_pos(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store, int *error)
-{
-	char	*function_name = "mbr_em710mba_wr_pos";
-	int	status = MB_SUCCESS;
-	char	line[EM3_POS_HEADER_SIZE];
-	short	label;
-	char	*labelchar;
-	size_t	write_len;
-	int	write_size;
-	unsigned short checksum;
-	mb_u_char   *uchar_ptr;
-	int	j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       pos_date:        %d\n",store->pos_date);
-		fprintf(stderr,"dbg5       pos_msec:        %d\n",store->pos_msec);
-		fprintf(stderr,"dbg5       pos_count:       %d\n",store->pos_count);
-		fprintf(stderr,"dbg5       pos_serial:      %d\n",store->pos_serial);
-		fprintf(stderr,"dbg5       pos_latitude:    %d\n",store->pos_latitude);
-		fprintf(stderr,"dbg5       pos_longitude:   %d\n",store->pos_longitude);
-		fprintf(stderr,"dbg5       pos_quality:     %d\n",store->pos_quality);
-		fprintf(stderr,"dbg5       pos_speed:       %d\n",store->pos_speed);
-		fprintf(stderr,"dbg5       pos_course:      %d\n",store->pos_course);
-		fprintf(stderr,"dbg5       pos_heading:     %d\n",store->pos_heading);
-		fprintf(stderr,"dbg5       pos_system:      %d\n",store->pos_system);
-		fprintf(stderr,"dbg5       pos_input_size:  %d\n",store->pos_input_size);
-		fprintf(stderr,"dbg5       pos_input:\ndbg5            %s\n",store->pos_input);
-		}
-
-	/* zero checksum */
-	checksum = 0;
-
-	/* write the record size */
-	mb_put_binary_int(swap, (int) (EM3_POS_HEADER_SIZE
-			+ store->pos_input_size
-			- (store->pos_input_size % 2) + 8), (void *) &write_size);
-	write_len = 4;
-	mb_fileio_put(verbose, mbio_ptr, (char *)&write_size, &write_len, error);
-	if (write_len != 4)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	else
-		status = MB_SUCCESS;
-
-	/* write the record label */
-	if (status == MB_SUCCESS)
-		{
-		labelchar = (char *) &label;
-		labelchar[0] = EM3_START_BYTE;
-		labelchar[1] = EM3_ID_POS;
-		write_len = 2;
-		status = mb_fileio_put(verbose, mbio_ptr, (char *)&label, &write_len, error);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[1];
-		}
-
-	/* write the sonar id */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_short(swap, (short) (store->sonar), (void *) &label);
-		write_len = 2;
-		status = mb_fileio_put(verbose, mbio_ptr, (char *)&label, &write_len, error);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[0];
-		checksum += uchar_ptr[1];
-		}
-
-	/* output binary header data */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_int(swap, (int) store->pos_date, (void *) &line[0]);
-		mb_put_binary_int(swap, (int) store->pos_msec, (void *) &line[4]);
-		mb_put_binary_short(swap, (unsigned short) store->pos_count, (void *) &line[8]);
-		mb_put_binary_short(swap, (unsigned short) store->pos_serial, (void *) &line[10]);
-		mb_put_binary_int(swap, (int) store->pos_latitude, (void *) &line[12]);
-		mb_put_binary_int(swap, (int) store->pos_longitude, (void *) &line[16]);
-		mb_put_binary_short(swap, (unsigned short) store->pos_quality, (void *) &line[20]);
-		mb_put_binary_short(swap, (unsigned short) store->pos_speed, (void *) &line[22]);
-		mb_put_binary_short(swap, (unsigned short) store->pos_course, (void *) &line[24]);
-		mb_put_binary_short(swap, (unsigned short) store->pos_heading, (void *) &line[26]);
-		line[28] = (mb_u_char) store->pos_system;
-		line[29] = (mb_u_char) store->pos_input_size;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM3_POS_HEADER_SIZE;j++)
-		    checksum += uchar_ptr[j];
-
-		/* write out data */
-		write_len = EM3_POS_HEADER_SIZE;
-		status = mb_fileio_put(verbose, mbio_ptr, line, &write_len, error);
-		}
-
-	/* output original ascii nav data */
-	if (status == MB_SUCCESS)
-		{
-		write_size = store->pos_input_size
-				- (store->pos_input_size % 2) + 1;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) store->pos_input;
-		for (j=0;j<write_size;j++)
-		    checksum += uchar_ptr[j];
-
-		/* write out data */
-		write_len = write_size;
-		status = mb_fileio_put(verbose, mbio_ptr, store->pos_input, &write_len, error);
-		}
-
-	/* output end of record */
-	if (status == MB_SUCCESS)
-		{
-		line[1] = 0x03;
-
-		/* set checksum */
-		mb_put_binary_short(swap, (unsigned short) checksum, (void *) &line[2]);
-
-		/* write out data */
-		write_len = 3;
-		status = mb_fileio_put(verbose, mbio_ptr, &line[1], &write_len, error);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em710mba_wr_svp(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store, int *error)
-{
-	char	*function_name = "mbr_em710mba_wr_svp";
-	int	status = MB_SUCCESS;
-	char	line[EM3_SVP_HEADER_SIZE];
-	short	label;
-	char	*labelchar;
-	size_t	write_len;
-	int	write_size;
-	unsigned short checksum;
-	mb_u_char   *uchar_ptr;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       svp_use_date:    %d\n",store->svp_use_date);
-		fprintf(stderr,"dbg5       svp_use_msec:    %d\n",store->svp_use_msec);
-		fprintf(stderr,"dbg5       svp_count:       %d\n",store->svp_count);
-		fprintf(stderr,"dbg5       svp_serial:      %d\n",store->svp_serial);
-		fprintf(stderr,"dbg5       svp_origin_date: %d\n",store->svp_origin_date);
-		fprintf(stderr,"dbg5       svp_origin_msec: %d\n",store->svp_origin_msec);
-		fprintf(stderr,"dbg5       svp_num:         %d\n",store->svp_num);
-		fprintf(stderr,"dbg5       svp_depth_res:   %d\n",store->svp_depth_res);
-		fprintf(stderr,"dbg5       count    depth    speed\n");
-		fprintf(stderr,"dbg5       -----------------------\n");
-		for (i=0;i<store->svp_num;i++)
-			fprintf(stderr,"dbg5        %d   %d  %d\n",
-				i, store->svp_depth[i], store->svp_vel[i]);
-		}
-
-	/* zero checksum */
-	checksum = 0;
-
-	/* write the record size */
-	mb_put_binary_int(swap, (int) (EM3_SVP_HEADER_SIZE
-			+ EM3_SVP_SLICE_SIZE * store->svp_num + 8), (void *) &write_size);
-	write_len = 4;
-	mb_fileio_put(verbose, mbio_ptr, (char *)&write_size, &write_len, error);
-	if (write_len != 4)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	else
-		status = MB_SUCCESS;
-
-	/* write the record label */
-	if (status == MB_SUCCESS)
-		{
-		labelchar = (char *) &label;
-		labelchar[0] = EM3_START_BYTE;
-		labelchar[1] = EM3_ID_SVP;
-		write_len = 2;
-		status = mb_fileio_put(verbose, mbio_ptr, (char *)&label, &write_len, error);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[1];
-		}
-
-	/* write the sonar id */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_short(swap, (short) (store->sonar), (void *) &label);
-		write_len = 2;
-		status = mb_fileio_put(verbose, mbio_ptr, (char *)&label, &write_len, error);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[0];
-		checksum += uchar_ptr[1];
-		}
-
-	/* output binary header data */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_int(swap, (int) store->svp_use_date, (void *) &line[0]);
-		mb_put_binary_int(swap, (int) store->svp_use_msec, (void *) &line[4]);
-		mb_put_binary_short(swap, (unsigned short) store->svp_count, (void *) &line[8]);
-		mb_put_binary_short(swap, (unsigned short) store->svp_serial, (void *) &line[10]);
-		mb_put_binary_int(swap, (int) store->svp_origin_date, (void *) &line[12]);
-		mb_put_binary_int(swap, (int) store->svp_origin_msec, (void *) &line[16]);
-		mb_put_binary_short(swap, (unsigned short) store->svp_num, (void *) &line[20]);
-		mb_put_binary_short(swap, (unsigned short) store->svp_depth_res, (void *) &line[22]);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM3_SVP_HEADER_SIZE;j++)
-		    checksum += uchar_ptr[j];
-
-		/* write out data */
-		write_len = EM3_SVP_HEADER_SIZE;
-		status = mb_fileio_put(verbose, mbio_ptr, line, &write_len, error);
-		}
-
-	/* output binary svp data */
-	if (status == MB_SUCCESS)
-	    for (i=0;i<store->svp_num;i++)
-		{
-		mb_put_binary_short(swap, (unsigned short) store->svp_depth[i], (void *) &line[0]);
-		mb_put_binary_short(swap, (unsigned short) store->svp_vel[i], (void *) &line[4]);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM3_SVP_SLICE_SIZE;j++)
-		    checksum += uchar_ptr[j];
-
-		/* write out data */
-		write_len = EM3_SVP_SLICE_SIZE;
-		status = mb_fileio_put(verbose, mbio_ptr, line, &write_len, error);
-		}
-
-	/* output end of record */
-	if (status == MB_SUCCESS)
-		{
-		line[0] = '\0';
-		line[1] = 0x03;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		checksum += uchar_ptr[0];
-
-		/* set checksum */
-		mb_put_binary_short(swap, (unsigned short) checksum, (void *) &line[2]);
-
-		/* write out data */
-		write_len = 4;
-		status = mb_fileio_put(verbose, mbio_ptr, line, &write_len, error);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em710mba_wr_svp2(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store, int *error)
-{
-	char	*function_name = "mbr_em710mba_wr_svp2";
-	int	status = MB_SUCCESS;
-	char	line[EM3_SVP2_HEADER_SIZE];
-	short	label;
-	char	*labelchar;
-	size_t	write_len;
-	int	write_size;
-	unsigned short checksum;
-	mb_u_char   *uchar_ptr;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       svp_use_date:    %d\n",store->svp_use_date);
-		fprintf(stderr,"dbg5       svp_use_msec:    %d\n",store->svp_use_msec);
-		fprintf(stderr,"dbg5       svp_count:       %d\n",store->svp_count);
-		fprintf(stderr,"dbg5       svp_serial:      %d\n",store->svp_serial);
-		fprintf(stderr,"dbg5       svp_origin_date: %d\n",store->svp_origin_date);
-		fprintf(stderr,"dbg5       svp_origin_msec: %d\n",store->svp_origin_msec);
-		fprintf(stderr,"dbg5       svp_num:         %d\n",store->svp_num);
-		fprintf(stderr,"dbg5       svp_depth_res:   %d\n",store->svp_depth_res);
-		fprintf(stderr,"dbg5       count    depth    speed\n");
-		fprintf(stderr,"dbg5       -----------------------\n");
-		for (i=0;i<store->svp_num;i++)
-			fprintf(stderr,"dbg5        %d   %d  %d\n",
-				i, store->svp_depth[i], store->svp_vel[i]);
-		}
-
-	/* zero checksum */
-	checksum = 0;
-
-	/* write the record size */
-	mb_put_binary_int(swap, (int) (EM3_SVP2_HEADER_SIZE
-			+ EM3_SVP2_SLICE_SIZE * store->svp_num + 8), (void *) &write_size);
-	write_len = 4;
-	mb_fileio_put(verbose, mbio_ptr, (char *)&write_size, &write_len, error);
-	if (write_len != 4)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	else
-		status = MB_SUCCESS;
-
-	/* write the record label */
-	if (status == MB_SUCCESS)
-		{
-		labelchar = (char *) &label;
-		labelchar[0] = EM3_START_BYTE;
-		labelchar[1] = EM3_ID_SVP2;
-		write_len = 2;
-		status = mb_fileio_put(verbose, mbio_ptr, (char *)&label, &write_len, error);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[1];
-		}
-
-	/* write the sonar id */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_short(swap, (short) (store->sonar), (void *) &label);
-		write_len = 2;
-		status = mb_fileio_put(verbose, mbio_ptr, (char *)&label, &write_len, error);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[0];
-		checksum += uchar_ptr[1];
-		}
-
-	/* output binary header data */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_int(swap, (int) store->svp_use_date, (void *) &line[0]);
-		mb_put_binary_int(swap, (int) store->svp_use_msec, (void *) &line[4]);
-		mb_put_binary_short(swap, (unsigned short) store->svp_count, (void *) &line[8]);
-		mb_put_binary_short(swap, (unsigned short) store->svp_serial, (void *) &line[10]);
-		mb_put_binary_int(swap, (int) store->svp_origin_date, (void *) &line[12]);
-		mb_put_binary_int(swap, (int) store->svp_origin_msec, (void *) &line[16]);
-		mb_put_binary_short(swap, (unsigned short) store->svp_num, (void *) &line[20]);
-		mb_put_binary_short(swap, (unsigned short) store->svp_depth_res, (void *) &line[22]);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM3_SVP2_HEADER_SIZE;j++)
-		    checksum += uchar_ptr[j];
-
-		/* write out data */
-		write_len = EM3_SVP2_HEADER_SIZE;
-		status = mb_fileio_put(verbose, mbio_ptr, line, &write_len, error);
-		}
-
-	/* output binary svp data */
-	if (status == MB_SUCCESS)
-	    for (i=0;i<store->svp_num;i++)
-		{
-		mb_put_binary_int(swap, (int) store->svp_depth[i], (void *) &line[0]);
-		mb_put_binary_int(swap, (int) store->svp_vel[i], (void *) &line[4]);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM3_SVP2_SLICE_SIZE;j++)
-		    checksum += uchar_ptr[j];
-
-		/* write out data */
-		write_len = EM3_SVP2_SLICE_SIZE;
-		status = mb_fileio_put(verbose, mbio_ptr, line, &write_len, error);
-		}
-
-	/* output end of record */
-	if (status == MB_SUCCESS)
-		{
-		line[0] = '\0';
-		line[1] = 0x03;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		checksum += uchar_ptr[0];
-
-		/* set checksum */
-		mb_put_binary_short(swap, (unsigned short) checksum, (void *) &line[2]);
-
-		/* write out data */
-		write_len = 4;
-		status = mb_fileio_put(verbose, mbio_ptr, line, &write_len, error);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em710mba_wr_bath2(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store, int *error)
-{
-	char	*function_name = "mbr_em710mba_wr_bath2";
-	int	status = MB_SUCCESS;
-	struct mbsys_simrad3_ping_struct *ping;
-	char	line[EM3_BATH2_HEADER_SIZE];
-	short	label;
-	char	*labelchar;
-	size_t	write_len;
-	int	write_size;
-	unsigned short checksum;
-	mb_u_char   *uchar_ptr;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		}
-	
-	/* set which storage structure to use */
-	ping = (struct mbsys_simrad3_ping_struct *) &(store->pings[store->ping_index]);
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:                  %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:                 %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:                  %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:                  %d\n",store->msec);
-		fprintf(stderr,"dbg5       png_date:              %d\n",ping->png_date);
-		fprintf(stderr,"dbg5       png_msec:              %d\n",ping->png_msec);
-		fprintf(stderr,"dbg5       png_count:             %d\n",ping->png_count);
-		fprintf(stderr,"dbg5       png_serial:            %d\n",ping->png_serial);
-		fprintf(stderr,"dbg5       png_heading:           %d\n",ping->png_heading);
-		fprintf(stderr,"dbg5       png_ssv:               %d\n",ping->png_ssv);
-		fprintf(stderr,"dbg5       png_xducer_depth:      %f\n",ping->png_xducer_depth);
-		fprintf(stderr,"dbg5       png_nbeams:            %d\n",ping->png_nbeams);
-		fprintf(stderr,"dbg5       png_nbeams_valid:      %d\n",ping->png_nbeams_valid);
-		fprintf(stderr,"dbg5       png_sample_rate:       %f\n",ping->png_sample_rate);
-		fprintf(stderr,"dbg5       png_spare:             %d\n",ping->png_spare);
-		fprintf(stderr,"dbg5       cnt  depth xtrack ltrack dprsn   azi   rng  qual wnd amp num\n");
-		fprintf(stderr,"dbg5       ------------------------------------------------------------\n");
-		for (i=0;i<ping->png_nbeams;i++)
-			fprintf(stderr,"dbg5       %3d %7.2f %7.2f %7.2f %5d %5d %5d %4d %3d %3d\n",
-				i, ping->png_depth[i], ping->png_acrosstrack[i],
-				ping->png_alongtrack[i], ping->png_window[i],
-				ping->png_quality[i], ping->png_iba[i],
-				ping->png_detection[i], ping->png_clean[i],
-				ping->png_amp[i]);
-		}
-
-	/* zero checksum */
-	checksum = 0;
-
-	/* write the record size */
-	mb_put_binary_int(swap, (int) (EM3_BATH2_HEADER_SIZE
-			+ EM3_BATH2_BEAM_SIZE * ping->png_nbeams + 8), (void *) &write_size);
-	write_len = 4;
-	mb_fileio_put(verbose, mbio_ptr, (char *)&write_size, &write_len, error);
-	if (write_len != 4)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	else
-		status = MB_SUCCESS;
-
-	/* write the record label */
-	if (status == MB_SUCCESS)
-		{
-		labelchar = (char *) &label;
-		labelchar[0] = EM3_START_BYTE;
-		labelchar[1] = EM3_ID_BATH2;
-		write_len = 2;
-		status = mb_fileio_put(verbose, mbio_ptr, (char *)&label, &write_len, error);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[1];
-		}
-
-	/* write the sonar id */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_short(swap, (short) (store->sonar), (void *) &label);
-		write_len = 2;
-		status = mb_fileio_put(verbose, mbio_ptr, (char *)&label, &write_len, error);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[0];
-		checksum += uchar_ptr[1];
-		}
-
-	/* output binary header data */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_int(swap, (int) ping->png_date, (void *) &line[0]);
-		mb_put_binary_int(swap, (int) ping->png_msec, (void *) &line[4]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_count, (void *) &line[8]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_serial, (void *) &line[10]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_heading, (void *) &line[12]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_ssv, (void *) &line[14]);
-		mb_put_binary_float(swap, (float) ping->png_xducer_depth, (void *) &line[16]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_nbeams, (void *) &line[20]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_nbeams_valid, (void *) &line[22]);
-		mb_put_binary_float(swap, (float) ping->png_sample_rate, (void *) &line[24]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_spare, (void *) &line[28]);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM3_BATH2_HEADER_SIZE;j++)
-		    checksum += uchar_ptr[j];
-
-		/* write out data */
-		write_len = EM3_BATH2_HEADER_SIZE;
-		status = mb_fileio_put(verbose, mbio_ptr, line, &write_len, error);
-		}
-
-	/* output binary beam data */
-	if (status == MB_SUCCESS)
-	    for (i=0;i<ping->png_nbeams;i++)
-		{
-		mb_put_binary_float(swap, ping->png_depth[i], (void *) &line[0]);
-		mb_put_binary_float(swap, ping->png_acrosstrack[i], (void *) &line[4]);
-		mb_put_binary_float(swap, ping->png_alongtrack[i], (void *) &line[8]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_window[i], (void *) &line[12]);
-		line[14] = (mb_u_char) ping->png_quality[i];
-		line[15] = (mb_s_char) ping->png_iba[i];
-		line[16] = (mb_u_char) ping->png_detection[i];
-		line[17] = (mb_s_char) ping->png_clean[i];
-		mb_put_binary_short(swap, (short) ping->png_amp[i], (void *) &line[18]);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM3_BATH2_BEAM_SIZE;j++)
-		    checksum += uchar_ptr[j];
-
-		/* write out data */
-		write_len = EM3_BATH2_BEAM_SIZE;
-		status = mb_fileio_put(verbose, mbio_ptr, line, &write_len, error);
-		}
-
-	/* output end of record */
-	if (status == MB_SUCCESS)
-		{
-		line[0] = 0;
-		line[1] = 0x03;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		checksum += uchar_ptr[0];
-
-		/* set checksum */
-		mb_put_binary_short(swap, (unsigned short) checksum, (void *) &line[2]);
-
-		/* write out data */
-		write_len = 4;
-		status = mb_fileio_put(verbose, mbio_ptr, line, &write_len, error);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em710mba_wr_bath3_mba(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store, int *error)
-{
-	char	*function_name = "mbr_em710mba_wr_bath3_mba";
-	int	status = MB_SUCCESS;
-	struct mbsys_simrad3_ping_struct *ping;
-	char	line[EM3_BATH3_MBA_HEADER_SIZE];
-	short	label;
-	char	*labelchar;
-	size_t	write_len;
-	int	write_size;
-	unsigned short checksum;
-	mb_u_char   *uchar_ptr;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		}
-
-	/* set which storage structure to use */
-	ping = (struct mbsys_simrad3_ping_struct *) &(store->pings[store->ping_index]);
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:                  %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:                 %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:                  %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:                  %d\n",store->msec);
-		fprintf(stderr,"dbg5       png_date:              %d\n",ping->png_date);
-		fprintf(stderr,"dbg5       png_msec:              %d\n",ping->png_msec);
-		fprintf(stderr,"dbg5       png_count:             %d\n",ping->png_count);
-		fprintf(stderr,"dbg5       png_serial:            %d\n",ping->png_serial);
-		fprintf(stderr,"dbg5       png_latitude:          %d\n",ping->png_latitude);
-		fprintf(stderr,"dbg5       png_longitude:         %d\n",ping->png_longitude);
-		fprintf(stderr,"dbg5       png_heading:           %d\n",ping->png_heading);
-		fprintf(stderr,"dbg5       png_heave:             %d\n",ping->png_heave);
-		fprintf(stderr,"dbg5       png_roll:              %d\n",ping->png_roll);
-		fprintf(stderr,"dbg5       png_pitch:             %d\n",ping->png_pitch);
-		fprintf(stderr,"dbg5       png_speed:             %d\n",ping->png_speed);
-		fprintf(stderr,"dbg5       png_ssv:               %d\n",ping->png_ssv);
-		fprintf(stderr,"dbg5       png_xducer_depth:      %f\n",ping->png_xducer_depth);
-		fprintf(stderr,"dbg5       png_nbeams:            %d\n",ping->png_nbeams);
-		fprintf(stderr,"dbg5       png_nbeams_valid:      %d\n",ping->png_nbeams_valid);
-		fprintf(stderr,"dbg5       png_sample_rate:       %f\n",ping->png_sample_rate);
-		fprintf(stderr,"dbg5       png_spare:             %d\n",ping->png_spare);
-		fprintf(stderr,"dbg5       cnt  depth xtrack ltrack win  qual  iba det cln amp depression azimuth range heave flag\n");
-		fprintf(stderr,"dbg5       ------------------------------------------------------------\n");
-		for (i=0;i<ping->png_nbeams;i++)
-			fprintf(stderr,"dbg5       %3d %7.2f %7.2f %7.2f %5d %5d %5d %4d %3d %3d %7.2f %7.2f %7.2f %7.2f %3u\n",
-				i, ping->png_depth[i], ping->png_acrosstrack[i],
-				ping->png_alongtrack[i], ping->png_window[i],
-				ping->png_quality[i], ping->png_iba[i],
-				ping->png_detection[i], ping->png_clean[i],
-				ping->png_amp[i], ping->png_depression[i],
-				ping->png_azimuth[i], ping->png_range[i], ping->png_bheave[i],
-				ping->png_beamflag[i]);
-		}
-
-	/* zero checksum */
-	checksum = 0;
-
-	/* write the record size */
-	mb_put_binary_int(swap, (int) (EM3_BATH3_MBA_HEADER_SIZE
-			+ EM3_BATH3_MBA_BEAM_SIZE * ping->png_nbeams + 8), (void *) &write_size);
-	write_len = 4;
-	mb_fileio_put(verbose, mbio_ptr, (char *)&write_size, &write_len, error);
-
-	/* write the record label */
-	if (status == MB_SUCCESS)
-		{
-		labelchar = (char *) &label;
-		labelchar[0] = EM3_START_BYTE;
-		labelchar[1] = EM3_ID_BATH3_MBA;
-		write_len = 2;
-		status = mb_fileio_put(verbose, mbio_ptr, (char *)&label, &write_len, error);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[1];
-		}
-
-	/* write the sonar id */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_short(swap, (short) (store->sonar), (void *) &label);
-		write_len = 2;
-		status = mb_fileio_put(verbose, mbio_ptr, (char *)&label, &write_len, error);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[0];
-		checksum += uchar_ptr[1];
-		}
-
-	/* output binary header data */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_int(swap, (int) ping->png_date, (void *) &line[0]);
-		mb_put_binary_int(swap, (int) ping->png_msec, (void *) &line[4]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_count, (void *) &line[8]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_serial, (void *) &line[10]);
-		mb_put_binary_int(swap, (int) ping->png_latitude, (void *) &line[12]);
-		mb_put_binary_int(swap, (int) ping->png_longitude, (void *) &line[16]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_heading, (void *) &line[20]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_heave, (void *) &line[22]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_roll, (void *) &line[24]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_pitch, (void *) &line[26]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_speed, (void *) &line[28]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_ssv, (void *) &line[30]);
-		mb_put_binary_float(swap, (float) ping->png_xducer_depth, (void *) &line[32]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_nbeams, (void *) &line[36]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_nbeams_valid, (void *) &line[38]);
-		mb_put_binary_float(swap, (float) ping->png_sample_rate, (void *) &line[40]);
-		mb_put_binary_int(swap, (int) ping->png_spare, (void *) &line[44]);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM3_BATH3_MBA_HEADER_SIZE;j++)
-		    checksum += uchar_ptr[j];
-
-		/* write out data */
-		write_len = EM3_BATH3_MBA_HEADER_SIZE;
-		status = mb_fileio_put(verbose, mbio_ptr, line, &write_len, error);
-		}
-
-	/* output binary beam data */
-	if (status == MB_SUCCESS)
-	    for (i=0;i<ping->png_nbeams;i++)
-		{
-		mb_put_binary_float(swap, ping->png_depth[i], (void *) &line[0]);
-		mb_put_binary_float(swap, ping->png_acrosstrack[i], (void *) &line[4]);
-		mb_put_binary_float(swap, ping->png_alongtrack[i], (void *) &line[8]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_window[i], (void *) &line[12]);
-		line[14] = (mb_u_char) ping->png_quality[i];
-		line[15] = (mb_s_char) ping->png_iba[i];
-		line[16] = (mb_u_char) ping->png_detection[i];
-		line[17] = (mb_s_char) ping->png_clean[i];
-		mb_put_binary_short(swap, (short) ping->png_amp[i], (void *) &line[18]);
-		mb_put_binary_float(swap, ping->png_depression[i], (void *) &line[20]);
-		mb_put_binary_float(swap, ping->png_azimuth[i], (void *) &line[24]);
-		mb_put_binary_float(swap, ping->png_range[i], (void *) &line[28]);
-		mb_put_binary_float(swap, ping->png_bheave[i], (void *) &line[32]);
-		line[36] = (mb_s_char) ping->png_beamflag[i];
-		line[37] = (mb_u_char) 0;
-/* fprintf(stderr,"WRITE ping:%d beam %d  png_depression:%f ",ping->png_count,i,ping->png_depression[i]);
-fprintf(stderr,"png_azimuth:%f ",ping->png_azimuth[i]);
-fprintf(stderr,"png_range:%f ",ping->png_range[i]);
-fprintf(stderr,"png_bheave:%f ",ping->png_bheave[i]);
-fprintf(stderr,"png_beamflag:%d\n",ping->png_beamflag[i]); */
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM3_BATH3_MBA_BEAM_SIZE;j++)
-		    checksum += uchar_ptr[j];
-
-		/* write out data */
-		write_len = EM3_BATH3_MBA_BEAM_SIZE;
-		status = mb_fileio_put(verbose, mbio_ptr, line, &write_len, error);
-		}
-
-	/* output end of record */
-	if (status == MB_SUCCESS)
-		{
-		line[0] = 0;
-		line[1] = 0x03;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		checksum += uchar_ptr[0];
-
-		/* set checksum */
-		mb_put_binary_short(swap, (unsigned short) checksum, (void *) &line[2]);
-
-		/* write out data */
-		write_len = 4;
-		status = mb_fileio_put(verbose, mbio_ptr, line, &write_len, error);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em710mba_wr_rawbeam4(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store, int *error)
-{
-	char	*function_name = "mbr_em710mba_wr_rawbeam4";
-	int	status = MB_SUCCESS;
-	struct mbsys_simrad3_ping_struct *ping;
-	char	line[EM3_RAWBEAM4_HEADER_SIZE];
-	short	label;
-	char	*labelchar;
-	size_t	write_len;
-	int	write_size;
-	unsigned short checksum;
-	mb_u_char   *uchar_ptr;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		}
-	
-	/* set which storage structure to use */
-	ping = (struct mbsys_simrad3_ping_struct *) &(store->pings[store->ping_index]);
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       png_raw_read:               %d\n",ping->png_raw_read);
-		fprintf(stderr,"dbg5       png_raw_date:                %d\n",ping->png_raw_date);
-		fprintf(stderr,"dbg5       png_raw_msec:                %d\n",ping->png_raw_msec);
-		fprintf(stderr,"dbg5       png_raw_count:               %d\n",ping->png_raw_count);
-		fprintf(stderr,"dbg5       png_raw_serial:              %d\n",ping->png_raw_serial);
-		fprintf(stderr,"dbg5       png_raw_ssv:                 %d\n",ping->png_raw_ssv);
-		fprintf(stderr,"dbg5       png_raw_ntx:                 %d\n",ping->png_raw_ntx);
-		fprintf(stderr,"dbg5       png_raw_nbeams:              %d\n",ping->png_raw_nbeams);
-		fprintf(stderr,"dbg5       png_raw_detections:          %d\n",ping->png_raw_detections);
-		fprintf(stderr,"dbg5       png_raw_sample_rate:         %f\n",ping->png_raw_sample_rate);
-		fprintf(stderr,"dbg5       png_raw_spare:               %d\n",ping->png_raw_spare);
-		fprintf(stderr,"dbg5       ------------------------------------------------------------\n");
-		fprintf(stderr,"dbg5       transmit pulse values:\n");
-		fprintf(stderr,"dbg5       tiltangle focus length offset center bandwidth waveform sector\n");
-		fprintf(stderr,"dbg5       ------------------------------------------------------------\n");
-		for (i=0;i<ping->png_raw_ntx;i++)
-			fprintf(stderr,"dbg5       %3d %5d %5d %f %f %f %4d %4d %4d %f\n",
-				i, ping->png_raw_txtiltangle[i],
-				ping->png_raw_txfocus[i], ping->png_raw_txsignallength[i],
-				ping->png_raw_txoffset[i], ping->png_raw_txcenter[i],
-				ping->png_raw_txabsorption[i], ping->png_raw_txwaveform[i],
-				ping->png_raw_txsector[i], ping->png_raw_txbandwidth[i]);
-		fprintf(stderr,"dbg5       ------------------------------------------------------------\n");
-		fprintf(stderr,"dbg5       beam values:\n");
-		fprintf(stderr,"dbg5       angle range sector amp quality window beam\n");
-		fprintf(stderr,"dbg5       ------------------------------------------------------------\n");
-		for (i=0;i<ping->png_raw_nbeams;i++)
-			fprintf(stderr,"dbg5       %3d %5d %3d %3d %4d %3d %5d %f %5d %5d %5d\n",
-				i, ping->png_raw_rxpointangle[i], ping->png_raw_rxsector[i],
-				ping->png_raw_rxdetection[i], ping->png_raw_rxwindow[i],
-				ping->png_raw_rxquality[i], ping->png_raw_rxspare1[i],
-				ping->png_raw_rxrange[i],ping->png_raw_rxamp[i],
-				ping->png_raw_rxcleaning[i],ping->png_raw_rxspare2[i]);
-		}
-
-	/* zero checksum */
-	checksum = 0;
-
-	/* write the record size */
-	mb_put_binary_int(swap, (int) (EM3_RAWBEAM4_HEADER_SIZE
-			+ EM3_RAWBEAM4_TX_SIZE * ping->png_raw_ntx
-			+ EM3_RAWBEAM4_BEAM_SIZE * ping->png_raw_nbeams + 8), (void *) &write_size);
-	write_len = 4;
-	mb_fileio_put(verbose, mbio_ptr, (char *)&write_size, &write_len, error);
-	if (write_len != 4)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	else
-		status = MB_SUCCESS;
-
-	/* write the record label */
-	if (status == MB_SUCCESS)
-		{
-		labelchar = (char *) &label;
-		labelchar[0] = EM3_START_BYTE;
-		labelchar[1] = EM3_ID_RAWBEAM4;
-		write_len = 2;
-		status = mb_fileio_put(verbose, mbio_ptr, (char *)&label, &write_len, error);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[1];
-		}
-
-	/* write the sonar id */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_short(swap, (short) (store->sonar), (void *) &label);
-		write_len = 2;
-		status = mb_fileio_put(verbose, mbio_ptr, (char *)&label, &write_len, error);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[0];
-		checksum += uchar_ptr[1];
-		}
-
-	/* output binary header data */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_int(swap, (int) ping->png_raw_date, (void *) &line[0]);
-		mb_put_binary_int(swap, (int) ping->png_raw_msec, (void *) &line[4]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_raw_count, (void *) &line[8]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_raw_serial, (void *) &line[10]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_raw_ssv, (void *) &line[12]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_raw_ntx, (void *) &line[14]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_raw_nbeams, (void *) &line[16]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_raw_detections, (void *) &line[18]);
-		mb_put_binary_float(swap, ping->png_raw_sample_rate, (void *) &line[20]);
-		mb_put_binary_int(swap, (int) ping->png_raw_spare, (void *) &line[24]);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM3_RAWBEAM4_HEADER_SIZE;j++)
-		    checksum += uchar_ptr[j];
-
-		/* write out data */
-		write_len = EM3_RAWBEAM4_HEADER_SIZE;
-		status = mb_fileio_put(verbose, mbio_ptr, line, &write_len, error);
-		}
-
-	/* output binary tx data */
-	if (status == MB_SUCCESS)
-	    for (i=0;i<ping->png_raw_ntx;i++)
-		{
-		mb_put_binary_short(swap, (short) ping->png_raw_txtiltangle[i], (void *) &line[0]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_raw_txfocus[i], (void *) &line[2]);
-		mb_put_binary_float(swap, ping->png_raw_txsignallength[i], (void *) &line[4]);
-		mb_put_binary_float(swap, ping->png_raw_txoffset[i], (void *) &line[8]);
-		mb_put_binary_float(swap, ping->png_raw_txcenter[i], (void *) &line[12]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_raw_txabsorption[i], (void *) &line[16]);
-		line[18] = (mb_u_char) ping->png_raw_txwaveform[i];
-		line[19] = (mb_u_char) ping->png_raw_txsector[i];
-		mb_put_binary_float(swap, ping->png_raw_txbandwidth[i], (void *) &line[20]);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM3_RAWBEAM4_TX_SIZE;j++)
-		    checksum += uchar_ptr[j];
-
-		/* write out data */
-		write_len = EM3_RAWBEAM4_TX_SIZE;
-		status = mb_fileio_put(verbose, mbio_ptr, line, &write_len, error);
-		}
-
-	/* output binary beam data */
-	if (status == MB_SUCCESS)
-	    for (i=0;i<ping->png_raw_nbeams;i++)
-		{
-		mb_put_binary_short(swap, (short) ping->png_raw_rxpointangle[i], (void *) &line[0]);
-		line[2] = (mb_u_char) ping->png_raw_rxsector[i];
-		line[3] = (mb_u_char) ping->png_raw_rxdetection[i];
-		mb_put_binary_short(swap, (short) ping->png_raw_rxwindow[i], (void *) &line[4]);
-		line[6] = (mb_u_char) ping->png_raw_rxquality[i];
-		line[7] = (mb_u_char) ping->png_raw_rxspare1[i];
-		mb_put_binary_float(swap, ping->png_raw_rxrange[i], (void *) &line[8]);
-		mb_put_binary_short(swap, (short) ping->png_raw_rxamp[i], (void *) &line[12]);
-		line[14] = (mb_u_char) ping->png_raw_rxcleaning[i];
-		line[15] = (mb_u_char) ping->png_raw_rxspare2[i];
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM3_RAWBEAM4_BEAM_SIZE;j++)
-		    checksum += uchar_ptr[j];
-
-		/* write out data */
-		write_len = EM3_RAWBEAM4_BEAM_SIZE;
-		status = mb_fileio_put(verbose, mbio_ptr, line, &write_len, error);
-		}
-
-	/* output end of record */
-	if (status == MB_SUCCESS)
-		{
-		line[0] = 0;
-		line[1] = 0x03;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		checksum += uchar_ptr[0];
-
-		/* set checksum */
-		mb_put_binary_short(swap, (unsigned short) checksum, (void *) &line[2]);
-
-		/* write out data */
-		write_len = 4;
-		status = mb_fileio_put(verbose, mbio_ptr, line, &write_len, error);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em710mba_wr_quality(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store, int *error)
-{
-	char	*function_name = "mbr_em710mba_rd_quality";
-	int	status = MB_SUCCESS;
-	struct mbsys_simrad3_ping_struct *ping;
-	char	line[EM3_QUALITY_HEADER_SIZE];
-	short	label;
-	char	*labelchar;
-	size_t	write_len;
-	int	write_size;
-	unsigned short checksum;
-	mb_u_char   *uchar_ptr;
-	int	index;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		}
-	
-	/* set which storage structure to use */
-	ping = (struct mbsys_simrad3_ping_struct *) &(store->pings[store->ping_index]);
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:                  %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:                 %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:                  %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:                  %d\n",store->msec);
-		fprintf(stderr,"dbg5       png_quality_date:              %d\n",ping->png_quality_date);
-		fprintf(stderr,"dbg5       png_quality_msec:              %d\n",ping->png_quality_msec);
-		fprintf(stderr,"dbg5       png_quality_count:             %d\n",ping->png_quality_count);
-		fprintf(stderr,"dbg5       png_quality_serial:            %d\n",ping->png_quality_serial);
-		fprintf(stderr,"dbg5       png_quality_nbeams:            %d\n",ping->png_quality_nbeams);
-		fprintf(stderr,"dbg5       png_quality_nparameters:       %d\n",ping->png_quality_nparameters);
-		fprintf(stderr,"dbg5       png_quality_spare:         v   %d\n",ping->png_quality_spare);
-		fprintf(stderr,"dbg5       cnt  quality parameters\n");
-		fprintf(stderr,"dbg5       ------------------------------------------------------------\n");
-		for (i=0;i<ping->png_quality_nbeams;i++)
-			{
-			fprintf(stderr,"dbg5       %3d ", i);
-			for (j=0;j<ping->png_quality_nparameters;j++)
-				fprintf(stderr,"%f", ping->png_quality_parameters[i][j]);
-			fprintf(stderr,"\n");
-			}
-		}
-
-	/* zero checksum */
-	checksum = 0;
-
-	/* write the record size */
-	mb_put_binary_int(swap, (int) (EM3_QUALITY_HEADER_SIZE
-			+ ping->png_quality_nbeams * ping->png_quality_nparameters * sizeof(float) + 8),
-			(void *) &write_size);
-	write_len = 4;
-	mb_fileio_put(verbose, mbio_ptr, (char *)&write_size, &write_len, error);
-
-	/* write the record label */
-	if (status == MB_SUCCESS)
-		{
-		labelchar = (char *) &label;
-		labelchar[0] = EM3_START_BYTE;
-		labelchar[1] = EM3_ID_QUALITY;
-		write_len = 2;
-		status = mb_fileio_put(verbose, mbio_ptr, (char *)&label, &write_len, error);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[1];
-		}
-
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_short(swap, (short) (store->sonar), (void *) &label);
-		write_len = 2;
-		status = mb_fileio_put(verbose, mbio_ptr, (char *)&label, &write_len, error);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[0];
-		checksum += uchar_ptr[1];
-		}
-
-	/* output binary header data */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_int(swap, (int) ping->png_quality_date, (void *) &line[0]);
-		mb_put_binary_int(swap, (int) ping->png_quality_msec, (void *) &line[4]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_quality_count, (void *) &line[8]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_quality_serial, (void *) &line[10]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_quality_nbeams, (void *) &line[12]);
-		line[14] = (mb_u_char) ping->png_quality_nparameters;
-		line[15] = (mb_u_char) ping->png_quality_spare;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM3_QUALITY_HEADER_SIZE;j++)
-		    checksum += uchar_ptr[j];
-
-		/* write out data */
-		write_len = EM3_QUALITY_HEADER_SIZE;
-		status = mb_fileio_put(verbose, mbio_ptr, line, &write_len, error);
-		}
-
-	/* output binary beam data */
-	if (status == MB_SUCCESS)
-		{
-		write_len = (size_t)(ping->png_quality_nparameters * sizeof(float));
-		for (i=0;i<ping->png_quality_nbeams;i++)
-			{
-			index = 0;
-			for (j=0;j<ping->png_quality_nparameters;j++)
-				{
-				mb_put_binary_float(swap, (unsigned short) ping->png_quality_parameters[i][j], (void *) &line[index]);
-				index += 4;
-				}
-
-			/* compute checksum */
-			uchar_ptr = (mb_u_char *) line;
-			for (j=0;j<write_len;j++)
-			    checksum += uchar_ptr[j];
-	
-			/* write out data */
-			status = mb_fileio_put(verbose, mbio_ptr, line, &write_len, error);
-			}
-		}
-
-	/* output end of record */
-	if (status == MB_SUCCESS)
-		{
-		line[0] = 0x00;
-		line[1] = 0x03;
-
-		/* set checksum */
-		mb_put_binary_short(swap, (unsigned short) checksum, (void *) &line[2]);
-
-		/* write out data */
-		write_len = 4;
-		status = mb_fileio_put(verbose, mbio_ptr, &line[0], &write_len, error);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em710mba_wr_ss2_mba(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store, int *error)
-{
-	char	*function_name = "mbr_em710mba_wr_ss2_mba";
-	int	status = MB_SUCCESS;
-	struct mbsys_simrad3_ping_struct *ping;
-	char	line[2 * MBSYS_SIMRAD3_BUFFER_SIZE];
-	short	label;
-	char	*labelchar;
-	size_t	write_len;
-	int	write_size;
-	int	offset;
-	unsigned short checksum;
-	mb_u_char   *uchar_ptr;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		}
-	
-	/* set which storage structure to use */
-	ping = (struct mbsys_simrad3_ping_struct *) &(store->pings[store->ping_index]);
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:               %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:              %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:               %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:               %d\n",store->msec);
-		fprintf(stderr,"dbg5       png_date:           %d\n",ping->png_date);
-		fprintf(stderr,"dbg5       png_msec:           %d\n",ping->png_msec);
-
-		fprintf(stderr,"dbg5       png_count:             %d\n",ping->png_count);
-		fprintf(stderr,"dbg5       png_serial:            %d\n",ping->png_serial);
-		fprintf(stderr,"dbg5       png_latitude:          %d\n",ping->png_latitude);
-		fprintf(stderr,"dbg5       png_longitude:         %d\n",ping->png_longitude);
-		fprintf(stderr,"dbg5       png_heading:           %d\n",ping->png_heading);
-		fprintf(stderr,"dbg5       png_heave:             %d\n",ping->png_heave);
-		fprintf(stderr,"dbg5       png_roll:              %d\n",ping->png_roll);
-		fprintf(stderr,"dbg5       png_pitch:             %d\n",ping->png_pitch);
-		fprintf(stderr,"dbg5       png_speed:             %d\n",ping->png_speed);
-		fprintf(stderr,"dbg5       png_ssv:               %d\n",ping->png_ssv);
-		fprintf(stderr,"dbg5       png_xducer_depth:      %f\n",ping->png_xducer_depth);
-		fprintf(stderr,"dbg5       png_nbeams:            %d\n",ping->png_nbeams);
-		fprintf(stderr,"dbg5       png_nbeams_valid:      %d\n",ping->png_nbeams_valid);
-		fprintf(stderr,"dbg5       png_sample_rate:       %f\n",ping->png_sample_rate);
-		fprintf(stderr,"dbg5       png_spare:             %d\n",ping->png_spare);
-		fprintf(stderr,"dbg5       cnt  depth xtrack ltrack win  qual  iba det cln amp depression azimuth range heave flag\n");
-		fprintf(stderr,"dbg5       ------------------------------------------------------------\n");
-		for (i=0;i<ping->png_nbeams;i++)
-			fprintf(stderr,"dbg5       %3d %7.2f %7.2f %7.2f %5d %5d %5d %4d %3d %3d %7.2f %7.2f %7.2f %7.2f %3u\n",
-				i, ping->png_depth[i], ping->png_acrosstrack[i],
-				ping->png_alongtrack[i], ping->png_window[i],
-				ping->png_quality[i], ping->png_iba[i],
-				ping->png_detection[i], ping->png_clean[i],
-				ping->png_amp[i], ping->png_depression[i],
-				ping->png_azimuth[i], ping->png_range[i], ping->png_bheave[i],
-				ping->png_beamflag[i]);
-
-		fprintf(stderr,"dbg5       png_ss_date:        %d\n",ping->png_ss_date);
-		fprintf(stderr,"dbg5       png_ss_msec:        %d\n",ping->png_ss_msec);
-		fprintf(stderr,"dbg5       png_ss_count:       %d\n",ping->png_ss_count);
-		fprintf(stderr,"dbg5       png_ss_serial:      %d\n",ping->png_ss_serial);
-		fprintf(stderr,"dbg5       png_ss_sample_rate: %f\n",ping->png_ss_sample_rate);
-		fprintf(stderr,"dbg5       png_r_zero:         %d\n",ping->png_r_zero);
-		fprintf(stderr,"dbg5       png_bsn:            %d\n",ping->png_bsn);
-		fprintf(stderr,"dbg5       png_bso:            %d\n",ping->png_bso);
-		fprintf(stderr,"dbg5       png_tx:             %d\n",ping->png_tx);
-		fprintf(stderr,"dbg5       png_tvg_crossover:  %d\n",ping->png_tvg_crossover);
-		fprintf(stderr,"dbg5       png_nbeams_ss:      %d\n",ping->png_nbeams_ss);
-		fprintf(stderr,"dbg5       png_npixels:        %d\n",ping->png_npixels);
-		fprintf(stderr,"dbg5       cnt  index sort samples start center\n");
-		fprintf(stderr,"dbg5       --------------------------------------------------\n");
-		for (i=0;i<ping->png_nbeams_ss;i++)
-			fprintf(stderr,"dbg5        %4d %2d %4d %4d %4d %4d\n",
-				i, ping->png_sort_direction[i], ping->png_ssdetection[i],
-				ping->png_beam_samples[i], ping->png_start_sample[i],
-				ping->png_center_sample[i]);
-		fprintf(stderr,"dbg5       cnt  ss\n");
-		fprintf(stderr,"dbg5       --------------------------------------------------\n");
-		for (i=0;i<ping->png_npixels;i++)
-			fprintf(stderr,"dbg5        %d %d\n",
-				i, ping->png_ssraw[i]);
-		fprintf(stderr,"dbg5       cnt  ss ssalongtrack\n");
-		fprintf(stderr,"dbg5       --------------------------------------------------\n");
-		for (i=0;i<ping->png_pixels_ss;i++)
-			fprintf(stderr,"dbg5        %d %d %d\n",
-				i, ping->png_ss[i], ping->png_ssalongtrack[i]);
-		}
-
-	/* zero checksum */
-	checksum = 0;
-
-	/* write the record size */
-	mb_put_binary_int(swap, (int) (EM3_SS2_MBA_HEADER_SIZE
-			+ EM3_SS2_MBA_BEAM_SIZE * ping->png_nbeams_ss
-			+ sizeof(short) * (ping->png_npixels + 2 * ping->png_pixels_ss)
-			+ 8), (void *) &write_size);
-	write_len = 4;
-	mb_fileio_put(verbose, mbio_ptr, (char *)&write_size, &write_len, error);
-
-	/* write the record label */
-	if (status == MB_SUCCESS)
-		{
-		labelchar = (char *) &label;
-		labelchar[0] = EM3_START_BYTE;
-		labelchar[1] = EM3_ID_SS2_MBA;
-		write_len = 2;
-		status = mb_fileio_put(verbose, mbio_ptr, (char *)&label, &write_len, error);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[1];
-		}
-
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_short(swap, (short) (store->sonar), (void *) &label);
-		write_len = 2;
-		status = mb_fileio_put(verbose, mbio_ptr, (char *)&label, &write_len, error);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[0];
-		checksum += uchar_ptr[1];
-		}
-
-	/* output binary header data */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_int(swap, (int) ping->png_ss_date, (void *) &line[0]);
-		mb_put_binary_int(swap, (int) ping->png_ss_msec, (void *) &line[4]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_ss_count, (void *) &line[8]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_ss_serial, (void *) &line[10]);
-		mb_put_binary_float(swap, ping->png_ss_sample_rate, (void *) &line[12]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_r_zero, (void *) &line[16]);
-		mb_put_binary_short(swap, (short) ping->png_bsn, (void *) &line[18]);
-		mb_put_binary_short(swap, (short) ping->png_bso, (void *) &line[20]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_tx, (void *) &line[22]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_tvg_crossover, (void *) &line[24]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_nbeams_ss, (void *) &line[26]);
-		mb_put_binary_float(swap, (float) ping->png_pixel_size, (void *) &line[28]);
-		mb_put_binary_int(swap, (int) ping->png_pixels_ss, (void *) &line[32]);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM3_SS2_MBA_HEADER_SIZE;j++)
-		    checksum += uchar_ptr[j];
-
-		/* write out data */
-		write_len = EM3_SS2_MBA_HEADER_SIZE;
-		status = mb_fileio_put(verbose, mbio_ptr, line, &write_len, error);
-		}
-
-	/* output binary beam data */
-	if (status == MB_SUCCESS)
-	    for (i=0;i<ping->png_nbeams_ss;i++)
-		{
-		line[0] = (mb_s_char) ping->png_sort_direction[i];
-		line[1] = (mb_u_char) ping->png_ssdetection[i];
-		mb_put_binary_short(swap, (unsigned short) ping->png_beam_samples[i], (void *) &line[2]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_center_sample[i], (void *) &line[4]);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM3_SS2_MBA_BEAM_SIZE;j++)
-		    checksum += uchar_ptr[j];
-
-		/* write out data */
-		write_len = EM3_SS2_MBA_BEAM_SIZE;
-		status = mb_fileio_put(verbose, mbio_ptr, line, &write_len, error);
-		}
-
-	/* output sidescan data */
-	if (status == MB_SUCCESS)
-		{
-		write_size = 2 * ping->png_npixels;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) ping->png_ssraw;
-		for (j=0;j<write_size;j++)
-		    checksum += uchar_ptr[j];
-
-		write_len = write_size;
-		status = mb_fileio_put(verbose, mbio_ptr, (char *)ping->png_ssraw, &write_len, error);
-		}
-
-	/* output processed sidescan data */
-	if (status == MB_SUCCESS)
-	    {
-	    offset = (MBSYS_SIMRAD3_MAXPIXELS - ping->png_pixels_ss) / 2;
-	    for (i=0;i<ping->png_pixels_ss;i++)
-		{
-		mb_put_binary_short(swap, (short) ping->png_ss[offset+i], (void *) &line[2*i]);
-		}
-
-	    /* compute checksum */
-	    write_size = ping->png_pixels_ss * sizeof(short);
-	    uchar_ptr = (mb_u_char *) &line[0];
-	    for (j=0;j<write_size;j++)
-		checksum += uchar_ptr[j];
-
-	    /* write out data */
-	    write_len = write_size;
-	    status = mb_fileio_put(verbose, mbio_ptr, line, &write_len, error);
-	    }
-
-	/* output processed sidescan alongtrack data */
-	if (status == MB_SUCCESS)
-	    {
-	    offset = (MBSYS_SIMRAD3_MAXPIXELS - ping->png_pixels_ss) / 2;
-	    for (i=0;i<ping->png_pixels_ss;i++)
-		{
-		mb_put_binary_short(swap, ping->png_ssalongtrack[offset+i], (void *) &line[2*i]);
-		}
-
-	    /* compute checksum */
-	    write_size = ping->png_pixels_ss * sizeof(short);
-	    uchar_ptr = (mb_u_char *) &line[0];
-	    for (j=0;j<write_size;j++)
-		checksum += uchar_ptr[j];
-
-	    /* write out data */
-	    write_len = write_size;
-	    status = mb_fileio_put(verbose, mbio_ptr, line, &write_len, error);
-	    }
-
-	/* output end of record */
-	if (status == MB_SUCCESS)
-		{
-		line[0] = 0;
-		line[1] = 0x03;
-
-		/* set checksum */
-		mb_put_binary_short(swap, (unsigned short) checksum, (void *) &line[2]);
-
-		/* write out data */
-		write_len = 4;
-		status = mb_fileio_put(verbose, mbio_ptr, line, &write_len, error);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em710mba_wr_wc(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store, int *error)
-{
-	char	*function_name = "mbr_em710mba_wr_wc";
-	int	status = MB_SUCCESS;
-	struct mbsys_simrad3_watercolumn_struct *wc;
-	char	line[EM3_WC_HEADER_SIZE];
-	short	label;
-	char	*labelchar;
-	size_t	write_len;
-	int	write_size;
-	unsigned short checksum;
-	mb_u_char   *uchar_ptr;
-	int	record_size;
-	int	pad;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		}
-
-	/* get storage structure */
-	wc = (struct mbsys_simrad3_watercolumn_struct *) store->wc;
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       wtc_date:        %d\n",wc->wtc_date);
-		fprintf(stderr,"dbg5       wtc_msec:        %d\n",wc->wtc_msec);
-		fprintf(stderr,"dbg5       wtc_count:       %d\n",wc->wtc_count);
-		fprintf(stderr,"dbg5       wtc_serial:      %d\n",wc->wtc_serial);
-		fprintf(stderr,"dbg5       wtc_ndatagrams:  %d\n",wc->wtc_ndatagrams);
-		fprintf(stderr,"dbg5       wtc_datagram:    %d\n",wc->wtc_datagram);
-		fprintf(stderr,"dbg5       wtc_ntx:         %d\n",wc->wtc_ntx);
-		fprintf(stderr,"dbg5       wtc_nrx:         %d\n",wc->wtc_nrx);
-		fprintf(stderr,"dbg5       wtc_nbeam:       %d\n",wc->wtc_nbeam);
-		fprintf(stderr,"dbg5       wtc_ssv:         %d\n",wc->wtc_ssv);
-		fprintf(stderr,"dbg5       wtc_sfreq:       %d\n",wc->wtc_sfreq);
-		fprintf(stderr,"dbg5       wtc_heave:       %d\n",wc->wtc_heave);
-		fprintf(stderr,"dbg5       wtc_spare1:      %d\n",wc->wtc_spare1);
-		fprintf(stderr,"dbg5       wtc_spare2:      %d\n",wc->wtc_spare2);
-		fprintf(stderr,"dbg5       wtc_spare3:      %d\n",wc->wtc_spare3);
-		fprintf(stderr,"dbg5       ---------------------------\n");
-		fprintf(stderr,"dbg5       cnt  tilt center sector\n");
-		fprintf(stderr,"dbg5       ---------------------------\n");
-		for (i=0;i<wc->wtc_ntx;i++)
-			fprintf(stderr,"dbg5       %3d %6d %6d %6d\n",
-				i, wc->wtc_txtiltangle[i], wc->wtc_txcenter[i],
-				wc->wtc_txsector[i]);
-		for (i=0;i<wc->wtc_nbeam;i++)
-			{
-			fprintf(stderr,"dbg5       --------------------------------------------------\n");
-			fprintf(stderr,"dbg5       cnt  angle start samples unknown sector beam\n");
-			fprintf(stderr,"dbg5       --------------------------------------------------\n");
-			fprintf(stderr,"dbg5        %4d %3d %2d %4d %4d %4d %4d\n",
-				i, wc->beam[i].wtc_rxpointangle,
-				wc->beam[i].wtc_start_sample,
-				wc->beam[i].wtc_beam_samples,
-				wc->beam[i].wtc_beam_spare,
-				wc->beam[i].wtc_sector,
-				wc->beam[i].wtc_beam);
-/*			fprintf(stderr,"dbg5       --------------------------------------------------\n");
-			fprintf(stderr,"dbg5       beam[%d]: sample amplitude\n",i);
-			fprintf(stderr,"dbg5       --------------------------------------------------\n");
-			for (j=0;j<wc->beam[i].wtc_beam_samples;j++)
-				fprintf(stderr,"dbg5        %4d %4d\n",
-					j, wc->beam[i].wtc_amp[j]);*/
-			}
-		}
-
-	/* zero checksum */
-	checksum = 0;
-
-	/* write the record size */
-	record_size = EM3_WC_HEADER_SIZE
-			+ EM3_WC_BEAM_SIZE * wc->wtc_nbeam
-			+ EM3_WC_TX_SIZE * wc->wtc_ntx + 8;
-	for (i=0;i<wc->wtc_nbeam;i++)
-		{
-		record_size += wc->beam[i].wtc_beam_samples;
-		}
-	pad = (record_size % 2);
-	record_size += pad;
-	mb_put_binary_int(swap, record_size, (void *) &write_size);
-	write_len = 4;
-	mb_fileio_put(verbose, mbio_ptr, (char *)&write_size, &write_len, error);
-	if (write_len != 4)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	else
-		status = MB_SUCCESS;
-
-	/* write the record label */
-	if (status == MB_SUCCESS)
-		{
-		labelchar = (char *) &label;
-		labelchar[0] = EM3_START_BYTE;
-		labelchar[1] = EM3_ID_WATERCOLUMN;
-		write_len = 2;
-		status = mb_fileio_put(verbose, mbio_ptr, (char *)&label, &write_len, error);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[1];
-		}
-
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_short(swap, (short) (store->sonar), (void *) &label);
-		write_len = 2;
-		status = mb_fileio_put(verbose, mbio_ptr, (char *)&label, &write_len, error);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[0];
-		checksum += uchar_ptr[1];
-		}
-
-	/* output binary header data */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_int(swap, (int) wc->wtc_date, (void *) &line[0]);
-		mb_put_binary_int(swap, (int) wc->wtc_msec, (void *) &line[4]);
-		mb_put_binary_short(swap, (unsigned short) wc->wtc_count, (void *) &line[8]);
-		mb_put_binary_short(swap, (unsigned short) wc->wtc_serial, (void *) &line[10]);
-		mb_put_binary_short(swap, (unsigned short) wc->wtc_ndatagrams, (void *) &line[12]);
-		mb_put_binary_short(swap, (unsigned short) wc->wtc_datagram, (void *) &line[14]);
-		mb_put_binary_short(swap, (unsigned short) wc->wtc_ntx, (void *) &line[16]);
-		mb_put_binary_short(swap, (unsigned short) wc->wtc_nrx, (void *) &line[18]);
-		mb_put_binary_short(swap, (unsigned short) wc->wtc_nbeam, (void *) &line[20]);
-		mb_put_binary_short(swap, (unsigned short) wc->wtc_ssv, (void *) &line[22]);
-		mb_put_binary_int(swap, (int) wc->wtc_sfreq, (void *) &line[24]);
-		mb_put_binary_short(swap, (short) wc->wtc_heave, (void *) &line[28]);
-		mb_put_binary_short(swap, (unsigned short) wc->wtc_spare1, (void *) &line[30]);
-		mb_put_binary_short(swap, (unsigned short) wc->wtc_spare2, (void *) &line[32]);
-		mb_put_binary_short(swap, (unsigned short) wc->wtc_spare3, (void *) &line[34]);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM3_WC_HEADER_SIZE;j++)
-		    checksum += uchar_ptr[j];
-
-		/* write out data */
-		write_len = EM3_WC_HEADER_SIZE;
-		status = mb_fileio_put(verbose, mbio_ptr, line, &write_len, error);
-		}
-
-	/* output binary beam data */
-	if (status == MB_SUCCESS)
-	    {
-	    for (i=0;i<wc->wtc_ntx;i++)
-		{
-		mb_put_binary_short(swap, (short) wc->wtc_txtiltangle[i], (void *) &line[0]);
-		mb_put_binary_short(swap, (unsigned short) wc->wtc_txcenter[i], (void *) &line[2]);
-		line[4] = (mb_u_char) wc->wtc_txsector[i];
-		line[5] = (mb_u_char) 0;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM3_WC_TX_SIZE;j++)
-		    checksum += uchar_ptr[j];
-
-		/* write out data */
-		write_len = EM3_WC_TX_SIZE;
-		status = mb_fileio_put(verbose, mbio_ptr, line, &write_len, error);
-		}
-	    for (i=0;i<wc->wtc_nbeam;i++)
-		{
-		mb_put_binary_short(swap, (short) wc->beam[i].wtc_rxpointangle, (void *) &line[0]);
-		mb_put_binary_short(swap, (unsigned short) wc->beam[i].wtc_start_sample, (void *) &line[2]);
-		mb_put_binary_short(swap, (unsigned short) wc->beam[i].wtc_beam_samples, (void *) &line[4]);
-		mb_put_binary_short(swap, (unsigned short) wc->beam[i].wtc_beam_spare, (void *) &line[6]);
-		line[8] = (mb_u_char) wc->beam[i].wtc_sector;
-		line[9] = (mb_u_char) wc->beam[i].wtc_beam;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM3_WC_BEAM_SIZE;j++)
-		    checksum += uchar_ptr[j];
-
-		/* write out data */
-		write_len = EM3_WC_BEAM_SIZE;
-		status = mb_fileio_put(verbose, mbio_ptr, line, &write_len, error);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) wc->beam[i].wtc_amp;
-		for (j=0;j<wc->beam[i].wtc_beam_samples;j++)
-		    checksum += uchar_ptr[j];
-
-		/* write out data */
-		write_len = wc->beam[i].wtc_beam_samples;
-		status = mb_fileio_put(verbose, mbio_ptr, (char *)wc->beam[i].wtc_amp, &write_len, error);
-		}
-	    }
-
-	/* output end of record */
-	if (status == MB_SUCCESS)
-		{
-		if (pad == 1)
-			{
-			line[0] = 0;
-			checksum += line[0];
-			}
-		line[1] = 0x03;
-
-		/* set checksum */
-		mb_put_binary_short(swap, (unsigned short) checksum, (void *) &line[2]);
-
-		/* write out data */
-		write_len = 3+pad;
-		status = mb_fileio_put(verbose, mbio_ptr, &line[!pad], &write_len, error);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mbr_em710raw.c b/src/mbio/mbr_em710raw.c
deleted file mode 100644
index da9950f..0000000
--- a/src/mbio/mbr_em710raw.c
+++ /dev/null
@@ -1,10298 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbr_em710raw.c	2/26/2008
- *	$Id: mbr_em710raw.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 2008-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbr_em710raw.c contains the functions for reading and writing
- * multibeam data in the EM710RAW format.
- * These functions include:
- *   mbr_alm_em710raw	- allocate read/write memory
- *   mbr_dem_em710raw	- deallocate read/write memory
- *   mbr_rt_em710raw	- read and translate data
- *   mbr_wt_em710raw	- translate and write data
- *
- * Author:	D. W. Caress
- * Date:	February 26, 2008
- *
- * $Log: mbr_em710raw.c,v $
- * Revision 5.3  2009/03/02 18:51:52  caress
- * Fixed problems with formats 58 and 59, and also updated copyright dates in several source files.
- *
- * Revision 5.2  2008/11/16 21:51:18  caress
- * Updating all recent changes, including time lag analysis using mbeditviz and improvements to the mbgrid footprint gridding algorithm.
- *
- * Revision 5.1  2008/07/10 06:41:31  caress
- * Fixed support for EM122
- *
- * Revision 5.0  2008/03/01 09:11:35  caress
- * Added support for Simrad EM710 multibeam in new formats 58 and 59.
- *
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_define.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mbsys_simrad3.h"
-
-/* include for byte swapping */
-#include "mb_swap.h"
-
-/* get NaN detector */
-#if defined(isnanf)
-#define check_fnan(x) isnanf((x))
-#elif defined(isnan)
-#define check_fnan(x) isnan((double)(x))
-#elif HAVE_ISNANF == 1
-#define check_fnan(x) isnanf(x)
-extern int isnanf(float x);
-#elif HAVE_ISNAN == 1
-#define check_fnan(x) isnan((double)(x))
-#elif HAVE_ISNAND == 1
-#define check_fnan(x) isnand((double)(x))
-#else
-#define check_fnan(x) ((x) != (x))
-#endif
-
-/* set precision of iterative raytracing depth & distance matching */
-#define MBR_EM710RAW_BATH_RECALC_PRECISION 0.0001
-#define MBR_EM710RAW_BATH_RECALC_NCALCMAX 50
-#define MBR_EM710RAW_BATH_RECALC_ANGLEMODE 0
-
-/* control method of estimating range and angles for bathymetry recalculation
-	- by default the code solves for the angles and heave offsets that come
-	  close to matching the original reported bathymetry by raytracing through
-	  the original water sound speed model.
-	- if the define below is uncommented, then the code will instead adjust
-	  the angles and ranges to match the original bathymetry - this will
-	  generally achieve bathymetry closer to that reported by the sonar, but
-	  requires modifying the travel times (an unsavory and unsatisfactory
-	  approach). */
-/* #define MBR_EM710RAW_BATH_RECALC_TWEAK_ANGLE_RANGE 1 */
-
-/* turn on debug statements here */
-/* #define MBR_EM710RAW_DEBUG 1 */
-/* #define MBR_EM710RAW_DEBUG2 1 */
-/* #define MBR_EM710RAW_DEBUG3 1 */
-
-/* essential function prototypes */
-int mbr_register_em710raw(int verbose, void *mbio_ptr,
-		int *error);
-int mbr_info_em710raw(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_alm_em710raw(int verbose, void *mbio_ptr, int *error);
-int mbr_dem_em710raw(int verbose, void *mbio_ptr, int *error);
-int mbr_rt_em710raw(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_wt_em710raw(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_em710raw_rd_data(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_em710raw_chk_label(int verbose, void *mbio_ptr, char *label,
-		short *type, short *sonar);
-int mbr_em710raw_rd_status(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store,
-		short type, short sonar, int *goodend, int *error);
-int mbr_em710raw_rd_start(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store,
-		short type, short sonar, int *version, int *num_sonars,
-		int *goodend, int *error);
-int mbr_em710raw_rd_run_parameter(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store,
-		short sonar, int *goodend, int *error);
-int mbr_em710raw_rd_clock(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store,
-		short sonar, int *goodend, int *error);
-int mbr_em710raw_rd_tide(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store,
-		short sonar, int *goodend, int *error);
-int mbr_em710raw_rd_height(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store,
-		short sonar, int *goodend, int *error);
-int mbr_em710raw_rd_heading(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store,
-		short sonar, int *goodend, int *error);
-int mbr_em710raw_rd_ssv(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store,
-		short sonar, int *goodend, int *error);
-int mbr_em710raw_rd_tilt(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store,
-		short sonar, int *goodend, int *error);
-int mbr_em710raw_rd_extraparameters(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store,
-		short sonar, int *goodend, int *error);
-int mbr_em710raw_rd_attitude(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store,
-		short sonar, int *goodend, int *error);
-int mbr_em710raw_rd_netattitude(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store,
-		short sonar, int *goodend, int *error);
-int mbr_em710raw_rd_pos(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store,
-		short sonar, int *goodend, int *error);
-int mbr_em710raw_rd_svp(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store,
-		short sonar, int *goodend, int *error);
-int mbr_em710raw_rd_svp2(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store,
-		short sonar, int *goodend, int *error);
-int mbr_em710raw_rd_bath2(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store,
-		short sonar, int version, 
-		int *goodend, int *error);
-int mbr_em710raw_rd_rawbeam4(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store,
-		short sonar, int *goodend, int *error);
-int mbr_em710raw_rd_quality(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store,
-		short sonar, int *goodend, int *error);
-int mbr_em710raw_rd_ss2(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store,
-		short sonar,
-		int *goodend, int *error);
-int mbr_em710raw_rd_wc(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store,
-		short sonar, int *goodend, int *error);
-int mbr_em710raw_wr_data(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_em710raw_wr_status(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store, int *error);
-int mbr_em710raw_wr_start(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store, int *error);
-int mbr_em710raw_wr_run_parameter(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store, int *error);
-int mbr_em710raw_wr_clock(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store, int *error);
-int mbr_em710raw_wr_tide(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store, int *error);
-int mbr_em710raw_wr_height(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store, int *error);
-int mbr_em710raw_wr_heading(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store, int *error);
-int mbr_em710raw_wr_ssv(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store, int *error);
-int mbr_em710raw_wr_tilt(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store, int *error);
-int mbr_em710raw_wr_extraparameters(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store, int *error);
-int mbr_em710raw_wr_attitude(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store, int *error);
-int mbr_em710raw_wr_netattitude(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store, int *error);
-int mbr_em710raw_wr_pos(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store, int *error);
-int mbr_em710raw_wr_svp(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store, int *error);
-int mbr_em710raw_wr_svp2(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store, int *error);
-int mbr_em710raw_wr_bath2(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store, int *error);
-int mbr_em710raw_wr_rawbeam4(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store, int *error);
-int mbr_em710raw_wr_quality(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store, int *error);
-int mbr_em710raw_wr_ss2(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store, int *error);
-int mbr_em710raw_wr_wc(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store, int *error);
-
-static char rcs_id[]="$Id: mbr_em710raw.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mbr_register_em710raw(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_register_em710raw";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* get mb_io_ptr */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set format info parameters */
-	status = mbr_info_em710raw(verbose,
-			&mb_io_ptr->system,
-			&mb_io_ptr->beams_bath_max,
-			&mb_io_ptr->beams_amp_max,
-			&mb_io_ptr->pixels_ss_max,
-			mb_io_ptr->format_name,
-			mb_io_ptr->system_name,
-			mb_io_ptr->format_description,
-			&mb_io_ptr->numfile,
-			&mb_io_ptr->filetype,
-			&mb_io_ptr->variable_beams,
-			&mb_io_ptr->traveltime,
-			&mb_io_ptr->beam_flagging,
-			&mb_io_ptr->nav_source,
-			&mb_io_ptr->heading_source,
-			&mb_io_ptr->vru_source,
-			&mb_io_ptr->svp_source,
-			&mb_io_ptr->beamwidth_xtrack,
-			&mb_io_ptr->beamwidth_ltrack,
-			error);
-
-	/* set format and system specific function pointers */
-	mb_io_ptr->mb_io_format_alloc = &mbr_alm_em710raw;
-	mb_io_ptr->mb_io_format_free = &mbr_dem_em710raw;
-	mb_io_ptr->mb_io_store_alloc = &mbsys_simrad3_alloc;
-	mb_io_ptr->mb_io_store_free = &mbsys_simrad3_deall;
-	mb_io_ptr->mb_io_read_ping = &mbr_rt_em710raw;
-	mb_io_ptr->mb_io_write_ping = &mbr_wt_em710raw;
-	mb_io_ptr->mb_io_dimensions = &mbsys_simrad3_dimensions;
-	mb_io_ptr->mb_io_pingnumber = &mbsys_simrad3_pingnumber;
-	mb_io_ptr->mb_io_extract = &mbsys_simrad3_extract;
-	mb_io_ptr->mb_io_insert = &mbsys_simrad3_insert;
-	mb_io_ptr->mb_io_extract_nnav = &mbsys_simrad3_extract_nnav;
-	mb_io_ptr->mb_io_extract_nav = &mbsys_simrad3_extract_nav;
-	mb_io_ptr->mb_io_insert_nav = &mbsys_simrad3_insert_nav;
-	mb_io_ptr->mb_io_extract_altitude = &mbsys_simrad3_extract_altitude;
-	mb_io_ptr->mb_io_insert_altitude = NULL;
-	mb_io_ptr->mb_io_extract_svp = &mbsys_simrad3_extract_svp;
-	mb_io_ptr->mb_io_insert_svp = &mbsys_simrad3_insert_svp;
-	mb_io_ptr->mb_io_ttimes = &mbsys_simrad3_ttimes;
-	mb_io_ptr->mb_io_detects = &mbsys_simrad3_detects;
-	mb_io_ptr->mb_io_pulses = &mbsys_simrad3_pulses;
-	mb_io_ptr->mb_io_gains = &mbsys_simrad3_gains;
-	mb_io_ptr->mb_io_copyrecord = &mbsys_simrad3_copy;
-	mb_io_ptr->mb_io_extract_rawss = NULL;
-	mb_io_ptr->mb_io_insert_rawss = NULL;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",mb_io_ptr->system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",mb_io_ptr->beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",mb_io_ptr->beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",mb_io_ptr->pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",mb_io_ptr->format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",mb_io_ptr->system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",mb_io_ptr->format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",mb_io_ptr->numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",mb_io_ptr->filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",mb_io_ptr->variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",mb_io_ptr->traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",mb_io_ptr->beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",mb_io_ptr->nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",mb_io_ptr->heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",mb_io_ptr->vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",mb_io_ptr->svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",mb_io_ptr->beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",mb_io_ptr->beamwidth_ltrack);
-		fprintf(stderr,"dbg2       format_alloc:       %p\n",(void *)mb_io_ptr->mb_io_format_alloc);
-		fprintf(stderr,"dbg2       format_free:        %p\n",(void *)mb_io_ptr->mb_io_format_free);
-		fprintf(stderr,"dbg2       store_alloc:        %p\n",(void *)mb_io_ptr->mb_io_store_alloc);
-		fprintf(stderr,"dbg2       store_free:         %p\n",(void *)mb_io_ptr->mb_io_store_free);
-		fprintf(stderr,"dbg2       read_ping:          %p\n",(void *)mb_io_ptr->mb_io_read_ping);
-		fprintf(stderr,"dbg2       write_ping:         %p\n",(void *)mb_io_ptr->mb_io_write_ping);
-		fprintf(stderr,"dbg2       extract:            %p\n",(void *)mb_io_ptr->mb_io_extract);
-		fprintf(stderr,"dbg2       insert:             %p\n",(void *)mb_io_ptr->mb_io_insert);
-		fprintf(stderr,"dbg2       extract_nav:        %p\n",(void *)mb_io_ptr->mb_io_extract_nav);
-		fprintf(stderr,"dbg2       insert_nav:         %p\n",(void *)mb_io_ptr->mb_io_insert_nav);
-		fprintf(stderr,"dbg2       extract_altitude:   %p\n",(void *)mb_io_ptr->mb_io_extract_altitude);
-		fprintf(stderr,"dbg2       insert_altitude:    %p\n",(void *)mb_io_ptr->mb_io_insert_altitude);
-		fprintf(stderr,"dbg2       extract_svp:        %p\n",(void *)mb_io_ptr->mb_io_extract_svp);
-		fprintf(stderr,"dbg2       insert_svp:         %p\n",(void *)mb_io_ptr->mb_io_insert_svp);
-		fprintf(stderr,"dbg2       ttimes:             %p\n",(void *)mb_io_ptr->mb_io_ttimes);
-		fprintf(stderr,"dbg2       detects:            %p\n",(void *)mb_io_ptr->mb_io_detects);
-		fprintf(stderr,"dbg2       pulses:             %p\n",(void *)mb_io_ptr->mb_io_pulses);
-		fprintf(stderr,"dbg2       extract_rawss:      %p\n",(void *)mb_io_ptr->mb_io_extract_rawss);
-		fprintf(stderr,"dbg2       insert_rawss:       %p\n",(void *)mb_io_ptr->mb_io_insert_rawss);
-		fprintf(stderr,"dbg2       copyrecord:         %p\n",(void *)mb_io_ptr->mb_io_copyrecord);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbr_info_em710raw(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error)
-{
-	char	*function_name = "mbr_info_em710raw";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* set format info parameters */
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-	*system = MB_SYS_SIMRAD3;
-	*beams_bath_max = 400;
-	*beams_amp_max = 400;
-	*pixels_ss_max = 1024;
-	strncpy(format_name, "EM710RAW", MB_NAME_LENGTH);
-	strncpy(system_name, "SIMRAD3", MB_NAME_LENGTH);
-	strncpy(format_description, "Format name:          MBF_EM710RAW\nInformal Description: Kongsberg current multibeam vendor format\nAttributes:           Kongsberg EM122, EM302, EM710,\n                      bathymetry, amplitude, and sidescan,\n                      up to 400 beams, variable pixels, binary, Kongsberg.\n", MB_DESCRIPTION_LENGTH);
-	*numfile = 1;
-	*filetype = MB_FILETYPE_SINGLE;
-	*variable_beams = MB_YES;
-	*traveltime = MB_YES;
-	*beam_flagging = MB_NO;
-	*nav_source = MB_DATA_NAV;
-	*heading_source = MB_DATA_DATA;
-	*vru_source = MB_DATA_ATTITUDE;
-	*svp_source = MB_DATA_VELOCITY_PROFILE;
-	*beamwidth_xtrack = 2.0;
-	*beamwidth_ltrack = 2.0;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",*system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",*beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",*beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",*pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",*numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",*filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",*variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",*traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",*beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",*nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",*heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",*vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",*svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",*beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",*beamwidth_ltrack);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_alm_em710raw(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_alm_em710raw";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	int	*databyteswapped;
-	double	*pixel_size;
-	double	*swath_width;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set initial status */
-	status = MB_SUCCESS;
-
-	/* allocate memory for data structure */
-	mb_io_ptr->structure_size = 0;
-	mb_io_ptr->data_structure_size = 0;
-	status = mbsys_simrad3_alloc(
-			verbose,mbio_ptr,
-			&mb_io_ptr->store_data,error);
-
-	/* initialize saved values */
-	databyteswapped = (int *) &mb_io_ptr->save1;
-	pixel_size = &mb_io_ptr->saved1;
-	swath_width = &mb_io_ptr->saved2;
-	*databyteswapped = -1;
-	*pixel_size = 0.0;
-	*swath_width = 0.0;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_dem_em710raw(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_dem_em710raw";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointers to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* deallocate memory for data descriptor */
-	status = mbsys_simrad3_deall(
-			verbose,mbio_ptr,
-			&mb_io_ptr->store_data,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_rt_em710raw(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_rt_em710raw";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_simrad3_struct *store;
-	struct mbsys_simrad3_attitude_struct *attitude;
-	struct mbsys_simrad3_netattitude_struct *netattitude;
-	struct mbsys_simrad3_heading_struct *heading;
-	struct mbsys_simrad3_ssv_struct *ssv;
-	struct mbsys_simrad3_ping_struct *ping;
-	int	time_i[7];
-	double	ntime_d, ptime_d, atime_d, btime_d;
-	double	bath_time_d, ss_time_d;
-	double	rawspeed, pheading;
-	double	plon, plat, pspeed, roll, pitch, heave;
-	double	soundspeed;
-	double	transmit_alongtrack;
-	double	theta_nadir;
-	int	inadir;
-	double	att_time_d[MBSYS_SIMRAD3_MAXATTITUDE];
-	double	att_roll[MBSYS_SIMRAD3_MAXATTITUDE];
-	double	att_pitch[MBSYS_SIMRAD3_MAXATTITUDE];
-	double	att_heave[MBSYS_SIMRAD3_MAXATTITUDE];
-	
-	double	transmit_time_d, transmit_heading, transmit_heave, transmit_roll, transmit_pitch;
-	double	receive_time_d, receive_heading, receive_heave, receive_roll, receive_pitch;
-	
-	/* transmit and receive array offsets */
-	double	tx_x, tx_y, tx_z, tx_h, tx_r, tx_p;
-	double	rx_x, rx_y, rx_z, rx_h, rx_r, rx_p;
-	
-	/* roll and pitch sensor offsets */
-	double	rollpitch_off_x, rollpitch_off_y, rollpitch_off_z, rollpitch_off_h, rollpitch_off_r, rollpitch_off_p;
-	
-	/* heave sensor offsets */
-	double	heave_off_x, heave_off_y, heave_off_z, heave_off_h, heave_off_r, heave_off_p;
-	
-	/* heading sensor offset */
-	double	heading_off_x, heading_off_y, heading_off_z, heading_off_h, heading_off_r, heading_off_p;
-	
-	/* position sensor offsets */
-	double	position_off_x, position_off_y, position_off_z;
-	
-	/* variables for beam angle calculation */
-	mb_3D_orientation tx_align;
-	mb_3D_orientation tx_orientation;
-	double tx_steer;
-	mb_3D_orientation rx_align;
-	mb_3D_orientation rx_orientation;
-	double rx_steer;
-	double reference_heading;
-	double beamAzimuth;
-	double beamDepression;
-	double	*pixel_size, *swath_width;
-	mb_u_char detection_mask;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointers to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* read next data from file */
-	status = mbr_em710raw_rd_data(verbose,mbio_ptr,store_ptr,error);
-
-	/* get pointers to data structures */
-	store = (struct mbsys_simrad3_struct *) store_ptr;
-	ping = (struct mbsys_simrad3_ping_struct *) &(store->pings[store->ping_index]);
-	attitude = (struct mbsys_simrad3_attitude_struct *) store->attitude;
-	netattitude = (struct mbsys_simrad3_netattitude_struct *) store->netattitude;
-	heading = (struct mbsys_simrad3_heading_struct *) store->heading;
-	ssv = (struct mbsys_simrad3_ssv_struct *) store->ssv;
-	pixel_size = (double *) &mb_io_ptr->saved1;
-	swath_width = (double *) &mb_io_ptr->saved2;
-
-	/* save fix and heading if nav data */
-	if (status == MB_SUCCESS
-		&& store->kind == MB_DATA_NAV)
-		{
-		/* get nav time */
-		time_i[0] = store->pos_date / 10000;
-		time_i[1] = (store->pos_date % 10000) / 100;
-		time_i[2] = store->pos_date % 100;
-		time_i[3] = store->pos_msec / 3600000;
-		time_i[4] = (store->pos_msec % 3600000) / 60000;
-		time_i[5] = (store->pos_msec % 60000) / 1000;
-		time_i[6] = (store->pos_msec % 1000) * 1000;
-		mb_get_time(verbose, time_i, &ntime_d);
-
-		/* add latest fix */
-		if (store->pos_longitude != EM3_INVALID_INT
-			&& store->pos_latitude != EM3_INVALID_INT)
-			mb_navint_add(verbose, mbio_ptr,
-				ntime_d,
-				(double)(0.0000001 * store->pos_longitude),
-				(double)(0.00000005 * store->pos_latitude),
-				error);
-
-		/* add latest heading */
-		if (store->pos_heading != EM3_INVALID_INT)
-			mb_hedint_add(verbose, mbio_ptr,
-				ntime_d,
-				(double)(0.01 * store->pos_heading),
-				error);
-		}
-
-	/* save attitude if "active" attitude data
-		- note that the mb_io_ptr->vru_source value will be set dynamically
-			to reflect the actual attitude source used in realtime
-			by the sonar.
-		- attitude records from the sensors are
-			set at kinds MB_DATA_ATTITUDE (serial port 1),
-			MB_DATA_ATTITUDE1 (serial port 2),
-			or MB_DATA_ATTITUDE2 (network attitude). */
-	if (status == MB_SUCCESS
-		&& store->type == EM3_ATTITUDE)
-		{
-		/* save for interpolation if this record comes
-			from the active attitude sensor */
-		if ((attitude->att_sensordescriptor & 14) == 0)
-			{
-			/* set the vru_source */
-			mb_io_ptr->vru_source = store->kind;
-
-			/* get attitude time */
-			time_i[0] = attitude->att_date / 10000;
-			time_i[1] = (attitude->att_date % 10000) / 100;
-			time_i[2] = attitude->att_date % 100;
-			time_i[3] = attitude->att_msec / 3600000;
-			time_i[4] = (attitude->att_msec % 3600000) / 60000;
-			time_i[5] = (attitude->att_msec % 60000) / 1000;
-			time_i[6] = (attitude->att_msec % 1000) * 1000;
-			mb_get_time(verbose, time_i, &atime_d);
-
-			/* add latest attitude samples */
-			attitude->att_ndata = MIN(attitude->att_ndata,MBSYS_SIMRAD3_MAXATTITUDE);
-			for (i=0;i<attitude->att_ndata;i++)
-				{
-				att_time_d[i] = (double)(atime_d + 0.001 * attitude->att_time[i]);
-				att_heave[i] = (double)(0.01 * attitude->att_heave[i]);
-				att_roll[i] = (double)(0.01 * attitude->att_roll[i]);
-				att_pitch[i] = (double)(0.01 * attitude->att_pitch[i]);
-				}
-			mb_attint_nadd(verbose, mbio_ptr,
-					attitude->att_ndata,att_time_d,att_heave,att_roll,att_pitch,
-					error);
-			}
-
-		/* else this record is not from the active vru sensor
-			- make sure the vru_source does not point to this sensor */
-		else if (mb_io_ptr->vru_source == store->kind)
-			{
-			if (store->kind == MB_DATA_ATTITUDE)
-				mb_io_ptr->vru_source = MB_DATA_ATTITUDE1;
-			else
-				mb_io_ptr->vru_source = MB_DATA_ATTITUDE;
-			}
-		}
-
-	/* save netattitude if "active" attitude data
-		- note that the mb_io_ptr->vru_source value will be set dynamically
-			to reflect the actual attitude source used in realtime
-			by the sonar.
-		- attitude records from the sensors are
-			set at kinds MB_DATA_ATTITUDE (serial port 1),
-			MB_DATA_ATTITUDE1 (serial port 2),
-			or MB_DATA_ATTITUDE2 (network attitude). */
-	if (status == MB_SUCCESS
-		&& store->type == EM3_NETATTITUDE)
-		{
-		/* save for interpolation if this record comes
-			from the active attitude sensor */
-		if ((netattitude->nat_sensordescriptor & 14) == 0)
-			{
-			/* set the vru_source */
-			mb_io_ptr->vru_source = store->kind;
-
-			/* get attitude time */
-			time_i[0] = netattitude->nat_date / 10000;
-			time_i[1] = (netattitude->nat_date % 10000) / 100;
-			time_i[2] = netattitude->nat_date % 100;
-			time_i[3] = netattitude->nat_msec / 3600000;
-			time_i[4] = (netattitude->nat_msec % 3600000) / 60000;
-			time_i[5] = (netattitude->nat_msec % 60000) / 1000;
-			time_i[6] = (netattitude->nat_msec % 1000) * 1000;
-			mb_get_time(verbose, time_i, &atime_d);
-
-			/* add latest attitude samples */
-			netattitude->nat_ndata = MIN(netattitude->nat_ndata,MBSYS_SIMRAD3_MAXATTITUDE);
-			for (i=0;i<netattitude->nat_ndata;i++)
-				{
-				att_time_d[i] = (double)(atime_d + 0.001 * netattitude->nat_time[i]);
-				att_heave[i] = (double)(0.01 * netattitude->nat_heave[i]);
-				att_roll[i] = (double)(0.01 * netattitude->nat_roll[i]);
-				att_pitch[i] = (double)(0.01 * netattitude->nat_pitch[i]);
-				}
-			mb_attint_nadd(verbose, mbio_ptr,
-					netattitude->nat_ndata,att_time_d,att_heave,att_roll,att_pitch,
-					error);
-			}
-
-		/* else this record is not from the active vru sensor
-			- make sure the vru_source does not point to this sensor */
-		else if (mb_io_ptr->vru_source == store->kind)
-			{
-			mb_io_ptr->vru_source = MB_DATA_ATTITUDE;
-			}
-		}
-
-	/* save sonar depth value if survey data */
-	if (status == MB_SUCCESS
-		&& store->kind == MB_DATA_DATA)
-		{
-		time_i[0] = ping->png_date / 10000;
-		time_i[1] = (ping->png_date % 10000) / 100;
-		time_i[2] = ping->png_date % 100;
-		time_i[3] = ping->png_msec / 3600000;
-		time_i[4] = (ping->png_msec % 3600000) / 60000;
-		time_i[5] = (ping->png_msec % 60000) / 1000;
-		time_i[6] = (ping->png_msec % 1000) * 1000;
-		mb_get_time(verbose, time_i, &btime_d);
-		mb_depint_add(verbose, mbio_ptr,
-				btime_d,(double)ping->png_xducer_depth,
-				error);
-		}
-
-	/* interpolate attitude data into navigation records */
-	if (status == MB_SUCCESS
-		&& (store->kind == MB_DATA_NAV
-			|| store->kind == MB_DATA_NAV1
-			|| store->kind == MB_DATA_NAV2
-			|| store->kind == MB_DATA_NAV3))
-		{
-		/* get nav time */
-		time_i[0] = store->pos_date / 10000;
-		time_i[1] = (store->pos_date % 10000) / 100;
-		time_i[2] = store->pos_date % 100;
-		time_i[3] = store->pos_msec / 3600000;
-		time_i[4] = (store->pos_msec % 3600000) / 60000;
-		time_i[5] = (store->pos_msec % 60000) / 1000;
-		time_i[6] = (store->pos_msec % 1000) * 1000;
-		mb_get_time(verbose, time_i, &ntime_d);
-
-		/* interpolate from saved attitude */
-		mb_attint_interp(verbose, mbio_ptr, ntime_d,
-				    &heave, &roll, &pitch, error);
-		store->pos_roll = (int) rint(roll / 0.01);
-		store->pos_pitch = (int) rint(pitch / 0.01);
-		store->pos_heave = (int) rint(heave / 0.01);
-		}
-
-	/* if no sidescan read then zero sidescan data */
-	if (status == MB_SUCCESS
-		&& store->kind == MB_DATA_DATA
-		&& ping->png_ss_read == MB_NO)
-		{
-		status = mbsys_simrad3_zero_ss(verbose,store_ptr,error);
-		}
-
-	/* else check that bath and sidescan data record time stamps
-	   match for survey data - we can have bath without
-	   sidescan but not sidescan without bath */
-	else if (status == MB_SUCCESS
-		&& store->kind == MB_DATA_DATA)
-		{
-		/* get times of bath and sidescan records */
-		time_i[0] = ping->png_date / 10000;
-		time_i[1] = (ping->png_date % 10000) / 100;
-		time_i[2] = ping->png_date % 100;
-		time_i[3] = ping->png_msec / 3600000;
-		time_i[4] = (ping->png_msec % 3600000) / 60000;
-		time_i[5] = (ping->png_msec % 60000) / 1000;
-		time_i[6] = (ping->png_msec % 1000) * 1000;
-		mb_get_time(verbose, time_i, &bath_time_d);
-		time_i[0] = ping->png_ss_date / 10000;
-		time_i[1] = (ping->png_ss_date % 10000) / 100;
-		time_i[2] = ping->png_ss_date % 100;
-		time_i[3] = ping->png_ss_msec / 3600000;
-		time_i[4] = (ping->png_ss_msec % 3600000) / 60000;
-		time_i[5] = (ping->png_ss_msec % 60000) / 1000;
-		time_i[6] = (ping->png_ss_msec % 1000) * 1000;
-		mb_get_time(verbose, time_i, &ss_time_d);
-/* fprintf(stderr,"Check: png_count:%d png_raw_count:%d png_ss_count:%d    Beams:%d %d %d\n",
-ping->png_count,ping->png_raw_count,ping->png_ss_count,ping->png_nbeams,ping->png_raw_nbeams,ping->png_nbeams_ss);*/
-
-		/* check for time match - if bath newer than
-		   sidescan then zero sidescan,  if sidescan
-		   newer than bath then set error,  if ok then
-		   check that beam ids are the same */
-		if (ping->png_ss_date == 0
-			|| ping->png_nbeams_ss == 0)
-		    {
-		    status = mbsys_simrad3_zero_ss(verbose,store_ptr,error);
-		    }
-		else if (fabs(bath_time_d - ss_time_d) > 0.002)
-		    {
-		    if (verbose > 0)
-		    	fprintf(stderr,"%s: %4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d Sidescan zeroed, bathtime:%f != sstime:%f\n",
-				function_name, time_i[0], time_i[1], time_i[2],
-					time_i[3], time_i[4], time_i[5], time_i[6],
-					bath_time_d, ss_time_d);
-		    status = mbsys_simrad3_zero_ss(verbose,store_ptr,error);
-		    }
-		else
-		    {
-		    /* check for some indicators of broken records */
-		    if (ping->png_nbeams < ping->png_nbeams_ss
-			|| ping->png_nbeams > ping->png_nbeams_ss + 1)
-			{
-		    	if (verbose > 1)
-			    	fprintf(stderr,"%s: %4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d Sidescan ignored: num bath beams != num ss beams: %d %d\n",
-					function_name, time_i[0], time_i[1], time_i[2],
-					time_i[3], time_i[4], time_i[5], time_i[6],
-					ping->png_nbeams, ping->png_nbeams_ss);
-			}
-		    }
-		}
-
-	/* add some calculated data to survey records */
-	if (status == MB_SUCCESS
-		&& store->kind == MB_DATA_DATA)
-		{
-/*fprintf(stderr, "mode:%d absorption:%d tran_pulse:%d tran_beam:%d tran_pow:%d rec_beam:%d rec_band:%d rec_gain:%d tvg_cross:%d\n",
-store->run_mode, store->run_absorption,
-store->run_tran_pulse, store->run_tran_pow,
-store->run_rec_beam, store->run_rec_band,
-store->run_rec_gain, store->run_tvg_cross);
-fprintf(stderr, "max_range:%d r_zero:%d r_zero_corr:%d tvg_start:%d tvg_stop:%d bsn:%d bso:%d tx:%d tvg_crossover:%d\n",
-ping->png_max_range, ping->png_r_zero,
-ping->png_r_zero_corr, ping->png_tvg_start,
-ping->png_tvg_stop, ping->png_bsn,
-ping->png_bso, ping->png_tx,
-ping->png_tvg_crossover);
-fprintf(stderr, "mode:%d depth:%11f max_range:%d r_zero:%d r_zero_corr:%d bsn:%d bso:%d\n",
-store->run_mode,
-0.01 * ping->png_depth_res * ping->png_depth[ping->png_nbeams/2],
-ping->png_max_range, ping->png_r_zero,
-ping->png_r_zero_corr, ping->png_bsn,
-ping->png_bso);*/
-			
-		/* get transducer offsets */
-		if (store->par_stc == 0)
-			{
-			tx_x = store->par_s1x;
-			tx_y = store->par_s1y;
-			tx_z = store->par_s1z;
-			tx_h = store->par_s1h;
-			tx_r = store->par_s1r;
-			tx_p = store->par_s1p;
-			rx_x = store->par_s2x;
-			rx_y = store->par_s2y;
-			rx_z = store->par_s2z;
-			rx_h = store->par_s2h;
-			rx_r = store->par_s2r;
-			rx_p = store->par_s2p;
-			}
-		else if (store->par_stc == 1)
-			{
-			tx_x = store->par_s1x;
-			tx_y = store->par_s1y;
-			tx_z = store->par_s1z;
-			tx_h = store->par_s1h;
-			tx_r = store->par_s1r;
-			tx_p = store->par_s1p;
-			rx_x = store->par_s1x;
-			rx_y = store->par_s1y;
-			rx_z = store->par_s1z;
-			rx_h = store->par_s1h;
-			rx_r = store->par_s1r;
-			rx_p = store->par_s1p;
-			}
-		else if (store->par_stc == 2 && ping->png_serial == store->par_serial_1)
-			{
-			tx_x = store->par_s1x;
-			tx_y = store->par_s1y;
-			tx_z = store->par_s1z;
-			tx_h = store->par_s1h;
-			tx_r = store->par_s1r;
-			tx_p = store->par_s1p;
-			rx_x = store->par_s1x;
-			rx_y = store->par_s1y;
-			rx_z = store->par_s1z;
-			rx_h = store->par_s1h;
-			rx_r = store->par_s1r;
-			rx_p = store->par_s1p;
-			}
-		else if (store->par_stc == 2 && ping->png_serial == store->par_serial_2)
-			{
-			tx_x = store->par_s2x;
-			tx_y = store->par_s2y;
-			tx_z = store->par_s2z;
-			tx_h = store->par_s2h;
-			tx_r = store->par_s2r;
-			tx_p = store->par_s2p;
-			rx_x = store->par_s2x;
-			rx_y = store->par_s2y;
-			rx_z = store->par_s2z;
-			rx_h = store->par_s2h;
-			rx_r = store->par_s2r;
-			rx_p = store->par_s2p;
-			}
-		else if (store->par_stc == 3 && ping->png_serial == store->par_serial_1)
-			{
-			tx_x = store->par_s1x;
-			tx_y = store->par_s1y;
-			tx_z = store->par_s1z;
-			tx_h = store->par_s1h;
-			tx_r = store->par_s1r;
-			tx_p = store->par_s1p;
-			rx_x = store->par_s2x;
-			rx_y = store->par_s2y;
-			rx_z = store->par_s2z;
-			rx_h = store->par_s2h;
-			rx_r = store->par_s2r;
-			rx_p = store->par_s2p;
-			}
-		else if (store->par_stc == 3 && ping->png_serial == store->par_serial_2)
-			{
-			tx_x = store->par_s1x;
-			tx_y = store->par_s1y;
-			tx_z = store->par_s1z;
-			tx_h = store->par_s1h;
-			tx_r = store->par_s1r;
-			tx_p = store->par_s1p;
-			rx_x = store->par_s3x;
-			rx_y = store->par_s3y;
-			rx_z = store->par_s3z;
-			rx_h = store->par_s3h;
-			rx_r = store->par_s3r;
-			rx_p = store->par_s3p;
-			}
-		else if (store->par_stc == 4 && ping->png_serial == store->par_serial_1)
-			{
-			tx_x = store->par_s0x;
-			tx_y = store->par_s0y;
-			tx_z = store->par_s0z;
-			tx_h = store->par_s0h;
-			tx_r = store->par_s0r;
-			tx_p = store->par_s0p;
-			rx_x = store->par_s2x;
-			rx_y = store->par_s2y;
-			rx_z = store->par_s2z;
-			rx_h = store->par_s2h;
-			rx_r = store->par_s2r;
-			rx_p = store->par_s2p;
-			}
-		else if (store->par_stc == 4 && ping->png_serial == store->par_serial_2)
-			{
-			tx_x = store->par_s1x;
-			tx_y = store->par_s1y;
-			tx_z = store->par_s1z;
-			tx_h = store->par_s1h;
-			tx_r = store->par_s1r;
-			tx_p = store->par_s1p;
-			rx_x = store->par_s3x;
-			rx_y = store->par_s3y;
-			rx_z = store->par_s3z;
-			rx_h = store->par_s3h;
-			rx_r = store->par_s3r;
-			rx_p = store->par_s3p;
-			}
-			
-		/* get active sensor offsets */
-		if (store->par_aps == 0)
-			{
-			position_off_x = store->par_p1x;
-			position_off_y = store->par_p1y;
-			position_off_z = store->par_p1z;
-			}
-		else if (store->par_aps == 1)
-			{
-			position_off_x = store->par_p2x;
-			position_off_y = store->par_p2y;
-			position_off_z = store->par_p2z;
-			}
-		else if (store->par_aps == 2)
-			{
-			position_off_x = store->par_p3x;
-			position_off_y = store->par_p3y;
-			position_off_z = store->par_p3z;
-			}
-		if (store->par_aro == 2)
-			{
-			rollpitch_off_x = store->par_msx;
-			rollpitch_off_y = store->par_msy;
-			rollpitch_off_z = store->par_msz;
-			rollpitch_off_h = store->par_msg;
-			rollpitch_off_r = store->par_msr;
-			rollpitch_off_p = store->par_msp;
-			}
-		else if (store->par_aro == 3)
-			{
-			rollpitch_off_x = store->par_nsx;
-			rollpitch_off_y = store->par_nsy;
-			rollpitch_off_z = store->par_nsz;
-			rollpitch_off_h = store->par_nsg;
-			rollpitch_off_r = store->par_nsr;
-			rollpitch_off_p = store->par_nsp;
-			}
-		if (store->par_ahe == 2)
-			{
-			heave_off_x = store->par_msx;
-			heave_off_y = store->par_msy;
-			heave_off_z = store->par_msz;
-			heave_off_h = store->par_msg;
-			heave_off_r = store->par_msr;
-			heave_off_p = store->par_msp;
-			}
-		else if (store->par_ahe == 3)
-			{
-			heave_off_x = store->par_nsx;
-			heave_off_y = store->par_nsy;
-			heave_off_z = store->par_nsz;
-			heave_off_h = store->par_nsg;
-			heave_off_r = store->par_nsr;
-			heave_off_p = store->par_nsp;
-			}
-		if (store->par_ahs == 0 || store->par_ahs == 4)
-			{
-			heading_off_x = store->par_p3x;
-			heading_off_y = store->par_p3y;
-			heading_off_z = store->par_p3z;
-			heading_off_h = store->par_gcg;
-			heading_off_r = 0.0;
-			heading_off_p = 0.0;
-			}
-		else if (store->par_ahs == 1)
-			{
-			heading_off_x = store->par_p1x;
-			heading_off_y = store->par_p1y;
-			heading_off_z = store->par_p1z;
-			heading_off_h = store->par_gcg;
-			heading_off_r = 0.0;
-			heading_off_p = 0.0;
-			}
-		else if (store->par_ahs == 2)
-			{
-			heading_off_x = store->par_msx;
-			heading_off_y = store->par_msy;
-			heading_off_z = store->par_msz;
-			heading_off_h = store->par_msg + store->par_gcg;
-			heading_off_r = store->par_msr;
-			heading_off_p = store->par_msp;
-			}
-		else if (store->par_ahs == 3 && store->par_nsz != 0.0)
-			{
-			heading_off_x = store->par_nsx;
-			heading_off_y = store->par_nsy;
-			heading_off_z = store->par_nsz;
-			heading_off_h = store->par_nsg + store->par_gcg;
-			heading_off_r = store->par_nsr;
-			heading_off_p = store->par_nsp;
-			}
-		else if (store->par_ahs == 3)
-			{
-			heading_off_x = store->par_p2x;
-			heading_off_y = store->par_p2y;
-			heading_off_z = store->par_p2z;
-			heading_off_h = store->par_gcg;
-			heading_off_r = 0.0;
-			heading_off_p = 0.0;
-			}
-
-		/* get ping time */
-		time_i[0] = ping->png_date / 10000;
-		time_i[1] = (ping->png_date % 10000) / 100;
-		time_i[2] = ping->png_date % 100;
-		time_i[3] = ping->png_msec / 3600000;
-		time_i[4] = (ping->png_msec % 3600000) / 60000;
-		time_i[5] = (ping->png_msec % 60000) / 1000;
-		time_i[6] = (ping->png_msec % 1000) * 1000;
-		mb_get_time(verbose, time_i, &ptime_d);
-
-		/* interpolate from saved nav */
-		if (store->pos_speed == 0
-		    || store->pos_speed == EM3_INVALID_SHORT)
-			rawspeed = 0.0;
-		else
-			rawspeed =  0.036 * store->pos_speed;
-		pheading = 0.01 * ping->png_heading;
-		mb_navint_interp(verbose, mbio_ptr, ptime_d, pheading, rawspeed,
-				    &plon, &plat, &pspeed, error);
-		if (plon == 0.0
-		    && plat == 0.0)
-		    {
-		    ping->png_longitude = (int) EM3_INVALID_INT;
-		    ping->png_latitude = (int) EM3_INVALID_INT;
-		    }
-		else
-		    {
-		    ping->png_longitude = (int) rint(10000000 * plon);
-		    ping->png_latitude =  (int) rint(20000000 * plat);
-		    }
-		ping->png_speed = (int) rint(pspeed / 0.036);
-
-		/* interpolate from saved attitude */
-		mb_attint_interp(verbose, mbio_ptr, ptime_d,
-				    &heave, &roll, &pitch, error);
-		ping->png_roll = (int) rint(roll / 0.01);
-		ping->png_pitch = (int) rint(pitch / 0.01);
-		ping->png_heave = (int) rint(heave / 0.01);
-
-		/* make first cut at angles */
-		/* calculate corrected ranges, angles, and bathymetry */
-		theta_nadir = 90.0;
-		inadir = 0;
-		for (i=0;i<ping->png_nbeams;i++)
-			{
-			/* calculate time of transmit and receive */
-			transmit_time_d = ptime_d + (double) ping->png_raw_txoffset[ping->png_raw_rxsector[i]];
-			receive_time_d = transmit_time_d + ping->png_raw_rxrange[i];
-
-			/* get attitude and heave at ping and receive time */
-			mb_hedint_interp(verbose, mbio_ptr, transmit_time_d,
-				    		&transmit_heading, error);
-			mb_attint_interp(verbose, mbio_ptr, transmit_time_d,
-				    		&transmit_heave, &transmit_roll, &transmit_pitch, error);
-			mb_hedint_interp(verbose, mbio_ptr, receive_time_d,
-				    		&receive_heading, error);
-			mb_attint_interp(verbose, mbio_ptr, receive_time_d,
-				    		&receive_heave, &receive_roll, &receive_pitch, error);
-
-			/* alongtrack offset distance */
-			transmit_alongtrack = (0.01 * ((double)ping->png_speed))
-						* ((double) ping->png_raw_txoffset[ping->png_raw_rxsector[i]]);
-
-			/* get corrected range */
-			if (ping->png_ssv <= 0)
-				ping->png_ssv = 150;
-			soundspeed = 0.1 * ((double)ping->png_ssv);
-			ping->png_range[i] = ping->png_raw_rxrange[i];
-			/* ping->png_bheave[i] is the difference between the heave at the ping timestamp time that is factored
-			 * into the ping->png_xducer_depth value and the average heave at the sector transmit time and the beam receive time */
-			ping->png_bheave[i] = 0.5 *(receive_heave + transmit_heave) - heave;
-
-			/* calculate beam angles for raytracing using Jon Beaudoin's code based on:
-				Beaudoin, J., Hughes Clarke, J., and Bartlett, J. Application of
-				Surface Sound Speed Measurements in Post-Processing for Multi-Sector
-				Multibeam Echosounders : International Hydrographic Review, v.5, no.3,
-				p.26-31.
-				(http://www.omg.unb.ca/omg/papers/beaudoin_IHR_nov2004.pdf).
-			   note complexity if transducer arrays are reverse mounted, as determined
-			   by a mount heading angle of about 180 degrees rather than about 0 degrees.
-			   If a receive array or a transmit array are reverse mounted then:
-				1) subtract 180 from the heading mount angle of the array
-				2) flip the sign of the pitch and roll mount offsets of the array
-				3) flip the sign of the beam steering angle from that array
-					(reverse TX means flip sign of TX steer, reverse RX
-					means flip sign of RX steer) */
-			if (tx_h <= 90.0 || tx_h >= 270.0)
-				{
-				tx_align.roll = tx_r;
-				tx_align.pitch = tx_p;
-				tx_align.heading = tx_h;
-				tx_steer = (0.01 * (double)ping->png_raw_txtiltangle[ping->png_raw_rxsector[i]]);
-				}
-			else
-				{
-				tx_align.roll = -tx_r;
-				tx_align.pitch = -tx_p;
-				tx_align.heading = tx_h - 180.0;
-				tx_steer = -(0.01 * (double)ping->png_raw_txtiltangle[ping->png_raw_rxsector[i]]);
-				}
-			tx_orientation.roll = transmit_roll;
-			tx_orientation.pitch = transmit_pitch;
-			tx_orientation.heading = transmit_heading;
-			if (rx_h <= 90.0 || rx_h >= 270.0)
-				{
-				rx_align.roll = rx_r;
-				rx_align.pitch = rx_p;
-				rx_align.heading = rx_h;
-				rx_steer = (0.01 * (double)ping->png_raw_rxpointangle[i]);
-				}
-			else
-				{
-				rx_align.roll = -rx_r;
-				rx_align.pitch = -rx_p;
-				rx_align.heading = rx_h - 180.0;
-				rx_steer = -(0.01 * (double)ping->png_raw_rxpointangle[i]);
-				}
-			rx_orientation.roll = receive_roll;
-			rx_orientation.pitch = receive_pitch;
-			rx_orientation.heading = receive_heading;
-			reference_heading = pheading;
-
-			status = mb_beaudoin(verbose,
-						tx_align,
-						tx_orientation,
-						tx_steer,
-						rx_align,
-						rx_orientation,
-						rx_steer,
-						reference_heading,
-						&beamAzimuth,
-						&beamDepression,
-						error);
-			ping->png_depression[i] = 90.0 - beamDepression;
-			ping->png_azimuth[i] = 90.0 + beamAzimuth;
-			if (ping->png_azimuth[i] < 0.0)
-				ping->png_azimuth[i] += 360.0;
-/* fprintf(stderr,"i:%d %f %f     %f %f\n",
-i,beamDepression,beamAzimuth,ping->png_depression[i],ping->png_azimuth[i]);*/
-
-			/* calculate beamflag */
-			detection_mask = (mb_u_char) ping->png_raw_rxdetection[i];
-			if (store->sonar == MBSYS_SIMRAD3_M3 && (ping->png_detection[i] & 128) == 128)
-				{
-				ping->png_beamflag[i] = MB_FLAG_NULL;
-				ping->png_raw_rxdetection[i] = ping->png_raw_rxdetection[i] | 128;
-				}
-			else if ((detection_mask & 128) == 128 && (detection_mask & 112) != 0)
-				{
-				ping->png_beamflag[i] = MB_FLAG_NULL;
-/* fprintf(stderr,"beam i:%d detection_mask:%d %d quality:%u beamflag:%u\n",
-i,ping->png_raw_rxdetection[i],detection_mask,(mb_u_char)ping->png_raw_rxquality[i],(mb_u_char)ping->png_beamflag[i]);*/
-				}
-			else if ((detection_mask & 128) == 128)
-				{
-				ping->png_beamflag[i] = MB_FLAG_FLAG + MB_FLAG_SONAR;
-/*fprintf(stderr,"beam i:%d detection_mask:%d %d quality:%u beamflag:%u\n",
-i,ping->png_raw_rxdetection[i],detection_mask,(mb_u_char)ping->png_raw_rxquality[i],(mb_u_char)ping->png_beamflag[i]);*/
-				}
-			else if (ping->png_clean[i] != 0)
-				{
-				ping->png_beamflag[i] = MB_FLAG_FLAG + MB_FLAG_SONAR;
-				}
-			else
-				{
-				ping->png_beamflag[i] = MB_FLAG_NONE;
-				}
-				
-			/* check for NaN value */
-			if (isnan(ping->png_depth[i]))
-				{
-				ping->png_beamflag[i] = MB_FLAG_NULL;
-				ping->png_depth[i] = 0.0;
-				}
-			}
-
-		/* generate processed sidescan */
-		ping->png_pixel_size = 0;
-		ping->png_pixels_ss = 0;
-		status = mbsys_simrad3_makess(verbose,
-				mbio_ptr, store_ptr,
-				MB_NO, pixel_size,
-				MB_NO, swath_width,
-				1,
-				error);
-		}
-
-	/* set error and kind in mb_io_ptr */
-	mb_io_ptr->new_error = *error;
-	mb_io_ptr->new_kind = store->kind;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_wt_em710raw(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_wt_em710raw";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_simrad3_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_simrad3_struct *) store_ptr;
-
-	/* write next data to file */
-	status = mbr_em710raw_wr_data(verbose,mbio_ptr,store_ptr,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em710raw_rd_data(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_em710raw_rd_data";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_simrad3_struct *store;
-	FILE	*mbfp;
-	int	swap = -1;
-	int	done;
-	int	*databyteswapped;
-	int	record_size;
-	int	*record_size_save;
-	int	bytes_read;
-	char	*label;
-	int	*label_save_flag;
-	char	*record_size_char;
-	short	type;
-	short	sonar;
-	int	*version;
-	short	*typelast;
-	short	*sonarlast;
-	int	*nbadrec;
-	int	good_end_bytes;
-	size_t	read_len;
-	int	skip = 0;
-	int	*num_sonars;
-	char	junk;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_simrad3_struct *) store_ptr;
-	mbfp = mb_io_ptr->mbfp;
-
-	/* get saved values */
-	databyteswapped = (int *) &mb_io_ptr->save1;
-	record_size_save = (int *) &mb_io_ptr->save2;
-	label = (char *) mb_io_ptr->save_label;
-	version = (int *) (&mb_io_ptr->save3);
-	label_save_flag = (int *) &mb_io_ptr->save_label_flag;
-	typelast = (short *) &mb_io_ptr->save6;
-	sonarlast = (short *) &mb_io_ptr->save7;
-	nbadrec = (int *) &mb_io_ptr->save8;
-	num_sonars = (int *) &mb_io_ptr->save10;
-	record_size_char = (char *) &record_size;
-
-	/* set file position */
-	mb_io_ptr->file_pos = mb_io_ptr->file_bytes;
-
-	/* set flag to swap bytes if necessary */
-	swap =  *databyteswapped;
-	
-	/* if a ping structure was previously flagged as complete then reset the structure to empty */
-	for (i=0;i<MBSYS_SIMRAD3_NUM_PING_STRUCTURES;i++)
-		{
-		if (store->pings[i].read_status == MBSYS_SIMRAD3_PING_COMPLETE)
-			{
-			store->pings[i].read_status = MBSYS_SIMRAD3_PING_NO_DATA;
-			store->pings[i].png_bath_read = MB_NO;
-			store->pings[i].png_raw_read = MB_NO;
-			store->pings[i].png_quality_read = MB_NO;
-			store->pings[i].png_ss_read = MB_NO;
-			}
-		}
-
-	/* loop over reading data until a record is ready for return */
-	done = MB_NO;
-	*error = MB_ERROR_NO_ERROR;
-	while (done == MB_NO)
-		{
-#ifdef MBR_EM710RAW_DEBUG
-	fprintf(stderr,"\nabove mbr_em710raw_rd_data loop:\n");
-	fprintf(stderr,"label_save_flag:%d status:%d\n",*label_save_flag,status);
-#endif
-		/* if no label saved get next record label */
-		if (*label_save_flag == MB_NO)
-			{
-			/* read four byte record size */
-			read_len = 4;
-			status = mb_fileio_get(verbose, mbio_ptr, (char *)&record_size, &read_len, error);
-#ifdef MBR_EM710RAW_DEBUG
-	fprintf(stderr,"read record size:%d status:%d\n",record_size,status);
-#endif
-
-			/* read label */
-			read_len = 4;
-			status = mb_fileio_get(verbose, mbio_ptr, (char *)label, &read_len, error);
-
-			/* check label - if not a good label read a byte
-				at a time until a good label is found */
-			skip = 0;
-#ifdef MBR_EM710RAW_DEBUG
-	fprintf(stderr,"read label:%x%x%x%x skip:%d status:%d\n",label[0],label[1],label[2],label[3],skip,status);
-#endif
-			while (status == MB_SUCCESS
-				&& mbr_em710raw_chk_label(verbose,
-					mbio_ptr, label, &type, &sonar) != MB_SUCCESS)
-			    {
-			    /* get next byte */
-			    for (i=0;i<3;i++)
-				record_size_char[i] = record_size_char[i+1];
-			    record_size_char[3] = label[0];
-			    for (i=0;i<3;i++)
-				label[i] = label[i+1];
-			    read_len = 1;
-			    status = mb_fileio_get(verbose, mbio_ptr, (char *)(&label[3]), &read_len, error);
-			    skip++;
-#ifdef MBR_EM710RAW_DEBUG
-	fprintf(stderr,"read label:%x%x%x%x skip:%d status:%d\n",label[0],label[1],label[2],label[3],skip,status);
-#endif
-			    }
-
-			/* report problem */
-			if (skip > 0 && verbose > 0)
-			    {
-			    if (*nbadrec == 0)
-			    	fprintf(stderr,
-"\nThe MBF_EM710RAW module skipped data between identified\n\
-data records. Something is broken, most probably the data...\n\
-However, the data may include a data record type that we\n\
-haven't seen yet, or there could be an error in the code.\n\
-If skipped data are reported multiple times, \n\
-we recommend you send a data sample and problem \n\
-description to the MB-System team \n\
-(caress at mbari.org and dale at ldeo.columbia.edu)\n\
-Have a nice day...\n");
-				fprintf(stderr,
-						"MBF_EM710RAW skipped %d bytes between records %4.4hX:%d and %4.4hX:%d\n",
-						skip, *typelast, *typelast, type, type);
-				(*nbadrec)++;
-			    }
-			*typelast = type;
-			*sonarlast = sonar;
-
-			/* set flag to swap bytes if necessary */
-			swap = *databyteswapped;
-
-			/* get record_size */
-			if (*databyteswapped != mb_io_ptr->byteswapped)
-				record_size = mb_swap_int(record_size);
-			*record_size_save = record_size;
-			}
-
-		/* else use saved label */
-		else
-			{
-			*label_save_flag = MB_NO;
-			type = *typelast;
-			sonar = *sonarlast;
-			record_size = *record_size_save;
-#ifdef MBR_EM710RAW_DEBUG
-	fprintf(stderr,"use previously read label:%x%x%x%x skip:%d status:%d\n",label[0],label[1],label[2],label[3],skip,status);
-#endif
-			}
-
-#ifdef MBR_EM710RAW_DEBUG
-	fprintf(stderr,"\nstart of mbr_em710raw_rd_data loop:\n");
-	fprintf(stderr,"skip:%d type:%x sonar:%d recsize:%u done:%d\n",
-		skip, type, sonar, *record_size_save, done);
-#endif
-#ifdef MBR_EM710RAW_DEBUG3
-	if (skip > 0)
-	fprintf(stderr,"SKIPPED BYTES: %d\n", skip);
-	fprintf(stderr,"type:%x sonar:%d recsize:%u done:%d   ",
-	type, sonar, *record_size_save, done);
-#endif
-
-		/* allocate secondary data structure for
-			extraparameters data if needed */
-		if (status == MB_SUCCESS &&
-			(type == EM3_EXTRAPARAMETERS)
-			&& store->extraparameters == NULL)
-			{
-			status = mbsys_simrad3_extraparameters_alloc(
-					verbose,mbio_ptr,
-					store_ptr,error);
-			}
-
-		/* allocate secondary data structure for
-			heading data if needed */
-		if (status == MB_SUCCESS &&
-			(type == EM3_HEADING)
-			&& store->heading == NULL)
-			{
-			status = mbsys_simrad3_heading_alloc(
-					verbose,mbio_ptr,
-					store_ptr,error);
-			}
-
-		/* allocate secondary data structure for
-			attitude data if needed */
-		if (status == MB_SUCCESS &&
-			(type == EM3_ATTITUDE)
-			&& store->attitude == NULL)
-			{
-			status = mbsys_simrad3_attitude_alloc(
-					verbose,mbio_ptr,
-					store_ptr,error);
-			}
-
-		/* allocate secondary data structure for
-			netattitude data if needed */
-		if (status == MB_SUCCESS &&
-			(type == EM3_NETATTITUDE)
-			&& store->netattitude == NULL)
-			{
-			status = mbsys_simrad3_netattitude_alloc(
-					verbose,mbio_ptr,
-					store_ptr,error);
-			}
-
-		/* allocate secondary data structure for
-			ssv data if needed */
-		if (status == MB_SUCCESS &&
-			(type == EM3_SSV)
-			&& store->ssv == NULL)
-			{
-			status = mbsys_simrad3_ssv_alloc(
-					verbose,mbio_ptr,
-					store_ptr,error);
-			}
-
-		/* allocate secondary data structure for
-			tilt data if needed */
-		if (status == MB_SUCCESS &&
-			(type == EM3_TILT)
-			&& store->tilt == NULL)
-			{
-			status = mbsys_simrad3_tilt_alloc(
-					verbose,mbio_ptr,
-					store_ptr,error);
-			}
-
-		/* allocate secondary data structure for
-			water column data if needed */
-		if (status == MB_SUCCESS &&
-			(type == EM3_WATERCOLUMN))
-			{
-			if (store->wc == NULL)
-			    status = mbsys_simrad3_wc_alloc(
-					verbose,mbio_ptr,
-					store_ptr,error);
-			}
-
-		/* read the appropriate data records */
-		if (status == MB_FAILURE)
-			{
-#ifdef MBR_EM710RAW_DEBUG
-	fprintf(stderr,"call nothing, read failure\n");
-#endif
-			done = MB_YES;
-			record_size = 0;
-			*record_size_save = record_size;
-			}
-		else if (type !=  EM3_PU_ID
-			&& type != EM3_PU_STATUS
-			&& type != EM3_PU_BIST
-			&& type != EM3_EXTRAPARAMETERS
-			&& type != EM3_ATTITUDE
-			&& type != EM3_CLOCK
-			&& type != EM3_BATH
-			&& type != EM3_SBDEPTH
-			&& type != EM3_RAWBEAM
-			&& type != EM3_SSV
-			&& type != EM3_HEADING
-			&& type != EM3_START
-			&& type != EM3_TILT
-			&& type != EM3_CBECHO
-			&& type != EM3_RAWBEAM4
-			&& type != EM3_QUALITY
-			&& type != EM3_POS
-			&& type != EM3_RUN_PARAMETER
-			&& type != EM3_SS
-			&& type != EM3_TIDE
-			&& type != EM3_SVP2
-			&& type != EM3_SVP
-			&& type != EM3_SSPINPUT
-			&& type != EM3_BATH2
-			&& type != EM3_SS2
-			&& type != EM3_RAWBEAM2
-			&& type != EM3_RAWBEAM3
-			&& type != EM3_HEIGHT
-			&& type != EM3_STOP
-			&& type != EM3_WATERCOLUMN
-			&& type != EM3_NETATTITUDE
-			&& type != EM3_REMOTE
-			&& type != EM3_SSP
-			&& type != EM3_BATH_MBA
-			&& type != EM3_SS_MBA
-			&& type != EM3_BATH2_MBA
-			&& type != EM3_SS2_MBA
-			&& type != EM3_BATH3_MBA)
-			{
-#ifdef MBR_EM710RAW_DEBUG
-	fprintf(stderr,"call nothing, try again\n");
-#endif
-			done = MB_NO;
-			}
-		else if (type == EM3_PU_STATUS)
-			{
-#ifdef MBR_EM710RAW_DEBUG
-	fprintf(stderr,"call mbr_em710raw_rd_status type %x\n",type);
-#endif
-
-			status = mbr_em710raw_rd_status(
-				verbose,mbio_ptr,swap,store,type,sonar,&good_end_bytes,error);
-			if (status == MB_SUCCESS)
-				{
-				done = MB_YES;
-				}
-#ifdef MBR_EM710RAW_DEBUG3
-	fprintf(stderr,"mbr_em710raw_rd_status\n");
-#endif
-			}
-		else if (type == EM3_START
-			|| type == EM3_STOP)
-			{
-#ifdef MBR_EM710RAW_DEBUG
-	fprintf(stderr,"call mbr_em710raw_rd_start type %x\n",type);
-#endif
-			status = mbr_em710raw_rd_start(
-				verbose,mbio_ptr,swap,store,type,sonar,version,num_sonars,&good_end_bytes,error);
-			if (status == MB_SUCCESS)
-				{
-				done = MB_YES;
-				}
-#ifdef MBR_EM710RAW_DEBUG3
-	fprintf(stderr,"mbr_em710raw_rd_start\n");
-#endif
-			}
-		else if (type == EM3_RUN_PARAMETER)
-			{
-#ifdef MBR_EM710RAW_DEBUG
-	fprintf(stderr,"call mbr_em710raw_rd_run_parameter type %x\n",type);
-#endif
-			status = mbr_em710raw_rd_run_parameter(
-				verbose,mbio_ptr,swap,store,sonar,&good_end_bytes,error);
-			if (status == MB_SUCCESS)
-				{
-				done = MB_YES;
-				}
-#ifdef MBR_EM710RAW_DEBUG3
-	fprintf(stderr,"mbr_em710raw_rd_run_parameter\n");
-#endif
-			}
-		else if (type == EM3_CLOCK)
-			{
-#ifdef MBR_EM710RAW_DEBUG
-	fprintf(stderr,"call mbr_em710raw_rd_clock type %x\n",type);
-#endif
-			status = mbr_em710raw_rd_clock(
-				verbose,mbio_ptr,swap,store,sonar,&good_end_bytes,error);
-			if (status == MB_SUCCESS)
-				{
-				done = MB_YES;
-				}
-#ifdef MBR_EM710RAW_DEBUG3
-	fprintf(stderr,"mbr_em710raw_rd_clock\n");
-#endif
-			}
-		else if (type == EM3_TIDE)
-			{
-#ifdef MBR_EM710RAW_DEBUG
-	fprintf(stderr,"call mbr_em710raw_rd_tide type %x\n",type);
-#endif
-			status = mbr_em710raw_rd_tide(
-				verbose,mbio_ptr,swap,store,sonar,&good_end_bytes,error);
-			if (status == MB_SUCCESS)
-				{
-				done = MB_YES;
-				}
-#ifdef MBR_EM710RAW_DEBUG3
-	fprintf(stderr,"mbr_em710raw_rd_tide\n");
-#endif
-			}
-		else if (type == EM3_HEIGHT)
-			{
-#ifdef MBR_EM710RAW_DEBUG
-	fprintf(stderr,"call mbr_em710raw_rd_height type %x\n",type);
-#endif
-			status = mbr_em710raw_rd_height(
-				verbose,mbio_ptr,swap,store,sonar,&good_end_bytes,error);
-			if (status == MB_SUCCESS)
-				{
-				done = MB_YES;
-				}
-#ifdef MBR_EM710RAW_DEBUG3
-	fprintf(stderr,"mbr_em710raw_rd_height\n");
-#endif
-			}
-		else if (type == EM3_HEADING)
-			{
-#ifdef MBR_EM710RAW_DEBUG
-	fprintf(stderr,"call mbr_em710raw_rd_heading type %x\n",type);
-#endif
-			status = mbr_em710raw_rd_heading(
-				verbose,mbio_ptr,swap,store,sonar,&good_end_bytes,error);
-			if (status == MB_SUCCESS)
-				{
-				done = MB_YES;
-				}
-#ifdef MBR_EM710RAW_DEBUG3
-	fprintf(stderr,"mbr_em710raw_rd_heading\n");
-#endif
-			}
-		else if (type == EM3_SSV)
-			{
-#ifdef MBR_EM710RAW_DEBUG
-	fprintf(stderr,"call mbr_em710raw_rd_ssv type %x\n",type);
-#endif
-			status = mbr_em710raw_rd_ssv(
-				verbose,mbio_ptr,swap,store,sonar,&good_end_bytes,error);
-			if (status == MB_SUCCESS)
-				{
-				done = MB_YES;
-				}
-#ifdef MBR_EM710RAW_DEBUG3
-	fprintf(stderr,"mbr_em710raw_rd_ssv\n");
-#endif
-			}
-		else if (type == EM3_TILT)
-			{
-#ifdef MBR_EM710RAW_DEBUG
-	fprintf(stderr,"call mbr_em710raw_rd_tilt type %x\n",type);
-#endif
-			status = mbr_em710raw_rd_tilt(
-				verbose,mbio_ptr,swap,store,sonar,&good_end_bytes,error);
-			if (status == MB_SUCCESS)
-				{
-				done = MB_YES;
-				}
-#ifdef MBR_EM710RAW_DEBUG3
-	fprintf(stderr,"mbr_em710raw_rd_tilt\n");
-#endif
-			}
-		else if (type == EM3_EXTRAPARAMETERS)
-			{
-#ifdef MBR_EM710RAW_DEBUG
-	fprintf(stderr,"call mbr_em710raw_rd_extraparameters type %x\n",type);
-#endif
-			status = mbr_em710raw_rd_extraparameters(
-				verbose,mbio_ptr,swap,store,sonar,&good_end_bytes,error);
-			if (status == MB_SUCCESS)
-				{
-				done = MB_YES;
-				}
-#ifdef MBR_EM710RAW_DEBUG3
-	fprintf(stderr,"mbr_em710raw_rd_extraparameters\n");
-#endif
-			}
-		else if (type == EM3_ATTITUDE)
-			{
-#ifdef MBR_EM710RAW_DEBUG
-	fprintf(stderr,"call mbr_em710raw_rd_attitude type %x\n",type);
-#endif
-			status = mbr_em710raw_rd_attitude(
-				verbose,mbio_ptr,swap,store,sonar,&good_end_bytes,error);
-			if (status == MB_SUCCESS)
-				{
-				done = MB_YES;
-				}
-#ifdef MBR_EM710RAW_DEBUG3
-	fprintf(stderr,"mbr_em710raw_rd_attitude\n");
-#endif
-			}
-		else if (type == EM3_NETATTITUDE)
-			{
-#ifdef MBR_EM710RAW_DEBUG
-	fprintf(stderr,"call mbr_em710raw_rd_netattitude type %x\n",type);
-#endif
-			status = mbr_em710raw_rd_netattitude(
-				verbose,mbio_ptr,swap,store,sonar,&good_end_bytes,error);
-			if (status == MB_SUCCESS)
-				{
-				done = MB_YES;
-				}
-#ifdef MBR_EM710RAW_DEBUG3
-	fprintf(stderr,"mbr_em710raw_rd_netattitude\n");
-#endif
-			}
-		else if (type == EM3_POS)
-			{
-#ifdef MBR_EM710RAW_DEBUG
-	fprintf(stderr,"call mbr_em710raw_rd_pos type %x\n",type);
-#endif
-			status = mbr_em710raw_rd_pos(
-				verbose,mbio_ptr,swap,store,sonar,&good_end_bytes,error);
-			if (status == MB_SUCCESS)
-				{
-				done = MB_YES;
-				}
-#ifdef MBR_EM710RAW_DEBUG3
-	fprintf(stderr,"mbr_em710raw_rd_pos\n");
-#endif
-			}
-		else if (type == EM3_SVP)
-			{
-#ifdef MBR_EM710RAW_DEBUG
-	fprintf(stderr,"call mbr_em710raw_rd_svp type %x\n",type);
-#endif
-			status = mbr_em710raw_rd_svp(
-				verbose,mbio_ptr,swap,store,sonar,&good_end_bytes,error);
-			if (status == MB_SUCCESS)
-				{
-				done = MB_YES;
-				}
-#ifdef MBR_EM710RAW_DEBUG3
-	fprintf(stderr,"mbr_em710raw_rd_svp\n");
-#endif
-			}
-		else if (type == EM3_SVP2)
-			{
-#ifdef MBR_EM710RAW_DEBUG
-	fprintf(stderr,"call mbr_em710raw_rd_svp2 type %x\n",type);
-#endif
-			status = mbr_em710raw_rd_svp2(
-				verbose,mbio_ptr,swap,store,sonar,&good_end_bytes,error);
-			if (status == MB_SUCCESS)
-				{
-				done = MB_YES;
-				}
-#ifdef MBR_EM710RAW_DEBUG3
-	fprintf(stderr,"mbr_em710raw_rd_svp2\n");
-#endif
-			}
-		else if (type == EM3_BATH2)
-			{
-#ifdef MBR_EM710RAW_DEBUG
-	fprintf(stderr,"call mbr_em710raw_rd_bath2 type %x\n",type);
-#endif
-			status = mbr_em710raw_rd_bath2(
-				verbose,mbio_ptr,swap,store,sonar,*version,&good_end_bytes,error);
-			if (status == MB_SUCCESS)
-				{
-				store->pings[store->ping_index].read_status = MBSYS_SIMRAD3_PING_PARTIAL;
-				store->pings[store->ping_index].png_bath_read = MB_YES;
-				done = MB_NO;
-				}
-			if (status == MB_SUCCESS && sonar == MBSYS_SIMRAD3_M3)
-				{
-				if (store->pings[store->ping_index].png_bath_read == MB_YES
-					&& store->pings[store->ping_index].png_raw_read == MB_YES
-					&& store->pings[store->ping_index].png_count == store->pings[store->ping_index].png_raw_count)
-					{
-					done = MB_YES;
-					}
-				}
-			else if (status == MB_SUCCESS)
-				{
-				if (store->pings[store->ping_index].png_bath_read == MB_YES
-					&& store->pings[store->ping_index].png_ss_read == MB_YES
-					&& store->pings[store->ping_index].png_count == store->pings[store->ping_index].png_ss_count)
-					{
-					store->pings[store->ping_index].read_status = MBSYS_SIMRAD3_PING_COMPLETE;
-					done = MB_YES;
-					}
-				}
-#ifdef MBR_EM710RAW_DEBUG3
-	fprintf(stderr,"mbr_em710raw_rd_bath2: ping_index:%d ping:%d serial:%d\n",
-			store->ping_index,store->pings[store->ping_index].png_count,
-			store->pings[store->ping_index].png_serial);
-#endif
-			}
-		else if (type == EM3_RAWBEAM4)
-			{
-#ifdef MBR_EM710RAW_DEBUG
-	fprintf(stderr,"call mbr_em710raw_rd_rawbeam4 type %x\n",type);
-#endif
-			status = mbr_em710raw_rd_rawbeam4(
-				verbose,mbio_ptr,swap,store,sonar,&good_end_bytes,error);
-			if (status == MB_SUCCESS)
-				{
-				store->pings[store->ping_index].read_status = MBSYS_SIMRAD3_PING_PARTIAL;
-				store->pings[store->ping_index].png_raw_read = MB_YES;
-				done = MB_NO;
-				}
-#ifdef MBR_EM710RAW_DEBUG3
-	fprintf(stderr,"mbr_em710raw_rd_rawbeam4: ping_index:%d ping:%d serial:%d\n",
-			store->ping_index,store->pings[store->ping_index].png_raw_count,
-			store->pings[store->ping_index].png_raw_serial);
-#endif
-			}
-		else if (type == EM3_QUALITY)
-			{
-#ifdef MBR_EM710RAW_DEBUG
-	fprintf(stderr,"call mbr_em710raw_rd_quality type %x\n",type);
-#endif
-			status = mbr_em710raw_rd_quality(
-				verbose,mbio_ptr,swap,store,sonar,&good_end_bytes,error);
-			if (status == MB_SUCCESS)
-				{
-				store->pings[store->ping_index].read_status = MBSYS_SIMRAD3_PING_PARTIAL;
-				store->pings[store->ping_index].png_quality_read = MB_YES;
-				done = MB_NO;
-				}
-#ifdef MBR_EM710RAW_DEBUG3
-	fprintf(stderr,"mbr_em710raw_rd_quality: ping_index:%d ping:%d serial:%d\n",
-			store->ping_index,store->pings[store->ping_index].png_quality_count,
-			store->pings[store->ping_index].png_quality_serial);
-#endif
-			}
-		else if (type == EM3_SS2)
-			{
-#ifdef MBR_EM710RAW_DEBUG
-	fprintf(stderr,"call mbr_em710raw_rd_ss2 type %x\n",type);
-#endif
-			status = mbr_em710raw_rd_ss2(
-				verbose,mbio_ptr,swap,store,sonar,&good_end_bytes,error);
-			if (status == MB_SUCCESS)
-				{
-				store->pings[store->ping_index].read_status = MBSYS_SIMRAD3_PING_PARTIAL;
-				store->pings[store->ping_index].png_ss_read = MB_YES;
-				done = MB_NO;
-				}
-			if (status == MB_SUCCESS)
-				{
-				if (store->pings[store->ping_index].png_bath_read == MB_YES
-					&& store->pings[store->ping_index].png_ss_read == MB_YES
-					&& store->pings[store->ping_index].png_count == store->pings[store->ping_index].png_ss_count)
-					{
-					store->pings[store->ping_index].read_status = MBSYS_SIMRAD3_PING_COMPLETE;
-					done = MB_YES;
-					}
-				}
-#ifdef MBR_EM710RAW_DEBUG3
-	fprintf(stderr,"mbr_em710raw_rd_ss2: ping_index:%d ping:%d serial:%d\n",
-			store->ping_index,store->pings[store->ping_index].png_ss_count,
-			store->pings[store->ping_index].png_ss_serial);
-#endif
-			}
-		else if (type == EM3_WATERCOLUMN)
-			{
-#ifdef MBR_EM710RAW_DEBUG
-	fprintf(stderr,"call mbr_em710raw_rd_wc type %x\n",type);
-#endif
-			status = mbr_em710raw_rd_wc(
-				verbose,mbio_ptr,swap,store,sonar,&good_end_bytes,error);
-			if (status == MB_SUCCESS)
-				{
-				done = MB_YES;
-				}
-#ifdef MBR_EM710RAW_DEBUG3
-	fprintf(stderr,"mbr_em710raw_rd_wc ping:%d\n", store->wc->wtc_count);
-#endif
-			}
-		else
-			{
-#ifdef MBR_EM710RAW_DEBUG
-	fprintf(stderr,"skip over %d bytes of unsupported datagram type %x\n",
-			*record_size_save, type);
-#endif
-			for (i=0;i<*record_size_save-4;i++)
-				{
-				read_len = 1;
-				status = mb_fileio_get(verbose, mbio_ptr, (char *)&junk, &read_len, error);
-				}
-			if (status == MB_FAILURE)
-				{
-				done = MB_YES;
-				good_end_bytes = MB_NO;
-				}
-			else
-				{
-				done = MB_NO;
-				good_end_bytes = MB_YES;
-				}
-#ifdef MBR_EM710RAW_DEBUG3
-	fprintf(stderr,"skip over %d bytes of unsupported datagram type %x\n",
-			*record_size_save, type);
-#endif
-			}
-
-		/* bail out if there is an error */
-		if (status == MB_FAILURE)
-			done = MB_YES;
-
-		/* if necessary read over unread but expected bytes */
-		bytes_read = ftell(mbfp) - mb_io_ptr->file_bytes - 4;
-		if (*label_save_flag == MB_NO && good_end_bytes == MB_NO
-			&& bytes_read < record_size)
-			{
-#ifdef MBR_EM710RAW_DEBUG
-	fprintf(stderr,"skip over %d unread bytes of supported datagram type %x\n",
-			record_size - bytes_read, type);
-#endif
-			for (i=0;i<record_size - bytes_read;i++)
-				{
-				read_len = 1;
-				status = mb_fileio_get(verbose, mbio_ptr, (char *)&junk, &read_len, error);
-				}
-			}
-
-#ifdef MBR_EM710RAW_DEBUG
-	fprintf(stderr,"record_size:%d bytes read:%ld file_pos old:%ld new:%ld\n",
-		record_size, ftell(mbfp) - mb_io_ptr->file_bytes, mb_io_ptr->file_bytes, ftell(mbfp));
-	fprintf(stderr,"done:%d status:%d error:%d\n",
-		done, status, *error);
-	fprintf(stderr,"end of mbr_em710raw_rd_data loop:\n\n");
-#endif
-#ifdef MBR_EM710RAW_DEBUG3
-	if (done == MB_YES)
-	fprintf(stderr,"DONE! type:%x kind:%d status:%d error:%d\n\n", type, store->kind, status, *error);
-#endif
-
-		/* get file position */
-		if (*label_save_flag == MB_YES)
-			mb_io_ptr->file_bytes = ftell(mbfp) - 2;
-		else
-			mb_io_ptr->file_bytes = ftell(mbfp);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em710raw_chk_label(int verbose, void *mbio_ptr, char *label, short *type, short *sonar)
-{
-	char	*function_name = "mbr_em710raw_chk_label";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	mb_u_char	startbyte;
-	mb_u_char	typebyte;
-	short	*sonar_save;
-	short	sonarunswap;
-	short	sonarswap;
-	int	swap;
-	int	*databyteswapped;
-	int	typegood;
-	int	sonargood;
-	int	sonarswapgood;
-	int	sonarunswapgood;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       label:      %x%x%x%x\n",label[0],label[1],label[2],label[3]);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-	sonar_save = (short *) (&mb_io_ptr->save11);
-	databyteswapped = (int *) &mb_io_ptr->save1;
-
-#ifdef MBR_EM710RAW_DEBUG
-	fprintf(stderr, "Check label: %x|%x|%x|%x\n", label[0],label[1],label[2],label[3]);
-#endif
-
-	/* check for valid start byte and type */
-	startbyte = label[0];
-	typebyte = label[1];
-	if (startbyte ==  EM3_START_BYTE &&
-		(typebyte == EM3_ID_PU_ID
-		|| typebyte == EM3_ID_PU_STATUS
-		|| typebyte == EM3_ID_PU_BIST
-		|| typebyte == EM3_ID_EXTRAPARAMETERS
-		|| typebyte == EM3_ID_ATTITUDE
-		|| typebyte == EM3_ID_NETATTITUDE
-		|| typebyte == EM3_ID_CLOCK
-		|| typebyte == EM3_ID_BATH
-		|| typebyte == EM3_ID_SBDEPTH
-		|| typebyte == EM3_ID_RAWBEAM
-		|| typebyte == EM3_ID_SSV
-		|| typebyte == EM3_ID_HEADING
-		|| typebyte == EM3_ID_START
-		|| typebyte == EM3_ID_TILT
-		|| typebyte == EM3_ID_CBECHO
-		|| typebyte == EM3_ID_RAWBEAM4
-		|| typebyte == EM3_ID_QUALITY
-		|| typebyte == EM3_ID_POS
-		|| typebyte == EM3_ID_RUN_PARAMETER
-		|| typebyte == EM3_ID_SS
-		|| typebyte == EM3_ID_TIDE
-		|| typebyte == EM3_ID_SVP2
-		|| typebyte == EM3_ID_SVP
-		|| typebyte == EM3_ID_SSPINPUT
-		|| typebyte == EM3_ID_BATH2
-		|| typebyte == EM3_ID_SS2
-		|| typebyte == EM3_ID_RAWBEAM2
-		|| typebyte == EM3_ID_RAWBEAM3
-		|| typebyte == EM3_ID_HEIGHT
-		|| typebyte == EM3_ID_STOP
-		|| typebyte == EM3_ID_WATERCOLUMN
-		|| typebyte == EM3_ID_REMOTE
-		|| typebyte == EM3_ID_SSP
-		|| typebyte == EM3_ID_BATH_MBA
-		|| typebyte == EM3_ID_SS_MBA
-		|| typebyte == EM3_ID_BATH2_MBA
-		|| typebyte == EM3_ID_SS2_MBA))
-		{
-		typegood = MB_YES;
-		}
-	else
-		{
-		typegood = MB_NO;
-		}
-
-	/* check for data byte swapping if necessary */
-	sonarswapgood = MB_NO;
-	sonarunswapgood = MB_NO;
-	if (typegood == MB_YES && *databyteswapped == -1)
-		{
-		sonarunswap = *((short *)&label[2]);
-		sonarswap = mb_swap_short(sonarunswap);
-
-		/* check for valid sonarunswap */
-		if (sonarunswap == MBSYS_SIMRAD3_EM710
-			|| sonarunswap == MBSYS_SIMRAD3_EM3002
-			|| sonarunswap == MBSYS_SIMRAD3_EM302
-			|| sonarunswap == MBSYS_SIMRAD3_EM122
-			|| sonarunswap == MBSYS_SIMRAD3_EM2040
-			|| sonarunswap == MBSYS_SIMRAD3_EM2045
-			|| sonarunswap == MBSYS_SIMRAD3_M3)
-			{
-			sonarunswapgood = MB_YES;
-			}
-		else
-			{
-			sonarunswapgood = MB_NO;
-			}
-
-		/* check for valid sonarswap */
-		if (sonarswap == MBSYS_SIMRAD3_EM710
-			|| sonarswap == MBSYS_SIMRAD3_EM3002
-			|| sonarswap == MBSYS_SIMRAD3_EM302
-			|| sonarswap == MBSYS_SIMRAD3_EM122
-			|| sonarswap == MBSYS_SIMRAD3_EM2040
-			|| sonarswap == MBSYS_SIMRAD3_EM2045
-			|| sonarswap == MBSYS_SIMRAD3_M3)
-			{
-			sonarswapgood = MB_YES;
-			}
-		else
-			{
-			sonarswapgood = MB_NO;
-			}
-		if (sonarunswapgood == MB_YES && sonarswapgood == MB_NO)
-			{
-			if (mb_io_ptr->byteswapped == MB_YES)
-				*databyteswapped = MB_YES;
-			else
-				*databyteswapped = MB_NO;
-			}
-		else if (sonarunswapgood == MB_NO && sonarswapgood == MB_YES)
-			{
-			if (mb_io_ptr->byteswapped == MB_YES)
-				*databyteswapped = MB_NO;
-			else
-				*databyteswapped = MB_YES;
-			}
-		}
-
-	/* set flag to swap bytes if necessary */
-	swap =  *databyteswapped;
-
-	*type = *((short *)&label[0]);
-	*sonar = *((short *)&label[2]);
-	if (mb_io_ptr->byteswapped == MB_YES)
-		*type = mb_swap_short(*type);
-	if (*databyteswapped != mb_io_ptr->byteswapped)
-		{
-		*sonar = mb_swap_short(*sonar);
-		}
-
-#ifdef MBR_EM710RAW_DEBUG
-fprintf(stderr,"typegood:%d mb_io_ptr->byteswapped:%d sonarunswapgood:%d sonarswapgood:%d *databyteswapped:%d *type:%d *sonar:%d\n",
-typegood,mb_io_ptr->byteswapped,sonarunswapgood,sonarswapgood,*databyteswapped,*type,*sonar);
-#endif
-
-	/* check for valid sonar */
-	if (*sonar != MBSYS_SIMRAD3_EM710
-		&& *sonar != MBSYS_SIMRAD3_EM3002
-		&& *sonar != MBSYS_SIMRAD3_EM302
-		&& *sonar != MBSYS_SIMRAD3_EM122
-		&& *sonar != MBSYS_SIMRAD3_EM2040
-		&& *sonar != MBSYS_SIMRAD3_EM2045
-		&& *sonar != MBSYS_SIMRAD3_M3)
-		{
-		sonargood = MB_NO;
-		}
-	else
-		{
-		sonargood = MB_YES;
-		}
-
-	if (startbyte == EM3_START_BYTE && typegood == MB_NO && sonargood == MB_YES)
-		{
-		mb_notice_log_problem(verbose, mbio_ptr,
-			MB_PROBLEM_BAD_DATAGRAM);
-		if (verbose >= 1)
-		    fprintf(stderr, "Bad datagram type: %4.4hX %4.4hX | %d %d\n", *type, *sonar, *type, *sonar);
-		}
-	if (typegood != MB_YES || sonargood != MB_YES)
-		{
-		status = MB_FAILURE;
-		}
-
-	/* save sonar if successful */
-	if (status == MB_SUCCESS)
-	    *sonar_save = *sonar;
-
-	/* allow exception found in some data */
-	if (*type == EM3_SSV && *sonar == 0 && *sonar_save != 0)
-		{
-		status = MB_SUCCESS;
-		*sonar = *sonar_save;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       type:       %d\n",*type);
-		fprintf(stderr,"dbg2       sonar:      %d\n",*sonar);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em710raw_rd_status(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store,
-		short type, short sonar, int *goodend, int *error)
-{
-	char	*function_name = "mbr_em710raw_rd_status";
-	int	status = MB_SUCCESS;
-	char	line[EM3_PU_STATUS_SIZE];
-	short	short_val;
-	size_t	read_len;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		fprintf(stderr,"dbg2       sonar:      %d\n",sonar);
-		}
-
-	/* set goodend false until a good end is found */
-	*goodend = MB_NO;
-
-	/* set kind and type values */
-	store->kind = MB_DATA_STATUS;
-	store->type = EM3_PU_STATUS;
-	store->sonar = sonar;
-
-	/* read binary values into char array */
-	read_len = (size_t)(EM3_PU_STATUS_SIZE-4);
-	status = mb_fileio_get(verbose, mbio_ptr, (char *)line, &read_len, error);
-
-	/* get binary data */
-	if (status == MB_SUCCESS)
-		{
-		mb_get_binary_int(swap, &line[0], &store->sts_date);
-		    if (store->sts_date != 0) store->date = store->sts_date;
-		mb_get_binary_int(swap, &line[4], &store->sts_msec);
-		    if (store->sts_date != 0) store->msec = store->sts_msec;
-		mb_get_binary_short(swap, &line[8], &short_val);
-		    store->sts_status_count = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[10], &short_val);
-		    store->sts_serial = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[12], &short_val);
-		    store->sts_pingrate = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[14], &short_val);
-		    store->sts_ping_count = (int) ((unsigned short) short_val);
-		mb_get_binary_int(swap, &line[16], &store->sts_load);
-		mb_get_binary_int(swap, &line[20], &store->sts_udp_status);
-		mb_get_binary_int(swap, &line[24], &store->sts_serial1_status);
-		mb_get_binary_int(swap, &line[28], &store->sts_serial2_status);
-		mb_get_binary_int(swap, &line[32], &store->sts_serial3_status);
-		mb_get_binary_int(swap, &line[36], &store->sts_serial4_status);
-		store->sts_pps_status = (mb_u_char) line[40];
-		store->sts_position_status = (mb_s_char) line[41];
-		store->sts_attitude_status = (mb_s_char) line[42];
-		store->sts_clock_status = (mb_s_char) line[43];
-		store->sts_heading_status = (mb_s_char) line[44];
-		store->sts_pu_status = (mb_u_char) line[45];
-		mb_get_binary_short(swap, &line[46], &short_val);
-		    store->sts_last_heading = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[48], &short_val);
-		    store->sts_last_roll = (int) ((short) short_val);
-		mb_get_binary_short(swap, &line[50], &short_val);
-		    store->sts_last_pitch = (int) ((short) short_val);
-		mb_get_binary_short(swap, &line[52], &short_val);
-		    store->sts_last_heave = (int) ((short) short_val);
-		mb_get_binary_short(swap, &line[54], &short_val);
-		    store->sts_last_ssv = (int) ((unsigned short) short_val);
-		mb_get_binary_int(swap, &line[56], &store->sts_last_depth);
-		mb_get_binary_int(swap, &line[60], &store->sts_spare);
-		store->sts_bso = (mb_s_char) line[64];
-		store->sts_bsn = (mb_s_char) line[65];
-		store->sts_gain = (mb_s_char) line[66];
-		store->sts_dno = (mb_u_char) line[67];
-		mb_get_binary_short(swap, &line[68], &short_val);
-		    store->sts_rno = (int) ((unsigned short) short_val);
-		store->sts_port = (mb_s_char) line[70];
-		store->sts_stbd = (mb_u_char) line[71];
-		mb_get_binary_short(swap, &line[72], &short_val);
-		    store->sts_ssp = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[74], &short_val);
-		    store->sts_yaw = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[76], &short_val);
-		    store->sts_port2 = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[78], &short_val);
-		    store->sts_stbd2 = (int) ((unsigned short) short_val);
-		store->sts_spare2 = (mb_u_char) line[80];
-		if (line[EM3_PU_STATUS_SIZE-7] == EM3_END)
-			*goodend = MB_YES;
-#ifdef MBR_EM710RAW_DEBUG
-	fprintf(stderr, "End Bytes: %2.2hhX %d | %2.2hhX %d | %2.2hhX %d\n",
-		line[EM3_PU_STATUS_SIZE-7], line[EM3_PU_STATUS_SIZE-7],
-		line[EM3_PU_STATUS_SIZE-6], line[EM3_PU_STATUS_SIZE-6],
-		line[EM3_PU_STATUS_SIZE-5], line[EM3_PU_STATUS_SIZE-5]);
-#endif
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:                %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:               %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:                %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:                %d\n",store->msec);
-		fprintf(stderr,"dbg5       run_date:            %d\n",store->sts_date);
-		fprintf(stderr,"dbg5       run_msec:            %d\n",store->sts_msec);
-		fprintf(stderr,"dbg5       sts_status_count:    %d\n",store->sts_status_count);
-		fprintf(stderr,"dbg5       run_serial:          %d\n",store->sts_serial);
-		fprintf(stderr,"dbg5       sts_pingrate:        %d\n",store->sts_pingrate);
-		fprintf(stderr,"dbg5       sts_ping_count:      %d\n",store->sts_ping_count);
-		fprintf(stderr,"dbg5       sts_load:            %d\n",store->sts_load);
-		fprintf(stderr,"dbg5       sts_udp_status:      %d\n",store->sts_udp_status);
-		fprintf(stderr,"dbg5       sts_serial1_status:  %d\n",store->sts_serial1_status);
-		fprintf(stderr,"dbg5       sts_serial2_status:  %d\n",store->sts_serial2_status);
-		fprintf(stderr,"dbg5       sts_serial3_status:  %d\n",store->sts_serial3_status);
-		fprintf(stderr,"dbg5       sts_serial4_status:  %d\n",store->sts_serial4_status);
-		fprintf(stderr,"dbg5       sts_pps_status:      %d\n",store->sts_pps_status);
-		fprintf(stderr,"dbg5       sts_position_status: %d\n",store->sts_position_status);
-		fprintf(stderr,"dbg5       sts_attitude_status: %d\n",store->sts_attitude_status);
-		fprintf(stderr,"dbg5       sts_clock_status:    %d\n",store->sts_clock_status);
-		fprintf(stderr,"dbg5       sts_heading_status:  %d\n",store->sts_heading_status);
-		fprintf(stderr,"dbg5       sts_pu_status:       %d\n",store->sts_pu_status);
-		fprintf(stderr,"dbg5       sts_last_heading:    %d\n",store->sts_last_heading);
-		fprintf(stderr,"dbg5       sts_last_roll:       %d\n",store->sts_last_roll);
-		fprintf(stderr,"dbg5       sts_last_pitch:      %d\n",store->sts_last_pitch);
-		fprintf(stderr,"dbg5       sts_last_heave:      %d\n",store->sts_last_heave);
-		fprintf(stderr,"dbg5       sts_last_ssv:        %d\n",store->sts_last_ssv);
-		fprintf(stderr,"dbg5       sts_last_heave:      %d\n",store->sts_last_heave);
-		fprintf(stderr,"dbg5       sts_last_depth:      %d\n",store->sts_last_depth);
-		fprintf(stderr,"dbg5       sts_spare:           %d\n",store->sts_spare);
-		fprintf(stderr,"dbg5       sts_bso:             %d\n",store->sts_bso);
-		fprintf(stderr,"dbg5       sts_bsn:             %d\n",store->sts_bsn);
-		fprintf(stderr,"dbg5       sts_gain:            %d\n",store->sts_gain);
-		fprintf(stderr,"dbg5       sts_dno:             %d\n",store->sts_dno);
-		fprintf(stderr,"dbg5       sts_rno:             %d\n",store->sts_rno);
-		fprintf(stderr,"dbg5       sts_port:            %d\n",store->sts_port);
-		fprintf(stderr,"dbg5       sts_stbd:            %d\n",store->sts_stbd);
-		fprintf(stderr,"dbg5       sts_ssp:             %d\n",store->sts_ssp);
-		fprintf(stderr,"dbg5       sts_yaw:             %d\n",store->sts_yaw);
-		fprintf(stderr,"dbg5       sts_port2:           %d\n",store->sts_port2);
-		fprintf(stderr,"dbg5       sts_stbd2:           %d\n",store->sts_stbd2);
-		fprintf(stderr,"dbg5       sts_spare2:          %d\n",store->sts_spare2);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       goodend:    %d\n",*goodend);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em710raw_rd_start(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store,
-		short type, short sonar, int *version, int *num_sonars, int *goodend, int *error)
-{
-	char	*function_name = "mbr_em710raw_rd_start";
-	int	status = MB_SUCCESS;
-	char	line[MBSYS_SIMRAD3_BUFFER_SIZE];
-	short	short_val;
-	size_t	read_len;
-	int	len;
-	int	done;
-	char	*comma_ptr;
-	int	i1, i2, i3;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		fprintf(stderr,"dbg2       type:       %d\n",type);
-		fprintf(stderr,"dbg2       sonar:      %d\n",sonar);
-		}
-
-	/* set goodend false until a good end is found */
-	*goodend = MB_NO;
-
-	/* make sure comment is initialized */
-	store->par_com[0] = '\0';
-
-	/* set type value */
-	store->type = type;
-	store->sonar = sonar;
-
-	/* read binary values into char array */
-	read_len = (size_t)(EM3_START_HEADER_SIZE);
-	status = mb_fileio_get(verbose, mbio_ptr, (char *)line, &read_len, error);
-
-	/* get binary header data */
-	if (status == MB_SUCCESS)
-		{
-		mb_get_binary_int(swap, &line[0], &store->par_date);
-		    store->date = store->par_date;
-		mb_get_binary_int(swap, &line[4], &store->par_msec);
-		    store->msec = store->par_msec;
-		mb_get_binary_short(swap, &line[8], &short_val);
-		    store->par_line_num = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[10], &short_val);
-		    store->par_serial_1 = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[12], &short_val);
-		    store->par_serial_2 = (int) ((unsigned short) short_val);
-		    
-		/* set the number of sonars */
-		if (store->par_serial_2 != 0)
-			*num_sonars = 2;
-		else
-			*num_sonars = 1;
-		}
-
-	/* now loop over reading individual characters to
-	    handle ASCII parameter values */
-	done = MB_NO;
-	len = 0;
-	while (status == MB_SUCCESS && done == MB_NO)
-		{
-		read_len = (size_t)1;
-		status = mb_fileio_get(verbose, mbio_ptr, (char *)&line[len], &read_len, error);
-		if (status == MB_SUCCESS)
-			{
-			len++;
-			}
-		else
-			{
-			done = MB_YES;
-			}
-
-		if (status == MB_SUCCESS
-			&& (((mb_u_char)(line[len-1])) < 32
-			    || ((mb_u_char)(line[len-1])) > 127)
-			&& ((mb_u_char)(line[len-1])) != '\r'
-			&& ((mb_u_char)(line[len-1])) != '\n')
-			{
-			done = MB_YES;
-			if (len > 1)
-			    line[0] = line[len-1];
-			}
-		else if (status == MB_SUCCESS
-			&& line[len-1] == ','
-			&& len > 5)
-			{
-			line[len] = 0;
-			if (strncmp("WLZ=", line, 4) == 0)
-			    mb_get_double(&(store->par_wlz), &line[4], len-5);
-			else if (strncmp("SMH=", line, 4) == 0)
-			    mb_get_int(&(store->par_smh), &line[4], len-5);
-			    
-			else if (strncmp("HUN=", line, 4) == 0)
-			    mb_get_int(&(store->par_hun), &line[4], len-5);
-			else if (strncmp("HUT=", line, 4) == 0)
-			    mb_get_double(&(store->par_hut), &line[4], len-5);
-			else if (strncmp("TXS=", line, 4) == 0)
-			    mb_get_int(&(store->par_txs), &line[4], len-5);
-			else if (strncmp("T2X=", line, 4) == 0)
-			    mb_get_int(&(store->par_t2x), &line[4], len-5);
-			else if (strncmp("R1S=", line, 4) == 0)
-			    mb_get_int(&(store->par_r1s), &line[4], len-5);
-			else if (strncmp("R2S=", line, 4) == 0)
-			    mb_get_int(&(store->par_r2s), &line[4], len-5);
-			else if (strncmp("STC=", line, 4) == 0)
-			    mb_get_int(&(store->par_stc), &line[4], len-5);
-			    
-			else if (strncmp("S0Z=", line, 4) == 0)
-			    mb_get_double(&(store->par_s0z), &line[4], len-5);
-			else if (strncmp("S0X=", line, 4) == 0)
-			    mb_get_double(&(store->par_s0x), &line[4], len-5);
-			else if (strncmp("S0Y=", line, 4) == 0)
-			    mb_get_double(&(store->par_s0y), &line[4], len-5);
-			else if (strncmp("S0H=", line, 4) == 0)
-			    mb_get_double(&(store->par_s0h), &line[4], len-5);
-			else if (strncmp("S0R=", line, 4) == 0)
-			    mb_get_double(&(store->par_s0r), &line[4], len-5);
-			else if (strncmp("S0P=", line, 4) == 0)
-			    mb_get_double(&(store->par_s0p), &line[4], len-5);
-			    
-			else if (strncmp("S1Z=", line, 4) == 0)
-			    mb_get_double(&(store->par_s1z), &line[4], len-5);
-			else if (strncmp("S1X=", line, 4) == 0)
-			    mb_get_double(&(store->par_s1x), &line[4], len-5);
-			else if (strncmp("S1Y=", line, 4) == 0)
-			    mb_get_double(&(store->par_s1y), &line[4], len-5);
-			else if (strncmp("S1H=", line, 4) == 0)
-			    mb_get_double(&(store->par_s1h), &line[4], len-5);
-			else if (strncmp("S1R=", line, 4) == 0)
-			    mb_get_double(&(store->par_s1r), &line[4], len-5);
-			else if (strncmp("S1P=", line, 4) == 0)
-			    mb_get_double(&(store->par_s1p), &line[4], len-5);
-			else if (strncmp("S1N=", line, 4) == 0)
-			    mb_get_int(&(store->par_s1n), &line[4], len-5);
-			    
-			else if (strncmp("S2Z=", line, 4) == 0)
-			    mb_get_double(&(store->par_s2z), &line[4], len-5);
-			else if (strncmp("S2X=", line, 4) == 0)
-			    mb_get_double(&(store->par_s2x), &line[4], len-5);
-			else if (strncmp("S2Y=", line, 4) == 0)
-			    mb_get_double(&(store->par_s2y), &line[4], len-5);
-			else if (strncmp("S2H=", line, 4) == 0)
-			    mb_get_double(&(store->par_s2h), &line[4], len-5);
-			else if (strncmp("S2R=", line, 4) == 0)
-			    mb_get_double(&(store->par_s2r), &line[4], len-5);
-			else if (strncmp("S2P=", line, 4) == 0)
-			    mb_get_double(&(store->par_s2p), &line[4], len-5);
-			else if (strncmp("S2N=", line, 4) == 0)
-			    mb_get_int(&(store->par_s2n), &line[4], len-5);
-			    
-			else if (strncmp("S3Z=", line, 4) == 0)
-			    mb_get_double(&(store->par_s3z), &line[4], len-5);
-			else if (strncmp("S3X=", line, 4) == 0)
-			    mb_get_double(&(store->par_s3x), &line[4], len-5);
-			else if (strncmp("S3Y=", line, 4) == 0)
-			    mb_get_double(&(store->par_s3y), &line[4], len-5);
-			else if (strncmp("S3H=", line, 4) == 0)
-			    mb_get_double(&(store->par_s3h), &line[4], len-5);
-			else if (strncmp("S3R=", line, 4) == 0)
-			    mb_get_double(&(store->par_s3r), &line[4], len-5);
-			else if (strncmp("S3P=", line, 4) == 0)
-			    mb_get_double(&(store->par_s3p), &line[4], len-5);
-			    
-			else if (strncmp("S1S=", line, 4) == 0)
-			    mb_get_int(&(store->par_s1s), &line[4], len-5);
-			else if (strncmp("S2S=", line, 4) == 0)
-			    mb_get_int(&(store->par_s2s), &line[4], len-5);
-			    
-			else if (strncmp("GO1=", line, 4) == 0)
-			    mb_get_double(&(store->par_go1), &line[4], len-5);
-			else if (strncmp("GO2=", line, 4) == 0)
-			    mb_get_double(&(store->par_go2), &line[4], len-5);
-			else if (strncmp("OBO=", line, 4) == 0)
-			    mb_get_double(&(store->par_obo), &line[4], len-5);
-			else if (strncmp("FGD=", line, 4) == 0)
-			    mb_get_double(&(store->par_fgd), &line[4], len-5);
-			    
-			else if (strncmp("TSV=", line, 4) == 0)
-			    strncpy(store->par_tsv, &line[4], MIN(len-5, 15));
-			else if (strncmp("RSV=", line, 4) == 0)
-			    strncpy(store->par_rsv, &line[4], MIN(len-5, 15));
-			else if (strncmp("BSV=", line, 4) == 0)
-			    strncpy(store->par_bsv, &line[4], MIN(len-5, 15));
-			else if (strncmp("PSV=", line, 4) == 0)
-			    {
-			    /* save the processor software version to use
-			       in tracking changes to the data format */
-			    strncpy(store->par_psv, &line[4], MIN(len-5, 15));
-			    if (sscanf(store->par_psv, "%d.%d.%d", &i1, &i2, &i3)
-				== 3)
-				*version = i3 + 100 * i2 + 10000 * i1;
-			    }
-			else if (strncmp("DDS=", line, 4) == 0)
-			    strncpy(store->par_dds, &line[4], MIN(len-5, 15));
-			else if (strncmp("OSV=", line, 4) == 0)
-			    strncpy(store->par_osv, &line[4], MIN(len-5, 15));
-			else if (strncmp("DSV=", line, 4) == 0)
-			    strncpy(store->par_dsv, &line[4], MIN(len-5, 15));
-			else if (strncmp("DSX=", line, 4) == 0)
-			    mb_get_double(&(store->par_dsx), &line[4], len-5);
-			else if (strncmp("DSY=", line, 4) == 0)
-			    mb_get_double(&(store->par_dsy), &line[4], len-5);
-			else if (strncmp("DSZ=", line, 4) == 0)
-			    mb_get_double(&(store->par_dsz), &line[4], len-5);
-			    
-			else if (strncmp("DSD=", line, 4) == 0)
-			    mb_get_int(&(store->par_dsd), &line[4], len-5);
-			else if (strncmp("DSO=", line, 4) == 0)
-			    mb_get_double(&(store->par_dso), &line[4], len-5);
-			else if (strncmp("DSF=", line, 4) == 0)
-			    mb_get_double(&(store->par_dsf), &line[4], len-5);
-			else if (strncmp("DSH=", line, 4) == 0)
-			    {
-			    store->par_dsh[0] = line[4];
-			    store->par_dsh[1] = line[5];
-			    }
-			else if (strncmp("APS=", line, 4) == 0)
-			    mb_get_int(&(store->par_aps), &line[4], len-5);
-			else if (strncmp("P1Q=", line, 4) == 0)
-			    mb_get_int(&(store->par_p1q), &line[4], len-5);
-			else if (strncmp("P1M=", line, 4) == 0)
-			    mb_get_int(&(store->par_p1m), &line[4], len-5);
-			else if (strncmp("P1T=", line, 4) == 0)
-			    mb_get_int(&(store->par_p1t), &line[4], len-5);
-			else if (strncmp("P1Z=", line, 4) == 0)
-			    mb_get_double(&(store->par_p1z), &line[4], len-5);
-			else if (strncmp("P1X=", line, 4) == 0)
-			    mb_get_double(&(store->par_p1x), &line[4], len-5);
-			else if (strncmp("P1Y=", line, 4) == 0)
-			    mb_get_double(&(store->par_p1y), &line[4], len-5);
-			else if (strncmp("P1D=", line, 4) == 0)
-			    mb_get_double(&(store->par_p1d), &line[4], len-5);
-			else if (strncmp("P1G=", line, 4) == 0)
-			    strncpy(store->par_p1g, &line[4], MIN(len-5, 15));
-			else if (strncmp("P2Q=", line, 4) == 0)
-			    mb_get_int(&(store->par_p2q), &line[4], len-5);
-			else if (strncmp("P2M=", line, 4) == 0)
-			    mb_get_int(&(store->par_p2m), &line[4], len-5);
-			else if (strncmp("P2T=", line, 4) == 0)
-			    mb_get_int(&(store->par_p2t), &line[4], len-5);
-			else if (strncmp("P2Z=", line, 4) == 0)
-			    mb_get_double(&(store->par_p2z), &line[4], len-5);
-			else if (strncmp("P2X=", line, 4) == 0)
-			    mb_get_double(&(store->par_p2x), &line[4], len-5);
-			else if (strncmp("P2Y=", line, 4) == 0)
-			    mb_get_double(&(store->par_p2y), &line[4], len-5);
-			else if (strncmp("P2D=", line, 4) == 0)
-			    mb_get_double(&(store->par_p2d), &line[4], len-5);
-			else if (strncmp("P2G=", line, 4) == 0)
-			    strncpy(store->par_p2g, &line[4], MIN(len-5, 15));
-			else if (strncmp("P3Q=", line, 4) == 0)
-			    mb_get_int(&(store->par_p3q), &line[4], len-5);
-			else if (strncmp("P3M=", line, 4) == 0)
-			    mb_get_int(&(store->par_p3m), &line[4], len-5);
-			else if (strncmp("P3T=", line, 4) == 0)
-			    mb_get_int(&(store->par_p3t), &line[4], len-5);
-			else if (strncmp("P3Z=", line, 4) == 0)
-			    mb_get_double(&(store->par_p3z), &line[4], len-5);
-			else if (strncmp("P3X=", line, 4) == 0)
-			    mb_get_double(&(store->par_p3x), &line[4], len-5);
-			else if (strncmp("P3Y=", line, 4) == 0)
-			    mb_get_double(&(store->par_p3y), &line[4], len-5);
-			else if (strncmp("P3D=", line, 4) == 0)
-			    mb_get_double(&(store->par_p3d), &line[4], len-5);
-			else if (strncmp("P3G=", line, 4) == 0)
-			    strncpy(store->par_p3g, &line[4], MIN(len-5, 15));
-			else if (strncmp("P3S=", line, 4) == 0)
-			    mb_get_int(&(store->par_p3s), &line[4], len-5);
-			    
-			else if (strncmp("MSZ=", line, 4) == 0)
-			    mb_get_double(&(store->par_msz), &line[4], len-5);
-			else if (strncmp("MSX=", line, 4) == 0)
-			    mb_get_double(&(store->par_msx), &line[4], len-5);
-			else if (strncmp("MSY=", line, 4) == 0)
-			    mb_get_double(&(store->par_msy), &line[4], len-5);
-			else if (strncmp("MRP=", line, 4) == 0)
-			    {
-			    store->par_mrp[0] = line[4];
-			    store->par_mrp[1] = line[5];
-			    }
-			else if (strncmp("MSD=", line, 4) == 0)
-			    mb_get_double(&(store->par_msd), &line[4], len-5);
-			else if (strncmp("MSR=", line, 4) == 0)
-			    mb_get_double(&(store->par_msr), &line[4], len-5);
-			else if (strncmp("MSP=", line, 4) == 0)
-			    mb_get_double(&(store->par_msp), &line[4], len-5);
-			else if (strncmp("MSG=", line, 4) == 0)
-			    mb_get_double(&(store->par_msg), &line[4], len-5);
-			    
-			else if (strncmp("NSZ=", line, 4) == 0)
-			    mb_get_double(&(store->par_nsz), &line[4], len-5);
-			else if (strncmp("NSX=", line, 4) == 0)
-			    mb_get_double(&(store->par_nsx), &line[4], len-5);
-			else if (strncmp("NSY=", line, 4) == 0)
-			    mb_get_double(&(store->par_nsy), &line[4], len-5);
-			else if (strncmp("NRP=", line, 4) == 0)
-			    {
-			    store->par_nrp[0] = line[4];
-			    store->par_nrp[1] = line[5];
-			    }
-			else if (strncmp("NSD=", line, 4) == 0)
-			    mb_get_double(&(store->par_nsd), &line[4], len-5);
-			else if (strncmp("NSR=", line, 4) == 0)
-			    mb_get_double(&(store->par_nsr), &line[4], len-5);
-			else if (strncmp("NSP=", line, 4) == 0)
-			    mb_get_double(&(store->par_nsp), &line[4], len-5);
-			else if (strncmp("NSG=", line, 4) == 0)
-			    mb_get_double(&(store->par_nsg), &line[4], len-5);
-			    
-			else if (strncmp("GCG=", line, 4) == 0)
-			    mb_get_double(&(store->par_gcg), &line[4], len-5);
-			else if (strncmp("MAS=", line, 4) == 0)
-			    mb_get_double(&(store->par_mas), &line[4], len-5);
-			else if (strncmp("SHC=", line, 4) == 0)
-			    mb_get_int(&(store->par_shc), &line[4], len-5);
-			else if (strncmp("PPS=", line, 4) == 0)
-			    mb_get_int(&(store->par_pps), &line[4], len-5);
-			else if (strncmp("CLS=", line, 4) == 0)
-			    mb_get_int(&(store->par_cls), &line[4], len-5);
-			else if (strncmp("CLO=", line, 4) == 0)
-			    mb_get_int(&(store->par_clo), &line[4], len-5);
-			else if (strncmp("VSN=", line, 4) == 0)
-			    mb_get_int(&(store->par_vsn), &line[4], len-5);
-			else if (strncmp("VSU=", line, 4) == 0)
-			    mb_get_int(&(store->par_vsu), &line[4], len-5);
-			else if (strncmp("VSE=", line, 4) == 0)
-			    mb_get_int(&(store->par_vse), &line[4], len-5);
-			else if (strncmp("VTU=", line, 4) == 0)
-			    mb_get_int(&(store->par_vtu), &line[4], len-5);
-			else if (strncmp("VTE=", line, 4) == 0)
-			    mb_get_int(&(store->par_vte), &line[4], len-5);
-			else if (strncmp("ARO=", line, 4) == 0)
-			    mb_get_int(&(store->par_aro), &line[4], len-5);
-			else if (strncmp("AHE=", line, 4) == 0)
-			    mb_get_int(&(store->par_ahe), &line[4], len-5);
-			else if (strncmp("AHS=", line, 4) == 0)
-			    mb_get_int(&(store->par_ahs), &line[4], len-5);
-			else if (strncmp("VSI=", line, 4) == 0)
-			    strncpy(store->par_vsi, &line[4], MIN(len-5, 15));
-			else if (strncmp("VSM=", line, 4) == 0)
-			    strncpy(store->par_vsm, &line[4], MIN(len-5, 15));
-
-			else if (strncmp("MCA1=", line, 5) == 0)
-			    strncpy(store->par_mca1, &line[5], MIN(len-6, 15));
-			else if (strncmp("MCU1=", line, 5) == 0)
-			    mb_get_int(&(store->par_mcu1), &line[5], len-6);
-			else if (strncmp("MCI1=", line, 5) == 0)
-			    strncpy(store->par_mci1, &line[5], MIN(len-6, 15));
-			else if (strncmp("MCP1=", line, 5) == 0)
-			    mb_get_int(&(store->par_mcp1), &line[5], len-6);
-
-			else if (strncmp("MCA2=", line, 5) == 0)
-			    strncpy(store->par_mca2, &line[5], MIN(len-6, 15));
-			else if (strncmp("MCU2=", line, 5) == 0)
-			    mb_get_int(&(store->par_mcu2), &line[5], len-6);
-			else if (strncmp("MCI2=", line, 5) == 0)
-			    strncpy(store->par_mci2, &line[5], MIN(len-6, 15));
-			else if (strncmp("MCP2=", line, 5) == 0)
-			    mb_get_int(&(store->par_mcp2), &line[5], len-6);
-
-			else if (strncmp("MCA3=", line, 5) == 0)
-			    strncpy(store->par_mca3, &line[5], MIN(len-6, 15));
-			else if (strncmp("MCU3=", line, 5) == 0)
-			    mb_get_int(&(store->par_mcu3), &line[5], len-6);
-			else if (strncmp("MCI3=", line, 5) == 0)
-			    strncpy(store->par_mci3, &line[5], MIN(len-6, 15));
-			else if (strncmp("MCP3=", line, 5) == 0)
-			    mb_get_int(&(store->par_mcp3), &line[5], len-6);
-
-			else if (strncmp("MCA4=", line, 5) == 0)
-			    strncpy(store->par_mca4, &line[5], MIN(len-6, 15));
-			else if (strncmp("MCU4=", line, 5) == 0)
-			    mb_get_int(&(store->par_mcu4), &line[5], len-6);
-			else if (strncmp("MCI4=", line, 5) == 0)
-			    strncpy(store->par_mci4, &line[5], MIN(len-6, 15));
-			else if (strncmp("MCP4=", line, 5) == 0)
-			    mb_get_int(&(store->par_mcp4), &line[5], len-6);
-			else if (strncmp("SNL=", line, 4) == 0)
-			    mb_get_int(&(store->par_snl), &line[4], len-5);
-			    
-			else if (strncmp("CPR=", line, 4) == 0)
-			    strncpy(store->par_cpr, &line[4], MIN(len-5, 3));
-			else if (strncmp("ROP=", line, 4) == 0)
-			    strncpy(store->par_rop, &line[4], MIN(len-5, MBSYS_SIMRAD3_COMMENT_LENGTH-1));
-			else if (strncmp("SID=", line, 4) == 0)
-			    strncpy(store->par_sid, &line[4], MIN(len-5, MBSYS_SIMRAD3_COMMENT_LENGTH-1));
-			else if (strncmp("RFN=", line, 4) == 0)
-			    strncpy(store->par_rfn, &line[4], MIN(len-5, MBSYS_SIMRAD3_COMMENT_LENGTH-1));
-			else if (strncmp("PLL=", line, 4) == 0)
-			    strncpy(store->par_pll, &line[4], MIN(len-5, MBSYS_SIMRAD3_COMMENT_LENGTH-1));
-			else if (strncmp("COM=", line, 4) == 0)
-			    {
-			    strncpy(store->par_com, &line[4], MIN(len-5, MBSYS_SIMRAD3_COMMENT_LENGTH-1));
-			    store->par_com[MIN(len-5, MBSYS_SIMRAD3_COMMENT_LENGTH-1)] = 0;
-			    /* replace caret (^) values with commas (,) to circumvent
-			       the format's inability to store commas in comments */
-			    while ((comma_ptr = strchr(store->par_com, '^')) != NULL)
-				{
-				comma_ptr[0] = ',';
-				}
-			    }
-			len = 0;
-			}
-		else if (status == MB_SUCCESS
-			&& line[len-1] == ','
-			&& len <= 5)
-			{
-			len = 0;
-			}
-		}
-
-	/* now set the data kind */
-	if (status == MB_SUCCESS)
-		{
-		if (strlen(store->par_com) > 0)
-		    store->kind = MB_DATA_COMMENT;
-		else if (store->type == EM3_START)
-		    store->kind = MB_DATA_START;
-		else if (store->type == EM3_STOP)
-		    store->kind = MB_DATA_STOP;
-		}
-
-	/* read end of record and last two check sum bytes */
-	if (status == MB_SUCCESS)
-	    {
-	    /* if EM3_END not yet found then the
-		next byte should be EM3_END */
-	    if (line[0] != EM3_END)
-		{
-		read_len = (size_t)1;
-		status = mb_fileio_get(verbose, mbio_ptr, (char *)&line[0], &read_len, error);
-		}
-
-	    /* if EM3_END not yet found then the
-		next byte should be EM3_END */
-	    if (line[0] != EM3_END)
-		{
-		read_len = (size_t)1;
-		status = mb_fileio_get(verbose, mbio_ptr, (char *)&line[0], &read_len, error);
-		}
-
-	    /* if we got the end byte then get check sum bytes */
-	    if (line[0] == EM3_END)
-		{
-		if (line[0] == EM3_END)
-			*goodend = MB_YES;
-		read_len = (size_t)2;
-		status = mb_fileio_get(verbose, mbio_ptr, (char *)&line[1], &read_len, error);
-	    /* don't check success of read
-	        - return success here even if read fails
-	        because all of the
-		important information in this record has
-		already been read - next attempt to read
-		file will return error */
-#ifdef MBR_EM710RAW_DEBUG
-	fprintf(stderr, "End Bytes: %2.2hhX %d | %2.2hhX %d | %2.2hhX %d\n",
-		line[0], line[0],
-		line[1], line[1],
-		line[2], line[2]);
-#endif
-		}
-#ifdef MBR_EM710RAW_DEBUG
-	fprintf(stderr, "\n");
-#endif
-	    }
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       par_date:        %d\n",store->par_date);
-		fprintf(stderr,"dbg5       par_msec:        %d\n",store->par_msec);
-		fprintf(stderr,"dbg5       par_line_num:    %d\n",store->par_line_num);
-		fprintf(stderr,"dbg5       par_serial_1:    %d\n",store->par_serial_1);
-		fprintf(stderr,"dbg5       par_serial_2:    %d\n",store->par_serial_2);
-		fprintf(stderr,"dbg5       par_wlz:         %f\n",store->par_wlz);
-		fprintf(stderr,"dbg5       par_smh:         %d\n",store->par_smh);
-		fprintf(stderr,"dbg5       par_hun:         %d\n",store->par_hun);
-		fprintf(stderr,"dbg5       par_hut:         %f\n",store->par_hut);
-		fprintf(stderr,"dbg5       par_txs:         %d\n",store->par_txs);
-		fprintf(stderr,"dbg5       par_t2x:         %d\n",store->par_t2x);
-		fprintf(stderr,"dbg5       par_r1s:         %d\n",store->par_r1s);
-		fprintf(stderr,"dbg5       par_r2s:         %d\n",store->par_r2s);
-		fprintf(stderr,"dbg5       par_stc:         %d\n",store->par_stc);
-		fprintf(stderr,"dbg5       par_s0z:         %f\n",store->par_s0z);
-		fprintf(stderr,"dbg5       par_s0x:         %f\n",store->par_s0x);
-		fprintf(stderr,"dbg5       par_s0y:         %f\n",store->par_s0y);
-		fprintf(stderr,"dbg5       par_s0h:         %f\n",store->par_s0h);
-		fprintf(stderr,"dbg5       par_s0r:         %f\n",store->par_s0r);
-		fprintf(stderr,"dbg5       par_s0p:         %f\n",store->par_s0p);
-		fprintf(stderr,"dbg5       par_s1z:         %f\n",store->par_s1z);
-		fprintf(stderr,"dbg5       par_s1x:         %f\n",store->par_s1x);
-		fprintf(stderr,"dbg5       par_s1y:         %f\n",store->par_s1y);
-		fprintf(stderr,"dbg5       par_s1h:         %f\n",store->par_s1h);
-		fprintf(stderr,"dbg5       par_s1r:         %f\n",store->par_s1r);
-		fprintf(stderr,"dbg5       par_s1p:         %f\n",store->par_s1p);
-		fprintf(stderr,"dbg5       par_s1n:         %d\n",store->par_s1n);
-		fprintf(stderr,"dbg5       par_s2z:         %f\n",store->par_s2z);
-		fprintf(stderr,"dbg5       par_s2x:         %f\n",store->par_s2x);
-		fprintf(stderr,"dbg5       par_s2y:         %f\n",store->par_s2y);
-		fprintf(stderr,"dbg5       par_s2h:         %f\n",store->par_s2h);
-		fprintf(stderr,"dbg5       par_s2r:         %f\n",store->par_s2r);
-		fprintf(stderr,"dbg5       par_s2p:         %f\n",store->par_s2p);
-		fprintf(stderr,"dbg5       par_s2n:         %d\n",store->par_s2n);
-		fprintf(stderr,"dbg5       par_s3z:         %f\n",store->par_s3z);
-		fprintf(stderr,"dbg5       par_s3x:         %f\n",store->par_s3x);
-		fprintf(stderr,"dbg5       par_s3y:         %f\n",store->par_s3y);
-		fprintf(stderr,"dbg5       par_s3h:         %f\n",store->par_s3h);
-		fprintf(stderr,"dbg5       par_s3r:         %f\n",store->par_s3r);
-		fprintf(stderr,"dbg5       par_s3p:         %f\n",store->par_s3p);
-		fprintf(stderr,"dbg5       par_s1s:         %d\n",store->par_s1s);
-		fprintf(stderr,"dbg5       par_s2s:         %d\n",store->par_s2s);
-		fprintf(stderr,"dbg5       par_go1:         %f\n",store->par_go1);
-		fprintf(stderr,"dbg5       par_go2:         %f\n",store->par_go2);
-		fprintf(stderr,"dbg5       par_obo:         %f\n",store->par_obo);
-		fprintf(stderr,"dbg5       par_fgd:         %f\n",store->par_fgd);
-		fprintf(stderr,"dbg5       par_tsv:         %s\n",store->par_tsv);
-		fprintf(stderr,"dbg5       par_rsv:         %s\n",store->par_rsv);
-		fprintf(stderr,"dbg5       par_bsv:         %s\n",store->par_bsv);
-		fprintf(stderr,"dbg5       par_psv:         %s\n",store->par_psv);
-		fprintf(stderr,"dbg5       par_dds:         %s\n",store->par_dds);
-		fprintf(stderr,"dbg5       par_osv:         %s\n",store->par_osv);
-		fprintf(stderr,"dbg5       par_dsv:         %s\n",store->par_dsv);
-		fprintf(stderr,"dbg5       par_dsx:         %f\n",store->par_dsx);
-		fprintf(stderr,"dbg5       par_dsy:         %f\n",store->par_dsy);
-		fprintf(stderr,"dbg5       par_dsz:         %f\n",store->par_dsz);
-		fprintf(stderr,"dbg5       par_dsd:         %d\n",store->par_dsd);
-		fprintf(stderr,"dbg5       par_dso:         %f\n",store->par_dso);
-		fprintf(stderr,"dbg5       par_dsf:         %f\n",store->par_dsf);
-		fprintf(stderr,"dbg5       par_dsh:         %c%c\n",store->par_dsh[0],store->par_dsh[1]);
-		fprintf(stderr,"dbg5       par_aps:         %d\n",store->par_aps);
-		fprintf(stderr,"dbg5       par_p1q:         %d\n",store->par_p1q);
-		fprintf(stderr,"dbg5       par_p1m:         %d\n",store->par_p1m);
-		fprintf(stderr,"dbg5       par_p1t:         %d\n",store->par_p1t);
-		fprintf(stderr,"dbg5       par_p1z:         %f\n",store->par_p1z);
-		fprintf(stderr,"dbg5       par_p1x:         %f\n",store->par_p1x);
-		fprintf(stderr,"dbg5       par_p1y:         %f\n",store->par_p1y);
-		fprintf(stderr,"dbg5       par_p1d:         %f\n",store->par_p1d);
-		fprintf(stderr,"dbg5       par_p1g:         %s\n",store->par_p1g);
-		fprintf(stderr,"dbg5       par_p2q:         %d\n",store->par_p2q);
-		fprintf(stderr,"dbg5       par_p2m:         %d\n",store->par_p2m);
-		fprintf(stderr,"dbg5       par_p2t:         %d\n",store->par_p2t);
-		fprintf(stderr,"dbg5       par_p2z:         %f\n",store->par_p2z);
-		fprintf(stderr,"dbg5       par_p2x:         %f\n",store->par_p2x);
-		fprintf(stderr,"dbg5       par_p2y:         %f\n",store->par_p2y);
-		fprintf(stderr,"dbg5       par_p2d:         %f\n",store->par_p2d);
-		fprintf(stderr,"dbg5       par_p2g:         %s\n",store->par_p2g);
-		fprintf(stderr,"dbg5       par_p3q:         %d\n",store->par_p3q);
-		fprintf(stderr,"dbg5       par_p3m:         %d\n",store->par_p3m);
-		fprintf(stderr,"dbg5       par_p3t:         %d\n",store->par_p3t);
-		fprintf(stderr,"dbg5       par_p3z:         %f\n",store->par_p3z);
-		fprintf(stderr,"dbg5       par_p3x:         %f\n",store->par_p3x);
-		fprintf(stderr,"dbg5       par_p3y:         %f\n",store->par_p3y);
-		fprintf(stderr,"dbg5       par_p3d:         %f\n",store->par_p3d);
-		fprintf(stderr,"dbg5       par_p3g:         %s\n",store->par_p3g);
-		fprintf(stderr,"dbg5       par_p3s:         %d\n",store->par_p3s);
-		fprintf(stderr,"dbg5       par_msz:         %f\n",store->par_msz);
-		fprintf(stderr,"dbg5       par_msx:         %f\n",store->par_msx);
-		fprintf(stderr,"dbg5       par_msy:         %f\n",store->par_msy);
-		fprintf(stderr,"dbg5       par_mrp:         %c%c\n",store->par_mrp[0],store->par_mrp[1]);
-		fprintf(stderr,"dbg5       par_msd:         %f\n",store->par_msd);
-		fprintf(stderr,"dbg5       par_msr:         %f\n",store->par_msr);
-		fprintf(stderr,"dbg5       par_msp:         %f\n",store->par_msp);
-		fprintf(stderr,"dbg5       par_msg:         %f\n",store->par_msg);
-		fprintf(stderr,"dbg5       par_nsz:         %f\n",store->par_nsz);
-		fprintf(stderr,"dbg5       par_nsx:         %f\n",store->par_nsx);
-		fprintf(stderr,"dbg5       par_nsy:         %f\n",store->par_nsy);
-		fprintf(stderr,"dbg5       par_nrp:         %c%c\n",store->par_nrp[0],store->par_nrp[1]);
-		fprintf(stderr,"dbg5       par_nsd:         %f\n",store->par_nsd);
-		fprintf(stderr,"dbg5       par_nsr:         %f\n",store->par_nsr);
-		fprintf(stderr,"dbg5       par_nsp:         %f\n",store->par_nsp);
-		fprintf(stderr,"dbg5       par_nsg:         %f\n",store->par_nsg);
-		fprintf(stderr,"dbg5       par_gcg:         %f\n",store->par_gcg);
-		fprintf(stderr,"dbg5       par_mas:         %f\n",store->par_mas);
-		fprintf(stderr,"dbg5       par_shc:         %d\n",store->par_shc);
-		fprintf(stderr,"dbg5       par_pps:         %d\n",store->par_pps);
-		fprintf(stderr,"dbg5       par_cls:         %d\n",store->par_cls);
-		fprintf(stderr,"dbg5       par_clo:         %d\n",store->par_clo);
-		fprintf(stderr,"dbg5       par_vsn:         %d\n",store->par_vsn);
-		fprintf(stderr,"dbg5       par_vsu:         %d\n",store->par_vsu);
-		fprintf(stderr,"dbg5       par_vse:         %d\n",store->par_vse);
-		fprintf(stderr,"dbg5       par_vtu:         %d\n",store->par_vtu);
-		fprintf(stderr,"dbg5       par_vte:         %d\n",store->par_vte);
-		fprintf(stderr,"dbg5       par_aro:         %d\n",store->par_aro);
-		fprintf(stderr,"dbg5       par_ahe:         %d\n",store->par_ahe);
-		fprintf(stderr,"dbg5       par_ahs:         %d\n",store->par_ahs);
-		fprintf(stderr,"dbg5       par_vsi:         %s\n",store->par_vsi);
-		fprintf(stderr,"dbg5       par_vsm:         %s\n",store->par_vsm);
-		fprintf(stderr,"dbg5       par_mca1:        %s\n",store->par_mca1);
-		fprintf(stderr,"dbg5       par_mcu1:        %d\n",store->par_mcu1);
-		fprintf(stderr,"dbg5       par_mci1:        %s\n",store->par_mci1);
-		fprintf(stderr,"dbg5       par_mcp1:        %d\n",store->par_mcp1);
-		fprintf(stderr,"dbg5       par_mca2:        %s\n",store->par_mca2);
-		fprintf(stderr,"dbg5       par_mcu2:        %d\n",store->par_mcu2);
-		fprintf(stderr,"dbg5       par_mci2:        %s\n",store->par_mci2);
-		fprintf(stderr,"dbg5       par_mcp2:        %d\n",store->par_mcp2);
-		fprintf(stderr,"dbg5       par_mca3:        %s\n",store->par_mca3);
-		fprintf(stderr,"dbg5       par_mcu3:        %d\n",store->par_mcu3);
-		fprintf(stderr,"dbg5       par_mci3:        %s\n",store->par_mci3);
-		fprintf(stderr,"dbg5       par_mcp3:        %d\n",store->par_mcp3);
-		fprintf(stderr,"dbg5       par_mca4:        %s\n",store->par_mca4);
-		fprintf(stderr,"dbg5       par_mcu4:        %d\n",store->par_mcu4);
-		fprintf(stderr,"dbg5       par_mci4:        %s\n",store->par_mci4);
-		fprintf(stderr,"dbg5       par_mcp4:        %d\n",store->par_mcp4);
-		fprintf(stderr,"dbg5       par_snl:         %d\n",store->par_snl);
-		fprintf(stderr,"dbg5       par_cpr:         %s\n",store->par_cpr);
-		fprintf(stderr,"dbg5       par_rop:         %s\n",store->par_rop);
-		fprintf(stderr,"dbg5       par_sid:         %s\n",store->par_sid);
-		fprintf(stderr,"dbg5       par_rfn:         %s\n",store->par_rfn);
-		fprintf(stderr,"dbg5       par_pll:         %s\n",store->par_pll);
-		fprintf(stderr,"dbg5       par_com:         %s\n",store->par_com);
-		}
-
-		
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       version:    %d\n",*version);
-		fprintf(stderr,"dbg2       num_sonars: %d\n",*num_sonars);
-		fprintf(stderr,"dbg2       goodend:    %d\n",*goodend);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em710raw_rd_run_parameter(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store,
-		short sonar, int *goodend, int *error)
-{
-	char	*function_name = "mbr_em710raw_rd_run_parameter";
-	int	status = MB_SUCCESS;
-	char	line[EM3_RUN_PARAMETER_SIZE];
-	short	short_val;
-	size_t	read_len;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		fprintf(stderr,"dbg2       sonar:      %d\n",sonar);
-		}
-
-	/* set goodend false until a good end is found */
-	*goodend = MB_NO;
-
-	/* set kind and type values */
-	store->kind = MB_DATA_RUN_PARAMETER;
-	store->type = EM3_RUN_PARAMETER;
-	store->sonar = sonar;
-
-	/* read binary values into char array */
-	read_len = (size_t)(EM3_RUN_PARAMETER_SIZE-4);
-	status = mb_fileio_get(verbose, mbio_ptr, (char *)line, &read_len, error);
-
-	/* get binary data */
-	if (status == MB_SUCCESS)
-		{
-		mb_get_binary_int(swap, &line[0], &store->run_date);
-		    if (store->run_date != 0) store->date = store->run_date;
-		mb_get_binary_int(swap, &line[4], &store->run_msec);
-		    if (store->run_date != 0) store->msec = store->run_msec;
-		mb_get_binary_short(swap, &line[8], &short_val);
-		    store->run_ping_count = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[10], &short_val);
-		    store->run_serial = (int) ((unsigned short) short_val);
-		mb_get_binary_int(swap, &line[12], &store->run_status);
-		store->run_mode = (mb_u_char) line[16];
-		store->run_filter_id = (mb_u_char) line[17];
-		mb_get_binary_short(swap, &line[18], &short_val);
-		    store->run_min_depth = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[20], &short_val);
-		    store->run_max_depth = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[22], &short_val);
-		    store->run_absorption = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[24], &short_val);
-		    store->run_tran_pulse = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[26], &short_val);
-		    store->run_tran_beam = (int) ((unsigned short) short_val);
-		store->run_tran_pow = (mb_u_char) line[28];
-		store->run_rec_beam = (mb_u_char) line[29];
-		store->run_rec_band = (mb_u_char) line[30];
-		store->run_rec_gain = (mb_u_char) line[31];
-		store->run_tvg_cross = (mb_u_char) line[32];
-		store->run_ssv_source = (mb_u_char) line[33];
-		mb_get_binary_short(swap, &line[34], &short_val);
-		    store->run_max_swath = (int) ((unsigned short) short_val);
-		store->run_beam_space = (mb_u_char) line[36];
-		store->run_swath_angle = (mb_u_char) line[37];
-		store->run_stab_mode = (mb_u_char) line[38];
-		for (i=0;i<6;i++)
-		    store->run_spare[i] = line[39+i];
-		if (line[EM3_RUN_PARAMETER_SIZE-7] == EM3_END)
-			*goodend = MB_YES;
-#ifdef MBR_EM710RAW_DEBUG
-	fprintf(stderr, "End Bytes: %2.2hhX %d | %2.2hhX %d | %2.2hhX %d\n",
-		line[EM3_RUN_PARAMETER_SIZE-7], line[EM3_RUN_PARAMETER_SIZE-7],
-		line[EM3_RUN_PARAMETER_SIZE-6], line[EM3_RUN_PARAMETER_SIZE-6],
-		line[EM3_RUN_PARAMETER_SIZE-5], line[EM3_RUN_PARAMETER_SIZE-5]);
-#endif
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       run_date:        %d\n",store->run_date);
-		fprintf(stderr,"dbg5       run_msec:        %d\n",store->run_msec);
-		fprintf(stderr,"dbg5       run_ping_count:  %d\n",store->run_ping_count);
-		fprintf(stderr,"dbg5       run_serial:      %d\n",store->run_serial);
-		fprintf(stderr,"dbg5       run_status:      %d\n",store->run_status);
-		fprintf(stderr,"dbg5       run_mode:        %d\n",store->run_mode);
-		fprintf(stderr,"dbg5       run_filter_id:   %d\n",store->run_filter_id);
-		fprintf(stderr,"dbg5       run_min_depth:   %d\n",store->run_min_depth);
-		fprintf(stderr,"dbg5       run_max_depth:   %d\n",store->run_max_depth);
-		fprintf(stderr,"dbg5       run_absorption:  %d\n",store->run_absorption);
-		fprintf(stderr,"dbg5       run_tran_pulse:  %d\n",store->run_tran_pulse);
-		fprintf(stderr,"dbg5       run_tran_beam:   %d\n",store->run_tran_beam);
-		fprintf(stderr,"dbg5       run_tran_pow:    %d\n",store->run_tran_pow);
-		fprintf(stderr,"dbg5       run_rec_beam:    %d\n",store->run_rec_beam);
-		fprintf(stderr,"dbg5       run_rec_band:    %d\n",store->run_rec_band);
-		fprintf(stderr,"dbg5       run_rec_gain:    %d\n",store->run_rec_gain);
-		fprintf(stderr,"dbg5       run_tvg_cross:   %d\n",store->run_tvg_cross);
-		fprintf(stderr,"dbg5       run_ssv_source:  %d\n",store->run_ssv_source);
-		fprintf(stderr,"dbg5       run_max_swath:   %d\n",store->run_max_swath);
-		fprintf(stderr,"dbg5       run_beam_space:  %d\n",store->run_beam_space);
-		fprintf(stderr,"dbg5       run_swath_angle: %d\n",store->run_swath_angle);
-		fprintf(stderr,"dbg5       run_stab_mode:   %d\n",store->run_stab_mode);
-		for (i=0;i<6;i++)
-			fprintf(stderr,"dbg5       run_spare[%d]:    %d\n",i,store->run_spare[i]);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       goodend:    %d\n",*goodend);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em710raw_rd_clock(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store,
-		short sonar, int *goodend, int *error)
-{
-	char	*function_name = "mbr_em710raw_rd_clock";
-	int	status = MB_SUCCESS;
-	char	line[EM3_CLOCK_SIZE];
-	short	short_val;
-	size_t	read_len;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		fprintf(stderr,"dbg2       sonar:      %d\n",sonar);
-		}
-
-	/* set goodend false until a good end is found */
-	*goodend = MB_NO;
-
-	/* set kind and type values */
-	store->kind = MB_DATA_CLOCK;
-	store->type = EM3_CLOCK;
-	store->sonar = sonar;
-
-	/* read binary values into char array */
-	read_len = (size_t)(EM3_CLOCK_SIZE-4);
-	status = mb_fileio_get(verbose, mbio_ptr, (char *)line, &read_len, error);
-
-	/* get binary data */
-	if (status == MB_SUCCESS)
-		{
-		mb_get_binary_int(swap, &line[0], &store->clk_date);
-		    store->date = store->clk_date;
-		mb_get_binary_int(swap, &line[4], &store->clk_msec);
-		    store->msec = store->clk_msec;
-		mb_get_binary_short(swap, &line[8], &short_val);
-		    store->clk_count = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[10], &short_val);
-		    store->clk_serial = (int) ((unsigned short) short_val);
-		mb_get_binary_int(swap, &line[12], &store->clk_origin_date);
-		mb_get_binary_int(swap, &line[16], &store->clk_origin_msec);
-		store->clk_1_pps_use = (mb_u_char) line[20];
-		if (line[EM3_CLOCK_SIZE-7] == EM3_END)
-			*goodend = MB_YES;
-#ifdef MBR_EM710RAW_DEBUG
-	fprintf(stderr, "End Bytes: %2.2hhX %d | %2.2hhX %d | %2.2hhX %d\n",
-		line[EM3_CLOCK_SIZE-7], line[EM3_CLOCK_SIZE-7],
-		line[EM3_CLOCK_SIZE-6], line[EM3_CLOCK_SIZE-6],
-		line[EM3_CLOCK_SIZE-5], line[EM3_CLOCK_SIZE-5]);
-#endif
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       clk_date:        %d\n",store->clk_date);
-		fprintf(stderr,"dbg5       clk_msec:        %d\n",store->clk_msec);
-		fprintf(stderr,"dbg5       clk_count:       %d\n",store->clk_count);
-		fprintf(stderr,"dbg5       clk_serial:      %d\n",store->clk_serial);
-		fprintf(stderr,"dbg5       clk_origin_date: %d\n",store->clk_origin_date);
-		fprintf(stderr,"dbg5       clk_origin_msec: %d\n",store->clk_origin_msec);
-		fprintf(stderr,"dbg5       clk_1_pps_use:   %d\n",store->clk_1_pps_use);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       goodend:    %d\n",*goodend);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em710raw_rd_tide(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store,
-		short sonar, int *goodend, int *error)
-{
-	char	*function_name = "mbr_em710raw_rd_tide";
-	int	status = MB_SUCCESS;
-	char	line[EM3_TIDE_SIZE];
-	short	short_val;
-	size_t	read_len;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		fprintf(stderr,"dbg2       sonar:      %d\n",sonar);
-		}
-
-	/* set goodend false until a good end is found */
-	*goodend = MB_NO;
-
-	/* set kind and type values */
-	store->kind = MB_DATA_TIDE;
-	store->type = EM3_TIDE;
-	store->sonar = sonar;
-
-	/* read binary values into char array */
-	read_len = (size_t)(EM3_TIDE_SIZE-4);
-	status = mb_fileio_get(verbose, mbio_ptr, (char *)line, &read_len, error);
-
-	/* get binary data */
-	if (status == MB_SUCCESS)
-		{
-		mb_get_binary_int(swap, &line[0], &store->tid_date);
-		    store->date = store->tid_date;
-		mb_get_binary_int(swap, &line[4], &store->tid_msec);
-		    store->msec = store->tid_msec;
-		mb_get_binary_short(swap, &line[8], &short_val);
-		    store->tid_count = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[10], &short_val);
-		    store->tid_serial = (int) ((unsigned short) short_val);
-		mb_get_binary_int(swap, &line[12], &store->tid_origin_date);
-		mb_get_binary_int(swap, &line[16], &store->tid_origin_msec);
-		mb_get_binary_short(swap, &line[20], &short_val);
-		    store->tid_tide = (int) short_val;
-		if (line[EM3_TIDE_SIZE-7] == 0x03)
-			*goodend = MB_YES;
-#ifdef MBR_EM710RAW_DEBUG
-	fprintf(stderr, "End Bytes: %2.2hhX %d | %2.2hhX %d | %2.2hhX %d\n",
-		line[EM3_TIDE_SIZE-7], line[EM3_TIDE_SIZE-7],
-		line[EM3_TIDE_SIZE-6], line[EM3_TIDE_SIZE-6],
-		line[EM3_TIDE_SIZE-5], line[EM3_TIDE_SIZE-5]);
-#endif
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       tid_date:        %d\n",store->tid_date);
-		fprintf(stderr,"dbg5       tid_msec:        %d\n",store->tid_msec);
-		fprintf(stderr,"dbg5       tid_count:       %d\n",store->tid_count);
-		fprintf(stderr,"dbg5       tid_serial:      %d\n",store->tid_serial);
-		fprintf(stderr,"dbg5       tid_origin_date: %d\n",store->tid_origin_date);
-		fprintf(stderr,"dbg5       tid_origin_msec: %d\n",store->tid_origin_msec);
-		fprintf(stderr,"dbg5       tid_tide:        %d\n",store->tid_tide);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       goodend:    %d\n",*goodend);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em710raw_rd_height(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store,
-		short sonar, int *goodend, int *error)
-{
-	char	*function_name = "mbr_em710raw_rd_height";
-	int	status = MB_SUCCESS;
-	char	line[EM3_HEIGHT_SIZE];
-	short	short_val;
-	size_t	read_len;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		fprintf(stderr,"dbg2       sonar:      %d\n",sonar);
-		}
-
-	/* set goodend false until a good end is found */
-	*goodend = MB_NO;
-
-	/* set kind and type values */
-	store->kind = MB_DATA_HEIGHT;
-	store->type = EM3_HEIGHT;
-	store->sonar = sonar;
-
-	/* read binary values into char array */
-	read_len = (size_t)(EM3_HEIGHT_SIZE-4);
-	status = mb_fileio_get(verbose, mbio_ptr, (char *)line, &read_len, error);
-
-	/* get binary data */
-	if (status == MB_SUCCESS)
-		{
-		mb_get_binary_int(swap, &line[0], &store->hgt_date);
-		    store->date = store->hgt_date;
-		mb_get_binary_int(swap, &line[4], &store->hgt_msec);
-		    store->msec = store->hgt_msec;
-		mb_get_binary_short(swap, &line[8], &short_val);
-		    store->hgt_count = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[10], &short_val);
-		    store->hgt_serial = (int) ((unsigned short) short_val);
-		mb_get_binary_int(swap, &line[12], &store->hgt_height);
-		store->hgt_type = (mb_u_char) line[16];
-		if (line[EM3_HEIGHT_SIZE-7] == EM3_END)
-			*goodend = MB_YES;
-#ifdef MBR_EM710RAW_DEBUG
-	fprintf(stderr, "End Bytes: %2.2hhX %d | %2.2hhX %d | %2.2hhX %d\n",
-		line[EM3_HEIGHT_SIZE-7], line[EM3_HEIGHT_SIZE-7],
-		line[EM3_HEIGHT_SIZE-6], line[EM3_HEIGHT_SIZE-6],
-		line[EM3_HEIGHT_SIZE-5], line[EM3_HEIGHT_SIZE-5]);
-#endif
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       hgt_date:        %d\n",store->hgt_date);
-		fprintf(stderr,"dbg5       hgt_msec:        %d\n",store->hgt_msec);
-		fprintf(stderr,"dbg5       hgt_count:       %d\n",store->hgt_count);
-		fprintf(stderr,"dbg5       hgt_serial:      %d\n",store->hgt_serial);
-		fprintf(stderr,"dbg5       hgt_height:      %d\n",store->hgt_height);
-		fprintf(stderr,"dbg5       hgt_type:        %d\n",store->hgt_type);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       goodend:    %d\n",*goodend);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em710raw_rd_heading(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store,
-		short sonar, int *goodend, int *error)
-{
-	char	*function_name = "mbr_em710raw_rd_heading";
-	int	status = MB_SUCCESS;
-	struct mbsys_simrad3_heading_struct *heading;
-	char	line[EM3_HEADING_HEADER_SIZE];
-	short	short_val;
-	size_t	read_len;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		fprintf(stderr,"dbg2       sonar:      %d\n",sonar);
-		}
-
-	/* set goodend false until a good end is found */
-	*goodend = MB_NO;
-
-	/* get  storage structure */
-	heading = (struct mbsys_simrad3_heading_struct *) store->heading;
-
-	/* set kind and type values */
-	store->kind = MB_DATA_HEADING;
-	store->type = EM3_HEADING;
-	store->sonar = sonar;
-
-	/* read binary header values into char array */
-	read_len = (size_t)(EM3_HEADING_HEADER_SIZE);
-	status = mb_fileio_get(verbose, mbio_ptr, (char *)line, &read_len, error);
-
-	/* get binary header data */
-	if (status == MB_SUCCESS)
-		{
-		mb_get_binary_int(swap, &line[0], &heading->hed_date);
-		    store->date = heading->hed_date;
-		mb_get_binary_int(swap, &line[4], &heading->hed_msec);
-		    store->msec = heading->hed_msec;
-		mb_get_binary_short(swap, &line[8], &short_val);
-		    heading->hed_count = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[10], &short_val);
-		    heading->hed_serial = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[12], &short_val);
-		    heading->hed_ndata = (int) ((unsigned short) short_val);
-		}
-
-	/* read binary heading values */
-	if (status == MB_SUCCESS)
-	    {
-	    for (i=0;i<heading->hed_ndata && status == MB_SUCCESS;i++)
-		{
-		read_len = (size_t)(EM3_HEADING_SLICE_SIZE);
-		status = mb_fileio_get(verbose, mbio_ptr, (char *)line, &read_len, error);
-		if (status == MB_SUCCESS
-			&& i < MBSYS_SIMRAD3_MAXHEADING)
-			{
-			mb_get_binary_short(swap, &line[0], &short_val);
-			    heading->hed_time[i] = (int) ((unsigned short) short_val);
-			mb_get_binary_short(swap, &line[2], &short_val);
-			    heading->hed_heading[i] = (int) ((unsigned short) short_val);
-			}
-		}
-	    heading->hed_ndata = MIN(heading->hed_ndata, MBSYS_SIMRAD3_MAXHEADING);
-	    }
-
-	/* now get last bytes of record */
-	if (status == MB_SUCCESS)
-		{
-		read_len = (size_t)4;
-		status = mb_fileio_get(verbose, mbio_ptr, (char *)line, &read_len, error);
-		if (status == MB_SUCCESS)
-			{
-			heading->hed_heading_status = (mb_u_char) line[0];
-			}
-		else
-			{
-			/* return success here because all of the
-			    important information in this record has
-			    already been read - next attempt to read
-			    file will return error */
-			status = MB_SUCCESS;
-			*error = MB_ERROR_NO_ERROR;
-			}
-		if (line[1] == EM3_END)
-			*goodend = MB_YES;
-#ifdef MBR_EM710RAW_DEBUG
-	fprintf(stderr, "End Bytes: %2.2hhX %d | %2.2hhX %d | %2.2hhX %d\n",
-		line[1], line[1],
-		line[2], line[2],
-		line[3], line[3]);
-#endif
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       hed_date:        %d\n",heading->hed_date);
-		fprintf(stderr,"dbg5       hed_msec:        %d\n",heading->hed_msec);
-		fprintf(stderr,"dbg5       hed_count:       %d\n",heading->hed_count);
-		fprintf(stderr,"dbg5       hed_serial:      %d\n",heading->hed_serial);
-		fprintf(stderr,"dbg5       hed_ndata:       %d\n",heading->hed_ndata);
-		fprintf(stderr,"dbg5       count    time (msec)    heading (0.01 deg)\n");
-		fprintf(stderr,"dbg5       -----    -----------    ------------------\n");
-		for (i=0;i<heading->hed_ndata;i++)
-			fprintf(stderr,"dbg5        %4d      %7d          %7d\n",
-				i, heading->hed_time[i], heading->hed_heading[i]);
-		fprintf(stderr,"dbg5       hed_heading_status: %d\n",heading->hed_heading_status);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       goodend:    %d\n",*goodend);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em710raw_rd_ssv(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store,
-		short sonar, int *goodend, int *error)
-{
-	char	*function_name = "mbr_em710raw_rd_ssv";
-	int	status = MB_SUCCESS;
-	struct mbsys_simrad3_ssv_struct *ssv;
-	char	line[EM3_SSV_HEADER_SIZE];
-	short	short_val;
-	size_t	read_len;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		fprintf(stderr,"dbg2       sonar:      %d\n",sonar);
-		}
-
-	/* set goodend false until a good end is found */
-	*goodend = MB_NO;
-
-	/* get  storage structure */
-	ssv = (struct mbsys_simrad3_ssv_struct *) store->ssv;
-
-	/* set kind and type values */
-	store->kind = MB_DATA_SSV;
-	store->type = EM3_SSV;
-	store->sonar = sonar;
-
-	/* read binary header values into char array */
-	read_len = (size_t)EM3_SSV_HEADER_SIZE;
-	status = mb_fileio_get(verbose, mbio_ptr, (char *)line, &read_len, error);
-
-	/* get binary header data */
-	if (status == MB_SUCCESS)
-		{
-		mb_get_binary_int(swap, &line[0], &ssv->ssv_date);
-		    store->date = ssv->ssv_date;
-		mb_get_binary_int(swap, &line[4], &ssv->ssv_msec);
-		    store->msec = ssv->ssv_msec;
-		mb_get_binary_short(swap, &line[8], &short_val);
-		    ssv->ssv_count = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[10], &short_val);
-		    ssv->ssv_serial = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[12], &short_val);
-		    ssv->ssv_ndata = (int) ((unsigned short) short_val);
-		}
-
-	/* read binary ssv values */
-	if (status == MB_SUCCESS)
-	    {
-	    for (i=0;i<ssv->ssv_ndata && status == MB_SUCCESS;i++)
-		{
-		read_len = (size_t)EM3_SSV_SLICE_SIZE;
-		status = mb_fileio_get(verbose, mbio_ptr, (char *)line, &read_len, error);
-		if (status == MB_SUCCESS
-			&& i < MBSYS_SIMRAD3_MAXSSV)
-			{
-			mb_get_binary_short(swap, &line[0], &short_val);
-			    ssv->ssv_time[i] = (int) ((unsigned short) short_val);
-			mb_get_binary_short(swap, &line[2], &short_val);
-			    ssv->ssv_ssv[i] = (int) ((unsigned short) short_val);
-			}
-		}
-	    ssv->ssv_ndata = MIN(ssv->ssv_ndata, MBSYS_SIMRAD3_MAXSSV);
-	    }
-
-	/* now get last bytes of record */
-	if (status == MB_SUCCESS)
-		{
-		read_len = (size_t)4;
-		status = mb_fileio_get(verbose, mbio_ptr, (char *)line, &read_len, error);
-		if (status != MB_SUCCESS)
-			{
-			/* return success here because all of the
-			    important information in this record has
-			    already been read - next attempt to read
-			    file will return error */
-			status = MB_SUCCESS;
-			*error = MB_ERROR_NO_ERROR;
-			}
-		if (line[1] == EM3_END)
-			*goodend = MB_YES;
-#ifdef MBR_EM710RAW_DEBUG
-	fprintf(stderr, "End Bytes: %2.2hhX %d | %2.2hhX %d | %2.2hhX %d\n",
-		line[1], line[1],
-		line[2], line[2],
-		line[3], line[3]);
-#endif
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       ssv_date:        %d\n",ssv->ssv_date);
-		fprintf(stderr,"dbg5       ssv_msec:        %d\n",ssv->ssv_msec);
-		fprintf(stderr,"dbg5       ssv_count:       %d\n",ssv->ssv_count);
-		fprintf(stderr,"dbg5       ssv_serial:      %d\n",ssv->ssv_serial);
-		fprintf(stderr,"dbg5       ssv_ndata:       %d\n",ssv->ssv_ndata);
-		fprintf(stderr,"dbg5       count    time (msec)    ssv (0.1 m/s)\n");
-		fprintf(stderr,"dbg5       -----    -----------    ------------------\n");
-		for (i=0;i<ssv->ssv_ndata;i++)
-			fprintf(stderr,"dbg5        %4d      %7d          %7d\n",
-				i, ssv->ssv_time[i], ssv->ssv_ssv[i]);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       goodend:    %d\n",*goodend);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em710raw_rd_tilt(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store,
-		short sonar, int *goodend, int *error)
-{
-	char	*function_name = "mbr_em710raw_rd_tilt";
-	int	status = MB_SUCCESS;
-	struct mbsys_simrad3_tilt_struct *tilt;
-	char	line[EM3_TILT_HEADER_SIZE];
-	short	short_val;
-	size_t	read_len;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		fprintf(stderr,"dbg2       sonar:      %d\n",sonar);
-		}
-
-	/* set goodend false until a good end is found */
-	*goodend = MB_NO;
-
-	/* get  storage structure */
-	tilt = (struct mbsys_simrad3_tilt_struct *) store->tilt;
-
-	/* set kind and type values */
-	store->kind = MB_DATA_TILT;
-	store->type = EM3_TILT;
-	store->sonar = sonar;
-
-	/* read binary header values into char array */
-	read_len = (size_t)EM3_TILT_HEADER_SIZE;
-	status = mb_fileio_get(verbose, mbio_ptr, (char *)line, &read_len, error);
-
-	/* get binary header data */
-	if (status == MB_SUCCESS)
-		{
-		mb_get_binary_int(swap, &line[0], &tilt->tlt_date);
-		    store->date = tilt->tlt_date;
-		mb_get_binary_int(swap, &line[4], &tilt->tlt_msec);
-		    store->msec = tilt->tlt_msec;
-		mb_get_binary_short(swap, &line[8], &short_val);
-		    tilt->tlt_count = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[10], &short_val);
-		    tilt->tlt_serial = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[12], &short_val);
-		    tilt->tlt_ndata = (int) ((unsigned short) short_val);
-		}
-
-	/* read binary tilt values */
-	if (status == MB_SUCCESS)
-	    {
-	    for (i=0;i<tilt->tlt_ndata && status == MB_SUCCESS;i++)
-		{
-		read_len = (size_t)EM3_TILT_SLICE_SIZE;
-		status = mb_fileio_get(verbose, mbio_ptr, (char *)line, &read_len, error);
-		if (status == MB_SUCCESS
-			&& i < MBSYS_SIMRAD3_MAXTILT)
-			{
-			mb_get_binary_short(swap, &line[0], &short_val);
-			    tilt->tlt_time[i] = (int) ((unsigned short) short_val);
-			mb_get_binary_short(swap, &line[2], &short_val);
-			    tilt->tlt_tilt[i] = (int) ((unsigned short) short_val);
-			}
-		}
-	    tilt->tlt_ndata = MIN(tilt->tlt_ndata, MBSYS_SIMRAD3_MAXTILT);
-	    }
-
-	/* now get last bytes of record */
-	if (status == MB_SUCCESS)
-		{
-		read_len = (size_t)4;
-		status = mb_fileio_get(verbose, mbio_ptr, (char *)line, &read_len, error);
-		if (status != MB_SUCCESS)
-			{
-			/* return success here because all of the
-			    important information in this record has
-			    already been read - next attempt to read
-			    file will return error */
-			status = MB_SUCCESS;
-			*error = MB_ERROR_NO_ERROR;
-			}
-		if (line[1] == EM3_END)
-			*goodend = MB_YES;
-#ifdef MBR_EM710RAW_DEBUG
-	fprintf(stderr, "End Bytes: %2.2hhX %d | %2.2hhX %d | %2.2hhX %d\n",
-		line[1], line[1],
-		line[2], line[2],
-		line[3], line[3]);
-#endif
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       tlt_date:        %d\n",tilt->tlt_date);
-		fprintf(stderr,"dbg5       tlt_msec:        %d\n",tilt->tlt_msec);
-		fprintf(stderr,"dbg5       tlt_count:       %d\n",tilt->tlt_count);
-		fprintf(stderr,"dbg5       tlt_serial:      %d\n",tilt->tlt_serial);
-		fprintf(stderr,"dbg5       tlt_ndata:       %d\n",tilt->tlt_ndata);
-		fprintf(stderr,"dbg5       count    time (msec)    tilt (0.01 deg)\n");
-		fprintf(stderr,"dbg5       -----    -----------    ------------------\n");
-		for (i=0;i<tilt->tlt_ndata;i++)
-			fprintf(stderr,"dbg5        %4d      %7d          %7d\n",
-				i, tilt->tlt_time[i], tilt->tlt_tilt[i]);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       goodend:    %d\n",*goodend);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em710raw_rd_extraparameters(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store,
-		short sonar, int *goodend, int *error)
-{
-	char	*function_name = "mbr_em710raw_rd_extraparameters";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_simrad3_extraparameters_struct *extraparameters;
-	char	line[EM3_EXTRAPARAMETERS_HEADER_SIZE];
-	short	short_val;
-	size_t	read_len;
-	int	*record_size_save;
-	int	index;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		fprintf(stderr,"dbg2       sonar:      %d\n",sonar);
-		}
-
-	/* set goodend false until a good end is found */
-	*goodend = MB_NO;
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get  storage structure */
-	extraparameters = (struct mbsys_simrad3_extraparameters_struct *) store->extraparameters;
-
-	/* set kind and type values */
-	store->kind = MB_DATA_PARAMETER;
-	store->type = EM3_EXTRAPARAMETERS;
-	store->sonar = sonar;
-
-	/* read binary header values into char array */
-	read_len = (size_t)EM3_EXTRAPARAMETERS_HEADER_SIZE;
-	status = mb_fileio_get(verbose, mbio_ptr, (char *)line, &read_len, error);
-
-	/* get binary header data */
-	if (status == MB_SUCCESS)
-		{
-		mb_get_binary_int(swap, &line[0], &extraparameters->xtr_date);
-		    store->date = extraparameters->xtr_date;
-		mb_get_binary_int(swap, &line[4], &extraparameters->xtr_msec);
-		    store->msec = extraparameters->xtr_msec;
-		mb_get_binary_short(swap, &line[8], &short_val);
-		    extraparameters->xtr_count = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[10], &short_val);
-		    extraparameters->xtr_serial = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[12], &short_val);
-		    extraparameters->xtr_id = (int) ((unsigned short) short_val);
-		}
-
-	/* calculate length of data array */
-	if (status == MB_SUCCESS)
-		{
-		record_size_save = (int *) &mb_io_ptr->save2;
-		extraparameters->xtr_data_size = *record_size_save - 22;
-		}
-
-	/* allocate memory if necessary */
-	if (status == MB_SUCCESS && extraparameters->xtr_data_size > extraparameters->xtr_nalloc)
-		{
-		status = mb_mallocd(verbose, __FILE__, __LINE__, extraparameters->xtr_data_size,
-							(void **)&extraparameters->xtr_data, error);
-		if (status == MB_SUCCESS)
-			extraparameters->xtr_nalloc = extraparameters->xtr_data_size;
-		else
-			extraparameters->xtr_nalloc = 0;
-		}
-
-	/* read data */
-	if (status == MB_SUCCESS)
-		{
-		read_len = (size_t)extraparameters->xtr_data_size;
-		status = mb_fileio_get(verbose, mbio_ptr, (char *)extraparameters->xtr_data, &read_len, error);
-		}
-
-	/* parse data if possible */
-	if (status == MB_SUCCESS && extraparameters->xtr_id == 2)
-		{
-		index = 0;
-		mb_get_binary_int(swap, &(extraparameters->xtr_data[index]), &extraparameters->xtr_pqf_activepositioning);
-		for (i=0;i<3;i++)
-			{
-			mb_get_binary_short(swap, &(extraparameters->xtr_data[index]), &extraparameters->xtr_pqf_qfsetting[i]); index += 2;
-			}
-		for (i=0;i<3;i++)
-			{
-			mb_get_binary_int(swap, &(extraparameters->xtr_data[index]), &extraparameters->xtr_pqf_nqualityfactors[i]); index += 4;
-			}
-		for (i=0;i<3;i++)
-			{
-			for (j=0;j<extraparameters->xtr_pqf_nqualityfactors[i];j++)
-				{
-				mb_get_binary_int(swap, &(extraparameters->xtr_data[index]), &extraparameters->xtr_pqf_qfvalues[i][j]); index += 4;
-				mb_get_binary_int(swap, &(extraparameters->xtr_data[index]), &extraparameters->xtr_pqf_qflimits[i][j]); index += 4;
-				}
-			}
-		}
-
-	/* now get last bytes of record */
-	if (status == MB_SUCCESS)
-		{
-		read_len = (size_t)4;
-		status = mb_fileio_get(verbose, mbio_ptr, (char *)line, &read_len, error);
-		if (status != MB_SUCCESS)
-			{
-			/* return success here because all of the
-			    important information in this record has
-			    already been read - next attempt to read
-			    file will return error */
-			status = MB_SUCCESS;
-			*error = MB_ERROR_NO_ERROR;
-			}
-		if (line[1] == EM3_END)
-			*goodend = MB_YES;
-#ifdef MBR_EM710RAW_DEBUG
-	fprintf(stderr, "End Bytes: %2.2hhX %d | %2.2hhX %d | %2.2hhX %d\n",
-		line[1], line[1],
-		line[2], line[2],
-		line[3], line[3]);
-#endif
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       xtr_date:        %d\n",extraparameters->xtr_date);
-		fprintf(stderr,"dbg5       xtr_msec:        %d\n",extraparameters->xtr_msec);
-		fprintf(stderr,"dbg5       xtr_count:       %d\n",extraparameters->xtr_count);
-		fprintf(stderr,"dbg5       xtr_serial:      %d\n",extraparameters->xtr_serial);
-		fprintf(stderr,"dbg5       xtr_id:          %d\n",extraparameters->xtr_id);
-		fprintf(stderr,"dbg5       xtr_data_size:   %d\n",extraparameters->xtr_data_size);
-		fprintf(stderr,"dbg5       xtr_nalloc:      %d\n",extraparameters->xtr_nalloc);
-		if (extraparameters->xtr_id == 2)
-			{
-			fprintf(stderr,"dbg5       xtr_pqf_activepositioning:          %d\n",extraparameters->xtr_pqf_activepositioning);
-			for (i=0;i<3;i++)
-				{
-				fprintf(stderr,"dbg5       positioning system:%d qfsetting:%d nqf:%d\n",
-					i,extraparameters->xtr_pqf_qfsetting[i],extraparameters->xtr_pqf_nqualityfactors[i]);
-				for (j=0;j<extraparameters->xtr_pqf_nqualityfactors[i];j++)
-				fprintf(stderr,"dbg5       quality factor:%d value:%d limit:%d\n",
-					j,extraparameters->xtr_pqf_qfvalues[i][j],extraparameters->xtr_pqf_qflimits[i][j]);
-				}
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       goodend:    %d\n",*goodend);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em710raw_rd_attitude(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store,
-		short sonar, int *goodend, int *error)
-{
-	char	*function_name = "mbr_em710raw_rd_attitude";
-	int	status = MB_SUCCESS;
-	struct mbsys_simrad3_attitude_struct *attitude;
-	char	line[EM3_ATTITUDE_HEADER_SIZE];
-	short	short_val;
-	size_t	read_len;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		fprintf(stderr,"dbg2       sonar:      %d\n",sonar);
-		}
-
-	/* set goodend false until a good end is found */
-	*goodend = MB_NO;
-
-	/* get  storage structure */
-	attitude = (struct mbsys_simrad3_attitude_struct *) store->attitude;
-
-	/* set type values
-		- kind has to wait for the sensor descriptor value at the end of the record */
-	store->type = EM3_ATTITUDE;
-	store->sonar = sonar;
-
-	/* read binary header values into char array */
-	read_len = (size_t)EM3_ATTITUDE_HEADER_SIZE;
-	status = mb_fileio_get(verbose, mbio_ptr, (char *)line, &read_len, error);
-
-	/* get binary header data */
-	if (status == MB_SUCCESS)
-		{
-		mb_get_binary_int(swap, &line[0], &attitude->att_date);
-		    store->date = attitude->att_date;
-		mb_get_binary_int(swap, &line[4], &attitude->att_msec);
-		    store->msec = attitude->att_msec;
-		mb_get_binary_short(swap, &line[8], &short_val);
-		    attitude->att_count = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[10], &short_val);
-		    attitude->att_serial = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[12], &short_val);
-		    attitude->att_ndata = (int) ((unsigned short) short_val);
-		}
-
-	/* read binary attitude values */
-	if (status == MB_SUCCESS)
-	    {
-	    for (i=0;i<attitude->att_ndata && status == MB_SUCCESS;i++)
-		{
-		read_len = (size_t)EM3_ATTITUDE_SLICE_SIZE;
-		status = mb_fileio_get(verbose, mbio_ptr, (char *)line, &read_len, error);
-		if (status == MB_SUCCESS
-			&& i < MBSYS_SIMRAD3_MAXATTITUDE)
-			{
-			mb_get_binary_short(swap, &line[0], &short_val);
-			    attitude->att_time[i] = (int) ((unsigned short) short_val);
-			mb_get_binary_short(swap, &line[2], &short_val);
-			    attitude->att_sensor_status[i] = (int) ((unsigned short) short_val);
-			mb_get_binary_short(swap, &line[4], &short_val);
-			    attitude->att_roll[i] = (int) short_val;
-			mb_get_binary_short(swap, &line[6], &short_val);
-			    attitude->att_pitch[i] = (int) short_val;
-			mb_get_binary_short(swap, &line[8], &short_val);
-			    attitude->att_heave[i] = (int) short_val;
-			mb_get_binary_short(swap, &line[10], &short_val);
-			    attitude->att_heading[i] = (int) ((unsigned short) short_val);
-			}
-		}
-	    attitude->att_ndata = MIN(attitude->att_ndata, MBSYS_SIMRAD3_MAXATTITUDE);
-	    }
-
-	/* now get last bytes of record */
-	if (status == MB_SUCCESS)
-		{
-		read_len = (size_t)4;
-		status = mb_fileio_get(verbose, mbio_ptr, (char *)line, &read_len, error);
-		if (status == MB_SUCCESS)
-			{
-			attitude->att_sensordescriptor = (mb_u_char) line[0];
-			}
-		else
-			{
-			/* return success here because all of the
-			    important information in this record has
-			    already been read - next attempt to read
-			    file will return error */
-			status = MB_SUCCESS;
-			*error = MB_ERROR_NO_ERROR;
-			}
-		if (line[1] == EM3_END)
-			*goodend = MB_YES;
-#ifdef MBR_EM710RAW_DEBUG
-	fprintf(stderr, "End Bytes: %2.2hhX %d | %2.2hhX %d | %2.2hhX %d\n",
-		line[1], line[1],
-		line[2], line[2],
-		line[3], line[3]);
-#endif
-		}
-
-	/* Set data kind */
-	if (status == MB_SUCCESS)
-		{
-		/* set data kind */
-		if ((attitude->att_sensordescriptor & 48) == 0)
-			store->kind = MB_DATA_ATTITUDE;
-		else if ((attitude->att_sensordescriptor & 48) == 16)
-			store->kind = MB_DATA_ATTITUDE1;
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       kind:            %d\n",store->kind);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       att_date:        %d\n",attitude->att_date);
-		fprintf(stderr,"dbg5       att_msec:        %d\n",attitude->att_msec);
-		fprintf(stderr,"dbg5       att_count:       %d\n",attitude->att_count);
-		fprintf(stderr,"dbg5       att_serial:      %d\n",attitude->att_serial);
-		fprintf(stderr,"dbg5       att_ndata:       %d\n",attitude->att_ndata);
-		fprintf(stderr,"dbg5       cnt   time   roll pitch heave heading\n");
-		fprintf(stderr,"dbg5       -------------------------------------\n");
-		for (i=0;i<attitude->att_ndata;i++)
-			fprintf(stderr,"dbg5        %3d  %d  %d %d %d %d\n",
-				i, attitude->att_time[i], attitude->att_roll[i],
-				attitude->att_pitch[i], attitude->att_heave[i],
-				attitude->att_heading[i]);
-		fprintf(stderr,"dbg5       att_sensordescriptor: %d\n",attitude->att_sensordescriptor);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       goodend:    %d\n",*goodend);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em710raw_rd_netattitude(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store,
-		short sonar, int *goodend, int *error)
-{
-	char	*function_name = "mbr_em710raw_rd_netattitude";
-	int	status = MB_SUCCESS;
-	struct mbsys_simrad3_netattitude_struct *netattitude;
-	char	line[MBSYS_SIMRAD3_BUFFER_SIZE];
-	short	short_val;
-	size_t	read_len;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		fprintf(stderr,"dbg2       sonar:      %d\n",sonar);
-		}
-
-	/* set goodend false until a good end is found */
-	*goodend = MB_NO;
-
-	/* get  storage structure */
-	netattitude = (struct mbsys_simrad3_netattitude_struct *) store->netattitude;
-
-	/* set type values */
-	store->type = EM3_NETATTITUDE;
-	store->sonar = sonar;
-
-	/* read binary header values into char array */
-	read_len = (size_t)EM3_NETATTITUDE_HEADER_SIZE;
-	status = mb_fileio_get(verbose, mbio_ptr, (char *)line, &read_len, error);
-
-	/* get binary header data */
-	if (status == MB_SUCCESS)
-		{
-		mb_get_binary_int(swap, &line[0], &netattitude->nat_date);
-		    store->date = netattitude->nat_date;
-		mb_get_binary_int(swap, &line[4], &netattitude->nat_msec);
-		    store->msec = netattitude->nat_msec;
-		mb_get_binary_short(swap, &line[8], &short_val);
-		    netattitude->nat_count = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[10], &short_val);
-		    netattitude->nat_serial = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[12], &short_val);
-		    netattitude->nat_ndata = (int) ((unsigned short) short_val);
-		netattitude->nat_sensordescriptor = line[14];
-		}
-
-	/* Set data kind */
-	if (status == MB_SUCCESS)
-		{
-		/* set data kind */
-		store->kind = MB_DATA_ATTITUDE2;
-		}
-
-	/* read binary netattitude values */
-	if (status == MB_SUCCESS)
-	    {
-	    for (i=0;i<netattitude->nat_ndata && status == MB_SUCCESS;i++)
-		{
-		read_len = (size_t)EM3_NETATTITUDE_SLICE_SIZE;
-		status = mb_fileio_get(verbose, mbio_ptr, (char *)line, &read_len, error);
-		if (status == MB_SUCCESS
-			&& i < MBSYS_SIMRAD3_MAXATTITUDE)
-			{
-			mb_get_binary_short(swap, &line[0], &short_val);
-			    netattitude->nat_time[i] = (int) ((unsigned short) short_val);
-			mb_get_binary_short(swap, &line[2], &short_val);
-			    netattitude->nat_roll[i] = (int) short_val;
-			mb_get_binary_short(swap, &line[4], &short_val);
-			    netattitude->nat_pitch[i] = (int) short_val;
-			mb_get_binary_short(swap, &line[6], &short_val);
-			    netattitude->nat_heave[i] = (int) short_val;
-			mb_get_binary_short(swap, &line[8], &short_val);
-			    netattitude->nat_heading[i] = (int) ((unsigned short) short_val);
-			netattitude->nat_nbyte_raw[i] = (mb_u_char) line[10];
-			if (netattitude->nat_nbyte_raw[i] <= MBSYS_SIMRAD3_BUFFER_SIZE)
-				{
-				read_len = (size_t)(netattitude->nat_nbyte_raw[i]);
-				status = mb_fileio_get(verbose, mbio_ptr, (char *)line, &read_len, error);
-				if (status == MB_SUCCESS)
-					{
-					for (j=0;j<netattitude->nat_nbyte_raw[i];j++)
-						netattitude->nat_raw[i*MBSYS_SIMRAD3_BUFFER_SIZE+j] = line[j];
-					}
-				}
-			else
-				{
-				for (j=0;j<netattitude->nat_nbyte_raw[i];j++)
-					{
-					read_len = (size_t)1;
-					status = mb_fileio_get(verbose, mbio_ptr, (char *)line, &read_len, error);
-					}
-				netattitude->nat_nbyte_raw[i] = 0;
-				}
-			}
-		}
-	    netattitude->nat_ndata = MIN(netattitude->nat_ndata, MBSYS_SIMRAD3_MAXATTITUDE);
-	    }
-
-	/* now get last bytes of record */
-	if (status == MB_SUCCESS)
-		{
-		read_len = (size_t)1;
-		status = mb_fileio_get(verbose, mbio_ptr, (char *)line, &read_len, error);
-		if (line[0] != EM3_END)
-			{
-			read_len = (size_t)1;
-			status = mb_fileio_get(verbose, mbio_ptr, (char *)&line[1], &read_len, error);
-			}
-		else
-			line[1] = EM3_END;
-		read_len = (size_t)2;
-		status = mb_fileio_get(verbose, mbio_ptr, (char *)&line[2], &read_len, error);
-		if (status != MB_SUCCESS)
-			{
-			/* return success here because all of the
-			    important information in this record has
-			    already been read - next attempt to read
-			    file will return error */
-			status = MB_SUCCESS;
-			*error = MB_ERROR_NO_ERROR;
-			}
-		if (line[1] == EM3_END)
-			*goodend = MB_YES;
-#ifdef MBR_EM710RAW_DEBUG
-	fprintf(stderr, "End Bytes: %2.2hhX %d | %2.2hhX %d | %2.2hhX %d\n",
-		line[1], line[1],
-		line[2], line[2],
-		line[3], line[3]);
-#endif
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       kind:                 %d\n",store->kind);
-		fprintf(stderr,"dbg5       type:                 %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:                %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:                 %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:                 %d\n",store->msec);
-		fprintf(stderr,"dbg5       nat_date:             %d\n",netattitude->nat_date);
-		fprintf(stderr,"dbg5       nat_msec:             %d\n",netattitude->nat_msec);
-		fprintf(stderr,"dbg5       nat_count:            %d\n",netattitude->nat_count);
-		fprintf(stderr,"dbg5       nat_serial:           %d\n",netattitude->nat_serial);
-		fprintf(stderr,"dbg5       nat_ndata:            %d\n",netattitude->nat_ndata);
-		fprintf(stderr,"dbg5       nat_sensordescriptor: %d\n",netattitude->nat_sensordescriptor);
-		fprintf(stderr,"dbg5       cnt   time   roll pitch heave heading nraw\n");
-		fprintf(stderr,"dbg5       -------------------------------------\n");
-		for (i=0;i<netattitude->nat_ndata;i++)
-			{
-			fprintf(stderr,"dbg5        %3d  %d  %d %d %d %d %d\n",
-				i, netattitude->nat_time[i], netattitude->nat_roll[i],
-				netattitude->nat_pitch[i], netattitude->nat_heave[i],
-				netattitude->nat_heading[i],netattitude->nat_nbyte_raw[i]);
-			fprintf(stderr,"dbg5        nat_raw[%d]: ",netattitude->nat_nbyte_raw[i]);
-			for (j=0;j<netattitude->nat_nbyte_raw[i];j++)
-				fprintf(stderr,"%x",netattitude->nat_raw[i*MBSYS_SIMRAD3_BUFFER_SIZE+j]);
-			fprintf(stderr,"\n");
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       goodend:    %d\n",*goodend);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em710raw_rd_pos(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store,
-		short sonar, int *goodend, int *error)
-{
-	char	*function_name = "mbr_em710raw_rd_pos";
-	int	status = MB_SUCCESS;
-	char	line[MBSYS_SIMRAD3_COMMENT_LENGTH];
-	short	short_val;
-	size_t	read_len;
-	int	done;
-	int	navchannel;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		fprintf(stderr,"dbg2       sonar:      %d\n",sonar);
-		}
-
-	/* set goodend false until a good end is found */
-	*goodend = MB_NO;
-
-	/* set kind and type values */
-	store->kind = MB_DATA_NAV;
-	store->type = EM3_POS;
-	store->sonar = sonar;
-
-	/* read binary header values into char array */
-	read_len = (size_t)EM3_POS_HEADER_SIZE;
-	status = mb_fileio_get(verbose, mbio_ptr, (char *)line, &read_len, error);
-
-	/* get binary header data */
-	if (status == MB_SUCCESS)
-		{
-		mb_get_binary_int(swap, &line[0], &store->pos_date);
-		    store->date = store->pos_date;
-		mb_get_binary_int(swap, &line[4], &store->pos_msec);
-		    store->msec = store->pos_msec;
-		mb_get_binary_short(swap, &line[8], &short_val);
-		    store->pos_count = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[10], &short_val);
-		    store->pos_serial = (int) ((unsigned short) short_val);
-		mb_get_binary_int(swap, &line[12], &store->pos_latitude);
-		mb_get_binary_int(swap, &line[16], &store->pos_longitude);
-		mb_get_binary_short(swap, &line[20], &short_val);
-		    store->pos_quality = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[22], &short_val);
-		    store->pos_speed = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[24], &short_val);
-		    store->pos_course = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[26], &short_val);
-		    store->pos_heading = (int) ((unsigned short) short_val);
-		store->pos_system = (mb_u_char) line[28];
-		store->pos_input_size = (mb_u_char) line[29];
-		}
-
-	/* read input position string */
-	if (status == MB_SUCCESS && store->pos_input_size < 256)
-		{
-		read_len = (size_t)store->pos_input_size;
-		status = mb_fileio_get(verbose, mbio_ptr, (char *)store->pos_input, &read_len, error);
-		if (status == MB_SUCCESS)
-			{
-			store->pos_input[store->pos_input_size] = '\0';
-			}
-		}
-
-	/* now loop over reading individual characters to
-	    get last bytes of record */
-	if (status == MB_SUCCESS)
-	    {
-	    done = MB_NO;
-	    while (done == MB_NO)
-		{
-		read_len = (size_t)1;
-		status = mb_fileio_get(verbose, mbio_ptr, (char *)line, &read_len, error);
-		if (status == MB_SUCCESS && line[0] == EM3_END)
-			{
-			done = MB_YES;
-
-			/* get last two check sum bytes */
-			read_len = (size_t)2;
-			status = mb_fileio_get(verbose, mbio_ptr, (char *)&line[1], &read_len, error);
-
-			*goodend = MB_YES;
-#ifdef MBR_EM710RAW_DEBUG
-	fprintf(stderr, "End Bytes: %2.2hhX %d | %2.2hhX %d | %2.2hhX %d\n",
-		line[0], line[0],
-		line[1], line[1],
-		line[2], line[2]);
-#endif
-			}
-		else if (status != MB_SUCCESS)
-			{
-			done = MB_YES;
-			/* return success here because all of the
-			    important information in this record has
-			    already been read - next attempt to read
-			    file will return error */
-			status = MB_SUCCESS;
-			*error = MB_ERROR_NO_ERROR;
-			}
-		}
-#ifdef MBR_EM710RAW_DEBUG
-	fprintf(stderr, "\n");
-#endif
-	    }
-
-	/* check for navigation source */
-	if (status == MB_SUCCESS)
-		{
-		/* "active" nav system has first bit set in store->pos_system */
-		if (store->pos_system & 128)
-		    {
-		    store->kind = MB_DATA_NAV;
-		    }
-
-		/* otherwise its from a secondary nav system */
-		else
-		    {
-		    navchannel = (store->pos_system & 0x03);
-		    if (navchannel == 1)
-			{
-			store->kind = MB_DATA_NAV1;
-			}
-		    else if (navchannel == 2)
-			{
-			store->kind = MB_DATA_NAV2;
-			}
-		    else if (navchannel == 3)
-			{
-			store->kind = MB_DATA_NAV3;
-			}
-
-		    /* otherwise its an error */
-		    else
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_UNINTELLIGIBLE;
-			}
-		    }
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       pos_date:        %d\n",store->pos_date);
-		fprintf(stderr,"dbg5       pos_msec:        %d\n",store->pos_msec);
-		fprintf(stderr,"dbg5       pos_count:       %d\n",store->pos_count);
-		fprintf(stderr,"dbg5       pos_serial:      %d\n",store->pos_serial);
-		fprintf(stderr,"dbg5       pos_latitude:    %d\n",store->pos_latitude);
-		fprintf(stderr,"dbg5       pos_longitude:   %d\n",store->pos_longitude);
-		fprintf(stderr,"dbg5       pos_quality:     %d\n",store->pos_quality);
-		fprintf(stderr,"dbg5       pos_speed:       %d\n",store->pos_speed);
-		fprintf(stderr,"dbg5       pos_course:      %d\n",store->pos_course);
-		fprintf(stderr,"dbg5       pos_heading:     %d\n",store->pos_heading);
-		fprintf(stderr,"dbg5       pos_system:      %d\n",store->pos_system);
-		fprintf(stderr,"dbg5       pos_input_size:  %d\n",store->pos_input_size);
-		fprintf(stderr,"dbg5       pos_input:\ndbg5            %s\n",store->pos_input);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       goodend:    %d\n",*goodend);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em710raw_rd_svp(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store,
-		short sonar, int *goodend, int *error)
-{
-	char	*function_name = "mbr_em710raw_rd_svp";
-	int	status = MB_SUCCESS;
-	char	line[EM3_SVP_HEADER_SIZE];
-	short	short_val;
-	size_t	read_len;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		fprintf(stderr,"dbg2       sonar:      %d\n",sonar);
-		}
-
-	/* set goodend false until a good end is found */
-	*goodend = MB_NO;
-
-	/* set kind and type values */
-	store->kind = MB_DATA_VELOCITY_PROFILE;
-	store->type = EM3_SVP;
-	store->sonar = sonar;
-
-	/* read binary header values into char array */
-	read_len = (size_t)EM3_SVP_HEADER_SIZE;
-	status = mb_fileio_get(verbose, mbio_ptr, (char *)line, &read_len, error);
-
-	/* get binary header data */
-	if (status == MB_SUCCESS)
-		{
-		mb_get_binary_int(swap, &line[0], &store->svp_use_date);
-		    store->date = store->svp_use_date;
-		mb_get_binary_int(swap, &line[4], &store->svp_use_msec);
-		    store->msec = store->svp_use_msec;
-		mb_get_binary_short(swap, &line[8], &short_val);
-		    store->svp_count = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[10], &short_val);
-		    store->svp_serial = (int) ((unsigned short) short_val);
-		mb_get_binary_int(swap, &line[12], &store->svp_origin_date);
-		mb_get_binary_int(swap, &line[16], &store->svp_origin_msec);
-		mb_get_binary_short(swap, &line[20], &short_val);
-		    store->svp_num = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[22], &short_val);
-		    store->svp_depth_res = (int) ((unsigned short) short_val);
-		}
-
-	/* read binary svp values */
-	if (status == MB_SUCCESS)
-	    {
-	    for (i=0;i<store->svp_num && status == MB_SUCCESS;i++)
-		{
-		read_len = (size_t)EM3_SVP_SLICE_SIZE;
-		status = mb_fileio_get(verbose, mbio_ptr, (char *)line, &read_len, error);
-		if (status == MB_SUCCESS && i < MBSYS_SIMRAD3_MAXSVP)
-			{
-			mb_get_binary_short(swap, &line[0], &short_val);
-			    store->svp_depth[i] = (int) ((unsigned short) short_val);
-			mb_get_binary_short(swap, &line[2], &short_val);
-			    store->svp_vel[i] = (int) ((unsigned short) short_val);
-			}
-		}
-	    store->svp_num = MIN(store->svp_num, MBSYS_SIMRAD3_MAXSVP);
-	    }
-
-	/* now get last bytes of record */
-	if (status == MB_SUCCESS)
-		{
-		read_len = (size_t)4;
-		status = mb_fileio_get(verbose, mbio_ptr, (char *)line, &read_len, error);
-		if (status != MB_SUCCESS)
-			{
-			/* return success here because all of the
-			    important information in this record has
-			    already been read - next attempt to read
-			    file will return error */
-			status = MB_SUCCESS;
-			*error = MB_ERROR_NO_ERROR;
-			}
-		if (line[1] == EM3_END)
-			*goodend = MB_YES;
-#ifdef MBR_EM710RAW_DEBUG
-	fprintf(stderr, "End Bytes: %2.2hhX %d | %2.2hhX %d | %2.2hhX %d\n",
-		line[1], line[1],
-		line[2], line[2],
-		line[3], line[3]);
-#endif
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       svp_use_date:    %d\n",store->svp_use_date);
-		fprintf(stderr,"dbg5       svp_use_msec:    %d\n",store->svp_use_msec);
-		fprintf(stderr,"dbg5       svp_count:       %d\n",store->svp_count);
-		fprintf(stderr,"dbg5       svp_serial:      %d\n",store->svp_serial);
-		fprintf(stderr,"dbg5       svp_origin_date: %d\n",store->svp_origin_date);
-		fprintf(stderr,"dbg5       svp_origin_msec: %d\n",store->svp_origin_msec);
-		fprintf(stderr,"dbg5       svp_num:         %d\n",store->svp_num);
-		fprintf(stderr,"dbg5       svp_depth_res:   %d\n",store->svp_depth_res);
-		fprintf(stderr,"dbg5       count    depth    speed\n");
-		fprintf(stderr,"dbg5       -----------------------\n");
-		for (i=0;i<store->svp_num;i++)
-			fprintf(stderr,"dbg5        %d   %d  %d\n",
-				i, store->svp_depth[i], store->svp_vel[i]);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       goodend:    %d\n",*goodend);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em710raw_rd_svp2(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store,
-		short sonar, int *goodend, int *error)
-{
-	char	*function_name = "mbr_em710raw_rd_svp2";
-	int	status = MB_SUCCESS;
-	char	line[EM3_SVP2_HEADER_SIZE];
-	short	short_val;
-	size_t	read_len;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		fprintf(stderr,"dbg2       sonar:      %d\n",sonar);
-		}
-
-	/* set goodend false until a good end is found */
-	*goodend = MB_NO;
-
-	/* set kind and type values */
-	store->kind = MB_DATA_VELOCITY_PROFILE;
-	store->type = EM3_SVP2;
-	store->sonar = sonar;
-
-	/* read binary header values into char array */
-	read_len = (size_t)EM3_SVP2_HEADER_SIZE;
-	status = mb_fileio_get(verbose, mbio_ptr, (char *)line, &read_len, error);
-
-	/* get binary header data */
-	if (status == MB_SUCCESS)
-		{
-		mb_get_binary_int(swap, &line[0], &store->svp_use_date);
-		    store->date = store->svp_use_date;
-		mb_get_binary_int(swap, &line[4], &store->svp_use_msec);
-		    store->msec = store->svp_use_msec;
-		mb_get_binary_short(swap, &line[8], &short_val);
-		    store->svp_count = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[10], &short_val);
-		    store->svp_serial = (int) ((unsigned short) short_val);
-		mb_get_binary_int(swap, &line[12], &store->svp_origin_date);
-		mb_get_binary_int(swap, &line[16], &store->svp_origin_msec);
-		mb_get_binary_short(swap, &line[20], &short_val);
-		    store->svp_num = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[22], &short_val);
-		    store->svp_depth_res = (int) ((unsigned short) short_val);
-		}
-
-	/* read binary svp values */
-	if (status == MB_SUCCESS)
-	    {
-	    for (i=0;i<store->svp_num && status == MB_SUCCESS;i++)
-		{
-		read_len = (size_t)EM3_SVP2_SLICE_SIZE;
-		status = mb_fileio_get(verbose, mbio_ptr, (char *)line, &read_len, error);
-		if (status == MB_SUCCESS && i < MBSYS_SIMRAD3_MAXSVP)
-			{
-			mb_get_binary_int(swap, &line[0], &store->svp_depth[i]);
-			mb_get_binary_int(swap, &line[4], &store->svp_vel[i]);
-			}
-		}
-	    store->svp_num = MIN(store->svp_num, MBSYS_SIMRAD3_MAXSVP);
-	    }
-
-	/* now get last bytes of record */
-	if (status == MB_SUCCESS)
-		{
-		read_len = (size_t)4;
-		status = mb_fileio_get(verbose, mbio_ptr, (char *)line, &read_len, error);
-		if (status != MB_SUCCESS)
-			{
-			/* return success here because all of the
-			    important information in this record has
-			    already been read - next attempt to read
-			    file will return error */
-			status = MB_SUCCESS;
-			*error = MB_ERROR_NO_ERROR;
-			}
-		if (line[1] == EM3_END)
-			*goodend = MB_YES;
-#ifdef MBR_EM710RAW_DEBUG
-	fprintf(stderr, "End Bytes: %2.2hhX %d | %2.2hhX %d | %2.2hhX %d\n",
-		line[1], line[1],
-		line[2], line[2],
-		line[3], line[3]);
-#endif
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       svp_use_date:    %d\n",store->svp_use_date);
-		fprintf(stderr,"dbg5       svp_use_msec:    %d\n",store->svp_use_msec);
-		fprintf(stderr,"dbg5       svp_count:       %d\n",store->svp_count);
-		fprintf(stderr,"dbg5       svp_serial:      %d\n",store->svp_serial);
-		fprintf(stderr,"dbg5       svp_origin_date: %d\n",store->svp_origin_date);
-		fprintf(stderr,"dbg5       svp_origin_msec: %d\n",store->svp_origin_msec);
-		fprintf(stderr,"dbg5       svp_num:         %d\n",store->svp_num);
-		fprintf(stderr,"dbg5       svp_depth_res:   %d\n",store->svp_depth_res);
-		fprintf(stderr,"dbg5       count    depth    speed\n");
-		fprintf(stderr,"dbg5       -----------------------\n");
-		for (i=0;i<store->svp_num;i++)
-			fprintf(stderr,"dbg5        %d   %d  %d\n",
-				i, store->svp_depth[i], store->svp_vel[i]);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       goodend:    %d\n",*goodend);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em710raw_rd_bath2(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store,
-		short sonar, int version, int *goodend, int *error)
-{
-	char	*function_name = "mbr_em710raw_rd_bath2";
-	int	status = MB_SUCCESS;
-	struct mbsys_simrad3_ping_struct *ping;
-	char	line[EM3_BATH2_HEADER_SIZE];
-	short	short_val;
-	float	float_val;
-	int	int_val;
-	size_t	read_len;
-	int	png_count;
-	int	serial;
-	int	oldest_ping;
-	int	oldest_ping_index;
-	int	found;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		fprintf(stderr,"dbg2       sonar:      %d\n",sonar);
-		fprintf(stderr,"dbg2       version:    %d\n",version);
-		}
-
-	/* set goodend false until a good end is found */
-	*goodend = MB_NO;
-
-	/* set kind and type values */
-	store->kind = MB_DATA_DATA;
-	store->type = EM3_BATH;
-	store->sonar = sonar;
-
-	/* read binary header values into char array */
-	read_len = (size_t)EM3_BATH2_HEADER_SIZE;
-	status = mb_fileio_get(verbose, mbio_ptr, (char *)line, &read_len, error);
-
-	/* figure out which storage structure to use */
-	mb_get_binary_short(swap, &line[8], &short_val);
-	png_count = (int) ((unsigned short) short_val);
-	mb_get_binary_short(swap, &line[10], &short_val);
-	serial = (int) ((unsigned short) short_val);
-	found = MB_NO;
-	oldest_ping = 999999999;
-	oldest_ping_index = -1;
-	for (i=0;i<MBSYS_SIMRAD3_NUM_PING_STRUCTURES && found == MB_NO;i++)
-		{
-		/* look for this ping by ping number and sonar serial number - if we already read
-		 * a record from this ping it has to be stored in one of the structures */
-		if (store->pings[i].read_status > 0 && png_count == store->pings[i].count && serial == store->pings[i].serial)
-			{
-			found = MB_YES;
-			store->ping_index = i;
-			}
-			
-		/* figure out which structure is holding the oldest ping in case we need to drop one
-		 * from memory to make room for the new ping. */
-		else if (store->pings[i].read_status > 0)
-			{
-			if (png_count < oldest_ping)
-				{
-				oldest_ping = png_count;
-				oldest_ping_index = i;
-				}
-			}
-			
-		/* if one of the ping structures is unused, set it to be used if we need to store
-		 * this ping */
-		else if (oldest_ping > 0)
-			{
-			oldest_ping = 0;
-			oldest_ping_index = i;
-			}
-		}
-	if (found == MB_NO)
-		{
-		store->ping_index = oldest_ping_index;
-		}
-	ping = (struct mbsys_simrad3_ping_struct *) &store->pings[store->ping_index];
-	ping->count = png_count;
-	ping->serial = serial;
-
-	/* get binary header data */
-	if (status == MB_SUCCESS)
-		{
-		mb_get_binary_int(swap, &line[0], &ping->png_date);
-		    store->date = ping->png_date;
-		mb_get_binary_int(swap, &line[4], &ping->png_msec);
-		    store->msec = ping->png_msec;
-		mb_get_binary_short(swap, &line[8], &short_val);
-		    ping->png_count = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[10], &short_val);
-		    ping->png_serial = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[12], &short_val);
-		    ping->png_heading = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[14], &short_val);
-		    ping->png_ssv = (int) ((unsigned short) short_val);
-		mb_get_binary_float(swap, &line[16], &float_val);
-		    ping->png_xducer_depth = float_val;
-		mb_get_binary_short(swap, &line[20], &short_val);
-		    ping->png_nbeams = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[22], &short_val);
-		    ping->png_nbeams_valid = (int) ((unsigned short) short_val);
-		mb_get_binary_float(swap, &line[24], &float_val);
-		    ping->png_sample_rate = float_val;
-		mb_get_binary_int(swap, &line[28], &int_val);
-		    ping->png_spare = int_val;
-#ifdef MBR_EM710RAW_DEBUG
-fprintf(stderr,"mbr_em710raw_rd_bath2:    ping->png_date:%d     ping->png_msec:%d     ping->png_count:%d     ping->png_nbeams:%d\n",
-ping->png_date,ping->png_msec,ping->png_count,ping->png_nbeams);
-#endif
-		}
-
-	/* check for some indicators of a broken record
-	    - these do happen!!!! */
-	if (status == MB_SUCCESS)
-		{
-		if (ping->png_nbeams_valid > ping->png_nbeams
-			|| ping->png_nbeams < 0
-			|| ping->png_nbeams_valid < 0
-			|| ping->png_nbeams > MBSYS_SIMRAD3_MAXBEAMS
-			|| ping->png_nbeams_valid > MBSYS_SIMRAD3_MAXBEAMS)
-			{
-#ifdef MBR_EM710RAW_DEBUG
-fprintf(stderr,"mbr_em710raw_rd_bath2: ERROR SET: ping->png_nbeams:%d ping->png_nbeams_valid:%d MBSYS_SIMRAD3_MAXBEAMS:%d\n",
-ping->png_nbeams,ping->png_nbeams_valid,MBSYS_SIMRAD3_MAXBEAMS);
-#endif
-			status = MB_FAILURE;
-			*error = MB_ERROR_UNINTELLIGIBLE;
-			}
-		}
-
-	/* read binary beam values */
-	if (status == MB_SUCCESS)
-	    {
-	    for (i=0;i<ping->png_nbeams && status == MB_SUCCESS;i++)
-		{
-		read_len = (size_t)EM3_BATH2_BEAM_SIZE;
-		status = mb_fileio_get(verbose, mbio_ptr, (char *)line, &read_len, error);
-		if (status == MB_SUCCESS
-			&& i < MBSYS_SIMRAD3_MAXBEAMS)
-			{
-			mb_get_binary_float(swap, &line[0], &float_val);
-			    ping->png_depth[i] = float_val;
-			mb_get_binary_float(swap, &line[4], &float_val);
-			    ping->png_acrosstrack[i] = float_val;
-			mb_get_binary_float(swap, &line[8], &float_val);
-			    ping->png_alongtrack[i] = float_val;
-			mb_get_binary_short(swap, &line[12], &short_val);
-			    ping->png_window[i] = (int) ((unsigned short) short_val);
-			ping->png_quality[i] = (int)((mb_u_char) line[14]);
-			ping->png_iba[i] = (int)((mb_s_char) line[15]);
-			ping->png_detection[i] = (int)((mb_u_char) line[16]);
-			ping->png_clean[i] = (int)((mb_s_char) line[17]);
-			mb_get_binary_short(swap, &line[18], &short_val);
-			    ping->png_amp[i] = (int) short_val;
-			}
-		}
-	    }
-
-	/* now get last bytes of record */
-	if (status == MB_SUCCESS)
-		{
-		read_len = (size_t)4;
-		status = mb_fileio_get(verbose, mbio_ptr, (char *)line, &read_len, error);
-		if (line[1] == EM3_END)
-			*goodend = MB_YES;
-#ifdef MBR_EM710RAW_DEBUG
-	fprintf(stderr, "End Bytes: %2.2hhX %d | %2.2hhX %d | %2.2hhX %d\n",
-		line[1], line[1],
-		line[2], line[2],
-		line[3], line[3]);
-#endif
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:                  %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:                 %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:                  %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:                  %d\n",store->msec);
-		fprintf(stderr,"dbg5       png_date:              %d\n",ping->png_date);
-		fprintf(stderr,"dbg5       png_msec:              %d\n",ping->png_msec);
-		fprintf(stderr,"dbg5       png_count:             %d\n",ping->png_count);
-		fprintf(stderr,"dbg5       png_serial:            %d\n",ping->png_serial);
-		fprintf(stderr,"dbg5       png_heading:           %d\n",ping->png_heading);
-		fprintf(stderr,"dbg5       png_ssv:               %d\n",ping->png_ssv);
-		fprintf(stderr,"dbg5       png_xducer_depth:      %f\n",ping->png_xducer_depth);
-		fprintf(stderr,"dbg5       png_nbeams:            %d\n",ping->png_nbeams);
-		fprintf(stderr,"dbg5       png_nbeams_valid:      %d\n",ping->png_nbeams_valid);
-		fprintf(stderr,"dbg5       png_sample_rate:       %f\n",ping->png_sample_rate);
-		fprintf(stderr,"dbg5       png_spare:             %d\n",ping->png_spare);
-		fprintf(stderr,"dbg5       cnt  depth xtrack ltrack win  qual  iba det cln amp\n");
-		fprintf(stderr,"dbg5       ------------------------------------------------------------\n");
-		for (i=0;i<ping->png_nbeams;i++)
-			fprintf(stderr,"dbg5       %3d %7.2f %7.2f %7.2f %5d %5d %5d %4d %3d %3d\n",
-				i, ping->png_depth[i], ping->png_acrosstrack[i],
-				ping->png_alongtrack[i], ping->png_window[i],
-				ping->png_quality[i], ping->png_iba[i],
-				ping->png_detection[i], ping->png_clean[i],
-				ping->png_amp[i]);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       goodend:    %d\n",*goodend);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em710raw_rd_rawbeam4(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store,
-		short sonar, int *goodend, int *error)
-{
-	char	*function_name = "mbr_em710raw_rd_rawbeam4";
-	int	status = MB_SUCCESS;
-	struct mbsys_simrad3_ping_struct *ping;
-	char	line[EM3_RAWBEAM4_HEADER_SIZE];
-	short	short_val;
-	int	int_val;
-	float	float_val;
-	size_t	read_len;
-	int	png_count;
-	int	serial;
-	int	oldest_ping;
-	int	oldest_ping_index;
-	int	found;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		fprintf(stderr,"dbg2       sonar:      %d\n",sonar);
-		}
-
-	/* set goodend false until a good end is found */
-	*goodend = MB_NO;
-
-	/* read binary header values into char array */
-	read_len = (size_t)EM3_RAWBEAM4_HEADER_SIZE;
-	status = mb_fileio_get(verbose, mbio_ptr, (char *)line, &read_len, error);
-
-	/* figure out which storage structure to use */
-	mb_get_binary_short(swap, &line[8], &short_val);
-	png_count = (int) ((unsigned short) short_val);
-	mb_get_binary_short(swap, &line[10], &short_val);
-	serial = (int) ((unsigned short) short_val);
-	found = MB_NO;
-	oldest_ping = 999999999;
-	oldest_ping_index = -1;
-	for (i=0;i<MBSYS_SIMRAD3_NUM_PING_STRUCTURES && found == MB_NO;i++)
-		{
-		/* look for this ping by ping number and sonar serial number - if we already read
-		 * a record from this ping it has to be stored in one of the structures */
-		if (store->pings[i].read_status > 0 && png_count == store->pings[i].count && serial == store->pings[i].serial)
-			{
-			found = MB_YES;
-			store->ping_index = i;
-			}
-			
-		/* figure out which structure is holding the oldest ping in case we need to drop one
-		 * from memory to make room for the new ping. */
-		else if (store->pings[i].read_status > 0)
-			{
-			if (png_count < oldest_ping)
-				{
-				oldest_ping = png_count;
-				oldest_ping_index = i;
-				}
-			}
-			
-		/* if one of the ping structures is unused, set it to be used if we need to store
-		 * this ping */
-		else if (oldest_ping > 0)
-			{
-			oldest_ping = 0;
-			oldest_ping_index = i;
-			}
-		}
-	if (found == MB_NO)
-		{
-		store->ping_index = oldest_ping_index;
-		}
-	ping = (struct mbsys_simrad3_ping_struct *) &store->pings[store->ping_index];
-	ping->count = png_count;
-	ping->serial = serial;
-
-	/* get binary header data */
-	if (status == MB_SUCCESS)
-		{
-		mb_get_binary_int(swap, &line[0], &ping->png_raw_date);
-		    store->date = ping->png_raw_date;
-		mb_get_binary_int(swap, &line[4], &ping->png_raw_msec);
-		    store->msec = ping->png_raw_msec;
-		mb_get_binary_short(swap, &line[8], &short_val);
-		    ping->png_raw_count = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[10], &short_val);
-		    ping->png_raw_serial = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[12], &short_val);
-		    ping->png_raw_ssv = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[14], &short_val);
-		    ping->png_raw_ntx = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[16], &short_val);
-		    ping->png_raw_nbeams = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[18], &short_val);
-		    ping->png_raw_detections = (int) ((unsigned short) short_val);
-		mb_get_binary_float(swap, &line[20], &float_val);
-		    ping->png_raw_sample_rate = float_val;
-		mb_get_binary_int(swap, &line[24], &int_val);
-		    ping->png_raw_spare = (int) (int_val);
-/*fprintf(stderr,"ping->png_raw_date:%d ping->png_raw_msec:%d ping->png_raw_count:%d ping->png_raw_nbeams:%d\n",
-ping->png_raw_date,ping->png_raw_msec,ping->png_raw_count,ping->png_raw_nbeams);*/
-		}
-
-	/* check for some indicators of a broken record
-	    - these do happen!!!! */
-	if (status == MB_SUCCESS)
-		{
-		if (ping->png_raw_detections > ping->png_raw_nbeams
-			|| ping->png_raw_nbeams < 0
-			|| ping->png_raw_detections < 0
-			|| ping->png_raw_nbeams > MBSYS_SIMRAD3_MAXBEAMS
-			|| ping->png_raw_detections > MBSYS_SIMRAD3_MAXBEAMS
-			|| ping->png_raw_ntx > MBSYS_SIMRAD3_MAXTX)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_UNINTELLIGIBLE;
-			}
-		}
-
-	/* read binary tx values */
-	if (status == MB_SUCCESS)
-	    {
-	    for (i=0;i<ping->png_raw_ntx && status == MB_SUCCESS;i++)
-		{
-		read_len = (size_t)EM3_RAWBEAM4_TX_SIZE;
-		status = mb_fileio_get(verbose, mbio_ptr, (char *)line, &read_len, error);
-		if (status == MB_SUCCESS
-			&& i < MBSYS_SIMRAD3_MAXTX)
-			{
-			mb_get_binary_short(swap, &line[0], &short_val);
-			    ping->png_raw_txtiltangle[i] = (int) short_val;
-			mb_get_binary_short(swap, &line[2], &short_val);
-			    ping->png_raw_txfocus[i] = (int) ((unsigned short) short_val);
-			mb_get_binary_float(swap, &line[4], &float_val);
-			    ping->png_raw_txsignallength[i] = float_val;
-			mb_get_binary_float(swap, &line[8], &float_val);
-			    ping->png_raw_txoffset[i] = float_val;
-			mb_get_binary_float(swap, &line[12], &float_val);
-			    ping->png_raw_txcenter[i] = float_val;
-			mb_get_binary_short(swap, &line[16], &short_val);
-			    ping->png_raw_txabsorption[i] = (int) ((unsigned short) short_val);
-			ping->png_raw_txwaveform[i] = (int) line[18];
-			ping->png_raw_txsector[i] = (int) line[19];
-			mb_get_binary_float(swap, &line[20], &float_val);
-			    ping->png_raw_txbandwidth[i] = float_val;
-			}
-		}
-	    }
-
-	/* read binary beam values */
-	if (status == MB_SUCCESS)
-	    {
-	    for (i=0;i<ping->png_raw_nbeams && status == MB_SUCCESS;i++)
-		{
-		read_len = (size_t)EM3_RAWBEAM4_BEAM_SIZE;
-		status = mb_fileio_get(verbose, mbio_ptr, (char *)line, &read_len, error);
-		if (status == MB_SUCCESS
-			&& i < MBSYS_SIMRAD3_MAXBEAMS)
-			{
-			mb_get_binary_short(swap, &line[0], &short_val);
-			    ping->png_raw_rxpointangle[i] = (int) short_val;
-			ping->png_raw_rxsector[i] = (mb_u_char) line[2];
-			ping->png_raw_rxdetection[i] = (mb_u_char) line[3];
-			mb_get_binary_short(swap, &line[4], &short_val);
-			    ping->png_raw_rxwindow[i] = (int) ((unsigned short) short_val);
-			ping->png_raw_rxquality[i] = (mb_u_char) line[6];
-			ping->png_raw_rxspare1[i] = (mb_s_char) line[7];
-			mb_get_binary_float(swap, &line[8], &float_val);
-			    ping->png_raw_rxrange[i] = float_val;
-			mb_get_binary_short(swap, &line[12], &short_val);
-			    ping->png_raw_rxamp[i] = (int) ((short) short_val);
-			ping->png_raw_rxcleaning[i] = (mb_s_char) line[14];
-			ping->png_raw_rxspare2[i] = (mb_u_char) line[15];
-			}
-		}
-
-	    /* zero out ranges that are NaN values - unfortunately this has actually
-	    	happened in some R/V Langseth EM122 data from 20100616 */
-	    for (i=0;i<ping->png_raw_nbeams;i++)
-		{
-		if (check_fnan(ping->png_raw_rxrange[i]))
-			ping->png_raw_rxrange[i]  = 0.0;
-		}
-	    }
-
-	/* now get last bytes of record */
-	if (status == MB_SUCCESS)
-		{
-		read_len = (size_t)4;
-		status = mb_fileio_get(verbose, mbio_ptr, (char *)line, &read_len, error);
-		if (line[1] == EM3_END)
-			*goodend = MB_YES;
-#ifdef MBR_EM710RAW_DEBUG
-	fprintf(stderr, "End Bytes: %2.2hhX %d | %2.2hhX %d | %2.2hhX %d\n",
-		line[1], line[1],
-		line[2], line[2],
-		line[3], line[3]);
-#endif
-		}
-
-	/* check for some other indicators of a broken record
-	    - these do happen!!!! */
-	if (status == MB_SUCCESS)
-		{
-		if (ping->png_raw_nbeams > 0
-		    && ping->png_raw_detections > ping->png_raw_nbeams)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_UNINTELLIGIBLE;
-			}
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       png_raw_read:               %d\n",ping->png_raw_read);
-		fprintf(stderr,"dbg5       png_raw_date:                %d\n",ping->png_raw_date);
-		fprintf(stderr,"dbg5       png_raw_msec:                %d\n",ping->png_raw_msec);
-		fprintf(stderr,"dbg5       png_raw_count:               %d\n",ping->png_raw_count);
-		fprintf(stderr,"dbg5       png_raw_serial:              %d\n",ping->png_raw_serial);
-		fprintf(stderr,"dbg5       png_raw_ssv:                 %d\n",ping->png_raw_ssv);
-		fprintf(stderr,"dbg5       png_raw_ntx:                 %d\n",ping->png_raw_ntx);
-		fprintf(stderr,"dbg5       png_raw_nbeams:              %d\n",ping->png_raw_nbeams);
-		fprintf(stderr,"dbg5       png_raw_detections:          %d\n",ping->png_raw_detections);
-		fprintf(stderr,"dbg5       png_raw_sample_rate:         %f\n",ping->png_raw_sample_rate);
-		fprintf(stderr,"dbg5       png_raw_spare:               %d\n",ping->png_raw_spare);
-		fprintf(stderr,"dbg5       ------------------------------------------------------------\n");
-		fprintf(stderr,"dbg5       transmit pulse values:\n");
-		fprintf(stderr,"dbg5       tiltangle focus length offset center bandwidth waveform sector\n");
-		fprintf(stderr,"dbg5       ------------------------------------------------------------\n");
-		for (i=0;i<ping->png_raw_ntx;i++)
-			fprintf(stderr,"dbg5       %3d %5d %5d %f %f %f %4d %4d %4d %f\n",
-				i, ping->png_raw_txtiltangle[i],
-				ping->png_raw_txfocus[i], ping->png_raw_txsignallength[i],
-				ping->png_raw_txoffset[i], ping->png_raw_txcenter[i],
-				ping->png_raw_txabsorption[i], ping->png_raw_txwaveform[i],
-				ping->png_raw_txsector[i], ping->png_raw_txbandwidth[i]);
-		fprintf(stderr,"dbg5       ------------------------------------------------------------\n");
-		fprintf(stderr,"dbg5       beam values:\n");
-		fprintf(stderr,"dbg5       beam angle sector detection window quality spare1 range amp clean spare2\n");
-		fprintf(stderr,"dbg5       ------------------------------------------------------------\n");
-		for (i=0;i<ping->png_raw_nbeams;i++)
-			fprintf(stderr,"dbg5       %3d %5d %3d %3d %4d %3d %5d %f %5d %5d %5d\n",
-				i, ping->png_raw_rxpointangle[i], ping->png_raw_rxsector[i],
-				ping->png_raw_rxdetection[i], ping->png_raw_rxwindow[i],
-				ping->png_raw_rxquality[i], ping->png_raw_rxspare1[i],
-				ping->png_raw_rxrange[i],ping->png_raw_rxamp[i],
-				ping->png_raw_rxcleaning[i],ping->png_raw_rxspare2[i]);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       goodend:    %d\n",*goodend);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em710raw_rd_quality(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store,
-		short sonar, int *goodend, int *error)
-{
-	char	*function_name = "mbr_em710raw_rd_quality";
-	int	status = MB_SUCCESS;
-	struct mbsys_simrad3_ping_struct *ping;
-	char	line[EM3_QUALITY_HEADER_SIZE];
-	short	short_val;
-	float	float_val;
-	size_t	read_len;
-	int	png_count;
-	int	serial;
-	int	oldest_ping;
-	int	oldest_ping_index;
-	int	found;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		fprintf(stderr,"dbg2       sonar:      %d\n",sonar);
-		}
-
-	/* set goodend false until a good end is found */
-	*goodend = MB_NO;
-
-	/* set kind and type values */
-	store->kind = MB_DATA_DATA;
-	store->type = EM3_QUALITY;
-	store->sonar = sonar;
-
-	/* read binary header values into char array */
-	read_len = (size_t)EM3_QUALITY_HEADER_SIZE;
-	status = mb_fileio_get(verbose, mbio_ptr, (char *)line, &read_len, error);
-
-	/* figure out which storage structure to use */
-	mb_get_binary_short(swap, &line[8], &short_val);
-	png_count = (int) ((unsigned short) short_val);
-	mb_get_binary_short(swap, &line[10], &short_val);
-	serial = (int) ((unsigned short) short_val);
-	found = MB_NO;
-	oldest_ping = 999999999;
-	oldest_ping_index = -1;
-	for (i=0;i<MBSYS_SIMRAD3_NUM_PING_STRUCTURES && found == MB_NO;i++)
-		{
-		/* look for this ping by ping number and sonar serial number - if we already read
-		 * a record from this ping it has to be stored in one of the structures */
-		if (store->pings[i].read_status > 0 && png_count == store->pings[i].count && serial == store->pings[i].serial)
-			{
-			found = MB_YES;
-			store->ping_index = i;
-			}
-			
-		/* figure out which structure is holding the oldest ping in case we need to drop one
-		 * from memory to make room for the new ping. */
-		else if (store->pings[i].read_status > 0)
-			{
-			if (png_count < oldest_ping)
-				{
-				oldest_ping = png_count;
-				oldest_ping_index = i;
-				}
-			}
-			
-		/* if one of the ping structures is unused, set it to be used if we need to store
-		 * this ping */
-		else if (oldest_ping > 0)
-			{
-			oldest_ping = 0;
-			oldest_ping_index = i;
-			}
-		}
-	if (found == MB_NO)
-		{
-		store->ping_index = oldest_ping_index;
-		}
-	ping = (struct mbsys_simrad3_ping_struct *) &store->pings[store->ping_index];
-	ping->count = png_count;
-	ping->serial = serial;
-
-	/* get binary header data */
-	if (status == MB_SUCCESS)
-		{
-		mb_get_binary_int(swap, &line[0], &ping->png_quality_date);
-		    store->date = ping->png_quality_date;
-		mb_get_binary_int(swap, &line[4], &ping->png_quality_msec);
-		    store->msec = ping->png_quality_msec;
-		mb_get_binary_short(swap, &line[8], &short_val);
-		    ping->png_quality_count = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[10], &short_val);
-		    ping->png_quality_serial = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[12], &short_val);
-		    ping->png_quality_nbeams = (int) ((unsigned short) short_val);
-		ping->png_quality_nparameters = (int) line[14];
-		ping->png_quality_spare = (int) line[15];
-		    
-#ifdef MBR_EM710RAW_DEBUG
-fprintf(stderr,"mbr_em710raw_rd_quality:    ping->png_quality_date:%d     ping->png_quality_msec:%d     ping->png_quality_count:%d     ping->png_quality_nbeams:%d\n",
-ping->png_quality_date,ping->png_quality_msec,ping->png_quality_count,ping->png_quality_nbeams);
-#endif
-		}
-
-	/* read binary beam values */
-	if (status == MB_SUCCESS)
-		{
-		for (i=0;i<ping->png_quality_nbeams && status == MB_SUCCESS;i++)
-			{
-			if (status == MB_SUCCESS
-				&& i < MBSYS_SIMRAD3_MAXBEAMS)
-				{
-				read_len = (size_t)(ping->png_quality_nparameters * sizeof(float));
-				status = mb_fileio_get(verbose, mbio_ptr, (char *)line, &read_len, error);
-				for (j=0;j<ping->png_quality_nparameters;j++)
-					{
-					mb_get_binary_float(swap, &line[j * sizeof(float)], &float_val);
-					    ping->png_quality_parameters[i][j] = float_val;				
-					}
-				}
-			}
-		}
-
-	/* now get last bytes of record */
-	if (status == MB_SUCCESS)
-		{
-		read_len = (size_t)4;
-		status = mb_fileio_get(verbose, mbio_ptr, (char *)line, &read_len, error);
-		if (line[1] == EM3_END)
-			*goodend = MB_YES;
-#ifdef MBR_EM710RAW_DEBUG
-	fprintf(stderr, "End Bytes: %2.2hhX %d | %2.2hhX %d | %2.2hhX %d\n",
-		line[1], line[1],
-		line[2], line[2],
-		line[3], line[3]);
-#endif
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:                  %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:                 %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:                  %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:                  %d\n",store->msec);
-		fprintf(stderr,"dbg5       png_quality_date:              %d\n",ping->png_quality_date);
-		fprintf(stderr,"dbg5       png_quality_msec:              %d\n",ping->png_quality_msec);
-		fprintf(stderr,"dbg5       png_quality_count:             %d\n",ping->png_quality_count);
-		fprintf(stderr,"dbg5       png_quality_serial:            %d\n",ping->png_quality_serial);
-		fprintf(stderr,"dbg5       png_quality_nbeams:            %d\n",ping->png_quality_nbeams);
-		fprintf(stderr,"dbg5       png_quality_nparameters:       %d\n",ping->png_quality_nparameters);
-		fprintf(stderr,"dbg5       png_quality_spare:             %d\n",ping->png_quality_spare);
-		fprintf(stderr,"dbg5       cnt  quality parameters\n");
-		fprintf(stderr,"dbg5       ------------------------------------------------------------\n");
-		for (i=0;i<ping->png_quality_nbeams;i++)
-			{
-			fprintf(stderr,"dbg5       %3d ", i);
-			for (j=0;j<ping->png_quality_nparameters;j++)
-				fprintf(stderr,"%f", ping->png_quality_parameters[i][j]);
-			fprintf(stderr,"\n");
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       goodend:    %d\n",*goodend);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em710raw_rd_ss2(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store,
-		short sonar, 
-		int *goodend, int *error)
-{
-	char	*function_name = "mbr_em710raw_rd_ss2";
-	int	status = MB_SUCCESS;
-	struct mbsys_simrad3_ping_struct *ping;
-	char	line[EM3_SS2_HEADER_SIZE];
-	short	short_val;
-	float	float_val;
-	size_t	read_len;
-	int	done;
-	int	junk_bytes;
-	int	png_count;
-	int	serial;
-	int	oldest_ping;
-	int	oldest_ping_index;
-	int	found;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		fprintf(stderr,"dbg2       sonar:      %d\n",sonar);
-		}
-
-	/* set goodend false until a good end is found */
-	*goodend = MB_NO;
-
-	/* set kind and type values */
-	store->kind = MB_DATA_DATA;
-	store->type = EM3_SS2;
-	store->sonar = sonar;
-
-	/* read binary header values into char array */
-	read_len = (size_t)EM3_SS2_HEADER_SIZE;
-	status = mb_fileio_get(verbose, mbio_ptr, (char *)line, &read_len, error);
-
-	/* figure out which storage structure to use */
-	mb_get_binary_short(swap, &line[8], &short_val);
-	png_count = (int) ((unsigned short) short_val);
-	mb_get_binary_short(swap, &line[10], &short_val);
-	serial = (int) ((unsigned short) short_val);
-	found = MB_NO;
-	oldest_ping = 999999999;
-	oldest_ping_index = -1;
-	for (i=0;i<MBSYS_SIMRAD3_NUM_PING_STRUCTURES && found == MB_NO;i++)
-		{
-		/* look for this ping by ping number and sonar serial number - if we already read
-		 * a record from this ping it has to be stored in one of the structures */
-		if (store->pings[i].read_status > 0 && png_count == store->pings[i].count && serial == store->pings[i].serial)
-			{
-			found = MB_YES;
-			store->ping_index = i;
-			}
-			
-		/* figure out which structure is holding the oldest ping in case we need to drop one
-		 * from memory to make room for the new ping. */
-		else if (store->pings[i].read_status > 0)
-			{
-			if (png_count < oldest_ping)
-				{
-				oldest_ping = png_count;
-				oldest_ping_index = i;
-				}
-			}
-			
-		/* if one of the ping structures is unused, set it to be used if we need to store
-		 * this ping */
-		else if (oldest_ping > 0)
-			{
-			oldest_ping = 0;
-			oldest_ping_index = i;
-			}
-		}
-	if (found == MB_NO)
-		{
-		store->ping_index = oldest_ping_index;
-		}
-	ping = (struct mbsys_simrad3_ping_struct *) &store->pings[store->ping_index];
-	ping->count = png_count;
-	ping->serial = serial;
-
-	/* get binary header data */
-	if (status == MB_SUCCESS)
-		{
-		mb_get_binary_int(swap, &line[0], &ping->png_ss_date);
-		    store->date = ping->png_ss_date;
-		mb_get_binary_int(swap, &line[4], & ping->png_ss_msec);
-		    store->msec = ping->png_ss_msec;
-		mb_get_binary_short(swap, &line[8], &short_val);
-		    ping->png_ss_count = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[10], &short_val);
-		    ping->png_ss_serial = (int) ((unsigned short) short_val);
-		mb_get_binary_float(swap, &line[12], &float_val);
-		    ping->png_ss_sample_rate = float_val;
-		mb_get_binary_short(swap, &line[16], &short_val);
-		    ping->png_r_zero = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[18], &short_val);
-		    ping->png_bsn = (int) ((short) short_val);
-		mb_get_binary_short(swap, &line[20], &short_val);
-		    ping->png_bso = (int) ((short) short_val);
-		mb_get_binary_short(swap, &line[22], &short_val);
-		    ping->png_tx = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[24], &short_val);
-		    ping->png_tvg_crossover = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[26], &short_val);
-		    ping->png_nbeams_ss = (int) ((unsigned short) short_val);
-/*fprintf(stderr," ping->png_ss_date:%d  ping->png_ss_msec:%d  ping->png_ss_count:%d  ping->png_nbeams_ss:%d\n",
-ping->png_ss_date,ping->png_ss_msec,ping->png_ss_count,ping->png_nbeams_ss);*/
-		}
-
-	/* check for some indicators of a broken record
-	    - these do happen!!!! */
-	if (status == MB_SUCCESS)
-		{
-		if (ping->png_nbeams_ss < 0
-			|| ping->png_nbeams_ss > MBSYS_SIMRAD3_MAXBEAMS)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_UNINTELLIGIBLE;
-			}
-		}
-
-	/* read binary beam values */
-	if (status == MB_SUCCESS)
-	    {
-	    ping->png_npixels = 0;
-	    for (i=0;i<ping->png_nbeams_ss && status == MB_SUCCESS;i++)
-		{
-		read_len = (size_t)EM3_SS2_BEAM_SIZE;
-		status = mb_fileio_get(verbose, mbio_ptr, (char *)line, &read_len, error);
-		if (status == MB_SUCCESS
-			&& i < MBSYS_SIMRAD3_MAXBEAMS)
-			{
-			status = MB_SUCCESS;
-			ping->png_sort_direction[i] = (mb_s_char) line[0];
-			ping->png_ssdetection[i] = (mb_u_char) line[1];
-			mb_get_binary_short(swap, &line[2], &short_val);
-			    ping->png_beam_samples[i] = (int) ((unsigned short) short_val);
-			mb_get_binary_short(swap, &line[4], &short_val);
-			    ping->png_center_sample[i] = (int) ((unsigned short) short_val);
-
-			ping->png_start_sample[i] = ping->png_npixels;
-			ping->png_npixels += ping->png_beam_samples[i];
-			if (ping->png_npixels > MBSYS_SIMRAD3_MAXRAWPIXELS)
-				{
-				ping->png_beam_samples[i]
-					-= (ping->png_npixels
-						- MBSYS_SIMRAD3_MAXRAWPIXELS);
-				if (ping->png_beam_samples[i] < 0)
-					ping->png_beam_samples[i] = 0;
-				}
-			}
-		}
-
-	    /* check for too much pixel data */
-	    if (ping->png_npixels > MBSYS_SIMRAD3_MAXRAWPIXELS)
-		{
-		if (verbose > 0)
-		    fprintf(stderr, "WARNING: Simrad multibeam sidescan pixels %d exceed maximum %d!\n",
-			    ping->png_npixels, MBSYS_SIMRAD3_MAXRAWPIXELS);
-		junk_bytes = ping->png_npixels - MBSYS_SIMRAD3_MAXRAWPIXELS;
-		ping->png_npixels = MBSYS_SIMRAD3_MAXRAWPIXELS;
-		status = MB_FAILURE;
-		*error = MB_ERROR_UNINTELLIGIBLE;
-		}
-	    else
-		junk_bytes = 0;
-	    }
-
-	/* read binary sidescan values */
-	if (status == MB_SUCCESS)
-		{
-		read_len = (size_t)(2 * ping->png_npixels);
-		status = mb_fileio_get(verbose, mbio_ptr, (char *)ping->png_ssraw, &read_len, error);
-		}
-
-	/* read any leftover binary sidescan values */
-	if (status == MB_SUCCESS)
-		{
-		for (i=0;i<junk_bytes;i++)
-			{
-			read_len = (size_t)1;
-			status = mb_fileio_get(verbose, mbio_ptr, (char *)line, &read_len, error);
-			}
-		}
-
-	/* now loop over reading individual characters to
-	    get last bytes of record */
-	if (status == MB_SUCCESS)
-	    {
-	    done = MB_NO;
-	    while (done == MB_NO)
-		{
-		read_len = (size_t)1;
-		status = mb_fileio_get(verbose, mbio_ptr, (char *)line, &read_len, error);
-		if (status == MB_SUCCESS && line[0] == EM3_END)
-			{
-			done = MB_YES;
-
-			/* get last two check sum bytes */
-			read_len = (size_t)2;
-			status = mb_fileio_get(verbose, mbio_ptr, (char *)&line[1], &read_len, error);
-
-			*goodend = MB_YES;
-#ifdef MBR_EM710RAW_DEBUG
-	fprintf(stderr, "End Bytes: %2.2hhX %d | %2.2hhX %d | %2.2hhX %d\n",
-		line[0], line[0],
-		line[1], line[1],
-		line[2], line[2]);
-#endif
-			}
-		else if (status != MB_SUCCESS)
-			{
-			done = MB_YES;
-			/* return success here because all of the
-			    important information in this record has
-			    already been read - next attempt to read
-			    file will return error */
-			status = MB_SUCCESS;
-			*error = MB_ERROR_NO_ERROR;
-			}
-		}
-#ifdef MBR_EM710RAW_DEBUG
-	fprintf(stderr, "\n");
-#endif
-	    }
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:               %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:              %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:               %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:               %d\n",store->msec);
-		fprintf(stderr,"dbg5       png_date:           %d\n",ping->png_date);
-		fprintf(stderr,"dbg5       png_msec:           %d\n",ping->png_msec);
-		fprintf(stderr,"dbg5       png_date:              %d\n",ping->png_date);
-		fprintf(stderr,"dbg5       png_msec:              %d\n",ping->png_msec);
-		fprintf(stderr,"dbg5       png_count:             %d\n",ping->png_count);
-		fprintf(stderr,"dbg5       png_serial:            %d\n",ping->png_serial);
-		fprintf(stderr,"dbg5       png_heading:           %d\n",ping->png_heading);
-		fprintf(stderr,"dbg5       png_ssv:               %d\n",ping->png_ssv);
-		fprintf(stderr,"dbg5       png_xducer_depth:      %f\n",ping->png_xducer_depth);
-		fprintf(stderr,"dbg5       png_nbeams:            %d\n",ping->png_nbeams);
-		fprintf(stderr,"dbg5       png_nbeams_valid:      %d\n",ping->png_nbeams_valid);
-		fprintf(stderr,"dbg5       png_sample_rate:       %f\n",ping->png_sample_rate);
-		fprintf(stderr,"dbg5       png_spare:             %d\n",ping->png_spare);
-		fprintf(stderr,"dbg5       cnt  depth   xtrack   ltrack   wndw quality iba det clean amp\n");
-		fprintf(stderr,"dbg5       ------------------------------------------------------------\n");
-		for (i=0;i<ping->png_nbeams;i++)
-			fprintf(stderr,"dbg5       %3d %7.2f %7.2f %7.2f %5d %5d %5d %4d %3d %3d\n",
-				i, ping->png_depth[i], ping->png_acrosstrack[i],
-				ping->png_alongtrack[i], ping->png_window[i],
-				ping->png_quality[i], ping->png_iba[i],
-				ping->png_detection[i], ping->png_clean[i],
-				ping->png_amp[i]);
-
-		fprintf(stderr,"dbg5       png_ss_date:        %d\n",ping->png_ss_date);
-		fprintf(stderr,"dbg5       png_ss_msec:        %d\n",ping->png_ss_msec);
-		fprintf(stderr,"dbg5       png_ss_count:       %d\n",ping->png_ss_count);
-		fprintf(stderr,"dbg5       png_ss_serial:      %d\n",ping->png_ss_serial);
-		fprintf(stderr,"dbg5       png_ss_sample_rate: %f\n",ping->png_ss_sample_rate);
-		fprintf(stderr,"dbg5       png_r_zero:         %d\n",ping->png_r_zero);
-		fprintf(stderr,"dbg5       png_bsn:            %d\n",ping->png_bsn);
-		fprintf(stderr,"dbg5       png_bso:            %d\n",ping->png_bso);
-		fprintf(stderr,"dbg5       png_tx:             %d\n",ping->png_tx);
-		fprintf(stderr,"dbg5       png_tvg_crossover:  %d\n",ping->png_tvg_crossover);
-		fprintf(stderr,"dbg5       png_nbeams_ss:      %d\n",ping->png_nbeams_ss);
-		fprintf(stderr,"dbg5       png_npixels:        %d\n",ping->png_npixels);
-		fprintf(stderr,"dbg5       cnt  index sort samples start center\n");
-		fprintf(stderr,"dbg5       --------------------------------------------------\n");
-		for (i=0;i<ping->png_nbeams_ss;i++)
-			fprintf(stderr,"dbg5        %4d %2d %4d %4d %4d %4d\n",
-				i, ping->png_sort_direction[i], ping->png_ssdetection[i],
-				ping->png_beam_samples[i], ping->png_start_sample[i],
-				ping->png_center_sample[i]);
-		fprintf(stderr,"dbg5       cnt  ss\n");
-		fprintf(stderr,"dbg5       --------------------------------------------------\n");
-		for (i=0;i<ping->png_npixels;i++)
-			fprintf(stderr,"dbg5        %d %d\n",
-				i, ping->png_ssraw[i]);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       goodend:    %d\n",*goodend);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em710raw_rd_wc(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store,
-		short sonar, int *goodend, int *error)
-{
-	char	*function_name = "mbr_em710raw_rd_wc";
-	int	status = MB_SUCCESS;
-	struct mbsys_simrad3_watercolumn_struct *wc;
-	char	line[EM3_WC_HEADER_SIZE];
-	short	short_val;
-	size_t	read_len;
-	int	done;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		fprintf(stderr,"dbg2       sonar:      %d\n",sonar);
-		}
-
-	/* set goodend false until a good end is found */
-	*goodend = MB_NO;
-
-	/* get  storage structure */
-	wc = (struct mbsys_simrad3_watercolumn_struct *) store->wc;
-
-	/* set kind and type values */
-	store->kind = MB_DATA_WATER_COLUMN;
-	store->type = EM3_WATERCOLUMN;
-	store->sonar = sonar;
-
-	/* read binary header values into char array */
-	read_len = (size_t)EM3_WC_HEADER_SIZE;
-	status = mb_fileio_get(verbose, mbio_ptr, (char *)line, &read_len, error);
-
-	/* get binary header data */
-	if (status == MB_SUCCESS)
-		{
-		mb_get_binary_int(swap, &line[0], &wc->wtc_date);
-		    store->date = wc->wtc_date;
-		mb_get_binary_int(swap, &line[4], & wc->wtc_msec);
-		    store->msec = wc->wtc_msec;
-		mb_get_binary_short(swap, &line[8], &short_val);
-		    wc->wtc_count = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[10], &short_val);
-		    wc->wtc_serial = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[12], &short_val);
-		    wc->wtc_ndatagrams = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[14], &short_val);
-		    wc->wtc_datagram = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[16], &short_val);
-		    wc->wtc_ntx = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[18], &short_val);
-		    wc->wtc_nrx = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[20], &short_val);
-		    wc->wtc_nbeam = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[22], &short_val);
-		    wc->wtc_ssv = (int) ((unsigned short) short_val);
-		mb_get_binary_int(swap, &line[24], &(wc->wtc_sfreq));
-		mb_get_binary_short(swap, &line[28], &short_val);
-		    wc->wtc_heave = (int) ((short) short_val);
-		mb_get_binary_short(swap, &line[30], &short_val);
-		    wc->wtc_spare1 = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[32], &short_val);
-		    wc->wtc_spare2 = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &line[34], &short_val);
-		    wc->wtc_spare3 = (int) ((unsigned short) short_val);
-		}
-
-	/* check for some indicators of a broken record
-	    - these do happen!!!! */
-	if (status == MB_SUCCESS)
-		{
-		if (wc->wtc_nbeam < 0
-			|| wc->wtc_nbeam > MBSYS_SIMRAD3_MAXBEAMS
-			|| wc->wtc_ntx < 0
-			|| wc->wtc_ntx > MBSYS_SIMRAD3_MAXTX)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_UNINTELLIGIBLE;
-			}
-		}
-
-	/* read binary beam values */
-	if (status == MB_SUCCESS)
-	    {
-	    for (i=0;i<wc->wtc_ntx && status == MB_SUCCESS;i++)
-		{
-		read_len = (size_t)EM3_WC_TX_SIZE;
-		status = mb_fileio_get(verbose, mbio_ptr, (char *)line, &read_len, error);
-		if (status == MB_SUCCESS
-			&& i < MBSYS_SIMRAD3_MAXTX)
-			{
-			mb_get_binary_short(swap, &line[0], &short_val);
-			    wc->wtc_txtiltangle[i] = (int) (short_val);
-			mb_get_binary_short(swap, &line[2], &short_val);
-			    wc->wtc_txcenter[i] = (int) (short_val);
-			wc->wtc_txsector[i] = (int) ((mb_u_char) line[4]);
-			}
-		}
-	    for (i=0;i<wc->wtc_nbeam && status == MB_SUCCESS;i++)
-		{
-		read_len = (size_t)EM3_WC_BEAM_SIZE;
-		status = mb_fileio_get(verbose, mbio_ptr, (char *)line, &read_len, error);
-		if (status == MB_SUCCESS
-			&& i < MBSYS_SIMRAD3_MAXBEAMS)
-			{
-			mb_get_binary_short(swap, &line[0], &short_val);
-			    wc->beam[i].wtc_rxpointangle = (int) (short_val);
-			mb_get_binary_short(swap, &line[2], &short_val);
-			    wc->beam[i].wtc_start_sample = (int) (short_val);
-			mb_get_binary_short(swap, &line[4], &short_val);
-			    wc->beam[i].wtc_beam_samples = (int) (unsigned short)(short_val);
-			mb_get_binary_short(swap, &line[6], &short_val);
-			    wc->beam[i].wtc_beam_spare = (int) (unsigned short)(short_val);
-			wc->beam[i].wtc_sector = (int) (mb_u_char) (line[8]);
-			wc->beam[i].wtc_beam = (int) (mb_u_char) (line[9]);
-			}
-		read_len = (size_t)wc->beam[i].wtc_beam_samples;
-		status = mb_fileio_get(verbose, mbio_ptr, (char *)wc->beam[i].wtc_amp, &read_len, error);
-		}
-	    }
-
-	/* now loop over reading individual characters to
-	    get last bytes of record */
-	if (status == MB_SUCCESS)
-	    {
-	    done = MB_NO;
-	    while (done == MB_NO)
-		{
-		read_len = (size_t)1;
-		status = mb_fileio_get(verbose, mbio_ptr, (char *)line, &read_len, error);
-		if (status == MB_SUCCESS && line[0] == EM3_END)
-			{
-			done = MB_YES;
-
-			/* get last two check sum bytes */
-			read_len = (size_t)2;
-			status = mb_fileio_get(verbose, mbio_ptr, (char *)&line[1], &read_len, error);
-			*goodend = MB_YES;
-#ifdef MBR_EM710RAW_DEBUG
-	fprintf(stderr, "End Bytes: %2.2hhX %d | %2.2hhX %d | %2.2hhX %d\n",
-		line[0], line[0],
-		line[1], line[1],
-		line[2], line[2]);
-#endif
-			}
-		else if (status != MB_SUCCESS)
-			{
-			done = MB_YES;
-			/* return success here because all of the
-			    important information in this record has
-			    already been read - next attempt to read
-			    file will return error */
-			status = MB_SUCCESS;
-			*error = MB_ERROR_NO_ERROR;
-			}
-		}
-#ifdef MBR_EM710RAW_DEBUG
-	fprintf(stderr, "\n");
-#endif
-	    }
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       wtc_date:        %d\n",wc->wtc_date);
-		fprintf(stderr,"dbg5       wtc_msec:        %d\n",wc->wtc_msec);
-		fprintf(stderr,"dbg5       wtc_count:       %d\n",wc->wtc_count);
-		fprintf(stderr,"dbg5       wtc_serial:      %d\n",wc->wtc_serial);
-		fprintf(stderr,"dbg5       wtc_ndatagrams:  %d\n",wc->wtc_ndatagrams);
-		fprintf(stderr,"dbg5       wtc_datagram:    %d\n",wc->wtc_datagram);
-		fprintf(stderr,"dbg5       wtc_ntx:         %d\n",wc->wtc_ntx);
-		fprintf(stderr,"dbg5       wtc_nrx:         %d\n",wc->wtc_nrx);
-		fprintf(stderr,"dbg5       wtc_nbeam:       %d\n",wc->wtc_nbeam);
-		fprintf(stderr,"dbg5       wtc_ssv:         %d\n",wc->wtc_ssv);
-		fprintf(stderr,"dbg5       wtc_sfreq:       %d\n",wc->wtc_sfreq);
-		fprintf(stderr,"dbg5       wtc_heave:       %d\n",wc->wtc_heave);
-		fprintf(stderr,"dbg5       wtc_spare1:      %d\n",wc->wtc_spare1);
-		fprintf(stderr,"dbg5       wtc_spare2:      %d\n",wc->wtc_spare2);
-		fprintf(stderr,"dbg5       wtc_spare3:      %d\n",wc->wtc_spare3);
-		fprintf(stderr,"dbg5       ---------------------------\n");
-		fprintf(stderr,"dbg5       cnt  tilt center sector\n");
-		fprintf(stderr,"dbg5       ---------------------------\n");
-		for (i=0;i<wc->wtc_ntx;i++)
-			fprintf(stderr,"dbg5       %3d %6d %6d %6d\n",
-				i, wc->wtc_txtiltangle[i], wc->wtc_txcenter[i],
-				wc->wtc_txsector[i]);
-		for (i=0;i<wc->wtc_nbeam;i++)
-			{
-			fprintf(stderr,"dbg5       --------------------------------------------------\n");
-			fprintf(stderr,"dbg5       cnt  angle start samples unknown sector beam\n");
-			fprintf(stderr,"dbg5       --------------------------------------------------\n");
-			fprintf(stderr,"dbg5        %4d %3d %2d %4d %4d %4d %4d\n",
-				i, wc->beam[i].wtc_rxpointangle,
-				wc->beam[i].wtc_start_sample,
-				wc->beam[i].wtc_beam_samples,
-				wc->beam[i].wtc_beam_spare,
-				wc->beam[i].wtc_sector,
-				wc->beam[i].wtc_beam);
-/*			fprintf(stderr,"dbg5       --------------------------------------------------\n");
-			fprintf(stderr,"dbg5       beam[%d]: sample amplitude\n",i);
-			fprintf(stderr,"dbg5       --------------------------------------------------\n");
-			for (j=0;j<wc->beam[i].wtc_beam_samples;j++)
-				fprintf(stderr,"dbg5        %4d %4d\n",
-					j, wc->beam[i].wtc_amp[j]);*/
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       goodend:    %d\n",*goodend);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em710raw_wr_data(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_em710raw_wr_data";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_simrad3_struct *store;
-	struct mbsys_simrad3_ping_struct *ping;
-	FILE	*mbfp;
-	int	swap;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_simrad3_struct *) store_ptr;
-	mbfp = mb_io_ptr->mbfp;
-
-#ifdef MBR_EM710RAW_DEBUG
-	fprintf(stderr,"\nstart of mbr_em710raw_wr_data:\n");
-	fprintf(stderr,"kind:%d %d type:%x\n", store->kind, mb_io_ptr->new_kind, store->type);
-#endif
-	
-	/* figure out which storage structure to use */
-	ping = (struct mbsys_simrad3_ping_struct *) &(store->pings[store->ping_index]);
-
-	/* set swap flag */
-	swap = MB_YES;
-
-	if (store->kind == MB_DATA_COMMENT
-		|| store->kind == MB_DATA_START
-		|| store->kind == MB_DATA_STOP)
-		{
-#ifdef MBR_EM710RAW_DEBUG
-	fprintf(stderr,"call mbr_em710raw_wr_start kind:%d type %x\n",store->kind,store->type);
-#else
-#ifdef MBR_EM710RAW_DEBUG3
-	fprintf(stderr,"type:%x sonar:%d                      mbr_em710raw_wr_start\n\n",store->type,store->sonar);
-#endif
-#endif
-		status = mbr_em710raw_wr_start(verbose,mbio_ptr,swap,store,error);
-		}
-	else if (store->kind == MB_DATA_STATUS)
-		{
-#ifdef MBR_EM710RAW_DEBUG
-	fprintf(stderr,"call mbr_em710raw_wr_status kind:%d type %x\n",store->kind,store->type);
-#else
-#ifdef MBR_EM710RAW_DEBUG3
-	fprintf(stderr,"type:%x sonar:%d                      mbr_em710raw_wr_status\n\n",store->type,store->sonar);
-#endif
-#endif
-		status = mbr_em710raw_wr_status(verbose,mbio_ptr,swap,store,error);
-		}
-	else if (store->kind == MB_DATA_RUN_PARAMETER)
-		{
-#ifdef MBR_EM710RAW_DEBUG
-	fprintf(stderr,"call mbr_em710raw_wr_run_parameter kind:%d type %x\n",store->kind,store->type);
-#else
-#ifdef MBR_EM710RAW_DEBUG3
-	fprintf(stderr,"type:%x sonar:%d                      mbr_em710raw_wr_run_parameter\n\n",store->type,store->sonar);
-#endif
-#endif
-		status = mbr_em710raw_wr_run_parameter(verbose,mbio_ptr,swap,store,error);
-		}
-	else if (store->kind == MB_DATA_CLOCK)
-		{
-#ifdef MBR_EM710RAW_DEBUG
-	fprintf(stderr,"call mbr_em710raw_wr_clock kind:%d type %x\n",store->kind,store->type);
-#else
-#ifdef MBR_EM710RAW_DEBUG3
-	fprintf(stderr,"type:%x sonar:%d                      mbr_em710raw_wr_clock\n\n",store->type,store->sonar);
-#endif
-#endif
-		status = mbr_em710raw_wr_clock(verbose,mbio_ptr,swap,store,error);
-		}
-	else if (store->kind == MB_DATA_TIDE)
-		{
-#ifdef MBR_EM710RAW_DEBUG
-	fprintf(stderr,"call mbr_em710raw_wr_tide kind:%d type %x\n",store->kind,store->type);
-#else
-#ifdef MBR_EM710RAW_DEBUG3
-	fprintf(stderr,"type:%x sonar:%d                      mbr_em710raw_wr_tide\n\n",store->type,store->sonar);
-#endif
-#endif
-		status = mbr_em710raw_wr_tide(verbose,mbio_ptr,swap,store,error);
-		}
-	else if (store->kind == MB_DATA_HEIGHT)
-		{
-#ifdef MBR_EM710RAW_DEBUG
-	fprintf(stderr,"call mbr_em710raw_wr_height kind:%d type %x\n",store->kind,store->type);
-#else
-#ifdef MBR_EM710RAW_DEBUG3
-	fprintf(stderr,"type:%x sonar:%d                      mbr_em710raw_wr_height\n\n",store->type,store->sonar);
-#endif
-#endif
-		status = mbr_em710raw_wr_height(verbose,mbio_ptr,swap,store,error);
-		}
-	else if (store->kind == MB_DATA_HEADING)
-		{
-#ifdef MBR_EM710RAW_DEBUG
-	fprintf(stderr,"call mbr_em710raw_wr_heading kind:%d type %x\n",store->kind,store->type);
-#else
-#ifdef MBR_EM710RAW_DEBUG3
-	fprintf(stderr,"type:%x sonar:%d                      mbr_em710raw_wr_heading\n\n",store->type,store->sonar);
-#endif
-#endif
-		status = mbr_em710raw_wr_heading(verbose,mbio_ptr,swap,store,error);
-		}
-	else if (store->kind == MB_DATA_SSV)
-		{
-#ifdef MBR_EM710RAW_DEBUG
-	fprintf(stderr,"call mbr_em710raw_wr_ssv kind:%d type %x\n",store->kind,store->type);
-#else
-#ifdef MBR_EM710RAW_DEBUG3
-	fprintf(stderr,"type:%x sonar:%d                      mbr_em710raw_wr_ssv\n\n",store->type,store->sonar);
-#endif
-#endif
-		status = mbr_em710raw_wr_ssv(verbose,mbio_ptr,swap,store,error);
-		}
-	else if (store->kind == MB_DATA_TILT)
-		{
-#ifdef MBR_EM710RAW_DEBUG
-	fprintf(stderr,"call mbr_em710raw_wr_tilt kind:%d type %x\n",store->kind,store->type);
-#else
-#ifdef MBR_EM710RAW_DEBUG3
-	fprintf(stderr,"type:%x sonar:%d                      mbr_em710raw_wr_tilt\n\n",store->type,store->sonar);
-#endif
-#endif
-		status = mbr_em710raw_wr_tilt(verbose,mbio_ptr,swap,store,error);
-		}
-	else if (store->kind == MB_DATA_PARAMETER)
-		{
-#ifdef MBR_EM710RAW_DEBUG
-	fprintf(stderr,"call mbr_em710raw_wr_extraparameters kind:%d type %x\n",store->kind,store->type);
-#else
-#ifdef MBR_EM710RAW_DEBUG3
-	fprintf(stderr,"type:%x sonar:%d                      mbr_em710raw_wr_extraparameters\n\n",store->type,store->sonar);
-#endif
-#endif
-		status = mbr_em710raw_wr_extraparameters(verbose,mbio_ptr,swap,store,error);
-		}
-	else if ((store->kind == MB_DATA_ATTITUDE
-			|| store->kind == MB_DATA_ATTITUDE1)
-		 && store->type == EM3_ATTITUDE)
-		{
-#ifdef MBR_EM710RAW_DEBUG
-	fprintf(stderr,"call mbr_em710raw_wr_attitude kind:%d type %x\n",store->kind,store->type);
-#else
-#ifdef MBR_EM710RAW_DEBUG3
-	fprintf(stderr,"type:%x sonar:%d                      mbr_em710raw_wr_attitude\n\n",store->type,store->sonar);
-#endif
-#endif
-		status = mbr_em710raw_wr_attitude(verbose,mbio_ptr,swap,store,error);
-		}
-	else if (store->kind == MB_DATA_ATTITUDE2
-		 && store->type == EM3_NETATTITUDE)
-		{
-#ifdef MBR_EM710RAW_DEBUG
-	fprintf(stderr,"call mbr_em710raw_wr_netattitude kind:%d type %x\n",store->kind,store->type);
-#else
-#ifdef MBR_EM710RAW_DEBUG3
-	fprintf(stderr,"type:%x sonar:%d                      mbr_em710raw_wr_netattitude\n\n",store->type,store->sonar);
-#endif
-#endif
-		status = mbr_em710raw_wr_netattitude(verbose,mbio_ptr,swap,store,error);
-		}
-	else if (store->kind == MB_DATA_NAV
-		|| store->kind == MB_DATA_NAV1
-		|| store->kind == MB_DATA_NAV2
-		|| store->kind == MB_DATA_NAV3)
-		{
-#ifdef MBR_EM710RAW_DEBUG
-	fprintf(stderr,"call mbr_em710raw_wr_pos kind:%d type %x\n",store->kind,store->type);
-#else
-#ifdef MBR_EM710RAW_DEBUG3
-	fprintf(stderr,"type:%x sonar:%d                      mbr_em710raw_wr_pos\n\n",store->type,store->sonar);
-#endif
-#endif
-		status = mbr_em710raw_wr_pos(verbose,mbio_ptr,swap,store,error);
-		}
-	else if (store->kind == MB_DATA_VELOCITY_PROFILE)
-		{
-#ifdef MBR_EM710RAW_DEBUG
-	fprintf(stderr,"call mbr_em710raw_wr_svp kind:%d type %x\n",store->kind,store->type);
-#else
-#ifdef MBR_EM710RAW_DEBUG3
-	fprintf(stderr,"type:%x sonar:%d                      mbr_em710raw_wr_svp\n\n",store->type,store->sonar);
-#endif
-#endif
-	        if (store->type == EM3_SVP)
-		  status = mbr_em710raw_wr_svp(verbose,mbio_ptr,swap,store,error);
-		else
-		  status = mbr_em710raw_wr_svp2(verbose,mbio_ptr,swap,store,error);
-		}
-	else if (store->kind == MB_DATA_DATA)
-		{
-		if (ping->png_raw_read == MB_YES)
-		    {
-#ifdef MBR_EM710RAW_DEBUG
-	fprintf(stderr,"call mbr_em710raw_wr_rawbeam4 kind:%d type %x\n",store->kind,store->type);
-#else
-#ifdef MBR_EM710RAW_DEBUG3
-	fprintf(stderr,"type:%x sonar:%d                      mbr_em710raw_wr_rawbeam4: sonar 1 ping:%d\n",
-		store->type,store->sonar,store->pings[store->ping_index].png_count);
-#endif
-#endif
-		    status = mbr_em710raw_wr_rawbeam4(verbose,mbio_ptr,swap,store,error);
-		    }
-#ifdef MBR_EM710RAW_DEBUG
-	else fprintf(stderr,"NOT call mbr_em710raw_wr_rawbeam4 kind:%d type %x\n",store->kind,store->type);
-#else
-#ifdef MBR_EM710RAW_DEBUG3
-	else fprintf(stderr,"NOT call mbr_em710raw_wr_rawbeam4\n");
-#endif
-#endif
-
-		if (ping->png_quality_read == MB_YES)
-		    {
-#ifdef MBR_EM710RAW_DEBUG
-	fprintf(stderr,"call mbr_em710raw_wr_quality kind:%d type %x\n",store->kind,store->type);
-#else
-#ifdef MBR_EM710RAW_DEBUG3
-	fprintf(stderr,"type:%x sonar:%d                      mbr_em710raw_wr_quality: sonar 1 ping:%d\n",
-		store->type,store->sonar,store->pings[store->ping_index].png_count);
-#endif
-#endif
-		    status = mbr_em710raw_wr_quality(verbose,mbio_ptr,swap,store,error);
-		    }
-#ifdef MBR_EM710RAW_DEBUG
-	else fprintf(stderr,"NOT call mbr_em710raw_wr_quality kind:%d type %x\n",store->kind,store->type);
-#else
-#ifdef MBR_EM710RAW_DEBUG3
-	else fprintf(stderr,"NOT call mbr_em710raw_wr_quality\n");
-#endif
-#endif
-
-#ifdef MBR_EM710RAW_DEBUG
-	fprintf(stderr,"call mbr_em710raw_wr_bath2 kind:%d type %x\n",store->kind,store->type);
-#else
-#ifdef MBR_EM710RAW_DEBUG3
-	fprintf(stderr,"type:%x sonar:%d                      mbr_em710raw_wr_bath2: sonar 1 ping:%d\n",
-		store->type,store->sonar,store->pings[store->ping_index].png_count);
-#endif
-#endif
-		status = mbr_em710raw_wr_bath2(verbose,mbio_ptr,swap,store,error);
-		if (ping->png_ss_read == MB_YES)
-		    {
-#ifdef MBR_EM710RAW_DEBUG
-	fprintf(stderr,"call mbr_em710raw_wr_ss2 kind:%d type %x\n",store->kind,store->type);
-#else
-#ifdef MBR_EM710RAW_DEBUG3
-	fprintf(stderr,"type:%x sonar:%d                      mbr_em710raw_wr_ss2: sonar 1 ping:%d\n\n",store->type,store->sonar,store->pings[store->ping_index].png_count);
-#endif
-#endif
-		    status = mbr_em710raw_wr_ss2(verbose,mbio_ptr,swap,store,error);
-		    }
-#ifdef MBR_EM710RAW_DEBUG
-	else fprintf(stderr,"NOT call mbr_em710raw_wr_ss2 kind:%d type %x\n",store->kind,store->type);
-#else
-#ifdef MBR_EM710RAW_DEBUG3
-	else fprintf(stderr,"NOT call mbr_em710raw_wr_ss2\n\n");
-#endif
-#endif
-		}
-	else if (store->kind == MB_DATA_WATER_COLUMN)
-		{
-#ifdef MBR_EM710RAW_DEBUG
-	fprintf(stderr,"call mbr_em710raw_wr_wc kind:%d type %x\n",store->kind,store->type);
-#else
-#ifdef MBR_EM710RAW_DEBUG3
-	fprintf(stderr,"type:%x sonar:%d                      mbr_em710raw_wr_wc\n\n",store->type,store->sonar);
-#endif
-#endif
-	        status = mbr_em710raw_wr_wc(verbose,mbio_ptr,swap,store,error);
-		}
-	else
-		{
-#ifdef MBR_EM710RAW_DEBUG
-	fprintf(stderr,"call nothing bad kind: %d type %x\n", store->kind, store->type);
-#else
-#ifdef MBR_EM710RAW_DEBUG3
-	fprintf(stderr,"call nothing bad kind: %d type %x\n\n", store->kind, store->type);
-#endif
-#endif
-		status = MB_FAILURE;
-		*error = MB_ERROR_BAD_KIND;
-		}
-
-#ifdef MBR_EM710RAW_DEBUG
-	fprintf(stderr,"status:%d error:%d\n", status, *error);
-	fprintf(stderr,"end of mbr_em710raw_wr_data:\n");
-#endif
-
-	/* print output debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Data record kind in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       kind:       %d\n",store->kind);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em710raw_wr_start(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store, int *error)
-{
-	char	*function_name = "mbr_em710raw_wr_start";
-	int	status = MB_SUCCESS;
-	char	line[MBSYS_SIMRAD3_BUFFER_SIZE], *buff;
-	int	buff_len;
-	size_t	write_len;
-	int	write_size;
-	unsigned short checksum;
-	char	*comma_ptr;
-	mb_u_char   *uchar_ptr;
-	int	j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       par_date:        %d\n",store->par_date);
-		fprintf(stderr,"dbg5       par_msec:        %d\n",store->par_msec);
-		fprintf(stderr,"dbg5       par_line_num:    %d\n",store->par_line_num);
-		fprintf(stderr,"dbg5       par_serial_1:    %d\n",store->par_serial_1);
-		fprintf(stderr,"dbg5       par_serial_2:    %d\n",store->par_serial_2);
-		fprintf(stderr,"dbg5       par_wlz:         %f\n",store->par_wlz);
-		fprintf(stderr,"dbg5       par_smh:         %d\n",store->par_smh);
-		fprintf(stderr,"dbg5       par_hun:         %d\n",store->par_hun);
-		fprintf(stderr,"dbg5       par_hut:         %f\n",store->par_hut);
-		fprintf(stderr,"dbg5       par_txs:         %d\n",store->par_txs);
-		fprintf(stderr,"dbg5       par_t2x:         %d\n",store->par_t2x);
-		fprintf(stderr,"dbg5       par_r1s:         %d\n",store->par_r1s);
-		fprintf(stderr,"dbg5       par_r2s:         %d\n",store->par_r2s);
-		fprintf(stderr,"dbg5       par_stc:         %d\n",store->par_stc);
-		fprintf(stderr,"dbg5       par_s0z:         %f\n",store->par_s0z);
-		fprintf(stderr,"dbg5       par_s0x:         %f\n",store->par_s0x);
-		fprintf(stderr,"dbg5       par_s0y:         %f\n",store->par_s0y);
-		fprintf(stderr,"dbg5       par_s0h:         %f\n",store->par_s0h);
-		fprintf(stderr,"dbg5       par_s0r:         %f\n",store->par_s0r);
-		fprintf(stderr,"dbg5       par_s0p:         %f\n",store->par_s0p);
-		fprintf(stderr,"dbg5       par_s1z:         %f\n",store->par_s1z);
-		fprintf(stderr,"dbg5       par_s1x:         %f\n",store->par_s1x);
-		fprintf(stderr,"dbg5       par_s1y:         %f\n",store->par_s1y);
-		fprintf(stderr,"dbg5       par_s1h:         %f\n",store->par_s1h);
-		fprintf(stderr,"dbg5       par_s1r:         %f\n",store->par_s1r);
-		fprintf(stderr,"dbg5       par_s1p:         %f\n",store->par_s1p);
-		fprintf(stderr,"dbg5       par_s1n:         %d\n",store->par_s1n);
-		fprintf(stderr,"dbg5       par_s2z:         %f\n",store->par_s2z);
-		fprintf(stderr,"dbg5       par_s2x:         %f\n",store->par_s2x);
-		fprintf(stderr,"dbg5       par_s2y:         %f\n",store->par_s2y);
-		fprintf(stderr,"dbg5       par_s2h:         %f\n",store->par_s2h);
-		fprintf(stderr,"dbg5       par_s2r:         %f\n",store->par_s2r);
-		fprintf(stderr,"dbg5       par_s2p:         %f\n",store->par_s2p);
-		fprintf(stderr,"dbg5       par_s2n:         %d\n",store->par_s2n);
-		fprintf(stderr,"dbg5       par_s3z:         %f\n",store->par_s3z);
-		fprintf(stderr,"dbg5       par_s3x:         %f\n",store->par_s3x);
-		fprintf(stderr,"dbg5       par_s3y:         %f\n",store->par_s3y);
-		fprintf(stderr,"dbg5       par_s3h:         %f\n",store->par_s3h);
-		fprintf(stderr,"dbg5       par_s3r:         %f\n",store->par_s3r);
-		fprintf(stderr,"dbg5       par_s3p:         %f\n",store->par_s3p);
-		fprintf(stderr,"dbg5       par_s1s:         %d\n",store->par_s1s);
-		fprintf(stderr,"dbg5       par_s2s:         %d\n",store->par_s2s);
-		fprintf(stderr,"dbg5       par_go1:         %f\n",store->par_go1);
-		fprintf(stderr,"dbg5       par_go2:         %f\n",store->par_go2);
-		fprintf(stderr,"dbg5       par_obo:         %f\n",store->par_obo);
-		fprintf(stderr,"dbg5       par_fgd:         %f\n",store->par_fgd);
-		fprintf(stderr,"dbg5       par_tsv:         %s\n",store->par_tsv);
-		fprintf(stderr,"dbg5       par_rsv:         %s\n",store->par_rsv);
-		fprintf(stderr,"dbg5       par_bsv:         %s\n",store->par_bsv);
-		fprintf(stderr,"dbg5       par_psv:         %s\n",store->par_psv);
-		fprintf(stderr,"dbg5       par_dds:         %s\n",store->par_dds);
-		fprintf(stderr,"dbg5       par_osv:         %s\n",store->par_osv);
-		fprintf(stderr,"dbg5       par_dsv:         %s\n",store->par_dsv);
-		fprintf(stderr,"dbg5       par_dsx:         %f\n",store->par_dsx);
-		fprintf(stderr,"dbg5       par_dsy:         %f\n",store->par_dsy);
-		fprintf(stderr,"dbg5       par_dsz:         %f\n",store->par_dsz);
-		fprintf(stderr,"dbg5       par_dsd:         %d\n",store->par_dsd);
-		fprintf(stderr,"dbg5       par_dso:         %f\n",store->par_dso);
-		fprintf(stderr,"dbg5       par_dsf:         %f\n",store->par_dsf);
-		fprintf(stderr,"dbg5       par_dsh:         %c%c\n",store->par_dsh[0],store->par_dsh[1]);
-		fprintf(stderr,"dbg5       par_aps:         %d\n",store->par_aps);
-		fprintf(stderr,"dbg5       par_p1q:         %d\n",store->par_p1q);
-		fprintf(stderr,"dbg5       par_p1m:         %d\n",store->par_p1m);
-		fprintf(stderr,"dbg5       par_p1t:         %d\n",store->par_p1t);
-		fprintf(stderr,"dbg5       par_p1z:         %f\n",store->par_p1z);
-		fprintf(stderr,"dbg5       par_p1x:         %f\n",store->par_p1x);
-		fprintf(stderr,"dbg5       par_p1y:         %f\n",store->par_p1y);
-		fprintf(stderr,"dbg5       par_p1d:         %f\n",store->par_p1d);
-		fprintf(stderr,"dbg5       par_p1g:         %s\n",store->par_p1g);
-		fprintf(stderr,"dbg5       par_p2q:         %d\n",store->par_p2q);
-		fprintf(stderr,"dbg5       par_p2m:         %d\n",store->par_p2m);
-		fprintf(stderr,"dbg5       par_p2t:         %d\n",store->par_p2t);
-		fprintf(stderr,"dbg5       par_p2z:         %f\n",store->par_p2z);
-		fprintf(stderr,"dbg5       par_p2x:         %f\n",store->par_p2x);
-		fprintf(stderr,"dbg5       par_p2y:         %f\n",store->par_p2y);
-		fprintf(stderr,"dbg5       par_p2d:         %f\n",store->par_p2d);
-		fprintf(stderr,"dbg5       par_p2g:         %s\n",store->par_p2g);
-		fprintf(stderr,"dbg5       par_p3q:         %d\n",store->par_p3q);
-		fprintf(stderr,"dbg5       par_p3m:         %d\n",store->par_p3m);
-		fprintf(stderr,"dbg5       par_p3t:         %d\n",store->par_p3t);
-		fprintf(stderr,"dbg5       par_p3z:         %f\n",store->par_p3z);
-		fprintf(stderr,"dbg5       par_p3x:         %f\n",store->par_p3x);
-		fprintf(stderr,"dbg5       par_p3y:         %f\n",store->par_p3y);
-		fprintf(stderr,"dbg5       par_p3d:         %f\n",store->par_p3d);
-		fprintf(stderr,"dbg5       par_p3g:         %s\n",store->par_p3g);
-		fprintf(stderr,"dbg5       par_p3s:         %d\n",store->par_p3s);
-		fprintf(stderr,"dbg5       par_msz:         %f\n",store->par_msz);
-		fprintf(stderr,"dbg5       par_msx:         %f\n",store->par_msx);
-		fprintf(stderr,"dbg5       par_msy:         %f\n",store->par_msy);
-		fprintf(stderr,"dbg5       par_mrp:         %c%c\n",store->par_mrp[0],store->par_mrp[1]);
-		fprintf(stderr,"dbg5       par_msd:         %f\n",store->par_msd);
-		fprintf(stderr,"dbg5       par_msr:         %f\n",store->par_msr);
-		fprintf(stderr,"dbg5       par_msp:         %f\n",store->par_msp);
-		fprintf(stderr,"dbg5       par_msg:         %f\n",store->par_msg);
-		fprintf(stderr,"dbg5       par_nsz:         %f\n",store->par_nsz);
-		fprintf(stderr,"dbg5       par_nsx:         %f\n",store->par_nsx);
-		fprintf(stderr,"dbg5       par_nsy:         %f\n",store->par_nsy);
-		fprintf(stderr,"dbg5       par_nrp:         %c%c\n",store->par_nrp[0],store->par_nrp[1]);
-		fprintf(stderr,"dbg5       par_nsd:         %f\n",store->par_nsd);
-		fprintf(stderr,"dbg5       par_nsr:         %f\n",store->par_nsr);
-		fprintf(stderr,"dbg5       par_nsp:         %f\n",store->par_nsp);
-		fprintf(stderr,"dbg5       par_nsg:         %f\n",store->par_nsg);
-		fprintf(stderr,"dbg5       par_gcg:         %f\n",store->par_gcg);
-		fprintf(stderr,"dbg5       par_mas:         %f\n",store->par_mas);
-		fprintf(stderr,"dbg5       par_shc:         %d\n",store->par_shc);
-		fprintf(stderr,"dbg5       par_pps:         %d\n",store->par_pps);
-		fprintf(stderr,"dbg5       par_cls:         %d\n",store->par_cls);
-		fprintf(stderr,"dbg5       par_clo:         %d\n",store->par_clo);
-		fprintf(stderr,"dbg5       par_vsn:         %d\n",store->par_vsn);
-		fprintf(stderr,"dbg5       par_vsu:         %d\n",store->par_vsu);
-		fprintf(stderr,"dbg5       par_vse:         %d\n",store->par_vse);
-		fprintf(stderr,"dbg5       par_vtu:         %d\n",store->par_vtu);
-		fprintf(stderr,"dbg5       par_vte:         %d\n",store->par_vte);
-		fprintf(stderr,"dbg5       par_aro:         %d\n",store->par_aro);
-		fprintf(stderr,"dbg5       par_ahe:         %d\n",store->par_ahe);
-		fprintf(stderr,"dbg5       par_ahs:         %d\n",store->par_ahs);
-		fprintf(stderr,"dbg5       par_vsi:         %s\n",store->par_vsi);
-		fprintf(stderr,"dbg5       par_vsm:         %s\n",store->par_vsm);
-		fprintf(stderr,"dbg5       par_mca1:        %s\n",store->par_mca1);
-		fprintf(stderr,"dbg5       par_mcu1:        %d\n",store->par_mcu1);
-		fprintf(stderr,"dbg5       par_mci1:        %s\n",store->par_mci1);
-		fprintf(stderr,"dbg5       par_mcp1:        %d\n",store->par_mcp1);
-		fprintf(stderr,"dbg5       par_mca2:        %s\n",store->par_mca2);
-		fprintf(stderr,"dbg5       par_mcu2:        %d\n",store->par_mcu2);
-		fprintf(stderr,"dbg5       par_mci2:        %s\n",store->par_mci2);
-		fprintf(stderr,"dbg5       par_mcp2:        %d\n",store->par_mcp2);
-		fprintf(stderr,"dbg5       par_mca3:        %s\n",store->par_mca3);
-		fprintf(stderr,"dbg5       par_mcu3:        %d\n",store->par_mcu3);
-		fprintf(stderr,"dbg5       par_mci3:        %s\n",store->par_mci3);
-		fprintf(stderr,"dbg5       par_mcp3:        %d\n",store->par_mcp3);
-		fprintf(stderr,"dbg5       par_mca4:        %s\n",store->par_mca4);
-		fprintf(stderr,"dbg5       par_mcu4:        %d\n",store->par_mcu4);
-		fprintf(stderr,"dbg5       par_mci4:        %s\n",store->par_mci4);
-		fprintf(stderr,"dbg5       par_mcp4:        %d\n",store->par_mcp4);
-		fprintf(stderr,"dbg5       par_snl:         %d\n",store->par_snl);
-		fprintf(stderr,"dbg5       par_cpr:         %s\n",store->par_cpr);
-		fprintf(stderr,"dbg5       par_rop:         %s\n",store->par_rop);
-		fprintf(stderr,"dbg5       par_sid:         %s\n",store->par_sid);
-		fprintf(stderr,"dbg5       par_rfn:         %s\n",store->par_rfn);
-		fprintf(stderr,"dbg5       par_pll:         %s\n",store->par_pll);
-		fprintf(stderr,"dbg5       par_com:         %s\n",store->par_com);
-		}
-
-	/* zero checksum */
-	checksum = 0;
-
-	/* if data type not set - use start */
-	if (store->type == EM3_NONE)
-	    store->type = EM3_START;
-
-	/* if sonar not set use EM710 */
-	if (store->sonar == 0)
-	    store->sonar = MBSYS_SIMRAD3_EM710;
-
-	/* set up start of output buffer - we handle this
-	   record differently because of the ascii data */
-	memset(line, 0, MBSYS_SIMRAD3_BUFFER_SIZE);
-
-	/* put binary header data into buffer */
-	if (status == MB_SUCCESS)
-		{
-		line[4] = EM3_START_BYTE;
-		line[5] = EM3_ID_START;
-		mb_put_binary_short(swap, (unsigned short) store->sonar, (void *) &line[6]);
-		mb_put_binary_int(swap, (int) store->par_date, (void *) &line[8]);
-		mb_put_binary_int(swap, (int) store->par_msec, (void *) &line[12]);
-		mb_put_binary_short(swap, (unsigned short) store->par_line_num, (void *) &line[16]);
-		mb_put_binary_short(swap, (unsigned short) store->par_serial_1, (void *) &line[18]);
-		mb_put_binary_short(swap, (unsigned short) store->par_serial_2, (void *) &line[20]);
-		}
-		
-	/* construct ascii parameter buffer */
-	buff = &line[22];
-	buff_len = 0;
-	
-	if (store->par_wlz != 0.0)
-		{
-		sprintf(&buff[buff_len], "WLZ=%.3f,", store->par_wlz);
-		buff_len = strlen(buff);		
-		}
-	if (store->par_smh != 0)
-		{
-		sprintf(&buff[buff_len], "SMH=%d,", store->par_smh);
-		buff_len = strlen(buff);		
-		}
-	if (store->par_hut != 0.0)
-		{
-		sprintf(&buff[buff_len], "HUN=%d,", store->par_hun);
-		buff_len = strlen(buff);		
-		sprintf(&buff[buff_len], "HUT=%f,", store->par_hut);
-		buff_len = strlen(buff);		
-		}
-	if (store->par_txs != 0)
-		{
-		sprintf(&buff[buff_len], "TXS=%d,", store->par_txs);
-		buff_len = strlen(buff);		
-		}
-	if (store->par_t2x != 0)
-		{
-		sprintf(&buff[buff_len], "T2X=%d,", store->par_t2x);
-		buff_len = strlen(buff);		
-		}
-	if (store->par_r1s != 0)
-		{
-		sprintf(&buff[buff_len], "R1S=%d,", store->par_r1s);
-		buff_len = strlen(buff);		
-		}
-	if (store->par_r2s != 0)
-		{
-		sprintf(&buff[buff_len], "R2S=%d,", store->par_r2s);
-		buff_len = strlen(buff);		
-		}
-	sprintf(&buff[buff_len], "STC=%d,", store->par_stc);
-	buff_len = strlen(buff);
-	if (store->par_stc == 4)
-		{
-		sprintf(&buff[buff_len], "S0Z=%.3f,", store->par_s0z);
-		buff_len = strlen(buff);		
-		sprintf(&buff[buff_len], "S0X=%.3f,", store->par_s0x);
-		buff_len = strlen(buff);		
-		sprintf(&buff[buff_len], "S0Y=%.3f,", store->par_s0y);
-		buff_len = strlen(buff);		
-		sprintf(&buff[buff_len], "S0H=%.3f,", store->par_s0h);
-		buff_len = strlen(buff);		
-		sprintf(&buff[buff_len], "S0R=%.3f,", store->par_s0r);
-		buff_len = strlen(buff);		
-		sprintf(&buff[buff_len], "S0P=%.3f,", store->par_s0p);
-		buff_len = strlen(buff);		
-		}
-	sprintf(&buff[buff_len], "S1Z=%.3f,", store->par_s1z);
-	buff_len = strlen(buff);		
-	sprintf(&buff[buff_len], "S1X=%.3f,", store->par_s1x);
-	buff_len = strlen(buff);		
-	sprintf(&buff[buff_len], "S1Y=%.3f,", store->par_s1y);
-	buff_len = strlen(buff);		
-	sprintf(&buff[buff_len], "S1H=%.3f,", store->par_s1h);
-	buff_len = strlen(buff);		
-	sprintf(&buff[buff_len], "S1R=%.3f,", store->par_s1r);
-	buff_len = strlen(buff);		
-	sprintf(&buff[buff_len], "S1P=%.3f,", store->par_s1p);
-	buff_len = strlen(buff);		
-	sprintf(&buff[buff_len], "S1S=%d,", store->par_s1s);
-	buff_len = strlen(buff);		
-	if (store->par_stc != 1)
-		{
-		sprintf(&buff[buff_len], "S2Z=%.3f,", store->par_s2z);
-		buff_len = strlen(buff);		
-		sprintf(&buff[buff_len], "S2X=%.3f,", store->par_s2x);
-		buff_len = strlen(buff);		
-		sprintf(&buff[buff_len], "S2Y=%.3f,", store->par_s2y);
-		buff_len = strlen(buff);		
-		sprintf(&buff[buff_len], "S2H=%.3f,", store->par_s2h);
-		buff_len = strlen(buff);		
-		sprintf(&buff[buff_len], "S2R=%.3f,", store->par_s2r);
-		buff_len = strlen(buff);		
-		sprintf(&buff[buff_len], "S2P=%.3f,", store->par_s2p);
-		buff_len = strlen(buff);		
-		sprintf(&buff[buff_len], "S2S=%d,", store->par_s2s);
-		buff_len = strlen(buff);
-		}
-	if (store->par_stc >= 3)
-		{
-		sprintf(&buff[buff_len], "S3Z=%.3f,", store->par_s3z);
-		buff_len = strlen(buff);		
-		sprintf(&buff[buff_len], "S3X=%.3f,", store->par_s3x);
-		buff_len = strlen(buff);		
-		sprintf(&buff[buff_len], "S3Y=%.3f,", store->par_s3y);
-		buff_len = strlen(buff);		
-		sprintf(&buff[buff_len], "S3H=%.3f,", store->par_s3h);
-		buff_len = strlen(buff);		
-		sprintf(&buff[buff_len], "S3R=%.3f,", store->par_s3r);
-		buff_len = strlen(buff);		
-		sprintf(&buff[buff_len], "S3P=%.3f,", store->par_s3p);
-		buff_len = strlen(buff);		
-		}
-	if (store->par_go1 != 0.0)
-		{
-		sprintf(&buff[buff_len], "GO1=%.3f,", store->par_go1);
-		buff_len = strlen(buff);
-		}
-	if (store->par_go2 != 0.0)
-		{
-		sprintf(&buff[buff_len], "GO2=%.3f,", store->par_go1);
-		buff_len = strlen(buff);
-		}
-	if (store->par_obo != 0.0)
-		{
-		sprintf(&buff[buff_len], "OBO=%.3f,", store->par_obo);
-		buff_len = strlen(buff);
-		}
-	if (store->par_fgd != 0.0)
-		{
-		sprintf(&buff[buff_len], "FGD=%.3f,", store->par_fgd);
-		buff_len = strlen(buff);
-		}
-	if (strlen(store->par_tsv) > 0)
-		{
-		sprintf(&buff[buff_len], "TSV=%s,", store->par_tsv);
-		buff_len = strlen(buff);
-		}
-	if (strlen(store->par_rsv) > 0)
-		{
-		sprintf(&buff[buff_len], "RSV=%s,", store->par_rsv);
-		buff_len = strlen(buff);
-		}
-	if (strlen(store->par_bsv) > 0)
-		{
-		sprintf(&buff[buff_len], "BSV=%s,", store->par_bsv);
-		buff_len = strlen(buff);
-		}
-	if (strlen(store->par_psv) > 0)
-		{
-		sprintf(&buff[buff_len], "PSV=%s,", store->par_psv);
-		buff_len = strlen(buff);
-		}
-	if (strlen(store->par_dds) > 0)
-		{
-		sprintf(&buff[buff_len], "DDS=%s,", store->par_dds);
-		buff_len = strlen(buff);
-		}
-	if (strlen(store->par_osv) > 0)
-		{
-		sprintf(&buff[buff_len], "OSV=%s,", store->par_osv);
-		buff_len = strlen(buff);
-		}
-	if (strlen(store->par_dsv) > 0)
-		{
-		sprintf(&buff[buff_len], "DSV=%s,", store->par_dsv);
-		buff_len = strlen(buff);
-		}
-
-	sprintf(&buff[buff_len], "DSX=%.6f,", store->par_dsx);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "DSY=%.6f,", store->par_dsy);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "DSZ=%.6f,", store->par_dsz);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "DSD=%d,", store->par_dsd);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "DSO=%.6f,", store->par_dso);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "DSF=%.6f,", store->par_dsf);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "DSH=%c%c,",store->par_dsh[0], store->par_dsh[1]);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "APS=%d,",store->par_aps);
-	buff_len = strlen(buff);
-	
-	if (store->par_p1q)
-		{
-		sprintf(&buff[buff_len], "P1Q=%d,",store->par_p1q);
-		buff_len = strlen(buff);
-		sprintf(&buff[buff_len], "P1M=%d,",store->par_p1m);
-		buff_len = strlen(buff);
-		sprintf(&buff[buff_len], "P1T=%d,",store->par_p1t);
-		buff_len = strlen(buff);
-		sprintf(&buff[buff_len], "P1Z=%.3f,", store->par_p1z);
-		buff_len = strlen(buff);
-		sprintf(&buff[buff_len], "P1X=%.3f,", store->par_p1x);
-		buff_len = strlen(buff);
-		sprintf(&buff[buff_len], "P1Y=%.3f,", store->par_p1y);
-		buff_len = strlen(buff);
-		sprintf(&buff[buff_len], "P1D=%.1f,", store->par_p1d);
-		buff_len = strlen(buff);
-		sprintf(&buff[buff_len], "P1G=%s,", store->par_p1g);
-		buff_len = strlen(buff);
-		}
-	if (store->par_p2q)
-		{
-		sprintf(&buff[buff_len], "P2Q=%d,",store->par_p2q);
-		buff_len = strlen(buff);
-		sprintf(&buff[buff_len], "P2M=%d,",store->par_p2m);
-		buff_len = strlen(buff);
-		sprintf(&buff[buff_len], "P2T=%d,",store->par_p2t);
-		buff_len = strlen(buff);
-		sprintf(&buff[buff_len], "P2Z=%.3f,", store->par_p2z);
-		buff_len = strlen(buff);
-		sprintf(&buff[buff_len], "P2X=%.3f,", store->par_p2x);
-		buff_len = strlen(buff);
-		sprintf(&buff[buff_len], "P2Y=%.3f,", store->par_p2y);
-		buff_len = strlen(buff);
-		sprintf(&buff[buff_len], "P2D=%.3f,", store->par_p2d);
-		buff_len = strlen(buff);
-		sprintf(&buff[buff_len], "P2G=%s,", store->par_p2g);
-		buff_len = strlen(buff);
-		}
-	if (store->par_p3q)
-		{
-		sprintf(&buff[buff_len], "P3Q=%d,",store->par_p3q);
-		buff_len = strlen(buff);
-		sprintf(&buff[buff_len], "P3M=%d,",store->par_p3m);
-		buff_len = strlen(buff);
-		sprintf(&buff[buff_len], "P3T=%d,",store->par_p3t);
-		buff_len = strlen(buff);
-		sprintf(&buff[buff_len], "P3Z=%.3f,", store->par_p3z);
-		buff_len = strlen(buff);
-		sprintf(&buff[buff_len], "P3X=%.3f,", store->par_p3x);
-		buff_len = strlen(buff);
-		sprintf(&buff[buff_len], "P3Y=%.3f,", store->par_p3y);
-		buff_len = strlen(buff);
-		sprintf(&buff[buff_len], "P3D=%.3f,", store->par_p3d);
-		buff_len = strlen(buff);
-		sprintf(&buff[buff_len], "P3G=%s,", store->par_p3g);
-		buff_len = strlen(buff);
-		sprintf(&buff[buff_len], "P3S=%d,",store->par_p3s);
-		buff_len = strlen(buff);
-		}
-	
-	sprintf(&buff[buff_len], "MSZ=%.3f,", store->par_msz);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "MSX=%.3f,", store->par_msx);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "MSY=%.3f,", store->par_msy);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "MRP=%c%c,",
-		store->par_mrp[0], store->par_mrp[1]);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "MSD=%.3f,", store->par_msd);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "MSR=%.3f,", store->par_msr);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "MSP=%.3f,", store->par_msp);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "MSG=%.3f,", store->par_msg);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "NSZ=%.3f,", store->par_nsz);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "NSX=%.3f,", store->par_nsx);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "NSY=%.3f,", store->par_nsy);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "NRP=%c%c,",
-		store->par_nrp[0], store->par_nrp[1]);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "NSD=%.3f,", store->par_nsd);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "NSR=%.3f,", store->par_nsr);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "NSP=%.3f,", store->par_nsp);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "NSG=%.3f,", store->par_nsg);
-	buff_len = strlen(buff);
-	
-	sprintf(&buff[buff_len], "GCG=%.3f,", store->par_gcg);
-	buff_len = strlen(buff);
-	if (store->par_mas != 0.0)
-	    {
-	    sprintf(&buff[buff_len], "MAS=%.3f,", store->par_mas);
-	    buff_len = strlen(buff);
-	    }
-	sprintf(&buff[buff_len], "SHC=%d,", store->par_shc);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "PPS=%d,", store->par_pps);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "CLS=%d,", store->par_cls);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "CLO=%d,", store->par_clo);
-	buff_len = strlen(buff);
-	
-	sprintf(&buff[buff_len], "VSN=%d,", store->par_vsn);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "VSU=%d,", store->par_vsu);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "VSE=%d,", store->par_vse);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "VTU=%d,", store->par_vtu);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "VTE=%d,", store->par_vte);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "ARO=%d,", store->par_aro);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "AHE=%d,", store->par_ahe);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "AHS=%d,", store->par_ahs);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "VSI=%s,", store->par_vsi);
-	buff_len = strlen(buff);
-	sprintf(&buff[buff_len], "VSM=%s,", store->par_vsm);
-	buff_len = strlen(buff);
-	
-	if (store->par_mcp1 > 0)
-		{
-		sprintf(&buff[buff_len], "MCA1=%s,", store->par_mca1);
-		buff_len = strlen(buff);
-		sprintf(&buff[buff_len], "MCU1=%d,", store->par_mcu1);
-		buff_len = strlen(buff);
-		sprintf(&buff[buff_len], "MCI1=%s,", store->par_mci1);
-		buff_len = strlen(buff);
-		sprintf(&buff[buff_len], "MCP1=%d,", store->par_mcp1);
-		buff_len = strlen(buff);
-		}
-	if (store->par_mcp2 > 0)
-		{
-		sprintf(&buff[buff_len], "MCA2=%s,", store->par_mca2);
-		buff_len = strlen(buff);
-		sprintf(&buff[buff_len], "MCU2=%d,", store->par_mcu2);
-		buff_len = strlen(buff);
-		sprintf(&buff[buff_len], "MCI2=%s,", store->par_mci2);
-		buff_len = strlen(buff);
-		sprintf(&buff[buff_len], "MCP2=%d,", store->par_mcp2);
-		buff_len = strlen(buff);
-		}
-	if (store->par_mcp3 > 0)
-		{
-		sprintf(&buff[buff_len], "MCA3=%s,", store->par_mca3);
-		buff_len = strlen(buff);
-		sprintf(&buff[buff_len], "MCU3=%d,", store->par_mcu3);
-		buff_len = strlen(buff);
-		sprintf(&buff[buff_len], "MCI3=%s,", store->par_mci3);
-		buff_len = strlen(buff);
-		sprintf(&buff[buff_len], "MCP3=%d,", store->par_mcp3);
-		buff_len = strlen(buff);
-		}
-	if (store->par_mcp4 > 0)
-		{
-		sprintf(&buff[buff_len], "MCA4=%s,", store->par_mca4);
-		buff_len = strlen(buff);
-		sprintf(&buff[buff_len], "MCU4=%d,", store->par_mcu4);
-		buff_len = strlen(buff);
-		sprintf(&buff[buff_len], "MCI4=%s,", store->par_mci4);
-		buff_len = strlen(buff);
-		sprintf(&buff[buff_len], "MCP4=%d,", store->par_mcp4);
-		buff_len = strlen(buff);
-		}
-	sprintf(&buff[buff_len], "SNL=%d,", store->par_snl);
-	buff_len = strlen(buff);
-	
-	if (strlen(store->par_cpr) > 0)
-	    {
-	    sprintf(&buff[buff_len], "CPR=%s,", store->par_cpr);
-	    buff_len = strlen(buff);
-	    }
-	if (strlen(store->par_rop) > 0)
-	    {
-	    sprintf(&buff[buff_len], "ROP=%s,", store->par_rop);
-	    buff_len = strlen(buff);
-	    }
-	if (strlen(store->par_sid) > 0)
-	    {
-	    sprintf(&buff[buff_len], "SID=%s,", store->par_sid);
-	    buff_len = strlen(buff);
-	    }
-	if (strlen(store->par_rfn) > 0)
-	    {
-	    sprintf(&buff[buff_len], "RFN=%s,", store->par_rfn);
-	    buff_len = strlen(buff);
-	    }
-	if (strlen(store->par_pll) > 0)
-	    {
-	    sprintf(&buff[buff_len], "PLL=%s,", store->par_pll);
-	    buff_len = strlen(buff);
-	    }
-	if (strlen(store->par_com) > 0)
-	    {
-	    /* replace commas (,) with caret (^) values to circumvent
-	       the format's inability to store commas in comments */
-	    while ((comma_ptr = strchr(store->par_com, ',')) != NULL)
-		{
-		comma_ptr[0] = '^';
-		}
-	    sprintf(&buff[buff_len], "COM=%s,", store->par_com);
-	    buff_len = strlen(buff);
-	    }
-	buff[buff_len] = ',';
-	buff_len++;
-	if (buff_len % 2 == 0)
-	    buff_len++;
-
-	/* put end of record in buffer */
-	line[buff_len + 22] = EM3_END;
-
-	/* get size of record */
-	write_size = 25 + buff_len;
-	mb_put_binary_int(swap, (int) (write_size - 4), (void *) &line[0]);
-
-	/* compute checksum */
-	uchar_ptr = (mb_u_char *) line;
-	for (j=5;j<write_size-3;j++)
-	    checksum += uchar_ptr[j];
-
-	/* set checksum */
-	mb_put_binary_short(swap, (unsigned short) checksum, (void *) &line[buff_len + 23]);
-
-	/* finally write out the data */
-	write_len = write_size;
-	status = mb_fileio_put(verbose, mbio_ptr, line, &write_len, error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em710raw_wr_status(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store, int *error)
-{
-	char	*function_name = "mbr_em710raw_wr_status";
-	int	status = MB_SUCCESS;
-	char	line[EM3_PU_STATUS_SIZE];
-	short	label;
-	char	*labelchar;
-	size_t	write_len;
-	int	write_size;
-	unsigned short checksum;
-	mb_u_char   *uchar_ptr;
-	int	j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:                %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:               %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:                %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:                %d\n",store->msec);
-		fprintf(stderr,"dbg5       run_date:            %d\n",store->sts_date);
-		fprintf(stderr,"dbg5       run_msec:            %d\n",store->sts_msec);
-		fprintf(stderr,"dbg5       sts_status_count:    %d\n",store->sts_status_count);
-		fprintf(stderr,"dbg5       run_serial:          %d\n",store->sts_serial);
-		fprintf(stderr,"dbg5       sts_pingrate:        %d\n",store->sts_pingrate);
-		fprintf(stderr,"dbg5       sts_ping_count:      %d\n",store->sts_ping_count);
-		fprintf(stderr,"dbg5       sts_load:            %d\n",store->sts_load);
-		fprintf(stderr,"dbg5       sts_udp_status:      %d\n",store->sts_udp_status);
-		fprintf(stderr,"dbg5       sts_serial1_status:  %d\n",store->sts_serial1_status);
-		fprintf(stderr,"dbg5       sts_serial2_status:  %d\n",store->sts_serial2_status);
-		fprintf(stderr,"dbg5       sts_serial3_status:  %d\n",store->sts_serial3_status);
-		fprintf(stderr,"dbg5       sts_serial4_status:  %d\n",store->sts_serial4_status);
-		fprintf(stderr,"dbg5       sts_pps_status:      %d\n",store->sts_pps_status);
-		fprintf(stderr,"dbg5       sts_position_status: %d\n",store->sts_position_status);
-		fprintf(stderr,"dbg5       sts_attitude_status: %d\n",store->sts_attitude_status);
-		fprintf(stderr,"dbg5       sts_clock_status:    %d\n",store->sts_clock_status);
-		fprintf(stderr,"dbg5       sts_heading_status:  %d\n",store->sts_heading_status);
-		fprintf(stderr,"dbg5       sts_pu_status:       %d\n",store->sts_pu_status);
-		fprintf(stderr,"dbg5       sts_last_heading:    %d\n",store->sts_last_heading);
-		fprintf(stderr,"dbg5       sts_last_roll:       %d\n",store->sts_last_roll);
-		fprintf(stderr,"dbg5       sts_last_pitch:      %d\n",store->sts_last_pitch);
-		fprintf(stderr,"dbg5       sts_last_heave:      %d\n",store->sts_last_heave);
-		fprintf(stderr,"dbg5       sts_last_ssv:        %d\n",store->sts_last_ssv);
-		fprintf(stderr,"dbg5       sts_last_heave:      %d\n",store->sts_last_heave);
-		fprintf(stderr,"dbg5       sts_last_depth:      %d\n",store->sts_last_depth);
-		fprintf(stderr,"dbg5       sts_spare:           %d\n",store->sts_spare);
-		fprintf(stderr,"dbg5       sts_bso:             %d\n",store->sts_bso);
-		fprintf(stderr,"dbg5       sts_bsn:             %d\n",store->sts_bsn);
-		fprintf(stderr,"dbg5       sts_gain:            %d\n",store->sts_gain);
-		fprintf(stderr,"dbg5       sts_dno:             %d\n",store->sts_dno);
-		fprintf(stderr,"dbg5       sts_rno:             %d\n",store->sts_rno);
-		fprintf(stderr,"dbg5       sts_port:            %d\n",store->sts_port);
-		fprintf(stderr,"dbg5       sts_stbd:            %d\n",store->sts_stbd);
-		fprintf(stderr,"dbg5       sts_ssp:             %d\n",store->sts_ssp);
-		fprintf(stderr,"dbg5       sts_yaw:             %d\n",store->sts_yaw);
-		fprintf(stderr,"dbg5       sts_port2:           %d\n",store->sts_port2);
-		fprintf(stderr,"dbg5       sts_stbd2:           %d\n",store->sts_stbd2);
-		fprintf(stderr,"dbg5       sts_spare2:          %d\n",store->sts_spare2);
-		}
-
-	/* zero checksum */
-	checksum = 0;
-
-	/* write the record size */
-	mb_put_binary_int(swap, (int) (EM3_PU_STATUS_SIZE), (void *) &write_size);
-	write_len = 4;
-	mb_fileio_put(verbose, mbio_ptr, (char *)&write_size, &write_len, error);
-
-	/* write the record label */
-	if (status == MB_SUCCESS)
-		{
-		labelchar = (char *) &label;
-		labelchar[0] = EM3_START_BYTE;
-		labelchar[1] = EM3_ID_PU_STATUS;
-		write_len = 2;
-		status = mb_fileio_put(verbose, mbio_ptr, (char *)&label, &write_len, error);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[1];
-		}
-
-	/* write the sonar id */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_short(swap, (short) (store->sonar), (void *) &label);
-		write_len = 2;
-		status = mb_fileio_put(verbose, mbio_ptr, (char *)&label, &write_len, error);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[0];
-		checksum += uchar_ptr[1];
-		}
-
-	/* construct binary data */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_int(swap, (int) store->sts_date, (void *) &line[0]);
-		mb_put_binary_int(swap, (int) store->sts_msec, (void *) &line[4]);
-		mb_put_binary_short(swap, (unsigned short) store->sts_status_count, (void *) &line[8]);
-		mb_put_binary_short(swap, (unsigned short) store->run_serial, (void *) &line[10]);
-		mb_put_binary_short(swap, (unsigned short) store->sts_pingrate, (void *) &line[12]);
-		mb_put_binary_short(swap, (unsigned short) store->sts_ping_count, (void *) &line[14]);
-		mb_put_binary_int(swap, (int) store->sts_load, (void *) &line[16]);
-		mb_put_binary_int(swap, (int) store->sts_udp_status, (void *) &line[20]);
-		mb_put_binary_int(swap, (int) store->sts_serial1_status, (void *) &line[24]);
-		mb_put_binary_int(swap, (int) store->sts_serial2_status, (void *) &line[28]);
-		mb_put_binary_int(swap, (int) store->sts_serial3_status, (void *) &line[32]);
-		mb_put_binary_int(swap, (int) store->sts_serial3_status, (void *) &line[36]);
-		line[40] = store->sts_pps_status;
-		line[41] = store->sts_position_status;
-		line[42] = store->sts_attitude_status;
-		line[43] = store->sts_clock_status;
-		line[44] = store->sts_heading_status;
-		line[45] = store->sts_pu_status;
-		mb_put_binary_short(swap, (unsigned short) store->sts_last_heading, (void *) &line[46]);
-		mb_put_binary_short(swap, (short) store->sts_last_roll, (void *) &line[48]);
-		mb_put_binary_short(swap, (short) store->sts_last_pitch, (void *) &line[50]);
-		mb_put_binary_short(swap, (short) store->sts_last_heave, (void *) &line[52]);
-		mb_put_binary_short(swap, (unsigned short) store->sts_last_ssv, (void *) &line[54]);
-		mb_put_binary_int(swap, (int) store->sts_last_depth, (void *) &line[56]);
-		mb_put_binary_int(swap, (int) store->sts_spare, (void *) &line[60]);
-		line[64] = store->sts_bso;
-		line[65] = store->sts_bsn;
-		line[66] = store->sts_gain;
-		line[67] = store->sts_dno;
-		mb_put_binary_short(swap, (unsigned short) store->sts_rno, (void *) &line[68]);
-		line[70] = store->sts_port;
-		line[71] = store->sts_stbd;
-		mb_put_binary_short(swap, (unsigned short) store->sts_ssp, (void *) &line[72]);
-		mb_put_binary_short(swap, (unsigned short) store->sts_yaw, (void *) &line[74]);
-		mb_put_binary_short(swap, (unsigned short) store->sts_port2, (void *) &line[76]);
-		mb_put_binary_short(swap, (unsigned short) store->sts_stbd2, (void *) &line[78]);
-		line[80] = store->sts_spare2;
-		line[EM3_PU_STATUS_SIZE-7] = 0x03;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM3_PU_STATUS_SIZE-7;j++)
-		    checksum += uchar_ptr[j];
-
-		/* set checksum */
-		mb_put_binary_short(swap, (unsigned short) checksum, (void *) &line[EM3_PU_STATUS_SIZE-6]);
-
-		/* write out data */
-		write_len = EM3_PU_STATUS_SIZE-4;
-		status = mb_fileio_put(verbose, mbio_ptr, line, &write_len, error);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em710raw_wr_run_parameter(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store, int *error)
-{
-	char	*function_name = "mbr_em710raw_wr_run_parameter";
-	int	status = MB_SUCCESS;
-	char	line[EM3_RUN_PARAMETER_SIZE];
-	short	label;
-	char	*labelchar;
-	size_t	write_len;
-	int	write_size;
-	unsigned short checksum;
-	mb_u_char   *uchar_ptr;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       run_date:        %d\n",store->run_date);
-		fprintf(stderr,"dbg5       run_msec:        %d\n",store->run_msec);
-		fprintf(stderr,"dbg5       run_ping_count:  %d\n",store->run_ping_count);
-		fprintf(stderr,"dbg5       run_serial:      %d\n",store->run_serial);
-		fprintf(stderr,"dbg5       run_status:      %d\n",store->run_status);
-		fprintf(stderr,"dbg5       run_mode:        %d\n",store->run_mode);
-		fprintf(stderr,"dbg5       run_filter_id:   %d\n",store->run_filter_id);
-		fprintf(stderr,"dbg5       run_min_depth:   %d\n",store->run_min_depth);
-		fprintf(stderr,"dbg5       run_max_depth:   %d\n",store->run_max_depth);
-		fprintf(stderr,"dbg5       run_absorption:  %d\n",store->run_absorption);
-		fprintf(stderr,"dbg5       run_tran_pulse:  %d\n",store->run_tran_pulse);
-		fprintf(stderr,"dbg5       run_tran_beam:   %d\n",store->run_tran_beam);
-		fprintf(stderr,"dbg5       run_tran_pow:    %d\n",store->run_tran_pow);
-		fprintf(stderr,"dbg5       run_rec_beam:    %d\n",store->run_rec_beam);
-		fprintf(stderr,"dbg5       run_rec_band:    %d\n",store->run_rec_band);
-		fprintf(stderr,"dbg5       run_rec_gain:    %d\n",store->run_rec_gain);
-		fprintf(stderr,"dbg5       run_tvg_cross:   %d\n",store->run_tvg_cross);
-		fprintf(stderr,"dbg5       run_ssv_source:  %d\n",store->run_ssv_source);
-		fprintf(stderr,"dbg5       run_max_swath:   %d\n",store->run_max_swath);
-		fprintf(stderr,"dbg5       run_beam_space:  %d\n",store->run_beam_space);
-		fprintf(stderr,"dbg5       run_swath_angle: %d\n",store->run_swath_angle);
-		fprintf(stderr,"dbg5       run_stab_mode:   %d\n",store->run_stab_mode);
-		for (i=0;i<6;i++)
-			fprintf(stderr,"dbg5       run_spare[%d]:    %d\n",i,store->run_spare[i]);
-		}
-
-	/* zero checksum */
-	checksum = 0;
-
-	/* write the record size */
-	mb_put_binary_int(swap, (int) (EM3_RUN_PARAMETER_SIZE), (void *) &write_size);
-	write_len = 4;mb_fileio_put(verbose, mbio_ptr, (char *)&write_size, &write_len, error);
-	if (write_len != 4)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	else
-		status = MB_SUCCESS;
-
-	/* write the record label */
-	if (status == MB_SUCCESS)
-		{
-		labelchar = (char *) &label;
-		labelchar[0] = EM3_START_BYTE;
-		labelchar[1] = EM3_ID_RUN_PARAMETER;
-		write_len = 2;
-		status = mb_fileio_put(verbose, mbio_ptr, (char *)&label, &write_len, error);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[1];
-		}
-
-	/* write the sonar id */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_short(swap, (short) (store->sonar), (void *) &label);
-		write_len = 2;
-		status = mb_fileio_put(verbose, mbio_ptr, (char *)&label, &write_len, error);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[0];
-		checksum += uchar_ptr[1];
-		}
-
-	/* construct binary data */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_int(swap, (int) store->run_date, (void *) &line[0]);
-		mb_put_binary_int(swap, (int) store->run_msec, (void *) &line[4]);
-		mb_put_binary_short(swap, (unsigned short) store->run_ping_count, (void *) &line[8]);
-		mb_put_binary_short(swap, (unsigned short) store->run_serial, (void *) &line[10]);
-		mb_put_binary_int(swap, (int) store->run_status, (void *) &line[12]);
-		line[16] = store->run_mode;
-		line[17] = store->run_filter_id;
-		mb_put_binary_short(swap, (unsigned short) store->run_min_depth, (void *) &line[18]);
-		mb_put_binary_short(swap, (unsigned short) store->run_max_depth, (void *) &line[20]);
-		mb_put_binary_short(swap, (unsigned short) store->run_absorption, (void *) &line[22]);
-		mb_put_binary_short(swap, (unsigned short) store->run_tran_pulse, (void *) &line[24]);
-		mb_put_binary_short(swap, (unsigned short) store->run_tran_beam, (void *) &line[26]);
-		line[28] = store->run_tran_pow;
-		line[29] = store->run_rec_beam;
-		line[30] = store->run_rec_band;
-		line[31] = store->run_rec_gain;
-		line[32] = store->run_tvg_cross;
-		line[33] = store->run_ssv_source;
-		mb_put_binary_short(swap, (unsigned short) store->run_max_swath, (void *) &line[34]);
-		line[36] = store->run_beam_space;
-		line[37] = store->run_swath_angle;
-		line[38] = store->run_stab_mode;
-		for (i=0;i<6;i++)
-		    line[39+i] = store->run_spare[i];
-		line[EM3_RUN_PARAMETER_SIZE-7] = 0x03;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM3_RUN_PARAMETER_SIZE-7;j++)
-		    checksum += uchar_ptr[j];
-
-		/* set checksum */
-		mb_put_binary_short(swap, (unsigned short) checksum, (void *) &line[EM3_RUN_PARAMETER_SIZE-6]);
-
-		/* write out data */
-		write_len = EM3_RUN_PARAMETER_SIZE-4;
-		status = mb_fileio_put(verbose, mbio_ptr, line, &write_len, error);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em710raw_wr_clock(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store, int *error)
-{
-	char	*function_name = "mbr_em710raw_wr_clock";
-	int	status = MB_SUCCESS;
-	char	line[EM3_CLOCK_SIZE];
-	short	label;
-	char	*labelchar;
-	size_t	write_len;
-	int	write_size;
-	unsigned short checksum;
-	mb_u_char   *uchar_ptr;
-	int	j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       clk_date:        %d\n",store->clk_date);
-		fprintf(stderr,"dbg5       clk_msec:        %d\n",store->clk_msec);
-		fprintf(stderr,"dbg5       clk_count:       %d\n",store->clk_count);
-		fprintf(stderr,"dbg5       clk_serial:      %d\n",store->clk_serial);
-		fprintf(stderr,"dbg5       clk_origin_date: %d\n",store->clk_origin_date);
-		fprintf(stderr,"dbg5       clk_origin_msec: %d\n",store->clk_origin_msec);
-		fprintf(stderr,"dbg5       clk_1_pps_use:   %d\n",store->clk_1_pps_use);
-		}
-
-	/* zero checksum */
-	checksum = 0;
-
-	/* write the record size */
-	mb_put_binary_int(swap, (int) (EM3_CLOCK_SIZE), (void *) &write_size);
-	write_len = 4;
-	mb_fileio_put(verbose, mbio_ptr, (char *)&write_size, &write_len, error);
-	if (write_len != 4)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	else
-		status = MB_SUCCESS;
-
-	/* write the record label */
-	if (status == MB_SUCCESS)
-		{
-		labelchar = (char *) &label;
-		labelchar[0] = EM3_START_BYTE;
-		labelchar[1] = EM3_ID_CLOCK;
-		write_len = 2;
-		status = mb_fileio_put(verbose, mbio_ptr, (char *)&label, &write_len, error);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[1];
-		}
-
-	/* write the sonar id */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_short(swap, (short) (store->sonar), (void *) &label);
-		write_len = 2;
-		status = mb_fileio_put(verbose, mbio_ptr, (char *)&label, &write_len, error);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[0];
-		checksum += uchar_ptr[1];
-		}
-
-	/* construct binary data */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_int(swap, (int) store->clk_date, (void *) &line[0]);
-		mb_put_binary_int(swap, (int) store->clk_msec, (void *) &line[4]);
-		mb_put_binary_short(swap, (unsigned short) store->clk_count, (void *) &line[8]);
-		mb_put_binary_short(swap, (unsigned short) store->clk_serial, (void *) &line[10]);
-		mb_put_binary_int(swap, (int) store->clk_origin_date, (void *) &line[12]);
-		mb_put_binary_int(swap, (int) store->clk_origin_msec, (void *) &line[16]);
-		line[20] = store->clk_1_pps_use;
-		line[EM3_CLOCK_SIZE-7] = 0x03;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM3_CLOCK_SIZE-7;j++)
-		    checksum += uchar_ptr[j];
-
-		/* set checksum */
-		mb_put_binary_short(swap, (unsigned short) checksum, (void *) &line[EM3_CLOCK_SIZE-6]);
-
-		/* write out data */
-		write_len = EM3_CLOCK_SIZE-4;
-		status = mb_fileio_put(verbose, mbio_ptr, line, &write_len, error);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em710raw_wr_tide(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store, int *error)
-{
-	char	*function_name = "mbr_em710raw_wr_tide";
-	int	status = MB_SUCCESS;
-	char	line[EM3_TIDE_SIZE];
-	short	label;
-	char	*labelchar;
-	size_t	write_len;
-	int	write_size;
-	unsigned short checksum;
-	mb_u_char   *uchar_ptr;
-	int	j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       tid_date:        %d\n",store->tid_date);
-		fprintf(stderr,"dbg5       tid_msec:        %d\n",store->tid_msec);
-		fprintf(stderr,"dbg5       tid_count:       %d\n",store->tid_count);
-		fprintf(stderr,"dbg5       tid_serial:      %d\n",store->tid_serial);
-		fprintf(stderr,"dbg5       tid_origin_date: %d\n",store->tid_origin_date);
-		fprintf(stderr,"dbg5       tid_origin_msec: %d\n",store->tid_origin_msec);
-		fprintf(stderr,"dbg5       tid_tide:        %d\n",store->tid_tide);
-		}
-
-	/* zero checksum */
-	checksum = 0;
-
-	/* write the record size */
-	mb_put_binary_int(swap, (int) (EM3_TIDE_SIZE), (void *) &write_size);
-	write_len = 4;
-	status = mb_fileio_put(verbose, mbio_ptr, (char *)&write_size, &write_len, error);
-
-	/* write the record label */
-	if (status == MB_SUCCESS)
-		{
-		labelchar = (char *) &label;
-		labelchar[0] = EM3_START_BYTE;
-		labelchar[1] = EM3_ID_TIDE;
-		write_len = 2;
-		status = mb_fileio_put(verbose, mbio_ptr, (char *)&label, &write_len, error);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[1];
-		}
-
-	/* write the sonar id */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_short(swap, (short) (store->sonar), (void *) &label);
-		write_len = 2;
-		status = mb_fileio_put(verbose, mbio_ptr, (char *)&label, &write_len, error);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[0];
-		checksum += uchar_ptr[1];
-		}
-
-	/* construct binary data */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_int(swap, (int) store->tid_date, (void *) &line[0]);
-		mb_put_binary_int(swap, (int) store->tid_msec, (void *) &line[4]);
-		mb_put_binary_short(swap, (unsigned short) store->tid_count, (void *) &line[8]);
-		mb_put_binary_short(swap, (unsigned short) store->tid_serial, (void *) &line[10]);
-		mb_put_binary_int(swap, (int) store->tid_origin_date, (void *) &line[12]);
-		mb_put_binary_int(swap, (int) store->tid_origin_msec, (void *) &line[16]);
-		mb_put_binary_short(swap, (short) store->tid_tide, (void *) &line[20]);
-		line[EM3_TIDE_SIZE-8] = '\0';
-		line[EM3_TIDE_SIZE-7] = 0x03;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM3_TIDE_SIZE-7;j++)
-		    checksum += uchar_ptr[j];
-
-		/* set checksum */
-		mb_put_binary_short(swap, (unsigned short) checksum, (void *) &line[EM3_TIDE_SIZE-6]);
-
-		/* write out data */
-		write_len = EM3_TIDE_SIZE-4;
-		status = mb_fileio_put(verbose, mbio_ptr, line, &write_len, error);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em710raw_wr_height(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store, int *error)
-{
-	char	*function_name = "mbr_em710raw_wr_height";
-	int	status = MB_SUCCESS;
-	char	line[EM3_HEIGHT_SIZE];
-	short	label;
-	char	*labelchar;
-	size_t	write_len;
-	int	write_size;
-	unsigned short checksum;
-	mb_u_char   *uchar_ptr;
-	int	j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       hgt_date:        %d\n",store->hgt_date);
-		fprintf(stderr,"dbg5       hgt_msec:        %d\n",store->hgt_msec);
-		fprintf(stderr,"dbg5       hgt_count:       %d\n",store->hgt_count);
-		fprintf(stderr,"dbg5       hgt_serial:      %d\n",store->hgt_serial);
-		fprintf(stderr,"dbg5       hgt_height:      %d\n",store->hgt_height);
-		fprintf(stderr,"dbg5       hgt_type:        %d\n",store->hgt_type);
-		}
-
-	/* zero checksum */
-	checksum = 0;
-
-	/* write the record size */
-	mb_put_binary_int(swap, (int) (EM3_HEIGHT_SIZE), (void *) &write_size);
-	write_len = 4;
-	mb_fileio_put(verbose, mbio_ptr, (char *)&write_size, &write_len, error);
-	if (write_len != 4)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	else
-		status = MB_SUCCESS;
-
-	/* write the record label */
-	if (status == MB_SUCCESS)
-		{
-		labelchar = (char *) &label;
-		labelchar[0] = EM3_START_BYTE;
-		labelchar[1] = EM3_ID_HEIGHT;
-		write_len = 2;
-		status = mb_fileio_put(verbose, mbio_ptr, (char *)&label, &write_len, error);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[1];
-		}
-
-	/* write the sonar id */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_short(swap, (short) (store->sonar), (void *) &label);
-		write_len = 2;
-		status = mb_fileio_put(verbose, mbio_ptr, (char *)&label, &write_len, error);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[0];
-		checksum += uchar_ptr[1];
-		}
-
-	/* construct binary data */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_int(swap, (int) store->hgt_date, (void *) &line[0]);
-		mb_put_binary_int(swap, (int) store->hgt_msec, (void *) &line[4]);
-		mb_put_binary_short(swap, (unsigned short) store->hgt_count, (void *) &line[8]);
-		mb_put_binary_short(swap, (unsigned short) store->hgt_serial, (void *) &line[10]);
-		mb_put_binary_int(swap, (int) store->hgt_height, (void *) &line[12]);
-		line[16] = (mb_u_char) store->hgt_type;
-		line[EM3_HEIGHT_SIZE-7] = 0x03;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM3_HEIGHT_SIZE-7;j++)
-		    checksum += uchar_ptr[j];
-
-		/* set checksum */
-		mb_put_binary_short(swap, (unsigned short) checksum, (void *) &line[EM3_HEIGHT_SIZE-6]);
-
-		/* write out data */
-		write_len = EM3_HEIGHT_SIZE-4;
-		status = mb_fileio_put(verbose, mbio_ptr, line, &write_len, error);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em710raw_wr_heading(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store, int *error)
-{
-	char	*function_name = "mbr_em710raw_wr_heading";
-	int	status = MB_SUCCESS;
-	struct mbsys_simrad3_heading_struct *heading;
-	char	line[EM3_HEADING_HEADER_SIZE];
-	short	label;
-	char	*labelchar;
-	size_t	write_len;
-	int	write_size;
-	unsigned short checksum;
-	mb_u_char   *uchar_ptr;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		}
-
-	/* get storage structure */
-	heading = (struct mbsys_simrad3_heading_struct *) store->heading;
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       hed_date:        %d\n",heading->hed_date);
-		fprintf(stderr,"dbg5       hed_msec:        %d\n",heading->hed_msec);
-		fprintf(stderr,"dbg5       hed_count:       %d\n",heading->hed_count);
-		fprintf(stderr,"dbg5       hed_serial:      %d\n",heading->hed_serial);
-		fprintf(stderr,"dbg5       hed_ndata:       %d\n",heading->hed_ndata);
-		fprintf(stderr,"dbg5       count    time (msec)    heading (0.01 deg)\n");
-		fprintf(stderr,"dbg5       -----    -----------    ------------------\n");
-		for (i=0;i<heading->hed_ndata;i++)
-			fprintf(stderr,"dbg5        %4d      %7d          %7d\n",
-				i, heading->hed_time[i], heading->hed_heading[i]);
-		fprintf(stderr,"dbg5       hed_heading_status: %d\n",heading->hed_heading_status);
-		}
-
-	/* zero checksum */
-	checksum = 0;
-
-	/* write the record size */
-	mb_put_binary_int(swap, (int) (EM3_HEADING_HEADER_SIZE
-			+ EM3_HEADING_SLICE_SIZE * heading->hed_ndata + 8), (void *) &write_size);
-	write_len = 4;
-	mb_fileio_put(verbose, mbio_ptr, (char *)&write_size, &write_len, error);
-	if (write_len != 4)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	else
-		status = MB_SUCCESS;
-
-	/* write the record label */
-	if (status == MB_SUCCESS)
-		{
-		labelchar = (char *) &label;
-		labelchar[0] = EM3_START_BYTE;
-		labelchar[1] = EM3_ID_HEADING;
-		write_len = 2;
-		status = mb_fileio_put(verbose, mbio_ptr, (char *)&label, &write_len, error);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[1];
-		}
-
-	/* write the sonar id */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_short(swap, (short) (store->sonar), (void *) &label);
-		write_len = 2;
-		status = mb_fileio_put(verbose, mbio_ptr, (char *)&label, &write_len, error);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[0];
-		checksum += uchar_ptr[1];
-		}
-
-	/* output binary header data */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_int(swap, (int) heading->hed_date, (void *) &line[0]);
-		mb_put_binary_int(swap, (int) heading->hed_msec, (void *) &line[4]);
-		mb_put_binary_short(swap, (unsigned short) heading->hed_count, (void *) &line[8]);
-		mb_put_binary_short(swap, (unsigned short) heading->hed_serial, (void *) &line[10]);
-		mb_put_binary_short(swap, (unsigned short) heading->hed_ndata, (void *) &line[12]);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM3_HEADING_HEADER_SIZE;j++)
-		    checksum += uchar_ptr[j];
-
-		/* write out data */
-		write_len = EM3_HEADING_HEADER_SIZE;
-		status = mb_fileio_put(verbose, mbio_ptr, line, &write_len, error);
-		}
-
-	/* output binary heading data */
-	if (status == MB_SUCCESS)
-	    for (i=0;i<heading->hed_ndata;i++)
-		{
-		mb_put_binary_short(swap, (unsigned short) heading->hed_time[i], (void *) &line[0]);
-		mb_put_binary_short(swap, (unsigned short) heading->hed_heading[i], (void *) &line[2]);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM3_HEADING_SLICE_SIZE;j++)
-		    checksum += uchar_ptr[j];
-
-		/* write out data */
-		write_len = EM3_HEADING_SLICE_SIZE;
-		status = mb_fileio_put(verbose, mbio_ptr, line, &write_len, error);
-		}
-
-	/* output end of record */
-	if (status == MB_SUCCESS)
-		{
-		line[0] = (mb_u_char) heading->hed_heading_status;
-		line[1] = 0x03;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		checksum += uchar_ptr[0];
-
-		/* set checksum */
-		mb_put_binary_short(swap, (unsigned short) checksum, (void *) &line[2]);
-
-		/* write out data */
-		write_len = 4;
-		status = mb_fileio_put(verbose, mbio_ptr, line, &write_len, error);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em710raw_wr_ssv(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store, int *error)
-{
-	char	*function_name = "mbr_em710raw_wr_ssv";
-	int	status = MB_SUCCESS;
-	struct mbsys_simrad3_ssv_struct *ssv;
-	char	line[EM3_SSV_HEADER_SIZE];
-	short	label;
-	char	*labelchar;
-	size_t	write_len;
-	int	write_size;
-	unsigned short checksum;
-	mb_u_char   *uchar_ptr;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		}
-
-	/* get storage structure */
-	ssv = (struct mbsys_simrad3_ssv_struct *) store->ssv;
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       ssv_date:        %d\n",ssv->ssv_date);
-		fprintf(stderr,"dbg5       ssv_msec:        %d\n",ssv->ssv_msec);
-		fprintf(stderr,"dbg5       ssv_count:       %d\n",ssv->ssv_count);
-		fprintf(stderr,"dbg5       ssv_serial:      %d\n",ssv->ssv_serial);
-		fprintf(stderr,"dbg5       ssv_ndata:       %d\n",ssv->ssv_ndata);
-		fprintf(stderr,"dbg5       count    time (msec)    ssv (0.1 m/s)\n");
-		fprintf(stderr,"dbg5       -----    -----------    ------------------\n");
-		for (i=0;i<ssv->ssv_ndata;i++)
-			fprintf(stderr,"dbg5        %4d      %7d          %7d\n",
-				i, ssv->ssv_time[i], ssv->ssv_ssv[i]);
-		}
-
-	/* zero checksum */
-	checksum = 0;
-
-	/* write the record size */
-	mb_put_binary_int(swap, (int) (EM3_SSV_HEADER_SIZE
-			+ EM3_SSV_SLICE_SIZE * ssv->ssv_ndata + 8), (void *) &write_size);
-	write_len = 4;
-	mb_fileio_put(verbose, mbio_ptr, (char *)&write_size, &write_len, error);
-	if (write_len != 4)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	else
-		status = MB_SUCCESS;
-
-	/* write the record label */
-	if (status == MB_SUCCESS)
-		{
-		labelchar = (char *) &label;
-		labelchar[0] = EM3_START_BYTE;
-		labelchar[1] = EM3_ID_SSV;
-		write_len = 2;
-		status = mb_fileio_put(verbose, mbio_ptr, (char *)&label, &write_len, error);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[1];
-		}
-
-	/* write the sonar id */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_short(swap, (short) (store->sonar), (void *) &label);
-		write_len = 2;
-		status = mb_fileio_put(verbose, mbio_ptr, (char *)&label, &write_len, error);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[0];
-		checksum += uchar_ptr[1];
-		}
-
-	/* output binary header data */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_int(swap, (int) ssv->ssv_date, (void *) &line[0]);
-		mb_put_binary_int(swap, (int) ssv->ssv_msec, (void *) &line[4]);
-		mb_put_binary_short(swap, (unsigned short) ssv->ssv_count, (void *) &line[8]);
-		mb_put_binary_short(swap, (unsigned short) ssv->ssv_serial, (void *) &line[10]);
-		mb_put_binary_short(swap, (unsigned short) ssv->ssv_ndata, (void *) &line[12]);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM3_SSV_HEADER_SIZE;j++)
-		    checksum += uchar_ptr[j];
-
-		/* write out data */
-		write_len = EM3_SSV_HEADER_SIZE;
-		status = mb_fileio_put(verbose, mbio_ptr, line, &write_len, error);
-		}
-
-	/* output binary ssv data */
-	if (status == MB_SUCCESS)
-	    for (i=0;i<ssv->ssv_ndata;i++)
-		{
-		mb_put_binary_short(swap, (unsigned short) ssv->ssv_time[i], (void *) &line[0]);
-		mb_put_binary_short(swap, (unsigned short) ssv->ssv_ssv[i], (void *) &line[2]);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM3_SSV_SLICE_SIZE;j++)
-		    checksum += uchar_ptr[j];
-
-		/* write out data */
-		write_len = EM3_SSV_SLICE_SIZE;
-		status = mb_fileio_put(verbose, mbio_ptr, line, &write_len, error);
-		}
-
-	/* output end of record */
-	if (status == MB_SUCCESS)
-		{
-		line[0] = 0;
-		line[1] = 0x03;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		checksum += uchar_ptr[0];
-
-		/* set checksum */
-		mb_put_binary_short(swap, (unsigned short) checksum, (void *) &line[2]);
-
-		/* write out data */
-		write_len = 4;
-		status = mb_fileio_put(verbose, mbio_ptr, line, &write_len, error);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em710raw_wr_tilt(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store, int *error)
-{
-	char	*function_name = "mbr_em710raw_wr_tilt";
-	int	status = MB_SUCCESS;
-	struct mbsys_simrad3_tilt_struct *tilt;
-	char	line[EM3_TILT_HEADER_SIZE];
-	short	label;
-	char	*labelchar;
-	size_t	write_len;
-	int	write_size;
-	unsigned short checksum;
-	mb_u_char   *uchar_ptr;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		}
-
-	/* get storage structure */
-	tilt = (struct mbsys_simrad3_tilt_struct *) store->tilt;
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       tlt_date:        %d\n",tilt->tlt_date);
-		fprintf(stderr,"dbg5       tlt_msec:        %d\n",tilt->tlt_msec);
-		fprintf(stderr,"dbg5       tlt_count:       %d\n",tilt->tlt_count);
-		fprintf(stderr,"dbg5       tlt_serial:      %d\n",tilt->tlt_serial);
-		fprintf(stderr,"dbg5       tlt_ndata:       %d\n",tilt->tlt_ndata);
-		fprintf(stderr,"dbg5       count    time (msec)    tilt (0.01 deg)\n");
-		fprintf(stderr,"dbg5       -----    -----------    ------------------\n");
-		for (i=0;i<tilt->tlt_ndata;i++)
-			fprintf(stderr,"dbg5        %4d      %7d          %7d\n",
-				i, tilt->tlt_time[i], tilt->tlt_tilt[i]);
-		}
-
-	/* zero checksum */
-	checksum = 0;
-
-	/* write the record size */
-	mb_put_binary_int(swap, (int) (EM3_TILT_HEADER_SIZE
-			+ EM3_TILT_SLICE_SIZE * tilt->tlt_ndata + 8), (void *) &write_size);
-	write_len = 4;
-	mb_fileio_put(verbose, mbio_ptr, (char *)&write_size, &write_len, error);
-	if (write_len != 4)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	else
-		status = MB_SUCCESS;
-
-	/* write the record label */
-	if (status == MB_SUCCESS)
-		{
-		labelchar = (char *) &label;
-		labelchar[0] = EM3_START_BYTE;
-		labelchar[1] = EM3_ID_TILT;
-		write_len = 2;
-		status = mb_fileio_put(verbose, mbio_ptr, (char *)&label, &write_len, error);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[1];
-		}
-
-	/* write the sonar id */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_short(swap, (short) (store->sonar), (void *) &label);
-		write_len = 2;
-		status = mb_fileio_put(verbose, mbio_ptr, (char *)&label, &write_len, error);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[0];
-		checksum += uchar_ptr[1];
-		}
-
-	/* output binary header data */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_int(swap, (int) tilt->tlt_date, (void *) &line[0]);
-		mb_put_binary_int(swap, (int) tilt->tlt_msec, (void *) &line[4]);
-		mb_put_binary_short(swap, (unsigned short) tilt->tlt_count, (void *) &line[8]);
-		mb_put_binary_short(swap, (unsigned short) tilt->tlt_serial, (void *) &line[10]);
-		mb_put_binary_short(swap, (unsigned short) tilt->tlt_ndata, (void *) &line[12]);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM3_TILT_HEADER_SIZE;j++)
-		    checksum += uchar_ptr[j];
-
-		/* write out data */
-		write_len = EM3_TILT_HEADER_SIZE;
-		status = mb_fileio_put(verbose, mbio_ptr, line, &write_len, error);
-		}
-
-	/* output binary tilt data */
-	if (status == MB_SUCCESS)
-	    for (i=0;i<tilt->tlt_ndata;i++)
-		{
-		mb_put_binary_short(swap, (unsigned short) tilt->tlt_time[i], (void *) &line[0]);
-		mb_put_binary_short(swap, (unsigned short) tilt->tlt_tilt[i], (void *) &line[2]);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM3_TILT_SLICE_SIZE;j++)
-		    checksum += uchar_ptr[j];
-
-		/* write out data */
-		write_len = EM3_TILT_SLICE_SIZE;
-		status = mb_fileio_put(verbose, mbio_ptr, line, &write_len, error);
-		}
-
-	/* output end of record */
-	if (status == MB_SUCCESS)
-		{
-		line[0] = 0;
-		line[1] = 0x03;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		checksum += uchar_ptr[0];
-
-		/* set checksum */
-		mb_put_binary_short(swap, (unsigned short) checksum, (void *) &line[2]);
-
-		/* write out data */
-		write_len = 4;
-		status = mb_fileio_put(verbose, mbio_ptr, line, &write_len, error);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em710raw_wr_extraparameters(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store, int *error)
-{
-	char	*function_name = "mbr_em710raw_wr_extraparameters";
-	int	status = MB_SUCCESS;
-	struct mbsys_simrad3_extraparameters_struct *extraparameters;
-	char	line[EM3_EXTRAPARAMETERS_HEADER_SIZE];
-	short	label;
-	char	*labelchar;
-	size_t	write_len;
-	int	write_size;
-	unsigned short checksum;
-	mb_u_char   *uchar_ptr;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		}
-
-	/* get storage structure */
-	extraparameters = (struct mbsys_simrad3_extraparameters_struct *) store->extraparameters;
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       xtr_date:        %d\n",extraparameters->xtr_date);
-		fprintf(stderr,"dbg5       xtr_msec:        %d\n",extraparameters->xtr_msec);
-		fprintf(stderr,"dbg5       xtr_count:       %d\n",extraparameters->xtr_count);
-		fprintf(stderr,"dbg5       xtr_serial:      %d\n",extraparameters->xtr_serial);
-		fprintf(stderr,"dbg5       xtr_id:          %d\n",extraparameters->xtr_id);
-		fprintf(stderr,"dbg5       xtr_data_size:   %d\n",extraparameters->xtr_data_size);
-		fprintf(stderr,"dbg5       xtr_nalloc:      %d\n",extraparameters->xtr_nalloc);
-		if (extraparameters->xtr_id == 2)
-			{
-			fprintf(stderr,"dbg5       xtr_pqf_activepositioning:          %d\n",extraparameters->xtr_pqf_activepositioning);
-			for (i=0;i<3;i++)
-				{
-				fprintf(stderr,"dbg5       positioning system:%d qfsetting:%d nqf:%d\n",
-					i,extraparameters->xtr_pqf_qfsetting[i],extraparameters->xtr_pqf_nqualityfactors[i]);
-				for (j=0;j<extraparameters->xtr_pqf_nqualityfactors[i];j++)
-				fprintf(stderr,"dbg5       quality factor:%d value:%d limit:%d\n",
-					j,extraparameters->xtr_pqf_qfvalues[i][j],extraparameters->xtr_pqf_qflimits[i][j]);
-				}
-			}
-		}
-
-	/* zero checksum */
-	checksum = 0;
-
-	/* write the record size */
-	mb_put_binary_int(swap, (int) (EM3_EXTRAPARAMETERS_HEADER_SIZE
-			+ extraparameters->xtr_data_size + 8), (void *) &write_size);
-	write_len = 4;
-	mb_fileio_put(verbose, mbio_ptr, (char *)&write_size, &write_len, error);
-	if (write_len != 4)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	else
-		status = MB_SUCCESS;
-
-	/* write the record label */
-	if (status == MB_SUCCESS)
-		{
-		labelchar = (char *) &label;
-		labelchar[0] = EM3_START_BYTE;
-		labelchar[1] = EM3_ID_EXTRAPARAMETERS;
-		write_len = 2;
-		status = mb_fileio_put(verbose, mbio_ptr, (char *)&label, &write_len, error);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[1];
-		}
-
-	/* write the sonar id */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_short(swap, (short) (store->sonar), (void *) &label);
-		write_len = 2;
-		status = mb_fileio_put(verbose, mbio_ptr, (char *)&label, &write_len, error);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[0];
-		checksum += uchar_ptr[1];
-		}
-
-	/* output binary header data */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_int(swap, (int) extraparameters->xtr_date, (void *) &line[0]);
-		mb_put_binary_int(swap, (int) extraparameters->xtr_msec, (void *) &line[4]);
-		mb_put_binary_short(swap, (unsigned short) extraparameters->xtr_count, (void *) &line[8]);
-		mb_put_binary_short(swap, (unsigned short) extraparameters->xtr_serial, (void *) &line[10]);
-		mb_put_binary_short(swap, (unsigned short) extraparameters->xtr_id, (void *) &line[12]);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM3_EXTRAPARAMETERS_HEADER_SIZE;j++)
-		    checksum += uchar_ptr[j];
-
-		/* write out data */
-		write_len = EM3_EXTRAPARAMETERS_HEADER_SIZE;
-		status = mb_fileio_put(verbose, mbio_ptr, line, &write_len, error);
-		}
-
-	/* output binary extraparameters data */
-	if (status == MB_SUCCESS)
-		{
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) extraparameters->xtr_data;
-		for (j=0;j<extraparameters->xtr_data_size;j++)
-		    checksum += uchar_ptr[j];
-
-		/* write out data */
-		write_len = extraparameters->xtr_data_size;
-		status = mb_fileio_put(verbose, mbio_ptr, extraparameters->xtr_data, &write_len, error);
-		}
-
-	/* output end of record */
-	if (status == MB_SUCCESS)
-		{
-		line[0] = 0;
-		line[1] = 0x03;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		checksum += uchar_ptr[0];
-
-		/* set checksum */
-		mb_put_binary_short(swap, (unsigned short) checksum, (void *) &line[2]);
-
-		/* write out data */
-		write_len = 4;
-		status = mb_fileio_put(verbose, mbio_ptr, line, &write_len, error);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em710raw_wr_attitude(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store, int *error)
-{
-	char	*function_name = "mbr_em710raw_wr_attitude";
-	int	status = MB_SUCCESS;
-	struct mbsys_simrad3_attitude_struct *attitude;
-	char	line[EM3_ATTITUDE_HEADER_SIZE];
-	short	label;
-	char	*labelchar;
-	size_t	write_len;
-	int	write_size;
-	unsigned short checksum;
-	mb_u_char   *uchar_ptr;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		}
-
-	/* get storage structure */
-	attitude = (struct mbsys_simrad3_attitude_struct *) store->attitude;
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       att_date:        %d\n",attitude->att_date);
-		fprintf(stderr,"dbg5       att_msec:        %d\n",attitude->att_msec);
-		fprintf(stderr,"dbg5       att_count:       %d\n",attitude->att_count);
-		fprintf(stderr,"dbg5       att_serial:      %d\n",attitude->att_serial);
-		fprintf(stderr,"dbg5       att_ndata:       %d\n",attitude->att_ndata);
-		fprintf(stderr,"dbg5       cnt   time   roll pitch heave heading\n");
-		fprintf(stderr,"dbg5       -------------------------------------\n");
-		for (i=0;i<attitude->att_ndata;i++)
-			fprintf(stderr,"dbg5        %3d  %d  %d %d %d %d\n",
-				i, attitude->att_time[i], attitude->att_roll[i],
-				attitude->att_pitch[i], attitude->att_heave[i],
-				attitude->att_heading[i]);
-		fprintf(stderr,"dbg5       att_sensordescriptor: %d\n",attitude->att_sensordescriptor);
-		}
-
-	/* zero checksum */
-	checksum = 0;
-
-	/* write the record size */
-	mb_put_binary_int(swap, (int) (EM3_ATTITUDE_HEADER_SIZE
-			+ EM3_ATTITUDE_SLICE_SIZE * attitude->att_ndata + 8), (void *) &write_size);
-	write_len = 4;
-	mb_fileio_put(verbose, mbio_ptr, (char *)&write_size, &write_len, error);
-	if (write_len != 4)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	else
-		status = MB_SUCCESS;
-
-	/* write the record label */
-	if (status == MB_SUCCESS)
-		{
-		labelchar = (char *) &label;
-		labelchar[0] = EM3_START_BYTE;
-		labelchar[1] = EM3_ID_ATTITUDE;
-		write_len = 2;
-		status = mb_fileio_put(verbose, mbio_ptr, (char *)&label, &write_len, error);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[1];
-		}
-
-	/* write the sonar id */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_short(swap, (short) (store->sonar), (void *) &label);
-		write_len = 2;
-		status = mb_fileio_put(verbose, mbio_ptr, (char *)&label, &write_len, error);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[0];
-		checksum += uchar_ptr[1];
-		}
-
-	/* output binary header data */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_int(swap, (int) attitude->att_date, (void *) &line[0]);
-		mb_put_binary_int(swap, (int) attitude->att_msec, (void *) &line[4]);
-		mb_put_binary_short(swap, (unsigned short) attitude->att_count, (void *) &line[8]);
-		mb_put_binary_short(swap, (unsigned short) attitude->att_serial, (void *) &line[10]);
-		mb_put_binary_short(swap, (unsigned short) attitude->att_ndata, (void *) &line[12]);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM3_ATTITUDE_HEADER_SIZE;j++)
-		    checksum += uchar_ptr[j];
-
-		/* write out data */
-		write_len = EM3_ATTITUDE_HEADER_SIZE;
-		status = mb_fileio_put(verbose, mbio_ptr, line, &write_len, error);
-		}
-
-	/* output binary heading data */
-	if (status == MB_SUCCESS)
-	    for (i=0;i<attitude->att_ndata;i++)
-		{
-		mb_put_binary_short(swap, (unsigned short) attitude->att_time[i], (void *) &line[0]);
-		mb_put_binary_short(swap, (unsigned short) attitude->att_sensor_status[i], (void *) &line[2]);
-		mb_put_binary_short(swap, (short) attitude->att_roll[i], (void *) &line[4]);
-		mb_put_binary_short(swap, (short) attitude->att_pitch[i], (void *) &line[6]);
-		mb_put_binary_short(swap, (short) attitude->att_heave[i], (void *) &line[8]);
-		mb_put_binary_short(swap, (unsigned short) attitude->att_heading[i], (void *) &line[10]);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM3_ATTITUDE_SLICE_SIZE;j++)
-		    checksum += uchar_ptr[j];
-
-		/* write out data */
-		write_len = EM3_ATTITUDE_SLICE_SIZE;
-		status = mb_fileio_put(verbose, mbio_ptr, line, &write_len, error);
-		}
-
-	/* output end of record */
-	if (status == MB_SUCCESS)
-		{
-		line[0] = (mb_u_char) attitude->att_sensordescriptor;
-		line[1] = 0x03;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		checksum += uchar_ptr[0];
-
-		/* set checksum */
-		mb_put_binary_short(swap, (unsigned short) checksum, (void *) &line[2]);
-
-		/* write out data */
-		write_len = 4;
-		status = mb_fileio_put(verbose, mbio_ptr, line, &write_len, error);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em710raw_wr_netattitude(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store, int *error)
-{
-	char	*function_name = "mbr_em710raw_wr_netattitude";
-	int	status = MB_SUCCESS;
-	struct mbsys_simrad3_netattitude_struct *netattitude;
-	char	line[EM3_NETATTITUDE_SLICE_SIZE+MBSYS_SIMRAD3_BUFFER_SIZE];
-	short	label;
-	char	*labelchar;
-	size_t	write_len;
-	int	write_size;
-	int	extrabyte;
-	unsigned short checksum;
-	mb_u_char   *uchar_ptr;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		}
-
-	/* get storage structure */
-	netattitude = (struct mbsys_simrad3_netattitude_struct *) store->netattitude;
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:                 %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:                %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:                 %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:                 %d\n",store->msec);
-		fprintf(stderr,"dbg5       nat_date:             %d\n",netattitude->nat_date);
-		fprintf(stderr,"dbg5       nat_msec:             %d\n",netattitude->nat_msec);
-		fprintf(stderr,"dbg5       nat_count:            %d\n",netattitude->nat_count);
-		fprintf(stderr,"dbg5       nat_serial:           %d\n",netattitude->nat_serial);
-		fprintf(stderr,"dbg5       nat_ndata:            %d\n",netattitude->nat_ndata);
-		fprintf(stderr,"dbg5       nat_sensordescriptor: %d\n",netattitude->nat_sensordescriptor);
-		fprintf(stderr,"dbg5       cnt   time   roll pitch heave heading\n");
-		fprintf(stderr,"dbg5       -------------------------------------\n");
-		for (i=0;i<netattitude->nat_ndata;i++)
-			{
-			fprintf(stderr,"dbg5        %3d  %d  %d %d %d %d %d\n",
-				i, netattitude->nat_time[i], netattitude->nat_roll[i],
-				netattitude->nat_pitch[i], netattitude->nat_heave[i],
-				netattitude->nat_heading[i],netattitude->nat_nbyte_raw[i]);
-			fprintf(stderr,"dbg5        nat_raw[%d]: ",netattitude->nat_nbyte_raw[i]);
-			for (j=0;j<netattitude->nat_nbyte_raw[i];j++)
-				fprintf(stderr,"%x",netattitude->nat_raw[i*MBSYS_SIMRAD3_BUFFER_SIZE+j]);
-			fprintf(stderr,"\n");
-			}
-		}
-
-	/* zero checksum */
-	checksum = 0;
-
-	/* write the record size */
-	write_size = EM3_NETATTITUDE_HEADER_SIZE + 8;
-	for (i=0;i<netattitude->nat_ndata;i++)
-		{
-		write_size += EM3_NETATTITUDE_SLICE_SIZE + netattitude->nat_nbyte_raw[i];
-		}
-	extrabyte = 0;
-	if (write_size%2)
-		{
-		extrabyte++;
-		write_size--;
-		}
-	mb_put_binary_int(swap, (int)write_size, (void *) line);
-	write_len = 4;
-	status = mb_fileio_put(verbose, mbio_ptr, line, &write_len, error);
-
-	/* write the record label */
-	if (status == MB_SUCCESS)
-		{
-		labelchar = (char *) &label;
-		labelchar[0] = EM3_START_BYTE;
-		labelchar[1] = EM3_ID_NETATTITUDE;
-		write_len = 2;
-		status = mb_fileio_put(verbose, mbio_ptr, (char *)&label, &write_len, error);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[1];
-		}
-
-	/* write the sonar id */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_short(swap, (short) (store->sonar), (void *) &label);
-		write_len = 2;
-		status = mb_fileio_put(verbose, mbio_ptr, (char *)&label, &write_len, error);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[0];
-		checksum += uchar_ptr[1];
-		}
-
-	/* output binary header data */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_int(swap, (int) netattitude->nat_date, (void *) &line[0]);
-		mb_put_binary_int(swap, (int) netattitude->nat_msec, (void *) &line[4]);
-		mb_put_binary_short(swap, (unsigned short) netattitude->nat_count, (void *) &line[8]);
-		mb_put_binary_short(swap, (unsigned short) netattitude->nat_serial, (void *) &line[10]);
-		mb_put_binary_short(swap, (unsigned short) netattitude->nat_ndata, (void *) &line[12]);
-		line[14] = (mb_u_char) netattitude->nat_sensordescriptor;
-		line[15] = (mb_u_char) 0;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM3_NETATTITUDE_HEADER_SIZE;j++)
-		    checksum += uchar_ptr[j];
-
-		/* write out data */
-		write_len = EM3_NETATTITUDE_HEADER_SIZE;
-		status = mb_fileio_put(verbose, mbio_ptr, line, &write_len, error);
-		}
-
-	/* output binary attitude data */
-	if (status == MB_SUCCESS)
-	    for (i=0;i<netattitude->nat_ndata;i++)
-		{
-		mb_put_binary_short(swap, (unsigned short) netattitude->nat_time[i], (void *) &line[0]);
-		mb_put_binary_short(swap, (short) netattitude->nat_roll[i], (void *) &line[2]);
-		mb_put_binary_short(swap, (short) netattitude->nat_pitch[i], (void *) &line[4]);
-		mb_put_binary_short(swap, (short) netattitude->nat_heave[i], (void *) &line[6]);
-		mb_put_binary_short(swap, (unsigned short) netattitude->nat_heading[i], (void *) &line[8]);
-		line[10] = (mb_u_char) netattitude->nat_nbyte_raw[i];
-		for (j=0;j<netattitude->nat_nbyte_raw[i];j++)
-			line[j+11] = netattitude->nat_raw[i*MBSYS_SIMRAD3_BUFFER_SIZE+j];
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM3_NETATTITUDE_SLICE_SIZE+netattitude->nat_nbyte_raw[i];j++)
-		    checksum += uchar_ptr[j];
-
-		/* write out data */
-		write_len = EM3_NETATTITUDE_SLICE_SIZE+netattitude->nat_nbyte_raw[i];
-		status = mb_fileio_put(verbose, mbio_ptr, line, &write_len, error);
-		}
-
-	/* output end of record */
-	if (status == MB_SUCCESS)
-		{
-		line[0] = 0;
-		line[1] = 0x03;
-
-		/* set checksum */
-		mb_put_binary_short(swap, (unsigned short) checksum, (void *) &line[2]);
-
-		/* write out data */
-		if (extrabyte)
-			{
-			write_len = 3;
-			status = mb_fileio_put(verbose, mbio_ptr, &line[1], &write_len, error);
-			}
-		else
-			{
-			write_len = 4;
-			status = mb_fileio_put(verbose, mbio_ptr, line, &write_len, error);
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em710raw_wr_pos(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store, int *error)
-{
-	char	*function_name = "mbr_em710raw_wr_pos";
-	int	status = MB_SUCCESS;
-	char	line[EM3_POS_HEADER_SIZE];
-	short	label;
-	char	*labelchar;
-	size_t	write_len;
-	int	write_size;
-	unsigned short checksum;
-	mb_u_char   *uchar_ptr;
-	int	j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       pos_date:        %d\n",store->pos_date);
-		fprintf(stderr,"dbg5       pos_msec:        %d\n",store->pos_msec);
-		fprintf(stderr,"dbg5       pos_count:       %d\n",store->pos_count);
-		fprintf(stderr,"dbg5       pos_serial:      %d\n",store->pos_serial);
-		fprintf(stderr,"dbg5       pos_latitude:    %d\n",store->pos_latitude);
-		fprintf(stderr,"dbg5       pos_longitude:   %d\n",store->pos_longitude);
-		fprintf(stderr,"dbg5       pos_quality:     %d\n",store->pos_quality);
-		fprintf(stderr,"dbg5       pos_speed:       %d\n",store->pos_speed);
-		fprintf(stderr,"dbg5       pos_course:      %d\n",store->pos_course);
-		fprintf(stderr,"dbg5       pos_heading:     %d\n",store->pos_heading);
-		fprintf(stderr,"dbg5       pos_system:      %d\n",store->pos_system);
-		fprintf(stderr,"dbg5       pos_input_size:  %d\n",store->pos_input_size);
-		fprintf(stderr,"dbg5       pos_input:\ndbg5            %s\n",store->pos_input);
-		}
-
-	/* zero checksum */
-	checksum = 0;
-
-	/* write the record size */
-	mb_put_binary_int(swap, (int) (EM3_POS_HEADER_SIZE
-			+ store->pos_input_size
-			- (store->pos_input_size % 2) + 8), (void *) &write_size);
-	write_len = 4;
-	mb_fileio_put(verbose, mbio_ptr, (char *)&write_size, &write_len, error);
-	if (write_len != 4)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	else
-		status = MB_SUCCESS;
-
-	/* write the record label */
-	if (status == MB_SUCCESS)
-		{
-		labelchar = (char *) &label;
-		labelchar[0] = EM3_START_BYTE;
-		labelchar[1] = EM3_ID_POS;
-		write_len = 2;
-		status = mb_fileio_put(verbose, mbio_ptr, (char *)&label, &write_len, error);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[1];
-		}
-
-	/* write the sonar id */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_short(swap, (short) (store->sonar), (void *) &label);
-		write_len = 2;
-		status = mb_fileio_put(verbose, mbio_ptr, (char *)&label, &write_len, error);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[0];
-		checksum += uchar_ptr[1];
-		}
-
-	/* output binary header data */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_int(swap, (int) store->pos_date, (void *) &line[0]);
-		mb_put_binary_int(swap, (int) store->pos_msec, (void *) &line[4]);
-		mb_put_binary_short(swap, (unsigned short) store->pos_count, (void *) &line[8]);
-		mb_put_binary_short(swap, (unsigned short) store->pos_serial, (void *) &line[10]);
-		mb_put_binary_int(swap, (int) store->pos_latitude, (void *) &line[12]);
-		mb_put_binary_int(swap, (int) store->pos_longitude, (void *) &line[16]);
-		mb_put_binary_short(swap, (unsigned short) store->pos_quality, (void *) &line[20]);
-		mb_put_binary_short(swap, (unsigned short) store->pos_speed, (void *) &line[22]);
-		mb_put_binary_short(swap, (unsigned short) store->pos_course, (void *) &line[24]);
-		mb_put_binary_short(swap, (unsigned short) store->pos_heading, (void *) &line[26]);
-		line[28] = (mb_u_char) store->pos_system;
-		line[29] = (mb_u_char) store->pos_input_size;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM3_POS_HEADER_SIZE;j++)
-		    checksum += uchar_ptr[j];
-
-		/* write out data */
-		write_len = EM3_POS_HEADER_SIZE;
-		status = mb_fileio_put(verbose, mbio_ptr, line, &write_len, error);
-		}
-
-	/* output original ascii nav data */
-	if (status == MB_SUCCESS)
-		{
-		write_size = store->pos_input_size
-				- (store->pos_input_size % 2) + 1;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) store->pos_input;
-		for (j=0;j<write_size;j++)
-		    checksum += uchar_ptr[j];
-
-		/* write out data */
-		write_len = write_size;
-		status = mb_fileio_put(verbose, mbio_ptr, store->pos_input, &write_len, error);
-		}
-
-	/* output end of record */
-	if (status == MB_SUCCESS)
-		{
-		line[1] = 0x03;
-
-		/* set checksum */
-		mb_put_binary_short(swap, (unsigned short) checksum, (void *) &line[2]);
-
-		/* write out data */
-		write_len = 3;
-		status = mb_fileio_put(verbose, mbio_ptr, &line[1], &write_len, error);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em710raw_wr_svp(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store, int *error)
-{
-	char	*function_name = "mbr_em710raw_wr_svp";
-	int	status = MB_SUCCESS;
-	char	line[EM3_SVP_HEADER_SIZE];
-	short	label;
-	char	*labelchar;
-	size_t	write_len;
-	int	write_size;
-	unsigned short checksum;
-	mb_u_char   *uchar_ptr;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       svp_use_date:    %d\n",store->svp_use_date);
-		fprintf(stderr,"dbg5       svp_use_msec:    %d\n",store->svp_use_msec);
-		fprintf(stderr,"dbg5       svp_count:       %d\n",store->svp_count);
-		fprintf(stderr,"dbg5       svp_serial:      %d\n",store->svp_serial);
-		fprintf(stderr,"dbg5       svp_origin_date: %d\n",store->svp_origin_date);
-		fprintf(stderr,"dbg5       svp_origin_msec: %d\n",store->svp_origin_msec);
-		fprintf(stderr,"dbg5       svp_num:         %d\n",store->svp_num);
-		fprintf(stderr,"dbg5       svp_depth_res:   %d\n",store->svp_depth_res);
-		fprintf(stderr,"dbg5       count    depth    speed\n");
-		fprintf(stderr,"dbg5       -----------------------\n");
-		for (i=0;i<store->svp_num;i++)
-			fprintf(stderr,"dbg5        %d   %d  %d\n",
-				i, store->svp_depth[i], store->svp_vel[i]);
-		}
-
-	/* zero checksum */
-	checksum = 0;
-
-	/* write the record size */
-	mb_put_binary_int(swap, (int) (EM3_SVP_HEADER_SIZE
-			+ EM3_SVP_SLICE_SIZE * store->svp_num + 8), (void *) &write_size);
-	write_len = 4;
-	mb_fileio_put(verbose, mbio_ptr, (char *)&write_size, &write_len, error);
-	if (write_len != 4)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	else
-		status = MB_SUCCESS;
-
-	/* write the record label */
-	if (status == MB_SUCCESS)
-		{
-		labelchar = (char *) &label;
-		labelchar[0] = EM3_START_BYTE;
-		labelchar[1] = EM3_ID_SVP;
-		write_len = 2;
-		status = mb_fileio_put(verbose, mbio_ptr, (char *)&label, &write_len, error);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[1];
-		}
-
-	/* write the sonar id */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_short(swap, (short) (store->sonar), (void *) &label);
-		write_len = 2;
-		status = mb_fileio_put(verbose, mbio_ptr, (char *)&label, &write_len, error);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[0];
-		checksum += uchar_ptr[1];
-		}
-
-	/* output binary header data */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_int(swap, (int) store->svp_use_date, (void *) &line[0]);
-		mb_put_binary_int(swap, (int) store->svp_use_msec, (void *) &line[4]);
-		mb_put_binary_short(swap, (unsigned short) store->svp_count, (void *) &line[8]);
-		mb_put_binary_short(swap, (unsigned short) store->svp_serial, (void *) &line[10]);
-		mb_put_binary_int(swap, (int) store->svp_origin_date, (void *) &line[12]);
-		mb_put_binary_int(swap, (int) store->svp_origin_msec, (void *) &line[16]);
-		mb_put_binary_short(swap, (unsigned short) store->svp_num, (void *) &line[20]);
-		mb_put_binary_short(swap, (unsigned short) store->svp_depth_res, (void *) &line[22]);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM3_SVP_HEADER_SIZE;j++)
-		    checksum += uchar_ptr[j];
-
-		/* write out data */
-		write_len = EM3_SVP_HEADER_SIZE;
-		status = mb_fileio_put(verbose, mbio_ptr, line, &write_len, error);
-		}
-
-	/* output binary svp data */
-	if (status == MB_SUCCESS)
-	    for (i=0;i<store->svp_num;i++)
-		{
-		mb_put_binary_short(swap, (unsigned short) store->svp_depth[i], (void *) &line[0]);
-		mb_put_binary_short(swap, (unsigned short) store->svp_vel[i], (void *) &line[4]);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM3_SVP_SLICE_SIZE;j++)
-		    checksum += uchar_ptr[j];
-
-		/* write out data */
-		write_len = EM3_SVP_SLICE_SIZE;
-		status = mb_fileio_put(verbose, mbio_ptr, line, &write_len, error);
-		}
-
-	/* output end of record */
-	if (status == MB_SUCCESS)
-		{
-		line[0] = '\0';
-		line[1] = 0x03;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		checksum += uchar_ptr[0];
-
-		/* set checksum */
-		mb_put_binary_short(swap, (unsigned short) checksum, (void *) &line[2]);
-
-		/* write out data */
-		write_len = 4;
-		status = mb_fileio_put(verbose, mbio_ptr, line, &write_len, error);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em710raw_wr_svp2(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store, int *error)
-{
-	char	*function_name = "mbr_em710raw_wr_svp2";
-	int	status = MB_SUCCESS;
-	char	line[EM3_SVP2_HEADER_SIZE];
-	short	label;
-	char	*labelchar;
-	size_t	write_len;
-	int	write_size;
-	unsigned short checksum;
-	mb_u_char   *uchar_ptr;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       svp_use_date:    %d\n",store->svp_use_date);
-		fprintf(stderr,"dbg5       svp_use_msec:    %d\n",store->svp_use_msec);
-		fprintf(stderr,"dbg5       svp_count:       %d\n",store->svp_count);
-		fprintf(stderr,"dbg5       svp_serial:      %d\n",store->svp_serial);
-		fprintf(stderr,"dbg5       svp_origin_date: %d\n",store->svp_origin_date);
-		fprintf(stderr,"dbg5       svp_origin_msec: %d\n",store->svp_origin_msec);
-		fprintf(stderr,"dbg5       svp_num:         %d\n",store->svp_num);
-		fprintf(stderr,"dbg5       svp_depth_res:   %d\n",store->svp_depth_res);
-		fprintf(stderr,"dbg5       count    depth    speed\n");
-		fprintf(stderr,"dbg5       -----------------------\n");
-		for (i=0;i<store->svp_num;i++)
-			fprintf(stderr,"dbg5        %d   %d  %d\n",
-				i, store->svp_depth[i], store->svp_vel[i]);
-		}
-
-	/* zero checksum */
-	checksum = 0;
-
-	/* write the record size */
-	mb_put_binary_int(swap, (int) (EM3_SVP2_HEADER_SIZE
-			+ EM3_SVP2_SLICE_SIZE * store->svp_num + 8), (void *) &write_size);
-	write_len = 4;
-	mb_fileio_put(verbose, mbio_ptr, (char *)&write_size, &write_len, error);
-	if (write_len != 4)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	else
-		status = MB_SUCCESS;
-
-	/* write the record label */
-	if (status == MB_SUCCESS)
-		{
-		labelchar = (char *) &label;
-		labelchar[0] = EM3_START_BYTE;
-		labelchar[1] = EM3_ID_SVP2;
-		write_len = 2;
-		status = mb_fileio_put(verbose, mbio_ptr, (char *)&label, &write_len, error);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[1];
-		}
-
-	/* write the sonar id */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_short(swap, (short) (store->sonar), (void *) &label);
-		write_len = 2;
-		status = mb_fileio_put(verbose, mbio_ptr, (char *)&label, &write_len, error);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[0];
-		checksum += uchar_ptr[1];
-		}
-
-	/* output binary header data */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_int(swap, (int) store->svp_use_date, (void *) &line[0]);
-		mb_put_binary_int(swap, (int) store->svp_use_msec, (void *) &line[4]);
-		mb_put_binary_short(swap, (unsigned short) store->svp_count, (void *) &line[8]);
-		mb_put_binary_short(swap, (unsigned short) store->svp_serial, (void *) &line[10]);
-		mb_put_binary_int(swap, (int) store->svp_origin_date, (void *) &line[12]);
-		mb_put_binary_int(swap, (int) store->svp_origin_msec, (void *) &line[16]);
-		mb_put_binary_short(swap, (unsigned short) store->svp_num, (void *) &line[20]);
-		mb_put_binary_short(swap, (unsigned short) store->svp_depth_res, (void *) &line[22]);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM3_SVP2_HEADER_SIZE;j++)
-		    checksum += uchar_ptr[j];
-
-		/* write out data */
-		write_len = EM3_SVP2_HEADER_SIZE;
-		status = mb_fileio_put(verbose, mbio_ptr, line, &write_len, error);
-		}
-
-	/* output binary svp data */
-	if (status == MB_SUCCESS)
-	    for (i=0;i<store->svp_num;i++)
-		{
-		mb_put_binary_int(swap, (int) store->svp_depth[i], (void *) &line[0]);
-		mb_put_binary_int(swap, (int) store->svp_vel[i], (void *) &line[4]);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM3_SVP2_SLICE_SIZE;j++)
-		    checksum += uchar_ptr[j];
-
-		/* write out data */
-		write_len = EM3_SVP2_SLICE_SIZE;
-		status = mb_fileio_put(verbose, mbio_ptr, line, &write_len, error);
-		}
-
-	/* output end of record */
-	if (status == MB_SUCCESS)
-		{
-		line[0] = '\0';
-		line[1] = 0x03;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		checksum += uchar_ptr[0];
-
-		/* set checksum */
-		mb_put_binary_short(swap, (unsigned short) checksum, (void *) &line[2]);
-
-		/* write out data */
-		write_len = 4;
-		status = mb_fileio_put(verbose, mbio_ptr, line, &write_len, error);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em710raw_wr_bath2(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store, int *error)
-{
-	char	*function_name = "mbr_em710raw_wr_bath2";
-	int	status = MB_SUCCESS;
-	struct mbsys_simrad3_ping_struct *ping;
-	char	line[EM3_BATH2_HEADER_SIZE];
-	short	label;
-	char	*labelchar;
-	size_t	write_len;
-	int	write_size;
-	unsigned short checksum;
-	mb_u_char   *uchar_ptr;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		}
-	
-	/* set which storage structure to use */
-	ping = (struct mbsys_simrad3_ping_struct *) &(store->pings[store->ping_index]);
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:                  %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:                 %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:                  %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:                  %d\n",store->msec);
-		fprintf(stderr,"dbg5       png_date:              %d\n",ping->png_date);
-		fprintf(stderr,"dbg5       png_msec:              %d\n",ping->png_msec);
-		fprintf(stderr,"dbg5       png_count:             %d\n",ping->png_count);
-		fprintf(stderr,"dbg5       png_serial:            %d\n",ping->png_serial);
-		fprintf(stderr,"dbg5       png_heading:           %d\n",ping->png_heading);
-		fprintf(stderr,"dbg5       png_ssv:               %d\n",ping->png_ssv);
-		fprintf(stderr,"dbg5       png_xducer_depth:      %f\n",ping->png_xducer_depth);
-		fprintf(stderr,"dbg5       png_nbeams:            %d\n",ping->png_nbeams);
-		fprintf(stderr,"dbg5       png_nbeams_valid:      %d\n",ping->png_nbeams_valid);
-		fprintf(stderr,"dbg5       png_sample_rate:       %f\n",ping->png_sample_rate);
-		fprintf(stderr,"dbg5       png_spare:             %d\n",ping->png_spare);
-		fprintf(stderr,"dbg5       cnt  depth xtrack ltrack dprsn   azi   rng  qual wnd amp num\n");
-		fprintf(stderr,"dbg5       ------------------------------------------------------------\n");
-		for (i=0;i<ping->png_nbeams;i++)
-			fprintf(stderr,"dbg5       %3d %7.2f %7.2f %7.2f %5d %5d %5d %4d %3d %3d\n",
-				i, ping->png_depth[i], ping->png_acrosstrack[i],
-				ping->png_alongtrack[i], ping->png_window[i],
-				ping->png_quality[i], ping->png_iba[i],
-				ping->png_detection[i], ping->png_clean[i],
-				ping->png_amp[i]);
-		}
-
-	/* zero checksum */
-	checksum = 0;
-
-	/* write the record size */
-	mb_put_binary_int(swap, (int) (EM3_BATH2_HEADER_SIZE
-			+ EM3_BATH2_BEAM_SIZE * ping->png_nbeams + 8), (void *) &write_size);
-	write_len = 4;
-	mb_fileio_put(verbose, mbio_ptr, (char *)&write_size, &write_len, error);
-	if (write_len != 4)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	else
-		status = MB_SUCCESS;
-
-	/* write the record label */
-	if (status == MB_SUCCESS)
-		{
-		labelchar = (char *) &label;
-		labelchar[0] = EM3_START_BYTE;
-		labelchar[1] = EM3_ID_BATH2;
-		write_len = 2;
-		status = mb_fileio_put(verbose, mbio_ptr, (char *)&label, &write_len, error);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[1];
-		}
-
-	/* write the sonar id */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_short(swap, (short) (store->sonar), (void *) &label);
-		write_len = 2;
-		status = mb_fileio_put(verbose, mbio_ptr, (char *)&label, &write_len, error);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[0];
-		checksum += uchar_ptr[1];
-		}
-
-	/* output binary header data */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_int(swap, (int) ping->png_date, (void *) &line[0]);
-		mb_put_binary_int(swap, (int) ping->png_msec, (void *) &line[4]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_count, (void *) &line[8]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_serial, (void *) &line[10]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_heading, (void *) &line[12]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_ssv, (void *) &line[14]);
-		mb_put_binary_float(swap, (float) ping->png_xducer_depth, (void *) &line[16]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_nbeams, (void *) &line[20]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_nbeams_valid, (void *) &line[22]);
-		mb_put_binary_float(swap, (float) ping->png_sample_rate, (void *) &line[24]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_spare, (void *) &line[28]);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM3_BATH2_HEADER_SIZE;j++)
-		    checksum += uchar_ptr[j];
-
-		/* write out data */
-		write_len = EM3_BATH2_HEADER_SIZE;
-		status = mb_fileio_put(verbose, mbio_ptr, line, &write_len, error);
-		}
-
-	/* output binary beam data */
-	if (status == MB_SUCCESS)
-	    for (i=0;i<ping->png_nbeams;i++)
-		{
-		mb_put_binary_float(swap, ping->png_depth[i], (void *) &line[0]);
-		mb_put_binary_float(swap, ping->png_acrosstrack[i], (void *) &line[4]);
-		mb_put_binary_float(swap, ping->png_alongtrack[i], (void *) &line[8]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_window[i], (void *) &line[12]);
-		line[14] = (mb_u_char) ping->png_quality[i];
-		line[15] = (mb_s_char) ping->png_iba[i];
-		line[16] = (mb_u_char) ping->png_detection[i];
-		line[17] = (mb_s_char) ping->png_clean[i];
-		mb_put_binary_short(swap, (short) ping->png_amp[i], (void *) &line[18]);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM3_BATH2_BEAM_SIZE;j++)
-		    checksum += uchar_ptr[j];
-
-		/* write out data */
-		write_len = EM3_BATH2_BEAM_SIZE;
-		status = mb_fileio_put(verbose, mbio_ptr, line, &write_len, error);
-		}
-
-	/* output end of record */
-	if (status == MB_SUCCESS)
-		{
-		line[0] = 0x00;
-		line[1] = 0x03;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		checksum += uchar_ptr[0];
-
-		/* set checksum */
-		mb_put_binary_short(swap, (unsigned short) checksum, (void *) &line[2]);
-
-		/* write out data */
-		write_len = 4;
-		status = mb_fileio_put(verbose, mbio_ptr, line, &write_len, error);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em710raw_wr_rawbeam4(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store, int *error)
-{
-	char	*function_name = "mbr_em710raw_wr_rawbeam4";
-	int	status = MB_SUCCESS;
-	struct mbsys_simrad3_ping_struct *ping;
-	char	line[EM3_RAWBEAM4_HEADER_SIZE];
-	short	label;
-	char	*labelchar;
-	size_t	write_len;
-	int	write_size;
-	unsigned short checksum;
-	mb_u_char   *uchar_ptr;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		}
-	
-	/* set which storage structure to use */
-	ping = (struct mbsys_simrad3_ping_struct *) &(store->pings[store->ping_index]);
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       png_raw_read:               %d\n",ping->png_raw_read);
-		fprintf(stderr,"dbg5       png_raw_date:                %d\n",ping->png_raw_date);
-		fprintf(stderr,"dbg5       png_raw_msec:                %d\n",ping->png_raw_msec);
-		fprintf(stderr,"dbg5       png_raw_count:               %d\n",ping->png_raw_count);
-		fprintf(stderr,"dbg5       png_raw_serial:              %d\n",ping->png_raw_serial);
-		fprintf(stderr,"dbg5       png_raw_ssv:                 %d\n",ping->png_raw_ssv);
-		fprintf(stderr,"dbg5       png_raw_ntx:                 %d\n",ping->png_raw_ntx);
-		fprintf(stderr,"dbg5       png_raw_nbeams:              %d\n",ping->png_raw_nbeams);
-		fprintf(stderr,"dbg5       png_raw_detections:          %d\n",ping->png_raw_detections);
-		fprintf(stderr,"dbg5       png_raw_sample_rate:         %f\n",ping->png_raw_sample_rate);
-		fprintf(stderr,"dbg5       png_raw_spare:               %d\n",ping->png_raw_spare);
-		fprintf(stderr,"dbg5       ------------------------------------------------------------\n");
-		fprintf(stderr,"dbg5       transmit pulse values:\n");
-		fprintf(stderr,"dbg5       tiltangle focus length offset center bandwidth waveform sector\n");
-		fprintf(stderr,"dbg5       ------------------------------------------------------------\n");
-		for (i=0;i<ping->png_raw_ntx;i++)
-			fprintf(stderr,"dbg5       %3d %5d %5d %f %f %f %4d %4d %4d %f\n",
-				i, ping->png_raw_txtiltangle[i],
-				ping->png_raw_txfocus[i], ping->png_raw_txsignallength[i],
-				ping->png_raw_txoffset[i], ping->png_raw_txcenter[i],
-				ping->png_raw_txabsorption[i], ping->png_raw_txwaveform[i],
-				ping->png_raw_txsector[i], ping->png_raw_txbandwidth[i]);
-		fprintf(stderr,"dbg5       ------------------------------------------------------------\n");
-		fprintf(stderr,"dbg5       beam values:\n");
-		fprintf(stderr,"dbg5       angle range sector amp quality window beam\n");
-		fprintf(stderr,"dbg5       ------------------------------------------------------------\n");
-		for (i=0;i<ping->png_raw_nbeams;i++)
-			fprintf(stderr,"dbg5       %3d %5d %3d %3d %4d %3d %5d %f %5d %5d %5d\n",
-				i, ping->png_raw_rxpointangle[i], ping->png_raw_rxsector[i],
-				ping->png_raw_rxdetection[i], ping->png_raw_rxwindow[i],
-				ping->png_raw_rxquality[i], ping->png_raw_rxspare1[i],
-				ping->png_raw_rxrange[i],ping->png_raw_rxamp[i],
-				ping->png_raw_rxcleaning[i],ping->png_raw_rxspare2[i]);
-		}
-
-	/* zero checksum */
-	checksum = 0;
-
-	/* write the record size */
-	mb_put_binary_int(swap, (int) (EM3_RAWBEAM4_HEADER_SIZE
-			+ EM3_RAWBEAM4_TX_SIZE * ping->png_raw_ntx
-			+ EM3_RAWBEAM4_BEAM_SIZE * ping->png_raw_nbeams + 8), (void *) &write_size);
-	write_len = 4;
-	mb_fileio_put(verbose, mbio_ptr, (char *)&write_size, &write_len, error);
-	if (write_len != 4)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	else
-		status = MB_SUCCESS;
-
-	/* write the record label */
-	if (status == MB_SUCCESS)
-		{
-		labelchar = (char *) &label;
-		labelchar[0] = EM3_START_BYTE;
-		labelchar[1] = EM3_ID_RAWBEAM4;
-		write_len = 2;
-		status = mb_fileio_put(verbose, mbio_ptr, (char *)&label, &write_len, error);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[1];
-		}
-
-	/* write the sonar id */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_short(swap, (short) (store->sonar), (void *) &label);
-		write_len = 2;
-		status = mb_fileio_put(verbose, mbio_ptr, (char *)&label, &write_len, error);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[0];
-		checksum += uchar_ptr[1];
-		}
-
-	/* output binary header data */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_int(swap, (int) ping->png_raw_date, (void *) &line[0]);
-		mb_put_binary_int(swap, (int) ping->png_raw_msec, (void *) &line[4]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_raw_count, (void *) &line[8]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_raw_serial, (void *) &line[10]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_raw_ssv, (void *) &line[12]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_raw_ntx, (void *) &line[14]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_raw_nbeams, (void *) &line[16]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_raw_detections, (void *) &line[18]);
-		mb_put_binary_float(swap, ping->png_raw_sample_rate, (void *) &line[20]);
-		mb_put_binary_int(swap, (int) ping->png_raw_spare, (void *) &line[24]);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM3_RAWBEAM4_HEADER_SIZE;j++)
-		    checksum += uchar_ptr[j];
-
-		/* write out data */
-		write_len = EM3_RAWBEAM4_HEADER_SIZE;
-		status = mb_fileio_put(verbose, mbio_ptr, line, &write_len, error);
-		}
-
-	/* output binary tx data */
-	if (status == MB_SUCCESS)
-	    for (i=0;i<ping->png_raw_ntx;i++)
-		{
-		mb_put_binary_short(swap, (short) ping->png_raw_txtiltangle[i], (void *) &line[0]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_raw_txfocus[i], (void *) &line[2]);
-		mb_put_binary_float(swap, ping->png_raw_txsignallength[i], (void *) &line[4]);
-		mb_put_binary_float(swap, ping->png_raw_txoffset[i], (void *) &line[8]);
-		mb_put_binary_float(swap, ping->png_raw_txcenter[i], (void *) &line[12]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_raw_txabsorption[i], (void *) &line[16]);
-		line[18] = (mb_u_char) ping->png_raw_txwaveform[i];
-		line[19] = (mb_u_char) ping->png_raw_txsector[i];
-		mb_put_binary_float(swap, ping->png_raw_txbandwidth[i], (void *) &line[20]);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM3_RAWBEAM4_TX_SIZE;j++)
-		    checksum += uchar_ptr[j];
-
-		/* write out data */
-		write_len = EM3_RAWBEAM4_TX_SIZE;
-		status = mb_fileio_put(verbose, mbio_ptr, line, &write_len, error);
-		}
-
-	/* output binary beam data */
-	if (status == MB_SUCCESS)
-	    for (i=0;i<ping->png_raw_nbeams;i++)
-		{
-		mb_put_binary_short(swap, (short) ping->png_raw_rxpointangle[i], (void *) &line[0]);
-		line[2] = (mb_u_char) ping->png_raw_rxsector[i];
-		line[3] = (mb_u_char) ping->png_raw_rxdetection[i];
-		mb_put_binary_short(swap, (short) ping->png_raw_rxwindow[i], (void *) &line[4]);
-		line[6] = (mb_u_char) ping->png_raw_rxquality[i];
-		line[7] = (mb_u_char) ping->png_raw_rxspare1[i];
-		mb_put_binary_float(swap, ping->png_raw_rxrange[i], (void *) &line[8]);
-		mb_put_binary_short(swap, (short) ping->png_raw_rxamp[i], (void *) &line[12]);
-		line[14] = (mb_u_char) ping->png_raw_rxcleaning[i];
-		line[15] = (mb_u_char) ping->png_raw_rxspare2[i];
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM3_RAWBEAM4_BEAM_SIZE;j++)
-		    checksum += uchar_ptr[j];
-
-		/* write out data */
-		write_len = EM3_RAWBEAM4_BEAM_SIZE;
-		status = mb_fileio_put(verbose, mbio_ptr, line, &write_len, error);
-		}
-
-	/* output end of record */
-	if (status == MB_SUCCESS)
-		{
-		line[0] = 0x00;
-		line[1] = 0x03;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		checksum += uchar_ptr[0];
-
-		/* set checksum */
-		mb_put_binary_short(swap, (unsigned short) checksum, (void *) &line[2]);
-
-		/* write out data */
-		write_len = 4;
-		status = mb_fileio_put(verbose, mbio_ptr, line, &write_len, error);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em710raw_wr_quality(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store, int *error)
-{
-	char	*function_name = "mbr_em710raw_wr_quality";
-	int	status = MB_SUCCESS;
-	struct mbsys_simrad3_ping_struct *ping;
-	char	line[EM3_QUALITY_HEADER_SIZE];
-	short	label;
-	char	*labelchar;
-	size_t	write_len;
-	int	write_size;
-	unsigned short checksum;
-	mb_u_char   *uchar_ptr;
-	int	index;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		}
-	
-	/* set which storage structure to use */
-	ping = (struct mbsys_simrad3_ping_struct *) &(store->pings[store->ping_index]);
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:                  %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:                 %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:                  %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:                  %d\n",store->msec);
-		fprintf(stderr,"dbg5       png_quality_date:              %d\n",ping->png_quality_date);
-		fprintf(stderr,"dbg5       png_quality_msec:              %d\n",ping->png_quality_msec);
-		fprintf(stderr,"dbg5       png_quality_count:             %d\n",ping->png_quality_count);
-		fprintf(stderr,"dbg5       png_quality_serial:            %d\n",ping->png_quality_serial);
-		fprintf(stderr,"dbg5       png_quality_nbeams:            %d\n",ping->png_quality_nbeams);
-		fprintf(stderr,"dbg5       png_quality_nparameters:       %d\n",ping->png_quality_nparameters);
-		fprintf(stderr,"dbg5       png_quality_spare:         v   %d\n",ping->png_quality_spare);
-		fprintf(stderr,"dbg5       cnt  quality parameters\n");
-		fprintf(stderr,"dbg5       ------------------------------------------------------------\n");
-		for (i=0;i<ping->png_quality_nbeams;i++)
-			{
-			fprintf(stderr,"dbg5       %3d ", i);
-			for (j=0;j<ping->png_quality_nparameters;j++)
-				fprintf(stderr,"%f", ping->png_quality_parameters[i][j]);
-			fprintf(stderr,"\n");
-			}
-		}
-
-	/* zero checksum */
-	checksum = 0;
-
-	/* write the record size */
-	mb_put_binary_int(swap, (int) (EM3_QUALITY_HEADER_SIZE
-			+ ping->png_quality_nbeams * ping->png_quality_nparameters * sizeof(float) + 8),
-			(void *) &write_size);
-	write_len = 4;
-	mb_fileio_put(verbose, mbio_ptr, (char *)&write_size, &write_len, error);
-
-	/* write the record label */
-	if (status == MB_SUCCESS)
-		{
-		labelchar = (char *) &label;
-		labelchar[0] = EM3_START_BYTE;
-		labelchar[1] = EM3_ID_QUALITY;
-		write_len = 2;
-		status = mb_fileio_put(verbose, mbio_ptr, (char *)&label, &write_len, error);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[1];
-		}
-
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_short(swap, (short) (store->sonar), (void *) &label);
-		write_len = 2;
-		status = mb_fileio_put(verbose, mbio_ptr, (char *)&label, &write_len, error);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[0];
-		checksum += uchar_ptr[1];
-		}
-
-	/* output binary header data */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_int(swap, (int) ping->png_quality_date, (void *) &line[0]);
-		mb_put_binary_int(swap, (int) ping->png_quality_msec, (void *) &line[4]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_quality_count, (void *) &line[8]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_quality_serial, (void *) &line[10]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_quality_nbeams, (void *) &line[12]);
-		line[14] = (mb_u_char) ping->png_quality_nparameters;
-		line[15] = (mb_u_char) ping->png_quality_spare;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM3_QUALITY_HEADER_SIZE;j++)
-		    checksum += uchar_ptr[j];
-
-		/* write out data */
-		write_len = EM3_QUALITY_HEADER_SIZE;
-		status = mb_fileio_put(verbose, mbio_ptr, line, &write_len, error);
-		}
-
-	/* output binary beam data */
-	if (status == MB_SUCCESS)
-		{
-		write_len = (size_t)(ping->png_quality_nparameters * sizeof(float));
-		for (i=0;i<ping->png_quality_nbeams;i++)
-			{
-			index = 0;
-			for (j=0;j<ping->png_quality_nparameters;j++)
-				{
-				mb_put_binary_float(swap, ping->png_quality_parameters[i][j], (void *) &line[index]);
-				index += 4;
-				}
-
-			/* compute checksum */
-			uchar_ptr = (mb_u_char *) line;
-			for (j=0;j<write_len;j++)
-			    checksum += uchar_ptr[j];
-	
-			/* write out data */
-			status = mb_fileio_put(verbose, mbio_ptr, line, &write_len, error);
-			}
-		}
-
-	/* output end of record */
-	if (status == MB_SUCCESS)
-		{
-		line[0] = 0x00;
-		line[1] = 0x03;
-
-		/* set checksum */
-		mb_put_binary_short(swap, (unsigned short) checksum, (void *) &line[2]);
-
-		/* write out data */
-		write_len = 4;
-		status = mb_fileio_put(verbose, mbio_ptr, &line[0], &write_len, error);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em710raw_wr_ss2(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store, int *error)
-{
-	char	*function_name = "mbr_em710raw_wr_ss2";
-	int	status = MB_SUCCESS;
-	struct mbsys_simrad3_ping_struct *ping;
-	char	line[EM3_SS2_HEADER_SIZE];
-	short	label;
-	char	*labelchar;
-	size_t	write_len;
-	int	write_size;
-	unsigned short checksum;
-	mb_u_char   *uchar_ptr;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		}
-	
-	/* set which storage structure to use */
-	ping = (struct mbsys_simrad3_ping_struct *) &(store->pings[store->ping_index]);
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:               %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:              %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:               %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:               %d\n",store->msec);
-		fprintf(stderr,"dbg5       png_date:           %d\n",ping->png_date);
-		fprintf(stderr,"dbg5       png_msec:           %d\n",ping->png_msec);
-
-		fprintf(stderr,"dbg5       png_date:              %d\n",ping->png_date);
-		fprintf(stderr,"dbg5       png_msec:              %d\n",ping->png_msec);
-		fprintf(stderr,"dbg5       png_count:             %d\n",ping->png_count);
-		fprintf(stderr,"dbg5       png_serial:            %d\n",ping->png_serial);
-		fprintf(stderr,"dbg5       png_heading:           %d\n",ping->png_heading);
-		fprintf(stderr,"dbg5       png_ssv:               %d\n",ping->png_ssv);
-		fprintf(stderr,"dbg5       png_xducer_depth:      %f\n",ping->png_xducer_depth);
-		fprintf(stderr,"dbg5       png_nbeams:            %d\n",ping->png_nbeams);
-		fprintf(stderr,"dbg5       png_nbeams_valid:      %d\n",ping->png_nbeams_valid);
-		fprintf(stderr,"dbg5       png_sample_rate:       %f\n",ping->png_sample_rate);
-		fprintf(stderr,"dbg5       png_spare:             %d\n",ping->png_spare);
-		fprintf(stderr,"dbg5       cnt  depth xtrack ltrack dprsn   azi   rng  qual wnd amp num\n");
-		fprintf(stderr,"dbg5       ------------------------------------------------------------\n");
-		for (i=0;i<ping->png_nbeams;i++)
-			fprintf(stderr,"dbg5       %3d %7.2f %7.2f %7.2f %5d %5d %5d %4d %3d %3d\n",
-				i, ping->png_depth[i], ping->png_acrosstrack[i],
-				ping->png_alongtrack[i], ping->png_window[i],
-				ping->png_quality[i], ping->png_iba[i],
-				ping->png_detection[i], ping->png_clean[i],
-				ping->png_amp[i]);
-
-		fprintf(stderr,"dbg5       png_ss_date:        %d\n",ping->png_ss_date);
-		fprintf(stderr,"dbg5       png_ss_msec:        %d\n",ping->png_ss_msec);
-		fprintf(stderr,"dbg5       png_ss_count:       %d\n",ping->png_ss_count);
-		fprintf(stderr,"dbg5       png_ss_serial:      %d\n",ping->png_ss_serial);
-		fprintf(stderr,"dbg5       png_ss_sample_rate: %f\n",ping->png_ss_sample_rate);
-		fprintf(stderr,"dbg5       png_r_zero:         %d\n",ping->png_r_zero);
-		fprintf(stderr,"dbg5       png_bsn:            %d\n",ping->png_bsn);
-		fprintf(stderr,"dbg5       png_bso:            %d\n",ping->png_bso);
-		fprintf(stderr,"dbg5       png_tx:             %d\n",ping->png_tx);
-		fprintf(stderr,"dbg5       png_tvg_crossover:  %d\n",ping->png_tvg_crossover);
-		fprintf(stderr,"dbg5       png_nbeams_ss:      %d\n",ping->png_nbeams_ss);
-		fprintf(stderr,"dbg5       png_npixels:        %d\n",ping->png_npixels);
-		fprintf(stderr,"dbg5       cnt  index sort samples start center\n");
-		fprintf(stderr,"dbg5       --------------------------------------------------\n");
-		for (i=0;i<ping->png_nbeams_ss;i++)
-			fprintf(stderr,"dbg5        %4d %2d %4d %4d %4d %4d\n",
-				i, ping->png_sort_direction[i], ping->png_ssdetection[i],
-				ping->png_beam_samples[i], ping->png_start_sample[i],
-				ping->png_center_sample[i]);
-		fprintf(stderr,"dbg5       cnt  ss\n");
-		fprintf(stderr,"dbg5       --------------------------------------------------\n");
-		for (i=0;i<ping->png_npixels;i++)
-			fprintf(stderr,"dbg5        %d %d\n",
-				i, ping->png_ssraw[i]);
-		}
-
-	/* zero checksum */
-	checksum = 0;
-
-	/* write the record size */
-	mb_put_binary_int(swap, (int) (EM3_SS2_HEADER_SIZE
-			+ EM3_SS2_BEAM_SIZE * ping->png_nbeams_ss
-			+ sizeof(short) * ping->png_npixels + 8), (void *) &write_size);
-	write_len = 4;
-	mb_fileio_put(verbose, mbio_ptr, (char *)&write_size, &write_len, error);
-
-	/* write the record label */
-	if (status == MB_SUCCESS)
-		{
-		labelchar = (char *) &label;
-		labelchar[0] = EM3_START_BYTE;
-		labelchar[1] = EM3_ID_SS2;
-		write_len = 2;
-		status = mb_fileio_put(verbose, mbio_ptr, (char *)&label, &write_len, error);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[1];
-		}
-
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_short(swap, (short) (store->sonar), (void *) &label);
-		write_len = 2;
-		status = mb_fileio_put(verbose, mbio_ptr, (char *)&label, &write_len, error);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[0];
-		checksum += uchar_ptr[1];
-		}
-
-	/* output binary header data */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_int(swap, (int) ping->png_ss_date, (void *) &line[0]);
-		mb_put_binary_int(swap, (int) ping->png_ss_msec, (void *) &line[4]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_ss_count, (void *) &line[8]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_ss_serial, (void *) &line[10]);
-		mb_put_binary_float(swap, ping->png_ss_sample_rate, (void *) &line[12]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_r_zero, (void *) &line[16]);
-		mb_put_binary_short(swap, (short) ping->png_bsn, (void *) &line[18]);
-		mb_put_binary_short(swap, (short) ping->png_bso, (void *) &line[20]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_tx, (void *) &line[22]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_tvg_crossover, (void *) &line[24]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_nbeams_ss, (void *) &line[26]);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM3_SS2_HEADER_SIZE;j++)
-		    checksum += uchar_ptr[j];
-
-		/* write out data */
-		write_len = EM3_SS2_HEADER_SIZE;
-		status = mb_fileio_put(verbose, mbio_ptr, line, &write_len, error);
-		}
-
-	/* output binary beam data */
-	if (status == MB_SUCCESS)
-	    for (i=0;i<ping->png_nbeams_ss;i++)
-		{
-		line[0] = (mb_s_char) ping->png_sort_direction[i];
-		line[1] = (mb_u_char) ping->png_ssdetection[i];
-		mb_put_binary_short(swap, (unsigned short) ping->png_beam_samples[i], (void *) &line[2]);
-		mb_put_binary_short(swap, (unsigned short) ping->png_center_sample[i], (void *) &line[4]);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM3_SS2_BEAM_SIZE;j++)
-		    checksum += uchar_ptr[j];
-
-		/* write out data */
-		write_len = EM3_SS2_BEAM_SIZE;
-		status = mb_fileio_put(verbose, mbio_ptr, line, &write_len, error);
-		}
-
-	/* output sidescan data */
-	if (status == MB_SUCCESS)
-		{
-		write_size = 2 * ping->png_npixels;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) ping->png_ssraw;
-		for (j=0;j<write_size;j++)
-		    checksum += uchar_ptr[j];
-
-		write_len = write_size;
-		status = mb_fileio_put(verbose, mbio_ptr, (char *)ping->png_ssraw, &write_len, error);
-		}
-
-	/* output end of record */
-	if (status == MB_SUCCESS)
-		{
-		line[0] = 0;
-		line[1] = 0x03;
-
-		/* set checksum */
-		mb_put_binary_short(swap, (unsigned short) checksum, (void *) &line[2]);
-
-		/* write out data */
-		write_len = 4;
-		status = mb_fileio_put(verbose, mbio_ptr, line, &write_len, error);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_em710raw_wr_wc(int verbose, void *mbio_ptr, int swap,
-		struct mbsys_simrad3_struct *store, int *error)
-{
-	char	*function_name = "mbr_em710raw_wr_wc";
-	int	status = MB_SUCCESS;
-	struct mbsys_simrad3_watercolumn_struct *wc;
-	char	line[EM3_WC_HEADER_SIZE];
-	short	label;
-	char	*labelchar;
-	size_t	write_len;
-	int	write_size;
-	unsigned short checksum;
-	mb_u_char   *uchar_ptr;
-	int	record_size;
-	int	pad;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       swap:       %d\n",swap);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		}
-
-	/* get storage structure */
-	wc = (struct mbsys_simrad3_watercolumn_struct *) store->wc;
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       type:            %d\n",store->type);
-		fprintf(stderr,"dbg5       sonar:           %d\n",store->sonar);
-		fprintf(stderr,"dbg5       date:            %d\n",store->date);
-		fprintf(stderr,"dbg5       msec:            %d\n",store->msec);
-		fprintf(stderr,"dbg5       wtc_date:        %d\n",wc->wtc_date);
-		fprintf(stderr,"dbg5       wtc_msec:        %d\n",wc->wtc_msec);
-		fprintf(stderr,"dbg5       wtc_count:       %d\n",wc->wtc_count);
-		fprintf(stderr,"dbg5       wtc_serial:      %d\n",wc->wtc_serial);
-		fprintf(stderr,"dbg5       wtc_ndatagrams:  %d\n",wc->wtc_ndatagrams);
-		fprintf(stderr,"dbg5       wtc_datagram:    %d\n",wc->wtc_datagram);
-		fprintf(stderr,"dbg5       wtc_ntx:         %d\n",wc->wtc_ntx);
-		fprintf(stderr,"dbg5       wtc_nrx:         %d\n",wc->wtc_nrx);
-		fprintf(stderr,"dbg5       wtc_nbeam:       %d\n",wc->wtc_nbeam);
-		fprintf(stderr,"dbg5       wtc_ssv:         %d\n",wc->wtc_ssv);
-		fprintf(stderr,"dbg5       wtc_sfreq:       %d\n",wc->wtc_sfreq);
-		fprintf(stderr,"dbg5       wtc_heave:       %d\n",wc->wtc_heave);
-		fprintf(stderr,"dbg5       wtc_spare1:      %d\n",wc->wtc_spare1);
-		fprintf(stderr,"dbg5       wtc_spare2:      %d\n",wc->wtc_spare2);
-		fprintf(stderr,"dbg5       wtc_spare3:      %d\n",wc->wtc_spare3);
-		fprintf(stderr,"dbg5       ---------------------------\n");
-		fprintf(stderr,"dbg5       cnt  tilt center sector\n");
-		fprintf(stderr,"dbg5       ---------------------------\n");
-		for (i=0;i<wc->wtc_ntx;i++)
-			fprintf(stderr,"dbg5       %3d %6d %6d %6d\n",
-				i, wc->wtc_txtiltangle[i], wc->wtc_txcenter[i],
-				wc->wtc_txsector[i]);
-		for (i=0;i<wc->wtc_nbeam;i++)
-			{
-			fprintf(stderr,"dbg5       --------------------------------------------------\n");
-			fprintf(stderr,"dbg5       cnt  angle start samples unknown sector beam\n");
-			fprintf(stderr,"dbg5       --------------------------------------------------\n");
-			fprintf(stderr,"dbg5        %4d %3d %2d %4d %4d %4d %4d\n",
-				i, wc->beam[i].wtc_rxpointangle,
-				wc->beam[i].wtc_start_sample,
-				wc->beam[i].wtc_beam_samples,
-				wc->beam[i].wtc_beam_spare,
-				wc->beam[i].wtc_sector,
-				wc->beam[i].wtc_beam);
-/*			fprintf(stderr,"dbg5       --------------------------------------------------\n");
-			fprintf(stderr,"dbg5       beam[%d]: sample amplitude\n",i);
-			fprintf(stderr,"dbg5       --------------------------------------------------\n");
-			for (j=0;j<wc->beam[i].wtc_beam_samples;j++)
-				fprintf(stderr,"dbg5        %4d %4d\n",
-					j, wc->beam[i].wtc_amp[j]);*/
-			}
-		}
-
-	/* zero checksum */
-	checksum = 0;
-
-	/* write the record size */
-	record_size = EM3_WC_HEADER_SIZE
-			+ EM3_WC_BEAM_SIZE * wc->wtc_nbeam
-			+ EM3_WC_TX_SIZE * wc->wtc_ntx + 8;
-	for (i=0;i<wc->wtc_nbeam;i++)
-		{
-		record_size += wc->beam[i].wtc_beam_samples;
-		}
-	pad = (record_size % 2);
-	record_size += pad;
-	mb_put_binary_int(swap, record_size, (void *) &write_size);
-	write_len = 4;
-	mb_fileio_put(verbose, mbio_ptr, (char *)&write_size, &write_len, error);
-	if (write_len != 4)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	else
-		status = MB_SUCCESS;
-
-	/* write the record label */
-	if (status == MB_SUCCESS)
-		{
-		labelchar = (char *) &label;
-		labelchar[0] = EM3_START_BYTE;
-		labelchar[1] = EM3_ID_WATERCOLUMN;
-		write_len = 2;
-		status = mb_fileio_put(verbose, mbio_ptr, (char *)&label, &write_len, error);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[1];
-		}
-
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_short(swap, (short) (store->sonar), (void *) &label);
-		write_len = 2;
-		status = mb_fileio_put(verbose, mbio_ptr, (char *)&label, &write_len, error);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) &label;
-		checksum += uchar_ptr[0];
-		checksum += uchar_ptr[1];
-		}
-
-	/* output binary header data */
-	if (status == MB_SUCCESS)
-		{
-		mb_put_binary_int(swap, (int) wc->wtc_date, (void *) &line[0]);
-		mb_put_binary_int(swap, (int) wc->wtc_msec, (void *) &line[4]);
-		mb_put_binary_short(swap, (unsigned short) wc->wtc_count, (void *) &line[8]);
-		mb_put_binary_short(swap, (unsigned short) wc->wtc_serial, (void *) &line[10]);
-		mb_put_binary_short(swap, (unsigned short) wc->wtc_ndatagrams, (void *) &line[12]);
-		mb_put_binary_short(swap, (unsigned short) wc->wtc_datagram, (void *) &line[14]);
-		mb_put_binary_short(swap, (unsigned short) wc->wtc_ntx, (void *) &line[16]);
-		mb_put_binary_short(swap, (unsigned short) wc->wtc_nrx, (void *) &line[18]);
-		mb_put_binary_short(swap, (unsigned short) wc->wtc_nbeam, (void *) &line[20]);
-		mb_put_binary_short(swap, (unsigned short) wc->wtc_ssv, (void *) &line[22]);
-		mb_put_binary_int(swap, (int) wc->wtc_sfreq, (void *) &line[24]);
-		mb_put_binary_short(swap, (short) wc->wtc_heave, (void *) &line[28]);
-		mb_put_binary_short(swap, (unsigned short) wc->wtc_spare1, (void *) &line[30]);
-		mb_put_binary_short(swap, (unsigned short) wc->wtc_spare2, (void *) &line[32]);
-		mb_put_binary_short(swap, (unsigned short) wc->wtc_spare3, (void *) &line[34]);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM3_WC_HEADER_SIZE;j++)
-		    checksum += uchar_ptr[j];
-
-		/* write out data */
-		write_len = EM3_WC_HEADER_SIZE;
-		status = mb_fileio_put(verbose, mbio_ptr, line, &write_len, error);
-		}
-
-	/* output binary beam data */
-	if (status == MB_SUCCESS)
-	    {
-	    for (i=0;i<wc->wtc_ntx;i++)
-		{
-		mb_put_binary_short(swap, (short) wc->wtc_txtiltangle[i], (void *) &line[0]);
-		mb_put_binary_short(swap, (unsigned short) wc->wtc_txcenter[i], (void *) &line[2]);
-		line[4] = (mb_u_char) wc->wtc_txsector[i];
-		line[5] = (mb_u_char) 0;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM3_WC_TX_SIZE;j++)
-		    checksum += uchar_ptr[j];
-
-		/* write out data */
-		write_len = EM3_WC_TX_SIZE;
-		status = mb_fileio_put(verbose, mbio_ptr, line, &write_len, error);
-		}
-	    for (i=0;i<wc->wtc_nbeam;i++)
-		{
-		mb_put_binary_short(swap, (short) wc->beam[i].wtc_rxpointangle, (void *) &line[0]);
-		mb_put_binary_short(swap, (unsigned short) wc->beam[i].wtc_start_sample, (void *) &line[2]);
-		mb_put_binary_short(swap, (unsigned short) wc->beam[i].wtc_beam_samples, (void *) &line[4]);
-		mb_put_binary_short(swap, (unsigned short) wc->beam[i].wtc_beam_spare, (void *) &line[6]);
-		line[8] = (mb_u_char) wc->beam[i].wtc_sector;
-		line[9] = (mb_u_char) wc->beam[i].wtc_beam;
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) line;
-		for (j=0;j<EM3_WC_BEAM_SIZE;j++)
-		    checksum += uchar_ptr[j];
-
-		/* write out data */
-		write_len = EM3_WC_BEAM_SIZE;
-		status = mb_fileio_put(verbose, mbio_ptr, line, &write_len, error);
-
-		/* compute checksum */
-		uchar_ptr = (mb_u_char *) wc->beam[i].wtc_amp;
-		for (j=0;j<wc->beam[i].wtc_beam_samples;j++)
-		    checksum += uchar_ptr[j];
-
-		/* write out data */
-		write_len = wc->beam[i].wtc_beam_samples;
-		status = mb_fileio_put(verbose, mbio_ptr, (char *)wc->beam[i].wtc_amp, &write_len, error);
-		}
-	    }
-
-	/* output end of record */
-	if (status == MB_SUCCESS)
-		{
-		if (pad == 1)
-			{
-			line[0] = 0;
-			checksum += line[0];
-			}
-		line[1] = 0x03;
-
-		/* set checksum */
-		mb_put_binary_short(swap, (unsigned short) checksum, (void *) &line[2]);
-
-		/* write out data */
-		write_len = 3+pad;
-		status = mb_fileio_put(verbose, mbio_ptr, &line[!pad], &write_len, error);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mbr_emoldraw.c b/src/mbio/mbr_emoldraw.c
deleted file mode 100644
index db0f436..0000000
--- a/src/mbio/mbr_emoldraw.c
+++ /dev/null
@@ -1,4955 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbr_emoldraw.c	3/4/2001
- *	$Id: mbr_emoldraw.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 2001-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbr_emoldraw.c contains the functions for reading and writing
- * multibeam data in the emoldraw format.
- * These functions include:
- *   mbr_alm_emoldraw	- allocate read/write memory
- *   mbr_dem_emoldraw	- deallocate read/write memory
- *   mbr_rt_emoldraw	- read and translate data
- *   mbr_wt_emoldraw	- translate and write data
- *
- * Author:	D. W. Caress
- * Date:	March 4, 2001
- *
- * $Log: mbr_emoldraw.c,v $
- * Revision 5.12  2008/03/01 09:14:03  caress
- * Some housekeeping changes.
- *
- * Revision 5.11  2007/06/18 01:19:48  caress
- * Changes as of 17 June 2007.
- *
- * Revision 5.10  2006/01/24 19:11:17  caress
- * Version 5.0.8 beta.
- *
- * Revision 5.9  2005/11/05 00:48:04  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.8  2003/12/04 23:10:23  caress
- * Fixed problems with format 54 EM12DARW due to old code assuming how internal structure was packed. Also changed handling of beamflags for formats that don't support beamflags. Now flagged beams will always be nulled in such cases.
- *
- * Revision 5.7  2003/05/20 18:05:32  caress
- * Added svp_source to data source parameters.
- *
- * Revision 5.6  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.5  2002/10/02 23:55:42  caress
- * Release 5.0.beta24
- *
- * Revision 5.4  2002/08/21 00:55:46  caress
- * Release 5.0.beta22
- *
- * Revision 5.3  2002/07/20 20:42:40  caress
- * Release 5.0.beta20
- *
- * Revision 5.2  2001/07/20 00:31:11  caress
- * Release 5.0.beta03
- *
- * Revision 5.1  2001/06/08  21:44:01  caress
- * Version 5.0.beta01
- *
- * Revision 5.0  2001/03/22  20:49:19  caress
- * Trying to make version 5.0.beta0
- *
- *
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mb_define.h"
-#include "mbsys_simrad.h"
-
-/* include for byte swapping */
-#include "mb_swap.h"
-
-/* turn on debug statements here */
-/*#define MBR_EMOLDRAW_DEBUG 1*/
-
-/* essential function prototypes */
-int mbr_register_emoldraw(int verbose, void *mbio_ptr, int *error);
-int mbr_info_emoldraw(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_alm_emoldraw(int verbose, void *mbio_ptr, int *error);
-int mbr_dem_emoldraw(int verbose, void *mbio_ptr, int *error);
-int mbr_rt_emoldraw(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_wt_emoldraw(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_emoldraw_rd_data(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_emoldraw_chk_label(int verbose, void *mbio_ptr, short type);
-int mbr_emoldraw_rd_start(int verbose, FILE *mbfp,
-		struct mbsys_simrad_struct *store, int *error);
-int mbr_emoldraw_rd_stop(int verbose, FILE *mbfp,
-		struct mbsys_simrad_struct *store, int *error);
-int mbr_emoldraw_rd_parameter(int verbose, FILE *mbfp,
-		struct mbsys_simrad_struct *store, int *error);
-int mbr_emoldraw_rd_pos(int verbose, FILE *mbfp,
-		struct mbsys_simrad_struct *store, int *error);
-int mbr_emoldraw_rd_svp(int verbose, FILE *mbfp,
-		struct mbsys_simrad_struct *store, int *error);
-int mbr_emoldraw_rd_em1000bath(int verbose, FILE *mbfp,
-		struct mbsys_simrad_struct *store, int *error);
-int mbr_emoldraw_rd_em12bath(int verbose, FILE *mbfp,
-		struct mbsys_simrad_struct *store, int swath_id, int *error);
-int mbr_emoldraw_rd_em121bath(int verbose, FILE *mbfp,
-		struct mbsys_simrad_struct *store, int *error);
-int mbr_emoldraw_rd_ss(int verbose, FILE *mbfp,
-		struct mbsys_simrad_struct *store,
-		int swath_id, int first, int *more, int *error);
-int mbr_emoldraw_rd_ssp(int verbose, FILE *mbfp,
-		struct mbsys_simrad_struct *store,
-		int swath_id, int first, int *more, int *error);
-int mbr_emoldraw_wr_data(int verbose, void *mbio_ptr,
-				void *store_ptr, int *error);
-int mbr_emoldraw_wr_start(int verbose, FILE *mbfp,
-				struct mbsys_simrad_struct *store, int *error);
-int mbr_emoldraw_wr_stop(int verbose, FILE *mbfp,
-				struct mbsys_simrad_struct *store, int *error);
-int mbr_emoldraw_wr_parameter(int verbose, FILE *mbfp,
-				struct mbsys_simrad_struct *store, int *error);
-int mbr_emoldraw_wr_pos(int verbose, FILE *mbfp,
-				struct mbsys_simrad_struct *store, int *error);
-int mbr_emoldraw_wr_svp(int verbose, FILE *mbfp,
-				struct mbsys_simrad_struct *store, int *error);
-int mbr_emoldraw_wr_em1000bath(int verbose, FILE *mbfp,
-				struct mbsys_simrad_struct *store, int *error);
-int mbr_emoldraw_wr_em12bath(int verbose, FILE *mbfp,
-				struct mbsys_simrad_struct *store, int *error);
-int mbr_emoldraw_wr_em121bath(int verbose, FILE *mbfp,
-				struct mbsys_simrad_struct *store, int *error);
-int mbr_emoldraw_wr_ss(int verbose, FILE *mbfp,
-				struct mbsys_simrad_struct *store, int *error);
-int mbr_emoldraw_wr_ssp(int verbose, FILE *mbfp,
-				struct mbsys_simrad_struct *store, int *error);
-
-static char rcs_id[]="$Id: mbr_emoldraw.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mbr_register_emoldraw(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_register_emoldraw";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* get mb_io_ptr */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set format info parameters */
-	status = mbr_info_emoldraw(verbose,
-			&mb_io_ptr->system,
-			&mb_io_ptr->beams_bath_max,
-			&mb_io_ptr->beams_amp_max,
-			&mb_io_ptr->pixels_ss_max,
-			mb_io_ptr->format_name,
-			mb_io_ptr->system_name,
-			mb_io_ptr->format_description,
-			&mb_io_ptr->numfile,
-			&mb_io_ptr->filetype,
-			&mb_io_ptr->variable_beams,
-			&mb_io_ptr->traveltime,
-			&mb_io_ptr->beam_flagging,
-			&mb_io_ptr->nav_source,
-			&mb_io_ptr->heading_source,
-			&mb_io_ptr->vru_source,
-			&mb_io_ptr->svp_source,
-			&mb_io_ptr->beamwidth_xtrack,
-			&mb_io_ptr->beamwidth_ltrack,
-			error);
-
-	/* set format and system specific function pointers */
-	mb_io_ptr->mb_io_format_alloc = &mbr_alm_emoldraw;
-	mb_io_ptr->mb_io_format_free = &mbr_dem_emoldraw;
-	mb_io_ptr->mb_io_store_alloc = &mbsys_simrad_alloc;
-	mb_io_ptr->mb_io_store_free = &mbsys_simrad_deall;
-	mb_io_ptr->mb_io_read_ping = &mbr_rt_emoldraw;
-	mb_io_ptr->mb_io_write_ping = &mbr_wt_emoldraw;
-	mb_io_ptr->mb_io_dimensions = &mbsys_simrad_dimensions;
-	mb_io_ptr->mb_io_extract = &mbsys_simrad_extract;
-	mb_io_ptr->mb_io_insert = &mbsys_simrad_insert;
-	mb_io_ptr->mb_io_extract_nav = &mbsys_simrad_extract_nav;
-	mb_io_ptr->mb_io_insert_nav = &mbsys_simrad_insert_nav;
-	mb_io_ptr->mb_io_extract_altitude = &mbsys_simrad_extract_altitude;
-	mb_io_ptr->mb_io_insert_altitude = NULL;
-	mb_io_ptr->mb_io_extract_svp = &mbsys_simrad_extract_svp;
-	mb_io_ptr->mb_io_insert_svp = &mbsys_simrad_insert_svp;
-	mb_io_ptr->mb_io_ttimes = &mbsys_simrad_ttimes;
-	mb_io_ptr->mb_io_detects = &mbsys_simrad_detects;
-	mb_io_ptr->mb_io_gains = &mbsys_simrad_gains;
-	mb_io_ptr->mb_io_copyrecord = &mbsys_simrad_copy;
-	mb_io_ptr->mb_io_extract_rawss = NULL;
-	mb_io_ptr->mb_io_insert_rawss = NULL;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",mb_io_ptr->system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",mb_io_ptr->beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",mb_io_ptr->beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",mb_io_ptr->pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",mb_io_ptr->format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",mb_io_ptr->system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",mb_io_ptr->format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",mb_io_ptr->numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",mb_io_ptr->filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",mb_io_ptr->variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",mb_io_ptr->traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",mb_io_ptr->beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",mb_io_ptr->nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",mb_io_ptr->heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",mb_io_ptr->vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",mb_io_ptr->svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",mb_io_ptr->beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",mb_io_ptr->beamwidth_ltrack);
-		fprintf(stderr,"dbg2       format_alloc:       %p\n",(void *)mb_io_ptr->mb_io_format_alloc);
-		fprintf(stderr,"dbg2       format_free:        %p\n",(void *)mb_io_ptr->mb_io_format_free);
-		fprintf(stderr,"dbg2       store_alloc:        %p\n",(void *)mb_io_ptr->mb_io_store_alloc);
-		fprintf(stderr,"dbg2       store_free:         %p\n",(void *)mb_io_ptr->mb_io_store_free);
-		fprintf(stderr,"dbg2       read_ping:          %p\n",(void *)mb_io_ptr->mb_io_read_ping);
-		fprintf(stderr,"dbg2       write_ping:         %p\n",(void *)mb_io_ptr->mb_io_write_ping);
-		fprintf(stderr,"dbg2       extract:            %p\n",(void *)mb_io_ptr->mb_io_extract);
-		fprintf(stderr,"dbg2       insert:             %p\n",(void *)mb_io_ptr->mb_io_insert);
-		fprintf(stderr,"dbg2       extract_nav:        %p\n",(void *)mb_io_ptr->mb_io_extract_nav);
-		fprintf(stderr,"dbg2       insert_nav:         %p\n",(void *)mb_io_ptr->mb_io_insert_nav);
-		fprintf(stderr,"dbg2       extract_altitude:   %p\n",(void *)mb_io_ptr->mb_io_extract_altitude);
-		fprintf(stderr,"dbg2       insert_altitude:    %p\n",(void *)mb_io_ptr->mb_io_insert_altitude);
-		fprintf(stderr,"dbg2       extract_svp:        %p\n",(void *)mb_io_ptr->mb_io_extract_svp);
-		fprintf(stderr,"dbg2       insert_svp:         %p\n",(void *)mb_io_ptr->mb_io_insert_svp);
-		fprintf(stderr,"dbg2       ttimes:             %p\n",(void *)mb_io_ptr->mb_io_ttimes);
-		fprintf(stderr,"dbg2       detects:            %p\n",(void *)mb_io_ptr->mb_io_detects);
-		fprintf(stderr,"dbg2       extract_rawss:      %p\n",(void *)mb_io_ptr->mb_io_extract_rawss);
-		fprintf(stderr,"dbg2       insert_rawss:       %p\n",(void *)mb_io_ptr->mb_io_insert_rawss);
-		fprintf(stderr,"dbg2       copyrecord:         %p\n",(void *)mb_io_ptr->mb_io_copyrecord);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbr_info_emoldraw(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error)
-{
-	char	*function_name = "mbr_info_emoldraw";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* set format info parameters */
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-	*system = MB_SYS_SIMRAD;
-	*beams_bath_max = MBSYS_SIMRAD_MAXBEAMS;
-	*beams_amp_max = MBSYS_SIMRAD_MAXBEAMS;
-	*pixels_ss_max = MBSYS_SIMRAD_MAXPIXELS;
-	strncpy(format_name, "EMOLDRAW", MB_NAME_LENGTH);
-	strncpy(system_name, "SIMRAD", MB_NAME_LENGTH);
-	strncpy(format_description, "Format name:          MBF_EMOLDRAW\nInformal Description: Old Simrad vendor multibeam format\nAttributes:           Simrad EM1000, EM12S, EM12D, \n                      and EM121 multibeam sonars,\n                      bathymetry, amplitude, and sidescan,\n                      60 beams for EM1000, 81 beams for EM12S/D,\n		      121 beams for EM121, variable pixels,\n		      ascii + binary, Simrad.\n", MB_DESCRIPTION_LENGTH);
-	*numfile = 1;
-	*filetype = MB_FILETYPE_NORMAL;
-	*variable_beams = MB_NO;
-	*traveltime = MB_YES;
-	*beam_flagging = MB_NO;
-	*nav_source = MB_DATA_NAV;
-	*heading_source = MB_DATA_DATA;
-	*vru_source = MB_DATA_DATA;
-	*svp_source = MB_DATA_VELOCITY_PROFILE;
-	*beamwidth_xtrack = 2.0;
-	*beamwidth_ltrack = 2.0;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",*system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",*beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",*beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",*pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",*numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",*filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",*variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",*traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",*beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",*nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",*heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",*vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",*svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",*beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",*beamwidth_ltrack);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_alm_emoldraw(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_alm_emoldraw";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	int	*wrapper;
-	double	*pixel_size;
-	double	*swath_width;
-	int	*num_bathrec;
-	int	*num_ssrec;
-	int	*file_has_ss;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set initial status */
-	status = MB_SUCCESS;
-
-	/* allocate memory for data structure */
-	mb_io_ptr->structure_size = 0;
-	mb_io_ptr->data_structure_size = 0;
-	status = mbsys_simrad_alloc(
-			verbose,mbio_ptr,
-			&mb_io_ptr->store_data,error);
-
-	/* initialize saved variables */
-	wrapper = (int *) &mb_io_ptr->save5;
-	pixel_size = (double *) &mb_io_ptr->saved1;
-	swath_width = (double *) &mb_io_ptr->saved2;
-	num_bathrec = (int *) &mb_io_ptr->save6;
-	num_ssrec = (int *) &mb_io_ptr->save7;
-	file_has_ss = (int *) &mb_io_ptr->save8;
-	*wrapper = -1;
-	*pixel_size = 0.0;
-	*swath_width = 0.0;
-	*num_bathrec = 0;
-	*num_ssrec = 0;
-	*file_has_ss = MB_YES;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_dem_emoldraw(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_dem_emoldraw";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointers to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* deallocate memory for data descriptor */
-	status = mbsys_simrad_deall(
-			verbose,mbio_ptr,
-			&mb_io_ptr->store_data,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_rt_emoldraw(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_rt_emoldraw";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_simrad_struct *store;
-	struct mbsys_simrad_survey_struct *ping;
-	int	ntime_i[7];
-	double	ntime_d;
-	int	ptime_i[7];
-	double	ptime_d;
-	double	rawspeed, pheading;
-	double	plon, plat, pspeed;
-	double	*pixel_size;
-	double	*swath_width;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointers to mbio descriptor and data structures */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-	store = (struct mbsys_simrad_struct *) store_ptr;
-	pixel_size = (double *) &mb_io_ptr->saved1;
-	swath_width = (double *) &mb_io_ptr->saved2;
-
-	/* read next data from file */
-	status = mbr_emoldraw_rd_data(verbose,mbio_ptr,store_ptr,error);
-
-	/* set error and kind in mb_io_ptr */
-	mb_io_ptr->new_error = *error;
-	mb_io_ptr->new_kind = store->kind;
-
-	/* save fix if nav data */
-	if (status == MB_SUCCESS
-		&& store->kind == MB_DATA_NAV)
-		{
-		/* get nav time */
-		mb_fix_y2k(verbose, store->pos_year,
-			    &ntime_i[0]);
-		ntime_i[1] = store->pos_month;
-		ntime_i[2] = store->pos_day;
-		ntime_i[3] = store->pos_hour;
-		ntime_i[4] = store->pos_minute;
-		ntime_i[5] = store->pos_second;
-		ntime_i[6] = 10000 * store->pos_centisecond;
-		mb_get_time(verbose, ntime_i, &ntime_d);
-
-		/* add latest fix */
-		mb_navint_add(verbose, mbio_ptr,
-			ntime_d,
-			store->pos_longitude,
-			store->pos_latitude,
-			error);
-		}
-
-	/* handle navigation interpolation and generate sidescan */
-	if (status == MB_SUCCESS
-		&& store->kind == MB_DATA_DATA)
-		{
-		/* get ping structure */
-		ping = (struct mbsys_simrad_survey_struct *) store->ping;
-
-		/* get ping time */
-		mb_fix_y2k(verbose, store->year,
-			    &ptime_i[0]);
-		ptime_i[1] = store->month;
-		ptime_i[2] = store->day;
-		ptime_i[3] = store->hour;
-		ptime_i[4] = store->minute;
-		ptime_i[5] = store->second;
-		ptime_i[6] = 10000*store->centisecond;
-		mb_get_time(verbose, ptime_i, &ptime_d);
-
-		/* interpolate from saved nav */
-		rawspeed =  3.6 * store->speed;
-		pheading = store->line_heading;
-		mb_navint_interp(verbose, mbio_ptr, ptime_d, pheading, rawspeed,
-				    &plon, &plat, &pspeed, error);
-
-		/* print debug statements */
-		if (verbose >= 4)
-			{
-			fprintf(stderr,"dbg4       Interpolated Navigation:\n");
-			fprintf(stderr,"dbg4       longitude:  %f\n", plon);
-			fprintf(stderr,"dbg4       latitude:   %f\n", plat);
-			fprintf(stderr,"dbg4       speed:      %f\n", pspeed);
-			}
-
-		/* adopt interpolated navigation */
-		ping->longitude = plon;
-		ping->latitude = plat;
-
-		/* generate sidescan */
-		ping->pixel_size = 0.0;
-		ping->pixels_ss = 0;
-		status = mbsys_simrad_makess(verbose,
-				mbio_ptr, store_ptr,
-				MB_NO, pixel_size,
-				MB_NO, swath_width,
-				0,
-				error);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_wt_emoldraw(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_wt_emoldraw";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_simrad_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_simrad_struct *) store_ptr;
-
-	/* write next data to file */
-	status = mbr_emoldraw_wr_data(verbose,mbio_ptr,store_ptr,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_emoldraw_rd_data(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_emoldraw_rd_data";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_simrad_struct *store;
-	FILE	*mbfp;
-	int	done;
-	int	*wrapper;
-	char	*label;
-	int	*label_save_flag;
-	short int expect;
-	short int *type;
-	short int first_type;
-	int	first_ss;
-	int	more_ss;
-	short int *expect_save;
-	int	*expect_save_flag;
-	short int *first_type_save;
-	int	*first_ss_save;
-	int	*more_ss_save;
-	int	*num_bathrec;
-	int	*num_ssrec;
-	int	*file_has_ss;
-	int	read_len;
-	int	skip = 0;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-	mbfp = mb_io_ptr->mbfp;
-	store = (struct mbsys_simrad_struct *) store_ptr;
-
-	/* get saved values */
-	wrapper = (int *) &mb_io_ptr->save5;
-	label = (char *) mb_io_ptr->save_label;
-	type = (short int *) mb_io_ptr->save_label;
-	label_save_flag = (int *) &mb_io_ptr->save_label_flag;
-	expect_save_flag = (int *) &mb_io_ptr->save_flag;
-	expect_save = (short int *) &mb_io_ptr->save1;
-	first_type_save = (short int *) &mb_io_ptr->save2;
-	first_ss_save = (int *) &mb_io_ptr->save3;
-	more_ss_save = (int *) &mb_io_ptr->save4;
-	num_bathrec = (int *) &mb_io_ptr->save6;
-	num_ssrec = (int *) &mb_io_ptr->save7;
-	file_has_ss = (int *) &mb_io_ptr->save8;
-	if (*expect_save_flag == MB_YES)
-		{
-		expect = *expect_save;
-		first_type = *first_type_save;
-		first_ss = *first_ss_save;
-		more_ss = *more_ss_save;
-		*expect_save_flag = MB_NO;
-		}
-	else
-		{
-		expect = EM_NONE;
-		first_type = EM_NONE;
-		first_ss = MB_YES;
-		more_ss = MB_NO;
-		}
-
-	/* check if sidescan is to be expected */
-	if (*num_bathrec > 3 && *num_ssrec == 0)
-		*file_has_ss = MB_NO;
-	else
-		*file_has_ss = MB_YES;
-
-	/* set file position */
-	mb_io_ptr->file_pos = mb_io_ptr->file_bytes;
-
-	/* loop over reading data until a record is ready for return */
-	done = MB_NO;
-	*error = MB_ERROR_NO_ERROR;
-	while (done == MB_NO)
-		{
-		/* if no label saved get next record label */
-		if (*label_save_flag == MB_NO)
-			{
-			/* read four byte wrapper if data stream is known
-				to have wrappers */
-			if (*wrapper == MB_YES)
-				{
-				if ((read_len = fread(label,
-					1,4,mb_io_ptr->mbfp)) != 4)
-					{
-					status = MB_FAILURE;
-					*error = MB_ERROR_EOF;
-					}
-				}
-
-			/* look for label */
-			if (status == MB_SUCCESS
-				&& (read_len = fread(label,
-					1,2,mb_io_ptr->mbfp)) != 2)
-				{
-				status = MB_FAILURE;
-				*error = MB_ERROR_EOF;
-				}
-
-			/* check label - if not a good label read a byte
-				at a time until a good label is found */
-			skip = 0;
-			while (status == MB_SUCCESS
-				&& mbr_emoldraw_chk_label(verbose,
-					mbio_ptr, *type) != MB_SUCCESS)
-			    {
-			    /* get next byte */
-			    label[0] = label[1];
-			    if ((read_len = fread(&label[1],
-				    1,1,mb_io_ptr->mbfp)) != 1)
-					{
-					status = MB_FAILURE;
-					*error = MB_ERROR_EOF;
-					}
-			    skip++;
-			    }
-
-			/* set wrapper status if needed */
-			if (*wrapper < 0)
-				{
-				if (skip == 0)
-					*wrapper = MB_NO;
-				else if (skip == 4)
-					*wrapper = MB_YES;
-				}
-			}
-
-		/* else use saved label */
-		else
-			*label_save_flag = MB_NO;
-
-		/* swap bytes if necessary */
-#ifdef BYTESWAPPED
-		*type = (short int) mb_swap_short(*type);
-#endif
-
-#ifdef MBR_EMOLDRAW_DEBUG
-	fprintf(stderr,"\nstart of mbr_emoldraw_rd_data loop:\n");
-	fprintf(stderr,"done:%d\n",done);
-	fprintf(stderr,"wrapper:%d\n",*wrapper);
-	fprintf(stderr,"num_bathrec:%d\n",*num_bathrec);
-	fprintf(stderr,"num_ssrec:%d\n",*num_ssrec);
-	fprintf(stderr,"file_has_ss:%d\n",*file_has_ss);
-	fprintf(stderr,"skip:%d\n",skip);
-	fprintf(stderr,"expect:%x\n",expect);
-	fprintf(stderr,"type:%x\n",*type);
-	fprintf(stderr,"first_type:%x\n",first_type);
-	fprintf(stderr,"first_ss:%d\n",first_ss);
-	fprintf(stderr,"more_ss:%d\n",more_ss);
-#endif
-
-		/* allocate secondary data structure for
-			survey data if needed */
-		if (status == MB_SUCCESS &&
-			(*type == EM_12S_BATH
-			|| *type == EM_12DP_BATH
-			|| *type == EM_12DS_BATH
-			|| *type == EM_121_BATH
-			|| *type == EM_1000_BATH
-			|| *type == EM_12S_SS
-			|| *type == EM_12DP_SS
-			|| *type == EM_12DS_SS
-			|| *type == EM_12S_SSP
-			|| *type == EM_12DP_SSP
-			|| *type == EM_12DS_SSP)
-			&& store->ping == NULL)
-			{
-			status = mbsys_simrad_survey_alloc(
-					verbose,mbio_ptr,
-					store_ptr,error);
-			}
-
-		/* read the appropriate data records */
-		if (status == MB_FAILURE && expect == EM_NONE)
-			{
-#ifdef MBR_EMOLDRAW_DEBUG
-	fprintf(stderr,"call nothing, read failure, no expect\n");
-#endif
-			done = MB_YES;
-			}
-		else if (status == MB_FAILURE && expect != EM_NONE)
-			{
-#ifdef MBR_EMOLDRAW_DEBUG
-	fprintf(stderr,"call nothing, read failure, expect %x\n",expect);
-#endif
-			store->kind = MB_DATA_DATA;
-			done = MB_YES;
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		else if (*type != EM_START
-			&& *type != EM_STOP
-			&& *type != EM_PARAMETER
-			&& *type != EM_POS
-			&& *type != EM_SVP
-			&& *type != EM_12S_BATH
-			&& *type != EM_12DP_BATH
-			&& *type != EM_12DS_BATH
-			&& *type != EM_121_BATH
-			&& *type != EM_1000_BATH
-			&& *type != EM_12S_SS
-			&& *type != EM_12DP_SS
-			&& *type != EM_12DS_SS
-			&& *type != EM_12S_SSP
-			&& *type != EM_12DP_SSP
-			&& *type != EM_12DS_SSP)
-			{
-#ifdef MBR_EMOLDRAW_DEBUG
-	fprintf(stderr,"call nothing, try again\n");
-#endif
-			done = MB_NO;
-			}
-		else if (*type == EM_START)
-			{
-#ifdef MBR_EMOLDRAW_DEBUG
-	fprintf(stderr,"call mbr_emoldraw_rd_start type %x\n",*type);
-#endif
-			status = mbr_emoldraw_rd_start(
-				verbose,mbfp,store,error);
-			if (status == MB_SUCCESS)
-				{
-				done = MB_YES;
-				store->kind = MB_DATA_START;
-				if (expect != EM_NONE)
-					{
-					*expect_save = expect;
-					*expect_save_flag = MB_YES;
-					*first_type_save = first_type;
-					*first_ss_save = first_ss;
-					*more_ss_save = more_ss;
-					}
-				else
-					*expect_save_flag = MB_NO;
-				}
-			}
-		else if (*type == EM_STOP
-			&& expect != EM_NONE)
-			{
-#ifdef MBR_EMOLDRAW_DEBUG
-	fprintf(stderr,"call nothing, expect %x but got type %x\n",expect,*type);
-#endif
-			store->kind = MB_DATA_DATA;
-			done = MB_YES;
-			expect = EM_NONE;
-			*label_save_flag = MB_YES;
-			}
-		else if (*type == EM_STOP)
-			{
-#ifdef MBR_EMOLDRAW_DEBUG
-	fprintf(stderr,"call mbr_emoldraw_rd_stop type %x\n",*type);
-#endif
-			status = mbr_emoldraw_rd_stop(
-				verbose,mbfp,store,error);
-			if (status == MB_SUCCESS)
-				{
-				done = MB_YES;
-				store->kind = MB_DATA_STOP;
-				if (expect != EM_NONE)
-					{
-					*expect_save = expect;
-					*expect_save_flag = MB_YES;
-					*first_type_save = first_type;
-					*first_ss_save = first_ss;
-					*more_ss_save = more_ss;
-					}
-				else
-					*expect_save_flag = MB_NO;
-				}
-			}
-		else if (*type == EM_PARAMETER)
-			{
-#ifdef MBR_EMOLDRAW_DEBUG
-	fprintf(stderr,"call mbr_emoldraw_rd_parameter type %x\n",*type);
-#endif
-			status = mbr_emoldraw_rd_parameter(
-				verbose,mbfp,store,error);
-			if (status == MB_SUCCESS)
-				{
-				done = MB_YES;
-				store->kind = MB_DATA_COMMENT;
-				if (expect != EM_NONE)
-					{
-					*expect_save = expect;
-					*expect_save_flag = MB_YES;
-					*first_type_save = first_type;
-					*first_ss_save = first_ss;
-					*more_ss_save = more_ss;
-					}
-				else
-					*expect_save_flag = MB_NO;
-				}
-			}
-		else if (*type == EM_POS)
-			{
-#ifdef MBR_EMOLDRAW_DEBUG
-	fprintf(stderr,"call mbr_emoldraw_rd_pos type %x\n",*type);
-#endif
-			status = mbr_emoldraw_rd_pos(
-				verbose,mbfp,store,error);
-			if (status == MB_SUCCESS)
-				{
-				done = MB_YES;
-				store->kind = MB_DATA_NAV;
-				if (expect != EM_NONE)
-					{
-					*expect_save = expect;
-					*expect_save_flag = MB_YES;
-					*first_type_save = first_type;
-					*first_ss_save = first_ss;
-					*more_ss_save = more_ss;
-					}
-				else
-					*expect_save_flag = MB_NO;
-				}
-			}
-		else if (*type == EM_SVP)
-			{
-#ifdef MBR_EMOLDRAW_DEBUG
-	fprintf(stderr,"call mbr_emoldraw_rd_svp type %x\n",*type);
-#endif
-			status = mbr_emoldraw_rd_svp(
-				verbose,mbfp,store,error);
-			if (status == MB_SUCCESS)
-				{
-				done = MB_YES;
-				store->kind = MB_DATA_VELOCITY_PROFILE;
-				if (expect != EM_NONE)
-					{
-					*expect_save = expect;
-					*expect_save_flag = MB_YES;
-					*first_type_save = first_type;
-					*first_ss_save = first_ss;
-					*more_ss_save = more_ss;
-					}
-				else
-					*expect_save_flag = MB_NO;
-				}
-			}
-		else if (*type == EM_12S_BATH
-			&& expect != EM_NONE
-			&& expect != EM_12S_BATH)
-			{
-#ifdef MBR_EMOLDRAW_DEBUG
-	fprintf(stderr,"call nothing, expect %x but got type %x\n",expect,*type);
-#endif
-			store->kind = MB_DATA_DATA;
-			done = MB_YES;
-			expect = EM_NONE;
-			*label_save_flag = MB_YES;
-			}
-		else if (*type == EM_12S_BATH)
-			{
-#ifdef MBR_EMOLDRAW_DEBUG
-	fprintf(stderr,"call mbr_emoldraw_rd_em12bath type %x\n",*type);
-#endif
-			store->sonar = MBSYS_SIMRAD_EM12S;
-			status = mbr_emoldraw_rd_em12bath(
-				verbose,mbfp,store,
-				EM_SWATH_CENTER,error);
-			if (status == MB_SUCCESS)
-				{
-				(*num_bathrec)++;
-#ifdef MBR_EMOLDRAW_DEBUG
-	fprintf(stderr,"check num_bathrec:%d\n",*num_bathrec);
-#endif
-				store->kind = MB_DATA_DATA;
-				if (first_type == EM_NONE
-					&& *file_has_ss == MB_YES)
-					{
-					done = MB_NO;
-					first_type = EM_12S_BATH;
-					expect = EM_12S_SS;
-					}
-				else
-					{
-					done = MB_YES;
-					expect = EM_NONE;
-					}
-				}
-			}
-		else if (*type == EM_12DP_BATH
-			&& expect != EM_NONE
-			&& expect != EM_12DP_BATH)
-			{
-#ifdef MBR_EMOLDRAW_DEBUG
-	fprintf(stderr,"call nothing, expect %x but got type %x\n",expect,*type);
-#endif
-			store->kind = MB_DATA_DATA;
-			done = MB_YES;
-			expect = EM_NONE;
-			*label_save_flag = MB_YES;
-			}
-		else if (*type == EM_12DP_BATH)
-			{
-#ifdef MBR_EMOLDRAW_DEBUG
-	fprintf(stderr,"call mbr_emoldraw_rd_em12bath type %x\n",*type);
-#endif
-			store->sonar = MBSYS_SIMRAD_EM12D;
-			status = mbr_emoldraw_rd_em12bath(
-				verbose,mbfp,store,
-				EM_SWATH_PORT,error);
-			if (status == MB_SUCCESS)
-				{
-				(*num_bathrec)++;
-#ifdef MBR_EMOLDRAW_DEBUG
-	fprintf(stderr,"num_bathrec:%d\n",*num_bathrec);
-#endif
-				store->kind = MB_DATA_DATA;
-				if (first_type == EM_NONE
-					&& *file_has_ss == MB_YES)
-					{
-					done = MB_NO;
-					first_type = EM_12DP_BATH;
-					expect = EM_12DP_SS;
-					}
-				else
-					{
-					done = MB_YES;
-					expect = EM_NONE;
-					}
-				}
-			}
-		else if (*type == EM_12DS_BATH
-			&& expect != EM_NONE
-			&& expect != EM_12DS_BATH)
-			{
-#ifdef MBR_EMOLDRAW_DEBUG
-	fprintf(stderr,"call nothing, expect %x but got type %x\n",expect,*type);
-#endif
-			store->kind = MB_DATA_DATA;
-			done = MB_YES;
-			expect = EM_NONE;
-			*label_save_flag = MB_YES;
-			}
-		else if (*type == EM_12DS_BATH)
-			{
-#ifdef MBR_EMOLDRAW_DEBUG
-	fprintf(stderr,"call mbr_emoldraw_rd_em12bath type %x\n",*type);
-#endif
-			store->sonar = MBSYS_SIMRAD_EM12D;
-			status = mbr_emoldraw_rd_em12bath(
-				verbose,mbfp,store,
-				EM_SWATH_STARBOARD,error);
-			if (status == MB_SUCCESS)
-				{
-				(*num_bathrec)++;
-#ifdef MBR_EMOLDRAW_DEBUG
-	fprintf(stderr,"num_bathrec:%d\n",*num_bathrec);
-#endif
-				store->kind = MB_DATA_DATA;
-				if (first_type == EM_NONE
-					&& *file_has_ss == MB_YES)
-					{
-					done = MB_NO;
-					first_type = EM_12DS_BATH;
-					expect = EM_12DS_SS;
-					}
-				else
-					{
-					done = MB_YES;
-					expect = EM_NONE;
-					}
-				}
-			}
-		else if (*type == EM_121_BATH
-			&& expect != EM_NONE
-			&& expect != EM_12S_BATH)
-			{
-#ifdef MBR_EMOLDRAW_DEBUG
-	fprintf(stderr,"call nothing, expect %x but got type %x\n",expect,*type);
-#endif
-			store->kind = MB_DATA_DATA;
-			done = MB_YES;
-			expect = EM_NONE;
-			*label_save_flag = MB_YES;
-			}
-		else if (*type == EM_121_BATH)
-			{
-#ifdef MBR_EMOLDRAW_DEBUG
-	fprintf(stderr,"call mbr_emoldraw_rd_em121bath type %x\n",*type);
-#endif
-			store->sonar = MBSYS_SIMRAD_EM121;
-			status = mbr_emoldraw_rd_em121bath(
-				verbose,mbfp,store,error);
-			if (status == MB_SUCCESS)
-				{
-				(*num_bathrec)++;
-#ifdef MBR_EMOLDRAW_DEBUG
-	fprintf(stderr,"num_bathrec:%d\n",*num_bathrec);
-#endif
-				store->kind = MB_DATA_DATA;
-				if (first_type == EM_NONE
-					&& *file_has_ss == MB_YES)
-					{
-					done = MB_NO;
-					first_type = EM_121_BATH;
-					expect = EM_12S_SS;
-					}
-				else
-					{
-					done = MB_YES;
-					expect = EM_NONE;
-					}
-				}
-			}
-		else if (*type == EM_1000_BATH
-			&& expect != EM_NONE
-			&& expect != EM_12S_BATH)
-			{
-#ifdef MBR_EMOLDRAW_DEBUG
-	fprintf(stderr,"call nothing, expect %x but got type %x\n",expect,*type);
-#endif
-			store->kind = MB_DATA_DATA;
-			done = MB_YES;
-			expect = EM_NONE;
-			*label_save_flag = MB_YES;
-			}
-		else if (*type == EM_1000_BATH)
-			{
-#ifdef MBR_EMOLDRAW_DEBUG
-	fprintf(stderr,"call mbr_emoldraw_rd_em1000bath type %x\n",*type);
-#endif
-			status = mbr_emoldraw_rd_em1000bath(
-				verbose,mbfp,store,error);
-			if (status == MB_SUCCESS)
-				{
-				(*num_bathrec)++;
-#ifdef MBR_EMOLDRAW_DEBUG
-	fprintf(stderr,"num_bathrec:%d\n",*num_bathrec);
-#endif
-				store->sonar = MBSYS_SIMRAD_EM1000;
-				store->kind = MB_DATA_DATA;
-				if (first_type == EM_NONE
-					&& *file_has_ss == MB_YES)
-					{
-					done = MB_NO;
-					first_type = EM_12DS_BATH;
-					expect = EM_12S_SS;
-					}
-				else
-					{
-					done = MB_YES;
-					expect = EM_NONE;
-					}
-				}
-			}
-		else if (*type == EM_12S_SS
-			&& expect != EM_NONE
-			&& expect != EM_12S_SS)
-			{
-#ifdef MBR_EMOLDRAW_DEBUG
-	fprintf(stderr,"call nothing, expect %x but got type %x\n",expect,*type);
-#endif
-			store->kind = MB_DATA_DATA;
-			done = MB_YES;
-			expect = EM_NONE;
-			*label_save_flag = MB_YES;
-			}
-		else if (*type == EM_12S_SS)
-			{
-#ifdef MBR_EMOLDRAW_DEBUG
-	fprintf(stderr,"call mbr_emoldraw_rd_ss type %x\n",*type);
-#endif
-			status = mbr_emoldraw_rd_ss(
-				verbose,mbfp,store,
-				EM_SWATH_CENTER,
-				first_ss,&more_ss,error);
-			if (status == MB_SUCCESS
-				&& first_ss == MB_YES)
-				(*num_ssrec)++;
-			if (status == MB_SUCCESS
-				&& more_ss == MB_NO)
-				{
-				*file_has_ss = MB_YES;
-				if (first_type == EM_NONE)
-					{
-					done = MB_NO;
-					first_type = EM_12S_SS;
-					expect = EM_12S_BATH;
-					}
-				else
-					{
-					done = MB_YES;
-					expect = EM_NONE;
-					}
-				first_ss = MB_YES;
-				}
-			else if (status == MB_SUCCESS
-				&& more_ss == MB_YES)
-				{
-				done = MB_NO;
-				expect = EM_12S_SS;
-				first_ss = MB_NO;
-				}
-			else if (status == MB_FAILURE)
-				{
-				if (first_type == EM_NONE)
-					{
-					done = MB_NO;
-					first_type = EM_12S_SS;
-					expect = EM_12S_BATH;
-					}
-				else
-					{
-					done = MB_YES;
-					expect = EM_NONE;
-					}
-				first_ss = MB_YES;
-				}
-			}
-		else if (*type == EM_12DP_SS
-			&& expect != EM_NONE
-			&& expect != EM_12DP_SS)
-			{
-#ifdef MBR_EMOLDRAW_DEBUG
-	fprintf(stderr,"call nothing, expect %x but got type %x\n",expect,*type);
-#endif
-			store->kind = MB_DATA_DATA;
-			done = MB_YES;
-			expect = EM_NONE;
-			*label_save_flag = MB_YES;
-			}
-		else if (*type == EM_12DP_SS)
-			{
-#ifdef MBR_EMOLDRAW_DEBUG
-	fprintf(stderr,"call mbr_emoldraw_rd_ss type %x\n",*type);
-#endif
-			status = mbr_emoldraw_rd_ss(
-				verbose,mbfp,store,
-				EM_SWATH_PORT,
-				first_ss,&more_ss,error);
-			if (status == MB_SUCCESS
-				&& first_ss == MB_YES)
-				(*num_ssrec)++;
-			if (status == MB_SUCCESS
-				&& more_ss == MB_NO)
-				{
-				*file_has_ss = MB_YES;
-				if (first_type == EM_NONE)
-					{
-					done = MB_NO;
-					first_type = EM_12DP_SS;
-					expect = EM_12DP_BATH;
-					}
-				else
-					{
-					done = MB_YES;
-					expect = EM_NONE;
-					}
-				first_ss = MB_YES;
-				}
-			else if (status == MB_SUCCESS
-				&& more_ss == MB_YES)
-				{
-				done = MB_NO;
-				expect = EM_12DP_SS;
-				first_ss = MB_NO;
-				}
-			else if (status == MB_FAILURE)
-				{
-				if (first_type == EM_NONE)
-					{
-					done = MB_NO;
-					first_type = EM_12DP_SS;
-					expect = EM_12DP_BATH;
-					}
-				else
-					{
-					done = MB_YES;
-					expect = EM_NONE;
-					}
-				first_ss = MB_YES;
-				}
-			}
-
-		else if (*type == EM_12DS_SS
-			&& expect != EM_NONE
-			&& expect != EM_12DS_SS)
-			{
-#ifdef MBR_EMOLDRAW_DEBUG
-	fprintf(stderr,"call nothing, expect %x but got type %x\n",expect,*type);
-#endif
-			store->kind = MB_DATA_DATA;
-			done = MB_YES;
-			expect = EM_NONE;
-			*label_save_flag = MB_YES;
-			}
-		else if (*type == EM_12DS_SS)
-			{
-#ifdef MBR_EMOLDRAW_DEBUG
-	fprintf(stderr,"call mbr_emoldraw_rd_ss type %x\n",*type);
-#endif
-			status = mbr_emoldraw_rd_ss(
-				verbose,mbfp,store,
-				EM_SWATH_STARBOARD,
-				first_ss,&more_ss,error);
-			if (status == MB_SUCCESS
-				&& first_ss == MB_YES)
-				(*num_ssrec)++;
-			if (status == MB_SUCCESS
-				&& more_ss == MB_NO)
-				{
-				*file_has_ss = MB_YES;
-				if (first_type == EM_NONE)
-					{
-					done = MB_NO;
-					first_type = EM_12DS_SS;
-					expect = EM_12DS_BATH;
-					}
-				else
-					{
-					done = MB_YES;
-					expect = EM_NONE;
-					}
-				first_ss = MB_YES;
-				}
-			else if (status == MB_SUCCESS
-				&& more_ss == MB_YES)
-				{
-				done = MB_NO;
-				expect = EM_12DS_SS;
-				first_ss = MB_NO;
-				}
-			else if (status == MB_FAILURE)
-				{
-				if (first_type == EM_NONE)
-					{
-					done = MB_NO;
-					first_type = EM_12DS_SS;
-					expect = EM_12DS_BATH;
-					}
-				else
-					{
-					done = MB_YES;
-					expect = EM_NONE;
-					}
-				first_ss = MB_YES;
-				}
-			}
-		else if (*type == EM_12S_SSP
-			&& expect != EM_NONE
-			&& expect != EM_12S_SS)
-			{
-#ifdef MBR_EMOLDRAW_DEBUG
-	fprintf(stderr,"call nothing, expect %x but got type %x\n",expect,*type);
-#endif
-			store->kind = MB_DATA_DATA;
-			done = MB_YES;
-			expect = EM_NONE;
-			*label_save_flag = MB_YES;
-			}
-		else if (*type == EM_12S_SSP)
-			{
-#ifdef MBR_EMOLDRAW_DEBUG
-	fprintf(stderr,"call mbr_emoldraw_rd_ssp type %x\n",*type);
-#endif
-			status = mbr_emoldraw_rd_ssp(
-				verbose,mbfp,store,
-				EM_SWATH_CENTER,
-				first_ss,&more_ss,error);
-			if (status == MB_SUCCESS
-				&& first_ss == MB_YES)
-				(*num_ssrec)++;
-			if (status == MB_SUCCESS
-				&& more_ss == MB_NO)
-				{
-				*file_has_ss = MB_YES;
-				if (first_type == EM_NONE)
-					{
-					done = MB_NO;
-					first_type = EM_12S_SSP;
-					expect = EM_12S_BATH;
-					}
-				else
-					{
-					done = MB_YES;
-					expect = EM_NONE;
-					}
-				first_ss = MB_YES;
-				}
-			else if (status == MB_SUCCESS
-				&& more_ss == MB_YES)
-				{
-				done = MB_NO;
-				expect = EM_12S_SS;
-				first_ss = MB_NO;
-				}
-			else if (status == MB_FAILURE)
-				{
-				if (first_type == EM_NONE)
-					{
-					done = MB_NO;
-					first_type = EM_12S_SSP;
-					expect = EM_12S_BATH;
-					}
-				else
-					{
-					done = MB_YES;
-					expect = EM_NONE;
-					}
-				first_ss = MB_YES;
-				}
-			}
-		else if (*type == EM_12DP_SSP
-			&& expect != EM_NONE
-			&& expect != EM_12DP_SS)
-			{
-#ifdef MBR_EMOLDRAW_DEBUG
-	fprintf(stderr,"call nothing, expect %x but got type %x\n",expect,*type);
-#endif
-			store->kind = MB_DATA_DATA;
-			done = MB_YES;
-			expect = EM_NONE;
-			*label_save_flag = MB_YES;
-			}
-		else if (*type == EM_12DP_SSP)
-			{
-#ifdef MBR_EMOLDRAW_DEBUG
-	fprintf(stderr,"call mbr_emoldraw_rd_ssp type %x\n",*type);
-#endif
-			status = mbr_emoldraw_rd_ssp(
-				verbose,mbfp,store,
-				EM_SWATH_PORT,
-				first_ss,&more_ss,error);
-			if (status == MB_SUCCESS
-				&& first_ss == MB_YES)
-				(*num_ssrec)++;
-			if (status == MB_SUCCESS
-				&& more_ss == MB_NO)
-				{
-				*file_has_ss = MB_YES;
-				if (first_type == EM_NONE)
-					{
-					done = MB_NO;
-					first_type = EM_12DP_SSP;
-					expect = EM_12DP_BATH;
-					}
-				else
-					{
-					done = MB_YES;
-					expect = EM_NONE;
-					}
-				first_ss = MB_YES;
-				}
-			else if (status == MB_SUCCESS
-				&& more_ss == MB_YES)
-				{
-				done = MB_NO;
-				expect = EM_12DP_SS;
-				first_ss = MB_NO;
-				}
-			else if (status == MB_FAILURE)
-				{
-				if (first_type == EM_NONE)
-					{
-					done = MB_NO;
-					first_type = EM_12DP_SSP;
-					expect = EM_12DP_BATH;
-					}
-				else
-					{
-					done = MB_YES;
-					expect = EM_NONE;
-					}
-				first_ss = MB_YES;
-				}
-			}
-
-		else if (*type == EM_12DS_SSP
-			&& expect != EM_NONE
-			&& expect != EM_12DS_SS)
-			{
-#ifdef MBR_EMOLDRAW_DEBUG
-	fprintf(stderr,"call nothing, expect %x but got type %x\n",expect,*type);
-#endif
-			store->kind = MB_DATA_DATA;
-			done = MB_YES;
-			expect = EM_NONE;
-			*label_save_flag = MB_YES;
-			}
-		else if (*type == EM_12DS_SSP)
-			{
-#ifdef MBR_EMOLDRAW_DEBUG
-	fprintf(stderr,"call mbr_emoldraw_rd_ssp type %x\n",*type);
-#endif
-			status = mbr_emoldraw_rd_ssp(
-				verbose,mbfp,store,
-				EM_SWATH_STARBOARD,
-				first_ss,&more_ss,error);
-			if (status == MB_SUCCESS
-				&& first_ss == MB_YES)
-				(*num_ssrec)++;
-			if (status == MB_SUCCESS
-				&& more_ss == MB_NO)
-				{
-				*file_has_ss = MB_YES;
-				if (first_type == EM_NONE)
-					{
-					done = MB_NO;
-					first_type = EM_12DS_SSP;
-					expect = EM_12DS_BATH;
-					}
-				else
-					{
-					done = MB_YES;
-					expect = EM_NONE;
-					}
-				first_ss = MB_YES;
-				}
-			else if (status == MB_SUCCESS
-				&& more_ss == MB_YES)
-				{
-				done = MB_NO;
-				expect = EM_12DS_SS;
-				first_ss = MB_NO;
-				}
-			else if (status == MB_FAILURE)
-				{
-				if (first_type == EM_NONE)
-					{
-					done = MB_NO;
-					first_type = EM_12DS_SSP;
-					expect = EM_12DS_BATH;
-					}
-				else
-					{
-					done = MB_YES;
-					expect = EM_NONE;
-					}
-				first_ss = MB_YES;
-				}
-			}
-
-		/* bail out if there is an error */
-		if (status == MB_FAILURE)
-			done = MB_YES;
-
-#ifdef MBR_EMOLDRAW_DEBUG
-	fprintf(stderr,"end of mbr_emoldraw_rd_data loop:\n");
-	fprintf(stderr,"status:%d error:%d\n",status, *error);
-	fprintf(stderr,"done:%d\n",done);
-	fprintf(stderr,"expect:%x\n",expect);
-	fprintf(stderr,"type:%x\n",*type);
-#endif
-		}
-
-	/* get file position */
-	if (*label_save_flag == MB_YES)
-		mb_io_ptr->file_bytes = ftell(mbfp) - 2;
-	else if (*expect_save_flag != MB_YES)
-		mb_io_ptr->file_bytes = ftell(mbfp);
-
-	/* swap label if saved and byteswapped */
-#ifdef BYTESWAPPED
-	if (*label_save_flag == MB_YES)
-		*type = (short int) mb_swap_short(*type);
-#endif
-
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_emoldraw_chk_label(int verbose, void *mbio_ptr, short type)
-{
-	char	*function_name = "mbr_emoldraw_chk_label";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	char	*startid;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       type:       %d\n",type);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-		/* swap bytes if necessary */
-#ifdef BYTESWAPPED
-		type = (short) mb_swap_short(type);
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2  Input values byte swapped:\n");
-		fprintf(stderr,"dbg2       type:       %d\n",type);
-		}
-#endif
-
-	/* check for valid label */
-	if (type != EM_START
-		&& type != EM_STOP
-		&& type != EM_PARAMETER
-		&& type != EM_POS
-		&& type != EM_SVP
-		&& type != EM_12DS_BATH
-		&& type != EM_12DP_BATH
-		&& type != EM_12S_BATH
-		&& type != EM_121_BATH
-		&& type != EM_1000_BATH
-		&& type != EM_12DP_SS
-		&& type != EM_12DS_SS
-		&& type != EM_12S_SS
-		&& type != EM_12DP_SSP
-		&& type != EM_12DS_SSP
-		&& type != EM_12S_SSP)
-		{
-		status = MB_FAILURE;
-		startid = (char *) &type;
-		if (verbose >= 1 && *startid == 2)
-			{
-			fprintf(stderr, "Bad datagram type: %4.4hX  %d\n", type, type);
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_emoldraw_rd_start(int verbose, FILE *mbfp,
-		struct mbsys_simrad_struct *store, int *error)
-{
-	char	*function_name = "mbr_emoldraw_rd_start";
-	int	status = MB_SUCCESS;
-	char	line[EM_START_SIZE];
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		}
-
-	/* read record into char array */
-	status = fread(line,1,EM_START_SIZE,mbfp);
-	if (status == EM_START_SIZE)
-		status = MB_SUCCESS;
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	/* get data */
-	if (status == MB_SUCCESS)
-		{
-		store->kind = MB_DATA_START;
-		mb_get_int(&(store->par_day),          line,      2);
-		mb_get_int(&(store->par_month),        line+2,    2);
-		mb_get_int(&(store->par_year),         line+4,    2);
-		mb_get_int(&(store->par_hour),         line+7,    2);
-		mb_get_int(&(store->par_minute),       line+9,    2);
-		mb_get_int(&(store->par_second),       line+11,   2);
-		mb_get_int(&(store->par_centisecond),  line+13,   2);
-		mb_get_int(&(store->pos_type),         line+20,   1);
-		mb_get_double(&(store->pos_delay),     line+26,   5);
-		mb_get_double(&(store->roll_offset),   line+36,   5);
-		mb_get_double(&(store->pitch_offset),  line+46,   5);
-		mb_get_double(&(store->heading_offset),line+56,   5);
-		mb_get_double(&(store->em100_td),      line+70,   5);
-		mb_get_double(&(store->em100_tx),      line+84,   5);
-		mb_get_double(&(store->em100_ty),      line+98,   5);
-		mb_get_double(&(store->em12_td),       line+111,  5);
-		mb_get_double(&(store->em12_tx),       line+124,  5);
-		mb_get_double(&(store->em12_ty),       line+137,  5);
-		mb_get_double(&(store->em1000_td),     line+152,  5);
-		mb_get_double(&(store->em1000_tx),     line+167,  5);
-		mb_get_double(&(store->em1000_ty),     line+182,  5);
-		for(i=0;i<128;i++)
-			store->spare_parameter[i] = line[188+i];
-		mb_get_int(&(store->survey_line),      line+328,  4);
-		for(i=0;i<80;i++)
-			store->comment[i] = line[341+i];
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       year:             %d\n",store->par_year);
-		fprintf(stderr,"dbg5       month:            %d\n",store->par_month);
-		fprintf(stderr,"dbg5       day:              %d\n",store->par_day);
-		fprintf(stderr,"dbg5       hour:             %d\n",store->par_hour);
-		fprintf(stderr,"dbg5       minute:           %d\n",store->par_minute);
-		fprintf(stderr,"dbg5       sec:              %d\n",store->par_second);
-		fprintf(stderr,"dbg5       centisecond:      %d\n",store->par_centisecond);
-		fprintf(stderr,"dbg5       pos_type:         %d\n",store->pos_type);
-		fprintf(stderr,"dbg5       pos_delay:        %f\n",store->pos_delay);
-		fprintf(stderr,"dbg5       roll_offset:      %f\n",store->roll_offset);
-		fprintf(stderr,"dbg5       pitch_offset:     %f\n",store->pitch_offset);
-		fprintf(stderr,"dbg5       heading_offset:   %f\n",store->heading_offset);
-		fprintf(stderr,"dbg5       em100_td:         %f\n",store->em100_td);
-		fprintf(stderr,"dbg5       em100_tx:         %f\n",store->em100_tx);
-		fprintf(stderr,"dbg5       em100_ty:         %f\n",store->em100_ty);
-		fprintf(stderr,"dbg5       em12_td:          %f\n",store->em12_td);
-		fprintf(stderr,"dbg5       em12_tx:          %f\n",store->em12_tx);
-		fprintf(stderr,"dbg5       em12_ty:          %f\n",store->em12_ty);
-		fprintf(stderr,"dbg5       em1000_td:        %f\n",store->em1000_td);
-		fprintf(stderr,"dbg5       em1000_tx:        %f\n",store->em1000_tx);
-		fprintf(stderr,"dbg5       em1000_ty:        %f\n",store->em1000_ty);
-		fprintf(stderr,"dbg5       survey_line:      %d\n",store->survey_line);
-		fprintf(stderr,"dbg5       comment:          %s\n",store->comment);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_emoldraw_rd_stop(int verbose, FILE *mbfp,
-		struct mbsys_simrad_struct *store, int *error)
-{
-	char	*function_name = "mbr_emoldraw_rd_stop";
-	int	status = MB_SUCCESS;
-	char	line[EM_STOP_SIZE];
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		}
-
-	/* read record into char array */
-	status = fread(line,1,EM_STOP_SIZE,mbfp);
-	if (status == EM_STOP_SIZE)
-		status = MB_SUCCESS;
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	/* get data */
-	if (status == MB_SUCCESS)
-		{
-		store->kind = MB_DATA_STOP;
-		mb_get_int(&(store->par_day),          line,      2);
-		mb_get_int(&(store->par_month),        line+2,    2);
-		mb_get_int(&(store->par_year),         line+4,    2);
-		mb_get_int(&(store->par_hour),         line+7,    2);
-		mb_get_int(&(store->par_minute),       line+9,    2);
-		mb_get_int(&(store->par_second),       line+11,   2);
-		mb_get_int(&(store->par_centisecond),  line+13,   2);
-		mb_get_int(&(store->pos_type),         line+20,   1);
-		mb_get_double(&(store->pos_delay),     line+26,   5);
-		mb_get_double(&(store->roll_offset),   line+36,   5);
-		mb_get_double(&(store->pitch_offset),  line+46,   5);
-		mb_get_double(&(store->heading_offset),line+56,   5);
-		mb_get_double(&(store->em100_td),      line+70,   5);
-		mb_get_double(&(store->em100_tx),      line+84,   5);
-		mb_get_double(&(store->em100_ty),      line+98,   5);
-		mb_get_double(&(store->em12_td),       line+111,  5);
-		mb_get_double(&(store->em12_tx),       line+124,  5);
-		mb_get_double(&(store->em12_ty),       line+137,  5);
-		mb_get_double(&(store->em1000_td),     line+152,  5);
-		mb_get_double(&(store->em1000_tx),     line+167,  5);
-		mb_get_double(&(store->em1000_ty),     line+182,  5);
-		for(i=0;i<128;i++)
-			store->spare_parameter[i] = line[188+i];
-		mb_get_int(&(store->survey_line),      line+328,  4);
-		for(i=0;i<80;i++)
-			store->comment[i] = line[341+i];
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       year:             %d\n",store->par_year);
-		fprintf(stderr,"dbg5       month:            %d\n",store->par_month);
-		fprintf(stderr,"dbg5       day:              %d\n",store->par_day);
-		fprintf(stderr,"dbg5       hour:             %d\n",store->par_hour);
-		fprintf(stderr,"dbg5       minute:           %d\n",store->par_minute);
-		fprintf(stderr,"dbg5       sec:              %d\n",store->par_second);
-		fprintf(stderr,"dbg5       centisecond:      %d\n",store->par_centisecond);
-		fprintf(stderr,"dbg5       pos_type:         %d\n",store->pos_type);
-		fprintf(stderr,"dbg5       pos_delay:        %f\n",store->pos_delay);
-		fprintf(stderr,"dbg5       roll_offset:      %f\n",store->roll_offset);
-		fprintf(stderr,"dbg5       pitch_offset:     %f\n",store->pitch_offset);
-		fprintf(stderr,"dbg5       heading_offset:   %f\n",store->heading_offset);
-		fprintf(stderr,"dbg5       em100_td:         %f\n",store->em100_td);
-		fprintf(stderr,"dbg5       em100_tx:         %f\n",store->em100_tx);
-		fprintf(stderr,"dbg5       em100_ty:         %f\n",store->em100_ty);
-		fprintf(stderr,"dbg5       em12_td:          %f\n",store->em12_td);
-		fprintf(stderr,"dbg5       em12_tx:          %f\n",store->em12_tx);
-		fprintf(stderr,"dbg5       em12_ty:          %f\n",store->em12_ty);
-		fprintf(stderr,"dbg5       em1000_td:        %f\n",store->em1000_td);
-		fprintf(stderr,"dbg5       em1000_tx:        %f\n",store->em1000_tx);
-		fprintf(stderr,"dbg5       em1000_ty:        %f\n",store->em1000_ty);
-		fprintf(stderr,"dbg5       survey_line:      %d\n",store->survey_line);
-		fprintf(stderr,"dbg5       comment:          %s\n",store->comment);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_emoldraw_rd_parameter(int verbose, FILE *mbfp,
-		struct mbsys_simrad_struct *store, int *error)
-{
-	char	*function_name = "mbr_emoldraw_rd_parameter";
-	int	status = MB_SUCCESS;
-	char	line[EM_PARAMETER_SIZE];
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		}
-
-	/* read record into char array */
-	status = fread(line,1,EM_PARAMETER_SIZE,mbfp);
-	if (status == EM_PARAMETER_SIZE)
-		status = MB_SUCCESS;
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	/* get data */
-	if (status == MB_SUCCESS)
-		{
-		store->kind = MB_DATA_COMMENT;
-		mb_get_int(&(store->par_day),          line,      2);
-		mb_get_int(&(store->par_month),        line+2,    2);
-		mb_get_int(&(store->par_year),         line+4,    2);
-		mb_get_int(&(store->par_hour),         line+7,    2);
-		mb_get_int(&(store->par_minute),       line+9,    2);
-		mb_get_int(&(store->par_second),       line+11,   2);
-		mb_get_int(&(store->par_centisecond),  line+13,   2);
-		mb_get_int(&(store->pos_type),         line+20,   1);
-		mb_get_double(&(store->pos_delay),     line+26,   5);
-		mb_get_double(&(store->roll_offset),   line+36,   5);
-		mb_get_double(&(store->pitch_offset),  line+46,   5);
-		mb_get_double(&(store->heading_offset),line+56,   5);
-		mb_get_double(&(store->em100_td),      line+70,   5);
-		mb_get_double(&(store->em100_tx),      line+84,   5);
-		mb_get_double(&(store->em100_ty),      line+98,   5);
-		mb_get_double(&(store->em12_td),       line+111,  5);
-		mb_get_double(&(store->em12_tx),       line+124,  5);
-		mb_get_double(&(store->em12_ty),       line+137,  5);
-		mb_get_double(&(store->em1000_td),     line+152,  5);
-		mb_get_double(&(store->em1000_tx),     line+167,  5);
-		mb_get_double(&(store->em1000_ty),     line+182,  5);
-		for(i=0;i<128;i++)
-			store->spare_parameter[i] = line[188+i];
-		mb_get_int(&(store->survey_line),      line+328,  4);
-		for(i=0;i<80;i++)
-			store->comment[i] = line[341+i];
-
-		/* infer sonar type from transducer depths */
-		if (store->em12_td != 0.0)
-		    store->sonar = MBSYS_SIMRAD_EM12S;
-		else if (store->em1000_td != 0.0)
-		    store->sonar = MBSYS_SIMRAD_EM1000;
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       year:             %d\n",store->par_year);
-		fprintf(stderr,"dbg5       month:            %d\n",store->par_month);
-		fprintf(stderr,"dbg5       day:              %d\n",store->par_day);
-		fprintf(stderr,"dbg5       hour:             %d\n",store->par_hour);
-		fprintf(stderr,"dbg5       minute:           %d\n",store->par_minute);
-		fprintf(stderr,"dbg5       sec:              %d\n",store->par_second);
-		fprintf(stderr,"dbg5       centisecond:      %d\n",store->par_centisecond);
-		fprintf(stderr,"dbg5       pos_type:         %d\n",store->pos_type);
-		fprintf(stderr,"dbg5       pos_delay:        %f\n",store->pos_delay);
-		fprintf(stderr,"dbg5       roll_offset:      %f\n",store->pos_delay);
-		fprintf(stderr,"dbg5       pitch_offset:     %f\n",store->pos_delay);
-		fprintf(stderr,"dbg5       heading_offset:   %f\n",store->pos_delay);
-		fprintf(stderr,"dbg5       em100_td:         %f\n",store->pos_delay);
-		fprintf(stderr,"dbg5       em100_tx:         %f\n",store->pos_delay);
-		fprintf(stderr,"dbg5       em100_ty:         %f\n",store->pos_delay);
-		fprintf(stderr,"dbg5       em12_td:          %f\n",store->pos_delay);
-		fprintf(stderr,"dbg5       em12_tx:          %f\n",store->pos_delay);
-		fprintf(stderr,"dbg5       em12_ty:          %f\n",store->pos_delay);
-		fprintf(stderr,"dbg5       em1000_td:        %f\n",store->pos_delay);
-		fprintf(stderr,"dbg5       em1000_tx:        %f\n",store->pos_delay);
-		fprintf(stderr,"dbg5       em1000_ty:        %f\n",store->pos_delay);
-		fprintf(stderr,"dbg5       survey_line:      %d\n",store->survey_line);
-		fprintf(stderr,"dbg5       comment:          %s\n",store->comment);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_emoldraw_rd_pos(int verbose, FILE *mbfp,
-		struct mbsys_simrad_struct *store, int *error)
-{
-	char	*function_name = "mbr_emoldraw_rd_pos";
-	int	status = MB_SUCCESS;
-	char	line[EM_POS_SIZE];
-	int	degree;
-	double	minute;
-	char	hemisphere;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		}
-
-	/* read record into char array */
-	status = fread(line,1,EM_POS_SIZE,mbfp);
-	if (status == EM_POS_SIZE)
-		status = MB_SUCCESS;
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	/* get data */
-	if (status == MB_SUCCESS)
-		{
-		store->kind = MB_DATA_NAV;
-		mb_get_int(&(store->pos_day),          line,      2);
-		mb_get_int(&(store->pos_month),        line+2,    2);
-		mb_get_int(&(store->pos_year),         line+4,    2);
-		mb_get_int(&(store->pos_hour),         line+7,    2);
-		mb_get_int(&(store->pos_minute),       line+9,    2);
-		mb_get_int(&(store->pos_second),       line+11,   2);
-		mb_get_int(&(store->pos_centisecond),  line+13,   2);
-		mb_get_int(&degree,                   line+16,   2);
-		mb_get_double(&minute,                line+18,   7);
-		hemisphere = line[25];
-		store->pos_latitude = degree + minute/60.0;
-		if (hemisphere == 'S' || hemisphere == 's')
-			store->pos_latitude = -store->pos_latitude;
-		mb_get_int(&degree,                   line+27,   3);
-		mb_get_double(&minute,                line+30,   7);
-		hemisphere = line[37];
-		store->pos_longitude = degree + minute/60.0;
-		if (hemisphere == 'W' || hemisphere == 'w')
-			store->pos_longitude = -store->pos_longitude;
-		mb_get_double(&(store->utm_northing),  line+39,  11);
-		mb_get_double(&(store->utm_easting),   line+51,   9);
-		mb_get_int(&(store->utm_zone),         line+61,   2);
-		mb_get_int(&degree,                   line+64,   3);
-		mb_get_double(&minute,                line+67,   7);
-		hemisphere = line[74];
-		store->utm_zone_lon = degree + minute/60.0;
-		if (hemisphere == 'W' || hemisphere == 'w')
-			store->utm_zone_lon = -store->utm_zone_lon;
-		mb_get_int(&(store->utm_system),       line+76,   1);
-		mb_get_int(&(store->pos_quality),      line+78,   1);
-		mb_get_double(&(store->speed),         line+80,   4);
-		mb_get_double(&(store->line_heading),  line+85,   5);
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       year:             %d\n",store->pos_year);
-		fprintf(stderr,"dbg5       month:            %d\n",store->pos_month);
-		fprintf(stderr,"dbg5       day:              %d\n",store->pos_day);
-		fprintf(stderr,"dbg5       hour:             %d\n",store->pos_hour);
-		fprintf(stderr,"dbg5       minute:           %d\n",store->pos_minute);
-		fprintf(stderr,"dbg5       sec:              %d\n",store->pos_second);
-		fprintf(stderr,"dbg5       centisecond:      %d\n",store->pos_centisecond);
-		fprintf(stderr,"dbg5       longitude:        %f\n",store->pos_longitude);
-		fprintf(stderr,"dbg5       latitude:         %f\n",store->pos_latitude);
-		fprintf(stderr,"dbg5       utm_northing:     %f\n",store->utm_northing);
-		fprintf(stderr,"dbg5       utm_easting:      %f\n",store->utm_easting);
-		fprintf(stderr,"dbg5       utm_zone:         %d\n",store->utm_zone);
-		fprintf(stderr,"dbg5       utm_zone_lon:     %f\n",store->utm_zone_lon);
-		fprintf(stderr,"dbg5       utm_system:       %d\n",store->utm_system);
-		fprintf(stderr,"dbg5       pos_quality:      %d\n",store->pos_quality);
-		fprintf(stderr,"dbg5       speed:            %f\n",store->speed);
-		fprintf(stderr,"dbg5       line_heading:     %f\n",store->line_heading);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_emoldraw_rd_svp(int verbose, FILE *mbfp,
-		struct mbsys_simrad_struct *store, int *error)
-{
-	char	*function_name = "mbr_emoldraw_rd_svp";
-	int	status = MB_SUCCESS;
-	char	line[EM_SVP_SIZE];
-	short	short_val;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		}
-
-	/* read record into char array */
-	status = fread(line,1,EM_SVP_SIZE,mbfp);
-	if (status == EM_SVP_SIZE)
-		status = MB_SUCCESS;
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	/* get data */
-	if (status == MB_SUCCESS)
-		{
-		store->kind = MB_DATA_VELOCITY_PROFILE;
-		mb_get_int(&(store->svp_day),          line,      2);
-		mb_get_int(&(store->svp_month),        line+2,    2);
-		mb_get_int(&(store->svp_year),         line+4,    2);
-		mb_get_int(&(store->svp_hour),         line+6,    2);
-		mb_get_int(&(store->svp_minute),       line+8,    2);
-		mb_get_int(&(store->svp_second),       line+10,   2);
-		mb_get_int(&(store->svp_centisecond),  line+12,   2);
-		mb_get_binary_short(MB_YES, &line[14], &short_val);
-		store->svp_num = short_val;
-		for (i=0;i<store->svp_num;i++)
-			{
-			mb_get_binary_short(MB_YES, &line[16+4*i], &short_val);
-			store->svp_depth[i] = short_val;
-			mb_get_binary_short(MB_YES, &line[18+4*i], &short_val);
-			store->svp_vel[i] = short_val;
-			}
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       year:             %d\n",store->svp_year);
-		fprintf(stderr,"dbg5       month:            %d\n",store->svp_month);
-		fprintf(stderr,"dbg5       day:              %d\n",store->svp_day);
-		fprintf(stderr,"dbg5       hour:             %d\n",store->svp_hour);
-		fprintf(stderr,"dbg5       minute:           %d\n",store->svp_minute);
-		fprintf(stderr,"dbg5       sec:              %d\n",store->svp_second);
-		fprintf(stderr,"dbg5       centisecond:      %d\n",store->svp_centisecond);
-		fprintf(stderr,"dbg5       svp_num:          %d\n",store->svp_num);
-		for (i=0;i<store->svp_num;i++)
-			fprintf(stderr,"dbg5       depth: %d     vel: %d\n",
-				store->svp_depth[i],store->svp_vel[i]);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_emoldraw_rd_em1000bath(int verbose, FILE *mbfp,
-		struct mbsys_simrad_struct *store, int *error)
-{
-	char	*function_name = "mbr_emoldraw_rd_em1000bath";
-	int	status = MB_SUCCESS;
-	struct mbsys_simrad_survey_struct *ping;
-	char	line[EM_1000_BATH_SIZE];
-	char	beamarray[11];
-	short int short_val;
-	short int *short_ptr;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		}
-
-	/* read record into char array */
-	status = fread(line,1,EM_1000_BATH_SIZE,mbfp);
-	if (status == EM_1000_BATH_SIZE)
-		status = MB_SUCCESS;
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	/* get data */
-	if (status == MB_SUCCESS)
-		{
-		/* get ping structure */
-		ping = (struct mbsys_simrad_survey_struct *) store->ping;
-
-		/* set sonar id */
-		store->sonar = MBSYS_SIMRAD_EM1000;
-
-		/* get ascii stuff */
-		store->kind = MB_DATA_DATA;
-		mb_get_int(&(store->day),              line,      2);
-		mb_get_int(&(store->month),            line+2,    2);
-		mb_get_int(&(store->year),             line+4,    2);
-		mb_get_int(&(store->hour),             line+6,    2);
-		mb_get_int(&(store->minute),           line+8,    2);
-		mb_get_int(&(store->second),           line+10,   2);
-		mb_get_int(&(store->centisecond),      line+12,   2);
-
-		/* get binary stuff */
-		mb_get_binary_short(MB_YES, &line[14], &short_val); ping->ping_number = (int) short_val;
-		ping->bath_mode = (int) line[16];
-		ping->bath_quality = (int) line[17];
-		mb_get_binary_short(MB_YES, &line[18], &short_val); ping->keel_depth = (int) short_val;
-		mb_get_binary_short(MB_YES, &line[20], &short_val); ping->heading = (int) short_val;
-		mb_get_binary_short(MB_YES, &line[22], &short_val); ping->roll = (int) short_val;
-		mb_get_binary_short(MB_YES, &line[24], &short_val); ping->pitch = (int) short_val;
-		mb_get_binary_short(MB_YES, &line[26], &short_val); ping->xducer_pitch = (int) short_val;
-		mb_get_binary_short(MB_YES, &line[28], &short_val); ping->ping_heave = (int) short_val;
-		mb_get_binary_short(MB_YES, &line[30], &short_val); ping->sound_vel = (int) short_val;
-		for (i=0;i<MBSYS_EM1000_MAXBEAMS;i++)
-			{
-			for (j=0;j<11;j++)
-				beamarray[j] = line[32+11*i+j];
-			short_ptr = (short int *) beamarray;
-			mb_get_binary_short(MB_YES, &short_ptr[0], (short *) &ping->bath[i]);
-			mb_get_binary_short(MB_YES, &short_ptr[1], &ping->bath_acrosstrack[i]);
-			mb_get_binary_short(MB_YES, &short_ptr[2], &ping->bath_alongtrack[i]);
-			mb_get_binary_short(MB_YES, &short_ptr[3], &ping->tt[i]);
-			ping->amp[i] = (mb_s_char) beamarray[8];
-			ping->quality[i] = (mb_u_char) beamarray[9];
-			ping->heave[i] = (mb_s_char) beamarray[10];
-			if (ping->bath[i] == 0)
-				ping->beamflag[i] = MB_FLAG_NULL;
-			else
-				ping->beamflag[i] = MB_FLAG_NONE;
-			}
-		ping->bath_res = 0;
-		if (ping->bath_mode >= 3 && ping->bath_mode <= 7)
-			ping->beams_bath = MBSYS_EM1000_MAXBEAMS;
-		else
-			ping->beams_bath = 48;
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       year:             %d\n",store->year);
-		fprintf(stderr,"dbg5       month:            %d\n",store->month);
-		fprintf(stderr,"dbg5       day:              %d\n",store->day);
-		fprintf(stderr,"dbg5       hour:             %d\n",store->hour);
-		fprintf(stderr,"dbg5       minute:           %d\n",store->minute);
-		fprintf(stderr,"dbg5       sec:              %d\n",store->second);
-		fprintf(stderr,"dbg5       centisecond:      %d\n",store->centisecond);
-		fprintf(stderr,"dbg5       ping_number:      %d\n",ping->ping_number);
-		fprintf(stderr,"dbg5       beams_bath:       %d\n",ping->beams_bath);
-		fprintf(stderr,"dbg5       bath_mode:        %d\n",ping->bath_mode);
-		fprintf(stderr,"dbg5       bath_res:         %d\n",ping->bath_res);
-		fprintf(stderr,"dbg5       bath_quality:     %d\n",ping->ping_number);
-		fprintf(stderr,"dbg5       keel_depth:       %d\n",ping->keel_depth);
-		fprintf(stderr,"dbg5       heading:          %d\n",ping->heading);
-		fprintf(stderr,"dbg5       roll:             %d\n",ping->roll);
-		fprintf(stderr,"dbg5       pitch:            %d\n",ping->pitch);
-		fprintf(stderr,"dbg5       xducer_pitch:     %d\n",ping->xducer_pitch);
-		fprintf(stderr,"dbg5       ping_heave:       %d\n",ping->ping_heave);
-		fprintf(stderr,"dbg5       sound_vel:        %d\n",ping->sound_vel);
-		fprintf(stderr,"dbg5       beam bath xtrack ltrack tt amp qual heave\n");
-		for (i=0;i<ping->beams_bath;i++)
-			fprintf(stderr,"dbg5       beam:%d  bath:%d  xtrck:%d  ltrck:%d tt:%d  amp:%d  qual:%d  heave:%d\n",
-				i,ping->bath[i],ping->bath_acrosstrack[i],
-				ping->bath_alongtrack[i],ping->tt[i],
-				ping->amp[i],ping->quality[i],ping->heave[i]);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_emoldraw_rd_em12bath(int verbose, FILE *mbfp,
-		struct mbsys_simrad_struct *store, int swath_id, int *error)
-{
-	char	*function_name = "mbr_emoldraw_rd_em12bath";
-	int	status = MB_SUCCESS;
-	struct mbsys_simrad_survey_struct *ping;
-	char	line[EM_12S_BATH_SIZE];
-	char	beamarray[11];
-	short int short_val;
-	short int *short_ptr;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		fprintf(stderr,"dbg2       swath_id:   %d\n",swath_id);
-		}
-
-	/* read record into char array */
-	status = fread(line,1,EM_12S_BATH_SIZE,mbfp);
-	if (status == EM_12S_BATH_SIZE)
-		status = MB_SUCCESS;
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	/* get data */
-	if (status == MB_SUCCESS)
-		{
-		/* get ping structure */
-		ping = (struct mbsys_simrad_survey_struct *) store->ping;
-
-		/* set sonar id */
-		if (swath_id == EM_SWATH_CENTER)
-		    store->sonar = MBSYS_SIMRAD_EM12S;
-		else
-		    store->sonar = MBSYS_SIMRAD_EM12D;
-
-		/* get ascii stuff */
-		store->kind = MB_DATA_DATA;
-		mb_get_int(&(store->day),              line,      2);
-		mb_get_int(&(store->month),            line+2,    2);
-		mb_get_int(&(store->year),             line+4,    2);
-		mb_get_int(&(store->hour),             line+6,    2);
-		mb_get_int(&(store->minute),           line+8,    2);
-		mb_get_int(&(store->second),           line+10,   2);
-		mb_get_int(&(store->centisecond),      line+12,   2);
-
-		/* set swath id */
-		ping->swath_id = swath_id;
-
-		/* get binary stuff */
-		mb_get_binary_short(MB_YES, &line[14], &short_val); ping->ping_number = (int) short_val;
-		ping->beams_bath = MBSYS_EM12_MAXBEAMS;
-		ping->bath_res = (int) line[16];
-		ping->bath_quality = (int) line[17];
-		mb_get_binary_short(MB_YES, &line[18], &short_val); ping->keel_depth = (int) short_val;
-		mb_get_binary_short(MB_YES, &line[20], &short_val); ping->heading = (int) short_val;
-		mb_get_binary_short(MB_YES, &line[22], &short_val); ping->roll = (int) short_val;
-		mb_get_binary_short(MB_YES, &line[24], &short_val); ping->pitch = (int) short_val;
-		mb_get_binary_short(MB_YES, &line[26], &short_val); ping->ping_heave = (int) short_val;
-		mb_get_binary_short(MB_YES, &line[28], &short_val); ping->sound_vel = (int) short_val;
-		ping->bath_mode = (int) line[30];
-		for (i=0;i<ping->beams_bath;i++)
-			{
-			for (j=0;j<11;j++)
-				beamarray[j] = line[32+11*i+j];
-			short_ptr = (short int *) beamarray;
-			mb_get_binary_short(MB_YES, &short_ptr[0], (short *) &ping->bath[i]);
-			mb_get_binary_short(MB_YES, &short_ptr[1], &ping->bath_acrosstrack[i]);
-			mb_get_binary_short(MB_YES, &short_ptr[2], &ping->bath_alongtrack[i]);
-			mb_get_binary_short(MB_YES, &short_ptr[3], &ping->tt[i]);
-			ping->amp[i] = (mb_s_char) beamarray[8];
-			ping->quality[i] = (mb_u_char) beamarray[9];
-			ping->heave[i] = (mb_s_char) beamarray[10];
-			if (ping->bath[i] == 0)
-				ping->beamflag[i] = MB_FLAG_NULL;
-			else
-				ping->beamflag[i] = MB_FLAG_NONE;
-			}
-		}
-
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       year:             %d\n",store->year);
-		fprintf(stderr,"dbg5       month:            %d\n",store->month);
-		fprintf(stderr,"dbg5       day:              %d\n",store->day);
-		fprintf(stderr,"dbg5       hour:             %d\n",store->hour);
-		fprintf(stderr,"dbg5       minute:           %d\n",store->minute);
-		fprintf(stderr,"dbg5       sec:              %d\n",store->second);
-		fprintf(stderr,"dbg5       centisecond:      %d\n",store->centisecond);
-		fprintf(stderr,"dbg5       ping_number:      %d\n",ping->ping_number);
-		fprintf(stderr,"dbg5       beams_bath:       %d\n",ping->beams_bath);
-		fprintf(stderr,"dbg5       bath_mode:        %d\n",ping->bath_mode);
-		fprintf(stderr,"dbg5       bath_res:         %d\n",ping->bath_res);
-		fprintf(stderr,"dbg5       bath_quality:     %d\n",ping->bath_quality);
-		fprintf(stderr,"dbg5       keel_depth:       %d\n",ping->keel_depth);
-		fprintf(stderr,"dbg5       heading:          %d\n",ping->heading);
-		fprintf(stderr,"dbg5       roll:             %d\n",ping->roll);
-		fprintf(stderr,"dbg5       pitch:            %d\n",ping->pitch);
-		fprintf(stderr,"dbg5       ping_heave:       %d\n",ping->ping_heave);
-		fprintf(stderr,"dbg5       sound_vel:        %d\n",ping->sound_vel);
-		fprintf(stderr,"dbg5       beam bath xtrack ltrack tt amp qual heave\n");
-		for (i=0;i<ping->beams_bath;i++)
-			fprintf(stderr,"dbg5       beam:%d  bath:%d  xtrck:%d  ltrck:%d tt:%d  amp:%d  qual:%d  heave:%d\n",
-				i,ping->bath[i],ping->bath_acrosstrack[i],
-				ping->bath_alongtrack[i],ping->tt[i],
-				ping->amp[i],ping->quality[i],ping->heave[i]);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_emoldraw_rd_em121bath(int verbose, FILE *mbfp,
-		struct mbsys_simrad_struct *store, int *error)
-{
-	char	*function_name = "mbr_emoldraw_rd_em121bath";
-	int	status = MB_SUCCESS;
-	struct mbsys_simrad_survey_struct *ping;
-	char	line[EM_121_BATH_SIZE];
-	char	beamarray[11];
-	short int short_val;
-	short int *short_ptr;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		}
-
-	/* get ping structure */
-	ping = (struct mbsys_simrad_survey_struct *) store->ping;
-
-	/* read record into char array */
-	status = fread(line,1,EM_121_BATH_SIZE,mbfp);
-	if (status == EM_121_BATH_SIZE)
-		status = MB_SUCCESS;
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	/* get data */
-	if (status == MB_SUCCESS)
-		{
-		/* get ascii stuff */
-		store->kind = MB_DATA_DATA;
-		mb_get_int(&(store->day),              line,      2);
-		mb_get_int(&(store->month),            line+2,    2);
-		mb_get_int(&(store->year),             line+4,    2);
-		mb_get_int(&(store->hour),             line+6,    2);
-		mb_get_int(&(store->minute),           line+8,    2);
-		mb_get_int(&(store->second),           line+10,   2);
-		mb_get_int(&(store->centisecond),      line+12,   2);
-
-		/* get binary stuff */
-		mb_get_binary_short(MB_YES, &line[14], &short_val); ping->ping_number = (int) short_val;
-		ping->bath_mode = (int) line[16];
-		ping->bath_res = 0;
-		ping->bath_quality = (int) line[17];
-		ping->bath_num = (int) line[18];
-		ping->beams_bath = ping->bath_num;
-		ping->pulse_length = (int) line[19];
-		ping->beam_width = (int) line[20];
-		ping->power_level = (int) line[21];
-		ping->tx_status = (int) line[22];
-		ping->rx_status = (int) line[23];
-		mb_get_binary_short(MB_YES, &line[24], &short_val); ping->keel_depth = (int) short_val;
-		mb_get_binary_short(MB_YES, &line[26], &short_val); ping->heading = (int) short_val;
-		mb_get_binary_short(MB_YES, &line[28], &short_val); ping->roll = (int) short_val;
-		mb_get_binary_short(MB_YES, &line[30], &short_val); ping->pitch = (int) short_val;
-		mb_get_binary_short(MB_YES, &line[32], &short_val); ping->ping_heave = (int) short_val;
-		mb_get_binary_short(MB_YES, &line[34], &short_val); ping->sound_vel = (int) short_val;
-		ping->along_res = (int) line[36];
-		ping->across_res = (int) line[37];
-		ping->depth_res = (int) line[38];
-		ping->range_res = (int) line[39];
-		for (i=0;i<ping->beams_bath;i++)
-			{
-			for (j=0;j<11;j++)
-				beamarray[j] = line[44+11*i+j];
-			short_ptr = (short int *) beamarray;
-			mb_get_binary_short(MB_YES, &short_ptr[0], (short *) &ping->bath[i]);
-			mb_get_binary_short(MB_YES, &short_ptr[1], &ping->bath_acrosstrack[i]);
-			mb_get_binary_short(MB_YES, &short_ptr[2], &ping->bath_alongtrack[i]);
-			mb_get_binary_short(MB_YES, &short_ptr[3], &ping->tt[i]);
-			ping->amp[i] = (mb_s_char) beamarray[8];
-			ping->quality[i] = (mb_u_char) beamarray[9];
-			ping->heave[i] = (mb_s_char) beamarray[10];
-			if (ping->bath[i] == 0)
-				ping->beamflag[i] = MB_FLAG_NULL;
-			else
-				ping->beamflag[i] = MB_FLAG_NONE;
-			}
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       year:             %d\n",store->year);
-		fprintf(stderr,"dbg5       month:            %d\n",store->month);
-		fprintf(stderr,"dbg5       day:              %d\n",store->day);
-		fprintf(stderr,"dbg5       hour:             %d\n",store->hour);
-		fprintf(stderr,"dbg5       minute:           %d\n",store->minute);
-		fprintf(stderr,"dbg5       sec:              %d\n",store->second);
-		fprintf(stderr,"dbg5       centisecond:      %d\n",store->centisecond);
-		fprintf(stderr,"dbg5       ping_number:      %d\n",ping->ping_number);
-		fprintf(stderr,"dbg5       beams_bath:       %d\n",ping->beams_bath);
-		fprintf(stderr,"dbg5       bath_mode:        %d\n",ping->bath_mode);
-		fprintf(stderr,"dbg5       bath_quality:     %d\n",ping->bath_quality);
-		fprintf(stderr,"dbg5       bath_num:         %d\n",ping->bath_num);
-		fprintf(stderr,"dbg5       pulse_length:     %d\n",ping->pulse_length);
-		fprintf(stderr,"dbg5       beam_width:       %d\n",ping->beam_width);
-		fprintf(stderr,"dbg5       power_level:      %d\n",ping->power_level);
-		fprintf(stderr,"dbg5       tx_status:        %d\n",ping->tx_status);
-		fprintf(stderr,"dbg5       rx_status:        %d\n",ping->rx_status);
-		fprintf(stderr,"dbg5       along_res:        %d\n",ping->along_res);
-		fprintf(stderr,"dbg5       across_res:       %d\n",ping->across_res);
-		fprintf(stderr,"dbg5       depth_res:        %d\n",ping->depth_res);
-		fprintf(stderr,"dbg5       range_res:        %d\n",ping->range_res);
-		fprintf(stderr,"dbg5       keel_depth:       %d\n",ping->keel_depth);
-		fprintf(stderr,"dbg5       heading:          %d\n",ping->heading);
-		fprintf(stderr,"dbg5       roll:             %d\n",ping->roll);
-		fprintf(stderr,"dbg5       pitch:            %d\n",ping->pitch);
-		fprintf(stderr,"dbg5       ping_heave:       %d\n",ping->ping_heave);
-		fprintf(stderr,"dbg5       sound_vel:        %d\n",ping->sound_vel);
-		fprintf(stderr,"dbg5       beam bath xtrack ltrack tt amp qual heave\n");
-		for (i=0;i<ping->beams_bath;i++)
-			fprintf(stderr,"dbg5       beam:%d  bath:%d  xtrck:%d  ltrck:%d tt:%d  amp:%d  qual:%d  heave:%d\n",
-				i,ping->bath[i],ping->bath_acrosstrack[i],
-				ping->bath_alongtrack[i],ping->tt[i],
-				ping->amp[i],ping->quality[i],ping->heave[i]);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_emoldraw_rd_ss(int verbose, FILE *mbfp,
-		struct mbsys_simrad_struct *store,
-		int swath_id, int first, int *more, int *error)
-{
-	char	*function_name = "mbr_emoldraw_rd_ss";
-	int	status = MB_SUCCESS;
-	struct mbsys_simrad_survey_struct *ping;
-	char	line[EM_SS_SIZE];
-	int	num_datagrams;
-	int	datagram;
-	int	num_beams;
-	int	beamlist[MBSYS_SIMRAD_MAXBEAMS];
-	mb_s_char *beam_ss;
-	int	ioffset;
-	int	npixelsum;
-	short int short_val;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		fprintf(stderr,"dbg2       swath_id:   %d\n",swath_id);
-		fprintf(stderr,"dbg2       first:      %d\n",first);
-		}
-
-	/* get ping structure */
-	ping = (struct mbsys_simrad_survey_struct *) store->ping;
-
-	/* if first call for current ping, initialize */
-	if (first == MB_YES)
-		{
-		ping->pixels_ssraw = 0;
-		for (i=0;i<ping->beams_bath;i++)
-			{
-			ping->beam_samples[i] = 0;
-			ping->beam_center_sample[i] = 0;
-			ping->beam_start_sample[i] = 0;
-			}
-		}
-
-	/* read first record into char array */
-	status = fread(line,1,EM_SS_SIZE,mbfp);
-	if (status == EM_SS_SIZE)
-		status = MB_SUCCESS;
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	/* get data */
-	if (status == MB_SUCCESS)
-		{
-		/* get ascii stuff */
-		store->kind = MB_DATA_DATA;
-		mb_get_int(&(store->day),              line,      2);
-		mb_get_int(&(store->month),            line+2,    2);
-		mb_get_int(&(store->year),             line+4,    2);
-		mb_get_int(&(store->hour),             line+6,    2);
-		mb_get_int(&(store->minute),           line+8,    2);
-		mb_get_int(&(store->second),           line+10,   2);
-		mb_get_int(&(store->centisecond),      line+12,   2);
-
-		/* set swath id */
-		ping->swath_id = swath_id;
-
-		/* get binary stuff */
-		mb_get_binary_short(MB_YES, &line[14], &short_val); ping->ping_number = (int) short_val;
-/*		mb_get_binary_short(MB_YES, &line[16], &short_val); ping->sound_vel = (int) short_val;*/
-		ping->ss_mode = (int) line[18];
-		num_datagrams = (int) line[19];
-		datagram = (int) line[20];
-		num_beams = (int) line[21];
-
-		/* check for good values */
-		if (num_datagrams < 1 || num_datagrams > 255
-		    || datagram < 1 || datagram > 255
-		    || num_beams < 1 || num_beams > MBSYS_SIMRAD_MAXBEAMS)
-			{
-			num_beams = 0;
-			}
-
-		/* get number of pixels */
-		npixelsum = 0;
-		for (i=0;i<num_beams;i++)
-			{
-			beamlist[i] = ((int) line[22+6*i]) - 1;
-			ping->beam_frequency[beamlist[i]] = (short int) line[23+6*i];
-			mb_get_binary_short(MB_YES, &line[24+6*i], &ping->beam_samples[beamlist[i]]);
-			mb_get_binary_short(MB_YES, &line[26+6*i], &ping->beam_center_sample[beamlist[i]]);
-			npixelsum += ping->beam_samples[beamlist[i]];
-			}
-
-		/* check for bad numbers of pixels indicating a broken
-		    record */
-		if (npixelsum > 523)
-		    for (i=0;i<num_beams;i++)
-			{
-			ping->beam_samples[beamlist[i]] = 0;
-			}
-
-		/* load up the sidescan for each beam */
-		ioffset = 22+6*num_beams;
-		for (i=0;i<num_beams;i++)
-			{
-			/* do not ever load more data than can be
-			    in the data record */
-			if (ping->pixels_ssraw + ping->beam_samples[beamlist[i]]
-				> MBSYS_SIMRAD_MAXRAWPIXELS)
-				ping->beam_samples[beamlist[i]] = 0;
-
-			/* get the sidescan */
-			ping->beam_start_sample[beamlist[i]] = ping->pixels_ssraw;
-			for (j=0;j<ping->beam_samples[beamlist[i]];j++)
-				{
-				ping->ssraw[ping->pixels_ssraw] =
-					(mb_s_char) line[ioffset];
-				ioffset++;
-				ping->pixels_ssraw++;
-				}
-			}
-		}
-
-	/* set status */
-	if (status == MB_SUCCESS)
-		ping->ss_status = EM_SS_AMPONLY;
-	else
-		ping->ss_status = EM_SS_NONE;
-
-	/* set flag if another sidescan record needs to be read */
-	if (status == MB_SUCCESS && datagram < num_datagrams)
-		*more = MB_YES;
-	else
-		*more = MB_NO;
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       year:             %d\n",store->year);
-		fprintf(stderr,"dbg5       month:            %d\n",store->month);
-		fprintf(stderr,"dbg5       day:              %d\n",store->day);
-		fprintf(stderr,"dbg5       hour:             %d\n",store->hour);
-		fprintf(stderr,"dbg5       minute:           %d\n",store->minute);
-		fprintf(stderr,"dbg5       sec:              %d\n",store->second);
-		fprintf(stderr,"dbg5       centisecond:      %d\n",store->centisecond);
-		fprintf(stderr,"dbg5       ping_number:      %d\n",ping->ping_number);
-		fprintf(stderr,"dbg5       sound_vel:        %d\n",ping->sound_vel);
-		fprintf(stderr,"dbg5       ss_mode:          %d\n",ping->ss_mode);
-		fprintf(stderr,"dbg5       num_datagrams:    %d\n",num_datagrams);
-		fprintf(stderr,"dbg5       datagram:         %d\n",datagram);
-		fprintf(stderr,"dbg5       num_beams:        %d\n",num_beams);
-		fprintf(stderr,"dbg5       beam frequency samples center\n");
-		for (i=0;i<num_beams;i++)
-			fprintf(stderr,"dbg5       beam:%d  frequency:%d  samples:%d  center:%d  start:%d\n",
-				beamlist[i],ping->beam_frequency[beamlist[i]],
-				ping->beam_samples[beamlist[i]],
-				ping->beam_center_sample[beamlist[i]],
-				ping->beam_start_sample[beamlist[i]]);
-		for (i=0;i<num_beams;i++)
-			{
-			beam_ss = &ping->ssraw[ping->beam_start_sample[beamlist[i]]];
-			for (j=0;j<ping->beam_samples[beamlist[i]];j++)
-				fprintf(stderr,"dbg5       beam:%d pixel:%d  amp:%d\n",
-					beamlist[i],j,beam_ss[j]);
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       more:       %d\n",*more);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_emoldraw_rd_ssp(int verbose, FILE *mbfp,
-		struct mbsys_simrad_struct *store,
-		int swath_id, int first, int *more, int *error)
-{
-	char	*function_name = "mbr_emoldraw_rd_ssp";
-	int	status = MB_SUCCESS;
-	struct mbsys_simrad_survey_struct *ping;
-	char	line[EM_SSP_SIZE];
-	char	*char_ptr;
-	int	num_datagrams;
-	int	datagram;
-	int	num_beams;
-	int	beamlist[MBSYS_SIMRAD_MAXBEAMS];
-	mb_s_char *beam_ss;
-	short int *beam_ssp;
-	int	ioffset;
-	int	npixelsum;
-	short int short_val;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		fprintf(stderr,"dbg2       swath_id:   %d\n",swath_id);
-		fprintf(stderr,"dbg2       first:      %d\n",first);
-		}
-
-	/* get ping structure */
-	ping = (struct mbsys_simrad_survey_struct *) store->ping;
-
-	/* if first call for current ping, initialize */
-	if (first == MB_YES)
-		{
-		ping->pixels_ssraw = 0;
-		for (i=0;i<ping->beams_bath;i++)
-			{
-			ping->beam_samples[i] = 0;
-			ping->beam_center_sample[i] = 0;
-			ping->beam_start_sample[i] = 0;
-			}
-		}
-
-	/* read first record into char array */
-	status = fread(line,1,EM_SSP_SIZE,mbfp);
-	if (status == EM_SSP_SIZE)
-		status = MB_SUCCESS;
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	/* get data */
-	if (status == MB_SUCCESS)
-		{
-		/* get ascii stuff */
-		store->kind = MB_DATA_DATA;
-		mb_get_int(&(store->day),              line,      2);
-		mb_get_int(&(store->month),            line+2,    2);
-		mb_get_int(&(store->year),             line+4,    2);
-		mb_get_int(&(store->hour),             line+6,    2);
-		mb_get_int(&(store->minute),           line+8,    2);
-		mb_get_int(&(store->second),           line+10,   2);
-		mb_get_int(&(store->centisecond),      line+12,   2);
-
-		/* set swath id */
-		ping->swath_id = swath_id;
-
-		/* get binary stuff */
-		mb_get_binary_short(MB_YES, &line[14], &short_val); ping->ping_number = (int) short_val;
-/*		mb_get_binary_short(MB_YES, &line[16], &short_val); ping->sound_vel = (int) short_val;*/
-		ping->ss_mode = (int) line[18];
-		num_datagrams = (int) line[19];
-		datagram = (int) line[20];
-		num_beams = (int) line[21];
-
-		/* check for good values */
-		if (num_datagrams < 1 || num_datagrams > 255
-		    || datagram < 1 || datagram > 255
-		    || num_beams < 1 || num_beams > MBSYS_SIMRAD_MAXBEAMS)
-			{
-			num_beams = 0;
-			}
-
-		/* get number of pixels */
-		npixelsum = 0;
-		for (i=0;i<num_beams;i++)
-			{
-			beamlist[i] = ((int) line[22+6*i]) - 1;
-			ping->beam_frequency[beamlist[i]] = (short int) line[23+6*i];
-			mb_get_binary_short(MB_YES, &line[24+6*i], &ping->beam_samples[beamlist[i]]);
-			mb_get_binary_short(MB_YES, &line[26+6*i], &ping->beam_center_sample[beamlist[i]]);
-			npixelsum += ping->beam_samples[beamlist[i]];
-			}
-
-		/* check for bad numbers of pixels indicating a broken
-		    record */
-		if (npixelsum > 523)
-		    for (i=0;i<num_beams;i++)
-			{
-			ping->beam_samples[beamlist[i]] = 0;
-			}
-
-		/* load up the sidescan for each beam */
-		ioffset = 22+6*num_beams;
-		char_ptr = (char *) &short_val;
-		for (i=0;i<num_beams;i++)
-			{
-			/* do not ever load more data than we can store */
-			if (ping->pixels_ssraw + ping->beam_samples[beamlist[i]]
-				> MBSYS_SIMRAD_MAXRAWPIXELS)
-				ping->beam_samples[beamlist[i]] = 0;
-
-			/* get the sidescan */
-			ping->beam_start_sample[beamlist[i]] = ping->pixels_ssraw;
-			for (j=0;j<ping->beam_samples[beamlist[i]];j++)
-				{
-				ping->ssraw[ping->pixels_ssraw] = (mb_s_char) line[ioffset];
-				char_ptr[0] = line[ioffset+1];
-				char_ptr[1] = line[ioffset+2];
-				mb_get_binary_short(MB_YES, (short *)char_ptr, &ping->ssp[ping->pixels_ssraw]);
-				ioffset += 3;
-				ping->pixels_ssraw++;
-				}
-			}
-		}
-
-	/* set status */
-	if (status == MB_SUCCESS)
-		ping->ss_status = EM_SS_AMPPHASE;
-	else
-		ping->ss_status = EM_SS_NONE;
-
-	/* set flag if another sidescan record needs to be read */
-	if (status == MB_SUCCESS && datagram < num_datagrams)
-		*more = MB_YES;
-	else
-		*more = MB_NO;
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       year:             %d\n",store->year);
-		fprintf(stderr,"dbg5       month:            %d\n",store->month);
-		fprintf(stderr,"dbg5       day:              %d\n",store->day);
-		fprintf(stderr,"dbg5       hour:             %d\n",store->hour);
-		fprintf(stderr,"dbg5       minute:           %d\n",store->minute);
-		fprintf(stderr,"dbg5       sec:              %d\n",store->second);
-		fprintf(stderr,"dbg5       centisecond:      %d\n",store->centisecond);
-		fprintf(stderr,"dbg5       ping_number:      %d\n",ping->ping_number);
-		fprintf(stderr,"dbg5       sound_vel:        %d\n",ping->sound_vel);
-		fprintf(stderr,"dbg5       ss_mode:          %d\n",ping->ss_mode);
-		fprintf(stderr,"dbg5       num_datagrams:    %d\n",num_datagrams);
-		fprintf(stderr,"dbg5       datagram:         %d\n",datagram);
-		fprintf(stderr,"dbg5       num_beams:        %d\n",num_beams);
-		fprintf(stderr,"dbg5       beam frequency samples center\n");
-		for (i=0;i<num_beams;i++)
-			fprintf(stderr,"dbg5       beam:%d  frequency:%d  samples:%d  center:%d  start:%d\n",
-				beamlist[i],ping->beam_frequency[beamlist[i]],
-				ping->beam_samples[beamlist[i]],
-				ping->beam_center_sample[beamlist[i]],
-				ping->beam_start_sample[beamlist[i]]);
-		for (i=0;i<num_beams;i++)
-			{
-			beam_ss = &ping->ssraw[ping->beam_start_sample[beamlist[i]]];
-			beam_ssp = &ping->ssp[ping->beam_start_sample[beamlist[i]]];
-			for (j=0;j<ping->beam_samples[beamlist[i]];j++)
-				fprintf(stderr,"dbg5       beam:%d pixel:%d  amp:%d phase:%d\n",
-					beamlist[i],j,beam_ss[j],beam_ssp[j]);
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       more:       %d\n",*more);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_emoldraw_wr_data(int verbose, void *mbio_ptr,
-				void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_emoldraw_wr_data";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_simrad_struct *store;
-	struct mbsys_simrad_survey_struct *ping;
-	FILE	*mbfp;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_simrad_struct *) store_ptr;
-	ping = (struct mbsys_simrad_survey_struct *) store->ping;
-	mbfp = mb_io_ptr->mbfp;
-
-	if (store->kind == MB_DATA_COMMENT)
-		{
-#ifdef MBR_EMOLDRAW_DEBUG
-	fprintf(stderr,"call mbr_emoldraw_wr_parameter\n");
-#endif
-		status = mbr_emoldraw_wr_parameter(verbose,mbfp,store,error);
-		}
-	else if (store->kind == MB_DATA_START)
-		{
-#ifdef MBR_EMOLDRAW_DEBUG
-	fprintf(stderr,"call mbr_emoldraw_wr_start\n");
-#endif
-		status = mbr_emoldraw_wr_start(verbose,mbfp,store,error);
-		}
-	else if (store->kind == MB_DATA_STOP)
-		{
-#ifdef MBR_EMOLDRAW_DEBUG
-	fprintf(stderr,"call mbr_emoldraw_wr_stop\n");
-#endif
-		status = mbr_emoldraw_wr_stop(verbose,mbfp,store,error);
-		}
-	else if (store->kind == MB_DATA_NAV)
-		{
-#ifdef MBR_EMOLDRAW_DEBUG
-	fprintf(stderr,"call mbr_emoldraw_wr_pos\n");
-#endif
-		status = mbr_emoldraw_wr_pos(verbose,mbfp,store,error);
-		}
-	else if (store->kind == MB_DATA_VELOCITY_PROFILE)
-		{
-#ifdef MBR_EMOLDRAW_DEBUG
-	fprintf(stderr,"call mbr_emoldraw_wr_svp\n");
-#endif
-		status = mbr_emoldraw_wr_svp(verbose,mbfp,store,error);
-		}
-	else if (store->kind == MB_DATA_DATA
-		&& (store->sonar == MBSYS_SIMRAD_EM12S
-		    || store->sonar == MBSYS_SIMRAD_EM12D))
-		{
-#ifdef MBR_EMOLDRAW_DEBUG
-	fprintf(stderr,"call mbr_emoldraw_wr_em12bath\n");
-#endif
-		status = mbr_emoldraw_wr_em12bath(verbose,mbfp,store,error);
-		if (ping->ss_status == EM_SS_AMPONLY)
-		    {
-#ifdef MBR_EMOLDRAW_DEBUG
-	fprintf(stderr,"call mbr_emoldraw_wr_ss\n");
-#endif
-		    status = mbr_emoldraw_wr_ss(verbose,mbfp,store,error);
-		    }
-		else if (ping->ss_status == EM_SS_AMPPHASE)
-		    {
-#ifdef MBR_EMOLDRAW_DEBUG
-	fprintf(stderr,"call mbr_emoldraw_wr_ssp\n");
-#endif
-		    status = mbr_emoldraw_wr_ssp(verbose,mbfp,store,error);
-		    }
-		}
-	else if (store->kind == MB_DATA_DATA
-		&& (store->sonar == MBSYS_SIMRAD_EM1000))
-		{
-#ifdef MBR_EMOLDRAW_DEBUG
-	fprintf(stderr,"call mbr_emoldraw_wr_em1000bath\n");
-#endif
-		status = mbr_emoldraw_wr_em1000bath(verbose,mbfp,store,error);
-		if (ping->ss_status == EM_SS_AMPONLY)
-		    {
-#ifdef MBR_EMOLDRAW_DEBUG
-	fprintf(stderr,"call mbr_emoldraw_wr_ss\n");
-#endif
-		    status = mbr_emoldraw_wr_ss(verbose,mbfp,store,error);
-		    }
-		else if (ping->ss_status == EM_SS_AMPPHASE)
-		    {
-#ifdef MBR_EMOLDRAW_DEBUG
-	fprintf(stderr,"call mbr_emoldraw_wr_ssp\n");
-#endif
-		    status = mbr_emoldraw_wr_ssp(verbose,mbfp,store,error);
-		    }
-		}
-	else if (store->kind == MB_DATA_DATA
-		&& (store->sonar == MBSYS_SIMRAD_EM121))
-		{
-#ifdef MBR_EMOLDRAW_DEBUG
-	fprintf(stderr,"call mbr_emoldraw_wr_em121bath\n");
-#endif
-		status = mbr_emoldraw_wr_em121bath(verbose,mbfp,store,error);
-		if (ping->ss_status == EM_SS_AMPONLY)
-		    {
-#ifdef MBR_EMOLDRAW_DEBUG
-	fprintf(stderr,"call mbr_emoldraw_wr_ss\n");
-#endif
-		    status = mbr_emoldraw_wr_ss(verbose,mbfp,store,error);
-		    }
-		else if (ping->ss_status == EM_SS_AMPPHASE)
-		    {
-#ifdef MBR_EMOLDRAW_DEBUG
-	fprintf(stderr,"call mbr_emoldraw_wr_ssp\n");
-#endif
-		    status = mbr_emoldraw_wr_ssp(verbose,mbfp,store,error);
-		    }
-		}
-	else
-		{
-#ifdef MBR_EMOLDRAW_DEBUG
-	fprintf(stderr,"call nothing - kind:%d sonar:%d\n", store->kind, store->sonar);
-#endif
-		status = MB_FAILURE;
-		*error = MB_ERROR_BAD_KIND;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Data record kind in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       kind:       %d\n",store->kind);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_emoldraw_wr_start(int verbose, FILE *mbfp,
-				struct mbsys_simrad_struct *store, int *error)
-{
-	char	*function_name = "mbr_emoldraw_wr_start";
-	int	status = MB_SUCCESS;
-	char	line[EM_START_SIZE];
-	short int label;
-	int	write_len;
-	int	write_size;
-	unsigned short checksum;
-	short int short_val;
-	mb_u_char   *uchar_ptr;
-	char   *char_ptr;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       year:             %d\n",store->par_year);
-		fprintf(stderr,"dbg5       month:            %d\n",store->par_month);
-		fprintf(stderr,"dbg5       day:              %d\n",store->par_day);
-		fprintf(stderr,"dbg5       hour:             %d\n",store->par_hour);
-		fprintf(stderr,"dbg5       minute:           %d\n",store->par_minute);
-		fprintf(stderr,"dbg5       sec:              %d\n",store->par_second);
-		fprintf(stderr,"dbg5       centisecond:      %d\n",store->par_centisecond);
-		fprintf(stderr,"dbg5       pos_type:         %d\n",store->pos_type);
-		fprintf(stderr,"dbg5       pos_delay:        %f\n",store->pos_delay);
-		fprintf(stderr,"dbg5       roll_offset:      %f\n",store->pos_delay);
-		fprintf(stderr,"dbg5       pitch_offset:     %f\n",store->pos_delay);
-		fprintf(stderr,"dbg5       heading_offset:   %f\n",store->pos_delay);
-		fprintf(stderr,"dbg5       em100_td:         %f\n",store->pos_delay);
-		fprintf(stderr,"dbg5       em100_tx:         %f\n",store->pos_delay);
-		fprintf(stderr,"dbg5       em100_ty:         %f\n",store->pos_delay);
-		fprintf(stderr,"dbg5       em12_td:          %f\n",store->pos_delay);
-		fprintf(stderr,"dbg5       em12_tx:          %f\n",store->pos_delay);
-		fprintf(stderr,"dbg5       em12_ty:          %f\n",store->pos_delay);
-		fprintf(stderr,"dbg5       em1000_td:        %f\n",store->pos_delay);
-		fprintf(stderr,"dbg5       em1000_tx:        %f\n",store->pos_delay);
-		fprintf(stderr,"dbg5       em1000_ty:        %f\n",store->pos_delay);
-		fprintf(stderr,"dbg5       survey_line:      %d\n",store->survey_line);
-		fprintf(stderr,"dbg5       comment:          %s\n",store->comment);
-		}
-
-	/* write the record size */
-	mb_put_binary_int(MB_NO, (int) (EM_START_SIZE + 2), (void *) &write_size);
-	write_len = fwrite(&write_size,1,4,mbfp);
-	if (write_len != 4)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	else
-		status = MB_SUCCESS;
-
-	/* write the record label */
-	mb_put_binary_short(MB_NO, (short) EM_START, (void *) &label);
-	write_len = fwrite(&label,1,2,mbfp);
-	if (write_len != 2)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	else
-		status = MB_SUCCESS;
-
-	/* write out the data */
-	if (status == MB_SUCCESS)
-		{
-		/* construct record */
-		sprintf(line,"%2.2d%2.2d%2.2d,",
-			store->par_day,store->par_month,store->par_year);
-		sprintf(line+7,"%2.2d%2.2d%2.2d%2.2d,",
-			store->par_hour,store->par_minute,
-			store->par_second,store->par_centisecond);
-		sprintf(line+16,  "PIS=%1d,",   store->pos_type);
-		sprintf(line+22,  "PTD=%5.1f,",   store->pos_delay);
-		sprintf(line+32,  "MSR=%5.2f,",   store->roll_offset);
-		sprintf(line+42,  "MSP=%5.2f,",   store->pitch_offset);
-		sprintf(line+52,  "MSG=%5.2f,",   store->heading_offset);
-		sprintf(line+62,  "EM100TD=%5.1f,",   store->em100_td);
-		sprintf(line+76,  "EM100TX=%5.1f,",   store->em100_tx);
-		sprintf(line+90,  "EM100TY=%5.1f,",   store->em100_ty);
-		sprintf(line+104, "EM12TD=%5.1f,",   store->em12_td);
-		sprintf(line+117, "EM12TX=%5.1f,",   store->em12_tx);
-		sprintf(line+130, "EM12TY=%5.1f,",   store->em12_ty);
-		sprintf(line+143, "EM1000TD=%5.1f,",   store->em1000_td);
-		sprintf(line+158, "EM1000TX=%5.1f,",   store->em1000_tx);
-		sprintf(line+173, "EM1000TY=%5.1f,",   store->em1000_ty);
-		for (i=0;i<128;i++)
-			line[188+i] = store->spare_parameter[i];
-		sprintf(line+316, "SURVEY_LINE_%4.4d,", store->survey_line);
-		sprintf(line+333, "COMMENT:");
-		for (i=0;i<80;i++)
-			line[341+i] = store->comment[i];
-		line[EM_START_SIZE-3] = 0x03;
-
-		/* compute and set checksum */
-		uchar_ptr = (mb_u_char *) line;
-		checksum = 0;
-		for (j=0;j<EM_START_SIZE-3;j++)
-		    checksum += uchar_ptr[j];
-		mb_put_binary_short(MB_YES, (short) checksum, (void *) &short_val);
-		char_ptr = (char *) &short_val;
-		line[EM_START_SIZE-2] = char_ptr[0];
-		line[EM_START_SIZE-1] = char_ptr[1];
-
-		/* write out data */
-		write_len = fwrite(line,1,EM_START_SIZE,mbfp);
-
-		if (write_len != EM_START_SIZE)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_emoldraw_wr_stop(int verbose, FILE *mbfp,
-				struct mbsys_simrad_struct *store, int *error)
-{
-	char	*function_name = "mbr_emoldraw_wr_stop";
-	int	status = MB_SUCCESS;
-	char	line[EM_STOP_SIZE];
-	short int label;
-	int	write_len;
-	int	write_size;
-	unsigned short checksum;
-	short int short_val;
-	mb_u_char   *uchar_ptr;
-	char   *char_ptr;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       year:             %d\n",store->par_year);
-		fprintf(stderr,"dbg5       month:            %d\n",store->par_month);
-		fprintf(stderr,"dbg5       day:              %d\n",store->par_day);
-		fprintf(stderr,"dbg5       hour:             %d\n",store->par_hour);
-		fprintf(stderr,"dbg5       minute:           %d\n",store->par_minute);
-		fprintf(stderr,"dbg5       sec:              %d\n",store->par_second);
-		fprintf(stderr,"dbg5       centisecond:      %d\n",store->par_centisecond);
-		fprintf(stderr,"dbg5       pos_type:         %d\n",store->pos_type);
-		fprintf(stderr,"dbg5       pos_delay:        %f\n",store->pos_delay);
-		fprintf(stderr,"dbg5       roll_offset:      %f\n",store->pos_delay);
-		fprintf(stderr,"dbg5       pitch_offset:     %f\n",store->pos_delay);
-		fprintf(stderr,"dbg5       heading_offset:   %f\n",store->pos_delay);
-		fprintf(stderr,"dbg5       em100_td:         %f\n",store->pos_delay);
-		fprintf(stderr,"dbg5       em100_tx:         %f\n",store->pos_delay);
-		fprintf(stderr,"dbg5       em100_ty:         %f\n",store->pos_delay);
-		fprintf(stderr,"dbg5       em12_td:          %f\n",store->pos_delay);
-		fprintf(stderr,"dbg5       em12_tx:          %f\n",store->pos_delay);
-		fprintf(stderr,"dbg5       em12_ty:          %f\n",store->pos_delay);
-		fprintf(stderr,"dbg5       em1000_td:        %f\n",store->pos_delay);
-		fprintf(stderr,"dbg5       em1000_tx:        %f\n",store->pos_delay);
-		fprintf(stderr,"dbg5       em1000_ty:        %f\n",store->pos_delay);
-		fprintf(stderr,"dbg5       survey_line:      %d\n",store->survey_line);
-		fprintf(stderr,"dbg5       comment:          %s\n",store->comment);
-		}
-
-	/* write the record size */
-	mb_put_binary_int(MB_NO, (int) (EM_STOP_SIZE + 2), (void *) &write_size);
-	write_len = fwrite(&write_size,1,4,mbfp);
-	if (write_len != 4)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	else
-		status = MB_SUCCESS;
-
-	/* write the record label */
-	mb_put_binary_short(MB_NO, (short) EM_STOP, (void *) &label);
-	write_len = fwrite(&label,1,2,mbfp);
-	if (write_len != 2)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	else
-		status = MB_SUCCESS;
-
-	/* write out the data */
-	if (status == MB_SUCCESS)
-		{
-		/* construct record */
-		sprintf(line,"%2.2d%2.2d%2.2d,",
-			store->par_day,store->par_month,store->par_year);
-		sprintf(line+7,"%2.2d%2.2d%2.2d%2.2d,",
-			store->par_hour,store->par_minute,
-			store->par_second,store->par_centisecond);
-		sprintf(line+16,  "PIS=%1d,",   store->pos_type);
-		sprintf(line+22,  "PTD=%5.1f,",   store->pos_delay);
-		sprintf(line+32,  "MSR=%5.2f,",   store->roll_offset);
-		sprintf(line+42,  "MSP=%5.2f,",   store->pitch_offset);
-		sprintf(line+52,  "MSG=%5.2f,",   store->heading_offset);
-		sprintf(line+62,  "EM100TD=%5.1f,",   store->em100_td);
-		sprintf(line+76,  "EM100TX=%5.1f,",   store->em100_tx);
-		sprintf(line+90,  "EM100TY=%5.1f,",   store->em100_ty);
-		sprintf(line+104, "EM12TD=%5.1f,",   store->em12_td);
-		sprintf(line+117, "EM12TX=%5.1f,",   store->em12_tx);
-		sprintf(line+130, "EM12TY=%5.1f,",   store->em12_ty);
-		sprintf(line+143, "EM1000TD=%5.1f,",   store->em1000_td);
-		sprintf(line+158, "EM1000TX=%5.1f,",   store->em1000_tx);
-		sprintf(line+173, "EM1000TY=%5.1f,",   store->em1000_ty);
-		for (i=0;i<128;i++)
-			line[188+i] = store->spare_parameter[i];
-		sprintf(line+316, "SURVEY_LINE_%4.4d,", store->survey_line);
-		sprintf(line+333, "COMMENT:");
-		for (i=0;i<80;i++)
-			line[341+i] = store->comment[i];
-		line[EM_STOP_SIZE-3] = 0x03;
-
-		/* compute and set checksum */
-		uchar_ptr = (mb_u_char *) line;
-		checksum = 0;
-		for (j=0;j<EM_STOP_SIZE-3;j++)
-		    checksum += uchar_ptr[j];
-		mb_put_binary_short(MB_YES, (short) checksum, (void *) &short_val);
-		char_ptr = (char *) &short_val;
-		line[EM_STOP_SIZE-2] = char_ptr[0];
-		line[EM_STOP_SIZE-1] = char_ptr[1];
-
-		/* write out data */
-		write_len = fwrite(line,1,EM_STOP_SIZE,mbfp);
-		if (write_len != EM_STOP_SIZE)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_emoldraw_wr_parameter(int verbose, FILE *mbfp,
-				struct mbsys_simrad_struct *store, int *error)
-{
-	char	*function_name = "mbr_emoldraw_wr_parameter";
-	int	status = MB_SUCCESS;
-	char	line[EM_PARAMETER_SIZE];
-	short int label;
-	int	write_len;
-	int	write_size;
-	unsigned short checksum;
-	short int short_val;
-	mb_u_char   *uchar_ptr;
-	char   *char_ptr;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       year:             %d\n",store->par_year);
-		fprintf(stderr,"dbg5       month:            %d\n",store->par_month);
-		fprintf(stderr,"dbg5       day:              %d\n",store->par_day);
-		fprintf(stderr,"dbg5       hour:             %d\n",store->par_hour);
-		fprintf(stderr,"dbg5       minute:           %d\n",store->par_minute);
-		fprintf(stderr,"dbg5       sec:              %d\n",store->par_second);
-		fprintf(stderr,"dbg5       centisecond:      %d\n",store->par_centisecond);
-		fprintf(stderr,"dbg5       pos_type:         %d\n",store->pos_type);
-		fprintf(stderr,"dbg5       pos_delay:        %f\n",store->pos_delay);
-		fprintf(stderr,"dbg5       roll_offset:      %f\n",store->pos_delay);
-		fprintf(stderr,"dbg5       pitch_offset:     %f\n",store->pos_delay);
-		fprintf(stderr,"dbg5       heading_offset:   %f\n",store->pos_delay);
-		fprintf(stderr,"dbg5       em100_td:         %f\n",store->pos_delay);
-		fprintf(stderr,"dbg5       em100_tx:         %f\n",store->pos_delay);
-		fprintf(stderr,"dbg5       em100_ty:         %f\n",store->pos_delay);
-		fprintf(stderr,"dbg5       em12_td:          %f\n",store->pos_delay);
-		fprintf(stderr,"dbg5       em12_tx:          %f\n",store->pos_delay);
-		fprintf(stderr,"dbg5       em12_ty:          %f\n",store->pos_delay);
-		fprintf(stderr,"dbg5       em1000_td:        %f\n",store->pos_delay);
-		fprintf(stderr,"dbg5       em1000_tx:        %f\n",store->pos_delay);
-		fprintf(stderr,"dbg5       em1000_ty:        %f\n",store->pos_delay);
-		fprintf(stderr,"dbg5       survey_line:      %d\n",store->survey_line);
-		fprintf(stderr,"dbg5       comment:          %s\n",store->comment);
-		}
-
-	/* write the record size */
-	mb_put_binary_int(MB_NO, (int) (EM_PARAMETER_SIZE + 2), (void *) &write_size);
-	write_len = fwrite(&write_size,1,4,mbfp);
-	if (write_len != 4)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	else
-		status = MB_SUCCESS;
-
-	/* write the record label */
-	mb_put_binary_short(MB_NO, (short) EM_PARAMETER, (void *) &label);
-	write_len = fwrite(&label,1,2,mbfp);
-	if (write_len != 2)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	else
-		status = MB_SUCCESS;
-
-	/* write out the data */
-	if (status == MB_SUCCESS)
-		{
-		/* construct record */
-		sprintf(line,"%2.2d%2.2d%2.2d,",
-			store->par_day,store->par_month,store->par_year);
-		sprintf(line+7,"%2.2d%2.2d%2.2d%2.2d,",
-			store->par_hour,store->par_minute,
-			store->par_second,store->par_centisecond);
-		sprintf(line+16,  "PIS=%1d,",   store->pos_type);
-		sprintf(line+22,  "PTD=%5.1f,",   store->pos_delay);
-		sprintf(line+32,  "MSR=%5.2f,",   store->roll_offset);
-		sprintf(line+42,  "MSP=%5.2f,",   store->pitch_offset);
-		sprintf(line+52,  "MSG=%5.2f,",   store->heading_offset);
-		sprintf(line+62,  "EM100TD=%5.1f,",   store->em100_td);
-		sprintf(line+76,  "EM100TX=%5.1f,",   store->em100_tx);
-		sprintf(line+90,  "EM100TY=%5.1f,",   store->em100_ty);
-		sprintf(line+104, "EM12TD=%5.1f,",   store->em12_td);
-		sprintf(line+117, "EM12TX=%5.1f,",   store->em12_tx);
-		sprintf(line+130, "EM12TY=%5.1f,",   store->em12_ty);
-		sprintf(line+143, "EM1000TD=%5.1f,",   store->em1000_td);
-		sprintf(line+158, "EM1000TX=%5.1f,",   store->em1000_tx);
-		sprintf(line+173, "EM1000TY=%5.1f,",   store->em1000_ty);
-		for (i=0;i<128;i++)
-			line[188+i] = store->spare_parameter[i];
-		sprintf(line+316, "SURVEY_LINE_%4.4d,", store->survey_line);
-		sprintf(line+333, "COMMENT:");
-		for (i=0;i<80;i++)
-			line[341+i] = store->comment[i];
-		line[EM_PARAMETER_SIZE-3] = 0x03;
-
-		/* compute and set checksum */
-		uchar_ptr = (mb_u_char *) line;
-		checksum = 0;
-		for (j=0;j<EM_PARAMETER_SIZE-3;j++)
-		    checksum += uchar_ptr[j];
-		mb_put_binary_short(MB_YES, (short) checksum, (void *) &short_val);
-		char_ptr = (char *) &short_val;
-		line[EM_PARAMETER_SIZE-2] = char_ptr[0];
-		line[EM_PARAMETER_SIZE-1] = char_ptr[1];
-
-		/* write out data */
-		write_len = fwrite(line,1,EM_PARAMETER_SIZE,mbfp);
-		if (write_len != EM_PARAMETER_SIZE)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_emoldraw_wr_pos(int verbose, FILE *mbfp,
-				struct mbsys_simrad_struct *store, int *error)
-{
-	char	*function_name = "mbr_emoldraw_wr_pos";
-	int	status = MB_SUCCESS;
-	char	line[EM_POS_SIZE];
-	short int label;
-	int	write_len;
-	int	write_size;
-	unsigned short checksum;
-	short int short_val;
-	mb_u_char   *uchar_ptr;
-	char   *char_ptr;
-	double	degree_dec;
-	int	degree;
-	double	minute;
-	char	hemisphere;
-	int	j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       year:             %d\n",store->pos_year);
-		fprintf(stderr,"dbg5       month:            %d\n",store->pos_month);
-		fprintf(stderr,"dbg5       day:              %d\n",store->pos_day);
-		fprintf(stderr,"dbg5       hour:             %d\n",store->pos_hour);
-		fprintf(stderr,"dbg5       minute:           %d\n",store->pos_minute);
-		fprintf(stderr,"dbg5       sec:              %d\n",store->pos_second);
-		fprintf(stderr,"dbg5       centisecond:      %d\n",store->pos_centisecond);
-		fprintf(stderr,"dbg5       longitude:        %f\n",store->pos_longitude);
-		fprintf(stderr,"dbg5       latitude:         %f\n",store->pos_latitude);
-		fprintf(stderr,"dbg5       utm_northing:     %f\n",store->utm_northing);
-		fprintf(stderr,"dbg5       utm_easting:      %f\n",store->utm_easting);
-		fprintf(stderr,"dbg5       utm_zone:         %d\n",store->utm_zone);
-		fprintf(stderr,"dbg5       utm_zone_lon:     %f\n",store->utm_zone_lon);
-		fprintf(stderr,"dbg5       utm_system:       %d\n",store->utm_system);
-		fprintf(stderr,"dbg5       pos_quality:      %d\n",store->pos_quality);
-		fprintf(stderr,"dbg5       speed:            %f\n",store->speed);
-		fprintf(stderr,"dbg5       line_heading:     %f\n",store->line_heading);
-		}
-
-	/* write the record size */
-	mb_put_binary_int(MB_NO, (int) (EM_POS_SIZE + 2), (void *) &write_size);
-	write_len = fwrite(&write_size,1,4,mbfp);
-	if (write_len != 4)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	else
-		status = MB_SUCCESS;
-
-	/* write the record label */
-	mb_put_binary_short(MB_NO, (short) EM_POS, (void *) &label);
-	write_len = fwrite(&label,1,2,mbfp);
-	if (write_len != 2)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	else
-		status = MB_SUCCESS;
-
-	/* write out the data */
-	if (status == MB_SUCCESS)
-		{
-		/* construct record */
-		sprintf(line,"%2.2d%2.2d%2.2d,",
-			store->pos_day,store->pos_month,store->pos_year);
-		sprintf(line+7,"%2.2d%2.2d%2.2d%2.2d,",
-			store->pos_hour,store->pos_minute,
-			store->pos_second,store->pos_centisecond);
-		if (store->pos_latitude > 0.0)
-			{
-			hemisphere = 'N';
-			degree_dec = store->pos_latitude;
-			}
-		else
-			{
-			hemisphere = 'S';
-			degree_dec = -store->pos_latitude;
-			}
-		degree = (int) floor(degree_dec);
-		minute = 60.0*(degree_dec - degree);
-		sprintf(line+16,"%2.2d%7.4f%c,",degree,minute,hemisphere);
-		if (store->pos_longitude > 180.0)
-			store->pos_longitude = store->pos_longitude - 360.0;
-		if (store->pos_longitude <= -180.0)
-			store->pos_longitude = store->pos_longitude + 360.0;
-		if (store->pos_longitude > 0.0)
-			{
-			hemisphere = 'E';
-			degree_dec = store->pos_longitude;
-			}
-		else
-			{
-			hemisphere = 'W';
-			degree_dec = -store->pos_longitude;
-			}
-		degree = (int) floor(degree_dec);
-		minute = 60.0*(degree_dec - degree);
-		sprintf(line+27,"%3.3d%7.4f%c,",degree,minute,hemisphere);
-		sprintf(line+39,"%11.1f,%9.1f,%2.2d,",
-			store->utm_northing,store->utm_easting,store->utm_zone);
-		if (store->utm_zone_lon > 180.0)
-			store->utm_zone_lon = store->utm_zone_lon - 360.0;
-		if (store->utm_zone_lon <= -180.0)
-			store->utm_zone_lon = store->utm_zone_lon + 360.0;
-		if (store->utm_zone_lon > 0.0)
-			{
-			hemisphere = 'E';
-			degree_dec = store->utm_zone_lon;
-			}
-		else
-			{
-			hemisphere = 'W';
-			degree_dec = -store->utm_zone_lon;
-			}
-		degree = (int) floor(degree_dec);
-		minute = 60.0*(degree_dec - degree);
-		sprintf(line+64,"%3.3d%7.4f%c,",degree,minute,hemisphere);
-		sprintf(line+76,"%1.1d,%1.1d,%4.1f,%5.1f",
-			store->utm_system,store->pos_quality,
-			store->speed,store->line_heading);
-		line[EM_POS_SIZE-3] = 0x03;
-
-		/* compute and set checksum */
-		uchar_ptr = (mb_u_char *) line;
-		checksum = 0;
-		for (j=0;j<EM_POS_SIZE-3;j++)
-		    checksum += uchar_ptr[j];
-		mb_put_binary_short(MB_YES, (short) checksum, (void *) &short_val);
-		char_ptr = (char *) &short_val;
-		line[EM_POS_SIZE-2] = char_ptr[0];
-		line[EM_POS_SIZE-1] = char_ptr[1];
-
-		/* write out data */
-		write_len = fwrite(line,1,EM_POS_SIZE,mbfp);
-		if (write_len != EM_POS_SIZE)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_emoldraw_wr_svp(int verbose, FILE *mbfp,
-				struct mbsys_simrad_struct *store, int *error)
-{
-	char	*function_name = "mbr_emoldraw_wr_svp";
-	int	status = MB_SUCCESS;
-	char	line[EM_SVP_SIZE];
-	short int label;
-	int	write_len;
-	int	write_size;
-	unsigned short checksum;
-	short int short_val;
-	mb_u_char   *uchar_ptr;
-	char   *char_ptr;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       year:             %d\n",store->svp_year);
-		fprintf(stderr,"dbg5       month:            %d\n",store->svp_month);
-		fprintf(stderr,"dbg5       day:              %d\n",store->svp_day);
-		fprintf(stderr,"dbg5       hour:             %d\n",store->svp_hour);
-		fprintf(stderr,"dbg5       minute:           %d\n",store->svp_minute);
-		fprintf(stderr,"dbg5       sec:              %d\n",store->svp_second);
-		fprintf(stderr,"dbg5       centisecond:      %d\n",store->svp_centisecond);
-		fprintf(stderr,"dbg5       svp_num:          %d\n",store->svp_num);
-		for (i=0;i<store->svp_num;i++)
-			fprintf(stderr,"dbg5       depth: %d     vel: %d\n",
-				store->svp_depth[i],store->svp_vel[i]);
-		}
-
-	/* write the record size */
-	mb_put_binary_int(MB_NO, (int) (EM_SVP_SIZE + 2), (void *) &write_size);
-	write_len = fwrite(&write_size,1,4,mbfp);
-	if (write_len != 4)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	else
-		status = MB_SUCCESS;
-
-	/* write the record label */
-	mb_put_binary_short(MB_NO, (short) EM_SVP, (void *) &label);
-	write_len = fwrite(&label,1,2,mbfp);
-	if (write_len != 2)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	else
-		status = MB_SUCCESS;
-
-	/* write out the data */
-	if (status == MB_SUCCESS)
-		{
-		/* construct record */
-		sprintf(line,"%2.2d%2.2d%2.2d",
-			store->svp_day,store->svp_month,store->svp_year);
-		sprintf(line+6,"%2.2d%2.2d%2.2d%2.2d",
-			store->svp_hour,store->svp_minute,
-			store->svp_second,store->svp_centisecond);
-		mb_put_binary_short(MB_YES, (short) store->svp_num, (void *) &line[14]);
-		for (i=0;i<store->svp_num;i++)
-			{
-			mb_put_binary_short(MB_YES, (short) store->svp_depth[i], (void *) &line[16+4*i]);
-			mb_put_binary_short(MB_YES, (short) store->svp_vel[i], (void *) &line[18+4*i]);
-			}
-		for (i=store->svp_num;i<100;i++)
-			{
-			mb_put_binary_short(MB_YES, (short) 0, (void *) &line[16+4*i]);
-			mb_put_binary_short(MB_YES, (short) 0, (void *) &line[18+4*i]);
-			}
-		line[EM_SVP_SIZE-3] = 0x03;
-
-		/* compute and set checksum */
-		uchar_ptr = (mb_u_char *) line;
-		checksum = 0;
-		for (j=0;j<EM_SVP_SIZE-3;j++)
-		    checksum += uchar_ptr[j];
-		mb_put_binary_short(MB_YES, (short) checksum, (void *) &short_val);
-		char_ptr = (char *) &short_val;
-		line[EM_SVP_SIZE-2] = char_ptr[0];
-		line[EM_SVP_SIZE-1] = char_ptr[1];
-
-		/* write out data */
-		write_len = fwrite(line,1,EM_SVP_SIZE,mbfp);
-		if (write_len != EM_SVP_SIZE)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_emoldraw_wr_em1000bath(int verbose, FILE *mbfp,
-				struct mbsys_simrad_struct *store, int *error)
-{
-	char	*function_name = "mbr_emoldraw_wr_em1000bath";
-	int	status = MB_SUCCESS;
-	struct mbsys_simrad_survey_struct *ping;
-	char	line[EM_1000_BATH_SIZE];
-	char	beamarray[11];
-	short int label;
-	int	write_len;
-	int	write_size;
-	unsigned short checksum;
-	short int short_val;
-	mb_u_char   *uchar_ptr;
-	char   *char_ptr;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		}
-
-	/* get ping structure */
-	ping = (struct mbsys_simrad_survey_struct *) store->ping;
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       year:             %d\n",store->year);
-		fprintf(stderr,"dbg5       month:            %d\n",store->month);
-		fprintf(stderr,"dbg5       day:              %d\n",store->day);
-		fprintf(stderr,"dbg5       hour:             %d\n",store->hour);
-		fprintf(stderr,"dbg5       minute:           %d\n",store->minute);
-		fprintf(stderr,"dbg5       sec:              %d\n",store->second);
-		fprintf(stderr,"dbg5       centisecond:      %d\n",store->centisecond);
-		fprintf(stderr,"dbg5       ping_number:      %d\n",ping->ping_number);
-		fprintf(stderr,"dbg5       beams_bath:       %d\n",ping->beams_bath);
-		fprintf(stderr,"dbg5       bath_mode:        %d\n",ping->bath_mode);
-		fprintf(stderr,"dbg5       bath_res:         %d\n",ping->bath_res);
-		fprintf(stderr,"dbg5       bath_quality:     %d\n",ping->ping_number);
-		fprintf(stderr,"dbg5       keel_depth:       %d\n",ping->keel_depth);
-		fprintf(stderr,"dbg5       heading:          %d\n",ping->heading);
-		fprintf(stderr,"dbg5       roll:             %d\n",ping->roll);
-		fprintf(stderr,"dbg5       pitch:            %d\n",ping->pitch);
-		fprintf(stderr,"dbg5       xducer_pitch:     %d\n",ping->xducer_pitch);
-		fprintf(stderr,"dbg5       ping_heave:       %d\n",ping->ping_heave);
-		fprintf(stderr,"dbg5       sound_vel:        %d\n",ping->sound_vel);
-		fprintf(stderr,"dbg5       beam bath xtrack ltrack tt amp qual heave\n");
-		for (i=0;i<ping->beams_bath;i++)
-			fprintf(stderr,"dbg5       beam:%d  bath:%d  xtrck:%d  ltrck:%d tt:%d  amp:%d  qual:%d  heave:%d\n",
-				i,ping->bath[i],ping->bath_acrosstrack[i],
-				ping->bath_alongtrack[i],ping->tt[i],
-				ping->amp[i],ping->quality[i],ping->heave[i]);
-		}
-
-	/* write the record size */
-	mb_put_binary_int(MB_NO, (int) (EM_1000_BATH_SIZE + 2), (void *) &write_size);
-	write_len = fwrite(&write_size,1,4,mbfp);
-	if (write_len != 4)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	else
-		status = MB_SUCCESS;
-
-	/* write the record label */
-	mb_put_binary_short(MB_NO, (short) EM_1000_BATH, (void *) &label);
-	write_len = fwrite(&label,1,2,mbfp);
-	if (write_len != 2)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	else
-		status = MB_SUCCESS;
-
-	/* write out the data */
-	if (status == MB_SUCCESS)
-		{
-		/* construct record */
-		sprintf(line,"%2.2d%2.2d%2.2d",
-			store->day,store->month,store->year);
-		sprintf(line+6,"%2.2d%2.2d%2.2d%2.2d",
-			store->hour,store->minute,
-			store->second,store->centisecond);
-		mb_put_binary_short(MB_YES, (short) ping->ping_number, (void *) &line[14]);
-		line[16] = (char) ping->bath_mode;
-		line[17] = (char) ping->bath_quality;
-		mb_put_binary_short(MB_YES, (short) ping->keel_depth, (void *) &line[18]);
-		mb_put_binary_short(MB_YES, (short) ping->heading, (void *) &line[20]);
-		mb_put_binary_short(MB_YES, (short) ping->roll, (void *) &line[22]);
-		mb_put_binary_short(MB_YES, (short) ping->pitch, (void *) &line[24]);
-		mb_put_binary_short(MB_YES, (short) ping->xducer_pitch, (void *) &line[26]);
-		mb_put_binary_short(MB_YES, (short) ping->ping_heave, (void *) &line[28]);
-		mb_put_binary_short(MB_YES, (short) ping->sound_vel, (void *) &line[30]);
-		for (i=0;i<MBSYS_EM1000_MAXBEAMS;i++)
-			{
-			if (!mb_beam_ok(ping->beamflag[i]))
-				ping->bath[i] = 0;
-			mb_put_binary_short(MB_YES, (short) ping->bath[i], (void *) &beamarray[0]);
-			mb_put_binary_short(MB_YES, (short) ping->bath_acrosstrack[i], (void *) &beamarray[2]);
-			mb_put_binary_short(MB_YES, (short) ping->bath_alongtrack[i], (void *) &beamarray[4]);
-			mb_put_binary_short(MB_YES, (short) ping->tt[i], (void *) &beamarray[6]);
-			beamarray[8] = (char) ping->amp[i];
-			beamarray[9] = (char) ping->quality[i];
-			beamarray[10] = (char) ping->heave[i];
-			for (j=0;j<11;j++)
-				line[32+11*i+j] = beamarray[j];
-			}
-		line[EM_1000_BATH_SIZE-3] = 0x03;
-
-		/* compute and set checksum */
-		uchar_ptr = (mb_u_char *) line;
-		checksum = 0;
-		for (j=0;j<EM_1000_BATH_SIZE-3;j++)
-		    checksum += uchar_ptr[j];
-		mb_put_binary_short(MB_YES, (short) checksum, (void *) &short_val);
-		char_ptr = (char *) &short_val;
-		line[EM_1000_BATH_SIZE-2] = char_ptr[0];
-		line[EM_1000_BATH_SIZE-1] = char_ptr[1];
-
-		/* write out data */
-		write_len = fwrite(line,1,EM_1000_BATH_SIZE,mbfp);
-		if (write_len != EM_1000_BATH_SIZE)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_emoldraw_wr_em12bath(int verbose, FILE *mbfp,
-				struct mbsys_simrad_struct *store, int *error)
-{
-	char	*function_name = "mbr_emoldraw_wr_em12bath";
-	int	status = MB_SUCCESS;
-	struct mbsys_simrad_survey_struct *ping;
-	char	line[EM_12S_BATH_SIZE];
-	char	beamarray[11];
-	short int label;
-	int	write_len;
-	int	write_size;
-	unsigned short checksum;
-	short int short_val;
-	mb_u_char   *uchar_ptr;
-	char   *char_ptr;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		}
-
-	/* get ping structure */
-	ping = (struct mbsys_simrad_survey_struct *) store->ping;
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       year:             %d\n",store->year);
-		fprintf(stderr,"dbg5       month:            %d\n",store->month);
-		fprintf(stderr,"dbg5       day:              %d\n",store->day);
-		fprintf(stderr,"dbg5       hour:             %d\n",store->hour);
-		fprintf(stderr,"dbg5       minute:           %d\n",store->minute);
-		fprintf(stderr,"dbg5       sec:              %d\n",store->second);
-		fprintf(stderr,"dbg5       centisecond:      %d\n",store->centisecond);
-		fprintf(stderr,"dbg5       ping_number:      %d\n",ping->ping_number);
-		fprintf(stderr,"dbg5       beams_bath:       %d\n",ping->beams_bath);
-		fprintf(stderr,"dbg5       bath_mode:        %d\n",ping->bath_mode);
-		fprintf(stderr,"dbg5       bath_res:         %d\n",ping->bath_res);
-		fprintf(stderr,"dbg5       bath_quality:     %d\n",ping->bath_quality);
-		fprintf(stderr,"dbg5       keel_depth:       %d\n",ping->keel_depth);
-		fprintf(stderr,"dbg5       heading:          %d\n",ping->heading);
-		fprintf(stderr,"dbg5       roll:             %d\n",ping->roll);
-		fprintf(stderr,"dbg5       pitch:            %d\n",ping->pitch);
-		fprintf(stderr,"dbg5       ping_heave:       %d\n",ping->ping_heave);
-		fprintf(stderr,"dbg5       sound_vel:        %d\n",ping->sound_vel);
-		fprintf(stderr,"dbg5       beam bath xtrack ltrack tt amp qual heave\n");
-		for (i=0;i<ping->beams_bath;i++)
-			fprintf(stderr,"dbg5       beam:%d  bath:%d  xtrck:%d  ltrck:%d tt:%d  amp:%d  qual:%d  heave:%d\n",
-				i,ping->bath[i],ping->bath_acrosstrack[i],
-				ping->bath_alongtrack[i],ping->tt[i],
-				ping->amp[i],ping->quality[i],ping->heave[i]);
-		}
-
-	/* write the record size */
-	mb_put_binary_int(MB_NO, (int) (EM_12S_BATH_SIZE + 2), (void *) &write_size);
-	write_len = fwrite(&write_size,1,4,mbfp);
-	if (write_len != 4)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	else
-		status = MB_SUCCESS;
-
-	/* write the record label */
-	if (ping->swath_id == EM_SWATH_CENTER)
-		mb_put_binary_short(MB_NO, (short) EM_12S_BATH, (void *) &label);
-	else if (ping->swath_id == EM_SWATH_PORT)
-		mb_put_binary_short(MB_NO, (short) EM_12DP_BATH, (void *) &label);
-	else
-		mb_put_binary_short(MB_NO, (short) EM_12DS_BATH, (void *) &label);
-	write_len = fwrite(&label,1,2,mbfp);
-	if (write_len != 2)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	else
-		status = MB_SUCCESS;
-
-	/* write out the data */
-	if (status == MB_SUCCESS)
-		{
-		/* construct record */
-		sprintf(line,"%2.2d%2.2d%2.2d",
-			store->day,store->month,store->year);
-		sprintf(line+6,"%2.2d%2.2d%2.2d%2.2d",
-			store->hour,store->minute,
-			store->second,store->centisecond);
-		mb_put_binary_short(MB_YES, (short) ping->ping_number, (void *) &line[14]);
-		line[16] = (char) ping->bath_res;
-		line[17] = (char) ping->bath_quality;
-		mb_put_binary_short(MB_YES, (short) ping->keel_depth, (void *) &line[18]);
-		mb_put_binary_short(MB_YES, (short) ping->heading, (void *) &line[20]);
-		mb_put_binary_short(MB_YES, (short) ping->roll, (void *) &line[22]);
-		mb_put_binary_short(MB_YES, (short) ping->pitch, (void *) &line[24]);
-		mb_put_binary_short(MB_YES, (short) ping->ping_heave, (void *) &line[26]);
-		mb_put_binary_short(MB_YES, (short) ping->sound_vel, (void *) &line[28]);
-		line[30] = (char) ping->bath_mode;
-		line[31] = (char) 0;
-		for (i=0;i<MBSYS_EM12_MAXBEAMS;i++)
-			{
-			if (!mb_beam_ok(ping->beamflag[i]))
-				ping->bath[i] = 0;
-			mb_put_binary_short(MB_YES, (short) ping->bath[i], (void *) &beamarray[0]);
-			mb_put_binary_short(MB_YES, (short) ping->bath_acrosstrack[i], (void *) &beamarray[2]);
-			mb_put_binary_short(MB_YES, (short) ping->bath_alongtrack[i], (void *) &beamarray[4]);
-			mb_put_binary_short(MB_YES, (short) ping->tt[i], (void *) &beamarray[6]);
-			beamarray[8] = (char) ping->amp[i];
-			beamarray[9] = (char) ping->quality[i];
-			beamarray[10] = (char) ping->heave[i];
-			for (j=0;j<11;j++)
-				line[32+11*i+j] = beamarray[j];
-			}
-		line[EM_12S_BATH_SIZE-3] = 0x03;
-
-		/* compute and set checksum */
-		uchar_ptr = (mb_u_char *) line;
-		checksum = 0;
-		for (j=0;j<EM_12S_BATH_SIZE-3;j++)
-		    checksum += uchar_ptr[j];
-		mb_put_binary_short(MB_YES, (short) checksum, (void *) &short_val);
-		char_ptr = (char *) &short_val;
-		line[EM_12S_BATH_SIZE-2] = char_ptr[0];
-		line[EM_12S_BATH_SIZE-1] = char_ptr[1];
-
-		/* write out data */
-		write_len = fwrite(line,1,EM_12S_BATH_SIZE,mbfp);
-		if (write_len != EM_12S_BATH_SIZE)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_emoldraw_wr_em121bath(int verbose, FILE *mbfp,
-				struct mbsys_simrad_struct *store, int *error)
-{
-	char	*function_name = "mbr_emoldraw_wr_em121bath";
-	int	status = MB_SUCCESS;
-	struct mbsys_simrad_survey_struct *ping;
-	char	line[EM_121_BATH_SIZE];
-	char	beamarray[11];
-	short int label;
-	int	write_len;
-	int	write_size;
-	unsigned short checksum;
-	short int short_val;
-	mb_u_char   *uchar_ptr;
-	char   *char_ptr;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		}
-
-	/* get ping structure */
-	ping = (struct mbsys_simrad_survey_struct *) store->ping;
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       year:             %d\n",store->year);
-		fprintf(stderr,"dbg5       month:            %d\n",store->month);
-		fprintf(stderr,"dbg5       day:              %d\n",store->day);
-		fprintf(stderr,"dbg5       hour:             %d\n",store->hour);
-		fprintf(stderr,"dbg5       minute:           %d\n",store->minute);
-		fprintf(stderr,"dbg5       sec:              %d\n",store->second);
-		fprintf(stderr,"dbg5       centisecond:      %d\n",store->centisecond);
-		fprintf(stderr,"dbg5       ping_number:      %d\n",ping->ping_number);
-		fprintf(stderr,"dbg5       beams_bath:       %d\n",ping->beams_bath);
-		fprintf(stderr,"dbg5       bath_mode:        %d\n",ping->bath_mode);
-		fprintf(stderr,"dbg5       bath_quality:     %d\n",ping->bath_quality);
-		fprintf(stderr,"dbg5       bath_num:         %d\n",ping->bath_num);
-		fprintf(stderr,"dbg5       pulse_length:     %d\n",ping->pulse_length);
-		fprintf(stderr,"dbg5       beam_width:       %d\n",ping->beam_width);
-		fprintf(stderr,"dbg5       power_level:      %d\n",ping->power_level);
-		fprintf(stderr,"dbg5       tx_status:        %d\n",ping->tx_status);
-		fprintf(stderr,"dbg5       rx_status:        %d\n",ping->rx_status);
-		fprintf(stderr,"dbg5       along_res:        %d\n",ping->along_res);
-		fprintf(stderr,"dbg5       across_res:       %d\n",ping->across_res);
-		fprintf(stderr,"dbg5       depth_res:        %d\n",ping->depth_res);
-		fprintf(stderr,"dbg5       range_res:        %d\n",ping->range_res);
-		fprintf(stderr,"dbg5       keel_depth:       %d\n",ping->keel_depth);
-		fprintf(stderr,"dbg5       heading:          %d\n",ping->heading);
-		fprintf(stderr,"dbg5       roll:             %d\n",ping->roll);
-		fprintf(stderr,"dbg5       pitch:            %d\n",ping->pitch);
-		fprintf(stderr,"dbg5       ping_heave:       %d\n",ping->ping_heave);
-		fprintf(stderr,"dbg5       sound_vel:        %d\n",ping->sound_vel);
-		fprintf(stderr,"dbg5       beam bath xtrack ltrack tt amp qual heave\n");
-		for (i=0;i<ping->beams_bath;i++)
-			fprintf(stderr,"dbg5       beam:%d  bath:%d  xtrck:%d  ltrck:%d tt:%d  amp:%d  qual:%d  heave:%d\n",
-				i,ping->bath[i],ping->bath_acrosstrack[i],
-				ping->bath_alongtrack[i],ping->tt[i],
-				ping->amp[i],ping->quality[i],ping->heave[i]);
-		}
-
-	/* write the record size */
-	mb_put_binary_int(MB_NO, (int) (EM_121_BATH_SIZE + 2), (void *) &write_size);
-	write_len = fwrite(&write_size,1,4,mbfp);
-	if (write_len != 4)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	else
-		status = MB_SUCCESS;
-
-	/* write the record label */
-	mb_put_binary_short(MB_NO, (short) EM_121_BATH, (void *) &label);
-	write_len = fwrite(&label,1,2,mbfp);
-	if (write_len != 2)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	else
-		status = MB_SUCCESS;
-
-	/* write out the data */
-	if (status == MB_SUCCESS)
-		{
-		/* construct record */
-		sprintf(line,"%2.2d%2.2d%2.2d",
-			store->day,store->month,store->year);
-		sprintf(line+6,"%2.2d%2.2d%2.2d%2.2d",
-			store->hour,store->minute,
-			store->second,store->centisecond);
-		mb_put_binary_short(MB_YES, (short) ping->ping_number, (void *) &line[14]);
-		line[16] = (char) ping->bath_mode;
-		line[17] = (char) ping->bath_quality;
-		line[18] = (char) ping->bath_num;
-		line[19] = (char) ping->pulse_length;
-		line[20] = (char) ping->beam_width;
-		line[21] = (char) ping->power_level;
-		line[22] = (char) ping->tx_status;
-		line[23] = (char) ping->rx_status;
-		mb_put_binary_short(MB_YES, (short) ping->keel_depth, (void *) &line[24]);
-		mb_put_binary_short(MB_YES, (unsigned short) ping->heading, (void *) &line[26]);
-		mb_put_binary_short(MB_YES, (short) ping->roll, (void *) &line[28]);
-		mb_put_binary_short(MB_YES, (short) ping->pitch, (void *) &line[30]);
-		mb_put_binary_short(MB_YES, (short) ping->ping_heave, (void *) &line[32]);
-		mb_put_binary_short(MB_YES, (short) ping->sound_vel, (void *) &line[34]);
-		line[36] = (char) ping->along_res;
-		line[37] = (char) ping->across_res;
-		line[38] = (char) ping->depth_res;
-		line[39] = (char) ping->range_res;
-		for (i=0;i<MBSYS_EM121_MAXBEAMS;i++)
-			{
-			if (!mb_beam_ok(ping->beamflag[i]))
-				ping->bath[i] = 0;
-			mb_put_binary_short(MB_YES, (short) ping->bath[i], (void *) &beamarray[0]);
-			mb_put_binary_short(MB_YES, (short) ping->bath_acrosstrack[i], (void *) &beamarray[2]);
-			mb_put_binary_short(MB_YES, (short) ping->bath_alongtrack[i], (void *) &beamarray[4]);
-			mb_put_binary_short(MB_YES, (short) ping->tt[i], (void *) &beamarray[6]);
-			beamarray[8] = (char) ping->amp[i];
-			beamarray[9] = (char) ping->quality[i];
-			beamarray[10] = (char) ping->heave[i];
-			for (j=0;j<11;j++)
-				line[44+11*i+j] = beamarray[j];
-			}
-		line[EM_121_BATH_SIZE-3] = 0x03;
-
-		/* compute and set checksum */
-		uchar_ptr = (mb_u_char *) line;
-		checksum = 0;
-		for (j=0;j<EM_121_BATH_SIZE-3;j++)
-		    checksum += uchar_ptr[j];
-		mb_put_binary_short(MB_YES, (short) checksum, (void *) &short_val);
-		char_ptr = (char *) &short_val;
-		line[EM_121_BATH_SIZE-2] = char_ptr[0];
-		line[EM_121_BATH_SIZE-1] = char_ptr[1];
-
-		/* write out data */
-		write_len = fwrite(line,1,EM_121_BATH_SIZE,mbfp);
-		if (write_len != EM_121_BATH_SIZE)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_emoldraw_wr_ss(int verbose, FILE *mbfp,
-				struct mbsys_simrad_struct *store, int *error)
-{
-	char	*function_name = "mbr_emoldraw_wr_ss";
-	int	status = MB_SUCCESS;
-	struct mbsys_simrad_survey_struct *ping;
-	char	line[EM_SS_SIZE];
-	short int label;
-	int	write_len;
-	int	write_size;
-	unsigned short checksum;
-	short int short_val;
-	mb_u_char   *uchar_ptr;
-	char   *char_ptr;
-	int	num_datagrams;
-	int	datagram;
-	int	num_beams;
-	int	datagram_start[MBSYS_EM1000_MAXBEAMS+1];
-	int	datagram_end[MBSYS_EM1000_MAXBEAMS+1];
-	int	datagram_size[MBSYS_EM1000_MAXBEAMS+1];
-	int	new_datagram_size;
-	mb_s_char *beam_ss;
-	int	ioffset;
-	int	odatagram;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		}
-
-	/* get ping structure */
-	ping = (struct mbsys_simrad_survey_struct *) store->ping;
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       year:             %d\n",store->year);
-		fprintf(stderr,"dbg5       month:            %d\n",store->month);
-		fprintf(stderr,"dbg5       day:              %d\n",store->day);
-		fprintf(stderr,"dbg5       hour:             %d\n",store->hour);
-		fprintf(stderr,"dbg5       minute:           %d\n",store->minute);
-		fprintf(stderr,"dbg5       sec:              %d\n",store->second);
-		fprintf(stderr,"dbg5       centisecond:      %d\n",store->centisecond);
-		fprintf(stderr,"dbg5       ping_number:      %d\n",ping->ping_number);
-		fprintf(stderr,"dbg5       sound_vel:        %d\n",ping->sound_vel);
-		fprintf(stderr,"dbg5       ss_mode:          %d\n",ping->ss_mode);
-		fprintf(stderr,"dbg5       beam frequency samples center start\n");
-		for (i=0;i<MBSYS_EM1000_MAXBEAMS;i++)
-			fprintf(stderr,"dbg5       beam:%d  frequency:%d  samples:%d  center:%d  start:%d\n",
-				i,ping->beam_frequency[i],
-				ping->beam_samples[i],
-				ping->beam_center_sample[i],
-				ping->beam_start_sample[i]);
-		for (i=0;i<MBSYS_EM1000_MAXBEAMS;i++)
-			{
-			beam_ss = &ping->ssraw[ping->beam_start_sample[i]];
-			for (j=0;j<ping->beam_samples[i];j++)
-				fprintf(stderr,"dbg5       beam:%d pixel:%d  amp:%d\n",
-					i,j,beam_ss[j]);
-			}
-		}
-
-	/* preprocess data to figure out how many
-		sidescan datagrams to output */
-	num_datagrams = 0;
-	datagram_size[0] = 22;
-	datagram_start[0] = 0;
-	datagram_end[0] = 0;
-	for (i=0;i<MBSYS_EM1000_MAXBEAMS;i++)
-		{
-		new_datagram_size = datagram_size[num_datagrams] + 6 + ping->beam_samples[i];
-		if (new_datagram_size > 551
-			&& i == MBSYS_EM1000_MAXBEAMS - 1)
-			{
-			datagram_end[num_datagrams] = i - 1;
-			num_datagrams++;
-			datagram_start[num_datagrams] = i;
-			datagram_end[num_datagrams] =
-				MBSYS_EM1000_MAXBEAMS - 1;
-			datagram_size[num_datagrams] =
-				22 + 6 + ping->beam_samples[i];
-			num_datagrams++;
-			}
-		else if (new_datagram_size > 551)
-			{
-			datagram_end[num_datagrams] = i - 1;
-			num_datagrams++;
-			datagram_start[num_datagrams] = i;
-			datagram_end[num_datagrams] =
-				MBSYS_EM1000_MAXBEAMS - 1;
-			datagram_size[num_datagrams] =
-				22 + 6 + ping->beam_samples[i];
-			}
-		else if (new_datagram_size == 551)
-			{
-			datagram_end[num_datagrams] = i;
-			datagram_size[num_datagrams] = new_datagram_size;
-			num_datagrams++;
-			datagram_start[num_datagrams] = i + 1;
-			datagram_end[num_datagrams] =
-				MBSYS_EM1000_MAXBEAMS - 1;
-			datagram_size[num_datagrams] = 22;
-			}
-		else if (i == MBSYS_EM1000_MAXBEAMS - 1)
-			{
-			datagram_end[num_datagrams] = i;
-			datagram_size[num_datagrams] = new_datagram_size;
-			num_datagrams++;
-			}
-		else
-			datagram_size[num_datagrams] = new_datagram_size;
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       num_datagrams:    %d\n",num_datagrams);
-		for (datagram=0;datagram<num_datagrams;datagram++)
-			{
-			fprintf(stderr,"\ndbg5       datagram[%d]:  beam %d to beam %d\n",
-				datagram,datagram_start[datagram],datagram_end[datagram]);
-			for (i=datagram_start[datagram];i<=datagram_end[datagram];i++)
-				fprintf(stderr,"dbg5       beam:%d  frequency:%d  samples:%d  center:%d\n",
-					i,ping->beam_frequency[i],
-					ping->beam_samples[i],
-					ping->beam_center_sample[i]);
-			}
-		}
-
-	/* now loop over all of the sidescan datagrams to be written */
-	for (datagram=0;datagram<num_datagrams;datagram++)
-	{
-	num_beams = datagram_end[datagram]
-		- datagram_start[datagram] + 1;
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       year:             %d\n",store->year);
-		fprintf(stderr,"dbg5       month:            %d\n",store->month);
-		fprintf(stderr,"dbg5       day:              %d\n",store->day);
-		fprintf(stderr,"dbg5       hour:             %d\n",store->hour);
-		fprintf(stderr,"dbg5       minute:           %d\n",store->minute);
-		fprintf(stderr,"dbg5       sec:              %d\n",store->second);
-		fprintf(stderr,"dbg5       centisecond:      %d\n",store->centisecond);
-		fprintf(stderr,"dbg5       ping_number:      %d\n",ping->ping_number);
-		fprintf(stderr,"dbg5       sound_vel:        %d\n",ping->sound_vel);
-		fprintf(stderr,"dbg5       ss_mode:          %d\n",ping->ss_mode);
-		fprintf(stderr,"dbg5       num_datagrams:    %d\n",num_datagrams);
-		fprintf(stderr,"dbg5       datagram:         %d\n",datagram);
-		fprintf(stderr,"dbg5       num_beams:        %d\n",num_beams);
-		for (i=datagram_start[datagram];i<=datagram_end[datagram];i++)
-			fprintf(stderr,"dbg5       beam:%d  frequency:%d  samples:%d  center:%d  start:%d\n",
-				i,ping->beam_frequency[i],
-				ping->beam_samples[i],
-				ping->beam_center_sample[i],
-				ping->beam_start_sample[i]);
-		for (i=datagram_start[datagram];i<=datagram_end[datagram];i++)
-			{
-			beam_ss = &ping->ssraw[ping->beam_start_sample[i]];
-			for (j=0;j<ping->beam_samples[i];j++)
-				fprintf(stderr,"dbg5       beam:%d pixel:%d  amp:%d\n",
-					i,j,beam_ss[j]);
-			}
-		}
-
-	/* write the record size */
-	mb_put_binary_int(MB_NO, (int) (EM_SS_SIZE + 2), (void *) &write_size);
-	write_len = fwrite(&write_size,1,4,mbfp);
-	if (write_len != 4)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	else
-		status = MB_SUCCESS;
-
-	/* write the record label */
-	if (ping->swath_id == EM_SWATH_CENTER)
-		mb_put_binary_short(MB_NO, (short) EM_12S_SS, (void *) &label);
-	else if (ping->swath_id == EM_SWATH_PORT)
-		mb_put_binary_short(MB_NO, (short) EM_12DP_SS, (void *) &label);
-	else
-		mb_put_binary_short(MB_NO, (short) EM_12DS_SS, (void *) &label);
-	write_len = fwrite(&label,1,2,mbfp);
-	if (write_len != 2)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	else
-		status = MB_SUCCESS;
-
-	/* write out the data */
-	if (status == MB_SUCCESS)
-		{
-		/* construct record */
-		sprintf(line,"%2.2d%2.2d%2.2d",
-			store->day,store->month,store->year);
-		sprintf(line+6,"%2.2d%2.2d%2.2d%2.2d",
-			store->hour,store->minute,
-			store->second,store->centisecond);
-		mb_put_binary_short(MB_YES, (short) ping->ping_number, (void *) &line[14]);
-		mb_put_binary_short(MB_YES, (short) ping->sound_vel, (void *) &line[16]);
-		line[18] = (char) ping->ss_mode;
-		line[19] = (char) num_datagrams;
-		odatagram = datagram + 1;
-		line[20] = (char) odatagram;
-		line[21] = (char) num_beams;
-		j=0;
-		for (i=datagram_start[datagram];i<=datagram_end[datagram];i++)
-			{
-			line[22 + 6*j] = (char) (i + 1);
-			line[23 + 6*j] = (char) ping->beam_frequency[i];
-			mb_put_binary_short(MB_YES, (short) ping->beam_samples[i], (void *) &line[24 + 6*j]);
-			mb_put_binary_short(MB_YES, (short) ping->beam_center_sample[i], (void *) &line[26 + 6*j]);
-			j++;
-			}
-		ioffset = 22 + 6*num_beams;
-		for (i=datagram_start[datagram];i<=datagram_end[datagram];i++)
-			{
-			beam_ss = &ping->ssraw[ping->beam_start_sample[i]];
-			for (j=0;j<ping->beam_samples[i];j++)
-				{
-				line[ioffset + j] = (char) beam_ss[j];
-				}
-			ioffset = ioffset + ping->beam_samples[i];
-			}
-		for (i=ioffset;i<EM_SS_SIZE;i++)
-			line[i] = (char) 0;
-		line[EM_SS_SIZE-3] = 0x03;
-
-		/* compute and set checksum */
-		uchar_ptr = (mb_u_char *) line;
-		checksum = 0;
-		for (j=0;j<EM_SS_SIZE-3;j++)
-		    checksum += uchar_ptr[j];
-		mb_put_binary_short(MB_YES, (short) checksum, (void *) &short_val);
-		char_ptr = (char *) &short_val;
-		line[EM_SS_SIZE-2] = char_ptr[0];
-		line[EM_SS_SIZE-1] = char_ptr[1];
-
-		/* write out data */
-		write_len = fwrite(line,1,EM_SS_SIZE,mbfp);
-		if (write_len != EM_SS_SIZE)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* end loop over datagrams */
-	}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_emoldraw_wr_ssp(int verbose, FILE *mbfp,
-				struct mbsys_simrad_struct *store, int *error)
-{
-	char	*function_name = "mbr_emoldraw_wr_ssp";
-	int	status = MB_SUCCESS;
-	struct mbsys_simrad_survey_struct *ping;
-	char	line[EM_SSP_SIZE];
-	short int label;
-	int	write_len;
-	int	write_size;
-	unsigned short checksum;
-	short int short_val;
-	mb_u_char   *uchar_ptr;
-	char   *char_ptr;
-	int	num_datagrams;
-	int	datagram;
-	int	num_beams;
-	int	datagram_start[MBSYS_SIMRAD_MAXBEAMS+1];
-	int	datagram_end[MBSYS_SIMRAD_MAXBEAMS+1];
-	int	datagram_size[MBSYS_SIMRAD_MAXBEAMS+1];
-	int	new_datagram_size;
-	mb_s_char *beam_ss;
-	short int *beam_ssp;
-	int	ioffset;
-	int	odatagram;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		}
-
-	/* get ping structure */
-	ping = (struct mbsys_simrad_survey_struct *) store->ping;
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       year:             %d\n",store->year);
-		fprintf(stderr,"dbg5       month:            %d\n",store->month);
-		fprintf(stderr,"dbg5       day:              %d\n",store->day);
-		fprintf(stderr,"dbg5       hour:             %d\n",store->hour);
-		fprintf(stderr,"dbg5       minute:           %d\n",store->minute);
-		fprintf(stderr,"dbg5       sec:              %d\n",store->second);
-		fprintf(stderr,"dbg5       centisecond:      %d\n",store->centisecond);
-		fprintf(stderr,"dbg5       ping_number:      %d\n",ping->ping_number);
-		fprintf(stderr,"dbg5       sound_vel:        %d\n",ping->sound_vel);
-		fprintf(stderr,"dbg5       ss_mode:          %d\n",ping->ss_mode);
-		fprintf(stderr,"dbg5       beam frequency samples center start\n");
-		for (i=0;i<MBSYS_SIMRAD_MAXBEAMS;i++)
-			fprintf(stderr,"dbg5       beam:%d  frequency:%d  samples:%d  center:%d  start:%d\n",
-				i,ping->beam_frequency[i],
-				ping->beam_samples[i],
-				ping->beam_center_sample[i],
-				ping->beam_start_sample[i]);
-		for (i=0;i<MBSYS_SIMRAD_MAXBEAMS;i++)
-			{
-			beam_ss = &ping->ssraw[ping->beam_start_sample[i]];
-			beam_ssp = &ping->ssp[ping->beam_start_sample[i]];
-			for (j=0;j<ping->beam_samples[i];j++)
-				fprintf(stderr,"dbg5       beam:%d pixel:%d  amp:%d phase:%d\n",
-					i,j,beam_ss[j],beam_ssp[j]);
-			}
-		}
-
-	/* preprocess data to figure out how many
-		sidescan datagrams to output */
-	num_datagrams = 0;
-	datagram_size[0] = 22;
-	datagram_start[0] = 0;
-	datagram_end[0] = 0;
-	for (i=0;i<MBSYS_SIMRAD_MAXBEAMS;i++)
-		{
-		new_datagram_size = datagram_size[num_datagrams] + 6 + 3 * ping->beam_samples[i];
-		if (new_datagram_size > 1465
-			&& i == MBSYS_SIMRAD_MAXBEAMS - 1)
-			{
-			datagram_end[num_datagrams] = i - 1;
-			num_datagrams++;
-			datagram_start[num_datagrams] = i;
-			datagram_end[num_datagrams] =
-				MBSYS_SIMRAD_MAXBEAMS - 1;
-			datagram_size[num_datagrams] =
-				22 + 6 + 3 * ping->beam_samples[i];
-			num_datagrams++;
-			}
-		else if (new_datagram_size > 1465)
-			{
-			datagram_end[num_datagrams] = i - 1;
-			num_datagrams++;
-			datagram_start[num_datagrams] = i;
-			datagram_end[num_datagrams] =
-				MBSYS_SIMRAD_MAXBEAMS - 1;
-			datagram_size[num_datagrams] =
-				22 + 6 + 3 * ping->beam_samples[i];
-			}
-		else if (new_datagram_size == 1465)
-			{
-			datagram_end[num_datagrams] = i;
-			datagram_size[num_datagrams] = new_datagram_size;
-			num_datagrams++;
-			datagram_start[num_datagrams] = i + 1;
-			datagram_end[num_datagrams] =
-				MBSYS_SIMRAD_MAXBEAMS - 1;
-			datagram_size[num_datagrams] = 22;
-			}
-		else if (i == MBSYS_SIMRAD_MAXBEAMS - 1)
-			{
-			datagram_end[num_datagrams] = i;
-			datagram_size[num_datagrams] = new_datagram_size;
-			num_datagrams++;
-			}
-		else
-			datagram_size[num_datagrams] = new_datagram_size;
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       num_datagrams:    %d\n",num_datagrams);
-		for (datagram=0;datagram<num_datagrams;datagram++)
-			{
-			fprintf(stderr,"\ndbg5       datagram[%d]:  beam %d to beam %d\n",
-				datagram,datagram_start[datagram],datagram_end[datagram]);
-			for (i=datagram_start[datagram];i<=datagram_end[datagram];i++)
-				fprintf(stderr,"dbg5       beam:%d  frequency:%d  samples:%d  center:%d\n",
-					i,ping->beam_frequency[i],
-					ping->beam_samples[i],
-					ping->beam_center_sample[i]);
-			}
-		}
-
-	/* now loop over all of the sidescan datagrams to be written */
-	for (datagram=0;datagram<num_datagrams;datagram++)
-	{
-	num_beams = datagram_end[datagram]
-		- datagram_start[datagram] + 1;
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       year:             %d\n",store->year);
-		fprintf(stderr,"dbg5       month:            %d\n",store->month);
-		fprintf(stderr,"dbg5       day:              %d\n",store->day);
-		fprintf(stderr,"dbg5       hour:             %d\n",store->hour);
-		fprintf(stderr,"dbg5       minute:           %d\n",store->minute);
-		fprintf(stderr,"dbg5       sec:              %d\n",store->second);
-		fprintf(stderr,"dbg5       centisecond:      %d\n",store->centisecond);
-		fprintf(stderr,"dbg5       ping_number:      %d\n",ping->ping_number);
-		fprintf(stderr,"dbg5       sound_vel:        %d\n",ping->sound_vel);
-		fprintf(stderr,"dbg5       ss_mode:          %d\n",ping->ss_mode);
-		fprintf(stderr,"dbg5       num_datagrams:    %d\n",num_datagrams);
-		fprintf(stderr,"dbg5       datagram:         %d\n",datagram);
-		fprintf(stderr,"dbg5       num_beams:        %d\n",num_beams);
-		for (i=datagram_start[datagram];i<=datagram_end[datagram];i++)
-			fprintf(stderr,"dbg5       beam:%d  frequency:%d  samples:%d  center:%d  start:%d\n",
-				i,ping->beam_frequency[i],
-				ping->beam_samples[i],
-				ping->beam_center_sample[i],
-				ping->beam_start_sample[i]);
-		for (i=datagram_start[datagram];i<=datagram_end[datagram];i++)
-			{
-			beam_ss = &ping->ssraw[ping->beam_start_sample[i]];
-			beam_ssp = &ping->ssp[ping->beam_start_sample[i]];
-			for (j=0;j<ping->beam_samples[i];j++)
-				fprintf(stderr,"dbg5       beam:%d pixel:%d  amp:%d phase:%d\n",
-					i,j,beam_ss[j],beam_ssp[j]);
-			}
-		}
-
-	/* write the record size */
-	mb_put_binary_int(MB_NO, (int) (EM_12S_SSP_SIZE + 2), (void *) &write_size);
-	write_len = fwrite(&write_size,1,4,mbfp);
-	if (write_len != 4)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	else
-		status = MB_SUCCESS;
-
-	/* write the record label */
-	if (ping->swath_id == EM_SWATH_CENTER)
-		mb_put_binary_short(MB_NO, (short) EM_12S_SSP, (void *) &label);
-	else if (ping->swath_id == EM_SWATH_PORT)
-		mb_put_binary_short(MB_NO, (short) EM_12DP_SSP, (void *) &label);
-	else
-		mb_put_binary_short(MB_NO, (short) EM_12DS_SSP, (void *) &label);
-	write_len = fwrite(&label,1,2,mbfp);
-	if (write_len != 2)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	else
-		status = MB_SUCCESS;
-
-	/* write out the data */
-	if (status == MB_SUCCESS)
-		{
-		/* construct record */
-		sprintf(line,"%2.2d%2.2d%2.2d",
-			store->day,store->month,store->year);
-		sprintf(line+6,"%2.2d%2.2d%2.2d%2.2d",
-			store->hour,store->minute,
-			store->second,store->centisecond);
-		mb_put_binary_short(MB_YES, (short) ping->ping_number, (void *) &line[14]);
-		mb_put_binary_short(MB_YES, (short) ping->sound_vel, (void *) &line[16]);
-		line[18] = (char) ping->ss_mode;
-		line[19] = (char) num_datagrams;
-		odatagram = datagram + 1;
-		line[20] = (char) odatagram;
-		line[21] = (char) num_beams;
-		j=0;
-		for (i=datagram_start[datagram];i<=datagram_end[datagram];i++)
-			{
-			line[22 + 6*j] = (char) (i + 1);
-			line[23 + 6*j] = (char) ping->beam_frequency[i];
-			mb_put_binary_short(MB_YES, (short) ping->beam_samples[i], (void *) &line[24 + 6*j]);
-			mb_put_binary_short(MB_YES, (short) ping->beam_center_sample[i], (void *) &line[26 + 6*j]);
-			j++;
-			}
-		ioffset = 22 + 6*num_beams;
-		char_ptr = (char *) &short_val;
-		for (i=datagram_start[datagram];i<=datagram_end[datagram];i++)
-			{
-			beam_ss = &ping->ssraw[ping->beam_start_sample[i]];
-			beam_ssp = &ping->ssp[ping->beam_start_sample[i]];
-			for (j=0;j<ping->beam_samples[i];j++)
-				{
-				line[ioffset] = (char) beam_ss[j];
-				mb_put_binary_short(MB_YES, (short) beam_ssp[j], (void *) &short_val);
-				line[ioffset+1] = char_ptr[0];
-				line[ioffset+2] = char_ptr[1];
-				ioffset += 3;
-				}
-			}
-		for (i=ioffset;i<EM_SSP_SIZE;i++)
-			line[i] = (char) 0;
-
-		line[EM_SSP_SIZE-3] = 0x03;
-
-		/* compute and set checksum */
-		uchar_ptr = (mb_u_char *) line;
-		checksum = 0;
-		for (j=0;j<EM_SSP_SIZE-3;j++)
-		    checksum += uchar_ptr[j];
-		mb_put_binary_short(MB_YES, (short) checksum, (void *) &short_val);
-		char_ptr = (char *) &short_val;
-		line[EM_SSP_SIZE-2] = char_ptr[0];
-		line[EM_SSP_SIZE-1] = char_ptr[1];
-
-		/* write out data */
-		write_len = fwrite(line,1,EM_SSP_SIZE,mbfp);
-		if (write_len != EM_SSP_SIZE)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* end loop over datagrams */
-	}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mbr_gsfgenmb.c b/src/mbio/mbr_gsfgenmb.c
deleted file mode 100644
index 962e016..0000000
--- a/src/mbio/mbr_gsfgenmb.c
+++ /dev/null
@@ -1,777 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbr_gsfgenmb.c	2/27/98
- *	$Id: mbr_gsfgenmb.c 2229 2015-02-14 23:04:41Z caress $
- *
- *    Copyright (c) 1998-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbr_gsfgenmb.c contains the functions for reading and writing
- * multibeam data in the GSFGENMB format.
- * These functions include:
- *   mbr_alm_gsfgenmb	- allocate read/write memory
- *   mbr_dem_gsfgenmb	- deallocate read/write memory
- *   mbr_rt_gsfgenmb	- read and translate data
- *   mbr_wt_gsfgenmb	- translate and write data
- *
- * Author:	D. W. Caress
- * Date:	February 27, 1998
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mb_define.h"
-#include "mbf_gsfgenmb.h"
-#include "mbsys_gsf.h"
-
-/* GSF error value */
-extern int gsfError;
-
-/* essential function prototypes */
-int mbr_register_gsfgenmb(int verbose, void *mbio_ptr,
-		int *error);
-int mbr_info_gsfgenmb(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_alm_gsfgenmb(int verbose, void *mbio_ptr, int *error);
-int mbr_dem_gsfgenmb(int verbose, void *mbio_ptr, int *error);
-int mbr_rt_gsfgenmb(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_wt_gsfgenmb(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-
-static char rcs_id[]="$Id: mbr_gsfgenmb.c 2229 2015-02-14 23:04:41Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mbr_register_gsfgenmb(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_register_gsfgenmb";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* get mb_io_ptr */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set format info parameters */
-	status = mbr_info_gsfgenmb(verbose,
-			&mb_io_ptr->system,
-			&mb_io_ptr->beams_bath_max,
-			&mb_io_ptr->beams_amp_max,
-			&mb_io_ptr->pixels_ss_max,
-			mb_io_ptr->format_name,
-			mb_io_ptr->system_name,
-			mb_io_ptr->format_description,
-			&mb_io_ptr->numfile,
-			&mb_io_ptr->filetype,
-			&mb_io_ptr->variable_beams,
-			&mb_io_ptr->traveltime,
-			&mb_io_ptr->beam_flagging,
-			&mb_io_ptr->nav_source,
-			&mb_io_ptr->heading_source,
-			&mb_io_ptr->vru_source,
-			&mb_io_ptr->svp_source,
-			&mb_io_ptr->beamwidth_xtrack,
-			&mb_io_ptr->beamwidth_ltrack,
-			error);
-
-	/* set format and system specific function pointers */
-	mb_io_ptr->mb_io_format_alloc = &mbr_alm_gsfgenmb;
-	mb_io_ptr->mb_io_format_free = &mbr_dem_gsfgenmb;
-	mb_io_ptr->mb_io_store_alloc = &mbsys_gsf_alloc;
-	mb_io_ptr->mb_io_store_free = &mbsys_gsf_deall;
-	mb_io_ptr->mb_io_read_ping = &mbr_rt_gsfgenmb;
-	mb_io_ptr->mb_io_write_ping = &mbr_wt_gsfgenmb;
-	mb_io_ptr->mb_io_sonartype = &mbsys_gsf_sonartype;
-	mb_io_ptr->mb_io_sidescantype = &mbsys_gsf_sidescantype;
-	mb_io_ptr->mb_io_dimensions = &mbsys_gsf_dimensions;
-	mb_io_ptr->mb_io_sonartype = &mbsys_gsf_sonartype;
-	mb_io_ptr->mb_io_sidescantype = &mbsys_gsf_sidescantype;
-	mb_io_ptr->mb_io_extract = &mbsys_gsf_extract;
-	mb_io_ptr->mb_io_insert = &mbsys_gsf_insert;
-	mb_io_ptr->mb_io_extract_nav = &mbsys_gsf_extract_nav;
-	mb_io_ptr->mb_io_insert_nav = &mbsys_gsf_insert_nav;
-	mb_io_ptr->mb_io_extract_altitude = &mbsys_gsf_extract_altitude;
-	mb_io_ptr->mb_io_insert_altitude = &mbsys_gsf_insert_altitude;
-	mb_io_ptr->mb_io_extract_svp = &mbsys_gsf_extract_svp;
-	mb_io_ptr->mb_io_insert_svp = &mbsys_gsf_insert_svp;
-	mb_io_ptr->mb_io_ttimes = &mbsys_gsf_ttimes;
-	mb_io_ptr->mb_io_detects = &mbsys_gsf_detects;
-	mb_io_ptr->mb_io_copyrecord = &mbsys_gsf_copy;
-	mb_io_ptr->mb_io_extract_rawss = NULL;
-	mb_io_ptr->mb_io_insert_rawss = NULL;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",mb_io_ptr->system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",mb_io_ptr->beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",mb_io_ptr->beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",mb_io_ptr->pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",mb_io_ptr->format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",mb_io_ptr->system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",mb_io_ptr->format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",mb_io_ptr->numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",mb_io_ptr->filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",mb_io_ptr->variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",mb_io_ptr->traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",mb_io_ptr->beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",mb_io_ptr->nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",mb_io_ptr->heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",mb_io_ptr->vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",mb_io_ptr->svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",mb_io_ptr->beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",mb_io_ptr->beamwidth_ltrack);
-		fprintf(stderr,"dbg2       format_alloc:       %p\n",(void *)mb_io_ptr->mb_io_format_alloc);
-		fprintf(stderr,"dbg2       format_free:        %p\n",(void *)mb_io_ptr->mb_io_format_free);
-		fprintf(stderr,"dbg2       store_alloc:        %p\n",(void *)mb_io_ptr->mb_io_store_alloc);
-		fprintf(stderr,"dbg2       store_free:         %p\n",(void *)mb_io_ptr->mb_io_store_free);
-		fprintf(stderr,"dbg2       read_ping:          %p\n",(void *)mb_io_ptr->mb_io_read_ping);
-		fprintf(stderr,"dbg2       write_ping:         %p\n",(void *)mb_io_ptr->mb_io_write_ping);
-		fprintf(stderr,"dbg2       extract:            %p\n",(void *)mb_io_ptr->mb_io_extract);
-		fprintf(stderr,"dbg2       insert:             %p\n",(void *)mb_io_ptr->mb_io_insert);
-		fprintf(stderr,"dbg2       extract_nav:        %p\n",(void *)mb_io_ptr->mb_io_extract_nav);
-		fprintf(stderr,"dbg2       insert_nav:         %p\n",(void *)mb_io_ptr->mb_io_insert_nav);
-		fprintf(stderr,"dbg2       extract_altitude:   %p\n",(void *)mb_io_ptr->mb_io_extract_altitude);
-		fprintf(stderr,"dbg2       insert_altitude:    %p\n",(void *)mb_io_ptr->mb_io_insert_altitude);
-		fprintf(stderr,"dbg2       extract_svp:        %p\n",(void *)mb_io_ptr->mb_io_extract_svp);
-		fprintf(stderr,"dbg2       insert_svp:         %p\n",(void *)mb_io_ptr->mb_io_insert_svp);
-		fprintf(stderr,"dbg2       ttimes:             %p\n",(void *)mb_io_ptr->mb_io_ttimes);
-		fprintf(stderr,"dbg2       detects:            %p\n",(void *)mb_io_ptr->mb_io_detects);
-		fprintf(stderr,"dbg2       extract_rawss:      %p\n",(void *)mb_io_ptr->mb_io_extract_rawss);
-		fprintf(stderr,"dbg2       insert_rawss:       %p\n",(void *)mb_io_ptr->mb_io_insert_rawss);
-		fprintf(stderr,"dbg2       copyrecord:         %p\n",(void *)mb_io_ptr->mb_io_copyrecord);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbr_info_gsfgenmb(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error)
-{
-	char	*function_name = "mbr_info_gsfgenmb";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* set format info parameters */
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-	*system = MB_SYS_GSF;
-	*beams_bath_max = 254;
-	*beams_amp_max = 254;
-	*pixels_ss_max = 8192;
-	strncpy(format_name, "GSFGENMB", MB_NAME_LENGTH);
-	strncpy(system_name, "GSF", MB_NAME_LENGTH);
-	strncpy(format_description, "Format name:          MBF_GSFGENMB\nInformal Description: SAIC Generic Sensor Format (GSF)\nAttributes:           variable beams,  bathymetry and amplitude,\n                      binary, single files, SAIC. \n", MB_DESCRIPTION_LENGTH);
-	*numfile = 1;
-	*filetype = MB_FILETYPE_GSF;
-	*variable_beams = MB_YES;
-	*traveltime = MB_YES;
-	*beam_flagging = MB_YES;
-	*nav_source = MB_DATA_DATA;
-	*heading_source = MB_DATA_DATA;
-	*vru_source = MB_DATA_DATA;
-	*svp_source = MB_DATA_VELOCITY_PROFILE;
-	*beamwidth_xtrack = 0.0;
-	*beamwidth_ltrack = 0.0;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",*system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",*beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",*beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",*pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",*numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",*filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",*variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",*traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",*beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",*nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",*heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",*vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",*svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",*beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",*beamwidth_ltrack);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_alm_gsfgenmb(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_alm_gsfgenmb";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set initial status */
-	status = MB_SUCCESS;
-
-	/* allocate memory for data structure */
-	mb_io_ptr->structure_size = sizeof(struct mbf_gsfgenmb_struct);
-	status = mb_malloc(verbose,mb_io_ptr->structure_size,
-				&mb_io_ptr->raw_data,error);
-	memset(mb_io_ptr->raw_data, 0, mb_io_ptr->structure_size);
-	status = mbsys_gsf_alloc(verbose,mbio_ptr,
-		&mb_io_ptr->store_data,error);
-
-	/* set processing parameter output flag */
-	mb_io_ptr->save1 = MB_NO;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_dem_gsfgenmb(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_dem_gsfgenmb";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_gsfgenmb_struct *data;
-	gsfRecords	    *records;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-	data = (struct mbf_gsfgenmb_struct *) mb_io_ptr->raw_data;
-	records = &(data->records);
-
-	/* deallocate memory for data descriptor */
-	/*gsfFree(records);*/
-	status = mb_free(verbose,&mb_io_ptr->raw_data,error);
-	status = mbsys_gsf_deall(verbose,mbio_ptr,
-		&mb_io_ptr->store_data,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_rt_gsfgenmb(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_rt_gsfgenmb";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_gsfgenmb_struct *data;
-	struct mbsys_gsf_struct *store;
-	gsfDataID	    *dataID;
-	gsfRecords	    *records;
-	gsfSwathBathyPing   *mb_ping;
-	int	ret;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor and data structure */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-	store = (struct mbsys_gsf_struct *) store_ptr;
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_gsfgenmb_struct *) mb_io_ptr->raw_data;
-
-	/* get pointers to GSF structures */
-	dataID = &(data->dataID);
-	records = &(data->records);
-	mb_ping = &(records->mb_ping);
-
-	/* set file position */
-	mb_io_ptr->file_pos = mb_io_ptr->file_bytes;
-
-	/* read next record from file */
-	ret = gsfRead((int)mb_io_ptr->gsfid, GSF_NEXT_RECORD, dataID, records, NULL, 0);
-
-	/* deal with errors */
-	if (ret < 0)
-	    {
-	    if (gsfError == GSF_READ_TO_END_OF_FILE
-		|| gsfError == GSF_PARTIAL_RECORD_AT_END_OF_FILE)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-	    else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_UNINTELLIGIBLE;
-		}
-	    }
-
-	/* else deal with data */
-	else
-	    {
-	    if (dataID->recordID == GSF_RECORD_HISTORY)
-		{
-		data->kind = MB_DATA_HISTORY;
-		status = MB_SUCCESS;
-		*error = MB_ERROR_NO_ERROR;
-		}
-
-	    else if (dataID->recordID == GSF_RECORD_SWATH_BATHY_SUMMARY)
-		{
-		data->kind = MB_DATA_SUMMARY;
-		status = MB_SUCCESS;
-		*error = MB_ERROR_NO_ERROR;
-		}
-
-	    else if (dataID->recordID == GSF_RECORD_PROCESSING_PARAMETERS)
-		{
-		data->kind = MB_DATA_PROCESSING_PARAMETERS;
-		status = MB_SUCCESS;
-		*error = MB_ERROR_NO_ERROR;
-		}
-
-	    else if (dataID->recordID == GSF_RECORD_SENSOR_PARAMETERS)
-		{
-		data->kind = MB_DATA_PROCESSING_PARAMETERS;
-		status = MB_SUCCESS;
-		*error = MB_ERROR_NO_ERROR;
-		}
-
-	    else if (dataID->recordID == GSF_RECORD_NAVIGATION_ERROR)
-		{
-		data->kind = MB_DATA_NAVIGATION_ERROR;
-		status = MB_SUCCESS;
-		*error = MB_ERROR_NO_ERROR;
-		}
-
-	    else if (dataID->recordID == GSF_RECORD_SOUND_VELOCITY_PROFILE)
-		{
-		data->kind = MB_DATA_VELOCITY_PROFILE;
-		status = MB_SUCCESS;
-		*error = MB_ERROR_NO_ERROR;
-		}
-
-	    else if (dataID->recordID == GSF_RECORD_COMMENT)
-		{
-		/* copy comment */
-		data->kind = MB_DATA_COMMENT;
-		if (records->comment.comment != NULL)
-		    {
-		    status = MB_SUCCESS;
-		    *error = MB_ERROR_NO_ERROR;
-		    }
-		else
-		    {
-		    status = MB_FAILURE;
-		    *error = MB_ERROR_UNINTELLIGIBLE;
-		    }
-		}
-
-	    else if (dataID->recordID == GSF_RECORD_SWATH_BATHYMETRY_PING)
-		{
-		status = MB_SUCCESS;
-		*error = MB_ERROR_NO_ERROR;
-		data->kind = MB_DATA_DATA;
-
-		/* get beam widths */
-		ret = gsfGetSwathBathyBeamWidths(records, &(mb_io_ptr->beamwidth_ltrack),
-							&(mb_io_ptr->beamwidth_xtrack));
-		if (ret < 0)
-		    {
-		    mb_io_ptr->beamwidth_ltrack = 0.0;
-		    mb_io_ptr->beamwidth_xtrack = 0.0;
-		    }
-		    
-		/* if needed create array for beam flags */
-		if (mb_ping->number_beams > 0 && mb_ping->beam_flags == NULL)
-		    {
-		    mb_ping->beam_flags = (unsigned char *) malloc(mb_ping->number_beams * sizeof(char));
-		    for (i=0;i<mb_ping->number_beams;i++)
-			mb_ping->beam_flags[i] = MB_FLAG_NONE;
-		    }
-		    
-		/* if needed create array for along_track */
-		if (mb_ping->number_beams > 0 && mb_ping->along_track == NULL)
-		    {
-		    mb_ping->along_track = (double *) malloc(mb_ping->number_beams * sizeof(double));
-		    for (i=0;i<mb_ping->number_beams;i++)
-			mb_ping->along_track[i] = 0.0;
-		    }
-		}
-
-	    else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_UNINTELLIGIBLE;
-		}
-	    }
-
-	/* set error and kind in mb_io_ptr */
-	mb_io_ptr->new_error = *error;
-	mb_io_ptr->new_kind = data->kind;
-
-	/* output debug info */
-	if (verbose >= 4)
-		{
-		fprintf(stderr,"\ndbg4  New record read by MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg4  New record kind:\n");
-		fprintf(stderr,"dbg4       error:      %d\n",
-			mb_io_ptr->new_error);
-		fprintf(stderr,"dbg4       kind:       %d\n",
-			mb_io_ptr->new_kind);
-		fprintf(stderr,"dbg4       dataID->recordID: %d\n",
-			dataID->recordID);
-		}
-	if (verbose >= 4 && data->kind == MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"\ndbg4  New comment read by MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg4  New comment values:\n");
-		fprintf(stderr,"dbg4       kind:              %d\n",
-			data->kind);
-		fprintf(stderr,"dbg4       comment time sec:  %ld\n",
-			records->comment.comment_time.tv_sec);
-		fprintf(stderr,"dbg4       comment time nsec: %ld\n",
-			records->comment.comment_time.tv_nsec);
-		fprintf(stderr,"dbg4       comment length:    %d\n",
-			records->comment.comment_length);
-		fprintf(stderr,"dbg4       comment:           %s\n",
-			records->comment.comment);
-		}
-	if (verbose >= 4 && data->kind == MB_DATA_DATA)
-		{
-		fprintf(stderr,"\ndbg4  New ping read by MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg4  New ping values:\n");
-		fprintf(stderr,"dbg4       kind:       %d\n",
-			data->kind);
-		fprintf(stderr,"dbg4       time sec:   %ld\n",
-			mb_ping->ping_time.tv_sec);
-		fprintf(stderr,"dbg4       time nsec:  %ld\n",
-			mb_ping->ping_time.tv_nsec);
-		fprintf(stderr,"dbg4       longitude:  %f\n",
-			mb_ping->longitude);
-		fprintf(stderr,"dbg4       latitude:   %f\n",
-			mb_ping->latitude);
-		fprintf(stderr,"dbg4       speed:      %f\n",
-			mb_ping->speed);
-		fprintf(stderr,"dbg4       heading:    %f\n",
-			mb_ping->heading);
-		fprintf(stderr,"dbg4       beams:      %d\n",
-			mb_ping->number_beams);
-		for (i=0;i<mb_ping->number_beams;i++)
-		  fprintf(stderr,"dbg4       beam:%d  flag:%d  bath:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,mb_ping->beam_flags[i],
-			mb_ping->depth[i],
-			mb_ping->across_track[i],
-			mb_ping->along_track[i]);
-		if (mb_ping->mc_amplitude != NULL)
-		for (i=0;i<mb_ping->number_beams;i++)
-		  fprintf(stderr,"dbg4       beam:%d  amp:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,mb_ping->mc_amplitude[i],
-			mb_ping->across_track[i],
-			mb_ping->along_track[i]);
-		if (mb_ping->mr_amplitude != NULL)
-		for (i=0;i<mb_ping->number_beams;i++)
-		  fprintf(stderr,"dbg4       beam:%d  amp:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,mb_ping->mr_amplitude[i],
-			mb_ping->across_track[i],
-			mb_ping->along_track[i]);
-		}
-
-	/* translate values to data storage structure */
-	if (status == MB_SUCCESS
-		&& store != NULL)
-		{
-		gsfFree(&(store->records));
-		gsfCopyRecords(&(store->records), records);
-		store->dataID = *dataID;
-		store->kind = data->kind;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_wt_gsfgenmb(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_wt_gsfgenmb";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_gsfgenmb_struct *data;
-	struct mbsys_gsf_struct *store;
-	gsfDataID		*dataID;
-	gsfRecords		*records;
-	gsfSwathBathyPing	*mb_ping;
-	int	ret = 0;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor and data structure */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-	store = (struct mbsys_gsf_struct *) store_ptr;
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_gsfgenmb_struct *) mb_io_ptr->raw_data;
-
-	/* get pointers to GSF structures */
-	dataID = &(data->dataID);
-	records = &(data->records);
-	mb_ping = &(records->mb_ping);
-
-	/* translate values to data storage structure */
-	if (status == MB_SUCCESS
-		&& store != NULL)
-		{
-		gsfFree(records);
-		gsfCopyRecords(records, &(store->records));
-		*dataID = store->dataID;
-		data->kind = store->kind;
-		}
-
-	/* output debug info */
-	if (verbose >= 4)
-		{
-		fprintf(stderr,"\ndbg4  New record to be written by MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg4  New record kind:\n");
-		fprintf(stderr,"dbg4       kind:              %d\n",
-			data->kind);
-		}
-	if (verbose >= 4 && data->kind == MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"\ndbg4  New comment to be written by MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg4  New comment values:\n");
-		fprintf(stderr,"dbg4       kind:              %d\n",
-			data->kind);
-		fprintf(stderr,"dbg4       comment time sec:  %ld\n",
-			records->comment.comment_time.tv_sec);
-		fprintf(stderr,"dbg4       comment time nsec: %ld\n",
-			records->comment.comment_time.tv_nsec);
-		fprintf(stderr,"dbg4       comment length:    %d\n",
-			records->comment.comment_length);
-		fprintf(stderr,"dbg4       comment:           %s\n",
-			records->comment.comment);
-		}
-	if (verbose >= 4 && data->kind == MB_DATA_DATA)
-		{
-		fprintf(stderr,"\ndbg4  New ping to be written by MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg4  New ping values:\n");
-		fprintf(stderr,"dbg4       kind:       %d\n",
-			data->kind);
-		fprintf(stderr,"dbg4       time sec:   %ld\n",
-			mb_ping->ping_time.tv_sec);
-		fprintf(stderr,"dbg4       time nsec:  %ld\n",
-			mb_ping->ping_time.tv_nsec);
-		fprintf(stderr,"dbg4       longitude:  %f\n",
-			mb_ping->longitude);
-		fprintf(stderr,"dbg4       latitude:   %f\n",
-			mb_ping->latitude);
-		fprintf(stderr,"dbg4       speed:      %f\n",
-			mb_ping->speed);
-		fprintf(stderr,"dbg4       heading:    %f\n",
-			mb_ping->heading);
-		fprintf(stderr,"dbg4       beams:      %d\n",
-			mb_ping->number_beams);
-		for (i=0;i<mb_ping->number_beams;i++)
-		  fprintf(stderr,"dbg4       beam:%d  flag:%d  bath:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,mb_ping->beam_flags[i],
-			mb_ping->depth[i],
-			mb_ping->across_track[i],
-			mb_ping->along_track[i]);
-		if (mb_ping->mc_amplitude != NULL)
-		for (i=0;i<mb_ping->number_beams;i++)
-		  fprintf(stderr,"dbg4       beam:%d  amp:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,mb_ping->mc_amplitude[i],
-			mb_ping->across_track[i],
-			mb_ping->along_track[i]);
-		if (mb_ping->mr_amplitude != NULL)
-		for (i=0;i<mb_ping->number_beams;i++)
-		  fprintf(stderr,"dbg4       beam:%d  amp:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,mb_ping->mr_amplitude[i],
-			mb_ping->across_track[i],
-			mb_ping->along_track[i]);
-		}
-
-	/* write gsf data to file */
-	if (status == MB_SUCCESS)
-	    {
-	    /* if first survey ping and no processing parameters output,
-	    	output the processing parameters */
-	    if (data->kind == MB_DATA_DATA && mb_io_ptr->save1 == MB_NO)
-	    	{
-		/* write a processing parameter record */
-		dataID->recordID = GSF_RECORD_PROCESSING_PARAMETERS;
-		if ((ret = gsfWrite((int)mb_io_ptr->gsfid, dataID, records)) < 0)
-		    {
-		    status = MB_FAILURE;
-		    *error = MB_ERROR_WRITE_FAIL;
-		    }
-		dataID->recordID = GSF_RECORD_SWATH_BATHYMETRY_PING;
-		mb_io_ptr->save1 = MB_YES;
-		}
-		
-	    /* if a processing parameter record is output, keep track of it */
-	    else if (data->kind == MB_DATA_PROCESSING_PARAMETERS)
-		mb_io_ptr->save1 = MB_YES; 
-
-	    /* write the record */
-	    if ((ret = gsfWrite((int)mb_io_ptr->gsfid, dataID, records)) < 0)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	    }
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mbr_hir2rnav.c b/src/mbio/mbr_hir2rnav.c
deleted file mode 100644
index 7a8f57f..0000000
--- a/src/mbio/mbr_hir2rnav.c
+++ /dev/null
@@ -1,631 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbr_hir2rnav.c	5/20/99
- *	$Id: mbr_hir2rnav.c 1829 2010-02-05 02:53:39Z caress $
- *
- *    Copyright (c) 1999-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbr_hir2rnav.c contains the functions for reading and writing
- * multibeam data in the HIR2RNAV format.
- * These functions include:
- *   mbr_alm_hir2rnav	- allocate read/write memory
- *   mbr_dem_hir2rnav	- deallocate read/write memory
- *   mbr_rt_hir2rnav	- read and translate data
- *   mbr_wt_hir2rnav	- translate and write data
- *
- * Author:	D. W. Caress
- * Date:	May 20, 1999
- *
- * $Log: mbr_hir2rnav.c,v $
- *
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mb_define.h"
-#include "mbsys_singlebeam.h"
-
-/* essential function prototypes */
-int mbr_register_hir2rnav(int verbose, void *mbio_ptr,
-		int *error);
-int mbr_info_hir2rnav(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_alm_hir2rnav(int verbose, void *mbio_ptr, int *error);
-int mbr_dem_hir2rnav(int verbose, void *mbio_ptr, int *error);
-int mbr_rt_hir2rnav(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_wt_hir2rnav(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_hir2rnav_rd_data(int verbose, void *mbio_ptr, int *error);
-int mbr_hir2rnav_wr_data(int verbose, void *mbio_ptr, void *data_ptr, int *error);
-
-static char rcs_id[]="$Id: mbr_hir2rnav.c 1829 2010-02-05 02:53:39Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mbr_register_hir2rnav(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_register_hir2rnav";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* get mb_io_ptr */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set format info parameters */
-	status = mbr_info_hir2rnav(verbose,
-			&mb_io_ptr->system,
-			&mb_io_ptr->beams_bath_max,
-			&mb_io_ptr->beams_amp_max,
-			&mb_io_ptr->pixels_ss_max,
-			mb_io_ptr->format_name,
-			mb_io_ptr->system_name,
-			mb_io_ptr->format_description,
-			&mb_io_ptr->numfile,
-			&mb_io_ptr->filetype,
-			&mb_io_ptr->variable_beams,
-			&mb_io_ptr->traveltime,
-			&mb_io_ptr->beam_flagging,
-			&mb_io_ptr->nav_source,
-			&mb_io_ptr->heading_source,
-			&mb_io_ptr->vru_source,
-			&mb_io_ptr->svp_source,
-			&mb_io_ptr->beamwidth_xtrack,
-			&mb_io_ptr->beamwidth_ltrack,
-			error);
-
-	/* set format and system specific function pointers */
-	mb_io_ptr->mb_io_format_alloc = &mbr_alm_hir2rnav;
-	mb_io_ptr->mb_io_format_free = &mbr_dem_hir2rnav;
-	mb_io_ptr->mb_io_store_alloc = &mbsys_singlebeam_alloc;
-	mb_io_ptr->mb_io_store_free = &mbsys_singlebeam_deall;
-	mb_io_ptr->mb_io_read_ping = &mbr_rt_hir2rnav;
-	mb_io_ptr->mb_io_write_ping = &mbr_wt_hir2rnav;
-	mb_io_ptr->mb_io_dimensions = &mbsys_singlebeam_dimensions;
-	mb_io_ptr->mb_io_extract = &mbsys_singlebeam_extract;
-	mb_io_ptr->mb_io_insert = &mbsys_singlebeam_insert;
-	mb_io_ptr->mb_io_extract_nav = &mbsys_singlebeam_extract_nav;
-	mb_io_ptr->mb_io_insert_nav = &mbsys_singlebeam_insert_nav;
-	mb_io_ptr->mb_io_extract_altitude = &mbsys_singlebeam_extract_altitude;
-	mb_io_ptr->mb_io_insert_altitude = NULL;
-	mb_io_ptr->mb_io_extract_svp = NULL;
-	mb_io_ptr->mb_io_insert_svp = NULL;
-	mb_io_ptr->mb_io_ttimes = &mbsys_singlebeam_ttimes;
-	mb_io_ptr->mb_io_detects = &mbsys_singlebeam_detects;
-	mb_io_ptr->mb_io_copyrecord = &mbsys_singlebeam_copy;
-	mb_io_ptr->mb_io_extract_rawss = NULL;
-	mb_io_ptr->mb_io_insert_rawss = NULL;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",mb_io_ptr->system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",mb_io_ptr->beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",mb_io_ptr->beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",mb_io_ptr->pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",mb_io_ptr->format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",mb_io_ptr->system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",mb_io_ptr->format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",mb_io_ptr->numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",mb_io_ptr->filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",mb_io_ptr->variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",mb_io_ptr->traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",mb_io_ptr->beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",mb_io_ptr->nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",mb_io_ptr->heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",mb_io_ptr->vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",mb_io_ptr->svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",mb_io_ptr->beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",mb_io_ptr->beamwidth_ltrack);
-		fprintf(stderr,"dbg2       format_alloc:       %p\n",(void *)mb_io_ptr->mb_io_format_alloc);
-		fprintf(stderr,"dbg2       format_free:        %p\n",(void *)mb_io_ptr->mb_io_format_free);
-		fprintf(stderr,"dbg2       store_alloc:        %p\n",(void *)mb_io_ptr->mb_io_store_alloc);
-		fprintf(stderr,"dbg2       store_free:         %p\n",(void *)mb_io_ptr->mb_io_store_free);
-		fprintf(stderr,"dbg2       read_ping:          %p\n",(void *)mb_io_ptr->mb_io_read_ping);
-		fprintf(stderr,"dbg2       write_ping:         %p\n",(void *)mb_io_ptr->mb_io_write_ping);
-		fprintf(stderr,"dbg2       extract:            %p\n",(void *)mb_io_ptr->mb_io_extract);
-		fprintf(stderr,"dbg2       insert:             %p\n",(void *)mb_io_ptr->mb_io_insert);
-		fprintf(stderr,"dbg2       extract_nav:        %p\n",(void *)mb_io_ptr->mb_io_extract_nav);
-		fprintf(stderr,"dbg2       insert_nav:         %p\n",(void *)mb_io_ptr->mb_io_insert_nav);
-		fprintf(stderr,"dbg2       extract_altitude:   %p\n",(void *)mb_io_ptr->mb_io_extract_altitude);
-		fprintf(stderr,"dbg2       insert_altitude:    %p\n",(void *)mb_io_ptr->mb_io_insert_altitude);
-		fprintf(stderr,"dbg2       extract_svp:        %p\n",(void *)mb_io_ptr->mb_io_extract_svp);
-		fprintf(stderr,"dbg2       insert_svp:         %p\n",(void *)mb_io_ptr->mb_io_insert_svp);
-		fprintf(stderr,"dbg2       ttimes:             %p\n",(void *)mb_io_ptr->mb_io_ttimes);
-		fprintf(stderr,"dbg2       detects:            %p\n",(void *)mb_io_ptr->mb_io_detects);
-		fprintf(stderr,"dbg2       extract_rawss:      %p\n",(void *)mb_io_ptr->mb_io_extract_rawss);
-		fprintf(stderr,"dbg2       insert_rawss:       %p\n",(void *)mb_io_ptr->mb_io_insert_rawss);
-		fprintf(stderr,"dbg2       copyrecord:         %p\n",(void *)mb_io_ptr->mb_io_copyrecord);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbr_info_hir2rnav(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error)
-{
-	char	*function_name = "mbr_info_hir2rnav";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* set format info parameters */
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-	*system = MB_SYS_SINGLEBEAM;
-	*beams_bath_max = 0;
-	*beams_amp_max = 0;
-	*pixels_ss_max = 0;
-	strncpy(format_name, "HIR2RNAV", MB_NAME_LENGTH);
-	strncpy(system_name, "SINGLEBEAM", MB_NAME_LENGTH);
-	strncpy(format_description, "Format name:          MBF_HIR2RNAV\nInformal Description: SIO GDC R2R navigation format\nAttributes:           R2R navigation, ascii, SIO\n", MB_DESCRIPTION_LENGTH);
-	*numfile = 1;
-	*filetype = MB_FILETYPE_NORMAL;
-	*variable_beams = MB_NO;
-	*traveltime = MB_NO;
-	*beam_flagging = MB_NO;
-	*nav_source = MB_DATA_DATA;
-	*heading_source = MB_DATA_NONE;
-	*vru_source = MB_DATA_NONE;
-	*svp_source = MB_DATA_NONE;
-	*beamwidth_xtrack = 0.0;
-	*beamwidth_ltrack = 0.0;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",*system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",*beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",*beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",*pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",*numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",*filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",*variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",*traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",*beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",*nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",*heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",*vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",*svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",*beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",*beamwidth_ltrack);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_alm_hir2rnav(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_alm_hir2rnav";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set initial status */
-	status = MB_SUCCESS;
-
-	/* allocate memory for data structure */
-	mb_io_ptr->structure_size = 0;
-	mb_io_ptr->data_structure_size = 0;
-	status = mbsys_singlebeam_alloc(verbose, mbio_ptr, &(mb_io_ptr->store_data), error);
-
-	/* set number of records read or written to zero */
-	mb_io_ptr->save1 = 0;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_dem_hir2rnav(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_dem_hir2rnav";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* deallocate memory for data descriptor */
-	status = mbsys_singlebeam_deall(verbose, mbio_ptr, &(mb_io_ptr->store_data), error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_rt_hir2rnav(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_rt_hir2rnav";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_singlebeam_struct *store;
-	char	line[MB_COMMENT_MAXLINE];
-	char	*line_ptr;
-	int	*read_count;
-	int	nget;
-	double	sec;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointers to mbio descriptor and data structure */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-	store = (struct mbsys_singlebeam_struct *) store_ptr;
-
-	/* get pointer to read counter */
-	read_count = (int *) &mb_io_ptr->save1;
-
-	/* set file position */
-	mb_io_ptr->file_bytes = ftell(mb_io_ptr->mbfp);
-	mb_io_ptr->file_pos = mb_io_ptr->file_bytes;
-
-	/* read next record */
-	if ((line_ptr = fgets(line, MB_PATH_MAXLINE,
-			mb_io_ptr->mbfp)) != NULL)
-		{
-		/* set status */
-		mb_io_ptr->file_bytes += strlen(line);
-		status = MB_SUCCESS;
-		*error = MB_ERROR_NO_ERROR;
-		}
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-	mb_io_ptr->file_bytes = ftell(mb_io_ptr->mbfp);
-
-	/* handle the data */
-	if (status == MB_SUCCESS
-	    && line[0] == '#')
-	    {
-	    store->kind = MB_DATA_COMMENT;
-            strncpy(store->comment,&line[1],MB_COMMENT_MAXLINE);
-	    if (store->comment[strlen(store->comment)-1] == '\n')
-		store->comment[strlen(store->comment)-1] = '\0';
-	    (*read_count)++;
-	    }
-	else if (status == MB_SUCCESS)
-	    {
-	    store->kind = MB_DATA_DATA;
-
-	    /* read data */
-	    nget = sscanf(line,"%d-%d-%dT%d:%d:%lfZ %lf %lf %d %d %lf %d",
-		    &store->time_i[0],&store->time_i[1],&store->time_i[2],
-		    &store->time_i[3],&store->time_i[4],&sec,
-		    &store->longitude,&store->latitude,
-		    &store->gps_quality,&store->gps_nsat,
-		    &store->gps_dilution,&store->gps_height);
-/* fprintf(stderr,"\nLINE:%s\tnget:%d %d/%d/%d %d:%d:%f  lon:%f lat:%f  gps:%d %d %f %d\n",
-line,nget,
-store->time_i[0],store->time_i[1],store->time_i[2],
-store->time_i[3],store->time_i[4],sec,
-store->longitude,store->latitude,
-store->gps_quality,store->gps_nsat,
-store->gps_dilution,store->gps_height);*/
-	    if (nget != 12)
-		    {
-		    store->gps_quality = 0;
-		    store->gps_nsat = 0;
-		    store->gps_dilution = 0.0;
-		    store->gps_height = 0;
-		    }
-	    if ((nget == 8 || nget == 12) && store->time_i[0] != 0)
-		    {
-	    	    status = MB_SUCCESS;
-	   	    *error = MB_ERROR_NO_ERROR;
-
-	    	    store->time_i[5] = (int) floor(sec);
-	    	    store->time_i[6] = (int)((sec - store->time_i[5]) * 1000000);
-	    	    mb_get_time(verbose,store->time_i,&store->time_d);
-	    	    (*read_count)++;
-	    	    }
-
-	    /* catch erroneous records */
-	    else
-	    	{
-	    	status = MB_FAILURE;
-	   	*error = MB_ERROR_UNINTELLIGIBLE;
-		}
-	    }
-
-	/* print output debug statements */
-	if (status == MB_SUCCESS && verbose >= 4)
-	    {
-	    if (store->kind == MB_DATA_DATA)
-		{
-		fprintf(stderr,"\ndbg4  Data read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg4  Values read:\n");
-		fprintf(stderr,"dbg4       time_i[0]:    %d\n",store->time_i[0]);
-		fprintf(stderr,"dbg4       time_i[1]:    %d\n",store->time_i[1]);
-		fprintf(stderr,"dbg4       time_i[2]:    %d\n",store->time_i[2]);
-		fprintf(stderr,"dbg4       time_i[3]:    %d\n",store->time_i[3]);
-		fprintf(stderr,"dbg4       time_i[4]:    %d\n",store->time_i[4]);
-		fprintf(stderr,"dbg4       time_i[5]:    %d\n",store->time_i[5]);
-		fprintf(stderr,"dbg4       time_i[6]:    %d\n",store->time_i[6]);
-		fprintf(stderr,"dbg4       time_d:       %f\n",store->time_d);
-		fprintf(stderr,"dbg4       longitude:    %f\n",store->longitude);
-		fprintf(stderr,"dbg4       latitude:     %f\n",store->latitude);
-		fprintf(stderr,"dbg4       gps_quality:  %d\n",store->gps_quality);
-		fprintf(stderr,"dbg4       gps_nsat:     %d\n",store->gps_nsat);
-		fprintf(stderr,"dbg4       gps_dilution: %f\n",store->gps_dilution);
-		fprintf(stderr,"dbg4       gps_height:   %d\n",store->gps_height);
-		fprintf(stderr,"dbg4       error:        %d\n",*error);
-		fprintf(stderr,"dbg4       status:       %d\n",status);
-		}
-	    else if (store->kind == MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"\ndbg4  Data read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg4  Values read:\n");
-		fprintf(stderr,"dbg4       comment:      %s\n",store->comment);
-		}
-	    }
-
-	/* set error and kind in mb_io_ptr */
-	mb_io_ptr->new_error = *error;
-	mb_io_ptr->new_kind = store->kind;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_wt_hir2rnav(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_wt_hir2rnav";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_singlebeam_struct *store;
-	char	line[MB_COMMENT_MAXLINE];
-	int	*write_count;
-	int	len;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor and data structure*/
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-	store = (struct mbsys_singlebeam_struct *) store_ptr;
-
-	/* get pointer to write counter */
-	write_count = (int *) &mb_io_ptr->save1;
-
-	/* print output debug statements */
-	if (store != NULL && verbose >= 4)
-	    {
-	    if (store->kind == MB_DATA_DATA)
-		{
-		fprintf(stderr,"\ndbg4  Data to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg4  Values to be written:\n");
-		fprintf(stderr,"dbg4       time_i[0]:    %d\n",store->time_i[0]);
-		fprintf(stderr,"dbg4       time_i[1]:    %d\n",store->time_i[1]);
-		fprintf(stderr,"dbg4       time_i[2]:    %d\n",store->time_i[2]);
-		fprintf(stderr,"dbg4       time_i[3]:    %d\n",store->time_i[3]);
-		fprintf(stderr,"dbg4       time_i[4]:    %d\n",store->time_i[4]);
-		fprintf(stderr,"dbg4       time_i[5]:    %d\n",store->time_i[5]);
-		fprintf(stderr,"dbg4       time_i[6]:    %d\n",store->time_i[6]);
-		fprintf(stderr,"dbg4       time_d:       %f\n",store->time_d);
-		fprintf(stderr,"dbg4       longitude:    %f\n",store->longitude);
-		fprintf(stderr,"dbg4       latitude:     %f\n",store->latitude);
-		fprintf(stderr,"dbg4       gps_quality:  %d\n",store->gps_quality);
-		fprintf(stderr,"dbg4       gps_nsat:     %d\n",store->gps_nsat);
-		fprintf(stderr,"dbg4       gps_dilution: %f\n",store->gps_dilution);
-		fprintf(stderr,"dbg4       gps_height:   %d\n",store->gps_height);
-		fprintf(stderr,"dbg4       error:        %d\n",*error);
-		fprintf(stderr,"dbg4       status:       %d\n",status);
-		}
-	    else if (store->kind == MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"\ndbg4  Data to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg4  Values to be written:\n");
-		fprintf(stderr,"dbg4       comment:      %s\n",store->comment);
-		}
-	    }
-
-	/* write the record */
-	if (store != NULL)
-		{
-		/* deal with comment */
-		if (store->kind == MB_DATA_COMMENT)
-		    {
-		    line[0] = '#';
-        	    strncpy(&line[1],store->comment,MB_COMMENT_MAXLINE-2);
-        	    len = strlen(line);
-		    if (line[len-1] != '\n')
-			{
-			line[len] = '\n';
-			line[len+1] = '\0';
-			}
-		    }
-		else if (store->kind == MB_DATA_DATA)
-		    {
-		    /* deal with data */
-		    if (store->gps_nsat > 0)
-			    sprintf(line,"%4.4d-%2.2d-%2.2dT%2.2d:%2.2d:%2.2d.%3.3dZ\t%11.6f\t%10.6f\t%d\t%d\t%.1f\t%d\n",
-				    store->time_i[0],store->time_i[1],store->time_i[2],
-				    store->time_i[3],store->time_i[4],store->time_i[5],1000*store->time_i[6],
-				    store->longitude,store->latitude,
-				    store->gps_quality,store->gps_nsat,
-				    store->gps_dilution,store->gps_height);
-		    else
-			    sprintf(line,"%4.4d-%2.2d-%2.2dT%2.2d:%2.2d:%2.2d.%3.3dZ\t%11.6f\t%10.6f\n",
-				    store->time_i[0],store->time_i[1],store->time_i[2],
-				    store->time_i[3],store->time_i[4],store->time_i[5],1000*store->time_i[6],
-				    store->longitude,store->latitude);
-		    }
-
-		/* write data */
-		if (fputs(line,mb_io_ptr->mbfp) == EOF)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			(*write_count)++;
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mbr_hs10jams.c b/src/mbio/mbr_hs10jams.c
deleted file mode 100644
index 34cf587..0000000
--- a/src/mbio/mbr_hs10jams.c
+++ /dev/null
@@ -1,788 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbr_hs10jams.c	12/4/00
- *	$Id: mbr_hs10jams.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 2000-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbr_hs10jams.c contains the functions for reading and writing
- * navigation data in the HS10JAMS format.
- * These functions include:
- *   mbr_alm_hs10jams	- allocate read/write memory
- *   mbr_dem_hs10jams	- deallocate read/write memory
- *   mbr_rt_hs10jams	- read and translate data
- *   mbr_wt_hs10jams	- translate and write data
- *
- * Author:	D. W. Caress
- * Date:	December 4, 2000
- *
- * $Log: mbr_hs10jams.c,v $
- * Revision 5.7  2005/11/05 00:48:05  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.6  2003/05/20 18:05:32  caress
- * Added svp_source to data source parameters.
- *
- * Revision 5.5  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.4  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.3  2001/07/20 00:31:11  caress
- * Release 5.0.beta03
- *
- * Revision 5.2  2001/03/22  20:50:02  caress
- * Trying to make version 5.0.beta0
- *
- * Revision 5.1  2001/01/22  07:43:34  caress
- * Version 5.0.beta01
- *
- * Revision 5.0  2000/12/10  20:24:25  caress
- * Initial revision.
- *
- *
- *
- */
-/*
- * Notes on the MBF_HS10JAMS data format:
- *   1. The Furuno HS-10 multibeam sonar generated 45 beams
- *      of bathymetry and amplitude.
- *   2. To my knowledge, only one Furuno HS-10 multibeam sonar
- *      has been operated. It was installed on S/V Yokosuka,
- *      a JAMSTEC research vessel. The Furuno HS-10 has since been
- *      replaced by a SeaBeam 2112 multibeam sonar.
- *   3. A specification for the raw HS-10 data format was
- *      provided by JAMSTEC, and is included below. The raw format
- *      consists of 800 byte binary records in which only the
- *      lower 4 bits of each byte are used.
- *   4. The actual data files provided to WHOI seem to be simple
- *      717 byte ASCII records with time, lat, lon, heading,
- *      center beam depth, 45 depths, 45 acrosstrack distances,
- *      45 beam amplitudes, and a <CR><LF> terminator. Format
- *      171 supports the actual data we received.
- *   5. The data received use 5 characters each for depth,
- *      acrosstrack, and amplitude values. Null beams have
- *      depth values of 29999 and acrosstrack values of 99999.
- *      MB-System supports beam flagging by setting flagged
- *      beams negative.
- *   6. The internal data structure supports the data included
- *      in the format 171 files, and does not yet include values
- *      listed in the raw format spec but not seen in the data
- *      provided.
- *   7. Comment records are supported as an MB-System extension
- *      where the first two bytes of the record are "##".
- *      Comment records are variable length.
- *   8. The raw data format specification is as follows:
- *
- *      ----------------------------------------------------------
- *      HS-10 MNBES Data Format - JAMSTEC
- *
- *      800 bytes/record, 10 records/block
- *
- *      Note: 4 bits from LSB is effective in each byte.
- *           zB. 30 30 35 39 ---> 0 0 5 9 (HEX) = 89 (DEC)
- *               30 30 32 3D ---> 0 0 2 D (HEX) = 45 (DEC)
- *      The HS-10 processor calculates the water depth by use of
- *      average sound velocity and by correcting the difference
- *      between the true angle of the sound path (obtained by the
- *      true sound velocity profile) and the nominal angle of each
- *      beam (every 2 degrees). The horizontal distance of the n-th
- *      beam is
- *              Distance(n) = Depth(n) * tan[T(n)],
- *      where T(n) is the nominal angle of the n-th beam:
- *              ( T(n) = 2 * (n-23) degrees, n=1,45 ).
- *
- *      No.  Bytes  Data
- *       1.    4    Year
- *       2.    4    Month
- *       3.    4    Day
- *       4.    4    Hour
- *       5.    4    Minute
- *       6.    4    Second
- *       7.    8    Latitude in 1/10000 minute
- *       8.    8    Longitude in 1/10000 minute
- *       9.    8    X in 1/10 metre
- *      10.    8    Y in 1/10 metre
- *      11.    4    Ship's speed in 1/10 knot
- *      12.    4    Ship's heading in 1/10 degree
- *      13. 4x45    45 Water depths in metre
- *      14. 4x45    45 Intensity of reflection in dB
- *      15.    4    Selection of navigation
- *                    0:HYB, 1:ANS, 2:MANU(L/L) 3:MANU(X/Y)
- *      16.    4    Surface sound velocity in 1/10 m/sec
- *      17.    8    Initial latitude in 1/10000 minute
- *      18.    8    Initial longitude in 1/10000 minute
- *      19.    8    Initial X in 1/10 metre
- *      20.    8    Initial Y in 1/10 metre
- *      21.    4    Manual bearing in 1/10 degree
- *      22.    4    Manual ship's speed in 1/10 knot
- *      23.    4    Ship's draft in 1/10 metre
- *      24.    4    Offset X in 1/10 metre
- *      25.    4    Offset Y in 1/10 metre
- *      26.    4    Selection of sound velocity
- *                    0:no correction, 1:manual input, 2:calculation correction
- *      27.    4    Average sound velocity in 1/10 m/sec
- *      28.    4    Input selection of water temperature
- *                    0:AUTO, 1:MANUAL
- *      29.    4    Water temperature in 1/10 degree
- *      30.    4    Tide level in 1/10 metre
- *      31. 4x10    10 Depth of layer in metre
- *      32. 4x10    10 Temperature of layer in 1/10 degree
- *      33. 4x10    10 Salinity in 1/10 per mille
- *      34. 4x10    10 Sound velocity in 1/10 m/sec
- *      35.    4    Transmitted pulse width
- *                    0:1m, 1:2m, 2:4m, 3:8m
- *      36.    4    Level of transmission [1-16]
- *                    1:Off, 16:Max, -2dB in each step
- *      37.    4    Selection of period of tranmission
- *                    0:Auto, 1:Manual
- *      38:    4    Period of tranmission in second
- *      39:    4    Pre-amp ATT
- *                    0:OFF, 1:ON
- *      40:    4    Receiving gain [1-16]
- *                    1:Off, 16:Max, -2dB in each step
- *      41.    4    TVG [1-4]
- *      42.    4    AVG [1-4]
- *      43.    4    Threshold [1-16]
- *      44.    4    Gate width (R/L) [1-4]
- *      45.    4    Gate width (F/B) [1-4]
- *      46.    4    Selection of beam pattern [1-3]
- *      47.    4    Interferance removal
- *                    0:OFF, 1:ON
- *      48.    4    KP shift [1-32]
- *      49.    4    Sonar mode [0]
- *      50.         not used
- *      ----------------------------------------------------------
- *
- */
-
-#define	MBF_HS10JAMS_MAXLINE	800
-#define	MBF_HS10JAMS_LENGTH	717
-
-/* standard include files */
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mb_define.h"
-#include "mbsys_hs10.h"
-
-/* essential function prototypes */
-int mbr_register_hs10jams(int verbose, void *mbio_ptr,
-		int *error);
-int mbr_info_hs10jams(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_alm_hs10jams(int verbose, void *mbio_ptr, int *error);
-int mbr_dem_hs10jams(int verbose, void *mbio_ptr, int *error);
-int mbr_rt_hs10jams(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_wt_hs10jams(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-
-static char rcs_id[]="$Id: mbr_hs10jams.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mbr_register_hs10jams(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_register_hs10jams";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* get mb_io_ptr */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set format info parameters */
-	status = mbr_info_hs10jams(verbose,
-			&mb_io_ptr->system,
-			&mb_io_ptr->beams_bath_max,
-			&mb_io_ptr->beams_amp_max,
-			&mb_io_ptr->pixels_ss_max,
-			mb_io_ptr->format_name,
-			mb_io_ptr->system_name,
-			mb_io_ptr->format_description,
-			&mb_io_ptr->numfile,
-			&mb_io_ptr->filetype,
-			&mb_io_ptr->variable_beams,
-			&mb_io_ptr->traveltime,
-			&mb_io_ptr->beam_flagging,
-			&mb_io_ptr->nav_source,
-			&mb_io_ptr->heading_source,
-			&mb_io_ptr->vru_source,
-			&mb_io_ptr->svp_source,
-			&mb_io_ptr->beamwidth_xtrack,
-			&mb_io_ptr->beamwidth_ltrack,
-			error);
-
-	/* set format and system specific function pointers */
-	mb_io_ptr->mb_io_format_alloc = &mbr_alm_hs10jams;
-	mb_io_ptr->mb_io_format_free = &mbr_dem_hs10jams;
-	mb_io_ptr->mb_io_store_alloc = &mbsys_hs10_alloc;
-	mb_io_ptr->mb_io_store_free = &mbsys_hs10_deall;
-	mb_io_ptr->mb_io_read_ping = &mbr_rt_hs10jams;
-	mb_io_ptr->mb_io_write_ping = &mbr_wt_hs10jams;
-	mb_io_ptr->mb_io_dimensions = &mbsys_hs10_dimensions;
-	mb_io_ptr->mb_io_extract = &mbsys_hs10_extract;
-	mb_io_ptr->mb_io_insert = &mbsys_hs10_insert;
-	mb_io_ptr->mb_io_extract_nav = &mbsys_hs10_extract_nav;
-	mb_io_ptr->mb_io_insert_nav = &mbsys_hs10_insert_nav;
-	mb_io_ptr->mb_io_extract_altitude = &mbsys_hs10_extract_altitude;
-	mb_io_ptr->mb_io_insert_altitude = NULL;
-	mb_io_ptr->mb_io_extract_svp = NULL;
-	mb_io_ptr->mb_io_insert_svp = NULL;
-	mb_io_ptr->mb_io_ttimes = &mbsys_hs10_ttimes;
-	mb_io_ptr->mb_io_detects = &mbsys_hs10_detects;
-	mb_io_ptr->mb_io_copyrecord = &mbsys_hs10_copy;
-	mb_io_ptr->mb_io_extract_rawss = NULL;
-	mb_io_ptr->mb_io_insert_rawss = NULL;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",mb_io_ptr->system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",mb_io_ptr->beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",mb_io_ptr->beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",mb_io_ptr->pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",mb_io_ptr->format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",mb_io_ptr->system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",mb_io_ptr->format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",mb_io_ptr->numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",mb_io_ptr->filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",mb_io_ptr->variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",mb_io_ptr->traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",mb_io_ptr->beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",mb_io_ptr->nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",mb_io_ptr->heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",mb_io_ptr->vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",mb_io_ptr->svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",mb_io_ptr->beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",mb_io_ptr->beamwidth_ltrack);
-		fprintf(stderr,"dbg2       format_alloc:       %p\n",(void *)mb_io_ptr->mb_io_format_alloc);
-		fprintf(stderr,"dbg2       format_free:        %p\n",(void *)mb_io_ptr->mb_io_format_free);
-		fprintf(stderr,"dbg2       store_alloc:        %p\n",(void *)mb_io_ptr->mb_io_store_alloc);
-		fprintf(stderr,"dbg2       store_free:         %p\n",(void *)mb_io_ptr->mb_io_store_free);
-		fprintf(stderr,"dbg2       read_ping:          %p\n",(void *)mb_io_ptr->mb_io_read_ping);
-		fprintf(stderr,"dbg2       write_ping:         %p\n",(void *)mb_io_ptr->mb_io_write_ping);
-		fprintf(stderr,"dbg2       extract:            %p\n",(void *)mb_io_ptr->mb_io_extract);
-		fprintf(stderr,"dbg2       insert:             %p\n",(void *)mb_io_ptr->mb_io_insert);
-		fprintf(stderr,"dbg2       extract_nav:        %p\n",(void *)mb_io_ptr->mb_io_extract_nav);
-		fprintf(stderr,"dbg2       insert_nav:         %p\n",(void *)mb_io_ptr->mb_io_insert_nav);
-		fprintf(stderr,"dbg2       extract_altitude:   %p\n",(void *)mb_io_ptr->mb_io_extract_altitude);
-		fprintf(stderr,"dbg2       insert_altitude:    %p\n",(void *)mb_io_ptr->mb_io_insert_altitude);
-		fprintf(stderr,"dbg2       extract_svp:        %p\n",(void *)mb_io_ptr->mb_io_extract_svp);
-		fprintf(stderr,"dbg2       insert_svp:         %p\n",(void *)mb_io_ptr->mb_io_insert_svp);
-		fprintf(stderr,"dbg2       ttimes:             %p\n",(void *)mb_io_ptr->mb_io_ttimes);
-		fprintf(stderr,"dbg2       detects:            %p\n",(void *)mb_io_ptr->mb_io_detects);
-		fprintf(stderr,"dbg2       extract_rawss:      %p\n",(void *)mb_io_ptr->mb_io_extract_rawss);
-		fprintf(stderr,"dbg2       insert_rawss:       %p\n",(void *)mb_io_ptr->mb_io_insert_rawss);
-		fprintf(stderr,"dbg2       copyrecord:         %p\n",(void *)mb_io_ptr->mb_io_copyrecord);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbr_info_hs10jams(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error)
-{
-	char	*function_name = "mbr_info_hs10jams";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* set format info parameters */
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-	*system = MB_SYS_SINGLEBEAM;
-	*beams_bath_max = 45;
-	*beams_amp_max = 45;
-	*pixels_ss_max = 0;
-	strncpy(format_name, "HS10JAMS", MB_NAME_LENGTH);
-	strncpy(system_name, "HS10", MB_NAME_LENGTH);
-	strncpy(format_description, "Format name:          MBF_HS10JAMS\nInformal Description: Furuno HS-10 multibeam format,\nAttributes:           45 beams bathymetry and amplitude,\n                      ascii, JAMSTEC\n", MB_DESCRIPTION_LENGTH);
-	*numfile = 1;
-	*filetype = MB_FILETYPE_NORMAL;
-	*variable_beams = MB_NO;
-	*traveltime = MB_NO;
-	*beam_flagging = MB_YES;
-	*nav_source = MB_DATA_DATA;
-	*heading_source = MB_DATA_DATA;
-	*vru_source = MB_DATA_DATA;
-	*svp_source = MB_DATA_NONE;
-	*beamwidth_xtrack = 2.0;
-	*beamwidth_ltrack = 2.0;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",*system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",*beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",*beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",*pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",*numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",*filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",*variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",*traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",*beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",*nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",*heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",*vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",*svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",*beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",*beamwidth_ltrack);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_alm_hs10jams(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_alm_hs10jams";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set initial status */
-	status = MB_SUCCESS;
-
-	/* allocate memory for data structure */
-	mb_io_ptr->structure_size = 0;
-	mb_io_ptr->data_structure_size = 0;
-	status = mb_malloc(verbose,sizeof(struct mbsys_hs10_struct),
-				&mb_io_ptr->store_data,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_dem_hs10jams(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_dem_hs10jams";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* deallocate memory for data descriptor */
-	status = mb_free(verbose,&mb_io_ptr->store_data,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_rt_hs10jams(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_rt_hs10jams";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_hs10_struct *store;
-	char	line[MBF_HS10JAMS_MAXLINE];
-	char	*line_ptr;
-	int	shift;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointers to mbio descriptor and data structures */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-	store = (struct mbsys_hs10_struct *) store_ptr;
-
-	/* set file position */
-	mb_io_ptr->file_bytes = ftell(mb_io_ptr->mbfp);
-	mb_io_ptr->file_pos = mb_io_ptr->file_bytes;
-
-	/* read next record */
-	if ((line_ptr = fgets(line, MBF_HS10JAMS_MAXLINE,
-			mb_io_ptr->mbfp)) != NULL)
-		{
-		mb_io_ptr->file_bytes += strlen(line);
-		if (strlen(line) >= MBF_HS10JAMS_LENGTH-2
-			|| line[0] == '#')
-			{
-			status = MB_SUCCESS;
-			*error = MB_ERROR_NO_ERROR;
-			}
-		else
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_UNINTELLIGIBLE;
-			}
-		}
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-	mb_io_ptr->file_bytes = ftell(mb_io_ptr->mbfp);
-
-	/* translate values to data storage structure */
-	if (status == MB_SUCCESS
-		&& store != NULL)
-		{
-		/* deal with comment */
-		if (line[0] == '#')
-			{
-			for (i=0;i<MBSYS_HS10_COMMENT;i++)
-				store->comment[i] = '\0';
-			store->kind = MB_DATA_COMMENT;
-			strncpy(store->comment, &line[2],
-				MIN(MBSYS_HS10_COMMENT,
-				    strlen(&line[2]) - 2));
-			}
-
-		/* deal with survey ping */
-		else
-			{
-			/* get time stamp */
-			shift = 0;
-			store->kind = MB_DATA_DATA;
-			mb_get_int(&store->year, &line[shift], 2); shift += 2;
-			mb_get_int(&store->month, &line[shift], 2); shift += 2;
-			mb_get_int(&store->day, &line[shift], 2); shift += 2;
-			mb_get_int(&store->hour, &line[shift], 2); shift += 2;
-			mb_get_int(&store->minute, &line[shift], 2); shift += 2;
-			mb_get_int(&store->tenth_second, &line[shift], 3); shift += 3;
-
-			/* get navigation */
-			store->NorS = line[shift]; shift += 1;
-			mb_get_int(&store->latdeg, &line[shift], 3); shift += 3;
-			mb_get_int(&store->latmin, &line[shift], 5); shift += 5;
-			store->EorW = line[shift]; shift += 1;
-			mb_get_int(&store->londeg, &line[shift], 3); shift += 3;
-			mb_get_int(&store->lonmin, &line[shift], 5); shift += 5;
-			mb_get_int(&store->heading, &line[shift], 4); shift += 4;
-			mb_get_int(&store->center_depth, &line[shift], 5); shift += 5;
-
-			/* get depth */
-			for (i=0;i<MBSYS_HS10_BEAMS;i++)
-				 {
-				 mb_get_int(&store->depth[i], &line[shift], 5); shift += 5;
-				 }
-
-			/* get acrosstrack */
-			for (i=0;i<MBSYS_HS10_BEAMS;i++)
-				 {
-				 mb_get_int(&store->acrosstrack[i], &line[shift], 5); shift += 5;
-				 }
-
-			/* get amplitude */
-			for (i=0;i<MBSYS_HS10_BEAMS;i++)
-				 {
-				 mb_get_int(&store->amplitude[i], &line[shift], 5); shift += 5;
-				 }
-			}
-		}
-
-	/* set error and kind in mb_io_ptr */
-	mb_io_ptr->new_error = *error;
-	mb_io_ptr->new_kind = store->kind;
-
-	/* print debug statements */
-	if (verbose >= 5
-		&& status == MB_SUCCESS
-		&& store->kind == MB_DATA_DATA)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       year:             %d\n",store->year);
-		fprintf(stderr,"dbg5       month:            %d\n",store->month);
-		fprintf(stderr,"dbg5       day:              %d\n",store->day);
-		fprintf(stderr,"dbg5       hour:             %d\n",store->hour);
-		fprintf(stderr,"dbg5       minute:           %d\n",store->minute);
-		fprintf(stderr,"dbg5       tenth_second:     %d\n",store->tenth_second);
-		fprintf(stderr,"dbg5       NorS:             %c\n",store->NorS);
-		fprintf(stderr,"dbg5       latdeg:           %d\n",store->latdeg);
-		fprintf(stderr,"dbg5       latmin:           %d\n",store->latmin);
-		fprintf(stderr,"dbg5       EorW:             %c\n",store->NorS);
-		fprintf(stderr,"dbg5       londeg:           %d\n",store->londeg);
-		fprintf(stderr,"dbg5       lonmin:           %d\n",store->lonmin);
-		fprintf(stderr,"dbg5       heading:          %d\n",store->heading);
-		fprintf(stderr,"dbg5       center_depth:     %d\n",store->center_depth);
-		fprintf(stderr,"dbg5       beam values (beam depth acrosstrack amplitude):\n");
-		for (i=0;i<MBSYS_HS10_BEAMS;i++)
-			fprintf(stderr,"dbg5       %2d %5d %5d %5d\n",
-				i,store->depth[i],store->acrosstrack[i],store->amplitude[i]);
-		}
-	else if (verbose >= 5
-		&& status == MB_SUCCESS
-		&& store->kind == MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"\ndbg5  Comment read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       comment: %s\n",store->comment);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_wt_hs10jams(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_wt_hs10jams";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_hs10_struct *store;
-	char	line[MBF_HS10JAMS_MAXLINE];
-	int	shift;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to storage data structure */
-	store = (struct mbsys_hs10_struct *) store_ptr;
-
-	/* write out debug info */
-	if (verbose >= 5
-		&& store->kind == MB_DATA_DATA)
-		{
-		fprintf(stderr,"\ndbg5  Values to write in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       year:             %d\n",store->year);
-		fprintf(stderr,"dbg5       month:            %d\n",store->month);
-		fprintf(stderr,"dbg5       day:              %d\n",store->day);
-		fprintf(stderr,"dbg5       hour:             %d\n",store->hour);
-		fprintf(stderr,"dbg5       minute:           %d\n",store->minute);
-		fprintf(stderr,"dbg5       tenth_second:     %d\n",store->tenth_second);
-		fprintf(stderr,"dbg5       NorS:             %c\n",store->NorS);
-		fprintf(stderr,"dbg5       londeg:           %d\n",store->londeg);
-		fprintf(stderr,"dbg5       lonmin:           %d\n",store->lonmin);
-		fprintf(stderr,"dbg5       heading:          %d\n",store->heading);
-		fprintf(stderr,"dbg5       center_depth:     %d\n",store->center_depth);
-		fprintf(stderr,"dbg5       beam values (beam depth acrosstrack amplitude):\n");
-		for (i=0;i<MBSYS_HS10_BEAMS;i++)
-			fprintf(stderr,"dbg5       %2d %5d %5d %5d\n",
-				i,store->depth[i],store->acrosstrack[i],store->amplitude[i]);
-		}
-	else if (verbose >= 5
-		&& store->kind == MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"\ndbg5  Comment to write in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       comment: %s\n",store->comment);
-		}
-
-	/* translate data from data storage structure */
-	if (store->kind == MB_DATA_COMMENT)
-		{
-		/* deal with comment */
-		for (i=0;i<MBF_HS10JAMS_MAXLINE;i++)
-			line[i] = '\0';
-		line[0] = '#';
-		line[1] = '#';
-		strncpy(&line[2], store->comment, MBSYS_HS10_COMMENT);
-		line[strlen(store->comment)+2] = '\r';
-		line[strlen(store->comment)+3] = '\n';
-		}
-	else
-		{
-		/* deal with survey ping */
-		sprintf(line,
-		    "%2d%2d%2d%2d%2d%3d%c%3d%5d%c%3d%5d%4d%5d",
-		    store->year,
-		    store->month,
-		    store->day,
-		    store->hour,
-		    store->minute,
-		    store->tenth_second,
-		    store->NorS,
-		    store->latdeg,
-		    store->latmin,
-		    store->EorW,
-		    store->londeg,
-		    store->lonmin,
-		    store->heading,
-		    store->center_depth);
-		shift = 40;
-		for (i=0;i<MBSYS_HS10_BEAMS;i++)
-			{
-			sprintf(&line[shift], "%5d", store->depth[i]);
-			shift += 5;
-			}
-		for (i=0;i<MBSYS_HS10_BEAMS;i++)
-			{
-			sprintf(&line[shift], "%5d", store->acrosstrack[i]);
-			shift += 5;
-			}
-		for (i=0;i<MBSYS_HS10_BEAMS;i++)
-			{
-			sprintf(&line[shift], "%5d", store->amplitude[i]);
-			shift += 5;
-			}
-		line[shift] = '\r'; shift += 1;
-		line[shift] = '\n'; shift += 1;
-		line[shift] = '\0';
-		}
-
-	/* write next data to file */
-	if (fputs(line,mb_io_ptr->mbfp) == EOF)
-		{
-		*error = MB_ERROR_WRITE_FAIL;
-		status = MB_FAILURE;
-		}
-	else
-		{
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mbr_hsatlraw.c b/src/mbio/mbr_hsatlraw.c
deleted file mode 100644
index e6c624c..0000000
--- a/src/mbio/mbr_hsatlraw.c
+++ /dev/null
@@ -1,3896 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbr_hsatlraw.c	2/11/93
- *	$Id: mbr_hsatlraw.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1993-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbr_hsatlraw.c contains the functions for reading and writing
- * multibeam data in the HSATLRAW format.
- * These functions include:
- *   mbr_alm_hsatlraw	- allocate read/write memory
- *   mbr_dem_hsatlraw	- deallocate read/write memory
- *   mbr_rt_hsatlraw	- read and translate data
- *   mbr_wt_hsatlraw	- translate and write data
- *
- * Author:	D. W. Caress
- * Date:	February 11, 1993
- * $Log: mbr_hsatlraw.c,v $
- * Revision 5.11  2006/09/11 18:55:52  caress
- * Changes during Western Flyer and Thomas Thompson cruises, August-September
- * 2006.
- *
- * Revision 5.10  2005/11/05 00:48:03  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.9  2004/05/22 06:00:07  caress
- * Release 5.0.4
- *
- * Revision 5.8  2003/05/20 18:05:32  caress
- * Added svp_source to data source parameters.
- *
- * Revision 5.7  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.6  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.5  2002/08/21 00:55:46  caress
- * Release 5.0.beta22
- *
- * Revision 5.4  2002/05/02 03:55:34  caress
- * Release 5.0.beta17
- *
- * Revision 5.3  2001/07/20 00:31:11  caress
- * Release 5.0.beta03
- *
- * Revision 5.2  2001/03/22  20:50:02  caress
- * Trying to make version 5.0.beta0
- *
- * Revision 5.1  2001/01/22  07:43:34  caress
- * Version 5.0.beta01
- *
- * Revision 5.0  2000/12/01  22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.17  2000/10/11  01:03:21  caress
- * Convert to ANSI C
- *
- * Revision 4.16  2000/09/30  06:34:20  caress
- * Snapshot for Dale.
- *
- * Revision 4.15  2000/03/06  21:54:21  caress
- * Added check for Hydrosweep Y2k problem - Ewing sonar
- * started putting out 1900 instead of 2000 in February 2000.
- *
- * Revision 4.14  1998/10/05  17:46:15  caress
- * MB-System version 4.6beta
- *
- * Revision 4.13  1997/09/12  14:58:34  caress
- * Set size of tape block headers to exclude at 12 characters.
- *
- * Revision 4.12  1997/07/25  14:19:53  caress
- * Version 4.5beta2.
- * Much mucking, particularly with Simrad formats.
- *
- * Revision 4.11  1997/04/21  17:02:07  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.10  1996/04/24  01:14:38  caress
- * Code now keeps any water sound velocity or position offset
- * data encountered in memory.
- *
- * Revision 4.10  1996/04/24  01:14:38  caress
- * Code now keeps any water sound velocity or position offset
- * data encountered in memory.
- *
- * Revision 4.9  1996/04/22  13:21:19  caress
- * Now have DTR and MIN/MAX defines in mb_define.h
- *
- * Revision 4.8  1995/07/26  14:45:39  caress
- * Fixed problems related to shallow water data.
- *
- * Revision 4.7  1995/07/13  21:40:28  caress
- * Fixed problem with scaling of center beam depths.
- *
- * Revision 4.6  1995/03/17  15:12:59  caress
- * Changes related to handling early, problematic
- * Ewing Hydrosweep data.
- *
- * Revision 4.5  1995/03/08  13:31:09  caress
- * Fixed bug related to handling of shallow water data and the depth scale.
- *
- * Revision 4.4  1995/03/06  19:38:54  caress
- * Changed include strings.h to string.h for POSIX compliance.
- *
- * Revision 4.3  1995/02/22  21:55:10  caress
- * Fixed reading of amplitude data from existing data.
- *
- * Revision 4.2  1994/10/21  12:20:01  caress
- * Release V4.0
- *
- * Revision 4.1  1994/05/21  02:23:29  caress
- * Made sure that mb_io_ptr->new_bath_alongtrack is set to zero on reading.
- *
- * Revision 4.1  1994/05/21  02:23:29  caress
- * Made sure that mb_io_ptr->new_bath_alongtrack is set to zero on reading.
- *
- * Revision 4.0  1994/03/06  00:01:56  caress
- * First cut at version 4.0
- *
- * Revision 4.3  1994/03/04  22:27:09  caress
- * Reduced output amplitude values by a factor of 10 so that
- * general range should be between 20 and 500, hopefully
- * enough to insure actual range between 1 and 999.
- *
- * Revision 4.2  1994/03/03  03:39:43  caress
- * Fixed copyright message.
- *
- * Revision 4.1  1994/03/03  03:15:16  caress
- * Added simple processing of amplitude data as part of
- * reading.  This will have to be improved, but its a start.
- *
- * Revision 4.0  1994/02/21  03:59:50  caress
- * First cut at new version. Altered to be consistent
- * with passing of three types of data: bathymetry,
- * amplitude, and sidescan.
- *
- * Revision 3.0  1993/05/14  22:55:16  sohara
- * initial version
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mb_define.h"
-#include "mbsys_hsds.h"
-#include "mbf_hsatlraw.h"
-
-/* local defines */
-#define ZERO_ALL    0
-#define ZERO_SOME   1
-
-/* essential function prototypes */
-int mbr_register_hsatlraw(int verbose, void *mbio_ptr,
-		int *error);
-int mbr_info_hsatlraw(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_alm_hsatlraw(int verbose, void *mbio_ptr, int *error);
-int mbr_dem_hsatlraw(int verbose, void *mbio_ptr, int *error);
-int mbr_zero_hsatlraw(int verbose, void *data_ptr, int mode, int *error);
-int mbr_rt_hsatlraw(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_wt_hsatlraw(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-
-int mbr_hsatlraw_rd_label(int verbose, FILE *mbfp,
-		char *line, int *type, int *shift, int *error);
-int mbr_hsatlraw_read_line(int verbose, FILE *mbfp,
-		int minimum_size, char *line, int *error);
-int mbr_hsatlraw_rd_ergnhydi(int verbose, FILE *mbfp,
-		struct mbf_hsatlraw_struct *data, int shift, int *error);
-int mbr_hsatlraw_rd_ergnpara(int verbose, FILE *mbfp,
-		struct mbf_hsatlraw_struct *data, int shift, int *error);
-int mbr_hsatlraw_rd_ergnposi(int verbose, FILE *mbfp,
-		struct mbf_hsatlraw_struct *data, int shift, int *error);
-int mbr_hsatlraw_rd_ergneich(int verbose, FILE *mbfp,
-		struct mbf_hsatlraw_struct *data, int shift, int *error);
-int mbr_hsatlraw_rd_ergnmess(int verbose, FILE *mbfp,
-		struct mbf_hsatlraw_struct *data, int shift, int *error);
-int mbr_hsatlraw_rd_ergnslzt(int verbose, FILE *mbfp,
-		struct mbf_hsatlraw_struct *data, int shift, int *error);
-int mbr_hsatlraw_rd_ergnctds(int verbose, FILE *mbfp,
-		struct mbf_hsatlraw_struct *data, int shift, int *error);
-int mbr_hsatlraw_rd_ergnampl(int verbose, FILE *mbfp,
-		struct mbf_hsatlraw_struct *data, int shift, int *error);
-int mbr_hsatlraw_rd_ldeocmnt(int verbose, FILE *mbfp,
-		struct mbf_hsatlraw_struct *data, int shift, int *error);
-
-int mbr_hsatlraw_rd_data(int verbose, void *mbio_ptr, int *error);
-int mbr_hsatlraw_wr_data(int verbose, void *mbio_ptr, void *data_ptr, int *error);
-int mbr_hsatlraw_wr_label(int verbose, FILE *mbfp, char type, int *error);
-int mbr_hsatlraw_write_line(int verbose, FILE *mbfp, char *line, int *error);
-int mbr_hsatlraw_wr_rawline(int verbose, FILE *mbfp, void *data_ptr, int *error);
-int mbr_hsatlraw_wr_ergnhydi(int verbose, FILE *mbfp, void *data_ptr, int *error);
-int mbr_hsatlraw_wr_ergnpara(int verbose, FILE *mbfp, void *data_ptr, int *error);
-int mbr_hsatlraw_wr_ergnposi(int verbose, FILE *mbfp, void *data_ptr, int *error);
-int mbr_hsatlraw_wr_ergneich(int verbose, FILE *mbfp, void *data_ptr, int *error);
-int mbr_hsatlraw_wr_ergnmess(int verbose, FILE *mbfp, void *data_ptr, int *error);
-int mbr_hsatlraw_wr_ergnslzt(int verbose, FILE *mbfp, void *data_ptr, int *error);
-int mbr_hsatlraw_wr_ergnctds(int verbose, FILE *mbfp, void *data_ptr, int *error);
-int mbr_hsatlraw_wr_ergnampl(int verbose, FILE *mbfp, void *data_ptr, int *error);
-int mbr_hsatlraw_wr_ldeocmnt(int verbose, FILE *mbfp, void *data_ptr, int *error);
-
-static char rcs_id[]="$Id: mbr_hsatlraw.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mbr_register_hsatlraw(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_register_hsatlraw";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* get mb_io_ptr */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set format info parameters */
-	status = mbr_info_hsatlraw(verbose,
-			&mb_io_ptr->system,
-			&mb_io_ptr->beams_bath_max,
-			&mb_io_ptr->beams_amp_max,
-			&mb_io_ptr->pixels_ss_max,
-			mb_io_ptr->format_name,
-			mb_io_ptr->system_name,
-			mb_io_ptr->format_description,
-			&mb_io_ptr->numfile,
-			&mb_io_ptr->filetype,
-			&mb_io_ptr->variable_beams,
-			&mb_io_ptr->traveltime,
-			&mb_io_ptr->beam_flagging,
-			&mb_io_ptr->nav_source,
-			&mb_io_ptr->heading_source,
-			&mb_io_ptr->vru_source,
-			&mb_io_ptr->svp_source,
-			&mb_io_ptr->beamwidth_xtrack,
-			&mb_io_ptr->beamwidth_ltrack,
-			error);
-
-	/* set format and system specific function pointers */
-	mb_io_ptr->mb_io_format_alloc = &mbr_alm_hsatlraw;
-	mb_io_ptr->mb_io_format_free = &mbr_dem_hsatlraw;
-	mb_io_ptr->mb_io_store_alloc = &mbsys_hsds_alloc;
-	mb_io_ptr->mb_io_store_free = &mbsys_hsds_deall;
-	mb_io_ptr->mb_io_read_ping = &mbr_rt_hsatlraw;
-	mb_io_ptr->mb_io_write_ping = &mbr_wt_hsatlraw;
-	mb_io_ptr->mb_io_dimensions = &mbsys_hsds_dimensions;
-	mb_io_ptr->mb_io_extract = &mbsys_hsds_extract;
-	mb_io_ptr->mb_io_insert = &mbsys_hsds_insert;
-	mb_io_ptr->mb_io_extract_nav = &mbsys_hsds_extract_nav;
-	mb_io_ptr->mb_io_insert_nav = &mbsys_hsds_insert_nav;
-	mb_io_ptr->mb_io_extract_altitude = &mbsys_hsds_extract_altitude;
-	mb_io_ptr->mb_io_insert_altitude = NULL;
-	mb_io_ptr->mb_io_extract_svp = &mbsys_hsds_extract_svp;
-	mb_io_ptr->mb_io_insert_svp = &mbsys_hsds_insert_svp;
-	mb_io_ptr->mb_io_ttimes = &mbsys_hsds_ttimes;
-	mb_io_ptr->mb_io_detects = &mbsys_hsds_detects;
-	mb_io_ptr->mb_io_copyrecord = &mbsys_hsds_copy;
-	mb_io_ptr->mb_io_extract_rawss = NULL;
-	mb_io_ptr->mb_io_insert_rawss = NULL;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",mb_io_ptr->system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",mb_io_ptr->beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",mb_io_ptr->beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",mb_io_ptr->pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",mb_io_ptr->format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",mb_io_ptr->system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",mb_io_ptr->format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",mb_io_ptr->numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",mb_io_ptr->filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",mb_io_ptr->variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",mb_io_ptr->traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",mb_io_ptr->beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",mb_io_ptr->nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",mb_io_ptr->heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",mb_io_ptr->vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",mb_io_ptr->svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",mb_io_ptr->beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",mb_io_ptr->beamwidth_ltrack);
-		fprintf(stderr,"dbg2       format_alloc:       %p\n",(void *)mb_io_ptr->mb_io_format_alloc);
-		fprintf(stderr,"dbg2       format_free:        %p\n",(void *)mb_io_ptr->mb_io_format_free);
-		fprintf(stderr,"dbg2       store_alloc:        %p\n",(void *)mb_io_ptr->mb_io_store_alloc);
-		fprintf(stderr,"dbg2       store_free:         %p\n",(void *)mb_io_ptr->mb_io_store_free);
-		fprintf(stderr,"dbg2       read_ping:          %p\n",(void *)mb_io_ptr->mb_io_read_ping);
-		fprintf(stderr,"dbg2       write_ping:         %p\n",(void *)mb_io_ptr->mb_io_write_ping);
-		fprintf(stderr,"dbg2       extract:            %p\n",(void *)mb_io_ptr->mb_io_extract);
-		fprintf(stderr,"dbg2       insert:             %p\n",(void *)mb_io_ptr->mb_io_insert);
-		fprintf(stderr,"dbg2       extract_nav:        %p\n",(void *)mb_io_ptr->mb_io_extract_nav);
-		fprintf(stderr,"dbg2       insert_nav:         %p\n",(void *)mb_io_ptr->mb_io_insert_nav);
-		fprintf(stderr,"dbg2       extract_altitude:   %p\n",(void *)mb_io_ptr->mb_io_extract_altitude);
-		fprintf(stderr,"dbg2       insert_altitude:    %p\n",(void *)mb_io_ptr->mb_io_insert_altitude);
-		fprintf(stderr,"dbg2       extract_svp:        %p\n",(void *)mb_io_ptr->mb_io_extract_svp);
-		fprintf(stderr,"dbg2       insert_svp:         %p\n",(void *)mb_io_ptr->mb_io_insert_svp);
-		fprintf(stderr,"dbg2       ttimes:             %p\n",(void *)mb_io_ptr->mb_io_ttimes);
-		fprintf(stderr,"dbg2       detects:            %p\n",(void *)mb_io_ptr->mb_io_detects);
-		fprintf(stderr,"dbg2       extract_rawss:      %p\n",(void *)mb_io_ptr->mb_io_extract_rawss);
-		fprintf(stderr,"dbg2       insert_rawss:       %p\n",(void *)mb_io_ptr->mb_io_insert_rawss);
-		fprintf(stderr,"dbg2       copyrecord:         %p\n",(void *)mb_io_ptr->mb_io_copyrecord);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbr_info_hsatlraw(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error)
-{
-	char	*function_name = "mbr_info_hsatlraw";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* set format info parameters */
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-	*system = MB_SYS_HSDS;
-	*beams_bath_max = 59;
-	*beams_amp_max = 59;
-	*pixels_ss_max = 0;
-	strncpy(format_name, "HSATLRAW", MB_NAME_LENGTH);
-	strncpy(system_name, "HSDS", MB_NAME_LENGTH);
-	strncpy(format_description, "Format name:          MBF_HSATLRAW\nInformal Description: Raw Hydrosweep\nAttributes:           Hydrosweep DS, bathymetry and amplitude, 59 beams,\n                      ascii, Atlas Electronik.\n", MB_DESCRIPTION_LENGTH);
-	*numfile = 1;
-	*filetype = MB_FILETYPE_NORMAL;
-	*variable_beams = MB_NO;
-	*traveltime = MB_YES;
-	*beam_flagging = MB_NO;
-	*nav_source = MB_DATA_DATA;
-	*heading_source = MB_DATA_DATA;
-	*vru_source = MB_DATA_DATA;
-	*svp_source = MB_DATA_VELOCITY_PROFILE;
-	*beamwidth_xtrack = 2.0;
-	*beamwidth_ltrack = 2.0;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",*system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",*beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",*beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",*pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",*numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",*filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",*variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",*traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",*beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",*nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",*heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",*vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",*svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",*beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",*beamwidth_ltrack);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_alm_hsatlraw(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_alm_hsatlraw";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_hsatlraw_struct *data;
-	char	*data_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set initial status */
-	status = MB_SUCCESS;
-
-	/* allocate memory for data structure */
-	mb_io_ptr->structure_size = sizeof(struct mbf_hsatlraw_struct);
-	mb_io_ptr->data_structure_size = 0;
-	status = mb_malloc(verbose,mb_io_ptr->structure_size,
-				&mb_io_ptr->raw_data,error);
-	status = mbsys_hsds_alloc(verbose, mbio_ptr, (void **)(&mb_io_ptr->store_data),error);
-
-	/* get pointer to mbio descriptor */
-	data = (struct mbf_hsatlraw_struct *) mb_io_ptr->raw_data;
-	data_ptr = (char *) data;
-
-	/* initialize everything to zeros */
-	mbr_zero_hsatlraw(verbose,data_ptr,ZERO_ALL,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_dem_hsatlraw(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_dem_hsatlraw";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* deallocate memory for data descriptor */
-	status = mb_free(verbose,&mb_io_ptr->raw_data,error);
-	status = mb_free(verbose,&mb_io_ptr->store_data,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_zero_hsatlraw(int verbose, void *data_ptr, int mode, int *error)
-{
-	char	*function_name = "mbr_zero_hsatlraw";
-	int	status = MB_SUCCESS;
-	struct mbf_hsatlraw_struct *data;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       data_ptr:   %p\n",(void *)data_ptr);
-		fprintf(stderr,"dbg2       mode:       %d\n",mode);
-		}
-
-	/* get pointer to data descriptor */
-	data = (struct mbf_hsatlraw_struct *) data_ptr;
-
-	/* initialize everything to zeros */
-	if (data != NULL)
-		{
-		/* type of data record */
-		data->kind = MB_DATA_NONE;
-
-		/* position (all records ) */
-		data->lon = 0.0;
-		data->lat = 0.0;
-
-		/* time stamp (all records ) */
-		data->year = 0;
-		data->month = 0;
-		data->day = 0;
-		data->hour = 0;
-		data->minute = 0;
-		data->second = 0;
-		data->alt_minute = 0;
-		data->alt_second = 0;
-
-		/* additional navigation and depths (ERGNMESS and ERGNEICH) */
-		data->course_true = 0.0;
-		data->speed_transverse = 0.0;
-		data->speed = 0.0;
-		data->speed_reference[0] = '\0';
-		data->pitch = 0.0;
-		data->track = 0;
-		data->depth_center = 0.0;
-		data->depth_scale = 0.0;
-		data->spare = 0;
-		for (i=0;i<MBF_HSATLRAW_BEAMS;i++)
-			{
-			data->distance[i] = 0;
-			data->depth[i] = 0;
-			}
-
-		/* travel time data (ERGNSLZT) */
-		data->course_ground = 0.0;
-		data->speed_ground = 0.0;
-		data->heave = 0.0;
-		data->roll = 0.0;
-		data->time_center = 0.0;
-		data->time_scale = 0.0;
-		for (i=0;i<MBF_HSATLRAW_BEAMS;i++)
-			data->time[i] = 0;
-		for (i=0;i<11;i++)
-			data->gyro[i] = 0.0;
-
-		/* amplitude data (ERGNAMPL) */
-		data->mode[0] = '\0';
-		data->trans_strbd = 0;
-		data->trans_vert = 0;
-		data->trans_port = 0;
-		data->pulse_len_strbd = 0;
-		data->pulse_len_vert = 0;
-		data->pulse_len_port = 0;
-		data->gain_start = 0;
-		data->r_compensation_factor = 0;
-		data->compensation_start = 0;
-		data->increase_start = 0;
-		data->tvc_near = 0;
-		data->tvc_far = 0;
-		data->increase_int_near = 0;
-		data->increase_int_far = 0;
-		data->gain_center = 0;
-		data->filter_gain = 0.0;
-		data->amplitude_center = 0;
-		data->echo_duration_center = 0;
-		data->echo_scale_center = 0;
-		for (i=0;i<16;i++)
-			{
-			data->gain[i] = 0;
-			data->echo_scale[i] = 0;
-			}
-		for (i=0;i<MBF_HSATLRAW_BEAMS;i++)
-			{
-			data->amplitude[i] = 0;
-			data->echo_duration[i] = 0;
-			}
-
-		/* these values zeroed only when structure
-			is first allocated - this allows
-			these values to be remembered internally
-			once one of these occasional data
-			records is encountered */
-		if (mode == ZERO_ALL)
-			{
-			/* mean velocity (ERGNHYDI) */
-			data->draught = 0.0;
-			data->vel_mean = 0.0;
-			data->vel_keel = 0.0;
-			data->tide = 0.0;
-
-			/* water velocity profile */
-			data->num_vel = 0;
-			for (i=0;i<MBF_HSATLRAW_MAXVEL;i++)
-				{
-				data->depth[i] = 0;
-				data->velocity[i] = 0;
-				}
-
-			/* navigation source (ERGNPOSI) */
-			data->pos_corr_x = 0.0;
-			data->pos_corr_y = 0.0;
-			strncpy(data->sensors,"POS",9);
-			}
-
-		/* comment (LDEOCOMM) */
-		strncpy(data->comment,"\0",MBF_HSATLRAW_MAXLINE);
-
-		}
-
-	/* assume success */
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_rt_hsatlraw(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_rt_hsatlraw";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_hsatlraw_struct *data;
-	struct mbsys_hsds_struct *store;
-	double	xx, rr, zz, tt;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointers to mbio descriptor and data structures */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-	data = (struct mbf_hsatlraw_struct *) mb_io_ptr->raw_data;
-	store = (struct mbsys_hsds_struct *) store_ptr;
-
-	/* read next data from file */
-	status = mbr_hsatlraw_rd_data(verbose,mbio_ptr,error);
-
-	/* set error and kind in mb_io_ptr */
-	mb_io_ptr->new_error = *error;
-	mb_io_ptr->new_kind = data->kind;
-
-	/* translate values to hydrosweep data storage structure */
-	if (status == MB_SUCCESS
-		&& store != NULL)
-		{
-		/* type of data record */
-		store->kind = data->kind;
-
-		/* position (all records ) */
-		store->lon = data->lon;
-		store->lat = data->lat;
-
-		/* time stamp (all records ) */
-		store->year = data->year;
-		store->month = data->month;
-		store->day = data->day;
-		store->hour = data->hour;
-		store->minute = data->minute;
-		store->second = data->second;
-		store->alt_minute = data->alt_minute;
-		store->alt_second = data->alt_second;
-
-		/* additional navigation and depths (ERGNMESS and ERGNEICH) */
-		store->course_true = data->course_true;
-		store->speed_transverse = data->speed_transverse;
-		store->speed = data->speed;
-		store->speed_reference[0] = data->speed_reference[0];
-		store->pitch = data->pitch;
-		store->track = data->track;
-		store->depth_center = data->depth_center;
-		store->depth_scale = data->depth_scale;
-		store->spare = data->spare;
-		for (i=0;i<MBSYS_HSDS_BEAMS;i++)
-			{
-			store->distance[i] = data->distance[i];
-			store->depth[i] = data->depth[i];
-			}
-
-		/* travel time data (ERGNSLZT) */
-		store->course_ground = data->course_ground;
-		store->speed_ground = data->speed_ground;
-		store->heave = data->heave;
-		store->roll = data->roll;
-		store->time_center = data->time_center;
-		store->time_scale = data->time_scale;
-		for (i=0;i<MBSYS_HSDS_BEAMS;i++)
-			store->time[i] = data->time[i];
-		for (i=0;i<11;i++)
-			store->gyro[i] = data->gyro[i];
-
-		/* amplitude data (ERGNAMPL) */
-		store->mode[0] = data->mode[0];
-		store->trans_strbd = data->trans_strbd;
-		store->trans_vert = data->trans_vert;
-		store->trans_port = data->trans_port;
-		store->pulse_len_strbd = data->pulse_len_strbd;
-		store->pulse_len_vert = data->pulse_len_vert;
-		store->pulse_len_port = data->pulse_len_port;
-		store->gain_start = data->gain_start;
-		store->r_compensation_factor = data->r_compensation_factor;
-		store->compensation_start = data->compensation_start;
-		store->increase_start = data->increase_start;
-		store->tvc_near = data->tvc_near;
-		store->tvc_far = data->tvc_far;
-		store->increase_int_near = data->increase_int_near;
-		store->increase_int_far = data->increase_int_far;
-		store->gain_center = data->gain_center;
-		store->filter_gain = data->filter_gain;
-		store->amplitude_center = data->amplitude_center;
-		store->echo_duration_center = data->echo_duration_center;
-		store->echo_scale_center = data->echo_scale_center;
-		for (i=0;i<MBSYS_HSDS_BEAMS;i++)
-			{
-			store->amplitude[i] = data->amplitude[i];
-			store->echo_duration[i] = data->echo_duration[i];
-			}
-		for (i=0;i<16;i++)
-			{
-			store->gain[i] = data->gain[i];
-			store->echo_scale[i] = data->echo_scale[i];
-			}
-
-		/* mean velocity (ERGNHYDI) */
-		store->draught = data->draught;
-		store->vel_mean = data->vel_mean;
-		store->vel_keel = data->vel_keel;
-		store->tide = data->tide;
-
-		/* water velocity profile (HS_ERGNCTDS) */
-		store->num_vel = data->num_vel;
-		for (i=0;i<data->num_vel;i++)
-			{
-			store->vdepth[i] = data->vdepth[i];
-			store->velocity[i] = data->velocity[i];
-			}
-
-		/* navigation source (ERGNPOSI) */
-		store->pos_corr_x = data->pos_corr_x;
-		store->pos_corr_y = data->pos_corr_y;
-		strncpy(store->sensors,data->sensors,8);
-
-		/* comment (LDEOCMNT) */
-		strncpy(store->comment,data->comment,MBSYS_HSDS_MAXLINE);
-
-		/* processed backscatter */
-		store->back_scale = 1.0;
-		for (i=0;i<MBSYS_HSDS_BEAMS;i++)
-			{
-			store->back[i] = mb_io_ptr->new_amp[i];
-			}
-
-		/* deal with missing travel times if needed */
-		if (store->kind == MB_DATA_DATA)
-			{
-			if (store->vel_mean <= 0.0)
-				store->vel_mean = 1500.0;
-			if (store->vel_keel <= 0.0)
-				store->vel_keel = 1500.0;
-			if (store->time_scale == 0)
-				store->time_scale = 0.01;
-			if (store->time_center <= 0.0 && store->depth_center != 0.0)
-				{
-				rr = fabs(store->depth_center) + store->draught + store->heave;
-				store->time_center = rr / store->vel_mean;
-				}
-			for (i=0;i<MBSYS_HSDS_BEAMS;i++)
-				{
-				if (data->time[i] <= 0 && store->depth[i] != 0)
-					{
-					zz = store->depth_scale * (fabs((double)store->depth[i]) + store->draught + store->heave);
-					xx = store->depth_scale * store->distance[i];
-					rr = sqrt(xx * xx + zz * zz);
-					tt = 2 * rr / store->vel_mean;
-					store->time[i] = tt / store->time_scale;
-					}
-				}
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_wt_hsatlraw(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_wt_hsatlraw";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_hsatlraw_struct *data;
-	char	*data_ptr;
-	struct mbsys_hsds_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_hsatlraw_struct *) mb_io_ptr->raw_data;
-	data_ptr = (char *) data;
-	store = (struct mbsys_hsds_struct *) store_ptr;
-
-	/* first translate values from data storage structure */
-	if (store != NULL)
-		{
-		/* type of data record */
-		data->kind = store->kind;
-
-		/* position (all records ) */
-		data->lon = store->lon;
-		data->lat = store->lat;
-
-		/* time stamp (all records ) */
-		data->year = store->year;
-		data->month = store->month;
-		data->day = store->day;
-		data->hour = store->hour;
-		data->minute = store->minute;
-		data->second = store->second;
-		data->alt_minute = store->alt_minute;
-		data->alt_second = store->alt_second;
-
-		/* additional navigation and depths (ERGNMESS and ERGNEICH) */
-		data->course_true = store->course_true;
-		data->speed_transverse = store->speed_transverse;
-		data->speed = store->speed;
-		data->speed_reference[0] = store->speed_reference[0];
-		data->pitch = store->pitch;
-		data->track = store->track;
-		data->depth_center = store->depth_center;
-		data->depth_scale = store->depth_scale;
-		data->spare = store->spare;
-		for (i=0;i<MBSYS_HSDS_BEAMS;i++)
-			{
-			data->distance[i] = store->distance[i];
-			data->depth[i] = store->depth[i];
-			}
-
-		/* travel time data (ERGNSLZT) */
-		data->course_ground = store->course_ground;
-		data->speed_ground = store->speed_ground;
-		data->heave = store->heave;
-		data->roll = store->roll;
-		data->time_center = store->time_center;
-		data->time_scale = store->time_scale;
-		for (i=0;i<MBSYS_HSDS_BEAMS;i++)
-			data->time[i] = store->time[i];
-		for (i=0;i<11;i++)
-			data->gyro[i] = store->gyro[i];
-
-		/* amplitude data (ERGNAMPL) */
-		data->mode[0] = store->mode[0];
-		data->trans_strbd = store->trans_strbd;
-		data->trans_vert = store->trans_vert;
-		data->trans_port = store->trans_port;
-		data->pulse_len_strbd = store->pulse_len_strbd;
-		data->pulse_len_vert = store->pulse_len_vert;
-		data->pulse_len_port = store->pulse_len_port;
-		data->gain_start = store->gain_start;
-		data->r_compensation_factor = store->r_compensation_factor;
-		data->compensation_start = store->compensation_start;
-		data->increase_start = store->increase_start;
-		data->tvc_near = store->tvc_near;
-		data->tvc_far = store->tvc_far;
-		data->increase_int_near = store->increase_int_near;
-		data->increase_int_far = store->increase_int_far;
-		data->gain_center = store->gain_center;
-		data->filter_gain = store->filter_gain;
-		data->amplitude_center = store->amplitude_center;
-		data->echo_duration_center = store->echo_duration_center;
-		data->echo_scale_center = store->echo_scale_center;
-		for (i=0;i<MBSYS_HSDS_BEAMS;i++)
-			{
-			data->amplitude[i] = store->amplitude[i];
-			data->echo_duration[i] = store->echo_duration[i];
-			}
-		for (i=0;i<16;i++)
-			{
-			data->gain[i] = store->gain[i];
-			data->echo_scale[i] = store->echo_scale[i];
-			}
-
-		/* mean velocity (ERGNHYDI) */
-		data->draught = store->draught;
-		data->vel_mean = store->vel_mean;
-		data->vel_keel = store->vel_keel;
-		data->tide = store->tide;
-
-		/* water velocity profile (HS_ERGNCTDS) */
-		data->num_vel = store->num_vel;
-		for (i=0;i<store->num_vel;i++)
-			{
-			data->vdepth[i] = store->vdepth[i];
-			data->velocity[i] = store->velocity[i];
-			}
-
-		/* navigation source (ERGNPOSI) */
-		data->pos_corr_x = store->pos_corr_x;
-		data->pos_corr_y = store->pos_corr_y;
-		strncpy(data->sensors,store->sensors,8);
-
-		/* comment (LDEOCMNT) */
-		strncpy(data->comment,store->comment,MBSYS_HSDS_MAXLINE);
-
-		}
-
-	/* check that no bathymetry values are negative */
-	for (i=0;i<MBSYS_HSDS_BEAMS;i++)
-		{
-		if (data->depth[i] < 0)
-			data->depth[i] = 0;
-		}
-
-	/* write next data to file */
-	status = mbr_hsatlraw_wr_data(verbose,mbio_ptr,data_ptr,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_hsatlraw_rd_data(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_hsatlraw_rd_data";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_hsatlraw_struct *data;
-	char	*data_ptr;
-	FILE	*mbfp;
-	int	done;
-	int	expect;
-
-	static int line_save_flag = MB_NO;
-	static char raw_line[MBF_HSATLRAW_MAXLINE] = "\0";
-	static int type = MBF_HSATLRAW_NONE;
-	static int shift = 0;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_hsatlraw_struct *) mb_io_ptr->raw_data;
-	data_ptr = (char *) data;
-	mbfp = mb_io_ptr->mbfp;
-
-	/* initialize everything to zeros */
-	mbr_zero_hsatlraw(verbose,data_ptr,ZERO_SOME,error);
-
-	/* set file position */
-	mb_io_ptr->file_pos = mb_io_ptr->file_bytes;
-
-	done = MB_NO;
-	expect = MBF_HSATLRAW_NONE;
-	while (done == MB_NO)
-		{
-
-		/* get next record label */
-		if (line_save_flag == MB_NO)
-			{
-			mb_io_ptr->file_bytes = ftell(mbfp);
-			status = mbr_hsatlraw_rd_label(verbose,mbfp,
-				raw_line,&type,&shift,error);
-			}
-		else
-			line_save_flag = MB_NO;
-
-		/* read the appropriate data records */
-		if (status == MB_FAILURE && expect == MBF_HSATLRAW_NONE)
-			{
-			mb_io_ptr->file_bytes = ftell(mbfp);
-			done = MB_YES;
-			}
-		else if (status == MB_FAILURE && expect != MBF_HSATLRAW_NONE)
-			{
-			mb_io_ptr->file_bytes = ftell(mbfp);
-			done = MB_YES;
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		else if (expect != MBF_HSATLRAW_NONE && expect != type)
-			{
-			done = MB_YES;
-			line_save_flag = MB_YES;
-			}
-		else if (type == MBF_HSATLRAW_RAW_LINE)
-			{
-			strcpy(data->comment,raw_line+shift);
-			mb_io_ptr->file_bytes = ftell(mbfp);
-			done = MB_YES;
-			data->kind = MB_DATA_RAW_LINE;
-			*error = MB_ERROR_UNINTELLIGIBLE;
-			status = MB_FAILURE;
-			}
-		else if (type == MBF_HSATLRAW_ERGNHYDI)
-			{
-			status = mbr_hsatlraw_rd_ergnhydi(
-				verbose,mbfp,data,shift,error);
-			mb_io_ptr->file_bytes = ftell(mbfp);
-			if (status == MB_SUCCESS)
-				{
-				done = MB_YES;
-				data->kind = MB_DATA_MEAN_VELOCITY;
-				}
-			}
-		else if (type == MBF_HSATLRAW_ERGNPARA)
-			{
-			status = mbr_hsatlraw_rd_ergnpara(
-				verbose,mbfp,data,shift,error);
-			mb_io_ptr->file_bytes = ftell(mbfp);
-			if (status == MB_SUCCESS)
-				{
-				done = MB_YES;
-				data->kind = MB_DATA_STANDBY;
-				}
-			}
-		else if (type == MBF_HSATLRAW_ERGNPOSI)
-			{
-			status = mbr_hsatlraw_rd_ergnposi(
-				verbose,mbfp,data,shift,error);
-			mb_io_ptr->file_bytes = ftell(mbfp);
-			if (status == MB_SUCCESS)
-				{
-				done = MB_YES;
-				data->kind = MB_DATA_NAV_SOURCE;
-				}
-			}
-		else if (type == MBF_HSATLRAW_ERGNEICH)
-			{
-			status = mbr_hsatlraw_rd_ergneich(
-				verbose,mbfp,data,shift,error);
-			mb_io_ptr->file_bytes = ftell(mbfp);
-			if (status == MB_SUCCESS)
-				{
-				done = MB_NO;
-				data->kind = MB_DATA_CALIBRATE;
-				expect = MBF_HSATLRAW_ERGNSLZT;
-				}
-			}
-		else if (type == MBF_HSATLRAW_ERGNMESS)
-			{
-			status = mbr_hsatlraw_rd_ergnmess(
-				verbose,mbfp,data,shift,error);
-			mb_io_ptr->file_bytes = ftell(mbfp);
-			if (status == MB_SUCCESS)
-				{
-				done = MB_NO;
-				data->kind = MB_DATA_DATA;
-				expect = MBF_HSATLRAW_ERGNSLZT;
-				}
-			}
-		else if (type == MBF_HSATLRAW_ERGNSLZT)
-			{
-			status = mbr_hsatlraw_rd_ergnslzt(
-				verbose,mbfp,data,shift,error);
-			mb_io_ptr->file_bytes = ftell(mbfp);
-			if (status == MB_SUCCESS && expect == MBF_HSATLRAW_ERGNSLZT)
-				{
-				done = MB_NO;
-				expect = MBF_HSATLRAW_ERGNAMPL;
-				}
-			else if (status == MB_SUCCESS)
-				{
-				done = MB_YES;
-				expect = MBF_HSATLRAW_NONE;
-				*error = MB_ERROR_UNINTELLIGIBLE;
-				status = MB_FAILURE;
-				}
-			}
-		else if (type == MBF_HSATLRAW_ERGNCTDS)
-			{
-			status = mbr_hsatlraw_rd_ergnctds(
-				verbose,mbfp,data,shift,error);
-			mb_io_ptr->file_bytes = ftell(mbfp);
-			if (status == MB_SUCCESS)
-				{
-				done = MB_YES;
-				data->kind = MB_DATA_VELOCITY_PROFILE;
-				}
-			}
-		else if (type == MBF_HSATLRAW_ERGNAMPL)
-			{
-			status = mbr_hsatlraw_rd_ergnampl(
-				verbose,mbfp,data,shift,error);
-			mb_io_ptr->file_bytes = ftell(mbfp);
-			if (status == MB_SUCCESS
-				&& expect == MBF_HSATLRAW_ERGNAMPL)
-				{
-				done = MB_YES;
-				expect = MBF_HSATLRAW_NONE;
-				}
-			else if (status == MB_SUCCESS)
-				{
-				done = MB_YES;
-				expect = MBF_HSATLRAW_NONE;
-				*error = MB_ERROR_UNINTELLIGIBLE;
-				status = MB_FAILURE;
-				}
-			}
-		else if (type == MBF_HSATLRAW_LDEOCMNT)
-			{
-			status = mbr_hsatlraw_rd_ldeocmnt(
-				verbose,mbfp,data,shift,error);
-			mb_io_ptr->file_bytes = ftell(mbfp);
-			if (status == MB_SUCCESS)
-				{
-				done = MB_YES;
-				data->kind = MB_DATA_COMMENT;
-				}
-			}
-		}
-
-	/* handle Hydrosweep Y2K problem */
-	if (status == MB_SUCCESS && data->year < 1962)
-		data->year = 2000 + (data->year % 100);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int	mbr_hsatlraw_rd_label(int verbose, FILE *mbfp,
-		char *line, int *type, int *shift, int *error)
-{
-	char	*function_name = "mbr_hsatlraw_rd_label";
-	int	status = MB_SUCCESS;
-	int	i;
-	int	icmp;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		}
-
-	/* read next line in file */
-	status = mbr_hsatlraw_read_line(verbose,mbfp,0,line,error);
-
-	/* see if we just encountered an identifier record */
-	if (status == MB_SUCCESS)
-		{
-		*type = MBF_HSATLRAW_RAW_LINE;
-		*shift = 0;
-		for (i=1;i<MBF_HSATLRAW_RECORDS;i++)
-			{
-			icmp = strncmp(line,mbf_hsatlraw_labels[i],8);
-			if (icmp == 0)
-				*type = i;
-			}
-		}
-
-	/* didn't find one with zero shift, try shift = 4 in case this
-		is tape data */
-	if (status == MB_SUCCESS && *type == MBF_HSATLRAW_RAW_LINE)
-		{
-		*shift = 4;
-		for (i=1;i<MBF_HSATLRAW_RECORDS;i++)
-			{
-			icmp = strncmp(line+4,mbf_hsatlraw_labels[i],8);
-			if (icmp == 0)
-				*type = i;
-			}
-		if (*type == MBF_HSATLRAW_RAW_LINE)
-			*shift = 0;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       line:       %s\n",line);
-		fprintf(stderr,"dbg2       type:       %d\n",*type);
-		fprintf(stderr,"dbg2       shift:      %d\n",*shift);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int	mbr_hsatlraw_read_line(int verbose, FILE *mbfp,
-		int minimum_size, char *line, int *error)
-{
-	char	*function_name = "mbr_hsatlraw_read_line";
-	int	status = MB_SUCCESS;
-	int	nchars;
-	int	done;
-	char	*result;
-	int	blank;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		}
-
-	/* read next good line in file */
-	done = MB_NO;
-	do
-		{
-		/* read next line in file */
-		strncpy(line,"\0",MBF_HSATLRAW_MAXLINE);
-		result = fgets(line,MBF_HSATLRAW_MAXLINE,mbfp);
-
-
-		/* check for eof */
-		if (result == line)
-			{
-			/* check size of line */
-			nchars = strlen(line);
-			if (nchars >= minimum_size)
-				{
-				done = MB_YES;
-			
-				/* trim trailing blank characters */
-				blank = MB_YES;
-				for (i=(nchars-1); i>=0 && blank==MB_YES; i--)
-					{
-					if (line[i] == ' ' || line[i] == '\r' || line[i] == '\n')
-						line[i] = '\0';
-					else
-						blank = MB_NO;
-					}
-				nchars = strlen(line);
-				}
-				
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		else
-			{
-			done = MB_YES;
-			*error = MB_ERROR_EOF;
-			status = MB_FAILURE;
-			}
-
-		/* print debug statements */
-		if (verbose >= 5)
-			{
-			fprintf(stderr,"\ndbg5  New line read in function <%s>\n",function_name);
-			fprintf(stderr,"dbg5       line:       %s\n",line);
-			fprintf(stderr,"dbg5       chars:      %d\n",nchars);
-			}
-
-		}
-	while (done == MB_NO);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       line:       %s\n",line);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_hsatlraw_rd_ergnhydi(int verbose, FILE *mbfp,
-		struct mbf_hsatlraw_struct *data, int shift, int *error)
-{
-	char	*function_name = "mbr_hsatlraw_rd_ergnhydi";
-	int	status = MB_SUCCESS;
-	char	line[MBF_HSATLRAW_MAXLINE];
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       data:       %p\n",(void *)data);
-		fprintf(stderr,"dbg2       shift:      %d\n",shift);
-		}
-
-	/* read event record from file */
-	status = mbr_hsatlraw_read_line(verbose,mbfp,shift+9,line,error);
-
-	/* make sure line is long enough */
-	if (strlen(line) < 69 + shift)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_UNINTELLIGIBLE;
-		}
-
-	/* parse data from first line */
-	if (status == MB_SUCCESS)
-		{
-		mb_get_double( &(data->lon),        line+shift,    12);
-		mb_get_double( &(data->lat),        line+12+shift, 12);
-		mb_get_int(    &(data->year),       line+24+shift,  4);
-		mb_get_int(    &(data->month),      line+28+shift,  2);
-		mb_get_int(    &(data->day),        line+30+shift,  2);
-		mb_get_int(    &(data->hour),       line+32+shift,  2);
-		mb_get_int(    &(data->minute),     line+34+shift,  2);
-		mb_get_int(    &(data->second),     line+36+shift,  2);
-		mb_get_int(    &(data->alt_minute), line+38+shift,  5);
-		mb_get_int(    &(data->alt_second), line+43+shift,  2);
-		mb_get_double( &(data->draught),    line+45+shift,  4);
-		mb_get_double( &(data->vel_mean),   line+49+shift,  7);
-		mb_get_double( &(data->vel_keel),   line+56+shift,  7);
-		mb_get_double( &(data->tide),       line+63+shift,  6);
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       longitude:        %f\n",data->lon);
-		fprintf(stderr,"dbg5       latitude:         %f\n",data->lat);
-		fprintf(stderr,"dbg5       year:             %d\n",data->year);
-		fprintf(stderr,"dbg5       month:            %d\n",data->month);
-		fprintf(stderr,"dbg5       day:              %d\n",data->day);
-		fprintf(stderr,"dbg5       hour:             %d\n",data->hour);
-		fprintf(stderr,"dbg5       minute:           %d\n",
-			data->minute);
-		fprintf(stderr,"dbg5       second:           %d\n",
-			data->second);
-		fprintf(stderr,"dbg5       alt minute:       %d\n",
-			data->alt_minute);
-		fprintf(stderr,"dbg5       alt second:       %d\n",
-			data->alt_second);
-		fprintf(stderr,"dbg5       draught:          %f\n",
-			data->draught);
-		fprintf(stderr,"dbg5       mean velocity:    %f\n",
-			data->vel_mean);
-		fprintf(stderr,"dbg5       keel velocity:    %f\n",
-			data->vel_keel);
-		fprintf(stderr,"dbg5       tide:             %f\n",data->tide);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_hsatlraw_rd_ergnpara(int verbose, FILE *mbfp,
-		struct mbf_hsatlraw_struct *data, int shift, int *error)
-{
-	char	*function_name = "mbr_hsatlraw_rd_ergnpara";
-	int	status = MB_SUCCESS;
-	char	line[MBF_HSATLRAW_MAXLINE];
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       data:       %p\n",(void *)data);
-		fprintf(stderr,"dbg2       shift:      %d\n",shift);
-		}
-
-	/* read event record from file */
-	status = mbr_hsatlraw_read_line(verbose,mbfp,shift+9,line,error);
-
-	/* make sure line is long enough */
-	if (strlen(line) < 84 + shift)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_UNINTELLIGIBLE;
-		}
-
-	/* parse data from first line */
-	if (status == MB_SUCCESS)
-		{
-		mb_get_double( &(data->lon),        line+shift,    12);
-		mb_get_double( &(data->lat),        line+12+shift, 12);
-		mb_get_int(    &(data->year),       line+24+shift,  4);
-		mb_get_int(    &(data->month),      line+28+shift,  2);
-		mb_get_int(    &(data->day),        line+30+shift,  2);
-		mb_get_int(    &(data->hour),       line+32+shift,  2);
-		mb_get_int(    &(data->minute),     line+34+shift,  2);
-		mb_get_int(    &(data->second),     line+36+shift,  2);
-		mb_get_int(    &(data->alt_minute), line+38+shift,  5);
-		mb_get_int(    &(data->alt_second), line+43+shift,  2);
-		mb_get_double( &(data->course_true),line+45+shift,  5);
-		mb_get_double( &(data->speed_transverse), line+50+shift, 9);
-		mb_get_double( &(data->speed),      line+59+shift,  9);
-		data->speed_reference[0] = line[68+shift];
-		mb_get_double( &(data->pitch),      line+69+shift,  4);
-		mb_get_int(    &(data->track),      line+73+shift,  4);
-		mb_get_double( &(data->depth_center),line+77+shift, 7);
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       longitude:        %f\n",data->lon);
-		fprintf(stderr,"dbg5       latitude:         %f\n",data->lat);
-		fprintf(stderr,"dbg5       year:             %d\n",data->year);
-		fprintf(stderr,"dbg5       month:            %d\n",data->month);
-		fprintf(stderr,"dbg5       day:              %d\n",data->day);
-		fprintf(stderr,"dbg5       hour:             %d\n",data->hour);
-		fprintf(stderr,"dbg5       minute:           %d\n",
-			data->minute);
-		fprintf(stderr,"dbg5       second:           %d\n",
-			data->second);
-		fprintf(stderr,"dbg5       alt minute:       %d\n",
-			data->alt_minute);
-		fprintf(stderr,"dbg5       alt second:       %d\n",
-			data->alt_second);
-		fprintf(stderr,"dbg5       course_true:      %f\n",
-			data->course_true);
-		fprintf(stderr,"dbg5       speed_transverse: %f\n",
-			data->speed_transverse);
-		fprintf(stderr,"dbg5       speed:            %f\n",
-			data->speed);
-		fprintf(stderr,"dbg5       speed_reference:  %c\n",
-			data->speed_reference[0]);
-		fprintf(stderr,"dbg5       pitch:            %f\n",
-			data->pitch);
-		fprintf(stderr,"dbg5       track:            %d\n",
-			data->track);
-		fprintf(stderr,"dbg5       depth_center:     %f\n",
-			data->depth_center);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_hsatlraw_rd_ergnposi(int verbose, FILE *mbfp,
-		struct mbf_hsatlraw_struct *data, int shift, int *error)
-{
-	char	*function_name = "mbr_hsatlraw_rd_ergnposi";
-	int	status = MB_SUCCESS;
-	char	line[MBF_HSATLRAW_MAXLINE];
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       data:       %p\n",(void *)data);
-		fprintf(stderr,"dbg2       shift:      %d\n",shift);
-		}
-
-	/* read event record from file */
-	status = mbr_hsatlraw_read_line(verbose,mbfp,shift+9,line,error);
-
-	/* make sure line is long enough */
-	if (strlen(line) < 67 + shift)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_UNINTELLIGIBLE;
-		}
-
-	/* parse data from first line */
-	if (status == MB_SUCCESS)
-		{
-		mb_get_double( &(data->lon),        line+shift,    12);
-		mb_get_double( &(data->lat),        line+12+shift, 12);
-		mb_get_int(    &(data->year),       line+24+shift,  4);
-		mb_get_int(    &(data->month),      line+28+shift,  2);
-		mb_get_int(    &(data->day),        line+30+shift,  2);
-		mb_get_int(    &(data->hour),       line+32+shift,  2);
-		mb_get_int(    &(data->minute),     line+34+shift,  2);
-		mb_get_int(    &(data->second),     line+36+shift,  2);
-		mb_get_int(    &(data->alt_minute), line+38+shift,  5);
-		mb_get_int(    &(data->alt_second), line+43+shift,  2);
-		mb_get_double( &(data->pos_corr_x), line+45+shift,  7);
-		mb_get_double( &(data->pos_corr_y), line+52+shift,  7);
-		strncpy(data->sensors,line+59+shift,8);
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       longitude:        %f\n",data->lon);
-		fprintf(stderr,"dbg5       latitude:         %f\n",data->lat);
-		fprintf(stderr,"dbg5       year:             %d\n",data->year);
-		fprintf(stderr,"dbg5       month:            %d\n",data->month);
-		fprintf(stderr,"dbg5       day:              %d\n",data->day);
-		fprintf(stderr,"dbg5       hour:             %d\n",data->hour);
-		fprintf(stderr,"dbg5       minute:           %d\n",
-			data->minute);
-		fprintf(stderr,"dbg5       second:           %d\n",
-			data->second);
-		fprintf(stderr,"dbg5       alt minute:       %d\n",
-			data->alt_minute);
-		fprintf(stderr,"dbg5       alt second:       %d\n",
-			data->alt_second);
-		fprintf(stderr,"dbg5       pos_corr_x:       %f\n",
-			data->pos_corr_x);
-		fprintf(stderr,"dbg5       pos_corr_y:       %f\n",
-			data->pos_corr_y);
-		fprintf(stderr,"dbg5       sensors:          %s\n",
-			data->sensors);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_hsatlraw_rd_ergneich(int verbose, FILE *mbfp,
-		struct mbf_hsatlraw_struct *data, int shift, int *error)
-{
-	char	*function_name = "mbr_hsatlraw_rd_ergneich";
-	int	status = MB_SUCCESS;
-	char	line[MBF_HSATLRAW_MAXLINE];
-	int	i;
-	int	numvals;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       data:       %p\n",(void *)data);
-		fprintf(stderr,"dbg2       shift:      %d\n",shift);
-		}
-
-	/* read event record from file */
-	status = mbr_hsatlraw_read_line(verbose,mbfp,shift+9,line,error);
-
-	/* make sure line is long enough */
-	if (strlen(line) < 90 + shift)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_UNINTELLIGIBLE;
-		}
-
-	/* parse data from event record */
-	if (status == MB_SUCCESS)
-		{
-		mb_get_double( &(data->lon),        line+shift,    12);
-		mb_get_double( &(data->lat),        line+12+shift, 12);
-		mb_get_int(    &(data->year),       line+24+shift,  4);
-		mb_get_int(    &(data->month),      line+28+shift,  2);
-		mb_get_int(    &(data->day),        line+30+shift,  2);
-		mb_get_int(    &(data->hour),       line+32+shift,  2);
-		mb_get_int(    &(data->minute),     line+34+shift,  2);
-		mb_get_int(    &(data->second),     line+36+shift,  2);
-		mb_get_int(    &(data->alt_minute), line+38+shift,  5);
-		mb_get_int(    &(data->alt_second), line+43+shift,  2);
-		mb_get_double( &(data->course_true),line+45+shift,  5);
-		mb_get_double( &(data->speed_transverse), line+50+shift, 9);
-		mb_get_double( &(data->speed),      line+59+shift,  9);
-		data->speed_reference[0] = line[68+shift];
-		mb_get_double( &(data->pitch),      line+69+shift,  4);
-		mb_get_int(    &(data->track),      line+73+shift,  4);
-		mb_get_double( &(data->depth_center),line+77+shift, 7);
-		mb_get_double( &(data->depth_scale),line+84+shift,  4);
-		mb_get_int( &(data->spare),line+88+shift,  2);
-		if (data->depth_scale > 0.0)
-			data->depth[29] =
-				(int) (data->depth_center/data->depth_scale);
-		else
-			data->depth[29] = (int) data->depth_center;
-		data->distance[29] = 0;
-		}
-
-	/* read and parse data from first data record */
-	if ((status = mbr_hsatlraw_read_line(verbose,mbfp,shift+9,line,error))
-		== MB_SUCCESS)
-		{
-		mb_get_int(&numvals,line+shift,2);
-		if (numvals == 29)
-		for (i=0;i<numvals;i++)
-			mb_get_int(&(data->distance[i+30]),line+i*4+2+shift,4);
-		else
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_UNINTELLIGIBLE;
-			}
-		}
-
-	/* read and parse data from second data record */
-	if ((status = mbr_hsatlraw_read_line(verbose,mbfp,shift+9,line,error))
-		== MB_SUCCESS)
-		{
-		mb_get_int(&numvals,line+shift,2);
-		if (numvals == 29)
-		for (i=0;i<numvals;i++)
-			mb_get_int(&(data->depth[i+30]),line+i*4+2+shift,4);
-		else
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_UNINTELLIGIBLE;
-			}
-		}
-
-	/* read and parse data from third data record */
-	if ((status = mbr_hsatlraw_read_line(verbose,mbfp,shift+9,line,error))
-		== MB_SUCCESS)
-		{
-		mb_get_int(&numvals,line+shift,2);
-		if (numvals == 29)
-		for (i=0;i<numvals;i++)
-			{
-			mb_get_int(&(data->distance[28-i]),line+i*4+2+shift,4);
-			data->distance[28-i] = -data->distance[28-i];
-			}
-		else
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_UNINTELLIGIBLE;
-			}
-		}
-
-	/* read and parse data from fourth data record */
-	if ((status = mbr_hsatlraw_read_line(verbose,mbfp,shift+9,line,error))
-		== MB_SUCCESS)
-		{
-		mb_get_int(&numvals,line+shift,2);
-		if (numvals == 29)
-		for (i=0;i<numvals;i++)
-			mb_get_int(&(data->depth[28-i]),line+i*4+2+shift,4);
-		else
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_UNINTELLIGIBLE;
-			}
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       longitude:        %f\n",data->lon);
-		fprintf(stderr,"dbg5       latitude:         %f\n",data->lat);
-		fprintf(stderr,"dbg5       year:             %d\n",data->year);
-		fprintf(stderr,"dbg5       month:            %d\n",data->month);
-		fprintf(stderr,"dbg5       day:              %d\n",data->day);
-		fprintf(stderr,"dbg5       hour:             %d\n",data->hour);
-		fprintf(stderr,"dbg5       minute:           %d\n",
-			data->minute);
-		fprintf(stderr,"dbg5       second:           %d\n",
-			data->second);
-		fprintf(stderr,"dbg5       alt minute:       %d\n",
-			data->alt_minute);
-		fprintf(stderr,"dbg5       alt second:       %d\n",
-			data->alt_second);
-		fprintf(stderr,"dbg5       course_true:      %f\n",
-			data->course_true);
-		fprintf(stderr,"dbg5       speed_transverse: %f\n",
-			data->speed_transverse);
-		fprintf(stderr,"dbg5       speed:            %f\n",
-			data->speed);
-		fprintf(stderr,"dbg5       speed_reference:  %c\n",
-			data->speed_reference[0]);
-		fprintf(stderr,"dbg5       pitch:            %f\n",
-			data->pitch);
-		fprintf(stderr,"dbg5       track:            %d\n",
-			data->track);
-		fprintf(stderr,"dbg5       depth_center:     %f\n",
-			data->depth_center);
-		fprintf(stderr,"dbg5       depth_scale:      %f\n",
-			data->depth_scale);
-		fprintf(stderr,"dbg5       spare:            %d\n",
-			data->spare);
-		fprintf(stderr,"dbg5       distances and depths:\n");
-		for (i=0;i<MBF_HSATLRAW_BEAMS;i++)
-			fprintf(stderr,"dbg5         %d  %d  %d\n",
-				i,data->distance[i],data->depth[i]);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_hsatlraw_rd_ergnmess(int verbose, FILE *mbfp,
-		struct mbf_hsatlraw_struct *data, int shift, int *error)
-{
-	char	*function_name = "mbr_hsatlraw_rd_ergnmess";
-	int	status = MB_SUCCESS;
-	char	line[MBF_HSATLRAW_MAXLINE];
-	int	numvals;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       data:       %p\n",(void *)data);
-		fprintf(stderr,"dbg2       shift:      %d\n",shift);
-		}
-
-	/* read event record from file */
-	status = mbr_hsatlraw_read_line(verbose,mbfp,shift+9,line,error);
-
-	/* make sure line is long enough */
-	if (status == MB_SUCCESS
-		&& (strlen(line) < 90 + shift
-		|| strlen(line) > 92 + shift))
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_UNINTELLIGIBLE;
-		}
-
-	/* parse data from event record */
-	if (status == MB_SUCCESS)
-		{
-		mb_get_double( &(data->lon),        line+shift,    12);
-		mb_get_double( &(data->lat),        line+12+shift, 12);
-		mb_get_int(    &(data->year),       line+24+shift,  4);
-		mb_get_int(    &(data->month),      line+28+shift,  2);
-		mb_get_int(    &(data->day),        line+30+shift,  2);
-		mb_get_int(    &(data->hour),       line+32+shift,  2);
-		mb_get_int(    &(data->minute),     line+34+shift,  2);
-		mb_get_int(    &(data->second),     line+36+shift,  2);
-		mb_get_int(    &(data->alt_minute), line+38+shift,  5);
-		mb_get_int(    &(data->alt_second), line+43+shift,  2);
-		mb_get_double( &(data->course_true),line+45+shift,  5);
-		mb_get_double( &(data->speed_transverse), line+50+shift, 9);
-		mb_get_double( &(data->speed),      line+59+shift,  9);
-		data->speed_reference[0] = line[68+shift];
-		mb_get_double( &(data->pitch),      line+69+shift,  4);
-		mb_get_int(    &(data->track),      line+73+shift,  4);
-		mb_get_double( &(data->depth_center),line+77+shift, 7);
-		mb_get_double( &(data->depth_scale),line+84+shift,  4);
-		mb_get_int( &(data->spare),line+88+shift,  2);
-		if (data->depth_scale > 0.0)
-			data->depth[29] =
-				(int) (data->depth_center/data->depth_scale);
-		else
-			data->depth[29] = (int) data->depth_center;
-		data->distance[29] = 0;
-		}
-
-	/* read and parse data from first data record */
-	if (status == MB_SUCCESS
-		&& (status = mbr_hsatlraw_read_line(verbose,mbfp,
-				shift+9,line,error)) == MB_SUCCESS)
-		{
-		mb_get_int(&numvals,line+shift,2);
-		if (numvals == 29)
-			for (i=0;i<numvals;i++)
-				mb_get_int(&(data->distance[i+30]),
-					line+i*4+2+shift,4);
-		else
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_UNINTELLIGIBLE;
-			}
-		}
-
-	/* read and parse data from second data record */
-	if (status == MB_SUCCESS
-		&& (status = mbr_hsatlraw_read_line(verbose,mbfp,
-				shift+9,line,error)) == MB_SUCCESS)
-		{
-		mb_get_int(&numvals,line+shift,2);
-		if (numvals == 29)
-			for (i=0;i<numvals;i++)
-				{
-				mb_get_int(&(data->depth[i+30]),
-					line+i*4+2+shift,4);
-				}
-		else
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_UNINTELLIGIBLE;
-			}
-		}
-
-	/* read and parse data from third data record */
-	if (status == MB_SUCCESS
-		&& (status = mbr_hsatlraw_read_line(verbose,mbfp,
-				shift+9,line,error)) == MB_SUCCESS)
-		{
-		mb_get_int(&numvals,line+shift,2);
-		if (numvals == 29)
-			for (i=0;i<numvals;i++)
-				{
-				mb_get_int(&(data->distance[28-i]),
-					line+i*4+2+shift,4);
-				data->distance[28-i] =
-					-data->distance[28-i];
-				}
-		else
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_UNINTELLIGIBLE;
-			}
-		}
-
-	/* read and parse data from fourth data record */
-	if (status == MB_SUCCESS
-		&& (status = mbr_hsatlraw_read_line(verbose,mbfp,
-				shift+9,line,error)) == MB_SUCCESS)
-		{
-		mb_get_int(&numvals,line+shift,2);
-		if (numvals == 29)
-			for (i=0;i<numvals;i++)
-				{
-				mb_get_int(&(data->depth[28-i]),
-					line+i*4+2+shift,4);
-				}
-		else
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_UNINTELLIGIBLE;
-			}
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       longitude:        %f\n",data->lon);
-		fprintf(stderr,"dbg5       latitude:         %f\n",data->lat);
-		fprintf(stderr,"dbg5       year:             %d\n",data->year);
-		fprintf(stderr,"dbg5       month:            %d\n",data->month);
-		fprintf(stderr,"dbg5       day:              %d\n",data->day);
-		fprintf(stderr,"dbg5       hour:             %d\n",data->hour);
-		fprintf(stderr,"dbg5       minute:           %d\n",
-			data->minute);
-		fprintf(stderr,"dbg5       second:           %d\n",
-			data->second);
-		fprintf(stderr,"dbg5       alt minute:       %d\n",
-			data->alt_minute);
-		fprintf(stderr,"dbg5       alt second:       %d\n",
-			data->alt_second);
-		fprintf(stderr,"dbg5       course_true:      %f\n",
-			data->course_true);
-		fprintf(stderr,"dbg5       speed_transverse: %f\n",
-			data->speed_transverse);
-		fprintf(stderr,"dbg5       speed:            %f\n",
-			data->speed);
-		fprintf(stderr,"dbg5       speed_reference:  %c\n",
-			data->speed_reference[0]);
-		fprintf(stderr,"dbg5       pitch:            %f\n",
-			data->pitch);
-		fprintf(stderr,"dbg5       track:            %d\n",
-			data->track);
-		fprintf(stderr,"dbg5       depth_center:     %f\n",
-			data->depth_center);
-		fprintf(stderr,"dbg5       depth_scale:      %f\n",
-			data->depth_scale);
-		fprintf(stderr,"dbg5       spare:            %d\n",
-			data->spare);
-		fprintf(stderr,"dbg5       distances and depths:\n");
-		for (i=0;i<MBF_HSATLRAW_BEAMS;i++)
-			fprintf(stderr,"dbg5         %d  %d  %d\n",
-				i,data->distance[i],data->depth[i]);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_hsatlraw_rd_ergnslzt(int verbose, FILE *mbfp,
-		struct mbf_hsatlraw_struct *data, int shift, int *error)
-{
-	char	*function_name = "mbr_hsatlraw_rd_ergnslzt";
-	int	status = MB_SUCCESS;
-	char	line[MBF_HSATLRAW_MAXLINE];
-	int	i;
-	int	numvals;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       data:       %p\n",(void *)data);
-		fprintf(stderr,"dbg2       shift:      %d\n",shift);
-		}
-
-	/* read event record from file */
-	status = mbr_hsatlraw_read_line(verbose,mbfp,shift+9,line,error);
-
-	/* make sure line is long enough */
-	if (strlen(line) < 84 + shift)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_UNINTELLIGIBLE;
-		}
-
-	/* parse data from event record */
-	if (status == MB_SUCCESS)
-		{
-		mb_get_double( &(data->lon),        line+shift,    12);
-		mb_get_double( &(data->lat),        line+12+shift, 12);
-		mb_get_int(    &(data->year),       line+24+shift,  4);
-		mb_get_int(    &(data->month),      line+28+shift,  2);
-		mb_get_int(    &(data->day),        line+30+shift,  2);
-		mb_get_int(    &(data->hour),       line+32+shift,  2);
-		mb_get_int(    &(data->minute),     line+34+shift,  2);
-		mb_get_int(    &(data->second),     line+36+shift,  2);
-		mb_get_double( &(data->course_true),line+38+shift,  5);
-		mb_get_double( &(data->course_ground),line+43+shift,5);
-		mb_get_double( &(data->speed_ground),line+48+shift, 9);
-		mb_get_double( &(data->heave),      line+57+shift,  6);
-		mb_get_double( &(data->pitch),      line+63+shift,  4);
-		mb_get_double( &(data->roll),       line+67+shift,  5);
-		mb_get_double( &(data->time_center),line+72+shift,  6);
-		mb_get_double( &(data->time_scale), line+78+shift,  6);
-		data->time[29] = (int) (0.0001*(data->time_center)
-					/(data->time_scale));
-		}
-
-	/* read and parse data from first data record */
-	if ((status = mbr_hsatlraw_read_line(verbose,mbfp,shift+9,line,error))
-		== MB_SUCCESS)
-		{
-		mb_get_int(&numvals,line+shift,2);
-		if (numvals == 29)
-		for (i=0;i<numvals;i++)
-			mb_get_int(&(data->time[i+30]),line+i*4+2+shift,4);
-		else
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_UNINTELLIGIBLE;
-			}
-		}
-
-	/* read and parse data from second data record */
-	if ((status = mbr_hsatlraw_read_line(verbose,mbfp,shift+9,line,error))
-		== MB_SUCCESS)
-		{
-		mb_get_int(&numvals,line+shift,2);
-		if (numvals == 29)
-		for (i=0;i<numvals;i++)
-			mb_get_int(&(data->time[28-i]),line+i*4+2+shift,4);
-		else
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_UNINTELLIGIBLE;
-			}
-		}
-
-	/* read and parse data from third data record */
-	if ((status = mbr_hsatlraw_read_line(verbose,mbfp,shift+9,line,error))
-		== MB_SUCCESS)
-		{
-		for (i=0;i<11;i++)
-			mb_get_double(&(data->gyro[i]),line+i*5+shift,5);
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       longitude:        %f\n",data->lon);
-		fprintf(stderr,"dbg5       latitude:         %f\n",data->lat);
-		fprintf(stderr,"dbg5       year:             %d\n",data->year);
-		fprintf(stderr,"dbg5       month:            %d\n",data->month);
-		fprintf(stderr,"dbg5       day:              %d\n",data->day);
-		fprintf(stderr,"dbg5       hour:             %d\n",data->hour);
-		fprintf(stderr,"dbg5       minute:           %d\n",
-			data->minute);
-		fprintf(stderr,"dbg5       second:           %d\n",
-			data->second);
-		fprintf(stderr,"dbg5       course_true:      %f\n",
-			data->course_true);
-		fprintf(stderr,"dbg5       course_ground:    %f\n",
-			data->course_ground);
-		fprintf(stderr,"dbg5       speed_ground:     %f\n",
-			data->speed_ground);
-		fprintf(stderr,"dbg5       heave:            %f\n",
-			data->heave);
-		fprintf(stderr,"dbg5       pitch:            %f\n",
-			data->pitch);
-		fprintf(stderr,"dbg5       roll:             %f\n",
-			data->roll);
-		fprintf(stderr,"dbg5       time_center:      %f\n",
-			data->depth_center);
-		fprintf(stderr,"dbg5       time_scale:       %f\n",
-			data->time_scale);
-		fprintf(stderr,"dbg5       travel times:\n");
-		for (i=0;i<MBF_HSATLRAW_BEAMS;i++)
-			fprintf(stderr,"dbg5         %d  %d\n",
-				i,data->time[i]);
-		fprintf(stderr,"dbg5       gyro headings:\n");
-		for (i=0;i<11;i++)
-			fprintf(stderr,"dbg5         %d  %f\n",
-				i,data->gyro[i]);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_hsatlraw_rd_ergnctds(int verbose, FILE *mbfp,
-		struct mbf_hsatlraw_struct *data, int shift, int *error)
-{
-	char	*function_name = "mbr_hsatlraw_rd_ergnctds";
-	int	status = MB_SUCCESS;
-	char	line[MBF_HSATLRAW_MAXLINE];
-	int	i, j, k;
-	int	nlines;
-	int	numvals;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       data:       %p\n",(void *)data);
-		fprintf(stderr,"dbg2       shift:      %d\n",shift);
-		}
-
-	/* read event record from file */
-	status = mbr_hsatlraw_read_line(verbose,mbfp,shift+9,line,error);
-
-	/* make sure line is long enough */
-	if (strlen(line) < 40 + shift)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_UNINTELLIGIBLE;
-		}
-
-	/* parse data from event record */
-	if (status == MB_SUCCESS)
-		{
-		mb_get_double( &(data->lon),        line+shift,    12);
-		mb_get_double( &(data->lat),        line+12+shift, 12);
-		mb_get_int(    &(data->year),       line+24+shift,  4);
-		mb_get_int(    &(data->month),      line+28+shift,  2);
-		mb_get_int(    &(data->day),        line+30+shift,  2);
-		mb_get_int(    &(data->hour),       line+32+shift,  2);
-		mb_get_int(    &(data->minute),     line+34+shift,  2);
-		mb_get_int(    &(data->second),     line+36+shift,  2);
-		mb_get_int(    &(data->num_vel),    line+38+shift,  2);
-		}
-
-	nlines = 0;
-	if (status == MB_SUCCESS)
-		{
-		/* figure out how many lines to read */
-		if (data->num_vel > MBF_HSATLRAW_MAXVEL)
-			data->num_vel = MBF_HSATLRAW_MAXVEL;
-		nlines = data->num_vel/10;
-		if (data->num_vel%10 > 0) nlines++;
-		}
-
-	/* read and parse data records from file */
-	for (i=0;i<nlines;i++)
-		{
-		if ((status = mbr_hsatlraw_read_line(verbose,mbfp,shift+9,line,error))
-			== MB_SUCCESS)
-			{
-			numvals = 10;
-			if (i == nlines - 1) numvals = data->num_vel%10;
-			for (j=0;j<numvals;j++)
-				{
-				k = j + i*10;
-				mb_get_double(&(data->vdepth[k]),
-					line+j*11+shift,5);
-				mb_get_double(&(data->velocity[k]),
-					line+j*11+5+shift,6);
-				}
-			}
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       longitude:        %f\n",data->lon);
-		fprintf(stderr,"dbg5       latitude:         %f\n",data->lat);
-		fprintf(stderr,"dbg5       year:             %d\n",data->year);
-		fprintf(stderr,"dbg5       month:            %d\n",data->month);
-		fprintf(stderr,"dbg5       day:              %d\n",data->day);
-		fprintf(stderr,"dbg5       hour:             %d\n",data->hour);
-		fprintf(stderr,"dbg5       minute:           %d\n",
-			data->minute);
-		fprintf(stderr,"dbg5       second:           %d\n",
-			data->second);
-		fprintf(stderr,"dbg5       num_vel:          %d\n",
-			data->num_vel);
-		fprintf(stderr,"dbg5       water depths and velocities:\n");
-		for (i=0;i<11;i++)
-			fprintf(stderr,"dbg5         %d  %f  %f\n",
-				i,data->vdepth[i],data->velocity[i]);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_hsatlraw_rd_ergnampl(int verbose, FILE *mbfp,
-		struct mbf_hsatlraw_struct *data, int shift, int *error)
-{
-	char	*function_name = "mbr_hsatlraw_rd_ergnampl";
-	int	status = MB_SUCCESS;
-	char	line[MBF_HSATLRAW_MAXLINE];
-	int	i;
-	int	numvals;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       data:       %p\n",(void *)data);
-		fprintf(stderr,"dbg2       shift:      %d\n",shift);
-		}
-
-	/* read event record from file */
-	status = mbr_hsatlraw_read_line(verbose,mbfp,shift+9,line,error);
-
-	/* make sure line is long enough */
-	if (strlen(line) < 90 + shift)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_UNINTELLIGIBLE;
-		}
-
-	/* parse data from event record */
-	if (status == MB_SUCCESS)
-		{
-		mb_get_double( &(data->lon),        line+shift,    12);
-		mb_get_double( &(data->lat),        line+12+shift, 12);
-		mb_get_int(    &(data->year),       line+24+shift,  4);
-		mb_get_int(    &(data->month),      line+28+shift,  2);
-		mb_get_int(    &(data->day),        line+30+shift,  2);
-		mb_get_int(    &(data->hour),       line+32+shift,  2);
-		mb_get_int(    &(data->minute),     line+34+shift,  2);
-		mb_get_int(    &(data->second),     line+36+shift,  2);
-		data->mode[0] = line[38+shift];
-		mb_get_int(    &(data->trans_strbd),line+39+shift,  3);
-		mb_get_int(    &(data->trans_vert), line+42+shift,  3);
-		mb_get_int(    &(data->trans_port), line+45+shift,  3);
-		mb_get_int(    &(data->pulse_len_strbd),line+48+shift,2);
-		mb_get_int(    &(data->pulse_len_vert),line+50+shift,2);
-		mb_get_int(    &(data->pulse_len_port),line+52+shift,2);
-		mb_get_int(    &(data->gain_start), line+54+shift,  2);
-		mb_get_int(    &(data->r_compensation_factor),line+56+shift,2);
-		mb_get_int(    &(data->compensation_start),line+58+shift,4);
-		mb_get_int(    &(data->increase_start),line+62+shift,5);
-		mb_get_int(    &(data->tvc_near),   line+67+shift,  2);
-		mb_get_int(    &(data->tvc_far),    line+69+shift,  2);
-		mb_get_int(    &(data->increase_int_near),line+71+shift,3);
-		mb_get_int(    &(data->increase_int_far),line+74+shift,3);
-		mb_get_int(    &(data->gain_center),line+77+shift,  1);
-		mb_get_double( &(data->filter_gain),line+78+shift,  5);
-		mb_get_int(    &(data->amplitude_center),line+83+shift,3);
-		mb_get_int(    &(data->echo_duration_center),line+86+shift,3);
-		mb_get_int(    &(data->echo_scale_center),line+89+shift,1);
-		data->amplitude[29] = data->amplitude_center;
-		data->echo_duration[29] = (int) data->echo_duration_center;
-		}
-
-	/* read and parse data from first data record */
-	if ((status = mbr_hsatlraw_read_line(verbose,mbfp,shift+9,line,error))
-		== MB_SUCCESS)
-		{
-		for (i=0;i<8;i++)
-			mb_get_int(&(data->gain[i+8]),line+i+shift,1);
-		mb_get_int(&numvals,line+8+shift,2);
-		if (numvals == 29)
-		for (i=0;i<numvals;i++)
-			mb_get_int(&(data->amplitude[i+30]),
-				line+i*3+10+shift,3);
-		else
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_UNINTELLIGIBLE;
-			}
-		}
-
-	/* read and parse data from second data record */
-	if ((status = mbr_hsatlraw_read_line(verbose,mbfp,shift+9,line,error))
-		== MB_SUCCESS)
-		{
-		for (i=0;i<8;i++)
-			mb_get_int(&(data->gain[i]),line+i+shift,1);
-		mb_get_int(&numvals,line+8+shift,2);
-		if (numvals == 29)
-		for (i=0;i<numvals;i++)
-			mb_get_int(&(data->amplitude[28-i]),
-				line+i*3+10+shift,3);
-		else
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_UNINTELLIGIBLE;
-			}
-		}
-
-	/* read and parse data from third data record */
-	if ((status = mbr_hsatlraw_read_line(verbose,mbfp,shift+9,line,error))
-		== MB_SUCCESS)
-		{
-		for (i=0;i<8;i++)
-			mb_get_int(&(data->echo_scale[i+8]),line+1+shift,1);
-		mb_get_int(&numvals,line+8+shift,2);
-		if (numvals == 29)
-		for (i=0;i<numvals;i++)
-			mb_get_int(&(data->echo_duration[i+30]),
-				line+i*3+10+shift,3);
-		else
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_UNINTELLIGIBLE;
-			}
-		}
-
-	/* read and parse data from fourth data record */
-	if ((status = mbr_hsatlraw_read_line(verbose,mbfp,shift+9,line,error))
-		== MB_SUCCESS)
-		{
-		for (i=0;i<8;i++)
-			mb_get_int(&(data->echo_scale[i]),line+1+shift,1);
-		mb_get_int(&numvals,line+8+shift,2);
-		if (numvals == 29)
-		for (i=0;i<numvals;i++)
-			mb_get_int(&(data->echo_duration[28-i]),
-				line+i*3+10+shift,3);
-		else
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_UNINTELLIGIBLE;
-			}
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       longitude:        %f\n",data->lon);
-		fprintf(stderr,"dbg5       latitude:         %f\n",data->lat);
-		fprintf(stderr,"dbg5       year:             %d\n",data->year);
-		fprintf(stderr,"dbg5       month:            %d\n",data->month);
-		fprintf(stderr,"dbg5       day:              %d\n",data->day);
-		fprintf(stderr,"dbg5       hour:             %d\n",data->hour);
-		fprintf(stderr,"dbg5       minute:           %d\n",
-			data->minute);
-		fprintf(stderr,"dbg5       second:           %d\n",
-			data->second);
-		fprintf(stderr,"dbg5       mode:             %c\n",
-			data->mode[0]);
-		fprintf(stderr,"dbg5       trans_strbd:      %d\n",
-			data->trans_strbd);
-		fprintf(stderr,"dbg5       trans_vert:       %d\n",
-			data->trans_vert);
-		fprintf(stderr,"dbg5       trans_port:       %d\n",
-			data->trans_port);
-		fprintf(stderr,"dbg5       pulse_len_strbd:  %d\n",
-			data->pulse_len_strbd);
-		fprintf(stderr,"dbg5       pulse_len_vert:   %d\n",
-			data->pulse_len_vert);
-		fprintf(stderr,"dbg5       pulse_len_port:   %d\n",
-			data->pulse_len_port);
-		fprintf(stderr,"dbg5       gain_start:       %d\n",
-			data->gain_start);
-		fprintf(stderr,"dbg5       r_comp_factor:    %d\n",
-			data->r_compensation_factor);
-		fprintf(stderr,"dbg5       comp_start:       %d\n",
-			data->compensation_start);
-		fprintf(stderr,"dbg5       increase_start:   %d\n",
-			data->increase_start);
-		fprintf(stderr,"dbg5       tvc_near:         %d\n",
-			data->tvc_near);
-		fprintf(stderr,"dbg5       increase_start:   %d\n",
-			data->increase_start);
-		fprintf(stderr,"dbg5       tvc_far:          %d\n",
-			data->tvc_far);
-		fprintf(stderr,"dbg5       increase_int_near:%d\n",
-			data->increase_int_near);
-		fprintf(stderr,"dbg5       increase_int_far: %d\n",
-			data->increase_int_far);
-		fprintf(stderr,"dbg5       gain_center:      %d\n",
-			data->gain_center);
-		fprintf(stderr,"dbg5       filter_gain:      %f\n",
-			data->filter_gain);
-		fprintf(stderr,"dbg5       amplitude_center: %d\n",
-			data->amplitude_center);
-		fprintf(stderr,"dbg5       echo_dur_center:  %d\n",
-			data->echo_duration_center);
-		fprintf(stderr,"dbg5       echo_scal_center: %d\n",
-			data->echo_scale_center);
-		fprintf(stderr,"dbg5       amplitudes and echo durations:\n");
-		for (i=0;i<MBF_HSATLRAW_BEAMS;i++)
-			fprintf(stderr,"dbg5         %d  %d  %d\n",
-				i,data->amplitude[i],data->echo_duration[i]);
-		fprintf(stderr,"dbg5       gains and echo scales:\n");
-		for (i=0;i<16;i++)
-			fprintf(stderr,"dbg5         %d  %d  %d\n",
-				i,data->gain[i],data->echo_scale[i]);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_hsatlraw_rd_ldeocmnt(int verbose, FILE *mbfp,
-		struct mbf_hsatlraw_struct *data, int shift, int *error)
-{
-	char	*function_name = "mbr_hsatlraw_rd_ldeocmnt";
-	int	status = MB_SUCCESS;
-	char	line[MBF_HSATLRAW_MAXLINE];
-	int	nchars;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       data:       %p\n",(void *)data);
-		fprintf(stderr,"dbg2       shift:      %d\n",shift);
-		}
-
-	/* read comment record from file */
-	status = mbr_hsatlraw_read_line(verbose,mbfp,shift,line,error);
-
-	/* copy comment into data structure */
-	if (status == MB_SUCCESS)
-		{
-		nchars = strlen(line+shift);
-		strncpy(data->comment,line+shift,nchars-1);
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Value read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       comment:          %s\n",
-			data->comment);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_hsatlraw_wr_data(int verbose, void *mbio_ptr, void *data_ptr, int *error)
-{
-	char	*function_name = "mbr_hsatlraw_wr_data";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_hsatlraw_struct *data;
-	FILE	*mbfp;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       data_ptr:   %p\n",(void *)data_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_hsatlraw_struct *) data_ptr;
-	mbfp = mb_io_ptr->mbfp;
-
-	if (data->kind == MB_DATA_RAW_LINE)
-		{
-		status = mbr_hsatlraw_wr_rawline(verbose,mbfp,data,error);
-		}
-	else if (data->kind == MB_DATA_DATA)
-		{
-		status = mbr_hsatlraw_wr_ergnmess(verbose,mbfp,data_ptr,error);
-		status = mbr_hsatlraw_wr_ergnslzt(verbose,mbfp,data_ptr,error);
-		status = mbr_hsatlraw_wr_ergnampl(verbose,mbfp,data_ptr,error);
-		}
-	else if (data->kind == MB_DATA_CALIBRATE)
-		{
-		status = mbr_hsatlraw_wr_ergneich(verbose,mbfp,data_ptr,error);
-		status = mbr_hsatlraw_wr_ergnslzt(verbose,mbfp,data_ptr,error);
-		status = mbr_hsatlraw_wr_ergnampl(verbose,mbfp,data_ptr,error);
-		}
-	else if (data->kind == MB_DATA_MEAN_VELOCITY)
-		{
-		status = mbr_hsatlraw_wr_ergnhydi(verbose,mbfp,data_ptr,error);
-		}
-	else if (data->kind == MB_DATA_VELOCITY_PROFILE)
-		{
-		status = mbr_hsatlraw_wr_ergnctds(verbose,mbfp,data_ptr,error);
-		}
-	else if (data->kind == MB_DATA_STANDBY)
-		{
-		status = mbr_hsatlraw_wr_ergnpara(verbose,mbfp,data_ptr,error);
-		}
-	else if (data->kind == MB_DATA_NAV_SOURCE)
-		{
-		status = mbr_hsatlraw_wr_ergnposi(verbose,mbfp,data_ptr,error);
-		}
-	else if (data->kind == MB_DATA_COMMENT)
-		{
-		status = mbr_hsatlraw_wr_ldeocmnt(verbose,mbfp,data_ptr,error);
-		}
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_BAD_KIND;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Data record kind in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       kind:       %d\n",data->kind);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int	mbr_hsatlraw_wr_label(int verbose, FILE *mbfp, char type, int *error)
-{
-	char	*function_name = "mbr_hsatlraw_wr_label";
-	int	status = MB_SUCCESS;
-	char	line[MBF_HSATLRAW_MAXLINE];
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       type:       %d\n",type);
-		}
-
-	/* write label in file */
-	sprintf(line,"%8s\n",mbf_hsatlraw_labels[(int)type]);
-	status = mbr_hsatlraw_write_line(verbose,mbfp,line,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int	mbr_hsatlraw_write_line(int verbose, FILE *mbfp, char *line, int *error)
-{
-	char	*function_name = "mbr_hsatlraw_write_line";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       line:       %s\n",line);
-		}
-
-	/* write next line in file */
-	if ((status = fputs(line,mbfp)) != EOF)
-		{
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-		}
-	else
-		{
-		*error = MB_ERROR_WRITE_FAIL;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_hsatlraw_wr_rawline(int verbose, FILE *mbfp, void *data_ptr, int *error)
-{
-	char	*function_name = "mbr_hsatlraw_wr_rawline";
-	int	status = MB_SUCCESS;
-	struct mbf_hsatlraw_struct *data;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       data_ptr:   %p\n",(void *)data_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_hsatlraw_struct *) data_ptr;
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       raw line:         %s\n",
-			data->comment);
-		}
-
-	/* write out the data */
-	if (status == MB_SUCCESS)
-		{
-		/* output the line */
-		status = fprintf(mbfp,"%s\n",data->comment);
-		if (status >= 0)
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		else
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_hsatlraw_wr_ergnhydi(int verbose, FILE *mbfp, void *data_ptr, int *error)
-{
-	char	*function_name = "mbr_hsatlraw_wr_ergnhydi";
-	int	status = MB_SUCCESS;
-	struct mbf_hsatlraw_struct *data;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       data_ptr:   %p\n",(void *)data_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_hsatlraw_struct *) data_ptr;
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       longitude:        %f\n",data->lon);
-		fprintf(stderr,"dbg5       latitude:         %f\n",data->lat);
-		fprintf(stderr,"dbg5       year:             %d\n",data->year);
-		fprintf(stderr,"dbg5       month:            %d\n",data->month);
-		fprintf(stderr,"dbg5       day:              %d\n",data->day);
-		fprintf(stderr,"dbg5       hour:             %d\n",data->hour);
-		fprintf(stderr,"dbg5       minute:           %d\n",
-			data->minute);
-		fprintf(stderr,"dbg5       second:           %d\n",
-			data->second);
-		fprintf(stderr,"dbg5       alt minute:       %d\n",
-			data->alt_minute);
-		fprintf(stderr,"dbg5       alt second:       %d\n",
-			data->alt_second);
-		fprintf(stderr,"dbg5       draught:          %f\n",
-			data->draught);
-		fprintf(stderr,"dbg5       mean velocity:    %f\n",
-			data->vel_mean);
-		fprintf(stderr,"dbg5       keel velocity:    %f\n",
-			data->vel_keel);
-		fprintf(stderr,"dbg5       tide:             %f\n",data->tide);
-		}
-
-	/* write the record label */
-	status = mbr_hsatlraw_wr_label(verbose,mbfp,
-		MBF_HSATLRAW_ERGNHYDI,error);
-
-	/* write out the data */
-	if (status == MB_SUCCESS)
-		{
-		/* output the event line */
-		status = fprintf(mbfp,"%+12.7f",data->lon);
-		status = fprintf(mbfp,"%+12.7f",data->lat);
-		status = fprintf(mbfp,"%4.4d",data->year);
-		status = fprintf(mbfp,"%2.2d",data->month);
-		status = fprintf(mbfp,"%2.2d",data->day);
-		status = fprintf(mbfp,"%2.2d",data->hour);
-		status = fprintf(mbfp,"%2.2d",data->minute);
-		status = fprintf(mbfp,"%2.2d",data->second);
-		status = fprintf(mbfp,"%5d",data->alt_minute);
-		status = fprintf(mbfp,"%2d",data->alt_second);
-		status = fprintf(mbfp,"%4.1f",data->draught);
-		status = fprintf(mbfp,"%7.2f",data->vel_mean);
-		status = fprintf(mbfp,"%7.2f",data->vel_keel);
-		status = fprintf(mbfp,"%+06.2f\n",data->tide);
-
-		/* check for an error */
-		if (status > 0)
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		else
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_hsatlraw_wr_ergnpara(int verbose, FILE *mbfp, void *data_ptr, int *error)
-{
-	char	*function_name = "mbr_hsatlraw_wr_ergnpara";
-	int	status = MB_SUCCESS;
-	struct mbf_hsatlraw_struct *data;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       data_ptr:   %p\n",(void *)data_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_hsatlraw_struct *) data_ptr;
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       longitude:        %f\n",data->lon);
-		fprintf(stderr,"dbg5       latitude:         %f\n",data->lat);
-		fprintf(stderr,"dbg5       year:             %d\n",data->year);
-		fprintf(stderr,"dbg5       month:            %d\n",data->month);
-		fprintf(stderr,"dbg5       day:              %d\n",data->day);
-		fprintf(stderr,"dbg5       hour:             %d\n",data->hour);
-		fprintf(stderr,"dbg5       minute:           %d\n",
-			data->minute);
-		fprintf(stderr,"dbg5       second:           %d\n",
-			data->second);
-		fprintf(stderr,"dbg5       alt minute:       %d\n",
-			data->alt_minute);
-		fprintf(stderr,"dbg5       alt second:       %d\n",
-			data->alt_second);
-		fprintf(stderr,"dbg5       course_true:      %f\n",
-			data->course_true);
-		fprintf(stderr,"dbg5       speed_transverse: %f\n",
-			data->speed_transverse);
-		fprintf(stderr,"dbg5       speed:            %f\n",
-			data->speed);
-		fprintf(stderr,"dbg5       speed_reference:  %c\n",
-			data->speed_reference[0]);
-		fprintf(stderr,"dbg5       pitch:            %f\n",
-			data->pitch);
-		fprintf(stderr,"dbg5       track:            %d\n",
-			data->track);
-		fprintf(stderr,"dbg5       depth_center:     %f\n",
-			data->depth_center);
-		}
-
-	/* write the record label */
-	status = mbr_hsatlraw_wr_label(verbose,mbfp,
-		MBF_HSATLRAW_ERGNPARA,error);
-
-	/* write out the data */
-	if (status == MB_SUCCESS)
-		{
-		/* output the event line */
-		status = fprintf(mbfp,"%+12.7f",data->lon);
-		status = fprintf(mbfp,"%+12.7f",data->lat);
-		status = fprintf(mbfp,"%4.4d",data->year);
-		status = fprintf(mbfp,"%2.2d",data->month);
-		status = fprintf(mbfp,"%2.2d",data->day);
-		status = fprintf(mbfp,"%2.2d",data->hour);
-		status = fprintf(mbfp,"%2.2d",data->minute);
-		status = fprintf(mbfp,"%2.2d",data->second);
-		status = fprintf(mbfp,"%5d",data->alt_minute);
-		status = fprintf(mbfp,"%2d",data->alt_second);
-		status = fprintf(mbfp,"%5.1f",data->course_true);
-		status = fprintf(mbfp,"%+9.1f",data->speed_transverse);
-		status = fprintf(mbfp,"%+9.1f",data->speed);
-		status = fprintf(mbfp,"%c",data->speed_reference[0]);
-		status = fprintf(mbfp,"%+4.1f",data->pitch);
-		status = fprintf(mbfp,"%4.4d",data->track);
-		status = fprintf(mbfp,"%7.1f\n",data->depth_center);
-
-		/* check for an error */
-		if (status > 0)
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		else
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_hsatlraw_wr_ergnposi(int verbose, FILE *mbfp, void *data_ptr, int *error)
-{
-	char	*function_name = "mbr_hsatlraw_wr_ergnposi";
-	int	status = MB_SUCCESS;
-	struct mbf_hsatlraw_struct *data;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       data_ptr:   %p\n",(void *)data_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_hsatlraw_struct *) data_ptr;
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       longitude:        %f\n",data->lon);
-		fprintf(stderr,"dbg5       latitude:         %f\n",data->lat);
-		fprintf(stderr,"dbg5       year:             %d\n",data->year);
-		fprintf(stderr,"dbg5       month:            %d\n",data->month);
-		fprintf(stderr,"dbg5       day:              %d\n",data->day);
-		fprintf(stderr,"dbg5       hour:             %d\n",data->hour);
-		fprintf(stderr,"dbg5       minute:           %d\n",
-			data->minute);
-		fprintf(stderr,"dbg5       second:           %d\n",
-			data->second);
-		fprintf(stderr,"dbg5       alt minute:       %d\n",
-			data->alt_minute);
-		fprintf(stderr,"dbg5       alt second:       %d\n",
-			data->alt_second);
-		fprintf(stderr,"dbg5       pos_corr_x:       %f\n",
-			data->pos_corr_x);
-		fprintf(stderr,"dbg5       pos_corr_y:       %f\n",
-			data->pos_corr_y);
-		fprintf(stderr,"dbg5       sensors:          %s\n",
-			data->sensors);
-		}
-
-	/* write the record label */
-	status = mbr_hsatlraw_wr_label(verbose,mbfp,
-		MBF_HSATLRAW_ERGNPOSI,error);
-
-	/* write out the data */
-	if (status == MB_SUCCESS)
-		{
-		/* output the event line */
-		status = fprintf(mbfp,"%+12.7f",data->lon);
-		status = fprintf(mbfp,"%+12.7f",data->lat);
-		status = fprintf(mbfp,"%4.4d",data->year);
-		status = fprintf(mbfp,"%2.2d",data->month);
-		status = fprintf(mbfp,"%2.2d",data->day);
-		status = fprintf(mbfp,"%2.2d",data->hour);
-		status = fprintf(mbfp,"%2.2d",data->minute);
-		status = fprintf(mbfp,"%2.2d",data->second);
-		status = fprintf(mbfp,"%5d",data->alt_minute);
-		status = fprintf(mbfp,"%2d",data->alt_second);
-		status = fprintf(mbfp,"%7.0f",data->pos_corr_x);
-		status = fprintf(mbfp,"%7.0f",data->pos_corr_y);
-		status = fprintf(mbfp,"%8s\n",data->sensors);
-
-		/* check for an error */
-		if (status > 0)
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		else
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_hsatlraw_wr_ergneich(int verbose, FILE *mbfp, void *data_ptr, int *error)
-{
-	char	*function_name = "mbr_hsatlraw_wr_ergneich";
-	int	status = MB_SUCCESS;
-	struct mbf_hsatlraw_struct *data;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       data_ptr:   %p\n",(void *)data_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_hsatlraw_struct *) data_ptr;
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       longitude:        %f\n",data->lon);
-		fprintf(stderr,"dbg5       latitude:         %f\n",data->lat);
-		fprintf(stderr,"dbg5       year:             %d\n",data->year);
-		fprintf(stderr,"dbg5       month:            %d\n",data->month);
-		fprintf(stderr,"dbg5       day:              %d\n",data->day);
-		fprintf(stderr,"dbg5       hour:             %d\n",data->hour);
-		fprintf(stderr,"dbg5       minute:           %d\n",
-			data->minute);
-		fprintf(stderr,"dbg5       second:           %d\n",
-			data->second);
-		fprintf(stderr,"dbg5       alt minute:       %d\n",
-			data->alt_minute);
-		fprintf(stderr,"dbg5       alt second:       %d\n",
-			data->alt_second);
-		fprintf(stderr,"dbg5       course_true:      %f\n",
-			data->course_true);
-		fprintf(stderr,"dbg5       speed_transverse: %f\n",
-			data->speed_transverse);
-		fprintf(stderr,"dbg5       speed:            %f\n",
-			data->speed);
-		fprintf(stderr,"dbg5       speed_reference:  %c\n",
-			data->speed_reference[0]);
-		fprintf(stderr,"dbg5       pitch:            %f\n",
-			data->pitch);
-		fprintf(stderr,"dbg5       track:            %d\n",
-			data->track);
-		fprintf(stderr,"dbg5       depth_center:     %f\n",
-			data->depth_center);
-		fprintf(stderr,"dbg5       depth_scale:      %f\n",
-			data->depth_scale);
-		fprintf(stderr,"dbg5       spare:            %d\n",
-			data->spare);
-		fprintf(stderr,"dbg5       distances and depths:\n");
-		for (i=0;i<MBF_HSATLRAW_BEAMS;i++)
-			fprintf(stderr,"dbg5         %d  %d  %d\n",
-				i,data->distance[i],data->depth[i]);
-		}
-
-	/* write the record label */
-	status = mbr_hsatlraw_wr_label(verbose,mbfp,
-		MBF_HSATLRAW_ERGNEICH,error);
-
-	/* write out the data */
-	if (status == MB_SUCCESS)
-		{
-		/* output the event line */
-		status = fprintf(mbfp,"%+12.7f",data->lon);
-		status = fprintf(mbfp,"%+12.7f",data->lat);
-		status = fprintf(mbfp,"%4.4d",data->year);
-		status = fprintf(mbfp,"%2.2d",data->month);
-		status = fprintf(mbfp,"%2.2d",data->day);
-		status = fprintf(mbfp,"%2.2d",data->hour);
-		status = fprintf(mbfp,"%2.2d",data->minute);
-		status = fprintf(mbfp,"%2.2d",data->second);
-		status = fprintf(mbfp,"%5d",data->alt_minute);
-		status = fprintf(mbfp,"%2d",data->alt_second);
-		status = fprintf(mbfp,"%5.1f",data->course_true);
-		status = fprintf(mbfp,"%+9.1f",data->speed_transverse);
-		status = fprintf(mbfp,"%+9.1f",data->speed);
-		status = fprintf(mbfp,"%c",data->speed_reference[0]);
-		status = fprintf(mbfp,"%+4.1f",data->pitch);
-		status = fprintf(mbfp,"%4.4d",data->track);
-		status = fprintf(mbfp,"%7.1f",data->depth_center);
-		status = fprintf(mbfp,"%4.2f",data->depth_scale);
-		status = fprintf(mbfp,"%2d\n",data->spare);
-
-		/* output forward distances */
-		status = fprintf(mbfp,"29");
-		for (i=0;i<29;i++)
-			status = fprintf(mbfp,"%4.4d",data->distance[i+30]);
-		status = fprintf(mbfp,"\n");
-
-		/* output forward depths */
-		status = fprintf(mbfp,"29");
-		for (i=0;i<29;i++)
-			status = fprintf(mbfp,"%4.4d",data->depth[i+30]);
-		status = fprintf(mbfp,"\n");
-
-		/* output aft distances */
-		status = fprintf(mbfp,"29");
-		for (i=0;i<29;i++)
-			status = fprintf(mbfp,"%4.4d",(-data->distance[28-i]));
-		status = fprintf(mbfp,"\n");
-
-		/* output aft depths */
-		status = fprintf(mbfp,"29");
-		for (i=0;i<29;i++)
-			status = fprintf(mbfp,"%4.4d",data->depth[28-i]);
-		status = fprintf(mbfp,"\n");
-
-		/* check for an error */
-		if (status > 0)
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		else
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_hsatlraw_wr_ergnmess(int verbose, FILE *mbfp, void *data_ptr, int *error)
-{
-	char	*function_name = "mbr_hsatlraw_wr_ergnmess";
-	int	status = MB_SUCCESS;
-	struct mbf_hsatlraw_struct *data;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       data_ptr:   %p\n",(void *)data_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_hsatlraw_struct *) data_ptr;
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       longitude:        %f\n",data->lon);
-		fprintf(stderr,"dbg5       latitude:         %f\n",data->lat);
-		fprintf(stderr,"dbg5       year:             %d\n",data->year);
-		fprintf(stderr,"dbg5       month:            %d\n",data->month);
-		fprintf(stderr,"dbg5       day:              %d\n",data->day);
-		fprintf(stderr,"dbg5       hour:             %d\n",data->hour);
-		fprintf(stderr,"dbg5       minute:           %d\n",
-			data->minute);
-		fprintf(stderr,"dbg5       second:           %d\n",
-			data->second);
-		fprintf(stderr,"dbg5       alt minute:       %d\n",
-			data->alt_minute);
-		fprintf(stderr,"dbg5       alt second:       %d\n",
-			data->alt_second);
-		fprintf(stderr,"dbg5       course_true:      %f\n",
-			data->course_true);
-		fprintf(stderr,"dbg5       speed_transverse: %f\n",
-			data->speed_transverse);
-		fprintf(stderr,"dbg5       speed:            %f\n",
-			data->speed);
-		fprintf(stderr,"dbg5       speed_reference:  %c\n",
-			data->speed_reference[0]);
-		fprintf(stderr,"dbg5       pitch:            %f\n",
-			data->pitch);
-		fprintf(stderr,"dbg5       track:            %d\n",
-			data->track);
-		fprintf(stderr,"dbg5       depth_center:     %f\n",
-			data->depth_center);
-		fprintf(stderr,"dbg5       depth_scale:      %f\n",
-			data->depth_scale);
-		fprintf(stderr,"dbg5       spare:            %d\n",
-			data->spare);
-		fprintf(stderr,"dbg5       distances and depths:\n");
-		for (i=0;i<MBF_HSATLRAW_BEAMS;i++)
-			fprintf(stderr,"dbg5         %d  %d  %d\n",
-				i,data->distance[i],data->depth[i]);
-		}
-
-	/* write the record label */
-	status = mbr_hsatlraw_wr_label(verbose,mbfp,
-		MBF_HSATLRAW_ERGNMESS,error);
-
-	/* write out the data */
-	if (status == MB_SUCCESS)
-		{
-		/* output the event line */
-		status = fprintf(mbfp,"%+12.7f",data->lon);
-		status = fprintf(mbfp,"%+12.7f",data->lat);
-		status = fprintf(mbfp,"%4.4d",data->year);
-		status = fprintf(mbfp,"%2.2d",data->month);
-		status = fprintf(mbfp,"%2.2d",data->day);
-		status = fprintf(mbfp,"%2.2d",data->hour);
-		status = fprintf(mbfp,"%2.2d",data->minute);
-		status = fprintf(mbfp,"%2.2d",data->second);
-		status = fprintf(mbfp,"%5d",data->alt_minute);
-		status = fprintf(mbfp,"%2d",data->alt_second);
-		status = fprintf(mbfp,"%5.1f",data->course_true);
-		status = fprintf(mbfp,"%+9.1f",data->speed_transverse);
-		status = fprintf(mbfp,"%+9.1f",data->speed);
-		status = fprintf(mbfp,"%c",data->speed_reference[0]);
-		status = fprintf(mbfp,"%+4.1f",data->pitch);
-		status = fprintf(mbfp,"%4.4d",data->track);
-		status = fprintf(mbfp,"%7.1f",data->depth_center);
-		status = fprintf(mbfp,"%4.2f",data->depth_scale);
-		status = fprintf(mbfp,"%2d\n",data->spare);
-
-		/* output starboard crosstrack distances */
-		status = fprintf(mbfp,"29");
-		for (i=0;i<29;i++)
-			status = fprintf(mbfp,"%4.4d",data->distance[i+30]);
-		status = fprintf(mbfp,"\n");
-
-		/* output starboard crosstrack depths */
-		status = fprintf(mbfp,"29");
-		for (i=0;i<29;i++)
-			status = fprintf(mbfp,"%4.4d",data->depth[i+30]);
-		status = fprintf(mbfp,"\n");
-
-		/* output port crosstrack distances */
-		status = fprintf(mbfp,"29");
-		for (i=0;i<29;i++)
-			status = fprintf(mbfp,"%4.4d",(-data->distance[28-i]));
-		status = fprintf(mbfp,"\n");
-
-		/* output port crosstrack depths */
-		status = fprintf(mbfp,"29");
-		for (i=0;i<29;i++)
-			status = fprintf(mbfp,"%4.4d",data->depth[28-i]);
-		status = fprintf(mbfp,"\n");
-
-		/* check for an error */
-		if (status > 0)
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		else
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_hsatlraw_wr_ergnslzt(int verbose, FILE *mbfp, void *data_ptr, int *error)
-{
-	char	*function_name = "mbr_hsatlraw_wr_ergnslzt";
-	int	status = MB_SUCCESS;
-	struct mbf_hsatlraw_struct *data;
-	int	datacheck;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       data_ptr:   %p\n",(void *)data_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_hsatlraw_struct *) data_ptr;
-
-	/* check if there are data to output */
-	datacheck = MB_NO;
-	for (i=0;i<MBF_HSATLRAW_BEAMS;i++)
-		if (data->time[i] > 0)
-			datacheck = MB_YES;
-
-	/* print debug statements */
-	if (verbose >= 5 && datacheck == MB_NO)
-		{
-		fprintf(stderr,"\ndbg5  No values to be written in MBIO function <%s>\n",function_name);
-		}
-
-	/* print debug statements */
-	if (verbose >= 5 && datacheck == MB_YES)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       longitude:        %f\n",data->lon);
-		fprintf(stderr,"dbg5       latitude:         %f\n",data->lat);
-		fprintf(stderr,"dbg5       year:             %d\n",data->year);
-		fprintf(stderr,"dbg5       month:            %d\n",data->month);
-		fprintf(stderr,"dbg5       day:              %d\n",data->day);
-		fprintf(stderr,"dbg5       hour:             %d\n",data->hour);
-		fprintf(stderr,"dbg5       minute:           %d\n",
-			data->minute);
-		fprintf(stderr,"dbg5       second:           %d\n",
-			data->second);
-		fprintf(stderr,"dbg5       course_true:      %f\n",
-			data->course_true);
-		fprintf(stderr,"dbg5       course_ground:    %f\n",
-			data->course_ground);
-		fprintf(stderr,"dbg5       speed_ground:     %f\n",
-			data->speed_ground);
-		fprintf(stderr,"dbg5       heave:            %f\n",
-			data->heave);
-		fprintf(stderr,"dbg5       pitch:            %f\n",
-			data->pitch);
-		fprintf(stderr,"dbg5       roll:             %f\n",
-			data->roll);
-		fprintf(stderr,"dbg5       time_center:      %f\n",
-			data->depth_center);
-		fprintf(stderr,"dbg5       time_scale:       %f\n",
-			data->time_scale);
-		fprintf(stderr,"dbg5       travel times:\n");
-		for (i=0;i<MBF_HSATLRAW_BEAMS;i++)
-			fprintf(stderr,"dbg5         %d  %d\n",
-				i,data->time[i]);
-		fprintf(stderr,"dbg5       gyro headings:\n");
-		for (i=0;i<11;i++)
-			fprintf(stderr,"dbg5         %d  %f\n",
-				i,data->gyro[i]);
-		}
-
-	/* write the record label */
-	if (datacheck == MB_YES)
-		status = mbr_hsatlraw_wr_label(verbose,mbfp,
-			MBF_HSATLRAW_ERGNSLZT,error);
-
-	/* write out the data */
-	if (status == MB_SUCCESS && datacheck == MB_YES)
-		{
-		/* output the event line */
-		status = fprintf(mbfp,"%+12.7f",data->lon);
-		status = fprintf(mbfp,"%+12.7f",data->lat);
-		status = fprintf(mbfp,"%4.4d",data->year);
-		status = fprintf(mbfp,"%2.2d",data->month);
-		status = fprintf(mbfp,"%2.2d",data->day);
-		status = fprintf(mbfp,"%2.2d",data->hour);
-		status = fprintf(mbfp,"%2.2d",data->minute);
-		status = fprintf(mbfp,"%2.2d",data->second);
-		status = fprintf(mbfp,"%5.1f",data->course_true);
-		status = fprintf(mbfp,"%5.1f",data->course_ground);
-		status = fprintf(mbfp,"%+9.1f",data->speed_ground);
-		status = fprintf(mbfp,"%+6.2f",data->heave);
-		status = fprintf(mbfp,"%+4.1f",data->pitch);
-		status = fprintf(mbfp,"%+5.1f",data->roll);
-		status = fprintf(mbfp,"%06.0f",data->time_center);
-		status = fprintf(mbfp,"%6.4f\n",data->time_scale);
-
-		/* output starboard crosstrack travel times */
-		status = fprintf(mbfp,"29");
-		for (i=0;i<29;i++)
-			status = fprintf(mbfp,"%4.4d",data->time[i+30]);
-		status = fprintf(mbfp,"\n");
-
-		/* output port crosstrack travel times */
-		status = fprintf(mbfp,"29");
-		for (i=0;i<29;i++)
-			status = fprintf(mbfp,"%4.4d",data->time[28-i]);
-		status = fprintf(mbfp,"\n");
-
-		/* output gyro headings */
-		for (i=0;i<11;i++)
-			status = fprintf(mbfp,"%05.1f",data->gyro[i]);
-		status = fprintf(mbfp,"\n");
-
-		/* check for an error */
-		if (status > 0)
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		else
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_hsatlraw_wr_ergnctds(int verbose, FILE *mbfp, void *data_ptr, int *error)
-{
-	char	*function_name = "mbr_hsatlraw_wr_ergnctds";
-	int	status = MB_SUCCESS;
-	struct mbf_hsatlraw_struct *data;
-	int	i;
-	int	nline, nrem;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       data_ptr:   %p\n",(void *)data_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_hsatlraw_struct *) data_ptr;
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       longitude:        %f\n",data->lon);
-		fprintf(stderr,"dbg5       latitude:         %f\n",data->lat);
-		fprintf(stderr,"dbg5       year:             %d\n",data->year);
-		fprintf(stderr,"dbg5       month:            %d\n",data->month);
-		fprintf(stderr,"dbg5       day:              %d\n",data->day);
-		fprintf(stderr,"dbg5       hour:             %d\n",data->hour);
-		fprintf(stderr,"dbg5       minute:           %d\n",
-			data->minute);
-		fprintf(stderr,"dbg5       second:           %d\n",
-			data->second);
-		fprintf(stderr,"dbg5       num_vel:          %d\n",
-			data->num_vel);
-		fprintf(stderr,"dbg5       water depths and velocities:\n");
-		for (i=0;i<11;i++)
-			fprintf(stderr,"dbg5         %d  %f  %f\n",
-				i,data->vdepth[i],data->velocity[i]);
-		}
-
-	/* write the record label */
-	status = mbr_hsatlraw_wr_label(verbose,mbfp,
-		MBF_HSATLRAW_ERGNCTDS,error);
-
-	/* write out the data */
-	if (status == MB_SUCCESS)
-		{
-		/* output the event line */
-		status = fprintf(mbfp,"%+12.7f",data->lon);
-		status = fprintf(mbfp,"%+12.7f",data->lat);
-		status = fprintf(mbfp,"%4.4d",data->year);
-		status = fprintf(mbfp,"%2.2d",data->month);
-		status = fprintf(mbfp,"%2.2d",data->day);
-		status = fprintf(mbfp,"%2.2d",data->hour);
-		status = fprintf(mbfp,"%2.2d",data->minute);
-		status = fprintf(mbfp,"%2.2d",data->second);
-		status = fprintf(mbfp,"%2d\n",data->num_vel);
-
-		/* figure number of velocity lines to write */
-		nline = data->num_vel/10;
-		nrem = data->num_vel%10;
-
-		/* write all of the full lines */
-		for (i=0;i<nline;i++)
-			{
-			for (i=0;i<10;i++)
-				status = fprintf(mbfp,"%5.0f%6.1f",
-					data->vdepth[i],data->velocity[i]);
-			status = fprintf(mbfp,"\n");
-			}
-
-		/* write the last line as needed */
-		if (nrem > 0)
-			{
-			for (i=0;i<nrem;i++)
-				status = fprintf(mbfp,"%5.0f%6.1f",
-					data->vdepth[i],data->velocity[i]);
-			for (i=0;i<(10-nrem);i++)
-				status = fprintf(mbfp,"           ");
-			status = fprintf(mbfp,"\n");
-			}
-
-		/* check for an error */
-		if (status > 0)
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		else
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_hsatlraw_wr_ergnampl(int verbose, FILE *mbfp, void *data_ptr, int *error)
-{
-	char	*function_name = "mbr_hsatlraw_wr_ergnampl";
-	int	status = MB_SUCCESS;
-	struct mbf_hsatlraw_struct *data;
-	int	datacheck;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       data_ptr:   %p\n",(void *)data_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_hsatlraw_struct *) data_ptr;
-
-        /* check if there are data to output */
-	datacheck = MB_NO;
-	for (i=0;i<MBF_HSATLRAW_BEAMS;i++)
-		if (data->amplitude[i] > 0)
-			datacheck = MB_YES;
-
-	/* print debug statements */
-	if (verbose >= 5 && datacheck == MB_NO)
-		{
-		fprintf(stderr,"\ndbg5  No values to be written in MBIO function <%s>\n",function_name);
-		}
-
-	/* print debug statements */
-	if (verbose >= 5 && datacheck == MB_YES)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       longitude:        %f\n",data->lon);
-		fprintf(stderr,"dbg5       latitude:         %f\n",data->lat);
-		fprintf(stderr,"dbg5       year:             %d\n",data->year);
-		fprintf(stderr,"dbg5       month:            %d\n",data->month);
-		fprintf(stderr,"dbg5       day:              %d\n",data->day);
-		fprintf(stderr,"dbg5       hour:             %d\n",data->hour);
-		fprintf(stderr,"dbg5       minute:           %d\n",
-			data->minute);
-		fprintf(stderr,"dbg5       second:           %d\n",
-			data->second);
-		fprintf(stderr,"dbg5       mode:             %c\n",
-			data->mode[0]);
-		fprintf(stderr,"dbg5       trans_strbd:      %d\n",
-			data->trans_strbd);
-		fprintf(stderr,"dbg5       trans_vert:       %d\n",
-			data->trans_vert);
-		fprintf(stderr,"dbg5       trans_port:       %d\n",
-			data->trans_port);
-		fprintf(stderr,"dbg5       pulse_len_strbd:  %d\n",
-			data->pulse_len_strbd);
-		fprintf(stderr,"dbg5       pulse_len_vert:   %d\n",
-			data->pulse_len_vert);
-		fprintf(stderr,"dbg5       pulse_len_port:   %d\n",
-			data->pulse_len_port);
-		fprintf(stderr,"dbg5       gain_start:       %d\n",
-			data->gain_start);
-		fprintf(stderr,"dbg5       r_comp_factor:    %d\n",
-			data->r_compensation_factor);
-		fprintf(stderr,"dbg5       comp_start:       %d\n",
-			data->compensation_start);
-		fprintf(stderr,"dbg5       increase_start:   %d\n",
-			data->increase_start);
-		fprintf(stderr,"dbg5       tvc_near:         %d\n",
-			data->tvc_near);
-		fprintf(stderr,"dbg5       increase_start:   %d\n",
-			data->increase_start);
-		fprintf(stderr,"dbg5       tvc_far:          %d\n",
-			data->tvc_far);
-		fprintf(stderr,"dbg5       increase_int_near:%d\n",
-			data->increase_int_near);
-		fprintf(stderr,"dbg5       increase_int_far: %d\n",
-			data->increase_int_far);
-		fprintf(stderr,"dbg5       gain_center:      %d\n",
-			data->gain_center);
-		fprintf(stderr,"dbg5       filter_gain:      %f\n",
-			data->filter_gain);
-		fprintf(stderr,"dbg5       amplitude_center: %d\n",
-			data->amplitude_center);
-		fprintf(stderr,"dbg5       echo_dur_center:  %d\n",
-			data->echo_duration_center);
-		fprintf(stderr,"dbg5       echo_scal_center: %d\n",
-			data->echo_scale_center);
-		fprintf(stderr,"dbg5       amplitudes and echo durations:\n");
-		for (i=0;i<MBF_HSATLRAW_BEAMS;i++)
-			fprintf(stderr,"dbg5         %d  %d  %d\n",
-				i,data->amplitude[i],data->echo_duration[i]);
-		fprintf(stderr,"dbg5       gains and echo scales:\n");
-		for (i=0;i<16;i++)
-			fprintf(stderr,"dbg5         %d  %d  %d\n",
-				i,data->gain[i],data->echo_scale[i]);
-		}
-
-	/* write the record label */
-	if (datacheck == MB_YES)
-		status = mbr_hsatlraw_wr_label(verbose,mbfp,
-			MBF_HSATLRAW_ERGNAMPL,error);
-
-	/* write out the data */
-	if (status == MB_SUCCESS && datacheck == MB_YES)
-		{
-		/* output the event line */
-		status = fprintf(mbfp,"%+12.7f",data->lon);
-		status = fprintf(mbfp,"%+12.7f",data->lat);
-		status = fprintf(mbfp,"%4.4d",data->year);
-		status = fprintf(mbfp,"%2.2d",data->month);
-		status = fprintf(mbfp,"%2.2d",data->day);
-		status = fprintf(mbfp,"%2.2d",data->hour);
-		status = fprintf(mbfp,"%2.2d",data->minute);
-		status = fprintf(mbfp,"%2.2d",data->second);
-		status = fprintf(mbfp,"%c",data->mode[0]);
-		status = fprintf(mbfp,"%3.3d",data->trans_strbd);
-		status = fprintf(mbfp,"%3.3d",data->trans_vert);
-		status = fprintf(mbfp,"%3.3d",data->trans_port);
-		status = fprintf(mbfp,"%2.2d",data->pulse_len_strbd);
-		status = fprintf(mbfp,"%2.2d",data->pulse_len_vert);
-		status = fprintf(mbfp,"%2.2d",data->pulse_len_port);
-		status = fprintf(mbfp,"%2.2d",data->gain_start);
-		status = fprintf(mbfp,"%2.2d",data->r_compensation_factor);
-		status = fprintf(mbfp,"%4.4d",data->compensation_start);
-		status = fprintf(mbfp,"%5.5d",data->increase_start);
-		status = fprintf(mbfp,"%2.2d",data->tvc_near);
-		status = fprintf(mbfp,"%2.2d",data->tvc_far);
-		status = fprintf(mbfp,"%3.3d",data->increase_int_near);
-		status = fprintf(mbfp,"%3.3d",data->increase_int_far);
-		status = fprintf(mbfp,"%1d",data->gain_center);
-		status = fprintf(mbfp,"%+5.1f",data->filter_gain);
-		status = fprintf(mbfp,"%3.3d",data->amplitude_center);
-		status = fprintf(mbfp,"%3.3d",data->echo_duration_center);
-		status = fprintf(mbfp,"%1d\n",data->echo_scale_center);
-
-		/* output starboard amplitudes */
-		for (i=0;i<8;i++)
-			status = fprintf(mbfp,"%1.1d",data->gain[i+8]);
-		status = fprintf(mbfp,"29");
-		for (i=0;i<29;i++)
-			status = fprintf(mbfp,"%3.3d",data->amplitude[i+30]);
-		status = fprintf(mbfp,"\n");
-
-		/* output port amplitudes */
-		for (i=0;i<8;i++)
-			status = fprintf(mbfp,"%1.1d",data->gain[i]);
-		status = fprintf(mbfp,"29");
-		for (i=0;i<29;i++)
-			status = fprintf(mbfp,"%3.3d",data->amplitude[28-i]);
-		status = fprintf(mbfp,"\n");
-
-		/* output starboard echo durations */
-		for (i=0;i<8;i++)
-			status = fprintf(mbfp,"%1.1d",data->echo_scale[i+8]);
-		status = fprintf(mbfp,"29");
-		for (i=0;i<29;i++)
-			status = fprintf(mbfp,"%3.3d",
-				data->echo_duration[i+30]);
-		status = fprintf(mbfp,"\n");
-
-		/* output port echo durations */
-		for (i=0;i<8;i++)
-			status = fprintf(mbfp,"%1.1d",data->echo_scale[i]);
-		status = fprintf(mbfp,"29");
-		for (i=0;i<29;i++)
-			status = fprintf(mbfp,"%3.3d",
-				data->echo_duration[28-i]);
-		status = fprintf(mbfp,"\n");
-
-		/* check for an error */
-		if (status > 0)
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		else
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_hsatlraw_wr_ldeocmnt(int verbose, FILE *mbfp, void *data_ptr, int *error)
-{
-	char	*function_name = "mbr_hsatlraw_wr_ldeocmnt";
-	int	status = MB_SUCCESS;
-	struct mbf_hsatlraw_struct *data;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       data_ptr:   %p\n",(void *)data_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_hsatlraw_struct *) data_ptr;
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       comment:          %s\n",data->comment);
-		}
-
-	/* write the record label */
-	status = mbr_hsatlraw_wr_label(verbose,mbfp,
-		MBF_HSATLRAW_LDEOCMNT,error);
-
-	/* write out the data */
-	if (status == MB_SUCCESS)
-		{
-		/* output the event line */
-		status = fprintf(mbfp,"%s\n",data->comment);
-
-		/* check for an error */
-		if (status >= 0)
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		else
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mbr_hsds2lam.c b/src/mbio/mbr_hsds2lam.c
deleted file mode 100644
index 8024035..0000000
--- a/src/mbio/mbr_hsds2lam.c
+++ /dev/null
@@ -1,1208 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbr_hsds2raw.c	6/20/01
- *	$Id: mbr_hsds2lam.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 2001-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbr_hsds2lam.c contains the functions for reading
- * multibeam data in the HSDS2LAM format.
- * These functions include:
- *   mbr_alm_hsds2lam	- allocate read/write memory
- *   mbr_dem_hsds2lam	- deallocate read/write memory
- *   mbr_rt_hsds2lam	- read and translate data
- *   mbr_wt_hsds2lam	- translate and write data
- *
- * Authors:	D. W. Caress
- * 		D. N. Chayes
- * Date:	June 20, 2001
- * $Log: mbr_hsds2lam.c,v $
- * Revision 5.5  2005/11/05 00:48:04  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.4  2003/05/20 18:05:32  caress
- * Added svp_source to data source parameters.
- *
- * Revision 5.3  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.2  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.1  2002/07/20 20:42:40  caress
- * Release 5.0.beta20
- *
- * Revision 5.0  2001/07/20 00:32:06  caress
- * Release 5.0.beta03
- *
- * Revision 5.0  2001/06/29  22:49:07  caress
- * Added support for HSDS2LAM
- *
- *
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_define.h"
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mbsys_atlas.h"
-
-/* turn on debug statements here */
-/* #define MBR_HSDS2LAM_DEBUG 1 */
-
-/* essential function prototypes */
-int mbr_register_hsds2lam(int verbose, void *mbio_ptr,
-		int *error);
-int mbr_info_hsds2lam(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_alm_hsds2lam(int verbose, void *mbio_ptr, int *error);
-int mbr_dem_hsds2lam(int verbose, void *mbio_ptr, int *error);
-int mbr_rt_hsds2lam(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_wt_hsds2lam(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_hsds2lam_rd_data(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_hsds2lam_wr_data(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-
-static char rcs_id[]="$Id: mbr_hsds2lam.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mbr_register_hsds2lam(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_register_hsds2lam";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* get mb_io_ptr */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set format info parameters */
-	status = mbr_info_hsds2lam(verbose,
-			&mb_io_ptr->system,
-			&mb_io_ptr->beams_bath_max,
-			&mb_io_ptr->beams_amp_max,
-			&mb_io_ptr->pixels_ss_max,
-			mb_io_ptr->format_name,
-			mb_io_ptr->system_name,
-			mb_io_ptr->format_description,
-			&mb_io_ptr->numfile,
-			&mb_io_ptr->filetype,
-			&mb_io_ptr->variable_beams,
-			&mb_io_ptr->traveltime,
-			&mb_io_ptr->beam_flagging,
-			&mb_io_ptr->nav_source,
-			&mb_io_ptr->heading_source,
-			&mb_io_ptr->vru_source,
-			&mb_io_ptr->svp_source,
-			&mb_io_ptr->beamwidth_xtrack,
-			&mb_io_ptr->beamwidth_ltrack,
-			error);
-
-	/* set format and system specific function pointers */
-	mb_io_ptr->mb_io_format_alloc = &mbr_alm_hsds2lam;
-	mb_io_ptr->mb_io_format_free = &mbr_dem_hsds2lam;
-	mb_io_ptr->mb_io_store_alloc = &mbsys_atlas_alloc;
-	mb_io_ptr->mb_io_store_free = &mbsys_atlas_deall;
-	mb_io_ptr->mb_io_read_ping = &mbr_rt_hsds2lam;
-	mb_io_ptr->mb_io_write_ping = &mbr_wt_hsds2lam;
-	mb_io_ptr->mb_io_dimensions = &mbsys_atlas_dimensions;
-	mb_io_ptr->mb_io_extract = &mbsys_atlas_extract;
-	mb_io_ptr->mb_io_insert = &mbsys_atlas_insert;
-	mb_io_ptr->mb_io_extract_nav = &mbsys_atlas_extract_nav;
-	mb_io_ptr->mb_io_insert_nav = &mbsys_atlas_insert_nav;
-	mb_io_ptr->mb_io_extract_altitude = &mbsys_atlas_extract_altitude;
-	mb_io_ptr->mb_io_insert_altitude = NULL;
-	mb_io_ptr->mb_io_extract_svp = NULL;
-	mb_io_ptr->mb_io_insert_svp = NULL;
-	mb_io_ptr->mb_io_ttimes = &mbsys_atlas_ttimes;
-	mb_io_ptr->mb_io_detects = &mbsys_atlas_detects;
-	mb_io_ptr->mb_io_copyrecord = &mbsys_atlas_copy;
-	mb_io_ptr->mb_io_extract_rawss = NULL;
-	mb_io_ptr->mb_io_insert_rawss = NULL;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",mb_io_ptr->system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",mb_io_ptr->beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",mb_io_ptr->beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",mb_io_ptr->pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",mb_io_ptr->format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",mb_io_ptr->system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",mb_io_ptr->format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",mb_io_ptr->numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",mb_io_ptr->filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",mb_io_ptr->variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",mb_io_ptr->traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",mb_io_ptr->beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",mb_io_ptr->nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",mb_io_ptr->heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",mb_io_ptr->vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",mb_io_ptr->svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",mb_io_ptr->beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",mb_io_ptr->beamwidth_ltrack);
-		fprintf(stderr,"dbg2       format_alloc:       %p\n",(void *)mb_io_ptr->mb_io_format_alloc);
-		fprintf(stderr,"dbg2       format_free:        %p\n",(void *)mb_io_ptr->mb_io_format_free);
-		fprintf(stderr,"dbg2       store_alloc:        %p\n",(void *)mb_io_ptr->mb_io_store_alloc);
-		fprintf(stderr,"dbg2       store_free:         %p\n",(void *)mb_io_ptr->mb_io_store_free);
-		fprintf(stderr,"dbg2       read_ping:          %p\n",(void *)mb_io_ptr->mb_io_read_ping);
-		fprintf(stderr,"dbg2       write_ping:         %p\n",(void *)mb_io_ptr->mb_io_write_ping);
-		fprintf(stderr,"dbg2       extract:            %p\n",(void *)mb_io_ptr->mb_io_extract);
-		fprintf(stderr,"dbg2       insert:             %p\n",(void *)mb_io_ptr->mb_io_insert);
-		fprintf(stderr,"dbg2       extract_nav:        %p\n",(void *)mb_io_ptr->mb_io_extract_nav);
-		fprintf(stderr,"dbg2       insert_nav:         %p\n",(void *)mb_io_ptr->mb_io_insert_nav);
-		fprintf(stderr,"dbg2       extract_altitude:   %p\n",(void *)mb_io_ptr->mb_io_extract_altitude);
-		fprintf(stderr,"dbg2       insert_altitude:    %p\n",(void *)mb_io_ptr->mb_io_insert_altitude);
-		fprintf(stderr,"dbg2       extract_svp:        %p\n",(void *)mb_io_ptr->mb_io_extract_svp);
-		fprintf(stderr,"dbg2       insert_svp:         %p\n",(void *)mb_io_ptr->mb_io_insert_svp);
-		fprintf(stderr,"dbg2       ttimes:             %p\n",(void *)mb_io_ptr->mb_io_ttimes);
-		fprintf(stderr,"dbg2       detects:            %p\n",(void *)mb_io_ptr->mb_io_detects);
-		fprintf(stderr,"dbg2       extract_rawss:      %p\n",(void *)mb_io_ptr->mb_io_extract_rawss);
-		fprintf(stderr,"dbg2       insert_rawss:       %p\n",(void *)mb_io_ptr->mb_io_insert_rawss);
-		fprintf(stderr,"dbg2       copyrecord:         %p\n",(void *)mb_io_ptr->mb_io_copyrecord);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbr_info_hsds2lam(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error)
-{
-	char	*function_name = "mbr_info_hsds2lam";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* set format info parameters */
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-	*system = MB_SYS_ATLAS;
-	*beams_bath_max = MBSYS_ATLAS_MAXBEAMS;
-	*beams_amp_max = MBSYS_ATLAS_MAXBEAMS;
-	*pixels_ss_max = MBSYS_ATLAS_MAXPIXELS;
-	strncpy(format_name, "HSDS2LAM", MB_NAME_LENGTH);
-	strncpy(system_name, "ATLAS", MB_NAME_LENGTH);
-	strncpy(format_description, "Format name:          MBF_HSDS2LAM\nInformal Description: L-DEO HSDS2 processing format\nAttributes:           STN Atlas multibeam sonars, \n                      Hydrosweep DS2, Hydrosweep MD, \n                      Fansweep 10, Fansweep 20, \n                      bathymetry, amplitude, and sidescan,\n                      up to 1440 beams and 4096 pixels,\n                      XDR binary, L-DEO.\n", MB_DESCRIPTION_LENGTH);
-	*numfile = 1;
-	*filetype = MB_FILETYPE_XDR;
-	*variable_beams = MB_YES;
-	*traveltime = MB_YES;
-	*beam_flagging = MB_YES;
-	*nav_source = MB_DATA_DATA;
-	*heading_source = MB_DATA_DATA;
-	*vru_source = MB_DATA_DATA;
-	*svp_source = MB_DATA_NONE;
-	*beamwidth_xtrack = 2.67;
-	*beamwidth_ltrack = 2.67;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",*system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",*beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",*beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",*pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",*numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",*filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",*variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",*traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",*beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",*nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",*heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",*vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",*svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",*beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",*beamwidth_ltrack);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_alm_hsds2lam(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_alm_hsds2lam";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set initial status */
-	status = MB_SUCCESS;
-
-	/* allocate memory for data structure */
-	mb_io_ptr->structure_size = 0;
-	mb_io_ptr->data_structure_size = 0;
-	status = mbsys_atlas_alloc(
-			verbose,mbio_ptr,
-			&mb_io_ptr->store_data,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_dem_hsds2lam(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_dem_hsds2lam";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointers to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* deallocate memory for data descriptor */
-	status = mbsys_atlas_deall(
-			verbose,mbio_ptr,
-			&mb_io_ptr->store_data,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_rt_hsds2lam(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_rt_hsds2lam";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_atlas_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointers to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* read next data from file */
-	status = mbr_hsds2lam_rd_data(verbose,mbio_ptr,store_ptr,error);
-
-	/* get pointers to data structures */
-	store = (struct mbsys_atlas_struct *) store_ptr;
-
-	/* set error and kind in mb_io_ptr */
-	mb_io_ptr->new_error = *error;
-	mb_io_ptr->new_kind = store->kind;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_wt_hsds2lam(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_wt_hsds2lam";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_atlas_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_atlas_struct *) store_ptr;
-
-	/* write next data to file */
-	status = mbr_hsds2lam_wr_data(verbose,mbio_ptr,store_ptr,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_hsds2lam_rd_data(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_hsds2lam_rd_data";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_atlas_struct *store;
-	int	xdr_status;
-	int	strlength;
-	int	telegram_id;
-	int	nskip;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_atlas_struct *) store_ptr;
-
-	/* set file position */
-	mb_io_ptr->file_pos = mb_io_ptr->file_bytes;
-
-	/* read the next record (hsds2lam telegram  */
-	*error = MB_ERROR_NO_ERROR;
-
-	/* get telegram */
-	nskip = 0;
-	xdr_status = xdr_int(mb_io_ptr->xdrs, &telegram_id);
-	while (xdr_status == MB_YES
-	    && telegram_id != MBSYS_ATLAS_TELEGRAM_HSDS2LAM
-	    && telegram_id != MBSYS_ATLAS_TELEGRAM_COMMENTLAM)
-	    {
-	    xdr_status = xdr_int(mb_io_ptr->xdrs, &telegram_id);
-	    nskip++;
-	    }
-
-	/* read ping record */
-	if (telegram_id == MBSYS_ATLAS_TELEGRAM_HSDS2LAM)
-	    {
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_u_int(mb_io_ptr->xdrs, &store->start_ping_no);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_double(mb_io_ptr->xdrs, &store->start_transmit_time_d);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_int(mb_io_ptr->xdrs, &strlength);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_opaque(mb_io_ptr->xdrs, (char *)store->start_opmode, strlength);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_double(mb_io_ptr->xdrs, &store->start_heave);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_double(mb_io_ptr->xdrs, &store->start_roll);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_double(mb_io_ptr->xdrs, &store->start_pitch);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_double(mb_io_ptr->xdrs, &store->start_heading);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_double(mb_io_ptr->xdrs, &store->start_ckeel);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_double(mb_io_ptr->xdrs, &store->start_cmean);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_double(mb_io_ptr->xdrs, &store->start_depth_min);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_double(mb_io_ptr->xdrs, &store->start_depth_max);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_u_int(mb_io_ptr->xdrs, &store->tt_ping_no);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_double(mb_io_ptr->xdrs, &store->tt_transmit_time_d);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_int(mb_io_ptr->xdrs, &store->tt_beam_table_index);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_int(mb_io_ptr->xdrs, &store->tt_beam_cnt);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_int(mb_io_ptr->xdrs, &store->tt_long1);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_int(mb_io_ptr->xdrs, &store->tt_long2);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_int(mb_io_ptr->xdrs, &store->tt_long3);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_int(mb_io_ptr->xdrs, &store->tt_xdraught);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_double(mb_io_ptr->xdrs, &store->tt_double1);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_double(mb_io_ptr->xdrs, &store->tt_double2);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_double(mb_io_ptr->xdrs, &store->tt_sensdraught);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_double(mb_io_ptr->xdrs, &store->tt_draught);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_double(mb_io_ptr->xdrs, &store->pr_navlon);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_double(mb_io_ptr->xdrs, &store->pr_navlat);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_double(mb_io_ptr->xdrs, &store->pr_speed);
-	    for (i=0;i<store->tt_beam_cnt;i++)
-		{
-		if (xdr_status == MB_YES)
-		    xdr_status = xdr_float(mb_io_ptr->xdrs, &(store->tt_lruntime[i]));
-		}
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_int(mb_io_ptr->xdrs, &strlength);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_opaque(mb_io_ptr->xdrs, (char *)store->tt_lamplitude, strlength);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_int(mb_io_ptr->xdrs, &strlength);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_opaque(mb_io_ptr->xdrs, (char *)store->tt_lstatus, strlength);
-	    for (i=0;i<store->tt_beam_cnt;i++)
-		{
-		if (xdr_status == MB_YES)
-		    xdr_status = xdr_double(mb_io_ptr->xdrs, &(store->pr_bath[i]));
-		}
-	    for (i=0;i<store->tt_beam_cnt;i++)
-		{
-		if (xdr_status == MB_YES)
-		    xdr_status = xdr_double(mb_io_ptr->xdrs, &(store->pr_bathacrosstrack[i]));
-		}
-	    for (i=0;i<store->tt_beam_cnt;i++)
-		{
-		if (xdr_status == MB_YES)
-		    xdr_status = xdr_double(mb_io_ptr->xdrs, &(store->pr_bathalongtrack[i]));
-		}
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_int(mb_io_ptr->xdrs, &strlength);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_opaque(mb_io_ptr->xdrs, (char *)store->pr_beamflag, strlength);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_u_int(mb_io_ptr->xdrs, &store->ss_ping_no);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_double(mb_io_ptr->xdrs, &store->ss_transmit_time_d);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_double(mb_io_ptr->xdrs, &store->ss_timedelay);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_double(mb_io_ptr->xdrs, &store->ss_timespacing);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_int(mb_io_ptr->xdrs, &store->ss_max_side_bb_cnt);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_int(mb_io_ptr->xdrs, &store->ss_max_side_sb_cnt);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_int(mb_io_ptr->xdrs, &strlength);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_opaque(mb_io_ptr->xdrs, (char *)store->ss_sidescan, strlength);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_double(mb_io_ptr->xdrs, &store->tr_transmit_time_d);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_u_int(mb_io_ptr->xdrs, &store->tr_ping_no);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_int(mb_io_ptr->xdrs, &store->tr_window_mode);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_int(mb_io_ptr->xdrs, &store->tr_no_of_win_groups);
-	    for (i=0;i<100;i++)
-		{
-		if (xdr_status == MB_YES)
-		    xdr_status = xdr_int(mb_io_ptr->xdrs, &store->tr_repeat_count[i]);
-		if (xdr_status == MB_YES)
-		    xdr_status = xdr_float(mb_io_ptr->xdrs, &store->tr_start[i]);
-		if (xdr_status == MB_YES)
-		    xdr_status = xdr_float(mb_io_ptr->xdrs, &store->tr_stop[i]);
-		}
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_double(mb_io_ptr->xdrs, &store->bs_transmit_time_d);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_int(mb_io_ptr->xdrs, &store->bs_ping_no);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_u_short(mb_io_ptr->xdrs, &store->bs_nrActualGainSets);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_float(mb_io_ptr->xdrs, &store->bs_rxGup);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_float(mb_io_ptr->xdrs, &store->bs_rxGain);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_float(mb_io_ptr->xdrs, &store->bs_ar);
-	    for (i=0;i<MBSYS_ATLAS_HSDS2_RX_PAR;i++)
-		{
-		if (xdr_status == MB_YES)
-		    xdr_status = xdr_float(mb_io_ptr->xdrs, &store->bs_TvgRx_time[i]);
-		if (xdr_status == MB_YES)
-		    xdr_status = xdr_float(mb_io_ptr->xdrs, &store->bs_TvgRx_gain[i]);
-		}
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_u_short(mb_io_ptr->xdrs, &store->bs_nrTxSets);
-	    for (i=0;i<MBSYS_ATLAS_HSDS2_TX_PAR;i++)
-		{
-		if (xdr_status == MB_YES)
-		    xdr_status = xdr_u_int(mb_io_ptr->xdrs, &store->bs_txBeamIndex[i]);
-		if (xdr_status == MB_YES)
-		    xdr_status = xdr_float(mb_io_ptr->xdrs, &store->bs_txLevel[i]);
-		if (xdr_status == MB_YES)
-		    xdr_status = xdr_float(mb_io_ptr->xdrs, &store->bs_txBeamAngle[i]);
-		if (xdr_status == MB_YES)
-		    xdr_status = xdr_float(mb_io_ptr->xdrs, &store->bs_pulseLength[i]);
-		}
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_u_short(mb_io_ptr->xdrs, &store->bs_nrBsSets);
-	    for (i=0;i<MBSYS_ATLAS_HSDS2_PFB_NUM;i++)
-		{
-		if (xdr_status == MB_YES)
-		    xdr_status = xdr_float(mb_io_ptr->xdrs, &store->bs_m_tau[i]);
-		}
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_int(mb_io_ptr->xdrs, &strlength);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_opaque(mb_io_ptr->xdrs, (char *)store->bs_eff_ampli, strlength);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_int(mb_io_ptr->xdrs, &strlength);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_opaque(mb_io_ptr->xdrs, (char *)store->bs_nis, strlength);
-
-	    /* set kind */
-	    if (store->start_opmode[12] == 0)
-		    store->kind = MB_DATA_DATA;
-	    else
-		    store->kind = MB_DATA_CALIBRATE;
-	    }
-
-	/* read comment record */
-	else if (telegram_id == MBSYS_ATLAS_TELEGRAM_COMMENTLAM)
-	    {
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_int(mb_io_ptr->xdrs, &strlength);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_opaque(mb_io_ptr->xdrs, (char *)store->comment, strlength);
-
-	    /* set kind */
-	    store->kind = MB_DATA_COMMENT;
-	    }
-
-	/* set error if required */
-	if (xdr_status == MB_NO)
-		{
-		*error = MB_ERROR_EOF;
-		status = MB_FAILURE;
-		}
-
-	/* check for broken records - these do happen!!! */
-	if (status == MB_SUCCESS
-	    && store->kind != MB_DATA_COMMENT
-	    && (store->tt_beam_cnt > MBSYS_ATLAS_MAXBEAMS
-		|| store->ss_max_side_bb_cnt > MBSYS_ATLAS_MAXPIXELS
-		|| store->ss_max_side_sb_cnt > MBSYS_ATLAS_MAXPIXELS
-		|| store->start_opmode[0] != 1))
-		{
-		*error = MB_ERROR_UNINTELLIGIBLE;
-		status = MB_FAILURE;
-		}
-
-	/* check again for broken records - these do happen!!! */
-	if (status == MB_SUCCESS
-	    && store->kind != MB_DATA_COMMENT)
-	    {
-	    for (i=0;i<store->tt_beam_cnt;i++)
-		{
-		if (store->tt_lruntime[i] > 20.0)
-		    {
-		    *error = MB_ERROR_UNINTELLIGIBLE;
-		    status = MB_FAILURE;
-		    }
-		}
-	    }
-
-	/* check again for broken records - these do happen!!! */
-	if (status == MB_SUCCESS
-	    && store->kind != MB_DATA_COMMENT)
-	    {
-	    for (i=0;i<store->tt_beam_cnt;i++)
-		{
-		if (store->tt_lruntime[i] > 20.0)
-		    {
-		    *error = MB_ERROR_UNINTELLIGIBLE;
-		    status = MB_FAILURE;
-		    }
-		}
-	    }
-
-	/* print debug statements */
-#ifndef MBR_HSDS2LAM_DEBUG
-	if (verbose >= 5)
-#endif
-		{
-		fprintf(stderr,"\ndbg5  HSDS2LAM telegram read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       xdr_status:              %d\n",xdr_status);
-		fprintf(stderr,"dbg5       kind:                    %d\n",store->kind);
-		if (store->kind == MB_DATA_COMMENT)
-		    {
-		    fprintf(stderr,"dbg5       comment:                 %s\n",store->comment);
-		    }
-		else
-		    {
-		    fprintf(stderr,"dbg5       start_ping_no:           %d\n",store->start_ping_no);
-		    fprintf(stderr,"dbg5       start_transmit_time_d:   %f\n",store->start_transmit_time_d);
-		    fprintf(stderr,"dbg5       start_opmode:            ");
-		    for (i=0;i<32;i++)
-			fprintf(stderr," %d",store->start_opmode[i]);
-		    fprintf(stderr,"\n");
-		    fprintf(stderr,"dbg5       start_heave:             %f\n",store->start_heave);
-		    fprintf(stderr,"dbg5       start_roll:              %f\n",store->start_roll);
-		    fprintf(stderr,"dbg5       start_pitch:             %f\n",store->start_pitch);
-		    fprintf(stderr,"dbg5       start_heading:           %f\n",store->start_heading);
-		    fprintf(stderr,"dbg5       start_ckeel:             %f\n",store->start_ckeel);
-		    fprintf(stderr,"dbg5       start_cmean:             %f\n",store->start_cmean);
-		    fprintf(stderr,"dbg5       start_depth_min:         %f\n",store->start_depth_min);
-		    fprintf(stderr,"dbg5       start_depth_max:         %f\n",store->start_depth_max);
-		    fprintf(stderr,"dbg5       tt_ping_no:              %d\n",store->tt_ping_no);
-		    fprintf(stderr,"dbg5       tt_transmit_time_d:      %f\n",store->tt_transmit_time_d);
-		    fprintf(stderr,"dbg5       tt_beam_table_index:     %d\n",store->tt_beam_table_index);
-		    fprintf(stderr,"dbg5       tt_beam_cnt:             %d\n",store->tt_beam_cnt);
-		    fprintf(stderr,"dbg5       tt_long1:                %d\n",store->tt_long1);
-		    fprintf(stderr,"dbg5       tt_long2:                %d\n",store->tt_long2);
-		    fprintf(stderr,"dbg5       tt_long3:                %d\n",store->tt_long3);
-		    fprintf(stderr,"dbg5       tt_xdraught:             %d\n",store->tt_xdraught);
-		    fprintf(stderr,"dbg5       tt_double1:              %f\n",store->tt_double1);
-		    fprintf(stderr,"dbg5       tt_double2:              %f\n",store->tt_double2);
-		    fprintf(stderr,"dbg5       tt_sensdraught:          %f\n",store->tt_sensdraught);
-		    fprintf(stderr,"dbg5       tt_draught:              %f\n",store->tt_draught);
-		    fprintf(stderr,"dbg5       beam bath xtrack lttrack tt amp stat flag:\n");
-		    for (i=0;i<store->tt_beam_cnt;i++)
-		    fprintf(stderr,"dbg5       %4d %12f %12f %12f %12f %3d %3d %3d\n",
-				    i, store->pr_bath[i], store->pr_bathacrosstrack[i], store->pr_bathalongtrack[i],
-				    store->tt_lruntime[i], store->tt_lamplitude[i],
-				    store->tt_lstatus[i], store->pr_beamflag[i]);
-		    fprintf(stderr,"dbg5       ss_ping_no:              %d\n",store->ss_ping_no);
-		    fprintf(stderr,"dbg5       ss_transmit_time_d:      %f\n",store->ss_transmit_time_d);
-		    fprintf(stderr,"dbg5       ss_timedelay:            %f\n",store->ss_timedelay);
-		    fprintf(stderr,"dbg5       ss_timespacing:          %f\n",store->ss_timespacing);
-		    fprintf(stderr,"dbg5       ss_max_side_bb_cnt:      %d\n",store->ss_max_side_bb_cnt);
-		    fprintf(stderr,"dbg5       ss_max_side_sb_cnt:      %d\n",store->ss_max_side_sb_cnt);
-		    for (i=0;i<(store->ss_max_side_bb_cnt + store->ss_max_side_sb_cnt);i++)
-			    fprintf(stderr,"dbg5       pixel[%d] ss:            %d\n",i, store->ss_sidescan[i]);
-		    fprintf(stderr,"dbg5       tr_ping_no:              %d\n",store->tr_ping_no);
-		    fprintf(stderr,"dbg5       tr_transmit_time_d:      %f\n",store->tr_transmit_time_d);
-		    fprintf(stderr,"dbg5       tr_window_mode:          %d\n",store->tr_window_mode);
-		    fprintf(stderr,"dbg5       tr_no_of_win_groups:     %d\n",store->tr_no_of_win_groups);
-		    for (i=0;i<MBSYS_ATLAS_MAXWINDOWS;i++)
-			    {
-			    fprintf(stderr,"dbg5       window[%d]:cnt start stop: %d %f %f\n",
-				    i, store->tr_repeat_count[i], store->tr_start[i], store->tr_stop[i]);
-			    }
-		    fprintf(stderr,"dbg5       bs_ping_no:              %d\n",store->bs_ping_no);
-		    fprintf(stderr,"dbg5       bs_transmit_time_d:      %f\n",store->bs_transmit_time_d);
-		    fprintf(stderr,"dbg5       bs_nrActualGainSets:     %d\n",store->bs_nrActualGainSets);
-		    fprintf(stderr,"dbg5       bs_rxGup:                %f\n",store->bs_rxGup);
-		    fprintf(stderr,"dbg5       bs_rxGain:               %f\n",store->bs_rxGain);
-		    fprintf(stderr,"dbg5       bs_ar:                   %f\n",store->bs_ar);
-		    for (i=0;i<MBSYS_ATLAS_HSDS2_RX_PAR;i++)
-			    {
-			    fprintf(stderr,"dbg5       tvgrx[%d]: time gain: %f %f\n",
-				    i, store->bs_TvgRx_time[i], store->bs_TvgRx_gain[i]);
-			    }
-		    fprintf(stderr,"dbg5       bs_nrTxSets:             %d\n",store->bs_nrTxSets);
-		    for (i=0;i<MBSYS_ATLAS_HSDS2_TX_PAR;i++)
-			    {
-			    fprintf(stderr,"dbg5       tx[%d]: # gain ang len:    %d %f %f %f\n",
-				    i, store->bs_txBeamIndex[i], store->bs_txLevel[i],
-				    store->bs_txBeamAngle[i], store->bs_pulseLength[i]);
-			    }
-		    fprintf(stderr,"dbg5       bs_nrBsSets:             %d\n",store->bs_nrBsSets);
-		    for (i=0;i<MBSYS_ATLAS_HSDS2_TX_PAR;i++)
-			    {
-			    fprintf(stderr,"dbg5       bs[%d]: # tau amp nis:   %f %d %d\n",
-				    i, store->bs_m_tau[i], store->bs_eff_ampli[i], store->bs_nis[i]);
-			    }
-		    }
-		}
-
-	/* get file position */
-	mb_io_ptr->file_bytes = ftell(mb_io_ptr->mbfp);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_hsds2lam_wr_data(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_hsds2lam_wr_data";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_atlas_struct *store;
-	int	xdr_status;
-	int	strlength;
-	int	telegram_id;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_atlas_struct *) store_ptr;
-
-	/* print debug statements */
-#ifndef MBR_HSDS2LAM_DEBUG
-	if (verbose >= 5)
-#endif
-		{
-		fprintf(stderr,"\ndbg5  HSDS2LAM telegram to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       kind:                    %d\n",store->kind);
-		if (store->kind == MB_DATA_COMMENT)
-		    {
-		    fprintf(stderr,"dbg5       comment:                 %s\n",store->comment);
-		    }
-		else
-		    {
-		    fprintf(stderr,"dbg5       start_ping_no:           %d\n",store->start_ping_no);
-		    fprintf(stderr,"dbg5       start_transmit_time_d:   %f\n",store->start_transmit_time_d);
-		    fprintf(stderr,"dbg5       start_opmode:            ");
-		    for (i=0;i<32;i++)
-			fprintf(stderr," %d",store->start_opmode[i]);
-		    fprintf(stderr,"\n");
-		    fprintf(stderr,"dbg5       start_heave:             %f\n",store->start_heave);
-		    fprintf(stderr,"dbg5       start_roll:              %f\n",store->start_roll);
-		    fprintf(stderr,"dbg5       start_pitch:             %f\n",store->start_pitch);
-		    fprintf(stderr,"dbg5       start_heading:           %f\n",store->start_heading);
-		    fprintf(stderr,"dbg5       start_ckeel:             %f\n",store->start_ckeel);
-		    fprintf(stderr,"dbg5       start_cmean:             %f\n",store->start_cmean);
-		    fprintf(stderr,"dbg5       start_depth_min:         %f\n",store->start_depth_min);
-		    fprintf(stderr,"dbg5       start_depth_max:         %f\n",store->start_depth_max);
-		    fprintf(stderr,"dbg5       tt_ping_no:              %d\n",store->tt_ping_no);
-		    fprintf(stderr,"dbg5       tt_transmit_time_d:      %f\n",store->tt_transmit_time_d);
-		    fprintf(stderr,"dbg5       tt_beam_table_index:     %d\n",store->tt_beam_table_index);
-		    fprintf(stderr,"dbg5       tt_beam_cnt:             %d\n",store->tt_beam_cnt);
-		    fprintf(stderr,"dbg5       tt_long1:                %d\n",store->tt_long1);
-		    fprintf(stderr,"dbg5       tt_long2:                %d\n",store->tt_long2);
-		    fprintf(stderr,"dbg5       tt_long3:                %d\n",store->tt_long3);
-		    fprintf(stderr,"dbg5       tt_xdraught:             %d\n",store->tt_xdraught);
-		    fprintf(stderr,"dbg5       tt_double1:              %f\n",store->tt_double1);
-		    fprintf(stderr,"dbg5       tt_double2:              %f\n",store->tt_double2);
-		    fprintf(stderr,"dbg5       tt_sensdraught:          %f\n",store->tt_sensdraught);
-		    fprintf(stderr,"dbg5       tt_draught:              %f\n",store->tt_draught);
-		    fprintf(stderr,"dbg5       beam bath xtrack lttrack tt amp stat flag:\n");
-		    for (i=0;i<store->tt_beam_cnt;i++)
-		    fprintf(stderr,"dbg5       %4d %12f %12f %12f %12f %3d %3d %3d\n",
-				    i, store->pr_bath[i], store->pr_bathacrosstrack[i], store->pr_bathalongtrack[i],
-				    store->tt_lruntime[i], store->tt_lamplitude[i],
-				    store->tt_lstatus[i], store->pr_beamflag[i]);
-		    fprintf(stderr,"dbg5       ss_ping_no:              %d\n",store->ss_ping_no);
-		    fprintf(stderr,"dbg5       ss_transmit_time_d:      %f\n",store->ss_transmit_time_d);
-		    fprintf(stderr,"dbg5       ss_timedelay:            %f\n",store->ss_timedelay);
-		    fprintf(stderr,"dbg5       ss_timespacing:          %f\n",store->ss_timespacing);
-		    fprintf(stderr,"dbg5       ss_max_side_bb_cnt:      %d\n",store->ss_max_side_bb_cnt);
-		    fprintf(stderr,"dbg5       ss_max_side_sb_cnt:      %d\n",store->ss_max_side_sb_cnt);
-		    for (i=0;i<(store->ss_max_side_bb_cnt + store->ss_max_side_sb_cnt);i++)
-			    fprintf(stderr,"dbg5       pixel[%d] ss:            %d\n",i, store->ss_sidescan[i]);
-		    fprintf(stderr,"dbg5       tr_ping_no:              %d\n",store->tr_ping_no);
-		    fprintf(stderr,"dbg5       tr_transmit_time_d:      %f\n",store->tr_transmit_time_d);
-		    fprintf(stderr,"dbg5       tr_window_mode:          %d\n",store->tr_window_mode);
-		    fprintf(stderr,"dbg5       tr_no_of_win_groups:     %d\n",store->tr_no_of_win_groups);
-		    for (i=0;i<MBSYS_ATLAS_MAXWINDOWS;i++)
-			    {
-			    fprintf(stderr,"dbg5       window[%d]:cnt start stop: %d %f %f\n",
-				    i, store->tr_repeat_count[i], store->tr_start[i], store->tr_stop[i]);
-			    }
-		    fprintf(stderr,"dbg5       bs_ping_no:              %d\n",store->bs_ping_no);
-		    fprintf(stderr,"dbg5       bs_transmit_time_d:      %f\n",store->bs_transmit_time_d);
-		    fprintf(stderr,"dbg5       bs_nrActualGainSets:     %d\n",store->bs_nrActualGainSets);
-		    fprintf(stderr,"dbg5       bs_rxGup:                %f\n",store->bs_rxGup);
-		    fprintf(stderr,"dbg5       bs_rxGain:               %f\n",store->bs_rxGain);
-		    fprintf(stderr,"dbg5       bs_ar:                   %f\n",store->bs_ar);
-		    for (i=0;i<MBSYS_ATLAS_HSDS2_RX_PAR;i++)
-			    {
-			    fprintf(stderr,"dbg5       tvgrx[%d]: time gain: %f %f\n",
-				    i, store->bs_TvgRx_time[i], store->bs_TvgRx_gain[i]);
-			    }
-		    fprintf(stderr,"dbg5       bs_nrTxSets:             %d\n",store->bs_nrTxSets);
-		    for (i=0;i<MBSYS_ATLAS_HSDS2_TX_PAR;i++)
-			    {
-			    fprintf(stderr,"dbg5       tx[%d]: # gain ang len:    %d %f %f %f\n",
-				    i, store->bs_txBeamIndex[i], store->bs_txLevel[i],
-				    store->bs_txBeamAngle[i], store->bs_pulseLength[i]);
-			    }
-		    fprintf(stderr,"dbg5       bs_nrBsSets:             %d\n",store->bs_nrBsSets);
-		    for (i=0;i<MBSYS_ATLAS_HSDS2_TX_PAR;i++)
-			    {
-			    fprintf(stderr,"dbg5       bs[%d]: # tau amp nis:   %f %d %d\n",
-				    i, store->bs_m_tau[i], store->bs_eff_ampli[i], store->bs_nis[i]);
-			    }
-		    }
-		}
-
-	/* write the next record (hsds2lam telegram)  */
-	*error = MB_ERROR_NO_ERROR;
-
-	/* write ping record */
-	if (store->kind == MB_DATA_DATA
-	    || store->kind == MB_DATA_CALIBRATE)
-	    {
-	    telegram_id = MBSYS_ATLAS_TELEGRAM_HSDS2LAM;
-	    xdr_status = xdr_int(mb_io_ptr->xdrs, &telegram_id);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_u_int(mb_io_ptr->xdrs, &store->start_ping_no);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_double(mb_io_ptr->xdrs, &store->start_transmit_time_d);
-	    strlength = 32;
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_int(mb_io_ptr->xdrs, &strlength);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_opaque(mb_io_ptr->xdrs, (char *)store->start_opmode, strlength);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_double(mb_io_ptr->xdrs, &store->start_heave);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_double(mb_io_ptr->xdrs, &store->start_roll);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_double(mb_io_ptr->xdrs, &store->start_pitch);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_double(mb_io_ptr->xdrs, &store->start_heading);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_double(mb_io_ptr->xdrs, &store->start_ckeel);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_double(mb_io_ptr->xdrs, &store->start_cmean);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_double(mb_io_ptr->xdrs, &store->start_depth_min);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_double(mb_io_ptr->xdrs, &store->start_depth_max);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_u_int(mb_io_ptr->xdrs, &store->tt_ping_no);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_double(mb_io_ptr->xdrs, &store->tt_transmit_time_d);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_int(mb_io_ptr->xdrs, &store->tt_beam_table_index);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_int(mb_io_ptr->xdrs, &store->tt_beam_cnt);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_int(mb_io_ptr->xdrs, &store->tt_long1);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_int(mb_io_ptr->xdrs, &store->tt_long2);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_int(mb_io_ptr->xdrs, &store->tt_long3);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_int(mb_io_ptr->xdrs, &store->tt_xdraught);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_double(mb_io_ptr->xdrs, &store->tt_double1);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_double(mb_io_ptr->xdrs, &store->tt_double2);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_double(mb_io_ptr->xdrs, &store->tt_sensdraught);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_double(mb_io_ptr->xdrs, &store->tt_draught);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_double(mb_io_ptr->xdrs, &store->pr_navlon);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_double(mb_io_ptr->xdrs, &store->pr_navlat);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_double(mb_io_ptr->xdrs, &store->pr_speed);
-	    for (i=0;i<store->tt_beam_cnt;i++)
-		{
-		if (xdr_status == MB_YES)
-		    xdr_status = xdr_float(mb_io_ptr->xdrs, &(store->tt_lruntime[i]));
-		}
-	    if (store->tt_beam_cnt % 4 == 0)
-		strlength = store->tt_beam_cnt;
-	    else
-		strlength = 4 * ((store->tt_beam_cnt / 4) + 1);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_int(mb_io_ptr->xdrs, &strlength);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_opaque(mb_io_ptr->xdrs, (char *)store->tt_lamplitude, strlength);
-	    if (store->tt_beam_cnt % 4 == 0)
-		strlength = store->tt_beam_cnt;
-	    else
-		strlength = 4 * ((store->tt_beam_cnt / 4) + 1);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_int(mb_io_ptr->xdrs, &strlength);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_opaque(mb_io_ptr->xdrs, (char *)store->tt_lstatus, strlength);
-	    for (i=0;i<store->tt_beam_cnt;i++)
-		{
-		if (xdr_status == MB_YES)
-		    xdr_status = xdr_double(mb_io_ptr->xdrs, &(store->pr_bath[i]));
-		}
-	    for (i=0;i<store->tt_beam_cnt;i++)
-		{
-		if (xdr_status == MB_YES)
-		    xdr_status = xdr_double(mb_io_ptr->xdrs, &(store->pr_bathacrosstrack[i]));
-		}
-	    for (i=0;i<store->tt_beam_cnt;i++)
-		{
-		if (xdr_status == MB_YES)
-		    xdr_status = xdr_double(mb_io_ptr->xdrs, &(store->pr_bathalongtrack[i]));
-		}
-	    if (store->tt_beam_cnt % 4 == 0)
-		strlength = store->tt_beam_cnt;
-	    else
-		strlength = 4 * ((store->tt_beam_cnt / 4) + 1);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_int(mb_io_ptr->xdrs, &strlength);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_opaque(mb_io_ptr->xdrs, (char *)store->pr_beamflag, strlength);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_u_int(mb_io_ptr->xdrs, &store->ss_ping_no);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_double(mb_io_ptr->xdrs, &store->ss_transmit_time_d);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_double(mb_io_ptr->xdrs, &store->ss_timedelay);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_double(mb_io_ptr->xdrs, &store->ss_timespacing);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_int(mb_io_ptr->xdrs, &store->ss_max_side_bb_cnt);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_int(mb_io_ptr->xdrs, &store->ss_max_side_sb_cnt);
-	    if ((store->ss_max_side_bb_cnt + store->ss_max_side_sb_cnt) % 4 == 0)
-		strlength = store->ss_max_side_bb_cnt + store->ss_max_side_sb_cnt;
-	    else
-		strlength = 4 * (((store->ss_max_side_bb_cnt + store->ss_max_side_sb_cnt) / 4) + 1);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_int(mb_io_ptr->xdrs, &strlength);
-	    xdr_status = xdr_opaque(mb_io_ptr->xdrs, (char *)store->ss_sidescan, strlength);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_double(mb_io_ptr->xdrs, &store->tr_transmit_time_d);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_u_int(mb_io_ptr->xdrs, &store->tr_ping_no);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_int(mb_io_ptr->xdrs, &store->tr_window_mode);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_int(mb_io_ptr->xdrs, &store->tr_no_of_win_groups);
-	    for (i=0;i<100;i++)
-		{
-		if (xdr_status == MB_YES)
-		    xdr_status = xdr_int(mb_io_ptr->xdrs, &store->tr_repeat_count[i]);
-		if (xdr_status == MB_YES)
-		    xdr_status = xdr_float(mb_io_ptr->xdrs, &store->tr_start[i]);
-		if (xdr_status == MB_YES)
-		    xdr_status = xdr_float(mb_io_ptr->xdrs, &store->tr_stop[i]);
-		}
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_double(mb_io_ptr->xdrs, &store->bs_transmit_time_d);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_int(mb_io_ptr->xdrs, &store->bs_ping_no);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_u_short(mb_io_ptr->xdrs, &store->bs_nrActualGainSets);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_float(mb_io_ptr->xdrs, &store->bs_rxGup);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_float(mb_io_ptr->xdrs, &store->bs_rxGain);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_float(mb_io_ptr->xdrs, &store->bs_ar);
-	    for (i=0;i<MBSYS_ATLAS_HSDS2_RX_PAR;i++)
-		{
-		if (xdr_status == MB_YES)
-		    xdr_status = xdr_float(mb_io_ptr->xdrs, &store->bs_TvgRx_time[i]);
-		if (xdr_status == MB_YES)
-		    xdr_status = xdr_float(mb_io_ptr->xdrs, &store->bs_TvgRx_gain[i]);
-		}
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_u_short(mb_io_ptr->xdrs, &store->bs_nrTxSets);
-	    for (i=0;i<MBSYS_ATLAS_HSDS2_TX_PAR;i++)
-		{
-		if (xdr_status == MB_YES)
-		    xdr_status = xdr_u_int(mb_io_ptr->xdrs, &store->bs_txBeamIndex[i]);
-		if (xdr_status == MB_YES)
-		    xdr_status = xdr_float(mb_io_ptr->xdrs, &store->bs_txLevel[i]);
-		if (xdr_status == MB_YES)
-		    xdr_status = xdr_float(mb_io_ptr->xdrs, &store->bs_txBeamAngle[i]);
-		if (xdr_status == MB_YES)
-		    xdr_status = xdr_float(mb_io_ptr->xdrs, &store->bs_pulseLength[i]);
-		}
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_u_short(mb_io_ptr->xdrs, &store->bs_nrBsSets);
-	    for (i=0;i<MBSYS_ATLAS_HSDS2_PFB_NUM;i++)
-		{
-		if (xdr_status == MB_YES)
-		    xdr_status = xdr_float(mb_io_ptr->xdrs, &store->bs_m_tau[i]);
-		}
-	    strlength = MBSYS_ATLAS_HSDS2_PFB_NUM;
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_int(mb_io_ptr->xdrs, &strlength);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_opaque(mb_io_ptr->xdrs, (char *)store->bs_eff_ampli, strlength);
-	    strlength = MBSYS_ATLAS_HSDS2_PFB_NUM;
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_int(mb_io_ptr->xdrs, &strlength);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_opaque(mb_io_ptr->xdrs, (char *)store->bs_nis, strlength);
-	    }
-
-	/* write comment record */
-	else if (store->kind == MB_DATA_COMMENT)
-	    {
-	    telegram_id = MBSYS_ATLAS_TELEGRAM_COMMENTLAM;
-	    xdr_status = xdr_int(mb_io_ptr->xdrs, &telegram_id);
-	    if ((strlen(store->comment) + 1) % 4 == 0)
-		strlength = strlen(store->comment) + 1;
-	    else
-		strlength = 4 * (((strlen(store->comment) + 1) / 4) + 1);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_int(mb_io_ptr->xdrs, &strlength);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_opaque(mb_io_ptr->xdrs, (char *)store->comment, strlength);
-	    }
-	    
-	else
-	    xdr_status = MB_NO;
-
-	/* set error if required */
-	if (xdr_status == MB_NO)
-		{
-		*error = MB_ERROR_WRITE_FAIL;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mbr_hsds2raw.c b/src/mbio/mbr_hsds2raw.c
deleted file mode 100644
index 2ab605e..0000000
--- a/src/mbio/mbr_hsds2raw.c
+++ /dev/null
@@ -1,1774 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbr_hsds2raw.c	6/20/01
- *	$Id: mbr_hsds2raw.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 2001-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbr_hsds2raw.c contains the functions for reading
- * multibeam data in the HSDS2RAW format.
- * These functions include:
- *   mbr_alm_hsds2raw	- allocate read/write memory
- *   mbr_dem_hsds2raw	- deallocate read/write memory
- *   mbr_rt_hsds2raw	- read and translate data
- *   mbr_wt_hsds2raw	- translate and write data
- *
- * Authors:	D. W. Caress
- * 		D. N. Chayes
- * Date:	June 20, 2001
- * $Log: mbr_hsds2raw.c,v $
- * Revision 5.12  2007/10/08 15:59:34  caress
- * MBIO changes as of 8 October 2007.
- *
- * Revision 5.11  2005/11/05 00:48:05  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.10  2003/05/20 18:05:32  caress
- * Added svp_source to data source parameters.
- *
- * Revision 5.9  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.8  2003/02/27 04:33:33  caress
- * Fixed handling of SURF format data.
- *
- * Revision 5.7  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.6  2002/07/20 20:42:40  caress
- * Release 5.0.beta20
- *
- * Revision 5.5  2002/04/06 02:43:39  caress
- * Release 5.0.beta16
- *
- * Revision 5.4  2001/12/18 04:27:45  caress
- * Release 5.0.beta11.
- *
- * Revision 5.3  2001/08/10 22:41:19  dcaress
- * Release 5.0.beta07
- *
- * Revision 5.2  2001-07-25 20:40:56-07  caress
- * Fixed handling of sidescan.
- *
- * Revision 5.1  2001/07/20 00:32:54  caress
- * Release 5.0.beta03
- *
- * Revision 5.0  2001/06/29  22:49:07  caress
- * Added support for HSDS2RAW
- *
- *
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_define.h"
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mbsys_atlas.h"
-
-/* turn on debug statements here */
-/* #define MBR_HSDS2RAW_DEBUG 1 */
-
-/* essential function prototypes */
-int mbr_register_hsds2raw(int verbose, void *mbio_ptr,
-		int *error);
-int mbr_info_hsds2raw(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_alm_hsds2raw(int verbose, void *mbio_ptr, int *error);
-int mbr_dem_hsds2raw(int verbose, void *mbio_ptr, int *error);
-int mbr_rt_hsds2raw(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_wt_hsds2raw(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_hsds2raw_rd_data(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_hsds2raw_wr_data(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-
-static char rcs_id[]="$Id: mbr_hsds2raw.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mbr_register_hsds2raw(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_register_hsds2raw";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* get mb_io_ptr */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set format info parameters */
-	status = mbr_info_hsds2raw(verbose,
-			&mb_io_ptr->system,
-			&mb_io_ptr->beams_bath_max,
-			&mb_io_ptr->beams_amp_max,
-			&mb_io_ptr->pixels_ss_max,
-			mb_io_ptr->format_name,
-			mb_io_ptr->system_name,
-			mb_io_ptr->format_description,
-			&mb_io_ptr->numfile,
-			&mb_io_ptr->filetype,
-			&mb_io_ptr->variable_beams,
-			&mb_io_ptr->traveltime,
-			&mb_io_ptr->beam_flagging,
-			&mb_io_ptr->nav_source,
-			&mb_io_ptr->heading_source,
-			&mb_io_ptr->vru_source,
-			&mb_io_ptr->svp_source,
-			&mb_io_ptr->beamwidth_xtrack,
-			&mb_io_ptr->beamwidth_ltrack,
-			error);
-
-	/* set format and system specific function pointers */
-	mb_io_ptr->mb_io_format_alloc = &mbr_alm_hsds2raw;
-	mb_io_ptr->mb_io_format_free = &mbr_dem_hsds2raw;
-	mb_io_ptr->mb_io_store_alloc = &mbsys_atlas_alloc;
-	mb_io_ptr->mb_io_store_free = &mbsys_atlas_deall;
-	mb_io_ptr->mb_io_read_ping = &mbr_rt_hsds2raw;
-	mb_io_ptr->mb_io_write_ping = &mbr_wt_hsds2raw;
-	mb_io_ptr->mb_io_dimensions = &mbsys_atlas_dimensions;
-	mb_io_ptr->mb_io_extract = &mbsys_atlas_extract;
-	mb_io_ptr->mb_io_insert = &mbsys_atlas_insert;
-	mb_io_ptr->mb_io_extract_nav = &mbsys_atlas_extract_nav;
-	mb_io_ptr->mb_io_insert_nav = &mbsys_atlas_insert_nav;
-	mb_io_ptr->mb_io_extract_altitude = &mbsys_atlas_extract_altitude;
-	mb_io_ptr->mb_io_insert_altitude = NULL;
-	mb_io_ptr->mb_io_extract_svp = NULL;
-	mb_io_ptr->mb_io_insert_svp = NULL;
-	mb_io_ptr->mb_io_ttimes = &mbsys_atlas_ttimes;
-	mb_io_ptr->mb_io_detects = &mbsys_atlas_detects;
-	mb_io_ptr->mb_io_copyrecord = &mbsys_atlas_copy;
-	mb_io_ptr->mb_io_extract_rawss = NULL;
-	mb_io_ptr->mb_io_insert_rawss = NULL;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",mb_io_ptr->system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",mb_io_ptr->beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",mb_io_ptr->beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",mb_io_ptr->pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",mb_io_ptr->format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",mb_io_ptr->system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",mb_io_ptr->format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",mb_io_ptr->numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",mb_io_ptr->filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",mb_io_ptr->variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",mb_io_ptr->traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",mb_io_ptr->beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",mb_io_ptr->nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",mb_io_ptr->heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",mb_io_ptr->vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",mb_io_ptr->svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",mb_io_ptr->beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",mb_io_ptr->beamwidth_ltrack);
-		fprintf(stderr,"dbg2       format_alloc:       %p\n",(void *)mb_io_ptr->mb_io_format_alloc);
-		fprintf(stderr,"dbg2       format_free:        %p\n",(void *)mb_io_ptr->mb_io_format_free);
-		fprintf(stderr,"dbg2       store_alloc:        %p\n",(void *)mb_io_ptr->mb_io_store_alloc);
-		fprintf(stderr,"dbg2       store_free:         %p\n",(void *)mb_io_ptr->mb_io_store_free);
-		fprintf(stderr,"dbg2       read_ping:          %p\n",(void *)mb_io_ptr->mb_io_read_ping);
-		fprintf(stderr,"dbg2       write_ping:         %p\n",(void *)mb_io_ptr->mb_io_write_ping);
-		fprintf(stderr,"dbg2       extract:            %p\n",(void *)mb_io_ptr->mb_io_extract);
-		fprintf(stderr,"dbg2       insert:             %p\n",(void *)mb_io_ptr->mb_io_insert);
-		fprintf(stderr,"dbg2       extract_nav:        %p\n",(void *)mb_io_ptr->mb_io_extract_nav);
-		fprintf(stderr,"dbg2       insert_nav:         %p\n",(void *)mb_io_ptr->mb_io_insert_nav);
-		fprintf(stderr,"dbg2       extract_altitude:   %p\n",(void *)mb_io_ptr->mb_io_extract_altitude);
-		fprintf(stderr,"dbg2       insert_altitude:    %p\n",(void *)mb_io_ptr->mb_io_insert_altitude);
-		fprintf(stderr,"dbg2       extract_svp:        %p\n",(void *)mb_io_ptr->mb_io_extract_svp);
-		fprintf(stderr,"dbg2       insert_svp:         %p\n",(void *)mb_io_ptr->mb_io_insert_svp);
-		fprintf(stderr,"dbg2       ttimes:             %p\n",(void *)mb_io_ptr->mb_io_ttimes);
-		fprintf(stderr,"dbg2       detects:            %p\n",(void *)mb_io_ptr->mb_io_detects);
-		fprintf(stderr,"dbg2       extract_rawss:      %p\n",(void *)mb_io_ptr->mb_io_extract_rawss);
-		fprintf(stderr,"dbg2       insert_rawss:       %p\n",(void *)mb_io_ptr->mb_io_insert_rawss);
-		fprintf(stderr,"dbg2       copyrecord:         %p\n",(void *)mb_io_ptr->mb_io_copyrecord);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbr_info_hsds2raw(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error)
-{
-	char	*function_name = "mbr_info_hsds2raw";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* set format info parameters */
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-	*system = MB_SYS_ATLAS;
-	*beams_bath_max = MBSYS_ATLAS_MAXBEAMS;
-	*beams_amp_max = MBSYS_ATLAS_MAXBEAMS;
-	*pixels_ss_max = MBSYS_ATLAS_MAXPIXELS;
-	strncpy(format_name, "HSDS2RAW", MB_NAME_LENGTH);
-	strncpy(system_name, "ATLAS", MB_NAME_LENGTH);
-	strncpy(format_description, "Format name:          MBF_HSDS2RAW\nInformal Description: STN Atlas raw multibeam format\nAttributes:           STN Atlas multibeam sonars, \n                      Hydrosweep DS2, Hydrosweep MD, \n                      Fansweep 10, Fansweep 20, \n                      bathymetry, amplitude, and sidescan,\n                      up to 1440 beams and 4096 pixels,\n                      XDR binary, STN Atlas.\n", MB_DESCRIPTION_LENGTH);
-	*numfile = -3;
-	*filetype = MB_FILETYPE_XDR;
-	*variable_beams = MB_YES;
-	*traveltime = MB_YES;
-	*beam_flagging = MB_YES;
-	*nav_source = MB_DATA_DATA;
-	*heading_source = MB_DATA_DATA;
-	*vru_source = MB_DATA_DATA;
-	*svp_source = MB_DATA_VELOCITY_PROFILE;
-	*beamwidth_xtrack = 2.67;
-	*beamwidth_ltrack = 2.67;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",*system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",*beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",*beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",*pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",*numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",*filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",*variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",*traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",*beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",*nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",*heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",*vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",*svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",*beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",*beamwidth_ltrack);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_alm_hsds2raw(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_alm_hsds2raw";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set initial status */
-	status = MB_SUCCESS;
-
-	/* allocate memory for data structure */
-	mb_io_ptr->structure_size = 0;
-	mb_io_ptr->data_structure_size = 0;
-	status = mbsys_atlas_alloc(
-			verbose,mbio_ptr,
-			&mb_io_ptr->store_data,error);
-
-	/* set name for navigation and angle files */
-	if (status == MB_SUCCESS)
-		{
-		if (strlen(mb_io_ptr->file) >= 5
-		    && strncmp(&(mb_io_ptr->file[strlen(mb_io_ptr->file)-4]),
-				".fsw", 4) == 0)
-			{
-			strcpy(mb_io_ptr->file2,mb_io_ptr->file);
-			strcpy(&(mb_io_ptr->file2[strlen(mb_io_ptr->file)-4]),
-				".nav");
-			}
-		if (strlen(mb_io_ptr->file) >= 5
-		    && strncmp(&(mb_io_ptr->file[strlen(mb_io_ptr->file)-4]),
-				".fsw", 4) == 0)
-			{
-			strcpy(mb_io_ptr->file3,mb_io_ptr->file);
-			strcpy(&(mb_io_ptr->file3[strlen(mb_io_ptr->file)-4]),
-				".ang");
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_dem_hsds2raw(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_dem_hsds2raw";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointers to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* deallocate memory for data descriptor */
-	status = mbsys_atlas_deall(
-			verbose,mbio_ptr,
-			&mb_io_ptr->store_data,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_rt_hsds2raw(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_rt_hsds2raw";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_atlas_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointers to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* read next data from file */
-	status = mbr_hsds2raw_rd_data(verbose,mbio_ptr,store_ptr,error);
-
-	/* get pointers to data structures */
-	store = (struct mbsys_atlas_struct *) store_ptr;
-
-	/* set error and kind in mb_io_ptr */
-	mb_io_ptr->new_error = *error;
-	mb_io_ptr->new_kind = store->kind;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_wt_hsds2raw(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_wt_hsds2raw";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_atlas_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_atlas_struct *) store_ptr;
-
-	/* write next data to file */
-	/* status = mbr_hsds2raw_wr_data(verbose,mbio_ptr,store_ptr,error); */
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_hsds2raw_rd_data(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_hsds2raw_rd_data";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_atlas_struct *store;
-	int	xdr_status;
-	int	read_status;
-	int	nskip;
-	int	done;
-	int	length;
-	int	telegram_id;
-	int	telegram_cnt;
-	char	telegram_send[16];
-	char	telegram_recv[16];
-	double	telegram_utc_time_d;
-	double	telegram_loc_time_d;
-	int	telegram_block_no;
-	int	telegram_block_cnt;
-	int	telegram_max_no;
-	int	telegram_act_no;
-	int	telegram_data_status;
-	int	telegram_sensor_status;
-	int	tt_max_lead_cnt;
-	int	tt_act_lead_cnt;
-	int	ss_act_side_cnt;
-
-	char	carrier_name[8];
-	char	task_name[16];
-	char	operator_name[32];
-	char	gauge_name[32];
-	char	comment[32];
-	char	profile_name[32];
-	int	profile_version;
-	double	sys_pos_lat;
-	double	sys_pos_lon;
-	char	sys_pos_sensor[8];
-	double	sys_pos_lat_tpe;
-	double	sys_pos_lon_tpe;
-	double	sys_pos_time;
-	int	sys_pos_data_status;
-	int	sys_pos_status;
-	double	sys_height;
-	char	sys_height_sensor[8];
-	double	sys_height_time;
-	int	sys_height_data_status;
-	int	sys_height_status;
-	double	sys_speed_wlong;
-	double	sys_speed_wcross;
-	char	sys_tw_sensor[8];
-	double	sys_tw_time;
-	int	sys_tw_data_status;
-	int	sys_tw_status;
-	double	sys_cog;
-	char	sys_cog_sensor[8];
-	double	sys_cog_time;
-	int	sys_cog_data_status;
-	int	sys_cog_status;
-	double	sys_sog;
-	char	sys_sog_sensor[8];
-	double	sys_sog_time;
-	int	sys_sog_data_status;
-	int	sys_sog_status;
-	double	sys_set;
-	double	sys_drift;
-	char	sys_set_drift_sensor[8];
-	double	sys_set_drift_time;
-	int	sys_set_drift_data_status;
-	int	sys_set_drift_status;
-	double	sys_heading;
-	char	sys_heading_sensor[8];
-	double	sys_heading_time;
-	int	sys_heading_data_status;
-	int	sys_heading_status;
-	double	sys_depth;
-	char	sys_depth_sensor[8];
-	double	sys_depth_water_level;
-	double	sys_depth_time;
-	int	sys_depth_data_status;
-	int	sys_depth_status;
-	double	sys_wspeed_abs;
-	double	sys_wdir_abs;
-	char	sys_wind_sensor[8];
-	double	sys_wind_time;
-	int	sys_wind_data_status;
-	int	sys_wind_status;
-
-	double	rr;
-	double  pspeed;
-	double	*angle_table;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_atlas_struct *) store_ptr;
-
-	/* set file position */
-	mb_io_ptr->file_pos = mb_io_ptr->file_bytes;
-
-	/* read the next record (start telegram + travel time telegrams
-	    + sidescan telegrams +  */
-	*error = MB_ERROR_NO_ERROR;
-
-	/* get start telegram */
-	xdr_status = xdr_int((XDR *)mb_io_ptr->xdrs, &telegram_id);
-
-	/* telegram id ok - just read send and receive strings */
-	if (xdr_status == MB_YES && telegram_id == MBSYS_ATLAS_TELEGRAM_START)
-	    {
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_int((XDR *)mb_io_ptr->xdrs, &telegram_cnt);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_int((XDR *)mb_io_ptr->xdrs, &length);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_opaque((XDR *)mb_io_ptr->xdrs, (char *)telegram_send, 16);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_int((XDR *)mb_io_ptr->xdrs, &length);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_opaque((XDR *)mb_io_ptr->xdrs, (char *)telegram_recv, 16);
-	    }
-
-	/* expected telegram id wrong - try to resync on recv string */
-	else if (xdr_status == MB_YES)
-	    {
-	    memset(telegram_recv, 0, 16);
-	    read_status = 1;
-	    nskip = 0;
-	    while (strncmp(telegram_recv, "BROADCAST", 9) != 0
-		&& read_status == 1)
-		{
-		for (i=0;i<15;i++)
-		    telegram_recv[i] = telegram_recv[i+1];
-		if ((read_status = fread(&(telegram_recv[15]), 1, 1, mb_io_ptr->mbfp)) == 1)
-		    nskip++;
-		}
-	    if (read_status == MB_YES)
-		{
-		fprintf(stderr, "Resync on START telegram: %d missing bytes\n",
-			(44 - nskip));
-		}
-	    else
-		{
-		xdr_status = MB_NO;
-		}
-	    }
-
-	/* hopefully we are synced - read the telegram */
-	if (xdr_status == MB_YES)
-	    xdr_status = xdr_double((XDR *)mb_io_ptr->xdrs, &telegram_utc_time_d);
-	if (xdr_status == MB_YES)
-	    xdr_status = xdr_double((XDR *)mb_io_ptr->xdrs, &telegram_loc_time_d);
-	if (xdr_status == MB_YES)
-	    xdr_status = xdr_int((XDR *)mb_io_ptr->xdrs, &telegram_block_no);
-	if (xdr_status == MB_YES)
-	    xdr_status = xdr_int((XDR *)mb_io_ptr->xdrs, &telegram_block_cnt);
-	if (xdr_status == MB_YES)
-	    xdr_status = xdr_u_int((XDR *)mb_io_ptr->xdrs, &store->start_ping_no);
-	if (xdr_status == MB_YES)
-	    xdr_status = xdr_double((XDR *)mb_io_ptr->xdrs, &store->start_transmit_time_d);
-	if (xdr_status == MB_YES)
-	    xdr_status = xdr_int((XDR *)mb_io_ptr->xdrs, &length);
-	if (xdr_status == MB_YES)
-	    xdr_status = xdr_opaque((XDR *)mb_io_ptr->xdrs, (char *) store->start_opmode, 32);
-	if (xdr_status == MB_YES)
-	    xdr_status = xdr_double((XDR *)mb_io_ptr->xdrs, &store->start_heave);
-	if (xdr_status == MB_YES)
-	    xdr_status = xdr_double((XDR *)mb_io_ptr->xdrs, &store->start_roll);
-	if (xdr_status == MB_YES)
-	    xdr_status = xdr_double((XDR *)mb_io_ptr->xdrs, &store->start_pitch);
-	if (xdr_status == MB_YES)
-	    xdr_status = xdr_double((XDR *)mb_io_ptr->xdrs, &store->start_heading);
-	if (xdr_status == MB_YES)
-	    xdr_status = xdr_double((XDR *)mb_io_ptr->xdrs, &store->start_ckeel);
-	if (xdr_status == MB_YES)
-	    xdr_status = xdr_double((XDR *)mb_io_ptr->xdrs, &store->start_cmean);
-	if (xdr_status == MB_YES)
-	    xdr_status = xdr_double((XDR *)mb_io_ptr->xdrs, &store->start_depth_min);
-	if (xdr_status == MB_YES)
-	    xdr_status = xdr_double((XDR *)mb_io_ptr->xdrs, &store->start_depth_max);
-	if (xdr_status == MB_YES)
-	    xdr_status = xdr_int((XDR *)mb_io_ptr->xdrs, &telegram_data_status);
-	if (xdr_status == MB_YES)
-	    xdr_status = xdr_int((XDR *)mb_io_ptr->xdrs, &telegram_sensor_status);
-
-	/* print debug statements */
-#ifndef MBR_HSDS2RAW_DEBUG
-	if (verbose >= 5)
-#endif
-		{
-		fprintf(stderr,"\ndbg5  Start telegram read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       xdr_status:              %d\n",xdr_status);
-		fprintf(stderr,"dbg5       telegram_id:             %d\n",telegram_id);
-		fprintf(stderr,"dbg5       telegram_cnt:            %d\n",telegram_cnt);
-		fprintf(stderr,"dbg5       telegram_send:           %s\n",telegram_send);
-		fprintf(stderr,"dbg5       telegram_recv:           %s\n",telegram_recv);
-		fprintf(stderr,"dbg5       telegram_utc_time_d:     %f\n",telegram_utc_time_d);
-		fprintf(stderr,"dbg5       telegram_loc_time_d:     %f\n",telegram_utc_time_d);
-		fprintf(stderr,"dbg5       telegram_block_no:       %d\n",telegram_block_no);
-		fprintf(stderr,"dbg5       telegram_block_cnt:      %d\n",telegram_block_cnt);
-		fprintf(stderr,"dbg5       start_ping_no:           %d\n",store->start_ping_no);
-		fprintf(stderr,"dbg5       start_transmit_time_d:   %f\n",store->start_transmit_time_d);
-		fprintf(stderr,"dbg5       start_opmode:            ");
-		for (i=0;i<32;i++)
-		    fprintf(stderr," %d",store->start_opmode[i]);
-		fprintf(stderr,"\n");
-		fprintf(stderr,"dbg5       start_heave:             %f\n",store->start_heave);
-		fprintf(stderr,"dbg5       start_roll:              %f\n",store->start_roll);
-		fprintf(stderr,"dbg5       start_pitch:             %f\n",store->start_pitch);
-		fprintf(stderr,"dbg5       start_heading:           %f\n",store->start_heading);
-		fprintf(stderr,"dbg5       start_ckeel:             %f\n",store->start_ckeel);
-		fprintf(stderr,"dbg5       start_cmean:             %f\n",store->start_cmean);
-		fprintf(stderr,"dbg5       start_depth_min:         %f\n",store->start_depth_min);
-		fprintf(stderr,"dbg5       start_depth_max:         %f\n",store->start_depth_max);
-		}
-
-	/* get travel times telegrams */
-	done = MB_NO;
-	store->tt_beam_cnt = 0;
-	while (xdr_status == MB_YES && done == MB_NO)
-		{
-		if (xdr_status == MB_YES)
-		    xdr_status = xdr_int((XDR *)mb_io_ptr->xdrs, &telegram_id);
-
-		/* telegram id ok - just read send and receive strings */
-		if (xdr_status == MB_YES && telegram_id == MBSYS_ATLAS_TELEGRAM_TRAVELTIMES)
-		    {
-		    if (xdr_status == MB_YES)
-			xdr_status = xdr_int((XDR *)mb_io_ptr->xdrs, &telegram_cnt);
-		    if (xdr_status == MB_YES)
-			xdr_status = xdr_int((XDR *)mb_io_ptr->xdrs, &length);
-		    if (xdr_status == MB_YES)
-			xdr_status = xdr_opaque((XDR *)mb_io_ptr->xdrs, (char *)telegram_send, 16);
-		    if (xdr_status == MB_YES)
-			xdr_status = xdr_int((XDR *)mb_io_ptr->xdrs, &length);
-		    if (xdr_status == MB_YES)
-			xdr_status = xdr_opaque((XDR *)mb_io_ptr->xdrs, (char *)telegram_recv, 16);
-		    }
-
-		/* expected telegram id wrong - try to resync on recv string */
-		else if (xdr_status == MB_YES)
-		    {
-		    memset(telegram_recv, 0, 16);
-		    read_status = 1;
-		    nskip = 0;
-		    while (strncmp(telegram_recv, "BROADCAST", 9) != 0
-			&& read_status == 1)
-			{
-			for (i=0;i<15;i++)
-			    telegram_recv[i] = telegram_recv[i+1];
-			if ((read_status = fread(&(telegram_recv[15]), 1, 1, mb_io_ptr->mbfp)) == 1)
-			    nskip++;
-			}
-		    if (read_status == MB_YES)
-			{
-			fprintf(stderr, "Resync on TRAVELTIMES telegram: %d missing bytes\n",
-				(44 - nskip));
-			}
-		    else
-			{
-			xdr_status = MB_NO;
-			}
-		    }
-
-		/* hopefully we are synced - read the telegram */
-		if (xdr_status == MB_YES)
-		    xdr_status = xdr_double((XDR *)mb_io_ptr->xdrs, &telegram_utc_time_d);
-		if (xdr_status == MB_YES)
-		    xdr_status = xdr_double((XDR *)mb_io_ptr->xdrs, &telegram_loc_time_d);
-		if (xdr_status == MB_YES)
-		    xdr_status = xdr_int((XDR *)mb_io_ptr->xdrs, &telegram_block_no);
-		if (xdr_status == MB_YES)
-		    xdr_status = xdr_int((XDR *)mb_io_ptr->xdrs, &telegram_block_cnt);
-		if (xdr_status == MB_YES)
-		    xdr_status = xdr_int((XDR *)mb_io_ptr->xdrs, &telegram_max_no);
-		if (xdr_status == MB_YES)
-		    xdr_status = xdr_int((XDR *)mb_io_ptr->xdrs, &telegram_act_no);
-		if (xdr_status == MB_YES)
-		    xdr_status = xdr_int((XDR *)mb_io_ptr->xdrs, &telegram_data_status);
-		if (xdr_status == MB_YES)
-		    xdr_status = xdr_int((XDR *)mb_io_ptr->xdrs, &telegram_sensor_status);
-		if (xdr_status == MB_YES)
-		    xdr_status = xdr_u_int((XDR *)mb_io_ptr->xdrs, &store->tt_ping_no);
-		if (xdr_status == MB_YES)
-		    xdr_status = xdr_double((XDR *)mb_io_ptr->xdrs, &store->tt_transmit_time_d);
-		if (xdr_status == MB_YES)
-		    xdr_status = xdr_int((XDR *)mb_io_ptr->xdrs, &store->tt_beam_table_index);
-		if (xdr_status == MB_YES)
-		    xdr_status = xdr_int((XDR *)mb_io_ptr->xdrs, &tt_max_lead_cnt);
-		if (xdr_status == MB_YES)
-		    xdr_status = xdr_int((XDR *)mb_io_ptr->xdrs, &tt_act_lead_cnt);
-		store->tt_beam_cnt += tt_act_lead_cnt;
-		if (xdr_status == MB_YES)
-		    xdr_status = xdr_int((XDR *)mb_io_ptr->xdrs, &store->tt_long1);
-		if (xdr_status == MB_YES)
-		    xdr_status = xdr_int((XDR *)mb_io_ptr->xdrs, &store->tt_long2);
-		if (xdr_status == MB_YES)
-		    xdr_status = xdr_int((XDR *)mb_io_ptr->xdrs, &store->tt_long3);
-		if (xdr_status == MB_YES)
-		    xdr_status = xdr_int((XDR *)mb_io_ptr->xdrs, &store->tt_xdraught);
-		if (xdr_status == MB_YES)
-		    xdr_status = xdr_double((XDR *)mb_io_ptr->xdrs, &store->tt_double1);
-		if (xdr_status == MB_YES)
-		    xdr_status = xdr_double((XDR *)mb_io_ptr->xdrs, &store->tt_double2);
-		if (xdr_status == MB_YES)
-		    xdr_status = xdr_double((XDR *)mb_io_ptr->xdrs, &store->tt_sensdraught);
-		if (xdr_status == MB_YES)
-		    xdr_status = xdr_double((XDR *)mb_io_ptr->xdrs, &store->tt_draught);
-		for (i=0;i<MBSYS_ATLAS_MAXBEAMTELEGRAM;i++)
-		    {
-		    if (xdr_status == MB_YES)
-			xdr_status = xdr_float((XDR *)mb_io_ptr->xdrs, &(store->tt_lruntime[i]));
-		    }
-		if (xdr_status == MB_YES)
-		    xdr_status = xdr_int((XDR *)mb_io_ptr->xdrs, &length);
-		if (xdr_status == MB_YES)
-		    xdr_status = xdr_opaque((XDR *)mb_io_ptr->xdrs, (char *)store->tt_lamplitude,
-						MBSYS_ATLAS_MAXBEAMTELEGRAM);
-		if (xdr_status == MB_YES)
-		    xdr_status = xdr_int((XDR *)mb_io_ptr->xdrs, &length);
-		if (xdr_status == MB_YES)
-		    xdr_status = xdr_opaque((XDR *)mb_io_ptr->xdrs, (char *)store->tt_lstatus,
-						MBSYS_ATLAS_MAXBEAMTELEGRAM);
-
-		/* set done if done */
-		if (xdr_status != MB_YES
-		    || telegram_act_no == telegram_max_no)
-		    done = MB_YES;
-
-		/* print debug statements */
-#ifndef MBR_HSDS2RAW_DEBUG
-		if (verbose >= 5)
-#endif
-			{
-			fprintf(stderr,"\ndbg5  Travel time telegrams read in MBIO function <%s>\n",function_name);
-			fprintf(stderr,"dbg5       xdr_status:              %d\n",xdr_status);
-			fprintf(stderr,"dbg5       telegram_id:             %d\n",telegram_id);
-			fprintf(stderr,"dbg5       telegram_cnt:            %d\n",telegram_cnt);
-			fprintf(stderr,"dbg5       telegram_send:           %s\n",telegram_send);
-			fprintf(stderr,"dbg5       telegram_recv:           %s\n",telegram_recv);
-			fprintf(stderr,"dbg5       telegram_utc_time_d:     %f\n",telegram_utc_time_d);
-			fprintf(stderr,"dbg5       telegram_loc_time_d:     %f\n",telegram_utc_time_d);
-			fprintf(stderr,"dbg5       telegram_block_no:       %d\n",telegram_block_no);
-			fprintf(stderr,"dbg5       telegram_block_cnt:      %d\n",telegram_block_cnt);
-			fprintf(stderr,"dbg5       telegram_max_no:         %d\n",telegram_max_no);
-			fprintf(stderr,"dbg5       telegram_act_no:         %d\n",telegram_act_no);
-			fprintf(stderr,"dbg5       telegram_data_status:    %d\n",telegram_data_status);
-			fprintf(stderr,"dbg5       telegram_sensor_status:  %d\n",telegram_sensor_status);
-			}
-		}
-
-	/* print debug statements */
-#ifndef MBR_HSDS2RAW_DEBUG
-	if (verbose >= 5)
-#endif
-		{
-		fprintf(stderr,"\ndbg5  Travel time telegrams read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       xdr_status:              %d\n",xdr_status);
-		fprintf(stderr,"dbg5       tt_ping_no:              %d\n",store->tt_ping_no);
-		fprintf(stderr,"dbg5       tt_transmit_time_d:      %f\n",store->tt_transmit_time_d);
-		fprintf(stderr,"dbg5       tt_beam_table_index:     %d\n",store->tt_beam_table_index);
-		fprintf(stderr,"dbg5       tt_beam_cnt:             %d\n",store->tt_beam_cnt);
-		fprintf(stderr,"dbg5       tt_long1:                %d\n",store->tt_long1);
-		fprintf(stderr,"dbg5       tt_long2:                %d\n",store->tt_long2);
-		fprintf(stderr,"dbg5       tt_long3:                %d\n",store->tt_long3);
-		fprintf(stderr,"dbg5       tt_xdraught:             %d\n",store->tt_xdraught);
-		fprintf(stderr,"dbg5       tt_double1:              %f\n",store->tt_double1);
-		fprintf(stderr,"dbg5       tt_double2:              %f\n",store->tt_double2);
-		fprintf(stderr,"dbg5       tt_sensdraught:          %f\n",store->tt_sensdraught);
-		fprintf(stderr,"dbg5       tt_draught:              %f\n",store->tt_draught);
-		if (verbose > 0)
-		for (i=0;i<MBSYS_ATLAS_MAXBEAMS;i++)
-			fprintf(stderr,"dbg5       beam[%d] tt amp stat:    %12f %3d %3d\n",
-				i, store->tt_lruntime[i], store->tt_lamplitude[i], store->tt_lstatus[i]);
-		}
-
-	/* get sidescan telegrams */
-	done = MB_NO;
-	while (xdr_status == MB_YES && done == MB_NO)
-		{
-		if (xdr_status == MB_YES)
-		    xdr_status = xdr_int((XDR *)mb_io_ptr->xdrs, &telegram_id);
-
-		/* telegram id ok - just read send and receive strings */
-		if (xdr_status == MB_YES && telegram_id == MBSYS_ATLAS_TELEGRAM_SIDESCAN)
-		    {
-		    if (xdr_status == MB_YES)
-			xdr_status = xdr_int((XDR *)mb_io_ptr->xdrs, &telegram_cnt);
-		    if (xdr_status == MB_YES)
-			xdr_status = xdr_int((XDR *)mb_io_ptr->xdrs, &length);
-		    if (xdr_status == MB_YES)
-			xdr_status = xdr_opaque((XDR *)mb_io_ptr->xdrs, (char *)telegram_send, 16);
-		    if (xdr_status == MB_YES)
-			xdr_status = xdr_int((XDR *)mb_io_ptr->xdrs, &length);
-		    if (xdr_status == MB_YES)
-			xdr_status = xdr_opaque((XDR *)mb_io_ptr->xdrs, (char *)telegram_recv, 16);
-		    }
-
-		/* expected telegram id wrong - try to resync on recv string */
-		else if (xdr_status == MB_YES)
-		    {
-		    memset(telegram_recv, 0, 16);
-		    read_status = 1;
-		    nskip = 0;
-		    while (strncmp(telegram_recv, "BROADCAST", 9) != 0
-			&& read_status == 1)
-			{
-			for (i=0;i<15;i++)
-			    telegram_recv[i] = telegram_recv[i+1];
-			if ((read_status = fread(&(telegram_recv[15]), 1, 1, mb_io_ptr->mbfp)) == 1)
-			    nskip++;
-			}
-		    if (read_status == MB_YES)
-			{
-			fprintf(stderr, "Resync on SIDESCAN telegram: %d missing bytes\n",
-				(44 - nskip));
-			}
-		    else
-			{
-			xdr_status = MB_NO;
-			}
-		    }
-
-		/* hopefully we are synced - read the telegram */
-		if (xdr_status == MB_YES)
-		    xdr_status = xdr_double((XDR *)mb_io_ptr->xdrs, &telegram_utc_time_d);
-		if (xdr_status == MB_YES)
-		    xdr_status = xdr_double((XDR *)mb_io_ptr->xdrs, &telegram_loc_time_d);
-		if (xdr_status == MB_YES)
-		    xdr_status = xdr_int((XDR *)mb_io_ptr->xdrs, &telegram_block_no);
-		if (xdr_status == MB_YES)
-		    xdr_status = xdr_int((XDR *)mb_io_ptr->xdrs, &telegram_block_cnt);
-		if (xdr_status == MB_YES)
-		    xdr_status = xdr_int((XDR *)mb_io_ptr->xdrs, &telegram_max_no);
-		if (xdr_status == MB_YES)
-		    xdr_status = xdr_int((XDR *)mb_io_ptr->xdrs, &telegram_act_no);
-		if (xdr_status == MB_YES)
-		    xdr_status = xdr_int((XDR *)mb_io_ptr->xdrs, &telegram_data_status);
-		if (xdr_status == MB_YES)
-		    xdr_status = xdr_int((XDR *)mb_io_ptr->xdrs, &telegram_sensor_status);
-		if (xdr_status == MB_YES)
-		    xdr_status = xdr_u_int((XDR *)mb_io_ptr->xdrs, &store->ss_ping_no);
-		if (xdr_status == MB_YES)
-		    xdr_status = xdr_double((XDR *)mb_io_ptr->xdrs, &store->ss_transmit_time_d);
-		if (xdr_status == MB_YES)
-		    xdr_status = xdr_double((XDR *)mb_io_ptr->xdrs, &store->ss_timedelay);
-		if (xdr_status == MB_YES)
-		    xdr_status = xdr_double((XDR *)mb_io_ptr->xdrs, &store->ss_timespacing);
-		if (xdr_status == MB_YES)
-		    xdr_status = xdr_int((XDR *)mb_io_ptr->xdrs, &store->ss_max_side_bb_cnt);
-		if (xdr_status == MB_YES)
-		    xdr_status = xdr_int((XDR *)mb_io_ptr->xdrs, &store->ss_max_side_sb_cnt);
-		if (xdr_status == MB_YES)
-		    xdr_status = xdr_int((XDR *)mb_io_ptr->xdrs, &ss_act_side_cnt);
-		if (xdr_status == MB_YES)
-		    xdr_status = xdr_int((XDR *)mb_io_ptr->xdrs, &length);
-		if (xdr_status == MB_YES)
-			{
-			if (telegram_act_no * MBSYS_ATLAS_MAXPIXELTELEGRAM <= MBSYS_ATLAS_MAXPIXELS)
-			    i = (telegram_act_no - 1) * MBSYS_ATLAS_MAXPIXELTELEGRAM;
-			else
-			    i = 0;
-			xdr_status = xdr_opaque((XDR *)mb_io_ptr->xdrs, (char *)&(store->ss_sidescan[i]),
-						MBSYS_ATLAS_MAXPIXELTELEGRAM);
-			}
-
-		/* set done if done */
-		if (xdr_status != MB_YES
-		    || telegram_act_no == telegram_max_no)
-		    done = MB_YES;
-
-		/* print debug statements */
-#ifndef MBR_HSDS2RAW_DEBUG
-		if (verbose >= 5)
-#endif
-			{
-			fprintf(stderr,"\ndbg5  Sidescan telegram read in MBIO function <%s>\n",function_name);
-			fprintf(stderr,"dbg5       xdr_status:              %d\n",xdr_status);
-			fprintf(stderr,"dbg5       telegram_id:             %d\n",telegram_id);
-			fprintf(stderr,"dbg5       telegram_cnt:            %d\n",telegram_cnt);
-			fprintf(stderr,"dbg5       telegram_send:           %s\n",telegram_send);
-			fprintf(stderr,"dbg5       telegram_recv:           %s\n",telegram_recv);
-			fprintf(stderr,"dbg5       telegram_utc_time_d:     %f\n",telegram_utc_time_d);
-			fprintf(stderr,"dbg5       telegram_loc_time_d:     %f\n",telegram_utc_time_d);
-			fprintf(stderr,"dbg5       telegram_block_no:       %d\n",telegram_block_no);
-			fprintf(stderr,"dbg5       telegram_block_cnt:      %d\n",telegram_block_cnt);
-			fprintf(stderr,"dbg5       telegram_max_no:         %d\n",telegram_max_no);
-			fprintf(stderr,"dbg5       telegram_act_no:         %d\n",telegram_act_no);
-			fprintf(stderr,"dbg5       telegram_data_status:    %d\n",telegram_data_status);
-			fprintf(stderr,"dbg5       telegram_sensor_status:  %d\n",telegram_sensor_status);
-			fprintf(stderr,"dbg5       ss_ping_no:              %d\n",store->ss_ping_no);
-			fprintf(stderr,"dbg5       ss_transmit_time_d:      %f\n",store->ss_transmit_time_d);
-			}
-		}
-
-	/* print debug statements */
-#ifndef MBR_HSDS2RAW_DEBUG
-	if (verbose >= 5)
-#endif
-		{
-		fprintf(stderr,"\ndbg5  Sidescan telegrams read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       xdr_status:              %d\n",xdr_status);
-		fprintf(stderr,"dbg5       ss_ping_no:              %d\n",store->ss_ping_no);
-		fprintf(stderr,"dbg5       ss_transmit_time_d:      %f\n",store->ss_transmit_time_d);
-		fprintf(stderr,"dbg5       ss_timedelay:            %f\n",store->ss_timedelay);
-		fprintf(stderr,"dbg5       ss_timespacing:          %f\n",store->ss_timespacing);
-		fprintf(stderr,"dbg5       ss_max_side_bb_cnt:      %d\n",store->ss_max_side_bb_cnt);
-		fprintf(stderr,"dbg5       ss_max_side_sb_cnt:      %d\n",store->ss_max_side_sb_cnt);
-		if (verbose > 0)
-		for (i=0;i<MBSYS_ATLAS_MAXPIXELS;i++)
-			fprintf(stderr,"dbg5       pixel[%d] ss:            %d\n",i, store->ss_sidescan[i]);
-		}
-
-	/* get tracking window telegram */
-	xdr_status = xdr_int((XDR *)mb_io_ptr->xdrs, &telegram_id);
-
-	/* telegram id ok - just read send and receive strings */
-	if (xdr_status == MB_YES && telegram_id == MBSYS_ATLAS_TELEGRAM_TRACKINGWINDOWS)
-	    {
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_int((XDR *)mb_io_ptr->xdrs, &telegram_cnt);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_int((XDR *)mb_io_ptr->xdrs, &length);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_opaque((XDR *)mb_io_ptr->xdrs, (char *)telegram_send, 16);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_int((XDR *)mb_io_ptr->xdrs, &length);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_opaque((XDR *)mb_io_ptr->xdrs, (char *)telegram_recv, 16);
-	    }
-
-	/* expected telegram id wrong - try to resync on recv string */
-	else if (xdr_status == MB_YES)
-	    {
-	    memset(telegram_recv, 0, 16);
-	    read_status = 1;
-	    nskip = 0;
-	    while (strncmp(telegram_recv, "BROADCAST", 9) != 0
-		&& read_status == 1)
-		{
-		for (i=0;i<15;i++)
-		    telegram_recv[i] = telegram_recv[i+1];
-		if ((read_status = fread(&(telegram_recv[15]), 1, 1, mb_io_ptr->mbfp)) == 1)
-		    nskip++;
-		}
-	    if (read_status == MB_YES)
-		{
-		fprintf(stderr, "Resync on TRACKINGWINDOWS telegram: %d missing bytes\n",
-			(44 - nskip));
-		}
-	    else
-		{
-		xdr_status = MB_NO;
-		}
-	    }
-
-	/* hopefully we are synced - read the telegram */
-	if (xdr_status == MB_YES)
-	    xdr_status = xdr_double((XDR *)mb_io_ptr->xdrs, &telegram_utc_time_d);
-	if (xdr_status == MB_YES)
-	    xdr_status = xdr_double((XDR *)mb_io_ptr->xdrs, &telegram_loc_time_d);
-	if (xdr_status == MB_YES)
-	    xdr_status = xdr_int((XDR *)mb_io_ptr->xdrs, &telegram_block_no);
-	if (xdr_status == MB_YES)
-	    xdr_status = xdr_int((XDR *)mb_io_ptr->xdrs, &telegram_block_cnt);
-	if (xdr_status == MB_YES)
-	    xdr_status = xdr_int((XDR *)mb_io_ptr->xdrs, &telegram_data_status);
-	if (xdr_status == MB_YES)
-	    xdr_status = xdr_int((XDR *)mb_io_ptr->xdrs, &telegram_sensor_status);
-	if (xdr_status == MB_YES)
-	    xdr_status = xdr_double((XDR *)mb_io_ptr->xdrs, &store->tr_transmit_time_d);
-	if (xdr_status == MB_YES)
-	    xdr_status = xdr_u_int((XDR *)mb_io_ptr->xdrs, &store->tr_ping_no);
-	if (xdr_status == MB_YES)
-	    xdr_status = xdr_int((XDR *)mb_io_ptr->xdrs, &store->tr_window_mode);
-	if (xdr_status == MB_YES)
-	    xdr_status = xdr_int((XDR *)mb_io_ptr->xdrs, &store->tr_no_of_win_groups);
-	for (i=0;i<100;i++)
-	    {
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_int((XDR *)mb_io_ptr->xdrs, &store->tr_repeat_count[i]);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_float((XDR *)mb_io_ptr->xdrs, &store->tr_start[i]);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_float((XDR *)mb_io_ptr->xdrs, &store->tr_stop[i]);
-	    }
-
-	/* print debug statements */
-#ifndef MBR_HSDS2RAW_DEBUG
-	if (verbose >= 5)
-#endif
-		{
-		fprintf(stderr,"\ndbg5  Tracking windows telegram read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       xdr_status:              %d\n",xdr_status);
-		fprintf(stderr,"dbg5       telegram_id:             %d\n",telegram_id);
-		fprintf(stderr,"dbg5       telegram_cnt:            %d\n",telegram_cnt);
-		fprintf(stderr,"dbg5       telegram_send:           %s\n",telegram_send);
-		fprintf(stderr,"dbg5       telegram_recv:           %s\n",telegram_recv);
-		fprintf(stderr,"dbg5       telegram_utc_time_d:     %f\n",telegram_utc_time_d);
-		fprintf(stderr,"dbg5       telegram_loc_time_d:     %f\n",telegram_utc_time_d);
-		fprintf(stderr,"dbg5       telegram_block_no:       %d\n",telegram_block_no);
-		fprintf(stderr,"dbg5       telegram_block_cnt:      %d\n",telegram_block_cnt);
-		fprintf(stderr,"dbg5       telegram_max_no:         %d\n",telegram_max_no);
-		fprintf(stderr,"dbg5       telegram_act_no:         %d\n",telegram_act_no);
-		fprintf(stderr,"dbg5       telegram_data_status:    %d\n",telegram_data_status);
-		fprintf(stderr,"dbg5       telegram_sensor_status:  %d\n",telegram_sensor_status);
-		fprintf(stderr,"dbg5       tr_ping_no:              %d\n",store->tr_ping_no);
-		fprintf(stderr,"dbg5       tr_transmit_time_d:      %f\n",store->tr_transmit_time_d);
-		fprintf(stderr,"dbg5       tr_window_mode:          %d\n",store->tr_window_mode);
-		fprintf(stderr,"dbg5       tr_no_of_win_groups:     %d\n",store->tr_no_of_win_groups);
-		if (verbose > 0)
-		for (i=0;i<MBSYS_ATLAS_MAXWINDOWS;i++)
-			{
-			fprintf(stderr,"dbg5       window[%d]:cnt start stop: %d %f %f\n",
-				i, store->tr_repeat_count[i], store->tr_start[i], store->tr_stop[i]);
-			}
-		}
-
-	/* get backscatter telegram */
-	xdr_status = xdr_int((XDR *)mb_io_ptr->xdrs, &telegram_id);
-
-	/* telegram id ok - just read send and receive strings */
-	if (xdr_status == MB_YES && telegram_id == MBSYS_ATLAS_TELEGRAM_BACKSCATTER)
-	    {
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_int((XDR *)mb_io_ptr->xdrs, &telegram_cnt);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_int((XDR *)mb_io_ptr->xdrs, &length);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_opaque((XDR *)mb_io_ptr->xdrs, (char *)telegram_send, 16);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_int((XDR *)mb_io_ptr->xdrs, &length);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_opaque((XDR *)mb_io_ptr->xdrs, (char *)telegram_recv, 16);
-	    }
-
-	/* expected telegram id wrong - try to resync on recv string */
-	else if (xdr_status == MB_YES)
-	    {
-	    memset(telegram_recv, 0, 16);
-	    read_status = 1;
-	    nskip = 0;
-	    while (strncmp(telegram_recv, "BROADCAST", 9) != 0
-		&& read_status == 1)
-		{
-		for (i=0;i<15;i++)
-		    telegram_recv[i] = telegram_recv[i+1];
-		if ((read_status = fread(&(telegram_recv[15]), 1, 1, mb_io_ptr->mbfp)) == 1)
-		    nskip++;
-		}
-	    if (read_status == MB_YES)
-		{
-		fprintf(stderr, "Resync on BACKSCATTER telegram: %d missing bytes\n",
-			(44 - nskip));
-		}
-	    else
-		{
-		xdr_status = MB_NO;
-		}
-	    }
-
-	/* hopefully we are synced - read the telegram */
-	if (xdr_status == MB_YES)
-	    xdr_status = xdr_double((XDR *)mb_io_ptr->xdrs, &telegram_utc_time_d);
-	if (xdr_status == MB_YES)
-	    xdr_status = xdr_double((XDR *)mb_io_ptr->xdrs, &telegram_loc_time_d);
-	if (xdr_status == MB_YES)
-	    xdr_status = xdr_int((XDR *)mb_io_ptr->xdrs, &telegram_block_no);
-	if (xdr_status == MB_YES)
-	    xdr_status = xdr_int((XDR *)mb_io_ptr->xdrs, &telegram_block_cnt);
-	if (xdr_status == MB_YES)
-	    xdr_status = xdr_int((XDR *)mb_io_ptr->xdrs, &telegram_data_status);
-	if (xdr_status == MB_YES)
-	    xdr_status = xdr_int((XDR *)mb_io_ptr->xdrs, &telegram_sensor_status);
-	if (xdr_status == MB_YES)
-	    xdr_status = xdr_double((XDR *)mb_io_ptr->xdrs, &store->bs_transmit_time_d);
-	if (xdr_status == MB_YES)
-	    xdr_status = xdr_int((XDR *)mb_io_ptr->xdrs, &store->bs_ping_no);
-	if (xdr_status == MB_YES)
-	    xdr_status = xdr_u_short((XDR *)mb_io_ptr->xdrs, &store->bs_nrActualGainSets);
-	if (xdr_status == MB_YES)
-	    xdr_status = xdr_float((XDR *)mb_io_ptr->xdrs, &store->bs_rxGup);
-	if (xdr_status == MB_YES)
-	    xdr_status = xdr_float((XDR *)mb_io_ptr->xdrs, &store->bs_rxGain);
-	if (xdr_status == MB_YES)
-	    xdr_status = xdr_float((XDR *)mb_io_ptr->xdrs, &store->bs_ar);
-	for (i=0;i<MBSYS_ATLAS_HSDS2_RX_PAR;i++)
-	    {
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_float((XDR *)mb_io_ptr->xdrs, &store->bs_TvgRx_time[i]);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_float((XDR *)mb_io_ptr->xdrs, &store->bs_TvgRx_gain[i]);
-	    }
-	if (xdr_status == MB_YES)
-	    xdr_status = xdr_u_short((XDR *)mb_io_ptr->xdrs, &store->bs_nrTxSets);
-	for (i=0;i<MBSYS_ATLAS_HSDS2_TX_PAR;i++)
-	    {
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_u_int((XDR *)mb_io_ptr->xdrs, &store->bs_txBeamIndex[i]);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_float((XDR *)mb_io_ptr->xdrs, &store->bs_txLevel[i]);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_float((XDR *)mb_io_ptr->xdrs, &store->bs_txBeamAngle[i]);
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_float((XDR *)mb_io_ptr->xdrs, &store->bs_pulseLength[i]);
-	    }
-	if (xdr_status == MB_YES)
-	    xdr_status = xdr_u_short((XDR *)mb_io_ptr->xdrs, &store->bs_nrBsSets);
-	for (i=0;i<MBSYS_ATLAS_HSDS2_PFB_NUM;i++)
-	    {
-	    if (xdr_status == MB_YES)
-		xdr_status = xdr_float((XDR *)mb_io_ptr->xdrs, &store->bs_m_tau[i]);
-	    }
-	if (xdr_status == MB_YES)
-	    xdr_status = xdr_int((XDR *)mb_io_ptr->xdrs, &length);
-	if (xdr_status == MB_YES)
-	    xdr_status = xdr_opaque((XDR *)mb_io_ptr->xdrs, (char *)store->bs_eff_ampli, MBSYS_ATLAS_HSDS2_PFB_NUM);
-	if (xdr_status == MB_YES)
-	    xdr_status = xdr_int((XDR *)mb_io_ptr->xdrs, &length);
-	if (xdr_status == MB_YES)
-	    xdr_status = xdr_opaque((XDR *)mb_io_ptr->xdrs, (char *)store->bs_nis, MBSYS_ATLAS_HSDS2_PFB_NUM);
-
-	/* print debug statements */
-#ifndef MBR_HSDS2RAW_DEBUG
-	if (verbose >= 5)
-#endif
-		{
-		fprintf(stderr,"\ndbg5  Backscatter telegram read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       xdr_status:              %d\n",xdr_status);
-		fprintf(stderr,"dbg5       telegram_id:             %d\n",telegram_id);
-		fprintf(stderr,"dbg5       telegram_cnt:            %d\n",telegram_cnt);
-		fprintf(stderr,"dbg5       telegram_send:           %s\n",telegram_send);
-		fprintf(stderr,"dbg5       telegram_recv:           %s\n",telegram_recv);
-		fprintf(stderr,"dbg5       telegram_utc_time_d:     %f\n",telegram_utc_time_d);
-		fprintf(stderr,"dbg5       telegram_loc_time_d:     %f\n",telegram_utc_time_d);
-		fprintf(stderr,"dbg5       telegram_block_no:       %d\n",telegram_block_no);
-		fprintf(stderr,"dbg5       telegram_block_cnt:      %d\n",telegram_block_cnt);
-		fprintf(stderr,"dbg5       telegram_max_no:         %d\n",telegram_max_no);
-		fprintf(stderr,"dbg5       telegram_act_no:         %d\n",telegram_act_no);
-		fprintf(stderr,"dbg5       telegram_data_status:    %d\n",telegram_data_status);
-		fprintf(stderr,"dbg5       telegram_sensor_status:  %d\n",telegram_sensor_status);
-		fprintf(stderr,"dbg5       bs_ping_no:              %d\n",store->bs_ping_no);
-		fprintf(stderr,"dbg5       bs_transmit_time_d:      %f\n",store->bs_transmit_time_d);
-		fprintf(stderr,"dbg5       bs_nrActualGainSets:     %d\n",store->bs_nrActualGainSets);
-		fprintf(stderr,"dbg5       bs_rxGup:                %f\n",store->bs_rxGup);
-		fprintf(stderr,"dbg5       bs_rxGain:               %f\n",store->bs_rxGain);
-		fprintf(stderr,"dbg5       bs_ar:                   %f\n",store->bs_ar);
-		if (verbose > 0)
-		for (i=0;i<MBSYS_ATLAS_HSDS2_RX_PAR;i++)
-			{
-			fprintf(stderr,"dbg5       tvgrx[%d]: time gain: %f %f\n",
-				i, store->bs_TvgRx_time[i], store->bs_TvgRx_gain[i]);
-			}
-		fprintf(stderr,"dbg5       bs_nrTxSets:             %d\n",store->bs_nrTxSets);
-		if (verbose > 0)
-		for (i=0;i<MBSYS_ATLAS_HSDS2_TX_PAR;i++)
-			{
-			fprintf(stderr,"dbg5       tx[%d]: # gain ang len:    %d %f %f %f\n",
-				i, store->bs_txBeamIndex[i], store->bs_txLevel[i],
-				store->bs_txBeamAngle[i], store->bs_pulseLength[i]);
-			}
-		fprintf(stderr,"dbg5       bs_nrBsSets:             %d\n",store->bs_nrBsSets);
-		if (verbose > 0)
-		for (i=0;i<MBSYS_ATLAS_HSDS2_TX_PAR;i++)
-			{
-			fprintf(stderr,"dbg5       bs[%d]: # tau amp nis:   %f %d %d\n",
-				i, store->bs_m_tau[i], store->bs_eff_ampli[i], store->bs_nis[i]);
-			}
-		}
-
-	/* set error if required */
-	if (xdr_status == MB_NO)
-		{
-		*error = MB_ERROR_EOF;
-		status = MB_FAILURE;
-		}
-
-	/* check for broken records - these do happen!!! */
-	if (status == MB_SUCCESS
-	    && (store->tt_beam_cnt > MBSYS_ATLAS_MAXBEAMS
-		|| store->ss_max_side_bb_cnt > MBSYS_ATLAS_MAXPIXELS
-		|| store->ss_max_side_sb_cnt > MBSYS_ATLAS_MAXPIXELS
-		|| store->start_opmode[0] != 1))
-		{
-		*error = MB_ERROR_UNINTELLIGIBLE;
-		status = MB_FAILURE;
-		}
-
-	/* check again for broken records - these do happen!!! */
-	if (status == MB_SUCCESS)
-	    {
-	    for (i=0;i<store->tt_beam_cnt;i++)
-		{
-		if (store->tt_lruntime[i] > 20.0)
-		    {
-		    *error = MB_ERROR_UNINTELLIGIBLE;
-		    status = MB_FAILURE;
-		    }
-		}
-	    }
-
-	/* check again for broken records - these do happen!!! */
-	if (status == MB_SUCCESS)
-	    {
-	    for (i=0;i<store->tt_beam_cnt;i++)
-		{
-		if (store->tt_lruntime[i] > 20.0)
-		    {
-		    *error = MB_ERROR_UNINTELLIGIBLE;
-		    status = MB_FAILURE;
-		    }
-		}
-	    }
-
-	/* calculate first cut bathymetry */
-	if (status == MB_SUCCESS)
-		{
-		/* get angle_table for 90 degree coverage */
-		if (store->start_opmode[3] == 0)
-			{
-			if (store->tt_beam_cnt == 140)
-		    		angle_table = (double *) ds2_ang_90d_140b;
-			else if (store->tt_beam_cnt == 59)
-		    		angle_table = (double *) ds2_ang_90d_59b;
-			}
-
-		/* get angle_table for 120 degree coverage */
-		else if (store->start_opmode[3] == 1)
-			{
-			if (store->tt_beam_cnt == 140)
-		    		angle_table = (double *) ds2_ang_120d_140b;
-			else if (store->tt_beam_cnt == 59)
-		    		angle_table = (double *) ds2_ang_120d_59b;
-			}
-
-		/* calculate bathymetry */
-		for (i=0;i<store->tt_beam_cnt;i++)
-			{
-			if (store->tt_lruntime[i] > 0.0)
-				{
-				rr = store->start_cmean * store->tt_lruntime[i] / 2.0;
-				store->pr_bath[i] = rr * cos(angle_table[i])
-									+ store->start_heave + store->tt_draught;
-				store->pr_bathacrosstrack[i] = rr * sin(angle_table[i]);
- 				store->pr_bathalongtrack[i] = 0.0;
-				store->pr_beamflag[i] = MB_FLAG_NONE;
-				}
-			else
-				{
-				store->pr_bath[i] = 0.0;
-				store->pr_bathacrosstrack[i] = 0.0;
-				store->pr_bathalongtrack[i] = 0.0;
-				store->pr_beamflag[i] = MB_FLAG_NULL;
-				}
-			}
-		}
-
-	/* look for navigation if needed */
-	if ((XDR *)mb_io_ptr->xdrs2 != NULL
-		&& ((mb_io_ptr->nfix > 0
-				&& mb_io_ptr->fix_time_d[mb_io_ptr->nfix - 1] < store->tt_transmit_time_d)
-			|| mb_io_ptr->nfix <= 0))
-		{
-		done = MB_NO;
-		while (done == MB_NO)
-			{
-			/* get system telegram */
-			xdr_status = xdr_int((XDR *)mb_io_ptr->xdrs2, &telegram_id);
-
-			/* telegram id ok - just read send and receive strings */
-			if (xdr_status == MB_YES && telegram_id == MBSYS_ATLAS_TELEGRAM_SYSTEM)
-			    {
-			    if (xdr_status == MB_YES)
-				xdr_status = xdr_int((XDR *)mb_io_ptr->xdrs2, &telegram_cnt);
-			    if (xdr_status == MB_YES)
-				xdr_status = xdr_int((XDR *)mb_io_ptr->xdrs2, &length);
-			    if (xdr_status == MB_YES)
-				xdr_status = xdr_opaque((XDR *)mb_io_ptr->xdrs2, telegram_send, 16);
-			    if (xdr_status == MB_YES)
-				xdr_status = xdr_int((XDR *)mb_io_ptr->xdrs2, &length);
-			    if (xdr_status == MB_YES)
-				xdr_status = xdr_opaque((XDR *)mb_io_ptr->xdrs2, telegram_recv, 16);
-			    }
-
-			/* expected telegram id wrong - try to resync on recv string */
-			else if (xdr_status == MB_YES)
-			    {
-			    memset(telegram_recv, 0, 16);
-			    read_status = 1;
-			    nskip = 0;
-			    while (strncmp(telegram_recv, "BROADCAST", 9) != 0
-				&& read_status == 1)
-				{
-				for (i=0;i<15;i++)
-				    telegram_recv[i] = telegram_recv[i+1];
-				if ((read_status = fread(&(telegram_recv[15]), 1, 1, mb_io_ptr->mbfp2)) == 1)
-				    nskip++;
-				}
-			    if (read_status == MB_YES)
-				{
-				fprintf(stderr, "Resync on SYSTEM telegram: %d missing bytes\n",
-					(44 - nskip));
-				}
-			    else
-				{
-				xdr_status = MB_NO;
-				}
-			    }
-
-			/* hopefully we are synced - read the telegram */
-			if (xdr_status == MB_YES)
-			    xdr_status = xdr_double((XDR *)mb_io_ptr->xdrs2, &telegram_utc_time_d);
-			if (xdr_status == MB_YES)
-			    xdr_status = xdr_double((XDR *)mb_io_ptr->xdrs2, &telegram_loc_time_d);
-			if (xdr_status == MB_YES)
-			    xdr_status = xdr_int((XDR *)mb_io_ptr->xdrs2, &telegram_block_no);
-			if (xdr_status == MB_YES)
-			    xdr_status = xdr_int((XDR *)mb_io_ptr->xdrs2, &telegram_block_cnt);
-			if (xdr_status == MB_YES)
-			    xdr_status = xdr_int((XDR *)mb_io_ptr->xdrs2, &length);
-			if (xdr_status == MB_YES)
-			    xdr_status = xdr_opaque((XDR *)mb_io_ptr->xdrs2, carrier_name, 8);
-			if (xdr_status == MB_YES)
-			    xdr_status = xdr_int((XDR *)mb_io_ptr->xdrs2, &length);
-			if (xdr_status == MB_YES)
-			    xdr_status = xdr_opaque((XDR *)mb_io_ptr->xdrs2, task_name, 16);
-			if (xdr_status == MB_YES)
-			    xdr_status = xdr_int((XDR *)mb_io_ptr->xdrs2, &length);
-			if (xdr_status == MB_YES)
-			    xdr_status = xdr_opaque((XDR *)mb_io_ptr->xdrs2, operator_name, 32);
-			if (xdr_status == MB_YES)
-			    xdr_status = xdr_int((XDR *)mb_io_ptr->xdrs2, &length);
-			if (xdr_status == MB_YES)
-			    xdr_status = xdr_opaque((XDR *)mb_io_ptr->xdrs2, gauge_name, 32);
-			if (xdr_status == MB_YES)
-			    xdr_status = xdr_int((XDR *)mb_io_ptr->xdrs2, &length);
-			if (xdr_status == MB_YES)
-			    xdr_status = xdr_opaque((XDR *)mb_io_ptr->xdrs2, comment, 32);
-			if (xdr_status == MB_YES)
-			    xdr_status = xdr_int((XDR *)mb_io_ptr->xdrs2, &length);
-			if (xdr_status == MB_YES)
-			    xdr_status = xdr_opaque((XDR *)mb_io_ptr->xdrs2, profile_name, 32);
-			if (xdr_status == MB_YES)
-			    xdr_status = xdr_int((XDR *)mb_io_ptr->xdrs2, &profile_version);
-
-			/* print debug statements */
-#ifndef MBR_HSDS2RAW_DEBUG
-			if (verbose >= 5)
-#endif
-				{
-				fprintf(stderr,"\ndbg5  System telegram read in MBIO function <%s>\n",function_name);
-				fprintf(stderr,"dbg5       xdr_status:              %d\n",xdr_status);
-				fprintf(stderr,"dbg5       telegram_id:             %d\n",telegram_id);
-				fprintf(stderr,"dbg5       telegram_cnt:            %d\n",telegram_cnt);
-				fprintf(stderr,"dbg5       telegram_send:           %s\n",telegram_send);
-				fprintf(stderr,"dbg5       telegram_recv:           %s\n",telegram_recv);
-				fprintf(stderr,"dbg5       telegram_utc_time_d:     %f\n",telegram_utc_time_d);
-				fprintf(stderr,"dbg5       telegram_loc_time_d:     %f\n",telegram_utc_time_d);
-				fprintf(stderr,"dbg5       telegram_block_no:       %d\n",telegram_block_no);
-				fprintf(stderr,"dbg5       telegram_block_cnt:      %d\n",telegram_block_cnt);
-				fprintf(stderr,"dbg5       carrier_name:            %s\n",carrier_name);
-				fprintf(stderr,"dbg5       task_name:               %s\n",task_name);
-				fprintf(stderr,"dbg5       operator_name:           %s\n",operator_name);
-				fprintf(stderr,"dbg5       gauge_name:              %s\n",gauge_name);
-				fprintf(stderr,"dbg5       comment:                 %s\n",comment);
-				fprintf(stderr,"dbg5       profile_name:            %s\n",profile_name);
-				fprintf(stderr,"dbg5       profile_version:         %d\n",profile_version);
-				}
-
-			if (xdr_status == MB_YES)
-			    xdr_status = xdr_int((XDR *)mb_io_ptr->xdrs2, &telegram_block_no);
-			if (xdr_status == MB_YES)
-			    xdr_status = xdr_int((XDR *)mb_io_ptr->xdrs2, &telegram_block_cnt);
-			if (xdr_status == MB_YES)
-			    xdr_status = xdr_double((XDR *)mb_io_ptr->xdrs2, &sys_pos_lat);
-			if (xdr_status == MB_YES)
-			    xdr_status = xdr_double((XDR *)mb_io_ptr->xdrs2, &sys_pos_lon);
-			if (xdr_status == MB_YES)
-			    xdr_status = xdr_int((XDR *)mb_io_ptr->xdrs2, &length);
-			if (xdr_status == MB_YES)
-			    xdr_status = xdr_opaque((XDR *)mb_io_ptr->xdrs2, sys_pos_sensor, 8);
-			if (xdr_status == MB_YES)
-			    xdr_status = xdr_double((XDR *)mb_io_ptr->xdrs2, &sys_pos_lat_tpe);
-			if (xdr_status == MB_YES)
-			    xdr_status = xdr_double((XDR *)mb_io_ptr->xdrs2, &sys_pos_lon_tpe);
-			if (xdr_status == MB_YES)
-			    xdr_status = xdr_double((XDR *)mb_io_ptr->xdrs2, &sys_pos_time);
-			if (xdr_status == MB_YES)
-			    xdr_status = xdr_int((XDR *)mb_io_ptr->xdrs2, &sys_pos_data_status);
-			if (xdr_status == MB_YES)
-			    xdr_status = xdr_int((XDR *)mb_io_ptr->xdrs2, &sys_pos_status);
-			if (xdr_status == MB_YES)
-			    xdr_status = xdr_double((XDR *)mb_io_ptr->xdrs2, &sys_height);
-			if (xdr_status == MB_YES)
-			    xdr_status = xdr_int((XDR *)mb_io_ptr->xdrs2, &length);
-			if (xdr_status == MB_YES)
-			    xdr_status = xdr_opaque((XDR *)mb_io_ptr->xdrs2, sys_height_sensor, 8);
-			if (xdr_status == MB_YES)
-			    xdr_status = xdr_double((XDR *)mb_io_ptr->xdrs2, &sys_height_time);
-			if (xdr_status == MB_YES)
-			    xdr_status = xdr_int((XDR *)mb_io_ptr->xdrs2, &sys_height_data_status);
-			if (xdr_status == MB_YES)
-			    xdr_status = xdr_int((XDR *)mb_io_ptr->xdrs2, &sys_height_status);
-			if (xdr_status == MB_YES)
-			    xdr_status = xdr_double((XDR *)mb_io_ptr->xdrs2, &sys_speed_wlong);
-			if (xdr_status == MB_YES)
-			    xdr_status = xdr_double((XDR *)mb_io_ptr->xdrs2, &sys_speed_wcross);
-			if (xdr_status == MB_YES)
-			    xdr_status = xdr_int((XDR *)mb_io_ptr->xdrs2, &length);
-			if (xdr_status == MB_YES)
-			    xdr_status = xdr_opaque((XDR *)mb_io_ptr->xdrs2, sys_tw_sensor, 8);
-			if (xdr_status == MB_YES)
-			    xdr_status = xdr_double((XDR *)mb_io_ptr->xdrs2, &sys_tw_time);
-			if (xdr_status == MB_YES)
-			    xdr_status = xdr_int((XDR *)mb_io_ptr->xdrs2, &sys_tw_data_status);
-			if (xdr_status == MB_YES)
-			    xdr_status = xdr_int((XDR *)mb_io_ptr->xdrs2, &sys_tw_status);
-			if (xdr_status == MB_YES)
-			    xdr_status = xdr_double((XDR *)mb_io_ptr->xdrs2, &sys_cog);
-			if (xdr_status == MB_YES)
-			    xdr_status = xdr_int((XDR *)mb_io_ptr->xdrs2, &length);
-			if (xdr_status == MB_YES)
-			    xdr_status = xdr_opaque((XDR *)mb_io_ptr->xdrs2, sys_cog_sensor, 8);
-			if (xdr_status == MB_YES)
-			    xdr_status = xdr_double((XDR *)mb_io_ptr->xdrs2, &sys_cog_time);
-			if (xdr_status == MB_YES)
-			    xdr_status = xdr_int((XDR *)mb_io_ptr->xdrs2, &sys_cog_data_status);
-			if (xdr_status == MB_YES)
-			    xdr_status = xdr_int((XDR *)mb_io_ptr->xdrs2, &sys_cog_status);
-			if (xdr_status == MB_YES)
-			    xdr_status = xdr_double((XDR *)mb_io_ptr->xdrs2, &sys_sog);
-			if (xdr_status == MB_YES)
-			    xdr_status = xdr_int((XDR *)mb_io_ptr->xdrs2, &length);
-			if (xdr_status == MB_YES)
-			    xdr_status = xdr_opaque((XDR *)mb_io_ptr->xdrs2, sys_sog_sensor, 8);
-			if (xdr_status == MB_YES)
-			    xdr_status = xdr_double((XDR *)mb_io_ptr->xdrs2, &sys_sog_time);
-			if (xdr_status == MB_YES)
-			    xdr_status = xdr_int((XDR *)mb_io_ptr->xdrs2, &sys_sog_data_status);
-			if (xdr_status == MB_YES)
-			    xdr_status = xdr_int((XDR *)mb_io_ptr->xdrs2, &sys_sog_status);
-			if (xdr_status == MB_YES)
-			    xdr_status = xdr_double((XDR *)mb_io_ptr->xdrs2, &sys_set);
-			if (xdr_status == MB_YES)
-			    xdr_status = xdr_double((XDR *)mb_io_ptr->xdrs2, &sys_drift);
-			if (xdr_status == MB_YES)
-			    xdr_status = xdr_int((XDR *)mb_io_ptr->xdrs2, &length);
-			if (xdr_status == MB_YES)
-			    xdr_status = xdr_opaque((XDR *)mb_io_ptr->xdrs2, sys_set_drift_sensor, 8);
-			if (xdr_status == MB_YES)
-			    xdr_status = xdr_double((XDR *)mb_io_ptr->xdrs2, &sys_set_drift_time);
-			if (xdr_status == MB_YES)
-			    xdr_status = xdr_int((XDR *)mb_io_ptr->xdrs2, &sys_set_drift_data_status);
-			if (xdr_status == MB_YES)
-			    xdr_status = xdr_int((XDR *)mb_io_ptr->xdrs2, &sys_set_drift_status);
-			if (xdr_status == MB_YES)
-			    xdr_status = xdr_double((XDR *)mb_io_ptr->xdrs2, &sys_heading);
-			if (xdr_status == MB_YES)
-			    xdr_status = xdr_int((XDR *)mb_io_ptr->xdrs2, &length);
-			if (xdr_status == MB_YES)
-			    xdr_status = xdr_opaque((XDR *)mb_io_ptr->xdrs2, sys_heading_sensor, 8);
-			if (xdr_status == MB_YES)
-			    xdr_status = xdr_double((XDR *)mb_io_ptr->xdrs2, &sys_heading_time);
-			if (xdr_status == MB_YES)
-			    xdr_status = xdr_int((XDR *)mb_io_ptr->xdrs2, &sys_heading_data_status);
-			if (xdr_status == MB_YES)
-			    xdr_status = xdr_int((XDR *)mb_io_ptr->xdrs2, &sys_heading_status);
-			if (xdr_status == MB_YES)
-			    xdr_status = xdr_double((XDR *)mb_io_ptr->xdrs2, &sys_depth);
-			if (xdr_status == MB_YES)
-			    xdr_status = xdr_int((XDR *)mb_io_ptr->xdrs2, &length);
-			if (xdr_status == MB_YES)
-			    xdr_status = xdr_opaque((XDR *)mb_io_ptr->xdrs2, sys_depth_sensor, 8);
-			if (xdr_status == MB_YES)
-			    xdr_status = xdr_double((XDR *)mb_io_ptr->xdrs2, &sys_depth_water_level);
-			if (xdr_status == MB_YES)
-			    xdr_status = xdr_double((XDR *)mb_io_ptr->xdrs2, &sys_depth_time);
-			if (xdr_status == MB_YES)
-			    xdr_status = xdr_int((XDR *)mb_io_ptr->xdrs2, &sys_depth_data_status);
-			if (xdr_status == MB_YES)
-			    xdr_status = xdr_int((XDR *)mb_io_ptr->xdrs2, &sys_depth_status);
-			if (xdr_status == MB_YES)
-			    xdr_status = xdr_double((XDR *)mb_io_ptr->xdrs2, &sys_wspeed_abs);
-			if (xdr_status == MB_YES)
-			    xdr_status = xdr_double((XDR *)mb_io_ptr->xdrs2, &sys_wdir_abs);
-			if (xdr_status == MB_YES)
-			    xdr_status = xdr_int((XDR *)mb_io_ptr->xdrs2, &length);
-			if (xdr_status == MB_YES)
-			    xdr_status = xdr_opaque((XDR *)mb_io_ptr->xdrs2, sys_wind_sensor, 8);
-			if (xdr_status == MB_YES)
-			    xdr_status = xdr_double((XDR *)mb_io_ptr->xdrs2, &sys_wind_time);
-			if (xdr_status == MB_YES)
-			    xdr_status = xdr_int((XDR *)mb_io_ptr->xdrs2, &sys_wind_data_status);
-			if (xdr_status == MB_YES)
-			    xdr_status = xdr_int((XDR *)mb_io_ptr->xdrs2, &sys_wind_status);
-
-			/* print debug statements */
-#ifndef MBR_HSDS2RAW_DEBUG
-			if (verbose >= 5)
-#endif
-				{
-				fprintf(stderr,"dbg5       xdr_status:              %d\n",xdr_status);
-				fprintf(stderr,"dbg5       telegram_block_no:       %d\n",telegram_block_no);
-				fprintf(stderr,"dbg5       telegram_block_cnt:      %d\n",telegram_block_cnt);
-				fprintf(stderr,"dbg5       sys_pos_lat:             %f\n",sys_pos_lat);
-				fprintf(stderr,"dbg5       sys_pos_lon:             %f\n",sys_pos_lon);
-				fprintf(stderr,"dbg5       sys_pos_sensor:          %s\n",sys_pos_sensor);
-				fprintf(stderr,"dbg5       sys_pos_lat_tpe:         %f\n",sys_pos_lat_tpe);
-				fprintf(stderr,"dbg5       sys_pos_lon_tpe:         %f\n",sys_pos_lon_tpe);
-				fprintf(stderr,"dbg5       sys_pos_time:            %f\n",sys_pos_time);
-				fprintf(stderr,"dbg5       sys_pos_data_status:     %d\n",sys_pos_data_status);
-				fprintf(stderr,"dbg5       sys_pos_status:          %d\n",sys_pos_status);
-				fprintf(stderr,"dbg5       sys_height:              %f\n",sys_height);
-				fprintf(stderr,"dbg5       sys_height_sensor:       %s\n",sys_height_sensor);
-				fprintf(stderr,"dbg5       sys_height_time:         %f\n",sys_height_time);
-				fprintf(stderr,"dbg5       sys_height_data_status:  %d\n",sys_height_data_status);
-				fprintf(stderr,"dbg5       sys_height_status:       %d\n",sys_height_status);
-				fprintf(stderr,"dbg5       sys_speed_wlong:         %f\n",sys_speed_wlong);
-				fprintf(stderr,"dbg5       sys_speed_wcross:        %f\n",sys_speed_wcross);
-				fprintf(stderr,"dbg5       sys_tw_sensor:           %s\n",sys_tw_sensor);
-				fprintf(stderr,"dbg5       sys_tw_time:             %f\n",sys_tw_time);
-				fprintf(stderr,"dbg5       sys_tw_data_status:      %d\n",sys_tw_data_status);
-				fprintf(stderr,"dbg5       sys_tw_status:           %d\n",sys_tw_status);
-				fprintf(stderr,"dbg5       sys_cog:                 %f\n",sys_cog);
-				fprintf(stderr,"dbg5       sys_cog_sensor:          %s\n",sys_cog_sensor);
-				fprintf(stderr,"dbg5       sys_cog_time:            %f\n",sys_cog_time);
-				fprintf(stderr,"dbg5       sys_cog_data_status:     %d\n",sys_cog_data_status);
-				fprintf(stderr,"dbg5       sys_cog_status:          %d\n",sys_cog_status);
-				fprintf(stderr,"dbg5       sys_sog:                 %f\n",sys_sog);
-				fprintf(stderr,"dbg5       sys_sog_sensor:          %s\n",sys_sog_sensor);
-				fprintf(stderr,"dbg5       sys_sog_time:            %f\n",sys_sog_time);
-				fprintf(stderr,"dbg5       sys_sog_data_status:     %d\n",sys_sog_data_status);
-				fprintf(stderr,"dbg5       sys_sog_status:          %d\n",sys_sog_status);
-				fprintf(stderr,"dbg5       sys_set:                 %f\n",sys_set);
-				fprintf(stderr,"dbg5       sys_drift:               %f\n",sys_drift);
-				fprintf(stderr,"dbg5       sys_set_drift_sensor:    %s\n",sys_set_drift_sensor);
-				fprintf(stderr,"dbg5       sys_set_drift_time:      %f\n",sys_set_drift_time);
-				fprintf(stderr,"dbg5       sys_set_drift_data_status: %d\n",sys_set_drift_data_status);
-				fprintf(stderr,"dbg5       sys_set_drift_status:      %d\n",sys_set_drift_status);
-				fprintf(stderr,"dbg5       sys_heading:             %f\n",sys_heading);
-				fprintf(stderr,"dbg5       sys_heading_sensor:      %s\n",sys_heading_sensor);
-				fprintf(stderr,"dbg5       sys_heading_time:        %f\n",sys_heading_time);
-				fprintf(stderr,"dbg5       sys_heading_data_status: %d\n",sys_heading_data_status);
-				fprintf(stderr,"dbg5       sys_heading_status:      %d\n",sys_heading_status);
-				fprintf(stderr,"dbg5       sys_depth:               %f\n",sys_depth);
-				fprintf(stderr,"dbg5       sys_depth_sensor:        %s\n",sys_depth_sensor);
-				fprintf(stderr,"dbg5       sys_depth_water_level:   %f\n",sys_depth_water_level);
-				fprintf(stderr,"dbg5       sys_depth_time:          %f\n",sys_depth_time);
-				fprintf(stderr,"dbg5       sys_depth_data_status:   %d\n",sys_depth_data_status);
-				fprintf(stderr,"dbg5       sys_depth_status:        %d\n",sys_depth_status);
-				fprintf(stderr,"dbg5       sys_wspeed_abs:          %f\n",sys_wspeed_abs);
-				fprintf(stderr,"dbg5       sys_wdir_abs:            %f\n",sys_wdir_abs);
-				fprintf(stderr,"dbg5       sys_wind_sensor:         %s\n",sys_wind_sensor);
-				fprintf(stderr,"dbg5       sys_wind_time:           %f\n",sys_wind_time);
-				fprintf(stderr,"dbg5       sys_wind_data_status:    %d\n",sys_wind_data_status);
-				fprintf(stderr,"dbg5       sys_wind_status:         %d\n",sys_wind_status);
-				}
-
-			/* add to nav fix list */
-			if (xdr_status == MB_YES)
-				{
-				mb_navint_add(verbose, mbio_ptr,
-						sys_pos_time, (RTD * sys_pos_lon), (RTD * sys_pos_lat),
-						error);
-				if (mb_io_ptr->fix_time_d[mb_io_ptr->nfix - 1]
-					>= store->tt_transmit_time_d)
-					done = MB_YES;
-				}
-			else
-				done = MB_YES;
-			}
-		}
-
-	/* now interpolate navigation if available */
-	if (mb_io_ptr->nfix > 0)
-		{
-		mb_navint_interp(verbose, mbio_ptr,
-				store->tt_transmit_time_d, store->start_heading, 0.0,
-				&(store->pr_navlon), &(store->pr_navlat), &pspeed,
-				error);
-		store->pr_speed = pspeed / 3.6;
-		}
-
-	/* set kind */
-	if (store->start_opmode[12] == 0)
-		store->kind = MB_DATA_DATA;
-	else
-		store->kind = MB_DATA_CALIBRATE;
-
-	/* get file position */
-	mb_io_ptr->file_bytes = ftell(mb_io_ptr->mbfp);
-	if (mb_io_ptr->mbfp2 != NULL)
-		mb_io_ptr->file2_bytes = ftell(mb_io_ptr->mbfp2);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_hsds2raw_wr_data(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_hsds2raw_wr_data";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_atlas_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_atlas_struct *) store_ptr;
-
-	/* print output debug statements */
-#ifndef MBR_HSDS2RAW_DEBUG
-	if (verbose >= 5)
-#endif
-		{
-		fprintf(stderr,"\ndbg5  Data record kind in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       kind:       %d\n",store->kind);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mbr_hsldedmb.c b/src/mbio/mbr_hsldedmb.c
deleted file mode 100644
index 78cc600..0000000
--- a/src/mbio/mbr_hsldedmb.c
+++ /dev/null
@@ -1,848 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbr_hsldedmb.c	2/2/93
- *	$Id: mbr_hsldedmb.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1993-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbr_hsldedmb.c contains the functions for reading and writing
- * multibeam data in the HSLDEDMB format.
- * These functions include:
- *   mbr_alm_hsldedmb	- allocate read/write memory
- *   mbr_dem_hsldedmb	- deallocate read/write memory
- *   mbr_rt_hsldedmb	- read and translate data
- *   mbr_wt_hsldedmb	- translate and write data
- *
- * Author:	D. W. Caress
- * Date:	February 2, 1993
- * $Log: mbr_hsldedmb.c,v $
- * Revision 5.10  2005/11/05 00:48:05  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.9  2003/05/20 18:05:32  caress
- * Added svp_source to data source parameters.
- *
- * Revision 5.8  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.7  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.6  2002/07/20 20:42:40  caress
- * Release 5.0.beta20
- *
- * Revision 5.5  2002/03/26 07:43:25  caress
- * Release 5.0.beta15
- *
- * Revision 5.4  2002/02/26 07:50:41  caress
- * Release 5.0.beta14
- *
- * Revision 5.3  2001/07/20 00:32:54  caress
- * Release 5.0.beta03
- *
- * Revision 5.2  2001/03/22  20:50:02  caress
- * Trying to make version 5.0.beta0
- *
- * Revision 5.1  2001/01/22  07:43:34  caress
- * Version 5.0.beta01
- *
- * Revision 5.0  2000/12/01  22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.10  2000/10/11  01:03:21  caress
- * Convert to ANSI C
- *
- * Revision 4.9  2000/09/30  06:34:20  caress
- * Snapshot for Dale.
- *
- * Revision 4.8  1998/10/05  17:46:15  caress
- * MB-System version 4.6beta
- *
- * Revision 4.7  1997/07/25  14:19:53  caress
- * Version 4.5beta2.
- * Much mucking, particularly with Simrad formats.
- *
- * Revision 4.6  1997/04/21  17:02:07  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.5  1996/04/22  13:21:19  caress
- * Now have DTR and MIN/MAX defines in mb_define.h
- *
- * Revision 4.5  1996/04/22  13:21:19  caress
- * Now have DTR and MIN/MAX defines in mb_define.h
- *
- * Revision 4.4  1995/03/06  19:38:54  caress
- * Changed include strings.h to string.h for POSIX compliance.
- *
- * Revision 4.3  1994/10/21  12:20:01  caress
- * Release V4.0
- *
- * Revision 4.2  1994/07/29  18:46:51  caress
- * Changes associated with supporting Lynx OS (byte swapped) and
- * using unix second time base (for time_d values).
- *
- * Revision 4.1  1994/05/21  02:23:29  caress
- * Made sure that mb_io_ptr->new_bath_alongtrack is set to zero on reading.
- *
- * Revision 4.0  1994/03/06  00:01:56  caress
- * First cut at version 4.0
- *
- * Revision 4.1  1994/03/03  03:39:43  caress
- * Fixed copyright message.
- *
- * Revision 4.0  1994/02/21  03:59:50  caress
- * First cut at new version. Altered to be consistent
- * with passing of three types of data: bathymetry,
- * amplitude, and sidescan.
- *
- * Revision 3.0  1993/05/14  22:55:40  sohara
- * initial version
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mb_define.h"
-#include "mbsys_hsds.h"
-#include "mbf_hsldedmb.h"
-
-/* time conversion constants */
-#define MININYEAR 525600.0
-#define MININDAY 1440.0
-
-/* include for byte swapping on little-endian machines */
-#ifdef BYTESWAPPED
-#include "mb_swap.h"
-#endif
-
-/* essential function prototypes */
-int mbr_register_hsldedmb(int verbose, void *mbio_ptr,
-		int *error);
-int mbr_info_hsldedmb(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_alm_hsldedmb(int verbose, void *mbio_ptr, int *error);
-int mbr_dem_hsldedmb(int verbose, void *mbio_ptr, int *error);
-int mbr_rt_hsldedmb(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_wt_hsldedmb(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-
-static char rcs_id[]="$Id: mbr_hsldedmb.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mbr_register_hsldedmb(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_register_hsldedmb";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* get mb_io_ptr */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set format info parameters */
-	status = mbr_info_hsldedmb(verbose,
-			&mb_io_ptr->system,
-			&mb_io_ptr->beams_bath_max,
-			&mb_io_ptr->beams_amp_max,
-			&mb_io_ptr->pixels_ss_max,
-			mb_io_ptr->format_name,
-			mb_io_ptr->system_name,
-			mb_io_ptr->format_description,
-			&mb_io_ptr->numfile,
-			&mb_io_ptr->filetype,
-			&mb_io_ptr->variable_beams,
-			&mb_io_ptr->traveltime,
-			&mb_io_ptr->beam_flagging,
-			&mb_io_ptr->nav_source,
-			&mb_io_ptr->heading_source,
-			&mb_io_ptr->vru_source,
-			&mb_io_ptr->svp_source,
-			&mb_io_ptr->beamwidth_xtrack,
-			&mb_io_ptr->beamwidth_ltrack,
-			error);
-
-	/* set format and system specific function pointers */
-	mb_io_ptr->mb_io_format_alloc = &mbr_alm_hsldedmb;
-	mb_io_ptr->mb_io_format_free = &mbr_dem_hsldedmb;
-	mb_io_ptr->mb_io_store_alloc = &mbsys_hsds_alloc;
-	mb_io_ptr->mb_io_store_free = &mbsys_hsds_deall;
-	mb_io_ptr->mb_io_read_ping = &mbr_rt_hsldedmb;
-	mb_io_ptr->mb_io_write_ping = &mbr_wt_hsldedmb;
-	mb_io_ptr->mb_io_dimensions = &mbsys_hsds_dimensions;
-	mb_io_ptr->mb_io_extract = &mbsys_hsds_extract;
-	mb_io_ptr->mb_io_insert = &mbsys_hsds_insert;
-	mb_io_ptr->mb_io_extract_nav = &mbsys_hsds_extract_nav;
-	mb_io_ptr->mb_io_insert_nav = &mbsys_hsds_insert_nav;
-	mb_io_ptr->mb_io_extract_altitude = &mbsys_hsds_extract_altitude;
-	mb_io_ptr->mb_io_insert_altitude = NULL;
-	mb_io_ptr->mb_io_extract_svp = NULL;
-	mb_io_ptr->mb_io_insert_svp = NULL;
-	mb_io_ptr->mb_io_ttimes = &mbsys_hsds_ttimes;
-	mb_io_ptr->mb_io_detects = &mbsys_hsds_detects;
-	mb_io_ptr->mb_io_copyrecord = &mbsys_hsds_copy;
-	mb_io_ptr->mb_io_extract_rawss = NULL;
-	mb_io_ptr->mb_io_insert_rawss = NULL;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",mb_io_ptr->system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",mb_io_ptr->beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",mb_io_ptr->beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",mb_io_ptr->pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",mb_io_ptr->format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",mb_io_ptr->system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",mb_io_ptr->format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",mb_io_ptr->numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",mb_io_ptr->filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",mb_io_ptr->variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",mb_io_ptr->traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",mb_io_ptr->beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",mb_io_ptr->nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",mb_io_ptr->heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",mb_io_ptr->vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",mb_io_ptr->svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",mb_io_ptr->beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",mb_io_ptr->beamwidth_ltrack);
-		fprintf(stderr,"dbg2       format_alloc:       %p\n",(void *)mb_io_ptr->mb_io_format_alloc);
-		fprintf(stderr,"dbg2       format_free:        %p\n",(void *)mb_io_ptr->mb_io_format_free);
-		fprintf(stderr,"dbg2       store_alloc:        %p\n",(void *)mb_io_ptr->mb_io_store_alloc);
-		fprintf(stderr,"dbg2       store_free:         %p\n",(void *)mb_io_ptr->mb_io_store_free);
-		fprintf(stderr,"dbg2       read_ping:          %p\n",(void *)mb_io_ptr->mb_io_read_ping);
-		fprintf(stderr,"dbg2       write_ping:         %p\n",(void *)mb_io_ptr->mb_io_write_ping);
-		fprintf(stderr,"dbg2       extract:            %p\n",(void *)mb_io_ptr->mb_io_extract);
-		fprintf(stderr,"dbg2       insert:             %p\n",(void *)mb_io_ptr->mb_io_insert);
-		fprintf(stderr,"dbg2       extract_nav:        %p\n",(void *)mb_io_ptr->mb_io_extract_nav);
-		fprintf(stderr,"dbg2       insert_nav:         %p\n",(void *)mb_io_ptr->mb_io_insert_nav);
-		fprintf(stderr,"dbg2       extract_altitude:   %p\n",(void *)mb_io_ptr->mb_io_extract_altitude);
-		fprintf(stderr,"dbg2       insert_altitude:    %p\n",(void *)mb_io_ptr->mb_io_insert_altitude);
-		fprintf(stderr,"dbg2       extract_svp:        %p\n",(void *)mb_io_ptr->mb_io_extract_svp);
-		fprintf(stderr,"dbg2       insert_svp:         %p\n",(void *)mb_io_ptr->mb_io_insert_svp);
-		fprintf(stderr,"dbg2       ttimes:             %p\n",(void *)mb_io_ptr->mb_io_ttimes);
-		fprintf(stderr,"dbg2       detects:            %p\n",(void *)mb_io_ptr->mb_io_detects);
-		fprintf(stderr,"dbg2       extract_rawss:      %p\n",(void *)mb_io_ptr->mb_io_extract_rawss);
-		fprintf(stderr,"dbg2       insert_rawss:       %p\n",(void *)mb_io_ptr->mb_io_insert_rawss);
-		fprintf(stderr,"dbg2       copyrecord:         %p\n",(void *)mb_io_ptr->mb_io_copyrecord);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbr_info_hsldedmb(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error)
-{
-	char	*function_name = "mbr_info_hsldedmb";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* set format info parameters */
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-	*system = MB_SYS_HSDS;
-	*beams_bath_max = 59;
-	*beams_amp_max = 0;
-	*pixels_ss_max = 0;
-	strncpy(format_name, "HSLDEDMB", MB_NAME_LENGTH);
-	strncpy(system_name, "HSDS", MB_NAME_LENGTH);
-	strncpy(format_description, "Format name:          MBF_HSLDEDMB\nInformal Description: EDMB Hydrosweep\nAttributes:           Hydrosweep DS, bathymetry, 59 beams, binary, NRL.\n", MB_DESCRIPTION_LENGTH);
-	*numfile = 1;
-	*filetype = MB_FILETYPE_NORMAL;
-	*variable_beams = MB_NO;
-	*traveltime = MB_NO;
-	*beam_flagging = MB_YES;
-	*nav_source = MB_DATA_DATA;
-	*heading_source = MB_DATA_DATA;
-	*vru_source = MB_DATA_DATA;
-	*svp_source = MB_DATA_NONE;
-	*beamwidth_xtrack = 2.0;
-	*beamwidth_ltrack = 2.0;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",*system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",*beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",*beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",*pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",*numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",*filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",*variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",*traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",*beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",*nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",*heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",*vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",*svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",*beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",*beamwidth_ltrack);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_alm_hsldedmb(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_alm_hsldedmb";
-	int	status;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set initial status */
-	status = MB_SUCCESS;
-
-	/* allocate memory for data structure */
-	mb_io_ptr->structure_size = sizeof(struct mbf_hsldedmb_struct);
-	mb_io_ptr->data_structure_size =
-		sizeof(struct mbf_hsldedmb_data_struct);
-	status = mb_malloc(verbose,mb_io_ptr->structure_size,
-				&mb_io_ptr->raw_data,error);
-	status = mb_malloc(verbose,sizeof(struct mbsys_hsds_struct),
-				&mb_io_ptr->store_data,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_dem_hsldedmb(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_dem_hsldedmb";
-	int	status;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* deallocate memory for data descriptor */
-	status = mb_free(verbose,&mb_io_ptr->raw_data,error);
-	status = mb_free(verbose,&mb_io_ptr->store_data,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_rt_hsldedmb(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_rt_hsldedmb";
-	int	status;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_hsldedmb_struct *dataplus;
-	struct mbf_hsldedmb_data_struct *data;
-	struct mbsys_hsds_struct *store;
-	char	*datacomment;
-	int	i;
-	int	id;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	dataplus = (struct mbf_hsldedmb_struct *) mb_io_ptr->raw_data;
-	data = &(dataplus->data);
-	datacomment = (char *) data;
-	dataplus->kind = MB_DATA_DATA;
-	store = (struct mbsys_hsds_struct *) store_ptr;
-
-	/* set file position */
-	mb_io_ptr->file_pos = mb_io_ptr->file_bytes;
-
-	/* read next record from file */
-	if ((status = fread(data,1,mb_io_ptr->data_structure_size,
-			mb_io_ptr->mbfp)) == mb_io_ptr->data_structure_size)
-		{
-		mb_io_ptr->file_bytes += status;
-		status = MB_SUCCESS;
-		*error = MB_ERROR_NO_ERROR;
-		}
-	else
-		{
-		mb_io_ptr->file_bytes += status;
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	/* byte swap the data if necessary */
-#ifdef BYTESWAPPED
-	if (status == MB_SUCCESS && data->seconds != 2054847098)
-		{
-		data->seconds = mb_swap_int(data->seconds);
-		data->microseconds = mb_swap_int(data->microseconds);
-		data->alt_seconds = mb_swap_int(data->alt_seconds);
-		data->alt_microseconds = mb_swap_int(data->alt_microseconds);
-		data->lat = mb_swap_int(data->lat);
-		data->lon = mb_swap_int(data->lon);
-		data->heading = mb_swap_short(data->heading);
-		data->course = mb_swap_short(data->course);
-		data->speed = mb_swap_short(data->speed);
-		data->pitch = mb_swap_short(data->pitch);
-		data->scale = mb_swap_short(data->scale);
-		for (i=0;i<MBSYS_HSDS_BEAMS;i++)
-			{
-			data->depth[i] = mb_swap_short(data->depth[i]);
-			data->range[i] = mb_swap_short(data->range[i]);
-			}
-		for (i=0;i<4;i++)
-			data->flag[i] = mb_swap_int(data->flag[i]);
-
-		}
-#endif
-
-	/* check for comment or unintelligible records */
-	if (status == MB_SUCCESS)
-		{
-		if (data->seconds == 2054847098)
-			{
-			dataplus->kind = MB_DATA_COMMENT;
-			}
-		else if (data->seconds == 0)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_UNINTELLIGIBLE;
-			dataplus->kind = MB_DATA_NONE;
-			}
-		else
-			{
-			dataplus->kind = MB_DATA_DATA;
-			}
-		}
-
-	/* set kind and error in mb_io_ptr */
-	mb_io_ptr->new_kind = dataplus->kind;
-	mb_io_ptr->new_error = *error;
-
-	/* translate values to hydrosweep data storage structure */
-	if (status == MB_SUCCESS
-		&& store != NULL)
-		{
-		/* type of data record */
-		store->kind = dataplus->kind;
-
-		/* time stamp (all records ) */
-		mb_io_ptr->new_time_d = data->seconds
-			+ 0.000001*data->microseconds;
-		mb_get_date(verbose,mb_io_ptr->new_time_d,
-			mb_io_ptr->new_time_i);
-		store->year = mb_io_ptr->new_time_i[0];
-		store->month = mb_io_ptr->new_time_i[1];
-		store->day = mb_io_ptr->new_time_i[2];
-		store->hour = mb_io_ptr->new_time_i[3];
-		store->minute = mb_io_ptr->new_time_i[4];
-		store->second = mb_io_ptr->new_time_i[5];
-		store->alt_minute = 0;
-		store->alt_second = 0;
-
-		/* position (all records ) */
-		store->lon = 0.0000001*data->lon;
-		store->lat = 0.0000001*data->lat;
-		if (store->lon > 180.)
-			store->lon = store->lon - 360.;
-		else if (store->lon < -180.)
-			store->lon = store->lon + 360.;
-
-		/* additional navigation and depths (ERGNMESS and ERGNEICH) */
-		store->course_true = 0.1*data->heading;
-		store->speed_transverse = 0.0;
-		store->speed = 0.1*data->speed;
-		store->speed_reference[0] = data->speed_ref;
-		store->pitch = 0.1*data->pitch;
-		store->track = 0;
-		store->depth_center
-			= data->depth[MBSYS_HSDS_BEAMS/2];
-		/*store->depth_scale = 0.01*data->scale;*/
-		store->depth_scale = 1.0;
-		store->spare = 1;
-		id = MBSYS_HSDS_BEAMS - 1;
-		for (i=0;i<MBSYS_HSDS_BEAMS;i++)
-			{
-			store->distance[id-i] = data->range[i];
-			store->depth[id-i] = data->depth[i];
-			}
-
-		/* travel time data (ERGNSLZT) */
-		store->course_ground = 0.1*data->course;
-		store->speed_ground = 0.0;
-		store->heave = 0.0;
-		store->roll = 0.0;
-		store->time_center = 0.0;
-		store->time_scale = 0.0;
-		for (i=0;i<MBSYS_HSDS_BEAMS;i++)
-			store->time[i] = 0;
-		for (i=0;i<11;i++)
-			store->gyro[i] = 0.0;
-
-		/* amplitude data (ERGNAMPL) */
-		store->mode[0] = '\0';
-		store->trans_strbd = 0;
-		store->trans_vert = 0;
-		store->trans_port = 0;
-		store->pulse_len_strbd = 0;
-		store->pulse_len_vert = 0;
-		store->pulse_len_port = 0;
-		store->gain_start = 0;
-		store->r_compensation_factor = 0;
-		store->compensation_start = 0;
-		store->increase_start = 0;
-		store->tvc_near = 0;
-		store->tvc_far = 0;
-		store->increase_int_near = 0;
-		store->increase_int_far = 0;
-		store->gain_center = 0;
-		store->filter_gain = 0.0;
-		store->amplitude_center = 0;
-		store->echo_duration_center = 0;
-		store->echo_scale_center = 0;
-		for (i=0;i<MBSYS_HSDS_BEAMS;i++)
-			{
-			store->amplitude[i] = 0;
-			store->echo_duration[i] = 0;
-			}
-		for (i=0;i<16;i++)
-			{
-			store->gain[i] = 0;
-			store->echo_scale[i] = 0;
-			}
-
-		/* mean velocity (ERGNHYDI) */
-		store->draught = 0.0;
-		store->vel_mean = 0.0;
-		store->vel_keel = 0.0;
-		store->tide = 0.0;
-
-		/* water velocity profile (HS_ERGNCTDS) */
-		store->num_vel = 0.0;
-
-		/* navigation source (ERGNPOSI) */
-		store->pos_corr_x = 0.0;
-		store->pos_corr_y = 0.0;
-		strncpy(store->sensors,"\0",8);
-
-		/* comment (LDEOCMNT) */
-		strncpy(store->comment,&datacomment[4],
-			MBSYS_HSDS_MAXLINE);
-
-		/* processed backscatter */
-		store->back_scale = 0.0;
-		for (i=0;i<MBSYS_HSDS_BEAMS;i++)
-			store->back[i] = 0;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_wt_hsldedmb(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_wt_hsldedmb";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_hsldedmb_struct *dataplus;
-	struct mbf_hsldedmb_data_struct *data;
-	struct mbsys_hsds_struct *store;
-	char	*datacomment;
-	int	time_i[7];
-	double	time_d;
-	int	i;
-	int	id;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	dataplus = (struct mbf_hsldedmb_struct *) mb_io_ptr->raw_data;
-	data = &(dataplus->data);
-	datacomment = (char *) data;
-	store = (struct mbsys_hsds_struct *) store_ptr;
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Status at beginning of MBIO function <%s>\n",function_name);
-		if (store != NULL)
-			fprintf(stderr,"dbg5       store->kind:    %d\n",
-				store->kind);
-		fprintf(stderr,"dbg5       new_kind:       %d\n",
-			mb_io_ptr->new_kind);
-		fprintf(stderr,"dbg5       new_error:      %d\n",
-			mb_io_ptr->new_error);
-		fprintf(stderr,"dbg5       error:          %d\n",*error);
-		fprintf(stderr,"dbg5       status:         %d\n",status);
-		}
-
-	/* first set some plausible amounts for some of the
-		variables in the HSLDEDMB record */
-	data->course = 0;
-	data->pitch = 0;
-	data->scale = 100;	/* this is a unit scale factor */
-	data->speed_ref = 'B';	/* assume speed is over the ground */
-	data->quality = '\0';
-	for (i=0;i<4;i++)
-		data->flag[i] = 0.0;
-
-	/* second translate values from hydrosweep data storage structure */
-	if (store != NULL)
-		{
-		dataplus->kind = store->kind;
-		if (store->kind == MB_DATA_DATA)
-			{
-			/* position */
-			if (store->lon < -180.0)
-				store->lon = store->lon + 360.0;
-			if (store->lon > 180.0)
-				store->lon = store->lon - 360.0;
-			data->lon = (int)(0.5 + 10000000.0*store->lon);
-			data->lat = (int)(0.5 + 10000000.0*store->lat);
-
-			/* time stamp */
-			time_i[0] = store->year;
-			time_i[1] = store->month;
-			time_i[2] = store->day;
-			time_i[3] = store->hour;
-			time_i[4] = store->minute;
-			time_i[5] = store->second;
-			time_i[6] = 0;
-			mb_get_time(verbose,time_i,&time_d);
-			data->seconds = (int) time_d;
-
-			/* additional navigation and depths */
-			data->heading = 10.0*store->course_true;
-			data->course = 10.0*store->course_ground;
-			data->speed = 10*store->speed;
-			data->speed_ref = store->speed_reference[0];
-			data->pitch = 10.0*store->pitch;
-			data->scale = 100*store->depth_scale;
-			id = MBSYS_HSDS_BEAMS - 1;
-			for (i=0;i<MBSYS_HSDS_BEAMS;i++)
-				{
-				data->range[i] = store->distance[id-i];
-				data->depth[i] = store->depth[id-i];
-				}
-			}
-
-		/* comment */
-		else if (store->kind == MB_DATA_COMMENT)
-			{
-			strcpy(datacomment,"zzzz");
-			strncat(datacomment,store->comment,MBSYS_HSDS_MAXLINE);
-			}
-		}
-
-	/* byte swap the data if necessary */
-#ifdef BYTESWAPPED
-	if (dataplus->kind == MB_DATA_DATA)
-		{
-		data->seconds = mb_swap_int(data->seconds);
-		data->microseconds = mb_swap_int(data->microseconds);
-		data->alt_seconds = mb_swap_int(data->alt_seconds);
-		data->alt_microseconds = mb_swap_int(data->alt_microseconds);
-		data->lat = mb_swap_int(data->lat);
-		data->lon = mb_swap_int(data->lon);
-		data->heading = mb_swap_short(data->heading);
-		data->course = mb_swap_short(data->course);
-		data->speed = mb_swap_short(data->speed);
-		data->pitch = mb_swap_short(data->pitch);
-		data->scale = mb_swap_short(data->scale);
-		for (i=0;i<MBSYS_HSDS_BEAMS;i++)
-			{
-			data->depth[i] = mb_swap_short(data->depth[i]);
-			data->range[i] = mb_swap_short(data->range[i]);
-			}
-		for (i=0;i<4;i++)
-			data->flag[i] = mb_swap_int(data->flag[i]);
-
-		}
-#endif
-
-	/* write next record to file */
-	if (dataplus->kind == MB_DATA_DATA
-		|| dataplus->kind == MB_DATA_COMMENT)
-		{
-		if ((status = fwrite(data,1,mb_io_ptr->data_structure_size,
-			mb_io_ptr->mbfp))
-			== mb_io_ptr->data_structure_size)
-			{
-			status = MB_SUCCESS;
-			*error = MB_ERROR_NO_ERROR;
-			}
-		else
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_WRITE_FAIL;
-			}
-		}
-	else
-		{
-		status = MB_SUCCESS;
-		*error = MB_ERROR_NO_ERROR;
-		if (verbose >= 5)
-			fprintf(stderr,"\ndbg5  No data written in MBIO function <%s>\n",function_name);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mbr_hsldeoih.c b/src/mbio/mbr_hsldeoih.c
deleted file mode 100644
index 18d1dc3..0000000
--- a/src/mbio/mbr_hsldeoih.c
+++ /dev/null
@@ -1,4047 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbr_hsldeoih.c	2/11/93
- *	$Id: mbr_hsldeoih.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1993-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbr_hsldeoih.c contains the functions for reading and writing
- * multibeam data in the HSLDEOIH format.
- * These functions include:
- *   mbr_alm_hsldeoih	- allocate read/write memory
- *   mbr_dem_hsldeoih	- deallocate read/write memory
- *   mbr_rt_hsldeoih	- read and translate data
- *   mbr_wt_hsldeoih	- translate and write data
- *
- * Author:	D. W. Caress
- * Date:	February 11, 1993
- * $Log: mbr_hsldeoih.c,v $
- * Revision 5.8  2005/11/05 00:48:04  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.7  2005/05/05 23:51:32  caress
- * Added code to detect bad scaling of the depth_center value found in some early (e.g 1995-1996) format 24 data files. In these cases, the center depth value is 100 times the correct value. This is detected and fixed when the depth value is > 12000.0.
- *
- * Revision 5.6  2003/05/20 18:05:32  caress
- * Added svp_source to data source parameters.
- *
- * Revision 5.5  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.4  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.3  2001/07/20 00:32:54  caress
- * Release 5.0.beta03
- *
- * Revision 5.2  2001/03/22  20:50:02  caress
- * Trying to make version 5.0.beta0
- *
- * Revision 5.1  2001/01/22  07:43:34  caress
- * Version 5.0.beta01
- *
- * Revision 5.0  2000/12/01  22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.17  2000/10/11  01:03:21  caress
- * Convert to ANSI C
- *
- * Revision 4.16  2000/09/30  06:34:20  caress
- * Snapshot for Dale.
- *
- * Revision 4.15  2000/03/08  00:44:59  caress
- * Version 4.6.10
- *
- * Revision 4.14  1999/07/16  19:24:15  caress
- * Yet another version.
- *
- * Revision 4.13  1998/10/05  17:46:15  caress
- * MB-System version 4.6beta
- *
- * Revision 4.12  1997/07/25  14:19:53  caress
- * Version 4.5beta2.
- * Much mucking, particularly with Simrad formats.
- *
- * Revision 4.11  1997/04/21  17:02:07  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.10  1996/04/24  01:14:38  caress
- * Code now keeps any water sound velocity or position offset
- * data encountered in memory.
- *
- * Revision 4.10  1996/04/24  01:14:38  caress
- * Code now keeps any water sound velocity or position offset
- * data encountered in memory.
- *
- * Revision 4.9  1996/04/22  13:21:19  caress
- * Now have DTR and MIN/MAX defines in mb_define.h
- *
- * Revision 4.8  1995/07/26  14:45:39  caress
- * Fixed problems related to shallow water data.
- *
- * Revision 4.7  1995/03/08  18:13:53  caress
- * Fixed another bug regarding shallow water data.
- *
- * Revision 4.6  1995/03/08  13:31:09  caress
- * Fixed bug related to handling of shallow water data and the depth scale.
- *
- * Revision 4.5  1995/03/06  19:38:54  caress
- * Changed include strings.h to string.h for POSIX compliance.
- *
- * Revision 4.4  1995/02/22  21:55:10  caress
- * Fixed reading of amplitude data from existing data.
- *
- * Revision 4.3  1994/10/21  12:20:01  caress
- * Release V4.0
- *
- * Revision 4.2  1994/07/29  18:46:51  caress
- * Changes associated with supporting Lynx OS (byte swapped) and
- * using unix second time base (for time_d values).
- *
- * Revision 4.1  1994/05/21  02:23:29  caress
- * Made sure that mb_io_ptr->new_bath_alongtrack is set to zero on reading.
- *
- * Revision 4.0  1994/03/06  00:01:56  caress
- * First cut at version 4.0
- *
- * Revision 4.2  1994/03/03  03:39:43  caress
- * Fixed copyright message.
- *
- * Revision 4.1  1994/03/03  03:15:16  caress
- * Fixed bug relating to processed amplitude data.
- *
- * Revision 4.0  1994/02/21  03:59:50  caress
- * First cut at new version. Altered to be consistent
- * with passing of three types of data: bathymetry,
- * amplitude, and sidescan.
- *
- * Revision 3.0  1993/05/14  22:56:08  sohara
- * initial version
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mb_define.h"
-#include "mbsys_hsds.h"
-#include "mbf_hsldeoih.h"
-
-/* include for byte swapping on little-endian machines */
-#ifdef BYTESWAPPED
-#include "mb_swap.h"
-#endif
-
-/* local defines */
-#define ZERO_ALL    0
-#define ZERO_SOME   1
-
-/* essential function prototypes */
-int mbr_register_hsldeoih(int verbose, void *mbio_ptr,
-		int *error);
-int mbr_info_hsldeoih(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_alm_hsldeoih(int verbose, void *mbio_ptr, int *error);
-int mbr_dem_hsldeoih(int verbose, void *mbio_ptr, int *error);
-int mbr_zero_hsldeoih(int verbose, void *data_ptr, int mode, int *error);
-int mbr_rt_hsldeoih(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_wt_hsldeoih(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_hsldeoih_rd_data(int verbose, void *mbio_ptr, int *error);
-int mbr_hsldeoih_rd_nav_source(int verbose, FILE *mbfp,
-		struct mbf_hsldeoih_struct *data, int *error);
-int mbr_hsldeoih_rd_mean_velocity(int verbose, FILE *mbfp,
-		struct mbf_hsldeoih_struct *data, int *error);
-int mbr_hsldeoih_rd_velocity_profile(int verbose, FILE *mbfp,
-		struct mbf_hsldeoih_struct *data, int *error);
-int mbr_hsldeoih_rd_standby(int verbose, FILE *mbfp,
-		struct mbf_hsldeoih_struct *data, int *error);
-int mbr_hsldeoih_rd_survey(int verbose, FILE *mbfp,
-		struct mbf_hsldeoih_struct *data, int *error);
-int mbr_hsldeoih_rd_calibrate(int verbose, FILE *mbfp,
-		struct mbf_hsldeoih_struct *data, int *error);
-int mbr_hsldeoih_rd_comment(int verbose, FILE *mbfp,
-		struct mbf_hsldeoih_struct *data, int *error);
-int mbr_hsldeoih_wr_data(int verbose, void *mbio_ptr, void *data_ptr, int *error);
-int mbr_hsldeoih_wr_nav_source(int verbose, FILE *mbfp,
-		struct mbf_hsldeoih_struct *data, int *error);
-int mbr_hsldeoih_wr_mean_velocity(int verbose, FILE *mbfp,
-		struct mbf_hsldeoih_struct *data, int *error);
-int mbr_hsldeoih_wr_velocity_profile(int verbose, FILE *mbfp,
-		struct mbf_hsldeoih_struct *data, int *error);
-int mbr_hsldeoih_wr_standby(int verbose, FILE *mbfp,
-		struct mbf_hsldeoih_struct *data, int *error);
-int mbr_hsldeoih_wr_survey(int verbose, FILE *mbfp,
-		struct mbf_hsldeoih_struct *data, int *error);
-int mbr_hsldeoih_wr_calibrate(int verbose, FILE *mbfp,
-		struct mbf_hsldeoih_struct *data, int *error);
-int mbr_hsldeoih_wr_comment(int verbose, FILE *mbfp,
-		struct mbf_hsldeoih_struct *data, int *error);
-
-static char rcs_id[]="$Id: mbr_hsldeoih.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mbr_register_hsldeoih(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_register_hsldeoih";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* get mb_io_ptr */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set format info parameters */
-	status = mbr_info_hsldeoih(verbose,
-			&mb_io_ptr->system,
-			&mb_io_ptr->beams_bath_max,
-			&mb_io_ptr->beams_amp_max,
-			&mb_io_ptr->pixels_ss_max,
-			mb_io_ptr->format_name,
-			mb_io_ptr->system_name,
-			mb_io_ptr->format_description,
-			&mb_io_ptr->numfile,
-			&mb_io_ptr->filetype,
-			&mb_io_ptr->variable_beams,
-			&mb_io_ptr->traveltime,
-			&mb_io_ptr->beam_flagging,
-			&mb_io_ptr->nav_source,
-			&mb_io_ptr->heading_source,
-			&mb_io_ptr->vru_source,
-			&mb_io_ptr->svp_source,
-			&mb_io_ptr->beamwidth_xtrack,
-			&mb_io_ptr->beamwidth_ltrack,
-			error);
-
-	/* set format and system specific function pointers */
-	mb_io_ptr->mb_io_format_alloc = &mbr_alm_hsldeoih;
-	mb_io_ptr->mb_io_format_free = &mbr_dem_hsldeoih;
-	mb_io_ptr->mb_io_store_alloc = &mbsys_hsds_alloc;
-	mb_io_ptr->mb_io_store_free = &mbsys_hsds_deall;
-	mb_io_ptr->mb_io_read_ping = &mbr_rt_hsldeoih;
-	mb_io_ptr->mb_io_write_ping = &mbr_wt_hsldeoih;
-	mb_io_ptr->mb_io_dimensions = &mbsys_hsds_dimensions;
-	mb_io_ptr->mb_io_extract = &mbsys_hsds_extract;
-	mb_io_ptr->mb_io_insert = &mbsys_hsds_insert;
-	mb_io_ptr->mb_io_extract_nav = &mbsys_hsds_extract_nav;
-	mb_io_ptr->mb_io_insert_nav = &mbsys_hsds_insert_nav;
-	mb_io_ptr->mb_io_extract_altitude = &mbsys_hsds_extract_altitude;
-	mb_io_ptr->mb_io_insert_altitude = NULL;
-	mb_io_ptr->mb_io_extract_svp = &mbsys_hsds_extract_svp;
-	mb_io_ptr->mb_io_insert_svp = &mbsys_hsds_insert_svp;
-	mb_io_ptr->mb_io_ttimes = &mbsys_hsds_ttimes;
-	mb_io_ptr->mb_io_detects = &mbsys_hsds_detects;
-	mb_io_ptr->mb_io_copyrecord = &mbsys_hsds_copy;
-	mb_io_ptr->mb_io_extract_rawss = NULL;
-	mb_io_ptr->mb_io_insert_rawss = NULL;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",mb_io_ptr->system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",mb_io_ptr->beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",mb_io_ptr->beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",mb_io_ptr->pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",mb_io_ptr->format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",mb_io_ptr->system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",mb_io_ptr->format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",mb_io_ptr->numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",mb_io_ptr->filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",mb_io_ptr->variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",mb_io_ptr->traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",mb_io_ptr->beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",mb_io_ptr->nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",mb_io_ptr->heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",mb_io_ptr->vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",mb_io_ptr->svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",mb_io_ptr->beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",mb_io_ptr->beamwidth_ltrack);
-		fprintf(stderr,"dbg2       format_alloc:       %p\n",(void *)mb_io_ptr->mb_io_format_alloc);
-		fprintf(stderr,"dbg2       format_free:        %p\n",(void *)mb_io_ptr->mb_io_format_free);
-		fprintf(stderr,"dbg2       store_alloc:        %p\n",(void *)mb_io_ptr->mb_io_store_alloc);
-		fprintf(stderr,"dbg2       store_free:         %p\n",(void *)mb_io_ptr->mb_io_store_free);
-		fprintf(stderr,"dbg2       read_ping:          %p\n",(void *)mb_io_ptr->mb_io_read_ping);
-		fprintf(stderr,"dbg2       write_ping:         %p\n",(void *)mb_io_ptr->mb_io_write_ping);
-		fprintf(stderr,"dbg2       extract:            %p\n",(void *)mb_io_ptr->mb_io_extract);
-		fprintf(stderr,"dbg2       insert:             %p\n",(void *)mb_io_ptr->mb_io_insert);
-		fprintf(stderr,"dbg2       extract_nav:        %p\n",(void *)mb_io_ptr->mb_io_extract_nav);
-		fprintf(stderr,"dbg2       insert_nav:         %p\n",(void *)mb_io_ptr->mb_io_insert_nav);
-		fprintf(stderr,"dbg2       extract_altitude:   %p\n",(void *)mb_io_ptr->mb_io_extract_altitude);
-		fprintf(stderr,"dbg2       insert_altitude:    %p\n",(void *)mb_io_ptr->mb_io_insert_altitude);
-		fprintf(stderr,"dbg2       extract_svp:        %p\n",(void *)mb_io_ptr->mb_io_extract_svp);
-		fprintf(stderr,"dbg2       insert_svp:         %p\n",(void *)mb_io_ptr->mb_io_insert_svp);
-		fprintf(stderr,"dbg2       ttimes:             %p\n",(void *)mb_io_ptr->mb_io_ttimes);
-		fprintf(stderr,"dbg2       detects:            %p\n",(void *)mb_io_ptr->mb_io_detects);
-		fprintf(stderr,"dbg2       extract_rawss:      %p\n",(void *)mb_io_ptr->mb_io_extract_rawss);
-		fprintf(stderr,"dbg2       insert_rawss:       %p\n",(void *)mb_io_ptr->mb_io_insert_rawss);
-		fprintf(stderr,"dbg2       copyrecord:         %p\n",(void *)mb_io_ptr->mb_io_copyrecord);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbr_info_hsldeoih(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error)
-{
-	char	*function_name = "mbr_info_hsldeoih";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* set format info parameters */
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-	*system = MB_SYS_HSDS;
-	*beams_bath_max = 59;
-	*beams_amp_max = 59;
-	*pixels_ss_max = 0;
-	strncpy(format_name, "HSLDEOIH", MB_NAME_LENGTH);
-	strncpy(system_name, "HSDS", MB_NAME_LENGTH);
-	strncpy(format_description, "Format name:          MBF_HSLDEOIH\nInformal Description: L-DEO in-house binary Hydrosweep\nAttributes:           Hydrosweep DS, 59 beams, bathymetry and amplitude, \n                      binary, centered, L-DEO.\n", MB_DESCRIPTION_LENGTH);
-	*numfile = 1;
-	*filetype = MB_FILETYPE_NORMAL;
-	*variable_beams = MB_NO;
-	*traveltime = MB_YES;
-	*beam_flagging = MB_YES;
-	*nav_source = MB_DATA_DATA;
-	*heading_source = MB_DATA_DATA;
-	*vru_source = MB_DATA_DATA;
-	*svp_source = MB_DATA_VELOCITY_PROFILE;
-	*beamwidth_xtrack = 2.0;
-	*beamwidth_ltrack = 2.0;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",*system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",*beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",*beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",*pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",*numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",*filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",*variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",*traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",*beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",*nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",*heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",*vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",*svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",*beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",*beamwidth_ltrack);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_alm_hsldeoih(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_alm_hsldeoih";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_hsldeoih_struct *data;
-	char	*data_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set initial status */
-	status = MB_SUCCESS;
-
-	/* allocate memory for data structure */
-	mb_io_ptr->structure_size = sizeof(struct mbf_hsldeoih_struct);
-	mb_io_ptr->data_structure_size = 0;
-	status = mb_malloc(verbose,mb_io_ptr->structure_size,
-				&mb_io_ptr->raw_data,error);
-	status = mb_malloc(verbose,sizeof(struct mbsys_hsds_struct),
-				&mb_io_ptr->store_data,error);
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-	data = (struct mbf_hsldeoih_struct *) mb_io_ptr->raw_data;
-	data_ptr = (char *) data;
-
-	/* initialize everything to zeros */
-	mbr_zero_hsldeoih(verbose,data_ptr,ZERO_ALL,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_dem_hsldeoih(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_dem_hsldeoih";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* deallocate memory for data descriptor */
-	status = mb_free(verbose,&mb_io_ptr->raw_data,error);
-	status = mb_free(verbose,&mb_io_ptr->store_data,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_zero_hsldeoih(int verbose, void *data_ptr, int mode, int *error)
-{
-	char	*function_name = "mbr_zero_hsldeoih";
-	int	status = MB_SUCCESS;
-	struct mbf_hsldeoih_struct *data;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       data_ptr:   %p\n",(void *)data_ptr);
-		fprintf(stderr,"dbg2       mode:       %d\n",mode);
-		}
-
-	/* get pointer to data descriptor */
-	data = (struct mbf_hsldeoih_struct *) data_ptr;
-
-	/* initialize almost everything to zeros */
-	if (data != NULL)
-		{
-		/* type of data record */
-		data->kind = MB_DATA_NONE;
-
-		/* position (all records ) */
-		data->lon = 0.0;
-		data->lat = 0.0;
-
-		/* time stamp (all records ) */
-		data->year = 0;
-		data->month = 0;
-		data->day = 0;
-		data->hour = 0;
-		data->minute = 0;
-		data->second = 0;
-		data->alt_minute = 0;
-		data->alt_second = 0;
-
-		/* additional navigation and depths (ERGNMESS and ERGNEICH) */
-		data->course_true = 0.0;
-		data->speed_transverse = 0.0;
-		data->speed = 0.0;
-		data->speed_reference[0] = '\0';
-		data->pitch = 0.0;
-		data->track = 0;
-		data->depth_center = 0.0;
-		data->depth_scale = 0.0;
-		data->spare = 0;
-		for (i=0;i<MBF_HSLDEOIH_BEAMS;i++)
-			{
-			data->distance[i] = 0;
-			data->depth[i] = 0;
-			}
-
-		/* travel time data (ERGNSLZT) */
-		data->course_ground = 0.0;
-		data->speed_ground = 0.0;
-		data->heave = 0.0;
-		data->roll = 0.0;
-		data->time_center = 0.0;
-		data->time_scale = 0.0;
-		for (i=0;i<MBF_HSLDEOIH_BEAMS;i++)
-			data->time[i] = 0;
-		for (i=0;i<11;i++)
-			data->gyro[i] = 0.0;
-
-		/* amplitude data (ERGNAMPL) */
-		data->mode[0] = '\0';
-		data->trans_strbd = 0;
-		data->trans_vert = 0;
-		data->trans_port = 0;
-		data->pulse_len_strbd = 0;
-		data->pulse_len_vert = 0;
-		data->pulse_len_port = 0;
-		data->gain_start = 0;
-		data->r_compensation_factor = 0;
-		data->compensation_start = 0;
-		data->increase_start = 0;
-		data->tvc_near = 0;
-		data->tvc_far = 0;
-		data->increase_int_near = 0;
-		data->increase_int_far = 0;
-		data->gain_center = 0;
-		data->filter_gain = 0.0;
-		data->amplitude_center = 0;
-		data->echo_duration_center = 0;
-		data->echo_scale_center = 0;
-		for (i=0;i<16;i++)
-			{
-			data->gain[i] = 0;
-			data->echo_scale[i] = 0;
-			}
-		for (i=0;i<MBF_HSLDEOIH_BEAMS;i++)
-			{
-			data->amplitude[i] = 0;
-			data->echo_duration[i] = 0;
-			}
-
-		/* these values zeroed only when structure
-			is first allocated - this allows
-			these values to be remembered internally
-			once one of these occasional data
-			records is encountered */
-		if (mode == ZERO_ALL)
-			{
-			/* mean velocity (ERGNHYDI) */
-			data->draught = 0.0;
-			data->vel_mean = 0.0;
-			data->vel_keel = 0.0;
-			data->tide = 0.0;
-
-			/* water velocity profile */
-			data->num_vel = 0;
-			for (i=0;i<MBF_HSLDEOIH_MAXVEL;i++)
-				{
-				data->depth[i] = 0;
-				data->velocity[i] = 0;
-				}
-
-			/* navigation source (ERGNPOSI) */
-			data->pos_corr_x = 0.0;
-			data->pos_corr_y = 0.0;
-			strncpy(data->sensors,"POS",9);
-			}
-
-		/* comment (LDEOCOMM) */
-		strncpy(data->comment,"\0",MBF_HSLDEOIH_MAXLINE);
-
-		/* processed backscatter */
-		data->back_scale = 0.0;
-		for (i=0;i<MBF_HSLDEOIH_BEAMS;i++)
-			data->back[i] = 0;
-		}
-
-	/* assume success */
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_rt_hsldeoih(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_rt_hsldeoih";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_hsldeoih_struct *data;
-	struct mbsys_hsds_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointers to mbio descriptor and data structures */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-	data = (struct mbf_hsldeoih_struct *) mb_io_ptr->raw_data;
-	store = (struct mbsys_hsds_struct *) store_ptr;
-
-	/* read next data from file */
-	status = mbr_hsldeoih_rd_data(verbose,mbio_ptr,error);
-
-	/* set error and kind in mb_io_ptr */
-	mb_io_ptr->new_error = *error;
-	mb_io_ptr->new_kind = data->kind;
-
-	/* translate values to hydrosweep data storage structure */
-	if (status == MB_SUCCESS
-		&& store != NULL)
-		{
-		/* type of data record */
-		store->kind = data->kind;
-
-		/* position (all records ) */
-		store->lon = data->lon;
-		store->lat = data->lat;
-
-		/* time stamp (all records ) */
-		store->year = data->year;
-		store->month = data->month;
-		store->day = data->day;
-		store->hour = data->hour;
-		store->minute = data->minute;
-		store->second = data->second;
-		store->alt_minute = data->alt_minute;
-		store->alt_second = data->alt_second;
-
-		/* additional navigation and depths (ERGNMESS and ERGNEICH) */
-		store->course_true = data->course_true;
-		store->speed_transverse = data->speed_transverse;
-		store->speed = data->speed;
-		store->speed_reference[0] = data->speed_reference[0];
-		store->pitch = data->pitch;
-		store->track = data->track;
-		store->depth_center = data->depth_center;
-		store->depth_scale = data->depth_scale;
-		store->spare = data->spare;
-		for (i=0;i<MBSYS_HSDS_BEAMS;i++)
-			{
-			store->distance[i] = data->distance[i];
-			store->depth[i] = data->depth[i];
-			}
-
-		/* travel time data (ERGNSLZT) */
-		store->course_ground = data->course_ground;
-		store->speed_ground = data->speed_ground;
-		store->heave = data->heave;
-		store->roll = data->roll;
-		store->time_center = data->time_center;
-		store->time_scale = data->time_scale;
-		for (i=0;i<MBSYS_HSDS_BEAMS;i++)
-			store->time[i] = data->time[i];
-		for (i=0;i<11;i++)
-			store->gyro[i] = data->gyro[i];
-
-		/* amplitude data (ERGNAMPL) */
-		store->mode[0] = data->mode[0];
-		store->trans_strbd = data->trans_strbd;
-		store->trans_vert = data->trans_vert;
-		store->trans_port = data->trans_port;
-		store->pulse_len_strbd = data->pulse_len_strbd;
-		store->pulse_len_vert = data->pulse_len_vert;
-		store->pulse_len_port = data->pulse_len_port;
-		store->gain_start = data->gain_start;
-		store->r_compensation_factor = data->r_compensation_factor;
-		store->compensation_start = data->compensation_start;
-		store->increase_start = data->increase_start;
-		store->tvc_near = data->tvc_near;
-		store->tvc_far = data->tvc_far;
-		store->increase_int_near = data->increase_int_near;
-		store->increase_int_far = data->increase_int_far;
-		store->gain_center = data->gain_center;
-		store->filter_gain = data->filter_gain;
-		store->amplitude_center = data->amplitude_center;
-		store->echo_duration_center = data->echo_duration_center;
-		store->echo_scale_center = data->echo_scale_center;
-		for (i=0;i<MBSYS_HSDS_BEAMS;i++)
-			{
-			store->amplitude[i] = data->amplitude[i];
-			store->echo_duration[i] = data->echo_duration[i];
-			}
-		for (i=0;i<16;i++)
-			{
-			store->gain[i] = data->gain[i];
-			store->echo_scale[i] = data->echo_scale[i];
-			}
-
-		/* mean velocity (ERGNHYDI) */
-		store->draught = data->draught;
-		store->vel_mean = data->vel_mean;
-		store->vel_keel = data->vel_keel;
-		store->tide = data->tide;
-
-		/* water velocity profile (HS_ERGNCTDS) */
-		store->num_vel = data->num_vel;
-		for (i=0;i<MBF_HSLDEOIH_MAXVEL;i++)
-			{
-			store->vdepth[i] = data->vdepth[i];
-			store->velocity[i] = data->velocity[i];
-			}
-
-		/* navigation source (ERGNPOSI) */
-		store->pos_corr_x = data->pos_corr_x;
-		store->pos_corr_y = data->pos_corr_y;
-		strncpy(store->sensors,data->sensors,8);
-
-		/* comment (LDEOCMNT) */
-		strncpy(store->comment,data->comment,MBSYS_HSDS_MAXLINE);
-
-		/* processed backscatter */
-		store->back_scale = data->back_scale;
-		for (i=0;i<MBF_HSLDEOIH_BEAMS;i++)
-			{
-			store->back[i] = data->back[i];
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_wt_hsldeoih(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_wt_hsldeoih";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_hsldeoih_struct *data;
-	char	*data_ptr;
-	struct mbsys_hsds_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_hsldeoih_struct *) mb_io_ptr->raw_data;
-	data_ptr = (char *) data;
-	store = (struct mbsys_hsds_struct *) store_ptr;
-
-	/* first translate values from data storage structure */
-	if (store != NULL)
-		{
-		/* type of data record */
-		data->kind = store->kind;
-
-		/* position (all records ) */
-		data->lon = store->lon;
-		data->lat = store->lat;
-
-		/* time stamp (all records ) */
-		data->year = store->year;
-		data->month = store->month;
-		data->day = store->day;
-		data->hour = store->hour;
-		data->minute = store->minute;
-		data->second = store->second;
-		data->alt_minute = store->alt_minute;
-		data->alt_second = store->alt_second;
-
-		/* additional navigation and depths (ERGNMESS and ERGNEICH) */
-		data->course_true = store->course_true;
-		data->speed_transverse = store->speed_transverse;
-		data->speed = store->speed;
-		data->speed_reference[0] = store->speed_reference[0];
-		data->pitch = store->pitch;
-		data->track = store->track;
-		data->depth_center = store->depth_center;
-		data->depth_scale = store->depth_scale;
-		data->spare = store->spare;
-		for (i=0;i<MBSYS_HSDS_BEAMS;i++)
-			{
-			data->distance[i] = store->distance[i];
-			data->depth[i] = store->depth[i];
-			}
-
-		/* travel time data (ERGNSLZT) */
-		data->course_ground = store->course_ground;
-		data->speed_ground = store->speed_ground;
-		data->heave = store->heave;
-		data->roll = store->roll;
-		data->time_center = store->time_center;
-		data->time_scale = store->time_scale;
-		for (i=0;i<MBSYS_HSDS_BEAMS;i++)
-			data->time[i] = store->time[i];
-		for (i=0;i<11;i++)
-			data->gyro[i] = store->gyro[i];
-
-		/* amplitude data (ERGNAMPL) */
-		data->mode[0] = store->mode[0];
-		data->trans_strbd = store->trans_strbd;
-		data->trans_vert = store->trans_vert;
-		data->trans_port = store->trans_port;
-		data->pulse_len_strbd = store->pulse_len_strbd;
-		data->pulse_len_vert = store->pulse_len_vert;
-		data->pulse_len_port = store->pulse_len_port;
-		data->gain_start = store->gain_start;
-		data->r_compensation_factor = store->r_compensation_factor;
-		data->compensation_start = store->compensation_start;
-		data->increase_start = store->increase_start;
-		data->tvc_near = store->tvc_near;
-		data->tvc_far = store->tvc_far;
-		data->increase_int_near = store->increase_int_near;
-		data->increase_int_far = store->increase_int_far;
-		data->gain_center = store->gain_center;
-		data->filter_gain = store->filter_gain;
-		data->amplitude_center = store->amplitude_center;
-		data->echo_duration_center = store->echo_duration_center;
-		data->echo_scale_center = store->echo_scale_center;
-		for (i=0;i<MBSYS_HSDS_BEAMS;i++)
-			{
-			data->amplitude[i] = store->amplitude[i];
-			data->echo_duration[i] = store->echo_duration[i];
-			}
-		for (i=0;i<16;i++)
-			{
-			data->gain[i] = store->gain[i];
-			data->echo_scale[i] = store->echo_scale[i];
-			}
-
-		/* mean velocity (ERGNHYDI) */
-		data->draught = store->draught;
-		data->vel_mean = store->vel_mean;
-		data->vel_keel = store->vel_keel;
-		data->tide = store->tide;
-
-		/* water velocity profile (HS_ERGNCTDS) */
-		data->num_vel = store->num_vel;
-		for (i=0;i<MBF_HSLDEOIH_MAXVEL;i++)
-			{
-			data->vdepth[i] = store->vdepth[i];
-			data->velocity[i] = store->velocity[i];
-			}
-
-		/* navigation source (ERGNPOSI) */
-		data->pos_corr_x = store->pos_corr_x;
-		data->pos_corr_y = store->pos_corr_y;
-		strncpy(data->sensors,store->sensors,8);
-
-		/* comment (LDEOCMNT) */
-		strncpy(data->comment,store->comment,MBSYS_HSDS_MAXLINE);
-
-		/* processed backscatter */
-		data->back_scale = store->back_scale;
-		for (i=0;i<MBF_HSLDEOIH_BEAMS;i++)
-			{
-			data->back[i] = store->back[i];
-			}
-		}
-
-	/* write next data to file */
-	status = mbr_hsldeoih_wr_data(verbose,mbio_ptr,data_ptr,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_hsldeoih_rd_data(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_hsldeoih_rd_data";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_hsldeoih_struct *data;
-	char	*data_ptr;
-	FILE	*mbfp;
-	int	label;
-	char	*labelchar;
-	int	label_test;
-	int	record_size;
-	short int	tmp;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_hsldeoih_struct *) mb_io_ptr->raw_data;
-	data_ptr = (char *) data;
-	mbfp = mb_io_ptr->mbfp;
-
-	/* initialize everything to zeros */
-	mbr_zero_hsldeoih(verbose,data_ptr,ZERO_SOME,error);
-
-	/* set file position */
-	mb_io_ptr->file_pos = mb_io_ptr->file_bytes;
-
-	/* get next record type */
-	if (fread(&label,1,sizeof(int),mbfp) == sizeof(int))
-		{
-		status = MB_SUCCESS;
-		*error = MB_ERROR_NO_ERROR;
-
-		labelchar = (char *) &label;
-		label_test = MBF_HSLDEOIH_LABEL;
-#ifdef BYTESWAPPED
-		label_test = mb_swap_int(label_test);
-#endif
-		while (label != label_test && status == MB_SUCCESS)
-			{
-			for (i=0;i<3;i++)
-				labelchar[i] = labelchar[i+1];
-			if (fread(&labelchar[3],1,1,mbfp) != 1)
-				{
-				status = MB_FAILURE;
-				*error = MB_ERROR_EOF;
-				}
-			}
-		}
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	/* see if we just encountered a record label */
-	if (status == MB_SUCCESS)
-		{
-		/* swap bytes if necessary */
-#ifdef BYTESWAPPED
-		label = mb_swap_int(label);
-#endif
-
-		if (label != MBF_HSLDEOIH_LABEL)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_UNINTELLIGIBLE;
-			}
-		}
-
-	/* read what size and kind of record it is */
-	if (status == MB_SUCCESS)
-		{
-		if ((status = fread(&tmp,1,sizeof(short int),
-			mbfp)) == sizeof(short int))
-			{
-#ifdef BYTESWAPPED
-			data->kind = (int) mb_swap_short(tmp);
-#else
-			data->kind = (int) tmp;
-#endif
-			status = MB_SUCCESS;
-			*error = MB_ERROR_NO_ERROR;
-			}
-		else
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_EOF;
-			}
-		}
-	if (status == MB_SUCCESS)
-		{
-		if ((status = fread(&tmp,1,sizeof(short int),mbfp))
-			== sizeof(short int))
-			{
-#ifdef BYTESWAPPED
-			record_size = (int) mb_swap_short(tmp);
-#else
-			record_size = (int) tmp;
-#endif
-			status = MB_SUCCESS;
-			*error = MB_ERROR_NO_ERROR;
-			}
-		else
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_EOF;
-			}
-		}
-
-	/* fix problems introduced by changes in data kind flags
-	 * that were unknowingly mapped into data files
-	 */
-	if (data->kind == MBF_HSLDEOIH_OLDKIND_CALIBRATE
-		&& record_size == 952)
-		{
-		data->kind = MBF_HSLDEOIH_KIND_CALIBRATE;
-		}
-	else if (data->kind == MBF_HSLDEOIH_OLDKIND_MEAN_VELOCITY
-		&& record_size == 40)
-		{
-		data->kind = MBF_HSLDEOIH_KIND_MEAN_VELOCITY;
-		}
-	else if (data->kind == MBF_HSLDEOIH_OLDKIND_VELOCITY_PROFILE
-		&& record_size == 264)
-		{
-		data->kind = MBF_HSLDEOIH_KIND_VELOCITY_PROFILE;
-		}
-	else if (data->kind == MBF_HSLDEOIH_OLDKIND_STANDBY
-		&& record_size == 52)
-		{
-		data->kind = MBF_HSLDEOIH_KIND_STANDBY;
-		}
-	else if (data->kind == MBF_HSLDEOIH_OLDKIND_NAV_SOURCE
-		&& record_size == 44)
-		{
-		data->kind = MBF_HSLDEOIH_KIND_NAV_SOURCE;
-		}
-
-	/* translate format kind values to MBIO kind values
-	 */
-	if (data->kind == MBF_HSLDEOIH_KIND_DATA)
-		{
-		data->kind = MB_DATA_DATA;
-		}
-	else if (data->kind == MBF_HSLDEOIH_KIND_COMMENT)
-		{
-		data->kind = MB_DATA_COMMENT;
-		}
-	else if (data->kind == MBF_HSLDEOIH_KIND_CALIBRATE)
-		{
-		data->kind = MB_DATA_CALIBRATE;
-		}
-	else if (data->kind == MBF_HSLDEOIH_KIND_MEAN_VELOCITY)
-		{
-		data->kind = MB_DATA_MEAN_VELOCITY;
-		}
-	else if (data->kind == MBF_HSLDEOIH_KIND_VELOCITY_PROFILE)
-		{
-		data->kind = MB_DATA_VELOCITY_PROFILE;
-		}
-	else if (data->kind == MBF_HSLDEOIH_KIND_STANDBY)
-		{
-		data->kind = MB_DATA_STANDBY;
-		}
-	else if (data->kind == MBF_HSLDEOIH_KIND_NAV_SOURCE)
-		{
-		data->kind = MB_DATA_NAV_SOURCE;
-		}
-
-	/* print debug statements */
-	if (verbose >= 4)
-		{
-		fprintf(stderr,"\ndbg4  Read record label in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg4       label:      %d\n",label);
-		fprintf(stderr,"dbg4       size:       %d\n",record_size);
-		fprintf(stderr,"dbg4       kind:       %d\n",data->kind);
-		fprintf(stderr,"dbg4       error:      %d\n",*error);
-		fprintf(stderr,"dbg4       status:     %d\n",status);
-		}
-
-	/* read the data */
-	if (status == MB_SUCCESS)
-		{
-		if (data->kind == MB_DATA_DATA)
-			status = mbr_hsldeoih_rd_survey(
-				verbose,mbfp,data,error);
-		else if (data->kind == MB_DATA_COMMENT)
-			status = mbr_hsldeoih_rd_comment(
-				verbose,mbfp,data,error);
-		else if (data->kind == MB_DATA_CALIBRATE)
-			status = mbr_hsldeoih_rd_calibrate(
-				verbose,mbfp,data,error);
-		else if (data->kind == MB_DATA_MEAN_VELOCITY)
-			status = mbr_hsldeoih_rd_mean_velocity(
-				verbose,mbfp,data,error);
-		else if (data->kind == MB_DATA_VELOCITY_PROFILE)
-			status = mbr_hsldeoih_rd_velocity_profile(
-				verbose,mbfp,data,error);
-		else if (data->kind == MB_DATA_STANDBY)
-			status = mbr_hsldeoih_rd_standby(
-				verbose,mbfp,data,error);
-		else if (data->kind == MB_DATA_NAV_SOURCE)
-			status = mbr_hsldeoih_rd_nav_source(
-				verbose,mbfp,data,error);
-		else
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_UNINTELLIGIBLE;
-			}
-		}
-
-	/* get file position */
-	mb_io_ptr->file_bytes = ftell(mbfp);
-
-	/* handle Hydrosweep Y2K problem */
-	if (status == MB_SUCCESS && data->year < 1962)
-		data->year = 2000 + (data->year % 100);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_hsldeoih_rd_nav_source(int verbose, FILE *mbfp,
-		struct mbf_hsldeoih_struct *data, int *error)
-{
-	char	*function_name = "mbr_hsldeoih_rd_nav_source";
-	int	status = MB_SUCCESS;
-	struct mbf_hsldeoih_nav_source_struct read_data;
-	int	read_size;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       data:       %p\n",(void *)data);
-		}
-
-	/* read record from file */
-	read_size = sizeof(read_data);
-	if ((status = fread(&read_data,1,sizeof(read_data),
-		mbfp)) != read_size)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-	else
-		{
-		status = MB_SUCCESS;
-		*error = MB_ERROR_NO_ERROR;
-		}
-
-	/* byte swap the data if necessary */
-#ifdef BYTESWAPPED
-	if (status == MB_SUCCESS)
-		{
-		mb_swap_float(&read_data.lon);
-		mb_swap_float(&read_data.lat);
-		read_data.year = mb_swap_short(read_data.year);
-		read_data.month = mb_swap_short(read_data.month);
-		read_data.day = mb_swap_short(read_data.day);
-		read_data.hour = mb_swap_short(read_data.hour);
-		read_data.minute = mb_swap_short(read_data.minute);
-		read_data.second = mb_swap_short(read_data.second);
-		read_data.alt_minute = mb_swap_short(read_data.alt_minute);
-		read_data.alt_second = mb_swap_short(read_data.alt_second);
-		mb_swap_float(&read_data.pos_corr_x);
-		mb_swap_float(&read_data.pos_corr_y);
-		}
-#endif
-
-	/* copy data to internal storage */
-	if (status == MB_SUCCESS)
-		{
-		data->lon = read_data.lon;
-		data->lat = read_data.lat;
-		data->year = read_data.year;
-		data->month = read_data.month;
-		data->day = read_data.day;
-		data->hour = read_data.hour;
-		data->minute = read_data.minute;
-		data->second = read_data.second;
-		data->alt_minute = read_data.alt_minute;
-		data->alt_second = read_data.alt_second;
-		data->pos_corr_x = read_data.pos_corr_x;
-		data->pos_corr_y = read_data.pos_corr_y;
-		strncpy(data->sensors,read_data.sensors,8);
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       longitude:        %f\n",data->lon);
-		fprintf(stderr,"dbg5       latitude:         %f\n",data->lat);
-		fprintf(stderr,"dbg5       year:             %d\n",data->year);
-		fprintf(stderr,"dbg5       month:            %d\n",data->month);
-		fprintf(stderr,"dbg5       day:              %d\n",data->day);
-		fprintf(stderr,"dbg5       hour:             %d\n",data->hour);
-		fprintf(stderr,"dbg5       minute:           %d\n",
-			data->minute);
-		fprintf(stderr,"dbg5       second:           %d\n",
-			data->second);
-		fprintf(stderr,"dbg5       alt minute:       %d\n",
-			data->alt_minute);
-		fprintf(stderr,"dbg5       alt second:       %d\n",
-			data->alt_second);
-		fprintf(stderr,"dbg5       pos_corr_x:       %f\n",
-			data->pos_corr_x);
-		fprintf(stderr,"dbg5       pos_corr_y:       %f\n",
-			data->pos_corr_y);
-		fprintf(stderr,"dbg5       sensors:          %s\n",
-			data->sensors);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_hsldeoih_rd_mean_velocity(int verbose, FILE *mbfp,
-		struct mbf_hsldeoih_struct *data, int *error)
-{
-	char	*function_name = "mbr_hsldeoih_rd_mean_velocity";
-	int	status = MB_SUCCESS;
-	struct mbf_hsldeoih_mean_velocity_struct read_data;
-	int	read_size;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       data:       %p\n",(void *)data);
-		}
-
-	/* read record from file */
-	read_size = sizeof(read_data);
-	if ((status = fread(&read_data,1,sizeof(read_data),
-		mbfp)) != read_size)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-        else
-                {
-                status = MB_SUCCESS;
-                *error = MB_ERROR_NO_ERROR;
-                }
-
-	/* byte swap the data if necessary */
-#ifdef BYTESWAPPED
-	if (status == MB_SUCCESS)
-		{
-		mb_swap_float(&read_data.lon);
-		mb_swap_float(&read_data.lat);
-		read_data.year = mb_swap_short(read_data.year);
-		read_data.month = mb_swap_short(read_data.month);
-		read_data.day = mb_swap_short(read_data.day);
-		read_data.hour = mb_swap_short(read_data.hour);
-		read_data.minute = mb_swap_short(read_data.minute);
-		read_data.second = mb_swap_short(read_data.second);
-		read_data.alt_minute = mb_swap_short(read_data.alt_minute);
-		read_data.alt_second = mb_swap_short(read_data.alt_second);
-		mb_swap_float(&read_data.draught);
-		mb_swap_float(&read_data.vel_mean);
-		mb_swap_float(&read_data.vel_keel);
-		mb_swap_float(&read_data.tide);
-		}
-#endif
-
-	/* copy data to internal storage */
-	if (status == MB_SUCCESS)
-		{
-		data->lon = read_data.lon;
-		data->lat = read_data.lat;
-		data->year = read_data.year;
-		data->month = read_data.month;
-		data->day = read_data.day;
-		data->hour = read_data.hour;
-		data->minute = read_data.minute;
-		data->second = read_data.second;
-		data->alt_minute = read_data.alt_minute;
-		data->alt_second = read_data.alt_second;
-		data->draught = read_data.draught;
-		data->vel_mean = read_data.vel_mean;
-		data->vel_keel = read_data.vel_keel;
-		data->tide = read_data.tide;
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       longitude:        %f\n",data->lon);
-		fprintf(stderr,"dbg5       latitude:         %f\n",data->lat);
-		fprintf(stderr,"dbg5       year:             %d\n",data->year);
-		fprintf(stderr,"dbg5       month:            %d\n",data->month);
-		fprintf(stderr,"dbg5       day:              %d\n",data->day);
-		fprintf(stderr,"dbg5       hour:             %d\n",data->hour);
-		fprintf(stderr,"dbg5       minute:           %d\n",
-			data->minute);
-		fprintf(stderr,"dbg5       second:           %d\n",
-			data->second);
-		fprintf(stderr,"dbg5       alt minute:       %d\n",
-			data->alt_minute);
-		fprintf(stderr,"dbg5       alt second:       %d\n",
-			data->alt_second);
-		fprintf(stderr,"dbg5       draught:          %f\n",
-			data->draught);
-		fprintf(stderr,"dbg5       mean velocity:    %f\n",
-			data->vel_mean);
-		fprintf(stderr,"dbg5       keel velocity:    %f\n",
-			data->vel_keel);
-		fprintf(stderr,"dbg5       tide:             %f\n",data->tide);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_hsldeoih_rd_velocity_profile(int verbose, FILE *mbfp,
-		struct mbf_hsldeoih_struct *data, int *error)
-{
-	char	*function_name = "mbr_hsldeoih_rd_velocity_profile";
-	int	status = MB_SUCCESS;
-	struct mbf_hsldeoih_velocity_profile_struct read_data;
-	int	read_size;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       data:       %p\n",(void *)data);
-		}
-
-	/* read record from file */
-	read_size = sizeof(read_data);
-	if ((status = fread(&read_data,1,sizeof(read_data),
-		mbfp)) != read_size)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-        else
-                {
-                status = MB_SUCCESS;
-                *error = MB_ERROR_NO_ERROR;
-                }
-
-	/* byte swap the data if necessary */
-#ifdef BYTESWAPPED
-	if (status == MB_SUCCESS)
-		{
-		mb_swap_float(&read_data.lon);
-		mb_swap_float(&read_data.lat);
-		read_data.year = mb_swap_short(read_data.year);
-		read_data.month = mb_swap_short(read_data.month);
-		read_data.day = mb_swap_short(read_data.day);
-		read_data.hour = mb_swap_short(read_data.hour);
-		read_data.minute = mb_swap_short(read_data.minute);
-		read_data.second = mb_swap_short(read_data.second);
-		data->num_vel = mb_swap_short(read_data.num_vel);
-		for (i=0;i<MBF_HSLDEOIH_MAXVEL;i++)
-			{
-			mb_swap_float(&read_data.vdepth[i]);
-			mb_swap_float(&read_data.velocity[i]);
-			}
-		}
-#endif
-
-	/* copy data to internal storage */
-	if (status == MB_SUCCESS)
-		{
-		data->lon = read_data.lon;
-		data->lat = read_data.lat;
-		data->year = read_data.year;
-		data->month = read_data.month;
-		data->day = read_data.day;
-		data->hour = read_data.hour;
-		data->minute = read_data.minute;
-		data->second = read_data.second;
-		data->num_vel = read_data.num_vel;
-		for (i=0;i<MBF_HSLDEOIH_MAXVEL;i++)
-			{
-			data->vdepth[i] = read_data.vdepth[i];
-			data->velocity[i] = read_data.velocity[i];
-			}
-		}
-
-	/* check for sensible numbers of velocity-depth pairs */
-	if (read_data.num_vel < 0
-		|| read_data.num_vel > MBF_HSLDEOIH_MAXVEL)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_UNINTELLIGIBLE;
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       longitude:        %f\n",data->lon);
-		fprintf(stderr,"dbg5       latitude:         %f\n",data->lat);
-		fprintf(stderr,"dbg5       year:             %d\n",data->year);
-		fprintf(stderr,"dbg5       month:            %d\n",data->month);
-		fprintf(stderr,"dbg5       day:              %d\n",data->day);
-		fprintf(stderr,"dbg5       hour:             %d\n",data->hour);
-		fprintf(stderr,"dbg5       minute:           %d\n",
-			data->minute);
-		fprintf(stderr,"dbg5       second:           %d\n",
-			data->second);
-		fprintf(stderr,"dbg5       num_vel:          %d\n",
-			data->num_vel);
-		fprintf(stderr,"dbg5       water depths and velocities:\n");
-		for (i=0;i<11;i++)
-			fprintf(stderr,"dbg5         %d  %f  %f\n",
-				i,data->vdepth[i],data->velocity[i]);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_hsldeoih_rd_standby(int verbose, FILE *mbfp,
-		struct mbf_hsldeoih_struct *data, int *error)
-{
-	char	*function_name = "mbr_hsldeoih_rd_standby";
-	int	status = MB_SUCCESS;
-	struct mbf_hsldeoih_standby_struct read_data;
-	int	read_size;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       data:       %p\n",(void *)data);
-		}
-
-	/* read record from file */
-	read_size = sizeof(read_data);
-	if ((status = fread(&read_data,1,sizeof(read_data),
-		mbfp)) != read_size)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-        else
-                {
-                status = MB_SUCCESS;
-                *error = MB_ERROR_NO_ERROR;
-                }
-
-	/* byte swap the data if necessary */
-#ifdef BYTESWAPPED
-	if (status == MB_SUCCESS)
-		{
-		mb_swap_float(&read_data.lon);
-		mb_swap_float(&read_data.lat);
-		read_data.year = mb_swap_short(read_data.year);
-		read_data.month = mb_swap_short(read_data.month);
-		read_data.day = mb_swap_short(read_data.day);
-		read_data.hour = mb_swap_short(read_data.hour);
-		read_data.minute = mb_swap_short(read_data.minute);
-		read_data.second = mb_swap_short(read_data.second);
-		read_data.alt_minute = mb_swap_short(read_data.alt_minute);
-		read_data.alt_second = mb_swap_short(read_data.alt_second);
-		mb_swap_float(&read_data.course_true);
-		mb_swap_float(&read_data.speed_transverse);
-		mb_swap_float(&read_data.speed);
-		mb_swap_float(&read_data.pitch);
-		read_data.track = mb_swap_short(read_data.track);
-		mb_swap_float(&read_data.depth_center);
-		}
-#endif
-
-	/* copy data to internal storage */
-	if (status == MB_SUCCESS)
-		{
-		data->lon = read_data.lon;
-		data->lat = read_data.lat;
-		data->year = read_data.year;
-		data->month = read_data.month;
-		data->day = read_data.day;
-		data->hour = read_data.hour;
-		data->minute = read_data.minute;
-		data->second = read_data.second;
-		data->alt_minute = read_data.alt_minute;
-		data->alt_second = read_data.alt_second;
-		data->course_true = read_data.course_true;
-		data->speed_transverse = read_data.speed_transverse;
-		data->speed = read_data.speed;
-		data->pitch = read_data.pitch;
-		data->track = read_data.track;
-		data->depth_center = read_data.depth_center;
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       longitude:        %f\n",data->lon);
-		fprintf(stderr,"dbg5       latitude:         %f\n",data->lat);
-		fprintf(stderr,"dbg5       year:             %d\n",data->year);
-		fprintf(stderr,"dbg5       month:            %d\n",data->month);
-		fprintf(stderr,"dbg5       day:              %d\n",data->day);
-		fprintf(stderr,"dbg5       hour:             %d\n",data->hour);
-		fprintf(stderr,"dbg5       minute:           %d\n",
-			data->minute);
-		fprintf(stderr,"dbg5       second:           %d\n",
-			data->second);
-		fprintf(stderr,"dbg5       alt minute:       %d\n",
-			data->alt_minute);
-		fprintf(stderr,"dbg5       alt second:       %d\n",
-			data->alt_second);
-		fprintf(stderr,"dbg5       course_true:      %f\n",
-			data->course_true);
-		fprintf(stderr,"dbg5       speed_transverse: %f\n",
-			data->speed_transverse);
-		fprintf(stderr,"dbg5       speed:            %f\n",
-			data->speed);
-		fprintf(stderr,"dbg5       speed_reference:  %c\n",
-			data->speed_reference[0]);
-		fprintf(stderr,"dbg5       pitch:            %f\n",
-			data->pitch);
-		fprintf(stderr,"dbg5       track:            %d\n",
-			data->track);
-		fprintf(stderr,"dbg5       depth_center:     %f\n",
-			data->depth_center);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_hsldeoih_rd_survey(int verbose, FILE *mbfp,
-		struct mbf_hsldeoih_struct *data, int *error)
-{
-	char	*function_name = "mbr_hsldeoih_rd_survey";
-	int	status = MB_SUCCESS;
-	struct mbf_hsldeoih_survey_struct read_data;
-	int	read_size;
-	int	need_back,  gain_ok;
-	int	gain_inner, gain_outer;
-	double	gain_beam, factor;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       data:       %p\n",(void *)data);
-		}
-
-	/* read record from file */
-	read_size = sizeof(read_data);
-	if ((status = fread(&read_data,1,sizeof(read_data),
-		mbfp)) != read_size)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-        else
-                {
-                status = MB_SUCCESS;
-                *error = MB_ERROR_NO_ERROR;
-                }
-
-	/* byte swap the data if necessary */
-#ifdef BYTESWAPPED
-	if (status == MB_SUCCESS)
-		{
-		/* position */
-		mb_swap_float(&read_data.lon);
-		mb_swap_float(&read_data.lat);
-
-		/* time stamp */
-		read_data.year = mb_swap_short(read_data.year);
-		read_data.month = mb_swap_short(read_data.month);
-		read_data.day = mb_swap_short(read_data.day);
-		read_data.hour = mb_swap_short(read_data.hour);
-		read_data.minute = mb_swap_short(read_data.minute);
-		read_data.second = mb_swap_short(read_data.second);
-		read_data.alt_minute = mb_swap_short(read_data.alt_minute);
-		read_data.alt_second = mb_swap_short(read_data.alt_second);
-
-		/* additional navigation and depths */
-		mb_swap_float(&read_data.course_true);
-		mb_swap_float(&read_data.speed_transverse);
-		mb_swap_float(&read_data.speed);
-		mb_swap_float(&read_data.pitch);
-		read_data.track = mb_swap_short(read_data.track);
-		mb_swap_float(&read_data.depth_center);
-		mb_swap_float(&read_data.depth_scale);
-		read_data.spare = mb_swap_short(read_data.spare);
-		for (i=0;i<MBF_HSLDEOIH_BEAMS;i++)
-			{
-			read_data.distance[i] =
-				mb_swap_short(read_data.distance[i]);
-			read_data.depth[i] =
-				mb_swap_short(read_data.depth[i]);
-			}
-
-		/* travel time data */
-		mb_swap_float(&read_data.course_ground);
-		mb_swap_float(&read_data.speed_ground);
-		mb_swap_float(&read_data.heave);
-		mb_swap_float(&read_data.roll);
-		mb_swap_float(&read_data.time_center);
-		mb_swap_float(&read_data.time_scale);
-		for (i=0;i<MBF_HSLDEOIH_BEAMS;i++)
-			read_data.time[i] = mb_swap_short(read_data.time[i]);
-		for (i=0;i<11;i++)
-			mb_swap_float(&read_data.gyro[i]);
-
-		/* amplitude data */
-		read_data.trans_strbd = mb_swap_short(read_data.trans_strbd);
-		read_data.trans_vert = mb_swap_short(read_data.trans_vert);
-		read_data.trans_port = mb_swap_short(read_data.trans_port);
-		read_data.pulse_len_strbd
-			= mb_swap_short(read_data.pulse_len_strbd);
-		read_data.pulse_len_vert
-			= mb_swap_short(read_data.pulse_len_vert);
-		read_data.pulse_len_port
-			= mb_swap_short(read_data.pulse_len_port);
-		read_data.gain_start
-			= mb_swap_short(read_data.gain_start);
-		read_data.r_compensation_factor
-			= mb_swap_short(read_data.r_compensation_factor);
-		read_data.compensation_start
-			= mb_swap_short(read_data.compensation_start);
-		read_data.increase_start
-			= mb_swap_short(read_data.increase_start);
-		read_data.tvc_near = mb_swap_short(read_data.tvc_near);
-		read_data.tvc_far = mb_swap_short(read_data.tvc_far);
-		read_data.increase_int_near
-			= mb_swap_short(read_data.increase_int_near);
-		read_data.increase_int_far
-			= mb_swap_short(read_data.increase_int_far);
-		read_data.gain_center = mb_swap_short(read_data.gain_center);
-		mb_swap_float(&read_data.filter_gain);
-		read_data.amplitude_center
-			= mb_swap_short(read_data.amplitude_center);
-		read_data.echo_duration_center
-			= mb_swap_short(read_data.echo_duration_center);
-		read_data.echo_scale_center
-			= mb_swap_short(read_data.echo_scale_center);
-		for (i=0;i<MBF_HSLDEOIH_BEAMS;i++)
-			{
-			read_data.amplitude[i]
-				= mb_swap_short(read_data.amplitude[i]);
-			read_data.echo_duration[i]
-				= mb_swap_short(read_data.echo_duration[i]);
-			}
-		for (i=0;i<16;i++)
-			{
-			read_data.gain[i]
-				= mb_swap_short(read_data.gain[i]);
-			read_data.echo_scale[i]
-				= mb_swap_short(read_data.echo_scale[i]);
-			}
-
-		/* processed backscatter data */
-		mb_swap_float(&read_data.back_scale);
-		for (i=0;i<MBF_HSLDEOIH_BEAMS;i++)
-			read_data.back[i] = mb_swap_short(read_data.back[i]);
-		}
-#endif
-
-	/* copy data to internal storage */
-	if (status == MB_SUCCESS)
-		{
-		/* position */
-		data->lon = read_data.lon;
-		data->lat = read_data.lat;
-
-		/* time stamp */
-		data->year = read_data.year;
-		data->month = read_data.month;
-		data->day = read_data.day;
-		data->hour = read_data.hour;
-		data->minute = read_data.minute;
-		data->second = read_data.second;
-		data->alt_minute = read_data.alt_minute;
-		data->alt_second = read_data.alt_second;
-
-		/* additional navigation and depths */
-		data->course_true = read_data.course_true;
-		data->speed_transverse = read_data.speed_transverse;
-		data->speed = read_data.speed;
-		data->speed_reference[0] = read_data.speed_reference[0];
-		data->pitch = read_data.pitch;
-		data->track = read_data.track;
-		data->depth_center = read_data.depth_center;
-		data->depth_scale = read_data.depth_scale;
-		data->spare = read_data.spare;
-		for (i=0;i<MBF_HSLDEOIH_BEAMS;i++)
-			{
-			data->distance[i] = read_data.distance[i];
-			data->depth[i] = read_data.depth[i];
-			}
-
-		/* travel time data */
-		data->course_ground = read_data.course_ground;
-		data->speed_ground = read_data.speed_ground;
-		data->heave = read_data.heave;
-		data->roll = read_data.roll;
-		data->time_center = read_data.time_center;
-		data->time_scale = read_data.time_scale;
-		data->mode[0] = read_data.mode[0];
-		for (i=0;i<MBF_HSLDEOIH_BEAMS;i++)
-			data->time[i] = read_data.time[i];
-		for (i=0;i<11;i++)
-			data->gyro[i] = read_data.gyro[i];
-
-		/* amplitude data */
-		data->trans_strbd = read_data.trans_strbd;
-		data->trans_vert = read_data.trans_vert;
-		data->trans_port = read_data.trans_port;
-		data->pulse_len_strbd = read_data.pulse_len_strbd;
-		data->pulse_len_vert = read_data.pulse_len_vert;
-		data->pulse_len_port = read_data.pulse_len_port;
-		data->gain_start = read_data.gain_start;
-		data->r_compensation_factor = read_data.r_compensation_factor;
-		data->compensation_start = read_data.compensation_start;
-		data->increase_start = read_data.increase_start;
-		data->tvc_near = read_data.tvc_near;
-		data->tvc_far = read_data.tvc_far;
-		data->increase_int_near = read_data.increase_int_near;
-		data->increase_int_far = read_data.increase_int_far;
-		data->gain_center = read_data.gain_center;
-		data->filter_gain = read_data.filter_gain;
-		data->amplitude_center = read_data.amplitude_center;
-		data->echo_duration_center = read_data.echo_duration_center;
-		data->echo_scale_center = read_data.echo_scale_center;
-		for (i=0;i<MBF_HSLDEOIH_BEAMS;i++)
-			{
-			data->amplitude[i] = read_data.amplitude[i];
-			data->echo_duration[i] = read_data.echo_duration[i];
-			}
-		for (i=0;i<16;i++)
-			{
-			data->gain[i] = read_data.gain[i];
-			data->echo_scale[i] = read_data.echo_scale[i];
-			}
-
-		/* processed backscatter data */
-		data->back_scale = read_data.back_scale;
-		for (i=0;i<MBF_HSLDEOIH_BEAMS;i++)
-			data->back[i] = read_data.back[i];
-		}
-
-	/* now fix possible problem with depth_center
-		- early versions of the i/o module stored the
-		center depth with a value scaled 100 times too large */
-	if (fabs(data->depth_center) > 12000.0)
-		data->depth_center *= 0.01;
-
-	/* now fix some possible problems with processed
-		beam amplitudes */
-	if (status == MB_SUCCESS)
-		{
-
-		/* see if gain values are messed up */
-		gain_ok = MB_NO;
-		i = 0;
-		while (i < 8 && gain_ok == MB_NO)
-			{
-			if (data->gain[i] != data->gain[0])
-				gain_ok = MB_YES;
-			if (data->gain[i+8] != data->gain[8])
-				gain_ok = MB_YES;
-			i++;
-			}
-
-		/* fix gain values if needed */
-		if (gain_ok == MB_NO)
-			{
-			gain_outer = data->gain[0];
-			gain_inner = data->gain[8];
-			for (i=0;i<16;i++)
-				{
-				if (i<4 || i > 11)
-					data->gain[i] = gain_outer;
-				else
-					data->gain[i] = gain_inner;
-				}
-			}
-
-		/* see if processed beam amplitude values
-			are available */
-		need_back = MB_YES;
-		i = 0;
-		while (i < MBF_HSLDEOIH_BEAMS && need_back == MB_YES)
-			{
-			if (data->back[i] != 0)
-				need_back = MB_NO;
-			i++;
-			}
-
-		/* get beam amplitude values if needed */
-		if (need_back == MB_YES)
-			{
-			data->back_scale = 1.0;
-			for (i=0;i<MBF_HSLDEOIH_BEAMS;i++)
-				{
-				gain_beam = 6*data->gain[which_gain[i]];
-				factor = 100.*pow(10.,(-0.05*gain_beam));
-				data->back[i] = factor*data->amplitude[i];
-				}
-			}
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       longitude:        %f\n",data->lon);
-		fprintf(stderr,"dbg5       latitude:         %f\n",data->lat);
-		fprintf(stderr,"dbg5       year:             %d\n",data->year);
-		fprintf(stderr,"dbg5       month:            %d\n",data->month);
-		fprintf(stderr,"dbg5       day:              %d\n",data->day);
-		fprintf(stderr,"dbg5       hour:             %d\n",data->hour);
-		fprintf(stderr,"dbg5       minute:           %d\n",
-			data->minute);
-		fprintf(stderr,"dbg5       second:           %d\n",
-			data->second);
-		fprintf(stderr,"dbg5       alt minute:       %d\n",
-			data->alt_minute);
-		fprintf(stderr,"dbg5       alt second:       %d\n",
-			data->alt_second);
-		fprintf(stderr,"dbg5       course_true:      %f\n",
-			data->course_true);
-		fprintf(stderr,"dbg5       speed_transverse: %f\n",
-			data->speed_transverse);
-		fprintf(stderr,"dbg5       speed:            %f\n",
-			data->speed);
-		fprintf(stderr,"dbg5       speed_reference:  %c\n",
-			data->speed_reference[0]);
-		fprintf(stderr,"dbg5       pitch:            %f\n",
-			data->pitch);
-		fprintf(stderr,"dbg5       track:            %d\n",
-			data->track);
-		fprintf(stderr,"dbg5       depth_center:     %f\n",
-			data->depth_center);
-		fprintf(stderr,"dbg5       depth_scale:      %f\n",
-			data->depth_scale);
-		fprintf(stderr,"dbg5       spare:            %d\n",
-			data->spare);
-		fprintf(stderr,"dbg5       distances and depths:\n");
-		for (i=0;i<MBF_HSLDEOIH_BEAMS;i++)
-			fprintf(stderr,"dbg5         %d  %d  %d\n",
-				i,data->distance[i],data->depth[i]);
-		fprintf(stderr,"dbg5       course_ground:    %f\n",
-			data->course_ground);
-		fprintf(stderr,"dbg5       speed_ground:     %f\n",
-			data->speed_ground);
-		fprintf(stderr,"dbg5       heave:            %f\n",
-			data->heave);
-		fprintf(stderr,"dbg5       pitch:            %f\n",
-			data->pitch);
-		fprintf(stderr,"dbg5       roll:             %f\n",
-			data->roll);
-		fprintf(stderr,"dbg5       time_center:      %f\n",
-			data->time_center);
-		fprintf(stderr,"dbg5       time_scale:       %f\n",
-			data->time_scale);
-		fprintf(stderr,"dbg5       travel times:\n");
-		for (i=0;i<MBF_HSLDEOIH_BEAMS;i++)
-			fprintf(stderr,"dbg5         %d  %d\n",
-				i,data->time[i]);
-		fprintf(stderr,"dbg5       gyro headings:\n");
-		for (i=0;i<11;i++)
-			fprintf(stderr,"dbg5         %d  %f\n",
-				i,data->gyro[i]);
-		fprintf(stderr,"dbg5       mode:             %c\n",
-			data->mode[0]);
-		fprintf(stderr,"dbg5       trans_strbd:      %d\n",
-			data->trans_strbd);
-		fprintf(stderr,"dbg5       trans_vert:       %d\n",
-			data->trans_vert);
-		fprintf(stderr,"dbg5       trans_port:       %d\n",
-			data->trans_port);
-		fprintf(stderr,"dbg5       pulse_len_strbd:  %d\n",
-			data->pulse_len_strbd);
-		fprintf(stderr,"dbg5       pulse_len_vert:   %d\n",
-			data->pulse_len_vert);
-		fprintf(stderr,"dbg5       pulse_len_port:   %d\n",
-			data->pulse_len_port);
-		fprintf(stderr,"dbg5       gain_start:       %d\n",
-			data->gain_start);
-		fprintf(stderr,"dbg5       r_comp_factor:    %d\n",
-			data->r_compensation_factor);
-		fprintf(stderr,"dbg5       comp_start:       %d\n",
-			data->compensation_start);
-		fprintf(stderr,"dbg5       increase_start:   %d\n",
-			data->increase_start);
-		fprintf(stderr,"dbg5       tvc_near:         %d\n",
-			data->tvc_near);
-		fprintf(stderr,"dbg5       increase_start:   %d\n",
-			data->increase_start);
-		fprintf(stderr,"dbg5       tvc_far:          %d\n",
-			data->tvc_far);
-		fprintf(stderr,"dbg5       increase_int_near:%d\n",
-			data->increase_int_near);
-		fprintf(stderr,"dbg5       increase_int_far: %d\n",
-			data->increase_int_far);
-		fprintf(stderr,"dbg5       gain_center:      %d\n",
-			data->gain_center);
-		fprintf(stderr,"dbg5       filter_gain:      %f\n",
-			data->filter_gain);
-		fprintf(stderr,"dbg5       amplitude_center: %d\n",
-			data->amplitude_center);
-		fprintf(stderr,"dbg5       echo_dur_center:  %d\n",
-			data->echo_duration_center);
-		fprintf(stderr,"dbg5       echo_scal_center: %d\n",
-			data->echo_scale_center);
-		fprintf(stderr,"dbg5       amplitudes and echo durations:\n");
-		for (i=0;i<MBF_HSLDEOIH_BEAMS;i++)
-			fprintf(stderr,"dbg5         %d  %d  %d\n",
-				i,data->amplitude[i],data->echo_duration[i]);
-		fprintf(stderr,"dbg5       gains and echo scales:\n");
-		for (i=0;i<16;i++)
-			fprintf(stderr,"dbg5         %d  %d  %d\n",
-				i,data->gain[i],data->echo_scale[i]);
-		fprintf(stderr,"dbg5       back_scale:       %f\n",
-			data->back_scale);
-		for (i=0;i<MBF_HSLDEOIH_BEAMS;i++)
-			fprintf(stderr,"dbg5         %d  %d\n",
-				i,data->back[i]);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_hsldeoih_rd_calibrate(int verbose, FILE *mbfp,
-		struct mbf_hsldeoih_struct *data, int *error)
-{
-	char	*function_name = "mbr_hsldeoih_rd_calibrate";
-	int	status = MB_SUCCESS;
-	struct mbf_hsldeoih_calibrate_struct read_data;
-	int	read_size;
-	int	need_back,  gain_ok;
-	int	gain_inner, gain_outer;
-	double	gain_beam, factor;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       data:       %p\n",(void *)data);
-		}
-
-	/* read record from file */
-	read_size = sizeof(read_data);
-	if ((status = fread(&read_data,1,sizeof(read_data),
-		mbfp)) != read_size)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-        else
-                {
-                status = MB_SUCCESS;
-                *error = MB_ERROR_NO_ERROR;
-                }
-
-	/* byte swap the data if necessary */
-#ifdef BYTESWAPPED
-	if (status == MB_SUCCESS)
-		{
-		/* position */
-		mb_swap_float(&read_data.lon);
-		mb_swap_float(&read_data.lat);
-
-		/* time stamp */
-		read_data.year = mb_swap_short(read_data.year);
-		read_data.month = mb_swap_short(read_data.month);
-		read_data.day = mb_swap_short(read_data.day);
-		read_data.hour = mb_swap_short(read_data.hour);
-		read_data.minute = mb_swap_short(read_data.minute);
-		read_data.second = mb_swap_short(read_data.second);
-		read_data.alt_minute = mb_swap_short(read_data.alt_minute);
-		read_data.alt_second = mb_swap_short(read_data.alt_second);
-
-		/* additional navigation and depths */
-		mb_swap_float(&read_data.course_true);
-		mb_swap_float(&read_data.speed_transverse);
-		mb_swap_float(&read_data.speed);
-		mb_swap_float(&read_data.pitch);
-		read_data.track = mb_swap_short(read_data.track);
-		mb_swap_float(&read_data.depth_center);
-		mb_swap_float(&read_data.depth_scale);
-		read_data.spare = mb_swap_short(read_data.spare);
-		for (i=0;i<MBF_HSLDEOIH_BEAMS;i++)
-			{
-			read_data.distance[i] =
-				mb_swap_short(read_data.distance[i]);
-			read_data.depth[i] =
-				mb_swap_short(read_data.depth[i]);
-			}
-
-		/* travel time data */
-		mb_swap_float(&read_data.course_ground);
-		mb_swap_float(&read_data.speed_ground);
-		mb_swap_float(&read_data.heave);
-		mb_swap_float(&read_data.roll);
-		mb_swap_float(&read_data.time_center);
-		mb_swap_float(&read_data.time_scale);
-		for (i=0;i<MBF_HSLDEOIH_BEAMS;i++)
-			read_data.time[i] = mb_swap_short(read_data.time[i]);
-		for (i=0;i<11;i++)
-			mb_swap_float(&read_data.gyro[i]);
-
-		/* amplitude data */
-		read_data.trans_strbd = mb_swap_short(read_data.trans_strbd);
-		read_data.trans_vert = mb_swap_short(read_data.trans_vert);
-		read_data.trans_port = mb_swap_short(read_data.trans_port);
-		read_data.pulse_len_strbd
-			= mb_swap_short(read_data.pulse_len_strbd);
-		read_data.pulse_len_vert
-			= mb_swap_short(read_data.pulse_len_vert);
-		read_data.pulse_len_port
-			= mb_swap_short(read_data.pulse_len_port);
-		read_data.gain_start
-			= mb_swap_short(read_data.gain_start);
-		read_data.r_compensation_factor
-			= mb_swap_short(read_data.r_compensation_factor);
-		read_data.compensation_start
-			= mb_swap_short(read_data.compensation_start);
-		read_data.increase_start
-			= mb_swap_short(read_data.increase_start);
-		read_data.tvc_near = mb_swap_short(read_data.tvc_near);
-		read_data.tvc_far = mb_swap_short(read_data.tvc_far);
-		read_data.increase_int_near
-			= mb_swap_short(read_data.increase_int_near);
-		read_data.increase_int_far
-			= mb_swap_short(read_data.increase_int_far);
-		read_data.gain_center = mb_swap_short(read_data.gain_center);
-		mb_swap_float(&read_data.filter_gain);
-		read_data.amplitude_center
-			= mb_swap_short(read_data.amplitude_center);
-		read_data.echo_duration_center
-			= mb_swap_short(read_data.echo_duration_center);
-		read_data.echo_scale_center
-			= mb_swap_short(read_data.echo_scale_center);
-		for (i=0;i<MBF_HSLDEOIH_BEAMS;i++)
-			{
-			read_data.amplitude[i]
-				= mb_swap_short(read_data.amplitude[i]);
-			read_data.echo_duration[i]
-				= mb_swap_short(read_data.echo_duration[i]);
-			}
-		for (i=0;i<16;i++)
-			{
-			read_data.gain[i]
-				= mb_swap_short(read_data.gain[i]);
-			read_data.echo_scale[i]
-				= mb_swap_short(read_data.echo_scale[i]);
-			}
-
-		/* processed backscatter data */
-		mb_swap_float(&read_data.back_scale);
-		for (i=0;i<MBF_HSLDEOIH_BEAMS;i++)
-			read_data.back[i] = mb_swap_short(read_data.back[i]);
-		}
-#endif
-
-	/* copy data to internal storage */
-	if (status == MB_SUCCESS)
-		{
-		/* position */
-		data->lon = read_data.lon;
-		data->lat = read_data.lat;
-
-		/* time stamp */
-		data->year = read_data.year;
-		data->month = read_data.month;
-		data->day = read_data.day;
-		data->hour = read_data.hour;
-		data->minute = read_data.minute;
-		data->second = read_data.second;
-		data->alt_minute = read_data.alt_minute;
-		data->alt_second = read_data.alt_second;
-
-		/* additional navigation and depths */
-		data->course_true = read_data.course_true;
-		data->speed_transverse = read_data.speed_transverse;
-		data->speed = read_data.speed;
-		data->speed_reference[0] = read_data.speed_reference[0];
-		data->pitch = read_data.pitch;
-		data->track = read_data.track;
-		data->depth_center = read_data.depth_center;
-		data->depth_scale = read_data.depth_scale;
-		data->spare = read_data.spare;
-		for (i=0;i<MBF_HSLDEOIH_BEAMS;i++)
-			{
-			data->distance[i] = read_data.distance[i];
-			data->depth[i] = read_data.depth[i];
-			}
-
-		/* travel time data */
-		data->course_ground = read_data.course_ground;
-		data->speed_ground = read_data.speed_ground;
-		data->heave = read_data.heave;
-		data->roll = read_data.roll;
-		data->time_center = read_data.time_center;
-		data->time_scale = read_data.time_scale;
-		data->mode[0] = read_data.mode[0];
-		for (i=0;i<MBF_HSLDEOIH_BEAMS;i++)
-			data->time[i] = read_data.time[i];
-		for (i=0;i<11;i++)
-			data->gyro[i] = read_data.gyro[i];
-
-		/* amplitude data */
-		data->trans_strbd = read_data.trans_strbd;
-		data->trans_vert = read_data.trans_vert;
-		data->trans_port = read_data.trans_port;
-		data->pulse_len_strbd = read_data.pulse_len_strbd;
-		data->pulse_len_vert = read_data.pulse_len_vert;
-		data->pulse_len_port = read_data.pulse_len_port;
-		data->gain_start = read_data.gain_start;
-		data->r_compensation_factor = read_data.r_compensation_factor;
-		data->compensation_start = read_data.compensation_start;
-		data->increase_start = read_data.increase_start;
-		data->tvc_near = read_data.tvc_near;
-		data->tvc_far = read_data.tvc_far;
-		data->increase_int_near = read_data.increase_int_near;
-		data->increase_int_far = read_data.increase_int_far;
-		data->gain_center = read_data.gain_center;
-		data->filter_gain = read_data.filter_gain;
-		data->amplitude_center = read_data.amplitude_center;
-		data->echo_duration_center = read_data.echo_duration_center;
-		data->echo_scale_center = read_data.echo_scale_center;
-		for (i=0;i<MBF_HSLDEOIH_BEAMS;i++)
-			{
-			data->amplitude[i] = read_data.amplitude[i];
-			data->echo_duration[i] = read_data.echo_duration[i];
-			}
-		for (i=0;i<16;i++)
-			{
-			data->gain[i] = read_data.gain[i];
-			data->echo_scale[i] = read_data.echo_scale[i];
-			}
-
-		/* processed backscatter data */
-		data->back_scale = read_data.back_scale;
-		for (i=0;i<MBF_HSLDEOIH_BEAMS;i++)
-			data->back[i] = read_data.back[i];
-		}
-
-	/* now fix some possible problems with processed
-		beam amplitudes */
-	if (status == MB_SUCCESS)
-		{
-
-		/* see if gain values are messed up */
-		gain_ok = MB_NO;
-		i = 0;
-		while (i < 8 && gain_ok == MB_NO)
-			{
-			if (data->gain[i] != data->gain[0])
-				gain_ok = MB_YES;
-			if (data->gain[i+8] != data->gain[8])
-				gain_ok = MB_YES;
-			i++;
-			}
-
-		/* fix gain values if needed */
-		if (gain_ok == MB_NO)
-			{
-			gain_outer = data->gain[0];
-			gain_inner = data->gain[8];
-			for (i=0;i<16;i++)
-				{
-				if (i<4 || i > 11)
-					data->gain[i] = gain_outer;
-				else
-					data->gain[i] = gain_inner;
-				}
-			}
-
-		/* see if processed beam amplitude values
-			are available */
-		need_back = MB_YES;
-		i = 0;
-		while (i < MBF_HSLDEOIH_BEAMS && need_back == MB_YES)
-			{
-			if (data->back[i] != 0)
-				need_back = MB_NO;
-			i++;
-			}
-
-		/* get beam amplitude values if needed */
-		if (need_back == MB_YES)
-			{
-			data->back_scale = 1.0;
-			for (i=0;i<MBF_HSLDEOIH_BEAMS;i++)
-				{
-				gain_beam = 6*data->gain[which_gain[i]];
-				factor = 100.*pow(10.,(-0.05*gain_beam));
-				data->back[i] = factor*data->amplitude[i];
-				}
-			}
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       longitude:        %f\n",data->lon);
-		fprintf(stderr,"dbg5       latitude:         %f\n",data->lat);
-		fprintf(stderr,"dbg5       year:             %d\n",data->year);
-		fprintf(stderr,"dbg5       month:            %d\n",data->month);
-		fprintf(stderr,"dbg5       day:              %d\n",data->day);
-		fprintf(stderr,"dbg5       hour:             %d\n",data->hour);
-		fprintf(stderr,"dbg5       minute:           %d\n",
-			data->minute);
-		fprintf(stderr,"dbg5       second:           %d\n",
-			data->second);
-		fprintf(stderr,"dbg5       alt minute:       %d\n",
-			data->alt_minute);
-		fprintf(stderr,"dbg5       alt second:       %d\n",
-			data->alt_second);
-		fprintf(stderr,"dbg5       course_true:      %f\n",
-			data->course_true);
-		fprintf(stderr,"dbg5       speed_transverse: %f\n",
-			data->speed_transverse);
-		fprintf(stderr,"dbg5       speed:            %f\n",
-			data->speed);
-		fprintf(stderr,"dbg5       speed_reference:  %c\n",
-			data->speed_reference[0]);
-		fprintf(stderr,"dbg5       pitch:            %f\n",
-			data->pitch);
-		fprintf(stderr,"dbg5       track:            %d\n",
-			data->track);
-		fprintf(stderr,"dbg5       depth_center:     %f\n",
-			data->depth_center);
-		fprintf(stderr,"dbg5       depth_scale:      %f\n",
-			data->depth_scale);
-		fprintf(stderr,"dbg5       spare:            %d\n",
-			data->spare);
-		fprintf(stderr,"dbg5       distances and depths:\n");
-		for (i=0;i<MBF_HSLDEOIH_BEAMS;i++)
-			fprintf(stderr,"dbg5         %d  %d  %d\n",
-				i,data->distance[i],data->depth[i]);
-		fprintf(stderr,"dbg5       course_ground:    %f\n",
-			data->course_ground);
-		fprintf(stderr,"dbg5       speed_ground:     %f\n",
-			data->speed_ground);
-		fprintf(stderr,"dbg5       heave:            %f\n",
-			data->heave);
-		fprintf(stderr,"dbg5       pitch:            %f\n",
-			data->pitch);
-		fprintf(stderr,"dbg5       roll:             %f\n",
-			data->roll);
-		fprintf(stderr,"dbg5       time_center:      %f\n",
-			data->depth_center);
-		fprintf(stderr,"dbg5       time_scale:       %f\n",
-			data->time_scale);
-		fprintf(stderr,"dbg5       travel times:\n");
-		for (i=0;i<MBF_HSLDEOIH_BEAMS;i++)
-			fprintf(stderr,"dbg5         %d  %d\n",
-				i,data->time[i]);
-		fprintf(stderr,"dbg5       gyro headings:\n");
-		for (i=0;i<11;i++)
-			fprintf(stderr,"dbg5         %d  %f\n",
-				i,data->gyro[i]);
-		fprintf(stderr,"dbg5       mode:             %c\n",
-			data->mode[0]);
-		fprintf(stderr,"dbg5       trans_strbd:      %d\n",
-			data->trans_strbd);
-		fprintf(stderr,"dbg5       trans_vert:       %d\n",
-			data->trans_vert);
-		fprintf(stderr,"dbg5       trans_port:       %d\n",
-			data->trans_port);
-		fprintf(stderr,"dbg5       pulse_len_strbd:  %d\n",
-			data->pulse_len_strbd);
-		fprintf(stderr,"dbg5       pulse_len_vert:   %d\n",
-			data->pulse_len_vert);
-		fprintf(stderr,"dbg5       pulse_len_port:   %d\n",
-			data->pulse_len_port);
-		fprintf(stderr,"dbg5       gain_start:       %d\n",
-			data->gain_start);
-		fprintf(stderr,"dbg5       r_comp_factor:    %d\n",
-			data->r_compensation_factor);
-		fprintf(stderr,"dbg5       comp_start:       %d\n",
-			data->compensation_start);
-		fprintf(stderr,"dbg5       increase_start:   %d\n",
-			data->increase_start);
-		fprintf(stderr,"dbg5       tvc_near:         %d\n",
-			data->tvc_near);
-		fprintf(stderr,"dbg5       increase_start:   %d\n",
-			data->increase_start);
-		fprintf(stderr,"dbg5       tvc_far:          %d\n",
-			data->tvc_far);
-		fprintf(stderr,"dbg5       increase_int_near:%d\n",
-			data->increase_int_near);
-		fprintf(stderr,"dbg5       increase_int_far: %d\n",
-			data->increase_int_far);
-		fprintf(stderr,"dbg5       gain_center:      %d\n",
-			data->gain_center);
-		fprintf(stderr,"dbg5       filter_gain:      %f\n",
-			data->filter_gain);
-		fprintf(stderr,"dbg5       amplitude_center: %d\n",
-			data->amplitude_center);
-		fprintf(stderr,"dbg5       echo_dur_center:  %d\n",
-			data->echo_duration_center);
-		fprintf(stderr,"dbg5       echo_scal_center: %d\n",
-			data->echo_scale_center);
-		fprintf(stderr,"dbg5       amplitudes and echo durations:\n");
-		for (i=0;i<MBF_HSLDEOIH_BEAMS;i++)
-			fprintf(stderr,"dbg5         %d  %d  %d\n",
-				i,data->amplitude[i],data->echo_duration[i]);
-		fprintf(stderr,"dbg5       gains and echo scales:\n");
-		for (i=0;i<16;i++)
-			fprintf(stderr,"dbg5         %d  %d  %d\n",
-				i,data->gain[i],data->echo_scale[i]);
-		fprintf(stderr,"dbg5       back_scale:       %f\n",
-			data->back_scale);
-		for (i=0;i<MBF_HSLDEOIH_BEAMS;i++)
-			fprintf(stderr,"dbg5         %d  %d\n",
-				i,data->back[i]);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_hsldeoih_rd_comment(int verbose, FILE *mbfp,
-		struct mbf_hsldeoih_struct *data, int *error)
-{
-	char	*function_name = "mbr_hsldeoih_rd_comment";
-	int	status = MB_SUCCESS;
-	struct mbf_hsldeoih_comment_struct read_data;
-	int	read_size;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       data:       %p\n",(void *)data);
-		}
-
-	/* read record from file */
-	read_size = sizeof(read_data);
-	if ((status = fread(&read_data,1,sizeof(read_data),
-		mbfp)) != read_size)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-        else
-                {
-                status = MB_SUCCESS;
-                *error = MB_ERROR_NO_ERROR;
-                }
-
-	/* copy data to internal storage */
-	if (status == MB_SUCCESS)
-		{
-		strncpy(data->comment,read_data.comment,MBF_HSLDEOIH_MAXLINE);
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       comment:          %s\n",data->comment);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_hsldeoih_wr_data(int verbose, void *mbio_ptr, void *data_ptr, int *error)
-{
-	char	*function_name = "mbr_hsldeoih_wr_data";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_hsldeoih_struct *data;
-	FILE	*mbfp;
-	int	label;
-	short int shortkind;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       data_ptr:   %p\n",(void *)data_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_hsldeoih_struct *) data_ptr;
-	mbfp = mb_io_ptr->mbfp;
-
-	/* print output debug statements */
-	if (verbose >= 4)
-		{
-		fprintf(stderr,"\ndbg4  Data record kind in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg4       kind:       %d\n",data->kind);
-		}
-
-	/* write record label to file */
-	label = MBF_HSLDEOIH_LABEL;
-#ifdef BYTESWAPPED
-	label = mb_swap_int(label);
-#endif
-	if ((status = fwrite(&label,1,sizeof(int),mbfp)) != sizeof(int))
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-	else
-		{
-		status = MB_SUCCESS;
-		*error = MB_ERROR_NO_ERROR;
-		}
-	shortkind = data->kind;
-
-	/* translate MBIO kind values to format kind values
-	 */
-	if (data->kind == MB_DATA_DATA)
-		{
-		shortkind = MBF_HSLDEOIH_KIND_DATA;
-		}
-	else if (data->kind == MB_DATA_COMMENT)
-		{
-		shortkind = MBF_HSLDEOIH_KIND_COMMENT;
-		}
-	else if (data->kind == MB_DATA_CALIBRATE)
-		{
-		shortkind = MBF_HSLDEOIH_KIND_CALIBRATE;
-		}
-	else if (data->kind == MB_DATA_MEAN_VELOCITY)
-		{
-		shortkind = MBF_HSLDEOIH_KIND_MEAN_VELOCITY;
-		}
-	else if (data->kind == MB_DATA_VELOCITY_PROFILE)
-		{
-		shortkind = MBF_HSLDEOIH_KIND_VELOCITY_PROFILE;
-		}
-	else if (data->kind == MB_DATA_STANDBY)
-		{
-		shortkind = MBF_HSLDEOIH_KIND_STANDBY;
-		}
-	else if (data->kind == MB_DATA_NAV_SOURCE)
-		{
-		shortkind = MBF_HSLDEOIH_KIND_NAV_SOURCE;
-		}
-#ifdef BYTESWAPPED
-	shortkind = mb_swap_short(shortkind);
-#endif
-	if ((status = fwrite(&shortkind,1,sizeof(short int),mbfp))
-		!= sizeof(short int))
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-	else
-		{
-		status = MB_SUCCESS;
-		*error = MB_ERROR_NO_ERROR;
-		}
-
-	/* write the data */
-	if (status == MB_SUCCESS)
-		{
-		if (data->kind == MB_DATA_DATA)
-			status = mbr_hsldeoih_wr_survey(verbose,
-				mbfp,data,error);
-		else if (data->kind == MB_DATA_COMMENT)
-			status = mbr_hsldeoih_wr_comment(verbose,
-				mbfp,data,error);
-		else if (data->kind == MB_DATA_CALIBRATE)
-			status = mbr_hsldeoih_wr_calibrate(verbose,
-				mbfp,data,error);
-		else if (data->kind == MB_DATA_MEAN_VELOCITY)
-			status = mbr_hsldeoih_wr_mean_velocity(verbose,
-				mbfp,data,error);
-		else if (data->kind == MB_DATA_VELOCITY_PROFILE)
-			status = mbr_hsldeoih_wr_velocity_profile(verbose,
-				mbfp,data,error);
-		else if (data->kind == MB_DATA_STANDBY)
-			status = mbr_hsldeoih_wr_standby(verbose,
-				mbfp,data,error);
-		else if (data->kind == MB_DATA_NAV_SOURCE)
-			status = mbr_hsldeoih_wr_nav_source(verbose,
-				mbfp,data,error);
-		else
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_BAD_KIND;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_hsldeoih_wr_nav_source(int verbose, FILE *mbfp,
-		struct mbf_hsldeoih_struct *data, int *error)
-{
-	char	*function_name = "mbr_hsldeoih_wr_nav_source";
-	int	status = MB_SUCCESS;
-	struct mbf_hsldeoih_nav_source_struct write_data;
-	int	write_size;
-	short int write_size_short;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       data:       %p\n",(void *)data);
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to write in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       longitude:        %f\n",data->lon);
-		fprintf(stderr,"dbg5       latitude:         %f\n",data->lat);
-		fprintf(stderr,"dbg5       year:             %d\n",data->year);
-		fprintf(stderr,"dbg5       month:            %d\n",data->month);
-		fprintf(stderr,"dbg5       day:              %d\n",data->day);
-		fprintf(stderr,"dbg5       hour:             %d\n",data->hour);
-		fprintf(stderr,"dbg5       minute:           %d\n",
-			data->minute);
-		fprintf(stderr,"dbg5       second:           %d\n",
-			data->second);
-		fprintf(stderr,"dbg5       alt minute:       %d\n",
-			data->alt_minute);
-		fprintf(stderr,"dbg5       alt second:       %d\n",
-			data->alt_second);
-		fprintf(stderr,"dbg5       pos_corr_x:       %f\n",
-			data->pos_corr_x);
-		fprintf(stderr,"dbg5       pos_corr_y:       %f\n",
-			data->pos_corr_y);
-		fprintf(stderr,"dbg5       sensors:          %s\n",
-			data->sensors);
-		}
-
-	/* copy data from internal storage */
-	if (status == MB_SUCCESS)
-		{
-		write_data.lon = data->lon;
-		write_data.lat = data->lat;
-		write_data.year = data->year;
-		write_data.month = data->month;
-		write_data.day = data->day;
-		write_data.hour = data->hour;
-		write_data.minute = data->minute;
-		write_data.second = data->second;
-		write_data.alt_minute = data->alt_minute;
-		write_data.alt_second = data->alt_second;
-		write_data.pos_corr_x = data->pos_corr_x;
-		write_data.pos_corr_y = data->pos_corr_y;
-		strncpy(write_data.sensors,data->sensors,8);
-		}
-
-	/* byte swap the data if necessary */
-#ifdef BYTESWAPPED
-	if (status == MB_SUCCESS)
-		{
-		mb_swap_float(&write_data.lon);
-		mb_swap_float(&write_data.lat);
-		write_data.year = mb_swap_short(write_data.year);
-		write_data.month = mb_swap_short(write_data.month);
-		write_data.day = mb_swap_short(write_data.day);
-		write_data.hour = mb_swap_short(write_data.hour);
-		write_data.minute = mb_swap_short(write_data.minute);
-		write_data.second = mb_swap_short(write_data.second);
-		write_data.alt_minute = mb_swap_short(write_data.alt_minute);
-		write_data.alt_second = mb_swap_short(write_data.alt_second);
-		mb_swap_float(&write_data.pos_corr_x);
-		mb_swap_float(&write_data.pos_corr_y);
-		}
-#endif
-
-	/* write record to file */
-	write_size = sizeof(write_data);
-	write_size_short = write_size;
-#ifdef BYTESWAPPED
-	write_size_short = mb_swap_short(write_size_short);
-#endif
-	if ((status = fwrite(&write_size_short,1,sizeof(short int),mbfp))
-		!= sizeof(short int))
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-	else
-		{
-		status = MB_SUCCESS;
-		*error = MB_ERROR_NO_ERROR;
-		}
-	if ((status = fwrite(&write_data,1,sizeof(write_data),mbfp))
-		!= write_size)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-        else
-                {
-                status = MB_SUCCESS;
-                *error = MB_ERROR_NO_ERROR;
-                }
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_hsldeoih_wr_mean_velocity(int verbose, FILE *mbfp,
-		struct mbf_hsldeoih_struct *data, int *error)
-{
-	char	*function_name = "mbr_hsldeoih_wr_mean_velocity";
-	int	status = MB_SUCCESS;
-	struct mbf_hsldeoih_mean_velocity_struct write_data;
-	int	write_size;
-	short int write_size_short;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       data:       %p\n",(void *)data);
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to write in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       longitude:        %f\n",data->lon);
-		fprintf(stderr,"dbg5       latitude:         %f\n",data->lat);
-		fprintf(stderr,"dbg5       year:             %d\n",data->year);
-		fprintf(stderr,"dbg5       month:            %d\n",data->month);
-		fprintf(stderr,"dbg5       day:              %d\n",data->day);
-		fprintf(stderr,"dbg5       hour:             %d\n",data->hour);
-		fprintf(stderr,"dbg5       minute:           %d\n",
-			data->minute);
-		fprintf(stderr,"dbg5       second:           %d\n",
-			data->second);
-		fprintf(stderr,"dbg5       alt minute:       %d\n",
-			data->alt_minute);
-		fprintf(stderr,"dbg5       alt second:       %d\n",
-			data->alt_second);
-		fprintf(stderr,"dbg5       draught:          %f\n",
-			data->draught);
-		fprintf(stderr,"dbg5       mean velocity:    %f\n",
-			data->vel_mean);
-		fprintf(stderr,"dbg5       keel velocity:    %f\n",
-			data->vel_keel);
-		fprintf(stderr,"dbg5       tide:             %f\n",data->tide);
-		}
-
-	/* copy data from internal storage */
-	if (status == MB_SUCCESS)
-		{
-		write_data.lon = data->lon;
-		write_data.lat = data->lat;
-		write_data.year = data->year;
-		write_data.month = data->month;
-		write_data.day = data->day;
-		write_data.hour = data->hour;
-		write_data.minute = data->minute;
-		write_data.second = data->second;
-		write_data.alt_minute = data->alt_minute;
-		write_data.alt_second = data->alt_second;
-		write_data.draught = data->draught;
-		write_data.vel_mean = data->vel_mean;
-		write_data.vel_keel = data->vel_keel;
-		write_data.tide = data->tide;
-		}
-
-	/* byte swap the data if necessary */
-#ifdef BYTESWAPPED
-	if (status == MB_SUCCESS)
-		{
-		mb_swap_float(&write_data.lon);
-		mb_swap_float(&write_data.lat);
-		write_data.year = mb_swap_short(write_data.year);
-		write_data.month = mb_swap_short(write_data.month);
-		write_data.day = mb_swap_short(write_data.day);
-		write_data.hour = mb_swap_short(write_data.hour);
-		write_data.minute = mb_swap_short(write_data.minute);
-		write_data.second = mb_swap_short(write_data.second);
-		write_data.alt_minute = mb_swap_short(write_data.alt_minute);
-		write_data.alt_second = mb_swap_short(write_data.alt_second);
-		mb_swap_float(&write_data.draught);
-		mb_swap_float(&write_data.vel_mean);
-		mb_swap_float(&write_data.vel_keel);
-		mb_swap_float(&write_data.tide);
-		}
-#endif
-
-	/* write record to file */
-	write_size = sizeof(write_data);
-	write_size_short = write_size;
-#ifdef BYTESWAPPED
-	write_size_short = mb_swap_short(write_size_short);
-#endif
-	if ((status = fwrite(&write_size_short,1,sizeof(short int),mbfp))
-		!= sizeof(short int))
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-        else
-                {
-                status = MB_SUCCESS;
-                *error = MB_ERROR_NO_ERROR;
-                }
-	if ((status = fwrite(&write_data,1,sizeof(write_data),
-		mbfp)) != write_size)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-        else
-                {
-                status = MB_SUCCESS;
-                *error = MB_ERROR_NO_ERROR;
-                }
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_hsldeoih_wr_velocity_profile(int verbose, FILE *mbfp,
-		struct mbf_hsldeoih_struct *data, int *error)
-{
-	char	*function_name = "mbr_hsldeoih_wr_velocity_profile";
-	int	status = MB_SUCCESS;
-	struct mbf_hsldeoih_velocity_profile_struct write_data;
-	int	write_size;
-	short int write_size_short;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       data:       %p\n",(void *)data);
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to write in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       longitude:        %f\n",data->lon);
-		fprintf(stderr,"dbg5       latitude:         %f\n",data->lat);
-		fprintf(stderr,"dbg5       year:             %d\n",data->year);
-		fprintf(stderr,"dbg5       month:            %d\n",data->month);
-		fprintf(stderr,"dbg5       day:              %d\n",data->day);
-		fprintf(stderr,"dbg5       hour:             %d\n",data->hour);
-		fprintf(stderr,"dbg5       minute:           %d\n",
-			data->minute);
-		fprintf(stderr,"dbg5       second:           %d\n",
-			data->second);
-		fprintf(stderr,"dbg5       num_vel:          %d\n",
-			data->num_vel);
-		fprintf(stderr,"dbg5       water depths and velocities:\n");
-		for (i=0;i<11;i++)
-			fprintf(stderr,"dbg5         %d  %f  %f\n",
-				i,data->vdepth[i],data->velocity[i]);
-		}
-
-	/* copy data from internal storage */
-	if (status == MB_SUCCESS)
-		{
-		write_data.lon = data->lon;
-		write_data.lat = data->lat;
-		write_data.year = data->year;
-		write_data.month = data->month;
-		write_data.day = data->day;
-		write_data.hour = data->hour;
-		write_data.minute = data->minute;
-		write_data.second = data->second;
-		write_data.num_vel = data->num_vel;
-		for (i=0;i<MBF_HSLDEOIH_MAXVEL;i++)
-			{
-			write_data.vdepth[i] = data->vdepth[i];
-			write_data.velocity[i] = data->velocity[i];
-			}
-		}
-
-	/* byte swap the data if necessary */
-#ifdef BYTESWAPPED
-	if (status == MB_SUCCESS)
-		{
-		mb_swap_float(&write_data.lon);
-		mb_swap_float(&write_data.lat);
-		write_data.year = mb_swap_short(write_data.year);
-		write_data.month = mb_swap_short(write_data.month);
-		write_data.day = mb_swap_short(write_data.day);
-		write_data.hour = mb_swap_short(write_data.hour);
-		write_data.minute = mb_swap_short(write_data.minute);
-		write_data.second = mb_swap_short(write_data.second);
-		data->num_vel = mb_swap_short(write_data.num_vel);
-		for (i=0;i<MBF_HSLDEOIH_MAXVEL;i++)
-			{
-			mb_swap_float(&write_data.vdepth[i]);
-			mb_swap_float(&write_data.velocity[i]);
-			}
-		}
-#endif
-
-	/* write record to file */
-	write_size = sizeof(write_data);
-	write_size_short = write_size;
-#ifdef BYTESWAPPED
-	write_size_short = mb_swap_short(write_size_short);
-#endif
-	if ((status = fwrite(&write_size_short,1,sizeof(short int),mbfp))
-		!= sizeof(short int))
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-        else
-                {
-                status = MB_SUCCESS;
-                *error = MB_ERROR_NO_ERROR;
-                }
-	if ((status = fwrite(&write_data,1,sizeof(write_data),
-		mbfp)) != write_size)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-        else
-                {
-                status = MB_SUCCESS;
-                *error = MB_ERROR_NO_ERROR;
-                }
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_hsldeoih_wr_standby(int verbose, FILE *mbfp,
-		struct mbf_hsldeoih_struct *data, int *error)
-{
-	char	*function_name = "mbr_hsldeoih_wr_standby";
-	int	status = MB_SUCCESS;
-	struct mbf_hsldeoih_standby_struct write_data;
-	int	write_size;
-	short int write_size_short;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       data:       %p\n",(void *)data);
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to write in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       longitude:        %f\n",data->lon);
-		fprintf(stderr,"dbg5       latitude:         %f\n",data->lat);
-		fprintf(stderr,"dbg5       year:             %d\n",data->year);
-		fprintf(stderr,"dbg5       month:            %d\n",data->month);
-		fprintf(stderr,"dbg5       day:              %d\n",data->day);
-		fprintf(stderr,"dbg5       hour:             %d\n",data->hour);
-		fprintf(stderr,"dbg5       minute:           %d\n",
-			data->minute);
-		fprintf(stderr,"dbg5       second:           %d\n",
-			data->second);
-		fprintf(stderr,"dbg5       alt minute:       %d\n",
-			data->alt_minute);
-		fprintf(stderr,"dbg5       alt second:       %d\n",
-			data->alt_second);
-		fprintf(stderr,"dbg5       course_true:      %f\n",
-			data->course_true);
-		fprintf(stderr,"dbg5       speed_transverse: %f\n",
-			data->speed_transverse);
-		fprintf(stderr,"dbg5       speed:            %f\n",
-			data->speed);
-		fprintf(stderr,"dbg5       speed_reference:  %c\n",
-			data->speed_reference[0]);
-		fprintf(stderr,"dbg5       pitch:            %f\n",
-			data->pitch);
-		fprintf(stderr,"dbg5       track:            %d\n",
-			data->track);
-		fprintf(stderr,"dbg5       depth_center:     %f\n",
-			data->depth_center);
-		}
-
-	/* copy data from internal storage */
-	if (status == MB_SUCCESS)
-		{
-		write_data.lon = data->lon;
-		write_data.lat = data->lat;
-		write_data.year = data->year;
-		write_data.month = data->month;
-		write_data.day = data->day;
-		write_data.hour = data->hour;
-		write_data.minute = data->minute;
-		write_data.second = data->second;
-		write_data.alt_minute = data->alt_minute;
-		write_data.alt_second = data->alt_second;
-		write_data.course_true = data->course_true;
-		write_data.speed_transverse = data->speed_transverse;
-		write_data.speed = data->speed;
-		write_data.speed_reference[0] = data->speed_reference[0];
-		write_data.pitch = data->pitch;
-		write_data.track = data->track;
-		write_data.depth_center = data->depth_center;
-		}
-
-	/* byte swap the data if necessary */
-#ifdef BYTESWAPPED
-	if (status == MB_SUCCESS)
-		{
-		mb_swap_float(&write_data.lon);
-		mb_swap_float(&write_data.lat);
-		write_data.year = mb_swap_short(write_data.year);
-		write_data.month = mb_swap_short(write_data.month);
-		write_data.day = mb_swap_short(write_data.day);
-		write_data.hour = mb_swap_short(write_data.hour);
-		write_data.minute = mb_swap_short(write_data.minute);
-		write_data.second = mb_swap_short(write_data.second);
-		write_data.alt_minute = mb_swap_short(write_data.alt_minute);
-		write_data.alt_second = mb_swap_short(write_data.alt_second);
-		mb_swap_float(&write_data.course_true);
-		mb_swap_float(&write_data.speed_transverse);
-		mb_swap_float(&write_data.speed);
-		mb_swap_float(&write_data.pitch);
-		write_data.track = mb_swap_short(write_data.track);
-		mb_swap_float(&write_data.depth_center);
-		}
-#endif
-
-	/* write record to file */
-	write_size = sizeof(write_data);
-	write_size_short = write_size;
-#ifdef BYTESWAPPED
-	write_size_short = mb_swap_short(write_size_short);
-#endif
-	if ((status = fwrite(&write_size_short,1,sizeof(short int),mbfp))
-		!= sizeof(short int))
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-        else
-                {
-                status = MB_SUCCESS;
-                *error = MB_ERROR_NO_ERROR;
-                }
-	if ((status = fwrite(&write_data,1,sizeof(write_data),
-		mbfp)) != write_size)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-        else
-                {
-                status = MB_SUCCESS;
-                *error = MB_ERROR_NO_ERROR;
-                }
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_hsldeoih_wr_survey(int verbose, FILE *mbfp,
-		struct mbf_hsldeoih_struct *data, int *error)
-{
-	char	*function_name = "mbr_hsldeoih_wr_survey";
-	int	status = MB_SUCCESS;
-	struct mbf_hsldeoih_survey_struct write_data;
-	int	write_size;
-	short int write_size_short;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       data:       %p\n",(void *)data);
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to write in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       longitude:        %f\n",data->lon);
-		fprintf(stderr,"dbg5       latitude:         %f\n",data->lat);
-		fprintf(stderr,"dbg5       year:             %d\n",data->year);
-		fprintf(stderr,"dbg5       month:            %d\n",data->month);
-		fprintf(stderr,"dbg5       day:              %d\n",data->day);
-		fprintf(stderr,"dbg5       hour:             %d\n",data->hour);
-		fprintf(stderr,"dbg5       minute:           %d\n",
-			data->minute);
-		fprintf(stderr,"dbg5       second:           %d\n",
-			data->second);
-		fprintf(stderr,"dbg5       alt minute:       %d\n",
-			data->alt_minute);
-		fprintf(stderr,"dbg5       alt second:       %d\n",
-			data->alt_second);
-		fprintf(stderr,"dbg5       course_true:      %f\n",
-			data->course_true);
-		fprintf(stderr,"dbg5       speed_transverse: %f\n",
-			data->speed_transverse);
-		fprintf(stderr,"dbg5       speed:            %f\n",
-			data->speed);
-		fprintf(stderr,"dbg5       speed_reference:  %c\n",
-			data->speed_reference[0]);
-		fprintf(stderr,"dbg5       pitch:            %f\n",
-			data->pitch);
-		fprintf(stderr,"dbg5       track:            %d\n",
-			data->track);
-		fprintf(stderr,"dbg5       depth_center:     %f\n",
-			data->depth_center);
-		fprintf(stderr,"dbg5       depth_scale:      %f\n",
-			data->depth_scale);
-		fprintf(stderr,"dbg5       spare:            %d\n",
-			data->spare);
-		fprintf(stderr,"dbg5       distances and depths:\n");
-		for (i=0;i<MBF_HSLDEOIH_BEAMS;i++)
-			fprintf(stderr,"dbg5         %d  %d  %d\n",
-				i,data->distance[i],data->depth[i]);
-		fprintf(stderr,"dbg5       course_ground:    %f\n",
-			data->course_ground);
-		fprintf(stderr,"dbg5       speed_ground:     %f\n",
-			data->speed_ground);
-		fprintf(stderr,"dbg5       heave:            %f\n",
-			data->heave);
-		fprintf(stderr,"dbg5       pitch:            %f\n",
-			data->pitch);
-		fprintf(stderr,"dbg5       roll:             %f\n",
-			data->roll);
-		fprintf(stderr,"dbg5       time_center:      %f\n",
-			data->depth_center);
-		fprintf(stderr,"dbg5       time_scale:       %f\n",
-			data->time_scale);
-		fprintf(stderr,"dbg5       travel times:\n");
-		for (i=0;i<MBF_HSLDEOIH_BEAMS;i++)
-			fprintf(stderr,"dbg5         %d  %d\n",
-				i,data->time[i]);
-		fprintf(stderr,"dbg5       gyro headings:\n");
-		for (i=0;i<11;i++)
-			fprintf(stderr,"dbg5         %d  %f\n",
-				i,data->gyro[i]);
-		fprintf(stderr,"dbg5       mode:             %c\n",
-			data->mode[0]);
-		fprintf(stderr,"dbg5       trans_strbd:      %d\n",
-			data->trans_strbd);
-		fprintf(stderr,"dbg5       trans_vert:       %d\n",
-			data->trans_vert);
-		fprintf(stderr,"dbg5       trans_port:       %d\n",
-			data->trans_port);
-		fprintf(stderr,"dbg5       pulse_len_strbd:  %d\n",
-			data->pulse_len_strbd);
-		fprintf(stderr,"dbg5       pulse_len_vert:   %d\n",
-			data->pulse_len_vert);
-		fprintf(stderr,"dbg5       pulse_len_port:   %d\n",
-			data->pulse_len_port);
-		fprintf(stderr,"dbg5       gain_start:       %d\n",
-			data->gain_start);
-		fprintf(stderr,"dbg5       r_comp_factor:    %d\n",
-			data->r_compensation_factor);
-		fprintf(stderr,"dbg5       comp_start:       %d\n",
-			data->compensation_start);
-		fprintf(stderr,"dbg5       increase_start:   %d\n",
-			data->increase_start);
-		fprintf(stderr,"dbg5       tvc_near:         %d\n",
-			data->tvc_near);
-		fprintf(stderr,"dbg5       increase_start:   %d\n",
-			data->increase_start);
-		fprintf(stderr,"dbg5       tvc_far:          %d\n",
-			data->tvc_far);
-		fprintf(stderr,"dbg5       increase_int_near:%d\n",
-			data->increase_int_near);
-		fprintf(stderr,"dbg5       increase_int_far: %d\n",
-			data->increase_int_far);
-		fprintf(stderr,"dbg5       gain_center:      %d\n",
-			data->gain_center);
-		fprintf(stderr,"dbg5       filter_gain:      %f\n",
-			data->filter_gain);
-		fprintf(stderr,"dbg5       amplitude_center: %d\n",
-			data->amplitude_center);
-		fprintf(stderr,"dbg5       echo_dur_center:  %d\n",
-			data->echo_duration_center);
-		fprintf(stderr,"dbg5       echo_scal_center: %d\n",
-			data->echo_scale_center);
-		fprintf(stderr,"dbg5       amplitudes and echo durations:\n");
-		for (i=0;i<MBF_HSLDEOIH_BEAMS;i++)
-			fprintf(stderr,"dbg5         %d  %d  %d\n",
-				i,data->amplitude[i],data->echo_duration[i]);
-		fprintf(stderr,"dbg5       gains and echo scales:\n");
-		for (i=0;i<16;i++)
-			fprintf(stderr,"dbg5         %d  %d  %d\n",
-				i,data->gain[i],data->echo_scale[i]);
-		fprintf(stderr,"dbg5       back_scale:       %f\n",
-			data->back_scale);
-		for (i=0;i<MBF_HSLDEOIH_BEAMS;i++)
-			fprintf(stderr,"dbg5         %d  %d\n",
-				i,data->back[i]);
-		}
-
-	/* copy data from internal storage */
-	if (status == MB_SUCCESS)
-		{
-		/* position */
-		write_data.lon = data->lon;
-		write_data.lat = data->lat;
-
-		/* time stamp */
-		write_data.year = data->year;
-		write_data.month = data->month;
-		write_data.day = data->day;
-		write_data.hour = data->hour;
-		write_data.minute = data->minute;
-		write_data.second = data->second;
-		write_data.alt_minute = data->alt_minute;
-		write_data.alt_second = data->alt_second;
-
-		/* additional navigation and depths */
-		write_data.course_true = data->course_true;
-		write_data.speed_transverse = data->speed_transverse;
-		write_data.speed = data->speed;
-		write_data.speed_reference[0] = data->speed_reference[0];
-		write_data.pitch = data->pitch;
-		write_data.track = data->track;
-		write_data.depth_center = data->depth_center;
-		write_data.depth_scale = data->depth_scale;
-		write_data.spare = data->spare;
-		for (i=0;i<MBF_HSLDEOIH_BEAMS;i++)
-			{
-			write_data.distance[i] = data->distance[i];
-			write_data.depth[i] = data->depth[i];
-			}
-
-		/* travel time data */
-		write_data.course_ground = data->course_ground;
-		write_data.speed_ground = data->speed_ground;
-		write_data.heave = data->heave;
-		write_data.roll = data->roll;
-		write_data.time_center = data->time_center;
-		write_data.time_scale = data->time_scale;
-		write_data.mode[0] = data->mode[0];
-		for (i=0;i<MBF_HSLDEOIH_BEAMS;i++)
-			write_data.time[i] = data->time[i];
-		for (i=0;i<11;i++)
-			write_data.gyro[i] = data->gyro[i];
-
-		/* amplitude data */
-		write_data.trans_strbd = data->trans_strbd;
-		write_data.trans_vert = data->trans_vert;
-		write_data.trans_port = data->trans_port;
-		write_data.pulse_len_strbd = data->pulse_len_strbd;
-		write_data.pulse_len_vert = data->pulse_len_vert;
-		write_data.pulse_len_port = data->pulse_len_port;
-		write_data.gain_start = data->gain_start;
-		write_data.r_compensation_factor = data->r_compensation_factor;
-		write_data.compensation_start = data->compensation_start;
-		write_data.increase_start = data->increase_start;
-		write_data.tvc_near = data->tvc_near;
-		write_data.tvc_far = data->tvc_far;
-		write_data.increase_int_near = data->increase_int_near;
-		write_data.increase_int_far = data->increase_int_far;
-		write_data.gain_center = data->gain_center;
-		write_data.filter_gain = data->filter_gain;
-		write_data.amplitude_center = data->amplitude_center;
-		write_data.echo_duration_center = data->echo_duration_center;
-		write_data.echo_scale_center = data->echo_scale_center;
-		for (i=0;i<MBF_HSLDEOIH_BEAMS;i++)
-			{
-			write_data.amplitude[i] = data->amplitude[i];
-			write_data.echo_duration[i] = data->echo_duration[i];
-			}
-		for (i=0;i<16;i++)
-			{
-			write_data.gain[i] = data->gain[i];
-			write_data.echo_scale[i] = data->echo_scale[i];
-			}
-
-		/* processed backscatter data */
-		write_data.back_scale = data->back_scale;
-		for (i=0;i<MBF_HSLDEOIH_BEAMS;i++)
-			write_data.back[i] = data->back[i];
-		}
-
-	/* byte swap the data if necessary */
-#ifdef BYTESWAPPED
-	if (status == MB_SUCCESS)
-		{
-		/* position */
-		mb_swap_float(&write_data.lon);
-		mb_swap_float(&write_data.lat);
-
-		/* time stamp */
-		write_data.year = mb_swap_short(write_data.year);
-		write_data.month = mb_swap_short(write_data.month);
-		write_data.day = mb_swap_short(write_data.day);
-		write_data.hour = mb_swap_short(write_data.hour);
-		write_data.minute = mb_swap_short(write_data.minute);
-		write_data.second = mb_swap_short(write_data.second);
-		write_data.alt_minute = mb_swap_short(write_data.alt_minute);
-		write_data.alt_second = mb_swap_short(write_data.alt_second);
-
-		/* additional navigation and depths */
-		mb_swap_float(&write_data.course_true);
-		mb_swap_float(&write_data.speed_transverse);
-		mb_swap_float(&write_data.speed);
-		mb_swap_float(&write_data.pitch);
-		write_data.track = mb_swap_short(write_data.track);
-		mb_swap_float(&write_data.depth_center);
-		mb_swap_float(&write_data.depth_scale);
-		write_data.spare = mb_swap_short(write_data.spare);
-		for (i=0;i<MBF_HSLDEOIH_BEAMS;i++)
-			{
-			write_data.distance[i] =
-				mb_swap_short(write_data.distance[i]);
-			write_data.depth[i] =
-				mb_swap_short(write_data.depth[i]);
-			}
-
-		/* travel time data */
-		mb_swap_float(&write_data.course_ground);
-		mb_swap_float(&write_data.speed_ground);
-		mb_swap_float(&write_data.heave);
-		mb_swap_float(&write_data.roll);
-		mb_swap_float(&write_data.time_center);
-		mb_swap_float(&write_data.time_scale);
-		for (i=0;i<MBF_HSLDEOIH_BEAMS;i++)
-			write_data.time[i] = mb_swap_short(write_data.time[i]);
-		for (i=0;i<11;i++)
-			mb_swap_float(&write_data.gyro[i]);
-
-		/* amplitude data */
-		write_data.trans_strbd = mb_swap_short(write_data.trans_strbd);
-		write_data.trans_vert = mb_swap_short(write_data.trans_vert);
-		write_data.trans_port = mb_swap_short(write_data.trans_port);
-		write_data.pulse_len_strbd
-			= mb_swap_short(write_data.pulse_len_strbd);
-		write_data.pulse_len_vert
-			= mb_swap_short(write_data.pulse_len_vert);
-		write_data.pulse_len_port
-			= mb_swap_short(write_data.pulse_len_port);
-		write_data.gain_start
-			= mb_swap_short(write_data.gain_start);
-		write_data.r_compensation_factor
-			= mb_swap_short(write_data.r_compensation_factor);
-		write_data.compensation_start
-			= mb_swap_short(write_data.compensation_start);
-		write_data.increase_start
-			= mb_swap_short(write_data.increase_start);
-		write_data.tvc_near = mb_swap_short(write_data.tvc_near);
-		write_data.tvc_far = mb_swap_short(write_data.tvc_far);
-		write_data.increase_int_near
-			= mb_swap_short(write_data.increase_int_near);
-		write_data.increase_int_far
-			= mb_swap_short(write_data.increase_int_far);
-		write_data.gain_center = mb_swap_short(write_data.gain_center);
-		mb_swap_float(&write_data.filter_gain);
-		write_data.amplitude_center
-			= mb_swap_short(write_data.amplitude_center);
-		write_data.echo_duration_center
-			= mb_swap_short(write_data.echo_duration_center);
-		write_data.echo_scale_center
-			= mb_swap_short(write_data.echo_scale_center);
-		for (i=0;i<MBF_HSLDEOIH_BEAMS;i++)
-			{
-			write_data.amplitude[i]
-				= mb_swap_short(write_data.amplitude[i]);
-			write_data.echo_duration[i]
-				= mb_swap_short(write_data.echo_duration[i]);
-			}
-		for (i=0;i<16;i++)
-			{
-			write_data.gain[i]
-				= mb_swap_short(write_data.gain[i]);
-			write_data.echo_scale[i]
-				= mb_swap_short(write_data.echo_scale[i]);
-			}
-
-		/* processed backscatter data */
-		mb_swap_float(&write_data.back_scale);
-		for (i=0;i<MBF_HSLDEOIH_BEAMS;i++)
-			write_data.back[i] = mb_swap_short(write_data.back[i]);
-		}
-#endif
-
-	/* write record to file */
-	write_size = sizeof(write_data);
-	write_size_short = write_size;
-#ifdef BYTESWAPPED
-	write_size_short = mb_swap_short(write_size_short);
-#endif
-	if ((status = fwrite(&write_size_short,1,sizeof(short int),mbfp))
-		!= sizeof(short int))
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-        else
-                {
-                status = MB_SUCCESS;
-                *error = MB_ERROR_NO_ERROR;
-                }
-	if ((status = fwrite(&write_data,1,sizeof(write_data),
-		mbfp)) != write_size)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-        else
-                {
-                status = MB_SUCCESS;
-                *error = MB_ERROR_NO_ERROR;
-                }
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_hsldeoih_wr_calibrate(int verbose, FILE *mbfp,
-		struct mbf_hsldeoih_struct *data, int *error)
-{
-	char	*function_name = "mbr_hsldeoih_wr_calibrate";
-	int	status = MB_SUCCESS;
-	struct mbf_hsldeoih_calibrate_struct write_data;
-	int	write_size;
-	short int write_size_short;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       data:       %p\n",(void *)data);
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to write in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       longitude:        %f\n",data->lon);
-		fprintf(stderr,"dbg5       latitude:         %f\n",data->lat);
-		fprintf(stderr,"dbg5       year:             %d\n",data->year);
-		fprintf(stderr,"dbg5       month:            %d\n",data->month);
-		fprintf(stderr,"dbg5       day:              %d\n",data->day);
-		fprintf(stderr,"dbg5       hour:             %d\n",data->hour);
-		fprintf(stderr,"dbg5       minute:           %d\n",
-			data->minute);
-		fprintf(stderr,"dbg5       second:           %d\n",
-			data->second);
-		fprintf(stderr,"dbg5       alt minute:       %d\n",
-			data->alt_minute);
-		fprintf(stderr,"dbg5       alt second:       %d\n",
-			data->alt_second);
-		fprintf(stderr,"dbg5       course_true:      %f\n",
-			data->course_true);
-		fprintf(stderr,"dbg5       speed_transverse: %f\n",
-			data->speed_transverse);
-		fprintf(stderr,"dbg5       speed:            %f\n",
-			data->speed);
-		fprintf(stderr,"dbg5       speed_reference:  %c\n",
-			data->speed_reference[0]);
-		fprintf(stderr,"dbg5       pitch:            %f\n",
-			data->pitch);
-		fprintf(stderr,"dbg5       track:            %d\n",
-			data->track);
-		fprintf(stderr,"dbg5       depth_center:     %f\n",
-			data->depth_center);
-		fprintf(stderr,"dbg5       depth_scale:      %f\n",
-			data->depth_scale);
-		fprintf(stderr,"dbg5       spare:            %d\n",
-			data->spare);
-		fprintf(stderr,"dbg5       distances and depths:\n");
-		for (i=0;i<MBF_HSLDEOIH_BEAMS;i++)
-			fprintf(stderr,"dbg5         %d  %d  %d\n",
-				i,data->distance[i],data->depth[i]);
-		fprintf(stderr,"dbg5       course_ground:    %f\n",
-			data->course_ground);
-		fprintf(stderr,"dbg5       speed_ground:     %f\n",
-			data->speed_ground);
-		fprintf(stderr,"dbg5       heave:            %f\n",
-			data->heave);
-		fprintf(stderr,"dbg5       pitch:            %f\n",
-			data->pitch);
-		fprintf(stderr,"dbg5       roll:             %f\n",
-			data->roll);
-		fprintf(stderr,"dbg5       time_center:      %f\n",
-			data->time_center);
-		fprintf(stderr,"dbg5       time_scale:       %f\n",
-			data->time_scale);
-		fprintf(stderr,"dbg5       travel times:\n");
-		for (i=0;i<MBF_HSLDEOIH_BEAMS;i++)
-			fprintf(stderr,"dbg5         %d  %d\n",
-				i,data->time[i]);
-		fprintf(stderr,"dbg5       gyro headings:\n");
-		for (i=0;i<11;i++)
-			fprintf(stderr,"dbg5         %d  %f\n",
-				i,data->gyro[i]);
-		fprintf(stderr,"dbg5       mode:             %c\n",
-			data->mode[0]);
-		fprintf(stderr,"dbg5       trans_strbd:      %d\n",
-			data->trans_strbd);
-		fprintf(stderr,"dbg5       trans_vert:       %d\n",
-			data->trans_vert);
-		fprintf(stderr,"dbg5       trans_port:       %d\n",
-			data->trans_port);
-		fprintf(stderr,"dbg5       pulse_len_strbd:  %d\n",
-			data->pulse_len_strbd);
-		fprintf(stderr,"dbg5       pulse_len_vert:   %d\n",
-			data->pulse_len_vert);
-		fprintf(stderr,"dbg5       pulse_len_port:   %d\n",
-			data->pulse_len_port);
-		fprintf(stderr,"dbg5       gain_start:       %d\n",
-			data->gain_start);
-		fprintf(stderr,"dbg5       r_comp_factor:    %d\n",
-			data->r_compensation_factor);
-		fprintf(stderr,"dbg5       comp_start:       %d\n",
-			data->compensation_start);
-		fprintf(stderr,"dbg5       increase_start:   %d\n",
-			data->increase_start);
-		fprintf(stderr,"dbg5       tvc_near:         %d\n",
-			data->tvc_near);
-		fprintf(stderr,"dbg5       increase_start:   %d\n",
-			data->increase_start);
-		fprintf(stderr,"dbg5       tvc_far:          %d\n",
-			data->tvc_far);
-		fprintf(stderr,"dbg5       increase_int_near:%d\n",
-			data->increase_int_near);
-		fprintf(stderr,"dbg5       increase_int_far: %d\n",
-			data->increase_int_far);
-		fprintf(stderr,"dbg5       gain_center:      %d\n",
-			data->gain_center);
-		fprintf(stderr,"dbg5       filter_gain:      %f\n",
-			data->filter_gain);
-		fprintf(stderr,"dbg5       amplitude_center: %d\n",
-			data->amplitude_center);
-		fprintf(stderr,"dbg5       echo_dur_center:  %d\n",
-			data->echo_duration_center);
-		fprintf(stderr,"dbg5       echo_scal_center: %d\n",
-			data->echo_scale_center);
-		fprintf(stderr,"dbg5       amplitudes and echo durations:\n");
-		for (i=0;i<MBF_HSLDEOIH_BEAMS;i++)
-			fprintf(stderr,"dbg5         %d  %d  %d\n",
-				i,data->amplitude[i],data->echo_duration[i]);
-		fprintf(stderr,"dbg5       gains and echo scales:\n");
-		for (i=0;i<16;i++)
-			fprintf(stderr,"dbg5         %d  %d  %d\n",
-				i,data->gain[i],data->echo_scale[i]);
-		fprintf(stderr,"dbg5       back_scale:       %f\n",
-			data->back_scale);
-		for (i=0;i<MBF_HSLDEOIH_BEAMS;i++)
-			fprintf(stderr,"dbg5         %d  %d\n",
-				i,data->back[i]);
-		}
-
-	/* copy data from internal storage */
-	if (status == MB_SUCCESS)
-		{
-		/* position */
-		write_data.lon = data->lon;
-		write_data.lat = data->lat;
-
-		/* time stamp */
-		write_data.year = data->year;
-		write_data.month = data->month;
-		write_data.day = data->day;
-		write_data.hour = data->hour;
-		write_data.minute = data->minute;
-		write_data.second = data->second;
-		write_data.alt_minute = data->alt_minute;
-		write_data.alt_second = data->alt_second;
-
-		/* additional navigation and depths */
-		write_data.course_true = data->course_true;
-		write_data.speed_transverse = data->speed_transverse;
-		write_data.speed = data->speed;
-		write_data.speed_reference[0] = data->speed_reference[0];
-		write_data.pitch = data->pitch;
-		write_data.track = data->track;
-		write_data.depth_center = data->depth_center;
-		write_data.depth_scale = data->depth_scale;
-		write_data.spare = data->spare;
-		for (i=0;i<MBF_HSLDEOIH_BEAMS;i++)
-			{
-			write_data.distance[i] = data->distance[i];
-			write_data.depth[i] = data->depth[i];
-			}
-
-		/* travel time data */
-		write_data.course_ground = data->course_ground;
-		write_data.speed_ground = data->speed_ground;
-		write_data.heave = data->heave;
-		write_data.roll = data->roll;
-		write_data.time_center = data->time_center;
-		write_data.time_scale = data->time_scale;
-		write_data.mode[0] = data->mode[0];
-		for (i=0;i<MBF_HSLDEOIH_BEAMS;i++)
-			write_data.time[i] = data->time[i];
-		for (i=0;i<11;i++)
-			write_data.gyro[i] = data->gyro[i];
-
-		/* amplitude data */
-		write_data.trans_strbd = data->trans_strbd;
-		write_data.trans_vert = data->trans_vert;
-		write_data.trans_port = data->trans_port;
-		write_data.pulse_len_strbd = data->pulse_len_strbd;
-		write_data.pulse_len_vert = data->pulse_len_vert;
-		write_data.pulse_len_port = data->pulse_len_port;
-		write_data.gain_start = data->gain_start;
-		write_data.r_compensation_factor = data->r_compensation_factor;
-		write_data.compensation_start = data->compensation_start;
-		write_data.increase_start = data->increase_start;
-		write_data.tvc_near = data->tvc_near;
-		write_data.tvc_far = data->tvc_far;
-		write_data.increase_int_near = data->increase_int_near;
-		write_data.increase_int_far = data->increase_int_far;
-		write_data.gain_center = data->gain_center;
-		write_data.filter_gain = data->filter_gain;
-		write_data.amplitude_center = data->amplitude_center;
-		write_data.echo_duration_center = data->echo_duration_center;
-		write_data.echo_scale_center = data->echo_scale_center;
-		for (i=0;i<MBF_HSLDEOIH_BEAMS;i++)
-			{
-			write_data.amplitude[i] = data->amplitude[i];
-			write_data.echo_duration[i] = data->echo_duration[i];
-			}
-		for (i=0;i<16;i++)
-			{
-			write_data.gain[i] = data->gain[i];
-			write_data.echo_scale[i] = data->echo_scale[i];
-			}
-
-		/* processed backscatter data */
-		write_data.back_scale = data->back_scale;
-		for (i=0;i<MBF_HSLDEOIH_BEAMS;i++)
-			write_data.back[i] = data->back[i];
-		}
-
-	/* byte swap the data if necessary */
-#ifdef BYTESWAPPED
-	if (status == MB_SUCCESS)
-		{
-		/* position */
-		mb_swap_float(&write_data.lon);
-		mb_swap_float(&write_data.lat);
-
-		/* time stamp */
-		write_data.year = mb_swap_short(write_data.year);
-		write_data.month = mb_swap_short(write_data.month);
-		write_data.day = mb_swap_short(write_data.day);
-		write_data.hour = mb_swap_short(write_data.hour);
-		write_data.minute = mb_swap_short(write_data.minute);
-		write_data.second = mb_swap_short(write_data.second);
-		write_data.alt_minute = mb_swap_short(write_data.alt_minute);
-		write_data.alt_second = mb_swap_short(write_data.alt_second);
-
-		/* additional navigation and depths */
-		mb_swap_float(&write_data.course_true);
-		mb_swap_float(&write_data.speed_transverse);
-		mb_swap_float(&write_data.speed);
-		mb_swap_float(&write_data.pitch);
-		write_data.track = mb_swap_short(write_data.track);
-		mb_swap_float(&write_data.depth_center);
-		mb_swap_float(&write_data.depth_scale);
-		write_data.spare = mb_swap_short(write_data.spare);
-		for (i=0;i<MBF_HSLDEOIH_BEAMS;i++)
-			{
-			write_data.distance[i] =
-				mb_swap_short(write_data.distance[i]);
-			write_data.depth[i] =
-				mb_swap_short(write_data.depth[i]);
-			}
-
-		/* travel time data */
-		mb_swap_float(&write_data.course_ground);
-		mb_swap_float(&write_data.speed_ground);
-		mb_swap_float(&write_data.heave);
-		mb_swap_float(&write_data.roll);
-		mb_swap_float(&write_data.time_center);
-		mb_swap_float(&write_data.time_scale);
-		for (i=0;i<MBF_HSLDEOIH_BEAMS;i++)
-			write_data.time[i] = mb_swap_short(write_data.time[i]);
-		for (i=0;i<11;i++)
-			mb_swap_float(&write_data.gyro[i]);
-
-		/* amplitude data */
-		write_data.trans_strbd = mb_swap_short(write_data.trans_strbd);
-		write_data.trans_vert = mb_swap_short(write_data.trans_vert);
-		write_data.trans_port = mb_swap_short(write_data.trans_port);
-		write_data.pulse_len_strbd
-			= mb_swap_short(write_data.pulse_len_strbd);
-		write_data.pulse_len_vert
-			= mb_swap_short(write_data.pulse_len_vert);
-		write_data.pulse_len_port
-			= mb_swap_short(write_data.pulse_len_port);
-		write_data.gain_start
-			= mb_swap_short(write_data.gain_start);
-		write_data.r_compensation_factor
-			= mb_swap_short(write_data.r_compensation_factor);
-		write_data.compensation_start
-			= mb_swap_short(write_data.compensation_start);
-		write_data.increase_start
-			= mb_swap_short(write_data.increase_start);
-		write_data.tvc_near = mb_swap_short(write_data.tvc_near);
-		write_data.tvc_far = mb_swap_short(write_data.tvc_far);
-		write_data.increase_int_near
-			= mb_swap_short(write_data.increase_int_near);
-		write_data.increase_int_far
-			= mb_swap_short(write_data.increase_int_far);
-		write_data.gain_center = mb_swap_short(write_data.gain_center);
-		mb_swap_float(&write_data.filter_gain);
-		write_data.amplitude_center
-			= mb_swap_short(write_data.amplitude_center);
-		write_data.echo_duration_center
-			= mb_swap_short(write_data.echo_duration_center);
-		write_data.echo_scale_center
-			= mb_swap_short(write_data.echo_scale_center);
-		for (i=0;i<MBF_HSLDEOIH_BEAMS;i++)
-			{
-			write_data.amplitude[i]
-				= mb_swap_short(write_data.amplitude[i]);
-			write_data.echo_duration[i]
-				= mb_swap_short(write_data.echo_duration[i]);
-			}
-		for (i=0;i<16;i++)
-			{
-			write_data.gain[i]
-				= mb_swap_short(write_data.gain[i]);
-			write_data.echo_scale[i]
-				= mb_swap_short(write_data.echo_scale[i]);
-			}
-
-		/* processed backscatter data */
-		mb_swap_float(&write_data.back_scale);
-		for (i=0;i<MBF_HSLDEOIH_BEAMS;i++)
-			write_data.back[i] = mb_swap_short(write_data.back[i]);
-		}
-#endif
-
-	/* write record to file */
-	write_size = sizeof(write_data);
-	write_size_short = write_size;
-#ifdef BYTESWAPPED
-	write_size_short = mb_swap_short(write_size_short);
-#endif
-	if ((status = fwrite(&write_size_short,1,sizeof(short int),mbfp))
-		!= sizeof(short int))
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-        else
-                {
-                status = MB_SUCCESS;
-                *error = MB_ERROR_NO_ERROR;
-                }
-	if ((status = fwrite(&write_data,1,sizeof(write_data),
-		mbfp)) != write_size)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-        else
-                {
-                status = MB_SUCCESS;
-                *error = MB_ERROR_NO_ERROR;
-                }
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_hsldeoih_wr_comment(int verbose, FILE *mbfp,
-		struct mbf_hsldeoih_struct *data, int *error)
-{
-	char	*function_name = "mbr_hsldeoih_wr_comment";
-	int	status = MB_SUCCESS;
-	struct mbf_hsldeoih_comment_struct write_data;
-	int	write_size;
-	short int write_size_short;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       data:       %p\n",(void *)data);
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to write in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       comment:          %s\n",data->comment);
-		}
-
-	/* copy data from internal storage */
-	if (status == MB_SUCCESS)
-		{
-		strncpy(write_data.comment,data->comment,
-			MBF_HSLDEOIH_MAXLINE);
-		}
-
-	/* write record to file */
-	write_size = sizeof(write_data);
-	write_size_short = write_size;
-#ifdef BYTESWAPPED
-	write_size_short = mb_swap_short(write_size_short);
-#endif
-	if ((status = fwrite(&write_size_short,1,sizeof(short int),mbfp))
-		!= sizeof(short int))
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-        else
-                {
-                status = MB_SUCCESS;
-                *error = MB_ERROR_NO_ERROR;
-                }
-	if ((status = fwrite(&write_data,1,sizeof(write_data),
-		mbfp)) != write_size)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-        else
-                {
-                status = MB_SUCCESS;
-                *error = MB_ERROR_NO_ERROR;
-                }
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mbr_hsmdaraw.c b/src/mbio/mbr_hsmdaraw.c
deleted file mode 100644
index 61a33ea..0000000
--- a/src/mbio/mbr_hsmdaraw.c
+++ /dev/null
@@ -1,2177 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbr_hsmdaraw.c	2/11/93
- *	$Header: /system/link/server/cvs/root/mbsystem/src/mbio/mbr_hsmdaraw.c,v 5.8 2005/11/05 00:48:04 caress Exp $
- *
- *    Copyright (c) 1993-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbr_hsmdaraw.c contains the functions for reading and writing
- * multibeam data in the HSMDARAW format.
- * These functions include:
- *   mbr_alm_hsmdaraw	- allocate read/write memory
- *   mbr_dem_hsmdaraw	- deallocate read/write memory
- *   mbr_rt_hsmdaraw	- read and translate data
- *   mbr_wt_hsmdaraw	- translate and write data
- *
- * Author:	Dale Chayes
- * Date:	August 11, 1995
- *
- * $Log: mbr_hsmdaraw.c,v $
- * Revision 5.8  2005/11/05 00:48:04  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.7  2003/05/20 18:05:32  caress
- * Added svp_source to data source parameters.
- *
- * Revision 5.6  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.5  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.4  2001/07/20 00:32:54  caress
- * Release 5.0.beta03
- *
- * Revision 5.3  2001/06/08  21:44:01  caress
- * Version 5.0.beta01
- *
- * Revision 5.2  2001/03/22  20:50:02  caress
- * Trying to make version 5.0.beta0
- *
- * Revision 5.1  2001/01/22  07:43:34  caress
- * Version 5.0.beta01
- *
- * Revision 5.0  2000/12/01  22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.11  2000/10/11  01:03:21  caress
- * Convert to ANSI C
- *
- * Revision 4.10  2000/09/30  06:34:20  caress
- * Snapshot for Dale.
- *
- * Revision 4.9  1999/09/14  20:39:11  caress
- * Fixed bugs handling HSMD
- *
- * Revision 4.8  1999/03/31  18:11:35  caress
- * MB-System 4.6beta7
- *
- * Revision 4.7  1998/10/05  17:46:15  caress
- * MB-System version 4.6beta
- *
- * Revision 4.6  1997/07/25  14:19:53  caress
- * Version 4.5beta2.
- * Much mucking, particularly with Simrad formats.
- *
- * Revision 4.5  1997/04/21  17:02:07  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.4  1996/07/16  22:07:12  caress
- * Fixed port/starboard mixup and made null angles for raytracing 40 degrees to
- * reflect 40 degree tranducer array mounting.
- *
- * Revision 4.4  1996/07/16  22:07:12  caress
- * Fixed port/starboard mixup and made null angles for raytracing 40 degrees to
- * reflect 40 degree tranducer array mounting.
- *
- * Revision 4.3  1996/04/22  13:21:19  caress
- * Now have DTR and MIN/MAX defines in mb_define.h
- *
- * Revision 4.2  1996/04/22  10:57:09  caress
- * DTR define now in mb_io.h
- *
- * Revision 4.1  1996/01/26  21:23:30  caress
- * Version 4.3 distribution
- *
- * Revision 4.0  1995/09/28  18:14:11  caress
- * First cut.
- *
- * Revision 1.1  1995/09/28  18:10:48  caress
- * Initial revision
- *
- * Revision 4.3  95/08/16  15:53:04  15:53:04  dale (Dale Chayes)
- * Works to a limited extent.
- * Does not handle writing type 101 data files yet.
- *
- * Revision 4.2  95/08/14  20:55:17  20:55:17  dale (Dale Chayes)
- * HSMD is partially working, at least internally.
- * Still need to fix:
- *  - time for each ping
- *  - position for each ping
- *
- * Revision 4.1  95/08/13  08:05:35  08:05:35  dale (Dale Chayes)
- * First attempt to compile. Still has a bunch of no longer appropriate
- * variables and does not yet have all the right stuff for HSMD, but
- * less than 100 errors before the compiler quits.
- *
- * Revision 4.0  95/08/11  14:09:12  14:09:12  dale (Dale Chayes)
- * First cut, copied from mbr_hsatlraw.c
- * reformated for emacs
- * converted hsds structures and defines to hsmd
- * Code not functionaly modified yet.
- *
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_define.h"
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mbsys_hsmd.h"
-#include "mbf_hsmdaraw.h"
-
-/* essential function prototypes */
-int mbr_register_hsmdaraw(int verbose, void *mbio_ptr,
-		int *error);
-int mbr_info_hsmdaraw(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_alm_hsmdaraw(int verbose, void *mbio_ptr, int *error);
-int mbr_dem_hsmdaraw(int verbose, void *mbio_ptr, int *error);
-int mbr_rt_hsmdaraw(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_wt_hsmdaraw(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_zero_hsmdaraw(int verbose, char *data_ptr, int *error);
-int mbr_rt_hsmdaraw(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_wt_hsmdaraw(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_hsmdaraw_rd_data(int verbose, void *mbio_ptr, int *error);
-int mbr_hsmdaraw_wr_data(int verbose, void *mbio_ptr, char *data_ptr, int *error);
-
-static char rcs_id[]="$Id: mbr_hsmdaraw.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mbr_register_hsmdaraw(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_register_hsmdaraw";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* get mb_io_ptr */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set format info parameters */
-	status = mbr_info_hsmdaraw(verbose,
-			&mb_io_ptr->system,
-			&mb_io_ptr->beams_bath_max,
-			&mb_io_ptr->beams_amp_max,
-			&mb_io_ptr->pixels_ss_max,
-			mb_io_ptr->format_name,
-			mb_io_ptr->system_name,
-			mb_io_ptr->format_description,
-			&mb_io_ptr->numfile,
-			&mb_io_ptr->filetype,
-			&mb_io_ptr->variable_beams,
-			&mb_io_ptr->traveltime,
-			&mb_io_ptr->beam_flagging,
-			&mb_io_ptr->nav_source,
-			&mb_io_ptr->heading_source,
-			&mb_io_ptr->vru_source,
-			&mb_io_ptr->svp_source,
-			&mb_io_ptr->beamwidth_xtrack,
-			&mb_io_ptr->beamwidth_ltrack,
-			error);
-
-	/* set format and system specific function pointers */
-	mb_io_ptr->mb_io_format_alloc = &mbr_alm_hsmdaraw;
-	mb_io_ptr->mb_io_format_free = &mbr_dem_hsmdaraw;
-	mb_io_ptr->mb_io_store_alloc = &mbsys_hsmd_alloc;
-	mb_io_ptr->mb_io_store_free = &mbsys_hsmd_deall;
-	mb_io_ptr->mb_io_read_ping = &mbr_rt_hsmdaraw;
-	mb_io_ptr->mb_io_write_ping = &mbr_wt_hsmdaraw;
-	mb_io_ptr->mb_io_dimensions = &mbsys_hsmd_dimensions;
-	mb_io_ptr->mb_io_extract = &mbsys_hsmd_extract;
-	mb_io_ptr->mb_io_insert = &mbsys_hsmd_insert;
-	mb_io_ptr->mb_io_extract_nav = &mbsys_hsmd_extract_nav;
-	mb_io_ptr->mb_io_insert_nav = &mbsys_hsmd_insert_nav;
-	mb_io_ptr->mb_io_extract_altitude = &mbsys_hsmd_extract_altitude;
-	mb_io_ptr->mb_io_insert_altitude = NULL;
-	mb_io_ptr->mb_io_extract_svp = NULL;
-	mb_io_ptr->mb_io_insert_svp = NULL;
-	mb_io_ptr->mb_io_ttimes = &mbsys_hsmd_ttimes;
-	mb_io_ptr->mb_io_detects = &mbsys_hsmd_detects;
-	mb_io_ptr->mb_io_copyrecord = &mbsys_hsmd_copy;
-	mb_io_ptr->mb_io_extract_rawss = NULL;
-	mb_io_ptr->mb_io_insert_rawss = NULL;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",mb_io_ptr->system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",mb_io_ptr->beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",mb_io_ptr->beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",mb_io_ptr->pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",mb_io_ptr->format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",mb_io_ptr->system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",mb_io_ptr->format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",mb_io_ptr->numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",mb_io_ptr->filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",mb_io_ptr->variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",mb_io_ptr->traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",mb_io_ptr->beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",mb_io_ptr->nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",mb_io_ptr->heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",mb_io_ptr->vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",mb_io_ptr->svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",mb_io_ptr->beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",mb_io_ptr->beamwidth_ltrack);
-		fprintf(stderr,"dbg2       format_alloc:       %p\n",(void *)mb_io_ptr->mb_io_format_alloc);
-		fprintf(stderr,"dbg2       format_free:        %p\n",(void *)mb_io_ptr->mb_io_format_free);
-		fprintf(stderr,"dbg2       store_alloc:        %p\n",(void *)mb_io_ptr->mb_io_store_alloc);
-		fprintf(stderr,"dbg2       store_free:         %p\n",(void *)mb_io_ptr->mb_io_store_free);
-		fprintf(stderr,"dbg2       read_ping:          %p\n",(void *)mb_io_ptr->mb_io_read_ping);
-		fprintf(stderr,"dbg2       write_ping:         %p\n",(void *)mb_io_ptr->mb_io_write_ping);
-		fprintf(stderr,"dbg2       extract:            %p\n",(void *)mb_io_ptr->mb_io_extract);
-		fprintf(stderr,"dbg2       insert:             %p\n",(void *)mb_io_ptr->mb_io_insert);
-		fprintf(stderr,"dbg2       extract_nav:        %p\n",(void *)mb_io_ptr->mb_io_extract_nav);
-		fprintf(stderr,"dbg2       insert_nav:         %p\n",(void *)mb_io_ptr->mb_io_insert_nav);
-		fprintf(stderr,"dbg2       extract_altitude:   %p\n",(void *)mb_io_ptr->mb_io_extract_altitude);
-		fprintf(stderr,"dbg2       insert_altitude:    %p\n",(void *)mb_io_ptr->mb_io_insert_altitude);
-		fprintf(stderr,"dbg2       extract_svp:        %p\n",(void *)mb_io_ptr->mb_io_extract_svp);
-		fprintf(stderr,"dbg2       insert_svp:         %p\n",(void *)mb_io_ptr->mb_io_insert_svp);
-		fprintf(stderr,"dbg2       ttimes:             %p\n",(void *)mb_io_ptr->mb_io_ttimes);
-		fprintf(stderr,"dbg2       detects:            %p\n",(void *)mb_io_ptr->mb_io_detects);
-		fprintf(stderr,"dbg2       extract_rawss:      %p\n",(void *)mb_io_ptr->mb_io_extract_rawss);
-		fprintf(stderr,"dbg2       insert_rawss:       %p\n",(void *)mb_io_ptr->mb_io_insert_rawss);
-		fprintf(stderr,"dbg2       copyrecord:         %p\n",(void *)mb_io_ptr->mb_io_copyrecord);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbr_info_hsmdaraw(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error)
-{
-	char	*function_name = "mbr_info_hsmdaraw";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* set format info parameters */
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-	*system = MB_SYS_HSMD;
-	*beams_bath_max = 79;
-	*beams_amp_max = 0;
-	*pixels_ss_max = 319;
-	strncpy(format_name, "HSMDARAW", MB_NAME_LENGTH);
-	strncpy(system_name, "HSMD", MB_NAME_LENGTH);
-	strncpy(format_description, "Format name:          MBF_HSMDARAW\nInformal Description: Atlas HSMD medium depth multibeam raw format\nAttributes:           40 beam bathymetry, 160 pixel sidescan,\n                      XDR (binary), STN Atlas Elektronik.\n", MB_DESCRIPTION_LENGTH);
-	*numfile = 1;
-	*filetype = MB_FILETYPE_XDR;
-	*variable_beams = MB_NO;
-	*traveltime = MB_YES;
-	*beam_flagging = MB_YES;
-	*nav_source = MB_DATA_NAV;
-	*heading_source = MB_DATA_DATA;
-	*vru_source = MB_DATA_DATA;
-	*svp_source = MB_DATA_NONE;
-	*beamwidth_xtrack = 1.7;
-	*beamwidth_ltrack = 1.7;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",*system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",*beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",*beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",*pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",*numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",*filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",*variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",*traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",*beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",*nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",*heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",*vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",*svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",*beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",*beamwidth_ltrack);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_alm_hsmdaraw(int verbose, void *mbio_ptr, int *error)
-{
-	char	 *function_name = "mbr_alm_hsmdaraw";
-	int	 status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_hsmdaraw_struct *data;
-	char	 *data_ptr;
-	double *FirstReftime;	/* time from the first header */
-	int  *Header_count; /* number of header records encounterd */
-	int  *Rev_count;	   /* Raw Event counter */
-	int  *Nav_count;	   /* number of Nav records */
-	int  *Angle_count;  /* etc....... */
-	int  *Svp_count;
-	int  *Raw_count;
-	int  *MDevent_count;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set initial status */
-	status = MB_SUCCESS;
-
-	/* allocate memory for data structure */
-	mb_io_ptr->structure_size = sizeof(struct mbf_hsmdaraw_struct);
-	mb_io_ptr->data_structure_size = 0;
-	status = mb_malloc(verbose,mb_io_ptr->structure_size,
-		     &mb_io_ptr->raw_data,error);
-	status = mb_malloc(verbose,sizeof(struct mbsys_hsmd_struct),
-		     &mb_io_ptr->store_data,error);
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-	data = (struct mbf_hsmdaraw_struct *) mb_io_ptr->raw_data;
-	data_ptr = (char *) data;
-
-	/* initialize saved values */
-	FirstReftime = &mb_io_ptr->saved1;	/* time from the first header */
-	Header_count = &mb_io_ptr->save1; /* number of header records encounterd */
-	Rev_count = &mb_io_ptr->save2;	   /* Raw Event counter */
-	Nav_count = &mb_io_ptr->save3;	   /* number of Nav records */
-	Angle_count = &mb_io_ptr->save4;  /* etc....... */
-	Svp_count = &mb_io_ptr->save5;
-	Raw_count = &mb_io_ptr->save6;
-	MDevent_count = &mb_io_ptr->save7;
-	*FirstReftime = 0.0;	/* time from the first header */
-	*Header_count = 0; /* number of header records encounterd */
-	*Rev_count = 0;	   /* Raw Event counter */
-	*Nav_count = 0;	   /* number of Nav records */
-	*Angle_count = 0;  /* etc....... */
-	*Svp_count = 0;
-	*Raw_count = 0;
-	*MDevent_count = 0;
-
-	/* initialize everything to zeros */
-	mbr_zero_hsmdaraw(verbose,data_ptr,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_dem_hsmdaraw(int verbose, void *mbio_ptr, int *error)
-{
-	char    *function_name = "mbr_dem_hsmdaraw";
-	int	  status = MB_SUCCESS;
-	struct  mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* deallocate memory for data descriptor */
-	status = mb_free(verbose,&mb_io_ptr->raw_data,error);
-	status = mb_free(verbose,&mb_io_ptr->store_data,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_zero_hsmdaraw(int verbose, char *data_ptr, int *error)
-{
-	char	 *function_name = "mbr_zero_hsmdaraw";
-	int	 status = MB_SUCCESS;
-	struct mbf_hsmdaraw_struct *data;
-	int	 i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       data_ptr:   %p\n",(void *)data_ptr);
-		}
-
-
-	/* get pointer to data descriptor */
-	data = (struct mbf_hsmdaraw_struct *) data_ptr;
-
-	/* initialize everything to zeros */
-	if (data != NULL)
-		{
-		for (i=0;i<4;i++)
-			{
-			data->scsid[i]= 0;
-			data->scsart[i]= 0;
-			}
-		data->scslng = 0;
-		data->scsext = 0;
-		data->scsblcnt = 0;
-		data->scsres1 = 0.0;
-		data->transid = 0;	/* indicates what kind of data */
-		data->reftime = -1.0;	/* unitialized */
-
-		data->datuhr = -1.0;
-
-		for (i=0;i<8;i++)
-			data->mksysint[i]=0;
-
-		for (i=0;i<84;i++)
-			data->mktext[i]=0;
-
-		data->navid = 0;
-		data->year = 0;
-		data->month = 0;
-		data->day = 0;
-		data->hour = 0;
-		data->minute = 0;
-		data->second = 0;
-		data->millisecond = 0.0;
-
-		data->lon = 0.0;
-		data->lat = 0.0;
-
-
-		data->ckeel = 0.0;
-		data->cmean = 0.0;
-		data->Port = 0;
-		data->noho = 0;
-		data->skals = 0;
-
-		for (i=0;i<MBF_HSMDARAW_BEAMS_PING;i++)
-			{
-			data->spfb[i] = 0;
-			data->angle[i] = mbf_hsmdaraw_beamangle[i];
-			data->depth[i] = 0.0;
-			data->distance[i] = 0.0;
-			}
-
-		data->ss_range = 0.0;
-		for (i=0;i<MBF_HSMDARAW_PIXELS_PING;i++)
-			data->ss[i] = 0;
-
-		data->heading_tx = 0.0;
-		for (i=0;i<5;i++)
-			data->heading_rx[i] = 0.0;
-
-		data->roll_tx = 0.0;
-		for (i=0;i<5;i++)
-			data->roll_rx[i] = 0.0;
-
-		data->pitch_tx = 0.0;
-		for (i=0;i<5;i++)
-			data->pitch_rx[i] = 0.0;
-
-		data->num_vel = 0;
-		for (i=0;i<MBF_HSMDARAW_MAXVEL;i++)
-			{
-			data->vdepth[i] = 0.0;
-			data->velocity[i] = 0.0;
-			}
-
-		}
-
-	/* assume success */
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_rt_hsmdaraw(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	 *function_name = "mbr_rt_hsmdaraw";
-	int	 status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_hsmdaraw_struct *data;
-	struct mbsys_hsmd_struct *store;
-	int	time_i[7];
-	double	time_d;
-	double	lon, lat, heading, speed;
-	int	 i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointers to mbio descriptor and data structures */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-	data = (struct mbf_hsmdaraw_struct *) mb_io_ptr->raw_data;
-	store = (struct mbsys_hsmd_struct *) store_ptr;
-
-	/* read next (record of) data from file */
-	status = mbr_hsmdaraw_rd_data(verbose,mbio_ptr,error);
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"dbg5: In function name:\t%s\n", function_name);
-		fprintf(stderr,"dbg5:\t Returned from  mbr_hsmdaraw_rd_data()\n");
-		fprintf(stderr,"dbg5:\t Status:\t%d\n", status);
-		fprintf(stderr,"dbg5:\t data->kind:\t%d\n", data->kind);
-		fprintf(stderr,"dbg5:\t store_ptr: \t%p\n",(void *)store_ptr);
-		}
-
-	/* set error and kind in mb_io_ptr */
-	mb_io_ptr->new_error = *error;
-	mb_io_ptr->new_kind = data->kind;
-
-	/* add nav records to list for interpolation */
-	if (status == MB_SUCCESS
-		&& data->kind == MB_DATA_NAV)
-		{
-		time_i[0] = data->year;
-		time_i[1] = data->month;
-		time_i[2] = data->day;
-		time_i[3] = data->hour;
-		time_i[4] = data->minute;
-		time_i[5] = data->second;
-		time_i[6] = 1000 * data->millisecond;
-		mb_get_time(verbose, time_i, &time_d);
-		lon = data->lon;
-		lat = data->lat;
-		mb_navint_add(verbose, mbio_ptr, time_d, lon, lat, error);
-		}
-
-	/* interpolate navigation for survey pings if needed */
-	if (status == MB_SUCCESS
-		&& data->kind == MB_DATA_DATA
-		&& mb_io_ptr->nfix >= 1)
-		{
-		time_i[0] = data->year;
-		time_i[1] = data->month;
-		time_i[2] = data->day;
-		time_i[3] = data->hour;
-		time_i[4] = data->minute;
-		time_i[5] = data->second;
-		time_i[6] = 1000 * data->millisecond;
-		mb_get_time(verbose, time_i, &time_d);
-		heading = data->heading_tx;
-		mb_navint_interp(verbose, mbio_ptr, time_d, heading, 0.0,
-				    &lon, &lat, &speed, error);
-		data->lon = lon;
-		data->lat = lat;
-		data->speed = speed;
-		}
-
-	/* translate values to data storage structure */
-	if (status == MB_SUCCESS
-		&& store != NULL)
-    		{
-		/* type of data record */
-		store->kind = data->kind;
-
-		/* header values */
-		for (i=0;i<4;i++)
-			{
-			store->scsid[i] = data->scsid[i];
-			store->scsart[i] = data->scsart[i];
-			}
-		store->scslng = data->scslng;
-		store->scsext = data->scsext;
-		store->scsblcnt = data->scsblcnt;
-		store->scsres1 = data->scsres1;
-		store->transid = data->transid;
-		store->reftime = data->reftime;
-
-		/* event data */
-		store->datuhr = data->datuhr;
-		for (i=0;i<8;i++)
-			store->mksysint[i] = data->mksysint[i];
-		for (i=0;i<84;i++)
-			store->mktext[i] = data->mktext[i];
-
-		/* navigation data */
-		store->navid = data->navid;
-		store->year = data->year;
-		store->month = data->month;
-		store->day = data->day;
-		store->hour = data->hour;
-		store->minute = data->minute;
-		store->second = data->second;
-		store->secf = data->secf;
-		store->millisecond = data->millisecond;
-		store->PingTime = data->PingTime;
-		store->lon = data->lon;
-		store->lat = data->lat;
-		store->pos_sens[0] = data->pos_sens[0];
-		store->pos_sens[1] = data->pos_sens[1];
-
-		/* travel time, bathymetry and sidescan data */
-		store->ckeel = data->ckeel;
-		store->cmean = data->cmean;
-		store->Port = data->Port;
-		store->noho = data->noho;
-		store->skals = data->skals;
-		for (i=0;i<MBF_HSMDARAW_BEAMS_PING;i++)
-			{
-	  		store->spfb[i] = data->spfb[i];
-	 		store->depth[i] = data->depth[i];
-	  		store->distance[i] = data->distance[i];
-	  		store->angle[i] = data->angle[i];
-			}
-		store->ss_range = data->ss_range;
-		for (i=0;i<MBF_HSMDARAW_PIXELS_PING;i++)
-			{
-			store->ss[i] = data->ss[i];
-			}
-		store->heading_tx = data->heading_tx;
-		store->roll_tx = data->roll_tx;
-		store->pitch_tx = data->pitch_tx;
-		for (i=0;i<5;i++)
-			{
-			store->heading_rx[i] = data->heading_rx[i];
-			store->pitch_rx[i] = data->pitch_rx[i];
-			store->roll_rx[i] = data->roll_rx[i];
-			}
-
-		/* MD event data */
-		store->evid = data->evid;
-		for (i=0;i<84;i++)
-			store->evtext[i] = data->evtext[i];
-
-		store->num_vel = data->num_vel;
-		for (i=0;i<data->num_vel;i++)
-			{
-			store->vdepth[i] = data->vdepth[i];
-			store->velocity[i] = data->velocity[i];
-			}
-
-		/* comment */
-		strncpy(store->comment,data->comment,MBSYS_HSMD_COMMENT);
-		store->heave = data->heave;
-		store->speed = data->speed;
-    		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_wt_hsmdaraw(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_wt_hsmdaraw";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_hsmdaraw_struct *data;
-	char	*data_ptr;
-	struct mbsys_hsmd_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_hsmdaraw_struct *) mb_io_ptr->raw_data;
-	data_ptr = (char *) data;
-	store = (struct mbsys_hsmd_struct *) store_ptr;
-
-	/* first translate values from data storage structure */
-	if (store != NULL)
-    		{
-		/* type of data record */
-		data->kind = store->kind;
-
-		/* header values */
-		for (i=0;i<4;i++)
-			{
-			data->scsid[i] = store->scsid[i];
-			data->scsart[i] = store->scsart[i];
-			}
-		data->scslng = store->scslng;
-		data->scsext = store->scsext;
-		data->scsblcnt = store->scsblcnt;
-		data->scsres1 = store->scsres1;
-		data->transid = store->transid;
-		data->reftime = store->reftime;
-
-		/* event data */
-		data->datuhr = store->datuhr;
-		for (i=0;i<8;i++)
-			data->mksysint[i] = store->mksysint[i];
-		for (i=0;i<84;i++)
-			data->mktext[i] = store->mktext[i];
-
-		/* navigation data */
-		data->navid = store->navid;
-		data->year = store->year;
-		data->month = store->month;
-		data->day = store->day;
-		data->hour = store->hour;
-		data->minute = store->minute;
-		data->second = store->second;
-		data->secf = store->secf;
-		data->millisecond = store->millisecond;
-		data->PingTime = store->PingTime;
-		data->lon = store->lon;
-		data->lat = store->lat;
-		data->pos_sens[0] = store->pos_sens[0];
-		data->pos_sens[1] = store->pos_sens[1];
-
-		/* travel time, bathymetry and sidescan data */
-		data->ckeel = store->ckeel;
-		data->cmean = store->cmean;
-		data->Port = store->Port;
-		data->noho = store->noho;
-		data->skals = store->skals;
-		for (i=0;i<MBF_HSMDARAW_BEAMS_PING;i++)
-			{
-	  		data->spfb[i] = store->spfb[i];
-	 		data->depth[i] = store->depth[i];
-	  		data->distance[i] = store->distance[i];
-	  		data->angle[i] = store->angle[i];
-			}
-		data->ss_range = store->ss_range;
-		for (i=0;i<MBF_HSMDARAW_PIXELS_PING;i++)
-			{
-			data->ss[i] = store->ss[i];
-			}
-		data->heading_tx = store->heading_tx;
-		data->roll_tx = store->roll_tx;
-		data->pitch_tx = store->pitch_tx;
-		for (i=0;i<5;i++)
-			{
-			data->heading_rx[i] = store->heading_rx[i];
-			data->pitch_rx[i] = store->pitch_rx[i];
-			data->roll_rx[i] = store->roll_rx[i];
-			}
-
-		/* MD event data */
-		data->evid = store->evid;
-		for (i=0;i<84;i++)
-			data->evtext[i] = store->evtext[i];
-
-		data->num_vel = store->num_vel;
-		for (i=0;i<store->num_vel;i++)
-			{
-			data->vdepth[i] = store->vdepth[i];
-			data->velocity[i] = store->velocity[i];
-			}
-
-		/* comment */
-		strncpy(data->comment,store->comment,MBSYS_HSMD_COMMENT);
-		data->heave = store->heave;
-		data->speed = store->speed;
-    		}
-
-	/* write next data to file */
-	status = mbr_hsmdaraw_wr_data(verbose,mbio_ptr,data_ptr,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_hsmdaraw_rd_data(int verbose, void *mbio_ptr, int *error)
-{
-	char    *function_name = "mbr_hsmdaraw_rd_data";
-	int     status = MB_SUCCESS;
-	struct  mb_io_struct *mb_io_ptr;
-	struct  mbf_hsmdaraw_struct *data;
-	char    *data_ptr;
-	FILE    *mbfp;
-	XDR	*xdrs;		/* xdr i/o pointer */
-	int     i;
-	int     time_i[7];
-	double	scale;
-	double	PingTime;	/* Synthesised time of this ping
-				 		PingTime = Base_time
-				 		+ (current.datuhr
-						- FirstReftime) */
-
-	double *FirstReftime;	/* time from the first header */
-	int  *Header_count; /* number of header records encounterd */
-	int  *Rev_count;	   /* Raw Event counter */
-	int  *Nav_count;	   /* number of Nav records */
-	int  *Angle_count;  /* etc....... */
-	int  *Svp_count;
-	int  *Raw_count;
-	int  *MDevent_count;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_hsmdaraw_struct *) mb_io_ptr->raw_data;
-	data_ptr = (char *) data;	/* The data structure pointer */
-	mbfp = mb_io_ptr->mbfp;		/* The file pointer */
-	xdrs = mb_io_ptr->xdrs;
-	FirstReftime = &mb_io_ptr->saved1;	/* time from the first header */
-	Header_count = &mb_io_ptr->save1; /* number of header records encounterd */
-	Rev_count = &mb_io_ptr->save2;	   /* Raw Event counter */
-	Nav_count = &mb_io_ptr->save3;	   /* number of Nav records */
-	Angle_count = &mb_io_ptr->save4;  /* etc....... */
-	Svp_count = &mb_io_ptr->save5;
-	Raw_count = &mb_io_ptr->save6;
-	MDevent_count = &mb_io_ptr->save7;
-
-	/* set file position */
-	mb_io_ptr->file_pos = mb_io_ptr->file_bytes;
-
-	/* Start reading an HSMD Header structure */
-	/* read the first four bytes */
-	for (i=0;i<4;i++)
-		status = xdr_char(xdrs, &data->scsid[i]);
-
-	/* loop until the beginning of a record is found */
-	while (status == MB_SUCCESS
-		&& strncmp(data->scsid, "DXT", 3) != 0)
-		{
-		if (data->scsid[1] == 'D'
-		    || data->scsid[2] == 'D'
-		    || data->scsid[3] == 'D')
-		    {
-		    for (i=0;i<3;i++)
-			    data->scsid[i] = data->scsid[i+1];
-		    status = xdr_char(xdrs, &data->scsid[3]);
-		    }
-		else
-		    {
-		    while (status == MB_SUCCESS
-			&& data->scsid[0] != 'D')
-			{
-			if ((status = fread(&data->scsid[0],
-				1,1,mb_io_ptr->mbfp)) != 1)
-				{
-				status = MB_FAILURE;
-				*error = MB_ERROR_EOF;
-				}
-			}
-		    if (status == MB_SUCCESS)
-			{
-			for (i=1;i<4;i++)
-			    status = xdr_char(xdrs, &data->scsid[i]);
-			}
-		    }
-		}
-
-	/* now read the rest of the record */
-	if (status == MB_SUCCESS)
-		for (i=0;i<4;i++)
-			status = xdr_char(xdrs, &data->scsart[i]);
-	if (status == MB_SUCCESS)
-		status = xdr_int(xdrs, &data->scslng);
-	if (status == MB_SUCCESS)
-		status = xdr_int(xdrs, &data->scsext);
-	if (status == MB_SUCCESS)
-		status = xdr_int(xdrs, &data->scsblcnt);
-	if (status == MB_SUCCESS)
-		status = xdr_double(xdrs, &data->scsres1);
-	if (status == MB_SUCCESS)
-		status = xdr_int(xdrs, &data->transid);
-
-	/* get first time and initialize the time base */
-	if (status == MB_SUCCESS)
-		status = xdr_double(xdrs, &data->reftime);
-	if (status == MB_SUCCESS
-		&& data->transid != MBF_HSMDARAW_COM)
-		{
-		(*Header_count)++;
-		if (*Header_count == 1)
-			*FirstReftime = data->reftime;
-		}
-
-	/* check status */
-	if (status == MB_SUCCESS)
-	      	*error = MB_ERROR_NO_ERROR;
-	else
-	      	*error = MB_ERROR_EOF;
-
-	/* print out some debug messages */
-	if (verbose >= 2 && status == MB_SUCCESS)
-		{
-		fprintf(stderr,"\ndbg2: ========================== \n");
-		fprintf(stderr,"dbg2: HED (0) # %d\t%.3lf\t%.3lf \n",
-				*Header_count,data->reftime, data->reftime-*FirstReftime);
-		}
-	if (verbose >= 5 && status == MB_SUCCESS)
-		{
-		fprintf(stderr,"dbg5: data  From Header:\n");
-		fprintf(stderr,"dbg5: \t->scsid : \t%s\n",data->scsid);
-		fprintf(stderr,"dbg5: \t->scsart: \t%s\n",data->scsart);
-		fprintf(stderr,"dbg5: \t->scslng: \t%d\t0x%0X\n",
-		  		data->scslng,data->scslng);
-		fprintf(stderr,"dbg5: \t->scsext:  \t%d\n",
-				data->scsext);
-		fprintf(stderr,"dbg5: \t->scsblcnt:\t%d\n",
-				data->scsblcnt);
-		fprintf(stderr,"dbg5: \t->scsres1: \t%lf\n",
-				data->scsres1);
-		fprintf(stderr,"dgb5: \t->transid: \t%d\n",
-				data->transid);
-		fprintf(stderr,"dgb5: \t->reftime: \t%lf\n",
-				data->reftime);
-		}
-
-     	/* done reading the header part of this data record
-		- now read the rest*/
-
-	/* read the appropriate data records */
-	if (status == MB_SUCCESS )
-		{
-		switch(data->transid)
-	  		{
-	  		case (MBF_HSMDARAW_RAW):	/* 1, Raw data record */
-	    			{
-				data->kind = MB_DATA_DATA;
-
-	      			(*Raw_count)++;	/* the number of this kind of record */
-
-				/* get water velocity and travel time data */
-	      			if (status == MB_SUCCESS)
-					status = xdr_double(xdrs, &data->ckeel);
-	      			if (status == MB_SUCCESS)
-					status = xdr_double(xdrs, &data->cmean);
-	      			if (status == MB_SUCCESS)
-					status = xdr_int(xdrs, &data->Port);
-				if (status == MB_SUCCESS)
-					status = xdr_int(xdrs, &data->noho);
-				if (status == MB_SUCCESS)
-					status = xdr_int(xdrs, &data->skals);
-				if (status == MB_SUCCESS)
-					for (i=0;i<MBF_HSMDARAW_BEAMS_PING;i++)
-						status = xdr_int(xdrs, &data->spfb[i]);
-
-				/* Check for bad beams - broken records produce
-				    bogus data - it happens with HSMD systems!!! */
-				if (data->skals)
-					scale = 0.00015;
-				else
-					scale = 0.000015;
-				if (status == MB_SUCCESS)
-				for (i=0; i<MBF_HSMDARAW_BEAMS_PING; i++ )
-		    			{
-	 				if (data->spfb[i] < -65535
-					    || data->spfb[i] > 65535)
-					    {
-					    data->spfb[i] = 0;
-					    }
-					}
-
-				/* Calculate bathymetry.
-					The travel times are scaled to
-					seconds, then adjusted for the mean sound
-					speed, then do the simple geometry to
-					calculate depth and cross-track. */
-				if (data->skals)
-					scale = 0.00015;
-				else
-					scale = 0.000015;
-				if (status == MB_SUCCESS)
-				for (i=0; i<MBF_HSMDARAW_BEAMS_PING; i++ )
-		    			{
-	 				data->depth[i] =
-						(fabs(scale * data->spfb[i])
-						* 0.5 * data->cmean)
-	    					* cos(data->angle[i] * DTR);
-	 				data->distance[i] =
-	    					data->depth[i]
-						* tan(data->angle[i] * DTR );
-	  				if (data->spfb[i] < 0)
-	   					data->depth[i] =
-							-data->depth[i];
-					if (data->Port == -1)
-						data->distance[i] =
-							-data->distance[i];
-					}
-
-				/* get sidescan data */
-				if (status == MB_SUCCESS)
-					status = xdr_double(xdrs, &data->ss_range);
-				if (status == MB_SUCCESS)
-					for (i=0;i<MBF_HSMDARAW_PIXELS_PING;i++)
-						status = xdr_char(xdrs, (char *)&data->ss[i]);
-
-				/* get attitude data */
-				if (status == MB_SUCCESS)
-					status = xdr_double(xdrs, &data->heading_tx);
-				if (status == MB_SUCCESS)
-					for (i=0;i<5;i++)
-						status = xdr_double(xdrs, &data->heading_rx[i]);
-				if (status == MB_SUCCESS)
-					status = xdr_double(xdrs, &data->roll_tx);
-				if (status == MB_SUCCESS)
-					for (i=0;i<5;i++)
-						status = xdr_double(xdrs, &data->roll_rx[i]);
-				if (status == MB_SUCCESS)
-					status = xdr_double(xdrs, &data->pitch_tx);
-				if (status == MB_SUCCESS)
-					for (i=0;i<5;i++)
-						status = xdr_double(xdrs, &data->pitch_rx[i]);
-
-				/* Establish the time of day for this
-				 * ping. "Raw" (travel time) data records
-				 * do not contain time of day, only the
-				 * internal Reference time. The interrupt
-				 * records contain a unix epoch time used
-				 * to convert to UTC. */
-				if (status == MB_SUCCESS)
-					{
-					PingTime = data->datuhr + (data->reftime
-						- *FirstReftime);
-					status = mb_get_date(verbose,PingTime,time_i);
-
-					data->PingTime 		= PingTime;
-					data->year 		= time_i[0];
-					data->month 		= time_i[1];
-					data->day 		= time_i[2];
-					data->hour 		= time_i[3];
-					data->minute 		= time_i[4];
-					data->second 		= time_i[5];
-					data->millisecond 	= time_i[6] / 1000;
-					}
-
-	      			/* output some debug messages */
-				if (verbose >= 2 && status == MB_SUCCESS)
-					{
-					fprintf(stderr,"\ndgb2: Setting time of Ping in RAW\n:");
-					fprintf(stderr,"dbg2: \t->year:   \t%4d\n",data->year);
-					fprintf(stderr,"dbg2: \t->month:  \t%2d\n",data->month);
-					fprintf(stderr,"dgb2: \t->day:    \t%2d\n",data->day);
-					fprintf(stderr,"dgb2: \t->hour:   \t%2d\n",data->hour);
-					fprintf(stderr,"dbg2: \t->minute: \t%2d\n",data->minute);
-					fprintf(stderr,"dbg2: \t->second: \t%2d\n",data->second);
-					fprintf(stderr,"dbg2: \t->millisecond: \t%3d\n",data->millisecond);
-					fprintf(stderr,"\ndbg2: \t->Lat:   \t%.4lf\n",data->lat);
-					fprintf(stderr,"\ndbg2: \t->Lon:   \t%.4lf\n",data->lon);
-					}
-				if (verbose >= 2 && status == MB_SUCCESS)
-					fprintf(stderr,"\ndbg2: RAW (1) \t%3d\t%4d %2d %2d %2d:%2d:%2d.%3d\n",
-						data->Port, data->year, data->month, data->day,
-						data->hour, data->minute, data->second, data->millisecond);
-				if (verbose >= 2 && status == MB_SUCCESS)
-					{
-					fprintf(stderr,"\ndgb2: Raw\n");
-					fprintf(stderr,"dbg2: \tckeel\t%8.2lf\n", data->ckeel);
-					fprintf(stderr,"dbg2: \tcmean\t%8.2lf\n", data->cmean);
-					fprintf(stderr,"dgb2: \tPort\t%d\n", data->Port);
-					fprintf(stderr,"\tnoho\t%d\n", data->noho);
-					fprintf(stderr,"\tskals\t%d\n", data->skals);
-					fprintf(stderr,"\tspfbs\n");
-					for (i=0;i<MBF_HSMDARAW_BEAMS_PING;i=i+4)
-		    				{
-						fprintf(stderr,"\t(%02d) %10d (%02d) %10d (%02d) %10d (%02d) %10d\n",
-			      				i,data->spfb[i],
-							i+1,data->spfb[i+1],
-							i+2, data->spfb[i+2],
-							i+3, data->spfb[i+3]);
-		   				}
-					fprintf(stderr,"\tss_range\t%lf\n", data->ss_range);
-					fprintf(stderr,"\tampl\n");
-					for (i=0;i<MBF_HSMDARAW_PIXELS_PING;i=i+4)
-		    				{
-						fprintf(stderr,"\t%d\t%d\t%d\t%d\n",
-							data->ss[i],
-							data->ss[i+1],
-							data->ss[i+2],
-			      				data->ss[i+3]);
-		    				}
-
-					fprintf(stderr,"\theading_tx\t%8.3lf\n", data->heading_tx);
-					fprintf(stderr,"\theading_rx:\t");
-					fprintf(stderr,"%8.3lf %8.3lf %8.3lf %8.3lf %8.3lf\n",
-						data->heading_rx[0],
-						data->heading_rx[1],
-						data->heading_rx[2],
-						data->heading_rx[3],
-						data->heading_rx[4]);
-
-					fprintf(stderr,"\troll_tx\t%8.3lf\n", data->roll_tx);
-					fprintf(stderr,"\troll_rx:\t");
-					fprintf(stderr,"%8.3lf %8.3lf %8.3lf %8.3lf %8.3lf\n",
-						data->roll_rx[0],
-						data->roll_rx[1],
-						data->roll_rx[2],
-						data->roll_rx[3],
-						data->roll_rx[4]);
-
-					fprintf(stderr,"\tpitch_tx\t%8.3lf\n", data->pitch_tx);
-					fprintf(stderr,"\tpitch_rx:\t");
-					fprintf(stderr,"%8.3lf %8.3lf %8.3lf %8.3lf %8.3lf\n",
-						data->pitch_rx[0],
-						data->pitch_rx[1],
-						data->pitch_rx[2],
-						data->pitch_rx[3],
-						data->pitch_rx[4]);
-					}
-
-				/* check status */
-				if (status == MB_SUCCESS)
-					{
-	      				*error = MB_ERROR_NO_ERROR;
-					}
-				else
-	      				*error = MB_ERROR_EOF;
-	     			break;
-	    			}
-
-	  		case (MBF_HSMDARAW_BAT):	/* 8, LDEO bath data record */
-	    			{
-				data->kind = MB_DATA_DATA;
-
-	      			(*Raw_count)++;	/* the number of this kind of record */
-
-				/* get time and position */
-	      			if (status == MB_SUCCESS)
-					status = xdr_double(xdrs, &data->PingTime);
-	      			if (status == MB_SUCCESS)
-					status = xdr_double(xdrs, &data->lon);
-	      			if (status == MB_SUCCESS)
-					status = xdr_double(xdrs, &data->lat);
-
-				/* get water velocity and travel time data */
-	      			if (status == MB_SUCCESS)
-					status = xdr_double(xdrs, &data->ckeel);
-	      			if (status == MB_SUCCESS)
-					status = xdr_double(xdrs, &data->cmean);
-	      			if (status == MB_SUCCESS)
-					status = xdr_int(xdrs, &data->Port);
-				if (status == MB_SUCCESS)
-					status = xdr_int(xdrs, &data->noho);
-				if (status == MB_SUCCESS)
-					status = xdr_int(xdrs, &data->skals);
-				if (status == MB_SUCCESS)
-					for (i=0;i<MBF_HSMDARAW_BEAMS_PING;i++)
-						status = xdr_int(xdrs, &data->spfb[i]);
-				if (status == MB_SUCCESS)
-					for (i=0;i<MBF_HSMDARAW_BEAMS_PING;i++)
-						status = xdr_double(xdrs, &data->depth[i]);
-				if (status == MB_SUCCESS)
-					for (i=0;i<MBF_HSMDARAW_BEAMS_PING;i++)
-						status = xdr_double(xdrs, &data->distance[i]);
-
-				/* get sidescan data */
-				if (status == MB_SUCCESS)
-					status = xdr_double(xdrs, &data->ss_range);
-				if (status == MB_SUCCESS)
-					for (i=0;i<MBF_HSMDARAW_PIXELS_PING;i++)
-						status = xdr_char(xdrs, (char *)&data->ss[i]);
-
-				/* get attitude data */
-				if (status == MB_SUCCESS)
-					status = xdr_double(xdrs, &data->heading_tx);
-				if (status == MB_SUCCESS)
-					for (i=0;i<5;i++)
-						status = xdr_double(xdrs, &data->heading_rx[i]);
-				if (status == MB_SUCCESS)
-					status = xdr_double(xdrs, &data->roll_tx);
-				if (status == MB_SUCCESS)
-					for (i=0;i<5;i++)
-						status = xdr_double(xdrs, &data->roll_rx[i]);
-				if (status == MB_SUCCESS)
-					status = xdr_double(xdrs, &data->pitch_tx);
-				if (status == MB_SUCCESS)
-					for (i=0;i<5;i++)
-						status = xdr_double(xdrs, &data->pitch_rx[i]);
-
-				/* Establish the time of day for this
-				 * ping. "Raw" (travel time) data records
-				 * do not contain time of day, only the
-				 * internal Reference time. The interrupt
-				 * records contain a unix epoch time used
-				 * to convert to UTC. */
-				if (status == MB_SUCCESS)
-					{
-					status = mb_get_date(verbose,
-						    data->PingTime,time_i);
-
-					data->year 		= time_i[0];
-					data->month 		= time_i[1];
-					data->day 		= time_i[2];
-					data->hour 		= time_i[3];
-					data->minute 		= time_i[4];
-					data->second 		= time_i[5];
-					data->millisecond 	= time_i[6] / 1000;
-					}
-
-	      			/* output some debug messages */
-				if (verbose >= 2 && status == MB_SUCCESS)
-					{
-					fprintf(stderr,"\ndgb2: Setting time of Ping in RAW\n:");
-					fprintf(stderr,"dbg2: \t->year:   \t%4d\n",data->year);
-					fprintf(stderr,"dbg2: \t->month:  \t%2d\n",data->month);
-					fprintf(stderr,"dgb2: \t->day:    \t%2d\n",data->day);
-					fprintf(stderr,"dgb2: \t->hour:   \t%2d\n",data->hour);
-					fprintf(stderr,"dbg2: \t->minute: \t%2d\n",data->minute);
-					fprintf(stderr,"dbg2: \t->second: \t%2d\n",data->second);
-					fprintf(stderr,"dbg2: \t->millisecond: \t%3d\n",data->millisecond);
-					fprintf(stderr,"\ndbg2: \t->Lat:   \t%.4lf\n",data->lat);
-					fprintf(stderr,"\ndbg2: \t->Lon:   \t%.4lf\n",data->lon);
-					}
-				if (verbose >= 2 && status == MB_SUCCESS)
-					fprintf(stderr,"\ndbg2: RAW (1) \t%3d\t%4d %2d %2d %2d:%2d:%2d.%3d\n",
-						data->Port, data->year, data->month, data->day,
-						data->hour, data->minute, data->second, data->millisecond);
-				if (verbose >= 2 && status == MB_SUCCESS)
-					{
-					fprintf(stderr,"\ndgb2: Raw\n");
-					fprintf(stderr,"dbg2: \tckeel\t%8.2lf\n", data->ckeel);
-					fprintf(stderr,"dbg2: \tcmean\t%8.2lf\n", data->cmean);
-					fprintf(stderr,"dgb2: \tPort\t%d\n", data->Port);
-					fprintf(stderr,"\tnoho\t%d\n", data->noho);
-					fprintf(stderr,"\tskals\t%d\n", data->skals);
-					fprintf(stderr,"\tspfbs\n");
-					for (i=0;i<MBF_HSMDARAW_BEAMS_PING;i=i+4)
-		    				{
-						fprintf(stderr,"\t(%02d) %10d (%02d) %10d (%02d) %10d (%02d) %10d\n",
-			      				i,data->spfb[i],
-							i+1,data->spfb[i+1],
-							i+2, data->spfb[i+2],
-							i+3, data->spfb[i+3]);
-		   				}
-					fprintf(stderr,"\tss_range\t%lf\n", data->ss_range);
-					fprintf(stderr,"\tampl\n");
-					for (i=0;i<MBF_HSMDARAW_PIXELS_PING;i=i+4)
-		    				{
-						fprintf(stderr,"\t%d\t%d\t%d\t%d\n",
-							data->ss[i],
-							data->ss[i+1],
-							data->ss[i+2],
-			      				data->ss[i+3]);
-		    				}
-
-					fprintf(stderr,"\theading_tx\t%8.3lf\n", data->heading_tx);
-					fprintf(stderr,"\theading_rx:\t");
-					fprintf(stderr,"%8.3lf %8.3lf %8.3lf %8.3lf %8.3lf\n",
-						data->heading_rx[0],
-						data->heading_rx[1],
-						data->heading_rx[2],
-						data->heading_rx[3],
-						data->heading_rx[4]);
-
-					fprintf(stderr,"\troll_tx\t%8.3lf\n", data->roll_tx);
-					fprintf(stderr,"\troll_rx:\t");
-					fprintf(stderr,"%8.3lf %8.3lf %8.3lf %8.3lf %8.3lf\n",
-						data->roll_rx[0],
-						data->roll_rx[1],
-						data->roll_rx[2],
-						data->roll_rx[3],
-						data->roll_rx[4]);
-
-					fprintf(stderr,"\tpitch_tx\t%8.3lf\n", data->pitch_tx);
-					fprintf(stderr,"\tpitch_rx:\t");
-					fprintf(stderr,"%8.3lf %8.3lf %8.3lf %8.3lf %8.3lf\n",
-						data->pitch_rx[0],
-						data->pitch_rx[1],
-						data->pitch_rx[2],
-						data->pitch_rx[3],
-						data->pitch_rx[4]);
-
-					}
-
-				/* check status */
-				if (status == MB_SUCCESS)
-					{
-	      				*error = MB_ERROR_NO_ERROR;
-					}
-				else
-	      				*error = MB_ERROR_EOF;
-	     			break;
-	    			}
-
-	  		case (MBF_HSMDARAW_NAV): /* 2, Navigation data record */
-	    			{
-				(*Nav_count)++;
-				data->kind = MB_DATA_NAV;
-
-				/* get nav data */
-				if (status == MB_SUCCESS)
-					status = xdr_int(xdrs, &data->navid);
-				if (status == MB_SUCCESS)
-					status = xdr_int(xdrs,&data->year);
-				if (status == MB_SUCCESS)
-					mb_fix_y2k(verbose, data->year, &data->year);
-				if (status == MB_SUCCESS)
-					status = xdr_int(xdrs,&data->month);
-				if (status == MB_SUCCESS)
-					status = xdr_int(xdrs,&data->day);
-				if (status == MB_SUCCESS)
-					status = xdr_int(xdrs,&data->hour);
-				if (status == MB_SUCCESS)
-					status = xdr_int(xdrs,&data->minute);
-				if (status == MB_SUCCESS)
-					status = xdr_double(xdrs,&data->secf);
-				if (status == MB_SUCCESS)
-					{
-					/* break decimal seconds into integer
-						seconds and msec */
-					data->second = (int) data->secf;
-					data->millisecond = (int) (1000 * (data->secf - data->second));
-					}
-
-				/* get position */
-				if (status == MB_SUCCESS)
-					status = xdr_double(xdrs, &data->lat);
-				if (status == MB_SUCCESS)
-					status = xdr_double(xdrs, &data->lon);
-				if (status == MB_SUCCESS)
-					status = xdr_char(xdrs, &data->pos_sens[0]);
-				if (status == MB_SUCCESS)
-					status = xdr_char(xdrs, &data->pos_sens[1]);
-
-				/* Establish the time of day for this
-				 * nav record. Nav data records
-				 * do contain time of day, but the values
-				 * seem unreliable. Thus, we use the
-				 * internal Reference time. The interrupt
-				 * records contain a unix epoch time used
-				 * to convert to UTC. */
-				if (status == MB_SUCCESS)
-					{
-					PingTime = data->datuhr + (data->reftime
-						- *FirstReftime);
-					status = mb_get_date(verbose,PingTime,time_i);
-
-					data->PingTime 		= PingTime;
-					data->year 		= time_i[0];
-					data->month 		= time_i[1];
-					data->day 		= time_i[2];
-					data->hour 		= time_i[3];
-					data->minute 		= time_i[4];
-					data->second 		= time_i[5];
-					data->millisecond 	= time_i[6] / 1000;
-					}
-
-	      			/* output some debug messages */
-				if (verbose >= 2 && status == MB_SUCCESS)
-					fprintf(stderr,"\ndbg2: NAV (2) # %3d\t%4d %2d %2d %2d:%2d:%2d.%3d\n",
-						*Nav_count, data->year, data->month, data->day,
-						data->hour, data->minute, data->second, data->millisecond);
-				if (verbose >= 2 && status == MB_SUCCESS)
-					{
-					fprintf(stderr,"dbg2: \nNav\n");
-					fprintf(stderr,"dbg2: \t->navid:  \t%d\n",data->navid);
-					fprintf(stderr,"dbg2: \t->year:   \t%4d\n",data->year);
-					fprintf(stderr,"dbg2: \t->month:  \t%2d\n",data->month);
-					fprintf(stderr,"dbg2: \t->day:    \t%2d\n",data->day);
-					fprintf(stderr,"dbg2: \t->hour:   \t%2d\n",data->hour);
-					fprintf(stderr,"dbg2: \t->minute: \t%2d\n",data->minute);
-					fprintf(stderr,"dbg2: \t->second: \t%2d\n",data->second);
-					fprintf(stderr,"dbg2: \t->millisec::\t%.3f\n",data->secf);
-
-					fprintf(stderr,"dbg2: \t->lat:    \t%lf\n",data->lat);
-					fprintf(stderr,"dbg2: \t->lon:    \t%lf\n",data->lon);
-					fprintf(stderr,"dbg2: \t->pos_sens:\t%s\n", data->pos_sens);
-					}
-				if ( verbose >= 2 && status == MB_SUCCESS)
-					{
-					fprintf(stderr,"dbg2: %4d %2d %3d %2d %2d %2d %d %10.5lf %10.5lf %2d %2s \n",
-					data->year,
-					data->month,
-					data->day,
-					data->hour,
-					data->minute,
-					data->second,
-					data->millisecond,
-					data->lat,
-					data->lon,
-					data->navid,
-					data->pos_sens);
-					}
-
-				/* check status */
-				if (status == MB_SUCCESS)
-	      				*error = MB_ERROR_NO_ERROR;
-				else
-	      				*error = MB_ERROR_EOF;
-	     			break;
-	    			}
-
-			case (MBF_HSMDARAW_MDE):		/* 3, MD Event */
-	    			{
-				(*MDevent_count)++;
-				data->kind = MB_DATA_EVENT;
-
-				if (status == MB_SUCCESS)
-					status = xdr_int(xdrs, &data->evid);
-
-				if (status == MB_SUCCESS)
-					for (i=0;i<84;i++)
-						status = xdr_char(xdrs, &data->evtext[i]);
-
-				/* Establish the time of day for this
-				 * record. Event data records
-				 * do not contain time of day, only the
-				 * internal Reference time. The interrupt
-				 * records contain a unix epoch time used
-				 * to convert to UTC. */
-				if (status == MB_SUCCESS)
-					{
-					PingTime = data->datuhr + (data->reftime
-						- *FirstReftime);
-					status = mb_get_date(verbose,
-						    PingTime,time_i);
-
-					data->PingTime 		= PingTime;
-					data->year 		= time_i[0];
-					data->month 		= time_i[1];
-					data->day 		= time_i[2];
-					data->hour 		= time_i[3];
-					data->minute 		= time_i[4];
-					data->second 		= time_i[5];
-					data->millisecond 	= time_i[6] / 1000;
-					}
-
-				/* output some debug messages */
-				if (verbose >= 2 && status == MB_SUCCESS)
-					{
-					fprintf(stderr,"MDE (3) # %d\n", *MDevent_count);
-					}
-	      			if (verbose >= 2 && status == MB_SUCCESS)
-					{
-					fprintf(stderr,"MDE Event->\n");
-					fprintf(stderr,"\t->evid:\t%d\n", data->evid);
-					fprintf(stderr,"\t->evtxt:\t%s\n", data->evtext);
-					}
-
-				/* check status */
-				if (status == MB_SUCCESS)
-	      				*error = MB_ERROR_NO_ERROR;
-				else
-	      				*error = MB_ERROR_EOF;
-	     			break;
-	    			}
-
-			case (MBF_HSMDARAW_ANG): /* Transid == 4, Beam Angles */
-	    			{
-				(*Angle_count)++;
-				data->kind = MB_DATA_ANGLE;
-
-				if (status == MB_SUCCESS)
-					status = xdr_int(xdrs, &data->noho);
-
-				if (status == MB_SUCCESS && status == MB_SUCCESS)
-					for (i=0;i<MBF_HSMDARAW_BEAMS_PING;i++)
-						{
-						status = xdr_double(xdrs, &data->angle[i]);
-						mbf_hsmdaraw_beamangle[i] = data->angle[i];
-						}
-
-				/* Establish the time of day for this
-				 * record. Angle data records
-				 * do not contain time of day, only the
-				 * internal Reference time. The interrupt
-				 * records contain a unix epoch time used
-				 * to convert to UTC. */
-				if (status == MB_SUCCESS)
-					{
-					PingTime = data->datuhr + (data->reftime
-						- *FirstReftime);
-					status = mb_get_date(verbose,
-						    PingTime,time_i);
-
-					data->PingTime 		= PingTime;
-					data->year 		= time_i[0];
-					data->month 		= time_i[1];
-					data->day 		= time_i[2];
-					data->hour 		= time_i[3];
-					data->minute 		= time_i[4];
-					data->second 		= time_i[5];
-					data->millisecond 	= time_i[6] / 1000;
-					}
-
-				/* output some debug messages */
-				if (verbose >= 2 && status == MB_SUCCESS)
-					{
-					fprintf(stderr,"\ndbg2: ANG (4) # %d\n", *Angle_count);
-					}
-				if ( verbose >= 5 && status == MB_SUCCESS)
-					{
-					fprintf(stderr,"\ndgb5: Ang");
-					fprintf(stderr,"dbg5:\tnoho:\t%d\n", data->noho);
-		  			for (i=0;i<MBF_HSMDARAW_BEAMS_PING;i=i+4)
-		   				{
-		      				fprintf(stderr,"\t%02d: %8.3lf\t%02d: %8.3lf\t%02d: %8.3lf\t%02d: %8.3lf\n",
-						i,data->angle[i],
-						i+1,data->angle[i+1],
-						i+2, data->angle[i+2],
-						i+3, data->angle[i+3]);
-		    				}
-					}
-
-				/* check status */
-				if (status == MB_SUCCESS)
-	      				*error = MB_ERROR_NO_ERROR;
-				else
-	      				*error = MB_ERROR_EOF;
-	     			break;
-	    			}
-
-			case (MBF_HSMDARAW_SVP): /* 5, Sound Velocity Profile */
-	    			{
-				(*Svp_count)++;
-				data->kind = MB_DATA_VELOCITY_PROFILE;
-
-				data->num_vel = 20;
-				for (i=0;i<data->num_vel;i++)
-					{
-					status = xdr_double(xdrs, &data->vdepth[i]);
-					status = xdr_double(xdrs, &data->velocity[i]);
-					}
-
-				/* Establish the time of day for this
-				 * record. SVP data records
-				 * do not contain time of day, only the
-				 * internal Reference time. The interrupt
-				 * records contain a unix epoch time used
-				 * to convert to UTC. */
-				if (status == MB_SUCCESS)
-					{
-					PingTime = data->datuhr + (data->reftime
-						- *FirstReftime);
-					status = mb_get_date(verbose,
-						    PingTime,time_i);
-
-					data->PingTime 		= PingTime;
-					data->year 		= time_i[0];
-					data->month 		= time_i[1];
-					data->day 		= time_i[2];
-					data->hour 		= time_i[3];
-					data->minute 		= time_i[4];
-					data->second 		= time_i[5];
-					data->millisecond 	= time_i[6] / 1000;
-					}
-
-				/* output some debug messages */
-				if (verbose >= 2 && status == MB_SUCCESS)
-					{
-					fprintf(stderr,"\ndbg2: SVP (5) # %d\n",*Svp_count);
-					}
-
-				/* check status */
-				if (status == MB_SUCCESS)
-	      				*error = MB_ERROR_NO_ERROR;
-				else
-	      				*error = MB_ERROR_EOF;
-	     			break;
-	    			}
-
-
-			case (MBF_HSMDARAW_REV):	/* 6, An Interrupt event? */
-	    			{
-				(*Rev_count)++;
-
-				if (status == MB_SUCCESS)
-					status = xdr_double(xdrs, &data->datuhr);
-				if (status == MB_SUCCESS)
-					for (i=0;i<8;i++)
-						status = xdr_char(xdrs, &data->mksysint[i]);
-				if (status == MB_SUCCESS)
-					for (i=0;i<84;i++)
-						status = xdr_char(xdrs, &data->mktext[i]);
-
-				/* Establish the time of day for this
-				 * record. Interrupt data records
-				 * contain a unix time which is used
-				 * to get time of day. */
-				if (status == MB_SUCCESS)
-					{
-					PingTime = data->datuhr + (data->reftime
-						- *FirstReftime);
-					status = mb_get_date(verbose,
-						    PingTime,time_i);
-
-					data->PingTime 		= PingTime;
-					data->year 		= time_i[0];
-					data->month 		= time_i[1];
-					data->day 		= time_i[2];
-					data->hour 		= time_i[3];
-					data->minute 		= time_i[4];
-					data->second 		= time_i[5];
-					data->millisecond 	= time_i[6] / 1000;
-					}
-
-				/* output some debug messages */
-	      			if (verbose >= 2 && status == MB_SUCCESS)
-					{
-					fprintf(stderr,"dbg2:\n REV (6) # %d\t%.3lf",
-						*Rev_count, data->datuhr );
-					}
-				if (verbose >= 5 && status == MB_SUCCESS)
-					{
-					fprintf(stderr,"\nIntevent");
-					fprintf(stderr,"->datuhr:  \t%lf\n",data->datuhr);
-					fprintf(stderr,"\t->mksysint:\t%s\n",data->mksysint);
-					fprintf(stderr,"\t->mktext:  \t%s\n",data->mktext);
-					}
-
-				/* Check to see if this Raw Event is
-				 * indicating the start or end of the file. */
-				if (status == MB_SUCCESS
-					&& strncmp(data->mksysint, "STOP",4) == 0)
-					{
-					data->kind = MB_DATA_STOP;
-		  			*error = MB_ERROR_NO_ERROR;
-					}
-				else if (status == MB_SUCCESS)
-					{
-					data->kind = MB_DATA_START;
-		  			*error = MB_ERROR_NO_ERROR;
-					}
-				else
-					{
-					*error = MB_ERROR_EOF;
-					}
-				break;
-	    			}
-
-			case (MBF_HSMDARAW_COM):	/* 7, Comment */
-	    			{
-				data->kind = MB_DATA_COMMENT;
-
-				if (status == MB_SUCCESS)
-					for (i=0;i<MBF_HSMDARAW_COMMENT;i++)
-						status = xdr_char(xdrs, &data->comment[i]);
-
-				/* Check status. */
-				if (status == MB_SUCCESS)
-		  			*error = MB_ERROR_NO_ERROR;
-				else
-					*error = MB_ERROR_EOF;
-				break;
-	    			}
-
-	  		default:
-	    			{
-				/* Should never get here, so fail! */
-				status = MB_FAILURE;
-	      			*error = MB_ERROR_UNINTELLIGIBLE;
-
-				if (verbose >=2)
-					{
-					fprintf(stderr,"dbg2: data->transid=%d not parsed\n",
-						data->transid);
-					}
-				break;
-	    			}
-	  		}
-      		}
-
-	/* get file position */
-	mb_io_ptr->file_bytes = ftell(mb_io_ptr->mbfp);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_hsmdaraw_wr_data(int verbose, void *mbio_ptr, char *data_ptr, int *error)
-{
-	char	  *function_name = "mbr_hsmdaraw_wr_data";
-	int	  status = MB_SUCCESS;
-	struct  mb_io_struct *mb_io_ptr;
-	struct  mbf_hsmdaraw_struct *data;
-	FILE	  *mbfp;
-	XDR	*xdrs;		/* xdr i/o pointer */
-	int     i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       data_ptr:   %p\n",(void *)data_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_hsmdaraw_struct *) data_ptr;
-	mbfp = mb_io_ptr->mbfp;
-	xdrs = mb_io_ptr->xdrs;
-
-	/* make sure transid is correct */
-	if (data->transid == MBF_HSMDARAW_BAT)
-		data->transid = MBF_HSMDARAW_RAW;
-
-	/* Start writing an HSMD Header structure */
-	for (i=0;i<4;i++)
-		status = xdr_char(xdrs, &data->scsid[i]);
-	if (status == MB_SUCCESS)
-		for (i=0;i<4;i++)
-			status = xdr_char(xdrs, &data->scsart[i]);
-	if (status == MB_SUCCESS)
-		status = xdr_int(xdrs, &data->scslng);
-	if (status == MB_SUCCESS)
-		status = xdr_int(xdrs, &data->scsext);
-	if (status == MB_SUCCESS)
-		status = xdr_int(xdrs, &data->scsblcnt);
-	if (status == MB_SUCCESS)
-		status = xdr_double(xdrs, &data->scsres1);
-	if (status == MB_SUCCESS)
-		status = xdr_int(xdrs, &data->transid);
-	if (status == MB_SUCCESS)
-		status = xdr_double(xdrs, &data->reftime);
-
-	/* write the appropriate data record */
-	if (status == MB_SUCCESS )
-		{
-		switch(data->transid)
-	  		{
-	  		case (MBF_HSMDARAW_RAW):	/* 1, Raw data record */
-	    			{
-				/* make sure transid is correct */
-				data->transid = MBF_HSMDARAW_RAW;
-
-				/* First make sure bathymetry edits are
-					carried over into travel times */
-				for (i=0; i<MBF_HSMDARAW_BEAMS_PING; i++ )
-		    			{
-					if (data->depth[i] < 0.0 &&
-						data->spfb[i] > 0.0)
-						data->spfb[i] = -data->spfb[i];
-					else if (data->depth[i] > 0.0 &&
-						data->spfb[i] < 0.0)
-						data->spfb[i] = -data->spfb[i];
-		    			}
-
-	      			/* output some debug messages */
-				if (verbose >= 2 && status == MB_SUCCESS)
-					{
-					fprintf(stderr,"\ndgb2: Setting time of Ping in RAW\n:");
-					fprintf(stderr,"dbg2: \t->year:   \t%4d\n",data->year);
-					fprintf(stderr,"dbg2: \t->month:  \t%2d\n",data->month);
-					fprintf(stderr,"dgb2: \t->day:    \t%2d\n",data->day);
-					fprintf(stderr,"dgb2: \t->hour:   \t%2d\n",data->hour);
-					fprintf(stderr,"dbg2: \t->minute: \t%2d\n",data->minute);
-					fprintf(stderr,"dbg2: \t->second: \t%2d\n",data->second);
-					fprintf(stderr,"dbg2: \t->millisecond: \t%3d\n",data->millisecond);
-					fprintf(stderr,"\ndbg2: \t->Lat:   \t%.4lf\n",data->lat);
-					fprintf(stderr,"\ndbg2: \t->Lon:   \t%.4lf\n",data->lon);
-					}
-				if (verbose >= 2 && status == MB_SUCCESS)
-					fprintf(stderr,"\ndbg2: RAW (1) \t%3d\t%4d %2d %2d %2d:%2d:%2d.%3d\n",
-						data->Port, data->year, data->month, data->day,
-						data->hour, data->minute, data->second, data->millisecond);
-				if (verbose >= 2 && status == MB_SUCCESS)
-					{
-					fprintf(stderr,"\ndgb2: Raw\n");
-					fprintf(stderr,"dbg2: \tckeel\t%8.2lf\n", data->ckeel);
-					fprintf(stderr,"dbg2: \tcmean\t%8.2lf\n", data->cmean);
-					fprintf(stderr,"dgb2: \tPort\t%d\n", data->Port);
-					fprintf(stderr,"\tnoho\t%d\n", data->noho);
-					fprintf(stderr,"\tskals\t%d\n", data->skals);
-					fprintf(stderr,"\tspfbs\n");
-					for (i=0;i<MBF_HSMDARAW_BEAMS_PING;i=i+4)
-		    				{
-						fprintf(stderr,"\t(%02d) %10d (%02d) %10d (%02d) %10d (%02d) %10d\n",
-			      				i,data->spfb[i],
-							i+1,data->spfb[i+1],
-							i+2, data->spfb[i+2],
-							i+3, data->spfb[i+3]);
-		   				}
-					fprintf(stderr,"\tss_range\t%lf\n", data->ss_range);
-					fprintf(stderr,"\tampl\n");
-					for (i=0;i<MBF_HSMDARAW_PIXELS_PING;i=i+4)
-		    				{
-						fprintf(stderr,"\t%d\t%d\t%d\t%d\n",
-							data->ss[i],
-							data->ss[i+1],
-							data->ss[i+2],
-			      				data->ss[i+3]);
-		    				}
-
-					fprintf(stderr,"\theading_tx\t%8.3lf\n", data->heading_tx);
-					fprintf(stderr,"\theading_rx:\t");
-					fprintf(stderr,"%8.3lf %8.3lf %8.3lf %8.3lf %8.3lf\n",
-						data->heading_rx[0],
-						data->heading_rx[1],
-						data->heading_rx[2],
-						data->heading_rx[3],
-						data->heading_rx[4]);
-
-					fprintf(stderr,"\troll_tx\t%8.3lf\n", data->roll_tx);
-					fprintf(stderr,"\troll_rx:\t");
-					fprintf(stderr,"%8.3lf %8.3lf %8.3lf %8.3lf %8.3lf\n",
-						data->roll_rx[0],
-						data->roll_rx[1],
-						data->roll_rx[2],
-						data->roll_rx[3],
-						data->roll_rx[4]);
-
-					fprintf(stderr,"\tpitch_tx\t%8.3lf\n", data->pitch_tx);
-					fprintf(stderr,"\tpitch_rx:\t");
-					fprintf(stderr,"%8.3lf %8.3lf %8.3lf %8.3lf %8.3lf\n",
-						data->pitch_rx[0],
-						data->pitch_rx[1],
-						data->pitch_rx[2],
-						data->pitch_rx[3],
-						data->pitch_rx[4]);
-
-					}
-
-				/* set water velocity and travel time data */
-	      			if (status == MB_SUCCESS)
-					status = xdr_double(xdrs, &data->ckeel);
-	      			if (status == MB_SUCCESS)
-					status = xdr_double(xdrs, &data->cmean);
-	      			if (status == MB_SUCCESS)
-					status = xdr_int(xdrs, &data->Port);
-				if (status == MB_SUCCESS)
-					status = xdr_int(xdrs, &data->noho);
-				if (status == MB_SUCCESS)
-					status = xdr_int(xdrs, &data->skals);
-				if (status == MB_SUCCESS)
-					for (i=0;i<MBF_HSMDARAW_BEAMS_PING;i++)
-						status = xdr_int(xdrs, &data->spfb[i]);
-
-				/* set sidescan data */
-				if (status == MB_SUCCESS)
-					status = xdr_double(xdrs, &data->ss_range);
-				if (status == MB_SUCCESS)
-					for (i=0;i<MBF_HSMDARAW_PIXELS_PING;i++)
-						status = xdr_char(xdrs, (char *)&data->ss[i]);
-
-				/* set attitude data */
-				if (status == MB_SUCCESS)
-					status = xdr_double(xdrs, &data->heading_tx);
-				if (status == MB_SUCCESS)
-					for (i=0;i<5;i++)
-						status = xdr_double(xdrs, &data->heading_rx[i]);
-				if (status == MB_SUCCESS)
-					status = xdr_double(xdrs, &data->roll_tx);
-				if (status == MB_SUCCESS)
-					for (i=0;i<5;i++)
-						status = xdr_double(xdrs, &data->roll_rx[i]);
-				if (status == MB_SUCCESS)
-					status = xdr_double(xdrs, &data->pitch_tx);
-				if (status == MB_SUCCESS)
-					for (i=0;i<5;i++)
-						status = xdr_double(xdrs, &data->pitch_rx[i]);
-
-				/* check status */
-				if (status == MB_SUCCESS)
-	      				*error = MB_ERROR_NO_ERROR;
-				else
-	      				*error = MB_ERROR_WRITE_FAIL;
-	     			break;
-	    			}
-
-	  		case (MBF_HSMDARAW_NAV): /* 2, Navigation data record */
-	    			{
-				/* set nav data */
-				if (status == MB_SUCCESS)
-					status = xdr_int(xdrs, &data->navid);
-				if (status == MB_SUCCESS)
-					mb_unfix_y2k(verbose, data->year, &data->year);
-				if (status == MB_SUCCESS)
-					status = xdr_int(xdrs,&data->year);
-				if (status == MB_SUCCESS)
-					status = xdr_int(xdrs,&data->month);
-				if (status == MB_SUCCESS)
-					status = xdr_int(xdrs,&data->day);
-				if (status == MB_SUCCESS)
-					status = xdr_int(xdrs,&data->hour);
-				if (status == MB_SUCCESS)
-					status = xdr_int(xdrs,&data->minute);
-				if (status == MB_SUCCESS)
-					status = xdr_double(xdrs,&data->secf);
-
-				/* set position */
-				if (status == MB_SUCCESS)
-					status = xdr_double(xdrs, &data->lat);
-				if (status == MB_SUCCESS)
-					status = xdr_double(xdrs, &data->lon);
-				if (status == MB_SUCCESS)
-					status = xdr_char(xdrs, &data->pos_sens[0]);
-				if (status == MB_SUCCESS)
-					status = xdr_char(xdrs, &data->pos_sens[1]);
-
-				/* check status */
-				if (status == MB_SUCCESS)
-	      				*error = MB_ERROR_NO_ERROR;
-				else
-	      				*error = MB_ERROR_WRITE_FAIL;
-	     			break;
-	    			}
-
-			case (MBF_HSMDARAW_MDE):		/* 3, MD Event */
-	    			{
-				if (status == MB_SUCCESS)
-					status = xdr_int(xdrs, &data->evid);
-				if (status == MB_SUCCESS)
-					for (i=0;i<84;i++)
-						status = xdr_char(xdrs, &data->evtext[i]);
-
-				/* check status */
-				if (status == MB_SUCCESS)
-	      				*error = MB_ERROR_NO_ERROR;
-				else
-	      				*error = MB_ERROR_WRITE_FAIL;
-	     			break;
-	    			}
-
-			case (MBF_HSMDARAW_ANG): /* Transid == 4, Beam Angles */
-	    			{
-				if (status == MB_SUCCESS)
-					status = xdr_int(xdrs, &data->noho);
-				if (status == MB_SUCCESS && status == MB_SUCCESS)
-					for (i=0;i<MBF_HSMDARAW_BEAMS_PING;i++)
-						status = xdr_double(xdrs, &data->angle[i]);
-
-				/* check status */
-				if (status == MB_SUCCESS)
-	      				*error = MB_ERROR_NO_ERROR;
-				else
-	      				*error = MB_ERROR_WRITE_FAIL;
-	     			break;
-	    			}
-
-			case (MBF_HSMDARAW_SVP): /* 5, Sound Velocity Profile */
-	    			{
-
-				data->num_vel = 20;
-				for (i=0;i<data->num_vel;i++)
-					{
-					status = xdr_double(xdrs, &data->vdepth[i]);
-					status = xdr_double(xdrs, &data->velocity[i]);
-					}
-
-				/* check status */
-				if (status == MB_SUCCESS)
-	      				*error = MB_ERROR_NO_ERROR;
-				else
-	      				*error = MB_ERROR_WRITE_FAIL;
-	     			break;
-	    			}
-
-			case (MBF_HSMDARAW_REV):	/* 6, An Interrupt event? */
-	    			{
-				if (status == MB_SUCCESS)
-					status = xdr_double(xdrs, &data->datuhr);
-				if (status == MB_SUCCESS)
-					for (i=0;i<8;i++)
-						status = xdr_char(xdrs, &data->mksysint[i]);
-				if (status == MB_SUCCESS)
-					for (i=0;i<84;i++)
-						status = xdr_char(xdrs, &data->mktext[i]);
-
-				/* Check status. */
-				if (status == MB_SUCCESS)
-		  			*error = MB_ERROR_NO_ERROR;
-				else
-					*error = MB_ERROR_WRITE_FAIL;
-				break;
-	    			}
-
-			case (MBF_HSMDARAW_COM):	/* 7, Comment */
-	    			{
-				if (status == MB_SUCCESS)
-					for (i=0;i<MBF_HSMDARAW_COMMENT;i++)
-						status = xdr_char(xdrs, &data->comment[i]);
-
-				/* Check status. */
-				if (status == MB_SUCCESS)
-		  			*error = MB_ERROR_NO_ERROR;
-				else
-					*error = MB_ERROR_WRITE_FAIL;
-				break;
-	    			}
-
-	  		default:
-	    			{
-				/* Should never get here, so fail! */
-				status = MB_FAILURE;
-	      			*error = MB_ERROR_UNINTELLIGIBLE;
-				break;
-	    			}
-	  		}
-      		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mbr_hsmdldih.c b/src/mbio/mbr_hsmdldih.c
deleted file mode 100644
index ff810f6..0000000
--- a/src/mbio/mbr_hsmdldih.c
+++ /dev/null
@@ -1,2177 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbr_hsmdldih.c	9/26/95
- *	$Header: /system/link/server/cvs/root/mbsystem/src/mbio/mbr_hsmdldih.c,v 5.10 2005/11/05 00:48:04 caress Exp $
- *
- *    Copyright (c) 1995-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbr_hsmdldih.c contains the functions for reading and writing
- * multibeam data in the HSMDLDIH format.
- * These functions include:
- *   mbr_alm_hsmdldih	- allocate read/write memory
- *   mbr_dem_hsmdldih	- deallocate read/write memory
- *   mbr_rt_hsmdldih	- read and translate data
- *   mbr_wt_hsmdldih	- translate and write data
- *
- * Author:	David W. Caress
- * Date:	September 26, 1995
- *
- * $Log: mbr_hsmdldih.c,v $
- * Revision 5.10  2005/11/05 00:48:04  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.9  2003/05/20 18:05:32  caress
- * Added svp_source to data source parameters.
- *
- * Revision 5.8  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.7  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.6  2002/07/20 20:42:40  caress
- * Release 5.0.beta20
- *
- * Revision 5.5  2001/08/10 22:41:19  dcaress
- * Release 5.0.beta07
- *
- * Revision 5.4  2001-07-19 17:32:54-07  caress
- * Release 5.0.beta03
- *
- * Revision 5.3  2001/06/08  21:44:01  caress
- * Version 5.0.beta01
- *
- * Revision 5.2  2001/03/22  20:50:02  caress
- * Trying to make version 5.0.beta0
- *
- * Revision 5.1  2001/01/22  07:43:34  caress
- * Version 5.0.beta01
- *
- * Revision 5.0  2000/12/01  22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.11  2000/10/11  01:03:21  caress
- * Convert to ANSI C
- *
- * Revision 4.10  2000/09/30  06:34:20  caress
- * Snapshot for Dale.
- *
- * Revision 4.9  1999/09/14  20:39:11  caress
- * Fixed bugs handling HSMD
- *
- * Revision 4.8  1999/03/31  18:11:35  caress
- * MB-System 4.6beta7
- *
- * Revision 4.7  1998/10/05  17:46:15  caress
- * MB-System version 4.6beta
- *
- * Revision 4.6  1997/07/25  14:19:53  caress
- * Version 4.5beta2.
- * Much mucking, particularly with Simrad formats.
- *
- * Revision 4.5  1997/04/21  17:02:07  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.4  1996/07/16  22:07:12  caress
- * Fixed port/starboard mixup and made null angles for raytracing 40 degrees to
- * reflect 40 degree tranducer array mounting.
- *
- * Revision 4.4  1996/07/16  22:07:12  caress
- * Fixed port/starboard mixup and made null angles for raytracing 40 degrees to
- * reflect 40 degree tranducer array mounting.
- *
- * Revision 4.3  1996/04/22  13:21:19  caress
- * Now have DTR and MIN/MAX defines in mb_define.h
- *
- * Revision 4.2  1996/04/22  10:57:09  caress
- * DTR define now in mb_io.h
- *
- * Revision 4.1  1996/01/26  21:23:30  caress
- * Version 4.3 distribution
- *
- * Revision 4.0  1995/09/28  18:14:11  caress
- * First cut.
- *
- * Revision 1.1  1995/09/28  18:10:48  caress
- * Initial revision
- *
- *
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_define.h"
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mbsys_hsmd.h"
-#include "mbf_hsmdldih.h"
-
-/* essential function prototypes */
-int mbr_register_hsmdldih(int verbose, void *mbio_ptr,
-		int *error);
-int mbr_info_hsmdldih(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_alm_hsmdldih(int verbose, void *mbio_ptr, int *error);
-int mbr_dem_hsmdldih(int verbose, void *mbio_ptr, int *error);
-int mbr_zero_hsmdldih(int verbose, char *data_ptr, int *error);
-int mbr_rt_hsmdldih(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_wt_hsmdldih(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_hsmdldih_rd_data(int verbose, void *mbio_ptr, int *error);
-int mbr_hsmdldih_wr_data(int verbose, void *mbio_ptr, char *data_ptr, int *error);
-
-static char rcs_id[]="$Id: mbr_hsmdldih.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mbr_register_hsmdldih(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_register_hsmdldih";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* get mb_io_ptr */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set format info parameters */
-	status = mbr_info_hsmdldih(verbose,
-			&mb_io_ptr->system,
-			&mb_io_ptr->beams_bath_max,
-			&mb_io_ptr->beams_amp_max,
-			&mb_io_ptr->pixels_ss_max,
-			mb_io_ptr->format_name,
-			mb_io_ptr->system_name,
-			mb_io_ptr->format_description,
-			&mb_io_ptr->numfile,
-			&mb_io_ptr->filetype,
-			&mb_io_ptr->variable_beams,
-			&mb_io_ptr->traveltime,
-			&mb_io_ptr->beam_flagging,
-			&mb_io_ptr->nav_source,
-			&mb_io_ptr->heading_source,
-			&mb_io_ptr->vru_source,
-			&mb_io_ptr->svp_source,
-			&mb_io_ptr->beamwidth_xtrack,
-			&mb_io_ptr->beamwidth_ltrack,
-			error);
-
-	/* set format and system specific function pointers */
-	mb_io_ptr->mb_io_format_alloc = &mbr_alm_hsmdldih;
-	mb_io_ptr->mb_io_format_free = &mbr_dem_hsmdldih;
-	mb_io_ptr->mb_io_store_alloc = &mbsys_hsmd_alloc;
-	mb_io_ptr->mb_io_store_free = &mbsys_hsmd_deall;
-	mb_io_ptr->mb_io_read_ping = &mbr_rt_hsmdldih;
-	mb_io_ptr->mb_io_write_ping = &mbr_wt_hsmdldih;
-	mb_io_ptr->mb_io_dimensions = &mbsys_hsmd_dimensions;
-	mb_io_ptr->mb_io_extract = &mbsys_hsmd_extract;
-	mb_io_ptr->mb_io_insert = &mbsys_hsmd_insert;
-	mb_io_ptr->mb_io_extract_nav = &mbsys_hsmd_extract_nav;
-	mb_io_ptr->mb_io_insert_nav = &mbsys_hsmd_insert_nav;
-	mb_io_ptr->mb_io_extract_altitude = &mbsys_hsmd_extract_altitude;
-	mb_io_ptr->mb_io_insert_altitude = NULL;
-	mb_io_ptr->mb_io_extract_svp = NULL;
-	mb_io_ptr->mb_io_insert_svp = NULL;
-	mb_io_ptr->mb_io_ttimes = &mbsys_hsmd_ttimes;
-	mb_io_ptr->mb_io_detects = &mbsys_hsmd_detects;
-	mb_io_ptr->mb_io_copyrecord = &mbsys_hsmd_copy;
-	mb_io_ptr->mb_io_extract_rawss = NULL;
-	mb_io_ptr->mb_io_insert_rawss = NULL;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",mb_io_ptr->system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",mb_io_ptr->beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",mb_io_ptr->beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",mb_io_ptr->pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",mb_io_ptr->format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",mb_io_ptr->system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",mb_io_ptr->format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",mb_io_ptr->numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",mb_io_ptr->filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",mb_io_ptr->variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",mb_io_ptr->traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",mb_io_ptr->beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",mb_io_ptr->nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",mb_io_ptr->heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",mb_io_ptr->vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",mb_io_ptr->svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",mb_io_ptr->beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",mb_io_ptr->beamwidth_ltrack);
-		fprintf(stderr,"dbg2       format_alloc:       %p\n",(void *)mb_io_ptr->mb_io_format_alloc);
-		fprintf(stderr,"dbg2       format_free:        %p\n",(void *)mb_io_ptr->mb_io_format_free);
-		fprintf(stderr,"dbg2       store_alloc:        %p\n",(void *)mb_io_ptr->mb_io_store_alloc);
-		fprintf(stderr,"dbg2       store_free:         %p\n",(void *)mb_io_ptr->mb_io_store_free);
-		fprintf(stderr,"dbg2       read_ping:          %p\n",(void *)mb_io_ptr->mb_io_read_ping);
-		fprintf(stderr,"dbg2       write_ping:         %p\n",(void *)mb_io_ptr->mb_io_write_ping);
-		fprintf(stderr,"dbg2       extract:            %p\n",(void *)mb_io_ptr->mb_io_extract);
-		fprintf(stderr,"dbg2       insert:             %p\n",(void *)mb_io_ptr->mb_io_insert);
-		fprintf(stderr,"dbg2       extract_nav:        %p\n",(void *)mb_io_ptr->mb_io_extract_nav);
-		fprintf(stderr,"dbg2       insert_nav:         %p\n",(void *)mb_io_ptr->mb_io_insert_nav);
-		fprintf(stderr,"dbg2       extract_altitude:   %p\n",(void *)mb_io_ptr->mb_io_extract_altitude);
-		fprintf(stderr,"dbg2       insert_altitude:    %p\n",(void *)mb_io_ptr->mb_io_insert_altitude);
-		fprintf(stderr,"dbg2       extract_svp:        %p\n",(void *)mb_io_ptr->mb_io_extract_svp);
-		fprintf(stderr,"dbg2       insert_svp:         %p\n",(void *)mb_io_ptr->mb_io_insert_svp);
-		fprintf(stderr,"dbg2       ttimes:             %p\n",(void *)mb_io_ptr->mb_io_ttimes);
-		fprintf(stderr,"dbg2       detects:            %p\n",(void *)mb_io_ptr->mb_io_detects);
-		fprintf(stderr,"dbg2       extract_rawss:      %p\n",(void *)mb_io_ptr->mb_io_extract_rawss);
-		fprintf(stderr,"dbg2       insert_rawss:       %p\n",(void *)mb_io_ptr->mb_io_insert_rawss);
-		fprintf(stderr,"dbg2       copyrecord:         %p\n",(void *)mb_io_ptr->mb_io_copyrecord);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbr_info_hsmdldih(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error)
-{
-	char	*function_name = "mbr_info_hsmdldih";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* set format info parameters */
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-	*system = MB_SYS_HSMD;
-	*beams_bath_max = 79;
-	*beams_amp_max = 0;
-	*pixels_ss_max = 319;
-	strncpy(format_name, "HSMDLDIH", MB_NAME_LENGTH);
-	strncpy(system_name, "HSMD", MB_NAME_LENGTH);
-	strncpy(format_description, "Format name:          MBF_HSMDLDIH\nInformal Description: Atlas HSMD medium depth multibeam processed format\nAttributes:           40 beam bathymetry, 160 pixel sidescan,\n                      XDR (binary), L-DEO.\n", MB_DESCRIPTION_LENGTH);
-	*numfile = 1;
-	*filetype = MB_FILETYPE_XDR;
-	*variable_beams = MB_NO;
-	*traveltime = MB_YES;
-	*beam_flagging = MB_YES;
-	*nav_source = MB_DATA_NAV;
-	*heading_source = MB_DATA_DATA;
-	*vru_source = MB_DATA_DATA;
-	*svp_source = MB_DATA_NONE;
-	*beamwidth_xtrack = 1.7;
-	*beamwidth_ltrack = 1.7;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",*system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",*beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",*beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",*pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",*numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",*filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",*variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",*traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",*beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",*nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",*heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",*vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",*svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",*beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",*beamwidth_ltrack);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_alm_hsmdldih(int verbose, void *mbio_ptr, int *error)
-{
-	char	 *function_name = "mbr_alm_hsmdldih";
-	int	 status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_hsmdldih_struct *data;
-	char	 *data_ptr;
-	double *FirstReftime;	/* time from the first header */
-	int  *Header_count; /* number of header records encounterd */
-	int  *Rev_count;	   /* Raw Event counter */
-	int  *Nav_count;	   /* number of Nav records */
-	int  *Angle_count;  /* etc....... */
-	int  *Svp_count;
-	int  *Raw_count;
-	int  *MDevent_count;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set initial status */
-	status = MB_SUCCESS;
-
-	/* allocate memory for data structure */
-	mb_io_ptr->structure_size = sizeof(struct mbf_hsmdldih_struct);
-	mb_io_ptr->data_structure_size = 0;
-	status = mb_malloc(verbose,mb_io_ptr->structure_size,
-		     &mb_io_ptr->raw_data,error);
-	status = mb_malloc(verbose,sizeof(struct mbsys_hsmd_struct),
-		     &mb_io_ptr->store_data,error);
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-	data = (struct mbf_hsmdldih_struct *) mb_io_ptr->raw_data;
-	data_ptr = (char *) data;
-
-	/* initialize saved values */
-	FirstReftime = &mb_io_ptr->saved1;	/* time from the first header */
-	Header_count = &mb_io_ptr->save1; /* number of header records encounterd */
-	Rev_count = &mb_io_ptr->save2;	   /* Raw Event counter */
-	Nav_count = &mb_io_ptr->save3;	   /* number of Nav records */
-	Angle_count = &mb_io_ptr->save4;  /* etc....... */
-	Svp_count = &mb_io_ptr->save5;
-	Raw_count = &mb_io_ptr->save6;
-	MDevent_count = &mb_io_ptr->save7;
-	*FirstReftime = 0.0;	/* time from the first header */
-	*Header_count = 0; /* number of header records encounterd */
-	*Rev_count = 0;	   /* Raw Event counter */
-	*Nav_count = 0;	   /* number of Nav records */
-	*Angle_count = 0;  /* etc....... */
-	*Svp_count = 0;
-	*Raw_count = 0;
-	*MDevent_count = 0;
-
-	/* initialize everything to zeros */
-	mbr_zero_hsmdldih(verbose,data_ptr,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_dem_hsmdldih(int verbose, void *mbio_ptr, int *error)
-{
-	char    *function_name = "mbr_dem_hsmdldih";
-	int	  status = MB_SUCCESS;
-	struct  mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* deallocate memory for data descriptor */
-	status = mb_free(verbose,&mb_io_ptr->raw_data,error);
-	status = mb_free(verbose,&mb_io_ptr->store_data,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_zero_hsmdldih(int verbose, char *data_ptr, int *error)
-{
-	char	 *function_name = "mbr_zero_hsmdldih";
-	int	 status = MB_SUCCESS;
-	struct mbf_hsmdldih_struct *data;
-	int	 i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       data_ptr:   %p\n",(void *)data_ptr);
-		}
-
-
-	/* get pointer to data descriptor */
-	data = (struct mbf_hsmdldih_struct *) data_ptr;
-
-	/* initialize everything to zeros */
-	if (data != NULL)
-		{
-		for (i=0;i<4;i++)
-			{
-			data->scsid[i]= 0;
-			data->scsart[i]= 0;
-			}
-		data->scslng = 0;
-		data->scsext = 0;
-		data->scsblcnt = 0;
-		data->scsres1 = 0.0;
-		data->transid = 0;	/* indicates what kind of data */
-		data->reftime = -1.0;	/* unitialized */
-
-		data->datuhr = -1.0;
-
-		for (i=0;i<8;i++)
-			data->mksysint[i]=0;
-
-		for (i=0;i<84;i++)
-			data->mktext[i]=0;
-
-		data->navid = 0;
-		data->year = 0;
-		data->month = 0;
-		data->day = 0;
-		data->hour = 0;
-		data->minute = 0;
-		data->second = 0;
-		data->millisecond = 0.0;
-
-		data->lon = 0.0;
-		data->lat = 0.0;
-
-
-		data->ckeel = 0.0;
-		data->cmean = 0.0;
-		data->Port = 0;
-		data->noho = 0;
-		data->skals = 0;
-
-		for (i=0;i<MBF_HSMDLDIH_BEAMS_PING;i++)
-			{
-			data->spfb[i] = 0;
-			data->angle[i] = mbf_hsmdldih_beamangle[i];
-			data->depth[i] = 0.0;
-			data->distance[i] = 0.0;
-			}
-
-		data->ss_range = 0.0;
-		for (i=0;i<MBF_HSMDLDIH_PIXELS_PING;i++)
-			data->ss[i] = 0;
-
-		data->heading_tx = 0.0;
-		for (i=0;i<5;i++)
-			data->heading_rx[i] = 0.0;
-
-		data->roll_tx = 0.0;
-		for (i=0;i<5;i++)
-			data->roll_rx[i] = 0.0;
-
-		data->pitch_tx = 0.0;
-		for (i=0;i<5;i++)
-			data->pitch_rx[i] = 0.0;
-
-		data->num_vel = 0;
-		for (i=0;i<MBF_HSMDLDIH_MAXVEL;i++)
-			{
-			data->vdepth[i] = 0.0;
-			data->velocity[i] = 0.0;
-			}
-
-		}
-
-	/* assume success */
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_rt_hsmdldih(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	 *function_name = "mbr_rt_hsmdldih";
-	int	 status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_hsmdldih_struct *data;
-	struct mbsys_hsmd_struct *store;
-	int	time_i[7];
-	double	time_d;
-	double	lon, lat, heading, speed;
-	int	 i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointers to mbio descriptor and data structures */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-	data = (struct mbf_hsmdldih_struct *) mb_io_ptr->raw_data;
-	store = (struct mbsys_hsmd_struct *) store_ptr;
-
-	/* read next (record of) data from file */
-	status = mbr_hsmdldih_rd_data(verbose,mbio_ptr,error);
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"dbg5: In function name:\t%s\n", function_name);
-		fprintf(stderr,"dbg5:\t Returned from  mbr_hsmdldih_rd_data()\n");
-		fprintf(stderr,"dbg5:\t Status:\t%d\n", status);
-		fprintf(stderr,"dbg5:\t data->kind:\t%d\n", data->kind);
-		fprintf(stderr,"dbg5:\t store_ptr: \t%p\n",(void *)store_ptr);
-		}
-
-	/* set error and kind in mb_io_ptr */
-	mb_io_ptr->new_error = *error;
-	mb_io_ptr->new_kind = data->kind;
-
-	/* add nav records to list for interpolation */
-	if (status == MB_SUCCESS
-		&& data->kind == MB_DATA_NAV)
-		{
-		time_i[0] = data->year;
-		time_i[1] = data->month;
-		time_i[2] = data->day;
-		time_i[3] = data->hour;
-		time_i[4] = data->minute;
-		time_i[5] = data->second;
-		time_i[6] = 1000 * data->millisecond;
-		mb_get_time(verbose, time_i, &time_d);
-		lon = data->lon;
-		lat = data->lat;
-		mb_navint_add(verbose, mbio_ptr, time_d, lon, lat, error);
-		}
-
-	/* interpolate navigation for survey pings if needed */
-	if (status == MB_SUCCESS
-		&& data->kind == MB_DATA_DATA
-		&& data->lon == 0.0
-		&& data->lat == 0.0
-		&& mb_io_ptr->nfix >= 1)
-		{
-		time_i[0] = data->year;
-		time_i[1] = data->month;
-		time_i[2] = data->day;
-		time_i[3] = data->hour;
-		time_i[4] = data->minute;
-		time_i[5] = data->second;
-		time_i[6] = 1000 * data->millisecond;
-		mb_get_time(verbose, time_i, &time_d);
-		heading = data->heading_tx;
-		mb_navint_interp(verbose, mbio_ptr, time_d, heading, 0.0,
-				    &lon, &lat, &speed, error);
-		data->lon = lon;
-		data->lat = lat;
-		data->speed = speed;
-		}
-
-	/* translate values to data storage structure */
-	if (status == MB_SUCCESS
-		&& store != NULL)
-    		{
-		/* type of data record */
-		store->kind = data->kind;
-
-		/* header values */
-		for (i=0;i<4;i++)
-			{
-			store->scsid[i] = data->scsid[i];
-			store->scsart[i] = data->scsart[i];
-			}
-		store->scslng = data->scslng;
-		store->scsext = data->scsext;
-		store->scsblcnt = data->scsblcnt;
-		store->scsres1 = data->scsres1;
-		store->transid = data->transid;
-		store->reftime = data->reftime;
-
-		/* event data */
-		store->datuhr = data->datuhr;
-		for (i=0;i<8;i++)
-			store->mksysint[i] = data->mksysint[i];
-		for (i=0;i<84;i++)
-			store->mktext[i] = data->mktext[i];
-
-		/* navigation data */
-		store->navid = data->navid;
-		store->year = data->year;
-		store->month = data->month;
-		store->day = data->day;
-		store->hour = data->hour;
-		store->minute = data->minute;
-		store->second = data->second;
-		store->secf = data->secf;
-		store->millisecond = data->millisecond;
-		store->PingTime = data->PingTime;
-		store->lon = data->lon;
-		store->lat = data->lat;
-		store->pos_sens[0] = data->pos_sens[0];
-		store->pos_sens[1] = data->pos_sens[1];
-
-		/* travel time, bathymetry and sidescan data */
-		store->ckeel = data->ckeel;
-		store->cmean = data->cmean;
-		store->Port = data->Port;
-		store->noho = data->noho;
-		store->skals = data->skals;
-		for (i=0;i<MBF_HSMDLDIH_BEAMS_PING;i++)
-			{
-	  		store->spfb[i] = data->spfb[i];
-	 		store->depth[i] = data->depth[i];
-	  		store->distance[i] = data->distance[i];
-	  		store->angle[i] = data->angle[i];
-			}
-		store->ss_range = data->ss_range;
-		for (i=0;i<MBF_HSMDLDIH_PIXELS_PING;i++)
-			{
-			store->ss[i] = data->ss[i];
-			}
-		store->heading_tx = data->heading_tx;
-		store->roll_tx = data->roll_tx;
-		store->pitch_tx = data->pitch_tx;
-		for (i=0;i<5;i++)
-			{
-			store->heading_rx[i] = data->heading_rx[i];
-			store->pitch_rx[i] = data->pitch_rx[i];
-			store->roll_rx[i] = data->roll_rx[i];
-			}
-
-		/* MD event data */
-		store->evid = data->evid;
-		for (i=0;i<84;i++)
-			store->evtext[i] = data->evtext[i];
-
-		store->num_vel = data->num_vel;
-		if (store->num_vel > MBF_HSMDLDIH_MAXVEL)
-		    store->num_vel = 0;
-		for (i=0;i<store->num_vel;i++)
-			{
-			store->vdepth[i] = data->vdepth[i];
-			store->velocity[i] = data->velocity[i];
-			}
-
-		/* comment */
-		strncpy(store->comment,data->comment,MBSYS_HSMD_COMMENT);
-		store->heave = data->heave;
-		store->speed = data->speed;
-    		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_wt_hsmdldih(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_wt_hsmdldih";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_hsmdldih_struct *data;
-	char	*data_ptr;
-	struct mbsys_hsmd_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_hsmdldih_struct *) mb_io_ptr->raw_data;
-	data_ptr = (char *) data;
-	store = (struct mbsys_hsmd_struct *) store_ptr;
-
-	/* first translate values from data storage structure */
-	if (store != NULL)
-    		{
-		/* type of data record */
-		data->kind = store->kind;
-
-		/* header values */
-		for (i=0;i<4;i++)
-			{
-			data->scsid[i] = store->scsid[i];
-			data->scsart[i] = store->scsart[i];
-			}
-		data->scslng = store->scslng;
-		data->scsext = store->scsext;
-		data->scsblcnt = store->scsblcnt;
-		data->scsres1 = store->scsres1;
-		data->transid = store->transid;
-		data->reftime = store->reftime;
-
-		/* event data */
-		data->datuhr = store->datuhr;
-		for (i=0;i<8;i++)
-			data->mksysint[i] = store->mksysint[i];
-		for (i=0;i<84;i++)
-			data->mktext[i] = store->mktext[i];
-
-		/* navigation data */
-		data->navid = store->navid;
-		data->year = store->year;
-		data->month = store->month;
-		data->day = store->day;
-		data->hour = store->hour;
-		data->minute = store->minute;
-		data->second = store->second;
-		data->secf = store->secf;
-		data->millisecond = store->millisecond;
-		data->PingTime = store->PingTime;
-		data->lon = store->lon;
-		data->lat = store->lat;
-		data->pos_sens[0] = store->pos_sens[0];
-		data->pos_sens[1] = store->pos_sens[1];
-
-		/* travel time, bathymetry and sidescan data */
-		data->ckeel = store->ckeel;
-		data->cmean = store->cmean;
-		data->Port = store->Port;
-		data->noho = store->noho;
-		data->skals = store->skals;
-		for (i=0;i<MBF_HSMDLDIH_BEAMS_PING;i++)
-			{
-	  		data->spfb[i] = store->spfb[i];
-	 		data->depth[i] = store->depth[i];
-	  		data->distance[i] = store->distance[i];
-	  		data->angle[i] = store->angle[i];
-			}
-		data->ss_range = store->ss_range;
-		for (i=0;i<MBF_HSMDLDIH_PIXELS_PING;i++)
-			{
-			data->ss[i] = store->ss[i];
-			}
-		data->heading_tx = store->heading_tx;
-		data->roll_tx = store->roll_tx;
-		data->pitch_tx = store->pitch_tx;
-		for (i=0;i<5;i++)
-			{
-			data->heading_rx[i] = store->heading_rx[i];
-			data->pitch_rx[i] = store->pitch_rx[i];
-			data->roll_rx[i] = store->roll_rx[i];
-			}
-
-		/* MD event data */
-		data->evid = store->evid;
-		for (i=0;i<84;i++)
-			data->evtext[i] = store->evtext[i];
-
-		data->num_vel = store->num_vel;
-		if (data->num_vel > MBF_HSMDLDIH_MAXVEL)
-		    data->num_vel = 0;
-		for (i=0;i<data->num_vel;i++)
-			{
-			data->vdepth[i] = store->vdepth[i];
-			data->velocity[i] = store->velocity[i];
-			}
-
-		/* comment */
-		strncpy(data->comment,store->comment,MBSYS_HSMD_COMMENT);
-		data->heave = store->heave;
-		data->speed = store->speed;
-    		}
-
-	/* write next data to file */
-	status = mbr_hsmdldih_wr_data(verbose,mbio_ptr,data_ptr,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_hsmdldih_rd_data(int verbose, void *mbio_ptr, int *error)
-{
-	char    *function_name = "mbr_hsmdldih_rd_data";
-	int     status = MB_SUCCESS;
-	struct  mb_io_struct *mb_io_ptr;
-	struct  mbf_hsmdldih_struct *data;
-	char    *data_ptr;
-	FILE    *mbfp;
-	XDR	*xdrs;		/* xdr i/o pointer */
-	int     i;
-	int     time_i[7];
-	double	scale;
-	double	PingTime;	/* Synthesised time of this ping
-				 		PingTime = Base_time
-				 		+ (current.datuhr
-						- FirstReftime) */
-
-	double *FirstReftime;	/* time from the first header */
-	int  *Header_count; /* number of header records encounterd */
-	int  *Rev_count;	   /* Raw Event counter */
-	int  *Nav_count;	   /* number of Nav records */
-	int  *Angle_count;  /* etc....... */
-	int  *Svp_count;
-	int  *Raw_count;
-	int  *MDevent_count;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_hsmdldih_struct *) mb_io_ptr->raw_data;
-	data_ptr = (char *) data;	/* The data structure pointer */
-	mbfp = mb_io_ptr->mbfp;		/* The file pointer */
-	xdrs = mb_io_ptr->xdrs;
-	FirstReftime = &mb_io_ptr->saved1;	/* time from the first header */
-	Header_count = &mb_io_ptr->save1; /* number of header records encounterd */
-	Rev_count = &mb_io_ptr->save2;	   /* Raw Event counter */
-	Nav_count = &mb_io_ptr->save3;	   /* number of Nav records */
-	Angle_count = &mb_io_ptr->save4;  /* etc....... */
-	Svp_count = &mb_io_ptr->save5;
-	Raw_count = &mb_io_ptr->save6;
-	MDevent_count = &mb_io_ptr->save7;
-
-	/* set file position */
-	mb_io_ptr->file_pos = mb_io_ptr->file_bytes;
-
-	/* Start reading an HSMD Header structure */
-	/* read the first four bytes */
-	for (i=0;i<4;i++)
-		status = xdr_char(xdrs, &data->scsid[i]);
-
-	/* loop until the beginning of a record is found */
-	while (status == MB_SUCCESS
-		&& strncmp(data->scsid, "DXT", 3) != 0)
-		{
-		if (data->scsid[1] == 'D'
-		    || data->scsid[2] == 'D'
-		    || data->scsid[3] == 'D')
-		    {
-		    for (i=0;i<3;i++)
-			    data->scsid[i] = data->scsid[i+1];
-		    status = xdr_char(xdrs, &data->scsid[3]);
-		    }
-		else
-		    {
-		    while (status == MB_SUCCESS
-			&& data->scsid[0] != 'D')
-			{
-			if ((status = fread(&data->scsid[0],
-				1,1,mb_io_ptr->mbfp)) != 1)
-				{
-				status = MB_FAILURE;
-				*error = MB_ERROR_EOF;
-				}
-			}
-		    if (status == MB_SUCCESS)
-			{
-			for (i=1;i<4;i++)
-			    status = xdr_char(xdrs, &data->scsid[i]);
-			}
-		    }
-		}
-
-	/* now read the rest of the record */
-	if (status == MB_SUCCESS)
-		for (i=0;i<4;i++)
-			status = xdr_char(xdrs, &data->scsart[i]);
-	if (status == MB_SUCCESS)
-		status = xdr_int(xdrs, &data->scslng);
-	if (status == MB_SUCCESS)
-		status = xdr_int(xdrs, &data->scsext);
-	if (status == MB_SUCCESS)
-		status = xdr_int(xdrs, &data->scsblcnt);
-	if (status == MB_SUCCESS)
-		status = xdr_double(xdrs, &data->scsres1);
-	if (status == MB_SUCCESS)
-		status = xdr_int(xdrs, &data->transid);
-
-	/* get first time and initialize the time base */
-	if (status == MB_SUCCESS)
-		status = xdr_double(xdrs, &data->reftime);
-	if (status == MB_SUCCESS
-		&& data->transid != MBF_HSMDLDIH_COM)
-		{
-		(*Header_count)++;
-		if (*Header_count == 1)
-			*FirstReftime = data->reftime;
-		}
-
-	/* check status */
-	if (status == MB_SUCCESS)
-	      	*error = MB_ERROR_NO_ERROR;
-	else
-	      	*error = MB_ERROR_EOF;
-
-	/* print out some debug messages */
-	if (verbose >= 2 && status == MB_SUCCESS)
-		{
-		fprintf(stderr,"\ndbg2: ========================== \n");
-		fprintf(stderr,"dbg2: HED (0) # %d\t%.3lf\t%.3lf \n",
-				*Header_count,data->reftime, data->reftime-*FirstReftime);
-		}
-	if (verbose >= 5 && status == MB_SUCCESS)
-		{
-		fprintf(stderr,"dbg5: data  From Header:\n");
-		fprintf(stderr,"dbg5: \t->scsid : \t%s\n",data->scsid);
-		fprintf(stderr,"dbg5: \t->scsart: \t%s\n",data->scsart);
-		fprintf(stderr,"dbg5: \t->scslng: \t%d\t0x%0X\n",
-		  		data->scslng,data->scslng);
-		fprintf(stderr,"dbg5: \t->scsext:  \t%d\n",
-				data->scsext);
-		fprintf(stderr,"dbg5: \t->scsblcnt:\t%d\n",
-				data->scsblcnt);
-		fprintf(stderr,"dbg5: \t->scsres1: \t%lf\n",
-				data->scsres1);
-		fprintf(stderr,"dgb5: \t->transid: \t%d\n",
-				data->transid);
-		fprintf(stderr,"dgb5: \t->reftime: \t%lf\n",
-				data->reftime);
-		}
-
-     	/* done reading the header part of this data record
-		- now read the rest*/
-
-	/* read the appropriate data records */
-	if (status == MB_SUCCESS )
-		{
-		switch(data->transid)
-	  		{
-	  		case (MBF_HSMDLDIH_RAW):	/* 1, Raw data record */
-	    			{
-				data->kind = MB_DATA_DATA;
-
-	      			(*Raw_count)++;	/* the number of this kind of record */
-
-				/* get water velocity and travel time data */
-	      			if (status == MB_SUCCESS)
-					status = xdr_double(xdrs, &data->ckeel);
-	      			if (status == MB_SUCCESS)
-					status = xdr_double(xdrs, &data->cmean);
-	      			if (status == MB_SUCCESS)
-					status = xdr_int(xdrs, &data->Port);
-				if (status == MB_SUCCESS)
-					status = xdr_int(xdrs, &data->noho);
-				if (status == MB_SUCCESS)
-					status = xdr_int(xdrs, &data->skals);
-				if (status == MB_SUCCESS)
-					for (i=0;i<MBF_HSMDLDIH_BEAMS_PING;i++)
-						status = xdr_int(xdrs, &data->spfb[i]);
-
-				/* Check for bad beams - broken records produce
-				    bogus data - it happens with HSMD systems!!! */
-				if (data->skals)
-					scale = 0.00015;
-				else
-					scale = 0.000015;
-				if (status == MB_SUCCESS)
-				for (i=0; i<MBF_HSMDLDIH_BEAMS_PING; i++ )
-		    			{
-	 				if (data->spfb[i] < -65535
-					    || data->spfb[i] > 65535)
-					    {
-					    data->spfb[i] = 0;
-					    }
-					}
-
-				/* Calculate bathymetry.
-					The travel times are scaled to
-					seconds, then adjusted for the mean sound
-					speed, then do the simple geometry to
-					calculate depth and cross-track. */
-				if (data->skals)
-					scale = 0.00015;
-				else
-					scale = 0.000015;
-				if (status == MB_SUCCESS)
-				for (i=0; i<MBF_HSMDLDIH_BEAMS_PING; i++ )
-		    			{
-	 				data->depth[i] =
-						(fabs(scale * data->spfb[i])
-						* 0.5 * data->cmean)
-	    					* cos(data->angle[i] * DTR);
-	 				data->distance[i] =
-	    					data->depth[i]
-						* tan(data->angle[i] * DTR );
-	  				if (data->spfb[i] < 0)
-	   					data->depth[i] =
-							-data->depth[i];
-					if (data->Port == -1)
-						data->distance[i] =
-							-data->distance[i];
-					}
-
-				/* get sidescan data */
-				if (status == MB_SUCCESS)
-					status = xdr_double(xdrs, &data->ss_range);
-				if (status == MB_SUCCESS)
-					for (i=0;i<MBF_HSMDLDIH_PIXELS_PING;i++)
-						status = xdr_char(xdrs, (char *)&data->ss[i]);
-
-				/* get attitude data */
-				if (status == MB_SUCCESS)
-					status = xdr_double(xdrs, &data->heading_tx);
-				if (status == MB_SUCCESS)
-					for (i=0;i<5;i++)
-						status = xdr_double(xdrs, &data->heading_rx[i]);
-				if (status == MB_SUCCESS)
-					status = xdr_double(xdrs, &data->roll_tx);
-				if (status == MB_SUCCESS)
-					for (i=0;i<5;i++)
-						status = xdr_double(xdrs, &data->roll_rx[i]);
-				if (status == MB_SUCCESS)
-					status = xdr_double(xdrs, &data->pitch_tx);
-				if (status == MB_SUCCESS)
-					for (i=0;i<5;i++)
-						status = xdr_double(xdrs, &data->pitch_rx[i]);
-
-				/* Establish the time of day for this
-				 * ping. "Raw" (travel time) data records
-				 * do not contain time of day, only the
-				 * internal Reference time. The interrupt
-				 * records contain a unix epoch time used
-				 * to convert to UTC. */
-				if (status == MB_SUCCESS)
-					{
-					PingTime = data->datuhr + (data->reftime
-						- *FirstReftime);
-					status = mb_get_date(verbose,PingTime,time_i);
-
-					data->PingTime 		= PingTime;
-					data->year 		= time_i[0];
-					data->month 		= time_i[1];
-					data->day 		= time_i[2];
-					data->hour 		= time_i[3];
-					data->minute 		= time_i[4];
-					data->second 		= time_i[5];
-					data->millisecond 	= time_i[6] / 1000;
-					}
-
-	      			/* output some debug messages */
-				if (verbose >= 2 && status == MB_SUCCESS)
-					{
-					fprintf(stderr,"\ndgb2: Setting time of Ping in RAW\n:");
-					fprintf(stderr,"dbg2: \t->year:   \t%4d\n",data->year);
-					fprintf(stderr,"dbg2: \t->month:  \t%2d\n",data->month);
-					fprintf(stderr,"dgb2: \t->day:    \t%2d\n",data->day);
-					fprintf(stderr,"dgb2: \t->hour:   \t%2d\n",data->hour);
-					fprintf(stderr,"dbg2: \t->minute: \t%2d\n",data->minute);
-					fprintf(stderr,"dbg2: \t->second: \t%2d\n",data->second);
-					fprintf(stderr,"dbg2: \t->millisecond: \t%3d\n",data->millisecond);
-					fprintf(stderr,"\ndbg2: \t->Lat:   \t%.4lf\n",data->lat);
-					fprintf(stderr,"\ndbg2: \t->Lon:   \t%.4lf\n",data->lon);
-					}
-				if (verbose >= 2 && status == MB_SUCCESS)
-					fprintf(stderr,"\ndbg2: RAW (1) \t%3d\t%4d %2d %2d %2d:%2d:%2d.%3d\n",
-						data->Port, data->year, data->month, data->day,
-						data->hour, data->minute, data->second, data->millisecond);
-				if (verbose >= 2 && status == MB_SUCCESS)
-					{
-					fprintf(stderr,"\ndgb2: Raw\n");
-					fprintf(stderr,"dbg2: \tckeel\t%8.2lf\n", data->ckeel);
-					fprintf(stderr,"dbg2: \tcmean\t%8.2lf\n", data->cmean);
-					fprintf(stderr,"dgb2: \tPort\t%d\n", data->Port);
-					fprintf(stderr,"\tnoho\t%d\n", data->noho);
-					fprintf(stderr,"\tskals\t%d\n", data->skals);
-					fprintf(stderr,"\tspfbs\n");
-					for (i=0;i<MBF_HSMDLDIH_BEAMS_PING;i=i+4)
-		    				{
-						fprintf(stderr,"\t(%02d) %10d (%02d) %10d (%02d) %10d (%02d) %10d\n",
-			      				i,data->spfb[i],
-							i+1,data->spfb[i+1],
-							i+2, data->spfb[i+2],
-							i+3, data->spfb[i+3]);
-		   				}
-					fprintf(stderr,"\tss_range\t%lf\n", data->ss_range);
-					fprintf(stderr,"\tampl\n");
-					for (i=0;i<MBF_HSMDLDIH_PIXELS_PING;i=i+4)
-		    				{
-						fprintf(stderr,"\t%d\t%d\t%d\t%d\n",
-							data->ss[i],
-							data->ss[i+1],
-							data->ss[i+2],
-			      				data->ss[i+3]);
-		    				}
-
-					fprintf(stderr,"\theading_tx\t%8.3lf\n", data->heading_tx);
-					fprintf(stderr,"\theading_rx:\t");
-					fprintf(stderr,"%8.3lf %8.3lf %8.3lf %8.3lf %8.3lf\n",
-						data->heading_rx[0],
-						data->heading_rx[1],
-						data->heading_rx[2],
-						data->heading_rx[3],
-						data->heading_rx[4]);
-
-					fprintf(stderr,"\troll_tx\t%8.3lf\n", data->roll_tx);
-					fprintf(stderr,"\troll_rx:\t");
-					fprintf(stderr,"%8.3lf %8.3lf %8.3lf %8.3lf %8.3lf\n",
-						data->roll_rx[0],
-						data->roll_rx[1],
-						data->roll_rx[2],
-						data->roll_rx[3],
-						data->roll_rx[4]);
-
-					fprintf(stderr,"\tpitch_tx\t%8.3lf\n", data->pitch_tx);
-					fprintf(stderr,"\tpitch_rx:\t");
-					fprintf(stderr,"%8.3lf %8.3lf %8.3lf %8.3lf %8.3lf\n",
-						data->pitch_rx[0],
-						data->pitch_rx[1],
-						data->pitch_rx[2],
-						data->pitch_rx[3],
-						data->pitch_rx[4]);
-
-					}
-
-				/* check status */
-				if (status == MB_SUCCESS)
-					{
-	      				*error = MB_ERROR_NO_ERROR;
-					}
-				else
-	      				*error = MB_ERROR_EOF;
-	     			break;
-	    			}
-
-	  		case (MBF_HSMDLDIH_BAT):	/* 8, LDEO bathy data record */
-	    			{
-				data->kind = MB_DATA_DATA;
-
-	      			(*Raw_count)++;	/* the number of this kind of record */
-
-				/* get time and position */
-	      			if (status == MB_SUCCESS)
-					status = xdr_double(xdrs, &data->PingTime);
-	      			if (status == MB_SUCCESS)
-					status = xdr_double(xdrs, &data->lon);
-	      			if (status == MB_SUCCESS)
-					status = xdr_double(xdrs, &data->lat);
-
-				/* get water velocity and travel time data */
-	      			if (status == MB_SUCCESS)
-					status = xdr_double(xdrs, &data->ckeel);
-	      			if (status == MB_SUCCESS)
-					status = xdr_double(xdrs, &data->cmean);
-	      			if (status == MB_SUCCESS)
-					status = xdr_int(xdrs, &data->Port);
-				if (status == MB_SUCCESS)
-					status = xdr_int(xdrs, &data->noho);
-				if (status == MB_SUCCESS)
-					status = xdr_int(xdrs, &data->skals);
-				if (status == MB_SUCCESS)
-					for (i=0;i<MBF_HSMDLDIH_BEAMS_PING;i++)
-						status = xdr_int(xdrs, &data->spfb[i]);
-				if (status == MB_SUCCESS)
-					for (i=0;i<MBF_HSMDLDIH_BEAMS_PING;i++)
-						status = xdr_double(xdrs, &data->depth[i]);
-				if (status == MB_SUCCESS)
-					for (i=0;i<MBF_HSMDLDIH_BEAMS_PING;i++)
-						status = xdr_double(xdrs, &data->distance[i]);
-
-				/* get sidescan data */
-				if (status == MB_SUCCESS)
-					status = xdr_double(xdrs, &data->ss_range);
-				if (status == MB_SUCCESS)
-					for (i=0;i<MBF_HSMDLDIH_PIXELS_PING;i++)
-						status = xdr_char(xdrs, (char *)&data->ss[i]);
-
-				/* get attitude data */
-				if (status == MB_SUCCESS)
-					status = xdr_double(xdrs, &data->heading_tx);
-				if (status == MB_SUCCESS)
-					for (i=0;i<5;i++)
-						status = xdr_double(xdrs, &data->heading_rx[i]);
-				if (status == MB_SUCCESS)
-					status = xdr_double(xdrs, &data->roll_tx);
-				if (status == MB_SUCCESS)
-					for (i=0;i<5;i++)
-						status = xdr_double(xdrs, &data->roll_rx[i]);
-				if (status == MB_SUCCESS)
-					status = xdr_double(xdrs, &data->pitch_tx);
-				if (status == MB_SUCCESS)
-					for (i=0;i<5;i++)
-						status = xdr_double(xdrs, &data->pitch_rx[i]);
-
-				/* Establish the time of day for this
-				 * ping. "Raw" (travel time) data records
-				 * do not contain time of day, only the
-				 * internal Reference time. The interrupt
-				 * records contain a unix epoch time used
-				 * to convert to UTC. */
-				if (status == MB_SUCCESS)
-					{
-					status = mb_get_date(verbose,
-						    data->PingTime,time_i);
-					data->year 		= time_i[0];
-					data->month 		= time_i[1];
-					data->day 		= time_i[2];
-					data->hour 		= time_i[3];
-					data->minute 		= time_i[4];
-					data->second 		= time_i[5];
-					data->millisecond 	= time_i[6] / 1000;
-					}
-
-	      			/* output some debug messages */
-				if (verbose >= 2 && status == MB_SUCCESS)
-					{
-					fprintf(stderr,"\ndgb2: Setting time of Ping in RAW\n:");
-					fprintf(stderr,"dbg2: \t->year:   \t%4d\n",data->year);
-					fprintf(stderr,"dbg2: \t->month:  \t%2d\n",data->month);
-					fprintf(stderr,"dgb2: \t->day:    \t%2d\n",data->day);
-					fprintf(stderr,"dgb2: \t->hour:   \t%2d\n",data->hour);
-					fprintf(stderr,"dbg2: \t->minute: \t%2d\n",data->minute);
-					fprintf(stderr,"dbg2: \t->second: \t%2d\n",data->second);
-					fprintf(stderr,"dbg2: \t->millisecond: \t%3d\n",data->millisecond);
-					fprintf(stderr,"\ndbg2: \t->Lat:   \t%.4lf\n",data->lat);
-					fprintf(stderr,"\ndbg2: \t->Lon:   \t%.4lf\n",data->lon);
-					}
-				if (verbose >= 2 && status == MB_SUCCESS)
-					fprintf(stderr,"\ndbg2: RAW (1) \t%3d\t%4d %2d %2d %2d:%2d:%2d.%3d\n",
-						data->Port, data->year, data->month, data->day,
-						data->hour, data->minute, data->second, data->millisecond);
-				if (verbose >= 2 && status == MB_SUCCESS)
-					{
-					fprintf(stderr,"\ndgb2: Raw\n");
-					fprintf(stderr,"dbg2: \tckeel\t%8.2lf\n", data->ckeel);
-					fprintf(stderr,"dbg2: \tcmean\t%8.2lf\n", data->cmean);
-					fprintf(stderr,"dgb2: \tPort\t%d\n", data->Port);
-					fprintf(stderr,"\tnoho\t%d\n", data->noho);
-					fprintf(stderr,"\tskals\t%d\n", data->skals);
-					fprintf(stderr,"\tspfbs\n");
-					for (i=0;i<MBF_HSMDLDIH_BEAMS_PING;i=i+4)
-		    				{
-						fprintf(stderr,"\t(%02d) %10d (%02d) %10d (%02d) %10d (%02d) %10d\n",
-			      				i,data->spfb[i],
-							i+1,data->spfb[i+1],
-							i+2, data->spfb[i+2],
-							i+3, data->spfb[i+3]);
-		   				}
-					fprintf(stderr,"\tss_range\t%lf\n", data->ss_range);
-					fprintf(stderr,"\tampl\n");
-					for (i=0;i<MBF_HSMDLDIH_PIXELS_PING;i=i+4)
-		    				{
-						fprintf(stderr,"\t%d\t%d\t%d\t%d\n",
-							data->ss[i],
-							data->ss[i+1],
-							data->ss[i+2],
-			      				data->ss[i+3]);
-		    				}
-
-					fprintf(stderr,"\theading_tx\t%8.3lf\n", data->heading_tx);
-					fprintf(stderr,"\theading_rx:\t");
-					fprintf(stderr,"%8.3lf %8.3lf %8.3lf %8.3lf %8.3lf\n",
-						data->heading_rx[0],
-						data->heading_rx[1],
-						data->heading_rx[2],
-						data->heading_rx[3],
-						data->heading_rx[4]);
-
-					fprintf(stderr,"\troll_tx\t%8.3lf\n", data->roll_tx);
-					fprintf(stderr,"\troll_rx:\t");
-					fprintf(stderr,"%8.3lf %8.3lf %8.3lf %8.3lf %8.3lf\n",
-						data->roll_rx[0],
-						data->roll_rx[1],
-						data->roll_rx[2],
-						data->roll_rx[3],
-						data->roll_rx[4]);
-
-					fprintf(stderr,"\tpitch_tx\t%8.3lf\n", data->pitch_tx);
-					fprintf(stderr,"\tpitch_rx:\t");
-					fprintf(stderr,"%8.3lf %8.3lf %8.3lf %8.3lf %8.3lf\n",
-						data->pitch_rx[0],
-						data->pitch_rx[1],
-						data->pitch_rx[2],
-						data->pitch_rx[3],
-						data->pitch_rx[4]);
-					}
-
-				/* check status */
-				if (status == MB_SUCCESS)
-					{
-	      				*error = MB_ERROR_NO_ERROR;
-					}
-				else
-	      				*error = MB_ERROR_EOF;
-	     			break;
-	    			}
-
-	  		case (MBF_HSMDLDIH_NAV): /* 2, Navigation data record */
-	    			{
-				(*Nav_count)++;
-				data->kind = MB_DATA_NAV;
-
-				/* get nav data */
-				if (status == MB_SUCCESS)
-					status = xdr_int(xdrs, &data->navid);
-				if (status == MB_SUCCESS)
-					status = xdr_int(xdrs,&data->year);
-				if (status == MB_SUCCESS)
-					mb_fix_y2k(verbose, data->year, &data->year);
-				if (status == MB_SUCCESS)
-					status = xdr_int(xdrs,&data->month);
-				if (status == MB_SUCCESS)
-					status = xdr_int(xdrs,&data->day);
-				if (status == MB_SUCCESS)
-					status = xdr_int(xdrs,&data->hour);
-				if (status == MB_SUCCESS)
-					status = xdr_int(xdrs,&data->minute);
-				if (status == MB_SUCCESS)
-					status = xdr_double(xdrs,&data->secf);
-				if (status == MB_SUCCESS)
-					{
-					/* break decimal seconds into integer
-						seconds and msec */
-					data->second = (int) data->secf;
-					data->millisecond = (int) (1000 * (data->secf - data->second));
-					}
-
-				/* get position */
-				if (status == MB_SUCCESS)
-					status = xdr_double(xdrs, &data->lat);
-				if (status == MB_SUCCESS)
-					status = xdr_double(xdrs, &data->lon);
-				if (status == MB_SUCCESS)
-					status = xdr_char(xdrs, &data->pos_sens[0]);
-				if (status == MB_SUCCESS)
-					status = xdr_char(xdrs, &data->pos_sens[1]);
-
-				/* Establish the time of day for this
-				 * nav record. Nav data records
-				 * do contain time of day, but the values
-				 * seem unreliable. Thus, we use the
-				 * internal Reference time. The interrupt
-				 * records contain a unix epoch time used
-				 * to convert to UTC. */
-				if (status == MB_SUCCESS)
-					{
-					PingTime = data->datuhr + (data->reftime
-						- *FirstReftime);
-					status = mb_get_date(verbose,PingTime,time_i);
-
-					data->PingTime 		= PingTime;
-					data->year 		= time_i[0];
-					data->month 		= time_i[1];
-					data->day 		= time_i[2];
-					data->hour 		= time_i[3];
-					data->minute 		= time_i[4];
-					data->second 		= time_i[5];
-					data->millisecond 	= time_i[6] / 1000;
-					}
-
-	      			/* output some debug messages */
-				if (verbose >= 2 && status == MB_SUCCESS)
-					fprintf(stderr,"\ndbg2: NAV (2) # %3d\t%4d %2d %2d %2d:%2d:%2d.%3d\n",
-						*Nav_count, data->year, data->month, data->day,
-						data->hour, data->minute, data->second, data->millisecond);
-				if (verbose >= 2 && status == MB_SUCCESS)
-					{
-					fprintf(stderr,"dbg2: \nNav\n");
-					fprintf(stderr,"dbg2: \t->navid:  \t%d\n",data->navid);
-					fprintf(stderr,"dbg2: \t->year:   \t%4d\n",data->year);
-					fprintf(stderr,"dbg2: \t->month:  \t%2d\n",data->month);
-					fprintf(stderr,"dbg2: \t->day:    \t%2d\n",data->day);
-					fprintf(stderr,"dbg2: \t->hour:   \t%2d\n",data->hour);
-					fprintf(stderr,"dbg2: \t->minute: \t%2d\n",data->minute);
-					fprintf(stderr,"dbg2: \t->second: \t%2d\n",data->second);
-					fprintf(stderr,"dbg2: \t->millisec::\t%.3f\n",data->secf);
-
-					fprintf(stderr,"dbg2: \t->lat:    \t%lf\n",data->lat);
-					fprintf(stderr,"dbg2: \t->lon:    \t%lf\n",data->lon);
-					fprintf(stderr,"dbg2: \t->pos_sens:\t%s\n", data->pos_sens);
-					}
-				if ( verbose >= 2 && status == MB_SUCCESS)
-					{
-					fprintf(stderr,"dbg2: %4d %2d %3d %2d %2d %2d %d %10.5lf %10.5lf %2d %2s \n",
-					data->year,
-					data->month,
-					data->day,
-					data->hour,
-					data->minute,
-					data->second,
-					data->millisecond,
-					data->lat,
-					data->lon,
-					data->navid,
-					data->pos_sens);
-					}
-
-				/* check status */
-				if (status == MB_SUCCESS)
-	      				*error = MB_ERROR_NO_ERROR;
-				else
-	      				*error = MB_ERROR_EOF;
-	     			break;
-	    			}
-
-			case (MBF_HSMDLDIH_MDE):		/* 3, MD Event */
-	    			{
-				(*MDevent_count)++;
-				data->kind = MB_DATA_EVENT;
-
-				if (status == MB_SUCCESS)
-					status = xdr_int(xdrs, &data->evid);
-
-				if (status == MB_SUCCESS)
-					for (i=0;i<84;i++)
-						status = xdr_char(xdrs, &data->evtext[i]);
-
-				/* Establish the time of day for this
-				 * record. Event data records
-				 * do not contain time of day, only the
-				 * internal Reference time. The interrupt
-				 * records contain a unix epoch time used
-				 * to convert to UTC. */
-				if (status == MB_SUCCESS)
-					{
-					PingTime = data->datuhr + (data->reftime
-						- *FirstReftime);
-					status = mb_get_date(verbose,
-						    PingTime,time_i);
-
-					data->PingTime 		= PingTime;
-					data->year 		= time_i[0];
-					data->month 		= time_i[1];
-					data->day 		= time_i[2];
-					data->hour 		= time_i[3];
-					data->minute 		= time_i[4];
-					data->second 		= time_i[5];
-					data->millisecond 	= time_i[6] / 1000;
-					}
-
-				/* output some debug messages */
-				if (verbose >= 2 && status == MB_SUCCESS)
-					{
-					fprintf(stderr,"MDE (3) # %d\n", *MDevent_count);
-					}
-	      			if (verbose >= 2 && status == MB_SUCCESS)
-					{
-					fprintf(stderr,"MDE Event->\n");
-					fprintf(stderr,"\t->evid:\t%d\n", data->evid);
-					fprintf(stderr,"\t->evtxt:\t%s\n", data->evtext);
-					}
-
-				/* check status */
-				if (status == MB_SUCCESS)
-	      				*error = MB_ERROR_NO_ERROR;
-				else
-	      				*error = MB_ERROR_EOF;
-	     			break;
-	    			}
-
-			case (MBF_HSMDLDIH_ANG): /* Transid == 4, Beam Angles */
-	    			{
-				(*Angle_count)++;
-				data->kind = MB_DATA_ANGLE;
-
-				if (status == MB_SUCCESS)
-					status = xdr_int(xdrs, &data->noho);
-
-				if (status == MB_SUCCESS && status == MB_SUCCESS)
-					for (i=0;i<MBF_HSMDLDIH_BEAMS_PING;i++)
-						{
-						status = xdr_double(xdrs, &data->angle[i]);
-						mbf_hsmdldih_beamangle[i] = data->angle[i];
-						}
-
-				/* Establish the time of day for this
-				 * record. Angle data records
-				 * do not contain time of day, only the
-				 * internal Reference time. The interrupt
-				 * records contain a unix epoch time used
-				 * to convert to UTC. */
-				if (status == MB_SUCCESS)
-					{
-					PingTime = data->datuhr + (data->reftime
-						- *FirstReftime);
-					status = mb_get_date(verbose,
-						    PingTime,time_i);
-
-					data->PingTime 		= PingTime;
-					data->year 		= time_i[0];
-					data->month 		= time_i[1];
-					data->day 		= time_i[2];
-					data->hour 		= time_i[3];
-					data->minute 		= time_i[4];
-					data->second 		= time_i[5];
-					data->millisecond 	= time_i[6] / 1000;
-					}
-
-				/* output some debug messages */
-				if (verbose >= 2 && status == MB_SUCCESS)
-					{
-					fprintf(stderr,"\ndbg2: ANG (4) # %d\n", *Angle_count);
-					}
-				if ( verbose >= 5 && status == MB_SUCCESS)
-					{
-					fprintf(stderr,"\ndgb5: Ang");
-					fprintf(stderr,"dbg5:\tnoho:\t%d\n", data->noho);
-		  			for (i=0;i<MBF_HSMDLDIH_BEAMS_PING;i=i+4)
-		   				{
-		      				fprintf(stderr,"\t%02d: %8.3lf\t%02d: %8.3lf\t%02d: %8.3lf\t%02d: %8.3lf\n",
-						i,data->angle[i],
-						i+1,data->angle[i+1],
-						i+2, data->angle[i+2],
-						i+3, data->angle[i+3]);
-		    				}
-					}
-
-				/* check status */
-				if (status == MB_SUCCESS)
-	      				*error = MB_ERROR_NO_ERROR;
-				else
-	      				*error = MB_ERROR_EOF;
-	     			break;
-	    			}
-
-			case (MBF_HSMDLDIH_SVP): /* 5, Sound Velocity Profile */
-	    			{
-				(*Svp_count)++;
-				data->kind = MB_DATA_VELOCITY_PROFILE;
-
-				data->num_vel = MBF_HSMDLDIH_MAXVEL;
-				for (i=0;i<data->num_vel;i++)
-					{
-					status = xdr_double(xdrs, &data->vdepth[i]);
-					status = xdr_double(xdrs, &data->velocity[i]);
-					}
-
-				/* Establish the time of day for this
-				 * record. SVP data records
-				 * do not contain time of day, only the
-				 * internal Reference time. The interrupt
-				 * records contain a unix epoch time used
-				 * to convert to UTC. */
-				if (status == MB_SUCCESS)
-					{
-					PingTime = data->datuhr + (data->reftime
-						- *FirstReftime);
-					status = mb_get_date(verbose,
-						    PingTime,time_i);
-
-					data->PingTime 		= PingTime;
-					data->year 		= time_i[0];
-					data->month 		= time_i[1];
-					data->day 		= time_i[2];
-					data->hour 		= time_i[3];
-					data->minute 		= time_i[4];
-					data->second 		= time_i[5];
-					data->millisecond 	= time_i[6] / 1000;
-					}
-
-				/* output some debug messages */
-				if (verbose >= 2 && status == MB_SUCCESS)
-					{
-					fprintf(stderr,"\ndbg2: SVP (5) # %d\n",*Svp_count);
-					}
-
-				/* check status */
-				if (status == MB_SUCCESS)
-	      				*error = MB_ERROR_NO_ERROR;
-				else
-	      				*error = MB_ERROR_EOF;
-	     			break;
-	    			}
-
-
-			case (MBF_HSMDLDIH_REV):	/* 6, An Interrupt event? */
-	    			{
-				(*Rev_count)++;
-
-				if (status == MB_SUCCESS)
-					status = xdr_double(xdrs, &data->datuhr);
-				if (status == MB_SUCCESS)
-					for (i=0;i<8;i++)
-						status = xdr_char(xdrs, &data->mksysint[i]);
-				if (status == MB_SUCCESS)
-					for (i=0;i<84;i++)
-						status = xdr_char(xdrs, &data->mktext[i]);
-
-				/* Establish the time of day for this
-				 * record. Interrupt data records
-				 * contain a unix time which is used
-				 * to get time of day. */
-				if (status == MB_SUCCESS)
-					{
-					PingTime = data->datuhr + (data->reftime
-						- *FirstReftime);
-					status = mb_get_date(verbose,
-						    PingTime,time_i);
-
-					data->PingTime 		= PingTime;
-					data->year 		= time_i[0];
-					data->month 		= time_i[1];
-					data->day 		= time_i[2];
-					data->hour 		= time_i[3];
-					data->minute 		= time_i[4];
-					data->second 		= time_i[5];
-					data->millisecond 	= time_i[6] / 1000;
-					}
-
-				/* output some debug messages */
-	      			if (verbose >= 2 && status == MB_SUCCESS)
-					{
-					fprintf(stderr,"dbg2:\n REV (6) # %d\t%.3lf",
-						*Rev_count, data->datuhr );
-					}
-				if (verbose >= 5 && status == MB_SUCCESS)
-					{
-					fprintf(stderr,"\nIntevent");
-					fprintf(stderr,"->datuhr:  \t%lf\n",data->datuhr);
-					fprintf(stderr,"\t->mksysint:\t%s\n",data->mksysint);
-					fprintf(stderr,"\t->mktext:  \t%s\n",data->mktext);
-					}
-
-				/* Check to see if this Raw Event is
-				 * indicating the start or end of the file. */
-				if (status == MB_SUCCESS
-					&& strncmp(data->mksysint, "STOP",4) == 0)
-					{
-					data->kind = MB_DATA_STOP;
-		  			*error = MB_ERROR_NO_ERROR;
-					}
-				else if (status == MB_SUCCESS)
-					{
-					data->kind = MB_DATA_START;
-		  			*error = MB_ERROR_NO_ERROR;
-					}
-				else
-					{
-					*error = MB_ERROR_EOF;
-					}
-				break;
-	    			}
-
-			case (MBF_HSMDLDIH_COM):	/* 7, Comment */
-	    			{
-				data->kind = MB_DATA_COMMENT;
-
-				if (status == MB_SUCCESS)
-					for (i=0;i<MBF_HSMDLDIH_COMMENT;i++)
-						status = xdr_char(xdrs, &data->comment[i]);
-
-				/* Check status. */
-				if (status == MB_SUCCESS)
-		  			*error = MB_ERROR_NO_ERROR;
-				else
-					*error = MB_ERROR_EOF;
-				break;
-	    			}
-
-	  		default:
-	    			{
-				/* Should never get here, so fail! */
-				status = MB_FAILURE;
-	      			*error = MB_ERROR_UNINTELLIGIBLE;
-
-				if (verbose >=2)
-					{
-					fprintf(stderr,"dbg2: data->transid=%d not parsed\n",
-						data->transid);
-					}
-				break;
-	    			}
-	  		}
-      		}
-
-	/* get file position */
-	mb_io_ptr->file_bytes = ftell(mb_io_ptr->mbfp);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_hsmdldih_wr_data(int verbose, void *mbio_ptr, char *data_ptr, int *error)
-{
-	char	  *function_name = "mbr_hsmdldih_wr_data";
-	int	  status = MB_SUCCESS;
-	struct  mb_io_struct *mb_io_ptr;
-	struct  mbf_hsmdldih_struct *data;
-	FILE	  *mbfp;
-	XDR	*xdrs;		/* xdr i/o pointer */
-	int     i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       data_ptr:   %p\n",(void *)data_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_hsmdldih_struct *) data_ptr;
-	mbfp = mb_io_ptr->mbfp;
-	xdrs = mb_io_ptr->xdrs;
-
-	/* make sure transid is correct */
-	if (data->transid == MBF_HSMDLDIH_RAW)
-		data->transid = MBF_HSMDLDIH_BAT;
-
-	/* Start writing an HSMD Header structure */
-	for (i=0;i<4;i++)
-		status = xdr_char(xdrs, &data->scsid[i]);
-	if (status == MB_SUCCESS)
-		for (i=0;i<4;i++)
-			status = xdr_char(xdrs, &data->scsart[i]);
-	if (status == MB_SUCCESS)
-		status = xdr_int(xdrs, &data->scslng);
-	if (status == MB_SUCCESS)
-		status = xdr_int(xdrs, &data->scsext);
-	if (status == MB_SUCCESS)
-		status = xdr_int(xdrs, &data->scsblcnt);
-	if (status == MB_SUCCESS)
-		status = xdr_double(xdrs, &data->scsres1);
-	if (status == MB_SUCCESS)
-		status = xdr_int(xdrs, &data->transid);
-	if (status == MB_SUCCESS)
-		status = xdr_double(xdrs, &data->reftime);
-
-	/* write the appropriate data record */
-	if (status == MB_SUCCESS )
-		{
-		switch(data->transid)
-	  		{
-	  		case (MBF_HSMDLDIH_BAT):	/* 8, LDEO bath data record */
-	    			{
-
-				/* First make sure bathymetry edits are
-					carried over into travel times */
-				for (i=0; i<MBF_HSMDLDIH_BEAMS_PING; i++ )
-		    			{
-					if (data->depth[i] < 0.0 &&
-						data->spfb[i] > 0.0)
-						data->spfb[i] = -data->spfb[i];
-					else if (data->depth[i] > 0.0 &&
-						data->spfb[i] < 0.0)
-						data->spfb[i] = -data->spfb[i];
-		    			}
-
-	      			/* output some debug messages */
-				if (verbose >= 2 && status == MB_SUCCESS)
-					{
-					fprintf(stderr,"\ndgb2: Setting time of Ping in RAW\n:");
-					fprintf(stderr,"dbg2: \t->year:   \t%4d\n",data->year);
-					fprintf(stderr,"dbg2: \t->month:  \t%2d\n",data->month);
-					fprintf(stderr,"dgb2: \t->day:    \t%2d\n",data->day);
-					fprintf(stderr,"dgb2: \t->hour:   \t%2d\n",data->hour);
-					fprintf(stderr,"dbg2: \t->minute: \t%2d\n",data->minute);
-					fprintf(stderr,"dbg2: \t->second: \t%2d\n",data->second);
-					fprintf(stderr,"dbg2: \t->millisecond: \t%3d\n",data->millisecond);
-					fprintf(stderr,"\ndbg2: \t->Lat:   \t%.4lf\n",data->lat);
-					fprintf(stderr,"\ndbg2: \t->Lon:   \t%.4lf\n",data->lon);
-					}
-				if (verbose >= 2 && status == MB_SUCCESS)
-					fprintf(stderr,"\ndbg2: RAW (1) \t%3d\t%4d %2d %2d %2d:%2d:%2d.%3d\n",
-						data->Port, data->year, data->month, data->day,
-						data->hour, data->minute, data->second, data->millisecond);
-				if (verbose >= 2 && status == MB_SUCCESS)
-					{
-					fprintf(stderr,"\ndgb2: Raw\n");
-					fprintf(stderr,"dbg2: \tckeel\t%8.2lf\n", data->ckeel);
-					fprintf(stderr,"dbg2: \tcmean\t%8.2lf\n", data->cmean);
-					fprintf(stderr,"dgb2: \tPort\t%d\n", data->Port);
-					fprintf(stderr,"\tnoho\t%d\n", data->noho);
-					fprintf(stderr,"\tskals\t%d\n", data->skals);
-					fprintf(stderr,"\tspfbs\n");
-					for (i=0;i<MBF_HSMDLDIH_BEAMS_PING;i=i+4)
-		    				{
-						fprintf(stderr,"\t(%02d) %10d (%02d) %10d (%02d) %10d (%02d) %10d\n",
-			      				i,data->spfb[i],
-							i+1,data->spfb[i+1],
-							i+2, data->spfb[i+2],
-							i+3, data->spfb[i+3]);
-		   				}
-					fprintf(stderr,"\tss_range\t%lf\n", data->ss_range);
-					fprintf(stderr,"\tampl\n");
-					for (i=0;i<MBF_HSMDLDIH_PIXELS_PING;i=i+4)
-		    				{
-						fprintf(stderr,"\t%d\t%d\t%d\t%d\n",
-							data->ss[i],
-							data->ss[i+1],
-							data->ss[i+2],
-			      				data->ss[i+3]);
-		    				}
-
-					fprintf(stderr,"\theading_tx\t%8.3lf\n", data->heading_tx);
-					fprintf(stderr,"\theading_rx:\t");
-					fprintf(stderr,"%8.3lf %8.3lf %8.3lf %8.3lf %8.3lf\n",
-						data->heading_rx[0],
-						data->heading_rx[1],
-						data->heading_rx[2],
-						data->heading_rx[3],
-						data->heading_rx[4]);
-
-					fprintf(stderr,"\troll_tx\t%8.3lf\n", data->roll_tx);
-					fprintf(stderr,"\troll_rx:\t");
-					fprintf(stderr,"%8.3lf %8.3lf %8.3lf %8.3lf %8.3lf\n",
-						data->roll_rx[0],
-						data->roll_rx[1],
-						data->roll_rx[2],
-						data->roll_rx[3],
-						data->roll_rx[4]);
-
-					fprintf(stderr,"\tpitch_tx\t%8.3lf\n", data->pitch_tx);
-					fprintf(stderr,"\tpitch_rx:\t");
-					fprintf(stderr,"%8.3lf %8.3lf %8.3lf %8.3lf %8.3lf\n",
-						data->pitch_rx[0],
-						data->pitch_rx[1],
-						data->pitch_rx[2],
-						data->pitch_rx[3],
-						data->pitch_rx[4]);
-					}
-
-				/* set time and position */
-	      			if (status == MB_SUCCESS)
-					status = xdr_double(xdrs, &data->PingTime);
-	      			if (status == MB_SUCCESS)
-					status = xdr_double(xdrs, &data->lon);
-	      			if (status == MB_SUCCESS)
-					status = xdr_double(xdrs, &data->lat);
-
-				/* set water velocity and travel time data */
-	      			if (status == MB_SUCCESS)
-					status = xdr_double(xdrs, &data->ckeel);
-	      			if (status == MB_SUCCESS)
-					status = xdr_double(xdrs, &data->cmean);
-	      			if (status == MB_SUCCESS)
-					status = xdr_int(xdrs, &data->Port);
-				if (status == MB_SUCCESS)
-					status = xdr_int(xdrs, &data->noho);
-				if (status == MB_SUCCESS)
-					status = xdr_int(xdrs, &data->skals);
-				if (status == MB_SUCCESS)
-					for (i=0;i<MBF_HSMDLDIH_BEAMS_PING;i++)
-						status = xdr_int(xdrs, &data->spfb[i]);
-				if (status == MB_SUCCESS)
-					for (i=0;i<MBF_HSMDLDIH_BEAMS_PING;i++)
-						status = xdr_double(xdrs, &data->depth[i]);
-				if (status == MB_SUCCESS)
-					for (i=0;i<MBF_HSMDLDIH_BEAMS_PING;i++)
-						status = xdr_double(xdrs, &data->distance[i]);
-
-				/* set sidescan data */
-				if (status == MB_SUCCESS)
-					status = xdr_double(xdrs, &data->ss_range);
-				if (status == MB_SUCCESS)
-					for (i=0;i<MBF_HSMDLDIH_PIXELS_PING;i++)
-						status = xdr_char(xdrs, (char *)&data->ss[i]);
-
-				/* set attitude data */
-				if (status == MB_SUCCESS)
-					status = xdr_double(xdrs, &data->heading_tx);
-				if (status == MB_SUCCESS)
-					for (i=0;i<5;i++)
-						status = xdr_double(xdrs, &data->heading_rx[i]);
-				if (status == MB_SUCCESS)
-					status = xdr_double(xdrs, &data->roll_tx);
-				if (status == MB_SUCCESS)
-					for (i=0;i<5;i++)
-						status = xdr_double(xdrs, &data->roll_rx[i]);
-				if (status == MB_SUCCESS)
-					status = xdr_double(xdrs, &data->pitch_tx);
-				if (status == MB_SUCCESS)
-					for (i=0;i<5;i++)
-						status = xdr_double(xdrs, &data->pitch_rx[i]);
-
-				/* check status */
-				if (status == MB_SUCCESS)
-	      				*error = MB_ERROR_NO_ERROR;
-				else
-	      				*error = MB_ERROR_WRITE_FAIL;
-	     			break;
-	    			}
-
-	  		case (MBF_HSMDLDIH_NAV): /* 2, Navigation data record */
-	    			{
-				/* set nav data */
-				if (status == MB_SUCCESS)
-					status = xdr_int(xdrs, &data->navid);
-				if (status == MB_SUCCESS)
-					mb_unfix_y2k(verbose, data->year, &data->year);
-				if (status == MB_SUCCESS)
-					status = xdr_int(xdrs,&data->year);
-				if (status == MB_SUCCESS)
-					status = xdr_int(xdrs,&data->month);
-				if (status == MB_SUCCESS)
-					status = xdr_int(xdrs,&data->day);
-				if (status == MB_SUCCESS)
-					status = xdr_int(xdrs,&data->hour);
-				if (status == MB_SUCCESS)
-					status = xdr_int(xdrs,&data->minute);
-				if (status == MB_SUCCESS)
-					status = xdr_double(xdrs,&data->secf);
-
-				/* set position */
-				if (status == MB_SUCCESS)
-					status = xdr_double(xdrs, &data->lat);
-				if (status == MB_SUCCESS)
-					status = xdr_double(xdrs, &data->lon);
-				if (status == MB_SUCCESS)
-					status = xdr_char(xdrs, &data->pos_sens[0]);
-				if (status == MB_SUCCESS)
-					status = xdr_char(xdrs, &data->pos_sens[1]);
-
-				/* check status */
-				if (status == MB_SUCCESS)
-	      				*error = MB_ERROR_NO_ERROR;
-				else
-	      				*error = MB_ERROR_WRITE_FAIL;
-	     			break;
-	    			}
-
-			case (MBF_HSMDLDIH_MDE):		/* 3, MD Event */
-	    			{
-				if (status == MB_SUCCESS)
-					status = xdr_int(xdrs, &data->evid);
-				if (status == MB_SUCCESS)
-					for (i=0;i<84;i++)
-						status = xdr_char(xdrs, &data->evtext[i]);
-
-				/* check status */
-				if (status == MB_SUCCESS)
-	      				*error = MB_ERROR_NO_ERROR;
-				else
-	      				*error = MB_ERROR_WRITE_FAIL;
-	     			break;
-	    			}
-
-			case (MBF_HSMDLDIH_ANG): /* Transid == 4, Beam Angles */
-	    			{
-				if (status == MB_SUCCESS)
-					status = xdr_int(xdrs, &data->noho);
-				if (status == MB_SUCCESS && status == MB_SUCCESS)
-					for (i=0;i<MBF_HSMDLDIH_BEAMS_PING;i++)
-						status = xdr_double(xdrs, &data->angle[i]);
-
-				/* check status */
-				if (status == MB_SUCCESS)
-	      				*error = MB_ERROR_NO_ERROR;
-				else
-	      				*error = MB_ERROR_WRITE_FAIL;
-	     			break;
-	    			}
-
-			case (MBF_HSMDLDIH_SVP): /* 5, Sound Velocity Profile */
-	    			{
-
-				data->num_vel = MBF_HSMDLDIH_MAXVEL;
-				for (i=0;i<data->num_vel;i++)
-					{
-					status = xdr_double(xdrs, &data->vdepth[i]);
-					status = xdr_double(xdrs, &data->velocity[i]);
-					}
-
-				/* check status */
-				if (status == MB_SUCCESS)
-	      				*error = MB_ERROR_NO_ERROR;
-				else
-	      				*error = MB_ERROR_WRITE_FAIL;
-	     			break;
-	    			}
-
-			case (MBF_HSMDLDIH_REV):	/* 6, An Interrupt event? */
-	    			{
-				if (status == MB_SUCCESS)
-					status = xdr_double(xdrs, &data->datuhr);
-				if (status == MB_SUCCESS)
-					for (i=0;i<8;i++)
-						status = xdr_char(xdrs, &data->mksysint[i]);
-				if (status == MB_SUCCESS)
-					for (i=0;i<84;i++)
-						status = xdr_char(xdrs, &data->mktext[i]);
-
-				/* Check status. */
-				if (status == MB_SUCCESS)
-		  			*error = MB_ERROR_NO_ERROR;
-				else
-					*error = MB_ERROR_WRITE_FAIL;
-				break;
-	    			}
-
-			case (MBF_HSMDLDIH_COM):	/* 7, Comment */
-	    			{
-				if (status == MB_SUCCESS)
-					for (i=0;i<MBF_HSMDLDIH_COMMENT;i++)
-						status = xdr_char(xdrs, &data->comment[i]);
-
-				/* Check status. */
-				if (status == MB_SUCCESS)
-		  			*error = MB_ERROR_NO_ERROR;
-				else
-					*error = MB_ERROR_WRITE_FAIL;
-				break;
-	    			}
-
-	  		default:
-	    			{
-				/* Should never get here, so fail! */
-				status = MB_FAILURE;
-	      			*error = MB_ERROR_UNINTELLIGIBLE;
-				break;
-	    			}
-	  		}
-      		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mbr_hsunknwn.c b/src/mbio/mbr_hsunknwn.c
deleted file mode 100644
index 431d6c8..0000000
--- a/src/mbio/mbr_hsunknwn.c
+++ /dev/null
@@ -1,770 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbr_hsunknwn.c	10/13/2008
- *	$Id: mbr_hsunknwn.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 2008-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbr_hsunknwn.c contains the functions for reading and writing
- * multibeam data in the HSUNKNWN format.
- * These functions include:
- *   mbr_alm_hsunknwn	- allocate read/write memory
- *   mbr_dem_hsunknwn	- deallocate read/write memory
- *   mbr_rt_hsunknwn	- read and translate data
- *   mbr_wt_hsunknwn	- translate and write data
- *
- * Author:	D. W. Caress
- * Date:	October 13, 2008
- *
- * $Log: mbr_hsunknwn.c,v $
- * Revision 5.0  2008/10/17 07:28:41  caress
- * Supporting Hydrosweep DS data in format used by SOPAC.
- *
- *
- *--------------------------------------------------------------------
- *
- * Some notes on the data format:
- *
- * According to Brian Bishop of SOPAC (email 12 October 2008),
- * data in this format derive from joint Japanese & SOPAC surveys
- * from 1991 through 2005 from an unknown ship and sonar.
- * Because the number of beams is 59, I suppose that the sonar
- * was likely an Atlas Hydrosweep DS, and treat the data as
- * such.
- *
- * Table AP5-4 Format of MBES Files (2000-2005)
- *
- * Line No, Item                                             Format Column
- * 1    1   Blank                                            4X      1:4
- *      2   Date (Year/Month/Day: YYYYMMDD)                  I8      4:12
- *      3   Blank                                            1X      13:13
- *      4   Time (Hour/Minute/Second: HHMMSS)                I6      14:19
- *      5   Longitude of Center (Degree)                     F12.7   20:31
- *      6   Latitude of Center (Degree)                      F12.7   32:43
- *      7   Dummy Data                                       2F8.1   44:59
- *      8   Azimuth (Heading: Degree)                        F9.3    60:68
- *      9   Water Depth of Center (m)                        F9.3    69:78
- * 2        Water Depth (X= -29 - 0 - +29)                   59F7.1  1:411
- * 3        Horizontal Distance (X= -29 - 0 - +29)           59F7.1  1:411
- * 4        Acoustic Reflection Intensity (X= -29 - 0 - +29) 59F7.1  1:411
- * 5        Dummy Data                                       59F7.1  1:411
- * 6        Dummy Data                                       59F7.1  1:411
- * Repeat Line 1 to 6
- *
- * Note: the data we saw has the first four characters of the first line
- * as " M  " rather than blank and has 7 null bytes before a <cr> at the
- * end of the first line, after the center water depth.
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mb_define.h"
-#include "mbsys_hsds.h"
-
-#define LINE1SIZE 87
-#define LINE2SIZE 415
-
-/* essential function prototypes */
-int mbr_register_hsunknwn(int verbose, void *mbio_ptr,
-		int *error);
-int mbr_info_hsunknwn(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_alm_hsunknwn(int verbose, void *mbio_ptr, int *error);
-int mbr_dem_hsunknwn(int verbose, void *mbio_ptr, int *error);
-int mbr_rt_hsunknwn(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_wt_hsunknwn(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-
-static char rcs_id[]="$Id: mbr_hsunknwn.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mbr_register_hsunknwn(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_register_hsunknwn";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* get mb_io_ptr */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set format info parameters */
-	status = mbr_info_hsunknwn(verbose,
-			&mb_io_ptr->system,
-			&mb_io_ptr->beams_bath_max,
-			&mb_io_ptr->beams_amp_max,
-			&mb_io_ptr->pixels_ss_max,
-			mb_io_ptr->format_name,
-			mb_io_ptr->system_name,
-			mb_io_ptr->format_description,
-			&mb_io_ptr->numfile,
-			&mb_io_ptr->filetype,
-			&mb_io_ptr->variable_beams,
-			&mb_io_ptr->traveltime,
-			&mb_io_ptr->beam_flagging,
-			&mb_io_ptr->nav_source,
-			&mb_io_ptr->heading_source,
-			&mb_io_ptr->vru_source,
-			&mb_io_ptr->svp_source,
-			&mb_io_ptr->beamwidth_xtrack,
-			&mb_io_ptr->beamwidth_ltrack,
-			error);
-
-	/* set format and system specific function pointers */
-	mb_io_ptr->mb_io_format_alloc = &mbr_alm_hsunknwn;
-	mb_io_ptr->mb_io_format_free = &mbr_dem_hsunknwn;
-	mb_io_ptr->mb_io_store_alloc = &mbsys_hsds_alloc;
-	mb_io_ptr->mb_io_store_free = &mbsys_hsds_deall;
-	mb_io_ptr->mb_io_read_ping = &mbr_rt_hsunknwn;
-	mb_io_ptr->mb_io_write_ping = &mbr_wt_hsunknwn;
-	mb_io_ptr->mb_io_dimensions = &mbsys_hsds_dimensions;
-	mb_io_ptr->mb_io_extract = &mbsys_hsds_extract;
-	mb_io_ptr->mb_io_insert = &mbsys_hsds_insert;
-	mb_io_ptr->mb_io_extract_nav = &mbsys_hsds_extract_nav;
-	mb_io_ptr->mb_io_insert_nav = &mbsys_hsds_insert_nav;
-	mb_io_ptr->mb_io_extract_altitude = &mbsys_hsds_extract_altitude;
-	mb_io_ptr->mb_io_insert_altitude = NULL;
-	mb_io_ptr->mb_io_extract_svp = NULL;
-	mb_io_ptr->mb_io_insert_svp = NULL;
-	mb_io_ptr->mb_io_ttimes = &mbsys_hsds_ttimes;
-	mb_io_ptr->mb_io_detects = &mbsys_hsds_detects;
-	mb_io_ptr->mb_io_copyrecord = &mbsys_hsds_copy;
-	mb_io_ptr->mb_io_extract_rawss = NULL;
-	mb_io_ptr->mb_io_insert_rawss = NULL;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",mb_io_ptr->system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",mb_io_ptr->beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",mb_io_ptr->beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",mb_io_ptr->pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",mb_io_ptr->format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",mb_io_ptr->system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",mb_io_ptr->format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",mb_io_ptr->numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",mb_io_ptr->filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",mb_io_ptr->variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",mb_io_ptr->traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",mb_io_ptr->beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",mb_io_ptr->nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",mb_io_ptr->heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",mb_io_ptr->vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",mb_io_ptr->svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",mb_io_ptr->beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",mb_io_ptr->beamwidth_ltrack);
-		fprintf(stderr,"dbg2       format_alloc:       %p\n",(void *)mb_io_ptr->mb_io_format_alloc);
-		fprintf(stderr,"dbg2       format_free:        %p\n",(void *)mb_io_ptr->mb_io_format_free);
-		fprintf(stderr,"dbg2       store_alloc:        %p\n",(void *)mb_io_ptr->mb_io_store_alloc);
-		fprintf(stderr,"dbg2       store_free:         %p\n",(void *)mb_io_ptr->mb_io_store_free);
-		fprintf(stderr,"dbg2       read_ping:          %p\n",(void *)mb_io_ptr->mb_io_read_ping);
-		fprintf(stderr,"dbg2       write_ping:         %p\n",(void *)mb_io_ptr->mb_io_write_ping);
-		fprintf(stderr,"dbg2       extract:            %p\n",(void *)mb_io_ptr->mb_io_extract);
-		fprintf(stderr,"dbg2       insert:             %p\n",(void *)mb_io_ptr->mb_io_insert);
-		fprintf(stderr,"dbg2       extract_nav:        %p\n",(void *)mb_io_ptr->mb_io_extract_nav);
-		fprintf(stderr,"dbg2       insert_nav:         %p\n",(void *)mb_io_ptr->mb_io_insert_nav);
-		fprintf(stderr,"dbg2       extract_altitude:   %p\n",(void *)mb_io_ptr->mb_io_extract_altitude);
-		fprintf(stderr,"dbg2       insert_altitude:    %p\n",(void *)mb_io_ptr->mb_io_insert_altitude);
-		fprintf(stderr,"dbg2       extract_svp:        %p\n",(void *)mb_io_ptr->mb_io_extract_svp);
-		fprintf(stderr,"dbg2       insert_svp:         %p\n",(void *)mb_io_ptr->mb_io_insert_svp);
-		fprintf(stderr,"dbg2       ttimes:             %p\n",(void *)mb_io_ptr->mb_io_ttimes);
-		fprintf(stderr,"dbg2       detects:            %p\n",(void *)mb_io_ptr->mb_io_detects);
-		fprintf(stderr,"dbg2       extract_rawss:      %p\n",(void *)mb_io_ptr->mb_io_extract_rawss);
-		fprintf(stderr,"dbg2       insert_rawss:       %p\n",(void *)mb_io_ptr->mb_io_insert_rawss);
-		fprintf(stderr,"dbg2       copyrecord:         %p\n",(void *)mb_io_ptr->mb_io_copyrecord);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbr_info_hsunknwn(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error)
-{
-	char	*function_name = "mbr_info_hsunknwn";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* set format info parameters */
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-	*system = MB_SYS_HSDS;
-	*beams_bath_max = 59;
-	*beams_amp_max = 59;
-	*pixels_ss_max = 0;
-	strncpy(format_name, "HSUNKNWN", MB_NAME_LENGTH);
-	strncpy(system_name, "HSDS", MB_NAME_LENGTH);
-	strncpy(format_description, "Format name:          MBF_HSUNKNWN\nInformal Description: Unknown Hydrosweep\nAttributes:           Hydrosweep DS, bathymetry, 59 beams, ascii, unknown origin, SOPAC.\n", MB_DESCRIPTION_LENGTH);
-	*numfile = 1;
-	*filetype = MB_FILETYPE_NORMAL;
-	*variable_beams = MB_NO;
-	*traveltime = MB_NO;
-	*beam_flagging = MB_YES;
-	*nav_source = MB_DATA_DATA;
-	*heading_source = MB_DATA_DATA;
-	*vru_source = MB_DATA_DATA;
-	*svp_source = MB_DATA_NONE;
-	*beamwidth_xtrack = 2.0;
-	*beamwidth_ltrack = 2.0;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",*system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",*beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",*beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",*pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",*numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",*filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",*variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",*traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",*beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",*nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",*heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",*vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",*svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",*beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",*beamwidth_ltrack);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_alm_hsunknwn(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_alm_hsunknwn";
-	int	status;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set initial status */
-	status = MB_SUCCESS;
-
-	/* allocate memory for data structure */
-	status = mb_malloc(verbose,sizeof(struct mbsys_hsds_struct),
-				&mb_io_ptr->store_data,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_dem_hsunknwn(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_dem_hsunknwn";
-	int	status;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* deallocate memory for data descriptor */
-	status = mb_free(verbose,&mb_io_ptr->raw_data,error);
-	status = mb_free(verbose,&mb_io_ptr->store_data,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_rt_hsunknwn(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_rt_hsunknwn";
-	int	status;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_hsds_struct *store;
-	char	line[MB_PATH_MAXLINE];
-	char	*result;
-	double	value;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_hsds_struct *) store_ptr;
-
-	/* set file position */
-	mb_io_ptr->file_pos = mb_io_ptr->file_bytes;
-
-	/* read first line of next record from file */
-	if ((status = fread(line,1,LINE1SIZE,mb_io_ptr->mbfp)) == LINE1SIZE)
-		{
-		mb_io_ptr->file_bytes += status;
-		status = MB_SUCCESS;
-		*error = MB_ERROR_NO_ERROR;
-
-		/* if comment just read the next line */
-		if (strncmp(line, "COMM", 4) == 0)
-			{
-			store->kind = MB_DATA_COMMENT;
-			result = fgets(store->comment,MBSYS_HSDS_MAXLINE,mb_io_ptr->mbfp);
-			if (result == NULL)
-				{
-				status = MB_FAILURE;
-				*error = MB_ERROR_EOF;
-				}
-			else
-				{
-				mb_io_ptr->file_bytes += strlen(store->comment);
-				store->comment[strlen(store->comment)-1] = 0;
-				store->comment[strlen(store->comment)-1] = 0;
-				}
-			}
-
-		else
-			{
-			store->kind = MB_DATA_DATA;
-
-			mb_get_int(    &(store->year),         line+ 4,  4);
-			mb_get_int(    &(store->month),        line+ 8,  2);
-			mb_get_int(    &(store->day),          line+10,  2);
-			mb_get_int(    &(store->hour),         line+13,  2);
-			mb_get_int(    &(store->minute),       line+15,  2);
-			mb_get_int(    &(store->second),       line+17,  2);
-			mb_get_double( &(store->lon),          line+19,  12);
-			mb_get_double( &(store->lat),          line+31,  12);
-
-			mb_get_double( &(store->course_true),  line+59,  9);
-			mb_get_double( &(store->depth_center), line+68,  9);
-
-			store->depth_scale = 0.1;
-			store->back_scale = 0.1;
-			}
-		}
-	else
-		{
-		mb_io_ptr->file_bytes += status;
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	/* read second line of next record from file */
-	if (status == MB_SUCCESS && store->kind == MB_DATA_DATA)
-		{
-		if ((status = fread(line,1,LINE2SIZE,mb_io_ptr->mbfp)) == LINE2SIZE)
-			{
-			mb_io_ptr->file_bytes += status;
-			status = MB_SUCCESS;
-			*error = MB_ERROR_NO_ERROR;
-
-			for (i=0;i<MBSYS_HSDS_BEAMS;i++)
-				{
-				mb_get_double( &value,          line+i*7,  7);
-				store->depth[i] = (int)(10.0 * value);
-				}
-			}
-		else
-			{
-			mb_io_ptr->file_bytes += status;
-			status = MB_FAILURE;
-			*error = MB_ERROR_EOF;
-			}
-
-		/* read third line of next record from file */
-		if ((status = fread(line,1,LINE2SIZE,mb_io_ptr->mbfp)) == LINE2SIZE)
-			{
-			mb_io_ptr->file_bytes += status;
-			status = MB_SUCCESS;
-			*error = MB_ERROR_NO_ERROR;
-
-			for (i=0;i<MBSYS_HSDS_BEAMS;i++)
-				{
-				mb_get_double( &value,          line+i*7,  7);
-				store->distance[i] = (int)(10.0 * value);
-				}
-			}
-		else
-			{
-			mb_io_ptr->file_bytes += status;
-			status = MB_FAILURE;
-			*error = MB_ERROR_EOF;
-			}
-
-		/* read fourth line of next record from file */
-		if ((status = fread(line,1,LINE2SIZE,mb_io_ptr->mbfp)) == LINE2SIZE)
-			{
-			mb_io_ptr->file_bytes += status;
-			status = MB_SUCCESS;
-			*error = MB_ERROR_NO_ERROR;
-
-			for (i=0;i<MBSYS_HSDS_BEAMS;i++)
-				{
-				mb_get_double( &value,          line+i*7,  7);
-				store->back[i] = (int)(10.0 * value);
-				}
-			}
-		else
-			{
-			mb_io_ptr->file_bytes += status;
-			status = MB_FAILURE;
-			*error = MB_ERROR_EOF;
-			}
-
-		/* read fifth line of next record from file */
-		if ((status = fread(line,1,LINE2SIZE,mb_io_ptr->mbfp)) == LINE2SIZE)
-			{
-			mb_io_ptr->file_bytes += status;
-			status = MB_SUCCESS;
-			*error = MB_ERROR_NO_ERROR;
-
-			for (i=0;i<MBSYS_HSDS_BEAMS;i++)
-				{
-				mb_get_double( &value,          line+i*7,  7);
-				}
-			}
-		else
-			{
-			mb_io_ptr->file_bytes += status;
-			status = MB_FAILURE;
-			*error = MB_ERROR_EOF;
-			}
-
-		/* read sixth line of next record from file */
-		if ((status = fread(line,1,LINE2SIZE,mb_io_ptr->mbfp)) == LINE2SIZE)
-			{
-			mb_io_ptr->file_bytes += status;
-			status = MB_SUCCESS;
-			*error = MB_ERROR_NO_ERROR;
-
-			for (i=0;i<MBSYS_HSDS_BEAMS;i++)
-				{
-				mb_get_double( &value,          line+i*7,  7);
-				}
-			}
-		else
-			{
-			mb_io_ptr->file_bytes += status;
-			status = MB_FAILURE;
-			*error = MB_ERROR_EOF;
-			}
-		}
-
-	/* set kind and error in mb_io_ptr */
-	mb_io_ptr->new_kind = store->kind;
-	mb_io_ptr->new_error = *error;
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       kind:             %d\n",store->kind);
-		if (store->kind == MB_DATA_DATA)
-			{
-			fprintf(stderr,"dbg5       lon:              %f\n",store->lon);
-			fprintf(stderr,"dbg5       lat:              %f\n",store->lat);
-			fprintf(stderr,"dbg5       year:             %d\n",store->year);
-			fprintf(stderr,"dbg5       month:            %d\n",store->month);
-			fprintf(stderr,"dbg5       day:              %d\n",store->day);
-			fprintf(stderr,"dbg5       hour:             %d\n",store->hour);
-			fprintf(stderr,"dbg5       minute:           %d\n",store->minute);
-			fprintf(stderr,"dbg5       second:           %d\n",store->second);
-			fprintf(stderr,"dbg5       course_true:      %f\n",store->course_true);
-			fprintf(stderr,"dbg5       depth_center:     %f\n",store->depth_center);
-			fprintf(stderr,"dbg5       depth_scale:      %f\n",store->depth_scale);
-			fprintf(stderr,"dbg5       back_scale:       %f\n",store->back_scale);
-			fprintf(stderr,"dbg5       beam distance depth back:\n");
-			for (i=0;i<MBSYS_HSDS_BEAMS;i++)
-				fprintf(stderr,"dbg5         %d  %d  %d  %d\n",
-					i,store->distance[i],store->depth[i],store->back[i]);
-			}
-		else if (store->kind == MB_DATA_COMMENT)
-			{
-			fprintf(stderr,"dbg5       comment: %s\n",store->comment);
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_wt_hsunknwn(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_wt_hsunknwn";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_hsds_struct *store;
-	double	value;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_hsds_struct *) store_ptr;
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Status at beginning of MBIO function <%s>\n",function_name);
-		if (store != NULL)
-			fprintf(stderr,"dbg5       store->kind:    %d\n",store->kind);
-		fprintf(stderr,"dbg5       new_kind:       %d\n",mb_io_ptr->new_kind);
-		fprintf(stderr,"dbg5       new_error:      %d\n",mb_io_ptr->new_error);
-		fprintf(stderr,"dbg5       error:          %d\n",*error);
-		fprintf(stderr,"dbg5       status:         %d\n",status);
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       kind:             %d\n",store->kind);
-		if (store->kind == MB_DATA_DATA)
-			{
-			fprintf(stderr,"dbg5       lon:              %f\n",store->lon);
-			fprintf(stderr,"dbg5       lat:              %f\n",store->lat);
-			fprintf(stderr,"dbg5       year:             %d\n",store->year);
-			fprintf(stderr,"dbg5       month:            %d\n",store->month);
-			fprintf(stderr,"dbg5       day:              %d\n",store->day);
-			fprintf(stderr,"dbg5       hour:             %d\n",store->hour);
-			fprintf(stderr,"dbg5       minute:           %d\n",store->minute);
-			fprintf(stderr,"dbg5       second:           %d\n",store->second);
-			fprintf(stderr,"dbg5       course_true:      %f\n",store->course_true);
-			fprintf(stderr,"dbg5       depth_center:     %f\n",store->depth_center);
-			fprintf(stderr,"dbg5       depth_scale:      %f\n",store->depth_scale);
-			fprintf(stderr,"dbg5       back_scale:       %f\n",store->back_scale);
-			fprintf(stderr,"dbg5       beam distance depth back:\n");
-			for (i=0;i<MBSYS_HSDS_BEAMS;i++)
-				fprintf(stderr,"dbg5         %d  %d  %d  %d\n",
-					i,store->distance[i],store->depth[i],store->back[i]);
-			}
-		else if (store->kind == MB_DATA_COMMENT)
-			{
-			fprintf(stderr,"dbg5       comment: %s\n",store->comment);
-			}
-		}
-
-	/* write comment record to file */
-	if (store->kind ==MB_DATA_COMMENT)
-		{
-		status = fprintf(mb_io_ptr->mbfp,"COMM                                                                                 \r\n");
-		if (status > 0)
-			status = fprintf(mb_io_ptr->mbfp,"%s\r\n",store->comment);
-		if (status > 0)
-			{
-			status = MB_SUCCESS;
-			*error = MB_ERROR_NO_ERROR;
-			}
-		else
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_WRITE_FAIL;
-			}
-		}
-
-	/* write data record to file */
-	else if (store->kind == MB_DATA_DATA)
-		{
-		fprintf(mb_io_ptr->mbfp," M  %4.4d%2.2d%2.2d %2.2d%2.2d%2.2d%12.7f%12.7f%8.1f%8.1f%9.3f%9.3f        \r\n",
-			store->year,store->month,store->day,
-			store->hour,store->minute,store->second,
-			store->lon,store->lat,0.0,0.0,store->course_true,
-			store->depth_center);
-		for (i=0;i<MBSYS_HSDS_BEAMS;i++)
-			{
-			value = store->depth[i] * store->depth_scale;
-			fprintf(mb_io_ptr->mbfp,"%7.1f",value);
-			}
-		fprintf(mb_io_ptr->mbfp,"\r\n");
-		for (i=0;i<MBSYS_HSDS_BEAMS;i++)
-			{
-			value = store->distance[i] * store->depth_scale;
-			fprintf(mb_io_ptr->mbfp,"%7.1f",value);
-			}
-		fprintf(mb_io_ptr->mbfp,"\r\n");
-		for (i=0;i<MBSYS_HSDS_BEAMS;i++)
-			{
-			value = store->back[i] * store->back_scale;
-			fprintf(mb_io_ptr->mbfp,"%7.1f",value);
-			}
-		fprintf(mb_io_ptr->mbfp,"\r\n");
-		for (i=0;i<MBSYS_HSDS_BEAMS;i++)
-			{
-			value = -9999.9;
-			fprintf(mb_io_ptr->mbfp,"%7.1f",value);
-			}
-		fprintf(mb_io_ptr->mbfp,"\r\n");
-		for (i=0;i<MBSYS_HSDS_BEAMS;i++)
-			{
-			value = 100.0;
-			fprintf(mb_io_ptr->mbfp,"%7.1f",value);
-			}
-		fprintf(mb_io_ptr->mbfp,"\r\n");
-		}
-
-	else
-		{
-		status = MB_SUCCESS;
-		*error = MB_ERROR_NO_ERROR;
-		if (verbose >= 5)
-			fprintf(stderr,"\ndbg5  No data written in MBIO function <%s>\n",function_name);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mbr_hsuricen.c b/src/mbio/mbr_hsuricen.c
deleted file mode 100644
index 7b937e5..0000000
--- a/src/mbio/mbr_hsuricen.c
+++ /dev/null
@@ -1,867 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbr_hsuricen.c	2/2/93
- *	$Id: mbr_hsuricen.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1993-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbr_hsuricen.c contains the functions for reading and writing
- * multibeam data in the HSURICEN format.
- * These functions include:
- *   mbr_alm_hsuricen	- allocate read/write memory
- *   mbr_dem_hsuricen	- deallocate read/write memory
- *   mbr_rt_hsuricen	- read and translate data
- *   mbr_wt_hsuricen	- translate and write data
- *
- * Author:	D. W. Caress
- * Date:	February 2, 1993
- * $Log: mbr_hsuricen.c,v $
- * Revision 5.9  2005/11/05 00:48:04  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.8  2003/05/20 18:05:32  caress
- * Added svp_source to data source parameters.
- *
- * Revision 5.7  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.6  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.5  2002/03/26 07:43:25  caress
- * Release 5.0.beta15
- *
- * Revision 5.4  2002/02/26 07:50:41  caress
- * Release 5.0.beta14
- *
- * Revision 5.3  2001/07/20 00:32:54  caress
- * Release 5.0.beta03
- *
- * Revision 5.2  2001/03/22  20:50:02  caress
- * Trying to make version 5.0.beta0
- *
- * Revision 5.1  2001/01/22  07:43:34  caress
- * Version 5.0.beta01
- *
- * Revision 5.0  2000/12/01  22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.12  2000/10/11  01:03:21  caress
- * Convert to ANSI C
- *
- * Revision 4.11  2000/09/30  06:34:20  caress
- * Snapshot for Dale.
- *
- * Revision 4.10  1998/10/05  17:46:15  caress
- * MB-System version 4.6beta
- *
- * Revision 4.9  1997/07/25  14:19:53  caress
- * Version 4.5beta2.
- * Much mucking, particularly with Simrad formats.
- *
- * Revision 4.8  1997/04/21  17:02:07  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.7  1996/04/22  13:21:19  caress
- * Now have DTR and MIN/MAX defines in mb_define.h
- *
- * Revision 4.7  1996/04/22  13:21:19  caress
- * Now have DTR and MIN/MAX defines in mb_define.h
- *
- * Revision 4.6  1995/03/17  15:12:59  caress
- * Changes related to handling early, problematic
- * Ewing Hydrosweep data.
- *
- * Revision 4.5  1995/03/09  12:41:58  caress
- * Fixed bug related to handling shallow water data.
- *
- * Revision 4.4  1995/03/06  19:38:54  caress
- * Changed include strings.h to string.h for POSIX compliance.
- *
- * Revision 4.3  1994/10/21  12:20:01  caress
- * Release V4.0
- *
- * Revision 4.2  1994/07/29  18:46:51  caress
- * Changes associated with supporting Lynx OS (byte swapped) and
- * using unix second time base (for time_d values).
- *
- * Revision 4.1  1994/05/21  02:23:29  caress
- * Made sure that mb_io_ptr->new_bath_alongtrack is set to zero on reading.
- *
- * Revision 4.0  1994/03/06  00:01:56  caress
- * First cut at version 4.0
- *
- * Revision 4.1  1994/03/03  03:39:43  caress
- * Fixed copyright message.
- *
- * Revision 4.0  1994/02/21  03:59:50  caress
- * First cut at new version. Altered to be consistent
- * with passing of three types of data: bathymetry,
- * amplitude, and sidescan.
- *
- * Revision 3.0  1993/05/14  22:56:29  sohara
- * initial version
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mb_define.h"
-#include "mbsys_hsds.h"
-#include "mbf_hsuricen.h"
-
-/* include for byte swapping on little-endian machines */
-#ifdef BYTESWAPPED
-#include "mb_swap.h"
-#endif
-
-/* essential function prototypes */
-int mbr_register_hsuricen(int verbose, void *mbio_ptr,
-		int *error);
-int mbr_info_hsuricen(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_alm_hsuricen(int verbose, void *mbio_ptr, int *error);
-int mbr_dem_hsuricen(int verbose, void *mbio_ptr, int *error);
-int mbr_rt_hsuricen(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_wt_hsuricen(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-
-static char rcs_id[]="$Id: mbr_hsuricen.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mbr_register_hsuricen(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_register_hsuricen";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* get mb_io_ptr */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set format info parameters */
-	status = mbr_info_hsuricen(verbose,
-			&mb_io_ptr->system,
-			&mb_io_ptr->beams_bath_max,
-			&mb_io_ptr->beams_amp_max,
-			&mb_io_ptr->pixels_ss_max,
-			mb_io_ptr->format_name,
-			mb_io_ptr->system_name,
-			mb_io_ptr->format_description,
-			&mb_io_ptr->numfile,
-			&mb_io_ptr->filetype,
-			&mb_io_ptr->variable_beams,
-			&mb_io_ptr->traveltime,
-			&mb_io_ptr->beam_flagging,
-			&mb_io_ptr->nav_source,
-			&mb_io_ptr->heading_source,
-			&mb_io_ptr->vru_source,
-			&mb_io_ptr->svp_source,
-			&mb_io_ptr->beamwidth_xtrack,
-			&mb_io_ptr->beamwidth_ltrack,
-			error);
-
-	/* set format and system specific function pointers */
-	mb_io_ptr->mb_io_format_alloc = &mbr_alm_hsuricen;
-	mb_io_ptr->mb_io_format_free = &mbr_dem_hsuricen;
-	mb_io_ptr->mb_io_store_alloc = &mbsys_hsds_alloc;
-	mb_io_ptr->mb_io_store_free = &mbsys_hsds_deall;
-	mb_io_ptr->mb_io_read_ping = &mbr_rt_hsuricen;
-	mb_io_ptr->mb_io_write_ping = &mbr_wt_hsuricen;
-	mb_io_ptr->mb_io_dimensions = &mbsys_hsds_dimensions;
-	mb_io_ptr->mb_io_extract = &mbsys_hsds_extract;
-	mb_io_ptr->mb_io_insert = &mbsys_hsds_insert;
-	mb_io_ptr->mb_io_extract_nav = &mbsys_hsds_extract_nav;
-	mb_io_ptr->mb_io_insert_nav = &mbsys_hsds_insert_nav;
-	mb_io_ptr->mb_io_extract_altitude = &mbsys_hsds_extract_altitude;
-	mb_io_ptr->mb_io_insert_altitude = NULL;
-	mb_io_ptr->mb_io_extract_svp = NULL;
-	mb_io_ptr->mb_io_insert_svp = NULL;
-	mb_io_ptr->mb_io_ttimes = &mbsys_hsds_ttimes;
-	mb_io_ptr->mb_io_detects = &mbsys_hsds_detects;
-	mb_io_ptr->mb_io_copyrecord = &mbsys_hsds_copy;
-	mb_io_ptr->mb_io_extract_rawss = NULL;
-	mb_io_ptr->mb_io_insert_rawss = NULL;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",mb_io_ptr->system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",mb_io_ptr->beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",mb_io_ptr->beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",mb_io_ptr->pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",mb_io_ptr->format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",mb_io_ptr->system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",mb_io_ptr->format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",mb_io_ptr->numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",mb_io_ptr->filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",mb_io_ptr->variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",mb_io_ptr->traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",mb_io_ptr->beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",mb_io_ptr->nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",mb_io_ptr->heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",mb_io_ptr->vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",mb_io_ptr->svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",mb_io_ptr->beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",mb_io_ptr->beamwidth_ltrack);
-		fprintf(stderr,"dbg2       format_alloc:       %p\n",(void *)mb_io_ptr->mb_io_format_alloc);
-		fprintf(stderr,"dbg2       format_free:        %p\n",(void *)mb_io_ptr->mb_io_format_free);
-		fprintf(stderr,"dbg2       store_alloc:        %p\n",(void *)mb_io_ptr->mb_io_store_alloc);
-		fprintf(stderr,"dbg2       store_free:         %p\n",(void *)mb_io_ptr->mb_io_store_free);
-		fprintf(stderr,"dbg2       read_ping:          %p\n",(void *)mb_io_ptr->mb_io_read_ping);
-		fprintf(stderr,"dbg2       write_ping:         %p\n",(void *)mb_io_ptr->mb_io_write_ping);
-		fprintf(stderr,"dbg2       extract:            %p\n",(void *)mb_io_ptr->mb_io_extract);
-		fprintf(stderr,"dbg2       insert:             %p\n",(void *)mb_io_ptr->mb_io_insert);
-		fprintf(stderr,"dbg2       extract_nav:        %p\n",(void *)mb_io_ptr->mb_io_extract_nav);
-		fprintf(stderr,"dbg2       insert_nav:         %p\n",(void *)mb_io_ptr->mb_io_insert_nav);
-		fprintf(stderr,"dbg2       extract_altitude:   %p\n",(void *)mb_io_ptr->mb_io_extract_altitude);
-		fprintf(stderr,"dbg2       insert_altitude:    %p\n",(void *)mb_io_ptr->mb_io_insert_altitude);
-		fprintf(stderr,"dbg2       extract_svp:        %p\n",(void *)mb_io_ptr->mb_io_extract_svp);
-		fprintf(stderr,"dbg2       insert_svp:         %p\n",(void *)mb_io_ptr->mb_io_insert_svp);
-		fprintf(stderr,"dbg2       ttimes:             %p\n",(void *)mb_io_ptr->mb_io_ttimes);
-		fprintf(stderr,"dbg2       detects:            %p\n",(void *)mb_io_ptr->mb_io_detects);
-		fprintf(stderr,"dbg2       extract_rawss:      %p\n",(void *)mb_io_ptr->mb_io_extract_rawss);
-		fprintf(stderr,"dbg2       insert_rawss:       %p\n",(void *)mb_io_ptr->mb_io_insert_rawss);
-		fprintf(stderr,"dbg2       copyrecord:         %p\n",(void *)mb_io_ptr->mb_io_copyrecord);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbr_info_hsuricen(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error)
-{
-	char	*function_name = "mbr_info_hsuricen";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* set format info parameters */
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-	*system = MB_SYS_HSDS;
-	*beams_bath_max = 59;
-	*beams_amp_max = 0;
-	*pixels_ss_max = 0;
-	strncpy(format_name, "HSURICEN", MB_NAME_LENGTH);
-	strncpy(system_name, "HSDS", MB_NAME_LENGTH);
-	strncpy(format_description, "Format name:          MBF_HSURICEN\nInformal Description: URI Hydrosweep\nAttributes:           Hydrosweep DS, 59 beams, bathymetry, binary, URI.\n", MB_DESCRIPTION_LENGTH);
-	*numfile = 1;
-	*filetype = MB_FILETYPE_NORMAL;
-	*variable_beams = MB_NO;
-	*traveltime = MB_NO;
-	*beam_flagging = MB_YES;
-	*nav_source = MB_DATA_DATA;
-	*heading_source = MB_DATA_DATA;
-	*vru_source = MB_DATA_DATA;
-	*svp_source = MB_DATA_NONE;
-	*beamwidth_xtrack = 2.0;
-	*beamwidth_ltrack = 2.0;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",*system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",*beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",*beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",*pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",*numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",*filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",*variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",*traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",*beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",*nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",*heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",*vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",*svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",*beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",*beamwidth_ltrack);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_alm_hsuricen(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_alm_hsuricen";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set initial status */
-	status = MB_SUCCESS;
-
-	/* allocate memory for data structure */
-	mb_io_ptr->structure_size = sizeof(struct mbf_hsuricen_struct);
-	mb_io_ptr->data_structure_size =
-		sizeof(struct mbf_hsuricen_data_struct);
-	status = mb_malloc(verbose,mb_io_ptr->structure_size,
-				&mb_io_ptr->raw_data,error);
-	status = mb_malloc(verbose,sizeof(struct mbsys_hsds_struct),
-				&mb_io_ptr->store_data,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_dem_hsuricen(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_dem_hsuricen";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* deallocate memory for data descriptor */
-	status = mb_free(verbose,&mb_io_ptr->raw_data,error);
-	status = mb_free(verbose,&mb_io_ptr->store_data,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_rt_hsuricen(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_rt_hsuricen";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_hsuricen_struct *dataplus;
-	struct mbf_hsuricen_data_struct *data;
-	struct mbsys_hsds_struct *store;
-	char	*datacomment;
-	int	time_j[5];
-	int	i;
-	int	id;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	dataplus = (struct mbf_hsuricen_struct *) mb_io_ptr->raw_data;
-	data = &(dataplus->data);
-	datacomment = (char *) data;
-	dataplus->kind = MB_DATA_DATA;
-	store = (struct mbsys_hsds_struct *) store_ptr;
-
-	/* set file position */
-	mb_io_ptr->file_pos = mb_io_ptr->file_bytes;
-
-	/* read next record from file */
-	if ((status = fread(data,1,mb_io_ptr->data_structure_size,
-			mb_io_ptr->mbfp)) == mb_io_ptr->data_structure_size)
-		{
-		mb_io_ptr->file_bytes += status;
-		status = MB_SUCCESS;
-		*error = MB_ERROR_NO_ERROR;
-		}
-	else
-		{
-		mb_io_ptr->file_bytes += status;
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	/* byte swap the data if necessary */
-#ifdef BYTESWAPPED
-	if (status == MB_SUCCESS && data->sec != 25443)
-		{
-		data->sec = mb_swap_short(data->sec);
-		data->min = mb_swap_short(data->min);
-		data->day = mb_swap_short(data->day);
-		data->year = mb_swap_short(data->year);
-		data->lat = mb_swap_int(data->lat);
-		data->lon = mb_swap_int(data->lon);
-		data->hdg = mb_swap_short(data->hdg);
-		data->course = mb_swap_short(data->course);
-		data->speed = mb_swap_short(data->speed);
-		data->pitch = mb_swap_short(data->pitch);
-		data->scale = mb_swap_short(data->scale);
-		for (i=0;i<MBSYS_HSDS_BEAMS;i++)
-			{
-			data->dist[i] = mb_swap_short(data->dist[i]);
-			data->deph[i] = mb_swap_short(data->deph[i]);
-			}
-		}
-#endif
-
-	/* check for comment or unintelligible records */
-	if (status == MB_SUCCESS)
-		{
-		if (data->sec == 25443)
-			{
-			dataplus->kind = MB_DATA_COMMENT;
-			}
-		else if (data->year == 0)
-			{
-			dataplus->kind = MB_DATA_NONE;
-			status = MB_FAILURE;
-			*error = MB_ERROR_UNINTELLIGIBLE;
-			}
-		else
-			{
-			dataplus->kind = MB_DATA_DATA;
-			}
-		}
-
-	/* set kind and error in mb_io_ptr */
-	mb_io_ptr->new_kind = dataplus->kind;
-	mb_io_ptr->new_error = *error;
-
-	/* translate values to hydrosweep data storage structure */
-	if (status == MB_SUCCESS
-		&& store != NULL)
-		{
-		/* type of data record */
-		store->kind = dataplus->kind;
-
-		/* time stamp (all records ) */
-		time_j[0] = data->year;
-		time_j[1] = data->day;
-		time_j[2] = data->min;
-		time_j[3] = data->sec/100;
-		time_j[4] = 10000*(data->sec - 100*time_j[3]);
-		mb_get_itime(verbose,time_j,mb_io_ptr->new_time_i);
-		mb_get_time(verbose,mb_io_ptr->new_time_i,
-			&(mb_io_ptr->new_time_d));
-		store->year = mb_io_ptr->new_time_i[0];
-		store->month = mb_io_ptr->new_time_i[1];
-		store->day = mb_io_ptr->new_time_i[2];
-		store->hour = mb_io_ptr->new_time_i[3];
-		store->minute = mb_io_ptr->new_time_i[4];
-		store->second = mb_io_ptr->new_time_i[5];
-		store->alt_minute = 0;
-		store->alt_second = 0;
-
-		/* position (all records ) */
-		store->lon = 0.0000001*data->lon;
-		store->lat = 0.0000001*data->lat;
-		if (store->lon > 180.)
-			store->lon = store->lon - 360.;
-		else if (store->lon < -180.)
-			store->lon = store->lon + 360.;
-
-		/* additional navigation and depths (ERGNMESS and ERGNEICH) */
-		store->course_true = 0.1*data->hdg;
-		store->speed_transverse = 0.0;
-		store->speed = 0.005092593*data->speed;
-		store->speed_reference[0] = data->speed_ref;
-		store->pitch = 0.1*data->pitch;
-		store->track = 0;
-		store->depth_scale = 0.01*data->scale;
-		store->depth_center
-			= store->depth_scale * data->deph[MBSYS_HSDS_BEAMS/2];
-		store->spare = 1;
-		id = MBSYS_HSDS_BEAMS - 1;
-		for (i=0;i<MBSYS_HSDS_BEAMS;i++)
-			{
-			store->distance[i] = data->dist[i];
-			store->depth[i] = data->deph[i];
-			}
-/*		for (i=0;i<MBSYS_HSDS_BEAMS;i++)
-			{
-			store->distance[id-i] = data->dist[i];
-			store->depth[id-i] = data->deph[i];
-			}*/
-
-		/* travel time data (ERGNSLZT) */
-		store->course_ground = 0.1*data->course;
-		store->speed_ground = 0.0;
-		store->heave = 0.0;
-		store->roll = 0.0;
-		store->time_center = 0.0;
-		store->time_scale = 0.0;
-		for (i=0;i<MBSYS_HSDS_BEAMS;i++)
-			store->time[i] = 0;
-		for (i=0;i<11;i++)
-			store->gyro[i] = 0.0;
-
-		/* amplitude data (ERGNAMPL) */
-		store->mode[0] = '\0';
-		store->trans_strbd = 0;
-		store->trans_vert = 0;
-		store->trans_port = 0;
-		store->pulse_len_strbd = 0;
-		store->pulse_len_vert = 0;
-		store->pulse_len_port = 0;
-		store->gain_start = 0;
-		store->r_compensation_factor = 0;
-		store->compensation_start = 0;
-		store->increase_start = 0;
-		store->tvc_near = 0;
-		store->tvc_far = 0;
-		store->increase_int_near = 0;
-		store->increase_int_far = 0;
-		store->gain_center = 0;
-		store->filter_gain = 0.0;
-		store->amplitude_center = 0;
-		store->echo_duration_center = 0;
-		store->echo_scale_center = 0;
-		for (i=0;i<MBSYS_HSDS_BEAMS;i++)
-			{
-			store->amplitude[i] = 0;
-			store->echo_duration[i] = 0;
-			}
-		for (i=0;i<16;i++)
-			{
-			store->gain[i] = 0;
-			store->echo_scale[i] = 0;
-			}
-
-		/* mean velocity (ERGNHYDI) */
-		store->draught = 0.0;
-		store->vel_mean = 0.0;
-		store->vel_keel = 0.0;
-		store->tide = 0.0;
-
-		/* water velocity profile (HS_ERGNCTDS) */
-		store->num_vel = 0.0;
-
-		/* navigation source (ERGNPOSI) */
-		store->pos_corr_x = 0.0;
-		store->pos_corr_y = 0.0;
-		strncpy(store->sensors,"\0",8);
-
-		/* comment (LDEOCMNT) */
-		strncpy(store->comment,&datacomment[2],
-			MBSYS_HSDS_MAXLINE);
-
-		/* processed backscatter */
-		store->back_scale = 0.0;
-		for (i=0;i<MBSYS_HSDS_BEAMS;i++)
-			store->back[i] = 0;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_wt_hsuricen(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_wt_hsuricen";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_hsuricen_struct *dataplus;
-	struct mbf_hsuricen_data_struct *data;
-	struct mbsys_hsds_struct *store;
-	char	*datacomment;
-	int	time_i[7];
-	int	time_j[5];
-	int	i;
-	int	id;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	dataplus = (struct mbf_hsuricen_struct *) mb_io_ptr->raw_data;
-	data = &(dataplus->data);
-	datacomment = (char *) data;
-	store = (struct mbsys_hsds_struct *) store_ptr;
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Status at beginning of MBIO function <%s>\n",function_name);
-		if (store != NULL)
-			fprintf(stderr,"dbg5       store->kind:    %d\n",
-				store->kind);
-		fprintf(stderr,"dbg5       new_kind:       %d\n",
-			mb_io_ptr->new_kind);
-		fprintf(stderr,"dbg5       new_error:      %d\n",
-			mb_io_ptr->new_error);
-		fprintf(stderr,"dbg5       error:          %d\n",*error);
-		fprintf(stderr,"dbg5       status:         %d\n",status);
-		}
-
-	/* first set some plausible amounts for some of the
-		variables in the HSURICEN record */
-	data->course = 0;
-	data->pitch = 0;
-	data->scale = 100;	/* this is a unit scale factor */
-	data->speed_ref = 'B';	/* assume speed is over the ground */
-	data->quality = 0;
-
-	/* second translate values from hydrosweep data storage structure */
-	if (store != NULL)
-		{
-		dataplus->kind = store->kind;
-		if (store->kind == MB_DATA_DATA)
-			{
-			/* position */
-			if (store->lon < -180.0)
-				store->lon = store->lon + 360.0;
-			if (store->lon > 180.0)
-				store->lon = store->lon - 360.0;
-			data->lon = (int)(0.5 + 10000000.0*store->lon);
-			data->lat = (int)(0.5 + 10000000.0*store->lat);
-
-			/* time stamp */
-			time_i[0] = store->year;
-			time_i[1] = store->month;
-			time_i[2] = store->day;
-			time_i[3] = store->hour;
-			time_i[4] = store->minute;
-			time_i[5] = store->second;
-			time_i[6] = 0;
-			mb_get_jtime(verbose,time_i,time_j);
-			data->year = time_j[0];
-			data->day = time_j[1];
-			data->min = time_j[2];
-			data->sec = 100*time_j[3] + 0.0001*time_j[4];
-
-			/* additional navigation and depths */
-			data->hdg = 10.0*store->course_true;
-			data->course = 10.0*store->course_ground;
-			data->speed = 196.36363636363*store->speed;
-			data->speed_ref = store->speed_reference[0];
-			data->pitch = 10.0*store->pitch;
-			data->scale = 100*store->depth_scale;
-			id = MBSYS_HSDS_BEAMS - 1;
-			for (i=0;i<MBSYS_HSDS_BEAMS;i++)
-				{
-				data->dist[i] = store->distance[i];
-				data->deph[i] = store->depth[i];
-				}
-/*			for (i=0;i<MBSYS_HSDS_BEAMS;i++)
-				{
-				data->dist[i] = store->distance[id-i];
-				data->deph[i] = store->depth[id-i];
-				}*/
-			}
-
-		/* comment */
-		else if (store->kind == MB_DATA_COMMENT)
-			{
-			strcpy(datacomment,"cc");
-			strncat(datacomment,store->comment,MBSYS_HSDS_MAXLINE);
-			}
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Ready to write data in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       kind:       %d\n",
-			dataplus->kind);
-		fprintf(stderr,"dbg5       error:      %d\n",*error);
-		fprintf(stderr,"dbg5       status:     %d\n",status);
-		}
-
-	/* byte swap the data if necessary */
-#ifdef BYTESWAPPED
-	if (dataplus->kind == MB_DATA_DATA)
-		{
-		data->sec = mb_swap_short(data->sec);
-		data->min = mb_swap_short(data->min);
-		data->day = mb_swap_short(data->day);
-		data->year = mb_swap_short(data->year);
-		data->lat = mb_swap_int(data->lat);
-		data->lon = mb_swap_int(data->lon);
-		data->hdg = mb_swap_short(data->hdg);
-		data->course = mb_swap_short(data->course);
-		data->speed = mb_swap_short(data->speed);
-		data->pitch = mb_swap_short(data->pitch);
-		data->scale = mb_swap_short(data->scale);
-		for (i=0;i<MBSYS_HSDS_BEAMS;i++)
-			{
-			data->dist[i] = mb_swap_short(data->dist[i]);
-			data->deph[i] = mb_swap_short(data->deph[i]);
-			}
-		}
-#endif
-
-	/* write next record to file */
-	if (dataplus->kind == MB_DATA_DATA
-		|| dataplus->kind == MB_DATA_COMMENT)
-		{
-		if ((status = fwrite(data,1,mb_io_ptr->data_structure_size,
-				mb_io_ptr->mbfp))
-				== mb_io_ptr->data_structure_size)
-			{
-			status = MB_SUCCESS;
-			*error = MB_ERROR_NO_ERROR;
-			}
-		else
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_WRITE_FAIL;
-			}
-		}
-	else
-		{
-		status = MB_SUCCESS;
-		*error = MB_ERROR_NO_ERROR;
-		if (verbose >= 5)
-			fprintf(stderr,"\ndbg5  No data written in MBIO function <%s>\n",function_name);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mbr_hsurivax.c b/src/mbio/mbr_hsurivax.c
deleted file mode 100644
index 1cbcaae..0000000
--- a/src/mbio/mbr_hsurivax.c
+++ /dev/null
@@ -1,854 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbr_hsurivax.c	2/2/93
- *	$Id: mbr_hsurivax.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1993-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbr_hsurivax.c contains the functions for reading and writing
- * multibeam data in the HSURICEN format.   The only difference between
- * the HSURIVAX format and the HSURICEN format is that the data files
- * are stored in VAX byte order ("little endian"). This is why the
- * format structure definitions are taken from the include file
- * mbf_hsuricen.h.
- * These functions include:
- *   mbr_alm_hsurivax	- allocate read/write memory
- *   mbr_dem_hsurivax	- deallocate read/write memory
- *   mbr_rt_hsurivax	- read and translate data
- *   mbr_wt_hsurivax	- translate and write data
- *
- * Author:	D. W. Caress
- * Date:	February 2, 1993
- * $Log: mbr_hsurivax.c,v $
- * Revision 5.9  2005/11/05 00:48:05  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.8  2003/05/20 18:05:32  caress
- * Added svp_source to data source parameters.
- *
- * Revision 5.7  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.6  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.5  2002/03/26 07:43:25  caress
- * Release 5.0.beta15
- *
- * Revision 5.4  2002/02/26 07:50:41  caress
- * Release 5.0.beta14
- *
- * Revision 5.3  2001/07/20 00:32:54  caress
- * Release 5.0.beta03
- *
- * Revision 5.2  2001/03/22  20:50:02  caress
- * Trying to make version 5.0.beta0
- *
- * Revision 5.1  2001/01/22  07:43:34  caress
- * Version 5.0.beta01
- *
- * Revision 5.0  2000/12/01  22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.9  2000/10/11  01:03:21  caress
- * Convert to ANSI C
- *
- * Revision 4.8  2000/09/30  06:34:20  caress
- * Snapshot for Dale.
- *
- * Revision 4.7  1998/10/05  17:46:15  caress
- * MB-System version 4.6beta
- *
- * Revision 4.6  1997/07/25  14:19:53  caress
- * Version 4.5beta2.
- * Much mucking, particularly with Simrad formats.
- *
- * Revision 4.5  1997/04/21  17:02:07  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.4  1996/04/22  13:21:19  caress
- * Now have DTR and MIN/MAX defines in mb_define.h
- *
- * Revision 4.4  1996/04/22  13:21:19  caress
- * Now have DTR and MIN/MAX defines in mb_define.h
- *
- * Revision 4.3  1995/03/17  15:12:59  caress
- * Changes related to handling early, problematic
- * Ewing Hydrosweep data.
- *
- * Revision 4.2  1995/03/06  19:38:54  caress
- * Changed include strings.h to string.h for POSIX compliance.
- *
- * Revision 4.1  1994/10/21  12:20:01  caress
- * Release V4.0
- *
- * Revision 4.0  1994/07/29  18:59:33  caress
- * Initial Revision.
- *
- * Revision 1.1  1994/07/29  18:46:51  caress
- * Initial revision
- *
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mb_define.h"
-#include "mbsys_hsds.h"
-#include "mbf_hsuricen.h"
-
-/* include for byte swapping on little-endian machines */
-#ifndef BYTESWAPPED
-#include "mb_swap.h"
-#endif
-
-/* essential function prototypes */
-int mbr_register_hsurivax(int verbose, void *mbio_ptr,
-		int *error);
-int mbr_info_hsurivax(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_alm_hsurivax(int verbose, void *mbio_ptr, int *error);
-int mbr_dem_hsurivax(int verbose, void *mbio_ptr, int *error);
-int mbr_rt_hsurivax(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_wt_hsurivax(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-
-static char rcs_id[]="$Id: mbr_hsurivax.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mbr_register_hsurivax(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_register_hsurivax";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* get mb_io_ptr */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set format info parameters */
-	status = mbr_info_hsurivax(verbose,
-			&mb_io_ptr->system,
-			&mb_io_ptr->beams_bath_max,
-			&mb_io_ptr->beams_amp_max,
-			&mb_io_ptr->pixels_ss_max,
-			mb_io_ptr->format_name,
-			mb_io_ptr->system_name,
-			mb_io_ptr->format_description,
-			&mb_io_ptr->numfile,
-			&mb_io_ptr->filetype,
-			&mb_io_ptr->variable_beams,
-			&mb_io_ptr->traveltime,
-			&mb_io_ptr->beam_flagging,
-			&mb_io_ptr->nav_source,
-			&mb_io_ptr->heading_source,
-			&mb_io_ptr->vru_source,
-			&mb_io_ptr->svp_source,
-			&mb_io_ptr->beamwidth_xtrack,
-			&mb_io_ptr->beamwidth_ltrack,
-			error);
-
-	/* set format and system specific function pointers */
-	mb_io_ptr->mb_io_format_alloc = &mbr_alm_hsurivax;
-	mb_io_ptr->mb_io_format_free = &mbr_dem_hsurivax;
-	mb_io_ptr->mb_io_store_alloc = &mbsys_hsds_alloc;
-	mb_io_ptr->mb_io_store_free = &mbsys_hsds_deall;
-	mb_io_ptr->mb_io_read_ping = &mbr_rt_hsurivax;
-	mb_io_ptr->mb_io_write_ping = &mbr_wt_hsurivax;
-	mb_io_ptr->mb_io_dimensions = &mbsys_hsds_dimensions;
-	mb_io_ptr->mb_io_extract = &mbsys_hsds_extract;
-	mb_io_ptr->mb_io_insert = &mbsys_hsds_insert;
-	mb_io_ptr->mb_io_extract_nav = &mbsys_hsds_extract_nav;
-	mb_io_ptr->mb_io_insert_nav = &mbsys_hsds_insert_nav;
-	mb_io_ptr->mb_io_extract_altitude = &mbsys_hsds_extract_altitude;
-	mb_io_ptr->mb_io_insert_altitude = NULL;
-	mb_io_ptr->mb_io_extract_svp = NULL;
-	mb_io_ptr->mb_io_insert_svp = NULL;
-	mb_io_ptr->mb_io_ttimes = &mbsys_hsds_ttimes;
-	mb_io_ptr->mb_io_detects = &mbsys_hsds_detects;
-	mb_io_ptr->mb_io_copyrecord = &mbsys_hsds_copy;
-	mb_io_ptr->mb_io_extract_rawss = NULL;
-	mb_io_ptr->mb_io_insert_rawss = NULL;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",mb_io_ptr->system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",mb_io_ptr->beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",mb_io_ptr->beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",mb_io_ptr->pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",mb_io_ptr->format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",mb_io_ptr->system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",mb_io_ptr->format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",mb_io_ptr->numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",mb_io_ptr->filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",mb_io_ptr->variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",mb_io_ptr->traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",mb_io_ptr->beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",mb_io_ptr->nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",mb_io_ptr->heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",mb_io_ptr->vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",mb_io_ptr->svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",mb_io_ptr->beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",mb_io_ptr->beamwidth_ltrack);
-		fprintf(stderr,"dbg2       format_alloc:       %p\n",(void *)mb_io_ptr->mb_io_format_alloc);
-		fprintf(stderr,"dbg2       format_free:        %p\n",(void *)mb_io_ptr->mb_io_format_free);
-		fprintf(stderr,"dbg2       store_alloc:        %p\n",(void *)mb_io_ptr->mb_io_store_alloc);
-		fprintf(stderr,"dbg2       store_free:         %p\n",(void *)mb_io_ptr->mb_io_store_free);
-		fprintf(stderr,"dbg2       read_ping:          %p\n",(void *)mb_io_ptr->mb_io_read_ping);
-		fprintf(stderr,"dbg2       write_ping:         %p\n",(void *)mb_io_ptr->mb_io_write_ping);
-		fprintf(stderr,"dbg2       extract:            %p\n",(void *)mb_io_ptr->mb_io_extract);
-		fprintf(stderr,"dbg2       insert:             %p\n",(void *)mb_io_ptr->mb_io_insert);
-		fprintf(stderr,"dbg2       extract_nav:        %p\n",(void *)mb_io_ptr->mb_io_extract_nav);
-		fprintf(stderr,"dbg2       insert_nav:         %p\n",(void *)mb_io_ptr->mb_io_insert_nav);
-		fprintf(stderr,"dbg2       extract_altitude:   %p\n",(void *)mb_io_ptr->mb_io_extract_altitude);
-		fprintf(stderr,"dbg2       insert_altitude:    %p\n",(void *)mb_io_ptr->mb_io_insert_altitude);
-		fprintf(stderr,"dbg2       extract_svp:        %p\n",(void *)mb_io_ptr->mb_io_extract_svp);
-		fprintf(stderr,"dbg2       insert_svp:         %p\n",(void *)mb_io_ptr->mb_io_insert_svp);
-		fprintf(stderr,"dbg2       ttimes:             %p\n",(void *)mb_io_ptr->mb_io_ttimes);
-		fprintf(stderr,"dbg2       detects:            %p\n",(void *)mb_io_ptr->mb_io_detects);
-		fprintf(stderr,"dbg2       extract_rawss:      %p\n",(void *)mb_io_ptr->mb_io_extract_rawss);
-		fprintf(stderr,"dbg2       insert_rawss:       %p\n",(void *)mb_io_ptr->mb_io_insert_rawss);
-		fprintf(stderr,"dbg2       copyrecord:         %p\n",(void *)mb_io_ptr->mb_io_copyrecord);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbr_info_hsurivax(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error)
-{
-	char	*function_name = "mbr_info_hsurivax";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* set format info parameters */
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-	*system = MB_SYS_HSDS;
-	*beams_bath_max = 59;
-	*beams_amp_max = 0;
-	*pixels_ss_max = 0;
-	strncpy(format_name, "HSURIVAX", MB_NAME_LENGTH);
-	strncpy(system_name, "HSDS", MB_NAME_LENGTH);
-	strncpy(format_description, "Format name:          MBF_HSURIVAX\nInformal Description: URI Hydrosweep from VAX\nAttributes:           Hydrosweep DS, 59 beams, bathymetry, binary,\n                      VAX byte order, URI.\n", MB_DESCRIPTION_LENGTH);
-	*numfile = 1;
-	*filetype = MB_FILETYPE_NORMAL;
-	*variable_beams = MB_NO;
-	*traveltime = MB_NO;
-	*beam_flagging = MB_YES;
-	*nav_source = MB_DATA_DATA;
-	*heading_source = MB_DATA_DATA;
-	*vru_source = MB_DATA_DATA;
-	*svp_source = MB_DATA_NONE;
-	*beamwidth_xtrack = 2.0;
-	*beamwidth_ltrack = 2.0;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",*system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",*beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",*beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",*pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",*numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",*filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",*variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",*traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",*beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",*nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",*heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",*vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",*svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",*beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",*beamwidth_ltrack);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_alm_hsurivax(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_alm_hsurivax";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set initial status */
-	status = MB_SUCCESS;
-
-	/* allocate memory for data structure */
-	mb_io_ptr->structure_size = sizeof(struct mbf_hsuricen_struct);
-	mb_io_ptr->data_structure_size =
-		sizeof(struct mbf_hsuricen_data_struct);
-	status = mb_malloc(verbose,mb_io_ptr->structure_size,
-				&mb_io_ptr->raw_data,error);
-	status = mb_malloc(verbose,sizeof(struct mbsys_hsds_struct),
-				&mb_io_ptr->store_data,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_dem_hsurivax(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_dem_hsurivax";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* deallocate memory for data descriptor */
-	status = mb_free(verbose,&mb_io_ptr->raw_data,error);
-	status = mb_free(verbose,&mb_io_ptr->store_data,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_rt_hsurivax(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_rt_hsurivax";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_hsuricen_struct *dataplus;
-	struct mbf_hsuricen_data_struct *data;
-	struct mbsys_hsds_struct *store;
-	char	*datacomment;
-	int	time_j[5];
-	int	i;
-	int	id;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	dataplus = (struct mbf_hsuricen_struct *) mb_io_ptr->raw_data;
-	data = &(dataplus->data);
-	datacomment = (char *) data;
-	dataplus->kind = MB_DATA_DATA;
-	store = (struct mbsys_hsds_struct *) store_ptr;
-
-	/* set file position */
-	mb_io_ptr->file_pos = mb_io_ptr->file_bytes;
-
-	/* read next record from file */
-	if ((status = fread(data,1,mb_io_ptr->data_structure_size,
-			mb_io_ptr->mbfp)) == mb_io_ptr->data_structure_size)
-		{
-		mb_io_ptr->file_bytes += status;
-		status = MB_SUCCESS;
-		*error = MB_ERROR_NO_ERROR;
-		}
-	else
-		{
-		mb_io_ptr->file_bytes += status;
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	/* byte swap the data if necessary */
-#ifndef BYTESWAPPED
-	if (status == MB_SUCCESS && data->sec != 25443)
-		{
-		data->sec = mb_swap_short(data->sec);
-		data->min = mb_swap_short(data->min);
-		data->day = mb_swap_short(data->day);
-		data->year = mb_swap_short(data->year);
-		data->lat = mb_swap_int(data->lat);
-		data->lon = mb_swap_int(data->lon);
-		data->hdg = mb_swap_short(data->hdg);
-		data->course = mb_swap_short(data->course);
-		data->speed = mb_swap_short(data->speed);
-		data->pitch = mb_swap_short(data->pitch);
-		data->scale = mb_swap_short(data->scale);
-		for (i=0;i<MBSYS_HSDS_BEAMS;i++)
-			{
-			data->dist[i] = mb_swap_short(data->dist[i]);
-			data->deph[i] = mb_swap_short(data->deph[i]);
-			}
-		}
-#endif
-
-	/* check for comment or unintelligible records */
-	if (status == MB_SUCCESS)
-		{
-		if (data->sec == 25443)
-			{
-			dataplus->kind = MB_DATA_COMMENT;
-			}
-		else if (data->year == 0)
-			{
-			dataplus->kind = MB_DATA_NONE;
-			status = MB_FAILURE;
-			*error = MB_ERROR_UNINTELLIGIBLE;
-			}
-		else
-			{
-			dataplus->kind = MB_DATA_DATA;
-			}
-		}
-
-	/* set kind and error in mb_io_ptr */
-	mb_io_ptr->new_kind = dataplus->kind;
-	mb_io_ptr->new_error = *error;
-
-	/* translate values to hydrosweep data storage structure */
-	if (status == MB_SUCCESS
-		&& store != NULL)
-		{
-		/* type of data record */
-		store->kind = dataplus->kind;
-
-		/* time stamp (all records ) */
-		time_j[0] = data->year;
-		time_j[1] = data->day;
-		time_j[2] = data->min;
-		time_j[3] = data->sec/100;
-		time_j[4] = 10000*(data->sec - 100*time_j[3]);
-		mb_get_itime(verbose,time_j,mb_io_ptr->new_time_i);
-		mb_get_time(verbose,mb_io_ptr->new_time_i,
-			&(mb_io_ptr->new_time_d));
-		store->year = mb_io_ptr->new_time_i[0];
-		store->month = mb_io_ptr->new_time_i[1];
-		store->day = mb_io_ptr->new_time_i[2];
-		store->hour = mb_io_ptr->new_time_i[3];
-		store->minute = mb_io_ptr->new_time_i[4];
-		store->second = mb_io_ptr->new_time_i[5];
-		store->alt_minute = 0;
-		store->alt_second = 0;
-
-		/* position (all records ) */
-		store->lon = 0.0000001*data->lon;
-		store->lat = 0.0000001*data->lat;
-		if (store->lon > 180.)
-			store->lon = store->lon - 360.;
-		else if (store->lon < -180.)
-			store->lon = store->lon + 360.;
-
-		/* additional navigation and depths (ERGNMESS and ERGNEICH) */
-		store->course_true = 0.1*data->hdg;
-		store->speed_transverse = 0.0;
-		store->speed = 0.005092593*data->speed;
-		store->speed_reference[0] = data->speed_ref;
-		store->pitch = 0.1*data->pitch;
-		store->track = 0;
-		store->depth_scale = 0.01*data->scale;
-		store->depth_center
-			= store->depth_scale * data->deph[MBSYS_HSDS_BEAMS/2];
-		store->spare = 1;
-		id = MBSYS_HSDS_BEAMS - 1;
-		for (i=0;i<MBSYS_HSDS_BEAMS;i++)
-			{
-			store->distance[i] = data->dist[i];
-			store->depth[i] = data->deph[i];
-			}
-/*		for (i=0;i<MBSYS_HSDS_BEAMS;i++)
-			{
-			store->distance[id-i] = data->dist[i];
-			store->depth[id-i] = data->deph[i];
-			}*/
-
-		/* travel time data (ERGNSLZT) */
-		store->course_ground = 0.1*data->course;
-		store->speed_ground = 0.0;
-		store->heave = 0.0;
-		store->roll = 0.0;
-		store->time_center = 0.0;
-		store->time_scale = 0.0;
-		for (i=0;i<MBSYS_HSDS_BEAMS;i++)
-			store->time[i] = 0;
-		for (i=0;i<11;i++)
-			store->gyro[i] = 0.0;
-
-		/* amplitude data (ERGNAMPL) */
-		store->mode[0] = '\0';
-		store->trans_strbd = 0;
-		store->trans_vert = 0;
-		store->trans_port = 0;
-		store->pulse_len_strbd = 0;
-		store->pulse_len_vert = 0;
-		store->pulse_len_port = 0;
-		store->gain_start = 0;
-		store->r_compensation_factor = 0;
-		store->compensation_start = 0;
-		store->increase_start = 0;
-		store->tvc_near = 0;
-		store->tvc_far = 0;
-		store->increase_int_near = 0;
-		store->increase_int_far = 0;
-		store->gain_center = 0;
-		store->filter_gain = 0.0;
-		store->amplitude_center = 0;
-		store->echo_duration_center = 0;
-		store->echo_scale_center = 0;
-		for (i=0;i<MBSYS_HSDS_BEAMS;i++)
-			{
-			store->amplitude[i] = 0;
-			store->echo_duration[i] = 0;
-			}
-		for (i=0;i<16;i++)
-			{
-			store->gain[i] = 0;
-			store->echo_scale[i] = 0;
-			}
-
-		/* mean velocity (ERGNHYDI) */
-		store->draught = 0.0;
-		store->vel_mean = 0.0;
-		store->vel_keel = 0.0;
-		store->tide = 0.0;
-
-		/* water velocity profile (HS_ERGNCTDS) */
-		store->num_vel = 0.0;
-
-		/* navigation source (ERGNPOSI) */
-		store->pos_corr_x = 0.0;
-		store->pos_corr_y = 0.0;
-		strncpy(store->sensors,"\0",8);
-
-		/* comment (LDEOCMNT) */
-		strncpy(store->comment,&datacomment[2],
-			MBSYS_HSDS_MAXLINE);
-
-		/* processed backscatter */
-		store->back_scale = 0.0;
-		for (i=0;i<MBSYS_HSDS_BEAMS;i++)
-			store->back[i] = 0;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_wt_hsurivax(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_wt_hsurivax";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_hsuricen_struct *dataplus;
-	struct mbf_hsuricen_data_struct *data;
-	struct mbsys_hsds_struct *store;
-	char	*datacomment;
-	int	time_i[7];
-	int	time_j[5];
-	int	i;
-	int	id;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	dataplus = (struct mbf_hsuricen_struct *) mb_io_ptr->raw_data;
-	data = &(dataplus->data);
-	datacomment = (char *) data;
-	store = (struct mbsys_hsds_struct *) store_ptr;
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Status at beginning of MBIO function <%s>\n",function_name);
-		if (store != NULL)
-			fprintf(stderr,"dbg5       store->kind:    %d\n",
-				store->kind);
-		fprintf(stderr,"dbg5       new_kind:       %d\n",
-			mb_io_ptr->new_kind);
-		fprintf(stderr,"dbg5       new_error:      %d\n",
-			mb_io_ptr->new_error);
-		fprintf(stderr,"dbg5       error:          %d\n",*error);
-		fprintf(stderr,"dbg5       status:         %d\n",status);
-		}
-
-	/* first set some plausible amounts for some of the
-		variables in the HSURICEN record */
-	data->course = 0;
-	data->pitch = 0;
-	data->scale = 100;	/* this is a unit scale factor */
-	data->speed_ref = 'B';	/* assume speed is over the ground */
-	data->quality = 0;
-
-	/* second translate values from hydrosweep data storage structure */
-	if (store != NULL)
-		{
-		dataplus->kind = store->kind;
-		if (store->kind == MB_DATA_DATA)
-			{
-			/* position */
-			if (store->lon < -180.0)
-				store->lon = store->lon + 360.0;
-			if (store->lon > 180.0)
-				store->lon = store->lon - 360.0;
-			data->lon = (int)(0.5 + 10000000.0*store->lon);
-			data->lat = (int)(0.5 + 10000000.0*store->lat);
-
-			/* time stamp */
-			time_i[0] = store->year;
-			time_i[1] = store->month;
-			time_i[2] = store->day;
-			time_i[3] = store->hour;
-			time_i[4] = store->minute;
-			time_i[5] = store->second;
-			time_i[6] = 0;
-			mb_get_jtime(verbose,time_i,time_j);
-			data->year = time_j[0];
-			data->day = time_j[1];
-			data->min = time_j[2];
-			data->sec = 100*time_j[3] + 0.0001*time_j[4];
-
-			/* additional navigation and depths */
-			data->hdg = 10.0*store->course_true;
-			data->course = 10.0*store->course_ground;
-			data->speed = 196.36363636363*store->speed;
-			data->speed_ref = store->speed_reference[0];
-			data->pitch = 10.0*store->pitch;
-			data->scale = 100*store->depth_scale;
-			id = MBSYS_HSDS_BEAMS - 1;
-			for (i=0;i<MBSYS_HSDS_BEAMS;i++)
-				{
-				data->dist[i] = store->distance[i];
-				data->deph[i] = store->depth[i];
-				}
-/*			for (i=0;i<MBSYS_HSDS_BEAMS;i++)
-				{
-				data->dist[i] = store->distance[id-i];
-				data->deph[i] = store->depth[id-i];
-				}*/
-			}
-
-		/* comment */
-		else if (store->kind == MB_DATA_COMMENT)
-			{
-			strcpy(datacomment,"cc");
-			strncat(datacomment,store->comment,MBSYS_HSDS_MAXLINE);
-			}
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Ready to write data in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       kind:       %d\n",
-			dataplus->kind);
-		fprintf(stderr,"dbg5       error:      %d\n",*error);
-		fprintf(stderr,"dbg5       status:     %d\n",status);
-		}
-
-	/* byte swap the data if necessary */
-#ifndef BYTESWAPPED
-	if (dataplus->kind == MB_DATA_DATA)
-		{
-		data->sec = mb_swap_short(data->sec);
-		data->min = mb_swap_short(data->min);
-		data->day = mb_swap_short(data->day);
-		data->year = mb_swap_short(data->year);
-		data->lat = mb_swap_int(data->lat);
-		data->lon = mb_swap_int(data->lon);
-		data->hdg = mb_swap_short(data->hdg);
-		data->course = mb_swap_short(data->course);
-		data->speed = mb_swap_short(data->speed);
-		data->pitch = mb_swap_short(data->pitch);
-		data->scale = mb_swap_short(data->scale);
-		for (i=0;i<MBSYS_HSDS_BEAMS;i++)
-			{
-			data->dist[i] = mb_swap_short(data->dist[i]);
-			data->deph[i] = mb_swap_short(data->deph[i]);
-			}
-		}
-#endif
-
-	/* write next record to file */
-	if (dataplus->kind == MB_DATA_DATA
-		|| dataplus->kind == MB_DATA_COMMENT)
-		{
-		if ((status = fwrite(data,1,mb_io_ptr->data_structure_size,
-				mb_io_ptr->mbfp))
-				== mb_io_ptr->data_structure_size)
-			{
-			status = MB_SUCCESS;
-			*error = MB_ERROR_NO_ERROR;
-			}
-		else
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_WRITE_FAIL;
-			}
-		}
-	else
-		{
-		status = MB_SUCCESS;
-		*error = MB_ERROR_NO_ERROR;
-		if (verbose >= 5)
-			fprintf(stderr,"\ndbg5  No data written in MBIO function <%s>\n",function_name);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mbr_hydrob93.c b/src/mbio/mbr_hydrob93.c
deleted file mode 100644
index 9d462e9..0000000
--- a/src/mbio/mbr_hydrob93.c
+++ /dev/null
@@ -1,608 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbr_hydrob93.c	9/19/2002
- *	$Id: mbr_hydrob93.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 2002-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbr_hydrob93.c contains the functions for reading and writing
- * hydrographic sounding data in the HYD93 Binary Format used by
- * the National Geophysical Data Center.
- * These functions include:
- *   mbr_alm_hydrob93	- allocate read/write memory
- *   mbr_dem_hydrob93	- deallocate read/write memory
- *   mbr_rt_hydrob93	- read and translate data
- *   mbr_wt_hydrob93	- translate and write data
- *
- * Author:	D. W. Caress
- * Date:	September 19, 2002
- *
- * $Log: mbr_hydrob93.c,v $
- * Revision 5.5  2008/07/10 06:43:40  caress
- * Preparing for 5.1.1beta20
- *
- * Revision 5.4  2005/11/05 00:48:04  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.3  2003/05/20 18:05:32  caress
- * Added svp_source to data source parameters.
- *
- * Revision 5.2  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.1  2002/09/20 17:45:43  caress
- * Release 5.0.beta23
- *
- * Revision 5.0  2002/09/19 22:18:06  caress
- * Initial Revision
- * l.
- * l
- *
- *
- *
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mb_define.h"
-#include "mbsys_singlebeam.h"
-
-/* local defines */
-#define MBF_HYDROB93_RECORD_LENGTH 14
-
-/* essential function prototypes */
-int mbr_register_hydrob93(int verbose, void *mbio_ptr,
-		int *error);
-int mbr_info_hydrob93(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_alm_hydrob93(int verbose, void *mbio_ptr, int *error);
-int mbr_dem_hydrob93(int verbose, void *mbio_ptr, int *error);
-int mbr_rt_hydrob93(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_wt_hydrob93(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-
-static char rcs_id[]="$Id: mbr_hydrob93.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mbr_register_hydrob93(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_register_hydrob93";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* get mb_io_ptr */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set format info parameters */
-	status = mbr_info_hydrob93(verbose,
-			&mb_io_ptr->system,
-			&mb_io_ptr->beams_bath_max,
-			&mb_io_ptr->beams_amp_max,
-			&mb_io_ptr->pixels_ss_max,
-			mb_io_ptr->format_name,
-			mb_io_ptr->system_name,
-			mb_io_ptr->format_description,
-			&mb_io_ptr->numfile,
-			&mb_io_ptr->filetype,
-			&mb_io_ptr->variable_beams,
-			&mb_io_ptr->traveltime,
-			&mb_io_ptr->beam_flagging,
-			&mb_io_ptr->nav_source,
-			&mb_io_ptr->heading_source,
-			&mb_io_ptr->vru_source,
-			&mb_io_ptr->svp_source,
-			&mb_io_ptr->beamwidth_xtrack,
-			&mb_io_ptr->beamwidth_ltrack,
-			error);
-
-	/* set format and system specific function pointers */
-	mb_io_ptr->mb_io_format_alloc = &mbr_alm_hydrob93;
-	mb_io_ptr->mb_io_format_free = &mbr_dem_hydrob93;
-	mb_io_ptr->mb_io_store_alloc = &mbsys_singlebeam_alloc;
-	mb_io_ptr->mb_io_store_free = &mbsys_singlebeam_deall;
-	mb_io_ptr->mb_io_read_ping = &mbr_rt_hydrob93;
-	mb_io_ptr->mb_io_write_ping = &mbr_wt_hydrob93;
-	mb_io_ptr->mb_io_dimensions = &mbsys_singlebeam_dimensions;
-	mb_io_ptr->mb_io_extract = &mbsys_singlebeam_extract;
-	mb_io_ptr->mb_io_insert = &mbsys_singlebeam_insert;
-	mb_io_ptr->mb_io_extract_nav = &mbsys_singlebeam_extract_nav;
-	mb_io_ptr->mb_io_insert_nav = &mbsys_singlebeam_insert_nav;
-	mb_io_ptr->mb_io_extract_altitude = &mbsys_singlebeam_extract_altitude;
-	mb_io_ptr->mb_io_insert_altitude = NULL;
-	mb_io_ptr->mb_io_extract_svp = NULL;
-	mb_io_ptr->mb_io_insert_svp = NULL;
-	mb_io_ptr->mb_io_ttimes = &mbsys_singlebeam_ttimes;
-	mb_io_ptr->mb_io_detects = &mbsys_singlebeam_detects;
-	mb_io_ptr->mb_io_copyrecord = &mbsys_singlebeam_copy;
-	mb_io_ptr->mb_io_extract_rawss = NULL;
-	mb_io_ptr->mb_io_insert_rawss = NULL;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",mb_io_ptr->system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",mb_io_ptr->beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",mb_io_ptr->beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",mb_io_ptr->pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",mb_io_ptr->format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",mb_io_ptr->system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",mb_io_ptr->format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",mb_io_ptr->numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",mb_io_ptr->filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",mb_io_ptr->variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",mb_io_ptr->traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",mb_io_ptr->beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",mb_io_ptr->nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",mb_io_ptr->heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",mb_io_ptr->vru_source);
-		fprintf(stderr,"dbg2       svp_source:     %d\n",mb_io_ptr->svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",mb_io_ptr->beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",mb_io_ptr->beamwidth_ltrack);
-		fprintf(stderr,"dbg2       format_alloc:       %p\n",(void *)mb_io_ptr->mb_io_format_alloc);
-		fprintf(stderr,"dbg2       format_free:        %p\n",(void *)mb_io_ptr->mb_io_format_free);
-		fprintf(stderr,"dbg2       store_alloc:        %p\n",(void *)mb_io_ptr->mb_io_store_alloc);
-		fprintf(stderr,"dbg2       store_free:         %p\n",(void *)mb_io_ptr->mb_io_store_free);
-		fprintf(stderr,"dbg2       read_ping:          %p\n",(void *)mb_io_ptr->mb_io_read_ping);
-		fprintf(stderr,"dbg2       write_ping:         %p\n",(void *)mb_io_ptr->mb_io_write_ping);
-		fprintf(stderr,"dbg2       extract:            %p\n",(void *)mb_io_ptr->mb_io_extract);
-		fprintf(stderr,"dbg2       insert:             %p\n",(void *)mb_io_ptr->mb_io_insert);
-		fprintf(stderr,"dbg2       extract_nav:        %p\n",(void *)mb_io_ptr->mb_io_extract_nav);
-		fprintf(stderr,"dbg2       insert_nav:         %p\n",(void *)mb_io_ptr->mb_io_insert_nav);
-		fprintf(stderr,"dbg2       extract_altitude:   %p\n",(void *)mb_io_ptr->mb_io_extract_altitude);
-		fprintf(stderr,"dbg2       insert_altitude:    %p\n",(void *)mb_io_ptr->mb_io_insert_altitude);
-		fprintf(stderr,"dbg2       extract_svp:        %p\n",(void *)mb_io_ptr->mb_io_extract_svp);
-		fprintf(stderr,"dbg2       insert_svp:         %p\n",(void *)mb_io_ptr->mb_io_insert_svp);
-		fprintf(stderr,"dbg2       ttimes:             %p\n",(void *)mb_io_ptr->mb_io_ttimes);
-		fprintf(stderr,"dbg2       detects:            %p\n",(void *)mb_io_ptr->mb_io_detects);
-		fprintf(stderr,"dbg2       extract_rawss:      %p\n",(void *)mb_io_ptr->mb_io_extract_rawss);
-		fprintf(stderr,"dbg2       insert_rawss:       %p\n",(void *)mb_io_ptr->mb_io_insert_rawss);
-		fprintf(stderr,"dbg2       copyrecord:         %p\n",(void *)mb_io_ptr->mb_io_copyrecord);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbr_info_hydrob93(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error)
-{
-	char	*function_name = "mbr_info_hydrob93";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* set format info parameters */
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-	*system = MB_SYS_SINGLEBEAM;
-	*beams_bath_max = 1;
-	*beams_amp_max = 0;
-	*pixels_ss_max = 0;
-	strncpy(format_name, "HYDROB93", MB_NAME_LENGTH);
-	strncpy(system_name, "SINGLEBEAM", MB_NAME_LENGTH);
-	strncpy(format_description, "Format name:         MBF_HYDROB93\nInformal Description: NGDC binary hydrographic sounding format\nAttributes:           XYZ (lon lat depth) binary soundings\n", MB_DESCRIPTION_LENGTH);
-	*numfile = 1;
-	*filetype = MB_FILETYPE_NORMAL;
-	*variable_beams = MB_NO;
-	*traveltime = MB_NO;
-	*beam_flagging = MB_YES;
-	*nav_source = MB_DATA_DATA;
-	*heading_source = MB_DATA_DATA;
-	*vru_source = MB_DATA_DATA;
-	*svp_source = MB_DATA_NONE;
-	*beamwidth_xtrack = 5.0;
-	*beamwidth_ltrack = 5.0;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",*system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",*beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",*beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",*pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",*numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",*filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",*variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",*traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",*beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",*nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",*heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",*vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",*svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",*beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",*beamwidth_ltrack);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_alm_hydrob93(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_alm_hydrob93";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set initial status */
-	status = MB_SUCCESS;
-
-	/* allocate memory for data structure */
-	mb_io_ptr->structure_size = 0;
-	mb_io_ptr->data_structure_size = 0;
-	status = mb_mallocd(verbose,__FILE__,__LINE__,sizeof(struct mbsys_singlebeam_struct),
-				(void **)&mb_io_ptr->store_data,error);
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set number of header records read to zero */
-	mb_io_ptr->save1 = 0;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_dem_hydrob93(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_dem_hydrob93";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* deallocate memory for data descriptor */
-	status = mb_freed(verbose,__FILE__, __LINE__, (void **)&mb_io_ptr->store_data,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_rt_hydrob93(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_rt_hydrob93";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_singlebeam_struct *store;
-	char	line[MBF_HYDROB93_RECORD_LENGTH];
-	int	ilongitude, ilatitude, idepth;
-	short	itype;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointers to mbio descriptor and data structures */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-	store = (struct mbsys_singlebeam_struct *) store_ptr;
-
-	/* set file position */
-	mb_io_ptr->file_bytes = ftell(mb_io_ptr->mbfp);
-	mb_io_ptr->file_pos = mb_io_ptr->file_bytes;
-
-	/* read next record from file */
-	mb_io_ptr->file_pos = mb_io_ptr->file_bytes;
-	if ((status = fread(line,1,MBF_HYDROB93_RECORD_LENGTH,
-			mb_io_ptr->mbfp)) == MBF_HYDROB93_RECORD_LENGTH)
-		{
-		mb_io_ptr->file_bytes += status;
-		status = MB_SUCCESS;
-		*error = MB_ERROR_NO_ERROR;
-		}
-	else
-		{
-		mb_io_ptr->file_bytes += status;
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	/* handle the data */
-	if (status == MB_SUCCESS)
-	    {
-	    /* parse data */
-	    mb_get_binary_int(MB_YES, &line[0], (int *) &ilatitude);
-	    mb_get_binary_int(MB_YES, &line[4], (int *) &ilongitude);
-	    mb_get_binary_int(MB_YES, &line[8], (int *) &idepth);
-	    mb_get_binary_short(MB_YES, &line[12], (short *) &itype);
-	    store->longitude = (ilongitude) * 0.000001;
-	    store->latitude = (ilatitude) * 0.000001;
-	    store->bath = (idepth) * 0.1;
-	    if (itype == 711)
-	    	store->flag = MB_FLAG_NONE;
-	    else if (itype == 10711)
-	    	store->flag = MB_FLAG_FLAG + MB_FLAG_MANUAL;
-	    else
-	    	store->flag = MB_FLAG_NULL;
-	    store->time_d = MB_TIME_D_UNKNOWN;
-	    mb_get_date(verbose, store->time_d, store->time_i);
-	    store->heading = 0.0;
-	    store->speed = 0.0;
-	    store->roll = 0.0;
-	    store->pitch = 0.0;
-	    store->heave = 0.0;
-
-	    /* set kind */
-	    if (itype == 711 || itype == 10711)
-	    	store->kind = MB_DATA_DATA;
-	    else
-	    	store->kind = MB_DATA_RAW_LINE;
-
-	    if (status == MB_SUCCESS)
-	        {
-		/* print output debug statements */
-		if (verbose >= 4)
-			{
-			fprintf(stderr,"\ndbg4  Data read in MBIO function <%s>\n",function_name);
-			fprintf(stderr,"dbg4  Values read:\n");
-			fprintf(stderr,"dbg4       time_i[0]:    %d\n",store->time_i[0]);
-			fprintf(stderr,"dbg4       time_i[1]:    %d\n",store->time_i[1]);
-			fprintf(stderr,"dbg4       time_i[2]:    %d\n",store->time_i[2]);
-			fprintf(stderr,"dbg4       time_i[3]:    %d\n",store->time_i[3]);
-			fprintf(stderr,"dbg4       time_i[4]:    %d\n",store->time_i[4]);
-			fprintf(stderr,"dbg4       time_i[5]:    %d\n",store->time_i[5]);
-			fprintf(stderr,"dbg4       time_i[6]:    %d\n",store->time_i[6]);
-			fprintf(stderr,"dbg4       time_d:       %f\n",store->time_d);
-			fprintf(stderr,"dbg4       latitude:     %f\n",store->latitude);
-			fprintf(stderr,"dbg4       longitude:    %f\n",store->longitude);
-			fprintf(stderr,"dbg4       bath:         %f\n",store->bath);
-			fprintf(stderr,"dbg4       flag:         %d\n",store->flag);
-			fprintf(stderr,"dbg4       heading:      %f\n",store->heading);
-			fprintf(stderr,"dbg4       speed:        %f\n",store->speed);
-			fprintf(stderr,"dbg4       roll:         %f\n",store->roll);
-			fprintf(stderr,"dbg4       pitch:        %f\n",store->pitch);
-			fprintf(stderr,"dbg4       heave:        %f\n",store->heave);
-			fprintf(stderr,"dbg4       error:        %d\n",*error);
-			fprintf(stderr,"dbg4       status:       %d\n",status);
-			}
-	    	}
-
-	    else
-	    	{
-	    	status = MB_FAILURE;
-	   	*error = MB_ERROR_UNINTELLIGIBLE;
-	    	}
-
-	    }
-
-	/* set error and kind in mb_io_ptr */
-	mb_io_ptr->new_error = *error;
-	mb_io_ptr->new_kind = store->kind;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_wt_hydrob93(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_wt_hydrob93";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_singlebeam_struct *store;
-	char	line[MBF_HYDROB93_RECORD_LENGTH];
-	int	ilongitude, ilatitude, idepth;
-	short	itype;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_singlebeam_struct *) store_ptr;
-
-	/* handle the data */
-	if (store->kind == MB_DATA_DATA)
-	    {
-	    /* print output debug statements */
-	    if (verbose >= 4)
-		    {
-		    fprintf(stderr,"\ndbg4  Data to be written in MBIO function <%s>\n",
-			    function_name);
-		    fprintf(stderr,"dbg4  Values,read:\n");
-		    fprintf(stderr,"dbg4       latitude:     %f\n",store->latitude);
-		    fprintf(stderr,"dbg4       longitude:    %f\n",store->longitude);
-		    fprintf(stderr,"dbg4       bath:         %f\n",store->bath);
-		    fprintf(stderr,"dbg4       flag:         %d\n",store->flag);
-		    fprintf(stderr,"dbg4       error:        %d\n",*error);
-		    fprintf(stderr,"dbg4       status:       %d\n",status);
-		    }
-
-	    /* put data into buffer */
-	    ilongitude = (int)(1000000 * store->longitude);
-	    ilatitude = (int)(1000000 * store->longitude);
-	    idepth = (int)(10 * store->bath);
-	    if (mb_beam_ok(store->flag))
-	    	itype = 711;
-	    else if (store->flag == MB_FLAG_NULL)
-	    	itype = 0;
-	    else
-	    	itype = 10711;
-	    mb_put_binary_int(MB_YES, (int) ilatitude, (void *) &line[0]);
-	    mb_put_binary_int(MB_YES, (int) ilongitude, (void *) &line[4]);
-	    mb_put_binary_int(MB_YES, (int) idepth, (void *) &line[8]);
-	    mb_put_binary_short(MB_YES, (short) itype, (void *) &line[12]);
-	    }
-
-	if ((status = fwrite(line,1,MBF_HYDROB93_RECORD_LENGTH,
-		mb_io_ptr->mbfp)) == MBF_HYDROB93_RECORD_LENGTH)
-		{
-		status = MB_SUCCESS;
-		*error = MB_ERROR_NO_ERROR;
-		}
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Data record kind in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       kind:       %d\n",store->kind);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mbr_hypc8101.c b/src/mbio/mbr_hypc8101.c
deleted file mode 100644
index bfb5899..0000000
--- a/src/mbio/mbr_hypc8101.c
+++ /dev/null
@@ -1,1588 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbr_hypc8101.c	8/8/94
- *	$Id: mbr_hypc8101.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1998-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbr_hypc8101.c contains the functions for reading and writing
- * multibeam data in the HYPC8101 format.
- * These functions include:
- *   mbr_alm_hypc8101	- allocate read/write memory
- *   mbr_dem_hypc8101	- deallocate read/write memory
- *   mbr_rt_hypc8101	- read and translate data
- *   mbr_wt_hypc8101	- translate and write data
- *
- * Author:	D. W. Caress
- * Date:	December 10, 1998
- *
- * $Log: mbr_hypc8101.c,v $
- * Revision 5.9  2005/11/05 00:48:05  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.8  2003/05/20 18:05:32  caress
- * Added svp_source to data source parameters.
- *
- * Revision 5.7  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.6  2003/01/15 20:51:48  caress
- * Release 5.0.beta28
- *
- * Revision 5.5  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.4  2001/07/20 00:32:54  caress
- * Release 5.0.beta03
- *
- * Revision 5.3  2001/06/08  21:44:01  caress
- * Version 5.0.beta01
- *
- * Revision 5.2  2001/03/22  20:50:02  caress
- * Trying to make version 5.0.beta0
- *
- * Revision 5.1  2001/01/22  07:43:34  caress
- * Version 5.0.beta01
- *
- * Revision 5.0  2000/12/01  22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.4  2000/10/11  01:03:21  caress
- * Convert to ANSI C
- *
- * Revision 4.3  2000/09/30  06:34:20  caress
- * Snapshot for Dale.
- *
- * Revision 4.2  1999/08/16  23:14:41  caress
- * Added ability to handle Mesotech SM2000 data
- *
- * Revision 4.1  1999/03/31  18:11:35  caress
- * MB-System 4.6beta7
- *
- * Revision 4.0  1999/01/01  23:38:01  caress
- * MB-System version 4.6beta6
- *
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mb_define.h"
-#include "mbsys_reson.h"
-#include "mbf_hypc8101.h"
-
-/* essential function prototypes */
-int mbr_register_hypc8101(int verbose, void *mbio_ptr,
-		int *error);
-int mbr_info_hypc8101(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_alm_hypc8101(int verbose, void *mbio_ptr, int *error);
-int mbr_dem_hypc8101(int verbose, void *mbio_ptr, int *error);
-int mbr_zero_hypc8101(int verbose, char *data_ptr, int *error);
-int mbr_rt_hypc8101(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_wt_hypc8101(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_hypc8101_rd_data(int verbose, void *mbio_ptr, int *error);
-
-static char rcs_id[]="$Id: mbr_hypc8101.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mbr_register_hypc8101(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_register_hypc8101";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* get mb_io_ptr */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set format info parameters */
-	status = mbr_info_hypc8101(verbose,
-			&mb_io_ptr->system,
-			&mb_io_ptr->beams_bath_max,
-			&mb_io_ptr->beams_amp_max,
-			&mb_io_ptr->pixels_ss_max,
-			mb_io_ptr->format_name,
-			mb_io_ptr->system_name,
-			mb_io_ptr->format_description,
-			&mb_io_ptr->numfile,
-			&mb_io_ptr->filetype,
-			&mb_io_ptr->variable_beams,
-			&mb_io_ptr->traveltime,
-			&mb_io_ptr->beam_flagging,
-			&mb_io_ptr->nav_source,
-			&mb_io_ptr->heading_source,
-			&mb_io_ptr->vru_source,
-			&mb_io_ptr->svp_source,
-			&mb_io_ptr->beamwidth_xtrack,
-			&mb_io_ptr->beamwidth_ltrack,
-			error);
-
-	/* set format and system specific function pointers */
-	mb_io_ptr->mb_io_format_alloc = &mbr_alm_hypc8101;
-	mb_io_ptr->mb_io_format_free = &mbr_dem_hypc8101;
-	mb_io_ptr->mb_io_store_alloc = &mbsys_reson_alloc;
-	mb_io_ptr->mb_io_store_free = &mbsys_reson_deall;
-	mb_io_ptr->mb_io_read_ping = &mbr_rt_hypc8101;
-	mb_io_ptr->mb_io_write_ping = &mbr_wt_hypc8101;
-	mb_io_ptr->mb_io_dimensions = &mbsys_reson_dimensions;
-	mb_io_ptr->mb_io_extract = &mbsys_reson_extract;
-	mb_io_ptr->mb_io_insert = &mbsys_reson_insert;
-	mb_io_ptr->mb_io_extract_nav = &mbsys_reson_extract_nav;
-	mb_io_ptr->mb_io_insert_nav = &mbsys_reson_insert_nav;
-	mb_io_ptr->mb_io_extract_altitude = &mbsys_reson_extract_altitude;
-	mb_io_ptr->mb_io_insert_altitude = NULL;
-	mb_io_ptr->mb_io_extract_svp = &mbsys_reson_extract_svp;
-	mb_io_ptr->mb_io_insert_svp = &mbsys_reson_insert_svp;
-	mb_io_ptr->mb_io_ttimes = &mbsys_reson_ttimes;
-	mb_io_ptr->mb_io_detects = &mbsys_reson_detects;
-	mb_io_ptr->mb_io_copyrecord = &mbsys_reson_copy;
-	mb_io_ptr->mb_io_extract_rawss = NULL;
-	mb_io_ptr->mb_io_insert_rawss = NULL;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",mb_io_ptr->system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",mb_io_ptr->beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",mb_io_ptr->beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",mb_io_ptr->pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",mb_io_ptr->format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",mb_io_ptr->system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",mb_io_ptr->format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",mb_io_ptr->numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",mb_io_ptr->filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",mb_io_ptr->variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",mb_io_ptr->traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",mb_io_ptr->beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",mb_io_ptr->nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",mb_io_ptr->heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",mb_io_ptr->vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",mb_io_ptr->svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",mb_io_ptr->beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",mb_io_ptr->beamwidth_ltrack);
-		fprintf(stderr,"dbg2       format_alloc:       %p\n",(void *)mb_io_ptr->mb_io_format_alloc);
-		fprintf(stderr,"dbg2       format_free:        %p\n",(void *)mb_io_ptr->mb_io_format_free);
-		fprintf(stderr,"dbg2       store_alloc:        %p\n",(void *)mb_io_ptr->mb_io_store_alloc);
-		fprintf(stderr,"dbg2       store_free:         %p\n",(void *)mb_io_ptr->mb_io_store_free);
-		fprintf(stderr,"dbg2       read_ping:          %p\n",(void *)mb_io_ptr->mb_io_read_ping);
-		fprintf(stderr,"dbg2       write_ping:         %p\n",(void *)mb_io_ptr->mb_io_write_ping);
-		fprintf(stderr,"dbg2       extract:            %p\n",(void *)mb_io_ptr->mb_io_extract);
-		fprintf(stderr,"dbg2       insert:             %p\n",(void *)mb_io_ptr->mb_io_insert);
-		fprintf(stderr,"dbg2       extract_nav:        %p\n",(void *)mb_io_ptr->mb_io_extract_nav);
-		fprintf(stderr,"dbg2       insert_nav:         %p\n",(void *)mb_io_ptr->mb_io_insert_nav);
-		fprintf(stderr,"dbg2       extract_altitude:   %p\n",(void *)mb_io_ptr->mb_io_extract_altitude);
-		fprintf(stderr,"dbg2       insert_altitude:    %p\n",(void *)mb_io_ptr->mb_io_insert_altitude);
-		fprintf(stderr,"dbg2       extract_svp:        %p\n",(void *)mb_io_ptr->mb_io_extract_svp);
-		fprintf(stderr,"dbg2       insert_svp:         %p\n",(void *)mb_io_ptr->mb_io_insert_svp);
-		fprintf(stderr,"dbg2       ttimes:             %p\n",(void *)mb_io_ptr->mb_io_ttimes);
-		fprintf(stderr,"dbg2       detects:            %p\n",(void *)mb_io_ptr->mb_io_detects);
-		fprintf(stderr,"dbg2       extract_rawss:      %p\n",(void *)mb_io_ptr->mb_io_extract_rawss);
-		fprintf(stderr,"dbg2       insert_rawss:       %p\n",(void *)mb_io_ptr->mb_io_insert_rawss);
-		fprintf(stderr,"dbg2       copyrecord:         %p\n",(void *)mb_io_ptr->mb_io_copyrecord);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbr_info_hypc8101(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error)
-{
-	char	*function_name = "mbr_info_hypc8101";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* set format info parameters */
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-	*system = MB_SYS_RESON;
-	*beams_bath_max = 101;
-	*beams_amp_max = 101;
-	*pixels_ss_max = 0;
-	strncpy(format_name, "HYPC8101", MB_NAME_LENGTH);
-	strncpy(system_name, "RESON", MB_NAME_LENGTH);
-	strncpy(format_description, "Format name:          MBF_HYPC8101\nInformal Description: Reson SeaBat 8101 shallow water multibeam\nAttributes:           101 beam bathymetry,\n                      ASCII, read-only, Coastal Oceanographics.\n", MB_DESCRIPTION_LENGTH);
-	*numfile = 1;
-	*filetype = MB_FILETYPE_NORMAL;
-	*variable_beams = MB_NO;
-	*traveltime = MB_YES;
-	*beam_flagging = MB_YES;
-	*nav_source = MB_DATA_NAV;
-	*heading_source = MB_DATA_DATA;
-	*vru_source = MB_DATA_DATA;
-	*svp_source = MB_DATA_VELOCITY_PROFILE;
-	*beamwidth_xtrack = 2.0;
-	*beamwidth_ltrack = 2.0;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",*system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",*beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",*beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",*pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",*numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",*filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",*variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",*traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",*beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",*nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",*heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",*vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",*svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",*beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",*beamwidth_ltrack);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_alm_hypc8101(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_alm_hypc8101";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set initial status */
-	status = MB_SUCCESS;
-
-	/* allocate memory for data structure */
-	mb_io_ptr->structure_size = sizeof(struct mbf_hypc8101_struct);
-	mb_io_ptr->data_structure_size = 0;
-	status = mb_malloc(verbose,mb_io_ptr->structure_size,
-				&mb_io_ptr->raw_data,error);
-	status = mb_malloc(verbose,sizeof(struct mbsys_reson_struct),
-				&mb_io_ptr->store_data,error);
-
-	/* initialize everything to zeros */
-	mbr_zero_hypc8101(verbose,mb_io_ptr->raw_data,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_dem_hypc8101(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_dem_hypc8101";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointers to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* deallocate memory for data descriptor */
-	status = mb_free(verbose,&mb_io_ptr->raw_data,error);
-	status = mb_free(verbose,&mb_io_ptr->store_data,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_zero_hypc8101(int verbose, char *data_ptr, int *error)
-{
-	char	*function_name = "mbr_zero_hypc8101";
-	int	status = MB_SUCCESS;
-	struct mbf_hypc8101_struct *data;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       data_ptr:   %p\n",(void *)data_ptr);
-		}
-
-	/* get pointer to data descriptor */
-	data = (struct mbf_hypc8101_struct *) data_ptr;
-
-	/* initialize everything to zeros */
-	if (data != NULL)
-		{
-		data->kind = MB_DATA_NONE;
-		data->sonar = MBSYS_RESON_UNKNOWN;
-		data->par_year = 0;
-		data->par_month = 0;
-		data->par_day = 0;
-		data->par_hour = 0;
-		data->par_minute = 0;
-		data->par_second = 0;
-		data->par_hundredth_sec = 0;
-		data->par_thousandth_sec = 0;
-		data->roll_offset = 0;	/* roll offset (degrees) */
-		data->pitch_offset = 0;	/* pitch offset (degrees) */
-		data->heading_offset = 0;	/* heading offset (degrees) */
-		data->time_delay = 0;		/* positioning system
-							delay (sec) */
-		data->transducer_depth = 0;	/* tranducer depth (meters) */
-		data->transducer_height = 0;	/* reference height (meters) */
-		data->transducer_x = 0;	/* reference athwartships
-							offset (meters) */
-		data->transducer_y = 0;	/* reference  fore-aft
-							offset (meters) */
-		data->antenna_x = 0;		/* antenna athwartships
-							offset (meters) */
-		data->antenna_y = 0;		/* antenna fore-aft
-							offset (meters) */
-		data->antenna_z = 0;		/* antenna height (meters) */
-		data->motion_sensor_x = 0;	/* motion sensor athwartships
-							offset (meters) */
-		data->motion_sensor_y = 0;	/* motion sensor fore-aft
-							offset (meters) */
-		data->motion_sensor_z = 0;	/* motion sensor height
-							offset (meters) */
-		data->spare = 0;
-		data->line_number = 0;
-		data->start_or_stop = 0;
-		data->transducer_serial_number = 0;
-		for (i=0;i<MBF_HYPC8101_COMMENT_LENGTH;i++)
-			data->comment[i] = '\0';
-
-		/* position (position telegrams) */
-		data->pos_year = 0;
-		data->pos_month = 0;
-		data->pos_day = 0;
-		data->pos_hour = 0;
-		data->pos_minute = 0;
-		data->pos_second = 0;
-		data->par_hundredth_sec = 0;
-		data->pos_thousandth_sec = 0;
-		data->pos_latitude = 0;
-		data->pos_longitude = 0;
-		data->utm_northing = 0;
-		data->utm_easting = 0;
-		data->utm_zone_lon = 0;
-		data->utm_zone = 0;
-		data->hemisphere = 0;
-		data->ellipsoid = 0;
-		data->pos_spare = 0;
-		data->semi_major_axis = 0;
-		data->other_quality = 0;
-
-		/* sound velocity profile */
-		data->svp_year = 0;
-		data->svp_month = 0;
-		data->svp_day = 0;
-		data->svp_hour = 0;
-		data->svp_minute = 0;
-		data->svp_second = 0;
-		data->svp_hundredth_sec = 0;
-		data->svp_thousandth_sec = 0;
-		data->svp_num = 0;
-		for (i=0;i<100;i++)
-			{
-			data->svp_depth[i] = 0; /* 0.1 meters */
-			data->svp_vel[i] = 0;	/* 0.1 meters/sec */
-			}
-
-		/* time stamp */
-		data->year = 0;
-		data->month = 0;
-		data->day = 0;
-		data->hour = 0;
-		data->minute = 0;
-		data->second = 0;
-		data->hundredth_sec = 0;
-		data->thousandth_sec = 0;
-		data->longitude = 0;
-		data->latitude = 0;
-		data->roll = 0;
-		data->pitch = 0;
-		data->heading = 0;
-		data->heave = 0;
-		data->ping_number = 0;
-		data->sound_vel = 0;
-		data->mode = 0;
-		data->gain1 = 0;
-		data->gain2 = 0;
-		data->gain3 = 0;
-		data->beams_bath = 0;
-		for (i=0;i<MBF_HYPC8101_MAXBEAMS;i++)
-			{
-			data->bath[i] = 0;
-			data->bath_acrosstrack[i] = 0;
-			data->bath_alongtrack[i] = 0;
-			data->tt[i] = 0;
-			data->angle[i] = 0;
-			data->quality[i] = 0;
-			data->amp[i] = 0;
-			}
-		}
-
-	/* assume success */
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_rt_hypc8101(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_rt_hypc8101";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_hypc8101_struct *data;
-	struct mbsys_reson_struct *store;
-	int	time_i[7];
-	double	time_d;
-	double	lon, lat, heading, speed;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointers to mbio descriptor and data structures */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-	data = (struct mbf_hypc8101_struct *) mb_io_ptr->raw_data;
-	store = (struct mbsys_reson_struct *) store_ptr;
-
-	/* read next data from file */
-	status = mbr_hypc8101_rd_data(verbose,mbio_ptr,error);
-
-	/* set error and kind in mb_io_ptr */
-	mb_io_ptr->new_error = *error;
-	mb_io_ptr->new_kind = data->kind;
-
-	/* interpolate navigation for survey pings if needed */
-	if (status == MB_SUCCESS
-		&& data->kind == MB_DATA_DATA
-		&& data->longitude == 0
-		&& data->latitude == 0
-		&& mb_io_ptr->nfix >= 1)
-		{
-		mb_fix_y2k(verbose, data->year,&time_i[0]);
-		time_i[1] = data->month;
-		time_i[2] = data->day;
-		time_i[3] = data->hour;
-		time_i[4] = data->minute;
-		time_i[5] = data->second;
-		time_i[6] = 10000*data->hundredth_sec
-			+ 100*data->thousandth_sec;
-		mb_get_time(verbose,time_i, &time_d);
-		heading = 0.01 * data->heading;
-		mb_navint_interp(verbose, mbio_ptr, time_d, heading, 0.0,
-				    &lon, &lat, &speed, error);
-		data->longitude = (int) (lon / 0.00000009);
-		data->latitude = (int) (lat / 0.00000009);
-		}
-
-	/* translate values to reson data storage structure */
-	if (status == MB_SUCCESS
-		&& store != NULL)
-		{
-		store->kind = data->kind;
-		store->sonar = data->sonar;
-
-		/* parameter telegram */
-		store->par_year = data->par_year;
-		store->par_month = data->par_month;
-		store->par_day = data->par_day;
-		store->par_hour = data->par_hour;
-		store->par_minute = data->par_minute;
-		store->par_second = data->par_second;
-		store->par_hundredth_sec = data->par_hundredth_sec;
-		store->par_thousandth_sec = data->par_thousandth_sec;
-		store->roll_offset = data->roll_offset;
-		store->pitch_offset = data->pitch_offset;
-		store->heading_offset = data->heading_offset;
-		store->time_delay = data->time_delay;
-		store->transducer_depth = 10 * data->transducer_depth;
-		store->transducer_height = data->transducer_height;
-		store->transducer_x = data->transducer_x;
-		store->transducer_y = data->transducer_y;
-		store->antenna_x = data->antenna_x;
-		store->antenna_y = data->antenna_y;
-		store->antenna_z = data->antenna_z;
-		store->motion_sensor_x = data->motion_sensor_x;
-		store->motion_sensor_y = data->motion_sensor_y;
-		store->motion_sensor_z = data->motion_sensor_z;
-		store->spare = data->spare;
-		store->line_number = data->line_number;
-		store->start_or_stop = data->start_or_stop;
-		store->transducer_serial_number
-			= data->transducer_serial_number;
-		for (i=0;i<MBSYS_RESON_COMMENT_LENGTH;i++)
-			store->comment[i] = data->comment[i];
-
-		/* position (position telegrams) */
-		store->pos_year = data->pos_year;
-		store->pos_month = data->pos_month;
-		store->pos_day = data->pos_day;
-		store->pos_hour = data->pos_hour;
-		store->pos_minute = data->pos_minute;
-		store->pos_second = data->pos_second;
-		store->pos_hundredth_sec = data->pos_hundredth_sec;
-		store->pos_thousandth_sec = data->pos_thousandth_sec;
-		store->pos_latitude = data->pos_latitude;
-		store->pos_longitude = data->pos_longitude;
-		store->utm_northing = data->utm_northing;
-		store->utm_easting = data->utm_easting;
-		store->utm_zone_lon = data->utm_zone_lon;
-		store->utm_zone = data->utm_zone;
-		store->hemisphere = data->hemisphere;
-		store->ellipsoid = data->ellipsoid;
-		store->pos_spare = data->pos_spare;
-		store->semi_major_axis = data->semi_major_axis;
-		store->other_quality = data->other_quality;
-
-		/* sound velocity profile */
-		store->svp_year = data->svp_year;
-		store->svp_month = data->svp_month;
-		store->svp_day = data->svp_day;
-		store->svp_hour = data->svp_hour;
-		store->svp_minute = data->svp_minute;
-		store->svp_second = data->svp_second;
-		store->svp_hundredth_sec = data->svp_hundredth_sec;
-		store->svp_thousandth_sec = data->svp_thousandth_sec;
-		store->svp_num = data->svp_num;
-		for (i=0;i<500;i++)
-			{
-			store->svp_depth[i] = data->svp_depth[i];
-			store->svp_vel[i] = data->svp_vel[i];
-			}
-
-		/* bathymetry */
-		store->year = data->year;
-		store->month = data->month;
-		store->day = data->day;
-		store->hour = data->hour;
-		store->minute = data->minute;
-		store->second = data->second;
-		store->hundredth_sec = data->hundredth_sec;
-		store->thousandth_sec = data->thousandth_sec;
-		store->longitude = data->longitude;
-		store->latitude = data->latitude;
-		store->roll = data->roll;
-		store->pitch = data->pitch;
-		store->heading = data->heading;
-		store->heave = data->heave;
-		store->ping_number = data->ping_number;
-		store->sound_vel = data->sound_vel;
-		store->mode = data->mode;
-		store->gain1 = data->gain1;
-		store->gain2 = data->gain2;
-		store->gain3 = data->gain3;
-		store->beams_bath = data->beams_bath;
-		for (i=0;i<store->beams_bath;i++)
-			{
-			store->bath[i] = data->bath[i];
-			store->bath_acrosstrack[i] = data->bath_acrosstrack[i];
-			store->bath_alongtrack[i] = data->bath_alongtrack[i];
-			store->tt[i] = data->tt[i];
-			store->angle[i] = data->angle[i];
-			store->quality[i] = data->quality[i];
-			store->amp[i] = data->amp[i];
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_wt_hypc8101(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_wt_hypc8101";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set error as this is a read only format */
-	status = MB_FAILURE;
-	*error = MB_ERROR_WRITE_FAIL;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_hypc8101_rd_data(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_hypc8101_rd_data";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_hypc8101_struct *data;
-	char	*result;
-	char	line[MBF_HYPC8101_MAXLINE];
-	int	done;
-	int	nscan;
-	int	ndevice, idummy;
-	double	raw_clock;
-	double	raw_lat, raw_lon;
-	double	hcp_clock, hcp_heave, hcp_roll, hcp_pitch;
-	double	gyr_clock, gyr_gyro;
-	double	pos_clock, pos_easting, pos_northing;
-	double	time_d;
-	int	time_i[7];
-	double	angle0, angle_inc;
-	int	device_type, device_nav, device_hcp;
-	int	device_gyro, device_sb2;
-	char	device_name[32];
-	double	sb2_clock, sb2_ssv;
-	int	sb2_nvalues;
-	int	sb2_nbeams, sb2_nbeams_read;
-	int	sb2_nquality, sb2_nquality_read, iquality;
-	double	sb2_quality, sb2_range;
-	int	syr, smon, sday, shour, smin, ssec;
-	double	off1, off2, off3, off4, off5, off6, off7;
-	double	heave, roll, pitch, gyro;
-	double	angle, theta, phi;
-	double	lon, lat, speed;
-	double	lever_x, lever_y, lever_z;
-	double	rr, xx, zz;
-	double	ddummy1, ddummy2;
-	char	*token;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_hypc8101_struct *) mb_io_ptr->raw_data;
-
-	/* set file position */
-	mb_io_ptr->file_pos = mb_io_ptr->file_bytes;
-
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-	done = MB_NO;
-	while (done == MB_NO)
-		{
-		/* read the next line */
-		result = fgets(line,MBF_HYPC8101_MAXLINE,mb_io_ptr->mbfp);
-		if (result == line
-			&& strlen(line) < MBF_HYPC8101_MAXLINE)
-		    {
-		    status = MB_SUCCESS;
-		    *error = MB_ERROR_NO_ERROR;
-
-		    if (verbose >= 4)
-			{
-			fprintf(stderr,"\ndbg4  Raw line read by MBIO function <%s>\n",function_name);
-			fprintf(stderr,"dbg4       line: %s\n",line);
-			}
-		    }
-		else
-		    {
-		    status = MB_FAILURE;
-		    *error = MB_ERROR_EOF;
-		    done = MB_YES;
-		    }
-
-		/* now make sense of the line */
-		if (status == MB_SUCCESS)
-		    {
-		    /* deal with vru data */
-		    if (strncmp(line, "HCP", 3) == 0)
-			{
-			nscan = sscanf(line+6, "%lf %lf %lf %lf",
-					&hcp_clock,
-					&hcp_heave,
-					&hcp_roll,
-					&hcp_pitch);
-			if (nscan == 4)
-			    {
-			    /* apply vru offsets */
-			    hcp_roll += 0.01 * data->roll_offset;
-			    hcp_pitch += 0.01 * data->pitch_offset;
-
-			    /* get time tag */
-			    time_d = data->start_time_d + hcp_clock;
-			    mb_get_date(verbose, time_d, time_i);
-			    mb_unfix_y2k(verbose, time_i[0], &data->year);
-			    data->month = time_i[1];
-			    data->day = time_i[2];
-			    data->hour = time_i[3];
-			    data->minute = time_i[4];
-			    data->second = time_i[5];
-			    data->hundredth_sec = time_i[6]/10000;
-			    data->thousandth_sec =
-				(time_i[6] - 10000 * data->hundredth_sec)/100;
-
-		    	    /* add latest attitude to list */
-		    	    mb_attint_add(verbose, mbio_ptr,
-				    time_d, hcp_heave, hcp_roll, hcp_pitch,
-				    error);
-
-			    /* get attitude data */
-			    data->heave = 1000 * hcp_heave;
-			    data->roll = 200 * hcp_roll;
-			    data->pitch = 200 * hcp_pitch;
-
-			    /* set done and kind */
-			    done = MB_YES;
-			    data->kind = MB_DATA_ATTITUDE;
-
-			    /* print debug statements */
-			    if (verbose >= 4)
-				{
-				fprintf(stderr,"\ndbg4  New data read by MBIO function <%s>\n",function_name);
-				fprintf(stderr,"dbg4  New attitude values:\n");
-				fprintf(stderr,"dbg4       kind:       %d\n",
-					data->kind);
-				fprintf(stderr,"dbg4       year:       %d\n",
-					data->year);
-				fprintf(stderr,"dbg4       month:      %d\n",
-					data->month);
-				fprintf(stderr,"dbg4       day:        %d\n",
-					data->day);
-				fprintf(stderr,"dbg4       hour:       %d\n",
-					data->hour);
-				fprintf(stderr,"dbg4       minute:     %d\n",
-					data->minute);
-				fprintf(stderr,"dbg4       second:     %d\n",
-					data->second);
-				fprintf(stderr,"dbg4       0.01 sec:   %d\n",
-					data->hundredth_sec);
-				fprintf(stderr,"dbg4       0.0001 sec: %d\n",
-					data->thousandth_sec);
-				fprintf(stderr,"dbg4       clock:      %f\n",
-					hcp_clock);
-				fprintf(stderr,"dbg4       heave:      %f\n",
-					hcp_heave);
-				fprintf(stderr,"dbg4       roll:       %f\n",
-					hcp_roll);
-				fprintf(stderr,"dbg4       pitch:      %f\n",
-					hcp_pitch);
-				}
-			    }
-			}
-
-		    /* deal with gyro data */
-		    else if (strncmp(line, "GYR", 3) == 0)
-			{
-			nscan = sscanf(line+6, "%lf %lf",
-					&gyr_clock,
-					&gyr_gyro);
-			if (nscan == 2)
-			    {
-			    /* apply heading offset */
-			    gyr_gyro += 0.01 * data->heading_offset;
-
-			    /* get time tag */
-			    time_d = data->start_time_d + gyr_clock;
-			    mb_get_date(verbose, time_d, time_i);
-			    mb_unfix_y2k(verbose, time_i[0], &data->year);
-			    data->month = time_i[1];
-			    data->day = time_i[2];
-			    data->hour = time_i[3];
-			    data->minute = time_i[4];
-			    data->second = time_i[5];
-			    data->hundredth_sec = time_i[6]/10000;
-			    data->thousandth_sec =
-				(time_i[6] - 10000 * data->hundredth_sec)/100;
-
-		    	    /* add latest attitude to list */
-		    	    mb_hedint_add(verbose, mbio_ptr,
-				    time_d, gyr_gyro, error);
-
-			    /* get gyro data */
-			    data->heading = 100 * gyr_gyro;
-
-			    /* set done and kind */
-			    done = MB_YES;
-			    data->kind = MB_DATA_HEADING;
-
-			    /* print debug statements */
-			    if (verbose >= 4)
-				{
-				fprintf(stderr,"\ndbg4  New data read by MBIO function <%s>\n",function_name);
-				fprintf(stderr,"dbg4  New heading values:\n");
-				fprintf(stderr,"dbg4       kind:       %d\n",
-					data->kind);
-				fprintf(stderr,"dbg4       year:       %d\n",
-					data->year);
-				fprintf(stderr,"dbg4       month:      %d\n",
-					data->month);
-				fprintf(stderr,"dbg4       day:        %d\n",
-					data->day);
-				fprintf(stderr,"dbg4       hour:       %d\n",
-					data->hour);
-				fprintf(stderr,"dbg4       minute:     %d\n",
-					data->minute);
-				fprintf(stderr,"dbg4       second:     %d\n",
-					data->second);
-				fprintf(stderr,"dbg4       0.01 sec:   %d\n",
-					data->hundredth_sec);
-				fprintf(stderr,"dbg4       0.0001 sec: %d\n",
-					data->thousandth_sec);
-				fprintf(stderr,"dbg4       clock:      %f\n",
-					gyr_clock);
-				fprintf(stderr,"dbg4       heading:    %f\n",
-					gyr_gyro);
-				}
-			    }
-			}
-
-		    /* deal with nav easting northing data */
-		    else if (strncmp(line, "POS", 3) == 0)
-			{
-			nscan = sscanf(line+6, "%lf %lf %lf",
-					&pos_clock,
-					&pos_easting,
-					&pos_northing);
-			if (nscan == 3)
-			    {
-			    /* apply time delay */
-			    pos_clock += 0.001 * data->time_delay;
-
-			    /* get time tag */
-			    time_d = data->start_time_d + pos_clock;
-			    mb_get_date(verbose, time_d, time_i);
-			    mb_unfix_y2k(verbose, time_i[0], &data->year);
-			    data->month = time_i[1];
-			    data->day = time_i[2];
-			    data->hour = time_i[3];
-			    data->minute = time_i[4];
-			    data->second = time_i[5];
-			    data->hundredth_sec = time_i[6]/10000;
-			    data->thousandth_sec =
-				(time_i[6] - 10000 * data->hundredth_sec)/100;
-
-			    /* get position data */
-			    data->utm_northing = 100 * pos_northing;
-			    data->utm_easting = 100 * pos_easting;
-
-			    /* set done and kind */
-			    done = MB_NO;
-			    data->kind = MB_DATA_NAV;
-
-			    /* print debug statements */
-			    if (verbose >= 4)
-				{
-				fprintf(stderr,"\ndbg4  New data read by MBIO function <%s>\n",function_name);
-				fprintf(stderr,"dbg4  New position values:\n");
-				fprintf(stderr,"dbg4       kind:       %d\n",
-					data->kind);
-				fprintf(stderr,"dbg4       year:       %d\n",
-					data->year);
-				fprintf(stderr,"dbg4       month:      %d\n",
-					data->month);
-				fprintf(stderr,"dbg4       day:        %d\n",
-					data->day);
-				fprintf(stderr,"dbg4       hour:       %d\n",
-					data->hour);
-				fprintf(stderr,"dbg4       minute:     %d\n",
-					data->minute);
-				fprintf(stderr,"dbg4       second:     %d\n",
-					data->second);
-				fprintf(stderr,"dbg4       0.01 sec:   %d\n",
-					data->hundredth_sec);
-				fprintf(stderr,"dbg4       0.0001 sec: %d\n",
-					data->thousandth_sec);
-				fprintf(stderr,"dbg4       clock:      %f\n",
-					pos_clock);
-				fprintf(stderr,"dbg4       easting:    %f\n",
-					pos_easting);
-				fprintf(stderr,"dbg4       northing:   %f\n",
-					pos_northing);
-				}
-			    }
-			}
-
-		    /* deal with nav lon lat data - sometimes followed
-		       by projected position data in POS lines - return MB_DATA_NAV
-		       after RAW lines */
-		    else if (strncmp(line, "RAW", 3) == 0)
-			{
-			nscan = sscanf(line+6, "%lf %d %lf %lf %lf %lf",
-					&raw_clock,
-					&idummy,
-					&raw_lat,
-					&raw_lon,
-					&ddummy1,
-					&ddummy2);
-			if (nscan == 6)
-			    {
-			    /* rescale */
-			    raw_lat = 0.0001 * raw_lat;
-			    raw_lon = 0.0001 * raw_lon;
-
-			    /* apply time delay */
-			    pos_clock += 0.001 * data->time_delay;
-
-			    /* get time tag */
-			    time_d = data->start_time_d + raw_clock;
-			    mb_get_date(verbose, time_d, time_i);
-			    mb_unfix_y2k(verbose, time_i[0], &data->pos_year);
-			    data->pos_month = time_i[1];
-			    data->pos_day = time_i[2];
-			    data->pos_hour = time_i[3];
-			    data->pos_minute = time_i[4];
-			    data->pos_second = time_i[5];
-			    data->pos_hundredth_sec = time_i[6]/10000;
-			    data->pos_thousandth_sec =
-				(time_i[6] - 10000 * data->pos_hundredth_sec)/100;
-
-		    	    /* add latest nav to list */
-		    	    mb_navint_add(verbose, mbio_ptr,
-				    time_d, raw_lon, raw_lat, error);
-
-			    /* interpolate attitude and heading if possible */
-			    mb_attint_interp(verbose, mbio_ptr, time_d,
-				&heave, &roll, &pitch, error);
-			    data->heave = 1000 * heave;
-			    data->roll = 200 * roll;
-			    data->pitch = 200 * pitch;
-			    mb_hedint_interp(verbose, mbio_ptr, time_d,
-				&gyro, error);
-			    data->heading = 100 * gyro;
-
-			    /* get position */
-			    data->pos_latitude = raw_lat / 0.00000009;
-			    data->pos_longitude = raw_lon / 0.00000009;
-
-			    /* set done and kind */
-			    done = MB_YES;
-			    data->kind = MB_DATA_NAV;
-
-			    /* print debug statements */
-			    if (verbose >= 4)
-				{
-				fprintf(stderr,"\ndbg4  New data read by MBIO function <%s>\n",function_name);
-				fprintf(stderr,"dbg4  New navigation values:\n");
-				fprintf(stderr,"dbg4       kind:       %d\n",
-					data->kind);
-				fprintf(stderr,"dbg4       year:       %d\n",
-					data->pos_year);
-				fprintf(stderr,"dbg4       month:      %d\n",
-					data->pos_month);
-				fprintf(stderr,"dbg4       day:        %d\n",
-					data->pos_day);
-				fprintf(stderr,"dbg4       hour:       %d\n",
-					data->pos_hour);
-				fprintf(stderr,"dbg4       minute:     %d\n",
-					data->pos_minute);
-				fprintf(stderr,"dbg4       second:     %d\n",
-					data->pos_second);
-				fprintf(stderr,"dbg4       0.01 sec:   %d\n",
-					data->pos_hundredth_sec);
-				fprintf(stderr,"dbg4       0.0001 sec: %d\n",
-					data->pos_thousandth_sec);
-				fprintf(stderr,"dbg4       pos_lon:    %d\n",
-					data->pos_longitude);
-				fprintf(stderr,"dbg4       pos_lat:    %d\n",
-					data->pos_latitude);
-				fprintf(stderr,"dbg4       clock:      %f\n",
-					raw_clock);
-				fprintf(stderr,"dbg4       longitude:   %f\n",
-					raw_lon);
-				fprintf(stderr,"dbg4       latitude:    %f\n",
-					raw_lat);
-				}
-			    }
-			}
-
-		    /* deal with multibeam data */
-		    else if (strncmp(line, "SB2", 3) == 0)
-			{
-			/* start strtok and get sb2_clock */
-			if (status == MB_SUCCESS
-			    && (token = strtok(line+6, " ")) != NULL)
-			    nscan = sscanf(token, "%lf",&sb2_clock);
-			else
-			    {
-			    status = MB_FAILURE;
-			    *error = MB_ERROR_UNINTELLIGIBLE;
-			    }
-
-			/* get sb2_nbeams */
-			if (status == MB_SUCCESS
-			    && (token = strtok(NULL, " ")) != NULL)
-			    nscan = sscanf(token, "%d",&sb2_nvalues);
-			else
-			    {
-			    status = MB_FAILURE;
-			    *error = MB_ERROR_UNINTELLIGIBLE;
-			    }
-
-			/* get sb2_ssv */
-			if (status == MB_SUCCESS
-			    && (token = strtok(NULL, " ")) != NULL)
-			    nscan = sscanf(token, "%lf",&sb2_ssv);
-			else
-			    {
-			    status = MB_FAILURE;
-			    *error = MB_ERROR_UNINTELLIGIBLE;
-			    }
-
-			/* copy values and get beam data */
-			if (status == MB_SUCCESS)
-			    {
-			    data->sound_vel = 10 * sb2_ssv;
-			    sb2_nbeams_read = 0;
-			    sb2_nbeams = floor(0.8 * (sb2_nvalues - 1));
-			    sb2_nquality = sb2_nvalues - sb2_nbeams - 1;
-			    for (i=0;i<sb2_nbeams;i++)
-				{
-				if (status == MB_SUCCESS
-				    && (token = strtok(NULL, " ")) != NULL)
-				    {
-				    if ((nscan = sscanf(token, "%lf",&sb2_range)) == 1)
-					{
-					data->tt[sb2_nbeams_read] = 100 * sb2_range;
-					sb2_nbeams_read++;
-					}
-				    }
-				else
-				    {
-				    status = MB_FAILURE;
-				    *error = MB_ERROR_UNINTELLIGIBLE;
-				    }
-				}
-			    }
-
-			/* copy values and get quality data */
-			if (status == MB_SUCCESS)
-			    {
-			    sb2_nquality_read = 0;
-			    for (i=0;i<sb2_nquality;i++)
-				{
-				if (status == MB_SUCCESS
-				    && (token = strtok(NULL, " ")) != NULL)
-				    {
-				    if ((nscan = sscanf(token, "%lf",&sb2_quality)) == 1)
-					{
-					iquality = sb2_quality;
-					data->quality[4 * sb2_nquality_read]
-						= (iquality >> 6) & 3;
-					data->quality[4 * sb2_nquality_read + 1]
-						= (iquality >> 4) & 3;
-					data->quality[4 * sb2_nquality_read + 2]
-						= (iquality >> 2) & 3;
-					data->quality[4 * sb2_nquality_read + 3]
-						= iquality & 3;
-					sb2_nquality_read++;
-					}
-				    }
-				else
-				    {
-				    status = MB_FAILURE;
-				    *error = MB_ERROR_UNINTELLIGIBLE;
-				    }
-				}
-			    }
-
-			/* calculate the rest of the data */
-			if (status == MB_SUCCESS)
-			    {
-			    /* get time tag */
-			    time_d = data->start_time_d + sb2_clock;
-			    mb_get_date(verbose, time_d, time_i);
-			    mb_unfix_y2k(verbose, time_i[0], &data->year);
-			    data->month = time_i[1];
-			    data->day = time_i[2];
-			    data->hour = time_i[3];
-			    data->minute = time_i[4];
-			    data->second = time_i[5];
-			    data->hundredth_sec = time_i[6]/10000;
-			    data->thousandth_sec =
-				(time_i[6] - 10000 * data->hundredth_sec)/100;
-
-			    /* interpolate attitude, heading and nav if possible */
-			    mb_attint_interp(verbose, mbio_ptr, time_d,
-				&heave, &roll, &pitch, error);
-			    mb_hedint_interp(verbose, mbio_ptr, time_d,
-				&gyro, error);
-			    mb_navint_interp(verbose, mbio_ptr, time_d,
-			        gyro, 0.0, &lon, &lat, &speed, error);
-
-			    /* get lever arm correction for heave */
-			    mb_lever(verbose,
-			    		(double) (0.01 * data->transducer_x),
-			    		(double) (0.01 * data->transducer_y),
-			    		(double) (0.01 * data->transducer_depth),
-			    		(double) (0.01 * data->antenna_x),
-			    		(double) (0.01 * data->antenna_y),
-			    		(double) (0.01 * data->antenna_z),
-					(double) (0.01 * data->motion_sensor_x),
-					(double) (0.01 * data->motion_sensor_y),
-					(double) (0.01 * data->motion_sensor_z),
-					(double) (0.01 * data->pitch_offset - pitch),
-					(double) (roll - 0.01 * data->roll_offset),
-					&lever_x,
-					&lever_y,
-					&lever_z,
-					error);
-/*fprintf(stderr,"roll:%f pitch:%f    dz:%f\n",
-(double) (roll - 0.01 * data->roll_offset),
-(double) (0.01 * data->pitch_offset - pitch),
-lever_z);*/
-			    heave += lever_z;
-			    data->heave = 1000 * heave;
-			    data->roll = 200 * roll;
-			    data->pitch = 200 * pitch;
-			    data->heading = 100 * gyro;
-			    data->latitude = lat / 0.00000009;
-			    data->longitude = lon / 0.00000009;
-
-			    /* calculate bathymetry */
-			    for (i=0;i<data->beams_bath;i++)
-				{
-				angle = data->angle0
-					+ data->angle_inc * (i - 0) - roll;
-				data->angle[i] = 200 * angle;
-				angle = 90.0 - angle;
-				mb_rollpitch_to_takeoff(
-					verbose,
-					pitch, angle,
-					&theta, &phi,
-					error);
-				rr = 0.0000005 * data->sound_vel * data->tt[i];
-				xx = rr * sin(DTR * theta);
-				zz = rr * cos(DTR * theta);
-				data->bath_acrosstrack[i]
-					= 100 * xx * cos(DTR * phi);
-				data->bath_alongtrack[i]
-					= 100 * xx * sin(DTR * phi);
-				data->bath[i] = 100 * (zz + heave)
-						+ data->transducer_depth;
-/*fprintf(stderr, "i:%d tt:%d angle:%f roll:%f pitch:%f heave:%f\n",
-i, data->tt[i], angle, roll, pitch, heave);
-fprintf(stderr, "theta:%f phi:%f\n", theta, phi);
-fprintf(stderr, "rr:%f xx:%f zz:%f\n", rr, xx, zz);
-fprintf(stderr, "bath: %d %d %d\n\n",
-data->bath[i], data->bath_acrosstrack[i], data->bath_alongtrack[i]);*/
-
-				/* deal with Mesotech SM2000 quality values */
-				if (data->sonar == MBSYS_RESON_MESOTECHSM2000)
-				    {
-				    if (data->quality[i] != 0)
-					data->quality[i] = 3;
-				    }
-				}
-
-			    /* set kind and done */
-			    done = MB_YES;
-			    data->kind = MB_DATA_DATA;
-
-			    /* print debug statements */
-			    if (verbose >= 4)
-				{
-				fprintf(stderr,"\ndbg4  New data read by MBIO function <%s>\n",function_name);
-				fprintf(stderr,"dbg4  New ping values:\n");
-				fprintf(stderr,"dbg4       kind:       %d\n",
-					data->kind);
-				fprintf(stderr,"dbg4       year:       %d\n",
-					data->year);
-				fprintf(stderr,"dbg4       month:      %d\n",
-					data->month);
-				fprintf(stderr,"dbg4       day:        %d\n",
-					data->day);
-				fprintf(stderr,"dbg4       hour:       %d\n",
-					data->hour);
-				fprintf(stderr,"dbg4       minute:     %d\n",
-					data->minute);
-				fprintf(stderr,"dbg4       second:     %d\n",
-					data->second);
-				fprintf(stderr,"dbg4       0.01 sec:   %d\n",
-					data->hundredth_sec);
-				fprintf(stderr,"dbg4       0.0001 sec: %d\n",
-					data->thousandth_sec);
-				fprintf(stderr,"dbg4       longitude:  %d\n",
-					data->longitude);
-				fprintf(stderr,"dbg4       latitude:   %d\n",
-					data->latitude);
-				fprintf(stderr,"dbg4       roll:       %d\n",
-					data->roll);
-				fprintf(stderr,"dbg4       pitch:      %d\n",
-					data->pitch);
-				fprintf(stderr,"dbg4       heading:    %d\n",
-					data->heading);
-				fprintf(stderr,"dbg4       heave:      %d\n",
-					data->heave);
-				fprintf(stderr,"dbg4       beams_bath: %d\n",
-					data->beams_bath);
-				fprintf(stderr,"dbg4       cnt bath xtrk ltrk tt ang qual\n");
-				for (i=0;i<data->beams_bath;i++)
-				fprintf(stderr,"dbg4       %3d  %6d %6d %6d %6d %6d %d\n",
-					i, data->bath[i],
-					data->bath_acrosstrack[i],
-					data->bath_alongtrack[i],
-					data->tt[i],
-					data->angle[i],
-					data->quality[i]);
-				}
-			    }
-			}
-
-		    /* deal with time data */
-		    else if (strncmp(line, "TND", 3) == 0)
-			{
-			nscan = sscanf(line+4, "%d:%d:%d %d/%d/%d",
-					&shour, &smin, &ssec,
-					&smon, &sday, &syr);
-			if (nscan == 6)
-			    {
-			    mb_fix_y2k(verbose, syr, &time_i[0]);
-			    time_i[1] = smon;
-			    time_i[2] = sday;
-			    time_i[3] = shour;
-			    time_i[4] = smin;
-			    time_i[5] = ssec;
-			    time_i[6] = 0;
-			    mb_get_time(verbose, time_i,
-					&data->start_time_d);
-			    data->par_year = syr;
-			    data->par_month = time_i[1];
-			    data->par_day = time_i[2];
-			    data->par_hour = time_i[3];
-			    data->par_minute = time_i[4];
-			    data->par_second = time_i[5];
-			    data->par_hundredth_sec = 0;
-			    data->par_thousandth_sec = 0;
-			    }
-			}
-
-		    /* deal with device data */
-		    else if (strncmp(line, "DEV", 3) == 0)
-			{
-			nscan = sscanf(line+4, "%d %d %s",
-					&ndevice, &device_type, device_name);
-			if (nscan == 3)
-			    {
-			    if (device_type == 4)
-				device_nav = ndevice;
-			    else if (device_type == 32)
-				device_gyro = ndevice;
-			    else if (device_type == 512)
-				device_hcp = ndevice;
-			    else if (device_type == 32784)
-				device_sb2 = ndevice;
-			    }
-			}
-
-		    /* deal with device offset data */
-		    else if (strncmp(line, "OFF", 3) == 0)
-			{
-			nscan = sscanf(line+4, "%d %lf %lf %lf %lf %lf %lf %lf",
-					&ndevice, &off1, &off2, &off3,
-					&off4, &off5, &off6, &off7);
-			if (nscan == 8)
-			    {
-			    if (ndevice == device_nav)
-				{
-				data->antenna_x = 100 * off1;
-				data->antenna_y = 100 * off2;
-				data->antenna_z = 100 * off3;
-				data->time_delay = 1000 * off7;
-				}
-			    else if (ndevice == device_hcp)
-				{
-				data->motion_sensor_x = 100 * off1;
-				data->motion_sensor_y = 100 * off2;
-				data->motion_sensor_z = 100 * off3;
-				data->heading_offset += 100 * off4;
-				data->roll_offset += 100 * off5;
-				data->pitch_offset += 100 * off6;
-				}
-			    else if (ndevice == device_sb2)
-				{
-				data->transducer_x = 100 * off1;
-				data->transducer_y = 100 * off2;
-				data->transducer_depth = 100 * off3;
-				data->heading_offset += 100 * off4;
-				data->roll_offset += 100 * off5;
-				data->pitch_offset += 100 * off6;
-				}
-			    }
-			}
-
-		    /* deal with private device data */
-		    else if (strncmp(line, "PRD", 3) == 0)
-			{
-			nscan = sscanf(line+4, "%d %s %lf %lf %d",
-					&ndevice, device_name,
-					&angle0, &angle_inc,
-					&sb2_nbeams);
-			if (nscan == 5)
-			    {
-			    if (ndevice == device_sb2)
-				{
-				data->beams_bath = sb2_nbeams;
-				data->angle0 = angle0;
-				data->angle_inc = angle_inc;
-				if (strcmp(device_name, "SEA8101") == 0)
-				    data->sonar = MBSYS_RESON_SEABAT8101;
-				else if (strcmp(device_name, "SM2000") == 0)
-				    data->sonar = MBSYS_RESON_MESOTECHSM2000;
-				}
-			    }
-			}
-
-		    /* deal with end of header */
-		    else if (strncmp(line, "EOH", 3) == 0)
-			{
-			/* set done and kind */
-			done = MB_YES;
-			data->kind = MB_DATA_PARAMETER;
-
-			/* print debug statements */
-			if (verbose >= 4)
-			    {
-			    fprintf(stderr,"\ndbg4  New data read by MBIO function <%s>\n",function_name);
-			    fprintf(stderr,"dbg4  New parameter values:\n");
-			    fprintf(stderr,"dbg4       kind:       %d\n",
-				    data->kind);
-			    fprintf(stderr,"dbg4       year:       %d\n",
-				    data->par_year);
-			    fprintf(stderr,"dbg4       month:      %d\n",
-				    data->par_month);
-			    fprintf(stderr,"dbg4       day:        %d\n",
-				    data->par_day);
-			    fprintf(stderr,"dbg4       hour:       %d\n",
-				    data->par_hour);
-			    fprintf(stderr,"dbg4       minute:     %d\n",
-				    data->par_minute);
-			    fprintf(stderr,"dbg4       second:     %d\n",
-				    data->par_second);
-			    fprintf(stderr,"dbg4       0.01 sec:   %d\n",
-				    data->par_hundredth_sec);
-			    fprintf(stderr,"dbg4       0.0001 sec: %d\n",
-				    data->par_thousandth_sec);
-			    fprintf(stderr,"dbg4       start_time_d:      %f\n",
-				    data->start_time_d);
-			    fprintf(stderr,"dbg4       angle0:            %f\n",
-				    data->angle0);
-			    fprintf(stderr,"dbg4       angle_inc:         %f\n",
-				    data->angle_inc);
-			    fprintf(stderr,"dbg4       beams_bath:        %d\n",
-				    data->beams_bath);
-			    fprintf(stderr,"dbg4       roll_offset:       %d\n",
-				    data->roll_offset);
-			    fprintf(stderr,"dbg4       pitch_offset:      %d\n",
-				    data->pitch_offset);
-			    fprintf(stderr,"dbg4       heading_offset:    %d\n",
-				    data->heading_offset);
-			    fprintf(stderr,"dbg4       time_delay:        %d\n",
-				    data->time_delay);
-			    fprintf(stderr,"dbg4       transducer_depth:  %d\n",
-				    data->transducer_depth);
-			    fprintf(stderr,"dbg4       transducer_height: %d\n",
-				    data->transducer_height);
-			    fprintf(stderr,"dbg4       transducer_x:      %d\n",
-				    data->transducer_x);
-			    fprintf(stderr,"dbg4       transducer_y:      %d\n",
-				    data->transducer_y);
-			    fprintf(stderr,"dbg4       antenna_x:         %d\n",
-				    data->antenna_x);
-			    fprintf(stderr,"dbg4       antenna_y:         %d\n",
-				    data->antenna_y);
-			    fprintf(stderr,"dbg4       antenna_z:         %d\n",
-				    data->antenna_z);
-			    fprintf(stderr,"dbg4       motion_sensor_x:   %d\n",
-				    data->motion_sensor_x);
-			    fprintf(stderr,"dbg4       motion_sensor_y:   %d\n",
-				    data->motion_sensor_y);
-			    fprintf(stderr,"dbg4       motion_sensor_z:   %d\n",
-				    data->motion_sensor_z);
-			    }
-			}
-		    }
-		}
-
-	/* get file position */
-	mb_io_ptr->file_bytes = ftell(mb_io_ptr->mbfp);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mbr_hysweep1.c b/src/mbio/mbr_hysweep1.c
deleted file mode 100644
index cd03836..0000000
--- a/src/mbio/mbr_hysweep1.c
+++ /dev/null
@@ -1,4077 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbr_hysweep1.c	12/23/2011
- *	$Id: mbr_hysweep1.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 2011-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbr_hysweep1.c contains the functions for reading and writing
- * multibeam data in the HYSWEEP1 format.
- * These functions include:
- *   mbr_alm_hysweep1	- allocate read/write memory
- *   mbr_dem_hysweep1	- deallocate read/write memory
- *   mbr_rt_hysweep1	- read and translate data
- *   mbr_wt_hysweep1	- translate and write data
- *
- * Author:	D. W. Caress
- * Date:	December 23,2011
- *
- * $Log: mbr_hysweep1.c,v $
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mb_define.h"
-#include "mbsys_hysweep.h"
-
-/* include for byte swapping */
-#include "mb_swap.h"
-
-/* local defines */
-
-/* turn on debug statements here */
-/* #define MBR_HYSWEEP1_DEBUG 1 */
-/* #define MBR_HYSWEEP1_DEBUG2 1 */
-
-/* essential function prototypes */
-int mbr_register_hysweep1(int verbose, void *mbio_ptr,
-		int *error);
-int mbr_info_hysweep1(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_alm_hysweep1(int verbose, void *mbio_ptr, int *error);
-int mbr_dem_hysweep1(int verbose, void *mbio_ptr, int *error);
-int mbr_rt_hysweep1(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_wt_hysweep1(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-
-int mbr_hysweep1_rd_data(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_hysweep1_rd_line(int verbose, FILE *mbfp, char *line, int *error);
-int mbr_hysweep1_wr_data(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-
-static char rcs_id[]="$Id: mbr_hysweep1.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mbr_register_hysweep1(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_register_hysweep1";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* get mb_io_ptr */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set format info parameters */
-	status = mbr_info_hysweep1(verbose,
-			&mb_io_ptr->system,
-			&mb_io_ptr->beams_bath_max,
-			&mb_io_ptr->beams_amp_max,
-			&mb_io_ptr->pixels_ss_max,
-			mb_io_ptr->format_name,
-			mb_io_ptr->system_name,
-			mb_io_ptr->format_description,
-			&mb_io_ptr->numfile,
-			&mb_io_ptr->filetype,
-			&mb_io_ptr->variable_beams,
-			&mb_io_ptr->traveltime,
-			&mb_io_ptr->beam_flagging,
-			&mb_io_ptr->nav_source,
-			&mb_io_ptr->heading_source,
-			&mb_io_ptr->vru_source,
-			&mb_io_ptr->svp_source,
-			&mb_io_ptr->beamwidth_xtrack,
-			&mb_io_ptr->beamwidth_ltrack,
-			error);
-
-	/* set format and system specific function pointers */
-	mb_io_ptr->mb_io_format_alloc = &mbr_alm_hysweep1;
-	mb_io_ptr->mb_io_format_free = &mbr_dem_hysweep1;
-	mb_io_ptr->mb_io_store_alloc = &mbsys_hysweep_alloc;
-	mb_io_ptr->mb_io_store_free = &mbsys_hysweep_deall;
-	mb_io_ptr->mb_io_read_ping = &mbr_rt_hysweep1;
-	mb_io_ptr->mb_io_write_ping = &mbr_wt_hysweep1;
-	mb_io_ptr->mb_io_dimensions = &mbsys_hysweep_dimensions;
-	mb_io_ptr->mb_io_pingnumber = &mbsys_hysweep_pingnumber;
-	mb_io_ptr->mb_io_extract = &mbsys_hysweep_extract;
-	mb_io_ptr->mb_io_insert = &mbsys_hysweep_insert;
-	mb_io_ptr->mb_io_extract_nav = &mbsys_hysweep_extract_nav;
-	mb_io_ptr->mb_io_extract_nnav = NULL;
-	mb_io_ptr->mb_io_insert_nav = &mbsys_hysweep_insert_nav;
-	mb_io_ptr->mb_io_extract_altitude = &mbsys_hysweep_extract_altitude;
-	mb_io_ptr->mb_io_insert_altitude = NULL;
-	mb_io_ptr->mb_io_extract_svp = NULL;
-	mb_io_ptr->mb_io_insert_svp = NULL;
-	mb_io_ptr->mb_io_ttimes = &mbsys_hysweep_ttimes;
-	mb_io_ptr->mb_io_detects = &mbsys_hysweep_detects;
-	mb_io_ptr->mb_io_gains = &mbsys_hysweep_gains;
-	mb_io_ptr->mb_io_copyrecord = &mbsys_hysweep_copy;
-	mb_io_ptr->mb_io_extract_rawss = NULL;
-	mb_io_ptr->mb_io_insert_rawss = NULL;
-	mb_io_ptr->mb_io_extract_segytraceheader = NULL;
-	mb_io_ptr->mb_io_extract_segy = NULL;
-	mb_io_ptr->mb_io_insert_segy = NULL;
-	mb_io_ptr->mb_io_ctd = NULL;
-	mb_io_ptr->mb_io_ancilliarysensor = NULL;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",mb_io_ptr->system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",mb_io_ptr->beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",mb_io_ptr->beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",mb_io_ptr->pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",mb_io_ptr->format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",mb_io_ptr->system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",mb_io_ptr->format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",mb_io_ptr->numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",mb_io_ptr->filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",mb_io_ptr->variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",mb_io_ptr->traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",mb_io_ptr->beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",mb_io_ptr->nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",mb_io_ptr->heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",mb_io_ptr->vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",mb_io_ptr->svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",mb_io_ptr->beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",mb_io_ptr->beamwidth_ltrack);
-		fprintf(stderr,"dbg2       format_alloc:       %p\n",(void *)mb_io_ptr->mb_io_format_alloc);
-		fprintf(stderr,"dbg2       format_free:        %p\n",(void *)mb_io_ptr->mb_io_format_free);
-		fprintf(stderr,"dbg2       store_alloc:        %p\n",(void *)mb_io_ptr->mb_io_store_alloc);
-		fprintf(stderr,"dbg2       store_free:         %p\n",(void *)mb_io_ptr->mb_io_store_free);
-		fprintf(stderr,"dbg2       read_ping:          %p\n",(void *)mb_io_ptr->mb_io_read_ping);
-		fprintf(stderr,"dbg2       write_ping:         %p\n",(void *)mb_io_ptr->mb_io_write_ping);
-		fprintf(stderr,"dbg2       extract:            %p\n",(void *)mb_io_ptr->mb_io_extract);
-		fprintf(stderr,"dbg2       insert:             %p\n",(void *)mb_io_ptr->mb_io_insert);
-		fprintf(stderr,"dbg2       extract_nav:        %p\n",(void *)mb_io_ptr->mb_io_extract_nav);
-		fprintf(stderr,"dbg2       insert_nav:         %p\n",(void *)mb_io_ptr->mb_io_insert_nav);
-		fprintf(stderr,"dbg2       extract_altitude:   %p\n",(void *)mb_io_ptr->mb_io_extract_altitude);
-		fprintf(stderr,"dbg2       insert_altitude:    %p\n",(void *)mb_io_ptr->mb_io_insert_altitude);
-		fprintf(stderr,"dbg2       extract_svp:        %p\n",(void *)mb_io_ptr->mb_io_extract_svp);
-		fprintf(stderr,"dbg2       insert_svp:         %p\n",(void *)mb_io_ptr->mb_io_insert_svp);
-		fprintf(stderr,"dbg2       ttimes:             %p\n",(void *)mb_io_ptr->mb_io_ttimes);
-		fprintf(stderr,"dbg2       detects:            %p\n",(void *)mb_io_ptr->mb_io_detects);
-		fprintf(stderr,"dbg2       extract_rawss:      %p\n",(void *)mb_io_ptr->mb_io_extract_rawss);
-		fprintf(stderr,"dbg2       insert_rawss:       %p\n",(void *)mb_io_ptr->mb_io_insert_rawss);
-		fprintf(stderr,"dbg2       extract_segytraceheader: %p\n",(void *)mb_io_ptr->mb_io_extract_segytraceheader);
-		fprintf(stderr,"dbg2       extract_segy:       %p\n",(void *)mb_io_ptr->mb_io_extract_segy);
-		fprintf(stderr,"dbg2       insert_segy:        %p\n",(void *)mb_io_ptr->mb_io_insert_segy);
-		fprintf(stderr,"dbg2       copyrecord:         %p\n",(void *)mb_io_ptr->mb_io_copyrecord);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbr_info_hysweep1(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error)
-{
-	char	*function_name = "mbr_info_hysweep1";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* set format info parameters */
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-	*system = MB_SYS_HYSWEEP;
-	*beams_bath_max = 512;
-	*beams_amp_max = 512;
-	*pixels_ss_max = MBSYS_HYSWEEP_MSS_NUM_PIXELS;
-	strncpy(format_name, "HYSWEEP1", MB_NAME_LENGTH);
-	strncpy(system_name, "HYSWEEP", MB_NAME_LENGTH);
-	strncpy(format_description, "Format name:          MBF_HYSWEEP1\nInformal Description: HYSWEEP multibeam data format\nAttributes:           Many multibeam sonars, \n                      bathymetry, amplitude\n                      variable beams, ascii, HYPACK.\n", MB_DESCRIPTION_LENGTH);
-	*numfile = 1;
-	*filetype = MB_FILETYPE_NORMAL;
-	*variable_beams = MB_YES;
-	*traveltime = MB_YES;
-	*beam_flagging = MB_YES;
-	*nav_source = MB_DATA_DATA;
-	*heading_source = MB_DATA_DATA;
-	*vru_source = MB_DATA_DATA;
-	*svp_source = MB_DATA_VELOCITY_PROFILE;
-	*beamwidth_xtrack = 1.0;
-	*beamwidth_ltrack = 1.0;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",*system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",*beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",*beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",*pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",*numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",*filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",*variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",*traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",*beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",*nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",*heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",*vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",*svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",*beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",*beamwidth_ltrack);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_alm_hysweep1(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_alm_hysweep1";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	int	*file_header_read;
-	int	*file_header_written;
-	int	*line_saved;
-	int	*RMB_read;
-	double	*pixel_size;
-	double	*swath_width;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set initial status */
-	status = MB_SUCCESS;
-
-	/* allocate memory for data structure */
-	mb_io_ptr->structure_size = 0;
-	mb_io_ptr->data_structure_size = 0;
-	status = mbsys_hysweep_alloc(
-			verbose,mbio_ptr,
-			&mb_io_ptr->store_data,error);
-
-	/* set saved values */
-	file_header_read = (int *) &mb_io_ptr->save1;
-	file_header_written = (int *) &mb_io_ptr->save2;
-	line_saved = (int *) &mb_io_ptr->save3;
-	RMB_read = (int *) &mb_io_ptr->save4;
-	*file_header_read = MB_NO;
-	*file_header_written = MB_NO;
-	*line_saved = MB_NO;
-	*RMB_read = MB_NO;
-	pixel_size = (double *) &mb_io_ptr->saved1;
-	swath_width = (double *) &mb_io_ptr->saved2;
-
-	*pixel_size = 0.0;
-	*swath_width = 0.0;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_dem_hysweep1(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_dem_hysweep1";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointers to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* deallocate memory for data descriptor */
-	status = mbsys_hysweep_deall(
-			verbose,mbio_ptr,
-			&mb_io_ptr->store_data,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_rt_hysweep1(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_rt_hysweep1";
-	int	status = MB_SUCCESS;
-	int	interp_status;
-	int	interp_error = MB_ERROR_NO_ERROR;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_hysweep_struct *store;
-	struct mbsys_hysweep_device_struct *device;
-	double	navlon, navlat;
-	double	speed;
-	double	alpha, beta, theta, phi;
-	double	rr, xx, zz;
-	double	*pixel_size, *swath_width;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointers to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* read next data from file */
-	status = mbr_hysweep1_rd_data(verbose,mbio_ptr,store_ptr,error);
-
-	/* get pointers to data structures */
-	store = (struct mbsys_hysweep_struct *) store_ptr;
-	pixel_size = (double *) &mb_io_ptr->saved1;
-	swath_width = (double *) &mb_io_ptr->saved2;
-
-	/* save position if primary data */
-	if (status == MB_SUCCESS
-		&& (store->kind == MB_DATA_NAV
-			|| store->kind == MB_DATA_NAV1
-			|| store->kind == MB_DATA_NAV2))
-		{
-		/* check device for being enabled */
-		device = (struct mbsys_hysweep_device_struct *)&(store->devices[store->POS_device_number]);
-		if (device->DV2_enabled == MB_YES)
-			{
-			/* add latest fix */
-			if (mb_io_ptr->projection_initialized == MB_YES)
-				{
-				mb_proj_inverse(verbose, mb_io_ptr->pjptr,
-								store->POS_x,
-								store->POS_y,
-								&navlon, &navlat,
-								error);
-				}
-			else
-				{
-				navlon = store->POS_x;
-				navlat = store->POS_y;
-				}
-			mb_navint_add(verbose, mbio_ptr,
-					store->time_d, navlon, navlat, error);
-/* fprintf(stderr,"POS %4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d   %f %f   %f %f\n",
-store->time_i[0],store->time_i[1],store->time_i[2],store->time_i[3],store->time_i[4],store->time_i[5],store->time_i[6],
-store->POS_x,store->POS_y,navlon,navlat);*/
-			}
-		}
-
-	/* save attitude if primary data */
-	if (status == MB_SUCCESS
-		&& store->kind == MB_DATA_ATTITUDE)
-		{
-		/* check device for being enabled */
-		device = (struct mbsys_hysweep_device_struct *)&(store->devices[store->HCP_device_number]);
-		if (device->DV2_enabled == MB_YES)
-			{
-			/* add latest attitude */
-			mb_attint_add(verbose, mbio_ptr,
-					store->time_d, -store->HCP_heave,
-					-store->HCP_roll, store->HCP_pitch, error);
-			}
-		}
-
-	/* save heading if primary data */
-	if (status == MB_SUCCESS
-		&& store->kind == MB_DATA_HEADING)
-		{
-		/* check device for being enabled */
-		device = (struct mbsys_hysweep_device_struct *)&(store->devices[store->GYR_device_number]);
-		if (device->DV2_enabled == MB_YES)
-			{
-			/* add latest attitude */
-			mb_hedint_add(verbose, mbio_ptr,
-					store->time_d, store->GYR_heading, error);
-			}
-		}
-
-	/* save sonardepth if primary data */
-	if (status == MB_SUCCESS
-		&& store->kind == MB_DATA_SONARDEPTH)
-		{
-		/* check device for being enabled */
-		device = (struct mbsys_hysweep_device_struct *)&(store->devices[store->DFT_device_number]);
-		if (device->DV2_enabled == MB_YES)
-			{
-			/* add latest attitude */
-			mb_depint_add(verbose, mbio_ptr,
-					store->time_d, store->DFT_draft, error);
-			}
-		}
-
-	/* save altitude if primary data */
-	if (status == MB_SUCCESS
-		&& store->kind == MB_DATA_ALTITUDE)
-		{
-		/* check device for being enabled */
-		device = (struct mbsys_hysweep_device_struct *)&(store->devices[store->EC1_device_number]);
-		if (device->DV2_enabled == MB_YES)
-			{
-			/* add latest attitude */
-			mb_altint_add(verbose, mbio_ptr,
-					store->time_d, store->EC1_rawdepth, error);
-			}
-		}
-#ifdef MBR_HYSWEEP1_DEBUG
-if (verbose > 0)
-fprintf(stderr,"Record returned: type:%d status:%d error:%d\n\n",store->kind, status, *error);
-#endif
-
-	/* if survey data then interpolate nav, heading, attitude, sonardepth onto ping times */
-	if (status == MB_SUCCESS
-		&& store->kind == MB_DATA_DATA)
-		{
-		speed = 0.0;
-		interp_status = mb_hedint_interp(verbose, mbio_ptr, store->time_d,
-				    &(store->RMBint_heading), &interp_error);
-		interp_status = mb_depint_interp(verbose, mbio_ptr, store->time_d,
-				    &(store->RMBint_draft), &interp_error);
-
-		/* ignore heading and sonar depth errors */
-		interp_error = MB_ERROR_NO_ERROR;
-
-		interp_status = mb_attint_interp(verbose, mbio_ptr, store->time_d,
-				    &(store->RMBint_heave), &(store->RMBint_roll),
-				    &(store->RMBint_pitch), &interp_error);
-		interp_status = mb_navint_interp(verbose, mbio_ptr, store->time_d, store->RMBint_heading, speed,
-				    &(store->RMBint_lon), &(store->RMBint_lat), &speed, &interp_error);
-		if (interp_status == MB_SUCCESS)
-			{
-			if (mb_io_ptr->projection_initialized == MB_YES)
-				{
-				mb_proj_forward(verbose, mb_io_ptr->pjptr,
-								store->RMBint_lon,
-								store->RMBint_lat,
-								&(store->RMBint_x),
-								&(store->RMBint_y),
-								error);
-				}
-			else
-				{
-				store->RMBint_x = store->RMBint_lon;
-				store->RMBint_y = store->RMBint_lat;
-				}
-			}
-		else
-			{
-			store->RMBint_lon = 0.0;
-			store->RMBint_lat = 0.0;
-			store->RMBint_x = 0.0;
-			store->RMBint_y = 0.0;
-			}
-/* fprintf(stderr,"RMB %4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d   %f %f   %f %f\n",
-store->time_i[0],store->time_i[1],store->time_i[2],store->time_i[3],store->time_i[4],store->time_i[5],store->time_i[6],
-store->RMBint_x,store->RMBint_y,store->RMBint_lon,store->RMBint_lat);*/
-		}
-
-	/* if survey data then calculate angles and bathymetry as necessary */
-	if (status == MB_SUCCESS
-		&& store->kind == MB_DATA_DATA)
-		{
-		/* get mapping sonar device pointer */
-		device = (struct mbsys_hysweep_device_struct *)&(store->devices[store->RMB_device_number]);
-
-		/* deal with case of multibeam sonar */
-		if (store->RMB_beam_data_available & 0x0001)
-			{
-			/* handle data that starts with beam angles in roll and pitch coordinates */
-			if (store->RMB_sonar_type == 1 || store->RMB_sonar_type == 2)
-				{
-				/* get beam roll angles if necessary */
-				if (!(store->RMB_beam_data_available & 0x0080))
-					{
-					for (i=0;i<store->RMB_num_beams;i++)
-						{
-						store->RMB_sounding_rollangles[i]
-							= device->MBI_first_beam_angle + i * device->MBI_angle_increment;
-						}
-					store->RMB_beam_data_available = store->RMB_beam_data_available | 0x0080;
-					}
-
-				/* get beam pitch angles if necessary */
-				if (!(store->RMB_beam_data_available & 0x0040))
-					{
-					for (i=0;i<store->RMB_num_beams;i++)
-						{
-						store->RMB_sounding_pitchangles[i] = 0.0;
-						}
-					store->RMB_beam_data_available = store->RMB_beam_data_available | 0x0040;
-					}
-				}
-
-			/* get beam takeoff and azimuthal angles if necessary */
-			if (!(store->RMB_beam_data_available & 0x0100)
-				|| !(store->RMB_beam_data_available & 0x0200))
-				{
-				for (i=0;i<store->RMB_num_beams;i++)
-					{
-					alpha = store->RMB_sounding_pitchangles[i];
-					beta = 90.0 + store->RMB_sounding_rollangles[i];
-
-					/* correct alpha for pitch if necessary */
-					if (!(device->MBI_sonar_flags & 0x0002))
-						alpha += store->RMBint_pitch;
-
-					/* correct beta for roll if necessary */
-					if (!(device->MBI_sonar_flags & 0x0001))
-						beta -= store->RMBint_roll;
-
-					mb_rollpitch_to_takeoff(
-						verbose,
-						alpha, beta,
-						&theta, &phi,
-						error);
-					store->RMB_sounding_takeoffangles[i] = theta;
-					store->RMB_sounding_azimuthalangles[i] = 90.0 - phi;
-					}
-				store->RMB_beam_data_available = store->RMB_beam_data_available | 0x0300;
-				}
-
-			/* get beam bathymetry if necessary */
-			if (!(store->RMB_beam_data_available & 0x0008)
-				|| !(store->RMB_beam_data_available & 0x0010)
-				|| !(store->RMB_beam_data_available & 0x0020))
-				{
-				for (i=0;i<store->RMB_num_beams;i++)
-					{
-					rr = store->RMB_beam_ranges[i];
-					theta = store->RMB_sounding_takeoffangles[i];
-					phi = 90.0 - store->RMB_sounding_azimuthalangles[i];
-					xx = rr * sin(DTR * theta);
-					zz = rr * cos(DTR * theta);
-					store->RMB_sounding_across[i] = xx * cos(DTR * phi);
-					store->RMB_sounding_along[i] = xx * sin(DTR * phi);
-					store->RMB_sounding_depths[i] = zz + store->RMBint_draft - store->RMBint_heave;
-					}
-				store->RMB_beam_data_available = store->RMB_beam_data_available | 0x0038;
-				}
-
-			/* get beam flags if necessary */
-			if (!(store->RMB_beam_data_available & 0x2000))
-				{
-				for (i=0;i<store->RMB_num_beams;i++)
-					{
-					store->RMB_sounding_flags[i] = MB_FLAG_NONE;
-					}
-				store->RMB_beam_data_available = store->RMB_beam_data_available | 0x2000;
-
-				/* incorporate quality values */
-				if ((store->RMB_beam_data_available & 0x1000)
-					&& strncmp(device->DEV_device_name, "Reson Seabat 8", 14) == 0)
-					{
-					for (i=0;i<store->RMB_num_beams;i++)
-						{
-						if (store->RMB_sounding_quality[i] < 2)
-							store->RMB_sounding_flags[i] = MB_FLAG_FLAG + MB_FLAG_SONAR;
-						}
-					}
-
-				/* check for null ranges */
-				if ((store->RMB_beam_data_available & 0x0001))
-					{
-					for (i=0;i<store->RMB_num_beams;i++)
-						{
-						if (store->RMB_beam_ranges[i] <= 0.0)
-							store->RMB_sounding_flags[i] = MB_FLAG_FLAG + MB_FLAG_SONAR;
-						}
-					}
-				}
-			}
-
-		/* deal with case of multiple transducer sonar */
-		if (store->RMB_beam_data_available & 0x0002)
-			{
-			/* get beam roll angles if necessary */
-			if (!(store->RMB_beam_data_available & 0x0080))
-				{
-				for (i=0;i<store->RMB_num_beams;i++)
-					{
-					store->RMB_sounding_rollangles[i] = 0.0;
-					}
-				store->RMB_beam_data_available = store->RMB_beam_data_available | 0x0080;
-				}
-
-			/* correct beam roll angles for roll if necessary */
-			if (!(device->MBI_sonar_flags & 0x0001))
-				{
-				for (i=0;i<store->RMB_num_beams;i++)
-					{
-					store->RMB_sounding_rollangles[i] += store->RMBint_roll;
-					}
-				}
-
-			/* get beam pitch angles if necessary */
-			if (!(store->RMB_beam_data_available & 0x0040))
-				{
-				if (!(device->MBI_sonar_flags & 0x0002))
-					{
-					for (i=0;i<store->RMB_num_beams;i++)
-						{
-						store->RMB_sounding_pitchangles[i] = store->RMBint_pitch;
-						}
-					}
-				else
-					{
-					for (i=0;i<store->RMB_num_beams;i++)
-						{
-						store->RMB_sounding_pitchangles[i] = 0.0;
-						}
-					}
-				store->RMB_beam_data_available = store->RMB_beam_data_available | 0x0040;
-				}
-
-			/* get beam takeoff and azimuthal angles if necessary */
-			if (!(store->RMB_beam_data_available & 0x0100)
-				|| !(store->RMB_beam_data_available & 0x0200))
-				{
-				for (i=0;i<store->RMB_num_beams;i++)
-					{
-					alpha = store->RMB_sounding_pitchangles[i];
-					beta = 90.0 - store->RMB_sounding_rollangles[i];
-					mb_rollpitch_to_takeoff(
-						verbose,
-						alpha, beta,
-						&theta, &phi,
-						error);
-					store->RMB_sounding_takeoffangles[i] = theta;
-					store->RMB_sounding_azimuthalangles[i] = 90.0 - phi;
-					}
-				store->RMB_beam_data_available = store->RMB_beam_data_available | 0x0300;
-				}
-
-			/* get beam bathymetry if necessary */
-			if (!(store->RMB_beam_data_available & 0x0004)
-				|| !(store->RMB_beam_data_available & 0x0008)
-				|| !(store->RMB_beam_data_available & 0x0010)
-				|| !(store->RMB_beam_data_available & 0x0020))
-				{
-				for (i=0;i<store->RMB_num_beams;i++)
-					{
-					rr = store->RMB_multi_ranges[i];
-					theta = store->RMB_sounding_takeoffangles[i];
-					phi = 90.0 - store->RMB_sounding_azimuthalangles[i];
-					xx = rr * sin(DTR * theta);
-					zz = rr * cos(DTR * theta);
-					store->RMB_sounding_across[i] = xx * cos(DTR * phi);
-					store->RMB_sounding_along[i] = xx * sin(DTR * phi);
-					store->RMB_sounding_depths[i] = zz + store->RMBint_draft - store->RMBint_heave;
-					}
-				store->RMB_beam_data_available = store->RMB_beam_data_available | 0x003C;
-				}
-
-			/* get beam flags if necessary */
-			if (!(store->RMB_beam_data_available & 0x2000))
-				{
-				for (i=0;i<store->RMB_num_beams;i++)
-					{
-					store->RMB_sounding_flags[i] = MB_FLAG_NONE;
-					}
-				store->RMB_beam_data_available = store->RMB_beam_data_available | 0x2000;
-				}
-			}
-
-		/* generate processed sidescan if needed */
-		if (store->MSS_ping_number != store->RSS_ping_number
-		    && (store->RSS_ping_number == store->RMB_ping_number
-			|| 10 * store->RSS_ping_number == store->RMB_ping_number))
-			{
-			status = mbsys_hysweep_makess(verbose, mbio_ptr, store_ptr,
-							MB_NO, pixel_size,
-							MB_NO, swath_width,
-							5, error);
-			}
-
-		/* print debug statements */
-		if (verbose >= 4)
-			{
-			fprintf(stderr,"\ndbg4  Multibeam bathymetry calculated by MBIO function <%s>\n",function_name);
-			fprintf(stderr,"dbg4       RMB_device_number:                 %d\n", store->RMB_device_number);
-			fprintf(stderr,"dbg4       RMB_time:                          %f\n", store->RMB_time);
-			fprintf(stderr,"dbg4       RMB_sonar_type:                    %x\n", store->RMB_sonar_type);
-			fprintf(stderr,"dbg4       RMB_sonar_flags:                   %x\n", store->RMB_sonar_flags);
-			fprintf(stderr,"dbg4       RMB_beam_data_available:           %x\n", store->RMB_beam_data_available);
-			fprintf(stderr,"dbg4       RMB_num_beams:                     %d\n", store->RMB_num_beams);
-			fprintf(stderr,"dbg4       RMB_num_beams_alloc:               %d\n", store->RMB_num_beams_alloc);
-			fprintf(stderr,"dbg4       RMB_sound_velocity:                %f\n", store->RMB_sound_velocity);
-			fprintf(stderr,"dbg4       RMB_ping_number:                   %d\n", store->RMB_ping_number);
-			for (i=0;i<store->RMB_num_beams;i++)
-				{
-				fprintf(stderr,"dbg4       beam:%4d", i);
-
-				if (store->RMB_beam_data_available & 0x0001)
-				fprintf(stderr," mbrng:%f", store->RMB_beam_ranges[i]);
-
-				if (store->RMB_beam_data_available & 0x0002)
-				fprintf(stderr," mtrng:%f", store->RMB_multi_ranges[i]);
-
-				if (store->RMB_beam_data_available & 0x0004)
-				fprintf(stderr," est:%f", store->RMB_sounding_eastings[i]);
-
-				if (store->RMB_beam_data_available & 0x0004)
-				fprintf(stderr," nor:%f", store->RMB_sounding_northings[i]);
-
-				if (store->RMB_beam_data_available & 0x0008)
-				fprintf(stderr," dep:%f", store->RMB_sounding_depths[i]);
-
-				if (store->RMB_beam_data_available & 0x0010)
-				fprintf(stderr," ltr:%f", store->RMB_sounding_along[i]);
-
-				if (store->RMB_beam_data_available & 0x0020)
-				fprintf(stderr," atr:%f", store->RMB_sounding_across[i]);
-
-				if (store->RMB_beam_data_available & 0x0040)
-				fprintf(stderr," pth:%f", store->RMB_sounding_pitchangles[i]);
-
-				if (store->RMB_beam_data_available & 0x0080)
-				fprintf(stderr," rll:%f", store->RMB_sounding_rollangles[i]);
-
-				if (store->RMB_beam_data_available & 0x0100)
-				fprintf(stderr," toa:%f", store->RMB_sounding_takeoffangles[i]);
-
-				if (store->RMB_beam_data_available & 0x0200)
-				fprintf(stderr," azi:%f", store->RMB_sounding_azimuthalangles[i]);
-
-				if (store->RMB_beam_data_available & 0x0400)
-				fprintf(stderr," tim:%d", store->RMB_sounding_timedelays[i]);
-
-				if (store->RMB_beam_data_available & 0x0800)
-				fprintf(stderr," int:%d", store->RMB_sounding_intensities[i]);
-
-				if (store->RMB_beam_data_available & 0x1000)
-				fprintf(stderr," qua:%d", store->RMB_sounding_quality[i]);
-
-				if (store->RMB_beam_data_available & 0x2000)
-				fprintf(stderr," flg:%d", store->RMB_sounding_flags[i]);
-
-				fprintf(stderr,"\n");
-				}
-			}
-		}
-
-	/* set error and kind in mb_io_ptr */
-	mb_io_ptr->new_error = *error;
-	mb_io_ptr->new_kind = store->kind;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_wt_hysweep1(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_wt_hysweep1";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_hysweep_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_hysweep_struct *) store_ptr;
-
-	/* write next data to file */
-	status = mbr_hysweep1_wr_data(verbose,mbio_ptr,store_ptr,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_hysweep1_rd_data(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_hysweep1_rd_data";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_hysweep_struct *store;
-	struct mbsys_hysweep_device_struct *device;
-	struct mbsys_hysweep_device_offset_struct *offset;
-	int	*file_header_read;
-	int	*file_header_written;
-	int	*line_saved;
-	int	*RMB_read;
-	int	done;
-	char	*line;
-	int	nscan, nread;
-	char	*token;
-	int	DEV_device_number;
-	int	DEV_device_capability;
-	mb_path	DEV_device_name;
-	int	DV2_device_number;
-	int	DV2_device_capability;
-	int	DV2_towfish;
-	int	DV2_enabled;
-	int	HVF_device_number;
-	int	MBI_device_number;
-	int	MBI_sonar_type;
-	int	MBI_sonar_flags;
-	int	MBI_beam_data_available;
-	int	MBI_num_beams_1;
-	int	MBI_num_beams_2;
-	double	MBI_first_beam_angle;
-	double	MBI_angle_increment;
-	int	OF2_device_number;
-	int	OF2_offset_type;
-	double	OF2_offset_starboard;
-	double	OF2_offset_forward;
-	double	OF2_offset_vertical;
-	double	OF2_offset_yaw;
-	double	OF2_offset_roll;
-	double	OF2_offset_pitch;
-	double	OF2_offset_time;
-	int	SSI_device_number;
-	int	SSI_sonar_flags;
-	int	SSI_port_num_samples;
-	int	SSI_starboard_num_samples;
-	int	tmpRMB_device_number;
-	double	tmpRMB_time;
-	int	tmpRMB_sonar_type;
-	int	tmpRMB_sonar_flags;
-	int	tmpRMB_beam_data_available;
-	int	tmpRMB_num_beams;
-	double	tmpRMB_sound_velocity;
-	int	tmpRMB_ping_number;
-	int	SNRok, RSSok;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_hysweep_struct *) store_ptr;
-	line = store->readline;
-
-	/* get saved values */
-	file_header_read = (int *) &mb_io_ptr->save1;
-	file_header_written = (int *) &mb_io_ptr->save2;
-	line_saved = (int *) &mb_io_ptr->save3;
-	RMB_read = (int *) &mb_io_ptr->save4;
-
-	/* set file position */
-	mb_io_ptr->file_pos = mb_io_ptr->file_bytes;
-
-	/* loop over reading data until a record is ready for return */
-	done = MB_NO;
-	while (*error == MB_ERROR_NO_ERROR && done == MB_NO)
-		{
-/* if (*line_saved == MB_YES)
-fprintf(stderr,"SAVED:"); */
-		/* read the next line */
-		if (*line_saved == MB_NO)
-			status = mbr_hysweep1_rd_line(verbose, mb_io_ptr->mbfp, line, error);
-		else
-			*line_saved = MB_NO;
-/* fprintf(stderr,"line:%s",line); */
-
-		/* now make sense of the line */
-		if (status == MB_SUCCESS)
-			{
-			/* check if a new record has been encountered before the last one
-				has been processed */
-			if (*RMB_read == MB_YES && strncmp(line, "RMB", 3) == 0)
-				{
-				/* check for erroneous RMB records associated with non-multibeam devices */
-				/* parse the first line */
-				nscan = sscanf(line+4, "%d %lf %x %x %x %d %lf %d",
-						&(tmpRMB_device_number),
-						&(tmpRMB_time),
-						&(tmpRMB_sonar_type),
-						&(tmpRMB_sonar_flags),
-						&(tmpRMB_beam_data_available),
-						&(tmpRMB_num_beams),
-						&(tmpRMB_sound_velocity),
-						&(tmpRMB_ping_number));
-				if (nscan == 8 && store->devices[tmpRMB_device_number].DEV_device_capability >= 32768)
-					{
-					*line_saved = MB_YES;
-					done = MB_YES;
-					store->kind = MB_DATA_DATA;
-					store->time_d = store->TND_survey_time_d + store->RMB_time;
-					mb_get_date(verbose, store->time_d, store->time_i);
-					*RMB_read = MB_NO;
-					}
-				else
-					{
-					status = MB_FAILURE;
-					*error = MB_ERROR_UNINTELLIGIBLE;
-					}
-				}
-
-			/* RMB multibeam data record */
-			else if (strncmp(line, "RMB", 3) == 0)
-				{
-/* fprintf(stderr,"Reading line because *RMB_read:%d\n",*RMB_read); */
-
-				/* parse the first line */
-				nscan = sscanf(line+4, "%d %lf %x %x %x %d %lf %d",
-						&(tmpRMB_device_number),
-						&(tmpRMB_time),
-						&(tmpRMB_sonar_type),
-						&(tmpRMB_sonar_flags),
-						&(tmpRMB_beam_data_available),
-						&(tmpRMB_num_beams),
-						&(tmpRMB_sound_velocity),
-						&(tmpRMB_ping_number));
-				if (nscan == 8 && store->devices[tmpRMB_device_number].DEV_device_capability >= 32768)
-					{
-					store->type = MBSYS_HYSWEEP_RECORDTYPE_RMB;
-					store->RMB_device_number = tmpRMB_device_number;
-					store->RMB_time = tmpRMB_time;
-					store->RMB_sonar_type = tmpRMB_sonar_type;
-					store->RMB_sonar_flags = tmpRMB_sonar_flags;
-					store->RMB_beam_data_available = tmpRMB_beam_data_available;
-					store->RMB_num_beams = tmpRMB_num_beams;
-					store->RMB_sound_velocity = tmpRMB_sound_velocity;
-					store->RMB_ping_number = tmpRMB_ping_number;
-					}
-				else
-					{
-					status = MB_FAILURE;
-					*error = MB_ERROR_UNINTELLIGIBLE;
-					}
-
-				/* allocate space for beam data if required */
-				if (status == MB_SUCCESS
-					&& store->RMB_num_beams > store->RMB_num_beams_alloc)
-					{
-					status = mb_reallocd(verbose, __FILE__, __LINE__, store->RMB_num_beams * sizeof(double),
-									(void **)&(store->RMB_beam_ranges), error);
-					status = mb_reallocd(verbose, __FILE__, __LINE__, store->RMB_num_beams * sizeof(double),
-									(void **)&(store->RMB_multi_ranges), error);
-					status = mb_reallocd(verbose, __FILE__, __LINE__, store->RMB_num_beams * sizeof(double),
-									(void **)&(store->RMB_sounding_eastings), error);
-					status = mb_reallocd(verbose, __FILE__, __LINE__, store->RMB_num_beams * sizeof(double),
-									(void **)&(store->RMB_sounding_northings), error);
-					status = mb_reallocd(verbose, __FILE__, __LINE__, store->RMB_num_beams * sizeof(double),
-									(void **)&(store->RMB_sounding_depths), error);
-					status = mb_reallocd(verbose, __FILE__, __LINE__, store->RMB_num_beams * sizeof(double),
-									(void **)&(store->RMB_sounding_across), error);
-					status = mb_reallocd(verbose, __FILE__, __LINE__, store->RMB_num_beams * sizeof(double),
-									(void **)&(store->RMB_sounding_along), error);
-					status = mb_reallocd(verbose, __FILE__, __LINE__, store->RMB_num_beams * sizeof(double),
-									(void **)&(store->RMB_sounding_pitchangles), error);
-					status = mb_reallocd(verbose, __FILE__, __LINE__, store->RMB_num_beams * sizeof(double),
-									(void **)&(store->RMB_sounding_rollangles), error);
-					status = mb_reallocd(verbose, __FILE__, __LINE__, store->RMB_num_beams * sizeof(double),
-									(void **)&(store->RMB_sounding_takeoffangles), error);
-					status = mb_reallocd(verbose, __FILE__, __LINE__, store->RMB_num_beams * sizeof(double),
-									(void **)&(store->RMB_sounding_azimuthalangles), error);
-					status = mb_reallocd(verbose, __FILE__, __LINE__, store->RMB_num_beams * sizeof(int),
-									(void **)&(store->RMB_sounding_timedelays), error);
-					status = mb_reallocd(verbose, __FILE__, __LINE__, store->RMB_num_beams * sizeof(int),
-									(void **)&(store->RMB_sounding_intensities), error);
-					status = mb_reallocd(verbose, __FILE__, __LINE__, store->RMB_num_beams * sizeof(int),
-									(void **)&(store->RMB_sounding_quality), error);
-					status = mb_reallocd(verbose, __FILE__, __LINE__, store->RMB_num_beams * sizeof(int),
-									(void **)&(store->RMB_sounding_flags), error);
-					}
-
-				/* read and parse RMB_beam_ranges if included */
-				if (status == MB_SUCCESS
-					&& store->RMB_beam_data_available & 0x0001)
-					{
-					/* read the next line */
-					status = mbr_hysweep1_rd_line(verbose, mb_io_ptr->mbfp, line, error);
-
-					/* parse the line */
-					if (status == MB_SUCCESS
-						&& (token = strtok(line+0, " ")) != NULL)
-						{
-						nread = 0;
-						for (i=0;i<store->RMB_num_beams && token != NULL;i++)
-							{
-							nscan = sscanf(token, "%lf", &(store->RMB_beam_ranges[i]));
-							if (nscan == 1)
-								nread++;
-							token = strtok(NULL, " ");
-							}
-						if (nread != store->RMB_num_beams)
-							{
-							status = MB_FAILURE;
-							*error = MB_ERROR_UNINTELLIGIBLE;
-							}
-						}
-
-					}
-
-				/* read and parse RMB_multi_ranges if included */
-				if (status == MB_SUCCESS
-					&& store->RMB_beam_data_available & 0x0002)
-					{
-					/* read the next line */
-					status = mbr_hysweep1_rd_line(verbose, mb_io_ptr->mbfp, line, error);
-
-					/* parse the line */
-					if (status == MB_SUCCESS
-						&& (token = strtok(line+0, " ")) != NULL)
-						{
-						nread = 0;
-						for (i=0;i<store->RMB_num_beams && token != NULL;i++)
-							{
-							nscan = sscanf(token, "%lf", &(store->RMB_multi_ranges[i]));
-							if (nscan == 1)
-								nread++;
-							token = strtok(NULL, " ");
-							}
-						if (nread != store->RMB_num_beams)
-							{
-							status = MB_FAILURE;
-							*error = MB_ERROR_UNINTELLIGIBLE;
-							}
-						}
-
-					}
-
-				/* read and parse   if included */
-				if (status == MB_SUCCESS
-					&& store->RMB_beam_data_available & 0x0004)
-					{
-					/* read the next line */
-					status = mbr_hysweep1_rd_line(verbose, mb_io_ptr->mbfp, line, error);
-
-					/* parse the line */
-					if (status == MB_SUCCESS
-						&& (token = strtok(line+0, " ")) != NULL)
-						{
-						nread = 0;
-						for (i=0;i<store->RMB_num_beams && token != NULL;i++)
-							{
-							nscan = sscanf(token, "%lf", &(store->RMB_sounding_eastings[i]));
-							if (nscan == 1)
-								nread++;
-							token = strtok(NULL, " ");
-							}
-						if (nread != store->RMB_num_beams)
-							{
-							status = MB_FAILURE;
-							*error = MB_ERROR_UNINTELLIGIBLE;
-							}
-						}
-
-					}
-
-				/* read and parse RMB_sounding_northings if included */
-				if (status == MB_SUCCESS
-					&& store->RMB_beam_data_available & 0x0004)
-					{
-					/* read the next line */
-					status = mbr_hysweep1_rd_line(verbose, mb_io_ptr->mbfp, line, error);
-
-					/* parse the line */
-					if (status == MB_SUCCESS
-						&& (token = strtok(line+0, " ")) != NULL)
-						{
-						nread = 0;
-						for (i=0;i<store->RMB_num_beams && token != NULL;i++)
-							{
-							nscan = sscanf(token, "%lf", &(store->RMB_sounding_northings[i]));
-							if (nscan == 1)
-								nread++;
-							token = strtok(NULL, " ");
-							}
-						if (nread != store->RMB_num_beams)
-							{
-							status = MB_FAILURE;
-							*error = MB_ERROR_UNINTELLIGIBLE;
-							}
-						}
-
-					}
-
-				/* read and parse RMB_sounding_depths if included */
-				if (status == MB_SUCCESS
-					&& store->RMB_beam_data_available & 0x0008)
-					{
-					/* read the next line */
-					status = mbr_hysweep1_rd_line(verbose, mb_io_ptr->mbfp, line, error);
-
-					/* parse the line */
-					if (status == MB_SUCCESS
-						&& (token = strtok(line+0, " ")) != NULL)
-						{
-						nread = 0;
-						for (i=0;i<store->RMB_num_beams && token != NULL;i++)
-							{
-							nscan = sscanf(token, "%lf", &(store->RMB_sounding_depths[i]));
-							if (nscan == 1)
-								nread++;
-							token = strtok(NULL, " ");
-							}
-						if (nread != store->RMB_num_beams)
-							{
-							status = MB_FAILURE;
-							*error = MB_ERROR_UNINTELLIGIBLE;
-							}
-						}
-
-					}
-
-				/* read and parse RMB_sounding_along if included */
-				if (status == MB_SUCCESS
-					&& store->RMB_beam_data_available & 0x0010)
-					{
-					/* read the next line */
-					status = mbr_hysweep1_rd_line(verbose, mb_io_ptr->mbfp, line, error);
-
-					/* parse the line */
-					if (status == MB_SUCCESS
-						&& (token = strtok(line+0, " ")) != NULL)
-						{
-						nread = 0;
-						for (i=0;i<store->RMB_num_beams && token != NULL;i++)
-							{
-							nscan = sscanf(token, "%lf", &(store->RMB_sounding_along[i]));
-							if (nscan == 1)
-								nread++;
-							token = strtok(NULL, " ");
-							}
-						if (nread != store->RMB_num_beams)
-							{
-							status = MB_FAILURE;
-							*error = MB_ERROR_UNINTELLIGIBLE;
-							}
-						}
-
-					}
-
-				/* read and parse RMB_sounding_across if included */
-				if (status == MB_SUCCESS
-					&& store->RMB_beam_data_available & 0x0020)
-					{
-					/* read the next line */
-					status = mbr_hysweep1_rd_line(verbose, mb_io_ptr->mbfp, line, error);
-
-					/* parse the line */
-					if (status == MB_SUCCESS
-						&& (token = strtok(line+0, " ")) != NULL)
-						{
-						nread = 0;
-						for (i=0;i<store->RMB_num_beams && token != NULL;i++)
-							{
-							nscan = sscanf(token, "%lf", &(store->RMB_sounding_across[i]));
-							if (nscan == 1)
-								nread++;
-							token = strtok(NULL, " ");
-							}
-						if (nread != store->RMB_num_beams)
-							{
-							status = MB_FAILURE;
-							*error = MB_ERROR_UNINTELLIGIBLE;
-							}
-						}
-
-					}
-
-				/* read and parse RMB_sounding_pitchangles if included */
-				if (status == MB_SUCCESS
-					&& store->RMB_beam_data_available & 0x0040)
-					{
-					/* read the next line */
-					status = mbr_hysweep1_rd_line(verbose, mb_io_ptr->mbfp, line, error);
-
-					/* parse the line */
-					if (status == MB_SUCCESS
-						&& (token = strtok(line+0, " ")) != NULL)
-						{
-						nread = 0;
-						for (i=0;i<store->RMB_num_beams && token != NULL;i++)
-							{
-							nscan = sscanf(token, "%lf", &(store->RMB_sounding_pitchangles[i]));
-							if (nscan == 1)
-								nread++;
-							token = strtok(NULL, " ");
-							}
-						if (nread != store->RMB_num_beams)
-							{
-							status = MB_FAILURE;
-							*error = MB_ERROR_UNINTELLIGIBLE;
-							}
-						}
-
-					}
-
-				/* read and parse RMB_sounding_rollangles if included */
-				if (status == MB_SUCCESS
-					&& store->RMB_beam_data_available & 0x0080)
-					{
-					/* read the next line */
-					status = mbr_hysweep1_rd_line(verbose, mb_io_ptr->mbfp, line, error);
-
-					/* parse the line */
-					if (status == MB_SUCCESS
-						&& (token = strtok(line+0, " ")) != NULL)
-						{
-						nread = 0;
-						for (i=0;i<store->RMB_num_beams && token != NULL;i++)
-							{
-							nscan = sscanf(token, "%lf", &(store->RMB_sounding_rollangles[i]));
-							if (nscan == 1)
-								nread++;
-							token = strtok(NULL, " ");
-							}
-						if (nread != store->RMB_num_beams)
-							{
-							status = MB_FAILURE;
-							*error = MB_ERROR_UNINTELLIGIBLE;
-							}
-						}
-
-					}
-
-				/* read and parse RMB_sounding_takeoffangles if included */
-				if (status == MB_SUCCESS
-					&& store->RMB_beam_data_available & 0x0100)
-					{
-					/* read the next line */
-					status = mbr_hysweep1_rd_line(verbose, mb_io_ptr->mbfp, line, error);
-
-					/* parse the line */
-					if (status == MB_SUCCESS
-						&& (token = strtok(line+0, " ")) != NULL)
-						{
-						nread = 0;
-						for (i=0;i<store->RMB_num_beams && token != NULL;i++)
-							{
-							nscan = sscanf(token, "%lf", &(store->RMB_sounding_takeoffangles[i]));
-							if (nscan == 1)
-								nread++;
-							token = strtok(NULL, " ");
-							}
-						if (nread != store->RMB_num_beams)
-							{
-							status = MB_FAILURE;
-							*error = MB_ERROR_UNINTELLIGIBLE;
-							}
-						}
-
-					}
-
-				/* read and parse RMB_sounding_azimuthalangles if included */
-				if (status == MB_SUCCESS
-					&& store->RMB_beam_data_available & 0x0200)
-					{
-					/* read the next line */
-					status = mbr_hysweep1_rd_line(verbose, mb_io_ptr->mbfp, line, error);
-
-					/* parse the line */
-					if (status == MB_SUCCESS
-						&& (token = strtok(line+0, " ")) != NULL)
-						{
-						nread = 0;
-						for (i=0;i<store->RMB_num_beams && token != NULL;i++)
-							{
-							nscan = sscanf(token, "%lf", &(store->RMB_sounding_azimuthalangles[i]));
-							if (nscan == 1)
-								nread++;
-							token = strtok(NULL, " ");
-							}
-						if (nread != store->RMB_num_beams)
-							{
-							status = MB_FAILURE;
-							*error = MB_ERROR_UNINTELLIGIBLE;
-							}
-						}
-
-					}
-
-				/* read and parse RMB_sounding_timedelays if included */
-				if (status == MB_SUCCESS
-					&& store->RMB_beam_data_available & 0x0400)
-					{
-					/* read the next line */
-					status = mbr_hysweep1_rd_line(verbose, mb_io_ptr->mbfp, line, error);
-
-					/* parse the line */
-					if (status == MB_SUCCESS
-						&& (token = strtok(line+0, " ")) != NULL)
-						{
-						nread = 0;
-						for (i=0;i<store->RMB_num_beams && token != NULL;i++)
-							{
-							nscan = sscanf(token, "%d", &(store->RMB_sounding_timedelays[i]));
-							if (nscan == 1)
-								nread++;
-							token = strtok(NULL, " ");
-							}
-						if (nread != store->RMB_num_beams)
-							{
-							status = MB_FAILURE;
-							*error = MB_ERROR_UNINTELLIGIBLE;
-							}
-						}
-
-					}
-
-				/* read and parse RMB_sounding_intensities if included */
-				if (status == MB_SUCCESS
-					&& store->RMB_beam_data_available & 0x0800)
-					{
-					/* read the next line */
-					status = mbr_hysweep1_rd_line(verbose, mb_io_ptr->mbfp, line, error);
-
-					/* parse the line */
-					if (status == MB_SUCCESS
-						&& (token = strtok(line+0, " ")) != NULL)
-						{
-						nread = 0;
-						for (i=0;i<store->RMB_num_beams && token != NULL;i++)
-							{
-							nscan = sscanf(token, "%d", &(store->RMB_sounding_intensities[i]));
-							if (nscan == 1)
-								nread++;
-							token = strtok(NULL, " ");
-							}
-						if (nread != store->RMB_num_beams)
-							{
-							status = MB_FAILURE;
-							*error = MB_ERROR_UNINTELLIGIBLE;
-							}
-						}
-
-					}
-
-				/* read and parse RMB_sounding_quality if included */
-				if (status == MB_SUCCESS
-					&& store->RMB_beam_data_available & 0x1000)
-					{
-					/* read the next line */
-					status = mbr_hysweep1_rd_line(verbose, mb_io_ptr->mbfp, line, error);
-
-					/* parse the line */
-					if (status == MB_SUCCESS
-						&& (token = strtok(line+0, " ")) != NULL)
-						{
-						nread = 0;
-						for (i=0;i<store->RMB_num_beams && token != NULL;i++)
-							{
-							nscan = sscanf(token, "%d", &(store->RMB_sounding_quality[i]));
-							if (nscan == 1)
-								nread++;
-							token = strtok(NULL, " ");
-							}
-						if (nread != store->RMB_num_beams)
-							{
-							status = MB_FAILURE;
-							*error = MB_ERROR_UNINTELLIGIBLE;
-							}
-						}
-
-					}
-
-				/* read and parse RMB_sounding_flags if included */
-				if (status == MB_SUCCESS
-					&& store->RMB_beam_data_available & 0x2000)
-					{
-					/* read the next line */
-					status = mbr_hysweep1_rd_line(verbose, mb_io_ptr->mbfp, line, error);
-
-					/* parse the line */
-					if (status == MB_SUCCESS
-						&& (token = strtok(line+0, " ")) != NULL)
-						{
-						nread = 0;
-						for (i=0;i<store->RMB_num_beams && token != NULL;i++)
-							{
-							nscan = sscanf(token, "%d", &(store->RMB_sounding_flags[i]));
-							if (nscan == 1)
-								nread++;
-							token = strtok(NULL, " ");
-							}
-						if (nread != store->RMB_num_beams)
-							{
-							status = MB_FAILURE;
-							*error = MB_ERROR_UNINTELLIGIBLE;
-							}
-						}
-
-					}
-
-				/* print debug statements */
-				if (verbose >= 4)
-					{
-					fprintf(stderr,"\ndbg4  RMB data record read by MBIO function <%s>\n",function_name);
-					fprintf(stderr,"dbg4       RMB_device_number:                 %d\n", store->RMB_device_number);
-					fprintf(stderr,"dbg4       RMB_time:                          %f\n", store->RMB_time);
-					fprintf(stderr,"dbg4       RMB_sonar_type:                    %x\n", store->RMB_sonar_type);
-					fprintf(stderr,"dbg4       RMB_sonar_flags:                   %x\n", store->RMB_sonar_flags);
-					fprintf(stderr,"dbg4       RMB_beam_data_available:           %x\n", store->RMB_beam_data_available);
-					fprintf(stderr,"dbg4       RMB_num_beams:                     %d\n", store->RMB_num_beams);
-					fprintf(stderr,"dbg4       RMB_num_beams_alloc:               %d\n", store->RMB_num_beams_alloc);
-					fprintf(stderr,"dbg4       RMB_sound_velocity:                %f\n", store->RMB_sound_velocity);
-					fprintf(stderr,"dbg4       RMB_ping_number:                   %d\n", store->RMB_ping_number);
-					for (i=0;i<store->RMB_num_beams;i++)
-						{
-						fprintf(stderr,"dbg4       beam:%4d", i);
-
-						if (store->RMB_beam_data_available & 0x0001)
-						fprintf(stderr," %f", store->RMB_beam_ranges[i]);
-
-						if (store->RMB_beam_data_available & 0x0002)
-						fprintf(stderr," %f", store->RMB_multi_ranges[i]);
-
-						if (store->RMB_beam_data_available & 0x0004)
-						fprintf(stderr," %f", store->RMB_sounding_eastings[i]);
-
-						if (store->RMB_beam_data_available & 0x0004)
-						fprintf(stderr," %f", store->RMB_sounding_northings[i]);
-
-						if (store->RMB_beam_data_available & 0x0008)
-						fprintf(stderr," %f", store->RMB_sounding_depths[i]);
-
-						if (store->RMB_beam_data_available & 0x0010)
-						fprintf(stderr," %f", store->RMB_sounding_along[i]);
-
-						if (store->RMB_beam_data_available & 0x0020)
-						fprintf(stderr," %f", store->RMB_sounding_across[i]);
-
-						if (store->RMB_beam_data_available & 0x0040)
-						fprintf(stderr," %f", store->RMB_sounding_pitchangles[i]);
-
-						if (store->RMB_beam_data_available & 0x0080)
-						fprintf(stderr," %f", store->RMB_sounding_rollangles[i]);
-
-						if (store->RMB_beam_data_available & 0x0100)
-						fprintf(stderr," %f", store->RMB_sounding_takeoffangles[i]);
-
-						if (store->RMB_beam_data_available & 0x0200)
-						fprintf(stderr," %f", store->RMB_sounding_azimuthalangles[i]);
-
-						if (store->RMB_beam_data_available & 0x0400)
-						fprintf(stderr," %d", store->RMB_sounding_timedelays[i]);
-
-						if (store->RMB_beam_data_available & 0x0800)
-						fprintf(stderr," %d", store->RMB_sounding_intensities[i]);
-
-						if (store->RMB_beam_data_available & 0x1000)
-						fprintf(stderr," %d", store->RMB_sounding_quality[i]);
-
-						if (store->RMB_beam_data_available & 0x2000)
-						fprintf(stderr," %d", store->RMB_sounding_flags[i]);
-
-						fprintf(stderr,"\n");
-						}
-					}
-
-				/* check if this completes a survey ping */
-				if (status == MB_SUCCESS)
-					{
-					if (store->SNR_ping_number > 0)
-						{
-						if (store->SNR_ping_number == store->RMB_ping_number)
-							SNRok = MB_YES;
-						else if (10 * store->SNR_ping_number == store->RMB_ping_number)
-							SNRok = MB_YES;
-						else
-							SNRok = MB_NO;
-						}
-					else
-						SNRok = MB_YES;
-					if (store->RSS_ping_number > 0)
-						{
-						if (store->RSS_ping_number == store->RMB_ping_number)
-							RSSok = MB_YES;
-						else if (10 * store->RSS_ping_number == store->RMB_ping_number)
-							RSSok = MB_YES;
-						else
-							RSSok = MB_NO;
-						}
-					else
-						RSSok = MB_YES;
-					if (SNRok == MB_YES && RSSok == MB_YES)
-						{
-						done = MB_YES;
-						store->kind = MB_DATA_DATA;
-						store->time_d = store->TND_survey_time_d + store->RMB_time;
-						mb_get_date(verbose, store->time_d, store->time_i);
-						}
-/* fprintf(stderr,"RMB SNRok:%d RSSok:%d done:%d store->kind:%d\n",SNRok,RSSok,done,store->kind); */
-					}
-
-				/* set *RMB_read flag */
-				if (done == MB_NO && status == MB_SUCCESS)
-					*RMB_read = MB_YES;
-				}
-
-			/* RSS data record */
-			else if (strncmp(line, "RSS", 3) == 0)
-				{
-				store->type = MBSYS_HYSWEEP_RECORDTYPE_RSS;
-
-				/* parse the first line */
-				nscan = sscanf(line+4, "%d %lf %x %d %d %lf %d %lf %lf %d %d %d %d",
-						&(store->RSS_device_number),
-						&(store->RSS_time),
-						&(store->RSS_sonar_flags),
-						&(store->RSS_port_num_samples),
-						&(store->RSS_starboard_num_samples),
-						&(store->RSS_sound_velocity),
-						&(store->RSS_ping_number),
-						&(store->RSS_altitude),
-						&(store->RSS_sample_rate),
-						&(store->RSS_minimum_amplitude),
-						&(store->RSS_maximum_amplitude),
-						&(store->RSS_bit_shift),
-						&(store->RSS_frequency));
-				if (nscan != 13)
-					{
-					status = MB_FAILURE;
-					*error = MB_ERROR_UNINTELLIGIBLE;
-					}
-
-				/* allocate space for sidescan data if required */
-				if (status == MB_SUCCESS && store->RSS_port_num_samples > store->RSS_port_num_samples_alloc)
-					{
-					status = mb_reallocd(verbose, __FILE__, __LINE__, store->RSS_port_num_samples * sizeof(int),
-									(void **)&(store->RSS_port), error);
-					if (status == MB_SUCCESS)
-						store->RSS_port_num_samples_alloc = store->RSS_port_num_samples;
-					else
-						store->RSS_port_num_samples_alloc = 0;;
-					}
-				if (status == MB_SUCCESS && store->RSS_starboard_num_samples > store->RSS_starboard_num_samples_alloc)
-					{
-					status = mb_reallocd(verbose, __FILE__, __LINE__, store->RSS_starboard_num_samples * sizeof(int),
-									(void **)&(store->RSS_starboard), error);
-					if (status == MB_SUCCESS)
-						store->RSS_starboard_num_samples_alloc = store->RSS_starboard_num_samples;
-					else
-						store->RSS_starboard_num_samples_alloc = 0;;
-					}
-
-				/* read and parse RSS_port */
-				if (status == MB_SUCCESS)
-					{
-					/* read the next line */
-					status = mbr_hysweep1_rd_line(verbose, mb_io_ptr->mbfp, line, error);
-
-					/* parse the line */
-					if (status == MB_SUCCESS
-						&& (token = strtok(line+0, " ")) != NULL)
-						{
-						nread = 0;
-						for (i=0;i<store->RSS_port_num_samples && token != NULL;i++)
-							{
-							nscan = sscanf(token, "%d", &(store->RSS_port[i]));
-							if (nscan == 1)
-								nread++;
-							token = strtok(NULL, " ");
-							}
-						if (nread != store->RSS_port_num_samples)
-							{
-							status = MB_FAILURE;
-							*error = MB_ERROR_UNINTELLIGIBLE;
-							}
-						}
-					}
-
-				/* read and parse RSS_starboard */
-				if (status == MB_SUCCESS)
-					{
-					/* read the next line */
-					status = mbr_hysweep1_rd_line(verbose, mb_io_ptr->mbfp, line, error);
-
-					/* parse the line */
-					if (status == MB_SUCCESS
-						&& (token = strtok(line+0, " ")) != NULL)
-						{
-						nread = 0;
-						for (i=0;i<store->RSS_starboard_num_samples && token != NULL;i++)
-							{
-							nscan = sscanf(token, "%d", &(store->RSS_starboard[i]));
-							if (nscan == 1)
-								nread++;
-							token = strtok(NULL, " ");
-							}
-						if (nread != store->RSS_starboard_num_samples)
-							{
-							status = MB_FAILURE;
-							*error = MB_ERROR_UNINTELLIGIBLE;
-							}
-						}
-
-					}
-
-				/* print debug statements */
-				if (verbose >= 4)
-					{
-					fprintf(stderr,"\ndbg4  RMB data record read by MBIO function <%s>\n",function_name);
-					fprintf(stderr,"dbg4       RSS_device_number:                 %d\n", store->RSS_device_number);
-					fprintf(stderr,"dbg4       RSS_time:                          %f\n", store->RSS_time);
-					fprintf(stderr,"dbg4       RSS_sonar_flags:                   %x\n", store->RSS_sonar_flags);
-					fprintf(stderr,"dbg4       RSS_port_num_samples:              %d\n", store->RSS_port_num_samples);
-					fprintf(stderr,"dbg4       RSS_port_num_samples_alloc:        %d\n", store->RSS_port_num_samples_alloc);
-					fprintf(stderr,"dbg4       RSS_starboard_num_samples:         %d\n", store->RSS_starboard_num_samples);
-					fprintf(stderr,"dbg4       RSS_starboard_num_samples_alloc:   %d\n", store->RSS_starboard_num_samples_alloc);
-					fprintf(stderr,"dbg4       RSS_sound_velocity:                %f\n", store->RSS_sound_velocity);
-					fprintf(stderr,"dbg4       RSS_ping_number:                   %d\n", store->RSS_ping_number);
-					fprintf(stderr,"dbg4       RSS_altitude:                      %f\n", store->RSS_altitude);
-					fprintf(stderr,"dbg4       RSS_sample_rate:                   %f\n", store->RSS_sample_rate);
-					fprintf(stderr,"dbg4       RSS_minimum_amplitude:             %d\n", store->RSS_minimum_amplitude);
-					fprintf(stderr,"dbg4       RSS_maximum_amplitude:             %d\n", store->RSS_maximum_amplitude);
-					fprintf(stderr,"dbg4       RSS_bit_shift:                     %d\n", store->RSS_bit_shift);
-					fprintf(stderr,"dbg4       RSS_frequency:                     %d\n", store->RSS_frequency);
-					for (i=0;i<store->RSS_port_num_samples;i++)
-						{
-						fprintf(stderr,"dbg4       port pixel:%5d ss:%d\n", i, store->RSS_port[i]);
-						}
-					for (i=0;i<store->RSS_port_num_samples;i++)
-						{
-						fprintf(stderr,"dbg4       starboard pixel:%5d ss:%d\n", i, store->RSS_starboard[i]);
-						}
-					}
-
-				/* check if this completes a survey ping */
-				if (status == MB_SUCCESS)
-					{
-					if (store->RSS_ping_number == store->RMB_ping_number)
-						RSSok = MB_YES;
-					else if (10 * store->RSS_ping_number == store->RMB_ping_number)
-						RSSok = MB_YES;
-					else
-						RSSok = MB_NO;
-					if (store->SNR_ping_number > 0)
-						{
-						if (store->SNR_ping_number == store->RMB_ping_number)
-							SNRok = MB_YES;
-						else if (10 * store->SNR_ping_number == store->RMB_ping_number)
-							SNRok = MB_YES;
-						else
-							SNRok = MB_NO;
-						}
-					else
-						SNRok = MB_YES;
-					if (SNRok == MB_YES && RSSok == MB_YES)
-						{
-						done = MB_YES;
-						store->kind = MB_DATA_DATA;
-						store->time_d = store->TND_survey_time_d + store->RMB_time;
-						mb_get_date(verbose, store->time_d, store->time_i);
-						}
-/* fprintf(stderr,"RSS SNRok:%d RSSok:%d done:%d store->kind:%d\n",SNRok,RSSok,done,store->kind); */
-					}
-
-				/* set *RMB_read flag */
-				if (done == MB_YES)
-					*RMB_read = MB_NO;
-				}
-
-			/* MSS data record */
-			else if (strncmp(line, "MSS", 3) == 0)
-				{
-				store->type = MBSYS_HYSWEEP_RECORDTYPE_MSS;
-
-				/* parse the first line */
-				nscan = sscanf(line+4, "%d %lf %lf %d %lf %d",
-						&(store->MSS_device_number),
-						&(store->MSS_time),
-						&(store->MSS_sound_velocity),
-						&(store->MSS_num_pixels),
-						&(store->MSS_pixel_size),
-						&(store->MSS_ping_number));
-				if (nscan != 6)
-					{
-					status = MB_FAILURE;
-					*error = MB_ERROR_UNINTELLIGIBLE;
-					}
-
-				/* read and parse MSS_ss */
-				if (status == MB_SUCCESS)
-					{
-					/* read the next line */
-					status = mbr_hysweep1_rd_line(verbose, mb_io_ptr->mbfp, line, error);
-
-					/* parse the line */
-					if (status == MB_SUCCESS
-						&& (token = strtok(line+0, " ")) != NULL)
-						{
-						nread = 0;
-						for (i=0;i<store->MSS_num_pixels && token != NULL;i++)
-							{
-							nscan = sscanf(token, "%lf", &(store->MSS_ss[i]));
-							if (nscan == 1)
-								nread++;
-							token = strtok(NULL, " ");
-							}
-						if (nread != store->MSS_num_pixels)
-							{
-							status = MB_FAILURE;
-							*error = MB_ERROR_UNINTELLIGIBLE;
-							}
-						}
-					}
-
-				/* read and parse MSS_along */
-				if (status == MB_SUCCESS)
-					{
-					/* read the next line */
-					status = mbr_hysweep1_rd_line(verbose, mb_io_ptr->mbfp, line, error);
-
-					/* parse the line */
-					if (status == MB_SUCCESS
-						&& (token = strtok(line+0, " ")) != NULL)
-						{
-						nread = 0;
-						for (i=0;i<store->MSS_num_pixels && token != NULL;i++)
-							{
-							nscan = sscanf(token, "%lf", &(store->MSS_ss_along[i]));
-							if (nscan == 1)
-								nread++;
-							token = strtok(NULL, " ");
-							}
-						if (nread != store->MSS_num_pixels)
-							{
-							status = MB_FAILURE;
-							*error = MB_ERROR_UNINTELLIGIBLE;
-							}
-						}
-
-					/* calculate MSS_across */
-					for (i=0;i<store->MSS_num_pixels;i++)
-						{
-						store->MSS_ss_across[i] = store->MSS_pixel_size * (double)(i - (store->MSS_num_pixels / 2));;
-						}
-					}
-
-				/* print debug statements */
-				if (verbose >= 4)
-					{
-					fprintf(stderr,"\ndbg4  MSS data record read by MBIO function <%s>\n",function_name);
-					fprintf(stderr,"dbg4       MSS_device_number:                 %d\n", store->MSS_device_number);
-					fprintf(stderr,"dbg4       MSS_time:                          %f\n", store->MSS_time);
-					fprintf(stderr,"dbg4       MSS_sound_velocity:                %f\n", store->MSS_sound_velocity);
-					fprintf(stderr,"dbg4       MSS_num_pixels:                    %d\n", store->MSS_num_pixels);
-					fprintf(stderr,"dbg4       MSS_pixel_size:                    %f\n", store->MSS_pixel_size);
-					fprintf(stderr,"dbg4       MSS_ping_number:                   %d\n", store->MSS_ping_number);
-					for (i=0;i<store->MSS_num_pixels;i++)
-						{
-						fprintf(stderr,"dbg4       pixel:%5d ss:%f across:%f along:%f\n",
-							i, store->MSS_ss[i], store->MSS_ss_across[i], store->MSS_ss_along[i]);
-						}
-					}
-
-				/* the MSS record is always written before RMB and so never completes a survey ping */
-				}
-
-			/* SNR data record */
-			else if (strncmp(line, "SNR", 3) == 0)
-				{
-				store->type = MBSYS_HYSWEEP_RECORDTYPE_SNR;
-
-				/* parse the first line */
-				nscan = sscanf(line+4, "%d %lf %d %d %d %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf",
-						&(store->SNR_device_number),
-						&(store->SNR_time),
-						&(store->SNR_ping_number),
-						&(store->SNR_sonar_id),
-						&(store->SNR_num_settings),
-						&(store->SNR_settings[0]),
-						&(store->SNR_settings[1]),
-						&(store->SNR_settings[2]),
-						&(store->SNR_settings[3]),
-						&(store->SNR_settings[4]),
-						&(store->SNR_settings[5]),
-						&(store->SNR_settings[6]),
-						&(store->SNR_settings[7]),
-						&(store->SNR_settings[8]),
-						&(store->SNR_settings[9]),
-						&(store->SNR_settings[10]),
-						&(store->SNR_settings[11]));
-				if (nscan != (5 + store->SNR_num_settings))
-					{
-					status = MB_FAILURE;
-					*error = MB_ERROR_UNINTELLIGIBLE;
-					}
-
-				/* print debug statements */
-				if (verbose >= 4)
-					{
-					fprintf(stderr,"\ndbg4  SNR data record read by MBIO function <%s>\n",function_name);
-					fprintf(stderr,"dbg4       SNR_device_number:                 %d\n", store->SNR_device_number);
-					fprintf(stderr,"dbg4       SNR_time:                          %f\n", store->SNR_time);
-					fprintf(stderr,"dbg4       SNR_ping_number:                   %d\n", store->SNR_ping_number);
-					fprintf(stderr,"dbg4       SNR_sonar_id:                      %d\n", store->SNR_sonar_id);
-					fprintf(stderr,"dbg4       SNR_num_settings:                  %d\n", store->SNR_num_settings);
-					fprintf(stderr,"dbg4       SNR_settings[0]:                   %f\n", store->SNR_settings[0]);
-					fprintf(stderr,"dbg4       SNR_settings[1]:                   %f\n", store->SNR_settings[1]);
-					fprintf(stderr,"dbg4       SNR_settings[2]:                   %f\n", store->SNR_settings[2]);
-					fprintf(stderr,"dbg4       SNR_settings[3]:                   %f\n", store->SNR_settings[3]);
-					fprintf(stderr,"dbg4       SNR_settings[4]:                   %f\n", store->SNR_settings[4]);
-					fprintf(stderr,"dbg4       SNR_settings[5]:                   %f\n", store->SNR_settings[5]);
-					fprintf(stderr,"dbg4       SNR_settings[6]:                   %f\n", store->SNR_settings[6]);
-					fprintf(stderr,"dbg4       SNR_settings[7]:                   %f\n", store->SNR_settings[7]);
-					fprintf(stderr,"dbg4       SNR_settings[8]:                   %f\n", store->SNR_settings[8]);
-					fprintf(stderr,"dbg4       SNR_settings[9]:                   %f\n", store->SNR_settings[9]);
-					fprintf(stderr,"dbg4       SNR_settings[10]:                  %f\n", store->SNR_settings[10]);
-					fprintf(stderr,"dbg4       SNR_settings[11]:                  %f\n", store->SNR_settings[11]);
-					}
-
-				/* check if this completes a survey ping */
-				if (status == MB_SUCCESS)
-					{
-					if (store->SNR_ping_number == store->RMB_ping_number)
-						SNRok = MB_YES;
-					else if (10 * store->SNR_ping_number == store->RMB_ping_number)
-						SNRok = MB_YES;
-					else
-						SNRok = MB_NO;
-					if (store->RSS_ping_number > 0)
-						{
-						if (store->RSS_ping_number == store->RMB_ping_number)
-							RSSok = MB_YES;
-						else if (10 * store->RSS_ping_number == store->RMB_ping_number)
-							RSSok = MB_YES;
-						else
-							RSSok = MB_NO;
-						}
-					else
-						RSSok = MB_YES;
-					if (SNRok == MB_YES && RSSok == MB_YES)
-						{
-						done = MB_YES;
-						store->kind = MB_DATA_DATA;
-						store->time_d = store->TND_survey_time_d + store->RMB_time;
-						mb_get_date(verbose, store->time_d, store->time_i);
-						}
-					}
-
-				/* set *RMB_read flag */
-				if (done == MB_YES)
-					*RMB_read = MB_NO;
-				}
-
-			/* TID data record */
-			else if (strncmp(line, "TID", 3) == 0)
-				{
-				store->type = MBSYS_HYSWEEP_RECORDTYPE_TID;
-
-				/* parse the first line */
-				nscan = sscanf(line+4, "%d %lf %lf",
-						&(store->TID_device_number),
-						&(store->TID_time),
-						&(store->TID_tide));
-				if (nscan != 3)
-					{
-					status = MB_FAILURE;
-					*error = MB_ERROR_UNINTELLIGIBLE;
-					}
-
-				/* print debug statements */
-				if (verbose >= 4)
-					{
-					fprintf(stderr,"\ndbg4  TID data record read by MBIO function <%s>\n",function_name);
-					fprintf(stderr,"dbg4       TID_device_number:                 %d\n", store->TID_device_number);
-					fprintf(stderr,"dbg4       TID_time:                          %f\n", store->TID_time);
-					fprintf(stderr,"dbg4       TID_tide:                          %f\n", store->TID_tide);
-					}
-
-				/* if successful this completes a tide record */
-				if (status == MB_SUCCESS)
-					{
-					done = MB_YES;
-					store->kind = MB_DATA_TIDE;
-					store->time_d = store->TND_survey_time_d + store->TID_time;
-					mb_get_date(verbose, store->time_d, store->time_i);
-					}
-				}
-
-			/* HCP data record */
-			else if (strncmp(line, "HCP", 3) == 0)
-				{
-				store->type = MBSYS_HYSWEEP_RECORDTYPE_HCP;
-
-				/* parse the first line */
-				nscan = sscanf(line+4, "%d %lf %lf %lf %lf",
-						&(store->HCP_device_number),
-						&(store->HCP_time),
-						&(store->HCP_heave),
-						&(store->HCP_roll),
-						&(store->HCP_pitch));
-				if (nscan != 5)
-					{
-					status = MB_FAILURE;
-					*error = MB_ERROR_UNINTELLIGIBLE;
-					}
-
-				/* print debug statements */
-				if (verbose >= 4)
-					{
-					fprintf(stderr,"\ndbg4  HCP data record read by MBIO function <%s>\n",function_name);
-					fprintf(stderr,"dbg4       HCP_device_number:                 %d\n", store->HCP_device_number);
-					fprintf(stderr,"dbg4       HCP_time:                          %f\n", store->HCP_time);
-					fprintf(stderr,"dbg4       HCP_heave:                         %f\n", store->HCP_heave);
-					fprintf(stderr,"dbg4       HCP_roll:                          %f\n", store->HCP_roll);
-					fprintf(stderr,"dbg4       HCP_pitch:                         %f\n", store->HCP_pitch);
-					}
-
-				/* if successful this completes an attitude record */
-				if (status == MB_SUCCESS)
-					{
-					done = MB_YES;
-					store->kind = MB_DATA_ATTITUDE;
-					store->time_d = store->TND_survey_time_d + store->HCP_time;
-					mb_get_date(verbose, store->time_d, store->time_i);
-					}
-				}
-
-			/* EC1 data record */
-			else if (strncmp(line, "EC1", 3) == 0)
-				{
-				store->type = MBSYS_HYSWEEP_RECORDTYPE_EC1;
-
-				/* parse the first line */
-				nscan = sscanf(line+4, "%d %lf %lf",
-						&(store->EC1_device_number),
-						&(store->EC1_time),
-						&(store->EC1_rawdepth));
-				if (nscan != 3)
-					{
-					status = MB_FAILURE;
-					*error = MB_ERROR_UNINTELLIGIBLE;
-					}
-
-				/* print debug statements */
-				if (verbose >= 4)
-					{
-					fprintf(stderr,"\ndbg4  EC1 data record read by MBIO function <%s>\n",function_name);
-					fprintf(stderr,"dbg4       EC1_device_number:                 %d\n", store->EC1_device_number);
-					fprintf(stderr,"dbg4       EC1_time:                          %f\n", store->EC1_time);
-					fprintf(stderr,"dbg4       EC1_rawdepth:                      %f\n", store->EC1_rawdepth);
-					}
-
-				/* if successful this completes an altitude record */
-				if (status == MB_SUCCESS)
-					{
-					done = MB_YES;
-					store->kind = MB_DATA_ALTITUDE;
-					store->time_d = store->TND_survey_time_d + store->EC1_time;
-					mb_get_date(verbose, store->time_d, store->time_i);
-					}
-				}
-
-			/* GPS data record */
-			else if (strncmp(line, "GPS", 3) == 0)
-				{
-				store->type = MBSYS_HYSWEEP_RECORDTYPE_GPS;
-
-				/* parse the first line */
-				nscan = sscanf(line+4, "%d %lf %lf %lf %lf %d %d",
-						&(store->GPS_device_number),
-						&(store->GPS_time),
-						&(store->GPS_cog),
-						&(store->GPS_sog),
-						&(store->GPS_hdop),
-						&(store->GPS_mode),
-						&(store->GPS_nsats));
-				if (nscan != 7)
-					{
-					status = MB_FAILURE;
-					*error = MB_ERROR_UNINTELLIGIBLE;
-					}
-
-				/* print debug statements */
-				if (verbose >= 4)
-					{
-					fprintf(stderr,"\ndbg4  GPS data record read by MBIO function <%s>\n",function_name);
-					fprintf(stderr,"dbg4       GPS_device_number:                 %d\n", store->GPS_device_number);
-					fprintf(stderr,"dbg4       GPS_time:                          %f\n", store->GPS_time);
-					fprintf(stderr,"dbg4       GPS_cog:                           %f\n", store->GPS_cog);
-					fprintf(stderr,"dbg4       GPS_sog:                           %f\n", store->GPS_sog);
-					fprintf(stderr,"dbg4       GPS_hdop:                          %f\n", store->GPS_hdop);
-					fprintf(stderr,"dbg4       GPS_mode:                          %d\n", store->GPS_mode);
-					fprintf(stderr,"dbg4       GPS_nsats:                         %d\n", store->GPS_nsats);
-					}
-				}
-
-			/* GYR data record */
-			else if (strncmp(line, "GYR", 3) == 0)
-				{
-				store->type = MBSYS_HYSWEEP_RECORDTYPE_GYR;
-
-				/* parse the first line */
-				nscan = sscanf(line+4, "%d %lf %lf",
-						&(store->GYR_device_number),
-						&(store->GYR_time),
-						&(store->GYR_heading));
-				if (nscan != 3)
-					{
-					status = MB_FAILURE;
-					*error = MB_ERROR_UNINTELLIGIBLE;
-					}
-
-				/* print debug statements */
-				if (verbose >= 4)
-					{
-					fprintf(stderr,"\ndbg4  GYR data record read by MBIO function <%s>\n",function_name);
-					fprintf(stderr,"dbg4       GYR_device_number:                 %d\n", store->GYR_device_number);
-					fprintf(stderr,"dbg4       GYR_time:                          %f\n", store->GYR_time);
-					fprintf(stderr,"dbg4       GYR_heading:                       %f\n", store->GYR_heading);
-					}
-
-				/* if successful this completes a heading record */
-				if (status == MB_SUCCESS)
-					{
-					done = MB_YES;
-					store->kind = MB_DATA_HEADING;
-					store->time_d = store->TND_survey_time_d + store->GYR_time;
-					mb_get_date(verbose, store->time_d, store->time_i);
-					}
-				}
-
-			/* POS data record */
-			else if (strncmp(line, "POS", 3) == 0)
-				{
-				store->type = MBSYS_HYSWEEP_RECORDTYPE_POS;
-
-				/* parse the first line */
-				nscan = sscanf(line+4, "%d %lf %lf %lf",
-						&(store->POS_device_number),
-						&(store->POS_time),
-						&(store->POS_x),
-						&(store->POS_y));
-				if (nscan != 4)
-					{
-					status = MB_FAILURE;
-					*error = MB_ERROR_UNINTELLIGIBLE;
-					}
-
-				/* print debug statements */
-				if (verbose >= 4)
-					{
-					fprintf(stderr,"\ndbg4  POS data record read by MBIO function <%s>\n",function_name);
-					fprintf(stderr,"dbg4       POS_device_number:                 %d\n", store->POS_device_number);
-					fprintf(stderr,"dbg4       POS_time:                          %f\n", store->POS_time);
-					fprintf(stderr,"dbg4       POS_x:                             %f\n", store->POS_x);
-					fprintf(stderr,"dbg4       POS_y:                             %f\n", store->POS_y);
-					}
-
-				/* if successful this completes a navigation record */
-				if (status == MB_SUCCESS)
-					{
-					done = MB_YES;
-					device = (struct mbsys_hysweep_device_struct *) &(store->devices[store->POS_device_number]);
-					if (device->DV2_enabled == MB_YES)
-						store->kind = MB_DATA_NAV;
-					else
-						store->kind = MB_DATA_NAV1;
-					store->time_d = store->TND_survey_time_d + store->POS_time;
-					mb_get_date(verbose, store->time_d, store->time_i);
-					}
-				}
-
-			/* DEV device data record */
-			else if (strncmp(line, "DEV", 3) == 0)
-				{
-				store->type = MBSYS_HYSWEEP_RECORDTYPE_DEV;
-
-				/* parse the first line */
-				token = strtok(line+4, " ");
-				nscan = sscanf(token, "%d", &(DEV_device_number));
-				if (nscan == 1)
-					{
-					token = strtok(NULL, " ");
-					nscan = sscanf(token, "%d", &(DEV_device_capability));
-					}
-				if (nscan == 1)
-					{
-					token = strtok(NULL, "\"");
-					strcpy(DEV_device_name, token);
-					nscan = 3;
-					}
-				if (nscan == 3)
-					{
-					device = (struct mbsys_hysweep_device_struct *) &(store->devices[DEV_device_number]);
-					device->DEV_device_number = DEV_device_number;
-					device->DEV_device_capability = DEV_device_capability;
-					strcpy(device->DEV_device_name, DEV_device_name);
-					store->num_devices++;
-					}
-				else
-					{
-					status = MB_FAILURE;
-					*error = MB_ERROR_UNINTELLIGIBLE;
-					}
-
-				/* print debug statements */
-				if (verbose >= 4)
-					{
-					fprintf(stderr,"\ndbg4  DEV data record read by MBIO function <%s>\n",function_name);
-					fprintf(stderr,"dbg4       DEV_device_number:                 %d\n", device->DEV_device_number);
-					fprintf(stderr,"dbg4       DEV_device_capability:             %d\n", device->DEV_device_capability);
-					fprintf(stderr,"dbg4       DEV_device_name:                   %s\n", device->DEV_device_name);
-					}
-				}
-
-			/* DV2 device data record */
-			else if (strncmp(line, "DV2", 3) == 0)
-				{
-				store->type = MBSYS_HYSWEEP_RECORDTYPE_DV2;
-
-				/* parse the first line */
-				nscan = sscanf(line+4, "%d %x %d %d",
-						&(DV2_device_number),
-						&(DV2_device_capability),
-						&(DV2_towfish),
-						&(DV2_enabled));
-				if (nscan == 4)
-					{
-					device = (struct mbsys_hysweep_device_struct *) &(store->devices[DEV_device_number]);
-					device->DV2_device_capability = DV2_device_capability;
-					device->DV2_towfish = DV2_towfish;
-					device->DV2_enabled = DV2_enabled;
-					}
-				else
-					{
-					status = MB_FAILURE;
-					*error = MB_ERROR_UNINTELLIGIBLE;
-					}
-
-				/* print debug statements */
-				if (verbose >= 4)
-					{
-					fprintf(stderr,"\ndbg4  DV2 data record read by MBIO function <%s>\n",function_name);
-					fprintf(stderr,"dbg4       DV2_device_number:                 %d\n", DV2_device_number);
-					fprintf(stderr,"dbg4       DV2_device_capability:             %d\n", device->DV2_device_capability);
-					fprintf(stderr,"dbg4       DV2_towfish:                       %d\n", device->DV2_towfish);
-					fprintf(stderr,"dbg4       DV2_enabled:                       %d\n", device->DV2_enabled);
-					}
-				}
-
-			/* EOH end of header data record */
-			else if (strncmp(line, "EOH", 3) == 0)
-				{
-				store->type = MBSYS_HYSWEEP_RECORDTYPE_EOH;
-
-				/* print debug statements */
-				if (verbose >= 4)
-					{
-					fprintf(stderr,"\ndbg4  EOH data record read by MBIO function <%s>\n",function_name);
-					}
-
-				/* handle some bookkeeping since the header has all been read */
-				*file_header_read = MB_YES;
-				
-				/* handle projection - if one is already initialized from
-				   a *.prj file leave it in place, if not use the first
-				   PRJ record in the file, if no projection set just use
-				   UTM01N */
-				if (mb_io_ptr->projection_initialized == MB_YES)
-					{
-					strcpy(store->PRJ_proj4_command,
-						mb_io_ptr->projection_id);
-					}
-				else
-					{
-					/* if no projection set just use UTM01N */
-					if (strlen(store->PRJ_proj4_command) == 0)
-						{
-						strcpy(store->PRJ_proj4_command, "UTM01N");
-						}
-						
-					/* initialize the projection */
-					mb_proj_init(verbose, store->PRJ_proj4_command,
-							&(mb_io_ptr->pjptr), error);
-					strcpy(mb_io_ptr->projection_id, store->PRJ_proj4_command);
-					mb_io_ptr->projection_initialized = MB_YES;
-					}
-				}
-
-			/* EOL end of line data record */
-			else if (strncmp(line, "EOL", 3) == 0)
-				{
-				store->type = MBSYS_HYSWEEP_RECORDTYPE_EOL;
-
-				/* print debug statements */
-				if (verbose >= 4)
-					{
-					fprintf(stderr,"\ndbg4  EOL data record read by MBIO function <%s>\n",function_name);
-					}
-				}
-
-			/* FTP file type data record */
-			else if (strncmp(line, "FTP", 3) == 0)
-				{
-				store->type = MBSYS_HYSWEEP_RECORDTYPE_FTP;
-
-				/* parse the first line */
-				nscan = sscanf(line+4, "%s",
-						store->FTP_record);
-				if (nscan != 1)
-					{
-					status = MB_FAILURE;
-					*error = MB_ERROR_UNINTELLIGIBLE;
-					}
-
-				/* print debug statements */
-				if (verbose >= 4)
-					{
-					fprintf(stderr,"\ndbg4  FTP data record read by MBIO function <%s>\n",function_name);
-					fprintf(stderr,"dbg4       FTP_record:                        %s\n", store->FTP_record);
-					}
-				}
-
-			/* VER file type data record */
-			else if (strncmp(line, "VER", 3) == 0)
-				{
-				store->type = MBSYS_HYSWEEP_RECORDTYPE_VER;
-
-				/* parse the first line */
-				nscan = sscanf(line+4, "%s",
-						store->VER_version);
-				if (nscan != 1)
-					{
-					status = MB_FAILURE;
-					*error = MB_ERROR_UNINTELLIGIBLE;
-					}
-
-				/* print debug statements */
-				if (verbose >= 4)
-					{
-					fprintf(stderr,"\ndbg4  VER data record read by MBIO function <%s>\n",function_name);
-					fprintf(stderr,"dbg4       VER_version:                       %s\n", store->VER_version);
-					}
-				}
-
-			/* HSP data record */
-			else if (strncmp(line, "HSP", 3) == 0)
-				{
-				store->type = MBSYS_HYSWEEP_RECORDTYPE_HSP;
-
-				/* parse the first line */
-				nscan = sscanf(line+4, "%lf %lf %lf %lf %lf %lf %d %d %lf %lf %d %d",
-						&(store->HSP_minimum_depth),
-						&(store->HSP_maximum_depth),
-						&(store->HSP_port_offset_limit),
-						&(store->HSP_stbd_offset_limit),
-						&(store->HSP_port_angle_limit),
-						&(store->HSP_stbd_angle_limit),
-						&(store->HSP_high_beam_quality),
-						&(store->HSP_low_beam_quality),
-						&(store->HSP_sonar_range),
-						&(store->HSP_towfish_layback),
-						&(store->HSP_units),
-						&(store->HSP_sonar_id));
-				if (nscan != 12)
-					{
-					status = MB_FAILURE;
-					*error = MB_ERROR_UNINTELLIGIBLE;
-					}
-
-				/* print debug statements */
-				if (verbose >= 4)
-					{
-					fprintf(stderr,"\ndbg4  HSP data record read by MBIO function <%s>\n",function_name);
-					fprintf(stderr,"dbg4       HSP_minimum_depth:                 %f\n", store->HSP_minimum_depth);
-					fprintf(stderr,"dbg4       HSP_maximum_depth:                 %f\n", store->HSP_maximum_depth);
-					fprintf(stderr,"dbg4       HSP_port_offset_limit:             %f\n", store->HSP_port_offset_limit);
-					fprintf(stderr,"dbg4       HSP_stbd_offset_limit:             %f\n", store->HSP_stbd_offset_limit);
-					fprintf(stderr,"dbg4       HSP_port_angle_limit:              %f\n", store->HSP_port_angle_limit);
-					fprintf(stderr,"dbg4       HSP_stbd_angle_limit:              %f\n", store->HSP_stbd_angle_limit);
-					fprintf(stderr,"dbg4       HSP_high_beam_quality:             %d\n", store->HSP_high_beam_quality);
-					fprintf(stderr,"dbg4       HSP_low_beam_quality:              %d\n", store->HSP_low_beam_quality);
-					fprintf(stderr,"dbg4       HSP_sonar_range:                   %f\n", store->HSP_sonar_range);
-					fprintf(stderr,"dbg4       HSP_towfish_layback:               %f\n", store->HSP_towfish_layback);
-					fprintf(stderr,"dbg4       HSP_units:                         %d\n", store->HSP_units);
-					fprintf(stderr,"dbg4       HSP_sonar_id:                      %d\n", store->HSP_sonar_id);
-					}
-				}
-
-			/* HSX data record */
-			else if (strncmp(line, "HSX", 3) == 0)
-				{
-				store->type = MBSYS_HYSWEEP_RECORDTYPE_HSX;
-
-				/* parse the first line */
-				nscan = sscanf(line+4, "%d",
-						&(store->HSX_record));
-				if (nscan != 1)
-					{
-					status = MB_FAILURE;
-					*error = MB_ERROR_UNINTELLIGIBLE;
-					}
-
-				/* print debug statements */
-				if (verbose >= 4)
-					{
-					fprintf(stderr,"\ndbg4  HSX data record read by MBIO function <%s>\n",function_name);
-					fprintf(stderr,"dbg4       HSX_record:                        %d\n", store->HSX_record);
-					}
-				}
-
-			/* HVF data record */
-			else if (strncmp(line, "HVF", 3) == 0)
-				{
-				store->type = MBSYS_HYSWEEP_RECORDTYPE_HVF;
-
-				/* parse the first line */
-				nscan = sscanf(line+4, "%d %lf %lf %lf %lf %lf %lf %lf",
-						&(HVF_device_number),
-						&(store->HVF_time_after_midnight),
-						&(store->HVF_minimum_depth),
-						&(store->HVF_maximum_depth),
-						&(store->HVF_port_offset_limit),
-						&(store->HVF_starboard_offset_limit),
-						&(store->HVF_minimum_angle_limit),
-						&(store->HVF_maximum_angle_limit));
-				if (nscan != 8)
-					{
-					status = MB_FAILURE;
-					*error = MB_ERROR_UNINTELLIGIBLE;
-					}
-
-				/* print debug statements */
-				if (verbose >= 4)
-					{
-					fprintf(stderr,"\ndbg4  HVF data record read by MBIO function <%s>\n",function_name);
-					fprintf(stderr,"dbg4       HVF_device_number:                 %d\n", HVF_device_number);
-					fprintf(stderr,"dbg4       HVF_time_after_midnight:           %f\n", store->HVF_time_after_midnight);
-					fprintf(stderr,"dbg4       HVF_minimum_depth:                 %f\n", store->HVF_minimum_depth);
-					fprintf(stderr,"dbg4       HVF_maximum_depth:                 %f\n", store->HVF_maximum_depth);
-					fprintf(stderr,"dbg4       HVF_port_offset_limit:             %f\n", store->HVF_port_offset_limit);
-					fprintf(stderr,"dbg4       HVF_starboard_offset_limit:        %f\n", store->HVF_starboard_offset_limit);
-					fprintf(stderr,"dbg4       HVF_minimum_angle_limit:           %f\n", store->HVF_minimum_angle_limit);
-					fprintf(stderr,"dbg4       HVF_maximum_angle_limit:           %f\n", store->HVF_maximum_angle_limit);
-					}
-				}
-
-			/* INF data record */
-			else if (strncmp(line, "INF", 3) == 0)
-				{
-				store->type = MBSYS_HYSWEEP_RECORDTYPE_INF;
-
-				/* parse the first line */
-				if (strncmp(line, "INF \"\" \"\" \"\" \"\" ", 16) == 0)
-					{
-					store->INF_surveyor[0] = '\0';
-					store->INF_boat[0] = '\0';
-					store->INF_project[0] = '\0';
-					store->INF_area[0] = '\0';
-					nscan = 0;
-					if (strlen(line) > 16)
-						nscan = sscanf(&(line[16]), "%lf %lf %lf",
-							&(store->INF_tide_correction),
-							&(store->INF_draft_correction),
-							&(store->INF_sound_velocity));
-					if (nscan < 3)
-						store->INF_sound_velocity = 1500.0;
-					if (nscan < 2)
-						store->INF_draft_correction = 0.0;
-					if (nscan < 1)
-						store->INF_tide_correction = 0.0;
-					}
-				else
-					{
-					if ((token = strtok(line+3, "\"")) != NULL)
-						{
-						token = strtok(NULL, "\"");
-						if (token != NULL && token[0] != ' ')
-							{
-							strcpy(store->INF_surveyor, token);
-							token = strtok(NULL, "\"");
-							}
-						else
-							store->INF_surveyor[0] = '\0';
-
-						token = strtok(NULL, "\"");
-						if (token != NULL && token[0] != ' ')
-							{
-							strcpy(store->INF_boat, token);
-							token = strtok(NULL, "\"");
-							}
-						else
-							store->INF_boat[0] = '\0';
-
-						token = strtok(NULL, "\"");
-						if (token != NULL && token[0] != ' ')
-							{
-							strcpy(store->INF_project, token);
-							token = strtok(NULL, "\"");
-							}
-						else
-							store->INF_project[0] = '\0';
-
-						token = strtok(NULL, "\"");
-						if (token != NULL && token[0] != ' ')
-							{
-							strcpy(store->INF_area, token);
-							token = strtok(NULL, "\"");
-							}
-						else
-							store->INF_area[0] = '\0';
-						}
-					nscan = 0;
-					if (token != NULL)
-						nscan = sscanf(token, "%lf %lf %lf",
-							&(store->INF_tide_correction),
-							&(store->INF_draft_correction),
-							&(store->INF_sound_velocity));
-					if (nscan < 3)
-						store->INF_sound_velocity = 1500.0;
-					if (nscan < 2)
-						store->INF_draft_correction = 0.0;
-					if (nscan < 1)
-						store->INF_tide_correction = 0.0;
-					}
-				if (nscan != 3)
-					{
-					status = MB_FAILURE;
-					*error = MB_ERROR_UNINTELLIGIBLE;
-					}
-
-				/* print debug statements */
-				if (verbose >= 4)
-					{
-					fprintf(stderr,"\ndbg4  INF data record read by MBIO function <%s>\n",function_name);
-					fprintf(stderr,"dbg4       INF_surveyor:                      %s\n", store->INF_surveyor);
-					fprintf(stderr,"dbg4       INF_boat:                          %s\n", store->INF_boat);
-					fprintf(stderr,"dbg4       INF_project:                       %s\n", store->INF_project);
-					fprintf(stderr,"dbg4       INF_area:                          %s\n", store->INF_area);
-					fprintf(stderr,"dbg4       INF_tide_correction:               %f\n", store->INF_tide_correction);
-					fprintf(stderr,"dbg4       INF_draft_correction:              %f\n", store->INF_draft_correction);
-					fprintf(stderr,"dbg4       INF_sound_velocity:                %f\n", store->INF_sound_velocity);
-					}
-				}
-
-			/* LBP data record */
-			else if (strncmp(line, "LBP", 3) == 0)
-				{
-				store->type = MBSYS_HYSWEEP_RECORDTYPE_LBP;
-
-				/* print debug statements */
-				if (verbose >= 4)
-					{
-					fprintf(stderr,"\ndbg4  LBP data record read by MBIO function <%s>\n",function_name);
-					}
-				}
-
-			/* LIN data record */
-			else if (strncmp(line, "LIN", 3) == 0)
-				{
-				store->type = MBSYS_HYSWEEP_RECORDTYPE_LIN;
-
-				/* print debug statements */
-				if (verbose >= 4)
-					{
-					fprintf(stderr,"\ndbg4  LIN data record read by MBIO function <%s>\n",function_name);
-					}
-				}
-
-			/* LNN data record */
-			else if (strncmp(line, "LNN", 3) == 0)
-				{
-				store->type = MBSYS_HYSWEEP_RECORDTYPE_LNN;
-
-				/* print debug statements */
-				if (verbose >= 4)
-					{
-					fprintf(stderr,"\ndbg4  LNN data record read by MBIO function <%s>\n",function_name);
-					}
-				}
-
-			/* MBI data record */
-			else if (strncmp(line, "MBI", 3) == 0)
-				{
-				store->type = MBSYS_HYSWEEP_RECORDTYPE_MBI;
-
-				/* parse the first line */
-				nscan = sscanf(line+4, "%d %x %x %x %d %d %lf %lf",
-						&(MBI_device_number),
-						&(MBI_sonar_type),
-						&(MBI_sonar_flags),
-						&(MBI_beam_data_available),
-						&(MBI_num_beams_1),
-						&(MBI_num_beams_2),
-						&(MBI_first_beam_angle),
-						&(MBI_angle_increment));
-				if (nscan == 8)
-					{
-					device = (struct mbsys_hysweep_device_struct *) &(store->devices[MBI_device_number]);
-					device->MBI_sonar_type = MBI_sonar_type;
-					device->MBI_sonar_flags = MBI_sonar_flags;
-					device->MBI_beam_data_available = MBI_beam_data_available;
-					device->MBI_num_beams_1 = MBI_num_beams_1;
-					device->MBI_num_beams_2 = MBI_num_beams_2;
-					device->MBI_first_beam_angle = MBI_first_beam_angle;
-					device->MBI_angle_increment = MBI_angle_increment;
-					}
-				else
-					{
-					status = MB_FAILURE;
-					*error = MB_ERROR_UNINTELLIGIBLE;
-					}
-
-				/* print debug statements */
-				if (verbose >= 4)
-					{
-					fprintf(stderr,"\ndbg4  MBI data record read by MBIO function <%s>\n",function_name);
-					fprintf(stderr,"dbg4       MBI_device_number:                 %d\n", MBI_device_number);
-					fprintf(stderr,"dbg4       MBI_sonar_id:                      %d\n", device->MBI_sonar_id);
-					fprintf(stderr,"dbg4       MBI_sonar_receive_shape:           %d\n", device->MBI_sonar_receive_shape);
-					fprintf(stderr,"dbg4       MBI_sonar_type:                    %x\n", device->MBI_sonar_type);
-					fprintf(stderr,"dbg4       MBI_sonar_flags:                   %x\n", device->MBI_sonar_flags);
-					fprintf(stderr,"dbg4       MBI_beam_data_available:           %x\n", device->MBI_beam_data_available);
-					fprintf(stderr,"dbg4       MBI_num_beams_1:                   %d\n", device->MBI_num_beams_1);
-					fprintf(stderr,"dbg4       MBI_num_beams_2:                   %d\n", device->MBI_num_beams_2);
-					fprintf(stderr,"dbg4       MBI_first_beam_angle:              %f\n", device->MBI_first_beam_angle);
-					fprintf(stderr,"dbg4       MBI_angle_increment:               %f\n", device->MBI_angle_increment);
-					}
-				}
-
-			/* OF2 data record */
-			else if (strncmp(line, "OF2", 3) == 0)
-				{
-				store->type = MBSYS_HYSWEEP_RECORDTYPE_OF2;
-
-				/* parse the first line */
-				nscan = sscanf(line+4, "%d %d %lf %lf %lf %lf %lf %lf %lf",
-						&(OF2_device_number),
-						&(OF2_offset_type),
-						&(OF2_offset_starboard),
-						&(OF2_offset_forward),
-						&(OF2_offset_vertical),
-						&(OF2_offset_yaw),
-						&(OF2_offset_roll),
-						&(OF2_offset_pitch),
-						&(OF2_offset_time));
-				if (nscan == 9)
-					{
-					device = (struct mbsys_hysweep_device_struct *) &(store->devices[OF2_device_number]);
-					offset = (struct mbsys_hysweep_device_offset_struct *) &(device->offsets[device->num_offsets]);
-					offset->OF2_offset_type = OF2_offset_type;
-					offset->OF2_offset_starboard = OF2_offset_starboard;
-					offset->OF2_offset_forward = OF2_offset_forward;
-					offset->OF2_offset_vertical = OF2_offset_vertical;
-					offset->OF2_offset_yaw = OF2_offset_yaw;
-					offset->OF2_offset_roll = OF2_offset_roll;
-					offset->OF2_offset_pitch = OF2_offset_pitch;
-					offset->OF2_offset_time = OF2_offset_time;
-					device->num_offsets++;
-					}
-				else
-					{
-					status = MB_FAILURE;
-					*error = MB_ERROR_UNINTELLIGIBLE;
-					}
-
-				/* print debug statements */
-				if (verbose >= 4)
-					{
-					fprintf(stderr,"\ndbg4  OF2 data record read by OF2O function <%s>\n",function_name);
-					fprintf(stderr,"dbg4       OF2_device_number:                 %d\n", OF2_device_number);
-					fprintf(stderr,"dbg4       num_offsets:                       %d\n", device->num_offsets);
-					fprintf(stderr,"dbg4       OF2_offset_type:                   %d\n", offset->OF2_offset_type);
-					fprintf(stderr,"dbg4       OF2_offset_starboard:              %f\n", offset->OF2_offset_starboard);
-					fprintf(stderr,"dbg4       OF2_offset_forward:                %f\n", offset->OF2_offset_forward);
-					fprintf(stderr,"dbg4       OF2_offset_vertical:               %f\n", offset->OF2_offset_vertical);
-					fprintf(stderr,"dbg4       OF2_offset_yaw:                    %f\n", offset->OF2_offset_yaw);
-					fprintf(stderr,"dbg4       OF2_offset_roll:                   %f\n", offset->OF2_offset_roll);
-					fprintf(stderr,"dbg4       OF2_offset_pitch:                  %f\n", offset->OF2_offset_pitch);
-					fprintf(stderr,"dbg4       OF2_offset_time:                   %f\n", offset->OF2_offset_time);
-					}
-				}
-
-			/* PRI data record */
-			else if (strncmp(line, "PRI", 3) == 0)
-				{
-				store->type = MBSYS_HYSWEEP_RECORDTYPE_PRI;
-
-				/* parse the first line */
-				nscan = sscanf(line+4, "%d",
-						&(store->primary_nav_device));
-				if (nscan == 1)
-					{
-					device = (struct mbsys_hysweep_device_struct *) &(store->devices[store->primary_nav_device]);
-					device->PRI_primary_nav_device = 1;
-					}
-				else
-					{
-					status = MB_FAILURE;
-					*error = MB_ERROR_UNINTELLIGIBLE;
-					}
-
-				/* print debug statements */
-				if (verbose >= 4)
-					{
-					fprintf(stderr,"\ndbg4  PRI data record read by MBIO function <%s>\n",function_name);
-					fprintf(stderr,"dbg4       primary_nav_device:                %d\n", store->primary_nav_device);
-					}
-				}
-
-			/* PTS data record */
-			else if (strncmp(line, "PTS", 3) == 0)
-				{
-				store->type = MBSYS_HYSWEEP_RECORDTYPE_PTS;
-
-				/* print debug statements */
-				if (verbose >= 4)
-					{
-					fprintf(stderr,"\ndbg4  PTS data record read by MBIO function <%s>\n",function_name);
-					}
-				}
-
-			/* SSI data record */
-			else if (strncmp(line, "SSI", 3) == 0)
-				{
-				store->type = MBSYS_HYSWEEP_RECORDTYPE_SSI;
-
-				/* parse the first line */
-				nscan = sscanf(line+4, "%d %x %d %d",
-						&(SSI_device_number),
-						&(SSI_sonar_flags),
-						&(SSI_port_num_samples),
-						&(SSI_starboard_num_samples));
-				if (nscan == 4)
-					{
-					device = (struct mbsys_hysweep_device_struct *) &(store->devices[SSI_device_number]);
-					device->SSI_sonar_flags = SSI_sonar_flags;
-					device->SSI_port_num_samples = SSI_port_num_samples;
-					device->SSI_starboard_num_samples = SSI_starboard_num_samples;
-					}
-				else
-					{
-					status = MB_FAILURE;
-					*error = MB_ERROR_UNINTELLIGIBLE;
-					}
-
-				/* print debug statements */
-				if (verbose >= 4)
-					{
-					fprintf(stderr,"\ndbg4  SSI data record read by SSIO function <%s>\n",function_name);
-					fprintf(stderr,"dbg4       SSI_device_number:                 %d\n", SSI_device_number);
-					fprintf(stderr,"dbg4       SSI_sonar_flags:                   %x\n", device->SSI_sonar_flags);
-					fprintf(stderr,"dbg4       SSI_port_num_samples:              %d\n", device->SSI_port_num_samples);
-					fprintf(stderr,"dbg4       SSI_starboard_num_samples:         %d\n", device->SSI_starboard_num_samples);
-					}
-				}
-
-			/* SVC data record */
-			else if (strncmp(line, "SVC", 3) == 0)
-				{
-				store->type = MBSYS_HYSWEEP_RECORDTYPE_SVC;
-
-				/* print debug statements */
-				if (verbose >= 4)
-					{
-					fprintf(stderr,"\ndbg4  SVC data record read by MBIO function <%s>\n",function_name);
-					}
-				}
-
-			/* TND data record */
-			else if (strncmp(line, "TND", 3) == 0)
-				{
-				store->type = MBSYS_HYSWEEP_RECORDTYPE_TND;
-
-				/* parse the first line */
-				nscan = sscanf(line+4, "%d:%d:%d %d/%d/%d",
-						&(store->TND_survey_time_i[3]),
-						&(store->TND_survey_time_i[4]),
-						&(store->TND_survey_time_i[5]),
-						&(store->TND_survey_time_i[1]),
-						&(store->TND_survey_time_i[2]),
-						&(store->TND_survey_time_i[0]));
-				if (nscan == 6)
-					{
-					store->TND_survey_time_i[6] = 0;
-					store->time_i[0] = store->TND_survey_time_i[0];
-					store->time_i[1] = store->TND_survey_time_i[1];
-					store->time_i[2] = store->TND_survey_time_i[2];
-					store->time_i[3] = 0;
-					store->time_i[4] = 0;
-					store->time_i[5] = 0;
-					store->time_i[6] = 0;
-					mb_get_time(verbose, store->time_i, &(store->TND_survey_time_d));
-					}
-				else
-					{
-					status = MB_FAILURE;
-					*error = MB_ERROR_UNINTELLIGIBLE;
-					}
-
-				/* print debug statements */
-				if (verbose >= 4)
-					{
-					fprintf(stderr,"\ndbg4  TND data record read by MBIO function <%s>\n",function_name);
-					fprintf(stderr,"dbg4       TND_survey_time_i[0]:              %d\n", store->TND_survey_time_i[0]);
-					fprintf(stderr,"dbg4       TND_survey_time_i[1]:              %d\n", store->TND_survey_time_i[1]);
-					fprintf(stderr,"dbg4       TND_survey_time_i[2]:              %d\n", store->TND_survey_time_i[2]);
-					fprintf(stderr,"dbg4       TND_survey_time_i[3]:              %d\n", store->TND_survey_time_i[3]);
-					fprintf(stderr,"dbg4       TND_survey_time_i[4]:              %d\n", store->TND_survey_time_i[4]);
-					fprintf(stderr,"dbg4       TND_survey_time_i[5]:              %d\n", store->TND_survey_time_i[5]);
-					fprintf(stderr,"dbg4       TND_survey_time_i[6]:              %d\n", store->TND_survey_time_i[6]);
-					fprintf(stderr,"dbg4       TND_survey_time_d:                 %f\n", store->TND_survey_time_d);
-					}
-				}
-
-			/* DFT data record */
-			else if (strncmp(line, "DFT", 3) == 0)
-				{
-				store->type = MBSYS_HYSWEEP_RECORDTYPE_DFT;
-
-				/* parse the first line */
-				nscan = sscanf(line+4, "%d %lf %lf",
-						&(store->DFT_device_number),
-						&(store->DFT_time),
-						&(store->DFT_draft));
-				if (nscan != 3)
-					{
-					status = MB_FAILURE;
-					*error = MB_ERROR_UNINTELLIGIBLE;
-					}
-
-				/* print debug statements */
-				if (verbose >= 4)
-					{
-					fprintf(stderr,"\ndbg4  DFT data record read by MBIO function <%s>\n",function_name);
-					fprintf(stderr,"dbg4       DFT_device_number:                 %d\n", store->DFT_device_number);
-					fprintf(stderr,"dbg4       DFT_time:                          %f\n", store->DFT_time);
-					fprintf(stderr,"dbg4       DFT_draft:                         %f\n", store->DFT_draft);
-					}
-
-				/* if successful this completes a sonar depth record */
-				if (status == MB_SUCCESS)
-					{
-					done = MB_YES;
-					store->kind = MB_DATA_SONARDEPTH;
-					store->time_d = store->TND_survey_time_d + store->DFT_time;
-					mb_get_date(verbose, store->time_d, store->time_i);
-					}
-				}
-
-			/* FIX data record */
-			else if (strncmp(line, "FIX", 3) == 0)
-				{
-				store->type = MBSYS_HYSWEEP_RECORDTYPE_FIX;
-
-				/* parse the first line */
-				nscan = sscanf(line+4, "%d %lf %d",
-						&(store->FIX_device_number),
-						&(store->FIX_time_after_midnight),
-						&(store->FIX_event_number));
-				if (nscan != 3)
-					{
-					status = MB_FAILURE;
-					*error = MB_ERROR_UNINTELLIGIBLE;
-					}
-
-				/* print debug statements */
-				if (verbose >= 4)
-					{
-					fprintf(stderr,"\ndbg4  FIX data record read by MBIO function <%s>\n",function_name);
-					fprintf(stderr,"dbg4       FIX_device_number:                 %d\n", store->FIX_device_number);
-					fprintf(stderr,"dbg4       FIX_time_after_midnight:           %f\n", store->FIX_time_after_midnight);
-					fprintf(stderr,"dbg4       FIX_event_number:                  %d\n", store->FIX_event_number);
-					}
-				}
-
-			/* PSA data record */
-			else if (strncmp(line, "PSA", 3) == 0)
-				{
-				store->type = MBSYS_HYSWEEP_RECORDTYPE_PSA;
-
-				/* parse the first line */
-				nscan = sscanf(line+4, "%d %lf %d %lf %lf",
-						&(store->PSA_device_number),
-						&(store->PSA_time),
-						&(store->PSA_ping_number),
-						&(store->PSA_a0),
-						&(store->PSA_a1));
-				if (nscan != 5)
-					{
-					status = MB_FAILURE;
-					*error = MB_ERROR_UNINTELLIGIBLE;
-					}
-
-				/* print debug statements */
-				if (verbose >= 4)
-					{
-					fprintf(stderr,"\ndbg4  PSA data record read by MBIO function <%s>\n",function_name);
-					fprintf(stderr,"dbg4       PSA_device_number:                 %d\n", store->PSA_device_number);
-					fprintf(stderr,"dbg4       PSA_time:                          %f\n", store->PSA_time);
-					fprintf(stderr,"dbg4       PSA_ping_number:                   %d\n", store->PSA_ping_number);
-					fprintf(stderr,"dbg4       PSA_a0:                            %f\n", store->PSA_a0);
-					fprintf(stderr,"dbg4       PSA_a1:                            %f\n", store->PSA_a1);
-					}
-				}
-
-			/* COM data record */
-			else if (strncmp(line, "COM", 3) == 0)
-				{
-				store->type = MBSYS_HYSWEEP_RECORDTYPE_COM;
-
-				/* parse the first line */
-				nscan = sscanf(line+4, "%s",
-						store->COM_comment);
-				if (nscan != 1)
-					{
-					status = MB_FAILURE;
-					*error = MB_ERROR_UNINTELLIGIBLE;
-					}
-
-				/* print debug statements */
-				if (verbose >= 4)
-					{
-					fprintf(stderr,"\ndbg4  COM data record read by MBIO function <%s>\n",function_name);
-					fprintf(stderr,"dbg4       COM_comment:                       %s\n", store->COM_comment);
-					}
-				}
-
-			/* PRJ data record */
-			else if (strncmp(line, "PRJ", 3) == 0)
-				{
-				store->type = MBSYS_HYSWEEP_RECORDTYPE_PRJ;
-
-				/* if no previously set projection use this one */
-				if (strlen(store->PRJ_proj4_command) == 0)
-					{
-					/* parse the first line */
-					nscan = sscanf(line+4, "%s",
-							store->PRJ_proj4_command);
-					if (nscan != 1)
-						{
-						status = MB_FAILURE;
-						*error = MB_ERROR_UNINTELLIGIBLE;
-						}
-
-					/* print debug statements */
-					if (verbose >= 4)
-						{
-						fprintf(stderr,"\ndbg4  PRJ data record read by MBIO function <%s>\n",function_name);
-						fprintf(stderr,"dbg4       PRJ_proj4_command:                 %s\n", store->PRJ_proj4_command);
-						}
-					}
-
-				/* do not overwrite previously set projection */
-				else
-					{
-					/* print debug statements */
-					if (verbose >= 4)
-						{
-						fprintf(stderr,"\ndbg4  PRJ data record ignored by MBIO function <%s>\n",function_name);
-						fprintf(stderr,"dbg4       Previously set PRJ_proj4_command:  %s\n", store->PRJ_proj4_command);
-						fprintf(stderr,"dbg4       Ignored PRJ_proj4_command:         %s\n", line+4);
-						}
-					}
-
-				}
-
-			/* unknown data record */
-			else
-				{
-				store->type = MBSYS_HYSWEEP_RECORDTYPE_NONE;
-				}
-				
-			/* treat unintelligible records as unknown */
-			if (status == MB_FAILURE && *error == MB_ERROR_UNINTELLIGIBLE)
-				{
-				status = MB_SUCCESS;
-				*error = MB_ERROR_NO_ERROR;
-				store->type = MBSYS_HYSWEEP_RECORDTYPE_NONE;
-				}
-
-			}
-		}
-#ifdef MBR_HYSWEEP1_DEBUG
-	if (status == MB_SUCCESS)
-		fprintf(stderr,"HYSWEEP1 DATA READ: type:%d status:%d error:%d\n\n",
-			store->kind, status, *error);
-#endif
-
-	/* get file position */
-	mb_io_ptr->file_bytes = ftell(mb_io_ptr->mbfp);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_hysweep1_rd_line(int verbose, FILE *mbfp, char *line, int *error)
-{
-	char	*function_name = "mbr_hysweep1_rd_line";
-	int	status = MB_SUCCESS;
-	char	*result;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		}
-
-	/* read the next line */
-	result = fgets(line,MBSYS_HYSWEEP_MAXLINE,mbfp);
-	if (result == line
-		&& strlen(line) < MBSYS_HYSWEEP_MAXLINE)
-	    {
-	    status = MB_SUCCESS;
-	    *error = MB_ERROR_NO_ERROR;
-
-	    if (verbose >= 4)
-		{
-		fprintf(stderr,"\ndbg4  Raw line read by MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg4       line: %s\n",line);
-		}
-	    }
-	else
-	    {
-	    status = MB_FAILURE;
-	    *error = MB_ERROR_EOF;
-	    }
-
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       line:       %s\n",line);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-
-}
-/*--------------------------------------------------------------------*/
-int mbr_hysweep1_wr_data(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_hysweep1_wr_data";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_hysweep_struct *store;
-	struct mbsys_hysweep_device_struct *device;
-	struct mbsys_hysweep_device_offset_struct *offset;
-	struct mbsys_hysweep_struct hysweeptmp;
-	FILE	*mbfp;
-	char	*line;
-	int	*file_header_read;
-	int	*file_header_written;
-	int	kindex;
-	int	*add_MB_POS;
-	int	*add_MB_HCP;
-	int	*add_MB_GYR;
-	int	*add_MB_DFT;
-	int	*device_number_MB_POS;
-	int	*device_number_MB_HCP;
-	int	*device_number_MB_GYR;
-	int	*device_number_MB_DFT;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-	mbfp = mb_io_ptr->mbfp;
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_hysweep_struct *) store_ptr;
-	line = store->writeline;
-
-	/* get saved values */
-	file_header_read = (int *) &mb_io_ptr->save1;
-	file_header_written = (int *) &mb_io_ptr->save2;
-	add_MB_POS = (int *) &mb_io_ptr->save3;
-	add_MB_HCP = (int *) &mb_io_ptr->save4;
-	add_MB_GYR = (int *) &mb_io_ptr->save5;
-	add_MB_DFT = (int *) &mb_io_ptr->save6;
-	device_number_MB_POS = (int *) &mb_io_ptr->save7;
-	device_number_MB_HCP = (int *) &mb_io_ptr->save8;
-	device_number_MB_GYR = (int *) &mb_io_ptr->save9;
-	device_number_MB_DFT = (int *) &mb_io_ptr->save10;
-
-	/* write fileheader if needed */
-	if (*file_header_written == MB_NO && store->kind != MB_DATA_COMMENT)
-		{
-		/* copy the mbsys_hysweep structure so that we can mess with the device list
-			if needed before writing it out */
-		hysweeptmp = *store;
-
-		/* check for existence of MB-System interpolated nav, attitude, heading, and sonar depth devices
-			- create if they don't exist */
-		*add_MB_POS = MB_YES;
-		*add_MB_HCP = MB_YES;
-		*add_MB_GYR = MB_YES;
-		*add_MB_DFT = MB_YES;
-		for (i=0;i<hysweeptmp.num_devices;i++)
-			{
-			device = (struct mbsys_hysweep_device_struct *) &(hysweeptmp.devices[i]);
-			if (device->DV2_enabled == MB_YES)
-				{
-				if ((strncmp(device->DEV_device_name, "MB-System", 9) == 0))
-					{
-					if (device->DV2_device_capability & 0x0004)
-						*add_MB_POS = MB_NO;
-					if (device->DV2_device_capability & 0x0020)
-						*add_MB_GYR = MB_NO;
-					if (device->DV2_device_capability & 0x0200)
-						*add_MB_HCP = MB_NO;
-					if (device->DV2_device_capability == 0x8000)
-						*add_MB_DFT = MB_NO;
-					}
-				else
-					{
-					if (device->DV2_device_capability & 0x0004)
-						{
-						device->DV2_enabled = MB_NO;
-						}
-					if (device->DV2_device_capability & 0x0020)
-						{
-						device->DV2_enabled = MB_NO;
-						}
-					if (device->DV2_device_capability & 0x0200)
-						{
-						device->DV2_enabled = MB_NO;
-						}
-					if (device->DV2_device_capability == 0x8000)
-						{
-						device->DV2_enabled = MB_NO;
-						}
-					}
-				}
-			}
-		if (*add_MB_POS == MB_YES)
-			{
-			*device_number_MB_POS = hysweeptmp.num_devices;
-			device = (struct mbsys_hysweep_device_struct *) &(hysweeptmp.devices[hysweeptmp.num_devices]);
-			device->DEV_device_number = hysweeptmp.num_devices;
-			device->DEV_device_capability = 4;
-			strcpy(device->DEV_device_name, "MB-System interpolated position");
-			device->DV2_device_capability = 0x0004;
-			device->DV2_towfish = 0;
-			device->DV2_enabled = 1;
-
-			device->num_offsets = 3;
-			for (i=0;i<device->num_offsets;i++)
-				{
-				offset = (struct mbsys_hysweep_device_offset_struct *) &(device->offsets[i]);
-				offset->OF2_device_number = hysweeptmp.num_devices;
-				offset->OF2_offset_type = i;
-				offset->OF2_offset_starboard = 0.0;
-				offset->OF2_offset_forward = 0.0;
-				offset->OF2_offset_vertical = 0.0;
-				offset->OF2_offset_yaw = 0.0;
-				offset->OF2_offset_roll = 0.0;
-				offset->OF2_offset_pitch = 0.0;
-				offset->OF2_offset_time = 0.0;
-				}
-			hysweeptmp.num_devices++;
-			}
-		if (*add_MB_GYR == MB_YES)
-			{
-			*device_number_MB_GYR = hysweeptmp.num_devices;
-			device = (struct mbsys_hysweep_device_struct *) &(hysweeptmp.devices[hysweeptmp.num_devices]);
-			device->DEV_device_number = hysweeptmp.num_devices;
-			device->DEV_device_capability = 32;
-			strcpy(device->DEV_device_name, "MB-System interpolated heading");
-			device->DV2_device_capability = 0x0020;
-			device->DV2_towfish = 0;
-			device->DV2_enabled = 1;
-
-			device->num_offsets = 2;
-			for (i=0;i<device->num_offsets;i++)
-				{
-				offset = (struct mbsys_hysweep_device_offset_struct *) &(device->offsets[i]);
-				offset->OF2_device_number = hysweeptmp.num_devices;
-				offset->OF2_offset_type = i + 1;
-				offset->OF2_offset_starboard = 0.0;
-				offset->OF2_offset_forward = 0.0;
-				offset->OF2_offset_vertical = 0.0;
-				offset->OF2_offset_yaw = 0.0;
-				offset->OF2_offset_roll = 0.0;
-				offset->OF2_offset_pitch = 0.0;
-				offset->OF2_offset_time = 0.0;
-				}
-			hysweeptmp.num_devices++;
-			}
-		if (*add_MB_HCP == MB_YES)
-			{
-			*device_number_MB_HCP = hysweeptmp.num_devices;
-			device = (struct mbsys_hysweep_device_struct *) &(hysweeptmp.devices[hysweeptmp.num_devices]);
-			device->DEV_device_number = hysweeptmp.num_devices;
-			device->DEV_device_capability = 512;
-			strcpy(device->DEV_device_name, "MB-System interpolated attitude");
-			device->DV2_device_capability = 0x0200;
-			device->DV2_towfish = 0;
-			device->DV2_enabled = 1;
-
-			device->num_offsets = 2;
-			for (i=0;i<device->num_offsets;i++)
-				{
-				offset = (struct mbsys_hysweep_device_offset_struct *) &(device->offsets[i]);
-				offset->OF2_device_number = hysweeptmp.num_devices;
-				offset->OF2_offset_type = i + 1;
-				offset->OF2_offset_starboard = 0.0;
-				offset->OF2_offset_forward = 0.0;
-				offset->OF2_offset_vertical = 0.0;
-				offset->OF2_offset_yaw = 0.0;
-				offset->OF2_offset_roll = 0.0;
-				offset->OF2_offset_pitch = 0.0;
-				offset->OF2_offset_time = 0.0;
-				}
-			hysweeptmp.num_devices++;
-			}
-		if (*add_MB_DFT == MB_YES)
-			{
-			*device_number_MB_DFT = hysweeptmp.num_devices;
-			device = (struct mbsys_hysweep_device_struct *) &(hysweeptmp.devices[hysweeptmp.num_devices]);
-			device->DEV_device_number = hysweeptmp.num_devices;
-			device->DEV_device_capability = 16384;
-			strcpy(device->DEV_device_name, "MB-System interpolated sonar depth");
-			device->DV2_device_capability = 0x1000;
-			device->DV2_towfish = 0;
-			device->DV2_enabled = 1;
-
-			device->num_offsets = 3;
-			for (i=0;i<device->num_offsets;i++)
-				{
-				offset = (struct mbsys_hysweep_device_offset_struct *) &(device->offsets[i]);
-				offset->OF2_device_number = hysweeptmp.num_devices;
-				offset->OF2_offset_type = i;
-				offset->OF2_offset_starboard = 0.0;
-				offset->OF2_offset_forward = 0.0;
-				offset->OF2_offset_vertical = 0.0;
-				offset->OF2_offset_yaw = 0.0;
-				offset->OF2_offset_roll = 0.0;
-				offset->OF2_offset_pitch = 0.0;
-				offset->OF2_offset_time = 0.0;
-				}
-			hysweeptmp.num_devices++;
-			}
-
-		/* print debug statements */
-		if (verbose >= 4)
-			{
-			fprintf(stderr,"\ndbg4  FTP data record to be written by MBIO function <%s>\n",function_name);
-			fprintf(stderr,"dbg4       FTP_record:                        %s\n", hysweeptmp.FTP_record);
-			fprintf(stderr,"\ndbg4  HSX data record to be written by MBIO function <%s>\n",function_name);
-			fprintf(stderr,"dbg4       HSX_record:                        %d\n", hysweeptmp.HSX_record);
-			fprintf(stderr,"\ndbg4  VER data record to be written by MBIO function <%s>\n",function_name);
-			fprintf(stderr,"dbg4       VER_version:                       %s\n", hysweeptmp.VER_version);
-			fprintf(stderr,"\ndbg4  TND data record to be written by MBIO function <%s>\n",function_name);
-			fprintf(stderr,"dbg4       TND_survey_time_i[0]:              %d\n", hysweeptmp.TND_survey_time_i[0]);
-			fprintf(stderr,"dbg4       TND_survey_time_i[1]:              %d\n", hysweeptmp.TND_survey_time_i[1]);
-			fprintf(stderr,"dbg4       TND_survey_time_i[2]:              %d\n", hysweeptmp.TND_survey_time_i[2]);
-			fprintf(stderr,"dbg4       TND_survey_time_i[3]:              %d\n", hysweeptmp.TND_survey_time_i[3]);
-			fprintf(stderr,"dbg4       TND_survey_time_i[4]:              %d\n", hysweeptmp.TND_survey_time_i[4]);
-			fprintf(stderr,"dbg4       TND_survey_time_i[5]:              %d\n", hysweeptmp.TND_survey_time_i[5]);
-			fprintf(stderr,"dbg4       TND_survey_time_i[6]:              %d\n", hysweeptmp.TND_survey_time_i[6]);
-			fprintf(stderr,"dbg4       TND_survey_time_d:                 %f\n", hysweeptmp.TND_survey_time_d);
-			fprintf(stderr,"\ndbg4  INF data record to be written by MBIO function <%s>\n",function_name);
-			fprintf(stderr,"dbg4       INF_surveyor:                      %s\n", hysweeptmp.INF_surveyor);
-			fprintf(stderr,"dbg4       INF_boat:                          %s\n", hysweeptmp.INF_boat);
-			fprintf(stderr,"dbg4       INF_project:                       %s\n", hysweeptmp.INF_project);
-			fprintf(stderr,"dbg4       INF_area:                          %s\n", hysweeptmp.INF_area);
-			fprintf(stderr,"dbg4       INF_tide_correction:               %f\n", hysweeptmp.INF_tide_correction);
-			fprintf(stderr,"dbg4       INF_draft_correction:              %f\n", hysweeptmp.INF_draft_correction);
-			fprintf(stderr,"dbg4       INF_sound_velocity:                %f\n", hysweeptmp.INF_sound_velocity);
-			fprintf(stderr,"\ndbg4  HSP data record to be written by MBIO function <%s>\n",function_name);
-			fprintf(stderr,"dbg4       HSP_minimum_depth:                 %f\n", hysweeptmp.HSP_minimum_depth);
-			fprintf(stderr,"dbg4       HSP_maximum_depth:                 %f\n", hysweeptmp.HSP_maximum_depth);
-			fprintf(stderr,"dbg4       HSP_port_offset_limit:             %f\n", hysweeptmp.HSP_port_offset_limit);
-			fprintf(stderr,"dbg4       HSP_stbd_offset_limit:             %f\n", hysweeptmp.HSP_stbd_offset_limit);
-			fprintf(stderr,"dbg4       HSP_port_angle_limit:              %f\n", hysweeptmp.HSP_port_angle_limit);
-			fprintf(stderr,"dbg4       HSP_stbd_angle_limit:              %f\n", hysweeptmp.HSP_stbd_angle_limit);
-			fprintf(stderr,"dbg4       HSP_high_beam_quality:             %d\n", hysweeptmp.HSP_high_beam_quality);
-			fprintf(stderr,"dbg4       HSP_low_beam_quality:              %d\n", hysweeptmp.HSP_low_beam_quality);
-			fprintf(stderr,"dbg4       HSP_sonar_range:                   %f\n", hysweeptmp.HSP_sonar_range);
-			fprintf(stderr,"dbg4       HSP_towfish_layback:               %f\n", hysweeptmp.HSP_towfish_layback);
-			fprintf(stderr,"dbg4       HSP_units:                         %d\n", hysweeptmp.HSP_units);
-			fprintf(stderr,"dbg4       HSP_sonar_id:                      %d\n", hysweeptmp.HSP_sonar_id);
-			fprintf(stderr,"\ndbg4  EOH data record to be written by MBIO function <%s>\n",function_name);
-			fprintf(stderr,"\ndbg4  HVF data record to be written by MBIO function <%s>\n",function_name);
-			fprintf(stderr,"dbg4       HVF_time_after_midnight:           %f\n", hysweeptmp.HVF_time_after_midnight);
-			fprintf(stderr,"dbg4       HVF_minimum_depth:                 %f\n", hysweeptmp.HVF_minimum_depth);
-			fprintf(stderr,"dbg4       HVF_maximum_depth:                 %f\n", hysweeptmp.HVF_maximum_depth);
-			fprintf(stderr,"dbg4       HVF_port_offset_limit:             %f\n", hysweeptmp.HVF_port_offset_limit);
-			fprintf(stderr,"dbg4       HVF_starboard_offset_limit:        %f\n", hysweeptmp.HVF_starboard_offset_limit);
-			fprintf(stderr,"dbg4       HVF_minimum_angle_limit:           %f\n", hysweeptmp.HVF_minimum_angle_limit);
-			fprintf(stderr,"dbg4       HVF_maximum_angle_limit:           %f\n", hysweeptmp.HVF_maximum_angle_limit);
-			fprintf(stderr,"\ndbg4  FIX data record to be written by MBIO function <%s>\n",function_name);
-			fprintf(stderr,"dbg4       FIX_device_number:                 %d\n", hysweeptmp.FIX_device_number);
-			fprintf(stderr,"dbg4       FIX_time_after_midnight:           %f\n", hysweeptmp.FIX_time_after_midnight);
-			fprintf(stderr,"dbg4       FIX_event_number:                  %d\n", hysweeptmp.FIX_event_number);
-			}
-
-		fprintf(mbfp, "FTP %s\r\n", hysweeptmp.FTP_record);
-		fprintf(mbfp, "HSX %d\r\n", hysweeptmp.HSX_record);
-		fprintf(mbfp, "VER %s\r\n", hysweeptmp.VER_version);
-		fprintf(mbfp, "TND %2.2d:%2.2d:%2.2d %2.2d/%2.2d/%4.4d\r\n",
-			hysweeptmp.TND_survey_time_i[3],
-			hysweeptmp.TND_survey_time_i[4],
-			hysweeptmp.TND_survey_time_i[5],
-			hysweeptmp.TND_survey_time_i[1],
-			hysweeptmp.TND_survey_time_i[2],
-			hysweeptmp.TND_survey_time_i[0]);
-		fprintf(mbfp, "INF \"%s\" \"%s\" \"%s\" \"%s\" %.2f %.2f %.2f\r\n",
-			hysweeptmp.INF_surveyor,
-			hysweeptmp.INF_boat,
-			hysweeptmp.INF_project,
-			hysweeptmp.INF_area,
-			hysweeptmp.INF_tide_correction,
-			hysweeptmp.INF_draft_correction,
-			hysweeptmp.INF_sound_velocity);
-		fprintf(mbfp, "HSP %.2f %.2f %.2f %.2f %g %g %d %d %.2f %.2f %d %d\r\n",
-			hysweeptmp.HSP_minimum_depth,
-			hysweeptmp.HSP_maximum_depth,
-			hysweeptmp.HSP_port_offset_limit,
-			hysweeptmp.HSP_stbd_offset_limit,
-			hysweeptmp.HSP_port_angle_limit,
-			hysweeptmp.HSP_stbd_angle_limit,
-			hysweeptmp.HSP_high_beam_quality,
-			hysweeptmp.HSP_low_beam_quality,
-			hysweeptmp.HSP_sonar_range,
-			hysweeptmp.HSP_towfish_layback,
-			hysweeptmp.HSP_units,
-			hysweeptmp.HSP_sonar_id);
-
-		for (i=0;i<hysweeptmp.num_devices;i++)
-			{
-			device = (struct mbsys_hysweep_device_struct *) &(hysweeptmp.devices[i]);
-			fprintf(mbfp, "DEV %d %d \"%s\"\r\n",
-				device->DEV_device_number,
-				device->DEV_device_capability,
-				device->DEV_device_name);
-			fprintf(mbfp, "DV2 %d %d %d %d\r\n",
-				device->DEV_device_number,
-				device->DV2_device_capability,
-				device->DV2_towfish,
-				device->DV2_enabled);
-			for (j=0;j<device->num_offsets;j++)
-				{
-				offset = (struct mbsys_hysweep_device_offset_struct *) &(device->offsets[j]);
-				fprintf(mbfp, "OF2 %d %d %.2f %.2f %.2f %.2f %.2f %.2f %.2f\r\n",
-					offset->OF2_device_number,
-					offset->OF2_offset_type,
-					offset->OF2_offset_starboard,
-					offset->OF2_offset_forward,
-					offset->OF2_offset_vertical,
-					offset->OF2_offset_yaw,
-					offset->OF2_offset_roll,
-					offset->OF2_offset_pitch,
-					offset->OF2_offset_time);
-				}
-			if (device->PRI_primary_nav_device == i)
-				{
-				fprintf(mbfp, "PRI 1\r\n");
-				}
-			if (device->DEV_device_capability & 16)
-				{
-				fprintf(mbfp, "MBI %d %x %x %x %d %d %.3f %.3f\r\n",
-					device->DEV_device_number,
-					device->MBI_sonar_type,
-					device->MBI_sonar_flags,
-					device->MBI_beam_data_available,
-					device->MBI_num_beams_1,
-					device->MBI_num_beams_2,
-					device->MBI_first_beam_angle,
-					device->MBI_angle_increment);
-				fprintf(mbfp, "SSI %d %x %d %d\r\n",
-					device->DEV_device_number,
-					device->SSI_sonar_flags,
-					device->SSI_port_num_samples,
-					device->SSI_starboard_num_samples);
-				}
-			}
-
-		fprintf(mbfp, "PRJ %s\r\n", hysweeptmp.PRJ_proj4_command);
-		fprintf(mbfp, "EOH\r\n");
-		fprintf(mbfp, "HVF 99 %.3f %.1f %.1f %.1f %.1f %.1f %.1f\r\n",
-			hysweeptmp.HVF_time_after_midnight,
-			hysweeptmp.HVF_minimum_depth,
-			hysweeptmp.HVF_maximum_depth,
-			hysweeptmp.HVF_port_offset_limit,
-			hysweeptmp.HVF_starboard_offset_limit,
-			hysweeptmp.HVF_minimum_angle_limit,
-			hysweeptmp.HVF_maximum_angle_limit);
-		fprintf(mbfp, "FIX %d %.3f %d\r\n",
-			hysweeptmp.FIX_device_number,
-			hysweeptmp.FIX_time_after_midnight,
-			hysweeptmp.FIX_event_number);
-		*file_header_written = MB_YES;
-
-		/* initialize projection */
-		mb_proj_init(verbose, store->PRJ_proj4_command, &(mb_io_ptr->pjptr), error);
-		mb_io_ptr->projection_initialized = MB_YES;
-		}
-
-	/* call appropriate writing routines for ping data */
-	if (status == MB_SUCCESS && store->kind == MB_DATA_DATA)
-		{
-		/* print debug statements */
-		if (verbose >= 4)
-			{
-			fprintf(stderr,"\ndbg4  RMB data record read by MBIO function <%s>\n",function_name);
-			fprintf(stderr,"dbg4       RMB_device_number:                 %d\n", store->RMB_device_number);
-			fprintf(stderr,"dbg4       RMB_time:                          %f\n", store->RMB_time);
-			fprintf(stderr,"dbg4       RMB_sonar_type:                    %x\n", store->RMB_sonar_type);
-			fprintf(stderr,"dbg4       RMB_sonar_flags:                   %x\n", store->RMB_sonar_flags);
-			fprintf(stderr,"dbg4       RMB_beam_data_available:           %x\n", store->RMB_beam_data_available);
-			fprintf(stderr,"dbg4       RMB_num_beams:                     %d\n", store->RMB_num_beams);
-			fprintf(stderr,"dbg4       RMB_num_beams_alloc:               %d\n", store->RMB_num_beams_alloc);
-			fprintf(stderr,"dbg4       RMB_sound_velocity:                %f\n", store->RMB_sound_velocity);
-			fprintf(stderr,"dbg4       RMB_ping_number:                   %d\n", store->RMB_ping_number);
-			for (i=0;i<store->RMB_num_beams;i++)
-				{
-				fprintf(stderr,"dbg4       beam:%4d", i);
-
-				if (store->RMB_beam_data_available & 0x0001)
-				fprintf(stderr," %f", store->RMB_beam_ranges[i]);
-
-				if (store->RMB_beam_data_available & 0x0002)
-				fprintf(stderr," %f", store->RMB_multi_ranges[i]);
-
-				if (store->RMB_beam_data_available & 0x0004)
-				fprintf(stderr," %f", store->RMB_sounding_eastings[i]);
-
-				if (store->RMB_beam_data_available & 0x0004)
-				fprintf(stderr," %f", store->RMB_sounding_northings[i]);
-
-				if (store->RMB_beam_data_available & 0x0008)
-				fprintf(stderr," %f", store->RMB_sounding_depths[i]);
-
-				if (store->RMB_beam_data_available & 0x0010)
-				fprintf(stderr," %f", store->RMB_sounding_along[i]);
-
-				if (store->RMB_beam_data_available & 0x0020)
-				fprintf(stderr," %f", store->RMB_sounding_across[i]);
-
-				if (store->RMB_beam_data_available & 0x0040)
-				fprintf(stderr," %f", store->RMB_sounding_pitchangles[i]);
-
-				if (store->RMB_beam_data_available & 0x0080)
-				fprintf(stderr," %f", store->RMB_sounding_rollangles[i]);
-
-				if (store->RMB_beam_data_available & 0x0100)
-				fprintf(stderr," %f", store->RMB_sounding_takeoffangles[i]);
-
-				if (store->RMB_beam_data_available & 0x0200)
-				fprintf(stderr," %f", store->RMB_sounding_azimuthalangles[i]);
-
-				if (store->RMB_beam_data_available & 0x0400)
-				fprintf(stderr," %d", store->RMB_sounding_timedelays[i]);
-
-				if (store->RMB_beam_data_available & 0x0800)
-				fprintf(stderr," %d", store->RMB_sounding_intensities[i]);
-
-				if (store->RMB_beam_data_available & 0x1000)
-				fprintf(stderr," %d", store->RMB_sounding_quality[i]);
-
-				if (store->RMB_beam_data_available & 0x2000)
-				fprintf(stderr," %d", store->RMB_sounding_flags[i]);
-
-				fprintf(stderr,"\n");
-				}
-			}
-
-		/* add desired interpolated data */
-		if (*add_MB_POS == MB_YES)
-			{
-			sprintf(line, "POS %d %.3f %.2f %.2f\r\n",
-				*device_number_MB_POS,
-				store->RMB_time,
-				store->RMBint_x,
-				store->RMBint_y);
-			fputs(line, mbfp);
-/* fprintf(stderr,"writeline: %s",line); */
-			}
-		if (*add_MB_GYR == MB_YES)
-			{
-			sprintf(line, "GYR %d %.3f %.2f\r\n",
-				*device_number_MB_GYR,
-				store->RMB_time,
-				store->RMBint_heading);
-			fputs(line, mbfp);
-/* fprintf(stderr,"writeline: %s",line); */
-			}
-		if (*add_MB_HCP == MB_YES)
-			{
-			sprintf(line, "HCP %d %.3f %.2f %.2f %.2f\r\n",
-				*device_number_MB_HCP,
-				store->RMB_time,
-				(-store->RMBint_heave),
-				(-store->RMBint_roll),
-				store->RMBint_pitch);
-			fputs(line, mbfp);
-/* fprintf(stderr,"writeline: %s",line); */
-			}
-		if (*add_MB_DFT == MB_YES)
-			{
-			sprintf(line, "DFT %d %.3f %.2f\r\n",
-				*device_number_MB_DFT,
-				store->RMB_time,
-				store->RMBint_draft);
-			fputs(line, mbfp);
-/* fprintf(stderr,"writeline: %s",line); */
-			}
-
-		/* write raw sidescan if it exists */
-		if ((store->RSS_ping_number == store->RMB_ping_number
-			|| 10 * store->RSS_ping_number == store->RMB_ping_number)
-		    && store->RSS_port_num_samples + store->RSS_starboard_num_samples > 0)
-			{
-			/* write first line */
-			sprintf(line, "RSS %d %.3f %x %d %d %.2f %d %.2f %f %d %d %d %d\r\n",
-				store->RSS_device_number,
-				store->RSS_time,
-				store->RSS_sonar_flags,
-				store->RSS_port_num_samples,
-				store->RSS_starboard_num_samples,
-				store->RSS_sound_velocity,
-				store->RSS_ping_number,
-				store->RSS_altitude,
-				store->RSS_sample_rate,
-				store->RSS_minimum_amplitude,
-				store->RSS_maximum_amplitude,
-				store->RSS_bit_shift,
-				store->RSS_frequency);
-			fputs(line, mbfp);
-/* fprintf(stderr,"writeline: %s",line); */
-
-			/* write RSS_port */
-			for (i=0;i<store->RSS_port_num_samples;i++)
-				{
-				if (i != 0)
-					fprintf(mbfp, " ");
-				fprintf(mbfp, "%d",store->RSS_port[i]);
-				}
-			fprintf(mbfp,"\r\n");
-
-			/* write RSS_starboard */
-			for (i=0;i<store->RSS_starboard_num_samples;i++)
-				{
-				if (i != 0)
-					fprintf(mbfp, " ");
-				fprintf(mbfp, "%d",store->RSS_starboard[i]);
-				}
-			fprintf(mbfp,"\r\n");
-			}
-
-		/* write processed sidescan if it exists */
-/* fprintf(stderr,"store->MSS_num_pixels:%d store->MSS_ping_number:%d store->RMB_ping_number:%d\n",
-store->MSS_num_pixels,store->MSS_ping_number,store->RMB_ping_number); */
-		if ((store->MSS_ping_number == store->RMB_ping_number
-			|| 10 * store->MSS_ping_number == store->RMB_ping_number)
-		    && store->MSS_num_pixels > 0)
-			{
-			/* write first line */
-			sprintf(line, "MSS %d %.3f %.2f %d %.3f %d\r\n",
-				store->MSS_device_number,
-				store->MSS_time,
-				store->MSS_sound_velocity,
-				store->MSS_num_pixels,
-				store->MSS_pixel_size,
-				store->MSS_ping_number);
-			fputs(line, mbfp);
-/* fprintf(stderr,"writeline: %s",line); */
-
-			/* write MSS_ss */
-			for (i=0;i<store->MSS_num_pixels;i++)
-				{
-				if (i != 0)
-					fprintf(mbfp, " ");
-				fprintf(mbfp, "%.2f",store->MSS_ss[i]);
-				}
-			fprintf(mbfp,"\r\n");
-
-			/* write MSS_ss_along */
-			for (i=0;i<store->MSS_num_pixels;i++)
-				{
-				if (i != 0)
-					fprintf(mbfp, " ");
-				fprintf(mbfp, "%.2f",store->MSS_ss_along[i]);
-				}
-			fprintf(mbfp,"\r\n");
-			}
-
-		/* write SNR record if it exists */
-		if ((store->SNR_ping_number == store->RMB_ping_number
-			|| 10 * store->SNR_ping_number == store->RMB_ping_number))
-			{
-			sprintf(line, "SNR %d %.3f %d %d %d",
-				store->SNR_device_number,
-				store->SNR_time,
-				store->SNR_ping_number,
-				store->SNR_sonar_id,
-				store->SNR_num_settings);
-			for (i=0;i<store->SNR_num_settings;i++)
-				{
-				kindex = strlen(line);
-				sprintf(line+kindex, " %g", store->SNR_settings[i]);
-				}
-			kindex = strlen(line);
-			sprintf(line+kindex, "\r\n");
-			fputs(line, mbfp);
-/* fprintf(stderr,"writeline: %s",line); */
-			}
-
-		/* write first line */
-		sprintf(line, "RMB %d %.3f %x %x %x %d %.2f %d\r\n",
-			store->RMB_device_number,
-			store->RMB_time,
-			store->RMB_sonar_type,
-			store->RMB_sonar_flags,
-			store->RMB_beam_data_available,
-			store->RMB_num_beams,
-			store->RMB_sound_velocity,
-			store->RMB_ping_number);
-			fputs(line, mbfp);
-/* fprintf(stderr,"writeline: %s",line); */
-
-		/* write RMB_beam_ranges if included */
-		if (store->RMB_beam_data_available & 0x0001)
-			{
-			/* write the next line */
-			line[0]= '\0';
-			for (i=0;i<store->RMB_num_beams;i++)
-				{
-				kindex = strlen(line);
-				if (i > 0)
-					sprintf(line+kindex, " %.2f", store->RMB_beam_ranges[i]);
-				else
-					sprintf(line+kindex, "%.2f", store->RMB_beam_ranges[i]);
-				}
-			kindex = strlen(line);
-			sprintf(line+kindex, "\r\n");
-			fputs(line, mbfp);
-			}
-
-		/* write RMB_multi_ranges if included */
-		if (store->RMB_beam_data_available & 0x0002)
-			{
-			/* write the next line */
-			line[0]= '\0';
-			for (i=0;i<store->RMB_num_beams;i++)
-				{
-				kindex = strlen(line);
-				if (i > 0)
-					sprintf(line+kindex, " %.2f", store->RMB_multi_ranges[i]);
-				else
-					sprintf(line+kindex, "%.2f", store->RMB_multi_ranges[i]);
-				}
-			kindex = strlen(line);
-			sprintf(line+kindex, "\r\n");
-			fputs(line, mbfp);
-			}
-
-		/* write RMB_sounding_eastings if included */
-		if (store->RMB_beam_data_available & 0x0004)
-			{
-			/* write the next line */
-			line[0]= '\0';
-			for (i=0;i<store->RMB_num_beams;i++)
-				{
-				kindex = strlen(line);
-				if (i > 0)
-					sprintf(line+kindex, " %.2f", store->RMB_sounding_eastings[i]);
-				else
-					sprintf(line+kindex, "%.2f", store->RMB_sounding_eastings[i]);
-				}
-			kindex = strlen(line);
-			sprintf(line+kindex, "\r\n");
-			fputs(line, mbfp);
-			}
-
-		/* write RMB_sounding_northings if included */
-		if (store->RMB_beam_data_available & 0x0004)
-			{
-			/* write the next line */
-			line[0]= '\0';
-			for (i=0;i<store->RMB_num_beams;i++)
-				{
-				kindex = strlen(line);
-				if (i > 0)
-					sprintf(line+kindex, " %.2f", store->RMB_sounding_northings[i]);
-				else
-					sprintf(line+kindex, "%.2f", store->RMB_sounding_northings[i]);
-				}
-			kindex = strlen(line);
-			sprintf(line+kindex, "\r\n");
-			fputs(line, mbfp);
-			}
-
-		/* write RMB_sounding_depths if included */
-		if (store->RMB_beam_data_available & 0x0008)
-			{
-			/* write the next line */
-			line[0]= '\0';
-			for (i=0;i<store->RMB_num_beams;i++)
-				{
-				kindex = strlen(line);
-				if (i > 0)
-					sprintf(line+kindex, " %.2f", store->RMB_sounding_depths[i]);
-				else
-					sprintf(line+kindex, "%.2f", store->RMB_sounding_depths[i]);
-				}
-			kindex = strlen(line);
-			sprintf(line+kindex, "\r\n");
-			fputs(line, mbfp);
-			}
-
-		/* write RMB_sounding_along if included */
-		if (store->RMB_beam_data_available & 0x0010)
-			{
-			/* write the next line */
-			line[0]= '\0';
-			for (i=0;i<store->RMB_num_beams;i++)
-				{
-				kindex = strlen(line);
-				if (i > 0)
-					sprintf(line+kindex, " %.2f", store->RMB_sounding_along[i]);
-				else
-					sprintf(line+kindex, "%.2f", store->RMB_sounding_along[i]);
-				}
-			kindex = strlen(line);
-			sprintf(line+kindex, "\r\n");
-			fputs(line, mbfp);
-			}
-
-		/* write RMB_sounding_across if included */
-		if (store->RMB_beam_data_available & 0x0020)
-			{
-			/* write the next line */
-			line[0]= '\0';
-			for (i=0;i<store->RMB_num_beams;i++)
-				{
-				kindex = strlen(line);
-				if (i > 0)
-					sprintf(line+kindex, " %.2f", store->RMB_sounding_across[i]);
-				else
-					sprintf(line+kindex, "%.2f", store->RMB_sounding_across[i]);
-				}
-			kindex = strlen(line);
-			sprintf(line+kindex, "\r\n");
-			fputs(line, mbfp);
-			}
-
-		/* write RMB_sounding_pitchangles if included */
-		if (store->RMB_beam_data_available & 0x0040)
-			{
-			/* write the next line */
-			line[0]= '\0';
-			for (i=0;i<store->RMB_num_beams;i++)
-				{
-				kindex = strlen(line);
-				if (i > 0)
-					sprintf(line+kindex, " %.2f", store->RMB_sounding_pitchangles[i]);
-				else
-					sprintf(line+kindex, "%.2f", store->RMB_sounding_pitchangles[i]);
-				}
-			kindex = strlen(line);
-			sprintf(line+kindex, "\r\n");
-			fputs(line, mbfp);
-			}
-
-		/* write RMB_sounding_rollangles if included */
-		if (store->RMB_beam_data_available & 0x0080)
-			{
-			/* write the next line */
-			line[0]= '\0';
-			for (i=0;i<store->RMB_num_beams;i++)
-				{
-				kindex = strlen(line);
-				if (i > 0)
-					sprintf(line+kindex, " %.2f", store->RMB_sounding_rollangles[i]);
-				else
-					sprintf(line+kindex, "%.2f", store->RMB_sounding_rollangles[i]);
-				}
-			kindex = strlen(line);
-			sprintf(line+kindex, "\r\n");
-			fputs(line, mbfp);
-			}
-
-		/* write RMB_sounding_takeoffangles if included */
-		if (store->RMB_beam_data_available & 0x0100)
-			{
-			/* write the next line */
-			line[0]= '\0';
-			for (i=0;i<store->RMB_num_beams;i++)
-				{
-				kindex = strlen(line);
-				if (i > 0)
-					sprintf(line+kindex, " %.2f", store->RMB_sounding_takeoffangles[i]);
-				else
-					sprintf(line+kindex, "%.2f", store->RMB_sounding_takeoffangles[i]);
-				}
-			kindex = strlen(line);
-			sprintf(line+kindex, "\r\n");
-			fputs(line, mbfp);
-			}
-
-		/* write RMB_sounding_azimuthalangles if included */
-		if (store->RMB_beam_data_available & 0x0200)
-			{
-			/* write the next line */
-			line[0]= '\0';
-			for (i=0;i<store->RMB_num_beams;i++)
-				{
-				kindex = strlen(line);
-				if (i > 0)
-					sprintf(line+kindex, " %.2f", store->RMB_sounding_azimuthalangles[i]);
-				else
-					sprintf(line+kindex, "%.2f", store->RMB_sounding_azimuthalangles[i]);
-				}
-			kindex = strlen(line);
-			sprintf(line+kindex, "\r\n");
-			fputs(line, mbfp);
-			}
-
-		/* write RMB_sounding_timedelays if included */
-		if (store->RMB_beam_data_available & 0x0400)
-			{
-			/* write the next line */
-			line[0]= '\0';
-			for (i=0;i<store->RMB_num_beams;i++)
-				{
-				kindex = strlen(line);
-				if (i > 0)
-					sprintf(line+kindex, " %d", store->RMB_sounding_timedelays[i]);
-				else
-					sprintf(line+kindex, "%d", store->RMB_sounding_timedelays[i]);
-				}
-			kindex = strlen(line);
-			sprintf(line+kindex, "\r\n");
-			fputs(line, mbfp);
-			}
-
-		/* write RMB_sounding_intensities if included */
-		if (store->RMB_beam_data_available & 0x0800)
-			{
-			/* write the next line */
-			line[0]= '\0';
-			for (i=0;i<store->RMB_num_beams;i++)
-				{
-				kindex = strlen(line);
-				if (i > 0)
-					sprintf(line+kindex, " %d", store->RMB_sounding_intensities[i]);
-				else
-					sprintf(line+kindex, "%d", store->RMB_sounding_intensities[i]);
-				}
-			kindex = strlen(line);
-			sprintf(line+kindex, "\r\n");
-			fputs(line, mbfp);
-			}
-
-		/* write RMB_sounding_quality if included */
-		if (store->RMB_beam_data_available & 0x1000)
-			{
-			/* write the next line */
-			line[0]= '\0';
-			for (i=0;i<store->RMB_num_beams;i++)
-				{
-				kindex = strlen(line);
-				if (i > 0)
-					sprintf(line+kindex, " %d", store->RMB_sounding_quality[i]);
-				else
-					sprintf(line+kindex, "%d", store->RMB_sounding_quality[i]);
-				}
-			kindex = strlen(line);
-			sprintf(line+kindex, "\r\n");
-			fputs(line, mbfp);
-			}
-
-		/* write RMB_sounding_flags if included */
-		if (store->RMB_beam_data_available & 0x2000)
-			{
-			/* write the next line */
-			line[0]= '\0';
-			for (i=0;i<store->RMB_num_beams;i++)
-				{
-				kindex = strlen(line);
-				if (i > 0)
-					sprintf(line+kindex, " %d", store->RMB_sounding_flags[i]);
-				else
-					sprintf(line+kindex, "%d", store->RMB_sounding_flags[i]);
-				}
-			kindex = strlen(line);
-			sprintf(line+kindex, "\r\n");
-			fputs(line, mbfp);
-			}
-		}
-
-	/* call appropriate writing routine for other records */
-	else if (status == MB_SUCCESS)
-		{
-		/* write HCP record */
-		if (store->kind == MB_DATA_ATTITUDE)
-			{
-			sprintf(line, "HCP %d %.3f %.2f %.2f %.2f\r\n",
-				store->HCP_device_number,
-				store->HCP_time,
-				store->HCP_heave,
-				store->HCP_roll,
-				store->HCP_pitch);
-			fputs(line, mbfp);
-/* fprintf(stderr,"writeline: %s",line); */
-			}
-
-		/* write GYR record */
-		else if (store->kind == MB_DATA_HEADING)
-			{
-			sprintf(line, "GYR %d %.3f %.2f\r\n",
-				store->GYR_device_number,
-				store->GYR_time,
-				store->GYR_heading);
-			fputs(line, mbfp);
-/* fprintf(stderr,"writeline: %s",line); */
-			}
-
-		/* write DFT record */
-		else if (store->kind == MB_DATA_SONARDEPTH)
-			{
-			sprintf(line, "DFT %d %.3f %.2f\r\n",
-				store->DFT_device_number,
-				store->DFT_time,
-				store->DFT_draft);
-			fputs(line, mbfp);
-/* fprintf(stderr,"writeline: %s",line); */
-			}
-
-		/* write GPS and POS record */
-		else if (store->kind == MB_DATA_NAV
-			|| store->kind == MB_DATA_NAV1)
-			{
-			if (store->GPS_device_number == store->POS_device_number)
-				{
-				sprintf(line, "GPS %d %.3f %.2f %.2f %.2f %d %d\r\n",
-					store->GPS_device_number,
-					store->GPS_time,
-					store->GPS_cog,
-					store->GPS_sog,
-					store->GPS_hdop,
-					store->GPS_mode,
-					store->GPS_nsats);
-				fputs(line, mbfp);
-/* fprintf(stderr,"writeline: %s",line); */
-				}
-
-			sprintf(line, "POS %d %.3f %.2f %.2f\r\n",
-				store->POS_device_number,
-				store->POS_time,
-				store->POS_x,
-				store->POS_y);
-			fputs(line, mbfp);
-/* fprintf(stderr,"writeline: %s",line); */
-			}
-
-		/* write EC1 record */
-		else if (store->kind == MB_DATA_ALTITUDE)
-			{
-			sprintf(line, "EC1 %d %.3f %.2f\r\n",
-				store->EC1_device_number,
-				store->EC1_time,
-				store->EC1_rawdepth);
-			fputs(line, mbfp);
-/* fprintf(stderr,"writeline: %s",line); */
-			}
-
-		/* write TID record */
-		else if (store->kind == MB_DATA_TIDE)
-			{
-			sprintf(line, "TID %d %.3f %.2f\r\n",
-				store->TID_device_number,
-				store->TID_time,
-				store->TID_tide);
-			fputs(line, mbfp);
-/* fprintf(stderr,"writeline: %s",line); */
-			}
-
-		/* write comment */
-		else if (store->kind == MB_DATA_COMMENT)
-			{
-			sprintf(line, "COM %s\r\n", store->COM_comment);
-/* fprintf(stderr,"writeline: %s",line); */
-			}
-		}
-
-#ifdef MBR_HYSWEEP1_DEBUG
-	fprintf(stderr,"HYSWEEP1 DATA WRITTEN: type:%d status:%d error:%d\n\n",
-	store->kind, status, *error);
-#endif
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mbr_image83p.c b/src/mbio/mbr_image83p.c
deleted file mode 100644
index b0aacc4..0000000
--- a/src/mbio/mbr_image83p.c
+++ /dev/null
@@ -1,1110 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbr_image83p.c	5/5/2008
- *	$Id: mbr_image83p.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 2008-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbr_image83p.c contains the functions for reading and writing
- * multibeam data in the IMAGE83P format.
- * These functions include:
- *   mbr_alm_image83p	- allocate read/write memory
- *   mbr_dem_image83p	- deallocate read/write memory
- *   mbr_rt_image83p	- read and translate data
- *   mbr_wt_image83p	- translate and write data
- *
- * Author:	Vivek Reddy, Santa Clara University
- *       	D.W. Caress
- * Date:	May 5, 2008
- *
- * $Log: mbr_image83p.c,v $
- * Revision 5.2  2008/09/20 00:57:41  caress
- * Release 5.1.1beta23
- *
- * Revision 5.1  2008/07/19 07:41:14  caress
- * Added formats 191 and 192 to support Imagenex Delta T multibeam data.
- *
- * Revision 5.0  2008/05/16 22:51:24  caress
- * Initial version.
- *
- */
-/*
- * Notes on the MBF_IMAGE83P data format:
- *   1. This data format is used to store Imagenex DeltaT multibeam
- *      bathymetry data.
- *   2. This is a limited vendor data format that does not allow storage
- *      of calculated bathymetry and beam flags for processing. DeltaT
- *      data should be translated to format mbf_imagemba (192) using
- *      mbcopy before processing.
- *   3. Comment records are supported - this is specific to MB-System.
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mb_define.h"
-#include "mbsys_image83p.h"
-
-/* time conversion constants */
-#define MININYEAR 525600.0
-#define MININDAY 1440.0
-
-#define MBF_IMAGE83P_BUFFER_SIZE 2176
-
-/* include for byte swapping on little-endian machines */
-#ifdef BYTESWAPPED
-#include "mb_swap.h"
-#endif
-
-/* essential function prototypes */
-int mbr_register_image83p(int verbose, void *mbio_ptr,
-		int *error);
-int mbr_info_image83p(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_alm_image83p(int verbose, void *mbio_ptr, int *error);
-int mbr_dem_image83p(int verbose, void *mbio_ptr, int *error);
-int mbr_rt_image83p(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_wt_image83p(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-
-static char rcs_id[]="$Id: mbr_image83p.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mbr_register_image83p(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_register_image83p";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* get mb_io_ptr */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set format info parameters */
-	status = mbr_info_image83p(verbose,
-			&mb_io_ptr->system,
-			&mb_io_ptr->beams_bath_max,
-			&mb_io_ptr->beams_amp_max,
-			&mb_io_ptr->pixels_ss_max,
-			mb_io_ptr->format_name,
-			mb_io_ptr->system_name,
-			mb_io_ptr->format_description,
-			&mb_io_ptr->numfile,
-			&mb_io_ptr->filetype,
-			&mb_io_ptr->variable_beams,
-			&mb_io_ptr->traveltime,
-			&mb_io_ptr->beam_flagging,
-			&mb_io_ptr->nav_source,
-			&mb_io_ptr->heading_source,
-			&mb_io_ptr->vru_source,
-			&mb_io_ptr->svp_source,
-			&mb_io_ptr->beamwidth_xtrack,
-			&mb_io_ptr->beamwidth_ltrack,
-			error);
-
-	/* set format and system specific function pointers */
-	mb_io_ptr->mb_io_format_alloc = &mbr_alm_image83p;
-	mb_io_ptr->mb_io_format_free = &mbr_dem_image83p;
-	mb_io_ptr->mb_io_store_alloc = &mbsys_image83p_alloc;
-	mb_io_ptr->mb_io_store_free = &mbsys_image83p_deall;
-	mb_io_ptr->mb_io_read_ping = &mbr_rt_image83p;
-	mb_io_ptr->mb_io_write_ping = &mbr_wt_image83p;
-	mb_io_ptr->mb_io_dimensions = &mbsys_image83p_dimensions;
-	mb_io_ptr->mb_io_extract = &mbsys_image83p_extract;
-	mb_io_ptr->mb_io_insert = &mbsys_image83p_insert;
-	mb_io_ptr->mb_io_extract_nav = &mbsys_image83p_extract_nav;
-	mb_io_ptr->mb_io_insert_nav = &mbsys_image83p_insert_nav;
-	mb_io_ptr->mb_io_extract_altitude = &mbsys_image83p_extract_altitude;
-	mb_io_ptr->mb_io_insert_altitude = NULL;
-	mb_io_ptr->mb_io_extract_svp = NULL;
-	mb_io_ptr->mb_io_insert_svp = NULL;
-	mb_io_ptr->mb_io_ttimes = &mbsys_image83p_ttimes;
-	mb_io_ptr->mb_io_detects = &mbsys_image83p_detects;
-	mb_io_ptr->mb_io_copyrecord = &mbsys_image83p_copy;
-	mb_io_ptr->mb_io_extract_rawss = NULL;
-	mb_io_ptr->mb_io_insert_rawss = NULL;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",mb_io_ptr->system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",mb_io_ptr->beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",mb_io_ptr->beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",mb_io_ptr->pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",mb_io_ptr->format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",mb_io_ptr->system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",mb_io_ptr->format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",mb_io_ptr->numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",mb_io_ptr->filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",mb_io_ptr->variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",mb_io_ptr->traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",mb_io_ptr->beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",mb_io_ptr->nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",mb_io_ptr->heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",mb_io_ptr->vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",mb_io_ptr->svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",mb_io_ptr->beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",mb_io_ptr->beamwidth_ltrack);
-		fprintf(stderr,"dbg2       format_alloc:       %p\n",(void *)mb_io_ptr->mb_io_format_alloc);
-		fprintf(stderr,"dbg2       format_free:        %p\n",(void *)mb_io_ptr->mb_io_format_free);
-		fprintf(stderr,"dbg2       store_alloc:        %p\n",(void *)mb_io_ptr->mb_io_store_alloc);
-		fprintf(stderr,"dbg2       store_free:         %p\n",(void *)mb_io_ptr->mb_io_store_free);
-		fprintf(stderr,"dbg2       read_ping:          %p\n",(void *)mb_io_ptr->mb_io_read_ping);
-		fprintf(stderr,"dbg2       write_ping:         %p\n",(void *)mb_io_ptr->mb_io_write_ping);
-		fprintf(stderr,"dbg2       extract:            %p\n",(void *)mb_io_ptr->mb_io_extract);
-		fprintf(stderr,"dbg2       insert:             %p\n",(void *)mb_io_ptr->mb_io_insert);
-		fprintf(stderr,"dbg2       extract_nav:        %p\n",(void *)mb_io_ptr->mb_io_extract_nav);
-		fprintf(stderr,"dbg2       insert_nav:         %p\n",(void *)mb_io_ptr->mb_io_insert_nav);
-		fprintf(stderr,"dbg2       extract_altitude:   %p\n",(void *)mb_io_ptr->mb_io_extract_altitude);
-		fprintf(stderr,"dbg2       insert_altitude:    %p\n",(void *)mb_io_ptr->mb_io_insert_altitude);
-		fprintf(stderr,"dbg2       extract_svp:        %p\n",(void *)mb_io_ptr->mb_io_extract_svp);
-		fprintf(stderr,"dbg2       insert_svp:         %p\n",(void *)mb_io_ptr->mb_io_insert_svp);
-		fprintf(stderr,"dbg2       ttimes:             %p\n",(void *)mb_io_ptr->mb_io_ttimes);
-		fprintf(stderr,"dbg2       detects:            %p\n",(void *)mb_io_ptr->mb_io_detects);
-		fprintf(stderr,"dbg2       extract_rawss:      %p\n",(void *)mb_io_ptr->mb_io_extract_rawss);
-		fprintf(stderr,"dbg2       insert_rawss:       %p\n",(void *)mb_io_ptr->mb_io_insert_rawss);
-		fprintf(stderr,"dbg2       copyrecord:         %p\n",(void *)mb_io_ptr->mb_io_copyrecord);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbr_info_image83p(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error)
-{
-	char	*function_name = "mbr_info_image83p";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* set format info parameters */
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-	*system = MB_SYS_IMAGE83P;
-	*beams_bath_max = 480;
-	*beams_amp_max = 0;
-	*pixels_ss_max = 0;
-	strncpy(format_name, "IMAGE83P", MB_NAME_LENGTH);
-	strncpy(system_name, "IMAGE83P", MB_NAME_LENGTH);
-	strncpy(format_description, "Format name:          MBF_IMAGE83P\nInformal Description: Imagenex DeltaT Multibeam\nAttributes:           Multibeam, bathymetry, 480 beams, ascii + binary, Imagenex.\n", MB_DESCRIPTION_LENGTH);
-	*numfile = 1;
-	*filetype = MB_FILETYPE_NORMAL;
-	*variable_beams = MB_NO;
-	*traveltime = MB_NO;
-	*beam_flagging = MB_YES;
-	*nav_source = MB_DATA_DATA;
-	*heading_source = MB_DATA_DATA;
-	*vru_source = MB_DATA_NONE;
-	*svp_source = MB_DATA_NONE;
-	*beamwidth_xtrack = 0.75;
-	*beamwidth_ltrack = 0.75;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",*system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",*beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",*beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",*pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",*numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",*filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",*variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",*traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",*beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",*nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",*heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",*vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",*svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",*beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",*beamwidth_ltrack);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_alm_image83p(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_alm_image83p";
-	int	status;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set initial status */
-	status = MB_SUCCESS;
-
-	/* allocate memory for data structure */
-	status = mb_malloc(verbose,sizeof(struct mbsys_image83p_struct),
-				&mb_io_ptr->store_data,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_dem_image83p(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_dem_image83p";
-	int	status;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* deallocate memory for data descriptor */
-	status = mb_free(verbose,&mb_io_ptr->store_data,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_rt_image83p(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_rt_image83p";
-	int	status;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_image83p_struct *store;
-	char	buffer[MBF_IMAGE83P_BUFFER_SIZE];
-	int	done;
-	int	index;
-	int	swap = MB_NO;
-	short	short_val;
-	int	int_val;
-	int	numberbytes, seconds_hundredths;
-	double	degrees, minutes, dec_minutes;
-	double	alpha, beta, theta, phi;
-	double	soundspeed, rr, xx, zz;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_image83p_struct *) store_ptr;
-
-	/* set file position */
-	mb_io_ptr->file_pos = mb_io_ptr->file_bytes;
-
-	/* read next record header from file */
-	done = MB_NO;
-	for(i = 0; i < MBF_IMAGE83P_BUFFER_SIZE; i ++)
-		buffer[i] = 0;
-	if ((status = fread(buffer,1,6,mb_io_ptr->mbfp)) == 6)
-		{
-		/* check for valid header */
-		if (strncmp(buffer,"83P",3) == 0)
-			{
-			done = MB_YES;
-			status = MB_SUCCESS;
-			*error = MB_ERROR_NO_ERROR;
-			}
-		else
-			{
-			/* loop over reading bytes until valid header is found */
-			while (done == MB_NO)
-				{
-				for (i=0;i<5;i++)
-					buffer[i] = buffer[i+1];
-				status = fread(&buffer[5],1,1,mb_io_ptr->mbfp);
-				if (status != 1)
-					{
-					mb_io_ptr->file_bytes += status;
-					status = MB_FAILURE;
-					*error = MB_ERROR_EOF;
-					done = MB_YES;
-					}
-				else if (strncmp(buffer,"83P",3) == 0)
-					{
-					done = MB_YES;
-					}
-				}
-			}
-		}
-	else
-		{
-		mb_io_ptr->file_bytes += status;
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	/* read rest of record from file */
-	if (status == MB_SUCCESS)
-		{
-		index = 3;
-		store->version = (int) buffer[index]; index++;
-
-		mb_get_binary_short(swap, &buffer[index], &short_val);
-		numberbytes = (int) ((unsigned short) short_val);
-
-		if ((status = fread(&buffer[6],1,numberbytes-6,mb_io_ptr->mbfp)) != numberbytes-6)
-			{
-			mb_io_ptr->file_bytes += status;
-			status = MB_FAILURE;
-			*error = MB_ERROR_EOF;
-			store->kind = MB_DATA_NONE;
-			}
-		else
-			{
-			status = MB_SUCCESS;
-			mb_io_ptr->file_bytes += status;
-			}
-		}
-
-	/* if success then parse the buffer */
-	if (status == MB_SUCCESS && buffer[6] =='#')
-		{
-		/* type of data record */
-		store->kind = MB_DATA_COMMENT;
-
-		/* copy comment */
-		index = 8;
-		strncpy(store->comment, &buffer[index], MBSYS_IMAGE83P_COMMENTLEN);
-		}
-
-	/* if success then parse the buffer */
-	else if (status == MB_SUCCESS)
-		{
-		/* type of data record */
-		store->kind = MB_DATA_DATA;
-
-		/* parse year */
-		index = 8;
-		mb_get_int(&store->time_i[0], &buffer[index + 7], 4);
-
-		/* parse month */
-		if(buffer[index + 3] == 'J')
-			{
-			if(buffer[index + 4] == 'A')
-				{
-				store->time_i[1] = 1;
-				}
-			else if(buffer[index + 5] == 'N')
-				{
-				store->time_i[1] = 6;
-				}
-			else
-				{
-				store->time_i[1] = 7;
-				}
-			}
-		else if(buffer[index + 3] == 'F')
-			{
-			store->time_i[1] = 2;
-			}
-		else if(buffer[index + 3] == 'M')
-			{
-			if(buffer[index + 5] == 'R')
-				{
-				store->time_i[1] = 3;
-				}
-			else
-				{
-				store->time_i[1] = 5;
-				}
-			}
-		else if(buffer[index + 3] == 'A')
-			{
-			if(buffer[index + 4] == 'P')
-				{
-				store->time_i[1] = 4;
-				}
-			else
-				{
-				store->time_i[1] = 8;
-				}
-			}
-		else if(buffer[index + 3] == 'S')
-			{
-			store->time_i[1] = 9;
-			}
-		else if(buffer[index + 3] == 'O')
-			{
-			store->time_i[1] = 10;
-			}
-		else if(buffer[index + 3] == 'N')
-			{
-			store->time_i[1] = 11;
-			}
-		else if(buffer[index + 3] == 'D')
-			{
-			store->time_i[1] = 12;
-			}
-
-		mb_get_int(&store->time_i[2], &buffer[index + 0], 2);
-		index +=12; /*to time*/
-
-		/* parse time */
-		mb_get_int(&store->time_i[3], &buffer[index], 2);
-		mb_get_int(&store->time_i[4], &buffer[index+3], 2);
-		mb_get_int(&store->time_i[5], &buffer[index+6], 2);
-		mb_get_int(&seconds_hundredths, &buffer[index+10], 2);
-		store->time_i[6] = 10000 * seconds_hundredths;
-		mb_get_time(verbose,store->time_i,&store->time_d);
-		for (i=0;i<7;i++)
-			{
-			mb_io_ptr->new_time_i[i] = store->time_i[i];
-
-			}
-		mb_io_ptr->new_time_d = store->time_d;
-		index += 13; /*to navigation latitude*/
-
-		/* parse gps navigation string latitude */
-		mb_get_double(&degrees, &buffer[index + 1], 2);
-		mb_get_double(&minutes, &buffer[index + 4], 2);
-		mb_get_double(&dec_minutes, &buffer[index + 7], 5);
-
-
-		store->nav_lat = degrees + (((dec_minutes / 100000) + minutes) / 60);
-		if(buffer[index + 13] == 'S' || buffer[index + 13] == 's')
-			{
-			store->nav_lat = -store->nav_lat;
-			}
-		index += 14; /*to navigation longtitude*/
-
-		/* parse gps navigation string longtitude */
-		mb_get_double(&degrees, &buffer[index], 3);
-		mb_get_double(&minutes, &buffer[index + 4], 2);
-		mb_get_double(&dec_minutes, &buffer[index + 7], 5);
-		store->nav_long = degrees + (((dec_minutes / 100000) + minutes) / 60);
-		if(buffer[index + 13] == 'W' || buffer[index + 13] == 'w')
-			{
-			store->nav_long = -store->nav_long;
-			}
-		index += 14;
-
-		/* parse gps speed and heading */
-		store->nav_speed = (int) ((mb_u_char)buffer[index]); index += 1;
-		mb_get_binary_short(swap, &buffer[index], &short_val); index += 2;
-		    store->nav_heading = (int) ((unsigned short) short_val);
-
-		/* parse dvl attitude and heading */
-/*		if (((mb_u_char)buffer[index]) >> 7)
-			{
-			store->pitch = ((((mb_u_char)buffer[index]) & 0x7F) << 8) + ((mb_u_char)buffer[index+1]);
-			}
-		else
-			{
-			store->pitch = 0;
-			}*/
-		store->pitch = ((((mb_u_char)buffer[index]) & 0x7F) << 8) + ((mb_u_char)buffer[index+1]);
-		index += 2;
-/*		if (((mb_u_char)buffer[index]) >> 7)
-			{
-			store->roll = ((((mb_u_char)buffer[index]) & 0x7F) << 8) + ((mb_u_char)buffer[index+1]);
-			}
-		else
-			{
-			store->roll = 0;
-			}*/
-		store->roll = ((((mb_u_char)buffer[index]) & 0x7F) << 8) + ((mb_u_char)buffer[index+1]);
-		index += 2;
-/*		if (((mb_u_char)buffer[index]) >> 7)
-			{
-			store->heading = ((((mb_u_char)buffer[index]) & 0x7F) << 8) + ((mb_u_char)buffer[index+1]);
-			}
-		else
-			{
-			store->heading = 0;
-			}*/
-		store->heading = ((((mb_u_char)buffer[index]) & 0x7F) << 8) + ((mb_u_char)buffer[index+1]);
-		index += 2;
-
-		/* parse beam info */
-		mb_get_binary_short(swap, &buffer[index], &short_val); index += 2;
-		    store->num_beams = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &buffer[index], &short_val); index += 2;
-		    store->samples_per_beam = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &buffer[index], &short_val); index += 2;
-		    store->sector_size = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &buffer[index], &short_val); index += 2;
-		    store->start_angle = (int) ((unsigned short) short_val);
-		store->angle_increment = (int) ((mb_u_char)buffer[index]); index += 1;
-		mb_get_binary_short(swap, &buffer[index], &short_val); index += 2;
-		    store->acoustic_range = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &buffer[index], &short_val); index += 2;
-		    store->acoustic_frequency = (int) ((unsigned short) short_val);
-		if (buffer[index] >> 7)
-			{
-			store->sound_velocity = ((((mb_u_char)buffer[index]) & 0x7F) << 8) + ((mb_u_char)buffer[index+1]);
-			}
-		else
-			{
-			store->sound_velocity = 15000;
-			}
-		index += 2;
-
-		mb_get_binary_short(swap, &buffer[index], &short_val); index += 2;
-		    store->range_resolution = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &buffer[index], &short_val); index += 2;
-		    store->pulse_length = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &buffer[index], &short_val); index += 2;
-		    store->profile_tilt_angle = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &buffer[index], &short_val); index += 2;
-		    store->rep_rate = (int) ((unsigned short) short_val);
-		mb_get_binary_int(swap, &buffer[index], &int_val); index += 4;
-		    store->ping_number = int_val;
-		index += 159;
-
-		/* fix unexpected zero values */
-		if (store->pitch == 0)
-			store->pitch = 900;
-		if (store->roll == 0)
-			store->roll = 900;
-		if (store->profile_tilt_angle == 0)
-			store->profile_tilt_angle = 180;
-
-		/* get ranges */
-		for (i=0;i<store->num_beams;i++)
-			{
-			mb_get_binary_short(swap, &buffer[index], &short_val); index += 2;
-		    	store->range[i] = (int) ((unsigned short) short_val);
-			}
-		}
-	mb_io_ptr->new_kind = store->kind;
-	mb_io_ptr->new_error = *error;
-
-	/* if success then calculate bathymetry */
-	if (status == MB_SUCCESS && store->kind == MB_DATA_DATA)
-		{
-		if (store->sound_velocity > 13000 && store->sound_velocity < 17000)
-			soundspeed = 0.1 * store->sound_velocity;
-		else
-			soundspeed = 1500.0;
-		store->sonar_depth = 0.0;
-		store->heave = 0.0;
-		store->num_proc_beams = store->num_beams;
-		for (i=0;i<store->num_proc_beams;i++)
-			{
-			if (store->range[i] > 0)
-				{
-				alpha = 0.1 * (store->pitch - 900) + ((double)store->profile_tilt_angle - 180.0);
-				beta = 270.0 - 0.01 * (store->start_angle + i * store->angle_increment)
-					+ 0.1 * (store->roll - 900);
-				mb_rollpitch_to_takeoff(
-					verbose,
-					alpha, beta,
-					&theta, &phi,
-					error);
-				rr = (soundspeed / 1500.0) * 0.001 * store->range_resolution * store->range[i];
-				xx = rr * sin(DTR * theta);
-				zz = rr * cos(DTR * theta);
-				store->beamrange[i] = rr;
-				store->angles[i] = theta;
-				store->angles_forward[i] = phi;
-				store->bathacrosstrack[i] = xx * cos(DTR * phi);
-				store->bathalongtrack[i] = xx * sin(DTR * phi);
-				store->bath[i] = zz + store->sonar_depth - store->heave;
-				store->beamflag[i] = MB_FLAG_NONE;
-				}
-			else
-				{
-				store->beamrange[i] = 0.0;
-				store->angles[i] = 0.0;
-				store->angles_forward[i] = 0.0;
-				store->beamflag[i] = MB_FLAG_NULL;
-				store->bath[i] = 0.0;
-				store->bathacrosstrack[i] = 0.0;
-				store->bathalongtrack[i] = 0.0;
-				}
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 4)
-		{
-		fprintf(stderr,"\ndbg2  Record read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg4  Data values:\n");
-		fprintf(stderr,"dbg4       kind:               %d\n",store->kind);
-		fprintf(stderr,"dbg4       version:            %d\n",store->version);
-		fprintf(stderr,"dbg4       time_i[0]:          %d\n",store->time_i[0]);
-		fprintf(stderr,"dbg4       time_i[1]:          %d\n",store->time_i[1]);
-		fprintf(stderr,"dbg4       time_i[2]:          %d\n",store->time_i[2]);
-		fprintf(stderr,"dbg4       time_i[3]:          %d\n",store->time_i[3]);
-		fprintf(stderr,"dbg4       time_i[4]:          %d\n",store->time_i[4]);
-		fprintf(stderr,"dbg4       time_i[5]:          %d\n",store->time_i[5]);
-		fprintf(stderr,"dbg4       time_i[6]:          %d\n",store->time_i[6]);
-		fprintf(stderr,"dbg4       time_d:             %f\n",store->time_d);
-		fprintf(stderr,"dbg4       nav_lat:            %f\n",store->nav_lat);
-		fprintf(stderr,"dbg4       nav_long:           %f\n",store->nav_long);
-		fprintf(stderr,"dbg4       nav_speed:          %d\n",store->nav_speed); /* 0.1 knots */
-		fprintf(stderr,"dbg4       nav_heading:        %d\n",store->nav_heading); /*0.1 degrees */
-		fprintf(stderr,"dbg4       pitch:              %d\n",store->pitch);
-		fprintf(stderr,"dbg4       roll:               %d\n",store->roll);
-		fprintf(stderr,"dbg4       heading:            %d\n",store->heading);
-		fprintf(stderr,"dbg4       num_beams:          %d\n",store->num_beams);
-		fprintf(stderr,"dbg4       samples_per_beam:   %d\n",store->samples_per_beam);
-		fprintf(stderr,"dbg4       sector_size:        %d\n",store->sector_size); /* degrees */
-		fprintf(stderr,"dbg4       start_angle:        %d\n",store->start_angle); /* 0.01 degrees + 180.0 */
-		fprintf(stderr,"dbg4       angle_increment:    %d\n",store->angle_increment); /* 0.01 degrees */
-		fprintf(stderr,"dbg4       acoustic_range:     %d\n",store->acoustic_range); /* meters */
-		fprintf(stderr,"dbg4       acoustic_frequency: %d\n",store->acoustic_frequency); /* kHz */
-		fprintf(stderr,"dbg4       sound_velocity:     %d\n",store->sound_velocity); /* 0.1 m/sec */
-		fprintf(stderr,"dbg4       range_resolution:   %d\n",store->range_resolution); /* 0.001 meters */
-		fprintf(stderr,"dbg4       pulse_length:       %d\n",store->pulse_length); /* usec */
-		fprintf(stderr,"dbg4       profile_tilt_angle: %d\n",store->profile_tilt_angle); /* degrees + 180.0 */
-		fprintf(stderr,"dbg4       rep_rate:           %d\n",store->rep_rate); /* msec */
-		fprintf(stderr,"dbg4       ping_number:        %d\n",store->ping_number);
-		for (i=0;i<store->num_beams;i++)
-			fprintf(stderr,"dbg4       range[%d]:            %d\n",i,store->range[i]);
-		fprintf(stderr,"dbg4       sonar_depth:        %f\n",store->sonar_depth);
-		fprintf(stderr,"dbg4       heave:              %f\n",store->heave);
-		fprintf(stderr,"dbg4       num_proc_beams:     %d\n",store->num_proc_beams);
-		for (i=0;i<store->num_proc_beams;i++)
-			fprintf(stderr,"dbg4       tt[%d]: %f angles:%f %f   bath: %f %f %f %d\n",
-				i,store->beamrange[i],store->angles[i],store->angles_forward[i],
-				store->bath[i],store->bathacrosstrack[i],
-				store->bathalongtrack[i],store->beamflag[i]);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_wt_image83p(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_wt_image83p";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_image83p_struct *store;
-	char	buffer[MBF_IMAGE83P_BUFFER_SIZE];
-	int	swap = MB_NO;
-	int	seconds_hundredths;
-	int	degrees;
-	double	minutes;
-	char	NorS;
-	int	write_len, index;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_image83p_struct *) store_ptr;
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Status at beginning of MBIO function <%s>\n",function_name);
-		if (store != NULL)
-			fprintf(stderr,"dbg5       store->kind:    %d\n",
-				store->kind);
-		fprintf(stderr,"dbg5       new_kind:       %d\n",
-			mb_io_ptr->new_kind);
-		fprintf(stderr,"dbg5       new_error:      %d\n",
-			mb_io_ptr->new_error);
-		fprintf(stderr,"dbg5       error:          %d\n",*error);
-		fprintf(stderr,"dbg5       status:         %d\n",status);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 4)
-		{
-		fprintf(stderr,"\ndbg2  Record read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg4  Data values:\n");
-		fprintf(stderr,"dbg4       kind:               %d\n",store->kind);
-		fprintf(stderr,"dbg4       version:            %d\n",store->version);
-		fprintf(stderr,"dbg4       time_i[0]:          %d\n",store->time_i[0]);
-		fprintf(stderr,"dbg4       time_i[1]:          %d\n",store->time_i[1]);
-		fprintf(stderr,"dbg4       time_i[2]:          %d\n",store->time_i[2]);
-		fprintf(stderr,"dbg4       time_i[3]:          %d\n",store->time_i[3]);
-		fprintf(stderr,"dbg4       time_i[4]:          %d\n",store->time_i[4]);
-		fprintf(stderr,"dbg4       time_i[5]:          %d\n",store->time_i[5]);
-		fprintf(stderr,"dbg4       time_i[6]:          %d\n",store->time_i[6]);
-		fprintf(stderr,"dbg4       time_d:             %f\n",store->time_d);
-		fprintf(stderr,"dbg4       nav_lat:            %f\n",store->nav_lat);
-		fprintf(stderr,"dbg4       nav_long:           %f\n",store->nav_long);
-		fprintf(stderr,"dbg4       nav_speed:          %d\n",store->nav_speed); /* 0.1 knots */
-		fprintf(stderr,"dbg4       nav_heading:        %d\n",store->nav_heading); /*0.1 degrees */
-		fprintf(stderr,"dbg4       pitch:              %d\n",store->pitch);
-		fprintf(stderr,"dbg4       roll:               %d\n",store->roll);
-		fprintf(stderr,"dbg4       heading:            %d\n",store->heading);
-		fprintf(stderr,"dbg4       num_beams:          %d\n",store->num_beams);
-		fprintf(stderr,"dbg4       samples_per_beam:   %d\n",store->samples_per_beam);
-		fprintf(stderr,"dbg4       sector_size:        %d\n",store->sector_size); /* degrees */
-		fprintf(stderr,"dbg4       start_angle:        %d\n",store->start_angle); /* 0.01 degrees + 180.0 */
-		fprintf(stderr,"dbg4       angle_increment:    %d\n",store->angle_increment); /* 0.01 degrees */
-		fprintf(stderr,"dbg4       acoustic_range:     %d\n",store->acoustic_range); /* meters */
-		fprintf(stderr,"dbg4       acoustic_frequency: %d\n",store->acoustic_frequency); /* kHz */
-		fprintf(stderr,"dbg4       sound_velocity:     %d\n",store->sound_velocity); /* 0.1 m/sec */
-		fprintf(stderr,"dbg4       range_resolution:   %d\n",store->range_resolution); /* 0.001 meters */
-		fprintf(stderr,"dbg4       pulse_length:       %d\n",store->pulse_length); /* usec */
-		fprintf(stderr,"dbg4       profile_tilt_angle: %d\n",store->profile_tilt_angle); /* degrees + 180.0 */
-		fprintf(stderr,"dbg4       rep_rate:           %d\n",store->rep_rate); /* msec */
-		fprintf(stderr,"dbg4       ping_number:        %d\n",store->ping_number);
-		for (i=0;i<store->num_beams;i++)
-			fprintf(stderr,"dbg4       range[%d]:            %d\n",i,store->range[i]);
-		fprintf(stderr,"dbg4       sonar_depth:        %f\n",store->sonar_depth);
-		fprintf(stderr,"dbg4       heave:              %f\n",store->heave);
-		fprintf(stderr,"dbg4       num_proc_beams:     %d\n",store->num_proc_beams);
-		for (i=0;i<store->num_proc_beams;i++)
-			fprintf(stderr,"dbg4       tt[%d]: %f angles:%f %f   bath: %f %f %f %d\n",
-				i,store->beamrange[i],store->angles[i],store->angles_forward[i],
-				store->bath[i],store->bathacrosstrack[i],
-				store->bathalongtrack[i],store->beamflag[i]);
-		}
-
-	/*  translate values from image83p data storage structure */
-	if (store != NULL)
-		{
-		if (store->kind == MB_DATA_DATA)
-			{
-			/* header */
-			index = 0;
-			buffer[index] = '8'; index++;
-			buffer[index] = '3'; index++;
-			buffer[index] = 'P'; index++;
-			buffer[index] = (char) store->version; index++;
-			write_len = 256 + 2 * store->num_beams;
-			mb_put_binary_short(swap, (unsigned short)write_len, (void *) &buffer[index]); index +=2;
-			buffer[index] = 0; index++;
-			buffer[index] = 0; index++; /* index = 8 */
-
-			/* date */
-			sprintf(&buffer[index], "%2.2d-", store->time_i[2]); index += 3;
-			switch(store->time_i[1])
-				{
-				case (1)  : sprintf(&buffer[index], "%s", "JAN-");
-							break;
-				case (2)  : sprintf(&buffer[index], "%s", "FEB-");
-							break;
-				case (3)  : sprintf(&buffer[index], "%s", "MAR-");
-							break;
-				case (4)  : sprintf(&buffer[index], "%s", "APR-");
-							break;
-				case (5)  : sprintf(&buffer[index], "%s", "MAY-");
-							break;
-				case (6)  : sprintf(&buffer[index], "%s", "JUN-");
-							break;
-				case (7)  : sprintf(&buffer[index], "%s", "JUL-");
-							break;
-				case (8)  : sprintf(&buffer[index], "%s", "AUG-");
-							break;
-				case (9)  : sprintf(&buffer[index], "%s", "SEP-");
-							break;
-				case (10)  :sprintf(&buffer[index], "%s", "OCT-");
-							break;
-				case (11) : sprintf(&buffer[index], "%s", "NOV-");
-							break;
-				case (12) : sprintf(&buffer[index],"%s", "DEC-");
-							break;
-				}
-			index += 4;
-			sprintf(&buffer[index], "%4.4d", store->time_i[0]); index += 4;
-			buffer[index] = 0; index++; /* index = 20 */
-
-			/* time */
-			sprintf(&buffer[index], "%2.2d:%2.2d:%2.2d",
-				store->time_i[3], store->time_i[4], store->time_i[5]); index += 8;
-			buffer[index] = 0; index++; /* index = 29 */
-
-			/* hundredths of seconds */
-			seconds_hundredths = store->time_i[6] / 10000;
-			sprintf(&buffer[index], ".%2.2d", seconds_hundredths); index += 3;
-			buffer[index] = 0; index++; /* index = 33 */
-
-			/* latitude*/
-			if (store->nav_lat > 0.0)
-				NorS = 'N';
-			else
-				NorS = 'S';
-			degrees = (int) fabs(store->nav_lat);
-			minutes = (fabs(store->nav_lat) - (double)degrees) * 60.0;
-			sprintf(&buffer[index], "_%2.2d.%8.5f_%c", degrees, minutes, NorS); index += 14; /* index = 47 */
-
-			/* longitude*/
-			if (store->nav_long > 0.0)
-				NorS = 'E';
-			else
-				NorS = 'W';
-			degrees = (int) fabs(store->nav_long);
-			minutes = (fabs(store->nav_long) - (double)degrees) * 60.0;
-			sprintf(&buffer[index], "%3.3d.%8.5f_%c", degrees, minutes, NorS);
-			index += 14; /* index = 61 */
-
-			/* speed */
-			buffer[index] = store->nav_speed; index++; /* index = 62 */
-
-			/* heading*/
-			mb_put_binary_short(swap, (unsigned short)store->nav_heading, (void *) &buffer[index]);
-			index += 2; /* index = 64 */
-
-			/* pitch */
-			mb_put_binary_short(swap, (unsigned short)store->pitch, (void *)&buffer[index]);
-			if (store->pitch != 0)
-				buffer[index] = buffer[index] | 0x80;
-			index += 2; /* index = 66 */
-
-			/* roll */
-			mb_put_binary_short(swap, (unsigned short)store->roll, (void *)&buffer[index]);
-			if(store->roll != 0)
-				buffer[index] = buffer[index] | 0x80;
-			index += 2; /* index = 68 */
-
-			/* heading */
-			mb_put_binary_short(swap, (unsigned short)store->heading, (void *)&buffer[index]);
-			if(store->heading != 0)
-				buffer[index] = buffer[index] | 0x80;
-			index += 2; /* index = 70 */
-
-			/* beams */
-			mb_put_binary_short(swap, (unsigned short)store->num_beams, (void *)&buffer[index]);
-			index += 2; /* index = 72 */
-			mb_put_binary_short(swap, (unsigned short)store->samples_per_beam, (void *)&buffer[index]);
-			index += 2; /* index = 74 */
-			mb_put_binary_short(swap, (unsigned short)store->sector_size, (void *)&buffer[index]);
-			index += 2; /* index = 76 */
-			mb_put_binary_short(swap, (unsigned short)store->start_angle, (void *)&buffer[index]);
-			index += 2; /* index = 78 */
-			buffer[index] = store->angle_increment;
-			index+=1; /* index = 79 */
-			mb_put_binary_short(swap, (unsigned short)store->acoustic_range, (void *)&buffer[index]);
-			index += 2; /* index = 81 */
-			mb_put_binary_short(swap, (unsigned short)store->acoustic_frequency, (void *)&buffer[index]);
-			index += 2; /* index = 83 */
-			mb_put_binary_short(swap, (unsigned short)store->sound_velocity, (void *)&buffer[index]);
-			if(store->sound_velocity != 0)
-				buffer[index] = buffer[index] | 0x80;
-			index += 2; /* index = 85 */
-			mb_put_binary_short(swap, (unsigned short)store->range_resolution, (void *)&buffer[index]);
-			index += 2; /* index = 87 */
-			mb_put_binary_short(swap, (unsigned short)store->pulse_length, (void *)&buffer[index]);
-			index += 2; /* index = 89 */
-			mb_put_binary_short(swap, (unsigned short)store->profile_tilt_angle, (void *)&buffer[index]);
-			index += 2; /* index = 91 */
-			mb_put_binary_short(swap, (unsigned short)store->rep_rate, (void *)&buffer[index]);
-			index += 2; /* index = 93 */
-			mb_put_binary_int(swap, store->ping_number, (void *)&buffer[index]);
-			index += 4; /* index = 97 */
-
-			/* blank part of header */
-			for (i=index;i<=255;i++)
-				buffer[i] = 0;
-			index += 159; /* index 256 */
-
-			/* ranges */
-			for (i=0;i<store->num_beams;i++)
-				{
-				mb_put_binary_short(swap, (unsigned short)store->range[i], &buffer[index + (i * 2)]);
-				}
-			}
-
-		else if (store->kind == MB_DATA_COMMENT)
-			{
-			/* header */
-			index = 0;
-			buffer[index] = '8'; index++;
-			buffer[index] = '3'; index++;
-			buffer[index] = 'P'; index++;
-			buffer[index] = (char) store->version; index++;
-			write_len = 256;
-			mb_put_binary_short(swap, (unsigned short)write_len, (void *) &buffer[index]); index +=2;
-			buffer[index] = '#'; index++;
-			buffer[index] = '#'; index++; /* index = 8 */
-
-			/* write comment */
-			strncpy(&buffer[index], store->comment, MBSYS_IMAGE83P_COMMENTLEN);
-			for (i=8+strlen(store->comment);i<8+MBSYS_IMAGE83P_COMMENTLEN;i++)
-					buffer[i] = 0;
-			}
-
-		/* write next record to file */
-		if (store->kind == MB_DATA_DATA
-			|| store->kind == MB_DATA_COMMENT)
-			{
-			if ((status = fwrite(buffer,1,write_len,
-				mb_io_ptr->mbfp))
-				== write_len)
-				{
-				status = MB_SUCCESS;
-				*error = MB_ERROR_NO_ERROR;
-				}
-			else
-				{
-				status = MB_FAILURE;
-				*error = MB_ERROR_WRITE_FAIL;
-				}
-
-			}
-		else
-			{
-			status = MB_SUCCESS;
-			*error = MB_ERROR_NO_ERROR;
-			if (verbose >= 5)
-				fprintf(stderr,"\ndbg5  No data written in MBIO function <%s>\n",function_name);
-			}
-		}
-
-	else
-		{
-		status = MB_SUCCESS;
-		*error = MB_ERROR_NO_ERROR;
-		if (verbose >= 5)
-			fprintf(stderr,"\ndbg5  No data written in MBIO function <%s>\n",function_name);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mbr_imagemba.c b/src/mbio/mbr_imagemba.c
deleted file mode 100644
index 0908233..0000000
--- a/src/mbio/mbr_imagemba.c
+++ /dev/null
@@ -1,1071 +0,0 @@
-   /*--------------------------------------------------------------------
- *    The MB-system:	mbr_imagemba.c	7/18/2008
- *	$Id: mbr_imagemba.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 2008-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbr_imagemba.c contains the functions for reading and writing
- * multibeam data in the IMAGEMBA format.
- * These functions include:
- *   mbr_alm_imagemba	- allocate read/write memory
- *   mbr_dem_imagemba	- deallocate read/write memory
- *   mbr_rt_imagemba	- read and translate data
- *   mbr_wt_imagemba	- translate and write data
- *
- * Author:	D.W. Caress
- * Date:	July 18, 2008
- *
- * $Log: mbr_imagemba.c,v $
- * Revision 5.1  2008/09/20 00:57:41  caress
- * Release 5.1.1beta23
- *
- * Revision 5.0  2008/07/19 07:43:00  caress
- * Added format 192 to support Imagenex Delta T multibeam data.
- *
- *
- *
- */
-/*
- * Notes on the MBF_IMAGEMBA data format:
- *   1. This data format is used to store Imagenex DeltaT multibeam
- *      bathymetry data.
- *   2. This data format is extended from the vendor format mbf_imagemba (191)
- *      in order to allow storage of calculated bathymetry and beam flags
- *      for processing.
- *   3. Comment records are supported.
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mb_define.h"
-#include "mbsys_image83p.h"
-
-/* time conversion constants */
-#define MININYEAR 525600.0
-#define MININDAY 1440.0
-
-#define MBF_IMAGEMBA_BUFFER_SIZE 7456
-#define MBF_IMAGEMBA_BEAM_SIZE 15
-
-/* include for byte swapping */
-#ifdef BYTESWAPPED
-#include "mb_swap.h"
-#endif
-
-/* essential function prototypes */
-int mbr_register_imagemba(int verbose, void *mbio_ptr,
-		int *error);
-int mbr_info_imagemba(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_alm_imagemba(int verbose, void *mbio_ptr, int *error);
-int mbr_dem_imagemba(int verbose, void *mbio_ptr, int *error);
-int mbr_rt_imagemba(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_wt_imagemba(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-
-static char rcs_id[]="$Id: mbr_imagemba.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mbr_register_imagemba(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_register_imagemba";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* get mb_io_ptr */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set format info parameters */
-	status = mbr_info_imagemba(verbose,
-			&mb_io_ptr->system,
-			&mb_io_ptr->beams_bath_max,
-			&mb_io_ptr->beams_amp_max,
-			&mb_io_ptr->pixels_ss_max,
-			mb_io_ptr->format_name,
-			mb_io_ptr->system_name,
-			mb_io_ptr->format_description,
-			&mb_io_ptr->numfile,
-			&mb_io_ptr->filetype,
-			&mb_io_ptr->variable_beams,
-			&mb_io_ptr->traveltime,
-			&mb_io_ptr->beam_flagging,
-			&mb_io_ptr->nav_source,
-			&mb_io_ptr->heading_source,
-			&mb_io_ptr->vru_source,
-			&mb_io_ptr->svp_source,
-			&mb_io_ptr->beamwidth_xtrack,
-			&mb_io_ptr->beamwidth_ltrack,
-			error);
-
-	/* set format and system specific function pointers */
-	mb_io_ptr->mb_io_format_alloc = &mbr_alm_imagemba;
-	mb_io_ptr->mb_io_format_free = &mbr_dem_imagemba;
-	mb_io_ptr->mb_io_store_alloc = &mbsys_image83p_alloc;
-	mb_io_ptr->mb_io_store_free = &mbsys_image83p_deall;
-	mb_io_ptr->mb_io_read_ping = &mbr_rt_imagemba;
-	mb_io_ptr->mb_io_write_ping = &mbr_wt_imagemba;
-	mb_io_ptr->mb_io_dimensions = &mbsys_image83p_dimensions;
-	mb_io_ptr->mb_io_extract = &mbsys_image83p_extract;
-	mb_io_ptr->mb_io_insert = &mbsys_image83p_insert;
-	mb_io_ptr->mb_io_extract_nav = &mbsys_image83p_extract_nav;
-	mb_io_ptr->mb_io_insert_nav = &mbsys_image83p_insert_nav;
-	mb_io_ptr->mb_io_extract_altitude = &mbsys_image83p_extract_altitude;
-	mb_io_ptr->mb_io_insert_altitude = NULL;
-	mb_io_ptr->mb_io_extract_svp = NULL;
-	mb_io_ptr->mb_io_insert_svp = NULL;
-	mb_io_ptr->mb_io_ttimes = &mbsys_image83p_ttimes;
-	mb_io_ptr->mb_io_detects = &mbsys_image83p_detects;
-	mb_io_ptr->mb_io_copyrecord = &mbsys_image83p_copy;
-	mb_io_ptr->mb_io_extract_rawss = NULL;
-	mb_io_ptr->mb_io_insert_rawss = NULL;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",mb_io_ptr->system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",mb_io_ptr->beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",mb_io_ptr->beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",mb_io_ptr->pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",mb_io_ptr->format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",mb_io_ptr->system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",mb_io_ptr->format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",mb_io_ptr->numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",mb_io_ptr->filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",mb_io_ptr->variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",mb_io_ptr->traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",mb_io_ptr->beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",mb_io_ptr->nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",mb_io_ptr->heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",mb_io_ptr->vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",mb_io_ptr->svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",mb_io_ptr->beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",mb_io_ptr->beamwidth_ltrack);
-		fprintf(stderr,"dbg2       format_alloc:       %p\n",(void *)mb_io_ptr->mb_io_format_alloc);
-		fprintf(stderr,"dbg2       format_free:        %p\n",(void *)mb_io_ptr->mb_io_format_free);
-		fprintf(stderr,"dbg2       store_alloc:        %p\n",(void *)mb_io_ptr->mb_io_store_alloc);
-		fprintf(stderr,"dbg2       store_free:         %p\n",(void *)mb_io_ptr->mb_io_store_free);
-		fprintf(stderr,"dbg2       read_ping:          %p\n",(void *)mb_io_ptr->mb_io_read_ping);
-		fprintf(stderr,"dbg2       write_ping:         %p\n",(void *)mb_io_ptr->mb_io_write_ping);
-		fprintf(stderr,"dbg2       extract:            %p\n",(void *)mb_io_ptr->mb_io_extract);
-		fprintf(stderr,"dbg2       insert:             %p\n",(void *)mb_io_ptr->mb_io_insert);
-		fprintf(stderr,"dbg2       extract_nav:        %p\n",(void *)mb_io_ptr->mb_io_extract_nav);
-		fprintf(stderr,"dbg2       insert_nav:         %p\n",(void *)mb_io_ptr->mb_io_insert_nav);
-		fprintf(stderr,"dbg2       extract_altitude:   %p\n",(void *)mb_io_ptr->mb_io_extract_altitude);
-		fprintf(stderr,"dbg2       insert_altitude:    %p\n",(void *)mb_io_ptr->mb_io_insert_altitude);
-		fprintf(stderr,"dbg2       extract_svp:        %p\n",(void *)mb_io_ptr->mb_io_extract_svp);
-		fprintf(stderr,"dbg2       insert_svp:         %p\n",(void *)mb_io_ptr->mb_io_insert_svp);
-		fprintf(stderr,"dbg2       ttimes:             %p\n",(void *)mb_io_ptr->mb_io_ttimes);
-		fprintf(stderr,"dbg2       detects:            %p\n",(void *)mb_io_ptr->mb_io_detects);
-		fprintf(stderr,"dbg2       extract_rawss:      %p\n",(void *)mb_io_ptr->mb_io_extract_rawss);
-		fprintf(stderr,"dbg2       insert_rawss:       %p\n",(void *)mb_io_ptr->mb_io_insert_rawss);
-		fprintf(stderr,"dbg2       copyrecord:         %p\n",(void *)mb_io_ptr->mb_io_copyrecord);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbr_info_imagemba(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error)
-{
-	char	*function_name = "mbr_info_imagemba";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* set format info parameters */
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-	*system = MB_SYS_IMAGE83P;
-	*beams_bath_max = 480;
-	*beams_amp_max = 0;
-	*pixels_ss_max = 0;
-	strncpy(format_name, "IMAGEMBA", MB_NAME_LENGTH);
-	strncpy(system_name, "IMAGEMBA", MB_NAME_LENGTH);
-	strncpy(format_description, "Format name:          MBF_IMAGEMBA\nInformal Description: MBARI DeltaT Multibeam\nAttributes:           Multibeam, bathymetry, 480 beams, ascii + binary, MBARI.\n", MB_DESCRIPTION_LENGTH);
-	*numfile = 1;
-	*filetype = MB_FILETYPE_NORMAL;
-	*variable_beams = MB_NO;
-	*traveltime = MB_NO;
-	*beam_flagging = MB_YES;
-	*nav_source = MB_DATA_DATA;
-	*heading_source = MB_DATA_DATA;
-	*vru_source = MB_DATA_NONE;
-	*svp_source = MB_DATA_NONE;
-	*beamwidth_xtrack = 0.75;
-	*beamwidth_ltrack = 0.75;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",*system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",*beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",*beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",*pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",*numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",*filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",*variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",*traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",*beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",*nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",*heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",*vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",*svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",*beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",*beamwidth_ltrack);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_alm_imagemba(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_alm_imagemba";
-	int	status;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set initial status */
-	status = MB_SUCCESS;
-
-	/* allocate memory for data structure */
-	status = mb_malloc(verbose,sizeof(struct mbsys_image83p_struct),
-				&mb_io_ptr->store_data,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_dem_imagemba(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_dem_imagemba";
-	int	status;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* deallocate memory for data descriptor */
-	status = mb_free(verbose,&mb_io_ptr->store_data,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_rt_imagemba(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_rt_imagemba";
-	int	status;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_image83p_struct *store;
-	char	buffer[MBF_IMAGEMBA_BUFFER_SIZE];
-	int	done;
-	int	index;
-	int	swap = MB_NO;
-	short	short_val;
-	int	int_val;
-	int	numberbytes, seconds_hundredths;
-	double	degrees, minutes, dec_minutes;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_image83p_struct *) store_ptr;
-
-	/* set file position */
-	mb_io_ptr->file_pos = mb_io_ptr->file_bytes;
-
-	/* read next record header from file */
-	done = MB_NO;
-	for(i = 0; i < MBF_IMAGEMBA_BUFFER_SIZE; i ++)
-		buffer[i] = 0;
-	if ((status = fread(buffer,1,6,mb_io_ptr->mbfp)) == 6)
-		{
-		/* check for valid header */
-		if (strncmp(buffer,"83P",3) == 0)
-			{
-			done = MB_YES;
-			status = MB_SUCCESS;
-			*error = MB_ERROR_NO_ERROR;
-			}
-		else
-			{
-			/* loop over reading bytes until valid header is found */
-			while (done == MB_NO)
-				{
-				for (i=0;i<5;i++)
-					buffer[i] = buffer[i+1];
-				status = fread(&buffer[5],1,1,mb_io_ptr->mbfp);
-				if (status != 1)
-					{
-					mb_io_ptr->file_bytes += status;
-					status = MB_FAILURE;
-					*error = MB_ERROR_EOF;
-					done = MB_YES;
-					}
-				else if (strncmp(buffer,"83P",3) == 0)
-					{
-					done = MB_YES;
-					}
-				}
-			}
-		}
-	else
-		{
-		mb_io_ptr->file_bytes += status;
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	/* read rest of record from file */
-	if (status == MB_SUCCESS)
-		{
-		index = 3;
-		store->version = (int) buffer[index]; index++;
-
-		mb_get_binary_short(swap, &buffer[index], &short_val);
-		numberbytes = (int) ((unsigned short) short_val);
-
-		if ((status = fread(&buffer[6],1,numberbytes-6,mb_io_ptr->mbfp)) != numberbytes-6)
-			{
-			mb_io_ptr->file_bytes += status;
-			status = MB_FAILURE;
-			*error = MB_ERROR_EOF;
-			store->kind = MB_DATA_NONE;
-			}
-		else
-			{
-			status = MB_SUCCESS;
-			mb_io_ptr->file_bytes += status;
-			}
-		}
-
-	/* if success then parse the buffer */
-	if (status == MB_SUCCESS && buffer[6] =='#')
-		{
-		/* type of data record */
-		store->kind = MB_DATA_COMMENT;
-
-		/* copy comment */
-		index = 8;
-		strncpy(store->comment, &buffer[index], MBSYS_IMAGE83P_COMMENTLEN);
-		}
-
-	/* if success then parse the buffer */
-	else if (status == MB_SUCCESS)
-		{
-		/* type of data record */
-		store->kind = MB_DATA_DATA;
-
-		/* parse year */
-		index = 8;
-		mb_get_int(&store->time_i[0], &buffer[index + 7], 4);
-
-		/* parse month */
-		if(buffer[index + 3] == 'J')
-			{
-			if(buffer[index + 4] == 'A')
-				{
-				store->time_i[1] = 1;
-				}
-			else if(buffer[index + 5] == 'N')
-				{
-				store->time_i[1] = 6;
-				}
-			else
-				{
-				store->time_i[1] = 7;
-				}
-			}
-		else if(buffer[index + 3] == 'F')
-			{
-			store->time_i[1] = 2;
-			}
-		else if(buffer[index + 3] == 'M')
-			{
-			if(buffer[index + 5] == 'R')
-				{
-				store->time_i[1] = 3;
-				}
-			else
-				{
-				store->time_i[1] = 5;
-				}
-			}
-		else if(buffer[index + 3] == 'A')
-			{
-			if(buffer[index + 4] == 'P')
-				{
-				store->time_i[1] = 4;
-				}
-			else
-				{
-				store->time_i[1] = 8;
-				}
-			}
-		else if(buffer[index + 3] == 'S')
-			{
-			store->time_i[1] = 9;
-			}
-		else if(buffer[index + 3] == 'O')
-			{
-			store->time_i[1] = 10;
-			}
-		else if(buffer[index + 3] == 'N')
-			{
-			store->time_i[1] = 11;
-			}
-		else if(buffer[index + 3] == 'D')
-			{
-			store->time_i[1] = 12;
-			}
-
-		mb_get_int(&store->time_i[2], &buffer[index + 0], 2);
-		index +=12; /*to time*/
-
-		/* parse time */
-		mb_get_int(&store->time_i[3], &buffer[index], 2);
-		mb_get_int(&store->time_i[4], &buffer[index+3], 2);
-		mb_get_int(&store->time_i[5], &buffer[index+6], 2);
-		mb_get_int(&seconds_hundredths, &buffer[index+10], 2);
-		store->time_i[6] = 10000 * seconds_hundredths;
-		mb_get_time(verbose,store->time_i,&store->time_d);
-		for (i=0;i<7;i++)
-			{
-			mb_io_ptr->new_time_i[i] = store->time_i[i];
-
-			}
-		mb_io_ptr->new_time_d = store->time_d;
-		index += 13; /*to navigation latitude*/
-
-		/* parse gps navigation string latitude */
-		mb_get_double(&degrees, &buffer[index + 1], 2);
-		mb_get_double(&minutes, &buffer[index + 4], 2);
-		mb_get_double(&dec_minutes, &buffer[index + 7], 5);
-
-
-		store->nav_lat = degrees + (((dec_minutes / 100000) + minutes) / 60);
-		if(buffer[index + 13] == 'S' || buffer[index + 13] == 's')
-			{
-			store->nav_lat = -store->nav_lat;
-			}
-		index += 14; /*to navigation longtitude*/
-
-		/* parse gps navigation string longtitude */
-		mb_get_double(&degrees, &buffer[index], 3);
-		mb_get_double(&minutes, &buffer[index + 4], 2);
-		mb_get_double(&dec_minutes, &buffer[index + 7], 5);
-		store->nav_long = degrees + (((dec_minutes / 100000) + minutes) / 60);
-		if(buffer[index + 13] == 'W' || buffer[index + 13] == 'w')
-			{
-			store->nav_long = -store->nav_long;
-			}
-		index += 14;
-
-		/* parse gps speed and heading */
-		store->nav_speed = (int) ((mb_u_char)buffer[index]); index += 1;
-		mb_get_binary_short(swap, &buffer[index], &short_val); index += 2;
-		    store->nav_heading = (int) ((unsigned short) short_val);
-
-		/* parse dvl attitude and heading */
-/*		if (buffer[index] >> 7)
-			{
-			store->pitch = ((((mb_u_char)buffer[index]) & 0x7F) << 8) + ((mb_u_char)buffer[index+1]);
-			}
-		else
-			{
-			store->pitch = 0;
-			}*/
-		store->pitch = ((((mb_u_char)buffer[index]) & 0x7F) << 8) + ((mb_u_char)buffer[index+1]);
-		index += 2;
-/*		if (buffer[index] >> 7)
-			{
-			store->roll = ((((mb_u_char)buffer[index]) & 0x7F) << 8) + ((mb_u_char)buffer[index+1]);
-			}
-		else
-			{
-			store->roll = 0;
-			}*/
-		store->roll = ((((mb_u_char)buffer[index]) & 0x7F) << 8) + ((mb_u_char)buffer[index+1]);
-		index += 2;
-/*		if (buffer[index] >> 7)
-			{
-			store->heading = ((((mb_u_char)buffer[index]) & 0x7F) << 8) + ((mb_u_char)buffer[index+1]);
-			}
-		else
-			{
-			store->heading = 0;
-			}*/
-		store->heading = ((((mb_u_char)buffer[index]) & 0x7F) << 8) + ((mb_u_char)buffer[index+1]);
-		index += 2;
-
-		/* parse beam info */
-		mb_get_binary_short(swap, &buffer[index], &short_val); index += 2;
-		    store->num_beams = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &buffer[index], &short_val); index += 2;
-		    store->samples_per_beam = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &buffer[index], &short_val); index += 2;
-		    store->sector_size = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &buffer[index], &short_val); index += 2;
-		    store->start_angle = (int) ((unsigned short) short_val);
-		store->angle_increment = (int) ((mb_u_char)buffer[index]); index += 1;
-		mb_get_binary_short(swap, &buffer[index], &short_val); index += 2;
-		    store->acoustic_range = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &buffer[index], &short_val); index += 2;
-		    store->acoustic_frequency = (int) ((unsigned short) short_val);
-		if (buffer[index] >> 7)
-			{
-			store->sound_velocity = ((((mb_u_char)buffer[index]) & 0x7F) << 8) + ((mb_u_char)buffer[index+1]);
-			}
-		else
-			{
-			store->sound_velocity = 15000;
-			}
-		index += 2;
-
-		mb_get_binary_short(swap, &buffer[index], &short_val); index += 2;
-		    store->range_resolution = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &buffer[index], &short_val); index += 2;
-		    store->pulse_length = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &buffer[index], &short_val); index += 2;
-		    store->profile_tilt_angle = (int) ((unsigned short) short_val);
-		mb_get_binary_short(swap, &buffer[index], &short_val); index += 2;
-		    store->rep_rate = (int) ((unsigned short) short_val);
-		mb_get_binary_int(swap, &buffer[index], &int_val); index += 4;
-		    store->ping_number = int_val;
-		index += 151;
-
-		/* get sonar_depth and heave */
-		mb_get_binary_float(swap, &buffer[index], &(store->sonar_depth)); index += 4;
-		mb_get_binary_float(swap, &buffer[index], &(store->heave)); index += 4;
-
-		/* get beams */
-		store->num_proc_beams = store->num_beams;
-		for (i=0;i<store->num_beams;i++)
-			{
-			mb_get_binary_short(swap, &buffer[index], &short_val); index += 2;
-		    	store->range[i] = (int) ((unsigned short) short_val);
-			mb_get_binary_float(swap, &buffer[index], &(store->bath[i])); index += 4;
-			mb_get_binary_float(swap, &buffer[index], &(store->bathacrosstrack[i])); index += 4;
-			mb_get_binary_float(swap, &buffer[index], &(store->bathalongtrack[i])); index += 4;
-			store->beamflag[i] = buffer[index]; index++;
-			}
-		}
-	mb_io_ptr->new_kind = store->kind;
-	mb_io_ptr->new_error = *error;
-
-	/* print output debug statements */
-	if (verbose >= 4)
-		{
-		fprintf(stderr,"\ndbg2  Record read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg4  Data values:\n");
-		fprintf(stderr,"dbg4       kind:               %d\n",store->kind);
-		fprintf(stderr,"dbg4       version:            %d\n",store->version);
-		fprintf(stderr,"dbg4       time_i[0]:          %d\n",store->time_i[0]);
-		fprintf(stderr,"dbg4       time_i[1]:          %d\n",store->time_i[1]);
-		fprintf(stderr,"dbg4       time_i[2]:          %d\n",store->time_i[2]);
-		fprintf(stderr,"dbg4       time_i[3]:          %d\n",store->time_i[3]);
-		fprintf(stderr,"dbg4       time_i[4]:          %d\n",store->time_i[4]);
-		fprintf(stderr,"dbg4       time_i[5]:          %d\n",store->time_i[5]);
-		fprintf(stderr,"dbg4       time_i[6]:          %d\n",store->time_i[6]);
-		fprintf(stderr,"dbg4       time_d:             %f\n",store->time_d);
-		fprintf(stderr,"dbg4       nav_lat:            %f\n",store->nav_lat);
-		fprintf(stderr,"dbg4       nav_long:           %f\n",store->nav_long);
-		fprintf(stderr,"dbg4       nav_speed:          %d\n",store->nav_speed); /* 0.1 knots */
-		fprintf(stderr,"dbg4       nav_heading:        %d\n",store->nav_heading); /*0.1 degrees */
-		fprintf(stderr,"dbg4       pitch:              %d\n",store->pitch);
-		fprintf(stderr,"dbg4       roll:               %d\n",store->roll);
-		fprintf(stderr,"dbg4       heading:            %d\n",store->heading);
-		fprintf(stderr,"dbg4       num_beams:          %d\n",store->num_beams);
-		fprintf(stderr,"dbg4       samples_per_beam:   %d\n",store->samples_per_beam);
-		fprintf(stderr,"dbg4       sector_size:        %d\n",store->sector_size); /* degrees */
-		fprintf(stderr,"dbg4       start_angle:        %d\n",store->start_angle); /* 0.01 degrees + 180.0 */
-		fprintf(stderr,"dbg4       angle_increment:    %d\n",store->angle_increment); /* 0.01 degrees */
-		fprintf(stderr,"dbg4       acoustic_range:     %d\n",store->acoustic_range); /* meters */
-		fprintf(stderr,"dbg4       acoustic_frequency: %d\n",store->acoustic_frequency); /* kHz */
-		fprintf(stderr,"dbg4       sound_velocity:     %d\n",store->sound_velocity); /* 0.1 m/sec */
-		fprintf(stderr,"dbg4       range_resolution:   %d\n",store->range_resolution); /* 0.001 meters */
-		fprintf(stderr,"dbg4       pulse_length:       %d\n",store->pulse_length); /* usec */
-		fprintf(stderr,"dbg4       profile_tilt_angle: %d\n",store->profile_tilt_angle); /* degrees + 180.0 */
-		fprintf(stderr,"dbg4       rep_rate:           %d\n",store->rep_rate); /* msec */
-		fprintf(stderr,"dbg4       ping_number:        %d\n",store->ping_number);
-		for (i=0;i<store->num_beams;i++)
-			fprintf(stderr,"dbg4       range[%d]:            %d\n",i,store->range[i]);
-		fprintf(stderr,"dbg4       sonar_depth:        %f\n",store->sonar_depth);
-		fprintf(stderr,"dbg4       heave:              %f\n",store->heave);
-		fprintf(stderr,"dbg4       num_proc_beams:     %d\n",store->num_proc_beams);
-		for (i=0;i<store->num_proc_beams;i++)
-			fprintf(stderr,"dbg4       tt[%d]: %f angles:%f %f   bath: %f %f %f %d\n",
-				i,store->beamrange[i],store->angles[i],store->angles_forward[i],
-				store->bath[i],store->bathacrosstrack[i],
-				store->bathalongtrack[i],store->beamflag[i]);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_wt_imagemba(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_wt_imagemba";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_image83p_struct *store;
-	char	buffer[MBF_IMAGEMBA_BUFFER_SIZE];
-	int	swap = MB_NO;
-	int	seconds_hundredths;
-	int	degrees;
-	double	minutes;
-	char	NorS;
-	int	write_len, index;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_image83p_struct *) store_ptr;
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Status at beginning of MBIO function <%s>\n",function_name);
-		if (store != NULL)
-			fprintf(stderr,"dbg5       store->kind:    %d\n",
-				store->kind);
-		fprintf(stderr,"dbg5       new_kind:       %d\n",
-			mb_io_ptr->new_kind);
-		fprintf(stderr,"dbg5       new_error:      %d\n",
-			mb_io_ptr->new_error);
-		fprintf(stderr,"dbg5       error:          %d\n",*error);
-		fprintf(stderr,"dbg5       status:         %d\n",status);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 4)
-		{
-		fprintf(stderr,"\ndbg2  Record read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg4  Data values:\n");
-		fprintf(stderr,"dbg4       kind:               %d\n",store->kind);
-		fprintf(stderr,"dbg4       version:            %d\n",store->version);
-		fprintf(stderr,"dbg4       time_i[0]:          %d\n",store->time_i[0]);
-		fprintf(stderr,"dbg4       time_i[1]:          %d\n",store->time_i[1]);
-		fprintf(stderr,"dbg4       time_i[2]:          %d\n",store->time_i[2]);
-		fprintf(stderr,"dbg4       time_i[3]:          %d\n",store->time_i[3]);
-		fprintf(stderr,"dbg4       time_i[4]:          %d\n",store->time_i[4]);
-		fprintf(stderr,"dbg4       time_i[5]:          %d\n",store->time_i[5]);
-		fprintf(stderr,"dbg4       time_i[6]:          %d\n",store->time_i[6]);
-		fprintf(stderr,"dbg4       time_d:             %f\n",store->time_d);
-		fprintf(stderr,"dbg4       nav_lat:            %f\n",store->nav_lat);
-		fprintf(stderr,"dbg4       nav_long:           %f\n",store->nav_long);
-		fprintf(stderr,"dbg4       nav_speed:          %d\n",store->nav_speed); /* 0.1 knots */
-		fprintf(stderr,"dbg4       nav_heading:        %d\n",store->nav_heading); /*0.1 degrees */
-		fprintf(stderr,"dbg4       pitch:              %d\n",store->pitch);
-		fprintf(stderr,"dbg4       roll:               %d\n",store->roll);
-		fprintf(stderr,"dbg4       heading:            %d\n",store->heading);
-		fprintf(stderr,"dbg4       num_beams:          %d\n",store->num_beams);
-		fprintf(stderr,"dbg4       samples_per_beam:   %d\n",store->samples_per_beam);
-		fprintf(stderr,"dbg4       sector_size:        %d\n",store->sector_size); /* degrees */
-		fprintf(stderr,"dbg4       start_angle:        %d\n",store->start_angle); /* 0.01 degrees + 180.0 */
-		fprintf(stderr,"dbg4       angle_increment:    %d\n",store->angle_increment); /* 0.01 degrees */
-		fprintf(stderr,"dbg4       acoustic_range:     %d\n",store->acoustic_range); /* meters */
-		fprintf(stderr,"dbg4       acoustic_frequency: %d\n",store->acoustic_frequency); /* kHz */
-		fprintf(stderr,"dbg4       sound_velocity:     %d\n",store->sound_velocity); /* 0.1 m/sec */
-		fprintf(stderr,"dbg4       range_resolution:   %d\n",store->range_resolution); /* 0.001 meters */
-		fprintf(stderr,"dbg4       pulse_length:       %d\n",store->pulse_length); /* usec */
-		fprintf(stderr,"dbg4       profile_tilt_angle: %d\n",store->profile_tilt_angle); /* degrees + 180.0 */
-		fprintf(stderr,"dbg4       rep_rate:           %d\n",store->rep_rate); /* msec */
-		fprintf(stderr,"dbg4       ping_number:        %d\n",store->ping_number);
-		for (i=0;i<store->num_beams;i++)
-			fprintf(stderr,"dbg4       range[%d]:            %d\n",i,store->range[i]);
-		fprintf(stderr,"dbg4       sonar_depth:        %f\n",store->sonar_depth);
-		fprintf(stderr,"dbg4       heave:              %f\n",store->heave);
-		fprintf(stderr,"dbg4       num_proc_beams:     %d\n",store->num_proc_beams);
-		for (i=0;i<store->num_proc_beams;i++)
-			fprintf(stderr,"dbg4       tt[%d]: %f angles:%f %f   bath: %f %f %f %d\n",
-				i,store->beamrange[i],store->angles[i],store->angles_forward[i],
-				store->bath[i],store->bathacrosstrack[i],
-				store->bathalongtrack[i],store->beamflag[i]);
-		}
-
-	/*  translate values from imagemba data storage structure */
-	if (store != NULL)
-		{
-		if (store->kind == MB_DATA_DATA)
-			{
-			/* header */
-			index = 0;
-			buffer[index] = '8'; index++;
-			buffer[index] = '3'; index++;
-			buffer[index] = 'P'; index++;
-			buffer[index] = (char) store->version; index++;
-			write_len = 256 + MBF_IMAGEMBA_BEAM_SIZE * store->num_beams;
-			mb_put_binary_short(swap, (unsigned short)write_len, (void *) &buffer[index]); index +=2;
-			buffer[index] = 0; index++;
-			buffer[index] = 0; index++; /* index = 8 */
-
-			/* date */
-			sprintf(&buffer[index], "%2.2d-", store->time_i[2]); index += 3;
-			switch(store->time_i[1])
-				{
-				case (1)  : sprintf(&buffer[index], "%s", "JAN-");
-							break;
-				case (2)  : sprintf(&buffer[index], "%s", "FEB-");
-							break;
-				case (3)  : sprintf(&buffer[index], "%s", "MAR-");
-							break;
-				case (4)  : sprintf(&buffer[index], "%s", "APR-");
-							break;
-				case (5)  : sprintf(&buffer[index], "%s", "MAY-");
-							break;
-				case (6)  : sprintf(&buffer[index], "%s", "JUN-");
-							break;
-				case (7)  : sprintf(&buffer[index], "%s", "JUL-");
-							break;
-				case (8)  : sprintf(&buffer[index], "%s", "AUG-");
-							break;
-				case (9)  : sprintf(&buffer[index], "%s", "SEP-");
-							break;
-				case (10)  :sprintf(&buffer[index], "%s", "OCT-");
-							break;
-				case (11) : sprintf(&buffer[index], "%s", "NOV-");
-							break;
-				case (12) : sprintf(&buffer[index],"%s", "DEC-");
-							break;
-				}
-			index += 4;
-			sprintf(&buffer[index], "%4.4d", store->time_i[0]); index += 4;
-			buffer[index] = 0; index++; /* index = 20 */
-
-			/* time */
-			sprintf(&buffer[index], "%2.2d:%2.2d:%2.2d",
-				store->time_i[3], store->time_i[4], store->time_i[5]); index += 8;
-			buffer[index] = 0; index++; /* index = 29 */
-
-			/* hundredths of seconds */
-			seconds_hundredths = store->time_i[6] / 10000;
-			sprintf(&buffer[index], ".%2.2d", seconds_hundredths); index += 3;
-			buffer[index] = 0; index++; /* index = 33 */
-
-			/* latitude*/
-			if (store->nav_lat > 0.0)
-				NorS = 'N';
-			else
-				NorS = 'S';
-			degrees = (int) fabs(store->nav_lat);
-			minutes = (fabs(store->nav_lat) - (double)degrees) * 60.0;
-			sprintf(&buffer[index], "_%2.2d.%8.5f_%c", degrees, minutes, NorS); index += 14; /* index = 47 */
-
-			/* longitude*/
-			if (store->nav_long > 0.0)
-				NorS = 'E';
-			else
-				NorS = 'W';
-			degrees = (int) fabs(store->nav_long);
-			minutes = (fabs(store->nav_long) - (double)degrees) * 60.0;
-			sprintf(&buffer[index], "%3.3d.%8.5f_%c", degrees, minutes, NorS);
-			index += 14; /* index = 61 */
-
-			/* speed */
-			buffer[index] = store->nav_speed; index++; /* index = 62 */
-
-			/* heading*/
-			mb_put_binary_short(swap, (unsigned short)store->nav_heading, (void *) &buffer[index]);
-			index += 2; /* index = 64 */
-
-			/* pitch */
-			mb_put_binary_short(swap, (unsigned short)store->pitch, (void *)&buffer[index]);
-			if (store->pitch != 0)
-				buffer[index] = buffer[index] | 0x80;
-			index += 2; /* index = 66 */
-
-			/* roll */
-			mb_put_binary_short(swap, (unsigned short)store->roll, (void *)&buffer[index]);
-			if(store->roll != 0)
-				buffer[index] = buffer[index] | 0x80;
-			index += 2; /* index = 68 */
-
-			/* heading */
-			mb_put_binary_short(swap, (unsigned short)store->heading, (void *)&buffer[index]);
-			if(store->heading != 0)
-				buffer[index] = buffer[index] | 0x80;
-			index += 2; /* index = 70 */
-
-			/* beams */
-			mb_put_binary_short(swap, (unsigned short)store->num_beams, (void *)&buffer[index]);
-			index += 2; /* index = 72 */
-			mb_put_binary_short(swap, (unsigned short)store->samples_per_beam, (void *)&buffer[index]);
-			index += 2; /* index = 74 */
-			mb_put_binary_short(swap, (unsigned short)store->sector_size, (void *)&buffer[index]);
-			index += 2; /* index = 76 */
-			mb_put_binary_short(swap, (unsigned short)store->start_angle, (void *)&buffer[index]);
-			index += 2; /* index = 78 */
-			buffer[index] = store->angle_increment;
-			index+=1; /* index = 79 */
-			mb_put_binary_short(swap, (unsigned short)store->acoustic_range, (void *)&buffer[index]);
-			index += 2; /* index = 81 */
-			mb_put_binary_short(swap, (unsigned short)store->acoustic_frequency, (void *)&buffer[index]);
-			index += 2; /* index = 83 */
-			mb_put_binary_short(swap, (unsigned short)store->sound_velocity, (void *)&buffer[index]);
-			if(store->sound_velocity != 0)
-				buffer[index] = buffer[index] | 0x80;
-			index += 2; /* index = 85 */
-			mb_put_binary_short(swap, (unsigned short)store->range_resolution, (void *)&buffer[index]);
-			index += 2; /* index = 87 */
-			mb_put_binary_short(swap, (unsigned short)store->pulse_length, (void *)&buffer[index]);
-			index += 2; /* index = 89 */
-			mb_put_binary_short(swap, (unsigned short)store->profile_tilt_angle, (void *)&buffer[index]);
-			index += 2; /* index = 91 */
-			mb_put_binary_short(swap, (unsigned short)store->rep_rate, (void *)&buffer[index]);
-			index += 2; /* index = 93 */
-			mb_put_binary_int(swap, store->ping_number, (void *)&buffer[index]);
-			index += 4; /* index = 97 */
-
-			/* blank part of header */
-			for (i=index;i<248;i++)
-				buffer[i] = 0;
-			index += 151; /* index 248 */
-
-			/* put sonar_depth and heave */
-			mb_put_binary_float(swap, (float)store->sonar_depth, (void *)&buffer[index]);
-			index += 4; /* index = 252 */
-			mb_put_binary_float(swap, (float)store->heave, (void *)&buffer[index]);
-			index += 4; /* index = 256 */
-
-			/* put beams */
-			for (i=0;i<store->num_beams;i++)
-				{
-				mb_put_binary_short(swap, (unsigned short)store->range[i], &buffer[index]);  index += 2;
-				mb_put_binary_float(swap, store->bath[i], (void *)&buffer[index]); index +=4;
-				mb_put_binary_float(swap, store->bathacrosstrack[i], (void *)&buffer[index]); index +=4;
-				mb_put_binary_float(swap, store->bathalongtrack[i], (void *)&buffer[index]); index +=4;
-				buffer[index] = (char) store->beamflag[i]; index++;
-				}
-			}
-
-		else if (store->kind == MB_DATA_COMMENT)
-			{
-			/* header */
-			index = 0;
-			buffer[index] = '8'; index++;
-			buffer[index] = '3'; index++;
-			buffer[index] = 'P'; index++;
-			buffer[index] = (char) store->version; index++;
-			write_len = 256;
-			mb_put_binary_short(swap, (unsigned short)write_len, (void *) &buffer[index]); index +=2;
-			buffer[index] = '#'; index++;
-			buffer[index] = '#'; index++; /* index = 8 */
-
-			/* write comment */
-			strncpy(&buffer[index], store->comment, MBSYS_IMAGE83P_COMMENTLEN);
-			for (i=8+strlen(store->comment);i<8+MBSYS_IMAGE83P_COMMENTLEN;i++)
-					buffer[i] = 0;
-			}
-
-		/* write next record to file */
-		if (store->kind == MB_DATA_DATA
-			|| store->kind == MB_DATA_COMMENT)
-			{
-			if ((status = fwrite(buffer,1,write_len,
-				mb_io_ptr->mbfp))
-				== write_len)
-				{
-				status = MB_SUCCESS;
-				*error = MB_ERROR_NO_ERROR;
-				}
-			else
-				{
-				status = MB_FAILURE;
-				*error = MB_ERROR_WRITE_FAIL;
-				}
-
-			}
-		else
-			{
-			status = MB_SUCCESS;
-			*error = MB_ERROR_NO_ERROR;
-			if (verbose >= 5)
-				fprintf(stderr,"\ndbg5  No data written in MBIO function <%s>\n",function_name);
-			}
-		}
-
-	else
-		{
-		status = MB_SUCCESS;
-		*error = MB_ERROR_NO_ERROR;
-		if (verbose >= 5)
-			fprintf(stderr,"\ndbg5  No data written in MBIO function <%s>\n",function_name);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mbr_l3xseraw.c b/src/mbio/mbr_l3xseraw.c
deleted file mode 100644
index dd52831..0000000
--- a/src/mbio/mbr_l3xseraw.c
+++ /dev/null
@@ -1,7810 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbr_l3xseraw.c	3/27/2000
- *	$Id: mbr_l3xseraw.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 2000-2015 by
- *    D. W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and D. N. Chayes (dale at lamont.ldgo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY  10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbr_sb2102xs.c contains the functions for reading and writing
- * multibeam data in the L3XSERAW format.
- * These functions include:
- *   mbr_alm_l3xseraw	- allocate read/write memory
- *   mbr_dem_l3xseraw	- deallocate read/write memory
- *   mbr_rt_l3xseraw	- read and translate data
- *   mbr_wt_l3xseraw	- translate and write data
- *
- * Author:	D. W. Caress
- * Date:	March 27, 1999
- * Additional Authors:	P. A. Cohen and S. Dzurenko
- *
- * $Log: mbr_l3xseraw.c,v $
- * Revision 5.21  2008/07/10 06:43:40  caress
- * Preparing for 5.1.1beta20
- *
- * Revision 5.20  2007/07/03 17:28:08  caress
- * Fixes to XSE format.
- *
- * Revision 5.19  2007/06/18 01:19:48  caress
- * Changes as of 17 June 2007.
- *
- * Revision 5.18  2006/12/15 21:36:16  caress
- * Turned off debug mode.
- *
- * Revision 5.17  2006/09/11 18:55:52  caress
- * Changes during Western Flyer and Thomas Thompson cruises, August-September
- * 2006.
- *
- * Revision 5.16  2006/08/04 03:56:41  caress
- * Working towards 5.1.0 release.
- *
- * Revision 5.15  2006/01/06 18:27:19  caress
- * Working towards 5.0.8
- *
- * Revision 5.14  2005/11/05 00:48:04  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.13  2003/05/20 18:05:32  caress
- * Added svp_source to data source parameters.
- *
- * Revision 5.12  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.11  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.10  2001/12/30 20:32:12  caress
- * Fixed array overflows in handling XSE data.
- *
- * Revision 5.9  2001/12/20 20:48:51  caress
- * Release 5.0.beta11
- *
- * Revision 5.8  2001/10/23  02:34:12  caress
- * Added error checking for corrupted depth and heave values.
- *
- * Revision 5.7  2001/08/23  20:50:24  caress
- * Fixed problems with SB2120 data.
- *
- * Revision 5.6  2001/08/10  22:41:19  dcaress
- * Release 5.0.beta07
- *
- * Revision 5.5  2001-07-22 14:17:01-07  caress
- * Fixed bug that deallocated an unallocated array.
- *
- * Revision 5.4  2001/07/20 00:32:54  caress
- * Release 5.0.beta03
- *
- * Revision 5.3  2001/06/08  21:44:01  caress
- * Version 5.0.beta01
- *
- * Revision 5.2  2001/06/03  06:54:56  caress
- * Fixed support for xse format on byte swapped computers.
- *
- * Revision 5.1  2001/04/09  18:04:51  caress
- * Fixed bug related to nav handling.
- *
- * Revision 5.0  2001/04/05  18:33:25  caress
- * Initial version.
- * Consolidates two former i/o modules elmk2xse and sb2120xs.
- *
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mb_define.h"
-#include "mbsys_xse.h"
-
-/* include for byte swapping */
-#include "mb_swap.h"
-
-
-/* #define MB_DEBUG 1 */
-/* #define MB_DEBUG2 1 */
-
-/* set up byte swapping scenario */
-#ifdef DATAINPCBYTEORDER
-#define SWAPFLAG    MB_YES
-#else
-#define SWAPFLAG    MB_NO
-#endif
-
-/* essential function prototypes */
-int mbr_register_l3xseraw(int verbose, void *mbio_ptr,
-		int *error);
-int mbr_info_l3xseraw(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_alm_l3xseraw(int verbose, void *mbio_ptr, int *error);
-int mbr_dem_l3xseraw(int verbose, void *mbio_ptr, int *error);
-int mbr_rt_l3xseraw(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_wt_l3xseraw(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_l3xseraw_rd_data(int verbose,void *mbio_ptr,void *store_ptr,int *error);
-int mbr_l3xseraw_rd_nav(int verbose,int buffer_size,char *buffer,void *store_ptr,int *error);
-int mbr_l3xseraw_rd_svp(int verbose,int buffer_size,char *buffer,void *store_ptr,int *error);
-int mbr_l3xseraw_rd_tide(int verbose,int buffer_size,char *buffer,void *store_ptr,int *error);
-int mbr_l3xseraw_rd_ship(int verbose,int buffer_size,char *buffer,void *store_ptr,int *error);
-int mbr_l3xseraw_rd_sidescan(int verbose,int buffer_size,char *buffer,void *store_ptr,int *error);
-int mbr_l3xseraw_rd_multibeam(int verbose,int buffer_size,char *buffer,void *store_ptr,int *error);
-int mbr_l3xseraw_rd_singlebeam(int verbose,int buffer_size,char *buffer,void *store_ptr,int *error);
-int mbr_l3xseraw_rd_message(int verbose,int buffer_size,char *buffer,void *store_ptr,int *error);
-int mbr_l3xseraw_rd_seabeam(int verbose,int buffer_size,char *buffer,void *store_ptr,int *error);
-int mbr_l3xseraw_rd_geodetic(int verbose,int buffer_size,char *buffer,void *store_ptr,int *error);
-int mbr_l3xseraw_rd_native(int verbose,int buffer_size,char *buffer,void *store_ptr,int *error);
-int mbr_l3xseraw_rd_product(int verbose,int buffer_size,char *buffer,void *store_ptr,int *error);
-int mbr_l3xseraw_rd_bathymetry(int verbose,int buffer_size,char *buffer,void *store_ptr,int *error);
-int mbr_l3xseraw_rd_control(int verbose,int buffer_size,char *buffer,void *store_ptr,int *error);
-int mbr_l3xseraw_rd_comment(int verbose,int buffer_size,char *buffer,void *store_ptr,int *error);
-int mbr_l3xseraw_wr_data(int verbose,void *mbio_ptr,void *store_ptr,int *error);
-int mbr_l3xseraw_wr_nav(int verbose,int *buffer_size,char *buffer,void *store_ptr,int *error);
-int mbr_l3xseraw_wr_svp(int verbose,int *buffer_size,char *buffer,void *store_ptr,int *error);
-int mbr_l3xseraw_wr_ship(int verbose,int *buffer_size,char *buffer,void *store_ptr,int *error);
-int mbr_l3xseraw_wr_multibeam(int verbose,int *buffer_size,char *buffer,void *store_ptr,int *error);
-int mbr_l3xseraw_wr_sidescan(int verbose,int *buffer_size,char *buffer,void *store_ptr,int *error);
-int mbr_l3xseraw_wr_seabeam(int verbose,int *buffer_size,char *buffer,void *store_ptr,int *error);
-int mbr_l3xseraw_wr_comment(int verbose,int *buffer_size,char *buffer,void *store_ptr,int *error);
-
-static char rcs_id[]="$Id: mbr_l3xseraw.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mbr_register_l3xseraw(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_register_l3xseraw";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* get mb_io_ptr */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set format info parameters */
-	status = mbr_info_l3xseraw(verbose,
-			&mb_io_ptr->system,
-			&mb_io_ptr->beams_bath_max,
-			&mb_io_ptr->beams_amp_max,
-			&mb_io_ptr->pixels_ss_max,
-			mb_io_ptr->format_name,
-			mb_io_ptr->system_name,
-			mb_io_ptr->format_description,
-			&mb_io_ptr->numfile,
-			&mb_io_ptr->filetype,
-			&mb_io_ptr->variable_beams,
-			&mb_io_ptr->traveltime,
-			&mb_io_ptr->beam_flagging,
-			&mb_io_ptr->nav_source,
-			&mb_io_ptr->heading_source,
-			&mb_io_ptr->vru_source,
-			&mb_io_ptr->svp_source,
-			&mb_io_ptr->beamwidth_xtrack,
-			&mb_io_ptr->beamwidth_ltrack,
-			error);
-
-	/* set format and system specific function pointers */
-	mb_io_ptr->mb_io_format_alloc = &mbr_alm_l3xseraw;
-	mb_io_ptr->mb_io_format_free = &mbr_dem_l3xseraw;
-	mb_io_ptr->mb_io_store_alloc = &mbsys_xse_alloc;
-	mb_io_ptr->mb_io_store_free = &mbsys_xse_deall;
-	mb_io_ptr->mb_io_read_ping = &mbr_rt_l3xseraw;
-	mb_io_ptr->mb_io_write_ping = &mbr_wt_l3xseraw;
-	mb_io_ptr->mb_io_dimensions = &mbsys_xse_dimensions;
-	mb_io_ptr->mb_io_extract = &mbsys_xse_extract;
-	mb_io_ptr->mb_io_insert = &mbsys_xse_insert;
-	mb_io_ptr->mb_io_extract_nav = &mbsys_xse_extract_nav;
-	mb_io_ptr->mb_io_insert_nav = &mbsys_xse_insert_nav;
-	mb_io_ptr->mb_io_extract_altitude = &mbsys_xse_extract_altitude;
-	mb_io_ptr->mb_io_insert_altitude = NULL;
-	mb_io_ptr->mb_io_extract_svp = &mbsys_xse_extract_svp;
-	mb_io_ptr->mb_io_insert_svp = &mbsys_xse_insert_svp;
-	mb_io_ptr->mb_io_ttimes = &mbsys_xse_ttimes;
-	mb_io_ptr->mb_io_detects = &mbsys_xse_detects;
-	mb_io_ptr->mb_io_copyrecord = &mbsys_xse_copy;
-	mb_io_ptr->mb_io_extract_rawss = NULL;
-	mb_io_ptr->mb_io_insert_rawss = NULL;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",mb_io_ptr->system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",mb_io_ptr->beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",mb_io_ptr->beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",mb_io_ptr->pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",mb_io_ptr->format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",mb_io_ptr->system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",mb_io_ptr->format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",mb_io_ptr->numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",mb_io_ptr->filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",mb_io_ptr->variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",mb_io_ptr->traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",mb_io_ptr->beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",mb_io_ptr->nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",mb_io_ptr->heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",mb_io_ptr->vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",mb_io_ptr->svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",mb_io_ptr->beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",mb_io_ptr->beamwidth_ltrack);
-		fprintf(stderr,"dbg2       format_alloc:       %p\n",(void *)mb_io_ptr->mb_io_format_alloc);
-		fprintf(stderr,"dbg2       format_free:        %p\n",(void *)mb_io_ptr->mb_io_format_free);
-		fprintf(stderr,"dbg2       store_alloc:        %p\n",(void *)mb_io_ptr->mb_io_store_alloc);
-		fprintf(stderr,"dbg2       store_free:         %p\n",(void *)mb_io_ptr->mb_io_store_free);
-		fprintf(stderr,"dbg2       read_ping:          %p\n",(void *)mb_io_ptr->mb_io_read_ping);
-		fprintf(stderr,"dbg2       write_ping:         %p\n",(void *)mb_io_ptr->mb_io_write_ping);
-		fprintf(stderr,"dbg2       extract:            %p\n",(void *)mb_io_ptr->mb_io_extract);
-		fprintf(stderr,"dbg2       insert:             %p\n",(void *)mb_io_ptr->mb_io_insert);
-		fprintf(stderr,"dbg2       extract_nav:        %p\n",(void *)mb_io_ptr->mb_io_extract_nav);
-		fprintf(stderr,"dbg2       insert_nav:         %p\n",(void *)mb_io_ptr->mb_io_insert_nav);
-		fprintf(stderr,"dbg2       extract_altitude:   %p\n",(void *)mb_io_ptr->mb_io_extract_altitude);
-		fprintf(stderr,"dbg2       insert_altitude:    %p\n",(void *)mb_io_ptr->mb_io_insert_altitude);
-		fprintf(stderr,"dbg2       extract_svp:        %p\n",(void *)mb_io_ptr->mb_io_extract_svp);
-		fprintf(stderr,"dbg2       insert_svp:         %p\n",(void *)mb_io_ptr->mb_io_insert_svp);
-		fprintf(stderr,"dbg2       ttimes:             %p\n",(void *)mb_io_ptr->mb_io_ttimes);
-		fprintf(stderr,"dbg2       detects:            %p\n",(void *)mb_io_ptr->mb_io_detects);
-		fprintf(stderr,"dbg2       extract_rawss:      %p\n",(void *)mb_io_ptr->mb_io_extract_rawss);
-		fprintf(stderr,"dbg2       insert_rawss:       %p\n",(void *)mb_io_ptr->mb_io_insert_rawss);
-		fprintf(stderr,"dbg2       copyrecord:         %p\n",(void *)mb_io_ptr->mb_io_copyrecord);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbr_info_l3xseraw(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error)
-{
-	char	*function_name = "mbr_info_l3xseraw";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* set format info parameters */
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-	*system = MB_SYS_XSE;
-	*beams_bath_max = 151;
-	*beams_amp_max = 151;
-	*pixels_ss_max = 2000;
-	strncpy(format_name, "L3XSERAW", MB_NAME_LENGTH);
-	strncpy(system_name, "XSE", MB_NAME_LENGTH);
-	strncpy(format_description, "Format name:          MBF_L3XSERAW\nInformal Description: ELAC/SeaBeam XSE vendor format\nAttributes:           Bottomchart MkII 50 kHz and 180 kHz multibeam, \n                      SeaBeam 2120 20 KHz multibeam,\n                      bathymetry, amplitude and sidescan,\n                      variable beams and pixels, binary, \n                      L3 Communications (Elac Nautik \n                      and SeaBeam Instruments).\n", MB_DESCRIPTION_LENGTH);
-	*numfile = 1;
-	*filetype = MB_FILETYPE_NORMAL;
-	*variable_beams = MB_YES;
-	*traveltime = MB_YES;
-	*beam_flagging = MB_YES;
-	*nav_source = MB_DATA_DATA;
-	*heading_source = MB_DATA_DATA;
-	*vru_source = MB_DATA_DATA;
-	*svp_source = MB_DATA_VELOCITY_PROFILE;
-	*beamwidth_xtrack = 2.0;
-	*beamwidth_ltrack = 2.0;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",*system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",*beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",*beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",*pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",*numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",*filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",*variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",*traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",*beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",*nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",*heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",*vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",*svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",*beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",*beamwidth_ltrack);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_alm_l3xseraw(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_alm_l3xseraw";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set initial status */
-	status = MB_SUCCESS;
-
-	/* allocate memory for data structure */
-	status = mb_mallocd(verbose,__FILE__,__LINE__,MBSYS_XSE_BUFFER_SIZE,
-				(void **)&mb_io_ptr->hdr_comment,error);
-	mbsys_xse_alloc(verbose,mbio_ptr,
-				&mb_io_ptr->store_data,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_dem_l3xseraw(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_dem_l3xseraw";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointers to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* deallocate memory for data descriptor */
-	status = mb_freed(verbose,__FILE__, __LINE__, (void **)&mb_io_ptr->store_data,error);
-	status = mb_freed(verbose,__FILE__, __LINE__, (void **)&mb_io_ptr->hdr_comment,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_rt_l3xseraw(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_rt_l3xseraw";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_xse_struct *store;
-	double	time_d;
-	double	lon, lat;
-	double	heading;
-	double	speed;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointers to mbio descriptor and data structures */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-	store = (struct mbsys_xse_struct *) store_ptr;
-
-	/* read next data from file */
-	status = mbr_l3xseraw_rd_data(verbose,mbio_ptr,store_ptr,error);
-
-/*fprintf(stderr, "read kind:%d\n", store->kind);
-fprintf(stderr, "store->mul_frame:%d store->sid_frame:%d\n\n",
-store->mul_frame, store->sid_frame);*/
-
-	/* set error and kind in mb_io_ptr */
-	mb_io_ptr->new_error = *error;
-	mb_io_ptr->new_kind = store->kind;
-
-	/* save fix if nav data */
-	if (status == MB_SUCCESS
-		&& store->kind == MB_DATA_NAV)
-		{
-		/* get time */
-		time_d = store->nav_sec
-			    - MBSYS_XSE_TIME_OFFSET
-			    + 0.000001 * store->nav_usec;
-
-		/* add nav to navlist */
-		if (store->nav_group_position == MB_YES)
-			mb_navint_add(verbose, mbio_ptr, time_d,
-				RTD * store->nav_x,
-				RTD * store->nav_y, error);
-
-		/* add heading to navlist */
-		if (store->nav_group_heading == MB_YES)
-			mb_hedint_add(verbose, mbio_ptr, time_d,
-				RTD * store->nav_hdg_heading, error);
-		else if (store->nav_group_motiongt == MB_YES)
-			mb_hedint_add(verbose, mbio_ptr, time_d,
-				RTD * store->nav_course_ground, error);
-		else if (store->nav_group_motiontw == MB_YES)
-			mb_hedint_add(verbose, mbio_ptr, time_d,
-				RTD * store->nav_course_water, error);
-		}
-
-	/* interpolate navigation for survey pings if needed */
-	if (status == MB_SUCCESS
-		&& store->kind == MB_DATA_DATA
-		&& store->mul_group_mbsystemnav == MB_NO)
-		{
-		/* get timestamp */
-		time_d = store->mul_sec
-			    - MBSYS_XSE_TIME_OFFSET
-			    + 0.000001 * store->mul_usec;
-
-		/* interpolate heading */
-		mb_hedint_interp(verbose, mbio_ptr, time_d,
-				 &heading, error);
-
-		/* get speed if possible */
-		if (store->nav_group_log == MB_YES)
-			speed = 3.6 * store->nav_log_speed;
-		else if (store->nav_group_motiongt == MB_YES)
-			speed = 3.6 * store->nav_speed_ground;
-		else if (store->nav_group_motiontw == MB_YES)
-			speed = 3.6 * store->nav_speed_water;
-		else
-			speed = 0.0;
-
-		/* interpolate position */
-		mb_navint_interp(verbose, mbio_ptr, time_d, heading, speed,
-				    &lon, &lat, &speed, error);
-
-		/* set values */
-		store->mul_lon = DTR * lon;
-		store->mul_lat = DTR * lat;
-		store->mul_heading = DTR * heading;
-		store->mul_speed = speed / 3.6;
-		store->mul_group_mbsystemnav = MB_YES;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_wt_l3xseraw(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_wt_l3xseraw";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_xse_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to store data structure */
-	store = (struct mbsys_xse_struct *) store_ptr;
-
-	/* write next data to file */
-	status = mbr_l3xseraw_wr_data(verbose,mbio_ptr,store_ptr,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_l3xseraw_rd_data(int verbose,void *mbio_ptr,void *store_ptr,int *error)
-{
-	char	*function_name = "mbr_l3xseraw_rd_data";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_xse_struct *store;
-	FILE	*mbfp;
-	static char label[4];
-	int	done;
-	int	frame_id;
-	int	frame_source;
-	int	frame_sec;
-	int	frame_usec;
-	int	frame_transaction;
-	int	frame_address;
-	int	buffer_size;
-	int	frame_size;
-	int	*buffer_size_max;
-	int	*frame_save;
-	int	*frame_expect;
-	int	*frame_id_save;
-	int	*frame_source_save;
-	int	*frame_sec_save;
-	int	*frame_usec_save;
-	int	*buffer_size_save;
-	char	*buffer;
-	int	index;
-	int	read_len;
-	int	skip;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to store data structure */
-	store = (struct mbsys_xse_struct *) store_ptr;
-	mbfp = mb_io_ptr->mbfp;
-
-	/* set file position */
-	mb_io_ptr->file_pos = mb_io_ptr->file_bytes;
-
-	/* read until done */
-	*error = MB_ERROR_NO_ERROR;
-	frame_expect = (int *) &mb_io_ptr->save1;
-	frame_save = (int *) &mb_io_ptr->save2;
-	frame_id_save = (int *) &mb_io_ptr->save3;
-	frame_source_save = (int *) &mb_io_ptr->save4;
-	frame_sec_save = (int *) &mb_io_ptr->save5;
-	frame_usec_save = (int *) &mb_io_ptr->save6;
-	buffer_size_save = (int *) &mb_io_ptr->save7;
-	buffer_size_max = (int *) &mb_io_ptr->save8;
-	buffer = mb_io_ptr->hdr_comment;
-	store->sbm_properties = MB_NO;
-	store->sbm_hrp = MB_NO;
-	store->sbm_signal = MB_NO;
-	store->sbm_message = MB_NO;
-	done = MB_NO;
-	if (*frame_save == MB_YES)
-	    {
-	    store->mul_frame = MB_NO;
-	    store->sid_frame = MB_NO;
-	    }
-	while (done == MB_NO)
-	    {
-	    /* use saved frame if available */
-	    if (*frame_save == MB_YES)
-			{
-			frame_id = *frame_id_save;
-			frame_source = *frame_source_save;
-			frame_sec = *frame_sec_save;
-			frame_usec = *frame_usec_save;
-			buffer_size = *buffer_size_save;
-			*frame_save = MB_NO;
-			}
-
-	    /* else read from file */
-	    else
-		{
-
-		/* look for the next frame start */
-		skip = 0;
-		if ((read_len = fread(&label[0],1,4,mb_io_ptr->mbfp)) != 4)
-		    {
-		    status = MB_FAILURE;
-		    *error = MB_ERROR_EOF;
-		    }
-
-#ifdef MB_DEBUG
-fprintf(stderr,"Byte: %d %c %o %x\n", label[0],label[0],label[0],label[0]);
-fprintf(stderr,"Byte: %d %c %o %x\n", label[1],label[1],label[1],label[1]);
-fprintf(stderr,"Byte: %d %c %o %x\n", label[2],label[2],label[2],label[2]);
-fprintf(stderr,"Byte: %d %c %o %x\n", label[3],label[3],label[3],label[3]);
-#endif
-
-#ifdef DATAINPCBYTEORDER
-		while (status == MB_SUCCESS
-		    && strncmp(label, "FSH$", 4))
-#else
-		while (status == MB_SUCCESS
-		    && strncmp(label, "$HSF", 4))
-#endif
-		    {
-		    /* get next byte */
-		    for (i=0;i<3;i++)
-				label[i] = label[i+1];
-		    if ((read_len = fread(&label[3],1,1,mb_io_ptr->mbfp)) != 1)
-				{
-				status = MB_FAILURE;
-				*error = MB_ERROR_EOF;
-				}
-		    else
-				{
-				skip++;
-#ifdef MB_DEBUG
-fprintf(stderr,"Byte: %d %c %o %x\n", label[3],label[3],label[3],label[3]);
-#endif
-				}
-		    }
-
-		/* Read entire data record into buffer. The XSE frame byte count value */
-		/* is notorious for being incorrect.  So we read the data record by */
-		/* reading up to the next frame end mark. */
-
-		/* copy the frame start label to the buffer */
-		if(status==MB_SUCCESS)
-			{
-			strncpy(buffer, label, 4);
-			index = 4;
-			buffer_size = 4;
-			}
-
-		/* Read next four bytes from the file into buffer to get us started. */
-		if (status == MB_SUCCESS)
-		    	{
-			if ((read_len = fread(&buffer[index],1,4,mb_io_ptr->mbfp)) != 4)
-				{
-				status = MB_FAILURE;
-				*error = MB_ERROR_EOF;
-				frame_size = 0;
-				}
-			else
-				{
-				buffer_size += 4;
-		    		mb_get_binary_int(SWAPFLAG, &buffer[4], (int *) &frame_size);
-				}
-			}
-
-		/* now read a byte at a time, continuing until we find the end mark */
-#ifdef DATAINPCBYTEORDER
-		while (status == MB_SUCCESS
-		    && strncmp(&buffer[index], "FSH#", 4))
-#else
-		while (status == MB_SUCCESS
-		    && strncmp(&buffer[index], "#HSF", 4))
-#endif
-		    {
-		    /* read next byte */
-		    if ((read_len = fread(&buffer[buffer_size],1,1,mb_io_ptr->mbfp)) != 1)
-				{
-				status = MB_FAILURE;
-				*error = MB_ERROR_EOF;
-				}
-			else
-				{
-				buffer_size++;
-				index++;
-				}
-
-		    /* don't let buffer overflow - error if record exceeds max size */
-		    if (buffer_size >= MBSYS_XSE_BUFFER_SIZE)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_UNINTELLIGIBLE;
-			}
-		    }
-		*buffer_size_max = MAX(buffer_size,*buffer_size_max);
-
-#ifdef MB_DEBUG
-if (*error != MB_ERROR_EOF)
-{
-fprintf(stderr,"%s:%d | \n",__FILE__,__LINE__);
-if (skip > 0)
-fprintf(stderr, "\n%s:%d | BYTES SKIPPED BETWEEN FRAMES: %d\n",__FILE__,__LINE__, skip);
-fprintf(stderr, "\n%s:%d | BUFFER SIZE: %u  MAX FOUND: %u  MAX: %u\n",__FILE__,__LINE__,
-buffer_size,*buffer_size_max,MBSYS_XSE_BUFFER_SIZE);
-}
-#endif
-
-		/* parse header values */
-		if (status == MB_SUCCESS)
-		    {
-		    /* get frame id, source, and time */
-		    index = 8;
-		    mb_get_binary_int(SWAPFLAG, &buffer[index], (int *) &frame_id); index += 4;
-		    mb_get_binary_int(SWAPFLAG, &buffer[index], (int *) &frame_source); index += 4;
-		    mb_get_binary_int(SWAPFLAG, &buffer[index], (int *) &frame_sec); index += 4;
-		    mb_get_binary_int(SWAPFLAG, &buffer[index], (int *) &frame_usec); index += 4;
-
-		    /* if it's a control frame, get the transaction and address values */
-		    if(frame_id == MBSYS_XSE_CNT_FRAME)
-			    {
-			    mb_get_binary_int(SWAPFLAG, &buffer[index], (int *) &frame_transaction); index += 4;
-			    mb_get_binary_int(SWAPFLAG, &buffer[index], (int *) &frame_address); index += 4;
-			    }
-		    }
-		}
-
-	    /* parse data if possible */
-	    if (status == MB_SUCCESS)
-			{
-#ifdef MB_DEBUG
-fprintf(stderr, "%s:%d | FRAME ID: %u  BUFFER SIZE:%d  FRAME SIZE:%d\n",__FILE__,__LINE__,frame_id,buffer_size,frame_size);
-#endif
-			if (frame_id == MBSYS_XSE_NAV_FRAME)
-			    {
-#ifdef MB_DEBUG
-fprintf(stderr, "%s:%d | READ NAV\n",__FILE__,__LINE__);
-#endif
-			    status = mbr_l3xseraw_rd_nav(verbose,buffer_size,buffer,store_ptr,error);
-			    if (store->nav_source > 0)
-				{
-				store->kind = MB_DATA_NAV;
-#ifdef MB_DEBUG
-fprintf(stderr,"%s:%d | nav_source:%d  time:%u.%6.6u\n",__FILE__,__LINE__,store->nav_source,store->nav_sec,store->nav_usec);
-#endif
-				}
-			    else
-				store->kind = MB_DATA_RAW_LINE;
-			    done = MB_YES;
-			    }
-			else if (frame_id == MBSYS_XSE_SVP_FRAME)
-			    {
-#ifdef MB_DEBUG
-fprintf(stderr, "%s:%d | READ SVP\n",__FILE__,__LINE__);
-#endif
-			    store->kind = MB_DATA_VELOCITY_PROFILE;
-			    status = mbr_l3xseraw_rd_svp(verbose,buffer_size,buffer,store_ptr,error);
-			    done = MB_YES;
-			    }
-			else if (frame_id == MBSYS_XSE_TID_FRAME)
-				{
-#ifdef MB_DEBUG
-fprintf(stderr, "%s:%d | READ TIDE\n",__FILE__,__LINE__);
-#endif
-				store->kind = MB_DATA_RAW_LINE;
-				status = mbr_l3xseraw_rd_tide(verbose,buffer_size,buffer,store_ptr,error);
-				done = MB_YES;
-				}
-			else if (frame_id == MBSYS_XSE_SHP_FRAME)
-			    {
-#ifdef MB_DEBUG
-fprintf(stderr, "%s:%d | READ PARAMETER\n",__FILE__,__LINE__);
-#endif
-			    store->kind = MB_DATA_PARAMETER;
-			    status = mbr_l3xseraw_rd_ship(verbose,buffer_size,buffer,store_ptr,error);
-			    done = MB_YES;
-			    }
-			else if (frame_id == MBSYS_XSE_SSN_FRAME)
-			    {
-#ifdef MB_DEBUG
-fprintf(stderr, "%s:%d | READ SIDESCAN\n",__FILE__,__LINE__);
-#endif
-			    store->kind = MB_DATA_DATA;
-			    status = mbr_l3xseraw_rd_sidescan(verbose,buffer_size,buffer,store_ptr,error);
-			    store->sid_frame = MB_YES;
-			    if (frame_id == *frame_expect
-				    && store->sid_ping == store->mul_ping
-				    && store->sid_group_avl == MB_YES)
-				    {
-				    *frame_expect = MBSYS_XSE_NONE_FRAME;
-				    done = MB_YES;
-				    }
-			    else if (frame_id == *frame_expect
-				    && store->sid_ping == store->mul_ping
-				    && store->sid_group_avl == MB_NO)
-				    {
-				    done = MB_NO;
-				    }
-			    else if (*frame_expect == MBSYS_XSE_NONE_FRAME)
-				    {
-				    *frame_expect = MBSYS_XSE_MBM_FRAME;
-				    done = MB_NO;
-				    }
-#ifdef MB_DEBUG
-fprintf(stderr, "%s:%d | \tframe_id:%d frame_expect:%d ping:%d %d sid_group_avl:%d\n",__FILE__,__LINE__,
-frame_id,*frame_expect,store->sid_ping,store->mul_ping,store->sid_group_avl);
-fprintf(stderr, "%s:%d | \tDONE:%d BEAMS:%d PIXELS:%d\n",__FILE__,__LINE__, done, store->mul_num_beams, store->sid_avl_num_samples);
-#endif
-			    }
-			else if (frame_id == MBSYS_XSE_MBM_FRAME
-				&& *frame_expect == MBSYS_XSE_SSN_FRAME)
-			    {
-#ifdef MB_DEBUG
-fprintf(stderr, "%s:%d | READ NOTHING - SAVE HEADER\n",__FILE__,__LINE__);
-#endif
-			    store->kind = MB_DATA_DATA;
-			    *frame_save = MB_YES;
-			    *frame_id_save = frame_id;
-			    *frame_source_save = frame_source;
-			    *frame_sec_save = frame_sec;
-			    *frame_usec_save = frame_usec;
-			    *buffer_size_save = buffer_size;
-			    *frame_expect = MBSYS_XSE_NONE_FRAME;
-			    done = MB_YES;
-#ifdef MB_DEBUG
-fprintf(stderr, "%s:%d | \tDONE:%d BEAMS:%d PIXELS:%d\n",__FILE__,__LINE__, done, store->mul_num_beams, store->sid_avl_num_samples);
-#endif
-			    }
-			else if (frame_id == MBSYS_XSE_MBM_FRAME)
-			    {
-#ifdef MB_DEBUG
-fprintf(stderr, "%s:%d | READ MULTIBEAM\n",__FILE__,__LINE__);
-#endif
-			    store->kind = MB_DATA_DATA;
-			    status = mbr_l3xseraw_rd_multibeam(verbose,buffer_size,buffer,store_ptr,error);
-			    store->mul_frame = MB_YES;
-			    if (frame_id == *frame_expect
-				    && store->sid_ping == store->mul_ping)
-				    {
-				    *frame_expect = MBSYS_XSE_NONE_FRAME;
-				    done = MB_YES;
-				    }
-			    else if (frame_id == *frame_expect)
-				    {
-				    *frame_expect = MBSYS_XSE_SSN_FRAME;
-				    done = MB_NO;
-				    }
-			    else if (*frame_expect == MBSYS_XSE_NONE_FRAME)
-				    {
-				    *frame_expect = MBSYS_XSE_SSN_FRAME;
-				    done = MB_NO;
-				    }
-#ifdef MB_DEBUG
-fprintf(stderr, "%s:%d | \tDONE:%d BEAMS:%d PIXELS:%d\n",__FILE__,__LINE__, done, store->mul_num_beams, store->sid_avl_num_samples);
-#endif
-			    }
-			else if (frame_id == MBSYS_XSE_SNG_FRAME)
-				{
-#ifdef MB_DEBUG
-fprintf(stderr, "%s:%d | READ SINGLEBEAM\n",__FILE__,__LINE__);
-#endif
-				store->kind = MB_DATA_RAW_LINE;
-				status = mbr_l3xseraw_rd_singlebeam(verbose,buffer_size,buffer,store_ptr,error);
-				done = MB_YES;
-				}
-			else if (frame_id == MBSYS_XSE_CNT_FRAME)
-				{
-#ifdef MB_DEBUG
-fprintf(stderr, "%s:%d | READ CONTROL\n",__FILE__,__LINE__);
-#endif
-				store->kind = MB_DATA_RAW_LINE;
-				status = mbr_l3xseraw_rd_control(verbose,buffer_size,buffer,store_ptr,error);
-				done = MB_YES;
-				}
-			else if (frame_id == MBSYS_XSE_BTH_FRAME)
-				{
-#ifdef MB_DEBUG
-fprintf(stderr, "%s:%d | READ BATHYMETRY\n",__FILE__,__LINE__);
-#endif
-				store->kind = MB_DATA_RAW_LINE;
-				status = mbr_l3xseraw_rd_bathymetry(verbose,buffer_size,buffer,store_ptr,error);
-				done = MB_YES;
-				}
-			else if (frame_id == MBSYS_XSE_PRD_FRAME)
-				{
-#ifdef MB_DEBUG
-fprintf(stderr, "%s:%d | READ PRODUCT\n",__FILE__,__LINE__);
-#endif
-				store->kind = MB_DATA_RAW_LINE;
-				status = mbr_l3xseraw_rd_product(verbose,buffer_size,buffer,store_ptr,error);
-				done = MB_YES;
-				}
-			else if (frame_id == MBSYS_XSE_NTV_FRAME)
-				{
-#ifdef MB_DEBUG
-fprintf(stderr, "%s:%d | READ NATIVE\n",__FILE__,__LINE__);
-#endif
-				store->kind = MB_DATA_RAW_LINE;
-				status = mbr_l3xseraw_rd_native(verbose,buffer_size,buffer,store_ptr,error);
-				done = MB_YES;
-				}
-			else if (frame_id == MBSYS_XSE_GEO_FRAME)
-				{
-#ifdef MB_DEBUG
-fprintf(stderr, "%s:%d | READ GEODETIC\n",__FILE__,__LINE__);
-#endif
-				store->kind = MB_DATA_RAW_LINE;
-				status = mbr_l3xseraw_rd_geodetic(verbose,buffer_size,buffer,store_ptr,error);
-				done = MB_YES;
-				}
-			else if (frame_id == MBSYS_XSE_SBM_FRAME)
-				{
-#ifdef MB_DEBUG
-fprintf(stderr, "%s:%d | READ SEABEAM\n",__FILE__,__LINE__);
-#endif
-				status = mbr_l3xseraw_rd_seabeam(verbose,buffer_size,buffer,store_ptr,error);
-				if (store->sbm_properties == MB_YES)
-				    store->kind = MB_DATA_RUN_PARAMETER;
-				else
-				    store->kind = MB_DATA_RAW_LINE;
-				done = MB_YES;
-				}
-			else if (frame_id == MBSYS_XSE_MSG_FRAME)
-				{
-#ifdef MB_DEBUG
-fprintf(stderr, "%s:%d | READ MESSAGE\n",__FILE__,__LINE__);
-#endif
-				store->kind = MB_DATA_RAW_LINE;
-				status = mbr_l3xseraw_rd_message(verbose,buffer_size,buffer,store_ptr,error);
-				done = MB_YES;
-				}
-			else if (frame_id == MBSYS_XSE_COM_FRAME)
-			    {
-#ifdef MB_DEBUG
-fprintf(stderr, "%s:%d | READ COMMENT\n",__FILE__,__LINE__);
-#endif
-			    store->kind = MB_DATA_COMMENT;
-			    status = mbr_l3xseraw_rd_comment(verbose,buffer_size,buffer,store_ptr,error);
-			    done = MB_YES;
-			    }
-			else /* handle an unrecognized frame */
-			    {
-#ifdef MB_DEBUG
-fprintf(stderr, "%s:%d | READ OTHER\n",__FILE__,__LINE__);
-#endif
-			    store->kind = MB_DATA_RAW_LINE;
-			    }
-
-			if(store->kind==MB_DATA_RAW_LINE)
-				{
-				store->rawsize = buffer_size;
-				for (i=0;i<buffer_size;i++)
-					store->raw[i] = buffer[i];
-				done = MB_YES;
-				}
-			}
-		else if (*frame_expect != MBSYS_XSE_NONE_FRAME
-		    && frame_id != *frame_expect)
-		    {
-#ifdef MB_DEBUG
-fprintf(stderr, "%s:%d | READ NOTHING - SAVE HEADER\n",__FILE__,__LINE__);
-#endif
-		    store->kind = MB_DATA_DATA;
-		    *frame_save = MB_YES;
-		    *frame_id_save = frame_id;
-		    *frame_source_save = frame_source;
-		    *frame_sec_save = frame_sec;
-		    *frame_usec_save = frame_usec;
-		    *buffer_size_save = buffer_size;
-		    *frame_expect = MBSYS_XSE_NONE_FRAME;
-		    done = MB_YES;
-		    }
-
-	    /* check for status */
-	    if (status == MB_FAILURE)
-			{
-			done = MB_YES;
-			*frame_save = MB_NO;
-			}
-	    }
-
-	/* get file position */
-	mb_io_ptr->file_bytes = ftell(mbfp);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_l3xseraw_rd_nav(int verbose,int buffer_size,char *buffer,void *store_ptr,int *error)
-{
-	char	*function_name = "mbr_l3xseraw_rd_nav";
-	int	status = MB_SUCCESS;
-	struct mbsys_xse_struct *store;
-	int	byte_count;
-	int	group_id;
-	int	done;
-	int	index;
-	int	skip;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       buffer_size:%d\n",buffer_size);
-		fprintf(stderr,"dbg2       buffer:     %p\n",(void *)buffer);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to store data structure */
-	store = (struct mbsys_xse_struct *) store_ptr;
-
-	/* get source and time */
-	index = 12;
-	mb_get_binary_int(SWAPFLAG, &buffer[index], (int *) &store->nav_source); index += 4;
-	mb_get_binary_int(SWAPFLAG, &buffer[index], (int *) &store->nav_sec); index += 4;
-	mb_get_binary_int(SWAPFLAG, &buffer[index], (int *) &store->nav_usec); index += 4;
-
-	/* reset group read flags */
-	store->nav_group_general = MB_NO;	/* boolean flag */
-	store->nav_group_position = MB_NO;	/* boolean flag */
-	store->nav_group_accuracy = MB_NO;	/* boolean flag */
-	store->nav_group_motiongt = MB_NO;	/* boolean flag */
-	store->nav_group_motiontw = MB_NO;	/* boolean flag */
-	store->nav_group_track = MB_NO;		/* boolean flag */
-	store->nav_group_hrp = MB_NO;		/* boolean flag */
-	store->nav_group_heave = MB_NO;		/* boolean flag */
-	store->nav_group_roll = MB_NO;		/* boolean flag */
-	store->nav_group_pitch = MB_NO;		/* boolean flag */
-	store->nav_group_heading = MB_NO;	/* boolean flag */
-	store->nav_group_log = MB_NO;		/* boolean flag */
-	store->nav_group_gps = MB_NO;		/* boolean flag */
-
-	/* loop over groups */
-	done = MB_NO;
-	while (index <= buffer_size
-		&& status == MB_SUCCESS
-		&& done == MB_NO)
-	    {
-	    /* look for group start or frame end */
-	    skip = 0;
-#ifdef DATAINPCBYTEORDER
-	    while (index < buffer_size
-			&& strncmp(&buffer[index], "GSH$", 4)
-			&& strncmp(&buffer[index], "FSH#", 4))
-			{
-			index++;
-			skip++;
-			}
-	    if (index >= buffer_size
-			|| !strncmp(&buffer[index], "FSH#", 4))
-			done = MB_YES;
-	    else
-			index += 4;
-#else
-	    while (index < buffer_size
-			&& strncmp(&buffer[index], "$HSG", 4)
-			&& strncmp(&buffer[index], "#HSF", 4))
-			{
-			index++;
-			skip++;
-			}
-	    if (index >= buffer_size
-			|| !strncmp(&buffer[index], "#HSF", 4))
-			done = MB_YES;
-	    else
-			index += 4;
-#endif
-
-#ifdef MB_DEBUG
-if (skip > 4) fprintf(stderr, "%s:%d | skipped %d bytes in function <%s>\n",__FILE__,__LINE__, skip-4, function_name);
-#endif
-
-	    /* deal with group */
-	    if (done == MB_NO)
-			{
-			/* get group size and id */
-			mb_get_binary_int(SWAPFLAG, &buffer[index], (int *) &byte_count); index += 4;
-			mb_get_binary_int(SWAPFLAG, &buffer[index], (int *) &group_id); index += 4;
-
-			/* print debug statements */
-			if (verbose >= 5)
-			    {
-			    fprintf(stderr,"\ndbg5  Group %d of %d bytes to be parsed in MBIO function <%s>\n",
-				    group_id, byte_count, function_name);
-			    }
-#ifdef MB_DEBUG
-fprintf(stderr, "%s:%d | Group %d of %d bytes to be parsed in MBIO function <%s>\n",__FILE__,__LINE__,
-				    group_id, byte_count, function_name);
-#endif
-
-		    /* handle general group */
-		    if (group_id == MBSYS_XSE_NAV_GROUP_GEN)
-				{
-#ifdef MB_DEBUG
-fprintf(stderr, "%s:%d | READ NAV_GROUP_GEN\n",__FILE__,__LINE__);
-#endif
-				mb_get_binary_int(SWAPFLAG, &buffer[index], (int *) &store->nav_quality); index += 4;
-				mb_get_binary_int(SWAPFLAG, &buffer[index], (int *) &store->nav_status); index += 4;
-				store->nav_group_general = MB_YES;
-				}
-
-		    /* handle point group */
-		    else if (group_id == MBSYS_XSE_NAV_GROUP_POS)
-				{
-#ifdef MB_DEBUG
-fprintf(stderr, "%s:%d | READ NAV_GROUP_POS\n",__FILE__,__LINE__);
-#endif
-				mb_get_binary_int(SWAPFLAG, &buffer[index], (int *) &store->nav_description_len); index += 4;
-				for (i=0;i<store->nav_description_len;i++)
-				    {
-				    store->nav_description[i] = buffer[index];
-				    index++;
-				    }
-				store->nav_description[store->nav_description_len] = '\0';
-				mb_get_binary_double(SWAPFLAG, &buffer[index], &store->nav_x); index += 8;
-				mb_get_binary_double(SWAPFLAG, &buffer[index], &store->nav_y); index += 8;
-				mb_get_binary_double(SWAPFLAG, &buffer[index], &store->nav_z); index += 8;
-				store->nav_group_position = MB_YES;
-				}
-
-		    /* handle accuracy group */
-		    else if (group_id == MBSYS_XSE_NAV_GROUP_ACCURACY)
-				{
-#ifdef MB_DEBUG
-fprintf(stderr, "%s:%d | READ NAV_GROUP_ACCURACY\n",__FILE__,__LINE__);
-#endif
-				mb_get_binary_int(SWAPFLAG, &buffer[index], (int *) &store->nav_acc_quality); index += 4;
-				store->nav_acc_numsatellites = buffer[index]; index++;
-				mb_get_binary_float(SWAPFLAG, &buffer[index], (float *) &store->nav_acc_horizdilution); index += 4;
-				mb_get_binary_float(SWAPFLAG, &buffer[index], (float *) &store->nav_acc_diffage); index += 4;
-				mb_get_binary_int(SWAPFLAG, &buffer[index], (int *) &store->nav_acc_diffref); index += 4;
-				store->nav_group_accuracy = MB_YES;
-				}
-
-		    /* handle motion ground truth group */
-		    else if (group_id == MBSYS_XSE_NAV_GROUP_MOTIONGT)
-				{
-#ifdef MB_DEBUG
-fprintf(stderr, "%s:%d | READ NAV_GROUP_MOTIONGT\n",__FILE__,__LINE__);
-#endif
-				mb_get_binary_double(SWAPFLAG, &buffer[index], &store->nav_speed_ground); index += 8;
-				mb_get_binary_double(SWAPFLAG, &buffer[index], &store->nav_course_ground); index += 8;
-				store->nav_group_motiongt = MB_YES;
-				}
-
-		    /* handle motion through water group */
-		    else if (group_id == MBSYS_XSE_NAV_GROUP_MOTIONTW)
-				{
-#ifdef MB_DEBUG
-fprintf(stderr, "%s:%d | READ NAV_GROUP_MOTIONTW\n",__FILE__,__LINE__);
-#endif
-				mb_get_binary_double(SWAPFLAG, &buffer[index], &store->nav_speed_water); index += 8;
-				mb_get_binary_double(SWAPFLAG, &buffer[index], &store->nav_course_water); index += 8;
-				store->nav_group_motiontw = MB_YES;
-				}
-
-			/* handle current track steering properties group */
-			else if (group_id == MBSYS_XSE_NAV_GROUP_TRACK)
-				{
-#ifdef MB_DEBUG
-fprintf(stderr, "%s:%d | READ NAV_GROUP_TRACK\n",__FILE__,__LINE__);
-#endif
-				mb_get_binary_double(SWAPFLAG, &buffer[index], &store->nav_trk_offset_track); index += 8;
-				mb_get_binary_double(SWAPFLAG, &buffer[index], &store->nav_trk_offset_sol); index += 8;
-				mb_get_binary_double(SWAPFLAG, &buffer[index], &store->nav_trk_offset_eol); index += 8;
-				mb_get_binary_double(SWAPFLAG, &buffer[index], &store->nav_trk_distance_sol); index += 8;
-				mb_get_binary_double(SWAPFLAG, &buffer[index], &store->nav_trk_azimuth_sol); index += 8;
-				mb_get_binary_double(SWAPFLAG, &buffer[index], &store->nav_trk_distance_eol); index += 8;
-				mb_get_binary_double(SWAPFLAG, &buffer[index], &store->nav_trk_azimuth_eol); index += 8;
-				store->nav_group_track = MB_YES;
-				}
-
-			/* handle the heaverollpitch group */
-			else if (group_id == MBSYS_XSE_NAV_GROUP_HRP)
-				{
-#ifdef MB_DEBUG
-fprintf(stderr, "%s:%d | READ NAV_GROUP_HRP\n",__FILE__,__LINE__);
-#endif
-				mb_get_binary_double(SWAPFLAG, &buffer[index], &store->nav_hrp_heave); index += 8;
-				mb_get_binary_double(SWAPFLAG, &buffer[index], &store->nav_hrp_roll); index += 8;
-				mb_get_binary_double(SWAPFLAG, &buffer[index], &store->nav_hrp_pitch); index += 8;
-				store->nav_group_hrp = MB_YES;
-				/* heave, roll, and pitch are best obtained from the multibeam frame */
-				}
-
-			/* handle the heave group */
-			else if (group_id == MBSYS_XSE_NAV_GROUP_HEAVE)
-				{
-#ifdef MB_DEBUG
-fprintf(stderr, "%s:%d | READ NAV_GROUP_HEAVE\n",__FILE__,__LINE__);
-#endif
-				mb_get_binary_double(SWAPFLAG, &buffer[index], &store->nav_hea_heave); index += 8;
-				store->nav_group_heave = MB_YES;
-				/* heave is obtained from the multibeam frame */
-				}
-
-			/* handle the roll group */
-			else if (group_id == MBSYS_XSE_NAV_GROUP_ROLL)
-				{
-#ifdef MB_DEBUG
-fprintf(stderr, "%s:%d | READ NAV_GROUP_ROLL\n",__FILE__,__LINE__);
-#endif
-				mb_get_binary_double(SWAPFLAG, &buffer[index], &store->nav_rol_roll); index += 8;
-				store->nav_group_roll = MB_YES;
-				/* roll is obtained from the multibeam frame */
-				}
-
-			/* handle the pitch group */
-			else if (group_id == MBSYS_XSE_NAV_GROUP_PITCH)
-				{
-#ifdef MB_DEBUG
-fprintf(stderr, "%s:%d | READ NAV_GROUP_PITCH\n",__FILE__,__LINE__);
-#endif
-				mb_get_binary_double(SWAPFLAG, &buffer[index], &store->nav_pit_pitch); index += 8;
-				store->nav_group_pitch = MB_YES;
-				/* pitch is obtained from the multibeam frame */
-				}
-
-			/* handle the heading group */
-			else if (group_id == MBSYS_XSE_NAV_GROUP_HEADING)
-				{
-#ifdef MB_DEBUG
-fprintf(stderr, "%s:%d | READ NAV_GROUP_HEADING\n",__FILE__,__LINE__);
-#endif
-				mb_get_binary_double(SWAPFLAG, &buffer[index], &store->nav_hdg_heading); index += 8;
-				store->nav_group_heading = MB_YES;
-				/* Heading Group value overrides the MTW Group course value */
-				}
-
-			/* handle the log group */
-			else if (group_id == MBSYS_XSE_NAV_GROUP_LOG)
-				{
-#ifdef MB_DEBUG
-fprintf(stderr, "%s:%d | READ NAV_GROUP_LOG\n",__FILE__,__LINE__);
-#endif
-				mb_get_binary_double(SWAPFLAG, &buffer[index], &store->nav_log_speed); index += 8;
-				store->nav_group_log = MB_YES;
-				/* speed is obtained from the motion ground truth */
-				/* and motion through water groups */
-				}
-
-			/* handle the gps group */
-			else if (group_id == MBSYS_XSE_NAV_GROUP_GPS)
-				{
-#ifdef MB_DEBUG
-fprintf(stderr, "%s:%d | READ NAV_GROUP_LOG\n",__FILE__,__LINE__);
-#endif
-				mb_get_binary_float(SWAPFLAG, &buffer[index], &store->nav_gps_altitude); index += 4;
-				mb_get_binary_float(SWAPFLAG, &buffer[index], &store->nav_gps_geoidalseparation); index += 4;
-				store->nav_group_gps = MB_YES;
-				}
-
-			else
-				{
-#ifdef MB_DEBUG
-fprintf(stderr, "%s:%d | READ NAV_GROUP_OTHER\n",__FILE__,__LINE__);
-#endif
-				}
-			}
-	    }
-
-	/* print debug statements */
-	if (verbose >= 5)
-	    {
-	    fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-	    fprintf(stderr,"dbg5       nav_source:          %d\n",store->nav_source);
-	    fprintf(stderr,"dbg5       nav_sec:             %u\n",store->nav_sec);
-	    fprintf(stderr,"dbg5       nav_usec:            %u\n",store->nav_usec);
-	    fprintf(stderr,"dbg5       nav_quality:         %d\n",store->nav_quality);
-	    fprintf(stderr,"dbg5       nav_status:          %d\n",store->nav_status);
-	    fprintf(stderr,"dbg5       nav_description_len: %d\n",store->nav_description_len);
-	    fprintf(stderr,"dbg5       nav_description:     %s\n",store->nav_description);
-	    fprintf(stderr,"dbg5       nav_x:               %f\n",store->nav_x);
-	    fprintf(stderr,"dbg5       nav_y:               %f\n",store->nav_y);
-	    fprintf(stderr,"dbg5       nav_z:               %f\n",store->nav_z);
-	    fprintf(stderr,"dbg5       nav_speed_ground:    %f\n",store->nav_speed_ground);
-	    fprintf(stderr,"dbg5       nav_course_ground:   %f\n",store->nav_course_ground);
-	    fprintf(stderr,"dbg5       nav_speed_water:     %f\n",store->nav_speed_water);
-	    fprintf(stderr,"dbg5       nav_course_water:    %f\n",store->nav_course_water);
-	    }
-
-	/* print output debug statements */
-	if (verbose >= 2)
-	    {
-	    fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-		    function_name);
-	    fprintf(stderr,"dbg2  Return values:\n");
-	    fprintf(stderr,"dbg2       error:      %d\n",*error);
-	    fprintf(stderr,"dbg2  Return status:\n");
-	    fprintf(stderr,"dbg2       status:  %d\n",status);
-	    }
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_l3xseraw_rd_svp(int verbose,int buffer_size,char *buffer,void *store_ptr,int *error)
-{
-	char	*function_name = "mbr_l3xseraw_rd_svp";
-	int	status = MB_SUCCESS;
-	struct mbsys_xse_struct *store;
-	int	byte_count;
-	int	group_id;
-	int	done;
-	int	index;
-	int	skip;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       buffer_size:%d\n",buffer_size);
-		fprintf(stderr,"dbg2       buffer:     %p\n",(void *)buffer);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to store data structure */
-	store = (struct mbsys_xse_struct *) store_ptr;
-
-	/* get source and time */
-	index = 12;
-	mb_get_binary_int(SWAPFLAG, &buffer[index], (int *) &store->svp_source); index += 4;
-	mb_get_binary_int(SWAPFLAG, &buffer[index], (int *) &store->svp_sec); index += 4;
-	mb_get_binary_int(SWAPFLAG, &buffer[index], (int *) &store->svp_usec); index += 4;
-
-	/* loop over groups */
-	done = MB_NO;
-	while (index <= buffer_size
-		&& status == MB_SUCCESS
-		&& done == MB_NO)
-	    {
-	    /* look for group start or frame end */
-	    skip = 0;
-#ifdef DATAINPCBYTEORDER
-	    while (index < buffer_size
-			&& strncmp(&buffer[index], "GSH$", 4)
-			&& strncmp(&buffer[index], "FSH#", 4))
-			{
-			index++;
-			skip++;
-			}
-	    if (index >= buffer_size
-			|| !strncmp(&buffer[index], "FSH#", 4))
-			done = MB_YES;
-	    else
-			index += 4;
-#else
-	    while (index < buffer_size
-			&& strncmp(&buffer[index], "$HSG", 4)
-			&& strncmp(&buffer[index], "#HSF", 4))
-			{
-			index++;
-			skip++;
-			}
-	    if (index >= buffer_size
-			|| !strncmp(&buffer[index], "#HSF", 4))
-			done = MB_YES;
-	    else
-			index += 4;
-#endif
-
-#ifdef MB_DEBUG
-if (skip > 4) fprintf(stderr, "%s:%d | skipped %d bytes in function <%s>\n",__FILE__,__LINE__, skip-4, function_name);
-#endif
-
-	    /* deal with group */
-	    if (done == MB_NO)
-			{
-			/* get group size and id */
-			mb_get_binary_int(SWAPFLAG, &buffer[index], (int *) &byte_count); index += 4;
-			mb_get_binary_int(SWAPFLAG, &buffer[index], (int *) &group_id); index += 4;
-
-			/* print debug statements */
-			if (verbose >= 5)
-			    {
-			    fprintf(stderr,"\ndbg5  Group %d of %d bytes to be parsed in MBIO function <%s>\n",
-				    group_id, byte_count, function_name);
-			    }
-#ifdef MB_DEBUG
-fprintf(stderr, "%s:%d | Group %d of %d bytes to be parsed in MBIO function <%s>\n",__FILE__,__LINE__,
-				    group_id, byte_count, function_name);
-#endif
-
-			/* handle general group */
-			if (group_id == MBSYS_XSE_SVP_GROUP_GEN)
-				{
-#ifdef MB_DEBUG
-fprintf(stderr, "%s:%d | READ SVP_GROUP_GEN\n",__FILE__,__LINE__);
-#endif
-				/* currently unused by MB-System */
-				}
-
-			/* handle depth group */
-			if (group_id == MBSYS_XSE_SVP_GROUP_DEPTH)
-				{
-#ifdef MB_DEBUG
-fprintf(stderr, "%s:%d | READ SVP_GROUP_DEPTH\n",__FILE__,__LINE__);
-#endif
-				mb_get_binary_int(SWAPFLAG, &buffer[index], (int *) &store->svp_nsvp); index += 4;
-				for (i=0;i<store->svp_nsvp;i++)
-				    {
-				    if (i < MBSYS_XSE_MAXSVP)
-						{
-						mb_get_binary_double(SWAPFLAG, &buffer[index], &store->svp_depth[i]); index += 8;
-						}
-				    }
-				}
-
-			/* handle velocity group */
-			else if (group_id == MBSYS_XSE_SVP_GROUP_VELOCITY)
-				{
-#ifdef MB_DEBUG
-fprintf(stderr, "%s:%d | READ SVP_GROUP_VELOCITY\n",__FILE__,__LINE__);
-#endif
-				mb_get_binary_int(SWAPFLAG, &buffer[index], (int *) &store->svp_nsvp); index += 4;
-				for (i=0;i<store->svp_nsvp;i++)
-				    {
-				    if (i < MBSYS_XSE_MAXSVP)
-						{
-						mb_get_binary_double(SWAPFLAG, &buffer[index], &store->svp_velocity[i]); index += 8;
-						}
-				    }
-				}
-
-			/* handle conductivity group */
-			else if (group_id == MBSYS_XSE_SVP_GROUP_CONDUCTIVITY)
-				{
-#ifdef MB_DEBUG
-fprintf(stderr, "%s:%d | READ SVP_GROUP_CONDUCTIVITY\n",__FILE__,__LINE__);
-#endif
-				mb_get_binary_int(SWAPFLAG, &buffer[index], (int *) &store->svp_nctd); index += 4;
-				for (i=0;i<store->svp_nctd;i++)
-				    {
-				    if (i < MBSYS_XSE_MAXSVP)
-						{
-						mb_get_binary_double(SWAPFLAG, &buffer[index], &store->svp_conductivity[i]); index += 8;
-						}
-				    }
-				}
-
-			/* handle salinity group */
-			else if (group_id == MBSYS_XSE_SVP_GROUP_SALINITY)
-				{
-#ifdef MB_DEBUG
-fprintf(stderr, "%s:%d | READ SVP_GROUP_SALINITY\n",__FILE__,__LINE__);
-#endif
-				mb_get_binary_int(SWAPFLAG, &buffer[index], (int *) &store->svp_nctd); index += 4;
-				for (i=0;i<store->svp_nctd;i++)
-				    {
-				    if (i < MBSYS_XSE_MAXSVP)
-						{
-						mb_get_binary_double(SWAPFLAG, &buffer[index], &store->svp_salinity[i]); index += 8;
-						}
-				    }
-				}
-
-			/* handle temperature group */
-			else if (group_id == MBSYS_XSE_SVP_GROUP_TEMP)
-				{
-#ifdef MB_DEBUG
-fprintf(stderr, "%s:%d | READ SVP_GROUP_TEMP\n",__FILE__,__LINE__);
-#endif
-				mb_get_binary_int(SWAPFLAG, &buffer[index], (int *) &store->svp_nctd); index += 4;
-				for (i=0;i<store->svp_nctd;i++)
-				    {
-				    if (i < MBSYS_XSE_MAXSVP)
-						{
-						mb_get_binary_double(SWAPFLAG, &buffer[index], &store->svp_temperature[i]); index += 8;
-						}
-				    }
-				}
-
-			/* handle pressure group */
-			else if (group_id == MBSYS_XSE_SVP_GROUP_PRESSURE)
-				{
-#ifdef MB_DEBUG
-fprintf(stderr, "%s:%d | READ SVP_GROUP_PRESSURE\n",__FILE__,__LINE__);
-#endif
-				mb_get_binary_int(SWAPFLAG, &buffer[index], (int *) &store->svp_nctd); index += 4;
-				for (i=0;i<store->svp_nctd;i++)
-				    {
-				    if (i < MBSYS_XSE_MAXSVP)
-						{
-						mb_get_binary_double(SWAPFLAG, &buffer[index], &store->svp_pressure[i]); index += 8;
-						}
-				    }
-				}
-
-			/* handle ssv group */
-			else if (group_id == MBSYS_XSE_SVP_GROUP_SSV)
-				{
-#ifdef MB_DEBUG
-fprintf(stderr, "%s:%d | READ SVP_GROUP_SSV\n",__FILE__,__LINE__);
-#endif
-				mb_get_binary_double(SWAPFLAG, &buffer[index], &store->svp_ssv); index += 8;
-				mb_get_binary_double(SWAPFLAG, &buffer[index], &store->svp_ssv_depth); index += 8;
-				store->svp_ssv_depthflag = buffer[index]; index++;
- 				}
-
-			/* handle point group */
-			else if (group_id == MBSYS_XSE_SVP_GROUP_POS)
-				{
-#ifdef MB_DEBUG
-fprintf(stderr, "%s:%d | READ SVP_GROUP_POS\n",__FILE__,__LINE__);
-#endif
-				/* currently unused by MB-System */
-				}
-
-			else
-				{
-#ifdef MB_DEBUG
-fprintf(stderr, "%s:%d | READ SVP_GROUP_OTHER\n",__FILE__,__LINE__);
-#endif
-				}
-			}
-	    }
-
-	/* print debug statements */
-	if (verbose >= 5)
-	    {
-	    fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-	    fprintf(stderr,"dbg5       svp_source:          %d\n",store->svp_source);
-	    fprintf(stderr,"dbg5       svp_sec:             %u\n",store->svp_sec);
-	    fprintf(stderr,"dbg5       svp_usec:            %u\n",store->svp_usec);
-	    fprintf(stderr,"dbg5       svp_nsvp:            %d\n",store->svp_nsvp);
-	    fprintf(stderr,"dbg5       svp_nctd:            %d\n",store->svp_nctd);
-	    fprintf(stderr,"dbg5       svp_ssv:             %f\n",store->svp_ssv);
-	    for (i=0;i<store->svp_nsvp;i++)
-		fprintf(stderr,"dbg5       svp[%d]:	        %f %f\n",
-		    i, store->svp_depth[i], store->svp_velocity[i]);
-	    for (i=0;i<store->svp_nctd;i++)
-		fprintf(stderr,"dbg5       cstd[%d]:        %f %f %f %f\n",
-		    i, store->svp_conductivity[i], store->svp_salinity[i],
-		    store->svp_temperature[i], store->svp_pressure[i]);
-	    }
-
-	/* print output debug statements */
-	if (verbose >= 2)
-	    {
-	    fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-		    function_name);
-	    fprintf(stderr,"dbg2  Return values:\n");
-	    fprintf(stderr,"dbg2       error:      %d\n",*error);
-	    fprintf(stderr,"dbg2  Return status:\n");
-	    fprintf(stderr,"dbg2       status:  %d\n",status);
-	    }
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_l3xseraw_rd_tide(int verbose,int buffer_size,char *buffer,void *store_ptr,int *error)
-{
-	char    *function_name = "mbr_l3xseraw_rd_tide";
-	int status = MB_SUCCESS;
-	struct mbsys_xse_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       buffer_size:%d\n",buffer_size);
-		fprintf(stderr,"dbg2       buffer:     %p\n",(void *)buffer);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to store data structure */
-	store = (struct mbsys_xse_struct *) store_ptr;
-
-	/* The tide frame is currently unused by MB-System */
-
-	/* print output debug statements */
-	if (verbose >= 2)
-	    {
-	    fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-		    function_name);
-	    fprintf(stderr,"dbg2  Return values:\n");
-	    fprintf(stderr,"dbg2       error:      %d\n",*error);
-	    fprintf(stderr,"dbg2  Return status:\n");
-	    fprintf(stderr,"dbg2       status:  %d\n",status);
-	    }
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_l3xseraw_rd_ship(int verbose,int buffer_size,char *buffer,void *store_ptr,int *error)
-{
-	char	*function_name = "mbr_l3xseraw_rd_ship";
-	int	status = MB_SUCCESS;
-	struct mbsys_xse_struct *store;
-	int	byte_count;
-	int	group_id;
-	int	done;
-	int	index;
-	int	skip;
-	int	nchar;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       buffer_size:%d\n",buffer_size);
-		fprintf(stderr,"dbg2       buffer:     %p\n",(void *)buffer);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to store data structure */
-	store = (struct mbsys_xse_struct *) store_ptr;
-
-	/* get source and time */
-	index = 12;
-	mb_get_binary_int(SWAPFLAG, &buffer[index], (int *) &store->par_source); index += 4;
-	mb_get_binary_int(SWAPFLAG, &buffer[index], (int *) &store->par_sec); index += 4;
-	mb_get_binary_int(SWAPFLAG, &buffer[index], (int *) &store->par_usec); index += 4;
-
-	/* loop over groups */
-	done = MB_NO;
-	while (index <= buffer_size
-		&& status == MB_SUCCESS
-		&& done == MB_NO)
-	    {
-	    /* look for group start or frame end */
-	    skip = 0;
-#ifdef DATAINPCBYTEORDER
-	    while (index < buffer_size
-			&& strncmp(&buffer[index], "GSH$", 4)
-			&& strncmp(&buffer[index], "FSH#", 4))
-			{
-			index++;
-			skip++;
-			}
-	    if (index >= buffer_size
-			|| !strncmp(&buffer[index], "FSH#", 4))
-			done = MB_YES;
-	    else
-			index += 4;
-#else
-	    while (index < buffer_size
-			&& strncmp(&buffer[index], "$HSG", 4)
-			&& strncmp(&buffer[index], "#HSF", 4))
-			{
-			index++;
-			skip++;
-			}
-	    if (index >= buffer_size
-			|| !strncmp(&buffer[index], "#HSF", 4))
-			done = MB_YES;
-	    else
-			index += 4;
-#endif
-
-#ifdef MB_DEBUG
-if (skip > 4) fprintf(stderr, "%s:%d | skipped %d bytes in function <%s>\n",__FILE__,__LINE__, skip-4, function_name);
-#endif
-
-	    /* deal with group */
-	    if (done == MB_NO)
-			{
-			/* get group size and id */
-			mb_get_binary_int(SWAPFLAG, &buffer[index], (int *) &byte_count); index += 4;
-			mb_get_binary_int(SWAPFLAG, &buffer[index], (int *) &group_id); index += 4;
-
-			/* print debug statements */
-			if (verbose >= 5)
-			    {
-			    fprintf(stderr,"\ndbg5  Group %d of %d bytes to be parsed in MBIO function <%s>\n",
-				    group_id, byte_count, function_name);
-			    }
-#ifdef MB_DEBUG
-fprintf(stderr, "%s:%d | Group %d of %d bytes to be parsed in MBIO function <%s>\n",__FILE__,__LINE__,
-				    group_id, byte_count, function_name);
-#endif
-
-			/* handle general group */
-			if (group_id == MBSYS_XSE_SHP_GROUP_GEN)
-				{
-				mb_get_binary_int(SWAPFLAG, &buffer[index], &nchar); index += 4;
-				for (i=0;i<nchar;i++)
-					{
-					store->par_ship_name[i] = buffer[index]; index++;
-					}
-				store->par_ship_name[nchar] = 0;
-				mb_get_binary_double(SWAPFLAG, &buffer[index], &store->par_ship_length); index += 8;
-				mb_get_binary_double(SWAPFLAG, &buffer[index], &store->par_ship_beam); index += 8;
-				mb_get_binary_double(SWAPFLAG, &buffer[index], &store->par_ship_draft); index += 8;
-				mb_get_binary_double(SWAPFLAG, &buffer[index], &store->par_ship_height); index += 8;
-				mb_get_binary_double(SWAPFLAG, &buffer[index], &store->par_ship_displacement); index += 8;
-				mb_get_binary_double(SWAPFLAG, &buffer[index], &store->par_ship_weight); index += 8;
-				}
-
-			/* handle time group */
-			else if (group_id == MBSYS_XSE_SHP_GROUP_TIME)
-				{
-				/* currently unused by MB-System */
-				}
-
-			/* handle draft group */
-			else if (group_id == MBSYS_XSE_SHP_GROUP_DRAFT)
-				{
-				/* currently unused by MB-System */
-				}
-
-			/* handle sensors group */
-			else if (group_id == MBSYS_XSE_SHP_GROUP_SENSORS)
-				{
-				mb_get_binary_int(SWAPFLAG, &buffer[index], &store->par_ship_nsensor); index += 4;
-				for (i=0;i<store->par_ship_nsensor;i++)
-					{
-					mb_get_binary_int(SWAPFLAG, &buffer[index], &store->par_ship_sensor_id[i]); index += 4;
-					}
-				for (i=0;i<store->par_ship_nsensor;i++)
-					{
-					mb_get_binary_int(SWAPFLAG, &buffer[index], &store->par_ship_sensor_type[i]); index += 4;
-					}
-				for (i=0;i<store->par_ship_nsensor;i++)
-					{
-					mb_get_binary_int(SWAPFLAG, &buffer[index], &store->par_ship_sensor_frequency[i]); index += 4;
-					}
-				}
-
-			/* handle motion group */
-			else if (group_id == MBSYS_XSE_SHP_GROUP_MOTION)
-				{
-				/* currently unused by MB-System */
-				}
-
-			/* handle geometry group */
-			else if (group_id == MBSYS_XSE_SHP_GROUP_GEOMETRY)
-				{
-				/* currently unused by MB-System */
-				}
-
-			/* handle description group */
-			else if (group_id == MBSYS_XSE_SHP_GROUP_DESCRIPTION)
-				{
-				/* currently unused by MB-System */
-				}
-
-		    /* handle parameter group */
-		    else if (group_id == MBSYS_XSE_SHP_GROUP_PARAMETER)
-				{
-				store->par_parameter = MB_YES;
-				mb_get_binary_float(SWAPFLAG, &buffer[index], &store->par_roll_bias); index += 4;
-				mb_get_binary_float(SWAPFLAG, &buffer[index], &store->par_pitch_bias); index += 4;
-				mb_get_binary_float(SWAPFLAG, &buffer[index], &store->par_heading_bias); index += 4;
-				mb_get_binary_float(SWAPFLAG, &buffer[index], &store->par_time_delay); index += 4;
-				mb_get_binary_float(SWAPFLAG, &buffer[index], &store->par_trans_x_port); index += 4;
-				mb_get_binary_float(SWAPFLAG, &buffer[index], &store->par_trans_y_port); index += 4;
-				mb_get_binary_float(SWAPFLAG, &buffer[index], &store->par_trans_z_port); index += 4;
-				mb_get_binary_float(SWAPFLAG, &buffer[index], &store->par_trans_x_stbd); index += 4;
-				mb_get_binary_float(SWAPFLAG, &buffer[index], &store->par_trans_y_stbd); index += 4;
-				mb_get_binary_float(SWAPFLAG, &buffer[index], &store->par_trans_z_stbd); index += 4;
-				mb_get_binary_float(SWAPFLAG, &buffer[index], &store->par_trans_err_port); index += 4;
-				mb_get_binary_float(SWAPFLAG, &buffer[index], &store->par_trans_err_stbd); index += 4;
-				mb_get_binary_float(SWAPFLAG, &buffer[index], &store->par_nav_x); index += 4;
-				mb_get_binary_float(SWAPFLAG, &buffer[index], &store->par_nav_y); index += 4;
-				mb_get_binary_float(SWAPFLAG, &buffer[index], &store->par_nav_z); index += 4;
-				mb_get_binary_float(SWAPFLAG, &buffer[index], &store->par_hrp_x); index += 4;
-				mb_get_binary_float(SWAPFLAG, &buffer[index], &store->par_hrp_y); index += 4;
-				mb_get_binary_float(SWAPFLAG, &buffer[index], &store->par_hrp_z); index += 4;
-				}
-
-		    /* handle navigation and motion group */
-		    else if (group_id == MBSYS_XSE_SHP_GROUP_NAVIGATIONANDMOTION)
-				{
-				store->par_navigationandmotion = MB_YES;
-				mb_get_binary_double(SWAPFLAG, &buffer[index], &store->par_nam_roll_bias); index += 8;
-				mb_get_binary_double(SWAPFLAG, &buffer[index], &store->par_nam_pitch_bias); index += 8;
-				mb_get_binary_double(SWAPFLAG, &buffer[index], &store->par_nam_heave_bias); index += 8;
-				mb_get_binary_double(SWAPFLAG, &buffer[index], &store->par_nam_heading_bias); index += 8;
-				mb_get_binary_double(SWAPFLAG, &buffer[index], &store->par_nam_time_delay); index += 8;
-				mb_get_binary_double(SWAPFLAG, &buffer[index], &store->par_nam_nav_x); index += 8;
-				mb_get_binary_double(SWAPFLAG, &buffer[index], &store->par_nam_nav_y); index += 8;
-				mb_get_binary_double(SWAPFLAG, &buffer[index], &store->par_nam_nav_z); index += 8;
-				mb_get_binary_double(SWAPFLAG, &buffer[index], &store->par_nam_hrp_x); index += 8;
-				mb_get_binary_double(SWAPFLAG, &buffer[index], &store->par_nam_hrp_y); index += 8;
-				mb_get_binary_double(SWAPFLAG, &buffer[index], &store->par_nam_hrp_z); index += 8;
-				}
-
-		    /* handle transducer group */
-		    else if (group_id == MBSYS_XSE_SHP_GROUP_TRANSDUCER)
-				{
-				mb_get_binary_int(SWAPFLAG, &buffer[index], &store->par_xdr_num_transducer); index += 4;
-				for (i=0;i<store->par_xdr_num_transducer;i++)
-					{
-					mb_get_binary_int(SWAPFLAG, &buffer[index], &store->par_xdr_sensorid[i]); index += 4;
-					mb_get_binary_int(SWAPFLAG, &buffer[index], (int *) &store->par_xdr_frequency[i]); index += 4;
-					store->par_xdr_transducer[i] = buffer[index]; index++;
-					store->par_xdr_side[i] = buffer[index]; index++;
-					mb_get_binary_double(SWAPFLAG, &buffer[index], &store->par_xdr_mountingroll[i]); index += 8;
-					mb_get_binary_double(SWAPFLAG, &buffer[index], &store->par_xdr_mountingpitch[i]); index += 8;
-					mb_get_binary_double(SWAPFLAG, &buffer[index], &store->par_xdr_mountingazimuth[i]); index += 8;
-					mb_get_binary_double(SWAPFLAG, &buffer[index], &store->par_xdr_mountingdistance[i]); index += 8;
-					mb_get_binary_double(SWAPFLAG, &buffer[index], &store->par_xdr_x[i]); index += 8;
-					mb_get_binary_double(SWAPFLAG, &buffer[index], &store->par_xdr_y[i]); index += 8;
-					mb_get_binary_double(SWAPFLAG, &buffer[index], &store->par_xdr_z[i]); index += 8;
-					mb_get_binary_double(SWAPFLAG, &buffer[index], &store->par_xdr_roll[i]); index += 8;
-					mb_get_binary_double(SWAPFLAG, &buffer[index], &store->par_xdr_pitch[i]); index += 8;
-					mb_get_binary_double(SWAPFLAG, &buffer[index], &store->par_xdr_azimuth[i]); index += 8;
-					}
-				}
-
-		    /* handle tranducer extended group */
-		    else if (group_id == MBSYS_XSE_SHP_GROUP_TRANSDUCEREXTENDED)
-				{
-				mb_get_binary_int(SWAPFLAG, &buffer[index], &store->par_xdx_num_transducer); index += 4;
-				for (i=0;i<store->par_xdx_num_transducer;i++)
-					{
-					store->par_xdx_roll[i] = buffer[index]; index++;
-					store->par_xdx_pitch[i] = buffer[index]; index++;
-					store->par_xdx_azimuth[i] = buffer[index]; index++;
-					index += 48;
-					}
-				}
-			}
-	    }
-
-	/* print debug statements */
-	if (verbose >= 5)
-	    {
-	    fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-	    fprintf(stderr,"dbg5       par_source:          %d\n",store->par_source);
-	    fprintf(stderr,"dbg5       par_sec:             %u\n",store->par_sec);
-	    fprintf(stderr,"dbg5       par_usec:            %u\n",store->par_usec);
-	    fprintf(stderr,"dbg5       par_ship_name:       %s\n",store->par_ship_name);
-	    fprintf(stderr,"dbg5       par_ship_length:     %f\n",store->par_ship_length);
-	    fprintf(stderr,"dbg5       par_ship_beam:       %f\n",store->par_ship_beam);
-	    fprintf(stderr,"dbg5       par_ship_draft:      %f\n",store->par_ship_draft);
-	    fprintf(stderr,"dbg5       par_ship_height:     %f\n",store->par_ship_height);
-	    fprintf(stderr,"dbg5       par_ship_displacement: %f\n",store->par_ship_displacement);
-	    fprintf(stderr,"dbg5       par_ship_weight:     %f\n",store->par_ship_weight);
-	    for (i=0;i<store->par_ship_nsensor;i++)
-		{
-		fprintf(stderr,"dbg5       par_ship_sensor_id[%d]:        %d\n",i,store->par_ship_sensor_id[i]);
-		fprintf(stderr,"dbg5       par_ship_sensor_type[%d]:      %d\n",i,store->par_ship_sensor_type[i]);
-		fprintf(stderr,"dbg5       par_ship_sensor_frequency[%d]: %d\n",i,store->par_ship_sensor_frequency[i]);
-		}
-	    fprintf(stderr,"dbg5       par_parameter:       %d\n",store->par_parameter);
-	    fprintf(stderr,"dbg5       par_roll_bias:       %f\n",store->par_roll_bias);
-	    fprintf(stderr,"dbg5       par_pitch_bias:      %f\n",store->par_pitch_bias);
-	    fprintf(stderr,"dbg5       par_heading_bias:    %f\n",store->par_heading_bias);
-	    fprintf(stderr,"dbg5       par_time_delay:      %f\n",store->par_time_delay);
-	    fprintf(stderr,"dbg5       par_trans_x_port:    %f\n",store->par_trans_x_port);
-	    fprintf(stderr,"dbg5       par_trans_y_port:    %f\n",store->par_trans_y_port);
-	    fprintf(stderr,"dbg5       par_trans_z_port:    %f\n",store->par_trans_z_port);
-	    fprintf(stderr,"dbg5       par_trans_x_stbd:    %f\n",store->par_trans_x_stbd);
-	    fprintf(stderr,"dbg5       par_trans_y_stbd:    %f\n",store->par_trans_y_stbd);
-	    fprintf(stderr,"dbg5       par_trans_z_stbd:    %f\n",store->par_trans_z_stbd);
-	    fprintf(stderr,"dbg5       par_trans_err_port:  %f\n",store->par_trans_err_port);
-	    fprintf(stderr,"dbg5       par_trans_err_stbd:  %f\n",store->par_trans_err_stbd);
-	    fprintf(stderr,"dbg5       par_nav_x:           %f\n",store->par_nav_x);
-	    fprintf(stderr,"dbg5       par_nav_y:           %f\n",store->par_nav_y);
-	    fprintf(stderr,"dbg5       par_nav_z:           %f\n",store->par_nav_z);
-	    fprintf(stderr,"dbg5       par_hrp_x:           %f\n",store->par_hrp_x);
-	    fprintf(stderr,"dbg5       par_hrp_y:           %f\n",store->par_hrp_y);
-	    fprintf(stderr,"dbg5       par_hrp_z:           %f\n",store->par_hrp_z);
-	    fprintf(stderr,"dbg5       par_navigationandmotion: %d\n",store->par_navigationandmotion);
-	    fprintf(stderr,"dbg5       par_nam_roll_bias:       %f\n",store->par_nam_roll_bias);
-	    fprintf(stderr,"dbg5       par_nam_pitch_bias:      %f\n",store->par_nam_pitch_bias);
-	    fprintf(stderr,"dbg5       par_nam_heave_bias:      %f\n",store->par_nam_heave_bias);
-	    fprintf(stderr,"dbg5       par_nam_heading_bias:    %f\n",store->par_nam_heading_bias);
-	    fprintf(stderr,"dbg5       par_nam_time_delay:      %f\n",store->par_nam_time_delay);
-	    fprintf(stderr,"dbg5       par_nam_nav_x:           %f\n",store->par_nam_nav_x);
-	    fprintf(stderr,"dbg5       par_nam_nav_y:           %f\n",store->par_nam_nav_y);
-	    fprintf(stderr,"dbg5       par_nam_nav_z:           %f\n",store->par_nam_nav_z);
-	    fprintf(stderr,"dbg5       par_nam_hrp_x:           %f\n",store->par_nam_hrp_x);
-	    fprintf(stderr,"dbg5       par_nam_hrp_y:           %f\n",store->par_nam_hrp_y);
-	    fprintf(stderr,"dbg5       par_nam_hrp_z:           %f\n",store->par_nam_hrp_z);
-	    fprintf(stderr,"dbg5       par_xdr_num_transducer:  %d\n",store->par_xdr_num_transducer);
-	    fprintf(stderr,"dbg5       # sensor xducer freq side roll pitch azi dist\n");
-	    for (i=0;i<store->par_xdr_num_transducer;i++)
-	    	fprintf(stderr,"dbg5       %d %d %d %d %d %f %f %f %f\n", i, store->par_xdr_sensorid[i], store->par_xdr_transducer[i],
-	    							store->par_xdr_frequency[i], store->par_xdr_side[i],
-								store->par_xdr_mountingroll[i], store->par_xdr_mountingpitch[i],
-								store->par_xdr_mountingazimuth[i], store->par_xdr_mountingdistance[i]);
-	    fprintf(stderr,"dbg5       # x y z roll pitch azimuth\n");
-	    for (i=0;i<store->par_xdr_num_transducer;i++)
-	    	fprintf(stderr,"dbg5       %d %f %f %f %f %f %f\n", i, store->par_xdr_x[i], store->par_xdr_y[i],
-	    							store->par_xdr_z[i], store->par_xdr_roll[i],
-								store->par_xdr_pitch[i], store->par_xdr_azimuth[i]);
-	    fprintf(stderr,"dbg5       par_xdx_num_transducer:  %d\n",store->par_xdx_num_transducer);
-	    fprintf(stderr,"dbg5       # roll pitch azimuth\n");
-	    for (i=0;i<store->par_xdx_num_transducer;i++)
-	    	fprintf(stderr,"dbg5       %d %d %d %d\n", i, store->par_xdx_roll[i], store->par_xdx_pitch[i], store->par_xdx_azimuth[i]);
-	    }
-
-	/* print output debug statements */
-	if (verbose >= 2)
-	    {
-	    fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-		    function_name);
-	    fprintf(stderr,"dbg2  Return values:\n");
-	    fprintf(stderr,"dbg2       error:      %d\n",*error);
-	    fprintf(stderr,"dbg2  Return status:\n");
-	    fprintf(stderr,"dbg2       status:  %d\n",status);
-	    }
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_l3xseraw_rd_sidescan(int verbose,int buffer_size,char *buffer,void *store_ptr,int *error)
-{
-	char	*function_name = "mbr_l3xseraw_rd_sidescan";
-	int	status = MB_SUCCESS;
-	struct mbsys_xse_struct *store;
-	int	byte_count;
-	int	group_id;
-	int	done;
-	int	index;
-	int	ngoodss;
-	double	xmin, xmax, binsize;
-	int	skip;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       buffer_size:%d\n",buffer_size);
-		fprintf(stderr,"dbg2       buffer:     %p\n",(void *)buffer);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to store data structure */
-	store = (struct mbsys_xse_struct *) store_ptr;
-
-	/* get source and time */
-	index = 12;
-	mb_get_binary_int(SWAPFLAG, &buffer[index], (int *) &store->sid_source); index += 4;
-	mb_get_binary_int(SWAPFLAG, &buffer[index], (int *) &store->sid_sec); index += 4;
-	mb_get_binary_int(SWAPFLAG, &buffer[index], (int *) &store->sid_usec); index += 4;
-
-	/* loop over groups */
-	done = MB_NO;
-	while (index <= buffer_size
-		&& status == MB_SUCCESS
-		&& done == MB_NO)
-	    {
-	    /* look for group start or frame end */
-	    skip = 0;
-#ifdef DATAINPCBYTEORDER
-	    while (index < buffer_size
-			&& strncmp(&buffer[index], "GSH$", 4)
-			&& strncmp(&buffer[index], "FSH#", 4))
-			{
-			index++;
-			skip++;
-			}
-	    if (index >= buffer_size
-			|| !strncmp(&buffer[index], "FSH#", 4))
-			done = MB_YES;
-	    else
-			index += 4;
-#else
-	    while (index < buffer_size
-			&& strncmp(&buffer[index], "$HSG", 4)
-			&& strncmp(&buffer[index], "#HSF", 4))
-			{
-			index++;
-			skip++;
-			}
-	    if (index >= buffer_size
-			|| !strncmp(&buffer[index], "#HSF", 4))
-			done = MB_YES;
-	    else
-			index += 4;
-#endif
-
-#ifdef MB_DEBUG
-if (skip > 4) fprintf(stderr, "%s:%d | skipped %d bytes in function <%s>\n",__FILE__,__LINE__, skip-4, function_name);
-#endif
-
-	    /* deal with group */
-	    if (done == MB_NO)
-			{
-			/* get group size and id */
-			mb_get_binary_int(SWAPFLAG, &buffer[index], (int *) &byte_count); index += 4;
-			mb_get_binary_int(SWAPFLAG, &buffer[index], (int *) &group_id); index += 4;
-
-			/* print debug statements */
-			if (verbose >= 5)
-			    {
-			    fprintf(stderr,"\ndbg5  Group %d of %d bytes to be parsed in MBIO function <%s>\n",
-				    group_id, byte_count, function_name);
-			    }
-#ifdef MB_DEBUG
-fprintf(stderr, "%s:%d | Group %d of %d bytes to be parsed in MBIO function <%s>\n",__FILE__,__LINE__,
-				    group_id, byte_count, function_name);
-#endif
-
-			/* handle general group */
-			if (group_id == MBSYS_XSE_SSN_GROUP_GEN)
-				{
-#ifdef MB_DEBUG
-fprintf(stderr, "%s:%d | READ SSN_GROUP_GEN\n",__FILE__,__LINE__);
-#endif
-				mb_get_binary_int(SWAPFLAG, &buffer[index], (int *) &store->sid_ping); index += 4;
-				mb_get_binary_float(SWAPFLAG, &buffer[index], &store->sid_frequency); index += 4;
-				mb_get_binary_float(SWAPFLAG, &buffer[index], &store->sid_pulse); index += 4;
-				mb_get_binary_float(SWAPFLAG, &buffer[index], &store->sid_power); index += 4;
-				mb_get_binary_float(SWAPFLAG, &buffer[index], &store->sid_bandwidth); index += 4;
-				mb_get_binary_float(SWAPFLAG, &buffer[index], &store->sid_sample); index += 4;
-#ifdef MB_DEBUG2
-fprintf(stderr, "ping=%u\n", store->sid_ping);
-fprintf(stderr, "frequency=%g\n", store->sid_frequency);
-fprintf(stderr, "pulse=%g\n", store->sid_pulse);
-fprintf(stderr, "power=%g\n", store->sid_power);
-fprintf(stderr, "bandwidth=%g\n", store->sid_bandwidth);
-fprintf(stderr, "sample=%g\n", store->sid_sample);
-#endif
-				}
-
-			/* handle amplitude vs traveltime group */
-			else if (group_id == MBSYS_XSE_SSN_GROUP_AMPVSTT)
-				{
-#ifdef MB_DEBUG
-fprintf(stderr, "%s:%d | READ SSN_GROUP_AMPVSTT\n",__FILE__,__LINE__);
-#endif
-				mb_get_binary_int(SWAPFLAG, &buffer[index], (int *) &store->sid_avt_sampleus); index += 4;
-				mb_get_binary_int(SWAPFLAG, &buffer[index], &store->sid_avt_offset); index += 4;
-				mb_get_binary_int(SWAPFLAG, &buffer[index], &store->sid_avt_num_samples); index += 4;
-				for (i=0;i<store->sid_avt_num_samples;i++)
-				    if (i < MBSYS_XSE_MAXPIXELS)
-						{
-						mb_get_binary_short(SWAPFLAG, &buffer[index], &store->sid_avt_amp[i]); index += 2;
-						}
-				store->sid_group_avt = MB_YES;
-#ifdef MB_DEBUG2
-fprintf(stderr, "sid_avt_sampleus=%d\n", store->sid_avt_sampleus);
-fprintf(stderr, "sid_avt_offset=%d\n", store->sid_avt_offset);
-fprintf(stderr, "sid_avt_num_samples=%d\n", store->sid_avt_num_samples);
-for (i=0;i<store->sid_avt_num_samples;i++)
-	fprintf(stderr, "sid_avt_amp[%d]:%d\n", i, store->sid_avt_amp[i]);
-#endif
-				}
-
-			/* handle phase vs traveltime group */
-			else if (group_id == MBSYS_XSE_SSN_GROUP_PHASEVSTT)
-				{
-#ifdef MB_DEBUG
-fprintf(stderr, "%s:%d | READ SSN_GROUP_PHASEVSTT\n",__FILE__,__LINE__);
-#endif
-				mb_get_binary_int(SWAPFLAG, &buffer[index], (int *) &store->sid_pvt_sampleus); index += 4;
-				mb_get_binary_int(SWAPFLAG, &buffer[index], &store->sid_pvt_offset); index += 4;
-				mb_get_binary_int(SWAPFLAG, &buffer[index], &store->sid_pvt_num_samples); index += 4;
-				for (i=0;i<store->sid_pvt_num_samples;i++)
-				    if (i < MBSYS_XSE_MAXPIXELS)
-						{
-						mb_get_binary_short(SWAPFLAG, &buffer[index], &store->sid_pvt_phase[i]); index += 2;
-						}
-				store->sid_group_pvt = MB_YES;
-#ifdef MB_DEBUG2
-fprintf(stderr, "sid_pvt_sampleus=%d\n", store->sid_pvt_sampleus);
-fprintf(stderr, "sid_pvt_offset=%d\n", store->sid_pvt_offset);
-fprintf(stderr, "sid_pvt_num_samples=%d\n", store->sid_pvt_num_samples);
-for (i=0;i<store->sid_pvt_num_samples;i++)
-	fprintf(stderr, "sid_pvt_phase[%d]:%d\n", i, store->sid_pvt_phase[i]);
-#endif
-				}
-
-		    /* handle amplitude vs lateral group */
-		    else if (group_id == MBSYS_XSE_SSN_GROUP_AMPVSLAT)
-				{
-#ifdef MB_DEBUG
-fprintf(stderr, "%s:%d | READ SSN_GROUP_AMPVSLAT\n",__FILE__,__LINE__);
-#endif
-				mb_get_binary_int(SWAPFLAG, &buffer[index], (int *) &store->sid_avl_binsize); index += 4;
-				mb_get_binary_int(SWAPFLAG, &buffer[index], (int *) &store->sid_avl_offset); index += 4;
-				mb_get_binary_int(SWAPFLAG, &buffer[index], (int *) &store->sid_avl_num_samples); index += 4;
-				for (i=0;i<store->sid_avl_num_samples;i++)
-				    if (i < MBSYS_XSE_MAXPIXELS)
-						{
-						mb_get_binary_short(SWAPFLAG, &buffer[index], &store->sid_avl_amp[i]); index += 2;
-						}
-				store->sid_group_avl = MB_YES;
-#ifdef MB_DEBUG2
-fprintf(stderr, "sid_avl_binsize=%d\n", store->sid_avl_binsize);
-fprintf(stderr, "sid_avl_offset=%d\n", store->sid_avl_offset);
-fprintf(stderr, "sid_avl_num_samples=%d\n", store->sid_avl_num_samples);
-for (i=0;i<store->sid_avl_num_samples;i++)
-	fprintf(stderr, "sid_avl_amp[%d]:%d\n", i, store->sid_avl_amp[i]);
-#endif
-				}
-
-			else if (group_id == MBSYS_XSE_SSN_GROUP_PHASEVSLAT)
-				{
-#ifdef MB_DEBUG
-fprintf(stderr, "%s:%d | READ SSN_GROUP_PHASEVSLAT\n",__FILE__,__LINE__);
-#endif
-				mb_get_binary_int(SWAPFLAG, &buffer[index], (int *) &store->sid_pvl_binsize); index += 4;
-				mb_get_binary_int(SWAPFLAG, &buffer[index], (int *) &store->sid_pvl_offset); index += 4;
-				mb_get_binary_int(SWAPFLAG, &buffer[index], (int *) &store->sid_pvl_num_samples); index += 4;
-				for (i=0;i<store->sid_pvl_num_samples;i++)
-				    if (i < MBSYS_XSE_MAXPIXELS)
-						{
-						mb_get_binary_short(SWAPFLAG, &buffer[index], &store->sid_pvl_phase[i]); index += 2;
-						}
-				store->sid_group_pvl = MB_YES;
-#ifdef MB_DEBUG2
-fprintf(stderr, "sid_pvl_binsize=%d\n", store->sid_pvl_binsize);
-fprintf(stderr, "sid_pvl_offset=%d\n", store->sid_pvl_offset);
-fprintf(stderr, "sid_pvl_num_samples=%d\n", store->sid_pvl_num_samples);
-for (i=0;i<store->sid_pvl_num_samples;i++)
-	fprintf(stderr, "sid_pvl_phase[%d]:%d\n", i, store->sid_pvl_phase[i]);
-#endif
-				}
-
-			else if (group_id == MBSYS_XSE_SSN_GROUP_SIGNAL)
-				{
-#ifdef MB_DEBUG
-fprintf(stderr, "%s:%d | READ MBSYS_XSE_SSN_GROUP_SIGNAL\n",__FILE__,__LINE__);
-#endif
-				mb_get_binary_int(SWAPFLAG, &buffer[index], (int *) &store->sid_sig_ping); index += 4;
-				mb_get_binary_int(SWAPFLAG, &buffer[index], (int *) &store->sid_sig_channel); index += 4;
-				mb_get_binary_double(SWAPFLAG, &buffer[index], (double *) &store->sid_sig_offset); index += 8;
-				mb_get_binary_double(SWAPFLAG, &buffer[index], (double *) &store->sid_sig_sample); index += 8;
-				mb_get_binary_int(SWAPFLAG, &buffer[index], (int *) &store->sid_sig_num_samples); index += 4;
-				for (i=0;i<store->sid_sig_num_samples;i++)
-				    if (i < MBSYS_XSE_MAXPIXELS)
-						{
-						mb_get_binary_short(SWAPFLAG, &buffer[index], &store->sid_sig_phase[i]); index += 2;
-						}
-				store->sid_group_signal = MB_YES;
-#ifdef MB_DEBUG2
-fprintf(stderr, "sid_sig_ping=%d\n", store->sid_sig_ping);
-fprintf(stderr, "sid_sig_channel=%d\n", store->sid_sig_channel);
-fprintf(stderr, "sid_sig_offset=%g\n", store->sid_sig_offset);
-fprintf(stderr, "sid_sig_sample=%g\n", store->sid_sig_sample);
-fprintf(stderr, "sid_sig_num_samples=%d\n", store->sid_sig_num_samples);
-for (i=0;i<store->sid_sig_num_samples;i++)
-	fprintf(stderr, "sid_sig_phase[%d]:%d\n", i, store->sid_sig_phase[i]);
-#endif
-				}
-
-			else if (group_id == MBSYS_XSE_SSN_GROUP_PINGTYPE)
-				{
-#ifdef MB_DEBUG
-fprintf(stderr, "%s:%d | READ MBSYS_XSE_SSN_GROUP_PINGTYPE\n",__FILE__,__LINE__);
-#endif
-				mb_get_binary_int(SWAPFLAG, &buffer[index], (int *) &store->sid_png_pulse); index += 4;
-				mb_get_binary_double(SWAPFLAG, &buffer[index], (double *) &store->sid_png_startfrequency); index += 8;
-				mb_get_binary_double(SWAPFLAG, &buffer[index], (double *) &store->sid_png_endfrequency); index += 8;
-				mb_get_binary_double(SWAPFLAG, &buffer[index], (double *) &store->sid_png_duration); index += 8;
-				mb_get_binary_int(SWAPFLAG, &buffer[index], (int *) &store->sid_png_mancode); index += 4;
-				mb_get_binary_int(SWAPFLAG, &buffer[index], (int *) &store->sid_png_pulseid); index += 4;
-				for (i=0;i<byte_count-40;i++)
-					{
-					store->sid_png_pulsename[i] = buffer[index]; index++;
-					}
-				store->sid_group_ping = MB_YES;
-#ifdef MB_DEBUG2
-fprintf(stderr, "sid_png_pulse=%d\n", store->sid_png_pulse);
-fprintf(stderr, "sid_png_startfrequency=%f\n", store->sid_png_startfrequency);
-fprintf(stderr, "sid_png_endfrequency=%f\n", store->sid_png_endfrequency);
-fprintf(stderr, "sid_png_duration=%f\n", store->sid_png_duration);
-fprintf(stderr, "sid_png_mancode=%d\n", store->sid_png_mancode);
-fprintf(stderr, "sid_png_pulseid=%d\n", store->sid_png_pulseid);
-fprintf(stderr, "sid_png_pulsename=%s\n", store->sid_png_pulsename);
-#endif
-				}
-
-			else if (group_id == MBSYS_XSE_SSN_GROUP_COMPLEXSIGNAL)
-				{
-#ifdef MB_DEBUG
-fprintf(stderr, "%s:%d | READ MBSYS_XSE_SSN_GROUP_COMPLEXSIGNAL\n",__FILE__,__LINE__);
-#endif
-				mb_get_binary_int(SWAPFLAG, &buffer[index], (int *) &store->sid_cmp_ping); index += 4;
-				mb_get_binary_int(SWAPFLAG, &buffer[index], (int *) &store->sid_cmp_channel); index += 4;
-				mb_get_binary_double(SWAPFLAG, &buffer[index], (double *) &store->sid_cmp_offset); index += 8;
-				mb_get_binary_double(SWAPFLAG, &buffer[index], (double *) &store->sid_cmp_sample); index += 8;
-				mb_get_binary_int(SWAPFLAG, &buffer[index], (int *) &store->sid_cmp_num_samples); index += 4;
-				for (i=0;i<store->sid_cmp_num_samples;i++)
-				    if (i < MBSYS_XSE_MAXPIXELS)
-						{
-						mb_get_binary_short(SWAPFLAG, &buffer[index], &store->sid_cmp_real[i]); index += 2;
-						mb_get_binary_short(SWAPFLAG, &buffer[index], &store->sid_cmp_imaginary[i]); index += 2;
-						}
-				store->sid_group_complex = MB_YES;
-#ifdef MB_DEBUG2
-fprintf(stderr, "sid_cmp_ping=%d\n", store->sid_cmp_ping);
-fprintf(stderr, "sid_cmp_channel=%d\n", store->sid_cmp_channel);
-fprintf(stderr, "sid_cmp_offset=%f\n", store->sid_cmp_offset);
-fprintf(stderr, "sid_cmp_sample=%f\n", store->sid_cmp_sample);
-fprintf(stderr, "sid_cmp_num_samples=%d\n", store->sid_cmp_num_samples);
-for (i=0;i<store->sid_cmp_num_samples;i++)
-	fprintf(stderr, "sid_cmp_real[%d]:%d sid_cmp_imaginary[%d]:%d\n", i, store->sid_cmp_real[i], i, store->sid_cmp_imaginary[i]);
-#endif
-				}
-
-			else if (group_id == MBSYS_XSE_SSN_GROUP_WEIGHTING)
-				{
-#ifdef MB_DEBUG
-fprintf(stderr, "%s:%d | READ MBSYS_XSE_SSN_GROUP_WEIGHTING\n",__FILE__,__LINE__);
-#endif
-				mb_get_binary_short(SWAPFLAG, &buffer[index], (short *) &store->sid_wgt_factorleft); index += 2;
-				mb_get_binary_int(SWAPFLAG, &buffer[index], (int *) &store->sid_wgt_samplesleft); index += 4;
-				mb_get_binary_short(SWAPFLAG, &buffer[index], (short *) &store->sid_wgt_factorright); index += 2;
-				mb_get_binary_int(SWAPFLAG, &buffer[index], (int *) &store->sid_wgt_samplesright); index += 4;
-				store->sid_group_weighting = MB_YES;
-#ifdef MB_DEBUG2
-fprintf(stderr, "sid_wgt_factorleft=%d\n", store->sid_wgt_factorleft);
-fprintf(stderr, "sid_wgt_samplesleft=%d\n", store->sid_wgt_samplesleft);
-fprintf(stderr, "sid_wgt_factorright=%d\n", store->sid_wgt_factorright);
-fprintf(stderr, "sid_wgt_samplesright=%d\n", store->sid_wgt_samplesright);
-#endif
-				}
-
-			else
-				{
-#ifdef MB_DEBUG
-fprintf(stderr, "%s:%d | READ SSN_GROUP_OTHER\n",__FILE__,__LINE__);
-#endif
-				}
-			}
-	    }
-
-	/* now if multibeam already read but bin size lacking then
-	   calculate bin size from bathymetry */
-	if (store->mul_frame == MB_YES
-	    && store->mul_num_beams > 1
-	    && store->sid_avl_num_samples > 1
-	    && store->sid_avl_binsize <= 0)
-	    {
-	    /* get width of bathymetry swath size */
-	    xmin = 9999999.9;
-	    xmax = -9999999.9;
-	    for (i=0;i<store->mul_num_beams;i++)
-			{
-			xmin = MIN(xmin, store->beams[i].lateral);
-			xmax = MAX(xmax, store->beams[i].lateral);
-			}
-
-	    /* get number of nonzero pixels */
-	    ngoodss = 0;
-	    for (i=0;i<store->sid_avl_num_samples;i++)
-			if (store->sid_avl_amp[i] != 0) ngoodss++;
-
-	    /* get bin size */
-	    if (xmax > xmin && ngoodss > 1)
-			{
-			binsize = (xmax - xmin) / (ngoodss - 1);
-			store->sid_avl_binsize = 1000 * binsize;
-			}
-	    }
-
-	/* print debug statements */
-	if (verbose >= 5)
-	    {
-	    fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-	    fprintf(stderr,"dbg5       sid_frame:            %d\n",store->sid_frame);
-	    fprintf(stderr,"dbg5       sid_group_avt:        %d\n",store->sid_group_avt);
-	    fprintf(stderr,"dbg5       sid_group_pvt:        %d\n",store->sid_group_pvt);
-	    fprintf(stderr,"dbg5       sid_group_avl:        %d\n",store->sid_group_avl);
-	    fprintf(stderr,"dbg5       sid_group_pvl:        %d\n",store->sid_group_pvl);
-	    fprintf(stderr,"dbg5       sid_group_signal:     %d\n",store->sid_group_signal);
-	    fprintf(stderr,"dbg5       sid_group_ping:       %d\n",store->sid_group_ping);
-	    fprintf(stderr,"dbg5       sid_group_complex:    %d\n",store->sid_group_complex);
-	    fprintf(stderr,"dbg5       sid_group_weighting:  %d\n",store->sid_group_weighting);
-	    fprintf(stderr,"dbg5       sid_source:           %d\n",store->sid_source);
-	    fprintf(stderr,"dbg5       sid_sec:              %d\n",store->sid_sec);
-	    fprintf(stderr,"dbg5       sid_usec:             %u\n",store->sid_usec);
-	    fprintf(stderr,"dbg5       sid_ping:             %u\n",store->sid_ping);
-	    fprintf(stderr,"dbg5       sid_frequency:        %f\n",store->sid_frequency);
-	    fprintf(stderr,"dbg5       sid_pulse:            %f\n",store->sid_pulse);
-	    fprintf(stderr,"dbg5       sid_power:            %f\n",store->sid_power);
-	    fprintf(stderr,"dbg5       sid_bandwidth:        %f\n",store->sid_bandwidth);
-	    fprintf(stderr,"dbg5       sid_sample:           %f\n",store->sid_sample);
-	    fprintf(stderr,"dbg5       sid_avt_sampleus:     %d\n",store->sid_avt_sampleus);
-	    fprintf(stderr,"dbg5       sid_avt_offset:       %d\n",store->sid_avt_offset);
-	    fprintf(stderr,"dbg5       sid_avt_num_samples:  %d\n",store->sid_avt_num_samples);
-	    for (i=0;i<store->sid_avt_num_samples;i++)
-	    	fprintf(stderr,"dbg5       sid_avt_amp[%d]:%d\n",i,store->sid_avt_amp[i]);
-	    fprintf(stderr,"dbg5       sid_pvt_sampleus:  %d\n",store->sid_pvt_sampleus);
-	    fprintf(stderr,"dbg5       sid_pvt_offset:  %d\n",store->sid_pvt_offset);
-	    fprintf(stderr,"dbg5       sid_pvt_num_samples:  %d\n",store->sid_pvt_num_samples);
-	    for (i=0;i<store->sid_pvt_num_samples;i++)
-	    	fprintf(stderr,"dbg5       sid_pvt_phase[%d]:%d\n",i,store->sid_pvt_phase[i]);
-	    fprintf(stderr,"dbg5       sid_avl_binsize:  %d\n",store->sid_avl_binsize);
-	    fprintf(stderr,"dbg5       sid_avl_offset:  %d\n",store->sid_avl_offset);
-	    fprintf(stderr,"dbg5       sid_avl_num_samples:  %d\n",store->sid_avl_num_samples);
-	    for (i=0;i<store->sid_avl_num_samples;i++)
-	    	fprintf(stderr,"dbg5       sid_avl_amp[%d]:%d\n",i,store->sid_avl_amp[i]);
-	    fprintf(stderr,"dbg5       sid_pvl_binsize:  %d\n",store->sid_pvl_binsize);
-	    fprintf(stderr,"dbg5       sid_pvl_offset:  %d\n",store->sid_pvl_offset);
-	    fprintf(stderr,"dbg5       sid_pvl_num_samples:  %d\n",store->sid_pvl_num_samples);
-	    for (i=0;i<store->sid_pvl_num_samples;i++)
-	    	fprintf(stderr,"dbg5       sid_pvl_phase[%d]:%d\n",i,store->sid_pvl_phase[i]);
-	    fprintf(stderr,"dbg5       sid_sig_ping:  %d\n",store->sid_sig_ping);
-	    fprintf(stderr,"dbg5       sid_sig_channel:  %d\n",store->sid_sig_channel);
-	    fprintf(stderr,"dbg5       sid_sig_offset:  %f\n",store->sid_sig_offset);
-	    fprintf(stderr,"dbg5       sid_sig_sample:  %f\n",store->sid_sig_sample);
-	    fprintf(stderr,"dbg5       sid_sig_num_samples:  %d\n",store->sid_sig_num_samples);
-	    for (i=0;i<store->sid_sig_num_samples;i++)
-	    	fprintf(stderr,"dbg5       sid_sig_phase[%d]:%d\n",i,store->sid_sig_phase[i]);
-	    fprintf(stderr,"dbg5       sid_png_pulse:  %u\n",store->sid_png_pulse);
-	    fprintf(stderr,"dbg5       sid_png_startfrequency:  %f\n",store->sid_png_startfrequency);
-	    fprintf(stderr,"dbg5       sid_png_endfrequency:  %f\n",store->sid_png_endfrequency);
-	    fprintf(stderr,"dbg5       sid_png_duration:  %f\n",store->sid_png_duration);
-	    fprintf(stderr,"dbg5       sid_png_mancode:  %d\n",store->sid_png_mancode);
-	    fprintf(stderr,"dbg5       sid_png_pulseid:  %d\n",store->sid_png_pulseid);
-	    fprintf(stderr,"dbg5       sid_png_pulsename:  %s\n",store->sid_png_pulsename);
-	    fprintf(stderr,"dbg5       sid_cmp_ping:  %d\n",store->sid_cmp_ping);
-	    fprintf(stderr,"dbg5       sid_cmp_channel:  %d\n",store->sid_cmp_channel);
-	    fprintf(stderr,"dbg5       sid_cmp_offset:  %f\n",store->sid_cmp_offset);
-	    fprintf(stderr,"dbg5       sid_cmp_sample:  %f\n",store->sid_cmp_sample);
-	    fprintf(stderr,"dbg5       sid_cmp_num_samples:  %d\n",store->sid_cmp_num_samples);
-	    for (i=0;i<store->sid_sig_num_samples;i++)
-	    	fprintf(stderr,"dbg5       sid_cmp_real[%d]:%d sid_cmp_imaginary[%d]:%d\n",
-				i,store->sid_cmp_real[i],i,store->sid_cmp_imaginary[i]);
-	    fprintf(stderr,"dbg5       sid_wgt_factorleft:  %d\n",store->sid_wgt_factorleft);
-	    fprintf(stderr,"dbg5       sid_wgt_samplesleft:  %d\n",store->sid_wgt_samplesleft);
-	    fprintf(stderr,"dbg5       sid_wgt_factorright:  %d\n",store->sid_wgt_factorright);
-	    fprintf(stderr,"dbg5       sid_wgt_samplesright:  %d\n",store->sid_wgt_samplesright);
-	    }
-
-	/* print output debug statements */
-	if (verbose >= 2)
-	    {
-	    fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-		    function_name);
-	    fprintf(stderr,"dbg2  Return values:\n");
-	    fprintf(stderr,"dbg2       error:      %d\n",*error);
-	    fprintf(stderr,"dbg2  Return status:\n");
-	    fprintf(stderr,"dbg2       status:  %d\n",status);
-	    }
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_l3xseraw_rd_multibeam(int verbose,int buffer_size,char *buffer,void *store_ptr,int *error)
-{
-	char	*function_name = "mbr_l3xseraw_rd_multibeam";
-	int	status = MB_SUCCESS;
-	struct mbsys_xse_struct *store;
-	int	byte_count;
-	int	group_id;
-	int	done;
-	int	index;
-	double	alpha, beta, theta, phi;
-	double	rr, xx, zz;
-	double	xmin, xmax, binsize;
-	int	ngoodss;
-	int	skip;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       buffer_size:%d\n",buffer_size);
-		fprintf(stderr,"dbg2       buffer:     %p\n",(void *)buffer);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to store data structure */
-	store = (struct mbsys_xse_struct *) store_ptr;
-
-	/* set group flags off */
-	store->mul_group_beam = MB_NO;	/* boolean flag - beam group read */
-	store->mul_group_tt = MB_NO;	/* boolean flag - tt group read */
-	store->mul_group_quality = MB_NO;/* boolean flag - quality group read */
-	store->mul_group_amp = MB_NO;	/* boolean flag - amp group read */
-	store->mul_group_delay = MB_NO;	/* boolean flag - delay group read */
-	store->mul_group_lateral = MB_NO;/* boolean flag - lateral group read */
-	store->mul_group_along = MB_NO;	/* boolean flag - along group read */
-	store->mul_group_depth = MB_NO;	/* boolean flag - depth group read */
-	store->mul_group_angle = MB_NO;	/* boolean flag - angle group read */
-	store->mul_group_heave = MB_NO;	/* boolean flag - heave group read */
-	store->mul_group_roll = MB_NO;	/* boolean flag - roll group read */
-	store->mul_group_pitch = MB_NO;	/* boolean flag - pitch group read */
-	store->mul_group_gates = MB_NO;	/* boolean flag - gates group read */
-	store->mul_group_noise = MB_NO;	/* boolean flag - noise group read */
-	store->mul_group_length = MB_NO;	/* boolean flag - length group read */
-	store->mul_group_hits = MB_NO;		/* boolean flag - hits group read */
-	store->mul_group_heavereceive = MB_NO;	/* boolean flag - heavereceive group read */
-	store->mul_group_azimuth = MB_NO;	/* boolean flag - azimuth group read */
-	store->mul_group_properties = MB_NO;	/* boolean flag - properties group read */
-	store->mul_group_normamp = MB_NO;	/* boolean flag - normalized amplitude group read */
-	store->mul_group_mbsystemnav = MB_NO;	/* boolean flag - mbsystemnav group read */
-
-	/* get source and time */
-	index = 12;
-	mb_get_binary_int(SWAPFLAG, &buffer[index], (int *) &store->mul_source); index += 4;
-	mb_get_binary_int(SWAPFLAG, &buffer[index], (int *) &store->mul_sec); index += 4;
-	mb_get_binary_int(SWAPFLAG, &buffer[index], (int *) &store->mul_usec); index += 4;
-
-	/* loop over groups */
-	done = MB_NO;
-	while (index <= buffer_size
-		&& status == MB_SUCCESS
-		&& done == MB_NO)
-	    {
-	    /* look for group start or frame end */
-	    skip = 0;
-#ifdef DATAINPCBYTEORDER
-	    while (index < buffer_size
-			&& strncmp(&buffer[index], "GSH$", 4)
-			&& strncmp(&buffer[index], "FSH#", 4))
-			{
-			index++;
-			skip++;
-			}
-	    if (index >= buffer_size
-			|| !strncmp(&buffer[index], "FSH#", 4))
-			done = MB_YES;
-	    else
-			index += 4;
-#else
-	    while (index < buffer_size
-			&& strncmp(&buffer[index], "$HSG", 4)
-			&& strncmp(&buffer[index], "#HSF", 4))
-			{
-			index++;
-			skip++;
-			}
-	    if (index >= buffer_size
-			|| !strncmp(&buffer[index], "#HSF", 4))
-			done = MB_YES;
-	    else
-			index += 4;
-#endif
-
-#ifdef MB_DEBUG
-if (skip > 4) fprintf(stderr, "%s:%d | skipped %d bytes in function <%s>\n",__FILE__,__LINE__, skip-4, function_name);
-#endif
-
-	    /* deal with group */
-	    if (done == MB_NO)
-			{
-			/* get group size and id */
-			mb_get_binary_int(SWAPFLAG, &buffer[index], (int *) &byte_count); index += 4;
-			mb_get_binary_int(SWAPFLAG, &buffer[index], (int *) &group_id); index += 4;
-
-			/* print debug statements */
-			if (verbose >= 5)
-			    {
-			    fprintf(stderr,"\ndbg5  Group %d of %d bytes to be parsed in MBIO function <%s>\n",
-				    group_id, byte_count, function_name);
-			    }
-#ifdef MB_DEBUG
-fprintf(stderr, "%s:%d | Group %d of %d bytes to be parsed in MBIO function <%s>\n",__FILE__,__LINE__,
-				    group_id, byte_count, function_name);
-#endif
-
-		    /* handle general group */
-		    if (group_id == MBSYS_XSE_MBM_GROUP_GEN)
-				{
-#ifdef MB_DEBUG
-fprintf(stderr, "%s:%d | READ MBM_GROUP_GEN\n",__FILE__,__LINE__);
-#endif
-				mb_get_binary_int(SWAPFLAG, &buffer[index], (int *) &store->mul_ping); index += 4;
-				mb_get_binary_float(SWAPFLAG, &buffer[index], &store->mul_frequency); index += 4;
-				mb_get_binary_float(SWAPFLAG, &buffer[index], &store->mul_pulse); index += 4;
-				mb_get_binary_float(SWAPFLAG, &buffer[index], &store->mul_power); index += 4;
-				mb_get_binary_float(SWAPFLAG, &buffer[index], &store->mul_bandwidth); index += 4;
-				mb_get_binary_float(SWAPFLAG, &buffer[index], &store->mul_sample); index += 4;
-				mb_get_binary_float(SWAPFLAG, &buffer[index], &store->mul_swath); index += 4;
-#ifdef MB_DEBUG2
-fprintf(stderr, "ping=%u\n", store->mul_ping);
-fprintf(stderr, "frequency=%f\n", store->mul_frequency);
-fprintf(stderr, "pulse=%f\n", store->mul_pulse);
-fprintf(stderr, "power=%f\n", store->mul_power);
-fprintf(stderr, "bandwidth=%f\n", store->mul_bandwidth);
-fprintf(stderr, "sample=%f\n", store->mul_sample);
-fprintf(stderr, "swath=%f\n", store->mul_swath);
-#endif
-				}
-
-		    /* handle beam group */
-		    else if (group_id == MBSYS_XSE_MBM_GROUP_BEAM)
-				{
-#ifdef MB_DEBUG
-fprintf(stderr, "%s:%d | READ MBM_GROUP_BEAM\n",__FILE__,__LINE__);
-#endif
-				store->mul_group_beam = MB_YES;
-				mb_get_binary_int(SWAPFLAG, &buffer[index], (int *) &store->mul_num_beams); index += 4;
-				for (i=0;i<store->mul_num_beams;i++)
-				    {
-				    if (i < MBSYS_XSE_MAXBEAMS)
-						{
-						mb_get_binary_short(SWAPFLAG, &buffer[index], &store->beams[i].beam); index += 2;
-						}
-				    }
-				}
-
-		    /* handle traveltime group */
-		    else if (group_id == MBSYS_XSE_MBM_GROUP_TT)
-				{
-#ifdef MB_DEBUG
-fprintf(stderr, "%s:%d | READ MBM_GROUP_TT\n",__FILE__,__LINE__);
-#endif
-				store->mul_group_tt = MB_YES;
-				mb_get_binary_int(SWAPFLAG, &buffer[index], (int *) &store->mul_num_beams); index += 4;
-				for (i=0;i<store->mul_num_beams;i++)
-				    {
-				    if (i < MBSYS_XSE_MAXBEAMS)
-						{
-						mb_get_binary_double(SWAPFLAG, &buffer[index], &store->beams[i].tt); index += 8;
-						}
-				    }
-#ifdef MB_DEBUG2
-fprintf(stderr, "N=%u\n", store->mul_num_beams);
-for(i=0;i<store->mul_num_beams;i++)
-	fprintf(stderr, "tt[%d]=%f\n", i, store->beams[i].tt);
-#endif
-				}
-
-		    /* handle quality group */
-		    else if (group_id == MBSYS_XSE_MBM_GROUP_QUALITY)
-				{
-#ifdef MB_DEBUG
-fprintf(stderr, "%s:%d | READ MBM_GROUP_QUALITY\n",__FILE__,__LINE__);
-#endif
-				store->mul_group_quality = MB_YES;
-				mb_get_binary_int(SWAPFLAG, &buffer[index], (int *) &store->mul_num_beams); index += 4;
-				for (i=0;i<store->mul_num_beams;i++)
-				    {
-				    if (i < MBSYS_XSE_MAXBEAMS)
-						store->beams[i].quality = buffer[index++];
-				    }
-#ifdef MB_DEBUG2
-fprintf(stderr, "N=%u\n", store->mul_num_beams);
-for(i=0;i<store->mul_num_beams;i++)
-	fprintf(stderr, "quality[%d]=%u\n", i, store->beams[i].quality);
-#endif
-				}
-
-		    /* handle amplitude group */
-		    else if (group_id == MBSYS_XSE_MBM_GROUP_AMP)
-				{
-#ifdef MB_DEBUG
-fprintf(stderr, "%s:%d | READ MBM_GROUP_AMP\n",__FILE__,__LINE__);
-#endif
-				store->mul_group_amp = MB_YES;
-				mb_get_binary_int(SWAPFLAG, &buffer[index], (int *) &store->mul_num_beams); index += 4;
-				for (i=0;i<store->mul_num_beams;i++)
-				    {
-				    if (i < MBSYS_XSE_MAXBEAMS)
-						{
-						mb_get_binary_short(SWAPFLAG, &buffer[index], &store->beams[i].amplitude); index += 2;
-						}
-				    }
-#ifdef MB_DEBUG2
-fprintf(stderr, "N=%u\n", store->mul_num_beams);
-for(i=0;i<store->mul_num_beams;i++)
-	fprintf(stderr, "amp[%d]=%d\n", i, store->beams[i].amplitude);
-#endif
-				}
-
-		    /* handle delay group */
-		    else if (group_id == MBSYS_XSE_MBM_GROUP_DELAY)
-				{
-#ifdef MB_DEBUG
-fprintf(stderr, "%s:%d | READ MBM_GROUP_DELAY\n",__FILE__,__LINE__);
-#endif
-				store->mul_group_delay = MB_YES;
-				mb_get_binary_int(SWAPFLAG, &buffer[index], (int *) &store->mul_num_beams); index += 4;
-				for (i=0;i<store->mul_num_beams;i++)
-				    {
-				    if (i < MBSYS_XSE_MAXBEAMS)
-						{
-						mb_get_binary_double(SWAPFLAG, &buffer[index], &store->beams[i].delay); index += 8;
-						}
-				    }
-#ifdef MB_DEBUG2
-fprintf(stderr, "N=%u\n", store->mul_num_beams);
-for(i=0;i<store->mul_num_beams;i++)
-	fprintf(stderr, "delay[%d]=%lf\n", i, store->beams[i].delay);
-#endif
-				}
-
-		    /* handle lateral group */
-		    else if (group_id == MBSYS_XSE_MBM_GROUP_LATERAL)
-				{
-#ifdef MB_DEBUG
-fprintf(stderr, "%s:%d | READ MBM_GROUP_LATERAL\n",__FILE__,__LINE__);
-#endif
-				store->mul_group_lateral = MB_YES;
-				mb_get_binary_int(SWAPFLAG, &buffer[index], (int *) &store->mul_num_beams); index += 4;
-				for (i=0;i<store->mul_num_beams;i++)
-				    {
-				    if (i < MBSYS_XSE_MAXBEAMS)
-						{
-						mb_get_binary_double(SWAPFLAG, &buffer[index], &store->beams[i].lateral); index += 8;
-						}
-				    }
-#ifdef MB_DEBUG2
-fprintf(stderr, "N=%u\n", store->mul_num_beams);
-for(i=0;i<store->mul_num_beams;i++)
-	fprintf(stderr, "lateral[%d]=%lf\n", i, store->beams[i].lateral);
-#endif
-				}
-
-		    /* handle along group */
-		    else if (group_id == MBSYS_XSE_MBM_GROUP_ALONG)
-				{
-#ifdef MB_DEBUG
-fprintf(stderr, "%s:%d | READ MBM_GROUP_ALONG\n",__FILE__,__LINE__);
-#endif
-				store->mul_group_along = MB_YES;
-				mb_get_binary_int(SWAPFLAG, &buffer[index], (int *) &store->mul_num_beams); index += 4;
-				for (i=0;i<store->mul_num_beams;i++)
-				    {
-				    if (i < MBSYS_XSE_MAXBEAMS)
-						{
-						mb_get_binary_double(SWAPFLAG, &buffer[index], &store->beams[i].along); index += 8;
-						}
-				    }
-#ifdef MB_DEBUG2
-fprintf(stderr, "N=%u\n", store->mul_num_beams);
-for(i=0;i<store->mul_num_beams;i++)
-	fprintf(stderr, "along[%d]=%lf\n", i, store->beams[i].along);
-#endif
-				}
-
-		    /* handle depth group */
-		    else if (group_id == MBSYS_XSE_MBM_GROUP_DEPTH)
-				{
-#ifdef MB_DEBUG
-fprintf(stderr, "%s:%d | READ MBM_GROUP_DEPTH\n",__FILE__,__LINE__);
-#endif
-				store->mul_group_depth = MB_YES;
-				mb_get_binary_int(SWAPFLAG, &buffer[index], (int *) &store->mul_num_beams); index += 4;
-				for (i=0;i<store->mul_num_beams;i++)
-				    {
-				    if (i < MBSYS_XSE_MAXBEAMS)
-						{
-						mb_get_binary_double(SWAPFLAG, &buffer[index], &store->beams[i].depth); index += 8;
-						}
-				    }
-#ifdef MB_DEBUG2
-fprintf(stderr, "N=%u\n", store->mul_num_beams);
-for(i=0;i<store->mul_num_beams;i++)
-	fprintf(stderr, "depth[%d]=%lf\n", i, store->beams[i].depth);
-#endif
-				}
-
-		    /* handle angle group */
-		    else if (group_id == MBSYS_XSE_MBM_GROUP_ANGLE)
-				{
-#ifdef MB_DEBUG
-fprintf(stderr, "%s:%d | READ MBM_GROUP_ANGLE\n",__FILE__,__LINE__);
-#endif
-				store->mul_group_angle = MB_YES;
-				mb_get_binary_int(SWAPFLAG, &buffer[index], (int *) &store->mul_num_beams); index += 4;
-				for (i=0;i<store->mul_num_beams;i++)
-				    {
-				    if (i < MBSYS_XSE_MAXBEAMS)
-						{
-						mb_get_binary_double(SWAPFLAG, &buffer[index], &store->beams[i].angle); index += 8;
-						}
-				    }
-#ifdef MB_DEBUG2
-fprintf(stderr, "N=%u\n", store->mul_num_beams);
-for(i=0;i<store->mul_num_beams;i++)
-	fprintf(stderr, "angle[%d]=%lf\n", i, store->beams[i].angle);
-#endif
-				}
-
-		    /* handle heave group */
-		    else if (group_id == MBSYS_XSE_MBM_GROUP_HEAVE)
-				{
-#ifdef MB_DEBUG
-fprintf(stderr, "%s:%d | READ MBM_GROUP_HEAVE\n",__FILE__,__LINE__);
-#endif
-				store->mul_group_heave = MB_YES;
-				mb_get_binary_int(SWAPFLAG, &buffer[index], (int *) &store->mul_num_beams); index += 4;
-				for (i=0;i<store->mul_num_beams;i++)
-				    {
-				    if (i < MBSYS_XSE_MAXBEAMS)
-						{
-						mb_get_binary_double(SWAPFLAG, &buffer[index], &store->beams[i].heave); index += 8;
-						}
-				    }
-#ifdef MB_DEBUG2
-fprintf(stderr, "N=%u\n", store->mul_num_beams);
-for(i=0;i<store->mul_num_beams;i++)
-	fprintf(stderr, "heave[%d]=%lf\n", i, store->beams[i].heave);
-#endif
-				}
-
-		    /* handle roll group */
-		    else if (group_id == MBSYS_XSE_MBM_GROUP_ROLL)
-				{
-#ifdef MB_DEBUG
-fprintf(stderr, "%s:%d | READ MBM_GROUP_ROLL\n",__FILE__,__LINE__);
-#endif
-				store->mul_group_roll = MB_YES;
-				mb_get_binary_int(SWAPFLAG, &buffer[index], (int *) &store->mul_num_beams); index += 4;
-				for (i=0;i<store->mul_num_beams;i++)
-				    {
-				    if (i < MBSYS_XSE_MAXBEAMS)
-						{
-						mb_get_binary_double(SWAPFLAG, &buffer[index], &store->beams[i].roll); index += 8;
-						}
-				    }
-#ifdef MB_DEBUG2
-fprintf(stderr, "N=%u\n", store->mul_num_beams);
-for(i=0;i<store->mul_num_beams;i++)
-	fprintf(stderr, "roll[%d]=%lf\n", i, store->beams[i].roll);
-#endif
-				}
-
-		    /* handle pitch group */
-		    else if (group_id == MBSYS_XSE_MBM_GROUP_PITCH)
-				{
-#ifdef MB_DEBUG
-fprintf(stderr, "%s:%d | READ MBM_GROUP_PITCH\n",__FILE__,__LINE__);
-#endif
-				store->mul_group_pitch = MB_YES;
-				mb_get_binary_int(SWAPFLAG, &buffer[index], (int *) &store->mul_num_beams); index += 4;
-				for (i=0;i<store->mul_num_beams;i++)
-				    {
-				    if (i < MBSYS_XSE_MAXBEAMS)
-						{
-						mb_get_binary_double(SWAPFLAG, &buffer[index], &store->beams[i].pitch); index += 8;
-						}
-				    }
-#ifdef MB_DEBUG2
-fprintf(stderr, "N=%u\n", store->mul_num_beams);
-for(i=0;i<store->mul_num_beams;i++)
-	fprintf(stderr, "pitch[%d]=%lf\n", i, store->beams[i].pitch);
-#endif
-				}
-
-			/* handle gates group */
-			else if (group_id == MBSYS_XSE_MBM_GROUP_GATES)
-				{
-#ifdef MB_DEBUG
-fprintf(stderr, "%s:%d | READ MBM_GROUP_GATES\n",__FILE__,__LINE__);
-#endif
-				store->mul_group_gates = MB_YES;
-				mb_get_binary_int(SWAPFLAG, &buffer[index], (int *) &store->mul_num_beams); index += 4;
-				for (i=0;i<store->mul_num_beams;i++)
-				    {
-				    if (i < MBSYS_XSE_MAXBEAMS)
-						{
-						mb_get_binary_double(SWAPFLAG, &buffer[index], &store->beams[i].gate_angle); index += 8;
-						mb_get_binary_double(SWAPFLAG, &buffer[index], &store->beams[i].gate_start); index += 8;
-						mb_get_binary_double(SWAPFLAG, &buffer[index], &store->beams[i].gate_stop); index += 8;
-						}
-				    }
-#ifdef MB_DEBUG2
-fprintf(stderr, "N=%u\n", store->mul_num_beams);
-for(i=0;i<store->mul_num_beams;i++)
-	fprintf(stderr, "gate_angle[%d]=%lf gate_start[%d]=%lf gate_stop[%d]=%lf\n",
-	    i, store->beams[i].gate_angle, i,store->beams[i].gate_start, i,store->beams[i].gate_stop);
-#endif
-				}
-
-			/* handle noise group */
-			else if (group_id == MBSYS_XSE_MBM_GROUP_NOISE)
-				{
-#ifdef MB_DEBUG
-fprintf(stderr, "%s:%d | READ MBM_GROUP_NOISE\n",__FILE__,__LINE__);
-#endif
-				store->mul_group_noise = MB_YES;
-				mb_get_binary_int(SWAPFLAG, &buffer[index], (int *) &store->mul_num_beams); index += 4;
-				for (i=0;i<store->mul_num_beams;i++)
-				    {
-				    if (i < MBSYS_XSE_MAXBEAMS)
-						{
-						mb_get_binary_float(SWAPFLAG, &buffer[index], &store->beams[i].noise); index += 4;
-						}
-				    }
-#ifdef MB_DEBUG2
-fprintf(stderr, "N=%u\n", store->mul_num_beams);
-for(i=0;i<store->mul_num_beams;i++)
-	fprintf(stderr, "noise[%d]=%f\n", i, store->beams[i].noise);
-#endif
-				}
-
-			/* handle length group */
-			else if (group_id == MBSYS_XSE_MBM_GROUP_LENGTH)
-				{
-#ifdef MB_DEBUG
-fprintf(stderr, "%s:%d | READ MBM_GROUP_LENGTH\n",__FILE__,__LINE__);
-#endif
-				store->mul_group_length = MB_YES;
-				mb_get_binary_int(SWAPFLAG, &buffer[index], (int *) &store->mul_num_beams); index += 4;
-				for (i=0;i<store->mul_num_beams;i++)
-				    {
-				    if (i < MBSYS_XSE_MAXBEAMS)
-						{
-						mb_get_binary_float(SWAPFLAG, &buffer[index], &store->beams[i].length); index += 4;
-						}
-				    }
-#ifdef MB_DEBUG2
-fprintf(stderr, "N=%u\n", store->mul_num_beams);
-for(i=0;i<store->mul_num_beams;i++)
-	fprintf(stderr, "length[%d]=%f\n", i, store->beams[i].length);
-#endif
-				}
-
-			/* handle hits group */
-			else if (group_id == MBSYS_XSE_MBM_GROUP_HITS)
-				{
-#ifdef MB_DEBUG
-fprintf(stderr, "%s:%d | READ MBM_GROUP_HITS\n",__FILE__,__LINE__);
-#endif
-				store->mul_group_hits = MB_YES;
-				mb_get_binary_int(SWAPFLAG, &buffer[index], (int *) &store->mul_num_beams); index += 4;
-				for (i=0;i<store->mul_num_beams;i++)
-				    {
-				    if (i < MBSYS_XSE_MAXBEAMS)
-						{
-						mb_get_binary_int(SWAPFLAG, &buffer[index], (int *) &store->beams[i].hits); index += 4;
-						}
-				    }
-#ifdef MB_DEBUG2
-fprintf(stderr, "N=%u\n", store->mul_num_beams);
-for(i=0;i<store->mul_num_beams;i++)
-	fprintf(stderr, "hits[%d]=%d\n", i, store->beams[i].hits);
-#endif
-				}
-
-			/* handle heavereceive group */
-			else if (group_id == MBSYS_XSE_MBM_GROUP_HEAVERECEIVE)
-				{
-#ifdef MB_DEBUG
-fprintf(stderr, "%s:%d | READ MBM_GROUP_HEAVERECEIVE\n",__FILE__,__LINE__);
-#endif
-				store->mul_group_heavereceive = MB_YES;
-				mb_get_binary_int(SWAPFLAG, &buffer[index], (int *) &store->mul_num_beams); index += 4;
-				for (i=0;i<store->mul_num_beams;i++)
-				    {
-				    if (i < MBSYS_XSE_MAXBEAMS)
-						{
-						mb_get_binary_double(SWAPFLAG, &buffer[index], (double *) &store->beams[i].heavereceive); index += 8;
-						}
-				    }
-#ifdef MB_DEBUG2
-fprintf(stderr, "N=%u\n", store->mul_num_beams);
-for(i=0;i<store->mul_num_beams;i++)
-	fprintf(stderr, "heavereceive[%d]=%f\n", i, store->beams[i].heavereceive);
-#endif
-				}
-
-			/* handle azimuth group */
-			else if (group_id == MBSYS_XSE_MBM_GROUP_AZIMUTH)
-				{
-#ifdef MB_DEBUG
-fprintf(stderr, "%s:%d | READ MBM_GROUP_AZIMUTH\n",__FILE__,__LINE__);
-#endif
-				store->mul_group_azimuth = MB_YES;
-				mb_get_binary_int(SWAPFLAG, &buffer[index], (int *) &store->mul_num_beams); index += 4;
-				for (i=0;i<store->mul_num_beams;i++)
-				    {
-				    if (i < MBSYS_XSE_MAXBEAMS)
-						{
-						mb_get_binary_double(SWAPFLAG, &buffer[index], (double *) &store->beams[i].azimuth); index += 8;
-						}
-				    }
-#ifdef MB_DEBUG2
-fprintf(stderr, "N=%u\n", store->mul_num_beams);
-for(i=0;i<store->mul_num_beams;i++)
-	fprintf(stderr, "azimuth[%d]=%f\n", i, store->beams[i].azimuth);
-#endif
-				}
-
-			/* handle properties group */
-			else if (group_id == MBSYS_XSE_MBM_GROUP_PROPERTIES)
-				{
-#ifdef MB_DEBUG
-fprintf(stderr, "%s:%d | READ MBM_GROUP_PROPERTIES\n",__FILE__,__LINE__);
-#endif
-				store->mul_group_properties = MB_YES;
-				mb_get_binary_int(SWAPFLAG, &buffer[index], (int *) &store->mul_num_properties); index += 4;
-				for (i=0;i<store->mul_num_properties;i++)
-				    {
-				    if (i < MBSYS_XSE_MAXPROPERTIES)
-						{
-						mb_get_binary_short(SWAPFLAG, &buffer[index], (double *) &store->mul_properties_type[i]); index += 2;
-						mb_get_binary_double(SWAPFLAG, &buffer[index], (double *) &store->mul_properties_value); index += 8;
-						}
-				    }
-				for (i=0;i<40;i++)
-				    {
-				    store->mul_properties_reserved[i] = buffer[index]; index++;
-				    }
-#ifdef MB_DEBUG2
-fprintf(stderr, "N=%u\n", store->mul_num_properties);
-for (i=0;i<store->mul_num_properties;i++)
-    fprintf(stderr,"dbg5       mul_properties[%d]: %d %f\n",
-	i, store->mul_properties_type[i], store->mul_properties_value[i]);
-for (i=0;i<40;i++)
-    fprintf(stderr,"dbg5       mul_properties_reserved[%d]: %d\n",
-	i, store->mul_properties_reserved[i]);
-#endif
-				}
-
-			/* handle normalized amplitude group */
-			else if (group_id == MBSYS_XSE_MBM_GROUP_NORMAMP)
-				{
-#ifdef MB_DEBUG
-fprintf(stderr, "%s:%d | READ MBM_GROUP_NORMAMP\n",__FILE__,__LINE__);
-#endif
-				store->mul_group_normamp = MB_YES;
-				mb_get_binary_int(SWAPFLAG, &buffer[index], (int *) &store->mul_normamp_num_beams); index += 4;
-				mb_get_binary_int(SWAPFLAG, &buffer[index], (int *) &store->mul_normamp_flags); index += 4;
-				mb_get_binary_float(SWAPFLAG, &buffer[index], (int *) &store->mul_normamp_along_beamwidth); index += 4;
-				mb_get_binary_float(SWAPFLAG, &buffer[index], (int *) &store->mul_normamp_across_beamwidth); index += 4;
-				for (i=0;i<store->mul_normamp_num_beams;i++)
-				    {
-				    if (i < MBSYS_XSE_MAXBEAMS)
-						{
-						mb_get_binary_short(SWAPFLAG, &buffer[index], (double *) &store->beams[i].normamp); index += 2;
-						}
-				    }
-				if (store->mul_normamp_flags == 0)
-				    {
-				    mb_get_binary_float(SWAPFLAG, &buffer[index], (double *) &store->beams[0].frequency); index += 4;
-				    for (i=1;i<store->mul_normamp_num_beams;i++)
-					{
-					store->beams[i].frequency = store->beams[0].frequency;
-					}
-				    }
-				else
-				    {
-				    for (i=0;i<store->mul_normamp_num_beams;i++)
-					{
-					if (i < MBSYS_XSE_MAXBEAMS)
-						{
-						mb_get_binary_float(SWAPFLAG, &buffer[index], (double *) &store->beams[i].frequency); index += 4;
-						}
-					}
-				    }
-#ifdef MB_DEBUG2
-fprintf(stderr, "N=%u\n", store->mul_num_beams);
-for(i=0;i<store->mul_num_beams;i++)
-	fprintf(stderr, "beam[%d]: normamp=%d frequency=%f\n", i, store->beams[i].normamp, store->beams[i].frequency);
-#endif
-				}
-
-			/* handle mbsystemnav group */
-			else if (group_id == MBSYS_XSE_MBM_GROUP_MBSYSTEMNAV)
-				{
-#ifdef MB_DEBUG
-fprintf(stderr, "%s:%d | READ MBSYS_XSE_MBM_GROUP_MBSYSTEMNAV\n",__FILE__,__LINE__);
-#endif
-				store->mul_group_mbsystemnav = MB_YES;
-				mb_get_binary_double(SWAPFLAG, &buffer[index], (double *) &store->mul_lon); index += 8;
-				mb_get_binary_double(SWAPFLAG, &buffer[index], (double *) &store->mul_lat); index += 8;
-				mb_get_binary_double(SWAPFLAG, &buffer[index], (double *) &store->mul_heading); index += 8;
-				mb_get_binary_double(SWAPFLAG, &buffer[index], (double *) &store->mul_speed); index += 8;
-#ifdef MB_DEBUG2
-fprintf(stderr, "lon=%f\n", store->mul_lon);
-fprintf(stderr, "lat=%f\n", store->mul_lat);
-fprintf(stderr, "heading=%f\n", store->mul_heading);
-fprintf(stderr, "speed=%f\n", store->mul_speed);
-#endif
-				}
-
-			else
-				{
-#ifdef MB_DEBUG
-fprintf(stderr, "%s:%d | READ MBM_GROUP_OTHER  group_id:%d\n",__FILE__,__LINE__, group_id);
-#endif
-				}
-		    }
-		}
-
-	/* now if tt and angles read but bathymetry not read
-	   calculate bathymetry assuming 1500 m/s velocity */
-	if (status == MB_SUCCESS
-	    && store->mul_group_tt == MB_YES
-	    && store->mul_group_angle == MB_YES
-	    && store->mul_group_heave == MB_YES
-	    && store->mul_group_roll == MB_YES
-	    && store->mul_group_pitch == MB_YES
-	    && store->mul_group_depth == MB_NO)
-	    {
-	    store->mul_group_lateral = MB_YES;
-	    store->mul_group_along = MB_YES;
-	    store->mul_group_depth = MB_YES;
-	    for (i=0;i<store->mul_num_beams;i++)
-		{
-		beta = 90.0 - RTD * store->beams[i].angle;
-		alpha = RTD * store->beams[i].pitch;
-		mb_rollpitch_to_takeoff(verbose,
-		    alpha, beta, &theta,
-		    &phi, error);
-		/* divide range by 2 because of round trip travel time */
-		rr = 1500.0 * store->beams[i].tt/2.0;
-		xx = rr * sin(DTR * theta);
-		zz = rr * cos(DTR * theta);
-		store->beams[i].lateral
-			= xx * cos(DTR * phi);
-		store->beams[i].along
-			= xx * sin(DTR * phi)
-		    + 0.5 * store->nav_speed_ground
-			* store->beams[i].delay;
-		store->beams[i].depth = zz;
-		}
-	    }
-
-	/* check for sensible bathymetry */
-	if (status == MB_SUCCESS
-	    && store->mul_group_depth == MB_YES)
-	    {
-	    for (i=0;i<store->mul_num_beams;i++)
-		{
-		if (fabs(store->beams[i].depth) > 11000.0)
-		    {
-		    status = MB_FAILURE;
-		    *error = MB_ERROR_UNINTELLIGIBLE;
-
-		    if (fabs(store->beams[i].heave) > 100.0)
-			store->beams[i].heave = 0.0;
-		    }
-		}
-	    }
-
-	/* now if sidescan already read but bin size lacking then
-	   calculate bin size from bathymetry */
-	if (store->mul_num_beams > 1
-	    && store->sid_frame == MB_YES
-	    && store->sid_avl_num_samples > 1
-	    && store->sid_avl_binsize <= 0)
-	    {
-	    /* get width of bathymetry swath size */
-	    xmin = 9999999.9;
-	    xmax = -9999999.9;
-	    for (i=0;i<store->mul_num_beams;i++)
-			{
-			xmin = MIN(xmin, store->beams[i].lateral);
-			xmax = MAX(xmax, store->beams[i].lateral);
-			}
-
-	    /* get number of nonzero pixels */
-	    ngoodss = 0;
-	    for (i=0;i<store->sid_avl_num_samples;i++)
-			if (store->sid_avl_amp[i] != 0) ngoodss++;
-
-	    /* get bin size */
-	    if (xmax > xmin && ngoodss > 1)
-			{
-			binsize = (xmax - xmin) / (ngoodss - 1);
-			store->sid_avl_binsize = 1000 * binsize;
-			}
-	    }
-
-	/* print debug statements */
-	if (verbose >= 5)
-	    {
-	    fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-	    fprintf(stderr,"dbg5       mul_group_beam:      %d\n",store->mul_group_beam);
-	    fprintf(stderr,"dbg5       mul_group_tt:        %d\n",store->mul_group_tt);
-	    fprintf(stderr,"dbg5       mul_group_quality:   %d\n",store->mul_group_quality);
-	    fprintf(stderr,"dbg5       mul_group_amp:       %d\n",store->mul_group_amp);
-	    fprintf(stderr,"dbg5       mul_group_delay:     %d\n",store->mul_group_delay);
-	    fprintf(stderr,"dbg5       mul_group_lateral:   %d\n",store->mul_group_lateral);
-	    fprintf(stderr,"dbg5       mul_group_along:     %d\n",store->mul_group_along);
-	    fprintf(stderr,"dbg5       mul_group_depth:     %d\n",store->mul_group_depth);
-	    fprintf(stderr,"dbg5       mul_group_angle:     %d\n",store->mul_group_angle);
-	    fprintf(stderr,"dbg5       mul_group_heave:     %d\n",store->mul_group_heave);
-	    fprintf(stderr,"dbg5       mul_group_roll:      %d\n",store->mul_group_roll);
-	    fprintf(stderr,"dbg5       mul_group_pitch:     %d\n",store->mul_group_pitch);
-	    fprintf(stderr,"dbg5       mul_group_gates:     %d\n",store->mul_group_gates);
-	    fprintf(stderr,"dbg5       mul_group_noise:     %d\n",store->mul_group_noise);
-	    fprintf(stderr,"dbg5       mul_group_length:    %d\n",store->mul_group_length);
-	    fprintf(stderr,"dbg5       mul_group_hits:      %d\n",store->mul_group_hits);
-	    fprintf(stderr,"dbg5       mul_group_heavereceive: %d\n",store->mul_group_heavereceive);
-	    fprintf(stderr,"dbg5       mul_group_azimuth:    %d\n",store->mul_group_azimuth);
-	    fprintf(stderr,"dbg5       mul_group_properties: %d\n",store->mul_group_properties);
-	    fprintf(stderr,"dbg5       mul_group_normamp:    %d\n",store->mul_group_normamp);
-	    fprintf(stderr,"dbg5       mul_group_mbsystemnav:  %d\n",store->mul_group_mbsystemnav);
-	    fprintf(stderr,"dbg5       mul_source:          %d\n",store->mul_source);
-	    fprintf(stderr,"dbg5       mul_sec:             %u\n",store->mul_sec);
-	    fprintf(stderr,"dbg5       mul_usec:            %u\n",store->mul_usec);
-	    fprintf(stderr,"dbg5       mul_ping:            %d\n",store->mul_ping);
-	    fprintf(stderr,"dbg5       mul_frequency:       %f\n",store->mul_frequency);
-	    fprintf(stderr,"dbg5       mul_pulse:           %f\n",store->mul_pulse);
-	    fprintf(stderr,"dbg5       mul_power:           %f\n",store->mul_power);
-	    fprintf(stderr,"dbg5       mul_bandwidth:       %f\n",store->mul_bandwidth);
-	    fprintf(stderr,"dbg5       mul_sample:          %f\n",store->mul_sample);
-	    fprintf(stderr,"dbg5       mul_swath:           %f\n",store->mul_swath);
-	    fprintf(stderr,"dbg5       mul_num_beams:       %d\n",store->mul_num_beams);
-	    fprintf(stderr,"dbg5       mul_lon:             %f\n",store->mul_lon);
-	    fprintf(stderr,"dbg5       mul_lat:             %f\n",store->mul_lat);
-	    fprintf(stderr,"dbg5       mul_heading:         %f\n",store->mul_heading);
-	    fprintf(stderr,"dbg5       mul_speed:           %f\n",store->mul_speed);
-	    for (i=0;i<store->mul_num_beams;i++)
-		fprintf(stderr,"dbg5       beam[%d]: %3d %7.2f %7.2f %7.2f %3d %3d %6.3f %6.2f %5.3f %5.2f %6.2f %6.2f  %f %f %f %f %f %d %f %f %d %f\n",
-		    i, store->beams[i].beam,
-		    store->beams[i].lateral,
-		    store->beams[i].along,
-		    store->beams[i].depth,
-		    store->beams[i].amplitude,
-		    store->beams[i].quality,
-		    store->beams[i].tt,
-		    store->beams[i].angle,
-		    store->beams[i].delay,
-		    store->beams[i].heave,
-		    store->beams[i].roll,
-		    store->beams[i].pitch,
-		    store->beams[i].gate_angle,
-		    store->beams[i].gate_start,
-		    store->beams[i].gate_stop,
-		    store->beams[i].noise,
-		    store->beams[i].length,
-		    store->beams[i].hits,
-		    store->beams[i].heavereceive,
-		    store->beams[i].azimuth,
-		    store->beams[i].normamp,
-		    store->beams[i].frequency);
-	    fprintf(stderr,"dbg5       mul_num_properties: %d\n",store->mul_num_properties);
-	    for (i=0;i<store->mul_num_properties;i++)
-		fprintf(stderr,"dbg5       mun_property[%d]: %d %f\n",
-		    i, store->mul_properties_type[i], store->mul_properties_value[i]);
-	    for (i=0;i<40;i++)
-		fprintf(stderr,"dbg5       mul_properties_reserved[%d]: %d\n",
-		    i, store->mul_properties_reserved[i]);
-	    fprintf(stderr,"dbg5       mul_normamp_num_beams:        %d\n",store->mul_normamp_num_beams);
-	    fprintf(stderr,"dbg5       mul_normamp_flags:            %d\n",store->mul_normamp_flags);
-	    fprintf(stderr,"dbg5       mul_normamp_along_beamwidth:  %f\n",store->mul_normamp_along_beamwidth);
-	    fprintf(stderr,"dbg5       mul_normamp_across_beamwidth: %f\n",store->mul_normamp_across_beamwidth);
-	    }
-
-	/* print output debug statements */
-	if (verbose >= 2)
-	    {
-	    fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-		    function_name);
-	    fprintf(stderr,"dbg2  Return values:\n");
-	    fprintf(stderr,"dbg2       error:      %d\n",*error);
-	    fprintf(stderr,"dbg2  Return status:\n");
-	    fprintf(stderr,"dbg2       status:  %d\n",status);
-	    }
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_l3xseraw_rd_singlebeam(int verbose,int buffer_size,char *buffer,void *store_ptr,int *error)
-{
-	char    *function_name = "mbr_l3xseraw_rd_singlebeam";
-	int status = MB_SUCCESS;
-	struct mbsys_xse_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       buffer_size:%d\n",buffer_size);
-		fprintf(stderr,"dbg2       buffer:     %p\n",(void *)buffer);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to store data structure */
-	store = (struct mbsys_xse_struct *) store_ptr;
-
-	/* The singlebeam frame is currently unused by MB-System */
-
-	/* print output debug statements */
-	if (verbose >= 2)
-	    {
-	    fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-		    function_name);
-	    fprintf(stderr,"dbg2  Return values:\n");
-	    fprintf(stderr,"dbg2       error:      %d\n",*error);
-	    fprintf(stderr,"dbg2  Return status:\n");
-	    fprintf(stderr,"dbg2       status:  %d\n",status);
-	    }
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_l3xseraw_rd_message(int verbose,int buffer_size,char *buffer,void *store_ptr,int *error)
-{
-	char    *function_name = "mbr_l3xseraw_rd_message";
-	int status = MB_SUCCESS;
-	struct mbsys_xse_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       buffer_size:%d\n",buffer_size);
-		fprintf(stderr,"dbg2       buffer:     %p\n",(void *)buffer);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to store data structure */
-	store = (struct mbsys_xse_struct *) store_ptr;
-
-	/* The message frame is currently unused by MB-System */
-
-	/* print output debug statements */
-	if (verbose >= 2)
-	    {
-	    fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-		    function_name);
-	    fprintf(stderr,"dbg2  Return values:\n");
-	    fprintf(stderr,"dbg2       error:      %d\n",*error);
-	    fprintf(stderr,"dbg2  Return status:\n");
-	    fprintf(stderr,"dbg2       status:  %d\n",status);
-	    }
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_l3xseraw_rd_seabeam(int verbose,int buffer_size,char *buffer,void *store_ptr,int *error)
-{
-	char    *function_name = "mbr_l3xseraw_rd_seabeam";
-	int status = MB_SUCCESS;
-	struct mbsys_xse_struct *store;
-	int byte_count;
-	int group_id;
-	int done;
-	int index;
-	int	skip;
-	int i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       buffer_size:%d\n",buffer_size);
-		fprintf(stderr,"dbg2       buffer:     %p\n",(void *)buffer);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-
-	/* get pointer to store data structure */
-	store = (struct mbsys_xse_struct *) store_ptr;
-
-	/* get source and time */
-	index = 12;
-	mb_get_binary_int(SWAPFLAG, &buffer[index], (int *) &store->sbm_source); index += 4;
-	mb_get_binary_int(SWAPFLAG, &buffer[index], (int *) &store->sbm_sec); index += 4;
-	mb_get_binary_int(SWAPFLAG, &buffer[index], (int *) &store->sbm_usec); index += 4;
-
-	/* loop over groups */
-	done = MB_NO;
-	while (index <= buffer_size
-		&& status == MB_SUCCESS
-		&& done == MB_NO)
-	    {
-	    /* look for group start or frame end */
-	    skip = 0;
-#ifdef DATAINPCBYTEORDER
-	    while (index < buffer_size
-			&& strncmp(&buffer[index], "GSH$", 4)
-			&& strncmp(&buffer[index], "FSH#", 4))
-			{
-			index++;
-			skip++;
-			}
-	    if (index >= buffer_size
-			|| !strncmp(&buffer[index], "FSH#", 4))
-			done = MB_YES;
-	    else
-			index += 4;
-#else
-	    while (index < buffer_size
-			&& strncmp(&buffer[index], "$HSG", 4)
-			&& strncmp(&buffer[index], "#HSF", 4))
-			{
-			index++;
-			skip++;
-			}
-	    if (index >= buffer_size
-			|| !strncmp(&buffer[index], "#HSF", 4))
-			done = MB_YES;
-	    else
-			index += 4;
-#endif
-
-#ifdef MB_DEBUG
-if (skip > 4) fprintf(stderr, "%s:%d | skipped %d bytes in function <%s>\n",__FILE__,__LINE__, skip-4, function_name);
-#endif
-
-	    /* deal with group */
-	    if (done == MB_NO)
-		    {
-		    /* get group size and id */
-		    mb_get_binary_int(SWAPFLAG, &buffer[index], (int *) &byte_count); index += 4;
-		    mb_get_binary_int(SWAPFLAG, &buffer[index], (int *) &group_id); index += 4;
-
-		    /* print debug statements */
-		    if (verbose >= 5)
-			{
-			fprintf(stderr,"\ndbg5  Group %d of %d bytes to be parsed in MBIO function <%s>\n",
-				group_id, byte_count, function_name);
-			}
-#ifdef MB_DEBUG
-fprintf(stderr, "%s:%d | Group %d of %d bytes to be parsed in MBIO function <%s>\n",__FILE__,__LINE__,
-				    group_id, byte_count, function_name);
-#endif
-
-		    /* handle properties group */
-		    if (group_id == MBSYS_XSE_SBM_GROUP_PROPERTIES)
-				{
-#ifdef MB_DEBUG
-fprintf(stderr, "%s:%d | READ SBM_GROUP_PROPERTIES\n",__FILE__,__LINE__);
-#endif
-				store->sbm_properties = MB_YES;
-				mb_get_binary_int(SWAPFLAG, &buffer[index], (int *) &store->sbm_ping); index += 4;
-				mb_get_binary_float(SWAPFLAG, &buffer[index], &store->sbm_ping_gain); index += 4;
-				mb_get_binary_float(SWAPFLAG, &buffer[index], &store->sbm_pulse_width); index += 4;
-				mb_get_binary_float(SWAPFLAG, &buffer[index], &store->sbm_transmit_power); index += 4;
-				mb_get_binary_float(SWAPFLAG, &buffer[index], &store->sbm_pixel_width); index += 4;
-				mb_get_binary_float(SWAPFLAG, &buffer[index], &store->sbm_swath_width); index += 4;
-				mb_get_binary_float(SWAPFLAG, &buffer[index], &store->sbm_time_slice); index += 4;
-				mb_get_binary_int(SWAPFLAG, &buffer[index], (int *) &store->sbm_depth_mode); index += 4;
-				mb_get_binary_int(SWAPFLAG, &buffer[index], (int *) &store->sbm_beam_mode); index += 4;
-				mb_get_binary_float(SWAPFLAG, &buffer[index], &store->sbm_ssv); index += 4;
-				mb_get_binary_float(SWAPFLAG, &buffer[index], &store->sbm_frequency); index += 4;
-				mb_get_binary_float(SWAPFLAG, &buffer[index], &store->sbm_bandwidth); index += 4;
-				}
-
-		    /* handle hrp group */
-		    if (group_id == MBSYS_XSE_SBM_GROUP_HRP)
-				{
-#ifdef MB_DEBUG
-fprintf(stderr, "%s:%d | READ SBM_GROUP_HRP\n",__FILE__,__LINE__);
-#endif
-				store->sbm_hrp = MB_YES;
-				mb_get_binary_double(SWAPFLAG, &buffer[index], &store->sbm_heave); index += 8;
-				mb_get_binary_double(SWAPFLAG, &buffer[index], &store->sbm_roll); index += 8;
-				mb_get_binary_double(SWAPFLAG, &buffer[index], &store->sbm_pitch); index += 8;
-				}
-
-		    /* handle center group */
-		    if (group_id == MBSYS_XSE_SBM_GROUP_SIGNAL)
-				{
-#ifdef MB_DEBUG
-fprintf(stderr, "%s:%d | READ SBM_GROUP_SIGNAL\n",__FILE__,__LINE__);
-#endif
-				store->sbm_signal = MB_YES;
-				mb_get_binary_int(SWAPFLAG, &buffer[index], (int *) &store->sbm_signal_beam); index += 4;
-				mb_get_binary_int(SWAPFLAG, &buffer[index], (int *) &store->sbm_signal_count); index += 4;
-				store->sbm_signal_count = MIN(MBSYS_XSE_MAXSAMPLES, store->sbm_signal_count);
-				for (i=0;i<store->sbm_signal_count;i++)
-				    {
-				    mb_get_binary_float(SWAPFLAG, &buffer[index], &store->sbm_signal_amp[i]);
-				    index += 4;
-				    }
-				}
-
-		    /* handle message group */
-		    if (group_id == MBSYS_XSE_SBM_GROUP_MESSAGE)
-				{
-#ifdef MB_DEBUG
-fprintf(stderr, "%s:%d | READ SBM_GROUP_MESSAGE\n",__FILE__,__LINE__);
-#endif
-				store->sbm_message = MB_YES;
-				mb_get_binary_int(SWAPFLAG, &buffer[index], (int *) &store->sbm_message_id); index += 4;
-				mb_get_binary_int(SWAPFLAG, &buffer[index], (int *) &store->sbm_message_len); index += 4;
-if (store->sbm_message_len > buffer_size)
- fprintf(stderr,"Read message: %d %d %d\n",buffer_size,store->sbm_message_len,store->sbm_message_id);
-				for (i=0;i<store->sbm_message_len;i++)
-				    {
-				    store->sbm_message_txt[i] = buffer[index];
-				    index++;
-				    }
-				store->sbm_message_txt[store->sbm_message_len] = 0;
-				}
-
-		    /* handle sweep segments group */
-		    if (group_id == MBSYS_XSE_SBM_GROUP_SWEEPSEGMENTS)
-				{
-#ifdef MB_DEBUG
-fprintf(stderr, "%s:%d | READ SBM_GROUP_SWEEPSEGMENTS\n",__FILE__,__LINE__);
-#endif
-				store->sbm_sweepsegments = MB_YES;
-				store->sbm_sweep_direction = buffer[index]; index++;
-				mb_get_binary_float(SWAPFLAG, &buffer[index], (int *) &store->sbm_sweep_azimuth); index += 4;
-				mb_get_binary_int(SWAPFLAG, &buffer[index], (int *) &store->sbm_sweep_segments); index += 4;
-				mb_get_binary_int(SWAPFLAG, &buffer[index], (int *) &store->sbm_sweep_seconds); index += 4;
-				mb_get_binary_int(SWAPFLAG, &buffer[index], (int *) &store->sbm_sweep_micro); index += 4;
-				mb_get_binary_float(SWAPFLAG, &buffer[index], (int *) &store->sbm_sweep_extrapolateazimuth); index += 4;
-				mb_get_binary_float(SWAPFLAG, &buffer[index], (int *) &store->sbm_sweep_interpolatedazimuth); index += 4;
-				mb_get_binary_float(SWAPFLAG, &buffer[index], (int *) &store->sbm_sweep_extrapolatepitch); index += 4;
-				mb_get_binary_float(SWAPFLAG, &buffer[index], (int *) &store->sbm_sweep_interpolatedpitch); index += 4;
-				mb_get_binary_float(SWAPFLAG, &buffer[index], (int *) &store->sbm_sweep_extrapolateroll); index += 4;
-				mb_get_binary_float(SWAPFLAG, &buffer[index], (int *) &store->sbm_sweep_interpolatedroll); index += 4;
-				mb_get_binary_float(SWAPFLAG, &buffer[index], (int *) &store->sbm_sweep_stabilizedangle); index += 4;
-				}
-
-		    /* handle spacing mode group */
-		    if (group_id == MBSYS_XSE_SBM_GROUP_SPACINGMODE)
-				{
-#ifdef MB_DEBUG
-fprintf(stderr, "%s:%d | READ SBM_GROUP_SPACINGMODE\n",__FILE__,__LINE__);
-#endif
-				store->sbm_spacingmode = MB_YES;
-				store->sbm_spacing_mode = buffer[index]; index++;
-				mb_get_binary_float(SWAPFLAG, &buffer[index], (int *) &store->sbm_spacing_equidistance); index += 4;
-				mb_get_binary_float(SWAPFLAG, &buffer[index], (int *) &store->sbm_spacing_equidistance_min); index += 4;
-				mb_get_binary_float(SWAPFLAG, &buffer[index], (int *) &store->sbm_spacing_equidistance_max); index += 4;
-				}
-		    }
-	    }
-
-	/* print debug statements */
-	if (verbose >= 5)
-	    {
-	    fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-	    fprintf(stderr,"dbg5       sbm_source:          %d\n",store->sbm_source);
-	    fprintf(stderr,"dbg5       sbm_sec:             %u\n",store->sbm_sec);
-	    fprintf(stderr,"dbg5       sbm_usec:            %u\n",store->sbm_usec);
-	    }
-	if (verbose >= 5 && store->sbm_properties == MB_YES)
-	    {
-	    fprintf(stderr,"dbg5       sbm_ping:            %d\n",store->sbm_ping);
-	    fprintf(stderr,"dbg5       sbm_ping_gain:       %f\n",store->sbm_ping_gain);
-	    fprintf(stderr,"dbg5       sbm_pulse_width:     %f\n",store->sbm_pulse_width);
-	    fprintf(stderr,"dbg5       sbm_transmit_power:  %f\n",store->sbm_transmit_power);
-	    fprintf(stderr,"dbg5       sbm_pixel_width:     %f\n",store->sbm_pixel_width);
-	    fprintf(stderr,"dbg5       sbm_swath_width:     %f\n",store->sbm_swath_width);
-	    fprintf(stderr,"dbg5       sbm_time_slice:      %f\n",store->sbm_time_slice);
-	    fprintf(stderr,"dbg5       sbm_depth_mode:      %d\n",store->sbm_depth_mode);
-	    fprintf(stderr,"dbg5       sbm_beam_mode:       %d\n",store->sbm_beam_mode);
-	    fprintf(stderr,"dbg5       sbm_ssv:             %f\n",store->sbm_ssv);
-	    fprintf(stderr,"dbg5       sbm_frequency:       %f\n",store->sbm_frequency);
-	    fprintf(stderr,"dbg5       sbm_bandwidth:       %f\n",store->sbm_bandwidth);
-	    }
-	if (verbose >= 5 && store->sbm_hrp == MB_YES)
-	    {
-	    fprintf(stderr,"dbg5       sbm_heave:           %f\n",store->sbm_heave);
-	    fprintf(stderr,"dbg5       sbm_roll:            %f\n",store->sbm_roll);
-	    fprintf(stderr,"dbg5       sbm_pitch:           %f\n",store->sbm_pitch);
-	    }
-	if (verbose >= 5 && store->sbm_signal == MB_YES)
-	    {
-	    fprintf(stderr,"dbg5       sbm_signal_beam:     %d\n",store->sbm_signal_beam);
-	    fprintf(stderr,"dbg5       sbm_signal_count:    %d\n",store->sbm_signal_count);
-	    for (i=0;i<store->sbm_signal_count;i++)
-		fprintf(stderr,"dbg5       sample[%d]: %f\n",
-		    i, store->sbm_signal_amp[i]);
-	    }
-	if (verbose >= 5 && store->sbm_message == MB_YES)
-	    {
-	    fprintf(stderr,"dbg5       sbm_message_id:      %d\n",store->sbm_message_id);
-	    fprintf(stderr,"dbg5       sbm_message_len:     %d\n",store->sbm_message_len);
-	    fprintf(stderr,"dbg5       sbm_message_txt:     %s\n",store->sbm_message_txt);
-	    }
-	if (verbose >= 5 && store->sbm_sweepsegments == MB_YES)
-	    {
-	    fprintf(stderr,"dbg5       sbm_sweep_direction: %d\n",store->sbm_sweep_direction);
-	    fprintf(stderr,"dbg5       sbm_sweep_azimuth:   %f\n",store->sbm_sweep_azimuth);
-	    fprintf(stderr,"dbg5       sbm_sweep_segments:  %d\n",store->sbm_sweep_segments);
-	    fprintf(stderr,"dbg5       sbm_sweep_seconds:   %d\n",store->sbm_sweep_seconds);
-	    fprintf(stderr,"dbg5       sbm_sweep_micro:     %d\n",store->sbm_sweep_micro);
-	    fprintf(stderr,"dbg5       sbm_sweep_extrapolateazimuth:  %f\n",store->sbm_sweep_extrapolateazimuth);
- 	    fprintf(stderr,"dbg5       sbm_sweep_interpolatedazimuth: %f\n",store->sbm_sweep_interpolatedazimuth);
- 	    fprintf(stderr,"dbg5       sbm_sweep_extrapolatepitch:    %f\n",store->sbm_sweep_extrapolatepitch);
- 	    fprintf(stderr,"dbg5       sbm_sweep_interpolatedpitch:   %f\n",store->sbm_sweep_interpolatedpitch);
- 	    fprintf(stderr,"dbg5       sbm_sweep_extrapolateroll:     %f\n",store->sbm_sweep_extrapolateroll);
- 	    fprintf(stderr,"dbg5       sbm_sweep_interpolatedroll:    %f\n",store->sbm_sweep_interpolatedroll);
- 	    fprintf(stderr,"dbg5       sbm_sweep_stabilizedangle:     %f\n",store->sbm_sweep_stabilizedangle);
-	    }
-	if (verbose >= 5 && store->sbm_spacingmode == MB_YES)
-	    {
-	    fprintf(stderr,"dbg5       sbm_spacing_mode:      	      %d\n",store->sbm_spacing_mode);
-	    fprintf(stderr,"dbg5       sbm_spacing_equidistance:      %f\n",store->sbm_spacing_equidistance);
-	    fprintf(stderr,"dbg5       sbm_spacing_equidistance_min:  %f\n",store->sbm_spacing_equidistance_min);
-	    fprintf(stderr,"dbg5       sbm_spacing_equidistance_max:  %f\n",store->sbm_spacing_equidistance_max);
-	    }
-
-	/* print output debug statements */
-	if (verbose >= 2)
-	    {
-	    fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-		    function_name);
-	    fprintf(stderr,"dbg2  Return values:\n");
-	    fprintf(stderr,"dbg2       error:      %d\n",*error);
-	    fprintf(stderr,"dbg2  Return status:\n");
-	    fprintf(stderr,"dbg2       status:  %d\n",status);
-	    }
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_l3xseraw_rd_geodetic(int verbose,int buffer_size,char *buffer,void *store_ptr,int *error)
-{
-	char    *function_name = "mbr_l3xseraw_rd_geodetic";
-	int status = MB_SUCCESS;
-	struct mbsys_xse_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       buffer_size:%d\n",buffer_size);
-		fprintf(stderr,"dbg2       buffer:     %p\n",(void *)buffer);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to store data structure */
-	store = (struct mbsys_xse_struct *) store_ptr;
-
-	/* The geodetic frame is currently unused by MB-System */
-
-	/* print output debug statements */
-	if (verbose >= 2)
-	    {
-	    fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-		    function_name);
-	    fprintf(stderr,"dbg2  Return values:\n");
-	    fprintf(stderr,"dbg2       error:      %d\n",*error);
-	    fprintf(stderr,"dbg2  Return status:\n");
-	    fprintf(stderr,"dbg2       status:  %d\n",status);
-	    }
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_l3xseraw_rd_native(int verbose,int buffer_size,char *buffer,void *store_ptr,int *error)
-{
-	char    *function_name = "mbr_l3xseraw_rd_native";
-	int status = MB_SUCCESS;
-	struct mbsys_xse_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       buffer_size:%d\n",buffer_size);
-		fprintf(stderr,"dbg2       buffer:     %p\n",(void *)buffer);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to store data structure */
-	store = (struct mbsys_xse_struct *) store_ptr;
-
-	/* The native frame is currently unused by MB-System */
-
-	/* print output debug statements */
-	if (verbose >= 2)
-	    {
-	    fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-		    function_name);
-	    fprintf(stderr,"dbg2  Return values:\n");
-	    fprintf(stderr,"dbg2       error:      %d\n",*error);
-	    fprintf(stderr,"dbg2  Return status:\n");
-	    fprintf(stderr,"dbg2       status:  %d\n",status);
-	    }
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_l3xseraw_rd_product(int verbose,int buffer_size,char *buffer,void *store_ptr,int *error)
-{
-	char    *function_name = "mbr_l3xseraw_rd_product";
-	int status = MB_SUCCESS;
-	struct mbsys_xse_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       buffer_size:%d\n",buffer_size);
-		fprintf(stderr,"dbg2       buffer:     %p\n",(void *)buffer);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to store data structure */
-	store = (struct mbsys_xse_struct *) store_ptr;
-
-	/* The product frame is currently unused by MB-System */
-
-	/* print output debug statements */
-	if (verbose >= 2)
-	    {
-	    fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-		    function_name);
-	    fprintf(stderr,"dbg2  Return values:\n");
-	    fprintf(stderr,"dbg2       error:      %d\n",*error);
-	    fprintf(stderr,"dbg2  Return status:\n");
-	    fprintf(stderr,"dbg2       status:  %d\n",status);
-	    }
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_l3xseraw_rd_bathymetry(int verbose,int buffer_size,char *buffer,void *store_ptr,int *error)
-{
-	char    *function_name = "mbr_l3xseraw_rd_bathymetry";
-	int status = MB_SUCCESS;
-	struct mbsys_xse_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       buffer_size:%d\n",buffer_size);
-		fprintf(stderr,"dbg2       buffer:     %p\n",(void *)buffer);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to store data structure */
-	store = (struct mbsys_xse_struct *) store_ptr;
-
-	/* The bathymetry frame is currently unused by MB-System */
-
-	/* print output debug statements */
-	if (verbose >= 2)
-	    {
-	    fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-		    function_name);
-	    fprintf(stderr,"dbg2  Return values:\n");
-	    fprintf(stderr,"dbg2       error:      %d\n",*error);
-	    fprintf(stderr,"dbg2  Return status:\n");
-	    fprintf(stderr,"dbg2       status:  %d\n",status);
-	    }
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_l3xseraw_rd_control(int verbose,int buffer_size,char *buffer,void *store_ptr,int *error)
-{
-	char    *function_name = "mbr_l3xseraw_rd_control";
-	int status = MB_SUCCESS;
-	struct mbsys_xse_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       buffer_size:%d\n",buffer_size);
-		fprintf(stderr,"dbg2       buffer:     %p\n",(void *)buffer);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to store data structure */
-	store = (struct mbsys_xse_struct *) store_ptr;
-
-	/* The control frame is currently unused by MB-System */
-
-	/* print output debug statements */
-	if (verbose >= 2)
-	    {
-	    fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-		    function_name);
-	    fprintf(stderr,"dbg2  Return values:\n");
-	    fprintf(stderr,"dbg2       error:      %d\n",*error);
-	    fprintf(stderr,"dbg2  Return status:\n");
-	    fprintf(stderr,"dbg2       status:  %d\n",status);
-	    }
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_l3xseraw_rd_comment(int verbose,int buffer_size,char *buffer,void *store_ptr,int *error)
-{
-	char	*function_name = "mbr_l3xseraw_rd_comment";
-	int	status = MB_SUCCESS;
-	struct mbsys_xse_struct *store;
-	int	byte_count;
-	int	group_id;
-	int	done;
-	int	index;
-	int	skip;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       buffer_size:%d\n",buffer_size);
-		fprintf(stderr,"dbg2       buffer:     %p\n",(void *)buffer);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to store data structure */
-	store = (struct mbsys_xse_struct *) store_ptr;
-
-	/* get source and time */
-	index = 12;
-	mb_get_binary_int(SWAPFLAG, &buffer[index], (int *) &store->com_source); index += 4;
-	mb_get_binary_int(SWAPFLAG, &buffer[index], (int *) &store->com_sec); index += 4;
-	mb_get_binary_int(SWAPFLAG, &buffer[index], (int *) &store->com_usec); index += 4;
-
-	/* loop over groups */
-	done = MB_NO;
-	while (index <= buffer_size
-		&& status == MB_SUCCESS
-		&& done == MB_NO)
-	    {
-	    /* look for group start or frame end */
-	    skip = 0;
-#ifdef DATAINPCBYTEORDER
-	    while (index < buffer_size
-			&& strncmp(&buffer[index], "GSH$", 4)
-			&& strncmp(&buffer[index], "FSH#", 4))
-			{
-			index++;
-			skip++;
-			}
-	    if (index >= buffer_size
-			|| !strncmp(&buffer[index], "FSH#", 4))
-			done = MB_YES;
-	    else
-			index += 4;
-#else
-	    while (index < buffer_size
-			&& strncmp(&buffer[index], "$HSG", 4)
-			&& strncmp(&buffer[index], "#HSF", 4))
-			{
-			index++;
-			skip++;
-			}
-	    if (index >= buffer_size
-			|| !strncmp(&buffer[index], "#HSF", 4))
-			done = MB_YES;
-	    else
-			index += 4;
-#endif
-
-#ifdef MB_DEBUG
-if (skip > 4) fprintf(stderr, "%s:%d | skipped %d bytes in function <%s>\n",__FILE__,__LINE__, skip-4, function_name);
-#endif
-
-	    /* deal with group */
-	    if (done == MB_NO)
-			{
-			/* get group size and id */
-			mb_get_binary_int(SWAPFLAG, &buffer[index], (int *) &byte_count); index += 4;
-			mb_get_binary_int(SWAPFLAG, &buffer[index], (int *) &group_id); index += 4;
-
-			/* print debug statements */
-			if (verbose >= 5)
-			    {
-			    fprintf(stderr,"\ndbg5  Group %d of %d bytes to be parsed in MBIO function <%s>\n",
-				    group_id, byte_count, function_name);
-			    }
-#ifdef MB_DEBUG
-fprintf(stderr, "%s:%d | Group %d of %d bytes to be parsed in MBIO function <%s>\n",__FILE__,__LINE__,
-				    group_id, byte_count, function_name);
-#endif
-
-		    /* handle general group */
-		    if (group_id == MBSYS_XSE_COM_GROUP_GEN)
-				{
-				for (i=0;i<byte_count;i++)
-				    {
-				    if (i<MBSYS_XSE_COMMENT_LENGTH-1)
-						store->comment[i] = buffer[index++];
-				    }
-				store->comment[MIN(byte_count-4, MBSYS_XSE_COMMENT_LENGTH-1)] = '\0';
-				}
-			}
-	    }
-
-	/* print debug statements */
-	if (verbose >= 5)
-	    {
-	    fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-	    fprintf(stderr,"dbg5       comment:             %s\n",store->comment);
-	    }
-
-	/* print output debug statements */
-	if (verbose >= 2)
-	    {
-	    fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-		    function_name);
-	    fprintf(stderr,"dbg2  Return values:\n");
-	    fprintf(stderr,"dbg2       error:      %d\n",*error);
-	    fprintf(stderr,"dbg2  Return status:\n");
-	    fprintf(stderr,"dbg2       status:  %d\n",status);
-	    }
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbr_l3xseraw_wr_data(int verbose,void *mbio_ptr,void *store_ptr,int *error)
-{
-	char	*function_name = "mbr_l3xseraw_wr_data";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_xse_struct *store;
-	FILE	*mbfp;
-	int	buffer_size;
-	int	write_size;
-	char	*buffer;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to store data structure */
-	store = (struct mbsys_xse_struct *) store_ptr;
-	mbfp = mb_io_ptr->mbfp;
-	buffer = mb_io_ptr->hdr_comment;
-
-#ifdef MB_DEBUG
-fprintf(stderr, "%s:%d | WRITE KIND: %d\n",__FILE__,__LINE__,store->kind);
-#endif
-
-	if (store->kind == MB_DATA_COMMENT)
-		{
-#ifdef MB_DEBUG
-fprintf(stderr, "%s:%d | WRITE COMMMENT\n",__FILE__,__LINE__);
-#endif
-		status = mbr_l3xseraw_wr_comment(verbose,&buffer_size,buffer,store_ptr,error);
-		if ((write_size = fwrite(buffer,1,buffer_size,mbfp)) != buffer_size)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		}
-	else if (store->kind == MB_DATA_NAV)
-		{
-#ifdef MB_DEBUG
-fprintf(stderr, "%s:%d | WRITE NAV\n",__FILE__,__LINE__);
-#endif
-		status = mbr_l3xseraw_wr_nav(verbose,&buffer_size,buffer,store_ptr,error);
-		if ((write_size = fwrite(buffer,1,buffer_size,mbfp)) != buffer_size)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		}
-	else if (store->kind == MB_DATA_VELOCITY_PROFILE)
-		{
-#ifdef MB_DEBUG
-fprintf(stderr, "%s:%d | WRITE SVP\n",__FILE__,__LINE__);
-#endif
-		status = mbr_l3xseraw_wr_svp(verbose,&buffer_size,buffer,store_ptr,error);
-		if ((write_size = fwrite(buffer,1,buffer_size,mbfp)) != buffer_size)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		}
-	else if (store->kind == MB_DATA_PARAMETER)
-		{
-#ifdef MB_DEBUG
-fprintf(stderr, "%s:%d | WRITE SHIP\n",__FILE__,__LINE__);
-#endif
-		status = mbr_l3xseraw_wr_ship(verbose,&buffer_size,buffer,store_ptr,error);
-		if ((write_size = fwrite(buffer,1,buffer_size,mbfp)) != buffer_size)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		}
-	else if (store->kind == MB_DATA_DATA)
-		{
-#ifdef MB_DEBUG
-fprintf(stderr, "%s:%d | WRITE MULTIBEAM\n",__FILE__,__LINE__);
-#endif
-		if (store->mul_frame == MB_YES)
-		    {
-		    status = mbr_l3xseraw_wr_multibeam(verbose,&buffer_size,buffer,store_ptr,error);
-		    if ((write_size = fwrite(buffer,1,buffer_size,mbfp)) != buffer_size)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		    }
-#ifdef MB_DEBUG
-fprintf(stderr, "%s:%d | WRITE SIDESCAN\n",__FILE__,__LINE__);
-#endif
-		if (store->sid_frame == MB_YES)
-		    {
-		    status = mbr_l3xseraw_wr_sidescan(verbose,&buffer_size,buffer,store_ptr,error);
-		    if ((write_size = fwrite(buffer,1,buffer_size,mbfp)) != buffer_size)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		    }
-		}
-	else if (store->kind == MB_DATA_RUN_PARAMETER)
-		{
-#ifdef MB_DEBUG
-fprintf(stderr, "%s:%d | WRITE RUN PARAMETER\n",__FILE__,__LINE__);
-#endif
-		status = mbr_l3xseraw_wr_seabeam(verbose,&buffer_size,buffer,store_ptr,error);
-		if ((write_size = fwrite(buffer,1,buffer_size,mbfp)) != buffer_size)
-		    {
-		    *error = MB_ERROR_WRITE_FAIL;
-		    status = MB_FAILURE;
-		    }
-		}
-	else if (store->kind == MB_DATA_RAW_LINE)
-		{
-#ifdef MB_DEBUG
-fprintf(stderr, "%s:%d | WRITE RAW LINE\n",__FILE__,__LINE__);
-#endif
-		if (store->rawsize > 0)
-		    {
-		    if ((write_size = fwrite(store->raw,1,store->rawsize,mbfp)) != store->rawsize)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		    }
-		}
-	else
-		{
-#ifdef MB_DEBUG
-fprintf(stderr, "%s:%d | WRITE FAILURE BAD KIND\n",__FILE__,__LINE__);
-#endif
-		status = MB_FAILURE;
-		*error = MB_ERROR_BAD_KIND;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Data record kind in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       kind:       %d\n",store->kind);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_l3xseraw_wr_nav(int verbose,int *buffer_size,char *buffer,void *store_ptr,int *error)
-{
-	char	*function_name = "mbr_l3xseraw_wr_nav";
-	int	status = MB_SUCCESS;
-	struct mbsys_xse_struct *store;
-	int	index;
-	int frame_count;
-	int group_count;
-	int frame_cnt_index;
-	int	group_cnt_index;
-	int frame_id;
-	int group_id;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-	    {
-	    fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-	    fprintf(stderr,"dbg2  Input arguments:\n");
-	    fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-	    fprintf(stderr,"dbg2       buffer:     %p\n",(void *)buffer);
-	    fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-	    }
-
-	/* get pointer to store data structure */
-	store = (struct mbsys_xse_struct *) store_ptr;
-
-	/* print debug statements */
-	if (verbose >= 5)
-	    {
-	    fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-	    fprintf(stderr,"dbg5       nav_source:          %d\n",store->nav_source);
-	    fprintf(stderr,"dbg5       nav_sec:             %u\n",store->nav_sec);
-	    fprintf(stderr,"dbg5       nav_usec:            %u\n",store->nav_usec);
-	    fprintf(stderr,"dbg5       nav_quality:         %d\n",store->nav_quality);
-	    fprintf(stderr,"dbg5       nav_status:          %d\n",store->nav_status);
-	    fprintf(stderr,"dbg5       nav_description_len: %d\n",store->nav_description_len);
-	    fprintf(stderr,"dbg5       nav_description:     %s\n",store->nav_description);
-	    fprintf(stderr,"dbg5       nav_x:               %f\n",store->nav_x);
-	    fprintf(stderr,"dbg5       nav_y:               %f\n",store->nav_y);
-	    fprintf(stderr,"dbg5       nav_z:               %f\n",store->nav_z);
-	    fprintf(stderr,"dbg5       nav_speed_ground:    %f\n",store->nav_speed_ground);
-	    fprintf(stderr,"dbg5       nav_course_ground:   %f\n",store->nav_course_ground);
-	    fprintf(stderr,"dbg5       nav_speed_water:     %f\n",store->nav_speed_water);
-	    fprintf(stderr,"dbg5       nav_course_water:    %f\n",store->nav_course_water);
-	    }
-
-	/* get the frame label */
-	index = 0;
-#ifdef DATAINPCBYTEORDER
-	strncpy(&buffer[index], "FSH$", 4);
-#else
-	strncpy(&buffer[index], "$HSF", 4);
-#endif
-	index += 4;
-
-	/* start the frame byte count, but don't write it to buffer yet */
-	/* increment index so we skip the count value in the buffer */
-	frame_count = 0;
-	frame_cnt_index = index;
-	index += 4;
-
-	/* get frame time */
-	frame_id = MBSYS_XSE_NAV_FRAME;
-	mb_put_binary_int(SWAPFLAG, frame_id, &buffer[index]); index += 4;
-	mb_put_binary_int(SWAPFLAG, store->nav_source, &buffer[index]); index += 4;
-	mb_put_binary_int(SWAPFLAG, store->nav_sec, &buffer[index]); index += 4;
-	mb_put_binary_int(SWAPFLAG, store->nav_usec, &buffer[index]); index += 4;
-	frame_count += 16;
-
-	/*****************************************/
-
-	/* write general group */
-	if (store->nav_group_general == MB_YES)
-		{
-		/* get group label */
-#ifdef DATAINPCBYTEORDER
-		strncpy(&buffer[index], "GSH$", 4);
-#else
-		strncpy(&buffer[index], "$HSG", 4);
-#endif
-		index += 4;
-
-		/* start the group byte count, but don't write it to buffer yet */
-		/* mark the byte count spot in the buffer and increment index so we skip it */
-		group_count = 0;
-		group_cnt_index = index;
-		index += 4;
-
-		/* get pos group */
-		group_id = MBSYS_XSE_NAV_GROUP_GEN;
-		mb_put_binary_int(SWAPFLAG, group_id, &buffer[index]); index += 4;
-		mb_put_binary_int(SWAPFLAG, store->nav_quality, &buffer[index]); index += 4;
-		mb_put_binary_int(SWAPFLAG, store->nav_status, &buffer[index]); index += 4;
-
-		/* get end of group label */
-#ifdef DATAINPCBYTEORDER
-		strncpy(&buffer[index], "GSH#", 4);
-#else
-		strncpy(&buffer[index], "#HSG", 4);
-#endif
-		index += 4;
-		group_count += store->nav_description_len + 32;
-
-		/* go back and fill in group byte count */
-		mb_put_binary_int(SWAPFLAG, group_count, &buffer[group_cnt_index]);
-
-		/* add group count to the frame count */
-		frame_count += group_count + 12;
-		}
-
-	/*****************************************/
-
-	/* write position group */
-	if (store->nav_group_position == MB_YES)
-		{
-		/* get group label */
-#ifdef DATAINPCBYTEORDER
-		strncpy(&buffer[index], "GSH$", 4);
-#else
-		strncpy(&buffer[index], "$HSG", 4);
-#endif
-		index += 4;
-
-		/* start the group byte count, but don't write it to buffer yet */
-		/* mark the byte count spot in the buffer and increment index so we skip it */
-		group_count = 0;
-		group_cnt_index = index;
-		index += 4;
-
-		/* get pos group */
-		group_id = MBSYS_XSE_NAV_GROUP_POS;
-		mb_put_binary_int(SWAPFLAG, group_id, &buffer[index]); index += 4;
-		mb_put_binary_int(SWAPFLAG, store->nav_description_len, &buffer[index]); index += 4;
-		for (i=0;i<store->nav_description_len;i++)
-		    {
-		    buffer[index] = store->nav_description[i]; index++;
-		    }
-		mb_put_binary_double(SWAPFLAG, store->nav_x, &buffer[index]); index += 8;
-		mb_put_binary_double(SWAPFLAG, store->nav_y, &buffer[index]); index += 8;
-		mb_put_binary_double(SWAPFLAG, store->nav_z, &buffer[index]); index += 8;
-
-		/* get end of group label */
-#ifdef DATAINPCBYTEORDER
-		strncpy(&buffer[index], "GSH#", 4);
-#else
-		strncpy(&buffer[index], "#HSG", 4);
-#endif
-		index += 4;
-		group_count += store->nav_description_len + 32;
-
-		/* go back and fill in group byte count */
-		mb_put_binary_int(SWAPFLAG, group_count, &buffer[group_cnt_index]);
-
-		/* add group count to the frame count */
-		frame_count += group_count + 12;
-		}
-
-	/*****************************************/
-
-	/* write accuracy group */
-	if (store->nav_group_accuracy == MB_YES)
-		{
-		/* get group label */
-#ifdef DATAINPCBYTEORDER
-		strncpy(&buffer[index], "GSH$", 4);
-#else
-		strncpy(&buffer[index], "$HSG", 4);
-#endif
-		index += 4;
-
-		/* start the group byte count, but don't write it to buffer yet */
-		/* mark the byte count spot in the buffer and increment index so we skip it */
-		group_count = 0;
-		group_cnt_index = index;
-		index += 4;
-
-		/* get pos group */
-		group_id = MBSYS_XSE_NAV_GROUP_ACCURACY;
-		mb_put_binary_int(SWAPFLAG, group_id, &buffer[index]); index += 4;
-		mb_put_binary_short(SWAPFLAG, store->nav_acc_quality, &buffer[index]); index += 2;
-		buffer[index] = store->nav_acc_numsatellites; index++;
-		mb_put_binary_float(SWAPFLAG, store->nav_acc_horizdilution, &buffer[index]); index += 4;
-		mb_put_binary_float(SWAPFLAG, store->nav_acc_diffage, &buffer[index]); index += 4;
-		mb_put_binary_int(SWAPFLAG, store->nav_acc_diffref, &buffer[index]); index += 4;
-
-		/* get end of group label */
-#ifdef DATAINPCBYTEORDER
-		strncpy(&buffer[index], "GSH#", 4);
-#else
-		strncpy(&buffer[index], "#HSG", 4);
-#endif
-		index += 4;
-		group_count += 19;
-
-		/* go back and fill in group byte count */
-		mb_put_binary_int(SWAPFLAG, group_count, &buffer[group_cnt_index]);
-
-		/* add group count to the frame count */
-		frame_count += group_count + 12;
-		}
-
-	/*****************************************/
-
-	/* write motion ground truth group */
-	if (store->nav_group_motiongt == MB_YES)
-		{
-		/* get group label */
-#ifdef DATAINPCBYTEORDER
-		strncpy(&buffer[index], "GSH$", 4);
-#else
-		strncpy(&buffer[index], "$HSG", 4);
-#endif
-		index += 4;
-
-		/* start the group byte count, but don't write it to buffer yet */
-		/* mark the byte count spot in the buffer and increment index so we skip it */
-		group_count = 0;
-		group_cnt_index = index;
-		index += 4;
-
-		/* get motion ground truth group */
-		group_id = MBSYS_XSE_NAV_GROUP_MOTIONGT;
-		mb_put_binary_int(SWAPFLAG, group_id, &buffer[index]); index += 4;
-		mb_put_binary_double(SWAPFLAG, store->nav_speed_ground, &buffer[index]); index += 8;
-		mb_put_binary_double(SWAPFLAG, store->nav_course_ground, &buffer[index]); index += 8;
-
-		/* get end of group label */
-#ifdef DATAINPCBYTEORDER
-		strncpy(&buffer[index], "GSH#", 4);
-#else
-		strncpy(&buffer[index], "#HSG", 4);
-#endif
-		index += 4;
-		group_count += 20;
-
-		/* go back and fill in group byte count */
-		mb_put_binary_int(SWAPFLAG, group_count, &buffer[group_cnt_index]);
-
-		/* add group count to the frame count */
-		frame_count += group_count + 12;
-		}
-
-	/*****************************************/
-
-	/* write motion through water group */
-	if (store->nav_group_motiontw == MB_YES)
-		{
-		/* get group label */
-#ifdef DATAINPCBYTEORDER
-		strncpy(&buffer[index], "GSH$", 4);
-#else
-		strncpy(&buffer[index], "$HSG", 4);
-#endif
-		index += 4;
-
-		/* start the group byte count, but don't write it to buffer yet */
-		/* mark the byte count spot in the buffer and increment index so we skip it */
-		group_count = 0;
-		group_cnt_index = index;
-		index += 4;
-
-		/* get motion through water group */
-		group_id = MBSYS_XSE_NAV_GROUP_MOTIONTW;
-		mb_put_binary_int(SWAPFLAG, group_id, &buffer[index]); index += 4;
-		mb_put_binary_double(SWAPFLAG, store->nav_speed_water, &buffer[index]); index += 8;
-		mb_put_binary_double(SWAPFLAG, store->nav_course_water, &buffer[index]); index += 8;
-
-		/* get end of group label */
-#ifdef DATAINPCBYTEORDER
-		strncpy(&buffer[index], "GSH#", 4);
-#else
-		strncpy(&buffer[index], "#HSG", 4);
-#endif
-		index += 4;
-		group_count += 20;
-
-		/* go back and fill in group byte count */
-		mb_put_binary_int(SWAPFLAG, group_count, &buffer[group_cnt_index]);
-
-		/* add group count to the frame count */
-		frame_count += group_count + 12;
-		}
-
-	/*****************************************/
-
-	/* write track steering group */
-	if (store->nav_group_track == MB_YES)
-		{
-		/* get group label */
-#ifdef DATAINPCBYTEORDER
-		strncpy(&buffer[index], "GSH$", 4);
-#else
-		strncpy(&buffer[index], "$HSG", 4);
-#endif
-		index += 4;
-
-		/* start the group byte count, but don't write it to buffer yet */
-		/* mark the byte count spot in the buffer and increment index so we skip it */
-		group_count = 0;
-		group_cnt_index = index;
-		index += 4;
-
-		/* get motion through water group */
-		group_id = MBSYS_XSE_NAV_GROUP_TRACK;
-		mb_put_binary_int(SWAPFLAG, group_id, &buffer[index]); index += 4;
-		mb_put_binary_double(SWAPFLAG, store->nav_trk_offset_track, &buffer[index]); index += 8;
-		mb_put_binary_double(SWAPFLAG, store->nav_trk_offset_sol, &buffer[index]); index += 8;
-		mb_put_binary_double(SWAPFLAG, store->nav_trk_offset_eol, &buffer[index]); index += 8;
-		mb_put_binary_double(SWAPFLAG, store->nav_trk_distance_sol, &buffer[index]); index += 8;
-		mb_put_binary_double(SWAPFLAG, store->nav_trk_azimuth_sol, &buffer[index]); index += 8;
-		mb_put_binary_double(SWAPFLAG, store->nav_trk_distance_eol, &buffer[index]); index += 8;
-		mb_put_binary_double(SWAPFLAG, store->nav_trk_azimuth_eol, &buffer[index]); index += 8;
-
-		/* get end of group label */
-#ifdef DATAINPCBYTEORDER
-		strncpy(&buffer[index], "GSH#", 4);
-#else
-		strncpy(&buffer[index], "#HSG", 4);
-#endif
-		index += 4;
-		group_count += 20;
-
-		/* go back and fill in group byte count */
-		mb_put_binary_int(SWAPFLAG, group_count, &buffer[group_cnt_index]);
-
-		/* add group count to the frame count */
-		frame_count += group_count + 12;
-		}
-
-	/*****************************************/
-
-	/* write heave roll pitch group */
-	if (store->nav_group_hrp == MB_YES)
-		{
-		/* get group label */
-#ifdef DATAINPCBYTEORDER
-		strncpy(&buffer[index], "GSH$", 4);
-#else
-		strncpy(&buffer[index], "$HSG", 4);
-#endif
-		index += 4;
-
-		/* start the group byte count, but don't write it to buffer yet */
-		/* mark the byte count spot in the buffer and increment index so we skip it */
-		group_count = 0;
-		group_cnt_index = index;
-		index += 4;
-
-		/* get motion through water group */
-		group_id = MBSYS_XSE_NAV_GROUP_HRP;
-		mb_put_binary_int(SWAPFLAG, group_id, &buffer[index]); index += 4;
-		mb_put_binary_double(SWAPFLAG, store->nav_hrp_heave, &buffer[index]); index += 8;
-		mb_put_binary_double(SWAPFLAG, store->nav_hrp_roll, &buffer[index]); index += 8;
-		mb_put_binary_double(SWAPFLAG, store->nav_hrp_pitch, &buffer[index]); index += 8;
-
-		/* get end of group label */
-#ifdef DATAINPCBYTEORDER
-		strncpy(&buffer[index], "GSH#", 4);
-#else
-		strncpy(&buffer[index], "#HSG", 4);
-#endif
-		index += 4;
-		group_count += 20;
-
-		/* go back and fill in group byte count */
-		mb_put_binary_int(SWAPFLAG, group_count, &buffer[group_cnt_index]);
-
-		/* add group count to the frame count */
-		frame_count += group_count + 12;
-		}
-
-	/*****************************************/
-
-	/* write heave group */
-	if (store->nav_group_hrp == MB_YES)
-		{
-		/* get group label */
-#ifdef DATAINPCBYTEORDER
-		strncpy(&buffer[index], "GSH$", 4);
-#else
-		strncpy(&buffer[index], "$HSG", 4);
-#endif
-		index += 4;
-
-		/* start the group byte count, but don't write it to buffer yet */
-		/* mark the byte count spot in the buffer and increment index so we skip it */
-		group_count = 0;
-		group_cnt_index = index;
-		index += 4;
-
-		/* get motion through water group */
-		group_id = MBSYS_XSE_NAV_GROUP_HEAVE;
-		mb_put_binary_int(SWAPFLAG, group_id, &buffer[index]); index += 4;
-		mb_put_binary_double(SWAPFLAG, store->nav_hea_heave, &buffer[index]); index += 8;
-
-		/* get end of group label */
-#ifdef DATAINPCBYTEORDER
-		strncpy(&buffer[index], "GSH#", 4);
-#else
-		strncpy(&buffer[index], "#HSG", 4);
-#endif
-		index += 4;
-		group_count += 20;
-
-		/* go back and fill in group byte count */
-		mb_put_binary_int(SWAPFLAG, group_count, &buffer[group_cnt_index]);
-
-		/* add group count to the frame count */
-		frame_count += group_count + 12;
-		}
-
-	/*****************************************/
-
-	/* write roll group */
-	if (store->nav_group_roll == MB_YES)
-		{
-		/* get group label */
-#ifdef DATAINPCBYTEORDER
-		strncpy(&buffer[index], "GSH$", 4);
-#else
-		strncpy(&buffer[index], "$HSG", 4);
-#endif
-		index += 4;
-
-		/* start the group byte count, but don't write it to buffer yet */
-		/* mark the byte count spot in the buffer and increment index so we skip it */
-		group_count = 0;
-		group_cnt_index = index;
-		index += 4;
-
-		/* get motion through water group */
-		group_id = MBSYS_XSE_NAV_GROUP_ROLL;
-		mb_put_binary_int(SWAPFLAG, group_id, &buffer[index]); index += 4;
-		mb_put_binary_double(SWAPFLAG, store->nav_rol_roll, &buffer[index]); index += 8;
-
-		/* get end of group label */
-#ifdef DATAINPCBYTEORDER
-		strncpy(&buffer[index], "GSH#", 4);
-#else
-		strncpy(&buffer[index], "#HSG", 4);
-#endif
-		index += 4;
-		group_count += 20;
-
-		/* go back and fill in group byte count */
-		mb_put_binary_int(SWAPFLAG, group_count, &buffer[group_cnt_index]);
-
-		/* add group count to the frame count */
-		frame_count += group_count + 12;
-		}
-
-	/*****************************************/
-
-	/* write pitch group */
-	if (store->nav_group_pitch == MB_YES)
-		{
-		/* get group label */
-#ifdef DATAINPCBYTEORDER
-		strncpy(&buffer[index], "GSH$", 4);
-#else
-		strncpy(&buffer[index], "$HSG", 4);
-#endif
-		index += 4;
-
-		/* start the group byte count, but don't write it to buffer yet */
-		/* mark the byte count spot in the buffer and increment index so we skip it */
-		group_count = 0;
-		group_cnt_index = index;
-		index += 4;
-
-		/* get motion through water group */
-		group_id = MBSYS_XSE_NAV_GROUP_PITCH;
-		mb_put_binary_int(SWAPFLAG, group_id, &buffer[index]); index += 4;
-		mb_put_binary_double(SWAPFLAG, store->nav_pit_pitch, &buffer[index]); index += 8;
-
-		/* get end of group label */
-#ifdef DATAINPCBYTEORDER
-		strncpy(&buffer[index], "GSH#", 4);
-#else
-		strncpy(&buffer[index], "#HSG", 4);
-#endif
-		index += 4;
-		group_count += 20;
-
-		/* go back and fill in group byte count */
-		mb_put_binary_int(SWAPFLAG, group_count, &buffer[group_cnt_index]);
-
-		/* add group count to the frame count */
-		frame_count += group_count + 12;
-		}
-
-	/*****************************************/
-
-	/* write heading group */
-	if (store->nav_group_heading == MB_YES)
-		{
-		/* get group label */
-#ifdef DATAINPCBYTEORDER
-		strncpy(&buffer[index], "GSH$", 4);
-#else
-		strncpy(&buffer[index], "$HSG", 4);
-#endif
-		index += 4;
-
-		/* start the group byte count, but don't write it to buffer yet */
-		/* mark the byte count spot in the buffer and increment index so we skip it */
-		group_count = 0;
-		group_cnt_index = index;
-		index += 4;
-
-		/* get motion through water group */
-		group_id = MBSYS_XSE_NAV_GROUP_HEADING;
-		mb_put_binary_int(SWAPFLAG, group_id, &buffer[index]); index += 4;
-		mb_put_binary_double(SWAPFLAG, store->nav_hdg_heading, &buffer[index]); index += 8;
-
-		/* get end of group label */
-#ifdef DATAINPCBYTEORDER
-		strncpy(&buffer[index], "GSH#", 4);
-#else
-		strncpy(&buffer[index], "#HSG", 4);
-#endif
-		index += 4;
-		group_count += 12;
-
-		/* go back and fill in group byte count */
-		mb_put_binary_int(SWAPFLAG, group_count, &buffer[group_cnt_index]);
-
-		/* add group count to the frame count */
-		frame_count += group_count + 12;
-		}
-
-	/*****************************************/
-
-	/* write speed log group */
-	if (store->nav_group_log == MB_YES)
-		{
-		/* get group label */
-#ifdef DATAINPCBYTEORDER
-		strncpy(&buffer[index], "GSH$", 4);
-#else
-		strncpy(&buffer[index], "$HSG", 4);
-#endif
-		index += 4;
-
-		/* start the group byte count, but don't write it to buffer yet */
-		/* mark the byte count spot in the buffer and increment index so we skip it */
-		group_count = 0;
-		group_cnt_index = index;
-		index += 4;
-
-		/* get motion through water group */
-		group_id = MBSYS_XSE_NAV_GROUP_LOG;
-		mb_put_binary_int(SWAPFLAG, group_id, &buffer[index]); index += 4;
-		mb_put_binary_double(SWAPFLAG, store->nav_log_speed, &buffer[index]); index += 8;
-
-		/* get end of group label */
-#ifdef DATAINPCBYTEORDER
-		strncpy(&buffer[index], "GSH#", 4);
-#else
-		strncpy(&buffer[index], "#HSG", 4);
-#endif
-		index += 4;
-		group_count += 12;
-
-		/* go back and fill in group byte count */
-		mb_put_binary_int(SWAPFLAG, group_count, &buffer[group_cnt_index]);
-
-		/* add group count to the frame count */
-		frame_count += group_count + 12;
-		}
-
-	/*****************************************/
-
-	/* write gps altitude group */
-	if (store->nav_group_gps == MB_YES)
-		{
-		/* get group label */
-#ifdef DATAINPCBYTEORDER
-		strncpy(&buffer[index], "GSH$", 4);
-#else
-		strncpy(&buffer[index], "$HSG", 4);
-#endif
-		index += 4;
-
-		/* start the group byte count, but don't write it to buffer yet */
-		/* mark the byte count spot in the buffer and increment index so we skip it */
-		group_count = 0;
-		group_cnt_index = index;
-		index += 4;
-
-		/* get motion through water group */
-		group_id = MBSYS_XSE_NAV_GROUP_GPS;
-		mb_put_binary_int(SWAPFLAG, group_id, &buffer[index]); index += 4;
-		mb_put_binary_float(SWAPFLAG, store->nav_gps_altitude, &buffer[index]); index += 4;
-		mb_put_binary_float(SWAPFLAG, store->nav_gps_geoidalseparation, &buffer[index]); index += 4;
-
-		/* get end of group label */
-#ifdef DATAINPCBYTEORDER
-		strncpy(&buffer[index], "GSH#", 4);
-#else
-		strncpy(&buffer[index], "#HSG", 4);
-#endif
-		index += 4;
-		group_count += 12;
-
-		/* go back and fill in group byte count */
-		mb_put_binary_int(SWAPFLAG, group_count, &buffer[group_cnt_index]);
-
-		/* add group count to the frame count */
-		frame_count += group_count + 12;
-		}
-
-	/*****************************************/
-
-	/* get end of frame label */
-#ifdef DATAINPCBYTEORDER
-	strncpy(&buffer[index], "FSH#", 4);
-#else
-	strncpy(&buffer[index], "#HSF", 4);
-#endif
-	index += 4;
-
-	/* go back and fill in frame byte count */
-	mb_put_binary_int(SWAPFLAG, frame_count, &buffer[frame_cnt_index]);
-
-	/* set buffer size */
-	*buffer_size = index;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2       buffer_size:%d\n",*buffer_size);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_l3xseraw_wr_svp(int verbose,int *buffer_size,char *buffer,void *store_ptr,int *error)
-{
-	char	*function_name = "mbr_l3xseraw_wr_svp";
-	int	status = MB_SUCCESS;
-	struct mbsys_xse_struct *store;
-	int	index;
-	int frame_count;
-	int group_count;
-	int frame_cnt_index;
-	int group_cnt_index;
-	int frame_id;
-	int group_id;
-	int write_conductivity = MB_NO;
-	int write_salinity = MB_NO;
-	int write_temperature = MB_NO;
-	int write_pressure = MB_NO;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-	    {
-	    fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-	    fprintf(stderr,"dbg2  Input arguments:\n");
-	    fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-	    fprintf(stderr,"dbg2       buffer:     %p\n",(void *)buffer);
-	    fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-	    }
-
-	/* get pointer to store data structure */
-	store = (struct mbsys_xse_struct *) store_ptr;
-
-	/* print debug statements */
-	if (verbose >= 5)
-	    {
-	    fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-	    fprintf(stderr,"dbg5       svp_source:          %d\n",store->svp_source);
-	    fprintf(stderr,"dbg5       svp_sec:             %u\n",store->svp_sec);
-	    fprintf(stderr,"dbg5       svp_usec:            %u\n",store->svp_usec);
-	    fprintf(stderr,"dbg5       svp_nsvp:            %d\n",store->svp_nsvp);
-	    fprintf(stderr,"dbg5       svp_nctd:            %d\n",store->svp_nctd);
-	    fprintf(stderr,"dbg5       svp_ssv:             %f\n",store->svp_ssv);
-	    for (i=0;i<store->svp_nsvp;i++)
-		fprintf(stderr,"dbg5       svp[%d]:	        %f %f\n",
-		    i, store->svp_depth[i], store->svp_velocity[i]);
-	    for (i=0;i<store->svp_nctd;i++)
-		fprintf(stderr,"dbg5       cstd[%d]:        %f %f %f %f\n",
-		    i, store->svp_conductivity[i], store->svp_salinity[i],
-		    store->svp_temperature[i], store->svp_pressure[i]);
-	    }
-
-	/* get the frame label */
-	index = 0;
-#ifdef DATAINPCBYTEORDER
-	strncpy(&buffer[index], "FSH$", 4);
-#else
-	strncpy(&buffer[index], "$HSF", 4);
-#endif
-	index += 4;
-
-	/* start the frame byte count, but don't write it to buffer yet */
-	/* increment index so we skip the count value in the buffer */
-	frame_count = 0;
-	frame_cnt_index = index;
-	index += 4;
-
-	/* get frame time */
-	frame_id = MBSYS_XSE_SVP_FRAME;
-	mb_put_binary_int(SWAPFLAG, frame_id, &buffer[index]); index += 4;
-	mb_put_binary_int(SWAPFLAG, store->svp_source, &buffer[index]); index += 4;
-	mb_put_binary_int(SWAPFLAG, store->svp_sec, &buffer[index]); index += 4;
-	mb_put_binary_int(SWAPFLAG, store->svp_usec, &buffer[index]); index += 4;
-	frame_count += 16;
-
-	/* get depth and velocity groups */
-	if (store->svp_nsvp > 0)
-	    {
-	    /* get group label */
-#ifdef DATAINPCBYTEORDER
-	    strncpy(&buffer[index], "GSH$", 4);
-#else
-	    strncpy(&buffer[index], "$HSG", 4);
-#endif
-	    index += 4;
-
-	    /* start the group byte count, but don't write it to buffer yet */
-	    /* mark the byte count spot in the buffer and increment index so we skip it */
-	    group_count = 0;
-	    group_cnt_index = index;
-	    index += 4;
-
-	    /* get depth array */
-	    group_id = MBSYS_XSE_SVP_GROUP_DEPTH;
-	    mb_put_binary_int(SWAPFLAG, group_id, &buffer[index]); index += 4;
-	    mb_put_binary_int(SWAPFLAG, store->svp_nsvp, &buffer[index]); index += 4;
-	    for (i=0;i<store->svp_nsvp;i++)
-		{
-		mb_put_binary_double(SWAPFLAG, store->svp_depth[i], &buffer[index]); index += 8;
-		}
-
-	    /* get end of group label */
-#ifdef DATAINPCBYTEORDER
-	    strncpy(&buffer[index], "GSH#", 4);
-#else
-	    strncpy(&buffer[index], "#HSG", 4);
-#endif
-	    index += 4;
-	    group_count += 8 + store->svp_nsvp*8;
-
-	    /* go back and fill in group byte count */
-	    mb_put_binary_int(SWAPFLAG, group_count, &buffer[group_cnt_index]);
-
-	    /* add group count to the frame count */
-	    frame_count += group_count + 12;
-
-	    /* get group label */
-#ifdef DATAINPCBYTEORDER
-	    strncpy(&buffer[index], "GSH$", 4);
-#else
-	    strncpy(&buffer[index], "$HSG", 4);
-#endif
-	    index += 4;
-
-	    /* start the group byte count, but don't write it to buffer yet */
-	    /* mark the byte count spot in the buffer and increment index so we skip it */
-	    group_count = 0;
-	    group_cnt_index = index;
-	    index += 4;
-
-	    /* get depth array */
-	    group_id = MBSYS_XSE_SVP_GROUP_VELOCITY;
-	    mb_put_binary_int(SWAPFLAG, group_id, &buffer[index]); index += 4;
-	    mb_put_binary_int(SWAPFLAG, store->svp_nsvp, &buffer[index]); index += 4;
-	    for (i=0;i<store->svp_nsvp;i++)
-			{
-			mb_put_binary_double(SWAPFLAG, store->svp_velocity[i], &buffer[index]); index += 8;
-			}
-	    mb_put_binary_double(SWAPFLAG, store->svp_ssv_depth, &buffer[index]); index += 8;
-	    buffer[index] = store->svp_ssv_depthflag; index++;
-
-	    /* get end of group label */
-#ifdef DATAINPCBYTEORDER
-	    strncpy(&buffer[index], "GSH#", 4);
-#else
-	    strncpy(&buffer[index], "#HSG", 4);
-#endif
-	    index += 4;
-	    group_count += 17 + store->svp_nsvp*8;
-
-	    /* go back and fill in group byte count */
-	    mb_put_binary_int(SWAPFLAG, group_count, &buffer[group_cnt_index]);
-
-	    /* add group count to the frame count */
-	    frame_count += group_count + 12;
-	    }
-
-	/* figure out which ctd groups are nonzero */
-	if (store->svp_nctd > 0)
-	    {
-	    for (i=0;i<store->svp_nctd;i++)
-		{
-		if (store->svp_conductivity[i] != 0.0)
-			write_conductivity = MB_YES;
-		if (store->svp_salinity[i] != 0.0)
-			write_salinity = MB_YES;
-		if (store->svp_temperature[i] != 0.0)
-			write_temperature = MB_YES;
-		if (store->svp_pressure[i] != 0.0)
-			write_pressure = MB_YES;
-		}
-	    }
-
-	/* get conductivity group */
-	if (store->svp_nctd > 0
-		&& write_conductivity == MB_YES)
-	    {
-	    /* get group label */
-#ifdef DATAINPCBYTEORDER
-	    strncpy(&buffer[index], "GSH$", 4);
-#else
-	    strncpy(&buffer[index], "$HSG", 4);
-#endif
-	    index += 4;
-
-	    /* start the group byte count, but don't write it to buffer yet */
-	    /* mark the byte count spot in the buffer and increment index so we skip it */
-	    group_count = 0;
-	    group_cnt_index = index;
-	    index += 4;
-
-	    /* get conductivity array */
-	    group_id = MBSYS_XSE_SVP_GROUP_CONDUCTIVITY;
-	    mb_put_binary_int(SWAPFLAG, group_id, &buffer[index]); index += 4;
-	    mb_put_binary_int(SWAPFLAG, store->svp_nctd, &buffer[index]); index += 4;
-	    for (i=0;i<store->svp_nctd;i++)
-			{
-			mb_put_binary_double(SWAPFLAG, store->svp_conductivity[i], &buffer[index]); index += 8;
-			}
-
-	    /* get end of group label */
-#ifdef DATAINPCBYTEORDER
-	    strncpy(&buffer[index], "GSH#", 4);
-#else
-	    strncpy(&buffer[index], "#HSG", 4);
-#endif
-	    index += 4;
-	    group_count += 8 + store->svp_nctd*8;
-
-	    /* go back and fill in group byte count */
-	    mb_put_binary_int(SWAPFLAG, group_count, &buffer[group_cnt_index]);
-
-	    /* add group count to the frame count */
-	    frame_count += group_count + 12;
-	    }
-
-	/* get salinity group */
-	if (store->svp_nctd > 0
-		&& write_salinity == MB_YES)
-	    {
-	    /* get group label */
-#ifdef DATAINPCBYTEORDER
-	    strncpy(&buffer[index], "GSH$", 4);
-#else
-	    strncpy(&buffer[index], "$HSG", 4);
-#endif
-	    index += 4;
-
-	    /* start the group byte count, but don't write it to buffer yet */
-	    /* mark the byte count spot in the buffer and increment index so we skip it */
-	    group_count = 0;
-	    group_cnt_index = index;
-	    index += 4;
-
-	    /* get salinity array */
-	    group_id = MBSYS_XSE_SVP_GROUP_SALINITY;
-	    mb_put_binary_int(SWAPFLAG, group_id, &buffer[index]); index += 4;
-	    mb_put_binary_int(SWAPFLAG, store->svp_nctd, &buffer[index]); index += 4;
-	    for (i=0;i<store->svp_nctd;i++)
-			{
-			mb_put_binary_double(SWAPFLAG, store->svp_salinity[i], &buffer[index]); index += 8;
-			}
-
-	    /* get end of group label */
-#ifdef DATAINPCBYTEORDER
-	    strncpy(&buffer[index], "GSH#", 4);
-#else
-	    strncpy(&buffer[index], "#HSG", 4);
-#endif
-	    index += 4;
-	    group_count += 8 + store->svp_nctd*8;
-
-	    /* go back and fill in group byte count */
-	    mb_put_binary_int(SWAPFLAG, group_count, &buffer[group_cnt_index]);
-
-	    /* add group count to the frame count */
-	    frame_count += group_count + 12;
-	    }
-
-	/* get temperature group */
-	if (store->svp_nctd > 0
-		&& write_temperature == MB_YES)
-	    {
-	    /* get group label */
-#ifdef DATAINPCBYTEORDER
-	    strncpy(&buffer[index], "GSH$", 4);
-#else
-	    strncpy(&buffer[index], "$HSG", 4);
-#endif
-	    index += 4;
-
-	    /* start the group byte count, but don't write it to buffer yet */
-	    /* mark the byte count spot in the buffer and increment index so we skip it */
-	    group_count = 0;
-	    group_cnt_index = index;
-	    index += 4;
-
-	    /* get temperature array */
-	    group_id = MBSYS_XSE_SVP_GROUP_TEMP;
-	    mb_put_binary_int(SWAPFLAG, group_id, &buffer[index]); index += 4;
-	    mb_put_binary_int(SWAPFLAG, store->svp_nctd, &buffer[index]); index += 4;
-	    for (i=0;i<store->svp_nctd;i++)
-			{
-			mb_put_binary_double(SWAPFLAG, store->svp_temperature[i], &buffer[index]); index += 8;
-			}
-
-	    /* get end of group label */
-#ifdef DATAINPCBYTEORDER
-	    strncpy(&buffer[index], "GSH#", 4);
-#else
-	    strncpy(&buffer[index], "#HSG", 4);
-#endif
-	    index += 4;
-	    group_count += 8 + store->svp_nctd*8;
-
-	    /* go back and fill in group byte count */
-	    mb_put_binary_int(SWAPFLAG, group_count, &buffer[group_cnt_index]);
-
-	    /* add group count to the frame count */
-	    frame_count += group_count + 12;
-	    }
-
-	/* get pressure group */
-	if (store->svp_nctd > 0
-		&& write_pressure == MB_YES)
-	    {
-	    /* get group label */
-#ifdef DATAINPCBYTEORDER
-	    strncpy(&buffer[index], "GSH$", 4);
-#else
-	    strncpy(&buffer[index], "$HSG", 4);
-#endif
-	    index += 4;
-
-	    /* start the group byte count, but don't write it to buffer yet */
-	    /* mark the byte count spot in the buffer and increment index so we skip it */
-	    group_count = 0;
-	    group_cnt_index = index;
-	    index += 4;
-
-	    /* get pressure array */
-	    group_id = MBSYS_XSE_SVP_GROUP_PRESSURE;
-	    mb_put_binary_int(SWAPFLAG, group_id, &buffer[index]); index += 4;
-	    mb_put_binary_int(SWAPFLAG, store->svp_nctd, &buffer[index]); index += 4;
-	    for (i=0;i<store->svp_nctd;i++)
-			{
-			mb_put_binary_double(SWAPFLAG, store->svp_pressure[i], &buffer[index]); index += 8;
-			}
-
-	    /* get end of group label */
-#ifdef DATAINPCBYTEORDER
-	    strncpy(&buffer[index], "GSH#", 4);
-#else
-	    strncpy(&buffer[index], "#HSG", 4);
-#endif
-	    index += 4;
-	    group_count += 8 + store->svp_nctd*8;
-
-	    /* go back and fill in group byte count */
-	    mb_put_binary_int(SWAPFLAG, group_count, &buffer[group_cnt_index]);
-
-	    /* add group count to the frame count */
-	    frame_count += group_count + 12;
-	    }
-
-	/* get ssv group */
-	if (store->svp_ssv > 0.0)
-	    {
-	    /* get group label */
-#ifdef DATAINPCBYTEORDER
-	    strncpy(&buffer[index], "GSH$", 4);
-#else
-	    strncpy(&buffer[index], "$HSG", 4);
-#endif
-	    index += 4;
-
-	    /* start the group byte count, but don't write it to buffer yet */
-	    /* mark the byte count spot in the buffer and increment index so we skip it */
-	    group_count = 0;
-	    group_cnt_index = index;
-	    index += 4;
-
-	    /* get ssv */
-	    group_id = MBSYS_XSE_SVP_GROUP_SSV;
-	    mb_put_binary_int(SWAPFLAG, group_id, &buffer[index]); index += 4;
-	    mb_put_binary_double(SWAPFLAG, store->svp_ssv, &buffer[index]); index += 8;
-	    mb_put_binary_double(SWAPFLAG, store->svp_ssv_depth, &buffer[index]); index += 8;
-	    buffer[index] = store->svp_ssv_depthflag; index++;
-
-	    /* get end of group label */
-#ifdef DATAINPCBYTEORDER
-	    strncpy(&buffer[index], "GSH#", 4);
-#else
-	    strncpy(&buffer[index], "#HSG", 4);
-#endif
-	    index += 4;
-	    group_count += 21;
-
-	    /* go back and fill in group byte count */
-	    mb_put_binary_int(SWAPFLAG, group_count, &buffer[group_cnt_index]);
-
-	    /* add group count to the frame count */
-	    frame_count += group_count + 12;
-	    }
-
-	/* get end of frame label */
-#ifdef DATAINPCBYTEORDER
-	strncpy(&buffer[index], "FSH#", 4);
-#else
-	strncpy(&buffer[index], "#HSF", 4);
-#endif
-	index += 4;
-
-	/* go back and fill in frame byte count */
-	mb_put_binary_int(SWAPFLAG, frame_count, &buffer[frame_cnt_index]);
-
-	/* set buffer size */
-	*buffer_size = index;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2       buffer_size:%d\n",*buffer_size);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_l3xseraw_wr_ship(int verbose,int *buffer_size,char *buffer,void *store_ptr,int *error)
-{
-	char	*function_name = "mbr_l3xseraw_wr_ship";
-	int	status = MB_SUCCESS;
-	struct mbsys_xse_struct *store;
-	int	index;
-	int frame_count;
-	int group_count;
-	int frame_cnt_index;
-	int group_cnt_index;
-	int frame_id;
-	int group_id;
-	int	nchar;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-	    {
-	    fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-	    fprintf(stderr,"dbg2  Input arguments:\n");
-	    fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-	    fprintf(stderr,"dbg2       buffer:     %p\n",(void *)buffer);
-	    fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-	    }
-
-	/* get pointer to store data structure */
-	store = (struct mbsys_xse_struct *) store_ptr;
-
-	/* print debug statements */
-	if (verbose >= 5)
-	    {
-	    fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-	    fprintf(stderr,"dbg5       par_source:          %d\n",store->par_source);
-	    fprintf(stderr,"dbg5       par_sec:             %u\n",store->par_sec);
-	    fprintf(stderr,"dbg5       par_usec:            %u\n",store->par_usec);
-	    fprintf(stderr,"dbg5       par_ship_name:       %s\n",store->par_ship_name);
-	    fprintf(stderr,"dbg5       par_ship_length:     %f\n",store->par_ship_length);
-	    fprintf(stderr,"dbg5       par_ship_beam:       %f\n",store->par_ship_beam);
-	    fprintf(stderr,"dbg5       par_ship_draft:      %f\n",store->par_ship_draft);
-	    fprintf(stderr,"dbg5       par_ship_height:     %f\n",store->par_ship_height);
-	    fprintf(stderr,"dbg5       par_ship_displacement: %f\n",store->par_ship_displacement);
-	    fprintf(stderr,"dbg5       par_ship_weight:     %f\n",store->par_ship_weight);
-	    for (i=0;i<store->par_ship_nsensor;i++)
-		{
-		fprintf(stderr,"dbg5       par_ship_sensor_id[%d]:        %d\n",i,store->par_ship_sensor_id[i]);
-		fprintf(stderr,"dbg5       par_ship_sensor_type[%d]:      %d\n",i,store->par_ship_sensor_type[i]);
-		fprintf(stderr,"dbg5       par_ship_sensor_frequency[%d]: %d\n",i,store->par_ship_sensor_frequency[i]);
-		}
-	    fprintf(stderr,"dbg5       par_parameter:       %d\n",store->par_parameter);
-	    fprintf(stderr,"dbg5       par_roll_bias:       %f\n",store->par_roll_bias);
-	    fprintf(stderr,"dbg5       par_pitch_bias:      %f\n",store->par_pitch_bias);
-	    fprintf(stderr,"dbg5       par_heading_bias:    %f\n",store->par_heading_bias);
-	    fprintf(stderr,"dbg5       par_time_delay:      %f\n",store->par_time_delay);
-	    fprintf(stderr,"dbg5       par_trans_x_port:    %f\n",store->par_trans_x_port);
-	    fprintf(stderr,"dbg5       par_trans_y_port:    %f\n",store->par_trans_y_port);
-	    fprintf(stderr,"dbg5       par_trans_z_port:    %f\n",store->par_trans_z_port);
-	    fprintf(stderr,"dbg5       par_trans_x_stbd:    %f\n",store->par_trans_x_stbd);
-	    fprintf(stderr,"dbg5       par_trans_y_stbd:    %f\n",store->par_trans_y_stbd);
-	    fprintf(stderr,"dbg5       par_trans_z_stbd:    %f\n",store->par_trans_z_stbd);
-	    fprintf(stderr,"dbg5       par_trans_err_port:  %f\n",store->par_trans_err_port);
-	    fprintf(stderr,"dbg5       par_trans_err_stbd:  %f\n",store->par_trans_err_stbd);
-	    fprintf(stderr,"dbg5       par_nav_x:           %f\n",store->par_nav_x);
-	    fprintf(stderr,"dbg5       par_nav_y:           %f\n",store->par_nav_y);
-	    fprintf(stderr,"dbg5       par_nav_z:           %f\n",store->par_nav_z);
-	    fprintf(stderr,"dbg5       par_hrp_x:           %f\n",store->par_hrp_x);
-	    fprintf(stderr,"dbg5       par_hrp_y:           %f\n",store->par_hrp_y);
-	    fprintf(stderr,"dbg5       par_hrp_z:           %f\n",store->par_hrp_z);
-	    fprintf(stderr,"dbg5       par_navigationandmotion: %d\n",store->par_navigationandmotion);
-	    fprintf(stderr,"dbg5       par_nam_roll_bias:       %f\n",store->par_nam_roll_bias);
-	    fprintf(stderr,"dbg5       par_nam_pitch_bias:      %f\n",store->par_nam_pitch_bias);
-	    fprintf(stderr,"dbg5       par_nam_heave_bias:      %f\n",store->par_nam_heave_bias);
-	    fprintf(stderr,"dbg5       par_nam_heading_bias:    %f\n",store->par_nam_heading_bias);
-	    fprintf(stderr,"dbg5       par_nam_time_delay:      %f\n",store->par_nam_time_delay);
-	    fprintf(stderr,"dbg5       par_nam_nav_x:           %f\n",store->par_nam_nav_x);
-	    fprintf(stderr,"dbg5       par_nam_nav_y:           %f\n",store->par_nam_nav_y);
-	    fprintf(stderr,"dbg5       par_nam_nav_z:           %f\n",store->par_nam_nav_z);
-	    fprintf(stderr,"dbg5       par_nam_hrp_x:           %f\n",store->par_nam_hrp_x);
-	    fprintf(stderr,"dbg5       par_nam_hrp_y:           %f\n",store->par_nam_hrp_y);
-	    fprintf(stderr,"dbg5       par_nam_hrp_z:           %f\n",store->par_nam_hrp_z);
-	    fprintf(stderr,"dbg5       par_xdr_num_transducer:  %d\n",store->par_xdr_num_transducer);
-	    fprintf(stderr,"dbg5       # sensor xducer freq side roll pitch azi dist\n");
-	    for (i=0;i<store->par_xdr_num_transducer;i++)
-	    	fprintf(stderr,"dbg5       %d %d %d %d %d %f %f %f %f\n", i, store->par_xdr_sensorid[i], store->par_xdr_transducer[i],
-	    							store->par_xdr_frequency[i], store->par_xdr_side[i],
-								store->par_xdr_mountingroll[i], store->par_xdr_mountingpitch[i],
-								store->par_xdr_mountingazimuth[i], store->par_xdr_mountingdistance[i]);
-	    fprintf(stderr,"dbg5       # x y z roll pitch azimuth\n");
-	    for (i=0;i<store->par_xdr_num_transducer;i++)
-	    	fprintf(stderr,"dbg5       %d %f %f %f %f %f %f\n", i, store->par_xdr_x[i], store->par_xdr_y[i],
-	    							store->par_xdr_z[i], store->par_xdr_roll[i],
-								store->par_xdr_pitch[i], store->par_xdr_azimuth[i]);
-	    fprintf(stderr,"dbg5       par_xdx_num_transducer:  %d\n",store->par_xdx_num_transducer);
-	    fprintf(stderr,"dbg5       # roll pitch azimuth\n");
-	    for (i=0;i<store->par_xdx_num_transducer;i++)
-	    	fprintf(stderr,"dbg5       %d %d %d %d\n", i, store->par_xdx_roll[i], store->par_xdx_pitch[i], store->par_xdx_azimuth[i]);
-	    }
-
-	/* get the frame label */
-	index = 0;
-#ifdef DATAINPCBYTEORDER
-	strncpy(&buffer[index], "FSH$", 4);
-#else
-	strncpy(&buffer[index], "$HSF", 4);
-#endif
-	index += 4;
-
-	/* start the frame byte count, but don't write it to buffer yet */
-	/* increment index so we skip the count value in the buffer */
-	frame_count = 0;
-	frame_cnt_index = index;
-	index += 4;
-
-	/* get frame time */
-	frame_id = MBSYS_XSE_SHP_FRAME;
-	mb_put_binary_int(SWAPFLAG, frame_id, &buffer[index]); index += 4;
-	mb_put_binary_int(SWAPFLAG, store->par_source, &buffer[index]); index += 4;
-	mb_put_binary_int(SWAPFLAG, store->par_sec, &buffer[index]); index += 4;
-	mb_put_binary_int(SWAPFLAG, store->par_usec, &buffer[index]); index += 4;
-	frame_count += 16;
-
-	/*****************************************/
-
-	/* get group label */
-#ifdef DATAINPCBYTEORDER
-	strncpy(&buffer[index], "GSH$", 4);
-#else
-	strncpy(&buffer[index], "$HSG", 4);
-#endif
-	index += 4;
-
-	/* start the group byte count, but don't write it to buffer yet */
-	/* mark the byte count spot in the buffer and increment index so we skip it */
-	group_count = 0;
-	group_cnt_index = index;
-	index += 4;
-
-	/* get general group */
-	group_id = MBSYS_XSE_SHP_GROUP_GEN;
-	mb_put_binary_int(SWAPFLAG, group_id, &buffer[index]); index += 4;
-	nchar = strlen(store->par_ship_name);
-	mb_put_binary_int(SWAPFLAG, nchar, &buffer[index]); index += 4;
-	for (i=0;i<nchar;i++)
-		{
-		buffer[index] = store->par_ship_name[i]; index++;
-		}
-	mb_put_binary_double(SWAPFLAG, store->par_ship_length, &buffer[index]); index += 8;
-	mb_put_binary_double(SWAPFLAG, store->par_ship_beam, &buffer[index]); index += 8;
-	mb_put_binary_double(SWAPFLAG, store->par_ship_draft, &buffer[index]); index += 8;
-	mb_put_binary_double(SWAPFLAG, store->par_ship_height, &buffer[index]); index += 8;
-	mb_put_binary_double(SWAPFLAG, store->par_ship_displacement, &buffer[index]); index += 8;
-	mb_put_binary_double(SWAPFLAG, store->par_ship_weight, &buffer[index]); index += 8;
-
-	/* get end of group label */
-#ifdef DATAINPCBYTEORDER
-	strncpy(&buffer[index], "GSH#", 4);
-#else
-	strncpy(&buffer[index], "#HSG", 4);
-#endif
-	index += 4;
-	group_count += nchar + 56;
-
-	/* go back and fill in group byte count */
-	mb_put_binary_int(SWAPFLAG, group_count, &buffer[group_cnt_index]);
-
-	/* add group count to the frame count */
-	frame_count += group_count + 12;
-
-	/*****************************************/
-
-	if (store->par_ship_nsensor > 0)
-		{
-		/* get group label */
-#ifdef DATAINPCBYTEORDER
-		strncpy(&buffer[index], "GSH$", 4);
-#else
-		strncpy(&buffer[index], "$HSG", 4);
-#endif
-		index += 4;
-
-		/* start the group byte count, but don't write it to buffer yet */
-		/* mark the byte count spot in the buffer and increment index so we skip it */
-		group_count = 0;
-		group_cnt_index = index;
-		index += 4;
-
-		/* get sensors group */
-		group_id = MBSYS_XSE_SHP_GROUP_SENSORS;
-		mb_put_binary_int(SWAPFLAG, group_id, &buffer[index]); index += 4;
-		mb_put_binary_int(SWAPFLAG, store->par_ship_nsensor, &buffer[index]); index += 4;
-		for (i=0;i<store->par_ship_nsensor;i++)
-			{
-			mb_put_binary_int(SWAPFLAG, store->par_ship_sensor_id[i], &buffer[index]); index += 4;
-			}
-		for (i=0;i<store->par_ship_nsensor;i++)
-			{
-			mb_put_binary_int(SWAPFLAG, store->par_ship_sensor_type[i], &buffer[index]); index += 4;
-			}
-		for (i=0;i<store->par_ship_nsensor;i++)
-			{
-			mb_put_binary_int(SWAPFLAG, store->par_ship_sensor_frequency[i], &buffer[index]); index += 4;
-			}
-
-		/* get end of group label */
-#ifdef DATAINPCBYTEORDER
-		strncpy(&buffer[index], "GSH#", 4);
-#else
-		strncpy(&buffer[index], "#HSG", 4);
-#endif
-		index += 4;
-		group_count += 12 * store->par_ship_nsensor + 8;
-
-		/* go back and fill in group byte count */
-		mb_put_binary_int(SWAPFLAG, group_count, &buffer[group_cnt_index]);
-
-		/* add group count to the frame count */
-		frame_count += group_count + 12;
-		}
-
-	/*****************************************/
-
-	if (store->par_parameter == MB_YES)
-		{
-		/* get group label */
-#ifdef DATAINPCBYTEORDER
-		strncpy(&buffer[index], "GSH$", 4);
-#else
-		strncpy(&buffer[index], "$HSG", 4);
-#endif
-		index += 4;
-
-		/* start the group byte count, but don't write it to buffer yet */
-		/* mark the byte count spot in the buffer and increment index so we skip it */
-		group_count = 0;
-		group_cnt_index = index;
-		index += 4;
-
-		/* get parameter group */
-		group_id = MBSYS_XSE_SHP_GROUP_PARAMETER;
-		mb_put_binary_int(SWAPFLAG, group_id, &buffer[index]); index += 4;
-		mb_put_binary_float(SWAPFLAG, store->par_roll_bias, &buffer[index]); index += 4;
-		mb_put_binary_float(SWAPFLAG, store->par_pitch_bias, &buffer[index]); index += 4;
-		mb_put_binary_float(SWAPFLAG, store->par_heading_bias, &buffer[index]); index += 4;
-		mb_put_binary_float(SWAPFLAG, store->par_time_delay, &buffer[index]); index += 4;
-		mb_put_binary_float(SWAPFLAG, store->par_trans_x_port, &buffer[index]); index += 4;
-		mb_put_binary_float(SWAPFLAG, store->par_trans_y_port, &buffer[index]); index += 4;
-		mb_put_binary_float(SWAPFLAG, store->par_trans_z_port, &buffer[index]); index += 4;
-		mb_put_binary_float(SWAPFLAG, store->par_trans_x_stbd, &buffer[index]); index += 4;
-		mb_put_binary_float(SWAPFLAG, store->par_trans_y_stbd, &buffer[index]); index += 4;
-		mb_put_binary_float(SWAPFLAG, store->par_trans_z_stbd, &buffer[index]); index += 4;
-		mb_put_binary_float(SWAPFLAG, store->par_trans_err_port, &buffer[index]); index += 4;
-		mb_put_binary_float(SWAPFLAG, store->par_trans_err_stbd, &buffer[index]); index += 4;
-		mb_put_binary_float(SWAPFLAG, store->par_nav_x, &buffer[index]); index += 4;
-		mb_put_binary_float(SWAPFLAG, store->par_nav_y, &buffer[index]); index += 4;
-		mb_put_binary_float(SWAPFLAG, store->par_nav_z, &buffer[index]); index += 4;
-		mb_put_binary_float(SWAPFLAG, store->par_hrp_x, &buffer[index]); index += 4;
-		mb_put_binary_float(SWAPFLAG, store->par_hrp_y, &buffer[index]); index += 4;
-		mb_put_binary_float(SWAPFLAG, store->par_hrp_z, &buffer[index]); index += 4;
-
-		/* get end of group label */
-#ifdef DATAINPCBYTEORDER
-		strncpy(&buffer[index], "GSH#", 4);
-#else
-		strncpy(&buffer[index], "#HSG", 4);
-#endif
-		index += 4;
-		group_count += 76;
-
-		/* go back and fill in group byte count */
-		mb_put_binary_int(SWAPFLAG, group_count, &buffer[group_cnt_index]);
-
-		/* add group count to the frame count */
-		frame_count += group_count + 12;
-		}
-
-	/*****************************************/
-
-	if (store->par_navigationandmotion == MB_YES)
-		{
-		/* get group label */
-#ifdef DATAINPCBYTEORDER
-		strncpy(&buffer[index], "GSH$", 4);
-#else
-		strncpy(&buffer[index], "$HSG", 4);
-#endif
-		index += 4;
-
-		/* start the group byte count, but don't write it to buffer yet */
-		/* mark the byte count spot in the buffer and increment index so we skip it */
-		group_count = 0;
-		group_cnt_index = index;
-		index += 4;
-
-		/* get parameter group */
-		group_id = MBSYS_XSE_SHP_GROUP_NAVIGATIONANDMOTION;
-		mb_put_binary_int(SWAPFLAG, group_id, &buffer[index]); index += 4;
-		mb_put_binary_double(SWAPFLAG, store->par_nam_roll_bias, &buffer[index]); index += 8;
-		mb_put_binary_double(SWAPFLAG, store->par_nam_pitch_bias, &buffer[index]); index += 8;
-		mb_put_binary_double(SWAPFLAG, store->par_nam_heave_bias, &buffer[index]); index += 8;
-		mb_put_binary_double(SWAPFLAG, store->par_nam_heading_bias, &buffer[index]); index += 8;
-		mb_put_binary_double(SWAPFLAG, store->par_nam_time_delay, &buffer[index]); index += 8;
-		mb_put_binary_double(SWAPFLAG, store->par_nam_nav_x, &buffer[index]); index += 8;
-		mb_put_binary_double(SWAPFLAG, store->par_nam_nav_y, &buffer[index]); index += 8;
-		mb_put_binary_double(SWAPFLAG, store->par_nam_nav_z, &buffer[index]); index += 8;
-		mb_put_binary_double(SWAPFLAG, store->par_nam_hrp_x, &buffer[index]); index += 8;
-		mb_put_binary_double(SWAPFLAG, store->par_nam_hrp_y, &buffer[index]); index += 8;
-		mb_put_binary_double(SWAPFLAG, store->par_nam_hrp_z, &buffer[index]); index += 8;
-
-		/* get end of group label */
-#ifdef DATAINPCBYTEORDER
-		strncpy(&buffer[index], "GSH#", 4);
-#else
-		strncpy(&buffer[index], "#HSG", 4);
-#endif
-		index += 4;
-		group_count += 92;
-
-		/* go back and fill in group byte count */
-		mb_put_binary_int(SWAPFLAG, group_count, &buffer[group_cnt_index]);
-
-		/* add group count to the frame count */
-		frame_count += group_count + 12;
-		}
-
-	/*****************************************/
-
-	if (store->par_xdr_num_transducer >0)
-		{
-		/* get group label */
-#ifdef DATAINPCBYTEORDER
-		strncpy(&buffer[index], "GSH$", 4);
-#else
-		strncpy(&buffer[index], "$HSG", 4);
-#endif
-		index += 4;
-
-		/* start the group byte count, but don't write it to buffer yet */
-		/* mark the byte count spot in the buffer and increment index so we skip it */
-		group_count = 0;
-		group_cnt_index = index;
-		index += 4;
-
-		/* get parameter group */
-		group_id = MBSYS_XSE_SHP_GROUP_TRANSDUCER;
-		mb_put_binary_int(SWAPFLAG, group_id, &buffer[index]); index += 4;
-		mb_put_binary_int(SWAPFLAG, store->par_xdr_num_transducer, &buffer[index]); index += 4;
-		for (i=0;i<store->par_xdr_num_transducer;i++)
-			{
-			mb_put_binary_int(SWAPFLAG, store->par_xdr_sensorid[i], &buffer[index]); index += 4;
-			mb_put_binary_int(SWAPFLAG, store->par_xdr_frequency[i], &buffer[index]); index += 4;
-			buffer[index] =  store->par_xdr_transducer[i]; index++;
-			buffer[index] =  store->par_xdr_side[i]; index++;
-			mb_put_binary_double(SWAPFLAG, store->par_xdr_mountingroll[i], &buffer[index]); index += 8;
-			mb_put_binary_double(SWAPFLAG, store->par_xdr_mountingpitch[i], &buffer[index]); index += 8;
-			mb_put_binary_double(SWAPFLAG, store->par_xdr_mountingazimuth[i], &buffer[index]); index += 8;
-			mb_put_binary_double(SWAPFLAG, store->par_xdr_mountingdistance[i], &buffer[index]); index += 8;
-			mb_put_binary_double(SWAPFLAG, store->par_xdr_x[i], &buffer[index]); index += 8;
-			mb_put_binary_double(SWAPFLAG, store->par_xdr_y[i], &buffer[index]); index += 8;
-			mb_put_binary_double(SWAPFLAG, store->par_xdr_z[i], &buffer[index]); index += 8;
-			mb_put_binary_double(SWAPFLAG, store->par_xdr_roll[i], &buffer[index]); index += 8;
-			mb_put_binary_double(SWAPFLAG, store->par_xdr_pitch[i], &buffer[index]); index += 8;
-			mb_put_binary_double(SWAPFLAG, store->par_xdr_azimuth[i], &buffer[index]); index += 8;
-			}
-
-		/* get end of group label */
-#ifdef DATAINPCBYTEORDER
-		strncpy(&buffer[index], "GSH#", 4);
-#else
-		strncpy(&buffer[index], "#HSG", 4);
-#endif
-		index += 4;
-		group_count += 8 + store->par_xdr_num_transducer * 90;
-
-		/* go back and fill in group byte count */
-		mb_put_binary_int(SWAPFLAG, group_count, &buffer[group_cnt_index]);
-
-		/* add group count to the frame count */
-		frame_count += group_count + 12;
-		}
-
-	/*****************************************/
-
-	if (store->par_xdx_num_transducer >0)
-		{
-		/* get group label */
-#ifdef DATAINPCBYTEORDER
-		strncpy(&buffer[index], "GSH$", 4);
-#else
-		strncpy(&buffer[index], "$HSG", 4);
-#endif
-		index += 4;
-
-		/* start the group byte count, but don't write it to buffer yet */
-		/* mark the byte count spot in the buffer and increment index so we skip it */
-		group_count = 0;
-		group_cnt_index = index;
-		index += 4;
-
-		/* get parameter group */
-		group_id = MBSYS_XSE_SHP_GROUP_TRANSDUCEREXTENDED;
-		mb_put_binary_int(SWAPFLAG, group_id, &buffer[index]); index += 4;
-		mb_put_binary_int(SWAPFLAG, store->par_xdx_num_transducer, &buffer[index]); index += 4;
-		for (i=0;i<store->par_xdx_num_transducer;i++)
-			{
-			buffer[index] = store->par_xdx_roll[i]; index++;
-			buffer[index] = store->par_xdx_pitch[i]; index++;
-			buffer[index] = store->par_xdx_azimuth[i]; index++;
-			for (j=0;j<48;j++)
-				{
-				buffer[index] = 0; index++;
-				}
-			}
-
-		/* get end of group label */
-#ifdef DATAINPCBYTEORDER
-		strncpy(&buffer[index], "GSH#", 4);
-#else
-		strncpy(&buffer[index], "#HSG", 4);
-#endif
-		index += 4;
-		group_count += 8 + store->par_xdx_num_transducer * 51;
-
-		/* go back and fill in group byte count */
-		mb_put_binary_int(SWAPFLAG, group_count, &buffer[group_cnt_index]);
-
-		/* add group count to the frame count */
-		frame_count += group_count + 12;
-		}
-
-	/*****************************************/
-
-	/* get end of frame label */
-#ifdef DATAINPCBYTEORDER
-	strncpy(&buffer[index], "FSH#", 4);
-#else
-	strncpy(&buffer[index], "#HSF", 4);
-#endif
-	index += 4;
-
-	/* go back and fill in frame byte count */
-	mb_put_binary_int(SWAPFLAG, frame_count, &buffer[frame_cnt_index]);
-
-	/* set buffer size */
-	*buffer_size = index;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2       buffer_size:%d\n",*buffer_size);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_l3xseraw_wr_multibeam(int verbose,int *buffer_size,char *buffer,void *store_ptr,int *error)
-{
-	char	*function_name = "mbr_l3xseraw_wr_multibeam";
-	int	status = MB_SUCCESS;
-	struct mbsys_xse_struct *store;
-	int	index;
-	int frame_count;
-	int group_count;
-	int frame_cnt_index;
-	int group_cnt_index;
-	int frame_id;
-	int group_id;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-	    {
-	    fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-	    fprintf(stderr,"dbg2  Input arguments:\n");
-	    fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-	    fprintf(stderr,"dbg2       buffer:     %p\n",(void *)buffer);
-	    fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-	    }
-
-	/* get pointer to store data structure */
-	store = (struct mbsys_xse_struct *) store_ptr;
-
-	/* print debug statements */
-	/* print debug statements */
-	if (verbose >= 5)
-	    {
-	    fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-	    fprintf(stderr,"dbg5       mul_group_beam:      %d\n",store->mul_group_beam);
-	    fprintf(stderr,"dbg5       mul_group_tt:        %d\n",store->mul_group_tt);
-	    fprintf(stderr,"dbg5       mul_group_quality:   %d\n",store->mul_group_quality);
-	    fprintf(stderr,"dbg5       mul_group_amp:       %d\n",store->mul_group_amp);
-	    fprintf(stderr,"dbg5       mul_group_delay:     %d\n",store->mul_group_delay);
-	    fprintf(stderr,"dbg5       mul_group_lateral:   %d\n",store->mul_group_lateral);
-	    fprintf(stderr,"dbg5       mul_group_along:     %d\n",store->mul_group_along);
-	    fprintf(stderr,"dbg5       mul_group_depth:     %d\n",store->mul_group_depth);
-	    fprintf(stderr,"dbg5       mul_group_angle:     %d\n",store->mul_group_angle);
-	    fprintf(stderr,"dbg5       mul_group_heave:     %d\n",store->mul_group_heave);
-	    fprintf(stderr,"dbg5       mul_group_roll:      %d\n",store->mul_group_roll);
-	    fprintf(stderr,"dbg5       mul_group_pitch:     %d\n",store->mul_group_pitch);
-	    fprintf(stderr,"dbg5       mul_group_gates:     %d\n",store->mul_group_gates);
-	    fprintf(stderr,"dbg5       mul_group_noise:     %d\n",store->mul_group_noise);
-	    fprintf(stderr,"dbg5       mul_group_length:    %d\n",store->mul_group_length);
-	    fprintf(stderr,"dbg5       mul_group_hits:      %d\n",store->mul_group_hits);
-	    fprintf(stderr,"dbg5       mul_group_heavereceive: %d\n",store->mul_group_heavereceive);
-	    fprintf(stderr,"dbg5       mul_group_azimuth:    %d\n",store->mul_group_azimuth);
-	    fprintf(stderr,"dbg5       mul_group_properties: %d\n",store->mul_group_properties);
-	    fprintf(stderr,"dbg5       mul_group_normamp:    %d\n",store->mul_group_normamp);
-	    fprintf(stderr,"dbg5       mul_group_mbsystemnav:  %d\n",store->mul_group_mbsystemnav);
-	    fprintf(stderr,"dbg5       mul_source:          %d\n",store->mul_source);
-	    fprintf(stderr,"dbg5       mul_sec:             %u\n",store->mul_sec);
-	    fprintf(stderr,"dbg5       mul_usec:            %u\n",store->mul_usec);
-	    fprintf(stderr,"dbg5       mul_ping:            %d\n",store->mul_ping);
-	    fprintf(stderr,"dbg5       mul_frequency:       %f\n",store->mul_frequency);
-	    fprintf(stderr,"dbg5       mul_pulse:           %f\n",store->mul_pulse);
-	    fprintf(stderr,"dbg5       mul_power:           %f\n",store->mul_power);
-	    fprintf(stderr,"dbg5       mul_bandwidth:       %f\n",store->mul_bandwidth);
-	    fprintf(stderr,"dbg5       mul_sample:          %f\n",store->mul_sample);
-	    fprintf(stderr,"dbg5       mul_swath:           %f\n",store->mul_swath);
-	    fprintf(stderr,"dbg5       mul_num_beams:       %d\n",store->mul_num_beams);
-	    fprintf(stderr,"dbg5       mul_lon:             %f\n",store->mul_lon);
-	    fprintf(stderr,"dbg5       mul_lat:             %f\n",store->mul_lat);
-	    fprintf(stderr,"dbg5       mul_heading:         %f\n",store->mul_heading);
-	    fprintf(stderr,"dbg5       mul_speed:           %f\n",store->mul_speed);
-	    for (i=0;i<store->mul_num_beams;i++)
-		fprintf(stderr,"dbg5       beam[%d]: %3d %7.2f %7.2f %7.2f %3d %3d %6.3f %6.2f %5.3f %5.2f %6.2f %6.2f  %f %f %f %f %f %d %f %f %d %f\n",
-		    i, store->beams[i].beam,
-		    store->beams[i].lateral,
-		    store->beams[i].along,
-		    store->beams[i].depth,
-		    store->beams[i].amplitude,
-		    store->beams[i].quality,
-		    store->beams[i].tt,
-		    store->beams[i].angle,
-		    store->beams[i].delay,
-		    store->beams[i].heave,
-		    store->beams[i].roll,
-		    store->beams[i].pitch,
-		    store->beams[i].gate_angle,
-		    store->beams[i].gate_start,
-		    store->beams[i].gate_stop,
-		    store->beams[i].noise,
-		    store->beams[i].length,
-		    store->beams[i].hits,
-		    store->beams[i].heavereceive,
-		    store->beams[i].azimuth,
-		    store->beams[i].normamp,
-		    store->beams[i].frequency);
-	    fprintf(stderr,"dbg5       mul_num_properties: %d\n",store->mul_num_properties);
-	    for (i=0;i<store->mul_num_properties;i++)
-		fprintf(stderr,"dbg5       mun_property[%d]: %d %f\n",
-		    i, store->mul_properties_type[i], store->mul_properties_value[i]);
-	    for (i=0;i<40;i++)
-		fprintf(stderr,"dbg5       mul_properties_reserved[%d]: %d\n",
-		    i, store->mul_properties_reserved[i]);
-	    fprintf(stderr,"dbg5       mul_normamp_num_beams:        %d\n",store->mul_normamp_num_beams);
-	    fprintf(stderr,"dbg5       mul_normamp_flags:            %d\n",store->mul_normamp_flags);
-	    fprintf(stderr,"dbg5       mul_normamp_along_beamwidth:  %f\n",store->mul_normamp_along_beamwidth);
-	    fprintf(stderr,"dbg5       mul_normamp_across_beamwidth: %f\n",store->mul_normamp_across_beamwidth);
-	    }
-
-	/* get the frame label */
-	index = 0;
-#ifdef DATAINPCBYTEORDER
-	strncpy(&buffer[index], "FSH$", 4);
-#else
-	strncpy(&buffer[index], "$HSF", 4);
-#endif
-	index += 4;
-
-	/* start the frame byte count, but don't write it to buffer yet */
-	/* increment index so we skip the count value in the buffer */
-	frame_count = 0;
-	frame_cnt_index = index;
-	index += 4;
-
-	/* get frame time */
-	frame_id = MBSYS_XSE_MBM_FRAME;
-	mb_put_binary_int(SWAPFLAG, frame_id, &buffer[index]); index += 4;
-	mb_put_binary_int(SWAPFLAG, store->mul_source, &buffer[index]); index += 4;
-	mb_put_binary_int(SWAPFLAG, store->mul_sec, &buffer[index]); index += 4;
-	mb_put_binary_int(SWAPFLAG, store->mul_usec, &buffer[index]); index += 4;
-	frame_count += 16;
-
-	/* get group label */
-#ifdef DATAINPCBYTEORDER
-	strncpy(&buffer[index], "GSH$", 4);
-#else
-	strncpy(&buffer[index], "$HSG", 4);
-#endif
-	index += 4;
-
-	/* start the group byte count, but don't write it to buffer yet */
-	/* mark the byte count spot in the buffer and increment index so we skip it */
-	group_count = 0;
-	group_cnt_index = index;
-	index += 4;
-
-	/* get general group */
-	group_id = MBSYS_XSE_MBM_GROUP_GEN;
-	mb_put_binary_int(SWAPFLAG, group_id, &buffer[index]); index += 4;
-	mb_put_binary_int(SWAPFLAG, store->mul_ping, &buffer[index]); index += 4;
-	mb_put_binary_float(SWAPFLAG, store->mul_frequency, &buffer[index]); index += 4;
-	mb_put_binary_float(SWAPFLAG, store->mul_pulse, &buffer[index]); index += 4;
-	mb_put_binary_float(SWAPFLAG, store->mul_power, &buffer[index]); index += 4;
-	mb_put_binary_float(SWAPFLAG, store->mul_bandwidth, &buffer[index]); index += 4;
-	mb_put_binary_float(SWAPFLAG, store->mul_sample, &buffer[index]); index += 4;
-	mb_put_binary_float(SWAPFLAG, store->mul_swath, &buffer[index]); index += 4;
-
-	/* get end of group label */
-#ifdef DATAINPCBYTEORDER
-	strncpy(&buffer[index], "GSH#", 4);
-#else
-	strncpy(&buffer[index], "#HSG", 4);
-#endif
-	index += 4;
-	group_count += 32;
-
-	/* go back and fill in group byte count */
-	mb_put_binary_int(SWAPFLAG, group_count, &buffer[group_cnt_index]);
-
-	/* add group count to the frame count */
-	frame_count += group_count + 12;
-
-	/* get beam groups */
-	if (store->mul_group_beam == MB_YES)
-	    {
-	    /* get group label */
-#ifdef DATAINPCBYTEORDER
-	    strncpy(&buffer[index], "GSH$", 4);
-#else
-	    strncpy(&buffer[index], "$HSG", 4);
-#endif
-	    index += 4;
-
-	    /* start the group byte count, but don't write it to buffer yet */
-	    /* mark the byte count spot in the buffer and increment index so we skip it */
-	    group_count = 0;
-	    group_cnt_index = index;
-	    index += 4;
-
-	    /* get beam array */
-	    group_id = MBSYS_XSE_MBM_GROUP_BEAM;
-	    mb_put_binary_int(SWAPFLAG, group_id, &buffer[index]); index += 4;
-	    mb_put_binary_int(SWAPFLAG, store->mul_num_beams, &buffer[index]); index += 4;
-	    for (i=0;i<store->mul_num_beams;i++)
-			{
-			mb_put_binary_short(SWAPFLAG, store->beams[i].beam, &buffer[index]); index += 2;
-			}
-
-	    /* get end of group label */
-#ifdef DATAINPCBYTEORDER
-	    strncpy(&buffer[index], "GSH#", 4);
-#else
-	    strncpy(&buffer[index], "#HSG", 4);
-#endif
-	    index += 4;
-	    group_count += 8 + store->mul_num_beams*2;
-
-	    /* go back and fill in group byte count */
-	    mb_put_binary_int(SWAPFLAG, group_count, &buffer[group_cnt_index]);
-
-	    /* add group count to the frame count */
-	    frame_count += group_count + 12;
-	    }
-
-	/* get tt groups */
-	if (store->mul_group_tt == MB_YES)
-	    {
-	    /* get group label */
-#ifdef DATAINPCBYTEORDER
-	    strncpy(&buffer[index], "GSH$", 4);
-#else
-	    strncpy(&buffer[index], "$HSG", 4);
-#endif
-	    index += 4;
-
-	    /* start the group byte count, but don't write it to buffer yet */
-	    /* mark the byte count spot in the buffer and increment index so we skip it */
-	    group_count = 0;
-	    group_cnt_index = index;
-	    index += 4;
-
-	    /* get tt array */
-	    group_id = MBSYS_XSE_MBM_GROUP_TT;
-	    mb_put_binary_int(SWAPFLAG, group_id, &buffer[index]); index += 4;
-	    mb_put_binary_int(SWAPFLAG, store->mul_num_beams, &buffer[index]); index += 4;
-	    for (i=0;i<store->mul_num_beams;i++)
-			{
-			mb_put_binary_double(SWAPFLAG, store->beams[i].tt, &buffer[index]); index += 8;
-			}
-
-	    /* get end of group label */
-#ifdef DATAINPCBYTEORDER
-	    strncpy(&buffer[index], "GSH#", 4);
-#else
-	    strncpy(&buffer[index], "#HSG", 4);
-#endif
-	    index += 4;
-	    group_count += 8 + store->mul_num_beams*8;
-
-	    /* go back and fill in group byte count */
-	    mb_put_binary_int(SWAPFLAG, group_count, &buffer[group_cnt_index]);
-
-	    /* add group count to the frame count */
-	    frame_count += group_count + 12;
-	    }
-
-	/* get quality groups */
-	if (store->mul_group_quality == MB_YES)
-	    {
-	    /* get group label */
-#ifdef DATAINPCBYTEORDER
-	    strncpy(&buffer[index], "GSH$", 4);
-#else
-	    strncpy(&buffer[index], "$HSG", 4);
-#endif
-	    index += 4;
-
-	    /* start the group byte count, but don't write it to buffer yet */
-	    /* mark the byte count spot in the buffer and increment index so we skip it */
-	    group_count = 0;
-	    group_cnt_index = index;
-	    index += 4;
-
-	    /* get quality array */
-	    group_id = MBSYS_XSE_MBM_GROUP_QUALITY;
-	    mb_put_binary_int(SWAPFLAG, group_id, &buffer[index]); index += 4;
-	    mb_put_binary_int(SWAPFLAG, store->mul_num_beams, &buffer[index]); index += 4;
-	    for (i=0;i<store->mul_num_beams;i++)
-			{
-			buffer[index] = store->beams[i].quality; index++;
-			}
-
-	    /* get end of group label */
-#ifdef DATAINPCBYTEORDER
-	    strncpy(&buffer[index], "GSH#", 4);
-#else
-	    strncpy(&buffer[index], "#HSG", 4);
-#endif
-	    index += sizeof(int);
-	    group_count += 8 + store->mul_num_beams;
-
-	    /* go back and fill in group byte count */
-	    mb_put_binary_int(SWAPFLAG, group_count, &buffer[group_cnt_index]);
-
-	    /* add group count to the frame count */
-	    frame_count += group_count + 12;
-	    }
-
-	/* get amplitude groups */
-	if (store->mul_group_amp == MB_YES)
-	    {
-	    /* get group label */
-#ifdef DATAINPCBYTEORDER
-	    strncpy(&buffer[index], "GSH$", 4);
-#else
-	    strncpy(&buffer[index], "$HSG", 4);
-#endif
-	    index += 4;
-
-	    /* start the group byte count, but don't write it to buffer yet */
-	    /* mark the byte count spot in the buffer and increment index so we skip it */
-	    group_count = 0;
-	    group_cnt_index = index;
-	    index += 4;
-
-	    /* get amplitude array */
-	    group_id = MBSYS_XSE_MBM_GROUP_AMP;
-	    mb_put_binary_int(SWAPFLAG, group_id, &buffer[index]); index += 4;
-	    mb_put_binary_int(SWAPFLAG, store->mul_num_beams, &buffer[index]); index += 4;
-	    for (i=0;i<store->mul_num_beams;i++)
-			{
-			mb_put_binary_short(SWAPFLAG, store->beams[i].amplitude, &buffer[index]); index += 2;
-			}
-
-	    /* get end of group label */
-#ifdef DATAINPCBYTEORDER
-	    strncpy(&buffer[index], "GSH#", 4);
-#else
-	    strncpy(&buffer[index], "#HSG", 4);
-#endif
-	    index += 4;
-	    group_count += 8 + store->mul_num_beams*2;
-
-	    /* go back and fill in group byte count */
-	    mb_put_binary_int(SWAPFLAG, group_count, &buffer[group_cnt_index]);
-
-	    /* add group count to the frame count */
-	    frame_count += group_count + 12;
-	    }
-
-	/* get delay groups */
-	if (store->mul_group_delay == MB_YES)
-	    {
-	    /* get group label */
-#ifdef DATAINPCBYTEORDER
-	    strncpy(&buffer[index], "GSH$", 4);
-#else
-	    strncpy(&buffer[index], "$HSG", 4);
-#endif
-	    index += 4;
-
-	    /* start the group byte count, but don't write it to buffer yet */
-	    /* mark the byte count spot in the buffer and increment index so we skip it */
-	    group_count = 0;
-	    group_cnt_index = index;
-	    index += 4;
-
-	    /* get delay array */
-	    group_id = MBSYS_XSE_MBM_GROUP_DELAY;
-	    mb_put_binary_int(SWAPFLAG, group_id, &buffer[index]); index += 4;
-	    mb_put_binary_int(SWAPFLAG, store->mul_num_beams, &buffer[index]); index += 4;
-	    for (i=0;i<store->mul_num_beams;i++)
-			{
-			mb_put_binary_double(SWAPFLAG, store->beams[i].delay, &buffer[index]); index += 8;
-			}
-
-	    /* get end of group label */
-#ifdef DATAINPCBYTEORDER
-	    strncpy(&buffer[index], "GSH#", 4);
-#else
-	    strncpy(&buffer[index], "#HSG", 4);
-#endif
-	    index += 4;
-	    group_count += 8 + store->mul_num_beams*8;
-
-	    /* go back and fill in group byte count */
-	    mb_put_binary_int(SWAPFLAG, group_count, &buffer[group_cnt_index]);
-
-	    /* add group count to the frame count */
-	    frame_count += group_count + 12;
-	    }
-
-	/* get lateral groups */
-	if (store->mul_group_lateral == MB_YES)
-	    {
-	    /* get group label */
-#ifdef DATAINPCBYTEORDER
-	    strncpy(&buffer[index], "GSH$", 4);
-#else
-	    strncpy(&buffer[index], "$HSG", 4);
-#endif
-	    index += 4;
-
-	    /* start the group byte count, but don't write it to buffer yet */
-	    /* mark the byte count spot in the buffer and increment index so we skip it */
-	    group_count = 0;
-	    group_cnt_index = index;
-	    index += 4;
-
-	    /* get lateral array */
-	    group_id = MBSYS_XSE_MBM_GROUP_LATERAL;
-	    mb_put_binary_int(SWAPFLAG, group_id, &buffer[index]); index += 4;
-	    mb_put_binary_int(SWAPFLAG, store->mul_num_beams, &buffer[index]); index += 4;
-	    for (i=0;i<store->mul_num_beams;i++)
-			{
-			mb_put_binary_double(SWAPFLAG, store->beams[i].lateral, &buffer[index]); index += 8;
-			}
-
-	    /* get end of group label */
-#ifdef DATAINPCBYTEORDER
-	    strncpy(&buffer[index], "GSH#", 4);
-#else
-	    strncpy(&buffer[index], "#HSG", 4);
-#endif
-	    index += 4;
-	    group_count += 8 + store->mul_num_beams*8;
-
-	    /* go back and fill in group byte count */
-	    mb_put_binary_int(SWAPFLAG, group_count, &buffer[group_cnt_index]);
-
-	    /* add group count to the frame count */
-	    frame_count += group_count + 12;
-	    }
-
-	/* get along groups */
-	if (store->mul_group_along == MB_YES)
-	    {
-	    /* get group label */
-#ifdef DATAINPCBYTEORDER
-	    strncpy(&buffer[index], "GSH$", 4);
-#else
-	    strncpy(&buffer[index], "$HSG", 4);
-#endif
-	    index += 4;
-
-	    /* start the group byte count, but don't write it to buffer yet */
-	    /* mark the byte count spot in the buffer and increment index so we skip it */
-	    group_count = 0;
-	    group_cnt_index = index;
-	    index += 4;
-
-	    /* get along array */
-	    group_id = MBSYS_XSE_MBM_GROUP_ALONG;
-	    mb_put_binary_int(SWAPFLAG, group_id, &buffer[index]); index += 4;
-	    mb_put_binary_int(SWAPFLAG, store->mul_num_beams, &buffer[index]); index += 4;
-	    for (i=0;i<store->mul_num_beams;i++)
-			{
-			mb_put_binary_double(SWAPFLAG, store->beams[i].along, &buffer[index]); index += 8;
-			}
-
-	    /* get end of group label */
-#ifdef DATAINPCBYTEORDER
-	    strncpy(&buffer[index], "GSH#", 4);
-#else
-	    strncpy(&buffer[index], "#HSG", 4);
-#endif
-	    index += sizeof(int);
-	    group_count += 8 + store->mul_num_beams*8;
-
-	    /* go back and fill in group byte count */
-	    mb_put_binary_int(SWAPFLAG, group_count, &buffer[group_cnt_index]);
-
-	    /* add group count to the frame count */
-	    frame_count += group_count + 12;
-	    }
-
-	/* get depth groups */
-	if (store->mul_group_depth == MB_YES)
-	    {
-	    /* get group label */
-#ifdef DATAINPCBYTEORDER
-	    strncpy(&buffer[index], "GSH$", 4);
-#else
-	    strncpy(&buffer[index], "$HSG", 4);
-#endif
-	    index += 4;
-
-	    /* start the group byte count, but don't write it to buffer yet */
-	    /* mark the byte count spot in the buffer and increment index so we skip it */
-	    group_count = 0;
-	    group_cnt_index = index;
-	    index += 4;
-
-	    /* get depth array */
-	    group_id = MBSYS_XSE_MBM_GROUP_DEPTH;
-	    mb_put_binary_int(SWAPFLAG, group_id, &buffer[index]); index += 4;
-	    mb_put_binary_int(SWAPFLAG, store->mul_num_beams, &buffer[index]); index += 4;
-	    for (i=0;i<store->mul_num_beams;i++)
-			{
-			mb_put_binary_double(SWAPFLAG, store->beams[i].depth, &buffer[index]); index += 8;
-			}
-
-	    /* get end of group label */
-#ifdef DATAINPCBYTEORDER
-	    strncpy(&buffer[index], "GSH#", 4);
-#else
-	    strncpy(&buffer[index], "#HSG", 4);
-#endif
-	    index += sizeof(int);
-	    group_count += 8 + store->mul_num_beams*8;
-
-	    /* go back and fill in group byte count */
-	    mb_put_binary_int(SWAPFLAG, group_count, &buffer[group_cnt_index]);
-
-	    /* add group count to the frame count */
-	    frame_count += group_count + 12;
-	    }
-
-	/* get angle groups */
-	if (store->mul_group_angle == MB_YES)
-	    {
-	    /* get group label */
-#ifdef DATAINPCBYTEORDER
-	    strncpy(&buffer[index], "GSH$", 4);
-#else
-	    strncpy(&buffer[index], "$HSG", 4);
-#endif
-	    index += 4;
-
-	    /* start the group byte count, but don't write it to buffer yet */
-	    /* mark the byte count spot in the buffer and increment index so we skip it */
-	    group_count = 0;
-	    group_cnt_index = index;
-	    index += 4;
-
-	    /* get angle array */
-	    group_id = MBSYS_XSE_MBM_GROUP_ANGLE;
-	    mb_put_binary_int(SWAPFLAG, group_id, &buffer[index]); index += 4;
-	    mb_put_binary_int(SWAPFLAG, store->mul_num_beams, &buffer[index]); index += 4;
-	    for (i=0;i<store->mul_num_beams;i++)
-			{
-			mb_put_binary_double(SWAPFLAG, store->beams[i].angle, &buffer[index]); index += 8;
-			}
-
-	    /* get end of group label */
-#ifdef DATAINPCBYTEORDER
-	    strncpy(&buffer[index], "GSH#", 4);
-#else
-	    strncpy(&buffer[index], "#HSG", 4);
-#endif
-	    index += 4;
-	    group_count += 8 + store->mul_num_beams*8;
-
-	    /* go back and fill in group byte count */
-	    mb_put_binary_int(SWAPFLAG, group_count, &buffer[group_cnt_index]);
-
-	    /* add group count to the frame count */
-	    frame_count += group_count + 12;
-	    }
-
-	/* get heave groups */
-	if (store->mul_group_heave == MB_YES)
-	    {
-	    /* get group label */
-#ifdef DATAINPCBYTEORDER
-	    strncpy(&buffer[index], "GSH$", 4);
-#else
-	    strncpy(&buffer[index], "$HSG", 4);
-#endif
-	    index += 4;
-
-	    /* start the group byte count, but don't write it to buffer yet */
-	    /* mark the byte count spot in the buffer and increment index so we skip it */
-	    group_count = 0;
-	    group_cnt_index = index;
-	    index += 4;
-
-	    /* get heave array */
-	    group_id = MBSYS_XSE_MBM_GROUP_HEAVE;
-	    mb_put_binary_int(SWAPFLAG, group_id, &buffer[index]); index += 4;
-	    mb_put_binary_int(SWAPFLAG, store->mul_num_beams, &buffer[index]); index += 4;
-	    for (i=0;i<store->mul_num_beams;i++)
-			{
-			mb_put_binary_double(SWAPFLAG, store->beams[i].heave, &buffer[index]); index += 8;
-			}
-
-	    /* get end of group label */
-#ifdef DATAINPCBYTEORDER
-	    strncpy(&buffer[index], "GSH#", 4);
-#else
-	    strncpy(&buffer[index], "#HSG", 4);
-#endif
-	    index += 4;
-	    group_count += 8 + store->mul_num_beams*8;
-
-	    /* go back and fill in group byte count */
-	    mb_put_binary_int(SWAPFLAG, group_count, &buffer[group_cnt_index]);
-
-	    /* add group count to the frame count */
-	    frame_count += group_count + 12;
-	    }
-
-	/* get roll groups */
-	if (store->mul_group_roll == MB_YES)
-	    {
-	    /* get group label */
-#ifdef DATAINPCBYTEORDER
-	    strncpy(&buffer[index], "GSH$", 4);
-#else
-	    strncpy(&buffer[index], "$HSG", 4);
-#endif
-	    index += 4;
-
-	    /* start the group byte count, but don't write it to buffer yet */
-	    /* mark the byte count spot in the buffer and increment index so we skip it */
-	    group_count = 0;
-	    group_cnt_index = index;
-	    index += 4;
-
-	    /* get roll array */
-	    group_id = MBSYS_XSE_MBM_GROUP_ROLL;
-	    mb_put_binary_int(SWAPFLAG, group_id, &buffer[index]); index += 4;
-	    mb_put_binary_int(SWAPFLAG, store->mul_num_beams, &buffer[index]); index += 4;
-	    for (i=0;i<store->mul_num_beams;i++)
-			{
-			mb_put_binary_double(SWAPFLAG, store->beams[i].roll, &buffer[index]); index += 8;
-			}
-
-	    /* get end of group label */
-#ifdef DATAINPCBYTEORDER
-	    strncpy(&buffer[index], "GSH#", 4);
-#else
-	    strncpy(&buffer[index], "#HSG", 4);
-#endif
-	    index += 4;
-	    group_count += 8 + store->mul_num_beams*8;
-
-	    /* go back and fill in group byte count */
-	    mb_put_binary_int(SWAPFLAG, group_count, &buffer[group_cnt_index]);
-
-	    /* add group count to the frame count */
-	    frame_count += group_count + 12;
-	    }
-
-	/* get pitch groups */
-	if (store->mul_group_pitch == MB_YES)
-	    {
-	    /* get group label */
-#ifdef DATAINPCBYTEORDER
-	    strncpy(&buffer[index], "GSH$", 4);
-#else
-	    strncpy(&buffer[index], "$HSG", 4);
-#endif
-	    index += 4;
-
-	    /* start the group byte count, but don't write it to buffer yet */
-	    /* mark the byte count spot in the buffer and increment index so we skip it */
-	    group_count = 0;
-	    group_cnt_index = index;
-	    index += 4;
-
-	    /* get pitch array */
-	    group_id = MBSYS_XSE_MBM_GROUP_PITCH;
-	    mb_put_binary_int(SWAPFLAG, group_id, &buffer[index]); index += 4;
-	    mb_put_binary_int(SWAPFLAG, store->mul_num_beams, &buffer[index]); index += 4;
-	    for (i=0;i<store->mul_num_beams;i++)
-			{
-			mb_put_binary_double(SWAPFLAG, store->beams[i].pitch, &buffer[index]); index += 8;
-			}
-
-	    /* get end of group label */
-#ifdef DATAINPCBYTEORDER
-	    strncpy(&buffer[index], "GSH#", 4);
-#else
-	    strncpy(&buffer[index], "#HSG", 4);
-#endif
-	    index += 4;
-	    group_count += 8 + store->mul_num_beams*8;
-
-	    /* go back and fill in group byte count */
-	    mb_put_binary_int(SWAPFLAG, group_count, &buffer[group_cnt_index]);
-
-	    /* add group count to the frame count */
-	    frame_count += group_count + 12;
-	    }
-
-	/* get gates groups */
-	if (store->mul_group_gates == MB_YES)
-	    {
-	    /* get group label */
-#ifdef DATAINPCBYTEORDER
-	    strncpy(&buffer[index], "GSH$", 4);
-#else
-	    strncpy(&buffer[index], "$HSG", 4);
-#endif
-	    index += 4;
-
-	    /* start the group byte count, but don't write it to buffer yet */
-	    /* mark the byte count spot in the buffer and increment index so we skip it */
-	    group_count = 0;
-	    group_cnt_index = index;
-	    index += 4;
-
-	    /* get gates array */
-	    group_id = MBSYS_XSE_MBM_GROUP_GATES;
-	    mb_put_binary_int(SWAPFLAG, group_id, &buffer[index]); index += 4;
-	    mb_put_binary_int(SWAPFLAG, store->mul_num_beams, &buffer[index]); index += 4;
-	    for (i=0;i<store->mul_num_beams;i++)
-			{
-			mb_put_binary_double(SWAPFLAG, store->beams[i].gate_angle, &buffer[index]); index += 8;
-			mb_put_binary_double(SWAPFLAG, store->beams[i].gate_start, &buffer[index]); index += 8;
-			mb_put_binary_double(SWAPFLAG, store->beams[i].gate_stop, &buffer[index]); index += 8;
-			}
-
-	    /* get end of group label */
-#ifdef DATAINPCBYTEORDER
-	    strncpy(&buffer[index], "GSH#", 4);
-#else
-	    strncpy(&buffer[index], "#HSG", 4);
-#endif
-	    index += 4;
-	    group_count += 8 + store->mul_num_beams*24;
-
-	    /* go back and fill in group byte count */
-	    mb_put_binary_int(SWAPFLAG, group_count, &buffer[group_cnt_index]);
-
-	    /* add group count to the frame count */
-	    frame_count += group_count + 12;
-	    }
-
-	/* get noise groups */
-	if (store->mul_group_noise == MB_YES)
-	    {
-	    /* get group label */
-#ifdef DATAINPCBYTEORDER
-	    strncpy(&buffer[index], "GSH$", 4);
-#else
-	    strncpy(&buffer[index], "$HSG", 4);
-#endif
-	    index += 4;
-
-	    /* start the group byte count, but don't write it to buffer yet */
-	    /* mark the byte count spot in the buffer and increment index so we skip it */
-	    group_count = 0;
-	    group_cnt_index = index;
-	    index += 4;
-
-	    /* get noise array */
-	    group_id = MBSYS_XSE_MBM_GROUP_NOISE;
-	    mb_put_binary_int(SWAPFLAG, group_id, &buffer[index]); index += 4;
-	    mb_put_binary_int(SWAPFLAG, store->mul_num_beams, &buffer[index]); index += 4;
-	    for (i=0;i<store->mul_num_beams;i++)
-			{
-			mb_put_binary_float(SWAPFLAG, store->beams[i].noise, &buffer[index]); index += 4;
-			}
-
-	    /* get end of group label */
-#ifdef DATAINPCBYTEORDER
-	    strncpy(&buffer[index], "GSH#", 4);
-#else
-	    strncpy(&buffer[index], "#HSG", 4);
-#endif
-	    index += 4;
-	    group_count += 8 + store->mul_num_beams*4;
-
-	    /* go back and fill in group byte count */
-	    mb_put_binary_int(SWAPFLAG, group_count, &buffer[group_cnt_index]);
-
-	    /* add group count to the frame count */
-	    frame_count += group_count + 12;
-	    }
-
-	/* get length groups */
-	if (store->mul_group_length == MB_YES)
-	    {
-	    /* get group label */
-#ifdef DATAINPCBYTEORDER
-	    strncpy(&buffer[index], "GSH$", 4);
-#else
-	    strncpy(&buffer[index], "$HSG", 4);
-#endif
-	    index += 4;
-
-	    /* start the group byte count, but don't write it to buffer yet */
-	    /* mark the byte count spot in the buffer and increment index so we skip it */
-	    group_count = 0;
-	    group_cnt_index = index;
-	    index += 4;
-
-	    /* get length array */
-	    group_id = MBSYS_XSE_MBM_GROUP_LENGTH;
-	    mb_put_binary_int(SWAPFLAG, group_id, &buffer[index]); index += 4;
-	    mb_put_binary_int(SWAPFLAG, store->mul_num_beams, &buffer[index]); index += 4;
-	    for (i=0;i<store->mul_num_beams;i++)
-			{
-			mb_put_binary_float(SWAPFLAG, store->beams[i].length, &buffer[index]); index += 4;
-			}
-
-	    /* get end of group label */
-#ifdef DATAINPCBYTEORDER
-	    strncpy(&buffer[index], "GSH#", 4);
-#else
-	    strncpy(&buffer[index], "#HSG", 4);
-#endif
-	    index += 4;
-	    group_count += 8 + store->mul_num_beams*4;
-
-	    /* go back and fill in group byte count */
-	    mb_put_binary_int(SWAPFLAG, group_count, &buffer[group_cnt_index]);
-
-	    /* add group count to the frame count */
-	    frame_count += group_count + 12;
-	    }
-
-	/* get hits groups */
-	if (store->mul_group_hits == MB_YES)
-	    {
-	    /* get group label */
-#ifdef DATAINPCBYTEORDER
-	    strncpy(&buffer[index], "GSH$", 4);
-#else
-	    strncpy(&buffer[index], "$HSG", 4);
-#endif
-	    index += 4;
-
-	    /* start the group byte count, but don't write it to buffer yet */
-	    /* mark the byte count spot in the buffer and increment index so we skip it */
-	    group_count = 0;
-	    group_cnt_index = index;
-	    index += 4;
-
-	    /* get hits array */
-	    group_id = MBSYS_XSE_MBM_GROUP_HITS;
-	    mb_put_binary_int(SWAPFLAG, group_id, &buffer[index]); index += 4;
-	    mb_put_binary_int(SWAPFLAG, store->mul_num_beams, &buffer[index]); index += 4;
-	    for (i=0;i<store->mul_num_beams;i++)
-			{
-			mb_put_binary_int(SWAPFLAG, store->beams[i].hits, &buffer[index]); index += 4;
-			}
-
-	    /* get end of group label */
-#ifdef DATAINPCBYTEORDER
-	    strncpy(&buffer[index], "GSH#", 4);
-#else
-	    strncpy(&buffer[index], "#HSG", 4);
-#endif
-	    index += 4;
-	    group_count += 8 + store->mul_num_beams*4;
-
-	    /* go back and fill in group byte count */
-	    mb_put_binary_int(SWAPFLAG, group_count, &buffer[group_cnt_index]);
-
-	    /* add group count to the frame count */
-	    frame_count += group_count + 12;
-	    }
-
-	/* get heavereceive groups */
-	if (store->mul_group_heavereceive == MB_YES)
-	    {
-	    /* get group label */
-#ifdef DATAINPCBYTEORDER
-	    strncpy(&buffer[index], "GSH$", 4);
-#else
-	    strncpy(&buffer[index], "$HSG", 4);
-#endif
-	    index += 4;
-
-	    /* start the group byte count, but don't write it to buffer yet */
-	    /* mark the byte count spot in the buffer and increment index so we skip it */
-	    group_count = 0;
-	    group_cnt_index = index;
-	    index += 4;
-
-	    /* get heavereceive array */
-	    group_id = MBSYS_XSE_MBM_GROUP_HEAVERECEIVE;
-	    mb_put_binary_int(SWAPFLAG, group_id, &buffer[index]); index += 4;
-	    mb_put_binary_int(SWAPFLAG, store->mul_num_beams, &buffer[index]); index += 4;
-	    for (i=0;i<store->mul_num_beams;i++)
-			{
-			mb_put_binary_double(SWAPFLAG, store->beams[i].heavereceive, &buffer[index]); index += 8;
-			}
-
-	    /* get end of group label */
-#ifdef DATAINPCBYTEORDER
-	    strncpy(&buffer[index], "GSH#", 4);
-#else
-	    strncpy(&buffer[index], "#HSG", 4);
-#endif
-	    index += 4;
-	    group_count += 8 + store->mul_num_beams*8;
-
-	    /* go back and fill in group byte count */
-	    mb_put_binary_int(SWAPFLAG, group_count, &buffer[group_cnt_index]);
-
-	    /* add group count to the frame count */
-	    frame_count += group_count + 12;
-	    }
-
-	/* get azimuth groups */
-	if (store->mul_group_azimuth == MB_YES)
-	    {
-	    /* get group label */
-#ifdef DATAINPCBYTEORDER
-	    strncpy(&buffer[index], "GSH$", 4);
-#else
-	    strncpy(&buffer[index], "$HSG", 4);
-#endif
-	    index += 4;
-
-	    /* start the group byte count, but don't write it to buffer yet */
-	    /* mark the byte count spot in the buffer and increment index so we skip it */
-	    group_count = 0;
-	    group_cnt_index = index;
-	    index += 4;
-
-	    /* get azimuth array */
-	    group_id = MBSYS_XSE_MBM_GROUP_AZIMUTH;
-	    mb_put_binary_int(SWAPFLAG, group_id, &buffer[index]); index += 4;
-	    mb_put_binary_int(SWAPFLAG, store->mul_num_beams, &buffer[index]); index += 4;
-	    for (i=0;i<store->mul_num_beams;i++)
-			{
-			mb_put_binary_double(SWAPFLAG, store->beams[i].azimuth, &buffer[index]); index += 8;
-			}
-
-	    /* get end of group label */
-#ifdef DATAINPCBYTEORDER
-	    strncpy(&buffer[index], "GSH#", 4);
-#else
-	    strncpy(&buffer[index], "#HSG", 4);
-#endif
-	    index += 4;
-	    group_count += 8 + store->mul_num_beams*8;
-
-	    /* go back and fill in group byte count */
-	    mb_put_binary_int(SWAPFLAG, group_count, &buffer[group_cnt_index]);
-
-	    /* add group count to the frame count */
-	    frame_count += group_count + 12;
-	    }
-
-	/* get properties groups */
-	if (store->mul_group_properties == MB_YES)
-	    {
-	    /* get group label */
-#ifdef DATAINPCBYTEORDER
-	    strncpy(&buffer[index], "GSH$", 4);
-#else
-	    strncpy(&buffer[index], "$HSG", 4);
-#endif
-	    index += 4;
-
-	    /* start the group byte count, but don't write it to buffer yet */
-	    /* mark the byte count spot in the buffer and increment index so we skip it */
-	    group_count = 0;
-	    group_cnt_index = index;
-	    index += 4;
-
-	    /* get properties array */
-	    group_id = MBSYS_XSE_MBM_GROUP_PROPERTIES;
-	    mb_put_binary_int(SWAPFLAG, group_id, &buffer[index]); index += 4;
-	    mb_put_binary_int(SWAPFLAG, store->mul_num_properties, &buffer[index]); index += 4;
-	    for (i=0;i<store->mul_num_properties;i++)
-			{
-			mb_put_binary_short(SWAPFLAG, store->mul_properties_type[i], &buffer[index]); index += 2;
-			mb_put_binary_double(SWAPFLAG, store->mul_properties_value[i], &buffer[index]); index += 8;
-			}
-	    for (i=0;i<40;i++)
-			{
-			buffer[index] = store->mul_properties_reserved[i]; index++;
-			}
-
-	    /* get end of group label */
-#ifdef DATAINPCBYTEORDER
-	    strncpy(&buffer[index], "GSH#", 4);
-#else
-	    strncpy(&buffer[index], "#HSG", 4);
-#endif
-	    index += 4;
-	    group_count += 8 + store->mul_num_properties*10 + 40;
-
-	    /* go back and fill in group byte count */
-	    mb_put_binary_int(SWAPFLAG, group_count, &buffer[group_cnt_index]);
-
-	    /* add group count to the frame count */
-	    frame_count += group_count + 12;
-	    }
-
-	/* get normalized amplitude groups */
-	if (store->mul_group_normamp == MB_YES)
-	    {
-	    /* get group label */
-#ifdef DATAINPCBYTEORDER
-	    strncpy(&buffer[index], "GSH$", 4);
-#else
-	    strncpy(&buffer[index], "$HSG", 4);
-#endif
-	    index += 4;
-
-	    /* start the group byte count, but don't write it to buffer yet */
-	    /* mark the byte count spot in the buffer and increment index so we skip it */
-	    group_count = 0;
-	    group_cnt_index = index;
-	    index += 4;
-
-	    /* get properties array */
-	    group_id = MBSYS_XSE_MBM_GROUP_NORMAMP;
-	    mb_put_binary_int(SWAPFLAG, group_id, &buffer[index]); index += 4;
-	    mb_put_binary_int(SWAPFLAG, store->mul_normamp_num_beams, &buffer[index]); index += 4;
-	    mb_put_binary_int(SWAPFLAG, store->mul_normamp_flags, &buffer[index]); index += 4;
-	    mb_put_binary_float(SWAPFLAG, store->mul_normamp_along_beamwidth, &buffer[index]); index += 4;
-	    mb_put_binary_float(SWAPFLAG, store->mul_normamp_across_beamwidth, &buffer[index]); index += 4;
-	    for (i=0;i<store->mul_normamp_num_beams;i++)
-			{
-			mb_put_binary_short(SWAPFLAG, store->beams[i].normamp, &buffer[index]); index += 2;
-			}
-	    if (store->mul_normamp_flags == 0)
-			{
-			mb_put_binary_float(SWAPFLAG, store->beams[0].frequency, &buffer[index]); index += 4;
-			}
-	    else for (i=0;i<store->mul_normamp_num_beams;i++)
-			{
-			mb_put_binary_float(SWAPFLAG, store->beams[i].frequency, &buffer[index]); index += 4;
-			}
-
-	    /* get end of group label */
-#ifdef DATAINPCBYTEORDER
-	    strncpy(&buffer[index], "GSH#", 4);
-#else
-	    strncpy(&buffer[index], "#HSG", 4);
-#endif
-	    index += 4;
-	    if (store->mul_normamp_flags == 0)
-		group_count += 24 + store->mul_normamp_num_beams * 2;
-	    else
-		group_count += 20 + store->mul_normamp_num_beams * 2 + store->mul_normamp_num_beams * 4;
-
-	    /* go back and fill in group byte count */
-	    mb_put_binary_int(SWAPFLAG, group_count, &buffer[group_cnt_index]);
-
-	    /* add group count to the frame count */
-	    frame_count += group_count + 12;
-	    }
-
-	/* get mbsystemnav groups */
-	if (store->mul_group_mbsystemnav == MB_YES)
-	    {
-	    /* get group label */
-#ifdef DATAINPCBYTEORDER
-	    strncpy(&buffer[index], "GSH$", 4);
-#else
-	    strncpy(&buffer[index], "$HSG", 4);
-#endif
-	    index += 4;
-
-	    /* start the group byte count, but don't write it to buffer yet */
-	    /* mark the byte count spot in the buffer and increment index so we skip it */
-	    group_count = 0;
-	    group_cnt_index = index;
-	    index += 4;
-
-	    /* get azimuth array */
-	    group_id = MBSYS_XSE_MBM_GROUP_MBSYSTEMNAV;
-	    mb_put_binary_int(SWAPFLAG, group_id, &buffer[index]); index += 4;
-	    mb_put_binary_double(SWAPFLAG, store->mul_lon, &buffer[index]); index += 8;
-	    mb_put_binary_double(SWAPFLAG, store->mul_lat, &buffer[index]); index += 8;
-	    mb_put_binary_double(SWAPFLAG, store->mul_heading, &buffer[index]); index += 8;
-	    mb_put_binary_double(SWAPFLAG, store->mul_speed, &buffer[index]); index += 8;
-
-	    /* get end of group label */
-#ifdef DATAINPCBYTEORDER
-	    strncpy(&buffer[index], "GSH#", 4);
-#else
-	    strncpy(&buffer[index], "#HSG", 4);
-#endif
-	    index += 4;
-	    group_count += 36;
-
-	    /* go back and fill in group byte count */
-	    mb_put_binary_int(SWAPFLAG, group_count, &buffer[group_cnt_index]);
-
-	    /* add group count to the frame count */
-	    frame_count += group_count + 12;
-	    }
-
-	/* get end of frame label */
-#ifdef DATAINPCBYTEORDER
-	strncpy(&buffer[index], "FSH#", 4);
-#else
-	strncpy(&buffer[index], "#HSF", 4);
-#endif
-	index += 4;
-
-	/* go back and fill in frame byte count */
-	mb_put_binary_int(SWAPFLAG, frame_count, &buffer[frame_cnt_index]);
-
-	/* set buffer size */
-	*buffer_size = index;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2       buffer_size:%d\n",*buffer_size);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_l3xseraw_wr_sidescan(int verbose,int *buffer_size,char *buffer,void *store_ptr,int *error)
-{
-	char	*function_name = "mbr_l3xseraw_wr_sidescan";
-	int	status = MB_SUCCESS;
-	struct mbsys_xse_struct *store;
-	int	index;
-	int frame_count;
-	int group_count;
-	int frame_cnt_index;
-	int group_cnt_index;
-	int frame_id;
-	int group_id;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-	    {
-	    fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-	    fprintf(stderr,"dbg2  Input arguments:\n");
-	    fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-	    fprintf(stderr,"dbg2       buffer:     %p\n",(void *)buffer);
-	    fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-	    }
-
-	/* get pointer to store data structure */
-	store = (struct mbsys_xse_struct *) store_ptr;
-
-	/* print debug statements */
-	if (verbose >= 5)
-	    {
-	    fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-	    fprintf(stderr,"dbg5       sid_frame:            %d\n",store->sid_frame);
-	    fprintf(stderr,"dbg5       sid_group_avt:        %d\n",store->sid_group_avt);
-	    fprintf(stderr,"dbg5       sid_group_pvt:        %d\n",store->sid_group_pvt);
-	    fprintf(stderr,"dbg5       sid_group_avl:        %d\n",store->sid_group_avl);
-	    fprintf(stderr,"dbg5       sid_group_pvl:        %d\n",store->sid_group_pvl);
-	    fprintf(stderr,"dbg5       sid_group_signal:     %d\n",store->sid_group_signal);
-	    fprintf(stderr,"dbg5       sid_group_ping:       %d\n",store->sid_group_ping);
-	    fprintf(stderr,"dbg5       sid_group_complex:    %d\n",store->sid_group_complex);
-	    fprintf(stderr,"dbg5       sid_group_weighting:  %d\n",store->sid_group_weighting);
-	    fprintf(stderr,"dbg5       sid_source:           %d\n",store->sid_source);
-	    fprintf(stderr,"dbg5       sid_sec:              %d\n",store->sid_sec);
-	    fprintf(stderr,"dbg5       sid_usec:             %u\n",store->sid_usec);
-	    fprintf(stderr,"dbg5       sid_ping:             %u\n",store->sid_ping);
-	    fprintf(stderr,"dbg5       sid_frequency:        %f\n",store->sid_frequency);
-	    fprintf(stderr,"dbg5       sid_pulse:            %f\n",store->sid_pulse);
-	    fprintf(stderr,"dbg5       sid_power:            %f\n",store->sid_power);
-	    fprintf(stderr,"dbg5       sid_bandwidth:        %f\n",store->sid_bandwidth);
-	    fprintf(stderr,"dbg5       sid_sample:           %f\n",store->sid_sample);
-	    fprintf(stderr,"dbg5       sid_avt_sampleus:     %d\n",store->sid_avt_sampleus);
-	    fprintf(stderr,"dbg5       sid_avt_offset:       %d\n",store->sid_avt_offset);
-	    fprintf(stderr,"dbg5       sid_avt_num_samples:  %d\n",store->sid_avt_num_samples);
-	    for (i=0;i<store->sid_avt_num_samples;i++)
-	    	fprintf(stderr,"dbg5       sid_avt_amp[%d]:%d\n",i,store->sid_avt_amp[i]);
-	    fprintf(stderr,"dbg5       sid_pvt_sampleus:  %d\n",store->sid_pvt_sampleus);
-	    fprintf(stderr,"dbg5       sid_pvt_offset:  %d\n",store->sid_pvt_offset);
-	    fprintf(stderr,"dbg5       sid_pvt_num_samples:  %d\n",store->sid_pvt_num_samples);
-	    for (i=0;i<store->sid_pvt_num_samples;i++)
-	    	fprintf(stderr,"dbg5       sid_pvt_phase[%d]:%d\n",i,store->sid_pvt_phase[i]);
-	    fprintf(stderr,"dbg5       sid_avl_binsize:  %d\n",store->sid_avl_binsize);
-	    fprintf(stderr,"dbg5       sid_avl_offset:  %d\n",store->sid_avl_offset);
-	    fprintf(stderr,"dbg5       sid_avl_num_samples:  %d\n",store->sid_avl_num_samples);
-	    for (i=0;i<store->sid_avl_num_samples;i++)
-	    	fprintf(stderr,"dbg5       sid_avl_amp[%d]:%d\n",i,store->sid_avl_amp[i]);
-	    fprintf(stderr,"dbg5       sid_pvl_binsize:  %d\n",store->sid_pvl_binsize);
-	    fprintf(stderr,"dbg5       sid_pvl_offset:  %d\n",store->sid_pvl_offset);
-	    fprintf(stderr,"dbg5       sid_pvl_num_samples:  %d\n",store->sid_pvl_num_samples);
-	    for (i=0;i<store->sid_pvl_num_samples;i++)
-	    	fprintf(stderr,"dbg5       sid_pvl_phase[%d]:%d\n",i,store->sid_pvl_phase[i]);
-	    fprintf(stderr,"dbg5       sid_sig_ping:  %d\n",store->sid_sig_ping);
-	    fprintf(stderr,"dbg5       sid_sig_channel:  %d\n",store->sid_sig_channel);
-	    fprintf(stderr,"dbg5       sid_sig_offset:  %f\n",store->sid_sig_offset);
-	    fprintf(stderr,"dbg5       sid_sig_sample:  %f\n",store->sid_sig_sample);
-	    fprintf(stderr,"dbg5       sid_sig_num_samples:  %d\n",store->sid_sig_num_samples);
-	    for (i=0;i<store->sid_sig_num_samples;i++)
-	    	fprintf(stderr,"dbg5       sid_sig_phase[%d]:%d\n",i,store->sid_sig_phase[i]);
-	    fprintf(stderr,"dbg5       sid_png_pulse:  %u\n",store->sid_png_pulse);
-	    fprintf(stderr,"dbg5       sid_png_startfrequency:  %f\n",store->sid_png_startfrequency);
-	    fprintf(stderr,"dbg5       sid_png_endfrequency:  %f\n",store->sid_png_endfrequency);
-	    fprintf(stderr,"dbg5       sid_png_duration:  %f\n",store->sid_png_duration);
-	    fprintf(stderr,"dbg5       sid_png_mancode:  %d\n",store->sid_png_mancode);
-	    fprintf(stderr,"dbg5       sid_png_pulseid:  %d\n",store->sid_png_pulseid);
-	    fprintf(stderr,"dbg5       sid_png_pulsename:  %s\n",store->sid_png_pulsename);
-	    fprintf(stderr,"dbg5       sid_cmp_ping:  %d\n",store->sid_cmp_ping);
-	    fprintf(stderr,"dbg5       sid_cmp_channel:  %d\n",store->sid_cmp_channel);
-	    fprintf(stderr,"dbg5       sid_cmp_offset:  %f\n",store->sid_cmp_offset);
-	    fprintf(stderr,"dbg5       sid_cmp_sample:  %f\n",store->sid_cmp_sample);
-	    fprintf(stderr,"dbg5       sid_cmp_num_samples:  %d\n",store->sid_cmp_num_samples);
-	    for (i=0;i<store->sid_sig_num_samples;i++)
-	    	fprintf(stderr,"dbg5       sid_cmp_real[%d]:%d sid_cmp_imaginary[%d]:%d\n",
-				i,store->sid_cmp_real[i],i,store->sid_cmp_imaginary[i]);
-	    fprintf(stderr,"dbg5       sid_wgt_factorleft:  %d\n",store->sid_wgt_factorleft);
-	    fprintf(stderr,"dbg5       sid_wgt_samplesleft:  %d\n",store->sid_wgt_samplesleft);
-	    fprintf(stderr,"dbg5       sid_wgt_factorright:  %d\n",store->sid_wgt_factorright);
-	    fprintf(stderr,"dbg5       sid_wgt_samplesright:  %d\n",store->sid_wgt_samplesright);
-	    }
-
-	/* get the frame label */
-	index = 0;
-#ifdef DATAINPCBYTEORDER
-	strncpy(&buffer[index], "FSH$", 4);
-#else
-	strncpy(&buffer[index], "$HSF", 4);
-#endif
-	index += 4;
-
-	/* start the frame byte count, but don't write it to buffer yet */
-	/* increment index so we skip the count value in the buffer */
-	frame_count = 0;
-	frame_cnt_index = index;
-	index += 4;
-
-	/* get frame time */
-	frame_id = MBSYS_XSE_SSN_FRAME;
-	mb_put_binary_int(SWAPFLAG, frame_id, &buffer[index]); index += 4;
-	mb_put_binary_int(SWAPFLAG, store->sid_source, &buffer[index]); index += 4;
-	mb_put_binary_int(SWAPFLAG, store->sid_sec, &buffer[index]); index += 4;
-	mb_put_binary_int(SWAPFLAG, store->sid_usec, &buffer[index]); index += 4;
-	frame_count += 16;
-
-	/*****************************************/
-
-	/* get general group */
-	/* get group label */
-#ifdef DATAINPCBYTEORDER
-	strncpy(&buffer[index], "GSH$", 4);
-#else
-	strncpy(&buffer[index], "$HSG", 4);
-#endif
-	index += 4;
-
-	/* start the group byte count, but don't write it to buffer yet */
-	/* mark the byte count spot in the buffer and increment index so we skip it */
-	group_count = 0;
-	group_cnt_index = index;
-	index += 4;
-
-	/* get general group */
-	group_id = MBSYS_XSE_SSN_GROUP_GEN;
-	mb_put_binary_int(SWAPFLAG, group_id, &buffer[index]); index += 4;
-	mb_put_binary_int(SWAPFLAG, store->sid_ping, &buffer[index]); index += 4;
-	mb_put_binary_float(SWAPFLAG, store->sid_frequency, &buffer[index]); index += 4;
-	mb_put_binary_float(SWAPFLAG, store->sid_pulse, &buffer[index]); index += 4;
-	mb_put_binary_float(SWAPFLAG, store->sid_power, &buffer[index]); index += 4;
-	mb_put_binary_float(SWAPFLAG, store->sid_bandwidth, &buffer[index]); index += 4;
-	mb_put_binary_float(SWAPFLAG, store->sid_sample, &buffer[index]); index += 4;
-
-	/* get end of group label */
-#ifdef DATAINPCBYTEORDER
-	strncpy(&buffer[index], "GSH#", 4);
-#else
-	strncpy(&buffer[index], "#HSG", 4);
-#endif
-	index += 4;
-	group_count += 28;
-
-	/* go back and fill in group byte count */
-	mb_put_binary_int(SWAPFLAG, group_count, &buffer[group_cnt_index]);
-
-	/* add group count to the frame count */
-	    frame_count += group_count + 12;
-
-	/*****************************************/
-
-	/* get amplitude vs traveltime group */
-	if (store->sid_group_avt == MB_YES)
-		{
-		/* get group label */
-#ifdef DATAINPCBYTEORDER
-		strncpy(&buffer[index], "GSH$", 4);
-#else
-		strncpy(&buffer[index], "$HSG", 4);
-#endif
-		index += 4;
-
-		/* start the group byte count, but don't write it to buffer yet */
-		/* mark the byte count spot in the buffer and increment index so we skip it */
-		group_count = 0;
-		group_cnt_index = index;
-		index += 4;
-
-		/* get amplitude array */
-		group_id = MBSYS_XSE_SSN_GROUP_AMPVSTT;
-		mb_put_binary_int(SWAPFLAG, group_id, &buffer[index]); index += 4;
-		mb_put_binary_int(SWAPFLAG, store->sid_avt_sampleus, &buffer[index]); index += 4;
-		mb_put_binary_int(SWAPFLAG, store->sid_avt_offset, &buffer[index]); index += 4;
-		mb_put_binary_int(SWAPFLAG, store->sid_avt_num_samples, &buffer[index]); index += 4;
-		for (i=0;i<store->sid_avt_num_samples;i++)
-		    {
-		    mb_put_binary_short(SWAPFLAG, store->sid_avt_amp[i], &buffer[index]); index += 2;
-		    }
-
-		/* get end of group label */
-#ifdef DATAINPCBYTEORDER
-		strncpy(&buffer[index], "GSH#", 4);
-#else
-		strncpy(&buffer[index], "#HSG", 4);
-#endif
-		index += 4;
-		group_count += 16 + 2 * store->sid_avt_num_samples;
-
-		/* go back and fill in group byte count */
-		mb_put_binary_int(SWAPFLAG, group_count, &buffer[group_cnt_index]);
-
-		/* add group count to the frame count */
-		frame_count += group_count + 12;
-		}
-
-	/*****************************************/
-
-	/* get phase vs traveltime group */
-	if (store->sid_group_avt == MB_YES)
-		{
-		/* get group label */
-#ifdef DATAINPCBYTEORDER
-		strncpy(&buffer[index], "GSH$", 4);
-#else
-		strncpy(&buffer[index], "$HSG", 4);
-#endif
-		index += 4;
-
-		/* start the group byte count, but don't write it to buffer yet */
-		/* mark the byte count spot in the buffer and increment index so we skip it */
-		group_count = 0;
-		group_cnt_index = index;
-		index += 4;
-
-		/* get amplitude array */
-		group_id = MBSYS_XSE_SSN_GROUP_PHASEVSTT;
-		mb_put_binary_int(SWAPFLAG, group_id, &buffer[index]); index += 4;
-		mb_put_binary_int(SWAPFLAG, store->sid_pvt_sampleus, &buffer[index]); index += 4;
-		mb_put_binary_int(SWAPFLAG, store->sid_pvt_offset, &buffer[index]); index += 4;
-		mb_put_binary_int(SWAPFLAG, store->sid_pvt_num_samples, &buffer[index]); index += 4;
-		for (i=0;i<store->sid_pvt_num_samples;i++)
-		    {
-		    mb_put_binary_short(SWAPFLAG, store->sid_pvt_phase[i], &buffer[index]); index += 2;
-		    }
-
-		/* get end of group label */
-#ifdef DATAINPCBYTEORDER
-		strncpy(&buffer[index], "GSH#", 4);
-#else
-		strncpy(&buffer[index], "#HSG", 4);
-#endif
-		index += 4;
-		group_count += 16 + 2 * store->sid_pvt_num_samples;
-
-		/* go back and fill in group byte count */
-		mb_put_binary_int(SWAPFLAG, group_count, &buffer[group_cnt_index]);
-
-		/* add group count to the frame count */
-		frame_count += group_count + 12;
-		}
-
-	/*****************************************/
-
-	/* get amplitude vs lateral group */
-	if (store->sid_group_avl == MB_YES)
-		{
-		/* get group label */
-#ifdef DATAINPCBYTEORDER
-		strncpy(&buffer[index], "GSH$", 4);
-#else
-		strncpy(&buffer[index], "$HSG", 4);
-#endif
-		index += 4;
-
-		/* start the group byte count, but don't write it to buffer yet */
-		/* mark the byte count spot in the buffer and increment index so we skip it */
-		group_count = 0;
-		group_cnt_index = index;
-		index += 4;
-
-		/* get amplitude array */
-		group_id = MBSYS_XSE_SSN_GROUP_AMPVSLAT;
-		mb_put_binary_int(SWAPFLAG, group_id, &buffer[index]); index += 4;
-		mb_put_binary_int(SWAPFLAG, store->sid_avl_binsize, &buffer[index]); index += 4;
-		mb_put_binary_int(SWAPFLAG, store->sid_avl_offset, &buffer[index]); index += 4;
-		mb_put_binary_int(SWAPFLAG, store->sid_avl_num_samples, &buffer[index]); index += 4;
-		for (i=0;i<store->sid_avl_num_samples;i++)
-		    {
-		    mb_put_binary_short(SWAPFLAG, store->sid_avl_amp[i], &buffer[index]); index += 2;
-		    }
-
-		/* get end of group label */
-#ifdef DATAINPCBYTEORDER
-		strncpy(&buffer[index], "GSH#", 4);
-#else
-		strncpy(&buffer[index], "#HSG", 4);
-#endif
-		index += 4;
-		group_count += 16 + 2 * store->sid_avl_num_samples;
-
-		/* go back and fill in group byte count */
-		mb_put_binary_int(SWAPFLAG, group_count, &buffer[group_cnt_index]);
-
-		/* add group count to the frame count */
-		frame_count += group_count + 12;
-		}
-
-	/*****************************************/
-
-	/* get phase vs lateral group */
-	if (store->sid_group_pvl == MB_YES)
-		{
-		/* get group label */
-#ifdef DATAINPCBYTEORDER
-		strncpy(&buffer[index], "GSH$", 4);
-#else
-		strncpy(&buffer[index], "$HSG", 4);
-#endif
-		index += 4;
-
-		/* start the group byte count, but don't write it to buffer yet */
-		/* mark the byte count spot in the buffer and increment index so we skip it */
-		group_count = 0;
-		group_cnt_index = index;
-		index += 4;
-
-		/* get amplitude array */
-		group_id = MBSYS_XSE_SSN_GROUP_PHASEVSLAT;
-		mb_put_binary_int(SWAPFLAG, group_id, &buffer[index]); index += 4;
-		mb_put_binary_int(SWAPFLAG, store->sid_pvl_binsize, &buffer[index]); index += 4;
-		mb_put_binary_int(SWAPFLAG, store->sid_pvl_offset, &buffer[index]); index += 4;
-		mb_put_binary_int(SWAPFLAG, store->sid_pvl_num_samples, &buffer[index]); index += 4;
-		for (i=0;i<store->sid_pvl_num_samples;i++)
-		    {
-		    mb_put_binary_short(SWAPFLAG, store->sid_pvl_phase[i], &buffer[index]); index += 2;
-		    }
-
-		/* get end of group label */
-#ifdef DATAINPCBYTEORDER
-		strncpy(&buffer[index], "GSH#", 4);
-#else
-		strncpy(&buffer[index], "#HSG", 4);
-#endif
-		index += 4;
-		group_count += 16 + 2 * store->sid_pvl_num_samples;
-
-		/* go back and fill in group byte count */
-		mb_put_binary_int(SWAPFLAG, group_count, &buffer[group_cnt_index]);
-
-		/* add group count to the frame count */
-		frame_count += group_count + 12;
-		}
-
-	/*****************************************/
-
-	/* get signal group */
-	if (store->sid_group_signal == MB_YES)
-		{
-		/* get group label */
-#ifdef DATAINPCBYTEORDER
-		strncpy(&buffer[index], "GSH$", 4);
-#else
-		strncpy(&buffer[index], "$HSG", 4);
-#endif
-		index += 4;
-
-		/* start the group byte count, but don't write it to buffer yet */
-		/* mark the byte count spot in the buffer and increment index so we skip it */
-		group_count = 0;
-		group_cnt_index = index;
-		index += 4;
-
-		/* get amplitude array */
-		group_id = MBSYS_XSE_SSN_GROUP_SIGNAL;
-		mb_put_binary_int(SWAPFLAG, group_id, &buffer[index]); index += 4;
-		mb_put_binary_int(SWAPFLAG, store->sid_sig_ping, &buffer[index]); index += 4;
-		mb_put_binary_int(SWAPFLAG, store->sid_sig_channel, &buffer[index]); index += 4;
-		mb_put_binary_double(SWAPFLAG, store->sid_sig_offset, &buffer[index]); index += 8;
-		mb_put_binary_double(SWAPFLAG, store->sid_sig_sample, &buffer[index]); index += 8;
-		mb_put_binary_int(SWAPFLAG, store->sid_sig_num_samples, &buffer[index]); index += 4;
-		for (i=0;i<store->sid_sig_num_samples;i++)
-		    {
-		    mb_put_binary_short(SWAPFLAG, store->sid_sig_phase[i], &buffer[index]); index += 2;
-		    }
-
-		/* get end of group label */
-#ifdef DATAINPCBYTEORDER
-		strncpy(&buffer[index], "GSH#", 4);
-#else
-		strncpy(&buffer[index], "#HSG", 4);
-#endif
-		index += 4;
-		group_count += 32 + 2 * store->sid_sig_num_samples;
-
-		/* go back and fill in group byte count */
-		mb_put_binary_int(SWAPFLAG, group_count, &buffer[group_cnt_index]);
-
-		/* add group count to the frame count */
-		frame_count += group_count + 12;
-		}
-
-	/*****************************************/
-
-	/* get ping group */
-	if (store->sid_group_ping == MB_YES)
-		{
-		/* get group label */
-#ifdef DATAINPCBYTEORDER
-		strncpy(&buffer[index], "GSH$", 4);
-#else
-		strncpy(&buffer[index], "$HSG", 4);
-#endif
-		index += 4;
-
-		/* start the group byte count, but don't write it to buffer yet */
-		/* mark the byte count spot in the buffer and increment index so we skip it */
-		group_count = 0;
-		group_cnt_index = index;
-		index += 4;
-
-		/* get amplitude array */
-		group_id = MBSYS_XSE_SSN_GROUP_PINGTYPE;
-		mb_put_binary_int(SWAPFLAG, group_id, &buffer[index]); index += 4;
-		mb_put_binary_double(SWAPFLAG, store->sid_png_startfrequency, &buffer[index]); index += 8;
-		mb_put_binary_double(SWAPFLAG, store->sid_png_endfrequency, &buffer[index]); index += 8;
-		mb_put_binary_double(SWAPFLAG, store->sid_png_duration, &buffer[index]); index += 8;
-		mb_put_binary_int(SWAPFLAG, store->sid_png_mancode, &buffer[index]); index += 4;
-		mb_put_binary_int(SWAPFLAG, store->sid_png_pulseid, &buffer[index]); index += 4;
-		strcpy(&buffer[index], store->sid_png_pulsename); index += strlen(store->sid_png_pulsename);
-		buffer[index] = 0; index++;
-		if (strlen(store->sid_png_pulsename) % 2 > 0)
-			{
-			buffer[index] = 0; index++;
-			}
-
-		/* get end of group label */
-#ifdef DATAINPCBYTEORDER
-		strncpy(&buffer[index], "GSH#", 4);
-#else
-		strncpy(&buffer[index], "#HSG", 4);
-#endif
-		index += 4;
-		group_count += 36 + strlen(store->sid_png_pulsename) + 1 + (strlen(store->sid_png_pulsename) % 2);
-
-		/* go back and fill in group byte count */
-		mb_put_binary_int(SWAPFLAG, group_count, &buffer[group_cnt_index]);
-
-		/* add group count to the frame count */
-		frame_count += group_count + 12;
-		}
-
-	/*****************************************/
-
-	/* get complex signal group */
-	if (store->sid_group_ping == MB_YES)
-		{
-		/* get group label */
-#ifdef DATAINPCBYTEORDER
-		strncpy(&buffer[index], "GSH$", 4);
-#else
-		strncpy(&buffer[index], "$HSG", 4);
-#endif
-		index += 4;
-
-		/* start the group byte count, but don't write it to buffer yet */
-		/* mark the byte count spot in the buffer and increment index so we skip it */
-		group_count = 0;
-		group_cnt_index = index;
-		index += 4;
-
-		/* get amplitude array */
-		group_id = MBSYS_XSE_SSN_GROUP_COMPLEXSIGNAL;
-		mb_put_binary_int(SWAPFLAG, group_id, &buffer[index]); index += 4;
-		mb_put_binary_int(SWAPFLAG, store->sid_cmp_ping, &buffer[index]); index += 4;
-		mb_put_binary_int(SWAPFLAG, store->sid_cmp_channel, &buffer[index]); index += 4;
-		mb_put_binary_double(SWAPFLAG, store->sid_cmp_offset, &buffer[index]); index += 8;
-		mb_put_binary_double(SWAPFLAG, store->sid_cmp_sample, &buffer[index]); index += 8;
-		mb_put_binary_int(SWAPFLAG, store->sid_cmp_num_samples, &buffer[index]); index += 4;
-		for (i=0;i<store->sid_cmp_num_samples;i++)
-		    {
-		    mb_put_binary_short(SWAPFLAG, store->sid_cmp_real[i], &buffer[index]); index += 2;
-		    mb_put_binary_short(SWAPFLAG, store->sid_cmp_imaginary[i], &buffer[index]); index += 2;
-		    }
-
-		/* get end of group label */
-#ifdef DATAINPCBYTEORDER
-		strncpy(&buffer[index], "GSH#", 4);
-#else
-		strncpy(&buffer[index], "#HSG", 4);
-#endif
-		index += 4;
-		group_count += 32 + 4 * store->sid_cmp_num_samples;
-
-		/* go back and fill in group byte count */
-		mb_put_binary_int(SWAPFLAG, group_count, &buffer[group_cnt_index]);
-
-		/* add group count to the frame count */
-		frame_count += group_count + 12;
-		}
-
-	/*****************************************/
-
-	/* get weighting group */
-	if (store->sid_group_weighting == MB_YES)
-		{
-		/* get group label */
-#ifdef DATAINPCBYTEORDER
-		strncpy(&buffer[index], "GSH$", 4);
-#else
-		strncpy(&buffer[index], "$HSG", 4);
-#endif
-		index += 4;
-
-		/* start the group byte count, but don't write it to buffer yet */
-		/* mark the byte count spot in the buffer and increment index so we skip it */
-		group_count = 0;
-		group_cnt_index = index;
-		index += 4;
-
-		/* get amplitude array */
-		group_id = MBSYS_XSE_SSN_GROUP_WEIGHTING;
-		mb_put_binary_int(SWAPFLAG, group_id, &buffer[index]); index += 4;
-		mb_put_binary_short(SWAPFLAG, store->sid_wgt_factorleft, &buffer[index]); index += 2;
-		mb_put_binary_int(SWAPFLAG, store->sid_wgt_samplesleft, &buffer[index]); index += 4;
-		mb_put_binary_short(SWAPFLAG, store->sid_wgt_factorright, &buffer[index]); index += 2;
-		mb_put_binary_int(SWAPFLAG, store->sid_wgt_samplesright, &buffer[index]); index += 4;
-
-		/* get end of group label */
-#ifdef DATAINPCBYTEORDER
-		strncpy(&buffer[index], "GSH#", 4);
-#else
-		strncpy(&buffer[index], "#HSG", 4);
-#endif
-		index += 4;
-		group_count += 16;
-
-		/* go back and fill in group byte count */
-		mb_put_binary_int(SWAPFLAG, group_count, &buffer[group_cnt_index]);
-
-		/* add group count to the frame count */
-		frame_count += group_count + 12;
-		}
-
-	/*****************************************/
-
-	/* get end of frame label */
-#ifdef DATAINPCBYTEORDER
-	strncpy(&buffer[index], "FSH#", 4);
-#else
-	strncpy(&buffer[index], "#HSF", 4);
-#endif
-	index += 4;
-
-	/* go back and fill in frame byte count */
-	mb_put_binary_int(SWAPFLAG, frame_count, &buffer[frame_cnt_index]);
-
-	/* set buffer size */
-	*buffer_size = index;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2       buffer_size:%d\n",*buffer_size);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_l3xseraw_wr_seabeam(int verbose,int *buffer_size,char *buffer,void *store_ptr,int *error)
-{
-	char	*function_name = "mbr_l3xseraw_wr_seabeam";
-	int	status = MB_SUCCESS;
-	struct mbsys_xse_struct *store;
-	int	index;
-	int frame_count;
-	int group_count;
-	int frame_cnt_index;
-	int group_cnt_index;
-	int frame_id;
-	int group_id;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-	    {
-	    fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-	    fprintf(stderr,"dbg2  Input arguments:\n");
-	    fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-	    fprintf(stderr,"dbg2       buffer:     %p\n",(void *)buffer);
-	    fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-	    }
-
-	/* get pointer to store data structure */
-	store = (struct mbsys_xse_struct *) store_ptr;
-
-	/* print debug statements */
-	if (verbose >= 5)
-	    {
-	    fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-	    fprintf(stderr,"dbg5       sbm_source:          %d\n",store->sbm_source);
-	    fprintf(stderr,"dbg5       sbm_sec:             %u\n",store->sbm_sec);
-	    fprintf(stderr,"dbg5       sbm_usec:            %u\n",store->sbm_usec);
-	    }
-	if (verbose >= 5 && store->sbm_properties == MB_YES)
-	    {
-	    fprintf(stderr,"dbg5       sbm_ping:            %d\n",store->sbm_ping);
-	    fprintf(stderr,"dbg5       sbm_ping_gain:       %f\n",store->sbm_ping_gain);
-	    fprintf(stderr,"dbg5       sbm_pulse_width:     %f\n",store->sbm_pulse_width);
-	    fprintf(stderr,"dbg5       sbm_transmit_power:  %f\n",store->sbm_transmit_power);
-	    fprintf(stderr,"dbg5       sbm_pixel_width:     %f\n",store->sbm_pixel_width);
-	    fprintf(stderr,"dbg5       sbm_swath_width:     %f\n",store->sbm_swath_width);
-	    fprintf(stderr,"dbg5       sbm_time_slice:      %f\n",store->sbm_time_slice);
-	    fprintf(stderr,"dbg5       sbm_depth_mode:      %d\n",store->sbm_depth_mode);
-	    fprintf(stderr,"dbg5       sbm_beam_mode:       %d\n",store->sbm_beam_mode);
-	    fprintf(stderr,"dbg5       sbm_ssv:             %f\n",store->sbm_ssv);
-	    fprintf(stderr,"dbg5       sbm_frequency:       %f\n",store->sbm_frequency);
-	    fprintf(stderr,"dbg5       sbm_bandwidth:       %f\n",store->sbm_bandwidth);
-	    }
-	if (verbose >= 5 && store->sbm_hrp == MB_YES)
-	    {
-	    fprintf(stderr,"dbg5       sbm_heave:           %f\n",store->sbm_heave);
-	    fprintf(stderr,"dbg5       sbm_roll:            %f\n",store->sbm_roll);
-	    fprintf(stderr,"dbg5       sbm_pitch:           %f\n",store->sbm_pitch);
-	    }
-	if (verbose >= 5 && store->sbm_signal == MB_YES)
-	    {
-	    fprintf(stderr,"dbg5       sbm_signal_beam:     %d\n",store->sbm_signal_beam);
-	    fprintf(stderr,"dbg5       sbm_signal_count:    %d\n",store->sbm_signal_count);
-	    for (i=0;i<store->sbm_signal_count;i++)
-		fprintf(stderr,"dbg5       sample[%d]: %f\n",
-		    i, store->sbm_signal_amp[i]);
-	    }
-	if (verbose >= 5 && store->sbm_message == MB_YES)
-	    {
-	    fprintf(stderr,"dbg5       sbm_message_id:      %d\n",store->sbm_message_id);
-	    fprintf(stderr,"dbg5       sbm_message_len:     %d\n",store->sbm_message_len);
-	    fprintf(stderr,"dbg5       sbm_message_txt:     %s\n",store->sbm_message_txt);
-	    }
-	if (verbose >= 5 && store->sbm_sweepsegments == MB_YES)
-	    {
-	    fprintf(stderr,"dbg5       sbm_sweep_direction: %d\n",store->sbm_sweep_direction);
-	    fprintf(stderr,"dbg5       sbm_sweep_azimuth:   %f\n",store->sbm_sweep_azimuth);
-	    fprintf(stderr,"dbg5       sbm_sweep_segments:  %d\n",store->sbm_sweep_segments);
-	    fprintf(stderr,"dbg5       sbm_sweep_seconds:   %d\n",store->sbm_sweep_seconds);
-	    fprintf(stderr,"dbg5       sbm_sweep_micro:     %d\n",store->sbm_sweep_micro);
-	    fprintf(stderr,"dbg5       sbm_sweep_extrapolateazimuth:  %f\n",store->sbm_sweep_extrapolateazimuth);
- 	    fprintf(stderr,"dbg5       sbm_sweep_interpolatedazimuth: %f\n",store->sbm_sweep_interpolatedazimuth);
- 	    fprintf(stderr,"dbg5       sbm_sweep_extrapolatepitch:    %f\n",store->sbm_sweep_extrapolatepitch);
- 	    fprintf(stderr,"dbg5       sbm_sweep_interpolatedpitch:   %f\n",store->sbm_sweep_interpolatedpitch);
- 	    fprintf(stderr,"dbg5       sbm_sweep_extrapolateroll:     %f\n",store->sbm_sweep_extrapolateroll);
- 	    fprintf(stderr,"dbg5       sbm_sweep_interpolatedroll:    %f\n",store->sbm_sweep_interpolatedroll);
- 	    fprintf(stderr,"dbg5       sbm_sweep_stabilizedangle:     %f\n",store->sbm_sweep_stabilizedangle);
-	    }
-	if (verbose >= 5 && store->sbm_spacingmode == MB_YES)
-	    {
-	    fprintf(stderr,"dbg5       sbm_spacing_mode:      	      %d\n",store->sbm_spacing_mode);
-	    fprintf(stderr,"dbg5       sbm_spacing_equidistance:      %f\n",store->sbm_spacing_equidistance);
-	    fprintf(stderr,"dbg5       sbm_spacing_equidistance_min:  %f\n",store->sbm_spacing_equidistance_min);
-	    fprintf(stderr,"dbg5       sbm_spacing_equidistance_max:  %f\n",store->sbm_spacing_equidistance_max);
-	    }
-
-	/* get the frame label */
-	index = 0;
-#ifdef DATAINPCBYTEORDER
-	strncpy(&buffer[index], "FSH$", 4);
-#else
-	strncpy(&buffer[index], "$HSF", 4);
-#endif
-	index += 4;
-
-	/* start the frame byte count, but don't write it to buffer yet */
-	/* increment index so we skip the count value in the buffer */
-	frame_count = 0;
-	frame_cnt_index = index;
-	index += 4;
-
-	/* get frame time */
-	frame_id = MBSYS_XSE_SBM_FRAME;
-	mb_put_binary_int(SWAPFLAG, frame_id, &buffer[index]); index += 4;
-	mb_put_binary_int(SWAPFLAG, store->sbm_source, &buffer[index]); index += 4;
-	mb_put_binary_int(SWAPFLAG, store->sbm_sec, &buffer[index]); index += 4;
-	mb_put_binary_int(SWAPFLAG, store->sbm_usec, &buffer[index]); index += 4;
-	frame_count += 16;
-
-	/* deal with properties group */
-	if (store->sbm_properties == MB_YES)
-	    {
-	    /* get group label */
-#ifdef DATAINPCBYTEORDER
-	    strncpy(&buffer[index], "GSH$", 4);
-#else
-	    strncpy(&buffer[index], "$HSG", 4);
-#endif
-	    index += 4;
-
-	    /* start the group byte count, but don't write it to buffer yet */
-	    /* mark the byte count spot in the buffer and increment index so we skip it */
-	    group_count = 0;
-	    group_cnt_index = index;
-	    index += 4;
-
-	    /* get properties group */
-	    group_id = MBSYS_XSE_SBM_GROUP_PROPERTIES;
-	    mb_put_binary_int(SWAPFLAG, group_id, &buffer[index]); index += 4;
-	    mb_put_binary_int(SWAPFLAG, store->sbm_ping, &buffer[index]); index += 4;
-	    mb_put_binary_float(SWAPFLAG, store->sbm_ping_gain, &buffer[index]); index += 4;
-	    mb_put_binary_float(SWAPFLAG, store->sbm_pulse_width, &buffer[index]); index += 4;
-	    mb_put_binary_float(SWAPFLAG, store->sbm_transmit_power, &buffer[index]); index += 4;
-	    mb_put_binary_float(SWAPFLAG, store->sbm_pixel_width, &buffer[index]); index += 4;
-	    mb_put_binary_float(SWAPFLAG, store->sbm_swath_width, &buffer[index]); index += 4;
-	    mb_put_binary_float(SWAPFLAG, store->sbm_time_slice, &buffer[index]); index += 4;
-	    mb_put_binary_int(SWAPFLAG, store->sbm_depth_mode, &buffer[index]); index += 4;
-	    mb_put_binary_int(SWAPFLAG, store->sbm_beam_mode, &buffer[index]); index += 4;
-	    mb_put_binary_float(SWAPFLAG, store->sbm_ssv, &buffer[index]); index += 4;
-	    mb_put_binary_float(SWAPFLAG, store->sbm_frequency, &buffer[index]); index += 4;
-	    mb_put_binary_float(SWAPFLAG, store->sbm_bandwidth, &buffer[index]); index += 4;
-	    group_count += 52;
-
-	    /* get end of group label */
-#ifdef DATAINPCBYTEORDER
-	    strncpy(&buffer[index], "GSH#", 4);
-#else
-	    strncpy(&buffer[index], "#HSG", 4);
-#endif
-	    index += 4;
-
-	    /* go back and fill in group byte count */
-	    mb_put_binary_int(SWAPFLAG, group_count, &buffer[group_cnt_index]);
-
-	    /* add group count to the frame count */
-	    frame_count += group_count + 12;
-	    }
-
-	/* deal with hrp group */
-	if (store->sbm_hrp == MB_YES)
-	    {
-	    /* get group label */
-#ifdef DATAINPCBYTEORDER
-	    strncpy(&buffer[index], "GSH$", 4);
-#else
-	    strncpy(&buffer[index], "$HSG", 4);
-#endif
-	    index += 4;
-
-	    /* start the group byte count, but don't write it to buffer yet */
-	    /* mark the byte count spot in the buffer and increment index so we skip it */
-	    group_count = 0;
-	    group_cnt_index = index;
-	    index += 4;
-
-	    /* get hrp group */
-	    group_id = MBSYS_XSE_SBM_GROUP_HRP;
-	    mb_put_binary_int(SWAPFLAG, group_id, &buffer[index]); index += 4;
-	    mb_put_binary_double(SWAPFLAG, store->sbm_heave, &buffer[index]); index += 8;
-	    mb_put_binary_double(SWAPFLAG, store->sbm_roll, &buffer[index]); index += 8;
-	    mb_put_binary_double(SWAPFLAG, store->sbm_pitch, &buffer[index]); index += 8;
-	    group_count += 28;
-
-	    /* get end of group label */
-#ifdef DATAINPCBYTEORDER
-	    strncpy(&buffer[index], "GSH#", 4);
-#else
-	    strncpy(&buffer[index], "#HSG", 4);
-#endif
-	    index += 4;
-
-	    /* go back and fill in group byte count */
-	    mb_put_binary_int(SWAPFLAG, group_count, &buffer[group_cnt_index]);
-
-	    /* add group count to the frame count */
-	    frame_count += group_count + 12;
-	    }
-
-	/* deal with signal group */
-	if (store->sbm_signal == MB_YES)
-	    {
-	    /* get group label */
-#ifdef DATAINPCBYTEORDER
-	    strncpy(&buffer[index], "GSH$", 4);
-#else
-	    strncpy(&buffer[index], "$HSG", 4);
-#endif
-	    index += 4;
-
-	    /* start the group byte count, but don't write it to buffer yet */
-	    /* mark the byte count spot in the buffer and increment index so we skip it */
-	    group_count = 0;
-	    group_cnt_index = index;
-	    index += 4;
-
-	    /* get signal group */
-	    group_id = MBSYS_XSE_SBM_GROUP_SIGNAL;
-	    mb_put_binary_int(SWAPFLAG, group_id, &buffer[index]); index += 4;
-	    mb_put_binary_int(SWAPFLAG, store->sbm_signal_beam, &buffer[index]); index += 4;
-	    mb_put_binary_int(SWAPFLAG, store->sbm_signal_count, &buffer[index]); index += 4;
-	    for (i=0;i<store->sbm_signal_count;i++)
-		{
-		mb_put_binary_float(SWAPFLAG, store->sbm_signal_amp[i], &buffer[index]);
-		index += 4;
-		}
-	    group_count += 12 + 4 * store->sbm_signal_count;
-
-	    /* get end of group label */
-#ifdef DATAINPCBYTEORDER
-	    strncpy(&buffer[index], "GSH#", 4);
-#else
-	    strncpy(&buffer[index], "#HSG", 4);
-#endif
-	    index += 4;
-
-	    /* go back and fill in group byte count */
-	    mb_put_binary_int(SWAPFLAG, group_count, &buffer[group_cnt_index]);
-
-	    /* add group count to the frame count */
-	    frame_count += group_count + 12;
-	    }
-
-	/* deal with message group */
-	if (store->sbm_message == MB_YES)
-	    {
-	    /* get group label */
-#ifdef DATAINPCBYTEORDER
-	    strncpy(&buffer[index], "GSH$", 4);
-#else
-	    strncpy(&buffer[index], "$HSG", 4);
-#endif
-	    index += 4;
-
-	    /* start the group byte count, but don't write it to buffer yet */
-	    /* mark the byte count spot in the buffer and increment index so we skip it */
-	    group_count = 0;
-	    group_cnt_index = index;
-	    index += 4;
-
-	    /* get message group */
-	    group_id = MBSYS_XSE_SBM_GROUP_MESSAGE;
-	    mb_put_binary_int(SWAPFLAG, group_id, &buffer[index]); index += 4;
-	    mb_put_binary_int(SWAPFLAG, store->sbm_message_id, &buffer[index]); index += 4;
-	    mb_put_binary_int(SWAPFLAG, store->sbm_message_len, &buffer[index]); index += 4;
-	    for (i=0;i<store->sbm_message_len;i++)
-		{
-		buffer[index] = store->sbm_message_txt[i];
-		index++;
-		}
-	    group_count += 12 + store->sbm_message_len;
-
-	    /* get end of group label */
-#ifdef DATAINPCBYTEORDER
-	    strncpy(&buffer[index], "GSH#", 4);
-#else
-	    strncpy(&buffer[index], "#HSG", 4);
-#endif
-	    index += 4;
-
-	    /* go back and fill in group byte count */
-	    mb_put_binary_int(SWAPFLAG, group_count, &buffer[group_cnt_index]);
-
-	    /* add group count to the frame count */
-	    frame_count += group_count + 12;
-	    }
-
-	/* deal with sweep segments group */
-	if (store->sbm_sweepsegments == MB_YES)
-	    {
-	    /* get group label */
-#ifdef DATAINPCBYTEORDER
-	    strncpy(&buffer[index], "GSH$", 4);
-#else
-	    strncpy(&buffer[index], "$HSG", 4);
-#endif
-	    index += 4;
-
-	    /* start the group byte count, but don't write it to buffer yet */
-	    /* mark the byte count spot in the buffer and increment index so we skip it */
-	    group_count = 0;
-	    group_cnt_index = index;
-	    index += 4;
-
-	    /* get sweep segments group */
-	    group_id = MBSYS_XSE_SBM_GROUP_SWEEPSEGMENTS;
-	    mb_put_binary_int(SWAPFLAG, group_id, &buffer[index]); index += 4;
-	    buffer[index] = store->sbm_sweep_direction; index++;
-	    mb_put_binary_float(SWAPFLAG, store->sbm_sweep_azimuth, &buffer[index]); index += 4;
-	    mb_put_binary_int(SWAPFLAG, store->sbm_sweep_segments, &buffer[index]); index += 4;
-	    mb_put_binary_int(SWAPFLAG, store->sbm_sweep_seconds, &buffer[index]); index += 4;
-	    mb_put_binary_int(SWAPFLAG, store->sbm_sweep_micro, &buffer[index]); index += 4;
-	    mb_put_binary_float(SWAPFLAG, store->sbm_sweep_extrapolateazimuth, &buffer[index]); index += 4;
-	    mb_put_binary_float(SWAPFLAG, store->sbm_sweep_interpolatedazimuth, &buffer[index]); index += 4;
-	    mb_put_binary_float(SWAPFLAG, store->sbm_sweep_extrapolatepitch, &buffer[index]); index += 4;
-	    mb_put_binary_float(SWAPFLAG, store->sbm_sweep_interpolatedpitch, &buffer[index]); index += 4;
-	    mb_put_binary_float(SWAPFLAG, store->sbm_sweep_extrapolateroll, &buffer[index]); index += 4;
-	    mb_put_binary_float(SWAPFLAG, store->sbm_sweep_interpolatedroll, &buffer[index]); index += 4;
-	    mb_put_binary_float(SWAPFLAG, store->sbm_sweep_stabilizedangle, &buffer[index]); index += 4;
-	    group_count += 49;
-
-	    /* get end of group label */
-#ifdef DATAINPCBYTEORDER
-	    strncpy(&buffer[index], "GSH#", 4);
-#else
-	    strncpy(&buffer[index], "#HSG", 4);
-#endif
-	    index += 4;
-
-	    /* go back and fill in group byte count */
-	    mb_put_binary_int(SWAPFLAG, group_count, &buffer[group_cnt_index]);
-
-	    /* add group count to the frame count */
-	    frame_count += group_count + 12;
-	    }
-
-	/* deal with spacing mode group */
-	if (store->sbm_message == MB_YES)
-	    {
-	    /* get group label */
-#ifdef DATAINPCBYTEORDER
-	    strncpy(&buffer[index], "GSH$", 4);
-#else
-	    strncpy(&buffer[index], "$HSG", 4);
-#endif
-	    index += 4;
-
-	    /* start the group byte count, but don't write it to buffer yet */
-	    /* mark the byte count spot in the buffer and increment index so we skip it */
-	    group_count = 0;
-	    group_cnt_index = index;
-	    index += 4;
-
-	    /* get spacing mode group */
-	    group_id = MBSYS_XSE_SBM_GROUP_MESSAGE;
-	    mb_put_binary_int(SWAPFLAG, group_id, &buffer[index]); index += 4;
-	    buffer[index] = store->sbm_spacing_mode; index++;
-	    mb_put_binary_float(SWAPFLAG, store->sbm_spacing_equidistance, &buffer[index]); index += 4;
-	    mb_put_binary_float(SWAPFLAG, store->sbm_spacing_equidistance_min, &buffer[index]); index += 4;
-	    mb_put_binary_float(SWAPFLAG, store->sbm_spacing_equidistance_max, &buffer[index]); index += 4;
-	    group_count += 17 + store->sbm_message_len;
-
-	    /* get end of group label */
-#ifdef DATAINPCBYTEORDER
-	    strncpy(&buffer[index], "GSH#", 4);
-#else
-	    strncpy(&buffer[index], "#HSG", 4);
-#endif
-	    index += 4;
-
-	    /* go back and fill in group byte count */
-	    mb_put_binary_int(SWAPFLAG, group_count, &buffer[group_cnt_index]);
-
-	    /* add group count to the frame count */
-	    frame_count += group_count + 12;
-	    }
-
-	/* get end of frame label */
-#ifdef DATAINPCBYTEORDER
-	strncpy(&buffer[index], "FSH#", 4);
-#else
-	strncpy(&buffer[index], "#HSF", 4);
-#endif
-	index += 4;
-
-	/* go back and fill in frame byte count */
-	mb_put_binary_int(SWAPFLAG, frame_count, &buffer[frame_cnt_index]);
-
-	/* set buffer size */
-	*buffer_size = index;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2       buffer_size:%d\n",*buffer_size);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_l3xseraw_wr_comment(int verbose,int *buffer_size,char *buffer,void *store_ptr,int *error)
-{
-	char	*function_name = "mbr_l3xseraw_wr_comment";
-	int	status = MB_SUCCESS;
-	struct mbsys_xse_struct *store;
-	int	index;
-	int	size;
-	int	len;
-	int frame_id;
-	int group_id;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-	    {
-	    fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-	    fprintf(stderr,"dbg2  Input arguments:\n");
-	    fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-	    fprintf(stderr,"dbg2       buffer:     %p\n",(void *)buffer);
-	    fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-	    }
-
-	/* get pointer to store data structure */
-	store = (struct mbsys_xse_struct *) store_ptr;
-
-	/* print debug statements */
-	if (verbose >= 5)
-	    {
-	    fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-	    fprintf(stderr,"dbg5       comment:             %s\n",store->comment);
-	    }
-
-	/* get the frame label */
-	index = 0;
-#ifdef DATAINPCBYTEORDER
-	strncpy(&buffer[index], "FSH$", 4);
-#else
-	strncpy(&buffer[index], "$HSF", 4);
-#endif
-	index += 4;
-
-	/* get frame size */
-	len = strlen(store->comment) + 4;
-	if (len % 4 > 0)
-	    len += 4 - (len % 4);
-	size = len + 32;
-	mb_put_binary_int(SWAPFLAG, size, &buffer[index]); index += 4;
-
-	/* get frame time */
-	frame_id = MBSYS_XSE_COM_FRAME;
-	mb_put_binary_int(SWAPFLAG, frame_id, &buffer[index]); index += 4;
-	mb_put_binary_int(SWAPFLAG, store->com_source, &buffer[index]); index += 4;
-	mb_put_binary_int(SWAPFLAG, store->com_sec, &buffer[index]); index += 4;
-	mb_put_binary_int(SWAPFLAG, store->com_usec, &buffer[index]); index += 4;
-
-	/* get group label */
-#ifdef DATAINPCBYTEORDER
-	strncpy(&buffer[index], "GSH$", 4);
-#else
-	strncpy(&buffer[index], "$HSG", 4);
-#endif
-	index += 4;
-
-	/* get group size and id */
-	mb_put_binary_int(SWAPFLAG, (len + 4), &buffer[index]); index += 4;
-	group_id = MBSYS_XSE_COM_GROUP_GEN;
-	mb_put_binary_int(SWAPFLAG, group_id, &buffer[index]); index += 4;
-	strncpy(&buffer[index], store->comment, len); index += len;
-
-	/* get end of group label */
-#ifdef DATAINPCBYTEORDER
-	strncpy(&buffer[index], "GSH#", 4);
-#else
-	strncpy(&buffer[index], "#HSG", 4);
-#endif
-	index += 4;
-
-	/* get end of frame label */
-#ifdef DATAINPCBYTEORDER
-	strncpy(&buffer[index], "FSH#", 4);
-#else
-	strncpy(&buffer[index], "#HSF", 4);
-#endif
-	index += 4;
-
-	*buffer_size = index;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2       buffer_size:%d\n",*buffer_size);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mbr_mbarirov.c b/src/mbio/mbr_mbarirov.c
deleted file mode 100644
index fecc731..0000000
--- a/src/mbio/mbr_mbarirov.c
+++ /dev/null
@@ -1,995 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbr_mbarirov.c	5/20/99
- *	$Id: mbr_mbarirov.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1999-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbr_mbarirov.c contains the functions for reading and writing
- * multibeam data in the MBARIROV format.
- * These functions include:
- *   mbr_alm_mbarirov	- allocate read/write memory
- *   mbr_dem_mbarirov	- deallocate read/write memory
- *   mbr_rt_mbarirov	- read and translate data
- *   mbr_wt_mbarirov	- translate and write data
- *
- * Author:	D. W. Caress
- * Date:	May 20, 1999
- *
- * $Log: mbr_mbarirov.c,v $
- * Revision 5.10  2005/11/05 00:48:04  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.9  2004/04/27 01:46:12  caress
- * Various updates of April 26, 2004.
- *
- * Revision 5.8  2003/05/20 18:05:32  caress
- * Added svp_source to data source parameters.
- *
- * Revision 5.7  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.6  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.5  2001/07/20 00:32:54  caress
- * Release 5.0.beta03
- *
- * Revision 5.4  2001/04/09  21:22:48  caress
- * Added ability to ignore records with zero time tags.
- *
- * Revision 5.3  2001/03/22  20:50:02  caress
- * Trying to make version 5.0.beta0
- *
- * Revision 5.2  2001/01/22  07:43:34  caress
- * Version 5.0.beta01
- *
- * Revision 5.1  2000/12/10  20:26:50  caress
- * Version 5.0.alpha02
- *
- * Revision 5.0  2000/12/01  22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.4  2000/10/11  01:03:21  caress
- * Convert to ANSI C
- *
- * Revision 4.3  2000/09/30  06:34:20  caress
- * Snapshot for Dale.
- *
- * Revision 4.2  1999/09/24  23:10:12  caress
- * Made this module work with older variant of format.
- *
- * Revision 4.1  1999/07/16  19:29:09  caress
- * First revision.
- *
- * Revision 1.1  1999/07/16  19:24:15  caress
- * Initial revision
- *
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mb_define.h"
-#include "mbsys_singlebeam.h"
-#include "mbf_mbarirov.h"
-
-/* essential function prototypes */
-int mbr_register_mbarirov(int verbose, void *mbio_ptr,
-		int *error);
-int mbr_info_mbarirov(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_alm_mbarirov(int verbose, void *mbio_ptr, int *error);
-int mbr_dem_mbarirov(int verbose, void *mbio_ptr, int *error);
-int mbr_zero_mbarirov(int verbose, char *data_ptr, int *error);
-int mbr_rt_mbarirov(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_wt_mbarirov(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_mbarirov_rd_data(int verbose, void *mbio_ptr, int *error);
-int mbr_mbarirov_wr_data(int verbose, void *mbio_ptr, void *data_ptr, int *error);
-
-static char header[] = "Year,Day,Time,Usec,Lat,Lon,East,North,Pres,Head,Alti,Pitch,Roll,PosFlag,PresFlag,HeadFlag,AltiFlag,AttitFlag\n";
-
-static char rcs_id[]="$Id: mbr_mbarirov.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mbr_register_mbarirov(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_register_mbarirov";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* get mb_io_ptr */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set format info parameters */
-	status = mbr_info_mbarirov(verbose,
-			&mb_io_ptr->system,
-			&mb_io_ptr->beams_bath_max,
-			&mb_io_ptr->beams_amp_max,
-			&mb_io_ptr->pixels_ss_max,
-			mb_io_ptr->format_name,
-			mb_io_ptr->system_name,
-			mb_io_ptr->format_description,
-			&mb_io_ptr->numfile,
-			&mb_io_ptr->filetype,
-			&mb_io_ptr->variable_beams,
-			&mb_io_ptr->traveltime,
-			&mb_io_ptr->beam_flagging,
-			&mb_io_ptr->nav_source,
-			&mb_io_ptr->heading_source,
-			&mb_io_ptr->vru_source,
-			&mb_io_ptr->svp_source,
-			&mb_io_ptr->beamwidth_xtrack,
-			&mb_io_ptr->beamwidth_ltrack,
-			error);
-
-	/* set format and system specific function pointers */
-	mb_io_ptr->mb_io_format_alloc = &mbr_alm_mbarirov;
-	mb_io_ptr->mb_io_format_free = &mbr_dem_mbarirov;
-	mb_io_ptr->mb_io_store_alloc = &mbsys_singlebeam_alloc;
-	mb_io_ptr->mb_io_store_free = &mbsys_singlebeam_deall;
-	mb_io_ptr->mb_io_read_ping = &mbr_rt_mbarirov;
-	mb_io_ptr->mb_io_write_ping = &mbr_wt_mbarirov;
-	mb_io_ptr->mb_io_dimensions = &mbsys_singlebeam_dimensions;
-	mb_io_ptr->mb_io_extract = &mbsys_singlebeam_extract;
-	mb_io_ptr->mb_io_insert = &mbsys_singlebeam_insert;
-	mb_io_ptr->mb_io_extract_nav = &mbsys_singlebeam_extract_nav;
-	mb_io_ptr->mb_io_insert_nav = &mbsys_singlebeam_insert_nav;
-	mb_io_ptr->mb_io_extract_altitude = &mbsys_singlebeam_extract_altitude;
-	mb_io_ptr->mb_io_insert_altitude = NULL;
-	mb_io_ptr->mb_io_extract_svp = NULL;
-	mb_io_ptr->mb_io_insert_svp = NULL;
-	mb_io_ptr->mb_io_ttimes = &mbsys_singlebeam_ttimes;
-	mb_io_ptr->mb_io_detects = &mbsys_singlebeam_detects;
-	mb_io_ptr->mb_io_copyrecord = &mbsys_singlebeam_copy;
-	mb_io_ptr->mb_io_extract_rawss = NULL;
-	mb_io_ptr->mb_io_insert_rawss = NULL;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",mb_io_ptr->system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",mb_io_ptr->beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",mb_io_ptr->beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",mb_io_ptr->pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",mb_io_ptr->format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",mb_io_ptr->system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",mb_io_ptr->format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",mb_io_ptr->numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",mb_io_ptr->filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",mb_io_ptr->variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",mb_io_ptr->traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",mb_io_ptr->beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",mb_io_ptr->nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",mb_io_ptr->heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",mb_io_ptr->vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",mb_io_ptr->svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",mb_io_ptr->beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",mb_io_ptr->beamwidth_ltrack);
-		fprintf(stderr,"dbg2       format_alloc:       %p\n",(void *)mb_io_ptr->mb_io_format_alloc);
-		fprintf(stderr,"dbg2       format_free:        %p\n",(void *)mb_io_ptr->mb_io_format_free);
-		fprintf(stderr,"dbg2       store_alloc:        %p\n",(void *)mb_io_ptr->mb_io_store_alloc);
-		fprintf(stderr,"dbg2       store_free:         %p\n",(void *)mb_io_ptr->mb_io_store_free);
-		fprintf(stderr,"dbg2       read_ping:          %p\n",(void *)mb_io_ptr->mb_io_read_ping);
-		fprintf(stderr,"dbg2       write_ping:         %p\n",(void *)mb_io_ptr->mb_io_write_ping);
-		fprintf(stderr,"dbg2       extract:            %p\n",(void *)mb_io_ptr->mb_io_extract);
-		fprintf(stderr,"dbg2       insert:             %p\n",(void *)mb_io_ptr->mb_io_insert);
-		fprintf(stderr,"dbg2       extract_nav:        %p\n",(void *)mb_io_ptr->mb_io_extract_nav);
-		fprintf(stderr,"dbg2       insert_nav:         %p\n",(void *)mb_io_ptr->mb_io_insert_nav);
-		fprintf(stderr,"dbg2       extract_altitude:   %p\n",(void *)mb_io_ptr->mb_io_extract_altitude);
-		fprintf(stderr,"dbg2       insert_altitude:    %p\n",(void *)mb_io_ptr->mb_io_insert_altitude);
-		fprintf(stderr,"dbg2       extract_svp:        %p\n",(void *)mb_io_ptr->mb_io_extract_svp);
-		fprintf(stderr,"dbg2       insert_svp:         %p\n",(void *)mb_io_ptr->mb_io_insert_svp);
-		fprintf(stderr,"dbg2       ttimes:             %p\n",(void *)mb_io_ptr->mb_io_ttimes);
-		fprintf(stderr,"dbg2       detects:            %p\n",(void *)mb_io_ptr->mb_io_detects);
-		fprintf(stderr,"dbg2       extract_rawss:      %p\n",(void *)mb_io_ptr->mb_io_extract_rawss);
-		fprintf(stderr,"dbg2       insert_rawss:       %p\n",(void *)mb_io_ptr->mb_io_insert_rawss);
-		fprintf(stderr,"dbg2       copyrecord:         %p\n",(void *)mb_io_ptr->mb_io_copyrecord);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbr_info_mbarirov(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error)
-{
-	char	*function_name = "mbr_info_mbarirov";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* set format info parameters */
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-	*system = MB_SYS_SINGLEBEAM;
-	*beams_bath_max = 1;
-	*beams_amp_max = 0;
-	*pixels_ss_max = 0;
-	strncpy(format_name, "MBARIROV", MB_NAME_LENGTH);
-	strncpy(system_name, "SINGLEBEAM", MB_NAME_LENGTH);
-	strncpy(format_description, "Format name:          MBF_MBARIROV\nInformal Description: MBARI ROV navigation format\nAttributes:           ROV navigation, MBARI\n", MB_DESCRIPTION_LENGTH);
-	*numfile = 1;
-	*filetype = MB_FILETYPE_NORMAL;
-	*variable_beams = MB_NO;
-	*traveltime = MB_YES;
-	*beam_flagging = MB_NO;
-	*nav_source = MB_DATA_DATA;
-	*heading_source = MB_DATA_DATA;
-	*vru_source = MB_DATA_DATA;
-	*svp_source = MB_DATA_NONE;
-	*beamwidth_xtrack = 0.0;
-	*beamwidth_ltrack = 0.0;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",*system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",*beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",*beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",*pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",*numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",*filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",*variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",*traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",*beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",*nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",*heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",*vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",*svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",*beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",*beamwidth_ltrack);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_alm_mbarirov(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_alm_mbarirov";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_mbarirov_struct *data;
-	char	*data_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set initial status */
-	status = MB_SUCCESS;
-
-	/* allocate memory for data structure */
-	mb_io_ptr->structure_size = sizeof(struct mbf_mbarirov_struct);
-	mb_io_ptr->data_structure_size = 0;
-	status = mb_malloc(verbose,mb_io_ptr->structure_size,
-				&mb_io_ptr->raw_data,error);
-	status = mb_malloc(verbose,sizeof(struct mbsys_singlebeam_struct),
-				&mb_io_ptr->store_data,error);
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-	data = (struct mbf_mbarirov_struct *) mb_io_ptr->raw_data;
-	data_ptr = (char *) data;
-
-	/* set number of records read or written to zero */
-	mb_io_ptr->save1 = 0;
-
-	/* initialize everything to zeros */
-	mbr_zero_mbarirov(verbose,data_ptr,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_dem_mbarirov(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_dem_mbarirov";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* deallocate memory for data descriptor */
-	status = mb_free(verbose,&mb_io_ptr->raw_data,error);
-	status = mb_free(verbose,&mb_io_ptr->store_data,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_zero_mbarirov(int verbose, char *data_ptr, int *error)
-{
-	char	*function_name = "mbr_zero_mbarirov";
-	int	status = MB_SUCCESS;
-	struct mbf_mbarirov_struct *data;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       data_ptr:   %p\n",(void *)data_ptr);
-		}
-
-	/* get pointer to data descriptor */
-	data = (struct mbf_mbarirov_struct *) data_ptr;
-
-	/* initialize everything to zeros */
-	if (data != NULL)
-		{
-		data->kind = MB_DATA_NONE;
-		data->time_d = 0.0;
-		for (i=0;i<7;i++)
-		    data->time_i[i] = 0;
-		data->longitude = 0.0;
-		data->latitude = 0.0;
-		data->easting = 0.0;
-		data->northing = 0.0;
-		data->rov_depth = 0.0;
-		data->rov_pressure = 0.0;
-		data->rov_heading = 0.0;
-		data->rov_altitude = 0.0;
-		data->rov_pitch = 0.0;
-		data->rov_roll = 0.0;
-		data->position_flag = 0;
-		data->pressure_flag = 0;
-		data->heading_flag = 0;
-		data->altitude_flag = 0;
-		data->attitude_flag = 0;
-		for (i=0;i<MBF_MBARIROV_MAXLINE;i++)
-		    data->comment[i] = 0;
-		}
-
-	/* assume success */
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_rt_mbarirov(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_rt_mbarirov";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_mbarirov_struct *data;
-	struct mbsys_singlebeam_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointers to mbio descriptor and data structures */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-	data = (struct mbf_mbarirov_struct *) mb_io_ptr->raw_data;
-	store = (struct mbsys_singlebeam_struct *) store_ptr;
-
-	/* read next data from file */
-	status = mbr_mbarirov_rd_data(verbose,mbio_ptr,error);
-
-	/* set error and kind in mb_io_ptr */
-	mb_io_ptr->new_error = *error;
-	mb_io_ptr->new_kind = data->kind;
-
-	/* translate values to data storage structure */
-	if (status == MB_SUCCESS
-		&& store != NULL)
-		{
-		store->kind = data->kind;
-		store->time_d = data->time_d;
-		for (i=0;i<7;i++)
-		    store->time_i[i] = data->time_i[i];
-		store->longitude = data->longitude;
-		store->latitude = data->latitude;
-		store->easting = data->easting;
-		store->northing = data->northing;
-		store->sonar_depth = data->rov_depth;
-		store->rov_pressure = data->rov_pressure;
-		store->heading = data->rov_heading;
-		store->rov_altitude = data->rov_altitude;
-		store->roll = data->rov_roll;
-		store->pitch = data->rov_pitch;
-		store->position_flag = data->position_flag;
-		store->pressure_flag = data->pressure_flag;
-		store->heading_flag = data->heading_flag;
-		store->altitude_flag = data->altitude_flag;
-		store->attitude_flag = data->attitude_flag;
-		for (i=0;i<MB_COMMENT_MAXLINE;i++)
-		    store->comment[i] = data->comment[i];
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_wt_mbarirov(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_wt_mbarirov";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_mbarirov_struct *data;
-	struct mbsys_singlebeam_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_mbarirov_struct *) mb_io_ptr->raw_data;
-	store = (struct mbsys_singlebeam_struct *) store_ptr;
-
-	/* first translate values from data storage structure */
-	if (store != NULL)
-		{
-		data->kind = store->kind;
-		data->time_d = store->time_d;
-		for (i=0;i<7;i++)
-		    data->time_i[i] = store->time_i[i];
-		data->longitude = store->longitude;
-		data->latitude = store->latitude;
-		data->easting = store->easting;
-		data->northing = store->northing;
-		data->rov_depth = store->sonar_depth;
-		data->rov_pressure = store->rov_pressure;
-		data->rov_heading = store->heading;
-		data->rov_altitude = store->rov_altitude;
-		data->rov_roll = store->roll;
-		data->rov_pitch = store->pitch;
-		data->position_flag = store->position_flag;
-		data->pressure_flag = store->pressure_flag;
-		data->heading_flag = store->heading_flag;
-		data->altitude_flag = store->altitude_flag;
-		data->attitude_flag = store->attitude_flag;
-		for (i=0;i<MB_COMMENT_MAXLINE;i++)
-		    data->comment[i] = store->comment[i];
-		}
-
-	/* write next data to file */
-	status = mbr_mbarirov_wr_data(verbose,mbio_ptr,(void *)data,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_mbarirov_rd_data(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_mbarirov_rd_data";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_mbarirov_struct *data;
-	char	line[MBF_MBARIROV_MAXLINE+1];
-	int	year,jday;
-	double	timetag;
-	char	*line_ptr;
-	int	nread;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_mbarirov_struct *) mb_io_ptr->raw_data;
-
-	/* initialize everything to zeros */
-	mbr_zero_mbarirov(verbose,mb_io_ptr->raw_data,error);
-
-	/* set file position */
-	mb_io_ptr->file_bytes = ftell(mb_io_ptr->mbfp);
-	mb_io_ptr->file_pos = mb_io_ptr->file_bytes;
-
-	/* read next record */
-	if ((line_ptr = fgets(line, MBF_MBARIROV_MAXLINE,
-			mb_io_ptr->mbfp)) != NULL)
-		{
-		/* set status */
-		mb_io_ptr->file_bytes += strlen(line);
-		status = MB_SUCCESS;
-		*error = MB_ERROR_NO_ERROR;
-
-		/* if header found, read another line */
-		if (strncmp(line, header, 25) == 0)
-		    {
-		    if ((line_ptr = fgets(line, MBF_MBARIROV_MAXLINE,
-				    mb_io_ptr->mbfp)) != NULL)
-			{
-			/* set status */
-			mb_io_ptr->file_bytes += strlen(line);
-			status = MB_SUCCESS;
-			*error = MB_ERROR_NO_ERROR;
-			}
-		    else
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_EOF;
-			}
-		    }
-		}
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-	mb_io_ptr->file_bytes = ftell(mb_io_ptr->mbfp);
-
-	/* handle the data */
-	if (status == MB_SUCCESS
-	    && line[0] == '#')
-	    {
-	    data->kind = MB_DATA_COMMENT;
-            strncpy(data->comment,&line[1],MBF_MBARIROV_MAXLINE);
-	    if (data->comment[strlen(data->comment)-1] == '\n')
-		data->comment[strlen(data->comment)-1] = '\0';
-	    }
-	else if (status == MB_SUCCESS)
-	    {
-	    data->kind = MB_DATA_DATA;
-
-	    /* read data */
-	    if (strchr(line, ',') != NULL)
-		{
-		nread = sscanf(line,
-			"%d,%d,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%d,%d,%d,%d,%d",
-			&year,
-			&jday,
-			&timetag,
-			&data->time_d,
-			&data->latitude,
-			&data->longitude,
-			&data->easting,
-			&data->northing,
-			&data->rov_pressure,
-			&data->rov_heading,
-			&data->rov_altitude,
-			&data->rov_pitch,
-			&data->rov_roll,
-			&data->position_flag,
-			&data->pressure_flag,
-			&data->heading_flag,
-			&data->altitude_flag,
-			&data->attitude_flag);
-		}
-	    else
-		{
-		nread = sscanf(line,
-			"%d %d %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf,%d,%d,%d,%d,%d",
-			&year,
-			&jday,
-			&timetag,
-			&data->time_d,
-			&data->latitude,
-			&data->longitude,
-			&data->easting,
-			&data->northing,
-			&data->rov_pressure,
-			&data->rov_heading,
-			&data->rov_altitude,
-			&data->rov_pitch,
-			&data->rov_roll,
-			&data->position_flag,
-			&data->pressure_flag,
-			&data->heading_flag,
-			&data->altitude_flag,
-			&data->attitude_flag);
-		}
-
-	    /* catch erroneous records with wrong number of columns */
-	    if (nread == 8)
-	    	{
-		data->easting = 0.0;
-		data->northing = 0.0;
-		}
-	    else if (nread != 13 && nread != 18)
-	    	{
-	    	status = MB_FAILURE;
-	   	*error = MB_ERROR_UNINTELLIGIBLE;
-		}
-
-	    /* catch erroneous records with zero time */
-	    else if (year == 0)
-	    	{
-	    	status = MB_FAILURE;
-	   	*error = MB_ERROR_UNINTELLIGIBLE;
-		}
-
-	    else if (nread == 13 || nread == 18)
-	    	{
-	    	status = MB_SUCCESS;
-	   	*error = MB_ERROR_NO_ERROR;
-
-	    	/* get time */
-	    	mb_get_date(verbose,data->time_d,data->time_i);
-
-	    	/* get depth */
-	    	data->rov_depth = data->rov_pressure
-				/ (1.0052405
-				    * ( 1 + 5.28E-3
-				    	* sin(DTR * data->latitude)
-                    		    	* sin(DTR * data->latitude)));
-
-		/* print output debug statements */
-		if (verbose >= 4)
-			{
-			fprintf(stderr,"\ndbg4  Data read in MBIO function <%s>\n",function_name);
-			fprintf(stderr,"dbg4  Values,read:\n");
-			fprintf(stderr,"dbg4       time_d:       %f\n",data->time_d);
-			fprintf(stderr,"dbg4       latitude:     %f\n",data->latitude);
-			fprintf(stderr,"dbg4       longitude:    %f\n",data->longitude);
-			fprintf(stderr,"dbg4       easting:      %f\n",data->easting);
-			fprintf(stderr,"dbg4       northing:     %f\n",data->northing);
-			fprintf(stderr,"dbg4       rov_pressure: %f\n",data->rov_pressure);
-			fprintf(stderr,"dbg4       rov_heading:  %f\n",data->rov_heading);
-			fprintf(stderr,"dbg4       rov_altitude: %f\n",data->rov_altitude);
-			fprintf(stderr,"dbg4       rov_pitch:    %f\n",data->rov_pitch);
-			fprintf(stderr,"dbg4       rov_roll:     %f\n",data->rov_roll);
-			fprintf(stderr,"dbg4       position_flag:%d\n",data->position_flag);
-			fprintf(stderr,"dbg4       pressure_flag:%d\n",data->pressure_flag);
-			fprintf(stderr,"dbg4       heading_flag: %d\n",data->heading_flag);
-			fprintf(stderr,"dbg4       altitude_flag:%d\n",data->altitude_flag);
-			fprintf(stderr,"dbg4       attitude_flag:%d\n",data->attitude_flag);
-			fprintf(stderr,"dbg4       error:        %d\n",*error);
-			fprintf(stderr,"dbg4       status:       %d\n",status);
-			}
-	    	}
-
-	    else
-	    	{
-	    	status = MB_FAILURE;
-	   	*error = MB_ERROR_UNINTELLIGIBLE;
-	    	}
-
-	    }
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_mbarirov_wr_data(int verbose, void *mbio_ptr, void *data_ptr, int *error)
-{
-	char	*function_name = "mbr_mbarirov_wr_data";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_mbarirov_struct *data;
-	char	line[MBF_MBARIROV_MAXLINE+1];
-	int	time_j[6],year,jday,timetag;
-	int	len;
-	int	*write_count;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       data_ptr:   %p\n",(void *)data_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_mbarirov_struct *) data_ptr;
-
-	/* get pointer to write counter */
-	write_count = (int *) &mb_io_ptr->save1;
-
-	/* handle the data */
-	if (data->kind == MB_DATA_COMMENT)
-	    {
-	    line[0] = '#';
-            strncpy(&line[1],data->comment,MBF_MBARIROV_MAXLINE-2);
-            len = strlen(line);
-	    if (line[len-1] != '\n')
-		{
-		line[len] = '\n';
-		line[len+1] = '\0';
-		}
-	    }
-	else if (data->kind == MB_DATA_DATA)
-	    {
-	    /* get pressure */
-	    data->rov_pressure = data->rov_depth
-				    * (1.0052405
-					* ( 1 + 5.28E-3
-					    * sin(DTR * data->latitude)
-					    * sin(DTR * data->latitude)));
-
-	    /* print output debug statements */
-	    if (verbose >= 4)
-		    {
-		    fprintf(stderr,"\ndbg4  Data to be written in MBIO function <%s>\n",
-			    function_name);
-		    fprintf(stderr,"dbg4  Values,read:\n");
-		    fprintf(stderr,"dbg4       time_d:       %f\n",data->time_d);
-		    fprintf(stderr,"dbg4       latitude:     %f\n",data->latitude);
-		    fprintf(stderr,"dbg4       longitude:    %f\n",data->longitude);
-		    fprintf(stderr,"dbg4       easting:      %f\n",data->easting);
-		    fprintf(stderr,"dbg4       northing:     %f\n",data->northing);
-		    fprintf(stderr,"dbg4       rov_pressure: %f\n",data->rov_pressure);
-		    fprintf(stderr,"dbg4       rov_heading:  %f\n",data->rov_heading);
-		    fprintf(stderr,"dbg4       rov_altitude: %f\n",data->rov_altitude);
-		    fprintf(stderr,"dbg4       rov_pitch:    %f\n",data->rov_pitch);
-		    fprintf(stderr,"dbg4       rov_roll:     %f\n",data->rov_roll);
-		    fprintf(stderr,"dbg4       position_flag:%d\n",data->position_flag);
-		    fprintf(stderr,"dbg4       pressure_flag:%d\n",data->pressure_flag);
-		    fprintf(stderr,"dbg4       heading_flag: %d\n",data->heading_flag);
-		    fprintf(stderr,"dbg4       altitude_flag:%d\n",data->altitude_flag);
-		    fprintf(stderr,"dbg4       attitude_flag:%d\n",data->attitude_flag);
-		    fprintf(stderr,"dbg4       error:        %d\n",*error);
-		    fprintf(stderr,"dbg4       status:       %d\n",status);
-		    }
-
-	    mb_get_jtime(verbose,data->time_i,time_j);
-	    year = data->time_i[0];
-	    jday = time_j[1];
-	    timetag = 10000 * data->time_i[3]
-	    		+ 100 * data->time_i[4]
-	    		+ data->time_i[5];
-            sprintf(line,
-			"%4.4d,%3.3d,%6.6d,%9.0f,%10.6f,%11.6f,%7.0f,%7.0f,%7.2f,%5.1f,%6.2f,%4.1f,%4.1f,%d,%d,%d,%d,%d\n",
-			year,
-			jday,
-			timetag,
-			data->time_d,
-			data->latitude,
-			data->longitude,
-			data->easting,
-			data->northing,
-			data->rov_pressure,
-			data->rov_heading,
-			data->rov_altitude,
-			data->rov_pitch,
-			data->rov_roll,
-			data->position_flag,
-			data->pressure_flag,
-			data->heading_flag,
-			data->altitude_flag,
-			data->attitude_flag);
-	    }
-
-	/* write file header if needed */
-	if (*write_count == 0)
-	    {
-	    if (fputs(header,mb_io_ptr->mbfp) == EOF)
-		{
-		*error = MB_ERROR_WRITE_FAIL;
-		status = MB_FAILURE;
-		}
-	    else
-		{
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-		}
-	    }
-
-	/* write data */
-	if (fputs(line,mb_io_ptr->mbfp) == EOF)
-		{
-		*error = MB_ERROR_WRITE_FAIL;
-		status = MB_FAILURE;
-		}
-	else
-		{
-		(*write_count)++;
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-		}
-
-
-	/* print output debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Data record kind in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       kind:       %d\n",data->kind);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mbr_mbarrov2.c b/src/mbio/mbr_mbarrov2.c
deleted file mode 100644
index 7ffc989..0000000
--- a/src/mbio/mbr_mbarrov2.c
+++ /dev/null
@@ -1,938 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbr_mbarrov2.c	10/3/2006
- *	$Id: mbr_mbarrov2.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 2006-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbr_mbarrov2.c contains the functions for reading and writing
- * navigation data in the MBARROV2 format.
- * These functions include:
- *   mbr_alm_mbarrov2	- allocate read/write memory
- *   mbr_dem_mbarrov2	- deallocate read/write memory
- *   mbr_rt_mbarrov2	- read and translate data
- *   mbr_wt_mbarrov2	- translate and write data
- *
- * Author:	D. W. Caress
- * Date:	May 20, 1999
- *
- * $Log: mbr_mbarrov2.c,v $
- * Revision 5.0  2006/10/05 18:56:44  caress
- * New files for 5.1.0
- *
- *
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mb_define.h"
-#include "mbsys_singlebeam.h"
-#include "mbf_mbarrov2.h"
-
-/* essential function prototypes */
-int mbr_register_mbarrov2(int verbose, void *mbio_ptr,
-		int *error);
-int mbr_info_mbarrov2(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_alm_mbarrov2(int verbose, void *mbio_ptr, int *error);
-int mbr_dem_mbarrov2(int verbose, void *mbio_ptr, int *error);
-int mbr_zero_mbarrov2(int verbose, char *data_ptr, int *error);
-int mbr_rt_mbarrov2(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_wt_mbarrov2(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_mbarrov2_rd_data(int verbose, void *mbio_ptr, int *error);
-int mbr_mbarrov2_wr_data(int verbose, void *mbio_ptr, void *data_ptr, int *error);
-
-static char header[] = "RovName,DiveNumber,DateTime24,EpochSecs,Latitude,Longitude,Pressure,Depth,Altitude,Heading,Pitch,Roll,ShipLatitude,ShipLongitude,ShipHeading,QCFlag\n";
-
-static char rcs_id[]="$Id: mbr_mbarrov2.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mbr_register_mbarrov2(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_register_mbarrov2";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* get mb_io_ptr */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set format info parameters */
-	status = mbr_info_mbarrov2(verbose,
-			&mb_io_ptr->system,
-			&mb_io_ptr->beams_bath_max,
-			&mb_io_ptr->beams_amp_max,
-			&mb_io_ptr->pixels_ss_max,
-			mb_io_ptr->format_name,
-			mb_io_ptr->system_name,
-			mb_io_ptr->format_description,
-			&mb_io_ptr->numfile,
-			&mb_io_ptr->filetype,
-			&mb_io_ptr->variable_beams,
-			&mb_io_ptr->traveltime,
-			&mb_io_ptr->beam_flagging,
-			&mb_io_ptr->nav_source,
-			&mb_io_ptr->heading_source,
-			&mb_io_ptr->vru_source,
-			&mb_io_ptr->svp_source,
-			&mb_io_ptr->beamwidth_xtrack,
-			&mb_io_ptr->beamwidth_ltrack,
-			error);
-
-	/* set format and system specific function pointers */
-	mb_io_ptr->mb_io_format_alloc = &mbr_alm_mbarrov2;
-	mb_io_ptr->mb_io_format_free = &mbr_dem_mbarrov2;
-	mb_io_ptr->mb_io_store_alloc = &mbsys_singlebeam_alloc;
-	mb_io_ptr->mb_io_store_free = &mbsys_singlebeam_deall;
-	mb_io_ptr->mb_io_read_ping = &mbr_rt_mbarrov2;
-	mb_io_ptr->mb_io_write_ping = &mbr_wt_mbarrov2;
-	mb_io_ptr->mb_io_dimensions = &mbsys_singlebeam_dimensions;
-	mb_io_ptr->mb_io_extract = &mbsys_singlebeam_extract;
-	mb_io_ptr->mb_io_insert = &mbsys_singlebeam_insert;
-	mb_io_ptr->mb_io_extract_nav = &mbsys_singlebeam_extract_nav;
-	mb_io_ptr->mb_io_insert_nav = &mbsys_singlebeam_insert_nav;
-	mb_io_ptr->mb_io_extract_altitude = &mbsys_singlebeam_extract_altitude;
-	mb_io_ptr->mb_io_insert_altitude = NULL;
-	mb_io_ptr->mb_io_extract_svp = NULL;
-	mb_io_ptr->mb_io_insert_svp = NULL;
-	mb_io_ptr->mb_io_ttimes = &mbsys_singlebeam_ttimes;
-	mb_io_ptr->mb_io_detects = &mbsys_singlebeam_detects;
-	mb_io_ptr->mb_io_copyrecord = &mbsys_singlebeam_copy;
-	mb_io_ptr->mb_io_extract_rawss = NULL;
-	mb_io_ptr->mb_io_insert_rawss = NULL;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",mb_io_ptr->system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",mb_io_ptr->beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",mb_io_ptr->beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",mb_io_ptr->pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",mb_io_ptr->format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",mb_io_ptr->system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",mb_io_ptr->format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",mb_io_ptr->numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",mb_io_ptr->filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",mb_io_ptr->variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",mb_io_ptr->traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",mb_io_ptr->beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",mb_io_ptr->nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",mb_io_ptr->heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",mb_io_ptr->vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",mb_io_ptr->svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",mb_io_ptr->beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",mb_io_ptr->beamwidth_ltrack);
-		fprintf(stderr,"dbg2       format_alloc:       %p\n",(void *)mb_io_ptr->mb_io_format_alloc);
-		fprintf(stderr,"dbg2       format_free:        %p\n",(void *)mb_io_ptr->mb_io_format_free);
-		fprintf(stderr,"dbg2       store_alloc:        %p\n",(void *)mb_io_ptr->mb_io_store_alloc);
-		fprintf(stderr,"dbg2       store_free:         %p\n",(void *)mb_io_ptr->mb_io_store_free);
-		fprintf(stderr,"dbg2       read_ping:          %p\n",(void *)mb_io_ptr->mb_io_read_ping);
-		fprintf(stderr,"dbg2       write_ping:         %p\n",(void *)mb_io_ptr->mb_io_write_ping);
-		fprintf(stderr,"dbg2       extract:            %p\n",(void *)mb_io_ptr->mb_io_extract);
-		fprintf(stderr,"dbg2       insert:             %p\n",(void *)mb_io_ptr->mb_io_insert);
-		fprintf(stderr,"dbg2       extract_nav:        %p\n",(void *)mb_io_ptr->mb_io_extract_nav);
-		fprintf(stderr,"dbg2       insert_nav:         %p\n",(void *)mb_io_ptr->mb_io_insert_nav);
-		fprintf(stderr,"dbg2       extract_altitude:   %p\n",(void *)mb_io_ptr->mb_io_extract_altitude);
-		fprintf(stderr,"dbg2       insert_altitude:    %p\n",(void *)mb_io_ptr->mb_io_insert_altitude);
-		fprintf(stderr,"dbg2       extract_svp:        %p\n",(void *)mb_io_ptr->mb_io_extract_svp);
-		fprintf(stderr,"dbg2       insert_svp:         %p\n",(void *)mb_io_ptr->mb_io_insert_svp);
-		fprintf(stderr,"dbg2       ttimes:             %p\n",(void *)mb_io_ptr->mb_io_ttimes);
-		fprintf(stderr,"dbg2       detects:            %p\n",(void *)mb_io_ptr->mb_io_detects);
-		fprintf(stderr,"dbg2       extract_rawss:      %p\n",(void *)mb_io_ptr->mb_io_extract_rawss);
-		fprintf(stderr,"dbg2       insert_rawss:       %p\n",(void *)mb_io_ptr->mb_io_insert_rawss);
-		fprintf(stderr,"dbg2       copyrecord:         %p\n",(void *)mb_io_ptr->mb_io_copyrecord);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbr_info_mbarrov2(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error)
-{
-	char	*function_name = "mbr_info_mbarrov2";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* set format info parameters */
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-	*system = MB_SYS_SINGLEBEAM;
-	*beams_bath_max = 1;
-	*beams_amp_max = 0;
-	*pixels_ss_max = 0;
-	strncpy(format_name, "MBARROV2", MB_NAME_LENGTH);
-	strncpy(system_name, "SINGLEBEAM", MB_NAME_LENGTH);
-	strncpy(format_description, "Format name:          MBF_MBARROV2\nInformal Description: MBARI ROV navigation format\nAttributes:           ROV navigation, MBARI\n", MB_DESCRIPTION_LENGTH);
-	*numfile = 1;
-	*filetype = MB_FILETYPE_NORMAL;
-	*variable_beams = MB_NO;
-	*traveltime = MB_YES;
-	*beam_flagging = MB_NO;
-	*nav_source = MB_DATA_DATA;
-	*heading_source = MB_DATA_DATA;
-	*vru_source = MB_DATA_DATA;
-	*svp_source = MB_DATA_NONE;
-	*beamwidth_xtrack = 0.0;
-	*beamwidth_ltrack = 0.0;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",*system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",*beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",*beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",*pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",*numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",*filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",*variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",*traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",*beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",*nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",*heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",*vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",*svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",*beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",*beamwidth_ltrack);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_alm_mbarrov2(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_alm_mbarrov2";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_mbarrov2_struct *data;
-	char	*data_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set initial status */
-	status = MB_SUCCESS;
-
-	/* allocate memory for data structure */
-	mb_io_ptr->structure_size = sizeof(struct mbf_mbarrov2_struct);
-	mb_io_ptr->data_structure_size = 0;
-	status = mb_malloc(verbose,mb_io_ptr->structure_size,
-				&mb_io_ptr->raw_data,error);
-	status = mb_malloc(verbose,sizeof(struct mbsys_singlebeam_struct),
-				&mb_io_ptr->store_data,error);
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-	data = (struct mbf_mbarrov2_struct *) mb_io_ptr->raw_data;
-	data_ptr = (char *) data;
-
-	/* set number of records read or written to zero */
-	mb_io_ptr->save1 = 0;
-
-	/* initialize everything to zeros */
-	mbr_zero_mbarrov2(verbose,data_ptr,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_dem_mbarrov2(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_dem_mbarrov2";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* deallocate memory for data descriptor */
-	status = mb_free(verbose,&mb_io_ptr->raw_data,error);
-	status = mb_free(verbose,&mb_io_ptr->store_data,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_zero_mbarrov2(int verbose, char *data_ptr, int *error)
-{
-	char	*function_name = "mbr_zero_mbarrov2";
-	int	status = MB_SUCCESS;
-	struct mbf_mbarrov2_struct *data;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       data_ptr:   %p\n",(void *)data_ptr);
-		}
-
-	/* get pointer to data descriptor */
-	data = (struct mbf_mbarrov2_struct *) data_ptr;
-
-	/* initialize everything to zeros */
-	if (data != NULL)
-		{
-		data->kind = MB_DATA_NONE;
-		for (i=0;i<8;i++)
-		    data->rovname[i] = 0;
-		data->divenumber = 0;
-		data->time_d = 0.0;
-		for (i=0;i<7;i++)
-		    data->time_i[i] = 0;
-		data->longitude = 0.0;
-		data->latitude = 0.0;
-		data->rov_depth = 0.0;
-		data->rov_pressure = 0.0;
-		data->rov_heading = 0.0;
-		data->rov_altitude = 0.0;
-		data->rov_pitch = 0.0;
-		data->rov_roll = 0.0;
-		data->ship_longitude = 0.0;
-		data->ship_latitude = 0.0;
-		data->ship_heading = 0.0;
-		data->qc_flag = 0;
-		for (i=0;i<MBF_MBARROV2_MAXLINE;i++)
-		    data->comment[i] = 0;
-		}
-
-	/* assume success */
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_rt_mbarrov2(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_rt_mbarrov2";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_mbarrov2_struct *data;
-	struct mbsys_singlebeam_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointers to mbio descriptor and data structures */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-	data = (struct mbf_mbarrov2_struct *) mb_io_ptr->raw_data;
-	store = (struct mbsys_singlebeam_struct *) store_ptr;
-
-	/* read next data from file */
-	status = mbr_mbarrov2_rd_data(verbose,mbio_ptr,error);
-
-	/* set error and kind in mb_io_ptr */
-	mb_io_ptr->new_error = *error;
-	mb_io_ptr->new_kind = data->kind;
-
-	/* translate values to data storage structure */
-	if (status == MB_SUCCESS
-		&& store != NULL)
-		{
-		store->kind = data->kind;
-		strncpy(store->survey_id, data->rovname,4);
-		store->seismic_line = data->divenumber;
-		store->time_d = data->time_d;
-		for (i=0;i<7;i++)
-		    store->time_i[i] = data->time_i[i];
-		store->longitude = data->longitude;
-		store->latitude = data->latitude;
-		store->sonar_depth = data->rov_depth;
-		store->rov_pressure = data->rov_pressure;
-		store->heading = data->rov_heading;
-		store->rov_altitude = data->rov_altitude;
-		store->roll = data->rov_roll;
-		store->pitch = data->rov_pitch;
-		store->ship_longitude = data->ship_longitude;
-		store->ship_latitude = data->ship_latitude;
-		store->ship_heading = data->ship_heading;
-		store->qc_flag = data->qc_flag;
-		for (i=0;i<MB_COMMENT_MAXLINE;i++)
-		    store->comment[i] = data->comment[i];
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_wt_mbarrov2(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_wt_mbarrov2";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_mbarrov2_struct *data;
-	struct mbsys_singlebeam_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_mbarrov2_struct *) mb_io_ptr->raw_data;
-	store = (struct mbsys_singlebeam_struct *) store_ptr;
-
-	/* first translate values from data storage structure */
-	if (store != NULL)
-		{
-		data->kind = store->kind;
-		strncpy(data->rovname, store->survey_id,4);
-		data->rovname[4] = 0;
-		data->divenumber = store->seismic_line;
-		data->time_d = store->time_d;
-		for (i=0;i<7;i++)
-		    data->time_i[i] = store->time_i[i];
-		data->longitude = store->longitude;
-		data->latitude = store->latitude;
-		data->rov_depth = store->sonar_depth;
-		data->rov_pressure = store->rov_pressure;
-		data->rov_heading = store->heading;
-		data->rov_altitude = store->rov_altitude;
-		data->rov_roll = store->roll;
-		data->rov_pitch = store->pitch;
-		data->ship_longitude = store->ship_longitude;
-		data->ship_latitude = store->ship_latitude;
-		data->ship_heading = store->ship_heading;
-		data->qc_flag = store->qc_flag;
-		for (i=0;i<MB_COMMENT_MAXLINE;i++)
-		    data->comment[i] = store->comment[i];
-		}
-
-	/* write next data to file */
-	status = mbr_mbarrov2_wr_data(verbose,mbio_ptr,(void *)data,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_mbarrov2_rd_data(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_mbarrov2_rd_data";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_mbarrov2_struct *data;
-	char	line[MBF_MBARROV2_MAXLINE+1];
-	char	*line_ptr;
-	int	nread;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_mbarrov2_struct *) mb_io_ptr->raw_data;
-
-	/* initialize everything to zeros */
-	mbr_zero_mbarrov2(verbose,mb_io_ptr->raw_data,error);
-
-	/* set file position */
-	mb_io_ptr->file_bytes = ftell(mb_io_ptr->mbfp);
-	mb_io_ptr->file_pos = mb_io_ptr->file_bytes;
-
-	/* read next record */
-	if ((line_ptr = fgets(line, MBF_MBARROV2_MAXLINE,
-			mb_io_ptr->mbfp)) != NULL)
-		{
-		/* set status */
-		mb_io_ptr->file_bytes += strlen(line);
-		status = MB_SUCCESS;
-		*error = MB_ERROR_NO_ERROR;
-
-		/* if header found, read another line */
-		if (strncmp(line, header, 25) == 0)
-		    {
-		    if ((line_ptr = fgets(line, MBF_MBARROV2_MAXLINE,
-				    mb_io_ptr->mbfp)) != NULL)
-			{
-			/* set status */
-			mb_io_ptr->file_bytes += strlen(line);
-			status = MB_SUCCESS;
-			*error = MB_ERROR_NO_ERROR;
-			}
-		    else
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_EOF;
-			}
-		    }
-		}
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-	mb_io_ptr->file_bytes = ftell(mb_io_ptr->mbfp);
-
-	/* handle the data */
-	if (status == MB_SUCCESS
-	    && line[0] == '#')
-	    {
-	    data->kind = MB_DATA_COMMENT;
-            strncpy(data->comment,&line[1],MBF_MBARROV2_MAXLINE);
-	    if (data->comment[strlen(data->comment)-1] == '\n')
-		data->comment[strlen(data->comment)-1] = '\0';
-	    }
-	else if (status == MB_SUCCESS)
-	    {
-	    data->kind = MB_DATA_DATA;
-
-	    /* read data */
-	    if (strchr(line, ',') != NULL)
-		{
-		nread = sscanf(line,
-			"%c%c%c%c,%d,%d-%d-%d %d:%d:%d,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%d",
-			&data->rovname[0],&data->rovname[1],&data->rovname[2],&data->rovname[3],
-			&data->divenumber,
-			&data->time_i[0],
-			&data->time_i[1],
-			&data->time_i[2],
-			&data->time_i[3],
-			&data->time_i[4],
-			&data->time_i[5],
-			&data->time_d,
-			&data->latitude,
-			&data->longitude,
-			&data->rov_pressure,
-			&data->rov_depth,
-			&data->rov_altitude,
-			&data->rov_heading,
-			&data->rov_pitch,
-			&data->rov_roll,
-			&data->ship_latitude,
-			&data->ship_longitude,
-			&data->ship_heading,
-			&data->qc_flag);
-		}
-	    else
-		{
-		nread = sscanf(line,
-			"%c%c%c%c %d %d %d %d %d %d %d %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf %d",
-			&data->rovname[0],&data->rovname[1],&data->rovname[2],&data->rovname[3],
-			&data->divenumber,
-			&data->time_i[0],
-			&data->time_i[1],
-			&data->time_i[2],
-			&data->time_i[3],
-			&data->time_i[4],
-			&data->time_i[5],
-			&data->time_d,
-			&data->latitude,
-			&data->longitude,
-			&data->rov_pressure,
-			&data->rov_depth,
-			&data->rov_altitude,
-			&data->rov_heading,
-			&data->rov_pitch,
-			&data->rov_roll,
-			&data->ship_latitude,
-			&data->ship_longitude,
-			&data->ship_heading,
-			&data->qc_flag);
-		}
-
-	    /* print output debug statements */
-	    if (verbose >= 4)
-		{
-		fprintf(stderr,"\ndbg4  Data read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg4  Values,read:\n");
-		fprintf(stderr,"dbg4       rovname:        %s\n",data->rovname);
-		fprintf(stderr,"dbg4       divenumber:     %d\n",data->divenumber);
-		fprintf(stderr,"dbg4       time_i[0]:      %d\n",data->time_i[0]);
-		fprintf(stderr,"dbg4       time_i[1]:      %d\n",data->time_i[1]);
-		fprintf(stderr,"dbg4       time_i[2]:      %d\n",data->time_i[2]);
-		fprintf(stderr,"dbg4       time_i[3]:      %d\n",data->time_i[3]);
-		fprintf(stderr,"dbg4       time_i[4]:      %d\n",data->time_i[4]);
-		fprintf(stderr,"dbg4       time_i[5]:      %d\n",data->time_i[5]);
-		fprintf(stderr,"dbg4       time_i[6]:      %d\n",data->time_i[6]);
-		fprintf(stderr,"dbg4       time_d:         %f\n",data->time_d);
-		fprintf(stderr,"dbg4       latitude:       %f\n",data->latitude);
-		fprintf(stderr,"dbg4       longitude:      %f\n",data->longitude);
-		fprintf(stderr,"dbg4       rov_pressure:   %f\n",data->rov_pressure);
-		fprintf(stderr,"dbg4       rov_depth:      %f\n",data->rov_depth);
-		fprintf(stderr,"dbg4       rov_heading:    %f\n",data->rov_heading);
-		fprintf(stderr,"dbg4       rov_altitude:   %f\n",data->rov_altitude);
-		fprintf(stderr,"dbg4       rov_pitch:      %f\n",data->rov_pitch);
-		fprintf(stderr,"dbg4       rov_roll:       %f\n",data->rov_roll);
-		fprintf(stderr,"dbg4       ship_longitude: %f\n",data->ship_longitude);
-		fprintf(stderr,"dbg4       ship_latitude:  %f\n",data->ship_latitude);
-		fprintf(stderr,"dbg4       ship_heading:   %f\n",data->ship_heading);
-		fprintf(stderr,"dbg4       qc_flag:        %d\n",data->qc_flag);
-		fprintf(stderr,"dbg4       error:          %d\n",*error);
-		fprintf(stderr,"dbg4       status:         %d\n",status);
-		}
-
-	    /* catch erroneous records with wrong number of columns */
-	    if (nread < 20)
-	    	{
-	    	status = MB_FAILURE;
-	   	*error = MB_ERROR_UNINTELLIGIBLE;
-		}
-
-	    /* catch erroneous records with zero time */
-	    else if (data->time_i[0] == 0)
-	    	{
-	    	status = MB_FAILURE;
-	   	*error = MB_ERROR_UNINTELLIGIBLE;
-		}
-
-	    else
-	    	{
-	    	status = MB_SUCCESS;
-	   	*error = MB_ERROR_NO_ERROR;
-
-	    	/* get time */
-	    	mb_get_date(verbose,data->time_d,data->time_i);
-	    	}
-
-	    }
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_mbarrov2_wr_data(int verbose, void *mbio_ptr, void *data_ptr, int *error)
-{
-	char	*function_name = "mbr_mbarrov2_wr_data";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_mbarrov2_struct *data;
-	char	line[MBF_MBARROV2_MAXLINE+1];
-	int	len;
-	int	*write_count;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       data_ptr:   %p\n",(void *)data_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_mbarrov2_struct *) data_ptr;
-
-	/* get pointer to write counter */
-	write_count = (int *) &mb_io_ptr->save1;
-
-	/* handle the data */
-	if (data->kind == MB_DATA_COMMENT)
-	    {
-	    line[0] = '#';
-            strncpy(&line[1],data->comment,MBF_MBARROV2_MAXLINE-2);
-            len = strlen(line);
-	    if (line[len-1] != '\n')
-		{
-		line[len] = '\n';
-		line[len+1] = '\0';
-		}
-	    }
-	else if (data->kind == MB_DATA_DATA)
-	    {
-	    /* print output debug statements */
-	    if (verbose >= 4)
-		    {
-		    fprintf(stderr,"\ndbg4  Data to be written in MBIO function <%s>\n",
-			    function_name);
-			fprintf(stderr,"dbg4       rovname:        %s\n",data->rovname);
-			fprintf(stderr,"dbg4       divenumber:     %d\n",data->divenumber);
-			fprintf(stderr,"dbg4       time_i[0]:      %d\n",data->time_i[0]);
-			fprintf(stderr,"dbg4       time_i[1]:      %d\n",data->time_i[1]);
-			fprintf(stderr,"dbg4       time_i[2]:      %d\n",data->time_i[2]);
-			fprintf(stderr,"dbg4       time_i[3]:      %d\n",data->time_i[3]);
-			fprintf(stderr,"dbg4       time_i[4]:      %d\n",data->time_i[4]);
-			fprintf(stderr,"dbg4       time_i[5]:      %d\n",data->time_i[5]);
-			fprintf(stderr,"dbg4       time_i[6]:      %d\n",data->time_i[6]);
-			fprintf(stderr,"dbg4       time_d:         %f\n",data->time_d);
-			fprintf(stderr,"dbg4       latitude:       %f\n",data->latitude);
-			fprintf(stderr,"dbg4       longitude:      %f\n",data->longitude);
-			fprintf(stderr,"dbg4       rov_pressure:   %f\n",data->rov_pressure);
-			fprintf(stderr,"dbg4       rov_depth:      %f\n",data->rov_depth);
-			fprintf(stderr,"dbg4       rov_heading:    %f\n",data->rov_heading);
-			fprintf(stderr,"dbg4       rov_altitude:   %f\n",data->rov_altitude);
-			fprintf(stderr,"dbg4       rov_pitch:      %f\n",data->rov_pitch);
-			fprintf(stderr,"dbg4       rov_roll:       %f\n",data->rov_roll);
-			fprintf(stderr,"dbg4       ship_longitude: %f\n",data->ship_longitude);
-			fprintf(stderr,"dbg4       ship_latitude:  %f\n",data->ship_latitude);
-			fprintf(stderr,"dbg4       ship_heading:   %f\n",data->ship_heading);
-			fprintf(stderr,"dbg4       qc_flag:        %d\n",data->qc_flag);
-			fprintf(stderr,"dbg4       error:          %d\n",*error);
-			fprintf(stderr,"dbg4       status:         %d\n",status);
-		    }
-
-            sprintf(line,
-			"%c%c%c%c,%d,%4.4d-%2.2d-%2.2d %2.2d:%2.2d:%2.2d,%9.0f,%10.6f,%11.6f,%6.1f,%6.1f,%6.1f,%5.1f,%6.2f,%6.2f,%10.6f,%11.6f,%6.1f,%d\n",
-			data->rovname[0],data->rovname[1],data->rovname[2],data->rovname[3],
-			data->divenumber,
-			data->time_i[0],
-			data->time_i[1],
-			data->time_i[2],
-			data->time_i[3],
-			data->time_i[4],
-			data->time_i[5],
-			data->time_d,
-			data->latitude,
-			data->longitude,
-			data->rov_pressure,
-			data->rov_depth,
-			data->rov_altitude,
-			data->rov_heading,
-			data->rov_pitch,
-			data->rov_roll,
-			data->ship_latitude,
-			data->ship_longitude,
-			data->ship_heading,
-			data->qc_flag);
-	    }
-
-	/* write file header if needed */
-	if (*write_count == 0)
-	    {
-	    if (fputs(header,mb_io_ptr->mbfp) == EOF)
-		{
-		*error = MB_ERROR_WRITE_FAIL;
-		status = MB_FAILURE;
-		}
-	    else
-		{
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-		}
-	    }
-
-	/* write data */
-	if (fputs(line,mb_io_ptr->mbfp) == EOF)
-		{
-		*error = MB_ERROR_WRITE_FAIL;
-		status = MB_FAILURE;
-		}
-	else
-		{
-		(*write_count)++;
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-		}
-
-
-	/* print output debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Data record kind in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       kind:       %d\n",data->kind);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mbr_mbldeoih.c b/src/mbio/mbr_mbldeoih.c
deleted file mode 100644
index a5bf907..0000000
--- a/src/mbio/mbr_mbldeoih.c
+++ /dev/null
@@ -1,1481 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbr_mbldeoih.c	2/2/93
- *	$Id: mbr_mbldeoih.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1993-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbr_mbldeoih.c contains the functions for reading and writing
- * multibeam data in the MBF_MBLDEOIH format.
- * These functions include:
- *   mbr_alm_mbldeoih	- allocate read/write memory
- *   mbr_dem_mbldeoih	- deallocate read/write memory
- *   mbr_rt_mbldeoih	- read and translate data
- *   mbr_wt_mbldeoih	- translate and write data
- *
- * Author:	D. W. Caress
- * Date:	February 2, 1993
- * 
- */
-/*
- * Notes on the MBF_MBLDEOIH data format:
- *   1. This data format is used to store swath bathymetry
- *      and/or backscatter data with arbitrary numbers of beams
- *      and pixels. This format was created by the
- *      Lamont-Doherty Earth Observatory and the Monterey Bay
- *      Aquarium Research Institute to serve as general
- *      purpose archive formats for processed swath data.
- *   2. The format stores bathymetry, amplitude, and sidescan data.
- *   3. Each data record has a header section and a data section.
- *      The beginning of each header is a two byte identifier.
- *      The size of the header depends on the identifier:
- *           "##" =  8995 : Old comment - 30 byte header
- *           "cc" = 25443 : New comment - 36 byte header
- *           "dd" = 25700 : Version 1 survey data - 38 byte header
- *           "nn" = 28270 : Version 2 survey data - 44 byte header
- *           "DD" = 17476 : Version 3 survey data - 48 byte header
- *           "V4" = 22068 : Version 4 survey data - 90 byte header (13398 little-endian)
- *           "V5" = 22069 : Version 5 survey data - 98 byte header (13654 little-endian)
- *      In the case of data records, the header contains the time stamp,
- *      navigation, and the numbers of depth, beam amplitude, and
- *      sidescan values.  The data section contains the depth and
- *      backscatter values.  The number of depth and beam amplitude
- *      values is generally different from the number of sidescan
- *      values, so the length of the data section must be calculated
- *      from the numbers of beams and pixels. In the case of comment
- *      records, the header contains no information other than the
- *      identifier whether it is old (30 byte) or new (2 byte). The
- *      data section of the comment record is always 128 bytes.
- *   4. The data headers changed for version 2, including beam angle
- *      widths to allow beam footprint calculation. Older data
- *      are read without complaint, and the beam widths are passed
- *      as zero.
- *   5. The data headers changed again for version 3. Previously the
- *      bathymetry values were absolute depths. For version 3 the
- *      stored bathymetry are in depths relative to the sonar, and the
- *      transducer depth must be added to calculate absolute depths.
- *      Older data are read without complaint, and converted to version
- *      3 on writing.
- *   6. The data consist of variable length binary records encoded
- *	entirely in 2-byte integers.
- *   7. All data arrays are centered.
- *
- * The kind value in the mbsys_ldeoih_struct indicates whether the
- * structure holds data (kind = 1) or an
- * ascii comment record (kind = 0).
- *
- * The structures used to represent the binary data in the MBF_MBLDEOIH format
- * are documented in the mbsys_ldeoih.h file.
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mb_define.h"
-#include "mbsys_ldeoih.h"
-
-/* include for byte swapping on little-endian machines */
-#ifdef BYTESWAPPED
-#include "mb_swap.h"
-#endif
-
-/* essential function prototypes */
-int mbr_register_mbldeoih(int verbose, void *mbio_ptr,
-		int *error);
-int mbr_info_mbldeoih(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_alm_mbldeoih(int verbose, void *mbio_ptr, int *error);
-int mbr_dem_mbldeoih(int verbose, void *mbio_ptr, int *error);
-int mbr_rt_mbldeoih(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_wt_mbldeoih(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-
-/* define header sizes */
-#define	MBF_MBLDEOIH_V1HEADERSIZE	38
-#define	MBF_MBLDEOIH_V2HEADERSIZE	44
-#define	MBF_MBLDEOIH_V3HEADERSIZE	48
-#define	MBF_MBLDEOIH_V4HEADERSIZE	90
-#define	MBF_MBLDEOIH_V5HEADERSIZE	98
-#define	MBF_MBLDEOIH_ID_COMMENT1	8995	/* ## */
-#define	MBF_MBLDEOIH_ID_COMMENT2	25443	/* cc */
-#define	MBF_MBLDEOIH_ID_DATA1		25700	/* dd */
-#define	MBF_MBLDEOIH_ID_DATA2		28270	/* nn */
-#define	MBF_MBLDEOIH_ID_DATA3		17476	/* DD */
-#define	MBF_MBLDEOIH_ID_DATA4		22068	/* V4 big endian, 13398 little endian*/
-#define	MBF_MBLDEOIH_ID_DATA5		22069	/* V5 bin endian, 13654 little endian */
-
-static char rcs_id[]="$Id: mbr_mbldeoih.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mbr_register_mbldeoih(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_register_mbldeoih";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* get mb_io_ptr */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set format info parameters */
-	status = mbr_info_mbldeoih(verbose,
-			&mb_io_ptr->system,
-			&mb_io_ptr->beams_bath_max,
-			&mb_io_ptr->beams_amp_max,
-			&mb_io_ptr->pixels_ss_max,
-			mb_io_ptr->format_name,
-			mb_io_ptr->system_name,
-			mb_io_ptr->format_description,
-			&mb_io_ptr->numfile,
-			&mb_io_ptr->filetype,
-			&mb_io_ptr->variable_beams,
-			&mb_io_ptr->traveltime,
-			&mb_io_ptr->beam_flagging,
-			&mb_io_ptr->nav_source,
-			&mb_io_ptr->heading_source,
-			&mb_io_ptr->vru_source,
-			&mb_io_ptr->svp_source,
-			&mb_io_ptr->beamwidth_xtrack,
-			&mb_io_ptr->beamwidth_ltrack,
-			error);
-
-	/* set format and system specific function pointers */
-	mb_io_ptr->mb_io_format_alloc = &mbr_alm_mbldeoih;
-	mb_io_ptr->mb_io_format_free = &mbr_dem_mbldeoih;
-	mb_io_ptr->mb_io_store_alloc = &mbsys_ldeoih_alloc;
-	mb_io_ptr->mb_io_store_free = &mbsys_ldeoih_deall;
-	mb_io_ptr->mb_io_read_ping = &mbr_rt_mbldeoih;
-	mb_io_ptr->mb_io_write_ping = &mbr_wt_mbldeoih;
-	mb_io_ptr->mb_io_dimensions = &mbsys_ldeoih_dimensions;
-	mb_io_ptr->mb_io_sonartype = &mbsys_ldeoih_sonartype;
-	mb_io_ptr->mb_io_sidescantype = &mbsys_ldeoih_sidescantype;
-	mb_io_ptr->mb_io_extract = &mbsys_ldeoih_extract;
-	mb_io_ptr->mb_io_insert = &mbsys_ldeoih_insert;
-	mb_io_ptr->mb_io_extract_nav = &mbsys_ldeoih_extract_nav;
-	mb_io_ptr->mb_io_insert_nav = &mbsys_ldeoih_insert_nav;
-	mb_io_ptr->mb_io_extract_altitude = &mbsys_ldeoih_extract_altitude;
-	mb_io_ptr->mb_io_insert_altitude = &mbsys_ldeoih_insert_altitude;
-	mb_io_ptr->mb_io_extract_svp = NULL;
-	mb_io_ptr->mb_io_insert_svp = NULL;
-	mb_io_ptr->mb_io_ttimes = &mbsys_ldeoih_ttimes;
-	mb_io_ptr->mb_io_detects = &mbsys_ldeoih_detects;
-	mb_io_ptr->mb_io_copyrecord = &mbsys_ldeoih_copy;
-	mb_io_ptr->mb_io_extract_rawss = NULL;
-	mb_io_ptr->mb_io_insert_rawss = NULL;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",mb_io_ptr->system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",mb_io_ptr->beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",mb_io_ptr->beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",mb_io_ptr->pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",mb_io_ptr->format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",mb_io_ptr->system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",mb_io_ptr->format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",mb_io_ptr->numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",mb_io_ptr->filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",mb_io_ptr->variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",mb_io_ptr->traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",mb_io_ptr->beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",mb_io_ptr->nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",mb_io_ptr->heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",mb_io_ptr->vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",mb_io_ptr->svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",mb_io_ptr->beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",mb_io_ptr->beamwidth_ltrack);
-		fprintf(stderr,"dbg2       format_alloc:       %p\n",(void *)mb_io_ptr->mb_io_format_alloc);
-		fprintf(stderr,"dbg2       format_free:        %p\n",(void *)mb_io_ptr->mb_io_format_free);
-		fprintf(stderr,"dbg2       store_alloc:        %p\n",(void *)mb_io_ptr->mb_io_store_alloc);
-		fprintf(stderr,"dbg2       store_free:         %p\n",(void *)mb_io_ptr->mb_io_store_free);
-		fprintf(stderr,"dbg2       read_ping:          %p\n",(void *)mb_io_ptr->mb_io_read_ping);
-		fprintf(stderr,"dbg2       write_ping:         %p\n",(void *)mb_io_ptr->mb_io_write_ping);
-		fprintf(stderr,"dbg2       dimensions:         %p\n",(void *)mb_io_ptr->mb_io_dimensions);
-		fprintf(stderr,"dbg2       sidescantype:       %p\n",(void *)mb_io_ptr->mb_io_sidescantype);
-		fprintf(stderr,"dbg2       extract:            %p\n",(void *)mb_io_ptr->mb_io_extract);
-		fprintf(stderr,"dbg2       insert:             %p\n",(void *)mb_io_ptr->mb_io_insert);
-		fprintf(stderr,"dbg2       extract_nav:        %p\n",(void *)mb_io_ptr->mb_io_extract_nav);
-		fprintf(stderr,"dbg2       insert_nav:         %p\n",(void *)mb_io_ptr->mb_io_insert_nav);
-		fprintf(stderr,"dbg2       extract_altitude:   %p\n",(void *)mb_io_ptr->mb_io_extract_altitude);
-		fprintf(stderr,"dbg2       insert_altitude:    %p\n",(void *)mb_io_ptr->mb_io_insert_altitude);
-		fprintf(stderr,"dbg2       extract_svp:        %p\n",(void *)mb_io_ptr->mb_io_extract_svp);
-		fprintf(stderr,"dbg2       insert_svp:         %p\n",(void *)mb_io_ptr->mb_io_insert_svp);
-		fprintf(stderr,"dbg2       ttimes:             %p\n",(void *)mb_io_ptr->mb_io_ttimes);
-		fprintf(stderr,"dbg2       detects:            %p\n",(void *)mb_io_ptr->mb_io_detects);
-		fprintf(stderr,"dbg2       extract_rawss:      %p\n",(void *)mb_io_ptr->mb_io_extract_rawss);
-		fprintf(stderr,"dbg2       insert_rawss:       %p\n",(void *)mb_io_ptr->mb_io_insert_rawss);
-		fprintf(stderr,"dbg2       copyrecord:         %p\n",(void *)mb_io_ptr->mb_io_copyrecord);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbr_info_mbldeoih(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error)
-{
-	char	*function_name = "mbr_info_mbldeoih";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* set format info parameters */
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-	*system = MB_SYS_LDEOIH;
-	*beams_bath_max = 0;
-	*beams_amp_max = 0;
-	*pixels_ss_max = 0;
-	strncpy(format_name, "MBLDEOIH", MB_NAME_LENGTH);
-	strncpy(system_name, "LDEOIH", MB_NAME_LENGTH);
-	strncpy(format_description, "Format name:          MBF_MBLDEOIH\nInformal Description: L-DEO in-house generic multibeam\nAttributes:           Data from all sonar systems, bathymetry, \n                      amplitude and sidescan, variable beams and pixels, \n                      binary, centered, L-DEO.\n", MB_DESCRIPTION_LENGTH);
-	*numfile = 1;
-	*filetype = MB_FILETYPE_NORMAL;
-	*variable_beams = MB_YES;
-	*traveltime = MB_NO;
-	*beam_flagging = MB_YES;
-	*nav_source = MB_DATA_DATA;
-	*heading_source = MB_DATA_DATA;
-	*vru_source = MB_DATA_DATA;
-	*svp_source = MB_DATA_NONE;
-	*beamwidth_xtrack = 0.0;
-	*beamwidth_ltrack = 0.0;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",*system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",*beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",*beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",*pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",*numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",*filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",*variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",*traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",*beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",*nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",*heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",*vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",*svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",*beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",*beamwidth_ltrack);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_alm_mbldeoih(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_alm_mbldeoih";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set initial status */
-	status = MB_SUCCESS;
-
-	/* allocate memory for data structure */
-	status = mbsys_ldeoih_alloc(verbose,mbio_ptr,
-		&mb_io_ptr->store_data,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_dem_mbldeoih(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_dem_mbldeoih";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* deallocate memory for data descriptor */
-	status = mbsys_ldeoih_deall(verbose,mbio_ptr,
-		&mb_io_ptr->store_data,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_rt_mbldeoih(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_rt_mbldeoih";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_ldeoih_struct *store;
-	struct mbsys_ldeoih_old_struct oldstore;
-	int	read_size;
-	short	*flag;
-	short	short_transducer_depth;
-	short	short_altitude;
-	short	short_beams_bath, short_beams_amp, short_pixels_ss, short_spare1;
-	int	header_length;
-	char	buffer[MBF_MBLDEOIH_V4HEADERSIZE];
-	int	index;
-	double	newdepthscale;
-	double	depthmax;
-	int	time_i[7], time_j[6];
-	int	version;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor and data structure */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-	store = (struct mbsys_ldeoih_struct *) store_ptr;
-
-	/* set file position */
-	mb_io_ptr->file_pos = mb_io_ptr->file_bytes;
-
-	/* read next header id from file */
-	if ((status = fread(buffer,1,2,mb_io_ptr->mbfp)) == 2)
-		{
-		mb_io_ptr->file_bytes += status;
-		status = MB_SUCCESS;
-		*error = MB_ERROR_NO_ERROR;
-		}
-	else
-		{
-		mb_io_ptr->file_bytes += status;
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	/* read rest of header from file */
-	if (status == MB_SUCCESS)
-		{
-		flag = (short *) buffer;
-#ifdef BYTESWAPPED
-		*flag = mb_swap_short(*flag);
-#endif
-		if (*flag == MBF_MBLDEOIH_ID_COMMENT1)
-			{
-			store->kind = MB_DATA_COMMENT;
-			header_length = MBF_MBLDEOIH_V1HEADERSIZE;
-			}
-		else if (*flag == MBF_MBLDEOIH_ID_COMMENT2)
-			{
-			store->kind = MB_DATA_COMMENT;
-			header_length = 2;
-			}
-		else if (*flag == MBF_MBLDEOIH_ID_DATA5)
-			{
-			store->kind = MB_DATA_DATA;
-			header_length = MBF_MBLDEOIH_V5HEADERSIZE;
-			version = 5;
-			}
-		else if (*flag == MBF_MBLDEOIH_ID_DATA4)
-			{
-			store->kind = MB_DATA_DATA;
-			header_length = MBF_MBLDEOIH_V4HEADERSIZE;
-			version = 4;
-			}
-		else if (*flag == MBF_MBLDEOIH_ID_DATA3)
-			{
-			store->kind = MB_DATA_DATA;
-			header_length = MBF_MBLDEOIH_V3HEADERSIZE;
-			version = 3;
-			}
-		else if (*flag == MBF_MBLDEOIH_ID_DATA2)
-			{
-			store->kind = MB_DATA_DATA;
-			header_length = MBF_MBLDEOIH_V2HEADERSIZE;
-			version = 2;
-			}
-		else if (*flag == MBF_MBLDEOIH_ID_DATA1)
-			{
-			store->kind = MB_DATA_DATA;
-			header_length = MBF_MBLDEOIH_V1HEADERSIZE;
-			version = 1;
-			}
-		else
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_UNINTELLIGIBLE;
-			store->kind = MB_DATA_NONE;
-			}
-		}
-	if (status == MB_SUCCESS
-	    && header_length == 2)
-		{
-		/* only 2 byte header for new style comment */
-		status = MB_SUCCESS;
-		*error = MB_ERROR_NO_ERROR;
-		}
-	else if (status == MB_SUCCESS
-	    && (status = fread(&buffer[2],1,header_length-2,
-			mb_io_ptr->mbfp)) == header_length-2)
-		{
-		mb_io_ptr->file_bytes += status;
-		status = MB_SUCCESS;
-		*error = MB_ERROR_NO_ERROR;
-		}
-	else
-		{
-		mb_io_ptr->file_bytes += status;
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	if (status == MB_SUCCESS && store->kind == MB_DATA_DATA)
-		{
-		if (version == 5)
-			{
-			index = 2;
-			mb_get_binary_double(MB_NO, (void *)  &buffer[index], &store->time_d); index +=8;
-			mb_get_binary_double(MB_NO, (void *)  &buffer[index], &store->longitude); index +=8;
-			mb_get_binary_double(MB_NO, (void *)  &buffer[index], &store->latitude); index +=8;
-			mb_get_binary_double(MB_NO, (void *)  &buffer[index], &store->sonardepth); index +=8;
-			mb_get_binary_double(MB_NO, (void *)  &buffer[index], &store->altitude); index +=8;
-			mb_get_binary_float(MB_NO, (void *)  &buffer[index], &store->heading); index +=4;
-			mb_get_binary_float(MB_NO, (void *)  &buffer[index], &store->speed); index +=4;
-			mb_get_binary_float(MB_NO, (void *)  &buffer[index], &store->roll); index +=4;
-			mb_get_binary_float(MB_NO, (void *)  &buffer[index], &store->pitch); index +=4;
-			mb_get_binary_float(MB_NO, (void *)  &buffer[index], &store->heave); index +=4;
-			mb_get_binary_float(MB_NO, (void *)  &buffer[index], &store->beam_xwidth); index +=4;
-			mb_get_binary_float(MB_NO, (void *)  &buffer[index], &store->beam_lwidth); index +=4;
-			mb_get_binary_int(MB_NO, (void *)  &buffer[index], &store->beams_bath); index +=4;
-			mb_get_binary_int(MB_NO, (void *)  &buffer[index], &store->beams_amp); index +=4;
-			mb_get_binary_int(MB_NO, (void *)  &buffer[index], &store->pixels_ss); index +=4;
-			mb_get_binary_int(MB_NO, (void *)  &buffer[index], &store->spare1); index +=4;
-			mb_get_binary_float(MB_NO, (void *)  &buffer[index], &store->depth_scale); index +=4;
-			mb_get_binary_float(MB_NO, (void *)  &buffer[index], &store->distance_scale); index +=4;
-			store->ss_scalepower = buffer[index]; index++;
-			store->ss_type = buffer[index]; index++;
-			store->imagery_type = buffer[index]; index++;
-			store->topo_type = buffer[index]; index++;
-			}
-		else if (version == 4)
-			{
-			index = 2;
-			mb_get_binary_double(MB_NO, (void *)  &buffer[index], &store->time_d); index +=8;
-			mb_get_binary_double(MB_NO, (void *)  &buffer[index], &store->longitude); index +=8;
-			mb_get_binary_double(MB_NO, (void *)  &buffer[index], &store->latitude); index +=8;
-			mb_get_binary_double(MB_NO, (void *)  &buffer[index], &store->sonardepth); index +=8;
-			mb_get_binary_double(MB_NO, (void *)  &buffer[index], &store->altitude); index +=8;
-			mb_get_binary_float(MB_NO, (void *)  &buffer[index], &store->heading); index +=4;
-			mb_get_binary_float(MB_NO, (void *)  &buffer[index], &store->speed); index +=4;
-			mb_get_binary_float(MB_NO, (void *)  &buffer[index], &store->roll); index +=4;
-			mb_get_binary_float(MB_NO, (void *)  &buffer[index], &store->pitch); index +=4;
-			mb_get_binary_float(MB_NO, (void *)  &buffer[index], &store->heave); index +=4;
-			mb_get_binary_float(MB_NO, (void *)  &buffer[index], &store->beam_xwidth); index +=4;
-			mb_get_binary_float(MB_NO, (void *)  &buffer[index], &store->beam_lwidth); index +=4;
-			mb_get_binary_short(MB_NO, (void *)  &buffer[index], &short_beams_bath); index +=2;
-			mb_get_binary_short(MB_NO, (void *)  &buffer[index], &short_beams_amp); index +=2;
-			mb_get_binary_short(MB_NO, (void *)  &buffer[index], &short_pixels_ss); index +=2;
-			mb_get_binary_short(MB_NO, (void *)  &buffer[index], &short_spare1); index +=2;
-			mb_get_binary_float(MB_NO, (void *)  &buffer[index], &store->depth_scale); index +=4;
-			mb_get_binary_float(MB_NO, (void *)  &buffer[index], &store->distance_scale); index +=4;
-			store->ss_scalepower = buffer[index]; index++;
-			store->ss_type = buffer[index]; index++;
-			store->imagery_type = buffer[index]; index++;
-			store->topo_type = buffer[index]; index++;
-			store->beams_bath = short_beams_bath;
-			store->beams_amp = short_beams_amp;
-			store->pixels_ss = short_pixels_ss;
-			store->spare1 = short_spare1;
-			}
-		else
-			{
-			index = 2;
-			mb_get_binary_short(MB_NO, (void *)  &buffer[index], &oldstore.year); index +=2;
-			mb_get_binary_short(MB_NO, (void *)  &buffer[index], &oldstore.day); index +=2;
-			mb_get_binary_short(MB_NO, (void *)  &buffer[index], &oldstore.min); index +=2;
-			mb_get_binary_short(MB_NO, (void *)  &buffer[index], &oldstore.sec); index +=2;
-			mb_get_binary_short(MB_NO, (void *)  &buffer[index], &oldstore.msec); index +=2;
-			mb_get_binary_short(MB_NO, (void *)  &buffer[index], &oldstore.lon2u); index +=2;
-			mb_get_binary_short(MB_NO, (void *)  &buffer[index], &oldstore.lon2b); index +=2;
-			mb_get_binary_short(MB_NO, (void *)  &buffer[index], &oldstore.lat2u); index +=2;
-			mb_get_binary_short(MB_NO, (void *)  &buffer[index], &oldstore.lat2b); index +=2;
-			mb_get_binary_short(MB_NO, (void *)  &buffer[index], &oldstore.heading); index +=2;
-			mb_get_binary_short(MB_NO, (void *)  &buffer[index], &oldstore.speed); index +=2;
-			mb_get_binary_short(MB_NO, (void *)  &buffer[index], &oldstore.beams_bath); index +=2;
-			mb_get_binary_short(MB_NO, (void *)  &buffer[index], &oldstore.beams_amp); index +=2;
-			mb_get_binary_short(MB_NO, (void *)  &buffer[index], &oldstore.pixels_ss); index +=2;
-			if (version == 1)
-				{
-				mb_get_binary_short(MB_NO, (void *)  &buffer[index], &oldstore.depth_scale); index +=2;
-				mb_get_binary_short(MB_NO, (void *)  &buffer[index], &oldstore.distance_scale); index +=2;
-				mb_get_binary_short(MB_NO, (void *)  &buffer[index], &short_transducer_depth); index +=2;
-				mb_get_binary_short(MB_NO, (void *)  &buffer[index], &short_altitude); index +=2;
-				oldstore.transducer_depth = (int) (oldstore.depth_scale * short_transducer_depth);
-				oldstore.altitude = (int) (oldstore.depth_scale * short_altitude);
-				}
-			else if (version == 2)
-				{
-				mb_get_binary_short(MB_NO, (void *)  &buffer[index], &oldstore.depth_scale); index +=2;
-				mb_get_binary_short(MB_NO, (void *)  &buffer[index], &oldstore.distance_scale); index +=2;
-				mb_get_binary_short(MB_NO, (void *)  &buffer[index], &short_transducer_depth); index +=2;
-				mb_get_binary_short(MB_NO, (void *)  &buffer[index], &short_altitude); index +=2;
-				mb_get_binary_short(MB_NO, (void *)  &buffer[index], &oldstore.beam_xwidth); index +=2;
-				mb_get_binary_short(MB_NO, (void *)  &buffer[index], &oldstore.beam_lwidth); index +=2;
-				mb_get_binary_short(MB_NO, (void *)  &buffer[index], &oldstore.ss_type); index +=2;
-				oldstore.transducer_depth = (int) (oldstore.depth_scale * short_transducer_depth);
-				oldstore.altitude = (int) (oldstore.depth_scale * short_altitude);
-				}
-			else if (version == 3)
-				{
-				mb_get_binary_short(MB_NO, (void *)  &buffer[index], &oldstore.depth_scale); index +=2;
-				mb_get_binary_short(MB_NO, (void *)  &buffer[index], &oldstore.distance_scale); index +=2;
-				mb_get_binary_int(MB_NO, (void *)  &buffer[index], &oldstore.transducer_depth); index +=4;
-				mb_get_binary_int(MB_NO, (void *)  &buffer[index], &oldstore.altitude); index +=4;
-				mb_get_binary_short(MB_NO, (void *)  &buffer[index], &oldstore.beam_xwidth); index +=2;
-				mb_get_binary_short(MB_NO, (void *)  &buffer[index], &oldstore.beam_lwidth); index +=2;
-				mb_get_binary_short(MB_NO, (void *)  &buffer[index], &oldstore.ss_type); index +=2;
-				}
-
-			/* translate old data to current */
-
-			/* get time */
-			time_j[0] = oldstore.year;
-			time_j[1] = oldstore.day;
-			time_j[2] = oldstore.min;
-			time_j[3] = oldstore.sec;
-			time_j[4] = 1000 * oldstore.msec;
-			mb_get_itime(verbose,time_j,time_i);
-			mb_get_time(verbose,time_i,&store->time_d);
-
-			/* get navigation */
-			store->longitude = ((double) oldstore.lon2u)/60.
-						+ ((double) oldstore.lon2b)/600000.;
-			store->latitude = ((double) oldstore.lat2u)/60.
-						+ ((double) oldstore.lat2b)/600000. - 90.;
-
-			/* get sonardepth and altitude */
-			store->sonardepth = 0.001 * oldstore.transducer_depth;
-		    	store->altitude = 0.001 * oldstore.altitude;
-
-			/* get heading (360 degrees = 65536) and speed */
-			store->heading = (float) (0.0054932 * oldstore.heading);
-			store->speed = (float)(0.01 * oldstore.speed);
-
-			/* set roll and pitch to zero */
-			store->roll = 0.0;
-			store->pitch = 0.0;
-
-			/* set beamwidths in mb_io structure */
-			if (oldstore.beam_xwidth > 0)
-			    store->beam_xwidth = 0.01 * oldstore.beam_xwidth;
-			else
-			    store->beam_xwidth = 2.0;
-			if (oldstore.beam_lwidth > 0)
-			    store->beam_lwidth = 0.01 * oldstore.beam_lwidth;
-			else
-			    store->beam_lwidth = 2.0;
-
-			/* get beams_bath, beams_amp, pixels_ss */
-			store->beams_bath = oldstore.beams_bath;
-			store->beams_amp = oldstore.beams_amp;
-			store->pixels_ss = oldstore.pixels_ss;
-			store->spare1 = 0;
-
-			/* get scaling */
-			store->depth_scale = 0.001 * oldstore.depth_scale;
-			store->distance_scale = 0.001 * oldstore.distance_scale;
-
-			/* get sidescan type */
-			store->ss_scalepower = 0;
-			store->ss_type = oldstore.ss_type;
-			store->imagery_type = 0;
-			store->topo_type = MB_TOPOGRAPHY_TYPE_UNKNOWN;
-			}
-		}
-
-	/* set kind and error in mb_io_ptr */
-	mb_io_ptr->new_kind = store->kind;
-	mb_io_ptr->new_error = *error;
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  New header read in function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       flag:       %d\n",*flag);
-		}
-	if (verbose >= 5 && store->kind == MB_DATA_DATA && version < 4)
-		{
-		fprintf(stderr,"\ndbg5  Old version header read in function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       version:          %d\n",version);
-		fprintf(stderr,"dbg5       year:             %d\n",oldstore.year);
-		fprintf(stderr,"dbg5       day:              %d\n",oldstore.day);
-		fprintf(stderr,"dbg5       minute:           %d\n",oldstore.min);
-		fprintf(stderr,"dbg5       second:           %d\n",oldstore.sec);
-		fprintf(stderr,"dbg5       msec:             %d\n",oldstore.msec);
-		fprintf(stderr,"dbg5       lonu:             %d\n",oldstore.lon2u);
-		fprintf(stderr,"dbg5       lonb:             %d\n",oldstore.lon2b);
-		fprintf(stderr,"dbg5       latu:             %d\n",oldstore.lat2u);
-		fprintf(stderr,"dbg5       latb:             %d\n",oldstore.lat2b);
-		fprintf(stderr,"dbg5       heading:          %d\n",oldstore.heading);
-		fprintf(stderr,"dbg5       speed:            %d\n",oldstore.speed);
-		fprintf(stderr,"dbg5       beams bath:       %d\n",oldstore.beams_bath);
-		fprintf(stderr,"dbg5       beams amp:        %d\n",oldstore.beams_amp);
-		fprintf(stderr,"dbg5       pixels ss:        %d\n",oldstore.pixels_ss);
-		fprintf(stderr,"dbg5       depth scale:      %d\n",oldstore.depth_scale);
-		fprintf(stderr,"dbg5       dist scale:       %d\n",oldstore.distance_scale);
-		fprintf(stderr,"dbg5       transducer_depth: %d\n",oldstore.transducer_depth);
-		fprintf(stderr,"dbg5       altitude:         %d\n",oldstore.altitude);
-		fprintf(stderr,"dbg5       beam_xwidth:      %d\n",oldstore.beam_xwidth);
-		fprintf(stderr,"dbg5       beam_lwidth:      %d\n",oldstore.beam_lwidth);
-		fprintf(stderr,"dbg5       ss_type:          %d\n",oldstore.ss_type);
-		fprintf(stderr,"dbg5       status:           %d\n",status);
-		fprintf(stderr,"dbg5       error:            %d\n",*error);
-		}
-	if (verbose >= 5 && store->kind == MB_DATA_DATA)
-		{
-		fprintf(stderr,"\ndbg5  Current version header values in function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       time_d:           %f\n",store->time_d);
-		fprintf(stderr,"dbg5       longitude:        %f\n",store->longitude);
-		fprintf(stderr,"dbg5       latitude:         %f\n",store->latitude);
-		fprintf(stderr,"dbg5       sonardepth:       %f\n",store->sonardepth);
-		fprintf(stderr,"dbg5       altitude:         %f\n",store->altitude);
-		fprintf(stderr,"dbg5       heading:          %f\n",store->heading);
-		fprintf(stderr,"dbg5       speed:            %f\n",store->speed);
-		fprintf(stderr,"dbg5       roll:             %f\n",store->roll);
-		fprintf(stderr,"dbg5       pitch:            %f\n",store->pitch);
-		fprintf(stderr,"dbg5       heave:            %f\n",store->heave);
-		fprintf(stderr,"dbg5       beam_xwidth:      %f\n",store->beam_xwidth);
-		fprintf(stderr,"dbg5       beam_lwidth:      %f\n",store->beam_lwidth);
-		fprintf(stderr,"dbg5       beams_bath:       %d\n",store->beams_bath);
-		fprintf(stderr,"dbg5       beams_amp:        %d\n",store->beams_amp);
-		fprintf(stderr,"dbg5       pixels_ss:        %d\n",store->pixels_ss);
-		fprintf(stderr,"dbg5       spare1:           %d\n",store->spare1);
-		fprintf(stderr,"dbg5       depth_scale:      %f\n",store->depth_scale);
-		fprintf(stderr,"dbg5       distance_scale:   %f\n",store->distance_scale);
-		fprintf(stderr,"dbg5       ss_scalepower:    %d\n",store->ss_scalepower);
-		fprintf(stderr,"dbg5       ss_type:          %d\n",store->ss_type);
-		fprintf(stderr,"dbg5       spare3:           %d\n",store->imagery_type);
-		fprintf(stderr,"dbg5       sonartype:        %d\n",store->topo_type);
-		fprintf(stderr,"dbg5       status:           %d\n",status);
-		fprintf(stderr,"dbg5       error:            %d\n",*error);
-		}
-
-	/* read next chunk of the data */
-	if (status == MB_SUCCESS
-		&& store->kind == MB_DATA_COMMENT)
-		{
-		read_size = 128;
-		if ((status = fread(store->comment,1,read_size,mb_io_ptr->mbfp))
-			== read_size)
-			{
-			mb_io_ptr->file_bytes += status;
-			status = MB_SUCCESS;
-			*error = MB_ERROR_NO_ERROR;
-			}
-		else
-			{
-			mb_io_ptr->file_bytes += status;
-			status = MB_FAILURE;
-			*error = MB_ERROR_EOF;
-			}
-
-		/* print debug messages */
-		if (verbose >= 5 && status == MB_SUCCESS)
-			{
-			fprintf(stderr,"\ndbg5  New header comment in function <%s>\n",function_name);
-			fprintf(stderr,"dbg5       comment: %s\n",store->comment);
-			}
-		}
-	else if (status == MB_SUCCESS
-		&& store->kind == MB_DATA_DATA)
-		{
-		/* if needed reset numbers of beams and allocate
-		   memory for store arrays */
-		if (store->beams_bath > store->beams_bath_alloc)
-		    {
-		    store->beams_bath_alloc = store->beams_bath;
-		    if (store->beamflag != NULL)
-			status = mb_freed(verbose,__FILE__, __LINE__, (void **) &store->beamflag, error);
-		    if (store->bath != NULL)
-			status = mb_freed(verbose,__FILE__, __LINE__, (void **) &store->bath, error);
-		    if (store->bath_acrosstrack != NULL)
-			status = mb_freed(verbose,__FILE__, __LINE__, (void **) &store->bath_acrosstrack, error);
-		    if (store->bath_alongtrack != NULL)
-			status = mb_freed(verbose,__FILE__, __LINE__, (void **) &store->bath_alongtrack, error);
-		    status = mb_mallocd(verbose,__FILE__,__LINE__,
-				store->beams_bath_alloc * sizeof(char),
-				(void **)&store->beamflag,error);
-		    status = mb_mallocd(verbose,__FILE__,__LINE__,
-				store->beams_bath_alloc * sizeof(short),
-				(void **)&store->bath,error);
-		    status = mb_mallocd(verbose,__FILE__,__LINE__,
-				store->beams_bath_alloc * sizeof(short),
-				(void **)&store->bath_acrosstrack,error);
-		    status = mb_mallocd(verbose,__FILE__,__LINE__,
-				store->beams_bath_alloc * sizeof(short),
-				(void **)&store->bath_alongtrack,error);
-
-		    /* deal with a memory allocation failure */
-		    if (status == MB_FAILURE)
-			{
-			status = mb_freed(verbose,__FILE__, __LINE__, (void **) &store->beamflag, error);
-			status = mb_freed(verbose,__FILE__, __LINE__, (void **) &store->bath, error);
-			status = mb_freed(verbose,__FILE__, __LINE__, (void **) &store->bath_acrosstrack, error);
-			status = mb_freed(verbose,__FILE__, __LINE__, (void **) &store->bath_alongtrack, error);
-			status = MB_FAILURE;
-			*error = MB_ERROR_MEMORY_FAIL;
-			if (verbose >= 2)
-				{
-				fprintf(stderr,"\ndbg2  MBIO function <%s> terminated with error\n",function_name);
-				fprintf(stderr,"dbg2  Return values:\n");
-				fprintf(stderr,"dbg2       error:      %d\n",*error);
-				fprintf(stderr,"dbg2  Return status:\n");
-				fprintf(stderr,"dbg2       status:  %d\n",status);
-				}
-			return(status);
-			}
-		    }
-		if (store->beams_amp > store->beams_amp_alloc)
-		    {
-		    store->beams_amp_alloc = store->beams_amp;
-		    if (store->amp != NULL)
-			status = mb_freed(verbose,__FILE__, __LINE__, (void **) &store->amp, error);
-		    status = mb_mallocd(verbose,__FILE__,__LINE__,
-				store->beams_amp_alloc * sizeof(short),
-				(void **)&store->amp,error);
-
-		    /* deal with a memory allocation failure */
-		    if (status == MB_FAILURE)
-			{
-			status = mb_freed(verbose,__FILE__, __LINE__, (void **) &store->amp, error);
-			status = MB_FAILURE;
-			*error = MB_ERROR_MEMORY_FAIL;
-			if (verbose >= 2)
-				{
-				fprintf(stderr,"\ndbg2  MBIO function <%s> terminated with error\n",function_name);
-				fprintf(stderr,"dbg2  Return values:\n");
-				fprintf(stderr,"dbg2       error:      %d\n",*error);
-				fprintf(stderr,"dbg2  Return status:\n");
-				fprintf(stderr,"dbg2       status:  %d\n",status);
-				}
-			return(status);
-			}
-		    }
-		if (store->pixels_ss > store->pixels_ss_alloc)
-		    {
-		    store->pixels_ss_alloc = store->pixels_ss;
-		    if (store->ss != NULL)
-			status = mb_freed(verbose,__FILE__, __LINE__, (void **) &store->ss, error);
-		    if (store->ss_acrosstrack != NULL)
-			status = mb_freed(verbose,__FILE__, __LINE__, (void **) &store->ss_acrosstrack, error);
-		    if (store->ss_alongtrack != NULL)
-			status = mb_freed(verbose,__FILE__, __LINE__, (void **) &store->ss_alongtrack, error);
-		    status = mb_mallocd(verbose,__FILE__,__LINE__,
-				store->pixels_ss_alloc * sizeof(short),
-				(void **)&store->ss,error);
-		    status = mb_mallocd(verbose,__FILE__,__LINE__,
-				store->pixels_ss_alloc * sizeof(short),
-				(void **)&store->ss_acrosstrack,error);
-		    status = mb_mallocd(verbose,__FILE__,__LINE__,
-				store->pixels_ss_alloc * sizeof(short),
-				(void **)&store->ss_alongtrack,error);
-
-		    /* deal with a memory allocation failure */
-		    if (status == MB_FAILURE)
-			{
-			status = mb_freed(verbose,__FILE__, __LINE__, (void **) &store->ss, error);
-			status = mb_freed(verbose,__FILE__, __LINE__, (void **) &store->ss_acrosstrack, error);
-			status = mb_freed(verbose,__FILE__, __LINE__, (void **) &store->ss_alongtrack, error);
-			status = MB_FAILURE;
-			*error = MB_ERROR_MEMORY_FAIL;
-			if (verbose >= 2)
-				{
-				fprintf(stderr,"\ndbg2  MBIO function <%s> terminated with error\n",function_name);
-				fprintf(stderr,"dbg2  Return values:\n");
-				fprintf(stderr,"dbg2       error:      %d\n",*error);
-				fprintf(stderr,"dbg2  Return status:\n");
-				fprintf(stderr,"dbg2       status:  %d\n",status);
-				}
-			return(status);
-			}
-		    }
-
-		/* read bathymetry */
-		read_size = sizeof(char)*store->beams_bath;
-		status = fread(store->beamflag,1,read_size,mb_io_ptr->mbfp);
-		read_size = sizeof(short int)*store->beams_bath;
-		status = fread(store->bath,1,read_size,mb_io_ptr->mbfp);
-		mb_io_ptr->file_bytes += status;
-		status = fread(store->bath_acrosstrack,1,read_size,mb_io_ptr->mbfp);
-		mb_io_ptr->file_bytes += status;
-		status = fread(store->bath_alongtrack,1,read_size,mb_io_ptr->mbfp);
-		mb_io_ptr->file_bytes += status;
-
-		/* read amplitudes */
-		read_size = sizeof(short int)*store->beams_amp;
-		status = fread(store->amp,1,read_size,mb_io_ptr->mbfp);
-		mb_io_ptr->file_bytes += status;
-
-		/* read sidescan */
-		read_size = sizeof(short int)*store->pixels_ss;
-		status = fread(store->ss,1,read_size,mb_io_ptr->mbfp);
-		mb_io_ptr->file_bytes += status;
-		status = fread(store->ss_acrosstrack,1,read_size,mb_io_ptr->mbfp);
-		mb_io_ptr->file_bytes += status;
-		status = fread(store->ss_alongtrack,1,read_size,mb_io_ptr->mbfp);
-		mb_io_ptr->file_bytes += status;
-
-		/* byte swap the data if necessary */
-#ifdef BYTESWAPPED
-		for (i=0;i<store->beams_bath;i++)
-			{
-			store->bath[i] = mb_swap_short(store->bath[i]);
-			store->bath_acrosstrack[i]
-				= mb_swap_short(store->bath_acrosstrack[i]);
-			store->bath_alongtrack[i]
-				= mb_swap_short(store->bath_alongtrack[i]);
-			}
-		for (i=0;i<store->beams_amp;i++)
-			{
-			store->amp[i] = mb_swap_short(store->amp[i]);
-			}
-		for (i=0;i<store->pixels_ss;i++)
-			{
-			store->ss[i] = mb_swap_short(store->ss[i]);
-			store->ss_acrosstrack[i]
-				= mb_swap_short(store->ss_acrosstrack[i]);
-			store->ss_alongtrack[i]
-				= mb_swap_short(store->ss_alongtrack[i]);
-			}
-#endif
-
-		/* subtract the transducer depth from the bathymetry if version
-			1 or 2 data has been read */
-		if (version < 3)
-			{
-			depthmax = 0.0;
-			for (i=0;i<store->beams_bath;i++)
-				{
-				depthmax = MAX(depthmax, (store->depth_scale * store->bath[i] - store->sonardepth));
-				}
-			if (depthmax > 0.0)
-				newdepthscale = 0.001 * (double)(MAX((int) (1 + depthmax / 30.0), 1));
-			for (i=0;i<store->beams_bath;i++)
-				{
-				store->bath[i] = (short)((store->depth_scale * store->bath[i] - store->sonardepth) / newdepthscale);
-				}
-			store->depth_scale = newdepthscale;
-			}
-
-		/* check for end of file */
-		if (status == read_size)
-			{
-			status = MB_SUCCESS;
-			*error = MB_ERROR_NO_ERROR;
-			}
-		else
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_EOF;
-			}
-			
-		/* update maximum numbers of beams and pixels */
-		mb_io_ptr->beams_bath_max = MAX(mb_io_ptr->beams_bath_max, store->beams_bath);
-		mb_io_ptr->beams_amp_max = MAX(mb_io_ptr->beams_amp_max, store->beams_amp);
-		mb_io_ptr->pixels_ss_max = MAX(mb_io_ptr->pixels_ss_max, store->pixels_ss);
-
-		/* print debug messages */
-		if (verbose >= 5 && status == MB_SUCCESS)
-			{
-			fprintf(stderr,"\ndbg5  New data read in function <%s>\n",function_name);
-			fprintf(stderr,"dbg5       beams_bath: %d\n",
-				store->beams_bath);
-			for (i=0;i<store->beams_bath;i++)
-			  fprintf(stderr,"dbg5       beam:%d  flag:%d  bath:%d  acrosstrack:%d  alongtrack:%d\n",
-				i,store->beamflag[i],store->bath[i],
-				store->bath_acrosstrack[i],store->bath_alongtrack[i]);
-			fprintf(stderr,"dbg5       beams_amp:  %d\n",
-				store->beams_amp);
-			for (i=0;i<store->beams_amp;i++)
-			  fprintf(stderr,"dbg5       beam:%d  flag:%d  amp:%d  acrosstrack:%d  alongtrack:%d\n",
-				i,store->beamflag[i],store->amp[i],
-				store->bath_acrosstrack[i],store->bath_alongtrack[i]);
-			fprintf(stderr,"dbg5       pixels_ss:  %d\n",
-				store->pixels_ss);
-			for (i=0;i<store->pixels_ss;i++)
-			  fprintf(stderr,"dbg5       pixel:%d  ss:%d acrosstrack:%d  alongtrack:%d\n",
-				i,store->ss[i],
-				store->ss_acrosstrack[i],store->ss_alongtrack[i]);
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_wt_mbldeoih(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_wt_mbldeoih";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_ldeoih_struct *store;
-	struct mbsys_ldeoih_old_struct oldstore;
-	int	write_size;
-	short	*flag;
-	int	header_length;
-	char	buffer[MBF_MBLDEOIH_V4HEADERSIZE];
-	int	index;
-	double	depthscale, newdepthscale;
-	double	depthmax, transducer_depth;
-	double	navlon, navlat;
-	short	short_transducer_depth;
-	short	short_altitude;
-	int	*version;
-	int	time_j[5], time_i[7];
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor and data storage */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-	store = (struct mbsys_ldeoih_struct *) store_ptr;
-
-	/* set data flag pointer */
-	flag = (short *) buffer;
-
-	/* set version pointer */
-	version = &(mb_io_ptr->save1);
-
-	/* if set, write old format - this should only happen for writing fbt files
-		when the user has set fbtversion = old in the .mbio_defaults file
-		using mbdefaults */
-	if (store->kind == MB_DATA_DATA && *version == 2)
-		{
-		*flag = MBF_MBLDEOIH_ID_DATA2;
-		header_length = MBF_MBLDEOIH_V2HEADERSIZE;
-
-		/* translate data to old format */
-
-		/* get time */
-		mb_get_date(verbose, store->time_d, time_i);
-		mb_get_jtime(verbose,time_i,time_j);
-		oldstore.year = time_j[0];
-		oldstore.day = time_j[1];
-		oldstore.min = time_j[2];
-		oldstore.sec = time_j[3];
-		oldstore.msec = (short int)(((double)time_j[4] / 1000.0) + 0.5);
-
-		/* get navigation */
-		navlon = store->longitude;
-		if (navlon < 0.0)
-			navlon = navlon + 360.0;
-		oldstore.lon2u = (short int) 60.0 * navlon;
-		oldstore.lon2b = (short int) (600000.0 *
-					(navlon - ((double) oldstore.lon2u)/60.0));
-		navlat = store->latitude + 90.0;
-		oldstore.lat2u = (short int) 60.0 * navlat;
-		oldstore.lat2b = (short int) (600000.0 * (navlat - ((double) oldstore.lat2u)/60.0));
-
-		/* get heading (360 degrees = 65536) */
-		oldstore.heading = 182.044444 * store->heading;
-
-		oldstore.speed = 0.01 * store->speed;
-
-		/* get beams_bath, beams_amp, pixels_ss */
-		oldstore.beams_bath = store->beams_bath;
-		oldstore.beams_amp = store->beams_amp;
-		oldstore.pixels_ss = store->pixels_ss;
-
-		/* set beamwidths */
-		oldstore.beam_xwidth = 100 *store->beam_xwidth;
-		oldstore.beam_lwidth = 100 *store->beam_lwidth;
-
-		/* get scaling */
-		oldstore.depth_scale = 1000 * store->depth_scale;
-		oldstore.distance_scale = 1000 * store->distance_scale;
-		if (oldstore.depth_scale == 0)
-			oldstore.depth_scale = 10;
-		if (oldstore.distance_scale == 0)
-			oldstore.distance_scale = 10;
-
-		/* set scaled transducer_depth and altitude */
-		oldstore.transducer_depth = 1000 * store->sonardepth;
-		oldstore.altitude = 1000 * store->altitude;
-
-		/* get sidescan type */
-		oldstore.ss_type = store->ss_type;
-		}
-
-	/* otherwise write curent version data, which is version 4
-		if the number of beams and pixels is <= 32768 and version 5 if
-		it is greater than 32768 */
-	else if (store->kind == MB_DATA_DATA
-		&& store->beams_bath <= 32768
-		&& store->pixels_ss <= 32768)
-		{
-		*flag = MBF_MBLDEOIH_ID_DATA4;
-		header_length = MBF_MBLDEOIH_V4HEADERSIZE;
-		}
-	else if (store->kind == MB_DATA_DATA)
-		{
-		*flag = MBF_MBLDEOIH_ID_DATA5;
-		header_length = MBF_MBLDEOIH_V5HEADERSIZE;
-		}
-
-	/* otherwise write comment */
-	else
-		{
-		*flag = MBF_MBLDEOIH_ID_COMMENT2;
-		header_length = 2;
-		}
-#ifdef BYTESWAPPED
-	*flag = mb_swap_short(*flag);
-#endif
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  New header set in function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       flag:       %d\n",*flag);
-		}
-	if (verbose >= 5 && store->kind == MB_DATA_DATA)
-		{
-		fprintf(stderr,"\ndbg5  Current version header values in function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       time_d:           %f\n",store->time_d);
-		fprintf(stderr,"dbg5       longitude:        %f\n",store->longitude);
-		fprintf(stderr,"dbg5       latitude:         %f\n",store->latitude);
-		fprintf(stderr,"dbg5       sonardepth:       %f\n",store->sonardepth);
-		fprintf(stderr,"dbg5       altitude:         %f\n",store->altitude);
-		fprintf(stderr,"dbg5       heading:          %f\n",store->heading);
-		fprintf(stderr,"dbg5       speed:            %f\n",store->speed);
-		fprintf(stderr,"dbg5       roll:             %f\n",store->roll);
-		fprintf(stderr,"dbg5       pitch:            %f\n",store->pitch);
-		fprintf(stderr,"dbg5       heave:            %f\n",store->heave);
-		fprintf(stderr,"dbg5       beam_xwidth:      %f\n",store->beam_xwidth);
-		fprintf(stderr,"dbg5       beam_lwidth:      %f\n",store->beam_lwidth);
-		fprintf(stderr,"dbg5       beams_bath:       %d\n",store->beams_bath);
-		fprintf(stderr,"dbg5       beams_amp:        %d\n",store->beams_amp);
-		fprintf(stderr,"dbg5       pixels_ss:        %d\n",store->pixels_ss);
-		fprintf(stderr,"dbg5       spare1:           %d\n",store->spare1);
-		fprintf(stderr,"dbg5       depth_scale:      %f\n",store->depth_scale);
-		fprintf(stderr,"dbg5       distance_scale:   %f\n",store->distance_scale);
-		fprintf(stderr,"dbg5       ss_scalepower:    %d\n",store->ss_scalepower);
-		fprintf(stderr,"dbg5       ss_type:          %d\n",store->ss_type);
-		fprintf(stderr,"dbg5       spare3:           %d\n",store->imagery_type);
-		fprintf(stderr,"dbg5       sonartype:        %d\n",store->topo_type);
-		fprintf(stderr,"dbg5       status:           %d\n",status);
-		fprintf(stderr,"dbg5       error:            %d\n",*error);
-		}
-	if (verbose >= 5 && store->kind == MB_DATA_DATA && *version == 2)
-		{
-		fprintf(stderr,"\ndbg5  Old version header values in function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       year:             %d\n",oldstore.year);
-		fprintf(stderr,"dbg5       day:              %d\n",oldstore.day);
-		fprintf(stderr,"dbg5       minute:           %d\n",oldstore.min);
-		fprintf(stderr,"dbg5       second:           %d\n",oldstore.sec);
-		fprintf(stderr,"dbg5       msec:             %d\n",oldstore.msec);
-		fprintf(stderr,"dbg5       lonu:             %d\n",oldstore.lon2u);
-		fprintf(stderr,"dbg5       lonb:             %d\n",oldstore.lon2b);
-		fprintf(stderr,"dbg5       latu:             %d\n",oldstore.lat2u);
-		fprintf(stderr,"dbg5       latb:             %d\n",oldstore.lat2b);
-		fprintf(stderr,"dbg5       heading:          %d\n",oldstore.heading);
-		fprintf(stderr,"dbg5       speed:            %d\n",oldstore.speed);
-		fprintf(stderr,"dbg5       beams bath:       %d\n",oldstore.beams_bath);
-		fprintf(stderr,"dbg5       beams amp:        %d\n",oldstore.beams_amp);
-		fprintf(stderr,"dbg5       pixels ss:        %d\n",oldstore.pixels_ss);
-		fprintf(stderr,"dbg5       depth scale:      %d\n",oldstore.depth_scale);
-		fprintf(stderr,"dbg5       dist scale:       %d\n",oldstore.distance_scale);
-		fprintf(stderr,"dbg5       transducer_depth: %d\n",oldstore.transducer_depth);
-		fprintf(stderr,"dbg5       altitude:         %d\n",oldstore.altitude);
-		fprintf(stderr,"dbg5       beam_xwidth:      %d\n",oldstore.beam_xwidth);
-		fprintf(stderr,"dbg5       beam_lwidth:      %d\n",oldstore.beam_lwidth);
-		fprintf(stderr,"dbg5       ss_type:          %d\n",oldstore.ss_type);
-		fprintf(stderr,"dbg5       status:           %d\n",status);
-		fprintf(stderr,"dbg5       error:            %d\n",*error);
-		}
-
-	if (status == MB_SUCCESS && store->kind == MB_DATA_DATA)
-		{
-		/* if set, write old format - this should only happen for writing fbt files
-			when the user has set fbtversion = old in the .mbio_defaults file
-			using mbdefaults */
-		if (mb_io_ptr->save1 == 2)
-			{
-			/* recalculate depth scaling so that it encompasses full bathymetry values, not
-				just bathymetry relative to the sonar
-				- to convert to old format add transducer depth to the bathymetry
-				and reset the scaling */
-			depthscale = 0.001 * oldstore.depth_scale;
-			transducer_depth = 0.001 * oldstore.transducer_depth;
-			depthmax = 0.0;
-			for (i=0;i<oldstore.beams_bath;i++)
-				{
-				depthmax = MAX(depthmax, (depthscale * store->bath[i] + transducer_depth));
-				}
-			if (depthmax > 0.0)
-				oldstore.depth_scale = MAX((int) (1 + depthmax / 30.0), 1);
-			newdepthscale = 0.001 * oldstore.depth_scale;
-			for (i=0;i<oldstore.beams_bath;i++)
-				{
-				store->bath[i] = (short int)((store->depth_scale * store->bath[i] + transducer_depth) / newdepthscale);
-				}
-			short_transducer_depth = (short)(oldstore.transducer_depth / oldstore.depth_scale);
-			short_altitude = (short)(oldstore.altitude / oldstore.depth_scale);
-
-			/* write old version header */
-			index = 2;
-			mb_put_binary_short(MB_NO, oldstore.year, (void *)  &buffer[index]); index +=2;
-			mb_put_binary_short(MB_NO, oldstore.day, (void *)  &buffer[index]); index +=2;
-			mb_put_binary_short(MB_NO, oldstore.min, (void *)  &buffer[index]); index +=2;
-			mb_put_binary_short(MB_NO, oldstore.sec, (void *)  &buffer[index]); index +=2;
-			mb_put_binary_short(MB_NO, oldstore.msec, (void *)  &buffer[index]); index +=2;
-			mb_put_binary_short(MB_NO, oldstore.lon2u, (void *)  &buffer[index]); index +=2;
-			mb_put_binary_short(MB_NO, oldstore.lon2b, (void *)  &buffer[index]); index +=2;
-			mb_put_binary_short(MB_NO, oldstore.lat2u, (void *)  &buffer[index]); index +=2;
-			mb_put_binary_short(MB_NO, oldstore.lat2b, (void *)  &buffer[index]); index +=2;
-			mb_put_binary_short(MB_NO, oldstore.heading, (void *)  &buffer[index]); index +=2;
-			mb_put_binary_short(MB_NO, oldstore.speed, (void *)  &buffer[index]); index +=2;
-			mb_put_binary_short(MB_NO, oldstore.beams_bath, (void *)  &buffer[index]); index +=2;
-			mb_put_binary_short(MB_NO, oldstore.beams_amp, (void *)  &buffer[index]); index +=2;
-			mb_put_binary_short(MB_NO, oldstore.pixels_ss, (void *)  &buffer[index]); index +=2;
-			mb_put_binary_short(MB_NO, oldstore.depth_scale, (void *)  &buffer[index]); index +=2;
-			mb_put_binary_short(MB_NO, oldstore.distance_scale, (void *)  &buffer[index]); index +=2;
-			mb_put_binary_short(MB_NO, short_transducer_depth, (void *)  &buffer[index]); index +=2;
-			mb_put_binary_short(MB_NO, short_altitude, (void *)  &buffer[index]); index +=2;
-			mb_put_binary_short(MB_NO, oldstore.beam_xwidth, (void *)  &buffer[index]); index +=2;
-			mb_put_binary_short(MB_NO, oldstore.beam_lwidth, (void *)  &buffer[index]); index +=2;
-			mb_put_binary_short(MB_NO, oldstore.ss_type, (void *)  &buffer[index]); index +=2;
-			}
-
-		/* otherwise if reasonable number of beams then write version 4 record */
-		else if (header_length == MBF_MBLDEOIH_V4HEADERSIZE)
-			{
-			/* write current version header */
-			index = 2;
-			mb_put_binary_double(MB_NO, store->time_d, (void *)  &buffer[index]); index +=8;
-			mb_put_binary_double(MB_NO, store->longitude, (void *)  &buffer[index]); index +=8;
-			mb_put_binary_double(MB_NO, store->latitude, (void *)  &buffer[index]); index +=8;
-			mb_put_binary_double(MB_NO, store->sonardepth, (void *)  &buffer[index]); index +=8;
-			mb_put_binary_double(MB_NO, store->altitude, (void *)  &buffer[index]); index +=8;
-			mb_put_binary_float(MB_NO, store->heading, (void *)  &buffer[index]); index +=4;
-			mb_put_binary_float(MB_NO, store->speed, (void *)  &buffer[index]); index +=4;
-			mb_put_binary_float(MB_NO, store->roll, (void *)  &buffer[index]); index +=4;
-			mb_put_binary_float(MB_NO, store->pitch, (void *)  &buffer[index]); index +=4;
-			mb_put_binary_float(MB_NO, store->heave, (void *)  &buffer[index]); index +=4;
-			mb_put_binary_float(MB_NO, store->beam_xwidth, (void *)  &buffer[index]); index +=4;
-			mb_put_binary_float(MB_NO, store->beam_lwidth, (void *)  &buffer[index]); index +=4;
-			mb_put_binary_short(MB_NO, (short)store->beams_bath, (void *)  &buffer[index]); index +=2;
-			mb_put_binary_short(MB_NO, (short)store->beams_amp, (void *)  &buffer[index]); index +=2;
-			mb_put_binary_short(MB_NO, (short)store->pixels_ss, (void *)  &buffer[index]); index +=2;
-			mb_put_binary_short(MB_NO, (short)store->spare1, (void *)  &buffer[index]); index +=2;
-			mb_put_binary_float(MB_NO, store->depth_scale, (void *)  &buffer[index]); index +=4;
-			mb_put_binary_float(MB_NO, store->distance_scale, (void *)  &buffer[index]); index +=4;
-			buffer[index] = store->ss_scalepower; index++;
-			buffer[index] = store->ss_type; index++;
-			buffer[index] = store->imagery_type; index++;
-			buffer[index] = store->topo_type; index++;
-			}
-
-		/* otherwise if unreasonable number of beams then write version 5 record */
-		else
-			{
-			/* write current version header */
-			index = 2;
-			mb_put_binary_double(MB_NO, store->time_d, (void *)  &buffer[index]); index +=8;
-			mb_put_binary_double(MB_NO, store->longitude, (void *)  &buffer[index]); index +=8;
-			mb_put_binary_double(MB_NO, store->latitude, (void *)  &buffer[index]); index +=8;
-			mb_put_binary_double(MB_NO, store->sonardepth, (void *)  &buffer[index]); index +=8;
-			mb_put_binary_double(MB_NO, store->altitude, (void *)  &buffer[index]); index +=8;
-			mb_put_binary_float(MB_NO, store->heading, (void *)  &buffer[index]); index +=4;
-			mb_put_binary_float(MB_NO, store->speed, (void *)  &buffer[index]); index +=4;
-			mb_put_binary_float(MB_NO, store->roll, (void *)  &buffer[index]); index +=4;
-			mb_put_binary_float(MB_NO, store->pitch, (void *)  &buffer[index]); index +=4;
-			mb_put_binary_float(MB_NO, store->heave, (void *)  &buffer[index]); index +=4;
-			mb_put_binary_float(MB_NO, store->beam_xwidth, (void *)  &buffer[index]); index +=4;
-			mb_put_binary_float(MB_NO, store->beam_lwidth, (void *)  &buffer[index]); index +=4;
-			mb_put_binary_int(MB_NO, store->beams_bath, (void *)  &buffer[index]); index +=4;
-			mb_put_binary_int(MB_NO, store->beams_amp, (void *)  &buffer[index]); index +=4;
-			mb_put_binary_int(MB_NO, store->pixels_ss, (void *)  &buffer[index]); index +=4;
-			mb_put_binary_int(MB_NO, store->spare1, (void *)  &buffer[index]); index +=4;
-			mb_put_binary_float(MB_NO, store->depth_scale, (void *)  &buffer[index]); index +=4;
-			mb_put_binary_float(MB_NO, store->distance_scale, (void *)  &buffer[index]); index +=4;
-			buffer[index] = store->ss_scalepower; index++;
-			buffer[index] = store->ss_type; index++;
-			buffer[index] = store->imagery_type; index++;
-			buffer[index] = store->topo_type; index++;
-			}
-		}
-
-	/* write next header to file */
-	if ((status = fwrite(buffer,1,header_length,
-			mb_io_ptr->mbfp)) == header_length)
-		{
-		status = MB_SUCCESS;
-		*error = MB_ERROR_NO_ERROR;
-		}
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Going to write data in function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       kind:       %d\n",store->kind);
-		fprintf(stderr,"dbg5       status:     %d\n",status);
-		fprintf(stderr,"dbg5       error:      %d\n",*error);
-		}
-	if (verbose >= 5 && store->kind == MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"dbg5       comment:    %s\n",store->comment);
-		}
-	if (verbose >= 5 && store->kind == MB_DATA_DATA)
-		{
-		fprintf(stderr,"dbg5       beams_bath: %d\n",
-			store->beams_bath);
-		for (i=0;i<store->beams_bath;i++)
-		  fprintf(stderr,"dbg5       beam:%d  flag:%d  bath:%d  acrosstrack:%d  alongtrack:%d\n",
-			i,store->beamflag[i],store->bath[i],
-			store->bath_acrosstrack[i],store->bath_alongtrack[i]);
-		fprintf(stderr,"dbg5       beams_amp:  %d\n",
-			store->beams_amp);
-		for (i=0;i<store->beams_amp;i++)
-		  fprintf(stderr,"dbg5       beam:%d  flag:%d  amp:%d  acrosstrack:%d  alongtrack:%d\n",
-			i,store->beamflag[i],store->amp[i],
-			store->bath_acrosstrack[i],store->bath_alongtrack[i]);
-		fprintf(stderr,"dbg5       pixels_ss:  %d\n",
-			store->pixels_ss);
-		for (i=0;i<store->pixels_ss;i++)
-		  fprintf(stderr,"dbg5       pixel:%d  ss:%d acrosstrack:%d  alongtrack:%d\n",
-			i,store->ss[i],
-			store->ss_acrosstrack[i],store->ss_alongtrack[i]);
-		}
-
-	/* write next chunk of the data */
-	if (store->kind == MB_DATA_COMMENT)
-		{
-		write_size = 128;
-		if ((status = fwrite(store->comment,1,write_size,mb_io_ptr->mbfp))
-			== write_size)
-			{
-			status = MB_SUCCESS;
-			*error = MB_ERROR_NO_ERROR;
-			}
-		else
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_EOF;
-			}
-		}
-	else if (store->kind == MB_DATA_DATA)
-		{
-		/* byte swap the data if necessary */
-#ifdef BYTESWAPPED
-		for (i=0;i<store->beams_bath;i++)
-			{
-			store->bath[i] = mb_swap_short(store->bath[i]);
-			store->bath_acrosstrack[i]
-				= mb_swap_short(store->bath_acrosstrack[i]);
-			store->bath_alongtrack[i]
-				= mb_swap_short(store->bath_alongtrack[i]);
-			}
-		for (i=0;i<store->beams_amp;i++)
-			{
-			store->amp[i] = mb_swap_short(store->amp[i]);
-			}
-		for (i=0;i<store->pixels_ss;i++)
-			{
-			store->ss[i] = mb_swap_short(store->ss[i]);
-			store->ss_acrosstrack[i]
-				= mb_swap_short(store->ss_acrosstrack[i]);
-			store->ss_alongtrack[i]
-				= mb_swap_short(store->ss_alongtrack[i]);
-			}
-#endif
-
-		/* write bathymetry */
-		write_size = sizeof(char) * store->beams_bath;
-		status = fwrite(store->beamflag,1,write_size,mb_io_ptr->mbfp);
-		write_size = sizeof(short int) * store->beams_bath;
-		status = fwrite(store->bath,1,write_size,mb_io_ptr->mbfp);
-		status = fwrite(store->bath_acrosstrack,1,write_size,mb_io_ptr->mbfp);
-		status = fwrite(store->bath_alongtrack,1,write_size,mb_io_ptr->mbfp);
-
-		/* write amplitude */
-		write_size = sizeof(short int) * store->beams_amp;
-		status = fwrite(store->amp,1,write_size,mb_io_ptr->mbfp);
-
-		/* write sidescan */
-		write_size = sizeof(short int) * store->pixels_ss;
-		status = fwrite(store->ss,1,write_size,mb_io_ptr->mbfp);
-		status = fwrite(store->ss_acrosstrack,1,write_size,mb_io_ptr->mbfp);
-		status = fwrite(store->ss_alongtrack,1,write_size,mb_io_ptr->mbfp);
-
-		/* check for error */
-		if (status == write_size)
-			{
-			status = MB_SUCCESS;
-			*error = MB_ERROR_NO_ERROR;
-			}
-		else
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_EOF;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mbr_mbnetcdf.c b/src/mbio/mbr_mbnetcdf.c
deleted file mode 100644
index 8cb851b..0000000
--- a/src/mbio/mbr_mbnetcdf.c
+++ /dev/null
@@ -1,7189 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbr_mbnetcdf.c	1/25/02
- *	$Id: mbr_mbnetcdf.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 2002-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbr_mbnetcdf.c contains the functions for reading and writing
- * multibeam data in the MBF_MBNETCDF format.
- * These functions include:
- *   mbr_alm_mbnetcdf	- allocate read/write memory
- *   mbr_dem_mbnetcdf	- deallocate read/write memory
- *   mbr_rt_mbnetcdf	- read and translate data
- *   mbr_wt_mbnetcdf	- translate and write data
- *
- * Author:	D. W. Caress
- * Date:	January 25, 2002
- *
- * $Log: mbr_mbnetcdf.c,v $
- * Revision 5.9  2008/12/05 17:32:52  caress
- * Check-in mods 5 December 2008 including contributions from Gordon Keith.
- *
- * Revision 5.8  2008/07/10 06:43:40  caress
- * Preparing for 5.1.1beta20
- *
- * Revision 5.7  2008/05/16 22:56:24  caress
- * Release 5.1.1beta18.
- *
- * Revision 5.6  2008/03/01 09:14:03  caress
- * Some housekeeping changes.
- *
- * Revision 5.5  2005/11/05 00:48:05  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.4  2005/05/02 19:02:40  caress
- * The format 75 (MBF_MBNETCDF) i/o module has been altered to
- * handle multiple pings with the same time stamp without breaking
- * the beam edit (edit save file) scheme, which depends upon
- * unique time stamps. When multiple pings with the same time
- * stamp are encountered, the subsequent pings have multiples
- * of 2 msec added so that each has a detectably unique time
- * stamp. This issue relates to Thompson Seafalcon II multibeam
- * data; this sonar collects five simultaneous acrosstrack swathes.
- * Since this is a deep water sonar, the maximum 10 msec time
- * addition should not introduce excessive error in navigation
- * or other aspects of the data.
- *
- * Revision 5.3  2003/05/20 18:05:32  caress
- * Added svp_source to data source parameters.
- *
- * Revision 5.2  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.1  2002/05/29 23:38:53  caress
- * Release 5.0.beta18
- *
- * Revision 5.0  2002/05/02 04:00:03  caress
- * Release 5.0.beta17
- *
- * Revision 1.2  2002/05/02 03:55:34  caress
- * Release 5.0.beta17
- *
- * Revision 1.1  2002/02/22 09:03:43  caress
- * Initial revision
- *
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#include <string.h>
-#include <time.h>
-#include <netcdf.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mb_define.h"
-#include "mb_process.h"
-#include "mbsys_netcdf.h"
-
-/* essential function prototypes */
-int mbr_register_mbnetcdf(int verbose, void *mbio_ptr,
-		int *error);
-int mbr_info_mbnetcdf(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_info_mbncdfxt(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_alm_mbnetcdf(int verbose, void *mbio_ptr, int *error);
-int mbr_dem_mbnetcdf(int verbose, void *mbio_ptr, int *error);
-int mbr_rt_mbnetcdf(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_wt_mbnetcdf(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-
-#define MBNETCDF_DEBUG 1
-
-static char rcs_id[]="$Id: mbr_mbnetcdf.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mbr_register_mbnetcdf(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_register_mbnetcdf";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* get mb_io_ptr */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set format info parameters */
-	status = mbr_info_mbnetcdf(verbose,
-			&mb_io_ptr->system,
-			&mb_io_ptr->beams_bath_max,
-			&mb_io_ptr->beams_amp_max,
-			&mb_io_ptr->pixels_ss_max,
-			mb_io_ptr->format_name,
-			mb_io_ptr->system_name,
-			mb_io_ptr->format_description,
-			&mb_io_ptr->numfile,
-			&mb_io_ptr->filetype,
-			&mb_io_ptr->variable_beams,
-			&mb_io_ptr->traveltime,
-			&mb_io_ptr->beam_flagging,
-			&mb_io_ptr->nav_source,
-			&mb_io_ptr->heading_source,
-			&mb_io_ptr->vru_source,
-			&mb_io_ptr->svp_source,
-			&mb_io_ptr->beamwidth_xtrack,
-			&mb_io_ptr->beamwidth_ltrack,
-			error);
-
-	/* set format and system specific function pointers */
-	mb_io_ptr->mb_io_format_alloc = &mbr_alm_mbnetcdf;
-	mb_io_ptr->mb_io_format_free = &mbr_dem_mbnetcdf;
-	mb_io_ptr->mb_io_store_alloc = &mbsys_netcdf_alloc;
-	mb_io_ptr->mb_io_store_free = &mbsys_netcdf_deall;
-	mb_io_ptr->mb_io_read_ping = &mbr_rt_mbnetcdf;
-	mb_io_ptr->mb_io_write_ping = &mbr_wt_mbnetcdf;
-	mb_io_ptr->mb_io_dimensions = &mbsys_netcdf_dimensions;
-	mb_io_ptr->mb_io_extract = &mbsys_netcdf_extract;
-	mb_io_ptr->mb_io_insert = &mbsys_netcdf_insert;
-	mb_io_ptr->mb_io_extract_nav = &mbsys_netcdf_extract_nav;
-	mb_io_ptr->mb_io_insert_nav = &mbsys_netcdf_insert_nav;
-	mb_io_ptr->mb_io_extract_altitude = &mbsys_netcdf_extract_altitude;
-	mb_io_ptr->mb_io_insert_altitude = &mbsys_netcdf_insert_altitude;
-	mb_io_ptr->mb_io_extract_svp = NULL;
-	mb_io_ptr->mb_io_insert_svp = NULL;
-	mb_io_ptr->mb_io_ttimes = &mbsys_netcdf_ttimes;
-	mb_io_ptr->mb_io_detects = &mbsys_netcdf_detects;
-	mb_io_ptr->mb_io_copyrecord = &mbsys_netcdf_copy;
-	mb_io_ptr->mb_io_extract_rawss = NULL;
-	mb_io_ptr->mb_io_insert_rawss = NULL;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",mb_io_ptr->system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",mb_io_ptr->beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",mb_io_ptr->beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",mb_io_ptr->pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",mb_io_ptr->format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",mb_io_ptr->system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",mb_io_ptr->format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",mb_io_ptr->numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",mb_io_ptr->filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",mb_io_ptr->variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",mb_io_ptr->traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",mb_io_ptr->beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",mb_io_ptr->nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",mb_io_ptr->heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",mb_io_ptr->vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",mb_io_ptr->svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",mb_io_ptr->beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",mb_io_ptr->beamwidth_ltrack);
-		fprintf(stderr,"dbg2       format_alloc:       %p\n",(void *)mb_io_ptr->mb_io_format_alloc);
-		fprintf(stderr,"dbg2       format_free:        %p\n",(void *)mb_io_ptr->mb_io_format_free);
-		fprintf(stderr,"dbg2       store_alloc:        %p\n",(void *)mb_io_ptr->mb_io_store_alloc);
-		fprintf(stderr,"dbg2       store_free:         %p\n",(void *)mb_io_ptr->mb_io_store_free);
-		fprintf(stderr,"dbg2       read_ping:          %p\n",(void *)mb_io_ptr->mb_io_read_ping);
-		fprintf(stderr,"dbg2       write_ping:         %p\n",(void *)mb_io_ptr->mb_io_write_ping);
-		fprintf(stderr,"dbg2       extract:            %p\n",(void *)mb_io_ptr->mb_io_extract);
-		fprintf(stderr,"dbg2       insert:             %p\n",(void *)mb_io_ptr->mb_io_insert);
-		fprintf(stderr,"dbg2       extract_nav:        %p\n",(void *)mb_io_ptr->mb_io_extract_nav);
-		fprintf(stderr,"dbg2       insert_nav:         %p\n",(void *)mb_io_ptr->mb_io_insert_nav);
-		fprintf(stderr,"dbg2       extract_altitude:   %p\n",(void *)mb_io_ptr->mb_io_extract_altitude);
-		fprintf(stderr,"dbg2       insert_altitude:    %p\n",(void *)mb_io_ptr->mb_io_insert_altitude);
-		fprintf(stderr,"dbg2       extract_svp:        %p\n",(void *)mb_io_ptr->mb_io_extract_svp);
-		fprintf(stderr,"dbg2       insert_svp:         %p\n",(void *)mb_io_ptr->mb_io_insert_svp);
-		fprintf(stderr,"dbg2       ttimes:             %p\n",(void *)mb_io_ptr->mb_io_ttimes);
-		fprintf(stderr,"dbg2       detects:            %p\n",(void *)mb_io_ptr->mb_io_detects);
-		fprintf(stderr,"dbg2       extract_rawss:      %p\n",(void *)mb_io_ptr->mb_io_extract_rawss);
-		fprintf(stderr,"dbg2       insert_rawss:       %p\n",(void *)mb_io_ptr->mb_io_insert_rawss);
-		fprintf(stderr,"dbg2       copyrecord:         %p\n",(void *)mb_io_ptr->mb_io_copyrecord);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbr_info_mbnetcdf(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error)
-{
-	char	*function_name = "mbr_info_mbnetcdf";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* set format info parameters */
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-	*system = MB_SYS_NETCDF;
-	*beams_bath_max = 0;
-	*beams_amp_max = 0;
-	*pixels_ss_max = 0;
-	strncpy(format_name, "MBNETCDF", MB_NAME_LENGTH);
-	strncpy(system_name, "NETCDF", MB_NAME_LENGTH);
-	strncpy(format_description, "Format name:          MBF_MBNETCDF\nInformal Description: CARAIBES CDF multibeam\nAttributes:           Data from all sonar systems, bathymetry only, \n                      variable beams, netCDF, IFREMER.\n", MB_DESCRIPTION_LENGTH);
-	*numfile = 1;
-	*filetype = MB_FILETYPE_NETCDF;
-	*variable_beams = MB_YES;
-	*traveltime = MB_NO;
-	*beam_flagging = MB_YES;
-	*nav_source = MB_DATA_DATA;
-	*heading_source = MB_DATA_DATA;
-	*vru_source = MB_DATA_DATA;
-	*svp_source = MB_DATA_NONE;
-	*beamwidth_xtrack = 0.0;
-	*beamwidth_ltrack = 0.0;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",*system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",*beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",*beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",*pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",*numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",*filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",*variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",*traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",*beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",*nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",*heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",*vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",*svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",*beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",*beamwidth_ltrack);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbr_info_mbncdfxt(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error)
-{
-	char	*function_name = "mbr_info_mbnetcdf";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* set format info parameters */
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-	*system = MB_SYS_NETCDF;
-	*beams_bath_max = 256;
-	*beams_amp_max = 256;
-	*pixels_ss_max = 0;
-	strncpy(format_name, "MBNCDFXT", MB_NAME_LENGTH);
-	strncpy(system_name, "NETCDF", MB_NAME_LENGTH);
-	strncpy(format_description, "Format name:          MBF_MBNCDFXT\nInformal Description: CARAIBES CDF multibeam extended\nAttributes:           Superset of MBF_MBNETCDF, includes (at least SIMRAD EM12) amplitude, \n                      variable beams, netCDF, IFREMER.\n", MB_DESCRIPTION_LENGTH);
-	*numfile = 1;
-	*filetype = MB_FILETYPE_NETCDF;
-	*variable_beams = MB_YES;
-	*traveltime = MB_NO;
-	*beam_flagging = MB_YES;
-	*nav_source = MB_DATA_DATA;
-	*heading_source = MB_DATA_DATA;
-	*vru_source = MB_DATA_DATA;
-	*svp_source = MB_DATA_NONE;
-	*beamwidth_xtrack = 0.0;
-	*beamwidth_ltrack = 0.0;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",*system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",*beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",*beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",*pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",*numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",*filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",*variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",*traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",*beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",*nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",*heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",*vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",*svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",*beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",*beamwidth_ltrack);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_alm_mbnetcdf(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_alm_mbnetcdf";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	int	*dataread;
-	int	*commentread;
-	int	*recread;
-	double	*lastrawtime;
-	int	*nrawtimerepeat;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set initial status */
-	status = MB_SUCCESS;
-
-	/* allocate memory for data structure */
-	status = mbsys_netcdf_alloc(verbose,mbio_ptr,
-		&mb_io_ptr->store_data,error);
-
-	/* initialize values in structure */
-	dataread = (int *) &mb_io_ptr->save1;
-	commentread = (int *) &mb_io_ptr->save2;
-	recread = (int *) &mb_io_ptr->save4;
-	lastrawtime = (double *) &mb_io_ptr->saved1;
-	nrawtimerepeat = (int *) &mb_io_ptr->save5;
-	*dataread = MB_NO;
-	*commentread = 0;
-	*recread = 0;
-	*lastrawtime = 0.0;
-	*nrawtimerepeat = 0;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_dem_mbnetcdf(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_dem_mbnetcdf";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* deallocate memory for data descriptor */
-	status = mbsys_netcdf_deall(verbose,mbio_ptr,
-		&mb_io_ptr->store_data,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_rt_mbnetcdf(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_rt_mbnetcdf";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_netcdf_struct *store;
-	int	*dataread;
-	int	*commentread;
-	int	*recread;
-	int	recreadmax;
-	double	*lastrawtime;
-	int	*nrawtimerepeat;
-	double	time_d;
-	int	dim_id;
-	size_t	index[3], count[3];
-	int nc_status;
-	int	i;
-#ifdef MBNETCDF_DEBUG
-	int	nc_verbose = 1;
-#else
-	int	nc_verbose = 0;
-#endif
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor and data structure */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-	store = (struct mbsys_netcdf_struct *) store_ptr;
-	dataread = (int *) &mb_io_ptr->save1;
-	commentread = (int *) &mb_io_ptr->save2;
-	recread = (int *) &mb_io_ptr->save4;
-	lastrawtime = (double *) &mb_io_ptr->saved1;
-	nrawtimerepeat = (int *) &mb_io_ptr->save5;
-
-	/* set file position */
-	mb_io_ptr->file_pos = mb_io_ptr->file_bytes;
-
-	/* if first read then set everything up */
-	if (*dataread == MB_NO)
-	    {
-	    *dataread = MB_YES;
-
-	    /* get dimensions */
-	    nc_status = nc_inq_dimid(mb_io_ptr->ncid, "CIB_BLOCK_DIM", &dim_id);
-	    if (nc_status != NC_NOERR)
-	    	{
-	    	if (verbose >= 2 || nc_verbose >= 1) fprintf(stderr, "nc_inq_dimid CIB_BLOCK_DIM not found: %s\n", nc_strerror(nc_status));
-		}
-	    else
-	    	{
-	    	nc_status = nc_inq_dimlen(mb_io_ptr->ncid, dim_id, &store->CIB_BLOCK_DIM);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_inq_dimlen CIB_BLOCK_DIM error: %s\n", nc_strerror(nc_status));
-		}
-
-	    nc_status = nc_inq_dimid(mb_io_ptr->ncid, "mbHistoryRecNbr", &dim_id);
-	    if (nc_status != NC_NOERR)
-	    	{
-	    	if (verbose >= 2 || nc_verbose >= 1) fprintf(stderr, "nc_inq_dimid mbHistoryRecNbr error: %s\n", nc_strerror(nc_status));
-		}
-	    else
-	    	{
-	    	nc_status = nc_inq_dimlen(mb_io_ptr->ncid, dim_id, &store->mbHistoryRecNbr);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_inq_dimlen mbHistoryRecNbr error: %s\n", nc_strerror(nc_status));
-		}
-
-	    nc_status = nc_inq_dimid(mb_io_ptr->ncid, "mbNameLength", &dim_id);
-	    if (nc_status != NC_NOERR)
-	    	{
-	    	if (verbose >= 2 || nc_verbose >= 1) fprintf(stderr, "nc_inq_dimid mbNameLength error: %s\n", nc_strerror(nc_status));
-		}
-	    else
-	    	{
-	    	nc_status = nc_inq_dimlen(mb_io_ptr->ncid, dim_id, &store->mbNameLength);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_inq_dimlen mbNameLength error: %s\n", nc_strerror(nc_status));
-		}
-
-	    nc_status = nc_inq_dimid(mb_io_ptr->ncid, "mbCommentLength", &dim_id);
-	    if (nc_status != NC_NOERR)
-	    	{
-	    	if (verbose >= 2 || nc_verbose >= 1) fprintf(stderr, "nc_inq_dimid mbCommentLength error: %s\n", nc_strerror(nc_status));
-		}
-	    else
-	    	{
-	    	nc_status = nc_inq_dimlen(mb_io_ptr->ncid, dim_id, &store->mbCommentLength);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_inq_dimlen mbCommentLength error: %s\n", nc_strerror(nc_status));
-		}
-
-	    nc_status = nc_inq_dimid(mb_io_ptr->ncid, "mbAntennaNbr", &dim_id);
-	    if (nc_status != NC_NOERR)
-	    	{
-	    	if (verbose >= 2 || nc_verbose >= 1) fprintf(stderr, "nc_inq_dimid mbAntennaNbr error: %s\n", nc_strerror(nc_status));
-		}
-	    else
-	    	{
-	    	nc_status = nc_inq_dimlen(mb_io_ptr->ncid, dim_id, &store->mbAntennaNbr);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_inq_dimlen mbAntennaNbr error: %s\n", nc_strerror(nc_status));
-		}
-
-	    nc_status = nc_inq_dimid(mb_io_ptr->ncid, "mbBeamNbr", &dim_id);
-	    if (nc_status != NC_NOERR)
-	    	{
-	    	if (verbose >= 2 || nc_verbose >= 1) fprintf(stderr, "nc_inq_dimid mbBeamNbr error: %s\n", nc_strerror(nc_status));
-		}
-	    else
-	    	{
-	    	nc_status = nc_inq_dimlen(mb_io_ptr->ncid, dim_id, &store->mbBeamNbr);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_inq_dimlen mbBeamNbr error: %s\n", nc_strerror(nc_status));
-		}
-
-	    nc_status = nc_inq_dimid(mb_io_ptr->ncid, "mbCycleNbr", &dim_id);
-	    if (nc_status != NC_NOERR)
-	    	{
-	    	if (verbose >= 2 || nc_verbose >= 1) fprintf(stderr, "nc_inq_dimid mbCycleNbr error: %s\n", nc_strerror(nc_status));
-		}
-	    else
-	    	{
-	    	nc_status = nc_inq_dimlen(mb_io_ptr->ncid, dim_id, &store->mbCycleNbr);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_inq_dimlen mbCycleNbr error: %s\n", nc_strerror(nc_status));
-		}
-
-	    nc_status = nc_inq_dimid(mb_io_ptr->ncid, "mbVelocityProfilNbr", &dim_id);
-	    if (nc_status != NC_NOERR)
-	    	{
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_inq_dimid mbVelocityProfilNbr error: %s\n", nc_strerror(nc_status));
-		}
-	    else
-	    	{
-	    	nc_status = nc_inq_dimlen(mb_io_ptr->ncid, dim_id, &store->mbVelocityProfilNbr);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_inq_dimlen mbVelocityProfilNbr error: %s\n", nc_strerror(nc_status));
-		}
-	    if (nc_status != NC_NOERR)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	    /* print input debug statements */
-	    if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  NetCDF array dimensions read in function <%s>\n",function_name);
-		fprintf(stderr,"dbg2  Array and variable dimensions:\n");
-		fprintf(stderr,"dbg2       status:                  %d\n", status);
-		fprintf(stderr,"dbg2       error:                   %d\n", *error);
-		fprintf(stderr,"dbg2       nc_status:               %d\n", nc_status);
-		fprintf(stderr,"dbg2       CIB_BLOCK_DIM:           %zu\n", store->CIB_BLOCK_DIM);
-		fprintf(stderr,"dbg2       mbHistoryRecNbr:         %zu\n", store->mbHistoryRecNbr);
-		fprintf(stderr,"dbg2       mbNameLength:            %zu\n", store->mbNameLength);
-		fprintf(stderr,"dbg2       mbCommentLength:         %zu\n", store->mbCommentLength);
-		fprintf(stderr,"dbg2       mbAntennaNbr:            %zu\n", store->mbAntennaNbr);
-		fprintf(stderr,"dbg2       mbBeamNbr:               %zu\n", store->mbBeamNbr);
-		fprintf(stderr,"dbg2       mbCycleNbr:              %zu\n", store->mbCycleNbr);
-		fprintf(stderr,"dbg2       mbVelocityProfilNbr:     %zu\n", store->mbVelocityProfilNbr);
-		}
-
-	    /* get global attributes */
-	    if (status == MB_SUCCESS)
-		{
-		nc_status = nc_get_att_short(mb_io_ptr->ncid, NC_GLOBAL, "mbVersion", &store->mbVersion);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbVersion error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_get_att_text(mb_io_ptr->ncid, NC_GLOBAL, "mbName", store->mbName);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbName error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_get_att_text(mb_io_ptr->ncid, NC_GLOBAL, "mbClasse", store->mbClasse);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbClasse error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_get_att_short(mb_io_ptr->ncid, NC_GLOBAL, "mbLevel", &store->mbLevel);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbLevel error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_get_att_short(mb_io_ptr->ncid, NC_GLOBAL, "mbNbrHistoryRec", &store->mbNbrHistoryRec);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbNbrHistoryRec error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_get_att_text(mb_io_ptr->ncid, NC_GLOBAL, "mbTimeReference", store->mbTimeReference);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbTimeReference error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_get_att_int(mb_io_ptr->ncid, NC_GLOBAL, "mbStartDate", &store->mbStartDate);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbStartDate error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_get_att_int(mb_io_ptr->ncid, NC_GLOBAL, "mbStartTime", &store->mbStartTime);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbStartTime error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_get_att_int(mb_io_ptr->ncid, NC_GLOBAL, "mbEndDate", &store->mbEndDate);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbEndDate error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_get_att_int(mb_io_ptr->ncid, NC_GLOBAL, "mbEndTime", &store->mbEndTime);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbEndTime error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_get_att_double(mb_io_ptr->ncid, NC_GLOBAL, "mbNorthLatitude", &store->mbNorthLatitude);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbNorthLatitude error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_get_att_double(mb_io_ptr->ncid, NC_GLOBAL, "mbSouthLatitude", &store->mbSouthLatitude);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSouthLatitude error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_get_att_double(mb_io_ptr->ncid, NC_GLOBAL, "mbEastLongitude", &store->mbEastLongitude);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbEastLongitude error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_get_att_double(mb_io_ptr->ncid, NC_GLOBAL, "mbWestLongitude", &store->mbWestLongitude);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbWestLongitude error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_get_att_text(mb_io_ptr->ncid, NC_GLOBAL, "mbMeridian180", store->mbMeridian180);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbMeridian180 error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_get_att_text(mb_io_ptr->ncid, NC_GLOBAL, "mbGeoDictionnary", store->mbGeoDictionnary);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbGeoDictionnary error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_get_att_text(mb_io_ptr->ncid, NC_GLOBAL, "mbGeoRepresentation", store->mbGeoRepresentation);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbGeoRepresentation error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_get_att_text(mb_io_ptr->ncid, NC_GLOBAL, "mbGeodesicSystem", store->mbGeodesicSystem);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbGeodesicSystem error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_get_att_text(mb_io_ptr->ncid, NC_GLOBAL, "mbEllipsoidName", store->mbEllipsoidName);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbEllipsoidName error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_get_att_double(mb_io_ptr->ncid, NC_GLOBAL, "mbEllipsoidA", &store->mbEllipsoidA);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbEllipsoidA error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_get_att_double(mb_io_ptr->ncid, NC_GLOBAL, "mbEllipsoidInvF", &store->mbEllipsoidInvF);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbEllipsoidInvF error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_get_att_double(mb_io_ptr->ncid, NC_GLOBAL, "mbEllipsoidE2", &store->mbEllipsoidE2);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbEllipsoidE2 error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_get_att_short(mb_io_ptr->ncid, NC_GLOBAL, "mbProjType", &store->mbProjType);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbProjType error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_get_att_double(mb_io_ptr->ncid, NC_GLOBAL, "mbProjParameterValue", &store->mbProjParameterValue[0]);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbProjParameterValue error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_get_att_text(mb_io_ptr->ncid, NC_GLOBAL, "mbProjParameterCode", store->mbProjParameterCode);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbProjParameterCode error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_get_att_short(mb_io_ptr->ncid, NC_GLOBAL, "mbSounder", &store->mbSounder);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSounder error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_get_att_text(mb_io_ptr->ncid, NC_GLOBAL, "mbShip", store->mbShip);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbShip error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_get_att_text(mb_io_ptr->ncid, NC_GLOBAL, "mbSurvey", store->mbSurvey);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSurvey error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_get_att_text(mb_io_ptr->ncid, NC_GLOBAL, "mbReference", store->mbReference);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbReference error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_get_att_double(mb_io_ptr->ncid, NC_GLOBAL, "mbAntennaOffset", &store->mbAntennaOffset[0]);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAntennaOffset error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_get_att_double(mb_io_ptr->ncid, NC_GLOBAL, "mbAntennaDelay", &store->mbAntennaDelay);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAntennaDelay error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_get_att_double(mb_io_ptr->ncid, NC_GLOBAL, "mbSounderOffset", &store->mbSounderOffset[0]);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSounderOffset error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_get_att_double(mb_io_ptr->ncid, NC_GLOBAL, "mbSounderDelay", &store->mbSounderDelay);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSounderDelay error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_get_att_double(mb_io_ptr->ncid, NC_GLOBAL, "mbVRUOffset", &store->mbVRUOffset[0]);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbVRUOffset error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_get_att_double(mb_io_ptr->ncid, NC_GLOBAL, "mbVRUDelay", &store->mbVRUDelay);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbVRUDelay error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_get_att_double(mb_io_ptr->ncid, NC_GLOBAL, "mbHeadingBias", &store->mbHeadingBias);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHeadingBias error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_get_att_double(mb_io_ptr->ncid, NC_GLOBAL, "mbRollBias", &store->mbRollBias);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbRollBias error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_get_att_double(mb_io_ptr->ncid, NC_GLOBAL, "mbPitchBias", &store->mbPitchBias);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbPitchBias error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_get_att_double(mb_io_ptr->ncid, NC_GLOBAL, "mbHeaveBias", &store->mbHeaveBias);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHeaveBias error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_get_att_double(mb_io_ptr->ncid, NC_GLOBAL, "mbDraught", &store->mbDraught);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbDraught error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_get_att_short(mb_io_ptr->ncid, NC_GLOBAL, "mbNavType", &store->mbNavType);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbNavType error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_get_att_text(mb_io_ptr->ncid, NC_GLOBAL, "mbNavRef", store->mbNavRef);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbNavRef error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_get_att_short(mb_io_ptr->ncid, NC_GLOBAL, "mbTideType", &store->mbTideType);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbTideType error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_get_att_text(mb_io_ptr->ncid, NC_GLOBAL, "mbTideRef", store->mbTideRef);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbTideRef error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_get_att_double(mb_io_ptr->ncid, NC_GLOBAL, "mbMinDepth", &store->mbMinDepth);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbMinDepth error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_get_att_double(mb_io_ptr->ncid, NC_GLOBAL, "mbMaxDepth", &store->mbMaxDepth);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbMaxDepth error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_get_att_int(mb_io_ptr->ncid, NC_GLOBAL, "mbCycleCounter", &store->mbCycleCounter);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbCycleCounter error: %s\n", nc_strerror(nc_status));
-		if (nc_status != NC_NOERR)
-		    {
-		    status = MB_FAILURE;
-		    *error = MB_ERROR_EOF;
-		    }
-
-		/* print input debug statements */
-		if (verbose >= 2)
-		    {
-		    fprintf(stderr,"\ndbg2  NetCDF global attributes read in function <%s>\n",function_name);
-		    fprintf(stderr,"dbg2  Global attributes:\n");
-		    fprintf(stderr,"dbg2       status:                  %d\n", status);
-		    fprintf(stderr,"dbg2       error:                   %d\n", *error);
-		    fprintf(stderr,"dbg2       nc_status:             %d\n", nc_status);
-		    fprintf(stderr,"dbg2       mbVersion:             %d\n", store->mbVersion);
-		    fprintf(stderr,"dbg2       mbName:                %s\n", store->mbName);
-		    fprintf(stderr,"dbg2       mbClasse:              %s\n", store->mbClasse);
-		    fprintf(stderr,"dbg2       mbLevel:               %d\n", store->mbLevel);
-		    fprintf(stderr,"dbg2       mbNbrHistoryRec:       %d\n", store->mbNbrHistoryRec);
-		    fprintf(stderr,"dbg2       mbTimeReference:       %s\n", store->mbTimeReference);
-		    fprintf(stderr,"dbg2       mbStartDate:           %d\n", store->mbStartDate);
-		    fprintf(stderr,"dbg2       mbStartTime:           %d\n", store->mbStartTime);
-		    fprintf(stderr,"dbg2       mbEndDate:             %d\n", store->mbEndDate);
-		    fprintf(stderr,"dbg2       mbEndTime:             %d\n", store->mbEndTime);
-		    fprintf(stderr,"dbg2       mbNorthLatitude:       %f\n", store->mbNorthLatitude);
-		    fprintf(stderr,"dbg2       mbSouthLatitude:       %f\n", store->mbSouthLatitude);
-		    fprintf(stderr,"dbg2       mbEastLongitude:       %f\n", store->mbEastLongitude);
-		    fprintf(stderr,"dbg2       mbWestLongitude:       %f\n", store->mbWestLongitude);
-		    fprintf(stderr,"dbg2       mbMeridian180:         %s\n", store->mbMeridian180);
-		    fprintf(stderr,"dbg2       mbGeoDictionnary:      %s\n", store->mbGeoDictionnary);
-		    fprintf(stderr,"dbg2       mbGeoRepresentation:   %s\n", store->mbGeoRepresentation);
-		    fprintf(stderr,"dbg2       mbGeodesicSystem:      %s\n", store->mbGeodesicSystem);
-		    fprintf(stderr,"dbg2       mbEllipsoidName:       %s\n", store->mbEllipsoidName);
-		    fprintf(stderr,"dbg2       mbEllipsoidA:          %f\n", store->mbEllipsoidA);
-		    fprintf(stderr,"dbg2       mbEllipsoidInvF:       %f\n", store->mbEllipsoidInvF);
-		    fprintf(stderr,"dbg2       mbEllipsoidE2:         %f\n", store->mbEllipsoidE2);
-		    fprintf(stderr,"dbg2       mbProjType:            %d\n", store->mbProjType);
-		    for (i=0;i<10;i++)
-			fprintf(stderr,"dbg2       mbProjParameterValue[%d]:%f\n", i, store->mbProjParameterValue[i]);
-		    fprintf(stderr,"dbg2       mbProjParameterCode:   %s\n", store->mbProjParameterCode);
-		    fprintf(stderr,"dbg2       mbSounder:             %d\n", store->mbSounder);
-		    fprintf(stderr,"dbg2       mbShip:                %s\n", store->mbShip);
-		    fprintf(stderr,"dbg2       mbSurvey:              %s\n", store->mbSurvey);
-		    fprintf(stderr,"dbg2       mbReference:           %s\n", store->mbReference);
-		    for (i=0;i<3;i++)
-			fprintf(stderr,"dbg2       mbAntennaOffset[%d]:    %f\n", i, store->mbAntennaOffset[i]);
-		    fprintf(stderr,"dbg2       mbAntennaDelay:        %f\n", store->mbAntennaDelay);
-		    for (i=0;i<3;i++)
-			fprintf(stderr,"dbg2       mbSounderOffset[%d]:    %f\n", i, store->mbSounderOffset[i]);
-		    fprintf(stderr,"dbg2       mbSounderDelay:        %f\n", store->mbSounderDelay);
-		    for (i=0;i<3;i++)
-			fprintf(stderr,"dbg2       mbVRUOffset[%d]:        %f\n", i, store->mbVRUOffset[i]);
-		    fprintf(stderr,"dbg2       mbVRUDelay:            %f\n", store->mbVRUDelay);
-		    fprintf(stderr,"dbg2       mbHeadingBias:         %f\n", store->mbHeadingBias);
-		    fprintf(stderr,"dbg2       mbRollBias:            %f\n", store->mbRollBias);
-		    fprintf(stderr,"dbg2       mbPitchBias:           %f\n", store->mbPitchBias);
-		    fprintf(stderr,"dbg2       mbHeaveBias:           %f\n", store->mbHeaveBias);
-		    fprintf(stderr,"dbg2       mbDraught:             %f\n", store->mbDraught);
-		    fprintf(stderr,"dbg2       mbNavType:             %d\n", store->mbNavType);
-		    fprintf(stderr,"dbg2       mbNavRef:              %s\n", store->mbNavRef);
-		    fprintf(stderr,"dbg2       mbTideType:            %d\n", store->mbTideType);
-		    fprintf(stderr,"dbg2       mbTideRef:             %s\n", store->mbTideRef);
-		    fprintf(stderr,"dbg2       mbMinDepth:            %f\n", store->mbMinDepth);
-		    fprintf(stderr,"dbg2       mbMaxDepth:            %f\n", store->mbMaxDepth);
-		    fprintf(stderr,"dbg2       mbCycleCounter:        %d\n", store->mbCycleCounter);
-		    }
-		}
-
-	    /* get variable IDs */
-	    if (status == MB_SUCCESS)
-		{
-		nc_status = nc_inq_varid(mb_io_ptr->ncid, "mbHistDate", &store->mbHistDate_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_inq_varid mbHistDate_id error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_inq_varid(mb_io_ptr->ncid, "mbHistTime", &store->mbHistTime_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_inq_varid mbHistTime_id error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_inq_varid(mb_io_ptr->ncid, "mbHistCode", &store->mbHistCode_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_inq_varid mbHistCode_id error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_inq_varid(mb_io_ptr->ncid, "mbHistAutor", &store->mbHistAutor_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_inq_varid mbHistAutor_id error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_inq_varid(mb_io_ptr->ncid, "mbHistModule", &store->mbHistModule_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_inq_varid mbHistModule_id error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_inq_varid(mb_io_ptr->ncid, "mbHistComment", &store->mbHistComment_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_inq_varid mbHistComment_id error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_inq_varid(mb_io_ptr->ncid, "mbCycle", &store->mbCycle_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_inq_varid mbCycle_id error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_inq_varid(mb_io_ptr->ncid, "mbDate", &store->mbDate_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_inq_varid mbDate_id error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_inq_varid(mb_io_ptr->ncid, "mbTime", &store->mbTime_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_inq_varid mbTime_id error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_inq_varid(mb_io_ptr->ncid, "mbOrdinate", &store->mbOrdinate_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_inq_varid mbOrdinate_id error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_inq_varid(mb_io_ptr->ncid, "mbAbscissa", &store->mbAbscissa_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_inq_varid mbAbscissa_id error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_inq_varid(mb_io_ptr->ncid, "mbFrequency", &store->mbFrequency_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_inq_varid mbFrequency_id error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_inq_varid(mb_io_ptr->ncid, "mbSonarFrequency", &store->mbSonarFrequency_id);
-	    	if ((verbose >= 2 || nc_verbose >= 2) && nc_status != NC_NOERR) fprintf(stderr, "nc_inq_varid mbSonarFrequency_id not found: %s\n", nc_strerror(nc_status));
-		nc_status = nc_inq_varid(mb_io_ptr->ncid, "mbSounderMode", &store->mbSounderMode_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_inq_varid mbSounderMode_id error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_inq_varid(mb_io_ptr->ncid, "mbReferenceDepth", &store->mbReferenceDepth_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_inq_varid mbReferenceDepth_id error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_inq_varid(mb_io_ptr->ncid, "mbDynamicDraught", &store->mbDynamicDraught_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_inq_varid mbDynamicDraught_id error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_inq_varid(mb_io_ptr->ncid, "mbTide", &store->mbTide_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_inq_varid mbTide_id error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_inq_varid(mb_io_ptr->ncid, "mbSoundVelocity", &store->mbSoundVelocity_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_inq_varid mbSoundVelocity_id error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_inq_varid(mb_io_ptr->ncid, "mbHeading", &store->mbHeading_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_inq_varid mbHeading_id error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_inq_varid(mb_io_ptr->ncid, "mbRoll", &store->mbRoll_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_inq_varid mbRoll_id error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_inq_varid(mb_io_ptr->ncid, "mbPitch", &store->mbPitch_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_inq_varid mbPitch_id error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_inq_varid(mb_io_ptr->ncid, "mbTransmissionHeave", &store->mbTransmissionHeave_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_inq_varid mbTransmissionHeave_id error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_inq_varid(mb_io_ptr->ncid, "mbDistanceScale", &store->mbDistanceScale_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_inq_varid mbDistanceScale_id error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_inq_varid(mb_io_ptr->ncid, "mbRangeScale", &store->mbRangeScale_id);
-	    	if ((verbose >= 2 || nc_verbose >= 2) && nc_status != NC_NOERR) fprintf(stderr, "nc_inq_varid mbRangeScale_id not found: %s\n", nc_strerror(nc_status));
-		nc_status = nc_inq_varid(mb_io_ptr->ncid, "mbDepthScale", &store->mbDepthScale_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_inq_varid mbDepthScale_id error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_inq_varid(mb_io_ptr->ncid, "mbVerticalDepth", &store->mbVerticalDepth_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_inq_varid mbVerticalDepth_id error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_inq_varid(mb_io_ptr->ncid, "mbCQuality", &store->mbCQuality_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_inq_varid mbCQuality_id error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_inq_varid(mb_io_ptr->ncid, "mbCFlag", &store->mbCFlag_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_inq_varid mbCQuality_id error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_inq_varid(mb_io_ptr->ncid, "mbInterlacing", &store->mbInterlacing_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_inq_varid mbInterlacing_id error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_inq_varid(mb_io_ptr->ncid, "mbSamplingRate", &store->mbSamplingRate_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_inq_varid mbSamplingRate_id error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_inq_varid(mb_io_ptr->ncid, "mbCompensationLayerMode", &store->mbCompensationLayerMode_id);
-	    	if ((verbose >= 2 || nc_verbose >= 2) && nc_status != NC_NOERR) fprintf(stderr, "nc_inq_varid mbCompensationLayerMode_id not found: %s\n", nc_strerror(nc_status));
-		nc_status = nc_inq_varid(mb_io_ptr->ncid, "mbTransmitBeamwidth", &store->mbTransmitBeamwidth_id);
-	    	if ((verbose >= 2 || nc_verbose >= 2) && nc_status != NC_NOERR) fprintf(stderr, "nc_inq_varid mbTransmitBeamwidth_id not found: %s\n", nc_strerror(nc_status));
-		nc_status = nc_inq_varid(mb_io_ptr->ncid, "mbReceiveBeamwidth", &store->mbReceiveBeamwidth_id);
-	    	if ((verbose >= 2 || nc_verbose >= 2) && nc_status != NC_NOERR) fprintf(stderr, "nc_inq_varid mbReceiveBeamwidth_id not found: %s\n", nc_strerror(nc_status));
-		nc_status = nc_inq_varid(mb_io_ptr->ncid, "mbTransmitPulseLength", &store->mbTransmitPulseLength_id);
-	    	if ((verbose >= 2 || nc_verbose >= 2) && nc_status != NC_NOERR) fprintf(stderr, "nc_inq_varid mbTransmitPulseLength_id not found: %s\n", nc_strerror(nc_status));
-		nc_status = nc_inq_varid(mb_io_ptr->ncid, "mbAlongDistance", &store->mbAlongDistance_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_inq_varid mbAlongDistance_id error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_inq_varid(mb_io_ptr->ncid, "mbAcrossDistance", &store->mbAcrossDistance_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_inq_varid mbAcrossDistance_id error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_inq_varid(mb_io_ptr->ncid, "mbDepth", &store->mbDepth_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_inq_varid mbDepth_id error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_inq_varid(mb_io_ptr->ncid, "mbAcrossBeamAngle", &store->mbAcrossBeamAngle_id);
-	    	if ((verbose >= 2 || nc_verbose >= 2) && nc_status != NC_NOERR) fprintf(stderr, "nc_inq_varid mbAcrossBeamAngle_id not found: %s\n", nc_strerror(nc_status));
-		nc_status = nc_inq_varid(mb_io_ptr->ncid, "mbAzimutBeamAngle", &store->mbAzimutBeamAngle_id);
-	    	if ((verbose >= 2 || nc_verbose >= 2) && nc_status != NC_NOERR) fprintf(stderr, "nc_inq_varid mbAzimutBeamAngle not found: %s\n", nc_strerror(nc_status));
-		nc_status = nc_inq_varid(mb_io_ptr->ncid, "mbRange", &store->mbRange_id);
-	    	if ((verbose >= 2 || nc_verbose >= 2) && nc_status != NC_NOERR) fprintf(stderr, "nc_inq_varid mbRange_id not found: %s\n", nc_strerror(nc_status));
-		nc_status = nc_inq_varid(mb_io_ptr->ncid, "mbSoundingBias", &store->mbSoundingBias_id);
-	    	if ((verbose >= 2 || nc_verbose >= 2) && nc_status != NC_NOERR) fprintf(stderr, "nc_inq_varid mbSoundingBias_id not found: %s\n", nc_strerror(nc_status));
-		nc_status = nc_inq_varid(mb_io_ptr->ncid, "mbSQuality", &store->mbSQuality_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_inq_varid mbSQuality_id error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_inq_varid(mb_io_ptr->ncid, "mbReflectivity", &store->mbReflectivity_id);
-	    	if ((verbose >= 2 || nc_verbose >= 2) && nc_status != NC_NOERR) fprintf(stderr, "nc_inq_varid mbReflectivity_id not found: %s\n", nc_strerror(nc_status));
-		nc_status = nc_inq_varid(mb_io_ptr->ncid, "mbReceptionHeave", &store->mbReceptionHeave_id);
-	    	if ((verbose >= 2 || nc_verbose >= 2) && nc_status != NC_NOERR) fprintf(stderr, "nc_inq_varid mbReceptionHeave_id not found: %s\n", nc_strerror(nc_status));
-		nc_status = nc_inq_varid(mb_io_ptr->ncid, "mbAlongSlope", &store->mbAlongSlope_id);
-	    	if ((verbose >= 2 || nc_verbose >= 2) && nc_status != NC_NOERR) fprintf(stderr, "nc_inq_varid mbAlongSlope_id not found: %s\n", nc_strerror(nc_status));
-		nc_status = nc_inq_varid(mb_io_ptr->ncid, "mbAcrossSlope", &store->mbAcrossSlope_id);
-	    	if ((verbose >= 2 || nc_verbose >= 2) && nc_status != NC_NOERR) fprintf(stderr, "nc_inq_varid mbAcrossSlope_id not found: %s\n", nc_strerror(nc_status));
-		nc_status = nc_inq_varid(mb_io_ptr->ncid, "mbSFlag", &store->mbSFlag_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_inq_varid mbSFlag_id error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_inq_varid(mb_io_ptr->ncid, "mbSLengthOfDetection", &store->mbSLengthOfDetection_id);
-	    	if ((verbose >= 2 || nc_verbose >= 2) && nc_status != NC_NOERR) fprintf(stderr, "nc_inq_varid mbSLengthOfDetection_id not found: %s\n", nc_strerror(nc_status));
-		nc_status = nc_inq_varid(mb_io_ptr->ncid, "mbAntenna", &store->mbAntenna_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_inq_varid mbAntenna_id error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_inq_varid(mb_io_ptr->ncid, "mbBeamBias", &store->mbBeamBias_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_inq_varid mbBeamBias_id not found: %s\n", nc_strerror(nc_status));
-		nc_status = nc_inq_varid(mb_io_ptr->ncid, "mbBFlag", &store->mbBFlag_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_inq_varid mbBFlag_id error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_inq_varid(mb_io_ptr->ncid, "mbBeam", &store->mbBeam_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_inq_varid mbBeam_id error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_inq_varid(mb_io_ptr->ncid, "mbAFlag", &store->mbAFlag_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_inq_varid mbAFlag_id error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_inq_varid(mb_io_ptr->ncid, "mbVelProfilRef", &store->mbVelProfilRef_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_inq_varid mbVelProfilRef_id error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_inq_varid(mb_io_ptr->ncid, "mbVelProfilIdx", &store->mbVelProfilIdx_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_inq_varid mbVelProfilIdx_id error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_inq_varid(mb_io_ptr->ncid, "mbVelProfilDate", &store->mbVelProfilDate_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_inq_varid mbVelProfilDate_id error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_inq_varid(mb_io_ptr->ncid, "mbVelProfilTime", &store->mbVelProfilTime_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_inq_varid mbVelProfilTime_id error: %s\n", nc_strerror(nc_status));
-		if (nc_status != NC_NOERR)
-		    {
-		    status = MB_FAILURE;
-		    *error = MB_ERROR_EOF;
-		    }
-
-		/* print input debug statements */
-		if (verbose >= 2)
-		    {
-		    fprintf(stderr,"\ndbg2  NetCDF variable ids read in function <%s>\n",function_name);
-		    fprintf(stderr,"dbg2  Variable ids:\n");
-		    fprintf(stderr,"dbg2       status:                  %d\n", status);
-		    fprintf(stderr,"dbg2       error:                   %d\n", *error);
-		    fprintf(stderr,"dbg2       nc_status:               %d\n", nc_status);
-		    fprintf(stderr,"dbg2       mbHistDate_id:           %d\n", store->mbHistDate_id);
-		    fprintf(stderr,"dbg2       mbHistTime_id:           %d\n", store->mbHistTime_id);
-		    fprintf(stderr,"dbg2       mbHistCode_id:           %d\n", store->mbHistCode_id);
-		    fprintf(stderr,"dbg2       mbHistAutor_id:          %d\n", store->mbHistAutor_id);
-		    fprintf(stderr,"dbg2       mbHistModule_id:         %d\n", store->mbHistModule_id);
-		    fprintf(stderr,"dbg2       mbHistComment_id:        %d\n", store->mbHistComment_id);
-		    fprintf(stderr,"dbg2       mbCycle_id:              %d\n", store->mbCycle_id);
-		    fprintf(stderr,"dbg2       mbDate_id:               %d\n", store->mbDate_id);
-		    fprintf(stderr,"dbg2       mbTime_id:               %d\n", store->mbTime_id);
-		    fprintf(stderr,"dbg2       mbOrdinate_id:           %d\n", store->mbOrdinate_id);
-		    fprintf(stderr,"dbg2       mbAbscissa_id:           %d\n", store->mbAbscissa_id);
-		    fprintf(stderr,"dbg2       mbFrequency_id:          %d\n", store->mbFrequency_id);
-		    fprintf(stderr,"dbg2       mbSounderMode_id:        %d\n", store->mbSounderMode_id);
-		    fprintf(stderr,"dbg2       mbReferenceDepth_id:     %d\n", store->mbReferenceDepth_id);
-		    fprintf(stderr,"dbg2       mbDynamicDraught_id:     %d\n", store->mbDynamicDraught_id);
-		    fprintf(stderr,"dbg2       mbTide_id:               %d\n", store->mbTide_id);
-		    fprintf(stderr,"dbg2       mbSoundVelocity_id:      %d\n", store->mbSoundVelocity_id);
-		    fprintf(stderr,"dbg2       mbHeading_id:            %d\n", store->mbHeading_id);
-		    fprintf(stderr,"dbg2       mbRoll_id:               %d\n", store->mbRoll_id);
-		    fprintf(stderr,"dbg2       mbPitch_id:              %d\n", store->mbPitch_id);
-		    fprintf(stderr,"dbg2       mbTransmissionHeave_id:  %d\n", store->mbTransmissionHeave_id);
-		    fprintf(stderr,"dbg2       mbDistanceScale_id:      %d\n", store->mbDistanceScale_id);
-		    fprintf(stderr,"dbg2       mbDepthScale_id:         %d\n", store->mbDepthScale_id);
-		    fprintf(stderr,"dbg2       mbVerticalDepth_id:      %d\n", store->mbVerticalDepth_id);
-		    fprintf(stderr,"dbg2       mbCQuality_id:           %d\n", store->mbCQuality_id);
-		    fprintf(stderr,"dbg2       mbCFlag_id:              %d\n", store->mbCFlag_id);
-		    fprintf(stderr,"dbg2       mbInterlacing_id:        %d\n", store->mbInterlacing_id);
-		    fprintf(stderr,"dbg2       mbSamplingRate_id:       %d\n", store->mbSamplingRate_id);
-		    fprintf(stderr,"dbg2       mbAlongDistance_id:      %d\n", store->mbAlongDistance_id);
-		    fprintf(stderr,"dbg2       mbAcrossDistance_id:     %d\n", store->mbAcrossDistance_id);
-		    fprintf(stderr,"dbg2       mbDepth_id:              %d\n", store->mbDepth_id);
-		    fprintf(stderr,"dbg2       mbSQuality_id:           %d\n", store->mbSQuality_id);
-		    fprintf(stderr,"dbg2       mbSFlag_id:              %d\n", store->mbSFlag_id);
-		    fprintf(stderr,"dbg2       mbAntenna_id:            %d\n", store->mbAntenna_id);
-		    fprintf(stderr,"dbg2       mbBeamBias_id:           %d\n", store->mbBeamBias_id);
-		    fprintf(stderr,"dbg2       mbBFlag_id:              %d\n", store->mbBFlag_id);
-		    fprintf(stderr,"dbg2       mbBeam_id:               %d\n", store->mbBeam_id);
-		    fprintf(stderr,"dbg2       mbAFlag_id:              %d\n", store->mbAFlag_id);
-		    fprintf(stderr,"dbg2       mbVelProfilRef_id:       %d\n", store->mbVelProfilRef_id);
-		    fprintf(stderr,"dbg2       mbVelProfilIdx_id:       %d\n", store->mbVelProfilIdx_id);
-		    fprintf(stderr,"dbg2       mbVelProfilDate_id:      %d\n", store->mbVelProfilDate_id);
-		    fprintf(stderr,"dbg2       mbVelProfilTime_id:      %d\n", store->mbVelProfilTime_id);
-		    }
-		}
-
-	    /* allocate memory for variables */
-	    if (status == MB_SUCCESS)
-		{
-		status = mb_mallocd(verbose,__FILE__,__LINE__,
-			    store->mbHistoryRecNbr * sizeof(int),
-			    (void **)&store->mbHistDate,error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,
-			    store->mbHistoryRecNbr * sizeof(int),
-			    (void **)&store->mbHistTime,error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,
-			    store->mbHistoryRecNbr * sizeof(char),
-			    (void **)&store->mbHistCode,error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,
-			    store->mbHistoryRecNbr * store->mbNameLength * sizeof(char),
-			    (void **)&store->mbHistAutor,error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,
-			    store->mbHistoryRecNbr * store->mbNameLength * sizeof(char),
-			    (void **)&store->mbHistModule,error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,
-			    store->mbHistoryRecNbr * store->mbCommentLength * sizeof(char),
-			    (void **)&store->mbHistComment,error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,
-			    store->mbAntennaNbr * sizeof(int),
-			    (void **)&store->mbCycle,error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,
-			    store->mbAntennaNbr * sizeof(int),
-			    (void **)&store->mbDate,error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,
-			    store->mbAntennaNbr * sizeof(int),
-			    (void **)&store->mbTime,error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,
-			    store->mbAntennaNbr * sizeof(int),
-			    (void **)&store->mbOrdinate,error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,
-			    store->mbAntennaNbr * sizeof(int),
-			    (void **)&store->mbAbscissa,error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,
-			    store->mbAntennaNbr * sizeof(char),
-			    (void **)&store->mbFrequency,error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,
-			    store->mbAntennaNbr * sizeof(int),
-			    (void **)&store->mbSonarFrequency,error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,
-			    store->mbAntennaNbr * sizeof(char),
-			    (void **)&store->mbSounderMode,error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,
-			    store->mbAntennaNbr * sizeof(int),
-			    (void **)&store->mbReferenceDepth,error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,
-			    store->mbAntennaNbr * sizeof(short),
-			    (void **)&store->mbDynamicDraught,error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,
-			    store->mbAntennaNbr * sizeof(short),
-			    (void **)&store->mbTide,error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,
-			    store->mbAntennaNbr * sizeof(short),
-			    (void **)&store->mbSoundVelocity,error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,
-			    store->mbAntennaNbr * sizeof(short),
-			    (void **)&store->mbHeading,error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,
-			    store->mbAntennaNbr * sizeof(short),
-			    (void **)&store->mbRoll,error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,
-			    store->mbAntennaNbr * sizeof(short),
-			    (void **)&store->mbPitch,error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,
-			    store->mbAntennaNbr * sizeof(short),
-			    (void **)&store->mbTransmissionHeave,error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,
-			    store->mbAntennaNbr * sizeof(char),
-			    (void **)&store->mbDistanceScale,error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,
-			    store->mbAntennaNbr * sizeof(short),
-			    (void **)&store->mbRangeScale,error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,
-			    store->mbAntennaNbr * sizeof(char),
-			    (void **)&store->mbDepthScale,error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,
-			    store->mbAntennaNbr * sizeof(int),
-			    (void **)&store->mbVerticalDepth,error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,
-			    store->mbAntennaNbr * sizeof(char),
-			    (void **)&store->mbCQuality,error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,
-			    store->mbAntennaNbr * sizeof(char),
-			    (void **)&store->mbCFlag,error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,
-			    store->mbAntennaNbr * sizeof(char),
-			    (void **)&store->mbInterlacing,error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,
-			    store->mbAntennaNbr * sizeof(short),
-			    (void **)&store->mbSamplingRate,error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,
-			    store->mbAntennaNbr * sizeof(char),
-			    (void **)&store->mbCompensationLayerMode,error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,
-			    store->mbAntennaNbr * sizeof(short),
-			    (void **)&store->mbTransmitBeamwidth,error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,
-			    store->mbAntennaNbr * sizeof(char),
-			    (void **)&store->mbReceiveBeamwidth,error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,
-			    store->mbAntennaNbr * sizeof(short),
-			    (void **)&store->mbTransmitPulseLength,error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,
-			    store->mbBeamNbr * sizeof(short),
-			    (void **)&store->mbAlongDistance,error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,
-			    store->mbBeamNbr * sizeof(short),
-			    (void **)&store->mbAcrossDistance,error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,
-			    store->mbBeamNbr * sizeof(int),
-			    (void **)&store->mbDepth,error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,
-			    store->mbBeamNbr * sizeof(short),
-			    (void **)&store->mbAcrossBeamAngle,error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,
-			    store->mbBeamNbr * sizeof(short),
-			    (void **)&store->mbAzimutBeamAngle,error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,
-			    store->mbBeamNbr * sizeof(short),
-			    (void **)&store->mbRange,error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,
-			    store->mbBeamNbr * sizeof(short),
-			    (void **)&store->mbSoundingBias,error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,
-			    store->mbBeamNbr * sizeof(char),
-			    (void **)&store->mbSQuality,error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,
-			    store->mbBeamNbr * sizeof(char),
-			    (void **)&store->mbReflectivity,error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,
-			    store->mbBeamNbr * sizeof(char),
-			    (void **)&store->mbReceptionHeave,error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,
-			    store->mbBeamNbr * sizeof(short),
-			    (void **)&store->mbAlongSlope,error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,
-			    store->mbBeamNbr * sizeof(short),
-			    (void **)&store->mbAcrossSlope,error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,
-			    store->mbBeamNbr * sizeof(char),
-			    (void **)&store->mbSFlag,error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,
-			    store->mbBeamNbr * sizeof(char),
-			    (void **)&store->mbSLengthOfDetection,error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,
-			    store->mbBeamNbr * sizeof(char),
-			    (void **)&store->mbAntenna,error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,
-			    store->mbBeamNbr * sizeof(short),
-			    (void **)&store->mbBeamBias,error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,
-			    store->mbBeamNbr * sizeof(char),
-			    (void **)&store->mbBFlag,error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,
-			    store->mbAntennaNbr * sizeof(short),
-			    (void **)&store->mbBeam,error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,
-			    store->mbAntennaNbr * sizeof(char),
-			    (void **)&store->mbAFlag,error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,
-			    store->mbVelocityProfilNbr * store->mbCommentLength * sizeof(char),
-			    (void **)&store->mbVelProfilRef,error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,
-			    store->mbVelocityProfilNbr * sizeof(short),
-			    (void **)&store->mbVelProfilIdx,error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,
-			    store->mbVelocityProfilNbr * sizeof(int),
-			    (void **)&store->mbVelProfilDate,error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,
-			    store->mbVelocityProfilNbr * sizeof(int),
-			    (void **)&store->mbVelProfilTime,error);
-
-		/* deal with a memory allocation failure */
-		if (status == MB_FAILURE)
-		    {
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbHistDate, error);
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbHistTime, error);
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbHistCode, error);
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbHistAutor, error);
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbHistModule, error);
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbHistComment, error);
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbCycle, error);
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbDate, error);
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbTime, error);
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbOrdinate, error);
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbAbscissa, error);
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbFrequency, error);
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbSonarFrequency, error);
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbSounderMode, error);
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbReferenceDepth, error);
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbDynamicDraught, error);
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbTide, error);
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbSoundVelocity, error);
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbHeading, error);
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbRoll, error);
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbPitch, error);
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbTransmissionHeave, error);
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbDistanceScale, error);
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbRangeScale, error);
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbDepthScale, error);
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbVerticalDepth, error);
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbCQuality, error);
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbCFlag, error);
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbInterlacing, error);
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbSamplingRate, error);
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbCompensationLayerMode, error);
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbTransmitBeamwidth, error);
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbReceiveBeamwidth, error);
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbTransmitPulseLength, error);
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbAlongDistance, error);
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbAcrossDistance, error);
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbDepth, error);
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbAcrossBeamAngle, error);
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbAzimutBeamAngle, error);
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbRange, error);
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbSoundingBias, error);
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbSQuality, error);
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbReflectivity, error);
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbReceptionHeave, error);
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbAlongSlope, error);
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbAcrossSlope, error);
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbSFlag, error);
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbSLengthOfDetection, error);
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbAntenna, error);
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbBeamBias, error);
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbBFlag, error);
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbBeam, error);
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbAFlag, error);
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbVelProfilRef, error);
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbVelProfilIdx, error);
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbVelProfilDate, error);
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbVelProfilTime, error);
-		    status = MB_FAILURE;
-		    *error = MB_ERROR_MEMORY_FAIL;
-		    if (verbose >= 2)
-			    {
-			    fprintf(stderr,"\ndbg2  MBIO function <%s> terminated with error\n",function_name);
-			    fprintf(stderr,"dbg2  Return values:\n");
-			    fprintf(stderr,"dbg2       error:      %d\n",*error);
-			    fprintf(stderr,"dbg2  Return status:\n");
-			    fprintf(stderr,"dbg2       status:  %d\n",status);
-			    }
-		    return(status);
-		    }
-		}
-
-	    /* read variable attributes */
-	    if (status == MB_SUCCESS)
-		{
-		if (store->mbHistDate_id >= 0)
-		    {
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbHistDate_id, "type", store->mbHistDate_type);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHistDate_type error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbHistDate_id, "long_name", store->mbHistDate_long_name);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHistDate_long_name error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbHistDate_id, "name_code", store->mbHistDate_name_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHistDate_name_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbHistDate_id, "units", store->mbHistDate_units);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHistDate_units error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbHistDate_id, "unit_code", store->mbHistDate_unit_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHistDate_unit_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbHistDate_id, "add_offset", &store->mbHistDate_add_offset);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHistDate_add_offset error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbHistDate_id, "scale_factor", &store->mbHistDate_scale_factor);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHistDate_scale_factor error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbHistDate_id, "minimum", &store->mbHistDate_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHistDate_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbHistDate_id, "maximum", &store->mbHistDate_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHistDate_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbHistDate_id, "valid_minimum", &store->mbHistDate_valid_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHistDate_valid_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbHistDate_id, "valid_maximum", &store->mbHistDate_valid_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHistDate_valid_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbHistDate_id, "missing_value", &store->mbHistDate_missing_value);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHistDate_missing_value error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbHistDate_id, "format_C", store->mbHistDate_format_C);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHistDate_format_C error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbHistDate_id, "orientation", store->mbHistDate_orientation);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHistDate_orientation error: %s\n", nc_strerror(nc_status));
-		    }
-		if (store->mbHistTime_id >= 0)
-		    {
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbHistTime_id, "type", store->mbHistTime_type);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHistTime_type error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbHistTime_id, "long_name", store->mbHistTime_long_name);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHistTime_long_name error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbHistTime_id, "name_code", store->mbHistTime_name_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHistTime_name_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbHistTime_id, "units", store->mbHistTime_units);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHistTime_units error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbHistTime_id, "unit_code", store->mbHistTime_unit_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHistTime_unit_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbHistTime_id, "add_offset", &store->mbHistTime_add_offset);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHistTime_add_offset error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbHistTime_id, "scale_factor", &store->mbHistTime_scale_factor);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHistTime_scale_factor error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbHistTime_id, "minimum", &store->mbHistTime_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHistTime_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbHistTime_id, "maximum", &store->mbHistTime_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHistTime_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbHistTime_id, "valid_minimum", &store->mbHistTime_valid_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHistTime_valid_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbHistTime_id, "valid_maximum", &store->mbHistTime_valid_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHistTime_valid_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbHistTime_id, "missing_value", &store->mbHistTime_missing_value);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHistTime_missing_value error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbHistTime_id, "format_C", store->mbHistTime_format_C);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHistTime_format_C error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbHistTime_id, "orientation", store->mbHistTime_orientation);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHistTime_orientation error: %s\n", nc_strerror(nc_status));
-		    }
-		if (store->mbHistCode_id >= 0)
-		    {
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbHistCode_id, "type", store->mbHistCode_type);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHistCode_type error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbHistCode_id, "long_name", store->mbHistCode_long_name);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHistCode_long_name error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbHistCode_id, "name_code", store->mbHistCode_name_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHistCode_name_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbHistCode_id, "units", store->mbHistCode_units);
-/*fprintf(stderr,"store->mbHistCode_units:%d\n",store->mbHistCode_units);*/
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHistCode_units error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbHistCode_id, "unit_code", store->mbHistCode_unit_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHistCode_unit_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbHistCode_id, "add_offset", &store->mbHistCode_add_offset);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHistCode_add_offset error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbHistCode_id, "scale_factor", &store->mbHistCode_scale_factor);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHistCode_scale_factor error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbHistCode_id, "minimum", &store->mbHistCode_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHistCode_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbHistCode_id, "maximum", &store->mbHistCode_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHistCode_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbHistCode_id, "valid_minimum", &store->mbHistCode_valid_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHistCode_valid_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbHistCode_id, "valid_maximum", &store->mbHistCode_valid_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHistCode_valid_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbHistCode_id, "missing_value", &store->mbHistCode_missing_value);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHistCode_missing_value error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbHistCode_id, "format_C", store->mbHistCode_format_C);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHistCode_format_C error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbHistCode_id, "orientation", store->mbHistCode_orientation);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHistCode_orientation error: %s\n", nc_strerror(nc_status));
-		    }
-		if (store->mbHistAutor_id >= 0)
-		    {
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbHistAutor_id, "type", store->mbHistAutor_type);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHistAutor_type error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbHistAutor_id, "long_name", store->mbHistAutor_long_name);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHistAutor_long_name error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbHistAutor_id, "name_code", store->mbHistAutor_name_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHistAutor_name_code error: %s\n", nc_strerror(nc_status));
-		    }
-		if (store->mbHistModule_id >= 0)
-		    {
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbHistModule_id, "type", store->mbHistModule_type);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHistModule_type error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbHistModule_id, "long_name", store->mbHistModule_long_name);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHistModule_long_name error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbHistModule_id, "name_code", store->mbHistModule_name_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHistModule_name_code error: %s\n", nc_strerror(nc_status));
-		    }
-		if (store->mbHistComment_id >= 0)
-		    {
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbHistComment_id, "type", store->mbHistComment_type);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHistComment_type error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbHistComment_id, "long_name", store->mbHistComment_long_name);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHistComment_long_name error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbHistComment_id, "name_code", store->mbHistComment_name_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHistComment_name_code error: %s\n", nc_strerror(nc_status));
-		    }
-		if (store->mbCycle_id >= 0)
-		    {
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbCycle_id, "type", store->mbCycle_type);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbCycle_type error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbCycle_id, "long_name", store->mbCycle_long_name);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbCycle_long_name error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbCycle_id, "name_code", store->mbCycle_name_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbCycle_name_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbCycle_id, "units", store->mbCycle_units);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbCycle_units error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbCycle_id, "unit_code", store->mbCycle_unit_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbCycle_unit_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbCycle_id, "add_offset", &store->mbCycle_add_offset);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbCycle_add_offset error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbCycle_id, "scale_factor", &store->mbCycle_scale_factor);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbCycle_scale_factor error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbCycle_id, "minimum", &store->mbCycle_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbCycle_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbCycle_id, "maximum", &store->mbCycle_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbCycle_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbCycle_id, "valid_minimum", &store->mbCycle_valid_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbCycle_valid_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbCycle_id, "valid_maximum", &store->mbCycle_valid_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbCycle_valid_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbCycle_id, "missing_value", &store->mbCycle_missing_value);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbCycle_missing_value error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbCycle_id, "format_C", store->mbCycle_format_C);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbCycle_format_C error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbCycle_id, "orientation", store->mbCycle_orientation);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbCycle_orientation error: %s\n", nc_strerror(nc_status));
-		    }
-		if (store->mbDate_id >= 0)
-		    {
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbDate_id, "type", store->mbDate_type);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbDate_type error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbDate_id, "long_name", store->mbDate_long_name);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbDate_long_name error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbDate_id, "name_code", store->mbDate_name_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbDate_name_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbDate_id, "units", store->mbDate_units);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbDate_units error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbDate_id, "unit_code", store->mbDate_unit_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbDate_unit_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbDate_id, "add_offset", &store->mbDate_add_offset);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbDate_add_offset error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbDate_id, "scale_factor", &store->mbDate_scale_factor);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbDate_scale_factor error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbDate_id, "minimum", &store->mbDate_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbDate_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbDate_id, "maximum", &store->mbDate_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbDate_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbDate_id, "valid_minimum", &store->mbDate_valid_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbDate_valid_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbDate_id, "valid_maximum", &store->mbDate_valid_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbDate_valid_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbDate_id, "missing_value", &store->mbDate_missing_value);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbDate_missing_value error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbDate_id, "format_C", store->mbDate_format_C);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbDate_format_C error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbDate_id, "orientation", store->mbDate_orientation);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbDate_orientation error: %s\n", nc_strerror(nc_status));
-		    }
-		if (store->mbTime_id >= 0)
-		    {
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbTime_id, "type", store->mbTime_type);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbTime_type error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbTime_id, "long_name", store->mbTime_long_name);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbTime_long_name error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbTime_id, "name_code", store->mbTime_name_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbTime_name_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbTime_id, "units", store->mbTime_units);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbTime_units error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbTime_id, "unit_code", store->mbTime_unit_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbTime_unit_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbTime_id, "add_offset", &store->mbTime_add_offset);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbTime_add_offset error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbTime_id, "scale_factor", &store->mbTime_scale_factor);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbTime_scale_factor error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbTime_id, "minimum", &store->mbTime_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbTime_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbTime_id, "maximum", &store->mbTime_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbTime_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbTime_id, "valid_minimum", &store->mbTime_valid_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbTime_valid_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbTime_id, "valid_maximum", &store->mbTime_valid_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbTime_valid_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbTime_id, "missing_value", &store->mbTime_missing_value);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbTime_missing_value error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbTime_id, "format_C", store->mbTime_format_C);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbTime_format_C error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbTime_id, "orientation", store->mbTime_orientation);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbTime_orientation error: %s\n", nc_strerror(nc_status));
-		    }
-		if (store->mbOrdinate_id >= 0)
-		    {
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbOrdinate_id, "type", store->mbOrdinate_type);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbOrdinate_type error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbOrdinate_id, "long_name", store->mbOrdinate_long_name);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbOrdinate_long_name error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbOrdinate_id, "name_code", store->mbOrdinate_name_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbOrdinate_name_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbOrdinate_id, "units", store->mbOrdinate_units);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbOrdinate_units error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbOrdinate_id, "unit_code", store->mbOrdinate_unit_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbOrdinate_unit_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_double(mb_io_ptr->ncid, store->mbOrdinate_id, "add_offset", &store->mbOrdinate_add_offset);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbOrdinate_add_offset error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_double(mb_io_ptr->ncid, store->mbOrdinate_id, "scale_factor", &store->mbOrdinate_scale_factor);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbOrdinate_scale_factor error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_double(mb_io_ptr->ncid, store->mbOrdinate_id, "minimum", &store->mbOrdinate_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbOrdinate_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_double(mb_io_ptr->ncid, store->mbOrdinate_id, "maximum", &store->mbOrdinate_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbOrdinate_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbOrdinate_id, "valid_minimum", &store->mbOrdinate_valid_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbOrdinate_valid_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbOrdinate_id, "valid_maximum", &store->mbOrdinate_valid_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbOrdinate_valid_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbOrdinate_id, "missing_value", &store->mbOrdinate_missing_value);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbOrdinate_missing_value error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbOrdinate_id, "format_C", store->mbOrdinate_format_C);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbOrdinate_format_C error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbOrdinate_id, "orientation", store->mbOrdinate_orientation);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbOrdinate_orientation error: %s\n", nc_strerror(nc_status));
-		    }
-		if (store->mbAbscissa_id >= 0)
-		    {
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbAbscissa_id, "type", store->mbAbscissa_type);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAbscissa_type error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbAbscissa_id, "long_name", store->mbAbscissa_long_name);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAbscissa_long_name error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbAbscissa_id, "name_code", store->mbAbscissa_name_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAbscissa_name_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbAbscissa_id, "units", store->mbAbscissa_units);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAbscissa_units error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbAbscissa_id, "unit_code", store->mbAbscissa_unit_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAbscissa_unit_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_double(mb_io_ptr->ncid, store->mbAbscissa_id, "add_offset", &store->mbAbscissa_add_offset);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAbscissa_add_offset error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_double(mb_io_ptr->ncid, store->mbAbscissa_id, "scale_factor", &store->mbAbscissa_scale_factor);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAbscissa_scale_factor error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_double(mb_io_ptr->ncid, store->mbAbscissa_id, "minimum", &store->mbAbscissa_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAbscissa_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_double(mb_io_ptr->ncid, store->mbAbscissa_id, "maximum", &store->mbAbscissa_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAbscissa_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbAbscissa_id, "valid_minimum", &store->mbAbscissa_valid_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAbscissa_valid_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbAbscissa_id, "valid_maximum", &store->mbAbscissa_valid_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAbscissa_valid_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbAbscissa_id, "missing_value", &store->mbAbscissa_missing_value);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAbscissa_missing_value error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbAbscissa_id, "format_C", store->mbAbscissa_format_C);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAbscissa_format_C error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbAbscissa_id, "orientation", store->mbAbscissa_orientation);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAbscissa_orientation error: %s\n", nc_strerror(nc_status));
-		    }
-		if (store->mbFrequency_id >= 0)
-		    {
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbFrequency_id, "type", store->mbFrequency_type);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbFrequency_type error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbFrequency_id, "long_name", store->mbFrequency_long_name);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbFrequency_long_name error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbFrequency_id, "name_code", store->mbFrequency_name_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbFrequency_name_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbFrequency_id, "units", store->mbFrequency_units);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbFrequency_units error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbFrequency_id, "unit_code", store->mbFrequency_unit_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbFrequency_unit_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbFrequency_id, "add_offset", &store->mbFrequency_add_offset);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbFrequency_add_offset error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbFrequency_id, "scale_factor", &store->mbFrequency_scale_factor);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbFrequency_scale_factor error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbFrequency_id, "minimum", &store->mbFrequency_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbFrequency_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbFrequency_id, "maximum", &store->mbFrequency_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbFrequency_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbFrequency_id, "valid_minimum", &store->mbFrequency_valid_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbFrequency_valid_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbFrequency_id, "valid_maximum", &store->mbFrequency_valid_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbFrequency_valid_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbFrequency_id, "missing_value", &store->mbFrequency_missing_value);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbFrequency_missing_value error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbFrequency_id, "format_C", store->mbFrequency_format_C);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbFrequency_format_C error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbFrequency_id, "orientation", store->mbFrequency_orientation);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbFrequency_orientation error: %s\n", nc_strerror(nc_status));
-		    }
-		if (store->mbSonarFrequency_id >= 0)
-		    {
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbSonarFrequency_id, "type", store->mbSonarFrequency_type);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSonarFrequency_type error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbSonarFrequency_id, "long_name", store->mbSonarFrequency_long_name);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSonarFrequency_long_name error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbSonarFrequency_id, "name_code", store->mbSonarFrequency_name_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSonarFrequency_name_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbSonarFrequency_id, "units", store->mbSonarFrequency_units);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSonarFrequency_units error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbSonarFrequency_id, "unit_code", store->mbSonarFrequency_unit_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSonarFrequency_unit_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_double(mb_io_ptr->ncid, store->mbSonarFrequency_id, "add_offset", &store->mbSonarFrequency_add_offset);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSonarFrequency_add_offset error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_double(mb_io_ptr->ncid, store->mbSonarFrequency_id, "scale_factor", &store->mbSonarFrequency_scale_factor);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSonarFrequency_scale_factor error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_double(mb_io_ptr->ncid, store->mbSonarFrequency_id, "minimum", &store->mbSonarFrequency_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSonarFrequency_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_double(mb_io_ptr->ncid, store->mbSonarFrequency_id, "maximum", &store->mbSonarFrequency_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSonarFrequency_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbSonarFrequency_id, "valid_minimum", &store->mbSonarFrequency_valid_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSonarFrequency_valid_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbSonarFrequency_id, "valid_maximum", &store->mbSonarFrequency_valid_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSonarFrequency_valid_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbSonarFrequency_id, "missing_value", &store->mbSonarFrequency_missing_value);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSonarFrequency_missing_value error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbSonarFrequency_id, "format_C", store->mbSonarFrequency_format_C);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSonarFrequency_format_C error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbSonarFrequency_id, "orientation", store->mbSonarFrequency_orientation);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSonarFrequency_orientation error: %s\n", nc_strerror(nc_status));
-		    }
-		if (store->mbSounderMode_id >= 0)
-		    {
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbSounderMode_id, "type", store->mbSounderMode_type);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSounderMode_type error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbSounderMode_id, "long_name", store->mbSounderMode_long_name);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSounderMode_long_name error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbSounderMode_id, "name_code", store->mbSounderMode_name_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSounderMode_name_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbSounderMode_id, "units", store->mbSounderMode_units);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSounderMode_units error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbSounderMode_id, "unit_code", store->mbSounderMode_unit_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSounderMode_unit_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbSounderMode_id, "add_offset", &store->mbSounderMode_add_offset);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSounderMode_add_offset error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbSounderMode_id, "scale_factor", &store->mbSounderMode_scale_factor);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSounderMode_scale_factor error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbSounderMode_id, "minimum", &store->mbSounderMode_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSounderMode_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbSounderMode_id, "maximum", &store->mbSounderMode_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSounderMode_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbSounderMode_id, "valid_minimum", &store->mbSounderMode_valid_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSounderMode_valid_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbSounderMode_id, "valid_maximum", &store->mbSounderMode_valid_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSounderMode_valid_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbSounderMode_id, "missing_value", &store->mbSounderMode_missing_value);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSounderMode_missing_value error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbSounderMode_id, "format_C", store->mbSounderMode_format_C);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSounderMode_format_C error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbSounderMode_id, "orientation", store->mbSounderMode_orientation);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSounderMode_orientation error: %s\n", nc_strerror(nc_status));
-		    }
-		if (store->mbReferenceDepth_id >= 0)
-		    {
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbReferenceDepth_id, "type", store->mbReferenceDepth_type);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbReferenceDepth_type error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbReferenceDepth_id, "long_name", store->mbReferenceDepth_long_name);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbReferenceDepth_long_name error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbReferenceDepth_id, "name_code", store->mbReferenceDepth_name_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbReferenceDepth_name_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbReferenceDepth_id, "units", store->mbReferenceDepth_units);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbReferenceDepth_units error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbReferenceDepth_id, "unit_code", store->mbReferenceDepth_unit_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbReferenceDepth_unit_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_double(mb_io_ptr->ncid, store->mbReferenceDepth_id, "add_offset", &store->mbReferenceDepth_add_offset);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbReferenceDepth_add_offset error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_double(mb_io_ptr->ncid, store->mbReferenceDepth_id, "scale_factor", &store->mbReferenceDepth_scale_factor);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbReferenceDepth_scale_factor error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_double(mb_io_ptr->ncid, store->mbReferenceDepth_id, "minimum", &store->mbReferenceDepth_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbReferenceDepth_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_double(mb_io_ptr->ncid, store->mbReferenceDepth_id, "maximum", &store->mbReferenceDepth_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbReferenceDepth_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbReferenceDepth_id, "valid_minimum", &store->mbReferenceDepth_valid_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbReferenceDepth_valid_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbReferenceDepth_id, "valid_maximum", &store->mbReferenceDepth_valid_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbReferenceDepth_valid_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbReferenceDepth_id, "missing_value", &store->mbReferenceDepth_missing_value);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbReferenceDepth_missing_value error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbReferenceDepth_id, "format_C", store->mbReferenceDepth_format_C);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbReferenceDepth_format_C error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbReferenceDepth_id, "orientation", store->mbReferenceDepth_orientation);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbReferenceDepth_orientation error: %s\n", nc_strerror(nc_status));
-		    }
-		if (store->mbDynamicDraught_id >= 0)
-		    {
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbDynamicDraught_id, "type", store->mbDynamicDraught_type);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbDynamicDraught_type error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbDynamicDraught_id, "long_name", store->mbDynamicDraught_long_name);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbDynamicDraught_long_name error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbDynamicDraught_id, "name_code", store->mbDynamicDraught_name_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbDynamicDraught_name_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbDynamicDraught_id, "units", store->mbDynamicDraught_units);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbDynamicDraught_units error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbDynamicDraught_id, "unit_code", store->mbDynamicDraught_unit_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbDynamicDraught_unit_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_double(mb_io_ptr->ncid, store->mbDynamicDraught_id, "add_offset", &store->mbDynamicDraught_add_offset);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbDynamicDraught_add_offset error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_double(mb_io_ptr->ncid, store->mbDynamicDraught_id, "scale_factor", &store->mbDynamicDraught_scale_factor);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbDynamicDraught_scale_factor error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_double(mb_io_ptr->ncid, store->mbDynamicDraught_id, "minimum", &store->mbDynamicDraught_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbDynamicDraught_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_double(mb_io_ptr->ncid, store->mbDynamicDraught_id, "maximum", &store->mbDynamicDraught_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbDynamicDraught_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbDynamicDraught_id, "valid_minimum", &store->mbDynamicDraught_valid_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbDynamicDraught_valid_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbDynamicDraught_id, "valid_maximum", &store->mbDynamicDraught_valid_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbDynamicDraught_valid_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbDynamicDraught_id, "missing_value", &store->mbDynamicDraught_missing_value);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbDynamicDraught_missing_value error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbDynamicDraught_id, "format_C", store->mbDynamicDraught_format_C);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbDynamicDraught_format_C error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbDynamicDraught_id, "orientation", store->mbDynamicDraught_orientation);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbDynamicDraught_orientation error: %s\n", nc_strerror(nc_status));
-		    }
-		if (store->mbTide_id >= 0)
-		    {
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbTide_id, "type", store->mbTide_type);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbTide_type error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbTide_id, "long_name", store->mbTide_long_name);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbTide_long_name error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbTide_id, "name_code", store->mbTide_name_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbTide_name_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbTide_id, "units", store->mbTide_units);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbTide_units error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbTide_id, "unit_code", store->mbTide_unit_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbTide_unit_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_double(mb_io_ptr->ncid, store->mbTide_id, "add_offset", &store->mbTide_add_offset);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbTide_add_offset error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_double(mb_io_ptr->ncid, store->mbTide_id, "scale_factor", &store->mbTide_scale_factor);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbTide_scale_factor error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_double(mb_io_ptr->ncid, store->mbTide_id, "minimum", &store->mbTide_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbTide_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_double(mb_io_ptr->ncid, store->mbTide_id, "maximum", &store->mbTide_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbTide_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbTide_id, "valid_minimum", &store->mbTide_valid_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbTide_valid_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbTide_id, "valid_maximum", &store->mbTide_valid_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbTide_valid_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbTide_id, "missing_value", &store->mbTide_missing_value);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbTide_missing_value error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbTide_id, "format_C", store->mbTide_format_C);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbTide_format_C error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbTide_id, "orientation", store->mbTide_orientation);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbTide_orientation error: %s\n", nc_strerror(nc_status));
-		    }
-		if (store->mbSoundVelocity_id >= 0)
-		    {
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbSoundVelocity_id, "type", store->mbSoundVelocity_type);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSoundVelocity_type error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbSoundVelocity_id, "long_name", store->mbSoundVelocity_long_name);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSoundVelocity_long_name error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbSoundVelocity_id, "name_code", store->mbSoundVelocity_name_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSoundVelocity_name_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbSoundVelocity_id, "units", store->mbSoundVelocity_units);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSoundVelocity_units error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbSoundVelocity_id, "unit_code", store->mbSoundVelocity_unit_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSoundVelocity_unit_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_double(mb_io_ptr->ncid, store->mbSoundVelocity_id, "add_offset", &store->mbSoundVelocity_add_offset);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSoundVelocity_add_offset error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_double(mb_io_ptr->ncid, store->mbSoundVelocity_id, "scale_factor", &store->mbSoundVelocity_scale_factor);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSoundVelocity_scale_factor error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_double(mb_io_ptr->ncid, store->mbSoundVelocity_id, "minimum", &store->mbSoundVelocity_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSoundVelocity_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_double(mb_io_ptr->ncid, store->mbSoundVelocity_id, "maximum", &store->mbSoundVelocity_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSoundVelocity_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbSoundVelocity_id, "valid_minimum", &store->mbSoundVelocity_valid_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSoundVelocity_valid_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbSoundVelocity_id, "valid_maximum", &store->mbSoundVelocity_valid_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSoundVelocity_valid_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbSoundVelocity_id, "missing_value", &store->mbSoundVelocity_missing_value);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSoundVelocity_missing_value error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbSoundVelocity_id, "format_C", store->mbSoundVelocity_format_C);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSoundVelocity_format_C error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbSoundVelocity_id, "orientation", store->mbSoundVelocity_orientation);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSoundVelocity_orientation error: %s\n", nc_strerror(nc_status));
-		    }
-		if (store->mbHeading_id >= 0)
-		    {
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbHeading_id, "type", store->mbHeading_type);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHeading_type error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbHeading_id, "long_name", store->mbHeading_long_name);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHeading_long_name error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbHeading_id, "name_code", store->mbHeading_name_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHeading_name_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbHeading_id, "units", store->mbHeading_units);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHeading_units error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbHeading_id, "unit_code", store->mbHeading_unit_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHeading_unit_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_double(mb_io_ptr->ncid, store->mbHeading_id, "add_offset", &store->mbHeading_add_offset);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHeading_add_offset error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_double(mb_io_ptr->ncid, store->mbHeading_id, "scale_factor", &store->mbHeading_scale_factor);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHeading_scale_factor error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_double(mb_io_ptr->ncid, store->mbHeading_id, "minimum", &store->mbHeading_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHeading_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_double(mb_io_ptr->ncid, store->mbHeading_id, "maximum", &store->mbHeading_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHeading_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbHeading_id, "valid_minimum", &store->mbHeading_valid_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHeading_valid_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbHeading_id, "valid_maximum", &store->mbHeading_valid_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHeading_valid_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbHeading_id, "missing_value", &store->mbHeading_missing_value);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHeading_missing_value error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbHeading_id, "format_C", store->mbHeading_format_C);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHeading_format_C error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbHeading_id, "orientation", store->mbHeading_orientation);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHeading_orientation error: %s\n", nc_strerror(nc_status));
-		    }
-		if (store->mbRoll_id >= 0)
-		    {
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbRoll_id, "type", store->mbRoll_type);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbRoll_type error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbRoll_id, "long_name", store->mbRoll_long_name);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbRoll_long_name error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbRoll_id, "name_code", store->mbRoll_name_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbRoll_name_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbRoll_id, "units", store->mbRoll_units);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbRoll_units error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbRoll_id, "unit_code", store->mbRoll_unit_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbRoll_unit_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_double(mb_io_ptr->ncid, store->mbRoll_id, "add_offset", &store->mbRoll_add_offset);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbRoll_add_offset error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_double(mb_io_ptr->ncid, store->mbRoll_id, "scale_factor", &store->mbRoll_scale_factor);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbRoll_scale_factor error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_double(mb_io_ptr->ncid, store->mbRoll_id, "minimum", &store->mbRoll_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbRoll_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_double(mb_io_ptr->ncid, store->mbRoll_id, "maximum", &store->mbRoll_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbRoll_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbRoll_id, "valid_minimum", &store->mbRoll_valid_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbRoll_valid_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbRoll_id, "valid_maximum", &store->mbRoll_valid_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbRoll_valid_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbRoll_id, "missing_value", &store->mbRoll_missing_value);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbRoll_missing_value error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbRoll_id, "format_C", store->mbRoll_format_C);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbRoll_format_C error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbRoll_id, "orientation", store->mbRoll_orientation);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbRoll_orientation error: %s\n", nc_strerror(nc_status));
-		    }
-		if (store->mbPitch_id >= 0)
-		    {
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbPitch_id, "type", store->mbPitch_type);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbPitch_type error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbPitch_id, "long_name", store->mbPitch_long_name);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbPitch_long_name error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbPitch_id, "name_code", store->mbPitch_name_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbPitch_name_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbPitch_id, "units", store->mbPitch_units);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbPitch_units error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbPitch_id, "unit_code", store->mbPitch_unit_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbPitch_unit_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_double(mb_io_ptr->ncid, store->mbPitch_id, "add_offset", &store->mbPitch_add_offset);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbPitch_add_offset error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_double(mb_io_ptr->ncid, store->mbPitch_id, "scale_factor", &store->mbPitch_scale_factor);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbPitch_scale_factor error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_double(mb_io_ptr->ncid, store->mbPitch_id, "minimum", &store->mbPitch_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbPitch_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_double(mb_io_ptr->ncid, store->mbPitch_id, "maximum", &store->mbPitch_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbPitch_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbPitch_id, "valid_minimum", &store->mbPitch_valid_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbPitch_valid_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbPitch_id, "valid_maximum", &store->mbPitch_valid_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbPitch_valid_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbPitch_id, "missing_value", &store->mbPitch_missing_value);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbPitch_missing_value error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbPitch_id, "format_C", store->mbPitch_format_C);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbPitch_format_C error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbPitch_id, "orientation", store->mbPitch_orientation);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbPitch_orientation error: %s\n", nc_strerror(nc_status));
-		    }
-		if (store->mbTransmissionHeave_id >= 0)
-		    {
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbTransmissionHeave_id, "type", store->mbTransmissionHeave_type);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbTransmissionHeave_type error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbTransmissionHeave_id, "long_name", store->mbTransmissionHeave_long_name);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbTransmissionHeave_long_name error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbTransmissionHeave_id, "name_code", store->mbTransmissionHeave_name_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbTransmissionHeave_name_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbTransmissionHeave_id, "units", store->mbTransmissionHeave_units);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbTransmissionHeave_units error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbTransmissionHeave_id, "unit_code", store->mbTransmissionHeave_unit_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbTransmissionHeave_unit_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_double(mb_io_ptr->ncid, store->mbTransmissionHeave_id, "add_offset", &store->mbTransmissionHeave_add_offset);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbTransmissionHeave_add_offset error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_double(mb_io_ptr->ncid, store->mbTransmissionHeave_id, "scale_factor", &store->mbTransmissionHeave_scale_factor);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbTransmissionHeave_scale_factor error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_double(mb_io_ptr->ncid, store->mbTransmissionHeave_id, "minimum", &store->mbTransmissionHeave_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbTransmissionHeave_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_double(mb_io_ptr->ncid, store->mbTransmissionHeave_id, "maximum", &store->mbTransmissionHeave_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbTransmissionHeave_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbTransmissionHeave_id, "valid_minimum", &store->mbTransmissionHeave_valid_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbTransmissionHeave_valid_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbTransmissionHeave_id, "valid_maximum", &store->mbTransmissionHeave_valid_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbTransmissionHeave_valid_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbTransmissionHeave_id, "missing_value", &store->mbTransmissionHeave_missing_value);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbTransmissionHeave_missing_value error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbTransmissionHeave_id, "format_C", store->mbTransmissionHeave_format_C);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbTransmissionHeave_format_C error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbTransmissionHeave_id, "orientation", store->mbTransmissionHeave_orientation);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbTransmissionHeave_orientation error: %s\n", nc_strerror(nc_status));
-		    }
-		if (store->mbDistanceScale_id >= 0)
-		    {
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbDistanceScale_id, "type", store->mbDistanceScale_type);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbDistanceScale_type error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbDistanceScale_id, "long_name", store->mbDistanceScale_long_name);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbDistanceScale_long_name error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbDistanceScale_id, "name_code", store->mbDistanceScale_name_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbDistanceScale_name_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbDistanceScale_id, "units", store->mbDistanceScale_units);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbDistanceScale_units error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbDistanceScale_id, "unit_code", store->mbDistanceScale_unit_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbDistanceScale_unit_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_double(mb_io_ptr->ncid, store->mbDistanceScale_id, "add_offset", &store->mbDistanceScale_add_offset);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbDistanceScale_add_offset error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_double(mb_io_ptr->ncid, store->mbDistanceScale_id, "scale_factor", &store->mbDistanceScale_scale_factor);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbDistanceScale_scale_factor error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_double(mb_io_ptr->ncid, store->mbDistanceScale_id, "minimum", &store->mbDistanceScale_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbDistanceScale_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_double(mb_io_ptr->ncid, store->mbDistanceScale_id, "maximum", &store->mbDistanceScale_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbDistanceScale_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbDistanceScale_id, "valid_minimum", &store->mbDistanceScale_valid_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbDistanceScale_valid_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbDistanceScale_id, "valid_maximum", &store->mbDistanceScale_valid_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbDistanceScale_valid_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbDistanceScale_id, "missing_value", &store->mbDistanceScale_missing_value);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbDistanceScale_missing_value error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbDistanceScale_id, "format_C", store->mbDistanceScale_format_C);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbDistanceScale_format_C error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbDistanceScale_id, "orientation", store->mbDistanceScale_orientation);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbDistanceScale_orientation error: %s\n", nc_strerror(nc_status));
-		    }
-		if (store->mbRangeScale_id >= 0)
-		    {
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbRangeScale_id, "type", store->mbRangeScale_type);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbRangeScale_type error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbRangeScale_id, "long_name", store->mbRangeScale_long_name);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbRangeScale_long_name error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbRangeScale_id, "name_code", store->mbRangeScale_name_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbRangeScale_name_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbRangeScale_id, "units", store->mbRangeScale_units);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbRangeScale_units error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbRangeScale_id, "unit_code", store->mbRangeScale_unit_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbRangeScale_unit_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_double(mb_io_ptr->ncid, store->mbRangeScale_id, "add_offset", &store->mbRangeScale_add_offset);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbRangeScale_add_offset error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_double(mb_io_ptr->ncid, store->mbRangeScale_id, "scale_factor", &store->mbRangeScale_scale_factor);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbRangeScale_scale_factor error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_double(mb_io_ptr->ncid, store->mbRangeScale_id, "minimum", &store->mbRangeScale_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbRangeScale_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_double(mb_io_ptr->ncid, store->mbRangeScale_id, "maximum", &store->mbRangeScale_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbRangeScale_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbRangeScale_id, "valid_minimum", &store->mbRangeScale_valid_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbRangeScale_valid_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbRangeScale_id, "valid_maximum", &store->mbRangeScale_valid_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbRangeScale_valid_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbRangeScale_id, "missing_value", &store->mbRangeScale_missing_value);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbRangeScale_missing_value error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbRangeScale_id, "format_C", store->mbRangeScale_format_C);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbRangeScale_format_C error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbRangeScale_id, "orientation", store->mbRangeScale_orientation);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbRangeScale_orientation error: %s\n", nc_strerror(nc_status));
-		    }
-		if (store->mbDepthScale_id >= 0)
-		    {
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbDepthScale_id, "type", store->mbDepthScale_type);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbDepthScale_type error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbDepthScale_id, "long_name", store->mbDepthScale_long_name);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbDepthScale_long_name error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbDepthScale_id, "name_code", store->mbDepthScale_name_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbDepthScale_name_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbDepthScale_id, "units", store->mbDepthScale_units);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbDepthScale_units error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbDepthScale_id, "unit_code", store->mbDepthScale_unit_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbDepthScale_unit_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_double(mb_io_ptr->ncid, store->mbDepthScale_id, "add_offset", &store->mbDepthScale_add_offset);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbDepthScale_add_offset error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_double(mb_io_ptr->ncid, store->mbDepthScale_id, "scale_factor", &store->mbDepthScale_scale_factor);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbDepthScale_scale_factor error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_double(mb_io_ptr->ncid, store->mbDepthScale_id, "minimum", &store->mbDepthScale_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbDepthScale_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_double(mb_io_ptr->ncid, store->mbDepthScale_id, "maximum", &store->mbDepthScale_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbDepthScale_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbDepthScale_id, "valid_minimum", &store->mbDepthScale_valid_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbDepthScale_valid_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbDepthScale_id, "valid_maximum", &store->mbDepthScale_valid_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbDepthScale_valid_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbDepthScale_id, "missing_value", &store->mbDepthScale_missing_value);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbDepthScale_missing_value error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbDepthScale_id, "format_C", store->mbDepthScale_format_C);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbDepthScale_format_C error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbDepthScale_id, "orientation", store->mbDepthScale_orientation);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbDepthScale_orientation error: %s\n", nc_strerror(nc_status));
-		    }
-		if (store->mbVerticalDepth_id >= 0)
-		    {
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbVerticalDepth_id, "type", store->mbVerticalDepth_type);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbVerticalDepth_type error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbVerticalDepth_id, "long_name", store->mbVerticalDepth_long_name);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbVerticalDepth_long_name error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbVerticalDepth_id, "name_code", store->mbVerticalDepth_name_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbVerticalDepth_name_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbVerticalDepth_id, "units", store->mbVerticalDepth_units);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbVerticalDepth_units error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbVerticalDepth_id, "unit_code", store->mbVerticalDepth_unit_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbVerticalDepth_unit_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbVerticalDepth_id, "add_offset", &store->mbVerticalDepth_add_offset);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbVerticalDepth_add_offset error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbVerticalDepth_id, "scale_factor", &store->mbVerticalDepth_scale_factor);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbVerticalDepth_scale_factor error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbVerticalDepth_id, "minimum", &store->mbVerticalDepth_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbVerticalDepth_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbVerticalDepth_id, "maximum", &store->mbVerticalDepth_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbVerticalDepth_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbVerticalDepth_id, "valid_minimum", &store->mbVerticalDepth_valid_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbVerticalDepth_valid_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbVerticalDepth_id, "valid_maximum", &store->mbVerticalDepth_valid_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbVerticalDepth_valid_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbVerticalDepth_id, "missing_value", &store->mbVerticalDepth_missing_value);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbVerticalDepth_missing_value error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbVerticalDepth_id, "format_C", store->mbVerticalDepth_format_C);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbVerticalDepth_format_C error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbVerticalDepth_id, "orientation", store->mbVerticalDepth_orientation);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbVerticalDepth_orientation error: %s\n", nc_strerror(nc_status));
-		    }
-		if (store->mbCQuality_id >= 0)
-		    {
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbCQuality_id, "type", store->mbCQuality_type);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbCQuality_type error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbCQuality_id, "long_name", store->mbCQuality_long_name);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbCQuality_long_name error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbCQuality_id, "name_code", store->mbCQuality_name_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbCQuality_name_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbCQuality_id, "units", store->mbCQuality_units);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbCQuality_units error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbCQuality_id, "unit_code", store->mbCQuality_unit_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbCQuality_unit_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbCQuality_id, "add_offset", &store->mbCQuality_add_offset);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbCQuality_add_offset error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbCQuality_id, "scale_factor", &store->mbCQuality_scale_factor);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbCQuality_scale_factor error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbCQuality_id, "minimum", &store->mbCQuality_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbCQuality_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbCQuality_id, "maximum", &store->mbCQuality_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbCQuality_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbCQuality_id, "valid_minimum", &store->mbCQuality_valid_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbCQuality_valid_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbCQuality_id, "valid_maximum", &store->mbCQuality_valid_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbCQuality_valid_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbCQuality_id, "missing_value", &store->mbCQuality_missing_value);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbCQuality_missing_value error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbCQuality_id, "format_C", store->mbCQuality_format_C);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbCQuality_format_C error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbCQuality_id, "orientation", store->mbCQuality_orientation);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbCQuality_orientation error: %s\n", nc_strerror(nc_status));
-		    }
-		if (store->mbCFlag_id >= 0)
-		    {
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbCFlag_id, "type", store->mbCFlag_type);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbCFlag_type error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbCFlag_id, "long_name", store->mbCFlag_long_name);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbCFlag_long_name error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbCFlag_id, "name_code", store->mbCFlag_name_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbCFlag_name_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbCFlag_id, "units", store->mbCFlag_units);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbCFlag_units error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbCFlag_id, "unit_code", store->mbCFlag_unit_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbCFlag_unit_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbCFlag_id, "add_offset", &store->mbCFlag_add_offset);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbCFlag_add_offset error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbCFlag_id, "scale_factor", &store->mbCFlag_scale_factor);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbCFlag_scale_factor error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbCFlag_id, "minimum", &store->mbCFlag_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbCFlag_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbCFlag_id, "maximum", &store->mbCFlag_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbCFlag_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbCFlag_id, "valid_minimum", &store->mbCFlag_valid_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbCFlag_valid_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbCFlag_id, "valid_maximum", &store->mbCFlag_valid_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbCFlag_valid_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbCFlag_id, "missing_value", &store->mbCFlag_missing_value);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbCFlag_missing_value error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbCFlag_id, "format_C", store->mbCFlag_format_C);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbCFlag_format_C error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbCFlag_id, "orientation", store->mbCFlag_orientation);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbCFlag_orientation error: %s\n", nc_strerror(nc_status));
-		    }
-		if (store->mbInterlacing_id >= 0)
-		    {
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbInterlacing_id, "type", store->mbInterlacing_type);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbInterlacing_type error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbInterlacing_id, "long_name", store->mbInterlacing_long_name);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbInterlacing_long_name error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbInterlacing_id, "name_code", store->mbInterlacing_name_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbInterlacing_name_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbInterlacing_id, "units", store->mbInterlacing_units);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbInterlacing_units error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbInterlacing_id, "unit_code", store->mbInterlacing_unit_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbInterlacing_unit_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbInterlacing_id, "add_offset", &store->mbInterlacing_add_offset);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbInterlacing_add_offset error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbInterlacing_id, "scale_factor", &store->mbInterlacing_scale_factor);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbInterlacing_scale_factor error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbInterlacing_id, "minimum", &store->mbInterlacing_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbInterlacing_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbInterlacing_id, "maximum", &store->mbInterlacing_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbInterlacing_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbInterlacing_id, "valid_minimum", &store->mbInterlacing_valid_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbInterlacing_valid_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbInterlacing_id, "valid_maximum", &store->mbInterlacing_valid_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbInterlacing_valid_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbInterlacing_id, "missing_value", &store->mbInterlacing_missing_value);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbInterlacing_missing_value error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbInterlacing_id, "format_C", store->mbInterlacing_format_C);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbInterlacing_format_C error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbInterlacing_id, "orientation", store->mbInterlacing_orientation);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbInterlacing_orientation error: %s\n", nc_strerror(nc_status));
-		    }
-		if (store->mbSamplingRate_id >= 0)
-		    {
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbSamplingRate_id, "type", store->mbSamplingRate_type);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSamplingRate_type error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbSamplingRate_id, "long_name", store->mbSamplingRate_long_name);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSamplingRate_long_name error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbSamplingRate_id, "name_code", store->mbSamplingRate_name_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSamplingRate_name_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbSamplingRate_id, "units", store->mbSamplingRate_units);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSamplingRate_units error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbSamplingRate_id, "unit_code", store->mbSamplingRate_unit_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSamplingRate_unit_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbSamplingRate_id, "add_offset", &store->mbSamplingRate_add_offset);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSamplingRate_add_offset error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbSamplingRate_id, "scale_factor", &store->mbSamplingRate_scale_factor);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSamplingRate_scale_factor error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbSamplingRate_id, "minimum", &store->mbSamplingRate_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSamplingRate_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbSamplingRate_id, "maximum", &store->mbSamplingRate_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSamplingRate_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbSamplingRate_id, "valid_minimum", &store->mbSamplingRate_valid_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSamplingRate_valid_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbSamplingRate_id, "valid_maximum", &store->mbSamplingRate_valid_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSamplingRate_valid_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbSamplingRate_id, "missing_value", &store->mbSamplingRate_missing_value);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSamplingRate_missing_value error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbSamplingRate_id, "format_C", store->mbSamplingRate_format_C);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSamplingRate_format_C error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbSamplingRate_id, "orientation", store->mbSamplingRate_orientation);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSamplingRate_orientation error: %s\n", nc_strerror(nc_status));
-		    }
-		if (store->mbCompensationLayerMode_id >= 0)
-		    {
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbCompensationLayerMode_id, "type", store->mbCompensationLayerMode_type);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbCompensationLayerMode_type error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbCompensationLayerMode_id, "long_name", store->mbCompensationLayerMode_long_name);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbCompensationLayerMode_long_name error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbCompensationLayerMode_id, "name_code", store->mbCompensationLayerMode_name_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbCompensationLayerMode_name_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbCompensationLayerMode_id, "units", store->mbCompensationLayerMode_units);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbCompensationLayerMode_units error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbCompensationLayerMode_id, "unit_code", store->mbCompensationLayerMode_unit_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbCompensationLayerMode_unit_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbCompensationLayerMode_id, "add_offset", &store->mbCompensationLayerMode_add_offset);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbCompensationLayerMode_add_offset error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbCompensationLayerMode_id, "scale_factor", &store->mbCompensationLayerMode_scale_factor);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbCompensationLayerMode_scale_factor error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbCompensationLayerMode_id, "minimum", &store->mbCompensationLayerMode_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbCompensationLayerMode_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbCompensationLayerMode_id, "maximum", &store->mbCompensationLayerMode_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbCompensationLayerMode_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbCompensationLayerMode_id, "valid_minimum", &store->mbCompensationLayerMode_valid_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbCompensationLayerMode_valid_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbCompensationLayerMode_id, "valid_maximum", &store->mbCompensationLayerMode_valid_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbCompensationLayerMode_valid_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbCompensationLayerMode_id, "missing_value", &store->mbCompensationLayerMode_missing_value);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbCompensationLayerMode_missing_value error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbCompensationLayerMode_id, "format_C", store->mbCompensationLayerMode_format_C);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbCompensationLayerMode_format_C error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbCompensationLayerMode_id, "orientation", store->mbCompensationLayerMode_orientation);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbCompensationLayerMode_orientation error: %s\n", nc_strerror(nc_status));
-		    }
-		if (store->mbTransmitBeamwidth_id >= 0)
-		    {
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbTransmitBeamwidth_id, "type", store->mbTransmitBeamwidth_type);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbTransmitBeamwidth_type error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbTransmitBeamwidth_id, "long_name", store->mbTransmitBeamwidth_long_name);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbTransmitBeamwidth_long_name error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbTransmitBeamwidth_id, "name_code", store->mbTransmitBeamwidth_name_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbTransmitBeamwidth_name_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbTransmitBeamwidth_id, "units", store->mbTransmitBeamwidth_units);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbTransmitBeamwidth_units error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbTransmitBeamwidth_id, "unit_code", store->mbTransmitBeamwidth_unit_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbTransmitBeamwidth_unit_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbTransmitBeamwidth_id, "add_offset", &store->mbTransmitBeamwidth_add_offset);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbTransmitBeamwidth_add_offset error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbTransmitBeamwidth_id, "scale_factor", &store->mbTransmitBeamwidth_scale_factor);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbTransmitBeamwidth_scale_factor error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbTransmitBeamwidth_id, "minimum", &store->mbTransmitBeamwidth_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbTransmitBeamwidth_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbTransmitBeamwidth_id, "maximum", &store->mbTransmitBeamwidth_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbTransmitBeamwidth_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbTransmitBeamwidth_id, "valid_minimum", &store->mbTransmitBeamwidth_valid_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbTransmitBeamwidth_valid_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbTransmitBeamwidth_id, "valid_maximum", &store->mbTransmitBeamwidth_valid_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbTransmitBeamwidth_valid_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbTransmitBeamwidth_id, "missing_value", &store->mbTransmitBeamwidth_missing_value);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbTransmitBeamwidth_missing_value error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbTransmitBeamwidth_id, "format_C", store->mbTransmitBeamwidth_format_C);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbTransmitBeamwidth_format_C error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbTransmitBeamwidth_id, "orientation", store->mbTransmitBeamwidth_orientation);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbTransmitBeamwidth_orientation error: %s\n", nc_strerror(nc_status));
-		    }
-		if (store->mbReceiveBeamwidth_id >= 0)
-		    {
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbReceiveBeamwidth_id, "type", store->mbReceiveBeamwidth_type);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbReceiveBeamwidth_type error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbReceiveBeamwidth_id, "long_name", store->mbReceiveBeamwidth_long_name);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbReceiveBeamwidth_long_name error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbReceiveBeamwidth_id, "name_code", store->mbReceiveBeamwidth_name_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbReceiveBeamwidth_name_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbReceiveBeamwidth_id, "units", store->mbReceiveBeamwidth_units);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbReceiveBeamwidth_units error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbReceiveBeamwidth_id, "unit_code", store->mbReceiveBeamwidth_unit_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbReceiveBeamwidth_unit_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbReceiveBeamwidth_id, "add_offset", &store->mbReceiveBeamwidth_add_offset);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbReceiveBeamwidth_add_offset error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbReceiveBeamwidth_id, "scale_factor", &store->mbReceiveBeamwidth_scale_factor);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbReceiveBeamwidth_scale_factor error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbReceiveBeamwidth_id, "minimum", &store->mbReceiveBeamwidth_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbReceiveBeamwidth_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbReceiveBeamwidth_id, "maximum", &store->mbReceiveBeamwidth_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbReceiveBeamwidth_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbReceiveBeamwidth_id, "valid_minimum", &store->mbReceiveBeamwidth_valid_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbReceiveBeamwidth_valid_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbReceiveBeamwidth_id, "valid_maximum", &store->mbReceiveBeamwidth_valid_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbReceiveBeamwidth_valid_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbReceiveBeamwidth_id, "missing_value", &store->mbReceiveBeamwidth_missing_value);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbReceiveBeamwidth_missing_value error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbReceiveBeamwidth_id, "format_C", store->mbReceiveBeamwidth_format_C);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbReceiveBeamwidth_format_C error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbReceiveBeamwidth_id, "orientation", store->mbReceiveBeamwidth_orientation);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbReceiveBeamwidth_orientation error: %s\n", nc_strerror(nc_status));
-		    }
-		if (store->mbTransmitPulseLength_id >= 0)
-		    {
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbTransmitPulseLength_id, "type", store->mbTransmitPulseLength_type);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbTransmitPulseLength_type error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbTransmitPulseLength_id, "long_name", store->mbTransmitPulseLength_long_name);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbTransmitPulseLength_long_name error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbTransmitPulseLength_id, "name_code", store->mbTransmitPulseLength_name_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbTransmitPulseLength_name_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbTransmitPulseLength_id, "units", store->mbTransmitPulseLength_units);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbTransmitPulseLength_units error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbTransmitPulseLength_id, "unit_code", store->mbTransmitPulseLength_unit_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbTransmitPulseLength_unit_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbTransmitPulseLength_id, "add_offset", &store->mbTransmitPulseLength_add_offset);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbTransmitPulseLength_add_offset error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbTransmitPulseLength_id, "scale_factor", &store->mbTransmitPulseLength_scale_factor);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbTransmitPulseLength_scale_factor error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbTransmitPulseLength_id, "minimum", &store->mbTransmitPulseLength_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbTransmitPulseLength_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbTransmitPulseLength_id, "maximum", &store->mbTransmitPulseLength_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbTransmitPulseLength_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbTransmitPulseLength_id, "valid_minimum", &store->mbTransmitPulseLength_valid_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbTransmitPulseLength_valid_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbTransmitPulseLength_id, "valid_maximum", &store->mbTransmitPulseLength_valid_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbTransmitPulseLength_valid_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbTransmitPulseLength_id, "missing_value", &store->mbTransmitPulseLength_missing_value);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbTransmitPulseLength_missing_value error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbTransmitPulseLength_id, "format_C", store->mbTransmitPulseLength_format_C);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbTransmitPulseLength_format_C error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbTransmitPulseLength_id, "orientation", store->mbTransmitPulseLength_orientation);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbTransmitPulseLength_orientation error: %s\n", nc_strerror(nc_status));
-		    }
-		if (store->mbAlongDistance_id >= 0)
-		    {
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbAlongDistance_id, "type", store->mbAlongDistance_type);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAlongDistance_type error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbAlongDistance_id, "long_name", store->mbAlongDistance_long_name);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAlongDistance_long_name error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbAlongDistance_id, "name_code", store->mbAlongDistance_name_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAlongDistance_name_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbAlongDistance_id, "units", store->mbAlongDistance_units);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAlongDistance_units error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbAlongDistance_id, "unit_code", store->mbAlongDistance_unit_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAlongDistance_unit_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbAlongDistance_id, "add_offset", &store->mbAlongDistance_add_offset);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAlongDistance_add_offset error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbAlongDistance_id, "scale_factor", &store->mbAlongDistance_scale_factor);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAlongDistance_scale_factor error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbAlongDistance_id, "minimum", &store->mbAlongDistance_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAlongDistance_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbAlongDistance_id, "maximum", &store->mbAlongDistance_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAlongDistance_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbAlongDistance_id, "valid_minimum", &store->mbAlongDistance_valid_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAlongDistance_valid_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbAlongDistance_id, "valid_maximum", &store->mbAlongDistance_valid_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAlongDistance_valid_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbAlongDistance_id, "missing_value", &store->mbAlongDistance_missing_value);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAlongDistance_missing_value error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbAlongDistance_id, "format_C", store->mbAlongDistance_format_C);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAlongDistance_format_C error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbAlongDistance_id, "orientation", store->mbAlongDistance_orientation);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAlongDistance_orientation error: %s\n", nc_strerror(nc_status));
-		    }
-		if (store->mbAcrossDistance_id >= 0)
-		    {
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbAcrossDistance_id, "type", store->mbAcrossDistance_type);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAcrossDistance_type error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbAcrossDistance_id, "long_name", store->mbAcrossDistance_long_name);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAcrossDistance_long_name error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbAcrossDistance_id, "name_code", store->mbAcrossDistance_name_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAcrossDistance_name_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbAcrossDistance_id, "units", store->mbAcrossDistance_units);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAcrossDistance_units error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbAcrossDistance_id, "unit_code", store->mbAcrossDistance_unit_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAcrossDistance_unit_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbAcrossDistance_id, "add_offset", &store->mbAcrossDistance_add_offset);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAcrossDistance_add_offset error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbAcrossDistance_id, "scale_factor", &store->mbAcrossDistance_scale_factor);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAcrossDistance_scale_factor error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbAcrossDistance_id, "minimum", &store->mbAcrossDistance_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAcrossDistance_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbAcrossDistance_id, "maximum", &store->mbAcrossDistance_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAcrossDistance_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbAcrossDistance_id, "valid_minimum", &store->mbAcrossDistance_valid_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAcrossDistance_valid_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbAcrossDistance_id, "valid_maximum", &store->mbAcrossDistance_valid_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAcrossDistance_valid_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbAcrossDistance_id, "missing_value", &store->mbAcrossDistance_missing_value);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAcrossDistance_missing_value error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbAcrossDistance_id, "format_C", store->mbAcrossDistance_format_C);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAcrossDistance_format_C error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbAcrossDistance_id, "orientation", store->mbAcrossDistance_orientation);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAcrossDistance_orientation error: %s\n", nc_strerror(nc_status));
-		    }
-		if (store->mbDepth_id >= 0)
-		    {
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbDepth_id, "type", store->mbDepth_type);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbDepth_type error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbDepth_id, "long_name", store->mbDepth_long_name);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbDepth_long_name error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbDepth_id, "name_code", store->mbDepth_name_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbDepth_name_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbDepth_id, "units", store->mbDepth_units);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbDepth_units error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbDepth_id, "unit_code", store->mbDepth_unit_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbDepth_unit_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbDepth_id, "add_offset", &store->mbDepth_add_offset);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbDepth_add_offset error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbDepth_id, "scale_factor", &store->mbDepth_scale_factor);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbDepth_scale_factor error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbDepth_id, "minimum", &store->mbDepth_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbDepth_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbDepth_id, "maximum", &store->mbDepth_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbDepth_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbDepth_id, "valid_minimum", &store->mbDepth_valid_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbDepth_valid_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbDepth_id, "valid_maximum", &store->mbDepth_valid_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbDepth_valid_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbDepth_id, "missing_value", &store->mbDepth_missing_value);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbDepth_missing_value error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbDepth_id, "format_C", store->mbDepth_format_C);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbDepth_format_C error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbDepth_id, "orientation", store->mbDepth_orientation);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbDepth_orientation error: %s\n", nc_strerror(nc_status));
-		    }
-		if (store->mbAcrossBeamAngle_id >= 0)
-		    {
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbAcrossBeamAngle_id, "type", store->mbAcrossBeamAngle_type);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAcrossBeamAngle_type error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbAcrossBeamAngle_id, "long_name", store->mbAcrossBeamAngle_long_name);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAcrossBeamAngle_long_name error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbAcrossBeamAngle_id, "name_code", store->mbAcrossBeamAngle_name_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAcrossBeamAngle_name_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbAcrossBeamAngle_id, "units", store->mbAcrossBeamAngle_units);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAcrossBeamAngle_units error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbAcrossBeamAngle_id, "unit_code", store->mbAcrossBeamAngle_unit_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAcrossBeamAngle_unit_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_double(mb_io_ptr->ncid, store->mbAcrossBeamAngle_id, "add_offset", &store->mbAcrossBeamAngle_add_offset);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAcrossBeamAngle_add_offset error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_double(mb_io_ptr->ncid, store->mbAcrossBeamAngle_id, "scale_factor", &store->mbAcrossBeamAngle_scale_factor);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAcrossBeamAngle_scale_factor error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_double(mb_io_ptr->ncid, store->mbAcrossBeamAngle_id, "minimum", &store->mbAcrossBeamAngle_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAcrossBeamAngle_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_double(mb_io_ptr->ncid, store->mbAcrossBeamAngle_id, "maximum", &store->mbAcrossBeamAngle_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAcrossBeamAngle_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbAcrossBeamAngle_id, "valid_minimum", &store->mbAcrossBeamAngle_valid_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAcrossBeamAngle_valid_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbAcrossBeamAngle_id, "valid_maximum", &store->mbAcrossBeamAngle_valid_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAcrossBeamAngle_valid_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbAcrossBeamAngle_id, "missing_value", &store->mbAcrossBeamAngle_missing_value);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAcrossBeamAngle_missing_value error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbAcrossBeamAngle_id, "format_C", store->mbAcrossBeamAngle_format_C);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAcrossBeamAngle_format_C error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbAcrossBeamAngle_id, "orientation", store->mbAcrossBeamAngle_orientation);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAcrossBeamAngle_orientation error: %s\n", nc_strerror(nc_status));
-		    }
-		if (store->mbAzimutBeamAngle_id >= 0)
-		    {
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbAzimutBeamAngle_id, "type", store->mbAzimutBeamAngle_type);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAzimutBeamAngle_type error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbAzimutBeamAngle_id, "long_name", store->mbAzimutBeamAngle_long_name);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAzimutBeamAngle_long_name error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbAzimutBeamAngle_id, "name_code", store->mbAzimutBeamAngle_name_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAzimutBeamAngle_name_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbAzimutBeamAngle_id, "units", store->mbAzimutBeamAngle_units);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAzimutBeamAngle_units error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbAzimutBeamAngle_id, "unit_code", store->mbAzimutBeamAngle_unit_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAzimutBeamAngle_unit_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_double(mb_io_ptr->ncid, store->mbAzimutBeamAngle_id, "add_offset", &store->mbAzimutBeamAngle_add_offset);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAzimutBeamAngle_add_offset error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_double(mb_io_ptr->ncid, store->mbAzimutBeamAngle_id, "scale_factor", &store->mbAzimutBeamAngle_scale_factor);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAzimutBeamAngle_scale_factor error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_double(mb_io_ptr->ncid, store->mbAzimutBeamAngle_id, "minimum", &store->mbAzimutBeamAngle_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAzimutBeamAngle_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_double(mb_io_ptr->ncid, store->mbAzimutBeamAngle_id, "maximum", &store->mbAzimutBeamAngle_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAzimutBeamAngle_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbAzimutBeamAngle_id, "valid_minimum", &store->mbAzimutBeamAngle_valid_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAzimutBeamAngle_valid_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbAzimutBeamAngle_id, "valid_maximum", &store->mbAzimutBeamAngle_valid_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAzimutBeamAngle_valid_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbAzimutBeamAngle_id, "missing_value", &store->mbAzimutBeamAngle_missing_value);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAzimutBeamAngle_missing_value error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbAzimutBeamAngle_id, "format_C", store->mbAzimutBeamAngle_format_C);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAzimutBeamAngle_format_C error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbAzimutBeamAngle_id, "orientation", store->mbAzimutBeamAngle_orientation);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAzimutBeamAngle_orientation error: %s\n", nc_strerror(nc_status));
-		    }
-		if (store->mbRange_id >= 0)
-		    {
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbRange_id, "type", store->mbRange_type);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbRange_type error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbRange_id, "long_name", store->mbRange_long_name);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbRange_long_name error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbRange_id, "name_code", store->mbRange_name_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbRange_name_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbRange_id, "units", store->mbRange_units);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbRange_units error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbRange_id, "unit_code", store->mbRange_unit_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbRange_unit_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbRange_id, "add_offset", &store->mbRange_add_offset);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbRange_add_offset error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbRange_id, "scale_factor", &store->mbRange_scale_factor);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbRange_scale_factor error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbRange_id, "minimum", &store->mbRange_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbRange_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbRange_id, "maximum", &store->mbRange_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbRange_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbRange_id, "valid_minimum", &store->mbRange_valid_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbRange_valid_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbRange_id, "valid_maximum", &store->mbRange_valid_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbRange_valid_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbRange_id, "missing_value", &store->mbRange_missing_value);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbRange_missing_value error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbRange_id, "format_C", store->mbRange_format_C);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbRange_format_C error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbRange_id, "orientation", store->mbRange_orientation);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbRange_orientation error: %s\n", nc_strerror(nc_status));
-		    }
-		if (store->mbSoundingBias_id >= 0)
-		    {
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbSoundingBias_id, "type", store->mbSoundingBias_type);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSoundingBias_type error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbSoundingBias_id, "long_name", store->mbSoundingBias_long_name);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSoundingBias_long_name error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbSoundingBias_id, "name_code", store->mbSoundingBias_name_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSoundingBias_name_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbSoundingBias_id, "units", store->mbSoundingBias_units);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSoundingBias_units error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbSoundingBias_id, "unit_code", store->mbSoundingBias_unit_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSoundingBias_unit_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_double(mb_io_ptr->ncid, store->mbSoundingBias_id, "add_offset", &store->mbSoundingBias_add_offset);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSoundingBias_add_offset error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_double(mb_io_ptr->ncid, store->mbSoundingBias_id, "scale_factor", &store->mbSoundingBias_scale_factor);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSoundingBias_scale_factor error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_double(mb_io_ptr->ncid, store->mbSoundingBias_id, "minimum", &store->mbSoundingBias_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSoundingBias_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_double(mb_io_ptr->ncid, store->mbSoundingBias_id, "maximum", &store->mbSoundingBias_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSoundingBias_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbSoundingBias_id, "valid_minimum", &store->mbSoundingBias_valid_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSoundingBias_valid_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbSoundingBias_id, "valid_maximum", &store->mbSoundingBias_valid_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSoundingBias_valid_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbSoundingBias_id, "missing_value", &store->mbSoundingBias_missing_value);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSoundingBias_missing_value error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbSoundingBias_id, "format_C", store->mbSoundingBias_format_C);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSoundingBias_format_C error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbSoundingBias_id, "orientation", store->mbSoundingBias_orientation);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSoundingBias_orientation error: %s\n", nc_strerror(nc_status));
-		    }
-		if (store->mbSQuality_id >= 0)
-		    {
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbSQuality_id, "type", store->mbSQuality_type);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSQuality_type error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbSQuality_id, "long_name", store->mbSQuality_long_name);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSQuality_long_name error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbSQuality_id, "name_code", store->mbSQuality_name_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSQuality_name_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbSQuality_id, "units", store->mbSQuality_units);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSQuality_units error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbSQuality_id, "unit_code", store->mbSQuality_unit_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSQuality_unit_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbSQuality_id, "add_offset", &store->mbSQuality_add_offset);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSQuality_add_offset error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbSQuality_id, "scale_factor", &store->mbSQuality_scale_factor);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSQuality_scale_factor error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbSQuality_id, "minimum", &store->mbSQuality_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSQuality_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbSQuality_id, "maximum", &store->mbSQuality_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSQuality_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbSQuality_id, "valid_minimum", &store->mbSQuality_valid_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSQuality_valid_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbSQuality_id, "valid_maximum", &store->mbSQuality_valid_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSQuality_valid_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbSQuality_id, "missing_value", &store->mbSQuality_missing_value);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSQuality_missing_value error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbSQuality_id, "format_C", store->mbSQuality_format_C);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSQuality_format_C error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbSQuality_id, "orientation", store->mbSQuality_orientation);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSQuality_orientation error: %s\n", nc_strerror(nc_status));
-		    }
-		if (store->mbReflectivity_id >= 0)
-		    {
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbReflectivity_id, "type", store->mbReflectivity_type);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbReflectivity_type error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbReflectivity_id, "long_name", store->mbReflectivity_long_name);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbReflectivity_long_name error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbReflectivity_id, "name_code", store->mbReflectivity_name_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbReflectivity_name_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbReflectivity_id, "units", store->mbReflectivity_units);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbReflectivity_units error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbReflectivity_id, "unit_code", store->mbReflectivity_unit_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbReflectivity_unit_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_double(mb_io_ptr->ncid, store->mbReflectivity_id, "add_offset", &store->mbReflectivity_add_offset);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbReflectivity_add_offset error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_double(mb_io_ptr->ncid, store->mbReflectivity_id, "scale_factor", &store->mbReflectivity_scale_factor);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbReflectivity_scale_factor error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_double(mb_io_ptr->ncid, store->mbReflectivity_id, "minimum", &store->mbReflectivity_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbReflectivity_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_double(mb_io_ptr->ncid, store->mbReflectivity_id, "maximum", &store->mbReflectivity_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbReflectivity_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbReflectivity_id, "valid_minimum", &store->mbReflectivity_valid_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbReflectivity_valid_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbReflectivity_id, "valid_maximum", &store->mbReflectivity_valid_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbReflectivity_valid_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbReflectivity_id, "missing_value", &store->mbReflectivity_missing_value);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbReflectivity_missing_value error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbReflectivity_id, "format_C", store->mbReflectivity_format_C);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbReflectivity_format_C error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbReflectivity_id, "orientation", store->mbReflectivity_orientation);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbReflectivity_orientation error: %s\n", nc_strerror(nc_status));
-		    }
-		if (store->mbReceptionHeave_id >= 0)
-		    {
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbReceptionHeave_id, "type", store->mbSFlag_type);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSFlag_type error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbReceptionHeave_id, "long_name", store->mbSFlag_long_name);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSFlag_long_name error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbReceptionHeave_id, "name_code", store->mbSFlag_name_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSFlag_name_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbReceptionHeave_id, "units", store->mbSFlag_units);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSFlag_units error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbReceptionHeave_id, "unit_code", store->mbSFlag_unit_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSFlag_unit_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbReceptionHeave_id, "add_offset", &store->mbSFlag_add_offset);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSFlag_add_offset error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbReceptionHeave_id, "scale_factor", &store->mbSFlag_scale_factor);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSFlag_scale_factor error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbReceptionHeave_id, "minimum", &store->mbSFlag_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSFlag_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbReceptionHeave_id, "maximum", &store->mbSFlag_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSFlag_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbReceptionHeave_id, "valid_minimum", &store->mbSFlag_valid_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSFlag_valid_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbReceptionHeave_id, "valid_maximum", &store->mbSFlag_valid_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSFlag_valid_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbReceptionHeave_id, "missing_value", &store->mbSFlag_missing_value);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSFlag_missing_value error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbReceptionHeave_id, "format_C", store->mbSFlag_format_C);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSFlag_format_C error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbReceptionHeave_id, "orientation", store->mbSFlag_orientation);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSFlag_orientation error: %s\n", nc_strerror(nc_status));
-		    }
-		if (store->mbAlongSlope_id >= 0)
-		    {
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbAlongSlope_id, "type", store->mbSFlag_type);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSFlag_type error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbAlongSlope_id, "long_name", store->mbSFlag_long_name);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSFlag_long_name error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbAlongSlope_id, "name_code", store->mbSFlag_name_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSFlag_name_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbAlongSlope_id, "units", store->mbSFlag_units);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSFlag_units error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbAlongSlope_id, "unit_code", store->mbSFlag_unit_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSFlag_unit_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbAlongSlope_id, "add_offset", &store->mbSFlag_add_offset);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSFlag_add_offset error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbAlongSlope_id, "scale_factor", &store->mbSFlag_scale_factor);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSFlag_scale_factor error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbAlongSlope_id, "minimum", &store->mbSFlag_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSFlag_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbAlongSlope_id, "maximum", &store->mbSFlag_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSFlag_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbAlongSlope_id, "valid_minimum", &store->mbSFlag_valid_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSFlag_valid_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbAlongSlope_id, "valid_maximum", &store->mbSFlag_valid_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSFlag_valid_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbAlongSlope_id, "missing_value", &store->mbSFlag_missing_value);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSFlag_missing_value error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbAlongSlope_id, "format_C", store->mbSFlag_format_C);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSFlag_format_C error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbAlongSlope_id, "orientation", store->mbSFlag_orientation);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSFlag_orientation error: %s\n", nc_strerror(nc_status));
-		    }
-		if (store->mbAcrossSlope_id >= 0)
-		    {
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbAcrossSlope_id, "type", store->mbSFlag_type);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSFlag_type error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbAcrossSlope_id, "long_name", store->mbSFlag_long_name);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSFlag_long_name error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbAcrossSlope_id, "name_code", store->mbSFlag_name_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSFlag_name_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbAcrossSlope_id, "units", store->mbSFlag_units);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSFlag_units error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbAcrossSlope_id, "unit_code", store->mbSFlag_unit_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSFlag_unit_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbAcrossSlope_id, "add_offset", &store->mbSFlag_add_offset);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSFlag_add_offset error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbAcrossSlope_id, "scale_factor", &store->mbSFlag_scale_factor);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSFlag_scale_factor error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbAcrossSlope_id, "minimum", &store->mbSFlag_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSFlag_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbAcrossSlope_id, "maximum", &store->mbSFlag_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSFlag_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbAcrossSlope_id, "valid_minimum", &store->mbSFlag_valid_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSFlag_valid_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbAcrossSlope_id, "valid_maximum", &store->mbSFlag_valid_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSFlag_valid_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbAcrossSlope_id, "missing_value", &store->mbSFlag_missing_value);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSFlag_missing_value error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbAcrossSlope_id, "format_C", store->mbSFlag_format_C);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSFlag_format_C error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbAcrossSlope_id, "orientation", store->mbSFlag_orientation);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSFlag_orientation error: %s\n", nc_strerror(nc_status));
-		    }
-		if (store->mbSFlag_id >= 0)
-		    {
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbSFlag_id, "type", store->mbSFlag_type);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSFlag_type error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbSFlag_id, "long_name", store->mbSFlag_long_name);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSFlag_long_name error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbSFlag_id, "name_code", store->mbSFlag_name_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSFlag_name_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbSFlag_id, "units", store->mbSFlag_units);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSFlag_units error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbSFlag_id, "unit_code", store->mbSFlag_unit_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSFlag_unit_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbSFlag_id, "add_offset", &store->mbSFlag_add_offset);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSFlag_add_offset error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbSFlag_id, "scale_factor", &store->mbSFlag_scale_factor);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSFlag_scale_factor error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbSFlag_id, "minimum", &store->mbSFlag_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSFlag_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbSFlag_id, "maximum", &store->mbSFlag_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSFlag_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbSFlag_id, "valid_minimum", &store->mbSFlag_valid_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSFlag_valid_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbSFlag_id, "valid_maximum", &store->mbSFlag_valid_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSFlag_valid_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbSFlag_id, "missing_value", &store->mbSFlag_missing_value);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSFlag_missing_value error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbSFlag_id, "format_C", store->mbSFlag_format_C);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSFlag_format_C error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbSFlag_id, "orientation", store->mbSFlag_orientation);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSFlag_orientation error: %s\n", nc_strerror(nc_status));
-		    }
-		if (store->mbSLengthOfDetection_id >= 0)
-		    {
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbSLengthOfDetection_id, "type", store->mbSFlag_type);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSFlag_type error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbSLengthOfDetection_id, "long_name", store->mbSFlag_long_name);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSFlag_long_name error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbSLengthOfDetection_id, "name_code", store->mbSFlag_name_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSFlag_name_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbSLengthOfDetection_id, "units", store->mbSFlag_units);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSFlag_units error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbSLengthOfDetection_id, "unit_code", store->mbSFlag_unit_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSFlag_unit_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbSLengthOfDetection_id, "add_offset", &store->mbSFlag_add_offset);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSFlag_add_offset error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbSLengthOfDetection_id, "scale_factor", &store->mbSFlag_scale_factor);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSFlag_scale_factor error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbSLengthOfDetection_id, "minimum", &store->mbSFlag_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSFlag_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbSLengthOfDetection_id, "maximum", &store->mbSFlag_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSFlag_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbSLengthOfDetection_id, "valid_minimum", &store->mbSFlag_valid_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSFlag_valid_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbSLengthOfDetection_id, "valid_maximum", &store->mbSFlag_valid_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSFlag_valid_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbSLengthOfDetection_id, "missing_value", &store->mbSFlag_missing_value);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSFlag_missing_value error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbSLengthOfDetection_id, "format_C", store->mbSFlag_format_C);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSFlag_format_C error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbSLengthOfDetection_id, "orientation", store->mbSFlag_orientation);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSFlag_orientation error: %s\n", nc_strerror(nc_status));
-		    }
-		if (store->mbAntenna_id >= 0)
-		    {
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbAntenna_id, "type", store->mbAntenna_type);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAntenna_type error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbAntenna_id, "long_name", store->mbAntenna_long_name);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAntenna_long_name error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbAntenna_id, "name_code", store->mbAntenna_name_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAntenna_name_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbAntenna_id, "units", store->mbAntenna_units);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAntenna_units error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbAntenna_id, "unit_code", store->mbAntenna_unit_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAntenna_unit_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbAntenna_id, "add_offset", &store->mbAntenna_add_offset);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAntenna_add_offset error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbAntenna_id, "scale_factor", &store->mbAntenna_scale_factor);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAntenna_scale_factor error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbAntenna_id, "minimum", &store->mbAntenna_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAntenna_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbAntenna_id, "maximum", &store->mbAntenna_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAntenna_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbAntenna_id, "valid_minimum", &store->mbAntenna_valid_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAntenna_valid_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbAntenna_id, "valid_maximum", &store->mbAntenna_valid_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAntenna_valid_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbAntenna_id, "missing_value", &store->mbAntenna_missing_value);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAntenna_missing_value error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbAntenna_id, "format_C", store->mbAntenna_format_C);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAntenna_format_C error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbAntenna_id, "orientation", store->mbAntenna_orientation);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAntenna_orientation error: %s\n", nc_strerror(nc_status));
-		    }
-		if (store->mbBeamBias_id >= 0)
-		    {
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbBeamBias_id, "type", store->mbBeamBias_type);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbBeamBias_type error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbBeamBias_id, "long_name", store->mbBeamBias_long_name);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbBeamBias_long_name error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbBeamBias_id, "name_code", store->mbBeamBias_name_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbBeamBias_name_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbBeamBias_id, "units", store->mbBeamBias_units);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbBeamBias_units error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbBeamBias_id, "unit_code", store->mbBeamBias_unit_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbBeamBias_unit_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_double(mb_io_ptr->ncid, store->mbBeamBias_id, "add_offset", &store->mbBeamBias_add_offset);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbBeamBias_add_offset error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_double(mb_io_ptr->ncid, store->mbBeamBias_id, "scale_factor", &store->mbBeamBias_scale_factor);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbBeamBias_scale_factor error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbBeamBias_id, "minimum", &store->mbBeamBias_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbBeamBias_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbBeamBias_id, "maximum", &store->mbBeamBias_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbBeamBias_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbBeamBias_id, "valid_minimum", &store->mbBeamBias_valid_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbBeamBias_valid_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbBeamBias_id, "valid_maximum", &store->mbBeamBias_valid_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbBeamBias_valid_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbBeamBias_id, "missing_value", &store->mbBeamBias_missing_value);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbBeamBias_missing_value error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbBeamBias_id, "format_C", store->mbBeamBias_format_C);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbBeamBias_format_C error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbBeamBias_id, "orientation", store->mbBeamBias_orientation);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbBeamBias_orientation error: %s\n", nc_strerror(nc_status));
-		    }
-		if (store->mbBFlag_id >= 0)
-		    {
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbBFlag_id, "type", store->mbBFlag_type);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbBFlag_type error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbBFlag_id, "long_name", store->mbBFlag_long_name);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbBFlag_long_name error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbBFlag_id, "name_code", store->mbBFlag_name_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbBFlag_name_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbBFlag_id, "units", store->mbBFlag_units);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbBFlag_units error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbBFlag_id, "unit_code", store->mbBFlag_unit_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbBFlag_unit_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbBFlag_id, "add_offset", &store->mbBFlag_add_offset);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbBFlag_add_offset error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbBFlag_id, "scale_factor", &store->mbBFlag_scale_factor);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbBFlag_scale_factor error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbBFlag_id, "minimum", &store->mbBFlag_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbBFlag_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbBFlag_id, "maximum", &store->mbBFlag_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbBFlag_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbBFlag_id, "valid_minimum", &store->mbBFlag_valid_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbBFlag_valid_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbBFlag_id, "valid_maximum", &store->mbBFlag_valid_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbBFlag_valid_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbBFlag_id, "missing_value", &store->mbBFlag_missing_value);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbBFlag_missing_value error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbBFlag_id, "format_C", store->mbBFlag_format_C);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbBFlag_format_C error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbBFlag_id, "orientation", store->mbBFlag_orientation);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbBFlag_orientation error: %s\n", nc_strerror(nc_status));
-		    }
-		if (store->mbBeam_id >= 0)
-		    {
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbBeam_id, "type", store->mbBeam_type);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbBeam_type error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbBeam_id, "long_name", store->mbBeam_long_name);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbBeam_long_name error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbBeam_id, "name_code", store->mbBeam_name_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbBeam_name_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbBeam_id, "units", store->mbBeam_units);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbBeam_units error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbBeam_id, "unit_code", store->mbBeam_unit_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbBeam_unit_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbBeam_id, "add_offset", &store->mbBeam_add_offset);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbBeam_add_offset error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbBeam_id, "scale_factor", &store->mbBeam_scale_factor);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbBeam_scale_factor error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbBeam_id, "minimum", &store->mbBeam_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbBeam_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbBeam_id, "maximum", &store->mbBeam_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbBeam_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbBeam_id, "valid_minimum", &store->mbBeam_valid_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbBeam_valid_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbBeam_id, "valid_maximum", &store->mbBeam_valid_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbBeam_valid_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbBeam_id, "missing_value", &store->mbBeam_missing_value);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbBeam_missing_value error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbBeam_id, "format_C", store->mbBeam_format_C);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbBeam_format_C error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbBeam_id, "orientation", store->mbBeam_orientation);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbBeam_orientation error: %s\n", nc_strerror(nc_status));
-		    }
-		if (store->mbAFlag_id >= 0)
-		    {
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbAFlag_id, "type", store->mbAFlag_type);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAFlag_type error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbAFlag_id, "long_name", store->mbAFlag_long_name);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAFlag_long_name error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbAFlag_id, "name_code", store->mbAFlag_name_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAFlag_name_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbAFlag_id, "units", store->mbAFlag_units);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAFlag_units error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbAFlag_id, "unit_code", store->mbAFlag_unit_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAFlag_unit_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbAFlag_id, "add_offset", &store->mbAFlag_add_offset);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAFlag_add_offset error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbAFlag_id, "scale_factor", &store->mbAFlag_scale_factor);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAFlag_scale_factor error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbAFlag_id, "minimum", &store->mbAFlag_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAFlag_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbAFlag_id, "maximum", &store->mbAFlag_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAFlag_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbAFlag_id, "valid_minimum", &store->mbAFlag_valid_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAFlag_valid_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbAFlag_id, "valid_maximum", &store->mbAFlag_valid_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAFlag_valid_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbAFlag_id, "missing_value", &store->mbAFlag_missing_value);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAFlag_missing_value error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbAFlag_id, "format_C", store->mbAFlag_format_C);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAFlag_format_C error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbAFlag_id, "orientation", store->mbAFlag_orientation);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAFlag_orientation error: %s\n", nc_strerror(nc_status));
-		    }
-		if (store->mbVelProfilRef_id >= 0)
-		    {
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbVelProfilRef_id, "type", store->mbVelProfilRef_type);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbVelProfilRef_type error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbVelProfilRef_id, "long_name", store->mbVelProfilRef_long_name);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbVelProfilRef_long_name error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbVelProfilRef_id, "name_code", store->mbVelProfilRef_name_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbVelProfilRef_name_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbVelProfilRef_id, "type", store->mbVelProfilRef_type);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbVelProfilRef_type error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbVelProfilRef_id, "long_name", store->mbVelProfilRef_long_name);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbVelProfilRef_long_name error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbVelProfilRef_id, "name_code", store->mbVelProfilRef_name_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbVelProfilRef_name_code error: %s\n", nc_strerror(nc_status));
-		    }
-		if (store->mbVelProfilIdx_id >= 0)
-		    {
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbVelProfilIdx_id, "add_offset", &store->mbVelProfilIdx_add_offset);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbVelProfilIdx_add_offset error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbVelProfilIdx_id, "scale_factor", &store->mbVelProfilIdx_scale_factor);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbVelProfilIdx_scale_factor error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbVelProfilIdx_id, "minimum", &store->mbVelProfilIdx_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbVelProfilIdx_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbVelProfilIdx_id, "maximum", &store->mbVelProfilIdx_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbVelProfilIdx_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbVelProfilIdx_id, "valid_minimum", &store->mbVelProfilIdx_valid_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbVelProfilIdx_valid_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbVelProfilIdx_id, "valid_maximum", &store->mbVelProfilIdx_valid_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbVelProfilIdx_valid_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbVelProfilIdx_id, "missing_value", &store->mbVelProfilIdx_missing_value);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbVelProfilIdx_missing_value error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbVelProfilIdx_id, "format_C", store->mbVelProfilIdx_format_C);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbVelProfilIdx_format_C error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbVelProfilIdx_id, "orientation", store->mbVelProfilIdx_orientation);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbVelProfilIdx_orientation error: %s\n", nc_strerror(nc_status));
-		    }
-		if (store->mbVelProfilDate_id >= 0)
-		    {
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbVelProfilDate_id, "type", store->mbVelProfilDate_type);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbVelProfilDate_type error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbVelProfilDate_id, "long_name", store->mbVelProfilDate_long_name);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbVelProfilDate_long_name error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbVelProfilDate_id, "name_code", store->mbVelProfilDate_name_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbVelProfilDate_name_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbVelProfilDate_id, "units", store->mbVelProfilDate_units);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbVelProfilDate_units error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbVelProfilDate_id, "unit_code", store->mbVelProfilDate_unit_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbVelProfilDate_unit_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbVelProfilDate_id, "add_offset", &store->mbVelProfilDate_add_offset);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbVelProfilDate_add_offset error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbVelProfilDate_id, "scale_factor", &store->mbVelProfilDate_scale_factor);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbVelProfilDate_scale_factor error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbVelProfilDate_id, "minimum", &store->mbVelProfilDate_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbVelProfilDate_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbVelProfilDate_id, "maximum", &store->mbVelProfilDate_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbVelProfilDate_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbVelProfilDate_id, "valid_minimum", &store->mbVelProfilDate_valid_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbVelProfilDate_valid_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbVelProfilDate_id, "valid_maximum", &store->mbVelProfilDate_valid_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbVelProfilDate_valid_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbVelProfilDate_id, "missing_value", &store->mbVelProfilDate_missing_value);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbVelProfilDate_missing_value error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbVelProfilDate_id, "format_C", store->mbVelProfilDate_format_C);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbVelProfilDate_format_C error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbVelProfilDate_id, "orientation", store->mbVelProfilDate_orientation);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbVelProfilDate_orientation error: %s\n", nc_strerror(nc_status));
-		    }
-		if (store->mbVelProfilTime_id >= 0)
-		    {
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbVelProfilTime_id, "type", store->mbVelProfilTime_type);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbVelProfilTime_type error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbVelProfilTime_id, "long_name", store->mbVelProfilTime_long_name);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbVelProfilTime_long_name error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbVelProfilTime_id, "name_code", store->mbVelProfilTime_name_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbVelProfilTime_name_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbVelProfilTime_id, "units", store->mbVelProfilTime_units);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbVelProfilTime_units error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbVelProfilTime_id, "unit_code", store->mbVelProfilTime_unit_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbVelProfilTime_unit_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbVelProfilTime_id, "add_offset", &store->mbVelProfilTime_add_offset);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbVelProfilTime_add_offset error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbVelProfilTime_id, "scale_factor", &store->mbVelProfilTime_scale_factor);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbVelProfilTime_scale_factor error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbVelProfilTime_id, "minimum", &store->mbVelProfilTime_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbVelProfilTime_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbVelProfilTime_id, "maximum", &store->mbVelProfilTime_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbVelProfilTime_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbVelProfilTime_id, "valid_minimum", &store->mbVelProfilTime_valid_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbVelProfilTime_valid_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbVelProfilTime_id, "valid_maximum", &store->mbVelProfilTime_valid_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbVelProfilTime_valid_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbVelProfilTime_id, "missing_value", &store->mbVelProfilTime_missing_value);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbVelProfilTime_missing_value error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbVelProfilTime_id, "format_C", store->mbVelProfilTime_format_C);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbVelProfilTime_format_C error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbVelProfilTime_id, "orientation", store->mbVelProfilTime_orientation);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbVelProfilTime_orientation error: %s\n", nc_strerror(nc_status));
-		    }
-		if (nc_status != NC_NOERR)
-		    {
-		    status = MB_FAILURE;
-		    *error = MB_ERROR_EOF;
-		    }
-
-		/* print input debug statements */
-		if (verbose >= 2)
-		    {
-		    fprintf(stderr,"\ndbg2  NetCDF variable attributes read in function <%s>\n",function_name);
-		    fprintf(stderr,"dbg2  Variable attributes:\n");
-		    fprintf(stderr,"dbg2       status:                  %d\n", status);
-		    fprintf(stderr,"dbg2       error:                   %d\n", *error);
-		    fprintf(stderr,"dbg2       nc_status:               %d\n", nc_status);
-		    fprintf(stderr,"dbg2       mbHistCode_long_name:		%s\n", store->mbHistCode_long_name);
-		    fprintf(stderr,"dbg2       mbHistCode_name_code:		%s\n", store->mbHistCode_name_code);
-		    fprintf(stderr,"dbg2       mbHistCode_units:	    %s\n", store->mbHistCode_units);
-		    fprintf(stderr,"dbg2       mbHistCode_unit_code:		    %s\n", store->mbHistCode_unit_code);
-		    fprintf(stderr,"dbg2       mbHistCode_add_offset:		    %d\n", store->mbHistCode_add_offset);
-		    fprintf(stderr,"dbg2       mbHistCode_scale_factor:		%d\n", store->mbHistCode_scale_factor);
-		    fprintf(stderr,"dbg2       mbHistCode_minimum:	    %d\n", store->mbHistCode_minimum);
-		    fprintf(stderr,"dbg2       mbHistCode_maximum:	    %d\n", store->mbHistCode_maximum);
-		    fprintf(stderr,"dbg2       mbHistCode_valid_minimum:	    %d\n", store->mbHistCode_valid_minimum);
-		    fprintf(stderr,"dbg2       mbHistCode_valid_maximum:	%d\n", store->mbHistCode_valid_maximum);
-		    fprintf(stderr,"dbg2       mbHistCode_missing_value:	%d\n", store->mbHistCode_missing_value);
-		    fprintf(stderr,"dbg2       mbHistCode_format_C:	    %s\n", store->mbHistCode_format_C);
-		    fprintf(stderr,"dbg2       mbHistCode_orientation:		%s\n", store->mbHistCode_orientation);
-		    fprintf(stderr,"dbg2       mbHistAutor_type:	    %s\n", store->mbHistAutor_type);
-		    fprintf(stderr,"dbg2       mbHistAutor_long_name:		%s\n", store->mbHistAutor_long_name);
-		    fprintf(stderr,"dbg2       mbHistAutor_name_code:		%s\n", store->mbHistAutor_name_code);
-		    fprintf(stderr,"dbg2       mbHistModule_type:	    %s\n", store->mbHistModule_type);
-		    fprintf(stderr,"dbg2       mbHistModule_long_name:		%s\n", store->mbHistModule_long_name);
-		    fprintf(stderr,"dbg2       mbHistModule_name_code:		%s\n", store->mbHistModule_name_code);
-		    fprintf(stderr,"dbg2       mbHistComment_type:	    %s\n", store->mbHistComment_type);
-		    fprintf(stderr,"dbg2       mbHistComment_long_name:		%s\n", store->mbHistComment_long_name);
-		    fprintf(stderr,"dbg2       mbHistComment_name_code:		%s\n", store->mbHistComment_name_code);
-		    fprintf(stderr,"dbg2       mbCycle_type:		%s\n", store->mbCycle_type);
-		    fprintf(stderr,"dbg2       mbCycle_long_name:		%s\n", store->mbCycle_long_name);
-		    fprintf(stderr,"dbg2       mbCycle_name_code:		%s\n", store->mbCycle_name_code);
-		    fprintf(stderr,"dbg2       mbCycle_units:		%s\n", store->mbCycle_units);
-		    fprintf(stderr,"dbg2       mbCycle_unit_code:		%s\n", store->mbCycle_unit_code);
-		    fprintf(stderr,"dbg2       mbCycle_add_offset:		%d\n", store->mbCycle_add_offset);
-		    fprintf(stderr,"dbg2       mbCycle_scale_factor:		%d\n", store->mbCycle_scale_factor);
-		    fprintf(stderr,"dbg2       mbCycle_minimum:		%d\n", store->mbCycle_minimum);
-		    fprintf(stderr,"dbg2       mbCycle_maximum:		%d\n", store->mbCycle_maximum);
-		    fprintf(stderr,"dbg2       mbCycle_valid_minimum:		%d\n", store->mbCycle_valid_minimum);
-		    fprintf(stderr,"dbg2       mbCycle_valid_maximum:		%d\n", store->mbCycle_valid_maximum);
-		    fprintf(stderr,"dbg2       mbCycle_missing_value:		%d\n", store->mbCycle_missing_value);
-		    fprintf(stderr,"dbg2       mbCycle_format_C:		%s\n", store->mbCycle_format_C);
-		    fprintf(stderr,"dbg2       mbCycle_orientation:		%s\n", store->mbCycle_orientation);
-		    fprintf(stderr,"dbg2       mbDate_type:		%s\n", store->mbDate_type);
-		    fprintf(stderr,"dbg2       mbDate_long_name:		%s\n", store->mbDate_long_name);
-		    fprintf(stderr,"dbg2       mbDate_name_code:		%s\n", store->mbDate_name_code);
-		    fprintf(stderr,"dbg2       mbDate_units:		%s\n", store->mbDate_units);
-		    fprintf(stderr,"dbg2       mbDate_unit_code:		%s\n", store->mbDate_unit_code);
-		    fprintf(stderr,"dbg2       mbDate_add_offset:		%d\n", store->mbDate_add_offset);
-		    fprintf(stderr,"dbg2       mbDate_scale_factor:		%d\n", store->mbDate_scale_factor);
-		    fprintf(stderr,"dbg2       mbDate_minimum:		%d\n", store->mbDate_minimum);
-		    fprintf(stderr,"dbg2       mbDate_maximum:		%d\n", store->mbDate_maximum);
-		    fprintf(stderr,"dbg2       mbDate_valid_minimum:		%d\n", store->mbDate_valid_minimum);
-		    fprintf(stderr,"dbg2       mbDate_valid_maximum:		%d\n", store->mbDate_valid_maximum);
-		    fprintf(stderr,"dbg2       mbDate_missing_value:		%d\n", store->mbDate_missing_value);
-		    fprintf(stderr,"dbg2       mbDate_format_C:		%s\n", store->mbDate_format_C);
-		    fprintf(stderr,"dbg2       mbDate_orientation:		%s\n", store->mbDate_orientation);
-		    fprintf(stderr,"dbg2       mbTime_type:		%s\n", store->mbTime_type);
-		    fprintf(stderr,"dbg2       mbTime_long_name:		%s\n", store->mbTime_long_name);
-		    fprintf(stderr,"dbg2       mbTime_name_code:		%s\n", store->mbTime_name_code);
-		    fprintf(stderr,"dbg2       mbTime_units:		%s\n", store->mbTime_units);
-		    fprintf(stderr,"dbg2       mbTime_unit_code:		%s\n", store->mbTime_unit_code);
-		    fprintf(stderr,"dbg2       mbTime_add_offset:		%d\n", store->mbTime_add_offset);
-		    fprintf(stderr,"dbg2       mbTime_scale_factor:		%d\n", store->mbTime_scale_factor);
-		    fprintf(stderr,"dbg2       mbTime_minimum:		%d\n", store->mbTime_minimum);
-		    fprintf(stderr,"dbg2       mbTime_maximum:		%d\n", store->mbTime_maximum);
-		    fprintf(stderr,"dbg2       mbTime_valid_minimum:		%d\n", store->mbTime_valid_minimum);
-		    fprintf(stderr,"dbg2       mbTime_valid_maximum:		%d\n", store->mbTime_valid_maximum);
-		    fprintf(stderr,"dbg2       mbTime_missing_value:		%d\n", store->mbTime_missing_value);
-		    fprintf(stderr,"dbg2       mbTime_format_C:		%s\n", store->mbTime_format_C);
-		    fprintf(stderr,"dbg2       mbTime_orientation:		%s\n", store->mbTime_orientation);
-		    fprintf(stderr,"dbg2       mbOrdinate_type:		%s\n", store->mbOrdinate_type);
-		    fprintf(stderr,"dbg2       mbOrdinate_long_name:		%s\n", store->mbOrdinate_long_name);
-		    fprintf(stderr,"dbg2       mbOrdinate_name_code:		%s\n", store->mbOrdinate_name_code);
-		    fprintf(stderr,"dbg2       mbOrdinate_units:		%s\n", store->mbOrdinate_units);
-		    fprintf(stderr,"dbg2       mbOrdinate_unit_code:		%s\n", store->mbOrdinate_unit_code);
-		    fprintf(stderr,"dbg2       mbOrdinate_add_offset:		%f\n", store->mbOrdinate_add_offset);
-		    fprintf(stderr,"dbg2       mbOrdinate_scale_factor:		%f\n", store->mbOrdinate_scale_factor);
-		    fprintf(stderr,"dbg2       mbOrdinate_minimum:		%f\n", store->mbOrdinate_minimum);
-		    fprintf(stderr,"dbg2       mbOrdinate_maximum:		%f\n", store->mbOrdinate_maximum);
-		    fprintf(stderr,"dbg2       mbOrdinate_valid_minimum:		%d\n", store->mbOrdinate_valid_minimum);
-		    fprintf(stderr,"dbg2       mbOrdinate_valid_maximum:		%d\n", store->mbOrdinate_valid_maximum);
-		    fprintf(stderr,"dbg2       mbOrdinate_missing_value:		%d\n", store->mbOrdinate_missing_value);
-		    fprintf(stderr,"dbg2       mbOrdinate_format_C:		%s\n", store->mbOrdinate_format_C);
-		    fprintf(stderr,"dbg2       mbOrdinate_orientation:		%s\n", store->mbOrdinate_orientation);
-		    fprintf(stderr,"dbg2       mbAbscissa_type:		%s\n", store->mbAbscissa_type);
-		    fprintf(stderr,"dbg2       mbAbscissa_long_name:		%s\n", store->mbAbscissa_long_name);
-		    fprintf(stderr,"dbg2       mbAbscissa_name_code:		%s\n", store->mbAbscissa_name_code);
-		    fprintf(stderr,"dbg2       mbAbscissa_units:		%s\n", store->mbAbscissa_units);
-		    fprintf(stderr,"dbg2       mbAbscissa_unit_code:		%s\n", store->mbAbscissa_unit_code);
-		    fprintf(stderr,"dbg2       mbAbscissa_add_offset:		%f\n", store->mbAbscissa_add_offset);
-		    fprintf(stderr,"dbg2       mbAbscissa_scale_factor:		%f\n", store->mbAbscissa_scale_factor);
-		    fprintf(stderr,"dbg2       mbAbscissa_minimum:		%f\n", store->mbAbscissa_minimum);
-		    fprintf(stderr,"dbg2       mbAbscissa_maximum:		%f\n", store->mbAbscissa_maximum);
-		    fprintf(stderr,"dbg2       mbAbscissa_valid_minimum:		%d\n", store->mbAbscissa_valid_minimum);
-		    fprintf(stderr,"dbg2       mbAbscissa_valid_maximum:		%d\n", store->mbAbscissa_valid_maximum);
-		    fprintf(stderr,"dbg2       mbAbscissa_missing_value:		%d\n", store->mbAbscissa_missing_value);
-		    fprintf(stderr,"dbg2       mbAbscissa_format_C:		%s\n", store->mbAbscissa_format_C);
-		    fprintf(stderr,"dbg2       mbAbscissa_orientation:		%s\n", store->mbAbscissa_orientation);
-		    fprintf(stderr,"dbg2       mbFrequency_type:		%s\n", store->mbFrequency_type);
-		    fprintf(stderr,"dbg2       mbFrequency_long_name:		%s\n", store->mbFrequency_long_name);
-		    fprintf(stderr,"dbg2       mbFrequency_name_code:		%s\n", store->mbFrequency_name_code);
-		    fprintf(stderr,"dbg2       mbFrequency_units:		%s\n", store->mbFrequency_units);
-		    fprintf(stderr,"dbg2       mbFrequency_unit_code:		%s\n", store->mbFrequency_unit_code);
-		    fprintf(stderr,"dbg2       mbFrequency_add_offset:		%d\n", store->mbFrequency_add_offset);
-		    fprintf(stderr,"dbg2       mbFrequency_scale_factor:		%d\n", store->mbFrequency_scale_factor);
-		    fprintf(stderr,"dbg2       mbFrequency_minimum:		%d\n", store->mbFrequency_minimum);
-		    fprintf(stderr,"dbg2       mbFrequency_maximum:		%d\n", store->mbFrequency_maximum);
-		    fprintf(stderr,"dbg2       mbFrequency_valid_minimum:		%d\n", store->mbFrequency_valid_minimum);
-		    fprintf(stderr,"dbg2       mbFrequency_valid_maximum:		%d\n", store->mbFrequency_valid_maximum);
-		    fprintf(stderr,"dbg2       mbFrequency_missing_value:		%d\n", store->mbFrequency_missing_value);
-		    fprintf(stderr,"dbg2       mbFrequency_format_C:		%s\n", store->mbFrequency_format_C);
-		    fprintf(stderr,"dbg2       mbFrequency_orientation:			%s\n", store->mbFrequency_orientation);
-		    fprintf(stderr,"dbg2       mbSounderMode_type:			%s\n", store->mbSounderMode_type);
-		    fprintf(stderr,"dbg2       mbSounderMode_long_name:			%s\n", store->mbSounderMode_long_name);
-		    fprintf(stderr,"dbg2       mbSounderMode_name_code:			%s\n", store->mbSounderMode_name_code);
-		    fprintf(stderr,"dbg2       mbSounderMode_units:			%s\n", store->mbSounderMode_units);
-		    fprintf(stderr,"dbg2       mbSounderMode_unit_code:			%s\n", store->mbSounderMode_unit_code);
-		    fprintf(stderr,"dbg2       mbSounderMode_add_offset:		%d\n", store->mbSounderMode_add_offset);
-		    fprintf(stderr,"dbg2       mbSounderMode_scale_factor:		%d\n", store->mbSounderMode_scale_factor);
-		    fprintf(stderr,"dbg2       mbSounderMode_minimum:			%d\n", store->mbSounderMode_minimum);
-		    fprintf(stderr,"dbg2       mbSounderMode_maximum:			%d\n", store->mbSounderMode_maximum);
-		    fprintf(stderr,"dbg2       mbSounderMode_valid_minimum:		%d\n", store->mbSounderMode_valid_minimum);
-		    fprintf(stderr,"dbg2       mbSounderMode_valid_maximum:		%d\n", store->mbSounderMode_valid_maximum);
-		    fprintf(stderr,"dbg2       mbSounderMode_missing_value:		%d\n", store->mbSounderMode_missing_value);
-		    fprintf(stderr,"dbg2       mbSounderMode_format_C:			%s\n", store->mbSounderMode_format_C);
-		    fprintf(stderr,"dbg2       mbSounderMode_orientation:		%s\n", store->mbSounderMode_orientation);
-		    fprintf(stderr,"dbg2       mbReferenceDepth_type:			%s\n", store->mbReferenceDepth_type);
-		    fprintf(stderr,"dbg2       mbReferenceDepth_long_name:		%s\n", store->mbReferenceDepth_long_name);
-		    fprintf(stderr,"dbg2       mbReferenceDepth_name_code:		%s\n", store->mbReferenceDepth_name_code);
-		    fprintf(stderr,"dbg2       mbReferenceDepth_units:			%s\n", store->mbReferenceDepth_units);
-		    fprintf(stderr,"dbg2       mbReferenceDepth_unit_code:		%s\n", store->mbReferenceDepth_unit_code);
-		    fprintf(stderr,"dbg2       mbReferenceDepth_add_offset:		%f\n", store->mbReferenceDepth_add_offset);
-		    fprintf(stderr,"dbg2       mbReferenceDepth_scale_factor:		%f\n", store->mbReferenceDepth_scale_factor);
-		    fprintf(stderr,"dbg2       mbReferenceDepth_minimum:		%f\n", store->mbReferenceDepth_minimum);
-		    fprintf(stderr,"dbg2       mbReferenceDepth_maximum:		%f\n", store->mbReferenceDepth_maximum);
-		    fprintf(stderr,"dbg2       mbReferenceDepth_valid_minimum:		%d\n", store->mbReferenceDepth_valid_minimum);
-		    fprintf(stderr,"dbg2       mbReferenceDepth_valid_maximum:		%d\n", store->mbReferenceDepth_valid_maximum);
-		    fprintf(stderr,"dbg2       mbReferenceDepth_missing_value:		%d\n", store->mbReferenceDepth_missing_value);
-		    fprintf(stderr,"dbg2       mbReferenceDepth_format_C:		%s\n", store->mbReferenceDepth_format_C);
-		    fprintf(stderr,"dbg2       mbReferenceDepth_orientation:		%s\n", store->mbReferenceDepth_orientation);
-		    fprintf(stderr,"dbg2       mbDynamicDraught_type:			%s\n", store->mbDynamicDraught_type);
-		    fprintf(stderr,"dbg2       mbDynamicDraught_long_name:		%s\n", store->mbDynamicDraught_long_name);
-		    fprintf(stderr,"dbg2       mbDynamicDraught_name_code:		%s\n", store->mbDynamicDraught_name_code);
-		    fprintf(stderr,"dbg2       mbDynamicDraught_units:			%s\n", store->mbDynamicDraught_units);
-		    fprintf(stderr,"dbg2       mbDynamicDraught_unit_code:		%s\n", store->mbDynamicDraught_unit_code);
-		    fprintf(stderr,"dbg2       mbDynamicDraught_add_offset:		%f\n", store->mbDynamicDraught_add_offset);
-		    fprintf(stderr,"dbg2       mbDynamicDraught_scale_factor:		%f\n", store->mbDynamicDraught_scale_factor);
-		    fprintf(stderr,"dbg2       mbDynamicDraught_minimum:		%f\n", store->mbDynamicDraught_minimum);
-		    fprintf(stderr,"dbg2       mbDynamicDraught_maximum:		%f\n", store->mbDynamicDraught_maximum);
-		    fprintf(stderr,"dbg2       mbDynamicDraught_valid_minimum:		%d\n", store->mbDynamicDraught_valid_minimum);
-		    fprintf(stderr,"dbg2       mbDynamicDraught_valid_maximum:		%d\n", store->mbDynamicDraught_valid_maximum);
-		    fprintf(stderr,"dbg2       mbDynamicDraught_missing_value:		%d\n", store->mbDynamicDraught_missing_value);
-		    fprintf(stderr,"dbg2       mbDynamicDraught_format_C:		%s\n", store->mbDynamicDraught_format_C);
-		    fprintf(stderr,"dbg2       mbDynamicDraught_orientation:		%s\n", store->mbDynamicDraught_orientation);
-		    fprintf(stderr,"dbg2       mbTide_type:				%s\n", store->mbTide_type);
-		    fprintf(stderr,"dbg2       mbTide_long_name:			%s\n", store->mbTide_long_name);
-		    fprintf(stderr,"dbg2       mbTide_name_code:			%s\n", store->mbTide_name_code);
-		    fprintf(stderr,"dbg2       mbTide_units:				%s\n", store->mbTide_units);
-		    fprintf(stderr,"dbg2       mbTide_unit_code:			%s\n", store->mbTide_unit_code);
-		    fprintf(stderr,"dbg2       mbTide_add_offset:			%f\n", store->mbTide_add_offset);
-		    fprintf(stderr,"dbg2       mbTide_scale_factor:			%f\n", store->mbTide_scale_factor);
-		    fprintf(stderr,"dbg2       mbTide_minimum:				%f\n", store->mbTide_minimum);
-		    fprintf(stderr,"dbg2       mbTide_maximum:				%f\n", store->mbTide_maximum);
-		    fprintf(stderr,"dbg2       mbTide_valid_minimum:			%d\n", store->mbTide_valid_minimum);
-		    fprintf(stderr,"dbg2       mbTide_valid_maximum:			%d\n", store->mbTide_valid_maximum);
-		    fprintf(stderr,"dbg2       mbTide_missing_value:			%d\n", store->mbTide_missing_value);
-		    fprintf(stderr,"dbg2       mbTide_format_C:				%s\n", store->mbTide_format_C);
-		    fprintf(stderr,"dbg2       mbTide_orientation:			%s\n", store->mbTide_orientation);
-		    fprintf(stderr,"dbg2       mbSoundVelocity_type:			%s\n", store->mbSoundVelocity_type);
-		    fprintf(stderr,"dbg2       mbSoundVelocity_long_name:		%s\n", store->mbSoundVelocity_long_name);
-		    fprintf(stderr,"dbg2       mbSoundVelocity_name_code:		%s\n", store->mbSoundVelocity_name_code);
-		    fprintf(stderr,"dbg2       mbSoundVelocity_units:			%s\n", store->mbSoundVelocity_units);
-		    fprintf(stderr,"dbg2       mbSoundVelocity_unit_code:		%s\n", store->mbSoundVelocity_unit_code);
-		    fprintf(stderr,"dbg2       mbSoundVelocity_add_offset:		%f\n", store->mbSoundVelocity_add_offset);
-		    fprintf(stderr,"dbg2       mbSoundVelocity_scale_factor:		%f\n", store->mbSoundVelocity_scale_factor);
-		    fprintf(stderr,"dbg2       mbSoundVelocity_minimum:			%f\n", store->mbSoundVelocity_minimum);
-		    fprintf(stderr,"dbg2       mbSoundVelocity_maximum:			%f\n", store->mbSoundVelocity_maximum);
-		    fprintf(stderr,"dbg2       mbSoundVelocity_valid_minimum:		%d\n", store->mbSoundVelocity_valid_minimum);
-		    fprintf(stderr,"dbg2       mbSoundVelocity_valid_maximum:		%d\n", store->mbSoundVelocity_valid_maximum);
-		    fprintf(stderr,"dbg2       mbSoundVelocity_missing_value:		%d\n", store->mbSoundVelocity_missing_value);
-		    fprintf(stderr,"dbg2       mbSoundVelocity_format_C:		%s\n", store->mbSoundVelocity_format_C);
-		    fprintf(stderr,"dbg2       mbSoundVelocity_orientation:		%s\n", store->mbSoundVelocity_orientation);
-		    fprintf(stderr,"dbg2       mbHeading_type:		%s\n", store->mbHeading_type);
-		    fprintf(stderr,"dbg2       mbHeading_long_name:		%s\n", store->mbHeading_long_name);
-		    fprintf(stderr,"dbg2       mbHeading_name_code:		%s\n", store->mbHeading_name_code);
-		    fprintf(stderr,"dbg2       mbHeading_units:		%s\n", store->mbHeading_units);
-		    fprintf(stderr,"dbg2       mbHeading_unit_code:		%s\n", store->mbHeading_unit_code);
-		    fprintf(stderr,"dbg2       mbHeading_add_offset:		%f\n", store->mbHeading_add_offset);
-		    fprintf(stderr,"dbg2       mbHeading_scale_factor:		%f\n", store->mbHeading_scale_factor);
-		    fprintf(stderr,"dbg2       mbHeading_minimum:		%f\n", store->mbHeading_minimum);
-		    fprintf(stderr,"dbg2       mbHeading_maximum:		%f\n", store->mbHeading_maximum);
-		    fprintf(stderr,"dbg2       mbHeading_valid_minimum:		%d\n", store->mbHeading_valid_minimum);
-		    fprintf(stderr,"dbg2       mbHeading_valid_maximum:		%d\n", store->mbHeading_valid_maximum);
-		    fprintf(stderr,"dbg2       mbHeading_missing_value:		%d\n", store->mbHeading_missing_value);
-		    fprintf(stderr,"dbg2       mbHeading_format_C:		%s\n", store->mbHeading_format_C);
-		    fprintf(stderr,"dbg2       mbHeading_orientation:		%s\n", store->mbHeading_orientation);
-		    fprintf(stderr,"dbg2       mbRoll_type:		%s\n", store->mbRoll_type);
-		    fprintf(stderr,"dbg2       mbRoll_long_name:		%s\n", store->mbRoll_long_name);
-		    fprintf(stderr,"dbg2       mbRoll_name_code:		%s\n", store->mbRoll_name_code);
-		    fprintf(stderr,"dbg2       mbRoll_units:		%s\n", store->mbRoll_units);
-		    fprintf(stderr,"dbg2       mbRoll_unit_code:		%s\n", store->mbRoll_unit_code);
-		    fprintf(stderr,"dbg2       mbRoll_add_offset:		%f\n", store->mbRoll_add_offset);
-		    fprintf(stderr,"dbg2       mbRoll_scale_factor:		%f\n", store->mbRoll_scale_factor);
-		    fprintf(stderr,"dbg2       mbRoll_minimum:		%f\n", store->mbRoll_minimum);
-		    fprintf(stderr,"dbg2       mbRoll_maximum:		%f\n", store->mbRoll_maximum);
-		    fprintf(stderr,"dbg2       mbRoll_valid_minimum:		%d\n", store->mbRoll_valid_minimum);
-		    fprintf(stderr,"dbg2       mbRoll_valid_maximum:		%d\n", store->mbRoll_valid_maximum);
-		    fprintf(stderr,"dbg2       mbRoll_missing_value:		%d\n", store->mbRoll_missing_value);
-		    fprintf(stderr,"dbg2       mbRoll_format_C:		%s\n", store->mbRoll_format_C);
-		    fprintf(stderr,"dbg2       mbRoll_orientation:		%s\n", store->mbRoll_orientation);
-		    fprintf(stderr,"dbg2       mbPitch_type:		%s\n", store->mbPitch_type);
-		    fprintf(stderr,"dbg2       mbPitch_long_name:		%s\n", store->mbPitch_long_name);
-		    fprintf(stderr,"dbg2       mbPitch_name_code:		%s\n", store->mbPitch_name_code);
-		    fprintf(stderr,"dbg2       mbPitch_units:		%s\n", store->mbPitch_units);
-		    fprintf(stderr,"dbg2       mbPitch_unit_code:		%s\n", store->mbPitch_unit_code);
-		    fprintf(stderr,"dbg2       mbPitch_add_offset:		%f\n", store->mbPitch_add_offset);
-		    fprintf(stderr,"dbg2       mbPitch_scale_factor:		%f\n", store->mbPitch_scale_factor);
-		    fprintf(stderr,"dbg2       mbPitch_minimum:		%f\n", store->mbPitch_minimum);
-		    fprintf(stderr,"dbg2       mbPitch_maximum:		%f\n", store->mbPitch_maximum);
-		    fprintf(stderr,"dbg2       mbPitch_valid_minimum:		%d\n", store->mbPitch_valid_minimum);
-		    fprintf(stderr,"dbg2       mbPitch_valid_maximum:		%d\n", store->mbPitch_valid_maximum);
-		    fprintf(stderr,"dbg2       mbPitch_missing_value:		%d\n", store->mbPitch_missing_value);
-		    fprintf(stderr,"dbg2       mbPitch_format_C:		%s\n", store->mbPitch_format_C);
-		    fprintf(stderr,"dbg2       mbPitch_orientation:		%s\n", store->mbPitch_orientation);
-		    fprintf(stderr,"dbg2       mbTransmissionHeave_type:		%s\n", store->mbTransmissionHeave_type);
-		    fprintf(stderr,"dbg2       mbTransmissionHeave_long_name:		%s\n", store->mbTransmissionHeave_long_name);
-		    fprintf(stderr,"dbg2       mbTransmissionHeave_name_code:		%s\n", store->mbTransmissionHeave_name_code);
-		    fprintf(stderr,"dbg2       mbTransmissionHeave_units:		%s\n", store->mbTransmissionHeave_units);
-		    fprintf(stderr,"dbg2       mbTransmissionHeave_unit_code:		%s\n", store->mbTransmissionHeave_unit_code);
-		    fprintf(stderr,"dbg2       mbTransmissionHeave_add_offset:		%f\n", store->mbTransmissionHeave_add_offset);
-		    fprintf(stderr,"dbg2       mbTransmissionHeave_scale_factor:		%f\n", store->mbTransmissionHeave_scale_factor);
-		    fprintf(stderr,"dbg2       mbTransmissionHeave_minimum:		%f\n", store->mbTransmissionHeave_minimum);
-		    fprintf(stderr,"dbg2       mbTransmissionHeave_maximum:		%f\n", store->mbTransmissionHeave_maximum);
-		    fprintf(stderr,"dbg2       mbTransmissionHeave_valid_minimum:		%d\n", store->mbTransmissionHeave_valid_minimum);
-		    fprintf(stderr,"dbg2       mbTransmissionHeave_valid_maximum:		%d\n", store->mbTransmissionHeave_valid_maximum);
-		    fprintf(stderr,"dbg2       mbTransmissionHeave_missing_value:		%d\n", store->mbTransmissionHeave_missing_value);
-		    fprintf(stderr,"dbg2       mbTransmissionHeave_format_C:		%s\n", store->mbTransmissionHeave_format_C);
-		    fprintf(stderr,"dbg2       mbTransmissionHeave_orientation:		%s\n", store->mbTransmissionHeave_orientation);
-		    fprintf(stderr,"dbg2       mbDistanceScale_type:		%s\n", store->mbDistanceScale_type);
-		    fprintf(stderr,"dbg2       mbDistanceScale_long_name:		%s\n", store->mbDistanceScale_long_name);
-		    fprintf(stderr,"dbg2       mbDistanceScale_name_code:		%s\n", store->mbDistanceScale_name_code);
-		    fprintf(stderr,"dbg2       mbDistanceScale_units:		%s\n", store->mbDistanceScale_units);
-		    fprintf(stderr,"dbg2       mbDistanceScale_unit_code:		%s\n", store->mbDistanceScale_unit_code);
-		    fprintf(stderr,"dbg2       mbDistanceScale_add_offset:		%f\n", store->mbDistanceScale_add_offset);
-		    fprintf(stderr,"dbg2       mbDistanceScale_scale_factor:		%f\n", store->mbDistanceScale_scale_factor);
-		    fprintf(stderr,"dbg2       mbDistanceScale_minimum:		%f\n", store->mbDistanceScale_minimum);
-		    fprintf(stderr,"dbg2       mbDistanceScale_maximum:		%f\n", store->mbDistanceScale_maximum);
-		    fprintf(stderr,"dbg2       mbDistanceScale_valid_minimum:		%d\n", store->mbDistanceScale_valid_minimum);
-		    fprintf(stderr,"dbg2       mbDistanceScale_valid_maximum:		%d\n", store->mbDistanceScale_valid_maximum);
-		    fprintf(stderr,"dbg2       mbDistanceScale_missing_value:		%d\n", store->mbDistanceScale_missing_value);
-		    fprintf(stderr,"dbg2       mbDistanceScale_format_C:		%s\n", store->mbDistanceScale_format_C);
-		    fprintf(stderr,"dbg2       mbDistanceScale_orientation:		%s\n", store->mbDistanceScale_orientation);
-		    fprintf(stderr,"dbg2       mbDepthScale_type:		%s\n", store->mbDepthScale_type);
-		    fprintf(stderr,"dbg2       mbDepthScale_long_name:		%s\n", store->mbDepthScale_long_name);
-		    fprintf(stderr,"dbg2       mbDepthScale_name_code:		%s\n", store->mbDepthScale_name_code);
-		    fprintf(stderr,"dbg2       mbDepthScale_units:		%s\n", store->mbDepthScale_units);
-		    fprintf(stderr,"dbg2       mbDepthScale_unit_code:		%s\n", store->mbDepthScale_unit_code);
-		    fprintf(stderr,"dbg2       mbDepthScale_add_offset:		%f\n", store->mbDepthScale_add_offset);
-		    fprintf(stderr,"dbg2       mbDepthScale_scale_factor:		%f\n", store->mbDepthScale_scale_factor);
-		    fprintf(stderr,"dbg2       mbDepthScale_minimum:		%f\n", store->mbDepthScale_minimum);
-		    fprintf(stderr,"dbg2       mbDepthScale_maximum:		%f\n", store->mbDepthScale_maximum);
-		    fprintf(stderr,"dbg2       mbDepthScale_valid_minimum:		%d\n", store->mbDepthScale_valid_minimum);
-		    fprintf(stderr,"dbg2       mbDepthScale_valid_maximum:		%d\n", store->mbDepthScale_valid_maximum);
-		    fprintf(stderr,"dbg2       mbDepthScale_missing_value:		%d\n", store->mbDepthScale_missing_value);
-		    fprintf(stderr,"dbg2       mbDepthScale_format_C:		%s\n", store->mbDepthScale_format_C);
-		    fprintf(stderr,"dbg2       mbDepthScale_orientation:		%s\n", store->mbDepthScale_orientation);
-		    fprintf(stderr,"dbg2       mbVerticalDepth_type:		%s\n", store->mbVerticalDepth_type);
-		    fprintf(stderr,"dbg2       mbVerticalDepth_long_name:		%s\n", store->mbVerticalDepth_long_name);
-		    fprintf(stderr,"dbg2       mbVerticalDepth_name_code:		%s\n", store->mbVerticalDepth_name_code);
-		    fprintf(stderr,"dbg2       mbVerticalDepth_units:		%s\n", store->mbVerticalDepth_units);
-		    fprintf(stderr,"dbg2       mbVerticalDepth_unit_code:		%s\n", store->mbVerticalDepth_unit_code);
-		    fprintf(stderr,"dbg2       mbVerticalDepth_add_offset:		%d\n", store->mbVerticalDepth_add_offset);
-		    fprintf(stderr,"dbg2       mbVerticalDepth_scale_factor:		%d\n", store->mbVerticalDepth_scale_factor);
-		    fprintf(stderr,"dbg2       mbVerticalDepth_minimum:		%d\n", store->mbVerticalDepth_minimum);
-		    fprintf(stderr,"dbg2       mbVerticalDepth_maximum:		%d\n", store->mbVerticalDepth_maximum);
-		    fprintf(stderr,"dbg2       mbVerticalDepth_valid_minimum:		%d\n", store->mbVerticalDepth_valid_minimum);
-		    fprintf(stderr,"dbg2       mbVerticalDepth_valid_maximum:		%d\n", store->mbVerticalDepth_valid_maximum);
-		    fprintf(stderr,"dbg2       mbVerticalDepth_missing_value:		%d\n", store->mbVerticalDepth_missing_value);
-		    fprintf(stderr,"dbg2       mbVerticalDepth_format_C:		%s\n", store->mbVerticalDepth_format_C);
-		    fprintf(stderr,"dbg2       mbVerticalDepth_orientation:		%s\n", store->mbVerticalDepth_orientation);
-		    fprintf(stderr,"dbg2       mbCQuality_type:		%s\n", store->mbCQuality_type);
-		    fprintf(stderr,"dbg2       mbCQuality_long_name:		%s\n", store->mbCQuality_long_name);
-		    fprintf(stderr,"dbg2       mbCQuality_name_code:		%s\n", store->mbCQuality_name_code);
-		    fprintf(stderr,"dbg2       mbCQuality_units:		%s\n", store->mbCQuality_units);
-		    fprintf(stderr,"dbg2       mbCQuality_unit_code:		%s\n", store->mbCQuality_unit_code);
-		    fprintf(stderr,"dbg2       mbCQuality_add_offset:		%d\n", store->mbCQuality_add_offset);
-		    fprintf(stderr,"dbg2       mbCQuality_scale_factor:		%d\n", store->mbCQuality_scale_factor);
-		    fprintf(stderr,"dbg2       mbCQuality_minimum:		%d\n", store->mbCQuality_minimum);
-		    fprintf(stderr,"dbg2       mbCQuality_maximum:		%d\n", store->mbCQuality_maximum);
-		    fprintf(stderr,"dbg2       mbCQuality_valid_minimum:		%d\n", store->mbCQuality_valid_minimum);
-		    fprintf(stderr,"dbg2       mbCQuality_valid_maximum:		%d\n", store->mbCQuality_valid_maximum);
-		    fprintf(stderr,"dbg2       mbCQuality_missing_value:		%d\n", store->mbCQuality_missing_value);
-		    fprintf(stderr,"dbg2       mbCQuality_format_C:		%s\n", store->mbCQuality_format_C);
-		    fprintf(stderr,"dbg2       mbCQuality_orientation:		%s\n", store->mbCQuality_orientation);
-		    fprintf(stderr,"dbg2       mbCFlag_type:		%s\n", store->mbCFlag_type);
-		    fprintf(stderr,"dbg2       mbCFlag_long_name:		%s\n", store->mbCFlag_long_name);
-		    fprintf(stderr,"dbg2       mbCFlag_name_code:		%s\n", store->mbCFlag_name_code);
-		    fprintf(stderr,"dbg2       mbCFlag_units:		%s\n", store->mbCFlag_units);
-		    fprintf(stderr,"dbg2       mbCFlag_unit_code:		%s\n", store->mbCFlag_unit_code);
-		    fprintf(stderr,"dbg2       mbCFlag_add_offset:		%d\n", store->mbCFlag_add_offset);
-		    fprintf(stderr,"dbg2       mbCFlag_scale_factor:		%d\n", store->mbCFlag_scale_factor);
-		    fprintf(stderr,"dbg2       mbCFlag_minimum:		%d\n", store->mbCFlag_minimum);
-		    fprintf(stderr,"dbg2       mbCFlag_maximum:		%d\n", store->mbCFlag_maximum);
-		    fprintf(stderr,"dbg2       mbCFlag_valid_minimum:		%d\n", store->mbCFlag_valid_minimum);
-		    fprintf(stderr,"dbg2       mbCFlag_valid_maximum:		%d\n", store->mbCFlag_valid_maximum);
-		    fprintf(stderr,"dbg2       mbCFlag_missing_value:		%d\n", store->mbCFlag_missing_value);
-		    fprintf(stderr,"dbg2       mbCFlag_format_C:		%s\n", store->mbCFlag_format_C);
-		    fprintf(stderr,"dbg2       mbCFlag_orientation:		%s\n", store->mbCFlag_orientation);
-		    fprintf(stderr,"dbg2       mbInterlacing_type:		%s\n", store->mbInterlacing_type);
-		    fprintf(stderr,"dbg2       mbInterlacing_long_name:		%s\n", store->mbInterlacing_long_name);
-		    fprintf(stderr,"dbg2       mbInterlacing_name_code:		%s\n", store->mbInterlacing_name_code);
-		    fprintf(stderr,"dbg2       mbInterlacing_units:		%s\n", store->mbInterlacing_units);
-		    fprintf(stderr,"dbg2       mbInterlacing_unit_code:		%s\n", store->mbInterlacing_unit_code);
-		    fprintf(stderr,"dbg2       mbInterlacing_add_offset:		%d\n", store->mbInterlacing_add_offset);
-		    fprintf(stderr,"dbg2       mbInterlacing_scale_factor:		%d\n", store->mbInterlacing_scale_factor);
-		    fprintf(stderr,"dbg2       mbInterlacing_minimum:		%d\n", store->mbInterlacing_minimum);
-		    fprintf(stderr,"dbg2       mbInterlacing_maximum:		%d\n", store->mbInterlacing_maximum);
-		    fprintf(stderr,"dbg2       mbInterlacing_valid_minimum:		%d\n", store->mbInterlacing_valid_minimum);
-		    fprintf(stderr,"dbg2       mbInterlacing_valid_maximum:		%d\n", store->mbInterlacing_valid_maximum);
-		    fprintf(stderr,"dbg2       mbInterlacing_missing_value:		%d\n", store->mbInterlacing_missing_value);
-		    fprintf(stderr,"dbg2       mbInterlacing_format_C:		%s\n", store->mbInterlacing_format_C);
-		    fprintf(stderr,"dbg2       mbInterlacing_orientation:		%s\n", store->mbInterlacing_orientation);
-		    fprintf(stderr,"dbg2       mbSamplingRate_type:		%s\n", store->mbSamplingRate_type);
-		    fprintf(stderr,"dbg2       mbSamplingRate_long_name:		%s\n", store->mbSamplingRate_long_name);
-		    fprintf(stderr,"dbg2       mbSamplingRate_name_code:		%s\n", store->mbSamplingRate_name_code);
-		    fprintf(stderr,"dbg2       mbSamplingRate_units:		%s\n", store->mbSamplingRate_units);
-		    fprintf(stderr,"dbg2       mbSamplingRate_unit_code:		%s\n", store->mbSamplingRate_unit_code);
-		    fprintf(stderr,"dbg2       mbSamplingRate_add_offset:		%d\n", store->mbSamplingRate_add_offset);
-		    fprintf(stderr,"dbg2       mbSamplingRate_scale_factor:		%d\n", store->mbSamplingRate_scale_factor);
-		    fprintf(stderr,"dbg2       mbSamplingRate_minimum:		%d\n", store->mbSamplingRate_minimum);
-		    fprintf(stderr,"dbg2       mbSamplingRate_maximum:		%d\n", store->mbSamplingRate_maximum);
-		    fprintf(stderr,"dbg2       mbSamplingRate_valid_minimum:		%d\n", store->mbSamplingRate_valid_minimum);
-		    fprintf(stderr,"dbg2       mbSamplingRate_valid_maximum:		%d\n", store->mbSamplingRate_valid_maximum);
-		    fprintf(stderr,"dbg2       mbSamplingRate_missing_value:		%d\n", store->mbSamplingRate_missing_value);
-		    fprintf(stderr,"dbg2       mbSamplingRate_format_C:		%s\n", store->mbSamplingRate_format_C);
-		    fprintf(stderr,"dbg2       mbSamplingRate_orientation:		%s\n", store->mbSamplingRate_orientation);
-		    fprintf(stderr,"dbg2       mbAlongDistance_type:		%s\n", store->mbAlongDistance_type);
-		    fprintf(stderr,"dbg2       mbAlongDistance_long_name:		%s\n", store->mbAlongDistance_long_name);
-		    fprintf(stderr,"dbg2       mbAlongDistance_name_code:		%s\n", store->mbAlongDistance_name_code);
-		    fprintf(stderr,"dbg2       mbAlongDistance_units:		%s\n", store->mbAlongDistance_units);
-		    fprintf(stderr,"dbg2       mbAlongDistance_unit_code:		%s\n", store->mbAlongDistance_unit_code);
-		    fprintf(stderr,"dbg2       mbAlongDistance_add_offset:		%d\n", store->mbAlongDistance_add_offset);
-		    fprintf(stderr,"dbg2       mbAlongDistance_scale_factor:		%d\n", store->mbAlongDistance_scale_factor);
-		    fprintf(stderr,"dbg2       mbAlongDistance_minimum:		%d\n", store->mbAlongDistance_minimum);
-		    fprintf(stderr,"dbg2       mbAlongDistance_maximum:		%d\n", store->mbAlongDistance_maximum);
-		    fprintf(stderr,"dbg2       mbAlongDistance_valid_minimum:		%d\n", store->mbAlongDistance_valid_minimum);
-		    fprintf(stderr,"dbg2       mbAlongDistance_valid_maximum:		%d\n", store->mbAlongDistance_valid_maximum);
-		    fprintf(stderr,"dbg2       mbAlongDistance_missing_value:		%d\n", store->mbAlongDistance_missing_value);
-		    fprintf(stderr,"dbg2       mbAlongDistance_format_C:		%s\n", store->mbAlongDistance_format_C);
-		    fprintf(stderr,"dbg2       mbAlongDistance_orientation:		%s\n", store->mbAlongDistance_orientation);
-		    fprintf(stderr,"dbg2       mbAcrossDistance_type:		%s\n", store->mbAcrossDistance_type);
-		    fprintf(stderr,"dbg2       mbAcrossDistance_long_name:		%s\n", store->mbAcrossDistance_long_name);
-		    fprintf(stderr,"dbg2       mbAcrossDistance_name_code:		%s\n", store->mbAcrossDistance_name_code);
-		    fprintf(stderr,"dbg2       mbAcrossDistance_units:		%s\n", store->mbAcrossDistance_units);
-		    fprintf(stderr,"dbg2       mbAcrossDistance_unit_code:		%s\n", store->mbAcrossDistance_unit_code);
-		    fprintf(stderr,"dbg2       mbAcrossDistance_add_offset:		%d\n", store->mbAcrossDistance_add_offset);
-		    fprintf(stderr,"dbg2       mbAcrossDistance_scale_factor:		%d\n", store->mbAcrossDistance_scale_factor);
-		    fprintf(stderr,"dbg2       mbAcrossDistance_minimum:		%d\n", store->mbAcrossDistance_minimum);
-		    fprintf(stderr,"dbg2       mbAcrossDistance_maximum:		%d\n", store->mbAcrossDistance_maximum);
-		    fprintf(stderr,"dbg2       mbAcrossDistance_valid_minimum:		%d\n", store->mbAcrossDistance_valid_minimum);
-		    fprintf(stderr,"dbg2       mbAcrossDistance_valid_maximum:		%d\n", store->mbAcrossDistance_valid_maximum);
-		    fprintf(stderr,"dbg2       mbAcrossDistance_missing_value:		%d\n", store->mbAcrossDistance_missing_value);
-		    fprintf(stderr,"dbg2       mbAcrossDistance_format_C:		%s\n", store->mbAcrossDistance_format_C);
-		    fprintf(stderr,"dbg2       mbAcrossDistance_orientation:		%s\n", store->mbAcrossDistance_orientation);
-		    fprintf(stderr,"dbg2       mbDepth_type:		%s\n", store->mbDepth_type);
-		    fprintf(stderr,"dbg2       mbDepth_long_name:		%s\n", store->mbDepth_long_name);
-		    fprintf(stderr,"dbg2       mbDepth_name_code:		%s\n", store->mbDepth_name_code);
-		    fprintf(stderr,"dbg2       mbDepth_units:		%s\n", store->mbDepth_units);
-		    fprintf(stderr,"dbg2       mbDepth_unit_code:		%s\n", store->mbDepth_unit_code);
-		    fprintf(stderr,"dbg2       mbDepth_add_offset:		%d\n", store->mbDepth_add_offset);
-		    fprintf(stderr,"dbg2       mbDepth_scale_factor:		%d\n", store->mbDepth_scale_factor);
-		    fprintf(stderr,"dbg2       mbDepth_minimum:		%d\n", store->mbDepth_minimum);
-		    fprintf(stderr,"dbg2       mbDepth_maximum:		%d\n", store->mbDepth_maximum);
-		    fprintf(stderr,"dbg2       mbDepth_valid_minimum:		%d\n", store->mbDepth_valid_minimum);
-		    fprintf(stderr,"dbg2       mbDepth_valid_maximum:		%d\n", store->mbDepth_valid_maximum);
-		    fprintf(stderr,"dbg2       mbDepth_missing_value:		%d\n", store->mbDepth_missing_value);
-		    fprintf(stderr,"dbg2       mbDepth_format_C:		%s\n", store->mbDepth_format_C);
-		    fprintf(stderr,"dbg2       mbDepth_orientation:		%s\n", store->mbDepth_orientation);
-		    fprintf(stderr,"dbg2       mbSQuality_type:		%s\n", store->mbSQuality_type);
-		    fprintf(stderr,"dbg2       mbSQuality_long_name:		%s\n", store->mbSQuality_long_name);
-		    fprintf(stderr,"dbg2       mbSQuality_name_code:		%s\n", store->mbSQuality_name_code);
-		    fprintf(stderr,"dbg2       mbSQuality_units:		%s\n", store->mbSQuality_units);
-		    fprintf(stderr,"dbg2       mbSQuality_unit_code:		%s\n", store->mbSQuality_unit_code);
-		    fprintf(stderr,"dbg2       mbSQuality_add_offset:		%d\n", store->mbSQuality_add_offset);
-		    fprintf(stderr,"dbg2       mbSQuality_scale_factor:		%d\n", store->mbSQuality_scale_factor);
-		    fprintf(stderr,"dbg2       mbSQuality_minimum:		%d\n", store->mbSQuality_minimum);
-		    fprintf(stderr,"dbg2       mbSQuality_maximum:		%d\n", store->mbSQuality_maximum);
-		    fprintf(stderr,"dbg2       mbSQuality_valid_minimum:		%d\n", store->mbSQuality_valid_minimum);
-		    fprintf(stderr,"dbg2       mbSQuality_valid_maximum:		%d\n", store->mbSQuality_valid_maximum);
-		    fprintf(stderr,"dbg2       mbSQuality_missing_value:		%d\n", store->mbSQuality_missing_value);
-		    fprintf(stderr,"dbg2       mbSQuality_format_C:		%s\n", store->mbSQuality_format_C);
-		    fprintf(stderr,"dbg2       mbSQuality_orientation:		%s\n", store->mbSQuality_orientation);
-		    fprintf(stderr,"dbg2       mbSFlag_type:		%s\n", store->mbSFlag_type);
-		    fprintf(stderr,"dbg2       mbSFlag_long_name:		%s\n", store->mbSFlag_long_name);
-		    fprintf(stderr,"dbg2       mbSFlag_name_code:		%s\n", store->mbSFlag_name_code);
-		    fprintf(stderr,"dbg2       mbSFlag_units:		%s\n", store->mbSFlag_units);
-		    fprintf(stderr,"dbg2       mbSFlag_unit_code:		%s\n", store->mbSFlag_unit_code);
-		    fprintf(stderr,"dbg2       mbSFlag_add_offset:		%d\n", store->mbSFlag_add_offset);
-		    fprintf(stderr,"dbg2       mbSFlag_scale_factor:		%d\n", store->mbSFlag_scale_factor);
-		    fprintf(stderr,"dbg2       mbSFlag_minimum:		%d\n", store->mbSFlag_minimum);
-		    fprintf(stderr,"dbg2       mbSFlag_maximum:		%d\n", store->mbSFlag_maximum);
-		    fprintf(stderr,"dbg2       mbSFlag_valid_minimum:		%d\n", store->mbSFlag_valid_minimum);
-		    fprintf(stderr,"dbg2       mbSFlag_valid_maximum:		%d\n", store->mbSFlag_valid_maximum);
-		    fprintf(stderr,"dbg2       mbSFlag_missing_value:		%d\n", store->mbSFlag_missing_value);
-		    fprintf(stderr,"dbg2       mbSFlag_format_C:		%s\n", store->mbSFlag_format_C);
-		    fprintf(stderr,"dbg2       mbSFlag_orientation:		%s\n", store->mbSFlag_orientation);
-		    fprintf(stderr,"dbg2       mbAntenna_type:		%s\n", store->mbAntenna_type);
-		    fprintf(stderr,"dbg2       mbAntenna_long_name:		%s\n", store->mbAntenna_long_name);
-		    fprintf(stderr,"dbg2       mbAntenna_name_code:		%s\n", store->mbAntenna_name_code);
-		    fprintf(stderr,"dbg2       mbAntenna_units:		%s\n", store->mbAntenna_units);
-		    fprintf(stderr,"dbg2       mbAntenna_unit_code:		%s\n", store->mbAntenna_unit_code);
-		    fprintf(stderr,"dbg2       mbAntenna_add_offset:		%d\n", store->mbAntenna_add_offset);
-		    fprintf(stderr,"dbg2       mbAntenna_scale_factor:		%d\n", store->mbAntenna_scale_factor);
-		    fprintf(stderr,"dbg2       mbAntenna_minimum:		%d\n", store->mbAntenna_minimum);
-		    fprintf(stderr,"dbg2       mbAntenna_maximum:		%d\n", store->mbAntenna_maximum);
-		    fprintf(stderr,"dbg2       mbAntenna_valid_minimum:		%d\n", store->mbAntenna_valid_minimum);
-		    fprintf(stderr,"dbg2       mbAntenna_valid_maximum:		%d\n", store->mbAntenna_valid_maximum);
-		    fprintf(stderr,"dbg2       mbAntenna_missing_value:		%d\n", store->mbAntenna_missing_value);
-		    fprintf(stderr,"dbg2       mbAntenna_format_C:		%s\n", store->mbAntenna_format_C);
-		    fprintf(stderr,"dbg2       mbAntenna_orientation:		%s\n", store->mbAntenna_orientation);
-		    fprintf(stderr,"dbg2       mbBeamBias_type:		%s\n", store->mbBeamBias_type);
-		    fprintf(stderr,"dbg2       mbBeamBias_long_name:		%s\n", store->mbBeamBias_long_name);
-		    fprintf(stderr,"dbg2       mbBeamBias_name_code:		%s\n", store->mbBeamBias_name_code);
-		    fprintf(stderr,"dbg2       mbBeamBias_units:		%s\n", store->mbBeamBias_units);
-		    fprintf(stderr,"dbg2       mbBeamBias_unit_code:		%s\n", store->mbBeamBias_unit_code);
-		    fprintf(stderr,"dbg2       mbBeamBias_add_offset:		%f\n", store->mbBeamBias_add_offset);
-		    fprintf(stderr,"dbg2       mbBeamBias_scale_factor:		%f\n", store->mbBeamBias_scale_factor);
-		    fprintf(stderr,"dbg2       mbBeamBias_minimum:		%d\n", store->mbBeamBias_minimum);
-		    fprintf(stderr,"dbg2       mbBeamBias_maximum:		%d\n", store->mbBeamBias_maximum);
-		    fprintf(stderr,"dbg2       mbBeamBias_valid_minimum:		%d\n", store->mbBeamBias_valid_minimum);
-		    fprintf(stderr,"dbg2       mbBeamBias_valid_maximum:		%d\n", store->mbBeamBias_valid_maximum);
-		    fprintf(stderr,"dbg2       mbBeamBias_missing_value:		%d\n", store->mbBeamBias_missing_value);
-		    fprintf(stderr,"dbg2       mbBeamBias_format_C:		%s\n", store->mbBeamBias_format_C);
-		    fprintf(stderr,"dbg2       mbBeamBias_orientation:		%s\n", store->mbBeamBias_orientation);
-		    fprintf(stderr,"dbg2       mbBFlag_type:		%s\n", store->mbBFlag_type);
-		    fprintf(stderr,"dbg2       mbBFlag_long_name:		%s\n", store->mbBFlag_long_name);
-		    fprintf(stderr,"dbg2       mbBFlag_name_code:		%s\n", store->mbBFlag_name_code);
-		    fprintf(stderr,"dbg2       mbBFlag_units:		%s\n", store->mbBFlag_units);
-		    fprintf(stderr,"dbg2       mbBFlag_unit_code:		%s\n", store->mbBFlag_unit_code);
-		    fprintf(stderr,"dbg2       mbBFlag_add_offset:		%d\n", store->mbBFlag_add_offset);
-		    fprintf(stderr,"dbg2       mbBFlag_scale_factor:		%d\n", store->mbBFlag_scale_factor);
-		    fprintf(stderr,"dbg2       mbBFlag_minimum:		%d\n", store->mbBFlag_minimum);
-		    fprintf(stderr,"dbg2       mbBFlag_maximum:		%d\n", store->mbBFlag_maximum);
-		    fprintf(stderr,"dbg2       mbBFlag_valid_minimum:		%d\n", store->mbBFlag_valid_minimum);
-		    fprintf(stderr,"dbg2       mbBFlag_valid_maximum:		%d\n", store->mbBFlag_valid_maximum);
-		    fprintf(stderr,"dbg2       mbBFlag_missing_value:		%d\n", store->mbBFlag_missing_value);
-		    fprintf(stderr,"dbg2       mbBFlag_format_C:		%s\n", store->mbBFlag_format_C);
-		    fprintf(stderr,"dbg2       mbBFlag_orientation:		%s\n", store->mbBFlag_orientation);
-		    fprintf(stderr,"dbg2       mbBeam_type:		%s\n", store->mbBeam_type);
-		    fprintf(stderr,"dbg2       mbBeam_long_name:		%s\n", store->mbBeam_long_name);
-		    fprintf(stderr,"dbg2       mbBeam_name_code:		%s\n", store->mbBeam_name_code);
-		    fprintf(stderr,"dbg2       mbBeam_units:		%s\n", store->mbBeam_units);
-		    fprintf(stderr,"dbg2       mbBeam_unit_code:		%s\n", store->mbBeam_unit_code);
-		    fprintf(stderr,"dbg2       mbBeam_add_offset:		%d\n", store->mbBeam_add_offset);
-		    fprintf(stderr,"dbg2       mbBeam_scale_factor:		%d\n", store->mbBeam_scale_factor);
-		    fprintf(stderr,"dbg2       mbBeam_minimum:		%d\n", store->mbBeam_minimum);
-		    fprintf(stderr,"dbg2       mbBeam_maximum:		%d\n", store->mbBeam_maximum);
-		    fprintf(stderr,"dbg2       mbBeam_valid_minimum:		%d\n", store->mbBeam_valid_minimum);
-		    fprintf(stderr,"dbg2       mbBeam_valid_maximum:		%d\n", store->mbBeam_valid_maximum);
-		    fprintf(stderr,"dbg2       mbBeam_missing_value:		%d\n", store->mbBeam_missing_value);
-		    fprintf(stderr,"dbg2       mbBeam_format_C:		%s\n", store->mbBeam_format_C);
-		    fprintf(stderr,"dbg2       mbBeam_orientation:		%s\n", store->mbBeam_orientation);
-		    fprintf(stderr,"dbg2       mbAFlag_type:		%s\n", store->mbAFlag_type);
-		    fprintf(stderr,"dbg2       mbAFlag_long_name:		%s\n", store->mbAFlag_long_name);
-		    fprintf(stderr,"dbg2       mbAFlag_name_code:		%s\n", store->mbAFlag_name_code);
-		    fprintf(stderr,"dbg2       mbAFlag_units:		%s\n", store->mbAFlag_units);
-		    fprintf(stderr,"dbg2       mbAFlag_unit_code:		%s\n", store->mbAFlag_unit_code);
-		    fprintf(stderr,"dbg2       mbAFlag_add_offset:		%d\n", store->mbAFlag_add_offset);
-		    fprintf(stderr,"dbg2       mbAFlag_scale_factor:		%d\n", store->mbAFlag_scale_factor);
-		    fprintf(stderr,"dbg2       mbAFlag_minimum:		%d\n", store->mbAFlag_minimum);
-		    fprintf(stderr,"dbg2       mbAFlag_maximum:		%d\n", store->mbAFlag_maximum);
-		    fprintf(stderr,"dbg2       mbAFlag_valid_minimum:		%d\n", store->mbAFlag_valid_minimum);
-		    fprintf(stderr,"dbg2       mbAFlag_valid_maximum:		%d\n", store->mbAFlag_valid_maximum);
-		    fprintf(stderr,"dbg2       mbAFlag_missing_value:		%d\n", store->mbAFlag_missing_value);
-		    fprintf(stderr,"dbg2       mbAFlag_format_C:		%s\n", store->mbAFlag_format_C);
-		    fprintf(stderr,"dbg2       mbAFlag_orientation:		%s\n", store->mbAFlag_orientation);
-		    fprintf(stderr,"dbg2       mbVelProfilRef_type:		%s\n", store->mbVelProfilRef_type);
-		    fprintf(stderr,"dbg2       mbVelProfilRef_long_name:		%s\n", store->mbVelProfilRef_long_name);
-		    fprintf(stderr,"dbg2       mbVelProfilRef_name_code:		%s\n", store->mbVelProfilRef_name_code);
-		    fprintf(stderr,"dbg2       mbVelProfilIdx_type:		%s\n", store->mbVelProfilIdx_type);
-		    fprintf(stderr,"dbg2       mbVelProfilIdx_long_name:		%s\n", store->mbVelProfilIdx_long_name);
-		    fprintf(stderr,"dbg2       mbVelProfilIdx_name_code:		%s\n", store->mbVelProfilIdx_name_code);
-		    fprintf(stderr,"dbg2       mbVelProfilIdx_units:		%s\n", store->mbVelProfilIdx_units);
-		    fprintf(stderr,"dbg2       mbVelProfilIdx_unit_code:		%s\n", store->mbVelProfilIdx_unit_code);
-		    fprintf(stderr,"dbg2       mbVelProfilIdx_add_offset:		%d\n", store->mbVelProfilIdx_add_offset);
-		    fprintf(stderr,"dbg2       mbVelProfilIdx_scale_factor:		%d\n", store->mbVelProfilIdx_scale_factor);
-		    fprintf(stderr,"dbg2       mbVelProfilIdx_minimum:		%d\n", store->mbVelProfilIdx_minimum);
-		    fprintf(stderr,"dbg2       mbVelProfilIdx_maximum:		%d\n", store->mbVelProfilIdx_maximum);
-		    fprintf(stderr,"dbg2       mbVelProfilIdx_valid_minimum:		%d\n", store->mbVelProfilIdx_valid_minimum);
-		    fprintf(stderr,"dbg2       mbVelProfilIdx_valid_maximum:		%d\n", store->mbVelProfilIdx_valid_maximum);
-		    fprintf(stderr,"dbg2       mbVelProfilIdx_missing_value:		%d\n", store->mbVelProfilIdx_missing_value);
-		    fprintf(stderr,"dbg2       mbVelProfilIdx_format_C:		%s\n", store->mbVelProfilIdx_format_C);
-		    fprintf(stderr,"dbg2       mbVelProfilIdx_orientation:		%s\n", store->mbVelProfilIdx_orientation);
-		    fprintf(stderr,"dbg2       mbVelProfilDate_type:		%s\n", store->mbVelProfilDate_type);
-		    fprintf(stderr,"dbg2       mbVelProfilDate_long_name:		%s\n", store->mbVelProfilDate_long_name);
-		    fprintf(stderr,"dbg2       mbVelProfilDate_name_code:		%s\n", store->mbVelProfilDate_name_code);
-		    fprintf(stderr,"dbg2       mbVelProfilDate_units:		%s\n", store->mbVelProfilDate_units);
-		    fprintf(stderr,"dbg2       mbVelProfilDate_unit_code:		%s\n", store->mbVelProfilDate_unit_code);
-		    fprintf(stderr,"dbg2       mbVelProfilDate_add_offset:		%d\n", store->mbVelProfilDate_add_offset);
-		    fprintf(stderr,"dbg2       mbVelProfilDate_scale_factor:		%d\n", store->mbVelProfilDate_scale_factor);
-		    fprintf(stderr,"dbg2       mbVelProfilDate_minimum:		%d\n", store->mbVelProfilDate_minimum);
-		    fprintf(stderr,"dbg2       mbVelProfilDate_maximum:		%d\n", store->mbVelProfilDate_maximum);
-		    fprintf(stderr,"dbg2       mbVelProfilDate_valid_minimum:		%d\n", store->mbVelProfilDate_valid_minimum);
-		    fprintf(stderr,"dbg2       mbVelProfilDate_valid_maximum:		%d\n", store->mbVelProfilDate_valid_maximum);
-		    fprintf(stderr,"dbg2       mbVelProfilDate_missing_value:		%d\n", store->mbVelProfilDate_missing_value);
-		    fprintf(stderr,"dbg2       mbVelProfilDate_format_C:		%s\n", store->mbVelProfilDate_format_C);
-		    fprintf(stderr,"dbg2       mbVelProfilDate_orientation:		%s\n", store->mbVelProfilDate_orientation);
-		    fprintf(stderr,"dbg2       mbVelProfilTime_type:		%s\n", store->mbVelProfilTime_type);
-		    fprintf(stderr,"dbg2       mbVelProfilTime_long_name:		%s\n", store->mbVelProfilTime_long_name);
-		    fprintf(stderr,"dbg2       mbVelProfilTime_name_code:		%s\n", store->mbVelProfilTime_name_code);
-		    fprintf(stderr,"dbg2       mbVelProfilTime_units:		%s\n", store->mbVelProfilTime_units);
-		    fprintf(stderr,"dbg2       mbVelProfilTime_unit_code:		%s\n", store->mbVelProfilTime_unit_code);
-		    fprintf(stderr,"dbg2       mbVelProfilTime_add_offset:		%d\n", store->mbVelProfilTime_add_offset);
-		    fprintf(stderr,"dbg2       mbVelProfilTime_scale_factor:		%d\n", store->mbVelProfilTime_scale_factor);
-		    fprintf(stderr,"dbg2       mbVelProfilTime_minimum:		%d\n", store->mbVelProfilTime_minimum);
-		    fprintf(stderr,"dbg2       mbVelProfilTime_maximum:		%d\n", store->mbVelProfilTime_maximum);
-		    fprintf(stderr,"dbg2       mbVelProfilTime_valid_minimum:		%d\n", store->mbVelProfilTime_valid_minimum);
-		    fprintf(stderr,"dbg2       mbVelProfilTime_valid_maximum:		%d\n", store->mbVelProfilTime_valid_maximum);
-		    fprintf(stderr,"dbg2       mbVelProfilTime_missing_value:		%d\n", store->mbVelProfilTime_missing_value);
-		    fprintf(stderr,"dbg2       mbVelProfilTime_format_C:		%s\n", store->mbVelProfilTime_format_C);
-		    fprintf(stderr,"dbg2       mbVelProfilTime_orientation:		%s\n", store->mbVelProfilTime_orientation);
-		    }
-		}
-
-	    /* read global variables */
-	    if (status == MB_SUCCESS)
-		{
-		if (store->mbHistDate_id >= 0)
-		    {
-		    index[0] = 0;
-		    count[0] = store->mbNbrHistoryRec;
-		    nc_status = nc_get_vara_int(mb_io_ptr->ncid, store->mbHistDate_id, index, count, store->mbHistDate);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_vara mbHistDate error: %s\n", nc_strerror(nc_status));
-		    }
-		if (store->mbHistTime_id >= 0)
-		    {
-		    index[0] = 0;
-		    count[0] = store->mbNbrHistoryRec;
-		    nc_status = nc_get_vara_int(mb_io_ptr->ncid, store->mbHistTime_id, index, count, store->mbHistTime);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_vara mbHistTime error: %s\n", nc_strerror(nc_status));
-		    }
-		if (store->mbHistCode_id >= 0)
-		    {
-		    index[0] = 0;
-		    count[0] = store->mbNbrHistoryRec;
-		    nc_status = nc_get_vara_text(mb_io_ptr->ncid, store->mbHistCode_id, index, count, store->mbHistCode);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_vara mbHistCode error: %s\n", nc_strerror(nc_status));
-		    }
-		if (store->mbHistAutor_id >= 0)
-		    {
-		    index[0] = 0;
-		    index[1] = 0;
-		    count[0] = store->mbNbrHistoryRec;
-		    count[1] = store->mbNameLength;
-		    nc_status = nc_get_vara_text(mb_io_ptr->ncid, store->mbHistAutor_id, index, count, store->mbHistAutor);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_vara mbHistAutor error: %s\n", nc_strerror(nc_status));
-		    }
-		if (store->mbHistModule_id >= 0)
-		    {
-		    index[0] = 0;
-		    index[1] = 0;
-		    count[0] = store->mbNbrHistoryRec;
-		    count[1] = store->mbNameLength;
-		    nc_status = nc_get_vara_text(mb_io_ptr->ncid, store->mbHistModule_id, index, count, store->mbHistModule);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_vara mbHistModule error: %s\n", nc_strerror(nc_status));
-		    }
-		if (store->mbHistComment_id >= 0)
-		    {
-		    index[0] = 0;
-		    index[1] = 0;
-		    count[0] = store->mbNbrHistoryRec;
-		    count[1] = store->mbCommentLength;
-		    nc_status = nc_get_vara_text(mb_io_ptr->ncid, store->mbHistComment_id, index, count, store->mbHistComment);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_vara mbHistComment error: %s\n", nc_strerror(nc_status));
-		    }
-		if (store->mbAntenna_id >= 0)
-		    {
-		    index[0] = 0;
-		    count[0] = store->mbBeamNbr;
-		    nc_status = nc_get_vara_text(mb_io_ptr->ncid, store->mbAntenna_id, index, count, store->mbAntenna);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_vara mbAntenna error: %s\n", nc_strerror(nc_status));
-		    }
-		if (store->mbBeamBias_id >= 0)
-		    {
-		    index[0] = 0;
-		    count[0] = store->mbBeamNbr;
-		    nc_status = nc_get_vara_short(mb_io_ptr->ncid, store->mbBeamBias_id, index, count, store->mbBeamBias);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_vara mbBeamBias error: %s\n", nc_strerror(nc_status));
-		    }
-		if (store->mbBFlag_id >= 0)
-		    {
-		    index[0] = 0;
-		    count[0] = store->mbBeamNbr;
-		    nc_status = nc_get_vara_text(mb_io_ptr->ncid, store->mbBFlag_id, index, count, store->mbBFlag);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_vara mbBFlag error: %s\n", nc_strerror(nc_status));
-		    }
-		if (store->mbBeam_id >= 0)
-		    {
-		    index[0] = 0;
-		    count[0] = store->mbAntennaNbr;
-		    nc_status = nc_get_vara_short(mb_io_ptr->ncid, store->mbBeam_id, index, count, store->mbBeam);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_vara mbBeam error: %s\n", nc_strerror(nc_status));
-		    }
-		if (store->mbAFlag_id >= 0)
-		    {
-		    index[0] = 0;
-		    count[0] = store->mbAntennaNbr;
-		    nc_status = nc_get_vara_text(mb_io_ptr->ncid, store->mbAFlag_id, index, count, store->mbAFlag);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_vara mbAFlag error: %s\n", nc_strerror(nc_status));
-		    }
-		if (store->mbVelProfilRef_id >= 0)
-		    {
-		    index[0] = 0;
-		    index[1] = 0;
-		    count[0] = store->mbVelocityProfilNbr;
-		    count[1] = store->mbCommentLength;
-		    nc_status = nc_get_vara_text(mb_io_ptr->ncid, store->mbVelProfilRef_id, index, count, store->mbVelProfilRef);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_vara mbVelProfilRef error: %s\n", nc_strerror(nc_status));
-		    }
-		if (store->mbVelProfilIdx_id >= 0)
-		    {
-		    index[0] = 0;
-		    count[0] = store->mbVelocityProfilNbr;
-		    nc_status = nc_get_vara_short(mb_io_ptr->ncid, store->mbVelProfilIdx_id, index, count, store->mbVelProfilIdx);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_vara mbVelProfilIdx error: %s\n", nc_strerror(nc_status));
-		    }
-		if (store->mbVelProfilDate_id >= 0)
-		    {
-		    index[0] = 0;
-		    count[0] = store->mbVelocityProfilNbr;
-		    nc_status = nc_get_vara_int(mb_io_ptr->ncid, store->mbVelProfilDate_id, index, count, store->mbVelProfilDate);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_vara mbVelProfilDate error: %s\n", nc_strerror(nc_status));
-		    }
-		if (store->mbVelProfilTime_id >= 0)
-		    {
-		    index[0] = 0;
-		    count[0] = store->mbVelocityProfilNbr;
-		    nc_status = nc_get_vara_int(mb_io_ptr->ncid, store->mbVelProfilTime_id, index, count, store->mbVelProfilTime);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_vara mbVelProfilTime error: %s\n", nc_strerror(nc_status));
-		    }
-		if (nc_status != NC_NOERR)
-		    {
-		    status = MB_FAILURE;
-		    *error = MB_ERROR_EOF;
-		    }
-
-		/* print input debug statements */
-		if (verbose >= 2)
-		    {
-		    fprintf(stderr,"\ndbg2  NetCDF Global Variables read in function <%s>\n",function_name);
-		    fprintf(stderr,"dbg2  Global Variables:\n");
-		    fprintf(stderr,"dbg2       status:                  %d\n", status);
-		    fprintf(stderr,"dbg2       error:                   %d\n", *error);
-		    fprintf(stderr,"dbg2       nc_status:               %d\n", nc_status);
-		    fprintf(stderr,"dbg2       mbNbrHistoryRec:         %d\n", store->mbNbrHistoryRec);
-		    for (i=0;i<store->mbNbrHistoryRec;i++)
-			{
-			fprintf(stderr,"dbg2       mbHistDate[%2d]:          %d\n", i, store->mbHistDate[i]);
-			fprintf(stderr,"dbg2       mbHistTime[%2d]:          %d\n", i, store->mbHistTime[i]);
-			fprintf(stderr,"dbg2       mbHistCode[%2d]:          %d\n", i, store->mbHistCode[i]);
-			fprintf(stderr,"dbg2       mbHistAutor[%2d]:         %s\n", i, &(store->mbHistAutor[i*store->mbNameLength]));
-			fprintf(stderr,"dbg2       mbHistModule[%2d]:        %s\n", i, &(store->mbHistModule[i*store->mbNameLength]));
-			fprintf(stderr,"dbg2       mbHistComment[%2d]:       %s\n", i, &(store->mbHistComment[i*store->mbCommentLength]));
-			}
-		    fprintf(stderr,"dbg2       mbAntennaNbr:              %zu\n", store->mbAntennaNbr);
-		    fprintf(stderr,"dbg2       Antenna mbBeam mbAFlag\n");
-		    for (i=0;i<store->mbAntennaNbr;i++)
-			{
-			fprintf(stderr,"dbg2       %d %d %d\n",
-				i, store->mbBeam[i], store->mbAFlag[i]);
-			}
-		    fprintf(stderr,"dbg2       mbBeamNbr:              %zu\n", store->mbBeamNbr);
-		    fprintf(stderr,"dbg2       beam mbAntenna mbBeamBias mbBFlag\n");
-		    for (i=0;i<store->mbBeamNbr;i++)
-			{
-			fprintf(stderr,"dbg2       %3d %d %d %d\n",
-				i, store->mbAntenna[i], store->mbBeamBias[i],
-				store->mbBFlag[i]);
-			}
-		    fprintf(stderr,"dbg2       mbVelocityProfilNbr:    %zu\n", store->mbVelocityProfilNbr);
-		    for (i=0;i<store->mbVelocityProfilNbr;i++)
-			{
-			fprintf(stderr,"dbg2       mbVelProfilRef[%2d]:      %s\n", i, &(store->mbVelProfilRef[i*store->mbCommentLength]));
-			fprintf(stderr,"dbg2       mbVelProfilIdx[%2d]:      %d\n", i, store->mbVelProfilIdx[i]);
-			fprintf(stderr,"dbg2       mbVelProfilDate[%2d]:     %d\n", i, store->mbVelProfilDate[i]);
-			fprintf(stderr,"dbg2       mbVelProfilTime[%2d]:     %d\n", i, store->mbVelProfilTime[i]);
-			}
-		    }
-		}
-	    }
-
-	/* set maximum number of pings to read */
-	if (store->CIB_BLOCK_DIM > 0)
-	    {
-	    recreadmax = store->CIB_BLOCK_DIM * store->mbCycleNbr;
-	    }
-	else
-	    {
-	    recreadmax = store->mbCycleNbr;
-	    }
-
-	/* read next data from file */
-	/* first run through all comment records */
-	if (status == MB_SUCCESS && store->mbNbrHistoryRec > *commentread)
-	    {
-	    store->kind = MB_DATA_COMMENT;
-
-	    /* get next comment */
-	    strncpy(store->comment,
-		    &(store->mbHistComment[(*commentread) *store->mbCommentLength]),
-		    MBSYS_NETCDF_COMMENTLEN);
-
-	    /* set counters */
-	    (*commentread)++;
-	    (*dataread)++;
-
-	    /* print input debug statements */
-	    if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  Comment read in function <%s>\n",function_name);
-		fprintf(stderr,"dbg2  Comment:\n");
-		fprintf(stderr,"dbg2       status:                  %d\n", status);
-		fprintf(stderr,"dbg2       error:                   %d\n", *error);
-		fprintf(stderr,"dbg2       comment:                 %s\n", store->comment);
-		}
-	    }
-
-	/* next run through all survey records */
-	else if (status == MB_SUCCESS && recreadmax > *recread)
-	    {
-	    /* set kind */
-	    store->kind = MB_DATA_DATA;
-/*fprintf(stderr,"*recread:%d mbCycleNbr:%d mbCycle_id:%d mbAntennaNbr:%d CIB_BLOCK_DIM:%d\n",
-*recread,store->mbCycleNbr,store->mbCycle_id,store->mbAntennaNbr,store->CIB_BLOCK_DIM);*/
-
-	    /* set index and count arrays for per-ping variables */
-	    if (store->CIB_BLOCK_DIM > 0)
-	    	{
-		index[0] = (*recread / store->CIB_BLOCK_DIM);
-		index[1] = *recread - store->CIB_BLOCK_DIM * index[0];
-		index[2] = 0;
-		count[0] = 1;
-		count[1] = 1;
-		count[2] = store->mbAntennaNbr;
-		}
-	    else
-	    	{
-		index[0] = *recread;
-		index[1] = 0;
-		index[2] = 0;
-		count[0] = 1;
-		count[1] = store->mbAntennaNbr;
-		count[2] = 0;
-		}
-
-	    /* read the per-ping variables from next record */
-	    if (store->mbCycle_id >= 0)
-		{
-/* fprintf(stderr,"index: %d %d count:%d %d mbCycleNbr:%d mbCycle_id:%d\n",index[0],index[1],count[0],count[1],store->mbCycleNbr,store->mbCycle_id);*/
-		nc_status = nc_get_vara_int(mb_io_ptr->ncid, store->mbCycle_id, index, count, store->mbCycle);
-		if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_vara mbCycle error: %s\n", nc_strerror(nc_status));
-		}
-	    if (store->mbDate_id >= 0)
-		{
-		nc_status = nc_get_vara_int(mb_io_ptr->ncid, store->mbDate_id, index, count, store->mbDate);
-		if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_vara mbDate error: %s\n", nc_strerror(nc_status));
-		}
-	    if (store->mbTime_id >= 0)
-		{
-		nc_status = nc_get_vara_int(mb_io_ptr->ncid, store->mbTime_id, index, count, store->mbTime);
-		if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_vara mbTime error: %s\n", nc_strerror(nc_status));
-		}
-	    if (store->mbOrdinate_id >= 0)
-		{
-		nc_status = nc_get_vara_int(mb_io_ptr->ncid, store->mbOrdinate_id, index, count, store->mbOrdinate);
-		if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_vara mbOrdinate error: %s\n", nc_strerror(nc_status));
-		}
-	    if (store->mbAbscissa_id >= 0)
-		{
-		nc_status = nc_get_vara_int(mb_io_ptr->ncid, store->mbAbscissa_id, index, count, store->mbAbscissa);
-		if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_vara mbAbscissa error: %s\n", nc_strerror(nc_status));
-		}
-	    if (store->mbFrequency_id >= 0)
-		{
-		nc_status = nc_get_vara_text(mb_io_ptr->ncid, store->mbFrequency_id, index, count, store->mbFrequency);
-		if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_vara mbFrequency error: %s\n", nc_strerror(nc_status));
-		}
-	    if (store->mbSonarFrequency_id >= 0)
-		{
-		nc_status = nc_get_vara_int(mb_io_ptr->ncid, store->mbSonarFrequency_id, index, count, store->mbSonarFrequency);
-		if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_vara mbSonarFrequency error: %s\n", nc_strerror(nc_status));
-		}
-	    if (store->mbSounderMode_id >= 0)
-		{
-		nc_status = nc_get_vara_text(mb_io_ptr->ncid, store->mbSounderMode_id, index, count, store->mbSounderMode);
-		if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_vara mbSounderMode error: %s\n", nc_strerror(nc_status));
-		}
-	    if (store->mbReferenceDepth_id >= 0)
-		{
-		nc_status = nc_get_vara_int(mb_io_ptr->ncid, store->mbReferenceDepth_id, index, count, store->mbReferenceDepth);
-		if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_vara mbReferenceDepth error: %s\n", nc_strerror(nc_status));
-		}
-	    if (store->mbDynamicDraught_id >= 0)
-		{
-		nc_status = nc_get_vara_short(mb_io_ptr->ncid, store->mbDynamicDraught_id, index, count, store->mbDynamicDraught);
-		if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_vara mbDynamicDraught error: %s\n", nc_strerror(nc_status));
-		}
-	    if (store->mbTide_id >= 0)
-		{
-		nc_status = nc_get_vara_short(mb_io_ptr->ncid, store->mbTide_id, index, count, store->mbTide);
-		if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_vara mbTide error: %s\n", nc_strerror(nc_status));
-		}
-	    if (store->mbSoundVelocity_id >= 0)
-		{
-		nc_status = nc_get_vara_short(mb_io_ptr->ncid, store->mbSoundVelocity_id, index, count, store->mbSoundVelocity);
-		if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_vara mbSoundVelocity error: %s\n", nc_strerror(nc_status));
-		}
-	    if (store->mbHeading_id >= 0)
-		{
-		nc_status = nc_get_vara_short(mb_io_ptr->ncid, store->mbHeading_id, index, count, (short *)store->mbHeading);
-		if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_vara mbHeading error: %s\n", nc_strerror(nc_status));
-		}
-	    if (store->mbRoll_id >= 0)
-		{
-		nc_status = nc_get_vara_short(mb_io_ptr->ncid, store->mbRoll_id, index, count, store->mbRoll);
-		if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_vara mbRoll error: %s\n", nc_strerror(nc_status));
-		}
-	    if (store->mbPitch_id >= 0)
-		{
-		nc_status = nc_get_vara_short(mb_io_ptr->ncid, store->mbPitch_id, index, count, store->mbPitch);
-		if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_vara mbPitch error: %s\n", nc_strerror(nc_status));
-		}
-	    if (store->mbTransmissionHeave_id >= 0)
-		{
-		nc_status = nc_get_vara_short(mb_io_ptr->ncid, store->mbTransmissionHeave_id, index, count, store->mbTransmissionHeave);
-		if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_vara mbTransmissionHeave error: %s\n", nc_strerror(nc_status));
-		}
-	    if (store->mbDistanceScale_id >= 0)
-		{
-		nc_status = nc_get_vara_text(mb_io_ptr->ncid, store->mbDistanceScale_id, index, count, store->mbDistanceScale);
-		if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_vara mbDistanceScale error: %s\n", nc_strerror(nc_status));
-		}
-	    if (store->mbRangeScale_id >= 0)
-		{
-		nc_status = nc_get_vara_short(mb_io_ptr->ncid, store->mbRangeScale_id, index, count, store->mbRangeScale);
-		if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_vara mbRangeScale error: %s\n", nc_strerror(nc_status));
-		}
-	    if (store->mbDepthScale_id >= 0)
-		{
-		nc_status = nc_get_vara_text(mb_io_ptr->ncid, store->mbDepthScale_id, index, count, store->mbDepthScale);
-		if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_vara mbDepthScale error: %s\n", nc_strerror(nc_status));
-		}
-	    if (store->mbVerticalDepth_id >= 0)
-		{
-		nc_status = nc_get_vara_int(mb_io_ptr->ncid, store->mbVerticalDepth_id, index, count, store->mbVerticalDepth);
-		if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_vara mbVerticalDepth error: %s\n", nc_strerror(nc_status));
-		}
-	    if (store->mbCQuality_id >= 0)
-		{
-		nc_status = nc_get_vara_text(mb_io_ptr->ncid, store->mbCQuality_id, index, count, store->mbCQuality);
-		if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_vara mbCQuality error: %s\n", nc_strerror(nc_status));
-		}
-	    if (store->mbCFlag_id >= 0)
-		{
-		nc_status = nc_get_vara_text(mb_io_ptr->ncid, store->mbCFlag_id, index, count, store->mbCFlag);
-		if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_vara mbCFlag error: %s\n", nc_strerror(nc_status));
-		}
-	    if (store->mbInterlacing_id >= 0)
-		{
-		nc_status = nc_get_vara_text(mb_io_ptr->ncid, store->mbInterlacing_id, index, count, store->mbInterlacing);
-		if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_vara mbInterlacing error: %s\n", nc_strerror(nc_status));
-		}
-	    if (store->mbSamplingRate_id >= 0)
-		{
-		nc_status = nc_get_vara_short(mb_io_ptr->ncid, store->mbSamplingRate_id, index, count, store->mbSamplingRate);
-		if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_vara mbSamplingRate error: %s\n", nc_strerror(nc_status));
-		}
-	    if (store->mbCompensationLayerMode_id >= 0)
-		{
-		nc_status = nc_get_vara_text(mb_io_ptr->ncid, store->mbCompensationLayerMode_id, index, count, store->mbCompensationLayerMode);
-		if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_vara mbCompensationLayerMode error: %s\n", nc_strerror(nc_status));
-		}
-	    if (store->mbTransmitBeamwidth_id >= 0)
-		{
-		nc_status = nc_get_vara_short(mb_io_ptr->ncid, store->mbTransmitBeamwidth_id, index, count, store->mbTransmitBeamwidth);
-		if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_vara mbTransmitBeamwidth error: %s\n", nc_strerror(nc_status));
-		}
-	    if (store->mbReceiveBeamwidth_id >= 0)
-		{
-		nc_status = nc_get_vara_text(mb_io_ptr->ncid, store->mbReceiveBeamwidth_id, index, count, store->mbReceiveBeamwidth);
-		if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_vara mbReceiveBeamwidth error: %s\n", nc_strerror(nc_status));
-		}
-	    if (store->mbTransmitPulseLength_id >= 0)
-		{
-		nc_status = nc_get_vara_short(mb_io_ptr->ncid, store->mbTransmitPulseLength_id, index, count, store->mbTransmitPulseLength);
-		if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_vara mbTransmitPulseLength error: %s\n", nc_strerror(nc_status));
-		}
-
-	    /* set index and count arrays for per-beam variables */
-	    if (store->CIB_BLOCK_DIM > 0)
-	    	{
-		index[0] = (*recread / store->CIB_BLOCK_DIM);
-		index[1] = *recread - store->CIB_BLOCK_DIM * index[0];
-		index[2] = 0;
-		count[0] = 1;
-		count[1] = 1;
-		count[2] = store->mbBeamNbr;
-		}
-	    else
-	    	{
-		index[0] = *recread;
-		index[1] = 0;
-		index[2] = 0;
-		count[0] = 1;
-		count[1] = store->mbBeamNbr;
-		count[2] = 0;
-		}
-
-	    /* read the per-beam variables from next record */
-	    if (store->mbAlongDistance_id >= 0)
-		{
-		nc_status = nc_get_vara_short(mb_io_ptr->ncid, store->mbAlongDistance_id, index, count, store->mbAlongDistance);
-		if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_vara mbAlongDistance error: %s\n", nc_strerror(nc_status));
-		}
-	    if (store->mbAcrossDistance_id >= 0)
-		{
-		nc_status = nc_get_vara_short(mb_io_ptr->ncid, store->mbAcrossDistance_id, index, count, store->mbAcrossDistance);
-		if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_vara mbAcrossDistance error: %s\n", nc_strerror(nc_status));
-		}
-	    if (store->mbDepth_id >= 0)
-		{
-		nc_status = nc_get_vara_int(mb_io_ptr->ncid, store->mbDepth_id, index, count, store->mbDepth);
-		if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_vara mbDepth error: %s\n", nc_strerror(nc_status));
-		}
-	    if (store->mbAcrossBeamAngle_id >= 0)
-		{
-		nc_status = nc_get_vara_short(mb_io_ptr->ncid, store->mbAcrossBeamAngle_id, index, count, store->mbAcrossBeamAngle);
-		if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_vara mbAcrossBeamAngle error: %s\n", nc_strerror(nc_status));
-		}
-	    if (store->mbAzimutBeamAngle_id >= 0)
-		{
-		nc_status = nc_get_vara_short(mb_io_ptr->ncid, store->mbAzimutBeamAngle_id, index, count, store->mbAzimutBeamAngle);
-		if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_vara mbAzimutBeamAngle error: %s\n", nc_strerror(nc_status));
-		}
-	    if (store->mbRange_id >= 0)
-		{
-		nc_status = nc_get_vara_short(mb_io_ptr->ncid, store->mbRange_id, index, count, store->mbRange);
-		if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_vara mbRange error: %s\n", nc_strerror(nc_status));
-		}
-	    if (store->mbSoundingBias_id >= 0)
-		{
-		nc_status = nc_get_vara_short(mb_io_ptr->ncid, store->mbSoundingBias_id, index, count, store->mbSoundingBias);
-		if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_vara mbSoundingBias error: %s\n", nc_strerror(nc_status));
-		}
-	    if (store->mbSQuality_id >= 0)
-		{
-		nc_status = nc_get_vara_text(mb_io_ptr->ncid, store->mbSQuality_id, index, count, store->mbSQuality);
-		if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_vara mbSQuality error: %s\n", nc_strerror(nc_status));
-		}
-	    if (store->mbReflectivity_id >= 0)
-		{
-		nc_status = nc_get_vara_text(mb_io_ptr->ncid, store->mbReflectivity_id, index, count, store->mbReflectivity);
-		if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_vara mbReflectivity error: %s\n", nc_strerror(nc_status));
-		}
-	    if (store->mbReceptionHeave_id >= 0)
-		{
-		nc_status = nc_get_vara_text(mb_io_ptr->ncid, store->mbReceptionHeave_id, index, count, store->mbReceptionHeave);
-		if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_vara mbReceptionHeave error: %s\n", nc_strerror(nc_status));
-		}
-	    if (store->mbAlongSlope_id >= 0)
-		{
-		nc_status = nc_get_vara_short(mb_io_ptr->ncid, store->mbAlongSlope_id, index, count, store->mbAlongSlope);
-		if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_vara mbAlongSlope error: %s\n", nc_strerror(nc_status));
-		}
-	    if (store->mbAcrossSlope_id >= 0)
-		{
-		nc_status = nc_get_vara_short(mb_io_ptr->ncid, store->mbAcrossSlope_id, index, count, store->mbAcrossSlope);
-		if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_vara mbAcrossSlope error: %s\n", nc_strerror(nc_status));
-		}
-	    if (store->mbSFlag_id >= 0)
-		{
-		nc_status = nc_get_vara_text(mb_io_ptr->ncid, store->mbSFlag_id, index, count, store->mbSFlag);
-		if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_vara mbSFlag error: %s\n", nc_strerror(nc_status));
-		}
-	    if (store->mbSLengthOfDetection_id >= 0)
-		{
-		nc_status = nc_get_vara_text(mb_io_ptr->ncid, store->mbSLengthOfDetection_id, index, count, store->mbSLengthOfDetection);
-		if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_vara mbSLengthOfDetection error: %s\n", nc_strerror(nc_status));
-		}
-	    /* check status */
-	    if (nc_status != NC_NOERR)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	    /* set counters */
-	    (*recread)++;
-	    (*dataread)++;
-
-	    /* check for bad record - often found towards end of files */
-	    if (store->mbDate[0] == 0 && store->mbTime[0] == 0)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_UNINTELLIGIBLE;
-		}
-	    else
-		{
-		/* KLUGE to handle multiple pings with the same time stamp
-	    	    - this is a problem because the edit save file scheme differentiates between
-			    pings based on the time stamp.
-		    - this code detects multiple pings with the same time stamp and adds a small
-			    amount of time to subsequent pings
-		    David W. Caress
-		    2 May 2005 */
-		time_d = store->mbDate[0] * SECINDAY
-			    + store->mbTime[0] * 0.001;
-		if (time_d != *lastrawtime)
-			{
-			*nrawtimerepeat = 0;
-			*lastrawtime = time_d;
-			}
-		else
-			{
-			(*nrawtimerepeat)++;
-			time_d += (*nrawtimerepeat) * 2 * MB_ESF_MAXTIMEDIFF;
-		    	store->mbDate[0] = (int)(time_d / SECINDAY);
-		    	store->mbTime[0] = (int)(1000 * (time_d - store->mbDate[0] * SECINDAY));
-			}
-		}
-
-	    /* print input debug statements */
-	    if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  NetCDF Survey Record read in function <%s>\n",function_name);
-		fprintf(stderr,"dbg2  Global Variables:\n");
-		fprintf(stderr,"dbg2       status:                  %d\n", status);
-		fprintf(stderr,"dbg2       error:                   %d\n", *error);
-		fprintf(stderr,"dbg2       nc_status:               %d\n", nc_status);
-		fprintf(stderr,"dbg2       mbCycle:                 ");
-		for (i=0;i<store->mbAntennaNbr;i++)
-			fprintf(stderr, "%d ", store->mbCycle[i]);
-		fprintf(stderr, "\n");
-		fprintf(stderr,"dbg2       mbDate:                  ");
-		for (i=0;i<store->mbAntennaNbr;i++)
-			fprintf(stderr, "%d ", store->mbDate[i]);
-		fprintf(stderr, "\n");
-		fprintf(stderr,"dbg2       mbTime:                  ");
-		for (i=0;i<store->mbAntennaNbr;i++)
-			fprintf(stderr, "%d ", store->mbTime[i]);
-		fprintf(stderr, "\n");
-		fprintf(stderr,"dbg2       mbOrdinate:              ");
-		for (i=0;i<store->mbAntennaNbr;i++)
-			fprintf(stderr, "%d ", store->mbOrdinate[i]);
-		fprintf(stderr, "\n");
-		fprintf(stderr,"dbg2       mbAbscissa:              ");
-		for (i=0;i<store->mbAntennaNbr;i++)
-			fprintf(stderr, "%d ", store->mbAbscissa[i]);
-		fprintf(stderr, "\n");
-		fprintf(stderr,"dbg2       mbFrequency:             ");
-		for (i=0;i<store->mbAntennaNbr;i++)
-			fprintf(stderr, "%d ", store->mbFrequency[i]);
-		fprintf(stderr, "\n");
-		fprintf(stderr,"dbg2       mbSounderMode:           ");
-		for (i=0;i<store->mbAntennaNbr;i++)
-			fprintf(stderr, "%d ", store->mbSounderMode[i]);
-		fprintf(stderr, "\n");
-		fprintf(stderr,"dbg2       mbReferenceDepth:        ");
-		for (i=0;i<store->mbAntennaNbr;i++)
-			fprintf(stderr, "%d ", store->mbReferenceDepth[i]);
-		fprintf(stderr, "\n");
-		fprintf(stderr,"dbg2       mbDynamicDraught:        ");
-		for (i=0;i<store->mbAntennaNbr;i++)
-			fprintf(stderr, "%d ", store->mbDynamicDraught[i]);
-		fprintf(stderr, "\n");
-		fprintf(stderr,"dbg2       mbTide:                  ");
-		for (i=0;i<store->mbAntennaNbr;i++)
-			fprintf(stderr, "%d ", store->mbTide[i]);
-		fprintf(stderr, "\n");
-		fprintf(stderr,"dbg2       mbSoundVelocity:         ");
-		for (i=0;i<store->mbAntennaNbr;i++)
-			fprintf(stderr, "%d ", store->mbSoundVelocity[i]);
-		fprintf(stderr, "\n");
-		fprintf(stderr,"dbg2       mbHeading:               ");
-		for (i=0;i<store->mbAntennaNbr;i++)
-			fprintf(stderr, "%d ", store->mbHeading[i]);
-		fprintf(stderr, "\n");
-		fprintf(stderr,"dbg2       mbRoll:                  ");
-		for (i=0;i<store->mbAntennaNbr;i++)
-			fprintf(stderr, "%d ", store->mbRoll[i]);
-		fprintf(stderr, "\n");
-		fprintf(stderr,"dbg2       mbPitch:                 ");
-		for (i=0;i<store->mbAntennaNbr;i++)
-			fprintf(stderr, "%d ", store->mbPitch[i]);
-		fprintf(stderr, "\n");
-		fprintf(stderr,"dbg2       mbTransmissionHeave:     ");
-		for (i=0;i<store->mbAntennaNbr;i++)
-			fprintf(stderr, "%d ", store->mbTransmissionHeave[i]);
-		fprintf(stderr, "\n");
-		fprintf(stderr,"dbg2       mbDistanceScale:         ");
-		for (i=0;i<store->mbAntennaNbr;i++)
-			fprintf(stderr, "%d ", store->mbDistanceScale[i]);
-		fprintf(stderr, "\n");
-		fprintf(stderr,"dbg2       mbDepthScale:            ");
-		for (i=0;i<store->mbAntennaNbr;i++)
-			fprintf(stderr, "%d ", store->mbDepthScale[i]);
-		fprintf(stderr, "\n");
-		fprintf(stderr,"dbg2       mbVerticalDepth:         ");
-		for (i=0;i<store->mbAntennaNbr;i++)
-			fprintf(stderr, "%d ", store->mbVerticalDepth[i]);
-		fprintf(stderr, "\n");
-		fprintf(stderr,"dbg2       mbCQuality:              ");
-		for (i=0;i<store->mbAntennaNbr;i++)
-			fprintf(stderr, "%d ", store->mbCQuality[i]);
-		fprintf(stderr, "\n");
-		fprintf(stderr,"dbg2       mbCFlag:                 ");
-		for (i=0;i<store->mbAntennaNbr;i++)
-			fprintf(stderr, "%d ", store->mbCFlag[i]);
-		fprintf(stderr, "\n");
-		fprintf(stderr,"dbg2       mbInterlacing:           ");
-		for (i=0;i<store->mbAntennaNbr;i++)
-			fprintf(stderr, "%d ", store->mbInterlacing[i]);
-		fprintf(stderr, "\n");
-		fprintf(stderr,"dbg2       mbSamplingRate:          ");
-		for (i=0;i<store->mbAntennaNbr;i++)
-			fprintf(stderr, "%d ", store->mbSamplingRate[i]);
-		fprintf(stderr, "\n");
-		fprintf(stderr,"dbg2       mbBeamNbr:               %zu\n", store->mbBeamNbr);
-		fprintf(stderr,"dbg2       beam ltrack xtrack depth quality flag\n");
-		for (i=0;i<store->mbBeamNbr;i++)
-		    {
-		    fprintf(stderr,"dbg2       %3d %8d %8d %8d %d %d\n",
-				    i, store->mbAlongDistance[i],
-				    store->mbAcrossDistance[i], store->mbDepth[i],
-				    store->mbSQuality[i], store->mbSFlag[i]);
-		    }
-		}
-	    }
-
-	/* else end of file */
-	else
-	    {
-	    /* set kind */
-	    store->kind = MB_DATA_NONE;
-
-	    /* set flags */
-	    *error = MB_ERROR_EOF;
-	    status = MB_FAILURE;
-	    }
-
-	/* set error and kind in mb_io_ptr */
-	mb_io_ptr->new_error = *error;
-	mb_io_ptr->new_kind = store->kind;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_wt_mbnetcdf(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_wt_mbnetcdf";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_netcdf_struct *store;
-	struct mbsys_netcdf_struct *storelocal;
-	int	*datawrite;
-	int	*commentwrite;
-	int	*recwrite;
-	int 	nc_status;
-	int	CIB_BLOCK_DIM_id;
-	int	mbHistoryRecNbr_id;
-	int	mbNameLength_id;
-	int	mbCommentLength_id;
-	int	mbAntennaNbr_id;
-	int	mbBeamNbr_id;
-	int	mbCycleNbr_id;
-	int	mbVelocityProfilNbr_id;
-	int	dimsNbr;
-	int	dims[3];
-	size_t	index[3], count[3];
-	char	*user_ptr;
-	double	time_d;
-	int	icomment;
-	int	i;
-	int	extended = MB_NO;
-#ifdef MBNETCDF_DEBUG
-	int	nc_verbose = 1;
-#else
-	int	nc_verbose = 0;
-#endif
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor and data storage */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-	store = (struct mbsys_netcdf_struct *) store_ptr;
-	storelocal = (struct mbsys_netcdf_struct *) mb_io_ptr->store_data;
-	datawrite = (int *) &mb_io_ptr->save1;
-	commentwrite = (int *) &mb_io_ptr->save2;
-	recwrite = (int *) &mb_io_ptr->save4;
-
-	if (mb_io_ptr->format == MBF_MBNCDFXT)
-	    extended = MB_YES;
-
-	/* if comment and nothing written yet save it */
-	if (store->kind == MB_DATA_COMMENT
-	    && *recwrite == 0)
-	    {
-	    /* allocate arrays if needed */
-	    if (storelocal->mbNbrHistoryRec >= storelocal->mbHistoryRecNbr)
-	    	{
-		/* allocate or reallocate history arrays */
-		storelocal->mbHistoryRecNbr += 20;
-		status = mb_reallocd(verbose, __FILE__, __LINE__,
-			    storelocal->mbHistoryRecNbr * sizeof(int),
-			    (void **)&storelocal->mbHistDate,error);
-		status = mb_reallocd(verbose, __FILE__, __LINE__,
-			    storelocal->mbHistoryRecNbr * sizeof(int),
-			    (void **)&storelocal->mbHistTime,error);
-		status = mb_reallocd(verbose, __FILE__, __LINE__,
-			    storelocal->mbHistoryRecNbr * sizeof(char),
-			    (void **)&storelocal->mbHistCode,error);
-		status = mb_reallocd(verbose, __FILE__, __LINE__,
-			    storelocal->mbHistoryRecNbr * storelocal->mbNameLength * sizeof(char),
-			    (void **)&storelocal->mbHistAutor,error);
-		status = mb_reallocd(verbose, __FILE__, __LINE__,
-			    storelocal->mbHistoryRecNbr * storelocal->mbNameLength * sizeof(char),
-			    (void **)&storelocal->mbHistModule,error);
-		status = mb_reallocd(verbose, __FILE__, __LINE__,
-			    storelocal->mbHistoryRecNbr * storelocal->mbCommentLength * sizeof(char),
-			    (void **)&storelocal->mbHistComment,error);
-		for (i=storelocal->mbNbrHistoryRec;i<storelocal->mbHistoryRecNbr;i++)
-			    {
-			    storelocal->mbHistDate[i] = 0;
-			    storelocal->mbHistTime[i] = 0;
-			    storelocal->mbHistCode[i] = 0;
-			    }
-		}
-
-	    /* save old comment (from pre-existing netcdf file) */
-	    if (store != storelocal)
-		{
-		/* figure out which comment is being passed */
-		icomment = -1;
-		for (i=0;i<store->mbNbrHistoryRec;i++)
-		    {
-		    if (strncmp(store->comment,
-				&store->mbHistComment[i * store->mbCommentLength],
-				MBSYS_NETCDF_COMMENTLEN) == 0)
-			{
-			icomment = i;
-			}
-		    }
-		if (icomment > -1 && icomment < store->mbNbrHistoryRec)
-		    {
-		    strncpy(&(storelocal->mbHistAutor[(*commentwrite) * storelocal->mbNameLength]),
-			    &(store->mbHistAutor[icomment * store->mbNameLength]),
-			    MBSYS_NETCDF_NAMELEN);
-		    strncpy(&(storelocal->mbHistModule[(*commentwrite) * storelocal->mbNameLength]),
-			    &(store->mbHistModule[icomment * store->mbNameLength]),
-			    MBSYS_NETCDF_NAMELEN);
-		    strncpy(&(storelocal->mbHistComment[(*commentwrite) * storelocal->mbCommentLength]),
-			    &(store->mbHistComment[icomment * store->mbCommentLength]),
-			    MBSYS_NETCDF_COMMENTLEN);
-		    storelocal->mbHistDate[*commentwrite] = store->mbHistDate[icomment];
-		    storelocal->mbHistTime[*commentwrite] = store->mbHistTime[icomment];
-		    storelocal->mbHistCode[*commentwrite] = 1;
-		    storelocal->mbNbrHistoryRec++;
-		    }
-		}
-
-	    /* save new comment */
-	    else
-		{
-		if ((user_ptr = getenv("USER")) == NULL)
-			user_ptr = getenv("LOGNAME");
-		if (user_ptr != NULL)
-		    strncpy(&(storelocal->mbHistAutor[(*commentwrite) *storelocal->mbNameLength]),
-			user_ptr, MBSYS_NETCDF_NAMELEN);
-		else
-		    strncpy(&(storelocal->mbHistAutor[(*commentwrite) *storelocal->mbNameLength]),
-			"Unknown", MBSYS_NETCDF_NAMELEN);
-		strncpy(&(storelocal->mbHistModule[(*commentwrite) *storelocal->mbNameLength]),
-			"MB-System", MBSYS_NETCDF_NAMELEN);
-		strncpy(&(storelocal->mbHistComment[(*commentwrite) *storelocal->mbCommentLength]),
-			store->comment, MBSYS_NETCDF_COMMENTLEN);
-		time_d = (double)time((time_t *)0);
-		storelocal->mbHistDate[*commentwrite] = (int)(time_d / SECINDAY);
-		storelocal->mbHistTime[*commentwrite] = (int)(1000 * (time_d - storelocal->mbHistDate[*commentwrite] * SECINDAY));
-		storelocal->mbHistCode[*commentwrite] = 1;
-		storelocal->mbNbrHistoryRec++;
-		}
-
-	    /* set counters */
-	    (*commentwrite)++;
-	    (*datawrite)++;
-
-	    /* print input debug statements */
-	    if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  Comment saved in function <%s>\n",function_name);
-		fprintf(stderr,"dbg2  Comment:\n");
-		fprintf(stderr,"dbg2       status:                  %d\n", status);
-		fprintf(stderr,"dbg2       error:                   %d\n", *error);
-		fprintf(stderr,"dbg2       comment:                 %s\n", store->comment);
-		}
-	    }
-
-	/* if data and nothing written yet start it off */
-	if (store->kind == MB_DATA_DATA
-	    && *recwrite == 0
-	    && status == MB_SUCCESS)
-	    {
-	    /* copy over noncomment dimensions */
-	    storelocal->CIB_BLOCK_DIM = store->CIB_BLOCK_DIM;
-	    storelocal->mbAntennaNbr = store->mbAntennaNbr;
-	    storelocal->mbBeamNbr = store->mbBeamNbr;
-	    storelocal->mbCycleNbr = 0;
-	    storelocal->mbVelocityProfilNbr = store->mbVelocityProfilNbr;
-
-	    /* define the dimensions */
-	    if (storelocal->CIB_BLOCK_DIM > 0)
-	    	{
-   	    	nc_status = nc_def_dim(mb_io_ptr->ncid, "CIB_BLOCK_DIM", storelocal->CIB_BLOCK_DIM, &CIB_BLOCK_DIM_id);
-	    	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_def_dim CIB_BLOCK_DIM error: %s\n", nc_strerror(nc_status));
-/*fprintf(stderr,"storelocal->CIB_BLOCK_DIM:%lu\n",storelocal->CIB_BLOCK_DIM);*/
-		}
-   	    nc_status = nc_def_dim(mb_io_ptr->ncid, "mbHistoryRecNbr", storelocal->mbHistoryRecNbr, &mbHistoryRecNbr_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_def_dim mbHistoryRecNbr error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_def_dim(mb_io_ptr->ncid, "mbNameLength", storelocal->mbNameLength, &mbNameLength_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_def_dim mbNameLength error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_def_dim(mb_io_ptr->ncid, "mbCommentLength", storelocal->mbCommentLength, &mbCommentLength_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_def_dim mbCommentLength error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_def_dim(mb_io_ptr->ncid, "mbAntennaNbr", storelocal->mbAntennaNbr, &mbAntennaNbr_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_def_dim mbAntennaNbr error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_def_dim(mb_io_ptr->ncid, "mbBeamNbr", storelocal->mbBeamNbr, &mbBeamNbr_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_def_dim mbBeamNbr error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_def_dim(mb_io_ptr->ncid, "mbCycleNbr", NC_UNLIMITED, &mbCycleNbr_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_def_dim mbCycleNbr error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_def_dim(mb_io_ptr->ncid, "mbVelocityProfilNbr", storelocal->mbVelocityProfilNbr, &mbVelocityProfilNbr_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_def_dim mbVelocityProfilNbr error: %s\n", nc_strerror(nc_status));
-
-	    /* print input debug statements */
-	    if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  NetCDF array dimensions written in function <%s>\n",function_name);
-		fprintf(stderr,"dbg2  Array and variable dimensions:\n");
-		fprintf(stderr,"dbg2       status:                  %d\n", status);
-		fprintf(stderr,"dbg2       error:                   %d\n", *error);
-		fprintf(stderr,"dbg2       nc_status:               %d\n", nc_status);
-		fprintf(stderr,"dbg2       CIB_BLOCK_DIM:           %zu\n", storelocal->CIB_BLOCK_DIM);
-		fprintf(stderr,"dbg2       mbHistoryRecNbr:         %zu\n", storelocal->mbHistoryRecNbr);
-		fprintf(stderr,"dbg2       mbNameLength:            %zu\n", storelocal->mbNameLength);
-		fprintf(stderr,"dbg2       mbCommentLength:         %zu\n", storelocal->mbCommentLength);
-		fprintf(stderr,"dbg2       mbAntennaNbr:            %zu\n", storelocal->mbAntennaNbr);
-		fprintf(stderr,"dbg2       mbBeamNbr:               %zu\n", storelocal->mbBeamNbr);
-		fprintf(stderr,"dbg2       mbCycleNbr:              %zu\n", storelocal->mbCycleNbr);
-		fprintf(stderr,"dbg2       mbVelocityProfilNbr:     %zu\n", storelocal->mbVelocityProfilNbr);
-		}
-
-	    /* define global variables */
-	    dims[0] = mbHistoryRecNbr_id;
-	    nc_status = nc_def_var(mb_io_ptr->ncid, "mbHistDate", NC_INT, 1, dims, &storelocal->mbHistDate_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_def_var mbHistDate_id error: %s\n", nc_strerror(nc_status));
-	    dims[0] = mbHistoryRecNbr_id;
-	    nc_status = nc_def_var(mb_io_ptr->ncid, "mbHistTime", NC_INT, 1, dims, &storelocal->mbHistTime_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_def_var mbHistTime_id error: %s\n", nc_strerror(nc_status));
-	    dims[0] = mbHistoryRecNbr_id;
-	    nc_status = nc_def_var(mb_io_ptr->ncid, "mbHistCode", NC_CHAR, 1, dims, &storelocal->mbHistCode_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_def_var mbHistCode_id error: %s\n", nc_strerror(nc_status));
-	    dims[0] = mbHistoryRecNbr_id;
-	    dims[1] = mbNameLength_id;
-	    nc_status = nc_def_var(mb_io_ptr->ncid, "mbHistAutor", NC_CHAR, 2, dims, &storelocal->mbHistAutor_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_def_var mbHistAutor_id error: %s\n", nc_strerror(nc_status));
-	    dims[0] = mbHistoryRecNbr_id;
-	    dims[1] = mbNameLength_id;
-	    nc_status = nc_def_var(mb_io_ptr->ncid, "mbHistModule", NC_CHAR, 2, dims, &storelocal->mbHistModule_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_def_var mbHistModule_id error: %s\n", nc_strerror(nc_status));
-	    dims[0] = mbHistoryRecNbr_id;
-	    dims[1] = mbCommentLength_id;
-	    nc_status = nc_def_var(mb_io_ptr->ncid, "mbHistComment", NC_CHAR, 2, dims, &storelocal->mbHistComment_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_def_var mbHistComment_id error: %s\n", nc_strerror(nc_status));
-
-	    /* define per ping variables */
-	    if (storelocal->CIB_BLOCK_DIM > 0)
-	    	{
-		dimsNbr = 3;
-	    	dims[0] = mbCycleNbr_id;
-	    	dims[1] = CIB_BLOCK_DIM_id;
-	    	dims[2] = mbAntennaNbr_id;
-		}
-	    else
-		{
-		dimsNbr = 2;
-	    	dims[0] = mbCycleNbr_id;
-	    	dims[1] = mbAntennaNbr_id;
-	    	dims[2] = 0;
-		}
-	    nc_status = nc_def_var(mb_io_ptr->ncid, "mbCycle", NC_INT, dimsNbr, dims, &storelocal->mbCycle_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_def_var mbCycle_id error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_def_var(mb_io_ptr->ncid, "mbDate", NC_INT, dimsNbr, dims, &storelocal->mbDate_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_def_var mbDate_id error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_def_var(mb_io_ptr->ncid, "mbTime", NC_INT, dimsNbr, dims, &storelocal->mbTime_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_def_var mbTime_id error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_def_var(mb_io_ptr->ncid, "mbOrdinate", NC_INT, dimsNbr, dims, &storelocal->mbOrdinate_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_def_var mbOrdinate_id error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_def_var(mb_io_ptr->ncid, "mbAbscissa", NC_INT, dimsNbr, dims, &storelocal->mbAbscissa_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_def_var mbAbscissa_id error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_def_var(mb_io_ptr->ncid, "mbFrequency", NC_CHAR, dimsNbr, dims, &storelocal->mbFrequency_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_def_var mbFrequency_id error: %s\n", nc_strerror(nc_status));
-	    if (extended == MB_YES)
-		{
-	    	nc_status = nc_def_var(mb_io_ptr->ncid, "mbSonarFrequency", NC_INT, dimsNbr, dims, &storelocal->mbSonarFrequency_id);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_def_var mbSonarFrequency_id error: %s\n", nc_strerror(nc_status));
-		}
-	    nc_status = nc_def_var(mb_io_ptr->ncid, "mbSounderMode", NC_CHAR, dimsNbr, dims, &storelocal->mbSounderMode_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_def_var mbSounderMode_id error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_def_var(mb_io_ptr->ncid, "mbReferenceDepth", NC_INT, dimsNbr, dims, &storelocal->mbReferenceDepth_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_def_var mbReferenceDepth_id error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_def_var(mb_io_ptr->ncid, "mbDynamicDraught", NC_SHORT, dimsNbr, dims, &storelocal->mbDynamicDraught_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_def_var mbDynamicDraught_id error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_def_var(mb_io_ptr->ncid, "mbTide", NC_SHORT, dimsNbr, dims, &storelocal->mbTide_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_def_var mbTide_id error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_def_var(mb_io_ptr->ncid, "mbSoundVelocity", NC_SHORT, dimsNbr, dims, &storelocal->mbSoundVelocity_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_def_var mbSoundVelocity_id error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_def_var(mb_io_ptr->ncid, "mbHeading", NC_SHORT, dimsNbr, dims, &storelocal->mbHeading_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_def_var mbHeading_id error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_def_var(mb_io_ptr->ncid, "mbRoll", NC_SHORT, dimsNbr, dims, &storelocal->mbRoll_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_def_var mbRoll_id error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_def_var(mb_io_ptr->ncid, "mbPitch", NC_SHORT, dimsNbr, dims, &storelocal->mbPitch_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_def_var mbPitch_id error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_def_var(mb_io_ptr->ncid, "mbTransmissionHeave", NC_SHORT, dimsNbr, dims, &storelocal->mbTransmissionHeave_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_def_var mbTransmissionHeave_id error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_def_var(mb_io_ptr->ncid, "mbDistanceScale", NC_CHAR, dimsNbr, dims, &storelocal->mbDistanceScale_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_def_var mbDistanceScale_id error: %s\n", nc_strerror(nc_status));
-	    if (extended == MB_YES)
-	        {
-	        nc_status = nc_def_var(mb_io_ptr->ncid, "mbRangeScale", NC_SHORT, dimsNbr, dims, &storelocal->mbRangeScale_id);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_def_var mbRangeScale_id error: %s\n", nc_strerror(nc_status));
-	        }
-	    nc_status = nc_def_var(mb_io_ptr->ncid, "mbDepthScale", NC_CHAR, dimsNbr, dims, &storelocal->mbDepthScale_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_def_var mbDepthScale_id error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_def_var(mb_io_ptr->ncid, "mbVerticalDepth", NC_INT, dimsNbr, dims, &storelocal->mbVerticalDepth_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_def_var mbVerticalDepth_id error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_def_var(mb_io_ptr->ncid, "mbCQuality", NC_CHAR, dimsNbr, dims, &storelocal->mbCQuality_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_def_var mbCQuality_id error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_def_var(mb_io_ptr->ncid, "mbCFlag", NC_CHAR, dimsNbr, dims, &storelocal->mbCFlag_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_def_var mbCFlag_id error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_def_var(mb_io_ptr->ncid, "mbInterlacing", NC_CHAR, dimsNbr, dims, &storelocal->mbInterlacing_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_def_var mbInterlacing_id error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_def_var(mb_io_ptr->ncid, "mbSamplingRate", NC_SHORT, dimsNbr, dims, &storelocal->mbSamplingRate_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_def_var mbSamplingRate_id error: %s\n", nc_strerror(nc_status));
-	    if (extended == MB_YES)
-		{
-	        nc_status = nc_def_var(mb_io_ptr->ncid, "mbCompensationLayerMode", NC_CHAR, dimsNbr, dims, &storelocal->mbCompensationLayerMode_id);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_def_var mbCompensationLayerMode_id error: %s\n", nc_strerror(nc_status));
-	        nc_status = nc_def_var(mb_io_ptr->ncid, "mbTransmitBeamwidth", NC_SHORT, dimsNbr, dims, &storelocal->mbTransmitBeamwidth_id);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_def_var mbTransmitBeamwidth_id error: %s\n", nc_strerror(nc_status));
-	        nc_status = nc_def_var(mb_io_ptr->ncid, "mbReceiveBeamwidth", NC_CHAR, dimsNbr, dims, &storelocal->mbReceiveBeamwidth_id);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_def_var mbReceiveBeamwidth_id error: %s\n", nc_strerror(nc_status));
-	        nc_status = nc_def_var(mb_io_ptr->ncid, "mbTransmitPulseLength", NC_SHORT, dimsNbr, dims, &storelocal->mbTransmitPulseLength_id);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_def_var mbTransmitPulseLength_id error: %s\n", nc_strerror(nc_status));
-	        }
-
-
-	    /* define per beam variables */
-	    if (storelocal->CIB_BLOCK_DIM > 0)
-	    	{
-		dimsNbr = 3;
-	    	dims[0] = mbCycleNbr_id;
-	    	dims[2] = CIB_BLOCK_DIM_id;
-	    	dims[2] = mbBeamNbr_id;
-		}
-	    else
-		{
-		dimsNbr = 2;
-	    	dims[0] = mbCycleNbr_id;
-	    	dims[1] = mbBeamNbr_id;
-	    	dims[2] = 0;
-		}
-	    nc_status = nc_def_var(mb_io_ptr->ncid, "mbAlongDistance", NC_SHORT, dimsNbr, dims, &storelocal->mbAlongDistance_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_def_var mbAlongDistance_id error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_def_var(mb_io_ptr->ncid, "mbAcrossDistance", NC_SHORT, dimsNbr, dims, &storelocal->mbAcrossDistance_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_def_var mbAcrossDistance_id error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_def_var(mb_io_ptr->ncid, "mbDepth", NC_INT, dimsNbr, dims, &storelocal->mbDepth_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_def_var mbDepth_id error: %s\n", nc_strerror(nc_status));
-	    if (extended == MB_YES)
-		{
-		nc_status = nc_def_var(mb_io_ptr->ncid, "mbAcrossBeamAngle", NC_SHORT, dimsNbr, dims, &storelocal->mbAcrossBeamAngle_id);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_def_var mbAcrossBeamAngle_id error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_def_var(mb_io_ptr->ncid, "mbAzimutBeamAngle", NC_SHORT, dimsNbr, dims, &storelocal->mbAzimutBeamAngle_id);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_def_var mbAzimutBeamAngle_id error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_def_var(mb_io_ptr->ncid, "mbRange", NC_SHORT, dimsNbr, dims, &storelocal->mbRange_id);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_def_var mbRange_id error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_def_var(mb_io_ptr->ncid, "mbSoundingBias", NC_SHORT, dimsNbr, dims, &storelocal->mbSoundingBias_id);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_def_var mbSoundingBias_id error: %s\n", nc_strerror(nc_status));
-		}
-	    nc_status = nc_def_var(mb_io_ptr->ncid, "mbSQuality", NC_CHAR, dimsNbr, dims, &storelocal->mbSQuality_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_def_var mbSQuality_id error: %s\n", nc_strerror(nc_status));
-	    if (extended == MB_YES)
-		{
-		nc_status = nc_def_var(mb_io_ptr->ncid, "mbReflectivity", NC_CHAR, dimsNbr, dims, &storelocal->mbReflectivity_id);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_def_var mbReflectivity_id error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_def_var(mb_io_ptr->ncid, "mbReceptionHeave", NC_CHAR, dimsNbr, dims, &storelocal->mbReceptionHeave_id);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_def_var mbReceptionHeave_id error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_def_var(mb_io_ptr->ncid, "mbAlongSlope", NC_SHORT, dimsNbr, dims, &storelocal->mbAlongSlope_id);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_def_var mbAlongSlope_id error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_def_var(mb_io_ptr->ncid, "mbAcrossSlope", NC_SHORT, dimsNbr, dims, &storelocal->mbAcrossSlope_id);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_def_var mbAcrossSlope_id error: %s\n", nc_strerror(nc_status));
-		}
-	    nc_status = nc_def_var(mb_io_ptr->ncid, "mbSFlag", NC_CHAR, dimsNbr, dims, &storelocal->mbSFlag_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_def_var mbSFlag_id error: %s\n", nc_strerror(nc_status));
-	    if (extended == MB_YES)
-		{
-		nc_status = nc_def_var(mb_io_ptr->ncid, "mbSLengthOfDetection", NC_CHAR, dimsNbr, dims, &storelocal->mbSLengthOfDetection_id);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_def_var mbSLengthOfDetection_id error: %s\n", nc_strerror(nc_status));
-		}
-
-	    dimsNbr = 1;
-	    dims[0] = mbBeamNbr_id;
-	    nc_status = nc_def_var(mb_io_ptr->ncid, "mbAntenna", NC_CHAR, dimsNbr, dims, &storelocal->mbAntenna_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_def_var mbAntenna_id error: %s\n", nc_strerror(nc_status));
-	    if (extended != MB_YES)
-		{
-	    nc_status = nc_def_var(mb_io_ptr->ncid, "mbBeamBias", NC_SHORT, dimsNbr, dims, &storelocal->mbBeamBias_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_def_var mbBeamBias_id error: %s\n", nc_strerror(nc_status));
-		}
-	    nc_status = nc_def_var(mb_io_ptr->ncid, "mbBFlag", NC_CHAR, dimsNbr, dims, &storelocal->mbBFlag_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_def_var mbBFlag_id error: %s\n", nc_strerror(nc_status));
-
-	    /* define global variables */
-	    dimsNbr = 1;
-	    dims[0] = mbAntennaNbr_id;
-	    nc_status = nc_def_var(mb_io_ptr->ncid, "mbBeam", NC_SHORT, dimsNbr, dims, &storelocal->mbBeam_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_def_var mbBeam_id error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_def_var(mb_io_ptr->ncid, "mbAFlag", NC_CHAR, dimsNbr, dims, &storelocal->mbAFlag_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_def_var mbAFlag_id error: %s\n", nc_strerror(nc_status));
-	    dimsNbr = 2;
-	    dims[0] = mbVelocityProfilNbr_id;
-	    dims[1] = mbCommentLength_id;
-	    nc_status = nc_def_var(mb_io_ptr->ncid, "mbVelProfilRef", NC_CHAR, dimsNbr, dims, &storelocal->mbVelProfilRef_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_def_var mbVelProfilRef_id error: %s\n", nc_strerror(nc_status));
-	    dimsNbr = 1;
-	    dims[0] = mbVelocityProfilNbr_id;
-	    nc_status = nc_def_var(mb_io_ptr->ncid, "mbVelProfilIdx", NC_SHORT, dimsNbr, dims, &storelocal->mbVelProfilIdx_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_def_var mbVelProfilIdx_id error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_def_var(mb_io_ptr->ncid, "mbVelProfilDate", NC_INT, dimsNbr, dims, &storelocal->mbVelProfilDate_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_def_var mbVelProfilDate_id error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_def_var(mb_io_ptr->ncid, "mbVelProfilTime", NC_INT, dimsNbr, dims, &storelocal->mbVelProfilTime_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_def_var mbVelProfilTime_id error: %s\n", nc_strerror(nc_status));
-
-	    /* print input debug statements */
-	    if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  NetCDF variable ids written in function <%s>\n",function_name);
-		fprintf(stderr,"dbg2  Variable ids:\n");
-		fprintf(stderr,"dbg2       status:                  %d\n", status);
-		fprintf(stderr,"dbg2       error:                   %d\n", *error);
-		fprintf(stderr,"dbg2       nc_status:               %d\n", nc_status);
-		fprintf(stderr,"dbg2       mbHistDate_id:           %d\n", storelocal->mbHistDate_id);
-		fprintf(stderr,"dbg2       mbHistTime_id:           %d\n", storelocal->mbHistTime_id);
-		fprintf(stderr,"dbg2       mbHistCode_id:           %d\n", storelocal->mbHistCode_id);
-		fprintf(stderr,"dbg2       mbHistAutor_id:          %d\n", storelocal->mbHistAutor_id);
-		fprintf(stderr,"dbg2       mbHistModule_id:         %d\n", storelocal->mbHistModule_id);
-		fprintf(stderr,"dbg2       mbHistComment_id:        %d\n", storelocal->mbHistComment_id);
-		fprintf(stderr,"dbg2       mbCycle_id:              %d\n", storelocal->mbCycle_id);
-		fprintf(stderr,"dbg2       mbDate_id:               %d\n", storelocal->mbDate_id);
-		fprintf(stderr,"dbg2       mbTime_id:               %d\n", storelocal->mbTime_id);
-		fprintf(stderr,"dbg2       mbOrdinate_id:           %d\n", storelocal->mbOrdinate_id);
-		fprintf(stderr,"dbg2       mbAbscissa_id:           %d\n", storelocal->mbAbscissa_id);
-		fprintf(stderr,"dbg2       mbFrequency_id:          %d\n", storelocal->mbFrequency_id);
-		fprintf(stderr,"dbg2       mbSounderMode_id:        %d\n", storelocal->mbSounderMode_id);
-		fprintf(stderr,"dbg2       mbReferenceDepth_id:     %d\n", storelocal->mbReferenceDepth_id);
-		fprintf(stderr,"dbg2       mbDynamicDraught_id:     %d\n", storelocal->mbDynamicDraught_id);
-		fprintf(stderr,"dbg2       mbTide_id:               %d\n", storelocal->mbTide_id);
-		fprintf(stderr,"dbg2       mbSoundVelocity_id:      %d\n", storelocal->mbSoundVelocity_id);
-		fprintf(stderr,"dbg2       mbHeading_id:            %d\n", storelocal->mbHeading_id);
-		fprintf(stderr,"dbg2       mbRoll_id:               %d\n", storelocal->mbRoll_id);
-		fprintf(stderr,"dbg2       mbPitch_id:              %d\n", storelocal->mbPitch_id);
-		fprintf(stderr,"dbg2       mbTransmissionHeave_id:  %d\n", storelocal->mbTransmissionHeave_id);
-		fprintf(stderr,"dbg2       mbDistanceScale_id:      %d\n", storelocal->mbDistanceScale_id);
-		fprintf(stderr,"dbg2       mbDepthScale_id:         %d\n", storelocal->mbDepthScale_id);
-		fprintf(stderr,"dbg2       mbVerticalDepth_id:      %d\n", storelocal->mbVerticalDepth_id);
-		fprintf(stderr,"dbg2       mbCQuality_id:           %d\n", storelocal->mbCQuality_id);
-		fprintf(stderr,"dbg2       mbCFlag_id:              %d\n", storelocal->mbCFlag_id);
-		fprintf(stderr,"dbg2       mbInterlacing_id:        %d\n", storelocal->mbInterlacing_id);
-		fprintf(stderr,"dbg2       mbSamplingRate_id:       %d\n", storelocal->mbSamplingRate_id);
-		fprintf(stderr,"dbg2       mbAlongDistance_id:      %d\n", storelocal->mbAlongDistance_id);
-		fprintf(stderr,"dbg2       mbAcrossDistance_id:     %d\n", storelocal->mbAcrossDistance_id);
-		fprintf(stderr,"dbg2       mbDepth_id:              %d\n", storelocal->mbDepth_id);
-		fprintf(stderr,"dbg2       mbSQuality_id:           %d\n", storelocal->mbSQuality_id);
-		fprintf(stderr,"dbg2       mbSFlag_id:              %d\n", storelocal->mbSFlag_id);
-		fprintf(stderr,"dbg2       mbAntenna_id:            %d\n", storelocal->mbAntenna_id);
-		fprintf(stderr,"dbg2       mbBeamBias_id:           %d\n", storelocal->mbBeamBias_id);
-		fprintf(stderr,"dbg2       mbBFlag_id:              %d\n", storelocal->mbBFlag_id);
-		fprintf(stderr,"dbg2       mbBeam_id:               %d\n", storelocal->mbBeam_id);
-		fprintf(stderr,"dbg2       mbAFlag_id:              %d\n", storelocal->mbAFlag_id);
-		fprintf(stderr,"dbg2       mbVelProfilRef_id:       %d\n", storelocal->mbVelProfilRef_id);
-		fprintf(stderr,"dbg2       mbVelProfilIdx_id:       %d\n", storelocal->mbVelProfilIdx_id);
-		fprintf(stderr,"dbg2       mbVelProfilDate_id:      %d\n", storelocal->mbVelProfilDate_id);
-		fprintf(stderr,"dbg2       mbVelProfilTime_id:      %d\n", storelocal->mbVelProfilTime_id);
-		}
-
-	    /* save the global attributes */
-	    nc_status = nc_put_att_short(mb_io_ptr->ncid, NC_GLOBAL, "mbVersion", NC_SHORT, 1, &store->mbVersion);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbVersion error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, NC_GLOBAL, "mbName", MBSYS_NETCDF_ATTRIBUTELEN, store->mbName);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbName error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, NC_GLOBAL, "mbClasse", MBSYS_NETCDF_ATTRIBUTELEN, store->mbClasse);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbClasse error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_short(mb_io_ptr->ncid, NC_GLOBAL, "mbLevel", NC_SHORT, 1, &store->mbLevel);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbLevel error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_short(mb_io_ptr->ncid, NC_GLOBAL, "mbNbrHistoryRec", NC_SHORT, 1, &storelocal->mbNbrHistoryRec);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbNbrHistoryRec error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, NC_GLOBAL, "mbTimeReference", MBSYS_NETCDF_ATTRIBUTELEN, store->mbTimeReference);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbTimeReference error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, NC_GLOBAL, "mbStartDate", NC_INT, 1, &store->mbStartDate);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbStartDate error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, NC_GLOBAL, "mbStartTime", NC_INT, 1, &store->mbStartTime);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbStartTime error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, NC_GLOBAL, "mbEndDate", NC_INT, 1, &store->mbEndDate);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbEndDate error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, NC_GLOBAL, "mbEndTime", NC_INT, 1, &store->mbEndTime);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbEndTime error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, NC_GLOBAL, "mbNorthLatitude", NC_DOUBLE, 1, &store->mbNorthLatitude);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbNorthLatitude error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, NC_GLOBAL, "mbSouthLatitude", NC_DOUBLE, 1, &store->mbSouthLatitude);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbSouthLatitude error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, NC_GLOBAL, "mbEastLongitude", NC_DOUBLE, 1, &store->mbEastLongitude);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbEastLongitude error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, NC_GLOBAL, "mbWestLongitude", NC_DOUBLE, 1, &store->mbWestLongitude);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbWestLongitude error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, NC_GLOBAL, "mbMeridian180", MBSYS_NETCDF_ATTRIBUTELEN, store->mbMeridian180);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbMeridian180 error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, NC_GLOBAL, "mbGeoDictionnary", MBSYS_NETCDF_ATTRIBUTELEN, store->mbGeoDictionnary);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbGeoDictionnary error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, NC_GLOBAL, "mbGeoRepresentation", MBSYS_NETCDF_ATTRIBUTELEN, store->mbGeoRepresentation);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbGeoRepresentation error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, NC_GLOBAL, "mbGeodesicSystem", MBSYS_NETCDF_ATTRIBUTELEN, store->mbGeodesicSystem);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbGeodesicSystem error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, NC_GLOBAL, "mbEllipsoidName", MBSYS_NETCDF_COMMENTLEN, store->mbEllipsoidName);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbEllipsoidName error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, NC_GLOBAL, "mbEllipsoidA", NC_DOUBLE, 1, &store->mbEllipsoidA);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbEllipsoidA error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, NC_GLOBAL, "mbEllipsoidInvF", NC_DOUBLE, 1, &store->mbEllipsoidInvF);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbEllipsoidInvF error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, NC_GLOBAL, "mbEllipsoidE2", NC_DOUBLE, 1, &store->mbEllipsoidE2);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbEllipsoidE2 error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_short(mb_io_ptr->ncid, NC_GLOBAL, "mbProjType", NC_SHORT, 1, &store->mbProjType);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbProjType error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, NC_GLOBAL, "mbProjParameterValue", NC_DOUBLE, 10, store->mbProjParameterValue);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbProjParameterValue error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, NC_GLOBAL, "mbProjParameterCode", MBSYS_NETCDF_COMMENTLEN, store->mbProjParameterCode);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbProjParameterCode error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_short(mb_io_ptr->ncid, NC_GLOBAL, "mbSounder", NC_SHORT, 1, &store->mbSounder);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbSounder error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, NC_GLOBAL, "mbShip", MBSYS_NETCDF_COMMENTLEN, store->mbShip);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbShip error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, NC_GLOBAL, "mbSurvey", MBSYS_NETCDF_COMMENTLEN, store->mbSurvey);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbSurvey error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, NC_GLOBAL, "mbReference", MBSYS_NETCDF_COMMENTLEN, store->mbReference);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbReference error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, NC_GLOBAL, "mbAntennaOffset", NC_DOUBLE, 3, store->mbAntennaOffset);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbAntennaOffset error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, NC_GLOBAL, "mbAntennaDelay", NC_DOUBLE, 1, &store->mbAntennaDelay);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbAntennaDelay error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, NC_GLOBAL, "mbSounderOffset", NC_DOUBLE, 3, store->mbSounderOffset);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbSounderOffset error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, NC_GLOBAL, "mbSounderDelay", NC_DOUBLE, 1, &store->mbSounderDelay);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbSounderDelay error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, NC_GLOBAL, "mbVRUOffset", NC_DOUBLE, 3, store->mbVRUOffset);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbVRUOffset error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, NC_GLOBAL, "mbVRUDelay", NC_DOUBLE, 1, &store->mbVRUDelay);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbVRUDelay error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, NC_GLOBAL, "mbHeadingBias", NC_DOUBLE, 1, &store->mbHeadingBias);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbHeadingBias error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, NC_GLOBAL, "mbRollBias", NC_DOUBLE, 1, &store->mbRollBias);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbRollBias error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, NC_GLOBAL, "mbPitchBias", NC_DOUBLE, 1, &store->mbPitchBias);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbPitchBias error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, NC_GLOBAL, "mbHeaveBias", NC_DOUBLE, 1, &store->mbHeaveBias);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbHeaveBias error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, NC_GLOBAL, "mbDraught", NC_DOUBLE, 1, &store->mbDraught);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbDraught error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_short(mb_io_ptr->ncid, NC_GLOBAL, "mbNavType", NC_SHORT, 1, &store->mbNavType);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbNavType error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, NC_GLOBAL, "mbNavRef", MBSYS_NETCDF_COMMENTLEN, store->mbNavRef);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbNavRef error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_short(mb_io_ptr->ncid, NC_GLOBAL, "mbTideType", NC_SHORT, 1, &store->mbTideType);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbTideType error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, NC_GLOBAL, "mbTideRef", MBSYS_NETCDF_COMMENTLEN, store->mbTideRef);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbTideRef error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, NC_GLOBAL, "mbMinDepth", NC_DOUBLE, 1, &store->mbMinDepth);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbMinDepth error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, NC_GLOBAL, "mbMaxDepth", NC_DOUBLE, 1, &store->mbMaxDepth);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbMaxDepth error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, NC_GLOBAL, "mbCycleCounter", NC_INT, 1, &store->mbCycleCounter);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbVersion error: %s\n", nc_strerror(nc_status));
-
-	    /* print input debug statements */
-	    if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  NetCDF global attributes written in function <%s>\n",function_name);
-		fprintf(stderr,"dbg2  Global attributes:\n");
-		fprintf(stderr,"dbg2       status:                  %d\n", status);
-		fprintf(stderr,"dbg2       error:                   %d\n", *error);
-		fprintf(stderr,"dbg2       nc_status:             %d\n", nc_status);
-		fprintf(stderr,"dbg2       mbVersion:             %d\n", store->mbVersion);
-		fprintf(stderr,"dbg2       mbName:                %s\n", store->mbName);
-		fprintf(stderr,"dbg2       mbClasse:              %s\n", store->mbClasse);
-		fprintf(stderr,"dbg2       mbLevel:               %d\n", store->mbLevel);
-		fprintf(stderr,"dbg2       mbNbrHistoryRec:       %d\n", store->mbNbrHistoryRec);
-		fprintf(stderr,"dbg2       mbTimeReference:       %s\n", store->mbTimeReference);
-		fprintf(stderr,"dbg2       mbStartDate:           %d\n", store->mbStartDate);
-		fprintf(stderr,"dbg2       mbStartTime:           %d\n", store->mbStartTime);
-		fprintf(stderr,"dbg2       mbEndDate:             %d\n", store->mbEndDate);
-		fprintf(stderr,"dbg2       mbEndTime:             %d\n", store->mbEndTime);
-		fprintf(stderr,"dbg2       mbNorthLatitude:       %f\n", store->mbNorthLatitude);
-		fprintf(stderr,"dbg2       mbSouthLatitude:       %f\n", store->mbSouthLatitude);
-		fprintf(stderr,"dbg2       mbEastLongitude:       %f\n", store->mbEastLongitude);
-		fprintf(stderr,"dbg2       mbWestLongitude:       %f\n", store->mbWestLongitude);
-		fprintf(stderr,"dbg2       mbMeridian180:         %s\n", store->mbMeridian180);
-		fprintf(stderr,"dbg2       mbGeoDictionnary:      %s\n", store->mbGeoDictionnary);
-		fprintf(stderr,"dbg2       mbGeoRepresentation:   %s\n", store->mbGeoRepresentation);
-		fprintf(stderr,"dbg2       mbGeodesicSystem:      %s\n", store->mbGeodesicSystem);
-		fprintf(stderr,"dbg2       mbEllipsoidName:       %s\n", store->mbEllipsoidName);
-		fprintf(stderr,"dbg2       mbEllipsoidA:          %f\n", store->mbEllipsoidA);
-		fprintf(stderr,"dbg2       mbEllipsoidInvF:       %f\n", store->mbEllipsoidInvF);
-		fprintf(stderr,"dbg2       mbEllipsoidE2:         %f\n", store->mbEllipsoidE2);
-		fprintf(stderr,"dbg2       mbProjType:            %d\n", store->mbProjType);
-		for (i=0;i<10;i++)
-		    fprintf(stderr,"dbg2       mbProjParameterValue[%d]:%f\n", i, store->mbProjParameterValue[i]);
-		fprintf(stderr,"dbg2       mbProjParameterCode:   %s\n", store->mbProjParameterCode);
-		fprintf(stderr,"dbg2       mbSounder:             %d\n", store->mbSounder);
-		fprintf(stderr,"dbg2       mbShip:                %s\n", store->mbShip);
-		fprintf(stderr,"dbg2       mbSurvey:              %s\n", store->mbSurvey);
-		fprintf(stderr,"dbg2       mbReference:           %s\n", store->mbReference);
-		for (i=0;i<3;i++)
-		    fprintf(stderr,"dbg2       mbAntennaOffset[%d]:    %f\n", i, store->mbAntennaOffset[i]);
-		fprintf(stderr,"dbg2       mbAntennaDelay:        %f\n", store->mbAntennaDelay);
-		for (i=0;i<3;i++)
-		    fprintf(stderr,"dbg2       mbSounderOffset[%d]:    %f\n", i, store->mbSounderOffset[i]);
-		fprintf(stderr,"dbg2       mbSounderDelay:        %f\n", store->mbSounderDelay);
-		for (i=0;i<3;i++)
-		    fprintf(stderr,"dbg2       mbVRUOffset[%d]:        %f\n", i, store->mbVRUOffset[i]);
-		fprintf(stderr,"dbg2       mbVRUDelay:            %f\n", store->mbVRUDelay);
-		fprintf(stderr,"dbg2       mbHeadingBias:         %f\n", store->mbHeadingBias);
-		fprintf(stderr,"dbg2       mbRollBias:            %f\n", store->mbRollBias);
-		fprintf(stderr,"dbg2       mbPitchBias:           %f\n", store->mbPitchBias);
-		fprintf(stderr,"dbg2       mbHeaveBias:           %f\n", store->mbHeaveBias);
-		fprintf(stderr,"dbg2       mbDraught:             %f\n", store->mbDraught);
-		fprintf(stderr,"dbg2       mbNavType:             %d\n", store->mbNavType);
-		fprintf(stderr,"dbg2       mbNavRef:              %s\n", store->mbNavRef);
-		fprintf(stderr,"dbg2       mbTideType:            %d\n", store->mbTideType);
-		fprintf(stderr,"dbg2       mbTideRef:             %s\n", store->mbTideRef);
-		fprintf(stderr,"dbg2       mbMinDepth:            %f\n", store->mbMinDepth);
-		fprintf(stderr,"dbg2       mbMaxDepth:            %f\n", store->mbMaxDepth);
-		fprintf(stderr,"dbg2       mbCycleCounter:        %d\n", store->mbCycleCounter);
-		}
-
-	    /* save the variable attributes */
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbHistDate_id, "type", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbHistDate_type);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbHistDate_id, "long_name", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbHistDate_long_name);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbHistDate_id, "name_code", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbHistDate_name_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbHistDate_id, "units", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbHistDate_units);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbHistDate_id, "unit_code", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbHistDate_unit_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbHistDate_id, "add_offset", NC_INT, 1, &storelocal->mbHistDate_add_offset);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbHistDate_add_offset error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbHistDate_id, "scale_factor", NC_INT, 1, &storelocal->mbHistDate_scale_factor);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbHistDate_scale_factor error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbHistDate_id, "minimum", NC_INT, 1, &storelocal->mbHistDate_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbHistDate_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbHistDate_id, "maximum", NC_INT, 1, &storelocal->mbHistDate_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbHistDate_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbHistDate_id, "valid_minimum", NC_INT, 1, &storelocal->mbHistDate_valid_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbHistDate_valid_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbHistDate_id, "valid_maximum", NC_INT, 1, &storelocal->mbHistDate_valid_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbHistDate_valid_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbHistDate_id, "missing_value", NC_INT, 1, &storelocal->mbHistDate_missing_value);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbHistDate_missing_value error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbHistDate_id, "format_C", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbHistDate_format_C);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbHistDate_id, "orientation", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbHistDate_orientation);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbHistTime_id, "type", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbHistTime_type);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbHistTime_id, "long_name", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbHistTime_long_name);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbHistTime_id, "name_code", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbHistTime_name_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbHistTime_id, "units", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbHistTime_units);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbHistTime_id, "unit_code", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbHistTime_unit_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbHistTime_id, "add_offset", NC_INT, 1, &storelocal->mbHistTime_add_offset);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbHistTime_add_offset error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbHistTime_id, "scale_factor", NC_INT, 1, &storelocal->mbHistTime_scale_factor);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbHistTime_scale_factor error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbHistTime_id, "minimum", NC_INT, 1, &storelocal->mbHistTime_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbHistTime_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbHistTime_id, "maximum", NC_INT, 1, &storelocal->mbHistTime_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbHistTime_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbHistTime_id, "valid_minimum", NC_INT, 1, &storelocal->mbHistTime_valid_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbHistTime_valid_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbHistTime_id, "valid_maximum", NC_INT, 1, &storelocal->mbHistTime_valid_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbHistTime_valid_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbHistTime_id, "missing_value", NC_INT, 1, &storelocal->mbHistTime_missing_value);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbHistTime_missing_value error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbHistTime_id, "format_C", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbHistTime_format_C);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbHistTime_id, "orientation", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbHistTime_orientation);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbHistCode_id, "type", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbHistCode_type);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbHistCode_id, "long_name", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbHistCode_long_name);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbHistCode_id, "name_code", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbHistCode_name_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbHistCode_id, "units", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbHistCode_units);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbHistCode_id, "unit_code", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbHistCode_unit_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbHistCode_id, "add_offset", NC_INT, 1, &storelocal->mbHistCode_add_offset);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbHistCode_add_offset error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbHistCode_id, "scale_factor", NC_INT, 1, &storelocal->mbHistCode_scale_factor);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbHistCode_scale_factor error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbHistCode_id, "minimum", NC_INT, 1, &storelocal->mbHistCode_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbHistCode_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbHistCode_id, "maximum", NC_INT, 1, &storelocal->mbHistCode_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbHistCode_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbHistCode_id, "valid_minimum", NC_INT, 1, &storelocal->mbHistCode_valid_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbHistCode_valid_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbHistCode_id, "valid_maximum", NC_INT, 1, &storelocal->mbHistCode_valid_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbHistCode_valid_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbHistCode_id, "missing_value", NC_INT, 1, &storelocal->mbHistCode_missing_value);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbHistCode_missing_value error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbHistCode_id, "format_C", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbHistCode_format_C);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbHistCode_id, "orientation", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbHistCode_orientation);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbHistAutor_id, "type", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbHistAutor_type);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbHistAutor_id, "long_name", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbHistAutor_long_name);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbHistAutor_id, "name_code", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbHistAutor_name_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbHistModule_id, "type", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbHistModule_type);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbHistModule_id, "long_name", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbHistModule_long_name);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbHistModule_id, "name_code", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbHistModule_name_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbHistComment_id, "type", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbHistComment_type);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbHistComment_id, "long_name", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbHistComment_long_name);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbHistComment_id, "name_code", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbHistComment_name_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbCycle_id, "type", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbCycle_type);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbCycle_id, "long_name", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbCycle_long_name);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbCycle_id, "name_code", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbCycle_name_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbCycle_id, "units", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbCycle_units);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbCycle_id, "unit_code", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbCycle_unit_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbCycle_id, "add_offset", NC_INT, 1, &storelocal->mbCycle_add_offset);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbCycle_add_offset error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbCycle_id, "scale_factor", NC_INT, 1, &storelocal->mbCycle_scale_factor);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbCycle_scale_factor error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbCycle_id, "minimum", NC_INT, 1, &storelocal->mbCycle_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbCycle_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbCycle_id, "maximum", NC_INT, 1, &storelocal->mbCycle_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbCycle_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbCycle_id, "valid_minimum", NC_INT, 1, &storelocal->mbCycle_valid_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbCycle_valid_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbCycle_id, "valid_maximum", NC_INT, 1, &storelocal->mbCycle_valid_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbCycle_valid_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbCycle_id, "missing_value", NC_INT, 1, &storelocal->mbCycle_missing_value);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbCycle_missing_value error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbCycle_id, "format_C", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbCycle_format_C);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbCycle_id, "orientation", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbCycle_orientation);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbDate_id, "type", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbDate_type);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbDate_id, "long_name", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbDate_long_name);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbDate_id, "name_code", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbDate_name_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbDate_id, "units", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbDate_units);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbDate_id, "unit_code", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbDate_unit_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbDate_id, "add_offset", NC_INT, 1, &storelocal->mbDate_add_offset);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbDate_add_offset error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbDate_id, "scale_factor", NC_INT, 1, &storelocal->mbDate_scale_factor);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbDate_scale_factor error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbDate_id, "minimum", NC_INT, 1, &storelocal->mbDate_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbDate_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbDate_id, "maximum", NC_INT, 1, &storelocal->mbDate_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbDate_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbDate_id, "valid_minimum", NC_INT, 1, &storelocal->mbDate_valid_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbDate_valid_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbDate_id, "valid_maximum", NC_INT, 1, &storelocal->mbDate_valid_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbDate_valid_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbDate_id, "missing_value", NC_INT, 1, &storelocal->mbDate_missing_value);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbDate_missing_value error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbDate_id, "format_C", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbDate_format_C);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbDate_id, "orientation", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbDate_orientation);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbTime_id, "type", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbTime_type);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbTime_id, "long_name", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbTime_long_name);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbTime_id, "name_code", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbTime_name_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbTime_id, "units", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbTime_units);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbTime_id, "unit_code", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbTime_unit_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbTime_id, "add_offset", NC_INT, 1, &storelocal->mbTime_add_offset);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbTime_add_offset error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbTime_id, "scale_factor", NC_INT, 1, &storelocal->mbTime_scale_factor);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbTime_scale_factor error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbTime_id, "minimum", NC_INT, 1, &storelocal->mbTime_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbTime_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbTime_id, "maximum", NC_INT, 1, &storelocal->mbTime_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbTime_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbTime_id, "valid_minimum", NC_INT, 1, &storelocal->mbTime_valid_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbTime_valid_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbTime_id, "valid_maximum", NC_INT, 1, &storelocal->mbTime_valid_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbTime_valid_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbTime_id, "missing_value", NC_INT, 1, &storelocal->mbTime_missing_value);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbTime_missing_value error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbTime_id, "format_C", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbTime_format_C);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbTime_id, "orientation", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbTime_orientation);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbOrdinate_id, "type", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbOrdinate_type);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbOrdinate_id, "long_name", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbOrdinate_long_name);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbOrdinate_id, "name_code", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbOrdinate_name_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbOrdinate_id, "units", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbOrdinate_units);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbOrdinate_id, "unit_code", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbOrdinate_unit_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, storelocal->mbOrdinate_id, "add_offset", NC_DOUBLE, 1, &storelocal->mbOrdinate_add_offset);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbOrdinate_add_offset error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, storelocal->mbOrdinate_id, "scale_factor", NC_DOUBLE, 1, &storelocal->mbOrdinate_scale_factor);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbOrdinate_scale_factor error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, storelocal->mbOrdinate_id, "minimum", NC_DOUBLE, 1, &storelocal->mbOrdinate_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbOrdinate_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, storelocal->mbOrdinate_id, "maximum", NC_DOUBLE, 1, &storelocal->mbOrdinate_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbOrdinate_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbOrdinate_id, "valid_minimum", NC_INT, 1, &storelocal->mbOrdinate_valid_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbOrdinate_valid_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbOrdinate_id, "valid_maximum", NC_INT, 1, &storelocal->mbOrdinate_valid_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbOrdinate_valid_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbOrdinate_id, "missing_value", NC_INT, 1, &storelocal->mbOrdinate_missing_value);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbOrdinate_missing_value error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbOrdinate_id, "format_C", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbOrdinate_format_C);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbOrdinate_id, "orientation", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbOrdinate_orientation);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbAbscissa_id, "type", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbAbscissa_type);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbAbscissa_id, "long_name", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbAbscissa_long_name);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbAbscissa_id, "name_code", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbAbscissa_name_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbAbscissa_id, "units", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbAbscissa_units);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbAbscissa_id, "unit_code", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbAbscissa_unit_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, storelocal->mbAbscissa_id, "add_offset", NC_DOUBLE, 1, &storelocal->mbAbscissa_add_offset);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbAbscissa_add_offset error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, storelocal->mbAbscissa_id, "scale_factor", NC_DOUBLE, 1, &storelocal->mbAbscissa_scale_factor);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbAbscissa_scale_factor error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, storelocal->mbAbscissa_id, "minimum", NC_DOUBLE, 1, &storelocal->mbAbscissa_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbAbscissa_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, storelocal->mbAbscissa_id, "maximum", NC_DOUBLE, 1, &storelocal->mbAbscissa_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbAbscissa_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbAbscissa_id, "valid_minimum", NC_INT, 1, &storelocal->mbAbscissa_valid_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbAbscissa_valid_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbAbscissa_id, "valid_maximum", NC_INT, 1, &storelocal->mbAbscissa_valid_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbAbscissa_valid_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbAbscissa_id, "missing_value", NC_INT, 1, &storelocal->mbAbscissa_missing_value);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbAbscissa_missing_value error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbAbscissa_id, "format_C", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbAbscissa_format_C);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbAbscissa_id, "orientation", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbAbscissa_orientation);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbFrequency_id, "type", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbFrequency_type);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbFrequency_id, "long_name", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbFrequency_long_name);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbFrequency_id, "name_code", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbFrequency_name_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbFrequency_id, "units", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbFrequency_units);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbFrequency_id, "unit_code", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbFrequency_unit_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbFrequency_id, "add_offset", NC_INT, 1, &storelocal->mbFrequency_add_offset);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbFrequency_add_offset error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbFrequency_id, "scale_factor", NC_INT, 1, &storelocal->mbFrequency_scale_factor);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbFrequency_scale_factor error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbFrequency_id, "minimum", NC_INT, 1, &storelocal->mbFrequency_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbFrequency_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbFrequency_id, "maximum", NC_INT, 1, &storelocal->mbFrequency_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbFrequency_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbFrequency_id, "valid_minimum", NC_INT, 1, &storelocal->mbFrequency_valid_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbFrequency_valid_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbFrequency_id, "valid_maximum", NC_INT, 1, &storelocal->mbFrequency_valid_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbFrequency_valid_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbFrequency_id, "missing_value", NC_INT, 1, &storelocal->mbFrequency_missing_value);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbFrequency_missing_value error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbFrequency_id, "format_C", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbFrequency_format_C);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbFrequency_id, "orientation", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbFrequency_orientation);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    if (extended == MB_YES)
-		{
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbSonarFrequency_id, "type", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbSonarFrequency_type);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbSonarFrequency_id, "long_name", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbSonarFrequency_long_name);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbSonarFrequency_id, "name_code", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbSonarFrequency_name_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbSonarFrequency_id, "units", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbSonarFrequency_units);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbSonarFrequency_id, "unit_code", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbSonarFrequency_unit_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, storelocal->mbSonarFrequency_id, "add_offset", NC_DOUBLE, 1, &storelocal->mbSonarFrequency_add_offset);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbSonarFrequency_add_offset error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, storelocal->mbSonarFrequency_id, "scale_factor", NC_DOUBLE, 1, &storelocal->mbSonarFrequency_scale_factor);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbSonarFrequency_scale_factor error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, storelocal->mbSonarFrequency_id, "minimum", NC_DOUBLE, 1, &storelocal->mbSonarFrequency_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbSonarFrequency_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, storelocal->mbSonarFrequency_id, "maximum", NC_DOUBLE, 1, &storelocal->mbSonarFrequency_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbSonarFrequency_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbSonarFrequency_id, "valid_minimum", NC_INT, 1, &storelocal->mbSonarFrequency_valid_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbSonarFrequency_valid_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbSonarFrequency_id, "valid_maximum", NC_INT, 1, &storelocal->mbSonarFrequency_valid_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbSonarFrequency_valid_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbSonarFrequency_id, "missing_value", NC_INT, 1, &storelocal->mbSonarFrequency_missing_value);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbSonarFrequency_missing_value error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbSonarFrequency_id, "format_C", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbSonarFrequency_format_C);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbSonarFrequency_id, "orientation", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbSonarFrequency_orientation);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-		}
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbSounderMode_id, "type", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbSounderMode_type);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbSounderMode_id, "long_name", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbSounderMode_long_name);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbSounderMode_id, "name_code", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbSounderMode_name_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbSounderMode_id, "units", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbSounderMode_units);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbSounderMode_id, "unit_code", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbSounderMode_unit_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbSounderMode_id, "add_offset", NC_INT, 1, &storelocal->mbSounderMode_add_offset);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbSounderMode_add_offset error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbSounderMode_id, "scale_factor", NC_INT, 1, &storelocal->mbSounderMode_scale_factor);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbSounderMode_scale_factor error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbSounderMode_id, "minimum", NC_INT, 1, &storelocal->mbSounderMode_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbSounderMode_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbSounderMode_id, "maximum", NC_INT, 1, &storelocal->mbSounderMode_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbSounderMode_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbSounderMode_id, "valid_minimum", NC_INT, 1, &storelocal->mbSounderMode_valid_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbSounderMode_valid_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbSounderMode_id, "valid_maximum", NC_INT, 1, &storelocal->mbSounderMode_valid_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbSounderMode_valid_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbSounderMode_id, "missing_value", NC_INT, 1, &storelocal->mbSounderMode_missing_value);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbSounderMode_missing_value error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbSounderMode_id, "format_C", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbSounderMode_format_C);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbSounderMode_id, "orientation", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbSounderMode_orientation);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbReferenceDepth_id, "type", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbReferenceDepth_type);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbReferenceDepth_id, "long_name", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbReferenceDepth_long_name);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbReferenceDepth_id, "name_code", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbReferenceDepth_name_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbReferenceDepth_id, "units", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbReferenceDepth_units);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbReferenceDepth_id, "unit_code", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbReferenceDepth_unit_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, storelocal->mbReferenceDepth_id, "add_offset", NC_DOUBLE, 1, &storelocal->mbReferenceDepth_add_offset);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbReferenceDepth_add_offset error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, storelocal->mbReferenceDepth_id, "scale_factor", NC_DOUBLE, 1, &storelocal->mbReferenceDepth_scale_factor);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbReferenceDepth_scale_factor error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, storelocal->mbReferenceDepth_id, "minimum", NC_DOUBLE, 1, &storelocal->mbReferenceDepth_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbReferenceDepth_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, storelocal->mbReferenceDepth_id, "maximum", NC_DOUBLE, 1, &storelocal->mbReferenceDepth_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbReferenceDepth_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbReferenceDepth_id, "valid_minimum", NC_INT, 1, &storelocal->mbReferenceDepth_valid_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbReferenceDepth_valid_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbReferenceDepth_id, "valid_maximum", NC_INT, 1, &storelocal->mbReferenceDepth_valid_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbReferenceDepth_valid_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbReferenceDepth_id, "missing_value", NC_INT, 1, &storelocal->mbReferenceDepth_missing_value);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbReferenceDepth_missing_value error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbReferenceDepth_id, "format_C", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbReferenceDepth_format_C);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbReferenceDepth_id, "orientation", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbReferenceDepth_orientation);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbDynamicDraught_id, "type", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbDynamicDraught_type);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbDynamicDraught_id, "long_name", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbDynamicDraught_long_name);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbDynamicDraught_id, "name_code", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbDynamicDraught_name_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbDynamicDraught_id, "units", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbDynamicDraught_units);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbDynamicDraught_id, "unit_code", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbDynamicDraught_unit_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, storelocal->mbDynamicDraught_id, "add_offset", NC_DOUBLE, 1, &storelocal->mbDynamicDraught_add_offset);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbDynamicDraught_add_offset error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, storelocal->mbDynamicDraught_id, "scale_factor", NC_DOUBLE, 1, &storelocal->mbDynamicDraught_scale_factor);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbDynamicDraught_scale_factor error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, storelocal->mbDynamicDraught_id, "minimum", NC_DOUBLE, 1, &storelocal->mbDynamicDraught_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbDynamicDraught_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, storelocal->mbDynamicDraught_id, "maximum", NC_DOUBLE, 1, &storelocal->mbDynamicDraught_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbDynamicDraught_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbDynamicDraught_id, "valid_minimum", NC_INT, 1, &storelocal->mbDynamicDraught_valid_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbDynamicDraught_valid_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbDynamicDraught_id, "valid_maximum", NC_INT, 1, &storelocal->mbDynamicDraught_valid_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbDynamicDraught_valid_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbDynamicDraught_id, "missing_value", NC_INT, 1, &storelocal->mbDynamicDraught_missing_value);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbDynamicDraught_missing_value error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbDynamicDraught_id, "format_C", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbDynamicDraught_format_C);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbDynamicDraught_id, "orientation", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbDynamicDraught_orientation);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbTide_id, "type", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbTide_type);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbTide_id, "long_name", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbTide_long_name);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbTide_id, "name_code", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbTide_name_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbTide_id, "units", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbTide_units);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbTide_id, "unit_code", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbTide_unit_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, storelocal->mbTide_id, "add_offset", NC_DOUBLE, 1, &storelocal->mbTide_add_offset);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbTide_add_offset error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, storelocal->mbTide_id, "scale_factor", NC_DOUBLE, 1, &storelocal->mbTide_scale_factor);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbTide_scale_factor error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, storelocal->mbTide_id, "minimum", NC_DOUBLE, 1, &storelocal->mbTide_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbTide_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, storelocal->mbTide_id, "maximum", NC_DOUBLE, 1, &storelocal->mbTide_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbTide_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbTide_id, "valid_minimum", NC_INT, 1, &storelocal->mbTide_valid_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbTide_valid_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbTide_id, "valid_maximum", NC_INT, 1, &storelocal->mbTide_valid_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbTide_valid_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbTide_id, "missing_value", NC_INT, 1, &storelocal->mbTide_missing_value);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbTide_missing_value error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbTide_id, "format_C", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbTide_format_C);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbTide_id, "orientation", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbTide_orientation);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbSoundVelocity_id, "type", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbSoundVelocity_type);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbSoundVelocity_id, "long_name", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbSoundVelocity_long_name);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbSoundVelocity_id, "name_code", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbSoundVelocity_name_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbSoundVelocity_id, "units", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbSoundVelocity_units);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbSoundVelocity_id, "unit_code", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbSoundVelocity_unit_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, storelocal->mbSoundVelocity_id, "add_offset", NC_DOUBLE, 1, &storelocal->mbSoundVelocity_add_offset);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbSoundVelocity_add_offset error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, storelocal->mbSoundVelocity_id, "scale_factor", NC_DOUBLE, 1, &storelocal->mbSoundVelocity_scale_factor);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbSoundVelocity_scale_factor error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, storelocal->mbSoundVelocity_id, "minimum", NC_DOUBLE, 1, &storelocal->mbSoundVelocity_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbSoundVelocity_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, storelocal->mbSoundVelocity_id, "maximum", NC_DOUBLE, 1, &storelocal->mbSoundVelocity_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbSoundVelocity_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbSoundVelocity_id, "valid_minimum", NC_INT, 1, &storelocal->mbSoundVelocity_valid_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbSoundVelocity_valid_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbSoundVelocity_id, "valid_maximum", NC_INT, 1, &storelocal->mbSoundVelocity_valid_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbSoundVelocity_valid_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbSoundVelocity_id, "missing_value", NC_INT, 1, &storelocal->mbSoundVelocity_missing_value);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbSoundVelocity_missing_value error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbSoundVelocity_id, "format_C", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbSoundVelocity_format_C);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbSoundVelocity_id, "orientation", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbSoundVelocity_orientation);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbHeading_id, "type", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbHeading_type);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbHeading_id, "long_name", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbHeading_long_name);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbHeading_id, "name_code", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbHeading_name_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbHeading_id, "units", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbHeading_units);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbHeading_id, "unit_code", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbHeading_unit_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, storelocal->mbHeading_id, "add_offset", NC_DOUBLE, 1, &storelocal->mbHeading_add_offset);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbHeading_add_offset error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, storelocal->mbHeading_id, "scale_factor", NC_DOUBLE, 1, &storelocal->mbHeading_scale_factor);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbHeading_scale_factor error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, storelocal->mbHeading_id, "minimum", NC_DOUBLE, 1, &storelocal->mbHeading_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbHeading_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, storelocal->mbHeading_id, "maximum", NC_DOUBLE, 1, &storelocal->mbHeading_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbHeading_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbHeading_id, "valid_minimum", NC_INT, 1, &storelocal->mbHeading_valid_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbHeading_valid_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbHeading_id, "valid_maximum", NC_INT, 1, &storelocal->mbHeading_valid_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbHeading_valid_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbHeading_id, "missing_value", NC_INT, 1, &storelocal->mbHeading_missing_value);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbHeading_missing_value error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbHeading_id, "format_C", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbHeading_format_C);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbHeading_id, "orientation", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbHeading_orientation);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbRoll_id, "type", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbRoll_type);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbRoll_id, "long_name", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbRoll_long_name);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbRoll_id, "name_code", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbRoll_name_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbRoll_id, "units", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbRoll_units);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbRoll_id, "unit_code", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbRoll_unit_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, storelocal->mbRoll_id, "add_offset", NC_DOUBLE, 1, &storelocal->mbRoll_add_offset);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbRoll_add_offset error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, storelocal->mbRoll_id, "scale_factor", NC_DOUBLE, 1, &storelocal->mbRoll_scale_factor);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbRoll_scale_factor error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, storelocal->mbRoll_id, "minimum", NC_DOUBLE, 1, &storelocal->mbRoll_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbRoll_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, storelocal->mbRoll_id, "maximum", NC_DOUBLE, 1, &storelocal->mbRoll_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbRoll_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbRoll_id, "valid_minimum", NC_INT, 1, &storelocal->mbRoll_valid_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbRoll_valid_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbRoll_id, "valid_maximum", NC_INT, 1, &storelocal->mbRoll_valid_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbRoll_valid_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbRoll_id, "missing_value", NC_INT, 1, &storelocal->mbRoll_missing_value);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbRoll_missing_value error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbRoll_id, "format_C", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbRoll_format_C);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbRoll_id, "orientation", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbRoll_orientation);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbPitch_id, "type", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbPitch_type);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbPitch_id, "long_name", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbPitch_long_name);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbPitch_id, "name_code", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbPitch_name_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbPitch_id, "units", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbPitch_units);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbPitch_id, "unit_code", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbPitch_unit_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, storelocal->mbPitch_id, "add_offset", NC_DOUBLE, 1, &storelocal->mbPitch_add_offset);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbPitch_add_offset error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, storelocal->mbPitch_id, "scale_factor", NC_DOUBLE, 1, &storelocal->mbPitch_scale_factor);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbPitch_scale_factor error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, storelocal->mbPitch_id, "minimum", NC_DOUBLE, 1, &storelocal->mbPitch_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbPitch_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, storelocal->mbPitch_id, "maximum", NC_DOUBLE, 1, &storelocal->mbPitch_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbPitch_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbPitch_id, "valid_minimum", NC_INT, 1, &storelocal->mbPitch_valid_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbPitch_valid_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbPitch_id, "valid_maximum", NC_INT, 1, &storelocal->mbPitch_valid_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbPitch_valid_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbPitch_id, "missing_value", NC_INT, 1, &storelocal->mbPitch_missing_value);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbPitch_missing_value error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbPitch_id, "format_C", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbPitch_format_C);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbPitch_id, "orientation", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbPitch_orientation);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbTransmissionHeave_id, "type", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbTransmissionHeave_type);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbTransmissionHeave_id, "long_name", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbTransmissionHeave_long_name);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbTransmissionHeave_id, "name_code", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbTransmissionHeave_name_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbTransmissionHeave_id, "units", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbTransmissionHeave_units);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbTransmissionHeave_id, "unit_code", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbTransmissionHeave_unit_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, storelocal->mbTransmissionHeave_id, "add_offset", NC_DOUBLE, 1, &storelocal->mbTransmissionHeave_add_offset);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbTransmissionHeave_add_offset error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, storelocal->mbTransmissionHeave_id, "scale_factor", NC_DOUBLE, 1, &storelocal->mbTransmissionHeave_scale_factor);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbTransmissionHeave_scale_factor error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, storelocal->mbTransmissionHeave_id, "minimum", NC_DOUBLE, 1, &storelocal->mbTransmissionHeave_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbTransmissionHeave_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, storelocal->mbTransmissionHeave_id, "maximum", NC_DOUBLE, 1, &storelocal->mbTransmissionHeave_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbTransmissionHeave_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbTransmissionHeave_id, "valid_minimum", NC_INT, 1, &storelocal->mbTransmissionHeave_valid_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbTransmissionHeave_valid_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbTransmissionHeave_id, "valid_maximum", NC_INT, 1, &storelocal->mbTransmissionHeave_valid_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbTransmissionHeave_valid_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbTransmissionHeave_id, "missing_value", NC_INT, 1, &storelocal->mbTransmissionHeave_missing_value);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbTransmissionHeave_missing_value error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbTransmissionHeave_id, "format_C", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbTransmissionHeave_format_C);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbTransmissionHeave_id, "orientation", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbTransmissionHeave_orientation);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbDistanceScale_id, "type", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbDistanceScale_type);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbDistanceScale_id, "long_name", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbDistanceScale_long_name);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbDistanceScale_id, "name_code", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbDistanceScale_name_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbDistanceScale_id, "units", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbDistanceScale_units);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbDistanceScale_id, "unit_code", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbDistanceScale_unit_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, storelocal->mbDistanceScale_id, "add_offset", NC_DOUBLE, 1, &storelocal->mbDistanceScale_add_offset);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbDistanceScale_add_offset error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, storelocal->mbDistanceScale_id, "scale_factor", NC_DOUBLE, 1, &storelocal->mbDistanceScale_scale_factor);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbDistanceScale_scale_factor error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, storelocal->mbDistanceScale_id, "minimum", NC_DOUBLE, 1, &storelocal->mbDistanceScale_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbDistanceScale_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, storelocal->mbDistanceScale_id, "maximum", NC_DOUBLE, 1, &storelocal->mbDistanceScale_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbDistanceScale_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbDistanceScale_id, "valid_minimum", NC_INT, 1, &storelocal->mbDistanceScale_valid_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbDistanceScale_valid_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbDistanceScale_id, "valid_maximum", NC_INT, 1, &storelocal->mbDistanceScale_valid_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbDistanceScale_valid_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbDistanceScale_id, "missing_value", NC_INT, 1, &storelocal->mbDistanceScale_missing_value);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbDistanceScale_missing_value error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbDistanceScale_id, "format_C", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbDistanceScale_format_C);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbDistanceScale_id, "orientation", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbDistanceScale_orientation);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    if (extended == MB_YES)
-		{
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbRangeScale_id, "type", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbRangeScale_type);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbRangeScale_id, "long_name", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbRangeScale_long_name);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbRangeScale_id, "name_code", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbRangeScale_name_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbRangeScale_id, "units", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbRangeScale_units);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbRangeScale_id, "unit_code", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbRangeScale_unit_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, storelocal->mbRangeScale_id, "add_offset", NC_DOUBLE, 1, &storelocal->mbRangeScale_add_offset);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbRangeScale_add_offset error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, storelocal->mbRangeScale_id, "scale_factor", NC_DOUBLE, 1, &storelocal->mbRangeScale_scale_factor);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbRangeScale_scale_factor error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, storelocal->mbRangeScale_id, "minimum", NC_DOUBLE, 1, &storelocal->mbRangeScale_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbRangeScale_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, storelocal->mbRangeScale_id, "maximum", NC_DOUBLE, 1, &storelocal->mbRangeScale_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbRangeScale_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbRangeScale_id, "valid_minimum", NC_INT, 1, &storelocal->mbRangeScale_valid_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbRangeScale_valid_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbRangeScale_id, "valid_maximum", NC_INT, 1, &storelocal->mbRangeScale_valid_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbRangeScale_valid_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbRangeScale_id, "missing_value", NC_INT, 1, &storelocal->mbRangeScale_missing_value);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbRangeScale_missing_value error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbRangeScale_id, "format_C", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbRangeScale_format_C);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbRangeScale_id, "orientation", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbRangeScale_orientation);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-		}
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbDepthScale_id, "type", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbDepthScale_type);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbDepthScale_id, "long_name", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbDepthScale_long_name);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbDepthScale_id, "name_code", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbDepthScale_name_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbDepthScale_id, "units", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbDepthScale_units);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbDepthScale_id, "unit_code", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbDepthScale_unit_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, storelocal->mbDepthScale_id, "add_offset", NC_DOUBLE, 1, &storelocal->mbDepthScale_add_offset);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbDepthScale_add_offset error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, storelocal->mbDepthScale_id, "scale_factor", NC_DOUBLE, 1, &storelocal->mbDepthScale_scale_factor);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbDepthScale_scale_factor error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, storelocal->mbDepthScale_id, "minimum", NC_DOUBLE, 1, &storelocal->mbDepthScale_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbDepthScale_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, storelocal->mbDepthScale_id, "maximum", NC_DOUBLE, 1, &storelocal->mbDepthScale_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbDepthScale_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbDepthScale_id, "valid_minimum", NC_INT, 1, &storelocal->mbDepthScale_valid_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbDepthScale_valid_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbDepthScale_id, "valid_maximum", NC_INT, 1, &storelocal->mbDepthScale_valid_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbDepthScale_valid_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbDepthScale_id, "missing_value", NC_INT, 1, &storelocal->mbDepthScale_missing_value);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbDepthScale_missing_value error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbDepthScale_id, "format_C", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbDepthScale_format_C);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbDepthScale_id, "orientation", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbDepthScale_orientation);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbVerticalDepth_id, "type", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbVerticalDepth_type);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbVerticalDepth_id, "long_name", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbVerticalDepth_long_name);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbVerticalDepth_id, "name_code", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbVerticalDepth_name_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbVerticalDepth_id, "units", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbVerticalDepth_units);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbVerticalDepth_id, "unit_code", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbVerticalDepth_unit_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbVerticalDepth_id, "add_offset", NC_INT, 1, &storelocal->mbVerticalDepth_add_offset);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbVerticalDepth_add_offset error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbVerticalDepth_id, "scale_factor", NC_INT, 1, &storelocal->mbVerticalDepth_scale_factor);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbVerticalDepth_scale_factor error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbVerticalDepth_id, "minimum", NC_INT, 1, &storelocal->mbVerticalDepth_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbVerticalDepth_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbVerticalDepth_id, "maximum", NC_INT, 1, &storelocal->mbVerticalDepth_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbVerticalDepth_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbVerticalDepth_id, "valid_minimum", NC_INT, 1, &storelocal->mbVerticalDepth_valid_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbVerticalDepth_valid_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbVerticalDepth_id, "valid_maximum", NC_INT, 1, &storelocal->mbVerticalDepth_valid_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbVerticalDepth_valid_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbVerticalDepth_id, "missing_value", NC_INT, 1, &storelocal->mbVerticalDepth_missing_value);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbVerticalDepth_missing_value error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbVerticalDepth_id, "format_C", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbVerticalDepth_format_C);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbVerticalDepth_id, "orientation", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbVerticalDepth_orientation);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbCQuality_id, "type", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbCQuality_type);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbCQuality_id, "long_name", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbCQuality_long_name);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbCQuality_id, "name_code", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbCQuality_name_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbCQuality_id, "units", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbCQuality_units);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbCQuality_id, "unit_code", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbCQuality_unit_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbCQuality_id, "add_offset", NC_INT, 1, &storelocal->mbCQuality_add_offset);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbCQuality_add_offset error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbCQuality_id, "scale_factor", NC_INT, 1, &storelocal->mbCQuality_scale_factor);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbCQuality_scale_factor error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbCQuality_id, "minimum", NC_INT, 1, &storelocal->mbCQuality_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbCQuality_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbCQuality_id, "maximum", NC_INT, 1, &storelocal->mbCQuality_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbCQuality_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbCQuality_id, "valid_minimum", NC_INT, 1, &storelocal->mbCQuality_valid_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbCQuality_valid_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbCQuality_id, "valid_maximum", NC_INT, 1, &storelocal->mbCQuality_valid_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbCQuality_valid_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbCQuality_id, "missing_value", NC_INT, 1, &storelocal->mbCQuality_missing_value);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbCQuality_missing_value error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbCQuality_id, "format_C", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbCQuality_format_C);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbCQuality_id, "orientation", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbCQuality_orientation);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbCFlag_id, "type", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbCFlag_type);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbCFlag_id, "long_name", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbCFlag_long_name);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbCFlag_id, "name_code", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbCFlag_name_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbCFlag_id, "units", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbCFlag_units);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbCFlag_id, "unit_code", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbCFlag_unit_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbCFlag_id, "add_offset", NC_INT, 1, &storelocal->mbCFlag_add_offset);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbCFlag_add_offset error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbCFlag_id, "scale_factor", NC_INT, 1, &storelocal->mbCFlag_scale_factor);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbCFlag_scale_factor error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbCFlag_id, "minimum", NC_INT, 1, &storelocal->mbCFlag_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbCFlag_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbCFlag_id, "maximum", NC_INT, 1, &storelocal->mbCFlag_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbCFlag_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbCFlag_id, "valid_minimum", NC_INT, 1, &storelocal->mbCFlag_valid_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbCFlag_valid_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbCFlag_id, "valid_maximum", NC_INT, 1, &storelocal->mbCFlag_valid_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbCFlag_valid_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbCFlag_id, "missing_value", NC_INT, 1, &storelocal->mbCFlag_missing_value);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbCFlag_missing_value error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbCFlag_id, "format_C", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbCFlag_format_C);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbCFlag_id, "orientation", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbCFlag_orientation);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbInterlacing_id, "type", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbInterlacing_type);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbInterlacing_id, "long_name", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbInterlacing_long_name);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbInterlacing_id, "name_code", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbInterlacing_name_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbInterlacing_id, "units", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbInterlacing_units);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbInterlacing_id, "unit_code", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbInterlacing_unit_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbInterlacing_id, "add_offset", NC_INT, 1, &storelocal->mbInterlacing_add_offset);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbInterlacing_add_offset error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbInterlacing_id, "scale_factor", NC_INT, 1, &storelocal->mbInterlacing_scale_factor);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbInterlacing_scale_factor error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbInterlacing_id, "minimum", NC_INT, 1, &storelocal->mbInterlacing_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbInterlacing_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbInterlacing_id, "maximum", NC_INT, 1, &storelocal->mbInterlacing_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbInterlacing_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbInterlacing_id, "valid_minimum", NC_INT, 1, &storelocal->mbInterlacing_valid_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbInterlacing_valid_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbInterlacing_id, "valid_maximum", NC_INT, 1, &storelocal->mbInterlacing_valid_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbInterlacing_valid_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbInterlacing_id, "missing_value", NC_INT, 1, &storelocal->mbInterlacing_missing_value);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbInterlacing_missing_value error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbInterlacing_id, "format_C", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbInterlacing_format_C);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbInterlacing_id, "orientation", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbInterlacing_orientation);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbSamplingRate_id, "type", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbSamplingRate_type);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbSamplingRate_id, "long_name", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbSamplingRate_long_name);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbSamplingRate_id, "name_code", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbSamplingRate_name_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbSamplingRate_id, "units", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbSamplingRate_units);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbSamplingRate_id, "unit_code", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbSamplingRate_unit_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbSamplingRate_id, "add_offset", NC_INT, 1, &storelocal->mbSamplingRate_add_offset);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbSamplingRate_add_offset error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbSamplingRate_id, "scale_factor", NC_INT, 1, &storelocal->mbSamplingRate_scale_factor);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbSamplingRate_scale_factor error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbSamplingRate_id, "minimum", NC_INT, 1, &storelocal->mbSamplingRate_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbSamplingRate_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbSamplingRate_id, "maximum", NC_INT, 1, &storelocal->mbSamplingRate_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbSamplingRate_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbSamplingRate_id, "valid_minimum", NC_INT, 1, &storelocal->mbSamplingRate_valid_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbSamplingRate_valid_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbSamplingRate_id, "valid_maximum", NC_INT, 1, &storelocal->mbSamplingRate_valid_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbSamplingRate_valid_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbSamplingRate_id, "missing_value", NC_INT, 1, &storelocal->mbSamplingRate_missing_value);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbSamplingRate_missing_value error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbSamplingRate_id, "format_C", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbSamplingRate_format_C);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbSamplingRate_id, "orientation", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbSamplingRate_orientation);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    if (extended == MB_YES)
-		{
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbCompensationLayerMode_id, "type", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbCompensationLayerMode_type);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbCompensationLayerMode_id, "long_name", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbCompensationLayerMode_long_name);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbCompensationLayerMode_id, "name_code", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbCompensationLayerMode_name_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbCompensationLayerMode_id, "units", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbCompensationLayerMode_units);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbCompensationLayerMode_id, "unit_code", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbCompensationLayerMode_unit_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbCompensationLayerMode_id, "add_offset", NC_INT, 1, &storelocal->mbCompensationLayerMode_add_offset);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbCompensationLayerMode_add_offset error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbCompensationLayerMode_id, "scale_factor", NC_INT, 1, &storelocal->mbCompensationLayerMode_scale_factor);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbCompensationLayerMode_scale_factor error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbCompensationLayerMode_id, "minimum", NC_INT, 1, &storelocal->mbCompensationLayerMode_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbCompensationLayerMode_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbCompensationLayerMode_id, "maximum", NC_INT, 1, &storelocal->mbCompensationLayerMode_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbCompensationLayerMode_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbCompensationLayerMode_id, "valid_minimum", NC_INT, 1, &storelocal->mbCompensationLayerMode_valid_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbCompensationLayerMode_valid_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbCompensationLayerMode_id, "valid_maximum", NC_INT, 1, &storelocal->mbCompensationLayerMode_valid_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbCompensationLayerMode_valid_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbCompensationLayerMode_id, "missing_value", NC_INT, 1, &storelocal->mbCompensationLayerMode_missing_value);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbCompensationLayerMode_missing_value error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbCompensationLayerMode_id, "format_C", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbCompensationLayerMode_format_C);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbCompensationLayerMode_id, "orientation", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbCompensationLayerMode_orientation);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbTransmitBeamwidth_id, "type", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbTransmitBeamwidth_type);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbTransmitBeamwidth_id, "long_name", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbTransmitBeamwidth_long_name);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbTransmitBeamwidth_id, "name_code", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbTransmitBeamwidth_name_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbTransmitBeamwidth_id, "units", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbTransmitBeamwidth_units);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbTransmitBeamwidth_id, "unit_code", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbTransmitBeamwidth_unit_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbTransmitBeamwidth_id, "add_offset", NC_INT, 1, &storelocal->mbTransmitBeamwidth_add_offset);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbTransmitBeamwidth_add_offset error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbTransmitBeamwidth_id, "scale_factor", NC_INT, 1, &storelocal->mbTransmitBeamwidth_scale_factor);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbTransmitBeamwidth_scale_factor error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbTransmitBeamwidth_id, "minimum", NC_INT, 1, &storelocal->mbTransmitBeamwidth_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbTransmitBeamwidth_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbTransmitBeamwidth_id, "maximum", NC_INT, 1, &storelocal->mbTransmitBeamwidth_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbTransmitBeamwidth_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbTransmitBeamwidth_id, "valid_minimum", NC_INT, 1, &storelocal->mbTransmitBeamwidth_valid_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbTransmitBeamwidth_valid_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbTransmitBeamwidth_id, "valid_maximum", NC_INT, 1, &storelocal->mbTransmitBeamwidth_valid_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbTransmitBeamwidth_valid_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbTransmitBeamwidth_id, "missing_value", NC_INT, 1, &storelocal->mbTransmitBeamwidth_missing_value);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbTransmitBeamwidth_missing_value error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbTransmitBeamwidth_id, "format_C", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbTransmitBeamwidth_format_C);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbTransmitBeamwidth_id, "orientation", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbTransmitBeamwidth_orientation);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbReceiveBeamwidth_id, "type", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbReceiveBeamwidth_type);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbReceiveBeamwidth_id, "long_name", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbReceiveBeamwidth_long_name);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbReceiveBeamwidth_id, "name_code", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbReceiveBeamwidth_name_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbReceiveBeamwidth_id, "units", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbReceiveBeamwidth_units);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbReceiveBeamwidth_id, "unit_code", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbReceiveBeamwidth_unit_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbReceiveBeamwidth_id, "add_offset", NC_INT, 1, &storelocal->mbReceiveBeamwidth_add_offset);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbReceiveBeamwidth_add_offset error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbReceiveBeamwidth_id, "scale_factor", NC_INT, 1, &storelocal->mbReceiveBeamwidth_scale_factor);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbReceiveBeamwidth_scale_factor error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbReceiveBeamwidth_id, "minimum", NC_INT, 1, &storelocal->mbReceiveBeamwidth_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbReceiveBeamwidth_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbReceiveBeamwidth_id, "maximum", NC_INT, 1, &storelocal->mbReceiveBeamwidth_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbReceiveBeamwidth_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbReceiveBeamwidth_id, "valid_minimum", NC_INT, 1, &storelocal->mbReceiveBeamwidth_valid_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbReceiveBeamwidth_valid_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbReceiveBeamwidth_id, "valid_maximum", NC_INT, 1, &storelocal->mbReceiveBeamwidth_valid_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbReceiveBeamwidth_valid_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbReceiveBeamwidth_id, "missing_value", NC_INT, 1, &storelocal->mbReceiveBeamwidth_missing_value);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbReceiveBeamwidth_missing_value error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbReceiveBeamwidth_id, "format_C", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbReceiveBeamwidth_format_C);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbReceiveBeamwidth_id, "orientation", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbReceiveBeamwidth_orientation);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbTransmitPulseLength_id, "type", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbTransmitPulseLength_type);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbTransmitPulseLength_id, "long_name", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbTransmitPulseLength_long_name);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbTransmitPulseLength_id, "name_code", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbTransmitPulseLength_name_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbTransmitPulseLength_id, "units", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbTransmitPulseLength_units);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbTransmitPulseLength_id, "unit_code", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbTransmitPulseLength_unit_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbTransmitPulseLength_id, "add_offset", NC_INT, 1, &storelocal->mbTransmitPulseLength_add_offset);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbTransmitPulseLength_add_offset error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbTransmitPulseLength_id, "scale_factor", NC_INT, 1, &storelocal->mbTransmitPulseLength_scale_factor);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbTransmitPulseLength_scale_factor error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbTransmitPulseLength_id, "minimum", NC_INT, 1, &storelocal->mbTransmitPulseLength_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbTransmitPulseLength_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbTransmitPulseLength_id, "maximum", NC_INT, 1, &storelocal->mbTransmitPulseLength_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbTransmitPulseLength_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbTransmitPulseLength_id, "valid_minimum", NC_INT, 1, &storelocal->mbTransmitPulseLength_valid_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbTransmitPulseLength_valid_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbTransmitPulseLength_id, "valid_maximum", NC_INT, 1, &storelocal->mbTransmitPulseLength_valid_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbTransmitPulseLength_valid_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbTransmitPulseLength_id, "missing_value", NC_INT, 1, &storelocal->mbTransmitPulseLength_missing_value);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbTransmitPulseLength_missing_value error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbTransmitPulseLength_id, "format_C", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbTransmitPulseLength_format_C);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbTransmitPulseLength_id, "orientation", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbTransmitPulseLength_orientation);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-		}
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbAlongDistance_id, "type", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbAlongDistance_type);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbAlongDistance_id, "long_name", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbAlongDistance_long_name);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbAlongDistance_id, "name_code", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbAlongDistance_name_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbAlongDistance_id, "units", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbAlongDistance_units);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbAlongDistance_id, "unit_code", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbAlongDistance_unit_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbAlongDistance_id, "add_offset", NC_INT, 1, &storelocal->mbAlongDistance_add_offset);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbAlongDistance_add_offset error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbAlongDistance_id, "scale_factor", NC_INT, 1, &storelocal->mbAlongDistance_scale_factor);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbAlongDistance_scale_factor error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbAlongDistance_id, "minimum", NC_INT, 1, &storelocal->mbAlongDistance_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbAlongDistance_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbAlongDistance_id, "maximum", NC_INT, 1, &storelocal->mbAlongDistance_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbAlongDistance_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbAlongDistance_id, "valid_minimum", NC_INT, 1, &storelocal->mbAlongDistance_valid_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbAlongDistance_valid_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbAlongDistance_id, "valid_maximum", NC_INT, 1, &storelocal->mbAlongDistance_valid_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbAlongDistance_valid_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbAlongDistance_id, "missing_value", NC_INT, 1, &storelocal->mbAlongDistance_missing_value);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbAlongDistance_missing_value error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbAlongDistance_id, "format_C", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbAlongDistance_format_C);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbAlongDistance_id, "orientation", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbAlongDistance_orientation);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbAcrossDistance_id, "type", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbAcrossDistance_type);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbAcrossDistance_id, "long_name", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbAcrossDistance_long_name);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbAcrossDistance_id, "name_code", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbAcrossDistance_name_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbAcrossDistance_id, "units", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbAcrossDistance_units);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbAcrossDistance_id, "unit_code", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbAcrossDistance_unit_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbAcrossDistance_id, "add_offset", NC_INT, 1, &storelocal->mbAcrossDistance_add_offset);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbAcrossDistance_add_offset error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbAcrossDistance_id, "scale_factor", NC_INT, 1, &storelocal->mbAcrossDistance_scale_factor);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbAcrossDistance_scale_factor error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbAcrossDistance_id, "minimum", NC_INT, 1, &storelocal->mbAcrossDistance_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbAcrossDistance_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbAcrossDistance_id, "maximum", NC_INT, 1, &storelocal->mbAcrossDistance_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbAcrossDistance_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbAcrossDistance_id, "valid_minimum", NC_INT, 1, &storelocal->mbAcrossDistance_valid_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbAcrossDistance_valid_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbAcrossDistance_id, "valid_maximum", NC_INT, 1, &storelocal->mbAcrossDistance_valid_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbAcrossDistance_valid_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbAcrossDistance_id, "missing_value", NC_INT, 1, &storelocal->mbAcrossDistance_missing_value);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbAcrossDistance_missing_value error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbAcrossDistance_id, "format_C", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbAcrossDistance_format_C);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbAcrossDistance_id, "orientation", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbAcrossDistance_orientation);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbDepth_id, "type", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbDepth_type);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbDepth_id, "long_name", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbDepth_long_name);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbDepth_id, "name_code", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbDepth_name_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbDepth_id, "units", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbDepth_units);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbDepth_id, "unit_code", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbDepth_unit_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbDepth_id, "add_offset", NC_INT, 1, &storelocal->mbDepth_add_offset);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbDepth_add_offset error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbDepth_id, "scale_factor", NC_INT, 1, &storelocal->mbDepth_scale_factor);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbDepth_scale_factor error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbDepth_id, "minimum", NC_INT, 1, &storelocal->mbDepth_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbDepth_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbDepth_id, "maximum", NC_INT, 1, &storelocal->mbDepth_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbDepth_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbDepth_id, "valid_minimum", NC_INT, 1, &storelocal->mbDepth_valid_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbDepth_valid_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbDepth_id, "valid_maximum", NC_INT, 1, &storelocal->mbDepth_valid_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbDepth_valid_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbDepth_id, "missing_value", NC_INT, 1, &storelocal->mbDepth_missing_value);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbDepth_missing_value error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbDepth_id, "format_C", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbDepth_format_C);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbDepth_id, "orientation", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbDepth_orientation);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    if (extended == MB_YES)
-		{
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbAcrossBeamAngle_id, "type", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbAcrossBeamAngle_type);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbAcrossBeamAngle_id, "long_name", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbAcrossBeamAngle_long_name);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbAcrossBeamAngle_id, "name_code", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbAcrossBeamAngle_name_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbAcrossBeamAngle_id, "units", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbAcrossBeamAngle_units);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbAcrossBeamAngle_id, "unit_code", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbAcrossBeamAngle_unit_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, storelocal->mbAcrossBeamAngle_id, "add_offset", NC_DOUBLE, 1, &storelocal->mbAcrossBeamAngle_add_offset);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbAcrossBeamAngle_add_offset error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, storelocal->mbAcrossBeamAngle_id, "scale_factor", NC_DOUBLE, 1, &storelocal->mbAcrossBeamAngle_scale_factor);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbAcrossBeamAngle_scale_factor error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, storelocal->mbAcrossBeamAngle_id, "minimum", NC_DOUBLE, 1, &storelocal->mbAcrossBeamAngle_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbAcrossBeamAngle_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, storelocal->mbAcrossBeamAngle_id, "maximum", NC_DOUBLE, 1, &storelocal->mbAcrossBeamAngle_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbAcrossBeamAngle_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbAcrossBeamAngle_id, "valid_minimum", NC_INT, 1, &storelocal->mbAcrossBeamAngle_valid_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbAcrossBeamAngle_valid_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbAcrossBeamAngle_id, "valid_maximum", NC_INT, 1, &storelocal->mbAcrossBeamAngle_valid_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbAcrossBeamAngle_valid_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbAcrossBeamAngle_id, "missing_value", NC_INT, 1, &storelocal->mbAcrossBeamAngle_missing_value);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbAcrossBeamAngle_missing_value error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbAcrossBeamAngle_id, "format_C", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbAcrossBeamAngle_format_C);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbAcrossBeamAngle_id, "orientation", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbAcrossBeamAngle_orientation);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbAzimutBeamAngle_id, "type", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbAzimutBeamAngle_type);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbAzimutBeamAngle_id, "long_name", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbAzimutBeamAngle_long_name);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbAzimutBeamAngle_id, "name_code", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbAzimutBeamAngle_name_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbAzimutBeamAngle_id, "units", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbAzimutBeamAngle_units);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbAzimutBeamAngle_id, "unit_code", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbAzimutBeamAngle_unit_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, storelocal->mbAzimutBeamAngle_id, "add_offset", NC_DOUBLE, 1, &storelocal->mbAzimutBeamAngle_add_offset);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbAzimutBeamAngle_add_offset error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, storelocal->mbAzimutBeamAngle_id, "scale_factor", NC_DOUBLE, 1, &storelocal->mbAzimutBeamAngle_scale_factor);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbAzimutBeamAngle_scale_factor error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, storelocal->mbAzimutBeamAngle_id, "minimum", NC_DOUBLE, 1, &storelocal->mbAzimutBeamAngle_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbAzimutBeamAngle_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, storelocal->mbAzimutBeamAngle_id, "maximum", NC_DOUBLE, 1, &storelocal->mbAzimutBeamAngle_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbAzimutBeamAngle_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbAzimutBeamAngle_id, "valid_minimum", NC_INT, 1, &storelocal->mbAzimutBeamAngle_valid_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbAzimutBeamAngle_valid_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbAzimutBeamAngle_id, "valid_maximum", NC_INT, 1, &storelocal->mbAzimutBeamAngle_valid_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbAzimutBeamAngle_valid_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbAzimutBeamAngle_id, "missing_value", NC_INT, 1, &storelocal->mbAzimutBeamAngle_missing_value);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbAzimutBeamAngle_missing_value error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbAzimutBeamAngle_id, "format_C", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbAzimutBeamAngle_format_C);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbAzimutBeamAngle_id, "orientation", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbAzimutBeamAngle_orientation);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbRange_id, "type", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbRange_type);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbRange_id, "long_name", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbRange_long_name);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbRange_id, "name_code", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbRange_name_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbRange_id, "units", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbRange_units);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbRange_id, "unit_code", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbRange_unit_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbRange_id, "add_offset", NC_INT, 1, &storelocal->mbRange_add_offset);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbRange_add_offset error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbRange_id, "scale_factor", NC_INT, 1, &storelocal->mbRange_scale_factor);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbRange_scale_factor error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbRange_id, "minimum", NC_INT, 1, &storelocal->mbRange_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbRange_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbRange_id, "maximum", NC_INT, 1, &storelocal->mbRange_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbRange_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbRange_id, "valid_minimum", NC_INT, 1, &storelocal->mbRange_valid_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbRange_valid_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbRange_id, "valid_maximum", NC_INT, 1, &storelocal->mbRange_valid_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbRange_valid_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbRange_id, "missing_value", NC_INT, 1, &storelocal->mbRange_missing_value);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbRange_missing_value error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbRange_id, "format_C", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbRange_format_C);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbRange_id, "orientation", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbRange_orientation);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbSoundingBias_id, "type", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbSoundingBias_type);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbSoundingBias_id, "long_name", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbSoundingBias_long_name);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbSoundingBias_id, "name_code", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbSoundingBias_name_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbSoundingBias_id, "units", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbSoundingBias_units);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbSoundingBias_id, "unit_code", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbSoundingBias_unit_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, storelocal->mbSoundingBias_id, "add_offset", NC_DOUBLE, 1, &storelocal->mbSoundingBias_add_offset);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbSoundingBias_add_offset error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, storelocal->mbSoundingBias_id, "scale_factor", NC_DOUBLE, 1, &storelocal->mbSoundingBias_scale_factor);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbSoundingBias_scale_factor error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, storelocal->mbSoundingBias_id, "minimum", NC_DOUBLE, 1, &storelocal->mbSoundingBias_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbSoundingBias_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, storelocal->mbSoundingBias_id, "maximum", NC_DOUBLE, 1, &storelocal->mbSoundingBias_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbSoundingBias_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbSoundingBias_id, "valid_minimum", NC_INT, 1, &storelocal->mbSoundingBias_valid_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbSoundingBias_valid_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbSoundingBias_id, "valid_maximum", NC_INT, 1, &storelocal->mbSoundingBias_valid_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbSoundingBias_valid_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbSoundingBias_id, "missing_value", NC_INT, 1, &storelocal->mbSoundingBias_missing_value);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbSoundingBias_missing_value error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbSoundingBias_id, "format_C", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbSoundingBias_format_C);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbSoundingBias_id, "orientation", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbSoundingBias_orientation);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-		}
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbSQuality_id, "type", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbSQuality_type);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbSQuality_id, "long_name", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbSQuality_long_name);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbSQuality_id, "name_code", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbSQuality_name_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbSQuality_id, "units", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbSQuality_units);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbSQuality_id, "unit_code", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbSQuality_unit_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbSQuality_id, "add_offset", NC_INT, 1, &storelocal->mbSQuality_add_offset);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbSQuality_add_offset error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbSQuality_id, "scale_factor", NC_INT, 1, &storelocal->mbSQuality_scale_factor);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbSQuality_scale_factor error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbSQuality_id, "minimum", NC_INT, 1, &storelocal->mbSQuality_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbSQuality_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbSQuality_id, "maximum", NC_INT, 1, &storelocal->mbSQuality_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbSQuality_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbSQuality_id, "valid_minimum", NC_INT, 1, &storelocal->mbSQuality_valid_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbSQuality_valid_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbSQuality_id, "valid_maximum", NC_INT, 1, &storelocal->mbSQuality_valid_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbSQuality_valid_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbSQuality_id, "missing_value", NC_INT, 1, &storelocal->mbSQuality_missing_value);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbSQuality_missing_value error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbSQuality_id, "format_C", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbSQuality_format_C);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbSQuality_id, "orientation", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbSQuality_orientation);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    if (extended == MB_YES)
-		{
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbReflectivity_id, "type", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbReflectivity_type);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbReflectivity_id, "long_name", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbReflectivity_long_name);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbReflectivity_id, "name_code", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbReflectivity_name_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbReflectivity_id, "units", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbReflectivity_units);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbReflectivity_id, "unit_code", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbReflectivity_unit_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, storelocal->mbReflectivity_id, "add_offset", NC_DOUBLE, 1, &storelocal->mbReflectivity_add_offset);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbReflectivity_add_offset error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, storelocal->mbReflectivity_id, "scale_factor", NC_DOUBLE, 1, &storelocal->mbReflectivity_scale_factor);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbReflectivity_scale_factor error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, storelocal->mbReflectivity_id, "minimum", NC_DOUBLE, 1, &storelocal->mbReflectivity_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbReflectivity_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, storelocal->mbReflectivity_id, "maximum", NC_DOUBLE, 1, &storelocal->mbReflectivity_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbReflectivity_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbReflectivity_id, "valid_minimum", NC_INT, 1, &storelocal->mbReflectivity_valid_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbReflectivity_valid_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbReflectivity_id, "valid_maximum", NC_INT, 1, &storelocal->mbReflectivity_valid_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbReflectivity_valid_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbReflectivity_id, "missing_value", NC_INT, 1, &storelocal->mbReflectivity_missing_value);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbReflectivity_missing_value error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbReflectivity_id, "format_C", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbReflectivity_format_C);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbReflectivity_id, "orientation", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbReflectivity_orientation);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbReceptionHeave_id, "type", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbReceptionHeave_type);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbReceptionHeave_id, "long_name", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbReceptionHeave_long_name);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbReceptionHeave_id, "name_code", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbReceptionHeave_name_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbReceptionHeave_id, "units", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbReceptionHeave_units);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbReceptionHeave_id, "unit_code", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbReceptionHeave_unit_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, storelocal->mbReceptionHeave_id, "add_offset", NC_DOUBLE, 1, &storelocal->mbReceptionHeave_add_offset);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbReceptionHeave_add_offset error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, storelocal->mbReceptionHeave_id, "scale_factor", NC_DOUBLE, 1, &storelocal->mbReceptionHeave_scale_factor);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbReceptionHeave_scale_factor error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, storelocal->mbReceptionHeave_id, "minimum", NC_DOUBLE, 1, &storelocal->mbReceptionHeave_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbReceptionHeave_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, storelocal->mbReceptionHeave_id, "maximum", NC_DOUBLE, 1, &storelocal->mbReceptionHeave_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbReceptionHeave_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbReceptionHeave_id, "valid_minimum", NC_INT, 1, &storelocal->mbReceptionHeave_valid_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbReceptionHeave_valid_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbReceptionHeave_id, "valid_maximum", NC_INT, 1, &storelocal->mbReceptionHeave_valid_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbReceptionHeave_valid_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbReceptionHeave_id, "missing_value", NC_INT, 1, &storelocal->mbReceptionHeave_missing_value);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbReceptionHeave_missing_value error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbReceptionHeave_id, "format_C", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbReceptionHeave_format_C);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbReceptionHeave_id, "orientation", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbReceptionHeave_orientation);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbAlongSlope_id, "type", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbAlongSlope_type);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbAlongSlope_id, "long_name", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbAlongSlope_long_name);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbAlongSlope_id, "name_code", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbAlongSlope_name_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbAlongSlope_id, "units", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbAlongSlope_units);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbAlongSlope_id, "unit_code", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbAlongSlope_unit_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, storelocal->mbAlongSlope_id, "add_offset", NC_DOUBLE, 1, &storelocal->mbAlongSlope_add_offset);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbAlongSlope_add_offset error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, storelocal->mbAlongSlope_id, "scale_factor", NC_DOUBLE, 1, &storelocal->mbAlongSlope_scale_factor);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbAlongSlope_scale_factor error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, storelocal->mbAlongSlope_id, "minimum", NC_DOUBLE, 1, &storelocal->mbAlongSlope_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbAlongSlope_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, storelocal->mbAlongSlope_id, "maximum", NC_DOUBLE, 1, &storelocal->mbAlongSlope_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbAlongSlope_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbAlongSlope_id, "valid_minimum", NC_INT, 1, &storelocal->mbAlongSlope_valid_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbAlongSlope_valid_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbAlongSlope_id, "valid_maximum", NC_INT, 1, &storelocal->mbAlongSlope_valid_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbAlongSlope_valid_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbAlongSlope_id, "missing_value", NC_INT, 1, &storelocal->mbAlongSlope_missing_value);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbAlongSlope_missing_value error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbAlongSlope_id, "format_C", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbAlongSlope_format_C);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbAlongSlope_id, "orientation", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbAlongSlope_orientation);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbAcrossSlope_id, "type", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbAcrossSlope_type);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbAcrossSlope_id, "long_name", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbAcrossSlope_long_name);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbAcrossSlope_id, "name_code", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbAcrossSlope_name_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbAcrossSlope_id, "units", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbAcrossSlope_units);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbAcrossSlope_id, "unit_code", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbAcrossSlope_unit_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, storelocal->mbAcrossSlope_id, "add_offset", NC_DOUBLE, 1, &storelocal->mbAcrossSlope_add_offset);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbAcrossSlope_add_offset error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, storelocal->mbAcrossSlope_id, "scale_factor", NC_DOUBLE, 1, &storelocal->mbAcrossSlope_scale_factor);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbAcrossSlope_scale_factor error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, storelocal->mbAcrossSlope_id, "minimum", NC_DOUBLE, 1, &storelocal->mbAcrossSlope_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbAcrossSlope_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, storelocal->mbAcrossSlope_id, "maximum", NC_DOUBLE, 1, &storelocal->mbAcrossSlope_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbAcrossSlope_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbAcrossSlope_id, "valid_minimum", NC_INT, 1, &storelocal->mbAcrossSlope_valid_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbAcrossSlope_valid_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbAcrossSlope_id, "valid_maximum", NC_INT, 1, &storelocal->mbAcrossSlope_valid_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbAcrossSlope_valid_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbAcrossSlope_id, "missing_value", NC_INT, 1, &storelocal->mbAcrossSlope_missing_value);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbAcrossSlope_missing_value error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbAcrossSlope_id, "format_C", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbAcrossSlope_format_C);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbAcrossSlope_id, "orientation", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbAcrossSlope_orientation);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-		}
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbSFlag_id, "type", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbSFlag_type);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbSFlag_id, "long_name", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbSFlag_long_name);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbSFlag_id, "name_code", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbSFlag_name_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbSFlag_id, "units", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbSFlag_units);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbSFlag_id, "unit_code", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbSFlag_unit_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbSFlag_id, "add_offset", NC_INT, 1, &storelocal->mbSFlag_add_offset);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbSFlag_add_offset error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbSFlag_id, "scale_factor", NC_INT, 1, &storelocal->mbSFlag_scale_factor);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbSFlag_scale_factor error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbSFlag_id, "minimum", NC_INT, 1, &storelocal->mbSFlag_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbSFlag_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbSFlag_id, "maximum", NC_INT, 1, &storelocal->mbSFlag_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbSFlag_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbSFlag_id, "valid_minimum", NC_INT, 1, &storelocal->mbSFlag_valid_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbSFlag_valid_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbSFlag_id, "valid_maximum", NC_INT, 1, &storelocal->mbSFlag_valid_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbSFlag_valid_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbSFlag_id, "missing_value", NC_INT, 1, &storelocal->mbSFlag_missing_value);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbSFlag_missing_value error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbSFlag_id, "format_C", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbSFlag_format_C);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbSFlag_id, "orientation", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbSFlag_orientation);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    if (extended == MB_YES)
-		{
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbSLengthOfDetection_id, "type", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbSLengthOfDetection_type);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbSLengthOfDetection_id, "long_name", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbSLengthOfDetection_long_name);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbSLengthOfDetection_id, "name_code", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbSLengthOfDetection_name_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbSLengthOfDetection_id, "units", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbSLengthOfDetection_units);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbSLengthOfDetection_id, "unit_code", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbSLengthOfDetection_unit_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbSLengthOfDetection_id, "add_offset", NC_INT, 1, &storelocal->mbSLengthOfDetection_add_offset);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbSLengthOfDetection_add_offset error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbSLengthOfDetection_id, "scale_factor", NC_INT, 1, &storelocal->mbSLengthOfDetection_scale_factor);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbSLengthOfDetection_scale_factor error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbSLengthOfDetection_id, "minimum", NC_INT, 1, &storelocal->mbSLengthOfDetection_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbSLengthOfDetection_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbSLengthOfDetection_id, "maximum", NC_INT, 1, &storelocal->mbSLengthOfDetection_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbSLengthOfDetection_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbSLengthOfDetection_id, "valid_minimum", NC_INT, 1, &storelocal->mbSLengthOfDetection_valid_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbSLengthOfDetection_valid_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbSLengthOfDetection_id, "valid_maximum", NC_INT, 1, &storelocal->mbSLengthOfDetection_valid_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbSLengthOfDetection_valid_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbSLengthOfDetection_id, "missing_value", NC_INT, 1, &storelocal->mbSLengthOfDetection_missing_value);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbSLengthOfDetection_missing_value error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbSLengthOfDetection_id, "format_C", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbSLengthOfDetection_format_C);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbSLengthOfDetection_id, "orientation", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbSLengthOfDetection_orientation);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-		}
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbAntenna_id, "type", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbAntenna_type);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbAntenna_id, "long_name", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbAntenna_long_name);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbAntenna_id, "name_code", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbAntenna_name_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbAntenna_id, "units", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbAntenna_units);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbAntenna_id, "unit_code", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbAntenna_unit_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbAntenna_id, "add_offset", NC_INT, 1, &storelocal->mbAntenna_add_offset);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbAntenna_add_offset error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbAntenna_id, "scale_factor", NC_INT, 1, &storelocal->mbAntenna_scale_factor);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbAntenna_scale_factor error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbAntenna_id, "minimum", NC_INT, 1, &storelocal->mbAntenna_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbAntenna_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbAntenna_id, "maximum", NC_INT, 1, &storelocal->mbAntenna_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbAntenna_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbAntenna_id, "valid_minimum", NC_INT, 1, &storelocal->mbAntenna_valid_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbAntenna_valid_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbAntenna_id, "valid_maximum", NC_INT, 1, &storelocal->mbAntenna_valid_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbAntenna_valid_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbAntenna_id, "missing_value", NC_INT, 1, &storelocal->mbAntenna_missing_value);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbAntenna_missing_value error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbAntenna_id, "format_C", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbAntenna_format_C);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbAntenna_id, "orientation", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbAntenna_orientation);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    if (extended != MB_YES)
-		{
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbBeamBias_id, "type", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbBeamBias_type);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbBeamBias_id, "long_name", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbBeamBias_long_name);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbBeamBias_id, "name_code", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbBeamBias_name_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbBeamBias_id, "units", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbBeamBias_units);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbBeamBias_id, "unit_code", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbBeamBias_unit_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, storelocal->mbBeamBias_id, "add_offset", NC_DOUBLE, 1, &storelocal->mbBeamBias_add_offset);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbBeamBias_add_offset error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, storelocal->mbBeamBias_id, "scale_factor", NC_DOUBLE, 1, &storelocal->mbBeamBias_scale_factor);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbBeamBias_scale_factor error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbBeamBias_id, "minimum", NC_INT, 1, &storelocal->mbBeamBias_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbBeamBias_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbBeamBias_id, "maximum", NC_INT, 1, &storelocal->mbBeamBias_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbBeamBias_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbBeamBias_id, "valid_minimum", NC_INT, 1, &storelocal->mbBeamBias_valid_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbBeamBias_valid_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbBeamBias_id, "valid_maximum", NC_INT, 1, &storelocal->mbBeamBias_valid_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbBeamBias_valid_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbBeamBias_id, "missing_value", NC_INT, 1, &storelocal->mbBeamBias_missing_value);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbBeamBias_missing_value error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbBeamBias_id, "format_C", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbBeamBias_format_C);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbBeamBias_id, "orientation", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbBeamBias_orientation);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-		}
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbBFlag_id, "type", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbBFlag_type);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbBFlag_id, "long_name", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbBFlag_long_name);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbBFlag_id, "name_code", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbBFlag_name_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbBFlag_id, "units", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbBFlag_units);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbBFlag_id, "unit_code", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbBFlag_unit_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbBFlag_id, "add_offset", NC_INT, 1, &storelocal->mbBFlag_add_offset);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbBFlag_add_offset error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbBFlag_id, "scale_factor", NC_INT, 1, &storelocal->mbBFlag_scale_factor);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbBFlag_scale_factor error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbBFlag_id, "minimum", NC_INT, 1, &storelocal->mbBFlag_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbBFlag_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbBFlag_id, "maximum", NC_INT, 1, &storelocal->mbBFlag_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbBFlag_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbBFlag_id, "valid_minimum", NC_INT, 1, &storelocal->mbBFlag_valid_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbBFlag_valid_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbBFlag_id, "valid_maximum", NC_INT, 1, &storelocal->mbBFlag_valid_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbBFlag_valid_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbBFlag_id, "missing_value", NC_INT, 1, &storelocal->mbBFlag_missing_value);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbBFlag_missing_value error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbBFlag_id, "format_C", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbBFlag_format_C);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbBFlag_id, "orientation", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbBFlag_orientation);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbBeam_id, "type", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbBeam_type);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbBeam_id, "long_name", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbBeam_long_name);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbBeam_id, "name_code", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbBeam_name_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbBeam_id, "units", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbBeam_units);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbBeam_id, "unit_code", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbBeam_unit_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbBeam_id, "add_offset", NC_INT, 1, &storelocal->mbBeam_add_offset);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbBeam_add_offset error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbBeam_id, "scale_factor", NC_INT, 1, &storelocal->mbBeam_scale_factor);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbBeam_scale_factor error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbBeam_id, "minimum", NC_INT, 1, &storelocal->mbBeam_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbBeam_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbBeam_id, "maximum", NC_INT, 1, &storelocal->mbBeam_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbBeam_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbBeam_id, "valid_minimum", NC_INT, 1, &storelocal->mbBeam_valid_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbBeam_valid_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbBeam_id, "valid_maximum", NC_INT, 1, &storelocal->mbBeam_valid_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbBeam_valid_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbBeam_id, "missing_value", NC_INT, 1, &storelocal->mbBeam_missing_value);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbBeam_missing_value error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbBeam_id, "format_C", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbBeam_format_C);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbBeam_id, "orientation", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbBeam_orientation);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbAFlag_id, "type", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbAFlag_type);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbAFlag_id, "long_name", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbAFlag_long_name);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbAFlag_id, "name_code", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbAFlag_name_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbAFlag_id, "units", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbAFlag_units);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbAFlag_id, "unit_code", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbAFlag_unit_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbAFlag_id, "add_offset", NC_INT, 1, &storelocal->mbAFlag_add_offset);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbAFlag_add_offset error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbAFlag_id, "scale_factor", NC_INT, 1, &storelocal->mbAFlag_scale_factor);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbAFlag_scale_factor error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbAFlag_id, "minimum", NC_INT, 1, &storelocal->mbAFlag_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbAFlag_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbAFlag_id, "maximum", NC_INT, 1, &storelocal->mbAFlag_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbAFlag_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbAFlag_id, "valid_minimum", NC_INT, 1, &storelocal->mbAFlag_valid_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbAFlag_valid_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbAFlag_id, "valid_maximum", NC_INT, 1, &storelocal->mbAFlag_valid_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbAFlag_valid_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbAFlag_id, "missing_value", NC_INT, 1, &storelocal->mbAFlag_missing_value);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbAFlag_missing_value error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbAFlag_id, "format_C", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbAFlag_format_C);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbAFlag_id, "orientation", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbAFlag_orientation);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbVelProfilRef_id, "type", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbVelProfilRef_type);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbVelProfilRef_id, "long_name", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbVelProfilRef_long_name);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbVelProfilRef_id, "name_code", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbVelProfilRef_name_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbVelProfilIdx_id, "type", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbVelProfilIdx_type);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbVelProfilIdx_id, "long_name", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbVelProfilIdx_long_name);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbVelProfilIdx_id, "name_code", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbVelProfilIdx_name_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbVelProfilIdx_id, "units", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbVelProfilIdx_units);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbVelProfilIdx_id, "unit_code", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbVelProfilIdx_unit_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbVelProfilIdx_id, "add_offset", NC_INT, 1, &storelocal->mbVelProfilIdx_add_offset);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbVelProfilIdx_add_offset error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbVelProfilIdx_id, "scale_factor", NC_INT, 1, &storelocal->mbVelProfilIdx_scale_factor);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbVelProfilIdx_scale_factor error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbVelProfilIdx_id, "minimum", NC_INT, 1, &storelocal->mbVelProfilIdx_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbVelProfilIdx_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbVelProfilIdx_id, "maximum", NC_INT, 1, &storelocal->mbVelProfilIdx_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbVelProfilIdx_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbVelProfilIdx_id, "valid_minimum", NC_INT, 1, &storelocal->mbVelProfilIdx_valid_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbVelProfilIdx_valid_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbVelProfilIdx_id, "valid_maximum", NC_INT, 1, &storelocal->mbVelProfilIdx_valid_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbVelProfilIdx_valid_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbVelProfilIdx_id, "missing_value", NC_INT, 1, &storelocal->mbVelProfilIdx_missing_value);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbVelProfilIdx_missing_value error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbVelProfilIdx_id, "format_C", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbVelProfilIdx_format_C);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbVelProfilIdx_id, "orientation", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbVelProfilIdx_orientation);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbVelProfilDate_id, "type", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbVelProfilDate_type);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbVelProfilDate_id, "long_name", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbVelProfilDate_long_name);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbVelProfilDate_id, "name_code", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbVelProfilDate_name_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbVelProfilDate_id, "units", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbVelProfilDate_units);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbVelProfilDate_id, "unit_code", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbVelProfilDate_unit_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbVelProfilDate_id, "add_offset", NC_INT, 1, &storelocal->mbVelProfilDate_add_offset);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbVelProfilDate_add_offset error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbVelProfilDate_id, "scale_factor", NC_INT, 1, &storelocal->mbVelProfilDate_scale_factor);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbVelProfilDate_scale_factor error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbVelProfilDate_id, "minimum", NC_INT, 1, &storelocal->mbVelProfilDate_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbVelProfilDate_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbVelProfilDate_id, "maximum", NC_INT, 1, &storelocal->mbVelProfilDate_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbVelProfilDate_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbVelProfilDate_id, "valid_minimum", NC_INT, 1, &storelocal->mbVelProfilDate_valid_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbVelProfilDate_valid_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbVelProfilDate_id, "valid_maximum", NC_INT, 1, &storelocal->mbVelProfilDate_valid_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbVelProfilDate_valid_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbVelProfilDate_id, "missing_value", NC_INT, 1, &storelocal->mbVelProfilDate_missing_value);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbVelProfilDate_missing_value error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbVelProfilDate_id, "format_C", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbVelProfilDate_format_C);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbVelProfilDate_id, "orientation", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbVelProfilDate_orientation);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbVelProfilTime_id, "type", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbVelProfilTime_type);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbVelProfilTime_id, "long_name", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbVelProfilTime_long_name);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbVelProfilTime_id, "name_code", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbVelProfilTime_name_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbVelProfilTime_id, "units", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbVelProfilTime_units);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbVelProfilTime_id, "unit_code", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbVelProfilTime_unit_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbVelProfilTime_id, "add_offset", NC_INT, 1, &storelocal->mbVelProfilTime_add_offset);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbVelProfilTime_add_offset error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbVelProfilTime_id, "scale_factor", NC_INT, 1, &storelocal->mbVelProfilTime_scale_factor);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbVelProfilTime_scale_factor error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbVelProfilTime_id, "minimum", NC_INT, 1, &storelocal->mbVelProfilTime_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbVelProfilTime_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbVelProfilTime_id, "maximum", NC_INT, 1, &storelocal->mbVelProfilTime_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbVelProfilTime_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbVelProfilTime_id, "valid_minimum", NC_INT, 1, &storelocal->mbVelProfilTime_valid_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbVelProfilTime_valid_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbVelProfilTime_id, "valid_maximum", NC_INT, 1, &storelocal->mbVelProfilTime_valid_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbVelProfilTime_valid_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbVelProfilTime_id, "missing_value", NC_INT, 1, &storelocal->mbVelProfilTime_missing_value);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbVelProfilTime_missing_value error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbVelProfilTime_id, "format_C", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbVelProfilTime_format_C);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbVelProfilTime_id, "orientation", MBSYS_NETCDF_ATTRIBUTELEN, storelocal->mbVelProfilTime_orientation);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-
-	    /* print input debug statements */
-	    if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  NetCDF variable attributes written in function <%s>\n",function_name);
-		fprintf(stderr,"dbg2  Variable attributes:\n");
-		fprintf(stderr,"dbg2       status:                  %d\n", status);
-		fprintf(stderr,"dbg2       error:                   %d\n", *error);
-		fprintf(stderr,"dbg2       nc_status:               %d\n", nc_status);
-		fprintf(stderr,"dbg2       mbHistCode_long_name:		%s\n", storelocal->mbHistCode_long_name);
-		fprintf(stderr,"dbg2       mbHistCode_name_code:		%s\n", storelocal->mbHistCode_name_code);
-		fprintf(stderr,"dbg2       mbHistCode_units:	    %s\n", storelocal->mbHistCode_units);
-		fprintf(stderr,"dbg2       mbHistCode_unit_code:		    %s\n", storelocal->mbHistCode_unit_code);
-		fprintf(stderr,"dbg2       mbHistCode_add_offset:		    %d\n", storelocal->mbHistCode_add_offset);
-		fprintf(stderr,"dbg2       mbHistCode_scale_factor:		%d\n", storelocal->mbHistCode_scale_factor);
-		fprintf(stderr,"dbg2       mbHistCode_minimum:	    %d\n", storelocal->mbHistCode_minimum);
-		fprintf(stderr,"dbg2       mbHistCode_maximum:	    %d\n", storelocal->mbHistCode_maximum);
-		fprintf(stderr,"dbg2       mbHistCode_valid_minimum:	    %d\n", storelocal->mbHistCode_valid_minimum);
-		fprintf(stderr,"dbg2       mbHistCode_valid_maximum:	%d\n", storelocal->mbHistCode_valid_maximum);
-		fprintf(stderr,"dbg2       mbHistCode_missing_value:	%d\n", storelocal->mbHistCode_missing_value);
-		fprintf(stderr,"dbg2       mbHistCode_format_C:	    %s\n", storelocal->mbHistCode_format_C);
-		fprintf(stderr,"dbg2       mbHistCode_orientation:		%s\n", storelocal->mbHistCode_orientation);
-		fprintf(stderr,"dbg2       mbHistAutor_type:	    %s\n", storelocal->mbHistAutor_type);
-		fprintf(stderr,"dbg2       mbHistAutor_long_name:		%s\n", storelocal->mbHistAutor_long_name);
-		fprintf(stderr,"dbg2       mbHistAutor_name_code:		%s\n", storelocal->mbHistAutor_name_code);
-		fprintf(stderr,"dbg2       mbHistModule_type:	    %s\n", storelocal->mbHistModule_type);
-		fprintf(stderr,"dbg2       mbHistModule_long_name:		%s\n", storelocal->mbHistModule_long_name);
-		fprintf(stderr,"dbg2       mbHistModule_name_code:		%s\n", storelocal->mbHistModule_name_code);
-		fprintf(stderr,"dbg2       mbHistComment_type:	    %s\n", storelocal->mbHistComment_type);
-		fprintf(stderr,"dbg2       mbHistComment_long_name:		%s\n", storelocal->mbHistComment_long_name);
-		fprintf(stderr,"dbg2       mbHistComment_name_code:		%s\n", storelocal->mbHistComment_name_code);
-		fprintf(stderr,"dbg2       mbCycle_type:		%s\n", storelocal->mbCycle_type);
-		fprintf(stderr,"dbg2       mbCycle_long_name:		%s\n", storelocal->mbCycle_long_name);
-		fprintf(stderr,"dbg2       mbCycle_name_code:		%s\n", storelocal->mbCycle_name_code);
-		fprintf(stderr,"dbg2       mbCycle_units:		%s\n", storelocal->mbCycle_units);
-		fprintf(stderr,"dbg2       mbCycle_unit_code:		%s\n", storelocal->mbCycle_unit_code);
-		fprintf(stderr,"dbg2       mbCycle_add_offset:		%d\n", storelocal->mbCycle_add_offset);
-		fprintf(stderr,"dbg2       mbCycle_scale_factor:		%d\n", storelocal->mbCycle_scale_factor);
-		fprintf(stderr,"dbg2       mbCycle_minimum:		%d\n", storelocal->mbCycle_minimum);
-		fprintf(stderr,"dbg2       mbCycle_maximum:		%d\n", storelocal->mbCycle_maximum);
-		fprintf(stderr,"dbg2       mbCycle_valid_minimum:		%d\n", storelocal->mbCycle_valid_minimum);
-		fprintf(stderr,"dbg2       mbCycle_valid_maximum:		%d\n", storelocal->mbCycle_valid_maximum);
-		fprintf(stderr,"dbg2       mbCycle_missing_value:		%d\n", storelocal->mbCycle_missing_value);
-		fprintf(stderr,"dbg2       mbCycle_format_C:		%s\n", storelocal->mbCycle_format_C);
-		fprintf(stderr,"dbg2       mbCycle_orientation:		%s\n", storelocal->mbCycle_orientation);
-		fprintf(stderr,"dbg2       mbDate_type:		%s\n", storelocal->mbDate_type);
-		fprintf(stderr,"dbg2       mbDate_long_name:		%s\n", storelocal->mbDate_long_name);
-		fprintf(stderr,"dbg2       mbDate_name_code:		%s\n", storelocal->mbDate_name_code);
-		fprintf(stderr,"dbg2       mbDate_units:		%s\n", storelocal->mbDate_units);
-		fprintf(stderr,"dbg2       mbDate_unit_code:		%s\n", storelocal->mbDate_unit_code);
-		fprintf(stderr,"dbg2       mbDate_add_offset:		%d\n", storelocal->mbDate_add_offset);
-		fprintf(stderr,"dbg2       mbDate_scale_factor:		%d\n", storelocal->mbDate_scale_factor);
-		fprintf(stderr,"dbg2       mbDate_minimum:		%d\n", storelocal->mbDate_minimum);
-		fprintf(stderr,"dbg2       mbDate_maximum:		%d\n", storelocal->mbDate_maximum);
-		fprintf(stderr,"dbg2       mbDate_valid_minimum:		%d\n", storelocal->mbDate_valid_minimum);
-		fprintf(stderr,"dbg2       mbDate_valid_maximum:		%d\n", storelocal->mbDate_valid_maximum);
-		fprintf(stderr,"dbg2       mbDate_missing_value:		%d\n", storelocal->mbDate_missing_value);
-		fprintf(stderr,"dbg2       mbDate_format_C:		%s\n", storelocal->mbDate_format_C);
-		fprintf(stderr,"dbg2       mbDate_orientation:		%s\n", storelocal->mbDate_orientation);
-		fprintf(stderr,"dbg2       mbTime_type:		%s\n", storelocal->mbTime_type);
-		fprintf(stderr,"dbg2       mbTime_long_name:		%s\n", storelocal->mbTime_long_name);
-		fprintf(stderr,"dbg2       mbTime_name_code:		%s\n", storelocal->mbTime_name_code);
-		fprintf(stderr,"dbg2       mbTime_units:		%s\n", storelocal->mbTime_units);
-		fprintf(stderr,"dbg2       mbTime_unit_code:		%s\n", storelocal->mbTime_unit_code);
-		fprintf(stderr,"dbg2       mbTime_add_offset:		%d\n", storelocal->mbTime_add_offset);
-		fprintf(stderr,"dbg2       mbTime_scale_factor:		%d\n", storelocal->mbTime_scale_factor);
-		fprintf(stderr,"dbg2       mbTime_minimum:		%d\n", storelocal->mbTime_minimum);
-		fprintf(stderr,"dbg2       mbTime_maximum:		%d\n", storelocal->mbTime_maximum);
-		fprintf(stderr,"dbg2       mbTime_valid_minimum:		%d\n", storelocal->mbTime_valid_minimum);
-		fprintf(stderr,"dbg2       mbTime_valid_maximum:		%d\n", storelocal->mbTime_valid_maximum);
-		fprintf(stderr,"dbg2       mbTime_missing_value:		%d\n", storelocal->mbTime_missing_value);
-		fprintf(stderr,"dbg2       mbTime_format_C:		%s\n", storelocal->mbTime_format_C);
-		fprintf(stderr,"dbg2       mbTime_orientation:		%s\n", storelocal->mbTime_orientation);
-		fprintf(stderr,"dbg2       mbOrdinate_type:		%s\n", storelocal->mbOrdinate_type);
-		fprintf(stderr,"dbg2       mbOrdinate_long_name:		%s\n", storelocal->mbOrdinate_long_name);
-		fprintf(stderr,"dbg2       mbOrdinate_name_code:		%s\n", storelocal->mbOrdinate_name_code);
-		fprintf(stderr,"dbg2       mbOrdinate_units:		%s\n", storelocal->mbOrdinate_units);
-		fprintf(stderr,"dbg2       mbOrdinate_unit_code:		%s\n", storelocal->mbOrdinate_unit_code);
-		fprintf(stderr,"dbg2       mbOrdinate_add_offset:		%f\n", storelocal->mbOrdinate_add_offset);
-		fprintf(stderr,"dbg2       mbOrdinate_scale_factor:		%f\n", storelocal->mbOrdinate_scale_factor);
-		fprintf(stderr,"dbg2       mbOrdinate_minimum:		%f\n", storelocal->mbOrdinate_minimum);
-		fprintf(stderr,"dbg2       mbOrdinate_maximum:		%f\n", storelocal->mbOrdinate_maximum);
-		fprintf(stderr,"dbg2       mbOrdinate_valid_minimum:		%d\n", storelocal->mbOrdinate_valid_minimum);
-		fprintf(stderr,"dbg2       mbOrdinate_valid_maximum:		%d\n", storelocal->mbOrdinate_valid_maximum);
-		fprintf(stderr,"dbg2       mbOrdinate_missing_value:		%d\n", storelocal->mbOrdinate_missing_value);
-		fprintf(stderr,"dbg2       mbOrdinate_format_C:		%s\n", storelocal->mbOrdinate_format_C);
-		fprintf(stderr,"dbg2       mbOrdinate_orientation:		%s\n", storelocal->mbOrdinate_orientation);
-		fprintf(stderr,"dbg2       mbAbscissa_type:		%s\n", storelocal->mbAbscissa_type);
-		fprintf(stderr,"dbg2       mbAbscissa_long_name:		%s\n", storelocal->mbAbscissa_long_name);
-		fprintf(stderr,"dbg2       mbAbscissa_name_code:		%s\n", storelocal->mbAbscissa_name_code);
-		fprintf(stderr,"dbg2       mbAbscissa_units:		%s\n", storelocal->mbAbscissa_units);
-		fprintf(stderr,"dbg2       mbAbscissa_unit_code:		%s\n", storelocal->mbAbscissa_unit_code);
-		fprintf(stderr,"dbg2       mbAbscissa_add_offset:		%f\n", storelocal->mbAbscissa_add_offset);
-		fprintf(stderr,"dbg2       mbAbscissa_scale_factor:		%f\n", storelocal->mbAbscissa_scale_factor);
-		fprintf(stderr,"dbg2       mbAbscissa_minimum:		%f\n", storelocal->mbAbscissa_minimum);
-		fprintf(stderr,"dbg2       mbAbscissa_maximum:		%f\n", storelocal->mbAbscissa_maximum);
-		fprintf(stderr,"dbg2       mbAbscissa_valid_minimum:		%d\n", storelocal->mbAbscissa_valid_minimum);
-		fprintf(stderr,"dbg2       mbAbscissa_valid_maximum:		%d\n", storelocal->mbAbscissa_valid_maximum);
-		fprintf(stderr,"dbg2       mbAbscissa_missing_value:		%d\n", storelocal->mbAbscissa_missing_value);
-		fprintf(stderr,"dbg2       mbAbscissa_format_C:		%s\n", storelocal->mbAbscissa_format_C);
-		fprintf(stderr,"dbg2       mbAbscissa_orientation:		%s\n", storelocal->mbAbscissa_orientation);
-		fprintf(stderr,"dbg2       mbFrequency_type:		%s\n", storelocal->mbFrequency_type);
-		fprintf(stderr,"dbg2       mbFrequency_long_name:		%s\n", storelocal->mbFrequency_long_name);
-		fprintf(stderr,"dbg2       mbFrequency_name_code:		%s\n", storelocal->mbFrequency_name_code);
-		fprintf(stderr,"dbg2       mbFrequency_units:		%s\n", storelocal->mbFrequency_units);
-		fprintf(stderr,"dbg2       mbFrequency_unit_code:		%s\n", storelocal->mbFrequency_unit_code);
-		fprintf(stderr,"dbg2       mbFrequency_add_offset:		%d\n", storelocal->mbFrequency_add_offset);
-		fprintf(stderr,"dbg2       mbFrequency_scale_factor:		%d\n", storelocal->mbFrequency_scale_factor);
-		fprintf(stderr,"dbg2       mbFrequency_minimum:		%d\n", storelocal->mbFrequency_minimum);
-		fprintf(stderr,"dbg2       mbFrequency_maximum:		%d\n", storelocal->mbFrequency_maximum);
-		fprintf(stderr,"dbg2       mbFrequency_valid_minimum:		%d\n", storelocal->mbFrequency_valid_minimum);
-		fprintf(stderr,"dbg2       mbFrequency_valid_maximum:		%d\n", storelocal->mbFrequency_valid_maximum);
-		fprintf(stderr,"dbg2       mbFrequency_missing_value:		%d\n", storelocal->mbFrequency_missing_value);
-		fprintf(stderr,"dbg2       mbFrequency_format_C:		%s\n", storelocal->mbFrequency_format_C);
-		fprintf(stderr,"dbg2       mbFrequency_orientation:		%s\n", storelocal->mbFrequency_orientation);
-		fprintf(stderr,"dbg2       mbSounderMode_type:		%s\n", storelocal->mbSounderMode_type);
-		fprintf(stderr,"dbg2       mbSounderMode_long_name:		%s\n", storelocal->mbSounderMode_long_name);
-		fprintf(stderr,"dbg2       mbSounderMode_name_code:		%s\n", storelocal->mbSounderMode_name_code);
-		fprintf(stderr,"dbg2       mbSounderMode_units:		%s\n", storelocal->mbSounderMode_units);
-		fprintf(stderr,"dbg2       mbSounderMode_unit_code:		%s\n", storelocal->mbSounderMode_unit_code);
-		fprintf(stderr,"dbg2       mbSounderMode_add_offset:		%d\n", storelocal->mbSounderMode_add_offset);
-		fprintf(stderr,"dbg2       mbSounderMode_scale_factor:		%d\n", storelocal->mbSounderMode_scale_factor);
-		fprintf(stderr,"dbg2       mbSounderMode_minimum:		%d\n", storelocal->mbSounderMode_minimum);
-		fprintf(stderr,"dbg2       mbSounderMode_maximum:		%d\n", storelocal->mbSounderMode_maximum);
-		fprintf(stderr,"dbg2       mbSounderMode_valid_minimum:		%d\n", storelocal->mbSounderMode_valid_minimum);
-		fprintf(stderr,"dbg2       mbSounderMode_valid_maximum:		%d\n", storelocal->mbSounderMode_valid_maximum);
-		fprintf(stderr,"dbg2       mbSounderMode_missing_value:		%d\n", storelocal->mbSounderMode_missing_value);
-		fprintf(stderr,"dbg2       mbSounderMode_format_C:		%s\n", storelocal->mbSounderMode_format_C);
-		fprintf(stderr,"dbg2       mbSounderMode_orientation:		%s\n", storelocal->mbSounderMode_orientation);
-		fprintf(stderr,"dbg2       mbReferenceDepth_type:		%s\n", storelocal->mbReferenceDepth_type);
-		fprintf(stderr,"dbg2       mbReferenceDepth_long_name:		%s\n", storelocal->mbReferenceDepth_long_name);
-		fprintf(stderr,"dbg2       mbReferenceDepth_name_code:		%s\n", storelocal->mbReferenceDepth_name_code);
-		fprintf(stderr,"dbg2       mbReferenceDepth_units:		%s\n", storelocal->mbReferenceDepth_units);
-		fprintf(stderr,"dbg2       mbReferenceDepth_unit_code:		%s\n", storelocal->mbReferenceDepth_unit_code);
-		fprintf(stderr,"dbg2       mbReferenceDepth_add_offset:		%f\n", storelocal->mbReferenceDepth_add_offset);
-		fprintf(stderr,"dbg2       mbReferenceDepth_scale_factor:		%f\n", storelocal->mbReferenceDepth_scale_factor);
-		fprintf(stderr,"dbg2       mbReferenceDepth_minimum:		%f\n", storelocal->mbReferenceDepth_minimum);
-		fprintf(stderr,"dbg2       mbReferenceDepth_maximum:		%f\n", storelocal->mbReferenceDepth_maximum);
-		fprintf(stderr,"dbg2       mbReferenceDepth_valid_minimum:		%d\n", storelocal->mbReferenceDepth_valid_minimum);
-		fprintf(stderr,"dbg2       mbReferenceDepth_valid_maximum:		%d\n", storelocal->mbReferenceDepth_valid_maximum);
-		fprintf(stderr,"dbg2       mbReferenceDepth_missing_value:		%d\n", storelocal->mbReferenceDepth_missing_value);
-		fprintf(stderr,"dbg2       mbReferenceDepth_format_C:		%s\n", storelocal->mbReferenceDepth_format_C);
-		fprintf(stderr,"dbg2       mbReferenceDepth_orientation:		%s\n", storelocal->mbReferenceDepth_orientation);
-		fprintf(stderr,"dbg2       mbDynamicDraught_type:		%s\n", storelocal->mbDynamicDraught_type);
-		fprintf(stderr,"dbg2       mbDynamicDraught_long_name:		%s\n", storelocal->mbDynamicDraught_long_name);
-		fprintf(stderr,"dbg2       mbDynamicDraught_name_code:		%s\n", storelocal->mbDynamicDraught_name_code);
-		fprintf(stderr,"dbg2       mbDynamicDraught_units:		%s\n", storelocal->mbDynamicDraught_units);
-		fprintf(stderr,"dbg2       mbDynamicDraught_unit_code:		%s\n", storelocal->mbDynamicDraught_unit_code);
-		fprintf(stderr,"dbg2       mbDynamicDraught_add_offset:		%f\n", storelocal->mbDynamicDraught_add_offset);
-		fprintf(stderr,"dbg2       mbDynamicDraught_scale_factor:		%f\n", storelocal->mbDynamicDraught_scale_factor);
-		fprintf(stderr,"dbg2       mbDynamicDraught_minimum:		%f\n", storelocal->mbDynamicDraught_minimum);
-		fprintf(stderr,"dbg2       mbDynamicDraught_maximum:		%f\n", storelocal->mbDynamicDraught_maximum);
-		fprintf(stderr,"dbg2       mbDynamicDraught_valid_minimum:		%d\n", storelocal->mbDynamicDraught_valid_minimum);
-		fprintf(stderr,"dbg2       mbDynamicDraught_valid_maximum:		%d\n", storelocal->mbDynamicDraught_valid_maximum);
-		fprintf(stderr,"dbg2       mbDynamicDraught_missing_value:		%d\n", storelocal->mbDynamicDraught_missing_value);
-		fprintf(stderr,"dbg2       mbDynamicDraught_format_C:		%s\n", storelocal->mbDynamicDraught_format_C);
-		fprintf(stderr,"dbg2       mbDynamicDraught_orientation:		%s\n", storelocal->mbDynamicDraught_orientation);
-		fprintf(stderr,"dbg2       mbTide_type:		%s\n", storelocal->mbTide_type);
-		fprintf(stderr,"dbg2       mbTide_long_name:		%s\n", storelocal->mbTide_long_name);
-		fprintf(stderr,"dbg2       mbTide_name_code:		%s\n", storelocal->mbTide_name_code);
-		fprintf(stderr,"dbg2       mbTide_units:		%s\n", storelocal->mbTide_units);
-		fprintf(stderr,"dbg2       mbTide_unit_code:		%s\n", storelocal->mbTide_unit_code);
-		fprintf(stderr,"dbg2       mbTide_add_offset:		%f\n", storelocal->mbTide_add_offset);
-		fprintf(stderr,"dbg2       mbTide_scale_factor:		%f\n", storelocal->mbTide_scale_factor);
-		fprintf(stderr,"dbg2       mbTide_minimum:		%f\n", storelocal->mbTide_minimum);
-		fprintf(stderr,"dbg2       mbTide_maximum:		%f\n", storelocal->mbTide_maximum);
-		fprintf(stderr,"dbg2       mbTide_valid_minimum:		%d\n", storelocal->mbTide_valid_minimum);
-		fprintf(stderr,"dbg2       mbTide_valid_maximum:		%d\n", storelocal->mbTide_valid_maximum);
-		fprintf(stderr,"dbg2       mbTide_missing_value:		%d\n", storelocal->mbTide_missing_value);
-		fprintf(stderr,"dbg2       mbTide_format_C:		%s\n", storelocal->mbTide_format_C);
-		fprintf(stderr,"dbg2       mbTide_orientation:		%s\n", storelocal->mbTide_orientation);
-		fprintf(stderr,"dbg2       mbSoundVelocity_type:		%s\n", storelocal->mbSoundVelocity_type);
-		fprintf(stderr,"dbg2       mbSoundVelocity_long_name:		%s\n", storelocal->mbSoundVelocity_long_name);
-		fprintf(stderr,"dbg2       mbSoundVelocity_name_code:		%s\n", storelocal->mbSoundVelocity_name_code);
-		fprintf(stderr,"dbg2       mbSoundVelocity_units:		%s\n", storelocal->mbSoundVelocity_units);
-		fprintf(stderr,"dbg2       mbSoundVelocity_unit_code:		%s\n", storelocal->mbSoundVelocity_unit_code);
-		fprintf(stderr,"dbg2       mbSoundVelocity_add_offset:		%f\n", storelocal->mbSoundVelocity_add_offset);
-		fprintf(stderr,"dbg2       mbSoundVelocity_scale_factor:		%f\n", storelocal->mbSoundVelocity_scale_factor);
-		fprintf(stderr,"dbg2       mbSoundVelocity_minimum:		%f\n", storelocal->mbSoundVelocity_minimum);
-		fprintf(stderr,"dbg2       mbSoundVelocity_maximum:		%f\n", storelocal->mbSoundVelocity_maximum);
-		fprintf(stderr,"dbg2       mbSoundVelocity_valid_minimum:		%d\n", storelocal->mbSoundVelocity_valid_minimum);
-		fprintf(stderr,"dbg2       mbSoundVelocity_valid_maximum:		%d\n", storelocal->mbSoundVelocity_valid_maximum);
-		fprintf(stderr,"dbg2       mbSoundVelocity_missing_value:		%d\n", storelocal->mbSoundVelocity_missing_value);
-		fprintf(stderr,"dbg2       mbSoundVelocity_format_C:		%s\n", storelocal->mbSoundVelocity_format_C);
-		fprintf(stderr,"dbg2       mbSoundVelocity_orientation:		%s\n", storelocal->mbSoundVelocity_orientation);
-		fprintf(stderr,"dbg2       mbHeading_type:		%s\n", storelocal->mbHeading_type);
-		fprintf(stderr,"dbg2       mbHeading_long_name:		%s\n", storelocal->mbHeading_long_name);
-		fprintf(stderr,"dbg2       mbHeading_name_code:		%s\n", storelocal->mbHeading_name_code);
-		fprintf(stderr,"dbg2       mbHeading_units:		%s\n", storelocal->mbHeading_units);
-		fprintf(stderr,"dbg2       mbHeading_unit_code:		%s\n", storelocal->mbHeading_unit_code);
-		fprintf(stderr,"dbg2       mbHeading_add_offset:		%f\n", storelocal->mbHeading_add_offset);
-		fprintf(stderr,"dbg2       mbHeading_scale_factor:		%f\n", storelocal->mbHeading_scale_factor);
-		fprintf(stderr,"dbg2       mbHeading_minimum:		%f\n", storelocal->mbHeading_minimum);
-		fprintf(stderr,"dbg2       mbHeading_maximum:		%f\n", storelocal->mbHeading_maximum);
-		fprintf(stderr,"dbg2       mbHeading_valid_minimum:		%d\n", storelocal->mbHeading_valid_minimum);
-		fprintf(stderr,"dbg2       mbHeading_valid_maximum:		%d\n", storelocal->mbHeading_valid_maximum);
-		fprintf(stderr,"dbg2       mbHeading_missing_value:		%d\n", storelocal->mbHeading_missing_value);
-		fprintf(stderr,"dbg2       mbHeading_format_C:		%s\n", storelocal->mbHeading_format_C);
-		fprintf(stderr,"dbg2       mbHeading_orientation:		%s\n", storelocal->mbHeading_orientation);
-		fprintf(stderr,"dbg2       mbRoll_type:		%s\n", storelocal->mbRoll_type);
-		fprintf(stderr,"dbg2       mbRoll_long_name:		%s\n", storelocal->mbRoll_long_name);
-		fprintf(stderr,"dbg2       mbRoll_name_code:		%s\n", storelocal->mbRoll_name_code);
-		fprintf(stderr,"dbg2       mbRoll_units:		%s\n", storelocal->mbRoll_units);
-		fprintf(stderr,"dbg2       mbRoll_unit_code:		%s\n", storelocal->mbRoll_unit_code);
-		fprintf(stderr,"dbg2       mbRoll_add_offset:		%f\n", storelocal->mbRoll_add_offset);
-		fprintf(stderr,"dbg2       mbRoll_scale_factor:		%f\n", storelocal->mbRoll_scale_factor);
-		fprintf(stderr,"dbg2       mbRoll_minimum:		%f\n", storelocal->mbRoll_minimum);
-		fprintf(stderr,"dbg2       mbRoll_maximum:		%f\n", storelocal->mbRoll_maximum);
-		fprintf(stderr,"dbg2       mbRoll_valid_minimum:		%d\n", storelocal->mbRoll_valid_minimum);
-		fprintf(stderr,"dbg2       mbRoll_valid_maximum:		%d\n", storelocal->mbRoll_valid_maximum);
-		fprintf(stderr,"dbg2       mbRoll_missing_value:		%d\n", storelocal->mbRoll_missing_value);
-		fprintf(stderr,"dbg2       mbRoll_format_C:		%s\n", storelocal->mbRoll_format_C);
-		fprintf(stderr,"dbg2       mbRoll_orientation:		%s\n", storelocal->mbRoll_orientation);
-		fprintf(stderr,"dbg2       mbPitch_type:		%s\n", storelocal->mbPitch_type);
-		fprintf(stderr,"dbg2       mbPitch_long_name:		%s\n", storelocal->mbPitch_long_name);
-		fprintf(stderr,"dbg2       mbPitch_name_code:		%s\n", storelocal->mbPitch_name_code);
-		fprintf(stderr,"dbg2       mbPitch_units:		%s\n", storelocal->mbPitch_units);
-		fprintf(stderr,"dbg2       mbPitch_unit_code:		%s\n", storelocal->mbPitch_unit_code);
-		fprintf(stderr,"dbg2       mbPitch_add_offset:		%f\n", storelocal->mbPitch_add_offset);
-		fprintf(stderr,"dbg2       mbPitch_scale_factor:		%f\n", storelocal->mbPitch_scale_factor);
-		fprintf(stderr,"dbg2       mbPitch_minimum:		%f\n", storelocal->mbPitch_minimum);
-		fprintf(stderr,"dbg2       mbPitch_maximum:		%f\n", storelocal->mbPitch_maximum);
-		fprintf(stderr,"dbg2       mbPitch_valid_minimum:		%d\n", storelocal->mbPitch_valid_minimum);
-		fprintf(stderr,"dbg2       mbPitch_valid_maximum:		%d\n", storelocal->mbPitch_valid_maximum);
-		fprintf(stderr,"dbg2       mbPitch_missing_value:		%d\n", storelocal->mbPitch_missing_value);
-		fprintf(stderr,"dbg2       mbPitch_format_C:		%s\n", storelocal->mbPitch_format_C);
-		fprintf(stderr,"dbg2       mbPitch_orientation:		%s\n", storelocal->mbPitch_orientation);
-		fprintf(stderr,"dbg2       mbTransmissionHeave_type:		%s\n", storelocal->mbTransmissionHeave_type);
-		fprintf(stderr,"dbg2       mbTransmissionHeave_long_name:		%s\n", storelocal->mbTransmissionHeave_long_name);
-		fprintf(stderr,"dbg2       mbTransmissionHeave_name_code:		%s\n", storelocal->mbTransmissionHeave_name_code);
-		fprintf(stderr,"dbg2       mbTransmissionHeave_units:		%s\n", storelocal->mbTransmissionHeave_units);
-		fprintf(stderr,"dbg2       mbTransmissionHeave_unit_code:		%s\n", storelocal->mbTransmissionHeave_unit_code);
-		fprintf(stderr,"dbg2       mbTransmissionHeave_add_offset:		%f\n", storelocal->mbTransmissionHeave_add_offset);
-		fprintf(stderr,"dbg2       mbTransmissionHeave_scale_factor:		%f\n", storelocal->mbTransmissionHeave_scale_factor);
-		fprintf(stderr,"dbg2       mbTransmissionHeave_minimum:		%f\n", storelocal->mbTransmissionHeave_minimum);
-		fprintf(stderr,"dbg2       mbTransmissionHeave_maximum:		%f\n", storelocal->mbTransmissionHeave_maximum);
-		fprintf(stderr,"dbg2       mbTransmissionHeave_valid_minimum:		%d\n", storelocal->mbTransmissionHeave_valid_minimum);
-		fprintf(stderr,"dbg2       mbTransmissionHeave_valid_maximum:		%d\n", storelocal->mbTransmissionHeave_valid_maximum);
-		fprintf(stderr,"dbg2       mbTransmissionHeave_missing_value:		%d\n", storelocal->mbTransmissionHeave_missing_value);
-		fprintf(stderr,"dbg2       mbTransmissionHeave_format_C:		%s\n", storelocal->mbTransmissionHeave_format_C);
-		fprintf(stderr,"dbg2       mbTransmissionHeave_orientation:		%s\n", storelocal->mbTransmissionHeave_orientation);
-		fprintf(stderr,"dbg2       mbDistanceScale_type:		%s\n", storelocal->mbDistanceScale_type);
-		fprintf(stderr,"dbg2       mbDistanceScale_long_name:		%s\n", storelocal->mbDistanceScale_long_name);
-		fprintf(stderr,"dbg2       mbDistanceScale_name_code:		%s\n", storelocal->mbDistanceScale_name_code);
-		fprintf(stderr,"dbg2       mbDistanceScale_units:		%s\n", storelocal->mbDistanceScale_units);
-		fprintf(stderr,"dbg2       mbDistanceScale_unit_code:		%s\n", storelocal->mbDistanceScale_unit_code);
-		fprintf(stderr,"dbg2       mbDistanceScale_add_offset:		%f\n", storelocal->mbDistanceScale_add_offset);
-		fprintf(stderr,"dbg2       mbDistanceScale_scale_factor:		%f\n", storelocal->mbDistanceScale_scale_factor);
-		fprintf(stderr,"dbg2       mbDistanceScale_minimum:		%f\n", storelocal->mbDistanceScale_minimum);
-		fprintf(stderr,"dbg2       mbDistanceScale_maximum:		%f\n", storelocal->mbDistanceScale_maximum);
-		fprintf(stderr,"dbg2       mbDistanceScale_valid_minimum:		%d\n", storelocal->mbDistanceScale_valid_minimum);
-		fprintf(stderr,"dbg2       mbDistanceScale_valid_maximum:		%d\n", storelocal->mbDistanceScale_valid_maximum);
-		fprintf(stderr,"dbg2       mbDistanceScale_missing_value:		%d\n", storelocal->mbDistanceScale_missing_value);
-		fprintf(stderr,"dbg2       mbDistanceScale_format_C:		%s\n", storelocal->mbDistanceScale_format_C);
-		fprintf(stderr,"dbg2       mbDistanceScale_orientation:		%s\n", storelocal->mbDistanceScale_orientation);
-		fprintf(stderr,"dbg2       mbDepthScale_type:		%s\n", storelocal->mbDepthScale_type);
-		fprintf(stderr,"dbg2       mbDepthScale_long_name:		%s\n", storelocal->mbDepthScale_long_name);
-		fprintf(stderr,"dbg2       mbDepthScale_name_code:		%s\n", storelocal->mbDepthScale_name_code);
-		fprintf(stderr,"dbg2       mbDepthScale_units:		%s\n", storelocal->mbDepthScale_units);
-		fprintf(stderr,"dbg2       mbDepthScale_unit_code:		%s\n", storelocal->mbDepthScale_unit_code);
-		fprintf(stderr,"dbg2       mbDepthScale_add_offset:		%f\n", storelocal->mbDepthScale_add_offset);
-		fprintf(stderr,"dbg2       mbDepthScale_scale_factor:		%f\n", storelocal->mbDepthScale_scale_factor);
-		fprintf(stderr,"dbg2       mbDepthScale_minimum:		%f\n", storelocal->mbDepthScale_minimum);
-		fprintf(stderr,"dbg2       mbDepthScale_maximum:		%f\n", storelocal->mbDepthScale_maximum);
-		fprintf(stderr,"dbg2       mbDepthScale_valid_minimum:		%d\n", storelocal->mbDepthScale_valid_minimum);
-		fprintf(stderr,"dbg2       mbDepthScale_valid_maximum:		%d\n", storelocal->mbDepthScale_valid_maximum);
-		fprintf(stderr,"dbg2       mbDepthScale_missing_value:		%d\n", storelocal->mbDepthScale_missing_value);
-		fprintf(stderr,"dbg2       mbDepthScale_format_C:		%s\n", storelocal->mbDepthScale_format_C);
-		fprintf(stderr,"dbg2       mbDepthScale_orientation:		%s\n", storelocal->mbDepthScale_orientation);
-		fprintf(stderr,"dbg2       mbVerticalDepth_type:		%s\n", storelocal->mbVerticalDepth_type);
-		fprintf(stderr,"dbg2       mbVerticalDepth_long_name:		%s\n", storelocal->mbVerticalDepth_long_name);
-		fprintf(stderr,"dbg2       mbVerticalDepth_name_code:		%s\n", storelocal->mbVerticalDepth_name_code);
-		fprintf(stderr,"dbg2       mbVerticalDepth_units:		%s\n", storelocal->mbVerticalDepth_units);
-		fprintf(stderr,"dbg2       mbVerticalDepth_unit_code:		%s\n", storelocal->mbVerticalDepth_unit_code);
-		fprintf(stderr,"dbg2       mbVerticalDepth_add_offset:		%d\n", storelocal->mbVerticalDepth_add_offset);
-		fprintf(stderr,"dbg2       mbVerticalDepth_scale_factor:		%d\n", storelocal->mbVerticalDepth_scale_factor);
-		fprintf(stderr,"dbg2       mbVerticalDepth_minimum:		%d\n", storelocal->mbVerticalDepth_minimum);
-		fprintf(stderr,"dbg2       mbVerticalDepth_maximum:		%d\n", storelocal->mbVerticalDepth_maximum);
-		fprintf(stderr,"dbg2       mbVerticalDepth_valid_minimum:		%d\n", storelocal->mbVerticalDepth_valid_minimum);
-		fprintf(stderr,"dbg2       mbVerticalDepth_valid_maximum:		%d\n", storelocal->mbVerticalDepth_valid_maximum);
-		fprintf(stderr,"dbg2       mbVerticalDepth_missing_value:		%d\n", storelocal->mbVerticalDepth_missing_value);
-		fprintf(stderr,"dbg2       mbVerticalDepth_format_C:		%s\n", storelocal->mbVerticalDepth_format_C);
-		fprintf(stderr,"dbg2       mbVerticalDepth_orientation:		%s\n", storelocal->mbVerticalDepth_orientation);
-		fprintf(stderr,"dbg2       mbCQuality_type:		%s\n", storelocal->mbCQuality_type);
-		fprintf(stderr,"dbg2       mbCQuality_long_name:		%s\n", storelocal->mbCQuality_long_name);
-		fprintf(stderr,"dbg2       mbCQuality_name_code:		%s\n", storelocal->mbCQuality_name_code);
-		fprintf(stderr,"dbg2       mbCQuality_units:		%s\n", storelocal->mbCQuality_units);
-		fprintf(stderr,"dbg2       mbCQuality_unit_code:		%s\n", storelocal->mbCQuality_unit_code);
-		fprintf(stderr,"dbg2       mbCQuality_add_offset:		%d\n", storelocal->mbCQuality_add_offset);
-		fprintf(stderr,"dbg2       mbCQuality_scale_factor:		%d\n", storelocal->mbCQuality_scale_factor);
-		fprintf(stderr,"dbg2       mbCQuality_minimum:		%d\n", storelocal->mbCQuality_minimum);
-		fprintf(stderr,"dbg2       mbCQuality_maximum:		%d\n", storelocal->mbCQuality_maximum);
-		fprintf(stderr,"dbg2       mbCQuality_valid_minimum:		%d\n", storelocal->mbCQuality_valid_minimum);
-		fprintf(stderr,"dbg2       mbCQuality_valid_maximum:		%d\n", storelocal->mbCQuality_valid_maximum);
-		fprintf(stderr,"dbg2       mbCQuality_missing_value:		%d\n", storelocal->mbCQuality_missing_value);
-		fprintf(stderr,"dbg2       mbCQuality_format_C:		%s\n", storelocal->mbCQuality_format_C);
-		fprintf(stderr,"dbg2       mbCQuality_orientation:		%s\n", storelocal->mbCQuality_orientation);
-		fprintf(stderr,"dbg2       mbCFlag_type:		%s\n", storelocal->mbCFlag_type);
-		fprintf(stderr,"dbg2       mbCFlag_long_name:		%s\n", storelocal->mbCFlag_long_name);
-		fprintf(stderr,"dbg2       mbCFlag_name_code:		%s\n", storelocal->mbCFlag_name_code);
-		fprintf(stderr,"dbg2       mbCFlag_units:		%s\n", storelocal->mbCFlag_units);
-		fprintf(stderr,"dbg2       mbCFlag_unit_code:		%s\n", storelocal->mbCFlag_unit_code);
-		fprintf(stderr,"dbg2       mbCFlag_add_offset:		%d\n", storelocal->mbCFlag_add_offset);
-		fprintf(stderr,"dbg2       mbCFlag_scale_factor:		%d\n", storelocal->mbCFlag_scale_factor);
-		fprintf(stderr,"dbg2       mbCFlag_minimum:		%d\n", storelocal->mbCFlag_minimum);
-		fprintf(stderr,"dbg2       mbCFlag_maximum:		%d\n", storelocal->mbCFlag_maximum);
-		fprintf(stderr,"dbg2       mbCFlag_valid_minimum:		%d\n", storelocal->mbCFlag_valid_minimum);
-		fprintf(stderr,"dbg2       mbCFlag_valid_maximum:		%d\n", storelocal->mbCFlag_valid_maximum);
-		fprintf(stderr,"dbg2       mbCFlag_missing_value:		%d\n", storelocal->mbCFlag_missing_value);
-		fprintf(stderr,"dbg2       mbCFlag_format_C:		%s\n", storelocal->mbCFlag_format_C);
-		fprintf(stderr,"dbg2       mbCFlag_orientation:		%s\n", storelocal->mbCFlag_orientation);
-		fprintf(stderr,"dbg2       mbInterlacing_type:		%s\n", storelocal->mbInterlacing_type);
-		fprintf(stderr,"dbg2       mbInterlacing_long_name:		%s\n", storelocal->mbInterlacing_long_name);
-		fprintf(stderr,"dbg2       mbInterlacing_name_code:		%s\n", storelocal->mbInterlacing_name_code);
-		fprintf(stderr,"dbg2       mbInterlacing_units:		%s\n", storelocal->mbInterlacing_units);
-		fprintf(stderr,"dbg2       mbInterlacing_unit_code:		%s\n", storelocal->mbInterlacing_unit_code);
-		fprintf(stderr,"dbg2       mbInterlacing_add_offset:		%d\n", storelocal->mbInterlacing_add_offset);
-		fprintf(stderr,"dbg2       mbInterlacing_scale_factor:		%d\n", storelocal->mbInterlacing_scale_factor);
-		fprintf(stderr,"dbg2       mbInterlacing_minimum:		%d\n", storelocal->mbInterlacing_minimum);
-		fprintf(stderr,"dbg2       mbInterlacing_maximum:		%d\n", storelocal->mbInterlacing_maximum);
-		fprintf(stderr,"dbg2       mbInterlacing_valid_minimum:		%d\n", storelocal->mbInterlacing_valid_minimum);
-		fprintf(stderr,"dbg2       mbInterlacing_valid_maximum:		%d\n", storelocal->mbInterlacing_valid_maximum);
-		fprintf(stderr,"dbg2       mbInterlacing_missing_value:		%d\n", storelocal->mbInterlacing_missing_value);
-		fprintf(stderr,"dbg2       mbInterlacing_format_C:		%s\n", storelocal->mbInterlacing_format_C);
-		fprintf(stderr,"dbg2       mbInterlacing_orientation:		%s\n", storelocal->mbInterlacing_orientation);
-		fprintf(stderr,"dbg2       mbSamplingRate_type:		%s\n", storelocal->mbSamplingRate_type);
-		fprintf(stderr,"dbg2       mbSamplingRate_long_name:		%s\n", storelocal->mbSamplingRate_long_name);
-		fprintf(stderr,"dbg2       mbSamplingRate_name_code:		%s\n", storelocal->mbSamplingRate_name_code);
-		fprintf(stderr,"dbg2       mbSamplingRate_units:		%s\n", storelocal->mbSamplingRate_units);
-		fprintf(stderr,"dbg2       mbSamplingRate_unit_code:		%s\n", storelocal->mbSamplingRate_unit_code);
-		fprintf(stderr,"dbg2       mbSamplingRate_add_offset:		%d\n", storelocal->mbSamplingRate_add_offset);
-		fprintf(stderr,"dbg2       mbSamplingRate_scale_factor:		%d\n", storelocal->mbSamplingRate_scale_factor);
-		fprintf(stderr,"dbg2       mbSamplingRate_minimum:		%d\n", storelocal->mbSamplingRate_minimum);
-		fprintf(stderr,"dbg2       mbSamplingRate_maximum:		%d\n", storelocal->mbSamplingRate_maximum);
-		fprintf(stderr,"dbg2       mbSamplingRate_valid_minimum:		%d\n", storelocal->mbSamplingRate_valid_minimum);
-		fprintf(stderr,"dbg2       mbSamplingRate_valid_maximum:		%d\n", storelocal->mbSamplingRate_valid_maximum);
-		fprintf(stderr,"dbg2       mbSamplingRate_missing_value:		%d\n", storelocal->mbSamplingRate_missing_value);
-		fprintf(stderr,"dbg2       mbSamplingRate_format_C:		%s\n", storelocal->mbSamplingRate_format_C);
-		fprintf(stderr,"dbg2       mbSamplingRate_orientation:		%s\n", storelocal->mbSamplingRate_orientation);
-		fprintf(stderr,"dbg2       mbAlongDistance_type:		%s\n", storelocal->mbAlongDistance_type);
-		fprintf(stderr,"dbg2       mbAlongDistance_long_name:		%s\n", storelocal->mbAlongDistance_long_name);
-		fprintf(stderr,"dbg2       mbAlongDistance_name_code:		%s\n", storelocal->mbAlongDistance_name_code);
-		fprintf(stderr,"dbg2       mbAlongDistance_units:		%s\n", storelocal->mbAlongDistance_units);
-		fprintf(stderr,"dbg2       mbAlongDistance_unit_code:		%s\n", storelocal->mbAlongDistance_unit_code);
-		fprintf(stderr,"dbg2       mbAlongDistance_add_offset:		%d\n", storelocal->mbAlongDistance_add_offset);
-		fprintf(stderr,"dbg2       mbAlongDistance_scale_factor:		%d\n", storelocal->mbAlongDistance_scale_factor);
-		fprintf(stderr,"dbg2       mbAlongDistance_minimum:		%d\n", storelocal->mbAlongDistance_minimum);
-		fprintf(stderr,"dbg2       mbAlongDistance_maximum:		%d\n", storelocal->mbAlongDistance_maximum);
-		fprintf(stderr,"dbg2       mbAlongDistance_valid_minimum:		%d\n", storelocal->mbAlongDistance_valid_minimum);
-		fprintf(stderr,"dbg2       mbAlongDistance_valid_maximum:		%d\n", storelocal->mbAlongDistance_valid_maximum);
-		fprintf(stderr,"dbg2       mbAlongDistance_missing_value:		%d\n", storelocal->mbAlongDistance_missing_value);
-		fprintf(stderr,"dbg2       mbAlongDistance_format_C:		%s\n", storelocal->mbAlongDistance_format_C);
-		fprintf(stderr,"dbg2       mbAlongDistance_orientation:		%s\n", storelocal->mbAlongDistance_orientation);
-		fprintf(stderr,"dbg2       mbAcrossDistance_type:		%s\n", storelocal->mbAcrossDistance_type);
-		fprintf(stderr,"dbg2       mbAcrossDistance_long_name:		%s\n", storelocal->mbAcrossDistance_long_name);
-		fprintf(stderr,"dbg2       mbAcrossDistance_name_code:		%s\n", storelocal->mbAcrossDistance_name_code);
-		fprintf(stderr,"dbg2       mbAcrossDistance_units:		%s\n", storelocal->mbAcrossDistance_units);
-		fprintf(stderr,"dbg2       mbAcrossDistance_unit_code:		%s\n", storelocal->mbAcrossDistance_unit_code);
-		fprintf(stderr,"dbg2       mbAcrossDistance_add_offset:		%d\n", storelocal->mbAcrossDistance_add_offset);
-		fprintf(stderr,"dbg2       mbAcrossDistance_scale_factor:		%d\n", storelocal->mbAcrossDistance_scale_factor);
-		fprintf(stderr,"dbg2       mbAcrossDistance_minimum:		%d\n", storelocal->mbAcrossDistance_minimum);
-		fprintf(stderr,"dbg2       mbAcrossDistance_maximum:		%d\n", storelocal->mbAcrossDistance_maximum);
-		fprintf(stderr,"dbg2       mbAcrossDistance_valid_minimum:		%d\n", storelocal->mbAcrossDistance_valid_minimum);
-		fprintf(stderr,"dbg2       mbAcrossDistance_valid_maximum:		%d\n", storelocal->mbAcrossDistance_valid_maximum);
-		fprintf(stderr,"dbg2       mbAcrossDistance_missing_value:		%d\n", storelocal->mbAcrossDistance_missing_value);
-		fprintf(stderr,"dbg2       mbAcrossDistance_format_C:		%s\n", storelocal->mbAcrossDistance_format_C);
-		fprintf(stderr,"dbg2       mbAcrossDistance_orientation:		%s\n", storelocal->mbAcrossDistance_orientation);
-		fprintf(stderr,"dbg2       mbDepth_type:		%s\n", storelocal->mbDepth_type);
-		fprintf(stderr,"dbg2       mbDepth_long_name:		%s\n", storelocal->mbDepth_long_name);
-		fprintf(stderr,"dbg2       mbDepth_name_code:		%s\n", storelocal->mbDepth_name_code);
-		fprintf(stderr,"dbg2       mbDepth_units:		%s\n", storelocal->mbDepth_units);
-		fprintf(stderr,"dbg2       mbDepth_unit_code:		%s\n", storelocal->mbDepth_unit_code);
-		fprintf(stderr,"dbg2       mbDepth_add_offset:		%d\n", storelocal->mbDepth_add_offset);
-		fprintf(stderr,"dbg2       mbDepth_scale_factor:		%d\n", storelocal->mbDepth_scale_factor);
-		fprintf(stderr,"dbg2       mbDepth_minimum:		%d\n", storelocal->mbDepth_minimum);
-		fprintf(stderr,"dbg2       mbDepth_maximum:		%d\n", storelocal->mbDepth_maximum);
-		fprintf(stderr,"dbg2       mbDepth_valid_minimum:		%d\n", storelocal->mbDepth_valid_minimum);
-		fprintf(stderr,"dbg2       mbDepth_valid_maximum:		%d\n", storelocal->mbDepth_valid_maximum);
-		fprintf(stderr,"dbg2       mbDepth_missing_value:		%d\n", storelocal->mbDepth_missing_value);
-		fprintf(stderr,"dbg2       mbDepth_format_C:		%s\n", storelocal->mbDepth_format_C);
-		fprintf(stderr,"dbg2       mbDepth_orientation:		%s\n", storelocal->mbDepth_orientation);
-		fprintf(stderr,"dbg2       mbSQuality_type:		%s\n", storelocal->mbSQuality_type);
-		fprintf(stderr,"dbg2       mbSQuality_long_name:		%s\n", storelocal->mbSQuality_long_name);
-		fprintf(stderr,"dbg2       mbSQuality_name_code:		%s\n", storelocal->mbSQuality_name_code);
-		fprintf(stderr,"dbg2       mbSQuality_units:		%s\n", storelocal->mbSQuality_units);
-		fprintf(stderr,"dbg2       mbSQuality_unit_code:		%s\n", storelocal->mbSQuality_unit_code);
-		fprintf(stderr,"dbg2       mbSQuality_add_offset:		%d\n", storelocal->mbSQuality_add_offset);
-		fprintf(stderr,"dbg2       mbSQuality_scale_factor:		%d\n", storelocal->mbSQuality_scale_factor);
-		fprintf(stderr,"dbg2       mbSQuality_minimum:		%d\n", storelocal->mbSQuality_minimum);
-		fprintf(stderr,"dbg2       mbSQuality_maximum:		%d\n", storelocal->mbSQuality_maximum);
-		fprintf(stderr,"dbg2       mbSQuality_valid_minimum:		%d\n", storelocal->mbSQuality_valid_minimum);
-		fprintf(stderr,"dbg2       mbSQuality_valid_maximum:		%d\n", storelocal->mbSQuality_valid_maximum);
-		fprintf(stderr,"dbg2       mbSQuality_missing_value:		%d\n", storelocal->mbSQuality_missing_value);
-		fprintf(stderr,"dbg2       mbSQuality_format_C:		%s\n", storelocal->mbSQuality_format_C);
-		fprintf(stderr,"dbg2       mbSQuality_orientation:		%s\n", storelocal->mbSQuality_orientation);
-		fprintf(stderr,"dbg2       mbSFlag_type:		%s\n", storelocal->mbSFlag_type);
-		fprintf(stderr,"dbg2       mbSFlag_long_name:		%s\n", storelocal->mbSFlag_long_name);
-		fprintf(stderr,"dbg2       mbSFlag_name_code:		%s\n", storelocal->mbSFlag_name_code);
-		fprintf(stderr,"dbg2       mbSFlag_units:		%s\n", storelocal->mbSFlag_units);
-		fprintf(stderr,"dbg2       mbSFlag_unit_code:		%s\n", storelocal->mbSFlag_unit_code);
-		fprintf(stderr,"dbg2       mbSFlag_add_offset:		%d\n", storelocal->mbSFlag_add_offset);
-		fprintf(stderr,"dbg2       mbSFlag_scale_factor:		%d\n", storelocal->mbSFlag_scale_factor);
-		fprintf(stderr,"dbg2       mbSFlag_minimum:		%d\n", storelocal->mbSFlag_minimum);
-		fprintf(stderr,"dbg2       mbSFlag_maximum:		%d\n", storelocal->mbSFlag_maximum);
-		fprintf(stderr,"dbg2       mbSFlag_valid_minimum:		%d\n", storelocal->mbSFlag_valid_minimum);
-		fprintf(stderr,"dbg2       mbSFlag_valid_maximum:		%d\n", storelocal->mbSFlag_valid_maximum);
-		fprintf(stderr,"dbg2       mbSFlag_missing_value:		%d\n", storelocal->mbSFlag_missing_value);
-		fprintf(stderr,"dbg2       mbSFlag_format_C:		%s\n", storelocal->mbSFlag_format_C);
-		fprintf(stderr,"dbg2       mbSFlag_orientation:		%s\n", storelocal->mbSFlag_orientation);
-		fprintf(stderr,"dbg2       mbAntenna_type:		%s\n", storelocal->mbAntenna_type);
-		fprintf(stderr,"dbg2       mbAntenna_long_name:		%s\n", storelocal->mbAntenna_long_name);
-		fprintf(stderr,"dbg2       mbAntenna_name_code:		%s\n", storelocal->mbAntenna_name_code);
-		fprintf(stderr,"dbg2       mbAntenna_units:		%s\n", storelocal->mbAntenna_units);
-		fprintf(stderr,"dbg2       mbAntenna_unit_code:		%s\n", storelocal->mbAntenna_unit_code);
-		fprintf(stderr,"dbg2       mbAntenna_add_offset:		%d\n", storelocal->mbAntenna_add_offset);
-		fprintf(stderr,"dbg2       mbAntenna_scale_factor:		%d\n", storelocal->mbAntenna_scale_factor);
-		fprintf(stderr,"dbg2       mbAntenna_minimum:		%d\n", storelocal->mbAntenna_minimum);
-		fprintf(stderr,"dbg2       mbAntenna_maximum:		%d\n", storelocal->mbAntenna_maximum);
-		fprintf(stderr,"dbg2       mbAntenna_valid_minimum:		%d\n", storelocal->mbAntenna_valid_minimum);
-		fprintf(stderr,"dbg2       mbAntenna_valid_maximum:		%d\n", storelocal->mbAntenna_valid_maximum);
-		fprintf(stderr,"dbg2       mbAntenna_missing_value:		%d\n", storelocal->mbAntenna_missing_value);
-		fprintf(stderr,"dbg2       mbAntenna_format_C:		%s\n", storelocal->mbAntenna_format_C);
-		fprintf(stderr,"dbg2       mbAntenna_orientation:		%s\n", storelocal->mbAntenna_orientation);
-		fprintf(stderr,"dbg2       mbBeamBias_type:		%s\n", storelocal->mbBeamBias_type);
-		fprintf(stderr,"dbg2       mbBeamBias_long_name:		%s\n", storelocal->mbBeamBias_long_name);
-		fprintf(stderr,"dbg2       mbBeamBias_name_code:		%s\n", storelocal->mbBeamBias_name_code);
-		fprintf(stderr,"dbg2       mbBeamBias_units:		%s\n", storelocal->mbBeamBias_units);
-		fprintf(stderr,"dbg2       mbBeamBias_unit_code:		%s\n", storelocal->mbBeamBias_unit_code);
-		fprintf(stderr,"dbg2       mbBeamBias_add_offset:		%f\n", storelocal->mbBeamBias_add_offset);
-		fprintf(stderr,"dbg2       mbBeamBias_scale_factor:		%f\n", storelocal->mbBeamBias_scale_factor);
-		fprintf(stderr,"dbg2       mbBeamBias_minimum:		%d\n", storelocal->mbBeamBias_minimum);
-		fprintf(stderr,"dbg2       mbBeamBias_maximum:		%d\n", storelocal->mbBeamBias_maximum);
-		fprintf(stderr,"dbg2       mbBeamBias_valid_minimum:		%d\n", storelocal->mbBeamBias_valid_minimum);
-		fprintf(stderr,"dbg2       mbBeamBias_valid_maximum:		%d\n", storelocal->mbBeamBias_valid_maximum);
-		fprintf(stderr,"dbg2       mbBeamBias_missing_value:		%d\n", storelocal->mbBeamBias_missing_value);
-		fprintf(stderr,"dbg2       mbBeamBias_format_C:		%s\n", storelocal->mbBeamBias_format_C);
-		fprintf(stderr,"dbg2       mbBeamBias_orientation:		%s\n", storelocal->mbBeamBias_orientation);
-		fprintf(stderr,"dbg2       mbBFlag_type:		%s\n", storelocal->mbBFlag_type);
-		fprintf(stderr,"dbg2       mbBFlag_long_name:		%s\n", storelocal->mbBFlag_long_name);
-		fprintf(stderr,"dbg2       mbBFlag_name_code:		%s\n", storelocal->mbBFlag_name_code);
-		fprintf(stderr,"dbg2       mbBFlag_units:		%s\n", storelocal->mbBFlag_units);
-		fprintf(stderr,"dbg2       mbBFlag_unit_code:		%s\n", storelocal->mbBFlag_unit_code);
-		fprintf(stderr,"dbg2       mbBFlag_add_offset:		%d\n", storelocal->mbBFlag_add_offset);
-		fprintf(stderr,"dbg2       mbBFlag_scale_factor:		%d\n", storelocal->mbBFlag_scale_factor);
-		fprintf(stderr,"dbg2       mbBFlag_minimum:		%d\n", storelocal->mbBFlag_minimum);
-		fprintf(stderr,"dbg2       mbBFlag_maximum:		%d\n", storelocal->mbBFlag_maximum);
-		fprintf(stderr,"dbg2       mbBFlag_valid_minimum:		%d\n", storelocal->mbBFlag_valid_minimum);
-		fprintf(stderr,"dbg2       mbBFlag_valid_maximum:		%d\n", storelocal->mbBFlag_valid_maximum);
-		fprintf(stderr,"dbg2       mbBFlag_missing_value:		%d\n", storelocal->mbBFlag_missing_value);
-		fprintf(stderr,"dbg2       mbBFlag_format_C:		%s\n", storelocal->mbBFlag_format_C);
-		fprintf(stderr,"dbg2       mbBFlag_orientation:		%s\n", storelocal->mbBFlag_orientation);
-		fprintf(stderr,"dbg2       mbBeam_type:		%s\n", storelocal->mbBeam_type);
-		fprintf(stderr,"dbg2       mbBeam_long_name:		%s\n", storelocal->mbBeam_long_name);
-		fprintf(stderr,"dbg2       mbBeam_name_code:		%s\n", storelocal->mbBeam_name_code);
-		fprintf(stderr,"dbg2       mbBeam_units:		%s\n", storelocal->mbBeam_units);
-		fprintf(stderr,"dbg2       mbBeam_unit_code:		%s\n", storelocal->mbBeam_unit_code);
-		fprintf(stderr,"dbg2       mbBeam_add_offset:		%d\n", storelocal->mbBeam_add_offset);
-		fprintf(stderr,"dbg2       mbBeam_scale_factor:		%d\n", storelocal->mbBeam_scale_factor);
-		fprintf(stderr,"dbg2       mbBeam_minimum:		%d\n", storelocal->mbBeam_minimum);
-		fprintf(stderr,"dbg2       mbBeam_maximum:		%d\n", storelocal->mbBeam_maximum);
-		fprintf(stderr,"dbg2       mbBeam_valid_minimum:		%d\n", storelocal->mbBeam_valid_minimum);
-		fprintf(stderr,"dbg2       mbBeam_valid_maximum:		%d\n", storelocal->mbBeam_valid_maximum);
-		fprintf(stderr,"dbg2       mbBeam_missing_value:		%d\n", storelocal->mbBeam_missing_value);
-		fprintf(stderr,"dbg2       mbBeam_format_C:		%s\n", storelocal->mbBeam_format_C);
-		fprintf(stderr,"dbg2       mbBeam_orientation:		%s\n", storelocal->mbBeam_orientation);
-		fprintf(stderr,"dbg2       mbAFlag_type:		%s\n", storelocal->mbAFlag_type);
-		fprintf(stderr,"dbg2       mbAFlag_long_name:		%s\n", storelocal->mbAFlag_long_name);
-		fprintf(stderr,"dbg2       mbAFlag_name_code:		%s\n", storelocal->mbAFlag_name_code);
-		fprintf(stderr,"dbg2       mbAFlag_units:		%s\n", storelocal->mbAFlag_units);
-		fprintf(stderr,"dbg2       mbAFlag_unit_code:		%s\n", storelocal->mbAFlag_unit_code);
-		fprintf(stderr,"dbg2       mbAFlag_add_offset:		%d\n", storelocal->mbAFlag_add_offset);
-		fprintf(stderr,"dbg2       mbAFlag_scale_factor:		%d\n", storelocal->mbAFlag_scale_factor);
-		fprintf(stderr,"dbg2       mbAFlag_minimum:		%d\n", storelocal->mbAFlag_minimum);
-		fprintf(stderr,"dbg2       mbAFlag_maximum:		%d\n", storelocal->mbAFlag_maximum);
-		fprintf(stderr,"dbg2       mbAFlag_valid_minimum:		%d\n", storelocal->mbAFlag_valid_minimum);
-		fprintf(stderr,"dbg2       mbAFlag_valid_maximum:		%d\n", storelocal->mbAFlag_valid_maximum);
-		fprintf(stderr,"dbg2       mbAFlag_missing_value:		%d\n", storelocal->mbAFlag_missing_value);
-		fprintf(stderr,"dbg2       mbAFlag_format_C:		%s\n", storelocal->mbAFlag_format_C);
-		fprintf(stderr,"dbg2       mbAFlag_orientation:		%s\n", storelocal->mbAFlag_orientation);
-		fprintf(stderr,"dbg2       mbVelProfilRef_type:		%s\n", storelocal->mbVelProfilRef_type);
-		fprintf(stderr,"dbg2       mbVelProfilRef_long_name:		%s\n", storelocal->mbVelProfilRef_long_name);
-		fprintf(stderr,"dbg2       mbVelProfilRef_name_code:		%s\n", storelocal->mbVelProfilRef_name_code);
-		fprintf(stderr,"dbg2       mbVelProfilIdx_type:		%s\n", storelocal->mbVelProfilIdx_type);
-		fprintf(stderr,"dbg2       mbVelProfilIdx_long_name:		%s\n", storelocal->mbVelProfilIdx_long_name);
-		fprintf(stderr,"dbg2       mbVelProfilIdx_name_code:		%s\n", storelocal->mbVelProfilIdx_name_code);
-		fprintf(stderr,"dbg2       mbVelProfilIdx_units:		%s\n", storelocal->mbVelProfilIdx_units);
-		fprintf(stderr,"dbg2       mbVelProfilIdx_unit_code:		%s\n", storelocal->mbVelProfilIdx_unit_code);
-		fprintf(stderr,"dbg2       mbVelProfilIdx_add_offset:		%d\n", storelocal->mbVelProfilIdx_add_offset);
-		fprintf(stderr,"dbg2       mbVelProfilIdx_scale_factor:		%d\n", storelocal->mbVelProfilIdx_scale_factor);
-		fprintf(stderr,"dbg2       mbVelProfilIdx_minimum:		%d\n", storelocal->mbVelProfilIdx_minimum);
-		fprintf(stderr,"dbg2       mbVelProfilIdx_maximum:		%d\n", storelocal->mbVelProfilIdx_maximum);
-		fprintf(stderr,"dbg2       mbVelProfilIdx_valid_minimum:		%d\n", storelocal->mbVelProfilIdx_valid_minimum);
-		fprintf(stderr,"dbg2       mbVelProfilIdx_valid_maximum:		%d\n", storelocal->mbVelProfilIdx_valid_maximum);
-		fprintf(stderr,"dbg2       mbVelProfilIdx_missing_value:		%d\n", storelocal->mbVelProfilIdx_missing_value);
-		fprintf(stderr,"dbg2       mbVelProfilIdx_format_C:		%s\n", storelocal->mbVelProfilIdx_format_C);
-		fprintf(stderr,"dbg2       mbVelProfilIdx_orientation:		%s\n", storelocal->mbVelProfilIdx_orientation);
-		fprintf(stderr,"dbg2       mbVelProfilDate_type:		%s\n", storelocal->mbVelProfilDate_type);
-		fprintf(stderr,"dbg2       mbVelProfilDate_long_name:		%s\n", storelocal->mbVelProfilDate_long_name);
-		fprintf(stderr,"dbg2       mbVelProfilDate_name_code:		%s\n", storelocal->mbVelProfilDate_name_code);
-		fprintf(stderr,"dbg2       mbVelProfilDate_units:		%s\n", storelocal->mbVelProfilDate_units);
-		fprintf(stderr,"dbg2       mbVelProfilDate_unit_code:		%s\n", storelocal->mbVelProfilDate_unit_code);
-		fprintf(stderr,"dbg2       mbVelProfilDate_add_offset:		%d\n", storelocal->mbVelProfilDate_add_offset);
-		fprintf(stderr,"dbg2       mbVelProfilDate_scale_factor:		%d\n", storelocal->mbVelProfilDate_scale_factor);
-		fprintf(stderr,"dbg2       mbVelProfilDate_minimum:		%d\n", storelocal->mbVelProfilDate_minimum);
-		fprintf(stderr,"dbg2       mbVelProfilDate_maximum:		%d\n", storelocal->mbVelProfilDate_maximum);
-		fprintf(stderr,"dbg2       mbVelProfilDate_valid_minimum:		%d\n", storelocal->mbVelProfilDate_valid_minimum);
-		fprintf(stderr,"dbg2       mbVelProfilDate_valid_maximum:		%d\n", storelocal->mbVelProfilDate_valid_maximum);
-		fprintf(stderr,"dbg2       mbVelProfilDate_missing_value:		%d\n", storelocal->mbVelProfilDate_missing_value);
-		fprintf(stderr,"dbg2       mbVelProfilDate_format_C:		%s\n", storelocal->mbVelProfilDate_format_C);
-		fprintf(stderr,"dbg2       mbVelProfilDate_orientation:		%s\n", storelocal->mbVelProfilDate_orientation);
-		fprintf(stderr,"dbg2       mbVelProfilTime_type:		%s\n", storelocal->mbVelProfilTime_type);
-		fprintf(stderr,"dbg2       mbVelProfilTime_long_name:		%s\n", storelocal->mbVelProfilTime_long_name);
-		fprintf(stderr,"dbg2       mbVelProfilTime_name_code:		%s\n", storelocal->mbVelProfilTime_name_code);
-		fprintf(stderr,"dbg2       mbVelProfilTime_units:		%s\n", storelocal->mbVelProfilTime_units);
-		fprintf(stderr,"dbg2       mbVelProfilTime_unit_code:		%s\n", storelocal->mbVelProfilTime_unit_code);
-		fprintf(stderr,"dbg2       mbVelProfilTime_add_offset:		%d\n", storelocal->mbVelProfilTime_add_offset);
-		fprintf(stderr,"dbg2       mbVelProfilTime_scale_factor:		%d\n", storelocal->mbVelProfilTime_scale_factor);
-		fprintf(stderr,"dbg2       mbVelProfilTime_minimum:		%d\n", storelocal->mbVelProfilTime_minimum);
-		fprintf(stderr,"dbg2       mbVelProfilTime_maximum:		%d\n", storelocal->mbVelProfilTime_maximum);
-		fprintf(stderr,"dbg2       mbVelProfilTime_valid_minimum:		%d\n", storelocal->mbVelProfilTime_valid_minimum);
-		fprintf(stderr,"dbg2       mbVelProfilTime_valid_maximum:		%d\n", storelocal->mbVelProfilTime_valid_maximum);
-		fprintf(stderr,"dbg2       mbVelProfilTime_missing_value:		%d\n", storelocal->mbVelProfilTime_missing_value);
-		fprintf(stderr,"dbg2       mbVelProfilTime_format_C:		%s\n", storelocal->mbVelProfilTime_format_C);
-		fprintf(stderr,"dbg2       mbVelProfilTime_orientation:		%s\n", storelocal->mbVelProfilTime_orientation);
-		}
-
-	    /* end define mode */
-	    nc_status = nc_enddef(mb_io_ptr->ncid);
-
-	    /* save the comments */
-
-	    /* save the beam arrays */
-
-	    /* save the soundvel arrays */
-
-	    /* write global variables */
-	    if (status == MB_SUCCESS)
-		{
-		index[0] = 0;
-		count[0] = storelocal->mbHistoryRecNbr;
-		nc_status = nc_put_vara_int(mb_io_ptr->ncid, storelocal->mbHistDate_id, index, count, store->mbHistDate);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_vara mbHistDate error: %s\n", nc_strerror(nc_status));
-
-		index[0] = 0;
-		count[0] = storelocal->mbHistoryRecNbr;
-		nc_status = nc_put_vara_int(mb_io_ptr->ncid, storelocal->mbHistTime_id, index, count, store->mbHistTime);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_vara mbHistTime error: %s\n", nc_strerror(nc_status));
-
-		index[0] = 0;
-		count[0] = storelocal->mbHistoryRecNbr;
-		nc_status = nc_put_vara_text(mb_io_ptr->ncid, storelocal->mbHistCode_id, index, count, store->mbHistCode);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_vara mbHistCode error: %s\n", nc_strerror(nc_status));
-
-		index[0] = 0;
-		index[1] = 0;
-		count[0] = storelocal->mbHistoryRecNbr;
-		count[1] = storelocal->mbNameLength;
-		nc_status = nc_put_vara_text(mb_io_ptr->ncid, storelocal->mbHistAutor_id, index, count, store->mbHistAutor);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_vara mbHistAutor error: %s\n", nc_strerror(nc_status));
-
-		index[0] = 0;
-		index[1] = 0;
-		count[0] = storelocal->mbHistoryRecNbr;
-		count[1] = storelocal->mbNameLength;
-		nc_status = nc_put_vara_text(mb_io_ptr->ncid, storelocal->mbHistModule_id, index, count, store->mbHistModule);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_vara mbHistModule error: %s\n", nc_strerror(nc_status));
-
-		index[0] = 0;
-		index[1] = 0;
-		count[0] = storelocal->mbHistoryRecNbr;
-		count[1] = storelocal->mbCommentLength;
-		nc_status = nc_put_vara_text(mb_io_ptr->ncid, storelocal->mbHistComment_id, index, count, store->mbHistComment);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_vara mbHistComment error: %s\n", nc_strerror(nc_status));
-
-		index[0] = 0;
-		count[0] = storelocal->mbBeamNbr;
-		nc_status = nc_put_vara_text(mb_io_ptr->ncid, storelocal->mbAntenna_id, index, count, store->mbAntenna);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR)
-		fprintf(stderr, "nc_put_vara mbAntenna error: %s\n", nc_strerror(nc_status));
-
-	    	if (extended != MB_YES)
-	    	    {
-	    	    index[0] = 0;
-	    	    count[0] = storelocal->mbBeamNbr;
-	    	    nc_status = nc_put_vara_short(mb_io_ptr->ncid, storelocal->mbBeamBias_id, index, count, store->mbBeamBias);
-	    	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_vara mbBeamBias error: %s\n", nc_strerror(nc_status));
-	    	    }
-
-		index[0] = 0;
-		count[0] = storelocal->mbBeamNbr;
-		nc_status = nc_put_vara_text(mb_io_ptr->ncid, storelocal->mbBFlag_id, index, count, store->mbBFlag);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_vara mbBFlag error: %s\n", nc_strerror(nc_status));
-
-		index[0] = 0;
-		count[0] = storelocal->mbAntennaNbr;
-		nc_status = nc_put_vara_short(mb_io_ptr->ncid, storelocal->mbBeam_id, index, count, store->mbBeam);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_vara mbBeam error: %s\n", nc_strerror(nc_status));
-
-		index[0] = 0;
-		count[0] = storelocal->mbAntennaNbr;
-		nc_status = nc_put_vara_text(mb_io_ptr->ncid, storelocal->mbAFlag_id, index, count, store->mbAFlag);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_vara mbAFlag error: %s\n", nc_strerror(nc_status));
-
-		index[0] = 0;
-		index[1] = 0;
-		count[0] = storelocal->mbVelocityProfilNbr;
-		count[1] = storelocal->mbCommentLength;
-		nc_status = nc_put_vara_text(mb_io_ptr->ncid, storelocal->mbVelProfilRef_id, index, count, store->mbVelProfilRef);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_vara mbVelProfilRef error: %s\n", nc_strerror(nc_status));
-
-		index[0] = 0;
-		count[0] = storelocal->mbVelocityProfilNbr;
-		nc_status = nc_put_vara_short(mb_io_ptr->ncid, storelocal->mbVelProfilIdx_id, index, count, store->mbVelProfilIdx);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_vara mbVelProfilIdx error: %s\n", nc_strerror(nc_status));
-
-		index[0] = 0;
-		count[0] = storelocal->mbVelocityProfilNbr;
-		nc_status = nc_put_vara_int(mb_io_ptr->ncid, storelocal->mbVelProfilDate_id, index, count, store->mbVelProfilDate);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_vara mbVelProfilDate error: %s\n", nc_strerror(nc_status));
-
-		index[0] = 0;
-		count[0] = storelocal->mbVelocityProfilNbr;
-		nc_status = nc_put_vara_int(mb_io_ptr->ncid, storelocal->mbVelProfilTime_id, index, count, store->mbVelProfilTime);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_vara mbVelProfilTime error: %s\n", nc_strerror(nc_status));
-		if (nc_status != NC_NOERR)
-		    {
-		    status = MB_FAILURE;
-		    *error = MB_ERROR_EOF;
-		    }
-		}
-	    }
-
-	/* now write the data */
-	if (store->kind == MB_DATA_DATA
-	    && status == MB_SUCCESS)
-	    {
-	    /* write the variables from next record */
-	    if (storelocal->CIB_BLOCK_DIM > 0)
-	    	{
-	    	index[0] = (*recwrite / storelocal->CIB_BLOCK_DIM);
-	    	index[1] = *recwrite - storelocal->CIB_BLOCK_DIM * index[0];
-	    	index[2] = 0;
-	    	count[0] = 1;
-	    	count[1] = 1;
-	    	count[2] = storelocal->mbAntennaNbr;
-		}
-	    else
-		{
-	    	index[0] = *recwrite;
-	    	index[1] = 0;
-	    	index[2] = 0;
-	    	count[0] = 1;
-	    	count[1] = storelocal->mbAntennaNbr;
-	    	count[2] = 0;
-		}
-/* fprintf(stderr,"storelocal->CIB_BLOCK_DIM:%d index: %d %d %d count: %d %d %d\n",
-storelocal->CIB_BLOCK_DIM,index[0],index[1],index[2],count[0],count[1],count[2]); */
-	    nc_status = nc_put_vara_int(mb_io_ptr->ncid, storelocal->mbCycle_id, index, count, store->mbCycle);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_vara mbCycle error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_vara_int(mb_io_ptr->ncid, storelocal->mbDate_id, index, count, store->mbDate);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_vara mbDate error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_vara_int(mb_io_ptr->ncid, storelocal->mbTime_id, index, count, store->mbTime);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_vara mbTime error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_vara_int(mb_io_ptr->ncid, storelocal->mbOrdinate_id, index, count, store->mbOrdinate);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_vara mbOrdinate error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_vara_int(mb_io_ptr->ncid, storelocal->mbAbscissa_id, index, count, store->mbAbscissa);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_vara mbAbscissa error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_vara_text(mb_io_ptr->ncid, storelocal->mbFrequency_id, index, count, store->mbFrequency);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_vara mbFrequency error: %s\n", nc_strerror(nc_status));
-	    if (extended == MB_YES)
-		{
-	    	nc_status = nc_put_vara_int(mb_io_ptr->ncid, storelocal->mbSonarFrequency_id, index, count, store->mbSonarFrequency);
-	    	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_vara mbSonarFrequency error: %s\n", nc_strerror(nc_status));
-		}
-	    nc_status = nc_put_vara_text(mb_io_ptr->ncid, storelocal->mbSounderMode_id, index, count, store->mbSounderMode);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_vara mbSounderMode error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_vara_int(mb_io_ptr->ncid, storelocal->mbReferenceDepth_id, index, count, store->mbReferenceDepth);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_vara mbReferenceDepth error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_vara_short(mb_io_ptr->ncid, storelocal->mbDynamicDraught_id, index, count, store->mbDynamicDraught);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_vara mbDynamicDraught error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_vara_short(mb_io_ptr->ncid, storelocal->mbTide_id, index, count, store->mbTide);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_vara mbTide error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_vara_short(mb_io_ptr->ncid, storelocal->mbSoundVelocity_id, index, count, store->mbSoundVelocity);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_vara mbSoundVelocity error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_vara_short(mb_io_ptr->ncid, storelocal->mbHeading_id, index, count, (short *)store->mbHeading);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_vara mbHeading error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_vara_short(mb_io_ptr->ncid, storelocal->mbRoll_id, index, count, store->mbRoll);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_vara mbRoll error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_vara_short(mb_io_ptr->ncid, storelocal->mbPitch_id, index, count, store->mbPitch);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_vara mbPitch error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_vara_short(mb_io_ptr->ncid, storelocal->mbTransmissionHeave_id, index, count, store->mbTransmissionHeave);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_vara mbTransmissionHeave error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_vara_text(mb_io_ptr->ncid, storelocal->mbDistanceScale_id, index, count, store->mbDistanceScale);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_vara mbDistanceScale error: %s\n", nc_strerror(nc_status));
-	    if (extended == MB_YES)
-		{
-	    	nc_status = nc_put_vara_short(mb_io_ptr->ncid, storelocal->mbRangeScale_id, index, count, store->mbRangeScale);
-	    	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_vara mbRangeScale error: %s\n", nc_strerror(nc_status));
-		}
-	    nc_status = nc_put_vara_text(mb_io_ptr->ncid, storelocal->mbDepthScale_id, index, count, store->mbDepthScale);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_vara mbDepthScale error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_vara_int(mb_io_ptr->ncid, storelocal->mbVerticalDepth_id, index, count, store->mbVerticalDepth);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_vara mbVerticalDepth error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_vara_text(mb_io_ptr->ncid, storelocal->mbCQuality_id, index, count, store->mbCQuality);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_vara mbCQuality error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_vara_text(mb_io_ptr->ncid, storelocal->mbCFlag_id, index, count, store->mbCFlag);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_vara mbCFlag error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_vara_text(mb_io_ptr->ncid, storelocal->mbInterlacing_id, index, count, store->mbInterlacing);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_vara mbInterlacing error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_vara_short(mb_io_ptr->ncid, storelocal->mbSamplingRate_id, index, count, store->mbSamplingRate);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_vara mbSamplingRate error: %s\n", nc_strerror(nc_status));
-	    if (extended == MB_YES)
-		{
-	    	nc_status = nc_put_vara_text(mb_io_ptr->ncid, storelocal->mbCompensationLayerMode_id, index, count, store->mbCompensationLayerMode);
-	    	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_vara mbCompensationLayerMode error: %s\n", nc_strerror(nc_status));
-	    	nc_status = nc_put_vara_short(mb_io_ptr->ncid, storelocal->mbTransmitBeamwidth_id, index, count, store->mbTransmitBeamwidth);
-	    	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_vara mbTransmitBeamwidth error: %s\n", nc_strerror(nc_status));
-	    	nc_status = nc_put_vara_text(mb_io_ptr->ncid, storelocal->mbReceiveBeamwidth_id, index, count, store->mbReceiveBeamwidth);
-	    	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_vara mbReceiveBeamwidth error: %s\n", nc_strerror(nc_status));
-	    	nc_status = nc_put_vara_short(mb_io_ptr->ncid, storelocal->mbTransmitPulseLength_id, index, count, store->mbTransmitPulseLength);
-	    	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_vara mbTransmitPulseLength error: %s\n", nc_strerror(nc_status));
-		}
-	    if (storelocal->CIB_BLOCK_DIM > 0)
-	    	{
-	    	index[0] = (*recwrite / storelocal->CIB_BLOCK_DIM);
-	    	index[1] = *recwrite - storelocal->CIB_BLOCK_DIM * index[0];
-	    	index[2] = 0;
-	    	count[0] = 1;
-	    	count[1] = 1;
-	    	count[2] = storelocal->mbBeamNbr;
-		}
-	    else
-		{
-	    	index[0] = *recwrite;
-	    	index[1] = 0;
-	    	index[2] = 0;
-	    	count[0] = 1;
-	    	count[1] = storelocal->mbBeamNbr;
-	    	count[2] = 0;
-		}
-	    nc_status = nc_put_vara_short(mb_io_ptr->ncid, storelocal->mbAlongDistance_id, index, count, store->mbAlongDistance);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_vara mbAlongDistance error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_vara_short(mb_io_ptr->ncid, storelocal->mbAcrossDistance_id, index, count, store->mbAcrossDistance);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_vara mbAcrossDistance error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_vara_int(mb_io_ptr->ncid, storelocal->mbDepth_id, index, count, store->mbDepth);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_vara mbDepth error: %s\n", nc_strerror(nc_status));
-	    if (extended == MB_YES)
-		{
-	    	nc_status = nc_put_vara_short(mb_io_ptr->ncid, storelocal->mbAcrossBeamAngle_id, index, count, store->mbAcrossBeamAngle);
-	    	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_vara mbAcrossBeamAngle error: %s\n", nc_strerror(nc_status));
-	    	nc_status = nc_put_vara_short(mb_io_ptr->ncid, storelocal->mbAzimutBeamAngle_id, index, count, store->mbAzimutBeamAngle);
-	    	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_vara mbAzimutBeamAngle error: %s\n", nc_strerror(nc_status));
-	    	nc_status = nc_put_vara_short(mb_io_ptr->ncid, storelocal->mbRange_id, index, count, store->mbRange);
-	    	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_vara mbRange error: %s\n", nc_strerror(nc_status));
-	    	nc_status = nc_put_vara_short(mb_io_ptr->ncid, storelocal->mbSoundingBias_id, index, count, store->mbSoundingBias);
-	    	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_vara mbSoundingBias error: %s\n", nc_strerror(nc_status));
-		}
-	    nc_status = nc_put_vara_text(mb_io_ptr->ncid, storelocal->mbSQuality_id, index, count, store->mbSQuality);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_vara mbSQuality error: %s\n", nc_strerror(nc_status));
-	    if (extended == MB_YES)
-		{
-	    	nc_status = nc_put_vara_text(mb_io_ptr->ncid, storelocal->mbReflectivity_id, index, count, store->mbReflectivity);
-	    	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_vara mbReflectivity error: %s\n", nc_strerror(nc_status));
-	    	nc_status = nc_put_vara_text(mb_io_ptr->ncid, storelocal->mbReceptionHeave_id, index, count, store->mbReceptionHeave);
-	    	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_vara mbReceptionHeave error: %s\n", nc_strerror(nc_status));
-	    	nc_status = nc_put_vara_short(mb_io_ptr->ncid, storelocal->mbAlongSlope_id, index, count, store->mbAlongSlope);
-	    	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_vara mbAlongSlope error: %s\n", nc_strerror(nc_status));
-	    	nc_status = nc_put_vara_short(mb_io_ptr->ncid, storelocal->mbAcrossSlope_id, index, count, store->mbAcrossSlope);
-	    	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_vara mbAcrossSlope error: %s\n", nc_strerror(nc_status));
-		}
-	    nc_status = nc_put_vara_text(mb_io_ptr->ncid, storelocal->mbSFlag_id, index, count, store->mbSFlag);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_vara mbSQuality error: %s\n", nc_strerror(nc_status));
-	    if (extended == MB_YES)
-		{
-	    	nc_status = nc_put_vara_text(mb_io_ptr->ncid, storelocal->mbSLengthOfDetection_id, index, count, store->mbSLengthOfDetection);
-	    	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_vara mbSLengthOfDetection error: %s\n", nc_strerror(nc_status));
-		}
-
-	    /* check status */
-	    if (nc_status != NC_NOERR)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	    /* print input debug statements */
-	    if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  NetCDF Survey Record written in function <%s>\n",function_name);
-		fprintf(stderr,"dbg2  Global Variables:\n");
-		fprintf(stderr,"dbg2       status:                  %d\n", status);
-		fprintf(stderr,"dbg2       error:                   %d\n", *error);
-		fprintf(stderr,"dbg2       nc_status:               %d\n", nc_status);
-		fprintf(stderr,"dbg2       mbCycle:                 ");
-		for (i=0;i<store->mbAntennaNbr;i++)
-			fprintf(stderr, "%d ", store->mbCycle[i]);
-		fprintf(stderr, "\n");
-		fprintf(stderr,"dbg2       mbDate:                  ");
-		for (i=0;i<store->mbAntennaNbr;i++)
-			fprintf(stderr, "%d ", store->mbDate[i]);
-		fprintf(stderr, "\n");
-		fprintf(stderr,"dbg2       mbTime:                  ");
-		for (i=0;i<store->mbAntennaNbr;i++)
-			fprintf(stderr, "%d ", store->mbTime[i]);
-		fprintf(stderr, "\n");
-		fprintf(stderr,"dbg2       mbOrdinate:              ");
-		for (i=0;i<store->mbAntennaNbr;i++)
-			fprintf(stderr, "%d ", store->mbOrdinate[i]);
-		fprintf(stderr, "\n");
-		fprintf(stderr,"dbg2       mbAbscissa:              ");
-		for (i=0;i<store->mbAntennaNbr;i++)
-			fprintf(stderr, "%d ", store->mbAbscissa[i]);
-		fprintf(stderr, "\n");
-		fprintf(stderr,"dbg2       mbFrequency:             ");
-		for (i=0;i<store->mbAntennaNbr;i++)
-			fprintf(stderr, "%d ", store->mbFrequency[i]);
-		fprintf(stderr, "\n");
-		fprintf(stderr,"dbg2       mbSounderMode:           ");
-		for (i=0;i<store->mbAntennaNbr;i++)
-			fprintf(stderr, "%d ", store->mbSounderMode[i]);
-		fprintf(stderr, "\n");
-		fprintf(stderr,"dbg2       mbReferenceDepth:        ");
-		for (i=0;i<store->mbAntennaNbr;i++)
-			fprintf(stderr, "%d ", store->mbReferenceDepth[i]);
-		fprintf(stderr, "\n");
-		fprintf(stderr,"dbg2       mbDynamicDraught:        ");
-		for (i=0;i<store->mbAntennaNbr;i++)
-			fprintf(stderr, "%d ", store->mbDynamicDraught[i]);
-		fprintf(stderr, "\n");
-		fprintf(stderr,"dbg2       mbTide:                  ");
-		for (i=0;i<store->mbAntennaNbr;i++)
-			fprintf(stderr, "%d ", store->mbTide[i]);
-		fprintf(stderr, "\n");
-		fprintf(stderr,"dbg2       mbSoundVelocity:         ");
-		for (i=0;i<store->mbAntennaNbr;i++)
-			fprintf(stderr, "%d ", store->mbSoundVelocity[i]);
-		fprintf(stderr, "\n");
-		fprintf(stderr,"dbg2       mbHeading:               ");
-		for (i=0;i<store->mbAntennaNbr;i++)
-			fprintf(stderr, "%d ", store->mbHeading[i]);
-		fprintf(stderr, "\n");
-		fprintf(stderr,"dbg2       mbRoll:                  ");
-		for (i=0;i<store->mbAntennaNbr;i++)
-			fprintf(stderr, "%d ", store->mbRoll[i]);
-		fprintf(stderr, "\n");
-		fprintf(stderr,"dbg2       mbPitch:                 ");
-		for (i=0;i<store->mbAntennaNbr;i++)
-			fprintf(stderr, "%d ", store->mbPitch[i]);
-		fprintf(stderr, "\n");
-		fprintf(stderr,"dbg2       mbTransmissionHeave:     ");
-		for (i=0;i<store->mbAntennaNbr;i++)
-			fprintf(stderr, "%d ", store->mbTransmissionHeave[i]);
-		fprintf(stderr, "\n");
-		fprintf(stderr,"dbg2       mbDistanceScale:         ");
-		for (i=0;i<store->mbAntennaNbr;i++)
-			fprintf(stderr, "%d ", store->mbDistanceScale[i]);
-		fprintf(stderr, "\n");
-		fprintf(stderr,"dbg2       mbDepthScale:            ");
-		for (i=0;i<store->mbAntennaNbr;i++)
-			fprintf(stderr, "%d ", store->mbDepthScale[i]);
-		fprintf(stderr, "\n");
-		fprintf(stderr,"dbg2       mbVerticalDepth:         ");
-		for (i=0;i<store->mbAntennaNbr;i++)
-			fprintf(stderr, "%d ", store->mbVerticalDepth[i]);
-		fprintf(stderr, "\n");
-		fprintf(stderr,"dbg2       mbCQuality:              ");
-		for (i=0;i<store->mbAntennaNbr;i++)
-			fprintf(stderr, "%d ", store->mbCQuality[i]);
-		fprintf(stderr, "\n");
-		fprintf(stderr,"dbg2       mbCFlag:                 ");
-		for (i=0;i<store->mbAntennaNbr;i++)
-			fprintf(stderr, "%d ", store->mbCFlag[i]);
-		fprintf(stderr, "\n");
-		fprintf(stderr,"dbg2       mbInterlacing:           ");
-		for (i=0;i<store->mbAntennaNbr;i++)
-			fprintf(stderr, "%d ", store->mbInterlacing[i]);
-		fprintf(stderr, "\n");
-		fprintf(stderr,"dbg2       mbSamplingRate:          ");
-		for (i=0;i<store->mbAntennaNbr;i++)
-			fprintf(stderr, "%d ", store->mbSamplingRate[i]);
-		fprintf(stderr, "\n");
-		fprintf(stderr,"dbg2       mbBeamNbr:               %zu\n", store->mbBeamNbr);
-		fprintf(stderr,"dbg2       beam ltrack xtrack depth quality flag\n");
-		for (i=0;i<store->mbBeamNbr;i++)
-		    {
-		    fprintf(stderr,"dbg2       %3d %8d %8d %8d %d %d\n",
-				    i, store->mbAlongDistance[i],
-				    store->mbAcrossDistance[i], store->mbDepth[i],
-				    store->mbSQuality[i], store->mbSFlag[i]);
-		    }
-		}
-
-	    /* set counters */
-	    (*recwrite)++;
-	    (*datawrite)++;
-
-	    }
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mbr_mbpronav.c b/src/mbio/mbr_mbpronav.c
deleted file mode 100644
index 9b75eb7..0000000
--- a/src/mbio/mbr_mbpronav.c
+++ /dev/null
@@ -1,911 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbr_mbpronav.c	5/20/99
- *	$Id: mbr_mbpronav.c 2239 2015-05-07 00:51:42Z caress $
- *
- *    Copyright (c) 1999-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbr_mbpronav.c contains the functions for reading and writing
- * navigation data in the MBPRONAV format.
- * These functions include:
- *   mbr_alm_mbpronav	- allocate read/write memory
- *   mbr_dem_mbpronav	- deallocate read/write memory
- *   mbr_rt_mbpronav	- read and translate data
- *   mbr_wt_mbpronav	- translate and write data
- *
- * Author:	D. W. Caress
- * Date:	October 18, 1999
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mb_define.h"
-#include "mbsys_singlebeam.h"
-#include "mbf_mbpronav.h"
-
-/* essential function prototypes */
-int mbr_register_mbpronav(int verbose, void *mbio_ptr,
-		int *error);
-int mbr_info_mbpronav(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_alm_mbpronav(int verbose, void *mbio_ptr, int *error);
-int mbr_dem_mbpronav(int verbose, void *mbio_ptr, int *error);
-int mbr_zero_mbpronav(int verbose, char *data_ptr, int *error);
-int mbr_rt_mbpronav(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_wt_mbpronav(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_mbpronav_rd_data(int verbose, void *mbio_ptr, int *error);
-int mbr_mbpronav_wr_data(int verbose, void *mbio_ptr, void *data_ptr, int *error);
-
-static char rcs_id[]="$Id: mbr_mbpronav.c 2239 2015-05-07 00:51:42Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mbr_register_mbpronav(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_register_mbpronav";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* get mb_io_ptr */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set format info parameters */
-	status = mbr_info_mbpronav(verbose,
-			&mb_io_ptr->system,
-			&mb_io_ptr->beams_bath_max,
-			&mb_io_ptr->beams_amp_max,
-			&mb_io_ptr->pixels_ss_max,
-			mb_io_ptr->format_name,
-			mb_io_ptr->system_name,
-			mb_io_ptr->format_description,
-			&mb_io_ptr->numfile,
-			&mb_io_ptr->filetype,
-			&mb_io_ptr->variable_beams,
-			&mb_io_ptr->traveltime,
-			&mb_io_ptr->beam_flagging,
-			&mb_io_ptr->nav_source,
-			&mb_io_ptr->heading_source,
-			&mb_io_ptr->vru_source,
-			&mb_io_ptr->svp_source,
-			&mb_io_ptr->beamwidth_xtrack,
-			&mb_io_ptr->beamwidth_ltrack,
-			error);
-
-	/* set format and system specific function pointers */
-	mb_io_ptr->mb_io_format_alloc = &mbr_alm_mbpronav;
-	mb_io_ptr->mb_io_format_free = &mbr_dem_mbpronav;
-	mb_io_ptr->mb_io_store_alloc = &mbsys_singlebeam_alloc;
-	mb_io_ptr->mb_io_store_free = &mbsys_singlebeam_deall;
-	mb_io_ptr->mb_io_read_ping = &mbr_rt_mbpronav;
-	mb_io_ptr->mb_io_write_ping = &mbr_wt_mbpronav;
-	mb_io_ptr->mb_io_dimensions = &mbsys_singlebeam_dimensions;
-	mb_io_ptr->mb_io_extract = &mbsys_singlebeam_extract;
-	mb_io_ptr->mb_io_insert = &mbsys_singlebeam_insert;
-	mb_io_ptr->mb_io_extract_nav = &mbsys_singlebeam_extract_nav;
-	mb_io_ptr->mb_io_insert_nav = &mbsys_singlebeam_insert_nav;
-	mb_io_ptr->mb_io_extract_altitude = &mbsys_singlebeam_extract_altitude;
-	mb_io_ptr->mb_io_insert_altitude = NULL;
-	mb_io_ptr->mb_io_extract_svp = NULL;
-	mb_io_ptr->mb_io_insert_svp = NULL;
-	mb_io_ptr->mb_io_ttimes = &mbsys_singlebeam_ttimes;
-	mb_io_ptr->mb_io_detects = &mbsys_singlebeam_detects;
-	mb_io_ptr->mb_io_copyrecord = &mbsys_singlebeam_copy;
-	mb_io_ptr->mb_io_extract_rawss = NULL;
-	mb_io_ptr->mb_io_insert_rawss = NULL;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",mb_io_ptr->system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",mb_io_ptr->beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",mb_io_ptr->beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",mb_io_ptr->pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",mb_io_ptr->format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",mb_io_ptr->system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",mb_io_ptr->format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",mb_io_ptr->numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",mb_io_ptr->filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",mb_io_ptr->variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",mb_io_ptr->traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",mb_io_ptr->beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",mb_io_ptr->nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",mb_io_ptr->heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",mb_io_ptr->vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",mb_io_ptr->svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",mb_io_ptr->beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",mb_io_ptr->beamwidth_ltrack);
-		fprintf(stderr,"dbg2       format_alloc:       %p\n",(void *)mb_io_ptr->mb_io_format_alloc);
-		fprintf(stderr,"dbg2       format_free:        %p\n",(void *)mb_io_ptr->mb_io_format_free);
-		fprintf(stderr,"dbg2       store_alloc:        %p\n",(void *)mb_io_ptr->mb_io_store_alloc);
-		fprintf(stderr,"dbg2       store_free:         %p\n",(void *)mb_io_ptr->mb_io_store_free);
-		fprintf(stderr,"dbg2       read_ping:          %p\n",(void *)mb_io_ptr->mb_io_read_ping);
-		fprintf(stderr,"dbg2       write_ping:         %p\n",(void *)mb_io_ptr->mb_io_write_ping);
-		fprintf(stderr,"dbg2       extract:            %p\n",(void *)mb_io_ptr->mb_io_extract);
-		fprintf(stderr,"dbg2       insert:             %p\n",(void *)mb_io_ptr->mb_io_insert);
-		fprintf(stderr,"dbg2       extract_nav:        %p\n",(void *)mb_io_ptr->mb_io_extract_nav);
-		fprintf(stderr,"dbg2       insert_nav:         %p\n",(void *)mb_io_ptr->mb_io_insert_nav);
-		fprintf(stderr,"dbg2       extract_altitude:   %p\n",(void *)mb_io_ptr->mb_io_extract_altitude);
-		fprintf(stderr,"dbg2       insert_altitude:    %p\n",(void *)mb_io_ptr->mb_io_insert_altitude);
-		fprintf(stderr,"dbg2       extract_svp:        %p\n",(void *)mb_io_ptr->mb_io_extract_svp);
-		fprintf(stderr,"dbg2       insert_svp:         %p\n",(void *)mb_io_ptr->mb_io_insert_svp);
-		fprintf(stderr,"dbg2       ttimes:             %p\n",(void *)mb_io_ptr->mb_io_ttimes);
-		fprintf(stderr,"dbg2       detects:            %p\n",(void *)mb_io_ptr->mb_io_detects);
-		fprintf(stderr,"dbg2       extract_rawss:      %p\n",(void *)mb_io_ptr->mb_io_extract_rawss);
-		fprintf(stderr,"dbg2       insert_rawss:       %p\n",(void *)mb_io_ptr->mb_io_insert_rawss);
-		fprintf(stderr,"dbg2       copyrecord:         %p\n",(void *)mb_io_ptr->mb_io_copyrecord);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbr_info_mbpronav(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error)
-{
-	char	*function_name = "mbr_info_mbpronav";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* set format info parameters */
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-	*system = MB_SYS_SINGLEBEAM;
-	*beams_bath_max = 1;
-	*beams_amp_max = 0;
-	*pixels_ss_max = 0;
-	strncpy(format_name, "MBPRONAV", MB_NAME_LENGTH);
-	strncpy(system_name, "SINGLEBEAM", MB_NAME_LENGTH);
-	strncpy(format_description, "Format name:          MBF_MBPRONAV\nInformal Description: MB-System simple navigation format\nAttributes:           navigation, MBARI\n", MB_DESCRIPTION_LENGTH);
-	*numfile = 1;
-	*filetype = MB_FILETYPE_NORMAL;
-	*variable_beams = MB_NO;
-	*traveltime = MB_YES;
-	*beam_flagging = MB_NO;
-	*nav_source = MB_DATA_DATA;
-	*heading_source = MB_DATA_DATA;
-	*vru_source = MB_DATA_DATA;
-	*svp_source = MB_DATA_NONE;
-	*beamwidth_xtrack = 0.0;
-	*beamwidth_ltrack = 0.0;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",*system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",*beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",*beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",*pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",*numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",*filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",*variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",*traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",*beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",*nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",*heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",*vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",*svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",*beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",*beamwidth_ltrack);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_alm_mbpronav(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_alm_mbpronav";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_mbpronav_struct *data;
-	char	*data_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set initial status */
-	status = MB_SUCCESS;
-
-	/* allocate memory for data structure */
-	mb_io_ptr->structure_size = sizeof(struct mbf_mbpronav_struct);
-	mb_io_ptr->data_structure_size = 0;
-	status = mb_malloc(verbose,mb_io_ptr->structure_size,
-				&mb_io_ptr->raw_data,error);
-	status = mb_malloc(verbose,sizeof(struct mbsys_singlebeam_struct),
-				&mb_io_ptr->store_data,error);
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-	data = (struct mbf_mbpronav_struct *) mb_io_ptr->raw_data;
-	data_ptr = (char *) data;
-
-	/* set number of header records read to zero */
-	mb_io_ptr->save1 = 0;
-
-	/* initialize everything to zeros */
-	mbr_zero_mbpronav(verbose,data_ptr,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_dem_mbpronav(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_dem_mbpronav";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* deallocate memory for data descriptor */
-	status = mb_free(verbose,&mb_io_ptr->raw_data,error);
-	status = mb_free(verbose,&mb_io_ptr->store_data,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_zero_mbpronav(int verbose, char *data_ptr, int *error)
-{
-	char	*function_name = "mbr_zero_mbpronav";
-	int	status = MB_SUCCESS;
-	struct mbf_mbpronav_struct *data;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       data_ptr:   %p\n",(void *)data_ptr);
-		}
-
-	/* get pointer to data descriptor */
-	data = (struct mbf_mbpronav_struct *) data_ptr;
-
-	/* initialize everything to zeros */
-	if (data != NULL)
-		{
-		data->kind = MB_DATA_NONE;
-		data->time_d = 0.0;
-		for (i=0;i<7;i++)
-		    data->time_i[i] = 0;
-		data->longitude = 0.0;
-		data->latitude = 0.0;
-		data->heading = 0.0;
-		data->speed = 0.0;
-		data->sonardepth = 0.0;
-		data->roll = 0.0;
-		data->pitch = 0.0;
-		data->heave = 0.0;
-		for (i=0;i<MBF_MBPRONAV_MAXLINE;i++)
-		    data->comment[i] = 0;
-		}
-
-	/* assume success */
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_rt_mbpronav(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_rt_mbpronav";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_mbpronav_struct *data;
-	struct mbsys_singlebeam_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointers to mbio descriptor and data structures */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-	data = (struct mbf_mbpronav_struct *) mb_io_ptr->raw_data;
-	store = (struct mbsys_singlebeam_struct *) store_ptr;
-
-	/* read next data from file */
-	status = mbr_mbpronav_rd_data(verbose,mbio_ptr,error);
-
-	/* set error and kind in mb_io_ptr */
-	mb_io_ptr->new_error = *error;
-	mb_io_ptr->new_kind = data->kind;
-
-	/* translate values to data storage structure */
-	if (status == MB_SUCCESS
-		&& store != NULL)
-		{
-		store->kind = data->kind;
-		store->time_d = data->time_d;
-		for (i=0;i<7;i++)
-		    store->time_i[i] = data->time_i[i];
-		store->longitude = data->longitude;
-		store->latitude = data->latitude;
-		store->heading = data->heading;
-		store->speed = data->speed;
-		store->sonar_depth = data->sonardepth;
-		store->roll = data->roll;
-		store->pitch = data->pitch;
-		store->heave = data->heave;
-        	for (i=0;i<MBF_MBPRONAV_MAXLINE-1;i++)
-		    store->comment[i] = data->comment[i];
-		store->comment[MBF_MBPRONAV_MAXLINE-1] = 0;
-
-		/* zero the other parts of the structure */
-		for (i=0;i<8;i++)
-		    store->survey_id[i] = 0;
-		store->timezone = 0;
-		store->easting = 0.0;
-		store->northing = 0.0;
-		store->nav_type = 9;
-		store->nav_quality = 9;
-		store->rov_pressure = 0.0;
-		store->rov_altitude = 0.0;
-		store->flag = MB_FLAG_NULL;
-		store->tt = 0.0;
-		store->bath = 0.0;
-		store->tide = 0.0;
-		store->bath_corr = 99;
-		store->bath_type = 9;
-		store->mag_tot_1 = 0.0;
-		store->mag_tot_2 = 0.0;
-		store->mag_res = 0.0;
-		store->mag_res_sensor = 9;
-		store->mag_diurnal = 0.0;
-		store->mag_altitude = 0.0;
-		store->gravity = 0.0;
-		store->eotvos = 0.0;
-		store->free_air = 0.0;
-		store->seismic_line = 0;
-		store->seismic_shot = 0;
-		store->position_flag = 0;
-		store->pressure_flag = 0;
-		store->heading_flag = 0;
-		store->altitude_flag = 0;
-		store->attitude_flag = 0;
-		store->portlon = data->portlon;
-		store->portlat = data->portlat;
-		store->stbdlon = data->stbdlon;
-		store->stbdlat = data->stbdlat;
- 		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_wt_mbpronav(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_wt_mbpronav";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_mbpronav_struct *data;
-	struct mbsys_singlebeam_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_mbpronav_struct *) mb_io_ptr->raw_data;
-	store = (struct mbsys_singlebeam_struct *) store_ptr;
-
-	/* first translate values from data storage structure */
-	if (store != NULL)
-		{
-		data->kind = store->kind;
-		data->time_d = store->time_d;
-		for (i=0;i<7;i++)
-		    data->time_i[i] = store->time_i[i];
-		data->longitude = store->longitude;
-		data->latitude = store->latitude;
-		data->heading = store->heading;
-		data->speed = store->speed;
-		data->sonardepth = store->sonar_depth;
-		data->roll = store->roll;
-		data->pitch = store->pitch;
-		data->heave = store->heave;
-		for (i=0;i<MBF_MBPRONAV_MAXLINE-1;i++)
-		    data->comment[i] = store->comment[i];
-		data->comment[MBF_MBPRONAV_MAXLINE-1] = 0;
-		data->portlon = store->portlon;
-		data->portlat = store->portlat;
-		data->stbdlon = store->stbdlon;
-		data->stbdlat = store->stbdlat;
-		}
-
-	/* write next data to file */
-	status = mbr_mbpronav_wr_data(verbose,mbio_ptr,(void *)data,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_mbpronav_rd_data(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_mbpronav_rd_data";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_mbpronav_struct *data;
-	char	line[MBF_MBPRONAV_MAXLINE+1];
-	char	*line_ptr;
-	int	nread;
-	double  sec;
-	double  d1, d2, d3, d4, d5;
-	double  d6, d7, d8, d9;
-	double  d10, d11, d12, d13;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_mbpronav_struct *) mb_io_ptr->raw_data;
-
-	/* initialize everything to zeros */
-	mbr_zero_mbpronav(verbose,mb_io_ptr->raw_data,error);
-
-	/* set file position */
-	mb_io_ptr->file_bytes = ftell(mb_io_ptr->mbfp);
-	mb_io_ptr->file_pos = mb_io_ptr->file_bytes;
-
-	/* read next record */
-	if ((line_ptr = fgets(line, MBF_MBPRONAV_MAXLINE,
-			mb_io_ptr->mbfp)) != NULL)
-		{
-		mb_io_ptr->file_bytes += strlen(line);
-		status = MB_SUCCESS;
-		*error = MB_ERROR_NO_ERROR;
-		}
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-	mb_io_ptr->file_bytes = ftell(mb_io_ptr->mbfp);
-
-	/* handle the data */
-	if (status == MB_SUCCESS
-	    && line[0] == '#')
-	    {
-	    data->kind = MB_DATA_COMMENT;
-            strncpy(data->comment,&line[1],MBF_MBPRONAV_MAXLINE);
-	    }
-	else if (status == MB_SUCCESS)
-	    {
-	    data->kind = MB_DATA_DATA;
-
-	    /* read data */
-	    nread = sscanf(line,
-			"%d %d %d %d %d %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf",
-			&data->time_i[0],
-			&data->time_i[1],
-			&data->time_i[2],
-			&data->time_i[3],
-			&data->time_i[4],
-			&sec,
-			&d1,
-			&d2,
-			&d3,
-			&d4,
-			&d5,
-			&d6,
-			&d7,
-			&d8,
-			&d9,
-			&d10,
-			&d11,
-			&d12,
-			&d13);
-	    data->time_i[5] = (int) sec;
-	    data->time_i[6] = 1000000.0 * (sec - data->time_i[5]);
-	    if (nread >= 9)
-	        {
-	        mb_get_time(verbose,data->time_i,&data->time_d);
-		data->longitude = d2;
-		data->latitude = d3;
-		data->heading = 0.0;
-		data->speed = 0.0;
-		data->sonardepth = 0.0;
-		data->roll = 0.0;
-		data->pitch = 0.0;
-		data->heave = 0.0;
-		data->portlon = 0.0;
-		data->portlat = 0.0;
-		data->stbdlon = 0.0;
-		data->stbdlat = 0.0;
-	    	status = MB_SUCCESS;
-	   	*error = MB_ERROR_NO_ERROR;
-		}
-	    if (nread >= 10)
-		data->heading = d4;
-	    if (nread >= 11)
-		data->speed = d5;
-	    if (nread >= 12)
-		data->sonardepth = d6;
-	    if (nread >= 15)
-	    	{
-		data->roll = d7;
-		data->pitch = d8;
-		data->heave = d9;
-		}
-	    if (nread >= 17)
-	    	{
-		data->portlon = d10;
-		data->portlat = d11;
-		}
-	    if (nread >= 19)
-	    	{
-		data->stbdlon = d12;
-		data->stbdlat = d13;
-		}
-
-	    /* get time set if only one of two variables is defined */
-	    if (data->time_i[0] == 0 && data->time_d > 0.0)
-	    	mb_get_date(verbose,data->time_d,data->time_i);
-	    else if (data->time_i[0] > 0 && data->time_d == 0.0)
-	    	mb_get_time(verbose,data->time_i,&(data->time_d));
-
-	    if (status == MB_SUCCESS)
-	        {
-		/* print output debug statements */
-		if (verbose >= 4)
-			{
-			fprintf(stderr,"\ndbg4  Data read in MBIO function <%s>\n",function_name);
-			fprintf(stderr,"dbg4  Values,read:\n");
-			fprintf(stderr,"dbg4       time_i[0]:      %d\n",data->time_i[0]);
-			fprintf(stderr,"dbg4       time_i[1]:      %d\n",data->time_i[1]);
-			fprintf(stderr,"dbg4       time_i[2]:      %d\n",data->time_i[2]);
-			fprintf(stderr,"dbg4       time_i[3]:      %d\n",data->time_i[3]);
-			fprintf(stderr,"dbg4       time_i[4]:      %d\n",data->time_i[4]);
-			fprintf(stderr,"dbg4       time_i[5]:      %d\n",data->time_i[5]);
-			fprintf(stderr,"dbg4       time_i[6]:      %d\n",data->time_i[6]);
-			fprintf(stderr,"dbg4       time_d:         %f\n",data->time_d);
-			fprintf(stderr,"dbg4       latitude:       %f\n",data->latitude);
-			fprintf(stderr,"dbg4       longitude:      %f\n",data->longitude);
-			fprintf(stderr,"dbg4       heading:        %f\n",data->heading);
-			fprintf(stderr,"dbg4       speed:          %f\n",data->speed);
-			fprintf(stderr,"dbg4       sonardepth:     %f\n",data->sonardepth);
-			fprintf(stderr,"dbg4       roll:           %f\n",data->roll);
-			fprintf(stderr,"dbg4       pitch:          %f\n",data->pitch);
-			fprintf(stderr,"dbg4       heave:          %f\n",data->heave);
-			fprintf(stderr,"dbg4       portlon:        %f\n",data->portlon);
-			fprintf(stderr,"dbg4       portlat:        %f\n",data->portlat);
-			fprintf(stderr,"dbg4       stbdlon:        %f\n",data->stbdlon);
-			fprintf(stderr,"dbg4       stbdlat:        %f\n",data->stbdlat);
-			fprintf(stderr,"dbg4       error:          %d\n",*error);
-			fprintf(stderr,"dbg4       status:         %d\n",status);
-			}
-	    	}
-
-	    else
-	    	{
-	    	status = MB_FAILURE;
-	   	*error = MB_ERROR_UNINTELLIGIBLE;
-	    	}
-
-	    }
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_mbpronav_wr_data(int verbose, void *mbio_ptr, void *data_ptr, int *error)
-{
-	char	*function_name = "mbr_mbpronav_wr_data";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_mbpronav_struct *data;
-	char	line[MBF_MBPRONAV_MAXLINE+1];
-	int	len;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       data_ptr:   %p\n",(void *)data_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_mbpronav_struct *) data_ptr;
-
-	/* handle the data */
-	if (data->kind == MB_DATA_COMMENT)
-	    {
-	    line[0] = '#';
-            strncpy(&line[1],data->comment,MBF_MBPRONAV_MAXLINE-2);
-            len = strlen(line);
-            line[len] = '\n';
-            line[len+1] = '\0';
-	    }
-	else if (data->kind == MB_DATA_DATA)
-	    {
-	    /* print output debug statements */
-	    if (verbose >= 4)
-		    {
-		    fprintf(stderr,"\ndbg4  Data to be written in MBIO function <%s>\n",
-			    function_name);
-		    fprintf(stderr,"dbg4  Values,read:\n");
-		    fprintf(stderr,"dbg4       time_i[0]:    %d\n",data->time_i[0]);
-		    fprintf(stderr,"dbg4       time_i[1]:    %d\n",data->time_i[1]);
-		    fprintf(stderr,"dbg4       time_i[2]:    %d\n",data->time_i[2]);
-		    fprintf(stderr,"dbg4       time_i[3]:    %d\n",data->time_i[3]);
-		    fprintf(stderr,"dbg4       time_i[4]:    %d\n",data->time_i[4]);
-		    fprintf(stderr,"dbg4       time_i[5]:    %d\n",data->time_i[5]);
-		    fprintf(stderr,"dbg4       time_i[6]:    %d\n",data->time_i[6]);
-		    fprintf(stderr,"dbg4       time_d:       %f\n",data->time_d);
-		    fprintf(stderr,"dbg4       latitude:     %f\n",data->latitude);
-		    fprintf(stderr,"dbg4       longitude:    %f\n",data->longitude);
-		    fprintf(stderr,"dbg4       heading:      %f\n",data->heading);
-		    fprintf(stderr,"dbg4       speed:        %f\n",data->speed);
-		    fprintf(stderr,"dbg4       sonardepth:   %f\n",data->sonardepth);
-		    fprintf(stderr,"dbg4       roll:         %f\n",data->roll);
-		    fprintf(stderr,"dbg4       pitch:        %f\n",data->pitch);
-		    fprintf(stderr,"dbg4       heave:        %f\n",data->heave);
-		    fprintf(stderr,"dbg4       portlon:      %f\n",data->portlon);
-		    fprintf(stderr,"dbg4       portlat:      %f\n",data->portlat);
-		    fprintf(stderr,"dbg4       stbdlon:      %f\n",data->stbdlon);
-		    fprintf(stderr,"dbg4       stbdlat:      %f\n",data->stbdlat);
-		    fprintf(stderr,"dbg4       error:        %d\n",*error);
-		    fprintf(stderr,"dbg4       status:       %d\n",status);
-		    }
-
-            sprintf(line,
-			"%4.4d %2.2d %2.2d %2.2d %2.2d %2.2d.%6.6d %16.6f %.6f %.6f %.2f %.2f %.2f %.2f %.2f %.2f %.2f %.2f %.2f %.2f\n",
-			data->time_i[0],
-			data->time_i[1],
-			data->time_i[2],
-			data->time_i[3],
-			data->time_i[4],
-			data->time_i[5],
-			data->time_i[6],
-			data->time_d,
-			data->longitude,
-			data->latitude,
-			data->heading,
-			data->speed,
-			data->sonardepth,
-			data->roll,
-			data->pitch,
-			data->heave,
-			data->portlon,
-			data->portlat,
-			data->stbdlon,
-			data->stbdlat);
-	    }
-
-	if (fputs(line,mb_io_ptr->mbfp) == EOF)
-		{
-		*error = MB_ERROR_WRITE_FAIL;
-		status = MB_FAILURE;
-		}
-	else
-		{
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-		}
-
-
-	/* print output debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Data record kind in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       kind:       %d\n",data->kind);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mbr_mgd77dat.c b/src/mbio/mbr_mgd77dat.c
deleted file mode 100644
index 358c56d..0000000
--- a/src/mbio/mbr_mgd77dat.c
+++ /dev/null
@@ -1,1139 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbr_mgd77dat.c	5/18/99
- *	$Id: mbr_mgd77dat.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1999-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbr_mgd77dat.c contains the functions for reading and writing
- * multibeam data in the MGD77DAT format.
- * These functions include:
- *   mbr_alm_mgd77dat	- allocate read/write memory
- *   mbr_dem_mgd77dat	- deallocate read/write memory
- *   mbr_rt_mgd77dat	- read and translate data
- *   mbr_wt_mgd77dat	- translate and write data
- *
- * Author:	D. W. Caress
- * Date:	May 18, 1999
- *
- * $Log: mbr_mgd77dat.c,v $
- * Revision 5.11  2008/01/14 17:52:34  caress
- * Fixed problem with comments that prevented proper processing.
- *
- * Revision 5.10  2005/11/05 00:48:03  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.9  2004/09/24 20:44:44  caress
- * Implemented code fixes provided by Bob Covill.
- *
- * Revision 5.8  2003/05/20 18:05:32  caress
- * Added svp_source to data source parameters.
- *
- * Revision 5.7  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.6  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.5  2002/08/21 00:55:46  caress
- * Release 5.0.beta22
- *
- * Revision 5.4  2002/02/22 09:03:43  caress
- * Release 5.0.beta13
- *
- * Revision 5.3  2001/07/20 00:32:54  caress
- * Release 5.0.beta03
- *
- * Revision 5.2  2001/03/22  20:50:02  caress
- * Trying to make version 5.0.beta0
- *
- * Revision 5.1  2001/01/22  07:43:34  caress
- * Version 5.0.beta01
- *
- * Revision 5.0  2000/12/01  22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.3  2000/10/11  01:03:21  caress
- * Convert to ANSI C
- *
- * Revision 4.2  2000/09/30  06:34:20  caress
- * Snapshot for Dale.
- *
- * Revision 4.1  1999/07/16  19:29:09  caress
- * First revision.
- *
- * Revision 1.1  1999/07/16  19:24:15  caress
- * Initial revision
- *
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mb_define.h"
-#include "mbsys_singlebeam.h"
-#include "mbf_mgd77dat.h"
-
-/* essential function prototypes */
-int mbr_register_mgd77dat(int verbose, void *mbio_ptr,
-		int *error);
-int mbr_info_mgd77dat(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_alm_mgd77dat(int verbose, void *mbio_ptr, int *error);
-int mbr_dem_mgd77dat(int verbose, void *mbio_ptr, int *error);
-int mbr_zero_mgd77dat(int verbose, char *data_ptr, int *error);
-int mbr_rt_mgd77dat(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_wt_mgd77dat(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_mgd77dat_rd_data(int verbose, void *mbio_ptr, int *error);
-int mbr_mgd77dat_wr_data(int verbose, void *mbio_ptr, void *data_ptr, int *error);
-
-static char rcs_id[]="$Id: mbr_mgd77dat.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mbr_register_mgd77dat(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_register_mgd77dat";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* get mb_io_ptr */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set format info parameters */
-	status = mbr_info_mgd77dat(verbose,
-			&mb_io_ptr->system,
-			&mb_io_ptr->beams_bath_max,
-			&mb_io_ptr->beams_amp_max,
-			&mb_io_ptr->pixels_ss_max,
-			mb_io_ptr->format_name,
-			mb_io_ptr->system_name,
-			mb_io_ptr->format_description,
-			&mb_io_ptr->numfile,
-			&mb_io_ptr->filetype,
-			&mb_io_ptr->variable_beams,
-			&mb_io_ptr->traveltime,
-			&mb_io_ptr->beam_flagging,
-			&mb_io_ptr->nav_source,
-			&mb_io_ptr->heading_source,
-			&mb_io_ptr->vru_source,
-			&mb_io_ptr->svp_source,
-			&mb_io_ptr->beamwidth_xtrack,
-			&mb_io_ptr->beamwidth_ltrack,
-			error);
-
-	/* set format and system specific function pointers */
-	mb_io_ptr->mb_io_format_alloc = &mbr_alm_mgd77dat;
-	mb_io_ptr->mb_io_format_free = &mbr_dem_mgd77dat;
-	mb_io_ptr->mb_io_store_alloc = &mbsys_singlebeam_alloc;
-	mb_io_ptr->mb_io_store_free = &mbsys_singlebeam_deall;
-	mb_io_ptr->mb_io_read_ping = &mbr_rt_mgd77dat;
-	mb_io_ptr->mb_io_write_ping = &mbr_wt_mgd77dat;
-	mb_io_ptr->mb_io_dimensions = &mbsys_singlebeam_dimensions;
-	mb_io_ptr->mb_io_extract = &mbsys_singlebeam_extract;
-	mb_io_ptr->mb_io_insert = &mbsys_singlebeam_insert;
-	mb_io_ptr->mb_io_extract_nav = &mbsys_singlebeam_extract_nav;
-	mb_io_ptr->mb_io_insert_nav = &mbsys_singlebeam_insert_nav;
-	mb_io_ptr->mb_io_extract_altitude = &mbsys_singlebeam_extract_altitude;
-	mb_io_ptr->mb_io_insert_altitude = NULL;
-	mb_io_ptr->mb_io_extract_svp = NULL;
-	mb_io_ptr->mb_io_insert_svp = NULL;
-	mb_io_ptr->mb_io_ttimes = &mbsys_singlebeam_ttimes;
-	mb_io_ptr->mb_io_detects = &mbsys_singlebeam_detects;
-	mb_io_ptr->mb_io_copyrecord = &mbsys_singlebeam_copy;
-	mb_io_ptr->mb_io_extract_rawss = NULL;
-	mb_io_ptr->mb_io_insert_rawss = NULL;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",mb_io_ptr->system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",mb_io_ptr->beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",mb_io_ptr->beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",mb_io_ptr->pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",mb_io_ptr->format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",mb_io_ptr->system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",mb_io_ptr->format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",mb_io_ptr->numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",mb_io_ptr->filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",mb_io_ptr->variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",mb_io_ptr->traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",mb_io_ptr->beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",mb_io_ptr->nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",mb_io_ptr->heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",mb_io_ptr->vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",mb_io_ptr->svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",mb_io_ptr->beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",mb_io_ptr->beamwidth_ltrack);
-		fprintf(stderr,"dbg2       format_alloc:       %p\n",(void *)mb_io_ptr->mb_io_format_alloc);
-		fprintf(stderr,"dbg2       format_free:        %p\n",(void *)mb_io_ptr->mb_io_format_free);
-		fprintf(stderr,"dbg2       store_alloc:        %p\n",(void *)mb_io_ptr->mb_io_store_alloc);
-		fprintf(stderr,"dbg2       store_free:         %p\n",(void *)mb_io_ptr->mb_io_store_free);
-		fprintf(stderr,"dbg2       read_ping:          %p\n",(void *)mb_io_ptr->mb_io_read_ping);
-		fprintf(stderr,"dbg2       write_ping:         %p\n",(void *)mb_io_ptr->mb_io_write_ping);
-		fprintf(stderr,"dbg2       extract:            %p\n",(void *)mb_io_ptr->mb_io_extract);
-		fprintf(stderr,"dbg2       insert:             %p\n",(void *)mb_io_ptr->mb_io_insert);
-		fprintf(stderr,"dbg2       extract_nav:        %p\n",(void *)mb_io_ptr->mb_io_extract_nav);
-		fprintf(stderr,"dbg2       insert_nav:         %p\n",(void *)mb_io_ptr->mb_io_insert_nav);
-		fprintf(stderr,"dbg2       extract_altitude:   %p\n",(void *)mb_io_ptr->mb_io_extract_altitude);
-		fprintf(stderr,"dbg2       insert_altitude:    %p\n",(void *)mb_io_ptr->mb_io_insert_altitude);
-		fprintf(stderr,"dbg2       extract_svp:        %p\n",(void *)mb_io_ptr->mb_io_extract_svp);
-		fprintf(stderr,"dbg2       insert_svp:         %p\n",(void *)mb_io_ptr->mb_io_insert_svp);
-		fprintf(stderr,"dbg2       ttimes:             %p\n",(void *)mb_io_ptr->mb_io_ttimes);
-		fprintf(stderr,"dbg2       detects:            %p\n",(void *)mb_io_ptr->mb_io_detects);
-		fprintf(stderr,"dbg2       extract_rawss:      %p\n",(void *)mb_io_ptr->mb_io_extract_rawss);
-		fprintf(stderr,"dbg2       insert_rawss:       %p\n",(void *)mb_io_ptr->mb_io_insert_rawss);
-		fprintf(stderr,"dbg2       copyrecord:         %p\n",(void *)mb_io_ptr->mb_io_copyrecord);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbr_info_mgd77dat(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error)
-{
-	char	*function_name = "mbr_info_mgd77dat";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* set format info parameters */
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-	*system = MB_SYS_SINGLEBEAM;
-	*beams_bath_max = 1;
-	*beams_amp_max = 0;
-	*pixels_ss_max = 0;
-	strncpy(format_name, "MGD77DAT", MB_NAME_LENGTH);
-	strncpy(system_name, "SINGLEBEAM", MB_NAME_LENGTH);
-	strncpy(format_description, "Format name:          MBF_MGD77DAT\nInformal Description: NGDC MGD77 underway geophysics format\nAttributes:           single beam bathymetry, nav, magnetics,\n                      gravity, ascii, NOAA NGDC\n", MB_DESCRIPTION_LENGTH);
-	*numfile = 1;
-	*filetype = MB_FILETYPE_NORMAL;
-	*variable_beams = MB_NO;
-	*traveltime = MB_YES;
-	*beam_flagging = MB_NO;
-	*nav_source = MB_DATA_DATA;
-	*heading_source = MB_DATA_DATA;
-	*vru_source = MB_DATA_DATA;
-	*svp_source = MB_DATA_NONE;
-	*beamwidth_xtrack = 0.0;
-	*beamwidth_ltrack = 0.0;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",*system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",*beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",*beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",*pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",*numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",*filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",*variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",*traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",*beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",*nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",*heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",*vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",*svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",*beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",*beamwidth_ltrack);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_alm_mgd77dat(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_alm_mgd77dat";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_mgd77dat_struct *data;
-	char	*data_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set initial status */
-	status = MB_SUCCESS;
-
-	/* allocate memory for data structure */
-	mb_io_ptr->structure_size = sizeof(struct mbf_mgd77dat_struct);
-	mb_io_ptr->data_structure_size = 0;
-	status = mb_malloc(verbose,mb_io_ptr->structure_size,
-				&mb_io_ptr->raw_data,error);
-	status = mb_malloc(verbose,sizeof(struct mbsys_singlebeam_struct),
-				&mb_io_ptr->store_data,error);
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-	data = (struct mbf_mgd77dat_struct *) mb_io_ptr->raw_data;
-	data_ptr = (char *) data;
-
-	/* set number of header records read to zero */
-	mb_io_ptr->save1 = 0;
-
-	/* initialize everything to zeros */
-	mbr_zero_mgd77dat(verbose,data_ptr,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_dem_mgd77dat(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_dem_mgd77dat";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* deallocate memory for data descriptor */
-	status = mb_free(verbose,&mb_io_ptr->raw_data,error);
-	status = mb_free(verbose,&mb_io_ptr->store_data,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_zero_mgd77dat(int verbose, char *data_ptr, int *error)
-{
-	char	*function_name = "mbr_zero_mgd77dat";
-	int	status = MB_SUCCESS;
-	struct mbf_mgd77dat_struct *data;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       data_ptr:   %p\n",(void *)data_ptr);
-		}
-
-	/* get pointer to data descriptor */
-	data = (struct mbf_mgd77dat_struct *) data_ptr;
-
-	/* initialize everything to zeros */
-	if (data != NULL)
-		{
-		data->kind = MB_DATA_NONE;
-		for (i=0;i<8;i++)
-		    data->survey_id[i] = 0;
-		data->time_d = 0.0;
-		for (i=0;i<7;i++)
-		    data->time_i[i] = 0;
-		data->timezone = 0;
-		data->longitude = 0.0;
-		data->latitude = 0.0;
-		data->heading = 0.0;
-		data->speed = 0.0;
-		data->nav_type = 9;
-		data->nav_quality = 9;
-		data->roll = 0.0;
-		data->pitch = 0.0;
-		data->heave = 0.0;
-		data->tt = 0.0;
-		data->flag = MB_FLAG_NULL;
-		data->bath = 0.0;
-		data->bath_corr = 99;
-		data->bath_type = 9;
-		data->mag_tot_1 = 0.0;
-		data->mag_tot_2 = 0.0;
-		data->mag_res = 0.0;
-		data->mag_res_sensor = 9;
-		data->mag_diurnal = 0.0;
-		data->mag_altitude = 0.0;
-		data->gravity = 0.0;
-		data->eotvos = 0.0;
-		data->free_air = 0.0;
-		data->seismic_line = 0;
-		data->seismic_shot = 0;
-		for (i=0;i<MBF_MGD77DAT_DATA_LEN;i++)
-		    data->comment[i] = 0;
-		}
-
-	/* assume success */
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_rt_mgd77dat(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_rt_mgd77dat";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_mgd77dat_struct *data;
-	struct mbsys_singlebeam_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointers to mbio descriptor and data structures */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-	data = (struct mbf_mgd77dat_struct *) mb_io_ptr->raw_data;
-	store = (struct mbsys_singlebeam_struct *) store_ptr;
-
-	/* read next data from file */
-	status = mbr_mgd77dat_rd_data(verbose,mbio_ptr,error);
-
-	/* set error and kind in mb_io_ptr */
-	mb_io_ptr->new_error = *error;
-	mb_io_ptr->new_kind = data->kind;
-
-	/* translate values to data storage structure */
-	if (status == MB_SUCCESS
-		&& store != NULL)
-		{
-		store->kind = data->kind;
-		for (i=0;i<8;i++)
-		    store->survey_id[i] = data->survey_id[i];
-		store->time_d = data->time_d;
-		for (i=0;i<7;i++)
-		    store->time_i[i] = data->time_i[i];
-		store->timezone = data->timezone;
-		store->longitude = data->longitude;
-		store->latitude = data->latitude;
-		store->heading = data->heading;
-		store->speed = data->speed;
-		store->nav_type = data->nav_type;
-		store->nav_quality = data->nav_quality;
-		store->roll = data->roll;
-		store->pitch = data->pitch;
-		store->heave = data->heave;
-		store->flag = data->flag;
-		store->tt = data->tt;
-		store->bath = data->bath;
-		store->bath_corr = data->bath_corr;
-		store->bath_type = data->bath_type;
-		store->mag_tot_1 = data->mag_tot_1;
-		store->mag_tot_2 = data->mag_tot_2;
-		store->mag_res = data->mag_res;
-		store->mag_res_sensor = data->mag_res_sensor;
-		store->mag_diurnal = data->mag_diurnal;
-		store->mag_altitude = data->mag_altitude;
-		store->gravity = data->gravity;
-		store->eotvos = data->eotvos;
-		store->free_air = data->free_air;
-		store->seismic_line = data->seismic_line;
-		store->seismic_shot = data->seismic_shot;
-		for (i=0;i<MB_COMMENT_MAXLINE;i++)
-		    store->comment[i] = data->comment[i];
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_wt_mgd77dat(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_wt_mgd77dat";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_mgd77dat_struct *data;
-	struct mbsys_singlebeam_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_mgd77dat_struct *) mb_io_ptr->raw_data;
-	store = (struct mbsys_singlebeam_struct *) store_ptr;
-
-	/* first translate values from data storage structure */
-	if (store != NULL)
-		{
-		data->kind = store->kind;
-		for (i=0;i<8;i++)
-		    data->survey_id[i] = store->survey_id[i];
-		data->time_d = store->time_d;
-		for (i=0;i<7;i++)
-		    data->time_i[i] = store->time_i[i];
-		data->timezone = store->timezone;
-		data->longitude = store->longitude;
-		data->latitude = store->latitude;
-		data->heading = store->heading;
-		data->speed = store->speed;
-		data->nav_type = store->nav_type;
-		data->nav_quality = store->nav_quality;
-		data->roll = store->roll;
-		data->pitch = store->pitch;
-		data->heave = store->heave;
-		data->flag = store->flag;
-		data->tt = store->tt;
-		data->bath = store->bath;
-		data->bath_corr = store->bath_corr;
-		data->bath_type = store->bath_type;
-		data->mag_tot_1 = store->mag_tot_1;
-		data->mag_tot_2 = store->mag_tot_2;
-		data->mag_res = store->mag_res;
-		data->mag_res_sensor = store->mag_res_sensor;
-		data->mag_diurnal = store->mag_diurnal;
-		data->mag_altitude = store->mag_altitude;
-		data->gravity = store->gravity;
-		data->eotvos = store->eotvos;
-		data->free_air = store->free_air;
-		data->seismic_line = store->seismic_line;
-		data->seismic_shot = store->seismic_shot;
-		for (i=0;i<MB_COMMENT_MAXLINE;i++)
-		    data->comment[i] = store->comment[i];
-		}
-
-	/* write next data to file */
-	status = mbr_mgd77dat_wr_data(verbose,mbio_ptr,(void *)data,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_mgd77dat_rd_data(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_mgd77dat_rd_data";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_mgd77dat_struct *data;
-	int	*header_read;
-	char	line[MBF_MGD77DAT_DATA_LEN];
-	size_t	read_len;
-	size_t	skip;
-	int	shift;
-	int 	neg_unit;
-	int	itmp;
-	double	dtmp;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_mgd77dat_struct *) mb_io_ptr->raw_data;
-	header_read = (int *) &mb_io_ptr->save1;
-
-	/* initialize everything to zeros */
-	mbr_zero_mgd77dat(verbose,mb_io_ptr->raw_data,error);
-
-	/* set file position */
-	mb_io_ptr->file_bytes = ftell(mb_io_ptr->mbfp);
-	mb_io_ptr->file_pos = mb_io_ptr->file_bytes;
-
-	/* read next record */
-	if ((read_len = fread(line,1,MBF_MGD77DAT_DATA_LEN,
-			mb_io_ptr->mbfp)) == MBF_MGD77DAT_DATA_LEN)
-		{
-		mb_io_ptr->file_bytes += read_len;
-		status = MB_SUCCESS;
-		*error = MB_ERROR_NO_ERROR;
-		}
-	else
-		{
-		mb_io_ptr->file_bytes += read_len;
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-/*fprintf(stderr,"_RAWLINE:");
-for (i=0;i<MBF_MGD77DAT_DATA_LEN;i++)
-fprintf(stderr,"%c",line[i]);
-fprintf(stderr,"\n");*/
-
-	/* handle "pseudo-mgd77" in which each record is
-	 * followed by a cr or lf or both */
-	skip = 0;
-	if (line[0] == '\r' || line[0] == '\n')
-		skip++;
-	if (line[1] == '\r' || line[1] == '\n')
-		skip++;
-	if (skip > 0)
-		{
-		for (j=0;j<MBF_MGD77DAT_DATA_LEN-skip;j++)
-			{
-			line[j] = line[j+skip];
-			}
-	        if ((read_len = fread(&line[MBF_MGD77DAT_DATA_LEN-skip],1,skip,
-			    mb_io_ptr->mbfp)) == skip)
-		    {
-		    mb_io_ptr->file_bytes += read_len;
-		    status = MB_SUCCESS;
-		    *error = MB_ERROR_NO_ERROR;
-		    }
-	        else
-		    {
-		    mb_io_ptr->file_bytes += read_len;
-		    status = MB_FAILURE;
-		    *error = MB_ERROR_EOF;
-		    }
-/*fprintf(stderr,"---SKIPPED %zu BYTES---\n",skip);*/
-		}
-/*fprintf(stderr,"+FIXLINE:");
-for (i=0;i<MBF_MGD77DAT_DATA_LEN;i++)
-fprintf(stderr,"%c",line[i]);
-fprintf(stderr,"\n");*/
-
-	mb_io_ptr->file_bytes = ftell(mb_io_ptr->mbfp);
-
-	/* handle the data */
-	if (status == MB_SUCCESS
-	    && *header_read > 0
-	    && *header_read < MBF_MGD77DAT_HEADER_NUM)
-	    {
-	    data->kind = MB_DATA_HEADER;
-	    (*header_read)++;
-	    for (i=0;i<MBF_MGD77DAT_DATA_LEN;i++)
-		data->comment[i] = line[i];
-	    }
-	else if (status == MB_SUCCESS
-	    && (line[0] == '1' || line[0] == '4'))
-	    {
-	    data->kind = MB_DATA_HEADER;
-	    (*header_read) = 1;
-	    for (i=0;i<MBF_MGD77DAT_DATA_LEN;i++)
-		data->comment[i] = line[i];
-	    }
-	else if (status == MB_SUCCESS
-	    && line[0] == '#')
-	    {
-	    data->kind = MB_DATA_COMMENT;
-            strncpy(data->comment,&line[1],MBF_MGD77DAT_DATA_LEN-1);
-	    }
-	else if (status == MB_SUCCESS
-	    && line[0] == '3')
-	    {
-	    data->kind = MB_DATA_DATA;
-
-	    /* get survey id */
-	    shift = 1;
-	    for (i=0;i<8;i++)
-		data->survey_id[i] = line[i+shift];
-
-	    /* get time */
-	    shift += 8;
-	    mb_get_int(&data->timezone, &line[shift], 5); shift += 5;
-	    data->timezone = data->timezone / 100;
-	    mb_get_int(&itmp, &line[shift], 2); shift += 2;
-	    mb_fix_y2k(verbose, itmp, &data->time_i[0]);
-	    mb_get_int(&data->time_i[1], &line[shift], 2); shift += 2;
-	    mb_get_int(&data->time_i[2], &line[shift], 2); shift += 2;
-	    mb_get_int(&data->time_i[3], &line[shift], 2); shift += 2;
-	    mb_get_int(&itmp, &line[shift], 5); shift += 5;
-	    data->time_i[4] = 0.001 * itmp;
-	    dtmp = (itmp - 1000 * data->time_i[4]) * 0.06;
-	    data->time_i[5] = (int) dtmp;
-	    data->time_i[6] = 1000000 * (dtmp - data->time_i[5]);
-	    mb_get_time(verbose,data->time_i,&data->time_d);
-
-	    /* get nav */
-	    neg_unit = 8;
-	    if (line[shift] == '-') {
-		    shift += 1;
-		    neg_unit = 7;
-	    }
-	    mb_get_int(&itmp, &line[shift], neg_unit); shift += neg_unit;
-	    data->latitude = 0.00001 * itmp;
-	    if (neg_unit == 7)
-		    data->latitude = -data->latitude;
-
-	    neg_unit = 9;
-	    if (line[shift] == '-') {
-		    shift += 1;
-		    neg_unit = 8;
-	    }
-	    mb_get_int(&itmp, &line[shift], neg_unit); shift += neg_unit;
-	    data->longitude = 0.00001 * itmp;
-	    if (neg_unit == 8)
-		    data->longitude = -data->longitude;
-	    mb_get_int(&data->nav_type, &line[shift], 1); shift += 1;
-
-	    /* get bath */
-	    mb_get_int(&itmp, &line[shift], 6); shift += 6;
-	    data->tt = 0.0001 * itmp;
-	    mb_get_int(&itmp, &line[shift], 6); shift += 6;
-	    data->bath = 0.1 * itmp;
-	    mb_get_int(&data->bath_corr, &line[shift], 2); shift += 2;
-	    mb_get_int(&data->bath_type, &line[shift], 1); shift += 1;
-	    if (data->bath > 0.0 && data->bath < 99999.9)
-		{
-		data->flag = MB_FLAG_NONE;
-		}
-	    else
-		{
-		data->flag = MB_FLAG_NULL;
-		}
-
-	    /* get magnetics */
-	    mb_get_int(&itmp, &line[shift], 6); shift += 6;
-	    data->mag_tot_1 = 0.1 * itmp;
-	    mb_get_int(&itmp, &line[shift], 6); shift += 6;
-	    data->mag_tot_2 = 0.1 * itmp;
-	    mb_get_int(&itmp, &line[shift], 6); shift += 6;
-	    data->mag_res = 0.1 * itmp;
-	    mb_get_int(&data->mag_res_sensor, &line[shift], 1); shift += 1;
-	    mb_get_int(&itmp, &line[shift], 5); shift += 5;
-	    data->mag_diurnal = 0.1 * itmp;
-	    mb_get_int(&itmp, &line[shift], 6); shift += 6;
-	    data->mag_altitude = itmp;
-
-	    /* get gravity */
-	    mb_get_int(&itmp, &line[shift], 7); shift += 7;
-	    data->gravity = 0.1 * itmp;
-	    mb_get_int(&itmp, &line[shift], 6); shift += 6;
-	    data->eotvos = 0.1 * itmp;
-	    mb_get_int(&itmp, &line[shift], 5); shift += 5;
-	    data->free_air = 0.1 * itmp;
-	    mb_get_int(&data->seismic_line, &line[shift], 5); shift += 5;
-	    mb_get_int(&data->seismic_shot, &line[shift], 6); shift += 6;
-
-	    /* get nav quality */
-	    mb_get_int(&data->nav_quality, &line[shift], 1); shift += 1;
-	    }
-	else if (status == MB_SUCCESS
-	    && line[0] == '5')
-	    {
-	    data->kind = MB_DATA_DATA;
-
-	    /* get survey id */
-	    shift = 1;
-	    for (i=0;i<8;i++)
-		data->survey_id[i] = line[i+shift];
-
-	    /* get time */
-	    shift += 8;
-	    mb_get_int(&data->timezone, &line[shift], 3); shift += 3;
-	    mb_get_int(&data->time_i[0], &line[shift], 4); shift += 4;
-	    mb_get_int(&data->time_i[1], &line[shift], 2); shift += 2;
-	    mb_get_int(&data->time_i[2], &line[shift], 2); shift += 2;
-	    mb_get_int(&data->time_i[3], &line[shift], 2); shift += 2;
-	    mb_get_int(&itmp, &line[shift], 5); shift += 5;
-	    data->time_i[4] = 0.001 * itmp;
-	    dtmp = (itmp - 1000 * data->time_i[4]) * 0.06;
-	    data->time_i[5] = (int) dtmp;
-	    data->time_i[6] = 1000000 * (dtmp - data->time_i[5]);
-
-	    mb_get_time(verbose,data->time_i,&data->time_d);
-
-	    /* get nav */
-	    neg_unit = 8;
-	    if (line[shift] == '-') {
-		    shift += 1;
-		    neg_unit = 7;
-	    }
-	    mb_get_int(&itmp, &line[shift], neg_unit); shift += neg_unit;
-	    data->latitude = 0.00001 * itmp;
-	    if (neg_unit == 7)
-		    data->latitude = -data->latitude;
-
-	    neg_unit = 9;
-	    if (line[shift] == '-') {
-		    shift += 1;
-		    neg_unit = 8;
-	    }
-	    mb_get_int(&itmp, &line[shift], neg_unit); shift += neg_unit;
-	    data->longitude = 0.00001 * itmp;
-	    if (neg_unit == 8)
-		    data->longitude = -data->longitude;
-
-	    mb_get_int(&data->nav_type, &line[shift], 1); shift += 1;
-
-	    /* get bath */
-	    mb_get_int(&itmp, &line[shift], 6); shift += 6;
-	    data->tt = 0.0001 * itmp;
-	    mb_get_int(&itmp, &line[shift], 6); shift += 6;
-	    data->bath = 0.1 * itmp;
-	    mb_get_int(&data->bath_corr, &line[shift], 2); shift += 2;
-	    mb_get_int(&data->bath_type, &line[shift], 1); shift += 1;
-	    if (data->bath > 0.0 && data->bath < 99999.9)
-		{
-		data->flag = MB_FLAG_NONE;
-		}
-	    else
-		{
-		data->flag = MB_FLAG_NULL;
-		}
-
-	    /* get magnetics */
-	    mb_get_int(&itmp, &line[shift], 6); shift += 6;
-	    data->mag_tot_1 = 0.1 * itmp;
-	    mb_get_int(&itmp, &line[shift], 6); shift += 6;
-	    data->mag_tot_2 = 0.1 * itmp;
-	    mb_get_int(&itmp, &line[shift], 6); shift += 6;
-	    data->mag_res = 0.1 * itmp;
-	    mb_get_int(&data->mag_res_sensor, &line[shift], 1); shift += 1;
-	    mb_get_int(&itmp, &line[shift], 5); shift += 5;
-	    data->mag_diurnal = 0.1 * itmp;
-	    mb_get_int(&itmp, &line[shift], 6); shift += 6;
-	    data->mag_altitude = itmp;
-
-	    /* get gravity */
-	    mb_get_int(&itmp, &line[shift], 7); shift += 7;
-	    data->gravity = 0.1 * itmp;
-	    mb_get_int(&itmp, &line[shift], 6); shift += 6;
-	    data->eotvos = 0.1 * itmp;
-	    mb_get_int(&itmp, &line[shift], 5); shift += 5;
-	    data->free_air = 0.1 * itmp;
-	    mb_get_int(&data->seismic_line, &line[shift], 5); shift += 5;
-	    mb_get_int(&data->seismic_shot, &line[shift], 6); shift += 6;
-
-	    /* get nav quality */
-	    mb_get_int(&data->nav_quality, &line[shift], 1); shift += 1;
-	    }
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_mgd77dat_wr_data(int verbose, void *mbio_ptr, void *data_ptr, int *error)
-{
-	char	*function_name = "mbr_mgd77dat_wr_data";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_mgd77dat_struct *data;
-	char	line[MBF_MGD77DAT_DATA_LEN+1];
-	int	itmp;
-	int	write_len;
-	int	shift;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       data_ptr:   %p\n",(void *)data_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_mgd77dat_struct *) data_ptr;
-
-	/* handle the data */
-	if (data->kind == MB_DATA_HEADER)
-	    {
-	    strcpy(line, data->comment);
-	    for (i=strlen(line);i<MBF_MGD77DAT_DATA_LEN;i++)
-		line[i] = ' ';
-	    }
-	else if (data->kind == MB_DATA_COMMENT)
-	    {
-	    line[0] = '#';
-            strncpy(&line[1],data->comment,MBF_MGD77DAT_DATA_LEN-1);
-	    for (i=strlen(line);i<MBF_MGD77DAT_DATA_LEN;i++)
-		line[i] = ' ';
-	    }
-	else if (data->kind == MB_DATA_DATA)
-	    {
-	    /* set data record id */
-	    shift = 0;
-	    line[0] = '5'; shift += 1;
-
-	    /* get survey id */
-	    for (i=0;i<8;i++)
-		line[i+shift] = data->survey_id[i];
-	    shift += 8;
-
-	    /* get time */
-	    sprintf(&line[shift], "%3.3d", data->timezone); shift += 3;
-	    sprintf(&line[shift], "%4.4d", data->time_i[0]); shift += 4;
-	    sprintf(&line[shift], "%2.2d", data->time_i[1]); shift += 2;
-	    sprintf(&line[shift], "%2.2d", data->time_i[2]); shift += 2;
-	    sprintf(&line[shift], "%2.2d", data->time_i[3]); shift += 2;
-	    itmp = (1000.0 * data->time_i[4])
-		    + (1000.0 * (data->time_i[5]/60.0))
-			+ (1000.0 * ((data->time_i[6]/1000000.0)/60.0));
-	    sprintf(&line[shift], "%5.5d", itmp); shift += 5;
-
-	    /* get nav */
-	    itmp = 100000 * data->latitude;
-	    if (itmp < 0) {
-		    sprintf(&line[shift], "-"); shift += 1;
-		    sprintf(&line[shift], "%7.7d", itmp*-1); shift += 7;
-	    } else {
-		    sprintf(&line[shift], "%8.8d", itmp); shift += 8;
-	    }
-	    itmp = 100000 * data->longitude;
-	    if (itmp < 0) {
-		    sprintf(&line[shift], "-"); shift += 1;
-		    sprintf(&line[shift], "%8.8d", itmp*-1); shift += 8;
-	    } else {
-		    sprintf(&line[shift], "%9.9d", itmp); shift += 9;
-	    }
-	    sprintf(&line[shift], "%1.1d", data->nav_type); shift += 1;
-
-	    /* get bath */
-	    if (data->flag == MB_FLAG_NONE)
-		{
-		itmp = 10000 * data->tt;
-		sprintf(&line[shift], "%6.6d", itmp); shift += 6;
-		itmp = 10 * data->bath;
-		sprintf(&line[shift], "%6.6d", itmp); shift += 6;
-		}
-	    else
-		{
-		itmp = 999999;
-		sprintf(&line[shift], "%6.6d", itmp); shift += 6;
-		sprintf(&line[shift], "%6.6d", itmp); shift += 6;
-		}
-	    sprintf(&line[shift], "%2.2d", data->bath_corr); shift += 2;
-	    sprintf(&line[shift], "%1.1d", data->bath_type); shift += 1;
-
-	    /* get magnetics */
-	    itmp = 10 * data->mag_tot_1;
-	    sprintf(&line[shift], "%6.6d", itmp); shift += 6;
-	    itmp = 10 * data->mag_tot_2;
-	    sprintf(&line[shift], "%6.6d", itmp); shift += 6;
-	    itmp = 10 * data->mag_res;
-	    sprintf(&line[shift], "%6.6d", itmp); shift += 6;
-	    sprintf(&line[shift], "%1.1d", data->mag_res_sensor); shift += 1;
-	    itmp = 10 * data->mag_diurnal;
-	    sprintf(&line[shift], "%5.5d", itmp); shift += 5;
-	    itmp = data->mag_altitude;
-	    sprintf(&line[shift], "%6.6d", itmp); shift += 6;
-
-	    /* get gravity */
-	    itmp = 10 * data->gravity;
-	    sprintf(&line[shift], "%7.7d", itmp); shift += 7;
-	    itmp = 10 * data->eotvos;
-	    sprintf(&line[shift], "%6.6d", itmp); shift += 6;
-	    itmp = 10 * data->free_air;
-	    sprintf(&line[shift], "%5.5d", itmp); shift += 5;
-	    sprintf(&line[shift], "%5.5d", data->seismic_line); shift += 5;
-	    sprintf(&line[shift], "%6.6d", data->seismic_shot); shift += 6;
-
-	    /* get nav quality */
-	    sprintf(&line[shift], "%1.1d", data->nav_quality); shift += 1;
-	    }
-
-	write_len = fwrite(line,1,MBF_MGD77DAT_DATA_LEN,mb_io_ptr->mbfp);
-	if (write_len != MBF_MGD77DAT_DATA_LEN)
-		{
-		*error = MB_ERROR_WRITE_FAIL;
-		status = MB_FAILURE;
-		}
-	else
-		{
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-		}
-
-
-	/* print output debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Data record kind in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       kind:       %d\n",data->kind);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mbr_mgd77tab.c b/src/mbio/mbr_mgd77tab.c
deleted file mode 100644
index 41f44a8..0000000
--- a/src/mbio/mbr_mgd77tab.c
+++ /dev/null
@@ -1,2232 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbr_mgd77tab.c	5/18/99
- *	$Id: mbr_mgd77tab.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 2014-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbr_mgd77tab.c contains the functions for reading and writing
- * multibeam data in the MGD77TAB format.
- * These functions include:
- *   mbr_alm_mgd77tab	- allocate read/write memory
- *   mbr_dem_mgd77tab	- deallocate read/write memory
- *   mbr_rt_mgd77tab	- read and translate data
- *   mbr_wt_mgd77tab	- translate and write data
- *
- * Author:	D. W. Caress
- * Date:	February 25, 2014
- *
- * $Log: mbr_mgd77tab.c,v $
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mb_define.h"
-#include "mbsys_singlebeam.h"
-
-/*
- * Notes on the MBF_MGD77TAB data format:
- *   1. The MGD77T format is is an exchange format for marine
- *	geophysical data (bathymetry, magnetics, and gravity).
- *      The format standard is maintained by the National
- *      Geophysical Data Center of NOAA.
- *   2. The MGD77T format is an update of the MGD77 format that
- *      replaces fixed length records with variable length, tab
- *      delimited records.
- *   3. Blank fields are denoted by having no characters at all
- *      between the leading and following tab characters for
- *      those fields.
- *   4. The MB-System implementation includes the support of
- *      an arbitrary number of comment records at the beginning
- *      of each file. The comment records are 120 bytes each
- *      and begin with the character '#'.
- *   5. The following notes derive from the format specification
- *      document.
- *
- * THE MGD77T HEADER RECORD
- * The purpose of the (survey) Header Record is to document both the content
- * and structure of the geophysical data contained within subsequent data
- * records. In general, documentation that is constant throughout the survey
- * will be in the Header Record, while data that is variable will be in the
- * Data Records.
- *
- * The Header Record contains fields which are numeric and freely formatted
- * text. Each field is followed by a tab character. Unspecified or unused
- * fields are nil (a tab immediately follows the previous field). Tabs are
- * generally omitted for any trailing unspecified fields, including the tab
- * for the last specified field.
- *
- * MGD77T headers for groups of surveys can be contained in a single file or
- * in separate files (one file per survey). Generally the grouping method will
- * be the same as that of the MGD77T data files.
- *
- * The MGD77T survey header(s) file may optionally have a heading record of
- * field identifiers as the first record of the file, followed by the actual
- * survey header(s). The field identifier names offered in this format
- * description below are not to be considered as the “official” field identifier
- * names. Users may offer their own field id names, or not insert a heading
- * record in the survey header(s) file. However, the use of name “FORMAT_77”
- * as the second field identifier of the first record of the file will make
- * it easy for applications to determine that this record is a heading record
- * for a MGD77T survey header(s) file in the same way that “MGD77T” in the
- * second field of a record identifies the record as a MGD77T survey header
- * record.
- *
- * Format Conventions for the MGD77T Header Record:
- *
- * The following is a detailed description of the Header Record for MGD77T.
- * Fields can be of type integer, floating point or character. Fields that always
- * represent whole numbers are designated as integers. Fields that may contain a
- * decimal component are float, and fields that are alphanumeric are character.
- *
- * 	[field #] Type FIELD_ID Description 
- * 	_____________________________________________________ 
- * 	[1]	char 	SURVEY_ID 	SURVEY IDENTIFIER  
- * 					Identifier supplied by the contributing
- * 					organization, else given by NGDC in a
- * 					manner which represents the data.
- * 					Identical to same in data record. 
- * 	[2]	char	FORMAT_77	FORMAT ACRONYM - Set to “MGD77T” 
- * 	[3]	char	CENTER_ID	DATA CENTER FILE NUMBER 
- * 					Survey identifier bestowed by the data
- * 					center.  
- * 	[4]	char	PARAMS_CO	PARAMETERS SURVEYED CODES  
- * 					Status of geophysical parameters for
- * 					this survey. This field must be nil,
- * 					or exactly 5 characters. 
- * 					nil – entire field unspecified 
- * 					COL. PARAMETER SURVEYED
- * 						1 - bathymetry
- * 						2 - magnetics
- * 						3 - gravity
- * 						4 - high-resolution seismics
- * 						5 - deep penetration seismics
- * 					_________________________________
- * 					CODE - (for columns 27-31)
- * 						0 - unspecified
- * 						1 - Parameter NOT surveyed
- * 						3 - Parameter surveyed, not in file
- * 						5 - Parameter surveyed, in file 
- * 	[5]	int	DATE_CREAT	FILE CREATION DATE - YYYYMMDD  
- * 					Date data records were last altered/assimilated 
- * 	[6]	char	INST_SRC	SOURCE INSTITUTION 
- * 					Organization which collected the data or
- * 					contributor if collector not definitive. 
- * 	[7]	char 	COUNTRY 	COUNTRY  
- * 	[8]	char 	PLATFORM 	PLATFORM NAME 
- * 	[9]	int 	PLAT_TYPCO 	PLATFORM TYPE CODE 
- * 						nil – Unspecified
- * 						1 - Surface ship
- * 						2 - Submersible ship
- * 						3 – Aircraft
- * 						4 – Buoy
- * 						5 - Mobile land
- * 						6 - Fixed land
- * 						7 - Deep tow
- * 						8 - Anchored seafloor instrument
- * 						9 - Other, specify in next field 
- * 	[10]	char 	PLAT_TYP 	PLATFORM TYPE  
- * 					e.g., "Ship","Plane", "Submarine", etc. 
- * 	[11]	char 	CHIEF 		CHIEF SCIENTIST(S) 
- * 	[12]	char 	PROJECT 	PROJECT, CRUISE, LEG  
- * 					e.g., "Survops 6-69", "Indopac, Leg3" 
- * 	[13]	char 	FUNDING 	FUNDING  
- * 					i.e. agency or institution 
- * 	[14]	int 	DATE_DEP 	SURVEY DEPARTURE DATE - YYYYMMDD 
- * 	[15]	char 	PORT_DEP 	PORT OF DEPARTURE  
- * 					i.e. city, country 
- * 	[16]	int 	DATE_ARR 	SURVEY ARRIVAL DATE - YYYYMMDD 
- * 	[17]	char 	PORT_ARR 	PORT OF ARRIVAL  
- * 					i.e. city, country 
- * 	[18]	char 	NAV_INSTR 	NAVIGATION INSTRUMENTATION 
- * 					e.g. "Sat/LORAN A/Sextant" 
- * 	[19]	char 	POS_INFO 	POSITION DETERMINATION METHOD / GEODETIC DATUM 
- * 					e.g. "WGS84/Primary-Satellite, Secondary-LORAN A" 
- * 	[20]	char 	BATH_INSTR 	BATHYMETRY INSTRUMENTATION 
- * 					Include information such as frequency,
- * 					beam width, and sweep speed of recorder. 
- * 	[21]	char 	BATH_ADD 	ADDITIONAL FORMS OF BATHYMETRY 
- * 					e.g., "Microfilm","Analog records" 
- * 	[22]	char 	MAG_INSTR 	MAGNETICS INSTRUMENTATION 
- * 					e.g., "Proton Precession Mag-GEOMETRICS G-801"
- * 					or “Airborne AN/ASQ-81 scalar magnetometer,
- * 					Total Field 1 and Total Field 2 record values
- * 					are Uncorrected and Corrected”. 
- * 	[23]	char 	MAG_ADD 	ADDITIONAL FORMS OF MAGNETICS 
- * 					e.g., "punch tape","analog records" 
- * 	[24]	char 	GRAV_INSTR 	GRAVITY INSTRUMENTATION 
- * 					e.g., "L&R S-26" 
- * 	[25]	char 	GRAV_ADD 	ADDITIONAL FORMS OF GRAVITY DATA 
- * 					e.g., "Microfilm","Analog records " 
- * 	[26]	char 	SEIS_INSTR 	SEISMIC INSTRUMENTATION 
- * 					Include the size of the sound source,
- * 					the recording frequency filters, and
- * 					the number of channels e.g.,
- * 					"1700 cu. in., Airgun, 8-62 Hz, 36 Channels" 
- * 	[27]	char 	SEIS_FRMTS 	FORMATS OF SEISMIC DATA 
- * 					e.g., "Digital SEG-Y", "Mylar Sections", etc. 
- * 	[28]	float 	LAT_TOP 	NORTHBOUND LATITUDE OF SURVEY 
- * 	[29]	float 	LAT_BOTTOM 	SOUTHBOUND LATITUDE OF SURVEY 
- * 	[30]	float 	LON_LEFT 	WESTBOUND LONGITUDE OF SURVEY 
- * 					Between -180 and 180 degrees 
- * 	[31]	float 	LON_RIGHT 	EASTBOUND LONGITUDE OF SURVEY 
- * 					Between -180 and 180 degrees 
- * 	[32]	float 	BATH_DRATE 	GENERAL DIGITIZING RATE OF BATHYMETRY 
- * 					In (tenths of minutes)/minutes.  The rate
- * 					which is present within the data records;
- * 					e.g., if values were coded every 30 seconds,
- * 					set to (050)/0.5 
- * 	[33]	char 	BATH_SRATE 	GENERAL SAMPLING RATE OF BATHYMETRY  
- * 					This rate is instrumentation dependent;
- * 					e.g., "1/Second" 
- * 	[34]	float 	SOUND_VEL 	ASSUMED SOUND VELOCITY 
- * 					In meters per second. Historically, in
- * 					the U.S., this speed has been 800 fathoms/sec,
- * 					which equals 1463.3 meters/sec.; current
- * 					recorders generally have a calibration of
- * 					1500 meters/sec; e.g. 1500 
- * 	[35]	int 	VDATUM_CO 	BATHYMETRIC VERTICAL DATUM CODE - 
- * 						00 - No correction applied
- * 						01 - Lowest normal low water
- * 						02 - Mean lower low water
- * 						03 - Lowest low water
- * 						04 - Mean lower low water spring
- * 						05 - Indian spring low water
- * 						06 - Mean low water spring
- * 						07 - Mean sea level
- * 						08 - Mean low water
- * 						09 - Equatorial spring low water
- * 						10 - Tropic lower low water
- * 						11 - Lowest astronomical tide
- * 						88 - Other, specify in Add. Doc. 
- * 	[36]	char 	BATH_INTRP 	INTERPOLATION SCHEME 
- * 					This field allows for a description of
- * 					the interpolation scheme used, should
- * 					some of the data records contain interpolated
- * 					values; e.g., "5-minute intervals and peaks
- * 					and troughs" 
- * 	[37]	float 	MAG_DRATE 	GENERAL DIGITIZING RATE OF MAGNETICS  
- * 					In minutes.  The rate which is present
- * 					within the data records. 
- * 	[38]	float 	MAG_SRATE 	GENERAL SAMPLING RATE OF MAGNETICS 
- * 					In seconds.  This rate is instrumentation
- * 					dependent  e.g., if the pulse rate is
- * 					every 3 sec, set to 3 
- * 	[39]	float 	MAG_TOWDST 	MAGNETIC SENSOR TOW DISTANCE 
- * 					In meters.  The distance from the navigation
- * 					reference to the leading sensor. 
- * 	[40]	float 	MAG_SNSDEP 	SENSOR DEPTH 
- * 					In meters. This is the average depth (positive)
- * 					of the lead magnetic sensor, or flight altitude
- * 					(negative) if data is aeromagnetics. 
- * 	[41]	float 	MAG_SNSSEP 	HORIZONTAL SENSOR SEPARATION 
- * 					In meters.  Where two sensors are used. 
- * 	[42]	int 	M_REFFL_CO 	REFERENCE FIELD CODE 
- * 					This is the reference field used to determine
- * 					the residual magnetics:
- * 						00 - Unused
- * 						01 - AWC 70
- * 						02 - AWC 75
- * 						03 - IGRF-65
- * 						04 - IGRF-75
- * 						05 - GSFC-1266
- * 						06 - GSFC (POGO) 0674
- * 						07 - UK 75
- * 						08 - POGO 0368
- * 						09 - POGO 1068
- * 						10 - POGO 0869
- * 						11 - IGRF-80
- * 						12 - IGRF-85
- * 						13 - IGRF-90
- * 						14 - IGRF-95
- * 						15 - IGRF-00
- * 						16 - IGRF-05
- * 						17 - IGRF-10
- * 						18 - IGRF-11
- * 						88 - Other, specify
- * 						nil – Unspecified reference field code 
- * 	[43]	char 	MAG_REFFLD 	REFERENCE FIELD 
- * 					e.g., "IGRF-85" 
- * 	[44]	char 	MAG_RF_MTH 	METHOD OF APPLYING RESIDUAL FIELD 
- * 					The procedure used in applying this
- * 					reduction to the data; e.g.,
- * 					"Linear Interp. in 60-mile Square" 
- * 	[45]	float 	GRAV_DRATE 	GENERAL DIGITIZING RATE OF GRAVITY 
- * 					In minutes. The rate present within
- * 					the data records 
- * 	[46]	float 	GRAV_SRATE 	GENERAL SAMPLING RATE OF GRAVITY 
- * 					In seconds.  This rate is
- * 					instrumentation dependent. If recording
- * 					is continuous, set to 0 
- * 	[47]	int 	G_FORMU_CO 	THEORETICAL GRAVITY FORMULA CODE 
- * 						1 - Heiskanen 1924
- * 						2 - International 1930
- * 						3 - IAG System 1967
- * 						4 - IAG System 1980
- * 						8 - Other, specify 
- * 	[48]	char 	GRAV_FORMU 	THEORETICAL GRAVITY FORMULA  
- * 					e.g., "International '30",
- * 					"IAG System 1967", etc. 
- * 	[49]	int 	G_RFSYS_CO 	REFERENCE SYSTEM CODE 
- * 					Identifies the reference field:
- * 						1 - Local system, specify
- * 						2 - Potsdam system
- * 						3 - System IGSN 71
- * 						9 - Other, specify 
- * 	[50]	char 	GRAV_RFSYS 	REFERENCE SYSTEM 
- * 					e.g., "Potsdam System",
- * 					"System IGSN 71", etc. 
- * 	[51]	char 	GRAV_CORR 	CORRECTIONS APPLIED 
- * 					Drift, tare and bias corrections applied;
- * 					e.g. "+0.075 mgal per day 
- * 	[52]	float 	G_ST_DEP_G 	DEPARTURE BASE STATION GRAVITY 
- * 					In milligals.  At sea level - Network
- * 					value preferred. 
- * 	[53]	char 	G_ST_DEP 	DEPARTURE BASE STATION DESCRIPTION 
- * 					Indicates name and number of station 
- * 	[54]	float 	G_ST_ARR_G 	ARRIVAL BASE STATION GRAVITY 
- * 					In milligals.  At sea level - Network
- * 					value preferred. 
- * 	[55]	char 	G_ST_ARR 	ARRIVAL BASE STATION DESCRIPTION 
- * 					Indicates name and number of station 
- * 	[56]	int 	IDS_10_NUM 	NUMBER OF 10-DEGREE IDENTIFIERS  
- * 					This is the number of 4-digit 10-degree
- * 					identifiers which will follow this field,
- * 					excluding the "9999" flag. (see APPENDIX A) 
- * 	[57]	char 	IDS_10DEG 	10-DEGREE IDENTIFIERS 
- * 					A series of 4-digit codes, separated by
- * 					commas, which identify the 10-degree squares
- * 					through which the survey collected data
- * 					(see APPENDIX A). Code "9999" after last
- * 					identifier. 
- * 	[58]	 char 	ADD_DOC 	ADDITIONAL DOCUMENTATION 
- * 					Information concerning this survey not
- * 					contained in other header fields.  Embedded
- * 					End-of-Line characters are NOT ALLOWED. 
-
- * THE MGD77T DATA RECORD
- * The data record presents underway marine geophysical data in a correlative
- * manner. Geophysical data (bathymetry, magnetics, and gravity) and
- * seismic/segment identification (e.g. seismic line and shot-point ids)
- * are presented with a corresponding time and position. Documentation that
- * is variable throughout the survey also is included within each data record.
- * If primary navigation exists at a juncture where no geophysical data are
- * present, this record should be included with the data parameter fields
- * left unspecified (nil).
- * 
- * MGD77T data files for groups of surveys can be contained in a single file,
- * or in separate files (one file per survey). Generally the grouping method
- * will be the same as that of the MGD77T header files.
- * 
- * Format Conventions for the MGD77T Data Record:
- * 	1. For floating pt numbers, all decimal points are explicit
- * 		(e.g. 123.456 signifies a value of +123.456)
- * 	2. Leading zeros and blanks are discouraged in numeric fields.
- * 		Trailing blanks in numeric fields are not allowed.
- * 	3. Where float values are whole numbers, the decimal part/decimal pt
- * 		are not required. 4. In floats, trailing zeros after the last
- * 		significant digit past the decimal are not required.
- * 	5. Unspecified fields are nil (tab immediately follows previous field’s
- * 		delimiting tab).
- * 	6. All character fields should be trimmed of beginning and ending blanks.
- * 	7. Trailing tabs (trailing unspecified values) are generally omitted,
- * 		including the tab for the last specified (used) field.
- * 	8. All "corrections", such as time zone, diurnal magnetics, and Eotvos,
- * 		are understood to be added (e.g., time-zone correction is the
- * 		number of hours which must be added to the recorded time to
- * 		determine GMT).
- * 	9. For field values which differ from the definitions below, use the
- * 		Additional Documentation to describe how the values were arrived at.
- * 	10. A Column Heading record with will generally be the first record of
- * 		each data file. This can be omitted. The suggested Field Ids
- * 		of the data records should be considered, as they work well
- * 		with GEODAS and other software, and as shape file descriptors.
- * The following is a detailed description of the MGD77T Data Record. Fields
- * can be of type integer, floating point, or character. Fields that always
- * represent whole numbers are described as type int; fields that may contain
- * a decimal component are float, and fields that are alphanumeric are char.
- * 	[Field #] 	Type 	Field Id 	Description
- * 	____________________________________________________________
- *
- * 	[1]	char	SURVEY_ID	SURVEY IDENTIFIER
- * 					Identifier supplied by the contributing
- * 					organization, else given by NGDC in a
- * 					manner which represents the data.
- * 					Identical to that in MGD77/MGD77T header
- * 					record. 
- * 	[2]	float	TIMEZONE	TIME-ZONE CORRECTION 
- * 					In hours. Corrects time (in fields 3-4)
- * 					to GMT when added: equals zero when time
- * 					is GMT.  Time-zone normally falls between
- * 					-13 and +12 inclusively. 
- * 	[3]	int	DATE 		DATE (YYYYMMDD) 
- * 					e.g. 19720530 
- * 	[4]	float	TIME 		TIME 
- * 					Hours and decimal minutes
- * 					i.e. 11:59:40pm = 2359.6667 
- * 	[5]	float	LAT 		LATITUDE 
- * 					in decimal degrees + = North;
- * 					- = South Between -90 and 90 degrees 
- * 	[6]	float	LON 		LONGITUDE 
- * 					in decimal degrees + = East;
- * 					- = West Between -180 and 180 degrees 
- * 	[7]	int	POS_TYPE 	POSITION TYPE CODE 
- * 					Indicates how lat/lon was obtained:
- * 						1 = Observed fix
- * 						3 = Interpolated
- * 						nil = Unspecified 
- * 	[8]	int	NAV_QUALCO 	QUALITY CODE FOR NAVIGATION 
- * 						1 – good
- * 						2 – fair
- * 						3 – poor
- * 						4 – bad
- * 						5 – Suspected, by the originating institution
- * 						6 – Suspected, by the Data Center
- * 						nil – Unspecified
- * 					(Note: - Should Institution code the field as 1
- * 					through 5, the data center will not contradict.) 
- * 	[9]	float	BAT_TTIME 	BATHYMETRY, 2- WAY TRAVELTIME 
- * 					In seconds  Corrected for transducer depth and
- * 					other such corrections, especially in shallow water 
- * 	[10]	float	CORR_DEPTH 	BATHYMETRY, CORRECTED DEPTH 
- * 					In (positive) meters. e.g. 1234.56 
- * 	[11]	int	BAT_CPCO 	BATHYMETRIC CORRECTION CODE 
- * 					This code details the procedure used for
- * 					determining the sound velocity correction to depth:
- * 						01-55 – Matthews' Zones with zone
- * 						59 – Matthews' Zones, no zone specified
- * 						60 – S. Kuwahara Formula
- * 						61 – Wilson Formula
- * 						62 – Del Grosso Formula
- * 						63 – Carter's Tables
- * 						88 – Other (see Add. Doc.)
- * 						97 – Computed using 1500 meters/sec
- * 						98 – Unknown if Corrected nil – Unspecified 
- * 	[12]	int	BAT_TYPCO 	BATHYMETRIC TYPE CODE 
- * 					Indicates how the bathymetric value was obtained:
- * 						1 – Observed
- * 						3 – Interpolated
- * 						nil – Unspecified 
- * 	[13]	int	BAT_QUALCO 	QUALITY CODE FOR BATHYMETRY 
- * 						1 – good
- * 						2 – fair
- * 						3 – poor
- * 						4 – bad
- * 						5 – Suspected bad by Contributor
- * 						6 – Suspected bad by Data Center
- * 						nil - Unspecified 
- * 	[14]	float	MAG_TOT 	MAGNETICS TOTAL FIELD, 1ST SENSOR 
- * 					In nanoteslas; for leading sensor. Use
- * 					this field for single sensor, or for
- * 					aeromagnetics this can be the Uncorrected
- * 					Total Field value (Detail in MAGNETICS
- * 					INSTRUMENTATION header field). 
- * 	[15]	float	MAG_TOT2 	MAGNETICS TOTAL FIELD, 2ND SENSOR 
- * 					In nanoteslas; for trailing sensor, or
- * 					for aeromagnetics this can be the
- * 					Corrected Total Field value, (detail in
- * 					MAGNETICS INSTRUMENTATION and Additional
- * 					Documentation header fields). 
- * 	[16]	float	MAG_RES 	MAGNETICS RESIDUAL FIELD 
- * 					In nanoteslas; (reference field used is
- * 					in Header) 
- * 	[17]	int	MAG_RESSEN 	SENSOR FOR RESIDUAL FIELD 
- * 						1 - 1st or leading sensor
- * 						2 - 2nd or trailing sensor
- * 						nil – Unspecified (or single sensor) 
- * 	[18]	float	MAG_DICORR 	MAGNETICS DIURNAL CORRECTION - 
- * 					In nanoteslas (gammas). If nil, total and
- * 					residual fields are assumed to be
- * 					uncorrected; if used, total and residuals
- * 					are assumed to have been already corrected
- * 					with diurnal. 
- * 	[19]	int	MAG_SDEPTH 	DEPTH/ALTITUDE OF MAGNETICS SENSOR 
- * 					In meters.
- * 						+ = Below sea-level,
- * 						- = Above sea-level 
- * 	[20]	int	MAG_QUALCO 	QUALITY CODE FOR MAGNETICS 
- * 						1 – good
- * 						2 – fair
- * 						3 – poor
- * 						4 – bad
- * 						5 – Suspected bad by Contributor
- * 						6 – Suspected bad by Data Center
- * 						nil - Unspecified 
- * 	[21]	float	GRA_OBS 	OBSERVED GRAVITY 
- * 					In milligals  Corrected for Eotvos,
- * 					drift, and tares 
- * 	[22]	float	EOTVOS 		EOTVOS CORRECTION 
- * 					In milligals
- * 						E = 7.5 V cos(phi) * sin(alpha)
- * 							+ 0.0042 V*V 
- * 	[23]	float	FREEAIR 	FREE-AIR ANOMALY 
- * 					In milligals
- * 						Free-air Anomaly = G(observed)
- * 							minus G(theoretical) 
- * 	[24]	int	GRA_QUALCO 	QUALITY CODE FOR GRAVITY 
- * 						1 – good
- * 						2 – fair
- * 						3 – poor
- * 						4 – bad
- * 						5 – Suspected bad by Contributor
- * 						6 – Suspected bad by Data Center
- * 						nil - Unspecified 
- * 	[25]	int	LINEID 		LINE/TRACK/SEGMENT ID 
- * 					Used, for example, to cross reference
- * 					with seismic data. 
- * 	[26]	int	POINTID 	SEISMIC SHOT-POINT NUMBER/POINT ID 
- *
- * ___________________________________________________________
- * 
- * 10-DEGREE-SQUARE IDENTIFIER CODE 
- * A 10-degree-square area can be easily identified by constructing a four-digit
- * number.  The components of this number, in order of their construction are
- * described as follows: 
- * Quadrant - A one-digit number identifies the quadrant of the world with the
- * following significance to each digit: 
- *   1st digit = Quadrant number 
- *   Qc Code	Latitude	Longitude 
- *   _______ 	________	_________ 
- *     1         North		East 
- *     3         South		East 
- *     5         South		West 
- *     7         North		West 
- * 10-Degree Square - The next three digits identify a unique 10-degree square;
- * thus the significant digits consist of: 
- *	2nd digit = Tens digit of degrees latitude 
- *      3rd digit = Hundreds digit of degrees longitude  
- *      4th digit = Tens digit of degrees longitude 
- *  
- * 10-DEGREE SQ IDENT. CODE  
- * ________________________ 
- * 	Example Quad Lat Long Long 
- * 	37 deg 48'S, 	4 deg 13'E 	3 3 0 0 
- * 	21.6 deg S, 	14.3 deg W 	5 2 0 1 
- * 	34 deg 28'N, 	143 deg 27'W 	7 3 1 4 
- * 	75 deg N, 	43 deg E 	1 7 0 4 
- * ___________________________________________________________
- */
-
-/* header and data record in bytes */
-#define MBF_MGD77TAB_HEADER_FIELDS	58
-#define MBF_MGD77TAB_DATA_FIELDS	26
-
-struct mbf_mgd77tab_struct
-	{
-	/* type of data record */
-	int	kind;
-
-	/* data record flags */
-	int	defined_survey_id;
-	int	defined_timezone;
-	int	defined_date;
-	int	defined_time;
-	int	defined_lat;
-	int	defined_lon;
-	int	defined_pos_type;
-	int	defined_nav_qualco;
-	int	defined_bat_ttime;
-	int	defined_corr_depth;
-	int	defined_bat_cpco;
-	int	defined_bat_typco;
-	int	defined_bat_qualco;
-	int	defined_mag_tot;
-	int	defined_mag_tot2;
-	int	defined_mag_res;
-	int	defined_mag_ressen;
-	int	defined_mag_dicorr;
-	int	defined_mag_sdepth;
-	int	defined_mag_qualco;
-	int	defined_gra_obs;
-	int	defined_eotvos;
-	int	defined_freeair;
-	int	defined_gra_qualco;
-	int	defined_lineid;
-	int	defined_pointid;
-	int	last_field_defined;
-
-	/* data record values */
-	char	survey_id[8]; 	/* survey identifier
-					identifier supplied by the contributing
-					organization, else given by ngdc in a
-					manner which represents the data.
-					identical to that in mgd77/mgd77t header
-					record. */
-
-	float	timezone;   	/* time-zone correction 
-					in hours. corrects time (in fields 3-4)
-					to gmt when added: equals zero when time
-					is gmt.  time-zone normally falls between
-					-13 and +12 inclusively. */
-	int	date;		/* date (yyyymmdd) e.g. 19720530 */
-	float	time;		/* time hours and decimal minutes
-					i.e. 11:59:40pm = 2359.6667 */
-	float	lat;		/* latitude 
-					in decimal degrees + = north;
-					- = south between -90 and 90 degrees  */
-	float	lon;		/* longitude 
-					in decimal degrees + = east;
-					- = west between -180 and 180 degrees  */
-	int	pos_type;	/* position type code 
-					indicates how lat/lon was obtained:
-						1 = observed fix
-						3 = interpolated
-						nil = unspecified  */
-	int	nav_qualco;	/* quality code for navigation 
-						1 – good
-						2 – fair
-						3 – poor
-						4 – bad
- 						5 – suspected, by the originating institution
- 						6 – suspected, by the data center
- 						nil – unspecified
-					(note: - should institution code the field as 1
-					through 5, the data center will not contradict.)  */
-	float	bat_ttime; 	/* bathymetry, 2- way traveltime 
-					in seconds  corrected for transducer depth and
-					other such corrections, especially in shallow water  */
-	float	corr_depth; 	/* bathymetry, corrected depth 
- 					in (positive) meters. e.g. 1234.56  */
-	int	bat_cpco; 	/* bathymetric correction code 
- 					this code details the procedure used for
- 					determining the sound velocity correction to depth:
- 						01-55 – matthews' zones with zone
- 						59 – matthews' zones, no zone specified
- 						60 – s. kuwahara formula
- 						61 – wilson formula
- 						62 – del grosso formula
- 						63 – carter's tables
- 						88 – other (see add. doc.)
- 						97 – computed using 1500 meters/sec
- 						98 – unknown if corrected nil – unspecified  */
-	int	bat_typco; 	/* bathymetric type code 
- 					indicates how the bathymetric value was obtained:
- 						1 – observed
- 						3 – interpolated
- 						nil – unspecified  */
-	int	bat_qualco; 	/* quality code for bathymetry 
- 						1 – good
- 						2 – fair
- 						3 – poor
- 						4 – bad
- 						5 – suspected bad by contributor
- 						6 – suspected bad by data center
- 						nil - unspecified  */
-	float	mag_tot; 	/* magnetics total field, 1st sensor 
- 					in nanoteslas; for leading sensor. use
- 					this field for single sensor, or for
- 					aeromagnetics this can be the uncorrected
- 					total field value (detail in magnetics
- 					instrumentation header field).  */
-	float	mag_tot2; 	/* magnetics total field, 2nd sensor 
- 					in nanoteslas; for trailing sensor, or
- 					for aeromagnetics this can be the
- 					corrected total field value, (detail in
- 					magnetics instrumentation and additional
- 					documentation header fields).  */
-	float	mag_res; 	/* magnetics residual field 
- 					in nanoteslas; (reference field used is
- 					in header)  */
-	int	mag_ressen; 	/* sensor for residual field 
- 						1 - 1st or leading sensor
- 						2 - 2nd or trailing sensor
- 						nil – unspecified (or single sensor)  */
-	float	mag_dicorr; 	/* magnetics diurnal correction - 
- 					in nanoteslas (gammas). if nil, total and
- 					residual fields are assumed to be
- 					uncorrected; if used, total and residuals
- 					are assumed to have been already corrected
- 					with diurnal.  */
-	int	mag_sdepth; 	/* depth/altitude of magnetics sensor 
- 					in meters.
- 						+ = below sea-level,
- 						- = above sea-level  */
-	int	mag_qualco; 	/* quality code for magnetics 
- 						1 – good
- 						2 – fair
- 						3 – poor
- 						4 – bad
- 						5 – suspected bad by contributor
- 						6 – suspected bad by data center
- 						nil - unspecified  */
-	float	gra_obs; 	/* observed gravity 
- 					in milligals  corrected for eotvos,
- 					drift, and tares  */
-	float	eotvos; 		/* eotvos correction 
- 					in milligals
- 						e = 7.5 v cos(phi) * sin(alpha)
- 							+ 0.0042 v*v  */
-	float	freeair; 	/* free-air anomaly 
- 					in milligals
- 						free-air anomaly = g(observed)
- 							minus g(theoretical)  */
- 	int	gra_qualco; 	/* quality code for gravity 
- 						1 – good
- 						2 – fair
- 						3 – poor
- 						4 – bad
- 						5 – suspected bad by contributor
- 						6 – suspected bad by data center
- 						nil - unspecified  */
-	int	lineid; 		/* line/track/segment id 
- 					used, for example, to cross reference
- 					with seismic data.  */
-	int	pointid; 	/* seismic shot-point number/point id */
-
-	/* comment */
-	char	comment[MB_COMMENT_MAXLINE];
-	};
-
-/* essential function prototypes */
-int mbr_register_mgd77tab(int verbose, void *mbio_ptr,
-		int *error);
-int mbr_info_mgd77tab(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_alm_mgd77tab(int verbose, void *mbio_ptr, int *error);
-int mbr_dem_mgd77tab(int verbose, void *mbio_ptr, int *error);
-int mbr_rt_mgd77tab(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_wt_mgd77tab(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_mgd77tab_rd_data(int verbose, void *mbio_ptr, int *error);
-int mbr_mgd77tab_wr_data(int verbose, void *mbio_ptr, void *data_ptr, int *error);
-
-static char rcs_id[]="$Id: mbr_mgd77tab.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mbr_register_mgd77tab(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_register_mgd77tab";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* get mb_io_ptr */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set format info parameters */
-	status = mbr_info_mgd77tab(verbose,
-			&mb_io_ptr->system,
-			&mb_io_ptr->beams_bath_max,
-			&mb_io_ptr->beams_amp_max,
-			&mb_io_ptr->pixels_ss_max,
-			mb_io_ptr->format_name,
-			mb_io_ptr->system_name,
-			mb_io_ptr->format_description,
-			&mb_io_ptr->numfile,
-			&mb_io_ptr->filetype,
-			&mb_io_ptr->variable_beams,
-			&mb_io_ptr->traveltime,
-			&mb_io_ptr->beam_flagging,
-			&mb_io_ptr->nav_source,
-			&mb_io_ptr->heading_source,
-			&mb_io_ptr->vru_source,
-			&mb_io_ptr->svp_source,
-			&mb_io_ptr->beamwidth_xtrack,
-			&mb_io_ptr->beamwidth_ltrack,
-			error);
-
-	/* set format and system specific function pointers */
-	mb_io_ptr->mb_io_format_alloc = &mbr_alm_mgd77tab;
-	mb_io_ptr->mb_io_format_free = &mbr_dem_mgd77tab;
-	mb_io_ptr->mb_io_store_alloc = &mbsys_singlebeam_alloc;
-	mb_io_ptr->mb_io_store_free = &mbsys_singlebeam_deall;
-	mb_io_ptr->mb_io_read_ping = &mbr_rt_mgd77tab;
-	mb_io_ptr->mb_io_write_ping = &mbr_wt_mgd77tab;
-	mb_io_ptr->mb_io_dimensions = &mbsys_singlebeam_dimensions;
-	mb_io_ptr->mb_io_extract = &mbsys_singlebeam_extract;
-	mb_io_ptr->mb_io_insert = &mbsys_singlebeam_insert;
-	mb_io_ptr->mb_io_extract_nav = &mbsys_singlebeam_extract_nav;
-	mb_io_ptr->mb_io_insert_nav = &mbsys_singlebeam_insert_nav;
-	mb_io_ptr->mb_io_extract_altitude = &mbsys_singlebeam_extract_altitude;
-	mb_io_ptr->mb_io_insert_altitude = NULL;
-	mb_io_ptr->mb_io_extract_svp = NULL;
-	mb_io_ptr->mb_io_insert_svp = NULL;
-	mb_io_ptr->mb_io_ttimes = &mbsys_singlebeam_ttimes;
-	mb_io_ptr->mb_io_detects = &mbsys_singlebeam_detects;
-	mb_io_ptr->mb_io_copyrecord = &mbsys_singlebeam_copy;
-	mb_io_ptr->mb_io_extract_rawss = NULL;
-	mb_io_ptr->mb_io_insert_rawss = NULL;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",mb_io_ptr->system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",mb_io_ptr->beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",mb_io_ptr->beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",mb_io_ptr->pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",mb_io_ptr->format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",mb_io_ptr->system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",mb_io_ptr->format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",mb_io_ptr->numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",mb_io_ptr->filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",mb_io_ptr->variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",mb_io_ptr->traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",mb_io_ptr->beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",mb_io_ptr->nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",mb_io_ptr->heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",mb_io_ptr->vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",mb_io_ptr->svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",mb_io_ptr->beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",mb_io_ptr->beamwidth_ltrack);
-		fprintf(stderr,"dbg2       format_alloc:       %p\n",(void *)mb_io_ptr->mb_io_format_alloc);
-		fprintf(stderr,"dbg2       format_free:        %p\n",(void *)mb_io_ptr->mb_io_format_free);
-		fprintf(stderr,"dbg2       store_alloc:        %p\n",(void *)mb_io_ptr->mb_io_store_alloc);
-		fprintf(stderr,"dbg2       store_free:         %p\n",(void *)mb_io_ptr->mb_io_store_free);
-		fprintf(stderr,"dbg2       read_ping:          %p\n",(void *)mb_io_ptr->mb_io_read_ping);
-		fprintf(stderr,"dbg2       write_ping:         %p\n",(void *)mb_io_ptr->mb_io_write_ping);
-		fprintf(stderr,"dbg2       extract:            %p\n",(void *)mb_io_ptr->mb_io_extract);
-		fprintf(stderr,"dbg2       insert:             %p\n",(void *)mb_io_ptr->mb_io_insert);
-		fprintf(stderr,"dbg2       extract_nav:        %p\n",(void *)mb_io_ptr->mb_io_extract_nav);
-		fprintf(stderr,"dbg2       insert_nav:         %p\n",(void *)mb_io_ptr->mb_io_insert_nav);
-		fprintf(stderr,"dbg2       extract_altitude:   %p\n",(void *)mb_io_ptr->mb_io_extract_altitude);
-		fprintf(stderr,"dbg2       insert_altitude:    %p\n",(void *)mb_io_ptr->mb_io_insert_altitude);
-		fprintf(stderr,"dbg2       extract_svp:        %p\n",(void *)mb_io_ptr->mb_io_extract_svp);
-		fprintf(stderr,"dbg2       insert_svp:         %p\n",(void *)mb_io_ptr->mb_io_insert_svp);
-		fprintf(stderr,"dbg2       ttimes:             %p\n",(void *)mb_io_ptr->mb_io_ttimes);
-		fprintf(stderr,"dbg2       detects:            %p\n",(void *)mb_io_ptr->mb_io_detects);
-		fprintf(stderr,"dbg2       extract_rawss:      %p\n",(void *)mb_io_ptr->mb_io_extract_rawss);
-		fprintf(stderr,"dbg2       insert_rawss:       %p\n",(void *)mb_io_ptr->mb_io_insert_rawss);
-		fprintf(stderr,"dbg2       copyrecord:         %p\n",(void *)mb_io_ptr->mb_io_copyrecord);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbr_info_mgd77tab(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error)
-{
-	char	*function_name = "mbr_info_mgd77tab";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* set format info parameters */
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-	*system = MB_SYS_SINGLEBEAM;
-	*beams_bath_max = 1;
-	*beams_amp_max = 0;
-	*pixels_ss_max = 0;
-	strncpy(format_name, "MGD77TAB", MB_NAME_LENGTH);
-	strncpy(system_name, "SINGLEBEAM", MB_NAME_LENGTH);
-	strncpy(format_description, "Format name:          MBF_MGD77TAB\nInformal Description: NGDC MGD77 underway geophysics format\nAttributes:           single beam bathymetry, nav, magnetics, gravity,\n                      122 byte ascii records with CRLF line breaks, NOAA NGDC\n", MB_DESCRIPTION_LENGTH);
-	*numfile = 1;
-	*filetype = MB_FILETYPE_NORMAL;
-	*variable_beams = MB_NO;
-	*traveltime = MB_YES;
-	*beam_flagging = MB_NO;
-	*nav_source = MB_DATA_DATA;
-	*heading_source = MB_DATA_DATA;
-	*vru_source = MB_DATA_DATA;
-	*svp_source = MB_DATA_NONE;
-	*beamwidth_xtrack = 0.0;
-	*beamwidth_ltrack = 0.0;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",*system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",*beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",*beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",*pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",*numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",*filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",*variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",*traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",*beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",*nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",*heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",*vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",*svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",*beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",*beamwidth_ltrack);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_alm_mgd77tab(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_alm_mgd77tab";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_mgd77tab_struct *data;
-	char	*data_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set initial status */
-	status = MB_SUCCESS;
-
-	/* allocate memory for data structure */
-	mb_io_ptr->structure_size = sizeof(struct mbf_mgd77tab_struct);
-	mb_io_ptr->data_structure_size = 0;
-	status = mb_malloc(verbose,mb_io_ptr->structure_size,
-				&mb_io_ptr->raw_data,error);
-	status = mb_malloc(verbose,sizeof(struct mbsys_singlebeam_struct),
-				&mb_io_ptr->store_data,error);
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-	data = (struct mbf_mgd77tab_struct *) mb_io_ptr->raw_data;
-	data_ptr = (char *) data;
-
-	/* set number of header records read to zero */
-	mb_io_ptr->save1 = 0;
-
-	/* initialize everything to zeros */
-	memset(data_ptr, 0, sizeof(struct mbf_mgd77tab_struct));
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_dem_mgd77tab(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_dem_mgd77tab";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* deallocate memory for data descriptor */
-	status = mb_free(verbose,&mb_io_ptr->raw_data,error);
-	status = mb_free(verbose,&mb_io_ptr->store_data,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_rt_mgd77tab(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_rt_mgd77tab";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_mgd77tab_struct *data;
-	struct mbsys_singlebeam_struct *store;
-	double	minutes;
-	double	seconds;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointers to mbio descriptor and data structures */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-	data = (struct mbf_mgd77tab_struct *) mb_io_ptr->raw_data;
-	store = (struct mbsys_singlebeam_struct *) store_ptr;
-
-	/* read next data from file */
-	status = mbr_mgd77tab_rd_data(verbose,mbio_ptr,error);
-
-	/* set error and kind in mb_io_ptr */
-	mb_io_ptr->new_error = *error;
-	mb_io_ptr->new_kind = data->kind;
-
-	/* translate values to data storage structure */
-	if (status == MB_SUCCESS
-		&& store != NULL)
-		{
-		/* record kind */
-		store->kind = data->kind;
-		
-		/* survey id */
-		for (i=0;i<8;i++)
-		    store->survey_id[i] = data->survey_id[i];
-		
-		/* get MB-System time values from the MGD77T date, time, and timezone values */
-		store->time_i[0] = (int)(data->date / 10000);
-		store->time_i[1] = (int)((data->date - 10000 * store->time_i[0]) / 100);
-		store->time_i[2] = (int)(data->date - 10000 * store->time_i[0]
-							- 100 * store->time_i[1]);
-		store->time_i[3] = (int)floor(data->time / 100.0);
-		minutes = data->time - 100.0 * store->time_i[3];
-		store->time_i[4] = (int)floor(minutes);
-		seconds = (minutes - store->time_i[4]) * 60.0;
-		store->time_i[5] = (int)floor(seconds);
-		store->time_i[6] = (int)((seconds - store->time_i[5]) * 1000000);
-		mb_get_time(verbose, store->time_i, &store->time_d);
-		store->timezone = (int)round(data->timezone);
-		store->time_d += 3600.0 * store->timezone;
-		mb_get_date(verbose, store->time_d, store->time_i);
-		
-		/* position data */
-		store->longitude = data->lon;
-		store->latitude = data->lat;
-		store->nav_type = data->pos_type;
-		store->nav_quality = data->nav_qualco;
-		
-		/* bathymetry data */
-		if (data->corr_depth == 0.0)
-			store->flag = MB_FLAG_NULL;
-		else if (data->bat_qualco <= 1)
-			store->flag = MB_FLAG_NONE;
-		else
-			store->flag = MB_FLAG_FLAG + MB_FLAG_MANUAL;
-		store->tt = data->bat_ttime;
-		store->bath = data->corr_depth;
-		store->bath_corr = data->bat_cpco;
-		store->bath_type = data->bat_typco;
-		
-		/* magnetic data */
-		store->mag_tot_1 = data->mag_tot;
-		store->mag_tot_2 = data->mag_tot2;
-		store->mag_res = data->mag_res;
-		store->mag_res_sensor = data->mag_ressen;
-		store->mag_diurnal = data->mag_dicorr;
-		store->mag_altitude = data->mag_sdepth;
-		store->mag_qualco = data->mag_qualco;
-		
-		/* gravity data */
-		store->gravity = data->gra_obs;
-		store->eotvos = data->eotvos;
-		store->free_air = data->freeair;
-		store->gra_qualco = data->gra_qualco;
-		
-		store->seismic_line = data->lineid;
-		store->seismic_shot = data->pointid;
-		
-		for (i=0;i<MB_COMMENT_MAXLINE;i++)
-		    store->comment[i] = data->comment[i];
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_wt_mgd77tab(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_wt_mgd77tab";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_mgd77tab_struct *data;
-	struct mbsys_singlebeam_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_mgd77tab_struct *) mb_io_ptr->raw_data;
-	store = (struct mbsys_singlebeam_struct *) store_ptr;
-
-	/* first translate values from data storage structure */
-	if (store != NULL)
-		{
-		/* record kind */
-		data->kind = store->kind;
-		
-		/* survey id */
-		for (i=0;i<8;i++)
-		    data->survey_id[i] = store->survey_id[i];
-		
-		/* get MB-System time values from the MGD77T date, time, and timezone values */
-		data->date = store->time_i[0] * 10000 + store->time_i[1] * 100 + store->time_i[2];
-		data->time = store->time_i[3] * 100.0 + store->time_i[4]
-				+ store->time_i[5] / 3600.0
-				+ store->time_i[6] / 3600.0 / 1000000.0;
-		
-		/* position data */
-		data->lon = store->longitude;
-		data->lat = store->latitude;
-		data->pos_type = store->nav_type;
-		data->nav_qualco = store->nav_quality;
-		
-		/* bathymetry data */
-		if (mb_beam_check_flag_null(store->flag))
-			{
-			data->bat_qualco = 0;
-			data->corr_depth = 0.0;
-			}
-		else if (mb_beam_ok(store->flag))
-			data->bat_qualco = 1;
-		else
-			data->bat_qualco = 4;
-		store->tt = data->bat_ttime;
-		data->corr_depth = store->bath;
-		data->bat_cpco = store->bath_corr;
-		data->bat_typco = store->bath_type;
-		
-		/* magnetic data */
-		data->mag_tot = store->mag_tot_1;
-		data->mag_tot2 = store->mag_tot_2;
-		data->mag_res = store->mag_res;
-		data->mag_ressen = store->mag_res_sensor;
-		data->mag_dicorr = store->mag_diurnal;
-		data->mag_sdepth = store->mag_altitude;
-		data->mag_qualco = store->mag_qualco;
-		
-		/* gravity data */
-		data->gra_obs = store->gravity;
-		data->eotvos = store->eotvos;
-		data->freeair = store->free_air;
-		data->gra_qualco = store->gra_qualco;
-		
-		data->lineid = store->seismic_line;
-		data->pointid = store->seismic_shot;
-		
-		for (i=0;i<MB_COMMENT_MAXLINE;i++)
-		    data->comment[i] = store->comment[i];
-		    
-		/* check for valid fields */
-		data->last_field_defined = 0;
-		if (strlen(data->survey_id) > 0)
-			{
-			data->defined_survey_id = MB_YES;
-			data->last_field_defined = 0;
-			}
-		if (data->timezone != 0.0)
-			{
-			data->defined_timezone = MB_YES;
-			data->last_field_defined = 1;
-			}
-		if (data->date != 0)
-			{
-			data->defined_date = MB_YES;
-			data->last_field_defined = 2;
-			}
-		if (data->time != 0.0)
-			{
-			data->defined_time = MB_YES;
-			data->last_field_defined = 3;
-			}
-		if (data->lat != 0.0)
-			{
-			data->defined_lat = MB_YES;
-			data->last_field_defined = 4;
-			}
-		if (data->lon != 0.0)
-			{
-			data->defined_lon = MB_YES;
-			data->last_field_defined = 5;
-			}
-		if (data->pos_type != 0)
-			{
-			data->defined_pos_type = MB_YES;
-			data->last_field_defined = 6;
-			}
-		if (data->nav_qualco != 0)
-			{
-			data->defined_nav_qualco = MB_YES;
-			data->last_field_defined = 7;
-			}
-		if (data->bat_ttime != 0.0)
-			{
-			data->defined_bat_ttime = MB_YES;
-			data->last_field_defined = 8;
-			}
-		if (data->corr_depth != 0.0)
-			{
-			data->defined_corr_depth = MB_YES;
-			data->last_field_defined = 9;
-			}
-		if (data->bat_cpco != 0)
-			{
-			data->defined_bat_cpco = MB_YES;
-			data->last_field_defined = 10;
-			}
-		if (data->bat_typco != 0)
-			{
-			data->defined_bat_typco = MB_YES;
-			data->last_field_defined = 11;
-			}
-		if (data->bat_qualco != 0)
-			{
-			data->defined_bat_qualco = MB_YES;
-			data->last_field_defined = 12;
-			}
-		if (data->mag_tot != 0.0)
-			{
-			data->defined_mag_tot = MB_YES;
-			data->last_field_defined = 13;
-			}
-		if (data->mag_tot2 != 0.0)
-			{
-			data->defined_mag_tot2 = MB_YES;
-			data->last_field_defined = 14;
-			}
-		if (data->mag_res != 0.0)
-			{
-			data->defined_mag_res = MB_YES;
-			data->last_field_defined = 15;
-			}
-		if (data->mag_ressen != 0)
-			{
-			data->defined_mag_ressen = MB_YES;
-			data->last_field_defined = 16;
-			}
-		if (data->mag_dicorr != 0.0)
-			{
-			data->defined_mag_dicorr = MB_YES;
-			data->last_field_defined = 17;
-			}
-		if (data->mag_sdepth != 0)
-			{
-			data->defined_mag_sdepth = MB_YES;
-			data->last_field_defined = 18;
-			}
-		if (data->mag_qualco != 0)
-			{
-			data->defined_mag_qualco = MB_YES;
-			data->last_field_defined = 19;
-			}
-		if (data->gra_obs != 0.0)
-			{
-			data->defined_gra_obs = MB_YES;
-			data->last_field_defined = 20;
-			}
-		if (data->eotvos != 0.0)
-			{
-			data->defined_eotvos = MB_YES;
-			data->last_field_defined = 21;
-			}
-		if (data->freeair != 0.0)
-			{
-			data->defined_freeair = MB_YES;
-			data->last_field_defined = 22;
-			}
-		if (data->gra_qualco != 0)
-			{
-			data->defined_gra_qualco = MB_YES;
-			data->last_field_defined = 23;
-			}
-		if (data->lineid != 0)
-			{
-			data->defined_lineid = MB_YES;
-			data->last_field_defined = 24;
-			}
-		if (data->pointid != 0)
-			{
-			data->defined_pointid = MB_YES;
-			data->last_field_defined = 25;
-			}
-		}
-
-	/* write next data to file */
-	status = mbr_mgd77tab_wr_data(verbose,mbio_ptr,(void *)data,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_mgd77tab_rd_data(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_mgd77tab_rd_data";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_mgd77tab_struct *data;
-	int	*header_read;
-	char	line[MB_COMMENT_MAXLINE];
-	int	line_len;
-	char	*read_ptr;
-	int	ntabs;
-	int	nfields, ifield;
-	char	*fields[MBF_MGD77TAB_HEADER_FIELDS];
-	int	nscan;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_mgd77tab_struct *) mb_io_ptr->raw_data;
-	header_read = (int *) &mb_io_ptr->save1;
-
-	/* set file position */
-	mb_io_ptr->file_bytes = ftell(mb_io_ptr->mbfp);
-	mb_io_ptr->file_pos = mb_io_ptr->file_bytes;
-
-	/* read next record */
-	if ((read_ptr = fgets(line, MB_PATH_MAXLINE, mb_io_ptr->mbfp)) != NULL)
-		{
-		mb_io_ptr->file_bytes += strlen(line);
-		status = MB_SUCCESS;
-		*error = MB_ERROR_NO_ERROR;
-		}
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-	mb_io_ptr->file_bytes = ftell(mb_io_ptr->mbfp);
-	
-	/* parse the record */
-	if (status == MB_SUCCESS && strlen(line) > 0)
-		{
-		/* count the number of tabs in the line */
-		line_len = strlen(line);
-		ntabs = 0;
-		for (i=0;i<line_len;i++)
-			{
-			if (line[i] == '\t')
-				ntabs++;
-			}
-		
-		/* first check for comment */
-		if (line[0] == '#')
-			{
-			data->kind = MB_DATA_COMMENT;
-			strncpy(data->comment, &line[1], line_len-3);
-			data->comment[line_len-3] = '\0';
-			}
-		
-		/* else check for header lines */
-		else if (strncmp(line, "SURVEY_ID", 9) == 0 || ntabs > 26)
-			{
-			data->kind = MB_DATA_HEADER;
-			strncpy(data->comment, line, line_len-2);
-			data->comment[line_len-2] = '\0';
-			}
-			
-		/* else parse data record */
-		else if (ntabs > 0)
-			{
-			data->kind = MB_DATA_DATA;
-			
-			/* break line up into null-terminated fields
-				- keep array of pointers to the start of each field */
-			nfields = 0;
-			fields[nfields] = &line[0];
-			nfields++;
-			for (i=0;i<line_len-2;i++)
-				{
-				if (line[i] == '\t')
-					{
-					line[i] = '\0';
-					fields[nfields] = &line[i+1];
-					nfields++;
-					}
-				}
-			
-			/* now parse field 0 of the 26 expected fields */
-			data->last_field_defined = 0;
-			ifield = 0;
-			if (nfields > ifield && strlen(fields[ifield]) > 0)
-				{
-				data->defined_survey_id = MB_NO;
-				nscan = sscanf(fields[ifield], "%s", data->survey_id);
-				if (nscan == 1)
-					{
-					data->defined_survey_id = MB_YES;
-					data->last_field_defined = ifield;
-					}
-				}
-
-			/* now parse field 1 of the 26 expected fields */
-			ifield = 1;
-			if (nfields > ifield && strlen(fields[ifield]) > 0)
-				{
-				data->defined_timezone = MB_NO;
-				nscan = sscanf(fields[ifield], "%f", &data->timezone);
-				if (nscan == 1)
-					{
-					data->defined_timezone = MB_YES;
-					data->last_field_defined = ifield;
-					}
-				}
-
-			/* now parse field 2 of the 26 expected fields */
-			ifield = 2;
-			if (nfields > ifield && strlen(fields[ifield]) > 0)
-				{
-				data->defined_date = MB_NO;
-				nscan = sscanf(fields[ifield], "%d", &data->date);
-				if (nscan == 1)
-					{
-					data->defined_date = MB_YES;
-					data->last_field_defined = ifield;
-					}
-				}
-
-			/* now parse field 3 of the 26 expected fields */
-			ifield = 3;
-			if (nfields > ifield && strlen(fields[ifield]) > 0)
-				{
-				data->defined_time = MB_NO;
-				nscan = sscanf(fields[ifield], "%f", &data->time);
-				if (nscan == 1)
-					{
-					data->defined_time = MB_YES;
-					data->last_field_defined = ifield;
-					}
-				}
-
-			/* now parse field 4 of the 26 expected fields */
-			ifield = 4;
-			if (nfields > ifield && strlen(fields[ifield]) > 0)
-				{
-				data->defined_lat = MB_NO;
-				nscan = sscanf(fields[ifield], "%f", &data->lat);
-				if (nscan == 1)
-					{
-					data->defined_lat = MB_YES;
-					data->last_field_defined = ifield;
-					}
-				}
-
-			/* now parse field 5 of the 26 expected fields */
-			ifield = 5;
-			if (nfields > ifield && strlen(fields[ifield]) > 0)
-				{
-				data->defined_lon = MB_NO;
-				nscan = sscanf(fields[ifield], "%f", &data->lon);
-				if (nscan == 1)
-					{
-					data->defined_lon = MB_YES;
-					data->last_field_defined = ifield;
-					}
-				}
-
-			/* now parse field 6 of the 26 expected fields */
-			ifield = 6;
-			if (nfields > ifield && strlen(fields[ifield]) > 0)
-				{
-				data->defined_pos_type = MB_NO;
-				nscan = sscanf(fields[ifield], "%d", &data->pos_type);
-				if (nscan == 1)
-					{
-					data->defined_pos_type = MB_YES;
-					data->last_field_defined = ifield;
-					}
-				}
-
-			/* now parse field 7 of the 26 expected fields */
-			ifield = 7;
-			if (nfields > ifield && strlen(fields[ifield]) > 0)
-				{
-				data->defined_nav_qualco = MB_NO;
-				nscan = sscanf(fields[ifield], "%d", &data->nav_qualco);
-				if (nscan == 1)
-					{
-					data->defined_nav_qualco = MB_YES;
-					data->last_field_defined = ifield;
-					}
-				}
-
-			/* now parse field 8 of the 26 expected fields */
-			ifield = 8;
-			if (nfields > ifield && strlen(fields[ifield]) > 0)
-				{
-				data->defined_bat_ttime = MB_NO;
-				nscan = sscanf(fields[ifield], "%f", &data->bat_ttime);
-				if (nscan == 1)
-					{
-					data->defined_bat_ttime = MB_YES;
-					data->last_field_defined = ifield;
-					}
-				}
-
-			/* now parse field 9 of the 26 expected fields */
-			ifield = 9;
-			if (nfields > ifield && strlen(fields[ifield]) > 0)
-				{
-				data->defined_corr_depth = MB_NO;
-				nscan = sscanf(fields[ifield], "%f", &data->corr_depth);
-				if (nscan == 1)
-					{
-					data->defined_corr_depth = MB_YES;
-					data->last_field_defined = ifield;
-					}
-				}
-
-			/* now parse field 10 of the 26 expected fields */
-			ifield = 10;
-			if (nfields > ifield && strlen(fields[ifield]) > 0)
-				{
-				data->defined_bat_cpco = MB_NO;
-				nscan = sscanf(fields[ifield], "%d", &data->bat_cpco);
-				if (nscan == 1)
-					{
-					data->defined_bat_cpco = MB_YES;
-					data->last_field_defined = ifield;
-					}
-				}
-
-			/* now parse field 11 of the 26 expected fields */
-			ifield = 11;
-			if (nfields > ifield && strlen(fields[ifield]) > 0)
-				{
-				data->defined_bat_typco = MB_NO;
-				nscan = sscanf(fields[ifield], "%d", &data->bat_typco);
-				if (nscan == 1)
-					{
-					data->defined_bat_typco = MB_YES;
-					data->last_field_defined = ifield;
-					}
-				}
-
-			/* now parse field 12 of the 26 expected fields */
-			ifield = 12;
-			if (nfields > ifield && strlen(fields[ifield]) > 0)
-				{
-				data->defined_bat_qualco = MB_NO;
-				nscan = sscanf(fields[ifield], "%d", &data->bat_qualco);
-				if (nscan == 1)
-					{
-					data->defined_bat_qualco = MB_YES;
-					data->last_field_defined = ifield;
-					}
-				}
-
-			/* now parse field 13 of the 26 expected fields */
-			ifield = 13;
-			if (nfields > ifield && strlen(fields[ifield]) > 0)
-				{
-				data->defined_mag_tot = MB_NO;
-				nscan = sscanf(fields[ifield], "%f", &data->mag_tot);
-				if (nscan == 1)
-					{
-					data->defined_mag_tot = MB_YES;
-					data->last_field_defined = ifield;
-					}
-				}
-
-			/* now parse field 14 of the 26 expected fields */
-			ifield = 14;
-			if (nfields > ifield && strlen(fields[ifield]) > 0)
-				{
-				data->defined_mag_tot2 = MB_NO;
-				nscan = sscanf(fields[ifield], "%f", &data->mag_tot2);
-				if (nscan == 1)
-					{
-					data->defined_mag_tot2 = MB_YES;
-					data->last_field_defined = ifield;
-					}
-				}
-
-			/* now parse field 15 of the 26 expected fields */
-			ifield = 15;
-			if (nfields > ifield && strlen(fields[ifield]) > 0)
-				{
-				data->defined_mag_res = MB_NO;
-				nscan = sscanf(fields[ifield], "%f", &data->mag_res);
-				if (nscan == 1)
-					{
-					data->defined_mag_res = MB_YES;
-					data->last_field_defined = ifield;
-					}
-				}
-
-			/* now parse field 16 of the 26 expected fields */
-			ifield = 16;
-			if (nfields > ifield && strlen(fields[ifield]) > 0)
-				{
-				data->defined_mag_ressen = MB_NO;
-				nscan = sscanf(fields[ifield], "%d", &data->mag_ressen);
-				if (nscan == 1)
-					{
-					data->defined_mag_ressen = MB_YES;
-					data->last_field_defined = ifield;
-					}
-				}
-
-			/* now parse field 17 of the 26 expected fields */
-			ifield = 17;
-			if (nfields > ifield && strlen(fields[ifield]) > 0)
-				{
-				data->defined_mag_dicorr = MB_NO;
-				nscan = sscanf(fields[ifield], "%f", &data->mag_dicorr);
-				if (nscan == 1)
-					{
-					data->defined_mag_dicorr = MB_YES;
-					data->last_field_defined = ifield;
-					}
-				}
-
-			/* now parse field 18 of the 26 expected fields */
-			ifield = 18;
-			if (nfields > ifield && strlen(fields[ifield]) > 0)
-				{
-				data->defined_mag_sdepth = MB_NO;
-				nscan = sscanf(fields[ifield], "%d", &data->mag_sdepth);
-				if (nscan == 1)
-					{
-					data->defined_mag_sdepth = MB_YES;
-					data->last_field_defined = ifield;
-					}
-				}
-
-			/* now parse field 19 of the 26 expected fields */
-			ifield = 19;
-			if (nfields > ifield && strlen(fields[ifield]) > 0)
-				{
-				data->defined_mag_qualco = MB_NO;
-				nscan = sscanf(fields[ifield], "%d", &data->mag_qualco);
-				if (nscan == 1)
-					{
-					data->defined_mag_qualco = MB_YES;
-					data->last_field_defined = ifield;
-					}
-				}
-
-			/* now parse field 20 of the 26 expected fields */
-			ifield = 20;
-			if (nfields > ifield && strlen(fields[ifield]) > 0)
-				{
-				data->defined_gra_obs = MB_NO;
-				nscan = sscanf(fields[ifield], "%f", &data->gra_obs);
-				if (nscan == 1)
-					{
-					data->defined_gra_obs = MB_YES;
-					data->last_field_defined = ifield;
-					}
-				}
-
-			/* now parse field 21 of the 26 expected fields */
-			ifield = 21;
-			if (nfields > ifield && strlen(fields[ifield]) > 0)
-				{
-				data->defined_eotvos = MB_NO;
-				nscan = sscanf(fields[ifield], "%f", &data->eotvos);
-				if (nscan == 1)
-					{
-					data->defined_eotvos = MB_YES;
-					data->last_field_defined = ifield;
-					}
-				}
-
-			/* now parse field 22 of the 26 expected fields */
-			ifield = 22;
-			if (nfields > ifield && strlen(fields[ifield]) > 0)
-				{
-				data->defined_freeair = MB_NO;
-				nscan = sscanf(fields[ifield], "%f", &data->freeair);
-				if (nscan == 1)
-					{
-					data->defined_freeair = MB_YES;
-					data->last_field_defined = ifield;
-					}
-				}
-
-			/* now parse field 23 of the 26 expected fields */
-			ifield = 23;
-			if (nfields > ifield && strlen(fields[ifield]) > 0)
-				{
-				data->defined_gra_qualco = MB_NO;
-				nscan = sscanf(fields[ifield], "%d", &data->gra_qualco);
-				if (nscan == 1)
-					{
-					data->defined_gra_qualco = MB_YES;
-					data->last_field_defined = ifield;
-					}
-				}
-
-			/* now parse field 24 of the 26 expected fields */
-			ifield = 24;
-			if (nfields > ifield && strlen(fields[ifield]) > 0)
-				{
-				data->defined_lineid = MB_NO;
-				nscan = sscanf(fields[ifield], "%d", &data->lineid);
-				if (nscan == 1)
-					{
-					data->defined_lineid = MB_YES;
-					data->last_field_defined = ifield;
-					}
-				}
-
-			/* now parse field 25 of the 26 expected fields */
-			ifield = 25;
-			if (nfields > ifield && strlen(fields[ifield]) > 0)
-				{
-				data->defined_pointid = MB_NO;
-				nscan = sscanf(fields[ifield], "%d", &data->pointid);
-				if (nscan == 1)
-					{
-					data->defined_pointid = MB_YES;
-					data->last_field_defined = ifield;
-					}
-				}
-			}
-		}
-
-	/* print input debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Data read in function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       data->kind:                 %d\n", data->kind);
-		fprintf(stderr,"dbg5       data->defined_survey_id:    %d\n", data->defined_survey_id);
-		fprintf(stderr,"dbg5       data->defined_timezone:     %d\n", data->defined_timezone);
-		fprintf(stderr,"dbg5       data->defined_date:         %d\n", data->defined_date);
-		fprintf(stderr,"dbg5       data->defined_time:         %d\n", data->defined_time);
-		fprintf(stderr,"dbg5       data->defined_lat:          %d\n", data->defined_lat);
-		fprintf(stderr,"dbg5       data->defined_lon:          %d\n", data->defined_lon);
-		fprintf(stderr,"dbg5       data->defined_pos_type:     %d\n", data->defined_pos_type);
-		fprintf(stderr,"dbg5       data->defined_nav_qualco:   %d\n", data->defined_nav_qualco);
-		fprintf(stderr,"dbg5       data->defined_bat_ttime:    %d\n", data->defined_bat_ttime);
-		fprintf(stderr,"dbg5       data->defined_corr_depth:   %d\n", data->defined_corr_depth);
-		fprintf(stderr,"dbg5       data->defined_bat_cpco:     %d\n", data->defined_bat_cpco);
-		fprintf(stderr,"dbg5       data->defined_bat_typco:    %d\n", data->defined_bat_typco);
-		fprintf(stderr,"dbg5       data->defined_bat_qualco:   %d\n", data->defined_bat_qualco);
-		fprintf(stderr,"dbg5       data->defined_mag_tot:      %d\n", data->defined_mag_tot);
-		fprintf(stderr,"dbg5       data->defined_mag_tot2:     %d\n", data->defined_mag_tot2);
-		fprintf(stderr,"dbg5       data->defined_mag_res:      %d\n", data->defined_mag_res);
-		fprintf(stderr,"dbg5       data->defined_mag_ressen:   %d\n", data->defined_mag_ressen);
-		fprintf(stderr,"dbg5       data->defined_mag_dicorr:   %d\n", data->defined_mag_dicorr);
-		fprintf(stderr,"dbg5       data->defined_mag_sdepth:   %d\n", data->defined_mag_sdepth);
-		fprintf(stderr,"dbg5       data->defined_mag_qualco:   %d\n", data->defined_mag_qualco);
-		fprintf(stderr,"dbg5       data->defined_gra_obs:      %d\n", data->defined_gra_obs);
-		fprintf(stderr,"dbg5       data->defined_eotvos:       %d\n", data->defined_eotvos);
-		fprintf(stderr,"dbg5       data->defined_freeair:      %d\n", data->defined_freeair);
-		fprintf(stderr,"dbg5       data->defined_gra_qualco:   %d\n", data->defined_gra_qualco);
-		fprintf(stderr,"dbg5       data->defined_lineid:       %d\n", data->defined_lineid);
-		fprintf(stderr,"dbg5       data->defined_pointid:      %d\n", data->defined_pointid);
-		fprintf(stderr,"dbg5       data->last_field_defined:   %d\n", data->last_field_defined);
-		fprintf(stderr,"dbg5       data->survey_id:            %s\n", data->survey_id);
-		fprintf(stderr,"dbg5       data->timezone:             %f\n", data->timezone);
-		fprintf(stderr,"dbg5       data->date:                 %d\n", data->date);
-		fprintf(stderr,"dbg5       data->time:                 %f\n", data->time);
-		fprintf(stderr,"dbg5       data->lat:                  %f\n", data->lat);
-		fprintf(stderr,"dbg5       data->lon:                  %f\n", data->lon);
-		fprintf(stderr,"dbg5       data->pos_type:             %d\n", data->pos_type);
-		fprintf(stderr,"dbg5       data->nav_qualco:           %d\n", data->nav_qualco);
-		fprintf(stderr,"dbg5       data->bat_ttime:            %f\n", data->bat_ttime);
-		fprintf(stderr,"dbg5       data->corr_depth:           %f\n", data->corr_depth);
-		fprintf(stderr,"dbg5       data->bat_cpco:             %d\n", data->bat_cpco);
-		fprintf(stderr,"dbg5       data->bat_typco:            %d\n", data->bat_typco);
-		fprintf(stderr,"dbg5       data->bat_qualco:           %d\n", data->bat_qualco);
-		fprintf(stderr,"dbg5       data->mag_tot:              %f\n", data->mag_tot);
-		fprintf(stderr,"dbg5       data->mag_tot2:             %f\n", data->mag_tot2);
-		fprintf(stderr,"dbg5       data->mag_res:              %f\n", data->mag_res);
-		fprintf(stderr,"dbg5       data->mag_ressen:           %d\n", data->mag_ressen);
-		fprintf(stderr,"dbg5       data->mag_dicorr:           %f\n", data->mag_dicorr);
-		fprintf(stderr,"dbg5       data->mag_sdepth:           %d\n", data->mag_sdepth);
-		fprintf(stderr,"dbg5       data->mag_qualco:           %d\n", data->mag_qualco);
-		fprintf(stderr,"dbg5       data->gra_obs:              %f\n", data->gra_obs);
-		fprintf(stderr,"dbg5       data->eotvos:               %f\n", data->eotvos);
-		fprintf(stderr,"dbg5       data->freeair:              %f\n", data->freeair);
-		fprintf(stderr,"dbg5       data->gra_qualco:           %d\n", data->gra_qualco);
-		fprintf(stderr,"dbg5       data->lineid:               %d\n", data->lineid);
-		fprintf(stderr,"dbg5       data->pointid:              %d\n", data->pointid);
-		fprintf(stderr,"dbg5       data->comment:              %s\n", data->comment);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_mgd77tab_wr_data(int verbose, void *mbio_ptr, void *data_ptr, int *error)
-{
-	char	*function_name = "mbr_mgd77tab_wr_data";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_mgd77tab_struct *data;
-	char	line[MB_COMMENT_MAXLINE];
-	int	write_status;
-	int	shift;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       data_ptr:   %p\n",(void *)data_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_mgd77tab_struct *) data_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Data to be written in function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       data->kind:                 %d\n", data->kind);
-		fprintf(stderr,"dbg5       data->defined_survey_id:    %d\n", data->defined_survey_id);
-		fprintf(stderr,"dbg5       data->defined_timezone:     %d\n", data->defined_timezone);
-		fprintf(stderr,"dbg5       data->defined_date:         %d\n", data->defined_date);
-		fprintf(stderr,"dbg5       data->defined_time:         %d\n", data->defined_time);
-		fprintf(stderr,"dbg5       data->defined_lat:          %d\n", data->defined_lat);
-		fprintf(stderr,"dbg5       data->defined_lon:          %d\n", data->defined_lon);
-		fprintf(stderr,"dbg5       data->defined_pos_type:     %d\n", data->defined_pos_type);
-		fprintf(stderr,"dbg5       data->defined_nav_qualco:   %d\n", data->defined_nav_qualco);
-		fprintf(stderr,"dbg5       data->defined_bat_ttime:    %d\n", data->defined_bat_ttime);
-		fprintf(stderr,"dbg5       data->defined_corr_depth:   %d\n", data->defined_corr_depth);
-		fprintf(stderr,"dbg5       data->defined_bat_cpco:     %d\n", data->defined_bat_cpco);
-		fprintf(stderr,"dbg5       data->defined_bat_typco:    %d\n", data->defined_bat_typco);
-		fprintf(stderr,"dbg5       data->defined_bat_qualco:   %d\n", data->defined_bat_qualco);
-		fprintf(stderr,"dbg5       data->defined_mag_tot:      %d\n", data->defined_mag_tot);
-		fprintf(stderr,"dbg5       data->defined_mag_tot2:     %d\n", data->defined_mag_tot2);
-		fprintf(stderr,"dbg5       data->defined_mag_res:      %d\n", data->defined_mag_res);
-		fprintf(stderr,"dbg5       data->defined_mag_ressen:   %d\n", data->defined_mag_ressen);
-		fprintf(stderr,"dbg5       data->defined_mag_dicorr:   %d\n", data->defined_mag_dicorr);
-		fprintf(stderr,"dbg5       data->defined_mag_sdepth:   %d\n", data->defined_mag_sdepth);
-		fprintf(stderr,"dbg5       data->defined_mag_qualco:   %d\n", data->defined_mag_qualco);
-		fprintf(stderr,"dbg5       data->defined_gra_obs:      %d\n", data->defined_gra_obs);
-		fprintf(stderr,"dbg5       data->defined_eotvos:       %d\n", data->defined_eotvos);
-		fprintf(stderr,"dbg5       data->defined_freeair:      %d\n", data->defined_freeair);
-		fprintf(stderr,"dbg5       data->defined_gra_qualco:   %d\n", data->defined_gra_qualco);
-		fprintf(stderr,"dbg5       data->defined_lineid:       %d\n", data->defined_lineid);
-		fprintf(stderr,"dbg5       data->defined_pointid:      %d\n", data->defined_pointid);
-		fprintf(stderr,"dbg5       data->last_field_defined:   %d\n", data->last_field_defined);
-		fprintf(stderr,"dbg5       data->survey_id:            %s\n", data->survey_id);
-		fprintf(stderr,"dbg5       data->timezone:             %f\n", data->timezone);
-		fprintf(stderr,"dbg5       data->date:                 %d\n", data->date);
-		fprintf(stderr,"dbg5       data->time:                 %f\n", data->time);
-		fprintf(stderr,"dbg5       data->lat:                  %f\n", data->lat);
-		fprintf(stderr,"dbg5       data->lon:                  %f\n", data->lon);
-		fprintf(stderr,"dbg5       data->pos_type:             %d\n", data->pos_type);
-		fprintf(stderr,"dbg5       data->nav_qualco:           %d\n", data->nav_qualco);
-		fprintf(stderr,"dbg5       data->bat_ttime:            %f\n", data->bat_ttime);
-		fprintf(stderr,"dbg5       data->corr_depth:           %f\n", data->corr_depth);
-		fprintf(stderr,"dbg5       data->bat_cpco:             %d\n", data->bat_cpco);
-		fprintf(stderr,"dbg5       data->bat_typco:            %d\n", data->bat_typco);
-		fprintf(stderr,"dbg5       data->bat_qualco:           %d\n", data->bat_qualco);
-		fprintf(stderr,"dbg5       data->mag_tot:              %f\n", data->mag_tot);
-		fprintf(stderr,"dbg5       data->mag_tot2:             %f\n", data->mag_tot2);
-		fprintf(stderr,"dbg5       data->mag_res:              %f\n", data->mag_res);
-		fprintf(stderr,"dbg5       data->mag_ressen:           %d\n", data->mag_ressen);
-		fprintf(stderr,"dbg5       data->mag_dicorr:           %f\n", data->mag_dicorr);
-		fprintf(stderr,"dbg5       data->mag_sdepth:           %d\n", data->mag_sdepth);
-		fprintf(stderr,"dbg5       data->mag_qualco:           %d\n", data->mag_qualco);
-		fprintf(stderr,"dbg5       data->gra_obs:              %f\n", data->gra_obs);
-		fprintf(stderr,"dbg5       data->eotvos:               %f\n", data->eotvos);
-		fprintf(stderr,"dbg5       data->freeair:              %f\n", data->freeair);
-		fprintf(stderr,"dbg5       data->gra_qualco:           %d\n", data->gra_qualco);
-		fprintf(stderr,"dbg5       data->lineid:               %d\n", data->lineid);
-		fprintf(stderr,"dbg5       data->pointid:              %d\n", data->pointid);
-		fprintf(stderr,"dbg5       data->comment:              %s\n", data->comment);
-		}
-
-	/* handle the data */
-	if (data->kind == MB_DATA_HEADER)
-		{
-		sprintf(line,"%s\r\n",data->comment);
-		}
-	else if (data->kind == MB_DATA_COMMENT)
-		{
-		 sprintf(line, "#%s\r\n", data->comment);
-		}
-	else if (data->kind == MB_DATA_DATA)
-		{
-		/* figure out which is the last valid field - no tabs to be
-		 * written past that field */
-		
-		
-		/* write out each field */
-		shift = 0;
-		if (data->defined_survey_id == MB_YES)
-			{
-			sprintf(&line[shift], "%s", data->survey_id); shift = strlen(line);
-			}
-		if (data->defined_timezone == MB_YES)
-			{
-			sprintf(&line[shift], "\t%f", data->timezone); shift = strlen(line);
-			}
-		else if (data->last_field_defined > 1)
-			{
-			sprintf(&line[shift], "\t"); shift = strlen(line);
-			}
-		if (data->defined_date == MB_YES)
-			{
-			sprintf(&line[shift], "\t%d", data->date); shift = strlen(line);
-			}
-		else if (data->last_field_defined > 2)
-			{
-			sprintf(&line[shift], "\t"); shift = strlen(line);
-			}
-		if (data->defined_time == MB_YES)
-			{
-			sprintf(&line[shift], "\t%f", data->time); shift = strlen(line);
-			}
-		else if (data->last_field_defined > 3)
-			{
-			sprintf(&line[shift], "\t"); shift = strlen(line);
-			}
-		if (data->defined_lat == MB_YES)
-			{
-			sprintf(&line[shift], "\t%f", data->lat); shift = strlen(line);
-			}
-		else if (data->last_field_defined > 4)
-			{
-			sprintf(&line[shift], "\t"); shift = strlen(line);
-			}
-		if (data->defined_lon == MB_YES)
-			{
-			sprintf(&line[shift], "\t%f", data->lon); shift = strlen(line);
-			}
-		else if (data->last_field_defined > 5)
-			{
-			sprintf(&line[shift], "\t"); shift = strlen(line);
-			}
-		if (data->defined_pos_type == MB_YES)
-			{
-			sprintf(&line[shift], "\t%d", data->pos_type); shift = strlen(line);
-			}
-		else if (data->last_field_defined > 6)
-			{
-			sprintf(&line[shift], "\t"); shift = strlen(line);
-			}
-		if (data->defined_nav_qualco == MB_YES)
-			{
-			sprintf(&line[shift], "\t%d", data->nav_qualco); shift = strlen(line);
-			}
-		else if (data->last_field_defined > 7)
-			{
-			sprintf(&line[shift], "\t"); shift = strlen(line);
-			}
-		if (data->defined_bat_ttime == MB_YES)
-			{
-			sprintf(&line[shift], "\t%f", data->bat_ttime); shift = strlen(line);
-			}
-		else if (data->last_field_defined > 8)
-			{
-			sprintf(&line[shift], "\t"); shift = strlen(line);
-			}
-		if (data->defined_corr_depth == MB_YES)
-			{
-			sprintf(&line[shift], "\t%f", data->corr_depth); shift = strlen(line);
-			}
-		else if (data->last_field_defined > 9)
-			{
-			sprintf(&line[shift], "\t"); shift = strlen(line);
-			}
-		if (data->defined_bat_cpco == MB_YES)
-			{
-			sprintf(&line[shift], "\t%d", data->bat_cpco); shift = strlen(line);
-			}
-		else if (data->last_field_defined > 10)
-			{
-			sprintf(&line[shift], "\t"); shift = strlen(line);
-			}
-		if (data->defined_bat_typco == MB_YES)
-			{
-			sprintf(&line[shift], "\t%d", data->bat_typco); shift = strlen(line);
-			}
-		else if (data->last_field_defined > 11)
-			{
-			sprintf(&line[shift], "\t"); shift = strlen(line);
-			}
-		if (data->defined_bat_qualco == MB_YES)
-			{
-			sprintf(&line[shift], "\t%d", data->bat_qualco); shift = strlen(line);
-			}
-		else if (data->last_field_defined > 12)
-			{
-			sprintf(&line[shift], "\t"); shift = strlen(line);
-			}
-		if (data->defined_mag_tot == MB_YES)
-			{
-			sprintf(&line[shift], "\t%f", data->mag_tot); shift = strlen(line);
-			}
-		else if (data->last_field_defined > 13)
-			{
-			sprintf(&line[shift], "\t"); shift = strlen(line);
-			}
-		if (data->defined_mag_tot2 == MB_YES)
-			{
-			sprintf(&line[shift], "\t%f", data->mag_tot2); shift = strlen(line);
-			}
-		else if (data->last_field_defined > 14)
-			{
-			sprintf(&line[shift], "\t"); shift = strlen(line);
-			}
-		if (data->defined_mag_res == MB_YES)
-			{
-			sprintf(&line[shift], "\t%f", data->mag_res); shift = strlen(line);
-			}
-		else if (data->last_field_defined > 15)
-			{
-			sprintf(&line[shift], "\t"); shift = strlen(line);
-			}
-		if (data->defined_mag_ressen == MB_YES)
-			{
-			sprintf(&line[shift], "\t%d", data->mag_ressen); shift = strlen(line);
-			}
-		else if (data->last_field_defined > 16)
-			{
-			sprintf(&line[shift], "\t"); shift = strlen(line);
-			}
-		if (data->defined_mag_dicorr == MB_YES)
-			{
-			sprintf(&line[shift], "\t%f", data->mag_dicorr); shift = strlen(line);
-			}
-		else if (data->last_field_defined > 17)
-			{
-			sprintf(&line[shift], "\t"); shift = strlen(line);
-			}
-		if (data->defined_mag_sdepth == MB_YES)
-			{
-			sprintf(&line[shift], "\t%d", data->mag_sdepth); shift = strlen(line);
-			}
-		else if (data->last_field_defined > 18)
-			{
-			sprintf(&line[shift], "\t"); shift = strlen(line);
-			}
-		if (data->defined_mag_qualco == MB_YES)
-			{
-			sprintf(&line[shift], "\t%d", data->mag_qualco); shift = strlen(line);
-			}
-		else if (data->last_field_defined > 19)
-			{
-			sprintf(&line[shift], "\t"); shift = strlen(line);
-			}
-		if (data->defined_gra_obs == MB_YES)
-			{
-			sprintf(&line[shift], "\t%f", data->gra_obs); shift = strlen(line);
-			}
-		else if (data->last_field_defined > 20)
-			{
-			sprintf(&line[shift], "\t"); shift = strlen(line);
-			}
-		if (data->defined_eotvos == MB_YES)
-			{
-			sprintf(&line[shift], "\t%f", data->eotvos); shift = strlen(line);
-			}
-		else if (data->last_field_defined > 21)
-			{
-			sprintf(&line[shift], "\t"); shift = strlen(line);
-			}
-		if (data->defined_freeair == MB_YES)
-			{
-			sprintf(&line[shift], "\t%f", data->freeair); shift = strlen(line);
-			}
-		else if (data->last_field_defined > 22)
-			{
-			sprintf(&line[shift], "\t"); shift = strlen(line);
-			}
-		if (data->defined_gra_qualco == MB_YES)
-			{
-			sprintf(&line[shift], "\t%d", data->gra_qualco); shift = strlen(line);
-			}
-		else if (data->last_field_defined > 23)
-			{
-			sprintf(&line[shift], "\t"); shift = strlen(line);
-			}
-		if (data->defined_lineid == MB_YES)
-			{
-			sprintf(&line[shift], "\t%d", data->lineid); shift = strlen(line);
-			}
-		else if (data->last_field_defined > 24)
-			{
-			sprintf(&line[shift], "\t"); shift = strlen(line);
-			}
-		if (data->defined_pointid == MB_YES)
-			{
-			sprintf(&line[shift], "\t%d", data->pointid); shift = strlen(line);
-			}
-		line[shift] = '\r'; shift++;
-		line[shift] = '\n'; shift++;
-		line[shift] = '\0'; shift++;
-		}
-
-	if ((write_status = fputs(line, mb_io_ptr->mbfp)) > 0)
-		{
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-		}
-	else
-		{
-		*error = MB_ERROR_WRITE_FAIL;
-		status = MB_FAILURE;
-		}
-
-
-	/* print output debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Data record kind in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       kind:       %d\n",data->kind);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mbr_mgd77txt.c b/src/mbio/mbr_mgd77txt.c
deleted file mode 100644
index b238a8d..0000000
--- a/src/mbio/mbr_mgd77txt.c
+++ /dev/null
@@ -1,1191 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbr_mgd77txt.c	5/18/99
- *	$Id: mbr_mgd77txt.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 2014-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbr_mgd77txt.c contains the functions for reading and writing
- * multibeam data in the MGD77TXT format.
- * These functions include:
- *   mbr_alm_mgd77txt	- allocate read/write memory
- *   mbr_dem_mgd77txt	- deallocate read/write memory
- *   mbr_rt_mgd77txt	- read and translate data
- *   mbr_wt_mgd77txt	- translate and write data
- *
- * Author:	D. W. Caress
- * Date:	February 25, 2014
- *
- * $Log: mbr_mgd77txt.c,v $
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mb_define.h"
-#include "mbsys_singlebeam.h"
-
-/*
- * Notes on the MBF_MGD77TXT data format:
- *   1. The MGD77 format is is an exchange format for marine
- *	geophysical data (bathymetry, magnetics, and gravity).
- *      The format standard is maintained by the National
- *      Geophysical Data Center of NOAA.
- *   2. The standard MGD77 format includes a 1920 byte header
- *      followed by 120 byte data records. The header consists
- *      of 24 80 byte records. The first character of the first
- *      header record is either 1 (pre-Y2K fix) or 4 (post-Y2K fix).
- *      MB-System treats the header as 16 120 byte records and
- *      provides no means of modifying the header.
- *   3. The data records are each 120 bytes long. The first
- *      character of each data record is either
- *      3 (pre-Y2K fix) or 5 (post-Y2K fix).
- *   4. The MB-System implementation includes the support of
- *      an arbitrary number of comment records at the beginning
- *      of each file. The comment records are 120 bytes each
- *      and begin with the character '#'.
- *
- */
-
-/* header and data record in bytes */
-#define MBF_MGD77TXT_HEADER_NUM	    16
-#define MBF_MGD77TXT_DATA_LEN	    128
-
-struct mbf_mgd77txt_struct
-	{
-	/* type of data record */
-	int	kind;
-
-	/* survey id */
-	char	survey_id[8];
-			    /* Identifier supplied by the contributing
-				 organization, else given by NGDC in
-				 a manner which represents the data. */
-
-	/* time stamp */
-	double	time_d;
-	int	time_i[7];
-	int	timezone;   /* Corrects time (in characters 13-27)
-				 to GMT when added: equals zero when
-				 time is GMT.  Timezone normally falls
-				 between -13 and +12 inclusively. */
-	/* navigation */
-	double	longitude;
-	double	latitude;
-	double	heading;    /* degrees */
-	double	speed;	    /* km/hr */
-	int	nav_type;   /* Indicates how lat/lon was obtained:
-				1 = Observed fix
-				3 = Interpolated
-				9 = Unspecified	*/
-	int	nav_quality;
-			    /* QUALITY CODE FOR NAVIGATION -
-                             5 - Suspected, by the
-                                 originating institution
-                             6 - Suspected, by the data
-                                 center
-                             9 - No identifiable problem
-                                 found */
-
-	/* motion sensor data */
-	double	roll;
-	double	pitch;
-	double	heave;
-
-	/* bathymetry */
-	int	flag;	    /* MB-System style beamflag */
-	double	tt;	    /* two way travel time in sec */
-	double	bath;	    /* corrected depth in m */
-	int	bath_corr;  /* BATHYMETRIC CORRECTION CODE
-			       This code details the procedure
-			       used for determining the sound
-			       velocity correction to depth:
-				01-55  Matthews' Zones with zone
-				59     Matthews' Zones, no zone
-				60     S. Kuwahara Formula
-				61     Wilson Formula
-				62     Del Grosso Formula
-				63     Carter's Tables
-				88     Other (see Add. Doc.)
-				99     Unspecified */
-	int	bath_type;  /* BATHYMETRIC TYPE CODE
-				 Indicates how the data record's
-				 bathymetric value was obtained:
-				 1 =    Observed
-				 3 =    Interpolated
-				 9 =    Unspecified */
-
-	/* magnetics */
-	double	mag_tot_1;  /* MAGNETICS TOTAL FIELD, 1ST SENSOR
-				In tenths of nanoteslas (gammas).
-				For leading sensor.  Use this field
-				for single sensor. */
-	double	mag_tot_2;  /* MAGNETICS TOTAL FIELD, 2ND SENSOR
-				In tenths of nanoteslas (gammas).
-				For trailing sensor. */
-	double	mag_res;    /* MAGNETICS RESIDUAL FIELD
-				In tenths of nanoteslas (gammas). */
-	int	mag_res_sensor;
-			    /* SENSOR FOR RESIDUAL FIELD
-				1 = 1st or leading sensor
-				2 = 2nd or trailing sensor
-				9 = Unspecified */
-	double	mag_diurnal;
-			    /* MAGNETICS DIURNAL CORRECTION -
-				In tenths of nanoteslas (gammas).
-				(In nanoteslas) if 9-filled
-				(i.e., set to "+9999"), total
-				and residual fields are assumed
-				to be uncorrected; if used,
-				total and residuals are assumed
-				to have been already corrected. */
-	double	mag_altitude;
-			    /* DEPTH OR ALTITUDE OF MAGNETICS SENSOR
-				In meters.
-				+ = Below sealevel
-				- = Above sealevel */
-
-	/* gravity */
-	double	gravity;    /* OBSERVED GRAVITY
-                             In milligals.
-                             Corrected for Eotvos, drift, and
-                             tares */
-	double	eotvos;	    /* EOTVOS CORRECTION
-                             In milligals.
-                             E = 7.5 V cos phi sin alpha +
-                             0.0042 V*V */
-	double	free_air;   /* FREE-AIR ANOMALY
-                             In milligals.
-                             Free-air Anomaly = G(observed) -
-                             G(theoretical) */
-
-	/* seismic */
-	int	seismic_line;
-			    /* SEISMIC LINE NUMBER
-                             Used for cross referencing with
-                             seismic data. */
-	int	seismic_shot;
-			    /* SEISMIC SHOT-POINT NUMBER */
-
-	/* comment */
-	char	comment[MB_COMMENT_MAXLINE];
-	};
-
-/* essential function prototypes */
-int mbr_register_mgd77txt(int verbose, void *mbio_ptr,
-		int *error);
-int mbr_info_mgd77txt(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_alm_mgd77txt(int verbose, void *mbio_ptr, int *error);
-int mbr_dem_mgd77txt(int verbose, void *mbio_ptr, int *error);
-int mbr_zero_mgd77txt(int verbose, char *data_ptr, int *error);
-int mbr_rt_mgd77txt(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_wt_mgd77txt(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_mgd77txt_rd_data(int verbose, void *mbio_ptr, int *error);
-int mbr_mgd77txt_wr_data(int verbose, void *mbio_ptr, void *data_ptr, int *error);
-
-static char rcs_id[]="$Id: mbr_mgd77txt.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mbr_register_mgd77txt(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_register_mgd77txt";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* get mb_io_ptr */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set format info parameters */
-	status = mbr_info_mgd77txt(verbose,
-			&mb_io_ptr->system,
-			&mb_io_ptr->beams_bath_max,
-			&mb_io_ptr->beams_amp_max,
-			&mb_io_ptr->pixels_ss_max,
-			mb_io_ptr->format_name,
-			mb_io_ptr->system_name,
-			mb_io_ptr->format_description,
-			&mb_io_ptr->numfile,
-			&mb_io_ptr->filetype,
-			&mb_io_ptr->variable_beams,
-			&mb_io_ptr->traveltime,
-			&mb_io_ptr->beam_flagging,
-			&mb_io_ptr->nav_source,
-			&mb_io_ptr->heading_source,
-			&mb_io_ptr->vru_source,
-			&mb_io_ptr->svp_source,
-			&mb_io_ptr->beamwidth_xtrack,
-			&mb_io_ptr->beamwidth_ltrack,
-			error);
-
-	/* set format and system specific function pointers */
-	mb_io_ptr->mb_io_format_alloc = &mbr_alm_mgd77txt;
-	mb_io_ptr->mb_io_format_free = &mbr_dem_mgd77txt;
-	mb_io_ptr->mb_io_store_alloc = &mbsys_singlebeam_alloc;
-	mb_io_ptr->mb_io_store_free = &mbsys_singlebeam_deall;
-	mb_io_ptr->mb_io_read_ping = &mbr_rt_mgd77txt;
-	mb_io_ptr->mb_io_write_ping = &mbr_wt_mgd77txt;
-	mb_io_ptr->mb_io_dimensions = &mbsys_singlebeam_dimensions;
-	mb_io_ptr->mb_io_extract = &mbsys_singlebeam_extract;
-	mb_io_ptr->mb_io_insert = &mbsys_singlebeam_insert;
-	mb_io_ptr->mb_io_extract_nav = &mbsys_singlebeam_extract_nav;
-	mb_io_ptr->mb_io_insert_nav = &mbsys_singlebeam_insert_nav;
-	mb_io_ptr->mb_io_extract_altitude = &mbsys_singlebeam_extract_altitude;
-	mb_io_ptr->mb_io_insert_altitude = NULL;
-	mb_io_ptr->mb_io_extract_svp = NULL;
-	mb_io_ptr->mb_io_insert_svp = NULL;
-	mb_io_ptr->mb_io_ttimes = &mbsys_singlebeam_ttimes;
-	mb_io_ptr->mb_io_detects = &mbsys_singlebeam_detects;
-	mb_io_ptr->mb_io_copyrecord = &mbsys_singlebeam_copy;
-	mb_io_ptr->mb_io_extract_rawss = NULL;
-	mb_io_ptr->mb_io_insert_rawss = NULL;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",mb_io_ptr->system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",mb_io_ptr->beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",mb_io_ptr->beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",mb_io_ptr->pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",mb_io_ptr->format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",mb_io_ptr->system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",mb_io_ptr->format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",mb_io_ptr->numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",mb_io_ptr->filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",mb_io_ptr->variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",mb_io_ptr->traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",mb_io_ptr->beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",mb_io_ptr->nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",mb_io_ptr->heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",mb_io_ptr->vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",mb_io_ptr->svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",mb_io_ptr->beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",mb_io_ptr->beamwidth_ltrack);
-		fprintf(stderr,"dbg2       format_alloc:       %p\n",(void *)mb_io_ptr->mb_io_format_alloc);
-		fprintf(stderr,"dbg2       format_free:        %p\n",(void *)mb_io_ptr->mb_io_format_free);
-		fprintf(stderr,"dbg2       store_alloc:        %p\n",(void *)mb_io_ptr->mb_io_store_alloc);
-		fprintf(stderr,"dbg2       store_free:         %p\n",(void *)mb_io_ptr->mb_io_store_free);
-		fprintf(stderr,"dbg2       read_ping:          %p\n",(void *)mb_io_ptr->mb_io_read_ping);
-		fprintf(stderr,"dbg2       write_ping:         %p\n",(void *)mb_io_ptr->mb_io_write_ping);
-		fprintf(stderr,"dbg2       extract:            %p\n",(void *)mb_io_ptr->mb_io_extract);
-		fprintf(stderr,"dbg2       insert:             %p\n",(void *)mb_io_ptr->mb_io_insert);
-		fprintf(stderr,"dbg2       extract_nav:        %p\n",(void *)mb_io_ptr->mb_io_extract_nav);
-		fprintf(stderr,"dbg2       insert_nav:         %p\n",(void *)mb_io_ptr->mb_io_insert_nav);
-		fprintf(stderr,"dbg2       extract_altitude:   %p\n",(void *)mb_io_ptr->mb_io_extract_altitude);
-		fprintf(stderr,"dbg2       insert_altitude:    %p\n",(void *)mb_io_ptr->mb_io_insert_altitude);
-		fprintf(stderr,"dbg2       extract_svp:        %p\n",(void *)mb_io_ptr->mb_io_extract_svp);
-		fprintf(stderr,"dbg2       insert_svp:         %p\n",(void *)mb_io_ptr->mb_io_insert_svp);
-		fprintf(stderr,"dbg2       ttimes:             %p\n",(void *)mb_io_ptr->mb_io_ttimes);
-		fprintf(stderr,"dbg2       detects:            %p\n",(void *)mb_io_ptr->mb_io_detects);
-		fprintf(stderr,"dbg2       extract_rawss:      %p\n",(void *)mb_io_ptr->mb_io_extract_rawss);
-		fprintf(stderr,"dbg2       insert_rawss:       %p\n",(void *)mb_io_ptr->mb_io_insert_rawss);
-		fprintf(stderr,"dbg2       copyrecord:         %p\n",(void *)mb_io_ptr->mb_io_copyrecord);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbr_info_mgd77txt(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error)
-{
-	char	*function_name = "mbr_info_mgd77txt";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* set format info parameters */
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-	*system = MB_SYS_SINGLEBEAM;
-	*beams_bath_max = 1;
-	*beams_amp_max = 0;
-	*pixels_ss_max = 0;
-	strncpy(format_name, "MGD77TXT", MB_NAME_LENGTH);
-	strncpy(system_name, "SINGLEBEAM", MB_NAME_LENGTH);
-	strncpy(format_description, "Format name:          MBF_MGD77TXT\nInformal Description: NGDC MGD77 underway geophysics format\nAttributes:           single beam bathymetry, nav, magnetics, gravity,\n                      122 byte ascii records with CRLF line breaks, NOAA NGDC\n", MB_DESCRIPTION_LENGTH);
-	*numfile = 1;
-	*filetype = MB_FILETYPE_NORMAL;
-	*variable_beams = MB_NO;
-	*traveltime = MB_YES;
-	*beam_flagging = MB_NO;
-	*nav_source = MB_DATA_DATA;
-	*heading_source = MB_DATA_DATA;
-	*vru_source = MB_DATA_DATA;
-	*svp_source = MB_DATA_NONE;
-	*beamwidth_xtrack = 0.0;
-	*beamwidth_ltrack = 0.0;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",*system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",*beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",*beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",*pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",*numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",*filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",*variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",*traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",*beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",*nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",*heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",*vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",*svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",*beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",*beamwidth_ltrack);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_alm_mgd77txt(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_alm_mgd77txt";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_mgd77txt_struct *data;
-	char	*data_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set initial status */
-	status = MB_SUCCESS;
-
-	/* allocate memory for data structure */
-	mb_io_ptr->structure_size = sizeof(struct mbf_mgd77txt_struct);
-	mb_io_ptr->data_structure_size = 0;
-	status = mb_malloc(verbose,mb_io_ptr->structure_size,
-				&mb_io_ptr->raw_data,error);
-	status = mb_malloc(verbose,sizeof(struct mbsys_singlebeam_struct),
-				&mb_io_ptr->store_data,error);
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-	data = (struct mbf_mgd77txt_struct *) mb_io_ptr->raw_data;
-	data_ptr = (char *) data;
-
-	/* set number of header records read to zero */
-	mb_io_ptr->save1 = 0;
-
-	/* initialize everything to zeros */
-	mbr_zero_mgd77txt(verbose,data_ptr,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_dem_mgd77txt(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_dem_mgd77txt";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* deallocate memory for data descriptor */
-	status = mb_free(verbose,&mb_io_ptr->raw_data,error);
-	status = mb_free(verbose,&mb_io_ptr->store_data,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_zero_mgd77txt(int verbose, char *data_ptr, int *error)
-{
-	char	*function_name = "mbr_zero_mgd77txt";
-	int	status = MB_SUCCESS;
-	struct mbf_mgd77txt_struct *data;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       data_ptr:   %p\n",(void *)data_ptr);
-		}
-
-	/* get pointer to data descriptor */
-	data = (struct mbf_mgd77txt_struct *) data_ptr;
-
-	/* initialize everything to zeros */
-	if (data != NULL)
-		{
-		data->kind = MB_DATA_NONE;
-		for (i=0;i<8;i++)
-		    data->survey_id[i] = 0;
-		data->time_d = 0.0;
-		for (i=0;i<7;i++)
-		    data->time_i[i] = 0;
-		data->timezone = 0;
-		data->longitude = 0.0;
-		data->latitude = 0.0;
-		data->heading = 0.0;
-		data->speed = 0.0;
-		data->nav_type = 9;
-		data->nav_quality = 9;
-		data->roll = 0.0;
-		data->pitch = 0.0;
-		data->heave = 0.0;
-		data->tt = 0.0;
-		data->flag = MB_FLAG_NULL;
-		data->bath = 0.0;
-		data->bath_corr = 99;
-		data->bath_type = 9;
-		data->mag_tot_1 = 0.0;
-		data->mag_tot_2 = 0.0;
-		data->mag_res = 0.0;
-		data->mag_res_sensor = 9;
-		data->mag_diurnal = 0.0;
-		data->mag_altitude = 0.0;
-		data->gravity = 0.0;
-		data->eotvos = 0.0;
-		data->free_air = 0.0;
-		data->seismic_line = 0;
-		data->seismic_shot = 0;
-		for (i=0;i<MBF_MGD77TXT_DATA_LEN;i++)
-		    data->comment[i] = 0;
-		}
-
-	/* assume success */
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_rt_mgd77txt(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_rt_mgd77txt";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_mgd77txt_struct *data;
-	struct mbsys_singlebeam_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointers to mbio descriptor and data structures */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-	data = (struct mbf_mgd77txt_struct *) mb_io_ptr->raw_data;
-	store = (struct mbsys_singlebeam_struct *) store_ptr;
-
-	/* read next data from file */
-	status = mbr_mgd77txt_rd_data(verbose,mbio_ptr,error);
-
-	/* set error and kind in mb_io_ptr */
-	mb_io_ptr->new_error = *error;
-	mb_io_ptr->new_kind = data->kind;
-
-	/* translate values to data storage structure */
-	if (status == MB_SUCCESS
-		&& store != NULL)
-		{
-		store->kind = data->kind;
-		for (i=0;i<8;i++)
-		    store->survey_id[i] = data->survey_id[i];
-		store->time_d = data->time_d;
-		for (i=0;i<7;i++)
-		    store->time_i[i] = data->time_i[i];
-		store->timezone = data->timezone;
-		store->longitude = data->longitude;
-		store->latitude = data->latitude;
-		store->heading = data->heading;
-		store->speed = data->speed;
-		store->nav_type = data->nav_type;
-		store->nav_quality = data->nav_quality;
-		store->roll = data->roll;
-		store->pitch = data->pitch;
-		store->heave = data->heave;
-		store->flag = data->flag;
-		store->tt = data->tt;
-		store->bath = data->bath;
-		store->bath_corr = data->bath_corr;
-		store->bath_type = data->bath_type;
-		store->mag_tot_1 = data->mag_tot_1;
-		store->mag_tot_2 = data->mag_tot_2;
-		store->mag_res = data->mag_res;
-		store->mag_res_sensor = data->mag_res_sensor;
-		store->mag_diurnal = data->mag_diurnal;
-		store->mag_altitude = data->mag_altitude;
-		store->gravity = data->gravity;
-		store->eotvos = data->eotvos;
-		store->free_air = data->free_air;
-		store->seismic_line = data->seismic_line;
-		store->seismic_shot = data->seismic_shot;
-		for (i=0;i<MB_COMMENT_MAXLINE;i++)
-		    store->comment[i] = data->comment[i];
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_wt_mgd77txt(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_wt_mgd77txt";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_mgd77txt_struct *data;
-	struct mbsys_singlebeam_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_mgd77txt_struct *) mb_io_ptr->raw_data;
-	store = (struct mbsys_singlebeam_struct *) store_ptr;
-
-	/* first translate values from data storage structure */
-	if (store != NULL)
-		{
-		data->kind = store->kind;
-		for (i=0;i<8;i++)
-		    data->survey_id[i] = store->survey_id[i];
-		data->time_d = store->time_d;
-		for (i=0;i<7;i++)
-		    data->time_i[i] = store->time_i[i];
-		data->timezone = store->timezone;
-		data->longitude = store->longitude;
-		data->latitude = store->latitude;
-		data->heading = store->heading;
-		data->speed = store->speed;
-		data->nav_type = store->nav_type;
-		data->nav_quality = store->nav_quality;
-		data->roll = store->roll;
-		data->pitch = store->pitch;
-		data->heave = store->heave;
-		data->flag = store->flag;
-		data->tt = store->tt;
-		data->bath = store->bath;
-		data->bath_corr = store->bath_corr;
-		data->bath_type = store->bath_type;
-		data->mag_tot_1 = store->mag_tot_1;
-		data->mag_tot_2 = store->mag_tot_2;
-		data->mag_res = store->mag_res;
-		data->mag_res_sensor = store->mag_res_sensor;
-		data->mag_diurnal = store->mag_diurnal;
-		data->mag_altitude = store->mag_altitude;
-		data->gravity = store->gravity;
-		data->eotvos = store->eotvos;
-		data->free_air = store->free_air;
-		data->seismic_line = store->seismic_line;
-		data->seismic_shot = store->seismic_shot;
-		for (i=0;i<MB_COMMENT_MAXLINE;i++)
-		    data->comment[i] = store->comment[i];
-		}
-
-	/* write next data to file */
-	status = mbr_mgd77txt_wr_data(verbose,mbio_ptr,(void *)data,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_mgd77txt_rd_data(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_mgd77txt_rd_data";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_mgd77txt_struct *data;
-	int	*header_read;
-	char	line[MB_COMMENT_MAXLINE];
-	char	*read_ptr;
-	int	shift;
-	int 	neg_unit;
-	int	itmp;
-	double	dtmp;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_mgd77txt_struct *) mb_io_ptr->raw_data;
-	header_read = (int *) &mb_io_ptr->save1;
-
-	/* initialize everything to zeros */
-	mbr_zero_mgd77txt(verbose,mb_io_ptr->raw_data,error);
-
-	/* set file position */
-	mb_io_ptr->file_bytes = ftell(mb_io_ptr->mbfp);
-	mb_io_ptr->file_pos = mb_io_ptr->file_bytes;
-
-	/* read next record */
-	if ((read_ptr = fgets(line, MB_PATH_MAXLINE, mb_io_ptr->mbfp)) != NULL)
-		{
-		mb_io_ptr->file_bytes += strlen(line);
-		status = MB_SUCCESS;
-		*error = MB_ERROR_NO_ERROR;
-		}
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-	mb_io_ptr->file_bytes = ftell(mb_io_ptr->mbfp);
-
-	/* handle the data */
-	if (status == MB_SUCCESS
-	    && *header_read > 0
-	    && *header_read < MBF_MGD77TXT_HEADER_NUM)
-	    {
-	    data->kind = MB_DATA_HEADER;
-	    (*header_read)++;
-	    strncpy(data->comment, line, strlen(line)-2);
-	    }
-	else if (status == MB_SUCCESS
-	    && (line[0] == '1' || line[0] == '4'))
-	    {
-	    data->kind = MB_DATA_HEADER;
-	    (*header_read) = 1;
-	    strncpy(data->comment, line, strlen(line)-2);
-	    }
-	else if (status == MB_SUCCESS
-	    && line[0] == '#')
-	    {
-	    data->kind = MB_DATA_COMMENT;
-            strncpy(data->comment,&line[1],strlen(line)-3);
-	    }
-	else if (status == MB_SUCCESS
-	    && line[0] == '3')
-	    {
-	    data->kind = MB_DATA_DATA;
-
-	    /* get survey id */
-	    shift = 1;
-	    for (i=0;i<8;i++)
-		data->survey_id[i] = line[i+shift];
-
-	    /* get time */
-	    shift += 8;
-	    mb_get_int(&data->timezone, &line[shift], 5); shift += 5;
-	    data->timezone = data->timezone / 100;
-	    mb_get_int(&itmp, &line[shift], 2); shift += 2;
-	    mb_fix_y2k(verbose, itmp, &data->time_i[0]);
-	    mb_get_int(&data->time_i[1], &line[shift], 2); shift += 2;
-	    mb_get_int(&data->time_i[2], &line[shift], 2); shift += 2;
-	    mb_get_int(&data->time_i[3], &line[shift], 2); shift += 2;
-	    mb_get_int(&itmp, &line[shift], 5); shift += 5;
-	    data->time_i[4] = 0.001 * itmp;
-	    dtmp = (itmp - 1000 * data->time_i[4]) * 0.06;
-	    data->time_i[5] = (int) dtmp;
-	    data->time_i[6] = 1000000 * (dtmp - data->time_i[5]);
-	    mb_get_time(verbose,data->time_i,&data->time_d);
-
-	    /* get nav */
-	    neg_unit = 8;
-	    if (line[shift] == '-') {
-		    shift += 1;
-		    neg_unit = 7;
-	    }
-	    mb_get_int(&itmp, &line[shift], neg_unit); shift += neg_unit;
-	    data->latitude = 0.00001 * itmp;
-	    if (neg_unit == 7)
-		    data->latitude = -data->latitude;
-
-	    neg_unit = 9;
-	    if (line[shift] == '-') {
-		    shift += 1;
-		    neg_unit = 8;
-	    }
-	    mb_get_int(&itmp, &line[shift], neg_unit); shift += neg_unit;
-	    data->longitude = 0.00001 * itmp;
-	    if (neg_unit == 8)
-		    data->longitude = -data->longitude;
-	    mb_get_int(&data->nav_type, &line[shift], 1); shift += 1;
-
-	    /* get bath */
-	    mb_get_int(&itmp, &line[shift], 6); shift += 6;
-	    data->tt = 0.0001 * itmp;
-	    mb_get_int(&itmp, &line[shift], 6); shift += 6;
-	    data->bath = 0.1 * itmp;
-	    mb_get_int(&data->bath_corr, &line[shift], 2); shift += 2;
-	    mb_get_int(&data->bath_type, &line[shift], 1); shift += 1;
-	    if (data->bath > 0.0 && data->bath < 99999.9)
-		{
-		data->flag = MB_FLAG_NONE;
-		}
-	    else
-		{
-		data->flag = MB_FLAG_NULL;
-		}
-
-	    /* get magnetics */
-	    mb_get_int(&itmp, &line[shift], 6); shift += 6;
-	    data->mag_tot_1 = 0.1 * itmp;
-	    mb_get_int(&itmp, &line[shift], 6); shift += 6;
-	    data->mag_tot_2 = 0.1 * itmp;
-	    mb_get_int(&itmp, &line[shift], 6); shift += 6;
-	    data->mag_res = 0.1 * itmp;
-	    mb_get_int(&data->mag_res_sensor, &line[shift], 1); shift += 1;
-	    mb_get_int(&itmp, &line[shift], 5); shift += 5;
-	    data->mag_diurnal = 0.1 * itmp;
-	    mb_get_int(&itmp, &line[shift], 6); shift += 6;
-	    data->mag_altitude = itmp;
-
-	    /* get gravity */
-	    mb_get_int(&itmp, &line[shift], 7); shift += 7;
-	    data->gravity = 0.1 * itmp;
-	    mb_get_int(&itmp, &line[shift], 6); shift += 6;
-	    data->eotvos = 0.1 * itmp;
-	    mb_get_int(&itmp, &line[shift], 5); shift += 5;
-	    data->free_air = 0.1 * itmp;
-	    mb_get_int(&data->seismic_line, &line[shift], 5); shift += 5;
-	    mb_get_int(&data->seismic_shot, &line[shift], 6); shift += 6;
-
-	    /* get nav quality */
-	    mb_get_int(&data->nav_quality, &line[shift], 1); shift += 1;
-	    }
-	else if (status == MB_SUCCESS
-	    && line[0] == '5')
-	    {
-	    data->kind = MB_DATA_DATA;
-
-	    /* get survey id */
-	    shift = 1;
-	    for (i=0;i<8;i++)
-		data->survey_id[i] = line[i+shift];
-
-	    /* get time */
-	    shift += 8;
-	    mb_get_int(&data->timezone, &line[shift], 3); shift += 3;
-	    mb_get_int(&data->time_i[0], &line[shift], 4); shift += 4;
-	    mb_get_int(&data->time_i[1], &line[shift], 2); shift += 2;
-	    mb_get_int(&data->time_i[2], &line[shift], 2); shift += 2;
-	    mb_get_int(&data->time_i[3], &line[shift], 2); shift += 2;
-	    mb_get_int(&itmp, &line[shift], 5); shift += 5;
-	    data->time_i[4] = 0.001 * itmp;
-	    dtmp = (itmp - 1000 * data->time_i[4]) * 0.06;
-	    data->time_i[5] = (int) dtmp;
-	    data->time_i[6] = 1000000 * (dtmp - data->time_i[5]);
-
-	    mb_get_time(verbose,data->time_i,&data->time_d);
-
-	    /* get nav */
-	    neg_unit = 8;
-	    if (line[shift] == '-') {
-		    shift += 1;
-		    neg_unit = 7;
-	    }
-	    mb_get_int(&itmp, &line[shift], neg_unit); shift += neg_unit;
-	    data->latitude = 0.00001 * itmp;
-	    if (neg_unit == 7)
-		    data->latitude = -data->latitude;
-
-	    neg_unit = 9;
-	    if (line[shift] == '-') {
-		    shift += 1;
-		    neg_unit = 8;
-	    }
-	    mb_get_int(&itmp, &line[shift], neg_unit); shift += neg_unit;
-	    data->longitude = 0.00001 * itmp;
-	    if (neg_unit == 8)
-		    data->longitude = -data->longitude;
-
-	    mb_get_int(&data->nav_type, &line[shift], 1); shift += 1;
-
-	    /* get bath */
-	    mb_get_int(&itmp, &line[shift], 6); shift += 6;
-	    data->tt = 0.0001 * itmp;
-	    mb_get_int(&itmp, &line[shift], 6); shift += 6;
-	    data->bath = 0.1 * itmp;
-	    mb_get_int(&data->bath_corr, &line[shift], 2); shift += 2;
-	    mb_get_int(&data->bath_type, &line[shift], 1); shift += 1;
-	    if (data->bath > 0.0 && data->bath < 99999.9)
-		{
-		data->flag = MB_FLAG_NONE;
-		}
-	    else
-		{
-		data->flag = MB_FLAG_NULL;
-		}
-
-	    /* get magnetics */
-	    mb_get_int(&itmp, &line[shift], 6); shift += 6;
-	    data->mag_tot_1 = 0.1 * itmp;
-	    mb_get_int(&itmp, &line[shift], 6); shift += 6;
-	    data->mag_tot_2 = 0.1 * itmp;
-	    mb_get_int(&itmp, &line[shift], 6); shift += 6;
-	    data->mag_res = 0.1 * itmp;
-	    mb_get_int(&data->mag_res_sensor, &line[shift], 1); shift += 1;
-	    mb_get_int(&itmp, &line[shift], 5); shift += 5;
-	    data->mag_diurnal = 0.1 * itmp;
-	    mb_get_int(&itmp, &line[shift], 6); shift += 6;
-	    data->mag_altitude = itmp;
-
-	    /* get gravity */
-	    mb_get_int(&itmp, &line[shift], 7); shift += 7;
-	    data->gravity = 0.1 * itmp;
-	    mb_get_int(&itmp, &line[shift], 6); shift += 6;
-	    data->eotvos = 0.1 * itmp;
-	    mb_get_int(&itmp, &line[shift], 5); shift += 5;
-	    data->free_air = 0.1 * itmp;
-	    mb_get_int(&data->seismic_line, &line[shift], 5); shift += 5;
-	    mb_get_int(&data->seismic_shot, &line[shift], 6); shift += 6;
-
-	    /* get nav quality */
-	    mb_get_int(&data->nav_quality, &line[shift], 1); shift += 1;
-	    }
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_mgd77txt_wr_data(int verbose, void *mbio_ptr, void *data_ptr, int *error)
-{
-	char	*function_name = "mbr_mgd77txt_wr_data";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_mgd77txt_struct *data;
-	char	line[MB_COMMENT_MAXLINE];
-	int	itmp;
-	int	write_status;
-	int	shift;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       data_ptr:   %p\n",(void *)data_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_mgd77txt_struct *) data_ptr;
-
-	/* handle the data */
-	if (data->kind == MB_DATA_HEADER)
-	    {
-	    sprintf(line,"%s\r\n",data->comment);
-	    }
-	else if (data->kind == MB_DATA_COMMENT)
-	    {
-	    sprintf(line, "#%s\r\n", data->comment);
-	    }
-	else if (data->kind == MB_DATA_DATA)
-	    {
-	    /* set data record id */
-	    shift = 0;
-	    line[0] = '5'; shift += 1;
-
-	    /* get survey id */
-	    for (i=0;i<8;i++)
-		line[i+shift] = data->survey_id[i];
-	    shift += 8;
-
-	    /* get time */
-	    sprintf(&line[shift], "%3.3d", data->timezone); shift += 3;
-	    sprintf(&line[shift], "%4.4d", data->time_i[0]); shift += 4;
-	    sprintf(&line[shift], "%2.2d", data->time_i[1]); shift += 2;
-	    sprintf(&line[shift], "%2.2d", data->time_i[2]); shift += 2;
-	    sprintf(&line[shift], "%2.2d", data->time_i[3]); shift += 2;
-	    itmp = (1000.0 * data->time_i[4])
-		    + (1000.0 * (data->time_i[5]/60.0))
-			+ (1000.0 * ((data->time_i[6]/1000000.0)/60.0));
-	    sprintf(&line[shift], "%5.5d", itmp); shift += 5;
-
-	    /* get nav */
-	    itmp = 100000 * data->latitude;
-	    if (itmp < 0) {
-		    sprintf(&line[shift], "-"); shift += 1;
-		    sprintf(&line[shift], "%7.7d", itmp*-1); shift += 7;
-	    } else {
-		    sprintf(&line[shift], "%8.8d", itmp); shift += 8;
-	    }
-	    itmp = 100000 * data->longitude;
-	    if (itmp < 0) {
-		    sprintf(&line[shift], "-"); shift += 1;
-		    sprintf(&line[shift], "%8.8d", itmp*-1); shift += 8;
-	    } else {
-		    sprintf(&line[shift], "%9.9d", itmp); shift += 9;
-	    }
-	    sprintf(&line[shift], "%1.1d", data->nav_type); shift += 1;
-
-	    /* get bath */
-	    if (data->flag == MB_FLAG_NONE)
-		{
-		itmp = 10000 * data->tt;
-		sprintf(&line[shift], "%6.6d", itmp); shift += 6;
-		itmp = 10 * data->bath;
-		sprintf(&line[shift], "%6.6d", itmp); shift += 6;
-		}
-	    else
-		{
-		itmp = 999999;
-		sprintf(&line[shift], "%6.6d", itmp); shift += 6;
-		sprintf(&line[shift], "%6.6d", itmp); shift += 6;
-		}
-	    sprintf(&line[shift], "%2.2d", data->bath_corr); shift += 2;
-	    sprintf(&line[shift], "%1.1d", data->bath_type); shift += 1;
-
-	    /* get magnetics */
-	    itmp = 10 * data->mag_tot_1;
-	    sprintf(&line[shift], "%6.6d", itmp); shift += 6;
-	    itmp = 10 * data->mag_tot_2;
-	    sprintf(&line[shift], "%6.6d", itmp); shift += 6;
-	    itmp = 10 * data->mag_res;
-	    sprintf(&line[shift], "%6.6d", itmp); shift += 6;
-	    sprintf(&line[shift], "%1.1d", data->mag_res_sensor); shift += 1;
-	    itmp = 10 * data->mag_diurnal;
-	    sprintf(&line[shift], "%5.5d", itmp); shift += 5;
-	    itmp = data->mag_altitude;
-	    sprintf(&line[shift], "%6.6d", itmp); shift += 6;
-
-	    /* get gravity */
-	    itmp = 10 * data->gravity;
-	    sprintf(&line[shift], "%7.7d", itmp); shift += 7;
-	    itmp = 10 * data->eotvos;
-	    sprintf(&line[shift], "%6.6d", itmp); shift += 6;
-	    itmp = 10 * data->free_air;
-	    sprintf(&line[shift], "%5.5d", itmp); shift += 5;
-	    sprintf(&line[shift], "%5.5d", data->seismic_line); shift += 5;
-	    sprintf(&line[shift], "%6.6d", data->seismic_shot); shift += 6;
-
-	    /* get nav quality */
-	    sprintf(&line[shift], "%1.1d", data->nav_quality); shift += 1;
-
-	    /* set end of line */
-	    sprintf(&line[shift], "\r\n"); shift += 2;
-	    line[shift] = '\0';
-	    }
-
-	if ((write_status = fputs(line, mb_io_ptr->mbfp)) > 0)
-		{
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-		}
-	else
-		{
-		*error = MB_ERROR_WRITE_FAIL;
-		status = MB_FAILURE;
-		}
-
-
-	/* print output debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Data record kind in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       kind:       %d\n",data->kind);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mbr_mr1aldeo.c b/src/mbio/mbr_mr1aldeo.c
deleted file mode 100644
index 4770dea..0000000
--- a/src/mbio/mbr_mr1aldeo.c
+++ /dev/null
@@ -1,1594 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbr_mr1aldeo.c	10/24/95
- *	$Id: mbr_mr1aldeo.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1994-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbr_mr1aldeo.c contains the functions for reading and writing
- * multibeam data in the MR1ALDEO format.
- * These functions include:
- *   mbr_alm_mr1aldeo	- allocate read/write memory
- *   mbr_dem_mr1aldeo	- deallocate read/write memory
- *   mbr_rt_mr1aldeo	- read and translate data
- *   mbr_wt_mr1aldeo	- translate and write data
- *
- * Author:	D. W. Caress
- * Date:	October 24, 1995
- * $Log: mbr_mr1aldeo.c,v $
- * Revision 5.8  2008/07/10 06:43:40  caress
- * Preparing for 5.1.1beta20
- *
- * Revision 5.7  2005/11/05 00:48:05  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.6  2003/05/20 18:05:32  caress
- * Added svp_source to data source parameters.
- *
- * Revision 5.5  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.4  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.3  2001/07/20 00:32:54  caress
- * Release 5.0.beta03
- *
- * Revision 5.2  2001/03/22  20:50:02  caress
- * Trying to make version 5.0.beta0
- *
- * Revision 5.1  2001/01/22  07:43:34  caress
- * Version 5.0.beta01
- *
- * Revision 5.0  2000/12/01  22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 1.10  2000/10/11  01:03:21  caress
- * Convert to ANSI C
- *
- * Revision 1.9  2000/10/03  21:48:03  caress
- * Snapshot for Dale.
- *
- * Revision 1.8  2000/09/30  06:34:20  caress
- * Snapshot for Dale.
- *
- * Revision 1.7  1999/05/05  20:32:19  caress
- * Fixed bugs in handling updated bathymetry through mb_put_all call.
- *
- * Revision 1.6  1998/10/05  18:32:27  caress
- * MB-System version 4.6beta
- *
- * Revision 1.1  1998/10/05  17:46:15  caress
- * Initial revision
- *
- * Revision 1.5  1997/04/21  17:02:07  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 1.4  1996/04/22  13:21:19  caress
- * Now have DTR and MIN/MAX defines in mb_define.h
- *
- * Revision 1.4  1996/04/22  13:21:19  caress
- * Now have DTR and MIN/MAX defines in mb_define.h
- *
- * Revision 1.3  1996/04/22  11:16:30  caress
- * DTR define now in mb_io.h
- *
- * Revision 1.2  1996/03/12  17:21:55  caress
- * Added format 63, short HMR1 processing format.
- *
- * Revision 1.1  1996/01/26  21:23:30  caress
- * Initial revision
- *
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-#include <time.h>
-
-/* mbio include files */
-#include "mb_define.h"
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mbsys_mr1.h"
-#include "mbf_mr1aldeo.h"
-
-/* essential function prototypes */
-int mbr_register_mr1aldeo(int verbose, void *mbio_ptr,
-		int *error);
-int mbr_info_mr1aldeo(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_alm_mr1aldeo(int verbose, void *mbio_ptr, int *error);
-int mbr_dem_mr1aldeo(int verbose, void *mbio_ptr, int *error);
-int mbr_zero_mr1aldeo(int verbose, struct mbf_mr1aldeo_struct *data, int *error);
-int mbr_rt_mr1aldeo(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_wt_mr1aldeo(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_mr1aldeo_rd_data(int verbose, void *mbio_ptr, int *error);
-int mbr_mr1aldeo_rd_hdr(int verbose, XDR *xdrs,
-		struct mbf_mr1aldeo_struct *data, char **hdr_comment,
-		int *error);
-int mbr_mr1aldeo_rd_ping(int verbose, XDR *xdrs,
-		struct mbf_mr1aldeo_struct *data, int *error);
-int mbr_mr1aldeo_wr_data(int verbose, void *mbio_ptr,struct mbf_mr1aldeo_struct *data, int *error);
-int mbr_mr1aldeo_wr_hdr(int verbose, XDR *xdrs,
-		struct mbf_mr1aldeo_struct *data, char **hdr_comment, int *error);
-int mbr_mr1aldeo_wr_ping(int verbose, XDR *xdrs, struct mbf_mr1aldeo_struct *data, int *error);
-
-static char rcs_id[]="$Id: mbr_mr1aldeo.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mbr_register_mr1aldeo(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_register_mr1aldeo";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* get mb_io_ptr */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set format info parameters */
-	status = mbr_info_mr1aldeo(verbose,
-			&mb_io_ptr->system,
-			&mb_io_ptr->beams_bath_max,
-			&mb_io_ptr->beams_amp_max,
-			&mb_io_ptr->pixels_ss_max,
-			mb_io_ptr->format_name,
-			mb_io_ptr->system_name,
-			mb_io_ptr->format_description,
-			&mb_io_ptr->numfile,
-			&mb_io_ptr->filetype,
-			&mb_io_ptr->variable_beams,
-			&mb_io_ptr->traveltime,
-			&mb_io_ptr->beam_flagging,
-			&mb_io_ptr->nav_source,
-			&mb_io_ptr->heading_source,
-			&mb_io_ptr->vru_source,
-			&mb_io_ptr->svp_source,
-			&mb_io_ptr->beamwidth_xtrack,
-			&mb_io_ptr->beamwidth_ltrack,
-			error);
-
-	/* set format and system specific function pointers */
-	mb_io_ptr->mb_io_format_alloc = &mbr_alm_mr1aldeo;
-	mb_io_ptr->mb_io_format_free = &mbr_dem_mr1aldeo;
-	mb_io_ptr->mb_io_store_alloc = &mbsys_mr1_alloc;
-	mb_io_ptr->mb_io_store_free = &mbsys_mr1_deall;
-	mb_io_ptr->mb_io_read_ping = &mbr_rt_mr1aldeo;
-	mb_io_ptr->mb_io_write_ping = &mbr_wt_mr1aldeo;
-	mb_io_ptr->mb_io_dimensions = &mbsys_mr1_dimensions;
-	mb_io_ptr->mb_io_extract = &mbsys_mr1_extract;
-	mb_io_ptr->mb_io_insert = &mbsys_mr1_insert;
-	mb_io_ptr->mb_io_extract_nav = &mbsys_mr1_extract_nav;
-	mb_io_ptr->mb_io_insert_nav = &mbsys_mr1_insert_nav;
-	mb_io_ptr->mb_io_extract_altitude = &mbsys_mr1_extract_altitude;
-	mb_io_ptr->mb_io_insert_altitude = NULL;
-	mb_io_ptr->mb_io_extract_svp = NULL;
-	mb_io_ptr->mb_io_insert_svp = NULL;
-	mb_io_ptr->mb_io_ttimes = &mbsys_mr1_ttimes;
-	mb_io_ptr->mb_io_detects = &mbsys_mr1_detects;
-	mb_io_ptr->mb_io_copyrecord = &mbsys_mr1_copy;
-	mb_io_ptr->mb_io_extract_rawss = NULL;
-	mb_io_ptr->mb_io_insert_rawss = NULL;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",mb_io_ptr->system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",mb_io_ptr->beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",mb_io_ptr->beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",mb_io_ptr->pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",mb_io_ptr->format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",mb_io_ptr->system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",mb_io_ptr->format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",mb_io_ptr->numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",mb_io_ptr->filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",mb_io_ptr->variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",mb_io_ptr->traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",mb_io_ptr->beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",mb_io_ptr->nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",mb_io_ptr->heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",mb_io_ptr->vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",mb_io_ptr->svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",mb_io_ptr->beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",mb_io_ptr->beamwidth_ltrack);
-		fprintf(stderr,"dbg2       format_alloc:       %p\n",(void *)mb_io_ptr->mb_io_format_alloc);
-		fprintf(stderr,"dbg2       format_free:        %p\n",(void *)mb_io_ptr->mb_io_format_free);
-		fprintf(stderr,"dbg2       store_alloc:        %p\n",(void *)mb_io_ptr->mb_io_store_alloc);
-		fprintf(stderr,"dbg2       store_free:         %p\n",(void *)mb_io_ptr->mb_io_store_free);
-		fprintf(stderr,"dbg2       read_ping:          %p\n",(void *)mb_io_ptr->mb_io_read_ping);
-		fprintf(stderr,"dbg2       write_ping:         %p\n",(void *)mb_io_ptr->mb_io_write_ping);
-		fprintf(stderr,"dbg2       extract:            %p\n",(void *)mb_io_ptr->mb_io_extract);
-		fprintf(stderr,"dbg2       insert:             %p\n",(void *)mb_io_ptr->mb_io_insert);
-		fprintf(stderr,"dbg2       extract_nav:        %p\n",(void *)mb_io_ptr->mb_io_extract_nav);
-		fprintf(stderr,"dbg2       insert_nav:         %p\n",(void *)mb_io_ptr->mb_io_insert_nav);
-		fprintf(stderr,"dbg2       extract_altitude:   %p\n",(void *)mb_io_ptr->mb_io_extract_altitude);
-		fprintf(stderr,"dbg2       insert_altitude:    %p\n",(void *)mb_io_ptr->mb_io_insert_altitude);
-		fprintf(stderr,"dbg2       extract_svp:        %p\n",(void *)mb_io_ptr->mb_io_extract_svp);
-		fprintf(stderr,"dbg2       insert_svp:         %p\n",(void *)mb_io_ptr->mb_io_insert_svp);
-		fprintf(stderr,"dbg2       ttimes:             %p\n",(void *)mb_io_ptr->mb_io_ttimes);
-		fprintf(stderr,"dbg2       detects:            %p\n",(void *)mb_io_ptr->mb_io_detects);
-		fprintf(stderr,"dbg2       extract_rawss:      %p\n",(void *)mb_io_ptr->mb_io_extract_rawss);
-		fprintf(stderr,"dbg2       insert_rawss:       %p\n",(void *)mb_io_ptr->mb_io_insert_rawss);
-		fprintf(stderr,"dbg2       copyrecord:         %p\n",(void *)mb_io_ptr->mb_io_copyrecord);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbr_info_mr1aldeo(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error)
-{
-	char	*function_name = "mbr_info_mr1aldeo";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* set format info parameters */
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-	*system = MB_SYS_MR1;
-	*beams_bath_max = 3003;
-	*beams_amp_max = 0;
-	*pixels_ss_max = 7003;
-	strncpy(format_name, "MR1ALDEO", MB_NAME_LENGTH);
-	strncpy(system_name, "MR1", MB_NAME_LENGTH);
-	strncpy(format_description, "Format name:          MBF_MR1ALDEO\nInformal Description: L-DEO MR1 post processed format with travel times\nAttributes:           L-DEO MR1, bathymetry and sidescan,\n                      variable beams and pixels, xdr binary, \n                      L-DEO.\n", MB_DESCRIPTION_LENGTH);
-	*numfile = 1;
-	*filetype = MB_FILETYPE_XDR;
-	*variable_beams = MB_NO;
-	*traveltime = MB_YES;
-	*beam_flagging = MB_YES;
-	*nav_source = MB_DATA_DATA;
-	*heading_source = MB_DATA_DATA;
-	*vru_source = MB_DATA_DATA;
-	*svp_source = MB_DATA_NONE;
-	*beamwidth_xtrack = 0.0;
-	*beamwidth_ltrack = 2.0;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",*system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",*beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",*beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",*pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",*numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",*filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",*variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",*traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",*beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",*nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",*heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",*vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",*svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",*beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",*beamwidth_ltrack);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_alm_mr1aldeo(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_alm_mr1aldeo";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_mr1aldeo_struct *data;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set initial status */
-	status = MB_SUCCESS;
-
-	/* allocate memory for data structure */
-	mb_io_ptr->structure_size = sizeof(struct mbf_mr1aldeo_struct);
-	mb_io_ptr->data_structure_size = 0;
-	status = mb_mallocd(verbose,__FILE__,__LINE__,mb_io_ptr->structure_size,
-				(void **)&mb_io_ptr->raw_data,error);
-	status = mb_mallocd(verbose,__FILE__,__LINE__,sizeof(struct mbsys_mr1_struct),
-				(void **)&mb_io_ptr->store_data,error);
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-	data = (struct mbf_mr1aldeo_struct *) mb_io_ptr->raw_data;
-
-	/* initialize everything to zeros */
-	mbr_zero_mr1aldeo(verbose,data,error);
-	mb_io_ptr->fileheader = MB_NO;
-	mb_io_ptr->hdr_comment_size = 0;
-	mb_io_ptr->hdr_comment = NULL;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_dem_mr1aldeo(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_dem_mr1aldeo";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* deallocate memory for data descriptor */
-	status = mb_freed(verbose,__FILE__, __LINE__, (void **)&mb_io_ptr->raw_data,error);
-	status = mb_freed(verbose,__FILE__, __LINE__, (void **)&mb_io_ptr->store_data,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_zero_mr1aldeo(int verbose, struct mbf_mr1aldeo_struct *data, int *error)
-{
-	char	*function_name = "mbr_zero_mr1aldeo";
-	int	status = MB_SUCCESS;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       data:       %p\n",(void *)data);
-		}
-
-	/* initialize everything to zeros */
-	if (data != NULL)
-		{
-		/* type of data record */
-		data->kind = MB_DATA_NONE;
-
-		/* file header info */
-		data->mf_magic = 6666;
-		data->mf_count = 0;
-		if (data->mf_log == NULL)
-
-		/* ping header */
-		data->sec = 0;
-		data->usec = 0;
-		data->png_lon = 0.0;
-		data->png_lat = 0.0;
-		data->png_course = 0.0;
-		data->png_compass = 0.0;
-		data->png_prdepth = 0.0;
-		data->png_alt = 0.0;
-		data->png_pitch = 0.0;
-		data->png_roll = 0.0;
-		data->png_temp = 0.0;
-		data->png_atssincr = 0.0;
-		data->png_tt = 0.0;
-
-		/* port settings */
-		data->port_trans[0] = 0.0;
-		data->port_trans[1] = 0.0;
-		data->port_gain = 0.0;
-		data->port_pulse = 0.0;
-		data->port_btycount = 0;
-		data->port_btypad = 0;
-		data->port_ssoffset = 0.0;
-		data->port_sscount = 0;
-		data->port_sspad = 0;
-
-		/* starboard settings */
-		data->stbd_trans[0] = 0.0;
-		data->stbd_trans[1] = 0.0;
-		data->stbd_gain = 0.0;
-		data->stbd_pulse = 0.0;
-		data->stbd_btycount = 0;
-		data->stbd_btypad = 0;
-		data->stbd_ssoffset = 0.0;
-		data->stbd_sscount = 0;
-		data->stbd_sspad = 0;
-
-		/* bathymetry */
-		for (i=0;i<MBF_MR1ALDEO_BEAMS_SIDE;i++)
-			{
-			data->bath_acrosstrack_port[i] = 0.0;
-			data->bath_port[i] = 0.0;
-			data->tt_port[i] = 0.0;
-			data->angle_port[i] = 0.0;
-			data->bath_acrosstrack_stbd[i] = 0.0;
-			data->bath_stbd[i] = 0.0;
-			data->tt_stbd[i] = 0.0;
-			data->angle_stbd[i] = 0.0;
-			}
-
-		/* sidescan */
-		for (i=0;i<MBF_MR1ALDEO_PIXELS_SIDE;i++)
-			{
-			data->ss_port[i] = 0.0;
-			data->ss_stbd[i] = 0.0;
-			}
-
-		/* comment */
-		strncpy(data->comment,"\0",MBF_MR1ALDEO_MAXLINE);
-
-		}
-
-	/* assume success */
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_rt_mr1aldeo(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_rt_mr1aldeo";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_mr1aldeo_struct *data;
-	struct mbsys_mr1_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointers to mbio descriptor and data structures */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-	data = (struct mbf_mr1aldeo_struct *) mb_io_ptr->raw_data;
-	store = (struct mbsys_mr1_struct *) store_ptr;
-
-	/* read next data from file */
-	status = mbr_mr1aldeo_rd_data(verbose,mbio_ptr,error);
-
-	/* set error and kind in mb_io_ptr */
-	mb_io_ptr->new_error = *error;
-	mb_io_ptr->new_kind = data->kind;
-
-	/* translate values to sb2100 data storage structure */
-	if (status == MB_SUCCESS
-		&& store != NULL)
-		{
-		/* type of data record */
-		store->kind = data->kind;
-
-		/* file header info */
-		store->mf_magic = data->mf_magic;
-		store->mf_count = data->mf_count;
-
-		/* ping header */
-		store->sec = data->sec;
-		store->usec = data->usec;
-		store->png_lon = data->png_lon;
-		store->png_lat = data->png_lat;
-		store->png_course = data->png_course;
-		store->png_compass = data->png_compass;
-		store->png_prdepth = data->png_prdepth;
-		store->png_alt = data->png_alt;
-		store->png_pitch = data->png_pitch;
-		store->png_roll = data->png_roll;
-		store->png_temp = data->png_temp;
-		store->png_atssincr = data->png_atssincr;
-		store->png_tt = data->png_tt;
-
-		/* port settings */
-		store->port_trans[0] = data->port_trans[0];
-		store->port_trans[1] = data->port_trans[1];
-		store->port_gain = data->port_gain;
-		store->port_pulse = data->port_pulse;
-		store->port_btycount = data->port_btycount;
-		store->port_btypad = data->port_btypad;
-		store->port_ssoffset = data->port_ssoffset;
-		store->port_sscount = data->port_sscount;
-		store->port_sspad = data->port_sspad;
-
-		/* starboard settings */
-		store->stbd_trans[0] = data->stbd_trans[0];
-		store->stbd_trans[1] = data->stbd_trans[1];
-		store->stbd_gain = data->stbd_gain;
-		store->stbd_pulse = data->stbd_pulse;
-		store->stbd_btycount = data->stbd_btycount;
-		store->stbd_btypad = data->stbd_btypad;
-		store->stbd_ssoffset = data->stbd_ssoffset;
-		store->stbd_sscount = data->stbd_sscount;
-		store->stbd_sspad = data->stbd_sspad;
-
-		/* bathymetry */
-		for (i=0;i<store->port_btycount;i++)
-			{
-			store->bath_acrosstrack_port[i]
-				= data->bath_acrosstrack_port[i];
-			store->bath_port[i] = data->bath_port[i];
-			store->tt_port[i] = data->tt_port[i];
-			store->angle_port[i] = data->angle_port[i];
-			}
-		for (i=0;i<store->stbd_btycount;i++)
-			{
-			store->bath_acrosstrack_stbd[i]
-				= data->bath_acrosstrack_stbd[i];
-			store->bath_stbd[i] = data->bath_stbd[i];
-			store->tt_stbd[i] = data->tt_stbd[i];
-			store->angle_stbd[i] = data->angle_stbd[i];
-			}
-
-		/* sidescan */
-		for (i=0;i<store->port_sscount;i++)
-			{
-			store->ss_port[i] = data->ss_port[i];
-			}
-		for (i=0;i<store->stbd_sscount;i++)
-			{
-			store->ss_stbd[i] = data->ss_stbd[i];
-			}
-
-		/* comment */
-		strncpy(store->comment,data->comment,MBF_MR1ALDEO_MAXLINE);
-
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_wt_mr1aldeo(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_wt_mr1aldeo";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_mr1aldeo_struct *data;
-	struct mbsys_mr1_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_mr1aldeo_struct *) mb_io_ptr->raw_data;
-	store = (struct mbsys_mr1_struct *) store_ptr;
-
-	/* first translate values from data storage structure */
-	if (store != NULL)
-		{
-		/* type of data record */
-		data->kind = store->kind;
-
-		/* file header info */
-		data->mf_magic = store->mf_magic;
-		data->mf_count = store->mf_count;
-
-		/* ping header */
-		data->sec = store->sec;
-		data->usec = store->usec;
-		data->png_lon = store->png_lon;
-		data->png_lat = store->png_lat;
-		data->png_course = store->png_course;
-		data->png_compass = store->png_compass;
-		data->png_prdepth = store->png_prdepth;
-		data->png_alt = store->png_alt;
-		data->png_pitch = store->png_pitch;
-		data->png_roll = store->png_roll;
-		data->png_temp = store->png_temp;
-		data->png_atssincr = store->png_atssincr;
-		data->png_tt = store->png_tt;
-
-		/* port settings */
-		data->port_trans[0] = store->port_trans[0];
-		data->port_trans[1] = store->port_trans[1];
-		data->port_gain = store->port_gain;
-		data->port_pulse = store->port_pulse;
-		data->port_btycount = store->port_btycount;
-		data->port_btypad = store->port_btypad;
-		data->port_ssoffset = store->port_ssoffset;
-		data->port_sscount = store->port_sscount;
-		data->port_sspad = store->port_sspad;
-
-		/* starboard settings */
-		data->stbd_trans[0] = store->stbd_trans[0];
-		data->stbd_trans[1] = store->stbd_trans[1];
-		data->stbd_gain = store->stbd_gain;
-		data->stbd_pulse = store->stbd_pulse;
-		data->stbd_btycount = store->stbd_btycount;
-		data->stbd_btypad = store->stbd_btypad;
-		data->stbd_ssoffset = store->stbd_ssoffset;
-		data->stbd_sscount = store->stbd_sscount;
-		data->stbd_sspad = store->stbd_sspad;
-
-		/* bathymetry */
-		for (i=0;i<data->port_btycount;i++)
-			{
-			data->bath_acrosstrack_port[i]
-				= store->bath_acrosstrack_port[i];
-			data->bath_port[i] = store->bath_port[i];
-			data->tt_port[i] = store->tt_port[i];
-			data->angle_port[i] = store->angle_port[i];
-			}
-		for (i=0;i<data->stbd_btycount;i++)
-			{
-			data->bath_acrosstrack_stbd[i]
-				= store->bath_acrosstrack_stbd[i];
-			data->bath_stbd[i] = store->bath_stbd[i];
-			data->tt_stbd[i] = store->tt_stbd[i];
-			data->angle_stbd[i] = store->angle_stbd[i];
-			}
-
-		/* sidescan */
-		for (i=0;i<data->port_sscount;i++)
-			{
-			data->ss_port[i] = store->ss_port[i];
-			}
-		for (i=0;i<data->stbd_sscount;i++)
-			{
-			data->ss_stbd[i] = store->ss_stbd[i];
-			}
-
-		/* comment */
-		strncpy(data->comment,store->comment,MBF_MR1ALDEO_MAXLINE);
-
-		}
-
-	/* write next data to file */
-	status = mbr_mr1aldeo_wr_data(verbose,mbio_ptr,data,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_mr1aldeo_rd_data(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_mr1aldeo_rd_data";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_mr1aldeo_struct *data;
-	XDR	*xdrs;
-	int	read_size;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_mr1aldeo_struct *) mb_io_ptr->raw_data;
-	xdrs = mb_io_ptr->xdrs;
-
-	/* initialize everything to zeros */
-	mbr_zero_mr1aldeo(verbose,data,error);
-
-	/* if first time through read file header */
-	if (mb_io_ptr->fileheader == MB_NO)
-		{
-		status = mbr_mr1aldeo_rd_hdr(verbose,xdrs,data,
-			&mb_io_ptr->hdr_comment,error);
-		if (status == MB_SUCCESS)
-			{
-			mb_io_ptr->fileheader = MB_YES;
-			if (mb_io_ptr->hdr_comment == NULL)
-				mb_io_ptr->hdr_comment_size = 0;
-			else
-				mb_io_ptr->hdr_comment_size
-					= strlen(mb_io_ptr->hdr_comment);
-			mb_io_ptr->hdr_comment_loc = 0;
-			if (mb_io_ptr->hdr_comment_size > 80)
-				read_size = 80;
-			else
-				read_size = mb_io_ptr->hdr_comment_size;
-			strncpy(data->comment,mb_io_ptr->hdr_comment,read_size);
-			mb_io_ptr->hdr_comment_loc = read_size;
-			data->kind = MB_DATA_COMMENT;
-			}
-		}
-
-	/* if comments are still held in mb_io_ptr->hdr_comment then
-		extract comment and return */
-	else if (mb_io_ptr->hdr_comment_size > mb_io_ptr->hdr_comment_loc)
-		{
-		if (mb_io_ptr->hdr_comment_size - mb_io_ptr->hdr_comment_loc
-			> 80)
-			read_size = 80;
-		else
-			read_size = mb_io_ptr->hdr_comment_size
-				- mb_io_ptr->hdr_comment_loc;
-		strncpy(data->comment,
-			&mb_io_ptr->hdr_comment[mb_io_ptr->hdr_comment_loc],
-			read_size);
-		mb_io_ptr->hdr_comment_loc += read_size;
-		data->kind = MB_DATA_COMMENT;
-		}
-
-	/* else read data */
-	else
-		{
-		status = mbr_mr1aldeo_rd_ping(verbose,xdrs,data,error);
-		if (status == MB_SUCCESS)
-			{
-			data->kind = MB_DATA_DATA;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_mr1aldeo_rd_hdr(int verbose, XDR *xdrs,
-		struct mbf_mr1aldeo_struct *data, char **hdr_comment,
-		int *error)
-{
-	char	*function_name = "mbr_mr1aldeo_rd_hdr";
-	int	status = MB_SUCCESS;
-	int	len;
-	unsigned int	ulen;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       xdrs:       %p\n",(void *)xdrs);
-		fprintf(stderr,"dbg2       data:       %p\n",(void *)data);
-		fprintf(stderr,"dbg2       hdr_comment:%p\n",(void *)*hdr_comment);
-		}
-
-	/* set status and error */
-	*error = MB_ERROR_NO_ERROR;
-	status = MB_SUCCESS;
-
-	/* read magic number */
-	status = xdr_int(xdrs, &data->mf_magic);
-
-	/* read ping count */
-	if (status == MB_SUCCESS)
-		status = xdr_int(xdrs, &data->mf_count);
-
-	/* read header comment */
-	if (status == MB_SUCCESS)
-		status = xdr_int(xdrs, &len);
-	if (status == MB_SUCCESS)
-		{
-		if (len > 0)
-			{
-			status = mb_mallocd(verbose,__FILE__,__LINE__,len+1,(void **)hdr_comment,error);
-			status = xdr_bytes(xdrs,hdr_comment,&ulen,(unsigned int)(len + 1));
-			}
-		else if (len < 0)
-			status = MB_FAILURE;
-		}
-
-	if (status == MB_FAILURE && *error == MB_ERROR_NO_ERROR)
-		*error = MB_ERROR_EOF;
-	else if (data->mf_magic != 6666)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       mf_magic:         %d\n",data->mf_magic);
-		fprintf(stderr,"dbg5       mf_count:         %d\n",data->mf_count);
-		fprintf(stderr,"dbg5       hdr_comment:\n%s\n",*hdr_comment);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_mr1aldeo_rd_ping(int verbose, XDR *xdrs,
-		struct mbf_mr1aldeo_struct *data, int *error)
-{
-	char	*function_name = "mbr_mr1aldeo_rd_ping";
-	int	status = MB_SUCCESS;
-	int	dummy_count;
-	float	dummy;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       xdrs:       %p\n",(void *)xdrs);
-		fprintf(stderr,"dbg2       data:       %p\n",(void *)data);
-		}
-
-	/* read ping header */
-	status = xdr_int(xdrs, &data->sec);
-	status = xdr_int(xdrs, &data->usec);
-	status = xdr_double(xdrs, &data->png_lon);
-	status = xdr_double(xdrs, &data->png_lat);
-	status = xdr_float(xdrs, &data->png_course);
-	status = xdr_float(xdrs, &data->png_compass);
-	status = xdr_float(xdrs, &data->png_prdepth);
-	status = xdr_float(xdrs, &data->png_alt);
-	status = xdr_float(xdrs, &data->png_pitch);
-	status = xdr_float(xdrs, &data->png_roll);
-	status = xdr_float(xdrs, &data->png_temp);
-	status = xdr_float(xdrs, &data->png_atssincr);
-	status = xdr_float(xdrs, &data->png_tt);
-
-	/* read port side header */
-	status = xdr_float(xdrs, &data->port_trans[0]);
-	status = xdr_float(xdrs, &data->port_trans[1]);
-	status = xdr_float(xdrs, &data->port_gain);
-	status = xdr_float(xdrs, &data->port_pulse);
-	status = xdr_int(xdrs, &data->port_btycount);
-	status = xdr_float(xdrs, &data->port_ssoffset);
-	status = xdr_int(xdrs, &data->port_sscount);
-
-	/* read starboard side header */
-	status = xdr_float(xdrs, &data->stbd_trans[0]);
-	status = xdr_float(xdrs, &data->stbd_trans[1]);
-	status = xdr_float(xdrs, &data->stbd_gain);
-	status = xdr_float(xdrs, &data->stbd_pulse);
-	status = xdr_int(xdrs, &data->stbd_btycount);
-	status = xdr_float(xdrs, &data->stbd_ssoffset);
-	status = xdr_int(xdrs, &data->stbd_sscount);
-
-	/* read bathymetry and sidescan data
-		- handle more data than allowed by MBIO by
-		  throwing away the excess */
-
-	/* do port bathymetry */
-	if (data->port_btycount > MBF_MR1ALDEO_BEAMS_SIDE)
-		{
-		if (verbose > 0)
-			{
-			fprintf(stderr, "Port bathymetry count exceeds MBIO maximum: %d %d\n",
-				data->port_btycount, MBF_MR1ALDEO_BEAMS_SIDE);
-			}
-		dummy_count = data->port_btycount
-			- MBF_MR1ALDEO_BEAMS_SIDE;
-		data->port_btycount = MBF_MR1ALDEO_BEAMS_SIDE;
-		}
-	else
-		dummy_count = 0;
-	for (i=0;i<data->port_btycount;i++)
-		{
-		status = xdr_float(xdrs,&data->bath_acrosstrack_port[i]);
-		status = xdr_float(xdrs,&data->bath_port[i]);
-		status = xdr_float(xdrs,&data->tt_port[i]);
-		status = xdr_float(xdrs,&data->angle_port[i]);
-		}
-	for (i=0;i<dummy_count;i++)
-		{
-		status = xdr_float(xdrs,&dummy);
-		status = xdr_float(xdrs,&dummy);
-		status = xdr_float(xdrs,&dummy);
-		status = xdr_float(xdrs,&dummy);
-		}
-
-	/* do port sidescan */
-	if (data->port_sscount > MBF_MR1ALDEO_PIXELS_SIDE)
-		{
-		if (verbose > 0)
-			{
-			fprintf(stderr, "Port sidescan count exceeds MBIO maximum: %d %d\n",
-				data->port_sscount, MBF_MR1ALDEO_PIXELS_SIDE);
-			}
-		dummy_count = data->port_sscount
-			- MBF_MR1ALDEO_PIXELS_SIDE;
-		data->port_sscount = MBF_MR1ALDEO_PIXELS_SIDE;
-		}
-	else
-		dummy_count = 0;
-	for (i=0;i<data->port_sscount;i++)
-		{
-		status = xdr_float(xdrs,&data->ss_port[i]);
-		}
-	for (i=0;i<dummy_count;i++)
-		{
-		status = xdr_float(xdrs,&dummy);
-		}
-
-	/* do starboard bathymetry */
-	if (data->stbd_btycount > MBF_MR1ALDEO_BEAMS_SIDE)
-		{
-		/* output debug messages */
-		if (verbose > 0)
-			{
-			fprintf(stderr, "Starboard bathymetry count exceeds MBIO maximum: %d %d\n",
-				data->stbd_btycount, MBF_MR1ALDEO_BEAMS_SIDE);
-			}
-		dummy_count = data->stbd_btycount
-			- MBF_MR1ALDEO_BEAMS_SIDE;
-		data->stbd_btycount = MBF_MR1ALDEO_BEAMS_SIDE;
-		}
-	else
-		dummy_count = 0;
-	for (i=0;i<data->stbd_btycount;i++)
-		{
-		status = xdr_float(xdrs,&data->bath_acrosstrack_stbd[i]);
-		status = xdr_float(xdrs,&data->bath_stbd[i]);
-		status = xdr_float(xdrs,&data->tt_stbd[i]);
-		status = xdr_float(xdrs,&data->angle_stbd[i]);
-		}
-	for (i=0;i<dummy_count;i++)
-		{
-		status = xdr_float(xdrs,&dummy);
-		status = xdr_float(xdrs,&dummy);
-		status = xdr_float(xdrs,&dummy);
-		status = xdr_float(xdrs,&dummy);
-		}
-
-	/* do starboard sidescan */
-	if (data->stbd_sscount > MBF_MR1ALDEO_PIXELS_SIDE)
-		{
-		/* output debug messages */
-		if (verbose > 0)
-			{
-			fprintf(stderr, "Starboard sidescan count exceeds MBIO maximum: %d %d\n",
-				data->stbd_sscount, MBF_MR1ALDEO_PIXELS_SIDE);
-			}
-		dummy_count = data->stbd_sscount
-			- MBF_MR1ALDEO_PIXELS_SIDE;
-		data->stbd_sscount = MBF_MR1ALDEO_PIXELS_SIDE;
-		}
-	else
-		dummy_count = 0;
-	for (i=0;i<data->stbd_sscount;i++)
-		{
-		status = xdr_float(xdrs,&data->ss_stbd[i]);
-		}
-	for (i=0;i<dummy_count;i++)
-		{
-		status = xdr_float(xdrs,&dummy);
-		}
-
-	if (status == MB_FAILURE)
-		*error = MB_ERROR_EOF;
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       sec:              %d\n",data->sec);
-		fprintf(stderr,"dbg5       usec:             %d\n",data->usec);
-		fprintf(stderr,"dbg5       longitude:        %f\n",
-			data->png_lon);
-		fprintf(stderr,"dbg5       latitude:         %f\n",
-			data->png_lat);
-		fprintf(stderr,"dbg5       course:           %f\n",
-			data->png_course);
-		fprintf(stderr,"dbg5       heading:          %f\n",
-			data->png_compass);
-		fprintf(stderr,"dbg5       pressure depth:   %f\n",
-			data->png_prdepth);
-		fprintf(stderr,"dbg5       altitude:         %f\n",
-			data->png_alt);
-		fprintf(stderr,"dbg5       pitch:            %f\n",
-			data->png_pitch);
-		fprintf(stderr,"dbg5       roll:             %f\n",
-			data->png_roll);
-		fprintf(stderr,"dbg5       temperature:      %f\n",
-			data->png_temp);
-		fprintf(stderr,"dbg5       pixel spacing:    %f\n",
-			data->png_atssincr);
-		fprintf(stderr,"dbg5       nadir travel time:%f\n",
-			data->png_tt);
-		fprintf(stderr,"dbg5       port transmit 0:  %f\n",
-			data->port_trans[0]);
-		fprintf(stderr,"dbg5       port transmit 1:  %f\n",
-			data->port_trans[1]);
-		fprintf(stderr,"dbg5       port gain:        %f\n",
-			data->port_gain);
-		fprintf(stderr,"dbg5       port pulse:       %f\n",
-			data->port_pulse);
-		fprintf(stderr,"dbg5       port bath count:  %d\n",
-			data->port_btycount);
-		fprintf(stderr,"dbg5       port ss offset:   %f\n",
-			data->port_ssoffset);
-		fprintf(stderr,"dbg5       port ss count:    %d\n",
-			data->port_sscount);
-		fprintf(stderr,"dbg5       stbd transmit 0:  %f\n",
-			data->stbd_trans[0]);
-		fprintf(stderr,"dbg5       stbd transmit 1:  %f\n",
-			data->stbd_trans[1]);
-		fprintf(stderr,"dbg5       stbd gain:        %f\n",
-			data->stbd_gain);
-		fprintf(stderr,"dbg5       stbd pulse:       %f\n",
-			data->stbd_pulse);
-		fprintf(stderr,"dbg5       stbd bath count:  %d\n",
-			data->stbd_btycount);
-		fprintf(stderr,"dbg5       stbd ss offset:   %f\n",
-			data->stbd_ssoffset);
-		fprintf(stderr,"dbg5       stbd ss count:    %d\n",
-			data->stbd_sscount);
-		fprintf(stderr,"\n");
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"dbg5       port_beam  depth   xtrack    tt   angle\n");
-		for (i=0;i<data->port_btycount;i++)
-		  {
-		  fprintf(stderr,"dbg5       %3d     %12.4g %12.4g %12.4g %12.4g\n",
-			i,data->bath_port[i],data->bath_acrosstrack_port[i],
-			data->tt_port[i],data->angle_port[i]);
-		  }
-		fprintf(stderr,"\n");
-		fprintf(stderr,"dbg5       stbd_beam  depth   xtrack    tt   angle\n");
-		for (i=0;i<data->stbd_btycount;i++)
-		  {
-		  fprintf(stderr,"dbg5       %3d     %12.4g %12.4g %12.4g %12.4g\n",
-			i,data->bath_stbd[i],data->bath_acrosstrack_stbd[i],
-			data->tt_stbd[i],data->angle_stbd[i]);
-		  }
-		fprintf(stderr,"\n");
-		fprintf(stderr,"dbg5       port_pixel  sidescan\n");
-		for (i=0;i<data->port_sscount;i++)
-		  {
-		  fprintf(stderr,"dbg5       %3d     %12.4g\n",
-			i,data->ss_port[i]);
-		  }
-		fprintf(stderr,"\n");
-		fprintf(stderr,"dbg5       stbd_pixel  sidescan\n");
-		for (i=0;i<data->stbd_sscount;i++)
-		  {
-		  fprintf(stderr,"dbg5       %3d     %12.4g\n",
-			i,data->ss_stbd[i]);
-		  }
-		fprintf(stderr,"\n");
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_mr1aldeo_wr_data(int verbose, void *mbio_ptr,struct mbf_mr1aldeo_struct *data, int *error)
-{
-	char	*function_name = "mbr_mr1aldeo_wr_data";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	XDR	*xdrs;
-	char	*tmp;
-	int	lenc, lenhc, len;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       data:       %p\n",(void *)data);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to XDR structure */
-	xdrs = mb_io_ptr->xdrs;
-
-	/* if comment and file header not written */
-	if (mb_io_ptr->fileheader == MB_NO && data->kind == MB_DATA_COMMENT)
-		{
-		/* add comment to string mb_io_ptr->hdr_comment
-			to be be written in file header */
-		lenc = strlen(data->comment);
-		lenhc = 0;
-		if (mb_io_ptr->hdr_comment != NULL)
-			lenhc = strlen(mb_io_ptr->hdr_comment);
-		len = lenc + lenhc + 1;
-		status = mb_mallocd(verbose,__FILE__,__LINE__,len,(void **)&tmp,error);
-		strcpy(tmp,"\0");
-		if (lenhc > 0) strcpy(tmp,mb_io_ptr->hdr_comment);
-		if (lenc > 0) strcat(tmp,data->comment);
-		if (mb_io_ptr->hdr_comment != NULL)
-			mb_freed(verbose,__FILE__, __LINE__, (void **)&mb_io_ptr->hdr_comment,error);
-		mb_io_ptr->hdr_comment = tmp;
-		}
-
-	/* if data and file header not written */
-	else if (mb_io_ptr->fileheader == MB_NO
-		&& data->kind != MB_DATA_COMMENT)
-		{
-		/* write file header */
-		status = mbr_mr1aldeo_wr_hdr(verbose,xdrs,data,
-				&mb_io_ptr->hdr_comment,error);
-		mb_io_ptr->fileheader = MB_YES;
-
-		/* write data */
-		status = mbr_mr1aldeo_wr_ping(verbose,xdrs,data,error);
-		}
-
-	/* if data and file header written */
-	else if (mb_io_ptr->fileheader == MB_YES
-		&& data->kind == MB_DATA_DATA)
-		{
-		/* write data */
-		status = mbr_mr1aldeo_wr_ping(verbose,xdrs,data,error);
-		}
-
-	/* if not data and file header written */
-	else if (mb_io_ptr->fileheader == MB_YES
-		&& data->kind != MB_DATA_DATA)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_BAD_KIND;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Data record kind in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       kind:       %d\n",data->kind);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_mr1aldeo_wr_hdr(int verbose, XDR *xdrs,
-		struct mbf_mr1aldeo_struct *data, char **hdr_comment, int *error)
-{
-	char	*function_name = "mbr_mr1aldeo_wr_hdr";
-	int	status = MB_SUCCESS;
-	int	len;
-	unsigned int	ulen;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       xdrs:       %p\n",(void *)xdrs);
-		fprintf(stderr,"dbg2       data:       %p\n",(void *)data);
-		fprintf(stderr,"dbg2       hdr_comment:%p\n",(void *)*hdr_comment);
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       mf_magic:         %d\n",data->mf_magic);
-		fprintf(stderr,"dbg5       mf_count:         %d\n",data->mf_count);
-		fprintf(stderr,"dbg5       hdr_comment:\n%s\n",*hdr_comment);
-		}
-
-	/* set status and error */
-	*error = MB_ERROR_NO_ERROR;
-	status = MB_SUCCESS;
-
-	/* write magic number */
-	status = xdr_int(xdrs, &data->mf_magic);
-
-	/* write ping count */
-	if (status == MB_SUCCESS)
-		{
-		status = xdr_int(xdrs, &data->mf_count);
-		}
-
-	/* write header comment */
-	if (status == MB_SUCCESS)
-		{
-		if (*hdr_comment == NULL)
-			len = 0;
-		else
-			len = strlen(*hdr_comment);
-		status = xdr_int(xdrs, &len);
-		}
-	if (status == MB_SUCCESS && len > 0)
-		{
-		ulen = len;
-		status = xdr_bytes(xdrs,hdr_comment,
-				&ulen,(unsigned int)len);
-		}
-
-	/* check for an error */
-	if (status != MB_SUCCESS)
-		*error = MB_ERROR_WRITE_FAIL;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_mr1aldeo_wr_ping(int verbose, XDR *xdrs, struct mbf_mr1aldeo_struct *data, int *error)
-{
-	char	*function_name = "mbr_mr1aldeo_wr_ping";
-	int	status = MB_SUCCESS;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       xdrs:       %p\n",(void *)xdrs);
-		fprintf(stderr,"dbg2       data:       %p\n",(void *)data);
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       sec:              %d\n",data->sec);
-		fprintf(stderr,"dbg5       usec:             %d\n",data->usec);
-		fprintf(stderr,"dbg5       longitude:        %f\n",
-			data->png_lon);
-		fprintf(stderr,"dbg5       latitude:         %f\n",
-			data->png_lat);
-		fprintf(stderr,"dbg5       course:           %f\n",
-			data->png_course);
-		fprintf(stderr,"dbg5       heading:          %f\n",
-			data->png_compass);
-		fprintf(stderr,"dbg5       pressure depth:   %f\n",
-			data->png_prdepth);
-		fprintf(stderr,"dbg5       altitude:         %f\n",
-			data->png_alt);
-		fprintf(stderr,"dbg5       pitch:            %f\n",
-			data->png_pitch);
-		fprintf(stderr,"dbg5       roll:             %f\n",
-			data->png_roll);
-		fprintf(stderr,"dbg5       temperature:      %f\n",
-			data->png_temp);
-		fprintf(stderr,"dbg5       pixel spacing:    %f\n",
-			data->png_atssincr);
-		fprintf(stderr,"dbg5       nadir travel time:%f\n",
-			data->png_tt);
-		fprintf(stderr,"dbg5       port transmit 0:  %f\n",
-			data->port_trans[0]);
-		fprintf(stderr,"dbg5       port transmit 1:  %f\n",
-			data->port_trans[1]);
-		fprintf(stderr,"dbg5       port gain:        %f\n",
-			data->port_gain);
-		fprintf(stderr,"dbg5       port pulse:       %f\n",
-			data->port_pulse);
-		fprintf(stderr,"dbg5       port bath count:  %d\n",
-			data->port_btycount);
-		fprintf(stderr,"dbg5       port ss offset:   %f\n",
-			data->port_ssoffset);
-		fprintf(stderr,"dbg5       port ss count:    %d\n",
-			data->port_sscount);
-		fprintf(stderr,"dbg5       stbd transmit 0:  %f\n",
-			data->stbd_trans[0]);
-		fprintf(stderr,"dbg5       stbd transmit 1:  %f\n",
-			data->stbd_trans[1]);
-		fprintf(stderr,"dbg5       stbd gain:        %f\n",
-			data->stbd_gain);
-		fprintf(stderr,"dbg5       stbd pulse:       %f\n",
-			data->stbd_pulse);
-		fprintf(stderr,"dbg5       stbd bath count:  %d\n",
-			data->stbd_btycount);
-		fprintf(stderr,"dbg5       stbd ss offset:   %f\n",
-			data->stbd_ssoffset);
-		fprintf(stderr,"dbg5       stbd ss count:    %d\n",
-			data->stbd_sscount);
-		fprintf(stderr,"\n");
-		fprintf(stderr,"dbg5       port_beam  depth   xtrack    tt   angle\n");
-		for (i=0;i<data->port_btycount;i++)
-		  {
-		  fprintf(stderr,"dbg5       %3d     %12.4g %12.4g %12.4g %12.4g\n",
-			i,data->bath_port[i],data->bath_acrosstrack_port[i],
-			data->tt_port[i],data->angle_port[i]);
-		  }
-		fprintf(stderr,"\n");
-		fprintf(stderr,"dbg5       stbd_beam  depth   xtrack    tt   angle\n");
-		for (i=0;i<data->stbd_btycount;i++)
-		  {
-		  fprintf(stderr,"dbg5       %3d     %12.4g %12.4g %12.4g %12.4g\n",
-			i,data->bath_stbd[i],data->bath_acrosstrack_stbd[i],
-			data->tt_stbd[i],data->angle_stbd[i]);
-		  }
-		fprintf(stderr,"\n");
-		fprintf(stderr,"dbg5       port_pixel  sidescan\n");
-		for (i=0;i<data->port_sscount;i++)
-		  {
-		  fprintf(stderr,"dbg5       %3d     %12.4g\n",
-			i,data->ss_port[i]);
-		  }
-		fprintf(stderr,"\n");
-		fprintf(stderr,"dbg5       stbd_pixel  sidescan\n");
-		for (i=0;i<data->stbd_sscount;i++)
-		  {
-		  fprintf(stderr,"dbg5       %3d     %12.4g\n",
-			i,data->ss_stbd[i]);
-		  }
-		fprintf(stderr,"\n");
-		}
-
-	/* write ping header */
-	status = xdr_int(xdrs, &data->sec);
-	status = xdr_int(xdrs, &data->usec);
-	status = xdr_double(xdrs, &data->png_lon);
-	status = xdr_double(xdrs, &data->png_lat);
-	status = xdr_float(xdrs, &data->png_course);
-	status = xdr_float(xdrs, &data->png_compass);
-	status = xdr_float(xdrs, &data->png_prdepth);
-	status = xdr_float(xdrs, &data->png_alt);
-	status = xdr_float(xdrs, &data->png_pitch);
-	status = xdr_float(xdrs, &data->png_roll);
-	status = xdr_float(xdrs, &data->png_temp);
-	status = xdr_float(xdrs, &data->png_atssincr);
-	status = xdr_float(xdrs, &data->png_tt);
-
-	/* write port side header */
-	status = xdr_float(xdrs, &data->port_trans[0]);
-	status = xdr_float(xdrs, &data->port_trans[1]);
-	status = xdr_float(xdrs, &data->port_gain);
-	status = xdr_float(xdrs, &data->port_pulse);
-	status = xdr_int(xdrs, &data->port_btycount);
-	status = xdr_float(xdrs, &data->port_ssoffset);
-	status = xdr_int(xdrs, &data->port_sscount);
-
-	/* write starboard side header */
-	status = xdr_float(xdrs, &data->stbd_trans[0]);
-	status = xdr_float(xdrs, &data->stbd_trans[1]);
-	status = xdr_float(xdrs, &data->stbd_gain);
-	status = xdr_float(xdrs, &data->stbd_pulse);
-	status = xdr_int(xdrs, &data->stbd_btycount);
-	status = xdr_float(xdrs, &data->stbd_ssoffset);
-	status = xdr_int(xdrs, &data->stbd_sscount);
-
-	/* write bathymetry and sidescan data */
-	for (i=0;i<data->port_btycount;i++)
-		{
-		status = xdr_float(xdrs,&data->bath_acrosstrack_port[i]);
-		status = xdr_float(xdrs,&data->bath_port[i]);
-		status = xdr_float(xdrs,&data->tt_port[i]);
-		status = xdr_float(xdrs,&data->angle_port[i]);
-		}
-	for (i=0;i<data->port_sscount;i++)
-		{
-		status = xdr_float(xdrs,&data->ss_port[i]);
-		}
-	for (i=0;i<data->stbd_btycount;i++)
-		{
-		status = xdr_float(xdrs,&data->bath_acrosstrack_stbd[i]);
-		status = xdr_float(xdrs,&data->bath_stbd[i]);
-		status = xdr_float(xdrs,&data->tt_stbd[i]);
-		status = xdr_float(xdrs,&data->angle_stbd[i]);
-		}
-	for (i=0;i<data->stbd_sscount;i++)
-		{
-		status = xdr_float(xdrs,&data->ss_stbd[i]);
-		}
-	if (status == MB_FAILURE)
-		*error = MB_ERROR_WRITE_FAIL;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mbr_mr1bldeo.c b/src/mbio/mbr_mr1bldeo.c
deleted file mode 100644
index 866a3d2..0000000
--- a/src/mbio/mbr_mr1bldeo.c
+++ /dev/null
@@ -1,1589 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbr_mr1bldeo.c	10/24/95
- *	$Id: mbr_mr1bldeo.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1994-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbr_mr1bldeo.c contains the functions for reading and writing
- * multibeam data in the MR1BLDEO format.
- * These functions include:
- *   mbr_alm_mr1bldeo	- allocate read/write memory
- *   mbr_dem_mr1bldeo	- deallocate read/write memory
- *   mbr_rt_mr1bldeo	- read and translate data
- *   mbr_wt_mr1bldeo	- translate and write data
- *
- * Author:	D. W. Caress
- * Date:	October 24, 1995
- * $Log: mbr_mr1bldeo.c,v $
- * Revision 5.8  2008/07/10 06:43:40  caress
- * Preparing for 5.1.1beta20
- *
- * Revision 5.7  2005/11/05 00:48:05  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.6  2003/05/20 18:05:32  caress
- * Added svp_source to data source parameters.
- *
- * Revision 5.5  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.4  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.3  2001/07/20 00:32:54  caress
- * Release 5.0.beta03
- *
- * Revision 5.2  2001/03/22  20:50:02  caress
- * Trying to make version 5.0.beta0
- *
- * Revision 5.1  2001/01/22  07:43:34  caress
- * Version 5.0.beta01
- *
- * Revision 5.0  2000/12/01  22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 1.9  2000/10/11  01:03:21  caress
- * Convert to ANSI C
- *
- * Revision 1.8  2000/10/03  21:48:03  caress
- * Snapshot for Dale.
- *
- * Revision 1.7  2000/09/30  06:34:20  caress
- * Snapshot for Dale.
- *
- * Revision 1.6  1999/05/05  20:32:19  caress
- * Fixed bugs in handling updated bathymetry through mb_put_all call.
- *
- * Revision 1.5  1998/10/05  17:46:15  caress
- * MB-System version 4.6beta
- *
- * Revision 1.4  1997/04/21  17:02:07  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 1.3  1996/04/22  13:21:19  caress
- * Now have DTR and MIN/MAX defines in mb_define.h
- *
- * Revision 1.3  1996/04/22  13:21:19  caress
- * Now have DTR and MIN/MAX defines in mb_define.h
- *
- * Revision 1.2  1996/04/22  11:16:30  caress
- * DTR define now in mb_io.h
- *
- * Revision 1.1  1996/03/12  17:18:14  caress
- * Initial revision
- *
- * Revision 1.1  1996/01/26  21:23:30  caress
- * Initial revision
- *
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-#include <time.h>
-
-/* mbio include files */
-#include "mb_define.h"
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mbsys_mr1b.h"
-#include "mbf_mr1bldeo.h"
-
-/* essential function prototypes */
-int mbr_register_mr1bldeo(int verbose, void *mbio_ptr, int *error);
-int mbr_info_mr1bldeo(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_alm_mr1bldeo(int verbose, void *mbio_ptr, int *error);
-int mbr_dem_mr1bldeo(int verbose, void *mbio_ptr, int *error);
-int mbr_zero_mr1bldeo(int verbose, struct mbf_mr1bldeo_struct *data, int *error);
-int mbr_rt_mr1bldeo(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_wt_mr1bldeo(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_mr1bldeo_rd_data(int verbose, void *mbio_ptr, int *error);
-int mbr_mr1bldeo_rd_hdr(int verbose, XDR *xdrs,
-		struct mbf_mr1bldeo_struct *data, char **hdr_comment,
-		int *error);
-int mbr_mr1bldeo_rd_ping(int verbose, XDR *xdrs,
-		struct mbf_mr1bldeo_struct *data, int *error);
-int mbr_mr1bldeo_wr_data(int verbose, void *mbio_ptr, struct mbf_mr1bldeo_struct *data, int *error);
-int mbr_mr1bldeo_wr_hdr(int verbose, XDR *xdrs,
-		struct mbf_mr1bldeo_struct *data, char **hdr_comment, int *error);
-int mbr_mr1bldeo_wr_ping(int verbose, XDR *xdrs, struct mbf_mr1bldeo_struct *data, int *error);
-
-static char rcs_id[]="$Id: mbr_mr1bldeo.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mbr_register_mr1bldeo(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_register_mr1bldeo";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* get mb_io_ptr */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set format info parameters */
-	status = mbr_info_mr1bldeo(verbose,
-			&mb_io_ptr->system,
-			&mb_io_ptr->beams_bath_max,
-			&mb_io_ptr->beams_amp_max,
-			&mb_io_ptr->pixels_ss_max,
-			mb_io_ptr->format_name,
-			mb_io_ptr->system_name,
-			mb_io_ptr->format_description,
-			&mb_io_ptr->numfile,
-			&mb_io_ptr->filetype,
-			&mb_io_ptr->variable_beams,
-			&mb_io_ptr->traveltime,
-			&mb_io_ptr->beam_flagging,
-			&mb_io_ptr->nav_source,
-			&mb_io_ptr->heading_source,
-			&mb_io_ptr->vru_source,
-			&mb_io_ptr->svp_source,
-			&mb_io_ptr->beamwidth_xtrack,
-			&mb_io_ptr->beamwidth_ltrack,
-			error);
-
-	/* set format and system specific function pointers */
-	mb_io_ptr->mb_io_format_alloc = &mbr_alm_mr1bldeo;
-	mb_io_ptr->mb_io_format_free = &mbr_dem_mr1bldeo;
-	mb_io_ptr->mb_io_store_alloc = &mbsys_mr1b_alloc;
-	mb_io_ptr->mb_io_store_free = &mbsys_mr1b_deall;
-	mb_io_ptr->mb_io_read_ping = &mbr_rt_mr1bldeo;
-	mb_io_ptr->mb_io_write_ping = &mbr_wt_mr1bldeo;
-	mb_io_ptr->mb_io_dimensions = &mbsys_mr1b_dimensions;
-	mb_io_ptr->mb_io_extract = &mbsys_mr1b_extract;
-	mb_io_ptr->mb_io_insert = &mbsys_mr1b_insert;
-	mb_io_ptr->mb_io_extract_nav = &mbsys_mr1b_extract_nav;
-	mb_io_ptr->mb_io_insert_nav = &mbsys_mr1b_insert_nav;
-	mb_io_ptr->mb_io_extract_altitude = &mbsys_mr1b_extract_altitude;
-	mb_io_ptr->mb_io_insert_altitude = NULL;
-	mb_io_ptr->mb_io_extract_svp = NULL;
-	mb_io_ptr->mb_io_insert_svp = NULL;
-	mb_io_ptr->mb_io_ttimes = &mbsys_mr1b_ttimes;
-	mb_io_ptr->mb_io_detects = &mbsys_mr1b_detects;
-	mb_io_ptr->mb_io_copyrecord = &mbsys_mr1b_copy;
-	mb_io_ptr->mb_io_extract_rawss = NULL;
-	mb_io_ptr->mb_io_insert_rawss = NULL;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",mb_io_ptr->system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",mb_io_ptr->beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",mb_io_ptr->beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",mb_io_ptr->pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",mb_io_ptr->format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",mb_io_ptr->system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",mb_io_ptr->format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",mb_io_ptr->numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",mb_io_ptr->filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",mb_io_ptr->variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",mb_io_ptr->traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",mb_io_ptr->beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",mb_io_ptr->nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",mb_io_ptr->heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",mb_io_ptr->vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",mb_io_ptr->svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",mb_io_ptr->beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",mb_io_ptr->beamwidth_ltrack);
-		fprintf(stderr,"dbg2       format_alloc:       %p\n",(void *)mb_io_ptr->mb_io_format_alloc);
-		fprintf(stderr,"dbg2       format_free:        %p\n",(void *)mb_io_ptr->mb_io_format_free);
-		fprintf(stderr,"dbg2       store_alloc:        %p\n",(void *)mb_io_ptr->mb_io_store_alloc);
-		fprintf(stderr,"dbg2       store_free:         %p\n",(void *)mb_io_ptr->mb_io_store_free);
-		fprintf(stderr,"dbg2       read_ping:          %p\n",(void *)mb_io_ptr->mb_io_read_ping);
-		fprintf(stderr,"dbg2       write_ping:         %p\n",(void *)mb_io_ptr->mb_io_write_ping);
-		fprintf(stderr,"dbg2       extract:            %p\n",(void *)mb_io_ptr->mb_io_extract);
-		fprintf(stderr,"dbg2       insert:             %p\n",(void *)mb_io_ptr->mb_io_insert);
-		fprintf(stderr,"dbg2       extract_nav:        %p\n",(void *)mb_io_ptr->mb_io_extract_nav);
-		fprintf(stderr,"dbg2       insert_nav:         %p\n",(void *)mb_io_ptr->mb_io_insert_nav);
-		fprintf(stderr,"dbg2       extract_altitude:   %p\n",(void *)mb_io_ptr->mb_io_extract_altitude);
-		fprintf(stderr,"dbg2       insert_altitude:    %p\n",(void *)mb_io_ptr->mb_io_insert_altitude);
-		fprintf(stderr,"dbg2       extract_svp:        %p\n",(void *)mb_io_ptr->mb_io_extract_svp);
-		fprintf(stderr,"dbg2       insert_svp:         %p\n",(void *)mb_io_ptr->mb_io_insert_svp);
-		fprintf(stderr,"dbg2       ttimes:             %p\n",(void *)mb_io_ptr->mb_io_ttimes);
-		fprintf(stderr,"dbg2       detects:            %p\n",(void *)mb_io_ptr->mb_io_detects);
-		fprintf(stderr,"dbg2       extract_rawss:      %p\n",(void *)mb_io_ptr->mb_io_extract_rawss);
-		fprintf(stderr,"dbg2       insert_rawss:       %p\n",(void *)mb_io_ptr->mb_io_insert_rawss);
-		fprintf(stderr,"dbg2       copyrecord:         %p\n",(void *)mb_io_ptr->mb_io_copyrecord);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbr_info_mr1bldeo(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error)
-{
-	char	*function_name = "mbr_info_mr1bldeo";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* set format info parameters */
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-	*system = MB_SYS_MR1B;
-	*beams_bath_max = 153;
-	*beams_amp_max = 0;
-	*pixels_ss_max = 4003;
-	strncpy(format_name, "MR1BLDEO", MB_NAME_LENGTH);
-	strncpy(system_name, "MR1B", MB_NAME_LENGTH);
-	strncpy(format_description, "Format name:          MBF_MR1BLDEO\nInformal Description: L-DEO small MR1 post processed format with travel times\nAttributes:           L-DEO MR1, bathymetry and sidescan,\n                      variable beams and pixels, xdr binary, \n                      L-DEO.\n", MB_DESCRIPTION_LENGTH);
-	*numfile = 1;
-	*filetype = MB_FILETYPE_XDR;
-	*variable_beams = MB_NO;
-	*traveltime = MB_YES;
-	*beam_flagging = MB_YES;
-	*nav_source = MB_DATA_DATA;
-	*heading_source = MB_DATA_DATA;
-	*svp_source = MB_DATA_NONE;
-	*beamwidth_xtrack = 0.0;
-	*beamwidth_ltrack = 2.0;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",*system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",*beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",*beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",*pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",*numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",*filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",*variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",*traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",*beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",*nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",*heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",*vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",*svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",*beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",*beamwidth_ltrack);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_alm_mr1bldeo(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_alm_mr1bldeo";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_mr1bldeo_struct *data;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set initial status */
-	status = MB_SUCCESS;
-
-	/* allocate memory for data structure */
-	mb_io_ptr->structure_size = sizeof(struct mbf_mr1bldeo_struct);
-	mb_io_ptr->data_structure_size = 0;
-	status = mb_mallocd(verbose,__FILE__,__LINE__,mb_io_ptr->structure_size,
-				(void **)&mb_io_ptr->raw_data,error);
-	status = mb_mallocd(verbose,__FILE__,__LINE__,sizeof(struct mbsys_mr1b_struct),
-				(void **)&mb_io_ptr->store_data,error);
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-	data = (struct mbf_mr1bldeo_struct *) mb_io_ptr->raw_data;
-
-	/* initialize everything to zeros */
-	mbr_zero_mr1bldeo(verbose,data,error);
-	mb_io_ptr->fileheader = MB_NO;
-	mb_io_ptr->hdr_comment_size = 0;
-	mb_io_ptr->hdr_comment = NULL;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_dem_mr1bldeo(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_dem_mr1bldeo";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* deallocate memory for data descriptor */
-	status = mb_freed(verbose,__FILE__, __LINE__, (void **)&mb_io_ptr->raw_data,error);
-	status = mb_freed(verbose,__FILE__, __LINE__, (void **)&mb_io_ptr->store_data,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_zero_mr1bldeo(int verbose, struct mbf_mr1bldeo_struct *data, int *error)
-{
-	char	*function_name = "mbr_zero_mr1bldeo";
-	int	status = MB_SUCCESS;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       data:       %p\n",(void *)data);
-		}
-
-	/* initialize everything to zeros */
-	if (data != NULL)
-		{
-		/* type of data record */
-		data->kind = MB_DATA_NONE;
-
-		/* file header info */
-		data->mf_magic = 6666;
-		data->mf_count = 0;
-		if (data->mf_log == NULL)
-
-		/* ping header */
-		data->sec = 0;
-		data->usec = 0;
-		data->png_lon = 0.0;
-		data->png_lat = 0.0;
-		data->png_course = 0.0;
-		data->png_compass = 0.0;
-		data->png_prdepth = 0.0;
-		data->png_alt = 0.0;
-		data->png_pitch = 0.0;
-		data->png_roll = 0.0;
-		data->png_temp = 0.0;
-		data->png_atssincr = 0.0;
-		data->png_tt = 0.0;
-
-		/* port settings */
-		data->port_trans[0] = 0.0;
-		data->port_trans[1] = 0.0;
-		data->port_gain = 0.0;
-		data->port_pulse = 0.0;
-		data->port_btycount = 0;
-		data->port_btypad = 0;
-		data->port_ssoffset = 0.0;
-		data->port_sscount = 0;
-		data->port_sspad = 0;
-
-		/* starboard settings */
-		data->stbd_trans[0] = 0.0;
-		data->stbd_trans[1] = 0.0;
-		data->stbd_gain = 0.0;
-		data->stbd_pulse = 0.0;
-		data->stbd_btycount = 0;
-		data->stbd_btypad = 0;
-		data->stbd_ssoffset = 0.0;
-		data->stbd_sscount = 0;
-		data->stbd_sspad = 0;
-
-		/* bathymetry */
-		for (i=0;i<MBF_MR1BLDEO_BEAMS_SIDE;i++)
-			{
-			data->bath_acrosstrack_port[i] = 0.0;
-			data->bath_port[i] = 0.0;
-			data->tt_port[i] = 0.0;
-			data->angle_port[i] = 0.0;
-			data->bath_acrosstrack_stbd[i] = 0.0;
-			data->bath_stbd[i] = 0.0;
-			data->tt_stbd[i] = 0.0;
-			data->angle_stbd[i] = 0.0;
-			}
-
-		/* sidescan */
-		for (i=0;i<MBF_MR1BLDEO_PIXELS_SIDE;i++)
-			{
-			data->ss_port[i] = 0.0;
-			data->ss_stbd[i] = 0.0;
-			}
-
-		/* comment */
-		strncpy(data->comment,"\0",MBF_MR1BLDEO_MAXLINE);
-
-		}
-
-	/* assume success */
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_rt_mr1bldeo(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_rt_mr1bldeo";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_mr1bldeo_struct *data;
-	struct mbsys_mr1b_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointers to mbio descriptor and data structures */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-	data = (struct mbf_mr1bldeo_struct *) mb_io_ptr->raw_data;
-	store = (struct mbsys_mr1b_struct *) store_ptr;
-
-	/* read next data from file */
-	status = mbr_mr1bldeo_rd_data(verbose,mbio_ptr,error);
-
-	/* set error and kind in mb_io_ptr */
-	mb_io_ptr->new_error = *error;
-	mb_io_ptr->new_kind = data->kind;
-
-	/* translate values to mr1b data storage structure */
-	if (status == MB_SUCCESS
-		&& store != NULL)
-		{
-		/* type of data record */
-		store->kind = data->kind;
-
-		/* file header info */
-		store->mf_magic = data->mf_magic;
-		store->mf_count = data->mf_count;
-
-		/* ping header */
-		store->sec = data->sec;
-		store->usec = data->usec;
-		store->png_lon = data->png_lon;
-		store->png_lat = data->png_lat;
-		store->png_course = data->png_course;
-		store->png_compass = data->png_compass;
-		store->png_prdepth = data->png_prdepth;
-		store->png_alt = data->png_alt;
-		store->png_pitch = data->png_pitch;
-		store->png_roll = data->png_roll;
-		store->png_temp = data->png_temp;
-		store->png_atssincr = data->png_atssincr;
-		store->png_tt = data->png_tt;
-
-		/* port settings */
-		store->port_trans[0] = data->port_trans[0];
-		store->port_trans[1] = data->port_trans[1];
-		store->port_gain = data->port_gain;
-		store->port_pulse = data->port_pulse;
-		store->port_btycount = data->port_btycount;
-		store->port_btypad = data->port_btypad;
-		store->port_ssoffset = data->port_ssoffset;
-		store->port_sscount = data->port_sscount;
-		store->port_sspad = data->port_sspad;
-
-		/* starboard settings */
-		store->stbd_trans[0] = data->stbd_trans[0];
-		store->stbd_trans[1] = data->stbd_trans[1];
-		store->stbd_gain = data->stbd_gain;
-		store->stbd_pulse = data->stbd_pulse;
-		store->stbd_btycount = data->stbd_btycount;
-		store->stbd_btypad = data->stbd_btypad;
-		store->stbd_ssoffset = data->stbd_ssoffset;
-		store->stbd_sscount = data->stbd_sscount;
-		store->stbd_sspad = data->stbd_sspad;
-
-		/* bathymetry */
-		for (i=0;i<store->port_btycount;i++)
-			{
-			store->bath_acrosstrack_port[i]
-				= data->bath_acrosstrack_port[i];
-			store->bath_port[i] = data->bath_port[i];
-			store->tt_port[i] = data->tt_port[i];
-			store->angle_port[i] = data->angle_port[i];
-			}
-		for (i=0;i<store->stbd_btycount;i++)
-			{
-			store->bath_acrosstrack_stbd[i]
-				= data->bath_acrosstrack_stbd[i];
-			store->bath_stbd[i] = data->bath_stbd[i];
-			store->tt_stbd[i] = data->tt_stbd[i];
-			store->angle_stbd[i] = data->angle_stbd[i];
-			}
-
-		/* sidescan */
-		for (i=0;i<store->port_sscount;i++)
-			{
-			store->ss_port[i] = data->ss_port[i];
-			}
-		for (i=0;i<store->stbd_sscount;i++)
-			{
-			store->ss_stbd[i] = data->ss_stbd[i];
-			}
-
-		/* comment */
-		strncpy(store->comment,data->comment,MBF_MR1BLDEO_MAXLINE);
-
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_wt_mr1bldeo(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_wt_mr1bldeo";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_mr1bldeo_struct *data;
-	struct mbsys_mr1b_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_mr1bldeo_struct *) mb_io_ptr->raw_data;
-	store = (struct mbsys_mr1b_struct *) store_ptr;
-
-	/* first translate values from data storage structure */
-	if (store != NULL)
-		{
-		/* type of data record */
-		data->kind = store->kind;
-
-		/* file header info */
-		data->mf_magic = store->mf_magic;
-		data->mf_count = store->mf_count;
-
-		/* ping header */
-		data->sec = store->sec;
-		data->usec = store->usec;
-		data->png_lon = store->png_lon;
-		data->png_lat = store->png_lat;
-		data->png_course = store->png_course;
-		data->png_compass = store->png_compass;
-		data->png_prdepth = store->png_prdepth;
-		data->png_alt = store->png_alt;
-		data->png_pitch = store->png_pitch;
-		data->png_roll = store->png_roll;
-		data->png_temp = store->png_temp;
-		data->png_atssincr = store->png_atssincr;
-		data->png_tt = store->png_tt;
-
-		/* port settings */
-		data->port_trans[0] = store->port_trans[0];
-		data->port_trans[1] = store->port_trans[1];
-		data->port_gain = store->port_gain;
-		data->port_pulse = store->port_pulse;
-		data->port_btycount = store->port_btycount;
-		data->port_btypad = store->port_btypad;
-		data->port_ssoffset = store->port_ssoffset;
-		data->port_sscount = store->port_sscount;
-		data->port_sspad = store->port_sspad;
-
-		/* starboard settings */
-		data->stbd_trans[0] = store->stbd_trans[0];
-		data->stbd_trans[1] = store->stbd_trans[1];
-		data->stbd_gain = store->stbd_gain;
-		data->stbd_pulse = store->stbd_pulse;
-		data->stbd_btycount = store->stbd_btycount;
-		data->stbd_btypad = store->stbd_btypad;
-		data->stbd_ssoffset = store->stbd_ssoffset;
-		data->stbd_sscount = store->stbd_sscount;
-		data->stbd_sspad = store->stbd_sspad;
-
-		/* bathymetry */
-		for (i=0;i<data->port_btycount;i++)
-			{
-			data->bath_acrosstrack_port[i]
-				= store->bath_acrosstrack_port[i];
-			data->bath_port[i] = store->bath_port[i];
-			data->tt_port[i] = store->tt_port[i];
-			data->angle_port[i] = store->angle_port[i];
-			}
-		for (i=0;i<data->stbd_btycount;i++)
-			{
-			data->bath_acrosstrack_stbd[i]
-				= store->bath_acrosstrack_stbd[i];
-			data->bath_stbd[i] = store->bath_stbd[i];
-			data->tt_stbd[i] = store->tt_stbd[i];
-			data->angle_stbd[i] = store->angle_stbd[i];
-			}
-
-		/* sidescan */
-		for (i=0;i<data->port_sscount;i++)
-			{
-			data->ss_port[i] = store->ss_port[i];
-			}
-		for (i=0;i<data->stbd_sscount;i++)
-			{
-			data->ss_stbd[i] = store->ss_stbd[i];
-			}
-
-		/* comment */
-		strncpy(data->comment,store->comment,MBF_MR1BLDEO_MAXLINE);
-
-		}
-
-	/* write next data to file */
-	status = mbr_mr1bldeo_wr_data(verbose,mbio_ptr,data,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_mr1bldeo_rd_data(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_mr1bldeo_rd_data";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_mr1bldeo_struct *data;
-	XDR	*xdrs;
-	int	read_size;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_mr1bldeo_struct *) mb_io_ptr->raw_data;
-	xdrs = (XDR *)mb_io_ptr->xdrs;
-
-	/* initialize everything to zeros */
-	mbr_zero_mr1bldeo(verbose,data,error);
-
-	/* if first time through read file header */
-	if (mb_io_ptr->fileheader == MB_NO)
-		{
-		status = mbr_mr1bldeo_rd_hdr(verbose,xdrs,data,
-			&mb_io_ptr->hdr_comment,error);
-		if (status == MB_SUCCESS)
-			{
-			mb_io_ptr->fileheader = MB_YES;
-			if (mb_io_ptr->hdr_comment == NULL)
-				mb_io_ptr->hdr_comment_size = 0;
-			else
-				mb_io_ptr->hdr_comment_size
-					= strlen(mb_io_ptr->hdr_comment);
-			mb_io_ptr->hdr_comment_loc = 0;
-			if (mb_io_ptr->hdr_comment_size > 80)
-				read_size = 80;
-			else
-				read_size = mb_io_ptr->hdr_comment_size;
-			strncpy(data->comment,mb_io_ptr->hdr_comment,read_size);
-			mb_io_ptr->hdr_comment_loc = read_size;
-			data->kind = MB_DATA_COMMENT;
-			}
-		}
-
-	/* if comments are still held in mb_io_ptr->hdr_comment then
-		extract comment and return */
-	else if (mb_io_ptr->hdr_comment_size > mb_io_ptr->hdr_comment_loc)
-		{
-		if (mb_io_ptr->hdr_comment_size - mb_io_ptr->hdr_comment_loc
-			> 80)
-			read_size = 80;
-		else
-			read_size = mb_io_ptr->hdr_comment_size
-				- mb_io_ptr->hdr_comment_loc;
-		strncpy(data->comment,
-			&mb_io_ptr->hdr_comment[mb_io_ptr->hdr_comment_loc],
-			read_size);
-		mb_io_ptr->hdr_comment_loc += read_size;
-		data->kind = MB_DATA_COMMENT;
-		}
-
-	/* else read data */
-	else
-		{
-		status = mbr_mr1bldeo_rd_ping(verbose,xdrs,data,error);
-		if (status == MB_SUCCESS)
-			{
-			data->kind = MB_DATA_DATA;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_mr1bldeo_rd_hdr(int verbose, XDR *xdrs,
-		struct mbf_mr1bldeo_struct *data, char **hdr_comment,
-		int *error)
-{
-	char	*function_name = "mbr_mr1bldeo_rd_hdr";
-	int	status = MB_SUCCESS;
-	int	len;
-	unsigned int	ulen;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       xdrs:       %p\n",(void *)xdrs);
-		fprintf(stderr,"dbg2       data:       %p\n",(void *)data);
-		fprintf(stderr,"dbg2       hdr_comment:%p\n",(void *)*hdr_comment);
-		}
-
-	/* set status and error */
-	*error = MB_ERROR_NO_ERROR;
-	status = MB_SUCCESS;
-
-	/* read magic number */
-	status = xdr_int(xdrs, &data->mf_magic);
-
-	/* read ping count */
-	if (status == MB_SUCCESS)
-		status = xdr_int(xdrs, &data->mf_count);
-
-	/* read header comment */
-	if (status == MB_SUCCESS)
-		status = xdr_int(xdrs, &len);
-	if (status == MB_SUCCESS)
-		{
-		if (len > 0)
-			{
-			status = mb_mallocd(verbose,__FILE__,__LINE__,len+1,(void **)hdr_comment,error);
-			status = xdr_bytes(xdrs,hdr_comment,&ulen,(unsigned int)(len + 1));
-			}
-		else if (len < 0)
-			status = MB_FAILURE;
-		}
-
-	if (status == MB_FAILURE && *error == MB_ERROR_NO_ERROR)
-		*error = MB_ERROR_EOF;
-	else if (data->mf_magic != 6666)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       mf_magic:         %d\n",data->mf_magic);
-		fprintf(stderr,"dbg5       mf_count:         %d\n",data->mf_count);
-		fprintf(stderr,"dbg5       hdr_comment:\n%s\n",*hdr_comment);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_mr1bldeo_rd_ping(int verbose, XDR *xdrs,
-		struct mbf_mr1bldeo_struct *data, int *error)
-{
-	char	*function_name = "mbr_mr1bldeo_rd_ping";
-	int	status = MB_SUCCESS;
-	int	dummy_count;
-	float	dummy;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       xdrs:       %p\n",(void *)xdrs);
-		fprintf(stderr,"dbg2       data:       %p\n",(void *)data);
-		}
-
-	/* read ping header */
-	status = xdr_int(xdrs, &data->sec);
-	status = xdr_int(xdrs, &data->usec);
-	status = xdr_double(xdrs, &data->png_lon);
-	status = xdr_double(xdrs, &data->png_lat);
-	status = xdr_float(xdrs, &data->png_course);
-	status = xdr_float(xdrs, &data->png_compass);
-	status = xdr_float(xdrs, &data->png_prdepth);
-	status = xdr_float(xdrs, &data->png_alt);
-	status = xdr_float(xdrs, &data->png_pitch);
-	status = xdr_float(xdrs, &data->png_roll);
-	status = xdr_float(xdrs, &data->png_temp);
-	status = xdr_float(xdrs, &data->png_atssincr);
-	status = xdr_float(xdrs, &data->png_tt);
-
-	/* read port side header */
-	status = xdr_float(xdrs, &data->port_trans[0]);
-	status = xdr_float(xdrs, &data->port_trans[1]);
-	status = xdr_float(xdrs, &data->port_gain);
-	status = xdr_float(xdrs, &data->port_pulse);
-	status = xdr_int(xdrs, &data->port_btycount);
-	status = xdr_float(xdrs, &data->port_ssoffset);
-	status = xdr_int(xdrs, &data->port_sscount);
-
-	/* read starboard side header */
-	status = xdr_float(xdrs, &data->stbd_trans[0]);
-	status = xdr_float(xdrs, &data->stbd_trans[1]);
-	status = xdr_float(xdrs, &data->stbd_gain);
-	status = xdr_float(xdrs, &data->stbd_pulse);
-	status = xdr_int(xdrs, &data->stbd_btycount);
-	status = xdr_float(xdrs, &data->stbd_ssoffset);
-	status = xdr_int(xdrs, &data->stbd_sscount);
-
-	/* read bathymetry and sidescan data
-		- handle more data than allowed by MBIO by
-		  throwing away the excess */
-
-	/* do port bathymetry */
-	if (data->port_btycount > MBF_MR1BLDEO_BEAMS_SIDE)
-		{
-		if (verbose > 0)
-			{
-			fprintf(stderr, "Port bathymetry count exceeds MBIO maximum: %d %d\n",
-				data->port_btycount, MBF_MR1BLDEO_BEAMS_SIDE);
-			}
-		dummy_count = data->port_btycount
-			- MBF_MR1BLDEO_BEAMS_SIDE;
-		data->port_btycount = MBF_MR1BLDEO_BEAMS_SIDE;
-		}
-	else
-		dummy_count = 0;
-	for (i=0;i<data->port_btycount;i++)
-		{
-		status = xdr_float(xdrs,&data->bath_acrosstrack_port[i]);
-		status = xdr_float(xdrs,&data->bath_port[i]);
-		status = xdr_float(xdrs,&data->tt_port[i]);
-		status = xdr_float(xdrs,&data->angle_port[i]);
-		}
-	for (i=0;i<dummy_count;i++)
-		{
-		status = xdr_float(xdrs,&dummy);
-		status = xdr_float(xdrs,&dummy);
-		status = xdr_float(xdrs,&dummy);
-		status = xdr_float(xdrs,&dummy);
-		}
-
-	/* do port sidescan */
-	if (data->port_sscount > MBF_MR1BLDEO_PIXELS_SIDE)
-		{
-		if (verbose > 0)
-			{
-			fprintf(stderr, "Port sidescan count exceeds MBIO maximum: %d %d\n",
-				data->port_sscount, MBF_MR1BLDEO_PIXELS_SIDE);
-			}
-		dummy_count = data->port_sscount
-			- MBF_MR1BLDEO_PIXELS_SIDE;
-		data->port_sscount = MBF_MR1BLDEO_PIXELS_SIDE;
-		}
-	else
-		dummy_count = 0;
-	for (i=0;i<data->port_sscount;i++)
-		{
-		status = xdr_float(xdrs,&data->ss_port[i]);
-		}
-	for (i=0;i<dummy_count;i++)
-		{
-		status = xdr_float(xdrs,&dummy);
-		}
-
-	/* do starboard bathymetry */
-	if (data->stbd_btycount > MBF_MR1BLDEO_BEAMS_SIDE)
-		{
-		/* output debug messages */
-		if (verbose > 0)
-			{
-			fprintf(stderr, "Starboard bathymetry count exceeds MBIO maximum: %d %d\n",
-				data->stbd_btycount, MBF_MR1BLDEO_BEAMS_SIDE);
-			}
-		dummy_count = data->stbd_btycount
-			- MBF_MR1BLDEO_BEAMS_SIDE;
-		data->stbd_btycount = MBF_MR1BLDEO_BEAMS_SIDE;
-		}
-	else
-		dummy_count = 0;
-	for (i=0;i<data->stbd_btycount;i++)
-		{
-		status = xdr_float(xdrs,&data->bath_acrosstrack_stbd[i]);
-		status = xdr_float(xdrs,&data->bath_stbd[i]);
-		status = xdr_float(xdrs,&data->tt_stbd[i]);
-		status = xdr_float(xdrs,&data->angle_stbd[i]);
-		}
-	for (i=0;i<dummy_count;i++)
-		{
-		status = xdr_float(xdrs,&dummy);
-		status = xdr_float(xdrs,&dummy);
-		status = xdr_float(xdrs,&dummy);
-		status = xdr_float(xdrs,&dummy);
-		}
-
-	/* do starboard sidescan */
-	if (data->stbd_sscount > MBF_MR1BLDEO_PIXELS_SIDE)
-		{
-		/* output debug messages */
-		if (verbose > 0)
-			{
-			fprintf(stderr, "Starboard sidescan count exceeds MBIO maximum: %d %d\n",
-				data->stbd_sscount, MBF_MR1BLDEO_PIXELS_SIDE);
-			}
-		dummy_count = data->stbd_sscount
-			- MBF_MR1BLDEO_PIXELS_SIDE;
-		data->stbd_sscount = MBF_MR1BLDEO_PIXELS_SIDE;
-		}
-	else
-		dummy_count = 0;
-	for (i=0;i<data->stbd_sscount;i++)
-		{
-		status = xdr_float(xdrs,&data->ss_stbd[i]);
-		}
-	for (i=0;i<dummy_count;i++)
-		{
-		status = xdr_float(xdrs,&dummy);
-		}
-
-	if (status == MB_FAILURE)
-		*error = MB_ERROR_EOF;
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       sec:              %d\n",data->sec);
-		fprintf(stderr,"dbg5       usec:             %d\n",data->usec);
-		fprintf(stderr,"dbg5       longitude:        %f\n",
-			data->png_lon);
-		fprintf(stderr,"dbg5       latitude:         %f\n",
-			data->png_lat);
-		fprintf(stderr,"dbg5       course:           %f\n",
-			data->png_course);
-		fprintf(stderr,"dbg5       heading:          %f\n",
-			data->png_compass);
-		fprintf(stderr,"dbg5       pressure depth:   %f\n",
-			data->png_prdepth);
-		fprintf(stderr,"dbg5       altitude:         %f\n",
-			data->png_alt);
-		fprintf(stderr,"dbg5       pitch:            %f\n",
-			data->png_pitch);
-		fprintf(stderr,"dbg5       roll:             %f\n",
-			data->png_roll);
-		fprintf(stderr,"dbg5       temperature:      %f\n",
-			data->png_temp);
-		fprintf(stderr,"dbg5       pixel spacing:    %f\n",
-			data->png_atssincr);
-		fprintf(stderr,"dbg5       nadir travel time:%f\n",
-			data->png_tt);
-		fprintf(stderr,"dbg5       port transmit 0:  %f\n",
-			data->port_trans[0]);
-		fprintf(stderr,"dbg5       port transmit 1:  %f\n",
-			data->port_trans[1]);
-		fprintf(stderr,"dbg5       port gain:        %f\n",
-			data->port_gain);
-		fprintf(stderr,"dbg5       port pulse:       %f\n",
-			data->port_pulse);
-		fprintf(stderr,"dbg5       port bath count:  %d\n",
-			data->port_btycount);
-		fprintf(stderr,"dbg5       port ss offset:   %f\n",
-			data->port_ssoffset);
-		fprintf(stderr,"dbg5       port ss count:    %d\n",
-			data->port_sscount);
-		fprintf(stderr,"dbg5       stbd transmit 0:  %f\n",
-			data->stbd_trans[0]);
-		fprintf(stderr,"dbg5       stbd transmit 1:  %f\n",
-			data->stbd_trans[1]);
-		fprintf(stderr,"dbg5       stbd gain:        %f\n",
-			data->stbd_gain);
-		fprintf(stderr,"dbg5       stbd pulse:       %f\n",
-			data->stbd_pulse);
-		fprintf(stderr,"dbg5       stbd bath count:  %d\n",
-			data->stbd_btycount);
-		fprintf(stderr,"dbg5       stbd ss offset:   %f\n",
-			data->stbd_ssoffset);
-		fprintf(stderr,"dbg5       stbd ss count:    %d\n",
-			data->stbd_sscount);
-		fprintf(stderr,"\n");
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"dbg5       port_beam  depth   xtrack    tt   angle\n");
-		for (i=0;i<data->port_btycount;i++)
-		  {
-		  fprintf(stderr,"dbg5       %3d     %12.4g %12.4g %12.4g %12.4g\n",
-			i,data->bath_port[i],data->bath_acrosstrack_port[i],
-			data->tt_port[i],data->angle_port[i]);
-		  }
-		fprintf(stderr,"\n");
-		fprintf(stderr,"dbg5       stbd_beam  depth   xtrack    tt   angle\n");
-		for (i=0;i<data->stbd_btycount;i++)
-		  {
-		  fprintf(stderr,"dbg5       %3d     %12.4g %12.4g %12.4g %12.4g\n",
-			i,data->bath_stbd[i],data->bath_acrosstrack_stbd[i],
-			data->tt_stbd[i],data->angle_stbd[i]);
-		  }
-		fprintf(stderr,"\n");
-		fprintf(stderr,"dbg5       port_pixel  sidescan\n");
-		for (i=0;i<data->port_sscount;i++)
-		  {
-		  fprintf(stderr,"dbg5       %3d     %12.4g\n",
-			i,data->ss_port[i]);
-		  }
-		fprintf(stderr,"\n");
-		fprintf(stderr,"dbg5       stbd_pixel  sidescan\n");
-		for (i=0;i<data->stbd_sscount;i++)
-		  {
-		  fprintf(stderr,"dbg5       %3d     %12.4g\n",
-			i,data->ss_stbd[i]);
-		  }
-		fprintf(stderr,"\n");
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_mr1bldeo_wr_data(int verbose, void *mbio_ptr, struct mbf_mr1bldeo_struct *data, int *error)
-{
-	char	*function_name = "mbr_mr1bldeo_wr_data";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	XDR	*xdrs;
-	char	*tmp;
-	int	lenc, lenhc, len;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       data:       %p\n",(void *)data);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to XDR structure */
-	xdrs = (XDR *)mb_io_ptr->xdrs;
-
-	/* if comment and file header not written */
-	if (mb_io_ptr->fileheader == MB_NO && data->kind == MB_DATA_COMMENT)
-		{
-		/* add comment to string mb_io_ptr->hdr_comment
-			to be be written in file header */
-		lenc = strlen(data->comment);
-		lenhc = 0;
-		if (mb_io_ptr->hdr_comment != NULL)
-			lenhc = strlen(mb_io_ptr->hdr_comment);
-		len = lenc + lenhc + 1;
-		status = mb_mallocd(verbose,__FILE__,__LINE__,len,(void **)&tmp,error);
-		strcpy(tmp,"\0");
-		if (lenhc > 0) strcpy(tmp,mb_io_ptr->hdr_comment);
-		if (lenc > 0) strcat(tmp,data->comment);
-		if (mb_io_ptr->hdr_comment != NULL)
-			mb_freed(verbose,__FILE__, __LINE__, (void **)&mb_io_ptr->hdr_comment,error);
-		mb_io_ptr->hdr_comment = tmp;
-		}
-
-	/* if data and file header not written */
-	else if (mb_io_ptr->fileheader == MB_NO
-		&& data->kind != MB_DATA_COMMENT)
-		{
-		/* write file header */
-		status = mbr_mr1bldeo_wr_hdr(verbose,xdrs,data,
-				&mb_io_ptr->hdr_comment,error);
-		mb_io_ptr->fileheader = MB_YES;
-
-		/* write data */
-		status = mbr_mr1bldeo_wr_ping(verbose,xdrs,data,error);
-		}
-
-	/* if data and file header written */
-	else if (mb_io_ptr->fileheader == MB_YES
-		&& data->kind == MB_DATA_DATA)
-		{
-		/* write data */
-		status = mbr_mr1bldeo_wr_ping(verbose,xdrs,data,error);
-		}
-
-	/* if not data and file header written */
-	else if (mb_io_ptr->fileheader == MB_YES
-		&& data->kind != MB_DATA_DATA)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_BAD_KIND;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Data record kind in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       kind:       %d\n",data->kind);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_mr1bldeo_wr_hdr(int verbose, XDR *xdrs,
-		struct mbf_mr1bldeo_struct *data, char **hdr_comment, int *error)
-{
-	char	*function_name = "mbr_mr1bldeo_wr_hdr";
-	int	status = MB_SUCCESS;
-	int	len;
-	unsigned int	ulen;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       xdrs:       %p\n",(void *)xdrs);
-		fprintf(stderr,"dbg2       data:       %p\n",(void *)data);
-		fprintf(stderr,"dbg2       hdr_comment:%p\n",(void *)*hdr_comment);
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       mf_magic:         %d\n",data->mf_magic);
-		fprintf(stderr,"dbg5       mf_count:         %d\n",data->mf_count);
-		fprintf(stderr,"dbg5       hdr_comment:\n%s\n",*hdr_comment);
-		}
-
-	/* set status and error */
-	*error = MB_ERROR_NO_ERROR;
-	status = MB_SUCCESS;
-
-	/* write magic number */
-	status = xdr_int(xdrs, &data->mf_magic);
-
-	/* write ping count */
-	if (status == MB_SUCCESS)
-		{
-		status = xdr_int(xdrs, &data->mf_count);
-		}
-
-	/* write header comment */
-	if (status == MB_SUCCESS)
-		{
-		if (*hdr_comment == NULL)
-			len = 0;
-		else
-			len = strlen(*hdr_comment);
-		status = xdr_int(xdrs, &len);
-		}
-	if (status == MB_SUCCESS && len > 0)
-		{
-		ulen = len;
-		status = xdr_bytes(xdrs,hdr_comment,
-				&ulen,(unsigned int)len);
-		}
-
-	/* check for an error */
-	if (status != MB_SUCCESS)
-		*error = MB_ERROR_WRITE_FAIL;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_mr1bldeo_wr_ping(int verbose, XDR *xdrs, struct mbf_mr1bldeo_struct *data, int *error)
-{
-	char	*function_name = "mbr_mr1bldeo_wr_ping";
-	int	status = MB_SUCCESS;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       xdrs:       %p\n",(void *)xdrs);
-		fprintf(stderr,"dbg2       data:       %p\n",(void *)data);
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       sec:              %d\n",data->sec);
-		fprintf(stderr,"dbg5       usec:             %d\n",data->usec);
-		fprintf(stderr,"dbg5       longitude:        %f\n",
-			data->png_lon);
-		fprintf(stderr,"dbg5       latitude:         %f\n",
-			data->png_lat);
-		fprintf(stderr,"dbg5       course:           %f\n",
-			data->png_course);
-		fprintf(stderr,"dbg5       heading:          %f\n",
-			data->png_compass);
-		fprintf(stderr,"dbg5       pressure depth:   %f\n",
-			data->png_prdepth);
-		fprintf(stderr,"dbg5       altitude:         %f\n",
-			data->png_alt);
-		fprintf(stderr,"dbg5       pitch:            %f\n",
-			data->png_pitch);
-		fprintf(stderr,"dbg5       roll:             %f\n",
-			data->png_roll);
-		fprintf(stderr,"dbg5       temperature:      %f\n",
-			data->png_temp);
-		fprintf(stderr,"dbg5       pixel spacing:    %f\n",
-			data->png_atssincr);
-		fprintf(stderr,"dbg5       nadir travel time:%f\n",
-			data->png_tt);
-		fprintf(stderr,"dbg5       port transmit 0:  %f\n",
-			data->port_trans[0]);
-		fprintf(stderr,"dbg5       port transmit 1:  %f\n",
-			data->port_trans[1]);
-		fprintf(stderr,"dbg5       port gain:        %f\n",
-			data->port_gain);
-		fprintf(stderr,"dbg5       port pulse:       %f\n",
-			data->port_pulse);
-		fprintf(stderr,"dbg5       port bath count:  %d\n",
-			data->port_btycount);
-		fprintf(stderr,"dbg5       port ss offset:   %f\n",
-			data->port_ssoffset);
-		fprintf(stderr,"dbg5       port ss count:    %d\n",
-			data->port_sscount);
-		fprintf(stderr,"dbg5       stbd transmit 0:  %f\n",
-			data->stbd_trans[0]);
-		fprintf(stderr,"dbg5       stbd transmit 1:  %f\n",
-			data->stbd_trans[1]);
-		fprintf(stderr,"dbg5       stbd gain:        %f\n",
-			data->stbd_gain);
-		fprintf(stderr,"dbg5       stbd pulse:       %f\n",
-			data->stbd_pulse);
-		fprintf(stderr,"dbg5       stbd bath count:  %d\n",
-			data->stbd_btycount);
-		fprintf(stderr,"dbg5       stbd ss offset:   %f\n",
-			data->stbd_ssoffset);
-		fprintf(stderr,"dbg5       stbd ss count:    %d\n",
-			data->stbd_sscount);
-		fprintf(stderr,"\n");
-		fprintf(stderr,"dbg5       port_beam  depth   xtrack    tt   angle\n");
-		for (i=0;i<data->port_btycount;i++)
-		  {
-		  fprintf(stderr,"dbg5       %3d     %12.4g %12.4g %12.4g %12.4g\n",
-			i,data->bath_port[i],data->bath_acrosstrack_port[i],
-			data->tt_port[i],data->angle_port[i]);
-		  }
-		fprintf(stderr,"\n");
-		fprintf(stderr,"dbg5       stbd_beam  depth   xtrack    tt   angle\n");
-		for (i=0;i<data->stbd_btycount;i++)
-		  {
-		  fprintf(stderr,"dbg5       %3d     %12.4g %12.4g %12.4g %12.4g\n",
-			i,data->bath_stbd[i],data->bath_acrosstrack_stbd[i],
-			data->tt_stbd[i],data->angle_stbd[i]);
-		  }
-		fprintf(stderr,"\n");
-		fprintf(stderr,"dbg5       port_pixel  sidescan\n");
-		for (i=0;i<data->port_sscount;i++)
-		  {
-		  fprintf(stderr,"dbg5       %3d     %12.4g\n",
-			i,data->ss_port[i]);
-		  }
-		fprintf(stderr,"\n");
-		fprintf(stderr,"dbg5       stbd_pixel  sidescan\n");
-		for (i=0;i<data->stbd_sscount;i++)
-		  {
-		  fprintf(stderr,"dbg5       %3d     %12.4g\n",
-			i,data->ss_stbd[i]);
-		  }
-		fprintf(stderr,"\n");
-		}
-
-	/* write ping header */
-	status = xdr_int(xdrs, &data->sec);
-	status = xdr_int(xdrs, &data->usec);
-	status = xdr_double(xdrs, &data->png_lon);
-	status = xdr_double(xdrs, &data->png_lat);
-	status = xdr_float(xdrs, &data->png_course);
-	status = xdr_float(xdrs, &data->png_compass);
-	status = xdr_float(xdrs, &data->png_prdepth);
-	status = xdr_float(xdrs, &data->png_alt);
-	status = xdr_float(xdrs, &data->png_pitch);
-	status = xdr_float(xdrs, &data->png_roll);
-	status = xdr_float(xdrs, &data->png_temp);
-	status = xdr_float(xdrs, &data->png_atssincr);
-	status = xdr_float(xdrs, &data->png_tt);
-
-	/* write port side header */
-	status = xdr_float(xdrs, &data->port_trans[0]);
-	status = xdr_float(xdrs, &data->port_trans[1]);
-	status = xdr_float(xdrs, &data->port_gain);
-	status = xdr_float(xdrs, &data->port_pulse);
-	status = xdr_int(xdrs, &data->port_btycount);
-	status = xdr_float(xdrs, &data->port_ssoffset);
-	status = xdr_int(xdrs, &data->port_sscount);
-
-	/* write starboard side header */
-	status = xdr_float(xdrs, &data->stbd_trans[0]);
-	status = xdr_float(xdrs, &data->stbd_trans[1]);
-	status = xdr_float(xdrs, &data->stbd_gain);
-	status = xdr_float(xdrs, &data->stbd_pulse);
-	status = xdr_int(xdrs, &data->stbd_btycount);
-	status = xdr_float(xdrs, &data->stbd_ssoffset);
-	status = xdr_int(xdrs, &data->stbd_sscount);
-
-	/* write bathymetry and sidescan data */
-	for (i=0;i<data->port_btycount;i++)
-		{
-		status = xdr_float(xdrs,&data->bath_acrosstrack_port[i]);
-		status = xdr_float(xdrs,&data->bath_port[i]);
-		status = xdr_float(xdrs,&data->tt_port[i]);
-		status = xdr_float(xdrs,&data->angle_port[i]);
-		}
-	for (i=0;i<data->port_sscount;i++)
-		{
-		status = xdr_float(xdrs,&data->ss_port[i]);
-		}
-	for (i=0;i<data->stbd_btycount;i++)
-		{
-		status = xdr_float(xdrs,&data->bath_acrosstrack_stbd[i]);
-		status = xdr_float(xdrs,&data->bath_stbd[i]);
-		status = xdr_float(xdrs,&data->tt_stbd[i]);
-		status = xdr_float(xdrs,&data->angle_stbd[i]);
-		}
-	for (i=0;i<data->stbd_sscount;i++)
-		{
-		status = xdr_float(xdrs,&data->ss_stbd[i]);
-		}
-	if (status == MB_FAILURE)
-		*error = MB_ERROR_WRITE_FAIL;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mbr_mr1prhig.c b/src/mbio/mbr_mr1prhig.c
deleted file mode 100644
index 946fd64..0000000
--- a/src/mbio/mbr_mr1prhig.c
+++ /dev/null
@@ -1,1623 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbr_mr1prhig.c	3/3/94
- *	$Id: mbr_mr1prhig.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1994-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbr_mr1prhig.c contains the functions for reading and writing
- * multibeam data in the MR1PRHIG format.
- * These functions include:
- *   mbr_alm_mr1prhig	- allocate read/write memory
- *   mbr_dem_mr1prhig	- deallocate read/write memory
- *   mbr_rt_mr1prhig	- read and translate data
- *   mbr_wt_mr1prhig	- translate and write data
- *
- * Author:	D. W. Caress
- * Date:	July 17, 1994
- * $Log: mbr_mr1prhig.c,v $
- * Revision 5.9  2008/07/10 06:43:41  caress
- * Preparing for 5.1.1beta20
- *
- * Revision 5.8  2005/11/05 00:48:03  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.7  2003/05/20 18:05:32  caress
- * Added svp_source to data source parameters.
- *
- * Revision 5.6  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.5  2003/03/10 20:02:29  caress
- * Added mr1pr library.
- *
- * Revision 5.4  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.3  2001/07/20 00:32:54  caress
- * Release 5.0.beta03
- *
- * Revision 5.2  2001/03/22  20:50:02  caress
- * Trying to make version 5.0.beta0
- *
- * Revision 5.1  2001/01/22  07:43:34  caress
- * Version 5.0.beta01
- *
- * Revision 5.0  2000/12/01  22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.14  2000/10/11  01:03:21  caress
- * Convert to ANSI C
- *
- * Revision 4.13  2000/10/03  21:48:03  caress
- * Snapshot for Dale.
- *
- * Revision 4.12  2000/09/30  06:34:20  caress
- * Snapshot for Dale.
- *
- * Revision 4.11  1999/05/05  20:32:19  caress
- * Fixed bugs in handling updated bathymetry through mb_put_all call.
- *
- * Revision 4.10  1998/10/05  17:46:15  caress
- * MB-System version 4.6beta
- *
- * Revision 4.9  1997/04/21  17:02:07  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.8  1996/04/22  13:21:19  caress
- * Now have DTR and MIN/MAX defines in mb_define.h
- *
- * Revision 4.8  1996/04/22  13:21:19  caress
- * Now have DTR and MIN/MAX defines in mb_define.h
- *
- * Revision 4.7  1996/04/22  11:16:30  caress
- * DTR define now in mb_io.h
- *
- * Revision 4.6  1996/03/12  17:21:55  caress
- * Added format 63, short HMR1 processing format.
- *
- * Revision 4.5  1996/01/26  21:23:30  caress
- * Version 4.3 distribution
- *
- * Revision 4.4  1995/09/28  18:10:48  caress
- * Various bug fixes working toward release 4.3.
- *
- * Revision 4.3  1995/03/06  19:38:54  caress
- * Changed include strings.h to string.h for POSIX compliance.
- *
- * Revision 4.2  1994/11/23  23:16:34  caress
- * Now uses png_course instead of png_heading for heading
- * value because png_heading has large errors. Will
- * change back after processing tools to correct heading
- * are created.
- *
- * Revision 4.1  1994/10/21  12:20:01  caress
- * Release V4.0
- *
- * Revision 4.0  1994/07/29  18:59:33  caress
- * Initial Revision.
- *
- * Revision 1.1  1994/07/29  18:46:51  caress
- * Initial revision
- *
- *
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-#include <time.h>
-
-/* mbio include files */
-#include "mb_define.h"
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mbsys_mr1.h"
-#include "mbf_mr1prhig.h"
-
-/* essential function prototypes */
-
-int mbr_register_mr1prhig(int verbose, void *mbio_ptr, int *error);
-int mbr_info_mr1prhig(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_alm_mr1prhig(int verbose, void *mbio_ptr, int *error);
-int mbr_dem_mr1prhig(int verbose, void *mbio_ptr, int *error);
-int mbr_zero_mr1prhig(int verbose, struct mbf_mr1prhig_struct *data, int *error);
-int mbr_rt_mr1prhig(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_wt_mr1prhig(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_mr1prhig_rd_data(int verbose, void *mbio_ptr, int *error);
-int mbr_mr1prhig_rd_hdr(int verbose, XDR *xdrs,
-		struct mbf_mr1prhig_struct *data, char **hdr_comment,
-		int *error);
-int mbr_mr1prhig_rd_ping(int verbose, XDR *xdrs,
-		struct mbf_mr1prhig_struct *data, int *error);
-int mbr_mr1prhig_wr_data(int verbose, void *mbio_ptr, struct mbf_mr1prhig_struct *data, int *error);
-int mbr_mr1prhig_wr_hdr(int verbose, XDR *xdrs,
-		struct mbf_mr1prhig_struct *data, char **hdr_comment, int *error);
-int mbr_mr1prhig_wr_ping(int verbose, XDR *xdrs, struct mbf_mr1prhig_struct *data, int *error);
-
-static char rcs_id[]="$Id: mbr_mr1prhig.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mbr_register_mr1prhig(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_register_mr1prhig";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* get mb_io_ptr */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set format info parameters */
-	status = mbr_info_mr1prhig(verbose,
-			&mb_io_ptr->system,
-			&mb_io_ptr->beams_bath_max,
-			&mb_io_ptr->beams_amp_max,
-			&mb_io_ptr->pixels_ss_max,
-			mb_io_ptr->format_name,
-			mb_io_ptr->system_name,
-			mb_io_ptr->format_description,
-			&mb_io_ptr->numfile,
-			&mb_io_ptr->filetype,
-			&mb_io_ptr->variable_beams,
-			&mb_io_ptr->traveltime,
-			&mb_io_ptr->beam_flagging,
-			&mb_io_ptr->nav_source,
-			&mb_io_ptr->heading_source,
-			&mb_io_ptr->vru_source,
-			&mb_io_ptr->svp_source,
-			&mb_io_ptr->beamwidth_xtrack,
-			&mb_io_ptr->beamwidth_ltrack,
-			error);
-
-	/* set format and system specific function pointers */
-	mb_io_ptr->mb_io_format_alloc = &mbr_alm_mr1prhig;
-	mb_io_ptr->mb_io_format_free = &mbr_dem_mr1prhig;
-	mb_io_ptr->mb_io_store_alloc = &mbsys_mr1_alloc;
-	mb_io_ptr->mb_io_store_free = &mbsys_mr1_deall;
-	mb_io_ptr->mb_io_read_ping = &mbr_rt_mr1prhig;
-	mb_io_ptr->mb_io_write_ping = &mbr_wt_mr1prhig;
-	mb_io_ptr->mb_io_dimensions = &mbsys_mr1_dimensions;
-	mb_io_ptr->mb_io_extract = &mbsys_mr1_extract;
-	mb_io_ptr->mb_io_insert = &mbsys_mr1_insert;
-	mb_io_ptr->mb_io_extract_nav = &mbsys_mr1_extract_nav;
-	mb_io_ptr->mb_io_insert_nav = &mbsys_mr1_insert_nav;
-	mb_io_ptr->mb_io_extract_altitude = &mbsys_mr1_extract_altitude;
-	mb_io_ptr->mb_io_insert_altitude = NULL;
-	mb_io_ptr->mb_io_extract_svp = NULL;
-	mb_io_ptr->mb_io_insert_svp = NULL;
-	mb_io_ptr->mb_io_ttimes = &mbsys_mr1_ttimes;
-	mb_io_ptr->mb_io_detects = &mbsys_mr1_detects;
-	mb_io_ptr->mb_io_copyrecord = &mbsys_mr1_copy;
-	mb_io_ptr->mb_io_extract_rawss = NULL;
-	mb_io_ptr->mb_io_insert_rawss = NULL;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",mb_io_ptr->system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",mb_io_ptr->beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",mb_io_ptr->beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",mb_io_ptr->pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",mb_io_ptr->format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",mb_io_ptr->system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",mb_io_ptr->format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",mb_io_ptr->numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",mb_io_ptr->filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",mb_io_ptr->variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",mb_io_ptr->traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",mb_io_ptr->beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",mb_io_ptr->nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",mb_io_ptr->heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",mb_io_ptr->vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",mb_io_ptr->svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",mb_io_ptr->beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",mb_io_ptr->beamwidth_ltrack);
-		fprintf(stderr,"dbg2       format_alloc:       %p\n",(void *)mb_io_ptr->mb_io_format_alloc);
-		fprintf(stderr,"dbg2       format_free:        %p\n",(void *)mb_io_ptr->mb_io_format_free);
-		fprintf(stderr,"dbg2       store_alloc:        %p\n",(void *)mb_io_ptr->mb_io_store_alloc);
-		fprintf(stderr,"dbg2       store_free:         %p\n",(void *)mb_io_ptr->mb_io_store_free);
-		fprintf(stderr,"dbg2       read_ping:          %p\n",(void *)mb_io_ptr->mb_io_read_ping);
-		fprintf(stderr,"dbg2       write_ping:         %p\n",(void *)mb_io_ptr->mb_io_write_ping);
-		fprintf(stderr,"dbg2       extract:            %p\n",(void *)mb_io_ptr->mb_io_extract);
-		fprintf(stderr,"dbg2       insert:             %p\n",(void *)mb_io_ptr->mb_io_insert);
-		fprintf(stderr,"dbg2       extract_nav:        %p\n",(void *)mb_io_ptr->mb_io_extract_nav);
-		fprintf(stderr,"dbg2       insert_nav:         %p\n",(void *)mb_io_ptr->mb_io_insert_nav);
-		fprintf(stderr,"dbg2       extract_altitude:   %p\n",(void *)mb_io_ptr->mb_io_extract_altitude);
-		fprintf(stderr,"dbg2       insert_altitude:    %p\n",(void *)mb_io_ptr->mb_io_insert_altitude);
-		fprintf(stderr,"dbg2       extract_svp:        %p\n",(void *)mb_io_ptr->mb_io_extract_svp);
-		fprintf(stderr,"dbg2       insert_svp:         %p\n",(void *)mb_io_ptr->mb_io_insert_svp);
-		fprintf(stderr,"dbg2       ttimes:             %p\n",(void *)mb_io_ptr->mb_io_ttimes);
-		fprintf(stderr,"dbg2       detects:            %p\n",(void *)mb_io_ptr->mb_io_detects);
-		fprintf(stderr,"dbg2       extract_rawss:      %p\n",(void *)mb_io_ptr->mb_io_extract_rawss);
-		fprintf(stderr,"dbg2       insert_rawss:       %p\n",(void *)mb_io_ptr->mb_io_insert_rawss);
-		fprintf(stderr,"dbg2       copyrecord:         %p\n",(void *)mb_io_ptr->mb_io_copyrecord);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbr_info_mr1prhig(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error)
-{
-	char	*function_name = "mbr_info_mr1prhig";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* set format info parameters */
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-	*system = MB_SYS_MR1;
-	*beams_bath_max = 3003;
-	*beams_amp_max = 0;
-	*pixels_ss_max = 7003;
-	strncpy(format_name, "MR1PRHIG", MB_NAME_LENGTH);
-	strncpy(system_name, "MR1", MB_NAME_LENGTH);
-	strncpy(format_description, "Format name:      MBF_MR1PRHIG\nInformal Description: Obsolete SOEST MR1 post processed format\nAttributes:           SOEST MR1, bathymetry and sidescan,\n                      variable beams and pixels, xdr binary, \n                      SOEST, University of Hawaii.\n", MB_DESCRIPTION_LENGTH);
-	*numfile = 1;
-	*filetype = MB_FILETYPE_XDR;
-	*variable_beams = MB_YES;
-	*traveltime = MB_YES;
-	*beam_flagging = MB_YES;
-	*nav_source = MB_DATA_DATA;
-	*heading_source = MB_DATA_DATA;
-	*vru_source = MB_DATA_DATA;
-	*svp_source = MB_DATA_DATA;
-	*beamwidth_xtrack = 0.0;
-	*beamwidth_ltrack = 2.0;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",*system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",*beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",*beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",*pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",*numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",*filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",*variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",*traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",*beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",*nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",*heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",*vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",*svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",*beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",*beamwidth_ltrack);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_alm_mr1prhig(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_alm_mr1prhig";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_mr1prhig_struct *data;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set initial status */
-	status = MB_SUCCESS;
-
-	/* allocate memory for data structure */
-	mb_io_ptr->structure_size = sizeof(struct mbf_mr1prhig_struct);
-	mb_io_ptr->data_structure_size = 0;
-	status = mb_mallocd(verbose,__FILE__,__LINE__,mb_io_ptr->structure_size,
-				&mb_io_ptr->raw_data,error);
-	status = mb_mallocd(verbose,__FILE__,__LINE__,sizeof(struct mbsys_mr1_struct),
-				&mb_io_ptr->store_data,error);
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-	data = (struct mbf_mr1prhig_struct *) mb_io_ptr->raw_data;
-
-	/* initialize everything to zeros */
-	mbr_zero_mr1prhig(verbose,data,error);
-	mb_io_ptr->fileheader = MB_NO;
-	mb_io_ptr->hdr_comment_size = 0;
-	mb_io_ptr->hdr_comment = NULL;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_dem_mr1prhig(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_dem_mr1prhig";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* deallocate memory for data descriptor */
-	status = mb_freed(verbose,__FILE__, __LINE__, (void **)&mb_io_ptr->raw_data,error);
-	status = mb_freed(verbose,__FILE__, __LINE__, (void **)&mb_io_ptr->store_data,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_zero_mr1prhig(int verbose, struct mbf_mr1prhig_struct *data, int *error)
-{
-	char	*function_name = "mbr_zero_mr1prhig";
-	int	status = MB_SUCCESS;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       data:       %p\n",(void *)data);
-		}
-
-	/* initialize everything to zeros */
-	if (data != NULL)
-		{
-		/* type of data record */
-		data->kind = MB_DATA_NONE;
-
-		/* file header info */
-		data->mf_magic = 6666;
-		data->mf_count = 0;
-		if (data->mf_log == NULL)
-
-		/* ping header */
-		data->sec = 0;
-		data->usec = 0;
-		data->png_lon = 0.0;
-		data->png_lat = 0.0;
-		data->png_course = 0.0;
-		data->png_compass = 0.0;
-		data->png_prdepth = 0.0;
-		data->png_alt = 0.0;
-		data->png_pitch = 0.0;
-		data->png_roll = 0.0;
-		data->png_temp = 0.0;
-		data->png_atssincr = 0.0;
-
-		/* port settings */
-		data->port_trans[0] = 0.0;
-		data->port_trans[1] = 0.0;
-		data->port_gain = 0.0;
-		data->port_pulse = 0.0;
-		data->port_btycount = 0;
-		data->port_btypad = 0;
-		data->port_ssoffset = 0.0;
-		data->port_sscount = 0;
-		data->port_sspad = 0;
-
-		/* starboard settings */
-		data->stbd_trans[0] = 0.0;
-		data->stbd_trans[1] = 0.0;
-		data->stbd_gain = 0.0;
-		data->stbd_pulse = 0.0;
-		data->stbd_btycount = 0;
-		data->stbd_btypad = 0;
-		data->stbd_ssoffset = 0.0;
-		data->stbd_sscount = 0;
-		data->stbd_sspad = 0;
-
-		/* bathymetry */
-		for (i=0;i<MBF_MR1PRHIG_BEAMS_SIDE;i++)
-			{
-			data->bath_acrosstrack_port[i] = 0.0;
-			data->bath_port[i] = 0.0;
-			data->bath_acrosstrack_stbd[i] = 0.0;
-			data->bath_stbd[i] = 0.0;
-			}
-
-		/* sidescan */
-		for (i=0;i<MBF_MR1PRHIG_PIXELS_SIDE;i++)
-			{
-			data->ss_port[i] = 0.0;
-			data->ss_stbd[i] = 0.0;
-			}
-
-		/* comment */
-		strncpy(data->comment,"\0",MBF_MR1PRHIG_MAXLINE);
-
-		}
-
-	/* assume success */
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_rt_mr1prhig(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_rt_mr1prhig";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_mr1prhig_struct *data;
-	struct mbsys_mr1_struct *store;
-	double	xtrack, depth;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointers to mbio descriptor and data structures */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-	data = (struct mbf_mr1prhig_struct *) mb_io_ptr->raw_data;
-	store = (struct mbsys_mr1_struct *) store_ptr;
-
-	/* read next data from file */
-	status = mbr_mr1prhig_rd_data(verbose,mbio_ptr,error);
-
-	/* set error and kind in mb_io_ptr */
-	mb_io_ptr->new_error = *error;
-	mb_io_ptr->new_kind = data->kind;
-
-	/* translate values to mr1 data storage structure */
-	if (status == MB_SUCCESS
-		&& store != NULL)
-		{
-		/* type of data record */
-		store->kind = data->kind;
-
-		/* file header info */
-		store->mf_magic = data->mf_magic;
-		store->mf_count = data->mf_count;
-
-		/* ping header */
-		store->sec = data->sec;
-		store->usec = data->usec;
-		store->png_lon = data->png_lon;
-		store->png_lat = data->png_lat;
-		store->png_course = data->png_course;
-		store->png_compass = data->png_compass;
-		store->png_prdepth = data->png_prdepth;
-		store->png_alt = data->png_alt;
-		store->png_pitch = data->png_pitch;
-		store->png_roll = data->png_roll;
-		store->png_temp = data->png_temp;
-		store->png_atssincr = data->png_atssincr;
-
-		/* port settings */
-		store->port_trans[0] = data->port_trans[0];
-		store->port_trans[1] = data->port_trans[1];
-		store->port_gain = data->port_gain;
-		store->port_pulse = data->port_pulse;
-		store->port_btycount = data->port_btycount;
-		store->port_btypad = data->port_btypad;
-		store->port_ssoffset = data->port_ssoffset;
-		store->port_sscount = data->port_sscount;
-		store->port_sspad = data->port_sspad;
-
-		/* starboard settings */
-		store->stbd_trans[0] = data->stbd_trans[0];
-		store->stbd_trans[1] = data->stbd_trans[1];
-		store->stbd_gain = data->stbd_gain;
-		store->stbd_pulse = data->stbd_pulse;
-		store->stbd_btycount = data->stbd_btycount;
-		store->stbd_btypad = data->stbd_btypad;
-		store->stbd_ssoffset = data->stbd_ssoffset;
-		store->stbd_sscount = data->stbd_sscount;
-		store->stbd_sspad = data->stbd_sspad;
-
-		/* bathymetry */
-		for (i=0;i<store->port_btycount;i++)
-			{
-			store->bath_acrosstrack_port[i]
-				= data->bath_acrosstrack_port[i];
-			store->bath_port[i] = data->bath_port[i];
-			}
-		for (i=0;i<store->stbd_btycount;i++)
-			{
-			store->bath_acrosstrack_stbd[i]
-				= data->bath_acrosstrack_stbd[i];
-			store->bath_stbd[i] = data->bath_stbd[i];
-			}
-
-		/* get travel times and angles assuming
-		   bathymetry calculated using simple
-		   1500 m/s water velocity */
-		for (i=0;i<store->port_btycount;i++)
-			{
-			depth = fabs(store->bath_port[i]) - store->png_prdepth;
-			xtrack = -store->bath_acrosstrack_port[i];
-			if (fabs(depth) > 0.0)
-				{
-				store->tt_port[i]
-					= sqrt(depth*depth
-					    + xtrack*xtrack)/750.0;
-				store->angle_port[i]
-					= RTD*atan(xtrack/fabs(depth));
-				}
-			else
-				{
-				store->tt_port[i] = 0.0;
-				store->angle_port[i] = 0.0;
-				}
-			}
-		store->png_tt = fabs(store->png_alt) / 750.0;
-		for (i=0;i<store->stbd_btycount;i++)
-			{
-			depth = fabs(store->bath_stbd[i]) - store->png_prdepth;
-			xtrack = store->bath_acrosstrack_stbd[i];
-			if (fabs(depth) > 0.0)
-				{
-				store->tt_stbd[i]
-					= sqrt(depth*depth
-					    + xtrack*xtrack)/750.0;
-				store->angle_stbd[i]
-					= RTD*atan(xtrack/fabs(depth));
-				}
-			else
-				{
-				store->tt_stbd[i] = 0.0;
-				store->angle_stbd[i] = 0.0;
-				}
-			}
-
-		/* sidescan */
-		for (i=0;i<store->port_sscount;i++)
-			{
-			store->ss_port[i] = data->ss_port[i];
-			}
-		for (i=0;i<store->stbd_sscount;i++)
-			{
-			store->ss_stbd[i] = data->ss_stbd[i];
-			}
-
-		/* comment */
-		strncpy(store->comment,data->comment,MBF_MR1PRHIG_MAXLINE);
-
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_wt_mr1prhig(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_wt_mr1prhig";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_mr1prhig_struct *data;
-	struct mbsys_mr1_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_mr1prhig_struct *) mb_io_ptr->raw_data;
-	store = (struct mbsys_mr1_struct *) store_ptr;
-
-	/* first translate values from data storage structure */
-	if (store != NULL)
-		{
-		/* type of data record */
-		data->kind = store->kind;
-
-		/* file header info */
-		data->mf_magic = store->mf_magic;
-		data->mf_count = store->mf_count;
-
-		/* ping header */
-		data->sec = store->sec;
-		data->usec = store->usec;
-		data->png_lon = store->png_lon;
-		data->png_lat = store->png_lat;
-		data->png_course = store->png_course;
-		data->png_compass = store->png_compass;
-		data->png_prdepth = store->png_prdepth;
-		data->png_alt = store->png_alt;
-		data->png_pitch = store->png_pitch;
-		data->png_roll = store->png_roll;
-		data->png_temp = store->png_temp;
-		data->png_atssincr = store->png_atssincr;
-
-		/* port settings */
-		data->port_trans[0] = store->port_trans[0];
-		data->port_trans[1] = store->port_trans[1];
-		data->port_gain = store->port_gain;
-		data->port_pulse = store->port_pulse;
-		data->port_btycount = store->port_btycount;
-		data->port_btypad = store->port_btypad;
-		data->port_ssoffset = store->port_ssoffset;
-		data->port_sscount = store->port_sscount;
-		data->port_sspad = store->port_sspad;
-
-		/* starboard settings */
-		data->stbd_trans[0] = store->stbd_trans[0];
-		data->stbd_trans[1] = store->stbd_trans[1];
-		data->stbd_gain = store->stbd_gain;
-		data->stbd_pulse = store->stbd_pulse;
-		data->stbd_btycount = store->stbd_btycount;
-		data->stbd_btypad = store->stbd_btypad;
-		data->stbd_ssoffset = store->stbd_ssoffset;
-		data->stbd_sscount = store->stbd_sscount;
-		data->stbd_sspad = store->stbd_sspad;
-
-		/* bathymetry */
-		for (i=0;i<data->port_btycount;i++)
-			{
-			data->bath_acrosstrack_port[i]
-				= store->bath_acrosstrack_port[i];
-			data->bath_port[i] = store->bath_port[i];
-			}
-		for (i=0;i<data->stbd_btycount;i++)
-			{
-			data->bath_acrosstrack_stbd[i]
-				= store->bath_acrosstrack_stbd[i];
-			data->bath_stbd[i] = store->bath_stbd[i];
-			}
-
-		/* sidescan */
-		for (i=0;i<data->port_sscount;i++)
-			{
-			data->ss_port[i] = store->ss_port[i];
-			}
-		for (i=0;i<data->stbd_sscount;i++)
-			{
-			data->ss_stbd[i] = store->ss_stbd[i];
-			}
-
-		/* comment */
-		strncpy(data->comment,store->comment,MBF_MR1PRHIG_MAXLINE);
-		}
-
-	/* write next data to file */
-	status = mbr_mr1prhig_wr_data(verbose,mbio_ptr,data,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_mr1prhig_rd_data(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_mr1prhig_rd_data";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_mr1prhig_struct *data;
-	XDR	*xdrs;
-	int	read_size;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_mr1prhig_struct *) mb_io_ptr->raw_data;
-	xdrs = mb_io_ptr->xdrs;
-
-	/* initialize everything to zeros */
-	mbr_zero_mr1prhig(verbose,data,error);
-
-	/* if first time through read file header */
-	if (mb_io_ptr->fileheader == MB_NO)
-		{
-		status = mbr_mr1prhig_rd_hdr(verbose,xdrs,data,
-			&mb_io_ptr->hdr_comment,error);
-		if (status == MB_SUCCESS)
-			{
-			mb_io_ptr->fileheader = MB_YES;
-			if (mb_io_ptr->hdr_comment == NULL)
-				mb_io_ptr->hdr_comment_size = 0;
-			else
-				mb_io_ptr->hdr_comment_size
-					= strlen(mb_io_ptr->hdr_comment);
-			mb_io_ptr->hdr_comment_loc = 0;
-			if (mb_io_ptr->hdr_comment_size > 80)
-				read_size = 80;
-			else
-				read_size = mb_io_ptr->hdr_comment_size;
-			strncpy(data->comment,mb_io_ptr->hdr_comment,read_size);
-			mb_io_ptr->hdr_comment_loc = read_size;
-			data->kind = MB_DATA_COMMENT;
-			}
-		}
-
-	/* if comments are still held in mb_io_ptr->hdr_comment then
-		extract comment and return */
-	else if (mb_io_ptr->hdr_comment_size > mb_io_ptr->hdr_comment_loc)
-		{
-		if (mb_io_ptr->hdr_comment_size - mb_io_ptr->hdr_comment_loc
-			> 80)
-			read_size = 80;
-		else
-			read_size = mb_io_ptr->hdr_comment_size
-				- mb_io_ptr->hdr_comment_loc;
-		strncpy(data->comment,
-			&mb_io_ptr->hdr_comment[mb_io_ptr->hdr_comment_loc],
-			read_size);
-		mb_io_ptr->hdr_comment_loc += read_size;
-		data->kind = MB_DATA_COMMENT;
-		}
-
-	/* else read data */
-	else
-		{
-		status = mbr_mr1prhig_rd_ping(verbose,xdrs,data,error);
-		if (status == MB_SUCCESS)
-			{
-			data->kind = MB_DATA_DATA;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_mr1prhig_rd_hdr(int verbose, XDR *xdrs,
-		struct mbf_mr1prhig_struct *data, char **hdr_comment,
-		int *error)
-{
-	char	*function_name = "mbr_mr1prhig_rd_hdr";
-	int	status = MB_SUCCESS;
-	int	len;
-	unsigned int	ulen;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       xdrs:       %p\n",(void *)xdrs);
-		fprintf(stderr,"dbg2       data:       %p\n",(void *)data);
-		fprintf(stderr,"dbg2       hdr_comment:%p\n",(void *)*hdr_comment);
-		}
-
-	/* set status and error */
-	*error = MB_ERROR_NO_ERROR;
-	status = MB_SUCCESS;
-
-	/* read magic number */
-	status = xdr_int(xdrs, &data->mf_magic);
-
-	/* read ping count */
-	if (status == MB_SUCCESS)
-		status = xdr_int(xdrs, &data->mf_count);
-
-	/* read header comment */
-	if (status == MB_SUCCESS)
-		status = xdr_int(xdrs, &len);
-	if (status == MB_SUCCESS)
-		{
-		if (len > 0)
-			{
-			status = mb_mallocd(verbose,__FILE__,__LINE__,len+1,(void **)hdr_comment,error);
-			status = xdr_bytes(xdrs,hdr_comment,
-					&ulen,(unsigned int)(len + 1));
-			}
-		else if (len < 0)
-			status = MB_FAILURE;
-		}
-
-	if (status == MB_FAILURE && *error == MB_ERROR_NO_ERROR)
-		*error = MB_ERROR_EOF;
-	else if (data->mf_magic != 6666)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       mf_magic:         %d\n",data->mf_magic);
-		fprintf(stderr,"dbg5       mf_count:         %d\n",data->mf_count);
-		fprintf(stderr,"dbg5       hdr_comment:\n%s\n",*hdr_comment);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_mr1prhig_rd_ping(int verbose, XDR *xdrs,
-		struct mbf_mr1prhig_struct *data, int *error)
-{
-	char	*function_name = "mbr_mr1prhig_rd_ping";
-	int	status = MB_SUCCESS;
-	int	dummy_count;
-	float	dummy;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       xdrs:       %p\n",(void *)xdrs);
-		fprintf(stderr,"dbg2       data:       %p\n",(void *)data);
-		}
-
-	/* read ping header */
-	status = xdr_int(xdrs, &data->sec);
-	status = xdr_int(xdrs, &data->usec);
-	status = xdr_double(xdrs, &data->png_lon);
-	status = xdr_double(xdrs, &data->png_lat);
-	status = xdr_float(xdrs, &data->png_course);
-	status = xdr_float(xdrs, &data->png_compass);
-	status = xdr_float(xdrs, &data->png_prdepth);
-	status = xdr_float(xdrs, &data->png_alt);
-	status = xdr_float(xdrs, &data->png_pitch);
-	status = xdr_float(xdrs, &data->png_roll);
-	status = xdr_float(xdrs, &data->png_temp);
-	status = xdr_float(xdrs, &data->png_atssincr);
-
-	/* read port side header */
-	status = xdr_float(xdrs, &data->port_trans[0]);
-	status = xdr_float(xdrs, &data->port_trans[1]);
-	status = xdr_float(xdrs, &data->port_gain);
-	status = xdr_float(xdrs, &data->port_pulse);
-	status = xdr_int(xdrs, &data->port_btycount);
-	status = xdr_float(xdrs, &data->port_ssoffset);
-	status = xdr_int(xdrs, &data->port_sscount);
-
-	/* read starboard side header */
-	status = xdr_float(xdrs, &data->stbd_trans[0]);
-	status = xdr_float(xdrs, &data->stbd_trans[1]);
-	status = xdr_float(xdrs, &data->stbd_gain);
-	status = xdr_float(xdrs, &data->stbd_pulse);
-	status = xdr_int(xdrs, &data->stbd_btycount);
-	status = xdr_float(xdrs, &data->stbd_ssoffset);
-	status = xdr_int(xdrs, &data->stbd_sscount);
-
-	/* read bathymetry and sidescan data
-		- handle more data than allowed by MBIO by
-		  throwing away the excess */
-
-	/* do port bathymetry */
-	if (data->port_btycount > MBF_MR1PRHIG_BEAMS_SIDE)
-		{
-		/* output debug messages */
-		if (verbose > 0)
-			{
-			fprintf(stderr, "Port bathymetry count exceeds MBIO maximum: %d %d\n",
-				data->port_btycount, MBF_MR1PRHIG_BEAMS_SIDE);
-			}
-		dummy_count = data->port_btycount
-			- MBF_MR1PRHIG_BEAMS_SIDE;
-		data->port_btycount = MBF_MR1PRHIG_BEAMS_SIDE;
-		}
-	else
-		dummy_count = 0;
-	for (i=0;i<data->port_btycount;i++)
-		{
-		status = xdr_float(xdrs,&data->bath_acrosstrack_port[i]);
-		status = xdr_float(xdrs,&data->bath_port[i]);
-		}
-	for (i=0;i<dummy_count;i++)
-		{
-		status = xdr_float(xdrs,&dummy);
-		status = xdr_float(xdrs,&dummy);
-		}
-
-	/* do port sidescan */
-	if (data->port_sscount > MBF_MR1PRHIG_PIXELS_SIDE)
-		{
-		/* output debug messages */
-		if (verbose > 0)
-			{
-			fprintf(stderr, "Port sidescan count exceeds MBIO maximum: %d %d\n",
-				data->port_sscount, MBF_MR1PRHIG_PIXELS_SIDE);
-			}
-		dummy_count = data->port_sscount
-			- MBF_MR1PRHIG_PIXELS_SIDE;
-		data->port_sscount = MBF_MR1PRHIG_PIXELS_SIDE;
-		}
-	else
-		dummy_count = 0;
-	for (i=0;i<data->port_sscount;i++)
-		{
-		status = xdr_float(xdrs,&data->ss_port[i]);
-		}
-	for (i=0;i<dummy_count;i++)
-		{
-		status = xdr_float(xdrs,&dummy);
-		}
-
-	/* do starboard bathymetry */
-	if (data->stbd_btycount > MBF_MR1PRHIG_BEAMS_SIDE)
-		{
-		/* output debug messages */
-		if (verbose > 0)
-			{
-			fprintf(stderr, "Starboard bathymetry count exceeds MBIO maximum: %d %d\n",
-				data->stbd_btycount, MBF_MR1PRHIG_BEAMS_SIDE);
-			}
-		dummy_count = data->stbd_btycount
-			- MBF_MR1PRHIG_BEAMS_SIDE;
-		data->stbd_btycount = MBF_MR1PRHIG_BEAMS_SIDE;
-		}
-	else
-		dummy_count = 0;
-	for (i=0;i<data->stbd_btycount;i++)
-		{
-		status = xdr_float(xdrs,&data->bath_acrosstrack_stbd[i]);
-		status = xdr_float(xdrs,&data->bath_stbd[i]);
-		}
-	for (i=0;i<dummy_count;i++)
-		{
-		status = xdr_float(xdrs,&dummy);
-		status = xdr_float(xdrs,&dummy);
-		}
-
-	/* do starboard sidescan */
-	if (data->stbd_sscount > MBF_MR1PRHIG_PIXELS_SIDE)
-		{
-		/* output debug messages */
-		if (verbose > 0)
-			{
-			fprintf(stderr, "Starboard sidescan count exceeds MBIO maximum: %d %d\n",
-				data->stbd_sscount, MBF_MR1PRHIG_PIXELS_SIDE);
-			}
-		dummy_count = data->stbd_sscount
-			- MBF_MR1PRHIG_PIXELS_SIDE;
-		data->stbd_sscount = MBF_MR1PRHIG_PIXELS_SIDE;
-		}
-	else
-		dummy_count = 0;
-	for (i=0;i<data->stbd_sscount;i++)
-		{
-		status = xdr_float(xdrs,&data->ss_stbd[i]);
-		}
-	for (i=0;i<dummy_count;i++)
-		{
-		status = xdr_float(xdrs,&dummy);
-		}
-
-	if (status == MB_FAILURE)
-		*error = MB_ERROR_EOF;
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       sec:              %d\n",data->sec);
-		fprintf(stderr,"dbg5       usec:             %d\n",data->usec);
-		fprintf(stderr,"dbg5       longitude:        %f\n",
-			data->png_lon);
-		fprintf(stderr,"dbg5       latitude:         %f\n",
-			data->png_lat);
-		fprintf(stderr,"dbg5       course:           %f\n",
-			data->png_course);
-		fprintf(stderr,"dbg5       heading:          %f\n",
-			data->png_compass);
-		fprintf(stderr,"dbg5       pressure depth:   %f\n",
-			data->png_prdepth);
-		fprintf(stderr,"dbg5       altitude:         %f\n",
-			data->png_alt);
-		fprintf(stderr,"dbg5       pitch:            %f\n",
-			data->png_pitch);
-		fprintf(stderr,"dbg5       roll:             %f\n",
-			data->png_roll);
-		fprintf(stderr,"dbg5       temperature:      %f\n",
-			data->png_temp);
-		fprintf(stderr,"dbg5       pixel spacing:    %f\n",
-			data->png_atssincr);
-		fprintf(stderr,"dbg5       port transmit 0:  %f\n",
-			data->port_trans[0]);
-		fprintf(stderr,"dbg5       port transmit 1:  %f\n",
-			data->port_trans[1]);
-		fprintf(stderr,"dbg5       port gain:        %f\n",
-			data->port_gain);
-		fprintf(stderr,"dbg5       port pulse:       %f\n",
-			data->port_pulse);
-		fprintf(stderr,"dbg5       port bath count:  %d\n",
-			data->port_btycount);
-		fprintf(stderr,"dbg5       port ss offset:   %f\n",
-			data->port_ssoffset);
-		fprintf(stderr,"dbg5       port ss count:    %d\n",
-			data->port_sscount);
-		fprintf(stderr,"dbg5       stbd transmit 0:  %f\n",
-			data->stbd_trans[0]);
-		fprintf(stderr,"dbg5       stbd transmit 1:  %f\n",
-			data->stbd_trans[1]);
-		fprintf(stderr,"dbg5       stbd gain:        %f\n",
-			data->stbd_gain);
-		fprintf(stderr,"dbg5       stbd pulse:       %f\n",
-			data->stbd_pulse);
-		fprintf(stderr,"dbg5       stbd bath count:  %d\n",
-			data->stbd_btycount);
-		fprintf(stderr,"dbg5       stbd ss offset:   %f\n",
-			data->stbd_ssoffset);
-		fprintf(stderr,"dbg5       stbd ss count:    %d\n",
-			data->stbd_sscount);
-		fprintf(stderr,"\n");
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"dbg5       port_beam  depth   xtrack\n");
-		for (i=0;i<data->port_btycount;i++)
-		  {
-		  fprintf(stderr,"dbg5       %3d     %12.4g %12.4g\n",
-			i,data->bath_port[i],data->bath_acrosstrack_port[i]);
-		  }
-		fprintf(stderr,"\n");
-		fprintf(stderr,"dbg5       stbd_beam  depth   xtrack\n");
-		for (i=0;i<data->stbd_btycount;i++)
-		  {
-		  fprintf(stderr,"dbg5       %3d     %12.4g %12.4g\n",
-			i,data->bath_stbd[i],data->bath_acrosstrack_stbd[i]);
-		  }
-		fprintf(stderr,"\n");
-		fprintf(stderr,"dbg5       port_pixel  sidescan\n");
-		for (i=0;i<data->port_sscount;i++)
-		  {
-		  fprintf(stderr,"dbg5       %3d     %12.4g\n",
-			i,data->ss_port[i]);
-		  }
-		fprintf(stderr,"\n");
-		fprintf(stderr,"dbg5       stbd_pixel  sidescan\n");
-		for (i=0;i<data->stbd_sscount;i++)
-		  {
-		  fprintf(stderr,"dbg5       %3d     %12.4g\n",
-			i,data->ss_stbd[i]);
-		  }
-		fprintf(stderr,"\n");
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_mr1prhig_wr_data(int verbose, void *mbio_ptr, struct mbf_mr1prhig_struct *data, int *error)
-{
-	char	*function_name = "mbr_mr1prhig_wr_data";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	XDR	*xdrs;
-	char	*tmp;
-	int	lenc, lenhc, len;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       data:       %p\n",(void *)data);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to XDR structure */
-	xdrs = mb_io_ptr->xdrs;
-
-	/* if comment and file header not written */
-	if (mb_io_ptr->fileheader == MB_NO && data->kind == MB_DATA_COMMENT)
-		{
-		/* add comment to string mb_io_ptr->hdr_comment
-			to be be written in file header */
-		lenc = strlen(data->comment);
-		lenhc = 0;
-		if (mb_io_ptr->hdr_comment != NULL)
-			lenhc = strlen(mb_io_ptr->hdr_comment);
-		len = lenc + lenhc + 1;
-		status = mb_mallocd(verbose,__FILE__,__LINE__,len,(void **)&tmp,error);
-		strcpy(tmp,"\0");
-		if (lenhc > 0) strcpy(tmp,mb_io_ptr->hdr_comment);
-		if (lenc > 0) strcat(tmp,data->comment);
-		if (mb_io_ptr->hdr_comment != NULL)
-			mb_freed(verbose,__FILE__, __LINE__, (void **)&mb_io_ptr->hdr_comment,error);
-		mb_io_ptr->hdr_comment = tmp;
-		}
-
-	/* if data and file header not written */
-	else if (mb_io_ptr->fileheader == MB_NO
-		&& data->kind != MB_DATA_COMMENT)
-		{
-		/* write file header */
-		status = mbr_mr1prhig_wr_hdr(verbose,xdrs,data,
-				&mb_io_ptr->hdr_comment,error);
-		mb_io_ptr->fileheader = MB_YES;
-
-		/* write data */
-		status = mbr_mr1prhig_wr_ping(verbose,xdrs,data,error);
-		}
-
-	/* if data and file header written */
-	else if (mb_io_ptr->fileheader == MB_YES
-		&& data->kind == MB_DATA_DATA)
-		{
-		/* write data */
-		status = mbr_mr1prhig_wr_ping(verbose,xdrs,data,error);
-		}
-
-	/* if not data and file header written */
-	else if (mb_io_ptr->fileheader == MB_YES
-		&& data->kind != MB_DATA_DATA)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_BAD_KIND;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Data record kind in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       kind:       %d\n",data->kind);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_mr1prhig_wr_hdr(int verbose, XDR *xdrs,
-		struct mbf_mr1prhig_struct *data, char **hdr_comment, int *error)
-{
-	char	*function_name = "mbr_mr1prhig_wr_hdr";
-	int	status = MB_SUCCESS;
-	int	len;
-	unsigned int	ulen;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       xdrs:       %p\n",(void *)xdrs);
-		fprintf(stderr,"dbg2       data:       %p\n",(void *)data);
-		fprintf(stderr,"dbg2       hdr_comment:%p\n",(void *)*hdr_comment);
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       mf_magic:         %d\n",data->mf_magic);
-		fprintf(stderr,"dbg5       mf_count:         %d\n",data->mf_count);
-		fprintf(stderr,"dbg5       hdr_comment:\n%s\n",*hdr_comment);
-		}
-
-	/* set status and error */
-	*error = MB_ERROR_NO_ERROR;
-	status = MB_SUCCESS;
-
-	/* write magic number */
-	status = xdr_int(xdrs, &data->mf_magic);
-
-	/* write ping count */
-	if (status == MB_SUCCESS)
-		{
-		status = xdr_int(xdrs, &data->mf_count);
-		}
-
-	/* write header comment */
-	if (status == MB_SUCCESS)
-		{
-		if (*hdr_comment == NULL)
-			len = 0;
-		else
-			len = strlen(*hdr_comment);
-		status = xdr_int(xdrs, &len);
-		}
-	if (status == MB_SUCCESS && len > 0)
-		{
-		ulen = len;
-		status = xdr_bytes(xdrs,hdr_comment,
-				&ulen,(unsigned int)len);
-		}
-
-	/* check for an error */
-	if (status != MB_SUCCESS)
-		*error = MB_ERROR_WRITE_FAIL;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_mr1prhig_wr_ping(int verbose, XDR *xdrs, struct mbf_mr1prhig_struct *data, int *error)
-{
-	char	*function_name = "mbr_mr1prhig_wr_ping";
-	int	status = MB_SUCCESS;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       xdrs:       %p\n",(void *)xdrs);
-		fprintf(stderr,"dbg2       data:       %p\n",(void *)data);
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       sec:              %d\n",data->sec);
-		fprintf(stderr,"dbg5       usec:             %d\n",data->usec);
-		fprintf(stderr,"dbg5       longitude:        %f\n",
-			data->png_lon);
-		fprintf(stderr,"dbg5       latitude:         %f\n",
-			data->png_lat);
-		fprintf(stderr,"dbg5       course:           %f\n",
-			data->png_course);
-		fprintf(stderr,"dbg5       heading:          %f\n",
-			data->png_compass);
-		fprintf(stderr,"dbg5       pressure depth:   %f\n",
-			data->png_prdepth);
-		fprintf(stderr,"dbg5       altitude:         %f\n",
-			data->png_alt);
-		fprintf(stderr,"dbg5       pitch:            %f\n",
-			data->png_pitch);
-		fprintf(stderr,"dbg5       roll:             %f\n",
-			data->png_roll);
-		fprintf(stderr,"dbg5       temperature:      %f\n",
-			data->png_temp);
-		fprintf(stderr,"dbg5       pixel spacing:    %f\n",
-			data->png_atssincr);
-		fprintf(stderr,"dbg5       port transmit 0:  %f\n",
-			data->port_trans[0]);
-		fprintf(stderr,"dbg5       port transmit 1:  %f\n",
-			data->port_trans[1]);
-		fprintf(stderr,"dbg5       port gain:        %f\n",
-			data->port_gain);
-		fprintf(stderr,"dbg5       port pulse:       %f\n",
-			data->port_pulse);
-		fprintf(stderr,"dbg5       port bath count:  %d\n",
-			data->port_btycount);
-		fprintf(stderr,"dbg5       port ss offset:   %f\n",
-			data->port_ssoffset);
-		fprintf(stderr,"dbg5       port ss count:    %d\n",
-			data->port_sscount);
-		fprintf(stderr,"dbg5       stbd transmit 0:  %f\n",
-			data->stbd_trans[0]);
-		fprintf(stderr,"dbg5       stbd transmit 1:  %f\n",
-			data->stbd_trans[1]);
-		fprintf(stderr,"dbg5       stbd gain:        %f\n",
-			data->stbd_gain);
-		fprintf(stderr,"dbg5       stbd pulse:       %f\n",
-			data->stbd_pulse);
-		fprintf(stderr,"dbg5       stbd bath count:  %d\n",
-			data->stbd_btycount);
-		fprintf(stderr,"dbg5       stbd ss offset:   %f\n",
-			data->stbd_ssoffset);
-		fprintf(stderr,"dbg5       stbd ss count:    %d\n",
-			data->stbd_sscount);
-		fprintf(stderr,"\n");
-		fprintf(stderr,"dbg5       port_beam  depth   xtrack\n");
-		for (i=0;i<data->port_btycount;i++)
-		  {
-		  fprintf(stderr,"dbg5       %3d     %12.4g %12.4g\n",
-			i,data->bath_port[i],data->bath_acrosstrack_port[i]);
-		  }
-		fprintf(stderr,"\n");
-		fprintf(stderr,"dbg5       stbd_beam  depth   xtrack\n");
-		for (i=0;i<data->stbd_btycount;i++)
-		  {
-		  fprintf(stderr,"dbg5       %3d     %12.4g %12.4g\n",
-			i,data->bath_stbd[i],data->bath_acrosstrack_stbd[i]);
-		  }
-		fprintf(stderr,"\n");
-		fprintf(stderr,"dbg5       port_pixel  sidescan\n");
-		for (i=0;i<data->port_sscount;i++)
-		  {
-		  fprintf(stderr,"dbg5       %3d     %12.4g\n",
-			i,data->ss_port[i]);
-		  }
-		fprintf(stderr,"\n");
-		fprintf(stderr,"dbg5       stbd_pixel  sidescan\n");
-		for (i=0;i<data->stbd_sscount;i++)
-		  {
-		  fprintf(stderr,"dbg5       %3d     %12.4g\n",
-			i,data->ss_stbd[i]);
-		  }
-		fprintf(stderr,"\n");
-		}
-
-	/* write ping header */
-	status = xdr_int(xdrs, &data->sec);
-	status = xdr_int(xdrs, &data->usec);
-	status = xdr_double(xdrs, &data->png_lon);
-	status = xdr_double(xdrs, &data->png_lat);
-	status = xdr_float(xdrs, &data->png_course);
-	status = xdr_float(xdrs, &data->png_compass);
-	status = xdr_float(xdrs, &data->png_prdepth);
-	status = xdr_float(xdrs, &data->png_alt);
-	status = xdr_float(xdrs, &data->png_pitch);
-	status = xdr_float(xdrs, &data->png_roll);
-	status = xdr_float(xdrs, &data->png_temp);
-	status = xdr_float(xdrs, &data->png_atssincr);
-
-	/* write port side header */
-	status = xdr_float(xdrs, &data->port_trans[0]);
-	status = xdr_float(xdrs, &data->port_trans[1]);
-	status = xdr_float(xdrs, &data->port_gain);
-	status = xdr_float(xdrs, &data->port_pulse);
-	status = xdr_int(xdrs, &data->port_btycount);
-	status = xdr_float(xdrs, &data->port_ssoffset);
-	status = xdr_int(xdrs, &data->port_sscount);
-
-	/* write starboard side header */
-	status = xdr_float(xdrs, &data->stbd_trans[0]);
-	status = xdr_float(xdrs, &data->stbd_trans[1]);
-	status = xdr_float(xdrs, &data->stbd_gain);
-	status = xdr_float(xdrs, &data->stbd_pulse);
-	status = xdr_int(xdrs, &data->stbd_btycount);
-	status = xdr_float(xdrs, &data->stbd_ssoffset);
-	status = xdr_int(xdrs, &data->stbd_sscount);
-
-	/* write bathymetry and sidescan data */
-	for (i=0;i<data->port_btycount;i++)
-		{
-		status = xdr_float(xdrs,&data->bath_acrosstrack_port[i]);
-		status = xdr_float(xdrs,&data->bath_port[i]);
-		}
-	for (i=0;i<data->port_sscount;i++)
-		{
-		status = xdr_float(xdrs,&data->ss_port[i]);
-		}
-	for (i=0;i<data->stbd_btycount;i++)
-		{
-		status = xdr_float(xdrs,&data->bath_acrosstrack_stbd[i]);
-		status = xdr_float(xdrs,&data->bath_stbd[i]);
-		}
-	for (i=0;i<data->stbd_sscount;i++)
-		{
-		status = xdr_float(xdrs,&data->ss_stbd[i]);
-		}
-	if (status == MB_FAILURE)
-		*error = MB_ERROR_WRITE_FAIL;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mbr_mr1prvr2.c b/src/mbio/mbr_mr1prvr2.c
deleted file mode 100644
index 6bc721a..0000000
--- a/src/mbio/mbr_mr1prvr2.c
+++ /dev/null
@@ -1,1100 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbr_mr1prvr2.c	3/6/2003
- *	$Id: mbr_mr1prvr2.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 2003-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbr_mr1prvr2.c contains the functions for reading and writing
- * multibeam data in the MR1PRVR2 format.
- * These functions include:
- *   mbr_alm_mr1prvr2	- allocate read/write memory
- *   mbr_dem_mr1prvr2	- deallocate read/write memory
- *   mbr_rt_mr1prvr2	- read and translate data
- *   mbr_wt_mr1prvr2	- translate and write data
- *
- * Author:	D. W. Caress
- * Date:	March 6, 2003
- *
- * $Log: mbr_mr1prvr2.c,v $
- * Revision 5.4  2008/07/10 06:43:41  caress
- * Preparing for 5.1.1beta20
- *
- * Revision 5.3  2005/11/05 00:48:05  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.2  2004/04/27 01:01:46  caress
- * Fixed typo.
- *
- * Revision 5.1  2003/05/20 18:05:32  caress
- * Added svp_source to data source parameters.
- *
- * Revision 5.0  2003/03/10 20:03:59  caress
- * Initial version.
- *
- *
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#include <string.h>
-#include <time.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mb_define.h"
-#include "mbbs.h"
-#include "mbsys_mr1v2001.h"
-
-/* essential function prototypes */
-int mbr_register_mr1prvr2(int verbose, void *mbio_ptr,
-		int *error);
-int mbr_info_mr1prvr2(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_alm_mr1prvr2(int verbose, void *mbio_ptr, int *error);
-int mbr_dem_mr1prvr2(int verbose, void *mbio_ptr, int *error);
-int mbr_rt_mr1prvr2(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_wt_mr1prvr2(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_mr1prvr2_rd_data(int verbose, void *mbio_ptr, int *error);
-int mbr_mr1prvr2_wr_data(int verbose, void *mbio_ptr, char *store_ptr, int *error);
-
-static char rcs_id[]="$Id: mbr_mr1prvr2.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mbr_register_mr1prvr2(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_register_mr1prvr2";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* get mb_io_ptr */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set format info parameters */
-	status = mbr_info_mr1prvr2(verbose,
-			&mb_io_ptr->system,
-			&mb_io_ptr->beams_bath_max,
-			&mb_io_ptr->beams_amp_max,
-			&mb_io_ptr->pixels_ss_max,
-			mb_io_ptr->format_name,
-			mb_io_ptr->system_name,
-			mb_io_ptr->format_description,
-			&mb_io_ptr->numfile,
-			&mb_io_ptr->filetype,
-			&mb_io_ptr->variable_beams,
-			&mb_io_ptr->traveltime,
-			&mb_io_ptr->beam_flagging,
-			&mb_io_ptr->nav_source,
-			&mb_io_ptr->heading_source,
-			&mb_io_ptr->vru_source,
-			&mb_io_ptr->svp_source,
-			&mb_io_ptr->beamwidth_xtrack,
-			&mb_io_ptr->beamwidth_ltrack,
-			error);
-
-	/* set format and system specific function pointers */
-	mb_io_ptr->mb_io_format_alloc = &mbr_alm_mr1prvr2;
-	mb_io_ptr->mb_io_format_free = &mbr_dem_mr1prvr2;
-	mb_io_ptr->mb_io_store_alloc = &mbsys_mr1v2001_alloc;
-	mb_io_ptr->mb_io_store_free = &mbsys_mr1v2001_deall;
-	mb_io_ptr->mb_io_read_ping = &mbr_rt_mr1prvr2;
-	mb_io_ptr->mb_io_write_ping = &mbr_wt_mr1prvr2;
-	mb_io_ptr->mb_io_dimensions = &mbsys_mr1v2001_dimensions;
-	mb_io_ptr->mb_io_extract = &mbsys_mr1v2001_extract;
-	mb_io_ptr->mb_io_insert = &mbsys_mr1v2001_insert;
-	mb_io_ptr->mb_io_extract_nav = &mbsys_mr1v2001_extract_nav;
-	mb_io_ptr->mb_io_insert_nav = &mbsys_mr1v2001_insert_nav;
-	mb_io_ptr->mb_io_extract_altitude = &mbsys_mr1v2001_extract_altitude;
-	mb_io_ptr->mb_io_insert_altitude = NULL;
-	mb_io_ptr->mb_io_extract_svp = NULL;
-	mb_io_ptr->mb_io_insert_svp = NULL;
-	mb_io_ptr->mb_io_ttimes = &mbsys_mr1v2001_ttimes;
-	mb_io_ptr->mb_io_detects = &mbsys_mr1v2001_detects;
-	mb_io_ptr->mb_io_copyrecord = &mbsys_mr1v2001_copy;
-	mb_io_ptr->mb_io_extract_rawss = NULL;
-	mb_io_ptr->mb_io_insert_rawss = NULL;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",mb_io_ptr->system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",mb_io_ptr->beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",mb_io_ptr->beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",mb_io_ptr->pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",mb_io_ptr->format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",mb_io_ptr->system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",mb_io_ptr->format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",mb_io_ptr->numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",mb_io_ptr->filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",mb_io_ptr->variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",mb_io_ptr->traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",mb_io_ptr->beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",mb_io_ptr->nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",mb_io_ptr->heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",mb_io_ptr->vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",mb_io_ptr->svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",mb_io_ptr->beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",mb_io_ptr->beamwidth_ltrack);
-		fprintf(stderr,"dbg2       format_alloc:       %p\n",(void *)mb_io_ptr->mb_io_format_alloc);
-		fprintf(stderr,"dbg2       format_free:        %p\n",(void *)mb_io_ptr->mb_io_format_free);
-		fprintf(stderr,"dbg2       store_alloc:        %p\n",(void *)mb_io_ptr->mb_io_store_alloc);
-		fprintf(stderr,"dbg2       store_free:         %p\n",(void *)mb_io_ptr->mb_io_store_free);
-		fprintf(stderr,"dbg2       read_ping:          %p\n",(void *)mb_io_ptr->mb_io_read_ping);
-		fprintf(stderr,"dbg2       write_ping:         %p\n",(void *)mb_io_ptr->mb_io_write_ping);
-		fprintf(stderr,"dbg2       extract:            %p\n",(void *)mb_io_ptr->mb_io_extract);
-		fprintf(stderr,"dbg2       insert:             %p\n",(void *)mb_io_ptr->mb_io_insert);
-		fprintf(stderr,"dbg2       extract_nav:        %p\n",(void *)mb_io_ptr->mb_io_extract_nav);
-		fprintf(stderr,"dbg2       insert_nav:         %p\n",(void *)mb_io_ptr->mb_io_insert_nav);
-		fprintf(stderr,"dbg2       extract_altitude:   %p\n",(void *)mb_io_ptr->mb_io_extract_altitude);
-		fprintf(stderr,"dbg2       insert_altitude:    %p\n",(void *)mb_io_ptr->mb_io_insert_altitude);
-		fprintf(stderr,"dbg2       extract_svp:        %p\n",(void *)mb_io_ptr->mb_io_extract_svp);
-		fprintf(stderr,"dbg2       insert_svp:         %p\n",(void *)mb_io_ptr->mb_io_insert_svp);
-		fprintf(stderr,"dbg2       ttimes:             %p\n",(void *)mb_io_ptr->mb_io_ttimes);
-		fprintf(stderr,"dbg2       detects:            %p\n",(void *)mb_io_ptr->mb_io_detects);
-		fprintf(stderr,"dbg2       extract_rawss:      %p\n",(void *)mb_io_ptr->mb_io_extract_rawss);
-		fprintf(stderr,"dbg2       insert_rawss:       %p\n",(void *)mb_io_ptr->mb_io_insert_rawss);
-		fprintf(stderr,"dbg2       copyrecord:         %p\n",(void *)mb_io_ptr->mb_io_copyrecord);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbr_info_mr1prvr2(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error)
-{
-	char	*function_name = "mbr_info_mr1prvr2";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* set format info parameters */
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-	*system = MB_SYS_MR1;
-	*beams_bath_max = MBSYS_MR1V2001_BEAMS;
-	*beams_amp_max = 0;
-	*pixels_ss_max = MBSYS_MR1V2001_PIXELS;
-	strncpy(format_name, "MR1PRVR2", MB_NAME_LENGTH);
-	strncpy(system_name, "MR1", MB_NAME_LENGTH);
-	strncpy(format_description, "Format name:          MBF_MR1PRVR2\nInformal Description: SOEST MR1 post processed format\nAttributes:           SOEST MR1, bathymetry and sidescan,\n                      variable beams and pixels, xdr binary, \n                      SOEST, University of Hawaii.\n", MB_DESCRIPTION_LENGTH);
-	*numfile = 1;
-	*filetype = MB_FILETYPE_XDR;
-	*variable_beams = MB_YES;
-	*traveltime = MB_YES;
-	*beam_flagging = MB_YES;
-	*nav_source = MB_DATA_DATA;
-	*heading_source = MB_DATA_DATA;
-	*vru_source = MB_DATA_DATA;
-	*svp_source = MB_DATA_NONE;
-	*beamwidth_xtrack = 0.0;
-	*beamwidth_ltrack = 2.0;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",*system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",*beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",*beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",*pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",*numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",*filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",*variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",*traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",*beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",*nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",*heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",*vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",*svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",*beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",*beamwidth_ltrack);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_alm_mr1prvr2(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_alm_mr1prvr2";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set initial status */
-	status = MB_SUCCESS;
-
-	/* allocate memory for data structure */
-	mb_io_ptr->structure_size = 0;
-	mb_io_ptr->data_structure_size = 0;
-	status = mbsys_mr1v2001_alloc(verbose, mbio_ptr,
-			(void **)&mb_io_ptr->store_data,
-			error);
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* initialize everything to zeros */
-	mb_io_ptr->fileheader = MB_NO;
-	mb_io_ptr->hdr_comment_size = 0;
-	mb_io_ptr->hdr_comment = NULL;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_dem_mr1prvr2(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_dem_mr1prvr2";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_mr1v2001_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointers to mbio descriptor and data structures */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-	store = (struct mbsys_mr1v2001_struct *) mb_io_ptr->store_data;
-
-	/* deallocate memory for data descriptor */
-	if (store->bsbuffersize > 0
-		&& store->bsbuffer != NULL)
-		free(store->bsbuffer);
-	status = mb_freed(verbose,__FILE__, __LINE__, (void **)&mb_io_ptr->store_data,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_rt_mr1prvr2(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_rt_mr1prvr2";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_mr1v2001_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointers to mbio descriptor and data structures */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-	store = (struct mbsys_mr1v2001_struct *) store_ptr;
-
-	/* read next data from file */
-	status = mbr_mr1prvr2_rd_data(verbose,mbio_ptr,error);
-
-	/* set error and kind in mb_io_ptr */
-	mb_io_ptr->new_error = *error;
-	mb_io_ptr->new_kind = store->kind;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_wt_mr1prvr2(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_wt_mr1prvr2";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_mr1v2001_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_mr1v2001_struct *) store_ptr;
-
-	/* write next data to file */
-	status = mbr_mr1prvr2_wr_data(verbose,mbio_ptr,store_ptr,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_mr1prvr2_rd_data(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_mr1prvr2_rd_data";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_mr1v2001_struct *store;
-	char	*store_ptr;
-	char	*xdrs;
-	int	read_size;
-	int	bs_status = BS_SUCCESS;
-	char	*eol;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to data */
-	store = (struct mbsys_mr1v2001_struct *) mb_io_ptr->store_data;
-	store_ptr = (char *) store;
-	xdrs = mb_io_ptr->xdrs;
-
-	/* if first time through read file header */
-	if (mb_io_ptr->fileheader == MB_NO)
-		{
-		/* read the header into memory */
-		bs_status = mbbs_rdbsfhdr(&(store->header), (XDR *)xdrs);
-		if (bs_status == BS_SUCCESS)
-			{
-			mb_io_ptr->fileheader = MB_YES;
-			status = MB_SUCCESS;
-			}
-		else
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_EOF;
-			}
-
-		/* extract the comments string */
-		mb_io_ptr->hdr_comment_size = 0;
-		if (mb_io_ptr->hdr_comment != NULL)
-			mb_freed(verbose,__FILE__, __LINE__, (void **)&mb_io_ptr->hdr_comment,error);
-		if (status == MB_SUCCESS
-			&& store->header.bsf_count > 0)
-			{
-			status = mb_mallocd(verbose,__FILE__,__LINE__,strlen(store->header.bsf_log)+1,
-					(void **)&mb_io_ptr->hdr_comment,error);
-			}
-		if (status == MB_SUCCESS)
-			{
-			strcpy(mb_io_ptr->hdr_comment,store->header.bsf_log);
-			if (mb_io_ptr->hdr_comment == NULL)
-				mb_io_ptr->hdr_comment_size = 0;
-			else
-				mb_io_ptr->hdr_comment_size
-					= strlen(mb_io_ptr->hdr_comment);
-			mb_io_ptr->hdr_comment_loc = 0;
-			}
-
-		/* print debug statements */
-		if (verbose >= 5)
-			{
-			fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-			fprintf(stderr,"dbg5       mf_version:       %d\n",store->header.bsf_version);
-			fprintf(stderr,"dbg5       mf_count:         %d\n",store->header.bsf_count);
-			fprintf(stderr,"dbg5       mf_log:         \n%s\n",store->header.bsf_log);
-			}
-		}
-
-	/* if comments are still held in mb_io_ptr->hdr_comment then
-		extract comment and return */
-	if (mb_io_ptr->hdr_comment_size > mb_io_ptr->hdr_comment_loc)
-		{
-		eol = strchr(&mb_io_ptr->hdr_comment[mb_io_ptr->hdr_comment_loc], '\n');
-		if (eol == NULL)
-			read_size = strlen(&mb_io_ptr->hdr_comment[mb_io_ptr->hdr_comment_loc]);
-		else
-			read_size = strlen(&mb_io_ptr->hdr_comment[mb_io_ptr->hdr_comment_loc]) - strlen(eol);
-		if (read_size > MBSYS_MR1V2001_MAXLINE - 1)
-			{
-			read_size = MBSYS_MR1V2001_MAXLINE - 1;
-			eol = NULL;
-			}
-		strncpy(store->comment,
-			&mb_io_ptr->hdr_comment[mb_io_ptr->hdr_comment_loc],
-			read_size);
-		store->comment[read_size] = '\0';
-		mb_io_ptr->hdr_comment_loc += read_size;
-		if (eol != NULL)
-			mb_io_ptr->hdr_comment_loc++;
-		store->kind = MB_DATA_COMMENT;
-		}
-
-	/* else read data */
-	else
-		{
-		if ((bs_status = mbbs_rdpnghdr(&(store->ping), (XDR *)xdrs,
-						store->header.bsf_version))
-						!= BS_SUCCESS)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_EOF;
-			}
-		if (status == MB_SUCCESS
-			&& (bs_status = mbbs_pngrealloc(&(store->ping),
-						&(store->bsbuffer), &(store->bsbuffersize)))
-						!= BS_SUCCESS)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_MEMORY_FAIL;
-			}
-		if (status == MB_SUCCESS
-			&& (bs_status = mbbs_rdpngdata(&(store->ping),
-						(float *)store->bsbuffer, (XDR *)xdrs))
-						!= BS_SUCCESS)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_EOF;
-			}
-		if (status == MB_SUCCESS
-			&& (bs_status = mbbs_getpngdataptrs(&(store->ping),
-						(float *)store->bsbuffer,
-						&(store->pingdata))) != BS_SUCCESS)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_EOF;
-			}
-		if (status == MB_SUCCESS)
-			{
-			store->kind = MB_DATA_DATA;
-			}
-			
-		/* Fix case of old file with no beam flags excepting negative depths */
-		if (store->ping.png_flags & PNG_BTYSSFLAGSABSENT)
-			{
-			if (store->ping.png_flags & PNG_XYZ)
-				{
-				for (i=0;i<store->ping.png_sides[ACP_PORT].ps_btycount;i++)
-					{
-					if (store->pingdata.pd_bty[ACP_PORT][3*i+2] < 0.0)
-						{
-						store->pingdata.pd_bty[ACP_PORT][3*i+2] *= -1.0;
-						store->pingdata.pd_btyflags[ACP_PORT][i] = BTYD_EXTERNAL;
-						}
-					}
-				for (i=0;i<store->ping.png_sides[ACP_STBD].ps_btycount;i++)
-					{
-					if (store->pingdata.pd_bty[ACP_STBD][3*i+2] < 0.0)
-						{
-						store->pingdata.pd_bty[ACP_STBD][3*i+2] *= -1.0;
-						store->pingdata.pd_btyflags[ACP_STBD][i] = BTYD_EXTERNAL;
-						}
-					}
-				}
-			else
-				{
-				for (i=0;i<store->ping.png_sides[ACP_PORT].ps_btycount;i++)
-					{
-					if (store->pingdata.pd_bty[ACP_PORT][2*i+1] < 0.0)
-						{
-						store->pingdata.pd_bty[ACP_PORT][2*i+1] *= -1.0;
-						store->pingdata.pd_btyflags[ACP_PORT][i] = BTYD_EXTERNAL;
-						}
-					}
-				for (i=0;i<store->ping.png_sides[ACP_STBD].ps_btycount;i++)
-					{
-					if (store->pingdata.pd_bty[ACP_STBD][2*i+1] < 0.0)
-						{
-						store->pingdata.pd_bty[ACP_STBD][2*i+1] *= -1.0;
-						store->pingdata.pd_btyflags[ACP_STBD][i] = BTYD_EXTERNAL;
-						}
-					}
-				}
-			store->ping.png_flags = store->ping.png_flags ^ PNG_BTYSSFLAGSABSENT;
-			}
-
-		/* print debug statements */
-		if (verbose >= 5)
-			{
-			fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-			fprintf(stderr,"dbg5       png_flags:        %u\n",store->ping.png_flags);
-			fprintf(stderr,"dbg5       sec:              %ld\n",store->ping.png_tm.tv_sec);
-			fprintf(stderr,"dbg5       usec:             %ld\n",store->ping.png_tm.tv_usec);
-			fprintf(stderr,"dbg5       period:           %f\n",store->ping.png_period);
-			fprintf(stderr,"dbg5       ship longitude:   %f\n",store->ping.png_slon);
-			fprintf(stderr,"dbg5       ship latitude:    %f\n",store->ping.png_slat);
-			fprintf(stderr,"dbg5       ship course:      %f\n",store->ping.png_scourse);
-			fprintf(stderr,"dbg5       layback range:    %f\n",store->ping.png_laybackrng);
-			fprintf(stderr,"dbg5       layback bearing:  %f\n",store->ping.png_laybackbrg);
-			fprintf(stderr,"dbg5       towfish longitude:%f\n",store->ping.png_tlon);
-			fprintf(stderr,"dbg5       towfish latitude: %f\n",store->ping.png_tlat);
-			fprintf(stderr,"dbg5       towfish course:   %f\n",store->ping.png_tcourse);
-			fprintf(stderr,"dbg5       compass ptr:      %p\n",(void *)store->pingdata.pd_compass);
-			fprintf(stderr,"dbg5       towfish compass interval:  %f\n",store->ping.png_compass.sns_int);
-			fprintf(stderr,"dbg5       towfish compass samples:   %d\n",store->ping.png_compass.sns_nsamps);
-			fprintf(stderr,"dbg5       towfish compass value:     %f\n",store->ping.png_compass.sns_repval);
-			fprintf(stderr,"dbg5       towfish compass  heading:\n");
-			for (i=0;i<store->ping.png_compass.sns_nsamps;i++)
-				{
-				fprintf(stderr,"dbg5         %3d     %12.4g\n",i,store->pingdata.pd_compass[i]);
-				}
-			fprintf(stderr,"dbg5       depth ptr:                 %p\n",(void *)store->pingdata.pd_depth);
-			fprintf(stderr,"dbg5       towfish depth interval:    %f\n",store->ping.png_depth.sns_int);
-			fprintf(stderr,"dbg5       towfish depth samples:     %d\n",store->ping.png_depth.sns_nsamps);
-			fprintf(stderr,"dbg5       towfish depth value:       %f\n",store->ping.png_depth.sns_repval);
-			fprintf(stderr,"dbg5       towfish depth:\n");
-			for (i=0;i<store->ping.png_depth.sns_nsamps;i++)
-				{
-				fprintf(stderr,"dbg5         %3d     %12.4g\n",i,store->pingdata.pd_depth[i]);
-				}
-			fprintf(stderr,"dbg5       pitch ptr:                 %p\n",(void *)store->pingdata.pd_pitch);
-			fprintf(stderr,"dbg5       towfish pitch interval:    %f\n",store->ping.png_pitch.sns_int);
-			fprintf(stderr,"dbg5       towfish pitch samples:     %d\n",store->ping.png_pitch.sns_nsamps);
-			fprintf(stderr,"dbg5       towfish pitch value:       %f\n",store->ping.png_pitch.sns_repval);
-			fprintf(stderr,"dbg5       towfish pitch:\n");
-			for (i=0;i<store->ping.png_pitch.sns_nsamps;i++)
-				{
-				fprintf(stderr,"dbg5         %3d     %12.4g\n",i,store->pingdata.pd_pitch[i]);
-				}
-			fprintf(stderr,"dbg5       roll ptr:                  %p\n",(void *)store->pingdata.pd_roll);
-			fprintf(stderr,"dbg5       towfish roll interval:     %f\n",store->ping.png_roll.sns_int);
-			fprintf(stderr,"dbg5       towfish roll samples:      %d\n",store->ping.png_roll.sns_nsamps);
-			fprintf(stderr,"dbg5       towfish roll value:        %f\n",store->ping.png_roll.sns_repval);
-			fprintf(stderr,"dbg5       towfish roll:\n");
-			for (i=0;i<store->ping.png_roll.sns_nsamps;i++)
-				{
-				fprintf(stderr,"dbg5         %3d     %12.4g\n",i,store->pingdata.pd_roll[i]);
-				}
-			fprintf(stderr,"dbg5       png_snspad:       %d\n",store->ping.png_snspad);
-			fprintf(stderr,"dbg5       png_temp:         %f\n",store->ping.png_temp);
-			fprintf(stderr,"dbg5       png_ssincr:       %f\n",store->ping.png_ssincr);
-			fprintf(stderr,"dbg5       png_ssyoffsetmode:%d\n",store->ping.png_ssyoffsetmode);
-			fprintf(stderr,"dbg5       png_alt:          %f\n",store->ping.png_alt);
-			fprintf(stderr,"dbg5       png_magcorr:      %f\n",store->ping.png_magcorr);
-			fprintf(stderr,"dbg5       png_sndvel:       %f\n",store->ping.png_sndvel);
-			fprintf(stderr,"dbg5       png_cond:         %f\n",store->ping.png_cond);
-			fprintf(stderr,"dbg5       png_magx:         %f\n",store->ping.png_magx);
-			fprintf(stderr,"dbg5       png_magy:         %f\n",store->ping.png_magy);
-			fprintf(stderr,"dbg5       png_magz:         %f\n",store->ping.png_magz);
-			fprintf(stderr,"dbg5       port ps_xmitpwr:  %f\n",store->ping.png_sides[ACP_PORT].ps_xmitpwr);
-			fprintf(stderr,"dbg5       port ps_gain:     %f\n",store->ping.png_sides[ACP_PORT].ps_gain);
-			fprintf(stderr,"dbg5       port ps_pulse:    %f\n",store->ping.png_sides[ACP_PORT].ps_pulse);
-			fprintf(stderr,"dbg5       port ps_bdrange:  %f\n",store->ping.png_sides[ACP_PORT].ps_bdrange);
-			fprintf(stderr,"dbg5       port ps_btycount: %d\n",store->ping.png_sides[ACP_PORT].ps_btycount);
-			fprintf(stderr,"dbg5       port ps_btypad:   %d\n",store->ping.png_sides[ACP_PORT].ps_btypad);
-			fprintf(stderr,"dbg5       port bty ptr:     %p\n",(void *)store->pingdata.pd_bty[ACP_PORT]);
-			fprintf(stderr,"dbg5       port btyflags ptr:%p\n",(void *)store->pingdata.pd_btyflags[ACP_PORT]);
-			fprintf(stderr,"dbg5       port abi ptr:     %p\n",(void *)store->pingdata.pd_abi[ACP_PORT]);
-			if (store->ping.png_flags & PNG_XYZ)
-				{
-				fprintf(stderr,"dbg5       port flag acrosstrack alongtrack bathymetry:\n");
-				for (i=0;i<store->ping.png_sides[ACP_PORT].ps_btycount;i++)
-					{
-					fprintf(stderr,"dbg5         %3d     %d %12.4g %12.4g %12.4g\n",
-							i,store->pingdata.pd_btyflags[ACP_PORT][i],
-							store->pingdata.pd_bty[ACP_PORT][3*i],
-							store->pingdata.pd_bty[ACP_PORT][3*i+1],
-							store->pingdata.pd_bty[ACP_PORT][3*i+2]);
-					}
-				}
-			else
-				{
-				fprintf(stderr,"dbg5       port flag acrosstrack bathymetry:\n");
-				for (i=0;i<store->ping.png_sides[ACP_PORT].ps_btycount;i++)
-					{
-					fprintf(stderr,"dbg5         %3d     %d %12.4g %12.4g\n",
-							i,store->pingdata.pd_btyflags[ACP_PORT][i],
-							store->pingdata.pd_bty[ACP_PORT][2*i],
-							store->pingdata.pd_bty[ACP_PORT][2*i+1]);
-					}
-				}
-			fprintf(stderr,"dbg5       port ps_ssxoffset:%f\n",store->ping.png_sides[ACP_PORT].ps_ssxoffset);
-			fprintf(stderr,"dbg5       port ps_sscount:  %d\n",store->ping.png_sides[ACP_PORT].ps_sscount);
-			fprintf(stderr,"dbg5       port ps_sspad:    %d\n",store->ping.png_sides[ACP_PORT].ps_sspad);
-			fprintf(stderr,"dbg5       port ps_ssndrmask:%f\n",store->ping.png_sides[ACP_PORT].ps_ssndrmask);
-			fprintf(stderr,"dbg5       port ps_ssyoffset:%f\n",store->ping.png_sides[ACP_PORT].ps_ssyoffset);
-			fprintf(stderr,"dbg5       port ss ptr:      %p\n",(void *)store->pingdata.pd_ss[ACP_PORT]);
-			fprintf(stderr,"dbg5       port ssflags ptr: %p\n",(void *)store->pingdata.pd_ssflags[ACP_PORT]);
-			fprintf(stderr,"dbg5       port flag sidescan:\n");
-			for (i=0;i<store->ping.png_sides[ACP_PORT].ps_sscount;i++)
-				{
-				fprintf(stderr,"dbg5         %3d     %d %12.4g\n",
-						i,store->pingdata.pd_ssflags[ACP_PORT][i],
-						store->pingdata.pd_ss[ACP_PORT][i]);
-				}
-	
-			fprintf(stderr,"dbg5       stbd ps_xmitpwr:  %f\n",store->ping.png_sides[ACP_STBD].ps_xmitpwr);
-			fprintf(stderr,"dbg5       stbd ps_gain:     %f\n",store->ping.png_sides[ACP_STBD].ps_gain);
-			fprintf(stderr,"dbg5       stbd ps_pulse:    %f\n",store->ping.png_sides[ACP_STBD].ps_pulse);
-			fprintf(stderr,"dbg5       stbd ps_bdrange:  %f\n",store->ping.png_sides[ACP_STBD].ps_bdrange);
-			fprintf(stderr,"dbg5       stbd ps_btycount: %d\n",store->ping.png_sides[ACP_STBD].ps_btycount);
-			fprintf(stderr,"dbg5       stbd ps_btypad:   %d\n",store->ping.png_sides[ACP_STBD].ps_btypad);
-			fprintf(stderr,"dbg5       stbd bty ptr:     %p\n",(void *)store->pingdata.pd_bty[ACP_STBD]);
-			fprintf(stderr,"dbg5       stbd btyflags ptr:%p\n",(void *)store->pingdata.pd_btyflags[ACP_STBD]);
-			fprintf(stderr,"dbg5       stbd abi ptr:     %p\n",(void *)store->pingdata.pd_abi[ACP_STBD]);
-			if (store->ping.png_flags & PNG_XYZ)
-				{
-				fprintf(stderr,"dbg5       stbd flag acrosstrack alongtrack bathymetry:\n");
-				for (i=0;i<store->ping.png_sides[ACP_STBD].ps_btycount;i++)
-					{
-					fprintf(stderr,"dbg5         %3d     %d %12.4g %12.4g %12.4g\n",
-							i,store->pingdata.pd_btyflags[ACP_STBD][i],
-							store->pingdata.pd_bty[ACP_STBD][3*i],
-							store->pingdata.pd_bty[ACP_STBD][3*i+1],
-							store->pingdata.pd_bty[ACP_STBD][3*i+2]);
-					}
-				}
-			else
-				{
-				fprintf(stderr,"dbg5       stbd flag acrosstrack bathymetry:\n");
-				for (i=0;i<store->ping.png_sides[ACP_STBD].ps_btycount;i++)
-					{
-					fprintf(stderr,"dbg5         %3d     %d %12.4g %12.4g\n",
-							i,store->pingdata.pd_btyflags[ACP_STBD][i],
-							store->pingdata.pd_bty[ACP_STBD][2*i],
-							store->pingdata.pd_bty[ACP_STBD][2*i+1]);
-					}
-				}
-			fprintf(stderr,"dbg5       stbd ps_ssxoffset:%f\n",store->ping.png_sides[ACP_STBD].ps_ssxoffset);
-			fprintf(stderr,"dbg5       stbd ps_sscount:  %d\n",store->ping.png_sides[ACP_STBD].ps_sscount);
-			fprintf(stderr,"dbg5       stbd ps_sspad:    %d\n",store->ping.png_sides[ACP_STBD].ps_sspad);
-			fprintf(stderr,"dbg5       stbd ps_ssndrmask:%f\n",store->ping.png_sides[ACP_STBD].ps_ssndrmask);
-			fprintf(stderr,"dbg5       stbd ps_ssyoffset:%f\n",store->ping.png_sides[ACP_STBD].ps_ssyoffset);
-			fprintf(stderr,"dbg5       stbd ss ptr:      %p\n",(void *)store->pingdata.pd_ss[ACP_STBD]);
-			fprintf(stderr,"dbg5       stbd ssflags ptr: %p\n",(void *)store->pingdata.pd_ssflags[ACP_STBD]);
-			fprintf(stderr,"dbg5       stbd flag sidescan:\n");
-			for (i=0;i<store->ping.png_sides[ACP_STBD].ps_sscount;i++)
-				{
-				fprintf(stderr,"dbg5         %3d     %d %12.4g\n",
-						i,store->pingdata.pd_ssflags[ACP_STBD][i],
-						store->pingdata.pd_ss[ACP_STBD][i]);
-				}
-			fprintf(stderr,"\n");
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbr_mr1prvr2_wr_data(int verbose, void *mbio_ptr, char *store_ptr, int *error)
-{
-	char	*function_name = "mbr_mr1prvr2_wr_data";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_mr1v2001_struct *store;
-	char	*xdrs;
-	int	bs_status = BS_SUCCESS;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to data */
-	store = (struct mbsys_mr1v2001_struct *) store_ptr;
-	xdrs = mb_io_ptr->xdrs;
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       png_flags:        %u\n",store->ping.png_flags);
-		fprintf(stderr,"dbg5       sec:              %ld\n",store->ping.png_tm.tv_sec);
-		fprintf(stderr,"dbg5       usec:             %ld\n",store->ping.png_tm.tv_usec);
-		fprintf(stderr,"dbg5       period:           %f\n",store->ping.png_period);
-		fprintf(stderr,"dbg5       ship longitude:   %f\n",store->ping.png_slon);
-		fprintf(stderr,"dbg5       ship latitude:    %f\n",store->ping.png_slat);
-		fprintf(stderr,"dbg5       ship course:      %f\n",store->ping.png_scourse);
-		fprintf(stderr,"dbg5       layback range:    %f\n",store->ping.png_laybackrng);
-		fprintf(stderr,"dbg5       layback bearing:  %f\n",store->ping.png_laybackbrg);
-		fprintf(stderr,"dbg5       towfish longitude:%f\n",store->ping.png_tlon);
-		fprintf(stderr,"dbg5       towfish latitude: %f\n",store->ping.png_tlat);
-		fprintf(stderr,"dbg5       towfish course:   %f\n",store->ping.png_tcourse);
-		fprintf(stderr,"dbg5       compass ptr:      %p\n",(void *)store->pingdata.pd_compass);
-		fprintf(stderr,"dbg5       towfish compass interval:  %f\n",store->ping.png_compass.sns_int);
-		fprintf(stderr,"dbg5       towfish compass samples:   %d\n",store->ping.png_compass.sns_nsamps);
-		fprintf(stderr,"dbg5       towfish compass value:     %f\n",store->ping.png_compass.sns_repval);
-		fprintf(stderr,"dbg5       towfish compass  heading:\n");
-		for (i=0;i<store->ping.png_compass.sns_nsamps;i++)
-			{
-			fprintf(stderr,"dbg5         %3d     %12.4g\n",i,store->pingdata.pd_compass[i]);
-			}
-		fprintf(stderr,"dbg5       depth ptr:                 %p\n",(void *)store->pingdata.pd_depth);
-		fprintf(stderr,"dbg5       towfish depth interval:    %f\n",store->ping.png_depth.sns_int);
-		fprintf(stderr,"dbg5       towfish depth samples:     %d\n",store->ping.png_depth.sns_nsamps);
-		fprintf(stderr,"dbg5       towfish depth value:       %f\n",store->ping.png_depth.sns_repval);
-		fprintf(stderr,"dbg5       towfish depth:\n");
-		for (i=0;i<store->ping.png_depth.sns_nsamps;i++)
-			{
-			fprintf(stderr,"dbg5         %3d     %12.4g\n",i,store->pingdata.pd_depth[i]);
-			}
-		fprintf(stderr,"dbg5       pitch ptr:                 %p\n",(void *)store->pingdata.pd_pitch);
-		fprintf(stderr,"dbg5       towfish pitch interval:    %f\n",store->ping.png_pitch.sns_int);
-		fprintf(stderr,"dbg5       towfish pitch samples:     %d\n",store->ping.png_pitch.sns_nsamps);
-		fprintf(stderr,"dbg5       towfish pitch value:       %f\n",store->ping.png_pitch.sns_repval);
-		fprintf(stderr,"dbg5       towfish pitch:\n");
-		for (i=0;i<store->ping.png_pitch.sns_nsamps;i++)
-			{
-			fprintf(stderr,"dbg5         %3d     %12.4g\n",i,store->pingdata.pd_pitch[i]);
-			}
-		fprintf(stderr,"dbg5       roll ptr:                  %p\n",(void *)store->pingdata.pd_roll);
-		fprintf(stderr,"dbg5       towfish roll interval:     %f\n",store->ping.png_roll.sns_int);
-		fprintf(stderr,"dbg5       towfish roll samples:      %d\n",store->ping.png_roll.sns_nsamps);
-		fprintf(stderr,"dbg5       towfish roll value:        %f\n",store->ping.png_roll.sns_repval);
-		fprintf(stderr,"dbg5       towfish roll:\n");
-		for (i=0;i<store->ping.png_roll.sns_nsamps;i++)
-			{
-			fprintf(stderr,"dbg5         %3d     %12.4g\n",i,store->pingdata.pd_roll[i]);
-			}
-		fprintf(stderr,"dbg5       png_snspad:       %d\n",store->ping.png_snspad);
-		fprintf(stderr,"dbg5       png_temp:         %f\n",store->ping.png_temp);
-		fprintf(stderr,"dbg5       png_ssincr:       %f\n",store->ping.png_ssincr);
-		fprintf(stderr,"dbg5       png_ssyoffsetmode:%d\n",store->ping.png_ssyoffsetmode);
-		fprintf(stderr,"dbg5       png_alt:          %f\n",store->ping.png_alt);
-		fprintf(stderr,"dbg5       png_magcorr:      %f\n",store->ping.png_magcorr);
-		fprintf(stderr,"dbg5       png_sndvel:       %f\n",store->ping.png_sndvel);
-		fprintf(stderr,"dbg5       png_cond:         %f\n",store->ping.png_cond);
-		fprintf(stderr,"dbg5       png_magx:         %f\n",store->ping.png_magx);
-		fprintf(stderr,"dbg5       png_magy:         %f\n",store->ping.png_magy);
-		fprintf(stderr,"dbg5       png_magz:         %f\n",store->ping.png_magz);
-		fprintf(stderr,"dbg5       port ps_xmitpwr:  %f\n",store->ping.png_sides[ACP_PORT].ps_xmitpwr);
-		fprintf(stderr,"dbg5       port ps_gain:     %f\n",store->ping.png_sides[ACP_PORT].ps_gain);
-		fprintf(stderr,"dbg5       port ps_pulse:    %f\n",store->ping.png_sides[ACP_PORT].ps_pulse);
-		fprintf(stderr,"dbg5       port ps_bdrange:  %f\n",store->ping.png_sides[ACP_PORT].ps_bdrange);
-		fprintf(stderr,"dbg5       port ps_btycount: %d\n",store->ping.png_sides[ACP_PORT].ps_btycount);
-		fprintf(stderr,"dbg5       port ps_btypad:   %d\n",store->ping.png_sides[ACP_PORT].ps_btypad);
-		fprintf(stderr,"dbg5       port bty ptr:     %p\n",(void *)store->pingdata.pd_bty[ACP_PORT]);
-		fprintf(stderr,"dbg5       port btyflags ptr:%p\n",(void *)store->pingdata.pd_btyflags[ACP_PORT]);
-		fprintf(stderr,"dbg5       port abi ptr:     %p\n",(void *)store->pingdata.pd_abi[ACP_PORT]);
-		if (store->ping.png_flags & PNG_XYZ)
-			{
-			fprintf(stderr,"dbg5       port flag acrosstrack alongtrack bathymetry:\n");
-			for (i=0;i<store->ping.png_sides[ACP_PORT].ps_btycount;i++)
-				{
-				fprintf(stderr,"dbg5         %3d     %d %12.4g %12.4g %12.4g\n",
-						i,store->pingdata.pd_btyflags[ACP_PORT][i],
-						store->pingdata.pd_bty[ACP_PORT][3*i],
-						store->pingdata.pd_bty[ACP_PORT][3*i+1],
-						store->pingdata.pd_bty[ACP_PORT][3*i+2]);
-				}
-			}
-		else
-			{
-			fprintf(stderr,"dbg5       port flag acrosstrack bathymetry:\n");
-			for (i=0;i<store->ping.png_sides[ACP_PORT].ps_btycount;i++)
-				{
-				fprintf(stderr,"dbg5         %3d     %d %12.4g %12.4g\n",
-						i,store->pingdata.pd_btyflags[ACP_PORT][i],
-						store->pingdata.pd_bty[ACP_PORT][2*i],
-						store->pingdata.pd_bty[ACP_PORT][2*i+1]);
-				}
-			}
-		fprintf(stderr,"dbg5       port ps_ssxoffset:%f\n",store->ping.png_sides[ACP_PORT].ps_ssxoffset);
-		fprintf(stderr,"dbg5       port ps_sscount:  %d\n",store->ping.png_sides[ACP_PORT].ps_sscount);
-		fprintf(stderr,"dbg5       port ps_sspad:    %d\n",store->ping.png_sides[ACP_PORT].ps_sspad);
-		fprintf(stderr,"dbg5       port ps_ssndrmask:%f\n",store->ping.png_sides[ACP_PORT].ps_ssndrmask);
-		fprintf(stderr,"dbg5       port ps_ssyoffset:%f\n",store->ping.png_sides[ACP_PORT].ps_ssyoffset);
-		fprintf(stderr,"dbg5       port ss ptr:      %p\n",(void *)store->pingdata.pd_ss[ACP_PORT]);
-		fprintf(stderr,"dbg5       port ssflags ptr: %p\n",(void *)store->pingdata.pd_ssflags[ACP_PORT]);
-		fprintf(stderr,"dbg5       port flag sidescan:\n");
-		for (i=0;i<store->ping.png_sides[ACP_PORT].ps_sscount;i++)
-			{
-			fprintf(stderr,"dbg5         %3d     %d %12.4g\n",
-					i,store->pingdata.pd_ssflags[ACP_PORT][i],
-					store->pingdata.pd_ss[ACP_PORT][i]);
-			}
-
-		fprintf(stderr,"dbg5       stbd ps_xmitpwr:  %f\n",store->ping.png_sides[ACP_STBD].ps_xmitpwr);
-		fprintf(stderr,"dbg5       stbd ps_gain:     %f\n",store->ping.png_sides[ACP_STBD].ps_gain);
-		fprintf(stderr,"dbg5       stbd ps_pulse:    %f\n",store->ping.png_sides[ACP_STBD].ps_pulse);
-		fprintf(stderr,"dbg5       stbd ps_bdrange:  %f\n",store->ping.png_sides[ACP_STBD].ps_bdrange);
-		fprintf(stderr,"dbg5       stbd ps_btycount: %d\n",store->ping.png_sides[ACP_STBD].ps_btycount);
-		fprintf(stderr,"dbg5       stbd ps_btypad:   %d\n",store->ping.png_sides[ACP_STBD].ps_btypad);
-		fprintf(stderr,"dbg5       stbd bty ptr:     %p\n",(void *)store->pingdata.pd_bty[ACP_STBD]);
-		fprintf(stderr,"dbg5       stbd btyflags ptr:%p\n",(void *)store->pingdata.pd_btyflags[ACP_STBD]);
-		fprintf(stderr,"dbg5       stbd abi ptr:     %p\n",(void *)store->pingdata.pd_abi[ACP_STBD]);
-		if (store->ping.png_flags & PNG_XYZ)
-			{
-			fprintf(stderr,"dbg5       stbd flag acrosstrack alongtrack bathymetry:\n");
-			for (i=0;i<store->ping.png_sides[ACP_STBD].ps_btycount;i++)
-				{
-				fprintf(stderr,"dbg5         %3d     %d %12.4g %12.4g %12.4g\n",
-						i,store->pingdata.pd_btyflags[ACP_STBD][i],
-						store->pingdata.pd_bty[ACP_STBD][3*i],
-						store->pingdata.pd_bty[ACP_STBD][3*i+1],
-						store->pingdata.pd_bty[ACP_STBD][3*i+2]);
-				}
-			}
-		else
-			{
-			fprintf(stderr,"dbg5       stbd flag acrosstrack bathymetry:\n");
-			for (i=0;i<store->ping.png_sides[ACP_STBD].ps_btycount;i++)
-				{
-				fprintf(stderr,"dbg5         %3d     %d %12.4g %12.4g\n",
-						i,store->pingdata.pd_btyflags[ACP_STBD][i],
-						store->pingdata.pd_bty[ACP_STBD][2*i],
-						store->pingdata.pd_bty[ACP_STBD][2*i+1]);
-				}
-			}
-		fprintf(stderr,"dbg5       stbd ps_ssxoffset:%f\n",store->ping.png_sides[ACP_STBD].ps_ssxoffset);
-		fprintf(stderr,"dbg5       stbd ps_sscount:  %d\n",store->ping.png_sides[ACP_STBD].ps_sscount);
-		fprintf(stderr,"dbg5       stbd ps_sspad:    %d\n",store->ping.png_sides[ACP_STBD].ps_sspad);
-		fprintf(stderr,"dbg5       stbd ps_ssndrmask:%f\n",store->ping.png_sides[ACP_STBD].ps_ssndrmask);
-		fprintf(stderr,"dbg5       stbd ps_ssyoffset:%f\n",store->ping.png_sides[ACP_STBD].ps_ssyoffset);
-		fprintf(stderr,"dbg5       stbd ss ptr:      %p\n",(void *)store->pingdata.pd_ss[ACP_STBD]);
-		fprintf(stderr,"dbg5       stbd ssflags ptr: %p\n",(void *)store->pingdata.pd_ssflags[ACP_STBD]);
-		fprintf(stderr,"dbg5       stbd flag sidescan:\n");
-		for (i=0;i<store->ping.png_sides[ACP_STBD].ps_sscount;i++)
-			{
-			fprintf(stderr,"dbg5         %3d     %d %12.4g\n",
-					i,store->pingdata.pd_ssflags[ACP_STBD][i],
-					store->pingdata.pd_ss[ACP_STBD][i]);
-			}
-		fprintf(stderr,"\n");
-		}
-
-	/* if comment and file header not written */
-	if (mb_io_ptr->fileheader == MB_NO && store->kind == MB_DATA_COMMENT)
-		{
-		/* add comment to string mb_io_ptr->hdr_comment
-			to be be written in file header */
-		mb_io_ptr->hdr_comment_size += strlen(store->comment) + 2;
-		status = mb_reallocd(verbose, __FILE__, __LINE__, mb_io_ptr->hdr_comment_size,
-					(void **)&(mb_io_ptr->hdr_comment),
-					error);
-		strcat(mb_io_ptr->hdr_comment,store->comment);
-		strcat(mb_io_ptr->hdr_comment,"\n");
-		}
-
-	/* if data and file header not written */
-	else if (mb_io_ptr->fileheader == MB_NO
-		&& store->kind != MB_DATA_COMMENT)
-		{
-		/* insert new comments into file header */
-		mbbs_replacestr(&(store->header.bsf_log), mb_io_ptr->hdr_comment);
-
-		/* write file header */
-		if ((bs_status = mbbs_wrbsfhdr(&(store->header),
-				(XDR *)xdrs))
-				!= BS_SUCCESS)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_WRITE_FAIL;
-			}
-		else
-			mb_io_ptr->fileheader = MB_YES;
-		}
-
-	/* if data and file header written */
-	if (mb_io_ptr->fileheader == MB_YES
-		&& store->kind == MB_DATA_DATA)
-		{
-		/* write data */
-		if ((bs_status = mbbs_wrpnghdr(&(store->ping),
-				(XDR *)xdrs))
-				!= BS_SUCCESS)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_WRITE_FAIL;
-			}
-		if ((bs_status = mbbs_wrpngdata(&(store->ping),
-					(float *)store->bsbuffer,
-					(XDR *)xdrs))
-					!= BS_SUCCESS)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_WRITE_FAIL;
-			}
-		}
-
-	/* if not data and file header written */
-	else if (store->kind != MB_DATA_COMMENT
-		&& store->kind != MB_DATA_DATA)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_BAD_KIND;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Data record kind in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       kind:       %d\n",store->kind);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mbr_mstiffss.c b/src/mbio/mbr_mstiffss.c
deleted file mode 100644
index 0dc8657..0000000
--- a/src/mbio/mbr_mstiffss.c
+++ /dev/null
@@ -1,1469 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbr_mstiffss.c	4/7/98
- *	$Id: mbr_mstiffss.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1998-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbr_mstiffss.c contains the functions for reading
- * sidescan data in the MSTIFFSS format.
- * These functions include:
- *   mbr_alm_mstiffss	- allocate read/write memory
- *   mbr_dem_mstiffss	- deallocate read/write memory
- *   mbr_rt_mstiffss	- read and translate data
- *   mbr_wt_mstiffss	- translate and write data
- *
- * Author:	D. W. Caress
- * Date:	April 7, 1998
- * $Log: mbr_mstiffss.c,v $
- * Revision 5.8  2005/11/05 00:48:05  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.7  2003/05/20 18:05:32  caress
- * Added svp_source to data source parameters.
- *
- * Revision 5.6  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.5  2003/01/15 20:51:48  caress
- * Release 5.0.beta28
- *
- * Revision 5.4  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.3  2001/07/20 00:32:54  caress
- * Release 5.0.beta03
- *
- * Revision 5.2  2001/03/22  20:50:02  caress
- * Trying to make version 5.0.beta0
- *
- * Revision 5.1  2001/01/22  07:43:34  caress
- * Version 5.0.beta01
- *
- * Revision 5.0  2000/12/01  22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.3  2000/10/11  01:03:21  caress
- * Convert to ANSI C
- *
- * Revision 4.2  2000/09/30  06:34:20  caress
- * Snapshot for Dale.
- *
- * Revision 4.1  1999/03/31  18:11:35  caress
- * MB-System 4.6beta7
- *
- * Revision 4.0  1998/10/05  19:16:02  caress
- * MB-System version 4.6beta
- *
- * Revision 1.1  1998/10/05  18:32:27  caress
- * Initial revision
- *
- * Revision 1.1  1998/10/05  18:22:40  caress
- * Initial revision
- *
- * Revision 1.1  1998/10/05  17:46:15  caress
- * Initial revision
- *
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mb_define.h"
-#include "mbsys_mstiff.h"
-#include "mbf_mstiffss.h"
-
-/* essential function prototypes */
-int mbr_register_mstiffss(int verbose, void *mbio_ptr,
-		int *error);
-int mbr_info_mstiffss(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_alm_mstiffss(int verbose, void *mbio_ptr, int *error);
-int mbr_dem_mstiffss(int verbose, void *mbio_ptr, int *error);
-int mbr_rt_mstiffss(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_wt_mstiffss(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-
-static char rcs_id[]="$Id: mbr_mstiffss.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mbr_register_mstiffss(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_register_mstiffss";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* get mb_io_ptr */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set format info parameters */
-	status = mbr_info_mstiffss(verbose,
-			&mb_io_ptr->system,
-			&mb_io_ptr->beams_bath_max,
-			&mb_io_ptr->beams_amp_max,
-			&mb_io_ptr->pixels_ss_max,
-			mb_io_ptr->format_name,
-			mb_io_ptr->system_name,
-			mb_io_ptr->format_description,
-			&mb_io_ptr->numfile,
-			&mb_io_ptr->filetype,
-			&mb_io_ptr->variable_beams,
-			&mb_io_ptr->traveltime,
-			&mb_io_ptr->beam_flagging,
-			&mb_io_ptr->nav_source,
-			&mb_io_ptr->heading_source,
-			&mb_io_ptr->vru_source,
-			&mb_io_ptr->svp_source,
-			&mb_io_ptr->beamwidth_xtrack,
-			&mb_io_ptr->beamwidth_ltrack,
-			error);
-
-	/* set format and system specific function pointers */
-	mb_io_ptr->mb_io_format_alloc = &mbr_alm_mstiffss;
-	mb_io_ptr->mb_io_format_free = &mbr_dem_mstiffss;
-	mb_io_ptr->mb_io_store_alloc = &mbsys_mstiff_alloc;
-	mb_io_ptr->mb_io_store_free = &mbsys_mstiff_deall;
-	mb_io_ptr->mb_io_read_ping = &mbr_rt_mstiffss;
-	mb_io_ptr->mb_io_write_ping = &mbr_wt_mstiffss;
-	mb_io_ptr->mb_io_dimensions = &mbsys_mstiff_dimensions;
-	mb_io_ptr->mb_io_extract = &mbsys_mstiff_extract;
-	mb_io_ptr->mb_io_insert = &mbsys_mstiff_insert;
-	mb_io_ptr->mb_io_extract_nav = &mbsys_mstiff_extract_nav;
-	mb_io_ptr->mb_io_insert_nav = &mbsys_mstiff_insert_nav;
-	mb_io_ptr->mb_io_extract_altitude = &mbsys_mstiff_extract_altitude;
-	mb_io_ptr->mb_io_insert_altitude = NULL;
-	mb_io_ptr->mb_io_extract_svp = NULL;
-	mb_io_ptr->mb_io_insert_svp = NULL;
-	mb_io_ptr->mb_io_ttimes = &mbsys_mstiff_ttimes;
-	mb_io_ptr->mb_io_detects = &mbsys_mstiff_detects;
-	mb_io_ptr->mb_io_copyrecord = &mbsys_mstiff_copy;
-	mb_io_ptr->mb_io_extract_rawss = NULL;
-	mb_io_ptr->mb_io_insert_rawss = NULL;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",mb_io_ptr->system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",mb_io_ptr->beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",mb_io_ptr->beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",mb_io_ptr->pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",mb_io_ptr->format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",mb_io_ptr->system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",mb_io_ptr->format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",mb_io_ptr->numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",mb_io_ptr->filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",mb_io_ptr->variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",mb_io_ptr->traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",mb_io_ptr->beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",mb_io_ptr->nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",mb_io_ptr->heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",mb_io_ptr->vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",mb_io_ptr->svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",mb_io_ptr->beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",mb_io_ptr->beamwidth_ltrack);
-		fprintf(stderr,"dbg2       format_alloc:       %p\n",(void *)mb_io_ptr->mb_io_format_alloc);
-		fprintf(stderr,"dbg2       format_free:        %p\n",(void *)mb_io_ptr->mb_io_format_free);
-		fprintf(stderr,"dbg2       store_alloc:        %p\n",(void *)mb_io_ptr->mb_io_store_alloc);
-		fprintf(stderr,"dbg2       store_free:         %p\n",(void *)mb_io_ptr->mb_io_store_free);
-		fprintf(stderr,"dbg2       read_ping:          %p\n",(void *)mb_io_ptr->mb_io_read_ping);
-		fprintf(stderr,"dbg2       write_ping:         %p\n",(void *)mb_io_ptr->mb_io_write_ping);
-		fprintf(stderr,"dbg2       extract:            %p\n",(void *)mb_io_ptr->mb_io_extract);
-		fprintf(stderr,"dbg2       insert:             %p\n",(void *)mb_io_ptr->mb_io_insert);
-		fprintf(stderr,"dbg2       extract_nav:        %p\n",(void *)mb_io_ptr->mb_io_extract_nav);
-		fprintf(stderr,"dbg2       insert_nav:         %p\n",(void *)mb_io_ptr->mb_io_insert_nav);
-		fprintf(stderr,"dbg2       extract_altitude:   %p\n",(void *)mb_io_ptr->mb_io_extract_altitude);
-		fprintf(stderr,"dbg2       insert_altitude:    %p\n",(void *)mb_io_ptr->mb_io_insert_altitude);
-		fprintf(stderr,"dbg2       extract_svp:        %p\n",(void *)mb_io_ptr->mb_io_extract_svp);
-		fprintf(stderr,"dbg2       insert_svp:         %p\n",(void *)mb_io_ptr->mb_io_insert_svp);
-		fprintf(stderr,"dbg2       ttimes:             %p\n",(void *)mb_io_ptr->mb_io_ttimes);
-		fprintf(stderr,"dbg2       detects:            %p\n",(void *)mb_io_ptr->mb_io_detects);
-		fprintf(stderr,"dbg2       extract_rawss:      %p\n",(void *)mb_io_ptr->mb_io_extract_rawss);
-		fprintf(stderr,"dbg2       insert_rawss:       %p\n",(void *)mb_io_ptr->mb_io_insert_rawss);
-		fprintf(stderr,"dbg2       copyrecord:         %p\n",(void *)mb_io_ptr->mb_io_copyrecord);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbr_info_mstiffss(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error)
-{
-	char	*function_name = "mbr_info_mstiffss";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* set format info parameters */
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-	*system = MB_SYS_MSTIFF;
-	*beams_bath_max = 0;
-	*beams_amp_max = 0;
-	*pixels_ss_max = 1024;
-	strncpy(format_name, "MSTIFFSS", MB_NAME_LENGTH);
-	strncpy(system_name, "MSTIFF", MB_NAME_LENGTH);
-	strncpy(format_description, "Format name:          MBF_MSTIFFSS\nInformal Description: MSTIFF sidescan format\nAttributes:           variable pixels,  sidescan,\n                      binary TIFF variant, single files, Sea Scan. \n", MB_DESCRIPTION_LENGTH);
-	*numfile = 1;
-	*filetype = MB_FILETYPE_NORMAL;
-	*variable_beams = MB_NO;
-	*traveltime = MB_NO;
-	*beam_flagging = MB_NO;
-	*nav_source = MB_DATA_DATA;
-	*heading_source = MB_DATA_DATA;
-	*vru_source = MB_DATA_DATA;
-	*svp_source = MB_DATA_NONE;
-	*beamwidth_xtrack = 0.0;
-	*beamwidth_ltrack = 0.0;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",*system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",*beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",*beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",*pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",*numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",*filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",*variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",*traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",*beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",*nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",*heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",*vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",*svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",*beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",*beamwidth_ltrack);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_alm_mstiffss(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_alm_mstiffss";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	int	*n_read;
-	int	*n_nav_use;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set initial status */
-	status = MB_SUCCESS;
-
-	/* allocate memory for data structure */
-	mb_io_ptr->structure_size = sizeof(struct mbf_mstiffss_struct);
-	status = mb_malloc(verbose,mb_io_ptr->structure_size,
-				&mb_io_ptr->raw_data,error);
-	status = mb_malloc(verbose,sizeof(struct mbsys_mstiff_struct),
-				&mb_io_ptr->store_data,error);
-
-	/* set number read counter */
-	n_read = &(mb_io_ptr->save_label_flag);
-	n_nav_use = &(mb_io_ptr->save8);
-	*n_read = 0;
-	*n_nav_use = 0;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_dem_mstiffss(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_dem_mstiffss";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* deallocate memory for data descriptor */
-	status = mb_free(verbose,&mb_io_ptr->raw_data,error);
-	status = mb_free(verbose,&mb_io_ptr->store_data,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_rt_mstiffss(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_rt_mstiffss";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_mstiffss_struct *data;
-	struct mbsys_mstiff_struct *store;
-	char	buffer[MBF_MSTIFFSS_BUFFERSIZE];
-	int	ifd_offset;
-	short	nentry;
-	short	tag;
-	short	type;
-	int	count;
-	int	value_offset;
-	int	*n_read;
-	int	*bits_per_pixel;
-	int	*n_ping_file;
-	int	*n_pixel_channel;
-	int	*left_channel_offset;
-	int	*right_channel_offset;
-	int	*sonar_data_info_offset;
-	int	*sonar_data_info_tag;
-	int	*n_nav;
-	int	*n_nav_use;
-	int	*nav_info_offset;
-	int	*nav_info_tag;
-	int	timecorr_tag;
-	int	timecorr_offset;
-	short	corr_time[9];
-	int	*ref_windows_time;
-	int	corr_time_i[7];
-	double	*corr_time_d;
-	int	date, time;
-	int	pingtime;
-	short   range_code;
-	short	frequency_code;
-	short   range_delay_bin;
-	short   altitude_bin;
-	int	range_mode;
-	int	channel_mode;
-	double	range_per_bin;
-	double  range;
-	double  range_delay;
-	double  altitude;
-	double	frequency;
-	short	sonar_gain[16];
-	int	navsize;
-	int	navtime1, navtime2;
-	float	lon1, lon2;
-	float	lat1, lat2;
-	float	speed1, speed2;
-	float	course1, course2;
-	float	heading1, heading2;
-	double	lon, lat, speed, course, heading;
-	double	factor;
-	double	range_tot;
-	unsigned char left_channel[MBF_MSTIFFSS_PIXELS/2];
-	unsigned char right_channel[MBF_MSTIFFSS_PIXELS/2];
-	int	ibottom;
-	int	istart;
-	int	index;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_mstiffss_struct *) mb_io_ptr->raw_data;
-	store = (struct mbsys_mstiff_struct *) store_ptr;
-
-	/* get pointers to saved values in mb_io_ptr */
-	n_read = &(mb_io_ptr->save_label_flag);
-	bits_per_pixel = &(mb_io_ptr->save_flag);
-	n_ping_file = &(mb_io_ptr->save1);
-	n_pixel_channel = &(mb_io_ptr->save2);
-	left_channel_offset = &(mb_io_ptr->save3);
-	right_channel_offset = &(mb_io_ptr->save4);
-	sonar_data_info_offset = &(mb_io_ptr->save5);
-	sonar_data_info_tag = &(mb_io_ptr->save6);
-	n_nav = &(mb_io_ptr->save7);
-	n_nav_use = &(mb_io_ptr->save8);
-	nav_info_offset = &(mb_io_ptr->save9);
-	nav_info_tag = &(mb_io_ptr->save10);
-	ref_windows_time = &(mb_io_ptr->save11);
-	corr_time_d = &(mb_io_ptr->saved1);
-
-	/* if first time through, read file header and
-	    offsets, setting up for later reads */
-	if (*n_read <= 0)
-	    {
-	    /* set defaults */
-	    *bits_per_pixel = 8;
-	    /* check for proper file tag */
-	    if ((status = fread(buffer, 4 * sizeof(char),
-			    1, mb_io_ptr->mbfp)) != 1)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-	    else if (strncmp(buffer, "MSTL", 4) != 0)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_BAD_DATA;
-		}
-	    else
-		{
-		status = MB_SUCCESS;
-		*error = MB_ERROR_NO_ERROR;
-		}
-
-	    /* now get the image file directory offset */
-	    if ((status = fread(buffer,
-			    sizeof(int), 1, mb_io_ptr->mbfp)) == 1)
-		{
-		mb_get_binary_int(MB_YES, buffer, &ifd_offset);
-		status = MB_SUCCESS;
-		*error = MB_ERROR_NO_ERROR;
-		}
-	    else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	    /* now parse through the image file directory
-		and grab the important values */
-	    if (status == MB_SUCCESS)
-		{
-		status = fseek(mb_io_ptr->mbfp, (size_t) ifd_offset, SEEK_SET);
-		status = ftell(mb_io_ptr->mbfp);
-		if ((status = fread(buffer, sizeof(short),
-			1, mb_io_ptr->mbfp)) == 1)
-		    {
-		    mb_get_binary_short(MB_YES, buffer, &nentry);
-
-		    /* loop over all entries in the directory */
-		    if ((status = fread(buffer, 6 * nentry * sizeof(short), 1, mb_io_ptr->mbfp)) == 1)
-			{
-			index = 0;
-		    	for (i=0;i<nentry && status == MB_SUCCESS;i++)
-			     {
-		    	     mb_get_binary_short(MB_YES, &(buffer[index]), &tag);
-			     index += sizeof(short);
-		    	     mb_get_binary_short(MB_YES, &(buffer[index]), &type);
-			     index += sizeof(short);
-		    	     mb_get_binary_int(MB_YES, &(buffer[index]), &count);
-			     index += sizeof(int);
-		    	     mb_get_binary_int(MB_YES, &(buffer[index]), &value_offset);
-			     index += sizeof(int);
-/*fprintf(stderr,"tag:%d type:%d count:%d value_offset:%d\n",
-tag,type,count,value_offset);*/
-
-			    /* set values for important entries */
-
-			    /* BitsPerBin */
-			    if (tag == BitsPerBin)
-				{
-				*bits_per_pixel = value_offset;
-				}
-
-			    /* SonarLines */
-			    else if (tag == SonarLines)
-				{
-				*n_ping_file = value_offset;
-				}
-
-			    /* BinsPerChannel */
-			    else if (tag == BinsPerChannel)
-				{
-				*n_pixel_channel = value_offset;
-				}
-
-			    /* TimeCorrelation */
-			    else if (tag == TimeCorrelation)
-				{
-				timecorr_tag = tag;
-				timecorr_offset = value_offset;
-				}
-
-			    /* Y2KTimeCorrelation */
-			    else if (tag == Y2KTimeCorrelation)
-				{
-				timecorr_tag = tag;
-				timecorr_offset = value_offset;
-				}
-
-			    /* LeftChannel */
-			    else if (tag == LeftChannel)
-				{
-				*left_channel_offset = value_offset;
-				}
-
-			    /* LeftChannel2 */
-			    else if (tag == LeftChannel2)
-				{
-				*left_channel_offset = value_offset;
-				}
-
-			    /* RightChannel */
-			    else if (tag == RightChannel)
-				{
-				*right_channel_offset = value_offset;
-				}
-
-			    /* RightChannel2 */
-			    else if (tag == RightChannel2)
-				{
-				*right_channel_offset = value_offset;
-				}
-
-			    /* SonarDataInfo */
-			    else if (tag == SonarDataInfo)
-				{
-				*sonar_data_info_offset = value_offset;
-				*sonar_data_info_tag = tag;
-				}
-
-			    /* SonarDataInfo2 */
-			    else if (tag == SonarDataInfo2)
-				{
-				*sonar_data_info_offset = value_offset;
-				*sonar_data_info_tag = tag;
-				}
-
-			    /* SonarDataInfo3 */
-			    else if (tag == SonarDataInfo3)
-				{
-				*sonar_data_info_offset = value_offset;
-				*sonar_data_info_tag = tag;
-				}
-
-			    /* NavInfoCount */
-			    else if (tag == NavInfoCount)
-				{
-				*n_nav = value_offset;
-				}
-
-			    /* NavInfo */
-			    else if (tag == NavInfo)
-				{
-				*nav_info_offset = value_offset;
-				*nav_info_tag = tag;
-				}
-
-			    /* NavInfo2 */
-			    else if (tag == NavInfo2)
-				{
-				*nav_info_offset = value_offset;
-				*nav_info_tag = tag;
-				}
-
-			    /* NavInfo3 */
-			    else if (tag == NavInfo3)
-				{
-				*nav_info_offset = value_offset;
-				*nav_info_tag = tag;
-				}
-
-			    /* NavInfo4 */
-			    else if (tag == NavInfo4)
-				{
-				*nav_info_offset = value_offset;
-				*nav_info_tag = tag;
-				}
-
-			    /* NavInfo5 */
-			    else if (tag == NavInfo5)
-				{
-				*nav_info_offset = value_offset;
-				*nav_info_tag = tag;
-				}
-
-			    /* NavInfo6 */
-			    else if (tag == NavInfo6)
-				{
-				*nav_info_offset = value_offset;
-				*nav_info_tag = tag;
-				}
-			     }
-			}
-		    else
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_EOF;
-			}
-		    }
-		else
-		    {
-		    status = MB_FAILURE;
-		    *error = MB_ERROR_EOF;
-		    }
-		}
-
-	    /* set the time correlation */
-	    if (status == MB_SUCCESS)
-		{
-	    	/* TimeCorrelation */
-	    	if (timecorr_tag == TimeCorrelation)
-		    {
-		    /* get time correlation values */
-		    fseek(mb_io_ptr->mbfp, timecorr_offset, SEEK_SET);
-		    if ((status = fread(buffer, sizeof(int) + 9 * sizeof(short),
-			    1, mb_io_ptr->mbfp)) == 1)
-			{
-			index = 0;
-		    	mb_get_binary_int(MB_YES, &(buffer[index]), ref_windows_time);
-			index += sizeof(int);
-			for (i=0;i<9;i++)
-			    {
-		    	    mb_get_binary_short(MB_YES, &(buffer[index]),
-			    			&(corr_time[i]));
-			    index += sizeof(short);
-			    }
-			mb_fix_y2k(verbose,(int)corr_time[5],
-				    &corr_time_i[0]);
-			corr_time_i[1] = corr_time[4] + 1;
-			corr_time_i[2] = corr_time[3];
-			corr_time_i[3] = corr_time[2];
-			corr_time_i[4] = corr_time[1];
-			corr_time_i[5] = corr_time[0];
-			corr_time_i[6] = 0;
-			mb_get_time(verbose,corr_time_i,
-				corr_time_d);
-
-			status = MB_SUCCESS;
-			*error = MB_ERROR_NO_ERROR;
-			}
-		    else
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_EOF;
-			}
-		    }
-
-		/* Y2KTimeCorrelation */
-		else if (timecorr_tag == Y2KTimeCorrelation)
-		    {
-		    /* get time correlation values */
-		    fseek(mb_io_ptr->mbfp, timecorr_offset, SEEK_SET);
-		    if ((status = fread(buffer, 3 * sizeof(int),
-			    1, mb_io_ptr->mbfp)) == 1)
-			{
-			index = 0;
-		    	mb_get_binary_int(MB_YES, &(buffer[index]), ref_windows_time);
-			index += sizeof(int);
-		    	mb_get_binary_int(MB_YES, &(buffer[index]), &date);
-			index += sizeof(int);
-		    	mb_get_binary_int(MB_YES, &(buffer[index]), &time);
-			index += sizeof(int);
-			corr_time_i[0] = date / 10000;
-			corr_time_i[1] = (date - corr_time_i[0] * 10000)/ 100;
-			corr_time_i[2] = (date - corr_time_i[0] * 10000
-				    	    - corr_time_i[1] * 100);
-			corr_time_i[3] = (time / 3600);
-			corr_time_i[4] = (time - corr_time_i[3] * 3600) / 60;
-			corr_time_i[5] = (time - corr_time_i[3] * 3600
-				    	    - corr_time_i[4] * 60);
-			corr_time_i[6] = 0;
-			mb_get_time(verbose,corr_time_i,
-				corr_time_d);
-			status = MB_SUCCESS;
-			*error = MB_ERROR_NO_ERROR;
-			}
-		    else
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_EOF;
-			}
-		    }
-		else
-		    {
-		    status = MB_FAILURE;
-		    *error = MB_ERROR_EOF;
-		    }
-		}
-	    }
-
-	/* if all pings already read then return EOF */
-	if (status == MB_SUCCESS && *n_read >= *n_ping_file)
-	    {
-	    status = MB_FAILURE;
-	    *error = MB_ERROR_EOF;
-	    }
-
-	/* else read next ping */
-	else if (status == MB_SUCCESS)
-	    {
-	    /* get sonar data info */
-	    if (*sonar_data_info_tag == SonarDataInfo)
-	    	{
-		fseek(mb_io_ptr->mbfp,
-			*sonar_data_info_offset
-			    + (*n_read) * (sizeof(int) + 3 * sizeof(short)),
-			SEEK_SET);
-		if ((status = fread(buffer, sizeof(int) + 3 * sizeof(short),
-				1, mb_io_ptr->mbfp)) == 1)
-		    {
-		    index = 0;
-		    mb_get_binary_int(MB_YES, &(buffer[index]), &pingtime);
-		    index += sizeof(int);
-		    mb_get_binary_short(MB_YES, &(buffer[index]), &range_code);
-		    index += sizeof(short);
-		    frequency_code = FREQ_UNKNOWN;
-		    mb_get_binary_short(MB_YES, &(buffer[index]), &range_delay_bin);
-		    index += sizeof(short);
-		    mb_get_binary_short(MB_YES, &(buffer[index]), &altitude_bin);
-		    index += sizeof(short);
-		    status = MB_SUCCESS;
-		    *error = MB_ERROR_NO_ERROR;
-		    for (i=0;i<16;i++)
-		    	sonar_gain[i] = 0;
-		    }
-		else
-		    {
-		    status = MB_FAILURE;
-		    *error = MB_ERROR_EOF;
-		    }
-		}
-
-	    /* get sonar data info */
-	    else if (*sonar_data_info_tag == SonarDataInfo2)
-	    	{
-		fseek(mb_io_ptr->mbfp,
-			*sonar_data_info_offset
-			    + (*n_read) * (sizeof(int) + 4 * sizeof(short)),
-			SEEK_SET);
-		if ((status = fread(buffer, sizeof(int) + 4 * sizeof(short),
-				1, mb_io_ptr->mbfp)) == 1)
-		    {
-		    index = 0;
-		    mb_get_binary_int(MB_YES, &(buffer[index]), &pingtime);
-		    index += sizeof(int);
-		    mb_get_binary_short(MB_YES, &(buffer[index]), &range_code);
-		    index += sizeof(short);
-		    mb_get_binary_short(MB_YES, &(buffer[index]), &frequency_code);
-		    index += sizeof(short);
-		    mb_get_binary_short(MB_YES, &(buffer[index]), &range_delay_bin);
-		    index += sizeof(short);
-		    mb_get_binary_short(MB_YES, &(buffer[index]), &altitude_bin);
-		    index += sizeof(short);
-		    status = MB_SUCCESS;
-		    *error = MB_ERROR_NO_ERROR;
-		    for (i=0;i<16;i++)
-		    	sonar_gain[i] = 0;
-		    status = MB_SUCCESS;
-		    *error = MB_ERROR_NO_ERROR;
-		    }
-		else
-		    {
-		    status = MB_FAILURE;
-		    *error = MB_ERROR_EOF;
-		    }
-		}
-
-	    /* get sonar data info */
-	    else if (*sonar_data_info_tag == SonarDataInfo3)
-	    	{
-		fseek(mb_io_ptr->mbfp,
-			*sonar_data_info_offset
-			    + (*n_read) * (sizeof(int) + 20 * sizeof(short)),
-			SEEK_SET);
-		if ((status = fread(buffer, sizeof(int) + 20 * sizeof(short),
-				1, mb_io_ptr->mbfp)) == 1)
-		    {
-		    index = 0;
-		    mb_get_binary_int(MB_YES, &(buffer[index]), &pingtime);
-		    index += sizeof(int);
-		    mb_get_binary_short(MB_YES, &(buffer[index]), &range_code);
-		    index += sizeof(short);
-		    mb_get_binary_short(MB_YES, &(buffer[index]), &frequency_code);
-		    index += sizeof(short);
-		    mb_get_binary_short(MB_YES, &(buffer[index]), &range_delay_bin);
-		    index += sizeof(short);
-		    mb_get_binary_short(MB_YES, &(buffer[index]), &altitude_bin);
-		    index += sizeof(short);
-		    for (i=0;i<16;i++)
-		    	{
-			mb_get_binary_short(MB_YES, &(buffer[index]), &(sonar_gain[i]));
-		        index += sizeof(short);
-			}
-		    status = MB_SUCCESS;
-		    *error = MB_ERROR_NO_ERROR;
-		    }
-		else
-		    {
-		    status = MB_FAILURE;
-		    *error = MB_ERROR_EOF;
-		    }
-		}
-
-	    /* make sense of sonar data info */
-	    if (status == MB_SUCCESS)
-		{
-		channel_mode = (range_code & ~63) >> 6;
-		if (channel_mode == 3) channel_mode = 0;
-		range_mode = range_code & 15;
-		switch (range_mode)
-		    {
-		    case 1:
-			range = 5;
-			break;
-		    case 2:
-			range = 10;
-			break;
-		    case 3:
-			range = 20;
-			break;
-		    case 4:
-			range = 50;
-			break;
-		    case 5:
-			range = 75;
-			break;
-		    case 6:
-			range = 100;
-			break;
-		    case 7:
-			range = 150;
-			break;
-		    case 8:
-			range = 200;
-			break;
-		    case 9:
-			range = 300;
-			break;
-		    case 10:
-			range = 500;
-			break;
-		    default:
-			range = 5;
-			break;
-		    }
-		range_per_bin = range / *n_pixel_channel;
-		range_delay = range_delay_bin * range_per_bin;
-		altitude = altitude_bin * range_per_bin;
-		switch (frequency_code)
-		    {
-		    case 1:
-			frequency = 150.0;
-			break;
-		    case 2:
-			frequency = 300.0;
-			break;
-		    case 3:
-			frequency = 600.0;
-			break;
-		    case 4:
-			frequency = 1200.0;
-			break;
-		    case 5:
-			frequency = 0.0;
-			break;
-		    }
-		}
-
-	    /* now get navigation */
-	    if (status == MB_SUCCESS
-		&& *n_nav_use < *n_nav)
-		{
-		switch (*nav_info_tag)
-		    {
-		    case NavInfo:
-			navsize = 16 * sizeof(int);
-			break;
-		    case NavInfo2:
-			navsize = 19 * sizeof(int);
-			break;
-		    case NavInfo3:
-			navsize = 16 * sizeof(int);
-			break;
-		    case NavInfo4:
-			navsize = 19 * sizeof(int);
-			break;
-		    case NavInfo5:
-			navsize = 20 * sizeof(int);
-			break;
-		    case NavInfo6:
-			navsize = 20 * sizeof(int);
-			break;
-		    default:
-			navsize = 20 * sizeof(int);
-			break;
-		    }
-
-		/* read first nav point starting with last
-		   nav used */
-		fseek(mb_io_ptr->mbfp,
-		    *nav_info_offset + (*n_nav_use)
-			* navsize, SEEK_SET);
-		if ((status = fread(buffer, navsize,
-				1, mb_io_ptr->mbfp)) == 1)
-		    {
-		    index = 0;
-		    mb_get_binary_int(MB_YES, &(buffer[index]), &navtime1);
-		    index += sizeof(int);
-		    mb_get_binary_float(MB_YES, &(buffer[index]), &lat1);
-		    index += sizeof(float);
-		    mb_get_binary_float(MB_YES, &(buffer[index]), &lon1);
-		    index += sizeof(float);
-		    mb_get_binary_float(MB_YES, &(buffer[index]), &speed1);
-		    index += sizeof(float);
-		    mb_get_binary_float(MB_YES, &(buffer[index]), &course1);
-		    if (*nav_info_tag == NavInfo6)
-		    	{
-			index += 3 * sizeof(float);
-		        mb_get_binary_float(MB_YES, &(buffer[index]), &heading1);
-			}
-		    else
-			{
-			heading1 = course1;
-			}
-		    lon1 /= 60.;
-		    lat1 /= 60.;
-		    status = MB_SUCCESS;
-		    *error = MB_ERROR_NO_ERROR;
-		    }
-		else
-		    {
-		    status = MB_FAILURE;
-		    *error = MB_ERROR_EOF;
-		    }
-
-		/* read second nav point starting with last
-		   nav used */
-		fseek(mb_io_ptr->mbfp,
-		    *nav_info_offset + (*n_nav_use+1)
-			* navsize, SEEK_SET);
-		if ((status = fread(buffer, navsize,
-				1, mb_io_ptr->mbfp)) == 1)
-		    {
-		    index = 0;
-		    mb_get_binary_int(MB_YES, &(buffer[index]), &navtime2);
-		    index += sizeof(int);
-		    mb_get_binary_float(MB_YES, &(buffer[index]), &lat2);
-		    index += sizeof(float);
-		    mb_get_binary_float(MB_YES, &(buffer[index]), &lon2);
-		    index += sizeof(float);
-		    mb_get_binary_float(MB_YES, &(buffer[index]), &speed2);
-		    index += sizeof(float);
-		    mb_get_binary_float(MB_YES, &(buffer[index]), &course2);
-		    if (*nav_info_tag == NavInfo6)
-		    	{
-			index += 3 * sizeof(float);
-		        mb_get_binary_float(MB_YES, &(buffer[index]), &heading2);
-			}
-		    else
-			{
-			heading2 = course2;
-			}
-		    lon2 /= 60.;
-		    lat2 /= 60.;
-		    status = MB_SUCCESS;
-		    *error = MB_ERROR_NO_ERROR;
-		    }
-		else
-		    {
-		    status = MB_FAILURE;
-		    *error = MB_ERROR_EOF;
-		    navtime2 = 0.0;
-		    }
-
-		/* if first two nav points don't bracket ping
-		   in time keep reading until two found that
-		   do or end of nav reached */
-		while (pingtime > navtime2 && *n_nav_use < *n_nav - 2)
-		    {
-		    /* move nav 2 to nav 1 */
-		    navtime1 = navtime2;
-		    lat1 = lat2;
-		    lon1 = lon2;
-		    speed1 = speed2;
-		    course1 = course2;
-
-		    /* read second nav point starting with last
-		       nav used */
-		    fseek(mb_io_ptr->mbfp,
-			*nav_info_offset + (*n_nav_use+2)
-			    * navsize, SEEK_SET);
-		    if ((status = fread(buffer, navsize,
-				    1, mb_io_ptr->mbfp)) == 1)
-			{
-			index = 0;
-			mb_get_binary_int(MB_YES, &(buffer[index]), &navtime2);
-			index += sizeof(int);
-			mb_get_binary_float(MB_YES, &(buffer[index]), &lat2);
-			index += sizeof(float);
-			mb_get_binary_float(MB_YES, &(buffer[index]), &lon2);
-			index += sizeof(float);
-			mb_get_binary_float(MB_YES, &(buffer[index]), &speed2);
-			index += sizeof(float);
-			mb_get_binary_float(MB_YES, &(buffer[index]), &course2);
-			if (*nav_info_tag == NavInfo6)
-		    	    {
-			    index += 3 * sizeof(float);
-		            mb_get_binary_float(MB_YES, &(buffer[index]), &heading2);
-			    }
-			else
-		    	    {
-			    heading2 = course2;
-			    }
-			lon2 /= 60.;
-			lat2 /= 60.;
-		        (*n_nav_use)++;
-			status = MB_SUCCESS;
-			*error = MB_ERROR_NO_ERROR;
-			}
-		    else
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_EOF;
-			}
-
-		    }
-
-		/* now interpolate nav */
-		factor = ((double)(pingtime - navtime1))
-			    / ((double)(navtime2 - navtime1));
-		lon = lon1 + factor * (lon2 - lon1);
-		lat = lat1 + factor * (lat2 - lat1);
-		speed = speed1 + factor * (speed2 - speed1);
-		if (course2 - course1 > 180.0)
-			{
-			course = course1 + factor * (course2 - course1 - 360.0);
-			}
-		else if (course2 - course1 < -180.0)
-			{
-			course = course1 + factor * (course2 - course1 + 360.0);
-			}
-		else
-			{
-			course = course1 + factor * (course2 - course1);
-			}
-		if (heading2 - heading1 > 180.0)
-			{
-			heading = heading1 + factor * (heading2 - heading1 - 360.0);
-			}
-		else if (heading2 - heading1 < -180.0)
-			{
-			heading = heading1 + factor * (heading2 - heading1 + 360.0);
-			}
-		else
-			{
-			heading = heading1 + factor * (heading2 - heading1);
-			}
-		}
-
-	    /* now get left channel sonar data */
-	    if (status == MB_SUCCESS)
-		{
-		fseek(mb_io_ptr->mbfp,
-		    *left_channel_offset + (*n_read) * (*n_pixel_channel), SEEK_SET);
-		if ((status= fread(left_channel, sizeof(unsigned char),
-		    *n_pixel_channel, mb_io_ptr->mbfp))
-		    == *n_pixel_channel)
-		    {
-		    status = MB_SUCCESS;
-		    *error = MB_ERROR_NO_ERROR;
-		    }
-		else
-		    {
-		    status = MB_FAILURE;
-		    *error = MB_ERROR_EOF;
-		    }
-		}
-
-	    /* now get right channel sonar data */
-	    if (status == MB_SUCCESS)
-		{
-		fseek(mb_io_ptr->mbfp,
-		    *right_channel_offset + (*n_read) * (*n_pixel_channel), SEEK_SET);
-		if ((status= fread(right_channel, sizeof(unsigned char),
-		    *n_pixel_channel, mb_io_ptr->mbfp))
-		    == *n_pixel_channel)
-		    {
-		    status = MB_SUCCESS;
-		    *error = MB_ERROR_NO_ERROR;
-		    }
-		else
-		    {
-		    status = MB_FAILURE;
-		    *error = MB_ERROR_EOF;
-		    }
-		}
-
-	    /* if no altitude do bottom detect */
-	    if (status == MB_SUCCESS && altitude <= 0.0)
-		{
-		ibottom = 0;
-		for (i=0;i<*n_pixel_channel && ibottom == 0; i++)
-		    {
-		    range_tot = range_delay + i * range_per_bin;
-		    if (range_tot > MBF_MSTIFF_TRANSMIT_BINS * range_per_bin
-			&& right_channel[i] > MBF_MSTIFF_BOTTOM_THRESHOLD
-			&& left_channel[i] > MBF_MSTIFF_BOTTOM_THRESHOLD)
-			{
-			ibottom = i;
-			altitude = range_tot;
-			}
-		    }
-		if (altitude != range_tot)
-			{
-			/* There's either no amplitude data or the bottom, VES */
-			/* threshold is too high. Set a default value */
-			altitude = range_delay;
-			}
-		}
-
-	    /* increment reading counter */
-	    if (status == MB_SUCCESS)
-		(*n_read)++;
-
-	    /* copy to proper storage, doing slant range correction */
-	    if (status == MB_SUCCESS)
-		{
-		data->time_d = *corr_time_d
-				+ 0.001 * (pingtime - *ref_windows_time);
-		data->lon = lon;
-		data->lat = lat;
-		data->heading = heading;
-		data->course = course;
-		data->speed = speed;
-		data->altitude = altitude;
-		data->slant_range_max = range;
-		data->range_delay = range_delay;
-		data->sample_interval = range_per_bin;
-		data->sonar_depth = 0.0;
-		data->frequency = frequency;
-		data->pixels_ss = 2 * (*n_pixel_channel);
-		istart = (altitude - range_delay) / range_per_bin + 1;
-
-		/* port and starboard channels */
-		if (channel_mode == 0)
-		    {
-		    for (i=0;i<istart; i++)
-			{
-			j = (*n_pixel_channel) - 1 - i;
-			data->ss[j] = left_channel[i];
-			data->ssacrosstrack[j] = 0.0;
-			j = (*n_pixel_channel) + i;
-			data->ss[j] = right_channel[i];
-			data->ssacrosstrack[j] = 0.0;
-			}
-		    for (i=istart;i<*n_pixel_channel; i++)
-			{
-			range_tot = range_delay + i * range_per_bin;
-			j = (*n_pixel_channel) - 1 - i;
-			data->ss[j] = left_channel[i];
-			data->ssacrosstrack[j]
-			    = -sqrt(range_tot * range_tot
-				    - altitude * altitude);
-			j = (*n_pixel_channel) + i;
-			data->ss[j] = right_channel[i];
-			data->ssacrosstrack[j]
-			    = sqrt(range_tot * range_tot
-				    - altitude * altitude);
-			}
-		    }
-
-		/* port channel only */
-		else if (channel_mode == 1)
-		    {
-		    for (i=0;i<istart; i++)
-			{
-			j = 2 * (*n_pixel_channel) - 1 - 2 * i;
-			data->ss[j] = left_channel[i];
-			data->ssacrosstrack[j] = 0.0;
-			j = 2 * (*n_pixel_channel) - 2 - 2 * i;
-			data->ss[j] = right_channel[i];
-			data->ssacrosstrack[j] = 0.0;
-			}
-		    for (i=istart;i<*n_pixel_channel; i++)
-			{
-			range_tot = range_delay + (i - 0.5) * range_per_bin;
-			j = 2 * (*n_pixel_channel) - 1 - 2 * i;
-			data->ss[j] = left_channel[i];
-			data->ssacrosstrack[j]
-			    = -sqrt(range_tot * range_tot
-				    - altitude * altitude);
-			range_tot = range_delay + i * range_per_bin;
-			j = 2 * (*n_pixel_channel) - 2 - 2 * i;
-			data->ss[j] = right_channel[i];
-			data->ssacrosstrack[j]
-			    = -sqrt(range_tot * range_tot
-				    - altitude * altitude);
-			}
-		    }
-
-		/* starboard channel only */
-		else if (channel_mode == 2)
-		    {
-		    for (i=0;i<istart; i++)
-			{
-			j = 2 * i;
-			data->ss[j] = right_channel[i];
-			data->ssacrosstrack[j] = 0.0;
-			j = 2 * i + 1;
-			data->ss[j] = left_channel[i];
-			data->ssacrosstrack[j] = 0.0;
-			}
-		    for (i=istart;i<*n_pixel_channel; i++)
-			{
-			range_tot = range_delay + (i - 0.5) * range_per_bin;
-			j = 2 * i;
-			data->ss[j] = right_channel[i];
-			data->ssacrosstrack[j]
-			    = sqrt(range_tot * range_tot
-				    - altitude * altitude);
-			range_tot = range_delay + i * range_per_bin;
-			j = 2 * i + 1;
-			data->ss[j] = left_channel[i];
-			data->ssacrosstrack[j]
-			    = sqrt(range_tot * range_tot
-				    - altitude * altitude);
-			}
-		    }
-		}
-	    }
-
-	/* print debug statements */
-	if (status == MB_SUCCESS && verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  New data record read by MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5  Raw values:\n");
-		fprintf(stderr,"dbg5       n_ping_file:      %d\n", *n_ping_file);
-		fprintf(stderr,"dbg5       bits_per_pixel:   %d\n", *bits_per_pixel);
-		fprintf(stderr,"dbg5       n_pixel_channel:  %d\n", *n_pixel_channel);
-		fprintf(stderr,"dbg5       n_nav:            %d\n", *n_nav);
-		fprintf(stderr,"dbg5       n_nav_use:        %d\n", *n_nav_use);
-		fprintf(stderr,"dbg5       corr_time_d:      %f\n", *corr_time_d);
-		fprintf(stderr,"dbg5       ref_windows_time: %d\n", *ref_windows_time);
-		fprintf(stderr,"dbg5       pingtime:         %d\n", pingtime);
-		fprintf(stderr,"dbg5       range_code:       %d\n", range_code);
-		fprintf(stderr,"dbg5       channel_mode:     %d\n", channel_mode);
-		fprintf(stderr,"dbg5       range_mode:       %d\n", range_mode);
-		fprintf(stderr,"dbg5       range:            %f\n", range);
-		fprintf(stderr,"dbg5       range_delay_bin:  %d\n", range_delay_bin);
-		fprintf(stderr,"dbg5       range_delay:      %f\n", range_delay);
-		fprintf(stderr,"dbg5       altitude_bin:     %d\n", altitude_bin);
-		fprintf(stderr,"dbg5       altitude:         %f\n", altitude);
-		for (i=0;i<*n_pixel_channel;i++)
-		    fprintf(stderr,"dbg5       %4d  ss_left: %d  ss_right: %d\n",
-			    i, left_channel[i], right_channel[i]);
-		fprintf(stderr,"dbg5  Stored data values:\n");
-		fprintf(stderr,"dbg5       time:       %f\n",data->time_d);
-		fprintf(stderr,"dbg5       lon:        %f\n",data->lon);
-		fprintf(stderr,"dbg5       lat:        %f\n",data->lat);
-		fprintf(stderr,"dbg5       heading:    %f\n",data->heading);
-		fprintf(stderr,"dbg5       speed:      %f\n",data->speed);
-		fprintf(stderr,"dbg5       altitude:   %f\n",data->altitude);
-		fprintf(stderr,"dbg5       pixels_ss:  %d\n",data->pixels_ss);
-		for (i=0;i<data->pixels_ss;i++)
-		    fprintf(stderr,"dbg5       ss[%4d]: %d  xtrack:%f\n",
-			    i, data->ss[i], data->ssacrosstrack[i]);
-		}
-
-	/* set kind and error in mb_io_ptr */
-	mb_io_ptr->new_kind = MB_DATA_DATA;
-	mb_io_ptr->new_error = *error;
-
-	/* translate values to mstiff data storage structure */
-	if (status == MB_SUCCESS
-		&& store != NULL)
-		{
-		/* time stamp */
-		store->time_d = data->time_d;
-
-		/* position */
-		store->lon = data->lon;
-		store->lat = data->lat;
-
-		/* heading and speed */
-		store->heading = data->heading;
-		store->course = data->course;
-		store->speed = data->speed;
-		store->altitude = data->altitude;
-		store->slant_range_max = data->slant_range_max;
-		store->range_delay = data->range_delay;
-		store->sample_interval = data->sample_interval;
-		store->sonar_depth = data->sonar_depth;
-		store->frequency = data->frequency;
-
-		/* sidescan data */
-		store->pixels_ss = data->pixels_ss;
-		for (i=0;i<data->pixels_ss;i++)
-		    {
-		    store->ss[i] = data->ss[i];
-		    store->ssacrosstrack[i] = data->ssacrosstrack[i];
-		    }
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_wt_mstiffss(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_wt_mstiffss";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_mstiffss_struct *data;
-	struct mbsys_mstiff_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_mstiffss_struct *) mb_io_ptr->raw_data;
-	store = (struct mbsys_mstiff_struct *) store_ptr;
-
-	/* set error as this is a read only format */
-	status = MB_FAILURE;
-	*error = MB_ERROR_WRITE_FAIL;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mbr_nvnetcdf.c b/src/mbio/mbr_nvnetcdf.c
deleted file mode 100644
index 30ee976..0000000
--- a/src/mbio/mbr_nvnetcdf.c
+++ /dev/null
@@ -1,2727 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbr_nvnetcdf.c	5/4/02
- *	$Id: mbr_nvnetcdf.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 2002-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbr_nvnetcdf.c contains the functions for reading and writing
- * multibeam data in the MBF_MBNETCDF format.
- * These functions include:
- *   mbr_alm_nvnetcdf	- allocate read/write memory
- *   mbr_dem_nvnetcdf	- deallocate read/write memory
- *   mbr_rt_nvnetcdf	- read and translate data
- *   mbr_wt_nvnetcdf	- translate and write data
- *
- * Author:	D. W. Caress
- * Date:	May 4, 2002
- *
- * $Log: mbr_nvnetcdf.c,v $
- * Revision 5.6  2008/07/10 06:43:41  caress
- * Preparing for 5.1.1beta20
- *
- * Revision 5.5  2008/05/16 22:56:24  caress
- * Release 5.1.1beta18.
- *
- * Revision 5.4  2005/11/05 00:48:04  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.3  2005/03/26 22:05:17  caress
- * Release 5.0.7.
- *
- * Revision 5.2  2003/05/20 18:05:32  caress
- * Added svp_source to data source parameters.
- *
- * Revision 5.1  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.0  2002/05/29 23:39:23  caress
- * Release 5.0.beta18
- *
- *
- *
- */
-/* #define MBNETCDF_DEBUG 1 */
-
-/* standard include files */
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#include <string.h>
-#include <time.h>
-#include <netcdf.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mb_define.h"
-#include "mbsys_navnetcdf.h"
-
-/* essential function prototypes */
-int mbr_register_nvnetcdf(int verbose, void *mbio_ptr,
-		int *error);
-int mbr_info_nvnetcdf(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_alm_nvnetcdf(int verbose, void *mbio_ptr, int *error);
-int mbr_dem_nvnetcdf(int verbose, void *mbio_ptr, int *error);
-int mbr_rt_nvnetcdf(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_wt_nvnetcdf(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-
-static char rcs_id[]="$Id: mbr_nvnetcdf.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mbr_register_nvnetcdf(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_register_nvnetcdf";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* get mb_io_ptr */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set format info parameters */
-	status = mbr_info_nvnetcdf(verbose,
-			&mb_io_ptr->system,
-			&mb_io_ptr->beams_bath_max,
-			&mb_io_ptr->beams_amp_max,
-			&mb_io_ptr->pixels_ss_max,
-			mb_io_ptr->format_name,
-			mb_io_ptr->system_name,
-			mb_io_ptr->format_description,
-			&mb_io_ptr->numfile,
-			&mb_io_ptr->filetype,
-			&mb_io_ptr->variable_beams,
-			&mb_io_ptr->traveltime,
-			&mb_io_ptr->beam_flagging,
-			&mb_io_ptr->nav_source,
-			&mb_io_ptr->heading_source,
-			&mb_io_ptr->vru_source,
-			&mb_io_ptr->svp_source,
-			&mb_io_ptr->beamwidth_xtrack,
-			&mb_io_ptr->beamwidth_ltrack,
-			error);
-
-	/* set format and system specific function pointers */
-	mb_io_ptr->mb_io_format_alloc = &mbr_alm_nvnetcdf;
-	mb_io_ptr->mb_io_format_free = &mbr_dem_nvnetcdf;
-	mb_io_ptr->mb_io_store_alloc = &mbsys_navnetcdf_alloc;
-	mb_io_ptr->mb_io_store_free = &mbsys_navnetcdf_deall;
-	mb_io_ptr->mb_io_read_ping = &mbr_rt_nvnetcdf;
-	mb_io_ptr->mb_io_write_ping = &mbr_wt_nvnetcdf;
-	mb_io_ptr->mb_io_dimensions = &mbsys_navnetcdf_dimensions;
-	mb_io_ptr->mb_io_extract = &mbsys_navnetcdf_extract;
-	mb_io_ptr->mb_io_insert = &mbsys_navnetcdf_insert;
-	mb_io_ptr->mb_io_extract_nav = &mbsys_navnetcdf_extract_nav;
-	mb_io_ptr->mb_io_insert_nav = &mbsys_navnetcdf_insert_nav;
-	mb_io_ptr->mb_io_extract_altitude = &mbsys_navnetcdf_extract_altitude;
-	mb_io_ptr->mb_io_insert_altitude = &mbsys_navnetcdf_insert_altitude;
-	mb_io_ptr->mb_io_extract_svp = NULL;
-	mb_io_ptr->mb_io_insert_svp = NULL;
-	mb_io_ptr->mb_io_ttimes = &mbsys_navnetcdf_ttimes;
-	mb_io_ptr->mb_io_detects = &mbsys_navnetcdf_detects;
-	mb_io_ptr->mb_io_copyrecord = &mbsys_navnetcdf_copy;
-	mb_io_ptr->mb_io_extract_rawss = NULL;
-	mb_io_ptr->mb_io_insert_rawss = NULL;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",mb_io_ptr->system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",mb_io_ptr->beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",mb_io_ptr->beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",mb_io_ptr->pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",mb_io_ptr->format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",mb_io_ptr->system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",mb_io_ptr->format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",mb_io_ptr->numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",mb_io_ptr->filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",mb_io_ptr->variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",mb_io_ptr->traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",mb_io_ptr->beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",mb_io_ptr->nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",mb_io_ptr->heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",mb_io_ptr->vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",mb_io_ptr->svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",mb_io_ptr->beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",mb_io_ptr->beamwidth_ltrack);
-		fprintf(stderr,"dbg2       format_alloc:       %p\n",(void *)mb_io_ptr->mb_io_format_alloc);
-		fprintf(stderr,"dbg2       format_free:        %p\n",(void *)mb_io_ptr->mb_io_format_free);
-		fprintf(stderr,"dbg2       store_alloc:        %p\n",(void *)mb_io_ptr->mb_io_store_alloc);
-		fprintf(stderr,"dbg2       store_free:         %p\n",(void *)mb_io_ptr->mb_io_store_free);
-		fprintf(stderr,"dbg2       read_ping:          %p\n",(void *)mb_io_ptr->mb_io_read_ping);
-		fprintf(stderr,"dbg2       write_ping:         %p\n",(void *)mb_io_ptr->mb_io_write_ping);
-		fprintf(stderr,"dbg2       extract:            %p\n",(void *)mb_io_ptr->mb_io_extract);
-		fprintf(stderr,"dbg2       insert:             %p\n",(void *)mb_io_ptr->mb_io_insert);
-		fprintf(stderr,"dbg2       extract_nav:        %p\n",(void *)mb_io_ptr->mb_io_extract_nav);
-		fprintf(stderr,"dbg2       insert_nav:         %p\n",(void *)mb_io_ptr->mb_io_insert_nav);
-		fprintf(stderr,"dbg2       extract_altitude:   %p\n",(void *)mb_io_ptr->mb_io_extract_altitude);
-		fprintf(stderr,"dbg2       insert_altitude:    %p\n",(void *)mb_io_ptr->mb_io_insert_altitude);
-		fprintf(stderr,"dbg2       extract_svp:        %p\n",(void *)mb_io_ptr->mb_io_extract_svp);
-		fprintf(stderr,"dbg2       insert_svp:         %p\n",(void *)mb_io_ptr->mb_io_insert_svp);
-		fprintf(stderr,"dbg2       ttimes:             %p\n",(void *)mb_io_ptr->mb_io_ttimes);
-		fprintf(stderr,"dbg2       detects:            %p\n",(void *)mb_io_ptr->mb_io_detects);
-		fprintf(stderr,"dbg2       extract_rawss:      %p\n",(void *)mb_io_ptr->mb_io_extract_rawss);
-		fprintf(stderr,"dbg2       insert_rawss:       %p\n",(void *)mb_io_ptr->mb_io_insert_rawss);
-		fprintf(stderr,"dbg2       copyrecord:         %p\n",(void *)mb_io_ptr->mb_io_copyrecord);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbr_info_nvnetcdf(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error)
-{
-	char	*function_name = "mbr_info_nvnetcdf";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* set format info parameters */
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-	*system = MB_SYS_NAVNETCDF;
-	*beams_bath_max = 0;
-	*beams_amp_max = 0;
-	*pixels_ss_max = 0;
-	strncpy(format_name, "NVNETCDF", MB_NAME_LENGTH);
-	strncpy(system_name, "NAVNETCDF", MB_NAME_LENGTH);
-	strncpy(format_description, "Format name:          MBF_NVNETCDF\nInformal Description: CARAIBES CDF navigation\nAttributes:           netCDF, IFREMER.\n", MB_DESCRIPTION_LENGTH);
-	*numfile = 1;
-	*filetype = MB_FILETYPE_NETCDF;
-	*variable_beams = MB_NO;
-	*traveltime = MB_NO;
-	*beam_flagging = MB_NO;
-	*nav_source = MB_DATA_DATA;
-	*heading_source = MB_DATA_DATA;
-	*vru_source = MB_DATA_DATA;
-	*svp_source = MB_DATA_NONE;
-	*beamwidth_xtrack = 0.0;
-	*beamwidth_ltrack = 0.0;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",*system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",*beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",*beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",*pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",*numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",*filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",*variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",*traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",*beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",*nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",*heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",*vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",*svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",*beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",*beamwidth_ltrack);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_alm_nvnetcdf(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_alm_nvnetcdf";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_navnetcdf_struct *store;
-	int	*dataread;
-	int	*commentread;
-	int	*recread;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set initial status */
-	status = MB_SUCCESS;
-
-	/* allocate memory for data structure */
-	status = mbsys_navnetcdf_alloc(verbose,mbio_ptr,
-		&mb_io_ptr->store_data,error);
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_navnetcdf_struct *) mb_io_ptr->store_data;
-
-	/* initialize values in structure */
-	dataread = (int *) &mb_io_ptr->save1;
-	commentread = (int *) &mb_io_ptr->save2;
-	recread = (int *) &mb_io_ptr->save4;
-	*dataread = MB_NO;
-	*commentread = 0;
-	*recread = 0;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_dem_nvnetcdf(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_dem_nvnetcdf";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* deallocate memory for data descriptor */
-	status = mbsys_navnetcdf_deall(verbose,mbio_ptr,
-		&mb_io_ptr->store_data,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_rt_nvnetcdf(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_rt_nvnetcdf";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_navnetcdf_struct *store;
-	int	*dataread;
-	int	*commentread;
-	int	*recread;
-	int	dim_id;
-	size_t	index[2], count[2];
-	int nc_status;
-	int	i;
-#ifdef MBNETCDF_DEBUG
-	int	nc_verbose = 1;
-#else
-	int	nc_verbose = 0;
-#endif
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor and data structure */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-	store = (struct mbsys_navnetcdf_struct *) store_ptr;
-	dataread = (int *) &mb_io_ptr->save1;
-	commentread = (int *) &mb_io_ptr->save2;
-	recread = (int *) &mb_io_ptr->save4;
-
-	/* set file position */
-	mb_io_ptr->file_pos = mb_io_ptr->file_bytes;
-
-	/* if first read then set everything up */
-	if (*dataread == MB_NO)
-	    {
-	    *dataread = MB_YES;
-
-	    /* get dimensions */
-	    nc_status = nc_inq_dimid(mb_io_ptr->ncid, "mbHistoryRecNbr", &dim_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_inq_dimid mbHistoryRecNbr error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_inq_dimlen(mb_io_ptr->ncid, dim_id, &store->mbHistoryRecNbr);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_inq_dimlen mbHistoryRecNbr error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_inq_dimid(mb_io_ptr->ncid, "mbNameLength", &dim_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_inq_dimid mbNameLength error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_inq_dimlen(mb_io_ptr->ncid, dim_id, &store->mbNameLength);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_inq_dimlen mbNameLength error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_inq_dimid(mb_io_ptr->ncid, "mbCommentLength", &dim_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_inq_dimid mbCommentLength error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_inq_dimlen(mb_io_ptr->ncid, dim_id, &store->mbCommentLength);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_inq_dimlen mbCommentLength error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_inq_dimid(mb_io_ptr->ncid, "mbPositionNbr", &dim_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_inq_dimid mbPositionNbr error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_inq_dimlen(mb_io_ptr->ncid, dim_id, &store->mbPositionNbr);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_inq_dimlen mbPositionNbr error: %s\n", nc_strerror(nc_status));
-	    if (nc_status != NC_NOERR)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	    /* print input debug statements */
-	    if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  NetCDF array dimensions read in function <%s>\n",function_name);
-		fprintf(stderr,"dbg2  Array and variable dimensions:\n");
-		fprintf(stderr,"dbg2       status:                  %d\n", status);
-		fprintf(stderr,"dbg2       error:                   %d\n", *error);
-		fprintf(stderr,"dbg2       nc_status:               %d\n", nc_status);
-		fprintf(stderr,"dbg2       mbHistoryRecNbr:         %zu\n", store->mbHistoryRecNbr);
-		fprintf(stderr,"dbg2       mbNameLength:            %zu\n", store->mbNameLength);
-		fprintf(stderr,"dbg2       mbCommentLength:         %zu\n", store->mbCommentLength);
-		fprintf(stderr,"dbg2       mbPositionNbr:           %zu\n", store->mbPositionNbr);
-		}
-
-	    /* get global attributes */
-	    if (status == MB_SUCCESS)
-		{
-		nc_status = nc_get_att_short(mb_io_ptr->ncid, NC_GLOBAL, "mbVersion", &store->mbVersion);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbVersion error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_get_att_text(mb_io_ptr->ncid, NC_GLOBAL, "mbName", store->mbName);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbName error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_get_att_text(mb_io_ptr->ncid, NC_GLOBAL, "mbClasse", store->mbClasse);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbClasse error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_get_att_short(mb_io_ptr->ncid, NC_GLOBAL, "mbLevel", &store->mbLevel);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbLevel error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_get_att_short(mb_io_ptr->ncid, NC_GLOBAL, "mbNbrHistoryRec", &store->mbNbrHistoryRec);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbNbrHistoryRec error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_get_att_text(mb_io_ptr->ncid, NC_GLOBAL, "mbTimeReference", store->mbTimeReference);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbTimeReference error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_get_att_int(mb_io_ptr->ncid, NC_GLOBAL, "mbStartDate", &store->mbStartDate);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbStartDate error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_get_att_int(mb_io_ptr->ncid, NC_GLOBAL, "mbStartTime", &store->mbStartTime);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbStartTime error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_get_att_int(mb_io_ptr->ncid, NC_GLOBAL, "mbEndDate", &store->mbEndDate);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbEndDate error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_get_att_int(mb_io_ptr->ncid, NC_GLOBAL, "mbEndTime", &store->mbEndTime);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbEndTime error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_get_att_double(mb_io_ptr->ncid, NC_GLOBAL, "mbNorthLatitude", &store->mbNorthLatitude);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbNorthLatitude error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_get_att_double(mb_io_ptr->ncid, NC_GLOBAL, "mbSouthLatitude", &store->mbSouthLatitude);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSouthLatitude error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_get_att_double(mb_io_ptr->ncid, NC_GLOBAL, "mbEastLongitude", &store->mbEastLongitude);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbEastLongitude error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_get_att_double(mb_io_ptr->ncid, NC_GLOBAL, "mbWestLongitude", &store->mbWestLongitude);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbWestLongitude error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_get_att_text(mb_io_ptr->ncid, NC_GLOBAL, "mbMeridian180", store->mbMeridian180);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbMeridian180 error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_get_att_text(mb_io_ptr->ncid, NC_GLOBAL, "mbGeoDictionnary", store->mbGeoDictionnary);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbGeoDictionnary error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_get_att_text(mb_io_ptr->ncid, NC_GLOBAL, "mbGeoRepresentation", store->mbGeoRepresentation);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbGeoRepresentation error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_get_att_text(mb_io_ptr->ncid, NC_GLOBAL, "mbGeodesicSystem", store->mbGeodesicSystem);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbGeodesicSystem error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_get_att_text(mb_io_ptr->ncid, NC_GLOBAL, "mbEllipsoidName", store->mbEllipsoidName);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbEllipsoidName error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_get_att_double(mb_io_ptr->ncid, NC_GLOBAL, "mbEllipsoidA", &store->mbEllipsoidA);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbEllipsoidA error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_get_att_double(mb_io_ptr->ncid, NC_GLOBAL, "mbEllipsoidInvF", &store->mbEllipsoidInvF);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbEllipsoidInvF error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_get_att_double(mb_io_ptr->ncid, NC_GLOBAL, "mbEllipsoidE2", &store->mbEllipsoidE2);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbEllipsoidE2 error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_get_att_short(mb_io_ptr->ncid, NC_GLOBAL, "mbProjType", &store->mbProjType);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbProjType error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_get_att_double(mb_io_ptr->ncid, NC_GLOBAL, "mbProjParameterValue", &store->mbProjParameterValue[0]);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbProjParameterValue error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_get_att_text(mb_io_ptr->ncid, NC_GLOBAL, "mbProjParameterCode", store->mbProjParameterCode);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbProjParameterCode error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_get_att_text(mb_io_ptr->ncid, NC_GLOBAL, "mbShip", store->mbShip);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbShip error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_get_att_text(mb_io_ptr->ncid, NC_GLOBAL, "mbSurvey", store->mbSurvey);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSurvey error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_get_att_text(mb_io_ptr->ncid, NC_GLOBAL, "mbReference", store->mbReference);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbReference error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_get_att_int(mb_io_ptr->ncid, NC_GLOBAL, "mbPointCounter", &store->mbPointCounter);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbPointCounter error: %s\n", nc_strerror(nc_status));
-		if (nc_status != NC_NOERR)
-		    {
-		    status = MB_FAILURE;
-		    *error = MB_ERROR_EOF;
-		    }
-
-		/* print input debug statements */
-		if (verbose >= 2)
-		    {
-		    fprintf(stderr,"\ndbg2  NetCDF global attributes read in function <%s>\n",
-			    function_name);
-		    fprintf(stderr,"dbg2  Global attributes:\n");
-		    fprintf(stderr,"dbg2       status:                  %d\n", status);
-		    fprintf(stderr,"dbg2       error:                   %d\n", *error);
-		    fprintf(stderr,"dbg2       nc_status:             %d\n", nc_status);
-		    fprintf(stderr,"dbg2       mbVersion:             %d\n", store->mbVersion);
-		    fprintf(stderr,"dbg2       mbName:                %s\n", store->mbName);
-		    fprintf(stderr,"dbg2       mbClasse:              %s\n", store->mbClasse);
-		    fprintf(stderr,"dbg2       mbLevel:               %d\n", store->mbLevel);
-		    fprintf(stderr,"dbg2       mbNbrHistoryRec:       %d\n", store->mbNbrHistoryRec);
-		    fprintf(stderr,"dbg2       mbTimeReference:       %s\n", store->mbTimeReference);
-		    fprintf(stderr,"dbg2       mbStartDate:           %d\n", store->mbStartDate);
-		    fprintf(stderr,"dbg2       mbStartTime:           %d\n", store->mbStartTime);
-		    fprintf(stderr,"dbg2       mbEndDate:             %d\n", store->mbEndDate);
-		    fprintf(stderr,"dbg2       mbEndTime:             %d\n", store->mbEndTime);
-		    fprintf(stderr,"dbg2       mbNorthLatitude:       %f\n", store->mbNorthLatitude);
-		    fprintf(stderr,"dbg2       mbSouthLatitude:       %f\n", store->mbSouthLatitude);
-		    fprintf(stderr,"dbg2       mbEastLongitude:       %f\n", store->mbEastLongitude);
-		    fprintf(stderr,"dbg2       mbWestLongitude:       %f\n", store->mbWestLongitude);
-		    fprintf(stderr,"dbg2       mbMeridian180:         %s\n", store->mbMeridian180);
-		    fprintf(stderr,"dbg2       mbGeoDictionnary:      %s\n", store->mbGeoDictionnary);
-		    fprintf(stderr,"dbg2       mbGeoRepresentation:   %s\n", store->mbGeoRepresentation);
-		    fprintf(stderr,"dbg2       mbGeodesicSystem:      %s\n", store->mbGeodesicSystem);
-		    fprintf(stderr,"dbg2       mbEllipsoidName:       %s\n", store->mbEllipsoidName);
-		    fprintf(stderr,"dbg2       mbEllipsoidA:          %f\n", store->mbEllipsoidA);
-		    fprintf(stderr,"dbg2       mbEllipsoidInvF:       %f\n", store->mbEllipsoidInvF);
-		    fprintf(stderr,"dbg2       mbEllipsoidE2:         %f\n", store->mbEllipsoidE2);
-		    fprintf(stderr,"dbg2       mbProjType:            %d\n", store->mbProjType);
-		    for (i=0;i<10;i++)
-			fprintf(stderr,"dbg2       mbProjParameterValue[%d]:%f\n", i, store->mbProjParameterValue[i]);
-		    fprintf(stderr,"dbg2       mbProjParameterCode:   %s\n", store->mbProjParameterCode);
-		    fprintf(stderr,"dbg2       mbShip:                %s\n", store->mbShip);
-		    fprintf(stderr,"dbg2       mbSurvey:              %s\n", store->mbSurvey);
-		    fprintf(stderr,"dbg2       mbReference:           %s\n", store->mbReference);
-		    fprintf(stderr,"dbg2       mbPointCounter:        %d\n", store->mbPointCounter);
-		    }
-		}
-
-	    /* get variable IDs */
-	    if (status == MB_SUCCESS)
-		{
-		nc_status = nc_inq_varid(mb_io_ptr->ncid, "mbHistDate", &store->mbHistDate_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_inq_varid mbHistDate_id error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_inq_varid(mb_io_ptr->ncid, "mbHistTime", &store->mbHistTime_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_inq_varid mbHistTime_id error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_inq_varid(mb_io_ptr->ncid, "mbHistCode", &store->mbHistCode_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_inq_varid mbHistCode_id error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_inq_varid(mb_io_ptr->ncid, "mbHistAutor", &store->mbHistAutor_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_inq_varid mbHistAutor_id error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_inq_varid(mb_io_ptr->ncid, "mbHistModule", &store->mbHistModule_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_inq_varid mbHistModule_id error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_inq_varid(mb_io_ptr->ncid, "mbHistComment", &store->mbHistComment_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_inq_varid mbHistComment_id error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_inq_varid(mb_io_ptr->ncid, "mbDate", &store->mbDate_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_inq_varid mbDate_id error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_inq_varid(mb_io_ptr->ncid, "mbTime", &store->mbTime_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_inq_varid mbTime_id error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_inq_varid(mb_io_ptr->ncid, "mbOrdinate", &store->mbOrdinate_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_inq_varid mbOrdinate_id error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_inq_varid(mb_io_ptr->ncid, "mbAbscissa", &store->mbAbscissa_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_inq_varid mbAbscissa_id error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_inq_varid(mb_io_ptr->ncid, "mbAltitude", &store->mbAltitude_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_inq_varid mbAltitude_id error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_inq_varid(mb_io_ptr->ncid, "mbImmersion", &store->mbImmersion_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_inq_varid mbImmersion_id error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_inq_varid(mb_io_ptr->ncid, "mbHeading", &store->mbHeading_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_inq_varid mbHeading_id error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_inq_varid(mb_io_ptr->ncid, "mbSpeed", &store->mbSpeed_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_inq_varid mbSpeed_id error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_inq_varid(mb_io_ptr->ncid, "mbPType", &store->mbPType_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_inq_varid mbPType_id error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_inq_varid(mb_io_ptr->ncid, "mbPQuality", &store->mbPQuality_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_inq_varid mbPQuality_id error: %s\n", nc_strerror(nc_status));
-		nc_status = nc_inq_varid(mb_io_ptr->ncid, "mbPFlag", &store->mbPFlag_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_inq_varid mbPFlag_id error: %s\n", nc_strerror(nc_status));
-		if (nc_status != NC_NOERR)
-		    {
-		    status = MB_FAILURE;
-		    *error = MB_ERROR_EOF;
-		    }
-
-		/* print input debug statements */
-		if (verbose >= 2)
-		    {
-		    fprintf(stderr,"\ndbg2  NetCDF variable ids read in function <%s>\n",
-			    function_name);
-		    fprintf(stderr,"dbg2  Variable ids:\n");
-		    fprintf(stderr,"dbg2       status:                  %d\n", status);
-		    fprintf(stderr,"dbg2       error:                   %d\n", *error);
-		    fprintf(stderr,"dbg2       nc_status:               %d\n", nc_status);
-		    fprintf(stderr,"dbg2       mbHistDate_id:           %d\n", store->mbHistDate_id);
-		    fprintf(stderr,"dbg2       mbHistTime_id:           %d\n", store->mbHistTime_id);
-		    fprintf(stderr,"dbg2       mbHistCode_id:           %d\n", store->mbHistCode_id);
-		    fprintf(stderr,"dbg2       mbHistAutor_id:          %d\n", store->mbHistAutor_id);
-		    fprintf(stderr,"dbg2       mbHistModule_id:         %d\n", store->mbHistModule_id);
-		    fprintf(stderr,"dbg2       mbHistComment_id:        %d\n", store->mbHistComment_id);
-		    fprintf(stderr,"dbg2       mbDate_id:               %d\n", store->mbDate_id);
-		    fprintf(stderr,"dbg2       mbTime_id:               %d\n", store->mbTime_id);
-		    fprintf(stderr,"dbg2       mbOrdinate_id:           %d\n", store->mbOrdinate_id);
-		    fprintf(stderr,"dbg2       mbAbscissa_id:           %d\n", store->mbAbscissa_id);
-		    fprintf(stderr,"dbg2       mbAltitude_id:           %d\n", store->mbAltitude_id);
-		    fprintf(stderr,"dbg2       mbImmersion_id:          %d\n", store->mbImmersion_id);
-		    fprintf(stderr,"dbg2       mbHeading_id:            %d\n", store->mbHeading_id);
-		    fprintf(stderr,"dbg2       mbSpeed_id:              %d\n", store->mbSpeed_id);
-		    fprintf(stderr,"dbg2       mbPType_id:              %d\n", store->mbPType_id);
-		    fprintf(stderr,"dbg2       mbPQuality_id:           %d\n", store->mbPQuality_id);
-		    fprintf(stderr,"dbg2       mbPFlag_id:              %d\n", store->mbPFlag_id);
-		    }
-		}
-
-	    /* allocate memory for variables */
-	    if (status == MB_SUCCESS)
-		{
-		status = mb_mallocd(verbose,__FILE__,__LINE__,
-			    store->mbHistoryRecNbr * sizeof(int),
-			    (void **)&store->mbHistDate,error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,
-			    store->mbHistoryRecNbr * sizeof(int),
-			    (void **)&store->mbHistTime,error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,
-			    store->mbHistoryRecNbr * sizeof(char),
-			    (void **)&store->mbHistCode,error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,
-			    store->mbHistoryRecNbr * store->mbNameLength * sizeof(char),
-			    (void **)&store->mbHistAutor,error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,
-			    store->mbHistoryRecNbr * store->mbNameLength * sizeof(char),
-			    (void **)&store->mbHistModule,error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,
-			    store->mbHistoryRecNbr * store->mbCommentLength * sizeof(char),
-			    (void **)&store->mbHistComment,error);
-
-		/* deal with a memory allocation failure */
-		if (status == MB_FAILURE)
-		    {
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **) &store->mbHistDate, error);
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **) &store->mbHistTime, error);
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **) &store->mbHistCode, error);
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **) &store->mbHistAutor, error);
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **) &store->mbHistModule, error);
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **) &store->mbHistComment, error);
-		    status = MB_FAILURE;
-		    *error = MB_ERROR_MEMORY_FAIL;
-		    if (verbose >= 2)
-			    {
-			    fprintf(stderr,"\ndbg2  MBIO function <%s> terminated with error\n",function_name);
-			    fprintf(stderr,"dbg2  Return values:\n");
-			    fprintf(stderr,"dbg2       error:      %d\n",*error);
-			    fprintf(stderr,"dbg2  Return status:\n");
-			    fprintf(stderr,"dbg2       status:  %d\n",status);
-			    }
-		    return(status);
-		    }
-		}
-
-	    /* read variable attributes */
-	    if (status == MB_SUCCESS)
-		{
-		if (store->mbHistDate_id >= 0)
-		    {
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbHistDate_id, "type", store->mbHistDate_type);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHistDate_type error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbHistDate_id, "long_name", store->mbHistDate_long_name);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHistDate_long_name error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbHistDate_id, "name_code", store->mbHistDate_name_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHistDate_name_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbHistDate_id, "units", store->mbHistDate_units);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHistDate_units error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbHistDate_id, "unit_code", store->mbHistDate_unit_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHistDate_unit_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbHistDate_id, "add_offset", &store->mbHistDate_add_offset);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHistDate_add_offset error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbHistDate_id, "scale_factor", &store->mbHistDate_scale_factor);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHistDate_scale_factor error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbHistDate_id, "minimum", &store->mbHistDate_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHistDate_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbHistDate_id, "maximum", &store->mbHistDate_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHistDate_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbHistDate_id, "valid_minimum", &store->mbHistDate_valid_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHistDate_valid_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbHistDate_id, "valid_maximum", &store->mbHistDate_valid_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHistDate_valid_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbHistDate_id, "missing_value", &store->mbHistDate_missing_value);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHistDate_missing_value error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbHistDate_id, "format_C", store->mbHistDate_format_C);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHistDate_format_C error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbHistDate_id, "orientation", store->mbHistDate_orientation);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHistDate_orientation error: %s\n", nc_strerror(nc_status));
-		    }
-		if (store->mbHistTime_id >= 0)
-		    {
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbHistTime_id, "type", store->mbHistTime_type);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHistTime_type error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbHistTime_id, "long_name", store->mbHistTime_long_name);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHistTime_long_name error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbHistTime_id, "name_code", store->mbHistTime_name_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHistTime_name_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbHistTime_id, "units", store->mbHistTime_units);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHistTime_units error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbHistTime_id, "unit_code", store->mbHistTime_unit_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHistTime_unit_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbHistTime_id, "add_offset", &store->mbHistTime_add_offset);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHistTime_add_offset error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbHistTime_id, "scale_factor", &store->mbHistTime_scale_factor);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHistTime_scale_factor error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbHistTime_id, "minimum", &store->mbHistTime_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHistTime_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbHistTime_id, "maximum", &store->mbHistTime_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHistTime_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbHistTime_id, "valid_minimum", &store->mbHistTime_valid_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHistTime_valid_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbHistTime_id, "valid_maximum", &store->mbHistTime_valid_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHistTime_valid_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbHistTime_id, "missing_value", &store->mbHistTime_missing_value);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHistTime_missing_value error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbHistTime_id, "format_C", store->mbHistTime_format_C);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHistTime_format_C error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbHistTime_id, "orientation", store->mbHistTime_orientation);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHistTime_orientation error: %s\n", nc_strerror(nc_status));
-		    }
-		if (store->mbHistCode_id >= 0)
-		    {
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbHistCode_id, "type", store->mbHistCode_type);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHistCode_type error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbHistCode_id, "long_name", store->mbHistCode_long_name);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHistCode_long_name error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbHistCode_id, "name_code", store->mbHistCode_name_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHistCode_name_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbHistCode_id, "units", store->mbHistCode_units);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHistCode_units error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbHistCode_id, "unit_code", store->mbHistCode_unit_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHistCode_unit_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbHistCode_id, "add_offset", &store->mbHistCode_add_offset);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHistCode_add_offset error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbHistCode_id, "scale_factor", &store->mbHistCode_scale_factor);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHistCode_scale_factor error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbHistCode_id, "minimum", &store->mbHistCode_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHistCode_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbHistCode_id, "maximum", &store->mbHistCode_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHistCode_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbHistCode_id, "valid_minimum", &store->mbHistCode_valid_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHistCode_valid_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbHistCode_id, "valid_maximum", &store->mbHistCode_valid_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHistCode_valid_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbHistCode_id, "missing_value", &store->mbHistCode_missing_value);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHistCode_missing_value error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbHistCode_id, "format_C", store->mbHistCode_format_C);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHistCode_format_C error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbHistCode_id, "orientation", store->mbHistCode_orientation);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHistCode_orientation error: %s\n", nc_strerror(nc_status));
-		    }
-		if (store->mbHistAutor_id >= 0)
-		    {
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbHistAutor_id, "type", store->mbHistAutor_type);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHistAutor_type error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbHistAutor_id, "long_name", store->mbHistAutor_long_name);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHistAutor_long_name error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbHistAutor_id, "name_code", store->mbHistAutor_name_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHistAutor_name_code error: %s\n", nc_strerror(nc_status));
-		    }
-		if (store->mbHistModule_id >= 0)
-		    {
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbHistModule_id, "type", store->mbHistModule_type);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHistModule_type error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbHistModule_id, "long_name", store->mbHistModule_long_name);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHistModule_long_name error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbHistModule_id, "name_code", store->mbHistModule_name_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHistModule_name_code error: %s\n", nc_strerror(nc_status));
-		    }
-		if (store->mbHistComment_id >= 0)
-		    {
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbHistComment_id, "type", store->mbHistComment_type);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHistComment_type error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbHistComment_id, "long_name", store->mbHistComment_long_name);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHistComment_long_name error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbHistComment_id, "name_code", store->mbHistComment_name_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHistComment_name_code error: %s\n", nc_strerror(nc_status));
-		    }
-		if (store->mbDate_id >= 0)
-		    {
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbDate_id, "type", store->mbDate_type);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbDate_type error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbDate_id, "long_name", store->mbDate_long_name);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbDate_long_name error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbDate_id, "name_code", store->mbDate_name_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbDate_name_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbDate_id, "units", store->mbDate_units);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbDate_units error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbDate_id, "unit_code", store->mbDate_unit_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbDate_unit_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbDate_id, "add_offset", &store->mbDate_add_offset);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbDate_add_offset error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbDate_id, "scale_factor", &store->mbDate_scale_factor);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbDate_scale_factor error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbDate_id, "minimum", &store->mbDate_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbDate_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbDate_id, "maximum", &store->mbDate_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbDate_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbDate_id, "valid_minimum", &store->mbDate_valid_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbDate_valid_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbDate_id, "valid_maximum", &store->mbDate_valid_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbDate_valid_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbDate_id, "missing_value", &store->mbDate_missing_value);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbDate_missing_value error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbDate_id, "format_C", store->mbDate_format_C);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbDate_format_C error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbDate_id, "orientation", store->mbDate_orientation);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbDate_orientation error: %s\n", nc_strerror(nc_status));
-		    }
-		if (store->mbTime_id >= 0)
-		    {
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbTime_id, "type", store->mbTime_type);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbTime_type error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbTime_id, "long_name", store->mbTime_long_name);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbTime_long_name error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbTime_id, "name_code", store->mbTime_name_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbTime_name_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbTime_id, "units", store->mbTime_units);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbTime_units error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbTime_id, "unit_code", store->mbTime_unit_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbTime_unit_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbTime_id, "add_offset", &store->mbTime_add_offset);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbTime_add_offset error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbTime_id, "scale_factor", &store->mbTime_scale_factor);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbTime_scale_factor error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbTime_id, "minimum", &store->mbTime_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbTime_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbTime_id, "maximum", &store->mbTime_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbTime_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbTime_id, "valid_minimum", &store->mbTime_valid_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbTime_valid_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbTime_id, "valid_maximum", &store->mbTime_valid_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbTime_valid_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbTime_id, "missing_value", &store->mbTime_missing_value);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbTime_missing_value error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbTime_id, "format_C", store->mbTime_format_C);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbTime_format_C error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbTime_id, "orientation", store->mbTime_orientation);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbTime_orientation error: %s\n", nc_strerror(nc_status));
-		    }
-		if (store->mbOrdinate_id >= 0)
-		    {
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbOrdinate_id, "type", store->mbOrdinate_type);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbOrdinate_type error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbOrdinate_id, "long_name", store->mbOrdinate_long_name);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbOrdinate_long_name error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbOrdinate_id, "name_code", store->mbOrdinate_name_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbOrdinate_name_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbOrdinate_id, "units", store->mbOrdinate_units);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbOrdinate_units error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbOrdinate_id, "unit_code", store->mbOrdinate_unit_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbOrdinate_unit_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_double(mb_io_ptr->ncid, store->mbOrdinate_id, "add_offset", &store->mbOrdinate_add_offset);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbOrdinate_add_offset error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_double(mb_io_ptr->ncid, store->mbOrdinate_id, "scale_factor", &store->mbOrdinate_scale_factor);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbOrdinate_scale_factor error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbOrdinate_id, "minimum", &store->mbOrdinate_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbOrdinate_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbOrdinate_id, "maximum", &store->mbOrdinate_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbOrdinate_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbOrdinate_id, "valid_minimum", &store->mbOrdinate_valid_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbOrdinate_valid_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbOrdinate_id, "valid_maximum", &store->mbOrdinate_valid_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbOrdinate_valid_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbOrdinate_id, "missing_value", &store->mbOrdinate_missing_value);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbOrdinate_missing_value error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbOrdinate_id, "format_C", store->mbOrdinate_format_C);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbOrdinate_format_C error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbOrdinate_id, "orientation", store->mbOrdinate_orientation);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbOrdinate_orientation error: %s\n", nc_strerror(nc_status));
-		    }
-		if (store->mbAbscissa_id >= 0)
-		    {
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbAbscissa_id, "type", store->mbAbscissa_type);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAbscissa_type error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbAbscissa_id, "long_name", store->mbAbscissa_long_name);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAbscissa_long_name error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbAbscissa_id, "name_code", store->mbAbscissa_name_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAbscissa_name_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbAbscissa_id, "units", store->mbAbscissa_units);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAbscissa_units error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbAbscissa_id, "unit_code", store->mbAbscissa_unit_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAbscissa_unit_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_double(mb_io_ptr->ncid, store->mbAbscissa_id, "add_offset", &store->mbAbscissa_add_offset);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAbscissa_add_offset error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_double(mb_io_ptr->ncid, store->mbAbscissa_id, "scale_factor", &store->mbAbscissa_scale_factor);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAbscissa_scale_factor error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbAbscissa_id, "minimum", &store->mbAbscissa_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAbscissa_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbAbscissa_id, "maximum", &store->mbAbscissa_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAbscissa_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbAbscissa_id, "valid_minimum", &store->mbAbscissa_valid_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAbscissa_valid_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbAbscissa_id, "valid_maximum", &store->mbAbscissa_valid_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAbscissa_valid_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbAbscissa_id, "missing_value", &store->mbAbscissa_missing_value);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAbscissa_missing_value error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbAbscissa_id, "format_C", store->mbAbscissa_format_C);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAbscissa_format_C error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbAbscissa_id, "orientation", store->mbAbscissa_orientation);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAbscissa_orientation error: %s\n", nc_strerror(nc_status));
-		    }
-		if (store->mbAltitude_id >= 0)
-		    {
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbAltitude_id, "type", store->mbAltitude_type);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAltitude_type error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbAltitude_id, "long_name", store->mbAltitude_long_name);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAltitude_long_name error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbAltitude_id, "name_code", store->mbAltitude_name_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAltitude_name_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbAltitude_id, "units", store->mbAltitude_units);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAltitude_units error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbAltitude_id, "unit_code", store->mbAltitude_unit_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAltitude_unit_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_double(mb_io_ptr->ncid, store->mbAltitude_id, "add_offset", &store->mbAltitude_add_offset);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAltitude_add_offset error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_double(mb_io_ptr->ncid, store->mbAltitude_id, "scale_factor", &store->mbAltitude_scale_factor);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAltitude_scale_factor error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbAltitude_id, "minimum", &store->mbAltitude_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAltitude_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbAltitude_id, "maximum", &store->mbAltitude_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAltitude_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbAltitude_id, "valid_minimum", &store->mbAltitude_valid_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAltitude_valid_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbAltitude_id, "valid_maximum", &store->mbAltitude_valid_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAltitude_valid_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbAltitude_id, "missing_value", &store->mbAltitude_missing_value);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAltitude_missing_value error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbAltitude_id, "format_C", store->mbAltitude_format_C);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAltitude_format_C error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbAltitude_id, "orientation", store->mbAltitude_orientation);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbAltitude_orientation error: %s\n", nc_strerror(nc_status));
-		    }
-		if (store->mbImmersion_id >= 0)
-		    {
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbImmersion_id, "type", store->mbImmersion_type);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbImmersion_type error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbImmersion_id, "long_name", store->mbImmersion_long_name);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbImmersion_long_name error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbImmersion_id, "name_code", store->mbImmersion_name_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbImmersion_name_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbImmersion_id, "units", store->mbImmersion_units);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbImmersion_units error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbImmersion_id, "unit_code", store->mbImmersion_unit_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbImmersion_unit_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_double(mb_io_ptr->ncid, store->mbImmersion_id, "add_offset", &store->mbImmersion_add_offset);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbImmersion_add_offset error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_double(mb_io_ptr->ncid, store->mbImmersion_id, "scale_factor", &store->mbImmersion_scale_factor);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbImmersion_scale_factor error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbImmersion_id, "minimum", &store->mbImmersion_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbImmersion_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbImmersion_id, "maximum", &store->mbImmersion_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbImmersion_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbImmersion_id, "valid_minimum", &store->mbImmersion_valid_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbImmersion_valid_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbImmersion_id, "valid_maximum", &store->mbImmersion_valid_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbImmersion_valid_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbImmersion_id, "missing_value", &store->mbImmersion_missing_value);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbImmersion_missing_value error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbImmersion_id, "format_C", store->mbImmersion_format_C);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbImmersion_format_C error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbImmersion_id, "orientation", store->mbImmersion_orientation);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbImmersion_orientation error: %s\n", nc_strerror(nc_status));
-		    }
-		if (store->mbHeading_id >= 0)
-		    {
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbHeading_id, "type", store->mbHeading_type);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHeading_type error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbHeading_id, "long_name", store->mbHeading_long_name);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHeading_long_name error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbHeading_id, "name_code", store->mbHeading_name_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHeading_name_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbHeading_id, "units", store->mbHeading_units);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHeading_units error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbHeading_id, "unit_code", store->mbHeading_unit_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHeading_unit_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_double(mb_io_ptr->ncid, store->mbHeading_id, "add_offset", &store->mbHeading_add_offset);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHeading_add_offset error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_double(mb_io_ptr->ncid, store->mbHeading_id, "scale_factor", &store->mbHeading_scale_factor);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHeading_scale_factor error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbHeading_id, "minimum", &store->mbHeading_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHeading_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbHeading_id, "maximum", &store->mbHeading_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHeading_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbHeading_id, "valid_minimum", &store->mbHeading_valid_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHeading_valid_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbHeading_id, "valid_maximum", &store->mbHeading_valid_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHeading_valid_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbHeading_id, "missing_value", &store->mbHeading_missing_value);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHeading_missing_value error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbHeading_id, "format_C", store->mbHeading_format_C);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHeading_format_C error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbHeading_id, "orientation", store->mbHeading_orientation);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbHeading_orientation error: %s\n", nc_strerror(nc_status));
-		    }
-		if (store->mbSpeed_id >= 0)
-		    {
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbSpeed_id, "type", store->mbSpeed_type);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSpeed_type error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbSpeed_id, "long_name", store->mbSpeed_long_name);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSpeed_long_name error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbSpeed_id, "name_code", store->mbSpeed_name_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSpeed_name_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbSpeed_id, "units", store->mbSpeed_units);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSpeed_units error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbSpeed_id, "unit_code", store->mbSpeed_unit_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSpeed_unit_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_double(mb_io_ptr->ncid, store->mbSpeed_id, "add_offset", &store->mbSpeed_add_offset);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSpeed_add_offset error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_double(mb_io_ptr->ncid, store->mbSpeed_id, "scale_factor", &store->mbSpeed_scale_factor);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSpeed_scale_factor error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbSpeed_id, "minimum", &store->mbSpeed_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSpeed_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbSpeed_id, "maximum", &store->mbSpeed_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSpeed_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbSpeed_id, "valid_minimum", &store->mbSpeed_valid_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSpeed_valid_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbSpeed_id, "valid_maximum", &store->mbSpeed_valid_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSpeed_valid_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbSpeed_id, "missing_value", &store->mbSpeed_missing_value);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSpeed_missing_value error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbSpeed_id, "format_C", store->mbSpeed_format_C);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSpeed_format_C error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbSpeed_id, "orientation", store->mbSpeed_orientation);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbSpeed_orientation error: %s\n", nc_strerror(nc_status));
-		    }
-		if (store->mbPType_id >= 0)
-		    {
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbPType_id, "type", store->mbPType_type);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbPType_type error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbPType_id, "long_name", store->mbPType_long_name);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbPType_long_name error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbPType_id, "name_code", store->mbPType_name_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbPType_name_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbPType_id, "units", store->mbPType_units);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbPType_units error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbPType_id, "unit_code", store->mbPType_unit_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbPType_unit_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbPType_id, "add_offset", &store->mbPType_add_offset);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbPType_add_offset error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbPType_id, "scale_factor", &store->mbPType_scale_factor);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbPType_scale_factor error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbPType_id, "minimum", &store->mbPType_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbPType_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbPType_id, "maximum", &store->mbPType_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbPType_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbPType_id, "valid_minimum", &store->mbPType_valid_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbPType_valid_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbPType_id, "valid_maximum", &store->mbPType_valid_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbPType_valid_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbPType_id, "missing_value", &store->mbPType_missing_value);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbPType_missing_value error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbPType_id, "format_C", store->mbPType_format_C);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbPType_format_C error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbPType_id, "orientation", store->mbPType_orientation);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbPType_orientation error: %s\n", nc_strerror(nc_status));
-		    }
-		if (store->mbPQuality_id >= 0)
-		    {
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbPQuality_id, "type", store->mbPQuality_type);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbPQuality_type error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbPQuality_id, "long_name", store->mbPQuality_long_name);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbPQuality_long_name error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbPQuality_id, "name_code", store->mbPQuality_name_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbPQuality_name_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbPQuality_id, "units", store->mbPQuality_units);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbPQuality_units error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbPQuality_id, "unit_code", store->mbPQuality_unit_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbPQuality_unit_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbPQuality_id, "add_offset", &store->mbPQuality_add_offset);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbPQuality_add_offset error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbPQuality_id, "scale_factor", &store->mbPQuality_scale_factor);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbPQuality_scale_factor error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbPQuality_id, "minimum", &store->mbPQuality_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbPQuality_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbPQuality_id, "maximum", &store->mbPQuality_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbPQuality_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbPQuality_id, "valid_minimum", &store->mbPQuality_valid_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbPQuality_valid_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbPQuality_id, "valid_maximum", &store->mbPQuality_valid_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbPQuality_valid_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbPQuality_id, "missing_value", &store->mbPQuality_missing_value);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbPQuality_missing_value error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbPQuality_id, "format_C", store->mbPQuality_format_C);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbPQuality_format_C error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbPQuality_id, "orientation", store->mbPQuality_orientation);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbPQuality_orientation error: %s\n", nc_strerror(nc_status));
-		    }
-		if (store->mbPFlag_id >= 0)
-		    {
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbPFlag_id, "type", store->mbPFlag_type);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbPFlag_type error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbPFlag_id, "long_name", store->mbPFlag_long_name);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbPFlag_long_name error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbPFlag_id, "name_code", store->mbPFlag_name_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbPFlag_name_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbPFlag_id, "units", store->mbPFlag_units);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbPFlag_units error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbPFlag_id, "unit_code", store->mbPFlag_unit_code);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbPFlag_unit_code error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbPFlag_id, "add_offset", &store->mbPFlag_add_offset);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbPFlag_add_offset error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbPFlag_id, "scale_factor", &store->mbPFlag_scale_factor);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbPFlag_scale_factor error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbPFlag_id, "minimum", &store->mbPFlag_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbPFlag_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbPFlag_id, "maximum", &store->mbPFlag_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbPFlag_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbPFlag_id, "valid_minimum", &store->mbPFlag_valid_minimum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbPFlag_valid_minimum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbPFlag_id, "valid_maximum", &store->mbPFlag_valid_maximum);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbPFlag_valid_maximum error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_int(mb_io_ptr->ncid, store->mbPFlag_id, "missing_value", &store->mbPFlag_missing_value);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbPFlag_missing_value error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbPFlag_id, "format_C", store->mbPFlag_format_C);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbPFlag_format_C error: %s\n", nc_strerror(nc_status));
-		    nc_status = nc_get_att_text(mb_io_ptr->ncid, store->mbPFlag_id, "orientation", store->mbPFlag_orientation);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_att mbPFlag_orientation error: %s\n", nc_strerror(nc_status));
-		    }
-		if (nc_status != NC_NOERR)
-		    {
-		    status = MB_FAILURE;
-		    *error = MB_ERROR_EOF;
-		    }
-
-		/* print input debug statements */
-		if (verbose >= 2)
-		    {
-		    fprintf(stderr,"\ndbg2  NetCDF variable attributes read in function <%s>\n",
-			    function_name);
-		    fprintf(stderr,"dbg2  Variable attributes:\n");
-		    fprintf(stderr,"dbg2       status:				%d\n", status);
-		    fprintf(stderr,"dbg2       error:				%d\n", *error);
-		    fprintf(stderr,"dbg2       nc_status:			%d\n", nc_status);
-		    fprintf(stderr,"dbg2       mbHistCode_long_name:		%s\n", store->mbHistCode_long_name);
-		    fprintf(stderr,"dbg2       mbHistCode_name_code:		%s\n", store->mbHistCode_name_code);
-		    fprintf(stderr,"dbg2       mbHistCode_units:		%s\n", store->mbHistCode_units);
-		    fprintf(stderr,"dbg2       mbHistCode_unit_code:		%s\n", store->mbHistCode_unit_code);
-		    fprintf(stderr,"dbg2       mbHistCode_add_offset:		%d\n", store->mbHistCode_add_offset);
-		    fprintf(stderr,"dbg2       mbHistCode_scale_factor:		%d\n", store->mbHistCode_scale_factor);
-		    fprintf(stderr,"dbg2       mbHistCode_minimum:		%d\n", store->mbHistCode_minimum);
-		    fprintf(stderr,"dbg2       mbHistCode_maximum:		%d\n", store->mbHistCode_maximum);
-		    fprintf(stderr,"dbg2       mbHistCode_valid_minimum:	%d\n", store->mbHistCode_valid_minimum);
-		    fprintf(stderr,"dbg2       mbHistCode_valid_maximum:	%d\n", store->mbHistCode_valid_maximum);
-		    fprintf(stderr,"dbg2       mbHistCode_missing_value:	%d\n", store->mbHistCode_missing_value);
-		    fprintf(stderr,"dbg2       mbHistCode_format_C:		%s\n", store->mbHistCode_format_C);
-		    fprintf(stderr,"dbg2       mbHistCode_orientation:		%s\n", store->mbHistCode_orientation);
-		    fprintf(stderr,"dbg2       mbHistAutor_type:		%s\n", store->mbHistAutor_type);
-		    fprintf(stderr,"dbg2       mbHistAutor_long_name:		%s\n", store->mbHistAutor_long_name);
-		    fprintf(stderr,"dbg2       mbHistAutor_name_code:		%s\n", store->mbHistAutor_name_code);
-		    fprintf(stderr,"dbg2       mbHistModule_type:		%s\n", store->mbHistModule_type);
-		    fprintf(stderr,"dbg2       mbHistModule_long_name:		%s\n", store->mbHistModule_long_name);
-		    fprintf(stderr,"dbg2       mbHistModule_name_code:		%s\n", store->mbHistModule_name_code);
-		    fprintf(stderr,"dbg2       mbHistComment_type:		%s\n", store->mbHistComment_type);
-		    fprintf(stderr,"dbg2       mbHistComment_long_name:		%s\n", store->mbHistComment_long_name);
-		    fprintf(stderr,"dbg2       mbHistComment_name_code:		%s\n", store->mbHistComment_name_code);
-		    fprintf(stderr,"dbg2       mbDate_type:			%s\n", store->mbDate_type);
-		    fprintf(stderr,"dbg2       mbDate_long_name:		%s\n", store->mbDate_long_name);
-		    fprintf(stderr,"dbg2       mbDate_name_code:		%s\n", store->mbDate_name_code);
-		    fprintf(stderr,"dbg2       mbDate_units:			%s\n", store->mbDate_units);
-		    fprintf(stderr,"dbg2       mbDate_unit_code:		%s\n", store->mbDate_unit_code);
-		    fprintf(stderr,"dbg2       mbDate_add_offset:		%d\n", store->mbDate_add_offset);
-		    fprintf(stderr,"dbg2       mbDate_scale_factor:		%d\n", store->mbDate_scale_factor);
-		    fprintf(stderr,"dbg2       mbDate_minimum:			%d\n", store->mbDate_minimum);
-		    fprintf(stderr,"dbg2       mbDate_maximum:			%d\n", store->mbDate_maximum);
-		    fprintf(stderr,"dbg2       mbDate_valid_minimum:		%d\n", store->mbDate_valid_minimum);
-		    fprintf(stderr,"dbg2       mbDate_valid_maximum:		%d\n", store->mbDate_valid_maximum);
-		    fprintf(stderr,"dbg2       mbDate_missing_value:		%d\n", store->mbDate_missing_value);
-		    fprintf(stderr,"dbg2       mbDate_format_C:			%s\n", store->mbDate_format_C);
-		    fprintf(stderr,"dbg2       mbDate_orientation:		%s\n", store->mbDate_orientation);
-		    fprintf(stderr,"dbg2       mbTime_type:			%s\n", store->mbTime_type);
-		    fprintf(stderr,"dbg2       mbTime_long_name:		%s\n", store->mbTime_long_name);
-		    fprintf(stderr,"dbg2       mbTime_name_code:		%s\n", store->mbTime_name_code);
-		    fprintf(stderr,"dbg2       mbTime_units:			%s\n", store->mbTime_units);
-		    fprintf(stderr,"dbg2       mbTime_unit_code:		%s\n", store->mbTime_unit_code);
-		    fprintf(stderr,"dbg2       mbTime_add_offset:		%d\n", store->mbTime_add_offset);
-		    fprintf(stderr,"dbg2       mbTime_scale_factor:		%d\n", store->mbTime_scale_factor);
-		    fprintf(stderr,"dbg2       mbTime_minimum:			%d\n", store->mbTime_minimum);
-		    fprintf(stderr,"dbg2       mbTime_maximum:			%d\n", store->mbTime_maximum);
-		    fprintf(stderr,"dbg2       mbTime_valid_minimum:		%d\n", store->mbTime_valid_minimum);
-		    fprintf(stderr,"dbg2       mbTime_valid_maximum:		%d\n", store->mbTime_valid_maximum);
-		    fprintf(stderr,"dbg2       mbTime_missing_value:		%d\n", store->mbTime_missing_value);
-		    fprintf(stderr,"dbg2       mbTime_format_C:			%s\n", store->mbTime_format_C);
-		    fprintf(stderr,"dbg2       mbTime_orientation:		%s\n", store->mbTime_orientation);
-		    fprintf(stderr,"dbg2       mbOrdinate_type:			%s\n", store->mbOrdinate_type);
-		    fprintf(stderr,"dbg2       mbOrdinate_long_name:		%s\n", store->mbOrdinate_long_name);
-		    fprintf(stderr,"dbg2       mbOrdinate_name_code:		%s\n", store->mbOrdinate_name_code);
-		    fprintf(stderr,"dbg2       mbOrdinate_units:		%s\n", store->mbOrdinate_units);
-		    fprintf(stderr,"dbg2       mbOrdinate_unit_code:		%s\n", store->mbOrdinate_unit_code);
-		    fprintf(stderr,"dbg2       mbOrdinate_add_offset:		%f\n", store->mbOrdinate_add_offset);
-		    fprintf(stderr,"dbg2       mbOrdinate_scale_factor:		%f\n", store->mbOrdinate_scale_factor);
-		    fprintf(stderr,"dbg2       mbOrdinate_minimum:		%d\n", store->mbOrdinate_minimum);
-		    fprintf(stderr,"dbg2       mbOrdinate_maximum:		%d\n", store->mbOrdinate_maximum);
-		    fprintf(stderr,"dbg2       mbOrdinate_valid_minimum:	%d\n", store->mbOrdinate_valid_minimum);
-		    fprintf(stderr,"dbg2       mbOrdinate_valid_maximum:	%d\n", store->mbOrdinate_valid_maximum);
-		    fprintf(stderr,"dbg2       mbOrdinate_missing_value:	%d\n", store->mbOrdinate_missing_value);
-		    fprintf(stderr,"dbg2       mbOrdinate_format_C:		%s\n", store->mbOrdinate_format_C);
-		    fprintf(stderr,"dbg2       mbOrdinate_orientation:		%s\n", store->mbOrdinate_orientation);
-		    fprintf(stderr,"dbg2       mbAbscissa_type:			%s\n", store->mbAbscissa_type);
-		    fprintf(stderr,"dbg2       mbAbscissa_long_name:		%s\n", store->mbAbscissa_long_name);
-		    fprintf(stderr,"dbg2       mbAbscissa_name_code:		%s\n", store->mbAbscissa_name_code);
-		    fprintf(stderr,"dbg2       mbAbscissa_units:		%s\n", store->mbAbscissa_units);
-		    fprintf(stderr,"dbg2       mbAbscissa_unit_code:		%s\n", store->mbAbscissa_unit_code);
-		    fprintf(stderr,"dbg2       mbAbscissa_add_offset:		%f\n", store->mbAbscissa_add_offset);
-		    fprintf(stderr,"dbg2       mbAbscissa_scale_factor:		%f\n", store->mbAbscissa_scale_factor);
-		    fprintf(stderr,"dbg2       mbAbscissa_minimum:		%d\n", store->mbAbscissa_minimum);
-		    fprintf(stderr,"dbg2       mbAbscissa_maximum:		%d\n", store->mbAbscissa_maximum);
-		    fprintf(stderr,"dbg2       mbAbscissa_valid_minimum:	%d\n", store->mbAbscissa_valid_minimum);
-		    fprintf(stderr,"dbg2       mbAbscissa_valid_maximum:	%d\n", store->mbAbscissa_valid_maximum);
-		    fprintf(stderr,"dbg2       mbAbscissa_missing_value:	%d\n", store->mbAbscissa_missing_value);
-		    fprintf(stderr,"dbg2       mbAbscissa_format_C:		%s\n", store->mbAbscissa_format_C);
-		    fprintf(stderr,"dbg2       mbAbscissa_orientation:		%s\n", store->mbAbscissa_orientation);
-		    fprintf(stderr,"dbg2       mbAltitude_type:			%s\n", store->mbAltitude_type);
-		    fprintf(stderr,"dbg2       mbAltitude_long_name:		%s\n", store->mbAltitude_long_name);
-		    fprintf(stderr,"dbg2       mbAltitude_name_code:		%s\n", store->mbAltitude_name_code);
-		    fprintf(stderr,"dbg2       mbAltitude_units:		%s\n", store->mbAltitude_units);
-		    fprintf(stderr,"dbg2       mbAltitude_unit_code:		%s\n", store->mbAltitude_unit_code);
-		    fprintf(stderr,"dbg2       mbAltitude_add_offset:		%f\n", store->mbAltitude_add_offset);
-		    fprintf(stderr,"dbg2       mbAltitude_scale_factor:		%f\n", store->mbAltitude_scale_factor);
-		    fprintf(stderr,"dbg2       mbAltitude_minimum:		%d\n", store->mbAltitude_minimum);
-		    fprintf(stderr,"dbg2       mbAltitude_maximum:		%d\n", store->mbAltitude_maximum);
-		    fprintf(stderr,"dbg2       mbAltitude_valid_minimum:	%d\n", store->mbAltitude_valid_minimum);
-		    fprintf(stderr,"dbg2       mbAltitude_valid_maximum:	%d\n", store->mbAltitude_valid_maximum);
-		    fprintf(stderr,"dbg2       mbAltitude_missing_value:	%d\n", store->mbAltitude_missing_value);
-		    fprintf(stderr,"dbg2       mbAltitude_format_C:		%s\n", store->mbAltitude_format_C);
-		    fprintf(stderr,"dbg2       mbAltitude_orientation:		%s\n", store->mbAltitude_orientation);
-		    fprintf(stderr,"dbg2       mbImmersion_type:		%s\n", store->mbImmersion_type);
-		    fprintf(stderr,"dbg2       mbImmersion_long_name:		%s\n", store->mbImmersion_long_name);
-		    fprintf(stderr,"dbg2       mbImmersion_name_code:		%s\n", store->mbImmersion_name_code);
-		    fprintf(stderr,"dbg2       mbImmersion_units:		%s\n", store->mbImmersion_units);
-		    fprintf(stderr,"dbg2       mbImmersion_unit_code:		%s\n", store->mbImmersion_unit_code);
-		    fprintf(stderr,"dbg2       mbImmersion_add_offset:		%f\n", store->mbImmersion_add_offset);
-		    fprintf(stderr,"dbg2       mbImmersion_scale_factor:	%f\n", store->mbImmersion_scale_factor);
-		    fprintf(stderr,"dbg2       mbImmersion_minimum:		%d\n", store->mbImmersion_minimum);
-		    fprintf(stderr,"dbg2       mbImmersion_maximum:		%d\n", store->mbImmersion_maximum);
-		    fprintf(stderr,"dbg2       mbImmersion_valid_minimum:	%d\n", store->mbImmersion_valid_minimum);
-		    fprintf(stderr,"dbg2       mbImmersion_valid_maximum:	%d\n", store->mbImmersion_valid_maximum);
-		    fprintf(stderr,"dbg2       mbImmersion_missing_value:	%d\n", store->mbImmersion_missing_value);
-		    fprintf(stderr,"dbg2       mbImmersion_format_C:		%s\n", store->mbImmersion_format_C);
-		    fprintf(stderr,"dbg2       mbImmersion_orientation:		%s\n", store->mbImmersion_orientation);
-		    fprintf(stderr,"dbg2       mbHeading_type:			%s\n", store->mbHeading_type);
-		    fprintf(stderr,"dbg2       mbHeading_long_name:		%s\n", store->mbHeading_long_name);
-		    fprintf(stderr,"dbg2       mbHeading_name_code:		%s\n", store->mbHeading_name_code);
-		    fprintf(stderr,"dbg2       mbHeading_units:			%s\n", store->mbHeading_units);
-		    fprintf(stderr,"dbg2       mbHeading_unit_code:		%s\n", store->mbHeading_unit_code);
-		    fprintf(stderr,"dbg2       mbHeading_add_offset:		%f\n", store->mbHeading_add_offset);
-		    fprintf(stderr,"dbg2       mbHeading_scale_factor:		%f\n", store->mbHeading_scale_factor);
-		    fprintf(stderr,"dbg2       mbHeading_minimum:		%d\n", store->mbHeading_minimum);
-		    fprintf(stderr,"dbg2       mbHeading_maximum:		%d\n", store->mbHeading_maximum);
-		    fprintf(stderr,"dbg2       mbHeading_valid_minimum:		%d\n", store->mbHeading_valid_minimum);
-		    fprintf(stderr,"dbg2       mbHeading_valid_maximum:		%d\n", store->mbHeading_valid_maximum);
-		    fprintf(stderr,"dbg2       mbHeading_missing_value:		%d\n", store->mbHeading_missing_value);
-		    fprintf(stderr,"dbg2       mbHeading_format_C:		%s\n", store->mbHeading_format_C);
-		    fprintf(stderr,"dbg2       mbHeading_orientation:		%s\n", store->mbHeading_orientation);
-		    fprintf(stderr,"dbg2       mbSpeed_type:			%s\n", store->mbSpeed_type);
-		    fprintf(stderr,"dbg2       mbSpeed_long_name:		%s\n", store->mbSpeed_long_name);
-		    fprintf(stderr,"dbg2       mbSpeed_name_code:		%s\n", store->mbSpeed_name_code);
-		    fprintf(stderr,"dbg2       mbSpeed_units:			%s\n", store->mbSpeed_units);
-		    fprintf(stderr,"dbg2       mbSpeed_unit_code:		%s\n", store->mbSpeed_unit_code);
-		    fprintf(stderr,"dbg2       mbSpeed_add_offset:		%f\n", store->mbSpeed_add_offset);
-		    fprintf(stderr,"dbg2       mbSpeed_scale_factor:		%f\n", store->mbSpeed_scale_factor);
-		    fprintf(stderr,"dbg2       mbSpeed_minimum:			%d\n", store->mbSpeed_minimum);
-		    fprintf(stderr,"dbg2       mbSpeed_maximum:			%d\n", store->mbSpeed_maximum);
-		    fprintf(stderr,"dbg2       mbSpeed_valid_minimum:		%d\n", store->mbSpeed_valid_minimum);
-		    fprintf(stderr,"dbg2       mbSpeed_valid_maximum:		%d\n", store->mbSpeed_valid_maximum);
-		    fprintf(stderr,"dbg2       mbSpeed_missing_value:		%d\n", store->mbSpeed_missing_value);
-		    fprintf(stderr,"dbg2       mbSpeed_format_C:		%s\n", store->mbSpeed_format_C);
-		    fprintf(stderr,"dbg2       mbSpeed_orientation:		%s\n", store->mbSpeed_orientation);
-		    fprintf(stderr,"dbg2       mbPType_type:			%s\n", store->mbPType_type);
-		    fprintf(stderr,"dbg2       mbPType_long_name:		%s\n", store->mbPType_long_name);
-		    fprintf(stderr,"dbg2       mbPType_name_code:		%s\n", store->mbPType_name_code);
-		    fprintf(stderr,"dbg2       mbPType_units:			%s\n", store->mbPType_units);
-		    fprintf(stderr,"dbg2       mbPType_unit_code:		%s\n", store->mbPType_unit_code);
-		    fprintf(stderr,"dbg2       mbPType_add_offset:		%d\n", store->mbPType_add_offset);
-		    fprintf(stderr,"dbg2       mbPType_scale_factor:		%d\n", store->mbPType_scale_factor);
-		    fprintf(stderr,"dbg2       mbPType_minimum:			%d\n", store->mbPType_minimum);
-		    fprintf(stderr,"dbg2       mbPType_maximum:			%d\n", store->mbPType_maximum);
-		    fprintf(stderr,"dbg2       mbPType_valid_minimum:		%d\n", store->mbPType_valid_minimum);
-		    fprintf(stderr,"dbg2       mbPType_valid_maximum:		%d\n", store->mbPType_valid_maximum);
-		    fprintf(stderr,"dbg2       mbPType_missing_value:		%d\n", store->mbPType_missing_value);
-		    fprintf(stderr,"dbg2       mbPType_format_C:		%s\n", store->mbPType_format_C);
-		    fprintf(stderr,"dbg2       mbPType_orientation:		%s\n", store->mbPType_orientation);
-		    fprintf(stderr,"dbg2       mbPQuality_type:			%s\n", store->mbPQuality_type);
-		    fprintf(stderr,"dbg2       mbPQuality_long_name:		%s\n", store->mbPQuality_long_name);
-		    fprintf(stderr,"dbg2       mbPQuality_name_code:		%s\n", store->mbPQuality_name_code);
-		    fprintf(stderr,"dbg2       mbPQuality_units:		%s\n", store->mbPQuality_units);
-		    fprintf(stderr,"dbg2       mbPQuality_unit_code:		%s\n", store->mbPQuality_unit_code);
-		    fprintf(stderr,"dbg2       mbPQuality_add_offset:		%d\n", store->mbPQuality_add_offset);
-		    fprintf(stderr,"dbg2       mbPQuality_scale_factor:		%d\n", store->mbPQuality_scale_factor);
-		    fprintf(stderr,"dbg2       mbPQuality_minimum:		%d\n", store->mbPQuality_minimum);
-		    fprintf(stderr,"dbg2       mbPQuality_maximum:		%d\n", store->mbPQuality_maximum);
-		    fprintf(stderr,"dbg2       mbPQuality_valid_minimum:	%d\n", store->mbPQuality_valid_minimum);
-		    fprintf(stderr,"dbg2       mbPQuality_valid_maximum:	%d\n", store->mbPQuality_valid_maximum);
-		    fprintf(stderr,"dbg2       mbPQuality_missing_value:	%d\n", store->mbPQuality_missing_value);
-		    fprintf(stderr,"dbg2       mbPQuality_format_C:		%s\n", store->mbPQuality_format_C);
-		    fprintf(stderr,"dbg2       mbPQuality_orientation:		%s\n", store->mbPQuality_orientation);
-		    fprintf(stderr,"dbg2       mbPFlag_type:			%s\n", store->mbPFlag_type);
-		    fprintf(stderr,"dbg2       mbPFlag_long_name:		%s\n", store->mbPFlag_long_name);
-		    fprintf(stderr,"dbg2       mbPFlag_name_code:		%s\n", store->mbPFlag_name_code);
-		    fprintf(stderr,"dbg2       mbPFlag_units:			%s\n", store->mbPFlag_units);
-		    fprintf(stderr,"dbg2       mbPFlag_unit_code:		%s\n", store->mbPFlag_unit_code);
-		    fprintf(stderr,"dbg2       mbPFlag_add_offset:		%d\n", store->mbPFlag_add_offset);
-		    fprintf(stderr,"dbg2       mbPFlag_scale_factor:		%d\n", store->mbPFlag_scale_factor);
-		    fprintf(stderr,"dbg2       mbPFlag_minimum:			%d\n", store->mbPFlag_minimum);
-		    fprintf(stderr,"dbg2       mbPFlag_maximum:			%d\n", store->mbPFlag_maximum);
-		    fprintf(stderr,"dbg2       mbPFlag_valid_minimum:		%d\n", store->mbPFlag_valid_minimum);
-		    fprintf(stderr,"dbg2       mbPFlag_valid_maximum:		%d\n", store->mbPFlag_valid_maximum);
-		    fprintf(stderr,"dbg2       mbPFlag_missing_value:		%d\n", store->mbPFlag_missing_value);
-		    fprintf(stderr,"dbg2       mbPFlag_format_C:		%s\n", store->mbPFlag_format_C);
-		    fprintf(stderr,"dbg2       mbPFlag_orientation:		%s\n", store->mbPFlag_orientation);
-		    }
-		}
-
-	    /* read global variables */
-	    if (status == MB_SUCCESS)
-		{
-		if (store->mbHistDate_id >= 0)
-		    {
-		    index[0] = 0;
-		    count[0] = store->mbNbrHistoryRec;
-		    nc_status = nc_get_vara_int(mb_io_ptr->ncid, store->mbHistDate_id, index, count, store->mbHistDate);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_vara mbHistDate error: %s\n", nc_strerror(nc_status));
-		    }
-		if (store->mbHistTime_id >= 0)
-		    {
-		    index[0] = 0;
-		    count[0] = store->mbNbrHistoryRec;
-		    nc_status = nc_get_vara_int(mb_io_ptr->ncid, store->mbHistTime_id, index, count, store->mbHistTime);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_vara mbHistTime error: %s\n", nc_strerror(nc_status));
-		    }
-		if (store->mbHistCode_id >= 0)
-		    {
-		    index[0] = 0;
-		    count[0] = store->mbNbrHistoryRec;
-		    nc_status = nc_get_vara_text(mb_io_ptr->ncid, store->mbHistCode_id, index, count, store->mbHistCode);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_vara mbHistCode error: %s\n", nc_strerror(nc_status));
-		    }
-		if (store->mbHistAutor_id >= 0)
-		    {
-		    index[0] = 0;
-		    index[1] = 0;
-		    count[0] = store->mbNbrHistoryRec;
-		    count[1] = store->mbNameLength;
-		    nc_status = nc_get_vara_text(mb_io_ptr->ncid, store->mbHistAutor_id, index, count, store->mbHistAutor);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_vara mbHistAutor error: %s\n", nc_strerror(nc_status));
-		    }
-		if (store->mbHistModule_id >= 0)
-		    {
-		    index[0] = 0;
-		    index[1] = 0;
-		    count[0] = store->mbNbrHistoryRec;
-		    count[1] = store->mbNameLength;
-		    nc_status = nc_get_vara_text(mb_io_ptr->ncid, store->mbHistModule_id, index, count, store->mbHistModule);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_vara mbHistModule error: %s\n", nc_strerror(nc_status));
-		    }
-		if (store->mbHistComment_id >= 0)
-		    {
-		    index[0] = 0;
-		    index[1] = 0;
-		    count[0] = store->mbNbrHistoryRec;
-		    count[1] = store->mbCommentLength;
-		    nc_status = nc_get_vara_text(mb_io_ptr->ncid, store->mbHistComment_id, index, count, store->mbHistComment);
-		    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_vara mbHistComment error: %s\n", nc_strerror(nc_status));
-		    }
-		if (nc_status != NC_NOERR)
-		    {
-		    status = MB_FAILURE;
-		    *error = MB_ERROR_EOF;
-		    }
-
-		/* print input debug statements */
-		if (verbose >= 2)
-		    {
-		    fprintf(stderr,"\ndbg2  NetCDF Global Variables read in function <%s>\n",
-			    function_name);
-		    fprintf(stderr,"dbg2  Global Variables:\n");
-		    fprintf(stderr,"dbg2       status:                  %d\n", status);
-		    fprintf(stderr,"dbg2       error:                   %d\n", *error);
-		    fprintf(stderr,"dbg2       nc_status:               %d\n", nc_status);
-		    fprintf(stderr,"dbg2       mbNbrHistoryRec:         %d\n", store->mbNbrHistoryRec);
-		    for (i=0;i<store->mbNbrHistoryRec;i++)
-			{
-			fprintf(stderr,"dbg2       mbHistDate[%2d]:          %d\n", i, store->mbHistDate[i]);
-			fprintf(stderr,"dbg2       mbHistTime[%2d]:          %d\n", i, store->mbHistTime[i]);
-			fprintf(stderr,"dbg2       mbHistCode[%2d]:          %d\n", i, store->mbHistCode[i]);
-			fprintf(stderr,"dbg2       mbHistAutor[%2d]:         %s\n", i, &(store->mbHistAutor[i*store->mbNameLength]));
-			fprintf(stderr,"dbg2       mbHistModule[%2d]:        %s\n", i, &(store->mbHistModule[i*store->mbNameLength]));
-			fprintf(stderr,"dbg2       mbHistComment[%2d]:       %s\n", i, &(store->mbHistComment[i*store->mbCommentLength]));
-			}
-		    }
-		}
-	    }
-
-	/* read next data from file */
-	/* first run through all comment records */
-	if (status == MB_SUCCESS && store->mbNbrHistoryRec > *commentread)
-	    {
-	    store->kind = MB_DATA_COMMENT;
-
-	    /* get next comment */
-	    strncpy(store->comment,
-		    &(store->mbHistComment[(*commentread) *store->mbCommentLength]),
-		    MBSYS_NAVNETCDF_COMMENTLEN);
-
-	    /* set counters */
-	    (*commentread)++;
-	    (*dataread)++;
-
-	    /* print input debug statements */
-	    if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  Comment read in function <%s>\n",function_name);
-		fprintf(stderr,"dbg2  Comment:\n");
-		fprintf(stderr,"dbg2       status:                  %d\n", status);
-		fprintf(stderr,"dbg2       error:                   %d\n", *error);
-		fprintf(stderr,"dbg2       comment:                 %s\n", store->comment);
-		}
-	    }
-
-	/* next run through all survey records */
-	else if (status == MB_SUCCESS && store->mbPositionNbr > *recread)
-	    {
-	    /* set kind */
-	    store->kind = MB_DATA_DATA;
-
-	    /* read the variables from next record */
-	    if (store->mbDate_id >= 0)
-		{
-		index[0] = *recread;
-		count[0] = 1;
-		nc_status = nc_get_vara_int(mb_io_ptr->ncid, store->mbDate_id, index, count, &store->mbDate);
-		if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_vara mbDate error: %s\n", nc_strerror(nc_status));
-		}
-	    if (store->mbTime_id >= 0)
-		{
-		index[0] = *recread;
-		count[0] = 1;
-		nc_status = nc_get_vara_int(mb_io_ptr->ncid, store->mbTime_id, index, count, &store->mbTime);
-		if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_vara mbTime error: %s\n", nc_strerror(nc_status));
-		}
-	    if (store->mbOrdinate_id >= 0)
-		{
-		index[0] = *recread;
-		count[0] = 1;
-		nc_status = nc_get_vara_int(mb_io_ptr->ncid, store->mbOrdinate_id, index, count, &store->mbOrdinate);
-		if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_vara mbOrdinate error: %s\n", nc_strerror(nc_status));
-		}
-	    if (store->mbAbscissa_id >= 0)
-		{
-		index[0] = *recread;
-		count[0] = 1;
-		nc_status = nc_get_vara_int(mb_io_ptr->ncid, store->mbAbscissa_id, index, count, &store->mbAbscissa);
-		if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_vara mbAbscissa error: %s\n", nc_strerror(nc_status));
-		}
-	    if (store->mbAltitude_id >= 0)
-		{
-		index[0] = *recread;
-		count[0] = 1;
-		nc_status = nc_get_vara_short(mb_io_ptr->ncid, store->mbAltitude_id, index, count, &store->mbAltitude);
-		if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_vara mbAltitude error: %s\n", nc_strerror(nc_status));
-		}
-	    if (store->mbImmersion_id >= 0)
-		{
-		index[0] = *recread;
-		count[0] = 1;
-		nc_status = nc_get_vara_short(mb_io_ptr->ncid, store->mbImmersion_id, index, count, &store->mbImmersion);
-		if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_vara mbImmersion error: %s\n", nc_strerror(nc_status));
-		}
-	    if (store->mbHeading_id >= 0)
-		{
-		index[0] = *recread;
-		count[0] = 1;
-		nc_status = nc_get_vara_int(mb_io_ptr->ncid, store->mbHeading_id, index, count, &store->mbHeading);
-		if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_vara mbHeading error: %s\n", nc_strerror(nc_status));
-		}
-	    if (store->mbSpeed_id >= 0)
-		{
-		index[0] = *recread;
-		count[0] = 1;
-		nc_status = nc_get_vara_short(mb_io_ptr->ncid, store->mbSpeed_id, index, count, &store->mbSpeed);
-		if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_vara mbSpeed error: %s\n", nc_strerror(nc_status));
-		}
-	    if (store->mbPType_id >= 0)
-		{
-		index[0] = *recread;
-		count[0] = 1;
-		nc_status = nc_get_vara_text(mb_io_ptr->ncid, store->mbPType_id, index, count, &store->mbPType);
-		if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_vara mbPType error: %s\n", nc_strerror(nc_status));
-		}
-	    if (store->mbPQuality_id >= 0)
-		{
-		index[0] = *recread;
-		count[0] = 1;
-		nc_status = nc_get_vara_text(mb_io_ptr->ncid, store->mbPQuality_id, index, count, &store->mbPQuality);
-		if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_vara mbPQuality error: %s\n", nc_strerror(nc_status));
-		}
-	    if (store->mbPFlag_id >= 0)
-		{
-		index[0] = *recread;
-		count[0] = 1;
-		nc_status = nc_get_vara_text(mb_io_ptr->ncid, store->mbPFlag_id, index, count, &store->mbPFlag);
-		if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_get_vara mbPFlag error: %s\n", nc_strerror(nc_status));
-		}
-	    /* check status */
-	    if (nc_status != NC_NOERR)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	    /* set counters */
-	    (*recread)++;
-	    (*dataread)++;
-
-	    /* print input debug statements */
-	    if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  NetCDF Survey Record read in function <%s>\n",function_name);
-		fprintf(stderr,"dbg2  Global Variables:\n");
-		fprintf(stderr,"dbg2       status:                  %d\n", status);
-		fprintf(stderr,"dbg2       error:                   %d\n", *error);
-		fprintf(stderr,"dbg2       nc_status:               %d\n", nc_status);
-		fprintf(stderr,"dbg2       mbDate:                  %d\n", store->mbDate);
-		fprintf(stderr,"dbg2       mbTime:                  %d\n", store->mbTime);
-		fprintf(stderr,"dbg2       mbOrdinate:              %d\n", store->mbOrdinate);
-		fprintf(stderr,"dbg2       mbAbscissa:              %d\n", store->mbAbscissa);
-		fprintf(stderr,"dbg2       mbAltitude:              %d\n", store->mbAltitude);
-		fprintf(stderr,"dbg2       mbImmersion:             %d\n", store->mbImmersion);
-		fprintf(stderr,"dbg2       mbHeading:               %d\n", store->mbHeading);
-		fprintf(stderr,"dbg2       mbSpeed:                 %d\n", store->mbSpeed);
-		fprintf(stderr,"dbg2       mbPType:                 %d\n", store->mbPType);
-		fprintf(stderr,"dbg2       mbPQuality:              %d\n", store->mbPQuality);
-		fprintf(stderr,"dbg2       mbPFlag:                 %d\n", store->mbPFlag);
-		}
-	    }
-
-	/* else end of file */
-	else
-	    {
-	    /* set kind */
-	    store->kind = MB_DATA_NONE;
-
-	    /* set flags */
-	    *error = MB_ERROR_EOF;
-	    status = MB_FAILURE;
-	    }
-
-	/* set error and kind in mb_io_ptr */
-	mb_io_ptr->new_error = *error;
-	mb_io_ptr->new_kind = store->kind;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_wt_nvnetcdf(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_wt_nvnetcdf";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_navnetcdf_struct *store;
-	struct mbsys_navnetcdf_struct *storelocal;
-	int	*datawrite;
-	int	*commentwrite;
-	int	*recwrite;
-	int 	nc_status;
-	int	mbHistoryRecNbr_id;
-	int	mbNameLength_id;
-	int	mbCommentLength_id;
-	int	mbPositionNbr_id;
-	int	dims[2];
-	size_t	index[2], count[2];
-	char	*user_ptr;
-	double	time_d;
-	int	icomment;
-	int	i;
-#ifdef MBNETCDF_DEBUG
-	int	nc_verbose = 1;
-#else
-	int	nc_verbose = 0;
-#endif
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor and data storage */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-	store = (struct mbsys_navnetcdf_struct *) store_ptr;
-	storelocal = (struct mbsys_navnetcdf_struct *) mb_io_ptr->store_data;
-	datawrite = (int *) &mb_io_ptr->save1;
-	commentwrite = (int *) &mb_io_ptr->save2;
-	recwrite = (int *) &mb_io_ptr->save4;
-
-	/* if comment and nothing written yet save it */
-	if (store->kind == MB_DATA_COMMENT
-	    && *recwrite == 0)
-	    {
-	    /* allocate arrays if needed */
-	    if (storelocal->mbNbrHistoryRec >= storelocal->mbHistoryRecNbr)
-	    	{
-		/* allocate or reallocate history arrays */
-		storelocal->mbHistoryRecNbr += 20;
-		status = mb_reallocd(verbose, __FILE__, __LINE__,
-			    storelocal->mbHistoryRecNbr * sizeof(int),
-			    (void **)&storelocal->mbHistDate,error);
-		status = mb_reallocd(verbose, __FILE__, __LINE__,
-			    storelocal->mbHistoryRecNbr * sizeof(int),
-			    (void **)&storelocal->mbHistTime,error);
-		status = mb_reallocd(verbose, __FILE__, __LINE__,
-			    storelocal->mbHistoryRecNbr * sizeof(char),
-			    (void **)&storelocal->mbHistCode,error);
-		status = mb_reallocd(verbose, __FILE__, __LINE__,
-			    storelocal->mbHistoryRecNbr * storelocal->mbNameLength * sizeof(char),
-			    (void **)&storelocal->mbHistAutor,error);
-		status = mb_reallocd(verbose, __FILE__, __LINE__,
-			    storelocal->mbHistoryRecNbr * storelocal->mbNameLength * sizeof(char),
-			    (void **)&storelocal->mbHistModule,error);
-		status = mb_reallocd(verbose, __FILE__, __LINE__,
-			    storelocal->mbHistoryRecNbr * storelocal->mbCommentLength * sizeof(char),
-			    (void **)&storelocal->mbHistComment,error);
-		for (i=storelocal->mbNbrHistoryRec;i<storelocal->mbHistoryRecNbr;i++)
-			    {
-			    storelocal->mbHistDate[i] = 0;
-			    storelocal->mbHistTime[i] = 0;
-			    storelocal->mbHistCode[i] = 0;
-			    }
-		}
-
-	    /* save old comment (from pre-existing netcdf file) */
-	    if (store != storelocal)
-		{
-		/* figure out which comment is being passed */
-		icomment = -1;
-		for (i=0;i<store->mbNbrHistoryRec;i++)
-		    {
-		    if (strncmp(store->comment,
-				&store->mbHistComment[i * store->mbCommentLength],
-				MBSYS_NAVNETCDF_COMMENTLEN) == 0)
-			{
-			icomment = i;
-			}
-		    }
-		if (icomment > -1 && icomment < store->mbNbrHistoryRec)
-		    {
-		    strncpy(&(storelocal->mbHistAutor[(*commentwrite) * storelocal->mbNameLength]),
-			    &(store->mbHistAutor[icomment * store->mbNameLength]),
-			    MBSYS_NAVNETCDF_NAMELEN);
-		    strncpy(&(storelocal->mbHistModule[(*commentwrite) * storelocal->mbNameLength]),
-			    &(store->mbHistModule[icomment * store->mbNameLength]),
-			    MBSYS_NAVNETCDF_NAMELEN);
-		    strncpy(&(storelocal->mbHistComment[(*commentwrite) * storelocal->mbCommentLength]),
-			    &(store->mbHistComment[icomment * store->mbCommentLength]),
-			    MBSYS_NAVNETCDF_COMMENTLEN);
-		    storelocal->mbHistDate[*commentwrite] = store->mbHistDate[icomment];
-		    storelocal->mbHistTime[*commentwrite] = store->mbHistTime[icomment];
-		    storelocal->mbHistCode[*commentwrite] = 1;
-		    storelocal->mbNbrHistoryRec++;
-		    }
-		}
-
-	    /* save new comment */
-	    else
-		{
-		if ((user_ptr = getenv("USER")) == NULL)
-			user_ptr = getenv("LOGNAME");
-		if (user_ptr != NULL)
-		    strncpy(&(storelocal->mbHistAutor[(*commentwrite) *storelocal->mbNameLength]),
-			user_ptr, MBSYS_NAVNETCDF_NAMELEN);
-		else
-		    strncpy(&(storelocal->mbHistAutor[(*commentwrite) *storelocal->mbNameLength]),
-			"Unknown", MBSYS_NAVNETCDF_NAMELEN);
-		strncpy(&(storelocal->mbHistModule[(*commentwrite) *storelocal->mbNameLength]),
-			"MB-System", MBSYS_NAVNETCDF_NAMELEN);
-		strncpy(&(storelocal->mbHistComment[(*commentwrite) *storelocal->mbCommentLength]),
-			store->comment, MBSYS_NAVNETCDF_COMMENTLEN);
-		time_d = (double)time((time_t *)0);
-		storelocal->mbHistDate[*commentwrite] = (int)(time_d / SECINDAY);
-		storelocal->mbHistTime[*commentwrite] = (int)(1000 * (time_d - storelocal->mbHistDate[*commentwrite] * SECINDAY));
-		storelocal->mbHistCode[*commentwrite] = 1;
-		storelocal->mbNbrHistoryRec++;
-		}
-
-	    /* set counters */
-	    (*commentwrite)++;
-	    (*datawrite)++;
-
-	    /* print input debug statements */
-	    if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  Comment saved in function <%s>\n",function_name);
-		fprintf(stderr,"dbg2  Comment:\n");
-		fprintf(stderr,"dbg2       status:                  %d\n", status);
-		fprintf(stderr,"dbg2       error:                   %d\n", *error);
-		fprintf(stderr,"dbg2       comment:                 %s\n", store->comment);
-		}
-	    }
-
-	/* if data and nothing written yet start it off */
-	if (store->kind == MB_DATA_DATA
-	    && *recwrite == 0
-	    && status == MB_SUCCESS)
-	    {
-	    /* copy over noncomment dimensions */
-	    storelocal->mbPositionNbr = 0;
-
-	    /* define the dimensions */
-   	    nc_status = nc_def_dim(mb_io_ptr->ncid, "mbHistoryRecNbr", storelocal->mbHistoryRecNbr, &mbHistoryRecNbr_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_def_dim mbHistoryRecNbr error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_def_dim(mb_io_ptr->ncid, "mbNameLength", storelocal->mbNameLength, &mbNameLength_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_def_dim mbNameLength error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_def_dim(mb_io_ptr->ncid, "mbCommentLength", storelocal->mbCommentLength, &mbCommentLength_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_def_dim mbCommentLength error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_def_dim(mb_io_ptr->ncid, "mbPositionNbr", NC_UNLIMITED, &mbPositionNbr_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_def_dim mbPositionNbr error: %s\n", nc_strerror(nc_status));
-
-	    /* print input debug statements */
-	    if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  NetCDF array dimensions written in function <%s>\n",function_name);
-		fprintf(stderr,"dbg2  Array and variable dimensions:\n");
-		fprintf(stderr,"dbg2       status:                  %d\n", status);
-		fprintf(stderr,"dbg2       error:                   %d\n", *error);
-		fprintf(stderr,"dbg2       nc_status:               %d\n", nc_status);
-		fprintf(stderr,"dbg2       mbHistoryRecNbr:         %zu\n", storelocal->mbHistoryRecNbr);
-		fprintf(stderr,"dbg2       mbNameLength:            %zu\n", storelocal->mbNameLength);
-		fprintf(stderr,"dbg2       mbCommentLength:         %zu\n", storelocal->mbCommentLength);
-		fprintf(stderr,"dbg2       mbPositionNbr:           %zu\n", storelocal->mbPositionNbr);
-		}
-
-	    /* define the variables */
-	    dims[0] = mbHistoryRecNbr_id;
-	    nc_status = nc_def_var(mb_io_ptr->ncid, "mbHistDate", NC_INT, 1, dims, &storelocal->mbHistDate_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_def_var mbHistDate_id error: %s\n", nc_strerror(nc_status));
-	    dims[0] = mbHistoryRecNbr_id;
-	    nc_status = nc_def_var(mb_io_ptr->ncid, "mbHistTime", NC_INT, 1, dims, &storelocal->mbHistTime_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_def_var mbHistTime_id error: %s\n", nc_strerror(nc_status));
-	    dims[0] = mbHistoryRecNbr_id;
-	    nc_status = nc_def_var(mb_io_ptr->ncid, "mbHistCode", NC_CHAR, 1, dims, &storelocal->mbHistCode_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_def_var mbHistCode_id error: %s\n", nc_strerror(nc_status));
-	    dims[0] = mbHistoryRecNbr_id;
-	    dims[1] = mbNameLength_id;
-	    nc_status = nc_def_var(mb_io_ptr->ncid, "mbHistAutor", NC_CHAR, 2, dims, &storelocal->mbHistAutor_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_def_var mbHistAutor_id error: %s\n", nc_strerror(nc_status));
-	    dims[0] = mbHistoryRecNbr_id;
-	    dims[1] = mbNameLength_id;
-	    nc_status = nc_def_var(mb_io_ptr->ncid, "mbHistModule", NC_CHAR, 2, dims, &storelocal->mbHistModule_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_def_var mbHistModule_id error: %s\n", nc_strerror(nc_status));
-	    dims[0] = mbHistoryRecNbr_id;
-	    dims[1] = mbCommentLength_id;
-	    nc_status = nc_def_var(mb_io_ptr->ncid, "mbHistComment", NC_CHAR, 2, dims, &storelocal->mbHistComment_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_def_var mbHistComment_id error: %s\n", nc_strerror(nc_status));
-	    dims[0] = mbPositionNbr_id;
-	    nc_status = nc_def_var(mb_io_ptr->ncid, "mbDate", NC_INT, 1, dims, &storelocal->mbDate_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_def_var mbDate_id error: %s\n", nc_strerror(nc_status));
-	    dims[0] = mbPositionNbr_id;
-	    nc_status = nc_def_var(mb_io_ptr->ncid, "mbTime", NC_INT, 1, dims, &storelocal->mbTime_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_def_var mbTime_id error: %s\n", nc_strerror(nc_status));
-	    dims[0] = mbPositionNbr_id;
-	    nc_status = nc_def_var(mb_io_ptr->ncid, "mbOrdinate", NC_INT, 1, dims, &storelocal->mbOrdinate_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_def_var mbOrdinate_id error: %s\n", nc_strerror(nc_status));
-	    dims[0] = mbPositionNbr_id;
-	    nc_status = nc_def_var(mb_io_ptr->ncid, "mbAbscissa", NC_INT, 1, dims, &storelocal->mbAbscissa_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_def_var mbAbscissa_id error: %s\n", nc_strerror(nc_status));
-	    dims[0] = mbPositionNbr_id;
-	    nc_status = nc_def_var(mb_io_ptr->ncid, "mbAltitude", NC_SHORT, 1, dims, &storelocal->mbAltitude_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_def_var mbAltitude_id error: %s\n", nc_strerror(nc_status));
-	    dims[0] = mbPositionNbr_id;
-	    nc_status = nc_def_var(mb_io_ptr->ncid, "mbImmersion", NC_SHORT, 1, dims, &storelocal->mbImmersion_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_def_var mbImmersion_id error: %s\n", nc_strerror(nc_status));
-	    dims[0] = mbPositionNbr_id;
-	    nc_status = nc_def_var(mb_io_ptr->ncid, "mbHeading", NC_INT, 1, dims, &storelocal->mbHeading_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_def_var mbHeading_id error: %s\n", nc_strerror(nc_status));
-	    dims[0] = mbPositionNbr_id;
-	    nc_status = nc_def_var(mb_io_ptr->ncid, "mbSpeed", NC_SHORT, 1, dims, &storelocal->mbSpeed_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_def_var mbSpeed_id error: %s\n", nc_strerror(nc_status));
-	    dims[0] = mbPositionNbr_id;
-	    nc_status = nc_def_var(mb_io_ptr->ncid, "mbPType", NC_CHAR, 1, dims, &storelocal->mbPType_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_def_var mbPType_id error: %s\n", nc_strerror(nc_status));
-	    dims[0] = mbPositionNbr_id;
-	    nc_status = nc_def_var(mb_io_ptr->ncid, "mbPQuality", NC_CHAR, 1, dims, &storelocal->mbPQuality_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_def_var mbPQuality_id error: %s\n", nc_strerror(nc_status));
-	    dims[0] = mbPositionNbr_id;
-	    nc_status = nc_def_var(mb_io_ptr->ncid, "mbPFlag", NC_CHAR, 1, dims, &storelocal->mbPFlag_id);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_def_var mbPFlag_id error: %s\n", nc_strerror(nc_status));
-
-	    /* print input debug statements */
-	    if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  NetCDF variable ids written in function <%s>\n",function_name);
-		fprintf(stderr,"dbg2  Variable ids:\n");
-		fprintf(stderr,"dbg2       status:                  %d\n", status);
-		fprintf(stderr,"dbg2       error:                   %d\n", *error);
-		fprintf(stderr,"dbg2       nc_status:               %d\n", nc_status);
-		fprintf(stderr,"dbg2       mbHistDate_id:           %d\n", storelocal->mbHistDate_id);
-		fprintf(stderr,"dbg2       mbHistTime_id:           %d\n", storelocal->mbHistTime_id);
-		fprintf(stderr,"dbg2       mbHistCode_id:           %d\n", storelocal->mbHistCode_id);
-		fprintf(stderr,"dbg2       mbHistAutor_id:          %d\n", storelocal->mbHistAutor_id);
-		fprintf(stderr,"dbg2       mbHistModule_id:         %d\n", storelocal->mbHistModule_id);
-		fprintf(stderr,"dbg2       mbHistComment_id:        %d\n", storelocal->mbHistComment_id);
-		fprintf(stderr,"dbg2       mbDate_id:               %d\n", storelocal->mbDate_id);
-		fprintf(stderr,"dbg2       mbTime_id:               %d\n", storelocal->mbTime_id);
-		fprintf(stderr,"dbg2       mbOrdinate_id:           %d\n", storelocal->mbOrdinate_id);
-		fprintf(stderr,"dbg2       mbAbscissa_id:           %d\n", storelocal->mbAbscissa_id);
-		fprintf(stderr,"dbg2       mbAltitude_id:           %d\n", storelocal->mbAltitude_id);
-		fprintf(stderr,"dbg2       mbImmersion_id:          %d\n", storelocal->mbImmersion_id);
-		fprintf(stderr,"dbg2       mbHeading_id:            %d\n", storelocal->mbHeading_id);
-		fprintf(stderr,"dbg2       mbSpeed_id:              %d\n", storelocal->mbSpeed_id);
-		fprintf(stderr,"dbg2       mbPType_id:              %d\n", storelocal->mbPType_id);
-		fprintf(stderr,"dbg2       mbPQuality_id:           %d\n", storelocal->mbPQuality_id);
-		fprintf(stderr,"dbg2       mbPFlag_id:              %d\n", storelocal->mbPFlag_id);
-		}
-
-	    /* save the global attributes */
-	    nc_status = nc_put_att_short(mb_io_ptr->ncid, NC_GLOBAL, "mbVersion", NC_SHORT, 1, &store->mbVersion);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbVersion error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, NC_GLOBAL, "mbName", MBSYS_NAVNETCDF_ATTRIBUTELEN, store->mbName);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbName error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, NC_GLOBAL, "mbClasse", MBSYS_NAVNETCDF_ATTRIBUTELEN, store->mbClasse);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbClasse error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_short(mb_io_ptr->ncid, NC_GLOBAL, "mbLevel", NC_SHORT, 1, &store->mbLevel);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbLevel error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_short(mb_io_ptr->ncid, NC_GLOBAL, "mbNbrHistoryRec", NC_SHORT, 1, &storelocal->mbNbrHistoryRec);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbNbrHistoryRec error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, NC_GLOBAL, "mbTimeReference", MBSYS_NAVNETCDF_ATTRIBUTELEN, store->mbTimeReference);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbTimeReference error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, NC_GLOBAL, "mbStartDate", NC_INT, 1, &store->mbStartDate);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbStartDate error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, NC_GLOBAL, "mbStartTime", NC_INT, 1, &store->mbStartTime);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbStartTime error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, NC_GLOBAL, "mbEndDate", NC_INT, 1, &store->mbEndDate);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbEndDate error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, NC_GLOBAL, "mbEndTime", NC_INT, 1, &store->mbEndTime);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbEndTime error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, NC_GLOBAL, "mbNorthLatitude", NC_DOUBLE, 1, &store->mbNorthLatitude);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbNorthLatitude error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, NC_GLOBAL, "mbSouthLatitude", NC_DOUBLE, 1, &store->mbSouthLatitude);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbSouthLatitude error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, NC_GLOBAL, "mbEastLongitude", NC_DOUBLE, 1, &store->mbEastLongitude);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbEastLongitude error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, NC_GLOBAL, "mbWestLongitude", NC_DOUBLE, 1, &store->mbWestLongitude);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbWestLongitude error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, NC_GLOBAL, "mbMeridian180", MBSYS_NAVNETCDF_ATTRIBUTELEN, store->mbMeridian180);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbMeridian180 error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, NC_GLOBAL, "mbGeoDictionnary", MBSYS_NAVNETCDF_ATTRIBUTELEN, store->mbGeoDictionnary);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbGeoDictionnary error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, NC_GLOBAL, "mbGeoRepresentation", MBSYS_NAVNETCDF_ATTRIBUTELEN, store->mbGeoRepresentation);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbGeoRepresentation error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, NC_GLOBAL, "mbGeodesicSystem", MBSYS_NAVNETCDF_ATTRIBUTELEN, store->mbGeodesicSystem);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbGeodesicSystem error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, NC_GLOBAL, "mbEllipsoidName", MBSYS_NAVNETCDF_COMMENTLEN, store->mbEllipsoidName);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbEllipsoidName error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, NC_GLOBAL, "mbEllipsoidA", NC_DOUBLE, 1, &store->mbEllipsoidA);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbEllipsoidA error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, NC_GLOBAL, "mbEllipsoidInvF", NC_DOUBLE, 1, &store->mbEllipsoidInvF);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbEllipsoidInvF error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, NC_GLOBAL, "mbEllipsoidE2", NC_DOUBLE, 1, &store->mbEllipsoidE2);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbEllipsoidE2 error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_short(mb_io_ptr->ncid, NC_GLOBAL, "mbProjType", NC_SHORT, 1, &store->mbProjType);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbProjType error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, NC_GLOBAL, "mbProjParameterValue", NC_DOUBLE, 10, store->mbProjParameterValue);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbProjParameterValue error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, NC_GLOBAL, "mbProjParameterCode", MBSYS_NAVNETCDF_COMMENTLEN, store->mbProjParameterCode);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbProjParameterCode error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, NC_GLOBAL, "mbShip", MBSYS_NAVNETCDF_COMMENTLEN, store->mbShip);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbShip error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, NC_GLOBAL, "mbSurvey", MBSYS_NAVNETCDF_COMMENTLEN, store->mbSurvey);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbSurvey error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, NC_GLOBAL, "mbReference", MBSYS_NAVNETCDF_COMMENTLEN, store->mbReference);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbReference error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, NC_GLOBAL, "mbPointCounter", NC_INT, 1, &store->mbPointCounter);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbVersion error: %s\n", nc_strerror(nc_status));
-
-	    /* print input debug statements */
-	    if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  NetCDF global attributes written in function <%s>\n",function_name);
-		fprintf(stderr,"dbg2  Global attributes:\n");
-		fprintf(stderr,"dbg2       status:                  %d\n", status);
-		fprintf(stderr,"dbg2       error:                   %d\n", *error);
-		fprintf(stderr,"dbg2       nc_status:             %d\n", nc_status);
-		fprintf(stderr,"dbg2       mbVersion:             %d\n", store->mbVersion);
-		fprintf(stderr,"dbg2       mbName:                %s\n", store->mbName);
-		fprintf(stderr,"dbg2       mbClasse:              %s\n", store->mbClasse);
-		fprintf(stderr,"dbg2       mbLevel:               %d\n", store->mbLevel);
-		fprintf(stderr,"dbg2       mbNbrHistoryRec:       %d\n", store->mbNbrHistoryRec);
-		fprintf(stderr,"dbg2       mbTimeReference:       %s\n", store->mbTimeReference);
-		fprintf(stderr,"dbg2       mbStartDate:           %d\n", store->mbStartDate);
-		fprintf(stderr,"dbg2       mbStartTime:           %d\n", store->mbStartTime);
-		fprintf(stderr,"dbg2       mbEndDate:             %d\n", store->mbEndDate);
-		fprintf(stderr,"dbg2       mbEndTime:             %d\n", store->mbEndTime);
-		fprintf(stderr,"dbg2       mbNorthLatitude:       %f\n", store->mbNorthLatitude);
-		fprintf(stderr,"dbg2       mbSouthLatitude:       %f\n", store->mbSouthLatitude);
-		fprintf(stderr,"dbg2       mbEastLongitude:       %f\n", store->mbEastLongitude);
-		fprintf(stderr,"dbg2       mbWestLongitude:       %f\n", store->mbWestLongitude);
-		fprintf(stderr,"dbg2       mbMeridian180:         %s\n", store->mbMeridian180);
-		fprintf(stderr,"dbg2       mbGeoDictionnary:      %s\n", store->mbGeoDictionnary);
-		fprintf(stderr,"dbg2       mbGeoRepresentation:   %s\n", store->mbGeoRepresentation);
-		fprintf(stderr,"dbg2       mbGeodesicSystem:      %s\n", store->mbGeodesicSystem);
-		fprintf(stderr,"dbg2       mbEllipsoidName:       %s\n", store->mbEllipsoidName);
-		fprintf(stderr,"dbg2       mbEllipsoidA:          %f\n", store->mbEllipsoidA);
-		fprintf(stderr,"dbg2       mbEllipsoidInvF:       %f\n", store->mbEllipsoidInvF);
-		fprintf(stderr,"dbg2       mbEllipsoidE2:         %f\n", store->mbEllipsoidE2);
-		fprintf(stderr,"dbg2       mbProjType:            %d\n", store->mbProjType);
-		for (i=0;i<10;i++)
-		    fprintf(stderr,"dbg2       mbProjParameterValue[%d]:%f\n", i, store->mbProjParameterValue[i]);
-		fprintf(stderr,"dbg2       mbProjParameterCode:   %s\n", store->mbProjParameterCode);
-		fprintf(stderr,"dbg2       mbShip:                %s\n", store->mbShip);
-		fprintf(stderr,"dbg2       mbSurvey:              %s\n", store->mbSurvey);
-		fprintf(stderr,"dbg2       mbReference:           %s\n", store->mbReference);
-		fprintf(stderr,"dbg2       mbPointCounter:        %d\n", store->mbPointCounter);
-		}
-
-	    /* save the variable attributes */
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbHistDate_id, "type", MBSYS_NAVNETCDF_ATTRIBUTELEN, storelocal->mbHistDate_type);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbHistDate_id, "long_name", MBSYS_NAVNETCDF_ATTRIBUTELEN, storelocal->mbHistDate_long_name);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbHistDate_id, "name_code", MBSYS_NAVNETCDF_ATTRIBUTELEN, storelocal->mbHistDate_name_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbHistDate_id, "units", MBSYS_NAVNETCDF_ATTRIBUTELEN, storelocal->mbHistDate_units);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbHistDate_id, "unit_code", MBSYS_NAVNETCDF_ATTRIBUTELEN, storelocal->mbHistDate_unit_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbHistDate_id, "add_offset", NC_INT, 1, &storelocal->mbHistDate_add_offset);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbHistDate_add_offset error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbHistDate_id, "scale_factor", NC_INT, 1, &storelocal->mbHistDate_scale_factor);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbHistDate_scale_factor error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbHistDate_id, "minimum", NC_INT, 1, &storelocal->mbHistDate_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbHistDate_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbHistDate_id, "maximum", NC_INT, 1, &storelocal->mbHistDate_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbHistDate_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbHistDate_id, "valid_minimum", NC_INT, 1, &storelocal->mbHistDate_valid_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbHistDate_valid_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbHistDate_id, "valid_maximum", NC_INT, 1, &storelocal->mbHistDate_valid_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbHistDate_valid_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbHistDate_id, "missing_value", NC_INT, 1, &storelocal->mbHistDate_missing_value);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbHistDate_missing_value error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbHistDate_id, "format_C", MBSYS_NAVNETCDF_ATTRIBUTELEN, storelocal->mbHistDate_format_C);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbHistDate_id, "orientation", MBSYS_NAVNETCDF_ATTRIBUTELEN, storelocal->mbHistDate_orientation);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbHistTime_id, "type", MBSYS_NAVNETCDF_ATTRIBUTELEN, storelocal->mbHistTime_type);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbHistTime_id, "long_name", MBSYS_NAVNETCDF_ATTRIBUTELEN, storelocal->mbHistTime_long_name);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbHistTime_id, "name_code", MBSYS_NAVNETCDF_ATTRIBUTELEN, storelocal->mbHistTime_name_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbHistTime_id, "units", MBSYS_NAVNETCDF_ATTRIBUTELEN, storelocal->mbHistTime_units);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbHistTime_id, "unit_code", MBSYS_NAVNETCDF_ATTRIBUTELEN, storelocal->mbHistTime_unit_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbHistTime_id, "add_offset", NC_INT, 1, &storelocal->mbHistTime_add_offset);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbHistTime_add_offset error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbHistTime_id, "scale_factor", NC_INT, 1, &storelocal->mbHistTime_scale_factor);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbHistTime_scale_factor error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbHistTime_id, "minimum", NC_INT, 1, &storelocal->mbHistTime_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbHistTime_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbHistTime_id, "maximum", NC_INT, 1, &storelocal->mbHistTime_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbHistTime_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbHistTime_id, "valid_minimum", NC_INT, 1, &storelocal->mbHistTime_valid_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbHistTime_valid_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbHistTime_id, "valid_maximum", NC_INT, 1, &storelocal->mbHistTime_valid_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbHistTime_valid_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbHistTime_id, "missing_value", NC_INT, 1, &storelocal->mbHistTime_missing_value);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbHistTime_missing_value error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbHistTime_id, "format_C", MBSYS_NAVNETCDF_ATTRIBUTELEN, storelocal->mbHistTime_format_C);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbHistTime_id, "orientation", MBSYS_NAVNETCDF_ATTRIBUTELEN, storelocal->mbHistTime_orientation);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbHistCode_id, "type", MBSYS_NAVNETCDF_ATTRIBUTELEN, storelocal->mbHistCode_type);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbHistCode_id, "long_name", MBSYS_NAVNETCDF_ATTRIBUTELEN, storelocal->mbHistCode_long_name);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbHistCode_id, "name_code", MBSYS_NAVNETCDF_ATTRIBUTELEN, storelocal->mbHistCode_name_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbHistCode_id, "units", MBSYS_NAVNETCDF_ATTRIBUTELEN, storelocal->mbHistCode_units);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbHistCode_id, "unit_code", MBSYS_NAVNETCDF_ATTRIBUTELEN, storelocal->mbHistCode_unit_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbHistCode_id, "add_offset", NC_INT, 1, &storelocal->mbHistCode_add_offset);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbHistCode_add_offset error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbHistCode_id, "scale_factor", NC_INT, 1, &storelocal->mbHistCode_scale_factor);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbHistCode_scale_factor error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbHistCode_id, "minimum", NC_INT, 1, &storelocal->mbHistCode_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbHistCode_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbHistCode_id, "maximum", NC_INT, 1, &storelocal->mbHistCode_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbHistCode_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbHistCode_id, "valid_minimum", NC_INT, 1, &storelocal->mbHistCode_valid_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbHistCode_valid_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbHistCode_id, "valid_maximum", NC_INT, 1, &storelocal->mbHistCode_valid_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbHistCode_valid_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbHistCode_id, "missing_value", NC_INT, 1, &storelocal->mbHistCode_missing_value);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbHistCode_missing_value error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbHistCode_id, "format_C", MBSYS_NAVNETCDF_ATTRIBUTELEN, storelocal->mbHistCode_format_C);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbHistCode_id, "orientation", MBSYS_NAVNETCDF_ATTRIBUTELEN, storelocal->mbHistCode_orientation);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbHistAutor_id, "type", MBSYS_NAVNETCDF_ATTRIBUTELEN, storelocal->mbHistAutor_type);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbHistAutor_id, "long_name", MBSYS_NAVNETCDF_ATTRIBUTELEN, storelocal->mbHistAutor_long_name);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbHistAutor_id, "name_code", MBSYS_NAVNETCDF_ATTRIBUTELEN, storelocal->mbHistAutor_name_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbHistModule_id, "type", MBSYS_NAVNETCDF_ATTRIBUTELEN, storelocal->mbHistModule_type);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbHistModule_id, "long_name", MBSYS_NAVNETCDF_ATTRIBUTELEN, storelocal->mbHistModule_long_name);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbHistModule_id, "name_code", MBSYS_NAVNETCDF_ATTRIBUTELEN, storelocal->mbHistModule_name_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbHistComment_id, "type", MBSYS_NAVNETCDF_ATTRIBUTELEN, storelocal->mbHistComment_type);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbHistComment_id, "long_name", MBSYS_NAVNETCDF_ATTRIBUTELEN, storelocal->mbHistComment_long_name);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbHistComment_id, "name_code", MBSYS_NAVNETCDF_ATTRIBUTELEN, storelocal->mbHistComment_name_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbDate_id, "type", MBSYS_NAVNETCDF_ATTRIBUTELEN, storelocal->mbDate_type);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbDate_id, "long_name", MBSYS_NAVNETCDF_ATTRIBUTELEN, storelocal->mbDate_long_name);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbDate_id, "name_code", MBSYS_NAVNETCDF_ATTRIBUTELEN, storelocal->mbDate_name_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbDate_id, "units", MBSYS_NAVNETCDF_ATTRIBUTELEN, storelocal->mbDate_units);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbDate_id, "unit_code", MBSYS_NAVNETCDF_ATTRIBUTELEN, storelocal->mbDate_unit_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbDate_id, "add_offset", NC_INT, 1, &storelocal->mbDate_add_offset);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbDate_add_offset error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbDate_id, "scale_factor", NC_INT, 1, &storelocal->mbDate_scale_factor);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbDate_scale_factor error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbDate_id, "minimum", NC_INT, 1, &storelocal->mbDate_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbDate_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbDate_id, "maximum", NC_INT, 1, &storelocal->mbDate_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbDate_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbDate_id, "valid_minimum", NC_INT, 1, &storelocal->mbDate_valid_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbDate_valid_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbDate_id, "valid_maximum", NC_INT, 1, &storelocal->mbDate_valid_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbDate_valid_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbDate_id, "missing_value", NC_INT, 1, &storelocal->mbDate_missing_value);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbDate_missing_value error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbDate_id, "format_C", MBSYS_NAVNETCDF_ATTRIBUTELEN, storelocal->mbDate_format_C);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbDate_id, "orientation", MBSYS_NAVNETCDF_ATTRIBUTELEN, storelocal->mbDate_orientation);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbTime_id, "type", MBSYS_NAVNETCDF_ATTRIBUTELEN, storelocal->mbTime_type);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbTime_id, "long_name", MBSYS_NAVNETCDF_ATTRIBUTELEN, storelocal->mbTime_long_name);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbTime_id, "name_code", MBSYS_NAVNETCDF_ATTRIBUTELEN, storelocal->mbTime_name_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbTime_id, "units", MBSYS_NAVNETCDF_ATTRIBUTELEN, storelocal->mbTime_units);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbTime_id, "unit_code", MBSYS_NAVNETCDF_ATTRIBUTELEN, storelocal->mbTime_unit_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbTime_id, "add_offset", NC_INT, 1, &storelocal->mbTime_add_offset);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbTime_add_offset error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbTime_id, "scale_factor", NC_INT, 1, &storelocal->mbTime_scale_factor);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbTime_scale_factor error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbTime_id, "minimum", NC_INT, 1, &storelocal->mbTime_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbTime_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbTime_id, "maximum", NC_INT, 1, &storelocal->mbTime_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbTime_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbTime_id, "valid_minimum", NC_INT, 1, &storelocal->mbTime_valid_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbTime_valid_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbTime_id, "valid_maximum", NC_INT, 1, &storelocal->mbTime_valid_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbTime_valid_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbTime_id, "missing_value", NC_INT, 1, &storelocal->mbTime_missing_value);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbTime_missing_value error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbTime_id, "format_C", MBSYS_NAVNETCDF_ATTRIBUTELEN, storelocal->mbTime_format_C);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbTime_id, "orientation", MBSYS_NAVNETCDF_ATTRIBUTELEN, storelocal->mbTime_orientation);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbOrdinate_id, "type", MBSYS_NAVNETCDF_ATTRIBUTELEN, storelocal->mbOrdinate_type);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbOrdinate_id, "long_name", MBSYS_NAVNETCDF_ATTRIBUTELEN, storelocal->mbOrdinate_long_name);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbOrdinate_id, "name_code", MBSYS_NAVNETCDF_ATTRIBUTELEN, storelocal->mbOrdinate_name_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbOrdinate_id, "units", MBSYS_NAVNETCDF_ATTRIBUTELEN, storelocal->mbOrdinate_units);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbOrdinate_id, "unit_code", MBSYS_NAVNETCDF_ATTRIBUTELEN, storelocal->mbOrdinate_unit_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, storelocal->mbOrdinate_id, "add_offset", NC_DOUBLE, 1, &storelocal->mbOrdinate_add_offset);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbOrdinate_add_offset error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, storelocal->mbOrdinate_id, "scale_factor", NC_DOUBLE, 1, &storelocal->mbOrdinate_scale_factor);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbOrdinate_scale_factor error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbOrdinate_id, "minimum", NC_INT, 1, &storelocal->mbOrdinate_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbOrdinate_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbOrdinate_id, "maximum", NC_INT, 1, &storelocal->mbOrdinate_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbOrdinate_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbOrdinate_id, "valid_minimum", NC_INT, 1, &storelocal->mbOrdinate_valid_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbOrdinate_valid_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbOrdinate_id, "valid_maximum", NC_INT, 1, &storelocal->mbOrdinate_valid_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbOrdinate_valid_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbOrdinate_id, "missing_value", NC_INT, 1, &storelocal->mbOrdinate_missing_value);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbOrdinate_missing_value error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbOrdinate_id, "format_C", MBSYS_NAVNETCDF_ATTRIBUTELEN, storelocal->mbOrdinate_format_C);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbOrdinate_id, "orientation", MBSYS_NAVNETCDF_ATTRIBUTELEN, storelocal->mbOrdinate_orientation);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbAbscissa_id, "type", MBSYS_NAVNETCDF_ATTRIBUTELEN, storelocal->mbAbscissa_type);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbAbscissa_id, "long_name", MBSYS_NAVNETCDF_ATTRIBUTELEN, storelocal->mbAbscissa_long_name);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbAbscissa_id, "name_code", MBSYS_NAVNETCDF_ATTRIBUTELEN, storelocal->mbAbscissa_name_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbAbscissa_id, "units", MBSYS_NAVNETCDF_ATTRIBUTELEN, storelocal->mbAbscissa_units);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbAbscissa_id, "unit_code", MBSYS_NAVNETCDF_ATTRIBUTELEN, storelocal->mbAbscissa_unit_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, storelocal->mbAbscissa_id, "add_offset", NC_DOUBLE, 1, &storelocal->mbAbscissa_add_offset);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbAbscissa_add_offset error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, storelocal->mbAbscissa_id, "scale_factor", NC_DOUBLE, 1, &storelocal->mbAbscissa_scale_factor);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbAbscissa_scale_factor error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbAbscissa_id, "minimum", NC_INT, 1, &storelocal->mbAbscissa_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbAbscissa_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbAbscissa_id, "maximum", NC_INT, 1, &storelocal->mbAbscissa_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbAbscissa_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbAbscissa_id, "valid_minimum", NC_INT, 1, &storelocal->mbAbscissa_valid_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbAbscissa_valid_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbAbscissa_id, "valid_maximum", NC_INT, 1, &storelocal->mbAbscissa_valid_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbAbscissa_valid_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbAbscissa_id, "missing_value", NC_INT, 1, &storelocal->mbAbscissa_missing_value);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbAbscissa_missing_value error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbAbscissa_id, "format_C", MBSYS_NAVNETCDF_ATTRIBUTELEN, storelocal->mbAbscissa_format_C);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbAbscissa_id, "orientation", MBSYS_NAVNETCDF_ATTRIBUTELEN, storelocal->mbAbscissa_orientation);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbAltitude_id, "type", MBSYS_NAVNETCDF_ATTRIBUTELEN, storelocal->mbAltitude_type);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbAltitude_id, "long_name", MBSYS_NAVNETCDF_ATTRIBUTELEN, storelocal->mbAltitude_long_name);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbAltitude_id, "name_code", MBSYS_NAVNETCDF_ATTRIBUTELEN, storelocal->mbAltitude_name_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbAltitude_id, "units", MBSYS_NAVNETCDF_ATTRIBUTELEN, storelocal->mbAltitude_units);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbAltitude_id, "unit_code", MBSYS_NAVNETCDF_ATTRIBUTELEN, storelocal->mbAltitude_unit_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, storelocal->mbAltitude_id, "add_offset", NC_DOUBLE, 1, &storelocal->mbAltitude_add_offset);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbAltitude_add_offset error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, storelocal->mbAltitude_id, "scale_factor", NC_DOUBLE, 1, &storelocal->mbAltitude_scale_factor);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbAltitude_scale_factor error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbAltitude_id, "minimum", NC_INT, 1, &storelocal->mbAltitude_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbAltitude_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbAltitude_id, "maximum", NC_INT, 1, &storelocal->mbAltitude_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbAltitude_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbAltitude_id, "valid_minimum", NC_INT, 1, &storelocal->mbAltitude_valid_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbAltitude_valid_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbAltitude_id, "valid_maximum", NC_INT, 1, &storelocal->mbAltitude_valid_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbAltitude_valid_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbAltitude_id, "missing_value", NC_INT, 1, &storelocal->mbAltitude_missing_value);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbAltitude_missing_value error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbAltitude_id, "format_C", MBSYS_NAVNETCDF_ATTRIBUTELEN, storelocal->mbAltitude_format_C);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbAltitude_id, "orientation", MBSYS_NAVNETCDF_ATTRIBUTELEN, storelocal->mbAltitude_orientation);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbImmersion_id, "type", MBSYS_NAVNETCDF_ATTRIBUTELEN, storelocal->mbImmersion_type);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbImmersion_id, "long_name", MBSYS_NAVNETCDF_ATTRIBUTELEN, storelocal->mbImmersion_long_name);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbImmersion_id, "name_code", MBSYS_NAVNETCDF_ATTRIBUTELEN, storelocal->mbImmersion_name_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbImmersion_id, "units", MBSYS_NAVNETCDF_ATTRIBUTELEN, storelocal->mbImmersion_units);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbImmersion_id, "unit_code", MBSYS_NAVNETCDF_ATTRIBUTELEN, storelocal->mbImmersion_unit_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, storelocal->mbImmersion_id, "add_offset", NC_DOUBLE, 1, &storelocal->mbImmersion_add_offset);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbImmersion_add_offset error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, storelocal->mbImmersion_id, "scale_factor", NC_DOUBLE, 1, &storelocal->mbImmersion_scale_factor);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbImmersion_scale_factor error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbImmersion_id, "minimum", NC_INT, 1, &storelocal->mbImmersion_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbImmersion_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbImmersion_id, "maximum", NC_INT, 1, &storelocal->mbImmersion_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbImmersion_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbImmersion_id, "valid_minimum", NC_INT, 1, &storelocal->mbImmersion_valid_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbImmersion_valid_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbImmersion_id, "valid_maximum", NC_INT, 1, &storelocal->mbImmersion_valid_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbImmersion_valid_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbImmersion_id, "missing_value", NC_INT, 1, &storelocal->mbImmersion_missing_value);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbImmersion_missing_value error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbImmersion_id, "format_C", MBSYS_NAVNETCDF_ATTRIBUTELEN, storelocal->mbImmersion_format_C);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbImmersion_id, "orientation", MBSYS_NAVNETCDF_ATTRIBUTELEN, storelocal->mbImmersion_orientation);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbHeading_id, "type", MBSYS_NAVNETCDF_ATTRIBUTELEN, storelocal->mbHeading_type);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbHeading_id, "long_name", MBSYS_NAVNETCDF_ATTRIBUTELEN, storelocal->mbHeading_long_name);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbHeading_id, "name_code", MBSYS_NAVNETCDF_ATTRIBUTELEN, storelocal->mbHeading_name_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbHeading_id, "units", MBSYS_NAVNETCDF_ATTRIBUTELEN, storelocal->mbHeading_units);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbHeading_id, "unit_code", MBSYS_NAVNETCDF_ATTRIBUTELEN, storelocal->mbHeading_unit_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, storelocal->mbHeading_id, "add_offset", NC_DOUBLE, 1, &storelocal->mbHeading_add_offset);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbHeading_add_offset error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, storelocal->mbHeading_id, "scale_factor", NC_DOUBLE, 1, &storelocal->mbHeading_scale_factor);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbHeading_scale_factor error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbHeading_id, "minimum", NC_INT, 1, &storelocal->mbHeading_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbHeading_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbHeading_id, "maximum", NC_INT, 1, &storelocal->mbHeading_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbHeading_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbHeading_id, "valid_minimum", NC_INT, 1, &storelocal->mbHeading_valid_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbHeading_valid_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbHeading_id, "valid_maximum", NC_INT, 1, &storelocal->mbHeading_valid_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbHeading_valid_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbHeading_id, "missing_value", NC_INT, 1, &storelocal->mbHeading_missing_value);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbHeading_missing_value error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbHeading_id, "format_C", MBSYS_NAVNETCDF_ATTRIBUTELEN, storelocal->mbHeading_format_C);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbHeading_id, "orientation", MBSYS_NAVNETCDF_ATTRIBUTELEN, storelocal->mbHeading_orientation);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbSpeed_id, "type", MBSYS_NAVNETCDF_ATTRIBUTELEN, storelocal->mbSpeed_type);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbSpeed_id, "long_name", MBSYS_NAVNETCDF_ATTRIBUTELEN, storelocal->mbSpeed_long_name);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbSpeed_id, "name_code", MBSYS_NAVNETCDF_ATTRIBUTELEN, storelocal->mbSpeed_name_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbSpeed_id, "units", MBSYS_NAVNETCDF_ATTRIBUTELEN, storelocal->mbSpeed_units);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbSpeed_id, "unit_code", MBSYS_NAVNETCDF_ATTRIBUTELEN, storelocal->mbSpeed_unit_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, storelocal->mbSpeed_id, "add_offset", NC_DOUBLE, 1, &storelocal->mbSpeed_add_offset);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbSpeed_add_offset error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_double(mb_io_ptr->ncid, storelocal->mbSpeed_id, "scale_factor", NC_DOUBLE, 1, &storelocal->mbSpeed_scale_factor);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbSpeed_scale_factor error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbSpeed_id, "minimum", NC_INT, 1, &storelocal->mbSpeed_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbSpeed_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbSpeed_id, "maximum", NC_INT, 1, &storelocal->mbSpeed_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbSpeed_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbSpeed_id, "valid_minimum", NC_INT, 1, &storelocal->mbSpeed_valid_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbSpeed_valid_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbSpeed_id, "valid_maximum", NC_INT, 1, &storelocal->mbSpeed_valid_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbSpeed_valid_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbSpeed_id, "missing_value", NC_INT, 1, &storelocal->mbSpeed_missing_value);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbSpeed_missing_value error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbSpeed_id, "format_C", MBSYS_NAVNETCDF_ATTRIBUTELEN, storelocal->mbSpeed_format_C);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbSpeed_id, "orientation", MBSYS_NAVNETCDF_ATTRIBUTELEN, storelocal->mbSpeed_orientation);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbPType_id, "type", MBSYS_NAVNETCDF_ATTRIBUTELEN, storelocal->mbPType_type);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbPType_id, "long_name", MBSYS_NAVNETCDF_ATTRIBUTELEN, storelocal->mbPType_long_name);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbPType_id, "name_code", MBSYS_NAVNETCDF_ATTRIBUTELEN, storelocal->mbPType_name_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbPType_id, "units", MBSYS_NAVNETCDF_ATTRIBUTELEN, storelocal->mbPType_units);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbPType_id, "unit_code", MBSYS_NAVNETCDF_ATTRIBUTELEN, storelocal->mbPType_unit_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbPType_id, "add_offset", NC_INT, 1, &storelocal->mbPType_add_offset);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbPType_add_offset error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbPType_id, "scale_factor", NC_INT, 1, &storelocal->mbPType_scale_factor);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbPType_scale_factor error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbPType_id, "minimum", NC_INT, 1, &storelocal->mbPType_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbPType_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbPType_id, "maximum", NC_INT, 1, &storelocal->mbPType_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbPType_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbPType_id, "valid_minimum", NC_INT, 1, &storelocal->mbPType_valid_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbPType_valid_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbPType_id, "valid_maximum", NC_INT, 1, &storelocal->mbPType_valid_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbPType_valid_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbPType_id, "missing_value", NC_INT, 1, &storelocal->mbPType_missing_value);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbPType_missing_value error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbPType_id, "format_C", MBSYS_NAVNETCDF_ATTRIBUTELEN, storelocal->mbPType_format_C);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbPType_id, "orientation", MBSYS_NAVNETCDF_ATTRIBUTELEN, storelocal->mbPType_orientation);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbPQuality_id, "type", MBSYS_NAVNETCDF_ATTRIBUTELEN, storelocal->mbPQuality_type);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbPQuality_id, "long_name", MBSYS_NAVNETCDF_ATTRIBUTELEN, storelocal->mbPQuality_long_name);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbPQuality_id, "name_code", MBSYS_NAVNETCDF_ATTRIBUTELEN, storelocal->mbPQuality_name_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbPQuality_id, "units", MBSYS_NAVNETCDF_ATTRIBUTELEN, storelocal->mbPQuality_units);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbPQuality_id, "unit_code", MBSYS_NAVNETCDF_ATTRIBUTELEN, storelocal->mbPQuality_unit_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbPQuality_id, "add_offset", NC_INT, 1, &storelocal->mbPQuality_add_offset);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbPQuality_add_offset error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbPQuality_id, "scale_factor", NC_INT, 1, &storelocal->mbPQuality_scale_factor);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbPQuality_scale_factor error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbPQuality_id, "minimum", NC_INT, 1, &storelocal->mbPQuality_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbPQuality_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbPQuality_id, "maximum", NC_INT, 1, &storelocal->mbPQuality_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbPQuality_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbPQuality_id, "valid_minimum", NC_INT, 1, &storelocal->mbPQuality_valid_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbPQuality_valid_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbPQuality_id, "valid_maximum", NC_INT, 1, &storelocal->mbPQuality_valid_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbPQuality_valid_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbPQuality_id, "missing_value", NC_INT, 1, &storelocal->mbPQuality_missing_value);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbPQuality_missing_value error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbPQuality_id, "format_C", MBSYS_NAVNETCDF_ATTRIBUTELEN, storelocal->mbPQuality_format_C);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbPQuality_id, "orientation", MBSYS_NAVNETCDF_ATTRIBUTELEN, storelocal->mbPQuality_orientation);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbPFlag_id, "type", MBSYS_NAVNETCDF_ATTRIBUTELEN, storelocal->mbPFlag_type);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbPFlag_id, "long_name", MBSYS_NAVNETCDF_ATTRIBUTELEN, storelocal->mbPFlag_long_name);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbPFlag_id, "name_code", MBSYS_NAVNETCDF_ATTRIBUTELEN, storelocal->mbPFlag_name_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbPFlag_id, "units", MBSYS_NAVNETCDF_ATTRIBUTELEN, storelocal->mbPFlag_units);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbPFlag_id, "unit_code", MBSYS_NAVNETCDF_ATTRIBUTELEN, storelocal->mbPFlag_unit_code);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbPFlag_id, "add_offset", NC_INT, 1, &storelocal->mbPFlag_add_offset);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbPFlag_add_offset error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbPFlag_id, "scale_factor", NC_INT, 1, &storelocal->mbPFlag_scale_factor);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbPFlag_scale_factor error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbPFlag_id, "minimum", NC_INT, 1, &storelocal->mbPFlag_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbPFlag_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbPFlag_id, "maximum", NC_INT, 1, &storelocal->mbPFlag_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbPFlag_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbPFlag_id, "valid_minimum", NC_INT, 1, &storelocal->mbPFlag_valid_minimum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbPFlag_valid_minimum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbPFlag_id, "valid_maximum", NC_INT, 1, &storelocal->mbPFlag_valid_maximum);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbPFlag_valid_maximum error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_int(mb_io_ptr->ncid, storelocal->mbPFlag_id, "missing_value", NC_INT, 1, &storelocal->mbPFlag_missing_value);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att mbPFlag_missing_value error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbPFlag_id, "format_C", MBSYS_NAVNETCDF_ATTRIBUTELEN, storelocal->mbPFlag_format_C);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-	    nc_status = nc_put_att_text(mb_io_ptr->ncid, storelocal->mbPFlag_id, "orientation", MBSYS_NAVNETCDF_ATTRIBUTELEN, storelocal->mbPFlag_orientation);
-	    if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_att JJJJ error: %s\n", nc_strerror(nc_status));
-
-	    /* print input debug statements */
-	    if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  NetCDF variable attributes written in function <%s>\n",function_name);
-		fprintf(stderr,"dbg2  Variable attributes:\n");
-		fprintf(stderr,"dbg2       status:                  %d\n", status);
-		fprintf(stderr,"dbg2       error:                   %d\n", *error);
-		fprintf(stderr,"dbg2       nc_status:               %d\n", nc_status);
-		fprintf(stderr,"dbg2       mbHistCode_long_name:		%s\n", storelocal->mbHistCode_long_name);
-		fprintf(stderr,"dbg2       mbHistCode_name_code:		%s\n", storelocal->mbHistCode_name_code);
-		fprintf(stderr,"dbg2       mbHistCode_units:	    %s\n", storelocal->mbHistCode_units);
-		fprintf(stderr,"dbg2       mbHistCode_unit_code:		    %s\n", storelocal->mbHistCode_unit_code);
-		fprintf(stderr,"dbg2       mbHistCode_add_offset:		    %d\n", storelocal->mbHistCode_add_offset);
-		fprintf(stderr,"dbg2       mbHistCode_scale_factor:		%d\n", storelocal->mbHistCode_scale_factor);
-		fprintf(stderr,"dbg2       mbHistCode_minimum:	    %d\n", storelocal->mbHistCode_minimum);
-		fprintf(stderr,"dbg2       mbHistCode_maximum:	    %d\n", storelocal->mbHistCode_maximum);
-		fprintf(stderr,"dbg2       mbHistCode_valid_minimum:	    %d\n", storelocal->mbHistCode_valid_minimum);
-		fprintf(stderr,"dbg2       mbHistCode_valid_maximum:	%d\n", storelocal->mbHistCode_valid_maximum);
-		fprintf(stderr,"dbg2       mbHistCode_missing_value:	%d\n", storelocal->mbHistCode_missing_value);
-		fprintf(stderr,"dbg2       mbHistCode_format_C:	    %s\n", storelocal->mbHistCode_format_C);
-		fprintf(stderr,"dbg2       mbHistCode_orientation:		%s\n", storelocal->mbHistCode_orientation);
-		fprintf(stderr,"dbg2       mbHistAutor_type:	    %s\n", storelocal->mbHistAutor_type);
-		fprintf(stderr,"dbg2       mbHistAutor_long_name:		%s\n", storelocal->mbHistAutor_long_name);
-		fprintf(stderr,"dbg2       mbHistAutor_name_code:		%s\n", storelocal->mbHistAutor_name_code);
-		fprintf(stderr,"dbg2       mbHistModule_type:	    %s\n", storelocal->mbHistModule_type);
-		fprintf(stderr,"dbg2       mbHistModule_long_name:		%s\n", storelocal->mbHistModule_long_name);
-		fprintf(stderr,"dbg2       mbHistModule_name_code:		%s\n", storelocal->mbHistModule_name_code);
-		fprintf(stderr,"dbg2       mbHistComment_type:	    %s\n", storelocal->mbHistComment_type);
-		fprintf(stderr,"dbg2       mbHistComment_long_name:		%s\n", storelocal->mbHistComment_long_name);
-		fprintf(stderr,"dbg2       mbHistComment_name_code:		%s\n", storelocal->mbHistComment_name_code);
-		fprintf(stderr,"dbg2       mbDate_type:		%s\n", storelocal->mbDate_type);
-		fprintf(stderr,"dbg2       mbDate_long_name:		%s\n", storelocal->mbDate_long_name);
-		fprintf(stderr,"dbg2       mbDate_name_code:		%s\n", storelocal->mbDate_name_code);
-		fprintf(stderr,"dbg2       mbDate_units:		%s\n", storelocal->mbDate_units);
-		fprintf(stderr,"dbg2       mbDate_unit_code:		%s\n", storelocal->mbDate_unit_code);
-		fprintf(stderr,"dbg2       mbDate_add_offset:		%d\n", storelocal->mbDate_add_offset);
-		fprintf(stderr,"dbg2       mbDate_scale_factor:		%d\n", storelocal->mbDate_scale_factor);
-		fprintf(stderr,"dbg2       mbDate_minimum:		%d\n", storelocal->mbDate_minimum);
-		fprintf(stderr,"dbg2       mbDate_maximum:		%d\n", storelocal->mbDate_maximum);
-		fprintf(stderr,"dbg2       mbDate_valid_minimum:		%d\n", storelocal->mbDate_valid_minimum);
-		fprintf(stderr,"dbg2       mbDate_valid_maximum:		%d\n", storelocal->mbDate_valid_maximum);
-		fprintf(stderr,"dbg2       mbDate_missing_value:		%d\n", storelocal->mbDate_missing_value);
-		fprintf(stderr,"dbg2       mbDate_format_C:		%s\n", storelocal->mbDate_format_C);
-		fprintf(stderr,"dbg2       mbDate_orientation:		%s\n", storelocal->mbDate_orientation);
-		fprintf(stderr,"dbg2       mbTime_type:		%s\n", storelocal->mbTime_type);
-		fprintf(stderr,"dbg2       mbTime_long_name:		%s\n", storelocal->mbTime_long_name);
-		fprintf(stderr,"dbg2       mbTime_name_code:		%s\n", storelocal->mbTime_name_code);
-		fprintf(stderr,"dbg2       mbTime_units:		%s\n", storelocal->mbTime_units);
-		fprintf(stderr,"dbg2       mbTime_unit_code:		%s\n", storelocal->mbTime_unit_code);
-		fprintf(stderr,"dbg2       mbTime_add_offset:		%d\n", storelocal->mbTime_add_offset);
-		fprintf(stderr,"dbg2       mbTime_scale_factor:		%d\n", storelocal->mbTime_scale_factor);
-		fprintf(stderr,"dbg2       mbTime_minimum:		%d\n", storelocal->mbTime_minimum);
-		fprintf(stderr,"dbg2       mbTime_maximum:		%d\n", storelocal->mbTime_maximum);
-		fprintf(stderr,"dbg2       mbTime_valid_minimum:		%d\n", storelocal->mbTime_valid_minimum);
-		fprintf(stderr,"dbg2       mbTime_valid_maximum:		%d\n", storelocal->mbTime_valid_maximum);
-		fprintf(stderr,"dbg2       mbTime_missing_value:		%d\n", storelocal->mbTime_missing_value);
-		fprintf(stderr,"dbg2       mbTime_format_C:		%s\n", storelocal->mbTime_format_C);
-		fprintf(stderr,"dbg2       mbTime_orientation:		%s\n", storelocal->mbTime_orientation);
-		fprintf(stderr,"dbg2       mbOrdinate_type:		%s\n", storelocal->mbOrdinate_type);
-		fprintf(stderr,"dbg2       mbOrdinate_long_name:		%s\n", storelocal->mbOrdinate_long_name);
-		fprintf(stderr,"dbg2       mbOrdinate_name_code:		%s\n", storelocal->mbOrdinate_name_code);
-		fprintf(stderr,"dbg2       mbOrdinate_units:		%s\n", storelocal->mbOrdinate_units);
-		fprintf(stderr,"dbg2       mbOrdinate_unit_code:		%s\n", storelocal->mbOrdinate_unit_code);
-		fprintf(stderr,"dbg2       mbOrdinate_add_offset:		%f\n", storelocal->mbOrdinate_add_offset);
-		fprintf(stderr,"dbg2       mbOrdinate_scale_factor:		%f\n", storelocal->mbOrdinate_scale_factor);
-		fprintf(stderr,"dbg2       mbOrdinate_minimum:		%d\n", storelocal->mbOrdinate_minimum);
-		fprintf(stderr,"dbg2       mbOrdinate_maximum:		%d\n", storelocal->mbOrdinate_maximum);
-		fprintf(stderr,"dbg2       mbOrdinate_valid_minimum:		%d\n", storelocal->mbOrdinate_valid_minimum);
-		fprintf(stderr,"dbg2       mbOrdinate_valid_maximum:		%d\n", storelocal->mbOrdinate_valid_maximum);
-		fprintf(stderr,"dbg2       mbOrdinate_missing_value:		%d\n", storelocal->mbOrdinate_missing_value);
-		fprintf(stderr,"dbg2       mbOrdinate_format_C:		%s\n", storelocal->mbOrdinate_format_C);
-		fprintf(stderr,"dbg2       mbOrdinate_orientation:		%s\n", storelocal->mbOrdinate_orientation);
-		fprintf(stderr,"dbg2       mbAbscissa_type:		%s\n", storelocal->mbAbscissa_type);
-		fprintf(stderr,"dbg2       mbAbscissa_long_name:		%s\n", storelocal->mbAbscissa_long_name);
-		fprintf(stderr,"dbg2       mbAbscissa_name_code:		%s\n", storelocal->mbAbscissa_name_code);
-		fprintf(stderr,"dbg2       mbAbscissa_units:		%s\n", storelocal->mbAbscissa_units);
-		fprintf(stderr,"dbg2       mbAbscissa_unit_code:		%s\n", storelocal->mbAbscissa_unit_code);
-		fprintf(stderr,"dbg2       mbAbscissa_add_offset:		%f\n", storelocal->mbAbscissa_add_offset);
-		fprintf(stderr,"dbg2       mbAbscissa_scale_factor:		%f\n", storelocal->mbAbscissa_scale_factor);
-		fprintf(stderr,"dbg2       mbAbscissa_minimum:		%d\n", storelocal->mbAbscissa_minimum);
-		fprintf(stderr,"dbg2       mbAbscissa_maximum:		%d\n", storelocal->mbAbscissa_maximum);
-		fprintf(stderr,"dbg2       mbAbscissa_valid_minimum:		%d\n", storelocal->mbAbscissa_valid_minimum);
-		fprintf(stderr,"dbg2       mbAbscissa_valid_maximum:		%d\n", storelocal->mbAbscissa_valid_maximum);
-		fprintf(stderr,"dbg2       mbAbscissa_missing_value:		%d\n", storelocal->mbAbscissa_missing_value);
-		fprintf(stderr,"dbg2       mbAbscissa_format_C:		%s\n", storelocal->mbAbscissa_format_C);
-		fprintf(stderr,"dbg2       mbAbscissa_orientation:		%s\n", storelocal->mbAbscissa_orientation);
-		fprintf(stderr,"dbg2       mbAltitude_type:		%s\n", storelocal->mbAltitude_type);
-		fprintf(stderr,"dbg2       mbAltitude_long_name:		%s\n", storelocal->mbAltitude_long_name);
-		fprintf(stderr,"dbg2       mbAltitude_name_code:		%s\n", storelocal->mbAltitude_name_code);
-		fprintf(stderr,"dbg2       mbAltitude_units:		%s\n", storelocal->mbAltitude_units);
-		fprintf(stderr,"dbg2       mbAltitude_unit_code:		%s\n", storelocal->mbAltitude_unit_code);
-		fprintf(stderr,"dbg2       mbAltitude_add_offset:		%f\n", storelocal->mbAltitude_add_offset);
-		fprintf(stderr,"dbg2       mbAltitude_scale_factor:		%f\n", storelocal->mbAltitude_scale_factor);
-		fprintf(stderr,"dbg2       mbAltitude_minimum:		%d\n", storelocal->mbAltitude_minimum);
-		fprintf(stderr,"dbg2       mbAltitude_maximum:		%d\n", storelocal->mbAltitude_maximum);
-		fprintf(stderr,"dbg2       mbAltitude_valid_minimum:		%d\n", storelocal->mbAltitude_valid_minimum);
-		fprintf(stderr,"dbg2       mbAltitude_valid_maximum:		%d\n", storelocal->mbAltitude_valid_maximum);
-		fprintf(stderr,"dbg2       mbAltitude_missing_value:		%d\n", storelocal->mbAltitude_missing_value);
-		fprintf(stderr,"dbg2       mbAltitude_format_C:		%s\n", storelocal->mbAltitude_format_C);
-		fprintf(stderr,"dbg2       mbAltitude_orientation:		%s\n", storelocal->mbAltitude_orientation);
-		fprintf(stderr,"dbg2       mbImmersion_type:		%s\n", storelocal->mbImmersion_type);
-		fprintf(stderr,"dbg2       mbImmersion_long_name:		%s\n", storelocal->mbImmersion_long_name);
-		fprintf(stderr,"dbg2       mbImmersion_name_code:		%s\n", storelocal->mbImmersion_name_code);
-		fprintf(stderr,"dbg2       mbImmersion_units:		%s\n", storelocal->mbImmersion_units);
-		fprintf(stderr,"dbg2       mbImmersion_unit_code:		%s\n", storelocal->mbImmersion_unit_code);
-		fprintf(stderr,"dbg2       mbImmersion_add_offset:		%f\n", storelocal->mbImmersion_add_offset);
-		fprintf(stderr,"dbg2       mbImmersion_scale_factor:		%f\n", storelocal->mbImmersion_scale_factor);
-		fprintf(stderr,"dbg2       mbImmersion_minimum:		%d\n", storelocal->mbImmersion_minimum);
-		fprintf(stderr,"dbg2       mbImmersion_maximum:		%d\n", storelocal->mbImmersion_maximum);
-		fprintf(stderr,"dbg2       mbImmersion_valid_minimum:		%d\n", storelocal->mbImmersion_valid_minimum);
-		fprintf(stderr,"dbg2       mbImmersion_valid_maximum:		%d\n", storelocal->mbImmersion_valid_maximum);
-		fprintf(stderr,"dbg2       mbImmersion_missing_value:		%d\n", storelocal->mbImmersion_missing_value);
-		fprintf(stderr,"dbg2       mbImmersion_format_C:		%s\n", storelocal->mbImmersion_format_C);
-		fprintf(stderr,"dbg2       mbImmersion_orientation:		%s\n", storelocal->mbImmersion_orientation);
-		fprintf(stderr,"dbg2       mbHeading_type:		%s\n", storelocal->mbHeading_type);
-		fprintf(stderr,"dbg2       mbHeading_long_name:		%s\n", storelocal->mbHeading_long_name);
-		fprintf(stderr,"dbg2       mbHeading_name_code:		%s\n", storelocal->mbHeading_name_code);
-		fprintf(stderr,"dbg2       mbHeading_units:		%s\n", storelocal->mbHeading_units);
-		fprintf(stderr,"dbg2       mbHeading_unit_code:		%s\n", storelocal->mbHeading_unit_code);
-		fprintf(stderr,"dbg2       mbHeading_add_offset:		%f\n", storelocal->mbHeading_add_offset);
-		fprintf(stderr,"dbg2       mbHeading_scale_factor:		%f\n", storelocal->mbHeading_scale_factor);
-		fprintf(stderr,"dbg2       mbHeading_minimum:		%d\n", storelocal->mbHeading_minimum);
-		fprintf(stderr,"dbg2       mbHeading_maximum:		%d\n", storelocal->mbHeading_maximum);
-		fprintf(stderr,"dbg2       mbHeading_valid_minimum:		%d\n", storelocal->mbHeading_valid_minimum);
-		fprintf(stderr,"dbg2       mbHeading_valid_maximum:		%d\n", storelocal->mbHeading_valid_maximum);
-		fprintf(stderr,"dbg2       mbHeading_missing_value:		%d\n", storelocal->mbHeading_missing_value);
-		fprintf(stderr,"dbg2       mbHeading_format_C:		%s\n", storelocal->mbHeading_format_C);
-		fprintf(stderr,"dbg2       mbHeading_orientation:		%s\n", storelocal->mbHeading_orientation);
-		fprintf(stderr,"dbg2       mbSpeed_type:		%s\n", storelocal->mbSpeed_type);
-		fprintf(stderr,"dbg2       mbSpeed_long_name:		%s\n", storelocal->mbSpeed_long_name);
-		fprintf(stderr,"dbg2       mbSpeed_name_code:		%s\n", storelocal->mbSpeed_name_code);
-		fprintf(stderr,"dbg2       mbSpeed_units:		%s\n", storelocal->mbSpeed_units);
-		fprintf(stderr,"dbg2       mbSpeed_unit_code:		%s\n", storelocal->mbSpeed_unit_code);
-		fprintf(stderr,"dbg2       mbSpeed_add_offset:		%f\n", storelocal->mbSpeed_add_offset);
-		fprintf(stderr,"dbg2       mbSpeed_scale_factor:		%f\n", storelocal->mbSpeed_scale_factor);
-		fprintf(stderr,"dbg2       mbSpeed_minimum:		%d\n", storelocal->mbSpeed_minimum);
-		fprintf(stderr,"dbg2       mbSpeed_maximum:		%d\n", storelocal->mbSpeed_maximum);
-		fprintf(stderr,"dbg2       mbSpeed_valid_minimum:		%d\n", storelocal->mbSpeed_valid_minimum);
-		fprintf(stderr,"dbg2       mbSpeed_valid_maximum:		%d\n", storelocal->mbSpeed_valid_maximum);
-		fprintf(stderr,"dbg2       mbSpeed_missing_value:		%d\n", storelocal->mbSpeed_missing_value);
-		fprintf(stderr,"dbg2       mbSpeed_format_C:		%s\n", storelocal->mbSpeed_format_C);
-		fprintf(stderr,"dbg2       mbSpeed_orientation:		%s\n", storelocal->mbSpeed_orientation);
-		fprintf(stderr,"dbg2       mbPType_type:		%s\n", storelocal->mbPType_type);
-		fprintf(stderr,"dbg2       mbPType_long_name:		%s\n", storelocal->mbPType_long_name);
-		fprintf(stderr,"dbg2       mbPType_name_code:		%s\n", storelocal->mbPType_name_code);
-		fprintf(stderr,"dbg2       mbPType_units:		%s\n", storelocal->mbPType_units);
-		fprintf(stderr,"dbg2       mbPType_unit_code:		%s\n", storelocal->mbPType_unit_code);
-		fprintf(stderr,"dbg2       mbPType_add_offset:		%d\n", storelocal->mbPType_add_offset);
-		fprintf(stderr,"dbg2       mbPType_scale_factor:		%d\n", storelocal->mbPType_scale_factor);
-		fprintf(stderr,"dbg2       mbPType_minimum:		%d\n", storelocal->mbPType_minimum);
-		fprintf(stderr,"dbg2       mbPType_maximum:		%d\n", storelocal->mbPType_maximum);
-		fprintf(stderr,"dbg2       mbPType_valid_minimum:		%d\n", storelocal->mbPType_valid_minimum);
-		fprintf(stderr,"dbg2       mbPType_valid_maximum:		%d\n", storelocal->mbPType_valid_maximum);
-		fprintf(stderr,"dbg2       mbPType_missing_value:		%d\n", storelocal->mbPType_missing_value);
-		fprintf(stderr,"dbg2       mbPType_format_C:		%s\n", storelocal->mbPType_format_C);
-		fprintf(stderr,"dbg2       mbPType_orientation:		%s\n", storelocal->mbPType_orientation);
-		fprintf(stderr,"dbg2       mbPQuality_type:		%s\n", storelocal->mbPQuality_type);
-		fprintf(stderr,"dbg2       mbPQuality_long_name:		%s\n", storelocal->mbPQuality_long_name);
-		fprintf(stderr,"dbg2       mbPQuality_name_code:		%s\n", storelocal->mbPQuality_name_code);
-		fprintf(stderr,"dbg2       mbPQuality_units:		%s\n", storelocal->mbPQuality_units);
-		fprintf(stderr,"dbg2       mbPQuality_unit_code:		%s\n", storelocal->mbPQuality_unit_code);
-		fprintf(stderr,"dbg2       mbPQuality_add_offset:		%d\n", storelocal->mbPQuality_add_offset);
-		fprintf(stderr,"dbg2       mbPQuality_scale_factor:		%d\n", storelocal->mbPQuality_scale_factor);
-		fprintf(stderr,"dbg2       mbPQuality_minimum:		%d\n", storelocal->mbPQuality_minimum);
-		fprintf(stderr,"dbg2       mbPQuality_maximum:		%d\n", storelocal->mbPQuality_maximum);
-		fprintf(stderr,"dbg2       mbPQuality_valid_minimum:		%d\n", storelocal->mbPQuality_valid_minimum);
-		fprintf(stderr,"dbg2       mbPQuality_valid_maximum:		%d\n", storelocal->mbPQuality_valid_maximum);
-		fprintf(stderr,"dbg2       mbPQuality_missing_value:		%d\n", storelocal->mbPQuality_missing_value);
-		fprintf(stderr,"dbg2       mbPQuality_format_C:		%s\n", storelocal->mbPQuality_format_C);
-		fprintf(stderr,"dbg2       mbPQuality_orientation:		%s\n", storelocal->mbPQuality_orientation);
-		fprintf(stderr,"dbg2       mbPFlag_type:		%s\n", storelocal->mbPFlag_type);
-		fprintf(stderr,"dbg2       mbPFlag_long_name:		%s\n", storelocal->mbPFlag_long_name);
-		fprintf(stderr,"dbg2       mbPFlag_name_code:		%s\n", storelocal->mbPFlag_name_code);
-		fprintf(stderr,"dbg2       mbPFlag_units:		%s\n", storelocal->mbPFlag_units);
-		fprintf(stderr,"dbg2       mbPFlag_unit_code:		%s\n", storelocal->mbPFlag_unit_code);
-		fprintf(stderr,"dbg2       mbPFlag_add_offset:		%d\n", storelocal->mbPFlag_add_offset);
-		fprintf(stderr,"dbg2       mbPFlag_scale_factor:		%d\n", storelocal->mbPFlag_scale_factor);
-		fprintf(stderr,"dbg2       mbPFlag_minimum:		%d\n", storelocal->mbPFlag_minimum);
-		fprintf(stderr,"dbg2       mbPFlag_maximum:		%d\n", storelocal->mbPFlag_maximum);
-		fprintf(stderr,"dbg2       mbPFlag_valid_minimum:		%d\n", storelocal->mbPFlag_valid_minimum);
-		fprintf(stderr,"dbg2       mbPFlag_valid_maximum:		%d\n", storelocal->mbPFlag_valid_maximum);
-		fprintf(stderr,"dbg2       mbPFlag_missing_value:		%d\n", storelocal->mbPFlag_missing_value);
-		fprintf(stderr,"dbg2       mbPFlag_format_C:		%s\n", storelocal->mbPFlag_format_C);
-		fprintf(stderr,"dbg2       mbPFlag_orientation:		%s\n", storelocal->mbPFlag_orientation);
-		}
-
-	    /* end define mode */
-	    nc_status = nc_enddef(mb_io_ptr->ncid);
-
-	    /* save the comments */
-
-	    /* save the beam arrays */
-
-	    /* save the soundvel arrays */
-
-	    /* write global variables */
-	    if (status == MB_SUCCESS)
-		{
-		index[0] = 0;
-		count[0] = storelocal->mbHistoryRecNbr;
-		nc_status = nc_put_vara_int(mb_io_ptr->ncid, storelocal->mbHistDate_id, index, count, storelocal->mbHistDate);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_vara mbHistDate error: %s\n", nc_strerror(nc_status));
-
-		index[0] = 0;
-		count[0] = storelocal->mbHistoryRecNbr;
-		nc_status = nc_put_vara_int(mb_io_ptr->ncid, storelocal->mbHistTime_id, index, count, storelocal->mbHistTime);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_vara mbHistTime error: %s\n", nc_strerror(nc_status));
-
-		index[0] = 0;
-		count[0] = storelocal->mbHistoryRecNbr;
-		nc_status = nc_put_vara_text(mb_io_ptr->ncid, storelocal->mbHistCode_id, index, count, storelocal->mbHistCode);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_vara mbHistCode error: %s\n", nc_strerror(nc_status));
-
-		index[0] = 0;
-		index[1] = 0;
-		count[0] = storelocal->mbHistoryRecNbr;
-		count[1] = storelocal->mbNameLength;
-		nc_status = nc_put_vara_text(mb_io_ptr->ncid, storelocal->mbHistAutor_id, index, count, storelocal->mbHistAutor);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_vara mbHistAutor error: %s\n", nc_strerror(nc_status));
-
-		index[0] = 0;
-		index[1] = 0;
-		count[0] = storelocal->mbHistoryRecNbr;
-		count[1] = storelocal->mbNameLength;
-		nc_status = nc_put_vara_text(mb_io_ptr->ncid, storelocal->mbHistModule_id, index, count, storelocal->mbHistModule);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_vara mbHistModule error: %s\n", nc_strerror(nc_status));
-
-		index[0] = 0;
-		index[1] = 0;
-		count[0] = storelocal->mbHistoryRecNbr;
-		count[1] = storelocal->mbCommentLength;
-		nc_status = nc_put_vara_text(mb_io_ptr->ncid, storelocal->mbHistComment_id, index, count, storelocal->mbHistComment);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_vara mbHistComment error: %s\n", nc_strerror(nc_status));
-
-		if (nc_status != NC_NOERR)
-		    {
-		    status = MB_FAILURE;
-		    *error = MB_ERROR_EOF;
-		    }
-		}
-	    }
-
-	/* now write the data */
-	if (store->kind == MB_DATA_DATA
-	    && status == MB_SUCCESS)
-	    {
-	    /* write the variables from next record */
-	    index[0] = *recwrite;
-	    count[0] = 1;
-	    nc_status = nc_put_vara_int(mb_io_ptr->ncid, storelocal->mbDate_id, index, count, &store->mbDate);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_vara mbDate error: %s\n", nc_strerror(nc_status));
-	    index[0] = *recwrite;
-	    count[0] = 1;
-	    nc_status = nc_put_vara_int(mb_io_ptr->ncid, storelocal->mbTime_id, index, count, &store->mbTime);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_vara mbTime error: %s\n", nc_strerror(nc_status));
-	    index[0] = *recwrite;
-	    count[0] = 1;
-	    nc_status = nc_put_vara_int(mb_io_ptr->ncid, storelocal->mbOrdinate_id, index, count, &store->mbOrdinate);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_vara mbOrdinate error: %s\n", nc_strerror(nc_status));
-	    index[0] = *recwrite;
-	    count[0] = 1;
-	    nc_status = nc_put_vara_int(mb_io_ptr->ncid, storelocal->mbAbscissa_id, index, count, &store->mbAbscissa);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_vara mbAbscissa error: %s\n", nc_strerror(nc_status));
-	    index[0] = *recwrite;
-	    count[0] = 1;
-	    nc_status = nc_put_vara_short(mb_io_ptr->ncid, storelocal->mbAltitude_id, index, count, &store->mbAltitude);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_vara mbAltitude error: %s\n", nc_strerror(nc_status));
-	    index[0] = *recwrite;
-	    count[0] = 1;
-	    nc_status = nc_put_vara_short(mb_io_ptr->ncid, storelocal->mbImmersion_id, index, count, &store->mbImmersion);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_vara mbImmersion error: %s\n", nc_strerror(nc_status));
-	    index[0] = *recwrite;
-	    count[0] = 1;
-	    nc_status = nc_put_vara_int(mb_io_ptr->ncid, storelocal->mbHeading_id, index, count, &store->mbHeading);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_vara mbHeading error: %s\n", nc_strerror(nc_status));
-	    index[0] = *recwrite;
-	    count[0] = 1;
-	    nc_status = nc_put_vara_short(mb_io_ptr->ncid, storelocal->mbSpeed_id, index, count, &store->mbSpeed);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_vara mbSpeed error: %s\n", nc_strerror(nc_status));
-	    index[0] = *recwrite;
-	    count[0] = 1;
-	    nc_status = nc_put_vara_text(mb_io_ptr->ncid, storelocal->mbPType_id, index, count, &store->mbPType);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_vara mbPType error: %s\n", nc_strerror(nc_status));
-	    index[0] = *recwrite;
-	    count[0] = 1;
-	    nc_status = nc_put_vara_text(mb_io_ptr->ncid, storelocal->mbPQuality_id, index, count, &store->mbPQuality);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_vara mbPQuality error: %s\n", nc_strerror(nc_status));
-	    index[0] = *recwrite;
-	    count[0] = 1;
-	    nc_status = nc_put_vara_text(mb_io_ptr->ncid, storelocal->mbPFlag_id, index, count, &store->mbPFlag);
-	    	if ((verbose >= 2 || nc_verbose >= 1) && nc_status != NC_NOERR) fprintf(stderr, "nc_put_vara mbPFlag error: %s\n", nc_strerror(nc_status));
-
-	    /* check status */
-	    if (nc_status != NC_NOERR)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	    /* print input debug statements */
-	    if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  NetCDF Survey Record written in function <%s>\n",function_name);
-		fprintf(stderr,"dbg2  Global Variables:\n");
-		fprintf(stderr,"dbg2       status:                  %d\n", status);
-		fprintf(stderr,"dbg2       error:                   %d\n", *error);
-		fprintf(stderr,"dbg2       nc_status:               %d\n", nc_status);
-		fprintf(stderr,"dbg2       mbDate:                  %d\n", store->mbDate);
-		fprintf(stderr,"dbg2       mbTime:                  %d\n", store->mbTime);
-		fprintf(stderr,"dbg2       mbOrdinate:              %d\n", store->mbOrdinate);
-		fprintf(stderr,"dbg2       mbAbscissa:              %d\n", store->mbAbscissa);
-		fprintf(stderr,"dbg2       mbAltitude:              %d\n", store->mbAltitude);
-		fprintf(stderr,"dbg2       mbImmersion:             %d\n", store->mbImmersion);
-		fprintf(stderr,"dbg2       mbHeading:               %d\n", store->mbHeading);
-		fprintf(stderr,"dbg2       mbSpeed:                 %d\n", store->mbSpeed);
-		fprintf(stderr,"dbg2       mbPType:                 %d\n", store->mbPType);
-		fprintf(stderr,"dbg2       mbPQuality:              %d\n", store->mbPQuality);
-		fprintf(stderr,"dbg2       mbPFlag:                 %d\n", store->mbPFlag);
-		}
-
-	    /* set counters */
-	    (*recwrite)++;
-	    (*datawrite)++;
-
-	    }
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mbr_oicgeoda.c b/src/mbio/mbr_oicgeoda.c
deleted file mode 100644
index 805ed56..0000000
--- a/src/mbio/mbr_oicgeoda.c
+++ /dev/null
@@ -1,2134 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbr_oicgeoda.c	2/16/99
- *	$Id: mbr_oicgeoda.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1999-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbr_oicgeoda.c contains the functions for reading and writing
- * multibeam data in the MBF_OICGEODA format.
- * These functions include:
- *   mbr_alm_oicgeoda	- allocate read/write memory
- *   mbr_dem_oicgeoda	- deallocate read/write memory
- *   mbr_rt_oicgeoda	- read and translate data
- *   mbr_wt_oicgeoda	- translate and write data
- *
- * Author:	D. W. Caress
- * Date:	February 16, 1999
- *
- * $Log: mbr_oicgeoda.c,v $
- * Revision 5.10  2008/07/10 18:02:39  caress
- * Proceeding towards 5.1.1beta20.
- *
- * Revision 5.7  2005/11/05 00:48:03  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.6  2003/05/20 18:05:32  caress
- * Added svp_source to data source parameters.
- *
- * Revision 5.5  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.4  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.3  2001/07/20 00:32:54  caress
- * Release 5.0.beta03
- *
- * Revision 5.2  2001/03/22  20:50:02  caress
- * Trying to make version 5.0.beta0
- *
- * Revision 5.1  2001/01/22  07:43:34  caress
- * Version 5.0.beta01
- *
- * Revision 5.0  2000/12/01  22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.4  2000/10/11  01:03:21  caress
- * Convert to ANSI C
- *
- * Revision 4.3  2000/09/30  06:34:20  caress
- * Snapshot for Dale.
- *
- * Revision 4.2  1999/12/29  00:34:06  caress
- * Release 4.6.8
- *
- * Revision 4.1  1999/10/21  22:40:10  caress
- * Let module pass easting northing nav.
- *
- * Revision 4.0  1999/03/31  18:29:20  caress
- * MB-System 4.6beta7
- *
- * Revision 1.1  1999/03/31  18:11:35  caress
- * Initial revision
- *
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mb_define.h"
-#include "mbf_oicgeoda.h"
-#include "mbsys_oic.h"
-
-/* include for byte swapping on little-endian machines */
-#ifdef BYTESWAPPED
-#include "mb_swap.h"
-#endif
-
-/* essential function prototypes */
-int mbr_register_oicgeoda(int verbose, void *mbio_ptr,
-		int *error);
-int mbr_info_oicgeoda(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_alm_oicgeoda(int verbose, void *mbio_ptr, int *error);
-int mbr_dem_oicgeoda(int verbose, void *mbio_ptr, int *error);
-int mbr_rt_oicgeoda(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_wt_oicgeoda(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-
-static char rcs_id[]="$Id: mbr_oicgeoda.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mbr_register_oicgeoda(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_register_oicgeoda";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* get mb_io_ptr */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set format info parameters */
-	status = mbr_info_oicgeoda(verbose,
-			&mb_io_ptr->system,
-			&mb_io_ptr->beams_bath_max,
-			&mb_io_ptr->beams_amp_max,
-			&mb_io_ptr->pixels_ss_max,
-			mb_io_ptr->format_name,
-			mb_io_ptr->system_name,
-			mb_io_ptr->format_description,
-			&mb_io_ptr->numfile,
-			&mb_io_ptr->filetype,
-			&mb_io_ptr->variable_beams,
-			&mb_io_ptr->traveltime,
-			&mb_io_ptr->beam_flagging,
-			&mb_io_ptr->nav_source,
-			&mb_io_ptr->heading_source,
-			&mb_io_ptr->vru_source,
-			&mb_io_ptr->svp_source,
-			&mb_io_ptr->beamwidth_xtrack,
-			&mb_io_ptr->beamwidth_ltrack,
-			error);
-
-	/* set format and system specific function pointers */
-	mb_io_ptr->mb_io_format_alloc = &mbr_alm_oicgeoda;
-	mb_io_ptr->mb_io_format_free = &mbr_dem_oicgeoda;
-	mb_io_ptr->mb_io_store_alloc = &mbsys_oic_alloc;
-	mb_io_ptr->mb_io_store_free = &mbsys_oic_deall;
-	mb_io_ptr->mb_io_read_ping = &mbr_rt_oicgeoda;
-	mb_io_ptr->mb_io_write_ping = &mbr_wt_oicgeoda;
-	mb_io_ptr->mb_io_dimensions = &mbsys_oic_dimensions;
-	mb_io_ptr->mb_io_extract = &mbsys_oic_extract;
-	mb_io_ptr->mb_io_insert = &mbsys_oic_insert;
-	mb_io_ptr->mb_io_extract_nav = &mbsys_oic_extract_nav;
-	mb_io_ptr->mb_io_insert_nav = &mbsys_oic_insert_nav;
-	mb_io_ptr->mb_io_extract_altitude = &mbsys_oic_extract_altitude;
-	mb_io_ptr->mb_io_insert_altitude = &mbsys_oic_insert_altitude;
-	mb_io_ptr->mb_io_extract_svp = NULL;
-	mb_io_ptr->mb_io_insert_svp = NULL;
-	mb_io_ptr->mb_io_ttimes = &mbsys_oic_ttimes;
-	mb_io_ptr->mb_io_detects = &mbsys_oic_detects;
-	mb_io_ptr->mb_io_copyrecord = &mbsys_oic_copy;
-	mb_io_ptr->mb_io_extract_rawss = NULL;
-	mb_io_ptr->mb_io_insert_rawss = NULL;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",mb_io_ptr->system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",mb_io_ptr->beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",mb_io_ptr->beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",mb_io_ptr->pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",mb_io_ptr->format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",mb_io_ptr->system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",mb_io_ptr->format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",mb_io_ptr->numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",mb_io_ptr->filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",mb_io_ptr->variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",mb_io_ptr->traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",mb_io_ptr->beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",mb_io_ptr->nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",mb_io_ptr->heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",mb_io_ptr->vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",mb_io_ptr->svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",mb_io_ptr->beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",mb_io_ptr->beamwidth_ltrack);
-		fprintf(stderr,"dbg2       format_alloc:       %p\n",(void *)mb_io_ptr->mb_io_format_alloc);
-		fprintf(stderr,"dbg2       format_free:        %p\n",(void *)mb_io_ptr->mb_io_format_free);
-		fprintf(stderr,"dbg2       store_alloc:        %p\n",(void *)mb_io_ptr->mb_io_store_alloc);
-		fprintf(stderr,"dbg2       store_free:         %p\n",(void *)mb_io_ptr->mb_io_store_free);
-		fprintf(stderr,"dbg2       read_ping:          %p\n",(void *)mb_io_ptr->mb_io_read_ping);
-		fprintf(stderr,"dbg2       write_ping:         %p\n",(void *)mb_io_ptr->mb_io_write_ping);
-		fprintf(stderr,"dbg2       extract:            %p\n",(void *)mb_io_ptr->mb_io_extract);
-		fprintf(stderr,"dbg2       insert:             %p\n",(void *)mb_io_ptr->mb_io_insert);
-		fprintf(stderr,"dbg2       extract_nav:        %p\n",(void *)mb_io_ptr->mb_io_extract_nav);
-		fprintf(stderr,"dbg2       insert_nav:         %p\n",(void *)mb_io_ptr->mb_io_insert_nav);
-		fprintf(stderr,"dbg2       extract_altitude:   %p\n",(void *)mb_io_ptr->mb_io_extract_altitude);
-		fprintf(stderr,"dbg2       insert_altitude:    %p\n",(void *)mb_io_ptr->mb_io_insert_altitude);
-		fprintf(stderr,"dbg2       extract_svp:        %p\n",(void *)mb_io_ptr->mb_io_extract_svp);
-		fprintf(stderr,"dbg2       insert_svp:         %p\n",(void *)mb_io_ptr->mb_io_insert_svp);
-		fprintf(stderr,"dbg2       ttimes:             %p\n",(void *)mb_io_ptr->mb_io_ttimes);
-		fprintf(stderr,"dbg2       detects:            %p\n",(void *)mb_io_ptr->mb_io_detects);
-		fprintf(stderr,"dbg2       extract_rawss:      %p\n",(void *)mb_io_ptr->mb_io_extract_rawss);
-		fprintf(stderr,"dbg2       insert_rawss:       %p\n",(void *)mb_io_ptr->mb_io_insert_rawss);
-		fprintf(stderr,"dbg2       copyrecord:         %p\n",(void *)mb_io_ptr->mb_io_copyrecord);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbr_info_oicgeoda(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error)
-{
-	char	*function_name = "mbr_info_oicgeoda";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* set format info parameters */
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-	*system = MB_SYS_OIC;
-	*beams_bath_max = 1024;
-	*beams_amp_max = 256;
-	*pixels_ss_max = 2048;
-	strncpy(format_name, "OICGEODA", MB_NAME_LENGTH);
-	strncpy(system_name, "OIC", MB_NAME_LENGTH);
-	strncpy(format_description, "Format name:          MBF_OICGEODA\nInformal Description: OIC swath sonar format\nAttributes:           variable beam bathymetry and\n                      amplitude, variable pixel sidescan, binary,\n		      Oceanic Imaging Consultants\n", MB_DESCRIPTION_LENGTH);
-	*numfile = 1;
-	*filetype = MB_FILETYPE_NORMAL;
-	*variable_beams = MB_YES;
-	*traveltime = MB_YES;
-	*beam_flagging = MB_YES;
-	*nav_source = MB_DATA_DATA;
-	*heading_source = MB_DATA_DATA;
-	*vru_source = MB_DATA_DATA;
-	*svp_source = MB_DATA_NONE;
-	*beamwidth_xtrack = 0.0;
-	*beamwidth_ltrack = 0.0;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",*system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",*beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",*beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",*pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",*numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",*filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",*variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",*traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",*beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",*nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",*heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",*vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",*svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",*beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",*beamwidth_ltrack);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_alm_oicgeoda(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_alm_oicgeoda";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_oicgeoda_struct *dataplus;
-	struct mbf_oicgeoda_header_struct *header;
-	struct mbf_oicgeoda_data_struct *data;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set initial status */
-	status = MB_SUCCESS;
-
-	/* allocate memory for data structure */
-	mb_io_ptr->structure_size = sizeof(struct mbf_oicgeoda_struct);
-	status = mb_mallocd(verbose,__FILE__,__LINE__,mb_io_ptr->structure_size,
-				(void **)&mb_io_ptr->raw_data,error);
-	dataplus = (struct mbf_oicgeoda_struct *) mb_io_ptr->raw_data;
-	header = &(dataplus->header);
-	data = &(dataplus->data);
-	header->num_chan = 0;
-	header->beams_bath = 0;
-	header->beams_amp = 0;
-	header->bath_chan_port = -1;
-	header->bath_chan_stbd = -1;
-	header->pixels_ss = 0;
-	header->ss_chan_port = -1;
-	header->ss_chan_stbd = -1;
-	for (i=0;i<MBF_OICGEODA_MAX_CHANNELS;i++)
-	    {
-	    header->channel[i].offset = 0;
-	    header->channel[i].num_samples = 0;
-	    data->rawsize[i] = 0;
-	    data->raw[i] = NULL;
-	    }
-	data->beams_bath_alloc = 0;
-	data->beams_amp_alloc = 0;
-	data->pixels_ss_alloc = 0;
-	data->bath = NULL;
-	data->amp = NULL;
-	data->bathacrosstrack = NULL;
-	data->bathalongtrack = NULL;
-	data->tt = NULL;
-	data->angle = NULL;
-	data->ss = NULL;
-	data->ssacrosstrack = NULL;
-	data->ssalongtrack = NULL;
-	status = mbsys_oic_alloc(verbose,mbio_ptr,
-		&mb_io_ptr->store_data,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_dem_oicgeoda(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_dem_oicgeoda";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_oicgeoda_struct *dataplus;
-	struct mbf_oicgeoda_header_struct *header;
-	struct mbf_oicgeoda_data_struct *data;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-	dataplus = (struct mbf_oicgeoda_struct *) mb_io_ptr->raw_data;
-	header = &(dataplus->header);
-	data = &(dataplus->data);
-
-	/* deallocate memory for data descriptor */
-	for (i=0;i<MBF_OICGEODA_MAX_CHANNELS;i++)
-	    {
-	    if (data->raw[i] != NULL)
-		status = mb_freed(verbose,__FILE__, __LINE__, (void **)&(data->raw[i]),error);
-	    }
-	if (data->bath != NULL)
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&(data->bath),error);
-	if (data->amp != NULL)
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&(data->amp),error);
-	if (data->bathacrosstrack != NULL)
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&(data->bathacrosstrack),error);
-	if (data->bathalongtrack != NULL)
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&(data->bathalongtrack),error);
-	if (data->tt != NULL)
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&(data->tt),error);
-	if (data->angle != NULL)
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&(data->angle),error);
-	if (data->ss != NULL)
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&(data->ss),error);
-	if (data->ssacrosstrack != NULL)
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&(data->ssacrosstrack),error);
-	if (data->ssalongtrack != NULL)
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&(data->ssalongtrack),error);
-	status = mb_freed(verbose,__FILE__, __LINE__, (void **)&mb_io_ptr->raw_data,error);
-	status = mbsys_oic_deall(verbose,mbio_ptr,
-		&mb_io_ptr->store_data,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_rt_oicgeoda(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_rt_oicgeoda";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_oicgeoda_struct *dataplus;
-	struct mbf_oicgeoda_header_struct *header;
-	struct mbf_oicgeoda_data_struct *data;
-	struct mbsys_oic_struct *store;
-	char	buffer[MBF_OICGEODA_HEADER_SIZE];
-	char	*comment;
-	int	read_size;
-	int	data_size;
-	char	*char_ptr;
-	short	*short_ptr;
-	int	*int_ptr;
-	float	*float_ptr;
-	double	sample_interval;
-	int	beams_bath_port;
-	int	beams_bath_stbd;
-	double	dx, rr, xx, zz;
-	double	alpha, beta, theta, phi;
-	int	index, ichan;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor and data structure */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-	store = (struct mbsys_oic_struct *) store_ptr;
-
-	/* get pointer to raw data structure */
-	dataplus = (struct mbf_oicgeoda_struct *) mb_io_ptr->raw_data;
-	header = &(dataplus->header);
-	data = &(dataplus->data);
-	comment = dataplus->client;
-
-	/* set file position */
-	mb_io_ptr->file_pos = mb_io_ptr->file_bytes;
-
-	/* read next four bytes to look for start of header */
-	if ((read_size = fread(buffer,1,4,mb_io_ptr->mbfp)) != 4)
-	    {
-	    status = MB_FAILURE;
-	    *error = MB_ERROR_EOF;
-	    }
-
-	/* read another byted at a time until header found */
-	while (status == MB_SUCCESS
-	    && (buffer[0] != 'G'
-		|| buffer[1] != 'E'
-		|| buffer[2] != 'O'))
-	    {
-	    for (i=0;i<3;i++)
-		buffer[i] = buffer[i+1];
-	    if ((read_size = fread(&buffer[3],1,1,mb_io_ptr->mbfp)) != 1)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-	    }
-
-	/* now read the rest of the header */
-	if (status == MB_SUCCESS)
-	    {
-	    if ((read_size = fread(&buffer[4],
-				1,MBF_OICGEODA_HEADER_SIZE-4,
-				mb_io_ptr->mbfp))
-		!= MBF_OICGEODA_HEADER_SIZE-4)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-	    }
-
-	/* now parse the header */
-	if (status == MB_SUCCESS)
-	    {
-	    index = 3;
-	    header->type = buffer[index]; index += 1;
- 	    mb_get_binary_int(MB_NO,&buffer[index],&header->proc_status);
-	    index += 4;
- 	    mb_get_binary_int(MB_NO,&buffer[index],&header->data_size);
-	    index += 4;
-	    header->client_size = buffer[index];
-	    index += 1;
-	    header->fish_status = buffer[index];
-	    index += 1;
-	    header->nav_used = buffer[index];
-	    index += 1;
-	    header->nav_type = buffer[index];
-	    index += 1;
- 	    mb_get_binary_int(MB_NO,&buffer[index],&header->utm_zone);
-	    index += 4;
- 	    mb_get_binary_float(MB_NO,&buffer[index],&header->ship_x);
-	    index += 4;
- 	    mb_get_binary_float(MB_NO,&buffer[index],&header->ship_y);
-	    index += 4;
- 	    mb_get_binary_float(MB_NO,&buffer[index],&header->ship_course);
-	    index += 4;
- 	    mb_get_binary_float(MB_NO,&buffer[index],&header->ship_speed);
-	    index += 4;
- 	    mb_get_binary_int(MB_NO,&buffer[index],&header->sec);
-	    index += 4;
- 	    mb_get_binary_int(MB_NO,&buffer[index],&header->usec);
-	    index += 4;
- 	    mb_get_binary_float(MB_NO,&buffer[index],&header->spare_gain);
-	    index += 4;
- 	    mb_get_binary_float(MB_NO,&buffer[index],&header->fish_heading);
-	    index += 4;
- 	    mb_get_binary_float(MB_NO,&buffer[index],&header->fish_depth);
-	    index += 4;
- 	    mb_get_binary_float(MB_NO,&buffer[index],&header->fish_range);
-	    index += 4;
- 	    mb_get_binary_float(MB_NO,&buffer[index],&header->fish_pulse_width);
-	    index += 4;
- 	    mb_get_binary_float(MB_NO,&buffer[index],&header->gain_c0);
-	    index += 4;
- 	    mb_get_binary_float(MB_NO,&buffer[index],&header->gain_c1);
-	    index += 4;
- 	    mb_get_binary_float(MB_NO,&buffer[index],&header->gain_c2);
-	    index += 4;
- 	    mb_get_binary_float(MB_NO,&buffer[index],&header->fish_pitch);
-	    index += 4;
- 	    mb_get_binary_float(MB_NO,&buffer[index],&header->fish_roll);
-	    index += 4;
- 	    mb_get_binary_float(MB_NO,&buffer[index],&header->fish_yaw);
-	    index += 4;
- 	    mb_get_binary_float(MB_NO,&buffer[index],&header->fish_x);
-	    index += 4;
- 	    mb_get_binary_float(MB_NO,&buffer[index],&header->fish_y);
-	    index += 4;
- 	    mb_get_binary_float(MB_NO,&buffer[index],&header->fish_layback);
-	    index += 4;
- 	    mb_get_binary_float(MB_NO,&buffer[index],&header->fish_altitude);
-	    index += 4;
- 	    mb_get_binary_int(MB_NO,&buffer[index],&header->fish_altitude_samples);
-	    index += 4;
- 	    mb_get_binary_float(MB_NO,&buffer[index],&header->fish_ping_period);
-	    index += 4;
- 	    mb_get_binary_float(MB_NO,&buffer[index],&header->sound_velocity);
-	    index += 4;
- 	    mb_get_binary_int(MB_NO,&buffer[index],&header->num_chan);
-	    index += 4;
-	    for (i=0;i<MBF_OICGEODA_MAX_CHANNELS;i++)
-		{
- 		mb_get_binary_int(MB_NO,&buffer[index],&header->channel[i].offset);
-		index += 4;
-		}
-	    for (i=0;i<MBF_OICGEODA_MAX_CHANNELS;i++)
-		{
-		header->channel[i].type = buffer[index];
-		index += 1;
-		header->channel[i].side = buffer[index];
-		index += 1;
-		header->channel[i].size = buffer[index];
-		index += 1;
-		header->channel[i].empty = buffer[index];
-		index += 1;
- 		mb_get_binary_int(MB_NO,&buffer[index],&header->channel[i].frequency);
-		index += 4;
- 		mb_get_binary_int(MB_NO,&buffer[index],&header->channel[i].num_samples);
-		index += 4;
-		}
-	    }
-
-	/* read client specific data */
-	if (status == MB_SUCCESS && header->client_size > 0)
-	    {
-	    if ((read_size = fread(dataplus->client,1,
-				(int)(header->client_size),mb_io_ptr->mbfp))
-		== (int)(header->client_size))
-		{
-		if (header->client_size < MBF_OICGEODA_MAX_CLIENT)
-		    dataplus->client[header->client_size] = 0;
-		}
-	    else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-	    }
-
-	/* check for comment or unintelligible records */
-	if (status == MB_SUCCESS)
-	    {
-	    if (header->type == OIC_ID_COMMENT)
-		{
-		dataplus->kind = MB_DATA_COMMENT;
-		}
-	    else if (header->num_chan > 0 && header->num_chan <= 8)
-		{
-		dataplus->kind = MB_DATA_DATA;
-		}
-	    else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_UNINTELLIGIBLE;
-		dataplus->kind = MB_DATA_NONE;
-		}
-	    }
-
-	/* set kind and error in mb_io_ptr */
-	mb_io_ptr->new_kind = dataplus->kind;
-	mb_io_ptr->new_error = *error;
-
-	/* loop over each data channel and read data */
-	if (status == MB_SUCCESS && header->num_chan > 0)
-	    {
-	    for (i=0;i<header->num_chan;i++)
-		{
-		/* get size of data array */
-		if (header->channel[i].size == OIC_SIZE_CHAR)
-		    data_size = sizeof(char) * header->channel[i].num_samples;
-		else if (header->channel[i].size == OIC_SIZE_SHORT)
-		    data_size = sizeof(short) * header->channel[i].num_samples;
-		else if (header->channel[i].size == OIC_SIZE_INT)
-		    data_size = sizeof(int) * header->channel[i].num_samples;
-		else if (header->channel[i].size == OIC_SIZE_FLOAT)
-		    data_size = sizeof(float) * header->channel[i].num_samples;
-		else if (header->channel[i].size == OIC_SIZE_3FLOAT)
-		    data_size = 3 * sizeof(float) * header->channel[i].num_samples;
-
-		/* allocate data if needed */
-		if (data_size > data->rawsize[i]
-		    || data->raw[i] == NULL)
-		    {
-		    if (data->raw[i] != NULL)
-			status = mb_freed(verbose,__FILE__, __LINE__, (void **) &(data->raw[i]), error);
-		    status = mb_mallocd(verbose,__FILE__,__LINE__, data_size, (void **)&(data->raw[i]),error);
-		    data->rawsize[i] = data_size;
-		    }
-
-		/* read the data */
-		if (status == MB_SUCCESS)
-		    {
-		    if ((read_size = fread(data->raw[i],1,data_size,mb_io_ptr->mbfp))
-			!= data_size)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_EOF;
-			}
-		    }
-
-		/* byte swap the data if necessary */
-#ifdef BYTESWAPPED
-		if (status == MB_SUCCESS)
-		    {
-		    if (header->channel[i].size == OIC_SIZE_SHORT)
-			{
-			short_ptr = (short *) data->raw[i];
-			for (j=0;j<header->channel[i].num_samples;j++)
-			    {
-			    short_ptr[j] = mb_swap_short(short_ptr[j]);
-			    }
-			}
-		    else if (header->channel[i].size == OIC_SIZE_INT)
-			{
-			int_ptr = (int *) data->raw[i];
-			for (j=0;j<header->channel[i].num_samples;j++)
-			    {
-			    int_ptr[j] = mb_swap_int(int_ptr[j]);
-			    }
-			}
-		    else if (header->channel[i].size == OIC_SIZE_FLOAT)
-			{
-			float_ptr = (float *) data->raw[i];
-			for (j=0;j<header->channel[i].num_samples;j++)
-			    {
-			    mb_swap_float(&float_ptr[j]);
-			    }
-			}
-		    else if (header->channel[i].size == OIC_SIZE_3FLOAT)
-			{
-			float_ptr = (float *) data->raw[i];
-			for (j=0;j<3*header->channel[i].num_samples;j++)
-			    {
-			    mb_swap_float(&float_ptr[j]);
-			    }
-			}
-		    }
-#endif
-		}
-	    }
-
-	/* figure out number of beams and pixels in data */
-	if (status == MB_SUCCESS
-	    && dataplus->kind == MB_DATA_DATA)
-	    {
-	    header->beams_bath = 0;
-	    beams_bath_port = 0;
-	    beams_bath_stbd = 0;
-	    header->beams_amp = 0;
-	    header->bath_chan_port = -1;
-	    header->bath_chan_stbd = -1;
-	    header->pixels_ss = 0;
-	    header->ss_chan_port = -1;
-	    header->ss_chan_stbd = -1;
-	    for (ichan=0;ichan<header->num_chan;ichan++)
-		{
-		if (header->channel[ichan].type == OIC_TYPE_SIDESCAN)
-		    {
-		    if (header->channel[ichan].side == OIC_PORT
-			&& header->ss_chan_port == -1)
-			{
-			header->ss_chan_port = ichan;
-			header->fish_altitude_samples
-				= 2.0 * header->fish_altitude
-					* header->channel[ichan].num_samples
-					/ header->sound_velocity
-					/ header->fish_ping_period;
-			header->pixels_ss += header->channel[ichan].num_samples
-			    - MIN(header->fish_altitude_samples - 1, 0);
-			}
-		    else if (header->channel[ichan].side == OIC_STARBOARD
-			&& header->ss_chan_stbd == -1)
-			{
-			header->ss_chan_stbd = ichan;
-			header->fish_altitude_samples
-				= 2.0 * header->fish_altitude
-					* header->channel[ichan].num_samples
-					/ header->sound_velocity
-					/ header->fish_ping_period;
-			header->pixels_ss += header->channel[ichan].num_samples
-			    - MIN(header->fish_altitude_samples - 1, 0);
-			}
-		    }
-		else if (header->channel[ichan].type == OIC_TYPE_ANGLE)
-		    {
-		    if (header->channel[ichan].side == OIC_PORT
-			&& header->bath_chan_port == -1)
-			{
-			header->bath_chan_port = ichan;
-			beams_bath_port = 0;
-			if (header->channel[ichan].size == OIC_SIZE_SHORT)
-			    short_ptr = (short *) data->raw[ichan];
-			else if (header->channel[ichan].size == OIC_SIZE_INT)
-			    int_ptr = (int *) data->raw[ichan];
-			else if (header->channel[ichan].size == OIC_SIZE_FLOAT)
-			    float_ptr = (float *) data->raw[ichan];
-			for (i=0;i<header->channel[ichan].num_samples;i++)
-			    {
-			    if (header->channel[ichan].size == OIC_SIZE_SHORT)
-				{
-				if (short_ptr[i] > 0) beams_bath_port++;
-				}
-			    else if (header->channel[ichan].size == OIC_SIZE_INT)
-				{
-				if (int_ptr[i] > 0) beams_bath_port++;
-				}
-			    else if (header->channel[ichan].size == OIC_SIZE_FLOAT)
-				{
-				if (float_ptr[i] > 0.0) beams_bath_port++;
-				}
-			    }
-			header->beams_bath = 2 * MAX(beams_bath_port, beams_bath_stbd) + 1;
-			}
-		    else if (header->channel[ichan].side == OIC_STARBOARD
-			&& header->bath_chan_stbd == -1)
-			{
-			header->bath_chan_stbd = ichan;
-			beams_bath_stbd = 0;
-			if (header->channel[ichan].size == OIC_SIZE_SHORT)
-			    short_ptr = (short *) data->raw[ichan];
-			else if (header->channel[ichan].size == OIC_SIZE_INT)
-			    int_ptr = (int *) data->raw[ichan];
-			else if (header->channel[ichan].size == OIC_SIZE_FLOAT)
-			    float_ptr = (float *) data->raw[ichan];
-			for (i=0;i<header->channel[ichan].num_samples;i++)
-			    {
-			    if (header->channel[ichan].size == OIC_SIZE_SHORT)
-				{
-				if (short_ptr[i] > 0) beams_bath_stbd++;
-				}
-			    else if (header->channel[ichan].size == OIC_SIZE_INT)
-				{
-				if (int_ptr[i] > 0) beams_bath_stbd++;
-				}
-			    else if (header->channel[ichan].size == OIC_SIZE_FLOAT)
-				{
-				if (float_ptr[i] > 0.0) beams_bath_stbd++;
-				}
-			    }
-			header->beams_bath = 2 * MAX(beams_bath_port, beams_bath_stbd) + 1;
-			}
-		    }
-		else if (header->channel[ichan].type == OIC_TYPE_MULTIBEAM)
-		    {
-		    if (header->channel[ichan].side == OIC_PORT
-			&& header->bath_chan_port == -1)
-			{
-			header->bath_chan_port = ichan;
-			header->beams_bath += header->channel[ichan].num_samples;
-			header->beams_amp += header->channel[ichan].num_samples;
-			}
-		    else if (header->channel[ichan].side == OIC_STARBOARD
-			&& header->bath_chan_stbd == -1)
-			{
-			header->bath_chan_stbd = ichan;
-			header->beams_bath += header->channel[ichan].num_samples;
-			header->beams_amp += header->channel[ichan].num_samples;
-			}
-		    }
-		}
-	    }
-
-	/* print debug statements */
-	if (verbose >= 5)
-	    {
-	    fprintf(stderr,"\ndbg5  New header read in function <%s>\n",function_name);
-	    fprintf(stderr,"dbg5       type:             %d\n",header->type);
-	    fprintf(stderr,"dbg5       proc_status:      %d\n",header->proc_status);
-	    fprintf(stderr,"dbg5       data_size:        %d\n",header->data_size);
-	    fprintf(stderr,"dbg5       client_size:      %d\n",header->client_size);
-	    fprintf(stderr,"dbg5       fish_status:      %d\n",header->fish_status);
-	    fprintf(stderr,"dbg5       nav_used:         %d\n",header->nav_used);
-	    fprintf(stderr,"dbg5       nav_type:         %d\n",header->nav_type);
-	    fprintf(stderr,"dbg5       utm_zone:         %d\n",header->utm_zone);
-	    fprintf(stderr,"dbg5       ship_x:           %f\n",header->ship_x);
-	    fprintf(stderr,"dbg5       ship_y:           %f\n",header->ship_y);
-	    fprintf(stderr,"dbg5       ship_course:      %f\n",header->ship_course);
-	    fprintf(stderr,"dbg5       ship_speed:       %f\n",header->ship_speed);
-	    fprintf(stderr,"dbg5       sec:              %d\n",header->sec);
-	    fprintf(stderr,"dbg5       usec:             %d\n",header->usec);
-	    fprintf(stderr,"dbg5       spare_gain:       %f\n",header->spare_gain);
-	    fprintf(stderr,"dbg5       fish_heading:     %f\n",header->fish_heading);
-	    fprintf(stderr,"dbg5       fish_depth:       %f\n",header->fish_depth);
-	    fprintf(stderr,"dbg5       fish_range:       %f\n",header->fish_range);
-	    fprintf(stderr,"dbg5       fish_pulse_width: %f\n",header->fish_pulse_width);
-	    fprintf(stderr,"dbg5       gain_c0:          %f\n",header->gain_c0);
-	    fprintf(stderr,"dbg5       gain_c1:          %f\n",header->gain_c1);
-	    fprintf(stderr,"dbg5       gain_c2:          %f\n",header->gain_c2);
-	    fprintf(stderr,"dbg5       fish_pitch:       %f\n",header->fish_pitch);
-	    fprintf(stderr,"dbg5       fish_roll:        %f\n",header->fish_roll);
-	    fprintf(stderr,"dbg5       fish_yaw:         %f\n",header->fish_yaw);
-	    fprintf(stderr,"dbg5       fish_x:           %f\n",header->fish_x);
-	    fprintf(stderr,"dbg5       fish_y:           %f\n",header->fish_y);
-	    fprintf(stderr,"dbg5       fish_layback:     %f\n",header->fish_layback);
-	    fprintf(stderr,"dbg5       fish_altitude:    %f\n",header->fish_altitude);
-	    fprintf(stderr,"dbg5       fish_altitude_samples: %d\n",header->fish_altitude_samples);
-	    fprintf(stderr,"dbg5       fish_ping_period: %f\n",header->fish_ping_period);
-	    fprintf(stderr,"dbg5       sound_velocity:   %f\n",header->sound_velocity);
-	    fprintf(stderr,"dbg5       num_chan:         %d\n",header->num_chan);
-	    fprintf(stderr,"dbg5       beams_bath:       %d\n",header->beams_bath);
-	    fprintf(stderr,"dbg5       beams_amp:        %d\n",header->beams_amp);
-	    fprintf(stderr,"dbg5       bath_chan_port:   %d\n",header->bath_chan_port);
-	    fprintf(stderr,"dbg5       bath_chan_stbd:   %d\n",header->bath_chan_stbd);
-	    fprintf(stderr,"dbg5       pixels_ss:        %d\n",header->pixels_ss);
-	    fprintf(stderr,"dbg5       ss_chan_port:     %d\n",header->ss_chan_port);
-	    fprintf(stderr,"dbg5       ss_chan_stbd:     %d\n",header->ss_chan_stbd);
-	    for (i=0;i<header->num_chan;i++)
-		{
-		fprintf(stderr,"dbg5       offset[%1d]:      %d\n",
-			     i, header->channel[i].offset);
-		fprintf(stderr,"dbg5       type[%1d]:        %d\n",
-			     i, header->channel[i].type);
-		fprintf(stderr,"dbg5       side[%1d]:        %d\n",
-			     i, header->channel[i].side);
-		fprintf(stderr,"dbg5       size[%1d]:        %d\n",
-			     i, header->channel[i].size);
-		fprintf(stderr,"dbg5       empty[%1d]:       %d\n",
-			     i, header->channel[i].empty);
-		fprintf(stderr,"dbg5       frequency[%1d]:   %d\n",
-			     i, header->channel[i].frequency);
-		fprintf(stderr,"dbg5       num_samples[%1d]: %d\n",
-			     i, header->channel[i].num_samples);
-		}
-	    for (i=0;i<header->num_chan;i++)
-		{
-		fprintf(stderr,"\ndbg5  New data read in function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       channel:   %d\n", i);
-		if (header->channel[i].type == OIC_TYPE_SIDESCAN)
-		    fprintf(stderr, "dbg5       data type: sidescan\n");
-		else if (header->channel[i].type == OIC_TYPE_ANGLE)
-		    fprintf(stderr, "dbg5       data type: angle\n");
-		else if (header->channel[i].type == OIC_TYPE_MULTIBEAM)
-		    fprintf(stderr, "dbg5       data type: multibeam\n");
-		else
-		    fprintf(stderr, "dbg5       data type: unknown\n");
-		if (header->channel[i].side == OIC_PORT)
-		    fprintf(stderr, "dbg5       side:      port\n");
-		else if (header->channel[i].side == OIC_STARBOARD)
-		    fprintf(stderr, "dbg5       side:      starboard\n");
-		else
-		    fprintf(stderr, "dbg5       side:      unknown\n");
-		fprintf(stderr,"dbg5       frequency:   %d\n", header->channel[i].frequency);
-		fprintf(stderr,"dbg5       num samples: %d\n", header->channel[i].num_samples);
-		if (header->channel[i].size == OIC_SIZE_CHAR)
-		    {
-		    fprintf(stderr, "dbg5       size:      char (1 byte)\n");
-		    char_ptr = (char *) data->raw[i];
-		    for (j=0;j<header->channel[i].num_samples;j++)
-			{
-			fprintf(stderr, "dbg5      %5d  %5d\n", j, char_ptr[j]);
-			}
-		    }
-		else if (header->channel[i].size == OIC_SIZE_SHORT)
-		    {
-		    fprintf(stderr, "dbg5        size:      short (2 bytes)\n");
-		    short_ptr = (short *) data->raw[i];
-		    for (j=0;j<header->channel[i].num_samples;j++)
-			{
-			fprintf(stderr, "dbg5      %5d  %5d\n", j, short_ptr[j]);
-			}
-		    }
-		else if (header->channel[i].size == OIC_SIZE_INT)
-		    {
-		    fprintf(stderr, "dbg5       size:       int (4 bytes)\n");
-		    int_ptr = (int *) data->raw[i];
-		    for (j=0;j<header->channel[i].num_samples;j++)
-			{
-			fprintf(stderr, "dbg5      %5d  %5d\n", j, int_ptr[j]);
-			}
-		    }
-		else if (header->channel[i].size == OIC_SIZE_FLOAT)
-		    {
-		    fprintf(stderr, "dbg5       size:       float (4 bytes)\n");
-		    float_ptr = (float *) data->raw[i];
-		    for (j=0;j<header->channel[i].num_samples;j++)
-			{
-			fprintf(stderr, "dbg5      %5d  %10f\n", j, float_ptr[j]);
-			}
-		    }
-		else if (header->channel[i].size == OIC_SIZE_3FLOAT)
-		    {
-		    fprintf(stderr, "dbg5       size:       3 floats (12 bytes)\n");
-		    float_ptr = (float *) data->raw[i];
-		    for (j=0;j<header->channel[i].num_samples;j++)
-			{
-			fprintf(stderr, "dbg5      %5d  %10f %10f %10f\n",
-				j, float_ptr[3*j], float_ptr[3*j+1], float_ptr[3*j+2]);
-			}
-		    }
-		else
-		    fprintf(stderr, "dbg5      size:       unknown\n");
-		}
-	    fprintf(stderr,"dbg5       status:     %d\n",status);
-	    fprintf(stderr,"dbg5       error:      %d\n",*error);
-	    }
-
-	/* construct bathymetry and sidescan from raw data */
-	if (status == MB_SUCCESS
-	    && dataplus->kind == MB_DATA_DATA)
-	    {
-	    /* allocate arrays if needed */
-	    if (header->beams_bath > data->beams_bath_alloc
-		|| data->bath == NULL)
-		{
-		data->beams_bath_alloc = header->beams_bath;
-		if (data->bath != NULL)
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **) &(data->bath), error);
-		if (data->bathacrosstrack != NULL)
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **) &(data->bathacrosstrack), error);
-		if (data->bathalongtrack != NULL)
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **) &(data->bathalongtrack), error);
-		if (data->tt != NULL)
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **) &(data->tt), error);
-		if (data->angle != NULL)
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **) &(data->angle), error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__, header->beams_bath * sizeof(float),
-				    (void **)&(data->bath), error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__, header->beams_bath * sizeof(float),
-				    (void **)&(data->bathacrosstrack), error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__, header->beams_bath * sizeof(float),
-				    (void **)&(data->bathalongtrack), error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__, header->beams_bath * sizeof(float),
-				    (void **)&(data->tt), error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__, header->beams_bath * sizeof(float),
-				    (void **)&(data->angle), error);
-		}
-	    if (header->beams_amp > data->beams_amp_alloc
-		|| data->amp == NULL)
-		{
-		data->beams_amp_alloc = header->beams_amp;
-		if (data->amp != NULL)
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **) &(data->amp), error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__, header->beams_amp * sizeof(float),
-				    (void **)&(data->amp), error);
-		}
-	    if (header->pixels_ss > data->pixels_ss_alloc
-		|| data->ss == NULL)
-		{
-		data->pixels_ss_alloc = header->pixels_ss;
-		if (data->ss != NULL)
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **) &(data->ss), error);
-		if (data->ssacrosstrack != NULL)
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **) &(data->ssacrosstrack), error);
-		if (data->ssalongtrack != NULL)
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **) &(data->ssalongtrack), error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__, header->pixels_ss * sizeof(float),
-				    (void **)&(data->ss), error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__, header->pixels_ss * sizeof(float),
-				    (void **)&(data->ssacrosstrack), error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__, header->pixels_ss * sizeof(float),
-				    (void **)&(data->ssalongtrack), error);
-		}
-
-	    /* initialize bathymetry and sidescan */
-	    for (j=0;j<header->beams_bath;j++)
-		{
-		data->bathacrosstrack[j] = 0.0;
-		data->bathalongtrack[j] = 0.0;
-		data->bath[j] = 0.0;
-		data->tt[j] = 0.0;
-		data->angle[j] = 0.0;
-		}
-	    for (j=0;j<header->beams_amp;j++)
-		{
-		data->amp[j] = 0.0;
-		}
-	    for (j=0;j<header->pixels_ss;j++)
-		{
-		data->ssacrosstrack[j] = 0.0;
-		data->ssalongtrack[j] = 0.0;
-		data->ss[j] = 0.0;
-		}
-
-	    /* get center bathymetry */
-	    if (header->bath_chan_port >= 0
-		&& header->channel[header->bath_chan_port].type
-		    == OIC_TYPE_ANGLE
-		&& header->bath_chan_stbd >= 0
-		&& header->channel[header->bath_chan_stbd].type
-		    == OIC_TYPE_ANGLE)
-		{
-		j = header->beams_bath / 2;
-		rr = header->fish_altitude;
-		beta = 90.0;
-		alpha = header->fish_pitch;
-		status = mb_rollpitch_to_takeoff(verbose,
-			    alpha,beta,&theta,&phi,error);
-		xx = rr * sin(DTR * theta);
-		zz = rr * cos(DTR * theta);
-		data->bathacrosstrack[j]
-			= xx * cos(DTR * phi);
-		data->bathalongtrack[j]
-			= xx * sin(DTR * phi);
-		data->bath[j] = zz + header->fish_depth;
-		data->tt[j] = 2.0 * rr / header->sound_velocity;
-		data->angle[j] = beta;
-		}
-
-	    /* get port bathymetry */
-	    if (header->bath_chan_port >= 0)
-		{
-		ichan = header->bath_chan_port;
-		if (header->channel[ichan].size == OIC_SIZE_3FLOAT)
-		    {
-		    j = header->channel[ichan].num_samples;
-		    }
-		else
-		    {
-		    dx = header->fish_range
-			    / header->channel[ichan].num_samples;
-		    j = header->beams_bath / 2;
-		    }
-		if (header->channel[ichan].size == OIC_SIZE_SHORT)
-		    short_ptr = (short *) data->raw[ichan];
-		else if (header->channel[ichan].size == OIC_SIZE_INT)
-		    int_ptr = (int *) data->raw[ichan];
-		else if (header->channel[ichan].size == OIC_SIZE_FLOAT)
-		    float_ptr = (float *) data->raw[ichan];
-		else if (header->channel[ichan].size == OIC_SIZE_3FLOAT)
-		    float_ptr = (float *) data->raw[ichan];
-		for (i=0;i<header->channel[ichan].num_samples;i++)
-		    {
-		    if (header->channel[ichan].size == OIC_SIZE_3FLOAT)
-			{
-			j--;
-			beta = -float_ptr[3 * i + 1] + header->fish_roll;
-			rr = 0.5 * header->sound_velocity
-				* float_ptr[3 * i];
-			data->amp[j] = float_ptr[3 * i + 2];
-			}
-		    else
-			{
-			if (header->channel[ichan].size == OIC_SIZE_SHORT)
-			    zz = 0.1 * short_ptr[i];
-			else if (header->channel[ichan].size == OIC_SIZE_INT)
-			    zz = 0.1 * int_ptr[i];
-			else if (header->channel[ichan].size == OIC_SIZE_FLOAT)
-			    zz = float_ptr[i];
-			if (zz > 0.0)
-			    {
-			    j--;
-			    xx = -(i + 0.5) * dx;
-			    rr = sqrt(xx * xx + zz * zz);
-			    beta = RTD * acos(xx / rr);
-			    }
-			else
-			    rr = 0.0;
-			}
-		    if (rr > 0.0)
-			{
-			alpha = header->fish_pitch;
-			status = mb_rollpitch_to_takeoff(verbose,
-				    alpha,beta,&theta,&phi,error);
-			xx = rr * sin(DTR * theta);
-			zz = rr * cos(DTR * theta);
-			data->bathacrosstrack[j]
-				= xx * cos(DTR * phi);
-			data->bathalongtrack[j]
-				= xx * sin(DTR * phi);
-			data->bath[j] = zz + header->fish_depth;
-			data->tt[j] = 2.0 * rr / header->sound_velocity;
-			data->angle[j] = beta;
-			}
-		    else if (header->channel[ichan].size == OIC_SIZE_3FLOAT)
-			{
-			data->bathacrosstrack[j] = 0.0;
-			data->bathalongtrack[j] = 0.0;
-			data->bath[j] = 0.0;
-			data->tt[j] = 0.0;
-			data->angle[j] = 0.0;
-			}
-		    }
-		}
-
-	    /* get starboard bathymetry */
-	    if (header->bath_chan_stbd >= 0)
-		{
-		ichan = header->bath_chan_stbd;
-		if (header->channel[ichan].size == OIC_SIZE_3FLOAT)
-		    {
-		    j = header->beams_bath - header->channel[ichan].num_samples - 1;
-		    }
-		else
-		    {
-		    dx = header->fish_range
-			    / header->channel[ichan].num_samples;
-		    j = header->beams_bath / 2;
-		    }
-		if (header->channel[ichan].size == OIC_SIZE_SHORT)
-		    short_ptr = (short *) data->raw[ichan];
-		else if (header->channel[ichan].size == OIC_SIZE_INT)
-		    int_ptr = (int *) data->raw[ichan];
-		else if (header->channel[ichan].size == OIC_SIZE_FLOAT)
-		    float_ptr = (float *) data->raw[ichan];
-		else if (header->channel[ichan].size == OIC_SIZE_3FLOAT)
-		    float_ptr = (float *) data->raw[ichan];
-		for (i=0;i<header->channel[ichan].num_samples;i++)
-		    {
-		    if (header->channel[ichan].size == OIC_SIZE_3FLOAT)
-			{
-			j++;
-			beta = float_ptr[3 * i + 1] + header->fish_roll;
-			rr = 0.5 * header->sound_velocity
-				* float_ptr[3 * i];
-			data->amp[j] = float_ptr[3 * i + 2];
-			}
-		    else
-			{
-			if (header->channel[ichan].size == OIC_SIZE_SHORT)
-			    zz = 0.1 * short_ptr[i];
-			else if (header->channel[ichan].size == OIC_SIZE_INT)
-			    zz = 0.1 * int_ptr[i];
-			else if (header->channel[ichan].size == OIC_SIZE_FLOAT)
-			    zz = float_ptr[i];
-			if (zz > 0.0)
-			    {
-			    j++;
-			    xx = (i + 0.5) * dx;
-			    rr = sqrt(xx * xx + zz * zz);
-			    beta = RTD * acos(xx / rr);
-			    }
-			else
-			    rr = 0.0;
-			}
-		    if (rr > 0.0)
-			{
-			alpha = header->fish_pitch;
-			status = mb_rollpitch_to_takeoff(verbose,
-				    alpha,beta,&theta,&phi,error);
-			xx = rr * sin(DTR * theta);
-			zz = rr * cos(DTR * theta);
-			data->bathacrosstrack[j]
-				= xx * cos(DTR * phi);
-			data->bathalongtrack[j]
-				= xx * sin(DTR * phi);
-			data->bath[j] = zz + header->fish_depth;
-			data->tt[j] = 2.0 * rr / header->sound_velocity;
-			data->angle[j] = beta;
-			}
-		    else if (header->channel[ichan].size == OIC_SIZE_3FLOAT)
-			{
-			data->bathacrosstrack[j] = 0.0;
-			data->bathalongtrack[j] = 0.0;
-			data->bath[j] = 0.0;
-			data->tt[j] = 0.0;
-			data->angle[j] = 0.0;
-			}
-		    }
-		}
-
-	    /* get port sidescan */
-	    if (header->ss_chan_port >= 0)
-		{
-		ichan = header->ss_chan_port;
-		sample_interval = header->fish_ping_period
-				    / header->channel[ichan].num_samples;
-		if (header->channel[ichan].size == OIC_SIZE_CHAR)
-		    char_ptr = (char *) data->raw[ichan];
-		else if (header->channel[ichan].size == OIC_SIZE_SHORT)
-		    short_ptr = (short *) data->raw[ichan];
-		else if (header->channel[ichan].size == OIC_SIZE_INT)
-		    int_ptr = (int *) data->raw[ichan];
-		else if (header->channel[ichan].size == OIC_SIZE_FLOAT)
-		    float_ptr = (float *) data->raw[ichan];
-		for (i=header->fish_altitude_samples+1;
-		    i<header->channel[ichan].num_samples;i++)
-		    {
-		    j = header->channel[ichan].num_samples - i
-			    + header->fish_altitude_samples;
-		    if (header->channel[ichan].size == OIC_SIZE_CHAR)
-			data->ss[j] = char_ptr[i];
-		    else if (header->channel[ichan].size == OIC_SIZE_SHORT)
-			data->ss[j] = short_ptr[i];
-		    else if (header->channel[ichan].size == OIC_SIZE_INT)
-			data->ss[j] = int_ptr[i];
-		    else if (header->channel[ichan].size == OIC_SIZE_FLOAT)
-			data->ss[j] = float_ptr[i];
-		    beta = 180.0 - asin(((double)header->fish_altitude_samples)
-				/ ((double)i)) / DTR;
-		    alpha = header->fish_pitch;
-		    rr = 0.5 * header->sound_velocity
-			    * sample_interval * i;
-		    status = mb_rollpitch_to_takeoff(verbose,
-				alpha,beta,&theta,&phi,error);
-		    xx = rr * sin(DTR * theta);
-		    zz = rr * cos(DTR * theta);
-		    data->ssacrosstrack[j] = xx * cos(DTR * phi);
-		    data->ssalongtrack[j] = xx * sin(DTR * phi);
-		    }
-		}
-
-	    /* get starboard sidescan */
-	    if (header->ss_chan_stbd >= 0)
-		{
-		ichan = header->ss_chan_stbd;
-		sample_interval = header->fish_ping_period
-				    / header->channel[ichan].num_samples;
-		if (header->channel[ichan].size == OIC_SIZE_CHAR)
-		    char_ptr = (char *) data->raw[ichan];
-		else if (header->channel[ichan].size == OIC_SIZE_SHORT)
-		    short_ptr = (short *) data->raw[ichan];
-		else if (header->channel[ichan].size == OIC_SIZE_INT)
-		    int_ptr = (int *) data->raw[ichan];
-		else if (header->channel[ichan].size == OIC_SIZE_FLOAT)
-		    float_ptr = (float *) data->raw[ichan];
-		for (i=header->fish_altitude_samples+1;
-		    i<header->channel[ichan].num_samples;i++)
-		    {
-		    j = header->pixels_ss
-			    - header->channel[ichan].num_samples
-			    + i - header->fish_altitude_samples - 1;
-		    if (header->channel[ichan].size == OIC_SIZE_CHAR)
-			data->ss[j] = char_ptr[i];
-		    else if (header->channel[ichan].size == OIC_SIZE_SHORT)
-			data->ss[j] = short_ptr[i];
-		    else if (header->channel[ichan].size == OIC_SIZE_INT)
-			data->ss[j] = int_ptr[i];
-		    else if (header->channel[ichan].size == OIC_SIZE_FLOAT)
-			data->ss[j] = float_ptr[i];
-		    beta = asin(((double)header->fish_altitude_samples)
-				/ ((double)i)) / DTR;
-		    alpha = header->fish_pitch;
-		    rr = 0.5 * header->sound_velocity
-			    * sample_interval * i;
-		    status = mb_rollpitch_to_takeoff(verbose,
-				alpha,beta,&theta,&phi,error);
-		    xx = rr * sin(DTR * theta);
-		    zz = rr * cos(DTR * theta);
-		    data->ssacrosstrack[j] = xx * cos(DTR * phi);
-		    data->ssalongtrack[j] = xx * sin(DTR * phi);
-		    }
-		}
-	    }
-
-	/* print debug statements */
-	if (verbose >= 5 && status == MB_SUCCESS)
-	    {
-	    fprintf(stderr,"\ndbg5  New processed data generated in function <%s>\n",
-		    function_name);
-	    fprintf(stderr,"dbg5       beams_bath:       %d\n",header->beams_bath);
-	    fprintf(stderr,"dbg5       beam   bath  xtrack ltrack   tt   angle\n");
-	    for (i=0;i<header->beams_bath;i++)
-		{
-		fprintf(stderr,"dbg5       %4d %10f %10f %10f %10f %10f\n",
-			i, data->bath[i], data->bathacrosstrack[i],
-			data->bathalongtrack[i],
-			data->tt[i], data->angle[i]);
-		}
-	    fprintf(stderr,"dbg5       beams_amp:       %d\n",header->beams_amp);
-	    fprintf(stderr,"dbg5       beam   amp  xtrack ltrack\n");
-	    for (i=0;i<header->beams_amp;i++)
-		{
-		fprintf(stderr,"dbg5       %4d %10f %10f %10f\n",
-			i, data->amp[i], data->bathacrosstrack[i],
-			data->bathalongtrack[i]);
-		}
-	    fprintf(stderr,"dbg5       pixels_ss:       %d\n",header->pixels_ss);
-	    fprintf(stderr,"dbg5       beam   ss  xtrack ltrack\n");
-	    for (i=0;i<header->beams_amp;i++)
-		{
-		fprintf(stderr,"dbg5       %4d %10f %10f %10f\n",
-			i, data->ss[i], data->ssacrosstrack[i],
-			data->ssalongtrack[i]);
-		}
-	    }
-
-	/* translate values to data storage structure */
-	if (status == MB_SUCCESS
-		&& store != NULL)
-	    {
-	    /* type of data record */
-	    store->kind = dataplus->kind;
-	    store->type = header->type;
-
-	    /* status and size */
-	    store->proc_status = header->proc_status;
-	    store->data_size = header->data_size;
-	    store->client_size = header->client_size;
-	    store->fish_status = header->fish_status;
-
-	    /* nav */
-	    store->nav_used = header->nav_used;
-	    store->nav_type = header->nav_type;
-	    store->utm_zone = header->utm_zone;
-	    store->ship_x = header->ship_x;
-	    store->ship_y = header->ship_y;
-	    store->ship_course = header->ship_course;
-	    store->ship_speed = header->ship_speed;
-
-	    /* time stamp */
-	    store->sec = header->sec;
-	    store->usec = header->usec;
-
-	    /* more stuff */
-	    store->spare_gain = header->spare_gain;
-	    store->fish_heading = header->fish_heading;
-	    store->fish_depth = header->fish_depth;
-	    store->fish_range = header->fish_range;
-	    store->fish_pulse_width = header->fish_pulse_width;
-	    store->gain_c0 = header->gain_c0;
-	    store->gain_c1 = header->gain_c1;
-	    store->gain_c2 = header->gain_c2;
-	    store->fish_pitch = header->fish_pitch;
-	    store->fish_roll = header->fish_roll;
-	    store->fish_yaw = header->fish_yaw;
-	    store->fish_x = header->fish_x;
-	    store->fish_y = header->fish_y;
-	    store->fish_layback = header->fish_layback;
-	    store->fish_altitude = header->fish_altitude;
-	    store->fish_altitude_samples = header->fish_altitude_samples;
-	    store->fish_ping_period = header->fish_ping_period;
-	    store->sound_velocity = header->sound_velocity;
-
-	    /* numbers of beams and scaling */
-	    store->num_chan = header->num_chan;
-	    store->beams_bath = header->beams_bath;
-	    store->beams_amp = header->beams_amp;
-	    store->bath_chan_port = header->bath_chan_port;
-	    store->bath_chan_stbd = header->bath_chan_stbd;
-	    store->pixels_ss = header->pixels_ss;
-	    store->ss_chan_port = header->ss_chan_port;
-	    store->ss_chan_stbd = header->ss_chan_stbd;
-
-	    /* raw data */
-	    for (i=0;i<store->num_chan;i++)
-		{
-		/* copy channel info */
-		store->channel[i].offset = header->channel[i].offset;
-		store->channel[i].type = header->channel[i].type;
-		store->channel[i].side = header->channel[i].side;
-		store->channel[i].size = header->channel[i].size;
-		store->channel[i].empty = header->channel[i].empty;
-		store->channel[i].frequency = header->channel[i].frequency;
-		store->channel[i].num_samples = header->channel[i].num_samples;
-
-		/* allocate data if needed */
-		if (data->rawsize[i] > store->rawsize[i]
-		    || store->raw[i] == NULL)
-		    {
-		    if (store->raw[i] != NULL)
-			status = mb_freed(verbose,__FILE__, __LINE__, (void **) &(store->raw[i]), error);
-		    store->rawsize[i] = data->rawsize[i];
-		    status = mb_mallocd(verbose,__FILE__,__LINE__,store->rawsize[i], (void **)&(store->raw[i]),error);
-		    }
-
-		/* copy the data */
-		if (status == MB_SUCCESS)
-		    {
-		    for (j=0;j<store->rawsize[i];j++)
-			{
-			store->raw[i][j] = data->raw[i][j];
-			}
-		    }
-		}
-
-	    /* depths and sidescan */
-	    if (header->beams_bath > store->beams_bath_alloc
-		|| store->beamflag == NULL
-		|| store->bath == NULL
-		|| store->bathacrosstrack == NULL
-		|| store->bathalongtrack == NULL
-		|| store->tt == NULL
-		|| store->angle == NULL)
-		{
-		store->beams_bath_alloc = header->beams_bath;
-		if (store->beamflag != NULL)
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **) &(store->beamflag), error);
-		if (store->bath != NULL)
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **) &(store->bath), error);
-		if (store->bathacrosstrack != NULL)
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **) &(store->bathacrosstrack), error);
-		if (store->bathalongtrack != NULL)
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **) &(store->bathalongtrack), error);
-		if (store->tt != NULL)
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **) &(store->tt), error);
-		if (store->angle != NULL)
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **) &(store->angle), error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,store->beams_bath_alloc * sizeof(char),
-				    (void **)&(store->beamflag),error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,store->beams_bath_alloc * sizeof(float),
-				    (void **)&(store->bath),error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,store->beams_bath_alloc * sizeof(float),
-				    (void **)&(store->bathacrosstrack),error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,store->beams_bath_alloc * sizeof(float),
-				    (void **)&(store->bathalongtrack),error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,store->beams_bath_alloc * sizeof(float),
-				    (void **)&(store->tt),error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,store->beams_bath_alloc * sizeof(float),
-				    (void **)&(store->angle),error);
-		}
-	    if (header->beams_amp > store->beams_amp_alloc
-		|| store->amp == NULL)
-		{
-		store->beams_amp_alloc = header->beams_amp;
-		if (store->amp != NULL)
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **) &(store->amp), error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,store->beams_amp_alloc * sizeof(float),
-				    (void **)&(store->amp),error);
-		}
-	    if (header->pixels_ss > store->pixels_ss_alloc
-		|| store->ss == NULL
-		|| store->ssacrosstrack == NULL
-		|| store->ssalongtrack == NULL)
-		{
-		store->pixels_ss_alloc = header->pixels_ss;
-		if (store->ss != NULL)
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **) &(store->ss), error);
-		if (store->ssacrosstrack != NULL)
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **) &(store->ssacrosstrack), error);
-		if (store->ssalongtrack != NULL)
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **) &(store->ssalongtrack), error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,store->pixels_ss_alloc * sizeof(float),
-				    (void **)&(store->ss),error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,store->pixels_ss_alloc * sizeof(float),
-				    (void **)&(store->ssacrosstrack),error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,store->pixels_ss_alloc * sizeof(float),
-				    (void **)&(store->ssalongtrack),error);
-		}
-	    for (i=0;i<store->beams_bath;i++)
-		{
-		if (data->bath[i] == 0.0)
-		    store->beamflag[i] = MB_FLAG_NULL;
-		else
-		    store->beamflag[i] = MB_FLAG_NONE;
-		store->bath[i] = data->bath[i];
-		store->bathacrosstrack[i] = data->bathacrosstrack[i];
-		store->bathalongtrack[i] = data->bathalongtrack[i];
-		store->tt[i] = data->tt[i];
-		store->angle[i] = data->angle[i];
-		}
-	    for (i=0;i<store->beams_amp;i++)
-		{
-		store->amp[i] = data->amp[i];
-		}
-	    for (i=0;i<store->pixels_ss;i++)
-		{
-		store->ss[i] = data->ss[i];
-		store->ssacrosstrack[i] = data->ssacrosstrack[i];
-		store->ssalongtrack[i] = data->ssalongtrack[i];
-		}
-
-	    /* client */
-	    for (i=0;i<header->client_size;i++)
-		store->client[i] = dataplus->client[i];
-	    }
-
-	/* print output debug statements */
-	if (verbose >= 2)
-	    {
-	    fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-		    function_name);
-	    fprintf(stderr,"dbg2  Return values:\n");
-	    fprintf(stderr,"dbg2       error:      %d\n",*error);
-	    fprintf(stderr,"dbg2  Return status:\n");
-	    fprintf(stderr,"dbg2       status:  %d\n",status);
-	    }
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_wt_oicgeoda(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_wt_oicgeoda";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_oicgeoda_struct *dataplus;
-	struct mbf_oicgeoda_header_struct *header;
-	struct mbf_oicgeoda_data_struct *data;
-	struct mbsys_oic_struct *store;
-	char	buffer[MBF_OICGEODA_HEADER_SIZE];
-	char	*comment;
-	int	write_size;
-	int	data_size;
-	char	*char_ptr;
-	short	*short_ptr;
-	int	*int_ptr;
-	float	*float_ptr;
-	int	index;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor and data storage */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-	store = (struct mbsys_oic_struct *) store_ptr;
-
-	/* get pointer to raw data structure */
-	dataplus = (struct mbf_oicgeoda_struct *) mb_io_ptr->raw_data;
-	header = &(dataplus->header);
-	data = &(dataplus->data);
-	comment = dataplus->client;
-
-	/* first translate values from data storage structure */
-	if (store != NULL)
-	    {
-	    /* type of data record */
-	    dataplus->kind = store->kind;
-	    header->type = store->type;
-
-	    /* status and size */
-	    header->proc_status = store->proc_status;
-	    header->data_size = store->data_size;
-	    header->client_size = store->client_size;
-	    header->fish_status = store->fish_status;
-
-	    /* nav */
-	    header->nav_used = store->nav_used;
-	    header->nav_type = store->nav_type;
-	    header->utm_zone = store->utm_zone;
-	    header->ship_x = store->ship_x;
-	    header->ship_y = store->ship_y;
-	    header->ship_course = store->ship_course;
-	    header->ship_speed = store->ship_speed;
-
-	    /* time stamp */
-	    header->sec = store->sec;
-	    header->usec = store->usec;
-
-	    /* more stuff */
-	    header->spare_gain = store->spare_gain;
-	    header->fish_heading = store->fish_heading;
-	    header->fish_depth = store->fish_depth;
-	    header->fish_range = store->fish_range;
-	    header->fish_pulse_width = store->fish_pulse_width;
-	    header->gain_c0 = store->gain_c0;
-	    header->gain_c1 = store->gain_c1;
-	    header->gain_c2 = store->gain_c2;
-	    header->fish_pitch = store->fish_pitch;
-	    header->fish_roll = store->fish_roll;
-	    header->fish_yaw = store->fish_yaw;
-	    header->fish_x = store->fish_x;
-	    header->fish_y = store->fish_y;
-	    header->fish_layback = store->fish_layback;
-	    header->fish_altitude = store->fish_altitude;
-	    header->fish_altitude_samples = store->fish_altitude_samples;
-	    header->fish_ping_period = store->fish_ping_period;
-	    header->sound_velocity = store->sound_velocity;
-
-	    /* numbers of beams and scaling */
-	    header->num_chan = store->num_chan;
-	    header->beams_bath = store->beams_bath;
-	    header->beams_amp = store->beams_amp;
-	    header->bath_chan_port = store->bath_chan_port;
-	    header->bath_chan_stbd = store->bath_chan_stbd;
-	    header->pixels_ss = store->pixels_ss;
-	    header->ss_chan_port = store->ss_chan_port;
-	    header->ss_chan_stbd = store->ss_chan_stbd;
-
-	    /* raw data */
-	    for (i=0;i<header->num_chan;i++)
-		{
-		/* copy channel info */
-		header->channel[i].offset = store->channel[i].offset;
-		header->channel[i].type = store->channel[i].type;
-		header->channel[i].side = store->channel[i].side;
-		header->channel[i].size = store->channel[i].size;
-		header->channel[i].empty = store->channel[i].empty;
-		header->channel[i].frequency = store->channel[i].frequency;
-		header->channel[i].num_samples = store->channel[i].num_samples;
-
-		/* allocate data if needed */
-		if (store->rawsize[i] > data->rawsize[i]
-		    || data->raw[i] == NULL)
-		    {
-		    if (data->raw[i] != NULL)
-			status = mb_freed(verbose,__FILE__, __LINE__, (void **) &(data->raw[i]), error);
-		    data->rawsize[i] = store->rawsize[i];
-		    status = mb_mallocd(verbose,__FILE__,__LINE__, data->rawsize[i], (void **)&(data->raw[i]),error);
-		    }
-
-		/* copy the data */
-		if (status == MB_SUCCESS)
-		    {
-		    for (j=0;j<data->rawsize[i];j++)
-			{
-			data->raw[i][j] = store->raw[i][j];
-			}
-		    }
-		}
-
-	    /* depths and sidescan */
-	    if (header->beams_bath > data->beams_bath_alloc
-		|| data->bath == NULL
-		|| data->bathacrosstrack == NULL
-		|| data->bathalongtrack == NULL
-		|| data->tt == NULL
-		|| data->angle == NULL)
-		{
-		data->beams_bath_alloc = header->beams_bath;
-		if (data->bath != NULL)
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **) &(data->bath), error);
-		if (data->bathacrosstrack != NULL)
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **) &(data->bathacrosstrack), error);
-		if (data->bathalongtrack != NULL)
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **) &(data->bathalongtrack), error);
-		if (data->tt != NULL)
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **) &(data->tt), error);
-		if (data->angle != NULL)
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **) &(data->angle), error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,data->beams_bath_alloc * sizeof(float),
-				    (void **)&(data->bath),error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,data->beams_bath_alloc * sizeof(float),
-				    (void **)&(data->bathacrosstrack),error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,data->beams_bath_alloc * sizeof(float),
-				    (void **)&(data->bathalongtrack),error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,data->beams_bath_alloc * sizeof(float),
-				    (void **)&(data->tt),error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,data->beams_bath_alloc * sizeof(float),
-				    (void **)&(data->angle),error);
-		}
-	    if (header->beams_amp > data->beams_amp_alloc
-		|| data->amp == NULL)
-		{
-		data->beams_amp_alloc = header->beams_amp;
-		if (data->amp != NULL)
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **) &(data->amp), error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,data->beams_amp_alloc * sizeof(float),
-				    (void **)&(data->amp),error);
-		}
-	    if (header->pixels_ss > data->pixels_ss_alloc
-		|| data->ss == NULL
-		|| data->ssacrosstrack == NULL
-		|| data->ssalongtrack == NULL)
-		{
-		data->pixels_ss_alloc = header->pixels_ss;
-		if (data->ss != NULL)
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **) &(data->ss), error);
-		if (data->ssacrosstrack != NULL)
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **) &(data->ssacrosstrack), error);
-		if (data->ssalongtrack != NULL)
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **) &(data->ssalongtrack), error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,data->pixels_ss_alloc * sizeof(float),
-				    (void **)&(data->ss),error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,data->pixels_ss_alloc * sizeof(float),
-				    (void **)&(data->ssacrosstrack),error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,data->pixels_ss_alloc * sizeof(float),
-				    (void **)&(data->ssalongtrack),error);
-		}
-	    for (i=0;i<header->beams_bath;i++)
-		{
-		data->bath[i] = store->bath[i];
-		data->bathacrosstrack[i] = store->bathacrosstrack[i];
-		data->bathalongtrack[i] = store->bathalongtrack[i];
-		data->tt[i] = store->tt[i];
-		data->angle[i] = store->angle[i];
-		}
-	    for (i=0;i<header->beams_amp;i++)
-		{
-		data->amp[i] = store->amp[i];
-		}
-	    for (i=0;i<header->pixels_ss;i++)
-		{
-		data->ss[i] = store->ss[i];
-		data->ssacrosstrack[i] = store->ssacrosstrack[i];
-		data->ssalongtrack[i] = store->ssalongtrack[i];
-		}
-
-	    /* client */
-	    for (i=0;i<header->client_size;i++)
-		dataplus->client[i] = store->client[i];
-	    }
-
-	/* print debug statements */
-	if (verbose >= 5)
-	    {
-	    fprintf(stderr,"\ndbg5  New header set in function <%s>\n",function_name);
-	    fprintf(stderr,"dbg5       type:             %d\n",header->type);
-	    fprintf(stderr,"dbg5       proc_status:      %d\n",header->proc_status);
-	    fprintf(stderr,"dbg5       data_size:        %d\n",header->data_size);
-	    fprintf(stderr,"dbg5       client_size:      %d\n",header->client_size);
-	    fprintf(stderr,"dbg5       fish_status:      %d\n",header->fish_status);
-	    fprintf(stderr,"dbg5       nav_used:         %d\n",header->nav_used);
-	    fprintf(stderr,"dbg5       nav_type:         %d\n",header->nav_type);
-	    fprintf(stderr,"dbg5       utm_zone:         %d\n",header->utm_zone);
-	    fprintf(stderr,"dbg5       ship_x:           %f\n",header->ship_x);
-	    fprintf(stderr,"dbg5       ship_y:           %f\n",header->ship_y);
-	    fprintf(stderr,"dbg5       ship_course:      %f\n",header->ship_course);
-	    fprintf(stderr,"dbg5       ship_speed:       %f\n",header->ship_speed);
-	    fprintf(stderr,"dbg5       sec:              %d\n",header->sec);
-	    fprintf(stderr,"dbg5       usec:             %d\n",header->usec);
-	    fprintf(stderr,"dbg5       spare_gain:       %f\n",header->spare_gain);
-	    fprintf(stderr,"dbg5       fish_heading:     %f\n",header->fish_heading);
-	    fprintf(stderr,"dbg5       fish_depth:       %f\n",header->fish_depth);
-	    fprintf(stderr,"dbg5       fish_range:       %f\n",header->fish_range);
-	    fprintf(stderr,"dbg5       fish_pulse_width: %f\n",header->fish_pulse_width);
-	    fprintf(stderr,"dbg5       gain_c0:          %f\n",header->gain_c0);
-	    fprintf(stderr,"dbg5       gain_c1:          %f\n",header->gain_c1);
-	    fprintf(stderr,"dbg5       gain_c2:          %f\n",header->gain_c2);
-	    fprintf(stderr,"dbg5       fish_pitch:       %f\n",header->fish_pitch);
-	    fprintf(stderr,"dbg5       fish_roll:        %f\n",header->fish_roll);
-	    fprintf(stderr,"dbg5       fish_yaw:         %f\n",header->fish_yaw);
-	    fprintf(stderr,"dbg5       fish_x:           %f\n",header->fish_x);
-	    fprintf(stderr,"dbg5       fish_y:           %f\n",header->fish_y);
-	    fprintf(stderr,"dbg5       fish_layback:     %f\n",header->fish_layback);
-	    fprintf(stderr,"dbg5       fish_altitude:    %f\n",header->fish_altitude);
-	    fprintf(stderr,"dbg5       fish_altitude_samples: %d\n",header->fish_altitude_samples);
-	    fprintf(stderr,"dbg5       fish_ping_period: %f\n",header->fish_ping_period);
-	    fprintf(stderr,"dbg5       sound_velocity:   %f\n",header->sound_velocity);
-	    fprintf(stderr,"dbg5       num_chan:         %d\n",header->num_chan);
-	    fprintf(stderr,"dbg5       beams_bath:       %d\n",header->beams_bath);
-	    fprintf(stderr,"dbg5       beams_amp:        %d\n",header->beams_amp);
-	    fprintf(stderr,"dbg5       bath_chan_port:   %d\n",header->bath_chan_port);
-	    fprintf(stderr,"dbg5       bath_chan_stbd:   %d\n",header->bath_chan_stbd);
-	    fprintf(stderr,"dbg5       pixels_ss:        %d\n",header->pixels_ss);
-	    fprintf(stderr,"dbg5       ss_chan_port:     %d\n",header->ss_chan_port);
-	    fprintf(stderr,"dbg5       ss_chan_stbd:     %d\n",header->ss_chan_stbd);
-	    for (i=0;i<header->num_chan;i++)
-		{
-		fprintf(stderr,"dbg5       offset[%1d]:      %d\n",
-			     i, header->channel[i].offset);
-		fprintf(stderr,"dbg5       type[%1d]:        %d\n",
-			     i, header->channel[i].type);
-		fprintf(stderr,"dbg5       side[%1d]:        %d\n",
-			     i, header->channel[i].side);
-		fprintf(stderr,"dbg5       size[%1d]:        %d\n",
-			     i, header->channel[i].size);
-		fprintf(stderr,"dbg5       empty[%1d]:       %d\n",
-			     i, header->channel[i].empty);
-		fprintf(stderr,"dbg5       frequency[%1d]:   %d\n",
-			     i, header->channel[i].frequency);
-		fprintf(stderr,"dbg5       num_samples[%1d]: %d\n",
-			     i, header->channel[i].num_samples);
-		}
-	    fprintf(stderr,"dbg5       status:     %d\n",status);
-	    fprintf(stderr,"dbg5       error:      %d\n",*error);
-	    }
-
-	/* print debug messages */
-	if (verbose >= 5 && status == MB_SUCCESS)
-	    {
-	    for (i=0;i<header->num_chan;i++)
-		{
-		fprintf(stderr,"\ndbg5  New data set in function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       channel:   %d\n", i);
-		if (header->channel[i].type == OIC_TYPE_SIDESCAN)
-		    fprintf(stderr, "dbg5       data type: sidescan\n");
-		else if (header->channel[i].type == OIC_TYPE_ANGLE)
-		    fprintf(stderr, "dbg5       data type: angle\n");
-		else if (header->channel[i].type == OIC_TYPE_MULTIBEAM)
-		    fprintf(stderr, "dbg5       data type: multibeam\n");
-		else
-		    fprintf(stderr, "dbg5       data type: unknown\n");
-		if (header->channel[i].side == OIC_PORT)
-		    fprintf(stderr, "dbg5       side:      port\n");
-		else if (header->channel[i].side == OIC_STARBOARD)
-		    fprintf(stderr, "dbg5       side:      starboard\n");
-		else
-		    fprintf(stderr, "dbg5       side:      unknown\n");
-		fprintf(stderr,"dbg5       frequency:   %d\n", header->channel[i].frequency);
-		fprintf(stderr,"dbg5       num samples: %d\n", header->channel[i].num_samples);
-		if (header->channel[i].size == OIC_SIZE_CHAR)
-		    {
-		    fprintf(stderr, "dbg5       size:      char (1 byte)\n");
-		    char_ptr = (char *) data->raw[i];
-		    for (j=0;j<header->channel[i].num_samples;j++)
-			{
-			fprintf(stderr, "dbg5      %5d  %5d\n", j, char_ptr[j]);
-			}
-		    }
-		else if (header->channel[i].size == OIC_SIZE_SHORT)
-		    {
-		    fprintf(stderr, "dbg5       size:      short (2 bytes)\n");
-		    short_ptr = (short *) data->raw[i];
-		    for (j=0;j<header->channel[i].num_samples;j++)
-			{
-			fprintf(stderr, "dbg5      %5d  %5d\n", j, short_ptr[j]);
-			}
-		    }
-		else if (header->channel[i].size == OIC_SIZE_INT)
-		    {
-		    fprintf(stderr, "dbg5       size:      int (4 bytes)\n");
-		    int_ptr = (int *) data->raw[i];
-		    for (j=0;j<header->channel[i].num_samples;j++)
-			{
-			fprintf(stderr, "dbg5      %5d  %5d\n", j, int_ptr[j]);
-			}
-		    }
-		else if (header->channel[i].size == OIC_SIZE_FLOAT)
-		    {
-		    fprintf(stderr, "dbg5       size:      float (4 bytes)\n");
-		    float_ptr = (float *) data->raw[i];
-		    for (j=0;j<header->channel[i].num_samples;j++)
-			{
-			fprintf(stderr, "dbg5      %5d  %10f\n", j, float_ptr[j]);
-			}
-		    }
-		else if (header->channel[i].size == OIC_SIZE_3FLOAT)
-		    {
-		    fprintf(stderr, "dbg5       size:      3 floats (12 bytes)\n");
-		    float_ptr = (float *) data->raw[i];
-		    for (j=0;j<header->channel[i].num_samples;j++)
-			{
-			fprintf(stderr, "dbg5      %5d  %10f %10f %10f\n",
-				j, float_ptr[3*j], float_ptr[3*j+1], float_ptr[3*j+2]);
-			}
-		    }
-		else
-		    fprintf(stderr, "dbg5       size:      unknown\n");
-		}
-	    }
-
-	/* now reverse parse the header */
-	if (status == MB_SUCCESS)
-	    {
-	    index = 0;
-	    buffer[index] = 'G';
-	    index += 1;
-	    buffer[index] = 'E';
-	    index += 1;
-	    buffer[index] = 'O';
-	    index += 1;
-	    buffer[index] = header->type;
-	    index += 1;
- 	    mb_put_binary_int(MB_NO,header->proc_status,&buffer[index]);
-	    index += 4;
-	    mb_put_binary_int(MB_NO,header->data_size,&buffer[index]);
-	    index += 4;
-	    buffer[index] = header->client_size; index += 1;
-	    buffer[index] = header->fish_status; index += 1;
-	    buffer[index] = header->nav_used; index += 1;
-	    buffer[index] = header->nav_type; index += 1;
- 	    mb_put_binary_int(MB_NO,header->utm_zone,&buffer[index]);
-	    index += 4;
- 	    mb_put_binary_float(MB_NO,header->ship_x,&buffer[index]);
-	    index += 4;
- 	    mb_put_binary_float(MB_NO,header->ship_y,&buffer[index]);
-	    index += 4;
- 	    mb_put_binary_float(MB_NO,header->ship_course,&buffer[index]);
-	    index += 4;
- 	    mb_put_binary_float(MB_NO,header->ship_speed,&buffer[index]);
-	    index += 4;
- 	    mb_put_binary_int(MB_NO,header->sec,&buffer[index]);
-	    index += 4;
- 	    mb_put_binary_int(MB_NO,header->usec,&buffer[index]);
-	    index += 4;
- 	    mb_put_binary_float(MB_NO,header->spare_gain,&buffer[index]);
-	    index += 4;
- 	    mb_put_binary_float(MB_NO,header->fish_heading,&buffer[index]);
-	    index += 4;
- 	    mb_put_binary_float(MB_NO,header->fish_depth,&buffer[index]);
-	    index += 4;
- 	    mb_put_binary_float(MB_NO,header->fish_range,&buffer[index]);
-	    index += 4;
- 	    mb_put_binary_float(MB_NO,header->fish_pulse_width,&buffer[index]);
-	    index += 4;
- 	    mb_put_binary_float(MB_NO,header->gain_c0,&buffer[index]);
-	    index += 4;
- 	    mb_put_binary_float(MB_NO,header->gain_c1,&buffer[index]);
-	    index += 4;
- 	    mb_put_binary_float(MB_NO,header->gain_c2,&buffer[index]);
-	    index += 4;
- 	    mb_put_binary_float(MB_NO,header->fish_pitch,&buffer[index]);
-	    index += 4;
- 	    mb_put_binary_float(MB_NO,header->fish_roll,&buffer[index]);
-	    index += 4;
- 	    mb_put_binary_float(MB_NO,header->fish_yaw,&buffer[index]);
-	    index += 4;
- 	    mb_put_binary_float(MB_NO,header->fish_x,&buffer[index]);
-	    index += 4;
- 	    mb_put_binary_float(MB_NO,header->fish_y,&buffer[index]);
-	    index += 4;
- 	    mb_put_binary_float(MB_NO,header->fish_layback,&buffer[index]);
-	    index += 4;
- 	    mb_put_binary_float(MB_NO,header->fish_altitude,&buffer[index]);
-	    index += 4;
- 	    mb_put_binary_int(MB_NO,header->fish_altitude_samples,&buffer[index]);
-	    index += 4;
- 	    mb_put_binary_float(MB_NO,header->fish_ping_period,&buffer[index]);
-	    index += 4;
- 	    mb_put_binary_float(MB_NO,header->sound_velocity,&buffer[index]);
-	    index += 4;
- 	    mb_put_binary_int(MB_NO,header->num_chan,&buffer[index]);
-	    index += 4;
-	    for (i=0;i<MBF_OICGEODA_MAX_CHANNELS;i++)
-		{
- 		mb_put_binary_int(MB_NO,header->channel[i].offset,&buffer[index]);
-		index += 4;
-		}
-	    for (i=0;i<MBF_OICGEODA_MAX_CHANNELS;i++)
-		{
-		buffer[index] = header->channel[i].type; index += 1;
-		buffer[index] = header->channel[i].side; index += 1;
-		buffer[index] = header->channel[i].size; index += 1;
-		buffer[index] = header->channel[i].empty; index += 1;
- 		mb_put_binary_int(MB_NO,header->channel[i].frequency,&buffer[index]);
-		index += 4;
- 		mb_put_binary_int(MB_NO,header->channel[i].num_samples,&buffer[index]);
-		index += 4;
-		}
-	    }
-
-	/* write next header to file */
-	if ((write_size = fwrite(buffer,1,MBF_OICGEODA_HEADER_SIZE,
-			mb_io_ptr->mbfp)) == MBF_OICGEODA_HEADER_SIZE)
-		{
-		status = MB_SUCCESS;
-		*error = MB_ERROR_NO_ERROR;
-		}
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-
-	/* write client specific data */
-	if (status == MB_SUCCESS && header->client_size > 0)
-	    {
-	    if ((write_size = fwrite(dataplus->client,1,
-				(int)(header->client_size),mb_io_ptr->mbfp))
-		!= (int)(header->client_size))
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	    }
-
-	/* loop over each data channel and write data */
-	if (status == MB_SUCCESS && header->num_chan > 0)
-	    {
-	    for (i=0;i<header->num_chan;i++)
-		{
-		/* get size of data array */
-		if (header->channel[i].size == OIC_SIZE_CHAR)
-		    data_size = sizeof(char) * header->channel[i].num_samples;
-		else if (header->channel[i].size == OIC_SIZE_SHORT)
-		    data_size = sizeof(short) * header->channel[i].num_samples;
-		else if (header->channel[i].size == OIC_SIZE_INT)
-		    data_size = sizeof(int) * header->channel[i].num_samples;
-		else if (header->channel[i].size == OIC_SIZE_FLOAT)
-		    data_size = sizeof(float) * header->channel[i].num_samples;
-		else if (header->channel[i].size == OIC_SIZE_3FLOAT)
-		    data_size = 3 * sizeof(float) * header->channel[i].num_samples;
-
-		/* byte swap the data if necessary */
-#ifdef BYTESWAPPED
-		if (status == MB_SUCCESS)
-		    {
-		    if (header->channel[i].size == OIC_SIZE_SHORT)
-			{
-			short_ptr = (short *) data->raw[i];
-			for (j=0;j<header->channel[i].num_samples;j++)
-			    {
-			    short_ptr[j] = mb_swap_short(short_ptr[j]);
-			    }
-			}
-		    else if (header->channel[i].size == OIC_SIZE_INT)
-			{
-			int_ptr = (int *) data->raw[i];
-			for (j=0;j<header->channel[i].num_samples;j++)
-			    {
-			    int_ptr[j] = mb_swap_int(int_ptr[j]);
-			    }
-			}
-		    else if (header->channel[i].size == OIC_SIZE_FLOAT)
-			{
-			float_ptr = (float *) data->raw[i];
-			for (j=0;j<header->channel[i].num_samples;j++)
-			    {
-			    mb_swap_float(&float_ptr[j]);
-			    }
-			}
-		    else if (header->channel[i].size == OIC_SIZE_3FLOAT)
-			{
-			float_ptr = (float *) data->raw[i];
-			for (j=0;j<3*header->channel[i].num_samples;j++)
-			    {
-			    mb_swap_float(&float_ptr[j]);
-			    }
-			}
-		    }
-#endif
-
-		/* write the data */
-		if (status == MB_SUCCESS)
-		    {
-		    if ((write_size = fwrite(data->raw[i],1,data_size,mb_io_ptr->mbfp))
-			!= data_size)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_WRITE_FAIL;
-			}
-		    }
-		}
-	    }
-
-	/* print output debug statements */
-	if (verbose >= 2)
-	    {
-	    fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-		    function_name);
-	    fprintf(stderr,"dbg2  Return values:\n");
-	    fprintf(stderr,"dbg2       error:      %d\n",*error);
-	    fprintf(stderr,"dbg2  Return status:\n");
-	    fprintf(stderr,"dbg2       status:  %d\n",status);
-	    }
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mbr_oicmbari.c b/src/mbio/mbr_oicmbari.c
deleted file mode 100644
index 6900c53..0000000
--- a/src/mbio/mbr_oicmbari.c
+++ /dev/null
@@ -1,2045 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbr_oicgeoda.c	2/16/99
- *	$Id: mbr_oicmbari.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1999-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbr_oicmbari.c contains the functions for reading and writing
- * multibeam data in the MBF_OICMBARI format.
- * These functions include:
- *   mbr_alm_oicmbari	- allocate read/write memory
- *   mbr_dem_oicmbari	- deallocate read/write memory
- *   mbr_rt_oicmbari	- read and translate data
- *   mbr_wt_oicmbari	- translate and write data
- *
- * Author:	D. W. Caress
- * Date:	February 16, 1999
- *
- * $Log: mbr_oicmbari.c,v $
- * Revision 5.10  2008/07/10 18:02:39  caress
- * Proceeding towards 5.1.1beta20.
- *
- * Revision 5.7  2005/11/05 00:48:04  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.6  2003/05/20 18:05:32  caress
- * Added svp_source to data source parameters.
- *
- * Revision 5.5  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.4  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.3  2001/07/20 00:32:54  caress
- * Release 5.0.beta03
- *
- * Revision 5.2  2001/03/22  20:50:02  caress
- * Trying to make version 5.0.beta0
- *
- * Revision 5.1  2001/01/22  07:43:34  caress
- * Version 5.0.beta01
- *
- * Revision 5.0  2000/12/01  22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.4  2000/10/11  01:03:21  caress
- * Convert to ANSI C
- *
- * Revision 4.3  2000/09/30  06:34:20  caress
- * Snapshot for Dale.
- *
- * Revision 4.2  1999/12/29  00:34:06  caress
- * Release 4.6.8
- *
- * Revision 4.1  1999/04/07  20:38:24  caress
- * Fixes related to building under Linux.
- *
- * Revision 4.1  1999/04/03 07:36:16  caress
- * Fix bugs in byteswapped code.
- *
- * Revision 4.0  1999/03/31 18:29:20  caress
- * MB-System 4.6beta7
- *
- * Revision 1.1  1999/03/31  18:11:35  caress
- * Initial revision
- *
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mb_define.h"
-#include "mbf_oicmbari.h"
-#include "mbsys_oic.h"
-
-/* include for byte swapping on little-endian machines */
-#ifdef BYTESWAPPED
-#include "mb_swap.h"
-#endif
-
-/* essential function prototypes */
-int mbr_register_oicmbari(int verbose, void *mbio_ptr,
-		int *error);
-int mbr_info_oicmbari(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_alm_oicmbari(int verbose, void *mbio_ptr, int *error);
-int mbr_dem_oicmbari(int verbose, void *mbio_ptr, int *error);
-int mbr_rt_oicmbari(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_wt_oicmbari(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-
-static char rcs_id[]="$Id: mbr_oicmbari.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mbr_register_oicmbari(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_register_oicmbari";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* get mb_io_ptr */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set format info parameters */
-	status = mbr_info_oicmbari(verbose,
-			&mb_io_ptr->system,
-			&mb_io_ptr->beams_bath_max,
-			&mb_io_ptr->beams_amp_max,
-			&mb_io_ptr->pixels_ss_max,
-			mb_io_ptr->format_name,
-			mb_io_ptr->system_name,
-			mb_io_ptr->format_description,
-			&mb_io_ptr->numfile,
-			&mb_io_ptr->filetype,
-			&mb_io_ptr->variable_beams,
-			&mb_io_ptr->traveltime,
-			&mb_io_ptr->beam_flagging,
-			&mb_io_ptr->nav_source,
-			&mb_io_ptr->heading_source,
-			&mb_io_ptr->vru_source,
-			&mb_io_ptr->svp_source,
-			&mb_io_ptr->beamwidth_xtrack,
-			&mb_io_ptr->beamwidth_ltrack,
-			error);
-
-	/* set format and system specific function pointers */
-	mb_io_ptr->mb_io_format_alloc = &mbr_alm_oicmbari;
-	mb_io_ptr->mb_io_format_free = &mbr_dem_oicmbari;
-	mb_io_ptr->mb_io_store_alloc = &mbsys_oic_alloc;
-	mb_io_ptr->mb_io_store_free = &mbsys_oic_deall;
-	mb_io_ptr->mb_io_read_ping = &mbr_rt_oicmbari;
-	mb_io_ptr->mb_io_write_ping = &mbr_wt_oicmbari;
-	mb_io_ptr->mb_io_dimensions = &mbsys_oic_dimensions;
-	mb_io_ptr->mb_io_extract = &mbsys_oic_extract;
-	mb_io_ptr->mb_io_insert = &mbsys_oic_insert;
-	mb_io_ptr->mb_io_extract_nav = &mbsys_oic_extract_nav;
-	mb_io_ptr->mb_io_insert_nav = &mbsys_oic_insert_nav;
-	mb_io_ptr->mb_io_extract_altitude = &mbsys_oic_extract_altitude;
-	mb_io_ptr->mb_io_insert_altitude = &mbsys_oic_insert_altitude;
-	mb_io_ptr->mb_io_extract_svp = NULL;
-	mb_io_ptr->mb_io_insert_svp = NULL;
-	mb_io_ptr->mb_io_ttimes = &mbsys_oic_ttimes;
-	mb_io_ptr->mb_io_detects = &mbsys_oic_detects;
-	mb_io_ptr->mb_io_copyrecord = &mbsys_oic_copy;
-	mb_io_ptr->mb_io_extract_rawss = NULL;
-	mb_io_ptr->mb_io_insert_rawss = NULL;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",mb_io_ptr->system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",mb_io_ptr->beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",mb_io_ptr->beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",mb_io_ptr->pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",mb_io_ptr->format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",mb_io_ptr->system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",mb_io_ptr->format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",mb_io_ptr->numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",mb_io_ptr->filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",mb_io_ptr->variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",mb_io_ptr->traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",mb_io_ptr->beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",mb_io_ptr->nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",mb_io_ptr->heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",mb_io_ptr->vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",mb_io_ptr->svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",mb_io_ptr->beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",mb_io_ptr->beamwidth_ltrack);
-		fprintf(stderr,"dbg2       format_alloc:       %p\n",(void *)mb_io_ptr->mb_io_format_alloc);
-		fprintf(stderr,"dbg2       format_free:        %p\n",(void *)mb_io_ptr->mb_io_format_free);
-		fprintf(stderr,"dbg2       store_alloc:        %p\n",(void *)mb_io_ptr->mb_io_store_alloc);
-		fprintf(stderr,"dbg2       store_free:         %p\n",(void *)mb_io_ptr->mb_io_store_free);
-		fprintf(stderr,"dbg2       read_ping:          %p\n",(void *)mb_io_ptr->mb_io_read_ping);
-		fprintf(stderr,"dbg2       write_ping:         %p\n",(void *)mb_io_ptr->mb_io_write_ping);
-		fprintf(stderr,"dbg2       extract:            %p\n",(void *)mb_io_ptr->mb_io_extract);
-		fprintf(stderr,"dbg2       insert:             %p\n",(void *)mb_io_ptr->mb_io_insert);
-		fprintf(stderr,"dbg2       extract_nav:        %p\n",(void *)mb_io_ptr->mb_io_extract_nav);
-		fprintf(stderr,"dbg2       insert_nav:         %p\n",(void *)mb_io_ptr->mb_io_insert_nav);
-		fprintf(stderr,"dbg2       extract_altitude:   %p\n",(void *)mb_io_ptr->mb_io_extract_altitude);
-		fprintf(stderr,"dbg2       insert_altitude:    %p\n",(void *)mb_io_ptr->mb_io_insert_altitude);
-		fprintf(stderr,"dbg2       extract_svp:        %p\n",(void *)mb_io_ptr->mb_io_extract_svp);
-		fprintf(stderr,"dbg2       insert_svp:         %p\n",(void *)mb_io_ptr->mb_io_insert_svp);
-		fprintf(stderr,"dbg2       ttimes:             %p\n",(void *)mb_io_ptr->mb_io_ttimes);
-		fprintf(stderr,"dbg2       detects:            %p\n",(void *)mb_io_ptr->mb_io_detects);
-		fprintf(stderr,"dbg2       extract_rawss:      %p\n",(void *)mb_io_ptr->mb_io_extract_rawss);
-		fprintf(stderr,"dbg2       insert_rawss:       %p\n",(void *)mb_io_ptr->mb_io_insert_rawss);
-		fprintf(stderr,"dbg2       copyrecord:         %p\n",(void *)mb_io_ptr->mb_io_copyrecord);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbr_info_oicmbari(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error)
-{
-	char	*function_name = "mbr_info_oicmbari";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* set format info parameters */
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-	*system = MB_SYS_OIC;
-	*beams_bath_max = 1024;
-	*beams_amp_max = 256;
-	*pixels_ss_max = 2048;
-	strncpy(format_name, "OICMBARI", MB_NAME_LENGTH);
-	strncpy(system_name, "OIC", MB_NAME_LENGTH);
-	strncpy(format_description, "Format name:          MBF_OICMBARI\nInformal Description: OIC-style extended swath sonar format\nAttributes:           variable beam bathymetry and\n                      amplitude, variable pixel sidescan, binary,\n		      MBARI\n", MB_DESCRIPTION_LENGTH);
-	*numfile = 1;
-	*filetype = MB_FILETYPE_NORMAL;
-	*variable_beams = MB_YES;
-	*traveltime = MB_YES;
-	*beam_flagging = MB_YES;
-	*nav_source = MB_DATA_DATA;
-	*heading_source = MB_DATA_DATA;
-	*vru_source = MB_DATA_DATA;
-	*svp_source = MB_DATA_NONE;
-	*beamwidth_xtrack = 0.0;
-	*beamwidth_ltrack = 0.0;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",*system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",*beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",*beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",*pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",*numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",*filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",*variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",*traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",*beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",*nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",*heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",*vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",*svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",*beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",*beamwidth_ltrack);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_alm_oicmbari(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_alm_oicmbari";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_oicmbari_struct *dataplus;
-	struct mbf_oicmbari_header_struct *header;
-	struct mbf_oicmbari_data_struct *data;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set initial status */
-	status = MB_SUCCESS;
-
-	/* allocate memory for data structure */
-	mb_io_ptr->structure_size = sizeof(struct mbf_oicmbari_struct);
-	status = mb_mallocd(verbose,__FILE__,__LINE__,mb_io_ptr->structure_size,
-				(void **)&mb_io_ptr->raw_data,error);
-	dataplus = (struct mbf_oicmbari_struct *) mb_io_ptr->raw_data;
-	header = &(dataplus->header);
-	data = &(dataplus->data);
-	header->num_chan = 0;
-	header->beams_bath = 0;
-	header->beams_amp = 0;
-	header->bath_chan_port = -1;
-	header->bath_chan_stbd = -1;
-	header->pixels_ss = 0;
-	header->ss_chan_port = -1;
-	header->ss_chan_stbd = -1;
-	for (i=0;i<MBF_OICMBARI_MAX_CHANNELS;i++)
-	    {
-	    header->channel[i].offset = 0;
-	    header->channel[i].num_samples = 0;
-	    data->rawsize[i] = 0;
-	    data->raw[i] = NULL;
-	    }
-	data->beams_bath_alloc = 0;
-	data->beams_amp_alloc = 0;
-	data->pixels_ss_alloc = 0;
-	data->beamflag = NULL;
-	data->bath = NULL;
-	data->amp = NULL;
-	data->bathacrosstrack = NULL;
-	data->bathalongtrack = NULL;
-	data->tt = NULL;
-	data->angle = NULL;
-	data->ss = NULL;
-	data->ssacrosstrack = NULL;
-	data->ssalongtrack = NULL;
-	status = mbsys_oic_alloc(verbose,mbio_ptr,
-		&mb_io_ptr->store_data,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_dem_oicmbari(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_dem_oicmbari";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_oicmbari_struct *dataplus;
-	struct mbf_oicmbari_header_struct *header;
-	struct mbf_oicmbari_data_struct *data;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-	dataplus = (struct mbf_oicmbari_struct *) mb_io_ptr->raw_data;
-	header = &(dataplus->header);
-	data = &(dataplus->data);
-
-	/* deallocate memory for data descriptor */
-	for (i=0;i<MBF_OICMBARI_MAX_CHANNELS;i++)
-	    {
-	    if (data->raw[i] != NULL)
-		status = mb_freed(verbose,__FILE__, __LINE__, (void **)&(data->raw[i]),error);
-	    }
-	if (data->beamflag != NULL)
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&(data->beamflag),error);
-	if (data->bath != NULL)
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&(data->bath),error);
-	if (data->amp != NULL)
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&(data->amp),error);
-	if (data->bathacrosstrack != NULL)
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&(data->bathacrosstrack),error);
-	if (data->bathalongtrack != NULL)
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&(data->bathalongtrack),error);
-	if (data->tt != NULL)
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&(data->tt),error);
-	if (data->angle != NULL)
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&(data->angle),error);
-	if (data->ss != NULL)
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&(data->ss),error);
-	if (data->ssacrosstrack != NULL)
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&(data->ssacrosstrack),error);
-	if (data->ssalongtrack != NULL)
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&(data->ssalongtrack),error);
-	status = mb_freed(verbose,__FILE__, __LINE__, (void **)&mb_io_ptr->raw_data,error);
-	status = mbsys_oic_deall(verbose,mbio_ptr,
-		&mb_io_ptr->store_data,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_rt_oicmbari(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_rt_oicmbari";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_oicmbari_struct *dataplus;
-	struct mbf_oicmbari_header_struct *header;
-	struct mbf_oicmbari_data_struct *data;
-	struct mbsys_oic_struct *store;
-	char	buffer[MBF_OICMBARI_HEADER_SIZE];
-	char	*comment;
-	int	read_size;
-	int	data_size;
-	char	*char_ptr;
-	short	*short_ptr;
-	int	*int_ptr;
-	float	*float_ptr;
-	int	index;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor and data structure */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-	store = (struct mbsys_oic_struct *) store_ptr;
-
-	/* get pointer to raw data structure */
-	dataplus = (struct mbf_oicmbari_struct *) mb_io_ptr->raw_data;
-	header = &(dataplus->header);
-	data = &(dataplus->data);
-	comment = dataplus->client;
-
-	/* set file position */
-	mb_io_ptr->file_pos = mb_io_ptr->file_bytes;
-
-	/* read next four bytes to look for start of header */
-	if ((read_size = fread(buffer,1,4,mb_io_ptr->mbfp)) != 4)
-	    {
-	    status = MB_FAILURE;
-	    *error = MB_ERROR_EOF;
-	    }
-
-	/* read another byted at a time until header found */
-	while (status == MB_SUCCESS
-	    && (buffer[0] != 'G'
-		|| buffer[1] != 'E'
-		|| buffer[2] != '2'))
-	    {
-	    for (i=0;i<3;i++)
-		buffer[i] = buffer[i+1];
-	    if ((read_size = fread(&buffer[3],1,1,mb_io_ptr->mbfp)) != 1)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-	    }
-
-	/* now read the rest of the header */
-	if (status == MB_SUCCESS)
-	    {
-	    if ((read_size = fread(&buffer[4],
-				1,MBF_OICMBARI_HEADER_SIZE-4,
-				mb_io_ptr->mbfp))
-		!= MBF_OICMBARI_HEADER_SIZE-4)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-	    }
-
-	/* now parse the header */
-	if (status == MB_SUCCESS)
-	    {
-	    index = 3;
-	    header->type = buffer[index]; index += 1;
- 	    mb_get_binary_int(MB_NO,&buffer[index],&header->proc_status);
-	    index += 4;
- 	    mb_get_binary_int(MB_NO,&buffer[index],&header->data_size);
-	    index += 4;
-	    header->client_size = buffer[index];
-	    index += 1;
-	    header->fish_status = buffer[index];
-	    index += 1;
-	    header->nav_used = buffer[index];
-	    index += 1;
-	    header->nav_type = buffer[index];
-	    index += 1;
- 	    mb_get_binary_int(MB_NO,&buffer[index],&header->utm_zone);
-	    index += 4;
- 	    mb_get_binary_float(MB_NO,&buffer[index],&header->ship_x);
-	    index += 4;
- 	    mb_get_binary_float(MB_NO,&buffer[index],&header->ship_y);
-	    index += 4;
- 	    mb_get_binary_float(MB_NO,&buffer[index],&header->ship_course);
-	    index += 4;
- 	    mb_get_binary_float(MB_NO,&buffer[index],&header->ship_speed);
-	    index += 4;
- 	    mb_get_binary_int(MB_NO,&buffer[index],&header->sec);
-	    index += 4;
- 	    mb_get_binary_int(MB_NO,&buffer[index],&header->usec);
-	    index += 4;
- 	    mb_get_binary_float(MB_NO,&buffer[index],&header->spare_gain);
-	    index += 4;
- 	    mb_get_binary_float(MB_NO,&buffer[index],&header->fish_heading);
-	    index += 4;
- 	    mb_get_binary_float(MB_NO,&buffer[index],&header->fish_depth);
-	    index += 4;
- 	    mb_get_binary_float(MB_NO,&buffer[index],&header->fish_range);
-	    index += 4;
- 	    mb_get_binary_float(MB_NO,&buffer[index],&header->fish_pulse_width);
-	    index += 4;
- 	    mb_get_binary_float(MB_NO,&buffer[index],&header->gain_c0);
-	    index += 4;
- 	    mb_get_binary_float(MB_NO,&buffer[index],&header->gain_c1);
-	    index += 4;
- 	    mb_get_binary_float(MB_NO,&buffer[index],&header->gain_c2);
-	    index += 4;
- 	    mb_get_binary_float(MB_NO,&buffer[index],&header->fish_pitch);
-	    index += 4;
- 	    mb_get_binary_float(MB_NO,&buffer[index],&header->fish_roll);
-	    index += 4;
- 	    mb_get_binary_float(MB_NO,&buffer[index],&header->fish_yaw);
-	    index += 4;
- 	    mb_get_binary_float(MB_NO,&buffer[index],&header->fish_x);
-	    index += 4;
- 	    mb_get_binary_float(MB_NO,&buffer[index],&header->fish_y);
-	    index += 4;
- 	    mb_get_binary_float(MB_NO,&buffer[index],&header->fish_layback);
-	    index += 4;
- 	    mb_get_binary_float(MB_NO,&buffer[index],&header->fish_altitude);
-	    index += 4;
- 	    mb_get_binary_int(MB_NO,&buffer[index],&header->fish_altitude_samples);
-	    index += 4;
- 	    mb_get_binary_float(MB_NO,&buffer[index],&header->fish_ping_period);
-	    index += 4;
- 	    mb_get_binary_float(MB_NO,&buffer[index],&header->sound_velocity);
-	    index += 4;
- 	    mb_get_binary_int(MB_NO,&buffer[index],&header->num_chan);
-	    index += 4;
-	    for (i=0;i<MBF_OICMBARI_MAX_CHANNELS;i++)
-		{
- 		mb_get_binary_int(MB_NO,&buffer[index],&header->channel[i].offset);
-		index += 4;
-		}
-	    for (i=0;i<MBF_OICMBARI_MAX_CHANNELS;i++)
-		{
-		header->channel[i].type = buffer[index];
-		index += 1;
-		header->channel[i].side = buffer[index];
-		index += 1;
-		header->channel[i].size = buffer[index];
-		index += 1;
-		header->channel[i].empty = buffer[index];
-		index += 1;
- 		mb_get_binary_int(MB_NO,&buffer[index],&header->channel[i].frequency);
-		index += 4;
- 		mb_get_binary_int(MB_NO,&buffer[index],&header->channel[i].num_samples);
-		index += 4;
-		}
- 	    mb_get_binary_int(MB_NO,&buffer[index],&header->beams_bath);
-	    index += 4;
- 	    mb_get_binary_int(MB_NO,&buffer[index],&header->beams_amp);
-	    index += 4;
- 	    mb_get_binary_int(MB_NO,&buffer[index],&header->bath_chan_port);
-	    index += 4;
- 	    mb_get_binary_int(MB_NO,&buffer[index],&header->bath_chan_stbd);
-	    index += 4;
- 	    mb_get_binary_int(MB_NO,&buffer[index],&header->pixels_ss);
-	    index += 4;
- 	    mb_get_binary_int(MB_NO,&buffer[index],&header->ss_chan_port);
-	    index += 4;
- 	    mb_get_binary_int(MB_NO,&buffer[index],&header->ss_chan_stbd);
-	    index += 4;
-	    }
-
-	/* read client specific data */
-	if (status == MB_SUCCESS && header->client_size > 0)
-	    {
-	    if ((read_size = fread(dataplus->client,1,
-				(int)(header->client_size),mb_io_ptr->mbfp))
-		== (int)(header->client_size))
-		{
-		if (header->client_size < MBF_OICMBARI_MAX_CLIENT)
-		    dataplus->client[header->client_size] = 0;
-		}
-	    else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-	    }
-
-	/* check for comment or unintelligible records */
-	if (status == MB_SUCCESS)
-	    {
-	    if (header->type == OIC_ID_COMMENT)
-		{
-		dataplus->kind = MB_DATA_COMMENT;
-		}
-	    else if (header->num_chan > 0 && header->num_chan <= 8)
-		{
-		dataplus->kind = MB_DATA_DATA;
-		}
-	    else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_UNINTELLIGIBLE;
-		dataplus->kind = MB_DATA_NONE;
-		}
-	    }
-
-	/* set kind and error in mb_io_ptr */
-	mb_io_ptr->new_kind = dataplus->kind;
-	mb_io_ptr->new_error = *error;
-
-	/* loop over each data channel and read data */
-	if (status == MB_SUCCESS && header->num_chan > 0)
-	    {
-	    for (i=0;i<header->num_chan;i++)
-		{
-		/* get size of data array */
-		if (header->channel[i].size == OIC_SIZE_CHAR)
-		    data_size = sizeof(char) * header->channel[i].num_samples;
-		else if (header->channel[i].size == OIC_SIZE_SHORT)
-		    data_size = sizeof(short) * header->channel[i].num_samples;
-		else if (header->channel[i].size == OIC_SIZE_INT)
-		    data_size = sizeof(int) * header->channel[i].num_samples;
-		else if (header->channel[i].size == OIC_SIZE_FLOAT)
-		    data_size = sizeof(float) * header->channel[i].num_samples;
-		else if (header->channel[i].size == OIC_SIZE_3FLOAT)
-		    data_size = 3 * sizeof(float) * header->channel[i].num_samples;
-
-		/* allocate data if needed */
-		if (data_size > data->rawsize[i]
-		    || data->raw[i] == NULL)
-		    {
-		    if (data->raw[i] != NULL)
-			status = mb_freed(verbose,__FILE__, __LINE__, (void **) &(data->raw[i]), error);
-		    status = mb_mallocd(verbose,__FILE__,__LINE__, data_size, (void **)&(data->raw[i]),error);
-		    data->rawsize[i] = data_size;
-		    }
-
-		/* read the data */
-		if (status == MB_SUCCESS)
-		    {
-		    if ((read_size = fread(data->raw[i],1,data_size,mb_io_ptr->mbfp)) != data_size)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_EOF;
-			}
-		    }
-
-		/* byte swap the data if necessary */
-#ifdef BYTESWAPPED
-		if (status == MB_SUCCESS)
-		    {
-		    if (header->channel[i].size == OIC_SIZE_SHORT)
-			{
-			short_ptr = (short *) data->raw[i];
-			for (j=0;j<header->channel[i].num_samples;j++)
-			    {
-			    short_ptr[j] = mb_swap_short(short_ptr[j]);
-			    }
-			}
-		    else if (header->channel[i].size == OIC_SIZE_INT)
-			{
-			int_ptr = (int *) data->raw[i];
-			for (j=0;j<header->channel[i].num_samples;j++)
-			    {
-			    int_ptr[j] = mb_swap_int(int_ptr[j]);
-			    }
-			}
-		    else if (header->channel[i].size == OIC_SIZE_FLOAT)
-			{
-			float_ptr = (float *) data->raw[i];
-			for (j=0;j<header->channel[i].num_samples;j++)
-			    {
-			    mb_swap_float(&float_ptr[j]);
-			    }
-			}
-		    else if (header->channel[i].size == OIC_SIZE_3FLOAT)
-			{
-			float_ptr = (float *) data->raw[i];
-			for (j=0;j<3*header->channel[i].num_samples;j++)
-			    {
-			    mb_swap_float(&float_ptr[j]);
-			    }
-			}
-		    }
-#endif
-		}
-	    }
-
-	/* print debug statements */
-	if (verbose >= 5)
-	    {
-	    fprintf(stderr,"\ndbg5  New header read in function <%s>\n",function_name);
-	    fprintf(stderr,"dbg5       type:             %d\n",header->type);
-	    fprintf(stderr,"dbg5       proc_status:      %d\n",header->proc_status);
-	    fprintf(stderr,"dbg5       data_size:        %d\n",header->data_size);
-	    fprintf(stderr,"dbg5       client_size:      %d\n",header->client_size);
-	    fprintf(stderr,"dbg5       fish_status:      %d\n",header->fish_status);
-	    fprintf(stderr,"dbg5       nav_used:         %d\n",header->nav_used);
-	    fprintf(stderr,"dbg5       nav_type:         %d\n",header->nav_type);
-	    fprintf(stderr,"dbg5       utm_zone:         %d\n",header->utm_zone);
-	    fprintf(stderr,"dbg5       ship_x:           %f\n",header->ship_x);
-	    fprintf(stderr,"dbg5       ship_y:           %f\n",header->ship_y);
-	    fprintf(stderr,"dbg5       ship_course:      %f\n",header->ship_course);
-	    fprintf(stderr,"dbg5       ship_speed:       %f\n",header->ship_speed);
-	    fprintf(stderr,"dbg5       sec:              %d\n",header->sec);
-	    fprintf(stderr,"dbg5       usec:             %d\n",header->usec);
-	    fprintf(stderr,"dbg5       spare_gain:       %f\n",header->spare_gain);
-	    fprintf(stderr,"dbg5       fish_heading:     %f\n",header->fish_heading);
-	    fprintf(stderr,"dbg5       fish_depth:       %f\n",header->fish_depth);
-	    fprintf(stderr,"dbg5       fish_range:       %f\n",header->fish_range);
-	    fprintf(stderr,"dbg5       fish_pulse_width: %f\n",header->fish_pulse_width);
-	    fprintf(stderr,"dbg5       gain_c0:          %f\n",header->gain_c0);
-	    fprintf(stderr,"dbg5       gain_c1:          %f\n",header->gain_c1);
-	    fprintf(stderr,"dbg5       gain_c2:          %f\n",header->gain_c2);
-	    fprintf(stderr,"dbg5       fish_pitch:       %f\n",header->fish_pitch);
-	    fprintf(stderr,"dbg5       fish_roll:        %f\n",header->fish_roll);
-	    fprintf(stderr,"dbg5       fish_yaw:         %f\n",header->fish_yaw);
-	    fprintf(stderr,"dbg5       fish_x:           %f\n",header->fish_x);
-	    fprintf(stderr,"dbg5       fish_y:           %f\n",header->fish_y);
-	    fprintf(stderr,"dbg5       fish_layback:     %f\n",header->fish_layback);
-	    fprintf(stderr,"dbg5       fish_altitude:    %f\n",header->fish_altitude);
-	    fprintf(stderr,"dbg5       fish_altitude_samples: %d\n",header->fish_altitude_samples);
-	    fprintf(stderr,"dbg5       fish_ping_period: %f\n",header->fish_ping_period);
-	    fprintf(stderr,"dbg5       sound_velocity:   %f\n",header->sound_velocity);
-	    fprintf(stderr,"dbg5       num_chan:         %d\n",header->num_chan);
-	    fprintf(stderr,"dbg5       beams_bath:       %d\n",header->beams_bath);
-	    fprintf(stderr,"dbg5       beams_amp:        %d\n",header->beams_amp);
-	    fprintf(stderr,"dbg5       bath_chan_port:   %d\n",header->bath_chan_port);
-	    fprintf(stderr,"dbg5       bath_chan_stbd:   %d\n",header->bath_chan_stbd);
-	    fprintf(stderr,"dbg5       pixels_ss:        %d\n",header->pixels_ss);
-	    fprintf(stderr,"dbg5       ss_chan_port:     %d\n",header->ss_chan_port);
-	    fprintf(stderr,"dbg5       ss_chan_stbd:     %d\n",header->ss_chan_stbd);
-	    for (i=0;i<header->num_chan;i++)
-		{
-		fprintf(stderr,"dbg5       offset[%1d]:      %d\n",
-			     i, header->channel[i].offset);
-		fprintf(stderr,"dbg5       type[%1d]:        %d\n",
-			     i, header->channel[i].type);
-		fprintf(stderr,"dbg5       side[%1d]:        %d\n",
-			     i, header->channel[i].side);
-		fprintf(stderr,"dbg5       size[%1d]:        %d\n",
-			     i, header->channel[i].size);
-		fprintf(stderr,"dbg5       empty[%1d]:       %d\n",
-			     i, header->channel[i].empty);
-		fprintf(stderr,"dbg5       frequency[%1d]:   %d\n",
-			     i, header->channel[i].frequency);
-		fprintf(stderr,"dbg5       num_samples[%1d]: %d\n",
-			     i, header->channel[i].num_samples);
-		}
-	    for (i=0;i<header->num_chan;i++)
-		{
-		fprintf(stderr,"\ndbg5  New data read in function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       channel:   %d\n", i);
-		if (header->channel[i].type == OIC_TYPE_SIDESCAN)
-		    fprintf(stderr, "dbg5       data type: sidescan\n");
-		else if (header->channel[i].type == OIC_TYPE_ANGLE)
-		    fprintf(stderr, "dbg5       data type: angle\n");
-		else if (header->channel[i].type == OIC_TYPE_MULTIBEAM)
-		    fprintf(stderr, "dbg5       data type: multibeam\n");
-		else
-		    fprintf(stderr, "dbg5       data type: unknown\n");
-		if (header->channel[i].side == OIC_PORT)
-		    fprintf(stderr, "dbg5       side:      port\n");
-		else if (header->channel[i].side == OIC_STARBOARD)
-		    fprintf(stderr, "dbg5       side:      starboard\n");
-		else
-		    fprintf(stderr, "dbg5       side:      unknown\n");
-		fprintf(stderr,"dbg5       frequency:   %d\n", header->channel[i].frequency);
-		fprintf(stderr,"dbg5       num samples: %d\n", header->channel[i].num_samples);
-		if (header->channel[i].size == OIC_SIZE_CHAR)
-		    {
-		    fprintf(stderr, "dbg5       size:      char (1 byte)\n");
-		    char_ptr = (char *) data->raw[i];
-		    for (j=0;j<header->channel[i].num_samples;j++)
-			{
-			fprintf(stderr, "dbg5      %5d  %5d\n", j, char_ptr[j]);
-			}
-		    }
-		else if (header->channel[i].size == OIC_SIZE_SHORT)
-		    {
-		    fprintf(stderr, "dbg5        size:      short (2 bytes)\n");
-		    short_ptr = (short *) data->raw[i];
-		    for (j=0;j<header->channel[i].num_samples;j++)
-			{
-			fprintf(stderr, "dbg5      %5d  %5d\n", j, short_ptr[j]);
-			}
-		    }
-		else if (header->channel[i].size == OIC_SIZE_INT)
-		    {
-		    fprintf(stderr, "dbg5       size:       int (4 bytes)\n");
-		    int_ptr = (int *) data->raw[i];
-		    for (j=0;j<header->channel[i].num_samples;j++)
-			{
-			fprintf(stderr, "dbg5      %5d  %5d\n", j, int_ptr[j]);
-			}
-		    }
-		else if (header->channel[i].size == OIC_SIZE_FLOAT)
-		    {
-		    fprintf(stderr, "dbg5       size:       float (4 bytes)\n");
-		    float_ptr = (float *) data->raw[i];
-		    for (j=0;j<header->channel[i].num_samples;j++)
-			{
-			fprintf(stderr, "dbg5      %5d  %10f\n", j, float_ptr[j]);
-			}
-		    }
-		else if (header->channel[i].size == OIC_SIZE_3FLOAT)
-		    {
-		    fprintf(stderr, "dbg5       size:       3 floats (12 bytes)\n");
-		    float_ptr = (float *) data->raw[i];
-		    for (j=0;j<header->channel[i].num_samples;j++)
-			{
-			fprintf(stderr, "dbg5      %5d  %10f %10f %10f\n",
-				j, float_ptr[3*j], float_ptr[3*j+1], float_ptr[3*j+2]);
-			}
-		    }
-		else
-		    fprintf(stderr, "dbg5      size:       unknown\n");
-		}
-	    fprintf(stderr,"dbg5       status:     %d\n",status);
-	    fprintf(stderr,"dbg5       error:      %d\n",*error);
-	    }
-
-	/* allocate memory for processed bathymetry and sidescan data */
-	if (status == MB_SUCCESS
-	    && dataplus->kind == MB_DATA_DATA)
-	    {
-	    /* allocate arrays if needed */
-	    if (header->beams_bath > data->beams_bath_alloc
-		|| data->bath == NULL)
-		{
-		data->beams_bath_alloc = header->beams_bath;
-		if (data->bath != NULL)
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **) &(data->beamflag), error);
-		if (data->bath != NULL)
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **) &(data->bath), error);
-		if (data->bathacrosstrack != NULL)
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **) &(data->bathacrosstrack), error);
-		if (data->bathalongtrack != NULL)
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **) &(data->bathalongtrack), error);
-		if (data->tt != NULL)
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **) &(data->tt), error);
-		if (data->angle != NULL)
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **) &(data->angle), error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__, header->beams_bath * sizeof(char),
-				    (void **)&(data->beamflag), error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__, header->beams_bath * sizeof(float),
-				    (void **)&(data->bath), error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__, header->beams_bath * sizeof(float),
-				    (void **)&(data->bathacrosstrack), error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__, header->beams_bath * sizeof(float),
-				    (void **)&(data->bathalongtrack), error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__, header->beams_bath * sizeof(float),
-				    (void **)&(data->tt), error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__, header->beams_bath * sizeof(float),
-				    (void **)&(data->angle), error);
-		}
-	    if (header->beams_amp > data->beams_amp_alloc
-		|| data->amp == NULL)
-		{
-		data->beams_amp_alloc = header->beams_amp;
-		if (data->amp != NULL)
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **) &(data->amp), error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__, header->beams_amp * sizeof(float),
-				    (void **)&(data->amp), error);
-		}
-	    if (header->pixels_ss > data->pixels_ss_alloc
-		|| data->ss == NULL)
-		{
-		data->pixels_ss_alloc = header->pixels_ss;
-		if (data->ss != NULL)
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **) &(data->ss), error);
-		if (data->ssacrosstrack != NULL)
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **) &(data->ssacrosstrack), error);
-		if (data->ssalongtrack != NULL)
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **) &(data->ssalongtrack), error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__, header->pixels_ss * sizeof(float),
-				    (void **)&(data->ss), error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__, header->pixels_ss * sizeof(float),
-				    (void **)&(data->ssacrosstrack), error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__, header->pixels_ss * sizeof(float),
-				   (void **) &(data->ssalongtrack), error);
-		}
-	    }
-
-	/* read processed bathymetry */
-	if (status == MB_SUCCESS
-	    && dataplus->kind == MB_DATA_DATA
-	    && header->beams_bath > 0)
-	    {
-	    /* get beamflag array */
-	    data_size = header->beams_bath * sizeof(char);
-	    if ((read_size = fread(data->beamflag,1,data_size,mb_io_ptr->mbfp)) != data_size)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	    /* get bath array */
-	    data_size = header->beams_bath * sizeof(float);
-	    if ((read_size = fread(data->bath,1,data_size,mb_io_ptr->mbfp)) != data_size)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	    /* get bathacrosstrack array */
-	    data_size = header->beams_bath * sizeof(float);
-	    if ((read_size = fread(data->bathacrosstrack,1,data_size,mb_io_ptr->mbfp)) != data_size)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	    /* get bathalongtrack array */
-	    data_size = header->beams_bath * sizeof(float);
-	    if ((read_size = fread(data->bathalongtrack,1,data_size,mb_io_ptr->mbfp)) != data_size)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	    /* get tt array */
-	    data_size = header->beams_bath * sizeof(float);
-	    if ((read_size = fread(data->tt,1,data_size,mb_io_ptr->mbfp)) != data_size)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	    /* get angle array */
-	    data_size = header->beams_bath * sizeof(float);
-	    if ((read_size = fread(data->angle,1,data_size,mb_io_ptr->mbfp)) != data_size)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-	    }
-
-	/* read processed amplitude */
-	if (status == MB_SUCCESS
-	    && dataplus->kind == MB_DATA_DATA
-	    && header->beams_amp > 0)
-	    {
-	    /* get amplitude array */
-	    data_size = header->beams_amp * sizeof(char);
-	    if ((read_size = fread(data->amp,1,data_size,mb_io_ptr->mbfp)) != data_size)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-	    }
-
-	/* read processed sidescan */
-	if (status == MB_SUCCESS
-	    && dataplus->kind == MB_DATA_DATA
-	    && header->pixels_ss > 0)
-	    {
-	    /* get ss array */
-	    data_size = header->pixels_ss * sizeof(float);
-	    if ((read_size = fread(data->ss,1,data_size,mb_io_ptr->mbfp)) != data_size)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	    /* get ssacrosstrack array */
-	    data_size = header->pixels_ss * sizeof(float);
-	    if ((read_size = fread(data->ssacrosstrack,1,data_size,mb_io_ptr->mbfp)) != data_size)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	    /* get ssalongtrack array */
-	    data_size = header->pixels_ss * sizeof(float);
-	    if ((read_size = fread(data->ssalongtrack,1,data_size,mb_io_ptr->mbfp)) != data_size)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-	    }
-
-	/* byte swap the processed data if necessary */
-#ifdef BYTESWAPPED
-	if (status == MB_SUCCESS)
-	    {
-	    for (j=0;j<header->beams_bath;j++)
-		{
-		mb_swap_float(&data->bath[j]);
-		mb_swap_float(&data->bathacrosstrack[j]);
-		mb_swap_float(&data->bathalongtrack[j]);
-		mb_swap_float(&data->tt[j]);
-		mb_swap_float(&data->angle[j]);
-		}
-	    for (j=0;j<header->beams_amp;j++)
-		{
-		mb_swap_float(&data->amp[j]);
-		}
-	    for (j=0;j<header->pixels_ss;j++)
-		{
-		mb_swap_float(&data->ssacrosstrack[j]);
-		mb_swap_float(&data->ssalongtrack[j]);
-		mb_swap_float(&data->ss[j]);
-		}
-	    }
-#endif
-
-	/* print debug statements */
-	if (verbose >= 5 && status == MB_SUCCESS)
-	    {
-	    fprintf(stderr,"\ndbg5  New processed data read in function <%s>\n",
-		    function_name);
-	    fprintf(stderr,"dbg5       beams_bath:       %d\n",header->beams_bath);
-	    fprintf(stderr,"dbg5       beam   bath  xtrack ltrack   tt   angle\n");
-	    for (i=0;i<header->beams_bath;i++)
-		{
-		fprintf(stderr,"dbg5       %4d %10f %10f %10f %10f %10f\n",
-			i, data->bath[i], data->bathacrosstrack[i],
-			data->bathalongtrack[i],
-			data->tt[i], data->angle[i]);
-		}
-	    fprintf(stderr,"dbg5       beams_amp:       %d\n",header->beams_amp);
-	    fprintf(stderr,"dbg5       beam   amp  xtrack ltrack\n");
-	    for (i=0;i<header->beams_amp;i++)
-		{
-		fprintf(stderr,"dbg5       %4d %10f %10f %10f\n",
-			i, data->amp[i], data->bathacrosstrack[i],
-			data->bathalongtrack[i]);
-		}
-	    fprintf(stderr,"dbg5       pixels_ss:       %d\n",header->pixels_ss);
-	    fprintf(stderr,"dbg5       beam   ss  xtrack ltrack\n");
-	    for (i=0;i<header->beams_amp;i++)
-		{
-		fprintf(stderr,"dbg5       %4d %10f %10f %10f\n",
-			i, data->ss[i], data->ssacrosstrack[i],
-			data->ssalongtrack[i]);
-		}
-	    }
-
-	/* translate values to data storage structure */
-	if (status == MB_SUCCESS
-		&& store != NULL)
-	    {
-	    /* type of data record */
-	    store->kind = dataplus->kind;
-	    store->type = header->type;
-
-	    /* status and size */
-	    store->proc_status = header->proc_status;
-	    store->data_size = header->data_size;
-	    store->client_size = header->client_size;
-	    store->fish_status = header->fish_status;
-
-	    /* nav */
-	    store->nav_used = header->nav_used;
-	    store->nav_type = header->nav_type;
-	    store->utm_zone = header->utm_zone;
-	    store->ship_x = header->ship_x;
-	    store->ship_y = header->ship_y;
-	    store->ship_course = header->ship_course;
-	    store->ship_speed = header->ship_speed;
-
-	    /* time stamp */
-	    store->sec = header->sec;
-	    store->usec = header->usec;
-
-	    /* more stuff */
-	    store->spare_gain = header->spare_gain;
-	    store->fish_heading = header->fish_heading;
-	    store->fish_depth = header->fish_depth;
-	    store->fish_range = header->fish_range;
-	    store->fish_pulse_width = header->fish_pulse_width;
-	    store->gain_c0 = header->gain_c0;
-	    store->gain_c1 = header->gain_c1;
-	    store->gain_c2 = header->gain_c2;
-	    store->fish_pitch = header->fish_pitch;
-	    store->fish_roll = header->fish_roll;
-	    store->fish_yaw = header->fish_yaw;
-	    store->fish_x = header->fish_x;
-	    store->fish_y = header->fish_y;
-	    store->fish_layback = header->fish_layback;
-	    store->fish_altitude = header->fish_altitude;
-	    store->fish_altitude_samples = header->fish_altitude_samples;
-	    store->fish_ping_period = header->fish_ping_period;
-	    store->sound_velocity = header->sound_velocity;
-
-	    /* numbers of beams and scaling */
-	    store->num_chan = header->num_chan;
-	    store->beams_bath = header->beams_bath;
-	    store->beams_amp = header->beams_amp;
-	    store->bath_chan_port = header->bath_chan_port;
-	    store->bath_chan_stbd = header->bath_chan_stbd;
-	    store->pixels_ss = header->pixels_ss;
-	    store->ss_chan_port = header->ss_chan_port;
-	    store->ss_chan_stbd = header->ss_chan_stbd;
-
-	    /* raw data */
-	    for (i=0;i<store->num_chan;i++)
-		{
-		/* copy channel info */
-		store->channel[i].offset = header->channel[i].offset;
-		store->channel[i].type = header->channel[i].type;
-		store->channel[i].side = header->channel[i].side;
-		store->channel[i].size = header->channel[i].size;
-		store->channel[i].empty = header->channel[i].empty;
-		store->channel[i].frequency = header->channel[i].frequency;
-		store->channel[i].num_samples = header->channel[i].num_samples;
-
-		/* allocate data if needed */
-		if (data->rawsize[i] > store->rawsize[i]
-		    || store->raw[i] == NULL)
-		    {
-		    if (store->raw[i] != NULL)
-			status = mb_freed(verbose,__FILE__, __LINE__, (void **) &(store->raw[i]), error);
-		    store->rawsize[i] = data->rawsize[i];
-		    status = mb_mallocd(verbose,__FILE__,__LINE__,store->rawsize[i], (void **)&(store->raw[i]),error);
-		    }
-
-		/* copy the data */
-		if (status == MB_SUCCESS)
-		    {
-		    for (j=0;j<store->rawsize[i];j++)
-			{
-			store->raw[i][j] = data->raw[i][j];
-			}
-		    }
-		}
-
-	    /* depths and sidescan */
-	    if (header->beams_bath > store->beams_bath_alloc
-		|| store->beamflag == NULL
-		|| store->bath == NULL
-		|| store->bathacrosstrack == NULL
-		|| store->bathalongtrack == NULL
-		|| store->tt == NULL
-		|| store->angle == NULL)
-		{
-		store->beams_bath_alloc = header->beams_bath;
-		if (store->beamflag != NULL)
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **) &(store->beamflag), error);
-		if (store->bath != NULL)
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **) &(store->bath), error);
-		if (store->bathacrosstrack != NULL)
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **) &(store->bathacrosstrack), error);
-		if (store->bathalongtrack != NULL)
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **) &(store->bathalongtrack), error);
-		if (store->tt != NULL)
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **) &(store->tt), error);
-		if (store->angle != NULL)
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **) &(store->angle), error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,store->beams_bath_alloc * sizeof(char),
-				    (void **)&(store->beamflag),error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,store->beams_bath_alloc * sizeof(float),
-				    (void **)&(store->bath),error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,store->beams_bath_alloc * sizeof(float),
-				    (void **)&(store->bathacrosstrack),error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,store->beams_bath_alloc * sizeof(float),
-				    (void **)&(store->bathalongtrack),error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,store->beams_bath_alloc * sizeof(float),
-				    (void **)&(store->tt),error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,store->beams_bath_alloc * sizeof(float),
-				    (void **)&(store->angle),error);
-		}
-	    if (header->beams_amp > store->beams_amp_alloc
-		|| store->amp == NULL)
-		{
-		store->beams_amp_alloc = header->beams_amp;
-		if (store->amp != NULL)
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **) &(store->amp), error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,store->beams_amp_alloc * sizeof(float),
-				    (void **)&(store->amp),error);
-		}
-	    if (header->pixels_ss > store->pixels_ss_alloc
-		|| store->ss == NULL
-		|| store->ssacrosstrack == NULL
-		|| store->ssalongtrack == NULL)
-		{
-		store->pixels_ss_alloc = header->pixels_ss;
-		if (store->ss != NULL)
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **) &(store->ss), error);
-		if (store->ssacrosstrack != NULL)
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **) &(store->ssacrosstrack), error);
-		if (store->ssalongtrack != NULL)
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **) &(store->ssalongtrack), error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,store->pixels_ss_alloc * sizeof(float),
-				    (void **)&(store->ss),error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,store->pixels_ss_alloc * sizeof(float),
-				    (void **)&(store->ssacrosstrack),error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,store->pixels_ss_alloc * sizeof(float),
-				    (void **)&(store->ssalongtrack),error);
-		}
-	    for (i=0;i<store->beams_bath;i++)
-		{
-		store->beamflag[i] = data->beamflag[i];
-		store->bath[i] = data->bath[i];
-		store->bathacrosstrack[i] = data->bathacrosstrack[i];
-		store->bathalongtrack[i] = data->bathalongtrack[i];
-		store->tt[i] = data->tt[i];
-		store->angle[i] = data->angle[i];
-		}
-	    for (i=0;i<store->beams_amp;i++)
-		{
-		store->amp[i] = data->amp[i];
-		}
-	    for (i=0;i<store->pixels_ss;i++)
-		{
-		store->ss[i] = data->ss[i];
-		store->ssacrosstrack[i] = data->ssacrosstrack[i];
-		store->ssalongtrack[i] = data->ssalongtrack[i];
-		}
-
-	    /* client */
-	    for (i=0;i<header->client_size;i++)
-		store->client[i] = dataplus->client[i];
-	    }
-
-	/* print output debug statements */
-	if (verbose >= 2)
-	    {
-	    fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-		    function_name);
-	    fprintf(stderr,"dbg2  Return values:\n");
-	    fprintf(stderr,"dbg2       error:      %d\n",*error);
-	    fprintf(stderr,"dbg2  Return status:\n");
-	    fprintf(stderr,"dbg2       status:  %d\n",status);
-	    }
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_wt_oicmbari(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_wt_oicmbari";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_oicmbari_struct *dataplus;
-	struct mbf_oicmbari_header_struct *header;
-	struct mbf_oicmbari_data_struct *data;
-	struct mbsys_oic_struct *store;
-	char	buffer[MBF_OICMBARI_HEADER_SIZE];
-	char	*comment;
-	int	write_size;
-	int	data_size;
-	char	*char_ptr;
-	short	*short_ptr;
-	int	*int_ptr;
-	float	*float_ptr;
-	int	index;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor and data storage */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-	store = (struct mbsys_oic_struct *) store_ptr;
-
-	/* get pointer to raw data structure */
-	dataplus = (struct mbf_oicmbari_struct *) mb_io_ptr->raw_data;
-	header = &(dataplus->header);
-	data = &(dataplus->data);
-	comment = dataplus->client;
-
-	/* first translate values from data storage structure */
-	if (store != NULL)
-	    {
-	    /* type of data record */
-	    dataplus->kind = store->kind;
-	    header->type = store->type;
-
-	    /* status and size */
-	    header->proc_status = store->proc_status;
-	    header->data_size = store->data_size;
-	    header->client_size = store->client_size;
-	    header->fish_status = store->fish_status;
-
-	    /* nav */
-	    header->nav_used = store->nav_used;
-	    header->nav_type = store->nav_type;
-	    header->utm_zone = store->utm_zone;
-	    header->ship_x = store->ship_x;
-	    header->ship_y = store->ship_y;
-	    header->ship_course = store->ship_course;
-	    header->ship_speed = store->ship_speed;
-
-	    /* time stamp */
-	    header->sec = store->sec;
-	    header->usec = store->usec;
-
-	    /* more stuff */
-	    header->spare_gain = store->spare_gain;
-	    header->fish_heading = store->fish_heading;
-	    header->fish_depth = store->fish_depth;
-	    header->fish_range = store->fish_range;
-	    header->fish_pulse_width = store->fish_pulse_width;
-	    header->gain_c0 = store->gain_c0;
-	    header->gain_c1 = store->gain_c1;
-	    header->gain_c2 = store->gain_c2;
-	    header->fish_pitch = store->fish_pitch;
-	    header->fish_roll = store->fish_roll;
-	    header->fish_yaw = store->fish_yaw;
-	    header->fish_x = store->fish_x;
-	    header->fish_y = store->fish_y;
-	    header->fish_layback = store->fish_layback;
-	    header->fish_altitude = store->fish_altitude;
-	    header->fish_altitude_samples = store->fish_altitude_samples;
-	    header->fish_ping_period = store->fish_ping_period;
-	    header->sound_velocity = store->sound_velocity;
-
-	    /* numbers of beams and scaling */
-	    header->num_chan = store->num_chan;
-	    header->beams_bath = store->beams_bath;
-	    header->beams_amp = store->beams_amp;
-	    header->bath_chan_port = store->bath_chan_port;
-	    header->bath_chan_stbd = store->bath_chan_stbd;
-	    header->pixels_ss = store->pixels_ss;
-	    header->ss_chan_port = store->ss_chan_port;
-	    header->ss_chan_stbd = store->ss_chan_stbd;
-
-	    /* raw data */
-	    for (i=0;i<header->num_chan;i++)
-		{
-		/* copy channel info */
-		header->channel[i].offset = store->channel[i].offset;
-		header->channel[i].type = store->channel[i].type;
-		header->channel[i].side = store->channel[i].side;
-		header->channel[i].size = store->channel[i].size;
-		header->channel[i].empty = store->channel[i].empty;
-		header->channel[i].frequency = store->channel[i].frequency;
-		header->channel[i].num_samples = store->channel[i].num_samples;
-
-		/* allocate data if needed */
-		if (store->rawsize[i] > data->rawsize[i]
-		    || data->raw[i] == NULL)
-		    {
-		    if (data->raw[i] != NULL)
-			status = mb_freed(verbose,__FILE__, __LINE__, (void **) &(data->raw[i]), error);
-		    data->rawsize[i] = store->rawsize[i];
-		    status = mb_mallocd(verbose,__FILE__,__LINE__, data->rawsize[i], (void **)&(data->raw[i]),error);
-		    }
-
-		/* copy the data */
-		if (status == MB_SUCCESS)
-		    {
-		    for (j=0;j<data->rawsize[i];j++)
-			{
-			data->raw[i][j] = store->raw[i][j];
-			}
-		    }
-		}
-
-	    /* depths and sidescan */
-	    if (header->beams_bath > data->beams_bath_alloc
-		|| data->beamflag == NULL
-		|| data->bath == NULL
-		|| data->bathacrosstrack == NULL
-		|| data->bathalongtrack == NULL
-		|| data->tt == NULL
-		|| data->angle == NULL)
-		{
-		data->beams_bath_alloc = header->beams_bath;
-		if (data->beamflag != NULL)
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **) &(data->beamflag), error);
-		if (data->bath != NULL)
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **) &(data->bath), error);
-		if (data->bathacrosstrack != NULL)
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **) &(data->bathacrosstrack), error);
-		if (data->bathalongtrack != NULL)
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **) &(data->bathalongtrack), error);
-		if (data->tt != NULL)
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **) &(data->tt), error);
-		if (data->angle != NULL)
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **) &(data->angle), error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,data->beams_bath_alloc * sizeof(char),
-				    (void **)&(data->beamflag),error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,data->beams_bath_alloc * sizeof(float),
-				    (void **)&(data->bath),error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,data->beams_bath_alloc * sizeof(float),
-				    (void **)&(data->bathacrosstrack),error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,data->beams_bath_alloc * sizeof(float),
-				    (void **)&(data->bathalongtrack),error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,data->beams_bath_alloc * sizeof(float),
-				    (void **)&(data->tt),error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,data->beams_bath_alloc * sizeof(float),
-				    (void **)&(data->angle),error);
-		}
-	    if (header->beams_amp > data->beams_amp_alloc
-		|| data->amp == NULL)
-		{
-		data->beams_amp_alloc = header->beams_amp;
-		if (data->amp != NULL)
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **) &(data->amp), error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,data->beams_amp_alloc * sizeof(float),
-				    (void **)&(data->amp),error);
-		}
-	    if (header->pixels_ss > data->pixels_ss_alloc
-		|| data->ss == NULL
-		|| data->ssacrosstrack == NULL
-		|| data->ssalongtrack == NULL)
-		{
-		data->pixels_ss_alloc = header->pixels_ss;
-		if (data->ss != NULL)
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **) &(data->ss), error);
-		if (data->ssacrosstrack != NULL)
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **) &(data->ssacrosstrack), error);
-		if (data->ssalongtrack != NULL)
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **) &(data->ssalongtrack), error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,data->pixels_ss_alloc * sizeof(float),
-				    (void **)&(data->ss),error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,data->pixels_ss_alloc * sizeof(float),
-				    (void **)&(data->ssacrosstrack),error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,data->pixels_ss_alloc * sizeof(float),
-				    (void **)&(data->ssalongtrack),error);
-		}
-	    for (i=0;i<header->beams_bath;i++)
-		{
-		data->beamflag[i] = store->beamflag[i];
-		data->bath[i] = store->bath[i];
-		data->bathacrosstrack[i] = store->bathacrosstrack[i];
-		data->bathalongtrack[i] = store->bathalongtrack[i];
-		data->tt[i] = store->tt[i];
-		data->angle[i] = store->angle[i];
-		}
-	    for (i=0;i<header->beams_amp;i++)
-		{
-		data->amp[i] = store->amp[i];
-		}
-	    for (i=0;i<header->pixels_ss;i++)
-		{
-		data->ss[i] = store->ss[i];
-		data->ssacrosstrack[i] = store->ssacrosstrack[i];
-		data->ssalongtrack[i] = store->ssalongtrack[i];
-		}
-
-	    /* client */
-	    for (i=0;i<header->client_size;i++)
-		dataplus->client[i] = store->client[i];
-	    }
-
-	/* print debug statements */
-	if (verbose >= 5)
-	    {
-	    fprintf(stderr,"\ndbg5  New header set in function <%s>\n",function_name);
-	    fprintf(stderr,"dbg5       type:             %d\n",header->type);
-	    fprintf(stderr,"dbg5       proc_status:      %d\n",header->proc_status);
-	    fprintf(stderr,"dbg5       data_size:        %d\n",header->data_size);
-	    fprintf(stderr,"dbg5       client_size:      %d\n",header->client_size);
-	    fprintf(stderr,"dbg5       fish_status:      %d\n",header->fish_status);
-	    fprintf(stderr,"dbg5       nav_used:         %d\n",header->nav_used);
-	    fprintf(stderr,"dbg5       nav_type:         %d\n",header->nav_type);
-	    fprintf(stderr,"dbg5       utm_zone:         %d\n",header->utm_zone);
-	    fprintf(stderr,"dbg5       ship_x:           %f\n",header->ship_x);
-	    fprintf(stderr,"dbg5       ship_y:           %f\n",header->ship_y);
-	    fprintf(stderr,"dbg5       ship_course:      %f\n",header->ship_course);
-	    fprintf(stderr,"dbg5       ship_speed:       %f\n",header->ship_speed);
-	    fprintf(stderr,"dbg5       sec:              %d\n",header->sec);
-	    fprintf(stderr,"dbg5       usec:             %d\n",header->usec);
-	    fprintf(stderr,"dbg5       spare_gain:       %f\n",header->spare_gain);
-	    fprintf(stderr,"dbg5       fish_heading:     %f\n",header->fish_heading);
-	    fprintf(stderr,"dbg5       fish_depth:       %f\n",header->fish_depth);
-	    fprintf(stderr,"dbg5       fish_range:       %f\n",header->fish_range);
-	    fprintf(stderr,"dbg5       fish_pulse_width: %f\n",header->fish_pulse_width);
-	    fprintf(stderr,"dbg5       gain_c0:          %f\n",header->gain_c0);
-	    fprintf(stderr,"dbg5       gain_c1:          %f\n",header->gain_c1);
-	    fprintf(stderr,"dbg5       gain_c2:          %f\n",header->gain_c2);
-	    fprintf(stderr,"dbg5       fish_pitch:       %f\n",header->fish_pitch);
-	    fprintf(stderr,"dbg5       fish_roll:        %f\n",header->fish_roll);
-	    fprintf(stderr,"dbg5       fish_yaw:         %f\n",header->fish_yaw);
-	    fprintf(stderr,"dbg5       fish_x:           %f\n",header->fish_x);
-	    fprintf(stderr,"dbg5       fish_y:           %f\n",header->fish_y);
-	    fprintf(stderr,"dbg5       fish_layback:     %f\n",header->fish_layback);
-	    fprintf(stderr,"dbg5       fish_altitude:    %f\n",header->fish_altitude);
-	    fprintf(stderr,"dbg5       fish_altitude_samples: %d\n",header->fish_altitude_samples);
-	    fprintf(stderr,"dbg5       fish_ping_period: %f\n",header->fish_ping_period);
-	    fprintf(stderr,"dbg5       sound_velocity:   %f\n",header->sound_velocity);
-	    fprintf(stderr,"dbg5       num_chan:         %d\n",header->num_chan);
-	    fprintf(stderr,"dbg5       beams_bath:       %d\n",header->beams_bath);
-	    fprintf(stderr,"dbg5       beams_amp:        %d\n",header->beams_amp);
-	    fprintf(stderr,"dbg5       bath_chan_port:   %d\n",header->bath_chan_port);
-	    fprintf(stderr,"dbg5       bath_chan_stbd:   %d\n",header->bath_chan_stbd);
-	    fprintf(stderr,"dbg5       pixels_ss:        %d\n",header->pixels_ss);
-	    fprintf(stderr,"dbg5       ss_chan_port:     %d\n",header->ss_chan_port);
-	    fprintf(stderr,"dbg5       ss_chan_stbd:     %d\n",header->ss_chan_stbd);
-	    for (i=0;i<header->num_chan;i++)
-		{
-		fprintf(stderr,"dbg5       offset[%1d]:      %d\n",
-			     i, header->channel[i].offset);
-		fprintf(stderr,"dbg5       type[%1d]:        %d\n",
-			     i, header->channel[i].type);
-		fprintf(stderr,"dbg5       side[%1d]:        %d\n",
-			     i, header->channel[i].side);
-		fprintf(stderr,"dbg5       size[%1d]:        %d\n",
-			     i, header->channel[i].size);
-		fprintf(stderr,"dbg5       empty[%1d]:       %d\n",
-			     i, header->channel[i].empty);
-		fprintf(stderr,"dbg5       frequency[%1d]:   %d\n",
-			     i, header->channel[i].frequency);
-		fprintf(stderr,"dbg5       num_samples[%1d]: %d\n",
-			     i, header->channel[i].num_samples);
-		}
-	    fprintf(stderr,"dbg5       status:     %d\n",status);
-	    fprintf(stderr,"dbg5       error:      %d\n",*error);
-	    }
-
-	/* print debug messages */
-	if (verbose >= 5 && status == MB_SUCCESS)
-	    {
-	    for (i=0;i<header->num_chan;i++)
-		{
-		fprintf(stderr,"\ndbg5  New data set in function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       channel:   %d\n", i);
-		if (header->channel[i].type == OIC_TYPE_SIDESCAN)
-		    fprintf(stderr, "dbg5       data type: sidescan\n");
-		else if (header->channel[i].type == OIC_TYPE_ANGLE)
-		    fprintf(stderr, "dbg5       data type: angle\n");
-		else if (header->channel[i].type == OIC_TYPE_MULTIBEAM)
-		    fprintf(stderr, "dbg5       data type: multibeam\n");
-		else
-		    fprintf(stderr, "dbg5       data type: unknown\n");
-		if (header->channel[i].side == OIC_PORT)
-		    fprintf(stderr, "dbg5       side:      port\n");
-		else if (header->channel[i].side == OIC_STARBOARD)
-		    fprintf(stderr, "dbg5       side:      starboard\n");
-		else
-		    fprintf(stderr, "dbg5       side:      unknown\n");
-		fprintf(stderr,"dbg5       frequency:   %d\n", header->channel[i].frequency);
-		fprintf(stderr,"dbg5       num samples: %d\n", header->channel[i].num_samples);
-		if (header->channel[i].size == OIC_SIZE_CHAR)
-		    {
-		    fprintf(stderr, "dbg5       size:      char (1 byte)\n");
-		    char_ptr = (char *) data->raw[i];
-		    for (j=0;j<header->channel[i].num_samples;j++)
-			{
-			fprintf(stderr, "dbg5      %5d  %5d\n", j, char_ptr[j]);
-			}
-		    }
-		else if (header->channel[i].size == OIC_SIZE_SHORT)
-		    {
-		    fprintf(stderr, "dbg5       size:      short (2 bytes)\n");
-		    short_ptr = (short *) data->raw[i];
-		    for (j=0;j<header->channel[i].num_samples;j++)
-			{
-			fprintf(stderr, "dbg5      %5d  %5d\n", j, short_ptr[j]);
-			}
-		    }
-		else if (header->channel[i].size == OIC_SIZE_INT)
-		    {
-		    fprintf(stderr, "dbg5       size:      int (4 bytes)\n");
-		    int_ptr = (int *) data->raw[i];
-		    for (j=0;j<header->channel[i].num_samples;j++)
-			{
-			fprintf(stderr, "dbg5      %5d  %5d\n", j, int_ptr[j]);
-			}
-		    }
-		else if (header->channel[i].size == OIC_SIZE_FLOAT)
-		    {
-		    fprintf(stderr, "dbg5       size:      float (4 bytes)\n");
-		    float_ptr = (float *) data->raw[i];
-		    for (j=0;j<header->channel[i].num_samples;j++)
-			{
-			fprintf(stderr, "dbg5      %5d  %10f\n", j, float_ptr[j]);
-			}
-		    }
-		else if (header->channel[i].size == OIC_SIZE_3FLOAT)
-		    {
-		    fprintf(stderr, "dbg5       size:      3 floats (12 bytes)\n");
-		    float_ptr = (float *) data->raw[i];
-		    for (j=0;j<header->channel[i].num_samples;j++)
-			{
-			fprintf(stderr, "dbg5      %5d  %10f %10f %10f\n",
-				j, float_ptr[3*j], float_ptr[3*j+1], float_ptr[3*j+2]);
-			}
-		    }
-		else
-		    fprintf(stderr, "dbg5       size:      unknown\n");
-		}
-	    }
-
-	/* print debug statements */
-	if (verbose >= 5 && status == MB_SUCCESS)
-	    {
-	    fprintf(stderr,"\ndbg5  New processed data set in function <%s>\n",
-		    function_name);
-	    fprintf(stderr,"dbg5       beams_bath:       %d\n",header->beams_bath);
-	    fprintf(stderr,"dbg5       beam   bath  xtrack ltrack   tt   angle\n");
-	    for (i=0;i<header->beams_bath;i++)
-		{
-		fprintf(stderr,"dbg5       %4d %10f %10f %10f %10f %10f\n",
-			i, data->bath[i], data->bathacrosstrack[i],
-			data->bathalongtrack[i],
-			data->tt[i], data->angle[i]);
-		}
-	    fprintf(stderr,"dbg5       beams_amp:       %d\n",header->beams_amp);
-	    fprintf(stderr,"dbg5       beam   amp  xtrack ltrack\n");
-	    for (i=0;i<header->beams_amp;i++)
-		{
-		fprintf(stderr,"dbg5       %4d %10f %10f %10f\n",
-			i, data->amp[i], data->bathacrosstrack[i],
-			data->bathalongtrack[i]);
-		}
-	    fprintf(stderr,"dbg5       pixels_ss:       %d\n",header->pixels_ss);
-	    fprintf(stderr,"dbg5       beam   ss  xtrack ltrack\n");
-	    for (i=0;i<header->pixels_ss;i++)
-		{
-		fprintf(stderr,"dbg5       %4d %10f %10f %10f\n",
-			i, data->ss[i], data->ssacrosstrack[i],
-			data->ssalongtrack[i]);
-		}
-	    }
-
-	/* now reverse parse the header */
-	if (status == MB_SUCCESS)
-	    {
-	    index = 0;
-	    buffer[index] = 'G';
-	    index += 1;
-	    buffer[index] = 'E';
-	    index += 1;
-	    buffer[index] = '2';
-	    index += 1;
-	    buffer[index] = header->type;
-	    index += 1;
- 	    mb_put_binary_int(MB_NO,header->proc_status,&buffer[index]);
-	    index += 4;
-	    mb_put_binary_int(MB_NO,header->data_size,&buffer[index]);
-	    index += 4;
-	    buffer[index] = header->client_size; index += 1;
-	    buffer[index] = header->fish_status; index += 1;
-	    buffer[index] = header->nav_used; index += 1;
-	    buffer[index] = header->nav_type; index += 1;
- 	    mb_put_binary_int(MB_NO,header->utm_zone,&buffer[index]);
-	    index += 4;
- 	    mb_put_binary_float(MB_NO,header->ship_x,&buffer[index]);
-	    index += 4;
- 	    mb_put_binary_float(MB_NO,header->ship_y,&buffer[index]);
-	    index += 4;
- 	    mb_put_binary_float(MB_NO,header->ship_course,&buffer[index]);
-	    index += 4;
- 	    mb_put_binary_float(MB_NO,header->ship_speed,&buffer[index]);
-	    index += 4;
- 	    mb_put_binary_int(MB_NO,header->sec,&buffer[index]);
-	    index += 4;
- 	    mb_put_binary_int(MB_NO,header->usec,&buffer[index]);
-	    index += 4;
- 	    mb_put_binary_float(MB_NO,header->spare_gain,&buffer[index]);
-	    index += 4;
- 	    mb_put_binary_float(MB_NO,header->fish_heading,&buffer[index]);
-	    index += 4;
- 	    mb_put_binary_float(MB_NO,header->fish_depth,&buffer[index]);
-	    index += 4;
- 	    mb_put_binary_float(MB_NO,header->fish_range,&buffer[index]);
-	    index += 4;
- 	    mb_put_binary_float(MB_NO,header->fish_pulse_width,&buffer[index]);
-	    index += 4;
- 	    mb_put_binary_float(MB_NO,header->gain_c0,&buffer[index]);
-	    index += 4;
- 	    mb_put_binary_float(MB_NO,header->gain_c1,&buffer[index]);
-	    index += 4;
- 	    mb_put_binary_float(MB_NO,header->gain_c2,&buffer[index]);
-	    index += 4;
- 	    mb_put_binary_float(MB_NO,header->fish_pitch,&buffer[index]);
-	    index += 4;
- 	    mb_put_binary_float(MB_NO,header->fish_roll,&buffer[index]);
-	    index += 4;
- 	    mb_put_binary_float(MB_NO,header->fish_yaw,&buffer[index]);
-	    index += 4;
- 	    mb_put_binary_float(MB_NO,header->fish_x,&buffer[index]);
-	    index += 4;
- 	    mb_put_binary_float(MB_NO,header->fish_y,&buffer[index]);
-	    index += 4;
- 	    mb_put_binary_float(MB_NO,header->fish_layback,&buffer[index]);
-	    index += 4;
- 	    mb_put_binary_float(MB_NO,header->fish_altitude,&buffer[index]);
-	    index += 4;
- 	    mb_put_binary_int(MB_NO,header->fish_altitude_samples,&buffer[index]);
-	    index += 4;
- 	    mb_put_binary_float(MB_NO,header->fish_ping_period,&buffer[index]);
-	    index += 4;
- 	    mb_put_binary_float(MB_NO,header->sound_velocity,&buffer[index]);
-	    index += 4;
- 	    mb_put_binary_int(MB_NO,header->num_chan,&buffer[index]);
-	    index += 4;
-	    for (i=0;i<MBF_OICMBARI_MAX_CHANNELS;i++)
-		{
- 		mb_put_binary_int(MB_NO,header->channel[i].offset,&buffer[index]);
-		index += 4;
-		}
-	    for (i=0;i<MBF_OICMBARI_MAX_CHANNELS;i++)
-		{
-		buffer[index] = header->channel[i].type; index += 1;
-		buffer[index] = header->channel[i].side; index += 1;
-		buffer[index] = header->channel[i].size; index += 1;
-		buffer[index] = header->channel[i].empty; index += 1;
- 		mb_put_binary_int(MB_NO,header->channel[i].frequency,&buffer[index]);
-		index += 4;
- 		mb_put_binary_int(MB_NO,header->channel[i].num_samples,&buffer[index]);
-		index += 4;
-		}
- 	    mb_put_binary_int(MB_NO,header->beams_bath,&buffer[index]);
-	    index += 4;
- 	    mb_put_binary_int(MB_NO,header->beams_amp,&buffer[index]);
-	    index += 4;
- 	    mb_put_binary_int(MB_NO,header->bath_chan_port,&buffer[index]);
-	    index += 4;
- 	    mb_put_binary_int(MB_NO,header->bath_chan_stbd,&buffer[index]);
-	    index += 4;
- 	    mb_put_binary_int(MB_NO,header->pixels_ss,&buffer[index]);
-	    index += 4;
- 	    mb_put_binary_int(MB_NO,header->ss_chan_port,&buffer[index]);
-	    index += 4;
- 	    mb_put_binary_int(MB_NO,header->ss_chan_stbd,&buffer[index]);
-	    index += 4;
-	    }
-
-	/* write next header to file */
-	if ((write_size = fwrite(buffer,1,MBF_OICMBARI_HEADER_SIZE,
-			mb_io_ptr->mbfp)) == MBF_OICMBARI_HEADER_SIZE)
-		{
-		status = MB_SUCCESS;
-		*error = MB_ERROR_NO_ERROR;
-		}
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-
-	/* write client specific data */
-	if (status == MB_SUCCESS && header->client_size > 0)
-	    {
-	    if ((write_size = fwrite(dataplus->client,1,
-				(int)(header->client_size),mb_io_ptr->mbfp))
-		!= (int)(header->client_size))
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	    }
-
-	/* loop over each data channel and write data */
-	if (status == MB_SUCCESS && header->num_chan > 0)
-	    {
-	    for (i=0;i<header->num_chan;i++)
-		{
-		/* get size of data array */
-		if (header->channel[i].size == OIC_SIZE_CHAR)
-		    data_size = sizeof(char) * header->channel[i].num_samples;
-		else if (header->channel[i].size == OIC_SIZE_SHORT)
-		    data_size = sizeof(short) * header->channel[i].num_samples;
-		else if (header->channel[i].size == OIC_SIZE_INT)
-		    data_size = sizeof(int) * header->channel[i].num_samples;
-		else if (header->channel[i].size == OIC_SIZE_FLOAT)
-		    data_size = sizeof(float) * header->channel[i].num_samples;
-		else if (header->channel[i].size == OIC_SIZE_3FLOAT)
-		    data_size = 3 * sizeof(float) * header->channel[i].num_samples;
-
-		/* byte swap the data if necessary */
-#ifdef BYTESWAPPED
-		if (status == MB_SUCCESS)
-		    {
-		    if (header->channel[i].size == OIC_SIZE_SHORT)
-			{
-			short_ptr = (short *) data->raw[i];
-			for (j=0;j<header->channel[i].num_samples;j++)
-			    {
-			    short_ptr[j] = mb_swap_short(short_ptr[j]);
-			    }
-			}
-		    else if (header->channel[i].size == OIC_SIZE_INT)
-			{
-			int_ptr = (int *) data->raw[i];
-			for (j=0;j<header->channel[i].num_samples;j++)
-			    {
-			    int_ptr[j] = mb_swap_int(int_ptr[j]);
-			    }
-			}
-		    else if (header->channel[i].size == OIC_SIZE_FLOAT)
-			{
-			float_ptr = (float *) data->raw[i];
-			for (j=0;j<header->channel[i].num_samples;j++)
-			    {
-			    mb_swap_float(&float_ptr[j]);
-			    }
-			}
-		    else if (header->channel[i].size == OIC_SIZE_3FLOAT)
-			{
-			float_ptr = (float *) data->raw[i];
-			for (j=0;j<3*header->channel[i].num_samples;j++)
-			    {
-			    mb_swap_float(&float_ptr[j]);
-			    }
-			}
-		    }
-#endif
-
-		/* write the data */
-		if (status == MB_SUCCESS)
-		    {
-		    if ((write_size = fwrite(data->raw[i],1,data_size,mb_io_ptr->mbfp)) != data_size)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_WRITE_FAIL;
-			}
-		    }
-		}
-	    }
-
-	/* byte swap the processed data if necessary */
-#ifdef BYTESWAPPED
-	if (status == MB_SUCCESS)
-	    {
-	    for (j=0;j<header->beams_bath;j++)
-		{
-		mb_swap_float(&data->bath[j]);
-		mb_swap_float(&data->bathacrosstrack[j]);
-		mb_swap_float(&data->bathalongtrack[j]);
-		mb_swap_float(&data->tt[j]);
-		mb_swap_float(&data->angle[j]);
-		}
-	    for (j=0;j<header->beams_amp;j++)
-		{
-		mb_swap_float(&data->amp[j]);
-		}
-	    for (j=0;j<header->pixels_ss;j++)
-		{
-		mb_swap_float(&data->ssacrosstrack[j]);
-		mb_swap_float(&data->ssalongtrack[j]);
-		mb_swap_float(&data->ss[j]);
-		}
-	    }
-#endif
-
-	/* write processed bathymetry */
-	if (status == MB_SUCCESS
-	    && dataplus->kind == MB_DATA_DATA
-	    && header->beams_bath > 0)
-	    {
-	    /* get beamflag array */
-	    data_size = header->beams_bath * sizeof(char);
-	    if ((write_size = fwrite(data->beamflag,1,data_size,mb_io_ptr->mbfp)) != data_size)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	    /* get bath array */
-	    data_size = header->beams_bath * sizeof(float);
-	    if ((write_size = fwrite(data->bath,1,data_size,mb_io_ptr->mbfp)) != data_size)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	    /* get bathacrosstrack array */
-	    data_size = header->beams_bath * sizeof(float);
-	    if ((write_size = fwrite(data->bathacrosstrack,1,data_size,mb_io_ptr->mbfp)) != data_size)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	    /* get bathalongtrack array */
-	    data_size = header->beams_bath * sizeof(float);
-	    if ((write_size = fwrite(data->bathalongtrack,1,data_size,mb_io_ptr->mbfp)) != data_size)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	    /* get tt array */
-	    data_size = header->beams_bath * sizeof(float);
-	    if ((write_size = fwrite(data->tt,1,data_size,mb_io_ptr->mbfp)) != data_size)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	    /* get angle array */
-	    data_size = header->beams_bath * sizeof(float);
-	    if ((write_size = fwrite(data->angle,1,data_size,mb_io_ptr->mbfp)) != data_size)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-	    }
-
-	/* write processed amplitude */
-	if (status == MB_SUCCESS
-	    && dataplus->kind == MB_DATA_DATA
-	    && header->beams_amp > 0)
-	    {
-	    /* get amplitude array */
-	    data_size = header->beams_amp * sizeof(char);
-	    if ((write_size = fwrite(data->amp,1,data_size,mb_io_ptr->mbfp)) != data_size)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-	    }
-
-	/* write processed sidescan */
-	if (status == MB_SUCCESS
-	    && dataplus->kind == MB_DATA_DATA
-	    && header->pixels_ss > 0)
-	    {
-	    /* get ss array */
-	    data_size = header->pixels_ss * sizeof(float);
-	    if ((write_size = fwrite(data->ss,1,data_size,mb_io_ptr->mbfp)) != data_size)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	    /* get ssacrosstrack array */
-	    data_size = header->pixels_ss * sizeof(float);
-	    if ((write_size = fwrite(data->ssacrosstrack,1,data_size,mb_io_ptr->mbfp)) != data_size)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	    /* get ssalongtrack array */
-	    data_size = header->pixels_ss * sizeof(float);
-	    if ((write_size = fwrite(data->ssalongtrack,1,data_size,mb_io_ptr->mbfp)) != data_size)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-	    }
-
-	/* print output debug statements */
-	if (verbose >= 2)
-	    {
-	    fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-		    function_name);
-	    fprintf(stderr,"dbg2  Return values:\n");
-	    fprintf(stderr,"dbg2       error:      %d\n",*error);
-	    fprintf(stderr,"dbg2  Return status:\n");
-	    fprintf(stderr,"dbg2       status:  %d\n",status);
-	    }
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mbr_omghdcsj.c b/src/mbio/mbr_omghdcsj.c
deleted file mode 100644
index df37711..0000000
--- a/src/mbio/mbr_omghdcsj.c
+++ /dev/null
@@ -1,7943 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbr_omghdcsj.c	3/10/99
- *	$Id: mbr_omghdcsj.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1999-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbr_omghdcsj.c contains the functions for reading and writing
- * multibeam data in the MBF_OMGHDCSJ format.
- * These functions include:
- *   mbr_alm_omghdcsj	- allocate read/write memory
- *   mbr_dem_omghdcsj	- deallocate read/write memory
- *   mbr_rt_omghdcsj	- read and translate data
- *   mbr_wt_omghdcsj	- translate and write data
- *
- * Author:	D. W. Caress
- * Date:	March 10, 1999
- *
- * $Log: mbr_omghdcsj.c,v $
- * Revision 5.13  2008/09/20 00:57:41  caress
- * Release 5.1.1beta23
- *
- * Revision 5.12  2008/07/10 18:02:39  caress
- * Proceeding towards 5.1.1beta20.
- *
- * Revision 5.9  2008/03/14 18:33:03  caress
- * Updated support for JHC format 151.
- *
- * Revision 5.8  2006/08/09 22:41:27  caress
- * Fixed programs that read or write grids so that they do not use the GMT_begin() function; these programs will now work when GMT is built in the default fashion, when GMT is built in the default fashion, with "advisory file locking" enabled.
- *
- * Revision 5.7  2005/11/05 00:48:04  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.6  2003/05/20 18:05:32  caress
- * Added svp_source to data source parameters.
- *
- * Revision 5.5  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.4  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.3  2001/07/20 00:32:54  caress
- * Release 5.0.beta03
- *
- * Revision 5.2  2001/03/22  20:50:02  caress
- * Trying to make version 5.0.beta0
- *
- * Revision 5.1  2001/01/22  07:43:34  caress
- * Version 5.0.beta01
- *
- * Revision 5.0  2000/12/01  22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.5  2000/10/11  01:03:21  caress
- * Convert to ANSI C
- *
- * Revision 4.4  2000/09/30  06:34:20  caress
- * Snapshot for Dale.
- *
- * Revision 4.3  1999/08/08  04:16:03  caress
- * Added ELMK2XSE format.
- *
- * Revision 4.2  1999/04/21  05:45:32  caress
- * Fixed handling of bad beam index values.
- *
- * Revision 4.1  1999/04/20  06:43:57  caress
- * Fixed bug in sidescan handling.
- *
- * Revision 4.0  1999/03/31  18:29:20  caress
- * MB-System 4.6beta7
- *
- * Revision 1.1  1999/03/31  18:11:35  caress
- * Initial revision
- *
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mb_define.h"
-#include "mbsys_hdcs.h"
-#include "mbf_omghdcsj.h"
-
-/* include for byte swapping on little-endian machines */
-#ifdef BYTESWAPPED
-#include "mb_swap.h"
-#endif
-
-/* essential function prototypes */
-int mbr_register_omghdcsj(int verbose, void *mbio_ptr,
-		int *error);
-int mbr_info_omghdcsj(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_alm_omghdcsj(int verbose, void *mbio_ptr, int *error);
-int mbr_dem_omghdcsj(int verbose, void *mbio_ptr, int *error);
-int mbr_rt_omghdcsj(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_wt_omghdcsj(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-
-static char rcs_id[]="$Id: mbr_omghdcsj.c 2227 2015-02-05 21:12:31Z caress $";
-
-int profile_cnt = 0;
-
-/*--------------------------------------------------------------------*/
-int mbr_register_omghdcsj(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_register_omghdcsj";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* get mb_io_ptr */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set format info parameters */
-	status = mbr_info_omghdcsj(verbose,
-			&mb_io_ptr->system,
-			&mb_io_ptr->beams_bath_max,
-			&mb_io_ptr->beams_amp_max,
-			&mb_io_ptr->pixels_ss_max,
-			mb_io_ptr->format_name,
-			mb_io_ptr->system_name,
-			mb_io_ptr->format_description,
-			&mb_io_ptr->numfile,
-			&mb_io_ptr->filetype,
-			&mb_io_ptr->variable_beams,
-			&mb_io_ptr->traveltime,
-			&mb_io_ptr->beam_flagging,
-			&mb_io_ptr->nav_source,
-			&mb_io_ptr->heading_source,
-			&mb_io_ptr->vru_source,
-			&mb_io_ptr->svp_source,
-			&mb_io_ptr->beamwidth_xtrack,
-			&mb_io_ptr->beamwidth_ltrack,
-			error);
-
-	/* set format and system specific function pointers */
-	mb_io_ptr->mb_io_format_alloc = &mbr_alm_omghdcsj;
-	mb_io_ptr->mb_io_format_free = &mbr_dem_omghdcsj;
-	mb_io_ptr->mb_io_store_alloc = &mbsys_hdcs_alloc;
-	mb_io_ptr->mb_io_store_free = &mbsys_hdcs_deall;
-	mb_io_ptr->mb_io_read_ping = &mbr_rt_omghdcsj;
-	mb_io_ptr->mb_io_write_ping = &mbr_wt_omghdcsj;
-	mb_io_ptr->mb_io_dimensions = &mbsys_hdcs_dimensions;
-	mb_io_ptr->mb_io_extract = &mbsys_hdcs_extract;
-	mb_io_ptr->mb_io_insert = &mbsys_hdcs_insert;
-	mb_io_ptr->mb_io_extract_nav = &mbsys_hdcs_extract_nav;
-	mb_io_ptr->mb_io_insert_nav = &mbsys_hdcs_insert_nav;
-	mb_io_ptr->mb_io_extract_altitude = &mbsys_hdcs_extract_altitude;
-	mb_io_ptr->mb_io_insert_altitude = &mbsys_hdcs_insert_altitude;
-	mb_io_ptr->mb_io_extract_svp = NULL;
-	mb_io_ptr->mb_io_insert_svp = NULL;
-	mb_io_ptr->mb_io_ttimes = &mbsys_hdcs_ttimes;
-	mb_io_ptr->mb_io_detects = &mbsys_hdcs_detects;
-	mb_io_ptr->mb_io_copyrecord = &mbsys_hdcs_copy;
-	mb_io_ptr->mb_io_extract_rawss = NULL;
-	mb_io_ptr->mb_io_insert_rawss = NULL;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",mb_io_ptr->system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",mb_io_ptr->beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",mb_io_ptr->beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",mb_io_ptr->pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",mb_io_ptr->format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",mb_io_ptr->system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",mb_io_ptr->format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",mb_io_ptr->numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",mb_io_ptr->filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",mb_io_ptr->variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",mb_io_ptr->traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",mb_io_ptr->beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",mb_io_ptr->nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",mb_io_ptr->heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",mb_io_ptr->vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",mb_io_ptr->svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",mb_io_ptr->beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",mb_io_ptr->beamwidth_ltrack);
-		fprintf(stderr,"dbg2       format_alloc:       %p\n",(void *)mb_io_ptr->mb_io_format_alloc);
-		fprintf(stderr,"dbg2       format_free:        %p\n",(void *)mb_io_ptr->mb_io_format_free);
-		fprintf(stderr,"dbg2       store_alloc:        %p\n",(void *)mb_io_ptr->mb_io_store_alloc);
-		fprintf(stderr,"dbg2       store_free:         %p\n",(void *)mb_io_ptr->mb_io_store_free);
-		fprintf(stderr,"dbg2       read_ping:          %p\n",(void *)mb_io_ptr->mb_io_read_ping);
-		fprintf(stderr,"dbg2       write_ping:         %p\n",(void *)mb_io_ptr->mb_io_write_ping);
-		fprintf(stderr,"dbg2       extract:            %p\n",(void *)mb_io_ptr->mb_io_extract);
-		fprintf(stderr,"dbg2       insert:             %p\n",(void *)mb_io_ptr->mb_io_insert);
-		fprintf(stderr,"dbg2       extract_nav:        %p\n",(void *)mb_io_ptr->mb_io_extract_nav);
-		fprintf(stderr,"dbg2       insert_nav:         %p\n",(void *)mb_io_ptr->mb_io_insert_nav);
-		fprintf(stderr,"dbg2       extract_altitude:   %p\n",(void *)mb_io_ptr->mb_io_extract_altitude);
-		fprintf(stderr,"dbg2       insert_altitude:    %p\n",(void *)mb_io_ptr->mb_io_insert_altitude);
-		fprintf(stderr,"dbg2       extract_svp:        %p\n",(void *)mb_io_ptr->mb_io_extract_svp);
-		fprintf(stderr,"dbg2       insert_svp:         %p\n",(void *)mb_io_ptr->mb_io_insert_svp);
-		fprintf(stderr,"dbg2       ttimes:             %p\n",(void *)mb_io_ptr->mb_io_ttimes);
-		fprintf(stderr,"dbg2       detects:            %p\n",(void *)mb_io_ptr->mb_io_detects);
-		fprintf(stderr,"dbg2       extract_rawss:      %p\n",(void *)mb_io_ptr->mb_io_extract_rawss);
-		fprintf(stderr,"dbg2       insert_rawss:       %p\n",(void *)mb_io_ptr->mb_io_insert_rawss);
-		fprintf(stderr,"dbg2       copyrecord:         %p\n",(void *)mb_io_ptr->mb_io_copyrecord);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbr_info_omghdcsj(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error)
-{
-	char	*function_name = "mbr_info_omghdcsj";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* set format info parameters */
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-	*system = MB_SYS_HDCS;
-	*beams_bath_max = 1440;
-	*beams_amp_max = 1440;
-	*pixels_ss_max = 1024;
-	strncpy(format_name, "OMGHDCSJ", MB_NAME_LENGTH);
-	strncpy(system_name, "HDCS", MB_NAME_LENGTH);
-	strncpy(format_description, "Format name:          MBF_OMGHDCSJ\nInformal Description: UNB OMG HDCS format (the John Hughes Clarke format)\nAttributes:           variable beam bathymetry and\n                      amplitude, variable pixel sidescan, binary,\n		      UNB\n", MB_DESCRIPTION_LENGTH);
-	*numfile = -2;
-	*filetype = MB_FILETYPE_NORMAL;
-	*variable_beams = MB_YES;
-	*traveltime = MB_YES;
-	*beam_flagging = MB_YES;
-	*nav_source = MB_DATA_DATA;
-	*heading_source = MB_DATA_DATA;
-	*vru_source = MB_DATA_DATA;
-	*svp_source = MB_DATA_NONE;
-	*beamwidth_xtrack = 0.0;
-	*beamwidth_ltrack = 0.0;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",*system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",*beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",*beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",*pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",*numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",*filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",*variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",*traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",*beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",*nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",*heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",*vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",*svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",*beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",*beamwidth_ltrack);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_alm_omghdcsj(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_alm_omghdcsj";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_omghdcsj_struct *dataplus;
-	struct mbf_omghdcsj_summary_struct *summary;
-	struct mbf_omghdcsj_profile_struct *profile;
-	struct mbf_omghdcsj_data_struct *data;
-	int	*read_summary;
-	int	*fileVersion;
-	int	*toolType;
-	int	*profile_size;
-	int	*num_beam;
-	int	*beam_size;
-	int	*data_size;
-	int	*image_size;
-	double	*pixel_size;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set initial status */
-	status = MB_SUCCESS;
-
-	/* set name of possible parallel sidescan file */
-	if (strlen(mb_io_ptr->file) < 248)
-	    {
-	    strcpy(mb_io_ptr->file2, mb_io_ptr->file);
-	    strcat(mb_io_ptr->file2, ".ss_data");
-	    }
-
-
-	/* allocate memory for data structure */
-	mb_io_ptr->structure_size = sizeof(struct mbf_omghdcsj_struct);
-	status = mb_mallocd(verbose,__FILE__,__LINE__,mb_io_ptr->structure_size,
-				(void **)&mb_io_ptr->raw_data,error);
-
-	/* get pointers */
-	if (status == MB_SUCCESS)
-	    {
-	    dataplus = (struct mbf_omghdcsj_struct *) mb_io_ptr->raw_data;
-	    summary = &(dataplus->summary);
-	    profile = &(dataplus->profile);
-	    data = &(dataplus->data);
-	    read_summary = (int *) &mb_io_ptr->save1;
-	    fileVersion = (int *) &mb_io_ptr->save2;
-	    toolType = (int *) &mb_io_ptr->save3;
-	    profile_size = (int *) &mb_io_ptr->save4;
-	    num_beam = (int *) &mb_io_ptr->save5;
-	    beam_size = (int *) &mb_io_ptr->save6;
-	    data_size = (int *) &mb_io_ptr->save7;
-	    image_size = (int *) &mb_io_ptr->save8;
-	    pixel_size = (double *) &mb_io_ptr->saved1;
-	    dataplus->buffer = NULL;
-	    dataplus->kind = MB_DATA_NONE;
-	    status = mb_mallocd(verbose,__FILE__,__LINE__,
-			MBF_OMGHDCSJ_SUMMARY_SIZE+MBF_OMGHDCSJ_SUMMARY_V4EXTRA_SIZE,
-			(void **)&dataplus->buffer,error);
-
-	    /* initialize saved values */
-	    *read_summary = MB_NO;
-	    *fileVersion = 0;
-	    *toolType = MBSYS_HDCS_None;
-	    *profile_size = 0;
-	    *num_beam = 0;
-	    *beam_size = 0;
-	    *data_size = 0;
-	    *image_size = 0;
-	    *pixel_size = 0.0;
-
-	    /* initialize summary values */
-	    summary->sensorNumber = 1;
-	    summary->subFileID = 1;
-	    summary->fileVersion = 0;
-	    summary->toolType = MBSYS_HDCS_None;
-	    summary->numProfiles = 0;
-	    summary->numDepths = 0;
-	    summary->timeScale = 0;
-	    summary->refTime = 0;
-	    summary->minTime = 0;
-	    summary->maxTime = 0;
-	    summary->positionType = 0;
-	    summary->positionScale = 0;
-	    summary->refLat = 0;
-	    summary->minLat = 0;
-	    summary->maxLat = 0;
-	    summary->refLong = 0;
-	    summary->minLong = 0;
-	    summary->maxLong = 0;
-	    summary->minObsDepth = 0;
-	    summary->maxObsDepth = 0;
-	    summary->minProcDepth = 0;
-	    summary->maxProcDepth = 0;
-	    summary->status = 0;
-
-	    /* V4 */
-	    summary->totalProfileBytes = 0;
-	    for (i = 0; i< 20; i++)
-		summary->Profile_BitsDefining[i] = 0;
-	    summary->totalBeamBytes = 0;
-	    for (i = 0; i< 20; i++)
-		summary->Beam_BitsDefining[i] = 0;
-
-
-	    /* initialize profile */
-	    profile->status = 0;		/* status is either OK (0)
-						or no nav (1)
-						or unwanted for gridding (2) */
-	    profile->numDepths = 0;		/* Number of depths in profile        */
-	    profile->numSamples = 0;	/* Number of sidescan samples in parallel file        */
-	    profile->timeOffset = 0;	/* Time offset  wrt. header           */
-	    profile->vesselLatOffset = 0;	/* Latitude offset wrt. header        */
-	    profile->vesselLongOffset = 0;	/* Longitude offset wrt. header       */
-	    profile->vesselHeading = 0;	/* Heading (100 nRadians)             */
-	    profile->vesselHeave = 0;	/* Heave (mm)                         */
-	    profile->vesselPitch = 0;	/* Vessel pitch (100 nRadians)        */
-	    profile->vesselRoll = 0;	/* Vessel roll (100 nRadians)         */
-	    profile->tide = 0;		/* Tide (mm)                          */
-	    profile->vesselVelocity = 0;	/* Vessel Velocity (mm/s)
-						note - transducer pitch is
-						generally tucked into the vel field     */
-	    profile->power = 0;
-	    profile->TVG = 0;
-	    profile->attenuation = 0;
-	    profile->edflag = 0;
-	    profile->soundVelocity = 0; 	/* mm/s */
-	    profile->lengthImageDataField = 0;
-	    profile->pingNo = 0;
-	    profile->mode = 0;
-	    profile->Q_factor = 0;
-	    profile->pulseLength = 0;   /* centisecs*/
-	    profile->unassigned = 0;
-	    profile->td_sound_speed = 0;
-	    profile->samp_rate = 0;
-	    profile->z_res_cm = 0;
-	    profile->xy_res_cm = 0;
-	    profile->ssp_source = 0;
-	    profile->filter_ID = 0;
-	    profile->absorp_coeff = 0;
-	    profile->tx_pulse_len = 0;
-	    profile->tx_beam_width = 0;
-	    profile->max_swath_width = 0;
-	    profile->tx_power_reduction = 0;
-	    profile->rx_beam_width = 0;
-	    profile->rx_bandwidth = 0;
-	    profile->rx_gain_reduction = 0;
-	    profile->tvg_crossover = 0;
-	    profile->beam_spacing = 0;
-	    profile->coverage_sector = 0;
-	    profile->yaw_stab_mode = 0;
-
-	    /* V4 */
-	    profile->params[0].txBeamIndex = 0;
-	    profile->params[0].txLevel = 0;
-	    profile->params[0].txBeamAngle = 0;
-	    profile->params[0].txPulseLength = 0;
-	    profile->params[0].ss_offset = 0;
-	    profile->params[0].no_skipped_ss = 0;
-	    profile->params[0].no_acquired_ss = 0;
-	    profile->params[0].ss_sample_interval = 0;
-	    profile->params[0].bscatClass = 0;
-	    profile->params[0].nrActualGainSets = 0;
-	    profile->params[0].rxGup = 0;
-	    profile->params[0].rxGain = 0;
-	    profile->params[0].ar = 0;
-	    for (i = 0; i < 20; i++)
-	    	profile->params[0].rxtime[i] = 0;
-	    for (i = 0; i < 20; i++)
-	    	profile->params[0].rxgain[i] = 0;
-
-	    profile->params[1].txBeamIndex = 0;
-	    profile->params[1].txLevel = 0;
-	    profile->params[1].txBeamAngle = 0;
-	    profile->params[1].txPulseLength = 0;
-	    profile->params[1].ss_offset = 0;
-	    profile->params[1].no_skipped_ss = 0;
-	    profile->params[1].no_acquired_ss = 0;
-	    profile->params[1].ss_sample_interval = 0;
-	    profile->params[1].bscatClass = 0;
-	    profile->params[1].nrActualGainSets = 0;
-	    profile->params[1].rxGup = 0;
-	    profile->params[1].rxGain = 0;
-	    profile->params[1].ar = 0;
-	    for (i = 0; i < 20; i++)
-	    	profile->params[1].rxtime[i] = 0;
-	    for (i = 0; i < 20; i++)
-	    	profile->params[1].rxgain[i] = 0;
-
-	    profile->transducerDepth = 0;
-    	    profile->transducerPitch = 0;
-	    profile->transducerRoll = 0;
-    	    profile->transducerHeading = 0;
-	    profile->transducerLatOffset = 0;
-    	    profile->transducerLongOffset = 0;
-	    profile->transducerSlantRange = 0;
-    	    profile->transducerAcross = 0;
-	    profile->transducerAlong = 0;
-    	    profile->transducerBearing = 0;
-	    profile->longperiod_heaveCorrection = 0;
-    	    profile->dynamic_draftCorrection = 0;
-	    profile->deepdraftoffset_in_metres = 0;
-    	    profile->draft_at_Tx = 0;
-    	    profile->alternateRoll = 0;
-    	    profile->alternatePitch = 0;
-    	    profile->alternateHeave = 0;
-    	    profile->alternateHeading = 0;
-    	    profile->standaloneHeading = 0;
-    	    profile->RTK_at_RP = 0;
-    	    profile->Lowpass_RTK_at_RP = 0;
-    	    profile->WLZ = 0;
-    	    profile->samp_rate_SecondHead = 0;
-    	    profile->clock_drift_millis = 0;
-    	    profile->watercol_offset = 0;
-    	    profile->watercol_size = 0;
-   	    profile->watercol_offset_2nd = 0;
-   	    profile->watercol_size_2nd = 0;
-   	    profile->range_to_normal_incidence = 0;
-   	    profile->laser_timestampRef = 0;
-  	    profile->tx_sector_offset = 0;
-  	    profile->num_tx_sectors = 0;
-  	    profile->sonar_settings_offset = 0;
-  	    profile->ping_number = 0;
-  	    profile->multi_ping_sequence = 0;
-  	    profile->num_beams = 0;
-  	    profile->layer_compensation_flag = 0;
-  	    profile->bs_beam_position = 0.0;
-  	    profile->bs_control_flags = 0;
- 	    profile->bs_num_beams_per_side = 0;
- 	    profile->bs_current_beam_number = 0;
- 	    profile->bs_sample_descriptor = 0;
- 	    profile->snippet_sample_descriptor = 0;
-
-
-	    /* initialize data structure */
-	    data->beams = NULL;
-	    data->ss_raw = NULL;
-	    data->pixel_size = 0.0;
-	    data->pixels_ss = 0;
-	    for (i=0;i<MBF_OMGHDCSJ_MAX_PIXELS;i++)
-		{
-		data->ss_proc[i] = 0;
-		data->ssalongtrack[i] = 0;
-		}
-	    dataplus->comment[0] = 0;
-	    status = mbsys_hdcs_alloc(verbose,mbio_ptr,
-		    &mb_io_ptr->store_data,error);
-	    }
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_dem_omghdcsj(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_dem_omghdcsj";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_omghdcsj_struct *dataplus;
-	struct mbf_omghdcsj_profile_struct *profile;
-	struct mbf_omghdcsj_data_struct *data;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-	dataplus = (struct mbf_omghdcsj_struct *) mb_io_ptr->raw_data;
-	profile = &(dataplus->profile);
-	data = &(dataplus->data);
-
-	/* deallocate memory for data descriptor */
-	if (data->beams != NULL)
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&(data->beams),error);
-	if (data->ss_raw != NULL)
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&(data->ss_raw),error);
-	if (dataplus->buffer != NULL)
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&(dataplus->buffer),error);
-	status = mb_freed(verbose,__FILE__, __LINE__, (void **)&mb_io_ptr->raw_data,error);
-	status = mbsys_hdcs_deall(verbose,mbio_ptr,
-		&mb_io_ptr->store_data,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_rt_omghdcsj(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_rt_omghdcsj";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_omghdcsj_struct *dataplus;
-	struct mbf_omghdcsj_summary_struct *summary;
-	struct mbf_omghdcsj_profile_struct *profile;
-	struct mbf_omghdcsj_data_struct *data;
-	struct mbf_omghdcsj_beam_struct *beam;
-	struct mbsys_hdcs_struct *store;
-	struct mbsys_hdcs_beam_struct *sbeam;
-	int	*read_summary;
-	int	*fileVersion;
-	int	*toolType;
-	int	*profile_size;
-	int	*num_beam;
-	int	*beam_size;
-	int	*data_size;
-	int	*image_size;
-	char	*comment;
-	char	*buffer;
-	int	read_size;
-	int	buff_size;
-	short	*short_ptr;
-	int	*int_ptr;
-	float	*float_ptr;
-	mb_u_char   scaling_factor;
-	int	ScaleFactor;
-	int	offset, offset_start, sample_count;
-	int	nrawpixels, ssrawoffset, firstgoodbeam;
-	double	bathsort[MBF_OMGHDCSJ_MAX_BEAMS];
-	int	nbathsort;
-	double	*pixel_size, pixel_size_calc, swathwidth, xtrack, ss_spacing;
-	int	pixels_ss;
-	double	ss[MBF_OMGHDCSJ_MAX_PIXELS];
-	double	ss_alongtrack[MBF_OMGHDCSJ_MAX_PIXELS];
-	int	ss_cnt[MBF_OMGHDCSJ_MAX_PIXELS];
-	int	first, last, k1, k2;
-	int	i, j, k, jj;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-	    {
-	    fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-	    fprintf(stderr,"dbg2  Input arguments:\n");
-	    fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-	    fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-	    fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-	    }
-
-	/* get pointer to mbio descriptor and data structure */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-	store = (struct mbsys_hdcs_struct *) store_ptr;
-
-	/* get pointer to raw data structure */
-	dataplus = (struct mbf_omghdcsj_struct *) mb_io_ptr->raw_data;
-	summary = &(dataplus->summary);
-	profile = &(dataplus->profile);
-	data = &(dataplus->data);
-	comment = dataplus->comment;
-	buffer = dataplus->buffer;
-	read_summary = (int *) &mb_io_ptr->save1;
-	fileVersion = (int *) &mb_io_ptr->save2;
-	toolType = (int *) &mb_io_ptr->save3;
-	profile_size = (int *) &mb_io_ptr->save4;
-	num_beam = (int *) &mb_io_ptr->save5;
-	beam_size = (int *) &mb_io_ptr->save6;
-	data_size = (int *) &mb_io_ptr->save7;
-	image_size = (int *) &mb_io_ptr->save8;
-	pixel_size = (double *) &mb_io_ptr->saved1;
-
-	/* set file position */
-	mb_io_ptr->file_pos = mb_io_ptr->file_bytes;
-	mb_io_ptr->file2_pos = mb_io_ptr->file2_bytes;
-
-	/* read next four bytes */
-	if ((read_size = fread(buffer,1,
-	    4,mb_io_ptr->mbfp)) == 4)
-	    {
-	    mb_io_ptr->file_bytes += 4;
-	    if (buffer[0] == '#'
-		&& buffer[1] == '#'
-		&& buffer[2] == '#'
-		&& buffer[3] == '#')
-		{
-		dataplus->kind = MB_DATA_COMMENT;
-		}
-	    else if (buffer[0] == 'H'
-		&& buffer[1] == 'D'
-		&& buffer[2] == 'C'
-		&& buffer[3] == 'S')
-		{
-		dataplus->kind = MB_DATA_SUMMARY;
-		}
-	    else
-		{
-		dataplus->kind = MB_DATA_DATA;
-		}
-	    }
-	else
-	    {
-	    status = MB_FAILURE;
-	    *error = MB_ERROR_EOF;
-	    }
-
-	/* read summary */
-	if (status == MB_SUCCESS
-	    && dataplus->kind == MB_DATA_SUMMARY)
-	    {
-	    if ((read_size = fread(&buffer[4],1,
-		MBF_OMGHDCSJ_SUMMARY_SIZE-4,mb_io_ptr->mbfp))
-		!= MBF_OMGHDCSJ_SUMMARY_SIZE-4)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-	    /* parse the summary data */
-	    else
-		{
-		mb_io_ptr->file_bytes += read_size;
-		offset = 4;
-#ifdef BYTESWAPPED
-		int_ptr = (int *) &buffer[offset];
-		summary->sensorNumber = mb_swap_int(*int_ptr); offset +=4;
-		int_ptr = (int *) &buffer[offset];
-		summary->subFileID = mb_swap_int(*int_ptr); offset +=4;
-		int_ptr = (int *) &buffer[offset];
-		summary->fileVersion = mb_swap_int(*int_ptr); offset +=4;
-		int_ptr = (int *) &buffer[offset];
-		summary->toolType = mb_swap_int(*int_ptr); offset +=4;
-		int_ptr = (int *) &buffer[offset];
-		summary->numProfiles = mb_swap_int(*int_ptr); offset +=4;
-		int_ptr = (int *) &buffer[offset];
-		summary->numDepths = mb_swap_int(*int_ptr); offset +=4;
-		int_ptr = (int *) &buffer[offset];
-		summary->timeScale = mb_swap_int(*int_ptr); offset +=4;
-		int_ptr = (int *) &buffer[offset];
-		summary->refTime = mb_swap_int(*int_ptr); offset +=4;
-		int_ptr = (int *) &buffer[offset];
-		summary->minTime = mb_swap_int(*int_ptr); offset +=4;
-		int_ptr = (int *) &buffer[offset];
-		summary->maxTime = mb_swap_int(*int_ptr); offset +=4;
-		int_ptr = (int *) &buffer[offset];
-		summary->positionType = mb_swap_int(*int_ptr); offset +=4;
-		int_ptr = (int *) &buffer[offset];
-		summary->positionScale = mb_swap_int(*int_ptr); offset +=4;
-		int_ptr = (int *) &buffer[offset];
-		summary->refLat = mb_swap_int(*int_ptr); offset +=4;
-		int_ptr = (int *) &buffer[offset];
-		summary->minLat = mb_swap_int(*int_ptr); offset +=4;
-		int_ptr = (int *) &buffer[offset];
-		summary->maxLat = mb_swap_int(*int_ptr); offset +=4;
-		int_ptr = (int *) &buffer[offset];
-		summary->refLong = mb_swap_int(*int_ptr); offset +=4;
-		int_ptr = (int *) &buffer[offset];
-		summary->minLong = mb_swap_int(*int_ptr); offset +=4;
-		int_ptr = (int *) &buffer[offset];
-		summary->maxLong = mb_swap_int(*int_ptr); offset +=4;
-		int_ptr = (int *) &buffer[offset];
-		summary->minObsDepth = mb_swap_int(*int_ptr); offset +=4;
-		int_ptr = (int *) &buffer[offset];
-		summary->maxObsDepth = mb_swap_int(*int_ptr); offset +=4;
-		int_ptr = (int *) &buffer[offset];
-		summary->minProcDepth = mb_swap_int(*int_ptr); offset +=4;
-		int_ptr = (int *) &buffer[offset];
-		summary->maxProcDepth = mb_swap_int(*int_ptr); offset +=4;
-		int_ptr = (int *) &buffer[offset];
-		summary->status = *int_ptr;
-#else
-		int_ptr = (int *) &buffer[offset];
-		summary->sensorNumber = *int_ptr; offset +=4;
-		int_ptr = (int *) &buffer[offset];
-		summary->subFileID = *int_ptr; offset +=4;
-		int_ptr = (int *) &buffer[offset];
-		summary->fileVersion = *int_ptr; offset +=4;
-		int_ptr = (int *) &buffer[offset];
-		summary->toolType = *int_ptr; offset +=4;
-		int_ptr = (int *) &buffer[offset];
-		summary->numProfiles = *int_ptr; offset +=4;
-		int_ptr = (int *) &buffer[offset];
-		summary->numDepths = *int_ptr; offset +=4;
-		int_ptr = (int *) &buffer[offset];
-		summary->timeScale = *int_ptr; offset +=4;
-		int_ptr = (int *) &buffer[offset];
-		summary->refTime = *int_ptr; offset +=4;
-		int_ptr = (int *) &buffer[offset];
-		summary->minTime = *int_ptr; offset +=4;
-		int_ptr = (int *) &buffer[offset];
-		summary->maxTime = *int_ptr; offset +=4;
-		int_ptr = (int *) &buffer[offset];
-		summary->positionType = *int_ptr; offset +=4;
-		int_ptr = (int *) &buffer[offset];
-		summary->positionScale = *int_ptr; offset +=4;
-		int_ptr = (int *) &buffer[offset];
-		summary->refLat = *int_ptr; offset +=4;
-		int_ptr = (int *) &buffer[offset];
-		summary->minLat = *int_ptr; offset +=4;
-		int_ptr = (int *) &buffer[offset];
-		summary->maxLat = *int_ptr; offset +=4;
-		int_ptr = (int *) &buffer[offset];
-		summary->refLong = *int_ptr; offset +=4;
-		int_ptr = (int *) &buffer[offset];
-		summary->minLong = *int_ptr; offset +=4;
-		int_ptr = (int *) &buffer[offset];
-		summary->maxLong = *int_ptr; offset +=4;
-		int_ptr = (int *) &buffer[offset];
-		summary->minObsDepth = *int_ptr; offset +=4;
-		int_ptr = (int *) &buffer[offset];
-		summary->maxObsDepth = *int_ptr; offset +=4;
-		int_ptr = (int *) &buffer[offset];
-		summary->minProcDepth = *int_ptr; offset +=4;
-		int_ptr = (int *) &buffer[offset];
-		summary->maxProcDepth = *int_ptr; offset +=4;
-		int_ptr = (int *) &buffer[offset];
-		summary->status = *int_ptr;
-#endif
-		/* V4 */
-		if (summary->fileVersion == 4)
-		{
-			if ((read_size = fread(&buffer[MBF_OMGHDCSJ_SUMMARY_SIZE],1,
-				MBF_OMGHDCSJ_SUMMARY_V4EXTRA_SIZE, mb_io_ptr->mbfp))
-				!= MBF_OMGHDCSJ_SUMMARY_V4EXTRA_SIZE)
-			{
-				status = MB_FAILURE;
-				*error = MB_ERROR_EOF;
-			} else {
-			offset +=4;
-#ifdef BYTESWAPPED
-			int_ptr = (int *) &buffer[offset];
-			summary->totalProfileBytes = mb_swap_int(*int_ptr); offset +=4;
-			for (i = 0; i< 20; i++)
-			{
-				int_ptr = (int *) &buffer[offset];
-				summary->Profile_BitsDefining[i] = mb_swap_int(*int_ptr); offset +=4;
-			}
-			int_ptr = (int *) &buffer[offset];
-			summary->totalBeamBytes = mb_swap_int(*int_ptr); offset +=4;
-
-			for (i = 0; i< 20; i++)
-			{
-				/*
-				if (summary->Beam_BitsDefining[3])
-				{
-					summary->Beam_BitsDefining[3] &= ~(1 << 6);
-				}
-				*/
-				int_ptr = (int *) &buffer[offset];
-				summary->Beam_BitsDefining[i] = mb_swap_int(*int_ptr); offset +=4;
-			}
-#else
-			int_ptr = (int *) &buffer[offset];
-			summary->totalProfileBytes = *int_ptr; offset +=4;
-			for (i = 0; i< 20; i++)
-			{
-				int_ptr = (int *) &buffer[offset];
-				summary->Profile_BitsDefining[i] = *int_ptr; offset +=4;
-			}
-			int_ptr = (int *) &buffer[offset];
-			summary->totalBeamBytes = *int_ptr; offset +=4;
-			for (i = 0; i< 20; i++)
-			{
-				int_ptr = (int *) &buffer[offset];
-				summary->Beam_BitsDefining[i] = *int_ptr; offset +=4;
-			}
-
-#endif
-			}
-		}
-
-		/* set values to saved including data record sizes */
-		*read_summary = MB_YES;
-		*fileVersion = summary->fileVersion;
-		*toolType = summary->toolType;
-		if (*fileVersion == 1)
-		    {
-		    *profile_size = mbf_omghdcsj_tooldefs1[*toolType][MBF_OMGHDCSJ_PROFILE_LENGTH];
-		    *num_beam = mbf_omghdcsj_tooldefs1[*toolType][MBF_OMGHDCSJ_MAX_NO_BEAMS];
-		    *beam_size = mbf_omghdcsj_tooldefs1[*toolType][MBF_OMGHDCSJ_BEAM_LENGTH];
-		    *data_size = (*num_beam) * (*beam_size);
-		    *image_size = mbf_omghdcsj_tooldefs1[*toolType][MBF_OMGHDCSJ_IMAGE_LENGTH];
-		    }
-		else if (*fileVersion == 2)
-		    {
-		    *profile_size = mbf_omghdcsj_tooldefs2[*toolType][MBF_OMGHDCSJ_PROFILE_LENGTH];
-		    *num_beam = mbf_omghdcsj_tooldefs2[*toolType][MBF_OMGHDCSJ_MAX_NO_BEAMS];
-		    *beam_size = mbf_omghdcsj_tooldefs2[*toolType][MBF_OMGHDCSJ_BEAM_LENGTH];
-		    *data_size = (*num_beam) * (*beam_size);
-		    *image_size = mbf_omghdcsj_tooldefs2[*toolType][MBF_OMGHDCSJ_IMAGE_LENGTH];
-		    }
-		else if (*fileVersion == 3)
-		    {
-		    *profile_size = mbf_omghdcsj_tooldefs3[*toolType][MBF_OMGHDCSJ_PROFILE_LENGTH];
-		    *num_beam = mbf_omghdcsj_tooldefs3[*toolType][MBF_OMGHDCSJ_MAX_NO_BEAMS];
-		    *beam_size = mbf_omghdcsj_tooldefs3[*toolType][MBF_OMGHDCSJ_BEAM_LENGTH];
-		    *data_size = (*num_beam) * (*beam_size);
-		    *image_size = mbf_omghdcsj_tooldefs3[*toolType][MBF_OMGHDCSJ_IMAGE_LENGTH];
-		    }
-		else if (*fileVersion == 4)
-		    {
-		    *profile_size = summary->totalProfileBytes;
-		    *num_beam = summary->numDepths;
-		    *beam_size = summary->totalBeamBytes;
-		    *data_size = (*num_beam) * (*beam_size);
-		    *image_size = mbf_omghdcsj_tooldefs3[*toolType][MBF_OMGHDCSJ_IMAGE_LENGTH];
-		    }
-
-
-		/* allocate buffer at required size */
-		if (dataplus->buffer != NULL)
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&dataplus->buffer,error);
-		if (*fileVersion == 4)
-			/* buff_size = MAX(*profile_size, MBF_OMGHDCSJ_SUMMARY_SIZE+MBF_OMGHDCSJ_SUMMARY_V4EXTRA_SIZE);
-			*/
-			buff_size = *profile_size;
-		else
-			buff_size = MAX(*profile_size, MBF_OMGHDCSJ_SUMMARY_SIZE);
-		buff_size = MAX(buff_size, *image_size);
-		buff_size = MAX(buff_size, *data_size);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,buff_size, (void **)&dataplus->buffer,error);
-		if (status == MB_SUCCESS)
-		    {
-		    buffer = dataplus->buffer;
-		    if (data->beams != NULL)
-			status = mb_freed(verbose,__FILE__, __LINE__, (void **)&data->beams,error);
-		    if (status == MB_SUCCESS)
-			status = mb_mallocd(verbose,__FILE__,__LINE__,
-				    *num_beam * sizeof(struct mbf_omghdcsj_beam_struct),
-				    (void **)&data->beams,error);
-		    }
-		}
-	    }
-
-	/* or read comment */
-	else if (status == MB_SUCCESS
-	    && dataplus->kind == MB_DATA_COMMENT)
-	    {
-	    if ((read_size = fread(dataplus->comment,1,
-		MBF_OMGHDCSJ_MAX_COMMENT,mb_io_ptr->mbfp))
-		!= MBF_OMGHDCSJ_MAX_COMMENT)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-	    else
-		mb_io_ptr->file_bytes += read_size;
-	    }
-
-	/* or read data record */
-	else if (status == MB_SUCCESS
-	    && dataplus->kind == MB_DATA_DATA)
-	    {
-	    /* read profile */
-      if ((read_size = fread(&buffer[4],1,
-		*profile_size-4,mb_io_ptr->mbfp))
-		!= *profile_size-4)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-	    else
-		mb_io_ptr->file_bytes += read_size;
-
-	    /* now parse profile */
-	    if (status == MB_SUCCESS)
-		{
-		offset = 0;
-		if (*fileVersion == 1)
-		    {
-#ifdef BYTESWAPPED
-		    int_ptr = (int *) &buffer[offset];
-		    profile->status = mb_swap_int(*int_ptr); offset +=4;
-		    int_ptr = (int *) &buffer[offset];
-		    profile->numDepths = mb_swap_int(*int_ptr); offset +=4;
-		    int_ptr = (int *) &buffer[offset];
-		    profile->timeOffset = mb_swap_int(*int_ptr); offset +=4;
-		    int_ptr = (int *) &buffer[offset];
-		    profile->vesselLatOffset = mb_swap_int(*int_ptr); offset +=4;
-		    int_ptr = (int *) &buffer[offset];
-		    profile->vesselLongOffset = mb_swap_int(*int_ptr); offset +=4;
-		    int_ptr = (int *) &buffer[offset];
-		    profile->vesselHeading = mb_swap_int(*int_ptr); offset +=4;
-		    int_ptr = (int *) &buffer[offset];
-		    if (offset < *profile_size)
-			{
-			profile->vesselHeave = mb_swap_int(*int_ptr); offset +=4;
-			int_ptr = (int *) &buffer[offset];
-			profile->vesselPitch = mb_swap_int(*int_ptr); offset +=4;
-			int_ptr = (int *) &buffer[offset];
-			profile->vesselRoll = mb_swap_int(*int_ptr); offset +=4;
-			int_ptr = (int *) &buffer[offset];
-			profile->tide = mb_swap_int(*int_ptr); offset +=4;
-			int_ptr = (int *) &buffer[offset];
-			profile->vesselVelocity = mb_swap_int(*int_ptr); offset +=4;
-			}
-		    if (offset < *profile_size)
-			{
-			profile->power = buffer[offset]; offset +=1;
-			profile->TVG = buffer[offset]; offset +=1;
-			profile->attenuation = buffer[offset]; offset +=1;
-			profile->edflag = buffer[offset]; offset +=1;
-			int_ptr = (int *) &buffer[offset];
-			profile->soundVelocity = mb_swap_int(*int_ptr); offset +=4;
-			int_ptr = (int *) &buffer[offset];
-			profile->lengthImageDataField = mb_swap_int(*int_ptr); offset +=4;
-			int_ptr = (int *) &buffer[offset];
-			profile->pingNo = mb_swap_int(*int_ptr); offset +=4;
-			profile->mode = buffer[offset]; offset +=1;
-			profile->Q_factor = buffer[offset]; offset +=1;
-			profile->pulseLength = buffer[offset]; offset +=1;
-			profile->unassigned = buffer[offset]; offset +=1;
-			}
-#else
-		    int_ptr = (int *) &buffer[offset];
-		    profile->status = *int_ptr; offset +=4;
-		    int_ptr = (int *) &buffer[offset];
-		    profile->numDepths = *int_ptr; offset +=4;
-		    int_ptr = (int *) &buffer[offset];
-		    profile->timeOffset = *int_ptr; offset +=4;
-		    int_ptr = (int *) &buffer[offset];
-		    profile->vesselLatOffset = *int_ptr; offset +=4;
-		    int_ptr = (int *) &buffer[offset];
-		    profile->vesselLongOffset = *int_ptr; offset +=4;
-		    int_ptr = (int *) &buffer[offset];
-		    profile->vesselHeading = *int_ptr; offset +=4;
-		    if (offset < *profile_size)
-			{
-			int_ptr = (int *) &buffer[offset];
-			profile->vesselHeave = *int_ptr; offset +=4;
-			int_ptr = (int *) &buffer[offset];
-			profile->vesselPitch = *int_ptr; offset +=4;
-			int_ptr = (int *) &buffer[offset];
-			profile->vesselRoll = *int_ptr; offset +=4;
-			int_ptr = (int *) &buffer[offset];
-			profile->tide = *int_ptr; offset +=4;
-			int_ptr = (int *) &buffer[offset];
-			profile->vesselVelocity = *int_ptr; offset +=4;
-			}
-		    if (offset < *profile_size)
-			{
-			profile->power = buffer[offset]; offset +=1;
-			profile->TVG = buffer[offset]; offset +=1;
-			profile->attenuation = buffer[offset]; offset +=1;
-			profile->edflag = buffer[offset]; offset +=1;
-			int_ptr = (int *) &buffer[offset];
-			profile->soundVelocity = *int_ptr; offset +=4;
-			int_ptr = (int *) &buffer[offset];
-			profile->lengthImageDataField = *int_ptr; offset +=4;
-			int_ptr = (int *) &buffer[offset];
-			profile->pingNo = *int_ptr; offset +=4;
-			profile->mode = buffer[offset]; offset +=1;
-			profile->Q_factor = buffer[offset]; offset +=1;
-			profile->pulseLength = buffer[offset]; offset +=1;
-			profile->unassigned = buffer[offset]; offset +=1;
-			}
-#endif
-		    profile->numSamples = 0;
-		    profile->td_sound_speed = 0;
-		    profile->samp_rate = 0;
-		    profile->z_res_cm = 0;
-		    profile->xy_res_cm = 0;
-		    profile->ssp_source = 0;
-		    profile->filter_ID = 0;
-		    profile->absorp_coeff = 0;
-		    profile->tx_pulse_len = 0;
-		    profile->tx_beam_width = 0;
-		    profile->max_swath_width = 0;
-		    profile->tx_power_reduction = 0;
-		    profile->rx_beam_width = 0;
-		    profile->rx_bandwidth = 0;
-		    profile->rx_gain_reduction = 0;
-		    profile->tvg_crossover = 0;
-		    profile->beam_spacing = 0;
-		    profile->coverage_sector = 0;
-		    profile->yaw_stab_mode = 0;
-		    }
-		else if (*fileVersion == 2)
-		    {
-#ifdef BYTESWAPPED
-		    int_ptr = (int *) &buffer[offset];
-		    profile->timeOffset = mb_swap_int(*int_ptr); offset +=4;
-		    int_ptr = (int *) &buffer[offset];
-		    profile->vesselLatOffset = mb_swap_int(*int_ptr); offset +=4;
-		    int_ptr = (int *) &buffer[offset];
-		    profile->vesselLongOffset = mb_swap_int(*int_ptr); offset +=4;
-		    short_ptr = (short *) &buffer[offset];
-		    profile->vesselHeading = 10000 * ((short)mb_swap_short(*short_ptr)); offset +=2;
-		    short_ptr = (short *) &buffer[offset];
-		    profile->vesselHeave = (short)mb_swap_short(*short_ptr); offset +=2;
-		    short_ptr = (short *) &buffer[offset];
-		    profile->vesselPitch = 1000 * ((short)mb_swap_short(*short_ptr)); offset +=2;
-		    short_ptr = (short *) &buffer[offset];
-		    profile->vesselRoll = 1000 * ((short)mb_swap_short(*short_ptr)); offset +=2;
-		    short_ptr = (short *) &buffer[offset];
-		    profile->tide = (short)mb_swap_short(*short_ptr); offset +=2;
-		    short_ptr = (short *) &buffer[offset];
-		    profile->numDepths = (short)mb_swap_short(*short_ptr); offset +=2;
-		    profile->power = buffer[offset]; offset +=1;
-		    profile->TVG = buffer[offset]; offset +=1;
-		    profile->attenuation = buffer[offset]; offset +=1;
-		    profile->pulseLength = buffer[offset]; offset +=1;
-		    profile->mode = buffer[offset]; offset +=1;
-		    profile->status = buffer[offset]; offset +=1;
-		    profile->edflag = buffer[offset]; offset +=1;
-		    profile->unassigned = buffer[offset]; offset +=1;
-#else
-		    int_ptr = (int *) &buffer[offset];
-		    profile->timeOffset = *int_ptr; offset +=4;
-		    int_ptr = (int *) &buffer[offset];
-		    profile->vesselLatOffset = *int_ptr; offset +=4;
-		    int_ptr = (int *) &buffer[offset];
-		    profile->vesselLongOffset = *int_ptr; offset +=4;
-		    short_ptr = (short *) &buffer[offset];
-		    profile->vesselHeading = 10000 * (*short_ptr); offset +=2;
-		    short_ptr = (short *) &buffer[offset];
-		    profile->vesselHeave = *short_ptr; offset +=2;
-		    short_ptr = (short *) &buffer[offset];
-		    profile->vesselPitch = 1000 * (*short_ptr); offset +=2;
-		    short_ptr = (short *) &buffer[offset];
-		    profile->vesselRoll = 1000 * (*short_ptr); offset +=2;
-		    short_ptr = (short *) &buffer[offset];
-		    profile->tide = *short_ptr; offset +=2;
-		    short_ptr = (short *) &buffer[offset];
-		    profile->numDepths = *short_ptr; offset +=2;
-		    profile->power = buffer[offset]; offset +=1;
-		    profile->TVG = buffer[offset]; offset +=1;
-		    profile->attenuation = buffer[offset]; offset +=1;
-		    profile->pulseLength = buffer[offset]; offset +=1;
-		    profile->mode = buffer[offset]; offset +=1;
-		    profile->status = buffer[offset]; offset +=1;
-		    profile->edflag = buffer[offset]; offset +=1;
-		    profile->unassigned = buffer[offset]; offset +=1;
-#endif
-		    profile->numSamples = 0;
-		    profile->soundVelocity = 0;
-		    profile->lengthImageDataField = 0;
-		    profile->pingNo = 0;
-		    profile->Q_factor = 0;
-		    profile->td_sound_speed = 0;
-		    profile->samp_rate = 0;
-		    profile->z_res_cm = 0;
-		    profile->xy_res_cm = 0;
-		    profile->ssp_source = 0;
-		    profile->filter_ID = 0;
-		    profile->absorp_coeff = 0;
-		    profile->tx_pulse_len = 0;
-		    profile->tx_beam_width = 0;
-		    profile->max_swath_width = 0;
-		    profile->tx_power_reduction = 0;
-		    profile->rx_beam_width = 0;
-		    profile->rx_bandwidth = 0;
-		    profile->rx_gain_reduction = 0;
-		    profile->tvg_crossover = 0;
-		    profile->beam_spacing = 0;
-		    profile->coverage_sector = 0;
-		    profile->yaw_stab_mode = 0;
-		    }
-		else if (*fileVersion == 3)
-		    {
-#ifdef BYTESWAPPED
-		    int_ptr = (int *) &buffer[offset];
-		    profile->timeOffset = mb_swap_int(*int_ptr); offset +=4;
-		    int_ptr = (int *) &buffer[offset];
-		    profile->vesselLatOffset = mb_swap_int(*int_ptr); offset +=4;
-		    int_ptr = (int *) &buffer[offset];
-		    profile->vesselLongOffset = mb_swap_int(*int_ptr); offset +=4;
-		    short_ptr = (short *) &buffer[offset];
-		    profile->vesselHeading = 10000 * ((short)mb_swap_short(*short_ptr)); offset +=2;
-		    short_ptr = (short *) &buffer[offset];
-		    profile->vesselHeave = (short)mb_swap_short(*short_ptr); offset +=2;
-		    short_ptr = (short *) &buffer[offset];
-		    profile->vesselPitch = 1000 * ((short)mb_swap_short(*short_ptr)); offset +=2;
-		    short_ptr = (short *) &buffer[offset];
-		    profile->vesselRoll = 1000 * ((short)mb_swap_short(*short_ptr)); offset +=2;
-		    short_ptr = (short *) &buffer[offset];
-		    profile->tide = (short)mb_swap_short(*short_ptr); offset +=2;
-		    short_ptr = (short *) &buffer[offset];
-		    profile->numDepths = (short)mb_swap_short(*short_ptr); offset +=2;
-		    profile->power = buffer[offset]; offset +=1;
-		    profile->TVG = buffer[offset]; offset +=1;
-		    profile->attenuation = buffer[offset]; offset +=1;
-		    profile->pulseLength = buffer[offset]; offset +=1;
-		    profile->mode = buffer[offset]; offset +=1;
-		    profile->status = buffer[offset]; offset +=1;
-		    profile->edflag = buffer[offset]; offset +=1;
-		    profile->unassigned = buffer[offset]; offset +=1;
-		    if (offset < *profile_size)
-			{
-			short_ptr = (short *) &buffer[offset];
-			profile->td_sound_speed = (short)mb_swap_short(*short_ptr); offset +=2;
-			short_ptr = (short *) &buffer[offset];
-			profile->samp_rate = (short)mb_swap_short(*short_ptr); offset +=2;
-			profile->z_res_cm = buffer[offset]; offset +=1;
-			profile->xy_res_cm = buffer[offset]; offset +=1;
-			profile->ssp_source = buffer[offset]; offset +=1;
-			profile->filter_ID = buffer[offset]; offset +=1;
-			short_ptr = (short *) &buffer[offset];
-			profile->absorp_coeff = (short)mb_swap_short(*short_ptr); offset +=2;
-			short_ptr = (short *) &buffer[offset];
-			profile->tx_pulse_len = (short)mb_swap_short(*short_ptr); offset +=2;
-			short_ptr = (short *) &buffer[offset];
-			profile->tx_beam_width = (short)mb_swap_short(*short_ptr); offset +=2;
-			short_ptr = (short *) &buffer[offset];
-			profile->max_swath_width = (short)mb_swap_short(*short_ptr); offset +=2;
-			profile->tx_power_reduction = buffer[offset]; offset +=1;
-			profile->rx_beam_width = buffer[offset]; offset +=1;
-			profile->rx_bandwidth = buffer[offset]; offset +=1;
-			profile->rx_gain_reduction = buffer[offset]; offset +=1;
-			profile->tvg_crossover = buffer[offset]; offset +=1;
-			profile->beam_spacing = buffer[offset]; offset +=1;
-			profile->coverage_sector = buffer[offset]; offset +=1;
-			profile->yaw_stab_mode = buffer[offset]; offset +=1;
-			}
-#else
-		    int_ptr = (int *) &buffer[offset];
-		    profile->timeOffset = *int_ptr; offset +=4;
-		    int_ptr = (int *) &buffer[offset];
-		    profile->vesselLatOffset = *int_ptr; offset +=4;
-		    int_ptr = (int *) &buffer[offset];
-		    profile->vesselLongOffset = *int_ptr; offset +=4;
-		    short_ptr = (short *) &buffer[offset];
-		    profile->vesselHeading = 10000 * (*short_ptr); offset +=2;
-		    short_ptr = (short *) &buffer[offset];
-		    profile->vesselHeave = *short_ptr; offset +=2;
-		    short_ptr = (short *) &buffer[offset];
-		    profile->vesselPitch = 1000 * (*short_ptr); offset +=2;
-		    short_ptr = (short *) &buffer[offset];
-		    profile->vesselRoll = 1000 * (*short_ptr); offset +=2;
-		    short_ptr = (short *) &buffer[offset];
-		    profile->tide = *short_ptr; offset +=2;
-		    short_ptr = (short *) &buffer[offset];
-		    profile->numDepths = *short_ptr; offset +=2;
-		    profile->power = buffer[offset]; offset +=1;
-		    profile->TVG = buffer[offset]; offset +=1;
-		    profile->attenuation = buffer[offset]; offset +=1;
-		    profile->pulseLength = buffer[offset]; offset +=1;
-		    profile->mode = buffer[offset]; offset +=1;
-		    profile->status = buffer[offset]; offset +=1;
-		    profile->edflag = buffer[offset]; offset +=1;
-		    profile->unassigned = buffer[offset]; offset +=1;
-		    if (offset < *profile_size)
-			{
-			short_ptr = (short *) &buffer[offset];
-			profile->td_sound_speed = *short_ptr; offset +=2;
-			short_ptr = (short *) &buffer[offset];
-			profile->samp_rate = *short_ptr; offset +=2;
-			profile->z_res_cm = buffer[offset]; offset +=1;
-			profile->xy_res_cm = buffer[offset]; offset +=1;
-			profile->ssp_source = buffer[offset]; offset +=1;
-			profile->filter_ID = buffer[offset]; offset +=1;
-			short_ptr = (short *) &buffer[offset];
-			profile->absorp_coeff = *short_ptr; offset +=2;
-			short_ptr = (short *) &buffer[offset];
-			profile->tx_pulse_len = *short_ptr; offset +=2;
-			short_ptr = (short *) &buffer[offset];
-			profile->tx_beam_width = *short_ptr; offset +=2;
-			short_ptr = (short *) &buffer[offset];
-			profile->max_swath_width = *short_ptr; offset +=2;
-			profile->tx_power_reduction = buffer[offset]; offset +=1;
-			profile->rx_beam_width = buffer[offset]; offset +=1;
-			profile->rx_bandwidth = buffer[offset]; offset +=1;
-			profile->rx_gain_reduction = buffer[offset]; offset +=1;
-			profile->tvg_crossover = buffer[offset]; offset +=1;
-			profile->beam_spacing = buffer[offset]; offset +=1;
-			profile->coverage_sector = buffer[offset]; offset +=1;
-			profile->yaw_stab_mode = buffer[offset]; offset +=1;
-			}
-#endif
-		    profile->numSamples = 0;
-		    profile->soundVelocity = 0;
-		    profile->lengthImageDataField = 0;
-		    profile->pingNo = 0;
-		    profile->Q_factor = 0;
-
-		    }
-		    else if (*fileVersion == 4)
-		    {
-#ifdef BYTESWAPPED
-		    if (summary->Profile_BitsDefining[0])
-		    {
-			if (summary->Profile_BitsDefining[0] & PROF_ui_status)
-			{
-			     profile->status = buffer[offset]; offset+=1;
-			}
-			if (summary->Profile_BitsDefining[0] & PROF_ui_numDepths)
-			{
-			    short_ptr = (short *) &buffer[offset];
-			    profile->numDepths = (short)mb_swap_short(*short_ptr); offset +=2;
-			}
-			if (summary->Profile_BitsDefining[0] & PROF_ui_timeOffset)
-			{
-			    int_ptr = (int *) &buffer[offset];
-			    profile->timeOffset = mb_swap_int(*int_ptr); offset +=4;
-			}
-			if (summary->Profile_BitsDefining[0] & PROF_ui_vesselLatOffset)
-			{
-			    int_ptr = (int *) &buffer[offset];
-			    profile->vesselLatOffset = mb_swap_int(*int_ptr); offset +=4;
-			}
-			if (summary->Profile_BitsDefining[0] & PROF_ui_vesselLongOffset)
-			{
-			    int_ptr = (int *) &buffer[offset];
-			    profile->vesselLongOffset = mb_swap_int(*int_ptr); offset +=4;
-			}
-			if (summary->Profile_BitsDefining[0] & PROF_ui_vesselHeading)
-			{
-			    short_ptr = (short *) &buffer[offset];
-			    profile->vesselHeading = (int) ((short)mb_swap_short(*short_ptr)* 1000); offset +=2;
-			}
-			if (summary->Profile_BitsDefining[0] & PROF_si_vesselHeave)
-			{
-			    short_ptr = (short *) &buffer[offset];
-			    profile->vesselHeave = (short)mb_swap_short(*short_ptr); offset +=2;
-			}
-			if (summary->Profile_BitsDefining[0] & PROF_si_vesselPitch)
-			{
-			    short_ptr = (short *) &buffer[offset];
-			    profile->vesselPitch = (int) ((short)mb_swap_short(*short_ptr) * 1000); offset +=2;
-			}
-			if (summary->Profile_BitsDefining[0] & PROF_si_vesselRoll)
-			{
-			    short_ptr = (short *) &buffer[offset];
-			    profile->vesselRoll = (int) ((short)mb_swap_short(*short_ptr) * 1000); offset +=2;
-			}
-			if (summary->Profile_BitsDefining[0] & PROF_si_tide)
-			{
-			    int_ptr = (int *) &buffer[offset];
-			    profile->tide = mb_swap_int(*int_ptr); offset +=4;
-			}
-			if (summary->Profile_BitsDefining[0] & PROF_ui_vesselVelocity)
-			{
-			    int_ptr = (int *) &buffer[offset];
-			    profile->vesselVelocity = mb_swap_int(*int_ptr); offset +=4;
-			}
-		    }
-		    if (summary->Profile_BitsDefining[1])
-		    {
-		    if (summary->Profile_BitsDefining[1] & PROF_uc_power)
-		    {
-		    profile->power = buffer[offset]; offset +=1;
-		    }
-		    if (summary->Profile_BitsDefining[1] & PROF_uc_TVG)
-		    {
-		    profile->TVG = buffer[offset]; offset +=1;
-		    }
-		    if (summary->Profile_BitsDefining[1] & PROF_uc_attenuation)
-		    {
-		    profile->attenuation = buffer[offset]; offset +=1;
-		    }
-		    if (summary->Profile_BitsDefining[1] & PROF_uc_edflag)
-		    {
-		    profile->edflag = buffer[offset]; offset +=1;
-		    }
-		    if (summary->Profile_BitsDefining[1] & PROF_ui_soundVelocity)
-		    {
-		    short_ptr = (short *) &buffer[offset];
-		    profile->soundVelocity = (short)mb_swap_short(*short_ptr); offset +=2;
-		    }
-		    if (summary->Profile_BitsDefining[1] & PROF_ui_lengthImageDataField)
-		    {
-		    short_ptr = (short *) &buffer[offset];
-		    profile->lengthImageDataField = (short)mb_swap_short(*short_ptr); offset +=2;
-		    }
-		    if (summary->Profile_BitsDefining[1] & PROF_ui_pingNo)
-		    {
-		    short_ptr = (short *) &buffer[offset];
-		    profile->pingNo = (short)mb_swap_short(*short_ptr); offset +=2;
-		    }
-		    if (summary->Profile_BitsDefining[1] & PROF_uc_mode)
-		    {
-		    profile->mode = buffer[offset]; offset +=1;
-		    }
-		    if (summary->Profile_BitsDefining[1] & PROF_uc_Q_factor)
-		    {
-		    profile->Q_factor = buffer[offset]; offset +=1;
-		    }
-		    if (summary->Profile_BitsDefining[1] & PROF_uc_pulseLength)
-		    {
-		    profile->pulseLength = buffer[offset]; offset +=1;
-		    }
-		    if (summary->Profile_BitsDefining[1] & PROF_uc_unassigned)
-		    {
-		    profile->unassigned = buffer[offset]; offset +=1;
-		    }
-		    if (summary->Profile_BitsDefining[1] & PROF_us_td_sound_speed)
-		    {
-		    short_ptr = (short *) &buffer[offset];
-		    profile->td_sound_speed = (short)mb_swap_short(*short_ptr); offset +=2;
-		    }
-		    if (summary->Profile_BitsDefining[1] & PROF_us_samp_rate)
-		    {
-		    short_ptr = (short *) &buffer[offset];
-		    profile->samp_rate = (short)mb_swap_short(*short_ptr); offset +=2;
-		    }
-		    if (summary->Profile_BitsDefining[1] & PROF_uc_z_res_cm)
-		    {
-		    profile->z_res_cm = buffer[offset]; offset +=1;
-		    }
-		    if (summary->Profile_BitsDefining[1] & PROF_uc_xy_res_cm)
-		    {
-		    profile->xy_res_cm = buffer[offset]; offset +=1;
-		    }
-		    }
-
-		if (summary->Profile_BitsDefining[2])
-		{
-		    if (summary->Profile_BitsDefining[2] & PROF_uc_ssp_source)
-		    {
-		    profile->ssp_source = buffer[offset]; offset +=1;
-		    }
-		    if (summary->Profile_BitsDefining[2] & PROF_uc_filter_ID)
-		    {
-		    profile->filter_ID = buffer[offset]; offset +=1;
-		    }
-		    if (summary->Profile_BitsDefining[2] & PROF_us_absorp_coeff)
-		    {
-		    short_ptr = (short *) &buffer[offset];
-		    profile->absorp_coeff = (short)mb_swap_short(*short_ptr); offset +=2;
-		    }
-		    if (summary->Profile_BitsDefining[2] & PROF_us_tx_pulse_len)
-		    {
-		    short_ptr = (short *) &buffer[offset];
-		    profile->tx_pulse_len = (short)mb_swap_short(*short_ptr); offset +=2;
-		    }
-		    if (summary->Profile_BitsDefining[2] & PROF_us_tx_beam_width)
-		    {
-		    short_ptr = (short *) &buffer[offset];
-		    profile->tx_beam_width = (short)mb_swap_short(*short_ptr); offset +=2;
-		    }
-		    if (summary->Profile_BitsDefining[2] & PROF_us_max_swath_width)
-		    {
-		    short_ptr = (short *) &buffer[offset];
-		    profile->max_swath_width = (short)mb_swap_short(*short_ptr); offset +=2;
-		    }
-		    if (summary->Profile_BitsDefining[2] & PROF_uc_tx_power_reduction)
-		    {
-		    profile->tx_power_reduction = buffer[offset]; offset +=1;
-		    }
-		    if (summary->Profile_BitsDefining[2] & PROF_uc_rx_beam_width)
-		    {
-		    profile->rx_beam_width = buffer[offset]; offset +=1;
-		    }
-		    if (summary->Profile_BitsDefining[2] & PROF_uc_rx_bandwidth)
-		    {
-		    profile->rx_bandwidth = buffer[offset]; offset +=1;
-		    }
-		    if (summary->Profile_BitsDefining[2] & PROF_uc_rx_gain_reduction)
-		    {
-		    profile->rx_gain_reduction = buffer[offset]; offset +=1;
-		    }
-		    if (summary->Profile_BitsDefining[2] & PROF_uc_tvg_crossover)
-		    {
-		    profile->tvg_crossover = buffer[offset]; offset +=1;
-		    }
-		    if (summary->Profile_BitsDefining[2] & PROF_uc_beam_spacing)
-		    {
-		    profile->beam_spacing = buffer[offset]; offset +=1;
-		    }
-		    if (summary->Profile_BitsDefining[2] & PROF_uc_coverage_sector)
-		    {
-		    profile->coverage_sector = buffer[offset]; offset +=1;
-		    }
-		    if (summary->Profile_BitsDefining[2] & PROF_uc_yaw_stab_mode)
-		    {
-		    profile->yaw_stab_mode = buffer[offset]; offset +=1;
-		    }
-		 }
-
-		  if (summary->Profile_BitsDefining[3])
-		    {
-		      if (summary->Profile_BitsDefining[3] & PROF_ss_longperiod_heaveCorrection)
-			{
-			  short_ptr = (short *) &buffer[offset];
-			  profile->longperiod_heaveCorrection = (short)mb_swap_short(*short_ptr);
-			  offset += 2;
-			}
-		      if (summary->Profile_BitsDefining[3] & PROF_ss_dynamic_draftCorrection)
-			{
-			  short_ptr = (short *) &buffer[offset];
-			  profile->dynamic_draftCorrection = (short)mb_swap_short(*short_ptr);
-			  offset += 2;
-			}
-		      if (summary->Profile_BitsDefining[3] & PROF_ss_deepdraftoffset_in_metres)
-			{
-			  short_ptr = (short *) &buffer[offset];
-			  profile->deepdraftoffset_in_metres = (short)mb_swap_short(*short_ptr);
-			  offset += 2;
-			}
-		      if (summary->Profile_BitsDefining[3] & PROF_ss_draft_at_Tx)
-			{
-			  short_ptr = (short *) &buffer[offset];
-			  profile->draft_at_Tx = (short)mb_swap_short(*short_ptr);
-			  offset += 2;
-			}
-		      if (summary->Profile_BitsDefining[3] & PROF_ss_alternateRoll)
-			{
-			  short_ptr = (short *) &buffer[offset];
-			  profile->alternateRoll = (short)mb_swap_short(*short_ptr);
-			  offset += 2;
-			}
-		      if (summary->Profile_BitsDefining[3] & PROF_ss_alternatePitch)
-			{
-			  short_ptr = (short *) &buffer[offset];
-			  profile->alternatePitch = (short)mb_swap_short(*short_ptr);
-			  offset += 2;
-			}
-		      if (summary->Profile_BitsDefining[3] & PROF_ss_alternateHeave)
-			{
-			  short_ptr = (short *) &buffer[offset];
-			  profile->alternateHeave = (short)mb_swap_short(*short_ptr);
-			  offset += 2;
-			}
-		      if (summary->Profile_BitsDefining[3] & PROF_us_alternateHeading)
-			{
-			  short_ptr = (short *) &buffer[offset];
-			  profile->alternateHeading = (short)mb_swap_short(*short_ptr);
-			  offset += 2;
-			}
-		      if (summary->Profile_BitsDefining[3] & PROF_us_standaloneHeading)
-			{
-			  short_ptr = (short *) &buffer[offset];
-			  profile->standaloneHeading = (short)mb_swap_short(*short_ptr);
-			  offset += 2;
-			}
-		      if (summary->Profile_BitsDefining[3] & PROF_ss_RTK_at_RP)
-			{
-			  short_ptr = (short *) &buffer[offset];
-			  profile->RTK_at_RP = (short)mb_swap_short(*short_ptr);
-			  offset += 2;
-			}
-		      if (summary->Profile_BitsDefining[3] & PROF_ss_Lowpass_RTK_at_RP)
-			{
-			  short_ptr = (short *) &buffer[offset];
-			  profile->Lowpass_RTK_at_RP = (short)mb_swap_short(*short_ptr);
-			  offset += 2;
-			}
-		      if (summary->Profile_BitsDefining[3] & PROF_ss_WLZ)
-			{
-			  short_ptr = (short *) &buffer[offset];
-			  profile->WLZ = (short)mb_swap_short(*short_ptr);
-			  offset += 2;
-			}
-		      if (summary->Profile_BitsDefining[3] & PROF_us_samp_rate_SecondHead)
-			{
-			  short_ptr = (short *) &buffer[offset];
-			  profile->samp_rate_SecondHead = (short)mb_swap_short(*short_ptr);
-			  offset += 2;
-			}
-		      if (summary->Profile_BitsDefining[3] & PROF_si_clock_drift_millis)
-			{
-			  int_ptr = (int *) &buffer[offset];
-			  profile->clock_drift_millis = (int)mb_swap_int(*int_ptr);
-			  offset += 4;
-			}
-		      if (summary->Profile_BitsDefining[3] & PROF_ui_watercol_offset)
-			{
-			  int_ptr = (int *) &buffer[offset];
-			  profile->watercol_offset = (int)mb_swap_int(*int_ptr);
-			  offset += 4;
-			}
-		      if (summary->Profile_BitsDefining[3] & PROF_ui_watercol_size)
-			{
-			  int_ptr = (int *) &buffer[offset];
-			  profile->watercol_size = (int)mb_swap_int(*int_ptr);
-			  offset += 4;
-			}
-		      if (summary->Profile_BitsDefining[3] & PROF_ui_watercol_offset_2nd)
-			{
-			  int_ptr = (int *) &buffer[offset];
-			  profile->watercol_offset_2nd = (int)mb_swap_int(*int_ptr);
-			  offset += 4;
-			}
-		      if (summary->Profile_BitsDefining[3] & PROF_ui_watercol_size_2nd)
-			{
-			  int_ptr = (int *) &buffer[offset];
-			  profile->watercol_size_2nd = (int)mb_swap_int(*int_ptr);
-			  offset += 4;
-			}
-		      if (summary->Profile_BitsDefining[3] &
-			  PROF_us_range_to_normal_incidence)
-			{
-			  short_ptr = (short *) &buffer[offset];
-			  profile->range_to_normal_incidence = (short)mb_swap_short(*short_ptr);
-			  offset += 2;
-			}
-		      if (summary->Profile_BitsDefining[3] & PROF_ui_laser_timestampRef)
-			{
-			  int_ptr = (int *) &buffer[offset];
-			  profile->laser_timestampRef = (int)mb_swap_int(*int_ptr);
-			  offset += 4;
-			}
-		      if (summary->Profile_BitsDefining[3] & PROF_ui_tx_sector_offset)
-			{
-			  int_ptr = (int *) &buffer[offset];
-			  profile->tx_sector_offset = (int)mb_swap_int(*int_ptr);
-			  offset += 4;
-			}
-		      if (summary->Profile_BitsDefining[3] & PROF_us_num_tx_sectors)
-			{
-			  short_ptr = (short *) &buffer[offset];
-			  profile->num_tx_sectors = (short)mb_swap_short(*short_ptr);
-			  offset += 2;
-			}
-		    }
-
-		  if (summary->Profile_BitsDefining[4])
-		    {
-		      if (summary->Profile_BitsDefining[4] & PROF_st_params_PORT)
-			{
-
-			  if (summary->Profile_BitsDefining[4] & PROF_us_txBeamIndex)
-			    {
-			      short_ptr = (short *) &buffer[offset];
-			      profile->params[0].txBeamIndex = (short)mb_swap_short(*short_ptr);
-			      offset += 2;
-			    }
-			  if (summary->Profile_BitsDefining[4] & PROF_us_txLevel)
-			    {
-			      short_ptr = (short *) &buffer[offset];
-			      profile->params[0].txLevel = (short)mb_swap_short(*short_ptr);
-			      offset += 2;
-			    }
-			  if (summary->Profile_BitsDefining[4] & PROF_ss_txBeamAngle)
-			    {
-			      short_ptr = (short *) &buffer[offset];
-			      profile->params[0].txBeamAngle = (short)mb_swap_short(*short_ptr);
-			      offset += 2;
-			    }
-			  if (summary->Profile_BitsDefining[4] & PROF_us_txPulseLength)
-			    {
-			      short_ptr = (short *) &buffer[offset];
-			      profile->params[0].txPulseLength = (short)mb_swap_short(*short_ptr);
-			      offset += 2;
-			    }
-			  if (summary->Profile_BitsDefining[4] & PROF_ui_ss_offset)
-			    {
-			      int_ptr = (int *) &buffer[offset];
-			      profile->params[0].ss_offset = (int)mb_swap_int(*int_ptr);
-			      offset += 4;
-			    }
-			  if (summary->Profile_BitsDefining[4] & PROF_us_no_skipped_ss)
-			    {
-			      short_ptr = (short *) &buffer[offset];
-			      profile->params[0].no_skipped_ss = (short)mb_swap_short(*short_ptr);
-			      offset += 2;
-			    }
-			  if (summary->Profile_BitsDefining[4] & PROF_us_no_acquired_ss)
-			    {
-			      short_ptr = (short *) &buffer[offset];
-			      profile->params[0].no_acquired_ss = (short)mb_swap_short(*short_ptr);
-			      offset += 2;
-			    }
-			  if (summary->Profile_BitsDefining[4] & PROF_us_ss_sample_interval)
-			    {
-			      short_ptr = (short *) &buffer[offset];
-			      profile->params[0].ss_sample_interval = (short)mb_swap_short(*short_ptr);
-			      offset += 2;
-			    }
-			  if (summary->Profile_BitsDefining[4] & PROF_us_bscatClass)
-			    {
-			      short_ptr = (short *) &buffer[offset];
-			      profile->params[0].bscatClass = (short)mb_swap_short(*short_ptr);
-			      offset += 2;
-			    }
-			  if (summary->Profile_BitsDefining[4] & PROF_us_nrActualGainSets)
-			    {
-			      short_ptr = (short *) &buffer[offset];
-			      profile->params[0].nrActualGainSets = (short)mb_swap_short(*short_ptr);
-			      offset += 2;
-			    }
-			  if (summary->Profile_BitsDefining[4] & PROF_ss_rxGup)
-			    {
-			      short_ptr = (short *) &buffer[offset];
-			      profile->params[0].rxGup = (short)mb_swap_short(*short_ptr);
-			      offset += 2;
-			    }
-			  if (summary->Profile_BitsDefining[4] & PROF_ss_rxGain)
-			    {
-			      short_ptr = (short *) &buffer[offset];
-			      profile->params[0].rxGain = (short)mb_swap_short(*short_ptr);
-			      offset += 2;
-			    }
-			  if (summary->Profile_BitsDefining[4] & PROF_ss_ar)
-			    {
-			      short_ptr = (short *) &buffer[offset];
-			      profile->params[0].ar = (short)mb_swap_short(*short_ptr);
-			      offset += 2;
-			    }
-			  /* hard wired, that if present, there are 20 of them irrespective */
-			  if (summary->Profile_BitsDefining[4] & PROF_us_rxtimeARRAY)
-			    {
-			      for (i = 0; i < 20; i++)
-				{
-				  short_ptr = (short *) &buffer[offset];
-				  profile->params[0].rxtime[i] = (short)mb_swap_short(*short_ptr);
-				  offset += 2;
-				}
-			    }
-			  if (summary->Profile_BitsDefining[4] & PROF_ss_rxgainARRAY)
-			    {
-			      for (i = 0; i < 20; i++)
-				{
-				  short_ptr = (short *) &buffer[offset];
-				  profile->params[0].rxgain[i] = (short)mb_swap_short(*short_ptr);
-				  offset += 2;
-				}
-			    }
-			} /* if port is present */
-
-		      if (summary->Profile_BitsDefining[4] & PROF_st_params_STBD)
-			{
-
-			  if (summary->Profile_BitsDefining[4] & PROF_us_txBeamIndex)
-			    {
-			      short_ptr = (short *) &buffer[offset];
-			      profile->params[1].txBeamIndex = (short)mb_swap_short(*short_ptr);
-			      offset += 2;
-			    }
-			  if (summary->Profile_BitsDefining[4] & PROF_us_txLevel)
-			    {
-			      short_ptr = (short *) &buffer[offset];
-			      profile->params[1].txLevel = (short)mb_swap_short(*short_ptr);
-			      offset += 2;
-			    }
-			  if (summary->Profile_BitsDefining[4] & PROF_ss_txBeamAngle)
-			    {
-			      short_ptr = (short *) &buffer[offset];
-			      profile->params[1].txBeamAngle = (short)mb_swap_short(*short_ptr);
-			      offset += 2;
-			    }
-			  if (summary->Profile_BitsDefining[4] & PROF_us_txPulseLength)
-			    {
-			      short_ptr = (short *) &buffer[offset];
-			      profile->params[1].txPulseLength = (short)mb_swap_short(*short_ptr);
-			      offset += 2;
-			    }
-			  if (summary->Profile_BitsDefining[4] & PROF_ui_ss_offset)
-			    {
-			      int_ptr = (int *) &buffer[offset];
-			      profile->params[1].ss_offset = (int)mb_swap_int(*int_ptr);
-			      offset += 4;
-			    }
-			  if (summary->Profile_BitsDefining[4] & PROF_us_no_skipped_ss)
-			    {
-			      short_ptr = (short *) &buffer[offset];
-			      profile->params[1].no_skipped_ss = (short)mb_swap_short(*short_ptr);
-			      offset += 2;
-			    }
-			  if (summary->Profile_BitsDefining[4] & PROF_us_no_acquired_ss)
-			    {
-			      short_ptr = (short *) &buffer[offset];
-			      profile->params[1].no_acquired_ss = (short)mb_swap_short(*short_ptr);
-			      offset += 2;
-			    }
-			  if (summary->Profile_BitsDefining[4] & PROF_us_ss_sample_interval)
-			    {
-			      short_ptr = (short *) &buffer[offset];
-			      profile->params[1].ss_sample_interval = (short)mb_swap_short(*short_ptr);
-			      offset += 2;
-			    }
-			  if (summary->Profile_BitsDefining[4] & PROF_us_bscatClass)
-			    {
-			      short_ptr = (short *) &buffer[offset];
-			      profile->params[1].bscatClass = (short)mb_swap_short(*short_ptr);
-			      offset += 2;
-			    }
-			  if (summary->Profile_BitsDefining[4] & PROF_us_nrActualGainSets)
-			    {
-			      short_ptr = (short *) &buffer[offset];
-			      profile->params[1].nrActualGainSets = (short)mb_swap_short(*short_ptr);
-			      offset += 2;
-			    }
-			  if (summary->Profile_BitsDefining[4] & PROF_ss_rxGup)
-			    {
-			      short_ptr = (short *) &buffer[offset];
-			      profile->params[1].rxGup = (short)mb_swap_short(*short_ptr);
-			      offset += 2;
-			    }
-			  if (summary->Profile_BitsDefining[4] & PROF_ss_rxGain)
-			    {
-			      short_ptr = (short *) &buffer[offset];
-			      profile->params[1].rxGain = (short)mb_swap_short(*short_ptr);
-			      offset += 2;
-			    }
-			  if (summary->Profile_BitsDefining[4] & PROF_ss_ar)
-			    {
-			      short_ptr = (short *) &buffer[offset];
-			      profile->params[1].ar = (short)mb_swap_short(*short_ptr);
-			      offset += 2;
-			    }
-			  /* hard wired, that if present, there are 20 of them irrespective */
-			  if (summary->Profile_BitsDefining[4] & PROF_us_rxtimeARRAY)
-			    {
-			      for (i = 0; i < 20; i++)
-				{
-				  short_ptr = (short *) &buffer[offset];
-				  profile->params[1].rxtime[i] = (short)mb_swap_short(*short_ptr);
-				  offset += 2;
-				}
-			    }
-			  if (summary->Profile_BitsDefining[4] & PROF_ss_rxgainARRAY)
-			    {
-			      for (i = 0; i < 20; i++)
-				{
-				  short_ptr = (short *) &buffer[offset];
-				  profile->params[1].rxgain[i] = (short)mb_swap_short(*short_ptr);
-				  offset += 2;
-				}
-			    }
-
-			} /* if stbd is present */
-		    }
-
-		  if (summary->Profile_BitsDefining[5])
-		    {
-		      if (summary->Profile_BitsDefining[5] & PROF_si_transducerDepth)
-			{
-			  int_ptr = (int *) &buffer[offset];
-			  profile->transducerDepth = (int)mb_swap_int(*int_ptr);
-			  offset += 4;
-			}
-		      if (summary->Profile_BitsDefining[5] & PROF_si_transducerPitch)
-			{
-			  int_ptr = (int *) &buffer[offset];
-			  profile->transducerDepth = (int)mb_swap_int(*int_ptr);
-			  offset += 4;
-			}
-		      if (summary->Profile_BitsDefining[5] & PROF_si_transducerRoll)
-			{
-			  int_ptr = (int *) &buffer[offset];
-			  profile->transducerDepth = (int)mb_swap_int(*int_ptr);
-			  offset += 4;
-			}
-		      if (summary->Profile_BitsDefining[5] & PROF_ui_transducerHeading)
-			{
-			  int_ptr = (int *) &buffer[offset];
-			  profile->transducerDepth = (int)mb_swap_int(*int_ptr);
-			  offset += 4;
-			}
-		      if (summary->Profile_BitsDefining[5] & PROF_si_transducerLatOffset)
-			{
-			  int_ptr = (int *) &buffer[offset];
-			  profile->transducerDepth = (int)mb_swap_int(*int_ptr);
-			  offset += 4;
-			}
-		      if (summary->Profile_BitsDefining[5] & PROF_si_transducerLongOffset)
-			{
-			  int_ptr = (int *) &buffer[offset];
-			  profile->transducerDepth = (int)mb_swap_int(*int_ptr);
-			  offset += 4;
-			}
-		      if (summary->Profile_BitsDefining[5] & PROF_ui_transducerSlantRange)
-			{
-			  int_ptr = (int *) &buffer[offset];
-			  profile->transducerDepth = (int)mb_swap_int(*int_ptr);
-			  offset += 4;
-			}
-		      if (summary->Profile_BitsDefining[5] & PROF_si_transducerAcross)
-			{
-			  int_ptr = (int *) &buffer[offset];
-			  profile->transducerDepth = (int)mb_swap_int(*int_ptr);
-			  offset += 4;
-			}
-		      if (summary->Profile_BitsDefining[5] & PROF_si_transducerAlong)
-			{
-			  int_ptr = (int *) &buffer[offset];
-			  profile->transducerDepth = (int)mb_swap_int(*int_ptr);
-			  offset += 4;
-			}
-		      if (summary->Profile_BitsDefining[5] & PROF_ui_transducerBearing)
-			{
-			  int_ptr = (int *) &buffer[offset];
-			  profile->transducerDepth = (int)mb_swap_int(*int_ptr);
-			  offset += 4;
-			}
-		    }
-
-		  if (summary->Profile_BitsDefining[6])
-		    {
-		      if (summary->Profile_BitsDefining[6] & PROF_ui_sonar_settings_offset)
-			{
-			  int_ptr = (int *) &buffer[offset];
-			  profile->sonar_settings_offset = (int)mb_swap_int(*int_ptr);
-			  offset += 4;
-			}
-		      if (summary->Profile_BitsDefining[6] & PROF_ui_ping_number)
-			{
-			  int_ptr = (int *) &buffer[offset];
-			  profile->ping_number = (int)mb_swap_int(*int_ptr);
-			  offset += 4;
-			}
-		      if (summary->Profile_BitsDefining[6] & PROF_us_multi_ping_sequence)
-			{
-			  short_ptr = (short *) &buffer[offset];
-			  profile->multi_ping_sequence = (short)mb_swap_short(*short_ptr);
-			  offset += 2;
-			}
-		      if (summary->Profile_BitsDefining[6] & PROF_ui_num_beams)
-			{
-			  int_ptr = (int *) &buffer[offset];
-			  profile->num_beams = (int)mb_swap_int(*int_ptr);
-			  offset += 4;
-			}
-		      if (summary->Profile_BitsDefining[6] & PROF_uc_layer_compensation_flag)
-			{
-			  profile->layer_compensation_flag = buffer[offset];
-			  offset += 1;
-			}
-		      if (summary->Profile_BitsDefining[6] & PROF_f_bs_beam_position)
-			{
-			  float_ptr = (float *) &buffer[offset];
-			  mb_swap_float(float_ptr);
-			  profile->bs_beam_position = *float_ptr;
-			  offset += 4;
-			}
-		      if (summary->Profile_BitsDefining[6] & PROF_ui_bs_control_flags)
-			{
-			  int_ptr = (int *) &buffer[offset];
-			  profile->bs_control_flags = (int)mb_swap_int(*int_ptr);
-			  offset += 4;
-			}
-		      if (summary->Profile_BitsDefining[6] & PROF_us_bs_num_beams_per_side)
-			{
-			  short_ptr = (short *) &buffer[offset];
-			  profile->bs_num_beams_per_side = (short)mb_swap_short(*short_ptr);
-			  offset += 2;
-			}
-		      if (summary->Profile_BitsDefining[6] & PROF_us_bs_current_beam_number)
-			{
-			  short_ptr = (short *) &buffer[offset];
-			  profile->bs_current_beam_number = (short)mb_swap_short(*short_ptr);
-			  offset += 2;
-			}
-		      if (summary->Profile_BitsDefining[6] & PROF_uc_bs_sample_descriptor)
-			{
-			  profile->bs_sample_descriptor = buffer[offset];
-			  offset += 1;
-			}
-		      if (summary->Profile_BitsDefining[6] & PROF_ui_snippet_sample_descriptor)
-			{
-			  int_ptr = (int *) &buffer[offset];
-			  profile->snippet_sample_descriptor = (int)mb_swap_int(*int_ptr);
-			  offset += 4;
-			}
-		    }
-
-#else
-
-		    if (summary->Profile_BitsDefining[0])
-		    {
-			if (summary->Profile_BitsDefining[0] & PROF_ui_status)
-			{
-			     profile->status = buffer[offset]; offset+=1;
-			}
-			if (summary->Profile_BitsDefining[0] & PROF_ui_numDepths)
-			{
-			    short_ptr = (short *) &buffer[offset];
-			    profile->numDepths = *short_ptr; offset +=2;
-			}
-			if (summary->Profile_BitsDefining[0] & PROF_ui_timeOffset)
-			{
-			    int_ptr = (int *) &buffer[offset];
-			    profile->timeOffset = *int_ptr; offset +=4;
-			}
-			if (summary->Profile_BitsDefining[0] & PROF_ui_vesselLatOffset)
-			{
-			    int_ptr = (int *) &buffer[offset];
-			    profile->vesselLatOffset = *int_ptr; offset +=4;
-			}
-			if (summary->Profile_BitsDefining[0] & PROF_ui_vesselLongOffset)
-			{
-			    int_ptr = (int *) &buffer[offset];
-			    profile->vesselLongOffset = *int_ptr; offset +=4;
-			}
-			if (summary->Profile_BitsDefining[0] & PROF_ui_vesselHeading)
-			{
-			    short_ptr = (short *) &buffer[offset];
-			    profile->vesselHeading = (int) (*short_ptr* 1000); offset +=2;
-			}
-			if (summary->Profile_BitsDefining[0] & PROF_si_vesselHeave)
-			{
-			    short_ptr = (short *) &buffer[offset];
-			    profile->vesselHeave = *short_ptr; offset +=2;
-			}
-			if (summary->Profile_BitsDefining[0] & PROF_si_vesselPitch)
-			{
-			    short_ptr = (short *) &buffer[offset];
-			    profile->vesselPitch = (int) (*short_ptr * 1000); offset +=2;
-			}
-			if (summary->Profile_BitsDefining[0] & PROF_si_vesselRoll)
-			{
-			    short_ptr = (short *) &buffer[offset];
-			    profile->vesselRoll = (int) (*short_ptr * 1000); offset +=2;
-			}
-			if (summary->Profile_BitsDefining[0] & PROF_si_tide)
-			{
-			    int_ptr = (int *) &buffer[offset];
-			    profile->tide = *int_ptr; offset +=4;
-			}
-			if (summary->Profile_BitsDefining[0] & PROF_ui_vesselVelocity)
-			{
-			    int_ptr = (int *) &buffer[offset];
-			    profile->vesselVelocity = *int_ptr; offset +=4;
-			}
-		    }
-		    if (summary->Profile_BitsDefining[1])
-		    {
-		    if (summary->Profile_BitsDefining[1] & PROF_uc_power)
-		    {
-		    profile->power = buffer[offset]; offset +=1;
-		    }
-		    if (summary->Profile_BitsDefining[1] & PROF_uc_TVG)
-		    {
-		    profile->TVG = buffer[offset]; offset +=1;
-		    }
-		    if (summary->Profile_BitsDefining[1] & PROF_uc_attenuation)
-		    {
-		    profile->attenuation = buffer[offset]; offset +=1;
-		    }
-		    if (summary->Profile_BitsDefining[1] & PROF_uc_edflag)
-		    {
-		    profile->edflag = buffer[offset]; offset +=1;
-		    }
-		    if (summary->Profile_BitsDefining[1] & PROF_ui_soundVelocity)
-		    {
-		    short_ptr = (short *) &buffer[offset];
-		    profile->soundVelocity = *short_ptr; offset +=2;
-		    }
-		    if (summary->Profile_BitsDefining[1] & PROF_ui_lengthImageDataField)
-		    {
-		    short_ptr = (short *) &buffer[offset];
-		    profile->lengthImageDataField = *short_ptr; offset +=2;
-		    }
-		    if (summary->Profile_BitsDefining[1] & PROF_ui_pingNo)
-		    {
-		    short_ptr = (short *) &buffer[offset];
-		    profile->pingNo = *short_ptr; offset +=2;
-		    }
-		    if (summary->Profile_BitsDefining[1] & PROF_uc_mode)
-		    {
-		    profile->mode = buffer[offset]; offset +=1;
-		    }
-		    if (summary->Profile_BitsDefining[1] & PROF_uc_Q_factor)
-		    {
-		    profile->Q_factor = buffer[offset]; offset +=1;
-		    }
-		    if (summary->Profile_BitsDefining[1] & PROF_uc_pulseLength)
-		    {
-		    profile->pulseLength = buffer[offset]; offset +=1;
-		    }
-		    if (summary->Profile_BitsDefining[1] & PROF_uc_unassigned)
-		    {
-		    profile->unassigned = buffer[offset]; offset +=1;
-		    }
-		    if (summary->Profile_BitsDefining[1] & PROF_us_td_sound_speed)
-		    {
-		    short_ptr = (short *) &buffer[offset];
-		    profile->td_sound_speed = *short_ptr; offset +=2;
-		    }
-		    if (summary->Profile_BitsDefining[1] & PROF_us_samp_rate)
-		    {
-		    short_ptr = (short *) &buffer[offset];
-		    profile->samp_rate = *short_ptr; offset +=2;
-		    }
-		    if (summary->Profile_BitsDefining[1] & PROF_uc_z_res_cm)
-		    {
-		    profile->z_res_cm = buffer[offset]; offset +=1;
-		    }
-		    if (summary->Profile_BitsDefining[1] & PROF_uc_xy_res_cm)
-		    {
-		    profile->xy_res_cm = buffer[offset]; offset +=1;
-		    }
-		    }
-
-		if (summary->Profile_BitsDefining[2])
-		{
-		    if (summary->Profile_BitsDefining[2] & PROF_uc_ssp_source)
-		    {
-		    profile->ssp_source = buffer[offset]; offset +=1;
-		    }
-		    if (summary->Profile_BitsDefining[2] & PROF_uc_filter_ID)
-		    {
-		    profile->filter_ID = buffer[offset]; offset +=1;
-		    }
-		    if (summary->Profile_BitsDefining[2] & PROF_us_absorp_coeff)
-		    {
-		    short_ptr = (short *) &buffer[offset];
-		    profile->absorp_coeff = *short_ptr; offset +=2;
-		    }
-		    if (summary->Profile_BitsDefining[2] & PROF_us_tx_pulse_len)
-		    {
-		    short_ptr = (short *) &buffer[offset];
-		    profile->tx_pulse_len = *short_ptr; offset +=2;
-		    }
-		    if (summary->Profile_BitsDefining[2] & PROF_us_tx_beam_width)
-		    {
-		    short_ptr = (short *) &buffer[offset];
-		    profile->tx_beam_width = *short_ptr; offset +=2;
-		    }
-		    if (summary->Profile_BitsDefining[2] & PROF_us_max_swath_width)
-		    {
-		    short_ptr = (short *) &buffer[offset];
-		    profile->max_swath_width = *short_ptr; offset +=2;
-		    }
-		    if (summary->Profile_BitsDefining[2] & PROF_uc_tx_power_reduction)
-		    {
-		    profile->tx_power_reduction = buffer[offset]; offset +=1;
-		    }
-		    if (summary->Profile_BitsDefining[2] & PROF_uc_rx_beam_width)
-		    {
-		    profile->rx_beam_width = buffer[offset]; offset +=1;
-		    }
-		    if (summary->Profile_BitsDefining[2] & PROF_uc_rx_bandwidth)
-		    {
-		    profile->rx_bandwidth = buffer[offset]; offset +=1;
-		    }
-		    if (summary->Profile_BitsDefining[2] & PROF_uc_rx_gain_reduction)
-		    {
-		    profile->rx_gain_reduction = buffer[offset]; offset +=1;
-		    }
-		    if (summary->Profile_BitsDefining[2] & PROF_uc_tvg_crossover)
-		    {
-		    profile->tvg_crossover = buffer[offset]; offset +=1;
-		    }
-		    if (summary->Profile_BitsDefining[2] & PROF_uc_beam_spacing)
-		    {
-		    profile->beam_spacing = buffer[offset]; offset +=1;
-		    }
-		    if (summary->Profile_BitsDefining[2] & PROF_uc_coverage_sector)
-		    {
-		    profile->coverage_sector = buffer[offset]; offset +=1;
-		    }
-		    if (summary->Profile_BitsDefining[2] & PROF_uc_yaw_stab_mode)
-		    {
-		    profile->yaw_stab_mode = buffer[offset]; offset +=1;
-		    }
-		 }
-
-		  if (summary->Profile_BitsDefining[3])
-		    {
-		      if (summary->Profile_BitsDefining[3] & PROF_ss_longperiod_heaveCorrection)
-			{
-			  short_ptr = (short *) &buffer[offset];
-			  profile->longperiod_heaveCorrection = *short_ptr;
-			  offset += 2;
-			}
-		      if (summary->Profile_BitsDefining[3] & PROF_ss_dynamic_draftCorrection)
-			{
-			  short_ptr = (short *) &buffer[offset];
-			  profile->dynamic_draftCorrection = *short_ptr;
-			  offset += 2;
-			}
-		      if (summary->Profile_BitsDefining[3] & PROF_ss_deepdraftoffset_in_metres)
-			{
-			  short_ptr = (short *) &buffer[offset];
-			  profile->deepdraftoffset_in_metres = *short_ptr;
-			  offset += 2;
-			}
-		      if (summary->Profile_BitsDefining[3] & PROF_ss_draft_at_Tx)
-			{
-			  short_ptr = (short *) &buffer[offset];
-			  profile->draft_at_Tx = *short_ptr;
-			  offset += 2;
-			}
-		      if (summary->Profile_BitsDefining[3] & PROF_ss_alternateRoll)
-			{
-			  short_ptr = (short *) &buffer[offset];
-			  profile->alternateRoll = *short_ptr;
-			  offset += 2;
-			}
-		      if (summary->Profile_BitsDefining[3] & PROF_ss_alternatePitch)
-			{
-			  short_ptr = (short *) &buffer[offset];
-			  profile->alternatePitch = *short_ptr;
-			  offset += 2;
-			}
-		      if (summary->Profile_BitsDefining[3] & PROF_ss_alternateHeave)
-			{
-			  short_ptr = (short *) &buffer[offset];
-			  profile->alternateHeave = *short_ptr;
-			  offset += 2;
-			}
-		      if (summary->Profile_BitsDefining[3] & PROF_us_alternateHeading)
-			{
-			  short_ptr = (short *) &buffer[offset];
-			  profile->alternateHeading = *short_ptr;
-			  offset += 2;
-			}
-		      if (summary->Profile_BitsDefining[3] & PROF_us_standaloneHeading)
-			{
-			  short_ptr = (short *) &buffer[offset];
-			  profile->standaloneHeading = *short_ptr;
-			  offset += 2;
-			}
-		      if (summary->Profile_BitsDefining[3] & PROF_ss_RTK_at_RP)
-			{
-			  short_ptr = (short *) &buffer[offset];
-			  profile->RTK_at_RP = *short_ptr;
-			  offset += 2;
-			}
-		      if (summary->Profile_BitsDefining[3] & PROF_ss_Lowpass_RTK_at_RP)
-			{
-			  short_ptr = (short *) &buffer[offset];
-			  profile->Lowpass_RTK_at_RP = *short_ptr;
-			  offset += 2;
-			}
-		      if (summary->Profile_BitsDefining[3] & PROF_ss_WLZ)
-			{
-			  short_ptr = (short *) &buffer[offset];
-			  profile->WLZ = *short_ptr;
-			  offset += 2;
-			}
-		      if (summary->Profile_BitsDefining[3] & PROF_us_samp_rate_SecondHead)
-			{
-			  short_ptr = (short *) &buffer[offset];
-			  profile->samp_rate_SecondHead = *short_ptr;
-			  offset += 2;
-			}
-		      if (summary->Profile_BitsDefining[3] & PROF_si_clock_drift_millis)
-			{
-			  int_ptr = (int *) &buffer[offset];
-			  profile->clock_drift_millis = *int_ptr;
-			  offset += 4;
-			}
-		      if (summary->Profile_BitsDefining[3] & PROF_ui_watercol_offset)
-			{
-			  int_ptr = (int *) &buffer[offset];
-			  profile->watercol_offset = *int_ptr;
-			  offset += 4;
-			}
-		      if (summary->Profile_BitsDefining[3] & PROF_ui_watercol_size)
-			{
-			  int_ptr = (int *) &buffer[offset];
-			  profile->watercol_size = *int_ptr;
-			  offset += 4;
-			}
-		      if (summary->Profile_BitsDefining[3] & PROF_ui_watercol_offset_2nd)
-			{
-			  int_ptr = (int *) &buffer[offset];
-			  profile->watercol_offset_2nd = *int_ptr;
-			  offset += 4;
-			}
-		      if (summary->Profile_BitsDefining[3] & PROF_ui_watercol_size_2nd)
-			{
-			  int_ptr = (int *) &buffer[offset];
-			  profile->watercol_size_2nd = *int_ptr;
-			  offset += 4;
-			}
-		      if (summary->Profile_BitsDefining[3] &
-			  PROF_us_range_to_normal_incidence)
-			{
-			  short_ptr = (short *) &buffer[offset];
-			  profile->range_to_normal_incidence = *short_ptr;
-			  offset += 2;
-			}
-		      if (summary->Profile_BitsDefining[3] & PROF_ui_laser_timestampRef)
-			{
-			  int_ptr = (int *) &buffer[offset];
-			  profile->laser_timestampRef = *int_ptr;
-			  offset += 4;
-			}
-		      if (summary->Profile_BitsDefining[3] & PROF_ui_tx_sector_offset)
-			{
-			  int_ptr = (int *) &buffer[offset];
-			  profile->tx_sector_offset = *int_ptr;
-			  offset += 4;
-			}
-		      if (summary->Profile_BitsDefining[3] & PROF_us_num_tx_sectors)
-			{
-			  short_ptr = (short *) &buffer[offset];
-			  profile->num_tx_sectors = *short_ptr;
-			  offset += 2;
-			}
-		    }
-
-		  if (summary->Profile_BitsDefining[4])
-		    {
-		      if (summary->Profile_BitsDefining[4] & PROF_st_params_PORT)
-			{
-
-			  if (summary->Profile_BitsDefining[4] & PROF_us_txBeamIndex)
-			    {
-			      short_ptr = (short *) &buffer[offset];
-			      profile->params[0].txBeamIndex = *short_ptr;
-			      offset += 2;
-			    }
-			  if (summary->Profile_BitsDefining[4] & PROF_us_txLevel)
-			    {
-			      short_ptr = (short *) &buffer[offset];
-			      profile->params[0].txLevel = *short_ptr;
-			      offset += 2;
-			    }
-			  if (summary->Profile_BitsDefining[4] & PROF_ss_txBeamAngle)
-			    {
-			      short_ptr = (short *) &buffer[offset];
-			      profile->params[0].txBeamAngle = *short_ptr;
-			      offset += 2;
-			    }
-			  if (summary->Profile_BitsDefining[4] & PROF_us_txPulseLength)
-			    {
-			      short_ptr = (short *) &buffer[offset];
-			      profile->params[0].txPulseLength = *short_ptr;
-			      offset += 2;
-			    }
-			  if (summary->Profile_BitsDefining[4] & PROF_ui_ss_offset)
-			    {
-			      int_ptr = (int *) &buffer[offset];
-			      profile->params[0].ss_offset = *int_ptr;
-			      offset += 4;
-			    }
-			  if (summary->Profile_BitsDefining[4] & PROF_us_no_skipped_ss)
-			    {
-			      short_ptr = (short *) &buffer[offset];
-			      profile->params[0].no_skipped_ss = *short_ptr;
-			      offset += 2;
-			    }
-			  if (summary->Profile_BitsDefining[4] & PROF_us_no_acquired_ss)
-			    {
-			      short_ptr = (short *) &buffer[offset];
-			      profile->params[0].no_acquired_ss = *short_ptr;
-			      offset += 2;
-			    }
-			  if (summary->Profile_BitsDefining[4] & PROF_us_ss_sample_interval)
-			    {
-			      short_ptr = (short *) &buffer[offset];
-			      profile->params[0].ss_sample_interval = *short_ptr;
-			      offset += 2;
-			    }
-			  if (summary->Profile_BitsDefining[4] & PROF_us_bscatClass)
-			    {
-			      short_ptr = (short *) &buffer[offset];
-			      profile->params[0].bscatClass = *short_ptr;
-			      offset += 2;
-			    }
-			  if (summary->Profile_BitsDefining[4] & PROF_us_nrActualGainSets)
-			    {
-			      short_ptr = (short *) &buffer[offset];
-			      profile->params[0].nrActualGainSets = *short_ptr;
-			      offset += 2;
-			    }
-			  if (summary->Profile_BitsDefining[4] & PROF_ss_rxGup)
-			    {
-			      short_ptr = (short *) &buffer[offset];
-			      profile->params[0].rxGup = *short_ptr;
-			      offset += 2;
-			    }
-			  if (summary->Profile_BitsDefining[4] & PROF_ss_rxGain)
-			    {
-			      short_ptr = (short *) &buffer[offset];
-			      profile->params[0].rxGain = *short_ptr;
-			      offset += 2;
-			    }
-			  if (summary->Profile_BitsDefining[4] & PROF_ss_ar)
-			    {
-			      short_ptr = (short *) &buffer[offset];
-			      profile->params[0].ar = *short_ptr;
-			      offset += 2;
-			    }
-			  /* hard wired, that if present, there are 20 of them irrespective */
-			  if (summary->Profile_BitsDefining[4] & PROF_us_rxtimeARRAY)
-			    {
-			      for (i = 0; i < 20; i++)
-				{
-				  short_ptr = (short *) &buffer[offset];
-				  profile->params[0].rxtime[i] = *short_ptr;
-				  offset += 2;
-				}
-			    }
-			  if (summary->Profile_BitsDefining[4] & PROF_ss_rxgainARRAY)
-			    {
-			      for (i = 0; i < 20; i++)
-				{
-				  short_ptr = (short *) &buffer[offset];
-				  profile->params[0].rxgain[i] = *short_ptr;
-				  offset += 2;
-				}
-			    }
-			} /* if port is present */
-
-		      if (summary->Profile_BitsDefining[4] & PROF_st_params_STBD)
-			{
-
-			  if (summary->Profile_BitsDefining[4] & PROF_us_txBeamIndex)
-			    {
-			      short_ptr = (short *) &buffer[offset];
-			      profile->params[1].txBeamIndex = *short_ptr;
-			      offset += 2;
-			    }
-			  if (summary->Profile_BitsDefining[4] & PROF_us_txLevel)
-			    {
-			      short_ptr = (short *) &buffer[offset];
-			      profile->params[1].txLevel = *short_ptr;
-			      offset += 2;
-			    }
-			  if (summary->Profile_BitsDefining[4] & PROF_ss_txBeamAngle)
-			    {
-			      short_ptr = (short *) &buffer[offset];
-			      profile->params[1].txBeamAngle = *short_ptr;
-			      offset += 2;
-			    }
-			  if (summary->Profile_BitsDefining[4] & PROF_us_txPulseLength)
-			    {
-			      short_ptr = (short *) &buffer[offset];
-			      profile->params[1].txPulseLength = *short_ptr;
-			      offset += 2;
-			    }
-			  if (summary->Profile_BitsDefining[4] & PROF_ui_ss_offset)
-			    {
-			      int_ptr = (int *) &buffer[offset];
-			      profile->params[1].ss_offset = *int_ptr;
-			      offset += 4;
-			    }
-			  if (summary->Profile_BitsDefining[4] & PROF_us_no_skipped_ss)
-			    {
-			      short_ptr = (short *) &buffer[offset];
-			      profile->params[1].no_skipped_ss = *short_ptr;
-			      offset += 2;
-			    }
-			  if (summary->Profile_BitsDefining[4] & PROF_us_no_acquired_ss)
-			    {
-			      short_ptr = (short *) &buffer[offset];
-			      profile->params[1].no_acquired_ss = *short_ptr;
-			      offset += 2;
-			    }
-			  if (summary->Profile_BitsDefining[4] & PROF_us_ss_sample_interval)
-			    {
-			      short_ptr = (short *) &buffer[offset];
-			      profile->params[1].ss_sample_interval = *short_ptr;
-			      offset += 2;
-			    }
-			  if (summary->Profile_BitsDefining[4] & PROF_us_bscatClass)
-			    {
-			      short_ptr = (short *) &buffer[offset];
-			      profile->params[1].bscatClass = *short_ptr;
-			      offset += 2;
-			    }
-			  if (summary->Profile_BitsDefining[4] & PROF_us_nrActualGainSets)
-			    {
-			      short_ptr = (short *) &buffer[offset];
-			      profile->params[1].nrActualGainSets = *short_ptr;
-			      offset += 2;
-			    }
-			  if (summary->Profile_BitsDefining[4] & PROF_ss_rxGup)
-			    {
-			      short_ptr = (short *) &buffer[offset];
-			      profile->params[1].rxGup = *short_ptr;
-			      offset += 2;
-			    }
-			  if (summary->Profile_BitsDefining[4] & PROF_ss_rxGain)
-			    {
-			      short_ptr = (short *) &buffer[offset];
-			      profile->params[1].rxGain = *short_ptr;
-			      offset += 2;
-			    }
-			  if (summary->Profile_BitsDefining[4] & PROF_ss_ar)
-			    {
-			      short_ptr = (short *) &buffer[offset];
-			      profile->params[1].ar = *short_ptr;
-			      offset += 2;
-			    }
-			  /* hard wired, that if present, there are 20 of them irrespective */
-			  if (summary->Profile_BitsDefining[4] & PROF_us_rxtimeARRAY)
-			    {
-			      for (i = 0; i < 20; i++)
-				{
-				  short_ptr = (short *) &buffer[offset];
-				  profile->params[1].rxtime[i] = *short_ptr;
-				  offset += 2;
-				}
-			    }
-			  if (summary->Profile_BitsDefining[4] & PROF_ss_rxgainARRAY)
-			    {
-			      for (i = 0; i < 20; i++)
-				{
-				  short_ptr = (short *) &buffer[offset];
-				  profile->params[1].rxgain[i] = *short_ptr;
-				  offset += 2;
-				}
-			    }
-
-			} /* if stbd is present */
-		    }
-
-		  if (summary->Profile_BitsDefining[5])
-		    {
-		      if (summary->Profile_BitsDefining[5] & PROF_si_transducerDepth)
-			{
-			  int_ptr = (int *) &buffer[offset];
-			  profile->transducerDepth = *int_ptr;
-			  offset += 4;
-			}
-		      if (summary->Profile_BitsDefining[5] & PROF_si_transducerPitch)
-			{
-			  int_ptr = (int *) &buffer[offset];
-			  profile->transducerDepth = *int_ptr;
-			  offset += 4;
-			}
-		      if (summary->Profile_BitsDefining[5] & PROF_si_transducerRoll)
-			{
-			  int_ptr = (int *) &buffer[offset];
-			  profile->transducerDepth = *int_ptr;
-			  offset += 4;
-			}
-		      if (summary->Profile_BitsDefining[5] & PROF_ui_transducerHeading)
-			{
-			  int_ptr = (int *) &buffer[offset];
-			  profile->transducerDepth = *int_ptr;
-			  offset += 4;
-			}
-		      if (summary->Profile_BitsDefining[5] & PROF_si_transducerLatOffset)
-			{
-			  int_ptr = (int *) &buffer[offset];
-			  profile->transducerDepth = *int_ptr;
-			  offset += 4;
-			}
-		      if (summary->Profile_BitsDefining[5] & PROF_si_transducerLongOffset)
-			{
-			  int_ptr = (int *) &buffer[offset];
-			  profile->transducerDepth = *int_ptr;
-			  offset += 4;
-			}
-		      if (summary->Profile_BitsDefining[5] & PROF_ui_transducerSlantRange)
-			{
-			  int_ptr = (int *) &buffer[offset];
-			  profile->transducerDepth = *int_ptr;
-			  offset += 4;
-			}
-		      if (summary->Profile_BitsDefining[5] & PROF_si_transducerAcross)
-			{
-			  int_ptr = (int *) &buffer[offset];
-			  profile->transducerDepth = *int_ptr;
-			  offset += 4;
-			}
-		      if (summary->Profile_BitsDefining[5] & PROF_si_transducerAlong)
-			{
-			  int_ptr = (int *) &buffer[offset];
-			  profile->transducerDepth = *int_ptr;
-			  offset += 4;
-			}
-		      if (summary->Profile_BitsDefining[5] & PROF_ui_transducerBearing)
-			{
-			  int_ptr = (int *) &buffer[offset];
-			  profile->transducerDepth = *int_ptr;
-			  offset += 4;
-			}
-		    }
-
-		  if (summary->Profile_BitsDefining[6])
-		    {
-		      if (summary->Profile_BitsDefining[6] & PROF_ui_sonar_settings_offset)
-			{
-			  int_ptr = (int *) &buffer[offset];
-			  profile->sonar_settings_offset = *int_ptr;
-			  offset += 4;
-			}
-		      if (summary->Profile_BitsDefining[6] & PROF_ui_ping_number)
-			{
-			  int_ptr = (int *) &buffer[offset];
-			  profile->ping_number = *int_ptr;
-			  offset += 4;
-			}
-		      if (summary->Profile_BitsDefining[6] & PROF_us_multi_ping_sequence)
-			{
-			  short_ptr = (short *) &buffer[offset];
-			  profile->multi_ping_sequence = *short_ptr;
-			  offset += 2;
-			}
-		      if (summary->Profile_BitsDefining[6] & PROF_ui_num_beams)
-			{
-			  int_ptr = (int *) &buffer[offset];
-			  profile->num_beams = *int_ptr;
-			  offset += 4;
-			}
-		      if (summary->Profile_BitsDefining[6] & PROF_uc_layer_compensation_flag)
-			{
-			  profile->layer_compensation_flag = buffer[offset];
-			  offset += 1;
-			}
-		      if (summary->Profile_BitsDefining[6] & PROF_f_bs_beam_position)
-			{
-			  float_ptr = (float *) &buffer[offset];
-			  profile->bs_beam_position = *float_ptr;
-			  offset += 4;
-			}
-		      if (summary->Profile_BitsDefining[6] & PROF_ui_bs_control_flags)
-			{
-			  int_ptr = (int *) &buffer[offset];
-			  profile->bs_control_flags = *int_ptr;
-			  offset += 4;
-			}
-		      if (summary->Profile_BitsDefining[6] & PROF_us_bs_num_beams_per_side)
-			{
-			  short_ptr = (short *) &buffer[offset];
-			  profile->bs_num_beams_per_side = *short_ptr;
-			  offset += 2;
-			}
-		      if (summary->Profile_BitsDefining[6] & PROF_us_bs_current_beam_number)
-			{
-			  short_ptr = (short *) &buffer[offset];
-			  profile->bs_current_beam_number = *short_ptr;
-			  offset += 2;
-			}
-		      if (summary->Profile_BitsDefining[6] & PROF_uc_bs_sample_descriptor)
-			{
-			  profile->bs_sample_descriptor = buffer[offset];
-			  offset += 1;
-			}
-		      if (summary->Profile_BitsDefining[6] & PROF_ui_snippet_sample_descriptor)
-			{
-			  int_ptr = (int *) &buffer[offset];
-			  profile->snippet_sample_descriptor = *int_ptr;
-			  offset += 4;
-			}
-		    }
-
-#endif
-		    } /* Done V4 */
-
-		}
-
-	    /* now read next data */
-	    if (status == MB_SUCCESS)
-		{
-		if ((read_size = fread(buffer,1,
-		    *data_size,mb_io_ptr->mbfp))
-		    != *data_size)
-		    {
-		    status = MB_FAILURE;
-		    *error = MB_ERROR_EOF;
-		    }
-		else
-		    mb_io_ptr->file_bytes += read_size;
-
-
-		}
-
-	    /* now parse data */
-	    if (status == MB_SUCCESS)
-		{
-		offset = 0;
-		for (i=0;i<profile->numDepths;i++)
-		    {
-		    offset_start = offset;
-		    beam = &data->beams[i];
-		    if (*fileVersion == 1)
-			{
-#ifdef BYTESWAPPED
-			int_ptr = (int *) &buffer[offset];
-			beam->status = mb_swap_int(*int_ptr); offset+=4;
-			int_ptr = (int *) &buffer[offset];
-			beam->observedDepth = mb_swap_int(*int_ptr); offset+=4;
-			if ((offset - offset_start) < *beam_size)
-			    {
-			    int_ptr = (int *) &buffer[offset];
-			    beam->acrossTrack = mb_swap_int(*int_ptr); offset+=4;
-			    int_ptr = (int *) &buffer[offset];
-			    beam->alongTrack = mb_swap_int(*int_ptr); offset+=4;
-			    int_ptr = (int *) &buffer[offset];
-			    beam->latOffset = mb_swap_int(*int_ptr); offset+=4;
-			    int_ptr = (int *) &buffer[offset];
-			    beam->longOffset = mb_swap_int(*int_ptr); offset+=4;
-			    }
-			if ((offset - offset_start) < *beam_size)
-			    {
-			    int_ptr = (int *) &buffer[offset];
-			    beam->processedDepth = mb_swap_int(*int_ptr); offset+=4;
-			    int_ptr = (int *) &buffer[offset];
-			    beam->timeOffset = mb_swap_int(*int_ptr); offset+=4;
-			    int_ptr = (int *) &buffer[offset];
-			    beam->depthAccuracy = mb_swap_int(*int_ptr); offset+=4;
-			    }
-			if ((offset - offset_start) < *beam_size)
-			    {
-			    beam->reflectivity = buffer[offset]; offset+=1;
-			    beam->Q_factor = buffer[offset]; offset+=1;
-			    beam->beam_no = buffer[offset]; offset+=1;
-			    beam->freq = buffer[offset]; offset+=1;
-			    beam->calibratedBackscatter = buffer[offset]; offset+=1;
-			    beam->mindB = buffer[offset]; offset+=1;
-			    beam->maxdB = buffer[offset]; offset+=1;
-			    beam->pseudoAngleIndependentBackscatter = buffer[offset]; offset+=1;
-			    }
-			if ((offset - offset_start) < *beam_size)
-			    {
-			    int_ptr = (int *) &buffer[offset];
-			    beam->range = mb_swap_int(*int_ptr); offset+=4;
-			    int_ptr = (int *) &buffer[offset];
-			    beam->no_samples = mb_swap_int(*int_ptr); offset+=4;
-			    int_ptr = (int *) &buffer[offset];
-			    beam->offset = mb_swap_int(*int_ptr); offset+=4;
-			    int_ptr = (int *) &buffer[offset];
-			    beam->centre_no = mb_swap_int(*int_ptr); offset+=4;
-			    beam->sample_unit = buffer[offset]; offset+=1;
-			    beam->sample_interval = buffer[offset]; offset+=1;
-			    beam->dummy[0] = buffer[offset]; offset+=1;
-			    beam->dummy[1] = buffer[offset]; offset+=1;
-			    }
-#else
-			int_ptr = (int *) &buffer[offset];
-			beam->status = *int_ptr; offset+=4;
-			int_ptr = (int *) &buffer[offset];
-			beam->observedDepth = *int_ptr; offset+=4;
-			if ((offset - offset_start) < *beam_size)
-			    {
-			    int_ptr = (int *) &buffer[offset];
-			    beam->acrossTrack = *int_ptr; offset+=4;
-			    int_ptr = (int *) &buffer[offset];
-			    beam->alongTrack = *int_ptr; offset+=4;
-			    int_ptr = (int *) &buffer[offset];
-			    beam->latOffset = *int_ptr; offset+=4;
-			    int_ptr = (int *) &buffer[offset];
-			    beam->longOffset = *int_ptr; offset+=4;
-			    }
-			if ((offset - offset_start) < *beam_size)
-			    {
-			    int_ptr = (int *) &buffer[offset];
-			    beam->processedDepth = *int_ptr; offset+=4;
-			    int_ptr = (int *) &buffer[offset];
-			    beam->timeOffset = *int_ptr; offset+=4;
-			    int_ptr = (int *) &buffer[offset];
-			    beam->depthAccuracy = *int_ptr; offset+=4;
-			    }
-			if ((offset - offset_start) < *beam_size)
-			    {
-			    beam->reflectivity = buffer[offset]; offset+=1;
-			    beam->Q_factor = buffer[offset]; offset+=1;
-			    beam->beam_no = buffer[offset]; offset+=1;
-			    beam->freq = buffer[offset]; offset+=1;
-			    beam->calibratedBackscatter = buffer[offset]; offset+=1;
-			    beam->mindB = buffer[offset]; offset+=1;
-			    beam->maxdB = buffer[offset]; offset+=1;
-			    beam->pseudoAngleIndependentBackscatter = buffer[offset]; offset+=1;
-			    }
-			if ((offset - offset_start) < *beam_size)
-			    {
-			    int_ptr = (int *) &buffer[offset];
-			    beam->range = *int_ptr; offset+=4;
-			    int_ptr = (int *) &buffer[offset];
-			    beam->no_samples = *int_ptr; offset+=4;
-			    int_ptr = (int *) &buffer[offset];
-			    beam->offset = *int_ptr; offset+=4;
-			    int_ptr = (int *) &buffer[offset];
-			    beam->centre_no = *int_ptr; offset+=4;
-			    beam->sample_unit = buffer[offset]; offset+=1;
-			    beam->sample_interval = buffer[offset]; offset+=1;
-			    beam->dummy[0] = buffer[offset]; offset+=1;
-			    beam->dummy[1] = buffer[offset]; offset+=1;
-			    }
-#endif
-			beam->samp_win_length = 0;
-			beam->beam_depress_angle = 0;
-			beam->beam_heading_angle = 0;
-			beam->other_range = 0;
-			beam->Tx_steer = 0;
-			beam->Rc_steer = 0;
-			beam->TxSector = 0;
-			beam->Ifremer_qfactor = 0.0;
-			beam->timestampOffset = 0;
-			beam->no_RAMAN = 0;
-			beam->no_IR = 0;
-			beam->no_GAPD = 0;
-			beam->no_PMT = 0;
-			beam->prim_depth_conf = 0;
-			beam->seco_depth_conf = 0;
-			beam->scan_azimuth = 0;
-			beam->nadir_angle = 0;
-			beam->secondaryDepth = 0;
-			beam->wave_height = 0;
-			beam->opaqueDepth_PMT = 0;
-			beam->extinctionDepth_PMT = 0;
-			beam->pimDepth_PMT = 0;
-			beam->opaqueDepth_GAPD = 0;
-			beam->extinctionDepth_GAPD = 0;
-			beam->pimDepth_GAPD = 0;
-			beam->twtt = 0.0;
-			beam->snippet_first_sample = 0;
-			beam->snippet_last_sample = 0;
-			beam->intensity = 0.0;
-			}
-		    else if (*fileVersion == 2)
-			{
-#ifdef BYTESWAPPED
-			if ((offset - offset_start) < *beam_size)
-			    {
-			    short_ptr = (short *) &buffer[offset];
-			    beam->observedDepth = (short)mb_swap_short(*short_ptr); offset+=2;
-			    short_ptr = (short *) &buffer[offset];
-			    beam->acrossTrack = (short)mb_swap_short(*short_ptr); offset+=2;
-			    beam->status = buffer[offset]; offset+=1;
-			    }
-			if ((offset - offset_start) < *beam_size)
-			    {
-			    beam->reflectivity = buffer[offset]; offset+=1;
-			    beam->calibratedBackscatter = buffer[offset]; offset+=1;
-			    beam->pseudoAngleIndependentBackscatter = buffer[offset]; offset+=1;
-			    }
-			if ((offset - offset_start) < *beam_size)
-			    {
-			    short_ptr = (short *) &buffer[offset];
-			    beam->alongTrack = (short)mb_swap_short(*short_ptr); offset+=2;
-			    }
-			if ((offset - offset_start) < *beam_size)
-			    {
-			    short_ptr = (short *) &buffer[offset];
-			    beam->range = (short)mb_swap_short(*short_ptr); offset+=2;
-			    }
-			if ((offset - offset_start) < *beam_size)
-			    {
-			    int_ptr = (int *) &buffer[offset];
-			    beam->offset = mb_swap_int(*int_ptr); offset+=4;
-			    short_ptr = (short *) &buffer[offset];
-			    beam->no_samples = (short)mb_swap_short(*short_ptr); offset+=2;
-			    short_ptr = (short *) &buffer[offset];
-			    beam->centre_no = (short)mb_swap_short(*short_ptr); offset+=2;
-			    }
-#else
-			if ((offset - offset_start) < *beam_size)
-			    {
-			    short_ptr = (short *) &buffer[offset];
-			    beam->observedDepth = *short_ptr; offset+=2;
-			    short_ptr = (short *) &buffer[offset];
-			    beam->acrossTrack = *short_ptr; offset+=2;
-			    beam->status = buffer[offset]; offset+=1;
-			    }
-			if ((offset - offset_start) < *beam_size)
-			    {
-			    beam->reflectivity = buffer[offset]; offset+=1;
-			    beam->calibratedBackscatter = buffer[offset]; offset+=1;
-			    beam->pseudoAngleIndependentBackscatter = buffer[offset]; offset+=1;
-			    }
-			if ((offset - offset_start) < *beam_size)
-			    {
-			    short_ptr = (short *) &buffer[offset];
-			    beam->alongTrack = *short_ptr; offset+=2;
-			    }
-			if ((offset - offset_start) < *beam_size)
-			    {
-			    short_ptr = (short *) &buffer[offset];
-			    beam->range = *short_ptr; offset+=2;
-			    }
-			if ((offset - offset_start) < *beam_size)
-			    {
-			    int_ptr = (int *) &buffer[offset];
-			    beam->offset = *int_ptr; offset+=4;
-			    short_ptr = (short *) &buffer[offset];
-			    beam->no_samples = *short_ptr; offset+=2;
-			    short_ptr = (short *) &buffer[offset];
-			    beam->centre_no = *short_ptr; offset+=2;
-			    }
-#endif
-			beam->latOffset = 0;
-			beam->longOffset = 0;
-			beam->processedDepth = 0;
-			beam->timeOffset = 0;
-			beam->depthAccuracy = 0;
-			beam->reflectivity = 0;
-			beam->Q_factor = 0;
-			beam->beam_no = 0;
-			beam->freq = 0;
-			beam->mindB = 0;
-			beam->maxdB = 0;
-			beam->sample_unit = 0;
-			beam->sample_interval = 0;
-			beam->dummy[0] = 0;
-			beam->dummy[1] = 0;
-			beam->samp_win_length = 0;
-			beam->beam_depress_angle = 0;
-			beam->beam_heading_angle = 0;
-			beam->other_range = 0;
-			beam->Tx_steer = 0;
-			beam->Rc_steer = 0;
-			beam->TxSector = 0;
-			beam->Ifremer_qfactor = 0.0;
-			beam->timestampOffset = 0;
-			beam->no_RAMAN = 0;
-			beam->no_IR = 0;
-			beam->no_GAPD = 0;
-			beam->no_PMT = 0;
-			beam->prim_depth_conf = 0;
-			beam->seco_depth_conf = 0;
-			beam->scan_azimuth = 0;
-			beam->nadir_angle = 0;
-			beam->secondaryDepth = 0;
-			beam->wave_height = 0;
-			beam->opaqueDepth_PMT = 0;
-			beam->extinctionDepth_PMT = 0;
-			beam->pimDepth_PMT = 0;
-			beam->opaqueDepth_GAPD = 0;
-			beam->extinctionDepth_GAPD = 0;
-			beam->pimDepth_GAPD = 0;
-			beam->twtt = 0.0;
-			beam->snippet_first_sample = 0;
-			beam->snippet_last_sample = 0;
-			beam->intensity = 0.0;
-
-			if(beam->alongTrack < -13000)
-			    {
-			    ScaleFactor = 1;
-			    beam->alongTrack +=20000;
-			    }
-			else if(beam->alongTrack < -5000)
-			    {
-			    ScaleFactor = 10;
-			    beam->alongTrack +=10000;
-			    }
-			else if(beam->alongTrack < 5000)
-			    {
-			    ScaleFactor = 100;
-			    beam->alongTrack +=0000;
-			    }
-			else if(beam->alongTrack < 15000)
-			    {
-			    ScaleFactor = 1000;
-			    beam->alongTrack -=10000;
-			    }
-			beam->observedDepth = beam->observedDepth * ScaleFactor;
-			beam->acrossTrack = beam->acrossTrack * ScaleFactor;
-			beam->alongTrack = beam->alongTrack * ScaleFactor;
-			beam->Q_factor = beam->reflectivity;
-			}
-		    else if (*fileVersion == 3)
-			{
-#ifdef BYTESWAPPED
-			if ((offset - offset_start) < *beam_size)
-			    {
-			    short_ptr = (short *) &buffer[offset];
-			    beam->observedDepth = (short)mb_swap_short(*short_ptr); offset+=2;
-			    short_ptr = (short *) &buffer[offset];
-			    beam->acrossTrack = (short)mb_swap_short(*short_ptr); offset+=2;
-			    beam->status = buffer[offset]; offset+=1;
-			    }
-			if ((offset - offset_start) < *beam_size)
-			    {
-			    beam->reflectivity = buffer[offset]; offset+=1;
-			    beam->calibratedBackscatter = buffer[offset]; offset+=1;
-			    beam->pseudoAngleIndependentBackscatter = buffer[offset]; offset+=1;
-			    }
-			if ((offset - offset_start) < *beam_size)
-			    {
-			    short_ptr = (short *) &buffer[offset];
-			    beam->alongTrack = (short)mb_swap_short(*short_ptr); offset+=2;
-			    }
-			if ((offset - offset_start) < *beam_size)
-			    {
-			    short_ptr = (short *) &buffer[offset];
-			    beam->range = (short)mb_swap_short(*short_ptr); offset+=2;
-			    }
-			if ((offset - offset_start) < *beam_size)
-			    {
-			    int_ptr = (int *) &buffer[offset];
-			    beam->offset = mb_swap_int(*int_ptr); offset+=4;
-			    short_ptr = (short *) &buffer[offset];
-			    beam->no_samples = (short)mb_swap_short(*short_ptr); offset+=2;
-			    short_ptr = (short *) &buffer[offset];
-			    beam->centre_no = (short)mb_swap_short(*short_ptr); offset+=2;
-			    }
-			if ((offset - offset_start) < *beam_size)
-			    {
-			    short_ptr = (short *) &buffer[offset];
-			    beam->beam_depress_angle = (short)mb_swap_short(*short_ptr); offset+=2;
-			    short_ptr = (short *) &buffer[offset];
-			    beam->beam_heading_angle = (short)mb_swap_short(*short_ptr); offset+=2;
-			    beam->samp_win_length = buffer[offset]; offset+=1;
-			    scaling_factor = buffer[offset]; offset+=1;
-			    beam->Q_factor = buffer[offset]; offset+=1;
-			    offset+=1;
-			    }
-#else
-			if ((offset - offset_start) < *beam_size)
-			    {
-			    short_ptr = (short *) &buffer[offset];
-			    beam->observedDepth = *short_ptr; offset+=2;
-			    short_ptr = (short *) &buffer[offset];
-			    beam->acrossTrack = *short_ptr; offset+=2;
-			    beam->status = buffer[offset]; offset+=1;
-			    }
-			if ((offset - offset_start) < *beam_size)
-			    {
-			    beam->reflectivity = buffer[offset]; offset+=1;
-			    beam->calibratedBackscatter = buffer[offset]; offset+=1;
-			    beam->pseudoAngleIndependentBackscatter = buffer[offset]; offset+=1;
-			    }
-			if ((offset - offset_start) < *beam_size)
-			    {
-			    short_ptr = (short *) &buffer[offset];
-			    beam->alongTrack = *short_ptr; offset+=2;
-			    }
-			if ((offset - offset_start) < *beam_size)
-			    {
-			    short_ptr = (short *) &buffer[offset];
-			    beam->range = *short_ptr; offset+=2;
-			    }
-			if ((offset - offset_start) < *beam_size)
-			    {
-			    int_ptr = (int *) &buffer[offset];
-			    beam->offset = *int_ptr; offset+=4;
-			    short_ptr = (short *) &buffer[offset];
-			    beam->no_samples = *short_ptr; offset+=2;
-			    short_ptr = (short *) &buffer[offset];
-			    beam->centre_no = *short_ptr; offset+=2;
-			    }
-			if ((offset - offset_start) < *beam_size)
-			    {
-			    short_ptr = (short *) &buffer[offset];
-			    beam->beam_depress_angle = *short_ptr; offset+=2;
-			    short_ptr = (short *) &buffer[offset];
-			    beam->beam_heading_angle = *short_ptr; offset+=2;
-			    beam->samp_win_length = buffer[offset]; offset+=1;
-			    scaling_factor = buffer[offset]; offset+=1;
-			    beam->Q_factor = buffer[offset]; offset+=1;
-			    offset+=1;
-			    }
-#endif
-			beam->latOffset = 0;
-			beam->longOffset = 0;
-			beam->processedDepth = 0;
-			beam->timeOffset = 0;
-			beam->depthAccuracy = 0;
-			beam->reflectivity = 0;
-			beam->beam_no = 0;
-			beam->freq = 0;
-			beam->mindB = 0;
-			beam->maxdB = 0;
-			beam->sample_unit = 0;
-			beam->sample_interval = 0;
-			beam->dummy[0] = 0;
-			beam->dummy[1] = 0;
-			beam->other_range = 0;
-			beam->Tx_steer = 0;
-			beam->Rc_steer = 0;
-			beam->TxSector = 0;
-			beam->Ifremer_qfactor = 0.0;
-			beam->timestampOffset = 0;
-			beam->no_RAMAN = 0;
-			beam->no_IR = 0;
-			beam->no_GAPD = 0;
-			beam->no_PMT = 0;
-			beam->prim_depth_conf = 0;
-			beam->seco_depth_conf = 0;
-			beam->scan_azimuth = 0;
-			beam->nadir_angle = 0;
-			beam->secondaryDepth = 0;
-			beam->wave_height = 0;
-			beam->opaqueDepth_PMT = 0;
-			beam->extinctionDepth_PMT = 0;
-			beam->pimDepth_PMT = 0;
-			beam->opaqueDepth_GAPD = 0;
-			beam->extinctionDepth_GAPD = 0;
-			beam->pimDepth_GAPD = 0;
-			beam->twtt = 0.0;
-			beam->snippet_first_sample = 0;
-			beam->snippet_last_sample = 0;
-			beam->intensity = 0.0;
-
-			/* get scaling factor
-			    - if maximum of abs(acrossTrack) and abs(observedDepth)
-				    less than     32m, 1mm res,
-				    less than     64m, 2mm res,
-				    less than    128m, 4mm res,
-				    less than  4,096m, 12.8cm res
-				    less than 40,960m, 1.28m res */
-			ScaleFactor = pow(2.0,(double)scaling_factor);
-			beam->observedDepth = beam->observedDepth * ScaleFactor;
-			beam->acrossTrack = beam->acrossTrack * ScaleFactor;
-			beam->alongTrack = beam->alongTrack * ScaleFactor;
-
-			}
-			  /* V4 */
-			  else if (*fileVersion == 4)
-			{
-#ifdef BYTESWAPPED
-
-			if (summary->Beam_BitsDefining[0])
-			{
-			if (summary->Profile_BitsDefining[0] & BEAM_ui_status)
-			{
-				beam->status = buffer[offset]; offset+=1;
-			}
-			if (summary->Beam_BitsDefining[0] & BEAM_uc_scaling_factor)
-			{
-				beam->scaling_factor = buffer[offset]; offset+=1;
-			}
-			/* Scale Factor for depth / distance, etc */
-			ScaleFactor = pow(2.0,(double)beam->scaling_factor);
-
-			if (summary->Beam_BitsDefining[0] & BEAM_si_observedDepth)
-			{
-				short_ptr = (short *) &buffer[offset];
-				beam->observedDepth = ScaleFactor*(short)mb_swap_short(*short_ptr);
-				offset+=2;
-			}
-			if (summary->Beam_BitsDefining[0] & BEAM_si_acrossTrack)
-			{
-				short_ptr = (short *) &buffer[offset];
-				beam->acrossTrack = ScaleFactor*(short)mb_swap_short(*short_ptr);
-				offset+=2;
-			}
-			if (summary->Beam_BitsDefining[0] & BEAM_si_alongTrack)
-			{
-				short_ptr = (short *) &buffer[offset];
-				beam->alongTrack = (int)ScaleFactor*(short)mb_swap_short(*short_ptr);
-				offset+=2;
-			}
-			if (summary->Beam_BitsDefining[0] & BEAM_si_latOffset)
-			{
-				int_ptr = (int *) &buffer[offset];
-				beam->latOffset = mb_swap_int(*int_ptr); offset+=4;
-			}
-			if (summary->Beam_BitsDefining[0] & BEAM_si_longOffset)
-			{
-				int_ptr = (int *) &buffer[offset];
-				beam->longOffset = mb_swap_int(*int_ptr); offset+=4;
-			}
-			if (summary->Beam_BitsDefining[0] & BEAM_si_processedDepth)
-			{
-				short_ptr = (short *) &buffer[offset];
-				beam->processedDepth = ScaleFactor*(short)mb_swap_short(*short_ptr);
-				offset+=2;
-			}
-			if (summary->Beam_BitsDefining[0] & BEAM_si_timeOffset)
-			{
-				int_ptr = (int *) &buffer[offset];
-				beam->timeOffset = mb_swap_int(*int_ptr); offset+=4;
-			}
-			if (summary->Beam_BitsDefining[0] & BEAM_si_depthAccuracy)
-			{
-				short_ptr = (short *) &buffer[offset];
-				beam->depthAccuracy = ScaleFactor*(short)mb_swap_short(*short_ptr);
-				offset+=2;
-			}
-			}
-
-			if (summary->Beam_BitsDefining[1])
-			{
-			if (summary->Beam_BitsDefining[1] & BEAM_uc_reflectivity)
-			{
-				beam->reflectivity = buffer[offset]; offset+=1;
-			}
-			if (summary->Beam_BitsDefining[1] & BEAM_sc_Q_factor)
-			{
-				beam->Q_factor = buffer[offset]; offset+=1;
-			}
-			if (summary->Beam_BitsDefining[1] & BEAM_uc_beam_no)
-			{
-				beam->beam_no = buffer[offset]; offset+=1;
-			}
-			if (summary->Beam_BitsDefining[1] & BEAM_uc_freq)
-			{
-				beam->freq = buffer[offset]; offset+=1;
-			}
-			if (summary->Beam_BitsDefining[1] & BEAM_uc_calibratedBackscatter)
-			{
-				beam->calibratedBackscatter = buffer[offset]; offset+=1;
-			}
-			if (summary->Beam_BitsDefining[1] & BEAM_uc_mindB)
-			{
-				beam->mindB = buffer[offset]; offset+=1;
-			}
-			if (summary->Beam_BitsDefining[1] & BEAM_uc_maxdB)
-			{
-				beam->maxdB = buffer[offset]; offset+=1;
-			}
-			if (summary->Beam_BitsDefining[1] & BEAM_uc_pseudoAngleIndependentBackscatter)
-			{
-				beam->pseudoAngleIndependentBackscatter = buffer[offset]; offset+=1;
-			}
-			}
-
-			if (summary->Beam_BitsDefining[2])
-			{
-			if (summary->Beam_BitsDefining[2] & BEAM_ui_range)
-			{
-				short_ptr = (short *) &buffer[offset];
-				beam->range = (short)mb_swap_short(*short_ptr); offset+=2;
-			}
-			if (summary->Beam_BitsDefining[2] & BEAM_ui_no_samples)
-			{
-				short_ptr = (short *) &buffer[offset];
-				beam->no_samples = (short)mb_swap_short(*short_ptr); offset+=2;
-			}
-			if (summary->Beam_BitsDefining[2] & BEAM_ui_offset)
-			{
-				int_ptr = (int *) &buffer[offset];
-				beam->offset = mb_swap_int(*int_ptr); offset+=4;
-			}
-			if (summary->Beam_BitsDefining[2] & BEAM_si_centre_no)
-			{
-				short_ptr = (short *) &buffer[offset];
-				beam->centre_no = (short)mb_swap_short(*short_ptr); offset+=2;
-			}
-			if (summary->Beam_BitsDefining[2] & BEAM_uc_sample_unit)
-			{
-				beam->sample_unit = buffer[offset]; offset+=1;
-			}
-			if (summary->Beam_BitsDefining[2] & BEAM_uc_sample_interval)
-			{
-				beam->sample_interval = buffer[offset]; offset+=1;
-			}
-			if (summary->Beam_BitsDefining[2] & BEAM_uc_dummy0)
-			{
-			beam->dummy[0] = buffer[offset]; offset+=1;
-			}
-			if (summary->Beam_BitsDefining[2] & BEAM_uc_dummy1)
-			{
-			beam->dummy[1] = buffer[offset]; offset+=1;
-			}
-			if (summary->Beam_BitsDefining[2] & BEAM_uc_samp_win_length)
-			{
-			beam->samp_win_length = buffer[offset]; offset+=1;
-			}
-			}
-
-			if (summary->Beam_BitsDefining[3])
-			{
-			if (summary->Beam_BitsDefining[3] & BEAM_ss_beam_depress_angle)
-			{
-				short_ptr = (short *) &buffer[offset];
-				beam->beam_depress_angle = (short)mb_swap_short(*short_ptr); offset+=2;
-			}
-			if (summary->Beam_BitsDefining[3] & BEAM_us_beam_heading_angle)
-			{
-				short_ptr = (short *) &buffer[offset];
-				beam->beam_heading_angle = (short)mb_swap_short(*short_ptr); offset+=2;
-			}
-			if (summary->Beam_BitsDefining[3] & BEAM_us_other_range)
-			{
-				short_ptr = (short *) &buffer[offset];
-				beam->other_range = (short)mb_swap_short(*short_ptr); offset+=2;
-			}
-			if (summary->Beam_BitsDefining[3] & BEAM_ss_Tx_steer)
-			{
-				short_ptr = (short *) &buffer[offset];
-				beam->Tx_steer = (short)mb_swap_short(*short_ptr); offset+=2;
-			}
-			if (summary->Beam_BitsDefining[3] & BEAM_ss_Rc_steer)
-			{
-				short_ptr = (short *) &buffer[offset];
-				beam->Rc_steer = (short)mb_swap_short(*short_ptr); offset+=2;
-			}
-			if (summary->Beam_BitsDefining[3] & BEAM_uc_TxSector)
-			{
-				beam->TxSector = buffer[offset]; offset+=1;
-			}
-			if (summary->Beam_BitsDefining[3] & BEAM_f_Ifremer_qfactor)
-			{
-				float_ptr = (float *) &buffer[offset];
-				mb_swap_float(float_ptr);
-				beam->Ifremer_qfactor = *float_ptr;
-				offset+=4;
-			}
-			}
-
-			if (summary->Beam_BitsDefining[4])
-			{
-			if (summary->Beam_BitsDefining[4] & BEAM_ui_timestampOffset)
-			{
-				int_ptr = (int *) &buffer[offset];
-				beam->timestampOffset = mb_swap_int(*int_ptr); offset+=4;
-			}
-			if (summary->Beam_BitsDefining[4] & BEAM_us_no_RAMAN)
-			{
-				short_ptr = (short *) &buffer[offset];
-				beam->no_RAMAN = (short)mb_swap_short(*short_ptr); offset+=2;
-			}
-			if (summary->Beam_BitsDefining[4] & BEAM_us_no_IR)
-			{
-				short_ptr = (short *) &buffer[offset];
-				beam->no_IR = (short)mb_swap_short(*short_ptr); offset+=2;
-			}
-			if (summary->Beam_BitsDefining[4] & BEAM_us_no_GAPD)
-			{
-				short_ptr = (short *) &buffer[offset];
-				beam->no_GAPD = (short)mb_swap_short(*short_ptr); offset+=2;
-			}
-			if (summary->Beam_BitsDefining[4] & BEAM_us_no_PMT)
-			{
-				short_ptr = (short *) &buffer[offset];
-				beam->no_PMT = (short)mb_swap_short(*short_ptr); offset+=2;
-			}
-			if (summary->Beam_BitsDefining[4] & BEAM_uc_prim_depth_conf)
-			{
-				beam->prim_depth_conf = buffer[offset]; offset+=1;
-			}
-			if (summary->Beam_BitsDefining[4] & BEAM_uc_seco_depth_conf)
-			{
-				beam->seco_depth_conf = buffer[offset]; offset+=1;
-			}
-			if (summary->Beam_BitsDefining[4] & BEAM_ss_scan_azimuth)
-			{
-				short_ptr = (short *) &buffer[offset];
-				beam->scan_azimuth = (short)mb_swap_short(*short_ptr); offset+=2;
-			}
-			if (summary->Beam_BitsDefining[4] & BEAM_us_nadir_angle)
-			{
-				short_ptr = (short *) &buffer[offset];
-				beam->nadir_angle = (short)mb_swap_short(*short_ptr); offset+=2;
-			}
-			if (summary->Beam_BitsDefining[4] & BEAM_si_secondaryDepth)
-			{
-				short_ptr = (short *) &buffer[offset];
-				beam->secondaryDepth = ScaleFactor*mb_swap_short(*short_ptr); offset+=2;
-			}
-			if (summary->Beam_BitsDefining[4] & BEAM_ss_wave_height)
-			{
-				short_ptr = (short *) &buffer[offset];
-				beam->wave_height = (short)mb_swap_short(*short_ptr); offset+=2;
-			}
-			if (summary->Beam_BitsDefining[4] & BEAM_si_opaqueDepth_PMT)
-			{
-				int_ptr = (int *) &buffer[offset];
-				beam->opaqueDepth_PMT = mb_swap_int(*int_ptr); offset+=4;
-			}
-			if (summary->Beam_BitsDefining[4] & BEAM_si_extinctionDepth_PMT)
-			{
-				int_ptr = (int *) &buffer[offset];
-				beam->extinctionDepth_PMT = mb_swap_int(*int_ptr); offset+=4;
-			}
-			if (summary->Beam_BitsDefining[4] & BEAM_si_pimDepth_PMT)
-			{
-				int_ptr = (int *) &buffer[offset];
-				beam->pimDepth_PMT = mb_swap_int(*int_ptr); offset+=4;
-			}
-			if (summary->Beam_BitsDefining[4] & BEAM_si_opaqueDepth_GAPD)
-			{
-				int_ptr = (int *) &buffer[offset];
-				beam->opaqueDepth_GAPD = mb_swap_int(*int_ptr); offset+=4;
-			}
-			if (summary->Beam_BitsDefining[4] & BEAM_si_extinctionDepth_GAPD)
-			{
-				int_ptr = (int *) &buffer[offset];
-				beam->extinctionDepth_GAPD = mb_swap_int(*int_ptr); offset+=4;
-			}
-			if (summary->Beam_BitsDefining[4] & BEAM_si_pimDepth_GAPD)
-			{
-				int_ptr = (int *) &buffer[offset];
-				beam->pimDepth_GAPD = mb_swap_int(*int_ptr); offset+=4;
-			}
-			}
-
-			if (summary->Beam_BitsDefining[5])
-			{
-			if (summary->Beam_BitsDefining[5] & BEAM_f_twtt)
-			{
-				float_ptr = (float *)&buffer[offset];
-				mb_swap_float(float_ptr);
-				beam->twtt =*float_ptr; offset+=4;
-			}
-			if (summary->Beam_BitsDefining[5] & BEAM_ui_snippet_first_sample)
-			{
-				int_ptr = (int *) &buffer[offset];
-				beam->snippet_first_sample = mb_swap_int(*int_ptr); offset+=4;
-			}
-			if (summary->Beam_BitsDefining[5] & BEAM_ui_snippet_last_sample)
-			{
-				int_ptr = (int *) &buffer[offset];
-				beam->snippet_last_sample = mb_swap_int(*int_ptr); offset+=4;
-			}
-			if (summary->Beam_BitsDefining[5] & BEAM_f_intensity)
-			{
-				float_ptr = (float *) &buffer[offset];
-				mb_swap_float(float_ptr);
-				beam->intensity = *float_ptr;  offset+=4;
-			}
-			}
-#else
-			if (summary->Beam_BitsDefining[0])
-			{
-			if (summary->Profile_BitsDefining[0] & BEAM_ui_status)
-			{
-				beam->status = buffer[offset]; offset+=1;
-			}
-			if (summary->Beam_BitsDefining[0] & BEAM_uc_scaling_factor)
-			{
-				scaling_factor = buffer[offset]; offset+=1;
-			}
-			/* Scale Factor for depth / distance, etc */
-			ScaleFactor = pow(2.0,(double)scaling_factor);
-
-			if (summary->Beam_BitsDefining[0] & BEAM_si_observedDepth)
-			{
-				short_ptr = (short *) &buffer[offset];
-				beam->observedDepth = *short_ptr;
-				beam->observedDepth *= ScaleFactor;
-				offset+=2;
-			}
-			if (summary->Beam_BitsDefining[0] & BEAM_si_acrossTrack)
-			{
-				short_ptr = (short *) &buffer[offset];
-				beam->acrossTrack = *short_ptr;
-				beam->acrossTrack *= ScaleFactor;
-				offset+=2;
-			}
-			if (summary->Beam_BitsDefining[0] & BEAM_si_alongTrack)
-			{
-				short_ptr = (short *) &buffer[offset];
-				beam->alongTrack = *short_ptr;
-				beam->alongTrack *= ScaleFactor;
-				offset+=2;
-			}
-			if (summary->Beam_BitsDefining[0] & BEAM_si_latOffset)
-			{
-				int_ptr = (int *) &buffer[offset];
-				beam->latOffset = *int_ptr;
-				offset+=4;
-			}
-			if (summary->Beam_BitsDefining[0] & BEAM_si_longOffset)
-			{
-				int_ptr = (int *) &buffer[offset];
-				beam->longOffset = *int_ptr;
-				offset+=4;
-			}
-			if (summary->Beam_BitsDefining[0] & BEAM_si_processedDepth)
-			{
-				short_ptr = (short *) &buffer[offset];
-				beam->processedDepth = *short_ptr;
-				beam->processedDepth *= ScaleFactor;
-				offset+=2;
-			}
-			if (summary->Beam_BitsDefining[0] & BEAM_si_timeOffset)
-			{
-				int_ptr = (int *) &buffer[offset];
-				beam->timeOffset = *int_ptr;
-				offset+=4;
-			}
-			if (summary->Beam_BitsDefining[0] & BEAM_si_depthAccuracy)
-			{
-				short_ptr = (short *) &buffer[offset];
-				beam->depthAccuracy = *short_ptr;
-				beam->depthAccuracy *= ScaleFactor;
-				offset+=2;
-			}
-			}
-
-			if (summary->Beam_BitsDefining[1])
-			{
-			if (summary->Beam_BitsDefining[1] & BEAM_uc_reflectivity)
-			{
-				beam->reflectivity = buffer[offset];
-				offset+=1;
-			}
-			if (summary->Beam_BitsDefining[1] & BEAM_sc_Q_factor)
-			{
-				beam->Q_factor = buffer[offset];
-				offset+=1;
-			}
-			if (summary->Beam_BitsDefining[1] & BEAM_uc_beam_no)
-			{
-				beam->beam_no = buffer[offset];
-				offset+=1;
-			}
-			if (summary->Beam_BitsDefining[1] & BEAM_uc_freq)
-			{
-				beam->freq = buffer[offset];
-				offset+=1;
-			}
-			if (summary->Beam_BitsDefining[1] & BEAM_uc_calibratedBackscatter)
-			{
-				beam->calibratedBackscatter = buffer[offset];
-				offset+=1;
-			}
-			if (summary->Beam_BitsDefining[1] & BEAM_uc_mindB)
-			{
-				beam->mindB = buffer[offset];
-				offset+=1;
-			}
-			if (summary->Beam_BitsDefining[1] & BEAM_uc_maxdB)
-			{
-				beam->maxdB = buffer[offset];
-				offset+=1;
-			}
-			if (summary->Beam_BitsDefining[1] & BEAM_uc_pseudoAngleIndependentBackscatter)
-			{
-				beam->pseudoAngleIndependentBackscatter = buffer[offset];
-				offset+=1;
-			}
-			}
-
-			if (summary->Beam_BitsDefining[2])
-			{
-			if (summary->Beam_BitsDefining[2] & BEAM_ui_range)
-			{
-				short_ptr = (short *) &buffer[offset];
-				beam->range = *short_ptr;
-				offset+=2;
-			}
-			if (summary->Beam_BitsDefining[2] & BEAM_ui_no_samples)
-			{
-				short_ptr = (short *) &buffer[offset];
-				beam->no_samples = *short_ptr;
-				offset+=2;
-			}
-			if (summary->Beam_BitsDefining[2] & BEAM_ui_offset)
-			{
-				int_ptr = (int *) &buffer[offset];
-				beam->offset = *int_ptr;
-				offset+=4;
-			}
-			if (summary->Beam_BitsDefining[2] & BEAM_si_centre_no)
-			{
-				short_ptr = (short *) &buffer[offset];
-				beam->centre_no = *short_ptr;
-				offset+=2;
-			}
-			if (summary->Beam_BitsDefining[2] & BEAM_uc_sample_unit)
-			{
-				beam->sample_unit = buffer[offset];
-				offset+=1;
-			}
-			if (summary->Beam_BitsDefining[2] & BEAM_uc_sample_interval)
-			{
-				beam->sample_interval = buffer[offset];
-				offset+=1;
-			}
-			if (summary->Beam_BitsDefining[2] & BEAM_uc_dummy0)
-			{
-				beam->dummy[0] = buffer[offset];
-				offset+=1;
-			}
-			if (summary->Beam_BitsDefining[2] & BEAM_uc_dummy1)
-			{
-				beam->dummy[1] = buffer[offset];
-				offset+=1;
-			}
-			if (summary->Beam_BitsDefining[2] & BEAM_uc_samp_win_length)
-			{
-				beam->samp_win_length = buffer[offset];
-				offset+=1;
-			}
-			}
-
-			if (summary->Beam_BitsDefining[3])
-			{
-			if (summary->Beam_BitsDefining[3] & BEAM_ss_beam_depress_angle)
-			{
-				short_ptr = (short *) &buffer[offset];
-				beam->beam_depress_angle = *short_ptr;
-				offset+=2;
-			}
-			if (summary->Beam_BitsDefining[3] & BEAM_us_beam_heading_angle)
-			{
-				short_ptr = (short *) &buffer[offset];
-				beam->beam_heading_angle = *short_ptr;
-				offset+=2;
-			}
-			if (summary->Beam_BitsDefining[3] & BEAM_us_other_range)
-			{
-				short_ptr = (short *) &buffer[offset];
-				beam->other_range = *short_ptr;
-				offset+=2;
-			}
-			if (summary->Beam_BitsDefining[3] & BEAM_ss_Tx_steer)
-			{
-				short_ptr = (short *) &buffer[offset];
-				beam->Tx_steer = *short_ptr;
-				offset+=2;
-			}
-			if (summary->Beam_BitsDefining[3] & BEAM_ss_Rc_steer)
-			{
-				short_ptr = (short *) &buffer[offset];
-				beam->Rc_steer = *short_ptr;
-				offset+=2;
-			}
-			if (summary->Beam_BitsDefining[3] & BEAM_uc_TxSector)
-			{
-				beam->TxSector = buffer[offset];
-				offset+=1;
-			}
-			}
-
-			if (summary->Beam_BitsDefining[4])
-			{
-			if (summary->Beam_BitsDefining[4] & BEAM_ui_timestampOffset)
-			{
-				int_ptr = (int *) &buffer[offset];
-				beam->timestampOffset = *int_ptr;
-				offset+=4;
-			}
-			if (summary->Beam_BitsDefining[4] & BEAM_us_no_RAMAN)
-			{
-				short_ptr = (short *) &buffer[offset];
-				beam->no_RAMAN = *short_ptr;
-				offset+=2;
-			}
-			if (summary->Beam_BitsDefining[4] & BEAM_us_no_IR)
-			{
-				short_ptr = (short *) &buffer[offset];
-				beam->no_IR = *short_ptr;
-				offset+=2;
-			}
-			if (summary->Beam_BitsDefining[4] & BEAM_us_no_GAPD)
-			{
-				short_ptr = (short *) &buffer[offset];
-				beam->no_GAPD = *short_ptr;
-				offset+=2;
-			}
-			if (summary->Beam_BitsDefining[4] & BEAM_us_no_PMT)
-			{
-				short_ptr = (short *) &buffer[offset];
-				beam->no_PMT = *short_ptr;
-				offset+=2;
-			}
-			if (summary->Beam_BitsDefining[4] & BEAM_uc_prim_depth_conf)
-			{
-				beam->prim_depth_conf = buffer[offset];
-				offset+=1;
-			}
-			if (summary->Beam_BitsDefining[4] & BEAM_uc_seco_depth_conf)
-			{
-				beam->seco_depth_conf = buffer[offset];
-				offset+=1;
-			}
-			if (summary->Beam_BitsDefining[4] & BEAM_ss_scan_azimuth)
-			{
-				short_ptr = (short *) &buffer[offset];
-				beam->scan_azimuth = *short_ptr;
-				offset+=2;
-			}
-			if (summary->Beam_BitsDefining[4] & BEAM_us_nadir_angle)
-			{
-				short_ptr = (short *) &buffer[offset];
-				beam->nadir_angle = *short_ptr;
-				offset+=2;
-			}
-			if (summary->Beam_BitsDefining[4] & BEAM_si_secondaryDepth)
-			{
-				short_ptr = (short *) &buffer[offset];
-				beam->secondaryDepth = *short_ptr;
-				beam->secondaryDepth *= ScaleFactor;
-				offset+=2;
-			}
-			if (summary->Beam_BitsDefining[4] & BEAM_ss_wave_height)
-			{
-				short_ptr = (short *) &buffer[offset];
-				beam->wave_height = *short_ptr;
-				offset+=2;
-			}
-			if (summary->Beam_BitsDefining[4] & BEAM_si_opaqueDepth_PMT)
-			{
-				int_ptr = (int *) &buffer[offset];
-				beam->opaqueDepth_PMT = *int_ptr;
-				offset+=4;
-			}
-			if (summary->Beam_BitsDefining[4] & BEAM_si_extinctionDepth_PMT)
-			{
-				int_ptr = (int *) &buffer[offset];
-				beam->extinctionDepth_PMT = *int_ptr;
-				offset+=4;
-			}
-			if (summary->Beam_BitsDefining[4] & BEAM_si_pimDepth_PMT)
-			{
-				int_ptr = (int *) &buffer[offset];
-				beam->pimDepth_PMT = *int_ptr;
-				offset+=4;
-			}
-			if (summary->Beam_BitsDefining[4] & BEAM_si_opaqueDepth_GAPD)
-			{
-				int_ptr = (int *) &buffer[offset];
-				beam->opaqueDepth_GAPD = *int_ptr;
-				offset+=4;
-			}
-			if (summary->Beam_BitsDefining[4] & BEAM_si_extinctionDepth_GAPD)
-			{
-				int_ptr = (int *) &buffer[offset];
-				beam->extinctionDepth_GAPD = *int_ptr;
-				offset+=4;
-			}
-			if (summary->Beam_BitsDefining[4] & BEAM_si_pimDepth_GAPD)
-			{
-				int_ptr = (int *) &buffer[offset];
-				beam->pimDepth_GAPD = *int_ptr;
-				offset+=4;
-			}
-			}
-
-			if (summary->Beam_BitsDefining[5])
-			{
-			if (summary->Beam_BitsDefining[5] & BEAM_f_twtt)
-			{
-				float_ptr = (float *)&buffer[offset];
-				beam->twtt = *float_ptr;
-				offset+=4;
-			}
-			if (summary->Beam_BitsDefining[5] & BEAM_ui_snippet_first_sample)
-			{
-				int_ptr = (int *) &buffer[offset];
-				beam->snippet_first_sample = *int_ptr;
-				offset+=4;
-			}
-			if (summary->Beam_BitsDefining[5] & BEAM_ui_snippet_last_sample)
-			{
-				int_ptr = (int *) &buffer[offset];
-				beam->snippet_last_sample = *int_ptr;
-				offset+=4;
-			}
-			if (summary->Beam_BitsDefining[5] & BEAM_f_intensity)
-			{
-				float_ptr = (float *) &buffer[offset];
-				beam->intensity = *float_ptr;
-				offset+=4;
-			}
-			}
-
-#endif
-/*
-		fprintf(stdout, "BOB -- Beam=%d Scale=%d Obs.Depth=%d Proc.Depth=%d Acrosstrack Distance=%d\n",
-				i, ScaleFactor, beam->observedDepth, beam->processedDepth,
-				beam->acrossTrack);
-*/
-			}
-
-		    }
-		profile_cnt++;
-		}
-
-	    /* now deal with sidescan in parallel file */
-	    if (status == MB_SUCCESS
-		&& mb_io_ptr->mbfp2 != NULL
-		&& (summary->toolType == MBSYS_HDCS_EM1000
-		    || summary->toolType == MBSYS_HDCS_EM12_single
-		    || summary->toolType == MBSYS_HDCS_EM12_dual
-		    || summary->toolType == MBSYS_HDCS_EM300
-		    || summary->toolType == MBSYS_HDCS_EM3000
-		    || summary->toolType == MBSYS_HDCS_EM3000D
-		    || summary->toolType == MBSYS_HDCS_EM121A
-		    || summary->toolType == MBSYS_HDCS_EM1002
-		    || summary->toolType == MBSYS_HDCS_EM120
-		    || summary->toolType == MBSYS_HDCS_EM122
-	            || summary->toolType == MBSYS_HDCS_EM302
-		    || summary->toolType == MBSYS_HDCS_SeaBat_8125
-		    || summary->toolType == MBSYS_HDCS_SeaBat_8111
-		    || summary->toolType == MBSYS_HDCS_SeaBat_8150
-		    || summary->toolType == MBSYS_HDCS_EM3002
-		    || summary->toolType == MBSYS_HDCS_EM710
-		    || summary->toolType == MBSYS_HDCS_EM3002
-		    || summary->toolType == MBSYS_HDCS_EM3002D
-		    || summary->toolType == MBSYS_HDCS_SeaBat_8160))
-		{
-		/* count samples and get first offset */
-		nrawpixels = 0;
-		ssrawoffset = 0;
-		firstgoodbeam = MB_YES;
-		for (i=0;i<profile->numDepths;i++)
-		    {
-		    beam = &data->beams[i];
-		    if (beam->no_samples > 0)
-			{
-			nrawpixels += beam->no_samples;
-			if (firstgoodbeam == MB_YES)
-			    {
-			    ssrawoffset = beam->offset;
-			    firstgoodbeam = MB_NO;
-			    }
-			}
-		    }
-
-		/* allocate memory if required */
-		if (*image_size < nrawpixels
-		    || data->ss_raw == NULL)
-		    {
-		    *image_size = nrawpixels;
-		    if (data->ss_raw != NULL)
-			status = mb_freed(verbose,__FILE__, __LINE__, (void **)&data->ss_raw,error);
-		    status = mb_mallocd(verbose,__FILE__,__LINE__,
-				    *image_size,
-				    (void **)&data->ss_raw,error);
-		    }
-
-		/* read the sidescan */
-		if (status == MB_SUCCESS)
-		    {
-		    /* first read spare bytes if any */
-		    if (ssrawoffset > mb_io_ptr->file2_bytes)
-			{
-			for (i=mb_io_ptr->file2_bytes;i<ssrawoffset;i++)
-			    {
-			    if ((read_size = fread(data->ss_raw,1,
-				1,mb_io_ptr->mbfp2)) != 1)
-				{
-				/* close the secondary file and deallocate memory */
-				fclose(mb_io_ptr->mbfp2);
-				mb_io_ptr->mbfp2 = NULL;
-				if (data->ss_raw != NULL)
-				    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&data->ss_raw,error);
-				}
-			    else
-				{
-				mb_io_ptr->file2_bytes += read_size;
-				}
-			    }
-			}
-
-		    /* now read the real data */
-		    if ((read_size = fread(data->ss_raw,1,
-			nrawpixels,mb_io_ptr->mbfp2))
-			!= nrawpixels)
-			{
-			/* close the secondary file and deallocate memory */
-			fclose(mb_io_ptr->mbfp2);
-			mb_io_ptr->mbfp2 = NULL;
-			if (data->ss_raw != NULL)
-			    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&data->ss_raw,error);
-			}
-		    else
-			{
-			mb_io_ptr->file2_bytes += read_size;
-			profile->numSamples = nrawpixels;
-			}
-		    }
-		}
-	    }
-
-	/* set kind and error in mb_io_ptr */
-	mb_io_ptr->new_kind = dataplus->kind;
-	mb_io_ptr->new_error = *error;
-
-	/* print debug statements */
-	if (verbose >= 5 && status == MB_FAILURE)
-	    {
-	    fprintf(stderr,"\ndbg5  Read failure in function <%s>\n",
-		    function_name);
-	    fprintf(stderr,"dbg5       status:     %d\n",status);
-	    fprintf(stderr,"dbg5       error:      %d\n",*error);
-	    }
-
-	/* print debug statements */
-	else if (verbose >= 5 && dataplus->kind == MB_DATA_SUMMARY)
-	    {
-	    fprintf(stderr,"\ndbg5  Summary read in function <%s>\n",
-		    function_name);
-	    fprintf(stderr,"dbg5       kind:                   %d\n",dataplus->kind);
-	    fprintf(stderr,"dbg5       sensorNumber:           %d\n",summary->sensorNumber);
-	    fprintf(stderr,"dbg5       subFileID:              %d\n",summary->subFileID);
-	    fprintf(stderr,"dbg5       fileVersion:            %d\n",summary->fileVersion);
-	    fprintf(stderr,"dbg5       toolType:               %d\n",summary->toolType);
-	    fprintf(stderr,"dbg5       toolType name:          %s\n",mbsys_hdcs_tool_names[summary->toolType]);
-	    fprintf(stderr,"dbg5       numProfiles:            %d\n",summary->numProfiles);
-	    fprintf(stderr,"dbg5       numDepths:              %d\n",summary->numDepths);
-	    fprintf(stderr,"dbg5       timeScale:              %d\n",summary->timeScale);
-	    fprintf(stderr,"dbg5       refTime:                %d\n",summary->refTime);
-	    fprintf(stderr,"dbg5       minTime:                %d\n",summary->minTime);
-	    fprintf(stderr,"dbg5       maxTime:                %d\n",summary->maxTime);
-	    fprintf(stderr,"dbg5       positionType:           %d\n",summary->positionType);
-	    fprintf(stderr,"dbg5       positionScale:          %d\n",summary->positionScale);
-	    fprintf(stderr,"dbg5       refLat:                 %d\n",summary->refLat);
-	    fprintf(stderr,"dbg5       minLat:                 %d\n",summary->minLat);
-	    fprintf(stderr,"dbg5       maxLat:                 %d\n",summary->maxLat);
-	    fprintf(stderr,"dbg5       refLong:                %d\n",summary->refLong);
-	    fprintf(stderr,"dbg5       minLong:                %d\n",summary->minLong);
-	    fprintf(stderr,"dbg5       maxLong:                %d\n",summary->maxLong);
-	    fprintf(stderr,"dbg5       minObsDepth:            %d\n",summary->minObsDepth);
-	    fprintf(stderr,"dbg5       maxObsDepth:            %d\n",summary->maxObsDepth);
-	    fprintf(stderr,"dbg5       minProcDepth:           %d\n",summary->minProcDepth);
-	    fprintf(stderr,"dbg5       maxProcDepth:           %d\n",summary->maxProcDepth);
-	    fprintf(stderr,"dbg5       status:                 %d\n",summary->status);
-	    fprintf(stderr,"dbg5       status:                 %d\n",status);
-	    fprintf(stderr,"dbg5       error:                  %d\n",*error);
-	    }
-
-	/* print debug statements */
-	else if (verbose >= 5 && dataplus->kind == MB_DATA_COMMENT)
-	    {
-	    fprintf(stderr,"\ndbg5  New header comment in function <%s>\n",function_name);
-	    fprintf(stderr,"dbg5       kind:                   %d\n",dataplus->kind);
-	    fprintf(stderr,"dbg5       comment:                %s\n",dataplus->comment);
-	    fprintf(stderr,"dbg5       status:                 %d\n",status);
-	    fprintf(stderr,"dbg5       error:                  %d\n",*error);
-	    }
-
-	/* print debug statements */
-	else if (verbose >= 5 && dataplus->kind == MB_DATA_DATA)
-	    {
-	    fprintf(stderr,"\ndbg5  New profile read in function <%s>\n",
-		    function_name);
-	    fprintf(stderr,"dbg5       kind:                   %d\n",dataplus->kind);
-	    fprintf(stderr,"dbg5       status:                 %d\n",profile->status);
-	    fprintf(stderr,"dbg5       numDepths:              %d\n",profile->numDepths);
-	    fprintf(stderr,"dbg5       numSamples:             %d\n",profile->numSamples);
-	    fprintf(stderr,"dbg5       timeOffset:             %d\n",profile->timeOffset);
-	    fprintf(stderr,"dbg5       vesselLatOffset:        %d\n",profile->vesselLatOffset);
-	    fprintf(stderr,"dbg5       vesselLongOffset:       %d\n",profile->vesselLongOffset);
-	    fprintf(stderr,"dbg5       vesselHeading:          %d\n",profile->vesselHeading);
-	    fprintf(stderr,"dbg5       vesselHeave:            %d\n",profile->vesselHeave);
-	    fprintf(stderr,"dbg5       vesselPitch:            %d\n",profile->vesselPitch);
-	    fprintf(stderr,"dbg5       vesselRoll:             %d\n",profile->vesselRoll);
-	    fprintf(stderr,"dbg5       tide:                   %d\n",profile->tide);
-	    fprintf(stderr,"dbg5       vesselVelocity:         %d\n",profile->vesselVelocity);
-	    fprintf(stderr,"dbg5       power:                  %d\n",profile->power);
-	    fprintf(stderr,"dbg5       TVG:                    %d\n",profile->TVG);
-	    fprintf(stderr,"dbg5       attenuation:            %d\n",profile->attenuation);
-	    fprintf(stderr,"dbg5       edflag:                 %d\n",profile->edflag);
-	    fprintf(stderr,"dbg5       soundVelocity:          %d\n",profile->soundVelocity);
-	    fprintf(stderr,"dbg5       lengthImageDataField:   %d\n",profile->lengthImageDataField);
-	    fprintf(stderr,"dbg5       pingNo:                 %d\n",profile->pingNo);
-	    fprintf(stderr,"dbg5       mode:                   %d\n",profile->mode);
-	    fprintf(stderr,"dbg5       Q_factor:               %d\n",profile->Q_factor);
-	    fprintf(stderr,"dbg5       pulseLength:            %d\n",profile->pulseLength);
-	    fprintf(stderr,"dbg5       unassigned:             %d\n",profile->unassigned);
-	    fprintf(stderr,"dbg5       td_sound_speed:         %d\n",profile->td_sound_speed);
-	    fprintf(stderr,"dbg5       samp_rate:              %d\n",profile->samp_rate);
-	    fprintf(stderr,"dbg5       z_res_cm:               %d\n",profile->z_res_cm);
-	    fprintf(stderr,"dbg5       xy_res_cm:              %d\n",profile->xy_res_cm);
-	    fprintf(stderr,"dbg5       ssp_source:             %d\n",profile->ssp_source);
-	    fprintf(stderr,"dbg5       filter_ID:              %d\n",profile->filter_ID);
-	    fprintf(stderr,"dbg5       absorp_coeff:           %d\n",profile->absorp_coeff);
-	    fprintf(stderr,"dbg5       tx_pulse_len:           %d\n",profile->tx_pulse_len);
-	    fprintf(stderr,"dbg5       tx_beam_width:          %d\n",profile->tx_beam_width);
-	    fprintf(stderr,"dbg5       max_swath_width:        %d\n",profile->max_swath_width);
-	    fprintf(stderr,"dbg5       tx_power_reduction:     %d\n",profile->tx_power_reduction);
-	    fprintf(stderr,"dbg5       rx_beam_width:          %d\n",profile->rx_beam_width);
-	    fprintf(stderr,"dbg5       rx_bandwidth:           %d\n",profile->rx_bandwidth);
-	    fprintf(stderr,"dbg5       rx_gain_reduction:      %d\n",profile->rx_gain_reduction);
-	    fprintf(stderr,"dbg5       tvg_crossover:          %d\n",profile->tvg_crossover);
-	    fprintf(stderr,"dbg5       beam_spacing:           %d\n",profile->beam_spacing);
-	    fprintf(stderr,"dbg5       coverage_sector:        %d\n",profile->coverage_sector);
-	    fprintf(stderr,"dbg5       yaw_stab_mode:          %d\n",profile->yaw_stab_mode);
-	    fprintf(stderr,"dbg5       status:                 %d\n",status);
-	    fprintf(stderr,"dbg5       error:                  %d\n",*error);
-	    for (i=0;i<profile->numDepths;i++)
-		{
-		beam = &data->beams[i];
-		fprintf(stderr,"dbg5       status[%4d]:            %d\n",
-			     i, beam->status);
-		fprintf(stderr,"dbg5       observedDepth[%4d]:     %d\n",
-			     i, beam->observedDepth);
-		fprintf(stderr,"dbg5       acrossTrack[%4d]:       %d\n",
-			     i, beam->acrossTrack);
-		fprintf(stderr,"dbg5       alongTrack[%4d]:        %d\n",
-			     i, beam->alongTrack);
-		fprintf(stderr,"dbg5       latOffset[%4d]:         %d\n",
-			     i, beam->latOffset);
-		fprintf(stderr,"dbg5       longOffset[%4d]:        %d\n",
-			     i, beam->longOffset);
-		fprintf(stderr,"dbg5       processedDepth[%4d]:    %d\n",
-			     i, beam->processedDepth);
-		fprintf(stderr,"dbg5       timeOffset[%4d]:        %d\n",
-			     i, beam->timeOffset);
-		fprintf(stderr,"dbg5       depthAccuracy[%4d]:     %d\n",
-			     i, beam->depthAccuracy);
-		fprintf(stderr,"dbg5       reflectivity[%4d]:      %d\n",
-			     i, beam->reflectivity);
-		fprintf(stderr,"dbg5       Q_factor[%4d]:          %d\n",
-			     i, beam->Q_factor);
-		fprintf(stderr,"dbg5       beam_no[%4d]:           %d\n",
-			     i, beam->beam_no);
-		fprintf(stderr,"dbg5       freq[%4d]:              %d\n",
-			     i, beam->freq);
-		fprintf(stderr,"dbg5       calibBackscatter[%4d]:  %d\n",
-			     i, beam->calibratedBackscatter);
-		fprintf(stderr,"dbg5       mindB[%4d]:             %d\n",
-			     i, beam->mindB);
-		fprintf(stderr,"dbg5       maxdB[%4d]:             %d\n",
-			     i, beam->maxdB);
-		fprintf(stderr,"dbg5       AngleIndepBacks[%4d]:   %d\n",
-			     i, beam->pseudoAngleIndependentBackscatter);
-		fprintf(stderr,"dbg5       range[%4d]:             %d\n",
-			     i, beam->range);
-		fprintf(stderr,"dbg5       no_samples[%4d]:        %d\n",
-			     i, beam->no_samples);
-		fprintf(stderr,"dbg5       offset[%4d]:            %d\n",
-			     i, beam->offset);
-		fprintf(stderr,"dbg5       centre_no[%4d]:         %d\n",
-			     i, beam->centre_no);
-		fprintf(stderr,"dbg5       sample_unit[%4d]:       %d\n",
-			     i, beam->sample_unit);
-		fprintf(stderr,"dbg5       sample_interval[%4d]:   %d\n",
-			     i, beam->sample_interval);
-		fprintf(stderr,"dbg5       dummy0[%4d]:            %d\n",
-			     i, beam->dummy[0]);
-		fprintf(stderr,"dbg5       dummy1[%4d]:            %d\n",
-			     i, beam->dummy[1]);
-		fprintf(stderr,"dbg5       samp_win_length[%4d]:   %d\n",
-			     i, beam->samp_win_length);
-		fprintf(stderr,"dbg5       beam_depress_angle[%4d]:%d\n",
-			     i, beam->beam_depress_angle);
-		fprintf(stderr,"dbg5       beam_heading_angle[%4d]:%d\n",
-			     i, beam->beam_heading_angle);
-		}
-	    for (i=0;i<profile->numSamples;i++)
-		fprintf(stderr,"dbg5       sidescan sample[%4d]:%d\n",
-			     i, data->ss_raw[i]);
-	    fprintf(stderr,"dbg5       status:     %d\n",status);
-	    fprintf(stderr,"dbg5       error:      %d\n",*error);
-	    }
-
-	/* process sidescan */
-	if (status == MB_SUCCESS
-		&& dataplus->kind == MB_DATA_DATA)
-	    {
-
-	    /* read depth and beam location values into storage arrays */
-	    nbathsort = 0;
-	    swathwidth = 0.0;
-	    for (i=0;i<profile->numDepths;i++)
-		{
-		beam = &data->beams[i];
-		if (beam->observedDepth != 0
-		    && (beam->status == 0 || beam->status == 22))
-		    {
-		    bathsort[nbathsort] = 0.001 * (abs(beam->observedDepth)
-							- profile->tide);
-		    nbathsort++;
-		    swathwidth = MAX(swathwidth, 2.5 + 90.0 - 0.01 * beam->beam_depress_angle);
-		    }
-		}
-
-	    /* process raw sidescan if available */
-	    if (profile->numSamples <= 0
-		|| profile->numSamples > 10000)
-		{
-		pixels_ss = 0;
-		}
-	    else
-		{
-		/* zero arrays */
-		for (k=0;k<MBF_OMGHDCSJ_MAX_PIXELS;k++)
-		    {
-		    ss[k] = 0.0;
-		    ss_alongtrack[k] = 0.0;
-		    ss_cnt[k] = 0;
-		    }
-
-		/* get median depth and sidescan pixel size */
-		qsort((char *)bathsort, nbathsort, sizeof(double),(void *)mb_double_compare);
-		pixel_size_calc = 2 * tan(DTR * swathwidth) * bathsort[nbathsort/2]
-				    / MBF_OMGHDCSJ_MAX_PIXELS;
-		pixel_size_calc = MAX(pixel_size_calc, bathsort[nbathsort/2] * sin(DTR * 0.1));
-		if (*pixel_size <= 0.0)
-		    *pixel_size = pixel_size_calc;
-		else if (0.95 * (*pixel_size) > pixel_size_calc)
-		    *pixel_size = 0.95 * (*pixel_size);
-		else if (1.05 * (*pixel_size) < pixel_size_calc)
-		    *pixel_size = 1.05 * (*pixel_size);
-		else
-		    *pixel_size = pixel_size_calc;
-
-		/* get raw pixel size */
-		if (profile->samp_rate > 0)
-		    ss_spacing = 750.0 / profile->samp_rate;
-		else if (summary->toolType == MBSYS_HDCS_EM3000
-			|| summary->toolType == MBSYS_HDCS_EM3000D)
-		    ss_spacing = 750.0 / 14000;
-		else if (summary->toolType == MBSYS_HDCS_EM300)
-		    ss_spacing = 750.0 / 4512;
-		else if (summary->toolType == MBSYS_HDCS_EM1000
-			|| summary->toolType == MBSYS_HDCS_EM12_single
-			|| summary->toolType == MBSYS_HDCS_EM12_dual
-			|| summary->toolType == MBSYS_HDCS_EM121A
-			|| summary->toolType == MBSYS_HDCS_EM1002
-			|| summary->toolType == MBSYS_HDCS_EM120
-			|| summary->toolType == MBSYS_HDCS_SeaBat_8125
-			|| summary->toolType == MBSYS_HDCS_SeaBat_8111
-			|| summary->toolType == MBSYS_HDCS_SeaBat_8150
-			|| summary->toolType == MBSYS_HDCS_EM3002
-			|| summary->toolType == MBSYS_HDCS_EM710
-			|| summary->toolType == MBSYS_HDCS_EM3002
-			|| summary->toolType == MBSYS_HDCS_EM3002D
-			|| summary->toolType == MBSYS_HDCS_SeaBat_8160)
-		    {
-		    if (profile->power == 1)
-			    ss_spacing = 0.6;
-		    else if (profile->power == 2)
-			    ss_spacing = 2.4;
-		    else if (profile->power == 3)
-			    ss_spacing = 0.3;
-		    else if (profile->power == 4)
-			    ss_spacing = 0.3;
-		    else
-			    ss_spacing = 0.15;
-		    }
-
-		/* loop over raw sidescan, putting each raw pixel into
-			the binning arrays */
-		offset_start = -1;
-		sample_count = 0;
-		pixels_ss = MBF_OMGHDCSJ_MAX_PIXELS;
-		for (i=0;i<profile->numDepths;i++)
-		    {
-		    beam = &data->beams[i];
-		    if (beam->observedDepth != 0
-			&& (beam->status == 0 || beam->status == 22))
-			{
-			if (offset_start == -1
-				&& beam->no_samples > 0)
-			    offset_start = beam->offset;
-			else if ((beam->offset - offset_start)
-			    > sample_count)
-			    offset_start = beam->offset - sample_count;
-			else if (beam->offset <= 0 && offset_start > 0)
-			    beam->offset = offset_start + sample_count;
-			sample_count += beam->no_samples;
-/*fprintf(stderr, "i:%d flag:%d samples:%d sample_cnt:%d offset:%d offset_start:%d\n",
-i, mb_io_ptr->new_beamflag[i], beam->no_samples,
-sample_count, beam->offset, offset_start);
-*/
-			for (j=0;j<beam->no_samples;j++)
-			    {
-			    jj = j + beam->offset - offset_start;
-
-			    /* interpolate based on range */
-			    xtrack = 0.001 * beam->acrossTrack
-				+ ss_spacing * (j - abs(beam->centre_no));
-
-			    k = MBF_OMGHDCSJ_MAX_PIXELS / 2
-				+ (int)(xtrack / *pixel_size);
-			    if (beam->status == 0
-				&& k > 0 && k < MBF_OMGHDCSJ_MAX_PIXELS)
-				{
-				ss[k] += 0.5*((double)data->ss_raw[jj]) + 64.0;
-				ss_alongtrack[k] += 0.001 * beam->alongTrack;
-				ss_cnt[k]++;
-				}
-			    }
-			}
-		    }
-
-		/* average the sidescan */
-		first = MBF_OMGHDCSJ_MAX_PIXELS;
-		last = -1;
-		for (k=0;k<MBF_OMGHDCSJ_MAX_PIXELS;k++)
-			{
-			if (ss_cnt[k] > 0)
-				{
-				ss[k] /= ss_cnt[k];
-				ss_alongtrack[k] /= ss_cnt[k];
-				first = MIN(first, k);
-				last = k;
-				}
-			}
-
-		/* interpolate the sidescan */
-		k1 = first;
-		k2 = first;
-		for (k=first+1;k<last;k++)
-		    {
-		    if (ss_cnt[k] <= 0)
-			{
-			if (k2 <= k)
-			    {
-			    k2 = k+1;
-			    while (ss_cnt[k2] <= 0 && k2 < last)
-				k2++;
-			    }
-			ss[k] = ss[k1]
-			    + (ss[k2] - ss[k1])
-				* ((double)(k - k1)) / ((double)(k2 - k1));
-			ss_alongtrack[k] = ss_alongtrack[k1]
-			    + (ss_alongtrack[k2] - ss_alongtrack[k1])
-				* ((double)(k - k1)) / ((double)(k2 - k1));
-			}
-		    else
-			{
-			k1 = k;
-			}
-		    }
-		}
-
-	    /* done processing sidescan */
-
-	    }
-
-	/* translate values to data storage structure */
-	if (status == MB_SUCCESS
-		&& store != NULL)
-	    {
-	    /* type of data record */
-	    store->kind = dataplus->kind;
-	    store->read_summary = *read_summary;
-	    store->fileVersion = *fileVersion;
-	    store->toolType = *toolType;
-	    store->profile_size = *profile_size;
-	    store->num_beam = *num_beam;
-	    store->beam_size = *beam_size;
-	    store->data_size = *data_size;
-	    store->image_size = *image_size;
-
-	    if (dataplus->kind == MB_DATA_SUMMARY
-		|| dataplus->kind == MB_DATA_DATA)
-		{
-		/* summary values */
-		store->sensorNumber = summary->sensorNumber;
-		store->subFileID = summary->subFileID;
-		store->fileVersion = summary->fileVersion;
-		store->toolType = summary->toolType;
-		store->numProfiles = summary->numProfiles;
-		store->numDepths_sum = summary->numDepths;
-		store->timeScale = summary->timeScale;
-		store->refTime = summary->refTime;
-		store->minTime = summary->minTime;
-		store->maxTime = summary->maxTime;
-		store->positionType = summary->positionType;
-		store->positionScale = summary->positionScale;
-		store->refLat = summary->refLat;
-		store->minLat = summary->minLat;
-		store->maxLat = summary->maxLat;
-		store->refLong = summary->refLong;
-		store->minLong = summary->minLong;
-		store->maxLong = summary->maxLong;
-		store->minObsDepth = summary->minObsDepth;
-		store->maxObsDepth = summary->maxObsDepth;
-		store->minProcDepth = summary->minProcDepth;
-		store->maxProcDepth = summary->maxProcDepth;
-		store->status_sum = summary->status;
-		/* V4 */
-		store->totalProfileBytes = summary->totalProfileBytes;
-		for (i = 0; i < 20; i++)
-			store->Profile_BitsDefining[i] = summary->Profile_BitsDefining[i];
-		store->totalBeamBytes = summary->totalBeamBytes;
-		for (i = 0; i < 20; i++)
-			store->Beam_BitsDefining[i] = summary->Beam_BitsDefining[i];
-		}
-
-	    if (dataplus->kind == MB_DATA_DATA)
-		{
-		/* profile values */
-		store->status_pro = profile->status;
-		store->numDepths_pro = profile->numDepths;
-		store->timeOffset = profile->timeOffset;
-		store->vesselLatOffset = profile->vesselLatOffset;
-		store->vesselLongOffset = profile->vesselLongOffset;
-		store->vesselHeading = profile->vesselHeading;
-		store->vesselHeave = profile->vesselHeave;
-		store->vesselPitch = profile->vesselPitch;
-		store->vesselRoll = profile->vesselRoll;
-		store->tide = profile->tide;
-		store->vesselVelocity = profile->vesselVelocity;
-		store->power = profile->power;
-		store->TVG = profile->TVG;
-		store->attenuation = profile->attenuation;
-		store->edflag = profile->edflag;
-		store->soundVelocity = profile->soundVelocity;
-		store->lengthImageDataField = profile->lengthImageDataField;
-		store->pingNo = profile->pingNo;
-		store->mode = profile->mode;
-		store->Q_factor = profile->Q_factor;
-		store->pulseLength = profile->pulseLength;
-		store->unassigned = profile->unassigned;
-		store->td_sound_speed = profile->td_sound_speed;
-		store->samp_rate = profile->samp_rate;
-		store->z_res_cm = profile->z_res_cm;
-		store->xy_res_cm = profile->xy_res_cm;
-		store->ssp_source = profile->ssp_source;
-		store->filter_ID = profile->filter_ID;
-		store->absorp_coeff = profile->absorp_coeff;
-		store->tx_pulse_len = profile->tx_pulse_len;
-		store->tx_beam_width = profile->tx_beam_width;
-		store->max_swath_width = profile->max_swath_width;
-		store->tx_power_reduction = profile->tx_power_reduction;
-		store->rx_beam_width = profile->rx_beam_width;
-		store->rx_bandwidth = profile->rx_bandwidth;
-		store->rx_gain_reduction = profile->rx_gain_reduction;
-		store->tvg_crossover = profile->tvg_crossover;
-		store->beam_spacing = profile->beam_spacing;
-		store->coverage_sector = profile->coverage_sector;
-		store->yaw_stab_mode = profile->yaw_stab_mode;
-
-		/* V4 */
-		for( i = 0 ; i < 2; i++)
-		{
-			store->params[i].txBeamIndex = profile->params[i].txBeamIndex;
-			store->params[i].txLevel = profile->params[i].txLevel;
-			store->params[i].txBeamAngle = profile->params[i].txBeamAngle;
-			store->params[i].txPulseLength = profile->params[i].txPulseLength;
-			store->params[i].ss_offset = profile->params[i].ss_offset;
-			store->params[i].no_skipped_ss = profile->params[i].no_skipped_ss;
-			store->params[i].no_acquired_ss = profile->params[i].no_acquired_ss;
-			store->params[i].ss_sample_interval = profile->params[i].ss_sample_interval;
-			store->params[i].bscatClass = profile->params[i].bscatClass;
-			store->params[i].nrActualGainSets = profile->params[i].nrActualGainSets;
-			store->params[i].rxGup = profile->params[i].rxGup;
-			store->params[i].rxGain = profile->params[i].rxGain;
-			store->params[i].ar = profile->params[i].ar;
-			for (k = 0; k < 20; k++)
-				store->params[i].rxtime[k] = profile->params[i].rxtime[k];
-			for (k = 0; k < 20; k++)
-				store->params[i].rxgain[k] = profile->params[i].rxgain[k];
-		}
-		store->transducerDepth = profile->transducerDepth;
-		store->transducerPitch = profile->transducerPitch;
-		store->transducerRoll = profile->transducerRoll;
-		store->transducerHeading = profile->transducerHeading;
-		store->transducerLatOffset = profile->transducerLatOffset;
-		store->transducerLongOffset = profile->transducerLongOffset;
-		store->transducerSlantRange = profile->transducerSlantRange;
-		store->transducerAcross = profile->transducerAcross;
-		store->transducerAlong = profile->transducerAlong;
-		store->transducerBearing = profile->transducerBearing;
-		store->longperiod_heaveCorrection = profile->longperiod_heaveCorrection;
-		store->dynamic_draftCorrection = profile->dynamic_draftCorrection;
-		store->deepdraftoffset_in_metres = profile->deepdraftoffset_in_metres;
-		store->draft_at_Tx = profile->draft_at_Tx;
-		store->alternateRoll = profile->alternateRoll;
-		store->alternatePitch = profile->alternatePitch;
-		store->alternateHeave = profile->alternateHeave;
-		store->standaloneHeading = profile->standaloneHeading;
-		store->RTK_at_RP = profile->RTK_at_RP;
-		store->Lowpass_RTK_at_RP = profile->Lowpass_RTK_at_RP;
-		store->WLZ = profile->WLZ;
-		store->samp_rate_SecondHead = profile->samp_rate_SecondHead;
-		store->clock_drift_millis = profile->clock_drift_millis;
-		store->watercol_offset = profile->watercol_offset;
-		store->watercol_size = profile->watercol_size;
-		store->watercol_offset_2nd = profile->watercol_offset_2nd;
-		store->watercol_size_2nd = profile->watercol_size_2nd;
-		store->range_to_normal_incidence = profile->range_to_normal_incidence;
-		store->laser_timestampRef = profile->laser_timestampRef;
-		store->tx_sector_offset = profile->tx_sector_offset;
-		store->num_tx_sectors = profile->num_tx_sectors;
-		store->sonar_settings_offset = profile->sonar_settings_offset;
-		store->ping_number = profile->ping_number;
-		store->multi_ping_sequence = profile->multi_ping_sequence;
-		store->num_beams = profile->num_beams;
-		store->layer_compensation_flag = profile->layer_compensation_flag;
-		store->bs_beam_position = profile->bs_beam_position;
-		store->bs_control_flags = profile->bs_control_flags;
-		store->bs_num_beams_per_side = profile->bs_num_beams_per_side;
-		store->bs_current_beam_number = profile->bs_current_beam_number;
-		store->bs_sample_descriptor = profile->bs_sample_descriptor;
-		store->snippet_sample_descriptor = profile->snippet_sample_descriptor;
-
-
-		/* beams */
-		if (store->beams != NULL)
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->beams,error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,
-				*num_beam * sizeof(struct mbsys_hdcs_beam_struct),
-				(void **)&store->beams,error);
-		if (status == MB_SUCCESS)
-		    {
-		    for (i=0;i<profile->numDepths;i++)
-			{
-			beam = &data->beams[i];
-			sbeam = &store->beams[i];
-
-			sbeam->status = beam->status;
-			sbeam->scaling_factor = beam->scaling_factor;
-			sbeam->observedDepth = beam->observedDepth;
-			sbeam->acrossTrack = beam->acrossTrack;
-			sbeam->alongTrack = beam->alongTrack;
-			sbeam->latOffset = beam->latOffset;
-			sbeam->longOffset = beam->longOffset;
-			sbeam->processedDepth = beam->processedDepth;
-			sbeam->timeOffset = beam->timeOffset;
-			sbeam->depthAccuracy = beam->depthAccuracy;
-			sbeam->reflectivity = beam->reflectivity;
-			sbeam->Q_factor = beam->Q_factor;
-			sbeam->beam_no = beam->beam_no;
-			sbeam->freq = beam->freq;
-			sbeam->calibratedBackscatter = beam->calibratedBackscatter;
-			sbeam->mindB = beam->mindB;
-			sbeam->maxdB = beam->maxdB;
-			sbeam->pseudoAngleIndependentBackscatter = beam->pseudoAngleIndependentBackscatter;
-			sbeam->range = beam->range;
-			sbeam->no_samples = beam->no_samples;
-			sbeam->offset = beam->offset;
-			sbeam->centre_no = beam->centre_no;
-			sbeam->sample_unit = beam->sample_unit;
-			sbeam->sample_interval = beam->sample_interval;
-			sbeam->dummy[0] = beam->dummy[0];
-			sbeam->dummy[1] = beam->dummy[1];
-			sbeam->samp_win_length = beam->samp_win_length;
-			sbeam->beam_depress_angle = beam->beam_depress_angle;
-			sbeam->beam_heading_angle = beam->beam_heading_angle;
-			/* V4 */
-			sbeam->other_range = beam->other_range;
-			sbeam->Tx_steer = beam->Tx_steer;
-			sbeam->Rc_steer = beam->Rc_steer;
-			sbeam->TxSector = beam->TxSector;
-			sbeam->Ifremer_qfactor = beam->Ifremer_qfactor;
-			sbeam->timestampOffset = beam->timestampOffset;
-			sbeam->no_RAMAN = beam->no_RAMAN;
-			sbeam->no_IR = beam->no_IR;
-			sbeam->no_GAPD = beam->no_GAPD;
-			sbeam->no_PMT = beam->no_PMT;
-			sbeam->prim_depth_conf = beam->prim_depth_conf;
-			sbeam->seco_depth_conf = beam->seco_depth_conf;
-			sbeam->scan_azimuth = beam->scan_azimuth;
-			sbeam->nadir_angle = beam->nadir_angle;
-			sbeam->secondaryDepth = beam->secondaryDepth;
-			sbeam->wave_height = beam->wave_height;
-			sbeam->opaqueDepth_PMT = beam->opaqueDepth_PMT;
-			sbeam->extinctionDepth_PMT = beam->extinctionDepth_PMT;
-			sbeam->pimDepth_PMT = beam->pimDepth_PMT;
-			sbeam->opaqueDepth_GAPD = beam->opaqueDepth_GAPD;
-			sbeam->extinctionDepth_GAPD = beam->extinctionDepth_GAPD;
-			sbeam->pimDepth_GAPD = beam->pimDepth_GAPD;
-			sbeam->twtt = beam->twtt;
-			sbeam->snippet_first_sample = beam->snippet_first_sample;
-			sbeam->snippet_last_sample = beam->snippet_last_sample;
-			sbeam->intensity = beam->intensity;
-			}
-		    }
-
-		/* raw sidescan */
-		if (profile->numSamples > 0
-		    && store->numSamples < profile->numSamples
-		    && store->ss_raw != NULL)
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->ss_raw,error);
-		if (profile->numSamples > 0
-		    && data->ss_raw != NULL
-		    && store->ss_raw == NULL)
-		    {
-		    status = mb_mallocd(verbose,__FILE__,__LINE__,
-				    profile->numSamples,
-				    (void **)&store->ss_raw,error);
-		    }
-		if (status == MB_SUCCESS
-		    && profile->numSamples > 0
-		    && data->ss_raw != NULL
-		    && store->ss_raw != NULL)
-		    {
-		    store->numSamples = profile->numSamples;
-		    for (i=0;i<profile->numSamples;i++)
-			{
-			store->ss_raw[i] = data->ss_raw[i];
-			}
-		    }
-
-		/* processed sidescan */
-		if (pixels_ss == MBF_OMGHDCSJ_MAX_PIXELS)
-		    {
-		    store->pixels_ss = pixels_ss;
-		    store->pixel_size = 1000 * (*pixel_size);
-		    for (i=0;i<store->pixels_ss;i++)
-			{
-			store->ss_proc[i] = ss[i];
-			store->ssalongtrack[i]
-				= (short)(1000 * ss_alongtrack[i]);
-			}
-		    }
-		}
-
-	    if (dataplus->kind == MB_DATA_COMMENT)
-		{
-		/* comment */
-		for (i=0;i<MBF_OMGHDCSJ_MAX_COMMENT;i++)
-		    store->comment[i] = dataplus->comment[i];
-		}
-	    }
-
-	/* print output debug statements */
-	if (verbose >= 2)
-	    {
-	    fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-		    function_name);
-	    fprintf(stderr,"dbg2  Return values:\n");
-	    fprintf(stderr,"dbg2       error:      %d\n",*error);
-	    fprintf(stderr,"dbg2  Return status:\n");
-	    fprintf(stderr,"dbg2       status:  %d\n",status);
-	    }
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_wt_omghdcsj(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_wt_omghdcsj";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_omghdcsj_struct *dataplus;
-	struct mbf_omghdcsj_summary_struct *summary;
-	struct mbf_omghdcsj_profile_struct *profile;
-	struct mbf_omghdcsj_data_struct *data;
-	struct mbf_omghdcsj_beam_struct *beam;
-	struct mbsys_hdcs_struct *store;
-	struct mbsys_hdcs_beam_struct *sbeam;
-	int	*write_summary;
-	int	*fileVersion;
-	int	*toolType;
-	int	*profile_size;
-	int	*num_beam;
-	int	*beam_size;
-	int	*data_size;
-	int	*image_size;
-	double	*pixel_size;
-	char	*comment;
-	char	*buffer;
-	int	write_size;
-	int	buff_size;
-	short	*short_ptr;
-	int	*int_ptr;
-	float	*float_ptr;
-	mb_u_char   scaling_factor;
-	int	ScaleFactor;
-	int	MaxVal;
-	int	offset, offset_start;
-	int	sum_size;
-	int	i, k;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-	    {
-	    fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-	    fprintf(stderr,"dbg2  Input arguments:\n");
-	    fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-	    fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-	    fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-	    }
-
-	/* get pointer to mbio descriptor and data structure */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-	store = (struct mbsys_hdcs_struct *) store_ptr;
-
-	/* get pointer to raw data structure */
-	dataplus = (struct mbf_omghdcsj_struct *) mb_io_ptr->raw_data;
-	summary = &(dataplus->summary);
-	profile = &(dataplus->profile);
-	data = &(dataplus->data);
-	comment = dataplus->comment;
-	buffer = dataplus->buffer;
-	write_summary = (int *) &mb_io_ptr->save1;
-	fileVersion = (int *) &mb_io_ptr->save2;
-	toolType = (int *) &mb_io_ptr->save3;
-	profile_size = (int *) &mb_io_ptr->save4;
-	num_beam = (int *) &mb_io_ptr->save5;
-	beam_size = (int *) &mb_io_ptr->save6;
-	data_size = (int *) &mb_io_ptr->save7;
-	image_size = (int *) &mb_io_ptr->save8;
-	pixel_size = (double *) &mb_io_ptr->saved1;
-
-	/* set file position */
-	mb_io_ptr->file_pos = mb_io_ptr->file_bytes;
-	mb_io_ptr->file2_pos = mb_io_ptr->file2_bytes;
-
-	/* first translate values from data storage structure */
-	if (store != NULL)
-	    {
-	    /* type of data record */
-	    dataplus->kind = store->kind;
-	    *write_summary = store->read_summary;
-	    *fileVersion = store->fileVersion;
-	    *toolType = store->toolType;
-	    *profile_size = store->profile_size;
-	    *num_beam = store->num_beam;
-	    *beam_size = store->beam_size;
-	    *data_size = store->data_size;
-	    *image_size = store->image_size;
-
-	    if (dataplus->kind == MB_DATA_SUMMARY
-		|| dataplus->kind == MB_DATA_DATA)
-		{
-		/* summary values */
-		summary->sensorNumber = store->sensorNumber;
-		summary->subFileID = store->subFileID;
-		summary->fileVersion = store->fileVersion;
-		summary->toolType = store->toolType;
-		summary->numProfiles = store->numProfiles;
-		summary->numDepths = store->numDepths_sum;
-		summary->timeScale = store->timeScale;
-		summary->refTime = store->refTime;
-		summary->minTime = store->minTime;
-		summary->maxTime = store->maxTime;
-		summary->positionType = store->positionType;
-		summary->positionScale = store->positionScale;
-		summary->refLat = store->refLat;
-		summary->minLat = store->minLat;
-		summary->maxLat = store->maxLat;
-		summary->refLong = store->refLong;
-		summary->minLong = store->minLong;
-		summary->maxLong = store->maxLong;
-		summary->minObsDepth = store->minObsDepth;
-		summary->maxObsDepth = store->maxObsDepth;
-		summary->minProcDepth = store->minProcDepth;
-		summary->maxProcDepth = store->maxProcDepth;
-		summary->status = store->status_sum;
-		summary->totalProfileBytes = store->totalProfileBytes;
-		for (i = 0; i < 20; i++)
-			summary->Profile_BitsDefining[i] = store->Profile_BitsDefining[i];
-		summary->totalBeamBytes = store->totalBeamBytes;
-		for (i = 0; i < 20; i++)
-			summary->Beam_BitsDefining[i] = store->Beam_BitsDefining[i];
-		}
-
-	    if (dataplus->kind == MB_DATA_SUMMARY)
-		{
-		/* set values to be saved including data record sizes */
-		*write_summary = MB_YES;
-		*fileVersion = summary->fileVersion;
-		*toolType = summary->toolType;
-		if (*fileVersion == 1)
-		    {
-		    *profile_size = mbf_omghdcsj_tooldefs1[*toolType][MBF_OMGHDCSJ_PROFILE_LENGTH];
-		    *num_beam = mbf_omghdcsj_tooldefs1[*toolType][MBF_OMGHDCSJ_MAX_NO_BEAMS];
-		    *beam_size = mbf_omghdcsj_tooldefs1[*toolType][MBF_OMGHDCSJ_BEAM_LENGTH];
-		    *data_size = (*num_beam) * (*beam_size);
-		    *image_size = mbf_omghdcsj_tooldefs1[*toolType][MBF_OMGHDCSJ_IMAGE_LENGTH];
-		    }
-		else if (*fileVersion == 2)
-		    {
-		    *profile_size = mbf_omghdcsj_tooldefs2[*toolType][MBF_OMGHDCSJ_PROFILE_LENGTH];
-		    *num_beam = mbf_omghdcsj_tooldefs2[*toolType][MBF_OMGHDCSJ_MAX_NO_BEAMS];
-		    *beam_size = mbf_omghdcsj_tooldefs2[*toolType][MBF_OMGHDCSJ_BEAM_LENGTH];
-		    *data_size = (*num_beam) * (*beam_size);
-		    *image_size = mbf_omghdcsj_tooldefs2[*toolType][MBF_OMGHDCSJ_IMAGE_LENGTH];
-		    }
-		else if (*fileVersion == 3)
-		    {
-		    *profile_size = mbf_omghdcsj_tooldefs3[*toolType][MBF_OMGHDCSJ_PROFILE_LENGTH];
-		    *num_beam = mbf_omghdcsj_tooldefs3[*toolType][MBF_OMGHDCSJ_MAX_NO_BEAMS];
-		    *beam_size = mbf_omghdcsj_tooldefs3[*toolType][MBF_OMGHDCSJ_BEAM_LENGTH];
-		    *data_size = (*num_beam) * (*beam_size);
-		    *image_size = mbf_omghdcsj_tooldefs3[*toolType][MBF_OMGHDCSJ_IMAGE_LENGTH];
-		    }
-		else if (*fileVersion == 4)
-		    {
-		    *profile_size = summary->totalProfileBytes;
-		    *num_beam = summary->numDepths;
-		    *beam_size = summary->totalBeamBytes;
-		    *data_size = (*num_beam) * (*beam_size);
-		    *image_size = mbf_omghdcsj_tooldefs3[*toolType][MBF_OMGHDCSJ_IMAGE_LENGTH];
-		    }
-
-		/* allocate buffer at required size */
-		if (dataplus->buffer != NULL)
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&dataplus->buffer,error);
-
-		if (*fileVersion == 4)
-			buff_size = *profile_size;
-		else
-			buff_size = MAX(*profile_size, MBF_OMGHDCSJ_SUMMARY_SIZE);
-
-		buff_size = MAX(buff_size, *image_size);
-		buff_size = MAX(buff_size, *data_size);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,buff_size, (void **)&dataplus->buffer,error);
-		if (status == MB_SUCCESS)
-		    {
-		    buffer = dataplus->buffer;
-		    if (data->beams != NULL)
-			status = mb_freed(verbose,__FILE__, __LINE__, (void **)&data->beams,error);
-		    if (status == MB_SUCCESS)
-			status = mb_mallocd(verbose,__FILE__,__LINE__,
-				*num_beam * sizeof(struct mbf_omghdcsj_beam_struct),
-				(void **)&data->beams,error);
-		    }
-		}
-
-	    if (dataplus->kind == MB_DATA_DATA)
-		{
-		/* profile values */
-		profile->status = store->status_pro;
-		profile->numDepths = store->numDepths_pro;
-		profile->timeOffset = store->timeOffset;
-		profile->vesselLatOffset = store->vesselLatOffset;
-		profile->vesselLongOffset = store->vesselLongOffset;
-		profile->vesselHeading = store->vesselHeading;
-		profile->vesselHeave = store->vesselHeave;
-		profile->vesselPitch = store->vesselPitch;
-		profile->vesselRoll = store->vesselRoll;
-		profile->tide = store->tide;
-		profile->vesselVelocity = store->vesselVelocity;
-		profile->power = store->power;
-		profile->TVG = store->TVG;
-		profile->attenuation = store->attenuation;
-		profile->edflag = store->edflag;
-		profile->soundVelocity = store->soundVelocity;
-		profile->lengthImageDataField = store->lengthImageDataField;
-		profile->pingNo = store->pingNo;
-		profile->mode = store->mode;
-		profile->Q_factor = store->Q_factor;
-		profile->pulseLength = store->pulseLength;
-		profile->unassigned = store->unassigned;
-		profile->td_sound_speed = store->td_sound_speed;
-		profile->samp_rate = store->samp_rate;
-		profile->z_res_cm = store->z_res_cm;
-		profile->xy_res_cm = store->xy_res_cm;
-		profile->ssp_source = store->ssp_source;
-		profile->filter_ID = store->filter_ID;
-		profile->absorp_coeff = store->absorp_coeff;
-		profile->tx_pulse_len = store->tx_pulse_len;
-		profile->tx_beam_width = store->tx_beam_width;
-		profile->max_swath_width = store->max_swath_width;
-		profile->tx_power_reduction = store->tx_power_reduction;
-		profile->rx_beam_width = store->rx_beam_width;
-		profile->rx_bandwidth = store->rx_bandwidth;
-		profile->rx_gain_reduction = store->rx_gain_reduction;
-		profile->tvg_crossover = store->tvg_crossover;
-		profile->beam_spacing = store->beam_spacing;
-		profile->coverage_sector = store->coverage_sector;
-		profile->yaw_stab_mode = store->yaw_stab_mode;
-
-		/* V4 */
-		for( i = 0 ; i < 2; i++)
-		{
-			profile->params[i].txBeamIndex = store->params[i].txBeamIndex;
-			profile->params[i].txLevel = store->params[i].txLevel;
-			profile->params[i].txBeamAngle = store->params[i].txBeamAngle;
-			profile->params[i].txPulseLength = store->params[i].txPulseLength;
-			profile->params[i].ss_offset = store->params[i].ss_offset;
-			profile->params[i].no_skipped_ss = store->params[i].no_skipped_ss;
-			profile->params[i].no_acquired_ss = store->params[i].no_acquired_ss;
-			profile->params[i].ss_sample_interval = store->params[i].ss_sample_interval;
-			profile->params[i].bscatClass = store->params[i].bscatClass;
-			profile->params[i].nrActualGainSets = store->params[i].nrActualGainSets;
-			profile->params[i].rxGup = store->params[i].rxGup;
-			profile->params[i].rxGain = store->params[i].rxGain;
-			profile->params[i].ar = store->params[i].ar;
-			for (k = 0; k < 20; k++)
-				profile->params[i].rxtime[k] = store->params[i].rxtime[k];
-			for (k = 0; k < 20; k++)
-				profile->params[i].rxgain[k] = store->params[i].rxgain[k];
-		}
-		profile->transducerDepth = store->transducerDepth;
-		profile->transducerPitch = store->transducerPitch;
-		profile->transducerRoll = store->transducerRoll;
-		profile->transducerHeading = store->transducerHeading;
-		profile->transducerLatOffset = store->transducerLatOffset;
-		profile->transducerLongOffset = store->transducerLongOffset;
-		profile->transducerSlantRange = store->transducerSlantRange;
-		profile->transducerAcross = store->transducerAcross;
-		profile->transducerAlong = store->transducerAlong;
-		profile->transducerBearing = store->transducerBearing;
-		profile->longperiod_heaveCorrection = store->longperiod_heaveCorrection;
-		profile->dynamic_draftCorrection = store->dynamic_draftCorrection;
-		profile->deepdraftoffset_in_metres = store->deepdraftoffset_in_metres;
-		profile->draft_at_Tx = store->draft_at_Tx;
-		profile->alternateRoll = store->alternateRoll;
-		profile->alternatePitch = store->alternatePitch;
-		profile->alternateHeave = store->alternateHeave;
-		profile->standaloneHeading = store->standaloneHeading;
-		profile->RTK_at_RP = store->RTK_at_RP;
-		profile->Lowpass_RTK_at_RP = store->Lowpass_RTK_at_RP;
-		profile->WLZ = store->WLZ;
-		profile->samp_rate_SecondHead = store->samp_rate_SecondHead;
-		profile->clock_drift_millis = store->clock_drift_millis;
-		profile->watercol_offset = store->watercol_offset;
-		profile->watercol_size = store->watercol_size;
-		profile->watercol_offset_2nd = store->watercol_offset_2nd;
-		profile->watercol_size_2nd = store->watercol_size_2nd;
-		profile->range_to_normal_incidence = store->range_to_normal_incidence;
-		profile->laser_timestampRef = store->laser_timestampRef;
-		profile->tx_sector_offset = store->tx_sector_offset;
-		profile->num_tx_sectors = store->num_tx_sectors;
-		profile->sonar_settings_offset = store->sonar_settings_offset;
-		profile->ping_number = store->ping_number;
-		profile->multi_ping_sequence = store->multi_ping_sequence;
-		profile->num_beams = store->num_beams;
-		profile->layer_compensation_flag = store->layer_compensation_flag;
-		profile->bs_beam_position = store->bs_beam_position;
-		profile->bs_control_flags = store->bs_control_flags;
-		profile->bs_num_beams_per_side = store->bs_num_beams_per_side;
-		profile->bs_current_beam_number = store->bs_current_beam_number;
-		profile->bs_sample_descriptor = store->bs_sample_descriptor;
-		profile->snippet_sample_descriptor = store->snippet_sample_descriptor;
-
-
-
-		/* beams */
-		if (data->beams == NULL)
-		    {
-		    status = mb_mallocd(verbose,__FILE__,__LINE__,
-				*num_beam * sizeof(struct mbf_omghdcsj_beam_struct),
-				(void **)&data->beams,error);
-		    }
-		if (status == MB_SUCCESS)
-		    {
-		     for (i=0;i<store->numDepths_pro;i++)
-
-			{
-			beam = &data->beams[i];
-			sbeam = &store->beams[i];
-
-			beam->status = sbeam->status;
-			beam->scaling_factor = sbeam->scaling_factor;
-			beam->observedDepth = sbeam->observedDepth;
-			beam->acrossTrack = sbeam->acrossTrack;
-			beam->alongTrack = sbeam->alongTrack;
-			beam->latOffset = sbeam->latOffset;
-			beam->longOffset = sbeam->longOffset;
-			beam->processedDepth = sbeam->processedDepth;
-			beam->timeOffset = sbeam->timeOffset;
-			beam->depthAccuracy = sbeam->depthAccuracy;
-			beam->reflectivity = sbeam->reflectivity;
-			beam->Q_factor = sbeam->Q_factor;
-			beam->beam_no = sbeam->beam_no;
-			beam->freq = sbeam->freq;
-			beam->calibratedBackscatter = sbeam->calibratedBackscatter;
-			beam->mindB = sbeam->mindB;
-			beam->maxdB = sbeam->maxdB;
-			beam->pseudoAngleIndependentBackscatter = sbeam->pseudoAngleIndependentBackscatter;
-			beam->range = sbeam->range;
-			beam->no_samples = sbeam->no_samples;
-			beam->offset = sbeam->offset;
-			beam->centre_no = sbeam->centre_no;
-			beam->sample_unit = sbeam->sample_unit;
-			beam->sample_interval = sbeam->sample_interval;
-			beam->dummy[0] = sbeam->dummy[0];
-			beam->dummy[1] = sbeam->dummy[1];
-			beam->samp_win_length = sbeam->samp_win_length;
-			beam->beam_depress_angle = sbeam->beam_depress_angle;
-			beam->beam_heading_angle = sbeam->beam_heading_angle;
-			}
-		    for (i=store->numDepths_pro;i<store->num_beam;i++)
-			{
-			beam = &data->beams[i];
-			sbeam = &store->beams[i];
-
-			beam->status = 0;
-			beam->scaling_factor = 0;
-			beam->observedDepth = 0;
-			beam->acrossTrack = 0;
-			beam->alongTrack = 0;
-			beam->latOffset = 0;
-			beam->longOffset = 0;
-			beam->processedDepth = 0;
-			beam->timeOffset = 0;
-			beam->depthAccuracy = 0;
-			beam->reflectivity = 0;
-			beam->Q_factor = 0;
-			beam->beam_no = 0;
-			beam->freq = 0;
-			beam->calibratedBackscatter = 0;
-			beam->mindB = 0;
-			beam->maxdB = 0;
-			beam->pseudoAngleIndependentBackscatter = 0;
-			beam->range = 0;
-			beam->no_samples = 0;
-			beam->offset = 0;
-			beam->centre_no = 0;
-			beam->sample_unit = 0;
-			beam->sample_interval = 0;
-			beam->dummy[0] = 0;
-			beam->dummy[1] = 0;
-			beam->samp_win_length = 0;
-			beam->beam_depress_angle = 0;
-			beam->beam_heading_angle = 0;
-			}
-		    }
-
-		/* sidescan */
-		if (store->numSamples > 0
-		    && profile->numSamples < store->numSamples
-		    && data->ss_raw != NULL)
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&data->ss_raw,error);
-		if (store->numSamples > 0
-		    && store->ss_raw != NULL)
-		    {
-		    status = mb_mallocd(verbose,__FILE__,__LINE__,
-				    store->numSamples,
-				    (void **)&data->ss_raw,error);
-		    if (status == MB_SUCCESS)
-			{
-			profile->numSamples = store->numSamples;
-			for (i=0;i<store->numSamples;i++)
-			    {
-			    data->ss_raw[i] = store->ss_raw[i];
-			    }
-			}
-		    }
-		}
-
-	    if (dataplus->kind == MB_DATA_COMMENT)
-		{
-		/* comment */
-		for (i=0;i<MBF_OMGHDCSJ_MAX_COMMENT;i++)
-		    dataplus->comment[i] = store->comment[i];
-		}
-	    }
-
-	/* reset offsets in raw sidescan data */
-	if (status == MB_SUCCESS
-	    && profile->numSamples > 0)
-	    {
-	    offset = mb_io_ptr->file2_bytes;
-	    for (i=0;i<profile->numDepths;i++)
-		{
-		beam = &data->beams[i];
-		beam->offset = offset;
-		offset += beam->no_samples;
-		}
-	    }
-
-	/* print debug statements */
-	if (verbose >= 5 && (dataplus->kind == MB_DATA_SUMMARY
-	    || dataplus->kind == MB_DATA_DATA))
-	    {
-	    fprintf(stderr,"\ndbg5  Summary set in function <%s>\n",
-		    function_name);
-	    fprintf(stderr,"dbg5       kind:                   %d\n",dataplus->kind);
-	    fprintf(stderr,"dbg5       sensorNumber:           %d\n",summary->sensorNumber);
-	    fprintf(stderr,"dbg5       subFileID:              %d\n",summary->subFileID);
-	    fprintf(stderr,"dbg5       fileVersion:            %d\n",summary->fileVersion);
-	    fprintf(stderr,"dbg5       toolType:               %d\n",summary->toolType);
-	    fprintf(stderr,"dbg5       toolType name:          %s\n",mbsys_hdcs_tool_names[summary->toolType]);
-	    fprintf(stderr,"dbg5       numProfiles:            %d\n",summary->numProfiles);
-	    fprintf(stderr,"dbg5       numDepths:              %d\n",summary->numDepths);
-	    fprintf(stderr,"dbg5       timeScale:              %d\n",summary->timeScale);
-	    fprintf(stderr,"dbg5       refTime:                %d\n",summary->refTime);
-	    fprintf(stderr,"dbg5       minTime:                %d\n",summary->minTime);
-	    fprintf(stderr,"dbg5       maxTime:                %d\n",summary->maxTime);
-	    fprintf(stderr,"dbg5       positionType:           %d\n",summary->positionType);
-	    fprintf(stderr,"dbg5       positionScale:          %d\n",summary->positionScale);
-	    fprintf(stderr,"dbg5       refLat:                 %d\n",summary->refLat);
-	    fprintf(stderr,"dbg5       minLat:                 %d\n",summary->minLat);
-	    fprintf(stderr,"dbg5       maxLat:                 %d\n",summary->maxLat);
-	    fprintf(stderr,"dbg5       refLong:                %d\n",summary->refLong);
-	    fprintf(stderr,"dbg5       minLong:                %d\n",summary->minLong);
-	    fprintf(stderr,"dbg5       maxLong:                %d\n",summary->maxLong);
-	    fprintf(stderr,"dbg5       minObsDepth:            %d\n",summary->minObsDepth);
-	    fprintf(stderr,"dbg5       maxObsDepth:            %d\n",summary->maxObsDepth);
-	    fprintf(stderr,"dbg5       minProcDepth:           %d\n",summary->minProcDepth);
-	    fprintf(stderr,"dbg5       maxProcDepth:           %d\n",summary->maxProcDepth);
-	    fprintf(stderr,"dbg5       status:                 %d\n",summary->status);
-	    fprintf(stderr,"dbg5       status:                 %d\n",status);
-	    fprintf(stderr,"dbg5       error:                  %d\n",*error);
-	    }
-
-	/* print debug statements */
-	if (verbose >= 5 && dataplus->kind == MB_DATA_DATA)
-	    {
-	    fprintf(stderr,"\ndbg5  New profile read in function <%s>\n",
-		    function_name);
-	    fprintf(stderr,"dbg5       kind:                   %d\n",dataplus->kind);
-	    fprintf(stderr,"dbg5       status:                 %d\n",profile->status);
-	    fprintf(stderr,"dbg5       numDepths:              %d\n",profile->numDepths);
-	    fprintf(stderr,"dbg5       numSamples:             %d\n",profile->numSamples);
-	    fprintf(stderr,"dbg5       timeOffset:             %d\n",profile->timeOffset);
-	    fprintf(stderr,"dbg5       vesselLatOffset:        %d\n",profile->vesselLatOffset);
-	    fprintf(stderr,"dbg5       vesselLongOffset:       %d\n",profile->vesselLongOffset);
-	    fprintf(stderr,"dbg5       vesselHeading:          %d\n",profile->vesselHeading);
-	    fprintf(stderr,"dbg5       vesselHeave:            %d\n",profile->vesselHeave);
-	    fprintf(stderr,"dbg5       vesselPitch:            %d\n",profile->vesselPitch);
-	    fprintf(stderr,"dbg5       vesselRoll:             %d\n",profile->vesselRoll);
-	    fprintf(stderr,"dbg5       tide:                   %d\n",profile->tide);
-	    fprintf(stderr,"dbg5       vesselVelocity:         %d\n",profile->vesselVelocity);
-	    fprintf(stderr,"dbg5       power:                  %d\n",profile->power);
-	    fprintf(stderr,"dbg5       TVG:                    %d\n",profile->TVG);
-	    fprintf(stderr,"dbg5       attenuation:            %d\n",profile->attenuation);
-	    fprintf(stderr,"dbg5       edflag:                 %d\n",profile->edflag);
-	    fprintf(stderr,"dbg5       soundVelocity:          %d\n",profile->soundVelocity);
-	    fprintf(stderr,"dbg5       lengthImageDataField:   %d\n",profile->lengthImageDataField);
-	    fprintf(stderr,"dbg5       pingNo:                 %d\n",profile->pingNo);
-	    fprintf(stderr,"dbg5       mode:                   %d\n",profile->mode);
-	    fprintf(stderr,"dbg5       Q_factor:               %d\n",profile->Q_factor);
-	    fprintf(stderr,"dbg5       pulseLength:            %d\n",profile->pulseLength);
-	    fprintf(stderr,"dbg5       unassigned:             %d\n",profile->unassigned);
-	    fprintf(stderr,"dbg5       td_sound_speed:         %d\n",profile->td_sound_speed);
-	    fprintf(stderr,"dbg5       samp_rate:              %d\n",profile->samp_rate);
-	    fprintf(stderr,"dbg5       z_res_cm:               %d\n",profile->z_res_cm);
-	    fprintf(stderr,"dbg5       xy_res_cm:              %d\n",profile->xy_res_cm);
-	    fprintf(stderr,"dbg5       ssp_source:             %d\n",profile->ssp_source);
-	    fprintf(stderr,"dbg5       filter_ID:              %d\n",profile->filter_ID);
-	    fprintf(stderr,"dbg5       absorp_coeff:           %d\n",profile->absorp_coeff);
-	    fprintf(stderr,"dbg5       tx_pulse_len:           %d\n",profile->tx_pulse_len);
-	    fprintf(stderr,"dbg5       tx_beam_width:          %d\n",profile->tx_beam_width);
-	    fprintf(stderr,"dbg5       max_swath_width:        %d\n",profile->max_swath_width);
-	    fprintf(stderr,"dbg5       tx_power_reduction:     %d\n",profile->tx_power_reduction);
-	    fprintf(stderr,"dbg5       rx_beam_width:          %d\n",profile->rx_beam_width);
-	    fprintf(stderr,"dbg5       rx_bandwidth:           %d\n",profile->rx_bandwidth);
-	    fprintf(stderr,"dbg5       rx_gain_reduction:      %d\n",profile->rx_gain_reduction);
-	    fprintf(stderr,"dbg5       tvg_crossover:          %d\n",profile->tvg_crossover);
-	    fprintf(stderr,"dbg5       beam_spacing:           %d\n",profile->beam_spacing);
-	    fprintf(stderr,"dbg5       coverage_sector:        %d\n",profile->coverage_sector);
-	    fprintf(stderr,"dbg5       yaw_stab_mode:          %d\n",profile->yaw_stab_mode);
-	    fprintf(stderr,"dbg5       status:                 %d\n",status);
-	    fprintf(stderr,"dbg5       error:                  %d\n",*error);
-	    for (i=0;i<profile->numDepths;i++)
-		{
-		beam = &data->beams[i];
-		fprintf(stderr,"dbg5       status[%4d]:            %d\n",
-			     i, beam->status);
-		fprintf(stderr,"dbg5       observedDepth[%4d]:     %d\n",
-			     i, beam->observedDepth);
-		fprintf(stderr,"dbg5       acrossTrack[%4d]:       %d\n",
-			     i, beam->acrossTrack);
-		fprintf(stderr,"dbg5       alongTrack[%4d]:        %d\n",
-			     i, beam->alongTrack);
-		fprintf(stderr,"dbg5       latOffset[%4d]:         %d\n",
-			     i, beam->latOffset);
-		fprintf(stderr,"dbg5       longOffset[%4d]:        %d\n",
-			     i, beam->longOffset);
-		fprintf(stderr,"dbg5       processedDepth[%4d]:    %d\n",
-			     i, beam->processedDepth);
-		fprintf(stderr,"dbg5       timeOffset[%4d]:        %d\n",
-			     i, beam->timeOffset);
-		fprintf(stderr,"dbg5       depthAccuracy[%4d]:     %d\n",
-			     i, beam->depthAccuracy);
-		fprintf(stderr,"dbg5       reflectivity[%4d]:      %d\n",
-			     i, beam->reflectivity);
-		fprintf(stderr,"dbg5       Q_factor[%4d]:          %d\n",
-			     i, beam->Q_factor);
-		fprintf(stderr,"dbg5       beam_no[%4d]:           %d\n",
-			     i, beam->beam_no);
-		fprintf(stderr,"dbg5       freq[%4d]:              %d\n",
-			     i, beam->freq);
-		fprintf(stderr,"dbg5       calibBackscatter[%4d]:  %d\n",
-			     i, beam->calibratedBackscatter);
-		fprintf(stderr,"dbg5       mindB[%4d]:             %d\n",
-			     i, beam->mindB);
-		fprintf(stderr,"dbg5       maxdB[%4d]:             %d\n",
-			     i, beam->maxdB);
-		fprintf(stderr,"dbg5       AngleIndepBacks[%4d]:   %d\n",
-			     i, beam->pseudoAngleIndependentBackscatter);
-		fprintf(stderr,"dbg5       range[%4d]:             %d\n",
-			     i, beam->range);
-		fprintf(stderr,"dbg5       no_samples[%4d]:        %d\n",
-			     i, beam->no_samples);
-		fprintf(stderr,"dbg5       offset[%4d]:            %d\n",
-			     i, beam->offset);
-		fprintf(stderr,"dbg5       centre_no[%4d]:         %d\n",
-			     i, beam->centre_no);
-		fprintf(stderr,"dbg5       sample_unit[%4d]:       %d\n",
-			     i, beam->sample_unit);
-		fprintf(stderr,"dbg5       sample_interval[%4d]:   %d\n",
-			     i, beam->sample_interval);
-		fprintf(stderr,"dbg5       dummy0[%4d]:            %d\n",
-			     i, beam->dummy[0]);
-		fprintf(stderr,"dbg5       dummy1[%4d]:            %d\n",
-			     i, beam->dummy[1]);
-		fprintf(stderr,"dbg5       samp_win_length[%4d]:   %d\n",
-			     i, beam->samp_win_length);
-		fprintf(stderr,"dbg5       beam_depress_angle[%4d]:%d\n",
-			     i, beam->beam_depress_angle);
-		fprintf(stderr,"dbg5       beam_heading_angle[%4d]:%d\n",
-			     i, beam->beam_heading_angle);
-		}
-	    for (i=0;i<profile->numSamples;i++)
-		fprintf(stderr,"dbg5       sidescan sample[%4d]:%d\n",
-			     i, data->ss_raw[i]);
-	    fprintf(stderr,"dbg5       status:     %d\n",status);
-	    fprintf(stderr,"dbg5       error:      %d\n",*error);
-	    }
-
-	/* print debug statements */
-	if (verbose >= 5 && dataplus->kind == MB_DATA_COMMENT)
-	    {
-	    fprintf(stderr,"\ndbg5  Comment set in function <%s>\n",
-		    function_name);
-	    fprintf(stderr,"dbg5       kind:                   %d\n",dataplus->kind);
-	    fprintf(stderr,"dbg5       comment:                %s\n",dataplus->comment);
-	    fprintf(stderr,"dbg5       status:                 %d\n",status);
-	    fprintf(stderr,"dbg5       error:                  %d\n",*error);
-	    }
-
-	/* reverse parse and write the summary */
-	if (status == MB_SUCCESS
-	    && dataplus->kind == MB_DATA_SUMMARY)
-	    {
-	    offset = 0;
-	    buffer[offset] = 'H'; offset += 1;
-	    buffer[offset] = 'D'; offset += 1;
-	    buffer[offset] = 'C'; offset += 1;
-	    buffer[offset] = 'S'; offset += 1;
-#ifdef BYTESWAPPED
-	    int_ptr = (int *) &buffer[offset];
-	    *int_ptr = mb_swap_int(summary->sensorNumber); offset +=4;
-	    int_ptr = (int *) &buffer[offset];
-	    *int_ptr = mb_swap_int(summary->subFileID); offset +=4;
-	    int_ptr = (int *) &buffer[offset];
-	    *int_ptr = mb_swap_int(summary->fileVersion); offset +=4;
-	    int_ptr = (int *) &buffer[offset];
-	    *int_ptr = mb_swap_int(summary->toolType); offset +=4;
-	    int_ptr = (int *) &buffer[offset];
-	    *int_ptr = mb_swap_int(summary->numProfiles); offset +=4;
-	    int_ptr = (int *) &buffer[offset];
-	    *int_ptr = mb_swap_int(summary->numDepths); offset +=4;
-	    int_ptr = (int *) &buffer[offset];
-	    *int_ptr = mb_swap_int(summary->timeScale); offset +=4;
-	    int_ptr = (int *) &buffer[offset];
-	    *int_ptr = mb_swap_int(summary->refTime); offset +=4;
-	    int_ptr = (int *) &buffer[offset];
-	    *int_ptr = mb_swap_int(summary->minTime); offset +=4;
-	    int_ptr = (int *) &buffer[offset];
-	    *int_ptr = mb_swap_int(summary->maxTime); offset +=4;
-	    int_ptr = (int *) &buffer[offset];
-	    *int_ptr = mb_swap_int(summary->positionType); offset +=4;
-	    int_ptr = (int *) &buffer[offset];
-	    *int_ptr = mb_swap_int(summary->positionScale); offset +=4;
-	    int_ptr = (int *) &buffer[offset];
-	    *int_ptr = mb_swap_int(summary->refLat); offset +=4;
-	    int_ptr = (int *) &buffer[offset];
-	    *int_ptr = mb_swap_int(summary->minLat); offset +=4;
-	    int_ptr = (int *) &buffer[offset];
-	    *int_ptr = mb_swap_int(summary->maxLat); offset +=4;
-	    int_ptr = (int *) &buffer[offset];
-	    *int_ptr = mb_swap_int(summary->refLong); offset +=4;
-	    int_ptr = (int *) &buffer[offset];
-	    *int_ptr = mb_swap_int(summary->minLong); offset +=4;
-	    int_ptr = (int *) &buffer[offset];
-	    *int_ptr = mb_swap_int(summary->maxLong); offset +=4;
-	    int_ptr = (int *) &buffer[offset];
-	    *int_ptr = mb_swap_int(summary->minObsDepth); offset +=4;
-	    int_ptr = (int *) &buffer[offset];
-	    *int_ptr = mb_swap_int(summary->maxObsDepth); offset +=4;
-	    int_ptr = (int *) &buffer[offset];
-	    *int_ptr = mb_swap_int(summary->minProcDepth); offset +=4;
-	    int_ptr = (int *) &buffer[offset];
-	    *int_ptr = mb_swap_int(summary->maxProcDepth); offset +=4;
-	    int_ptr = (int *) &buffer[offset];
-	    *int_ptr = mb_swap_int(summary->status); offset +=4;
-	    /* V4 */
-	    int_ptr = (int *) &buffer[offset];
-	    *int_ptr = mb_swap_int(summary->totalProfileBytes); offset +=4;
-
-	    for (k = 0; k < 20; k++)
-	    {
-	    	int_ptr = (int *) &buffer[offset];
-	    	*int_ptr = mb_swap_int(summary->Profile_BitsDefining[k]); offset +=4;
-	    	/* if (k < 19) offset +=4; */
-	    }
-
-	    int_ptr = (int *) &buffer[offset];
-	    *int_ptr = mb_swap_int(summary->totalBeamBytes); offset +=4;
-
-	    for (k = 0; k < 20; k++)
-	    {
-	    	int_ptr = (int *) &buffer[offset];
-	    	*int_ptr = mb_swap_int(summary->Beam_BitsDefining[k]); offset +=4;
-	    	/* if (k < 19) offset +=4; */
-	    }
-#else
-	    int_ptr = (int *) &buffer[offset];
-	    *int_ptr = summary->sensorNumber; offset +=4;
-	    int_ptr = (int *) &buffer[offset];
-	    *int_ptr = summary->subFileID; offset +=4;
-	    int_ptr = (int *) &buffer[offset];
-	    *int_ptr = summary->fileVersion; offset +=4;
-	    int_ptr = (int *) &buffer[offset];
-	    *int_ptr = summary->toolType; offset +=4;
-	    int_ptr = (int *) &buffer[offset];
-	    *int_ptr = summary->numProfiles; offset +=4;
-	    int_ptr = (int *) &buffer[offset];
-	    *int_ptr = summary->numDepths; offset +=4;
-	    int_ptr = (int *) &buffer[offset];
-	    *int_ptr = summary->timeScale; offset +=4;
-	    int_ptr = (int *) &buffer[offset];
-	    *int_ptr = summary->refTime; offset +=4;
-	    int_ptr = (int *) &buffer[offset];
-	    *int_ptr = summary->minTime; offset +=4;
-	    int_ptr = (int *) &buffer[offset];
-	    *int_ptr = summary->maxTime; offset +=4;
-	    int_ptr = (int *) &buffer[offset];
-	    *int_ptr = summary->positionType; offset +=4;
-	    int_ptr = (int *) &buffer[offset];
-	    *int_ptr = summary->positionScale; offset +=4;
-	    int_ptr = (int *) &buffer[offset];
-	    *int_ptr = summary->refLat; offset +=4;
-	    int_ptr = (int *) &buffer[offset];
-	    *int_ptr = summary->minLat; offset +=4;
-	    int_ptr = (int *) &buffer[offset];
-	    *int_ptr = summary->maxLat; offset +=4;
-	    int_ptr = (int *) &buffer[offset];
-	    *int_ptr = summary->refLong; offset +=4;
-	    int_ptr = (int *) &buffer[offset];
-	    *int_ptr = summary->minLong; offset +=4;
-	    int_ptr = (int *) &buffer[offset];
-	    *int_ptr = summary->maxLong; offset +=4;
-	    int_ptr = (int *) &buffer[offset];
-	    *int_ptr = summary->minObsDepth; offset +=4;
-	    int_ptr = (int *) &buffer[offset];
-	    *int_ptr = summary->maxObsDepth; offset +=4;
-	    int_ptr = (int *) &buffer[offset];
-	    *int_ptr = summary->minProcDepth; offset +=4;
-	    int_ptr = (int *) &buffer[offset];
-	    *int_ptr = summary->maxProcDepth; offset +=4;
-	    int_ptr = (int *) &buffer[offset];
-	    *int_ptr = summary->status; offset +=4;
-	    /* V4 */
-	    int_ptr = (int *) &buffer[offset];
-	    *int_ptr = summary->totalProfileBytes; offset +=4;
-	    for (k = 0; k < 20; k++)
-	    {
-	    	int_ptr = (int *) &buffer[offset];
-	    	*int_ptr = summary->Profile_BitsDefining[k]; offset +=4;
-	    }
-	    int_ptr = (int *) &buffer[offset];
-	    *int_ptr = summary->totalBeamBytes; offset +=4;
-	    for (k = 0; k < 20; k++)
-	    {
-	    	int_ptr = (int *) &buffer[offset];
-	    	*int_ptr = summary->Beam_BitsDefining[k];
-	    	if ( k < 19) offset +=4; /* do not go too far */
-	    }
-
-#endif
-
-	    /* write summary to file */
-	    sum_size = MBF_OMGHDCSJ_SUMMARY_SIZE;
-	    if (*fileVersion == 4)
-	    	sum_size += MBF_OMGHDCSJ_SUMMARY_V4EXTRA_SIZE;
-
-	    if ((write_size = fwrite(buffer,1,sum_size,
-			    mb_io_ptr->mbfp)) == sum_size)
-		{
-		mb_io_ptr->file_bytes += write_size;
-		status = MB_SUCCESS;
-		*error = MB_ERROR_NO_ERROR;
-		}
-	    else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	    }
-
-	/* else reverse parse and write the data record */
-	else if (status == MB_SUCCESS
-	    && dataplus->kind == MB_DATA_DATA)
-	    {
-	    /* first do the profile */
-	    offset = 0;
-	    if (*fileVersion == 1)
-		{
-#ifdef BYTESWAPPED
-		int_ptr = (int *) &buffer[offset];
-		*int_ptr = mb_swap_int(profile->status); offset +=4;
-		int_ptr = (int *) &buffer[offset];
-		*int_ptr = mb_swap_int(profile->numDepths); offset +=4;
-		int_ptr = (int *) &buffer[offset];
-		*int_ptr = mb_swap_int(profile->timeOffset); offset +=4;
-		int_ptr = (int *) &buffer[offset];
-		*int_ptr = mb_swap_int(profile->vesselLatOffset); offset +=4;
-		int_ptr = (int *) &buffer[offset];
-		*int_ptr = mb_swap_int(profile->vesselLongOffset); offset +=4;
-		int_ptr = (int *) &buffer[offset];
-		*int_ptr = mb_swap_int(profile->vesselHeading); offset +=4;
-		if (offset < *profile_size)
-		    {
-		    int_ptr = (int *) &buffer[offset];
-		    *int_ptr = mb_swap_int(profile->vesselHeave); offset +=4;
-		    int_ptr = (int *) &buffer[offset];
-		    *int_ptr = mb_swap_int(profile->vesselPitch); offset +=4;
-		    int_ptr = (int *) &buffer[offset];
-		    *int_ptr = mb_swap_int(profile->vesselRoll); offset +=4;
-		    int_ptr = (int *) &buffer[offset];
-		    *int_ptr = mb_swap_int(profile->tide); offset +=4;
-		    int_ptr = (int *) &buffer[offset];
-		    *int_ptr = mb_swap_int(profile->vesselVelocity); offset +=4;
-		    }
-		if (offset < *profile_size)
-		    {
-		    buffer[offset] = profile->power; offset +=1;
-		    buffer[offset] = profile->TVG; offset +=1;
-		    buffer[offset] = profile->attenuation; offset +=1;
-		    buffer[offset] = profile->edflag; offset +=1;
-		    int_ptr = (int *) &buffer[offset];
-		    *int_ptr = mb_swap_int(profile->soundVelocity); offset +=4;
-		    int_ptr = (int *) &buffer[offset];
-		    *int_ptr = mb_swap_int(profile->lengthImageDataField); offset +=4;
-		    int_ptr = (int *) &buffer[offset];
-		    *int_ptr = mb_swap_int(profile->pingNo); offset +=4;
-		    buffer[offset] = profile->mode; offset +=1;
-		    buffer[offset] = profile->Q_factor; offset +=1;
-		    buffer[offset] = profile->pulseLength; offset +=1;
-		    buffer[offset] = profile->unassigned; offset +=1;
-		    }
-#else
-		int_ptr = (int *) &buffer[offset];
-		*int_ptr = profile->status; offset +=4;
-		int_ptr = (int *) &buffer[offset];
-		*int_ptr = profile->numDepths; offset +=4;
-		int_ptr = (int *) &buffer[offset];
-		*int_ptr = profile->timeOffset; offset +=4;
-		int_ptr = (int *) &buffer[offset];
-		*int_ptr = profile->vesselLatOffset; offset +=4;
-		int_ptr = (int *) &buffer[offset];
-		*int_ptr = profile->vesselLongOffset; offset +=4;
-		int_ptr = (int *) &buffer[offset];
-		*int_ptr = profile->vesselHeading; offset +=4;
-		if (offset < *profile_size)
-		    {
-		    int_ptr = (int *) &buffer[offset];
-		    *int_ptr = profile->vesselHeave; offset +=4;
-		    int_ptr = (int *) &buffer[offset];
-		    *int_ptr = profile->vesselPitch; offset +=4;
-		    int_ptr = (int *) &buffer[offset];
-		    *int_ptr = profile->vesselRoll; offset +=4;
-		    int_ptr = (int *) &buffer[offset];
-		    *int_ptr = profile->tide; offset +=4;
-		    int_ptr = (int *) &buffer[offset];
-		    *int_ptr = profile->vesselVelocity; offset +=4;
-		    }
-		if (offset < *profile_size)
-		    {
-		    buffer[offset] = profile->power; offset +=1;
-		    buffer[offset] = profile->TVG; offset +=1;
-		    buffer[offset] = profile->attenuation; offset +=1;
-		    buffer[offset] = profile->edflag; offset +=1;
-		    int_ptr = (int *) &buffer[offset];
-		    *int_ptr = profile->soundVelocity; offset +=4;
-		    int_ptr = (int *) &buffer[offset];
-		    *int_ptr = profile->lengthImageDataField; offset +=4;
-		    int_ptr = (int *) &buffer[offset];
-		    *int_ptr = profile->pingNo; offset +=4;
-		    buffer[offset] = profile->mode; offset +=1;
-		    buffer[offset] = profile->Q_factor; offset +=1;
-		    buffer[offset] = profile->pulseLength; offset +=1;
-		    buffer[offset] = profile->unassigned; offset +=1;
-		    }
-#endif
-		}
-	    else if (*fileVersion == 2)
-		{
-#ifdef BYTESWAPPED
-		int_ptr = (int *) &buffer[offset];
-		*int_ptr = mb_swap_int(profile->timeOffset); offset +=4;
-		int_ptr = (int *) &buffer[offset];
-		*int_ptr = mb_swap_int(profile->vesselLatOffset); offset +=4;
-		int_ptr = (int *) &buffer[offset];
-		*int_ptr = mb_swap_int(profile->vesselLongOffset); offset +=4;
-		short_ptr = (short *) &buffer[offset];
-		*short_ptr = (short)mb_swap_short((short)(profile->vesselHeading / 10000)); offset +=2;
-		short_ptr = (short *) &buffer[offset];
-		*short_ptr = (short)mb_swap_short((short)(profile->vesselHeave)); offset +=2;
-		short_ptr = (short *) &buffer[offset];
-		*short_ptr = (short)mb_swap_short((short)(profile->vesselPitch / 1000)); offset +=2;
-		short_ptr = (short *) &buffer[offset];
-		*short_ptr = (short)mb_swap_short((short)(profile->vesselRoll / 1000)); offset +=2;
-		short_ptr = (short *) &buffer[offset];
-		*short_ptr = (short)mb_swap_short((short)(profile->tide)); offset +=2;
-		short_ptr = (short *) &buffer[offset];
-		*short_ptr = (short)mb_swap_short((short)(profile->numDepths)); offset +=2;
-		buffer[offset] = profile->power; offset +=1;
-		buffer[offset] = profile->TVG; offset +=1;
-		buffer[offset] = profile->attenuation; offset +=1;
-		buffer[offset] = profile->pulseLength; offset +=1;
-		buffer[offset] = profile->mode; offset +=1;
-		buffer[offset] = profile->status; offset +=1;
-		buffer[offset] = profile->edflag; offset +=1;
-		buffer[offset] = profile->unassigned; offset +=1;
-#else
-		int_ptr = (int *) &buffer[offset];
-		*int_ptr = profile->timeOffset; offset +=4;
-		int_ptr = (int *) &buffer[offset];
-		*int_ptr = profile->vesselLatOffset; offset +=4;
-		int_ptr = (int *) &buffer[offset];
-		*int_ptr = profile->vesselLongOffset; offset +=4;
-		short_ptr = (short *) &buffer[offset];
-		*short_ptr = (short)(profile->vesselHeading / 10000); offset +=2;
-		short_ptr = (short *) &buffer[offset];
-		*short_ptr = (short)(profile->vesselHeave); offset +=2;
-		short_ptr = (short *) &buffer[offset];
-		*short_ptr = (short)(profile->vesselPitch / 1000); offset +=2;
-		short_ptr = (short *) &buffer[offset];
-		*short_ptr = (short)(profile->vesselRoll / 1000); offset +=2;
-		short_ptr = (short *) &buffer[offset];
-		*short_ptr = (short)(profile->tide); offset +=2;
-		short_ptr = (short *) &buffer[offset];
-		*short_ptr = (short)(profile->numDepths); offset +=2;
-		buffer[offset] = profile->power; offset +=1;
-		buffer[offset] = profile->TVG; offset +=1;
-		buffer[offset] = profile->attenuation; offset +=1;
-		buffer[offset] = profile->pulseLength; offset +=1;
-		buffer[offset] = profile->mode; offset +=1;
-		buffer[offset] = profile->status; offset +=1;
-		buffer[offset] = profile->edflag; offset +=1;
-		buffer[offset] = profile->unassigned; offset +=1;
-#endif
-		}
-	    else if (*fileVersion == 3)
-		{
-#ifdef BYTESWAPPED
-		int_ptr = (int *) &buffer[offset];
-		*int_ptr = mb_swap_int(profile->timeOffset); offset +=4;
-		int_ptr = (int *) &buffer[offset];
-		*int_ptr = mb_swap_int(profile->vesselLatOffset); offset +=4;
-		int_ptr = (int *) &buffer[offset];
-		*int_ptr = mb_swap_int(profile->vesselLongOffset); offset +=4;
-		short_ptr = (short *) &buffer[offset];
-		*short_ptr = (short)mb_swap_short((short)(profile->vesselHeading / 10000)); offset +=2;
-		short_ptr = (short *) &buffer[offset];
-		*short_ptr = (short)mb_swap_short((short)(profile->vesselHeave)); offset +=2;
-		short_ptr = (short *) &buffer[offset];
-		*short_ptr = (short)mb_swap_short((short)(profile->vesselPitch / 1000)); offset +=2;
-		short_ptr = (short *) &buffer[offset];
-		*short_ptr = (short)mb_swap_short((short)(profile->vesselRoll / 1000)); offset +=2;
-		short_ptr = (short *) &buffer[offset];
-		*short_ptr = (short)mb_swap_short((short)(profile->tide)); offset +=2;
-		short_ptr = (short *) &buffer[offset];
-		*short_ptr = (short)mb_swap_short((short)(profile->numDepths)); offset +=2;
-		buffer[offset] = profile->power; offset +=1;
-		buffer[offset] = profile->TVG; offset +=1;
-		buffer[offset] = profile->attenuation; offset +=1;
-		buffer[offset] = profile->pulseLength; offset +=1;
-		buffer[offset] = profile->mode; offset +=1;
-		buffer[offset] = profile->status; offset +=1;
-		buffer[offset] = profile->edflag; offset +=1;
-		buffer[offset] = profile->unassigned; offset +=1;
-		if (offset < *profile_size)
-		    {
-		    short_ptr = (short *) &buffer[offset];
-		    *short_ptr = (short)mb_swap_short((short)(profile->td_sound_speed)); offset +=2;
-		    short_ptr = (short *) &buffer[offset];
-		    *short_ptr = (short)mb_swap_short((short)(profile->samp_rate)); offset +=2;
-		    buffer[offset] = profile->z_res_cm; offset +=1;
-		    buffer[offset] = profile->xy_res_cm; offset +=1;
-		    buffer[offset] = profile->ssp_source; offset +=1;
-		    buffer[offset] = profile->filter_ID; offset +=1;
-		    short_ptr = (short *) &buffer[offset];
-		    *short_ptr = (short)mb_swap_short((short)(profile->absorp_coeff)); offset +=2;
-		    short_ptr = (short *) &buffer[offset];
-		    *short_ptr = (short)mb_swap_short((short)(profile->tx_pulse_len)); offset +=2;
-		    short_ptr = (short *) &buffer[offset];
-		    *short_ptr = (short)mb_swap_short((short)(profile->tx_beam_width)); offset +=2;
-		    short_ptr = (short *) &buffer[offset];
-		    *short_ptr = (short)mb_swap_short((short)(profile->max_swath_width)); offset +=2;
-		    buffer[offset] = profile->tx_power_reduction; offset +=1;
-		    buffer[offset] = profile->rx_beam_width; offset +=1;
-		    buffer[offset] = profile->rx_bandwidth; offset +=1;
-		    buffer[offset] = profile->rx_gain_reduction; offset +=1;
-		    buffer[offset] = profile->tvg_crossover; offset +=1;
-		    buffer[offset] = profile->beam_spacing; offset +=1;
-		    buffer[offset] = profile->coverage_sector; offset +=1;
-		    buffer[offset] = profile->yaw_stab_mode; offset +=1;
-		    }
-#else
-		int_ptr = (int *) &buffer[offset];
-		*int_ptr = profile->timeOffset; offset +=4;
-		int_ptr = (int *) &buffer[offset];
-		*int_ptr = profile->vesselLatOffset; offset +=4;
-		int_ptr = (int *) &buffer[offset];
-		*int_ptr = profile->vesselLongOffset; offset +=4;
-		short_ptr = (short *) &buffer[offset];
-		*short_ptr = (short)(profile->vesselHeading / 10000); offset +=2;
-		short_ptr = (short *) &buffer[offset];
-		*short_ptr = (short)(profile->vesselHeave); offset +=2;
-		short_ptr = (short *) &buffer[offset];
-		*short_ptr = (short)(profile->vesselPitch / 1000); offset +=2;
-		short_ptr = (short *) &buffer[offset];
-		*short_ptr = (short)(profile->vesselRoll / 1000); offset +=2;
-		short_ptr = (short *) &buffer[offset];
-		*short_ptr = (short)(profile->tide); offset +=2;
-		short_ptr = (short *) &buffer[offset];
-		*short_ptr = (short)(profile->numDepths); offset +=2;
-		buffer[offset] = profile->power; offset +=1;
-		buffer[offset] = profile->TVG; offset +=1;
-		buffer[offset] = profile->attenuation; offset +=1;
-		buffer[offset] = profile->pulseLength; offset +=1;
-		buffer[offset] = profile->mode; offset +=1;
-		buffer[offset] = profile->status; offset +=1;
-		buffer[offset] = profile->edflag; offset +=1;
-		buffer[offset] = profile->unassigned; offset +=1;
-		if (offset < *profile_size)
-		    {
-		    short_ptr = (short *) &buffer[offset];
-		    *short_ptr = (short)(profile->td_sound_speed); offset +=2;
-		    short_ptr = (short *) &buffer[offset];
-		    *short_ptr = (short)(profile->samp_rate); offset +=2;
-		    buffer[offset] = profile->z_res_cm; offset +=1;
-		    buffer[offset] = profile->xy_res_cm; offset +=1;
-		    buffer[offset] = profile->ssp_source; offset +=1;
-		    buffer[offset] = profile->filter_ID; offset +=1;
-		    short_ptr = (short *) &buffer[offset];
-		    *short_ptr = (short)(profile->absorp_coeff); offset +=2;
-		    short_ptr = (short *) &buffer[offset];
-		    *short_ptr = (short)(profile->tx_pulse_len); offset +=2;
-		    short_ptr = (short *) &buffer[offset];
-		    *short_ptr = (short)(profile->tx_beam_width); offset +=2;
-		    short_ptr = (short *) &buffer[offset];
-		    *short_ptr = (short)(profile->max_swath_width); offset +=2;
-		    buffer[offset] = profile->tx_power_reduction; offset +=1;
-		    buffer[offset] = profile->rx_beam_width; offset +=1;
-		    buffer[offset] = profile->rx_bandwidth; offset +=1;
-		    buffer[offset] = profile->rx_gain_reduction; offset +=1;
-		    buffer[offset] = profile->tvg_crossover; offset +=1;
-		    buffer[offset] = profile->beam_spacing; offset +=1;
-		    buffer[offset] = profile->coverage_sector; offset +=1;
-		    buffer[offset] = profile->yaw_stab_mode; offset +=1;
-		    }
-#endif
-		}
-	    else if (*fileVersion == 4)
-		{
-#ifdef BYTESWAPPED
-		    if (summary->Profile_BitsDefining[0])
-		    {
-			if (summary->Profile_BitsDefining[0] & PROF_ui_status)
-			{
-			     /* write as char */
-			     buffer[offset] = profile->status; offset +=1;
-			}
-			if (summary->Profile_BitsDefining[0] & PROF_ui_numDepths)
-			{
-			    short_ptr = (short *) &buffer[offset];
-			    *short_ptr = (short)mb_swap_short((short)profile->numDepths); offset +=2;
-			}
-			if (summary->Profile_BitsDefining[0] & PROF_ui_timeOffset)
-			{
-			    int_ptr = (int *) &buffer[offset];
-			    *int_ptr = mb_swap_int(profile->timeOffset); offset +=4;
-			}
-			if (summary->Profile_BitsDefining[0] & PROF_ui_vesselLatOffset)
-			{
-			    int_ptr = (int *) &buffer[offset];
-			    *int_ptr = mb_swap_int(profile->vesselLatOffset); offset +=4;
-			}
-			if (summary->Profile_BitsDefining[0] & PROF_ui_vesselLongOffset)
-			{
-			    int_ptr = (int *) &buffer[offset];
-			    *int_ptr = mb_swap_int(profile->vesselLongOffset); offset +=4;
-			}
-			if (summary->Profile_BitsDefining[0] & PROF_ui_vesselHeading)
-			{
-			    short_ptr = (short *) &buffer[offset];
-			    *short_ptr = (short)mb_swap_short((short)(profile->vesselHeading / 1000)); offset +=2;
-			 }
-			if (summary->Profile_BitsDefining[0] & PROF_si_vesselHeave)
-			{
-			    short_ptr = (short *) &buffer[offset];
-			    *short_ptr = (short)mb_swap_short((short)(profile->vesselHeave)); offset +=2;
-			}
-			if (summary->Profile_BitsDefining[0] & PROF_si_vesselPitch)
-			{
-			    short_ptr = (short *) &buffer[offset];
-			    *short_ptr = (short)mb_swap_short((short)(profile->vesselPitch / 1000)); offset +=2;
-			}
-			if (summary->Profile_BitsDefining[0] & PROF_si_vesselRoll)
-			{
-			    short_ptr = (short *) &buffer[offset];
-			    *short_ptr = (short)mb_swap_short((short)(profile->vesselRoll / 1000)); offset +=2;
-			}
-			if (summary->Profile_BitsDefining[0] & PROF_si_tide)
-			{
-			    int_ptr = (int *) &buffer[offset];
-			    *int_ptr = mb_swap_int(profile->tide); offset +=4;
-			}
-			if (summary->Profile_BitsDefining[0] & PROF_ui_vesselVelocity)
-			{
-			    int_ptr = (int *) &buffer[offset];
-			    *int_ptr = mb_swap_int(profile->vesselVelocity); offset +=4;
-			}
-		    }
-		    if (summary->Profile_BitsDefining[1])
-		    {
-		    if (summary->Profile_BitsDefining[1] & PROF_uc_power)
-		    {
-		    	buffer[offset] = profile->power; offset +=1;
-		    }
-		    if (summary->Profile_BitsDefining[1] & PROF_uc_TVG)
-		    {
-		    	buffer[offset] = profile->TVG; offset +=1;
-		    }
-		    if (summary->Profile_BitsDefining[1] & PROF_uc_attenuation)
-		    {
-		    	buffer[offset] = profile->attenuation; offset +=1;
-		    }
-		    if (summary->Profile_BitsDefining[1] & PROF_uc_edflag)
-		    {
-		    	buffer[offset] = profile->edflag; offset +=1;
-		    }
-		    if (summary->Profile_BitsDefining[1] & PROF_ui_soundVelocity)
-		    {
-		    	short_ptr = (short *) &buffer[offset];
-		    	*short_ptr = (short)mb_swap_short((short)profile->soundVelocity); offset +=2;
-		    }
-		    if (summary->Profile_BitsDefining[1] & PROF_ui_lengthImageDataField)
-		    {
-		    	short_ptr = (short *) &buffer[offset];
-		    	*short_ptr = (short)mb_swap_short((short)profile->lengthImageDataField); offset +=2;
-		    }
-		    if (summary->Profile_BitsDefining[1] & PROF_ui_pingNo)
-		    {
-		    	short_ptr = (short *) &buffer[offset];
-		    	*short_ptr = (short)mb_swap_short((short)profile->pingNo); offset +=2;
-		    }
-		    if (summary->Profile_BitsDefining[1] & PROF_uc_mode)
-		    {
-		    	buffer[offset] = profile->mode; offset +=1;
-		    }
-		    if (summary->Profile_BitsDefining[1] & PROF_uc_Q_factor)
-		    {
-		    	buffer[offset] = profile->Q_factor; offset +=1;
-		    }
-		    if (summary->Profile_BitsDefining[1] & PROF_uc_pulseLength)
-		    {
-		    buffer[offset] = profile->pulseLength; offset +=1;
-		    }
-		    if (summary->Profile_BitsDefining[1] & PROF_uc_unassigned)
-		    {
-		    	buffer[offset] = profile->unassigned; offset +=1;
-		    }
-		    if (summary->Profile_BitsDefining[1] & PROF_us_td_sound_speed)
-		    {
-		    	short_ptr = (short *) &buffer[offset];
-		    	*short_ptr = (short)mb_swap_short((short)profile->td_sound_speed); offset +=2;
-		    }
-		    if (summary->Profile_BitsDefining[1] & PROF_us_samp_rate)
-		    {
-		    	short_ptr = (short *) &buffer[offset];
-		    	*short_ptr = (short)mb_swap_short((short)profile->samp_rate); offset +=2;
-		    }
-		    if (summary->Profile_BitsDefining[1] & PROF_uc_z_res_cm)
-		    {
-		    	buffer[offset] = profile->z_res_cm; offset +=1;
-		    }
-		    if (summary->Profile_BitsDefining[1] & PROF_uc_xy_res_cm)
-		    {
-		    	buffer[offset] = profile->xy_res_cm; offset +=1;
-		    }
-		    }
-
-		if (summary->Profile_BitsDefining[2])
-		{
-		    if (summary->Profile_BitsDefining[2] & PROF_uc_ssp_source)
-		    {
-		    	buffer[offset] = profile->ssp_source; offset +=1;
-		    }
-		    if (summary->Profile_BitsDefining[2] & PROF_uc_filter_ID)
-		    {
-		    	buffer[offset] = profile->filter_ID; offset +=1;
-		    }
-		    if (summary->Profile_BitsDefining[2] & PROF_us_absorp_coeff)
-		    {
-		    	short_ptr = (short *) &buffer[offset];
-		    	*short_ptr = (short)mb_swap_short((short)profile->absorp_coeff); offset +=2;
-		    }
-		    if (summary->Profile_BitsDefining[2] & PROF_us_tx_pulse_len)
-		    {
-		    	short_ptr = (short *) &buffer[offset];
-		    	*short_ptr = (short)mb_swap_short((short)profile->tx_pulse_len); offset +=2;
-		    }
-		    if (summary->Profile_BitsDefining[2] & PROF_us_tx_beam_width)
-		    {
-			    short_ptr = (short *) &buffer[offset];
-			    *short_ptr = (short)mb_swap_short((short)profile->tx_beam_width); offset +=2;
-		    }
-		    if (summary->Profile_BitsDefining[2] & PROF_us_max_swath_width)
-		    {
-			    short_ptr = (short *) &buffer[offset];
-			    *short_ptr = (short)mb_swap_short((short)profile->max_swath_width); offset +=2;
-		    }
-		    if (summary->Profile_BitsDefining[2] & PROF_uc_tx_power_reduction)
-		    {
-		    	buffer[offset] = profile->tx_power_reduction; offset +=1;
-		    }
-		    if (summary->Profile_BitsDefining[2] & PROF_uc_rx_beam_width)
-		    {
-		    	buffer[offset] = profile->rx_beam_width; offset +=1;
-		    }
-		    if (summary->Profile_BitsDefining[2] & PROF_uc_rx_bandwidth)
-		    {
-		    	buffer[offset] = profile->rx_bandwidth; offset +=1;
-		    }
-		    if (summary->Profile_BitsDefining[2] & PROF_uc_rx_gain_reduction)
-		    {
-		    	buffer[offset] = profile->rx_gain_reduction; offset +=1;
-		    }
-		    if (summary->Profile_BitsDefining[2] & PROF_uc_tvg_crossover)
-		    {
-		    	buffer[offset] = profile->tvg_crossover; offset +=1;
-		    }
-		    if (summary->Profile_BitsDefining[2] & PROF_uc_beam_spacing)
-		    {
-		    	buffer[offset] = profile->beam_spacing; offset +=1;
-		    }
-		    if (summary->Profile_BitsDefining[2] & PROF_uc_coverage_sector)
-		    {
-		    	buffer[offset] = profile->coverage_sector; offset +=1;
-		    }
-		    if (summary->Profile_BitsDefining[2] & PROF_uc_yaw_stab_mode)
-		    {
-		   	buffer[offset] = profile->yaw_stab_mode; offset +=1;
-		    }
-		 }
-
-		  if (summary->Profile_BitsDefining[3])
-		    {
-		      if (summary->Profile_BitsDefining[3] & PROF_ss_longperiod_heaveCorrection)
-			{
-			  short_ptr = (short *) &buffer[offset];
-			  *short_ptr = (short)mb_swap_short((short)profile->longperiod_heaveCorrection); offset += 2;
-			}
-		      if (summary->Profile_BitsDefining[3] & PROF_ss_dynamic_draftCorrection)
-			{
-			  short_ptr = (short *) &buffer[offset];
-			  *short_ptr = (short)mb_swap_short((short)profile->dynamic_draftCorrection);
-			  offset += 2;
-			}
-		      if (summary->Profile_BitsDefining[3] & PROF_ss_deepdraftoffset_in_metres)
-			{
-			  short_ptr = (short *) &buffer[offset];
-			  *short_ptr = (short)mb_swap_short((short)profile->deepdraftoffset_in_metres);
-			  offset += 2;
-			}
-		      if (summary->Profile_BitsDefining[3] & PROF_ss_draft_at_Tx)
-			{
-			  short_ptr = (short *) &buffer[offset];
-			  *short_ptr = (short)mb_swap_short((short)profile->draft_at_Tx);
-			  offset += 2;
-			}
-		      if (summary->Profile_BitsDefining[3] & PROF_ss_alternateRoll)
-			{
-			  short_ptr = (short *) &buffer[offset];
-			  *short_ptr = (short)mb_swap_short((short)profile->alternateRoll);
-			  offset += 2;
-			}
-		      if (summary->Profile_BitsDefining[3] & PROF_ss_alternatePitch)
-			{
-			  short_ptr = (short *) &buffer[offset];
-			  *short_ptr = (short)mb_swap_short((short)profile->alternatePitch);
-			  offset += 2;
-			}
-		      if (summary->Profile_BitsDefining[3] & PROF_ss_alternateHeave)
-			{
-			  short_ptr = (short *) &buffer[offset];
-			  *short_ptr = (short)mb_swap_short((short)profile->alternateHeave);
-			  offset += 2;
-			}
-		      if (summary->Profile_BitsDefining[3] & PROF_us_alternateHeading)
-			{
-			  short_ptr = (short *) &buffer[offset];
-			  *short_ptr = (short)mb_swap_short((short)profile->alternateHeading);
-			  offset += 2;
-			}
-		      if (summary->Profile_BitsDefining[3] & PROF_us_standaloneHeading)
-			{
-			  short_ptr = (short *) &buffer[offset];
-			  *short_ptr = (short)mb_swap_short((short)profile->standaloneHeading);
-			  offset += 2;
-			}
-		      if (summary->Profile_BitsDefining[3] & PROF_ss_RTK_at_RP)
-			{
-			  short_ptr = (short *) &buffer[offset];
-			  *short_ptr = (short)mb_swap_short((short)profile->RTK_at_RP);
-			  offset += 2;
-			}
-		      if (summary->Profile_BitsDefining[3] & PROF_ss_Lowpass_RTK_at_RP)
-			{
-			  short_ptr = (short *) &buffer[offset];
-			  *short_ptr = (short)mb_swap_short((short)profile->Lowpass_RTK_at_RP);
-			  offset += 2;
-			}
-		      if (summary->Profile_BitsDefining[3] & PROF_ss_WLZ)
-			{
-			  short_ptr = (short *) &buffer[offset];
-			  *short_ptr = (short)mb_swap_short((short)profile->WLZ);
-			  offset += 2;
-			}
-		      if (summary->Profile_BitsDefining[3] & PROF_us_samp_rate_SecondHead)
-			{
-			  short_ptr = (short *) &buffer[offset];
-			  *short_ptr = (short)mb_swap_short((short)profile->samp_rate_SecondHead);
-			  offset += 2;
-			}
-		      if (summary->Profile_BitsDefining[3] & PROF_si_clock_drift_millis)
-			{
-			  int_ptr = (int *) &buffer[offset];
-			  *int_ptr = mb_swap_int(profile->clock_drift_millis);
-			  offset += 4;
-			}
-		      if (summary->Profile_BitsDefining[3] & PROF_ui_watercol_offset)
-			{
-			  int_ptr = (int *) &buffer[offset];
-			  *int_ptr = mb_swap_int(profile->watercol_offset);
-			  offset += 4;
-			}
-		      if (summary->Profile_BitsDefining[3] & PROF_ui_watercol_size)
-			{
-			  int_ptr = (int *) &buffer[offset];
-			  *int_ptr = mb_swap_int(profile->watercol_size);
-			  offset += 4;
-			}
-		      if (summary->Profile_BitsDefining[3] & PROF_ui_watercol_offset_2nd)
-			{
-			  int_ptr = (int *) &buffer[offset];
-			  *int_ptr = mb_swap_int(profile->watercol_offset_2nd);
-			  offset += 4;
-			}
-		      if (summary->Profile_BitsDefining[3] & PROF_ui_watercol_size_2nd)
-			{
-			  int_ptr = (int *) &buffer[offset];
-			  *int_ptr = mb_swap_int(profile->watercol_size_2nd);
-			  offset += 4;
-			}
-		      if (summary->Profile_BitsDefining[3] &
-			  PROF_us_range_to_normal_incidence)
-			{
-			  short_ptr = (short *) &buffer[offset];
-			  *short_ptr = (short)mb_swap_short((short)profile->range_to_normal_incidence);
-			  offset += 2;
-			}
-		      if (summary->Profile_BitsDefining[3] & PROF_ui_laser_timestampRef)
-			{
-			  int_ptr = (int *) &buffer[offset];
-			  *int_ptr = mb_swap_int(profile->laser_timestampRef);
-			  offset += 4;
-			}
-		      if (summary->Profile_BitsDefining[3] & PROF_ui_tx_sector_offset)
-			{
-			  int_ptr = (int *) &buffer[offset];
-			  *int_ptr = mb_swap_int(profile->tx_sector_offset);
-			  offset += 4;
-			}
-		      if (summary->Profile_BitsDefining[3] & PROF_us_num_tx_sectors)
-			{
-			  short_ptr = (short *) &buffer[offset];
-			  *short_ptr = (short)mb_swap_short((short)profile->num_tx_sectors);
-			  offset += 2;
-			}
-		    }
-
-		  if (summary->Profile_BitsDefining[4])
-		    {
-		      if (summary->Profile_BitsDefining[4] & PROF_st_params_PORT)
-			{
-
-			  if (summary->Profile_BitsDefining[4] & PROF_us_txBeamIndex)
-			    {
-			      short_ptr = (short *) &buffer[offset];
-			      *short_ptr = (short)mb_swap_short((short)profile->params[0].txBeamIndex);
-			      offset += 2;
-			    }
-			  if (summary->Profile_BitsDefining[4] & PROF_us_txLevel)
-			    {
-			      short_ptr = (short *) &buffer[offset];
-			      *short_ptr = (short)mb_swap_short((short)profile->params[0].txLevel);
-			      offset += 2;
-			    }
-			  if (summary->Profile_BitsDefining[4] & PROF_ss_txBeamAngle)
-			    {
-			      short_ptr = (short *) &buffer[offset];
-			      *short_ptr = (short)mb_swap_short((short)profile->params[0].txBeamAngle);
-			      offset += 2;
-			    }
-			  if (summary->Profile_BitsDefining[4] & PROF_us_txPulseLength)
-			    {
-			      short_ptr = (short *) &buffer[offset];
-			      *short_ptr = (short)mb_swap_short((short)profile->params[0].txPulseLength);
-			      offset += 2;
-			    }
-			  if (summary->Profile_BitsDefining[4] & PROF_ui_ss_offset)
-			    {
-			      int_ptr = (int *) &buffer[offset];
-			      *int_ptr = mb_swap_int(profile->params[0].ss_offset);
-			      offset += 4;
-			    }
-			  if (summary->Profile_BitsDefining[4] & PROF_us_no_skipped_ss)
-			    {
-			      short_ptr = (short *) &buffer[offset];
-			      *short_ptr = (short)mb_swap_short((short)profile->params[0].no_skipped_ss);
-			      offset += 2;
-			    }
-			  if (summary->Profile_BitsDefining[4] & PROF_us_no_acquired_ss)
-			    {
-			      short_ptr = (short *) &buffer[offset];
-			      *short_ptr = (short)mb_swap_short((short)profile->params[0].no_acquired_ss);
-			      offset += 2;
-			    }
-			  if (summary->Profile_BitsDefining[4] & PROF_us_ss_sample_interval)
-			    {
-			      short_ptr = (short *) &buffer[offset];
-			      *short_ptr = (short)mb_swap_short((short)profile->params[0].ss_sample_interval);
-			      offset += 2;
-			    }
-			  if (summary->Profile_BitsDefining[4] & PROF_us_bscatClass)
-			    {
-			      short_ptr = (short *) &buffer[offset];
-			      *short_ptr = (short)mb_swap_short((short)profile->params[0].bscatClass);
-			      offset += 2;
-			    }
-			  if (summary->Profile_BitsDefining[4] & PROF_us_nrActualGainSets)
-			    {
-			      short_ptr = (short *) &buffer[offset];
-
-			      *short_ptr = (short)mb_swap_short((short)profile->params[0].nrActualGainSets);
-			      offset += 2;
-			    }
-			  if (summary->Profile_BitsDefining[4] & PROF_ss_rxGup)
-			    {
-			      short_ptr = (short *) &buffer[offset];
-			      *short_ptr = (short)mb_swap_short((short)profile->params[0].rxGup);
-			      offset += 2;
-			    }
-			  if (summary->Profile_BitsDefining[4] & PROF_ss_rxGain)
-			    {
-			      short_ptr = (short *) &buffer[offset];
-			      *short_ptr = (short)mb_swap_short((short)profile->params[0].rxGain);
-			      offset += 2;
-			    }
-			  if (summary->Profile_BitsDefining[4] & PROF_ss_ar)
-			    {
-			      short_ptr = (short *) &buffer[offset];
-			      *short_ptr = (short)mb_swap_short((short)profile->params[0].ar);
-			      offset += 2;
-			    }
-			  /* hard wired, that if present, there are 20 of them irrespective */
-			  if (summary->Profile_BitsDefining[4] & PROF_us_rxtimeARRAY)
-			    {
-			      for (i = 0; i < 20; i++)
-				{
-				  short_ptr = (short *) &buffer[offset];
-				  *short_ptr = (short)mb_swap_short((short)profile->params[0].rxtime[i]);
-				  offset += 2;
-				}
-			    }
-			  if (summary->Profile_BitsDefining[4] & PROF_ss_rxgainARRAY)
-			    {
-			      for (i = 0; i < 20; i++)
-				{
-				  short_ptr = (short *) &buffer[offset];
-				  *short_ptr = (short)mb_swap_short((short)profile->params[0].rxgain[i]);
-				  offset += 2;
-				}
-			    }
-			} /* if port is present */
-
-		      if (summary->Profile_BitsDefining[4] & PROF_st_params_STBD)
-			{
-
-			  if (summary->Profile_BitsDefining[4] & PROF_us_txBeamIndex)
-			    {
-			      short_ptr = (short *) &buffer[offset];
-			      *short_ptr = (short)mb_swap_short((short)profile->params[1].txBeamIndex);
-			      offset += 2;
-			    }
-			  if (summary->Profile_BitsDefining[4] & PROF_us_txLevel)
-			    {
-			      short_ptr = (short *) &buffer[offset];
-			      *short_ptr = (short)mb_swap_short((short)profile->params[1].txLevel);
-			      offset += 2;
-			    }
-			  if (summary->Profile_BitsDefining[4] & PROF_ss_txBeamAngle)
-			    {
-			      short_ptr = (short *) &buffer[offset];
-			      *short_ptr = (short)mb_swap_short((short)profile->params[1].txBeamAngle);
-			      offset += 2;
-			    }
-			  if (summary->Profile_BitsDefining[4] & PROF_us_txPulseLength)
-			    {
-			      short_ptr = (short *) &buffer[offset];
-			      *short_ptr = (short)mb_swap_short((short)profile->params[1].txPulseLength);
-			      offset += 2;
-			    }
-			  if (summary->Profile_BitsDefining[4] & PROF_ui_ss_offset)
-			    {
-			      int_ptr = (int *) &buffer[offset];
-			      *int_ptr = mb_swap_int(profile->params[1].ss_offset);
-			      offset += 4;
-			    }
-			  if (summary->Profile_BitsDefining[4] & PROF_us_no_skipped_ss)
-			    {
-			      short_ptr = (short *) &buffer[offset];
-			      *short_ptr = (short)mb_swap_short((short)profile->params[1].no_skipped_ss);
-			      offset += 2;
-			    }
-			  if (summary->Profile_BitsDefining[4] & PROF_us_no_acquired_ss)
-			    {
-			      short_ptr = (short *) &buffer[offset];
-			      *short_ptr = (short)mb_swap_short((short)profile->params[1].no_acquired_ss);
-			      offset += 2;
-			    }
-			  if (summary->Profile_BitsDefining[4] & PROF_us_ss_sample_interval)
-			    {
-			      short_ptr = (short *) &buffer[offset];
-			      *short_ptr = (short)mb_swap_short((short)profile->params[1].ss_sample_interval);
-			      offset += 2;
-			    }
-			  if (summary->Profile_BitsDefining[4] & PROF_us_bscatClass)
-			    {
-			      short_ptr = (short *) &buffer[offset];
-			      *short_ptr = (short)mb_swap_short((short)profile->params[1].bscatClass);
-			      offset += 2;
-			    }
-			  if (summary->Profile_BitsDefining[4] & PROF_us_nrActualGainSets)
-			    {
-			      short_ptr = (short *) &buffer[offset];
-			      *short_ptr = (short)mb_swap_short((short)profile->params[1].nrActualGainSets);
-			      offset += 2;
-			    }
-			  if (summary->Profile_BitsDefining[4] & PROF_ss_rxGup)
-			    {
-			      short_ptr = (short *) &buffer[offset];
-			      *short_ptr = (short)mb_swap_short((short)profile->params[1].rxGup);
-			      offset += 2;
-			    }
-			  if (summary->Profile_BitsDefining[4] & PROF_ss_rxGain)
-			    {
-			      short_ptr = (short *) &buffer[offset];
-			      *short_ptr = (short)mb_swap_short((short)profile->params[1].rxGain);
-			      offset += 2;
-			    }
-			  if (summary->Profile_BitsDefining[4] & PROF_ss_ar)
-			    {
-			      short_ptr = (short *) &buffer[offset];
-			      *short_ptr = (short)mb_swap_short((short)profile->params[1].ar);
-			      offset += 2;
-			    }
-			  /* hard wired, that if present, there are 20 of them irrespective */
-			  if (summary->Profile_BitsDefining[4] & PROF_us_rxtimeARRAY)
-			    {
-			      for (i = 0; i < 20; i++)
-				{
-				  short_ptr = (short *) &buffer[offset];
-				  *short_ptr = (short)mb_swap_short((short)profile->params[1].rxtime[i]);
-				  offset += 2;
-				}
-			    }
-			  if (summary->Profile_BitsDefining[4] & PROF_ss_rxgainARRAY)
-			    {
-			      for (i = 0; i < 20; i++)
-				{
-				  short_ptr = (short *) &buffer[offset];
-				  *short_ptr = (short)mb_swap_short((short)profile->params[1].rxgain[i]);
-				  offset += 2;
-				}
-			    }
-
-			} /* if stbd is present */
-		    }
-
-		  if (summary->Profile_BitsDefining[5])
-		    {
-		      if (summary->Profile_BitsDefining[5] & PROF_si_transducerDepth)
-			{
-			  int_ptr = (int *) &buffer[offset];
-			  *int_ptr = mb_swap_int(profile->transducerDepth);
-			  offset += 4;
-			}
-		      if (summary->Profile_BitsDefining[5] & PROF_si_transducerPitch)
-			{
-			  int_ptr = (int *) &buffer[offset];
-			  *int_ptr = mb_swap_int(profile->transducerDepth);
-			  offset += 4;
-			}
-		      if (summary->Profile_BitsDefining[5] & PROF_si_transducerRoll)
-			{
-			  int_ptr = (int *) &buffer[offset];
-			  *int_ptr = mb_swap_int(profile->transducerDepth);
-			  offset += 4;
-			}
-		      if (summary->Profile_BitsDefining[5] & PROF_ui_transducerHeading)
-			{
-			  int_ptr = (int *) &buffer[offset];
-			  *int_ptr = mb_swap_int(profile->transducerDepth);
-			  offset += 4;
-			}
-		      if (summary->Profile_BitsDefining[5] & PROF_si_transducerLatOffset)
-			{
-			  int_ptr = (int *) &buffer[offset];
-			  *int_ptr = mb_swap_int(profile->transducerDepth);
-			  offset += 4;
-			}
-		      if (summary->Profile_BitsDefining[5] & PROF_si_transducerLongOffset)
-			{
-			  int_ptr = (int *) &buffer[offset];
-			  *int_ptr = mb_swap_int(profile->transducerDepth);
-			  offset += 4;
-			}
-		      if (summary->Profile_BitsDefining[5] & PROF_ui_transducerSlantRange)
-			{
-			  int_ptr = (int *) &buffer[offset];
-			  *int_ptr = mb_swap_int(profile->transducerDepth);
-			  offset += 4;
-			}
-		      if (summary->Profile_BitsDefining[5] & PROF_si_transducerAcross)
-			{
-			  int_ptr = (int *) &buffer[offset];
-			  *int_ptr = mb_swap_int(profile->transducerDepth);
-			  offset += 4;
-			}
-		      if (summary->Profile_BitsDefining[5] & PROF_si_transducerAlong)
-			{
-			  int_ptr = (int *) &buffer[offset];
-			  *int_ptr = mb_swap_int(profile->transducerDepth);
-			  offset += 4;
-			}
-		      if (summary->Profile_BitsDefining[5] & PROF_ui_transducerBearing)
-			{
-			  int_ptr = (int *) &buffer[offset];
-			  *int_ptr = mb_swap_int(profile->transducerDepth);
-			  offset += 4;
-			}
-		    }
-
-		  if (summary->Profile_BitsDefining[6])
-		    {
-		      if (summary->Profile_BitsDefining[6] & PROF_ui_sonar_settings_offset)
-			{
-			  int_ptr = (int *) &buffer[offset];
-			  *int_ptr = mb_swap_int(profile->sonar_settings_offset);
-			  offset += 4;
-			}
-		      if (summary->Profile_BitsDefining[6] & PROF_ui_ping_number)
-			{
-			  int_ptr = (int *) &buffer[offset];
-			  *int_ptr = mb_swap_int(profile->ping_number);
-			  offset += 4;
-			}
-		      if (summary->Profile_BitsDefining[6] & PROF_us_multi_ping_sequence)
-			{
-			  short_ptr = (short *) &buffer[offset];
-			  *short_ptr = (short)mb_swap_short((short)profile->multi_ping_sequence);
-			  offset += 2;
-			}
-		      if (summary->Profile_BitsDefining[6] & PROF_ui_num_beams)
-			{
-			  int_ptr = (int *) &buffer[offset];
-			  *int_ptr = mb_swap_int(profile->num_beams);
-			  offset += 4;
-			}
-		      if (summary->Profile_BitsDefining[6] & PROF_uc_layer_compensation_flag)
-			{
-			  buffer[offset]= profile->layer_compensation_flag;
-			  offset += 1;
-			}
-		      if (summary->Profile_BitsDefining[6] & PROF_f_bs_beam_position)
-			{
-			  float_ptr = (float *) &buffer[offset];
-			  mb_swap_float(&profile->bs_beam_position);
-			  *float_ptr = profile->bs_beam_position;
-			  offset += 4;
-			}
-		      if (summary->Profile_BitsDefining[6] & PROF_ui_bs_control_flags)
-			{
-			  int_ptr = (int *) &buffer[offset];
-			  *int_ptr = mb_swap_int(profile->bs_control_flags);
-			  offset += 4;
-			}
-		      if (summary->Profile_BitsDefining[6] & PROF_us_bs_num_beams_per_side)
-			{
-			  short_ptr = (short *) &buffer[offset];
-			  *short_ptr = (short)mb_swap_short((short)profile->bs_num_beams_per_side);
-			  offset += 2;
-			}
-		      if (summary->Profile_BitsDefining[6] & PROF_us_bs_current_beam_number)
-			{
-			  short_ptr = (short *) &buffer[offset];
-			  *short_ptr = (short)mb_swap_short((short)profile->bs_current_beam_number);
-			  offset += 2;
-			}
-		      if (summary->Profile_BitsDefining[6] & PROF_uc_bs_sample_descriptor)
-			{
-			  buffer[offset] = profile->bs_sample_descriptor;
-			  offset += 1;
-			}
-		      if (summary->Profile_BitsDefining[6] & PROF_ui_snippet_sample_descriptor)
-			{
-			  int_ptr = (int *) &buffer[offset];
-			  *int_ptr = mb_swap_int(profile->snippet_sample_descriptor);
-			  offset += 4;
-			}
-		    }
-#else
-		    if (summary->Profile_BitsDefining[0])
-		    {
-			if (summary->Profile_BitsDefining[0] & PROF_ui_status)
-			{
-			     buffer[offset] = profile->status;
-			     offset +1;
-
-			}
-			if (summary->Profile_BitsDefining[0] & PROF_ui_numDepths)
-			{
-			    short_ptr = (short *) &buffer[offset];
-			    *short_ptr = profile->numDepths; offset +=2;
-			}
-			if (summary->Profile_BitsDefining[0] & PROF_ui_timeOffset)
-			{
-			    int_ptr = (int *) &buffer[offset];
-			    *int_ptr = profile->timeOffset; offset +=4;
-			}
-			if (summary->Profile_BitsDefining[0] & PROF_ui_vesselLatOffset)
-			{
-			    int_ptr = (int *) &buffer[offset];
-			    *int_ptr = profile->vesselLatOffset; offset +=4;
-			}
-			if (summary->Profile_BitsDefining[0] & PROF_ui_vesselLongOffset)
-			{
-			    int_ptr = (int *) &buffer[offset];
-			    *int_ptr = profile->vesselLongOffset; offset +=4;
-			}
-			if (summary->Profile_BitsDefining[0] & PROF_ui_vesselHeading)
-			{
-			    short_ptr = (short *) &buffer[offset];
-			    *short_ptr = profile->vesselHeading / 1000; offset +=2;
-			 }
-			if (summary->Profile_BitsDefining[0] & PROF_si_vesselHeave)
-			{
-			    short_ptr = (short *) &buffer[offset];
-			    *short_ptr = profile->vesselHeave; offset +=2;
-			}
-			if (summary->Profile_BitsDefining[0] & PROF_si_vesselPitch)
-			{
-			    short_ptr = (short *) &buffer[offset];
-			    *short_ptr = profile->vesselPitch / 1000; offset +=2;
-			}
-			if (summary->Profile_BitsDefining[0] & PROF_si_vesselRoll)
-			{
-			    short_ptr = (short *) &buffer[offset];
-			    *short_ptr = profile->vesselRoll / 1000; offset +=2;
-			}
-			if (summary->Profile_BitsDefining[0] & PROF_si_tide)
-			{
-			    int_ptr = (int *) &buffer[offset];
-			    *int_ptr = profile->tide; offset +=4;
-			}
-			if (summary->Profile_BitsDefining[0] & PROF_ui_vesselVelocity)
-			{
-			    int_ptr = (int *) &buffer[offset];
-			    *int_ptr = profile->vesselVelocity; offset +=4;
-			}
-		    }
-		    if (summary->Profile_BitsDefining[1])
-		    {
-		    if (summary->Profile_BitsDefining[1] & PROF_uc_power)
-		    {
-		    	buffer[offset] = profile->power; offset +=1;
-		    }
-		    if (summary->Profile_BitsDefining[1] & PROF_uc_TVG)
-		    {
-		    	buffer[offset] = profile->TVG; offset +=1;
-		    }
-		    if (summary->Profile_BitsDefining[1] & PROF_uc_attenuation)
-		    {
-		    	buffer[offset] = profile->attenuation; offset +=1;
-		    }
-		    if (summary->Profile_BitsDefining[1] & PROF_uc_edflag)
-		    {
-		    	buffer[offset] = profile->edflag; offset +=1;
-		    }
-		    if (summary->Profile_BitsDefining[1] & PROF_ui_soundVelocity)
-		    {
-		    	short_ptr = (short *) &buffer[offset];
-		    	*short_ptr = profile->soundVelocity; offset +=2;
-		    }
-		    if (summary->Profile_BitsDefining[1] & PROF_ui_lengthImageDataField)
-		    {
-			    short_ptr = (short *) &buffer[offset];
-			    *short_ptr = profile->lengthImageDataField; offset +=2;
-		    }
-		    if (summary->Profile_BitsDefining[1] & PROF_ui_pingNo)
-		    {
-			    short_ptr = (short *) &buffer[offset];
-			    *short_ptr = profile->pingNo; offset +=2;
-		    }
-		    if (summary->Profile_BitsDefining[1] & PROF_uc_mode)
-		    {
-		    	buffer[offset] = profile->mode; offset +=1;
-		    }
-		    if (summary->Profile_BitsDefining[1] & PROF_uc_Q_factor)
-		    {
-		   	buffer[offset] = profile->Q_factor; offset +=1;
-		    }
-		    if (summary->Profile_BitsDefining[1] & PROF_uc_pulseLength)
-		    {
-		    	buffer[offset] = profile->pulseLength; offset +=1;
-		    }
-		    if (summary->Profile_BitsDefining[1] & PROF_uc_unassigned)
-		    {
-		    buffer[offset] = profile->unassigned; offset +=1;
-		    }
-		    if (summary->Profile_BitsDefining[1] & PROF_us_td_sound_speed)
-		    {
-			    short_ptr = (short *) &buffer[offset];
-			    *short_ptr = (short)profile->td_sound_speed; offset +=2;
-		    }
-		    if (summary->Profile_BitsDefining[1] & PROF_us_samp_rate)
-		    {
-			    short_ptr = (short *) &buffer[offset];
-			    *short_ptr = (short)profile->samp_rate; offset +=2;
-		    }
-		    if (summary->Profile_BitsDefining[1] & PROF_uc_z_res_cm)
-		    {
-		    	buffer[offset] = profile->z_res_cm; offset +=1;
-		    }
-		    if (summary->Profile_BitsDefining[1] & PROF_uc_xy_res_cm)
-		    {
-		    	buffer[offset] = profile->xy_res_cm; offset +=1;
-		    }
-		    }
-
-		if (summary->Profile_BitsDefining[2])
-		{
-		    if (summary->Profile_BitsDefining[2] & PROF_uc_ssp_source)
-		    {
-		    	buffer[offset] = profile->ssp_source; offset +=1;
-		    }
-		    if (summary->Profile_BitsDefining[2] & PROF_uc_filter_ID)
-		    {
-		    	buffer[offset] = profile->filter_ID; offset +=1;
-		    }
-		    if (summary->Profile_BitsDefining[2] & PROF_us_absorp_coeff)
-		    {
-			    short_ptr = (short *) &buffer[offset];
-			    *short_ptr = (short)profile->absorp_coeff; offset +=2;
-		    }
-		    if (summary->Profile_BitsDefining[2] & PROF_us_tx_pulse_len)
-		    {
-			    short_ptr = (short *) &buffer[offset];
-			    *short_ptr = (short)profile->tx_pulse_len; offset +=2;
-		    }
-		    if (summary->Profile_BitsDefining[2] & PROF_us_tx_beam_width)
-		    {
-			    short_ptr = (short *) &buffer[offset];
-			    *short_ptr = (short)profile->tx_beam_width; offset +=2;
-		    }
-		    if (summary->Profile_BitsDefining[2] & PROF_us_max_swath_width)
-		    {
-			    short_ptr = (short *) &buffer[offset];
-			    *short_ptr = (short)profile->max_swath_width; offset +=2;
-		    }
-		    if (summary->Profile_BitsDefining[2] & PROF_uc_tx_power_reduction)
-		    {
-		    	buffer[offset] = profile->tx_power_reduction; offset +=1;
-		    }
-		    if (summary->Profile_BitsDefining[2] & PROF_uc_rx_beam_width)
-		    {
-		    	buffer[offset] = profile->rx_beam_width; offset +=1;
-		    }
-		    if (summary->Profile_BitsDefining[2] & PROF_uc_rx_bandwidth)
-		    {
-		    	buffer[offset] = profile->rx_bandwidth; offset +=1;
-		    }
-		    if (summary->Profile_BitsDefining[2] & PROF_uc_rx_gain_reduction)
-		    {
-		   	buffer[offset] = profile->rx_gain_reduction; offset +=1;
-		    }
-		    if (summary->Profile_BitsDefining[2] & PROF_uc_tvg_crossover)
-		    {
-		    	buffer[offset] = profile->tvg_crossover; offset +=1;
-		    }
-		    if (summary->Profile_BitsDefining[2] & PROF_uc_beam_spacing)
-		    {
-		    	buffer[offset] = profile->beam_spacing; offset +=1;
-		    }
-		    if (summary->Profile_BitsDefining[2] & PROF_uc_coverage_sector)
-		    {
-		    	buffer[offset] = profile->coverage_sector; offset +=1;
-		    }
-		    if (summary->Profile_BitsDefining[2] & PROF_uc_yaw_stab_mode)
-		    {
-		    	buffer[offset] = profile->yaw_stab_mode; offset +=1;
-		    }
-		 }
-
-		  if (summary->Profile_BitsDefining[3])
-		    {
-		      if (summary->Profile_BitsDefining[3] & PROF_ss_longperiod_heaveCorrection)
-			{
-			  short_ptr = (short *) &buffer[offset];
-			  *short_ptr = (short)profile->longperiod_heaveCorrection; offset += 2;
-			}
-		      if (summary->Profile_BitsDefining[3] & PROF_ss_dynamic_draftCorrection)
-			{
-			  short_ptr = (short *) &buffer[offset];
-			  *short_ptr = (short)profile->dynamic_draftCorrection;
-			  offset += 2;
-			}
-		      if (summary->Profile_BitsDefining[3] & PROF_ss_deepdraftoffset_in_metres)
-			{
-			  short_ptr = (short *) &buffer[offset];
-			  *short_ptr = (short)profile->deepdraftoffset_in_metres;
-			  offset += 2;
-			}
-		      if (summary->Profile_BitsDefining[3] & PROF_ss_draft_at_Tx)
-			{
-			  short_ptr = (short *) &buffer[offset];
-			  *short_ptr = (short)profile->draft_at_Tx;
-			  offset += 2;
-			}
-		      if (summary->Profile_BitsDefining[3] & PROF_ss_alternateRoll)
-			{
-			  short_ptr = (short *) &buffer[offset];
-			  *short_ptr = (short)profile->alternateRoll;
-			  offset += 2;
-			}
-		      if (summary->Profile_BitsDefining[3] & PROF_ss_alternatePitch)
-			{
-			  short_ptr = (short *) &buffer[offset];
-			  *short_ptr = (short)profile->alternatePitch;
-			  offset += 2;
-			}
-		      if (summary->Profile_BitsDefining[3] & PROF_ss_alternateHeave)
-			{
-			  short_ptr = (short *) &buffer[offset];
-			  *short_ptr = (short)profile->alternateHeave;
-			  offset += 2;
-			}
-		      if (summary->Profile_BitsDefining[3] & PROF_us_alternateHeading)
-			{
-			  short_ptr = (short *) &buffer[offset];
-			  *short_ptr = (short)profile->alternateHeading;
-			  offset += 2;
-			}
-		      if (summary->Profile_BitsDefining[3] & PROF_us_standaloneHeading)
-			{
-			  short_ptr = (short *) &buffer[offset];
-			  *short_ptr = (short)profile->standaloneHeading;
-			  offset += 2;
-			}
-		      if (summary->Profile_BitsDefining[3] & PROF_ss_RTK_at_RP)
-			{
-			  short_ptr = (short *) &buffer[offset];
-			  *short_ptr = (short)profile->RTK_at_RP;
-			  offset += 2;
-			}
-		      if (summary->Profile_BitsDefining[3] & PROF_ss_Lowpass_RTK_at_RP)
-			{
-			  short_ptr = (short *) &buffer[offset];
-			  *short_ptr = (short)profile->Lowpass_RTK_at_RP;
-			  offset += 2;
-			}
-		      if (summary->Profile_BitsDefining[3] & PROF_ss_WLZ)
-			{
-			  short_ptr = (short *) &buffer[offset];
-			  *short_ptr = (short)profile->WLZ;
-			  offset += 2;
-			}
-		      if (summary->Profile_BitsDefining[3] & PROF_us_samp_rate_SecondHead)
-			{
-			  short_ptr = (short *) &buffer[offset];
-			  *short_ptr = (short)profile->samp_rate_SecondHead;
-			  offset += 2;
-			}
-		      if (summary->Profile_BitsDefining[3] & PROF_si_clock_drift_millis)
-			{
-			  int_ptr = (int *) &buffer[offset];
-			  *int_ptr = profile->clock_drift_millis;
-			  offset += 4;
-			}
-		      if (summary->Profile_BitsDefining[3] & PROF_ui_watercol_offset)
-			{
-			  int_ptr = (int *) &buffer[offset];
-			  *int_ptr = profile->watercol_offset;
-			  offset += 4;
-			}
-		      if (summary->Profile_BitsDefining[3] & PROF_ui_watercol_size)
-			{
-			  int_ptr = (int *) &buffer[offset];
-			  *int_ptr = profile->watercol_size;
-			  offset += 4;
-			}
-		      if (summary->Profile_BitsDefining[3] & PROF_ui_watercol_offset_2nd)
-			{
-			  int_ptr = (int *) &buffer[offset];
-			  *int_ptr = profile->watercol_offset_2nd;
-			  offset += 4;
-			}
-		      if (summary->Profile_BitsDefining[3] & PROF_ui_watercol_size_2nd)
-			{
-			  int_ptr = (int *) &buffer[offset];
-			  *int_ptr = profile->watercol_size_2nd;
-			  offset += 4;
-			}
-		      if (summary->Profile_BitsDefining[3] &
-			  PROF_us_range_to_normal_incidence)
-			{
-			  short_ptr = (short *) &buffer[offset];
-			  *short_ptr = (short)profile->range_to_normal_incidence;
-			  offset += 2;
-			}
-		      if (summary->Profile_BitsDefining[3] & PROF_ui_laser_timestampRef)
-			{
-			  int_ptr = (int *) &buffer[offset];
-			  *int_ptr = profile->laser_timestampRef;
-			  offset += 4;
-			}
-		      if (summary->Profile_BitsDefining[3] & PROF_ui_tx_sector_offset)
-			{
-			  int_ptr = (int *) &buffer[offset];
-			  *int_ptr = profile->tx_sector_offset;
-			  offset += 4;
-			}
-		      if (summary->Profile_BitsDefining[3] & PROF_us_num_tx_sectors)
-			{
-			  short_ptr = (short *) &buffer[offset];
-			  *short_ptr = (short)profile->num_tx_sectors;
-			  offset += 2;
-			}
-		    }
-
-		  if (summary->Profile_BitsDefining[4])
-		    {
-		      if (summary->Profile_BitsDefining[4] & PROF_st_params_PORT)
-			{
-
-			  if (summary->Profile_BitsDefining[4] & PROF_us_txBeamIndex)
-			    {
-			      short_ptr = (short *) &buffer[offset];
-			      *short_ptr = (short)profile->params[0].txBeamIndex;
-			      offset += 2;
-			    }
-			  if (summary->Profile_BitsDefining[4] & PROF_us_txLevel)
-			    {
-			      short_ptr = (short *) &buffer[offset];
-			      *short_ptr = (short)profile->params[0].txLevel;
-			      offset += 2;
-			    }
-			  if (summary->Profile_BitsDefining[4] & PROF_ss_txBeamAngle)
-			    {
-			      short_ptr = (short *) &buffer[offset];
-			      *short_ptr = (short)profile->params[0].txBeamAngle;
-			      offset += 2;
-			    }
-			  if (summary->Profile_BitsDefining[4] & PROF_us_txPulseLength)
-			    {
-			      short_ptr = (short *) &buffer[offset];
-			      *short_ptr = (short)profile->params[0].txPulseLength;
-			      offset += 2;
-			    }
-			  if (summary->Profile_BitsDefining[4] & PROF_ui_ss_offset)
-			    {
-			      int_ptr = (int *) &buffer[offset];
-			      *int_ptr = profile->params[0].ss_offset;
-			      offset += 4;
-			    }
-			  if (summary->Profile_BitsDefining[4] & PROF_us_no_skipped_ss)
-			    {
-			      short_ptr = (short *) &buffer[offset];
-			      *short_ptr = (short)profile->params[0].no_skipped_ss;
-			      offset += 2;
-			    }
-			  if (summary->Profile_BitsDefining[4] & PROF_us_no_acquired_ss)
-			    {
-			      short_ptr = (short *) &buffer[offset];
-			      *short_ptr = (short)profile->params[0].no_acquired_ss;
-			      offset += 2;
-			    }
-			  if (summary->Profile_BitsDefining[4] & PROF_us_ss_sample_interval)
-			    {
-			      short_ptr = (short *) &buffer[offset];
-			      *short_ptr = (short)profile->params[0].ss_sample_interval;
-			      offset += 2;
-			    }
-			  if (summary->Profile_BitsDefining[4] & PROF_us_bscatClass)
-			    {
-			      short_ptr = (short *) &buffer[offset];
-			      *short_ptr = (short)profile->params[0].bscatClass;
-			      offset += 2;
-			    }
-			  if (summary->Profile_BitsDefining[4] & PROF_us_nrActualGainSets)
-			    {
-			      short_ptr = (short *) &buffer[offset];
-			      *short_ptr = profile->params[0].nrActualGainSets;
-			      offset += 2;
-			    }
-			  if (summary->Profile_BitsDefining[4] & PROF_ss_rxGup)
-			    {
-			      short_ptr = (short *) &buffer[offset];
-			      *short_ptr = (short)profile->params[0].rxGup;
-			      offset += 2;
-			    }
-			  if (summary->Profile_BitsDefining[4] & PROF_ss_rxGain)
-			    {
-			      short_ptr = (short *) &buffer[offset];
-			      *short_ptr = (short)profile->params[0].rxGain;
-			      offset += 2;
-			    }
-			  if (summary->Profile_BitsDefining[4] & PROF_ss_ar)
-			    {
-			      short_ptr = (short *) &buffer[offset];
-			      *short_ptr = (short)profile->params[0].ar;
-			      offset += 2;
-			    }
-			  /* hard wired, that if present, there are 20 of them irrespective */
-			  if (summary->Profile_BitsDefining[4] & PROF_us_rxtimeARRAY)
-			    {
-			      for (i = 0; i < 20; i++)
-				{
-				  short_ptr = (short *) &buffer[offset];
-				  *short_ptr = (short)profile->params[0].rxtime[i];
-				  offset += 2;
-				}
-			    }
-			  if (summary->Profile_BitsDefining[4] & PROF_ss_rxgainARRAY)
-			    {
-			      for (i = 0; i < 20; i++)
-				{
-				  short_ptr = (short *) &buffer[offset];
-				  *short_ptr = (short)profile->params[0].rxgain[i];
-				  offset += 2;
-				}
-			    }
-			} /* if port is present */
-
-		      if (summary->Profile_BitsDefining[4] & PROF_st_params_STBD)
-			{
-
-			  if (summary->Profile_BitsDefining[4] & PROF_us_txBeamIndex)
-			    {
-			      short_ptr = (short *) &buffer[offset];
-			      *short_ptr = (short)profile->params[1].txBeamIndex;
-			      offset += 2;
-			    }
-			  if (summary->Profile_BitsDefining[4] & PROF_us_txLevel)
-			    {
-			      short_ptr = (short *) &buffer[offset];
-			      *short_ptr = (short)profile->params[1].txLevel;
-			      offset += 2;
-			    }
-			  if (summary->Profile_BitsDefining[4] & PROF_ss_txBeamAngle)
-			    {
-			      short_ptr = (short *) &buffer[offset];
-			      *short_ptr = (short)profile->params[1].txBeamAngle;
-			      offset += 2;
-			    }
-			  if (summary->Profile_BitsDefining[4] & PROF_us_txPulseLength)
-			    {
-			      short_ptr = (short *) &buffer[offset];
-			      *short_ptr = (short)profile->params[1].txPulseLength;
-			      offset += 2;
-			    }
-			  if (summary->Profile_BitsDefining[4] & PROF_ui_ss_offset)
-			    {
-			      int_ptr = (int *) &buffer[offset];
-			      *int_ptr = profile->params[1].ss_offset;
-			      offset += 4;
-			    }
-			  if (summary->Profile_BitsDefining[4] & PROF_us_no_skipped_ss)
-			    {
-			      short_ptr = (short *) &buffer[offset];
-			      *short_ptr = (short)profile->params[1].no_skipped_ss;
-			      offset += 2;
-			    }
-			  if (summary->Profile_BitsDefining[4] & PROF_us_no_acquired_ss)
-			    {
-			      short_ptr = (short *) &buffer[offset];
-			      *short_ptr = (short)profile->params[1].no_acquired_ss;
-			      offset += 2;
-			    }
-			  if (summary->Profile_BitsDefining[4] & PROF_us_ss_sample_interval)
-			    {
-			      short_ptr = (short *) &buffer[offset];
-			      *short_ptr = (short)profile->params[1].ss_sample_interval;
-			      offset += 2;
-			    }
-			  if (summary->Profile_BitsDefining[4] & PROF_us_bscatClass)
-			    {
-			      short_ptr = (short *) &buffer[offset];
-			      *short_ptr = (short)profile->params[1].bscatClass;
-			      offset += 2;
-			    }
-			  if (summary->Profile_BitsDefining[4] & PROF_us_nrActualGainSets)
-			    {
-			      short_ptr = (short *) &buffer[offset];
-			      *short_ptr = (short)profile->params[1].nrActualGainSets;
-			      offset += 2;
-			    }
-			  if (summary->Profile_BitsDefining[4] & PROF_ss_rxGup)
-			    {
-			      short_ptr = (short *) &buffer[offset];
-			      *short_ptr = (short)profile->params[1].rxGup;
-			      offset += 2;
-			    }
-			  if (summary->Profile_BitsDefining[4] & PROF_ss_rxGain)
-			    {
-			      short_ptr = (short *) &buffer[offset];
-			      *short_ptr = (short)profile->params[1].rxGain;
-			      offset += 2;
-			    }
-			  if (summary->Profile_BitsDefining[4] & PROF_ss_ar)
-			    {
-			      short_ptr = (short *) &buffer[offset];
-			      *short_ptr = (short)profile->params[1].ar;
-			      offset += 2;
-			    }
-			  /* hard wired, that if present, there are 20 of them irrespective */
-			  if (summary->Profile_BitsDefining[4] & PROF_us_rxtimeARRAY)
-			    {
-			      for (i = 0; i < 20; i++)
-				{
-				  short_ptr = (short *) &buffer[offset];
-				  *short_ptr = (short)profile->params[1].rxtime[i];
-				  offset += 2;
-				}
-			    }
-			  if (summary->Profile_BitsDefining[4] & PROF_ss_rxgainARRAY)
-			    {
-			      for (i = 0; i < 20; i++)
-				{
-				  short_ptr = (short *) &buffer[offset];
-				  *short_ptr = (short)profile->params[1].rxgain[i];
-				  offset += 2;
-				}
-			    }
-
-			} /* if stbd is present */
-		    }
-
-		  if (summary->Profile_BitsDefining[5])
-		    {
-		      if (summary->Profile_BitsDefining[5] & PROF_si_transducerDepth)
-			{
-			  int_ptr = (int *) &buffer[offset];
-			  *int_ptr = profile->transducerDepth;
-			  offset += 4;
-			}
-		      if (summary->Profile_BitsDefining[5] & PROF_si_transducerPitch)
-			{
-			  int_ptr = (int *) &buffer[offset];
-			  *int_ptr = profile->transducerDepth;
-			  offset += 4;
-			}
-		      if (summary->Profile_BitsDefining[5] & PROF_si_transducerRoll)
-			{
-			  int_ptr = (int *) &buffer[offset];
-			  *int_ptr = profile->transducerDepth;
-			  offset += 4;
-			}
-		      if (summary->Profile_BitsDefining[5] & PROF_ui_transducerHeading)
-			{
-			  int_ptr = (int *) &buffer[offset];
-			  *int_ptr = profile->transducerDepth;
-			  offset += 4;
-			}
-		      if (summary->Profile_BitsDefining[5] & PROF_si_transducerLatOffset)
-			{
-			  int_ptr = (int *) &buffer[offset];
-			  *int_ptr = profile->transducerDepth;
-			  offset += 4;
-			}
-		      if (summary->Profile_BitsDefining[5] & PROF_si_transducerLongOffset)
-			{
-			  int_ptr = (int *) &buffer[offset];
-			  *int_ptr = profile->transducerDepth;
-			  offset += 4;
-			}
-		      if (summary->Profile_BitsDefining[5] & PROF_ui_transducerSlantRange)
-			{
-			  int_ptr = (int *) &buffer[offset];
-			  *int_ptr = profile->transducerDepth;
-			  offset += 4;
-			}
-		      if (summary->Profile_BitsDefining[5] & PROF_si_transducerAcross)
-			{
-			  int_ptr = (int *) &buffer[offset];
-			  *int_ptr = profile->transducerDepth;
-			  offset += 4;
-			}
-		      if (summary->Profile_BitsDefining[5] & PROF_si_transducerAlong)
-			{
-			  int_ptr = (int *) &buffer[offset];
-			  *int_ptr = profile->transducerDepth;
-			  offset += 4;
-			}
-		      if (summary->Profile_BitsDefining[5] & PROF_ui_transducerBearing)
-			{
-			  int_ptr = (int *) &buffer[offset];
-			  *int_ptr = profile->transducerDepth;
-			  offset += 4;
-			}
-		    }
-
-		  if (summary->Profile_BitsDefining[6])
-		    {
-		      if (summary->Profile_BitsDefining[6] & PROF_ui_sonar_settings_offset)
-			{
-			  int_ptr = (int *) &buffer[offset];
-			  *int_ptr = profile->sonar_settings_offset;
-			  offset += 4;
-			}
-		      if (summary->Profile_BitsDefining[6] & PROF_ui_ping_number)
-			{
-			  int_ptr = (int *) &buffer[offset];
-			  *int_ptr = profile->ping_number;
-			  offset += 4;
-			}
-		      if (summary->Profile_BitsDefining[6] & PROF_us_multi_ping_sequence)
-			{
-			  short_ptr = (short *) &buffer[offset];
-			  *short_ptr = (short)profile->multi_ping_sequence;
-			  offset += 2;
-			}
-		      if (summary->Profile_BitsDefining[6] & PROF_ui_num_beams)
-			{
-			  int_ptr = (int *) &buffer[offset];
-			  *int_ptr = profile->num_beams;
-			  offset += 4;
-			}
-		      if (summary->Profile_BitsDefining[6] & PROF_uc_layer_compensation_flag)
-			{
-			  buffer[offset]= profile->layer_compensation_flag;
-			  offset += 1;
-			}
-		      if (summary->Profile_BitsDefining[6] & PROF_f_bs_beam_position)
-			{
-			  float_ptr = (float *) &buffer[offset];
-			  *float_ptr = profile->bs_beam_position;
-			  offset += 4;
-			}
-		      if (summary->Profile_BitsDefining[6] & PROF_ui_bs_control_flags)
-			{
-			  int_ptr = (int *) &buffer[offset];
-			  *int_ptr = profile->bs_control_flags;
-			  offset += 4;
-			}
-		      if (summary->Profile_BitsDefining[6] & PROF_us_bs_num_beams_per_side)
-			{
-			  short_ptr = (short *) &buffer[offset];
-			  *short_ptr = (short)profile->bs_num_beams_per_side;
-			  offset += 2;
-			}
-		      if (summary->Profile_BitsDefining[6] & PROF_us_bs_current_beam_number)
-			{
-			  short_ptr = (short *) &buffer[offset];
-			  *short_ptr = (short)profile->bs_current_beam_number;
-			  offset += 2;
-			}
-		      if (summary->Profile_BitsDefining[6] & PROF_uc_bs_sample_descriptor)
-			{
-			  buffer[offset] = profile->bs_sample_descriptor;
-			  offset += 1;
-			}
-		      if (summary->Profile_BitsDefining[6] & PROF_ui_snippet_sample_descriptor)
-			{
-			  int_ptr = (int *) &buffer[offset];
-			  *int_ptr = profile->snippet_sample_descriptor;
-			  offset += 4;
-			}
-		    }
-#endif
-/* Done V4 Profile */
-		}
-
-	    /* write profile to file */
-	    if ((write_size = fwrite(buffer,1,*profile_size,
-			    mb_io_ptr->mbfp)) == *profile_size)
-		{
-		mb_io_ptr->file_bytes += write_size;
-		status = MB_SUCCESS;
-		*error = MB_ERROR_NO_ERROR;
-		}
-	    else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-
-	    /* now reverse parse and write beam data */
-	    if (status == MB_SUCCESS)
-		{
-		offset = 0;
-		for (i=0;i<profile->numDepths;i++)
-		    {
-		    offset_start = offset;
-		    beam = &data->beams[i];
-		    if (*fileVersion == 1)
-			{
-#ifdef BYTESWAPPED
-			int_ptr = (int *) &buffer[offset];
-			*int_ptr = mb_swap_int(beam->status); offset +=4;
-			int_ptr = (int *) &buffer[offset];
-			*int_ptr = mb_swap_int(beam->observedDepth); offset +=4;
-			if ((offset - offset_start) < *beam_size)
-			    {
-			    int_ptr = (int *) &buffer[offset];
-			    *int_ptr = mb_swap_int(beam->acrossTrack); offset +=4;
-			    int_ptr = (int *) &buffer[offset];
-			    *int_ptr = mb_swap_int(beam->alongTrack); offset +=4;
-			    int_ptr = (int *) &buffer[offset];
-			    *int_ptr = mb_swap_int(beam->latOffset); offset +=4;
-			    int_ptr = (int *) &buffer[offset];
-			    *int_ptr = mb_swap_int(beam->processedDepth); offset +=4;
-			    }
-			if ((offset - offset_start) < *beam_size)
-			    {
-			    int_ptr = (int *) &buffer[offset];
-			    *int_ptr = mb_swap_int(beam->processedDepth); offset +=4;
-			    int_ptr = (int *) &buffer[offset];
-			    *int_ptr = mb_swap_int(beam->timeOffset); offset +=4;
-			    int_ptr = (int *) &buffer[offset];
-			    *int_ptr = mb_swap_int(beam->depthAccuracy); offset +=4;
-			    }
-			if ((offset - offset_start) < *beam_size)
-			    {
-			    buffer[offset] = beam->reflectivity; offset+=1;
-			    buffer[offset] = beam->Q_factor; offset+=1;
-			    buffer[offset] = beam->beam_no; offset+=1;
-			    buffer[offset] = beam->freq; offset+=1;
-			    buffer[offset] = beam->calibratedBackscatter; offset+=1;
-			    buffer[offset] = beam->mindB; offset+=1;
-			    buffer[offset] = beam->maxdB; offset+=1;
-			    buffer[offset] = beam->pseudoAngleIndependentBackscatter; offset+=1;
-			    }
-			if ((offset - offset_start) < *beam_size)
-			    {
-			    int_ptr = (int *) &buffer[offset];
-			    *int_ptr = mb_swap_int(beam->range); offset +=4;
-			    int_ptr = (int *) &buffer[offset];
-			    *int_ptr = mb_swap_int(beam->no_samples); offset +=4;
-			    int_ptr = (int *) &buffer[offset];
-			    *int_ptr = mb_swap_int(beam->offset); offset +=4;
-			    int_ptr = (int *) &buffer[offset];
-			    *int_ptr = mb_swap_int(beam->centre_no); offset +=4;
-			    buffer[offset] = beam->sample_unit; offset+=1;
-			    buffer[offset] = beam->sample_interval; offset+=1;
-			    buffer[offset] = beam->dummy[0]; offset+=1;
-			    buffer[offset] = beam->dummy[1]; offset+=1;
-			    }
-#else
-			int_ptr = (int *) &buffer[offset];
-			*int_ptr = beam->status; offset+=4;
-			int_ptr = (int *) &buffer[offset];
-			*int_ptr = beam->observedDepth; offset+=4;
-			if ((offset - offset_start) < *beam_size)
-			    {
-			    int_ptr = (int *) &buffer[offset];
-			    *int_ptr = beam->acrossTrack; offset+=4;
-			    int_ptr = (int *) &buffer[offset];
-			    *int_ptr = beam->alongTrack; offset+=4;
-			    int_ptr = (int *) &buffer[offset];
-			    *int_ptr = beam->latOffset; offset+=4;
-			    int_ptr = (int *) &buffer[offset];
-			    *int_ptr = beam->longOffset; offset+=4;
-			    }
-			if ((offset - offset_start) < *beam_size)
-			    {
-			    int_ptr = (int *) &buffer[offset];
-			    *int_ptr = beam->processedDepth; offset+=4;
-			    int_ptr = (int *) &buffer[offset];
-			    *int_ptr = beam->timeOffset; offset+=4;
-			    int_ptr = (int *) &buffer[offset];
-			    *int_ptr = beam->depthAccuracy; offset+=4;
-			    }
-			if ((offset - offset_start) < *beam_size)
-			    {
-			    buffer[offset] = beam->reflectivity; offset+=1;
-			    buffer[offset] = beam->Q_factor; offset+=1;
-			    buffer[offset] = beam->beam_no; offset+=1;
-			    buffer[offset] = beam->freq; offset+=1;
-			    buffer[offset] = beam->calibratedBackscatter; offset+=1;
-			    buffer[offset] = beam->mindB; offset+=1;
-			    buffer[offset] = beam->maxdB; offset+=1;
-			    buffer[offset] = beam->pseudoAngleIndependentBackscatter; offset+=1;
-			    }
-			if ((offset - offset_start) < *beam_size)
-			    {
-			    int_ptr = (int *) &buffer[offset];
-			    *int_ptr = beam->range; offset+=4;
-			    int_ptr = (int *) &buffer[offset];
-			    *int_ptr = beam->no_samples; offset+=4;
-			    int_ptr = (int *) &buffer[offset];
-			    *int_ptr = beam->offset; offset+=4;
-			    int_ptr = (int *) &buffer[offset];
-			    *int_ptr = beam->centre_no; offset+=4;
-			    buffer[offset] = beam->sample_unit; offset+=1;
-			    buffer[offset] = beam->sample_interval; offset+=1;
-			    buffer[offset] = beam->dummy[0]; offset+=1;
-			    buffer[offset] = beam->dummy[1]; offset+=1;
-			    }
-#endif
-			}
-		    else if (*fileVersion == 2)
-			{
-			MaxVal = MAX(abs(beam->observedDepth),
-					abs((int)beam->acrossTrack));
-			if(MaxVal < 30000 )
-			    ScaleFactor = 1;
-			else if(MaxVal < 300000 )
-			    ScaleFactor = 10;
-			else if(MaxVal < 3000000 )
-			    ScaleFactor = 100;
-			else
-			    ScaleFactor = 1000;
-			beam->observedDepth = beam->observedDepth / ScaleFactor;
-			beam->acrossTrack = beam->acrossTrack / ScaleFactor;
-			beam->alongTrack = beam->alongTrack / ScaleFactor;
-			beam->Q_factor = beam->reflectivity;
-			if (ScaleFactor == 1)
-			    beam->alongTrack += -20000;
-			else if (ScaleFactor == 10)
-			    beam->alongTrack += -10000;
-			else if (ScaleFactor == 100)
-			    beam->alongTrack += 0;
-			else if (ScaleFactor == 1000)
-			    beam->alongTrack += 10000;
-#ifdef BYTESWAPPED
-			if ((offset - offset_start) < *beam_size)
-			    {
-			    short_ptr = (short *) &buffer[offset];
-			    *short_ptr = (short)mb_swap_short((short)(beam->observedDepth)); offset+=2;
-			    short_ptr = (short *) &buffer[offset];
-			    *short_ptr = (short)mb_swap_short((short)(beam->acrossTrack)); offset+=2;
-			    buffer[offset] = beam->status; offset+=1;
-			    }
-			if ((offset - offset_start) < *beam_size)
-			    {
-			    buffer[offset] = beam->reflectivity; offset+=1;
-			    buffer[offset] = beam->calibratedBackscatter; offset+=1;
-			    buffer[offset] = beam->pseudoAngleIndependentBackscatter; offset+=1;
-			    }
-			if ((offset - offset_start) < *beam_size)
-			    {
-			    short_ptr = (short *) &buffer[offset];
-			    *short_ptr = (short)mb_swap_short((short)(beam->alongTrack)); offset+=2;
-			    }
-			if ((offset - offset_start) < *beam_size)
-			    {
-			    short_ptr = (short *) &buffer[offset];
-			    *short_ptr = (short)mb_swap_short((short)(beam->range)); offset+=2;
-			    }
-			if ((offset - offset_start) < *beam_size)
-			    {
-			    int_ptr = (int *) &buffer[offset];
-			    *int_ptr = mb_swap_int(beam->offset); offset +=4;
-			    short_ptr = (short *) &buffer[offset];
-			    *short_ptr = (short)mb_swap_short((short)(beam->no_samples)); offset+=2;
-			    short_ptr = (short *) &buffer[offset];
-			    *short_ptr = (short)mb_swap_short((short)(beam->centre_no)); offset+=2;
-			    }
-#else
-			if ((offset - offset_start) < *beam_size)
-			    {
-			    short_ptr = (short *) &buffer[offset];
-			    *short_ptr = (short)beam->observedDepth; offset+=2;
-			    short_ptr = (short *) &buffer[offset];
-			    *short_ptr = (short)beam->acrossTrack; offset+=2;
-			    buffer[offset] = beam->status; offset+=1;
-			    }
-			if ((offset - offset_start) < *beam_size)
-			    {
-			    buffer[offset] = beam->reflectivity; offset+=1;
-			    buffer[offset] = beam->calibratedBackscatter; offset+=1;
-			    buffer[offset] = beam->pseudoAngleIndependentBackscatter; offset+=1;
-			    }
-			if ((offset - offset_start) < *beam_size)
-			    {
-			    short_ptr = (short *) &buffer[offset];
-			    *short_ptr = (short)beam->alongTrack; offset+=2;
-			    }
-			if ((offset - offset_start) < *beam_size)
-			    {
-			    short_ptr = (short *) &buffer[offset];
-			    *short_ptr = (short)beam->range; offset+=2;
-			    }
-			if ((offset - offset_start) < *beam_size)
-			    {
-			    int_ptr = (int *) &buffer[offset];
-			    *int_ptr = beam->offset; offset+=4;
-			    short_ptr = (short *) &buffer[offset];
-			    *short_ptr = (short)beam->no_samples; offset+=2;
-			    short_ptr = (short *) &buffer[offset];
-			    *short_ptr = (short)beam->centre_no; offset+=2;
-			    }
-#endif
-			}
-		    else if (*fileVersion == 3)
-			{
-			MaxVal = MAX(abs(beam->observedDepth),
-					abs(beam->acrossTrack));
-			if (MaxVal < 32000 )
-				{
-				ScaleFactor = pow(2.0,0.0);
-				scaling_factor = 0;
-				}
-			else if (MaxVal < 64000 )
-				{
-				ScaleFactor = pow(2.0,1.0);
-				scaling_factor = 1;
-				}
-			else if (MaxVal < 128000 )
-				{
-				ScaleFactor = pow(2.0,2.0);
-				scaling_factor = 2;
-				}
-			else if (MaxVal < 256000 )
-				{
-				ScaleFactor = pow(2.0,3.0);
-				scaling_factor = 3;
-				}
-			else if (MaxVal < 512000 )
-				{
-				ScaleFactor = pow(2.0,4.0);
-				scaling_factor = 4;
-				}
-			else if (MaxVal < 1024000 )
-				{
-				ScaleFactor = pow(2.0,5.0);
-				scaling_factor = 5;
-				}
-			else if (MaxVal < 2048000 )
-				{
-				ScaleFactor = pow(2.0,6.0);
-				scaling_factor = 6;
-				}
-			else if (MaxVal < 4096000 )
-				{
-				ScaleFactor = pow(2.0,7.0);
-				scaling_factor = 7;
-				}
-			else if (MaxVal < 8192000 )
-				{
-				ScaleFactor = pow(2.0,8.0);
-				scaling_factor = 8;
-				}
-			else
-				{
-				ScaleFactor = pow(2.0,10.0);
-				scaling_factor = 10;
-				}
-			beam->observedDepth = beam->observedDepth / ScaleFactor;
-			beam->acrossTrack = beam->acrossTrack / ScaleFactor;
-			beam->alongTrack = beam->alongTrack / ScaleFactor;
-#ifdef BYTESWAPPED
-			if ((offset - offset_start) < *beam_size)
-			    {
-			    short_ptr = (short *) &buffer[offset];
-			    *short_ptr = (short)mb_swap_short((short)(beam->observedDepth)); offset+=2;
-			    short_ptr = (short *) &buffer[offset];
-			    *short_ptr = (short)mb_swap_short((short)(beam->acrossTrack)); offset+=2;
-			    buffer[offset] = beam->status; offset+=1;
-			    }
-			if ((offset - offset_start) < *beam_size)
-			    {
-			    buffer[offset] = beam->reflectivity; offset+=1;
-			    buffer[offset] = beam->calibratedBackscatter; offset+=1;
-			    buffer[offset] = beam->pseudoAngleIndependentBackscatter; offset+=1;
-			    }
-			if ((offset - offset_start) < *beam_size)
-			    {
-			    short_ptr = (short *) &buffer[offset];
-			    *short_ptr = (short)mb_swap_short((short)(beam->alongTrack)); offset+=2;
-			    }
-			if ((offset - offset_start) < *beam_size)
-			    {
-			    short_ptr = (short *) &buffer[offset];
-			    *short_ptr = (short)mb_swap_short((short)(beam->range)); offset+=2;
-			    }
-			if ((offset - offset_start) < *beam_size)
-			    {
-			    int_ptr = (int *) &buffer[offset];
-			    *int_ptr = mb_swap_int(beam->offset); offset +=4;
-			    short_ptr = (short *) &buffer[offset];
-			    *short_ptr = (short)mb_swap_short((short)(beam->no_samples)); offset+=2;
-			    short_ptr = (short *) &buffer[offset];
-			    *short_ptr = (short)mb_swap_short((short)(beam->centre_no)); offset+=2;
-			    }
-			if ((offset - offset_start) < *beam_size)
-			    {
-			    short_ptr = (short *) &buffer[offset];
-			    *short_ptr = (short)mb_swap_short((short)(beam->beam_depress_angle)); offset+=2;
-			    short_ptr = (short *) &buffer[offset];
-			    *short_ptr = (short)mb_swap_short((short)(beam->beam_heading_angle)); offset+=2;
-			    buffer[offset] = beam->samp_win_length; offset+=1;
-			    buffer[offset] = scaling_factor; offset+=1;
-			    buffer[offset] = beam->Q_factor; offset+=1;
-			    buffer[offset] = 0; offset+=1;
-			    }
-#else
-			if ((offset - offset_start) < *beam_size)
-			    {
-			    short_ptr = (short *) &buffer[offset];
-			    *short_ptr = (short)beam->observedDepth; offset+=2;
-			    short_ptr = (short *) &buffer[offset];
-			    *short_ptr = (short)beam->acrossTrack; offset+=2;
-			    buffer[offset] = beam->status; offset+=1;
-			    }
-			if ((offset - offset_start) < *beam_size)
-			    {
-			    buffer[offset] = beam->reflectivity; offset+=1;
-			    buffer[offset] = beam->calibratedBackscatter; offset+=1;
-			    buffer[offset] = beam->pseudoAngleIndependentBackscatter; offset+=1;
-			    }
-			if ((offset - offset_start) < *beam_size)
-			    {
-			    short_ptr = (short *) &buffer[offset];
-			    *short_ptr =(short) beam->alongTrack; offset+=2;
-			    }
-			if ((offset - offset_start) < *beam_size)
-			    {
-			    short_ptr = (short *) &buffer[offset];
-			    *short_ptr = (short)beam->range; offset+=2;
-			    }
-			if ((offset - offset_start) < *beam_size)
-			    {
-			    int_ptr = (int *) &buffer[offset];
-			    *int_ptr = beam->offset; offset+=4;
-			    short_ptr = (short *) &buffer[offset];
-			    *short_ptr = (short)beam->no_samples; offset+=2;
-			    short_ptr = (short *) &buffer[offset];
-			    *short_ptr = (short)beam->centre_no; offset+=2;
-			    }
-			if ((offset - offset_start) < *beam_size)
-			    {
-			    short_ptr = (short *) &buffer[offset];
-			    *short_ptr = (short)beam->beam_depress_angle; offset+=2;
-			    short_ptr = (short *) &buffer[offset];
-			    *short_ptr = (short)beam->beam_heading_angle; offset+=2;
-			    buffer[offset] = beam->samp_win_length; offset+=1;
-			    buffer[offset] = scaling_factor; offset+=1;
-			    buffer[offset] = beam->Q_factor; offset+=1;
-			    buffer[offset] = 0; offset+=1;
-			    }
-#endif
-			}
-/* V4 */
-			  else if (*fileVersion == 4)
-			{
-
-#ifdef BYTESWAPPED
-			if (summary->Beam_BitsDefining[0])
-			{
-			if (summary->Profile_BitsDefining[0] & BEAM_ui_status)
-			{
-				buffer[offset] = beam->status; offset+=1;
-			}
-			if (summary->Beam_BitsDefining[0] & BEAM_uc_scaling_factor)
-			{
-				buffer[offset] = beam->scaling_factor; offset+=1;
-			}
-
-			/* Scale Factor for depth / distance, etc */
-			ScaleFactor = pow(2.0,(double)beam->scaling_factor);
-			beam->observedDepth = beam->observedDepth / ScaleFactor;
-			beam->acrossTrack = beam->acrossTrack / ScaleFactor;
-			beam->alongTrack = beam->alongTrack / ScaleFactor;
-			beam->processedDepth = beam->processedDepth / ScaleFactor;
-			beam->depthAccuracy = beam->depthAccuracy / ScaleFactor;
-
-			if (summary->Beam_BitsDefining[0] & BEAM_si_observedDepth)
-			{
-				short_ptr = (short *) &buffer[offset];
-				*short_ptr = (short)mb_swap_short((short)beam->observedDepth);
-				offset+=2;
-			}
-			if (summary->Beam_BitsDefining[0] & BEAM_si_acrossTrack)
-			{
-				short_ptr = (short *) &buffer[offset];
-				*short_ptr = (short)mb_swap_short((short)beam->acrossTrack);
-				offset+=2;
-			}
-			if (summary->Beam_BitsDefining[0] & BEAM_si_alongTrack)
-			{
-				short_ptr = (short *) &buffer[offset];
-				*short_ptr = (short)mb_swap_short((short)beam->alongTrack);
-				offset+=2;
-			}
-			if (summary->Beam_BitsDefining[0] & BEAM_si_latOffset)
-			{
-				int_ptr = (int *) &buffer[offset];
-				*int_ptr = mb_swap_int(beam->latOffset); offset+=4;
-			}
-			if (summary->Beam_BitsDefining[0] & BEAM_si_longOffset)
-			{
-				int_ptr = (int *) &buffer[offset];
-				*int_ptr = mb_swap_int(beam->longOffset); offset+=4;
-			}
-			if (summary->Beam_BitsDefining[0] & BEAM_si_processedDepth)
-			{
-				short_ptr = (short *) &buffer[offset];
-				*short_ptr = (short)mb_swap_short((short)beam->processedDepth);
-				offset+=2;
-			}
-			if (summary->Beam_BitsDefining[0] & BEAM_si_timeOffset)
-			{
-				int_ptr = (int *) &buffer[offset];
-				*int_ptr = mb_swap_int(beam->timeOffset); offset+=4;
-			}
-			if (summary->Beam_BitsDefining[0] & BEAM_si_depthAccuracy)
-			{
-				short_ptr = (short *) &buffer[offset];
-				*short_ptr = (short)mb_swap_short((short)beam->depthAccuracy);
-				offset+=2;
-			}
-			}
-
-			if (summary->Beam_BitsDefining[1])
-			{
-			if (summary->Beam_BitsDefining[1] & BEAM_uc_reflectivity)
-			{
-				buffer[offset] = beam->reflectivity; offset+=1;
-			}
-			if (summary->Beam_BitsDefining[1] & BEAM_sc_Q_factor)
-			{
-				buffer[offset] = beam->Q_factor; offset+=1;
-			}
-			if (summary->Beam_BitsDefining[1] & BEAM_uc_beam_no)
-			{
-				buffer[offset] = beam->beam_no; offset+=1;
-			}
-			if (summary->Beam_BitsDefining[1] & BEAM_uc_freq)
-			{
-				buffer[offset] = beam->freq; offset+=1;
-			}
-			if (summary->Beam_BitsDefining[1] & BEAM_uc_calibratedBackscatter)
-			{
-				buffer[offset] = beam->calibratedBackscatter; offset+=1;
-			}
-			if (summary->Beam_BitsDefining[1] & BEAM_uc_mindB)
-			{
-				buffer[offset] = beam->mindB; offset+=1;
-			}
-			if (summary->Beam_BitsDefining[1] & BEAM_uc_maxdB)
-			{
-				buffer[offset] = beam->maxdB; offset+=1;
-			}
-			if (summary->Beam_BitsDefining[1] & BEAM_uc_pseudoAngleIndependentBackscatter)
-			{
-				buffer[offset] = beam->pseudoAngleIndependentBackscatter; offset+=1;
-			}
-			}
-
-			if (summary->Beam_BitsDefining[2])
-			{
-			if (summary->Beam_BitsDefining[2] & BEAM_ui_range)
-			{
-				short_ptr = (short *) &buffer[offset];
-				*short_ptr = (short)mb_swap_short((short)beam->range); offset+=2;
-			}
-			if (summary->Beam_BitsDefining[2] & BEAM_ui_no_samples)
-			{
-				short_ptr = (short *) &buffer[offset];
-				*short_ptr = (short)mb_swap_short((short)beam->no_samples); offset+=2;
-			}
-			if (summary->Beam_BitsDefining[2] & BEAM_ui_offset)
-			{
-				int_ptr = (int *) &buffer[offset];
-				*int_ptr = mb_swap_int(beam->offset); offset+=4;
-			}
-			if (summary->Beam_BitsDefining[2] & BEAM_si_centre_no)
-			{
-				short_ptr = (short *) &buffer[offset];
-				*short_ptr = (short)mb_swap_short((short)beam->centre_no); offset+=2;
-			}
-			if (summary->Beam_BitsDefining[2] & BEAM_uc_sample_unit)
-			{
-				buffer[offset] = beam->sample_unit; offset+=1;
-			}
-			if (summary->Beam_BitsDefining[2] & BEAM_uc_sample_interval)
-			{
-				buffer[offset] = beam->sample_interval; offset+=1;
-			}
-			if (summary->Beam_BitsDefining[2] & BEAM_uc_dummy0)
-			{
-				buffer[offset] = beam->dummy[0]; offset+=1;
-			}
-			if (summary->Beam_BitsDefining[2] & BEAM_uc_dummy1)
-			{
-				buffer[offset] = beam->dummy[1]; offset+=1;
-			}
-			if (summary->Beam_BitsDefining[2] & BEAM_uc_samp_win_length)
-			{
-				buffer[offset] = beam->samp_win_length; offset+=1;
-			}
-			}
-
-			if (summary->Beam_BitsDefining[3])
-			{
-			if (summary->Beam_BitsDefining[3] & BEAM_ss_beam_depress_angle)
-			{
-				short_ptr = (short *) &buffer[offset];
-				*short_ptr = (short)mb_swap_short((short)beam->beam_depress_angle); offset+=2;
-			}
-			if (summary->Beam_BitsDefining[3] & BEAM_us_beam_heading_angle)
-			{
-				short_ptr = (short *) &buffer[offset];
-				*short_ptr = (short)mb_swap_short((short)beam->beam_heading_angle); offset+=2;
-			}
-			if (summary->Beam_BitsDefining[3] & BEAM_us_other_range)
-			{
-				short_ptr = (short *) &buffer[offset];
-				*short_ptr = (short)mb_swap_short((short)beam->other_range); offset+=2;
-			}
-			if (summary->Beam_BitsDefining[3] & BEAM_ss_Tx_steer)
-			{
-				short_ptr = (short *) &buffer[offset];
-				*short_ptr = (short)mb_swap_short((short)beam->Tx_steer); offset+=2;
-			}
-			if (summary->Beam_BitsDefining[3] & BEAM_ss_Rc_steer)
-			{
-				short_ptr = (short *) &buffer[offset];
-				*short_ptr = (short)mb_swap_short((short)beam->Rc_steer); offset+=2;
-			}
-			if (summary->Beam_BitsDefining[3] & BEAM_uc_TxSector)
-			{
-				buffer[offset] = beam->TxSector; offset+=1;
-			}
-			if (summary->Beam_BitsDefining[3] & BEAM_f_Ifremer_qfactor)
-			{
-				float_ptr = (float *) &buffer[offset];
-				mb_swap_float(float_ptr);
-				beam->Ifremer_qfactor = *float_ptr; offset+=4;
-			}
-			}
-
-			if (summary->Beam_BitsDefining[4])
-			{
-			if (summary->Beam_BitsDefining[4] & BEAM_ui_timestampOffset)
-			{
-				int_ptr = (int *) &buffer[offset];
-				*int_ptr = mb_swap_int(beam->timestampOffset); offset+=4;
-			}
-			if (summary->Beam_BitsDefining[4] & BEAM_us_no_RAMAN)
-			{
-				short_ptr = (short *) &buffer[offset];
-				*short_ptr = (short)mb_swap_short((short)beam->no_RAMAN); offset+=2;
-			}
-			if (summary->Beam_BitsDefining[4] & BEAM_us_no_IR)
-			{
-				short_ptr = (short *) &buffer[offset];
-				*short_ptr = (short)mb_swap_short((short)beam->no_IR); offset+=2;
-			}
-			if (summary->Beam_BitsDefining[4] & BEAM_us_no_GAPD)
-			{
-				short_ptr = (short *) &buffer[offset];
-				*short_ptr = (short)mb_swap_short((short)beam->no_GAPD); offset+=2;
-			}
-			if (summary->Beam_BitsDefining[4] & BEAM_us_no_PMT)
-			{
-				short_ptr = (short *) &buffer[offset];
-				*short_ptr = (short)mb_swap_short((short)beam->no_PMT); offset+=2;
-			}
-			if (summary->Beam_BitsDefining[4] & BEAM_uc_prim_depth_conf)
-			{
-				buffer[offset] = beam->prim_depth_conf; offset+=1;
-			}
-			if (summary->Beam_BitsDefining[4] & BEAM_uc_seco_depth_conf)
-			{
-				buffer[offset] = beam->seco_depth_conf; offset+=1;
-			}
-			if (summary->Beam_BitsDefining[4] & BEAM_ss_scan_azimuth)
-			{
-				short_ptr = (short *) &buffer[offset];
-				*short_ptr = (short)mb_swap_short((short)beam->scan_azimuth); offset+=2;
-			}
-			if (summary->Beam_BitsDefining[4] & BEAM_us_nadir_angle)
-			{
-				short_ptr = (short *) &buffer[offset];
-				*short_ptr = (short)mb_swap_short((short)beam->nadir_angle); offset+=2;
-			}
-			if (summary->Beam_BitsDefining[4] & BEAM_si_secondaryDepth)
-			{
-				short_ptr = (short *) &buffer[offset];
-				*short_ptr = (short)mb_swap_short((short)beam->secondaryDepth); offset+=2;
-			}
-			if (summary->Beam_BitsDefining[4] & BEAM_ss_wave_height)
-			{
-				short_ptr = (short *) &buffer[offset];
-				*short_ptr = (short)mb_swap_short((short)beam->wave_height); offset+=2;
-			}
-			if (summary->Beam_BitsDefining[4] & BEAM_si_opaqueDepth_PMT)
-			{
-				int_ptr = (int *) &buffer[offset];
-				*int_ptr = mb_swap_int(beam->opaqueDepth_PMT); offset+=4;
-			}
-			if (summary->Beam_BitsDefining[4] & BEAM_si_extinctionDepth_PMT)
-			{
-				int_ptr = (int *) &buffer[offset];
-				*int_ptr = mb_swap_int(beam->extinctionDepth_PMT); offset+=4;
-			}
-			if (summary->Beam_BitsDefining[4] & BEAM_si_pimDepth_PMT)
-			{
-				int_ptr = (int *) &buffer[offset];
-				*int_ptr = mb_swap_int(beam->pimDepth_PMT); offset+=4;
-			}
-			if (summary->Beam_BitsDefining[4] & BEAM_si_opaqueDepth_GAPD)
-			{
-				int_ptr = (int *) &buffer[offset];
-				*int_ptr = mb_swap_int(beam->opaqueDepth_GAPD); offset+=4;
-			}
-			if (summary->Beam_BitsDefining[4] & BEAM_si_extinctionDepth_GAPD)
-			{
-				int_ptr = (int *) &buffer[offset];
-				*int_ptr = mb_swap_int(beam->extinctionDepth_GAPD); offset+=4;
-			}
-			if (summary->Beam_BitsDefining[4] & BEAM_si_pimDepth_GAPD)
-			{
-				int_ptr = (int *) &buffer[offset];
-				*int_ptr = mb_swap_int(beam->pimDepth_GAPD); offset+=4;
-			}
-			}
-
-			if (summary->Beam_BitsDefining[5])
-			{
-			if (summary->Beam_BitsDefining[5] & BEAM_f_twtt)
-			{
-				float_ptr = (float *)&buffer[offset];
-				mb_swap_float(float_ptr);
-				*float_ptr = beam->twtt; offset+=4;
-			}
-			if (summary->Beam_BitsDefining[5] & BEAM_ui_snippet_first_sample)
-			{
-				int_ptr = (int *) &buffer[offset];
-				*int_ptr = mb_swap_int(beam->snippet_first_sample); offset+=4;
-			}
-			if (summary->Beam_BitsDefining[5] & BEAM_ui_snippet_last_sample)
-			{
-				int_ptr = (int *) &buffer[offset];
-				*int_ptr = mb_swap_int(beam->snippet_last_sample); offset+=4;
-			}
-			if (summary->Beam_BitsDefining[5] & BEAM_f_intensity)
-			{
-				float_ptr = (float *) &buffer[offset];
-				mb_swap_float(float_ptr);
-				*float_ptr = beam->intensity;  offset+=4;
-			}
-			}
-
-#else
-			if (summary->Beam_BitsDefining[0])
-			{
-			if (summary->Profile_BitsDefining[0] & BEAM_ui_status)
-			{
-				buffer[offset] = beam->status; offset+=1;
-			}
-			if (summary->Beam_BitsDefining[0] & BEAM_uc_scaling_factor)
-			{
-				buffer[offset] = scaling_factor; offset+=1;
-			}
-			/* Scale Factor for depth / distance, etc */
-			ScaleFactor = pow(2.0,(double)scaling_factor);
-
-			if (summary->Beam_BitsDefining[0] & BEAM_si_observedDepth)
-			{
-				short_ptr = (short *) &buffer[offset];
-				*short_ptr = (short)beam->observedDepth;
-				offset+=2;
-			}
-			if (summary->Beam_BitsDefining[0] & BEAM_si_acrossTrack)
-			{
-				short_ptr = (short *) &buffer[offset];
-				*short_ptr = (short)(beam->acrossTrack / ScaleFactor);
-				offset+=2;
-			}
-			if (summary->Beam_BitsDefining[0] & BEAM_si_alongTrack)
-			{
-				short_ptr = (short *) &buffer[offset];
-				*short_ptr = (short)beam->alongTrack;
-				offset+=2;
-			}
-			if (summary->Beam_BitsDefining[0] & BEAM_si_latOffset)
-			{
-				int_ptr = (int *) &buffer[offset];
-				*int_ptr = beam->latOffset; offset+=4;
-			}
-			if (summary->Beam_BitsDefining[0] & BEAM_si_longOffset)
-			{
-				int_ptr = (int *) &buffer[offset];
-				*int_ptr = beam->longOffset; offset+=4;
-			}
-			if (summary->Beam_BitsDefining[0] & BEAM_si_processedDepth)
-			{
-				short_ptr = (short *) &buffer[offset];
-				*short_ptr = (short)beam->processedDepth;
-				offset+=2;
-			}
-			if (summary->Beam_BitsDefining[0] & BEAM_si_timeOffset)
-			{
-				int_ptr = (int *) &buffer[offset];
-				*int_ptr = beam->timeOffset; offset+=4;
-			}
-			if (summary->Beam_BitsDefining[0] & BEAM_si_depthAccuracy)
-			{
-				short_ptr = (short *) &buffer[offset];
-				*short_ptr = (short)beam->depthAccuracy;
-				offset+=2;
-			}
-			}
-
-			if (summary->Beam_BitsDefining[1])
-			{
-			if (summary->Beam_BitsDefining[1] & BEAM_uc_reflectivity)
-			{
-				buffer[offset] = beam->reflectivity; offset+=1;
-			}
-			if (summary->Beam_BitsDefining[1] & BEAM_sc_Q_factor)
-			{
-				buffer[offset] = beam->Q_factor; offset+=1;
-			}
-			if (summary->Beam_BitsDefining[1] & BEAM_uc_beam_no)
-			{
-				buffer[offset] = beam->beam_no; offset+=1;
-			}
-			if (summary->Beam_BitsDefining[1] & BEAM_uc_freq)
-			{
-				buffer[offset] = beam->freq; offset+=1;
-			}
-			if (summary->Beam_BitsDefining[1] & BEAM_uc_calibratedBackscatter)
-			{
-				buffer[offset] = beam->calibratedBackscatter; offset+=1;
-			}
-			if (summary->Beam_BitsDefining[1] & BEAM_uc_mindB)
-			{
-				buffer[offset] = beam->mindB; offset+=1;
-			}
-			if (summary->Beam_BitsDefining[1] & BEAM_uc_maxdB)
-			{
-				buffer[offset] = beam->maxdB; offset+=1;
-			}
-			if (summary->Beam_BitsDefining[1] & BEAM_uc_pseudoAngleIndependentBackscatter)
-			{
-				buffer[offset] = beam->pseudoAngleIndependentBackscatter; offset+=1;
-			}
-			}
-
-			if (summary->Beam_BitsDefining[2])
-			{
-			if (summary->Beam_BitsDefining[2] & BEAM_ui_range)
-			{
-				short_ptr = (short *) &buffer[offset];
-				*short_ptr = (short)beam->range; offset+=2;
-			}
-			if (summary->Beam_BitsDefining[2] & BEAM_ui_no_samples)
-			{
-				short_ptr = (short *) &buffer[offset];
-				*short_ptr = (short)beam->no_samples; offset+=2;
-			}
-			if (summary->Beam_BitsDefining[2] & BEAM_ui_offset)
-			{
-				int_ptr = (int *) &buffer[offset];
-				*int_ptr = beam->offset; offset+=4;
-			}
-			if (summary->Beam_BitsDefining[2] & BEAM_si_centre_no)
-			{
-				short_ptr = (short *) &buffer[offset];
-				*short_ptr = (short)beam->centre_no; offset+=2;
-			}
-			if (summary->Beam_BitsDefining[2] & BEAM_uc_sample_unit)
-			{
-				buffer[offset] = beam->sample_unit; offset+=1;
-			}
-			if (summary->Beam_BitsDefining[2] & BEAM_uc_sample_interval)
-			{
-				buffer[offset] = beam->sample_interval; offset+=1;
-			}
-			if (summary->Beam_BitsDefining[2] & BEAM_uc_dummy0)
-			{
-				buffer[offset] = beam->dummy[0]; offset+=1;
-			}
-			if (summary->Beam_BitsDefining[2] & BEAM_uc_dummy1)
-			{
-				buffer[offset] = beam->dummy[1]; offset+=1;
-			}
-			if (summary->Beam_BitsDefining[2] & BEAM_uc_samp_win_length)
-			{
-				buffer[offset] = beam->samp_win_length; offset+=1;
-			}
-			}
-
-			if (summary->Beam_BitsDefining[3])
-			{
-			if (summary->Beam_BitsDefining[3] & BEAM_ss_beam_depress_angle)
-			{
-				short_ptr = (short *) &buffer[offset];
-				*short_ptr = (short)beam->beam_depress_angle; offset+=2;
-			}
-			if (summary->Beam_BitsDefining[3] & BEAM_us_beam_heading_angle)
-			{
-				short_ptr = (short *) &buffer[offset];
-				*short_ptr = (short)beam->beam_heading_angle; offset+=2;
-			}
-			if (summary->Beam_BitsDefining[3] & BEAM_us_other_range)
-			{
-				short_ptr = (short *) &buffer[offset];
-				*short_ptr = (short)beam->other_range; offset+=2;
-			}
-			if (summary->Beam_BitsDefining[3] & BEAM_ss_Tx_steer)
-			{
-				short_ptr = (short *) &buffer[offset];
-				*short_ptr = (short)beam->Tx_steer; offset+=2;
-			}
-			if (summary->Beam_BitsDefining[3] & BEAM_ss_Rc_steer)
-			{
-				short_ptr = (short *) &buffer[offset];
-				*short_ptr = (short)beam->Rc_steer; offset+=2;
-			}
-			if (summary->Beam_BitsDefining[3] & BEAM_uc_TxSector)
-			{
-				buffer[offset] = beam->TxSector; offset+=1;
-			}
-			}
-
-			if (summary->Beam_BitsDefining[4])
-			{
-			if (summary->Beam_BitsDefining[4] & BEAM_ui_timestampOffset)
-			{
-				int_ptr = (int *) &buffer[offset];
-				*int_ptr = beam->timestampOffset; offset+=4;
-			}
-			if (summary->Beam_BitsDefining[4] & BEAM_us_no_RAMAN)
-			{
-				short_ptr = (short *) &buffer[offset];
-				*short_ptr = (short)beam->no_RAMAN; offset+=2;
-			}
-			if (summary->Beam_BitsDefining[4] & BEAM_us_no_IR)
-			{
-				short_ptr = (short *) &buffer[offset];
-				*short_ptr = (short)beam->no_IR; offset+=2;
-			}
-			if (summary->Beam_BitsDefining[4] & BEAM_us_no_GAPD)
-			{
-				short_ptr = (short *) &buffer[offset];
-				*short_ptr = (short)beam->no_GAPD; offset+=2;
-			}
-			if (summary->Beam_BitsDefining[4] & BEAM_us_no_PMT)
-			{
-				short_ptr = (short *) &buffer[offset];
-				*short_ptr = (short)beam->no_PMT; offset+=2;
-			}
-			if (summary->Beam_BitsDefining[4] & BEAM_uc_prim_depth_conf)
-			{
-				buffer[offset] = beam->prim_depth_conf; offset+=1;
-			}
-			if (summary->Beam_BitsDefining[4] & BEAM_uc_seco_depth_conf)
-			{
-				buffer[offset] = beam->seco_depth_conf; offset+=1;
-			}
-			if (summary->Beam_BitsDefining[4] & BEAM_ss_scan_azimuth)
-			{
-				short_ptr = (short *) &buffer[offset];
-				*short_ptr = (short)beam->scan_azimuth; offset+=2;
-			}
-			if (summary->Beam_BitsDefining[4] & BEAM_us_nadir_angle)
-			{
-				short_ptr = (short *) &buffer[offset];
-				*short_ptr = (short)beam->nadir_angle; offset+=2;
-			}
-			if (summary->Beam_BitsDefining[4] & BEAM_si_secondaryDepth)
-			{
-				short_ptr = (short *) &buffer[offset];
-				*short_ptr = (short)beam->secondaryDepth; offset+=2;
-			}
-			if (summary->Beam_BitsDefining[4] & BEAM_ss_wave_height)
-			{
-				short_ptr = (short *) &buffer[offset];
-				*short_ptr = (short)beam->wave_height; offset+=2;
-			}
-			if (summary->Beam_BitsDefining[4] & BEAM_si_opaqueDepth_PMT)
-			{
-				int_ptr = (int *) &buffer[offset];
-				*int_ptr = beam->opaqueDepth_PMT; offset+=4;
-			}
-			if (summary->Beam_BitsDefining[4] & BEAM_si_extinctionDepth_PMT)
-			{
-				int_ptr = (int *) &buffer[offset];
-				*int_ptr = beam->extinctionDepth_PMT; offset+=4;
-			}
-			if (summary->Beam_BitsDefining[4] & BEAM_si_pimDepth_PMT)
-			{
-				int_ptr = (int *) &buffer[offset];
-				*int_ptr = beam->pimDepth_PMT; offset+=4;
-			}
-			if (summary->Beam_BitsDefining[4] & BEAM_si_opaqueDepth_GAPD)
-			{
-				int_ptr = (int *) &buffer[offset];
-				*int_ptr = beam->opaqueDepth_GAPD; offset+=4;
-			}
-			if (summary->Beam_BitsDefining[4] & BEAM_si_extinctionDepth_GAPD)
-			{
-				int_ptr = (int *) &buffer[offset];
-				*int_ptr = beam->extinctionDepth_GAPD; offset+=4;
-			}
-			if (summary->Beam_BitsDefining[4] & BEAM_si_pimDepth_GAPD)
-			{
-				int_ptr = (int *) &buffer[offset];
-				*int_ptr = beam->pimDepth_GAPD; offset+=4;
-			}
-			}
-
-			if (summary->Beam_BitsDefining[5])
-			{
-			if (summary->Beam_BitsDefining[5] & BEAM_f_twtt)
-			{
-				float_ptr = (float *)&buffer[offset];
-				*float_ptr = beam->twtt; offset+=4;
-			}
-			if (summary->Beam_BitsDefining[5] & BEAM_ui_snippet_first_sample)
-			{
-				int_ptr = (int *) &buffer[offset];
-				*int_ptr = beam->snippet_first_sample; offset+=4;
-			}
-			if (summary->Beam_BitsDefining[5] & BEAM_ui_snippet_last_sample)
-			{
-				int_ptr = (int *) &buffer[offset];
-				*int_ptr = beam->snippet_last_sample; offset+=4;
-			}
-			if (summary->Beam_BitsDefining[5] & BEAM_f_intensity)
-			{
-				float_ptr = (float *) &buffer[offset];
-				*float_ptr = beam->intensity;  offset+=4;
-			}
-			}
-
-#endif
-/* End V4 Beam */
-			}
-		    }
-		}
-
-	    /* write beam data to file */
-	    if ((write_size = fwrite(buffer,1,*data_size,
-			    mb_io_ptr->mbfp)) == *data_size)
-		{
-		mb_io_ptr->file_bytes += write_size;
-		status = MB_SUCCESS;
-		*error = MB_ERROR_NO_ERROR;
-		}
-	    else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-
-       /* now deal with sidescan in parallel file */
-	    if (status == MB_SUCCESS
-		&& mb_io_ptr->mbfp2 != NULL
-		&& (summary->toolType == MBSYS_HDCS_EM1000
-		    || summary->toolType == MBSYS_HDCS_EM12_single
-		    || summary->toolType == MBSYS_HDCS_EM12_dual
-		    || summary->toolType == MBSYS_HDCS_EM300
-		    || summary->toolType == MBSYS_HDCS_EM3000
-		    || summary->toolType == MBSYS_HDCS_EM3000D
-		    || summary->toolType == MBSYS_HDCS_EM121A
-		    || summary->toolType == MBSYS_HDCS_EM1002
-		    || summary->toolType == MBSYS_HDCS_EM120
-		    || summary->toolType == MBSYS_HDCS_EM122
-	            || summary->toolType == MBSYS_HDCS_EM302
-		    || summary->toolType == MBSYS_HDCS_SeaBat_8125
-		    || summary->toolType == MBSYS_HDCS_SeaBat_8111
-		    || summary->toolType == MBSYS_HDCS_SeaBat_8150
-		    || summary->toolType == MBSYS_HDCS_EM3002
-		    || summary->toolType == MBSYS_HDCS_EM710
-		    || summary->toolType == MBSYS_HDCS_EM3002
-		    || summary->toolType == MBSYS_HDCS_EM3002D
-		    || summary->toolType == MBSYS_HDCS_SeaBat_8160))
-		{
-		/* write the sidescan */
-		if (status == MB_SUCCESS)
-		    {
-		    if ((write_size = fwrite(data->ss_raw,1,
-			profile->numSamples,mb_io_ptr->mbfp2))
-			== profile->numSamples)
-			{
-			mb_io_ptr->file2_bytes += write_size;
-			status = MB_SUCCESS;
-			*error = MB_ERROR_NO_ERROR;
-			}
-		    else
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_WRITE_FAIL;
-			}
-		    }
-		}
-	    }
-
-	/* else write the comment */
-	else if (status == MB_SUCCESS
-	    && dataplus->kind == MB_DATA_COMMENT)
-	    {
-	    offset = 0;
-	    buffer[offset] = '#'; offset += 1;
-	    buffer[offset] = '#'; offset += 1;
-	    buffer[offset] = '#'; offset += 1;
-	    buffer[offset] = '#'; offset += 1;
-
-	    /* write comment to file */
-	    if ((write_size = fwrite(buffer,1,4,
-			    mb_io_ptr->mbfp)) == 4)
-		{
-		mb_io_ptr->file_bytes += write_size;
-		if ((write_size = fwrite(dataplus->comment,1,
-				MBF_OMGHDCSJ_MAX_COMMENT,
-				mb_io_ptr->mbfp))
-				== MBF_OMGHDCSJ_MAX_COMMENT)
-		    {
-		    mb_io_ptr->file_bytes += write_size;
-		    status = MB_SUCCESS;
-		    *error = MB_ERROR_NO_ERROR;
-		    }
-		else
-		    {
-		    status = MB_FAILURE;
-		    *error = MB_ERROR_WRITE_FAIL;
-		    }
-		}
-	    else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	    }
-
-	/* print output debug statements */
-	if (verbose >= 2)
-	    {
-	    fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-		    function_name);
-	    fprintf(stderr,"dbg2  Return values:\n");
-	    fprintf(stderr,"dbg2       error:      %d\n",*error);
-	    fprintf(stderr,"dbg2  Return status:\n");
-	    fprintf(stderr,"dbg2       status:  %d\n",status);
-	    }
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mbr_photgram.c b/src/mbio/mbr_photgram.c
deleted file mode 100644
index b218fcb..0000000
--- a/src/mbio/mbr_photgram.c
+++ /dev/null
@@ -1,1098 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbr_photgram.c	1/27/2014
- *	$Id: mbr_photgram.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 2014-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbr_photgram.c contains the functions for reading and writing
- * multibeam data in the PHOTGRAM format.
- * These functions include:
- *   mbr_alm_photgram	- allocate read/write memory
- *   mbr_dem_photgram	- deallocate read/write memory
- *   mbr_rt_photgram	- read and translate data
- *   mbr_wt_photgram	- translate and write data
- *
- * Author:	D. W. Caress
- * Date:	November 23, 2014
- *
- */
-/*
- * Notes on the mbsys_stereopair data structure and associated format
- * mbf_photgram:
- *   1. This is an MB-System i/o module to read and write topography
- *      calculated by photogrammetry from stereo pair photographs.
- *   2. The structure in mbsys_stereopair.h defines the internal
- *      representation of photogrammetric topography data.
- *   3. The functions in mbsys_stereopair.c allow for extracting
- *      data from or inserting data into this internal
- *      representation. These functions are called by the
- *      MBIO API functions found in mbio/mb_access.c.
- *   4. The functions in mbr_photgram.c actually read and
- *      write the mbf_photgram format.
- *   5. Prototypes for all of the functions in mbsys_stereopair.c
- *      are provided in mbsys_stereopair.h.
- *   6. This list of functions corresponds to the function pointers
- *      that are included in the structure mb_io_struct that is defined
- *      in the file mbsystem/src/mbio/mb_io.h
- *      Not all of these functions are required - some only make sense to
- *      define if the relevant data type is part of the format. For instance,
- *      do not define mbsys_stereopair_extract_segy() if there are no subbottom
- *      profiler data supported by this data system
- *   7. The data are structured as deriving from a series of stereo pairs.
- *      The position and attitude of the camera rig are included, as is the
- *      position (relative to the camera) of each sounding derived from the
- *      stereo pair.
- *   8. Files in format mbf_photgram begin with the characters:
- *          ##PHOTGRAM##V001
- *      Following the 16-byte file header, the individual data records follow
- *      in any order. The defined record types include survey (MB_DATA_DATA),
- *      comment (MB_DATA_COMMENT), and INS (MB_DATA_NAV) which includes
- *      navigation, sensor depth, heading, and attitude sampled more frequently
- *      than the stereo photography.
- *
- *      Survey data records are binary with the following form:
- *              Number of bytes in record           4U
- *              Data record identifier              4U      (0x44445047 = "DDPG" = 1145327687)
- *              Time stamp (MB-System time_d)       8F      Decimal seconds since 1970/1/1/ 00:00:00
- *              Longitude                           8F      Decimal degrees
- *              Lattitude                           8F      Decimal degrees
- *              Sensor depth                        8F      Meters
- *              Heading                             4F      Decimal degrees
- *              Roll                                4F      Decimal degrees
- *              Pitch                               4F      Decimal degrees
- *              Speed                               4F      Decimal degrees
- *              Altitude                            4F      Decimal degrees
- *              N (Number of soundings)             4U
- *              ------------------------------------------------------------
- *              Repeat N times:
- *              ------------------------------------------------------------
- *              acrosstrack                         8F      meters
- *              alongtrack                          8F      meters
- *              depth                               8F      meters
- *              beamflag                            1U      beamflag
- *              red                                 1U      0-255
- *              green                               1U      0-255
- *              blue                                1U      0-255
- *              ------------------------------------------------------------
- *              End identifier                      4U      (0x454E4421 = "END!" = 1162757153)
- *              Check sum of data record between    2U
- *              and including the data record and
- *              end identifiers
- *
- *      INS data records are binary with the following form:
- *              Number of bytes in record           4U
- *              Data record identifier              4U      (0x4444494E = "DDIN" = 1145325902)
- *              Time stamp (MB-System time_d)       8F      Decimal seconds since 1970/1/1/ 00:00:00
- *              Longitude                           8F      Decimal degrees
- *              Lattitude                           8F      Decimal degrees
- *              Sensor depth                        8F      Meters
- *              Heading                             4F      Decimal degrees
- *              Roll                                4F      Decimal degrees
- *              Pitch                               4F      Decimal degrees
- *              Speed                               4F      Decimal degrees
- *              Altitude                            4F      Decimal degrees
- *              End identifier                      4U      (0x454E4421 = "END!" = 1162757153)
- *              Check sum of data record between    2U
- *              and including the data record and
- *              end identifiers
- *
- *      Comment data records are binary with the following form:
- *              Number of bytes in record           4U
- *              Data record identifier              4U      (0x4444434D = "DDCM" = 1145324365)
- *              Number of characters in comment     4U      Includes at least one terminating
- *                                                          null character, multiple of 4.
- *              Comment                             NC      
- *              End identifier                      4U      (0x454E4421 = "END!" = 1162757153)
- *              Check sum of data record between    2U
- *              and including the data record and
- *              end identifiers
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mb_define.h"
-#include "mbsys_stereopair.h"
-
-/* include for byte swapping */
-#include "mb_swap.h"
-
-/* turn on debug statements here */
-/* #define MBR_PHOTGRAM_DEBUG 1 */
-
-/* essential function prototypes */
-int mbr_register_photgram(int verbose, void *mbio_ptr,
-		int *error);
-int mbr_info_photgram(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_alm_photgram(int verbose, void *mbio_ptr, int *error);
-int mbr_dem_photgram(int verbose, void *mbio_ptr, int *error);
-int mbr_rt_photgram(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_wt_photgram(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_photgram_rd_data(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_photgram_wr_data(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-
-static char rcs_id[]="$Id: mbr_photgram.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mbr_register_photgram(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_register_photgram";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* get mb_io_ptr */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set format info parameters */
-	status = mbr_info_photgram(verbose,
-			&mb_io_ptr->system,
-			&mb_io_ptr->beams_bath_max,
-			&mb_io_ptr->beams_amp_max,
-			&mb_io_ptr->pixels_ss_max,
-			mb_io_ptr->format_name,
-			mb_io_ptr->system_name,
-			mb_io_ptr->format_description,
-			&mb_io_ptr->numfile,
-			&mb_io_ptr->filetype,
-			&mb_io_ptr->variable_beams,
-			&mb_io_ptr->traveltime,
-			&mb_io_ptr->beam_flagging,
-			&mb_io_ptr->nav_source,
-			&mb_io_ptr->heading_source,
-			&mb_io_ptr->vru_source,
-			&mb_io_ptr->svp_source,
-			&mb_io_ptr->beamwidth_xtrack,
-			&mb_io_ptr->beamwidth_ltrack,
-			error);
-
-	/* set format and system specific function pointers */
-	mb_io_ptr->mb_io_format_alloc = &mbr_alm_photgram;
-	mb_io_ptr->mb_io_format_free = &mbr_dem_photgram;
-	mb_io_ptr->mb_io_store_alloc = &mbsys_stereopair_alloc;
-	mb_io_ptr->mb_io_store_free = &mbsys_stereopair_deall;
-	mb_io_ptr->mb_io_read_ping = &mbr_rt_photgram;
-	mb_io_ptr->mb_io_write_ping = &mbr_wt_photgram;
-	mb_io_ptr->mb_io_dimensions = &mbsys_stereopair_dimensions;
-	mb_io_ptr->mb_io_pingnumber = &mbsys_stereopair_pingnumber;
-	mb_io_ptr->mb_io_sonartype = &mbsys_stereopair_sonartype;
-	mb_io_ptr->mb_io_sidescantype = &mbsys_stereopair_sidescantype;
-	mb_io_ptr->mb_io_extract = &mbsys_stereopair_extract;
-	mb_io_ptr->mb_io_insert = &mbsys_stereopair_insert;
-	mb_io_ptr->mb_io_extract_nav = &mbsys_stereopair_extract_nav;
-	mb_io_ptr->mb_io_extract_nnav = &mbsys_stereopair_extract_nnav;
-	mb_io_ptr->mb_io_insert_nav = &mbsys_stereopair_insert_nav;
-	mb_io_ptr->mb_io_extract_altitude = &mbsys_stereopair_extract_altitude;
-	mb_io_ptr->mb_io_insert_altitude = NULL;
-	mb_io_ptr->mb_io_extract_svp = NULL;
-	mb_io_ptr->mb_io_insert_svp = NULL;
-	mb_io_ptr->mb_io_ttimes = &mbsys_stereopair_ttimes;
-	mb_io_ptr->mb_io_detects = NULL;
-	mb_io_ptr->mb_io_gains = NULL;
-	mb_io_ptr->mb_io_copyrecord = &mbsys_stereopair_copy;
-	mb_io_ptr->mb_io_extract_rawss = NULL;
-	mb_io_ptr->mb_io_insert_rawss = NULL;
-	mb_io_ptr->mb_io_extract_segytraceheader = NULL;
-	mb_io_ptr->mb_io_extract_segy = NULL;
-	mb_io_ptr->mb_io_insert_segy = NULL;
-	mb_io_ptr->mb_io_ctd = NULL;
-	mb_io_ptr->mb_io_ancilliarysensor = NULL;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",mb_io_ptr->system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",mb_io_ptr->beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",mb_io_ptr->beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",mb_io_ptr->pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",mb_io_ptr->format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",mb_io_ptr->system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",mb_io_ptr->format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",mb_io_ptr->numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",mb_io_ptr->filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",mb_io_ptr->variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",mb_io_ptr->traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",mb_io_ptr->beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",mb_io_ptr->nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",mb_io_ptr->heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",mb_io_ptr->vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",mb_io_ptr->svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",mb_io_ptr->beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",mb_io_ptr->beamwidth_ltrack);
-		fprintf(stderr,"dbg2       format_alloc:       %p\n",(void *)mb_io_ptr->mb_io_format_alloc);
-		fprintf(stderr,"dbg2       format_free:        %p\n",(void *)mb_io_ptr->mb_io_format_free);
-		fprintf(stderr,"dbg2       store_alloc:        %p\n",(void *)mb_io_ptr->mb_io_store_alloc);
-		fprintf(stderr,"dbg2       store_free:         %p\n",(void *)mb_io_ptr->mb_io_store_free);
-		fprintf(stderr,"dbg2       read_ping:          %p\n",(void *)mb_io_ptr->mb_io_read_ping);
-		fprintf(stderr,"dbg2       write_ping:         %p\n",(void *)mb_io_ptr->mb_io_write_ping);
-		fprintf(stderr,"dbg2       extract:            %p\n",(void *)mb_io_ptr->mb_io_extract);
-		fprintf(stderr,"dbg2       insert:             %p\n",(void *)mb_io_ptr->mb_io_insert);
-		fprintf(stderr,"dbg2       extract_nav:        %p\n",(void *)mb_io_ptr->mb_io_extract_nav);
-		fprintf(stderr,"dbg2       insert_nav:         %p\n",(void *)mb_io_ptr->mb_io_insert_nav);
-		fprintf(stderr,"dbg2       extract_altitude:   %p\n",(void *)mb_io_ptr->mb_io_extract_altitude);
-		fprintf(stderr,"dbg2       insert_altitude:    %p\n",(void *)mb_io_ptr->mb_io_insert_altitude);
-		fprintf(stderr,"dbg2       extract_svp:        %p\n",(void *)mb_io_ptr->mb_io_extract_svp);
-		fprintf(stderr,"dbg2       insert_svp:         %p\n",(void *)mb_io_ptr->mb_io_insert_svp);
-		fprintf(stderr,"dbg2       ttimes:             %p\n",(void *)mb_io_ptr->mb_io_ttimes);
-		fprintf(stderr,"dbg2       detects:            %p\n",(void *)mb_io_ptr->mb_io_detects);
-		fprintf(stderr,"dbg2       extract_rawss:      %p\n",(void *)mb_io_ptr->mb_io_extract_rawss);
-		fprintf(stderr,"dbg2       insert_rawss:       %p\n",(void *)mb_io_ptr->mb_io_insert_rawss);
-		fprintf(stderr,"dbg2       extract_segytraceheader: %p\n",(void *)mb_io_ptr->mb_io_extract_segytraceheader);
-		fprintf(stderr,"dbg2       extract_segy:       %p\n",(void *)mb_io_ptr->mb_io_extract_segy);
-		fprintf(stderr,"dbg2       insert_segy:        %p\n",(void *)mb_io_ptr->mb_io_insert_segy);
-		fprintf(stderr,"dbg2       copyrecord:         %p\n",(void *)mb_io_ptr->mb_io_copyrecord);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbr_info_photgram(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error)
-{
-	char	*function_name = "mbr_info_photgram";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* set format info parameters */
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-	*system = MB_SYS_STEREOPAIR;
-	*beams_bath_max = 0;
-	*beams_amp_max = 0;
-	*pixels_ss_max = 0;
-	strncpy(format_name, "PHOTGRAM", MB_NAME_LENGTH);
-	strncpy(system_name, "STEREOPAIR", MB_NAME_LENGTH);
-	strncpy(format_description, "Format name:          MBF_PHOTGRAM\nInformal Description: Example format\nAttributes:           Name the relevant sensor(s), \n                      what data types are supported\n                      how many beams and pixels, file type (ascii, binary, netCDF), Organization that defined this format.\n", MB_DESCRIPTION_LENGTH);
-	*numfile = 1;
-	*filetype = MB_FILETYPE_SINGLE;
-	*variable_beams = MB_YES;
-	*traveltime = MB_YES;
-	*beam_flagging = MB_YES;
-	*nav_source = MB_DATA_DATA;
-	*heading_source = MB_DATA_DATA;
-	*vru_source = MB_DATA_DATA;
-	*svp_source = MB_DATA_NONE;
-	*beamwidth_xtrack = 0.0;
-	*beamwidth_ltrack = 0.0;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",*system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",*beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",*beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",*pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",*numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",*filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",*variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",*traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",*beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",*nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",*heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",*vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",*svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",*beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",*beamwidth_ltrack);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_alm_photgram(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_alm_photgram";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set initial status */
-	status = MB_SUCCESS;
-
-	/* allocate memory for data structure */
-	mb_io_ptr->structure_size = 0;
-	mb_io_ptr->data_structure_size = 0;
-	status = mbsys_stereopair_alloc(
-			verbose,mbio_ptr,
-			&mb_io_ptr->store_data,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_dem_photgram(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_dem_photgram";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointers to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* deallocate memory for data descriptor */
-	status = mbsys_stereopair_deall(
-			verbose,mbio_ptr,
-			&mb_io_ptr->store_data,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_rt_photgram(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_rt_photgram";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_stereopair_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointers to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-#ifdef MBR_PHOTGRAM_DEBUG
-	fprintf(stderr,"About to call mbr_photgram_rd_data...\n");
-#endif
-
-	/* read next data from file */
-	status = mbr_photgram_rd_data(verbose,mbio_ptr,store_ptr,error);
-
-	/* get pointers to data structures */
-	store = (struct mbsys_stereopair_struct *) store_ptr;
-
-	/* set error and kind in mb_io_ptr */
-	mb_io_ptr->new_error = *error;
-	mb_io_ptr->new_kind = store->kind;
-
-#ifdef MBR_PHOTGRAM_DEBUG
-	fprintf(stderr,"Done with mbr_photgram_rd_data: status:%d error:%d record kind:%d\n", status, *error, store->kind);
-#endif
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_wt_photgram(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_wt_photgram";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_stereopair_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_stereopair_struct *) store_ptr;
-
-#ifdef MBR_PHOTGRAM_DEBUG
-	fprintf(stderr,"About to call mbr_photgram_wr_data record kind:%d\n", store->kind);
-#endif
-
-	/* write next data to file */
-	status = mbr_photgram_wr_data(verbose,mbio_ptr,store_ptr,error);
-
-#ifdef MBR_PHOTGRAM_DEBUG
-	fprintf(stderr,"Done with mbr_photgram_wr_data: status:%d error:%d\n", status, *error);
-#endif
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_photgram_rd_data(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_photgram_rd_data";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_stereopair_struct *store;
-	struct mbsys_stereopair_sounding_struct *sounding;
-	char	buffer[MB_COMMENT_MAXLINE+8];
-	size_t	read_len;
-	int	recordsize;
-	short	checksum;
-	int	*fileheader_initialized;
-	int	*formatversion;
-	int	swap = MB_YES;
-	int	index;
-	int	skip;
-	int	i, n;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_stereopair_struct *) store_ptr;
-
-	/* set file position */
-	mb_io_ptr->file_pos = mb_io_ptr->file_bytes;
-	
-	/* get saved values */
-	fileheader_initialized = (int *) &mb_io_ptr->save1;
-	formatversion = (int *) &mb_io_ptr->save2;
-	
-	/* read file header if necessary */
-	if (*fileheader_initialized == MB_NO)
-		{
-		read_len = 16;
-		buffer[read_len] = '\0';
-		status = mb_fileio_get(verbose, mbio_ptr, (char *)buffer, &read_len, error);
-		if (strncmp(buffer, "##PHOTGRAM##V", 13) == 0)
-			{
-			n = sscanf(buffer, "##PHOTGRAM##V%d", formatversion);
-			*fileheader_initialized = MB_YES;
-			}
-		else
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_BAD_FORMAT;
-			}
-		}
-
-	/* read the next record header */
-	read_len = 8;
-	status = mb_fileio_get(verbose, mbio_ptr, (char *)buffer, &read_len, error);
-
-	/* check for valid record, loop over reading bytes until a valid
-		record label is found or the read fails */
-	skip = 0;
-	while (status == MB_SUCCESS && strncmp(&buffer[4], "DD", 2) != 0)
-		{
-		for (i=0;i<7;i++)
-			buffer[i] = buffer[i+1];
-		read_len = 1;
-		status = mb_fileio_get(verbose, mbio_ptr, (char *)&buffer[7], &read_len, error);
-		skip++;
-		}
-		
-	/* if a valid record label has been found then read and parse it */
-	if (status == MB_SUCCESS)
-		{
-		/* get the record size */
-		mb_get_binary_int(swap, &buffer[0], &recordsize);
-		
-		/* read a survey record */
-		if (strncmp(&buffer[4], "DDPG", 4) == 0)
-			{
-			store->kind = MB_DATA_DATA;
-			
-			/* read the record header */
-			read_len = MBSYS_STEREOPAIR_HEADER_SIZE;
-			status = mb_fileio_get(verbose, mbio_ptr, (char *)buffer, &read_len, error);
-			index = 0;
-			
-			/* parse the record header */
-			mb_get_binary_double(swap, &buffer[index], &store->time_d); index += 8;
-			mb_get_date(verbose, store->time_d, store->time_i);
-			mb_get_binary_double(swap, &buffer[index], &store->longitude); index += 8;
-			mb_get_binary_double(swap, &buffer[index], &store->latitude); index += 8;
-			mb_get_binary_double(swap, &buffer[index], &store->sensordepth); index += 8;
-			mb_get_binary_float(swap, &buffer[index], &store->heading); index += 4;
-			mb_get_binary_float(swap, &buffer[index], &store->roll); index += 4;
-			mb_get_binary_float(swap, &buffer[index], &store->pitch); index += 4;
-			mb_get_binary_float(swap, &buffer[index], &store->speed); index += 4;
-			mb_get_binary_float(swap, &buffer[index], &store->altitude); index += 4;
-			mb_get_binary_int(swap, &buffer[index], &store->num_soundings); index += 4;
-
-			/* output debug information */
-			if (verbose >= 4)
-				{
-				fprintf(stderr,"dbg4   DDPG Survey Record just read:\n");
-				fprintf(stderr,"dbg4     recordsize:                 %d\n",recordsize);
-				fprintf(stderr,"dbg4     kind:                       %d\n",store->kind);
-				fprintf(stderr,"dbg4     time_d:                     %f\n",store->time_d);
-				fprintf(stderr,"dbg4     longitude:                  %f\n",store->longitude);
-				fprintf(stderr,"dbg4     latitude:                   %f\n",store->latitude);
-				fprintf(stderr,"dbg4     sensordepth:                %f\n",store->sensordepth);
-				fprintf(stderr,"dbg4     heading:                    %f\n",store->heading);
-				fprintf(stderr,"dbg4     roll:                       %f\n",store->roll);
-				fprintf(stderr,"dbg4     pitch:                      %f\n",store->pitch);
-				fprintf(stderr,"dbg4     speed:                      %f\n",store->speed);
-				fprintf(stderr,"dbg4     altitude:                   %f\n",store->altitude);
-				fprintf(stderr,"dbg4     num_soundings:              %d\n",store->num_soundings);
-				fprintf(stderr,"dbg4     num_soundings_alloc:        %d\n",store->num_soundings_alloc);
-				}
-			
-			/* allocated memory to hold the soundings if necessary */
-			if (store->num_soundings_alloc < store->num_soundings)
-				{
-				/* allocate memory for data structure */
-				status = mb_reallocd(verbose, __FILE__, __LINE__,
-							store->num_soundings * sizeof(struct mbsys_stereopair_sounding_struct),
-							(void **)(&store->soundings), error);
-				if (status == MB_SUCCESS)
-					store->num_soundings_alloc = store->num_soundings;
-				else
-					store->num_soundings_alloc = 0;
-				}
-
-			/* output debug information */
-			if (verbose >= 4)
-				{
-				fprintf(stderr,"dbg4     num_soundings_alloc:        %d\n",store->num_soundings_alloc);
-				}
-				
-			/* read in the soundings */
-			for (i=0; i< store->num_soundings; i++)
-				{
-				sounding = &store->soundings[i];
-				
-				/* read the sounding */
-				read_len = MBSYS_STEREOPAIR_SOUNDING_SIZE;
-				status = mb_fileio_get(verbose, mbio_ptr, (char *)buffer, &read_len, error);
-				
-				/* parse the sounding */
-				index = 0;
-				mb_get_binary_double(swap, &buffer[index], &sounding->acrosstrack); index += 8;
-				mb_get_binary_double(swap, &buffer[index], &sounding->alongtrack); index += 8;
-				mb_get_binary_double(swap, &buffer[index], &sounding->depth); index += 8;
-				sounding->beamflag = buffer[index]; index++;
-				sounding->red = buffer[index]; index++;
-				sounding->green = buffer[index]; index++;
-				sounding->blue = buffer[index]; index++;
-
-				/* output debug information */
-				if (verbose >= 4)
-					{
-					fprintf(stderr,"dbg4     %10d  %10g  %10g  %10g %x   %3d %3d %3d\n",
-						i,sounding->acrosstrack,sounding->alongtrack,sounding->depth,sounding->beamflag,
-						sounding->red,sounding->green,sounding->blue);
-					}
-				}
-				
-			/* read the end identifier and checksum */
-			read_len = 6;
-			status = mb_fileio_get(verbose, mbio_ptr, (char *)&buffer, &read_len, error);
-				
-			/* parse the end identifier and checksum */
-			if (strncmp(buffer, "END!", 4) != 0)
-				{
-				status = MB_FAILURE;
-				*error = MB_ERROR_UNINTELLIGIBLE;
-				}
-			else
-				{
-				mb_get_binary_short(swap, &buffer[4], &checksum);
-				}
-
-			/* output debug information */
-			if (verbose >= 4)
-				{
-				fprintf(stderr,"dbg4     end identifier:             %c%c%c%c\n",buffer[0],buffer[1],buffer[2],buffer[3]);
-				fprintf(stderr,"dbg4     checksum:                   %d\n",checksum);
-				}
-			}
-		
-		/* read an ins record */
-		else if (strncmp(&buffer[4], "DDIN", 4) == 0)
-			{
-			store->kind = MB_DATA_NAV;
-			
-			/* read the record header */
-			read_len = MBSYS_STEREOPAIR_INS_SIZE;
-			status = mb_fileio_get(verbose, mbio_ptr, (char *)buffer, &read_len, error);
-			index = 0;
-			
-			/* parse the record header */
-			mb_get_binary_double(swap, &buffer[index], &store->time_d); index += 8;
-			mb_get_date(verbose, store->time_d, store->time_i);
-			mb_get_binary_double(swap, &buffer[index], &store->longitude); index += 8;
-			mb_get_binary_double(swap, &buffer[index], &store->latitude); index += 8;
-			mb_get_binary_double(swap, &buffer[index], &store->sensordepth); index += 8;
-			mb_get_binary_float(swap, &buffer[index], &store->heading); index += 4;
-			mb_get_binary_float(swap, &buffer[index], &store->roll); index += 4;
-			mb_get_binary_float(swap, &buffer[index], &store->pitch); index += 4;
-			mb_get_binary_float(swap, &buffer[index], &store->speed); index += 4;
-			mb_get_binary_float(swap, &buffer[index], &store->altitude); index += 4;
-			
-			/* read the end identifier and checksum */
-			read_len = 6;
-			status = mb_fileio_get(verbose, mbio_ptr, (char *)&buffer, &read_len, error);
-				
-			/* parse the end identifier and checksum */
-			if (strncmp(buffer, "END!", 4) != 0)
-				{
-				status = MB_FAILURE;
-				*error = MB_ERROR_UNINTELLIGIBLE;
-				}
-			else
-				{
-				mb_get_binary_short(swap, &buffer[4], &checksum);
-				}
-
-			/* output debug information */
-			if (verbose >= 4)
-				{
-				fprintf(stderr,"dbg4   DDIN Survey Record just read:\n");
-				fprintf(stderr,"dbg4     recordsize:                 %d\n",recordsize);
-				fprintf(stderr,"dbg4     kind:                       %d\n",store->kind);
-				fprintf(stderr,"dbg4     time_d:                     %f\n",store->time_d);
-				fprintf(stderr,"dbg4     longitude:                  %f\n",store->longitude);
-				fprintf(stderr,"dbg4     latitude:                   %f\n",store->latitude);
-				fprintf(stderr,"dbg4     sensordepth:                %f\n",store->sensordepth);
-				fprintf(stderr,"dbg4     heading:                    %f\n",store->heading);
-				fprintf(stderr,"dbg4     roll:                       %f\n",store->roll);
-				fprintf(stderr,"dbg4     pitch:                      %f\n",store->pitch);
-				fprintf(stderr,"dbg4     speed:                      %f\n",store->speed);
-				fprintf(stderr,"dbg4     altitude:                   %f\n",store->altitude);
-				fprintf(stderr,"dbg4     end identifier:             %c%c%c%c\n",buffer[0],buffer[1],buffer[2],buffer[3]);
-				fprintf(stderr,"dbg4     checksum:                   %d\n",checksum);
-				}
-			}
-		
-		/* read a comment record */
-		else if (strncmp(&buffer[4], "DDCM", 4) == 0)
-			{
-			store->kind = MB_DATA_COMMENT;
-			
-			/* read the comment length */
-			read_len = 4;
-			status = mb_fileio_get(verbose, mbio_ptr, (char *)&store->comment_len, &read_len, error);
-			
-			/* read the comment */
-			read_len = store->comment_len;
-			status = mb_fileio_get(verbose, mbio_ptr, (char *)store->comment, &read_len, error);
-			
-			/* read the end identifier and checksum */
-			read_len = 6;
-			status = mb_fileio_get(verbose, mbio_ptr, (char *)&buffer, &read_len, error);
-				
-			/* parse the end identifier and checksum */
-			if (strncmp(buffer, "END!", 4) != 0)
-				{
-				status = MB_FAILURE;
-				*error = MB_ERROR_UNINTELLIGIBLE;
-				}
-			else
-				{
-				mb_get_binary_short(swap, &buffer[4], &checksum);
-				}
-
-			/* output debug information */
-			if (verbose >= 4)
-				{
-				fprintf(stderr,"dbg4   DDCM Survey Record just read:\n");
-				fprintf(stderr,"dbg4     recordsize:                 %d\n",recordsize);
-				fprintf(stderr,"dbg4     kind:                       %d\n",store->kind);
-				fprintf(stderr,"dbg4     comment_len:                %d\n",store->comment_len);
-				fprintf(stderr,"dbg4     comment:                    %s\n",store->comment);
-				fprintf(stderr,"dbg4     end identifier:             %c%c%c%c\n",buffer[0],buffer[1],buffer[2],buffer[3]);
-				fprintf(stderr,"dbg4     checksum:                   %d\n",checksum);
-				}
-			}
-		}
-
-	/* get file position */
-	mb_io_ptr->file_bytes = ftell(mb_io_ptr->mbfp);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_photgram_wr_data(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_photgram_wr_data";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_stereopair_struct *store;
-	struct mbsys_stereopair_sounding_struct *sounding;
-	char	buffer[MB_COMMENT_MAXLINE+8];
-	size_t	write_len;
-	int	checksum = 0;
-	int	*fileheader_initialized;
-	int	*formatversion;
-	int	swap = MB_YES;
-	int	index;
-	int	i;
-	
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_stereopair_struct *) store_ptr;
-	
-	/* get saved values */
-	fileheader_initialized = (int *) &mb_io_ptr->save1;
-	formatversion = (int *) &mb_io_ptr->save2;
-	
-	/* write file header if necessary */
-	if (*fileheader_initialized == MB_NO)
-		{
-		sprintf(buffer, "##PHOTGRAM##V001");
-		write_len = 16;
-		buffer[write_len] = '\0';
-		status = mb_fileio_put(verbose, mbio_ptr, (char *)buffer, &write_len, error);
-		if (status == MB_SUCCESS)
-			{
-			*fileheader_initialized = MB_YES;
-			}
-		}
-		
-	/* now write the data record */
-	if (status == MB_SUCCESS)
-		{
-		/* write a survey record */
-		if (store->kind == MB_DATA_DATA)
-			{
-			/* calculate full write length */
-			write_len = 8 + MBSYS_STEREOPAIR_HEADER_SIZE
-					+ store->num_soundings * MBSYS_STEREOPAIR_SOUNDING_SIZE
-					+ 6;
-			
-			/* output debug information */
-			if (verbose >= 4)
-				{
-				fprintf(stderr,"dbg4   DDPG Survey Record to be written:\n");
-				fprintf(stderr,"dbg4     write_len:                  %zu\n",write_len);
-				fprintf(stderr,"dbg4     kind:                       %d\n",store->kind);
-				fprintf(stderr,"dbg4     time_d:                     %f\n",store->time_d);
-				fprintf(stderr,"dbg4     longitude:                  %f\n",store->longitude);
-				fprintf(stderr,"dbg4     latitude:                   %f\n",store->latitude);
-				fprintf(stderr,"dbg4     sensordepth:                %f\n",store->sensordepth);
-				fprintf(stderr,"dbg4     heading:                    %f\n",store->heading);
-				fprintf(stderr,"dbg4     roll:                       %f\n",store->roll);
-				fprintf(stderr,"dbg4     pitch:                      %f\n",store->pitch);
-				fprintf(stderr,"dbg4     speed:                      %f\n",store->speed);
-				fprintf(stderr,"dbg4     altitude:                   %f\n",store->altitude);
-				fprintf(stderr,"dbg4     num_soundings:              %d\n",store->num_soundings);
-				fprintf(stderr,"dbg4     num_soundings_alloc:        %d\n",store->num_soundings_alloc);
-				fprintf(stderr,"dbg4     num_soundings_alloc:        %d\n",store->num_soundings_alloc);
-				//for (i=0; i< store->num_soundings; i++)
-				for (i=0; i< 10; i++)
-					{
-					sounding = &store->soundings[i];
-					fprintf(stderr,"dbg4     %10d  %10g  %10g  %10g %x   %3d %3d %3d\n",
-						i,sounding->acrosstrack,sounding->alongtrack,sounding->depth,sounding->beamflag,
-						sounding->red,sounding->green,sounding->blue);
-					}
-				}
-
-			/* insert and write the header values */
-			index = 0;
-			mb_put_binary_int(swap, write_len, (void *)&buffer[index]); index += 4;
-			strncpy(&buffer[index], "DDPG", 4); index += 4;
-			mb_put_binary_double(swap, store->time_d, (void *)&buffer[index]); index += 8;
-			mb_put_binary_double(swap, store->longitude, (void *)&buffer[index]); index += 8;
-			mb_put_binary_double(swap, store->latitude, (void *)&buffer[index]); index += 8;
-			mb_put_binary_double(swap, store->sensordepth, (void *)&buffer[index]); index += 8;
-			mb_put_binary_float(swap, store->heading, (void *)&buffer[index]); index += 4;
-			mb_put_binary_float(swap, store->roll, (void *)&buffer[index]); index += 4;
-			mb_put_binary_float(swap, store->pitch, (void *)&buffer[index]); index += 4;
-			mb_put_binary_float(swap, store->speed, (void *)&buffer[index]); index += 4;
-			mb_put_binary_float(swap, store->altitude, (void *)&buffer[index]); index += 4;
-			mb_put_binary_int(swap, store->num_soundings, (void *)&buffer[index]); index += 4;
-			write_len = index;
-			status = mb_fileio_put(verbose, mbio_ptr, buffer, &write_len, error);
-				
-			/* write out the soundings */
-			for (i=0; i< store->num_soundings; i++)
-				{
-				/* insert the sounding */
-				sounding = &store->soundings[i];
-				index = 0;
-				mb_put_binary_double(swap, sounding->acrosstrack, (void *)&buffer[index]); index += 8;
-				mb_put_binary_double(swap, sounding->alongtrack, (void *)&buffer[index]); index += 8;
-				mb_put_binary_double(swap, sounding->depth, (void *)&buffer[index]); index += 8;
-				buffer[index] = sounding->beamflag; index++;
-				buffer[index] = sounding->red; index++;
-				buffer[index] = sounding->green; index++;
-				buffer[index] = sounding->blue; index++;
-				write_len = index;
-				status = mb_fileio_put(verbose, mbio_ptr, buffer, &write_len, error);
-				}
-
-			/* write the end identifier and checksum */
-			index = 0;
-			strncpy(&buffer[index], "END!", 4); index += 4;
-			mb_put_binary_short(swap, checksum, (void *)&buffer[index]); index += 2;
-			write_len = index;
-			status = mb_fileio_put(verbose, mbio_ptr, buffer, &write_len, error);
-			}
-			
-		/* write an ins record */
-		else if (store->kind == MB_DATA_NAV)
-			{
-			/* calculate full write length */
-			write_len = 8 + MBSYS_STEREOPAIR_INS_SIZE + 6;
-			
-			/* output debug information */
-			if (verbose >= 4)
-				{
-				fprintf(stderr,"dbg4   DDIN Survey Record to be written:\n");
-				fprintf(stderr,"dbg4     write_len:                  %zu\n",write_len);
-				fprintf(stderr,"dbg4     kind:                       %d\n",store->kind);
-				fprintf(stderr,"dbg4     time_d:                     %f\n",store->time_d);
-				fprintf(stderr,"dbg4     longitude:                  %f\n",store->longitude);
-				fprintf(stderr,"dbg4     latitude:                   %f\n",store->latitude);
-				fprintf(stderr,"dbg4     sensordepth:                %f\n",store->sensordepth);
-				fprintf(stderr,"dbg4     heading:                    %f\n",store->heading);
-				fprintf(stderr,"dbg4     roll:                       %f\n",store->roll);
-				fprintf(stderr,"dbg4     pitch:                      %f\n",store->pitch);
-				fprintf(stderr,"dbg4     speed:                      %f\n",store->speed);
-				fprintf(stderr,"dbg4     altitude:                   %f\n",store->altitude);
-				}
-
-			/* insert and write the header values */
-			index = 0;
-			mb_put_binary_int(swap, write_len, (void *)&buffer[index]); index += 4;
-			strncpy(&buffer[index], "DDIN", 4); index += 4;
-			mb_put_binary_double(swap, store->time_d, (void *)&buffer[index]); index += 8;
-			mb_put_binary_double(swap, store->longitude, (void *)&buffer[index]); index += 8;
-			mb_put_binary_double(swap, store->latitude, (void *)&buffer[index]); index += 8;
-			mb_put_binary_double(swap, store->sensordepth, (void *)&buffer[index]); index += 8;
-			mb_put_binary_float(swap, store->heading, (void *)&buffer[index]); index += 4;
-			mb_put_binary_float(swap, store->roll, (void *)&buffer[index]); index += 4;
-			mb_put_binary_float(swap, store->pitch, (void *)&buffer[index]); index += 4;
-			mb_put_binary_float(swap, store->speed, (void *)&buffer[index]); index += 4;
-			mb_put_binary_float(swap, store->altitude, (void *)&buffer[index]); index += 4;
-			strncpy(&buffer[index], "END!", 4); index += 4;
-			mb_put_binary_short(swap, checksum, (void *)&buffer[index]); index += 2;
-			write_len = index;
-			status = mb_fileio_put(verbose, mbio_ptr, buffer, &write_len, error);
-			}
-			
-		/* write a comment record */
-		else if (store->kind == MB_DATA_COMMENT)
-			{
-			/* calculate full write length */
-			write_len = 12 + store->comment_len + 6;
-			
-			/* output debug information */
-			if (verbose >= 4)
-				{
-				fprintf(stderr,"dbg4   DDCM Survey Record to be written:\n");
-				fprintf(stderr,"dbg4     write_len:                  %zu\n",write_len);
-				fprintf(stderr,"dbg4     kind:                       %d\n",store->kind);
-				fprintf(stderr,"dbg4     comment_len:                %d\n",store->comment_len);
-				fprintf(stderr,"dbg4     comment:                    %s\n",store->comment);
-				}
-
-			/* insert and write the header values */
-			index = 0;
-			mb_put_binary_int(swap, write_len, (void *)&buffer[index]); index += 4;
-			strncpy(&buffer[index], "DDCM", 4); index += 4;
-			mb_put_binary_int(swap, store->comment_len, (void *)&buffer[index]); index += 4;
-			strncpy(&buffer[index], store->comment, store->comment_len); index += store->comment_len;
-			strncpy(&buffer[index], "END!", 4); index += 4;
-			mb_put_binary_short(swap, checksum, (void *)&buffer[index]); index += 2;
-			write_len = index;
-			status = mb_fileio_put(verbose, mbio_ptr, buffer, &write_len, error);
-			}
-		}
-
-#ifdef MBR_PHOTGRAM_DEBUG
-	fprintf(stderr,"PHOTGRAM DATA WRITTEN: type:%d status:%d error:%d\n\n",
-	store->kind, status, *error);
-#endif
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mbr_reson7kr.c b/src/mbio/mbr_reson7kr.c
deleted file mode 100644
index 05abd35..0000000
--- a/src/mbio/mbr_reson7kr.c
+++ /dev/null
@@ -1,18146 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbr_reson7kr.c	4/4/2004
- *	$Id: mbr_reson7kr.c 2225 2015-02-05 07:31:48Z caress $
- *
- *    Copyright (c) 2004-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbr_reson7kr.c contains the functions for reading and writing
- * multibeam data in the RESON7KR format.
- * These functions include:
- *   mbr_alm_reson7kr	- allocate read/write memory
- *   mbr_dem_reson7kr	- deallocate read/write memory
- *   mbr_rt_reson7kr	- read and translate data
- *   mbr_wt_reson7kr	- translate and write data
- *
- * Author:	D. W. Caress
- * Date:	April 4,2004
- * $Log: mbr_reson7kr.c,v $
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mb_define.h"
-#include "mbsys_reson7k.h"
-
-/* include for byte swapping */
-#include "mb_swap.h"
-
-/* turn on debug statements here */
-//#define MBR_RESON7KR_DEBUG 1
-//#define MBR_RESON7KR_DEBUG2 1
-
-/* essential function prototypes */
-int mbr_register_reson7kr(int verbose, void *mbio_ptr,
-		int *error);
-int mbr_info_reson7kr(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_alm_reson7kr(int verbose, void *mbio_ptr, int *error);
-int mbr_dem_reson7kr(int verbose, void *mbio_ptr, int *error);
-int mbr_rt_reson7kr(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_wt_reson7kr(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-
-int mbr_reson7kr_chk_header(int verbose, void *mbio_ptr, char *buffer,
-				int *recordid,  int *deviceid, unsigned short *enumerator, int *size);
-int mbr_reson7kr_rd_data(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_reson7kr_chk_label(int verbose, void *mbio_ptr, short type);
-int mbr_reson7kr_chk_pingnumber(int verbose, int recordid, char *buffer,
-				int *ping_number);
-int mbr_reson7kr_rd_header(int verbose, char *buffer, int *index,
-				s7k_header *header, int *error);
-
-int mbr_reson7kr_rd_reference(int verbose, char *buffer, void *store_ptr, int *error);
-int mbr_reson7kr_rd_sensoruncal(int verbose, char *buffer, void *store_ptr, int *error);
-int mbr_reson7kr_rd_sensorcal(int verbose, char *buffer, void *store_ptr, int *error);
-int mbr_reson7kr_rd_position(int verbose, char *buffer, void *store_ptr, int *error);
-int mbr_reson7kr_rd_customattitude(int verbose, char *buffer, void *store_ptr, int *error);
-int mbr_reson7kr_rd_tide(int verbose, char *buffer, void *store_ptr, int *error);
-int mbr_reson7kr_rd_altitude(int verbose, char *buffer, void *store_ptr, int *error);
-int mbr_reson7kr_rd_motion(int verbose, char *buffer, void *store_ptr, int *error);
-int mbr_reson7kr_rd_depth(int verbose, char *buffer, void *store_ptr, int *error);
-int mbr_reson7kr_rd_svp(int verbose, char *buffer, void *store_ptr, int *error);
-int mbr_reson7kr_rd_ctd(int verbose, char *buffer, void *store_ptr, int *error);
-int mbr_reson7kr_rd_geodesy(int verbose, char *buffer, void *store_ptr, int *error);
-int mbr_reson7kr_rd_rollpitchheave(int verbose, char *buffer, void *store_ptr, int *error);
-int mbr_reson7kr_rd_heading(int verbose, char *buffer, void *store_ptr, int *error);
-int mbr_reson7kr_rd_surveyline(int verbose, char *buffer, void *store_ptr, int *error);
-int mbr_reson7kr_rd_navigation(int verbose, char *buffer, void *store_ptr, int *error);
-int mbr_reson7kr_rd_attitude(int verbose, char *buffer, void *store_ptr, int *error);
-int mbr_reson7kr_rd_rec1022(int verbose, char *buffer, void *store_ptr, int *error);
-int mbr_reson7kr_rd_fsdwchannel(int verbose, int data_format, char *buffer, int *index, s7k_fsdwchannel *fsdwchannel, int *error);
-int mbr_reson7kr_rd_fsdwssheader(int verbose, char *buffer, int *index, s7k_fsdwssheader *fsdwssheader, int *error);
-int mbr_reson7kr_rd_fsdwsegyheader(int verbose, char *buffer, int *index, s7k_fsdwsegyheader *fsdwsegyheader, int *error);
-int mbr_reson7kr_rd_fsdwsslo(int verbose, char *buffer, void *store_ptr,  int *error);
-int mbr_reson7kr_rd_fsdwsshi(int verbose, char *buffer, void *store_ptr,  int *error);
-int mbr_reson7kr_rd_fsdwsb(int verbose, char *buffer, void *store_ptr, int *error);
-int mbr_reson7kr_rd_bluefin(int verbose, char *buffer, void *store_ptr, int *error);
-int mbr_reson7kr_rd_processedsidescan(int verbose, char *buffer, void *store_ptr, int *error);
-int mbr_reson7kr_rd_volatilesonarsettings(int verbose, char *buffer, void *store_ptr, int *error);
-int mbr_reson7kr_rd_configuration(int verbose, char *buffer, void *store_ptr, int *error);
-int mbr_reson7kr_rd_matchfilter(int verbose, char *buffer, void *store_ptr, int *error);
-int mbr_reson7kr_rd_v2firmwarehardwareconfiguration(int verbose, char *buffer, void *store_ptr, int *error);
-int mbr_reson7kr_rd_beamgeometry(int verbose, char *buffer, void *store_ptr, int *error);
-int mbr_reson7kr_rd_calibration(int verbose, char *buffer, void *store_ptr, int *error);
-int mbr_reson7kr_rd_bathymetry(int verbose, char *buffer, void *store_ptr, int *error);
-int mbr_reson7kr_rd_backscatter(int verbose, char *buffer, void *store_ptr, int *error);
-int mbr_reson7kr_rd_beam(int verbose, char *buffer, void *store_ptr, int *error);
-int mbr_reson7kr_rd_verticaldepth(int verbose, char *buffer, void *store_ptr, int *error);
-int mbr_reson7kr_rd_tvg(int verbose, char *buffer, void *store_ptr, int *error);
-int mbr_reson7kr_rd_image(int verbose, char *buffer, void *store_ptr, int *error);
-int mbr_reson7kr_rd_v2pingmotion(int verbose, char *buffer, void *store_ptr, int *error);
-int mbr_reson7kr_rd_v2detectionsetup(int verbose, char *buffer, void *store_ptr, int *error);
-int mbr_reson7kr_rd_v2beamformed(int verbose, char *buffer, void *store_ptr, int *error);
-int mbr_reson7kr_rd_v2bite(int verbose, char *buffer, void *store_ptr, int *error);
-int mbr_reson7kr_rd_v27kcenterversion(int verbose, char *buffer, void *store_ptr, int *error);
-int mbr_reson7kr_rd_v28kwetendversion(int verbose, char *buffer, void *store_ptr, int *error);
-int mbr_reson7kr_rd_v2detection(int verbose, char *buffer, void *store_ptr, int *error);
-int mbr_reson7kr_rd_v2rawdetection(int verbose, char *buffer, void *store_ptr, int *error);
-int mbr_reson7kr_rd_v2snippet(int verbose, char *buffer, void *store_ptr, int *error);
-int mbr_reson7kr_rd_calibratedsnippet(int verbose, char *buffer, void *store_ptr, int *error);
-int mbr_reson7kr_rd_installation(int verbose, char *buffer, void *store_ptr, int *error);
-int mbr_reson7kr_rd_systemeventmessage(int verbose, char *buffer, void *store_ptr, int *error);
-int mbr_reson7kr_rd_fileheader(int verbose, char *buffer, void *store_ptr, int *error);
-int mbr_reson7kr_rd_remotecontrolsettings(int verbose, char *buffer, void *store_ptr, int *error);
-int mbr_reson7kr_rd_reserved(int verbose, char *buffer, void *store_ptr, int *error);
-int mbr_reson7kr_rd_roll(int verbose, char *buffer, void *store_ptr, int *error);
-int mbr_reson7kr_rd_pitch(int verbose, char *buffer, void *store_ptr, int *error);
-int mbr_reson7kr_rd_soundvelocity(int verbose, char *buffer, void *store_ptr, int *error);
-int mbr_reson7kr_rd_absorptionloss(int verbose, char *buffer, void *store_ptr, int *error);
-int mbr_reson7kr_rd_spreadingloss(int verbose, char *buffer, void *store_ptr, int *error);
-
-int mbr_reson7kr_wr_data(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_reson7kr_wr_header(int verbose, char *buffer, int *index, s7k_header *header, int *error);
-
-int mbr_reson7kr_wr_reference(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error);
-int mbr_reson7kr_wr_sensoruncal(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error);
-int mbr_reson7kr_wr_sensorcal(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error);
-int mbr_reson7kr_wr_position(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error);
-int mbr_reson7kr_wr_customattitude(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error);
-int mbr_reson7kr_wr_tide(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error);
-int mbr_reson7kr_wr_altitude(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error);
-int mbr_reson7kr_wr_motion(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error);
-int mbr_reson7kr_wr_depth(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error);
-int mbr_reson7kr_wr_svp(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error);
-int mbr_reson7kr_wr_ctd(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error);
-int mbr_reson7kr_wr_geodesy(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error);
-int mbr_reson7kr_wr_rollpitchheave(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error);
-int mbr_reson7kr_wr_heading(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error);
-int mbr_reson7kr_wr_surveyline(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error);
-int mbr_reson7kr_wr_navigation(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error);
-int mbr_reson7kr_wr_attitude(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error);
-int mbr_reson7kr_wr_rec1022(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error);
-int mbr_reson7kr_wr_fsdwchannel(int verbose, int data_format, char *buffer, int *index, s7k_fsdwchannel *fsdwchannel, int *error);
-int mbr_reson7kr_wr_fsdwssheader(int verbose, char *buffer, int *index, s7k_fsdwssheader *fsdwssheader, int *error);
-int mbr_reson7kr_wr_fsdwsegyheader(int verbose, char *buffer, int *index, s7k_fsdwsegyheader *fsdwsegyheader, int *error);
-int mbr_reson7kr_wr_fsdwsslo(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error);
-int mbr_reson7kr_wr_fsdwsshi(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error);
-int mbr_reson7kr_wr_fsdwsb(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error);
-int mbr_reson7kr_wr_bluefin(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error);
-int mbr_reson7kr_wr_processedsidescan(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error);
-int mbr_reson7kr_wr_volatilesonarsettings(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error);
-int mbr_reson7kr_wr_configuration(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error);
-int mbr_reson7kr_wr_matchfilter(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error);
-int mbr_reson7kr_wr_v2firmwarehardwareconfiguration(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error);
-int mbr_reson7kr_wr_beamgeometry(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error);
-int mbr_reson7kr_wr_calibration(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error);
-int mbr_reson7kr_wr_bathymetry(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error);
-int mbr_reson7kr_wr_backscatter(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error);
-int mbr_reson7kr_wr_beam(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error);
-int mbr_reson7kr_wr_verticaldepth(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error);
-int mbr_reson7kr_wr_tvg(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error);
-int mbr_reson7kr_wr_image(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error);
-int mbr_reson7kr_wr_v2pingmotion(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error);
-int mbr_reson7kr_wr_v2detectionsetup(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error);
-int mbr_reson7kr_wr_v2beamformed(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error);
-int mbr_reson7kr_wr_v2bite(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error);
-int mbr_reson7kr_wr_v27kcenterversion(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error);
-int mbr_reson7kr_wr_v28kwetendversion(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error);
-int mbr_reson7kr_wr_v2detection(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error);
-int mbr_reson7kr_wr_v2rawdetection(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error);
-int mbr_reson7kr_wr_v2snippet(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error);
-int mbr_reson7kr_wr_calibratedsnippet(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error);
-int mbr_reson7kr_wr_installation(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error);
-int mbr_reson7kr_wr_systemeventmessage(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error);
-int mbr_reson7kr_wr_fileheader(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error);
-int mbr_reson7kr_wr_remotecontrolsettings(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error);
-int mbr_reson7kr_wr_reserved(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error);
-int mbr_reson7kr_wr_roll(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error);
-int mbr_reson7kr_wr_pitch(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error);
-int mbr_reson7kr_wr_soundvelocity(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error);
-int mbr_reson7kr_wr_absorptionloss(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error);
-int mbr_reson7kr_wr_spreadingloss(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error);
-
-static char rcs_id[]="$Id: mbr_reson7kr.c 2225 2015-02-05 07:31:48Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mbr_register_reson7kr(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_register_reson7kr";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* get mb_io_ptr */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set format info parameters */
-	status = mbr_info_reson7kr(verbose,
-			&mb_io_ptr->system,
-			&mb_io_ptr->beams_bath_max,
-			&mb_io_ptr->beams_amp_max,
-			&mb_io_ptr->pixels_ss_max,
-			mb_io_ptr->format_name,
-			mb_io_ptr->system_name,
-			mb_io_ptr->format_description,
-			&mb_io_ptr->numfile,
-			&mb_io_ptr->filetype,
-			&mb_io_ptr->variable_beams,
-			&mb_io_ptr->traveltime,
-			&mb_io_ptr->beam_flagging,
-			&mb_io_ptr->nav_source,
-			&mb_io_ptr->heading_source,
-			&mb_io_ptr->vru_source,
-			&mb_io_ptr->svp_source,
-			&mb_io_ptr->beamwidth_xtrack,
-			&mb_io_ptr->beamwidth_ltrack,
-			error);
-
-	/* set format and system specific function pointers */
-	mb_io_ptr->mb_io_format_alloc = &mbr_alm_reson7kr;
-	mb_io_ptr->mb_io_format_free = &mbr_dem_reson7kr;
-	mb_io_ptr->mb_io_store_alloc = &mbsys_reson7k_alloc;
-	mb_io_ptr->mb_io_store_free = &mbsys_reson7k_deall;
-	mb_io_ptr->mb_io_read_ping = &mbr_rt_reson7kr;
-	mb_io_ptr->mb_io_write_ping = &mbr_wt_reson7kr;
-	mb_io_ptr->mb_io_dimensions = &mbsys_reson7k_dimensions;
-	mb_io_ptr->mb_io_pingnumber = &mbsys_reson7k_pingnumber;
-	mb_io_ptr->mb_io_sonartype = &mbsys_reson7k_sonartype;
-	mb_io_ptr->mb_io_sidescantype = &mbsys_reson7k_sidescantype;
-	mb_io_ptr->mb_io_extract = &mbsys_reson7k_extract;
-	mb_io_ptr->mb_io_insert = &mbsys_reson7k_insert;
-	mb_io_ptr->mb_io_extract_nav = &mbsys_reson7k_extract_nav;
-	mb_io_ptr->mb_io_extract_nnav = &mbsys_reson7k_extract_nnav;
-	mb_io_ptr->mb_io_insert_nav = &mbsys_reson7k_insert_nav;
-	mb_io_ptr->mb_io_extract_altitude = &mbsys_reson7k_extract_altitude;
-	mb_io_ptr->mb_io_insert_altitude = NULL;
-	mb_io_ptr->mb_io_extract_svp = &mbsys_reson7k_extract_svp;
-	mb_io_ptr->mb_io_insert_svp = &mbsys_reson7k_insert_svp;
-	mb_io_ptr->mb_io_ttimes = &mbsys_reson7k_ttimes;
-	mb_io_ptr->mb_io_detects = &mbsys_reson7k_detects;
-	mb_io_ptr->mb_io_gains = &mbsys_reson7k_gains;
-	mb_io_ptr->mb_io_copyrecord = &mbsys_reson7k_copy;
-	mb_io_ptr->mb_io_extract_rawss = NULL;
-	mb_io_ptr->mb_io_insert_rawss = NULL;
-	mb_io_ptr->mb_io_extract_segytraceheader = &mbsys_reson7k_extract_segytraceheader;
-	mb_io_ptr->mb_io_extract_segy = &mbsys_reson7k_extract_segy;
-	mb_io_ptr->mb_io_insert_segy = &mbsys_reson7k_insert_segy;
-	mb_io_ptr->mb_io_ctd = &mbsys_reson7k_ctd;
-	mb_io_ptr->mb_io_ancilliarysensor = &mbsys_reson7k_ancilliarysensor;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",mb_io_ptr->system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",mb_io_ptr->beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",mb_io_ptr->beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",mb_io_ptr->pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",mb_io_ptr->format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",mb_io_ptr->system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",mb_io_ptr->format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",mb_io_ptr->numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",mb_io_ptr->filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",mb_io_ptr->variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",mb_io_ptr->traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",mb_io_ptr->beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",mb_io_ptr->nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",mb_io_ptr->heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",mb_io_ptr->vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",mb_io_ptr->svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",mb_io_ptr->beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",mb_io_ptr->beamwidth_ltrack);
-		fprintf(stderr,"dbg2       format_alloc:       %p\n",(void *)mb_io_ptr->mb_io_format_alloc);
-		fprintf(stderr,"dbg2       format_free:        %p\n",(void *)mb_io_ptr->mb_io_format_free);
-		fprintf(stderr,"dbg2       store_alloc:        %p\n",(void *)mb_io_ptr->mb_io_store_alloc);
-		fprintf(stderr,"dbg2       store_free:         %p\n",(void *)mb_io_ptr->mb_io_store_free);
-		fprintf(stderr,"dbg2       read_ping:          %p\n",(void *)mb_io_ptr->mb_io_read_ping);
-		fprintf(stderr,"dbg2       write_ping:         %p\n",(void *)mb_io_ptr->mb_io_write_ping);
-		fprintf(stderr,"dbg2       extract:            %p\n",(void *)mb_io_ptr->mb_io_extract);
-		fprintf(stderr,"dbg2       insert:             %p\n",(void *)mb_io_ptr->mb_io_insert);
-		fprintf(stderr,"dbg2       extract_nav:        %p\n",(void *)mb_io_ptr->mb_io_extract_nav);
-		fprintf(stderr,"dbg2       insert_nav:         %p\n",(void *)mb_io_ptr->mb_io_insert_nav);
-		fprintf(stderr,"dbg2       extract_altitude:   %p\n",(void *)mb_io_ptr->mb_io_extract_altitude);
-		fprintf(stderr,"dbg2       insert_altitude:    %p\n",(void *)mb_io_ptr->mb_io_insert_altitude);
-		fprintf(stderr,"dbg2       extract_svp:        %p\n",(void *)mb_io_ptr->mb_io_extract_svp);
-		fprintf(stderr,"dbg2       insert_svp:         %p\n",(void *)mb_io_ptr->mb_io_insert_svp);
-		fprintf(stderr,"dbg2       ttimes:             %p\n",(void *)mb_io_ptr->mb_io_ttimes);
-		fprintf(stderr,"dbg2       detects:            %p\n",(void *)mb_io_ptr->mb_io_detects);
-		fprintf(stderr,"dbg2       extract_rawss:      %p\n",(void *)mb_io_ptr->mb_io_extract_rawss);
-		fprintf(stderr,"dbg2       insert_rawss:       %p\n",(void *)mb_io_ptr->mb_io_insert_rawss);
-		fprintf(stderr,"dbg2       extract_segytraceheader: %p\n",(void *)mb_io_ptr->mb_io_extract_segytraceheader);
-		fprintf(stderr,"dbg2       extract_segy:       %p\n",(void *)mb_io_ptr->mb_io_extract_segy);
-		fprintf(stderr,"dbg2       insert_segy:        %p\n",(void *)mb_io_ptr->mb_io_insert_segy);
-		fprintf(stderr,"dbg2       copyrecord:         %p\n",(void *)mb_io_ptr->mb_io_copyrecord);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbr_info_reson7kr(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error)
-{
-	char	*function_name = "mbr_info_reson7kr";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* set format info parameters */
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-	*system = MB_SYS_RESON7K;
-	*beams_bath_max = MBSYS_RESON7K_MAX_BEAMS;
-	*beams_amp_max = MBSYS_RESON7K_MAX_BEAMS;
-	*pixels_ss_max = MBSYS_RESON7K_MAX_PIXELS;
-	strncpy(format_name, "RESON7KR", MB_NAME_LENGTH);
-	strncpy(system_name, "RESON7K", MB_NAME_LENGTH);
-	strncpy(format_description, "Format name:          MBF_RESON7KR\nInformal Description: Reson 7K multibeam vendor format\nAttributes:           Reson 7K series multibeam sonars, \n                      bathymetry, amplitude, three channels sidescan, and subbottom\n                      up to 254 beams, variable pixels, binary, Reson.\n", MB_DESCRIPTION_LENGTH);
-	*numfile = 1;
-	*filetype = MB_FILETYPE_SINGLE;
-	*variable_beams = MB_YES;
-	*traveltime = MB_YES;
-	*beam_flagging = MB_YES;
-	*nav_source = MB_DATA_DATA;
-	*heading_source = MB_DATA_DATA;
-	*vru_source = MB_DATA_DATA;
-	*svp_source = MB_DATA_VELOCITY_PROFILE;
-	*beamwidth_xtrack = 1.0;
-	*beamwidth_ltrack = 1.0;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",*system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",*beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",*beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",*pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",*numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",*filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",*variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",*traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",*beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",*nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",*heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",*vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",*svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",*beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",*beamwidth_ltrack);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_alm_reson7kr(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_alm_reson7kr";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	int	*current_ping;
-	int	*last_ping;
-	int	*save_flag;
-	int	*recordid;
-	int	*recordidlast;
-	char	**bufferptr;
-	char	*buffer;
-	int	*bufferalloc;
-	char	**buffersaveptr;
-	char	*buffersave;
-	int	*size;
-	int	*nbadrec;
-	int	*deviceid;
-	unsigned short	*enumerator;
-	int	*fileheaders;
-	double	*pixel_size;
-	double	*swath_width;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set initial status */
-	status = MB_SUCCESS;
-
-	/* allocate memory for data structure */
-	mb_io_ptr->structure_size = 0;
-	mb_io_ptr->data_structure_size = 0;
-	status = mbsys_reson7k_alloc(
-			verbose,mbio_ptr,
-			&mb_io_ptr->store_data,error);
-	save_flag = (int *) &mb_io_ptr->save_flag;
-	current_ping = (int *) &mb_io_ptr->save14;
-	last_ping = (int *) &mb_io_ptr->save1;
-	recordid = (int *) &mb_io_ptr->save3;
-	recordidlast = (int *) &mb_io_ptr->save4;
-	bufferptr = (char **) &mb_io_ptr->saveptr1;
-	buffer = (char *) *bufferptr;
-	bufferalloc = (int *) &mb_io_ptr->save6;
-	buffersaveptr = (char **) &mb_io_ptr->saveptr2;
-	buffersave = (char *) *buffersaveptr;
-	size = (int *) &mb_io_ptr->save8;
-	nbadrec = (int *) &mb_io_ptr->save9;
-	deviceid = (int *) &mb_io_ptr->save10;
-	enumerator = (unsigned short *) &mb_io_ptr->save11;
-	fileheaders = (int *) &mb_io_ptr->save12;
-	pixel_size = (double *) &mb_io_ptr->saved1;
-	swath_width = (double *) &mb_io_ptr->saved2;
-
-	*current_ping = -1;
-	*last_ping = -1;
-	*save_flag = MB_NO;
-	*recordid = R7KRECID_None;
-	*recordidlast = R7KRECID_None;
-	*bufferptr = NULL;
-	*bufferalloc = 0;
-	*size = 0;
-	*nbadrec = 0;
-	*deviceid = 0;
-	*enumerator = 0;
-	*fileheaders = 0;
-	*pixel_size = 0.0;
-	*swath_width = 0.0;
-
-	/* allocate memory if necessary */
-	if (status == MB_SUCCESS)
-		{
-		status = mb_reallocd(verbose, __FILE__, __LINE__, MBSYS_RESON7K_BUFFER_STARTSIZE,
-					(void **)bufferptr, error);
-		if (status == MB_SUCCESS)
-		status = mb_reallocd(verbose, __FILE__, __LINE__, MBSYS_RESON7K_BUFFER_STARTSIZE,
-					(void **)buffersaveptr, error);
-		if (status == MB_SUCCESS)
-			*bufferalloc = MBSYS_RESON7K_BUFFER_STARTSIZE;
-		}
-
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_dem_reson7kr(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_dem_reson7kr";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	char	**bufferptr;
-	char	*buffer;
-	int	*bufferalloc;
-	char	**buffersaveptr;
-	char	*buffersave;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointers to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* deallocate memory for data descriptor */
-	status = mbsys_reson7k_deall(
-			verbose,mbio_ptr,
-			&mb_io_ptr->store_data,error);
-
-	/* deallocate memory for reading/writing buffer */
-	bufferptr = (char **) &mb_io_ptr->saveptr1;
-	buffer = (char *) *bufferptr;
-	bufferalloc = (int *) &mb_io_ptr->save6;
-	buffersaveptr = (char **) &mb_io_ptr->saveptr2;
-	buffersave = (char *) *buffersaveptr;
-	status = mb_freed(verbose,__FILE__,__LINE__,(void **)bufferptr,error);
-	status = mb_freed(verbose,__FILE__,__LINE__,(void **)buffersaveptr,error);
-	*bufferalloc = 0;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_rt_reson7kr(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_rt_reson7kr";
-	int	status = MB_SUCCESS;
-	int	interp_status;
-	int	interp_error = MB_ERROR_NO_ERROR;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_reson7k_struct *store;
-	s7kr_position 		*position;
-	s7kr_navigation 	*navigation;
-	s7kr_attitude 		*attitude;
-	s7kr_heading 		*dheading;
-	s7kr_rollpitchheave	*rollpitchheave;
-	s7kr_customattitude	*customattitude;
-	s7kr_altitude		*altitude;
-	s7kr_depth		*depth;
-	s7kr_volatilesettings	*volatilesettings;
-	s7kr_beamgeometry	*beamgeometry;
-	s7kr_bathymetry		*bathymetry;
-	s7kr_backscatter	*backscatter;
-	s7kr_beam		*beam;
-	s7kr_image		*image;
-	s7kr_v2detection	*v2detection;
-	s7kr_v2detectionsetup	*v2detectionsetup;
-	s7kr_v2rawdetection	*v2rawdetection;
-	s7kr_bluefin		*bluefin;
-	s7kr_processedsidescan  *processedsidescan;
-	int	*current_ping;
-	int	ss_source;
-	double	speed, heading, longitude, latitude;
-	double	roll, pitch, heave;
-	double	sonar_depth, sonar_altitude;
-	double	soundspeed, alpha, beta, theta, phi;
-	double	rr, xx, zz;
-	double	*pixel_size, *swath_width;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointers to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* read next data from file */
-	status = mbr_reson7kr_rd_data(verbose,mbio_ptr,store_ptr,error);
-
-	/* get pointers to data structures */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	position = &store->position;
-	attitude = &store->attitude;
-	volatilesettings = &store->volatilesettings;
-	beamgeometry = &store->beamgeometry;
-	bathymetry = &store->bathymetry;
-	backscatter = &store->backscatter;
-	beam = &store->beam;
-	image = &store->image;
-	v2detectionsetup = &store->v2detectionsetup;
-	v2detection = &store->v2detection;
-	v2rawdetection = &store->v2rawdetection;
-	bluefin = &store->bluefin;
-	processedsidescan = &store->processedsidescan;
-	current_ping = (int *) &mb_io_ptr->save14;
-	pixel_size = (double *) &mb_io_ptr->saved1;
-	swath_width = (double *) &mb_io_ptr->saved2;
-
-	/* throw away multibeam data if the time stamp makes no sense */
-	if (status == MB_SUCCESS
-		&& store->kind == MB_DATA_DATA
-		&& store->time_i[0] < 2004)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_UNINTELLIGIBLE;
-		}
-
-	/* save fix if nav data */
-	if (status == MB_SUCCESS
-		&& store->kind == MB_DATA_NAV1)
-		{
-		/* add latest fix */
-		position = &(store->position);
-		mb_navint_add(verbose, mbio_ptr,
-				store->time_d,
-				(double)(RTD * position->longitude),
-				(double)(RTD * position->latitude),
-				error);
-		}
-
-	/* save nav and attitude if bluefin data */
-	if (status == MB_SUCCESS
-		&& store->kind == MB_DATA_NAV2)
-		{
-		/* add latest fix */
-		bluefin = &(store->bluefin);
-		for (i=0;i<bluefin->number_frames;i++)
-			{
-/* if (bluefin->nav[i].timedelay != 0)
-fprintf(stderr,"NAV TIME DIFF: %f %d\n", bluefin->nav[i].position_time,bluefin->nav[i].timedelay);*/
-			mb_navint_add(verbose, mbio_ptr,
-					(double)(bluefin->nav[i].position_time),
-					(double)(RTD * bluefin->nav[i].longitude),
-					(double)(RTD * bluefin->nav[i].latitude),
-					error);
-			mb_attint_add(verbose, mbio_ptr,
-					(double)(bluefin->nav[i].position_time),
-					(double)(0.0),
-					(double)(RTD * bluefin->nav[i].roll),
-					(double)(RTD * bluefin->nav[i].pitch),
-					error);
-			mb_hedint_add(verbose, mbio_ptr,
-					(double)(bluefin->nav[i].position_time),
-					(double)(RTD * bluefin->nav[i].yaw),
-					error);
-			if (mb_io_ptr->nsonardepth == 0
-				|| (bluefin->nav[i].depth
-					!= mb_io_ptr->sonardepth_sonardepth[mb_io_ptr->nsonardepth-1]))
-				{
-				if (bluefin->nav[i].depth_time <= 0.0)
-					bluefin->nav[i].depth_time = bluefin->nav[i].position_time;
-				mb_depint_add(verbose, mbio_ptr,
-						(double)(bluefin->nav[i].depth_time),
-						(double)(bluefin->nav[i].depth),
-						error);
-				}
-			if (bluefin->nav[i].altitude > 0.0 && bluefin->nav[i].altitude < 250.0
-				&& (i == 0 || bluefin->nav[i].altitude != bluefin->nav[i-1].altitude))
-				{
-				mb_altint_add(verbose, mbio_ptr,
-						(double)(bluefin->nav[i].position_time),
-						(double)(bluefin->nav[i].altitude),
-						error);
-				}
-			}
-		}
-
-	/* save nav and heading if navigation data */
-	if (status == MB_SUCCESS
-		&& store->kind == MB_DATA_NAV3)
-		{
-		/* add latest fix */
-		navigation = &(store->navigation);
-		mb_navint_add(verbose, mbio_ptr,
-				store->time_d,
-				(double)(RTD * navigation->longitude),
-				(double)(RTD * navigation->latitude),
-				error);
-		mb_hedint_add(verbose, mbio_ptr,
-				store->time_d,
-				(double)(RTD * navigation->heading),
-				error);
-		}
-
-	/* save attitude if attitude record */
-	if (status == MB_SUCCESS
-		&& store->kind == MB_DATA_ATTITUDE
-		&& store->type == R7KRECID_Attitude)
-		{
-		/* get attitude structure */
-		attitude = &(store->attitude);
-
-		/* add latest attitude samples */
-		for (i=0;i<attitude->n;i++)
-			{
-			mb_attint_add(verbose, mbio_ptr,
-				(double)(store->time_d + 0.001 * ((double)attitude->delta_time[i])),
-				(double)(attitude->heave[i]),
-				(double)(RTD * attitude->roll[i]),
-				(double)(RTD * attitude->pitch[i]),
-				error);
-			mb_hedint_add(verbose, mbio_ptr,
-				(double)(store->time_d + 0.001 * ((double)attitude->delta_time[i])),
-				(double)(RTD * attitude->heading[i]),
-				error);
-			}
-		}
-
-	/* else save attitude if rollpitchheave record */
-	else if (status == MB_SUCCESS
-		&& store->kind == MB_DATA_ATTITUDE
-		&& store->type == R7KRECID_RollPitchHeave)
-		{
-		/* get attitude structure */
-		rollpitchheave = &(store->rollpitchheave);
-
-		/* add latest attitude samples */
-		mb_attint_add(verbose, mbio_ptr,
-				(double)(store->time_d),
-				(double)(rollpitchheave->heave),
-				(double)(RTD * rollpitchheave->roll),
-				(double)(RTD * rollpitchheave->pitch),
-				error);
-		}
-
-	/* else save attitude if customattitude record */
-	else if (status == MB_SUCCESS
-		&& store->kind == MB_DATA_ATTITUDE
-		&& store->type == R7KRECID_CustomAttitude)
-		{
-		/* get attitude structure */
-		customattitude = &(store->customattitude);
-
-		/* add latest attitude samples */
-		for (i=0;i<customattitude->n;i++)
-			{
-			mb_attint_add(verbose, mbio_ptr,
-				(double)(store->time_d + ((double)i) / ((double)customattitude->frequency)),
-				(double)(customattitude->heave[i]),
-				(double)(RTD * customattitude->roll[i]),
-				(double)(RTD * customattitude->pitch[i]),
-				error);
-			mb_hedint_add(verbose, mbio_ptr,
-				(double)(store->time_d + ((double)i) / ((double)customattitude->frequency)),
-				(double)(RTD * customattitude->heading[i]),
-				error);
-			}
-		}
-
-	/* save heading if heading record */
-	if (status == MB_SUCCESS
-		&& store->kind == MB_DATA_HEADING
-		&& store->type == R7KRECID_Heading)
-		{
-		/* get attitude structure */
-		dheading = &(store->heading);
-
-		/* add latest heading sample */
-		mb_hedint_add(verbose, mbio_ptr,
-				(double)(store->time_d),
-				(double)(RTD * dheading->heading),
-				error);
-		}
-
-	/* save altitude if altitude record */
-	if (status == MB_SUCCESS
-		&& store->kind == MB_DATA_HEIGHT
-		&& store->type == R7KRECID_Altitude)
-		{
-		/* get attitude structure */
-		altitude = &(store->altitude);
-
-		/* add latest altitude sample */
-		mb_altint_add(verbose, mbio_ptr,
-				(double)(store->time_d),
-				(double)(altitude->altitude),
-				error);
-		}
-
-	/* save sonardepth if depth record */
-	if (status == MB_SUCCESS
-		&& store->kind == MB_DATA_HEIGHT
-		&& store->type == R7KRECID_Depth)
-		{
-		/* get attitude structure */
-		depth = &(store->depth);
-
-		/* add latest depth sample if sensor depth, not water depth */
-		if (depth->descriptor == 0 && depth->depth != 0.0)
-			mb_depint_add(verbose, mbio_ptr,
-					(double)(store->time_d),
-					(double)(depth->depth),
-					error);
-		}
-
-#ifdef MBR_RESON7KR_DEBUG
-if (verbose > 0)
-fprintf(stderr,"Record returned: type:%d status:%d error:%d\n\n",store->kind, status, *error);
-#endif
-
-	/* kluge to reset quality flags */
-/*	if (status == MB_SUCCESS
-		&& store->kind == MB_DATA_DATA
-		&& bathymetry->header.Version < 5)
-		{
-		for (i=0;i<bathymetry->number_beams;i++)
-			{
-			if ((bathymetry->quality[i] & 15) < 2)
-				{
-				if (bathymetry->range[i] > 0.007)
-					{
-					bathymetry->quality[i] = (bathymetry->quality[i] & 240) + 15;
-					}
-				else
-					{
-					bathymetry->quality[i] = (bathymetry->quality[i] & 240) + 3;
-					}
-				}
-			}
-		}
-*/
-
-	/* calculate bathymetry if only raw detects are available */
-	if (status == MB_SUCCESS
-		&& store->kind == MB_DATA_DATA
-		&& store->read_bathymetry == MB_NO
-		&& store->read_v2rawdetection == MB_YES)
-		{
-		bathymetry->header = v2rawdetection->header;
-		bathymetry->header.RecordType = R7KRECID_7kBathymetricData;
-		bathymetry->serial_number = v2rawdetection->serial_number;
-		bathymetry->ping_number = v2rawdetection->ping_number;
-		bathymetry->multi_ping = v2rawdetection->multi_ping;
-		bathymetry->number_beams = v2rawdetection->number_beams;
-		bathymetry->layer_comp_flag = 0;
-		bathymetry->sound_vel_flag = 0;
-		if (volatilesettings->sound_velocity > 0.0)
-			bathymetry->sound_velocity = volatilesettings->sound_velocity;
-		else if (bluefin->environmental[0].sound_speed > 0.0)
-			bathymetry->sound_velocity = bluefin->environmental[0].sound_speed;
-		else
-			bathymetry->sound_velocity = 1500.0;
-		bathymetry->optionaldata = MB_NO;
-		store->read_bathymetry = MB_YES;
-		}
-
-	/* else calculate bathymetry if only detects are available */
-	else if (status == MB_SUCCESS
-		&& store->kind == MB_DATA_DATA
-		&& store->read_bathymetry == MB_NO
-		&& store->read_v2detection == MB_YES)
-		{
-		bathymetry->header = v2detection->header;
-		bathymetry->header.RecordType = R7KRECID_7kBathymetricData;
-		bathymetry->serial_number = v2detection->serial_number;
-		bathymetry->ping_number = v2detection->ping_number;
-		bathymetry->multi_ping = v2detection->multi_ping;
-		bathymetry->number_beams = v2detection->number_beams;
-		bathymetry->layer_comp_flag = 0;
-		bathymetry->sound_vel_flag = 0;
-		if (volatilesettings->sound_velocity > 0.0)
-			bathymetry->sound_velocity = volatilesettings->sound_velocity;
-		else if (bluefin->environmental[0].sound_speed > 0.0)
-			bathymetry->sound_velocity = bluefin->environmental[0].sound_speed;
-		else
-			bathymetry->sound_velocity = 1500.0;
-		bathymetry->optionaldata = MB_NO;
-		store->read_bathymetry = MB_YES;
-		}
-
-	/* get optional values in bathymetry record if needed */
-	if (status == MB_SUCCESS
-		&& store->kind == MB_DATA_DATA
-		&& bathymetry->optionaldata == MB_NO)
-		{
-		/* get navigation */
-		speed = 0.0;
-		longitude = 0.0;
-		latitude = 0.0;
-		heading = 0.0;
-		sonar_depth = 0.0;
-		interp_status = mb_hedint_interp(verbose, mbio_ptr, store->time_d,
-				    &heading, &interp_error);
-		if (interp_status == MB_SUCCESS)
-			interp_status = mb_navint_interp(verbose, mbio_ptr, store->time_d, heading, speed,
-				    &longitude, &latitude, &speed, &interp_error);
-		if (interp_status == MB_SUCCESS)
-			interp_status = mb_depint_interp(verbose, mbio_ptr, store->time_d,
-				    &sonar_depth, &interp_error);
-
-		/* if the optional data are not all available, this ping
-			is not useful. Just use null values here and catch
-			this condition with mb7kpreprocess */
-		/* if (interp_status == MB_FAILURE)
-			{
-			longitude = 0.0;
-			latitude = 0.0;
-			heading = 0.0;
-			sonar_depth = 0.0;
-			} */
-
-		/* get altitude */
-		interp_status = mb_altint_interp(verbose, mbio_ptr, store->time_d,
-				    &sonar_altitude, &interp_error);
-		if (interp_status == MB_FAILURE)
-			{
-			/* set altitude data to zero */
-			sonar_altitude = 0.0;
-			}
-
-		/* get attitude */
-		interp_status = mb_attint_interp(verbose, mbio_ptr, store->time_d,
-				    &heave, &roll, &pitch, &interp_error);
-		if (interp_status == MB_FAILURE)
-			{
-			/* set nav & attitude data to zero */
-			roll = 0.0;
-			pitch = 0.0;
-			heave = 0.0;
-			}
-
-		/* calculate the optional values in the bathymetry record */
-		bathymetry->longitude = DTR * longitude;
-		bathymetry->latitude = DTR * latitude;
-		bathymetry->heading = DTR * heading;
-		bathymetry->height_source = 1;
-		bathymetry->tide = 0.0;
-		bathymetry->roll = DTR * roll;
-		bathymetry->pitch = DTR * pitch;
-		bathymetry->heave = heave;
-		bathymetry->vehicle_height = -sonar_depth;
-
-		/* get ready to calculate bathymetry */
-		if (volatilesettings->sound_velocity > 0.0)
-			soundspeed = volatilesettings->sound_velocity;
-		else if (bluefin->environmental[0].sound_speed > 0.0)
-			soundspeed = bluefin->environmental[0].sound_speed;
-		else
-			soundspeed = 1500.0;
-
-		/* loop over detections as available - the 7k format has used several
-		   different records over the years, so there are several different
-		   cases that must be handled */
-
-		/* case of v2rawdetection record */
-		if (store->read_v2rawdetection == MB_YES)
-			{
-			/* initialize all of the beams */
-			for (i=0;i<bathymetry->number_beams;i++)
-				{
-				bathymetry->quality[i] = 0;
-				bathymetry->depth[i] = 0.0;
-				bathymetry->acrosstrack[i] = 0.0;
-				bathymetry->alongtrack[i] = 0.0;
-				bathymetry->pointing_angle[i] = 0.0;
-				bathymetry->azimuth_angle[i] = 0.0;
-				}
-
-			/* now loop over the detects */
-			for (j=0;j<v2rawdetection->number_beams;j++)
-				{
-				i = v2rawdetection->beam_descriptor[j];
-				bathymetry->range[i] = v2rawdetection->detection_point[j]
-							/ v2rawdetection->sampling_rate;
-				bathymetry->quality[i] = v2rawdetection->quality[j];
-				alpha = RTD * (bathymetry->pitch + v2rawdetection->tx_angle);
-				beta = 90.0 - RTD * (v2rawdetection->rx_angle[j] - bathymetry->roll);
-				mb_rollpitch_to_takeoff(
-					verbose,
-					alpha, beta,
-					&theta, &phi,
-					error);
-				rr = 0.5 * soundspeed * bathymetry->range[i];
-				xx = rr * sin(DTR * theta);
-				zz = rr * cos(DTR * theta);
-				bathymetry->acrosstrack[i] = xx * cos(DTR * phi);
-				bathymetry->alongtrack[i] = xx * sin(DTR * phi);
-				bathymetry->depth[i] = zz + sonar_depth - heave;
-				bathymetry->pointing_angle[i] = DTR * theta;
-				bathymetry->azimuth_angle[i] = DTR * phi;
-/*fprintf(stderr,"j:%d i:%d quality:%d roll:%f %f pitch:%f %f alpha:%f beta:%f theta:%f phi:%f  depth:%f %f %f\n",
-j, i, bathymetry->quality[i], roll, bathymetry->roll,pitch, bathymetry->pitch,
-alpha,beta,theta,phi,
-bathymetry->depth[i],bathymetry->acrosstrack[i],bathymetry->alongtrack[i]);*/
-				}
-			}
-
-		/* case of v2detection record with v2detectionsetup */
-		else if (store->read_v2detection == MB_YES && store->read_v2detectionsetup == MB_YES)
-			{
-			/* now loop over the detects */
-			for (j=0;j<v2detection->number_beams;j++)
-				{
-				i = v2detectionsetup->beam_descriptor[j];
-
-				bathymetry->range[i] = v2detection->range[j];
-				alpha = RTD * (v2detection->angle_y[j] + bathymetry->pitch
-						+ volatilesettings->steering_vertical);
-				beta = 90.0 - RTD * (v2detection->angle_x[j] - bathymetry->roll);
-				mb_rollpitch_to_takeoff(
-					verbose,
-					alpha, beta,
-					&theta, &phi,
-					error);
-				rr = 0.5 * soundspeed * bathymetry->range[i];
-				xx = rr * sin(DTR * theta);
-				zz = rr * cos(DTR * theta);
-				bathymetry->acrosstrack[i] = xx * cos(DTR * phi);
-				bathymetry->alongtrack[i] = xx * sin(DTR * phi);
-				bathymetry->depth[i] = zz + sonar_depth - heave;
-				bathymetry->pointing_angle[i] = DTR * theta;
-				bathymetry->azimuth_angle[i] = DTR * phi;
-/* fprintf(stderr,"i:%d roll:%f %f pitch:%f %f alpha:%f beta:%f theta:%f phi:%f  depth:%f %f %f\n",
-i,roll, bathymetry->roll,pitch, bathymetry->pitch,
-alpha,beta,theta,phi,
-bathymetry->depth[i],bathymetry->acrosstrack[i],bathymetry->alongtrack[i]); */
-				}
-			}
-
-		/* case of v2detection record alone */
-		else if (store->read_v2detection == MB_YES)
-			{
-			/* now loop over the detects */
-			for (j=0;j<v2detection->number_beams;j++)
-				{
-				i = j;
-
-				bathymetry->range[i] = v2detection->range[j];
-				alpha = RTD * (v2detection->angle_y[j] + bathymetry->pitch
-						+ volatilesettings->steering_vertical);
-				beta = 90.0 - RTD * (v2detection->angle_x[j] - bathymetry->roll);
-				mb_rollpitch_to_takeoff(
-					verbose,
-					alpha, beta,
-					&theta, &phi,
-					error);
-				rr = 0.5 * soundspeed * bathymetry->range[i];
-				xx = rr * sin(DTR * theta);
-				zz = rr * cos(DTR * theta);
-				bathymetry->acrosstrack[i] = xx * cos(DTR * phi);
-				bathymetry->alongtrack[i] = xx * sin(DTR * phi);
-				bathymetry->depth[i] = zz + sonar_depth - heave;
-				bathymetry->pointing_angle[i] = DTR * theta;
-				bathymetry->azimuth_angle[i] = DTR * phi;
-/* fprintf(stderr,"i:%d roll:%f %f pitch:%f %f alpha:%f beta:%f theta:%f phi:%f  depth:%f %f %f\n",
-i,roll, bathymetry->roll,pitch, bathymetry->pitch,
-alpha,beta,theta,phi,
-bathymetry->depth[i],bathymetry->acrosstrack[i],bathymetry->alongtrack[i]); */
-				}
-			}
-
-		/* else default case of beamgeometry record */
-		else
-			{
-			/* loop over all beams */
-			for (i=0;i<bathymetry->number_beams;i++)
-				{
-				if ((bathymetry->quality[i] & 15) > 0)
-					{
-					alpha = RTD * (beamgeometry->angle_alongtrack[i] + bathymetry->pitch
-						       + volatilesettings->steering_vertical);
-					beta = 90.0 - RTD * (beamgeometry->angle_acrosstrack[i] - bathymetry->roll);
-					mb_rollpitch_to_takeoff(
-						verbose,
-						alpha, beta,
-						&theta, &phi,
-						error);
-					rr = 0.5 * soundspeed * bathymetry->range[i];
-					xx = rr * sin(DTR * theta);
-					zz = rr * cos(DTR * theta);
-					bathymetry->acrosstrack[i] = xx * cos(DTR * phi);
-					bathymetry->alongtrack[i] = xx * sin(DTR * phi);
-					bathymetry->depth[i] = zz + sonar_depth - heave;
-					bathymetry->pointing_angle[i] = DTR * theta;
-					bathymetry->azimuth_angle[i] = DTR * phi;
-/* fprintf(stderr,"i:%d roll:%f %f pitch:%f %f alpha:%f beta:%f theta:%f phi:%f  depth:%f %f %f\n",
-i,roll, bathymetry->roll,pitch, bathymetry->pitch,
-alpha,beta,theta,phi,
-bathymetry->depth[i],bathymetry->acrosstrack[i],bathymetry->alongtrack[i]); */
-					}
-				else
-					{
-					bathymetry->quality[i] = 0;
-					bathymetry->depth[i] = 0.0;
-					bathymetry->acrosstrack[i] = 0.0;
-					bathymetry->alongtrack[i] = 0.0;
-					bathymetry->pointing_angle[i] = 0.0;
-					bathymetry->azimuth_angle[i] = 0.0;
-					}
-				}
-			}
-
-		/* set flag */
-		bathymetry->optionaldata = MB_YES;
-		bathymetry->header.OffsetToOptionalData
-				= MBSYS_RESON7K_RECORDHEADER_SIZE
-					+ R7KHDRSIZE_7kBathymetricData
-					+ bathymetry->number_beams * 9;
-
-/* mbsys_reson7k_print_bathymetry(verbose, bathymetry, error);*/
-		}
-
-	/* generate processed sidescan if needed */
-	if (status == MB_SUCCESS
-		&& store->kind == MB_DATA_DATA
-		&& store->read_bathymetry == MB_YES
-		&& store->read_processedsidescan == MB_NO)
-		{
-		/* set source of processed sidescan to be best available data */
-		if (store->read_calibratedsnippet == MB_YES)
-			ss_source = R7KRECID_7kCalibratedSnippetData;
-		else if (store->read_v2snippet == MB_YES)
-			ss_source = R7KRECID_7kV2SnippetData;
-		else if (store->read_beam == MB_YES)
-			ss_source = R7KRECID_7kBeamData;
-		else if (store->read_backscatter == MB_YES)
-			ss_source = R7KRECID_7kBackscatterImageData;
-		else
-			ss_source = 0;
-		status = mbsys_reson7k_makess(verbose, mbio_ptr, store_ptr,
-						ss_source, MB_NO, pixel_size,
-						MB_NO, swath_width,
-						MB_YES, error);
-		}
-
-	/* set error and kind in mb_io_ptr */
-	mb_io_ptr->new_error = *error;
-	mb_io_ptr->new_kind = store->kind;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_wt_reson7kr(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_wt_reson7kr";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_reson7k_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-
-	/* write next data to file */
-	status = mbr_reson7kr_wr_data(verbose,mbio_ptr,store_ptr,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_rd_data(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_reson7kr_rd_data";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_reson7k_struct *store;
-	s7k_header *header;
-	s7kr_fsdwss *fsdwsslo;
-	s7kr_fsdwss *fsdwsshi;
-	s7kr_fsdwsb *fsdwsb;
-	s7k_fsdwssheader *fsdwssheader;
-	s7k_fsdwsegyheader *fsdwsegyheader;
-	s7kr_bathymetry *bathymetry;
-	s7kr_backscatter	*backscatter;
-	s7kr_beam		*beam;
-	s7kr_image		*image;
-	s7kr_beamgeometry	*beamgeometry;
-	s7kr_v2detection	*v2detection;
-	s7kr_v2rawdetection	*v2rawdetection;
-	double	*edgetech_time_d;
-	double	*edgetech_dt;
-	double	*last_7k_time_d;
-	FILE	*mbfp;
-	size_t	read_len;
-	int	done;
-	int	*current_ping;
-	int	*last_ping;
-	int	*new_ping;
-	int	*save_flag;
-	int	*recordid;
-	int	*recordidlast;
-	int	*deviceid;
-	unsigned short	*enumerator;
-	int	*fileheaders;
-	char	**bufferptr;
-	char	*buffer;
-	int	*bufferalloc;
-	char	**buffersaveptr;
-	char	*buffersave;
-	int	*size;
-	int	*nbadrec;
-	int	skip;
-	int	ping_record;
-	int	time_j[5], time_i[7];
-	double	time_d;
-	int	nscan;
-	int	version_major, version_minor, version_svn;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	mbfp = mb_io_ptr->mbfp;
-
-	/* get saved values */
-	save_flag = (int *) &mb_io_ptr->save_flag;
-	current_ping = (int *) &mb_io_ptr->save14;
-	last_ping = (int *) &mb_io_ptr->save1;
-	new_ping = (int *) &mb_io_ptr->save2;
-	recordid = (int *) &mb_io_ptr->save3;
-	recordidlast = (int *) &mb_io_ptr->save4;
-	bufferptr = (char **) &mb_io_ptr->saveptr1;
-	buffer = (char *) *bufferptr;
-	bufferalloc = (int *) &mb_io_ptr->save6;
-	buffersaveptr = (char **) &mb_io_ptr->saveptr2;
-	buffersave = (char *) *buffersaveptr;
-	size = (int *) &mb_io_ptr->save8;
-	nbadrec = (int *) &mb_io_ptr->save9;
-	deviceid = (int *) &mb_io_ptr->save10;
-	enumerator = (unsigned short *) &mb_io_ptr->save11;
-	fileheaders = (int *) &mb_io_ptr->save12;
-	edgetech_time_d = (double *) &mb_io_ptr->saved3;
-	edgetech_dt = (double *) &mb_io_ptr->saved4;
-	last_7k_time_d = (double *) &mb_io_ptr->saved5;
-
-	/* set file position */
-	mb_io_ptr->file_pos = mb_io_ptr->file_bytes;
-
-	/* loop over reading data until a record is ready for return */
-	done = MB_NO;
-	*error = MB_ERROR_NO_ERROR;
-	while (done == MB_NO)
-		{
-		/* if no header saved get next record label */
-		if (*save_flag == MB_NO)
-			{
-			/* read next record header into buffer */
-			read_len = (size_t)MBSYS_RESON7K_VERSIONSYNCSIZE;
-			status = mb_fileio_get(verbose, mbio_ptr, buffer, &read_len, error);
-
-			/* check header - if not a good header read a byte
-				at a time until a good header is found */
-			skip = 0;
-			while (status == MB_SUCCESS
-				&& mbr_reson7kr_chk_header(verbose, mbio_ptr, buffer,
-				recordid, deviceid, enumerator, size) != MB_SUCCESS)
-			    {
-			    /* get next byte */
-			    for (i=0;i<MBSYS_RESON7K_VERSIONSYNCSIZE-1;i++)
-				buffer[i] = buffer[i+1];
-			    read_len = (size_t)1;
-			    status = mb_fileio_get(verbose, mbio_ptr, &buffer[MBSYS_RESON7K_VERSIONSYNCSIZE-1],
-					       &read_len, error);
-			    skip++;
-			    }
-
-			/* report problem */
-			if (skip > 0 && verbose >= 0)
-			    {
-			    if (*nbadrec == 0)
-			    	fprintf(stderr,
-"\nThe MBF_RESON7KR module skipped data between identified\n\
-data records. Something is broken, most probably the data...\n\
-However, the data may include a data record type that we\n\
-haven't seen yet, or there could be an error in the code.\n\
-If skipped data are reported multiple times, \n\
-we recommend you send a data sample and problem \n\
-description to the MB-System team \n\
-(caress at mbari.org and dale at ldeo.columbia.edu)\n\
-Have a nice day...\n");
-				fprintf(stderr,
-						"MBF_RESON7KR skipped %d bytes between records %4.4X:%d and %4.4X:%d\n",
-						skip, *recordidlast, *recordidlast, *recordid, *recordid);
-				(*nbadrec)++;
-			    }
-			*recordidlast = *recordid;
-			store->type = *recordid;
-
-			/* allocate memory to read rest of record if necessary */
-			if (*bufferalloc < *size)
-				{
-				status = mb_reallocd(verbose, __FILE__, __LINE__, *size,
-							(void **)bufferptr, error);
-				if (status == MB_SUCCESS)
-				status = mb_reallocd(verbose, __FILE__, __LINE__, *size,
-							(void **)buffersaveptr, error);
-				if (status != MB_SUCCESS)
-					{
-					*bufferalloc = 0;
-					done = MB_YES;
-					}
-				else
-					{
-					*bufferalloc = *size;
-					buffer = (char *) *bufferptr;
-					buffersave = (char *) *buffersaveptr;
-					}
-				}
-
-			/* read the rest of the record */
-			if (status == MB_SUCCESS)
-				{
-				read_len = (size_t)(*size - MBSYS_RESON7K_VERSIONSYNCSIZE);
-				status = mb_fileio_get(verbose, mbio_ptr, &buffer[MBSYS_RESON7K_VERSIONSYNCSIZE],
-					       &read_len, error);
-				}
-
-#ifndef MBR_RESON7KR_DEBUG
-if (skip > 0)
-fprintf(stderr,"RESON7KR record:skip:%d recordid:%x %d deviceid:%x %d enumerator:%x %d size:%d done:%d\n",
-skip, *recordid, *recordid,
-*deviceid, *deviceid,
-*enumerator, *enumerator,
-*size, done);
-#endif
-			}
-
-		/* else use saved record */
-		else
-			{
-			*save_flag = MB_NO;
-			mbr_reson7kr_chk_header(verbose, mbio_ptr, buffersave,
-						recordid, deviceid, enumerator, size);
-			for (i=0;i<*size;i++)
-				buffer[i] = buffersave[i];
-			}
-
-
-		/* check for ping record and ping number */
-		ping_record = MB_NO;
-		if (status == MB_SUCCESS)
-			{
-			if (*recordid == R7KRECID_7kVolatileSonarSettings
-				|| *recordid == R7KRECID_7kMatchFilter
-				|| *recordid == R7KRECID_7kBeamGeometry
-				|| *recordid == R7KRECID_7kRemoteControlSonarSettings
-				|| *recordid == R7KRECID_7kBathymetricData
-				|| *recordid == R7KRECID_ProcessedSidescan
-				|| *recordid == R7KRECID_7kBackscatterImageData
-				|| *recordid == R7KRECID_7kBeamData
-				|| *recordid == R7KRECID_7kVerticalDepth
-				|| *recordid == R7KRECID_7kTVGData
-				|| *recordid == R7KRECID_7kImageData
-				|| *recordid == R7KRECID_7kV2PingMotion
-				|| *recordid == R7KRECID_7kV2DetectionSetup
-				|| *recordid == R7KRECID_7kV2BeamformedData
-				|| *recordid == R7KRECID_7kV2Detection
-				|| *recordid == R7KRECID_7kV2RawDetection
-				|| *recordid == R7KRECID_7kV2SnippetData
-				|| *recordid == R7KRECID_7kCalibratedSnippetData)
-				{
-				/* check for ping number */
-				ping_record = MB_YES;
-				mbr_reson7kr_chk_pingnumber(verbose, *recordid, buffer, new_ping);
-#ifdef MBR_RESON7KR_DEBUG
-fprintf(stderr,"called mbr_reson7kr_chk_pingnumber recordid:%d last_ping:%d new_ping:%d\n",
-*recordid,*last_ping,*new_ping);
-fprintf(stderr,"current ping:%d records read: %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d\n",
-	store->current_ping_number,
-	store->read_volatilesettings,
-	store->read_matchfilter,
-	store->read_beamgeometry,
-	store->read_remotecontrolsettings,
-	store->read_bathymetry,
-	store->read_backscatter,
-	store->read_beam,
-	store->read_verticaldepth,
-	store->read_tvg,
-	store->read_image,
-	store->read_v2pingmotion,
-	store->read_v2detectionsetup,
-	store->read_v2beamformed,
-	store->read_v2detection,
-	store->read_v2rawdetection,
-	store->read_v2snippet,
-	store->read_processedsidescan);
-#endif
-
-				/* fix lack of ping number for backscatter and beam geometry records */
-				if (*recordid == R7KRECID_7kBackscatterImageData
-					&& *new_ping <= 0)
-					*new_ping = *last_ping;
-				else if (*recordid == R7KRECID_7kBeamGeometry
-					&& *new_ping <= 0)
-					*new_ping = *last_ping;
-
-				/* determine if record is continuation of the last ping
-					or a new ping - if new ping and last ping not yet
-					output then save the new record and output the
-					last ping as fully read */
-				if (*last_ping >= 0
-					&& *new_ping >= 0
-					&& *last_ping != *new_ping)
-					{
-					/* good ping if bathymetry record is read */
-					if (store->read_bathymetry == MB_YES)
-						{
-						done = MB_YES;
-						store->kind = MB_DATA_DATA;
-						*save_flag = MB_YES;
-						*current_ping = *last_ping;
-						*last_ping = -1;
-						for (i=0;i<*size;i++)
-							buffersave[i] = buffer[i];
-
-						/* get the time */
-						bathymetry = &(store->bathymetry);
-						header = &(bathymetry->header);
-						time_j[0] = header->s7kTime.Year;
-						time_j[1] = header->s7kTime.Day;
-						time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-						time_j[3] = (int) header->s7kTime.Seconds;
-						time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-						mb_get_itime(verbose, time_j, store->time_i);
-						mb_get_time(verbose, store->time_i, &(store->time_d));
-						}
-
-					/* good ping if at least the detects are available */
-					else if (store->read_v2detection == MB_YES)
-						{
-						done = MB_YES;
-						store->kind = MB_DATA_DATA;
-						*save_flag = MB_YES;
-						*current_ping = *last_ping;
-						*last_ping = -1;
-						for (i=0;i<*size;i++)
-							buffersave[i] = buffer[i];
-
-						/* get the time */
-						v2detection = &(store->v2detection);
-						header = &(v2detection->header);
-						time_j[0] = header->s7kTime.Year;
-						time_j[1] = header->s7kTime.Day;
-						time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-						time_j[3] = (int) header->s7kTime.Seconds;
-						time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-						mb_get_itime(verbose, time_j, store->time_i);
-						mb_get_time(verbose, store->time_i, &(store->time_d));
-
-						}
-
-					/* good ping if at least the raw detects are available */
-					else if (store->read_v2rawdetection == MB_YES)
-						{
-						done = MB_YES;
-						store->kind = MB_DATA_DATA;
-						*save_flag = MB_YES;
-						*current_ping = *last_ping;
-						*last_ping = -1;
-						for (i=0;i<*size;i++)
-							buffersave[i] = buffer[i];
-
-						/* get the time */
-						v2rawdetection = &(store->v2rawdetection);
-						header = &(v2rawdetection->header);
-						time_j[0] = header->s7kTime.Year;
-						time_j[1] = header->s7kTime.Day;
-						time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-						time_j[3] = (int) header->s7kTime.Seconds;
-						time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-						mb_get_itime(verbose, time_j, store->time_i);
-						mb_get_time(verbose, store->time_i, &(store->time_d));
-						}
-
-					/* not a complete record unless there is bathymetry, drop the partial ping */
-					else
-						{
-						done = MB_NO;
-						*last_ping = -1;
-						*last_ping = *new_ping;
-						*save_flag = MB_NO;
-						}
-
-					}
-				else if (*last_ping >= 0
-					&& *new_ping >= 0
-					&& *last_ping == *new_ping)
-					{
-					done = MB_NO;
-					}
-				else if (*last_ping == -1
-					&& *new_ping >= 0)
-					{
-					done = MB_NO;
-					*current_ping = -1;
-					*last_ping = *new_ping;
-					store->read_volatilesettings = MB_NO;
-					store->read_matchfilter = MB_NO;
-					store->read_beamgeometry = MB_NO;
-					store->read_bathymetry = MB_NO;
-					store->read_remotecontrolsettings = MB_NO;
-					store->read_backscatter = MB_NO;
-					store->read_beam = MB_NO;
-					store->read_verticaldepth = MB_NO;
-					store->read_tvg = MB_NO;
-					store->read_image = MB_NO;
-					store->read_v2pingmotion = MB_NO;
-					store->read_v2detectionsetup = MB_NO;
-					store->read_v2beamformed = MB_NO;
-					store->read_v2detection = MB_NO;
-					store->read_v2rawdetection = MB_NO;
-					store->read_v2snippet = MB_NO;
-					store->read_calibratedsnippet = MB_NO;
-					store->read_processedsidescan = MB_NO;
-					}
-				}
-			}
-/* fprintf(stderr,"ping_record:%d last_ping:%d new_ping:%d current_ping:%d done:%d status:%d error:%d\n",
-ping_record,*last_ping,*new_ping,*current_ping,done,status,*error); */
-
-		/* check for ping data already read in read error case */
-		if (status == MB_FAILURE && *last_ping >= 0)
-			{
-			status = MB_SUCCESS;
-			*error = MB_ERROR_NO_ERROR;
-			done = MB_YES;
-			*save_flag = MB_NO;
-			*last_ping = -1;
-			store->kind = MB_DATA_DATA;
-			store->time_d = *last_7k_time_d;
-			mb_get_date(verbose, store->time_d, store->time_i);
-			}
-
-#ifdef MBR_RESON7KR_DEBUG
-if (status == MB_SUCCESS && done == MB_NO && *save_flag == MB_NO)
-{
-fprintf(stderr, "Reading record id: %4.4X  %4.4d | %4.4X  %4.4d | %4.4hX  %4.4d |",
-*recordid, *recordid, *deviceid, *deviceid, *enumerator, *enumerator);
-if (*recordid == R7KRECID_ReferencePoint) fprintf(stderr," R7KRECID_ReferencePoint %d\n",*recordid);
-if (*recordid == R7KRECID_UncalibratedSensorOffset) fprintf(stderr," R7KRECID_UncalibratedSensorOffset %d\n",*recordid);
-if (*recordid == R7KRECID_CalibratedSensorOffset) fprintf(stderr," R7KRECID_CalibratedSensorOffset %d\n",*recordid);
-if (*recordid == R7KRECID_Position) fprintf(stderr," R7KRECID_Position %d\n",*recordid);
-if (*recordid == R7KRECID_CustomAttitude) fprintf(stderr," R7KRECID_CustomAttitude %d\n",*recordid);
-if (*recordid == R7KRECID_Tide) fprintf(stderr," R7KRECID_Tide %d\n",*recordid);
-if (*recordid == R7KRECID_Altitude) fprintf(stderr," R7KRECID_Altitude %d\n",*recordid);
-if (*recordid == R7KRECID_MotionOverGround) fprintf(stderr," R7KRECID_MotionOverGround %d\n",*recordid);
-if (*recordid == R7KRECID_Depth) fprintf(stderr," R7KRECID_Depth %d\n",*recordid);
-if (*recordid == R7KRECID_SoundVelocityProfile) fprintf(stderr," R7KRECID_SoundVelocityProfile %d\n",*recordid);
-if (*recordid == R7KRECID_CTD) fprintf(stderr," R7KRECID_CTD %d\n",*recordid);
-if (*recordid == R7KRECID_Geodesy) fprintf(stderr," R7KRECID_Geodesy %d\n",*recordid);
-if (*recordid == R7KRECID_RollPitchHeave) fprintf(stderr," R7KRECID_RollPitchHeave %d\n",*recordid);
-if (*recordid == R7KRECID_Heading) fprintf(stderr," R7KRECID_Heading %d\n",*recordid);
-if (*recordid == R7KRECID_SurveyLine) fprintf(stderr," R7KRECID_SurveyLine %d\n",*recordid);
-if (*recordid == R7KRECID_Navigation) fprintf(stderr," R7KRECID_Navigation %d\n",*recordid);
-if (*recordid == R7KRECID_Attitude) fprintf(stderr," R7KRECID_Attitude %d\n",*recordid);
-if (*recordid == R7KRECID_Rec1022) fprintf(stderr," R7KRECID_Rec1022 %d\n",*recordid);
-if (*recordid == R7KRECID_GenericSensorCalibration) fprintf(stderr," R7KRECID_GenericSensorCalibration %d\n",*recordid);
-if (*recordid == R7KRECID_GenericSidescan) fprintf(stderr," R7KRECID_GenericSidescan %d\n",*recordid);
-if (*recordid == R7KRECID_FSDWsidescan) fprintf(stderr," R7KRECID_FSDWsidescan %d\n",*recordid);
-if (*recordid == R7KRECID_FSDWsubbottom) fprintf(stderr," R7KRECID_FSDWsubbottom %d\n",*recordid);
-if (*recordid == R7KRECID_Bluefin) fprintf(stderr," R7KRECID_Bluefin %d\n",*recordid);
-if (*recordid == R7KRECID_ProcessedSidescan) fprintf(stderr," R7KRECID_ProcessedSidescan %d\n",*recordid);
-if (*recordid == R7KRECID_7kVolatileSonarSettings) fprintf(stderr," R7KRECID_7kVolatileSonarSettings %d\n",*recordid);
-if (*recordid == R7KRECID_7kConfiguration) fprintf(stderr," R7KRECID_7kConfiguration %d\n",*recordid);
-if (*recordid == R7KRECID_7kMatchFilter) fprintf(stderr," R7KRECID_7kMatchFilter %d\n",*recordid);
-if (*recordid == R7KRECID_7kV2FirmwareHardwareConfiguration) fprintf(stderr," R7KRECID_7kV2FirmwareHardwareConfiguration %d\n",*recordid);
-if (*recordid == R7KRECID_7kBeamGeometry) fprintf(stderr," R7KRECID_7kBeamGeometry %d\n",*recordid);
-if (*recordid == R7KRECID_7kCalibrationData) fprintf(stderr," R7KRECID_7kCalibrationData %d\n",*recordid);
-if (*recordid == R7KRECID_7kBathymetricData) fprintf(stderr," R7KRECID_7kBathymetricData %d\n",*recordid);
-if (*recordid == R7KRECID_7kBackscatterImageData) fprintf(stderr," R7KRECID_7kBackscatterImageData %d\n",*recordid);
-if (*recordid == R7KRECID_7kBeamData) fprintf(stderr," R7KRECID_7kBeamData %d\n",*recordid);
-if (*recordid == R7KRECID_7kVerticalDepth) fprintf(stderr," R7KRECID_7kVerticalDepth %d\n",*recordid);
-if (*recordid == R7KRECID_7kTVGData) fprintf(stderr," R7KRECID_7kTVGData %d\n",*recordid);
-if (*recordid == R7KRECID_7kImageData) fprintf(stderr," R7KRECID_7kImageData %d\n",*recordid);
-if (*recordid == R7KRECID_7kV2PingMotion) fprintf(stderr," R7KRECID_7kV2PingMotion %d\n",*recordid);
-if (*recordid == R7KRECID_7kV2DetectionSetup) fprintf(stderr," R7KRECID_7kV2DetectionSetup %d\n",*recordid);
-if (*recordid == R7KRECID_7kV2BeamformedData) fprintf(stderr," R7KRECID_7kV2BeamformedData %d\n",*recordid);
-if (*recordid == R7KRECID_7kV2BITEData) fprintf(stderr," R7KRECID_7kV2BITEData %d\n",*recordid);
-if (*recordid == R7KRECID_7kV27kCenterVersion) fprintf(stderr," R7KRECID_7kV27kCenterVersion %d\n",*recordid);
-if (*recordid == R7KRECID_7kV28kWetEndVersion) fprintf(stderr," R7KRECID_7kV28kWetEndVersion %d\n",*recordid);
-if (*recordid == R7KRECID_7kV2Detection) fprintf(stderr," R7KRECID_7kV2Detection %d\n",*recordid);
-if (*recordid == R7KRECID_7kV2RawDetection) fprintf(stderr," R7KRECID_7kV2RawDetection %d\n",*recordid);
-if (*recordid == R7KRECID_7kV2SnippetData) fprintf(stderr," R7KRECID_7kV2SnippetData %d\n",*recordid);
-if (*recordid == R7KRECID_7kCalibrationData) fprintf(stderr, " R7KRECID_7kCalibratedSnippetData %d\n", *recordid);
-if (*recordid == R7KRECID_7kInstallationParameters) fprintf(stderr," R7KRECID_7kInstallationParameters %d\n",*recordid);
-if (*recordid == R7KRECID_7kSystemEventMessage) fprintf(stderr,"R7KRECID_7kSystemEventMessage %d\n",*recordid);
-if (*recordid == R7KRECID_7kDataStorageStatus) fprintf(stderr," R7KRECID_7kDataStorageStatus %d\n",*recordid);
-if (*recordid == R7KRECID_7kFileHeader) fprintf(stderr," R7KRECID_7kFileHeader %d\n",*recordid);
-if (*recordid == R7KRECID_7kTrigger) fprintf(stderr," R7KRECID_7kTrigger %d\n",*recordid);
-if (*recordid == R7KRECID_7kTriggerSequenceSetup) fprintf(stderr," R7KRECID_7kTriggerSequenceSetup %d\n",*recordid);
-if (*recordid == R7KRECID_7kTriggerSequenceDone) fprintf(stderr," R7KRECID_7kTriggerSequenceDone %d\n",*recordid);
-if (*recordid == R7KRECID_7kTimeMessage) fprintf(stderr," R7KRECID_7kTimeMessage %d\n",*recordid);
-if (*recordid == R7KRECID_7kRemoteControl) fprintf(stderr," R7KRECID_7kRemoteControl %d\n",*recordid);
-if (*recordid == R7KRECID_7kRemoteControlAcknowledge) fprintf(stderr," R7KRECID_7kRemoteControlAcknowledge %d\n",*recordid);
-if (*recordid == R7KRECID_7kRemoteControlNotAcknowledge) fprintf(stderr," R7KRECID_7kRemoteControlNotAcknowledge %d\n",*recordid);
-if (*recordid == R7KRECID_7kRemoteControlSonarSettings) fprintf(stderr," R7KRECID_7kRemoteControlSonarSettings %d\n",*recordid);
-if (*recordid == R7KRECID_7kReserved) fprintf(stderr," R7KRECID_7kReserved %d\n",*recordid);
-if (*recordid == R7KRECID_7kRoll) fprintf(stderr," R7KRECID_7kRoll %d\n",*recordid);
-if (*recordid == R7KRECID_7kPitch) fprintf(stderr," R7KRECID_7kPitch %d\n",*recordid);
-if (*recordid == R7KRECID_7kSoundVelocity) fprintf(stderr," R7KRECID_7kSoundVelocity %d\n",*recordid);
-if (*recordid == R7KRECID_7kAbsorptionLoss) fprintf(stderr," R7KRECID_7kAbsorptionLoss %d\n",*recordid);
-if (*recordid == R7KRECID_7kSpreadingLoss) fprintf(stderr," R7KRECID_7kSpreadingLoss %d\n",*recordid);
-if (*recordid == R7KRECID_8100SonarData) fprintf(stderr," R7KRECID_8100SonarData %d\n",*recordid);
-}
-#endif
-
-		/* set done if read failure */
-		if (status == MB_FAILURE)
-			{
-#ifdef MBR_RESON7KR_DEBUG
-	fprintf(stderr,"call nothing, read failure\n");
-#endif
-			done = MB_YES;
-			}
-
-		/* if needed parse the data record */
-		if (status == MB_SUCCESS && done == MB_NO)
-			{
-			if (*recordid == R7KRECID_7kFileHeader)
-				{
-				status = mbr_reson7kr_rd_fileheader(verbose, buffer, store_ptr, error);
-				(*fileheaders)++;
-				done = MB_YES;
-
-/* kluge to set bogus background navigation */
-/*klugelon = -121.0;
-klugelat = 36.0;
-mb_navint_add(verbose, mbio_ptr,
-		store->time_d,
-		klugelon,
-		klugelat,
-		error);
-klugelon = -121.0;
-klugelat = 37.168;
-mb_navint_add(verbose, mbio_ptr,
-		store->time_d + 86400.0,
-		klugelon,
-		klugelat,
-		error);*/
-				}
-			else if (*recordid == R7KRECID_ReferencePoint)
-				{
-				status = mbr_reson7kr_rd_reference(verbose, buffer, store_ptr, error);
-				if (status == MB_SUCCESS)
-					done = MB_YES;
-				}
-			else if (*recordid == R7KRECID_UncalibratedSensorOffset)
-				{
-				status = mbr_reson7kr_rd_sensoruncal(verbose, buffer, store_ptr, error);
-				if (status == MB_SUCCESS)
-					done = MB_YES;
-				}
-			else if (*recordid == R7KRECID_CalibratedSensorOffset)
-				{
-				status = mbr_reson7kr_rd_sensorcal(verbose, buffer, store_ptr, error);
-				if (status == MB_SUCCESS)
-					done = MB_YES;
-				}
-			else if (*recordid == R7KRECID_Position)
-				{
-				status = mbr_reson7kr_rd_position(verbose, buffer, store_ptr, error);
-				if (status == MB_SUCCESS)
-					done = MB_YES;
-				}
-			else if (*recordid == R7KRECID_CustomAttitude)
-				{
-				status = mbr_reson7kr_rd_customattitude(verbose, buffer, store_ptr, error);
-				if (status == MB_SUCCESS)
-					done = MB_YES;
-				}
-			else if (*recordid == R7KRECID_Tide)
-				{
-				status = mbr_reson7kr_rd_tide(verbose, buffer, store_ptr, error);
-				if (status == MB_SUCCESS)
-					done = MB_YES;
-				}
-			else if (*recordid == R7KRECID_Altitude)
-				{
-				status = mbr_reson7kr_rd_altitude(verbose, buffer, store_ptr, error);
-				if (status == MB_SUCCESS)
-					done = MB_YES;
-				}
-			else if (*recordid == R7KRECID_MotionOverGround)
-				{
-				status = mbr_reson7kr_rd_motion(verbose, buffer, store_ptr, error);
-				if (status == MB_SUCCESS)
-					done = MB_YES;
-				}
-			else if (*recordid == R7KRECID_Depth)
-				{
-				status = mbr_reson7kr_rd_depth(verbose, buffer, store_ptr, error);
-				if (status == MB_SUCCESS)
-					done = MB_YES;
-				}
-			else if (*recordid == R7KRECID_SoundVelocityProfile)
-				{
-				status = mbr_reson7kr_rd_svp(verbose, buffer, store_ptr, error);
-				if (status == MB_SUCCESS)
-					done = MB_YES;
-				}
-			else if (*recordid == R7KRECID_CTD)
-				{
-				status = mbr_reson7kr_rd_ctd(verbose, buffer, store_ptr, error);
-				if (status == MB_SUCCESS)
-					done = MB_YES;
-				}
-			else if (*recordid == R7KRECID_Geodesy)
-				{
-				status = mbr_reson7kr_rd_geodesy(verbose, buffer, store_ptr, error);
-				if (status == MB_SUCCESS)
-					done = MB_YES;
-				}
-			else if (*recordid == R7KRECID_RollPitchHeave)
-				{
-				status = mbr_reson7kr_rd_rollpitchheave(verbose, buffer, store_ptr, error);
-				if (status == MB_SUCCESS)
-					done = MB_YES;
-				}
-			else if (*recordid == R7KRECID_Heading)
-				{
-				status = mbr_reson7kr_rd_heading(verbose, buffer, store_ptr, error);
-				if (status == MB_SUCCESS)
-					done = MB_YES;
-				}
-			else if (*recordid == R7KRECID_SurveyLine)
-				{
-				status = mbr_reson7kr_rd_surveyline(verbose, buffer, store_ptr, error);
-				if (status == MB_SUCCESS)
-					done = MB_YES;
-				}
-			else if (*recordid == R7KRECID_Navigation)
-				{
-				status = mbr_reson7kr_rd_navigation(verbose, buffer, store_ptr, error);
-				if (status == MB_SUCCESS)
-					done = MB_YES;
-				}
-			else if (*recordid == R7KRECID_Attitude)
-				{
-				status = mbr_reson7kr_rd_attitude(verbose, buffer, store_ptr, error);
-				if (status == MB_SUCCESS)
-					done = MB_YES;
-				}
-			else if (*recordid == R7KRECID_Rec1022)
-				{
-				status = mbr_reson7kr_rd_rec1022(verbose, buffer, store_ptr, error);
-				if (status == MB_SUCCESS)
-					done = MB_YES;
-				}
-			else if (*recordid == R7KRECID_FSDWsidescan
-				&& *deviceid == R7KDEVID_EdgetechFSDW
-				&& *enumerator == 20)
-				{
-				status = mbr_reson7kr_rd_fsdwsslo(verbose, buffer, store_ptr, error);
-				if (status == MB_SUCCESS)
-					{
-					done = MB_YES;
-
-					/* store the Edgetech timestamp for possible use in fixing 7k time */
-					fsdwsslo = &(store->fsdwsslo);
-					header = &(fsdwsslo->header);
-					fsdwssheader = &(fsdwsslo->ssheader[0]);
-					time_j[0] = fsdwssheader->year;
-					time_j[1] = fsdwssheader->day;
-					time_j[2] = 60 * fsdwssheader->hour + fsdwssheader->minute;
-					time_j[3] = fsdwssheader->second;
-					time_j[4] = 1000 * (fsdwssheader->millisecondsToday
-								- 1000 * ((int)(0.001 * fsdwssheader->millisecondsToday)));
-					mb_get_itime(verbose, time_j, time_i);
-					mb_get_time(verbose, time_i, &time_d);
-					if (*edgetech_time_d > 0.0 && time_d - *edgetech_time_d > 0.002)
-						*edgetech_dt = time_d - *edgetech_time_d;
-					*edgetech_time_d = time_d;
-#ifdef MBR_RESON7KR_DEBUG
-fprintf(stderr,"mbr_reson7kr_rd_fsdwsslo: EDGETECH TIME: %f %f\n", *edgetech_time_d, *edgetech_dt);
-#endif
-					}
-				}
-			else if (*recordid == R7KRECID_FSDWsidescan
-				&& *deviceid == R7KDEVID_EdgetechFSDWSSLF)
-				{
-				status = mbr_reson7kr_rd_fsdwsslo(verbose, buffer, store_ptr, error);
-				if (status == MB_SUCCESS)
-					{
-					done = MB_YES;
-
-					/* store the Edgetech timestamp for possible use in fixing 7k time */
-					fsdwsslo = &(store->fsdwsslo);
-					header = &(fsdwsslo->header);
-					fsdwssheader = &(fsdwsslo->ssheader[0]);
-					time_j[0] = fsdwssheader->year;
-					time_j[1] = fsdwssheader->day;
-					time_j[2] = 60 * fsdwssheader->hour + fsdwssheader->minute;
-					time_j[3] = fsdwssheader->second;
-					time_j[4] = 1000 * (fsdwssheader->millisecondsToday
-								- 1000 * ((int)(0.001 * fsdwssheader->millisecondsToday)));
-					mb_get_itime(verbose, time_j, time_i);
-					mb_get_time(verbose, time_i, &time_d);
-					if (*edgetech_time_d > 0.0 && time_d - *edgetech_time_d > 0.002)
-						*edgetech_dt = time_d - *edgetech_time_d;
-					*edgetech_time_d = time_d;
-#ifdef MBR_RESON7KR_DEBUG
-fprintf(stderr,"mbr_reson7kr_rd_fsdwsslo: EDGETECH TIME: %f %f\n", *edgetech_time_d, *edgetech_dt);
-#endif
-					}
-				}
-			else if (*recordid == R7KRECID_FSDWsidescan
-				&& *deviceid == R7KDEVID_EdgetechFSDW
-				&& *enumerator == 21)
-				{
-				status = mbr_reson7kr_rd_fsdwsshi(verbose, buffer, store_ptr, error);
-				if (status == MB_SUCCESS)
-					{
-					done = MB_YES;
-
-					/* store the Edgetech timestamp for possible use in fixing 7k time */
-					fsdwsshi = &(store->fsdwsshi);
-					header = &(fsdwsshi->header);
-					fsdwssheader = &(fsdwsshi->ssheader[0]);
-					time_j[0] = fsdwssheader->year;
-					time_j[1] = fsdwssheader->day;
-					time_j[2] = 60 * fsdwssheader->hour + fsdwssheader->minute;
-					time_j[3] = fsdwssheader->second;
-					time_j[4] = 1000 * (fsdwssheader->millisecondsToday
-								- 1000 * ((int)(0.001 * fsdwssheader->millisecondsToday)));
-					mb_get_itime(verbose, time_j, time_i);
-					mb_get_time(verbose, time_i, &time_d);
-					if (*edgetech_time_d > 0.0 && time_d - *edgetech_time_d > 0.002)
-						*edgetech_dt = time_d - *edgetech_time_d;
-					*edgetech_time_d = time_d;
-#ifdef MBR_RESON7KR_DEBUG
-fprintf(stderr,"mbr_reson7kr_rd_fsdwsshi: EDGETECH TIME: %f %f\n", *edgetech_time_d, *edgetech_dt);
-#endif
-					}
-				}
-			else if (*recordid == R7KRECID_FSDWsidescan
-				&& *deviceid == R7KDEVID_EdgetechFSDWSSHF)
-				{
-				status = mbr_reson7kr_rd_fsdwsshi(verbose, buffer, store_ptr, error);
-				if (status == MB_SUCCESS)
-					{
-					done = MB_YES;
-
-					/* store the Edgetech timestamp for possible use in fixing 7k time */
-					fsdwsshi = &(store->fsdwsshi);
-					header = &(fsdwsshi->header);
-					fsdwssheader = &(fsdwsshi->ssheader[0]);
-					time_j[0] = fsdwssheader->year;
-					time_j[1] = fsdwssheader->day;
-					time_j[2] = 60 * fsdwssheader->hour + fsdwssheader->minute;
-					time_j[3] = fsdwssheader->second;
-					time_j[4] = 1000 * (fsdwssheader->millisecondsToday
-								- 1000 * ((int)(0.001 * fsdwssheader->millisecondsToday)));
-					mb_get_itime(verbose, time_j, time_i);
-					mb_get_time(verbose, time_i, &time_d);
-					if (*edgetech_time_d > 0.0 && time_d - *edgetech_time_d > 0.002)
-						*edgetech_dt = time_d - *edgetech_time_d;
-					*edgetech_time_d = time_d;
-#ifdef MBR_RESON7KR_DEBUG
-fprintf(stderr,"mbr_reson7kr_rd_fsdwsshi: EDGETECH TIME: %f %f\n", *edgetech_time_d, *edgetech_dt);
-#endif
-					}
-				}
-			else if (*recordid == R7KRECID_FSDWsubbottom)
-				{
-				status = mbr_reson7kr_rd_fsdwsb(verbose, buffer, store_ptr, error);
-				if (status == MB_SUCCESS)
-					{
-					done = MB_YES;
-
-					/* store the Edgetech timestamp for possible use in fixing 7k time */
-					fsdwsb = &(store->fsdwsb);
-					header = &(fsdwsb->header);
-					fsdwsegyheader = &(fsdwsb->segyheader);
-					time_j[0] = fsdwsegyheader->year;
-					time_j[1] = fsdwsegyheader->day;
-					time_j[2] = 60 * fsdwsegyheader->hour + fsdwsegyheader->minute;
-					time_j[3] = fsdwsegyheader->second;
-					time_j[4] = 1000 * (fsdwsegyheader->millisecondsToday
-								- 1000 * ((int)(0.001 * fsdwsegyheader->millisecondsToday)));
-					mb_get_itime(verbose, time_j, time_i);
-					mb_get_time(verbose, time_i, &time_d);
-					if (*edgetech_time_d > 0.0 && time_d - *edgetech_time_d > 0.002)
-						*edgetech_dt = time_d - *edgetech_time_d;
-					*edgetech_time_d = time_d;
-#ifdef MBR_RESON7KR_DEBUG
-fprintf(stderr,"mbr_reson7kr_rd_fsdwsb:    EDGETECH TIME: %f %f\n", *edgetech_time_d, *edgetech_dt);
-#endif
-					}
-				}
-			else if (*recordid == R7KRECID_Bluefin)
-				{
-				status = mbr_reson7kr_rd_bluefin(verbose, buffer, store_ptr, error);
-				if (status == MB_SUCCESS)
-					done = MB_YES;
-				}
-			else if (*recordid == R7KRECID_ProcessedSidescan)
-				{
-				status = mbr_reson7kr_rd_processedsidescan(verbose, buffer, store_ptr, error);
-				if (status == MB_SUCCESS)
-					store->read_processedsidescan = MB_YES;
-				}
-			else if (*recordid == R7KRECID_7kVolatileSonarSettings)
-				{
-				status = mbr_reson7kr_rd_volatilesonarsettings(verbose, buffer, store_ptr, error);
-				if (status == MB_SUCCESS)
-					store->read_volatilesettings = MB_YES;
-				}
-			else if (*recordid == R7KRECID_7kConfiguration)
-				{
-				status = mbr_reson7kr_rd_configuration(verbose, buffer, store_ptr, error);
-				if (status == MB_SUCCESS)
-					done = MB_YES;
-				}
-			else if (*recordid == R7KRECID_7kMatchFilter)
-				{
-				status = mbr_reson7kr_rd_matchfilter(verbose, buffer, store_ptr, error);
-				if (status == MB_SUCCESS)
-					store->read_matchfilter = MB_YES;
-				}
-			else if (*recordid == R7KRECID_7kV2FirmwareHardwareConfiguration)
-				{
-				status = mbr_reson7kr_rd_v2firmwarehardwareconfiguration(verbose, buffer, store_ptr, error);
-				if (status == MB_SUCCESS)
-					done = MB_YES;
-				}
-			else if (*recordid == R7KRECID_7kBeamGeometry)
-				{
-				status = mbr_reson7kr_rd_beamgeometry(verbose, buffer, store_ptr, error);
-				if (status == MB_SUCCESS)
-					{
-					store->read_beamgeometry = MB_YES;
-					done = MB_NO;
-
-					/* set beam widths */
-					beamgeometry = &(store->beamgeometry);
-					mb_io_ptr->beamwidth_xtrack = RTD * beamgeometry->beamwidth_acrosstrack[beamgeometry->number_beams/2];
-					mb_io_ptr->beamwidth_ltrack = RTD * beamgeometry->beamwidth_alongtrack[beamgeometry->number_beams/2];
-					}
-				}
-			else if (*recordid == R7KRECID_7kCalibrationData)
-				{
-				status = mbr_reson7kr_rd_calibration(verbose, buffer, store_ptr, error);
-				if (status == MB_SUCCESS)
-					done = MB_YES;
-				}
-			else if (*recordid == R7KRECID_7kBathymetricData)
-				{
-				status = mbr_reson7kr_rd_bathymetry(verbose, buffer, store_ptr, error);
-				if (status == MB_SUCCESS)
-					{
-					store->read_bathymetry = MB_YES;
-
-					/* if needed use most recent Edgetech timestamp to fix 7k time */
-					bathymetry = &(store->bathymetry);
-					header = &(bathymetry->header);
-					*last_7k_time_d = store->time_d;
-					if (header->s7kTime.Year < 2004
-						&& *edgetech_time_d > 0.0
-						&& *edgetech_dt > 0.0
-						&& *edgetech_dt < 2.0)
-						{
-						if (*edgetech_time_d + *edgetech_dt > *last_7k_time_d + 0.002)
-							{
-							store->time_d = *edgetech_time_d + *edgetech_dt;
-							}
-						else
-							{
-							store->time_d = *edgetech_time_d + 2 * (*edgetech_dt);
-							}
-						mb_get_date(verbose, store->time_d, store->time_i);
-						mb_get_jtime(verbose, store->time_i, time_j);
-						header->s7kTime.Year = store->time_i[0];
-						header->s7kTime.Day = time_j[1];
-						header->s7kTime.Hours = store->time_i[3];
-						header->s7kTime.Minutes = store->time_i[4];
-						header->s7kTime.Seconds = store->time_i[5] + 0.000001 * store->time_i[6];
-#ifdef MBR_RESON7KR_DEBUG
-fprintf(stderr,"TIME CORRECTION: R7KRECID_7kBathymetricData:        7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d ping:%d\n",
-store->time_i[0],store->time_i[1],store->time_i[2],
-store->time_i[3],store->time_i[4],store->time_i[5],store->time_i[6],
-header->RecordNumber,bathymetry->ping_number);
-#endif
-						}
-					}
-
-/*mbsys_reson7k_print_bathymetry(verbose, &(store->bathymetry), error);*/
-
-				}
-			else if (*recordid == R7KRECID_7kBackscatterImageData)
-				{
-				status = mbr_reson7kr_rd_backscatter(verbose, buffer, store_ptr, error);
-				if (status == MB_SUCCESS)
-					{
-					store->read_backscatter = MB_YES;
-
-					/* if needed use most recent Edgetech timestamp to fix 7k time */
-					backscatter = &(store->backscatter);
-					header = &(backscatter->header);
-					*last_7k_time_d = store->time_d;
-					if (header->s7kTime.Year < 2004
-						&& *edgetech_time_d > 0.0
-						&& *edgetech_dt > 0.0
-						&& *edgetech_dt < 2.0)
-						{
-						if (*edgetech_time_d + *edgetech_dt > *last_7k_time_d + 0.002)
-							{
-							store->time_d = *edgetech_time_d + *edgetech_dt;
-							}
-						else
-							{
-							store->time_d = *edgetech_time_d + 2 * (*edgetech_dt);
-							}
-						mb_get_date(verbose, store->time_d, store->time_i);
-						mb_get_jtime(verbose, store->time_i, time_j);
-						header->s7kTime.Year = store->time_i[0];
-						header->s7kTime.Day = time_j[1];
-						header->s7kTime.Hours = store->time_i[3];
-						header->s7kTime.Minutes = store->time_i[4];
-						header->s7kTime.Seconds = store->time_i[5] + 0.000001 * store->time_i[6];
-#ifdef MBR_RESON7KR_DEBUG
-fprintf(stderr,"TIME CORRECTION: R7KRECID_7kBackscatterImageData:   7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d ping:%d\n",
-store->time_i[0],store->time_i[1],store->time_i[2],
-store->time_i[3],store->time_i[4],store->time_i[5],store->time_i[6],
-header->RecordNumber,backscatter->ping_number);
-#endif
-						}
-					}
-				}
-			else if (*recordid == R7KRECID_7kBeamData)
-				{
-				status = mbr_reson7kr_rd_beam(verbose, buffer, store_ptr, error);
-				if (status == MB_SUCCESS)
-					{
-					store->read_beam = MB_YES;
-
-					/* if needed use most recent Edgetech timestamp to fix 7k time */
-					beam = &(store->beam);
-					header = &(beam->header);
-					*last_7k_time_d = store->time_d;
-					if (header->s7kTime.Year < 2004
-						&& *edgetech_time_d > 0.0
-						&& *edgetech_dt > 0.0
-						&& *edgetech_dt < 2.0)
-						{
-						if (*edgetech_time_d + *edgetech_dt > *last_7k_time_d + 0.002)
-							{
-							store->time_d = *edgetech_time_d + *edgetech_dt;
-							}
-						else
-							{
-							store->time_d = *edgetech_time_d + 2 * (*edgetech_dt);
-							}
-						mb_get_date(verbose, store->time_d, store->time_i);
-						mb_get_jtime(verbose, store->time_i, time_j);
-						header->s7kTime.Year = store->time_i[0];
-						header->s7kTime.Day = time_j[1];
-						header->s7kTime.Hours = store->time_i[3];
-						header->s7kTime.Minutes = store->time_i[4];
-						header->s7kTime.Seconds = store->time_i[5] + 0.000001 * store->time_i[6];
-#ifdef MBR_RESON7KR_DEBUG
-fprintf(stderr,"TIME CORRECTION: R7KRECID_7kBeamData: 7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d ping:%d\n",
-store->time_i[0],store->time_i[1],store->time_i[2],
-store->time_i[3],store->time_i[4],store->time_i[5],store->time_i[6],
-header->RecordNumber,beam->ping_number);
-#endif
-						}
-					}
-				}
-			else if (*recordid == R7KRECID_7kVerticalDepth)
-				{
-				status = mbr_reson7kr_rd_verticaldepth(verbose, buffer, store_ptr, error);
-				if (status == MB_SUCCESS)
-					store->read_verticaldepth = MB_YES;
-				}
-			else if (*recordid == R7KRECID_7kTVGData)
-				{
-				status = mbr_reson7kr_rd_tvg(verbose, buffer, store_ptr, error);
-				if (status == MB_SUCCESS)
-					{
-					store->read_tvg = MB_YES;
-					}
-				}
-			else if (*recordid == R7KRECID_7kImageData)
-				{
-				status = mbr_reson7kr_rd_image(verbose, buffer, store_ptr, error);
-				if (status == MB_SUCCESS)
-					{
-					store->read_image = MB_YES;
-
-					/* if needed use most recent Edgetech timestamp to fix 7k time */
-					image = &(store->image);
-					header = &(image->header);
-					*last_7k_time_d = store->time_d;
-					if (header->s7kTime.Year < 2004
-						&& *edgetech_time_d > 0.0
-						&& *edgetech_dt > 0.0
-						&& *edgetech_dt < 2.0)
-						{
-						if (*edgetech_time_d + *edgetech_dt > *last_7k_time_d + 0.002)
-							{
-							store->time_d = *edgetech_time_d + *edgetech_dt;
-							}
-						else
-							{
-							store->time_d = *edgetech_time_d + 2 * (*edgetech_dt);
-							}
-						mb_get_date(verbose, store->time_d, store->time_i);
-						mb_get_jtime(verbose, store->time_i, time_j);
-						header->s7kTime.Year = store->time_i[0];
-						header->s7kTime.Day = time_j[1];
-						header->s7kTime.Hours = store->time_i[3];
-						header->s7kTime.Minutes = store->time_i[4];
-						header->s7kTime.Seconds = store->time_i[5] + 0.000001 * store->time_i[6];
-#ifdef MBR_RESON7KR_DEBUG
-fprintf(stderr,"TIME CORRECTION: R7KRECID_7kImageData:              7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d ping:%d\n",
-store->time_i[0],store->time_i[1],store->time_i[2],
-store->time_i[3],store->time_i[4],store->time_i[5],store->time_i[6],
-header->RecordNumber,image->ping_number);
-#endif
-						}
-					}
-				}
-			else if (*recordid == R7KRECID_7kV2PingMotion)
-				{
-				status = mbr_reson7kr_rd_v2pingmotion(verbose, buffer, store_ptr, error);
-				if (status == MB_SUCCESS)
-					store->read_v2pingmotion = MB_YES;
-				}
-			else if (*recordid == R7KRECID_7kV2DetectionSetup)
-				{
-				status = mbr_reson7kr_rd_v2detectionsetup(verbose, buffer, store_ptr, error);
-				if (status == MB_SUCCESS)
-					store->read_v2detectionsetup = MB_YES;
-				}
-			else if (*recordid == R7KRECID_7kV2BeamformedData)
-				{
-				status = mbr_reson7kr_rd_v2beamformed(verbose, buffer, store_ptr, error);
-				if (status == MB_SUCCESS)
-					store->read_v2beamformed = MB_YES;
-				}
-			else if (*recordid == R7KRECID_7kV2BITEData)
-				{
-				status = mbr_reson7kr_rd_v2bite(verbose, buffer, store_ptr, error);
-				if (status == MB_SUCCESS)
-					done = MB_YES;
-				}
-			else if (*recordid == R7KRECID_7kV27kCenterVersion)
-				{
-				status = mbr_reson7kr_rd_v27kcenterversion(verbose, buffer, store_ptr, error);
-				if (status == MB_SUCCESS)
-					done = MB_YES;
-				}
-			else if (*recordid == R7KRECID_7kV28kWetEndVersion)
-				{
-				status = mbr_reson7kr_rd_v28kwetendversion(verbose, buffer, store_ptr, error);
-				if (status == MB_SUCCESS)
-					done = MB_YES;
-				}
-			else if (*recordid == R7KRECID_7kV2Detection)
-				{
-				status = mbr_reson7kr_rd_v2detection(verbose, buffer, store_ptr, error);
-				if (status == MB_SUCCESS)
-					store->read_v2detection = MB_YES;
-				}
-			else if (*recordid == R7KRECID_7kV2RawDetection)
-				{
-				status = mbr_reson7kr_rd_v2rawdetection(verbose, buffer, store_ptr, error);
-				if (status == MB_SUCCESS)
-					store->read_v2rawdetection = MB_YES;
-				}
-			else if (*recordid == R7KRECID_7kV2SnippetData)
-				{
-				status = mbr_reson7kr_rd_v2snippet(verbose, buffer, store_ptr, error);
-				if (status == MB_SUCCESS)
-					store->read_v2snippet = MB_YES;
-				}
-			else if (*recordid == R7KRECID_7kCalibratedSnippetData)
-				{
-				status = mbr_reson7kr_rd_calibratedsnippet(verbose, buffer, store_ptr, error);
-				if (status == MB_SUCCESS)
-					store->read_calibratedsnippet = MB_YES;
-				}
-			else if (*recordid == R7KRECID_7kInstallationParameters)
-				{
-				status = mbr_reson7kr_rd_installation(verbose, buffer, store_ptr, error);
-				done = MB_YES;
-				}
-			else if (*recordid == R7KRECID_7kSystemEventMessage)
-				{
-				status = mbr_reson7kr_rd_systemeventmessage(verbose, buffer, store_ptr, error);
-				done = MB_YES;
-				}
-			else if (*recordid == R7KRECID_7kRemoteControlSonarSettings)
-				{
-				status = mbr_reson7kr_rd_remotecontrolsettings(verbose, buffer, store_ptr, error);
-				if (status == MB_SUCCESS)
-					store->read_remotecontrolsettings = MB_YES;
-				done = MB_NO;
-				}
-			else if (*recordid == R7KRECID_7kReserved)
-				{
-				status = mbr_reson7kr_rd_reserved(verbose, buffer, store_ptr, error);
-				done = MB_YES;
-				}
-			else if (*recordid == R7KRECID_7kRoll)
-				{
-				status = mbr_reson7kr_rd_roll(verbose, buffer, store_ptr, error);
-				done = MB_YES;
-				}
-			else if (*recordid == R7KRECID_7kPitch)
-				{
-				status = mbr_reson7kr_rd_pitch(verbose, buffer, store_ptr, error);
-				done = MB_YES;
-				}
-			else if (*recordid == R7KRECID_7kSoundVelocity)
-				{
-				status = mbr_reson7kr_rd_soundvelocity(verbose, buffer, store_ptr, error);
-				done = MB_YES;
-				}
-			else if (*recordid == R7KRECID_7kAbsorptionLoss)
-				{
-				status = mbr_reson7kr_rd_absorptionloss(verbose, buffer, store_ptr, error);
-				done = MB_YES;
-				}
-			else if (*recordid == R7KRECID_7kSpreadingLoss)
-				{
-				status = mbr_reson7kr_rd_spreadingloss(verbose, buffer, store_ptr, error);
-				done = MB_YES;
-				}
-			else
-				{
-
-#ifdef MBR_RESON7KR_DEBUG
-				fprintf(stderr,"Record type %d - recognized but not supported.\n",*recordid);
-#endif
-				done = MB_NO;
-				}
-
-			/* check if ping record is known to be done */
-			if (status == MB_SUCCESS
-				&& ping_record == MB_YES
-				&& store->read_v2detectionsetup == MB_YES)
-				{
-				if (status == MB_SUCCESS
-					&& ping_record == MB_YES
-					&& store->read_volatilesettings == MB_YES
-					&& store->read_matchfilter == MB_YES
-					&& store->read_beamgeometry == MB_YES
-					&& store->read_bathymetry == MB_YES
-					&& store->read_remotecontrolsettings == MB_YES
-					&& store->read_backscatter == MB_YES
-					&& store->read_beam == MB_YES
-					&& store->read_verticaldepth == MB_YES
-					/* && store->read_tvg == MB_YES */
-					&& store->read_image == MB_YES
-					&& store->read_v2pingmotion == MB_YES
-					&& store->read_v2detectionsetup == MB_YES
-					&& store->read_v2beamformed == MB_YES
-					&& store->read_v2detection == MB_YES
-					&& store->read_v2rawdetection == MB_YES
-					&& store->read_v2snippet == MB_YES)
-					{
-					done = MB_YES;
-					*current_ping = *last_ping;
-					*last_ping = -1;
-					}
-				}
-
-			/* check for MB-System format error in bathymetry records by checking comments
-			 * for MB-System distributions earlier than 4.3.2004 */
-			if (status == MB_SUCCESS
-				&& *recordid == R7KRECID_7kSystemEventMessage
-				&& store->systemeventmessage.message_length > 0)
-				{
-				nscan = sscanf(store->systemeventmessage.message,"MB-System Version %d.%d.%d", &version_major, &version_minor, &version_svn);
-				if (nscan == 0)
-					nscan = sscanf(store->systemeventmessage.message,"MB-system Version %d.%d.%d", &version_major, &version_minor, &version_svn);
-				if (nscan == 3
-					&& (version_major < 5
-						|| (version_major == 5 && version_minor < 3)
-						|| (version_major == 5 && version_minor == 3 && version_svn < 2004)))
-					{
-					store->bathymetry.acrossalongerror = MB_YES;
-					}
-				else if (nscan == 2
-					&& (version_major < 5
-						|| (version_major == 5 && version_minor < 3)))
-					{
-					store->bathymetry.acrossalongerror = MB_YES;
-					}
-				}
-			}
-
-		/* bail out if there is a parsing error */
-		if (status == MB_FAILURE)
-			done = MB_YES;
-#ifdef MBR_RESON7KR_DEBUG
-if (verbose >= 0)
-{
-fprintf(stderr,"done:%d kind:%d recordid:%x size:%d status:%d error:%d\n",
-	done, store->kind, *recordid, *size, status, *error);
-fprintf(stderr,"end of mbr_reson7kr_rd_data loop:\n\n");
-}
-/*if (status == MB_SUCCESS)
-{
-if (*save_flag == MB_YES)
-fprintf(stderr,"RECORD SAVED\n");
-else
-fprintf(stderr,"status:%d recordid:%d ping_record:%d current:%d last:%d new:%d  done:%d recs:%d %d %d %d %d %d %d %d %d\n",
-status,*recordid,ping_record,*current_ping,*last_ping,*new_ping,done,
-store->read_volatilesettings,store->read_matchfilter,
-store->read_beamgeometry,store->read_bathymetry,store->read_backscatter,
-store->read_beam,store->read_verticaldepth,store->read_tvg,store->read_image);
-}*/
-#endif
-		}
-#ifdef MBR_RESON7KR_DEBUG
-	if (status == MB_SUCCESS)
-		fprintf(stderr,"RESON7KR DATA READ: type:%d status:%d error:%d\n\n",
-			store->kind, status, *error);
-#endif
-
-	/* get file position */
-	if (*save_flag == MB_YES)
-		mb_io_ptr->file_bytes = ftell(mbfp) - *size;
-	else
-		mb_io_ptr->file_bytes = ftell(mbfp);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_chk_header(int verbose, void *mbio_ptr, char *buffer,
-				int *recordid,  int *deviceid, unsigned short *enumerator, int *size)
-{
-	char	*function_name = "mbr_reson7kr_chk_label";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	unsigned short	version;
-	unsigned short	offset;
-	unsigned int	sync;
-	unsigned short	reserved;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:       %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:      %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get values to check */
-	mb_get_binary_short(MB_YES, &buffer[0], &version);
-	mb_get_binary_short(MB_YES, &buffer[2], &offset);
-	mb_get_binary_int(MB_YES, &buffer[4], &sync);
-	mb_get_binary_int(MB_YES, &buffer[8], size);
-	mb_get_binary_int(MB_YES, &buffer[32], recordid);
-	mb_get_binary_int(MB_YES, &buffer[36], deviceid);
-	mb_get_binary_short(MB_YES, &buffer[40], &reserved);
-	mb_get_binary_short(MB_YES, &buffer[42], enumerator);
-#ifdef MBR_RESON7KR_DEBUG2
-	fprintf(stderr, "\nChecking header in mbr_reson7kr_chk_header:\n");
-	fprintf(stderr, "Version:      %4.4hX | %d\n", version, version);
-	fprintf(stderr, "Offset:       %4.4hX | %d\n", offset, offset);
-	fprintf(stderr, "Sync:         %4.4X | %d\n", sync, sync);
-	fprintf(stderr, "Size:         %4.4X | %d\n", *size, *size);
-	fprintf(stderr, "Record id:    %4.4X | %d\n", *recordid, *recordid);
-	fprintf(stderr, "Device id:    %4.4X | %d\n", *deviceid, *deviceid);
-	fprintf(stderr, "Reserved:     %4.4hX | %d\n", reserved, reserved);
-	fprintf(stderr, "Enumerator:   %4.4hX | %d\n", *enumerator, *enumerator);
-#endif
-
-	/* reset enumerator if version 2 */
-	if (version == 2)
-		*enumerator = reserved;
-
-	/* check sync */
-	if (sync != 0x0000FFFF)
-		{
-		status = MB_FAILURE;
-		}
-
-	/* check recordid */
-	else if (*recordid != R7KRECID_ReferencePoint
-			&& *recordid != R7KRECID_UncalibratedSensorOffset
-			&& *recordid != R7KRECID_CalibratedSensorOffset
-			&& *recordid != R7KRECID_Position
-			&& *recordid != R7KRECID_CustomAttitude
-			&& *recordid != R7KRECID_Tide
-			&& *recordid != R7KRECID_Altitude
-			&& *recordid != R7KRECID_MotionOverGround
-			&& *recordid != R7KRECID_Depth
-			&& *recordid != R7KRECID_SoundVelocityProfile
-			&& *recordid != R7KRECID_CTD
-			&& *recordid != R7KRECID_Geodesy
-			&& *recordid != R7KRECID_RollPitchHeave
-			&& *recordid != R7KRECID_Heading
-			&& *recordid != R7KRECID_SurveyLine
-			&& *recordid != R7KRECID_Navigation
-			&& *recordid != R7KRECID_Attitude
-			&& *recordid != R7KRECID_Rec1022
-			&& *recordid != R7KRECID_FSDWsidescan
-			&& *recordid != R7KRECID_FSDWsubbottom
-			&& *recordid != R7KRECID_Bluefin
-			&& *recordid != R7KRECID_ProcessedSidescan
-			&& *recordid != R7KRECID_7kVolatileSonarSettings
-			&& *recordid != R7KRECID_7kConfiguration
-			&& *recordid != R7KRECID_7kMatchFilter
-			&& *recordid != R7KRECID_7kV2FirmwareHardwareConfiguration
-			&& *recordid != R7KRECID_7kBeamGeometry
-			&& *recordid != R7KRECID_7kCalibrationData
-			&& *recordid != R7KRECID_7kBathymetricData
-			&& *recordid != R7KRECID_7kBackscatterImageData
-			&& *recordid != R7KRECID_7kBeamData
-			&& *recordid != R7KRECID_7kVerticalDepth
-			&& *recordid != R7KRECID_7kTVGData
-			&& *recordid != R7KRECID_7kImageData
-			&& *recordid != R7KRECID_7kV2PingMotion
-			&& *recordid != R7KRECID_7kV2DetectionSetup
-			&& *recordid != R7KRECID_7kV2BeamformedData
-			&& *recordid != R7KRECID_7kV2BITEData
-			&& *recordid != R7KRECID_7kV27kCenterVersion
-			&& *recordid != R7KRECID_7kV28kWetEndVersion
-			&& *recordid != R7KRECID_7kV2Detection
-			&& *recordid != R7KRECID_7kV2RawDetection
-			&& *recordid != R7KRECID_7kV2SnippetData
-			&& *recordid != R7KRECID_7kCalibratedSnippetData
-			&& *recordid != R7KRECID_7kInstallationParameters
-			&& *recordid != R7KRECID_7kSystemEventMessage
-			&& *recordid != R7KRECID_7kDataStorageStatus
-			&& *recordid != R7KRECID_7kFileHeader
-			&& *recordid != R7KRECID_7kTrigger
-			&& *recordid != R7KRECID_7kTriggerSequenceSetup
-			&& *recordid != R7KRECID_7kTriggerSequenceDone
-			&& *recordid != R7KRECID_7kTimeMessage
-			&& *recordid != R7KRECID_7kRemoteControl
-			&& *recordid != R7KRECID_7kRemoteControlAcknowledge
-			&& *recordid != R7KRECID_7kRemoteControlNotAcknowledge
-			&& *recordid != R7KRECID_7kRemoteControlSonarSettings
-			&& *recordid != R7KRECID_7kReserved
-			&& *recordid != R7KRECID_7kRoll
-			&& *recordid != R7KRECID_7kPitch
-			&& *recordid != R7KRECID_7kSoundVelocity
-			&& *recordid != R7KRECID_7kAbsorptionLoss
-			&& *recordid != R7KRECID_7kSpreadingLoss
-			&& *recordid != R7KRECID_8100SonarData)
-		{
-		status = MB_FAILURE;
-		}
-	else
-		{
-		status = MB_SUCCESS;
-
-#ifdef MBR_RESON7KR_DEBUG
-		if (verbose > 0)
-			{
-			fprintf(stderr, "Good record id: %4.4X | %d", *recordid, *recordid);
-			if (*recordid == R7KRECID_ReferencePoint) fprintf(stderr," R7KRECID_ReferencePoint\n");
-			if (*recordid == R7KRECID_UncalibratedSensorOffset) fprintf(stderr," R7KRECID_UncalibratedSensorOffset\n");
-			if (*recordid == R7KRECID_CalibratedSensorOffset) fprintf(stderr," R7KRECID_CalibratedSensorOffset\n");
-			if (*recordid == R7KRECID_Position) fprintf(stderr," R7KRECID_Position\n");
-			if (*recordid == R7KRECID_CustomAttitude) fprintf(stderr," R7KRECID_CustomAttitude\n");
-			if (*recordid == R7KRECID_Tide) fprintf(stderr," R7KRECID_Tide\n");
-			if (*recordid == R7KRECID_Altitude) fprintf(stderr," R7KRECID_Altitude\n");
-			if (*recordid == R7KRECID_MotionOverGround) fprintf(stderr," R7KRECID_MotionOverGround\n");
-			if (*recordid == R7KRECID_Depth) fprintf(stderr," R7KRECID_Depth\n");
-			if (*recordid == R7KRECID_SoundVelocityProfile) fprintf(stderr," R7KRECID_SoundVelocityProfile\n");
-			if (*recordid == R7KRECID_CTD) fprintf(stderr," R7KRECID_CTD\n");
-			if (*recordid == R7KRECID_Geodesy) fprintf(stderr," R7KRECID_Geodesy\n");
-			if (*recordid == R7KRECID_RollPitchHeave) fprintf(stderr," R7KRECID_RollPitchHeave\n");
-			if (*recordid == R7KRECID_Heading) fprintf(stderr," R7KRECID_Heading\n");
-			if (*recordid == R7KRECID_SurveyLine) fprintf(stderr," R7KRECID_Heading\n");
-			if (*recordid == R7KRECID_Navigation) fprintf(stderr," R7KRECID_Heading\n");
-			if (*recordid == R7KRECID_Attitude) fprintf(stderr," R7KRECID_Attitude\n");
-			if (*recordid == R7KRECID_Rec1022) fprintf(stderr," R7KRECID_Rec1022\n");
-			if (*recordid == R7KRECID_FSDWsidescan) fprintf(stderr," R7KRECID_FSDWsidescan\n");
-			if (*recordid == R7KRECID_FSDWsubbottom) fprintf(stderr," R7KRECID_FSDWsubbottom\n");
-			if (*recordid == R7KRECID_Bluefin) fprintf(stderr," R7KRECID_Bluefin\n");
-			if (*recordid == R7KRECID_ProcessedSidescan) fprintf(stderr," R7KRECID_ProcessedSidescan\n");
-			if (*recordid == R7KRECID_7kVolatileSonarSettings) fprintf(stderr," R7KRECID_7kVolatileSonarSettings\n");
-			if (*recordid == R7KRECID_7kConfiguration) fprintf(stderr," R7KRECID_7kConfiguration\n");
-			if (*recordid == R7KRECID_7kMatchFilter) fprintf(stderr," R7KRECID_7kMatchFilter\n");
-			if (*recordid == R7KRECID_7kV2FirmwareHardwareConfiguration) fprintf(stderr," R7KRECID_7kV2FirmwareHardwareConfiguration\n");
-			if (*recordid == R7KRECID_7kBeamGeometry) fprintf(stderr," R7KRECID_7kBeamGeometry\n");
-			if (*recordid == R7KRECID_7kCalibrationData) fprintf(stderr," R7KRECID_7kCalibrationData\n");
-			if (*recordid == R7KRECID_7kBathymetricData) fprintf(stderr," R7KRECID_7kBathymetricData\n");
-			if (*recordid == R7KRECID_7kBackscatterImageData) fprintf(stderr," R7KRECID_7kBackscatterImageData\n");
-			if (*recordid == R7KRECID_7kBeamData) fprintf(stderr," R7KRECID_7kBeamData\n");
-			if (*recordid == R7KRECID_7kVerticalDepth) fprintf(stderr," R7KRECID_7kVerticalDepth\n");
-			if (*recordid == R7KRECID_7kTVGData) fprintf(stderr," R7KRECID_7kTVGData\n");
-			if (*recordid == R7KRECID_7kImageData) fprintf(stderr," R7KRECID_7kImageData\n");
-			if (*recordid == R7KRECID_7kV2PingMotion) fprintf(stderr," R7KRECID_7kV2PingMotion\n");
-			if (*recordid == R7KRECID_7kV2DetectionSetup) fprintf(stderr," R7KRECID_7kV2DetectionSetup\n");
-			if (*recordid == R7KRECID_7kV2BeamformedData) fprintf(stderr," R7KRECID_7kV2BeamformedData\n");
-			if (*recordid == R7KRECID_7kV2BITEData) fprintf(stderr," R7KRECID_7kV2BITEData\n");
-			if (*recordid == R7KRECID_7kV27kCenterVersion) fprintf(stderr," R7KRECID_7kV27kCenterVersion\n");
-			if (*recordid == R7KRECID_7kV28kWetEndVersion) fprintf(stderr," R7KRECID_7kV28kWetEndVersion\n");
-			if (*recordid == R7KRECID_7kV2Detection) fprintf(stderr," R7KRECID_7kV2Detection\n");
-			if (*recordid == R7KRECID_7kV2RawDetection) fprintf(stderr," R7KRECID_7kV2RawDetection\n");
-			if (*recordid == R7KRECID_7kV2SnippetData) fprintf(stderr," R7KRECID_7kV2SnippetData\n");
-			if (*recordid == R7KRECID_7kCalibratedSnippetData) fprintf(stderr, " R&R7KRECID_7kCalibratedSnippetData\n");
-			if (*recordid == R7KRECID_7kInstallationParameters) fprintf(stderr," R7KRECID_7kInstallationParameters\n");
-			if (*recordid == R7KRECID_7kSystemEventMessage) fprintf(stderr,"R7KRECID_7kSystemEventMessage\n");
-			if (*recordid == R7KRECID_7kDataStorageStatus) fprintf(stderr," R7KRECID_7kDataStorageStatus\n");
-			if (*recordid == R7KRECID_7kFileHeader) fprintf(stderr," R7KRECID_7kFileHeader\n");
-			if (*recordid == R7KRECID_7kTrigger) fprintf(stderr," R7KRECID_7kTrigger\n");
-			if (*recordid == R7KRECID_7kTriggerSequenceSetup) fprintf(stderr," R7KRECID_7kTriggerSequenceSetup\n");
-			if (*recordid == R7KRECID_7kTriggerSequenceDone) fprintf(stderr," R7KRECID_7kTriggerSequenceDone\n");
-			if (*recordid == R7KRECID_7kTimeMessage) fprintf(stderr," R7KRECID_7kTimeMessage\n");
-			if (*recordid == R7KRECID_7kRemoteControl) fprintf(stderr," R7KRECID_7kRemoteControl\n");
-			if (*recordid == R7KRECID_7kRemoteControlAcknowledge) fprintf(stderr," R7KRECID_7kRemoteControlAcknowledge\n");
-			if (*recordid == R7KRECID_7kRemoteControlNotAcknowledge) fprintf(stderr," R7KRECID_7kRemoteControlNotAcknowledge\n");
-			if (*recordid == R7KRECID_7kRemoteControlSonarSettings) fprintf(stderr," R7KRECID_7kRemoteControlSonarSettings\n");
-			if (*recordid == R7KRECID_7kReserved) fprintf(stderr," R7KRECID_7kReserved\n");
-			if (*recordid == R7KRECID_7kRoll) fprintf(stderr," R7KRECID_7kRoll\n");
-			if (*recordid == R7KRECID_7kPitch) fprintf(stderr," R7KRECID_7kPitch\n");
-			if (*recordid == R7KRECID_7kSoundVelocity) fprintf(stderr," R7KRECID_7kSoundVelocity\n");
-			if (*recordid == R7KRECID_7kAbsorptionLoss) fprintf(stderr," R7KRECID_7kAbsorptionLoss\n");
-			if (*recordid == R7KRECID_7kSpreadingLoss) fprintf(stderr," R7KRECID_7kSpreadingLoss\n");
-			if (*recordid == R7KRECID_8100SonarData) fprintf(stderr," R7KRECID_8100SonarData\n");
-			}
-#endif
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Output arguments:\n");
-		fprintf(stderr,"dbg2       recordid:      %d\n",*recordid);
-		fprintf(stderr,"dbg2       deviceid:      %d\n",*deviceid);
-		fprintf(stderr,"dbg2       enumerator:    %d\n",*enumerator);
-		fprintf(stderr,"dbg2       size:          %d\n",*size);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:        %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_chk_pingnumber(int verbose, int recordid, char *buffer,
-				int *ping_number)
-{
-	char	*function_name = "mbr_reson7kr_chk_pingnumber";
-	int	status = MB_SUCCESS;
-	unsigned short	offset;
-	int	index;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:       %d\n",verbose);
-		fprintf(stderr,"dbg2       recordid:      %d\n",recordid);
-		fprintf(stderr,"dbg2       buffer:        %p\n",(void *)buffer);
-		}
-
-	/* get offset to data section */
-	mb_get_binary_short(MB_YES, &buffer[2], &offset);
-
-	/* check ping number if one of the ping records */
-	if (recordid == R7KRECID_7kVolatileSonarSettings)
-		{
-		index = offset + 12;
-		mb_get_binary_int(MB_YES, &buffer[index], ping_number);
-		status = MB_SUCCESS;
-		}
-	else if (recordid == R7KRECID_7kMatchFilter)
-		{
-		index = offset + 12;
-		mb_get_binary_int(MB_YES, &buffer[index], ping_number);
-		status = MB_SUCCESS;
-		}
-	else if (recordid == R7KRECID_7kBathymetricData)
-		{
-		index = offset + 12;
-		mb_get_binary_int(MB_YES, &buffer[index], ping_number);
-		status = MB_SUCCESS;
-		}
-	else if (recordid == R7KRECID_7kBackscatterImageData)
-		{
-		index = offset + 12;
-		mb_get_binary_int(MB_YES, &buffer[index], ping_number);
-		status = MB_SUCCESS;
-		}
-	else if (recordid == R7KRECID_7kBeamData)
-		{
-		index = offset + 12;
-		mb_get_binary_int(MB_YES, &buffer[index], ping_number);
-		status = MB_SUCCESS;
-		}
-	else if (recordid == R7KRECID_7kVerticalDepth)
-		{
-		index = offset + 8;
-		mb_get_binary_int(MB_YES, &buffer[index], ping_number);
-		status = MB_SUCCESS;
-		}
-	else if (recordid == R7KRECID_7kTVGData)
-		{
-		index = offset + 4;
-		mb_get_binary_int(MB_YES, &buffer[index], ping_number);
-		status = MB_SUCCESS;
-		}
-	else if (recordid == R7KRECID_7kImageData)
-		{
-		index = offset + 4;
-		mb_get_binary_int(MB_YES, &buffer[index], ping_number);
-		status = MB_SUCCESS;
-		}
-	else if (recordid == R7KRECID_7kV2PingMotion)
-		{
-		index = offset + 12;
-		mb_get_binary_int(MB_YES, &buffer[index], ping_number);
-		status = MB_SUCCESS;
-		}
-	else if (recordid == R7KRECID_7kV2DetectionSetup)
-		{
-		index = offset + 12;
-		mb_get_binary_int(MB_YES, &buffer[index], ping_number);
-		status = MB_SUCCESS;
-		}
-	else if (recordid == R7KRECID_7kV2BeamformedData)
-		{
-		index = offset + 12;
-		mb_get_binary_int(MB_YES, &buffer[index], ping_number);
-		status = MB_SUCCESS;
-		}
-	else if (recordid == R7KRECID_7kV2Detection)
-		{
-		index = offset + 12;
-		mb_get_binary_int(MB_YES, &buffer[index], ping_number);
-		status = MB_SUCCESS;
-		}
-	else if (recordid == R7KRECID_7kV2RawDetection)
-		{
-		index = offset + 12;
-		mb_get_binary_int(MB_YES, &buffer[index], ping_number);
-		status = MB_SUCCESS;
-		}
-	else if (recordid == R7KRECID_7kV2SnippetData)
-		{
-		index = offset + 12;
-		mb_get_binary_int(MB_YES, &buffer[index], ping_number);
-		status = MB_SUCCESS;
-		}
-	else if (recordid == R7KRECID_7kCalibratedSnippetData)
-		{
-		index = offset + 12;
-		mb_get_binary_int(MB_YES, &buffer[index], ping_number);
-		status = MB_SUCCESS;			
-		}
-	else if (recordid == R7KRECID_7kRemoteControlSonarSettings)
-		{
-		index = offset + 12;
-		mb_get_binary_int(MB_YES, &buffer[index], ping_number);
-		status = MB_SUCCESS;
-		}
-	else if (recordid == R7KRECID_ProcessedSidescan)
-		{
-		index = offset + 12;
-		mb_get_binary_int(MB_YES, &buffer[index], ping_number);
-		status = MB_SUCCESS;
-		}
-	else
-		{
-		status = MB_FAILURE;
-		*ping_number = 0;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Output arguments:\n");
-		fprintf(stderr,"dbg2       ping_number:   %d\n",*ping_number);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:        %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_rd_header(int verbose, char *buffer, int *index,
-		s7k_header *header, int *error)
-{
-	char	*function_name = "mbr_reson7kr_rd_header";
-	int	status = MB_SUCCESS;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       buffer:     %p\n",(void *)buffer);
-		fprintf(stderr,"dbg2       index:      %d\n",*index);
-		fprintf(stderr,"dbg2       header:     %p\n",(void *)header);
-		}
-
-	/* extract the header */
-	mb_get_binary_short(MB_YES, &buffer[*index], &(header->Version)); *index +=2;
-	mb_get_binary_short(MB_YES, &buffer[*index], &(header->Offset)); *index +=2;
-	mb_get_binary_int(MB_YES, &buffer[*index], &(header->SyncPattern)); *index += 4;
-	mb_get_binary_int(MB_YES, &buffer[*index], &(header->Size)); *index += 4;
-	mb_get_binary_int(MB_YES, &buffer[*index], &(header->OffsetToOptionalData)); *index += 4;
-	mb_get_binary_int(MB_YES, &buffer[*index], &(header->OptionalDataIdentifier)); *index += 4;
-	mb_get_binary_short(MB_YES, &buffer[*index], &(header->s7kTime.Year)); *index += 2;
-	mb_get_binary_short(MB_YES, &buffer[*index], &(header->s7kTime.Day)); *index += 2;
-	mb_get_binary_float(MB_YES, &buffer[*index], &(header->s7kTime.Seconds)); *index += 4;
-	header->s7kTime.Hours = (mb_u_char) buffer[*index]; (*index)++;
-	header->s7kTime.Minutes = (mb_u_char) buffer[*index]; (*index)++;
-	mb_get_binary_short(MB_YES, &buffer[*index], &(header->Reserved)); *index += 2;
-	mb_get_binary_int(MB_YES, &buffer[*index], &(header->RecordType)); *index += 4;
-	mb_get_binary_int(MB_YES, &buffer[*index], &(header->DeviceId)); *index += 4;
-	mb_get_binary_short(MB_YES, &buffer[*index], &(header->Reserved2)); *index += 2;
-	mb_get_binary_short(MB_YES, &buffer[*index], &(header->SystemEnumerator)); *index += 2;
-	if (header->Version == 2)
-		header->SystemEnumerator = header->Reserved2;
-	if (header->Version == 2)
-		mb_get_binary_int(MB_YES, &buffer[*index], &(header->DataSetNumber)); *index += 4;
-	mb_get_binary_int(MB_YES, &buffer[*index], &(header->RecordNumber)); *index += 4;
-	if (header->Version == 2)
-		{
-		for (i=0;i<8;i++)
-			{
-			header->PreviousRecord[i] = buffer[*index]; (*index)++;
-			}
-		for (i=0;i<8;i++)
-			{
-			header->NextRecord[i] = buffer[*index]; (*index)++;
-			}
-		}
-	mb_get_binary_short(MB_YES, &buffer[*index], &(header->Flags)); *index += 2;
-	mb_get_binary_short(MB_YES, &buffer[*index], &(header->Reserved3)); *index += 2;
-	if (header->Version == 2)
-		{
-		mb_get_binary_int(MB_YES, &buffer[*index], &(header->Reserved4)); *index += 4;
-		mb_get_binary_int(MB_YES, &buffer[*index], &(header->FragmentedTotal)); *index += 4;
-		mb_get_binary_int(MB_YES, &buffer[*index], &(header->FragmentNumber)); *index += 4;
-		}
-
-	/* print out the results */
-	/* mbsys_reson7k_print_header(verbose, header, error); */
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       index:      %d\n",*index);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_rd_reference(int verbose, char *buffer, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_reson7kr_rd_reference";
-	int	status = MB_SUCCESS;
-	struct mbsys_reson7k_struct *store;
-	s7k_header *header;
-	s7kr_reference *reference;
-	int	index;
-	int	time_j[5];
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       buffer:     %p\n",(void *)buffer);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	reference = &(store->reference);
-	header = &(reference->header);
-
-	/* extract the header */
-	index = 0;
-	status = mbr_reson7kr_rd_header(verbose, buffer, &index, header, error);
-
-	/* extract the data */
-	index = header->Offset + 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(reference->offset_x)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(reference->offset_y)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(reference->offset_z)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(reference->water_z)); index += 4;
-
-	/* set kind */
-	if (status == MB_SUCCESS)
-		{
-		/* set kind */
-		store->kind = MB_DATA_PARAMETER;
-		store->type = R7KRECID_ReferencePoint;
-
-		/* get the time */
-		time_j[0] = header->s7kTime.Year;
-		time_j[1] = header->s7kTime.Day;
-		time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-		time_j[3] = (int) header->s7kTime.Seconds;
-		time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-		mb_get_itime(verbose, time_j, store->time_i);
-		mb_get_time(verbose, store->time_i, &(store->time_d));
-		}
-	else
-		{
-		store->kind = MB_DATA_NONE;
-		}
-
-	/* print out the results */
-#ifdef MBR_RESON7KR_DEBUG
-fprintf(stderr,"R7KRECID_ReferencePoint:                7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d size:%d index:%d\n",
-store->time_i[0],store->time_i[1],store->time_i[2],
-store->time_i[3],store->time_i[4],store->time_i[5],store->time_i[6],
-header->RecordNumber,header->Size,index);
-#endif
-#ifdef MBR_RESON7KR_DEBUG
-	if (verbose > 0)
-#else
-	if (verbose >= 2)
-#endif
-	mbsys_reson7k_print_reference(verbose, reference, error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_rd_sensoruncal(int verbose, char *buffer, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_reson7kr_rd_sensoruncal";
-	int	status = MB_SUCCESS;
-	struct mbsys_reson7k_struct *store;
-	s7k_header *header;
-	s7kr_sensoruncal *sensoruncal;
-	int	index;
-	int	time_j[5];
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       buffer:     %p\n",(void *)buffer);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	sensoruncal = &(store->sensoruncal);
-	header = &(sensoruncal->header);
-
-	/* extract the header */
-	index = 0;
-	status = mbr_reson7kr_rd_header(verbose, buffer, &index, header, error);
-
-	/* extract the data */
-	index = header->Offset + 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(sensoruncal->offset_x)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(sensoruncal->offset_y)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(sensoruncal->offset_z)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(sensoruncal->offset_roll)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(sensoruncal->offset_pitch)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(sensoruncal->offset_yaw)); index += 4;
-
-	/* set kind */
-	if (status == MB_SUCCESS)
-		{
-		/* set kind */
-		store->kind = MB_DATA_PARAMETER;
-		store->type = R7KRECID_UncalibratedSensorOffset;
-
-		/* get the time */
-		time_j[0] = header->s7kTime.Year;
-		time_j[1] = header->s7kTime.Day;
-		time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-		time_j[3] = (int) header->s7kTime.Seconds;
-		time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-		mb_get_itime(verbose, time_j, store->time_i);
-		mb_get_time(verbose, store->time_i, &(store->time_d));
-		}
-	else
-		{
-		store->kind = MB_DATA_NONE;
-		}
-
-	/* print out the results */
-#ifdef MBR_RESON7KR_DEBUG
-fprintf(stderr,"R7KRECID_UncalibratedSensorOffset:      7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d size:%d index:%d\n",
-store->time_i[0],store->time_i[1],store->time_i[2],
-store->time_i[3],store->time_i[4],store->time_i[5],store->time_i[6],
-header->RecordNumber,header->Size,index);
-#endif
-#ifdef MBR_RESON7KR_DEBUG
-	if (verbose > 0)
-#else
-	if (verbose >= 2)
-#endif
-	mbsys_reson7k_print_sensoruncal(verbose, sensoruncal, error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_rd_sensorcal(int verbose, char *buffer, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_reson7kr_rd_sensorcal";
-	int	status = MB_SUCCESS;
-	struct mbsys_reson7k_struct *store;
-	s7k_header *header;
-	s7kr_sensorcal *sensorcal;
-	int	index;
-	int	time_j[5];
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       buffer:     %p\n",(void *)buffer);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	sensorcal = &(store->sensorcal);
-	header = &(sensorcal->header);
-
-	/* extract the header */
-	index = 0;
-	status = mbr_reson7kr_rd_header(verbose, buffer, &index, header, error);
-
-	/* extract the data */
-	index = header->Offset + 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(sensorcal->offset_x)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(sensorcal->offset_y)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(sensorcal->offset_z)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(sensorcal->offset_roll)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(sensorcal->offset_pitch)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(sensorcal->offset_yaw)); index += 4;
-
-	/* set kind */
-	if (status == MB_SUCCESS)
-		{
-		/* set kind */
-		store->kind = MB_DATA_PARAMETER;
-		store->type = R7KRECID_CalibratedSensorOffset;
-
-		/* get the time */
-		time_j[0] = header->s7kTime.Year;
-		time_j[1] = header->s7kTime.Day;
-		time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-		time_j[3] = (int) header->s7kTime.Seconds;
-		time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-		mb_get_itime(verbose, time_j, store->time_i);
-		mb_get_time(verbose, store->time_i, &(store->time_d));
-		}
-	else
-		{
-		store->kind = MB_DATA_NONE;
-		}
-
-	/* print out the results */
-#ifdef MBR_RESON7KR_DEBUG
-fprintf(stderr,"R7KRECID_CalibratedSensorOffset:        7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d size:%d index:%d\n",
-store->time_i[0],store->time_i[1],store->time_i[2],
-store->time_i[3],store->time_i[4],store->time_i[5],store->time_i[6],
-header->RecordNumber,header->Size,index);
-#endif
-#ifdef MBR_RESON7KR_DEBUG
-	if (verbose > 0)
-#else
-	if (verbose >= 2)
-#endif
-	mbsys_reson7k_print_sensorcal(verbose, sensorcal, error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_rd_position(int verbose, char *buffer, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_reson7kr_rd_position";
-	int	status = MB_SUCCESS;
-	struct mbsys_reson7k_struct *store;
-	s7k_header *header;
-	s7kr_position *position;
-	int	index;
-	int	time_j[5];
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       buffer:     %p\n",(void *)buffer);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	position = &(store->position);
-	header = &(position->header);
-
-	/* extract the header */
-	index = 0;
-	status = mbr_reson7kr_rd_header(verbose, buffer, &index, header, error);
-
-	/* extract the data */
-	index = header->Offset + 4;
-	mb_get_binary_int(MB_YES, &buffer[index], &(position->datum)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(position->latency)); index += 4;
-	mb_get_binary_double(MB_YES, &buffer[index], &(position->latitude)); index += 8;
-	mb_get_binary_double(MB_YES, &buffer[index], &(position->longitude)); index += 8;
-	mb_get_binary_double(MB_YES, &buffer[index], &(position->height)); index += 8;
-	position->type = buffer[index]; index++;
-	position->utm_zone = buffer[index]; index++;
-	position->quality = buffer[index]; index++;
-	position->method = buffer[index]; index++;
-
-	/* set kind */
-	if (status == MB_SUCCESS)
-		{
-		/* set kind */
-		store->kind = MB_DATA_NAV1;
-		store->type = R7KRECID_Position;
-
-		/* get the time */
-		time_j[0] = header->s7kTime.Year;
-		time_j[1] = header->s7kTime.Day;
-		time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-		time_j[3] = (int) header->s7kTime.Seconds;
-		time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-		mb_get_itime(verbose, time_j, store->time_i);
-		mb_get_time(verbose, store->time_i, &(store->time_d));
-		}
-	else
-		{
-		store->kind = MB_DATA_NONE;
-		}
-
-	/* print out the results */
-#ifdef MBR_RESON7KR_DEBUG
-fprintf(stderr,"R7KRECID_Position:                      7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d size:%d index:%d\n",
-store->time_i[0],store->time_i[1],store->time_i[2],
-store->time_i[3],store->time_i[4],store->time_i[5],store->time_i[6],
-header->RecordNumber,header->Size,index);
-#endif
-#ifdef MBR_RESON7KR_DEBUG
-	if (verbose > 0)
-#else
-	if (verbose >= 2)
-#endif
-	mbsys_reson7k_print_position(verbose, position, error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_rd_customattitude(int verbose, char *buffer, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_reson7kr_rd_customattitude";
-	int	status = MB_SUCCESS;
-	struct mbsys_reson7k_struct *store;
-	s7k_header *header;
-	s7kr_customattitude *customattitude;
-	int	data_size;
-	int	index;
-	int	time_j[5];
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       buffer:     %p\n",(void *)buffer);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	customattitude = &(store->customattitude);
-	header = &(customattitude->header);
-
-	/* extract the header */
-	index = 0;
-	status = mbr_reson7kr_rd_header(verbose, buffer, &index, header, error);
-
-	/* extract the data */
-	index = header->Offset + 4;
-	customattitude->bitfield = (mb_u_char) buffer[index]; index++;
-	customattitude->reserved = (mb_u_char) buffer[index]; index++;
-	mb_get_binary_short(MB_YES, &buffer[index], &(customattitude->n)); index += 2;
-	mb_get_binary_float(MB_YES, &buffer[index], &(customattitude->frequency)); index += 4;
-
-	/* make sure enough memory is allocated for channel data */
-	if (customattitude->nalloc < customattitude->n)
-		{
-		data_size = customattitude->n * sizeof(float);
-		status = mb_reallocd(verbose, __FILE__, __LINE__, data_size, (void **)&(customattitude->pitch), error);
-		if (status == MB_SUCCESS)
-			status = mb_reallocd(verbose, __FILE__, __LINE__, data_size, (void **)&(customattitude->roll), error);
-		if (status == MB_SUCCESS)
-			status = mb_reallocd(verbose, __FILE__, __LINE__, data_size, (void **)&(customattitude->heading), error);
-		if (status == MB_SUCCESS)
-			status = mb_reallocd(verbose, __FILE__, __LINE__, data_size, (void **)&(customattitude->heave), error);
-		if (status == MB_SUCCESS)
-			status = mb_reallocd(verbose, __FILE__, __LINE__, data_size, (void **)&(customattitude->pitchrate), error);
-		if (status == MB_SUCCESS)
-			status = mb_reallocd(verbose, __FILE__, __LINE__, data_size, (void **)&(customattitude->rollrate), error);
-		if (status == MB_SUCCESS)
-			status = mb_reallocd(verbose, __FILE__, __LINE__, data_size, (void **)&(customattitude->headingrate), error);
-		if (status == MB_SUCCESS)
-			status = mb_reallocd(verbose, __FILE__, __LINE__, data_size, (void **)&(customattitude->heaverate), error);
-		if (status == MB_SUCCESS)
-			{
-			customattitude->nalloc = customattitude->n;
-			}
-		else
-			{
-			customattitude->nalloc = 0;
-			customattitude->n = 0;
-			}
-		}
-
-	if (customattitude->bitfield & 1)
-	for (i=0;i<customattitude->n;i++)
-		{
-		mb_get_binary_float(MB_YES, &buffer[index], &(customattitude->pitch[i])); index += 4;
-		}
-	if (customattitude->bitfield & 2)
-	for (i=0;i<customattitude->n;i++)
-		{
-		mb_get_binary_float(MB_YES, &buffer[index], &(customattitude->roll[i])); index += 4;
-		}
-	if (customattitude->bitfield & 4)
-	for (i=0;i<customattitude->n;i++)
-		{
-		mb_get_binary_float(MB_YES, &buffer[index], &(customattitude->heading[i])); index += 4;
-		}
-	if (customattitude->bitfield & 8)
-	for (i=0;i<customattitude->n;i++)
-		{
-		mb_get_binary_float(MB_YES, &buffer[index], &(customattitude->heave[i])); index += 4;
-		}
-	if (customattitude->bitfield & 16)
-	for (i=0;i<customattitude->n;i++)
-		{
-		mb_get_binary_float(MB_YES, &buffer[index], &(customattitude->pitchrate[i])); index += 4;
-		}
-	if (customattitude->bitfield & 32)
-	for (i=0;i<customattitude->n;i++)
-		{
-		mb_get_binary_float(MB_YES, &buffer[index], &(customattitude->rollrate[i])); index += 4;
-		}
-	if (customattitude->bitfield & 64)
-	for (i=0;i<customattitude->n;i++)
-		{
-		mb_get_binary_float(MB_YES, &buffer[index], &(customattitude->headingrate[i])); index += 4;
-		}
-	if (customattitude->bitfield & 128)
-	for (i=0;i<customattitude->n;i++)
-		{
-		mb_get_binary_float(MB_YES, &buffer[index], &(customattitude->heaverate[i])); index += 4;
-		}
-
-	/* set kind */
-	if (status == MB_SUCCESS)
-		{
-		/* set kind */
-		store->kind = MB_DATA_ATTITUDE;
-		store->type = R7KRECID_CustomAttitude;
-
-		/* get the time */
-		time_j[0] = header->s7kTime.Year;
-		time_j[1] = header->s7kTime.Day;
-		time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-		time_j[3] = (int) header->s7kTime.Seconds;
-		time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-		mb_get_itime(verbose, time_j, store->time_i);
-		mb_get_time(verbose, store->time_i, &(store->time_d));
-		}
-	else
-		{
-		store->kind = MB_DATA_NONE;
-		}
-
-	/* print out the results */
-#ifdef MBR_RESON7KR_DEBUG
-fprintf(stderr,"R7KRECID_CustomAttitude:                7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d size:%d index:%d\n",
-store->time_i[0],store->time_i[1],store->time_i[2],
-store->time_i[3],store->time_i[4],store->time_i[5],store->time_i[6],
-header->RecordNumber,header->Size,index);
-#endif
-#ifdef MBR_RESON7KR_DEBUG
-	if (verbose > 0)
-#else
-	if (verbose >= 2)
-#endif
-	mbsys_reson7k_print_customattitude(verbose, customattitude, error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_rd_tide(int verbose, char *buffer, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_reson7kr_rd_tide";
-	int	status = MB_SUCCESS;
-	struct mbsys_reson7k_struct *store;
-	s7k_header *header;
-	s7kr_tide *tide;
-	int	index;
-	int	time_j[5];
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       buffer:     %p\n",(void *)buffer);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	tide = &(store->tide);
-	header = &(tide->header);
-
-	/* extract the header */
-	index = 0;
-	status = mbr_reson7kr_rd_header(verbose, buffer, &index, header, error);
-
-	/* extract the data */
-	index = header->Offset + 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(tide->tide)); index += 4;
-	mb_get_binary_short(MB_YES, &buffer[index], &(tide->source)); index += 2;
-	tide->flags = buffer[index]; index++;
-	mb_get_binary_short(MB_YES, &buffer[index], &(tide->gauge)); index += 2;
-	mb_get_binary_int(MB_YES, &buffer[index], &(tide->datum)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(tide->latency)); index += 4;
-	mb_get_binary_double(MB_YES, &buffer[index], &(tide->latitude)); index += 8;
-	mb_get_binary_double(MB_YES, &buffer[index], &(tide->longitude)); index += 8;
-	mb_get_binary_double(MB_YES, &buffer[index], &(tide->height)); index += 8;
-	tide->type = buffer[index]; index++;
-	tide->utm_zone = buffer[index]; index++;
-
-	/* set kind */
-	if (status == MB_SUCCESS)
-		{
-		/* set kind */
-		store->kind = MB_DATA_TIDE;
-		store->type = R7KRECID_Tide;
-
-		/* get the time */
-		time_j[0] = header->s7kTime.Year;
-		time_j[1] = header->s7kTime.Day;
-		time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-		time_j[3] = (int) header->s7kTime.Seconds;
-		time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-		mb_get_itime(verbose, time_j, store->time_i);
-		mb_get_time(verbose, store->time_i, &(store->time_d));
-		}
-	else
-		{
-		store->kind = MB_DATA_NONE;
-		}
-
-	/* print out the results */
-#ifdef MBR_RESON7KR_DEBUG
-fprintf(stderr,"R7KRECID_Tide:                          7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d size:%d index:%d\n",
-store->time_i[0],store->time_i[1],store->time_i[2],
-store->time_i[3],store->time_i[4],store->time_i[5],store->time_i[6],
-header->RecordNumber,header->Size,index);
-#endif
-#ifdef MBR_RESON7KR_DEBUG
-	if (verbose > 0)
-#else
-	if (verbose >= 2)
-#endif
-	mbsys_reson7k_print_tide(verbose, tide, error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_rd_altitude(int verbose, char *buffer, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_reson7kr_rd_altitude";
-	int	status = MB_SUCCESS;
-	struct mbsys_reson7k_struct *store;
-	s7k_header *header;
-	s7kr_altitude *altitude;
-	int	index;
-	int	time_j[5];
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       buffer:     %p\n",(void *)buffer);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	altitude = &(store->altitude);
-	header = &(altitude->header);
-
-	/* extract the header */
-	index = 0;
-	status = mbr_reson7kr_rd_header(verbose, buffer, &index, header, error);
-
-	/* extract the data */
-	index = header->Offset + 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(altitude->altitude)); index += 4;
-
-	/* set kind */
-	if (status == MB_SUCCESS)
-		{
-		/* set kind */
-		store->kind = MB_DATA_HEIGHT;
-		store->type = R7KRECID_Altitude;
-
-		/* get the time */
-		time_j[0] = header->s7kTime.Year;
-		time_j[1] = header->s7kTime.Day;
-		time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-		time_j[3] = (int) header->s7kTime.Seconds;
-		time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-		mb_get_itime(verbose, time_j, store->time_i);
-		mb_get_time(verbose, store->time_i, &(store->time_d));
-		}
-	else
-		{
-		store->kind = MB_DATA_NONE;
-		}
-
-	/* print out the results */
-#ifdef MBR_RESON7KR_DEBUG
-fprintf(stderr,"R7KRECID_Altitude:                      7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d size:%d index:%d\n",
-store->time_i[0],store->time_i[1],store->time_i[2],
-store->time_i[3],store->time_i[4],store->time_i[5],store->time_i[6],
-header->RecordNumber,header->Size,index);
-#endif
-#ifdef MBR_RESON7KR_DEBUG
-	if (verbose > 0)
-#else
-	if (verbose >= 2)
-#endif
-	mbsys_reson7k_print_altitude(verbose, altitude, error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_rd_motion(int verbose, char *buffer, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_reson7kr_rd_motion";
-	int	status = MB_SUCCESS;
-	struct mbsys_reson7k_struct *store;
-	s7k_header *header;
-	s7kr_motion *motion;
-	int	data_size;
-	int	index;
-	int	time_j[5];
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       buffer:     %p\n",(void *)buffer);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	motion = &(store->motion);
-	header = &(motion->header);
-
-	/* extract the header */
-	index = 0;
-	status = mbr_reson7kr_rd_header(verbose, buffer, &index, header, error);
-
-	/* extract the data */
-	index = header->Offset + 4;
-	motion->bitfield = (mb_u_char) buffer[index]; index++;
-	motion->reserved = (mb_u_char) buffer[index]; index++;
-	mb_get_binary_short(MB_YES, &buffer[index], &(motion->n)); index += 2;
-	mb_get_binary_float(MB_YES, &buffer[index], &(motion->frequency)); index += 4;
-
-	/* make sure enough memory is allocated for channel data */
-	if (motion->nalloc < motion->n)
-		{
-		data_size = motion->n * sizeof(float);
-		status = mb_reallocd(verbose, __FILE__, __LINE__, data_size, (void **)&(motion->x), error);
-		if (status == MB_SUCCESS)
-			status = mb_reallocd(verbose, __FILE__, __LINE__, data_size, (void **)&(motion->y), error);
-		if (status == MB_SUCCESS)
-			status = mb_reallocd(verbose, __FILE__, __LINE__, data_size, (void **)&(motion->z), error);
-		if (status == MB_SUCCESS)
-			status = mb_reallocd(verbose, __FILE__, __LINE__, data_size, (void **)&(motion->xa), error);
-		if (status == MB_SUCCESS)
-			status = mb_reallocd(verbose, __FILE__, __LINE__, data_size, (void **)&(motion->ya), error);
-		if (status == MB_SUCCESS)
-			status = mb_reallocd(verbose, __FILE__, __LINE__, data_size, (void **)&(motion->za), error);
-		if (status == MB_SUCCESS)
-			{
-			motion->nalloc = motion->n;
-			}
-		else
-			{
-			motion->nalloc = 0;
-			motion->n = 0;
-			}
-		}
-
-	if (motion->bitfield & 1)
-		{
-		for (i=0;i<motion->n;i++)
-			{
-			mb_get_binary_float(MB_YES, &buffer[index], &(motion->x[i])); index += 4;
-			}
-		for (i=0;i<motion->n;i++)
-			{
-			mb_get_binary_float(MB_YES, &buffer[index], &(motion->y[i])); index += 4;
-			}
-		for (i=0;i<motion->n;i++)
-			{
-			mb_get_binary_float(MB_YES, &buffer[index], &(motion->z[i])); index += 4;
-			}
-		}
-	if (motion->bitfield & 2)
-		{
-		for (i=0;i<motion->n;i++)
-			{
-			mb_get_binary_float(MB_YES, &buffer[index], &(motion->xa[i])); index += 4;
-			}
-		for (i=0;i<motion->n;i++)
-			{
-			mb_get_binary_float(MB_YES, &buffer[index], &(motion->ya[i])); index += 4;
-			}
-		for (i=0;i<motion->n;i++)
-			{
-			mb_get_binary_float(MB_YES, &buffer[index], &(motion->za[i])); index += 4;
-			}
-		}
-
-	/* set kind */
-	if (status == MB_SUCCESS)
-		{
-		/* set kind */
-		store->kind = MB_DATA_MOTION;
-		store->type = R7KRECID_MotionOverGround;
-
-		/* get the time */
-		time_j[0] = header->s7kTime.Year;
-		time_j[1] = header->s7kTime.Day;
-		time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-		time_j[3] = (int) header->s7kTime.Seconds;
-		time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-		mb_get_itime(verbose, time_j, store->time_i);
-		mb_get_time(verbose, store->time_i, &(store->time_d));
-		}
-	else
-		{
-		store->kind = MB_DATA_NONE;
-		}
-
-	/* print out the results */
-#ifdef MBR_RESON7KR_DEBUG
-fprintf(stderr,"R7KRECID_MotionOverGround:              7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d size:%d index:%d\n",
-store->time_i[0],store->time_i[1],store->time_i[2],
-store->time_i[3],store->time_i[4],store->time_i[5],store->time_i[6],
-header->RecordNumber,header->Size,index);
-#endif
-#ifdef MBR_RESON7KR_DEBUG
-	if (verbose > 0)
-#else
-	if (verbose >= 2)
-#endif
-	mbsys_reson7k_print_motion(verbose, motion, error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_rd_depth(int verbose, char *buffer, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_reson7kr_rd_depth";
-	int	status = MB_SUCCESS;
-	struct mbsys_reson7k_struct *store;
-	s7k_header *header;
-	s7kr_depth *depth;
-	int	index;
-	int	time_j[5];
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       buffer:     %p\n",(void *)buffer);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	depth = &(store->depth);
-	header = &(depth->header);
-
-	/* extract the header */
-	index = 0;
-	status = mbr_reson7kr_rd_header(verbose, buffer, &index, header, error);
-
-	/* extract the data */
-	index = header->Offset + 4;
-	depth->descriptor = (mb_u_char) buffer[index]; index++;
-	depth->correction = (mb_u_char) buffer[index]; index++;
-	mb_get_binary_short(MB_YES, &buffer[index], &(depth->reserved)); index += 2;
-	mb_get_binary_float(MB_YES, &buffer[index], &(depth->depth)); index += 4;
-
-	/* set kind */
-	if (status == MB_SUCCESS)
-		{
-		/* set kind */
-		store->kind = MB_DATA_HEIGHT;
-		store->type = R7KRECID_Depth;
-
-		/* get the time */
-		time_j[0] = header->s7kTime.Year;
-		time_j[1] = header->s7kTime.Day;
-		time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-		time_j[3] = (int) header->s7kTime.Seconds;
-		time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-		mb_get_itime(verbose, time_j, store->time_i);
-		mb_get_time(verbose, store->time_i, &(store->time_d));
-		}
-	else
-		{
-		store->kind = MB_DATA_NONE;
-		}
-
-	/* print out the results */
-#ifdef MBR_RESON7KR_DEBUG
-fprintf(stderr,"R7KRECID_Depth:                         7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d size:%d index:%d\n",
-store->time_i[0],store->time_i[1],store->time_i[2],
-store->time_i[3],store->time_i[4],store->time_i[5],store->time_i[6],
-header->RecordNumber,header->Size,index);
-#endif
-#ifdef MBR_RESON7KR_DEBUG
-	if (verbose > 0)
-#else
-	if (verbose >= 2)
-#endif
-	mbsys_reson7k_print_depth(verbose, depth, error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_rd_svp(int verbose, char *buffer, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_reson7kr_rd_svp";
-	int	status = MB_SUCCESS;
-	struct mbsys_reson7k_struct *store;
-	s7k_header *header;
-	s7kr_svp *svp;
-	int	data_size;
-	int	index;
-	int	time_j[5];
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       buffer:     %p\n",(void *)buffer);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	svp = &(store->svp);
-	header = &(svp->header);
-
-	/* extract the header */
-	index = 0;
-	status = mbr_reson7kr_rd_header(verbose, buffer, &index, header, error);
-
-	/* extract the data */
-	index = header->Offset + 4;
-	svp->position_flag = (mb_u_char) buffer[index]; index++;
-	svp->reserved1 = (mb_u_char) buffer[index]; index++;
-	mb_get_binary_short(MB_YES, &buffer[index], &(svp->reserved2)); index += 2;
-	mb_get_binary_double(MB_YES, &buffer[index], &(svp->latitude)); index += 8;
-	mb_get_binary_double(MB_YES, &buffer[index], &(svp->longitude)); index += 8;
-	mb_get_binary_int(MB_YES, &buffer[index], &(svp->n)); index += 4;
-
-	/* make sure enough memory is allocated for channel data */
-	if (svp->nalloc < svp->n)
-		{
-		data_size = svp->n * sizeof(float);
-		status = mb_reallocd(verbose, __FILE__, __LINE__, data_size, (void **)&(svp->depth), error);
-		if (status == MB_SUCCESS)
-			status = mb_reallocd(verbose, __FILE__, __LINE__, data_size, (void **)&(svp->sound_velocity), error);
-		if (status == MB_SUCCESS)
-			{
-			svp->nalloc = svp->n;
-			}
-		else
-			{
-			svp->nalloc = 0;
-			svp->n = 0;
-			}
-		}
-
-	for (i=0;i<svp->n;i++)
-		{
-		mb_get_binary_float(MB_YES, &buffer[index], &(svp->depth[i])); index += 4;
-		mb_get_binary_float(MB_YES, &buffer[index], &(svp->sound_velocity[i])); index += 4;
-		}
-
-	/* set kind */
-	if (status == MB_SUCCESS)
-		{
-		/* set kind */
-		store->kind = MB_DATA_VELOCITY_PROFILE;
-		store->type = R7KRECID_SoundVelocityProfile;
-
-		/* get the time */
-		time_j[0] = header->s7kTime.Year;
-		time_j[1] = header->s7kTime.Day;
-		time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-		time_j[3] = (int) header->s7kTime.Seconds;
-		time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-		mb_get_itime(verbose, time_j, store->time_i);
-		mb_get_time(verbose, store->time_i, &(store->time_d));
-		}
-	else
-		{
-		store->kind = MB_DATA_NONE;
-		}
-
-	/* print out the results */
-#ifdef MBR_RESON7KR_DEBUG
-fprintf(stderr,"R7KRECID_SoundVelocityProfile:          7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d size:%d index:%d\n",
-store->time_i[0],store->time_i[1],store->time_i[2],
-store->time_i[3],store->time_i[4],store->time_i[5],store->time_i[6],
-header->RecordNumber,header->Size,index);
-#endif
-#ifdef MBR_RESON7KR_DEBUG
-	if (verbose > 0)
-#else
-	if (verbose >= 2)
-#endif
-	mbsys_reson7k_print_svp(verbose, svp, error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_rd_ctd(int verbose, char *buffer, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_reson7kr_rd_ctd";
-	int	status = MB_SUCCESS;
-	struct mbsys_reson7k_struct *store;
-	s7k_header *header;
-	s7kr_ctd *ctd;
-	int	data_size;
-	int	index;
-	int	time_j[5];
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       buffer:     %p\n",(void *)buffer);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	ctd = &(store->ctd);
-	header = &(ctd->header);
-
-	/* extract the header */
-	index = 0;
-	status = mbr_reson7kr_rd_header(verbose, buffer, &index, header, error);
-
-	/* extract the data */
-	index = header->Offset + 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(ctd->frequency)); index += 4;
-	ctd->velocity_source_flag = (mb_u_char) buffer[index]; index++;
-	ctd->velocity_algorithm = (mb_u_char) buffer[index]; index++;
-	ctd->conductivity_flag = (mb_u_char) buffer[index]; index++;
-	ctd->pressure_flag = (mb_u_char) buffer[index]; index++;
-	ctd->position_flag = (mb_u_char) buffer[index]; index++;
-	ctd->validity = (mb_u_char) buffer[index]; index++;
-	mb_get_binary_short(MB_YES, &buffer[index], &(ctd->reserved)); index += 2;
-	mb_get_binary_double(MB_YES, &buffer[index], &(ctd->latitude)); index += 8;
-	mb_get_binary_double(MB_YES, &buffer[index], &(ctd->longitude)); index += 8;
-	mb_get_binary_float(MB_YES, &buffer[index], &(ctd->sample_rate)); index += 4;
-	mb_get_binary_int(MB_YES, &buffer[index], &(ctd->n)); index += 4;
-
-	/* make sure enough memory is allocated for channel data */
-	if (ctd->nalloc < ctd->n)
-		{
-		data_size = ctd->n * sizeof(float);
-		status = mb_reallocd(verbose, __FILE__, __LINE__, data_size, (void **)&(ctd->conductivity_salinity), error);
-		if (status == MB_SUCCESS)
-			status = mb_reallocd(verbose, __FILE__, __LINE__, data_size, (void **)&(ctd->temperature), error);
-		if (status == MB_SUCCESS)
-			status = mb_reallocd(verbose, __FILE__, __LINE__, data_size, (void **)&(ctd->pressure_depth), error);
-		if (status == MB_SUCCESS)
-			status = mb_reallocd(verbose, __FILE__, __LINE__, data_size, (void **)&(ctd->sound_velocity), error);
-		if (status == MB_SUCCESS)
-			status = mb_reallocd(verbose, __FILE__, __LINE__, data_size, (void **)&(ctd->absorption), error);
-		if (status == MB_SUCCESS)
-			{
-			ctd->nalloc = ctd->n;
-			}
-		else
-			{
-			ctd->nalloc = 0;
-			ctd->n = 0;
-			}
-		}
-
-	for (i=0;i<ctd->n;i++)
-		{
-		mb_get_binary_float(MB_YES, &buffer[index], &(ctd->conductivity_salinity[i])); index += 4;
-		mb_get_binary_float(MB_YES, &buffer[index], &(ctd->temperature[i])); index += 4;
-		mb_get_binary_float(MB_YES, &buffer[index], &(ctd->pressure_depth[i])); index += 4;
-		mb_get_binary_float(MB_YES, &buffer[index], &(ctd->sound_velocity[i])); index += 4;
-		mb_get_binary_float(MB_YES, &buffer[index], &(ctd->absorption[i])); index += 4;
-		}
-
-	/* set kind */
-	if (status == MB_SUCCESS)
-		{
-		/* set kind */
-		store->kind = MB_DATA_CTD;
-		store->type = R7KRECID_CTD;
-
-		/* get the time */
-		time_j[0] = header->s7kTime.Year;
-		time_j[1] = header->s7kTime.Day;
-		time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-		time_j[3] = (int) header->s7kTime.Seconds;
-		time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-		mb_get_itime(verbose, time_j, store->time_i);
-		mb_get_time(verbose, store->time_i, &(store->time_d));
-		}
-	else
-		{
-		store->kind = MB_DATA_NONE;
-		}
-
-	/* print out the results */
-#ifdef MBR_RESON7KR_DEBUG
-fprintf(stderr,"R7KRECID_CTD:                           7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d size:%d index:%d\n",
-store->time_i[0],store->time_i[1],store->time_i[2],
-store->time_i[3],store->time_i[4],store->time_i[5],store->time_i[6],
-header->RecordNumber,header->Size,index);
-#endif
-#ifdef MBR_RESON7KR_DEBUG
-	if (verbose > 0)
-#else
-	if (verbose >= 2)
-#endif
-	mbsys_reson7k_print_ctd(verbose, ctd, error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_rd_geodesy(int verbose, char *buffer, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_reson7kr_rd_geodesy";
-	int	status = MB_SUCCESS;
-	struct mbsys_reson7k_struct *store;
-	s7k_header *header;
-	s7kr_geodesy *geodesy;
-	int	index;
-	int	time_j[5];
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       buffer:     %p\n",(void *)buffer);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	geodesy = &(store->geodesy);
-	header = &(geodesy->header);
-
-	/* extract the header */
-	index = 0;
-	status = mbr_reson7kr_rd_header(verbose, buffer, &index, header, error);
-
-	/* extract the data */
-	index = header->Offset + 4;
-	for (i=0;i<32;i++)
-		{
-		geodesy->spheroid[i] = (mb_u_char) buffer[index]; index++;
-		}
-	mb_get_binary_double(MB_YES, &buffer[index], &(geodesy->semimajoraxis)); index += 8;
-	mb_get_binary_double(MB_YES, &buffer[index], &(geodesy->flattening)); index += 8;
-	for (i=0;i<16;i++)
-		{
-		geodesy->reserved1[i] = (mb_u_char) buffer[index]; index++;
-		}
-	for (i=0;i<32;i++)
-		{
-		geodesy->datum[i] = (mb_u_char) buffer[index]; index++;
-		}
-	mb_get_binary_int(MB_YES, &buffer[index], &(geodesy->calculation_method)); index += 4;
-	mb_get_binary_int(MB_YES, &buffer[index], &(geodesy->number_parameters)); index += 4;
-	mb_get_binary_double(MB_YES, &buffer[index], &(geodesy->dx)); index += 8;
-	mb_get_binary_double(MB_YES, &buffer[index], &(geodesy->dy)); index += 8;
-	mb_get_binary_double(MB_YES, &buffer[index], &(geodesy->dz)); index += 8;
-	mb_get_binary_double(MB_YES, &buffer[index], &(geodesy->rx)); index += 8;
-	mb_get_binary_double(MB_YES, &buffer[index], &(geodesy->ry)); index += 8;
-	mb_get_binary_double(MB_YES, &buffer[index], &(geodesy->rz)); index += 8;
-	mb_get_binary_double(MB_YES, &buffer[index], &(geodesy->scale)); index += 8;
-	for (i=0;i<35;i++)
-		{
-		geodesy->reserved2[i] = (mb_u_char) buffer[index]; index++;
-		}
-	for (i=0;i<32;i++)
-		{
-		geodesy->grid_name[i] = (mb_u_char) buffer[index]; index++;
-		}
-	geodesy->distance_units = (mb_u_char) buffer[index]; index++;
-	geodesy->angular_units = (mb_u_char) buffer[index]; index++;
-	mb_get_binary_double(MB_YES, &buffer[index], &(geodesy->latitude_origin)); index += 8;
-	mb_get_binary_double(MB_YES, &buffer[index], &(geodesy->central_meriidan)); index += 8;
-	mb_get_binary_double(MB_YES, &buffer[index], &(geodesy->false_easting)); index += 8;
-	mb_get_binary_double(MB_YES, &buffer[index], &(geodesy->false_northing)); index += 8;
-	mb_get_binary_double(MB_YES, &buffer[index], &(geodesy->central_scale_factor)); index += 8;
-	mb_get_binary_int(MB_YES, &buffer[index], &(geodesy->custum_identifier)); index += 4;
-	for (i=0;i<50;i++)
-		{
-		geodesy->reserved3[i] = (mb_u_char) buffer[index]; index++;
-		}
-
-	/* set kind */
-	if (status == MB_SUCCESS)
-		{
-		/* set kind */
-		store->kind = MB_DATA_PARAMETER;
-		store->type = R7KRECID_Geodesy;
-
-		/* get the time */
-		time_j[0] = header->s7kTime.Year;
-		time_j[1] = header->s7kTime.Day;
-		time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-		time_j[3] = (int) header->s7kTime.Seconds;
-		time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-		mb_get_itime(verbose, time_j, store->time_i);
-		mb_get_time(verbose, store->time_i, &(store->time_d));
-		}
-	else
-		{
-		store->kind = MB_DATA_NONE;
-		}
-
-	/* print out the results */
-#ifdef MBR_RESON7KR_DEBUG
-fprintf(stderr,"R7KRECID_Geodesy:                       7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d size:%d index:%d\n",
-store->time_i[0],store->time_i[1],store->time_i[2],
-store->time_i[3],store->time_i[4],store->time_i[5],store->time_i[6],
-header->RecordNumber,header->Size,index);
-#endif
-#ifdef MBR_RESON7KR_DEBUG
-	if (verbose > 0)
-#else
-	if (verbose >= 2)
-#endif
-	mbsys_reson7k_print_geodesy(verbose, geodesy, error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_rd_rollpitchheave(int verbose, char *buffer, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_reson7kr_rd_rollpitchheave";
-	int	status = MB_SUCCESS;
-	struct mbsys_reson7k_struct *store;
-	s7k_header *header;
-	s7kr_rollpitchheave *rollpitchheave;
-	int	index;
-	int	time_j[5];
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       buffer:     %p\n",(void *)buffer);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	rollpitchheave = &(store->rollpitchheave);
-	header = &(rollpitchheave->header);
-
-	/* extract the header */
-	index = 0;
-	status = mbr_reson7kr_rd_header(verbose, buffer, &index, header, error);
-
-	/* extract the data */
-	index = header->Offset + 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(rollpitchheave->roll)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(rollpitchheave->pitch)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(rollpitchheave->heave)); index += 4;
-
-	/* set kind */
-	if (status == MB_SUCCESS)
-		{
-		/* set kind */
-		store->kind = MB_DATA_ATTITUDE;
-		store->type = R7KRECID_RollPitchHeave;
-
-		/* get the time */
-		time_j[0] = header->s7kTime.Year;
-		time_j[1] = header->s7kTime.Day;
-		time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-		time_j[3] = (int) header->s7kTime.Seconds;
-		time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-		mb_get_itime(verbose, time_j, store->time_i);
-		mb_get_time(verbose, store->time_i, &(store->time_d));
-		}
-	else
-		{
-		store->kind = MB_DATA_NONE;
-		}
-
-	/* print out the results */
-#ifdef MBR_RESON7KR_DEBUG
-fprintf(stderr,"R7KRECID_RollPitchHeave:                7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d size:%d index:%d\n",
-store->time_i[0],store->time_i[1],store->time_i[2],
-store->time_i[3],store->time_i[4],store->time_i[5],store->time_i[6],
-header->RecordNumber,header->Size,index);
-#endif
-#ifdef MBR_RESON7KR_DEBUG
-	if (verbose > 0)
-#else
-	if (verbose >= 2)
-#endif
-	mbsys_reson7k_print_rollpitchheave(verbose, rollpitchheave, error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_rd_heading(int verbose, char *buffer, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_reson7kr_rd_heading";
-	int	status = MB_SUCCESS;
-	struct mbsys_reson7k_struct *store;
-	s7k_header *header;
-	s7kr_heading *heading;
-	int	index;
-	int	time_j[5];
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       buffer:     %p\n",(void *)buffer);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	heading = &(store->heading);
-	header = &(heading->header);
-
-	/* extract the header */
-	index = 0;
-	status = mbr_reson7kr_rd_header(verbose, buffer, &index, header, error);
-
-	/* extract the data */
-	index = header->Offset + 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(heading->heading)); index += 4;
-
-	/* set kind */
-	if (status == MB_SUCCESS)
-		{
-		/* set kind */
-		store->kind = MB_DATA_HEADING;
-		store->type = R7KRECID_Heading;
-
-		/* get the time */
-		time_j[0] = header->s7kTime.Year;
-		time_j[1] = header->s7kTime.Day;
-		time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-		time_j[3] = (int) header->s7kTime.Seconds;
-		time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-		mb_get_itime(verbose, time_j, store->time_i);
-		mb_get_time(verbose, store->time_i, &(store->time_d));
-		}
-	else
-		{
-		store->kind = MB_DATA_NONE;
-		}
-
-	/* print out the results */
-#ifdef MBR_RESON7KR_DEBUG
-fprintf(stderr,"R7KRECID_Heading:                       7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d size:%d index:%d\n",
-store->time_i[0],store->time_i[1],store->time_i[2],
-store->time_i[3],store->time_i[4],store->time_i[5],store->time_i[6],
-header->RecordNumber,header->Size,index);
-#endif
-#ifdef MBR_RESON7KR_DEBUG
-	if (verbose > 0)
-#else
-	if (verbose >= 2)
-#endif
-	mbsys_reson7k_print_heading(verbose, heading, error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_rd_surveyline(int verbose, char *buffer, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_reson7kr_rd_surveyline";
-	int	status = MB_SUCCESS;
-	struct mbsys_reson7k_struct *store;
-	s7k_header *header;
-	s7kr_surveyline *surveyline;
-	int	data_size;
-	int	index;
-	int	time_j[5];
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       buffer:     %p\n",(void *)buffer);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	surveyline = &(store->surveyline);
-	header = &(surveyline->header);
-
-	/* extract the header */
-	index = 0;
-	status = mbr_reson7kr_rd_header(verbose, buffer, &index, header, error);
-
-	/* extract the data */
-	index = header->Offset + 4;
-	mb_get_binary_short(MB_YES, &buffer[index], &(surveyline->n)); index += 2;
-	mb_get_binary_short(MB_YES, &buffer[index], &(surveyline->type)); index += 2;
-	mb_get_binary_float(MB_YES, &buffer[index], &(surveyline->turnradius)); index += 4;
-	for (i=0;i<64;i++)
-		{
-		surveyline->name[i] = (char) buffer[index]; index++;
-		}
-
-	/* make sure enough memory is allocated for channel data */
-	if (surveyline->nalloc < surveyline->n)
-		{
-		data_size = surveyline->n * sizeof(float);
-		status = mb_reallocd(verbose, __FILE__, __LINE__, data_size, (void **)&(surveyline->latitude), error);
-		if (status == MB_SUCCESS)
-			status = mb_reallocd(verbose, __FILE__, __LINE__, data_size, (void **)&(surveyline->longitude), error);
-		if (status == MB_SUCCESS)
-			{
-			surveyline->nalloc = surveyline->n;
-			}
-		else
-			{
-			surveyline->nalloc = 0;
-			surveyline->n = 0;
-			}
-		}
-
-	for (i=0;i<surveyline->n;i++)
-		{
-		mb_get_binary_double(MB_YES, &buffer[index], &(surveyline->latitude[i])); index += 8;
-		mb_get_binary_double(MB_YES, &buffer[index], &(surveyline->longitude[i])); index += 8;
-		}
-
-	/* set kind */
-	if (status == MB_SUCCESS)
-		{
-		/* set kind */
-		store->kind = MB_DATA_SURVEY_LINE;
-		store->type = R7KRECID_SurveyLine;
-
-		/* get the time */
-		time_j[0] = header->s7kTime.Year;
-		time_j[1] = header->s7kTime.Day;
-		time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-		time_j[3] = (int) header->s7kTime.Seconds;
-		time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-		mb_get_itime(verbose, time_j, store->time_i);
-		mb_get_time(verbose, store->time_i, &(store->time_d));
-		}
-	else
-		{
-		store->kind = MB_DATA_NONE;
-		}
-
-	/* print out the results */
-#ifdef MBR_RESON7KR_DEBUG
-fprintf(stderr,"R7KRECID_SurveyLine:                   7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d size:%d index:%d\n",
-store->time_i[0],store->time_i[1],store->time_i[2],
-store->time_i[3],store->time_i[4],store->time_i[5],store->time_i[6],
-header->RecordNumber,header->Size,index);
-#endif
-#ifdef MBR_RESON7KR_DEBUG
-	if (verbose > 0)
-#else
-	if (verbose >= 2)
-#endif
-	mbsys_reson7k_print_surveyline(verbose, surveyline, error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_rd_navigation(int verbose, char *buffer, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_reson7kr_rd_navigation";
-	int	status = MB_SUCCESS;
-	struct mbsys_reson7k_struct *store;
-	s7k_header *header;
-	s7kr_navigation *navigation;
-	int	index;
-	int	time_j[5];
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       buffer:     %p\n",(void *)buffer);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	navigation = &(store->navigation);
-	header = &(navigation->header);
-
-	/* extract the header */
-	index = 0;
-	status = mbr_reson7kr_rd_header(verbose, buffer, &index, header, error);
-
-	/* extract the data */
-	index = header->Offset + 4;
-	navigation->vertical_reference = (mb_u_char) buffer[index]; index++;
-	mb_get_binary_double(MB_YES, &buffer[index], &(navigation->latitude)); index += 8;
-	mb_get_binary_double(MB_YES, &buffer[index], &(navigation->longitude)); index += 8;
-	mb_get_binary_float(MB_YES, &buffer[index], &(navigation->position_accuracy)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(navigation->height)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(navigation->height_accuracy)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(navigation->speed)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(navigation->course)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(navigation->heading)); index += 4;
-
-	/* set kind */
-	if (status == MB_SUCCESS)
-		{
-		/* set kind */
-		store->kind = MB_DATA_NAV3;
-		store->type = R7KRECID_Navigation;
-
-		/* get the time */
-		time_j[0] = header->s7kTime.Year;
-		time_j[1] = header->s7kTime.Day;
-		time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-		time_j[3] = (int) header->s7kTime.Seconds;
-		time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-		mb_get_itime(verbose, time_j, store->time_i);
-		mb_get_time(verbose, store->time_i, &(store->time_d));
-		}
-	else
-		{
-		store->kind = MB_DATA_NONE;
-		}
-
-	/* print out the results */
-#ifdef MBR_RESON7KR_DEBUG
-fprintf(stderr,"R7KRECID_Navigation:                    7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d size:%d index:%d\n",
-store->time_i[0],store->time_i[1],store->time_i[2],
-store->time_i[3],store->time_i[4],store->time_i[5],store->time_i[6],
-header->RecordNumber,header->Size,index);
-#endif
-#ifdef MBR_RESON7KR_DEBUG
-	if (verbose > 0)
-#else
-	if (verbose >= 2)
-#endif
-	mbsys_reson7k_print_navigation(verbose, navigation, error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_rd_attitude(int verbose, char *buffer, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_reson7kr_rd_attitude";
-	int	status = MB_SUCCESS;
-	struct mbsys_reson7k_struct *store;
-	s7k_header *header;
-	s7kr_attitude *attitude;
-	int	data_size;
-	int	index;
-	int	time_j[5];
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       buffer:     %p\n",(void *)buffer);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	attitude = &(store->attitude);
-	header = &(attitude->header);
-
-	/* extract the header */
-	index = 0;
-	status = mbr_reson7kr_rd_header(verbose, buffer, &index, header, error);
-
-	/* extract the data */
-	index = header->Offset + 4;
-	attitude->n = (mb_u_char) buffer[index]; index++;
-
-	/* make sure enough memory is allocated for channel data */
-	if (attitude->nalloc < attitude->n)
-		{
-		data_size = attitude->n * sizeof(unsigned short);
-		status = mb_reallocd(verbose, __FILE__, __LINE__, data_size, (void **)&(attitude->delta_time), error);
-		data_size = attitude->n * sizeof(float);
-		if (status == MB_SUCCESS)
-			status = mb_reallocd(verbose, __FILE__, __LINE__, data_size, (void **)&(attitude->roll), error);
-		if (status == MB_SUCCESS)
-			status = mb_reallocd(verbose, __FILE__, __LINE__, data_size, (void **)&(attitude->pitch), error);
-		if (status == MB_SUCCESS)
-			status = mb_reallocd(verbose, __FILE__, __LINE__, data_size, (void **)&(attitude->heave), error);
-		if (status == MB_SUCCESS)
-			status = mb_reallocd(verbose, __FILE__, __LINE__, data_size, (void **)&(attitude->heading), error);
-		if (status == MB_SUCCESS)
-			{
-			attitude->nalloc = attitude->n;
-			}
-		else
-			{
-			attitude->nalloc = 0;
-			attitude->n = 0;
-			}
-		}
-
-	for (i=0;i<attitude->n;i++)
-		{
-		mb_get_binary_short(MB_YES, &buffer[index], &(attitude->delta_time[i])); index += 2;
-		mb_get_binary_float(MB_YES, &buffer[index], &(attitude->roll[i])); index += 4;
-		mb_get_binary_float(MB_YES, &buffer[index], &(attitude->pitch[i])); index += 4;
-		mb_get_binary_float(MB_YES, &buffer[index], &(attitude->heave[i])); index += 4;
-		mb_get_binary_float(MB_YES, &buffer[index], &(attitude->heading[i])); index += 4;
-		}
-
-	/* set kind */
-	if (status == MB_SUCCESS)
-		{
-		/* set kind */
-		store->kind = MB_DATA_ATTITUDE;
-		store->type = R7KRECID_Attitude;
-
-		/* get the time */
-		time_j[0] = header->s7kTime.Year;
-		time_j[1] = header->s7kTime.Day;
-		time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-		time_j[3] = (int) header->s7kTime.Seconds;
-		time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-		mb_get_itime(verbose, time_j, store->time_i);
-		mb_get_time(verbose, store->time_i, &(store->time_d));
-		}
-	else
-		{
-		store->kind = MB_DATA_NONE;
-		}
-
-	/* print out the results */
-#ifdef MBR_RESON7KR_DEBUG
-fprintf(stderr,"R7KRECID_Attitude:                      7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d size:%d index:%d\n",
-store->time_i[0],store->time_i[1],store->time_i[2],
-store->time_i[3],store->time_i[4],store->time_i[5],store->time_i[6],
-header->RecordNumber,header->Size,index);
-#endif
-#ifdef MBR_RESON7KR_DEBUG
-	if (verbose > 0)
-#else
-	if (verbose >= 2)
-#endif
-	mbsys_reson7k_print_attitude(verbose, attitude, error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_rd_rec1022(int verbose, char *buffer, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_reson7kr_rd_rec1022";
-	int	status = MB_SUCCESS;
-	struct mbsys_reson7k_struct *store;
-	s7k_header *header;
-	s7kr_rec1022 *rec1022;
-	int	index;
-	int	time_j[5];
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       buffer:     %p\n",(void *)buffer);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	rec1022 = &(store->rec1022);
-	header = &(rec1022->header);
-
-	/* extract the header */
-	index = 0;
-	status = mbr_reson7kr_rd_header(verbose, buffer, &index, header, error);
-
-	/* extract the data */
-	index = header->Offset + 4;
-	for (i=0;i<R7KHDRSIZE_Rec1022;i++)
-		{
-		rec1022->data[i] = (mb_u_char) buffer[index]; index++;
-		}
-
-	/* set kind */
-	if (status == MB_SUCCESS)
-		{
-		/* set kind */
-		store->kind = MB_DATA_RAW_LINE;
-		store->type = R7KRECID_Rec1022;
-
-		/* get the time */
-		time_j[0] = header->s7kTime.Year;
-		time_j[1] = header->s7kTime.Day;
-		time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-		time_j[3] = (int) header->s7kTime.Seconds;
-		time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-		mb_get_itime(verbose, time_j, store->time_i);
-		mb_get_time(verbose, store->time_i, &(store->time_d));
-		}
-	else
-		{
-		store->kind = MB_DATA_NONE;
-		}
-
-	/* print out the results */
-#ifdef MBR_RESON7KR_DEBUG
-fprintf(stderr,"R7KRECID_Rec1022:                      7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d size:%d index:%d\n",
-store->time_i[0],store->time_i[1],store->time_i[2],
-store->time_i[3],store->time_i[4],store->time_i[5],store->time_i[6],
-header->RecordNumber,header->Size,index);
-#endif
-#ifdef MBR_RESON7KR_DEBUG
-	if (verbose > 0)
-#else
-	if (verbose >= 2)
-#endif
-	mbsys_reson7k_print_rec1022(verbose, rec1022, error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_rd_fsdwchannel(int verbose, int data_format, char *buffer, int *index,
-		s7k_fsdwchannel *fsdwchannel, int *error)
-{
-	char	*function_name = "mbr_reson7kr_rd_fsdwchannel";
-	int	status = MB_SUCCESS;
-	int	data_size;
-	short	*shortptr;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       data_format:%d\n",data_format);
-		fprintf(stderr,"dbg2       buffer:     %p\n",(void *)buffer);
-		fprintf(stderr,"dbg2       index:      %d\n",*index);
-		fprintf(stderr,"dbg2       fsdwchannel:%p\n",(void *)fsdwchannel);
-		}
-
-	/* extract the channel header */
-	fsdwchannel->number = (mb_u_char) buffer[*index]; (*index)++;
-	fsdwchannel->type = (mb_u_char) buffer[*index]; (*index)++;
-	fsdwchannel->data_type = (mb_u_char) buffer[*index]; (*index)++;
-	fsdwchannel->polarity = (mb_u_char) buffer[*index]; (*index)++;
-	fsdwchannel->bytespersample = (mb_u_char) buffer[*index]; (*index)++;
-	for (i=0;i<3;i++)
-		{
-		fsdwchannel->reserved1[i] = buffer[*index]; (*index)++;
-		}
-	mb_get_binary_int(MB_YES, &buffer[*index], &(fsdwchannel->number_samples)); *index += 4;
-	mb_get_binary_int(MB_YES, &buffer[*index], &(fsdwchannel->start_time)); *index += 4;
-	mb_get_binary_int(MB_YES, &buffer[*index], &(fsdwchannel->sample_interval)); *index += 4;
-	mb_get_binary_float(MB_YES, &buffer[*index], &(fsdwchannel->range)); *index += 4;
-	mb_get_binary_float(MB_YES, &buffer[*index], &(fsdwchannel->voltage)); *index += 4;
-	for (i=0;i<16;i++)
-		{
-		fsdwchannel->name[i] = buffer[*index]; (*index)++;
-		}
-	for (i=0;i<20;i++)
-		{
-		fsdwchannel->reserved2[i] = buffer[*index]; (*index)++;
-		}
-
-	/* make sure enough memory is allocated for channel data */
-	data_size = fsdwchannel->bytespersample * fsdwchannel->number_samples;
-	if (fsdwchannel->data_alloc < data_size)
-		{
-		status = mb_reallocd(verbose, __FILE__, __LINE__, data_size, (void **)&(fsdwchannel->data), error);
-		if (status != MB_SUCCESS)
-			fsdwchannel->data_alloc = 0;
-		else
-			fsdwchannel->data_alloc = data_size;
-		}
-
-	/* copy over the data */
-	if (status == MB_SUCCESS)
-		{
-		if (fsdwchannel->bytespersample == 1)
-			{
-			for (i=0;i<fsdwchannel->number_samples;i++)
-				{
-				fsdwchannel->data[i] = buffer[*index]; (*index)++;
-				}
-			}
-		else if (fsdwchannel->bytespersample == 2)
-			{
-			shortptr = (short *) fsdwchannel->data;
-			for (i=0;i<fsdwchannel->number_samples;i++)
-				{
-/*srptr = (short *) &(buffer[*index]);
-urptr = (unsigned short *) &(buffer[*index]);*/
-				mb_get_binary_short(MB_YES, &(buffer[*index]), &(shortptr[i])); *index += 2;
-/*ssptr = (short *) &(shortptr[i]);
-usptr = (unsigned short *) &(shortptr[i]);
-fprintf(stderr,"sample:%5d   raw:%6d %6d   swapped:%6d %6d\n",
-i,*srptr,*urptr,*ssptr,*usptr);*/
-				}
-			}
-		else if (fsdwchannel->bytespersample == 4)
-			{
-			shortptr = (short *) fsdwchannel->data;
-			for (i=0;i<fsdwchannel->number_samples;i++)
-				{
-/*srptr = (short *) &(buffer[*index]);
-urptr = (unsigned short *) &(buffer[*index]);*/
-				mb_get_binary_short(MB_YES, &(buffer[*index]), &(shortptr[2*i])); *index += 2;
-/*ssptr = (short *) &(shortptr[2*i]);
-usptr = (unsigned short *) &(shortptr[2*i]);
-fprintf(stderr,"sample:%5d   IMAGINARY: raw:%6d %6d   swapped:%6d %6d",
-i,*srptr,*urptr,*ssptr,*usptr);
-srptr = (short *) &(buffer[*index]);
-urptr = (unsigned short *) &(buffer[*index]);*/
-				mb_get_binary_short(MB_YES, &(buffer[*index]), &(shortptr[2*i+1])); *index += 2;
-/*ssptr = (short *) &(shortptr[2*i+1]);
-usptr = (unsigned short *) &(shortptr[2*i+1]);
-fprintf(stderr,"    REAL: raw:%6d %6d   swapped:%6d %6d\n",
-*srptr,*urptr,*ssptr,*usptr);*/
-				}
-			}
-		}
-
-	/* print out the results */
-	/*mbsys_reson7k_print_fsdwchannel(verbose, data_format, fsdwchannel, error);*/
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       index:      %d\n",*index);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_rd_fsdwssheader(int verbose, char *buffer, int *index,
-		s7k_fsdwssheader *fsdwssheader, int *error)
-{
-	char	*function_name = "mbr_reson7kr_rd_fsdwssheader";
-	int	status = MB_SUCCESS;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:        %d\n",verbose);
-		fprintf(stderr,"dbg2       buffer:         %p\n",(void *)buffer);
-		fprintf(stderr,"dbg2       index:          %d\n",*index);
-		fprintf(stderr,"dbg2       fsdwssheader:   %p\n",(void *)fsdwssheader);
-		}
-
-	/* extract the Edgetech sidescan header */
-	mb_get_binary_short(MB_YES, &buffer[*index], &(fsdwssheader->subsystem)); *index += 2;
-	mb_get_binary_short(MB_YES, &buffer[*index], &(fsdwssheader->channelNum)); *index += 2;
-	mb_get_binary_int(MB_YES, &buffer[*index], &(fsdwssheader->pingNum)); *index += 4;
-	mb_get_binary_short(MB_YES, &buffer[*index], &(fsdwssheader->packetNum)); *index += 2;
-	mb_get_binary_short(MB_YES, &buffer[*index], &(fsdwssheader->trigSource)); *index += 2;
-	mb_get_binary_int(MB_YES, &buffer[*index], &(fsdwssheader->samples)); *index += 4;
-	mb_get_binary_int(MB_YES, &buffer[*index], &(fsdwssheader->sampleInterval)); *index += 4;
-	mb_get_binary_int(MB_YES, &buffer[*index], &(fsdwssheader->startDepth)); *index += 4;
-	mb_get_binary_short(MB_YES, &buffer[*index], &(fsdwssheader->weightingFactor)); *index += 2;
-	mb_get_binary_short(MB_YES, &buffer[*index], &(fsdwssheader->ADCGain)); *index += 2;
-	mb_get_binary_short(MB_YES, &buffer[*index], &(fsdwssheader->ADCMax)); *index += 2;
-	mb_get_binary_short(MB_YES, &buffer[*index], &(fsdwssheader->rangeSetting)); *index += 2;
-	mb_get_binary_short(MB_YES, &buffer[*index], &(fsdwssheader->pulseID)); *index += 2;
-	mb_get_binary_short(MB_YES, &buffer[*index], &(fsdwssheader->markNumber)); *index += 2;
-	mb_get_binary_short(MB_YES, &buffer[*index], &(fsdwssheader->dataFormat)); *index += 2;
-	mb_get_binary_short(MB_YES, &buffer[*index], &(fsdwssheader->reserved)); *index += 2;
-	mb_get_binary_int(MB_YES, &buffer[*index], &(fsdwssheader->millisecondsToday)); *index += 4;
-	mb_get_binary_short(MB_YES, &buffer[*index], &(fsdwssheader->year)); *index += 2;
-	mb_get_binary_short(MB_YES, &buffer[*index], &(fsdwssheader->day)); *index += 2;
-	mb_get_binary_short(MB_YES, &buffer[*index], &(fsdwssheader->hour)); *index += 2;
-	mb_get_binary_short(MB_YES, &buffer[*index], &(fsdwssheader->minute)); *index += 2;
-	mb_get_binary_short(MB_YES, &buffer[*index], &(fsdwssheader->second)); *index += 2;
-	mb_get_binary_short(MB_YES, &buffer[*index], &(fsdwssheader->heading)); *index += 2;
-	mb_get_binary_short(MB_YES, &buffer[*index], &(fsdwssheader->pitch)); *index += 2;
-	mb_get_binary_short(MB_YES, &buffer[*index], &(fsdwssheader->roll)); *index += 2;
-	mb_get_binary_short(MB_YES, &buffer[*index], &(fsdwssheader->heave)); *index += 2;
-	mb_get_binary_short(MB_YES, &buffer[*index], &(fsdwssheader->yaw)); *index += 2;
-	mb_get_binary_int(MB_YES, &buffer[*index], &(fsdwssheader->depth)); *index += 4;
-	mb_get_binary_short(MB_YES, &buffer[*index], &(fsdwssheader->temperature)); *index += 2;
-	for (i=0;i<2;i++)
-		{
-		fsdwssheader->reserved2[i] = buffer[*index]; (*index)++;
-		}
-	mb_get_binary_int(MB_YES, &buffer[*index], &(fsdwssheader->longitude)); *index += 4;
-	mb_get_binary_int(MB_YES, &buffer[*index], &(fsdwssheader->latitude)); *index += 4;
-
-	/* print out the results */
-	/*mbsys_reson7k_print_fsdwssheader(verbose, fsdwssheader, error);*/
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       index:      %d\n",*index);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_rd_fsdwsegyheader(int verbose, char *buffer, int *index,
-		s7k_fsdwsegyheader *fsdwsegyheader, int *error)
-{
-	char	*function_name = "mbr_reson7kr_rd_fsdwsegyheader";
-	int	status = MB_SUCCESS;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:        %d\n",verbose);
-		fprintf(stderr,"dbg2       buffer:         %p\n",(void *)buffer);
-		fprintf(stderr,"dbg2       index:          %d\n",*index);
-		fprintf(stderr,"dbg2       fsdwsegyheader: %p\n",(void *)fsdwsegyheader);
-		}
-
-	/* extract the Edgetech segy header */
-	mb_get_binary_int(MB_YES, &buffer[*index], &(fsdwsegyheader->sequenceNumber)); *index += 4;
-	mb_get_binary_int(MB_YES, &buffer[*index], &(fsdwsegyheader->startDepth)); *index += 4;
-	mb_get_binary_int(MB_YES, &buffer[*index], &(fsdwsegyheader->pingNum)); *index += 4;
-	mb_get_binary_int(MB_YES, &buffer[*index], &(fsdwsegyheader->channelNum)); *index += 4;
-	for (i=0;i<6;i++)
-		{
-		mb_get_binary_short(MB_YES, &buffer[*index], &(fsdwsegyheader->unused1[i])); *index += 2;
-		}
-	mb_get_binary_short(MB_YES, &buffer[*index], &(fsdwsegyheader->traceIDCode)); *index += 2;
-	for (i=0;i<2;i++)
-		{
-		mb_get_binary_short(MB_YES, &buffer[*index], &(fsdwsegyheader->unused2[i])); *index += 2;
-		}
-	mb_get_binary_short(MB_YES, &buffer[*index], &(fsdwsegyheader->dataFormat)); *index += 2;
-	mb_get_binary_short(MB_YES, &buffer[*index], &(fsdwsegyheader->NMEAantennaeR)); *index += 2;
-	mb_get_binary_short(MB_YES, &buffer[*index], &(fsdwsegyheader->NMEAantennaeO)); *index += 2;
-	for (i=0;i<32;i++)
-		{
-		fsdwsegyheader->RS232[i] = buffer[*index]; (*index)++;
-		}
-	mb_get_binary_int(MB_YES, &buffer[*index], &(fsdwsegyheader->sourceCoordX)); *index += 4;
-	mb_get_binary_int(MB_YES, &buffer[*index], &(fsdwsegyheader->sourceCoordY)); *index += 4;
-	mb_get_binary_int(MB_YES, &buffer[*index], &(fsdwsegyheader->groupCoordX)); *index += 4;
-	mb_get_binary_int(MB_YES, &buffer[*index], &(fsdwsegyheader->groupCoordY)); *index += 4;
-	mb_get_binary_short(MB_YES, &buffer[*index], &(fsdwsegyheader->coordUnits)); *index += 2;
-	for (i=0;i<24;i++)
-		{
-		fsdwsegyheader->annotation[i] = buffer[*index]; (*index)++;
-		}
- 	mb_get_binary_short(MB_YES, &buffer[*index], &(fsdwsegyheader->samples)); *index += 2;
-	mb_get_binary_int(MB_YES, &buffer[*index], &(fsdwsegyheader->sampleInterval)); *index += 4;
- 	mb_get_binary_short(MB_YES, &buffer[*index], &(fsdwsegyheader->ADCGain)); *index += 2;
-	mb_get_binary_short(MB_YES, &buffer[*index], &(fsdwsegyheader->pulsePower)); *index += 2;
-	mb_get_binary_short(MB_YES, &buffer[*index], &(fsdwsegyheader->correlated)); *index += 2;
- 	mb_get_binary_short(MB_YES, &buffer[*index], &(fsdwsegyheader->startFreq)); *index += 2;
- 	mb_get_binary_short(MB_YES, &buffer[*index], &(fsdwsegyheader->endFreq)); *index += 2;
- 	mb_get_binary_short(MB_YES, &buffer[*index], &(fsdwsegyheader->sweepLength)); *index += 2;
-	for (i=0;i<4;i++)
-		{
-		mb_get_binary_short(MB_YES, &buffer[*index], &(fsdwsegyheader->unused7[i])); *index += 2;
-		}
- 	mb_get_binary_short(MB_YES, &buffer[*index], &(fsdwsegyheader->aliasFreq)); *index += 2;
- 	mb_get_binary_short(MB_YES, &buffer[*index], &(fsdwsegyheader->pulseID)); *index += 2;
-	for (i=0;i<6;i++)
-		{
-		mb_get_binary_short(MB_YES, &buffer[*index], &(fsdwsegyheader->unused8[i])); *index += 2;
-		}
-	mb_get_binary_short(MB_YES, &buffer[*index], &(fsdwsegyheader->year)); *index += 2;
-	mb_get_binary_short(MB_YES, &buffer[*index], &(fsdwsegyheader->day)); *index += 2;
-	mb_get_binary_short(MB_YES, &buffer[*index], &(fsdwsegyheader->hour)); *index += 2;
-	mb_get_binary_short(MB_YES, &buffer[*index], &(fsdwsegyheader->minute)); *index += 2;
-	mb_get_binary_short(MB_YES, &buffer[*index], &(fsdwsegyheader->second)); *index += 2;
-	mb_get_binary_short(MB_YES, &buffer[*index], &(fsdwsegyheader->timeBasis)); *index += 2;
-	mb_get_binary_short(MB_YES, &buffer[*index], &(fsdwsegyheader->weightingFactor)); *index += 2;
-	mb_get_binary_short(MB_YES, &buffer[*index], &(fsdwsegyheader->unused9)); *index += 2;
-	mb_get_binary_short(MB_YES, &buffer[*index], &(fsdwsegyheader->heading)); *index += 2;
-	mb_get_binary_short(MB_YES, &buffer[*index], &(fsdwsegyheader->pitch)); *index += 2;
-	mb_get_binary_short(MB_YES, &buffer[*index], &(fsdwsegyheader->roll)); *index += 2;
-	mb_get_binary_short(MB_YES, &buffer[*index], &(fsdwsegyheader->temperature)); *index += 2;
-	mb_get_binary_short(MB_YES, &buffer[*index], &(fsdwsegyheader->heaveCompensation)); *index += 2;
-	mb_get_binary_short(MB_YES, &buffer[*index], &(fsdwsegyheader->trigSource)); *index += 2;
- 	mb_get_binary_short(MB_YES, &buffer[*index], &(fsdwsegyheader->markNumber)); *index += 2;
-	mb_get_binary_short(MB_YES, &buffer[*index], &(fsdwsegyheader->NMEAHour)); *index += 2;
-	mb_get_binary_short(MB_YES, &buffer[*index], &(fsdwsegyheader->NMEAMinutes)); *index += 2;
-	mb_get_binary_short(MB_YES, &buffer[*index], &(fsdwsegyheader->NMEASeconds)); *index += 2;
-	mb_get_binary_short(MB_YES, &buffer[*index], &(fsdwsegyheader->NMEACourse)); *index += 2;
-	mb_get_binary_short(MB_YES, &buffer[*index], &(fsdwsegyheader->NMEASpeed)); *index += 2;
-	mb_get_binary_short(MB_YES, &buffer[*index], &(fsdwsegyheader->NMEADay)); *index += 2;
-	mb_get_binary_short(MB_YES, &buffer[*index], &(fsdwsegyheader->NMEAYear)); *index += 2;
-	mb_get_binary_int(MB_YES, &buffer[*index], &(fsdwsegyheader->millisecondsToday)); *index += 4;
- 	mb_get_binary_short(MB_YES, &buffer[*index], &(fsdwsegyheader->ADCMax)); *index += 2;
-	mb_get_binary_short(MB_YES, &buffer[*index], &(fsdwsegyheader->calConst)); *index += 2;
-	mb_get_binary_short(MB_YES, &buffer[*index], &(fsdwsegyheader->vehicleID)); *index += 2;
-	for (i=0;i<6;i++)
-		{
-		fsdwsegyheader->softwareVersion[i] = buffer[*index]; (*index)++;
-		}
-	mb_get_binary_int(MB_YES, &buffer[*index], &(fsdwsegyheader->sphericalCorrection)); *index += 4;
- 	mb_get_binary_short(MB_YES, &buffer[*index], &(fsdwsegyheader->packetNum)); *index += 2;
-	mb_get_binary_short(MB_YES, &buffer[*index], &(fsdwsegyheader->ADCDecimation)); *index += 2;
-	mb_get_binary_short(MB_YES, &buffer[*index], &(fsdwsegyheader->decimation)); *index += 2;
-	for (i=0;i<7;i++)
-		{
-		mb_get_binary_short(MB_YES, &buffer[*index], &(fsdwsegyheader->unuseda[i])); *index += 2;
-		}
-
-	/* print out the results */
-	/*mbsys_reson7k_print_fsdwsegyheader(verbose, fsdwsegyheader, error);*/
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       index:      %d\n",*index);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_rd_fsdwsslo(int verbose, char *buffer, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_reson7kr_rd_fsdwsslo";
-	int	status = MB_SUCCESS;
-	struct mbsys_reson7k_struct *store;
-	s7k_header *header;
-	s7kr_fsdwss *fsdwsslo;
-	s7k_fsdwchannel *fsdwchannel;
-	s7k_fsdwssheader *fsdwssheader;
-	s7kr_bathymetry *bathymetry;
-	s7kr_bluefin *bluefin;
-	int	index;
-	int	time_i[7], time_j[5];
-	double	edgetech_time_d, s7k_time_d, bathy_time_d;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       buffer:     %p\n",(void *)buffer);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	fsdwsslo = &(store->fsdwsslo);
-	header = &(fsdwsslo->header);
-	bathymetry = &(store->bathymetry);
-	bluefin = &(store->bluefin);
-
-	/* extract the header */
-	index = 0;
-	status = mbr_reson7kr_rd_header(verbose, buffer, &index, header, error);
-
-	/* extract the data */
-	index = header->Offset + 4;
-	mb_get_binary_int(MB_YES, &buffer[index], &(fsdwsslo->msec_timestamp)); index += 4;
-	mb_get_binary_int(MB_YES, &buffer[index], &(fsdwsslo->ping_number)); index += 4;
-	mb_get_binary_int(MB_YES, &buffer[index], &(fsdwsslo->number_channels)); index += 4;
-	mb_get_binary_int(MB_YES, &buffer[index], &(fsdwsslo->total_bytes)); index += 4;
-	mb_get_binary_int(MB_YES, &buffer[index], &(fsdwsslo->data_format));index += 4;
-	index += 12;
-	for (i=0;i<2;i++)
-		{
-		fsdwchannel = &(fsdwsslo->channel[i]);
-		mbr_reson7kr_rd_fsdwchannel(verbose, fsdwsslo->data_format, buffer, &index, fsdwchannel, error);
-		}
-/*fprintf(stderr,"In mbr_reson7kr_rd_fsdwsslo: index:%d OffsetToOptionalData:%d\n",
-index, header->OffsetToOptionalData);
-	index = header->OffsetToOptionalData;*/
-	for (i=0;i<2;i++)
-		{
-		fsdwssheader = &(fsdwsslo->ssheader[i]);
-		mbr_reson7kr_rd_fsdwssheader(verbose, buffer, &index, fsdwssheader, error);
-		}
-
-	/* set kind */
-	if (status == MB_SUCCESS)
-		{
-		/* set kind */
-		store->kind = MB_DATA_SIDESCAN2;
-		store->type = R7KRECID_FSDWsidescan;
-		store->sstype = R7KRECID_FSDWsidescanLo;
-
-		/* get the time from the original Edgetech header */
-		time_j[0] = fsdwssheader->year;
-		time_j[1] = fsdwssheader->day;
-		time_j[2] = 60 * fsdwssheader->hour + fsdwssheader->minute;
-		time_j[3] = fsdwssheader->second;
-		time_j[4] = 1000 * (fsdwssheader->millisecondsToday
-					- 1000 * ((int)(0.001 * fsdwssheader->millisecondsToday)));
-		mb_get_itime(verbose, time_j, time_i);
-		mb_get_time(verbose, time_i, &(edgetech_time_d));
-
-		/* get the time from the 6046 datalogger header */
-		time_j[0] = header->s7kTime.Year;
-		time_j[1] = header->s7kTime.Day;
-		time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-		time_j[3] = (int) header->s7kTime.Seconds;
-		time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-		mb_get_itime(verbose, time_j, time_i);
-		mb_get_time(verbose, time_i, &(s7k_time_d));
-
-		/* get the time from the last bathymetry record */
-		time_j[0] = bathymetry->header.s7kTime.Year;
-		time_j[1] = bathymetry->header.s7kTime.Day;
-		time_j[2] = 60 * bathymetry->header.s7kTime.Hours + bathymetry->header.s7kTime.Minutes;
-		time_j[3] = (int) bathymetry->header.s7kTime.Seconds;
-		time_j[4] = (int) (1000000 * (bathymetry->header.s7kTime.Seconds - time_j[3]));
-		mb_get_itime(verbose, time_j, time_i);
-		mb_get_time(verbose, time_i, &(bathy_time_d));
-
-		/* figure out offset between 7k timestamp and Edgetech timestamp */
-#ifdef MBR_RESON7KR_DEBUG
-fprintf(stderr,"%s: 7k time offset: %f    7ktime:%f Edgetech:%f Bathymetry:%f\n",
-function_name, edgetech_time_d - bathy_time_d, s7k_time_d, edgetech_time_d, bathy_time_d);
-#endif
-
-		/* Use the Edgetech timestamp */
-		store->time_d = edgetech_time_d;
-		mb_get_date(verbose, store->time_d, store->time_i);
-
-		/* use Edgetech time for early MBARI SBP missions with
-			bad time synching, otherwise use 7K timestamp */
-		/*if (header->s7kTime.Year == 2004)
-			{
-			/\* get the time from the original Edgetech header *\/
-			time_j[0] = fsdwssheader->year;
-			time_j[1] = fsdwssheader->day;
-			time_j[2] = 60 * fsdwssheader->hour + fsdwssheader->minute;
-			time_j[3] = fsdwssheader->second;
-			time_j[4] = 1000 * (fsdwssheader->millisecondsToday
-						- 1000 * ((int)(0.001 * fsdwssheader->millisecondsToday)));
-			}
-
-		else
-			{
-			/\* get the time from the 6046 datalogger header *\/
-			time_j[0] = header->s7kTime.Year;
-			time_j[1] = header->s7kTime.Day;
-			time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-			time_j[3] = (int) header->s7kTime.Seconds;
-			time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-			}
-
-		mb_get_itime(verbose, time_j, store->time_i);
-		mb_get_time(verbose, store->time_i, &(store->time_d));*/
-		}
-	else
-		{
-		store->kind = MB_DATA_NONE;
-		}
-
-	/* print out the results */
-#ifdef MBR_RESON7KR_DEBUG
-	if (verbose > 0)
-#else
-	if (verbose >= 2)
-#endif
-	mbsys_reson7k_print_fsdwss(verbose, fsdwsslo, error);
-#ifdef MBR_RESON7KR_DEBUG
-for (i=0;i<fsdwsslo->number_channels;i++)
-{
-mb_get_date(verbose, s7k_time_d, time_i);
-fsdwchannel = &(fsdwsslo->channel[i]);
-fsdwssheader = &(fsdwsslo->ssheader[i]);
-fprintf(stderr,"R7KRECID_FSDWsidescanLo:           7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) FSDWtime(%4.4d-%3.3d %2.2d:%2.2d:%2.2d.%3.3d) ping:%d %d chan:%d %d sampint:%d %d\n",
-time_i[0],time_i[1],time_i[2],
-time_i[3],time_i[4],time_i[5],time_i[6],
-fsdwssheader->year,fsdwssheader->day,fsdwssheader->hour,fsdwssheader->minute,fsdwssheader->second,
-fsdwssheader->millisecondsToday - 1000 * (int)(0.001 * fsdwssheader->millisecondsToday),
-fsdwsslo->ping_number,fsdwssheader->pingNum,
-fsdwchannel->number,fsdwssheader->channelNum,
-fsdwchannel->sample_interval,fsdwssheader->sampleInterval);
-}
-#endif
-
-	/* get sonar_depth and altitude if possible */
-/*
-	if (bluefin->nav[0].depth > 0.0)
-		survey->sonar_depth = bluefin->nav[0].depth;
-	if (bluefin->nav[0].altitude > 0.0)
-		survey->sonar_altitude = bluefin->nav[0].altitude;
-	if (bluefin->environmental[0].sound_speed > 0.0)
-		sound_speed = bluefin->environmental[0].sound_speed;
-	else
-		sound_speed = 1500.0;
-	half_sound_speed = 0.5 * sound_speed;
-*/
-
-	/* if necessary get first arrival and treat as altitude */
-/*
-	if (survey->sonar_altitude == 0.0)
-		{
-		bottompick = fsdwchannel->number_samples;
-		for (i=0;i<2;i++)
-			{
-			fsdwchannel = &(fsdwsslo->channel[i]);
-			shortptr = (short *) fsdwchannel->data;
-			ushortptr = (unsigned short *) fsdwchannel->data;
-			if (fsdwsslo->data_format == EDGETECH_TRACEFORMAT_ENVELOPE)
-				pickvalue = (double) ushortptr[0];
-			else if (fsdwsslo->data_format == EDGETECH_TRACEFORMAT_ANALYTIC)
-				pickvalue = sqrt((double) (shortptr[0] * shortptr[0] + shortptr[1] * shortptr[1]));
-			else if (fsdwsslo->data_format == EDGETECH_TRACEFORMAT_RAW)
-				pickvalue = fabs((double) ushortptr[0]);
-			else if (fsdwsslo->data_format == EDGETECH_TRACEFORMAT_REALANALYTIC)
-				pickvalue = fabs((double) ushortptr[0]);
-			else if (fsdwsslo->data_format == EDGETECH_TRACEFORMAT_PIXEL)
-				pickvalue = (double) ushortptr[0];
-			pickvalue = MAX(40 * pickvalue, 80.0);
-			for (j=0;j<fsdwchannel->number_samples;j++)
-				{
-				if (fsdwsslo->data_format == EDGETECH_TRACEFORMAT_ENVELOPE)
-					value = (double) ushortptr[j];
-				else if (fsdwsslo->data_format == EDGETECH_TRACEFORMAT_ANALYTIC)
-					value = sqrt((double) (shortptr[2*j] * shortptr[2*j] + shortptr[2*j+1] * shortptr[2*j+1]));
-				else if (fsdwsslo->data_format == EDGETECH_TRACEFORMAT_RAW)
-					value = (double) ushortptr[j];
-				else if (fsdwsslo->data_format == EDGETECH_TRACEFORMAT_REALANALYTIC)
-					value = (double) ushortptr[j];
-				else if (fsdwsslo->data_format == EDGETECH_TRACEFORMAT_PIXEL)
-					value = (double) ushortptr[j];
-				if (bottompick > j && fabs(value) > pickvalue)
-					{
-					bottompick = j;
-					survey->sonar_altitude = half_sound_speed * bottompick * 0.000001 * fsdwchannel->sample_interval;
-					}
-				}
-			}
-		}
-	else
-		{
-		bottompick = survey->sonar_altitude / (half_sound_speed * 0.000001 * fsdwchannel->sample_interval);
-		}
-*/
-
-	/* insert sslo data into survey structure */
-/*
-	tracemax = 0.0;
-	pixelsize = (fsdwsslo->channel[0].range + fsdwsslo->channel[1].range) / 1024;
-	for (j=0;j<1024;j++)
-		{
-		bin[j] = 0.0;
-		nbin[j] = 0;
-		}
-	for (i=0;i<2;i++)
-		{
-		fsdwchannel = &(fsdwsslo->channel[i]);
-		shortptr = (short *) fsdwchannel->data;
-		ushortptr = (short *) fsdwchannel->data;
-		survey->number_sslow_pixels = 1024;
-		for (j=bottompick;j<fsdwchannel->number_samples;j++)
-			{
-			if (i == 0)
-				{
-				sign = -1.0;
-				k = fsdwchannel->number_samples - (j - bottompick);
-				}
-			else
-				{
-				sign = 1.0;
-				k = fsdwchannel->number_samples + (j - bottompick);
-				}
-			if (fsdwsslo->data_format == EDGETECH_TRACEFORMAT_ENVELOPE)
-				value = (double) ushortptr[j];
-			else if (fsdwsslo->data_format == EDGETECH_TRACEFORMAT_ANALYTIC)
-				value = sqrt((double) (shortptr[2*j] * shortptr[2*j] + shortptr[2*j+1] * shortptr[2*j+1]));
-			else if (fsdwsslo->data_format == EDGETECH_TRACEFORMAT_RAW)
-				value = (double) ushortptr[j];
-			else if (fsdwsslo->data_format == EDGETECH_TRACEFORMAT_REALANALYTIC)
-				value = (double) ushortptr[j];
-			else if (fsdwsslo->data_format == EDGETECH_TRACEFORMAT_PIXEL)
-				value = (double) ushortptr[j];
-			tracemax = MAX(tracemax, value);
-			range = half_sound_speed * j * 0.000001 * fsdwchannel->sample_interval;
-			xtrack = sign * sqrt(fabs(range * range
-						- survey->sonar_altitude * survey->sonar_altitude));
-			k = (xtrack / pixelsize) + 512;
-			if (k < 0) k = 0;
-			if (k > 1023) k = 1023;
-			bin[k] += value * value;
-			nbin[k]++;
-			}
-		}
-	for (j=0;j<1024;j++)
-		{
-		if (nbin[j] > 0)
-			survey->sslow[j] = sqrt(bin[j]) / nbin[j];
-		else
-			survey->sslow[j] = 0.0;
-		survey->sslow_acrosstrack[j] = pixelsize * (j - 512);;
-		survey->sslow_alongtrack[j] = 0.0;
-		}
-*/
-
-/*fprintf(stderr,"altitude:%f depth:%f sv:%f heading:%f bottompick:%d weight:%d ADCGain:%d ADCMax:%d max:%f\n",
-survey->sonar_altitude,survey->sonar_depth,sound_speed,survey->heading,bottompick,
-fsdwssheader->weightingFactor,fsdwssheader->ADCGain,fsdwssheader->ADCMax,tracemax);
-fprintf(stderr,"\n\nbottompick:%d altitude:%f pixelsize:%f\n",bottompick,survey->sonar_altitude,pixelsize);
-for (j=0;j<fsdwchannel->number_samples;j++)
-{
-fsdwchannel = &(fsdwsslo->channel[0]);
-ushortptr = (unsigned short *) fsdwchannel->data;
-value = (double) ushortptr[j];
-fprintf(stderr,"SSL[%5d]: %10.0f",j,value);
-fsdwchannel = &(fsdwsslo->channel[1]);
-ushortptr = (unsigned short *) fsdwchannel->data;
-value = (double) ushortptr[j];
-fprintf(stderr," %10.0f",value);
-if (j == bottompick) fprintf(stderr," BOTTOMPICK");
-fprintf(stderr,"\n");
-}*/
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_rd_fsdwsshi(int verbose, char *buffer, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_reson7kr_rd_fsdwsshi";
-	int	status = MB_SUCCESS;
-	struct mbsys_reson7k_struct *store;
-	s7k_header *header;
-	s7kr_fsdwss *fsdwsshi;
-	s7k_fsdwchannel *fsdwchannel;
-	s7k_fsdwssheader *fsdwssheader;
-	s7kr_bathymetry *bathymetry;
-	int	index;
-	int	time_i[7], time_j[5];
-	double	edgetech_time_d, s7k_time_d, bathy_time_d;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       buffer:     %p\n",(void *)buffer);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	fsdwsshi = &(store->fsdwsshi);
-	header = &(fsdwsshi->header);
-	bathymetry = &(store->bathymetry);
-
-	/* extract the header */
-	index = 0;
-	status = mbr_reson7kr_rd_header(verbose, buffer, &index, header, error);
-
-	/* extract the data */
-	index = header->Offset + 4;
-	mb_get_binary_int(MB_YES, &buffer[index], &(fsdwsshi->msec_timestamp)); index += 4;
-	mb_get_binary_int(MB_YES, &buffer[index], &(fsdwsshi->ping_number)); index += 4;
-	mb_get_binary_int(MB_YES, &buffer[index], &(fsdwsshi->number_channels)); index += 4;
-	mb_get_binary_int(MB_YES, &buffer[index], &(fsdwsshi->total_bytes)); index += 4;
-	mb_get_binary_int(MB_YES, &buffer[index], &(fsdwsshi->data_format));index += 4;
-	index += 12;
-	for (i=0;i<2;i++)
-		{
-		fsdwchannel = &(fsdwsshi->channel[i]);
-		mbr_reson7kr_rd_fsdwchannel(verbose, fsdwsshi->data_format, buffer, &index, fsdwchannel, error);
-		}
-/*fprintf(stderr,"In mbr_reson7kr_rd_fsdwsshi: index:%d OffsetToOptionalData:%d\n",
-index, header->OffsetToOptionalData);
-	index = header->OffsetToOptionalData;*/
-	for (i=0;i<2;i++)
-		{
-		fsdwssheader = &(fsdwsshi->ssheader[i]);
-		mbr_reson7kr_rd_fsdwssheader(verbose, buffer, &index, fsdwssheader, error);
-		}
-
-	/* set kind */
-	if (status == MB_SUCCESS)
-		{
-		/* set kind */
-		store->kind = MB_DATA_SIDESCAN3;
-		store->type = R7KRECID_FSDWsidescan;
-		store->sstype = R7KRECID_FSDWsidescanHi;
-
-		/* get the time from the original Edgetech header */
-		time_j[0] = fsdwssheader->year;
-		time_j[1] = fsdwssheader->day;
-		time_j[2] = 60 * fsdwssheader->hour + fsdwssheader->minute;
-		time_j[3] = fsdwssheader->second;
-		time_j[4] = 1000 * (fsdwssheader->millisecondsToday
-					- 1000 * ((int)(0.001 * fsdwssheader->millisecondsToday)));
-		mb_get_itime(verbose, time_j, time_i);
-		mb_get_time(verbose, time_i, &(edgetech_time_d));
-
-		/* get the time from the 6046 datalogger header */
-		time_j[0] = header->s7kTime.Year;
-		time_j[1] = header->s7kTime.Day;
-		time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-		time_j[3] = (int) header->s7kTime.Seconds;
-		time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-		mb_get_itime(verbose, time_j, time_i);
-		mb_get_time(verbose, time_i, &(s7k_time_d));
-
-		/* get the time from the last bathymetry record */
-		time_j[0] = bathymetry->header.s7kTime.Year;
-		time_j[1] = bathymetry->header.s7kTime.Day;
-		time_j[2] = 60 * bathymetry->header.s7kTime.Hours + bathymetry->header.s7kTime.Minutes;
-		time_j[3] = (int) bathymetry->header.s7kTime.Seconds;
-		time_j[4] = (int) (1000000 * (bathymetry->header.s7kTime.Seconds - time_j[3]));
-		mb_get_itime(verbose, time_j, time_i);
-		mb_get_time(verbose, time_i, &(bathy_time_d));
-
-		/* figure out offset between 7k timestamp and Edgetech timestamp */
-#ifdef MBR_RESON7KR_DEBUG
-fprintf(stderr,"%s: 7k time offset: %f    7ktime:%f Edgetech:%f Bathymetry:%f\n",
-function_name, edgetech_time_d - bathy_time_d, s7k_time_d, edgetech_time_d, bathy_time_d);
-#endif
-
-		/* use Edgetech time */
-		store->time_d = edgetech_time_d;
-		mb_get_date(verbose, edgetech_time_d, store->time_i);
-
-		/* use Edgetech time for early MBARI SBP missions with
-			bad time synching, otherwise use 7K timestamp */
-		/*if (header->s7kTime.Year == 2004)
-			{
-			/\* get the time from the original Edgetech header *\/
-			time_j[0] = fsdwssheader->year;
-			time_j[1] = fsdwssheader->day;
-			time_j[2] = 60 * fsdwssheader->hour + fsdwssheader->minute;
-			time_j[3] = fsdwssheader->second;
-			time_j[4] = 1000 * (fsdwssheader->millisecondsToday
-						- 1000 * ((int)(0.001 * fsdwssheader->millisecondsToday)));
-			}
-
-		else
-			{
-			/\* get the time from the 6046 datalogger header *\/
-			time_j[0] = header->s7kTime.Year;
-			time_j[1] = header->s7kTime.Day;
-			time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-			time_j[3] = (int) header->s7kTime.Seconds;
-			time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-			}
-
-		mb_get_itime(verbose, time_j, store->time_i);
-		mb_get_time(verbose, store->time_i, &(store->time_d));*/
-		}
-	else
-		{
-		store->kind = MB_DATA_NONE;
-		}
-
-	/* print out the results */
-#ifdef MBR_RESON7KR_DEBUG
-	if (verbose > 0)
-#else
-	if (verbose >= 2)
-#endif
-	mbsys_reson7k_print_fsdwss(verbose, fsdwsshi, error);
-#ifdef MBR_RESON7KR_DEBUG
-for (i=0;i<fsdwsshi->number_channels;i++)
-{
-mb_get_date(verbose, s7k_time_d, time_i);
-fsdwchannel = &(fsdwsshi->channel[i]);
-fsdwssheader = &(fsdwsshi->ssheader[i]);
-fprintf(stderr,"R7KRECID_FSDWsidescanHi:           7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) FSDWtime(%4.4d-%3.3d %2.2d:%2.2d:%2.2d.%3.3d) ping:%d %d chan:%d %d sampint:%d %d\n",
-time_i[0],time_i[1],time_i[2],
-time_i[3],time_i[4],time_i[5],time_i[6],
-fsdwssheader->year,fsdwssheader->day,fsdwssheader->hour,fsdwssheader->minute,fsdwssheader->second,
-fsdwssheader->millisecondsToday - 1000 * (int)(0.001 * fsdwssheader->millisecondsToday),
-fsdwsshi->ping_number,fsdwssheader->pingNum,
-fsdwchannel->number,fsdwssheader->channelNum,
-fsdwchannel->sample_interval,fsdwssheader->sampleInterval);
-}
-#endif
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_rd_fsdwsb(int verbose, char *buffer, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_reson7kr_rd_fsdwsb";
-	int	status = MB_SUCCESS;
-	struct mbsys_reson7k_struct *store;
-	s7k_header *header;
-	s7kr_fsdwsb *fsdwsb;
-	s7k_fsdwchannel *fsdwchannel;
-	s7k_fsdwsegyheader *fsdwsegyheader;
-	s7kr_bathymetry		*bathymetry;
-	int	index;
-	int	time_i[7], time_j[5];
-	double	edgetech_time_d, s7k_time_d, bathy_time_d;
-#ifdef MBR_RESON7KR_DEBUG
-	int i;
-#endif
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       buffer:     %p\n",(void *)buffer);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	fsdwsb = &(store->fsdwsb);
-	header = &(fsdwsb->header);
-	bathymetry = &store->bathymetry;
-
-	/* extract the header */
-	index = 0;
-	status = mbr_reson7kr_rd_header(verbose, buffer, &index, header, error);
-
-	/* extract the data */
-	index = header->Offset + 4;
-	mb_get_binary_int(MB_YES, &buffer[index], &(fsdwsb->msec_timestamp)); index += 4;
-	mb_get_binary_int(MB_YES, &buffer[index], &(fsdwsb->ping_number)); index += 4;
-	mb_get_binary_int(MB_YES, &buffer[index], &(fsdwsb->number_channels)); index += 4;
-	mb_get_binary_int(MB_YES, &buffer[index], &(fsdwsb->total_bytes)); index += 4;
-	mb_get_binary_int(MB_YES, &buffer[index], &(fsdwsb->data_format));index += 4;
-	index += 12;
-	fsdwchannel = &(fsdwsb->channel);
-	mbr_reson7kr_rd_fsdwchannel(verbose, fsdwsb->data_format, buffer, &index, fsdwchannel, error);
-/* fprintf(stderr,"index:%d offset:%d\n",index,header->OffsetToOptionalData);*/
-	fsdwsegyheader = &(fsdwsb->segyheader);
-	mbr_reson7kr_rd_fsdwsegyheader(verbose, buffer, &index, fsdwsegyheader, error);
-
-	/* set kind */
-	if (status == MB_SUCCESS)
-		{
-		/* set kind */
-		store->kind = MB_DATA_SUBBOTTOM_SUBBOTTOM;
-		store->type = R7KRECID_FSDWsubbottom;
-
-		/* get the time from the original Edgetech header */
-		time_j[0] = fsdwsegyheader->year;
-		time_j[1] = fsdwsegyheader->day;
-		time_j[2] = 60 * fsdwsegyheader->hour + fsdwsegyheader->minute;
-		time_j[3] = fsdwsegyheader->second;
-		time_j[4] = 1000 * (fsdwsegyheader->millisecondsToday
-					- 1000 * ((int)(0.001 * fsdwsegyheader->millisecondsToday)));
-		mb_get_itime(verbose, time_j, time_i);
-		mb_get_time(verbose, time_i, &(edgetech_time_d));
-
-		/* get the time from the 6046 datalogger header */
-		time_j[0] = header->s7kTime.Year;
-		time_j[1] = header->s7kTime.Day;
-		time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-		time_j[3] = (int) header->s7kTime.Seconds;
-		time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-		mb_get_itime(verbose, time_j, time_i);
-		mb_get_time(verbose, time_i, &(s7k_time_d));
-
-		/* get the time from the last bathymetry record */
-		time_j[0] = bathymetry->header.s7kTime.Year;
-		time_j[1] = bathymetry->header.s7kTime.Day;
-		time_j[2] = 60 * bathymetry->header.s7kTime.Hours + bathymetry->header.s7kTime.Minutes;
-		time_j[3] = (int) bathymetry->header.s7kTime.Seconds;
-		time_j[4] = (int) (1000000 * (bathymetry->header.s7kTime.Seconds - time_j[3]));
-		mb_get_itime(verbose, time_j, time_i);
-		mb_get_time(verbose, time_i, &(bathy_time_d));
-
-		/* figure out offset between 7k timestamp and Edgetech timestamp */
-#ifdef MBR_RESON7KR_DEBUG
-fprintf(stderr,"%s: 7k time offset: %f    7ktime:%f Edgetech:%f Bathymetry:%f\n",
-function_name, edgetech_time_d - bathy_time_d, s7k_time_d, edgetech_time_d, bathy_time_d);
-#endif
-
-		/* Use the Edgetech timestamp */
-		store->time_d = edgetech_time_d;
-		mb_get_date(verbose, store->time_d, store->time_i);
-
-		/* use Edgetech time */
-		store->time_d = edgetech_time_d;
-		mb_get_date(verbose, edgetech_time_d, store->time_i);
-
-		/* use Edgetech time for early MBARI SBP missions with
-			bad time synching, otherwise use 7K timestamp */
-		/*if (header->s7kTime.Year == 2004)
-			{
-			/\* get the time from the original Edgetech header *\/
-			time_j[0] = fsdwsegyheader->year;
-			time_j[1] = fsdwsegyheader->day;
-			time_j[2] = 60 * fsdwsegyheader->hour + fsdwsegyheader->minute;
-			time_j[3] = fsdwsegyheader->second;
-			time_j[4] = 1000 * (fsdwsegyheader->millisecondsToday
-						- 1000 * ((int)(0.001 * fsdwsegyheader->millisecondsToday)));
-			}
-
-		else
-			{
-			/\* get the time from the 6046 datalogger header *\/
-			time_j[0] = header->s7kTime.Year;
-			time_j[1] = header->s7kTime.Day;
-			time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-			time_j[3] = (int) header->s7kTime.Seconds;
-			time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-			}
-
-		mb_get_itime(verbose, time_j, store->time_i);
-		mb_get_time(verbose, store->time_i, &(store->time_d));*/
-		}
-	else
-		{
-		store->kind = MB_DATA_NONE;
-		}
-
-	/* print out the results */
-#ifdef MBR_RESON7KR_DEBUG
-	if (verbose > 0)
-#else
-	if (verbose >= 2)
-#endif
-	mbsys_reson7k_print_fsdwsb(verbose, fsdwsb, error);
-#ifdef MBR_RESON7KR_DEBUG
-for (i=0;i<fsdwsb->number_channels;i++)
-{
-mb_get_date(verbose, s7k_time_d, time_i);
-fsdwchannel = &(fsdwsb->channel);
-fsdwsegyheader = &(fsdwsb->segyheader);
-fprintf(stderr,"R7KRECID_FSDWsubbottom:            7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) FSDWtime(%4.4d-%3.3d %2.2d:%2.2d:%2.2d.%3.3d) ping:%d %d chan:%d %d sampint:%d %d\n",
-time_i[0],time_i[1],time_i[2],
-time_i[3],time_i[4],time_i[5],time_i[6],
-fsdwsegyheader->year,fsdwsegyheader->day,fsdwsegyheader->hour,fsdwsegyheader->minute,fsdwsegyheader->second,
-fsdwsegyheader->millisecondsToday - 1000 * (int)(0.001 * fsdwsegyheader->millisecondsToday),
-fsdwsb->ping_number,fsdwsegyheader->pingNum,
-fsdwchannel->number,fsdwsegyheader->channelNum,
-fsdwchannel->sample_interval,fsdwsegyheader->sampleInterval);
-}
-#endif
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_rd_bluefin(int verbose, char *buffer, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_reson7kr_rd_bluefin";
-	int	status = MB_SUCCESS;
-	struct mbsys_reson7k_struct *store;
-	s7k_header *header;
-	s7kr_bluefin *bluefin;
-	int	index;
-	int	time_j[5];
-	double	time_d;
-	int	timeproblem;
-	int	i, j;
-#ifdef MBR_RESON7KR_DEBUG
-	int	time_i[7];
-#endif
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       buffer:     %p\n",(void *)buffer);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	bluefin = &(store->bluefin);
-	header = &(bluefin->header);
-
-	/* extract the header */
-	index = 0;
-	status = mbr_reson7kr_rd_header(verbose, buffer, &index, header, error);
-
-	/* get the first cut time from the 6046 datalogger header */
-	time_j[0] = header->s7kTime.Year;
-	time_j[1] = header->s7kTime.Day;
-	time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-	time_j[3] = (int) header->s7kTime.Seconds;
-	time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-	mb_get_itime(verbose, time_j, store->time_i);
-	mb_get_time(verbose, store->time_i, &(store->time_d));
-
-	/* extract the start of the data */
-	index = header->Offset + 4;
-	mb_get_binary_int(MB_YES, &buffer[index], &(bluefin->msec_timestamp)); index += 4;
-	mb_get_binary_int(MB_YES, &buffer[index], &(bluefin->number_frames)); index += 4;
-	mb_get_binary_int(MB_YES, &buffer[index], &(bluefin->frame_size)); index += 4;
-	mb_get_binary_int(MB_YES, &buffer[index], &(bluefin->data_format)); index += 4;
-	for (i=0;i<16;i++)
-		{
-		bluefin->reserved[i] = buffer[index]; index++;
-		}
-
-	/* print out the results */
-#ifdef MBR_RESON7KR_DEBUG
-if (bluefin->data_format == R7KRECID_BluefinNav)
-fprintf(stderr,"R7KRECID_BluefinNav:               7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d size:%d index:%d\n",
-store->time_i[0],store->time_i[1],store->time_i[2],
-store->time_i[3],store->time_i[4],store->time_i[5],store->time_i[6],
-header->RecordNumber,header->Size,index);
-else
-fprintf(stderr,"R7KRECID_BluefinEnvironmental:     7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d size:%d index:%d\n",
-store->time_i[0],store->time_i[1],store->time_i[2],
-store->time_i[3],store->time_i[4],store->time_i[5],store->time_i[6],
-header->RecordNumber,header->Size,index);
-#endif
-
-	/* extract the nav or environmental data */
-	if (bluefin->data_format == R7KRECID_BluefinNav)
-		{
-		for (i=0;i<bluefin->number_frames;i++)
-			{
-			mb_get_binary_int(MB_YES, &buffer[index], &(bluefin->nav[i].packet_size)); index += 4;
-			mb_get_binary_short(MB_YES, &buffer[index], &(bluefin->nav[i].version)); index += 2;
-			mb_get_binary_short(MB_YES, &buffer[index], &(bluefin->nav[i].offset)); index += 2;
-			mb_get_binary_int(MB_YES, &buffer[index], &(bluefin->nav[i].data_type)); index += 4;
-			mb_get_binary_int(MB_YES, &buffer[index], &(bluefin->nav[i].data_size)); index += 4;
-			mb_get_binary_short(MB_YES, &buffer[index], &(bluefin->nav[i].s7kTime.Year)); index += 2;
-			mb_get_binary_short(MB_YES, &buffer[index], &(bluefin->nav[i].s7kTime.Day)); index += 2;
-			mb_get_binary_float(MB_YES, &buffer[index], &(bluefin->nav[i].s7kTime.Seconds)); index += 4;
-			bluefin->nav[i].s7kTime.Hours = (mb_u_char) buffer[index]; (index)++;
-			bluefin->nav[i].s7kTime.Minutes = (mb_u_char) buffer[index]; (index)++;
-			mb_get_binary_int(MB_YES, &buffer[index], &(bluefin->nav[i].checksum)); index += 4;
-			mb_get_binary_short(MB_YES, &buffer[index], &(bluefin->nav[i].timedelay)); index += 2;
-			mb_get_binary_int(MB_YES, &buffer[index], &(bluefin->nav[i].quality)); index += 4;
-			mb_get_binary_double(MB_YES, &buffer[index], &(bluefin->nav[i].latitude)); index += 8;
-			mb_get_binary_double(MB_YES, &buffer[index], &(bluefin->nav[i].longitude)); index += 8;
-			mb_get_binary_float(MB_YES, &buffer[index], &(bluefin->nav[i].speed)); index += 4;
-			mb_get_binary_double(MB_YES, &buffer[index], &(bluefin->nav[i].depth)); index += 8;
-			mb_get_binary_double(MB_YES, &buffer[index], &(bluefin->nav[i].altitude)); index += 8;
-			mb_get_binary_float(MB_YES, &buffer[index], &(bluefin->nav[i].roll)); index += 4;
-			mb_get_binary_float(MB_YES, &buffer[index], &(bluefin->nav[i].pitch)); index += 4;
-			mb_get_binary_float(MB_YES, &buffer[index], &(bluefin->nav[i].yaw)); index += 4;
-			mb_get_binary_float(MB_YES, &buffer[index], &(bluefin->nav[i].northing_rate)); index += 4;
-			mb_get_binary_float(MB_YES, &buffer[index], &(bluefin->nav[i].easting_rate)); index += 4;
-			mb_get_binary_float(MB_YES, &buffer[index], &(bluefin->nav[i].depth_rate)); index += 4;
-			mb_get_binary_float(MB_YES, &buffer[index], &(bluefin->nav[i].altitude_rate)); index += 4;
-			mb_get_binary_float(MB_YES, &buffer[index], &(bluefin->nav[i].roll_rate)); index += 4;
-			mb_get_binary_float(MB_YES, &buffer[index], &(bluefin->nav[i].pitch_rate)); index += 4;
-			mb_get_binary_float(MB_YES, &buffer[index], &(bluefin->nav[i].yaw_rate)); index += 4;
-			mb_get_binary_double(MB_YES, &buffer[index], &(bluefin->nav[i].position_time)); index += 8;
-			mb_get_binary_double(MB_YES, &buffer[index], &(bluefin->nav[i].depth_time)); index += 8;
-/*
-fprintf(stderr,"Bluefin nav[%d].packet_size:        %d\n",i,bluefin->nav[i].packet_size);
-fprintf(stderr,"Bluefin nav[%d].version:            %d\n",i,bluefin->nav[i].version);
-fprintf(stderr,"Bluefin nav[%d].offset:             %d\n",i,bluefin->nav[i].offset);
-fprintf(stderr,"Bluefin nav[%d].data_type:          %d\n",i,bluefin->nav[i].data_type);
-fprintf(stderr,"Bluefin nav[%d].data_size:          %d\n",i,bluefin->nav[i].data_size);
-fprintf(stderr,"Bluefin nav[%d].s7kTime.Year:       %d\n",i,bluefin->nav[i].s7kTime.Year);
-fprintf(stderr,"Bluefin nav[%d].s7kTime.Day:        %d\n",i,bluefin->nav[i].s7kTime.Day);
-fprintf(stderr,"Bluefin nav[%d].s7kTime.Seconds:    %f\n",i,bluefin->nav[i].s7kTime.Seconds);
-fprintf(stderr,"Bluefin nav[%d].s7kTime.Hours:      %d\n",i,bluefin->nav[i].s7kTime.Hours);
-fprintf(stderr,"Bluefin nav[%d].7kTime->Minutes:    %d\n",i,bluefin->nav[i].s7kTime.Minutes);
-fprintf(stderr,"Bluefin nav[%d].checksum:           %d\n",i,bluefin->nav[i].checksum);
-fprintf(stderr,"Bluefin nav[%d].timedelay:          %d\n",i,bluefin->nav[i].timedelay);
-fprintf(stderr,"Bluefin nav[%d].quality:            %x\n",i,bluefin->nav[i].quality);
-fprintf(stderr,"Bluefin nav[%d].latitude:           %f\n",i,bluefin->nav[i].latitude);
-fprintf(stderr,"Bluefin nav[%d].longitude:          %f\n",i,bluefin->nav[i].longitude);
-fprintf(stderr,"Bluefin nav[%d].speed:              %f\n",i,bluefin->nav[i].speed);
-fprintf(stderr,"Bluefin nav[%d].depth:              %f\n",i,bluefin->nav[i].depth);
-fprintf(stderr,"Bluefin nav[%d].altitude:           %f\n",i,bluefin->nav[i].altitude);
-fprintf(stderr,"Bluefin nav[%d].roll:               %f\n",i,bluefin->nav[i].roll);
-fprintf(stderr,"Bluefin nav[%d].pitch:              %f\n",i,bluefin->nav[i].pitch);
-fprintf(stderr,"Bluefin nav[%d].yaw:                %f\n",i,bluefin->nav[i].yaw);
-fprintf(stderr,"Bluefin nav[%d].northing_rate:      %f\n",i,bluefin->nav[i].northing_rate);
-fprintf(stderr,"Bluefin nav[%d].easting_rate:       %f\n",i,bluefin->nav[i].easting_rate);
-fprintf(stderr,"Bluefin nav[%d].depth_rate:         %f\n",i,bluefin->nav[i].depth_rate);
-fprintf(stderr,"Bluefin nav[%d].altitude_rate:      %f\n",i,bluefin->nav[i].altitude_rate);
-fprintf(stderr,"Bluefin nav[%d].roll_rate:          %f\n",i,bluefin->nav[i].roll_rate);
-fprintf(stderr,"Bluefin nav[%d].pitch_rate:         %f\n",i,bluefin->nav[i].pitch_rate);
-fprintf(stderr,"Bluefin nav[%d].yaw_rate:           %f\n",i,bluefin->nav[i].yaw_rate);
-fprintf(stderr,"Bluefin nav[%d].position_time:      %f\n",i,bluefin->nav[i].position_time);
-fprintf(stderr,"Bluefin nav[%d].depth_time:         %f\n",i,bluefin->nav[i].depth_time);
-*/
-
-/* print out the nav point time stamp */
-#ifdef MBR_RESON7KR_DEBUG
-time_j[0] = bluefin->nav[i].s7kTime.Year;
-time_j[1] = bluefin->nav[i].s7kTime.Day;
-time_j[2] = 60 * bluefin->nav[i].s7kTime.Hours + bluefin->nav[i].s7kTime.Minutes;
-time_j[3] = (int) bluefin->nav[i].s7kTime.Seconds;
-time_j[4] = (int) (1000000 * (bluefin->nav[i].s7kTime.Seconds - time_j[3]));
-mb_get_itime(verbose, time_j, time_i);
-fprintf(stderr,"                       %2.2d          7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) Pos_time:%f\n",
-i,time_i[0],time_i[1],time_i[2],
-time_i[3],time_i[4],time_i[5],time_i[6],
-bluefin->nav[i].position_time);
-#endif
-			}
-
-		/* The Reson 6046 datalogger has been placing the same time tag in each of the frames
-			- check if this is the case, if it is kluge new time tags spread over a one second interval */
-		if (bluefin->number_frames > 1)
-			{
-			/* figure out if there is a time problem */
-			timeproblem = MB_NO;
-			for (i=1;i<bluefin->number_frames;i++)
-				{
-				if (bluefin->nav[i].position_time == bluefin->nav[i-1].position_time)
-					timeproblem = MB_YES;
-				}
-			timeproblem = MB_NO;
-
-			/* figure out if the time changes anywhere */
-			if (timeproblem == MB_YES)
-				{
-				/* change unix times to use 7k time */
-				for (i=0;i<bluefin->number_frames;i++)
-					{
-					/* get the time  */
-#ifdef MBR_RESON7KR_DEBUG
-fprintf(stderr,"CHANGE TIMESTAMP: %d %2.2d:%2.2d:%6.3f %12f",
-i,bluefin->nav[i].s7kTime.Hours,bluefin->nav[i].s7kTime.Minutes,bluefin->nav[i].s7kTime.Seconds,time_d);
-#endif
-					time_j[0] = bluefin->nav[i].s7kTime.Year;
-					time_j[1] = bluefin->nav[i].s7kTime.Day;
-					time_j[2] = 60 * bluefin->nav[i].s7kTime.Hours + bluefin->nav[i].s7kTime.Minutes;
-					time_j[3] = (int) bluefin->nav[i].s7kTime.Seconds;
-					time_j[4] = (int) (1000000 * (bluefin->nav[i].s7kTime.Seconds - time_j[3]));
-					mb_get_itime(verbose, time_j, store->time_i);
-					mb_get_time(verbose, store->time_i, &time_d);
-					bluefin->nav[i].position_time = time_d;
-					bluefin->nav[i].depth_time = time_d;
-#ifdef MBR_RESON7KR_DEBUG
-fprintf(stderr,"    %12f\n",time_d);
-#endif
-					}
-				}
-			}
-		}
-	else if (bluefin->data_format == R7KRECID_BluefinEnvironmental)
-		{
-		for (i=0;i<bluefin->number_frames;i++)
-			{
-			mb_get_binary_int(MB_YES, &buffer[index], &(bluefin->environmental[i].packet_size)); index += 4;
-			mb_get_binary_short(MB_YES, &buffer[index], &(bluefin->environmental[i].version)); index += 2;
-			mb_get_binary_short(MB_YES, &buffer[index], &(bluefin->environmental[i].offset)); index += 2;
-			mb_get_binary_int(MB_YES, &buffer[index], &(bluefin->environmental[i].data_type)); index += 4;
-			mb_get_binary_int(MB_YES, &buffer[index], &(bluefin->environmental[i].data_size)); index += 4;
-			mb_get_binary_short(MB_YES, &buffer[index], &(bluefin->environmental[i].s7kTime.Year)); index += 2;
-			mb_get_binary_short(MB_YES, &buffer[index], &(bluefin->environmental[i].s7kTime.Day)); index += 2;
-			mb_get_binary_float(MB_YES, &buffer[index], &(bluefin->environmental[i].s7kTime.Seconds)); index += 4;
-			bluefin->environmental[i].s7kTime.Hours = (mb_u_char) buffer[index]; (index)++;
-			bluefin->environmental[i].s7kTime.Minutes = (mb_u_char) buffer[index]; (index)++;
-			mb_get_binary_int(MB_YES, &buffer[index], &(bluefin->environmental[i].checksum)); index += 4;
-			mb_get_binary_short(MB_YES, &buffer[index], &(bluefin->environmental[i].reserved1)); index += 2;
-			mb_get_binary_int(MB_YES, &buffer[index], &(bluefin->environmental[i].quality)); index += 4;
-			mb_get_binary_float(MB_YES, &buffer[index], &(bluefin->environmental[i].sound_speed)); index += 4;
-			mb_get_binary_float(MB_YES, &buffer[index], &(bluefin->environmental[i].conductivity)); index += 4;
-			mb_get_binary_float(MB_YES, &buffer[index], &(bluefin->environmental[i].temperature)); index += 4;
-			mb_get_binary_float(MB_YES, &buffer[index], &(bluefin->environmental[i].pressure)); index += 4;
-			mb_get_binary_float(MB_YES, &buffer[index], &(bluefin->environmental[i].salinity)); index += 4;
-			mb_get_binary_double(MB_YES, &buffer[index], &(bluefin->environmental[i].ctd_time)); index += 8;
-			mb_get_binary_double(MB_YES, &buffer[index], &(bluefin->environmental[i].temperature_time)); index += 8;
-			mb_get_binary_double(MB_YES, &buffer[index], &(bluefin->environmental[i].surface_pressure)); index += 8;
-			mb_get_binary_int(MB_YES, &buffer[index], &(bluefin->environmental[i].temperature_counts)); index += 4;
-			mb_get_binary_float(MB_YES, &buffer[index], &(bluefin->environmental[i].conductivity_frequency)); index += 4;
-			mb_get_binary_int(MB_YES, &buffer[index], &(bluefin->environmental[i].pressure_counts)); index += 4;
-			mb_get_binary_float(MB_YES, &buffer[index], &(bluefin->environmental[i].pressure_comp_voltage)); index += 4;
-			mb_get_binary_int(MB_YES, &buffer[index], &(bluefin->environmental[i].sensor_time_sec)); index += 4;
-			mb_get_binary_int(MB_YES, &buffer[index], &(bluefin->environmental[i].sensor_time_nsec)); index += 4;
-			mb_get_binary_short(MB_YES, &buffer[index], &(bluefin->environmental[i].sensor1)); index += 2;
-			mb_get_binary_short(MB_YES, &buffer[index], &(bluefin->environmental[i].sensor2)); index += 2;
-			mb_get_binary_short(MB_YES, &buffer[index], &(bluefin->environmental[i].sensor3)); index += 2;
-			mb_get_binary_short(MB_YES, &buffer[index], &(bluefin->environmental[i].sensor4)); index += 2;
-			mb_get_binary_short(MB_YES, &buffer[index], &(bluefin->environmental[i].sensor5)); index += 2;
-			mb_get_binary_short(MB_YES, &buffer[index], &(bluefin->environmental[i].sensor6)); index += 2;
-			mb_get_binary_short(MB_YES, &buffer[index], &(bluefin->environmental[i].sensor7)); index += 2;
-			mb_get_binary_short(MB_YES, &buffer[index], &(bluefin->environmental[i].sensor8)); index += 2;
-			for (j=0;j<8;j++)
-				{
-				bluefin->environmental[i].reserved2[j] = buffer[index]; index++;
-				}
-
-/* print out the environmental point time stamp */
-#ifdef MBR_RESON7KR_DEBUG
-time_j[0] = bluefin->environmental[i].s7kTime.Year;
-time_j[1] = bluefin->environmental[i].s7kTime.Day;
-time_j[2] = 60 * bluefin->environmental[i].s7kTime.Hours + bluefin->environmental[i].s7kTime.Minutes;
-time_j[3] = (int) bluefin->environmental[i].s7kTime.Seconds;
-time_j[4] = (int) (1000000 * (bluefin->environmental[i].s7kTime.Seconds - time_j[3]));
-mb_get_itime(verbose, time_j, time_i);
-fprintf(stderr,"                       %2.2d          7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) CTD_time:%f T_time:%f S_time:%d.%9.9d\n",
-i,time_i[0],time_i[1],time_i[2],
-time_i[3],time_i[4],time_i[5],time_i[6],
-bluefin->environmental[i].ctd_time,
-bluefin->environmental[i].temperature_time,
-bluefin->environmental[i].sensor_time_sec,
-bluefin->environmental[i].sensor_time_nsec);
-#endif
-			}
-
-		/* The Reson 6046 datalogger has been placing the same time tag in each of the frames
-			- check if this is the case, if it is kluge new time tags spread over a one second interval */
-		if (bluefin->number_frames > 1)
-			{
-			/* figure out if there is a time problem */
-			timeproblem = MB_NO;
-			for (i=1;i<bluefin->number_frames;i++)
-				{
-				if (bluefin->environmental[i].ctd_time == bluefin->environmental[i-1].ctd_time
-					|| bluefin->environmental[i].ctd_time < 10000000.0)
-					timeproblem = MB_YES;
-				}
-			timeproblem = MB_NO;
-
-			/* figure out if the time changes anywhere */
-			if (timeproblem == MB_YES)
-				{
-				/* change unix times to use 7k time */
-				for (i=0;i<bluefin->number_frames;i++)
-					{
-					/* get the time  */
-#ifdef MBR_RESON7KR_DEBUG
-fprintf(stderr,"CHANGE TIMESTAMP: %d %2.2d:%2.2d:%6.3f %12f",
-i,bluefin->environmental[i].s7kTime.Hours,bluefin->environmental[i].s7kTime.Minutes,bluefin->environmental[i].s7kTime.Seconds,time_d);
-#endif
-					time_j[0] = bluefin->environmental[i].s7kTime.Year;
-					time_j[1] = bluefin->environmental[i].s7kTime.Day;
-					time_j[2] = 60 * bluefin->environmental[i].s7kTime.Hours + bluefin->environmental[i].s7kTime.Minutes;
-					time_j[3] = (int) bluefin->environmental[i].s7kTime.Seconds;
-					time_j[4] = (int) (1000000 * (bluefin->environmental[i].s7kTime.Seconds - time_j[3]));
-					mb_get_itime(verbose, time_j, store->time_i);
-					mb_get_time(verbose, store->time_i, &time_d);
-					bluefin->environmental[i].ctd_time = time_d;
-					bluefin->environmental[i].temperature_time = time_d;
-#ifdef MBR_RESON7KR_DEBUG
-fprintf(stderr,"    %12f\n",
-time_d);
-#endif
-					}
-				}
-			}
-		}
-
-	/* set kind */
-	if (status == MB_SUCCESS)
-		{
-		/* set kind */
-		if (bluefin->data_format == R7KRECID_BluefinNav)
-			{
-			store->kind = MB_DATA_NAV2;
-			store->type = R7KRECID_Bluefin;
-
-			/* get the time from the 6046 datalogger header */
-			time_j[0] = bluefin->nav[0].s7kTime.Year;
-			time_j[1] = bluefin->nav[0].s7kTime.Day;
-			time_j[2] = 60 * bluefin->nav[0].s7kTime.Hours + bluefin->nav[0].s7kTime.Minutes;
-			time_j[3] = (int) bluefin->nav[0].s7kTime.Seconds;
-			time_j[4] = (int) (1000000 * (bluefin->nav[0].s7kTime.Seconds - time_j[3]));
-			mb_get_itime(verbose, time_j, store->time_i);
-			mb_get_time(verbose, store->time_i, &(store->time_d));
-			}
-		else if (bluefin->data_format == R7KRECID_BluefinEnvironmental)
-			{
-			store->kind = MB_DATA_SSV;
-			store->type = R7KRECID_Bluefin;
-
-			/* get the time from the 6046 datalogger header */
-			time_j[0] = bluefin->environmental[0].s7kTime.Year;
-			time_j[1] = bluefin->environmental[0].s7kTime.Day;
-			time_j[2] = 60 * bluefin->environmental[0].s7kTime.Hours + bluefin->environmental[0].s7kTime.Minutes;
-			time_j[3] = (int) bluefin->environmental[0].s7kTime.Seconds;
-			time_j[4] = (int) (1000000 * (bluefin->environmental[0].s7kTime.Seconds - time_j[3]));
-			mb_get_itime(verbose, time_j, store->time_i);
-			mb_get_time(verbose, store->time_i, &(store->time_d));
-			}
-		else
-			{
-			store->kind = MB_DATA_NONE;
-			status = MB_FAILURE;
-			*error = MB_ERROR_UNINTELLIGIBLE;
-			}
-		}
-	else
-		{
-		store->kind = MB_DATA_NONE;
-		}
-
-	/* print out the results */
-#ifdef MBR_RESON7KR_DEBUG
-if (bluefin->data_format == R7KRECID_BluefinNav)
-fprintf(stderr,"R7KRECID_BluefinNav:               7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d size:%d index:%d\n",
-store->time_i[0],store->time_i[1],store->time_i[2],
-store->time_i[3],store->time_i[4],store->time_i[5],store->time_i[6],
-header->RecordNumber,header->Size,index);
-else
-fprintf(stderr,"R7KRECID_BluefinEnvironmental:     7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d size:%d index:%d\n",
-store->time_i[0],store->time_i[1],store->time_i[2],
-store->time_i[3],store->time_i[4],store->time_i[5],store->time_i[6],
-header->RecordNumber,header->Size,index);
-#endif
-#ifdef MBR_RESON7KR_DEBUG
-	if (verbose > 0)
-#else
-	if (verbose >= 2)
-#endif
-	mbsys_reson7k_print_bluefin(verbose, bluefin, error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_rd_processedsidescan(int verbose, char *buffer, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_reson7kr_rd_processedsidescan";
-	int	status = MB_SUCCESS;
-	struct mbsys_reson7k_struct *store;
-	s7k_header *header;
-	s7kr_processedsidescan *processedsidescan;
-	int	index;
-	int	time_j[5];
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       buffer:     %p\n",(void *)buffer);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	processedsidescan = &(store->processedsidescan);
-	header = &(processedsidescan->header);
-
-	/* extract the header */
-	index = 0;
-	status = mbr_reson7kr_rd_header(verbose, buffer, &index, header, error);
-
-	/* extract the data */
-	index = header->Offset + 4;
-	mb_get_binary_long(MB_YES, &buffer[index], &(processedsidescan->serial_number)); index += 8;
-	mb_get_binary_int(MB_YES, &buffer[index], &(processedsidescan->ping_number)); index += 4;
-	mb_get_binary_short(MB_YES, &buffer[index], &(processedsidescan->multi_ping)); index += 2;
-	mb_get_binary_short(MB_YES, &buffer[index], &(processedsidescan->recordversion)); index += 2;
-	mb_get_binary_int(MB_YES, &buffer[index], &(processedsidescan->ss_source)); index += 4;
-	mb_get_binary_int(MB_YES, &buffer[index], &(processedsidescan->number_pixels)); index += 4;
-	mb_get_binary_int(MB_YES, &buffer[index], &(processedsidescan->ss_type)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(processedsidescan->pixelwidth)); index += 4;
-	mb_get_binary_double(MB_YES, &buffer[index], &(processedsidescan->sonardepth)); index += 8;
-	mb_get_binary_double(MB_YES, &buffer[index], &(processedsidescan->altitude)); index += 8;
-
-	/* extract the data */
-	for (i=0;i<processedsidescan->number_pixels;i++)
-		{
-		mb_get_binary_float(MB_YES, &buffer[index], &(processedsidescan->sidescan[i])); index += 4;
-		}
-	for (i=0;i<processedsidescan->number_pixels;i++)
-		{
-		mb_get_binary_float(MB_YES, &buffer[index], &(processedsidescan->alongtrack[i])); index += 4;
-		}
-
-	/* set kind */
-	if (status == MB_SUCCESS)
-		{
-		/* set kind */
-		store->kind = MB_DATA_DATA;
-		store->type = R7KRECID_ProcessedSidescan;
-
-		/* get the time */
-		time_j[0] = header->s7kTime.Year;
-		time_j[1] = header->s7kTime.Day;
-		time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-		time_j[3] = (int) header->s7kTime.Seconds;
-		time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-		mb_get_itime(verbose, time_j, store->time_i);
-		mb_get_time(verbose, store->time_i, &(store->time_d));
-		}
-	else
-		{
-		store->kind = MB_DATA_NONE;
-		}
-
-	/* print out the results */
-#ifdef MBR_RESON7KR_DEBUG
-fprintf(stderr,"R7KRECID_ProcessedSidescan:       7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d size:%d index:%d\n",
-store->time_i[0],store->time_i[1],store->time_i[2],
-store->time_i[3],store->time_i[4],store->time_i[5],store->time_i[6],
-header->RecordNumber,header->Size,index);
-#endif
-#ifdef MBR_RESON7KR_DEBUG
-	if (verbose > 0)
-#else
-	if (verbose >= 2)
-#endif
-	mbsys_reson7k_print_processedsidescan(verbose, processedsidescan, error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_rd_volatilesonarsettings(int verbose, char *buffer, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_reson7kr_rd_volatilesonarsettings";
-	int	status = MB_SUCCESS;
-	struct mbsys_reson7k_struct *store;
-	s7k_header *header;
-	s7kr_volatilesettings *volatilesettings;
-	int	index;
-	int	time_j[5];
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       buffer:     %p\n",(void *)buffer);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	volatilesettings = &(store->volatilesettings);
-	header = &(volatilesettings->header);
-
-	/* extract the header */
-	index = 0;
-	status = mbr_reson7kr_rd_header(verbose, buffer, &index, header, error);
-
-	/* extract the data */
-	index = header->Offset + 4;
-	mb_get_binary_long(MB_YES, &buffer[index], &(volatilesettings->serial_number)); index += 8;
-	mb_get_binary_int(MB_YES, &buffer[index], &(volatilesettings->ping_number)); index += 4;
-	mb_get_binary_short(MB_YES, &buffer[index], &(volatilesettings->multi_ping)); index += 2;
-	mb_get_binary_float(MB_YES, &buffer[index], &(volatilesettings->frequency)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(volatilesettings->sample_rate)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(volatilesettings->receiver_bandwidth)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(volatilesettings->pulse_width)); index += 4;
-	mb_get_binary_int(MB_YES, &buffer[index], &(volatilesettings->pulse_type)); index += 4;
-	mb_get_binary_int(MB_YES, &buffer[index], &(volatilesettings->pulse_envelope)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(volatilesettings->pulse_envelope_par)); index += 4;
-	mb_get_binary_int(MB_YES, &buffer[index], &(volatilesettings->pulse_reserved)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(volatilesettings->max_ping_rate)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(volatilesettings->ping_period)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(volatilesettings->range_selection)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(volatilesettings->power_selection)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(volatilesettings->gain_selection)); index += 4;
-	mb_get_binary_int(MB_YES, &buffer[index], &(volatilesettings->control_flags)); index += 4;
-	mb_get_binary_int(MB_YES, &buffer[index], &(volatilesettings->projector_magic_no)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(volatilesettings->steering_vertical)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(volatilesettings->steering_horizontal)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(volatilesettings->beamwidth_vertical)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(volatilesettings->beamwidth_horizontal)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(volatilesettings->focal_point)); index += 4;
-	mb_get_binary_int(MB_YES, &buffer[index], &(volatilesettings->projector_weighting)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(volatilesettings->projector_weighting_par)); index += 4;
-	mb_get_binary_int(MB_YES, &buffer[index], &(volatilesettings->transmit_flags)); index += 4;
-	mb_get_binary_int(MB_YES, &buffer[index], &(volatilesettings->hydrophone_magic_no)); index += 4;
-	mb_get_binary_int(MB_YES, &buffer[index], &(volatilesettings->receive_weighting)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(volatilesettings->receive_weighting_par)); index += 4;
-	mb_get_binary_int(MB_YES, &buffer[index], &(volatilesettings->receive_flags)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(volatilesettings->receive_width)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(volatilesettings->range_minimum)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(volatilesettings->range_maximum)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(volatilesettings->depth_minimum)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(volatilesettings->depth_maximum)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(volatilesettings->absorption)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(volatilesettings->sound_velocity)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(volatilesettings->spreading)); index += 4;
-	mb_get_binary_short(MB_YES, &buffer[index], &(volatilesettings->reserved)); index += 2;
-
-	/* set kind */
-	if (status == MB_SUCCESS)
-		{
-		/* set kind */
-		store->kind = MB_DATA_PARAMETER;
-		store->type = R7KRECID_7kVolatileSonarSettings;
-
-		/* get the time */
-		time_j[0] = header->s7kTime.Year;
-		time_j[1] = header->s7kTime.Day;
-		time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-		time_j[3] = (int) header->s7kTime.Seconds;
-		time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-		mb_get_itime(verbose, time_j, store->time_i);
-		mb_get_time(verbose, store->time_i, &(store->time_d));
-		}
-	else
-		{
-		store->kind = MB_DATA_NONE;
-		}
-
-	/* print out the results */
-#ifdef MBR_RESON7KR_DEBUG
-fprintf(stderr,"R7KRECID_7kVolatileSonarSettings:       7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d size:%d index:%d\n",
-store->time_i[0],store->time_i[1],store->time_i[2],
-store->time_i[3],store->time_i[4],store->time_i[5],store->time_i[6],
-header->RecordNumber,header->Size,index);
-#endif
-#ifdef MBR_RESON7KR_DEBUG
-	if (verbose > 0)
-#else
-	if (verbose >= 2)
-#endif
-	mbsys_reson7k_print_volatilesettings(verbose, volatilesettings, error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_rd_configuration(int verbose, char *buffer, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_reson7kr_rd_configuration";
-	int	status = MB_SUCCESS;
-	struct mbsys_reson7k_struct *store;
-	s7k_header *header;
-	s7kr_configuration *configuration;
-	s7k_device *device;
-	int	data_size;
-	int	index;
-	int	time_j[5];
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       buffer:     %p\n",(void *)buffer);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	configuration = &(store->configuration);
-	header = &(configuration->header);
-
-	/* extract the header */
-	index = 0;
-	status = mbr_reson7kr_rd_header(verbose, buffer, &index, header, error);
-
-	/* extract the data */
-	index = header->Offset + 4;
-	mb_get_binary_long(MB_YES, &buffer[index], &(configuration->serial_number)); index += 8;
-	mb_get_binary_int(MB_YES, &buffer[index], &(configuration->number_devices)); index += 4;
-
-	/* extract the data for each device */
-	for (i=0;i<configuration->number_devices;i++)
-		{
-		device = &(configuration->device[i]);
-		mb_get_binary_int(MB_YES, &buffer[index], &(device->magic_number)); index += 4;
-		for (j=0;j<64;j++)
-			{
-			device->description[j] = buffer[index]; index++;
-			}
-		mb_get_binary_long(MB_YES, &buffer[index], &(device->serial_number)); index += 8;
-		mb_get_binary_int(MB_YES, &buffer[index], &(device->info_length)); index += 4;
-
-		/* make sure enough memory is allocated for info data */
-		if (device->info_alloc < device->info_length)
-			{
-			data_size = device->info_length + 1;
-			status = mb_reallocd(verbose, __FILE__, __LINE__, data_size, (void **)&(device->info), error);
-			if (status == MB_SUCCESS)
-				{
-				device->info_alloc = device->info_length;
-				}
-			else
-				{
-				device->info_alloc = 0;
-				device->info_length = 0;
-				}
-			}
-
-		for (j=0;j<device->info_length;j++)
-			{
-			device->info[j] = buffer[index]; index++;
-			}
-		}
-
-	/* set kind */
-	if (status == MB_SUCCESS)
-		{
-		/* set kind */
-		store->kind = MB_DATA_PARAMETER;
-		store->type = R7KRECID_7kConfiguration;
-
-		/* get the time */
-		time_j[0] = header->s7kTime.Year;
-		time_j[1] = header->s7kTime.Day;
-		time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-		time_j[3] = (int) header->s7kTime.Seconds;
-		time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-		mb_get_itime(verbose, time_j, store->time_i);
-		mb_get_time(verbose, store->time_i, &(store->time_d));
-		}
-	else
-		{
-		store->kind = MB_DATA_NONE;
-		}
-
-	/* print out the results */
-#ifdef MBR_RESON7KR_DEBUG
-fprintf(stderr,"R7KRECID_7kConfiguration:               7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d size:%d index:%d\n",
-store->time_i[0],store->time_i[1],store->time_i[2],
-store->time_i[3],store->time_i[4],store->time_i[5],store->time_i[6],
-header->RecordNumber,header->Size,index);
-#endif
-#ifdef MBR_RESON7KR_DEBUG
-	if (verbose > 0)
-#else
-	if (verbose >= 2)
-#endif
-	mbsys_reson7k_print_configuration(verbose, configuration, error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_rd_matchfilter(int verbose, char *buffer, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_reson7kr_rd_matchfilter";
-	int	status = MB_SUCCESS;
-	struct mbsys_reson7k_struct *store;
-	s7k_header *header;
-	s7kr_matchfilter *matchfilter;
-	int	index;
-	int	time_j[5];
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       buffer:     %p\n",(void *)buffer);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	matchfilter = &(store->matchfilter);
-	header = &(matchfilter->header);
-
-	/* extract the header */
-	index = 0;
-	status = mbr_reson7kr_rd_header(verbose, buffer, &index, header, error);
-
-	/* extract the data */
-	index = header->Offset + 4;
-	mb_get_binary_long(MB_YES, &buffer[index], &(matchfilter->serial_number)); index += 8;
-	mb_get_binary_int(MB_YES, &buffer[index], &(matchfilter->ping_number)); index += 4;
-	mb_get_binary_int(MB_YES, &buffer[index], &(matchfilter->operation)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(matchfilter->start_frequency)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(matchfilter->end_frequency)); index += 4;
-
-	/* set kind */
-	if (status == MB_SUCCESS)
-		{
-		/* set kind */
-		store->kind = MB_DATA_DATA;
-		store->type = R7KRECID_7kMatchFilter;
-
-		/* get the time */
-		time_j[0] = header->s7kTime.Year;
-		time_j[1] = header->s7kTime.Day;
-		time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-		time_j[3] = (int) header->s7kTime.Seconds;
-		time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-		mb_get_itime(verbose, time_j, store->time_i);
-		mb_get_time(verbose, store->time_i, &(store->time_d));
-		}
-	else
-		{
-		store->kind = MB_DATA_NONE;
-		}
-
-	/* print out the results */
-#ifdef MBR_RESON7KR_DEBUG
-fprintf(stderr,"R7KRECID_7kMatchFilter:                 7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d size:%d index:%d\n",
-store->time_i[0],store->time_i[1],store->time_i[2],
-store->time_i[3],store->time_i[4],store->time_i[5],store->time_i[6],
-header->RecordNumber,header->Size,index);
-#endif
-#ifdef MBR_RESON7KR_DEBUG
-	if (verbose > 0)
-#else
-	if (verbose >= 2)
-#endif
-	mbsys_reson7k_print_matchfilter(verbose, matchfilter, error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_rd_v2firmwarehardwareconfiguration(int verbose, char *buffer, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_reson7kr_rd_v2firmwarehardwareconfiguration";
-	int	status = MB_SUCCESS;
-	struct mbsys_reson7k_struct *store;
-	s7k_header *header;
-	s7kr_v2firmwarehardwareconfiguration *v2firmwarehardwareconfiguration;
-	int	index;
-	int	data_size;
-	int	time_j[5];
-	int	j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       buffer:     %p\n",(void *)buffer);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	v2firmwarehardwareconfiguration = &(store->v2firmwarehardwareconfiguration);
-	header = &(v2firmwarehardwareconfiguration->header);
-
-	/* extract the header */
-	index = 0;
-	status = mbr_reson7kr_rd_header(verbose, buffer, &index, header, error);
-
-	/* extract the data */
-	index = header->Offset + 4;
-	mb_get_binary_int(MB_YES, &buffer[index], &(v2firmwarehardwareconfiguration->device_count)); index += 4;
-	mb_get_binary_int(MB_YES, &buffer[index], &(v2firmwarehardwareconfiguration->info_length)); index += 4;
-
-	/* make sure enough memory is allocated for info data */
-	if (v2firmwarehardwareconfiguration->info_alloc < v2firmwarehardwareconfiguration->info_length)
-		{
-		data_size = v2firmwarehardwareconfiguration->info_length + 1;
-		status = mb_reallocd(verbose, __FILE__, __LINE__, data_size, (void **)&(v2firmwarehardwareconfiguration->info), error);
-		if (status == MB_SUCCESS)
-			{
-			v2firmwarehardwareconfiguration->info_alloc = v2firmwarehardwareconfiguration->info_length;
-			}
-		else
-			{
-			v2firmwarehardwareconfiguration->info_alloc = 0;
-			v2firmwarehardwareconfiguration->info_length = 0;
-			}
-		}
-
-	for (j=0;j<v2firmwarehardwareconfiguration->info_length;j++)
-		{
-		v2firmwarehardwareconfiguration->info[j] = buffer[index]; index++;
-		}
-
-	/* set kind */
-	if (status == MB_SUCCESS)
-		{
-		/* set kind */
-		store->kind = MB_DATA_PARAMETER;
-		store->type = R7KRECID_7kV2FirmwareHardwareConfiguration;
-
-		/* get the time */
-		time_j[0] = header->s7kTime.Year;
-		time_j[1] = header->s7kTime.Day;
-		time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-		time_j[3] = (int) header->s7kTime.Seconds;
-		time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-		mb_get_itime(verbose, time_j, store->time_i);
-		mb_get_time(verbose, store->time_i, &(store->time_d));
-		}
-	else
-		{
-		store->kind = MB_DATA_NONE;
-		}
-
-	/* print out the results */
-#ifdef MBR_RESON7KR_DEBUG
-fprintf(stderr,"R7KRECID_7kV2FirmwareHardwareConfiguration:                 7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d size:%d index:%d\n",
-store->time_i[0],store->time_i[1],store->time_i[2],
-store->time_i[3],store->time_i[4],store->time_i[5],store->time_i[6],
-header->RecordNumber,header->Size,index);
-#endif
-#ifdef MBR_RESON7KR_DEBUG
-	if (verbose > 0)
-#else
-	if (verbose >= 2)
-#endif
-	mbsys_reson7k_print_v2firmwarehardwareconfiguration(verbose, v2firmwarehardwareconfiguration, error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_rd_beamgeometry(int verbose, char *buffer, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_reson7kr_rd_beamgeometry";
-	int	status = MB_SUCCESS;
-	struct mbsys_reson7k_struct *store;
-	s7k_header *header;
-	s7kr_beamgeometry *beamgeometry;
-	int	index;
-	int	time_j[5];
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       buffer:     %p\n",(void *)buffer);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	beamgeometry = &(store->beamgeometry);
-	header = &(beamgeometry->header);
-
-	/* extract the header */
-	index = 0;
-	status = mbr_reson7kr_rd_header(verbose, buffer, &index, header, error);
-
-	/* extract the data */
-	index = header->Offset + 4;
-	mb_get_binary_long(MB_YES, &buffer[index], &(beamgeometry->serial_number)); index += 8;
-	mb_get_binary_int(MB_YES, &buffer[index], &(beamgeometry->number_beams)); index += 4;
-
-	/* extract the data */
-	for (i=0;i<beamgeometry->number_beams;i++)
-		{
-		mb_get_binary_float(MB_YES, &buffer[index], &(beamgeometry->angle_alongtrack[i])); index += 4;
-		}
-	for (i=0;i<beamgeometry->number_beams;i++)
-		{
-		mb_get_binary_float(MB_YES, &buffer[index], &(beamgeometry->angle_acrosstrack[i])); index += 4;
-		}
-	for (i=0;i<beamgeometry->number_beams;i++)
-		{
-		mb_get_binary_float(MB_YES, &buffer[index], &(beamgeometry->beamwidth_alongtrack[i])); index += 4;
-		}
-	for (i=0;i<beamgeometry->number_beams;i++)
-		{
-		mb_get_binary_float(MB_YES, &buffer[index], &(beamgeometry->beamwidth_acrosstrack[i])); index += 4;
-		}
-
-	/* set kind */
-	if (status == MB_SUCCESS)
-		{
-		/* set kind */
-		store->kind = MB_DATA_DATA;
-		store->type = R7KRECID_7kBeamGeometry;
-
-		/* get the time */
-		time_j[0] = header->s7kTime.Year;
-		time_j[1] = header->s7kTime.Day;
-		time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-		time_j[3] = (int) header->s7kTime.Seconds;
-		time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-		mb_get_itime(verbose, time_j, store->time_i);
-		mb_get_time(verbose, store->time_i, &(store->time_d));
-		}
-	else
-		{
-		store->kind = MB_DATA_NONE;
-		}
-
-	/* print out the results */
-#ifdef MBR_RESON7KR_DEBUG
-fprintf(stderr,"R7KRECID_7kBeamGeometry:                7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d size:%d index:%d\n",
-store->time_i[0],store->time_i[1],store->time_i[2],
-store->time_i[3],store->time_i[4],store->time_i[5],store->time_i[6],
-header->RecordNumber,header->Size,index);
-#endif
-#ifdef MBR_RESON7KR_DEBUG
-	if (verbose > 0)
-#else
-	if (verbose >= 2)
-#endif
-	mbsys_reson7k_print_beamgeometry(verbose, beamgeometry, error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_rd_calibration(int verbose, char *buffer, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_reson7kr_rd_calibration";
-	int	status = MB_SUCCESS;
-	struct mbsys_reson7k_struct *store;
-	s7k_header *header;
-	s7kr_calibration *calibration;
-	int	index;
-	int	time_j[5];
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       buffer:     %p\n",(void *)buffer);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	calibration = &(store->calibration);
-	header = &(calibration->header);
-
-	/* extract the header */
-	index = 0;
-	status = mbr_reson7kr_rd_header(verbose, buffer, &index, header, error);
-
-	/* extract the data */
-	index = header->Offset + 4;
-	mb_get_binary_long(MB_YES, &buffer[index], &(calibration->serial_number)); index += 8;
-	mb_get_binary_short(MB_YES, &buffer[index], &(calibration->number_channels)); index += 2;
-
-	/* extract the data */
-	for (i=0;i<calibration->number_channels;i++)
-		{
-		mb_get_binary_float(MB_YES, &buffer[index], &(calibration->gain[i])); index += 4;
-		}
-	for (i=0;i<calibration->number_channels;i++)
-		{
-		mb_get_binary_float(MB_YES, &buffer[index], &(calibration->phase[i])); index += 4;
-		}
-
-	/* set kind */
-	if (status == MB_SUCCESS)
-		{
-		/* set kind */
-		store->kind = MB_DATA_DATA;
-		store->type = R7KRECID_7kCalibrationData;
-
-		/* get the time */
-		time_j[0] = header->s7kTime.Year;
-		time_j[1] = header->s7kTime.Day;
-		time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-		time_j[3] = (int) header->s7kTime.Seconds;
-		time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-		mb_get_itime(verbose, time_j, store->time_i);
-		mb_get_time(verbose, store->time_i, &(store->time_d));
-		}
-	else
-		{
-		store->kind = MB_DATA_NONE;
-		}
-
-	/* print out the results */
-#ifdef MBR_RESON7KR_DEBUG
-fprintf(stderr,"R7KRECID_7kCalibrationData:             7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d size:%d index:%d\n",
-store->time_i[0],store->time_i[1],store->time_i[2],
-store->time_i[3],store->time_i[4],store->time_i[5],store->time_i[6],
-header->RecordNumber,header->Size,index);
-#endif
-#ifdef MBR_RESON7KR_DEBUG
-	if (verbose > 0)
-#else
-	if (verbose >= 2)
-#endif
-	mbsys_reson7k_print_calibration(verbose, calibration, error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_rd_bathymetry(int verbose, char *buffer, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_reson7kr_rd_bathymetry";
-	int	status = MB_SUCCESS;
-	struct mbsys_reson7k_struct *store;
-	s7k_header *header;
-	s7kr_bathymetry *bathymetry;
-	int	index;
-	int	time_j[5];
-	double	acrosstrackmax, alongtrackmax;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       buffer:     %p\n",(void *)buffer);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	bathymetry = &(store->bathymetry);
-	header = &(bathymetry->header);
-
-	/* extract the header */
-	index = 0;
-	status = mbr_reson7kr_rd_header(verbose, buffer, &index, header, error);
-
-	/* extract the data */
-	index = header->Offset + 4;
-	mb_get_binary_long(MB_YES, &buffer[index], &(bathymetry->serial_number)); index += 8;
-	mb_get_binary_int(MB_YES, &buffer[index], &(bathymetry->ping_number)); index += 4;
-	mb_get_binary_short(MB_YES, &buffer[index], &(bathymetry->multi_ping)); index += 2;
-	mb_get_binary_int(MB_YES, &buffer[index], &(bathymetry->number_beams)); index += 4;
-
-	/* deal with version 5 records */
-	if (header->Version >= 5)
-		{
-		bathymetry->layer_comp_flag = buffer[index]; index++;
-		bathymetry->sound_vel_flag = buffer[index]; index++;
-		mb_get_binary_float(MB_YES, &buffer[index], &(bathymetry->sound_velocity)); index += 4;
-		}
-	else
-		{
-		bathymetry->layer_comp_flag = 0;
-		bathymetry->sound_vel_flag = 0;
-		bathymetry->sound_velocity = 0.0;
-		}
-
-	/* extract the data */
-	for (i=0;i<bathymetry->number_beams;i++)
-		{
-		mb_get_binary_float(MB_YES, &buffer[index], &(bathymetry->range[i])); index += 4;
-		}
-	for (i=0;i<bathymetry->number_beams;i++)
-		{
-		bathymetry->quality[i] = buffer[index]; index++;
-		}
-	for (i=0;i<bathymetry->number_beams;i++)
-		{
-		mb_get_binary_float(MB_YES, &buffer[index], &(bathymetry->intensity[i])); index += 4;
-		}
-	if ((header->OffsetToOptionalData == 0 && header->Size >= 92 + 17 * bathymetry->number_beams)
-		|| (header->OffsetToOptionalData > 0 && header->Size >= 137 + 37 * bathymetry->number_beams))
-		{
-		for (i=0;i<bathymetry->number_beams;i++)
-			{
-			mb_get_binary_float(MB_YES, &buffer[index], &(bathymetry->min_depth_gate[i])); index += 4;
-			}
-		for (i=0;i<bathymetry->number_beams;i++)
-			{
-			mb_get_binary_float(MB_YES, &buffer[index], &(bathymetry->max_depth_gate[i])); index += 4;
-			}
-		}
-
-	/* extract the optional data */
-	if (header->OffsetToOptionalData > 0)
-		{
-		index = header->OffsetToOptionalData;
-		bathymetry->optionaldata = MB_YES;
-		mb_get_binary_float(MB_YES, &buffer[index], &(bathymetry->frequency)); index += 4;
-		mb_get_binary_double(MB_YES, &buffer[index], &(bathymetry->latitude)); index += 8;
-		mb_get_binary_double(MB_YES, &buffer[index], &(bathymetry->longitude)); index += 8;
-		mb_get_binary_float(MB_YES, &buffer[index], &(bathymetry->heading)); index += 4;
-		bathymetry->height_source = buffer[index]; index++;
-		mb_get_binary_float(MB_YES, &buffer[index], &(bathymetry->tide)); index += 4;
-		mb_get_binary_float(MB_YES, &buffer[index], &(bathymetry->roll)); index += 4;
-		mb_get_binary_float(MB_YES, &buffer[index], &(bathymetry->pitch)); index += 4;
-		mb_get_binary_float(MB_YES, &buffer[index], &(bathymetry->heave)); index += 4;
-		mb_get_binary_float(MB_YES, &buffer[index], &(bathymetry->vehicle_height)); index += 4;
-		for (i=0;i<bathymetry->number_beams;i++)
-			{
-			mb_get_binary_float(MB_YES, &buffer[index], &(bathymetry->depth[i])); index += 4;
-			mb_get_binary_float(MB_YES, &buffer[index], &(bathymetry->alongtrack[i])); index += 4;
-			mb_get_binary_float(MB_YES, &buffer[index], &(bathymetry->acrosstrack[i])); index += 4;
-			mb_get_binary_float(MB_YES, &buffer[index], &(bathymetry->pointing_angle[i])); index += 4;
-			mb_get_binary_float(MB_YES, &buffer[index], &(bathymetry->azimuth_angle[i])); index += 4;
-			}
-
-		/* now check to see if these data were written incorrectly with acrosstrack before alongtrack
-		 * (ashamedly, this was true for MB-System through 4.3.2000)
-		 * - if so, switch the arrays */
-		if (bathymetry->acrossalongerror == MB_MAYBE)
-			{
-			acrosstrackmax = 0.0;
-			alongtrackmax = 0.0;
-			for (i=0;i<bathymetry->number_beams;i++)
-				{
-				acrosstrackmax = MAX(acrosstrackmax, fabs(bathymetry->acrosstrack[i]));
-				alongtrackmax = MAX(alongtrackmax, fabs(bathymetry->alongtrack[i]));
-				}
-			if (alongtrackmax > acrosstrackmax)
-				{
-				bathymetry->nacrossalongerroryes++;
-				}
-			else
-				{
-				bathymetry->nacrossalongerrorno++;
-				}
-			if (bathymetry->nacrossalongerroryes > 10)
-				{
-				bathymetry->acrossalongerror = MB_YES;
-				}
-			else if (bathymetry->nacrossalongerrorno > 10)
-				{
-				bathymetry->acrossalongerror = MB_NO;
-				}
-			}
-		if (bathymetry->acrossalongerror == MB_YES
-			|| (bathymetry->acrossalongerror == MB_MAYBE && alongtrackmax > acrosstrackmax))
-			{
-			for (i=0;i<bathymetry->number_beams;i++)
-				{
-				acrosstrackmax = bathymetry->acrosstrack[i];
-				bathymetry->acrosstrack[i] = bathymetry->alongtrack[i];
-				bathymetry->alongtrack[i] = acrosstrackmax;
-				}
-			}
-
-		}
-	else
-		{
-		bathymetry->optionaldata = MB_NO;
-		bathymetry->frequency = 0.0;
-		bathymetry->latitude = 0.0;
-		bathymetry->longitude = 0.0;
-		bathymetry->heading = 0.0;
-		bathymetry->height_source = 0;
-		bathymetry->tide = 0.0;
-		bathymetry->roll = 0.0;
-		bathymetry->pitch = 0.0;
-		bathymetry->heave = 0.0;
-		bathymetry->vehicle_height = 0.0;
-		for (i=0;i<MBSYS_RESON7K_MAX_BEAMS;i++)
-			{
-			bathymetry->depth[i] = 0.0;
-			bathymetry->acrosstrack[i] = 0.0;
-			bathymetry->alongtrack[i] = 0.0;
-			bathymetry->pointing_angle[i] = 0.0;
-			bathymetry->azimuth_angle[i] = 0.0;
-			}
-		}
-
-	/* set kind */
-	if (status == MB_SUCCESS)
-		{
-		/* set kind */
-		store->kind = MB_DATA_DATA;
-		store->type = R7KRECID_7kBathymetricData;
-
-		/* get the time */
-		time_j[0] = header->s7kTime.Year;
-		time_j[1] = header->s7kTime.Day;
-		time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-		time_j[3] = (int) header->s7kTime.Seconds;
-		time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-		mb_get_itime(verbose, time_j, store->time_i);
-		mb_get_time(verbose, store->time_i, &(store->time_d));
-		}
-	else
-		{
-		store->kind = MB_DATA_NONE;
-		}
-
-	/* print out the results */
-#ifdef MBR_RESON7KR_DEBUG
-fprintf(stderr,"R7KRECID_7kBathymetricData:             7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d ping:%d\n",
-store->time_i[0],store->time_i[1],store->time_i[2],
-store->time_i[3],store->time_i[4],store->time_i[5],store->time_i[6],
-header->RecordNumber,bathymetry->ping_number);
-#endif
-#ifdef MBR_RESON7KR_DEBUG
-	if (verbose > 0)
-#else
-	if (verbose >= 2)
-#endif
-	mbsys_reson7k_print_bathymetry(verbose, bathymetry, error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_rd_backscatter(int verbose, char *buffer, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_reson7kr_rd_backscatter";
-	int	status = MB_SUCCESS;
-	struct mbsys_reson7k_struct *store;
-	s7k_header *header;
-	s7kr_backscatter *backscatter;
-	int	data_size;
-	int	index;
-	int	time_j[5];
-	short	*short_ptr;
-	int	*int_ptr;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       buffer:     %p\n",(void *)buffer);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	backscatter = &(store->backscatter);
-	header = &(backscatter->header);
-
-	/* extract the header */
-	index = 0;
-	status = mbr_reson7kr_rd_header(verbose, buffer, &index, header, error);
-
-	/* extract the data */
-	index = header->Offset + 4;
-	mb_get_binary_long(MB_YES, &buffer[index], &(backscatter->serial_number)); index += 8;
-	mb_get_binary_int(MB_YES, &buffer[index], &(backscatter->ping_number)); index += 4;
-	mb_get_binary_short(MB_YES, &buffer[index], &(backscatter->multi_ping)); index += 2;
-	mb_get_binary_float(MB_YES, &buffer[index], &(backscatter->beam_position)); index += 4;
-	mb_get_binary_int(MB_YES, &buffer[index], &(backscatter->control_flags)); index += 4;
-	mb_get_binary_int(MB_YES, &buffer[index], &(backscatter->number_samples)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(backscatter->port_beamwidth_x)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(backscatter->port_beamwidth_y)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(backscatter->stbd_beamwidth_x)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(backscatter->stbd_beamwidth_y)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(backscatter->port_steering_x)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(backscatter->port_steering_y)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(backscatter->stbd_steering_x)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(backscatter->stbd_steering_y)); index += 4;
-	mb_get_binary_short(MB_YES, &buffer[index], &(backscatter->number_beams)); index += 2;
-	mb_get_binary_short(MB_YES, &buffer[index], &(backscatter->current_beam)); index += 2;
-	backscatter->sample_size = buffer[index]; index++;
-	backscatter->data_type = buffer[index]; index++;
-
-	/* allocate memory if required */
-	data_size = backscatter->number_samples * backscatter->sample_size;
-	if (backscatter->nalloc < data_size)
-		{
-		status = mb_reallocd(verbose, __FILE__, __LINE__, data_size, (void **)&(backscatter->port_data), error);
-		if (status == MB_SUCCESS)
-		status = mb_reallocd(verbose, __FILE__, __LINE__, data_size, (void **)&(backscatter->stbd_data), error);
-		if (status == MB_SUCCESS)
-			{
-			backscatter->nalloc = data_size;
-			}
-		else
-			{
-			backscatter->nalloc = 0;
-			backscatter->number_samples = 0;
-			}
-		}
-
-	/* extract backscatter data */
-	if (backscatter->sample_size == 1)
-		{
-		for (i=0;i<backscatter->number_samples;i++)
-			{
-			backscatter->port_data[i] = buffer[index]; index++;
-			}
-		for (i=0;i<backscatter->number_samples;i++)
-			{
-			backscatter->stbd_data[i] = buffer[index]; index++;
-			}
-		}
-	else if (backscatter->sample_size == 2)
-		{
-		short_ptr = (short *) backscatter->port_data;
-		for (i=0;i<backscatter->number_samples;i++)
-			{
-			mb_get_binary_short(MB_YES, &buffer[index], &(short_ptr[i])); index += 2;
-			}
-		short_ptr = (short *) backscatter->stbd_data;
-		for (i=0;i<backscatter->number_samples;i++)
-			{
-			mb_get_binary_short(MB_YES, &buffer[index], &(short_ptr[i])); index += 2;
-			}
-		}
-	else if (backscatter->sample_size == 4)
-		{
-		int_ptr = (int *) backscatter->port_data;
-		for (i=0;i<backscatter->number_samples;i++)
-			{
-			mb_get_binary_int(MB_YES, &buffer[index], &(int_ptr[i])); index += 4;
-			}
-		int_ptr = (int *) backscatter->stbd_data;
-		for (i=0;i<backscatter->number_samples;i++)
-			{
-			mb_get_binary_int(MB_YES, &buffer[index], &(int_ptr[i])); index += 4;
-			}
-		}
-
-	/* extract the optional data */
-	if (header->OffsetToOptionalData > 0)
-		{
-		index = header->OffsetToOptionalData;
-		backscatter->optionaldata = MB_YES;
-		mb_get_binary_float(MB_YES, &buffer[index], &(backscatter->frequency)); index += 4;
-		mb_get_binary_double(MB_YES, &buffer[index], &(backscatter->latitude)); index += 8;
-		mb_get_binary_double(MB_YES, &buffer[index], &(backscatter->longitude)); index += 8;
-		mb_get_binary_float(MB_YES, &buffer[index], &(backscatter->heading)); index += 4;
-		mb_get_binary_float(MB_YES, &buffer[index], &(backscatter->altitude)); index += 4;
-		}
-	else
-		{
-		backscatter->optionaldata = MB_NO;
-		backscatter->frequency = 0.0;
-		backscatter->latitude = 0.0;
-		backscatter->longitude = 0.0;
-		backscatter->heading = 0.0;
-		backscatter->altitude = 0.0;
-		}
-
-	/* set kind */
-	if (status == MB_SUCCESS)
-		{
-		/* set kind */
-		store->kind = MB_DATA_DATA;
-		store->type = R7KRECID_7kBackscatterImageData;
-
-		/* get the time */
-		time_j[0] = header->s7kTime.Year;
-		time_j[1] = header->s7kTime.Day;
-		time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-		time_j[3] = (int) header->s7kTime.Seconds;
-		time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-		mb_get_itime(verbose, time_j, store->time_i);
-		mb_get_time(verbose, store->time_i, &(store->time_d));
-		}
-	else
-		{
-		store->kind = MB_DATA_NONE;
-		}
-
-	/* print out the results */
-#ifdef MBR_RESON7KR_DEBUG
-fprintf(stderr,"R7KRECID_7kBackscatterImageData:        7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d ping:%d\n",
-store->time_i[0],store->time_i[1],store->time_i[2],
-store->time_i[3],store->time_i[4],store->time_i[5],store->time_i[6],
-header->RecordNumber,backscatter->ping_number);
-#endif
-#ifdef MBR_RESON7KR_DEBUG
-	if (verbose > 0)
-#else
-	if (verbose >= 2)
-#endif
-	mbsys_reson7k_print_backscatter(verbose, backscatter, error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_rd_beam(int verbose, char *buffer, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_reson7kr_rd_beam";
-	int	status = MB_SUCCESS;
-	struct mbsys_reson7k_struct *store;
-	s7k_header *header;
-	s7kr_beam *beam;
-	s7kr_snippet *snippet;
-	int	index;
-	int	time_j[5];
-	int	nalloc_amp;
-	int	nalloc_phase;
-	int	nsamples;
-	int	sample_type_amp;
-	int	sample_type_phase;
-	int	sample_type_iandq;
-	char	*charptr;
-	unsigned short 	*ushortptr;
-	unsigned int	*uintptr;
-	short	*shortptramp;
-	short	*shortptrphase;
-	int	*intptramp;
-	int	*intptrphase;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       buffer:     %p\n",(void *)buffer);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	beam = &(store->beam);
-	header = &(beam->header);
-
-	/* extract the header */
-	index = 0;
-	status = mbr_reson7kr_rd_header(verbose, buffer, &index, header, error);
-
-	/* extract the data */
-	index = header->Offset + 4;
-	mb_get_binary_long(MB_YES, &buffer[index], &(beam->serial_number)); index += 8;
-	mb_get_binary_int(MB_YES, &buffer[index], &(beam->ping_number)); index += 4;
-	mb_get_binary_short(MB_YES, &buffer[index], &(beam->multi_ping)); index += 2;
-	mb_get_binary_short(MB_YES, &buffer[index], &(beam->number_beams)); index += 2;
-	mb_get_binary_short(MB_YES, &buffer[index], &(beam->reserved)); index += 2;
-	mb_get_binary_int(MB_YES, &buffer[index], &(beam->number_samples)); index += 4;
-	beam->record_subset_flag = buffer[index]; index++;
-	beam->row_column_flag = buffer[index]; index++;
-	mb_get_binary_short(MB_YES, &buffer[index], &(beam->sample_header_id)); index += 2;
-	mb_get_binary_int(MB_YES, &buffer[index], &(beam->sample_type)); index += 4;
-	sample_type_amp = beam->sample_type & 15;
-	sample_type_phase = (beam->sample_type >> 4) & 15;
-	sample_type_iandq = (beam->sample_type >> 8) & 15;
-	for (i=0;i<beam->number_beams;i++)
-		{
-		snippet = &beam->snippets[i];
-		mb_get_binary_short(MB_YES, &buffer[index], &(snippet->beam_number)); index += 2;
-		mb_get_binary_int(MB_YES, &buffer[index], &(snippet->begin_sample)); index += 4;
-		mb_get_binary_int(MB_YES, &buffer[index], &(snippet->end_sample)); index += 4;
-		}
-
-	for (i=0;i<beam->number_beams;i++)
-		{
-		/* allocate memory for snippet if needed */
-		snippet = &beam->snippets[i];
-		nalloc_amp = 0;
-		nalloc_phase = 0;
-		if (sample_type_amp == 1)
-			nalloc_amp += 1;
-		else if (sample_type_amp == 2)
-			nalloc_amp += 2;
-		else if (sample_type_amp == 3)
-			nalloc_amp += 4;
-		if (sample_type_phase == 1)
-			nalloc_phase += 1;
-		else if (sample_type_phase == 2)
-			nalloc_phase += 2;
-		else if (sample_type_phase == 3)
-			nalloc_phase += 4;
-		if (sample_type_iandq == 1)
-			{
-			nalloc_amp += 2;
-			nalloc_phase += 2;
-			}
-		else if (sample_type_iandq == 2)
-			{
-			nalloc_amp += 4;
-			nalloc_phase += 4;
-			}
-		nalloc_amp *= (snippet->end_sample - snippet->begin_sample + 1);
-		nalloc_phase *= (snippet->end_sample - snippet->begin_sample + 1);
-		if (status == MB_SUCCESS
-			&& (snippet->nalloc_amp < nalloc_amp || snippet->nalloc_phase < nalloc_phase))
-			{
-			snippet->nalloc_amp = nalloc_amp;
-			if (status == MB_SUCCESS)
-			status = mb_reallocd(verbose, __FILE__, __LINE__, snippet->nalloc_amp,
-						(void **) &(snippet->amplitude), error);
-			snippet->nalloc_phase = nalloc_phase;
-			if (status == MB_SUCCESS)
-			status = mb_reallocd(verbose, __FILE__, __LINE__, snippet->nalloc_phase,
-						(void **) &(snippet->phase), error);
-			if (status != MB_SUCCESS)
-				{
-				snippet->nalloc_amp = 0;
-				snippet->nalloc_phase = 0;
-				}
-			}
-
-		/* extract snippet or beam data */
-		if (status == MB_SUCCESS)
-			{
-			nsamples = snippet->end_sample - snippet->begin_sample + 1;
-			for (j=0;j<nsamples;j++)
-				{
-				if (sample_type_amp == 1)
-					{
-					charptr = (char *)snippet->amplitude;
-					charptr[j] = buffer[index]; index++;
-					}
-				else if (sample_type_amp == 2)
-					{
-					ushortptr = (unsigned short *)snippet->amplitude;
-					mb_get_binary_short(MB_YES, &buffer[index], &(ushortptr[j])); index += 2;
-					}
-				else if (sample_type_amp == 3)
-					{
-					uintptr = (unsigned int *)snippet->amplitude;
-					mb_get_binary_int(MB_YES, &buffer[index], &(uintptr[j])); index += 4;
-					}
-				if (sample_type_phase == 1)
-					{
-					charptr = (char *)snippet->phase;
-					charptr[j] = buffer[index]; index++;
-					}
-				else if (sample_type_phase == 2)
-					{
-					ushortptr = (unsigned short *)snippet->phase;
-					mb_get_binary_short(MB_YES, &buffer[index], &(ushortptr[j])); index += 2;
-					}
-				else if (sample_type_phase == 3)
-					{
-					uintptr = (unsigned int *)snippet->phase;
-					mb_get_binary_int(MB_YES, &buffer[index], &(uintptr[j])); index += 4;
-					}
-				if (sample_type_iandq == 1)
-					{
-					shortptramp = (short *)snippet->amplitude;
-					shortptrphase = (short *)snippet->phase;
-					mb_get_binary_short(MB_YES, &buffer[index], &(shortptramp[j])); index += 2;
-					mb_get_binary_short(MB_YES, &buffer[index], &(shortptrphase[j])); index += 2;
-					}
-				else if (sample_type_iandq == 2)
-					{
-					intptramp = (int *)snippet->amplitude;
-					intptrphase = (int *)snippet->phase;
-					mb_get_binary_int(MB_YES, &buffer[index], &(intptramp[j])); index += 4;
-					mb_get_binary_int(MB_YES, &buffer[index], &(intptrphase[j])); index += 4;
-					}
-				}
-			}
-		}
-
-	/* set kind */
-	if (status == MB_SUCCESS)
-		{
-		/* set kind */
-		store->kind = MB_DATA_DATA;
-		store->type = R7KRECID_7kBeamData;
-
-		/* get the time */
-		time_j[0] = header->s7kTime.Year;
-		time_j[1] = header->s7kTime.Day;
-		time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-		time_j[3] = (int) header->s7kTime.Seconds;
-		time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-		mb_get_itime(verbose, time_j, store->time_i);
-		mb_get_time(verbose, store->time_i, &(store->time_d));
-		}
-	else
-		{
-		store->kind = MB_DATA_NONE;
-		}
-
-	/* print out the results */
-#ifdef MBR_RESON7KR_DEBUG
-fprintf(stderr,"R7KHDRSIZE_7kBeamData: 7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d ping:%d\n",
-store->time_i[0],store->time_i[1],store->time_i[2],
-store->time_i[3],store->time_i[4],store->time_i[5],store->time_i[6],
-header->RecordNumber,beam->ping_number);
-#endif
-#ifdef MBR_RESON7KR_DEBUG
-	if (verbose > 0)
-#else
-	if (verbose >= 2)
-#endif
-	mbsys_reson7k_print_beam(verbose, beam, error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_rd_verticaldepth(int verbose, char *buffer, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_reson7kr_rd_verticaldepth";
-	int	status = MB_SUCCESS;
-	struct mbsys_reson7k_struct *store;
-	s7k_header *header;
-	s7kr_verticaldepth *verticaldepth;
-	int	index;
-	int	time_j[5];
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       buffer:     %p\n",(void *)buffer);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	verticaldepth = &(store->verticaldepth);
-	header = &(verticaldepth->header);
-
-	/* extract the header */
-	index = 0;
-	status = mbr_reson7kr_rd_header(verbose, buffer, &index, header, error);
-
-	/* extract the data */
-	index = header->Offset + 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(verticaldepth->frequency)); index += 4;
-	mb_get_binary_int(MB_YES, &buffer[index], &(verticaldepth->ping_number)); index += 4;
-	mb_get_binary_short(MB_YES, &buffer[index], &(verticaldepth->multi_ping)); index += 2;
-	mb_get_binary_double(MB_YES, &buffer[index], &(verticaldepth->latitude)); index += 8;
-	mb_get_binary_double(MB_YES, &buffer[index], &(verticaldepth->longitude)); index += 8;
-	mb_get_binary_float(MB_YES, &buffer[index], &(verticaldepth->heading)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(verticaldepth->alongtrack)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(verticaldepth->acrosstrack)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(verticaldepth->vertical_depth)); index += 4;
-
-	/* set kind */
-	if (status == MB_SUCCESS)
-		{
-		/* set kind */
-		store->kind = MB_DATA_DATA;
-		store->type = R7KRECID_7kVerticalDepth;
-
-		/* get the time */
-		time_j[0] = header->s7kTime.Year;
-		time_j[1] = header->s7kTime.Day;
-		time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-		time_j[3] = (int) header->s7kTime.Seconds;
-		time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-		mb_get_itime(verbose, time_j, store->time_i);
-		mb_get_time(verbose, store->time_i, &(store->time_d));
-		}
-	else
-		{
-		store->kind = MB_DATA_NONE;
-		}
-
-	/* print out the results */
-#ifdef MBR_RESON7KR_DEBUG
-fprintf(stderr,"R7KRECID_7kVerticalDepth:               7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d ping:%d\n",
-store->time_i[0],store->time_i[1],store->time_i[2],
-store->time_i[3],store->time_i[4],store->time_i[5],store->time_i[6],
-header->RecordNumber,verticaldepth->ping_number);
-#endif
-#ifdef MBR_RESON7KR_DEBUG
-	if (verbose > 0)
-#else
-	if (verbose >= 2)
-#endif
-	mbsys_reson7k_print_verticaldepth(verbose, verticaldepth, error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_rd_tvg(int verbose, char *buffer, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_reson7kr_rd_tvg";
-	int	status = MB_SUCCESS;
-	struct mbsys_reson7k_struct *store;
-	s7k_header *header;
-	s7kr_tvg *tvg;
-	int	index;
-	int	time_j[5];
-	int	nalloc;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       buffer:     %p\n",(void *)buffer);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	tvg = &(store->tvg);
-	header = &(tvg->header);
-
-	/* extract the header */
-	index = 0;
-	status = mbr_reson7kr_rd_header(verbose, buffer, &index, header, error);
-
-	/* extract the data */
-	index = header->Offset + 4;
-	mb_get_binary_long(MB_YES, &buffer[index], &(tvg->serial_number)); index += 8;
-	mb_get_binary_int(MB_YES, &buffer[index], &(tvg->ping_number)); index += 4;
-	mb_get_binary_short(MB_YES, &buffer[index], &(tvg->multi_ping)); index += 2;
-	mb_get_binary_int(MB_YES, &buffer[index], &(tvg->n)); index += 4;
-	for (i=0;i<8;i++)
-		{
-		mb_get_binary_int(MB_YES, &buffer[index], &(tvg->reserved[i])); index += 4;
-		}
-
-	/* allocate memory for tvg if needed */
-	nalloc = tvg->n * sizeof(float);
-	if (status == MB_SUCCESS
-		&& tvg->nalloc < nalloc)
-		{
-		tvg->nalloc = nalloc;
-		if (status == MB_SUCCESS)
-		status = mb_reallocd(verbose, __FILE__, __LINE__, tvg->nalloc,
-					(void **)&(tvg->tvg), error);
-		if (status != MB_SUCCESS)
-			{
-			tvg->nalloc = 0;
-			}
-		}
-
-	/* extract tvg data */
-	memcpy((void *)tvg->tvg, (const void *)&buffer[index], (size_t)(tvg->n * sizeof(float)));
-
-	/* set kind */
-	if (status == MB_SUCCESS)
-		{
-		/* set kind */
-		store->kind = MB_DATA_DATA;
-		store->type = R7KRECID_7kTVGData;
-
-		/* get the time */
-		time_j[0] = header->s7kTime.Year;
-		time_j[1] = header->s7kTime.Day;
-		time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-		time_j[3] = (int) header->s7kTime.Seconds;
-		time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-		mb_get_itime(verbose, time_j, store->time_i);
-		mb_get_time(verbose, store->time_i, &(store->time_d));
-		}
-	else
-		{
-		store->kind = MB_DATA_NONE;
-		}
-
-	/* print out the results */
-#ifdef MBR_RESON7KR_DEBUG
-fprintf(stderr,"R7KRECID_7kTVGData:                   7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d ping:%d\n",
-store->time_i[0],store->time_i[1],store->time_i[2],
-store->time_i[3],store->time_i[4],store->time_i[5],store->time_i[6],
-header->RecordNumber,tvg->ping_number);
-#endif
-#ifdef MBR_RESON7KR_DEBUG
-	if (verbose > 0)
-#else
-	if (verbose >= 2)
-#endif
-	mbsys_reson7k_print_tvg(verbose, tvg, error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_rd_image(int verbose, char *buffer, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_reson7kr_rd_image";
-	int	status = MB_SUCCESS;
-	struct mbsys_reson7k_struct *store;
-	s7k_header *header;
-	s7kr_image *image;
-	int	index;
-	int	time_j[5];
-	int	nalloc;
-	char	*charptr;
-	unsigned short 	*ushortptr;
-	unsigned int	*uintptr;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       buffer:     %p\n",(void *)buffer);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	image = &(store->image);
-	header = &(image->header);
-
-	/* extract the header */
-	index = 0;
-	status = mbr_reson7kr_rd_header(verbose, buffer, &index, header, error);
-
-	/* extract the data */
-	index = header->Offset + 4;
-	mb_get_binary_int(MB_YES, &buffer[index], &(image->ping_number)); index += 4;
-	mb_get_binary_short(MB_YES, &buffer[index], &(image->multi_ping)); index += 2;
-	mb_get_binary_int(MB_YES, &buffer[index], &(image->width)); index += 4;
-	mb_get_binary_int(MB_YES, &buffer[index], &(image->height)); index += 4;
-	mb_get_binary_short(MB_YES, &buffer[index], &(image->color_depth)); index += 2;
-	mb_get_binary_short(MB_YES, &buffer[index], &(image->width_height_flag)); index += 2;
-	mb_get_binary_short(MB_YES, &buffer[index], &(image->compression)); index += 2;
-
-	/* allocate memory for image if needed */
-	nalloc = image->width * image->height * image->color_depth;
-	if (status == MB_SUCCESS
-		&& image->nalloc < nalloc)
-		{
-		image->nalloc = nalloc;
-		if (status == MB_SUCCESS)
-		status = mb_reallocd(verbose, __FILE__, __LINE__, image->nalloc,
-					(void **)&(image->image), error);
-		if (status != MB_SUCCESS)
-			{
-			image->nalloc = 0;
-			image->width = 0;
-			image->height = 0;
-			}
-		}
-
-	/* extract image data */
-	if (image->color_depth == 1)
-		{
-		charptr = (char *)image->image;
-		for (i=0;i<image->width * image->height;i++)
-			{
-			charptr[i] = buffer[index]; index++;
-			}
-		}
-	else if (image->color_depth == 2)
-		{
-		ushortptr = (unsigned short *)image->image;
-		for (i=0;i<image->width * image->height;i++)
-			{
-			mb_get_binary_short(MB_YES, &buffer[index], &(ushortptr[i])); index += 2;
-			}
-		}
-	else if (image->color_depth == 4)
-		{
-		uintptr = (unsigned int *)image->image;
-		for (i=0;i<image->width * image->height;i++)
-			{
-			mb_get_binary_int(MB_YES, &buffer[index], &(uintptr[i])); index += 4;
-			}
-		}
-
-	/* set kind */
-	if (status == MB_SUCCESS)
-		{
-		/* set kind */
-		store->kind = MB_DATA_DATA;
-		store->type = R7KRECID_7kImageData;
-
-		/* get the time */
-		time_j[0] = header->s7kTime.Year;
-		time_j[1] = header->s7kTime.Day;
-		time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-		time_j[3] = (int) header->s7kTime.Seconds;
-		time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-		mb_get_itime(verbose, time_j, store->time_i);
-		mb_get_time(verbose, store->time_i, &(store->time_d));
-		}
-	else
-		{
-		store->kind = MB_DATA_NONE;
-		}
-
-	/* print out the results */
-#ifdef MBR_RESON7KR_DEBUG
-fprintf(stderr,"R7KRECID_7kImageData:                   7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d ping:%d\n",
-store->time_i[0],store->time_i[1],store->time_i[2],
-store->time_i[3],store->time_i[4],store->time_i[5],store->time_i[6],
-header->RecordNumber,image->ping_number);
-#endif
-#ifdef MBR_RESON7KR_DEBUG
-	if (verbose > 0)
-#else
-	if (verbose >= 2)
-#endif
-	mbsys_reson7k_print_image(verbose, image, error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_rd_v2pingmotion(int verbose, char *buffer, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_reson7kr_rd_v2pingmotion";
-	int	status = MB_SUCCESS;
-	struct mbsys_reson7k_struct *store;
-	s7k_header *header;
-	s7kr_v2pingmotion *v2pingmotion;
-	int	index;
-	int	time_j[5];
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       buffer:     %p\n",(void *)buffer);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	v2pingmotion = &(store->v2pingmotion);
-	header = &(v2pingmotion->header);
-
-	/* extract the header */
-	index = 0;
-	status = mbr_reson7kr_rd_header(verbose, buffer, &index, header, error);
-
-	/* extract the data */
-	index = header->Offset + 4;
-	mb_get_binary_long(MB_YES, &buffer[index], &(v2pingmotion->serial_number)); index += 8;
-	mb_get_binary_int(MB_YES, &buffer[index], &(v2pingmotion->ping_number)); index += 4;
-	mb_get_binary_short(MB_YES, &buffer[index], &(v2pingmotion->multi_ping)); index += 2;
-	mb_get_binary_int(MB_YES, &buffer[index], &(v2pingmotion->n)); index += 4;
-	mb_get_binary_short(MB_YES, &buffer[index], &(v2pingmotion->flags)); index += 2;
-	mb_get_binary_int(MB_YES, &buffer[index], &(v2pingmotion->error_flags)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(v2pingmotion->frequency)); index += 4;
-	if (v2pingmotion->flags & 1)
-		{
-		mb_get_binary_float(MB_YES, &buffer[index], &(v2pingmotion->pitch)); index += 4;
-		}
-
-	/* allocate memory for v2pingmotion if needed */
-	if (status == MB_SUCCESS
-		&& v2pingmotion->nalloc < v2pingmotion->n)
-		{
-		v2pingmotion->nalloc = sizeof(float) * v2pingmotion->n;
-		if (status == MB_SUCCESS)
-		status = mb_reallocd(verbose, __FILE__, __LINE__, v2pingmotion->nalloc,
-					(void **)&(v2pingmotion->roll), error);
-		if (status != MB_SUCCESS)
-			{
-			v2pingmotion->nalloc = 0;
-			}
-		if (status == MB_SUCCESS)
-		status = mb_reallocd(verbose, __FILE__, __LINE__, v2pingmotion->nalloc,
-					(void **)&(v2pingmotion->heading), error);
-		if (status != MB_SUCCESS)
-			{
-			v2pingmotion->nalloc = 0;
-			}
-		if (status == MB_SUCCESS)
-		status = mb_reallocd(verbose, __FILE__, __LINE__, v2pingmotion->nalloc,
-					(void **)&(v2pingmotion->heave), error);
-		if (status != MB_SUCCESS)
-			{
-			v2pingmotion->nalloc = 0;
-			}
-		}
-
-	/* extract v2pingmotion data */
-	if (v2pingmotion->flags & 2)
-		{
-		for (i=0;i<v2pingmotion->n;i++)
-			{
-			mb_get_binary_float(MB_YES, &buffer[index], &(v2pingmotion->roll[i])); index += 4;
-			}
-		}
-	else
-		{
-		for (i=0;i<v2pingmotion->n;i++)
-			{
-			v2pingmotion->roll[i] = 0.0;
-			}
-		}
-	if (v2pingmotion->flags & 4)
-		{
-		for (i=0;i<v2pingmotion->n;i++)
-			{
-			mb_get_binary_float(MB_YES, &buffer[index], &(v2pingmotion->heading[i])); index += 4;
-			}
-		}
-	else
-		{
-		for (i=0;i<v2pingmotion->n;i++)
-			{
-			v2pingmotion->heading[i] = 0.0;
-			}
-		}
-	if (v2pingmotion->flags & 8)
-		{
-		for (i=0;i<v2pingmotion->n;i++)
-			{
-			mb_get_binary_float(MB_YES, &buffer[index], &(v2pingmotion->heave[i])); index += 4;
-			}
-		}
-	else
-		{
-		for (i=0;i<v2pingmotion->n;i++)
-			{
-			v2pingmotion->heave[i] = 0.0;
-			}
-		}
-
-	/* set kind */
-	if (status == MB_SUCCESS)
-		{
-		/* set kind */
-		store->kind = MB_DATA_DATA;
-		store->type = R7KRECID_7kV2PingMotion;
-
-		/* get the time */
-		time_j[0] = header->s7kTime.Year;
-		time_j[1] = header->s7kTime.Day;
-		time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-		time_j[3] = (int) header->s7kTime.Seconds;
-		time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-		mb_get_itime(verbose, time_j, store->time_i);
-		mb_get_time(verbose, store->time_i, &(store->time_d));
-		}
-	else
-		{
-		store->kind = MB_DATA_NONE;
-		}
-
-	/* print out the results */
-#ifdef MBR_RESON7KR_DEBUG
-fprintf(stderr,"R7KRECID_7kV2PingMotion:                   7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d ping:%d\n",
-store->time_i[0],store->time_i[1],store->time_i[2],
-store->time_i[3],store->time_i[4],store->time_i[5],store->time_i[6],
-header->RecordNumber,v2pingmotion->ping_number);
-#endif
-#ifdef MBR_RESON7KR_DEBUG
-	if (verbose > 0)
-#else
-	if (verbose >= 2)
-#endif
-	mbsys_reson7k_print_v2pingmotion(verbose, v2pingmotion, error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_rd_v2detectionsetup(int verbose, char *buffer, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_reson7kr_rd_v2detectionsetup";
-	int	status = MB_SUCCESS;
-	struct mbsys_reson7k_struct *store;
-	s7k_header *header;
-	s7kr_v2detectionsetup *v2detectionsetup;
-	int	index;
-	int	time_j[5];
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       buffer:     %p\n",(void *)buffer);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	v2detectionsetup = &(store->v2detectionsetup);
-	header = &(v2detectionsetup->header);
-
-	/* extract the header */
-	index = 0;
-	status = mbr_reson7kr_rd_header(verbose, buffer, &index, header, error);
-
-	/* extract the data */
-	index = header->Offset + 4;
-	mb_get_binary_long(MB_YES, &buffer[index], &(v2detectionsetup->serial_number)); index += 8;
-	mb_get_binary_int(MB_YES, &buffer[index], &(v2detectionsetup->ping_number)); index += 4;
-	mb_get_binary_short(MB_YES, &buffer[index], &(v2detectionsetup->multi_ping)); index += 2;
-	mb_get_binary_int(MB_YES, &buffer[index], &(v2detectionsetup->number_beams)); index += 4;
-	mb_get_binary_int(MB_YES, &buffer[index], &(v2detectionsetup->data_field_size)); index += 4;
-	v2detectionsetup->detection_algorithm = buffer[index]; index++;
-	mb_get_binary_int(MB_YES, &buffer[index], &(v2detectionsetup->detection_flags)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(v2detectionsetup->minimum_depth)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(v2detectionsetup->maximum_depth)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(v2detectionsetup->minimum_range)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(v2detectionsetup->maximum_range)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(v2detectionsetup->minimum_nadir_search)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(v2detectionsetup->maximum_nadir_search)); index += 4;
-	v2detectionsetup->automatic_filter_window = buffer[index]; index++;
-	mb_get_binary_float(MB_YES, &buffer[index], &(v2detectionsetup->applied_roll)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(v2detectionsetup->depth_gate_tilt)); index += 4;
-	for (i=0;i<14;i++)
-		{
-		mb_get_binary_float(MB_YES, &buffer[index], &(v2detectionsetup->reserved[i])); index += 4;
-		}
-
-	/* extract v2detectionsetup data */
-	for (i=0;i<v2detectionsetup->number_beams;i++)
-		{
-		mb_get_binary_short(MB_YES, &buffer[index], &(v2detectionsetup->beam_descriptor[i])); index += 2;
-		mb_get_binary_float(MB_YES, &buffer[index], &(v2detectionsetup->detection_point[i])); index += 4;
-		mb_get_binary_int(MB_YES, &buffer[index], &(v2detectionsetup->flags[i])); index += 4;
-		mb_get_binary_int(MB_YES, &buffer[index], &(v2detectionsetup->auto_limits_min_sample[i])); index += 4;
-		mb_get_binary_int(MB_YES, &buffer[index], &(v2detectionsetup->auto_limits_max_sample[i])); index += 4;
-		mb_get_binary_int(MB_YES, &buffer[index], &(v2detectionsetup->user_limits_min_sample[i])); index += 4;
-		mb_get_binary_int(MB_YES, &buffer[index], &(v2detectionsetup->user_limits_max_sample[i])); index += 4;
-		mb_get_binary_int(MB_YES, &buffer[index], &(v2detectionsetup->quality[i])); index += 4;
-		if (v2detectionsetup->data_field_size >= R7KRDTSIZE_7kV2DetectionSetup + 4)
-			{
-			mb_get_binary_float(MB_YES, &buffer[index], &(v2detectionsetup->uncertainty[i])); index += 4;
-			}
-		else
-			{
-			v2detectionsetup->uncertainty[i] = 0.0;
-			}
-		}
-
-	/* set kind */
-	if (status == MB_SUCCESS)
-		{
-		/* set kind */
-		store->kind = MB_DATA_DATA;
-		store->type = R7KRECID_7kV2DetectionSetup;
-
-		/* get the time */
-		time_j[0] = header->s7kTime.Year;
-		time_j[1] = header->s7kTime.Day;
-		time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-		time_j[3] = (int) header->s7kTime.Seconds;
-		time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-		mb_get_itime(verbose, time_j, store->time_i);
-		mb_get_time(verbose, store->time_i, &(store->time_d));
-		}
-	else
-		{
-		store->kind = MB_DATA_NONE;
-		}
-
-	/* print out the results */
-#ifdef MBR_RESON7KR_DEBUG
-fprintf(stderr,"R7KRECID_7kV2DetectionSetup:                   7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d ping:%d\n",
-store->time_i[0],store->time_i[1],store->time_i[2],
-store->time_i[3],store->time_i[4],store->time_i[5],store->time_i[6],
-header->RecordNumber,v2detectionsetup->ping_number);
-#endif
-#ifdef MBR_RESON7KR_DEBUG
-	if (verbose > 0)
-#else
-	if (verbose >= 2)
-#endif
-	mbsys_reson7k_print_v2detectionsetup(verbose, v2detectionsetup, error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_rd_v2beamformed(int verbose, char *buffer, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_reson7kr_rd_v2beamformed";
-	int	status = MB_SUCCESS;
-	struct mbsys_reson7k_struct *store;
-	s7k_header *header;
-	s7kr_v2beamformed *v2beamformed;
-	s7kr_v2amplitudephase *v2amplitudephase;
-	int	index;
-	int	time_j[5];
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       buffer:     %p\n",(void *)buffer);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	v2beamformed = &(store->v2beamformed);
-	header = &(v2beamformed->header);
-
-	/* extract the header */
-	index = 0;
-	status = mbr_reson7kr_rd_header(verbose, buffer, &index, header, error);
-
-	/* extract the data */
-	index = header->Offset + 4;
-	mb_get_binary_long(MB_YES, &buffer[index], &(v2beamformed->serial_number)); index += 8;
-	mb_get_binary_int(MB_YES, &buffer[index], &(v2beamformed->ping_number)); index += 4;
-	mb_get_binary_short(MB_YES, &buffer[index], &(v2beamformed->multi_ping)); index += 2;
-	mb_get_binary_short(MB_YES, &buffer[index], &(v2beamformed->number_beams)); index += 2;
-	mb_get_binary_int(MB_YES, &buffer[index], &(v2beamformed->number_samples)); index += 4;
-	for (i=0;i<32;i++)
-		{
-		v2beamformed->reserved[i] = buffer[index]; index++;
-		}
-
-	/* loop over all beams */
-	for (i=0;i<v2beamformed->number_beams;i++)
-		{
-		v2amplitudephase = &(v2beamformed->amplitudephase[i]);
-
-		/* allocate memory for v2beamformed if needed */
-		if (status == MB_SUCCESS
-			&& v2amplitudephase->nalloc < sizeof(short) * v2beamformed->number_samples)
-			{
-			v2amplitudephase->nalloc = sizeof(short) * v2beamformed->number_samples;
-			if (status == MB_SUCCESS)
-			status = mb_reallocd(verbose, __FILE__, __LINE__, v2amplitudephase->nalloc,
-						(void **)&(v2amplitudephase->amplitude), error);
-			if (status != MB_SUCCESS)
-				{
-				v2amplitudephase->nalloc = 0;
-				}
-			if (status == MB_SUCCESS)
-			status = mb_reallocd(verbose, __FILE__, __LINE__, v2amplitudephase->nalloc,
-						(void **)&(v2amplitudephase->phase), error);
-			if (status != MB_SUCCESS)
-				{
-				v2amplitudephase->nalloc = 0;
-				}
-			}
-
-		/* extract v2beamformed data */
-		for (j=0;j<v2beamformed->number_samples;j++)
-			{
-			mb_get_binary_short(MB_YES, &buffer[index], &(v2amplitudephase->amplitude[j])); index += 2;
-			mb_get_binary_short(MB_YES, &buffer[index], &(v2amplitudephase->phase[j])); index += 2;
-			}
-		v2amplitudephase->beam_number = i;
-		v2amplitudephase->number_samples = v2beamformed->number_samples;
-		}
-
-	/* set kind */
-	if (status == MB_SUCCESS)
-		{
-		/* set kind */
-		store->kind = MB_DATA_DATA;
-		store->type = R7KRECID_7kV2BeamformedData;
-
-		/* get the time */
-		time_j[0] = header->s7kTime.Year;
-		time_j[1] = header->s7kTime.Day;
-		time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-		time_j[3] = (int) header->s7kTime.Seconds;
-		time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-		mb_get_itime(verbose, time_j, store->time_i);
-		mb_get_time(verbose, store->time_i, &(store->time_d));
-		}
-	else
-		{
-		store->kind = MB_DATA_NONE;
-		}
-
-	/* print out the results */
-#ifdef MBR_RESON7KR_DEBUG
-fprintf(stderr,"R7KRECID_7kV2BeamformedData:                   7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d ping:%d\n",
-store->time_i[0],store->time_i[1],store->time_i[2],
-store->time_i[3],store->time_i[4],store->time_i[5],store->time_i[6],
-header->RecordNumber,v2beamformed->ping_number);
-#endif
-#ifdef MBR_RESON7KR_DEBUG
-	if (verbose > 0)
-#else
-	if (verbose >= 2)
-#endif
-	mbsys_reson7k_print_v2beamformed(verbose, v2beamformed, error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_rd_v2bite(int verbose, char *buffer, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_reson7kr_rd_v2bite";
-	int	status = MB_SUCCESS;
-	struct mbsys_reson7k_struct *store;
-	s7k_header *header;
-	s7kr_v2bite *v2bite;
-	s7kr_v2bitereport *report;
-	s7k_time *s7ktime;
-	s7kr_v2bitefield *bitefield;
-	int	index;
-	int	time_j[5];
-	int	i, j, k;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       buffer:     %p\n",(void *)buffer);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	v2bite = &(store->v2bite);
-	header = &(v2bite->header);
-
-	/* extract the header */
-	index = 0;
-	status = mbr_reson7kr_rd_header(verbose, buffer, &index, header, error);
-
-	/* extract the data */
-	index = header->Offset + 4;
-	mb_get_binary_short(MB_YES, &buffer[index], &(v2bite->number_reports)); index += 2;
-
-	/* allocate memory for v2bite->reports if needed */
-	if (status == MB_SUCCESS
-		&& v2bite->nalloc < v2bite->number_reports * sizeof(s7kr_v2bitereport))
-		{
-		v2bite->nalloc = v2bite->number_reports * sizeof(s7kr_v2bitereport);
-		if (status == MB_SUCCESS)
-		status = mb_reallocd(verbose, __FILE__, __LINE__, v2bite->nalloc,
-					(void **)&(v2bite->reports), error);
-		if (status != MB_SUCCESS)
-			{
-			v2bite->nalloc = 0;
-			}
-		}
-
-	/* loop over all bite reports */
-	for (i=0;i<v2bite->number_reports;i++)
-		{
-		report = &(v2bite->reports[i]);
-
-		for (j=0;j<64;j++)
-			{
-			report->source_name[j] = buffer[index]; index++;
-			}
-		report->source_address = buffer[index]; index++;
-		mb_get_binary_float(MB_YES, &buffer[index], &(report->frequency)); index += 4;
-		mb_get_binary_short(MB_YES, &buffer[index], &(report->enumerator)); index += 2;
-
-		s7ktime = &(report->downlink_time);
-		mb_get_binary_short(MB_YES, &buffer[index], &(s7ktime->Year)); index += 2;
-		mb_get_binary_short(MB_YES, &buffer[index], &(s7ktime->Day)); index += 2;
-		mb_get_binary_float(MB_YES, &buffer[index], &(s7ktime->Seconds)); index += 4;
-		s7ktime->Hours = (mb_u_char) buffer[index]; index++;
-		s7ktime->Minutes = (mb_u_char) buffer[index]; index++;
-
-		s7ktime = &(report->uplink_time);
-		mb_get_binary_short(MB_YES, &buffer[index], &(s7ktime->Year)); index += 2;
-		mb_get_binary_short(MB_YES, &buffer[index], &(s7ktime->Day)); index += 2;
-		mb_get_binary_float(MB_YES, &buffer[index], &(s7ktime->Seconds)); index += 4;
-		s7ktime->Hours = (mb_u_char) buffer[index]; index++;
-		s7ktime->Minutes = (mb_u_char) buffer[index]; index++;
-
-		s7ktime = &(report->bite_time);
-		mb_get_binary_short(MB_YES, &buffer[index], &(s7ktime->Year)); index += 2;
-		mb_get_binary_short(MB_YES, &buffer[index], &(s7ktime->Day)); index += 2;
-		mb_get_binary_float(MB_YES, &buffer[index], &(s7ktime->Seconds)); index += 4;
-		s7ktime->Hours = (mb_u_char) buffer[index]; index++;
-		s7ktime->Minutes = (mb_u_char) buffer[index]; index++;
-
-		report->status = buffer[index]; index++;
-		mb_get_binary_short(MB_YES, &buffer[index], &(report->number_bite)); index += 2;
-		for (j=0;j<32;j++)
-			{
-			report->bite_status[j] = buffer[index]; index++;
-			}
-
-		/* loop over all bite fields */
-		for (j=0;j<report->number_bite;j++)
-			{
-			bitefield = &(report->bitefield[j]);
-
-			mb_get_binary_short(MB_YES, &buffer[index], &(bitefield->reserved)); index += 2;
-			for (k=0;k<64;k++)
-				{
-				bitefield->name[k] = buffer[index]; index++;
-				}
-			bitefield->device_type = buffer[index]; index++;
-			mb_get_binary_float(MB_YES, &buffer[index], &(bitefield->minimum)); index += 4;
-			mb_get_binary_float(MB_YES, &buffer[index], &(bitefield->maximum)); index += 4;
-			mb_get_binary_float(MB_YES, &buffer[index], &(bitefield->value)); index += 4;
-			}
-		}
-
-	/* set kind */
-	if (status == MB_SUCCESS)
-		{
-		/* set kind */
-		store->kind = MB_DATA_PARAMETER;
-		store->type = R7KRECID_7kV2BITEData;
-
-		/* get the time */
-		time_j[0] = header->s7kTime.Year;
-		time_j[1] = header->s7kTime.Day;
-		time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-		time_j[3] = (int) header->s7kTime.Seconds;
-		time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-		mb_get_itime(verbose, time_j, store->time_i);
-		mb_get_time(verbose, store->time_i, &(store->time_d));
-		}
-	else
-		{
-		store->kind = MB_DATA_NONE;
-		}
-
-	/* print out the results */
-#ifdef MBR_RESON7KR_DEBUG
-fprintf(stderr,"R7KRECID_7kV2BITEData:                   7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d size:%d index:%d\n",
-store->time_i[0],store->time_i[1],store->time_i[2],
-store->time_i[3],store->time_i[4],store->time_i[5],store->time_i[6],
-header->RecordNumber,header->Size,index);
-#endif
-#ifdef MBR_RESON7KR_DEBUG
-	if (verbose > 0)
-#else
-	if (verbose >= 2)
-#endif
-	mbsys_reson7k_print_v2bite(verbose, v2bite, error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_rd_v27kcenterversion(int verbose, char *buffer, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_reson7kr_rd_v27kcenterversion";
-	int	status = MB_SUCCESS;
-	struct mbsys_reson7k_struct *store;
-	s7k_header *header;
-	s7kr_v27kcenterversion *v27kcenterversion;
-	int	index;
-	int	time_j[5];
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       buffer:     %p\n",(void *)buffer);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	v27kcenterversion = &(store->v27kcenterversion);
-	header = &(v27kcenterversion->header);
-
-	/* extract the header */
-	index = 0;
-	status = mbr_reson7kr_rd_header(verbose, buffer, &index, header, error);
-
-	/* extract the data */
-	index = header->Offset + 4;
-	for (i=0;i<32;i++)
-		{
-		v27kcenterversion->version[i] = buffer[index]; index++;
-		}
-
-	/* set kind */
-	if (status == MB_SUCCESS)
-		{
-		/* set kind */
-		store->kind = MB_DATA_PARAMETER;
-		store->type = R7KRECID_7kV27kCenterVersion;
-
-		/* get the time */
-		time_j[0] = header->s7kTime.Year;
-		time_j[1] = header->s7kTime.Day;
-		time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-		time_j[3] = (int) header->s7kTime.Seconds;
-		time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-		mb_get_itime(verbose, time_j, store->time_i);
-		mb_get_time(verbose, store->time_i, &(store->time_d));
-		}
-	else
-		{
-		store->kind = MB_DATA_NONE;
-		}
-
-	/* print out the results */
-#ifdef MBR_RESON7KR_DEBUG
-fprintf(stderr,"R7KRECID_7kV27kCenterVersion:                   7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d size:%d index:%d\n",
-store->time_i[0],store->time_i[1],store->time_i[2],
-store->time_i[3],store->time_i[4],store->time_i[5],store->time_i[6],
-header->RecordNumber,header->Size,index);
-#endif
-#ifdef MBR_RESON7KR_DEBUG
-	if (verbose > 0)
-#else
-	if (verbose >= 2)
-#endif
-	mbsys_reson7k_print_v27kcenterversion(verbose, v27kcenterversion, error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_rd_v28kwetendversion(int verbose, char *buffer, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_reson7kr_rd_v28kwetendversion";
-	int	status = MB_SUCCESS;
-	struct mbsys_reson7k_struct *store;
-	s7k_header *header;
-	s7kr_v28kwetendversion *v28kwetendversion;
-	int	index;
-	int	time_j[5];
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       buffer:     %p\n",(void *)buffer);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	v28kwetendversion = &(store->v28kwetendversion);
-	header = &(v28kwetendversion->header);
-
-	/* extract the header */
-	index = 0;
-	status = mbr_reson7kr_rd_header(verbose, buffer, &index, header, error);
-
-	/* extract the data */
-	index = header->Offset + 4;
-	for (i=0;i<32;i++)
-		{
-		v28kwetendversion->version[i] = buffer[index]; index++;
-		}
-
-	/* set kind */
-	if (status == MB_SUCCESS)
-		{
-		/* set kind */
-		store->kind = MB_DATA_PARAMETER;
-		store->type = R7KRECID_7kV28kWetEndVersion;
-
-		/* get the time */
-		time_j[0] = header->s7kTime.Year;
-		time_j[1] = header->s7kTime.Day;
-		time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-		time_j[3] = (int) header->s7kTime.Seconds;
-		time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-		mb_get_itime(verbose, time_j, store->time_i);
-		mb_get_time(verbose, store->time_i, &(store->time_d));
-		}
-	else
-		{
-		store->kind = MB_DATA_NONE;
-		}
-
-	/* print out the results */
-#ifdef MBR_RESON7KR_DEBUG
-fprintf(stderr,"R7KRECID_7kV28kWetEndVersion:                   7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d size:%d index:%d\n",
-store->time_i[0],store->time_i[1],store->time_i[2],
-store->time_i[3],store->time_i[4],store->time_i[5],store->time_i[6],
-header->RecordNumber,header->Size,index);
-#endif
-#ifdef MBR_RESON7KR_DEBUG
-	if (verbose > 0)
-#else
-	if (verbose >= 2)
-#endif
-	mbsys_reson7k_print_v28kwetendversion(verbose, v28kwetendversion, error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_rd_v2detection(int verbose, char *buffer, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_reson7kr_rd_v2detection";
-	int	status = MB_SUCCESS;
-	struct mbsys_reson7k_struct *store;
-	s7k_header *header;
-	s7kr_v2detection *v2detection;
-	int	index;
-	int	time_j[5];
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       buffer:     %p\n",(void *)buffer);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	v2detection = &(store->v2detection);
-	header = &(v2detection->header);
-
-	/* extract the header */
-	index = 0;
-	status = mbr_reson7kr_rd_header(verbose, buffer, &index, header, error);
-
-	/* extract the data */
-	index = header->Offset + 4;
-	mb_get_binary_long(MB_YES, &buffer[index], &(v2detection->serial_number)); index += 8;
-	mb_get_binary_int(MB_YES, &buffer[index], &(v2detection->ping_number)); index += 4;
-	mb_get_binary_short(MB_YES, &buffer[index], &(v2detection->multi_ping)); index += 2;
-	mb_get_binary_int(MB_YES, &buffer[index], &(v2detection->number_beams)); index += 4;
-	mb_get_binary_int(MB_YES, &buffer[index], &(v2detection->data_field_size)); index += 4;
-	mb_get_binary_long(MB_YES, &buffer[index], &(v2detection->corrections)); index += 8;
-	v2detection->detection_algorithm = buffer[index]; index++;
-	mb_get_binary_int(MB_YES, &buffer[index], &(v2detection->flags)); index += 4;
-	for (i=0;i<64;i++)
-		{
-		v2detection->reserved[i] = buffer[index]; index++;
-		}
-
-	/* extract the data */
-	for (i=0;i<v2detection->number_beams;i++)
-		{
-		mb_get_binary_float(MB_YES, &buffer[index], &(v2detection->range[i])); index += 4;
-		mb_get_binary_float(MB_YES, &buffer[index], &(v2detection->angle_x[i])); index += 4;
-		mb_get_binary_float(MB_YES, &buffer[index], &(v2detection->angle_y[i])); index += 4;
-		mb_get_binary_float(MB_YES, &buffer[index], &(v2detection->range_error[i])); index += 4;
-		mb_get_binary_float(MB_YES, &buffer[index], &(v2detection->angle_x_error[i])); index += 4;
-		mb_get_binary_float(MB_YES, &buffer[index], &(v2detection->angle_y_error[i])); index += 4;
-
-		/* skip extra data if it exists */
-		if (v2detection->data_field_size > 24)
-			index += v2detection->data_field_size - 24;
-		}
-
-	/* set kind */
-	if (status == MB_SUCCESS)
-		{
-		/* set kind */
-		store->kind = MB_DATA_DATA;
-		store->type = R7KRECID_7kV2Detection;
-
-		/* get the time */
-		time_j[0] = header->s7kTime.Year;
-		time_j[1] = header->s7kTime.Day;
-		time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-		time_j[3] = (int) header->s7kTime.Seconds;
-		time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-		mb_get_itime(verbose, time_j, store->time_i);
-		mb_get_time(verbose, store->time_i, &(store->time_d));
-		}
-	else
-		{
-		store->kind = MB_DATA_NONE;
-		}
-
-	/* print out the results */
-#ifdef MBR_RESON7KR_DEBUG
-fprintf(stderr,"R7KRECID_7kV2Detection:             7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d ping:%d\n",
-store->time_i[0],store->time_i[1],store->time_i[2],
-store->time_i[3],store->time_i[4],store->time_i[5],store->time_i[6],
-header->RecordNumber,v2detection->ping_number);
-#endif
-#ifdef MBR_RESON7KR_DEBUG
-	if (verbose > 0)
-#else
-	if (verbose >= 2)
-#endif
-	mbsys_reson7k_print_v2detection(verbose, v2detection, error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_rd_v2rawdetection(int verbose, char *buffer, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_reson7kr_rd_v2rawdetection";
-	int	status = MB_SUCCESS;
-	struct mbsys_reson7k_struct *store;
-	s7k_header *header;
-	s7kr_v2rawdetection *v2rawdetection;
-	s7kr_bathymetry *bathymetry;
-	int	index;
-	int	time_j[5];
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       buffer:     %p\n",(void *)buffer);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	v2rawdetection = &(store->v2rawdetection);
-	header = &(v2rawdetection->header);
-	bathymetry = &(store->bathymetry);
-
-	/* extract the header */
-	index = 0;
-	status = mbr_reson7kr_rd_header(verbose, buffer, &index, header, error);
-
-	/* extract the data */
-	index = header->Offset + 4;
-	mb_get_binary_long(MB_YES, &buffer[index], &(v2rawdetection->serial_number)); index += 8;
-	mb_get_binary_int(MB_YES, &buffer[index], &(v2rawdetection->ping_number)); index += 4;
-	mb_get_binary_short(MB_YES, &buffer[index], &(v2rawdetection->multi_ping)); index += 2;
-	mb_get_binary_int(MB_YES, &buffer[index], &(v2rawdetection->number_beams)); index += 4;
-	mb_get_binary_int(MB_YES, &buffer[index], &(v2rawdetection->data_field_size)); index += 4;
-	v2rawdetection->detection_algorithm = buffer[index]; index++;
-	mb_get_binary_int(MB_YES, &buffer[index], &(v2rawdetection->detection_flags)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(v2rawdetection->sampling_rate)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(v2rawdetection->tx_angle)); index += 4;
-	for (i=0;i<64;i++)
-		{
-		v2rawdetection->reserved[i] = buffer[index]; index++;
-		}
-
-	/* extract the data */
-	for (i=0;i<v2rawdetection->number_beams;i++)
-		{
-		mb_get_binary_short(MB_YES, &buffer[index], &(v2rawdetection->beam_descriptor[i])); index += 2;
-		mb_get_binary_float(MB_YES, &buffer[index], &(v2rawdetection->detection_point[i])); index += 4;
-		mb_get_binary_float(MB_YES, &buffer[index], &(v2rawdetection->rx_angle[i])); index += 4;
-		mb_get_binary_int(MB_YES, &buffer[index], &(v2rawdetection->flags[i])); index += 4;
-		mb_get_binary_int(MB_YES, &buffer[index], &(v2rawdetection->quality[i])); index += 4;
-		mb_get_binary_float(MB_YES, &buffer[index], &(v2rawdetection->uncertainty[i])); index += 4;
-
-		/* skip extra data if it exists */
-		if (v2rawdetection->data_field_size > 22)
-			index += v2rawdetection->data_field_size - 22;
-		}
-
-	/* set kind */
-	if (status == MB_SUCCESS)
-		{
-		/* set kind */
-		store->kind = MB_DATA_DATA;
-		store->type = R7KRECID_7kV2RawDetection;
-
-		/* get the time */
-		time_j[0] = header->s7kTime.Year;
-		time_j[1] = header->s7kTime.Day;
-		time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-		time_j[3] = (int) header->s7kTime.Seconds;
-		time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-		mb_get_itime(verbose, time_j, store->time_i);
-		mb_get_time(verbose, store->time_i, &(store->time_d));
-		}
-	else
-		{
-		store->kind = MB_DATA_NONE;
-		}
-
-	/* check for broken record */
-	for (i=0;i<v2rawdetection->number_beams;i++)
-		{
-		if ((v2rawdetection->beam_descriptor[i] > MBSYS_RESON7K_MAX_BEAMS)
-			|| (bathymetry->number_beams > 0 && v2rawdetection->beam_descriptor[i] > bathymetry->number_beams))
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_UNINTELLIGIBLE;
-			}
-		}
-
-	/* print out the results */
-#ifdef MBR_RESON7KR_DEBUG
-fprintf(stderr,"R7KRECID_7kV2RawDetection:             7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d ping:%d\n",
-store->time_i[0],store->time_i[1],store->time_i[2],
-store->time_i[3],store->time_i[4],store->time_i[5],store->time_i[6],
-header->RecordNumber,v2rawdetection->ping_number);
-#endif
-#ifdef MBR_RESON7KR_DEBUG
-	if (verbose > 0)
-#else
-	if (verbose >= 2)
-#endif
-	mbsys_reson7k_print_v2rawdetection(verbose, v2rawdetection, error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_rd_v2snippet(int verbose, char *buffer, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_reson7kr_rd_v2snippet";
-	int	status = MB_SUCCESS;
-	struct mbsys_reson7k_struct *store;
-	s7k_header *header;
-	s7kr_v2snippet *v2snippet;
-	s7kr_v2snippettimeseries *snippettimeseries;
-	int	index;
-	int	time_j[5];
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       buffer:     %p\n",(void *)buffer);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	v2snippet = &(store->v2snippet);
-	header = &(v2snippet->header);
-
-	/* extract the header */
-	index = 0;
-	status = mbr_reson7kr_rd_header(verbose, buffer, &index, header, error);
-
-	/* extract the data */
-	index = header->Offset + 4;
-	mb_get_binary_long(MB_YES, &buffer[index], &(v2snippet->serial_number)); index += 8;
-	mb_get_binary_int(MB_YES, &buffer[index], &(v2snippet->ping_number)); index += 4;
-	mb_get_binary_short(MB_YES, &buffer[index], &(v2snippet->multi_ping)); index += 2;
-	mb_get_binary_short(MB_YES, &buffer[index], &(v2snippet->number_beams)); index += 2;
-	v2snippet->error_flag = buffer[index]; index++;
-	v2snippet->control_flags = buffer[index]; index++;
-	for (i=0;i<28;i++)
-		{
-		v2snippet->reserved[i] = buffer[index]; index++;
-		}
-
-	/* loop over all beams to get snippet parameters */
-	for (i=0;i<v2snippet->number_beams;i++)
-		{
-		snippettimeseries = &(v2snippet->snippettimeseries[i]);
-
-		/* extract snippettimeseries data */
-		mb_get_binary_short(MB_YES, &buffer[index], &(snippettimeseries->beam_number)); index += 2;
-		mb_get_binary_int(MB_YES, &buffer[index], &(snippettimeseries->begin_sample)); index += 4;
-		mb_get_binary_int(MB_YES, &buffer[index], &(snippettimeseries->detect_sample)); index += 4;
-		mb_get_binary_int(MB_YES, &buffer[index], &(snippettimeseries->end_sample)); index += 4;
-
-		/* allocate memory for snippettimeseries if needed */
-		if (status == MB_SUCCESS
-			&& snippettimeseries->nalloc
-				< 2 * (snippettimeseries->end_sample - snippettimeseries->begin_sample + 1))
-			{
-			snippettimeseries->nalloc = 2 * (snippettimeseries->end_sample - snippettimeseries->begin_sample + 1);
-			if (status == MB_SUCCESS)
-			status = mb_reallocd(verbose, __FILE__, __LINE__, snippettimeseries->nalloc,
-						(void **)&(snippettimeseries->amplitude), error);
-			if (status != MB_SUCCESS)
-				{
-				snippettimeseries->nalloc = 0;
-				}
-			}
-		}
-
-	/* loop over all beams to get snippet data */
-	if (status == MB_SUCCESS)
-	for (i=0;i<v2snippet->number_beams;i++)
-		{
-		snippettimeseries = &(v2snippet->snippettimeseries[i]);
-		for (j=0;j<(snippettimeseries->end_sample - snippettimeseries->begin_sample + 1);j++)
-			{
-			mb_get_binary_short(MB_YES, &buffer[index], &(snippettimeseries->amplitude[j])); index += 2;
-			}
-		}
-
-	/* set kind */
-	if (status == MB_SUCCESS)
-		{
-		/* set kind */
-		store->kind = MB_DATA_DATA;
-		store->type = R7KRECID_7kV2SnippetData;
-
-		/* get the time */
-		time_j[0] = header->s7kTime.Year;
-		time_j[1] = header->s7kTime.Day;
-		time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-		time_j[3] = (int) header->s7kTime.Seconds;
-		time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-		mb_get_itime(verbose, time_j, store->time_i);
-		mb_get_time(verbose, store->time_i, &(store->time_d));
-		}
-	else
-		{
-		store->kind = MB_DATA_NONE;
-		}
-
-	/* print out the results */
-#ifdef MBR_RESON7KR_DEBUG
-fprintf(stderr,"R7KRECID_7kV2SnippetData:                   7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d ping:%d\n",
-store->time_i[0],store->time_i[1],store->time_i[2],
-store->time_i[3],store->time_i[4],store->time_i[5],store->time_i[6],
-header->RecordNumber,v2snippet->ping_number);
-#endif
-#ifdef MBR_RESON7KR_DEBUG
-	if (verbose > 0)
-#else
-	if (verbose >= 2)
-#endif
-	mbsys_reson7k_print_v2snippet(verbose, v2snippet, error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_rd_calibratedsnippet(int verbose, char *buffer, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_reson7kr_rd_calibratedsnippet";
-	int	status = MB_SUCCESS;
-	struct mbsys_reson7k_struct *store;
-	s7k_header *header;
-	s7kr_calibratedsnippet *calibratedsnippet;
-	s7kr_calibratedsnippettimeseries *calibratedsnippettimeseries;
-	int	index;
-	int	time_j[5];
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       buffer:     %p\n",(void *)buffer);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	calibratedsnippet = &(store->calibratedsnippet);
-	header = &(calibratedsnippet->header);
-
-	/* extract the header */
-	index = 0;
-	status = mbr_reson7kr_rd_header(verbose, buffer, &index, header, error);
-
-	/* extract the data */
-	index = header->Offset + 4;
-	mb_get_binary_long(MB_YES, &buffer[index], &(calibratedsnippet->serial_number)); index += 8;
-	mb_get_binary_int(MB_YES, &buffer[index], &(calibratedsnippet->ping_number)); index += 4;
-	mb_get_binary_short(MB_YES, &buffer[index], &(calibratedsnippet->multi_ping)); index += 2;
-	mb_get_binary_short(MB_YES, &buffer[index], &(calibratedsnippet->number_beams)); index += 2;
-	calibratedsnippet->error_flag = buffer[index]; index++;
-	mb_get_binary_int(MB_YES, &buffer[index], &(calibratedsnippet->control_flags)); index += 4;
-	for (i=0;i<28;i++)
-		{
-		calibratedsnippet->reserved[i] = buffer[index]; index++;
-		}
-
-	/* loop over all beams to get snippet parameters */
-	for (i=0;i<calibratedsnippet->number_beams;i++)
-		{
-		calibratedsnippettimeseries = &(calibratedsnippet->calibratedsnippettimeseries[i]);
-
-		/* extract snippettimeseries data */
-		mb_get_binary_short(MB_YES, &buffer[index], &(calibratedsnippettimeseries->beam_number)); index += 2;
-		mb_get_binary_int(MB_YES, &buffer[index], &(calibratedsnippettimeseries->begin_sample)); index += 4;
-		mb_get_binary_int(MB_YES, &buffer[index], &(calibratedsnippettimeseries->detect_sample)); index += 4;
-		mb_get_binary_int(MB_YES, &buffer[index], &(calibratedsnippettimeseries->end_sample)); index += 4;
-
-		/* allocate memory for snippettimeseries if needed */
-		if (status == MB_SUCCESS
-			&& calibratedsnippettimeseries->nalloc
-				< sizeof(float) * (calibratedsnippettimeseries->end_sample - calibratedsnippettimeseries->begin_sample + 1))
-			{
-			calibratedsnippettimeseries->nalloc = sizeof(float) * (calibratedsnippettimeseries->end_sample - calibratedsnippettimeseries->begin_sample + 1);
-			if (status == MB_SUCCESS)
-			status = mb_reallocd(verbose, __FILE__, __LINE__, calibratedsnippettimeseries->nalloc,
-						(void **)&(calibratedsnippettimeseries->amplitude), error);
-			if (status != MB_SUCCESS)
-				{
-				calibratedsnippettimeseries->nalloc = 0;
-				}
-			}
-		}
-
-	/* loop over all beams to get snippet data */
-	if (status == MB_SUCCESS)
-	for (i=0;i<calibratedsnippet->number_beams;i++)
-		{
-		calibratedsnippettimeseries = &(calibratedsnippet->calibratedsnippettimeseries[i]);
-		for (j=0;j<(calibratedsnippettimeseries->end_sample - calibratedsnippettimeseries->begin_sample + 1);j++)
-			{
-			mb_get_binary_float(MB_YES, &buffer[index], &(calibratedsnippettimeseries->amplitude[j])); index += 4;
-			}
-		}
-
-	/* set kind */
-	if (status == MB_SUCCESS)
-		{
-		/* set kind */
-		store->kind = MB_DATA_DATA;
-		store->type = R7KRECID_7kCalibratedSnippetData;
-
-		/* get the time */
-		time_j[0] = header->s7kTime.Year;
-		time_j[1] = header->s7kTime.Day;
-		time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-		time_j[3] = (int) header->s7kTime.Seconds;
-		time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-		mb_get_itime(verbose, time_j, store->time_i);
-		mb_get_time(verbose, store->time_i, &(store->time_d));
-		}
-	else
-		{
-		store->kind = MB_DATA_NONE;
-		}
-
-	/* print out the results */
-#ifdef MBR_RESON7KR_DEBUG
-fprintf(stderr,"R7KRECID_7kCalibratedSnippetData:                   7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d ping:%d\n",
-store->time_i[0],store->time_i[1],store->time_i[2],
-store->time_i[3],store->time_i[4],store->time_i[5],store->time_i[6],
-header->RecordNumber,calibratedsnippet->ping_number);
-#endif
-#ifdef MBR_RESON7KR_DEBUG
-	if (verbose > 0)
-#else
-	if (verbose >= 2)
-#endif
-	mbsys_reson7k_print_calibratedsnippet(verbose, calibratedsnippet, error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_rd_installation(int verbose, char *buffer, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_reson7kr_rd_installation";
-	int	status = MB_SUCCESS;
-	struct mbsys_reson7k_struct *store;
-	s7k_header *header;
-	s7kr_installation *installation;
-	int	index;
-	int	time_j[5];
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       buffer:     %p\n",(void *)buffer);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	installation = &(store->installation);
-	header = &(installation->header);
-
-	/* extract the header */
-	index = 0;
-	status = mbr_reson7kr_rd_header(verbose, buffer, &index, header, error);
-
-	/* extract the data */
-	index = header->Offset + 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(installation->frequency)); index += 4;
-	mb_get_binary_short(MB_YES, &buffer[index], &(installation->firmware_version_len)); index += 2;
-	for (i=0;i<128;i++)
-		{
-		installation->firmware_version[i] = buffer[index]; index++;
-		}
-	mb_get_binary_short(MB_YES, &buffer[index], &(installation->software_version_len)); index += 2;
-	for (i=0;i<128;i++)
-		{
-		installation->software_version[i] = buffer[index]; index++;
-		}
-	mb_get_binary_short(MB_YES, &buffer[index], &(installation->s7k_version_len)); index += 2;
-	for (i=0;i<128;i++)
-		{
-		installation->s7k_version[i] = buffer[index]; index++;
-		}
-	mb_get_binary_short(MB_YES, &buffer[index], &(installation->protocal_version_len)); index += 2;
-	for (i=0;i<128;i++)
-		{
-		installation->protocal_version[i] = buffer[index]; index++;
-		}
-	mb_get_binary_float(MB_YES, &buffer[index], &(installation->transmit_x)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(installation->transmit_y)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(installation->transmit_z)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(installation->transmit_roll)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(installation->transmit_pitch)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(installation->transmit_heading)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(installation->receive_x)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(installation->receive_y)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(installation->receive_z)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(installation->receive_roll)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(installation->receive_pitch)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(installation->receive_heading)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(installation->motion_x)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(installation->motion_y)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(installation->motion_z)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(installation->motion_roll)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(installation->motion_pitch)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(installation->motion_heading)); index += 4;
-	mb_get_binary_short(MB_YES, &buffer[index], &(installation->motion_time_delay)); index += 2;
-	mb_get_binary_float(MB_YES, &buffer[index], &(installation->position_x)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(installation->position_y)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(installation->position_z)); index += 4;
-	mb_get_binary_short(MB_YES, &buffer[index], &(installation->position_time_delay)); index += 2;
-	mb_get_binary_float(MB_YES, &buffer[index], &(installation->waterline_z)); index += 4;
-
-	/* set kind */
-	if (status == MB_SUCCESS)
-		{
-		/* set kind */
-		store->kind = MB_DATA_INSTALLATION;
-		store->type = R7KRECID_7kInstallationParameters;
-
-		/* get the time */
-		time_j[0] = header->s7kTime.Year;
-		time_j[1] = header->s7kTime.Day;
-		time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-		time_j[3] = (int) header->s7kTime.Seconds;
-		time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-		mb_get_itime(verbose, time_j, store->time_i);
-		mb_get_time(verbose, store->time_i, &(store->time_d));
-		}
-	else
-		{
-		store->kind = MB_DATA_NONE;
-		}
-
-	/* print out the results */
-#ifdef MBR_RESON7KR_DEBUG
-fprintf(stderr,"R7KRECID_7kInstallationParameters:      7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d size:%d index:%d\n",
-store->time_i[0],store->time_i[1],store->time_i[2],
-store->time_i[3],store->time_i[4],store->time_i[5],store->time_i[6],
-header->RecordNumber,header->Size,index);
-#endif
-#ifdef MBR_RESON7KR_DEBUG
-	if (verbose > 0)
-#else
-	if (verbose >= 2)
-#endif
-	mbsys_reson7k_print_installation(verbose, installation, error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_rd_fileheader(int verbose, char *buffer, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_reson7kr_rd_fileheader";
-	int	status = MB_SUCCESS;
-	struct mbsys_reson7k_struct *store;
-	s7k_header *header;
-	s7kr_fileheader *fileheader;
-	s7kr_subsystem *subsystem;
-	int	index;
-	int	time_j[5];
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       buffer:     %p\n",(void *)buffer);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	fileheader = &(store->fileheader);
-	header = &(fileheader->header);
-
-	/* extract the header */
-	index = 0;
-	status = mbr_reson7kr_rd_header(verbose, buffer, &index, header, error);
-
-	/* extract the data */
-	index = header->Offset + 4;
-	for (i=0;i<16;i++)
-		{
-		fileheader->file_identifier[i] = buffer[index]; index++;
-		}
-	mb_get_binary_short(MB_YES, &buffer[index], &(fileheader->version)); index += 2;
-	mb_get_binary_short(MB_YES, &buffer[index], &(fileheader->reserved)); index += 2;
-	for (i=0;i<16;i++)
-		{
-		fileheader->session_identifier[i] = buffer[index]; index++;
-		}
-	mb_get_binary_int(MB_YES, &buffer[index], &(fileheader->record_data_size)); index += 4;
-	mb_get_binary_int(MB_YES, &buffer[index], &(fileheader->number_subsystems)); index += 4;
-	for (i=0;i<64;i++)
-		{
-		fileheader->recording_name[i] = buffer[index]; index++;
-		}
-	for (i=0;i<16;i++)
-		{
-		fileheader->recording_version[i] = buffer[index]; index++;
-		}
-	for (i=0;i<64;i++)
-		{
-		fileheader->user_defined_name[i] = buffer[index]; index++;
-		}
-	for (i=0;i<128;i++)
-		{
-		fileheader->notes[i] = buffer[index]; index++;
-		}
-	for (i=0;i<fileheader->number_subsystems;i++)
-		{
-		subsystem = &(fileheader->subsystem[i]);
-		mb_get_binary_int(MB_YES, &buffer[index], &(subsystem->device_identifier)); index += 4;
-		if (header->Version == 2)
-			mb_get_binary_short(MB_YES, &buffer[index], &(subsystem->system_enumerator)); index += 2;
-		mb_get_binary_short(MB_YES, &buffer[index], &(subsystem->system_enumerator)); index += 2;
-		}
-
-	/* set kind */
-	if (status == MB_SUCCESS)
-		{
-		/* set kind */
-		store->kind = MB_DATA_HEADER;
-		store->type = R7KRECID_7kFileHeader;
-
-		/* get the time */
-		time_j[0] = header->s7kTime.Year;
-		time_j[1] = header->s7kTime.Day;
-		time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-		time_j[3] = (int) header->s7kTime.Seconds;
-		time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-		mb_get_itime(verbose, time_j, store->time_i);
-		mb_get_time(verbose, store->time_i, &(store->time_d));
-		}
-	else
-		{
-		store->kind = MB_DATA_NONE;
-		}
-
-	/* print out the results */
-#ifdef MBR_RESON7KR_DEBUG
-fprintf(stderr,"R7KRECID_7kFileHeader:                  7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d size:%d index:%d\n",
-store->time_i[0],store->time_i[1],store->time_i[2],
-store->time_i[3],store->time_i[4],store->time_i[5],store->time_i[6],
-header->RecordNumber,header->Size,index);
-#endif
-#ifdef MBR_RESON7KR_DEBUG
-	if (verbose > 0)
-#else
-	if (verbose >= 2)
-#endif
-	mbsys_reson7k_print_fileheader(verbose, fileheader, error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_rd_systemeventmessage(int verbose, char *buffer, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_reson7kr_rd_systemeventmessage";
-	int	status = MB_SUCCESS;
-	struct mbsys_reson7k_struct *store;
-	s7k_header *header;
-	s7kr_systemeventmessage *systemeventmessage;
-	int	data_size;
-	int	index;
-	int	time_j[5];
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       buffer:     %p\n",(void *)buffer);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	systemeventmessage = &(store->systemeventmessage);
-	header = &(systemeventmessage->header);
-
-	/* extract the header */
-	index = 0;
-	status = mbr_reson7kr_rd_header(verbose, buffer, &index, header, error);
-
-	/* extract the data */
-	index = header->Offset + 4;
-	mb_get_binary_long(MB_YES, &buffer[index], &(systemeventmessage->serial_number)); index += 8;
-	mb_get_binary_short(MB_YES, &buffer[index], &(systemeventmessage->event_id)); index += 2;
-	mb_get_binary_short(MB_YES, &buffer[index], &(systemeventmessage->message_length)); index += 2;
-	mb_get_binary_short(MB_YES, &buffer[index], &(systemeventmessage->event_identifier)); index += 2;
-
-	/* make sure enough memory is allocated for channel data */
-	if (systemeventmessage->message_alloc < systemeventmessage->message_length)
-		{
-		data_size = systemeventmessage->message_length + 1;
-		status = mb_reallocd(verbose, __FILE__, __LINE__, data_size, (void **)&(systemeventmessage->message), error);
-		if (status == MB_SUCCESS)
-			{
-			systemeventmessage->message_alloc = systemeventmessage->message_length;
-			}
-		else
-			{
-			systemeventmessage->message_alloc = 0;
-			systemeventmessage->message_length = 0;
-			}
-		}
-
-	/* extract the data */
-	for (i=0;i<systemeventmessage->message_length;i++)
-		{
-		systemeventmessage->message[i] = buffer[index]; index++;
-		}
-
-	/* set kind */
-	if (status == MB_SUCCESS)
-		{
-		/* set kind */
-		store->kind = MB_DATA_COMMENT;
-		store->type = R7KRECID_7kSystemEventMessage;
-
-		/* get the time */
-		time_j[0] = header->s7kTime.Year;
-		time_j[1] = header->s7kTime.Day;
-		time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-		time_j[3] = (int) header->s7kTime.Seconds;
-		time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-		mb_get_itime(verbose, time_j, store->time_i);
-		mb_get_time(verbose, store->time_i, &(store->time_d));
-		}
-	else
-		{
-		store->kind = MB_DATA_NONE;
-		}
-
-	/* print out the results */
-#ifdef MBR_RESON7KR_DEBUG
-	if (verbose > 0)
-#else
-	if (verbose >= 2)
-#endif
-	mbsys_reson7k_print_systemeventmessage(verbose, systemeventmessage, error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_rd_remotecontrolsettings(int verbose, char *buffer, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_reson7kr_rd_remotecontrolsettings";
-	int	status = MB_SUCCESS;
-	struct mbsys_reson7k_struct *store;
-	s7k_header *header;
-	s7kr_remotecontrolsettings *remotecontrolsettings;
-	int	index;
-	int	time_j[5];
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       buffer:     %p\n",(void *)buffer);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	remotecontrolsettings = &(store->remotecontrolsettings);
-	header = &(remotecontrolsettings->header);
-
-	/* extract the header */
-	index = 0;
-	status = mbr_reson7kr_rd_header(verbose, buffer, &index, header, error);
-
-	/* extract the data */
-	index = header->Offset + 4;
-	mb_get_binary_long(MB_YES, &buffer[index], &(remotecontrolsettings->serial_number)); index += 8;
-	mb_get_binary_int(MB_YES, &buffer[index], &(remotecontrolsettings->ping_number)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(remotecontrolsettings->frequency)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(remotecontrolsettings->sample_rate)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(remotecontrolsettings->receiver_bandwidth)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(remotecontrolsettings->pulse_width)); index += 4;
-	mb_get_binary_int(MB_YES, &buffer[index], &(remotecontrolsettings->pulse_type)); index += 4;
-	mb_get_binary_int(MB_YES, &buffer[index], &(remotecontrolsettings->pulse_envelope)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(remotecontrolsettings->pulse_envelope_par)); index += 4;
-	mb_get_binary_int(MB_YES, &buffer[index], &(remotecontrolsettings->pulse_reserved)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(remotecontrolsettings->max_ping_rate)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(remotecontrolsettings->ping_period)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(remotecontrolsettings->range_selection)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(remotecontrolsettings->power_selection)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(remotecontrolsettings->gain_selection)); index += 4;
-	mb_get_binary_int(MB_YES, &buffer[index], &(remotecontrolsettings->control_flags)); index += 4;
-	mb_get_binary_int(MB_YES, &buffer[index], &(remotecontrolsettings->projector_magic_no)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(remotecontrolsettings->steering_vertical)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(remotecontrolsettings->steering_horizontal)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(remotecontrolsettings->beamwidth_vertical)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(remotecontrolsettings->beamwidth_horizontal)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(remotecontrolsettings->focal_point)); index += 4;
-	mb_get_binary_int(MB_YES, &buffer[index], &(remotecontrolsettings->projector_weighting)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(remotecontrolsettings->projector_weighting_par)); index += 4;
-	mb_get_binary_int(MB_YES, &buffer[index], &(remotecontrolsettings->transmit_flags)); index += 4;
-	mb_get_binary_int(MB_YES, &buffer[index], &(remotecontrolsettings->hydrophone_magic_no)); index += 4;
-	mb_get_binary_int(MB_YES, &buffer[index], &(remotecontrolsettings->receive_weighting)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(remotecontrolsettings->receive_weighting_par)); index += 4;
-	mb_get_binary_int(MB_YES, &buffer[index], &(remotecontrolsettings->receive_flags)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(remotecontrolsettings->range_minimum)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(remotecontrolsettings->range_maximum)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(remotecontrolsettings->depth_minimum)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(remotecontrolsettings->depth_maximum)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(remotecontrolsettings->absorption)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(remotecontrolsettings->sound_velocity)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(remotecontrolsettings->spreading)); index += 4;
-	mb_get_binary_short(MB_YES, &buffer[index], &(remotecontrolsettings->reserved)); index += 2;
-	if (header->Size >= MBSYS_RESON7K_RECORDHEADER_SIZE + MBSYS_RESON7K_RECORDTAIL_SIZE
-			+ R7KHDRSIZE_7kRemoteControlSonarSettings)
-		{
-		mb_get_binary_float(MB_YES, &buffer[index], &(remotecontrolsettings->tx_offset_x)); index += 4;
-		mb_get_binary_float(MB_YES, &buffer[index], &(remotecontrolsettings->tx_offset_y)); index += 4;
-		mb_get_binary_float(MB_YES, &buffer[index], &(remotecontrolsettings->tx_offset_z)); index += 4;
-		mb_get_binary_float(MB_YES, &buffer[index], &(remotecontrolsettings->head_tilt_x)); index += 4;
-		mb_get_binary_float(MB_YES, &buffer[index], &(remotecontrolsettings->head_tilt_y)); index += 4;
-		mb_get_binary_float(MB_YES, &buffer[index], &(remotecontrolsettings->head_tilt_z)); index += 4;
-		mb_get_binary_short(MB_YES, &buffer[index], &(remotecontrolsettings->ping_on_off)); index += 2;
-		remotecontrolsettings->data_sample_types = buffer[index]; index++;
-		remotecontrolsettings->projector_orientation = buffer[index]; index++;
-		mb_get_binary_short(MB_YES, &buffer[index], &(remotecontrolsettings->beam_angle_mode)); index += 2;
-		mb_get_binary_short(MB_YES, &buffer[index], &(remotecontrolsettings->r7kcenter_mode)); index += 2;
-		mb_get_binary_float(MB_YES, &buffer[index], &(remotecontrolsettings->gate_depth_min)); index += 4;
-		mb_get_binary_float(MB_YES, &buffer[index], &(remotecontrolsettings->gate_depth_max)); index += 4;
-		for (i=0;i<35;i++)
-			{
-			mb_get_binary_short(MB_YES, &buffer[index], &(remotecontrolsettings->reserved2[i])); index += 2;
-			}
-		}
-
-	/* set kind */
-	if (status == MB_SUCCESS)
-		{
-		/* set kind */
-		store->kind = MB_DATA_DATA;
-		store->type = R7KRECID_7kRemoteControlSonarSettings;
-
-		/* get the time */
-		time_j[0] = header->s7kTime.Year;
-		time_j[1] = header->s7kTime.Day;
-		time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-		time_j[3] = (int) header->s7kTime.Seconds;
-		time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-		mb_get_itime(verbose, time_j, store->time_i);
-		mb_get_time(verbose, store->time_i, &(store->time_d));
-		}
-	else
-		{
-		store->kind = MB_DATA_NONE;
-		}
-
-	/* print out the results */
-#ifdef MBR_RESON7KR_DEBUG
-fprintf(stderr,"R7KRECID_7kRemoteControlSonarSettings:  7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d size:%d index:%d\n",
-store->time_i[0],store->time_i[1],store->time_i[2],
-store->time_i[3],store->time_i[4],store->time_i[5],store->time_i[6],
-header->RecordNumber,header->Size,index);
-#endif
-#ifdef MBR_RESON7KR_DEBUG
-	if (verbose > 0)
-#else
-	if (verbose >= 2)
-#endif
-	mbsys_reson7k_print_remotecontrolsettings(verbose, remotecontrolsettings, error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_rd_reserved(int verbose, char *buffer, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_reson7kr_rd_reserved";
-	int	status = MB_SUCCESS;
-	struct mbsys_reson7k_struct *store;
-	s7k_header *header;
-	s7kr_reserved *reserved;
-	int	index;
-	int	time_j[5];
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       buffer:     %p\n",(void *)buffer);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	reserved = &(store->reserved);
-	header = &(reserved->header);
-
-	/* extract the header */
-	index = 0;
-	status = mbr_reson7kr_rd_header(verbose, buffer, &index, header, error);
-
-	/* extract the data */
-	index = header->Offset + 4;
-	for (i=0;i<R7KHDRSIZE_7kReserved;i++)
-		{
-		reserved->reserved[i] = buffer[index]; index++;
-		}
-
-	/* set kind */
-	if (status == MB_SUCCESS)
-		{
-		/* set kind */
-		store->kind = MB_DATA_RAW_LINE;
-		store->type = R7KRECID_7kReserved;
-
-		/* get the time */
-		time_j[0] = header->s7kTime.Year;
-		time_j[1] = header->s7kTime.Day;
-		time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-		time_j[3] = (int) header->s7kTime.Seconds;
-		time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-		mb_get_itime(verbose, time_j, store->time_i);
-		mb_get_time(verbose, store->time_i, &(store->time_d));
-		}
-	else
-		{
-		store->kind = MB_DATA_NONE;
-		}
-
-	/* print out the results */
-#ifdef MBR_RESON7KR_DEBUG
-fprintf(stderr,"R7KRECID_7kReserved:  7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d size:%d index:%d\n",
-store->time_i[0],store->time_i[1],store->time_i[2],
-store->time_i[3],store->time_i[4],store->time_i[5],store->time_i[6],
-header->RecordNumber,header->Size,index);
-#endif
-#ifdef MBR_RESON7KR_DEBUG
-	if (verbose > 0)
-#else
-	if (verbose >= 2)
-#endif
-	mbsys_reson7k_print_reserved(verbose, reserved, error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_rd_roll(int verbose, char *buffer, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_reson7kr_rd_roll";
-	int	status = MB_SUCCESS;
-	struct mbsys_reson7k_struct *store;
-	s7k_header *header;
-	s7kr_roll *roll;
-	int	index;
-	int	time_j[5];
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       buffer:     %p\n",(void *)buffer);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	roll = &(store->roll);
-	header = &(roll->header);
-
-	/* extract the header */
-	index = 0;
-	status = mbr_reson7kr_rd_header(verbose, buffer, &index, header, error);
-
-	/* extract the data */
-	index = header->Offset + 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(roll->roll)); index += 4;
-
-	/* set kind */
-	if (status == MB_SUCCESS)
-		{
-		/* set kind */
-		store->kind = MB_DATA_ROLL;
-		store->type = R7KRECID_7kRoll;
-
-		/* get the time */
-		time_j[0] = header->s7kTime.Year;
-		time_j[1] = header->s7kTime.Day;
-		time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-		time_j[3] = (int) header->s7kTime.Seconds;
-		time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-		mb_get_itime(verbose, time_j, store->time_i);
-		mb_get_time(verbose, store->time_i, &(store->time_d));
-		}
-	else
-		{
-		store->kind = MB_DATA_NONE;
-		}
-
-	/* print out the results */
-#ifdef MBR_RESON7KR_DEBUG
-	if (verbose > 0)
-#else
-	if (verbose >= 2)
-#endif
-	mbsys_reson7k_print_roll(verbose, roll, error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_rd_pitch(int verbose, char *buffer, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_reson7kr_rd_pitch";
-	int	status = MB_SUCCESS;
-	struct mbsys_reson7k_struct *store;
-	s7k_header *header;
-	s7kr_pitch *pitch;
-	int	index;
-	int	time_j[5];
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       buffer:     %p\n",(void *)buffer);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	pitch = &(store->pitch);
-	header = &(pitch->header);
-
-	/* extract the header */
-	index = 0;
-	status = mbr_reson7kr_rd_header(verbose, buffer, &index, header, error);
-
-	/* extract the data */
-	index = header->Offset + 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(pitch->pitch)); index += 4;
-
-	/* set kind */
-	if (status == MB_SUCCESS)
-		{
-		/* set kind */
-		store->kind = MB_DATA_PITCH;
-		store->type = R7KRECID_7kPitch;
-
-		/* get the time */
-		time_j[0] = header->s7kTime.Year;
-		time_j[1] = header->s7kTime.Day;
-		time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-		time_j[3] = (int) header->s7kTime.Seconds;
-		time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-		mb_get_itime(verbose, time_j, store->time_i);
-		mb_get_time(verbose, store->time_i, &(store->time_d));
-		}
-	else
-		{
-		store->kind = MB_DATA_NONE;
-		}
-
-	/* print out the results */
-#ifdef MBR_RESON7KR_DEBUG
-	if (verbose > 0)
-#else
-	if (verbose >= 2)
-#endif
-	mbsys_reson7k_print_pitch(verbose, pitch, error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_rd_soundvelocity(int verbose, char *buffer, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_reson7kr_rd_soundvelocity";
-	int	status = MB_SUCCESS;
-	struct mbsys_reson7k_struct *store;
-	s7k_header *header;
-	s7kr_soundvelocity *soundvelocity;
-	int	index;
-	int	time_j[5];
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       buffer:     %p\n",(void *)buffer);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	soundvelocity = &(store->soundvelocity);
-	header = &(soundvelocity->header);
-
-	/* extract the header */
-	index = 0;
-	status = mbr_reson7kr_rd_header(verbose, buffer, &index, header, error);
-
-	/* extract the data */
-	index = header->Offset + 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(soundvelocity->soundvelocity)); index += 4;
-
-	/* set kind */
-	if (status == MB_SUCCESS)
-		{
-		/* set kind */
-		store->kind = MB_DATA_SSV;
-		store->type = R7KRECID_7kSoundVelocity;
-
-		/* get the time */
-		time_j[0] = header->s7kTime.Year;
-		time_j[1] = header->s7kTime.Day;
-		time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-		time_j[3] = (int) header->s7kTime.Seconds;
-		time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-		mb_get_itime(verbose, time_j, store->time_i);
-		mb_get_time(verbose, store->time_i, &(store->time_d));
-		}
-	else
-		{
-		store->kind = MB_DATA_NONE;
-		}
-
-	/* print out the results */
-#ifdef MBR_RESON7KR_DEBUG
-	if (verbose > 0)
-#else
-	if (verbose >= 2)
-#endif
-	mbsys_reson7k_print_soundvelocity(verbose, soundvelocity, error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_rd_absorptionloss(int verbose, char *buffer, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_reson7kr_rd_absorptionloss";
-	int	status = MB_SUCCESS;
-	struct mbsys_reson7k_struct *store;
-	s7k_header *header;
-	s7kr_absorptionloss *absorptionloss;
-	int	index;
-	int	time_j[5];
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       buffer:     %p\n",(void *)buffer);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	absorptionloss = &(store->absorptionloss);
-	header = &(absorptionloss->header);
-
-	/* extract the header */
-	index = 0;
-	status = mbr_reson7kr_rd_header(verbose, buffer, &index, header, error);
-
-	/* extract the data */
-	index = header->Offset + 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(absorptionloss->absorptionloss)); index += 4;
-
-	/* set kind */
-	if (status == MB_SUCCESS)
-		{
-		/* set kind */
-		store->kind = MB_DATA_ABSORPTIONLOSS;
-		store->type = R7KRECID_7kAbsorptionLoss;
-
-		/* get the time */
-		time_j[0] = header->s7kTime.Year;
-		time_j[1] = header->s7kTime.Day;
-		time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-		time_j[3] = (int) header->s7kTime.Seconds;
-		time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-		mb_get_itime(verbose, time_j, store->time_i);
-		mb_get_time(verbose, store->time_i, &(store->time_d));
-		}
-	else
-		{
-		store->kind = MB_DATA_NONE;
-		}
-
-	/* print out the results */
-#ifdef MBR_RESON7KR_DEBUG
-	if (verbose > 0)
-#else
-	if (verbose >= 2)
-#endif
-	mbsys_reson7k_print_absorptionloss(verbose, absorptionloss, error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_rd_spreadingloss(int verbose, char *buffer, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_reson7kr_rd_spreadingloss";
-	int	status = MB_SUCCESS;
-	struct mbsys_reson7k_struct *store;
-	s7k_header *header;
-	s7kr_spreadingloss *spreadingloss;
-	int	index;
-	int	time_j[5];
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       buffer:     %p\n",(void *)buffer);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	spreadingloss = &(store->spreadingloss);
-	header = &(spreadingloss->header);
-
-	/* extract the header */
-	index = 0;
-	status = mbr_reson7kr_rd_header(verbose, buffer, &index, header, error);
-
-	/* extract the data */
-	index = header->Offset + 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(spreadingloss->spreadingloss)); index += 4;
-
-	/* set kind */
-	if (status == MB_SUCCESS)
-		{
-		/* set kind */
-		store->kind = MB_DATA_SPREADINGLOSS;
-		store->type = R7KRECID_7kSpreadingLoss;
-
-		/* get the time */
-		time_j[0] = header->s7kTime.Year;
-		time_j[1] = header->s7kTime.Day;
-		time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-		time_j[3] = (int) header->s7kTime.Seconds;
-		time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-		mb_get_itime(verbose, time_j, store->time_i);
-		mb_get_time(verbose, store->time_i, &(store->time_d));
-		}
-	else
-		{
-		store->kind = MB_DATA_NONE;
-		}
-
-	/* print out the results */
-#ifdef MBR_RESON7KR_DEBUG
-	if (verbose > 0)
-#else
-	if (verbose >= 2)
-#endif
-	mbsys_reson7k_print_spreadingloss(verbose, spreadingloss, error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_wr_data(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_reson7kr_wr_data";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_reson7k_struct *store;
-	FILE	*mbfp;
-	char	**bufferptr;
-	char	*buffer;
-	int	*bufferalloc;
-	int	*fileheaders;
-	int	size;
-	size_t	write_len;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	mbfp = mb_io_ptr->mbfp;
-
-	/* get saved values */
-	bufferptr = (char **) &mb_io_ptr->saveptr1;
-	buffer = (char *) *bufferptr;
-	bufferalloc = (int *) &mb_io_ptr->save6;
-	fileheaders = (int *) &mb_io_ptr->save12;
-
-	/* write fileheader if needed */
-	if (status == MB_SUCCESS
-		&& (store->type == R7KRECID_7kFileHeader || *fileheaders == 0))
-		{
-#ifdef MBR_RESON7KR_DEBUG
-fprintf(stderr, "Writing record id: %4.4X | %d", R7KRECID_7kFileHeader, R7KRECID_7kFileHeader);
-fprintf(stderr," R7KRECID_7kFileHeader\n");
-#endif
-		status = mbr_reson7kr_wr_fileheader(verbose, bufferalloc, bufferptr, store_ptr, &size, error);
-		(*fileheaders)++;
-
-		/* write the record to the output file */
-		if (status == MB_SUCCESS)
-			{
-			buffer = (char *) *bufferptr;
-			write_len = (size_t)size;
-			status = mb_fileio_put(verbose, mbio_ptr, buffer, &write_len, error);
-			}
-		}
-
-	/* call appropriate writing routines for ping data */
-	if (status == MB_SUCCESS && store->kind == MB_DATA_DATA)
-		{
-		/* Reson 7k volatile sonar settings (record 7000) */
-		if (status == MB_SUCCESS && store->read_volatilesettings == MB_YES)
-			{
-			store->type = R7KRECID_7kVolatileSonarSettings;
-#ifdef MBR_RESON7KR_DEBUG
-fprintf(stderr, "Writing record id: %4.4X | %d", R7KRECID_7kVolatileSonarSettings, R7KRECID_7kVolatileSonarSettings);
-fprintf(stderr," R7KRECID_7kVolatileSonarSettings\n");
-#endif
-			status = mbr_reson7kr_wr_volatilesonarsettings(verbose, bufferalloc, bufferptr, store_ptr, &size, error);
-			buffer = (char *) *bufferptr;
-			write_len = (size_t)size;
-			status = mb_fileio_put(verbose, mbio_ptr, buffer, &write_len, error);
-			}
-		/* Reson 7k match filter (record 7002) */
-		if (status == MB_SUCCESS && store->read_matchfilter == MB_YES)
-			{
-			store->type = R7KRECID_7kMatchFilter;
-#ifdef MBR_RESON7KR_DEBUG
-fprintf(stderr, "Writing record id: %4.4X | %d", R7KRECID_7kMatchFilter, R7KRECID_7kMatchFilter);
-fprintf(stderr," R7KRECID_7kMatchFilter\n");
-#endif
-			status = mbr_reson7kr_wr_matchfilter(verbose, bufferalloc, bufferptr, store_ptr, &size, error);
-			buffer = (char *) *bufferptr;
-			write_len = (size_t)size;
-			status = mb_fileio_put(verbose, mbio_ptr, buffer, &write_len, error);
-			}
-
-		/* Reson 7k beam geometry (record 7004) */
-		if (status == MB_SUCCESS && store->read_beamgeometry == MB_YES)
-			{
-			store->type = R7KRECID_7kBeamGeometry;
-#ifdef MBR_RESON7KR_DEBUG
-fprintf(stderr, "Writing record id: %4.4X | %d", R7KRECID_7kBeamGeometry, R7KRECID_7kBeamGeometry);
-fprintf(stderr," R7KRECID_7kBeamGeometry\n");
-#endif
-			status = mbr_reson7kr_wr_beamgeometry(verbose, bufferalloc, bufferptr, store_ptr, &size, error);
-			buffer = (char *) *bufferptr;
-			write_len = (size_t)size;
-			status = mb_fileio_put(verbose, mbio_ptr, buffer, &write_len, error);
-			}
-
-		/* Reson 7k remote control settings (record 7503) */
-		if (status == MB_SUCCESS && store->read_remotecontrolsettings == MB_YES)
-			{
-			store->type = R7KRECID_7kRemoteControlSonarSettings;
-#ifdef MBR_RESON7KR_DEBUG
-fprintf(stderr, "Writing record id: %4.4X | %d", R7KRECID_7kRemoteControlSonarSettings, R7KRECID_7kRemoteControlSonarSettings);
-fprintf(stderr," R7KRECID_7kRemoteControlSonarSettings\n");
-#endif
-			status = mbr_reson7kr_wr_remotecontrolsettings(verbose, bufferalloc, bufferptr, store_ptr, &size, error);
-			buffer = (char *) *bufferptr;
-			write_len = (size_t)size;
-			status = mb_fileio_put(verbose, mbio_ptr, buffer, &write_len, error);
-			}
-
-		/* Reson 7k bathymetry (record 7006) */
-		if (status == MB_SUCCESS && store->read_bathymetry == MB_YES)
-			{
-				store->type = R7KRECID_7kBathymetricData;
-#ifdef MBR_RESON7KR_DEBUG
-fprintf(stderr, "Writing record id: %4.4X | %d", R7KRECID_7kBathymetricData, R7KRECID_7kBathymetricData);
-fprintf(stderr," R7KRECID_7kBathymetricData\n");
-#endif
-
-/*mbsys_reson7k_print_bathymetry(verbose, &(store->bathymetry), error);*/
-
-			status = mbr_reson7kr_wr_bathymetry(verbose, bufferalloc, bufferptr, store_ptr, &size, error);
-			buffer = (char *) *bufferptr;
-			write_len = (size_t)size;
-			status = mb_fileio_put(verbose, mbio_ptr, buffer, &write_len, error);
-			}
-
-		/* Processed sidescan - MB-System extension to 7k format (record 3199) */
-		if (status == MB_SUCCESS && store->read_processedsidescan == MB_YES)
-			{
-				store->type = R7KRECID_ProcessedSidescan;
-#ifdef MBR_RESON7KR_DEBUG
-fprintf(stderr, "Writing record id: %4.4X | %d", R7KRECID_ProcessedSidescan, R7KRECID_ProcessedSidescan);
-fprintf(stderr," R7KRECID_ProcessedSidescan\n");
-#endif
-
-/*mbsys_reson7k_print_processedsidescan(verbose, &(store->processedsidescan), error);*/
-
-			status = mbr_reson7kr_wr_processedsidescan(verbose, bufferalloc, bufferptr, store_ptr, &size, error);
-			buffer = (char *) *bufferptr;
-			write_len = (size_t)size;
-			status = mb_fileio_put(verbose, mbio_ptr, buffer, &write_len, error);
-			}
-
-		/* Reson 7k backscatter imagery data (record 7007) */
-		if (status == MB_SUCCESS && store->read_backscatter == MB_YES)
-			{
-			store->type = R7KRECID_7kBackscatterImageData;
-#ifdef MBR_RESON7KR_DEBUG
-fprintf(stderr, "Writing record id: %4.4X | %d", R7KRECID_7kBackscatterImageData, R7KRECID_7kBackscatterImageData);
-fprintf(stderr," R7KRECID_7kBackscatterImageData\n");
-#endif
-			status = mbr_reson7kr_wr_backscatter(verbose, bufferalloc, bufferptr, store_ptr, &size, error);
-			buffer = (char *) *bufferptr;
-			write_len = (size_t)size;
-			status = mb_fileio_put(verbose, mbio_ptr, buffer, &write_len, error);
-			}
-
-		/* Reson 7k beam data (record 7008) */
-		if (status == MB_SUCCESS && store->read_beam == MB_YES)
-			{
-			store->type = R7KRECID_7kBeamData;
-#ifdef MBR_RESON7KR_DEBUG
-fprintf(stderr, "Writing record id: %4.4X | %d", R7KRECID_7kBeamData, R7KRECID_7kBeamData);
-fprintf(stderr," R7KRECID_7kBeamData\n");
-#endif
-			status = mbr_reson7kr_wr_beam(verbose, bufferalloc, bufferptr, store_ptr, &size, error);
-			buffer = (char *) *bufferptr;
-			write_len = (size_t)size;
-			status = mb_fileio_put(verbose, mbio_ptr, buffer, &write_len, error);
-			}
-
-		/* Reson 7k vertical depth (record 7009) */
-		if (status == MB_SUCCESS && store->read_verticaldepth == MB_YES)
-			{
-			store->type = R7KRECID_7kVerticalDepth;
-#ifdef MBR_RESON7KR_DEBUG
-fprintf(stderr, "Writing record id: %4.4X | %d", R7KRECID_7kVerticalDepth, R7KRECID_7kVerticalDepth);
-fprintf(stderr," R7KRECID_7kVerticalDepth\n");
-#endif
-			status = mbr_reson7kr_wr_verticaldepth(verbose, bufferalloc, bufferptr, store_ptr, &size, error);
-			buffer = (char *) *bufferptr;
-			write_len = (size_t)size;
-			status = mb_fileio_put(verbose, mbio_ptr, buffer, &write_len, error);
-			}
-
-		/* Reson 7k tvg data (record 7010) */
-		if (status == MB_SUCCESS && store->read_tvg == MB_YES)
-			{
-			store->type = R7KRECID_7kTVGData;
-#ifdef MBR_RESON7KR_DEBUG
-fprintf(stderr, "Writing record id: %4.4X | %d", R7KRECID_7kTVGData, R7KRECID_7kTVGData);
-fprintf(stderr," R7KRECID_7kTVGData\n");
-#endif
-			status = mbr_reson7kr_wr_tvg(verbose, bufferalloc, bufferptr, store_ptr, &size, error);
-			buffer = (char *) *bufferptr;
-			write_len = (size_t)size;
-			status = mb_fileio_put(verbose, mbio_ptr, buffer, &write_len, error);
-			}
-
-		/* Reson 7k image data (record 7011) */
-		if (status == MB_SUCCESS && store->read_image == MB_YES)
-			{
-			store->type = R7KRECID_7kImageData;
-#ifdef MBR_RESON7KR_DEBUG
-fprintf(stderr, "Writing record id: %4.4X | %d", R7KRECID_7kImageData, R7KRECID_7kImageData);
-fprintf(stderr," R7KRECID_7kImageData\n");
-#endif
-			status = mbr_reson7kr_wr_image(verbose, bufferalloc, bufferptr, store_ptr, &size, error);
-			buffer = (char *) *bufferptr;
-			write_len = (size_t)size;
-			status = mb_fileio_put(verbose, mbio_ptr, buffer, &write_len, error);
-			}
-
-		/* Reson 7k Ping motion (record 7012) */
-		if (status == MB_SUCCESS && store->read_v2pingmotion == MB_YES)
-			{
-			store->type = R7KRECID_7kV2PingMotion;
-#ifdef MBR_RESON7KR_DEBUG
-fprintf(stderr, "Writing record id: %4.4X | %d", R7KRECID_7kV2PingMotion, R7KRECID_7kV2PingMotion);
-fprintf(stderr," R7KRECID_7kV2PingMotion\n");
-#endif
-			status = mbr_reson7kr_wr_v2pingmotion(verbose, bufferalloc, bufferptr, store_ptr, &size, error);
-			buffer = (char *) *bufferptr;
-			write_len = (size_t)size;
-			status = mb_fileio_put(verbose, mbio_ptr, buffer, &write_len, error);
-			}
-
-		/* Reson 7k detection setup (record 7017) */
-		if (status == MB_SUCCESS && store->read_v2detectionsetup == MB_YES)
-			{
-			store->type = R7KRECID_7kV2DetectionSetup;
-#ifdef MBR_RESON7KR_DEBUG
-fprintf(stderr, "Writing record id: %4.4X | %d", R7KRECID_7kV2DetectionSetup, R7KRECID_7kV2DetectionSetup);
-fprintf(stderr," R7KRECID_7kV2DetectionSetup\n");
-#endif
-			status = mbr_reson7kr_wr_v2detectionsetup(verbose, bufferalloc, bufferptr, store_ptr, &size, error);
-			buffer = (char *) *bufferptr;
-			write_len = (size_t)size;
-			status = mb_fileio_put(verbose, mbio_ptr, buffer, &write_len, error);
-			}
-
-		/* Reson 7k beamformed magnitude and phase data (record 7018) */
-		if (status == MB_SUCCESS && store->read_v2beamformed == MB_YES)
-			{
-			store->type = R7KRECID_7kV2BeamformedData;
-#ifdef MBR_RESON7KR_DEBUG
-fprintf(stderr, "Writing record id: %4.4X | %d", R7KRECID_7kV2BeamformedData, R7KRECID_7kV2BeamformedData);
-fprintf(stderr," R7KRECID_7kV2BeamformedData\n");
-#endif
-			status = mbr_reson7kr_wr_v2beamformed(verbose, bufferalloc, bufferptr, store_ptr, &size, error);
-			buffer = (char *) *bufferptr;
-			write_len = (size_t)size;
-			status = mb_fileio_put(verbose, mbio_ptr, buffer, &write_len, error);
-			}
-
-		/* Reson 7k version 2 detection (record 7026) */
-		if (status == MB_SUCCESS && store->read_v2detection == MB_YES)
-			{
-			store->type = R7KRECID_7kV2Detection;
-#ifdef MBR_RESON7KR_DEBUG
-fprintf(stderr, "Writing record id: %4.4X | %d", R7KRECID_7kV2Detection, R7KRECID_7kV2Detection);
-fprintf(stderr," R7KRECID_7kV2Detection\n");
-#endif
-			status = mbr_reson7kr_wr_v2detection(verbose, bufferalloc, bufferptr, store_ptr, &size, error);
-			buffer = (char *) *bufferptr;
-			write_len = (size_t)size;
-			status = mb_fileio_put(verbose, mbio_ptr, buffer, &write_len, error);
-			}
-
-		/* Reson 7k version 2 raw detection (record 7027) */
-		if (status == MB_SUCCESS && store->read_v2rawdetection == MB_YES)
-			{
-			store->type = R7KRECID_7kV2RawDetection;
-#ifdef MBR_RESON7KR_DEBUG
-fprintf(stderr, "Writing record id: %4.4X | %d", R7KRECID_7kV2RawDetection, R7KRECID_7kV2RawDetection);
-fprintf(stderr," R7KRECID_7kV2RawDetection\n");
-#endif
-			status = mbr_reson7kr_wr_v2rawdetection(verbose, bufferalloc, bufferptr, store_ptr, &size, error);
-			buffer = (char *) *bufferptr;
-			write_len = (size_t)size;
-			status = mb_fileio_put(verbose, mbio_ptr, buffer, &write_len, error);
-			}
-
-		/* Reson 7k version 2 snippet (record 7028) */
-		if (status == MB_SUCCESS && store->read_v2snippet == MB_YES)
-			{
-			store->type = R7KRECID_7kV2SnippetData;
-#ifdef MBR_RESON7KR_DEBUG
-fprintf(stderr, "Writing record id: %4.4X | %d", R7KRECID_7kV2SnippetData, R7KRECID_7kV2SnippetData);
-fprintf(stderr," R7KRECID_7kV2SnippetData\n");
-#endif
-			status = mbr_reson7kr_wr_v2snippet(verbose, bufferalloc, bufferptr, store_ptr, &size, error);
-			buffer = (char *) *bufferptr;
-			write_len = (size_t)size;
-			status = mb_fileio_put(verbose, mbio_ptr, buffer, &write_len, error);
-			}
-
-		/* Reson 7k calibrated snippet (record 7058) */
-		if (status == MB_SUCCESS && store->read_calibratedsnippet == MB_YES)
-			{
-			store->type = R7KRECID_7kCalibratedSnippetData;
-#ifdef MBR_RESON7KR_DEBUG
-fprintf(stderr, "Writing record id: %4.4X | %d", R7KRECID_7kCalibratedSnippetData, R7KRECID_7kCalibratedSnippetData);
-fprintf(stderr," R7KRECID_7kCalibratedSnippetData\n");
-#endif
-			status = mbr_reson7kr_wr_calibratedsnippet(verbose, bufferalloc, bufferptr, store_ptr, &size, error);
-			buffer = (char *) *bufferptr;
-			write_len = (size_t)size;
-			status = mb_fileio_put(verbose, mbio_ptr, buffer, &write_len, error);
-			}
-
-		}
-
-	/* call appropriate writing routine for other records */
-	else if (status == MB_SUCCESS && store->type != R7KRECID_7kFileHeader)
-		{
-#ifdef MBR_RESON7KR_DEBUG
-fprintf(stderr, "Writing record id: %4.4X | %d", store->type, store->type);
-if (store->type == R7KRECID_ReferencePoint) fprintf(stderr," R7KRECID_ReferencePoint\n");
-if (store->type == R7KRECID_UncalibratedSensorOffset) fprintf(stderr," R7KRECID_UncalibratedSensorOffset\n");
-if (store->type == R7KRECID_CalibratedSensorOffset) fprintf(stderr," R7KRECID_CalibratedSensorOffset\n");
-if (store->type == R7KRECID_Position) fprintf(stderr," R7KRECID_Position\n");
-if (store->type == R7KRECID_CustomAttitude) fprintf(stderr," R7KRECID_CustomAttitude\n");
-if (store->type == R7KRECID_Tide) fprintf(stderr," R7KRECID_Tide\n");
-if (store->type == R7KRECID_Altitude) fprintf(stderr," R7KRECID_Altitude\n");
-if (store->type == R7KRECID_MotionOverGround) fprintf(stderr," R7KRECID_MotionOverGround\n");
-if (store->type == R7KRECID_Depth) fprintf(stderr," R7KRECID_Depth\n");
-if (store->type == R7KRECID_SoundVelocityProfile) fprintf(stderr," R7KRECID_SoundVelocityProfile\n");
-if (store->type == R7KRECID_CTD) fprintf(stderr," R7KRECID_CTD\n");
-if (store->type == R7KRECID_Geodesy) fprintf(stderr," R7KRECID_Geodesy\n");
-if (store->type == R7KRECID_RollPitchHeave) fprintf(stderr," R7KRECID_RollPitchHeave\n");
-if (store->type == R7KRECID_Heading) fprintf(stderr," R7KRECID_Heading\n");
-if (store->type == R7KRECID_SurveyLine) fprintf(stderr," R7KRECID_SurveyLine\n");
-if (store->type == R7KRECID_Navigation) fprintf(stderr," R7KRECID_Navigation\n");
-if (store->type == R7KRECID_Attitude) fprintf(stderr," R7KRECID_Attitude\n");
-if (store->type == R7KRECID_Rec1022) fprintf(stderr," R7KRECID_Rec1022\n");
-if (store->type == R7KRECID_GenericSensorCalibration) fprintf(stderr," R7KRECID_GenericSensorCalibration\n");
-if (store->type == R7KRECID_GenericSidescan) fprintf(stderr," R7KRECID_GenericSidescan\n");
-if (store->type == R7KRECID_FSDWsidescan)
-	{
-	if (store->sstype == R7KRECID_FSDWsidescanLo) fprintf(stderr," R7KRECID_FSDWsidescan R7KRECID_FSDWsidescanLo\n");
-	if (store->sstype == R7KRECID_FSDWsidescanHi) fprintf(stderr," R7KRECID_FSDWsidescan R7KRECID_FSDWsidescanHi\n");
-	}
-if (store->type == R7KRECID_FSDWsubbottom) fprintf(stderr," R7KRECID_FSDWsubbottom\n");
-if (store->type == R7KRECID_Bluefin) fprintf(stderr," R7KRECID_Bluefin\n");
-if (store->type == R7KRECID_7kVolatileSonarSettings) fprintf(stderr," R7KRECID_7kVolatileSonarSettings\n");
-if (store->type == R7KRECID_7kConfiguration) fprintf(stderr," R7KRECID_7kConfiguration\n");
-if (store->type == R7KRECID_7kMatchFilter) fprintf(stderr," R7KRECID_7kMatchFilter\n");
-if (store->type == R7KRECID_7kV2FirmwareHardwareConfiguration) fprintf(stderr," R7KRECID_7kV2FirmwareHardwareConfiguration\n");
-if (store->type == R7KRECID_7kBeamGeometry) fprintf(stderr," R7KRECID_7kBeamGeometry\n");
-if (store->type == R7KRECID_7kCalibrationData) fprintf(stderr," R7KRECID_7kCalibrationData\n");
-if (store->type == R7KRECID_7kBathymetricData) fprintf(stderr," R7KRECID_7kBathymetricData\n");
-if (store->type == R7KRECID_7kBackscatterImageData) fprintf(stderr," R7KRECID_7kBackscatterImageData\n");
-if (store->type == R7KRECID_7kBeamData) fprintf(stderr," R7KRECID_7kBeamData\n");
-if (store->type == R7KRECID_7kVerticalDepth) fprintf(stderr," R7KRECID_7kVerticalDepth\n");
-if (store->type == R7KRECID_7kTVGData) fprintf(stderr," R7KRECID_7kTVGData\n");
-if (store->type == R7KRECID_7kImageData) fprintf(stderr," R7KRECID_7kImageData\n");
-if (store->type == R7KRECID_7kV2PingMotion) fprintf(stderr," R7KRECID_7kV2PingMotion\n");
-if (store->type == R7KRECID_7kV2DetectionSetup) fprintf(stderr," R7KRECID_7kV2DetectionSetup\n");
-if (store->type == R7KRECID_7kV2BeamformedData) fprintf(stderr," R7KRECID_7kV2BeamformedData\n");
-if (store->type == R7KRECID_7kV2BITEData) fprintf(stderr," R7KRECID_7kV2BITEData\n");
-if (store->type == R7KRECID_7kV27kCenterVersion) fprintf(stderr," R7KRECID_7kV27kCenterVersion\n");
-if (store->type == R7KRECID_7kV28kWetEndVersion) fprintf(stderr," R7KRECID_7kV28kWetEndVersion\n");
-if (store->type == R7KRECID_7kV2Detection) fprintf(stderr," R7KRECID_7kV2Detection\n");
-if (store->type == R7KRECID_7kV2RawDetection) fprintf(stderr," R7KRECID_7kV2RawDetection\n");
-if (store->type == R7KRECID_7kV2SnippetData) fprintf(stderr," R7KRECID_7kV2SnippetData\n");
-if (store->type == R7KRECID_7kCalibratedSnippetData) fprintf(stderr, " R7KRECID_7kCalibratedSnippetData\n");
-if (store->type == R7KRECID_7kInstallationParameters) fprintf(stderr," R7KRECID_7kInstallationParameters\n");
-if (store->type == R7KRECID_7kSystemEventMessage) fprintf(stderr,"R7KRECID_7kSystemEventMessage\n");
-if (store->type == R7KRECID_7kDataStorageStatus) fprintf(stderr," R7KRECID_7kDataStorageStatus\n");
-if (store->type == R7KRECID_7kFileHeader) fprintf(stderr," R7KRECID_7kFileHeader\n");
-if (store->type == R7KRECID_7kTrigger) fprintf(stderr," R7KRECID_7kTrigger\n");
-if (store->type == R7KRECID_7kTriggerSequenceSetup) fprintf(stderr," R7KRECID_7kTriggerSequenceSetup\n");
-if (store->type == R7KRECID_7kTriggerSequenceDone) fprintf(stderr," R7KRECID_7kTriggerSequenceDone\n");
-if (store->type == R7KRECID_7kTimeMessage) fprintf(stderr," R7KRECID_7kTimeMessage\n");
-if (store->type == R7KRECID_7kRemoteControl) fprintf(stderr," R7KRECID_7kRemoteControl\n");
-if (store->type == R7KRECID_7kRemoteControlAcknowledge) fprintf(stderr," R7KRECID_7kRemoteControlAcknowledge\n");
-if (store->type == R7KRECID_7kRemoteControlNotAcknowledge) fprintf(stderr," R7KRECID_7kRemoteControlNotAcknowledge\n");
-if (store->type == R7KRECID_7kRemoteControlSonarSettings) fprintf(stderr," R7KRECID_7kRemoteControlSonarSettings\n");
-if (store->type == R7KRECID_7kReserved) fprintf(stderr," R7KRECID_7kReserved\n");
-if (store->type == R7KRECID_7kRoll) fprintf(stderr," R7KRECID_7kRoll\n");
-if (store->type == R7KRECID_7kPitch) fprintf(stderr," R7KRECID_7kPitch\n");
-if (store->type == R7KRECID_7kSoundVelocity) fprintf(stderr," R7KRECID_7kSoundVelocity\n");
-if (store->type == R7KRECID_7kAbsorptionLoss) fprintf(stderr," R7KRECID_7kAbsorptionLoss\n");
-if (store->type == R7KRECID_7kSpreadingLoss) fprintf(stderr," R7KRECID_7kSpreadingLoss\n");
-if (store->type == R7KRECID_8100SonarData) fprintf(stderr," R7KRECID_8100SonarData\n");
-#endif
-		if (store->type == R7KRECID_ReferencePoint)
-			{
-			status = mbr_reson7kr_wr_reference(verbose, bufferalloc, bufferptr, store_ptr, &size, error);
-			}
-		else if (store->type == R7KRECID_UncalibratedSensorOffset)
-			{
-			status = mbr_reson7kr_wr_sensoruncal(verbose, bufferalloc, bufferptr, store_ptr, &size, error);
-			}
-		else if (store->type == R7KRECID_CalibratedSensorOffset)
-			{
-			status = mbr_reson7kr_wr_sensorcal(verbose, bufferalloc, bufferptr, store_ptr, &size, error);
-			}
-		else if (store->type == R7KRECID_Position)
-			{
-			status = mbr_reson7kr_wr_position(verbose, bufferalloc, bufferptr, store_ptr, &size, error);
-			}
-		else if (store->type == R7KRECID_CustomAttitude)
-			{
-			status = mbr_reson7kr_wr_customattitude(verbose, bufferalloc, bufferptr, store_ptr, &size, error);
-			}
-		else if (store->type == R7KRECID_Tide)
-			{
-			status = mbr_reson7kr_wr_tide(verbose, bufferalloc, bufferptr, store_ptr, &size, error);
-			}
-		else if (store->type == R7KRECID_Altitude)
-			{
-			status = mbr_reson7kr_wr_altitude(verbose, bufferalloc, bufferptr, store_ptr, &size, error);
-			}
-		else if (store->type == R7KRECID_MotionOverGround)
-			{
-			status = mbr_reson7kr_wr_motion(verbose, bufferalloc, bufferptr, store_ptr, &size, error);
-			}
-		else if (store->type == R7KRECID_Depth)
-			{
-			status = mbr_reson7kr_wr_depth(verbose, bufferalloc, bufferptr, store_ptr, &size, error);
-			}
-		else if (store->type == R7KRECID_SoundVelocityProfile)
-			{
-			status = mbr_reson7kr_wr_svp(verbose, bufferalloc, bufferptr, store_ptr, &size, error);
-			}
-		else if (store->type == R7KRECID_CTD)
-			{
-			status = mbr_reson7kr_wr_ctd(verbose, bufferalloc, bufferptr, store_ptr, &size, error);
-			}
-		else if (store->type == R7KRECID_Geodesy)
-			{
-			status = mbr_reson7kr_wr_geodesy(verbose, bufferalloc, bufferptr, store_ptr, &size, error);
-			}
-		else if (store->type == R7KRECID_RollPitchHeave)
-			{
-			status = mbr_reson7kr_wr_rollpitchheave(verbose, bufferalloc, bufferptr, store_ptr, &size, error);
-			}
-		else if (store->type == R7KRECID_Heading)
-			{
-			status = mbr_reson7kr_wr_heading(verbose, bufferalloc, bufferptr, store_ptr, &size, error);
-			}
-		else if (store->type == R7KRECID_SurveyLine)
-			{
-			status = mbr_reson7kr_wr_surveyline(verbose, bufferalloc, bufferptr, store_ptr, &size, error);
-			}
-		else if (store->type == R7KRECID_Navigation)
-			{
-			status = mbr_reson7kr_wr_navigation(verbose, bufferalloc, bufferptr, store_ptr, &size, error);
-			}
-		else if (store->type == R7KRECID_Attitude)
-			{
-			status = mbr_reson7kr_wr_attitude(verbose, bufferalloc, bufferptr, store_ptr, &size, error);
-			}
-		else if (store->type == R7KRECID_Rec1022)
-			{
-			status = mbr_reson7kr_wr_rec1022(verbose, bufferalloc, bufferptr, store_ptr, &size, error);
-			}
-		else if (store->type == R7KRECID_FSDWsidescan
-				&& store->sstype == R7KRECID_FSDWsidescanLo)
-			{
-			status = mbr_reson7kr_wr_fsdwsslo(verbose, bufferalloc, bufferptr, store_ptr, &size, error);
-			}
-		else if (store->type == R7KRECID_FSDWsidescan
-				&& store->sstype == R7KRECID_FSDWsidescanHi)
-			{
-			status = mbr_reson7kr_wr_fsdwsshi(verbose, bufferalloc, bufferptr, store_ptr, &size, error);
-			}
-		else if (store->type == R7KRECID_FSDWsubbottom)
-			{
-			status = mbr_reson7kr_wr_fsdwsb(verbose, bufferalloc, bufferptr, store_ptr, &size, error);
-			}
-		else if (store->type == R7KRECID_Bluefin)
-			{
-			status = mbr_reson7kr_wr_bluefin(verbose, bufferalloc, bufferptr, store_ptr, &size, error);
-			}
-		else if (store->type == R7KRECID_ProcessedSidescan)
-			{
-			status = mbr_reson7kr_wr_processedsidescan(verbose, bufferalloc, bufferptr, store_ptr, &size, error);
-			}
-		else if (store->type == R7KRECID_7kVolatileSonarSettings)
-			{
-			status = mbr_reson7kr_wr_volatilesonarsettings(verbose, bufferalloc, bufferptr, store_ptr, &size, error);
-			}
-		else if (store->type == R7KRECID_7kConfiguration)
-			{
-			status = mbr_reson7kr_wr_configuration(verbose, bufferalloc, bufferptr, store_ptr, &size, error);
-			}
-		else if (store->type == R7KRECID_7kV2FirmwareHardwareConfiguration)
-			{
-			status = mbr_reson7kr_wr_v2firmwarehardwareconfiguration(verbose, bufferalloc, bufferptr, store_ptr, &size, error);
-			}
-		else if (store->type == R7KRECID_7kCalibrationData)
-			{
-			status = mbr_reson7kr_wr_calibration(verbose, bufferalloc, bufferptr, store_ptr, &size, error);
-			}
-		else if (store->type == R7KRECID_7kV2BITEData)
-			{
-			status = mbr_reson7kr_wr_v2bite(verbose, bufferalloc, bufferptr, store_ptr, &size, error);
-			}
-		else if (store->type == R7KRECID_7kV27kCenterVersion)
-			{
-			status = mbr_reson7kr_wr_v27kcenterversion(verbose, bufferalloc, bufferptr, store_ptr, &size, error);
-			}
-		else if (store->type == R7KRECID_7kV28kWetEndVersion)
-			{
-			status = mbr_reson7kr_wr_v28kwetendversion(verbose, bufferalloc, bufferptr, store_ptr, &size, error);
-			}
-		else if (store->type == R7KRECID_7kInstallationParameters)
-			{
-			status = mbr_reson7kr_wr_installation(verbose, bufferalloc, bufferptr, store_ptr, &size, error);
-			}
-		else if (store->type == R7KRECID_7kSystemEventMessage)
-			{
-			status = mbr_reson7kr_wr_systemeventmessage(verbose, bufferalloc, bufferptr, store_ptr, &size, error);
-			}
-		else if (store->type == R7KRECID_7kRemoteControlSonarSettings)
-			{
-			status = mbr_reson7kr_wr_remotecontrolsettings(verbose, bufferalloc, bufferptr, store_ptr, &size, error);
-			}
-		else if (store->type == R7KRECID_7kReserved)
-			{
-			status = mbr_reson7kr_wr_reserved(verbose, bufferalloc, bufferptr, store_ptr, &size, error);
-			}
-		else if (store->type == R7KRECID_7kRoll)
-			{
-			status = mbr_reson7kr_wr_roll(verbose, bufferalloc, bufferptr, store_ptr, &size, error);
-			}
-		else if (store->type == R7KRECID_7kPitch)
-			{
-			status = mbr_reson7kr_wr_pitch(verbose, bufferalloc, bufferptr, store_ptr, &size, error);
-			}
-		else if (store->type == R7KRECID_7kSoundVelocity)
-			{
-			status = mbr_reson7kr_wr_soundvelocity(verbose, bufferalloc, bufferptr, store_ptr, &size, error);
-			}
-		else if (store->type == R7KRECID_7kAbsorptionLoss)
-			{
-			status = mbr_reson7kr_wr_absorptionloss(verbose, bufferalloc, bufferptr, store_ptr, &size, error);
-			}
-		else if (store->type == R7KRECID_7kSpreadingLoss)
-			{
-			status = mbr_reson7kr_wr_spreadingloss(verbose, bufferalloc, bufferptr, store_ptr, &size, error);
-			}
-		else
-			{
-			fprintf(stderr,"call nothing bad kind: %d type %x\n", store->kind, store->type);
-			status = MB_FAILURE;
-			*error = MB_ERROR_BAD_KIND;
-			}
-
-		/* finally write the record to the output file */
-		if (status == MB_SUCCESS)
-			{
-			buffer = (char *) *bufferptr;
-			write_len = (size_t)size;
-			status = mb_fileio_put(verbose, mbio_ptr, buffer, &write_len, error);
-			}
-		}
-
-#ifdef MBR_RESON7KR_DEBUG
-	fprintf(stderr,"RESON7KR DATA WRITTEN: type:%d status:%d error:%d\n\n",
-	store->kind, status, *error);
-#endif
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_wr_header(int verbose, char *buffer, int *index,
-		s7k_header *header, int *error)
-{
-	char	*function_name = "mbr_reson7kr_wr_header";
-	int	status = MB_SUCCESS;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       buffer:     %p\n",(void *)buffer);
-		fprintf(stderr,"dbg2       index:      %d\n",*index);
-		fprintf(stderr,"dbg2       header:     %p\n",(void *)header);
-		}
-
-	/* set some important values */
-	header->Version = 5;
-	header->Offset = 60;
-	header->SyncPattern = 0x0000ffff;
-	header->Reserved = 0;
-	for (i=0;i<8;i++)
-		{
-		header->PreviousRecord[i] = -1;
-		header->NextRecord[i] = -1;
-		}
-	header->Flags = 0;
-	header->Reserved2 = 0;
-
-	/* print out the data to be output */
-#ifdef MBR_RESON7KR_DEBUG
-	if (verbose > 0)
-#else
-	if (verbose >= 2)
-#endif
-	mbsys_reson7k_print_header(verbose, header, error);
-
-	/* insert the header */
-	mb_put_binary_short(MB_YES, header->Version, &buffer[*index]); *index +=2;
-	mb_put_binary_short(MB_YES, header->Offset, &buffer[*index]); *index +=2;
-	mb_put_binary_int(MB_YES, header->SyncPattern, &buffer[*index]); *index += 4;
-	mb_put_binary_int(MB_YES, header->Size, &buffer[*index]); *index += 4;
-	mb_put_binary_int(MB_YES, header->OffsetToOptionalData, &buffer[*index]); *index += 4;
-	mb_put_binary_int(MB_YES, header->OptionalDataIdentifier, &buffer[*index]); *index += 4;
-	mb_put_binary_short(MB_YES, header->s7kTime.Year, &buffer[*index]); *index += 2;
-	mb_put_binary_short(MB_YES, header->s7kTime.Day, &buffer[*index]); *index += 2;
-	mb_put_binary_float(MB_YES, header->s7kTime.Seconds, &buffer[*index]); *index += 4;
-	buffer[*index] = header->s7kTime.Hours; (*index)++;
-	buffer[*index] = header->s7kTime.Minutes; (*index)++;
-	mb_put_binary_short(MB_YES, header->Reserved, &buffer[*index]); *index += 2;
-	mb_put_binary_int(MB_YES, header->RecordType, &buffer[*index]); *index += 4;
-	mb_put_binary_int(MB_YES, header->DeviceId, &buffer[*index]); *index += 4;
-	mb_put_binary_short(MB_YES, header->Reserved2, &buffer[*index]); *index += 2;
-	mb_put_binary_short(MB_YES, header->SystemEnumerator, &buffer[*index]); *index += 2;
-	mb_put_binary_int(MB_YES, header->RecordNumber, &buffer[*index]); *index += 4;
-	mb_put_binary_short(MB_YES, header->Flags, &buffer[*index]); *index += 2;
-	mb_put_binary_short(MB_YES, header->Reserved3, &buffer[*index]); *index += 2;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       index:      %d\n",*index);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_wr_reference(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error)
-{
-	char	*function_name = "mbr_reson7kr_wr_reference";
-	int	status = MB_SUCCESS;
-	struct mbsys_reson7k_struct *store;
-	s7k_header *header;
-	s7kr_reference *reference;
-	unsigned int checksum;
-	int	index;
-	char	*buffer;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       bufferalloc:%d\n",*bufferalloc);
-		fprintf(stderr,"dbg2       bufferptr:  %p\n",(void *)bufferptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	reference = &(store->reference);
-	header = &(reference->header);
-
-	/* print out the data to be output */
-#ifdef MBR_RESON7KR_DEBUG
-	if (verbose > 0)
-#else
-	if (verbose >= 2)
-#endif
-	mbsys_reson7k_print_reference(verbose, reference, error);
-
-	/* figure out size of output record */
-	*size = MBSYS_RESON7K_RECORDHEADER_SIZE + MBSYS_RESON7K_RECORDTAIL_SIZE;
-	*size += R7KHDRSIZE_ReferencePoint;
-
-	/* allocate memory to write rest of record if necessary */
-	if (*bufferalloc < *size)
-		{
-		status = mb_reallocd(verbose, __FILE__, __LINE__, *size,
-					(void **)bufferptr, error);
-		if (status != MB_SUCCESS)
-			{
-			*bufferalloc = 0;
-			}
-		else
-			{
-			*bufferalloc = *size;
-			}
-		}
-
-	/* proceed to write if buffer allocated */
-	if (status == MB_SUCCESS)
-		{
-		/* get buffer for writing */
-		buffer = (char *) *bufferptr;
-
-		/* insert the header */
-		index = 0;
-		status = mbr_reson7kr_wr_header(verbose, buffer, &index, header, error);
-
-		/* insert the data */
-		mb_put_binary_float(MB_YES, reference->offset_x, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, reference->offset_y, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, reference->offset_z, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, reference->water_z, &buffer[index]); index += 4;
-
-		/* reset the header size value */
-		mb_put_binary_int(MB_YES, ((unsigned int)(index + 4)), &buffer[8]);
-
-		/* now add the checksum */
-		checksum = 0;
-		for (i=0;i<index;i++)
-			checksum += (unsigned char) buffer[i];
-		mb_put_binary_int(MB_YES, checksum, &buffer[index]); index += 4;
-
-		/* check size */
-		if (*size != index)
-			{
-fprintf(stderr,"Bad size comparison: file:%s line:%d size:%d index:%d\n", __FILE__, __LINE__, *size, index);
-			status = MB_FAILURE;
-			*error = MB_ERROR_BAD_DATA;
-			*size = 0;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       bufferalloc:%d\n",*bufferalloc);
-		fprintf(stderr,"dbg2       size:       %d\n",*size);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_wr_sensoruncal(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error)
-{
-	char	*function_name = "mbr_reson7kr_wr_sensoruncal";
-	int	status = MB_SUCCESS;
-	struct mbsys_reson7k_struct *store;
-	s7k_header *header;
-	s7kr_sensoruncal *sensoruncal;
-	unsigned int checksum;
-	int	index;
-	char	*buffer;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       bufferalloc:%d\n",*bufferalloc);
-		fprintf(stderr,"dbg2       bufferptr:  %p\n",(void *)bufferptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	sensoruncal = &(store->sensoruncal);
-	header = &(sensoruncal->header);
-
-	/* print out the data to be output */
-#ifdef MBR_RESON7KR_DEBUG
-	if (verbose > 0)
-#else
-	if (verbose >= 2)
-#endif
-	mbsys_reson7k_print_sensoruncal(verbose, sensoruncal, error);
-
-	/* figure out size of output record */
-	*size = MBSYS_RESON7K_RECORDHEADER_SIZE + MBSYS_RESON7K_RECORDTAIL_SIZE;
-	*size += R7KHDRSIZE_UncalibratedSensorOffset;
-
-	/* allocate memory to write rest of record if necessary */
-	if (*bufferalloc < *size)
-		{
-		status = mb_reallocd(verbose, __FILE__, __LINE__, *size,
-					(void **)bufferptr, error);
-		if (status != MB_SUCCESS)
-			{
-			*bufferalloc = 0;
-			}
-		else
-			{
-			*bufferalloc = *size;
-			}
-		}
-
-	/* proceed to write if buffer allocated */
-	if (status == MB_SUCCESS)
-		{
-		/* get buffer for writing */
-		buffer = (char *) *bufferptr;
-
-		/* insert the header */
-		index = 0;
-		status = mbr_reson7kr_wr_header(verbose, buffer, &index, header, error);
-
-		/* insert the data */
-		index = header->Offset + 4;
-		mb_put_binary_float(MB_YES, sensoruncal->offset_x, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, sensoruncal->offset_y, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, sensoruncal->offset_z, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, sensoruncal->offset_roll, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, sensoruncal->offset_pitch, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, sensoruncal->offset_yaw, &buffer[index]); index += 4;
-
-		/* reset the header size value */
-		mb_put_binary_int(MB_YES, ((unsigned int)(index + 4)), &buffer[8]);
-
-		/* now add the checksum */
-		checksum = 0;
-		for (i=0;i<index;i++)
-			checksum += (unsigned char) buffer[i];
-		mb_put_binary_int(MB_YES, checksum, &buffer[index]); index += 4;
-
-		/* check size */
-		if (*size != index)
-			{
-fprintf(stderr,"Bad size comparison: file:%s line:%d size:%d index:%d\n", __FILE__, __LINE__, *size, index);
-			status = MB_FAILURE;
-			*error = MB_ERROR_BAD_DATA;
-			*size = 0;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       bufferalloc:%d\n",*bufferalloc);
-		fprintf(stderr,"dbg2       size:       %d\n",*size);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_wr_sensorcal(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error)
-{
-	char	*function_name = "mbr_reson7kr_wr_sensorcal";
-	int	status = MB_SUCCESS;
-	struct mbsys_reson7k_struct *store;
-	s7k_header *header;
-	s7kr_sensorcal *sensorcal;
-	unsigned int checksum;
-	int	index;
-	char	*buffer;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       bufferalloc:%d\n",*bufferalloc);
-		fprintf(stderr,"dbg2       bufferptr:  %p\n",(void *)bufferptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	sensorcal = &(store->sensorcal);
-	header = &(sensorcal->header);
-
-	/* print out the data to be output */
-#ifdef MBR_RESON7KR_DEBUG
-	if (verbose > 0)
-#else
-	if (verbose >= 2)
-#endif
-	mbsys_reson7k_print_sensorcal(verbose, sensorcal, error);
-
-	/* figure out size of output record */
-	*size = MBSYS_RESON7K_RECORDHEADER_SIZE + MBSYS_RESON7K_RECORDTAIL_SIZE;
-	*size += R7KHDRSIZE_CalibratedSensorOffset;
-
-	/* allocate memory to write rest of record if necessary */
-	if (*bufferalloc < *size)
-		{
-		status = mb_reallocd(verbose, __FILE__, __LINE__, *size,
-					(void **)bufferptr, error);
-		if (status != MB_SUCCESS)
-			{
-			*bufferalloc = 0;
-			}
-		else
-			{
-			*bufferalloc = *size;
-			}
-		}
-
-	/* proceed to write if buffer allocated */
-	if (status == MB_SUCCESS)
-		{
-		/* get buffer for writing */
-		buffer = (char *) *bufferptr;
-
-		/* insert the header */
-		index = 0;
-		status = mbr_reson7kr_wr_header(verbose, buffer, &index, header, error);
-
-		/* insert the data */
-		index = header->Offset + 4;
-		mb_put_binary_float(MB_YES, sensorcal->offset_x, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, sensorcal->offset_y, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, sensorcal->offset_z, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, sensorcal->offset_roll, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, sensorcal->offset_pitch, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, sensorcal->offset_yaw, &buffer[index]); index += 4;
-
-		/* reset the header size value */
-		mb_put_binary_int(MB_YES, ((unsigned int)(index + 4)), &buffer[8]);
-
-		/* now add the checksum */
-		checksum = 0;
-		for (i=0;i<index;i++)
-			checksum += (unsigned char) buffer[i];
-		mb_put_binary_int(MB_YES, checksum, &buffer[index]); index += 4;
-
-		/* check size */
-		if (*size != index)
-			{
-fprintf(stderr,"Bad size comparison: file:%s line:%d size:%d index:%d\n", __FILE__, __LINE__, *size, index);
-			status = MB_FAILURE;
-			*error = MB_ERROR_BAD_DATA;
-			*size = 0;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       bufferalloc:%d\n",*bufferalloc);
-		fprintf(stderr,"dbg2       size:       %d\n",*size);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_wr_position(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error)
-{
-	char	*function_name = "mbr_reson7kr_wr_position";
-	int	status = MB_SUCCESS;
-	struct mbsys_reson7k_struct *store;
-	s7k_header *header;
-	s7kr_position *position;
-	unsigned int checksum;
-	int	index;
-	char	*buffer;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       bufferalloc:%d\n",*bufferalloc);
-		fprintf(stderr,"dbg2       bufferptr:  %p\n",(void *)bufferptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	position = &(store->position);
-	header = &(position->header);
-
-	/* print out the data to be output */
-#ifdef MBR_RESON7KR_DEBUG
-	if (verbose > 0)
-#else
-	if (verbose >= 2)
-#endif
-	mbsys_reson7k_print_position(verbose, position, error);
-
-	/* figure out size of output record */
-	*size = MBSYS_RESON7K_RECORDHEADER_SIZE + MBSYS_RESON7K_RECORDTAIL_SIZE;
-	*size += R7KHDRSIZE_Position;
-
-	/* allocate memory to write rest of record if necessary */
-	if (*bufferalloc < *size)
-		{
-		status = mb_reallocd(verbose, __FILE__, __LINE__, *size,
-					(void **)bufferptr, error);
-		if (status != MB_SUCCESS)
-			{
-			*bufferalloc = 0;
-			}
-		else
-			{
-			*bufferalloc = *size;
-			}
-		}
-
-	/* proceed to write if buffer allocated */
-	if (status == MB_SUCCESS)
-		{
-		/* get buffer for writing */
-		buffer = (char *) *bufferptr;
-
-		/* insert the header */
-		index = 0;
-		status = mbr_reson7kr_wr_header(verbose, buffer, &index, header, error);
-
-		/* insert the data */
-		index = header->Offset + 4;
-		mb_put_binary_int(MB_YES, position->datum, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, position->latency, &buffer[index]); index += 4;
-		mb_put_binary_double(MB_YES, position->latitude, &buffer[index]); index += 8;
-		mb_put_binary_double(MB_YES, position->longitude, &buffer[index]); index += 8;
-		mb_put_binary_double(MB_YES, position->height, &buffer[index]); index += 8;
-		buffer[index] = position->type; index++;
-		buffer[index] = position->utm_zone; index++;
-		buffer[index] = position->quality; index++;
-		buffer[index] = position->method; index++;
-
-		/* reset the header size value */
-		mb_put_binary_int(MB_YES, ((unsigned int)(index + 4)), &buffer[8]);
-
-		/* now add the checksum */
-		checksum = 0;
-		for (i=0;i<index;i++)
-			checksum += (unsigned char) buffer[i];
-		mb_put_binary_int(MB_YES, checksum, &buffer[index]); index += 4;
-
-		/* check size */
-		if (*size != index)
-			{
-fprintf(stderr,"Bad size comparison: file:%s line:%d size:%d index:%d\n", __FILE__, __LINE__, *size, index);
-			status = MB_FAILURE;
-			*error = MB_ERROR_BAD_DATA;
-			*size = 0;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       bufferalloc:%d\n",*bufferalloc);
-		fprintf(stderr,"dbg2       size:       %d\n",*size);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_wr_customattitude(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error)
-{
-	char	*function_name = "mbr_reson7kr_wr_customattitude";
-	int	status = MB_SUCCESS;
-	struct mbsys_reson7k_struct *store;
-	s7k_header *header;
-	s7kr_customattitude *customattitude;
-	unsigned int checksum;
-	int	index;
-	char	*buffer;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       bufferalloc:%d\n",*bufferalloc);
-		fprintf(stderr,"dbg2       bufferptr:  %p\n",(void *)bufferptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	customattitude = &(store->customattitude);
-	header = &(customattitude->header);
-
-	/* print out the data to be output */
-#ifdef MBR_RESON7KR_DEBUG
-	if (verbose > 0)
-#else
-	if (verbose >= 2)
-#endif
-	mbsys_reson7k_print_customattitude(verbose, customattitude, error);
-
-	/* figure out size of output record */
-	*size = MBSYS_RESON7K_RECORDHEADER_SIZE + MBSYS_RESON7K_RECORDTAIL_SIZE;
-	*size += R7KHDRSIZE_CustomAttitude;
-	if (customattitude->bitfield & 1)
-		*size += customattitude->n * sizeof(float);
-	if (customattitude->bitfield & 2)
-		*size += customattitude->n * sizeof(float);
-	if (customattitude->bitfield & 4)
-		*size += customattitude->n * sizeof(float);
-	if (customattitude->bitfield & 8)
-		*size += customattitude->n * sizeof(float);
-	if (customattitude->bitfield & 16)
-		*size += customattitude->n * sizeof(float);
-	if (customattitude->bitfield & 32)
-		*size += customattitude->n * sizeof(float);
-	if (customattitude->bitfield & 64)
-		*size += customattitude->n * sizeof(float);
-	if (customattitude->bitfield & 128)
-		*size += customattitude->n * sizeof(float);
-
-	/* allocate memory to write rest of record if necessary */
-	if (*bufferalloc < *size)
-		{
-		status = mb_reallocd(verbose, __FILE__, __LINE__, *size,
-					(void **)bufferptr, error);
-		if (status != MB_SUCCESS)
-			{
-			*bufferalloc = 0;
-			}
-		else
-			{
-			*bufferalloc = *size;
-			}
-		}
-
-	/* proceed to write if buffer allocated */
-	if (status == MB_SUCCESS)
-		{
-		/* get buffer for writing */
-		buffer = (char *) *bufferptr;
-
-		/* insert the header */
-		index = 0;
-		status = mbr_reson7kr_wr_header(verbose, buffer, &index, header, error);
-
-		/* insert the data */
-		index = header->Offset + 4;
-		customattitude->bitfield = (mb_u_char) buffer[index]; index++;
-		customattitude->reserved = (mb_u_char) buffer[index]; index++;
-		mb_put_binary_short(MB_YES, customattitude->n, &buffer[index]); index += 2;
-		mb_put_binary_float(MB_YES, customattitude->frequency, &buffer[index]); index += 4;
-
-		if (customattitude->bitfield & 1)
-		for (i=0;i<customattitude->n;i++)
-			{
-			mb_put_binary_float(MB_YES, customattitude->pitch[i], &buffer[index]); index += 4;
-			}
-		if (customattitude->bitfield & 2)
-		for (i=0;i<customattitude->n;i++)
-			{
-			mb_put_binary_float(MB_YES, customattitude->roll[i], &buffer[index]); index += 4;
-			}
-		if (customattitude->bitfield & 4)
-		for (i=0;i<customattitude->n;i++)
-			{
-			mb_put_binary_float(MB_YES, customattitude->heading[i], &buffer[index]); index += 4;
-			}
-		if (customattitude->bitfield & 8)
-		for (i=0;i<customattitude->n;i++)
-			{
-			mb_put_binary_float(MB_YES, customattitude->heave[i], &buffer[index]); index += 4;
-			}
-		if (customattitude->bitfield & 16)
-		for (i=0;i<customattitude->n;i++)
-			{
-			mb_put_binary_float(MB_YES, customattitude->pitchrate[i], &buffer[index]); index += 4;
-			}
-		if (customattitude->bitfield & 32)
-		for (i=0;i<customattitude->n;i++)
-			{
-			mb_put_binary_float(MB_YES, customattitude->rollrate[i], &buffer[index]); index += 4;
-			}
-		if (customattitude->bitfield & 64)
-		for (i=0;i<customattitude->n;i++)
-			{
-			mb_put_binary_float(MB_YES, customattitude->headingrate[i], &buffer[index]); index += 4;
-			}
-		if (customattitude->bitfield & 128)
-		for (i=0;i<customattitude->n;i++)
-			{
-			mb_put_binary_float(MB_YES, customattitude->heaverate[i], &buffer[index]); index += 4;
-			}
-
-		/* reset the header size value */
-		mb_put_binary_int(MB_YES, ((unsigned int)(index + 4)), &buffer[8]);
-
-		/* now add the checksum */
-		checksum = 0;
-		for (i=0;i<index;i++)
-			checksum += (unsigned char) buffer[i];
-		mb_put_binary_int(MB_YES, checksum, &buffer[index]); index += 4;
-
-		/* check size */
-		if (*size != index)
-			{
-fprintf(stderr,"Bad size comparison: file:%s line:%d size:%d index:%d\n", __FILE__, __LINE__, *size, index);
-			status = MB_FAILURE;
-			*error = MB_ERROR_BAD_DATA;
-			*size = 0;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       bufferalloc:%d\n",*bufferalloc);
-		fprintf(stderr,"dbg2       size:       %d\n",*size);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_wr_tide(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error)
-{
-	char	*function_name = "mbr_reson7kr_wr_tide";
-	int	status = MB_SUCCESS;
-	struct mbsys_reson7k_struct *store;
-	s7k_header *header;
-	s7kr_tide *tide;
-	unsigned int checksum;
-	int	index;
-	char	*buffer;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       bufferalloc:%d\n",*bufferalloc);
-		fprintf(stderr,"dbg2       bufferptr:  %p\n",(void *)bufferptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	tide = &(store->tide);
-	header = &(tide->header);
-
-	/* print out the data to be output */
-#ifdef MBR_RESON7KR_DEBUG
-	if (verbose > 0)
-#else
-	if (verbose >= 2)
-#endif
-	mbsys_reson7k_print_tide(verbose, tide, error);
-
-	/* figure out size of output record */
-	*size = MBSYS_RESON7K_RECORDHEADER_SIZE + MBSYS_RESON7K_RECORDTAIL_SIZE;
-	*size += R7KHDRSIZE_Tide;
-
-	/* allocate memory to write rest of record if necessary */
-	if (*bufferalloc < *size)
-		{
-		status = mb_reallocd(verbose, __FILE__, __LINE__, *size,
-					(void **)bufferptr, error);
-		if (status != MB_SUCCESS)
-			{
-			*bufferalloc = 0;
-			}
-		else
-			{
-			*bufferalloc = *size;
-			}
-		}
-
-	/* proceed to write if buffer allocated */
-	if (status == MB_SUCCESS)
-		{
-		/* get buffer for writing */
-		buffer = (char *) *bufferptr;
-
-		/* insert the header */
-		index = 0;
-		status = mbr_reson7kr_wr_header(verbose, buffer, &index, header, error);
-
-		/* insert the data */
-		index = header->Offset + 4;
-		mb_put_binary_float(MB_YES, tide->tide, &buffer[index]); index += 4;
-		mb_put_binary_short(MB_YES, tide->source, &buffer[index]); index += 2;
-		buffer[index] = tide->flags; index++;
-		mb_get_binary_short(MB_YES, &buffer[index], &(tide->gauge)); index += 2;
-		mb_get_binary_int(MB_YES, &buffer[index], &(tide->datum)); index += 4;
-		mb_get_binary_float(MB_YES, &buffer[index], &(tide->latency)); index += 4;
-		mb_get_binary_double(MB_YES, &buffer[index], &(tide->latitude)); index += 8;
-		mb_get_binary_double(MB_YES, &buffer[index], &(tide->longitude)); index += 8;
-		mb_get_binary_double(MB_YES, &buffer[index], &(tide->height)); index += 8;
-		buffer[index] = tide->type; index++;
-		buffer[index] = tide->utm_zone; index++;
-
-		/* reset the header size value */
-		mb_put_binary_int(MB_YES, ((unsigned int)(index + 4)), &buffer[8]);
-
-		/* now add the checksum */
-		checksum = 0;
-		for (i=0;i<index;i++)
-			checksum += (unsigned char) buffer[i];
-		mb_put_binary_int(MB_YES, checksum, &buffer[index]); index += 4;
-
-		/* check size */
-		if (*size != index)
-			{
-fprintf(stderr,"Bad size comparison: file:%s line:%d size:%d index:%d\n", __FILE__, __LINE__, *size, index);
-			status = MB_FAILURE;
-			*error = MB_ERROR_BAD_DATA;
-			*size = 0;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       bufferalloc:%d\n",*bufferalloc);
-		fprintf(stderr,"dbg2       size:       %d\n",*size);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_wr_altitude(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error)
-{
-	char	*function_name = "mbr_reson7kr_wr_altitude";
-	int	status = MB_SUCCESS;
-	struct mbsys_reson7k_struct *store;
-	s7k_header *header;
-	s7kr_altitude *altitude;
-	unsigned int checksum;
-	int	index;
-	char	*buffer;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       bufferalloc:%d\n",*bufferalloc);
-		fprintf(stderr,"dbg2       bufferptr:  %p\n",(void *)bufferptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	altitude = &(store->altitude);
-	header = &(altitude->header);
-
-	/* print out the data to be output */
-#ifdef MBR_RESON7KR_DEBUG
-	if (verbose > 0)
-#else
-	if (verbose >= 2)
-#endif
-	mbsys_reson7k_print_altitude(verbose, altitude, error);
-
-	/* figure out size of output record */
-	*size = MBSYS_RESON7K_RECORDHEADER_SIZE + MBSYS_RESON7K_RECORDTAIL_SIZE;
-	*size += R7KHDRSIZE_Altitude;
-
-	/* allocate memory to write rest of record if necessary */
-	if (*bufferalloc < *size)
-		{
-		status = mb_reallocd(verbose, __FILE__, __LINE__, *size,
-					(void **)bufferptr, error);
-		if (status != MB_SUCCESS)
-			{
-			*bufferalloc = 0;
-			}
-		else
-			{
-			*bufferalloc = *size;
-			}
-		}
-
-	/* proceed to write if buffer allocated */
-	if (status == MB_SUCCESS)
-		{
-		/* get buffer for writing */
-		buffer = (char *) *bufferptr;
-
-		/* insert the header */
-		index = 0;
-		status = mbr_reson7kr_wr_header(verbose, buffer, &index, header, error);
-
-		/* insert the data */
-		index = header->Offset + 4;
-		mb_put_binary_float(MB_YES, altitude->altitude, &buffer[index]); index += 4;
-
-		/* reset the header size value */
-		mb_put_binary_int(MB_YES, ((unsigned int)(index + 4)), &buffer[8]);
-
-		/* now add the checksum */
-		checksum = 0;
-		for (i=0;i<index;i++)
-			checksum += (unsigned char) buffer[i];
-		mb_put_binary_int(MB_YES, checksum, &buffer[index]); index += 4;
-
-		/* check size */
-		if (*size != index)
-			{
-fprintf(stderr,"Bad size comparison: file:%s line:%d size:%d index:%d\n", __FILE__, __LINE__, *size, index);
-			status = MB_FAILURE;
-			*error = MB_ERROR_BAD_DATA;
-			*size = 0;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       bufferalloc:%d\n",*bufferalloc);
-		fprintf(stderr,"dbg2       size:       %d\n",*size);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_wr_motion(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error)
-{
-	char	*function_name = "mbr_reson7kr_wr_motion";
-	int	status = MB_SUCCESS;
-	struct mbsys_reson7k_struct *store;
-	s7k_header *header;
-	s7kr_motion *motion;
-	unsigned int checksum;
-	int	index;
-	char	*buffer;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       bufferalloc:%d\n",*bufferalloc);
-		fprintf(stderr,"dbg2       bufferptr:  %p\n",(void *)bufferptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	motion = &(store->motion);
-	header = &(motion->header);
-
-	/* print out the data to be output */
-#ifdef MBR_RESON7KR_DEBUG
-	if (verbose > 0)
-#else
-	if (verbose >= 2)
-#endif
-	mbsys_reson7k_print_motion(verbose, motion, error);
-
-	/* figure out size of output record */
-	*size = MBSYS_RESON7K_RECORDHEADER_SIZE + MBSYS_RESON7K_RECORDTAIL_SIZE;
-	*size += R7KHDRSIZE_MotionOverGround;
-	if (motion->bitfield & 1)
-		*size += 3 * motion->n * sizeof(float);
-	if (motion->bitfield & 2)
-		*size += 3 * motion->n * sizeof(float);
-
-	/* allocate memory to write rest of record if necessary */
-	if (*bufferalloc < *size)
-		{
-		status = mb_reallocd(verbose, __FILE__, __LINE__, *size,
-					(void **)bufferptr, error);
-		if (status != MB_SUCCESS)
-			{
-			*bufferalloc = 0;
-			}
-		else
-			{
-			*bufferalloc = *size;
-			}
-		}
-
-	/* proceed to write if buffer allocated */
-	if (status == MB_SUCCESS)
-		{
-		/* get buffer for writing */
-		buffer = (char *) *bufferptr;
-
-		/* insert the header */
-		index = 0;
-		status = mbr_reson7kr_wr_header(verbose, buffer, &index, header, error);
-
-		/* insert the data */
-		index = header->Offset + 4;
-		motion->bitfield = (mb_u_char) buffer[index]; index++;
-		motion->reserved = (mb_u_char) buffer[index]; index++;
-		mb_put_binary_short(MB_YES, motion->n, &buffer[index]); index += 2;
-		mb_put_binary_float(MB_YES, motion->frequency, &buffer[index]); index += 4;
-
-		if (motion->bitfield & 1)
-			{
-			for (i=0;i<motion->n;i++)
-				{
-				mb_put_binary_float(MB_YES, motion->x[i], &buffer[index]); index += 4;
-				}
-			for (i=0;i<motion->n;i++)
-				{
-				mb_put_binary_float(MB_YES, motion->y[i], &buffer[index]); index += 4;
-				}
-			for (i=0;i<motion->n;i++)
-				{
-				mb_put_binary_float(MB_YES, motion->z[i], &buffer[index]); index += 4;
-				}
-			}
-		if (motion->bitfield & 2)
-			{
-			for (i=0;i<motion->n;i++)
-				{
-				mb_put_binary_float(MB_YES, motion->xa[i], &buffer[index]); index += 4;
-				}
-			for (i=0;i<motion->n;i++)
-				{
-				mb_put_binary_float(MB_YES, motion->ya[i], &buffer[index]); index += 4;
-				}
-			for (i=0;i<motion->n;i++)
-				{
-				mb_put_binary_float(MB_YES, motion->za[i], &buffer[index]); index += 4;
-				}
-			}
-
-		/* reset the header size value */
-		mb_put_binary_int(MB_YES, ((unsigned int)(index + 4)), &buffer[8]);
-
-		/* now add the checksum */
-		checksum = 0;
-		for (i=0;i<index;i++)
-			checksum += (unsigned char) buffer[i];
-		mb_put_binary_int(MB_YES, checksum, &buffer[index]); index += 4;
-
-		/* check size */
-		if (*size != index)
-			{
-fprintf(stderr,"Bad size comparison: file:%s line:%d size:%d index:%d\n", __FILE__, __LINE__, *size, index);
-			status = MB_FAILURE;
-			*error = MB_ERROR_BAD_DATA;
-			*size = 0;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       bufferalloc:%d\n",*bufferalloc);
-		fprintf(stderr,"dbg2       size:       %d\n",*size);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_wr_depth(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error)
-{
-	char	*function_name = "mbr_reson7kr_wr_depth";
-	int	status = MB_SUCCESS;
-	struct mbsys_reson7k_struct *store;
-	s7k_header *header;
-	s7kr_depth *depth;
-	unsigned int checksum;
-	int	index;
-	char	*buffer;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       bufferalloc:%d\n",*bufferalloc);
-		fprintf(stderr,"dbg2       bufferptr:  %p\n",(void *)bufferptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	depth = &(store->depth);
-	header = &(depth->header);
-
-	/* print out the data to be output */
-#ifdef MBR_RESON7KR_DEBUG
-	if (verbose > 0)
-#else
-	if (verbose >= 2)
-#endif
-	mbsys_reson7k_print_depth(verbose, depth, error);
-
-	/* figure out size of output record */
-	*size = MBSYS_RESON7K_RECORDHEADER_SIZE + MBSYS_RESON7K_RECORDTAIL_SIZE;
-	*size += R7KHDRSIZE_Depth;
-
-	/* allocate memory to write rest of record if necessary */
-	if (*bufferalloc < *size)
-		{
-		status = mb_reallocd(verbose, __FILE__, __LINE__, *size,
-					(void **)bufferptr, error);
-		if (status != MB_SUCCESS)
-			{
-			*bufferalloc = 0;
-			}
-		else
-			{
-			*bufferalloc = *size;
-			}
-		}
-
-	/* proceed to write if buffer allocated */
-	if (status == MB_SUCCESS)
-		{
-		/* get buffer for writing */
-		buffer = (char *) *bufferptr;
-
-		/* insert the header */
-		index = 0;
-		status = mbr_reson7kr_wr_header(verbose, buffer, &index, header, error);
-
-		/* insert the data */
-		index = header->Offset + 4;
-		depth->descriptor = (mb_u_char) buffer[index]; index++;
-		depth->correction = (mb_u_char) buffer[index]; index++;
-		mb_put_binary_short(MB_YES, depth->reserved, &buffer[index]); index += 2;
-		mb_put_binary_float(MB_YES, depth->depth, &buffer[index]); index += 4;
-
-		/* reset the header size value */
-		mb_put_binary_int(MB_YES, ((unsigned int)(index + 4)), &buffer[8]);
-
-		/* now add the checksum */
-		checksum = 0;
-		for (i=0;i<index;i++)
-			checksum += (unsigned char) buffer[i];
-		mb_put_binary_int(MB_YES, checksum, &buffer[index]); index += 4;
-
-		/* check size */
-		if (*size != index)
-			{
-fprintf(stderr,"Bad size comparison: file:%s line:%d size:%d index:%d\n", __FILE__, __LINE__, *size, index);
-			status = MB_FAILURE;
-			*error = MB_ERROR_BAD_DATA;
-			*size = 0;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       bufferalloc:%d\n",*bufferalloc);
-		fprintf(stderr,"dbg2       size:       %d\n",*size);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_wr_svp(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error)
-{
-	char	*function_name = "mbr_reson7kr_wr_svp";
-	int	status = MB_SUCCESS;
-	struct mbsys_reson7k_struct *store;
-	s7k_header *header;
-	s7kr_svp *svp;
-	unsigned int checksum;
-	int	index;
-	char	*buffer;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       bufferalloc:%d\n",*bufferalloc);
-		fprintf(stderr,"dbg2       bufferptr:  %p\n",(void *)bufferptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	svp = &(store->svp);
-	header = &(svp->header);
-
-	/* print out the data to be output */
-#ifdef MBR_RESON7KR_DEBUG
-	if (verbose > 0)
-#else
-	if (verbose >= 2)
-#endif
-	mbsys_reson7k_print_svp(verbose, svp, error);
-
-	/* figure out size of output record */
-	*size = MBSYS_RESON7K_RECORDHEADER_SIZE + MBSYS_RESON7K_RECORDTAIL_SIZE;
-	*size += R7KHDRSIZE_SoundVelocityProfile;
-	*size += R7KRDTSIZE_SoundVelocityProfile * svp->n;
-
-	/* allocate memory to write rest of record if necessary */
-	if (*bufferalloc < *size)
-		{
-		status = mb_reallocd(verbose, __FILE__, __LINE__, *size,
-					(void **)bufferptr, error);
-		if (status != MB_SUCCESS)
-			{
-			*bufferalloc = 0;
-			}
-		else
-			{
-			*bufferalloc = *size;
-			}
-		}
-
-	/* proceed to write if buffer allocated */
-	if (status == MB_SUCCESS)
-		{
-		/* get buffer for writing */
-		buffer = (char *) *bufferptr;
-
-		/* insert the header */
-		index = 0;
-		status = mbr_reson7kr_wr_header(verbose, buffer, &index, header, error);
-
-		/* insert the data */
-		index = header->Offset + 4;
-		svp->position_flag = (mb_u_char) buffer[index]; index++;
-		svp->reserved1 = (mb_u_char) buffer[index]; index++;
-		mb_put_binary_short(MB_YES, svp->reserved2, &buffer[index]); index += 2;
-		mb_put_binary_double(MB_YES, svp->latitude, &buffer[index]); index += 8;
-		mb_put_binary_double(MB_YES, svp->longitude, &buffer[index]); index += 8;
-		mb_put_binary_int(MB_YES, svp->n, &buffer[index]); index += 4;
-
-		for (i=0;i<svp->n;i++)
-			{
-			mb_put_binary_float(MB_YES, svp->depth[i], &buffer[index]); index += 4;
-			mb_put_binary_float(MB_YES, svp->sound_velocity[i], &buffer[index]); index += 4;
-			}
-
-		/* reset the header size value */
-		mb_put_binary_int(MB_YES, ((unsigned int)(index + 4)), &buffer[8]);
-
-		/* now add the checksum */
-		checksum = 0;
-		for (i=0;i<index;i++)
-			checksum += (unsigned char) buffer[i];
-		mb_put_binary_int(MB_YES, checksum, &buffer[index]); index += 4;
-
-		/* check size */
-		if (*size != index)
-			{
-fprintf(stderr,"Bad size comparison: file:%s line:%d size:%d index:%d\n", __FILE__, __LINE__, *size, index);
-			status = MB_FAILURE;
-			*error = MB_ERROR_BAD_DATA;
-			*size = 0;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       bufferalloc:%d\n",*bufferalloc);
-		fprintf(stderr,"dbg2       size:       %d\n",*size);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_wr_ctd(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error)
-{
-	char	*function_name = "mbr_reson7kr_wr_ctd";
-	int	status = MB_SUCCESS;
-	struct mbsys_reson7k_struct *store;
-	s7k_header *header;
-	s7kr_ctd *ctd;
-	unsigned int checksum;
-	int	index;
-	char	*buffer;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       bufferalloc:%d\n",*bufferalloc);
-		fprintf(stderr,"dbg2       bufferptr:  %p\n",(void *)bufferptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	ctd = &(store->ctd);
-	header = &(ctd->header);
-
-	/* print out the data to be output */
-#ifdef MBR_RESON7KR_DEBUG
-	if (verbose > 0)
-#else
-	if (verbose >= 2)
-#endif
-	mbsys_reson7k_print_ctd(verbose, ctd, error);
-
-	/* figure out size of output record */
-	*size = MBSYS_RESON7K_RECORDHEADER_SIZE + MBSYS_RESON7K_RECORDTAIL_SIZE;
-	*size += R7KHDRSIZE_CTD;
-	*size += ctd->n * R7KRDTSIZE_CTD;
-
-	/* allocate memory to write rest of record if necessary */
-	if (*bufferalloc < *size)
-		{
-		status = mb_reallocd(verbose, __FILE__, __LINE__, *size,
-					(void **)bufferptr, error);
-		if (status != MB_SUCCESS)
-			{
-			*bufferalloc = 0;
-			}
-		else
-			{
-			*bufferalloc = *size;
-			}
-		}
-
-	/* proceed to write if buffer allocated */
-	if (status == MB_SUCCESS)
-		{
-		/* get buffer for writing */
-		buffer = (char *) *bufferptr;
-
-		/* insert the header */
-		index = 0;
-		status = mbr_reson7kr_wr_header(verbose, buffer, &index, header, error);
-
-		/* insert the data */
-		index = header->Offset + 4;
-		mb_put_binary_float(MB_YES, ctd->frequency, &buffer[index]); index += 4;
-		buffer[index] = ctd->velocity_source_flag; index++;
-		buffer[index] = ctd->velocity_algorithm; index++;
-		buffer[index] = ctd->conductivity_flag; index++;
-		buffer[index] = ctd->pressure_flag; index++;
-		buffer[index] = ctd->position_flag; index++;
-		buffer[index] = ctd->validity; index++;
-		mb_put_binary_short(MB_YES, ctd->reserved, &buffer[index]); index += 2;
-		mb_put_binary_double(MB_YES, ctd->latitude, &buffer[index]); index += 8;
-		mb_put_binary_double(MB_YES, ctd->longitude, &buffer[index]); index += 8;
-		mb_put_binary_float(MB_YES, ctd->sample_rate, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, ctd->n, &buffer[index]); index += 4;
-
-		for (i=0;i<ctd->n;i++)
-			{
-			mb_put_binary_float(MB_YES, ctd->conductivity_salinity[i], &buffer[index]); index += 4;
-			mb_put_binary_float(MB_YES, ctd->temperature[i], &buffer[index]); index += 4;
-			mb_put_binary_float(MB_YES, ctd->pressure_depth[i], &buffer[index]); index += 4;
-			mb_put_binary_float(MB_YES, ctd->sound_velocity[i], &buffer[index]); index += 4;
-			mb_put_binary_float(MB_YES, ctd->absorption[i], &buffer[index]); index += 4;
-			}
-
-		/* reset the header size value */
-		mb_put_binary_int(MB_YES, ((unsigned int)(index + 4)), &buffer[8]);
-
-		/* now add the checksum */
-		checksum = 0;
-		for (i=0;i<index;i++)
-			checksum += (unsigned char) buffer[i];
-		mb_put_binary_int(MB_YES, checksum, &buffer[index]); index += 4;
-
-		/* check size */
-		if (*size != index)
-			{
-fprintf(stderr,"Bad size comparison: file:%s line:%d size:%d index:%d\n", __FILE__, __LINE__, *size, index);
-			status = MB_FAILURE;
-			*error = MB_ERROR_BAD_DATA;
-			*size = 0;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       bufferalloc:%d\n",*bufferalloc);
-		fprintf(stderr,"dbg2       size:       %d\n",*size);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_wr_geodesy(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error)
-{
-	char	*function_name = "mbr_reson7kr_wr_geodesy";
-	int	status = MB_SUCCESS;
-	struct mbsys_reson7k_struct *store;
-	s7k_header *header;
-	s7kr_geodesy *geodesy;
-	unsigned int checksum;
-	int	index;
-	char	*buffer;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       bufferalloc:%d\n",*bufferalloc);
-		fprintf(stderr,"dbg2       bufferptr:  %p\n",(void *)bufferptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	geodesy = &(store->geodesy);
-	header = &(geodesy->header);
-
-	/* print out the data to be output */
-#ifdef MBR_RESON7KR_DEBUG
-	if (verbose > 0)
-#else
-	if (verbose >= 2)
-#endif
-	mbsys_reson7k_print_geodesy(verbose, geodesy, error);
-
-	/* figure out size of output record */
-	*size = MBSYS_RESON7K_RECORDHEADER_SIZE + MBSYS_RESON7K_RECORDTAIL_SIZE;
-	*size += R7KHDRSIZE_Geodesy;
-
-	/* allocate memory to write rest of record if necessary */
-	if (*bufferalloc < *size)
-		{
-		status = mb_reallocd(verbose, __FILE__, __LINE__, *size,
-					(void **)bufferptr, error);
-		if (status != MB_SUCCESS)
-			{
-			*bufferalloc = 0;
-			}
-		else
-			{
-			*bufferalloc = *size;
-			}
-		}
-
-	/* proceed to write if buffer allocated */
-	if (status == MB_SUCCESS)
-		{
-		/* get buffer for writing */
-		buffer = (char *) *bufferptr;
-
-		/* insert the header */
-		index = 0;
-		status = mbr_reson7kr_wr_header(verbose, buffer, &index, header, error);
-
-		/* insert the data */
-		index = header->Offset + 4;
-		for (i=0;i<32;i++)
-			{
-			geodesy->spheroid[i] = (mb_u_char) buffer[index]; index++;
-			}
-		mb_put_binary_double(MB_YES, geodesy->semimajoraxis, &buffer[index]); index += 8;
-		mb_put_binary_double(MB_YES, geodesy->flattening, &buffer[index]); index += 8;
-		for (i=0;i<16;i++)
-			{
-			geodesy->reserved1[i] = (mb_u_char) buffer[index]; index++;
-			}
-		for (i=0;i<32;i++)
-			{
-			geodesy->datum[i] = (mb_u_char) buffer[index]; index++;
-			}
-		mb_put_binary_int(MB_YES, geodesy->calculation_method, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, geodesy->number_parameters, &buffer[index]); index += 4;
-		mb_put_binary_double(MB_YES, geodesy->dx, &buffer[index]); index += 8;
-		mb_put_binary_double(MB_YES, geodesy->dy, &buffer[index]); index += 8;
-		mb_put_binary_double(MB_YES, geodesy->dz, &buffer[index]); index += 8;
-		mb_put_binary_double(MB_YES, geodesy->rx, &buffer[index]); index += 8;
-		mb_put_binary_double(MB_YES, geodesy->ry, &buffer[index]); index += 8;
-		mb_put_binary_double(MB_YES, geodesy->rz, &buffer[index]); index += 8;
-		mb_put_binary_double(MB_YES, geodesy->scale, &buffer[index]); index += 8;
-		for (i=0;i<35;i++)
-			{
-			geodesy->reserved2[i] = (mb_u_char) buffer[index]; index++;
-			}
-		for (i=0;i<32;i++)
-			{
-			geodesy->grid_name[i] = (mb_u_char) buffer[index]; index++;
-			}
-		geodesy->distance_units = (mb_u_char) buffer[index]; index++;
-		geodesy->angular_units = (mb_u_char) buffer[index]; index++;
-		mb_put_binary_double(MB_YES, geodesy->latitude_origin, &buffer[index]); index += 8;
-		mb_put_binary_double(MB_YES, geodesy->central_meriidan, &buffer[index]); index += 8;
-		mb_put_binary_double(MB_YES, geodesy->false_easting, &buffer[index]); index += 8;
-		mb_put_binary_double(MB_YES, geodesy->false_northing, &buffer[index]); index += 8;
-		mb_put_binary_double(MB_YES, geodesy->central_scale_factor, &buffer[index]); index += 8;
-		mb_put_binary_int(MB_YES, geodesy->custum_identifier, &buffer[index]); index += 4;
-		for (i=0;i<50;i++)
-			{
-			geodesy->reserved3[i] = (mb_u_char) buffer[index]; index++;
-			}
-
-		/* reset the header size value */
-		mb_put_binary_int(MB_YES, ((unsigned int)(index + 4)), &buffer[8]);
-
-		/* now add the checksum */
-		checksum = 0;
-		for (i=0;i<index;i++)
-			checksum += (unsigned char) buffer[i];
-		mb_put_binary_int(MB_YES, checksum, &buffer[index]); index += 4;
-
-		/* check size */
-		if (*size != index)
-			{
-fprintf(stderr,"Bad size comparison: file:%s line:%d size:%d index:%d\n", __FILE__, __LINE__, *size, index);
-			status = MB_FAILURE;
-			*error = MB_ERROR_BAD_DATA;
-			*size = 0;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_wr_rollpitchheave(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error)
-{
-	char	*function_name = "mbr_reson7kr_wr_rollpitchheave";
-	int	status = MB_SUCCESS;
-	struct mbsys_reson7k_struct *store;
-	s7k_header *header;
-	s7kr_rollpitchheave *rollpitchheave;
-	unsigned int checksum;
-	int	index;
-	char	*buffer;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       bufferalloc:%d\n",*bufferalloc);
-		fprintf(stderr,"dbg2       bufferptr:  %p\n",(void *)bufferptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	rollpitchheave = &(store->rollpitchheave);
-	header = &(rollpitchheave->header);
-
-	/* print out the data to be output */
-#ifdef MBR_RESON7KR_DEBUG
-	if (verbose > 0)
-#else
-	if (verbose >= 2)
-#endif
-	mbsys_reson7k_print_rollpitchheave(verbose, rollpitchheave, error);
-
-	/* figure out size of output record */
-	*size = MBSYS_RESON7K_RECORDHEADER_SIZE + MBSYS_RESON7K_RECORDTAIL_SIZE;
-	*size += R7KHDRSIZE_RollPitchHeave;
-
-	/* allocate memory to write rest of record if necessary */
-	if (*bufferalloc < *size)
-		{
-		status = mb_reallocd(verbose, __FILE__, __LINE__, *size,
-					(void **)bufferptr, error);
-		if (status != MB_SUCCESS)
-			{
-			*bufferalloc = 0;
-			}
-		else
-			{
-			*bufferalloc = *size;
-			}
-		}
-
-	/* proceed to write if buffer allocated */
-	if (status == MB_SUCCESS)
-		{
-		/* get buffer for writing */
-		buffer = (char *) *bufferptr;
-
-		/* insert the header */
-		index = 0;
-		status = mbr_reson7kr_wr_header(verbose, buffer, &index, header, error);
-
-		/* insert the data */
-		index = header->Offset + 4;
-		mb_put_binary_float(MB_YES, rollpitchheave->roll, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, rollpitchheave->pitch, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, rollpitchheave->heave, &buffer[index]); index += 4;
-
-		/* reset the header size value */
-		mb_put_binary_int(MB_YES, ((unsigned int)(index + 4)), &buffer[8]);
-
-		/* now add the checksum */
-		checksum = 0;
-		for (i=0;i<index;i++)
-			checksum += (unsigned char) buffer[i];
-		mb_put_binary_int(MB_YES, checksum, &buffer[index]); index += 4;
-
-		/* check size */
-		if (*size != index)
-			{
-fprintf(stderr,"Bad size comparison: file:%s line:%d size:%d index:%d\n", __FILE__, __LINE__, *size, index);
-			status = MB_FAILURE;
-			*error = MB_ERROR_BAD_DATA;
-			*size = 0;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_wr_heading(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error)
-{
-	char	*function_name = "mbr_reson7kr_wr_heading";
-	int	status = MB_SUCCESS;
-	struct mbsys_reson7k_struct *store;
-	s7k_header *header;
-	s7kr_heading *heading;
-	unsigned int checksum;
-	int	index;
-	char	*buffer;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       bufferalloc:%d\n",*bufferalloc);
-		fprintf(stderr,"dbg2       bufferptr:  %p\n",(void *)bufferptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	heading = &(store->heading);
-	header = &(heading->header);
-
-	/* print out the data to be output */
-#ifdef MBR_RESON7KR_DEBUG
-	if (verbose > 0)
-#else
-	if (verbose >= 2)
-#endif
-	mbsys_reson7k_print_heading(verbose, heading, error);
-
-	/* figure out size of output record */
-	*size = MBSYS_RESON7K_RECORDHEADER_SIZE + MBSYS_RESON7K_RECORDTAIL_SIZE;
-	*size += R7KHDRSIZE_Heading;
-
-	/* allocate memory to write rest of record if necessary */
-	if (*bufferalloc < *size)
-		{
-		status = mb_reallocd(verbose, __FILE__, __LINE__, *size,
-					(void **)bufferptr, error);
-		if (status != MB_SUCCESS)
-			{
-			*bufferalloc = 0;
-			}
-		else
-			{
-			*bufferalloc = *size;
-			}
-		}
-
-	/* proceed to write if buffer allocated */
-	if (status == MB_SUCCESS)
-		{
-		/* get buffer for writing */
-		buffer = (char *) *bufferptr;
-
-		/* insert the header */
-		index = 0;
-		status = mbr_reson7kr_wr_header(verbose, buffer, &index, header, error);
-
-		/* insert the data */
-		index = header->Offset + 4;
-		mb_put_binary_float(MB_YES, heading->heading, &buffer[index]); index += 4;
-
-		/* reset the header size value */
-		mb_put_binary_int(MB_YES, ((unsigned int)(index + 4)), &buffer[8]);
-
-		/* now add the checksum */
-		checksum = 0;
-		for (i=0;i<index;i++)
-			checksum += (unsigned char) buffer[i];
-		mb_put_binary_int(MB_YES, checksum, &buffer[index]); index += 4;
-
-		/* check size */
-		if (*size != index)
-			{
-fprintf(stderr,"Bad size comparison: file:%s line:%d size:%d index:%d\n", __FILE__, __LINE__, *size, index);
-			status = MB_FAILURE;
-			*error = MB_ERROR_BAD_DATA;
-			*size = 0;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_wr_surveyline(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error)
-{
-	char	*function_name = "mbr_reson7kr_wr_surveyline";
-	int	status = MB_SUCCESS;
-	struct mbsys_reson7k_struct *store;
-	s7k_header *header;
-	s7kr_surveyline *surveyline;
-	unsigned int checksum;
-	int	index;
-	char	*buffer;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       bufferalloc:%d\n",*bufferalloc);
-		fprintf(stderr,"dbg2       bufferptr:  %p\n",(void *)bufferptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	surveyline = &(store->surveyline);
-	header = &(surveyline->header);
-
-	/* print out the data to be output */
-#ifdef MBR_RESON7KR_DEBUG
-	if (verbose > 0)
-#else
-	if (verbose >= 2)
-#endif
-	mbsys_reson7k_print_surveyline(verbose, surveyline, error);
-
-	/* figure out size of output record */
-	*size = MBSYS_RESON7K_RECORDHEADER_SIZE + MBSYS_RESON7K_RECORDTAIL_SIZE;
-	*size += R7KHDRSIZE_SurveyLine;
-	*size += surveyline->n * R7KRDTSIZE_SurveyLine;
-
-	/* allocate memory to write rest of record if necessary */
-	if (*bufferalloc < *size)
-		{
-		status = mb_reallocd(verbose, __FILE__, __LINE__, *size,
-					(void **)bufferptr, error);
-		if (status != MB_SUCCESS)
-			{
-			*bufferalloc = 0;
-			}
-		else
-			{
-			*bufferalloc = *size;
-			}
-		}
-
-	/* proceed to write if buffer allocated */
-	if (status == MB_SUCCESS)
-		{
-		/* get buffer for writing */
-		buffer = (char *) *bufferptr;
-
-		/* insert the header */
-		index = 0;
-		status = mbr_reson7kr_wr_header(verbose, buffer, &index, header, error);
-
-		/* insert the data */
-		index = header->Offset + 4;
-		mb_put_binary_short(MB_YES, surveyline->n, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, surveyline->type, &buffer[index]); index += 2;
-		mb_put_binary_float(MB_YES, surveyline->turnradius, &buffer[index]); index += 4;
-		for (i=0;i<64;i++)
-			{
-			buffer[index] = (char) surveyline->name[i]; index++;
-			}
-		for (i=0;i<surveyline->n;i++)
-			{
-			mb_put_binary_double(MB_YES, surveyline->latitude[i], &buffer[index]); index += 8;
-			mb_put_binary_double(MB_YES, surveyline->longitude[i], &buffer[index]); index += 8;
-			}
-
-		/* reset the header size value */
-		mb_put_binary_int(MB_YES, ((unsigned int)(index + 4)), &buffer[8]);
-
-		/* now add the checksum */
-		checksum = 0;
-		for (i=0;i<index;i++)
-			checksum += (unsigned char) buffer[i];
-		mb_put_binary_int(MB_YES, checksum, &buffer[index]); index += 4;
-
-		/* check size */
-		if (*size != index)
-			{
-fprintf(stderr,"Bad size comparison: file:%s line:%d size:%d index:%d\n", __FILE__, __LINE__, *size, index);
-			status = MB_FAILURE;
-			*error = MB_ERROR_BAD_DATA;
-			*size = 0;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_wr_navigation(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error)
-{
-	char	*function_name = "mbr_reson7kr_wr_navigation";
-	int	status = MB_SUCCESS;
-	struct mbsys_reson7k_struct *store;
-	s7k_header *header;
-	s7kr_navigation *navigation;
-	unsigned int checksum;
-	int	index;
-	char	*buffer;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       bufferalloc:%d\n",*bufferalloc);
-		fprintf(stderr,"dbg2       bufferptr:  %p\n",(void *)bufferptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	navigation = &(store->navigation);
-	header = &(navigation->header);
-
-	/* print out the data to be output */
-#ifdef MBR_RESON7KR_DEBUG
-	if (verbose > 0)
-#else
-	if (verbose >= 2)
-#endif
-	mbsys_reson7k_print_navigation(verbose, navigation, error);
-
-	/* figure out size of output record */
-	*size = MBSYS_RESON7K_RECORDHEADER_SIZE + MBSYS_RESON7K_RECORDTAIL_SIZE;
-	*size += R7KHDRSIZE_Navigation;
-
-	/* allocate memory to write rest of record if necessary */
-	if (*bufferalloc < *size)
-		{
-		status = mb_reallocd(verbose, __FILE__, __LINE__, *size,
-					(void **)bufferptr, error);
-		if (status != MB_SUCCESS)
-			{
-			*bufferalloc = 0;
-			}
-		else
-			{
-			*bufferalloc = *size;
-			}
-		}
-
-	/* proceed to write if buffer allocated */
-	if (status == MB_SUCCESS)
-		{
-		/* get buffer for writing */
-		buffer = (char *) *bufferptr;
-
-		/* insert the header */
-		index = 0;
-		status = mbr_reson7kr_wr_header(verbose, buffer, &index, header, error);
-
-		/* insert the data */
-		index = header->Offset + 4;
-		buffer[index] = (mb_u_char) navigation->vertical_reference; index++;
-		mb_put_binary_double(MB_YES, navigation->latitude, &buffer[index]); index += 8;
-		mb_put_binary_double(MB_YES, navigation->longitude, &buffer[index]); index += 8;
-		mb_put_binary_float(MB_YES, navigation->position_accuracy, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, navigation->height, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, navigation->height_accuracy, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, navigation->speed, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, navigation->course, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, navigation->heading, &buffer[index]); index += 4;
-
-		/* reset the header size value */
-		mb_put_binary_int(MB_YES, ((unsigned int)(index + 4)), &buffer[8]);
-
-		/* now add the checksum */
-		checksum = 0;
-		for (i=0;i<index;i++)
-			checksum += (unsigned char) buffer[i];
-		mb_put_binary_int(MB_YES, checksum, &buffer[index]); index += 4;
-
-		/* check size */
-		if (*size != index)
-			{
-fprintf(stderr,"Bad size comparison: file:%s line:%d size:%d index:%d\n", __FILE__, __LINE__, *size, index);
-			status = MB_FAILURE;
-			*error = MB_ERROR_BAD_DATA;
-			*size = 0;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_wr_attitude(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error)
-{
-	char	*function_name = "mbr_reson7kr_wr_attitude";
-	int	status = MB_SUCCESS;
-	struct mbsys_reson7k_struct *store;
-	s7k_header *header;
-	s7kr_attitude *attitude;
-	unsigned int checksum;
-	int	index;
-	char	*buffer;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       bufferalloc:%d\n",*bufferalloc);
-		fprintf(stderr,"dbg2       bufferptr:  %p\n",(void *)bufferptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	attitude = &(store->attitude);
-	header = &(attitude->header);
-
-	/* print out the data to be output */
-#ifdef MBR_RESON7KR_DEBUG
-	if (verbose > 0)
-#else
-	if (verbose >= 2)
-#endif
-	mbsys_reson7k_print_attitude(verbose, attitude, error);
-
-	/* figure out size of output record */
-	*size = MBSYS_RESON7K_RECORDHEADER_SIZE + MBSYS_RESON7K_RECORDTAIL_SIZE;
-	*size += R7KHDRSIZE_Attitude;
-	*size += attitude->n * R7KRDTSIZE_Attitude;
-
-	/* allocate memory to write rest of record if necessary */
-	if (*bufferalloc < *size)
-		{
-		status = mb_reallocd(verbose, __FILE__, __LINE__, *size,
-					(void **)bufferptr, error);
-		if (status != MB_SUCCESS)
-			{
-			*bufferalloc = 0;
-			}
-		else
-			{
-			*bufferalloc = *size;
-			}
-		}
-
-	/* proceed to write if buffer allocated */
-	if (status == MB_SUCCESS)
-		{
-		/* get buffer for writing */
-		buffer = (char *) *bufferptr;
-
-		/* insert the header */
-		index = 0;
-		status = mbr_reson7kr_wr_header(verbose, buffer, &index, header, error);
-
-		/* insert the data */
-		index = header->Offset + 4;
-		buffer[index] = attitude->n; index++;
-		for (i=0;i<attitude->n;i++)
-			{
-			mb_put_binary_short(MB_YES, attitude->delta_time[i], &buffer[index]); index += 2;
-			mb_put_binary_float(MB_YES, attitude->roll[i], &buffer[index]); index += 4;
-			mb_put_binary_float(MB_YES, attitude->pitch[i], &buffer[index]); index += 4;
-			mb_put_binary_float(MB_YES, attitude->heave[i], &buffer[index]); index += 4;
-			mb_put_binary_float(MB_YES, attitude->heading[i], &buffer[index]); index += 4;
-			}
-
-		/* reset the header size value */
-		mb_put_binary_int(MB_YES, ((unsigned int)(index + 4)), &buffer[8]);
-
-		/* now add the checksum */
-		checksum = 0;
-		for (i=0;i<index;i++)
-			checksum += (unsigned char) buffer[i];
-		mb_put_binary_int(MB_YES, checksum, &buffer[index]); index += 4;
-
-		/* check size */
-		if (*size != index)
-			{
-fprintf(stderr,"Bad size comparison: file:%s line:%d size:%d index:%d\n", __FILE__, __LINE__, *size, index);
-			status = MB_FAILURE;
-			*error = MB_ERROR_BAD_DATA;
-			*size = 0;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_wr_rec1022(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error)
-{
-	char	*function_name = "mbr_reson7kr_wr_rec1022";
-	int	status = MB_SUCCESS;
-	struct mbsys_reson7k_struct *store;
-	s7k_header *header;
-	s7kr_rec1022 *rec1022;
-	unsigned int checksum;
-	int	index;
-	char	*buffer;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       bufferalloc:%d\n",*bufferalloc);
-		fprintf(stderr,"dbg2       bufferptr:  %p\n",(void *)bufferptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	rec1022 = &(store->rec1022);
-	header = &(rec1022->header);
-
-	/* print out the data to be output */
-#ifdef MBR_RESON7KR_DEBUG
-	if (verbose > 0)
-#else
-	if (verbose >= 2)
-#endif
-	mbsys_reson7k_print_rec1022(verbose, rec1022, error);
-
-	/* figure out size of output record */
-	*size = MBSYS_RESON7K_RECORDHEADER_SIZE + MBSYS_RESON7K_RECORDTAIL_SIZE;
-	*size += R7KHDRSIZE_Rec1022;
-
-	/* allocate memory to write rest of record if necessary */
-	if (*bufferalloc < *size)
-		{
-		status = mb_reallocd(verbose, __FILE__, __LINE__, *size,
-					(void **)bufferptr, error);
-		if (status != MB_SUCCESS)
-			{
-			*bufferalloc = 0;
-			}
-		else
-			{
-			*bufferalloc = *size;
-			}
-		}
-
-	/* proceed to write if buffer allocated */
-	if (status == MB_SUCCESS)
-		{
-		/* get buffer for writing */
-		buffer = (char *) *bufferptr;
-
-		/* insert the header */
-		index = 0;
-		status = mbr_reson7kr_wr_header(verbose, buffer, &index, header, error);
-
-		/* insert the data */
-		index = header->Offset + 4;
-		for (i=0;i<R7KHDRSIZE_Rec1022;i++)
-			{
-			buffer[index] = rec1022->data[i]; index++;
-			}
-
-		/* reset the header size value */
-		mb_put_binary_int(MB_YES, ((unsigned int)(index + 4)), &buffer[8]);
-
-		/* now add the checksum */
-		checksum = 0;
-		for (i=0;i<index;i++)
-			checksum += (unsigned char) buffer[i];
-		mb_put_binary_int(MB_YES, checksum, &buffer[index]); index += 4;
-
-		/* check size */
-		if (*size != index)
-			{
-fprintf(stderr,"Bad size comparison: file:%s line:%d size:%d index:%d\n", __FILE__, __LINE__, *size, index);
-			status = MB_FAILURE;
-			*error = MB_ERROR_BAD_DATA;
-			*size = 0;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_wr_fsdwchannel(int verbose, int data_format, char *buffer, int *index,
-		s7k_fsdwchannel *fsdwchannel, int *error)
-{
-	char	*function_name = "mbr_reson7kr_wr_fsdwchannel";
-	int	status = MB_SUCCESS;
-	short	*shortptr;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       data_format:%d\n",data_format);
-		fprintf(stderr,"dbg2       index:      %d\n",*index);
-		fprintf(stderr,"dbg2       fsdwchannel:%p\n",(void *)fsdwchannel);
-		}
-
-	/* print out the data to be output */
-	/*mbsys_reson7k_print_fsdwchannel(verbose, data_format, fsdwchannel, error);*/
-
-	/* extract the channel header */
-	buffer[*index] = fsdwchannel->number; (*index)++;
-	buffer[*index] = fsdwchannel->type; (*index)++;
-	buffer[*index] = fsdwchannel->data_type; (*index)++;
-	buffer[*index] = fsdwchannel->polarity; (*index)++;
-	buffer[*index] = fsdwchannel->bytespersample; (*index)++;
-	for (i=0;i<3;i++)
-		{
-		buffer[*index] = fsdwchannel->reserved1[i]; (*index)++;
-		}
-	mb_put_binary_int(MB_YES, fsdwchannel->number_samples, &buffer[*index]); *index += 4;
-	mb_put_binary_int(MB_YES, fsdwchannel->start_time, &buffer[*index]); *index += 4;
-	mb_put_binary_int(MB_YES, fsdwchannel->sample_interval, &buffer[*index]); *index += 4;
-	mb_put_binary_float(MB_YES, fsdwchannel->range, &buffer[*index]); *index += 4;
-	mb_put_binary_float(MB_YES, fsdwchannel->voltage, &buffer[*index]); *index += 4;
-	for (i=0;i<16;i++)
-		{
-		buffer[*index] = fsdwchannel->name[i]; (*index)++;
-		}
-	for (i=0;i<20;i++)
-		{
-		buffer[*index] = fsdwchannel->reserved2[i]; (*index)++;
-		}
-
-	/* copy over the data */
-	if (status == MB_SUCCESS)
-		{
-		if (fsdwchannel->bytespersample == 1)
-			{
-			for (i=0;i<fsdwchannel->number_samples;i++)
-				{
-				buffer[*index] = fsdwchannel->data[i]; (*index)++;
-				}
-			}
-		else if (fsdwchannel->bytespersample == 2)
-			{
-			shortptr = (short *) fsdwchannel->data;
-			for (i=0;i<fsdwchannel->number_samples;i++)
-				{
-/*srptr = (short *) &(buffer[*index]);
-urptr = (unsigned short *) &(buffer[*index]);*/
-				mb_put_binary_short(MB_YES, shortptr[i], &buffer[*index]); *index += 2;
-/*ssptr = (short *) &(shortptr[i]);
-usptr = (unsigned short *) &(shortptr[i]);
-fprintf(stderr,"sample:%5d   raw:%6d %6d   swapped:%6d %6d\n",
-i,*srptr,*urptr,*ssptr,*usptr);*/
-				}
-			}
-		else if (fsdwchannel->bytespersample == 4)
-			{
-			shortptr = (short *) fsdwchannel->data;
-			for (i=0;i<fsdwchannel->number_samples;i++)
-				{
-/*srptr = (short *) &(buffer[*index]);
-urptr = (unsigned short *) &(buffer[*index]);*/
-				mb_put_binary_short(MB_YES, shortptr[2*i], &buffer[*index]); *index += 2;
-/*ssptr = (short *) &(shortptr[2*i]);
-usptr = (unsigned short *) &(shortptr[2*i]);
-fprintf(stderr,"sample:%5d   IMAGINARY: raw:%6d %6d   swapped:%6d %6d",
-i,*srptr,*urptr,*ssptr,*usptr);
-srptr = (short *) &(buffer[*index]);
-urptr = (unsigned short *) &(buffer[*index]);*/
-				mb_put_binary_short(MB_YES, shortptr[2*i+1], &buffer[*index]); *index += 2;
-/*ssptr = (short *) &(shortptr[2*i+1]);
-usptr = (unsigned short *) &(shortptr[2*i+1]);
-fprintf(stderr,"    REAL: raw:%6d %6d   swapped:%6d %6d\n",
-*srptr,*urptr,*ssptr,*usptr);*/
-				}
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       index:      %d\n",*index);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_wr_fsdwssheader(int verbose, char *buffer, int *index,
-		s7k_fsdwssheader *fsdwssheader, int *error)
-{
-	char	*function_name = "mbr_reson7kr_wr_fsdwssheader";
-	int	status = MB_SUCCESS;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:        %d\n",verbose);
-		fprintf(stderr,"dbg2       buffer:         %p\n",(void *)buffer);
-		fprintf(stderr,"dbg2       index:          %d\n",*index);
-		fprintf(stderr,"dbg2       fsdwssheader:   %p\n",(void *)fsdwssheader);
-		}
-
-	/* print out the data to be output */
-	/*mbsys_reson7k_print_fsdwssheader(verbose, fsdwssheader, error);*/
-
-	/* extract the Edgetech sidescan header */
-	mb_put_binary_short(MB_YES, fsdwssheader->subsystem, &buffer[*index]); *index += 2;
-	mb_put_binary_short(MB_YES, fsdwssheader->channelNum, &buffer[*index]); *index += 2;
-	mb_put_binary_int(MB_YES, fsdwssheader->pingNum, &buffer[*index]); *index += 4;
-	mb_put_binary_short(MB_YES, fsdwssheader->packetNum, &buffer[*index]); *index += 2;
-	mb_put_binary_short(MB_YES, fsdwssheader->trigSource, &buffer[*index]); *index += 2;
-	mb_put_binary_int(MB_YES, fsdwssheader->samples, &buffer[*index]); *index += 4;
-	mb_put_binary_int(MB_YES, fsdwssheader->sampleInterval, &buffer[*index]); *index += 4;
-	mb_put_binary_int(MB_YES, fsdwssheader->startDepth, &buffer[*index]); *index += 4;
-	mb_put_binary_short(MB_YES, fsdwssheader->weightingFactor, &buffer[*index]); *index += 2;
-	mb_put_binary_short(MB_YES, fsdwssheader->ADCGain, &buffer[*index]); *index += 2;
-	mb_put_binary_short(MB_YES, fsdwssheader->ADCMax, &buffer[*index]); *index += 2;
-	mb_put_binary_short(MB_YES, fsdwssheader->rangeSetting, &buffer[*index]); *index += 2;
-	mb_put_binary_short(MB_YES, fsdwssheader->pulseID, &buffer[*index]); *index += 2;
-	mb_put_binary_short(MB_YES, fsdwssheader->markNumber, &buffer[*index]); *index += 2;
-	mb_put_binary_short(MB_YES, fsdwssheader->dataFormat, &buffer[*index]); *index += 2;
-	mb_put_binary_short(MB_YES, fsdwssheader->reserved, &buffer[*index]); *index += 2;
-	mb_put_binary_int(MB_YES, fsdwssheader->millisecondsToday, &buffer[*index]); *index += 4;
-	mb_put_binary_short(MB_YES, fsdwssheader->year, &buffer[*index]); *index += 2;
-	mb_put_binary_short(MB_YES, fsdwssheader->day, &buffer[*index]); *index += 2;
-	mb_put_binary_short(MB_YES, fsdwssheader->hour, &buffer[*index]); *index += 2;
-	mb_put_binary_short(MB_YES, fsdwssheader->minute, &buffer[*index]); *index += 2;
-	mb_put_binary_short(MB_YES, fsdwssheader->second, &buffer[*index]); *index += 2;
-	mb_put_binary_short(MB_YES, fsdwssheader->heading, &buffer[*index]); *index += 2;
-	mb_put_binary_short(MB_YES, fsdwssheader->pitch, &buffer[*index]); *index += 2;
-	mb_put_binary_short(MB_YES, fsdwssheader->roll, &buffer[*index]); *index += 2;
-	mb_put_binary_short(MB_YES, fsdwssheader->heave, &buffer[*index]); *index += 2;
-	mb_put_binary_short(MB_YES, fsdwssheader->yaw, &buffer[*index]); *index += 2;
-	mb_put_binary_int(MB_YES, fsdwssheader->depth, &buffer[*index]); *index += 4;
-	mb_put_binary_short(MB_YES, fsdwssheader->temperature, &buffer[*index]); *index += 2;
-	for (i=0;i<2;i++)
-		{
-		buffer[*index] = fsdwssheader->reserved2[i]; (*index)++;
-		}
-	mb_put_binary_int(MB_YES, fsdwssheader->longitude, &buffer[*index]); *index += 4;
-	mb_put_binary_int(MB_YES, fsdwssheader->latitude, &buffer[*index]); *index += 4;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       index:      %d\n",*index);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_wr_fsdwsegyheader(int verbose, char *buffer, int *index,
-		s7k_fsdwsegyheader *fsdwsegyheader, int *error)
-{
-	char	*function_name = "mbr_reson7kr_wr_fsdwsegyheader";
-	int	status = MB_SUCCESS;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:        %d\n",verbose);
-		fprintf(stderr,"dbg2       buffer:         %p\n",(void *)buffer);
-		fprintf(stderr,"dbg2       index:          %d\n",*index);
-		fprintf(stderr,"dbg2       fsdwsegyheader: %p\n",(void *)fsdwsegyheader);
-		}
-
-	/* print out the data to be output */
-	/*mbsys_reson7k_print_fsdwsegyheader(verbose, fsdwsegyheader, error);*/
-
-	/* extract the Edgetech segy header */
-	mb_put_binary_int(MB_YES, fsdwsegyheader->sequenceNumber, &buffer[*index]); *index += 4;
-	mb_put_binary_int(MB_YES, fsdwsegyheader->startDepth, &buffer[*index]); *index += 4;
-	mb_put_binary_int(MB_YES, fsdwsegyheader->pingNum, &buffer[*index]); *index += 4;
-	mb_put_binary_int(MB_YES, fsdwsegyheader->channelNum, &buffer[*index]); *index += 4;
-	for (i=0;i<6;i++)
-		{
-		mb_put_binary_short(MB_YES, fsdwsegyheader->unused1[i], &buffer[*index]); *index += 2;
-		}
-	mb_put_binary_short(MB_YES, fsdwsegyheader->traceIDCode, &buffer[*index]); *index += 2;
-	for (i=0;i<2;i++)
-		{
-		mb_put_binary_short(MB_YES, fsdwsegyheader->unused2[i], &buffer[*index]); *index += 2;
-		}
-	mb_put_binary_short(MB_YES, fsdwsegyheader->dataFormat, &buffer[*index]); *index += 2;
-	mb_put_binary_short(MB_YES, fsdwsegyheader->NMEAantennaeR, &buffer[*index]); *index += 2;
-	mb_put_binary_short(MB_YES, fsdwsegyheader->NMEAantennaeO, &buffer[*index]); *index += 2;
-	for (i=0;i<32;i++)
-		{
-		buffer[*index] = fsdwsegyheader->RS232[i]; (*index)++;
-		}
-	mb_put_binary_int(MB_YES, fsdwsegyheader->sourceCoordX, &buffer[*index]); *index += 4;
-	mb_put_binary_int(MB_YES, fsdwsegyheader->sourceCoordY, &buffer[*index]); *index += 4;
-	mb_put_binary_int(MB_YES, fsdwsegyheader->groupCoordX, &buffer[*index]); *index += 4;
-	mb_put_binary_int(MB_YES, fsdwsegyheader->groupCoordY, &buffer[*index]); *index += 4;
-	mb_put_binary_short(MB_YES, fsdwsegyheader->coordUnits, &buffer[*index]); *index += 2;
-	for (i=0;i<24;i++)
-		{
-		buffer[*index] = fsdwsegyheader->annotation[i]; (*index)++;
-		}
- 	mb_put_binary_short(MB_YES, fsdwsegyheader->samples, &buffer[*index]); *index += 2;
-	mb_put_binary_int(MB_YES, fsdwsegyheader->sampleInterval, &buffer[*index]); *index += 4;
- 	mb_put_binary_short(MB_YES, fsdwsegyheader->ADCGain, &buffer[*index]); *index += 2;
-	mb_put_binary_short(MB_YES, fsdwsegyheader->pulsePower, &buffer[*index]); *index += 2;
-	mb_put_binary_short(MB_YES, fsdwsegyheader->correlated, &buffer[*index]); *index += 2;
- 	mb_put_binary_short(MB_YES, fsdwsegyheader->startFreq, &buffer[*index]); *index += 2;
- 	mb_put_binary_short(MB_YES, fsdwsegyheader->endFreq, &buffer[*index]); *index += 2;
- 	mb_put_binary_short(MB_YES, fsdwsegyheader->sweepLength, &buffer[*index]); *index += 2;
-	for (i=0;i<4;i++)
-		{
-		mb_put_binary_short(MB_YES, fsdwsegyheader->unused7[i], &buffer[*index]); *index += 2;
-		}
- 	mb_put_binary_short(MB_YES, fsdwsegyheader->aliasFreq, &buffer[*index]); *index += 2;
- 	mb_put_binary_short(MB_YES, fsdwsegyheader->pulseID, &buffer[*index]); *index += 2;
-	for (i=0;i<6;i++)
-		{
-		mb_put_binary_short(MB_YES, fsdwsegyheader->unused8[i], &buffer[*index]); *index += 2;
-		}
-	mb_put_binary_short(MB_YES, fsdwsegyheader->year, &buffer[*index]); *index += 2;
-	mb_put_binary_short(MB_YES, fsdwsegyheader->day, &buffer[*index]); *index += 2;
-	mb_put_binary_short(MB_YES, fsdwsegyheader->hour, &buffer[*index]); *index += 2;
-	mb_put_binary_short(MB_YES, fsdwsegyheader->minute, &buffer[*index]); *index += 2;
-	mb_put_binary_short(MB_YES, fsdwsegyheader->second, &buffer[*index]); *index += 2;
-	mb_put_binary_short(MB_YES, fsdwsegyheader->timeBasis, &buffer[*index]); *index += 2;
-	mb_put_binary_short(MB_YES, fsdwsegyheader->weightingFactor, &buffer[*index]); *index += 2;
-	mb_put_binary_short(MB_YES, fsdwsegyheader->unused9, &buffer[*index]); *index += 2;
-	mb_put_binary_short(MB_YES, fsdwsegyheader->heading, &buffer[*index]); *index += 2;
-	mb_put_binary_short(MB_YES, fsdwsegyheader->pitch, &buffer[*index]); *index += 2;
-	mb_put_binary_short(MB_YES, fsdwsegyheader->roll, &buffer[*index]); *index += 2;
-	mb_put_binary_short(MB_YES, fsdwsegyheader->temperature, &buffer[*index]); *index += 2;
-	mb_put_binary_short(MB_YES, fsdwsegyheader->heaveCompensation, &buffer[*index]); *index += 2;
-	mb_put_binary_short(MB_YES, fsdwsegyheader->trigSource, &buffer[*index]); *index += 2;
- 	mb_put_binary_short(MB_YES, fsdwsegyheader->markNumber, &buffer[*index]); *index += 2;
-	mb_put_binary_short(MB_YES, fsdwsegyheader->NMEAHour, &buffer[*index]); *index += 2;
-	mb_put_binary_short(MB_YES, fsdwsegyheader->NMEAMinutes, &buffer[*index]); *index += 2;
-	mb_put_binary_short(MB_YES, fsdwsegyheader->NMEASeconds, &buffer[*index]); *index += 2;
-	mb_put_binary_short(MB_YES, fsdwsegyheader->NMEACourse, &buffer[*index]); *index += 2;
-	mb_put_binary_short(MB_YES, fsdwsegyheader->NMEASpeed, &buffer[*index]); *index += 2;
-	mb_put_binary_short(MB_YES, fsdwsegyheader->NMEADay, &buffer[*index]); *index += 2;
-	mb_put_binary_short(MB_YES, fsdwsegyheader->NMEAYear, &buffer[*index]); *index += 2;
-	mb_put_binary_int(MB_YES, fsdwsegyheader->millisecondsToday, &buffer[*index]); *index += 4;
- 	mb_put_binary_short(MB_YES, fsdwsegyheader->ADCMax, &buffer[*index]); *index += 2;
-	mb_put_binary_short(MB_YES, fsdwsegyheader->calConst, &buffer[*index]); *index += 2;
-	mb_put_binary_short(MB_YES, fsdwsegyheader->vehicleID, &buffer[*index]); *index += 2;
-	for (i=0;i<6;i++)
-		{
-		buffer[*index] = fsdwsegyheader->softwareVersion[i]; (*index)++;
-		}
-	mb_put_binary_int(MB_YES, fsdwsegyheader->sphericalCorrection, &buffer[*index]); *index += 4;
- 	mb_put_binary_short(MB_YES, fsdwsegyheader->packetNum, &buffer[*index]); *index += 2;
-	mb_put_binary_short(MB_YES, fsdwsegyheader->ADCDecimation, &buffer[*index]); *index += 2;
-	mb_put_binary_short(MB_YES, fsdwsegyheader->decimation, &buffer[*index]); *index += 2;
-	for (i=0;i<7;i++)
-		{
-		mb_put_binary_short(MB_YES, fsdwsegyheader->unuseda[i], &buffer[*index]); *index += 2;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       index:      %d\n",*index);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_wr_fsdwsslo(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error)
-{
-	char	*function_name = "mbr_reson7kr_wr_fsdwsslo";
-	int	status = MB_SUCCESS;
-	struct mbsys_reson7k_struct *store;
-	s7k_header *header;
-	s7kr_fsdwss *fsdwsslo;
-	s7k_fsdwchannel *fsdwchannel;
-	s7k_fsdwssheader *fsdwssheader;
-	s7kr_bathymetry *bathymetry;
-	s7kr_bluefin *bluefin;
-	unsigned int checksum;
-	int	index;
-	char	*buffer;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       bufferalloc:%d\n",*bufferalloc);
-		fprintf(stderr,"dbg2       bufferptr:  %p\n",(void *)bufferptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	fsdwsslo = &(store->fsdwsslo);
-	header = &(fsdwsslo->header);
-	bathymetry = &(store->bathymetry);
-	bluefin = &(store->bluefin);
-
-	/* print out the data to be output */
-#ifdef MBR_RESON7KR_DEBUG
-	if (verbose > 0)
-#else
-	if (verbose >= 2)
-#endif
-	mbsys_reson7k_print_fsdwss(verbose, fsdwsslo, error);
-#ifdef MBR_RESON7KR_DEBUG
-for (i=0;i<fsdwsslo->number_channels;i++)
-{
-fsdwchannel = &(fsdwsslo->channel[i]);
-fsdwssheader = &(fsdwsslo->ssheader[i]);
-fprintf(stderr,"SSLO: 7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) FSDWtime(%4.4d-%3.3d %2.2d:%2.2d:%2.2d.%3.3d) ping:%d %d chan:%d %d sampint:%d %d\n",
-store->time_i[0],store->time_i[1],store->time_i[2],
-store->time_i[3],store->time_i[4],store->time_i[5],store->time_i[6],
-fsdwssheader->year,fsdwssheader->day,fsdwssheader->hour,fsdwssheader->minute,fsdwssheader->second,
-fsdwssheader->millisecondsToday - 1000 * (int)(0.001 * fsdwssheader->millisecondsToday),
-fsdwsslo->ping_number,fsdwssheader->pingNum,
-fsdwchannel->number,fsdwssheader->channelNum,
-fsdwchannel->sample_interval,fsdwssheader->sampleInterval);
-}
-#endif
-
-	/* figure out size of output record */
-	*size = MBSYS_RESON7K_RECORDHEADER_SIZE + MBSYS_RESON7K_RECORDTAIL_SIZE;
-	*size += R7KHDRSIZE_FSDWsidescan;
-	for (i=0;i<fsdwsslo->number_channels;i++)
-		{
-		*size += R7KHDRSIZE_FSDWchannelinfo;
-		*size += R7KHDRSIZE_FSDWssheader;
-		fsdwchannel = &(fsdwsslo->channel[i]);
-		*size += fsdwchannel->bytespersample * fsdwchannel->number_samples;
-		}
-
-	/* allocate memory to write rest of record if necessary */
-	if (*bufferalloc < *size)
-		{
-		status = mb_reallocd(verbose, __FILE__, __LINE__, *size,
-					(void **)bufferptr, error);
-		if (status != MB_SUCCESS)
-			{
-			*bufferalloc = 0;
-			}
-		else
-			{
-			*bufferalloc = *size;
-			}
-		}
-
-	/* proceed to write if buffer allocated */
-	if (status == MB_SUCCESS)
-		{
-		/* get buffer for writing */
-		buffer = (char *) *bufferptr;
-
-		/* insert the header */
-		index = 0;
-		status = mbr_reson7kr_wr_header(verbose, buffer, &index, header, error);
-
-		/* insert the data */
-		index = header->Offset + 4;
-		mb_put_binary_int(MB_YES, fsdwsslo->msec_timestamp, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, fsdwsslo->ping_number, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, fsdwsslo->number_channels, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, fsdwsslo->total_bytes, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, fsdwsslo->data_format, &buffer[index]);index += 4;
-		index += 12;
-		for (i=0;i<2;i++)
-			{
-			fsdwchannel = &(fsdwsslo->channel[i]);
-			mbr_reson7kr_wr_fsdwchannel(verbose, fsdwsslo->data_format, buffer, &index, fsdwchannel, error);
-			}
-	/*fprintf(stderr,"In mbr_reson7kr_wr_fsdwsslo: index:%d OffsetToOptionalData:%d\n",
-	index, header->OffsetToOptionalData);
-		index = header->OffsetToOptionalData;*/
-		for (i=0;i<2;i++)
-			{
-			fsdwssheader = &(fsdwsslo->ssheader[i]);
-			mbr_reson7kr_wr_fsdwssheader(verbose, buffer, &index, fsdwssheader, error);
-			}
-
-		/* reset the header size value */
-		mb_put_binary_int(MB_YES, ((unsigned int)(index + 4)), &buffer[8]);
-
-		/* now add the checksum */
-		checksum = 0;
-		for (i=0;i<index;i++)
-			checksum += (unsigned char) buffer[i];
-		mb_put_binary_int(MB_YES, checksum, &buffer[index]); index += 4;
-
-		/* check size */
-		if (*size != index)
-			{
-fprintf(stderr,"Bad size comparison: file:%s line:%d size:%d index:%d\n", __FILE__, __LINE__, *size, index);
-			status = MB_FAILURE;
-			*error = MB_ERROR_BAD_DATA;
-			*size = 0;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       bufferalloc:%d\n",*bufferalloc);
-		fprintf(stderr,"dbg2       size:       %d\n",*size);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_wr_fsdwsshi(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error)
-{
-	char	*function_name = "mbr_reson7kr_wr_fsdwsshi";
-	int	status = MB_SUCCESS;
-	struct mbsys_reson7k_struct *store;
-	s7k_header *header;
-	s7kr_fsdwss *fsdwsshi;
-	s7k_fsdwchannel *fsdwchannel;
-	s7k_fsdwssheader *fsdwssheader;
-	unsigned int checksum;
-	int	index;
-	char	*buffer;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       bufferalloc:%d\n",*bufferalloc);
-		fprintf(stderr,"dbg2       bufferptr:  %p\n",(void *)bufferptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	fsdwsshi = &(store->fsdwsshi);
-	header = &(fsdwsshi->header);
-
-	/* print out the data to be output */
-#ifdef MBR_RESON7KR_DEBUG
-	if (verbose > 0)
-#else
-	if (verbose >= 2)
-#endif
-	mbsys_reson7k_print_fsdwss(verbose, fsdwsshi, error);
-#ifdef MBR_RESON7KR_DEBUG
-for (i=0;i<fsdwsshi->number_channels;i++)
-{
-fsdwchannel = &(fsdwsshi->channel[i]);
-fsdwssheader = &(fsdwsshi->ssheader[i]);
-fprintf(stderr,"SSHI: 7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) FSDWtime(%4.4d-%3.3d %2.2d:%2.2d:%2.2d.%3.3d) ping:%d %d chan:%d %d sampint:%d %d\n",
-store->time_i[0],store->time_i[1],store->time_i[2],
-store->time_i[3],store->time_i[4],store->time_i[5],store->time_i[6],
-fsdwssheader->year,fsdwssheader->day,fsdwssheader->hour,fsdwssheader->minute,fsdwssheader->second,
-fsdwssheader->millisecondsToday - 1000 * (int)(0.001 * fsdwssheader->millisecondsToday),
-fsdwsshi->ping_number,fsdwssheader->pingNum,
-fsdwchannel->number,fsdwssheader->channelNum,
-fsdwchannel->sample_interval,fsdwssheader->sampleInterval);
-}
-#endif
-
-	/* figure out size of output record */
-	*size = MBSYS_RESON7K_RECORDHEADER_SIZE + MBSYS_RESON7K_RECORDTAIL_SIZE;
-	*size += R7KHDRSIZE_FSDWsidescan;
-	for (i=0;i<fsdwsshi->number_channels;i++)
-		{
-		*size += R7KHDRSIZE_FSDWchannelinfo;
-		*size += R7KHDRSIZE_FSDWssheader;
-		fsdwchannel = &(fsdwsshi->channel[i]);
-		*size += fsdwchannel->bytespersample * fsdwchannel->number_samples;
-		}
-
-	/* allocate memory to write rest of record if necessary */
-	if (*bufferalloc < *size)
-		{
-		status = mb_reallocd(verbose, __FILE__, __LINE__, *size,
-					(void **)bufferptr, error);
-		if (status != MB_SUCCESS)
-			{
-			*bufferalloc = 0;
-			}
-		else
-			{
-			*bufferalloc = *size;
-			}
-		}
-
-	/* proceed to write if buffer allocated */
-	if (status == MB_SUCCESS)
-		{
-		/* get buffer for writing */
-		buffer = (char *) *bufferptr;
-
-		/* insert the header */
-		index = 0;
-		status = mbr_reson7kr_wr_header(verbose, buffer, &index, header, error);
-
-		/* insert the data */
-		index = header->Offset + 4;
-		mb_put_binary_int(MB_YES, fsdwsshi->msec_timestamp, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, fsdwsshi->ping_number, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, fsdwsshi->number_channels, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, fsdwsshi->total_bytes, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, fsdwsshi->data_format, &buffer[index]);index += 4;
-		index += 12;
-		for (i=0;i<2;i++)
-			{
-			fsdwchannel = &(fsdwsshi->channel[i]);
-			mbr_reson7kr_wr_fsdwchannel(verbose, fsdwsshi->data_format, buffer, &index, fsdwchannel, error);
-			}
-	/*fprintf(stderr,"In mbr_reson7kr_wr_fsdwsshi: index:%d OffsetToOptionalData:%d\n",
-	index, header->OffsetToOptionalData);
-		index = header->OffsetToOptionalData;*/
-		for (i=0;i<2;i++)
-			{
-			fsdwssheader = &(fsdwsshi->ssheader[i]);
-			mbr_reson7kr_wr_fsdwssheader(verbose, buffer, &index, fsdwssheader, error);
-			}
-
-		/* reset the header size value */
-		mb_put_binary_int(MB_YES, ((unsigned int)(index + 4)), &buffer[8]);
-
-		/* now add the checksum */
-		checksum = 0;
-		for (i=0;i<index;i++)
-			checksum += (unsigned char) buffer[i];
-		mb_put_binary_int(MB_YES, checksum, &buffer[index]); index += 4;
-
-		/* check size */
-		if (*size != index)
-			{
-fprintf(stderr,"Bad size comparison: file:%s line:%d size:%d index:%d\n", __FILE__, __LINE__, *size, index);
-			status = MB_FAILURE;
-			*error = MB_ERROR_BAD_DATA;
-			*size = 0;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       bufferalloc:%d\n",*bufferalloc);
-		fprintf(stderr,"dbg2       size:       %d\n",*size);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_wr_fsdwsb(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error)
-{
-	char	*function_name = "mbr_reson7kr_wr_fsdwsb";
-	int	status = MB_SUCCESS;
-	struct mbsys_reson7k_struct *store;
-	s7k_header *header;
-	s7kr_fsdwsb *fsdwsb;
-	s7k_fsdwchannel *fsdwchannel;
-	s7k_fsdwsegyheader *fsdwsegyheader;
-	unsigned int checksum;
-	int	index;
-	char	*buffer;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       bufferalloc:%d\n",*bufferalloc);
-		fprintf(stderr,"dbg2       bufferptr:  %p\n",(void *)bufferptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	fsdwsb = &(store->fsdwsb);
-	header = &(fsdwsb->header);
-
-	/* print out the data to be output */
-#ifdef MBR_RESON7KR_DEBUG
-	if (verbose > 0)
-#else
-	if (verbose >= 2)
-#endif
-	mbsys_reson7k_print_fsdwsb(verbose, fsdwsb, error);
-#ifdef MBR_RESON7KR_DEBUG
-for (i=0;i<fsdwsb->number_channels;i++)
-{
-fsdwchannel = &(fsdwsb->channel);
-fsdwsegyheader = &(fsdwsb->segyheader);
-fprintf(stderr,"SBP:  7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) FSDWtime(%4.4d-%3.3d %2.2d:%2.2d:%2.2d.%3.3d) ping:%d %d chan:%d %d sampint:%d %d\n",
-store->time_i[0],store->time_i[1],store->time_i[2],
-store->time_i[3],store->time_i[4],store->time_i[5],store->time_i[6],
-fsdwsegyheader->year,fsdwsegyheader->day,fsdwsegyheader->hour,fsdwsegyheader->minute,fsdwsegyheader->second,
-fsdwsegyheader->millisecondsToday - 1000 * (int)(0.001 * fsdwsegyheader->millisecondsToday),
-fsdwsb->ping_number,fsdwsegyheader->pingNum,
-fsdwchannel->number,fsdwsegyheader->channelNum,
-fsdwchannel->sample_interval,fsdwsegyheader->sampleInterval);
-}
-#endif
-
-	/* figure out size of output record */
-	*size = MBSYS_RESON7K_RECORDHEADER_SIZE + MBSYS_RESON7K_RECORDTAIL_SIZE;
-	*size += R7KHDRSIZE_FSDWsubbottom;
-
-	/* figure out size of output record */
-	*size = MBSYS_RESON7K_RECORDHEADER_SIZE + MBSYS_RESON7K_RECORDTAIL_SIZE;
-	*size += R7KHDRSIZE_FSDWsubbottom;
-	for (i=0;i<fsdwsb->number_channels;i++)
-		{
-		*size += R7KHDRSIZE_FSDWchannelinfo;
-		*size += R7KHDRSIZE_FSDWsbheader;
-		fsdwchannel = &(fsdwsb->channel);
-		*size += fsdwchannel->bytespersample * fsdwchannel->number_samples;
-		}
-
-	/* allocate memory to write rest of record if necessary */
-	if (*bufferalloc < *size)
-		{
-		status = mb_reallocd(verbose, __FILE__, __LINE__, *size,
-					(void **)bufferptr, error);
-		if (status != MB_SUCCESS)
-			{
-			*bufferalloc = 0;
-			}
-		else
-			{
-			*bufferalloc = *size;
-			}
-		}
-
-	/* proceed to write if buffer allocated */
-	if (status == MB_SUCCESS)
-		{
-		/* get buffer for writing */
-		buffer = (char *) *bufferptr;
-
-		/* insert the header */
-		index = 0;
-		status = mbr_reson7kr_wr_header(verbose, buffer, &index, header, error);
-
-		/* insert the data */
-		index = header->Offset + 4;
-		mb_put_binary_int(MB_YES, fsdwsb->msec_timestamp, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, fsdwsb->ping_number, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, fsdwsb->number_channels, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, fsdwsb->total_bytes, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, fsdwsb->data_format, &buffer[index]);index += 4;
-		index += 12;
-		fsdwchannel = &(fsdwsb->channel);
-		mbr_reson7kr_wr_fsdwchannel(verbose, fsdwsb->data_format, buffer, &index, fsdwchannel, error);
-/* fprintf(stderr,"index:%d offset:%d\n",index,header->OffsetToOptionalData);*/
-		fsdwsegyheader = &(fsdwsb->segyheader);
-		mbr_reson7kr_wr_fsdwsegyheader(verbose, buffer, &index, fsdwsegyheader, error);
-
-		/* reset the header size value */
-		mb_put_binary_int(MB_YES, ((unsigned int)(index + 4)), &buffer[8]);
-
-		/* now add the checksum */
-		checksum = 0;
-		for (i=0;i<index;i++)
-			checksum += (unsigned char) buffer[i];
-		mb_put_binary_int(MB_YES, checksum, &buffer[index]); index += 4;
-
-		/* check size */
-		if (*size != index)
-			{
-fprintf(stderr,"Bad size comparison: file:%s line:%d size:%d index:%d\n", __FILE__, __LINE__, *size, index);
-			status = MB_FAILURE;
-			*error = MB_ERROR_BAD_DATA;
-			*size = 0;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       bufferalloc:%d\n",*bufferalloc);
-		fprintf(stderr,"dbg2       size:       %d\n",*size);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_wr_bluefin(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error)
-{
-	char	*function_name = "mbr_reson7kr_wr_bluefin";
-	int	status = MB_SUCCESS;
-	struct mbsys_reson7k_struct *store;
-	s7k_header *header;
-	s7kr_bluefin *bluefin;
-	unsigned int checksum;
-	int	index;
-	char	*buffer;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       bufferalloc:%d\n",*bufferalloc);
-		fprintf(stderr,"dbg2       bufferptr:  %p\n",(void *)bufferptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	bluefin = &(store->bluefin);
-	header = &(bluefin->header);
-
-	/* print out the data to be output */
-#ifdef MBR_RESON7KR_DEBUG
-	if (verbose > 0)
-#else
-	if (verbose >= 2)
-#endif
-	mbsys_reson7k_print_bluefin(verbose, bluefin, error);
-
-	/* figure out size of output record */
-	*size = MBSYS_RESON7K_RECORDHEADER_SIZE + MBSYS_RESON7K_RECORDTAIL_SIZE;
-	*size += R7KHDRSIZE_BluefinDataFrame;
-	*size += bluefin->number_frames * bluefin->frame_size;
-
-	/* allocate memory to write rest of record if necessary */
-	if (*bufferalloc < *size)
-		{
-		status = mb_reallocd(verbose, __FILE__, __LINE__, *size,
-					(void **)bufferptr, error);
-		if (status != MB_SUCCESS)
-			{
-			*bufferalloc = 0;
-			}
-		else
-			{
-			*bufferalloc = *size;
-			}
-		}
-
-	/* proceed to write if buffer allocated */
-	if (status == MB_SUCCESS)
-		{
-		/* get buffer for writing */
-		buffer = (char *) *bufferptr;
-
-		/* insert the header */
-		index = 0;
-		status = mbr_reson7kr_wr_header(verbose, buffer, &index, header, error);
-
-		/* insert the data */
-		index = header->Offset + 4;
-		mb_put_binary_int(MB_YES, bluefin->msec_timestamp, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, bluefin->number_frames, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, bluefin->frame_size, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, bluefin->data_format, &buffer[index]); index += 4;
-		for (i=0;i<16;i++)
-			{
-			buffer[index] = bluefin->reserved[i]; index++;
-			}
-		if (bluefin->data_format == R7KRECID_BluefinNav)
-			{
-			for (i=0;i<bluefin->number_frames;i++)
-				{
-				mb_put_binary_int(MB_YES, bluefin->nav[i].packet_size, &buffer[index]); index += 4;
-				mb_put_binary_short(MB_YES, bluefin->nav[i].version, &buffer[index]); index += 2;
-				mb_put_binary_short(MB_YES, bluefin->nav[i].offset, &buffer[index]); index += 2;
-				mb_put_binary_int(MB_YES, bluefin->nav[i].data_type, &buffer[index]); index += 4;
-				mb_put_binary_int(MB_YES, bluefin->nav[i].data_size, &buffer[index]); index += 4;
-				mb_put_binary_short(MB_YES, bluefin->nav[i].s7kTime.Year, &buffer[index]); index += 2;
-				mb_put_binary_short(MB_YES, bluefin->nav[i].s7kTime.Day, &buffer[index]); index += 2;
-				mb_put_binary_float(MB_YES, bluefin->nav[i].s7kTime.Seconds, &buffer[index]); index += 4;
-				buffer[index] = bluefin->nav[i].s7kTime.Hours; (index)++;
-				buffer[index] = bluefin->nav[i].s7kTime.Minutes; (index)++;
-				mb_put_binary_int(MB_YES, bluefin->nav[i].checksum, &buffer[index]); index += 4;
-				mb_put_binary_short(MB_YES, bluefin->nav[i].timedelay, &buffer[index]); index += 2;
-				mb_put_binary_int(MB_YES, bluefin->nav[i].quality, &buffer[index]); index += 4;
-				mb_put_binary_double(MB_YES, bluefin->nav[i].latitude, &buffer[index]); index += 8;
-				mb_put_binary_double(MB_YES, bluefin->nav[i].longitude, &buffer[index]); index += 8;
-				mb_put_binary_float(MB_YES, bluefin->nav[i].speed, &buffer[index]); index += 4;
-				mb_put_binary_double(MB_YES, bluefin->nav[i].depth, &buffer[index]); index += 8;
-				mb_put_binary_double(MB_YES, bluefin->nav[i].altitude, &buffer[index]); index += 8;
-				mb_put_binary_float(MB_YES, bluefin->nav[i].roll, &buffer[index]); index += 4;
-				mb_put_binary_float(MB_YES, bluefin->nav[i].pitch, &buffer[index]); index += 4;
-				mb_put_binary_float(MB_YES, bluefin->nav[i].yaw, &buffer[index]); index += 4;
-				mb_put_binary_float(MB_YES, bluefin->nav[i].northing_rate, &buffer[index]); index += 4;
-				mb_put_binary_float(MB_YES, bluefin->nav[i].easting_rate, &buffer[index]); index += 4;
-				mb_put_binary_float(MB_YES, bluefin->nav[i].depth_rate, &buffer[index]); index += 4;
-				mb_put_binary_float(MB_YES, bluefin->nav[i].altitude_rate, &buffer[index]); index += 4;
-				mb_put_binary_float(MB_YES, bluefin->nav[i].roll_rate, &buffer[index]); index += 4;
-				mb_put_binary_float(MB_YES, bluefin->nav[i].pitch_rate, &buffer[index]); index += 4;
-				mb_put_binary_float(MB_YES, bluefin->nav[i].yaw_rate, &buffer[index]); index += 4;
-				mb_put_binary_double(MB_YES, bluefin->nav[i].position_time, &buffer[index]); index += 8;
-				mb_put_binary_double(MB_YES, bluefin->nav[i].depth_time, &buffer[index]); index += 8;
-				}
-			}
-		else if (bluefin->data_format == R7KRECID_BluefinEnvironmental)
-			{
-			for (i=0;i<bluefin->number_frames;i++)
-				{
-				mb_put_binary_int(MB_YES, bluefin->environmental[i].packet_size, &buffer[index]); index += 4;
-				mb_put_binary_short(MB_YES, bluefin->environmental[i].version, &buffer[index]); index += 2;
-				mb_put_binary_short(MB_YES, bluefin->environmental[i].offset, &buffer[index]); index += 2;
-				mb_put_binary_int(MB_YES, bluefin->environmental[i].data_type, &buffer[index]); index += 4;
-				mb_put_binary_int(MB_YES, bluefin->environmental[i].data_size, &buffer[index]); index += 4;
-				mb_put_binary_short(MB_YES, bluefin->environmental[i].s7kTime.Year, &buffer[index]); index += 2;
-				mb_put_binary_short(MB_YES, bluefin->environmental[i].s7kTime.Day, &buffer[index]); index += 2;
-				mb_put_binary_float(MB_YES, bluefin->environmental[i].s7kTime.Seconds, &buffer[index]); index += 4;
-				buffer[index] = bluefin->environmental[i].s7kTime.Hours; (index)++;
-				buffer[index] = bluefin->environmental[i].s7kTime.Minutes; (index)++;
-				mb_put_binary_int(MB_YES, bluefin->environmental[i].checksum, &buffer[index]); index += 4;
-				mb_put_binary_short(MB_YES, bluefin->environmental[i].reserved1, &buffer[index]); index += 2;
-				mb_put_binary_int(MB_YES, bluefin->environmental[i].quality, &buffer[index]); index += 4;
-				mb_put_binary_float(MB_YES, bluefin->environmental[i].sound_speed, &buffer[index]); index += 4;
-				mb_put_binary_float(MB_YES, bluefin->environmental[i].conductivity, &buffer[index]); index += 4;
-				mb_put_binary_float(MB_YES, bluefin->environmental[i].temperature, &buffer[index]); index += 4;
-				mb_put_binary_float(MB_YES, bluefin->environmental[i].pressure, &buffer[index]); index += 4;
-				mb_put_binary_float(MB_YES, bluefin->environmental[i].salinity, &buffer[index]); index += 4;
-				mb_put_binary_double(MB_YES, bluefin->environmental[i].ctd_time, &buffer[index]); index += 8;
-				mb_put_binary_double(MB_YES, bluefin->environmental[i].temperature_time, &buffer[index]); index += 8;
-				mb_put_binary_double(MB_YES, bluefin->environmental[i].surface_pressure, &buffer[index]); index += 8;
-				mb_put_binary_int(MB_YES, bluefin->environmental[i].temperature_counts, &buffer[index]); index += 4;
-				mb_put_binary_float(MB_YES, bluefin->environmental[i].conductivity_frequency, &buffer[index]); index += 4;
-				mb_put_binary_int(MB_YES, bluefin->environmental[i].pressure_counts, &buffer[index]); index += 4;
-				mb_put_binary_float(MB_YES, bluefin->environmental[i].pressure_comp_voltage, &buffer[index]); index += 4;
-				mb_put_binary_int(MB_YES, bluefin->environmental[i].sensor_time_sec, &buffer[index]); index += 4;
-				mb_put_binary_int(MB_YES, bluefin->environmental[i].sensor_time_nsec, &buffer[index]); index += 4;
-				mb_put_binary_short(MB_YES, bluefin->environmental[i].sensor1, &buffer[index]); index += 2;
-				mb_put_binary_short(MB_YES, bluefin->environmental[i].sensor2, &buffer[index]); index += 2;
-				mb_put_binary_short(MB_YES, bluefin->environmental[i].sensor3, &buffer[index]); index += 2;
-				mb_put_binary_short(MB_YES, bluefin->environmental[i].sensor4, &buffer[index]); index += 2;
-				mb_put_binary_short(MB_YES, bluefin->environmental[i].sensor5, &buffer[index]); index += 2;
-				mb_put_binary_short(MB_YES, bluefin->environmental[i].sensor6, &buffer[index]); index += 2;
-				mb_put_binary_short(MB_YES, bluefin->environmental[i].sensor7, &buffer[index]); index += 2;
-				mb_put_binary_short(MB_YES, bluefin->environmental[i].sensor8, &buffer[index]); index += 2;
-				for (j=0;j<8;j++)
-					{
-					buffer[index] = bluefin->environmental[i].reserved2[j]; index++;
-					}
-				}
-			}
-
-		/* reset the header size value */
-		mb_put_binary_int(MB_YES, ((unsigned int)(index + 4)), &buffer[8]);
-
-		/* now add the checksum */
-		checksum = 0;
-		for (i=0;i<index;i++)
-			checksum += (unsigned char) buffer[i];
-		mb_put_binary_int(MB_YES, checksum, &buffer[index]); index += 4;
-
-		/* check size */
-		if (*size != index)
-			{
-fprintf(stderr,"Bad size comparison: file:%s line:%d size:%d index:%d\n", __FILE__, __LINE__, *size, index);
-			status = MB_FAILURE;
-			*error = MB_ERROR_BAD_DATA;
-			*size = 0;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       bufferalloc:%d\n",*bufferalloc);
-		fprintf(stderr,"dbg2       size:       %d\n",*size);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_wr_processedsidescan(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error)
-{
-	char	*function_name = "mbr_reson7kr_wr_processedsidescan";
-	int	status = MB_SUCCESS;
-	struct mbsys_reson7k_struct *store;
-	s7k_header *header;
-	s7kr_processedsidescan *processedsidescan;
-	unsigned int checksum;
-	int	index;
-	char	*buffer;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       bufferalloc:%d\n",*bufferalloc);
-		fprintf(stderr,"dbg2       bufferptr:  %p\n",(void *)bufferptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	processedsidescan = &(store->processedsidescan);
-	header = &(processedsidescan->header);
-
-	/* figure out size of output record */
-	*size = MBSYS_RESON7K_RECORDHEADER_SIZE + MBSYS_RESON7K_RECORDTAIL_SIZE;
-	*size += R7KHDRSIZE_ProcessedSidescan;
-	*size += processedsidescan->number_pixels * 8;
-	header->OffsetToOptionalData = 0;
-	header->Size = *size;
-
-	/* print out the data to be output */
-#ifdef MBR_RESON7KR_DEBUG
-	if (verbose > 0)
-#else
-	if (verbose >= 2)
-#endif
-	mbsys_reson7k_print_processedsidescan(verbose, processedsidescan, error);
-
-	/* allocate memory to write rest of record if necessary */
-	if (*bufferalloc < *size)
-		{
-		status = mb_reallocd(verbose, __FILE__, __LINE__, *size,
-					(void **)bufferptr, error);
-		if (status != MB_SUCCESS)
-			{
-			*bufferalloc = 0;
-			}
-		else
-			{
-			*bufferalloc = *size;
-			}
-		}
-
-	/* proceed to write if buffer allocated */
-	if (status == MB_SUCCESS)
-		{
-		/* get buffer for writing */
-		buffer = (char *) *bufferptr;
-
-		/* insert the header */
-		index = 0;
-		status = mbr_reson7kr_wr_header(verbose, buffer, &index, header, error);
-
-		/* insert the data */
-		index = header->Offset + 4;
-		mb_put_binary_long(MB_YES, processedsidescan->serial_number, &buffer[index]); index += 8;
-		mb_put_binary_int(MB_YES, processedsidescan->ping_number, &buffer[index]); index += 4;
-		mb_put_binary_short(MB_YES, processedsidescan->multi_ping, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, processedsidescan->recordversion, &buffer[index]); index += 2;
-		mb_put_binary_int(MB_YES, processedsidescan->ss_source, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, processedsidescan->number_pixels, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, processedsidescan->ss_type, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, processedsidescan->pixelwidth, &buffer[index]); index += 4;
-		mb_put_binary_double(MB_YES, processedsidescan->sonardepth, &buffer[index]); index += 8;
-		mb_put_binary_double(MB_YES, processedsidescan->altitude, &buffer[index]); index += 8;
-
-		/* insert the data */
-		for (i=0;i<processedsidescan->number_pixels;i++)
-			{
-			mb_put_binary_float(MB_YES, processedsidescan->sidescan[i], &buffer[index]); index += 4;
-			}
-		for (i=0;i<processedsidescan->number_pixels;i++)
-			{
-			mb_put_binary_float(MB_YES, processedsidescan->alongtrack[i], &buffer[index]); index += 4;
-			}
-
-		/* reset the header size value */
-		mb_put_binary_int(MB_YES, ((unsigned int)(index + 4)), &buffer[8]);
-
-		/* now add the checksum */
-		checksum = 0;
-		for (i=0;i<index;i++)
-			checksum += (unsigned char) buffer[i];
-		mb_put_binary_int(MB_YES, checksum, &buffer[index]); index += 4;
-
-		/* check size */
-		if (*size != index)
-			{
-fprintf(stderr,"Bad size comparison: file:%s line:%d size:%d index:%d\n", __FILE__, __LINE__, *size, index);
-			status = MB_FAILURE;
-			*error = MB_ERROR_BAD_DATA;
-			*size = 0;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       bufferalloc:%d\n",*bufferalloc);
-		fprintf(stderr,"dbg2       size:       %d\n",*size);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_wr_volatilesonarsettings(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error)
-{
-	char	*function_name = "mbr_reson7kr_wr_volatilesonarsettings";
-	int	status = MB_SUCCESS;
-	struct mbsys_reson7k_struct *store;
-	s7k_header *header;
-	s7kr_volatilesettings *volatilesettings;
-	unsigned int checksum;
-	int	index;
-	char	*buffer;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       bufferalloc:%d\n",*bufferalloc);
-		fprintf(stderr,"dbg2       bufferptr:  %p\n",(void *)bufferptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	volatilesettings = &(store->volatilesettings);
-	header = &(volatilesettings->header);
-
-	/* print out the data to be output */
-#ifdef MBR_RESON7KR_DEBUG
-	if (verbose > 0)
-#else
-	if (verbose >= 2)
-#endif
-	mbsys_reson7k_print_volatilesettings(verbose, volatilesettings, error);
-
-	/* figure out size of output record */
-	*size = MBSYS_RESON7K_RECORDHEADER_SIZE + MBSYS_RESON7K_RECORDTAIL_SIZE;
-	*size += R7KHDRSIZE_7kVolatileSonarSettings;
-
-	/* allocate memory to write rest of record if necessary */
-	if (*bufferalloc < *size)
-		{
-		status = mb_reallocd(verbose, __FILE__, __LINE__, *size,
-					(void **)bufferptr, error);
-		if (status != MB_SUCCESS)
-			{
-			*bufferalloc = 0;
-			}
-		else
-			{
-			*bufferalloc = *size;
-			}
-		}
-
-	/* proceed to write if buffer allocated */
-	if (status == MB_SUCCESS)
-		{
-		/* get buffer for writing */
-		buffer = (char *) *bufferptr;
-
-		/* insert the header */
-		index = 0;
-		status = mbr_reson7kr_wr_header(verbose, buffer, &index, header, error);
-
-		/* insert the data */
-		index = header->Offset + 4;
-		mb_put_binary_long(MB_YES, volatilesettings->serial_number, &buffer[index]); index += 8;
-		mb_put_binary_int(MB_YES, volatilesettings->ping_number, &buffer[index]); index += 4;
-		mb_put_binary_short(MB_YES, volatilesettings->multi_ping, &buffer[index]); index += 2;
-		mb_put_binary_float(MB_YES, volatilesettings->frequency, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, volatilesettings->sample_rate, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, volatilesettings->receiver_bandwidth, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, volatilesettings->pulse_width, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, volatilesettings->pulse_type, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, volatilesettings->pulse_envelope, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, volatilesettings->pulse_envelope_par, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, volatilesettings->pulse_reserved, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, volatilesettings->max_ping_rate, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, volatilesettings->ping_period, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, volatilesettings->range_selection, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, volatilesettings->power_selection, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, volatilesettings->gain_selection, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, volatilesettings->control_flags, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, volatilesettings->projector_magic_no, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, volatilesettings->steering_vertical, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, volatilesettings->steering_horizontal, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, volatilesettings->beamwidth_vertical, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, volatilesettings->beamwidth_horizontal, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, volatilesettings->focal_point, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, volatilesettings->projector_weighting, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, volatilesettings->projector_weighting_par, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, volatilesettings->transmit_flags, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, volatilesettings->hydrophone_magic_no, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, volatilesettings->receive_weighting, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, volatilesettings->receive_weighting_par, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, volatilesettings->receive_flags, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, volatilesettings->receive_width, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, volatilesettings->range_minimum, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, volatilesettings->range_maximum, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, volatilesettings->depth_minimum, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, volatilesettings->depth_maximum, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, volatilesettings->absorption, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, volatilesettings->sound_velocity, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, volatilesettings->spreading, &buffer[index]); index += 4;
-		mb_put_binary_short(MB_YES, volatilesettings->reserved, &buffer[index]); index += 2;
-
-		/* reset the header size value */
-		mb_put_binary_int(MB_YES, ((unsigned int)(index + 4)), &buffer[8]);
-
-		/* now add the checksum */
-		checksum = 0;
-		for (i=0;i<index;i++)
-			checksum += (unsigned char) buffer[i];
-		mb_put_binary_int(MB_YES, checksum, &buffer[index]); index += 4;
-
-		/* check size */
-		if (*size != index)
-			{
-fprintf(stderr,"Bad size comparison: file:%s line:%d size:%d index:%d\n", __FILE__, __LINE__, *size, index);
-			status = MB_FAILURE;
-			*error = MB_ERROR_BAD_DATA;
-			*size = 0;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       bufferalloc:%d\n",*bufferalloc);
-		fprintf(stderr,"dbg2       size:       %d\n",*size);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_wr_configuration(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error)
-{
-	char	*function_name = "mbr_reson7kr_wr_configuration";
-	int	status = MB_SUCCESS;
-	struct mbsys_reson7k_struct *store;
-	s7k_header *header;
-	s7kr_configuration *configuration;
-	s7k_device *device;
-	unsigned int checksum;
-	int	index;
-	char	*buffer;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       bufferalloc:%d\n",*bufferalloc);
-		fprintf(stderr,"dbg2       bufferptr:  %p\n",(void *)bufferptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	configuration = &(store->configuration);
-	header = &(configuration->header);
-
-	/* print out the data to be output */
-#ifdef MBR_RESON7KR_DEBUG
-	if (verbose > 0)
-#else
-	if (verbose >= 2)
-#endif
-	mbsys_reson7k_print_configuration(verbose, configuration, error);
-
-	/* figure out size of output record */
-	*size = MBSYS_RESON7K_RECORDHEADER_SIZE + MBSYS_RESON7K_RECORDTAIL_SIZE;
-	*size += R7KHDRSIZE_7kConfiguration;
-	for (i=0;i<configuration->number_devices;i++)
-		{
-		*size += 80;
-		device = &(configuration->device[i]);
-		*size += device->info_length;
-		}
-
-	/* allocate memory to write rest of record if necessary */
-	if (*bufferalloc < *size)
-		{
-		status = mb_reallocd(verbose, __FILE__, __LINE__, *size,
-					(void **)bufferptr, error);
-		if (status != MB_SUCCESS)
-			{
-			*bufferalloc = 0;
-			}
-		else
-			{
-			*bufferalloc = *size;
-			}
-		}
-
-	/* proceed to write if buffer allocated */
-	if (status == MB_SUCCESS)
-		{
-		/* get buffer for writing */
-		buffer = (char *) *bufferptr;
-
-		/* insert the header */
-		index = 0;
-		status = mbr_reson7kr_wr_header(verbose, buffer, &index, header, error);
-
-		/* insert the data */
-		index = header->Offset + 4;
-		mb_put_binary_long(MB_YES, configuration->serial_number, &buffer[index]); index += 8;
-		mb_put_binary_int(MB_YES, configuration->number_devices, &buffer[index]); index += 4;
-
-		/* extract the data for each device */
-		for (i=0;i<configuration->number_devices;i++)
-			{
-			device = &(configuration->device[i]);
-			mb_put_binary_int(MB_YES, device->magic_number, &buffer[index]); index += 4;
-			for (j=0;j<64;j++)
-				{
-				buffer[index] = device->description[j]; index++;
-				}
-			mb_put_binary_long(MB_YES, device->serial_number, &buffer[index]); index += 8;
-			mb_put_binary_int(MB_YES, device->info_length, &buffer[index]); index += 4;
-
-			for (j=0;j<device->info_length;j++)
-				{
-				buffer[index] = device->info[j]; index++;
-				}
-			}
-
-		/* reset the header size value */
-		mb_put_binary_int(MB_YES, ((unsigned int)(index + 4)), &buffer[8]);
-
-		/* now add the checksum */
-		checksum = 0;
-		for (i=0;i<index;i++)
-			checksum += (unsigned char) buffer[i];
-		mb_put_binary_int(MB_YES, checksum, &buffer[index]); index += 4;
-
-		/* check size */
-		if (*size != index)
-			{
-fprintf(stderr,"Bad size comparison: file:%s line:%d size:%d index:%d\n", __FILE__, __LINE__, *size, index);
-			status = MB_FAILURE;
-			*error = MB_ERROR_BAD_DATA;
-			*size = 0;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       bufferalloc:%d\n",*bufferalloc);
-		fprintf(stderr,"dbg2       size:       %d\n",*size);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_wr_matchfilter(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error)
-{
-	char	*function_name = "mbr_reson7kr_wr_matchfilter";
-	int	status = MB_SUCCESS;
-	struct mbsys_reson7k_struct *store;
-	s7k_header *header;
-	s7kr_matchfilter *matchfilter;
-	unsigned int checksum;
-	int	index;
-	char	*buffer;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       bufferalloc:%d\n",*bufferalloc);
-		fprintf(stderr,"dbg2       bufferptr:  %p\n",(void *)bufferptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	matchfilter = &(store->matchfilter);
-	header = &(matchfilter->header);
-
-	/* print out the data to be output */
-#ifdef MBR_RESON7KR_DEBUG
-	if (verbose > 0)
-#else
-	if (verbose >= 2)
-#endif
-	mbsys_reson7k_print_matchfilter(verbose, matchfilter, error);
-
-	/* figure out size of output record */
-	*size = MBSYS_RESON7K_RECORDHEADER_SIZE + MBSYS_RESON7K_RECORDTAIL_SIZE;
-	*size += R7KHDRSIZE_7kMatchFilter;
-
-	/* allocate memory to write rest of record if necessary */
-	if (*bufferalloc < *size)
-		{
-		status = mb_reallocd(verbose, __FILE__, __LINE__, *size,
-					(void **)bufferptr, error);
-		if (status != MB_SUCCESS)
-			{
-			*bufferalloc = 0;
-			}
-		else
-			{
-			*bufferalloc = *size;
-			}
-		}
-
-	/* proceed to write if buffer allocated */
-	if (status == MB_SUCCESS)
-		{
-		/* get buffer for writing */
-		buffer = (char *) *bufferptr;
-
-		/* insert the header */
-		index = 0;
-		status = mbr_reson7kr_wr_header(verbose, buffer, &index, header, error);
-
-		/* insert the data */
-		index = header->Offset + 4;
-		mb_put_binary_long(MB_YES, matchfilter->serial_number, &buffer[index]); index += 8;
-		mb_put_binary_int(MB_YES, matchfilter->ping_number, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, matchfilter->operation, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, matchfilter->start_frequency, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, matchfilter->end_frequency, &buffer[index]); index += 4;
-
-		/* reset the header size value */
-		mb_put_binary_int(MB_YES, ((unsigned int)(index + 4)), &buffer[8]);
-
-		/* now add the checksum */
-		checksum = 0;
-		for (i=0;i<index;i++)
-			checksum += (unsigned char) buffer[i];
-		mb_put_binary_int(MB_YES, checksum, &buffer[index]); index += 4;
-
-		/* check size */
-		if (*size != index)
-			{
-fprintf(stderr,"Bad size comparison: file:%s line:%d size:%d index:%d\n", __FILE__, __LINE__, *size, index);
-			status = MB_FAILURE;
-			*error = MB_ERROR_BAD_DATA;
-			*size = 0;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       bufferalloc:%d\n",*bufferalloc);
-		fprintf(stderr,"dbg2       size:       %d\n",*size);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_wr_v2firmwarehardwareconfiguration(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error)
-{
-	char	*function_name = "mbr_reson7kr_wr_v2firmwarehardwareconfiguration";
-	int	status = MB_SUCCESS;
-	struct mbsys_reson7k_struct *store;
-	s7k_header *header;
-	s7kr_v2firmwarehardwareconfiguration *v2firmwarehardwareconfiguration;
-	unsigned int checksum;
-	int	index;
-	char	*buffer;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       bufferalloc:%d\n",*bufferalloc);
-		fprintf(stderr,"dbg2       bufferptr:  %p\n",(void *)bufferptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	v2firmwarehardwareconfiguration = &(store->v2firmwarehardwareconfiguration);
-	header = &(v2firmwarehardwareconfiguration->header);
-
-	/* print out the data to be output */
-#ifdef MBR_RESON7KR_DEBUG
-	if (verbose > 0)
-#else
-	if (verbose >= 2)
-#endif
-	mbsys_reson7k_print_v2firmwarehardwareconfiguration(verbose, v2firmwarehardwareconfiguration, error);
-
-	/* figure out size of output record */
-	*size = MBSYS_RESON7K_RECORDHEADER_SIZE + MBSYS_RESON7K_RECORDTAIL_SIZE;
-	*size += R7KHDRSIZE_7kV2FirmwareHardwareConfiguration;
-	*size += v2firmwarehardwareconfiguration->info_length;
-
-	/* allocate memory to write rest of record if necessary */
-	if (*bufferalloc < *size)
-		{
-		status = mb_reallocd(verbose, __FILE__, __LINE__, *size,
-					(void **)bufferptr, error);
-		if (status != MB_SUCCESS)
-			{
-			*bufferalloc = 0;
-			}
-		else
-			{
-			*bufferalloc = *size;
-			}
-		}
-
-	/* proceed to write if buffer allocated */
-	if (status == MB_SUCCESS)
-		{
-		/* get buffer for writing */
-		buffer = (char *) *bufferptr;
-
-		/* insert the header */
-		index = 0;
-		status = mbr_reson7kr_wr_header(verbose, buffer, &index, header, error);
-
-		/* insert the data */
-		index = header->Offset + 4;
-		mb_put_binary_int(MB_YES, v2firmwarehardwareconfiguration->device_count, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, v2firmwarehardwareconfiguration->info_length, &buffer[index]); index += 4;
-
-		/* extract the info */
-		for (i=0;i<v2firmwarehardwareconfiguration->info_length;i++)
-			{
-			buffer[index] = v2firmwarehardwareconfiguration->info[i]; index++;
-			}
-
-		/* reset the header size value */
-		mb_put_binary_int(MB_YES, ((unsigned int)(index + 4)), &buffer[8]);
-
-		/* now add the checksum */
-		checksum = 0;
-		for (i=0;i<index;i++)
-			checksum += (unsigned char) buffer[i];
-		mb_put_binary_int(MB_YES, checksum, &buffer[index]); index += 4;
-
-		/* check size */
-		if (*size != index)
-			{
-fprintf(stderr,"Bad size comparison: file:%s line:%d size:%d index:%d\n", __FILE__, __LINE__, *size, index);
-			status = MB_FAILURE;
-			*error = MB_ERROR_BAD_DATA;
-			*size = 0;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       bufferalloc:%d\n",*bufferalloc);
-		fprintf(stderr,"dbg2       size:       %d\n",*size);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_wr_beamgeometry(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error)
-{
-	char	*function_name = "mbr_reson7kr_wr_beamgeometry";
-	int	status = MB_SUCCESS;
-	struct mbsys_reson7k_struct *store;
-	s7k_header *header;
-	s7kr_beamgeometry *beamgeometry;
-	unsigned int checksum;
-	int	index;
-	char	*buffer;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       bufferalloc:%d\n",*bufferalloc);
-		fprintf(stderr,"dbg2       bufferptr:  %p\n",(void *)bufferptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	beamgeometry = &(store->beamgeometry);
-	header = &(beamgeometry->header);
-
-	/* print out the data to be output */
-#ifdef MBR_RESON7KR_DEBUG
-	if (verbose > 0)
-#else
-	if (verbose >= 2)
-#endif
-	mbsys_reson7k_print_beamgeometry(verbose, beamgeometry, error);
-
-	/* figure out size of output record */
-	*size = MBSYS_RESON7K_RECORDHEADER_SIZE + MBSYS_RESON7K_RECORDTAIL_SIZE;
-	*size += R7KHDRSIZE_7kBeamGeometry;
-	*size += beamgeometry->number_beams * 16;
-
-	/* allocate memory to write rest of record if necessary */
-	if (*bufferalloc < *size)
-		{
-		status = mb_reallocd(verbose, __FILE__, __LINE__, *size,
-					(void **)bufferptr, error);
-		if (status != MB_SUCCESS)
-			{
-			*bufferalloc = 0;
-			}
-		else
-			{
-			*bufferalloc = *size;
-			}
-		}
-
-	/* proceed to write if buffer allocated */
-	if (status == MB_SUCCESS)
-		{
-		/* get buffer for writing */
-		buffer = (char *) *bufferptr;
-
-		/* insert the header */
-		index = 0;
-		status = mbr_reson7kr_wr_header(verbose, buffer, &index, header, error);
-
-		/* insert the data */
-		index = header->Offset + 4;
-		mb_put_binary_long(MB_YES, beamgeometry->serial_number, &buffer[index]); index += 8;
-		mb_put_binary_int(MB_YES, beamgeometry->number_beams, &buffer[index]); index += 4;
-
-		/* insert the data */
-		for (i=0;i<beamgeometry->number_beams;i++)
-			{
-			mb_put_binary_float(MB_YES, beamgeometry->angle_alongtrack[i], &buffer[index]); index += 4;
-			}
-		for (i=0;i<beamgeometry->number_beams;i++)
-			{
-			mb_put_binary_float(MB_YES, beamgeometry->angle_acrosstrack[i], &buffer[index]); index += 4;
-			}
-		for (i=0;i<beamgeometry->number_beams;i++)
-			{
-			mb_put_binary_float(MB_YES, beamgeometry->beamwidth_alongtrack[i], &buffer[index]); index += 4;
-			}
-		for (i=0;i<beamgeometry->number_beams;i++)
-			{
-			mb_put_binary_float(MB_YES, beamgeometry->beamwidth_acrosstrack[i], &buffer[index]); index += 4;
-			}
-
-		/* reset the header size value */
-		mb_put_binary_int(MB_YES, ((unsigned int)(index + 4)), &buffer[8]);
-
-		/* now add the checksum */
-		checksum = 0;
-		for (i=0;i<index;i++)
-			checksum += (unsigned char) buffer[i];
-		mb_put_binary_int(MB_YES, checksum, &buffer[index]); index += 4;
-
-		/* check size */
-		if (*size != index)
-			{
-fprintf(stderr,"Bad size comparison: file:%s line:%d size:%d index:%d\n", __FILE__, __LINE__, *size, index);
-			status = MB_FAILURE;
-			*error = MB_ERROR_BAD_DATA;
-			*size = 0;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       bufferalloc:%d\n",*bufferalloc);
-		fprintf(stderr,"dbg2       size:       %d\n",*size);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_wr_calibration(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error)
-{
-	char	*function_name = "mbr_reson7kr_wr_calibration";
-	int	status = MB_SUCCESS;
-	struct mbsys_reson7k_struct *store;
-	s7k_header *header;
-	s7kr_calibration *calibration;
-	unsigned int checksum;
-	int	index;
-	char	*buffer;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       bufferalloc:%d\n",*bufferalloc);
-		fprintf(stderr,"dbg2       bufferptr:  %p\n",(void *)bufferptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	calibration = &(store->calibration);
-	header = &(calibration->header);
-
-	/* print out the data to be output */
-#ifdef MBR_RESON7KR_DEBUG
-	if (verbose > 0)
-#else
-	if (verbose >= 2)
-#endif
-	mbsys_reson7k_print_calibration(verbose, calibration, error);
-
-	/* figure out size of output record */
-	*size = MBSYS_RESON7K_RECORDHEADER_SIZE + MBSYS_RESON7K_RECORDTAIL_SIZE;
-	*size += R7KHDRSIZE_7kCalibrationData;
-	*size += calibration->number_channels * 8;
-
-	/* allocate memory to write rest of record if necessary */
-	if (*bufferalloc < *size)
-		{
-		status = mb_reallocd(verbose, __FILE__, __LINE__, *size,
-					(void **)bufferptr, error);
-		if (status != MB_SUCCESS)
-			{
-			*bufferalloc = 0;
-			}
-		else
-			{
-			*bufferalloc = *size;
-			}
-		}
-
-	/* proceed to write if buffer allocated */
-	if (status == MB_SUCCESS)
-		{
-		/* get buffer for writing */
-		buffer = (char *) *bufferptr;
-
-		/* insert the header */
-		index = 0;
-		status = mbr_reson7kr_wr_header(verbose, buffer, &index, header, error);
-
-		/* insert the data */
-		index = header->Offset + 4;
-		mb_put_binary_long(MB_YES, calibration->serial_number, &buffer[index]); index += 8;
-		mb_put_binary_short(MB_YES, calibration->number_channels, &buffer[index]); index += 2;
-
-		/* insert the data */
-		for (i=0;i<calibration->number_channels;i++)
-			{
-			mb_put_binary_float(MB_YES, calibration->gain[i], &buffer[index]); index += 4;
-			}
-		for (i=0;i<calibration->number_channels;i++)
-			{
-			mb_put_binary_float(MB_YES, calibration->phase[i], &buffer[index]); index += 4;
-			}
-
-		/* reset the header size value */
-		mb_put_binary_int(MB_YES, ((unsigned int)(index + 4)), &buffer[8]);
-
-		/* now add the checksum */
-		checksum = 0;
-		for (i=0;i<index;i++)
-			checksum += (unsigned char) buffer[i];
-		mb_put_binary_int(MB_YES, checksum, &buffer[index]); index += 4;
-
-		/* check size */
-		if (*size != index)
-			{
-fprintf(stderr,"Bad size comparison: file:%s line:%d size:%d index:%d\n", __FILE__, __LINE__, *size, index);
-			status = MB_FAILURE;
-			*error = MB_ERROR_BAD_DATA;
-			*size = 0;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       bufferalloc:%d\n",*bufferalloc);
-		fprintf(stderr,"dbg2       size:       %d\n",*size);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_wr_bathymetry(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error)
-{
-	char	*function_name = "mbr_reson7kr_wr_bathymetry";
-	int	status = MB_SUCCESS;
-	struct mbsys_reson7k_struct *store;
-	s7k_header *header;
-	s7kr_bathymetry *bathymetry;
-	unsigned int checksum;
-	int	index;
-	char	*buffer;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       bufferalloc:%d\n",*bufferalloc);
-		fprintf(stderr,"dbg2       bufferptr:  %p\n",(void *)bufferptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	bathymetry = &(store->bathymetry);
-	header = &(bathymetry->header);
-
-	/* figure out size of output record */
-	*size = MBSYS_RESON7K_RECORDHEADER_SIZE + MBSYS_RESON7K_RECORDTAIL_SIZE;
-	*size += R7KHDRSIZE_7kBathymetricData;
-	*size += bathymetry->number_beams * 17;
-	if (bathymetry->optionaldata == MB_YES)
-		{
-		*size += 45 + bathymetry->number_beams * 20;
-		header->OffsetToOptionalData = MBSYS_RESON7K_RECORDHEADER_SIZE
-								+ R7KHDRSIZE_7kBathymetricData
-								+ bathymetry->number_beams * 17;
-		}
-	else
-		header->OffsetToOptionalData = 0;
-	header->Size = *size;
-
-	/* print out the data to be output */
-#ifdef MBR_RESON7KR_DEBUG
-	if (verbose > 0)
-#else
-	if (verbose >= 2)
-#endif
-	mbsys_reson7k_print_bathymetry(verbose, bathymetry, error);
-
-	/* allocate memory to write rest of record if necessary */
-	if (*bufferalloc < *size)
-		{
-		status = mb_reallocd(verbose, __FILE__, __LINE__, *size,
-					(void **)bufferptr, error);
-		if (status != MB_SUCCESS)
-			{
-			*bufferalloc = 0;
-			}
-		else
-			{
-			*bufferalloc = *size;
-			}
-		}
-
-	/* proceed to write if buffer allocated */
-	if (status == MB_SUCCESS)
-		{
-		/* get buffer for writing */
-		buffer = (char *) *bufferptr;
-
-		/* make sure the version number is right */
-		if (header->Version < 5)
-			header->Version = 5;
-
-		/* insert the header */
-		index = 0;
-		status = mbr_reson7kr_wr_header(verbose, buffer, &index, header, error);
-
-		/* insert the data */
-		index = header->Offset + 4;
-		mb_put_binary_long(MB_YES, bathymetry->serial_number, &buffer[index]); index += 8;
-		mb_put_binary_int(MB_YES, bathymetry->ping_number, &buffer[index]); index += 4;
-		mb_put_binary_short(MB_YES, bathymetry->multi_ping, &buffer[index]); index += 2;
-		mb_put_binary_int(MB_YES, bathymetry->number_beams, &buffer[index]); index += 4;
-		buffer[index] = bathymetry->layer_comp_flag; index++;
-		buffer[index] = bathymetry->sound_vel_flag; index++;
-		mb_put_binary_float(MB_YES, bathymetry->sound_velocity, &buffer[index]); index += 4;
-
-		/* insert the data */
-		for (i=0;i<bathymetry->number_beams;i++)
-			{
-			mb_put_binary_float(MB_YES, bathymetry->range[i], &buffer[index]); index += 4;
-			}
-		for (i=0;i<bathymetry->number_beams;i++)
-			{
-			buffer[index] = bathymetry->quality[i]; index++;
-			}
-		for (i=0;i<bathymetry->number_beams;i++)
-			{
-			mb_put_binary_float(MB_YES, bathymetry->intensity[i], &buffer[index]); index += 4;
-			}
-		for (i=0;i<bathymetry->number_beams;i++)
-			{
-			mb_put_binary_float(MB_YES, bathymetry->min_depth_gate[i], &buffer[index]); index += 4;
-			}
-		for (i=0;i<bathymetry->number_beams;i++)
-			{
-			mb_put_binary_float(MB_YES, bathymetry->max_depth_gate[i], &buffer[index]); index += 4;
-			}
-
-		/* insert the optional data */
-		if (bathymetry->optionaldata == MB_YES)
-			{
-			mb_put_binary_float(MB_YES, bathymetry->frequency, &buffer[index]); index += 4;
-			mb_put_binary_double(MB_YES, bathymetry->latitude, &buffer[index]); index += 8;
-			mb_put_binary_double(MB_YES, bathymetry->longitude, &buffer[index]); index += 8;
-			mb_put_binary_float(MB_YES, bathymetry->heading, &buffer[index]); index += 4;
-			buffer[index] = bathymetry->height_source; index++;
-			mb_put_binary_float(MB_YES, bathymetry->tide, &buffer[index]); index += 4;
-			mb_put_binary_float(MB_YES, bathymetry->roll, &buffer[index]); index += 4;
-			mb_put_binary_float(MB_YES, bathymetry->pitch, &buffer[index]); index += 4;
-			mb_put_binary_float(MB_YES, bathymetry->heave, &buffer[index]); index += 4;
-			mb_put_binary_float(MB_YES, bathymetry->vehicle_height, &buffer[index]); index += 4;
-			for (i=0;i<bathymetry->number_beams;i++)
-				{
-				mb_put_binary_float(MB_YES, bathymetry->depth[i], &buffer[index]); index += 4;
-				mb_put_binary_float(MB_YES, bathymetry->alongtrack[i], &buffer[index]); index += 4;
-				mb_put_binary_float(MB_YES, bathymetry->acrosstrack[i], &buffer[index]); index += 4;
-				mb_put_binary_float(MB_YES, bathymetry->pointing_angle[i], &buffer[index]); index += 4;
-				mb_put_binary_float(MB_YES, bathymetry->azimuth_angle[i], &buffer[index]); index += 4;
-				}
-			}
-
-		/* reset the header size value */
-		mb_put_binary_int(MB_YES, ((unsigned int)(index + 4)), &buffer[8]);
-
-		/* now add the checksum */
-		checksum = 0;
-		for (i=0;i<index;i++)
-			checksum += (unsigned char) buffer[i];
-		mb_put_binary_int(MB_YES, checksum, &buffer[index]); index += 4;
-
-		/* check size */
-		if (*size != index)
-			{
-fprintf(stderr,"Bad size comparison: file:%s line:%d size:%d index:%d\n", __FILE__, __LINE__, *size, index);
-			status = MB_FAILURE;
-			*error = MB_ERROR_BAD_DATA;
-			*size = 0;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       bufferalloc:%d\n",*bufferalloc);
-		fprintf(stderr,"dbg2       size:       %d\n",*size);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_wr_backscatter(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error)
-{
-	char	*function_name = "mbr_reson7kr_wr_backscatter";
-	int	status = MB_SUCCESS;
-	struct mbsys_reson7k_struct *store;
-	s7k_header *header;
-	s7kr_backscatter *backscatter;
-	int	data_size;
-	unsigned int checksum;
-	int	index;
-	char	*buffer;
-	short	*short_ptr;
-	int	*int_ptr;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       bufferalloc:%d\n",*bufferalloc);
-		fprintf(stderr,"dbg2       bufferptr:  %p\n",(void *)bufferptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	backscatter = &(store->backscatter);
-	header = &(backscatter->header);
-
-	/* print out the data to be output */
-#ifdef MBR_RESON7KR_DEBUG
-	if (verbose > 0)
-#else
-	if (verbose >= 2)
-#endif
-	mbsys_reson7k_print_backscatter(verbose, backscatter, error);
-
-	/* figure out size of output record */
-	*size = MBSYS_RESON7K_RECORDHEADER_SIZE + MBSYS_RESON7K_RECORDTAIL_SIZE;
-	*size += R7KHDRSIZE_7kBackscatterImageData;
-	*size += 2 * backscatter->number_samples * backscatter->sample_size;
-	if (header->OffsetToOptionalData > 0)
-		{
-		*size += 28;
-		}
-
-	/* allocate memory to write rest of record if necessary */
-	if (*bufferalloc < *size)
-		{
-		status = mb_reallocd(verbose, __FILE__, __LINE__, *size,
-					(void **)bufferptr, error);
-		if (status != MB_SUCCESS)
-			{
-			*bufferalloc = 0;
-			}
-		else
-			{
-			*bufferalloc = *size;
-			}
-		}
-
-	/* proceed to write if buffer allocated */
-	if (status == MB_SUCCESS)
-		{
-		/* get buffer for writing */
-		buffer = (char *) *bufferptr;
-
-		/* insert the header */
-		index = 0;
-		status = mbr_reson7kr_wr_header(verbose, buffer, &index, header, error);
-
-		/* insert the data */
-		index = header->Offset + 4;
-		mb_put_binary_long(MB_YES, backscatter->serial_number, &buffer[index]); index += 8;
-		mb_put_binary_int(MB_YES, backscatter->ping_number, &buffer[index]); index += 4;
-		mb_put_binary_short(MB_YES, backscatter->multi_ping, &buffer[index]); index += 2;
-		mb_put_binary_float(MB_YES, backscatter->beam_position, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, backscatter->control_flags, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, backscatter->number_samples, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, backscatter->port_beamwidth_x, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, backscatter->port_beamwidth_y, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, backscatter->stbd_beamwidth_x, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, backscatter->stbd_beamwidth_y, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, backscatter->port_steering_x, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, backscatter->port_steering_y, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, backscatter->stbd_steering_x, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, backscatter->stbd_steering_y, &buffer[index]); index += 4;
-		mb_put_binary_short(MB_YES, backscatter->number_beams, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, backscatter->current_beam, &buffer[index]); index += 2;
-		buffer[index] = backscatter->sample_size; index++;
-		buffer[index] = backscatter->data_type; index++;
-
-		/* allocate memory if required */
-		data_size = backscatter->number_samples * backscatter->sample_size;
-		if (backscatter->nalloc < data_size)
-			{
-			status = mb_reallocd(verbose, __FILE__, __LINE__, data_size, (void **)&(backscatter->port_data), error);
-			if (status == MB_SUCCESS)
-			status = mb_reallocd(verbose, __FILE__, __LINE__, data_size, (void **)&(backscatter->stbd_data), error);
-			if (status == MB_SUCCESS)
-				{
-				backscatter->nalloc = data_size;
-				}
-			else
-				{
-				backscatter->nalloc = 0;
-				backscatter->number_samples = 0;
-				}
-			}
-
-		/* extract backscatter data */
-		if (backscatter->sample_size == 1)
-			{
-			for (i=0;i<backscatter->number_samples;i++)
-				{
-				buffer[index] = backscatter->port_data[i]; index++;
-				}
-			for (i=0;i<backscatter->number_samples;i++)
-				{
-				buffer[index] = backscatter->stbd_data[i]; index++;
-				}
-			}
-		else if (backscatter->sample_size == 2)
-			{
-			short_ptr = (short *) backscatter->port_data;
-			for (i=0;i<backscatter->number_samples;i++)
-				{
-				mb_put_binary_short(MB_YES, short_ptr[i], &buffer[index]); index += 2;
-				}
-			short_ptr = (short *) backscatter->stbd_data;
-			for (i=0;i<backscatter->number_samples;i++)
-				{
-				mb_put_binary_short(MB_YES, short_ptr[i], &buffer[index]); index += 2;
-				}
-			}
-		else if (backscatter->sample_size == 4)
-			{
-			int_ptr = (int *) backscatter->port_data;
-			for (i=0;i<backscatter->number_samples;i++)
-				{
-				mb_put_binary_int(MB_YES, int_ptr[i], &buffer[index]); index += 4;
-				}
-			int_ptr = (int *) backscatter->stbd_data;
-			for (i=0;i<backscatter->number_samples;i++)
-				{
-				mb_put_binary_int(MB_YES, int_ptr[i], &buffer[index]); index += 4;
-				}
-			}
-
-		/* extract the optional data */
-		if (header->OffsetToOptionalData > 0)
-			{
-			index = header->OffsetToOptionalData;
-			backscatter->optionaldata = MB_YES;
-			mb_put_binary_float(MB_YES, backscatter->frequency, &buffer[index]); index += 4;
-			mb_put_binary_double(MB_YES, backscatter->latitude, &buffer[index]); index += 8;
-			mb_put_binary_double(MB_YES, backscatter->longitude, &buffer[index]); index += 8;
-			mb_put_binary_float(MB_YES, backscatter->heading, &buffer[index]); index += 4;
-			mb_put_binary_float(MB_YES, backscatter->altitude, &buffer[index]); index += 4;
-			}
-		else
-			{
-			backscatter->optionaldata = MB_NO;
-			backscatter->frequency = 0.0;
-			backscatter->latitude = 0.0;
-			backscatter->longitude = 0.0;
-			backscatter->heading = 0.0;
-			backscatter->altitude = 0.0;
-			}
-
-		/* reset the header size value */
-		mb_put_binary_int(MB_YES, ((unsigned int)(index + 4)), &buffer[8]);
-
-		/* now add the checksum */
-		checksum = 0;
-		for (i=0;i<index;i++)
-			checksum += (unsigned char) buffer[i];
-		mb_put_binary_int(MB_YES, checksum, &buffer[index]); index += 4;
-
-		/* check size */
-		if (*size != index)
-			{
-fprintf(stderr,"Bad size comparison: file:%s line:%d size:%d index:%d\n", __FILE__, __LINE__, *size, index);
-			status = MB_FAILURE;
-			*error = MB_ERROR_BAD_DATA;
-			*size = 0;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       bufferalloc:%d\n",*bufferalloc);
-		fprintf(stderr,"dbg2       size:       %d\n",*size);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_wr_beam(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error)
-{
-	char	*function_name = "mbr_reson7kr_wr_beam";
-	int	status = MB_SUCCESS;
-	struct mbsys_reson7k_struct *store;
-	s7k_header *header;
-	s7kr_beam *beam;
-	s7kr_snippet *snippet;
-	unsigned int checksum;
-	int	index;
-	char	*buffer;
-	int	nsamples;
-	int	sample_type_amp;
-	int	sample_type_phase;
-	int	sample_type_iandq;
-	int	sample_size;
-	char	*charptr;
-	unsigned short 	*ushortptr;
-	unsigned int	*uintptr;
-	short	*shortptramp;
-	short	*shortptrphase;
-	int	*intptramp;
-	int	*intptrphase;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       bufferalloc:%d\n",*bufferalloc);
-		fprintf(stderr,"dbg2       bufferptr:  %p\n",(void *)bufferptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	beam = &(store->beam);
-	header = &(beam->header);
-
-	/* print out the data to be output */
-#ifdef MBR_RESON7KR_DEBUG
-	if (verbose > 0)
-#else
-	if (verbose >= 2)
-#endif
-	mbsys_reson7k_print_beam(verbose, beam, error);
-
-	/* figure out size of output record */
-	*size = MBSYS_RESON7K_RECORDHEADER_SIZE + MBSYS_RESON7K_RECORDTAIL_SIZE;
-	*size += R7KHDRSIZE_7kBeamData;
-	sample_type_amp = beam->sample_type & 15;
-	sample_type_phase = (beam->sample_type >> 4) & 15;
-	sample_type_iandq = (beam->sample_type >> 8) & 15;
-	sample_size = 0;
-	if (sample_type_amp == 1)
-		sample_size += 1;
-	else if (sample_type_amp == 2)
-		sample_size += 2;
-	else if (sample_type_amp == 3)
-		sample_size += 4;
-	if (sample_type_phase == 1)
-		sample_size += 1;
-	else if (sample_type_phase == 2)
-		sample_size += 2;
-	else if (sample_type_phase == 3)
-		sample_size += 4;
-	if (sample_type_iandq == 1)
-		sample_size += 4;
-	else if (sample_type_iandq == 2)
-		sample_size += 8;
-	for (i=0;i<beam->number_beams;i++)
-		{
-		snippet = &beam->snippets[i];
-		*size += 10 + sample_size * (snippet->end_sample - snippet->begin_sample + 1);
-		}
-	if (header->OffsetToOptionalData > 0)
-		{
-		*size += 24 + beam->number_beams * 12;
-		}
-
-	/* allocate memory to write rest of record if necessary */
-	if (*bufferalloc < *size)
-		{
-		status = mb_reallocd(verbose, __FILE__, __LINE__, *size,
-					(void **)bufferptr, error);
-		if (status != MB_SUCCESS)
-			{
-			*bufferalloc = 0;
-			}
-		else
-			{
-			*bufferalloc = *size;
-			}
-		}
-
-	/* proceed to write if buffer allocated */
-	if (status == MB_SUCCESS)
-		{
-		/* get buffer for writing */
-		buffer = (char *) *bufferptr;
-
-		/* insert the header */
-		index = 0;
-		status = mbr_reson7kr_wr_header(verbose, buffer, &index, header, error);
-
-		/* insert the data */
-		index = header->Offset + 4;
-		mb_put_binary_long(MB_YES, beam->serial_number, &buffer[index]); index += 8;
-		mb_put_binary_int(MB_YES, beam->ping_number, &buffer[index]); index += 4;
-		mb_put_binary_short(MB_YES, beam->multi_ping, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, beam->number_beams, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, beam->reserved, &buffer[index]); index += 2;
-		mb_put_binary_int(MB_YES, beam->number_samples, &buffer[index]); index += 4;
-		buffer[index] = beam->record_subset_flag; index++;
-		buffer[index] = beam->row_column_flag; index++;
-		mb_put_binary_short(MB_YES, beam->sample_header_id, &buffer[index]); index += 2;
-		mb_put_binary_int(MB_YES, beam->sample_type, &buffer[index]); index += 4;
-		for (i=0;i<beam->number_beams;i++)
-			{
-			snippet = &beam->snippets[i];
-			mb_put_binary_short(MB_YES, snippet->beam_number, &buffer[index]); index += 2;
-			mb_put_binary_int(MB_YES, snippet->begin_sample, &buffer[index]); index += 4;
-			mb_put_binary_int(MB_YES, snippet->end_sample, &buffer[index]); index += 4;
-			}
-
-		for (i=0;i<beam->number_beams;i++)
-			{
-			/* extract snippet or beam data data */
-			if (status == MB_SUCCESS)
-				{
-				nsamples = snippet->end_sample - snippet->begin_sample + 1;
-				for (j=0;j<nsamples;j++)
-					{
-					if (sample_type_amp == 1)
-						{
-						charptr = (char *)snippet->amplitude;
-						buffer[index] = charptr[j]; index++;
-						}
-					else if (sample_type_amp == 2)
-						{
-						ushortptr = (unsigned short *)snippet->amplitude;
-						mb_put_binary_short(MB_YES, ushortptr[j], &buffer[index]); index += 2;
-						}
-					else if (sample_type_amp == 3)
-						{
-						uintptr = (unsigned int *)snippet->amplitude;
-						mb_put_binary_int(MB_YES, uintptr[j], &buffer[index]); index += 4;
-						}
-					if (sample_type_phase == 1)
-						{
-						charptr = (char *)snippet->phase;
-						buffer[index] = charptr[j]; index++;
-						}
-					else if (sample_type_phase == 2)
-						{
-						ushortptr = (unsigned short *)snippet->phase;
-						mb_put_binary_short(MB_YES, ushortptr[j], &buffer[index]); index += 2;
-						}
-					else if (sample_type_phase == 3)
-						{
-						uintptr = (unsigned int *)snippet->phase;
-						mb_put_binary_int(MB_YES, uintptr[j], &buffer[index]); index += 4;
-						}
-					if (sample_type_iandq == 1)
-						{
-						shortptramp = (short *)snippet->amplitude;
-						shortptrphase = (short *)snippet->phase;
-						mb_put_binary_short(MB_YES, shortptramp[j], &buffer[index]); index += 2;
-						mb_put_binary_short(MB_YES, shortptrphase[j], &buffer[index]); index += 2;
-						}
-					else if (sample_type_iandq == 2)
-						{
-						intptramp = (int *)snippet->amplitude;
-						intptrphase = (int *)snippet->phase;
-						mb_put_binary_int(MB_YES, intptramp[j], &buffer[index]); index += 4;
-						mb_put_binary_int(MB_YES, intptrphase[j], &buffer[index]); index += 4;
-						}
-					}
-				}
-			}
-
-		/* reset the header size value */
-		mb_put_binary_int(MB_YES, ((unsigned int)(index + 4)), &buffer[8]);
-
-		/* now add the checksum */
-		checksum = 0;
-		for (i=0;i<index;i++)
-			checksum += (unsigned char) buffer[i];
-		mb_put_binary_int(MB_YES, checksum, &buffer[index]); index += 4;
-
-		/* check size */
-		if (*size != index)
-			{
-fprintf(stderr,"Bad size comparison: file:%s line:%d size:%d index:%d\n", __FILE__, __LINE__, *size, index);
-			status = MB_FAILURE;
-			*error = MB_ERROR_BAD_DATA;
-			*size = 0;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       bufferalloc:%d\n",*bufferalloc);
-		fprintf(stderr,"dbg2       size:       %d\n",*size);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_wr_verticaldepth(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error)
-{
-	char	*function_name = "mbr_reson7kr_wr_verticaldepth";
-	int	status = MB_SUCCESS;
-	struct mbsys_reson7k_struct *store;
-	s7k_header *header;
-	s7kr_verticaldepth *verticaldepth;
-	unsigned int checksum;
-	int	index;
-	char	*buffer;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       bufferalloc:%d\n",*bufferalloc);
-		fprintf(stderr,"dbg2       bufferptr:  %p\n",(void *)bufferptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	verticaldepth = &(store->verticaldepth);
-	header = &(verticaldepth->header);
-
-	/* print out the data to be output */
-#ifdef MBR_RESON7KR_DEBUG
-	if (verbose > 0)
-#else
-	if (verbose >= 2)
-#endif
-	mbsys_reson7k_print_verticaldepth(verbose, verticaldepth, error);
-
-	/* figure out size of output record */
-	*size = MBSYS_RESON7K_RECORDHEADER_SIZE + MBSYS_RESON7K_RECORDTAIL_SIZE;
-	*size += R7KHDRSIZE_7kVerticalDepth;
-
-	/* allocate memory to write rest of record if necessary */
-	if (*bufferalloc < *size)
-		{
-		status = mb_reallocd(verbose, __FILE__, __LINE__, *size,
-					(void **)bufferptr, error);
-		if (status != MB_SUCCESS)
-			{
-			*bufferalloc = 0;
-			}
-		else
-			{
-			*bufferalloc = *size;
-			}
-		}
-
-	/* proceed to write if buffer allocated */
-	if (status == MB_SUCCESS)
-		{
-		/* get buffer for writing */
-		buffer = (char *) *bufferptr;
-
-		/* insert the header */
-		index = 0;
-		status = mbr_reson7kr_wr_header(verbose, buffer, &index, header, error);
-
-		/* insert the data */
-		index = header->Offset + 4;
-		mb_put_binary_float(MB_YES, verticaldepth->frequency, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, verticaldepth->ping_number, &buffer[index]); index += 4;
-		mb_put_binary_short(MB_YES, verticaldepth->multi_ping, &buffer[index]); index += 2;
-		mb_put_binary_double(MB_YES, verticaldepth->latitude, &buffer[index]); index += 8;
-		mb_put_binary_double(MB_YES, verticaldepth->longitude, &buffer[index]); index += 8;
-		mb_put_binary_float(MB_YES, verticaldepth->heading, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, verticaldepth->alongtrack, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, verticaldepth->acrosstrack, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, verticaldepth->vertical_depth, &buffer[index]); index += 4;
-
-		/* reset the header size value */
-		mb_put_binary_int(MB_YES, ((unsigned int)(index + 4)), &buffer[8]);
-
-		/* now add the checksum */
-		checksum = 0;
-		for (i=0;i<index;i++)
-			checksum += (unsigned char) buffer[i];
-		mb_put_binary_int(MB_YES, checksum, &buffer[index]); index += 4;
-
-		/* check size */
-		if (*size != index)
-			{
-fprintf(stderr,"Bad size comparison: file:%s line:%d size:%d index:%d\n", __FILE__, __LINE__, *size, index);
-			status = MB_FAILURE;
-			*error = MB_ERROR_BAD_DATA;
-			*size = 0;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       bufferalloc:%d\n",*bufferalloc);
-		fprintf(stderr,"dbg2       size:       %d\n",*size);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_wr_tvg(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error)
-{
-	char	*function_name = "mbr_reson7kr_wr_tvg";
-	int	status = MB_SUCCESS;
-	struct mbsys_reson7k_struct *store;
-	s7k_header *header;
-	s7kr_tvg *tvg;
-	unsigned int checksum;
-	int	index;
-	char	*buffer;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       bufferalloc:%d\n",*bufferalloc);
-		fprintf(stderr,"dbg2       bufferptr:  %p\n",(void *)bufferptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	tvg = &(store->tvg);
-	header = &(tvg->header);
-
-	/* print out the data to be output */
-#ifdef MBR_RESON7KR_DEBUG
-	if (verbose > 0)
-#else
-	if (verbose >= 2)
-#endif
-	mbsys_reson7k_print_tvg(verbose, tvg, error);
-
-	/* figure out size of output record */
-	*size = MBSYS_RESON7K_RECORDHEADER_SIZE + MBSYS_RESON7K_RECORDTAIL_SIZE;
-	*size += R7KHDRSIZE_7kTVGData;
-	*size += tvg->n * sizeof(float);
-
-	/* allocate memory to write rest of record if necessary */
-	if (*bufferalloc < *size)
-		{
-		status = mb_reallocd(verbose, __FILE__, __LINE__, *size,
-					(void **)bufferptr, error);
-		if (status != MB_SUCCESS)
-			{
-			*bufferalloc = 0;
-			}
-		else
-			{
-			*bufferalloc = *size;
-			}
-		}
-
-	/* proceed to write if buffer allocated */
-	if (status == MB_SUCCESS)
-		{
-		/* get buffer for writing */
-		buffer = (char *) *bufferptr;
-
-		/* insert the header */
-		index = 0;
-		status = mbr_reson7kr_wr_header(verbose, buffer, &index, header, error);
-
-		/* insert the data */
-		index = header->Offset + 4;
-		mb_put_binary_long(MB_YES, tvg->serial_number, &buffer[index]); index += 8;
-		mb_put_binary_int(MB_YES, tvg->ping_number, &buffer[index]); index += 4;
-		mb_put_binary_short(MB_YES, tvg->multi_ping, &buffer[index]); index += 2;
-		mb_put_binary_int(MB_YES, tvg->n, &buffer[index]); index += 4;
-		for (i=0;i<8;i++)
-			{
-			mb_put_binary_int(MB_YES, tvg->reserved[i], &buffer[index]); index += 4;
-			}
-
-		/* insert tvg data */
-		memcpy((void *)&buffer[index], (const void *)tvg->tvg, (size_t)(tvg->n * sizeof(float)));
-		index += tvg->n * sizeof(float);
-
-		/* reset the header size value */
-		mb_put_binary_int(MB_YES, ((unsigned int)(index + 4)), &buffer[8]);
-
-		/* now add the checksum */
-		checksum = 0;
-		for (i=0;i<index;i++)
-			checksum += (unsigned char) buffer[i];
-		mb_put_binary_int(MB_YES, checksum, &buffer[index]); index += 4;
-
-		/* check size */
-		if (*size != index)
-			{
-fprintf(stderr,"Bad size comparison: file:%s line:%d size:%d index:%d\n", __FILE__, __LINE__, *size, index);
-			status = MB_FAILURE;
-			*error = MB_ERROR_BAD_DATA;
-			*size = 0;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       bufferalloc:%d\n",*bufferalloc);
-		fprintf(stderr,"dbg2       size:       %d\n",*size);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_wr_image(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error)
-{
-	char	*function_name = "mbr_reson7kr_wr_image";
-	int	status = MB_SUCCESS;
-	struct mbsys_reson7k_struct *store;
-	s7k_header *header;
-	s7kr_image *image;
-	unsigned int checksum;
-	int	index;
-	char	*buffer;
-	int	nalloc;
-	char	*charptr;
-	unsigned short 	*ushortptr;
-	unsigned int	*uintptr;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       bufferalloc:%d\n",*bufferalloc);
-		fprintf(stderr,"dbg2       bufferptr:  %p\n",(void *)bufferptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	image = &(store->image);
-	header = &(image->header);
-
-	/* print out the data to be output */
-#ifdef MBR_RESON7KR_DEBUG
-	if (verbose > 0)
-#else
-	if (verbose >= 2)
-#endif
-	mbsys_reson7k_print_image(verbose, image, error);
-
-	/* figure out size of output record */
-	*size = MBSYS_RESON7K_RECORDHEADER_SIZE + MBSYS_RESON7K_RECORDTAIL_SIZE;
-	*size += R7KHDRSIZE_7kImageData;
-	*size += image->width * image->height * image->color_depth;
-
-	/* allocate memory to write rest of record if necessary */
-	if (*bufferalloc < *size)
-		{
-		status = mb_reallocd(verbose, __FILE__, __LINE__, *size,
-					(void **)bufferptr, error);
-		if (status != MB_SUCCESS)
-			{
-			*bufferalloc = 0;
-			}
-		else
-			{
-			*bufferalloc = *size;
-			}
-		}
-
-	/* proceed to write if buffer allocated */
-	if (status == MB_SUCCESS)
-		{
-		/* get buffer for writing */
-		buffer = (char *) *bufferptr;
-
-		/* insert the header */
-		index = 0;
-		status = mbr_reson7kr_wr_header(verbose, buffer, &index, header, error);
-
-		/* insert the data */
-		index = header->Offset + 4;
-		mb_put_binary_int(MB_YES, image->ping_number, &buffer[index]); index += 4;
-		mb_put_binary_short(MB_YES, image->multi_ping, &buffer[index]); index += 2;
-		mb_put_binary_int(MB_YES, image->width, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, image->height, &buffer[index]); index += 4;
-		mb_put_binary_short(MB_YES, image->color_depth, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, image->width_height_flag, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, image->compression, &buffer[index]); index += 2;
-
-		/* allocate memory for image if needed */
-		nalloc = image->width * image->height * image->color_depth;
-		if (status == MB_SUCCESS
-			&& image->nalloc < nalloc)
-			{
-			image->nalloc = nalloc;
-			if (status == MB_SUCCESS)
-			status = mb_reallocd(verbose, __FILE__, __LINE__, image->nalloc,
-						(void **)&(image->image), error);
-			if (status != MB_SUCCESS)
-				{
-				image->nalloc = 0;
-				image->width = 0;
-				image->height = 0;
-				}
-			}
-
-		/* extract image data */
-		if (image->color_depth == 1)
-			{
-			charptr = (char *)image->image;
-			for (i=0;i<image->width * image->height;i++)
-				{
-				buffer[index] = charptr[i]; index++;
-				}
-			}
-		else if (image->color_depth == 2)
-			{
-			ushortptr = (unsigned short *)image->image;
-			for (i=0;i<image->width * image->height;i++)
-				{
-				mb_put_binary_short(MB_YES, ushortptr[i], &buffer[index]); index += 2;
-				}
-			}
-		else if (image->color_depth == 4)
-			{
-			uintptr = (unsigned int *)image->image;
-			for (i=0;i<image->width * image->height;i++)
-				{
-				mb_put_binary_int(MB_YES, uintptr[i], &buffer[index]); index += 4;
-				}
-			}
-
-		/* reset the header size value */
-		mb_put_binary_int(MB_YES, ((unsigned int)(index + 4)), &buffer[8]);
-
-		/* now add the checksum */
-		checksum = 0;
-		for (i=0;i<index;i++)
-			checksum += (unsigned char) buffer[i];
-		mb_put_binary_int(MB_YES, checksum, &buffer[index]); index += 4;
-
-		/* check size */
-		if (*size != index)
-			{
-fprintf(stderr,"Bad size comparison: file:%s line:%d size:%d index:%d\n", __FILE__, __LINE__, *size, index);
-			status = MB_FAILURE;
-			*error = MB_ERROR_BAD_DATA;
-			*size = 0;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       bufferalloc:%d\n",*bufferalloc);
-		fprintf(stderr,"dbg2       size:       %d\n",*size);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_wr_v2pingmotion(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error)
-{
-	char	*function_name = "mbr_reson7kr_wr_v2pingmotion";
-	int	status = MB_SUCCESS;
-	struct mbsys_reson7k_struct *store;
-	s7k_header *header;
-	s7kr_v2pingmotion *v2pingmotion;
-	unsigned int checksum;
-	int	index;
-	char	*buffer;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       bufferalloc:%d\n",*bufferalloc);
-		fprintf(stderr,"dbg2       bufferptr:  %p\n",(void *)bufferptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	v2pingmotion = &(store->v2pingmotion);
-	header = &(v2pingmotion->header);
-
-	/* print out the data to be output */
-#ifdef MBR_RESON7KR_DEBUG
-	if (verbose > 0)
-#else
-	if (verbose >= 2)
-#endif
-	mbsys_reson7k_print_v2pingmotion(verbose, v2pingmotion, error);
-
-	/* figure out size of output record */
-	*size = MBSYS_RESON7K_RECORDHEADER_SIZE + MBSYS_RESON7K_RECORDTAIL_SIZE;
-	*size += R7KHDRSIZE_7kV2PingMotion;
-	if (v2pingmotion->flags & 1)
-		*size += sizeof(float);
-	if (v2pingmotion->flags & 2)
-		*size += sizeof(float) * v2pingmotion->n;
-	if (v2pingmotion->flags & 4)
-		*size += sizeof(float) * v2pingmotion->n;
-	if (v2pingmotion->flags & 8)
-		*size += sizeof(float) * v2pingmotion->n;
-
-	/* allocate memory to write rest of record if necessary */
-	if (*bufferalloc < *size)
-		{
-		status = mb_reallocd(verbose, __FILE__, __LINE__, *size,
-					(void **)bufferptr, error);
-		if (status != MB_SUCCESS)
-			{
-			*bufferalloc = 0;
-			}
-		else
-			{
-			*bufferalloc = *size;
-			}
-		}
-
-	/* proceed to write if buffer allocated */
-	if (status == MB_SUCCESS)
-		{
-		/* get buffer for writing */
-		buffer = (char *) *bufferptr;
-
-		/* insert the header */
-		index = 0;
-		status = mbr_reson7kr_wr_header(verbose, buffer, &index, header, error);
-
-		/* insert the data */
-		index = header->Offset + 4;
-		mb_put_binary_long(MB_YES, v2pingmotion->serial_number, &buffer[index]); index += 8;
-		mb_put_binary_int(MB_YES, v2pingmotion->ping_number, &buffer[index]); index += 4;
-		mb_put_binary_short(MB_YES, v2pingmotion->multi_ping, &buffer[index]); index += 2;
-		mb_put_binary_int(MB_YES, v2pingmotion->n, &buffer[index]); index += 4;
-		mb_put_binary_short(MB_YES, v2pingmotion->flags, &buffer[index]); index += 2;
-		mb_put_binary_int(MB_YES, v2pingmotion->error_flags, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, v2pingmotion->frequency, &buffer[index]); index += 4;
-		if (v2pingmotion->flags & 1)
-			{
-			mb_put_binary_float(MB_YES, v2pingmotion->pitch, &buffer[index]); index += 4;
-			}
-		if (v2pingmotion->flags & 2)
-			{
-			for (i=0;i<v2pingmotion->n;i++)
-				{
-				mb_put_binary_float(MB_YES, v2pingmotion->roll[i], &buffer[index]); index += 4;
-				}
-			}
-		if (v2pingmotion->flags & 4)
-			{
-			for (i=0;i<v2pingmotion->n;i++)
-				{
-				mb_put_binary_float(MB_YES, v2pingmotion->heading[i], &buffer[index]); index += 4;
-				}
-			}
-		if (v2pingmotion->flags & 8)
-			{
-			for (i=0;i<v2pingmotion->n;i++)
-				{
-				mb_put_binary_float(MB_YES, v2pingmotion->heave[i], &buffer[index]); index += 4;
-				}
-			}
-
-		/* reset the header size value */
-		mb_put_binary_int(MB_YES, ((unsigned int)(index + 4)), &buffer[8]);
-
-		/* now add the checksum */
-		checksum = 0;
-		for (i=0;i<index;i++)
-			checksum += (unsigned char) buffer[i];
-		mb_put_binary_int(MB_YES, checksum, &buffer[index]); index += 4;
-
-		/* check size */
-		if (*size != index)
-			{
-fprintf(stderr,"Bad size comparison: file:%s line:%d size:%d index:%d\n", __FILE__, __LINE__, *size, index);
-			status = MB_FAILURE;
-			*error = MB_ERROR_BAD_DATA;
-			*size = 0;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_wr_v2detectionsetup(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error)
-{
-	char	*function_name = "mbr_reson7kr_wr_v2detectionsetup";
-	int	status = MB_SUCCESS;
-	struct mbsys_reson7k_struct *store;
-	s7k_header *header;
-	s7kr_v2detectionsetup *v2detectionsetup;
-	unsigned int checksum;
-	int	index;
-	char	*buffer;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       bufferalloc:%d\n",*bufferalloc);
-		fprintf(stderr,"dbg2       bufferptr:  %p\n",(void *)bufferptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	v2detectionsetup = &(store->v2detectionsetup);
-	header = &(v2detectionsetup->header);
-
-	/* print out the data to be output */
-#ifdef MBR_RESON7KR_DEBUG
-	if (verbose > 0)
-#else
-	if (verbose >= 2)
-#endif
-	mbsys_reson7k_print_v2detectionsetup(verbose, v2detectionsetup, error);
-
-	/* figure out size of output record */
-	*size = MBSYS_RESON7K_RECORDHEADER_SIZE + MBSYS_RESON7K_RECORDTAIL_SIZE;
-	*size += R7KHDRSIZE_7kV2DetectionSetup;
-	*size += v2detectionsetup->number_beams * v2detectionsetup->data_field_size;
-
-	/* allocate memory to write rest of record if necessary */
-	if (*bufferalloc < *size)
-		{
-		status = mb_reallocd(verbose, __FILE__, __LINE__, *size,
-					(void **)bufferptr, error);
-		if (status != MB_SUCCESS)
-			{
-			*bufferalloc = 0;
-			}
-		else
-			{
-			*bufferalloc = *size;
-			}
-		}
-
-	/* proceed to write if buffer allocated */
-	if (status == MB_SUCCESS)
-		{
-		/* get buffer for writing */
-		buffer = (char *) *bufferptr;
-
-		/* insert the header */
-		index = 0;
-		status = mbr_reson7kr_wr_header(verbose, buffer, &index, header, error);
-
-		/* insert the data */
-		index = header->Offset + 4;
-		mb_put_binary_long(MB_YES, v2detectionsetup->serial_number, &buffer[index]); index += 8;
-		mb_put_binary_int(MB_YES, v2detectionsetup->ping_number, &buffer[index]); index += 4;
-		mb_put_binary_short(MB_YES, v2detectionsetup->multi_ping, &buffer[index]); index += 2;
-		mb_put_binary_int(MB_YES, v2detectionsetup->number_beams, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, v2detectionsetup->data_field_size, &buffer[index]); index += 4;
-		buffer[index] = v2detectionsetup->detection_algorithm; index++;
-		mb_put_binary_int(MB_YES, v2detectionsetup->detection_flags, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, v2detectionsetup->minimum_depth, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, v2detectionsetup->maximum_depth, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, v2detectionsetup->minimum_range, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, v2detectionsetup->maximum_range, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, v2detectionsetup->minimum_nadir_search, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, v2detectionsetup->maximum_nadir_search, &buffer[index]); index += 4;
-		buffer[index] = v2detectionsetup->automatic_filter_window; index++;
-		mb_put_binary_float(MB_YES, v2detectionsetup->applied_roll, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, v2detectionsetup->depth_gate_tilt, &buffer[index]); index += 4;
-		for (i=0;i<14;i++)
-			{
-			mb_put_binary_float(MB_YES, v2detectionsetup->reserved[i], &buffer[index]); index += 4;
-			}
-		for (i=0;i<v2detectionsetup->number_beams;i++)
-			{
-			mb_put_binary_short(MB_YES, v2detectionsetup->beam_descriptor[i], &buffer[index]); index += 2;
-			mb_put_binary_float(MB_YES, v2detectionsetup->detection_point[i], &buffer[index]); index += 4;
-			mb_put_binary_int(MB_YES, v2detectionsetup->flags[i], &buffer[index]); index += 4;
-			mb_put_binary_int(MB_YES, v2detectionsetup->auto_limits_min_sample[i], &buffer[index]); index += 4;
-			mb_put_binary_int(MB_YES, v2detectionsetup->auto_limits_max_sample[i], &buffer[index]); index += 4;
-			mb_put_binary_int(MB_YES, v2detectionsetup->user_limits_min_sample[i], &buffer[index]); index += 4;
-			mb_put_binary_int(MB_YES, v2detectionsetup->user_limits_max_sample[i], &buffer[index]); index += 4;
-			mb_put_binary_int(MB_YES, v2detectionsetup->quality[i], &buffer[index]); index += 4;
-			if (v2detectionsetup->data_field_size >= R7KRDTSIZE_7kV2DetectionSetup + 4)
-				{
-				mb_put_binary_int(MB_YES, v2detectionsetup->uncertainty[i], &buffer[index]); index += 4;
-				}
-			}
-
-		/* reset the header size value */
-		mb_put_binary_int(MB_YES, ((unsigned int)(index + 4)), &buffer[8]);
-
-		/* now add the checksum */
-		checksum = 0;
-		for (i=0;i<index;i++)
-			checksum += (unsigned char) buffer[i];
-		mb_put_binary_int(MB_YES, checksum, &buffer[index]); index += 4;
-
-		/* check size */
-		if (*size != index)
-			{
-fprintf(stderr,"Bad size comparison: file:%s line:%d size:%d index:%d\n", __FILE__, __LINE__, *size, index);
-			status = MB_FAILURE;
-			*error = MB_ERROR_BAD_DATA;
-			*size = 0;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_wr_v2beamformed(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error)
-{
-	char	*function_name = "mbr_reson7kr_wr_v2beamformed";
-	int	status = MB_SUCCESS;
-	struct mbsys_reson7k_struct *store;
-	s7k_header *header;
-	s7kr_v2beamformed *v2beamformed;
-	s7kr_v2amplitudephase *v2amplitudephase;
-	unsigned int checksum;
-	int	index;
-	char	*buffer;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       bufferalloc:%d\n",*bufferalloc);
-		fprintf(stderr,"dbg2       bufferptr:  %p\n",(void *)bufferptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	v2beamformed = &(store->v2beamformed);
-	header = &(v2beamformed->header);
-
-	/* print out the data to be output */
-#ifdef MBR_RESON7KR_DEBUG
-	if (verbose > 0)
-#else
-	if (verbose >= 2)
-#endif
-	mbsys_reson7k_print_v2beamformed(verbose, v2beamformed, error);
-
-	/* figure out size of output record */
-	*size = MBSYS_RESON7K_RECORDHEADER_SIZE + MBSYS_RESON7K_RECORDTAIL_SIZE;
-	*size += R7KHDRSIZE_7kV2BeamformedData;
-	*size += 2 * sizeof(short) * v2beamformed->number_beams * v2beamformed->number_samples;
-
-	/* allocate memory to write rest of record if necessary */
-	if (*bufferalloc < *size)
-		{
-		status = mb_reallocd(verbose, __FILE__, __LINE__, *size,
-					(void **)bufferptr, error);
-		if (status != MB_SUCCESS)
-			{
-			*bufferalloc = 0;
-			}
-		else
-			{
-			*bufferalloc = *size;
-			}
-		}
-
-	/* proceed to write if buffer allocated */
-	if (status == MB_SUCCESS)
-		{
-		/* get buffer for writing */
-		buffer = (char *) *bufferptr;
-
-		/* insert the header */
-		index = 0;
-		status = mbr_reson7kr_wr_header(verbose, buffer, &index, header, error);
-
-		/* insert the data */
-		index = header->Offset + 4;
-		mb_put_binary_long(MB_YES, v2beamformed->serial_number, &buffer[index]); index += 8;
-		mb_put_binary_int(MB_YES, v2beamformed->ping_number, &buffer[index]); index += 4;
-		mb_put_binary_short(MB_YES, v2beamformed->multi_ping, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, v2beamformed->number_beams, &buffer[index]); index += 2;
-		mb_put_binary_int(MB_YES, v2beamformed->number_samples, &buffer[index]); index += 4;
-		for (i=0;i<32;i++)
-			{
-			buffer[index] = v2beamformed->reserved[i]; index++;
-			}
-		for (i=0;i<v2beamformed->number_beams;i++)
-			{
-			v2amplitudephase = &(v2beamformed->amplitudephase[i]);
-
-			/* insert v2beamformed data */
-			for (j=0;j<v2beamformed->number_samples;j++)
-				{
-				mb_put_binary_short(MB_YES, v2amplitudephase->amplitude[j], &buffer[index]); index += 2;
-				mb_put_binary_short(MB_YES, v2amplitudephase->phase[j], &buffer[index]); index += 2;
-				}
-			}
-
-		/* reset the header size value */
-		mb_put_binary_int(MB_YES, ((unsigned int)(index + 4)), &buffer[8]);
-
-		/* now add the checksum */
-		checksum = 0;
-		for (i=0;i<index;i++)
-			checksum += (unsigned char) buffer[i];
-		mb_put_binary_int(MB_YES, checksum, &buffer[index]); index += 4;
-
-		/* check size */
-		if (*size != index)
-			{
-fprintf(stderr,"Bad size comparison: file:%s line:%d size:%d index:%d\n", __FILE__, __LINE__, *size, index);
-			status = MB_FAILURE;
-			*error = MB_ERROR_BAD_DATA;
-			*size = 0;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_wr_v2bite(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error)
-{
-	char	*function_name = "mbr_reson7kr_wr_v2bite";
-	int	status = MB_SUCCESS;
-	struct mbsys_reson7k_struct *store;
-	s7k_header *header;
-	s7kr_v2bite *v2bite;
-	s7kr_v2bitereport *report;
-	s7k_time *s7ktime;
-	s7kr_v2bitefield *bitefield;
-	unsigned int checksum;
-	int	index;
-	char	*buffer;
-	int	i, j, k;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       bufferalloc:%d\n",*bufferalloc);
-		fprintf(stderr,"dbg2       bufferptr:  %p\n",(void *)bufferptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	v2bite = &(store->v2bite);
-	header = &(v2bite->header);
-
-	/* print out the data to be output */
-#ifdef MBR_RESON7KR_DEBUG
-	if (verbose > 0)
-#else
-	if (verbose >= 2)
-#endif
-	mbsys_reson7k_print_v2bite(verbose, v2bite, error);
-
-	/* figure out size of output record */
-	*size = MBSYS_RESON7K_RECORDHEADER_SIZE + MBSYS_RESON7K_RECORDTAIL_SIZE;
-	*size += R7KHDRSIZE_7kV2BITEData;
-	for (i=0;i<v2bite->number_reports;i++)
-		{
-		report = &(v2bite->reports[i]);
-		*size += R7KRDTSIZE_7kV2BITERecordData + report->number_bite * R7KRDTSIZE_7kV2BITEFieldData;
-		}
-
-	/* allocate memory to store rest of record if necessary */
-	if (*bufferalloc < *size)
-		{
-		status = mb_reallocd(verbose, __FILE__, __LINE__, *size,
-					(void **)bufferptr, error);
-		if (status != MB_SUCCESS)
-			{
-			*bufferalloc = 0;
-			}
-		else
-			{
-			*bufferalloc = *size;
-			}
-		}
-
-	/* proceed to write if buffer allocated */
-	if (status == MB_SUCCESS)
-		{
-		/* get buffer for writing */
-		buffer = (char *) *bufferptr;
-
-		/* insert the header */
-		index = 0;
-		status = mbr_reson7kr_wr_header(verbose, buffer, &index, header, error);
-
-		/* insert the data */
-		index = header->Offset + 4;
-		mb_put_binary_short(MB_YES, v2bite->number_reports, &buffer[index]); index += 2;
-		for (i=0;i<v2bite->number_reports;i++)
-			{
-			report = &(v2bite->reports[i]);
-
-			for (j=0;j<64;j++)
-				{
-				buffer[index] = report->source_name[j]; index++;
-				}
-			buffer[index] = report->source_address; index++;
-			mb_put_binary_float(MB_YES, report->frequency, &buffer[index]); index += 4;
-			mb_put_binary_short(MB_YES, report->enumerator, &buffer[index]); index += 2;
-
-			s7ktime = &(report->downlink_time);
-			mb_put_binary_short(MB_YES, s7ktime->Year, &buffer[index]); index += 2;
-			mb_put_binary_short(MB_YES, s7ktime->Day, &buffer[index]); index += 2;
-			mb_put_binary_float(MB_YES, s7ktime->Seconds, &buffer[index]); index += 4;
-			buffer[index] = s7ktime->Hours; index++;
-			buffer[index] = s7ktime->Minutes; index++;
-
-			s7ktime = &(report->uplink_time);
-			mb_put_binary_short(MB_YES, s7ktime->Year, &buffer[index]); index += 2;
-			mb_put_binary_short(MB_YES, s7ktime->Day, &buffer[index]); index += 2;
-			mb_put_binary_float(MB_YES, s7ktime->Seconds, &buffer[index]); index += 4;
-			buffer[index] = s7ktime->Hours; index++;
-			buffer[index] = s7ktime->Minutes; index++;
-
-			s7ktime = &(report->bite_time);
-			mb_put_binary_short(MB_YES, s7ktime->Year, &buffer[index]); index += 2;
-			mb_put_binary_short(MB_YES, s7ktime->Day, &buffer[index]); index += 2;
-			mb_put_binary_float(MB_YES, s7ktime->Seconds, &buffer[index]); index += 4;
-			buffer[index] = s7ktime->Hours; index++;
-			buffer[index] = s7ktime->Minutes; index++;
-
-			buffer[index] = report->status; index++;
-			mb_put_binary_short(MB_YES, report->number_bite, &buffer[index]); index += 2;
-			for (j=0;j<32;j++)
-				{
-				buffer[index] = report->bite_status[j]; index++;
-				}
-
-			/* loop over all bite fields */
-			for (j=0;j<report->number_bite;j++)
-				{
-				bitefield = &(report->bitefield[j]);
-
-				mb_put_binary_short(MB_YES, bitefield->reserved, &buffer[index]); index += 2;
-				for (k=0;k<64;k++)
-					{
-					buffer[index] = bitefield->name[k]; index++;
-					}
-				buffer[index] = bitefield->device_type; index++;
-				mb_put_binary_float(MB_YES, bitefield->minimum, &buffer[index]); index += 4;
-				mb_put_binary_float(MB_YES, bitefield->maximum, &buffer[index]); index += 4;
-				mb_put_binary_float(MB_YES, bitefield->value, &buffer[index]); index += 4;
-				}
-			}
-
-		/* reset the header size value */
-		mb_put_binary_int(MB_YES, ((unsigned int)(index + 4)), &buffer[8]);
-
-		/* now add the checksum */
-		checksum = 0;
-		for (i=0;i<index;i++)
-			checksum += (unsigned char) buffer[i];
-		mb_put_binary_int(MB_YES, checksum, &buffer[index]); index += 4;
-
-		/* check size */
-		if (*size != index)
-			{
-fprintf(stderr,"Bad size comparison: file:%s line:%d size:%d index:%d\n", __FILE__, __LINE__, *size, index);
-			status = MB_FAILURE;
-			*error = MB_ERROR_BAD_DATA;
-			*size = 0;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_wr_v27kcenterversion(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error)
-{
-	char	*function_name = "mbr_reson7kr_wr_v27kcenterversion";
-	int	status = MB_SUCCESS;
-	struct mbsys_reson7k_struct *store;
-	s7k_header *header;
-	s7kr_v27kcenterversion *v27kcenterversion;
-	unsigned int checksum;
-	int	index;
-	char	*buffer;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       bufferalloc:%d\n",*bufferalloc);
-		fprintf(stderr,"dbg2       bufferptr:  %p\n",(void *)bufferptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	v27kcenterversion = &(store->v27kcenterversion);
-	header = &(v27kcenterversion->header);
-
-	/* print out the data to be output */
-#ifdef MBR_RESON7KR_DEBUG
-	if (verbose > 0)
-#else
-	if (verbose >= 2)
-#endif
-	mbsys_reson7k_print_v27kcenterversion(verbose, v27kcenterversion, error);
-
-	/* figure out size of output record */
-	*size = MBSYS_RESON7K_RECORDHEADER_SIZE + MBSYS_RESON7K_RECORDTAIL_SIZE;
-	*size += R7KHDRSIZE_7kV27kCenterVersion;
-
-	/* allocate memory to store rest of record if necessary */
-	if (*bufferalloc < *size)
-		{
-		status = mb_reallocd(verbose, __FILE__, __LINE__, *size,
-					(void **)bufferptr, error);
-		if (status != MB_SUCCESS)
-			{
-			*bufferalloc = 0;
-			}
-		else
-			{
-			*bufferalloc = *size;
-			}
-		}
-
-	/* proceed to write if buffer allocated */
-	if (status == MB_SUCCESS)
-		{
-		/* get buffer for writing */
-		buffer = (char *) *bufferptr;
-
-		/* insert the header */
-		index = 0;
-		status = mbr_reson7kr_wr_header(verbose, buffer, &index, header, error);
-
-		/* insert the data */
-		index = header->Offset + 4;
-		for (i=0;i<32;i++)
-			{
-			buffer[index] = v27kcenterversion->version[i]; index++;
-			}
-
-		/* reset the header size value */
-		mb_put_binary_int(MB_YES, ((unsigned int)(index + 4)), &buffer[8]);
-
-		/* now add the checksum */
-		checksum = 0;
-		for (i=0;i<index;i++)
-			checksum += (unsigned char) buffer[i];
-		mb_put_binary_int(MB_YES, checksum, &buffer[index]); index += 4;
-
-		/* check size */
-		if (*size != index)
-			{
-fprintf(stderr,"Bad size comparison: file:%s line:%d size:%d index:%d\n", __FILE__, __LINE__, *size, index);
-			status = MB_FAILURE;
-			*error = MB_ERROR_BAD_DATA;
-			*size = 0;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_wr_v28kwetendversion(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error)
-{
-	char	*function_name = "mbr_reson7kr_wr_v28kwetendversion";
-	int	status = MB_SUCCESS;
-	struct mbsys_reson7k_struct *store;
-	s7k_header *header;
-	s7kr_v28kwetendversion *v28kwetendversion;
-	unsigned int checksum;
-	int	index;
-	char	*buffer;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       bufferalloc:%d\n",*bufferalloc);
-		fprintf(stderr,"dbg2       bufferptr:  %p\n",(void *)bufferptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	v28kwetendversion = &(store->v28kwetendversion);
-	header = &(v28kwetendversion->header);
-
-	/* print out the data to be output */
-#ifdef MBR_RESON7KR_DEBUG
-	if (verbose > 0)
-#else
-	if (verbose >= 2)
-#endif
-	mbsys_reson7k_print_v28kwetendversion(verbose, v28kwetendversion, error);
-
-	/* figure out size of output record */
-	*size = MBSYS_RESON7K_RECORDHEADER_SIZE + MBSYS_RESON7K_RECORDTAIL_SIZE;
-	*size += R7KHDRSIZE_7kV28kWetEndVersion;
-
-	/* allocate memory to store rest of record if necessary */
-	if (*bufferalloc < *size)
-		{
-		status = mb_reallocd(verbose, __FILE__, __LINE__, *size,
-					(void **)bufferptr, error);
-		if (status != MB_SUCCESS)
-			{
-			*bufferalloc = 0;
-			}
-		else
-			{
-			*bufferalloc = *size;
-			}
-		}
-
-	/* proceed to write if buffer allocated */
-	if (status == MB_SUCCESS)
-		{
-		/* get buffer for writing */
-		buffer = (char *) *bufferptr;
-
-		/* insert the header */
-		index = 0;
-		status = mbr_reson7kr_wr_header(verbose, buffer, &index, header, error);
-
-		/* insert the data */
-		index = header->Offset + 4;
-		for (i=0;i<32;i++)
-			{
-			buffer[index] = v28kwetendversion->version[i]; index++;
-			}
-
-		/* reset the header size value */
-		mb_put_binary_int(MB_YES, ((unsigned int)(index + 4)), &buffer[8]);
-
-		/* now add the checksum */
-		checksum = 0;
-		for (i=0;i<index;i++)
-			checksum += (unsigned char) buffer[i];
-		mb_put_binary_int(MB_YES, checksum, &buffer[index]); index += 4;
-
-		/* check size */
-		if (*size != index)
-			{
-fprintf(stderr,"Bad size comparison: file:%s line:%d size:%d index:%d\n", __FILE__, __LINE__, *size, index);
-			status = MB_FAILURE;
-			*error = MB_ERROR_BAD_DATA;
-			*size = 0;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_wr_v2detection(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error)
-{
-	char	*function_name = "mbr_reson7kr_wr_v2detection";
-	int	status = MB_SUCCESS;
-	struct mbsys_reson7k_struct *store;
-	s7k_header *header;
-	s7kr_v2detection *v2detection;
-	unsigned int checksum;
-	int	index;
-	char	*buffer;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       bufferalloc:%d\n",*bufferalloc);
-		fprintf(stderr,"dbg2       bufferptr:  %p\n",(void *)bufferptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	v2detection = &(store->v2detection);
-	header = &(v2detection->header);
-
-	/* figure out size of output record */
-	*size = MBSYS_RESON7K_RECORDHEADER_SIZE + MBSYS_RESON7K_RECORDTAIL_SIZE;
-	*size += R7KHDRSIZE_7kV2Detection;
-	*size += v2detection->number_beams * v2detection->data_field_size;
-	header->OffsetToOptionalData = 0;
-	header->Size = *size;
-
-	/* print out the data to be output */
-#ifdef MBR_RESON7KR_DEBUG
-	if (verbose > 0)
-#else
-	if (verbose >= 2)
-#endif
-	mbsys_reson7k_print_v2detection(verbose, v2detection, error);
-
-	/* allocate memory to write rest of record if necessary */
-	if (*bufferalloc < *size)
-		{
-		status = mb_reallocd(verbose, __FILE__, __LINE__, *size,
-					(void **)bufferptr, error);
-		if (status != MB_SUCCESS)
-			{
-			*bufferalloc = 0;
-			}
-		else
-			{
-			*bufferalloc = *size;
-			}
-		}
-
-	/* proceed to write if buffer allocated */
-	if (status == MB_SUCCESS)
-		{
-		/* get buffer for writing */
-		buffer = (char *) *bufferptr;
-
-		/* insert the header */
-		index = 0;
-		status = mbr_reson7kr_wr_header(verbose, buffer, &index, header, error);
-
-		/* insert the data */
-		index = header->Offset + 4;
-		mb_put_binary_long(MB_YES, v2detection->serial_number, &buffer[index]); index += 8;
-		mb_put_binary_int(MB_YES, v2detection->ping_number, &buffer[index]); index += 4;
-		mb_put_binary_short(MB_YES, v2detection->multi_ping, &buffer[index]); index += 2;
-		mb_put_binary_int(MB_YES, v2detection->number_beams, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, v2detection->data_field_size, &buffer[index]); index += 4;
-		mb_put_binary_long(MB_YES, v2detection->corrections, &buffer[index]); index += 8;
-		buffer[index] = v2detection->detection_algorithm; index++;
-		mb_put_binary_int(MB_YES, v2detection->flags, &buffer[index]); index += 4;
-		for (i=0;i<64;i++)
-			{
-			buffer[index] = v2detection->reserved[i]; index++;
-			}
-
-		/* insert the data */
-		for (i=0;i<v2detection->number_beams;i++)
-			{
-			mb_put_binary_float(MB_YES, v2detection->range[i], &buffer[index]); index += 4;
-			mb_put_binary_float(MB_YES, v2detection->angle_x[i], &buffer[index]); index += 4;
-			mb_put_binary_float(MB_YES, v2detection->angle_y[i], &buffer[index]); index += 4;
-			mb_put_binary_float(MB_YES, v2detection->range_error[i], &buffer[index]); index += 4;
-			mb_put_binary_float(MB_YES, v2detection->angle_x_error[i], &buffer[index]); index += 4;
-			mb_put_binary_float(MB_YES, v2detection->angle_y_error[i], &buffer[index]); index += 4;
-			if (v2detection->data_field_size > 24)
-			for (j=0;j<v2detection->data_field_size-24;j++)
-				{
-				buffer[index] = 0; index++;
-				}
-			}
-
-		/* reset the header size value */
-		mb_put_binary_int(MB_YES, ((unsigned int)(index + 4)), &buffer[8]);
-
-		/* now add the checksum */
-		checksum = 0;
-		for (i=0;i<index;i++)
-			checksum += (unsigned char) buffer[i];
-		mb_put_binary_int(MB_YES, checksum, &buffer[index]); index += 4;
-
-		/* check size */
-		if (*size != index)
-			{
-fprintf(stderr,"Bad size comparison: file:%s line:%d size:%d index:%d\n", __FILE__, __LINE__, *size, index);
-			status = MB_FAILURE;
-			*error = MB_ERROR_BAD_DATA;
-			*size = 0;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       bufferalloc:%d\n",*bufferalloc);
-		fprintf(stderr,"dbg2       size:       %d\n",*size);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_wr_v2rawdetection(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error)
-{
-	char	*function_name = "mbr_reson7kr_wr_v2rawdetection";
-	int	status = MB_SUCCESS;
-	struct mbsys_reson7k_struct *store;
-	s7k_header *header;
-	s7kr_v2rawdetection *v2rawdetection;
-	unsigned int checksum;
-	int	index;
-	char	*buffer;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       bufferalloc:%d\n",*bufferalloc);
-		fprintf(stderr,"dbg2       bufferptr:  %p\n",(void *)bufferptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	v2rawdetection = &(store->v2rawdetection);
-	header = &(v2rawdetection->header);
-
-	/* figure out size of output record */
-	*size = MBSYS_RESON7K_RECORDHEADER_SIZE + MBSYS_RESON7K_RECORDTAIL_SIZE;
-	*size += R7KHDRSIZE_7kV2RawDetection;
-	*size += v2rawdetection->number_beams * v2rawdetection->data_field_size;
-	header->OffsetToOptionalData = 0;
-	header->Size = *size;
-
-	/* print out the data to be output */
-#ifdef MBR_RESON7KR_DEBUG
-	if (verbose > 0)
-#else
-	if (verbose >= 2)
-#endif
-	mbsys_reson7k_print_v2rawdetection(verbose, v2rawdetection, error);
-
-	/* allocate memory to write rest of record if necessary */
-	if (*bufferalloc < *size)
-		{
-		status = mb_reallocd(verbose, __FILE__, __LINE__, *size,
-					(void **)bufferptr, error);
-		if (status != MB_SUCCESS)
-			{
-			*bufferalloc = 0;
-			}
-		else
-			{
-			*bufferalloc = *size;
-			}
-		}
-
-	/* proceed to write if buffer allocated */
-	if (status == MB_SUCCESS)
-		{
-		/* get buffer for writing */
-		buffer = (char *) *bufferptr;
-
-		/* insert the header */
-		index = 0;
-		status = mbr_reson7kr_wr_header(verbose, buffer, &index, header, error);
-
-		/* insert the data */
-		index = header->Offset + 4;
-		mb_put_binary_long(MB_YES, v2rawdetection->serial_number, &buffer[index]); index += 8;
-		mb_put_binary_int(MB_YES, v2rawdetection->ping_number, &buffer[index]); index += 4;
-		mb_put_binary_short(MB_YES, v2rawdetection->multi_ping, &buffer[index]); index += 2;
-		mb_put_binary_int(MB_YES, v2rawdetection->number_beams, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, v2rawdetection->data_field_size, &buffer[index]); index += 4;
-		buffer[index] = v2rawdetection->detection_algorithm; index++;
-		mb_put_binary_int(MB_YES, v2rawdetection->detection_flags, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, v2rawdetection->sampling_rate, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, v2rawdetection->tx_angle, &buffer[index]); index += 4;
-		for (i=0;i<64;i++)
-			{
-			buffer[index] = v2rawdetection->reserved[i]; index++;
-			}
-
-		/* insert the data */
-		for (i=0;i<v2rawdetection->number_beams;i++)
-			{
-			mb_put_binary_short(MB_YES, v2rawdetection->beam_descriptor[i], &buffer[index]); index += 2;
-			mb_put_binary_float(MB_YES, v2rawdetection->detection_point[i], &buffer[index]); index += 4;
-			mb_put_binary_float(MB_YES, v2rawdetection->rx_angle[i], &buffer[index]); index += 4;
-			mb_put_binary_int(MB_YES, v2rawdetection->flags[i], &buffer[index]); index += 4;
-			mb_put_binary_int(MB_YES, v2rawdetection->quality[i], &buffer[index]); index += 4;
-			mb_put_binary_float(MB_YES, v2rawdetection->uncertainty[i], &buffer[index]); index += 4;
-			if (v2rawdetection->data_field_size > 22)
-			for (j=0;j<v2rawdetection->data_field_size-22;j++)
-				{
-				buffer[index] = 0; index++;
-				}
-			}
-
-		/* reset the header size value */
-		mb_put_binary_int(MB_YES, ((unsigned int)(index + 4)), &buffer[8]);
-
-		/* now add the checksum */
-		checksum = 0;
-		for (i=0;i<index;i++)
-			checksum += (unsigned char) buffer[i];
-		mb_put_binary_int(MB_YES, checksum, &buffer[index]); index += 4;
-
-		/* check size */
-		if (*size != index)
-			{
-fprintf(stderr,"Bad size comparison: file:%s line:%d size:%d index:%d\n", __FILE__, __LINE__, *size, index);
-			status = MB_FAILURE;
-			*error = MB_ERROR_BAD_DATA;
-			*size = 0;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       bufferalloc:%d\n",*bufferalloc);
-		fprintf(stderr,"dbg2       size:       %d\n",*size);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_wr_v2snippet(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error)
-{
-	char	*function_name = "mbr_reson7kr_wr_v2snippet";
-	int	status = MB_SUCCESS;
-	struct mbsys_reson7k_struct *store;
-	s7k_header *header;
-	s7kr_v2snippet *v2snippet;
-	s7kr_v2snippettimeseries *snippettimeseries;
-	unsigned int checksum;
-	int	index;
-	char	*buffer;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       bufferalloc:%d\n",*bufferalloc);
-		fprintf(stderr,"dbg2       bufferptr:  %p\n",(void *)bufferptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	v2snippet = &(store->v2snippet);
-	header = &(v2snippet->header);
-
-	/* figure out size of output record */
-	*size = MBSYS_RESON7K_RECORDHEADER_SIZE + MBSYS_RESON7K_RECORDTAIL_SIZE;
-	*size += R7KHDRSIZE_7kV2SnippetData;
-	for (i=0;i<v2snippet->number_beams;i++)
-		{
-		snippettimeseries = &(v2snippet->snippettimeseries[i]);
-
-		*size += R7KRDTSIZE_7kV2SnippetTimeseries
-			+ sizeof(short) * (snippettimeseries->end_sample - snippettimeseries->begin_sample + 1);
-		}
-	header->OffsetToOptionalData = 0;
-	header->Size = *size;
-
-	/* print out the data to be output */
-#ifdef MBR_RESON7KR_DEBUG
-	if (verbose > 0)
-#else
-	if (verbose >= 2)
-#endif
-	mbsys_reson7k_print_v2snippet(verbose, v2snippet, error);
-
-	/* allocate memory to write rest of record if necessary */
-	if (*bufferalloc < *size)
-		{
-		status = mb_reallocd(verbose, __FILE__, __LINE__, *size,
-					(void **)bufferptr, error);
-		if (status != MB_SUCCESS)
-			{
-			*bufferalloc = 0;
-			}
-		else
-			{
-			*bufferalloc = *size;
-			}
-		}
-
-	/* proceed to write if buffer allocated */
-	if (status == MB_SUCCESS)
-		{
-		/* get buffer for writing */
-		buffer = (char *) *bufferptr;
-
-		/* insert the header */
-		index = 0;
-		status = mbr_reson7kr_wr_header(verbose, buffer, &index, header, error);
-
-		/* insert the data */
-		index = header->Offset + 4;
-		mb_put_binary_long(MB_YES, v2snippet->serial_number, &buffer[index]); index += 8;
-		mb_put_binary_int(MB_YES, v2snippet->ping_number, &buffer[index]); index += 4;
-		mb_put_binary_short(MB_YES, v2snippet->multi_ping, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, v2snippet->number_beams, &buffer[index]); index += 2;
-		buffer[index] = v2snippet->error_flag; index++;
-		buffer[index] = v2snippet->control_flags; index++;
-		for (i=0;i<28;i++)
-			{
-			buffer[index] = v2snippet->reserved[i]; index++;
-			}
-
-		/* insert the snippet parameters */
-		for (i=0;i<v2snippet->number_beams;i++)
-			{
-			snippettimeseries = &(v2snippet->snippettimeseries[i]);
-
-			/* extract snippettimeseries data */
-			mb_put_binary_short(MB_YES, snippettimeseries->beam_number, &buffer[index]); index += 2;
-			mb_put_binary_int(MB_YES, snippettimeseries->begin_sample, &buffer[index]); index += 4;
-			mb_put_binary_int(MB_YES, snippettimeseries->detect_sample, &buffer[index]); index += 4;
-			mb_put_binary_int(MB_YES, snippettimeseries->end_sample, &buffer[index]); index += 4;
-			}
-
-		/* loop over all beams to insert snippet data */
-		for (i=0;i<v2snippet->number_beams;i++)
-			{
-			snippettimeseries = &(v2snippet->snippettimeseries[i]);
-			for (j=0;j<(snippettimeseries->end_sample - snippettimeseries->begin_sample + 1);j++)
-				{
-				mb_put_binary_short(MB_YES, snippettimeseries->amplitude[j], &buffer[index]); index += 2;
-				}
-			}
-
-		/* reset the header size value */
-		mb_put_binary_int(MB_YES, ((unsigned int)(index + 4)), &buffer[8]);
-
-		/* now add the checksum */
-		checksum = 0;
-		for (i=0;i<index;i++)
-			checksum += (unsigned char) buffer[i];
-		mb_put_binary_int(MB_YES, checksum, &buffer[index]); index += 4;
-
-		/* check size */
-		if (*size != index)
-			{
-fprintf(stderr,"Bad size comparison: file:%s line:%d size:%d index:%d\n", __FILE__, __LINE__, *size, index);
-			status = MB_FAILURE;
-			*error = MB_ERROR_BAD_DATA;
-			*size = 0;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       bufferalloc:%d\n",*bufferalloc);
-		fprintf(stderr,"dbg2       size:       %d\n",*size);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_wr_calibratedsnippet(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error)
-{
-	char	*function_name = "mbr_reson7kr_wr_calibratedsnippet";
-	int	status = MB_SUCCESS;
-	struct mbsys_reson7k_struct *store;
-	s7k_header *header;
-	s7kr_calibratedsnippet *calibratedsnippet;
-	s7kr_calibratedsnippettimeseries *snippettimeseries;
-	unsigned int checksum;
-	int	index;
-	char	*buffer;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       bufferalloc:%d\n",*bufferalloc);
-		fprintf(stderr,"dbg2       bufferptr:  %p\n",(void *)bufferptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	calibratedsnippet = &(store->calibratedsnippet);
-	header = &(calibratedsnippet->header);
-
-	/* figure out size of output record */
-	*size = MBSYS_RESON7K_RECORDHEADER_SIZE + MBSYS_RESON7K_RECORDTAIL_SIZE;
-	*size += R7KHDRSIZE_7kCalibratedSnippetData;
-	for (i=0;i<calibratedsnippet->number_beams;i++)
-		{
-		snippettimeseries = &(calibratedsnippet->calibratedsnippettimeseries[i]);
-
-		*size += R7KRDTSIZE_7kCalibratedSnippetTimeseries
-			+ sizeof(float) * (snippettimeseries->end_sample - snippettimeseries->begin_sample + 1);
-		}
-	header->OffsetToOptionalData = 0;
-	header->Size = *size;
-
-	/* print out the data to be output */
-#ifdef MBR_RESON7KR_DEBUG
-	if (verbose > 0)
-#else
-	if (verbose >= 2)
-#endif
-	mbsys_reson7k_print_calibratedsnippet(verbose, calibratedsnippet, error);
-
-	/* allocate memory to write rest of record if necessary */
-	if (*bufferalloc < *size)
-		{
-		status = mb_reallocd(verbose, __FILE__, __LINE__, *size,
-					(void **)bufferptr, error);
-		if (status != MB_SUCCESS)
-			{
-			*bufferalloc = 0;
-			}
-		else
-			{
-			*bufferalloc = *size;
-			}
-		}
-
-	/* proceed to write if buffer allocated */
-	if (status == MB_SUCCESS)
-		{
-		/* get buffer for writing */
-		buffer = (char *) *bufferptr;
-
-		/* insert the header */
-		index = 0;
-		status = mbr_reson7kr_wr_header(verbose, buffer, &index, header, error);
-
-		/* insert the data */
-		index = header->Offset + 4;
-		mb_put_binary_long(MB_YES, calibratedsnippet->serial_number, &buffer[index]); index += 8;
-		mb_put_binary_int(MB_YES, calibratedsnippet->ping_number, &buffer[index]); index += 4;
-		mb_put_binary_short(MB_YES, calibratedsnippet->multi_ping, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, calibratedsnippet->number_beams, &buffer[index]); index += 2;
-		buffer[index] = calibratedsnippet->error_flag; index++;
-		mb_put_binary_int(MB_YES, calibratedsnippet->control_flags, &buffer[index]); index += 4;
-		for (i=0;i<28;i++)
-			{
-			buffer[index] = calibratedsnippet->reserved[i]; index++;
-			}
-
-		/* insert the snippet parameters */
-		for (i=0;i<calibratedsnippet->number_beams;i++)
-			{
-			snippettimeseries = &(calibratedsnippet->calibratedsnippettimeseries[i]);
-
-			/* extract snippettimeseries data */
-			mb_put_binary_short(MB_YES, snippettimeseries->beam_number, &buffer[index]); index += 2;
-			mb_put_binary_int(MB_YES, snippettimeseries->begin_sample, &buffer[index]); index += 4;
-			mb_put_binary_int(MB_YES, snippettimeseries->detect_sample, &buffer[index]); index += 4;
-			mb_put_binary_int(MB_YES, snippettimeseries->end_sample, &buffer[index]); index += 4;
-			}
-
-		/* loop over all beams to insert snippet data */
-		for (i=0;i<calibratedsnippet->number_beams;i++)
-			{
-			snippettimeseries = &(calibratedsnippet->calibratedsnippettimeseries[i]);
-			for (j=0;j<(snippettimeseries->end_sample - snippettimeseries->begin_sample + 1);j++)
-				{
-				mb_put_binary_float(MB_YES, snippettimeseries->amplitude[j], &buffer[index]); index += 4;
-				}
-			}
-
-		/* reset the header size value */
-		mb_put_binary_int(MB_YES, ((unsigned int)(index + 4)), &buffer[8]);
-
-		/* now add the checksum */
-		checksum = 0;
-		for (i=0;i<index;i++)
-			checksum += (unsigned char) buffer[i];
-		mb_put_binary_int(MB_YES, checksum, &buffer[index]); index += 4;
-
-		/* check size */
-		if (*size != index)
-			{
-fprintf(stderr,"Bad size comparison: file:%s line:%d size:%d index:%d\n", __FILE__, __LINE__, *size, index);
-			status = MB_FAILURE;
-			*error = MB_ERROR_BAD_DATA;
-			*size = 0;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       bufferalloc:%d\n",*bufferalloc);
-		fprintf(stderr,"dbg2       size:       %d\n",*size);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}/*--------------------------------------------------------------------*/
-int mbr_reson7kr_wr_installation(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error)
-{
-	char	*function_name = "mbr_reson7kr_wr_installation";
-	int	status = MB_SUCCESS;
-	struct mbsys_reson7k_struct *store;
-	s7k_header *header;
-	s7kr_installation *installation;
-	unsigned int checksum;
-	int	index;
-	char	*buffer;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       bufferalloc:%d\n",*bufferalloc);
-		fprintf(stderr,"dbg2       bufferptr:  %p\n",(void *)bufferptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	installation = &(store->installation);
-	header = &(installation->header);
-
-	/* print out the data to be output */
-#ifdef MBR_RESON7KR_DEBUG
-	if (verbose > 0)
-#else
-	if (verbose >= 2)
-#endif
-	mbsys_reson7k_print_installation(verbose, installation, error);
-
-	/* figure out size of output record */
-	*size = MBSYS_RESON7K_RECORDHEADER_SIZE + MBSYS_RESON7K_RECORDTAIL_SIZE;
-	*size += R7KHDRSIZE_7kInstallationParameters;
-
-	/* allocate memory to write rest of record if necessary */
-	if (*bufferalloc < *size)
-		{
-		status = mb_reallocd(verbose, __FILE__, __LINE__, *size,
-					(void **)bufferptr, error);
-		if (status != MB_SUCCESS)
-			{
-			*bufferalloc = 0;
-			}
-		else
-			{
-			*bufferalloc = *size;
-			}
-		}
-
-	/* proceed to write if buffer allocated */
-	if (status == MB_SUCCESS)
-		{
-		/* get buffer for writing */
-		buffer = (char *) *bufferptr;
-
-		/* insert the header */
-		index = 0;
-		status = mbr_reson7kr_wr_header(verbose, buffer, &index, header, error);
-
-		/* insert the data */
-		index = header->Offset + 4;
-		mb_put_binary_float(MB_YES, installation->frequency, &buffer[index]); index += 4;
-		mb_put_binary_short(MB_YES, installation->firmware_version_len, &buffer[index]); index += 2;
-		for (i=0;i<128;i++)
-			{
-			buffer[index] = installation->firmware_version[i]; index++;
-			}
-		mb_put_binary_short(MB_YES, installation->software_version_len, &buffer[index]); index += 2;
-		for (i=0;i<128;i++)
-			{
-			buffer[index] = installation->software_version[i]; index++;
-			}
-		mb_put_binary_short(MB_YES, installation->s7k_version_len, &buffer[index]); index += 2;
-		for (i=0;i<128;i++)
-			{
-			buffer[index] = installation->s7k_version[i]; index++;
-			}
-		mb_put_binary_short(MB_YES, installation->protocal_version_len, &buffer[index]); index += 2;
-		for (i=0;i<128;i++)
-			{
-			buffer[index] = installation->protocal_version[i]; index++;
-			}
-		mb_put_binary_float(MB_YES, installation->transmit_x, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, installation->transmit_y, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, installation->transmit_z, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, installation->transmit_roll, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, installation->transmit_pitch, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, installation->transmit_heading, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, installation->receive_x, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, installation->receive_y, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, installation->receive_z, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, installation->receive_roll, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, installation->receive_pitch, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, installation->receive_heading, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, installation->motion_x, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, installation->motion_y, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, installation->motion_z, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, installation->motion_roll, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, installation->motion_pitch, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, installation->motion_heading, &buffer[index]); index += 4;
-		mb_put_binary_short(MB_YES, installation->motion_time_delay, &buffer[index]); index += 2;
-		mb_put_binary_float(MB_YES, installation->position_x, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, installation->position_y, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, installation->position_z, &buffer[index]); index += 4;
-		mb_put_binary_short(MB_YES, installation->position_time_delay, &buffer[index]); index += 2;
-		mb_put_binary_float(MB_YES, installation->waterline_z, &buffer[index]); index += 4;
-
-		/* reset the header size value */
-		mb_put_binary_int(MB_YES, ((unsigned int)(index + 4)), &buffer[8]);
-
-		/* now add the checksum */
-		checksum = 0;
-		for (i=0;i<index;i++)
-			checksum += (unsigned char) buffer[i];
-		mb_put_binary_int(MB_YES, checksum, &buffer[index]); index += 4;
-
-		/* check size */
-		if (*size != index)
-			{
-fprintf(stderr,"Bad size comparison: file:%s line:%d size:%d index:%d\n", __FILE__, __LINE__, *size, index);
-			status = MB_FAILURE;
-			*error = MB_ERROR_BAD_DATA;
-			*size = 0;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       bufferalloc:%d\n",*bufferalloc);
-		fprintf(stderr,"dbg2       size:       %d\n",*size);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_wr_fileheader(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error)
-{
-	char	*function_name = "mbr_reson7kr_wr_fileheader";
-	int	status = MB_SUCCESS;
-	struct mbsys_reson7k_struct *store;
-	s7k_header *header;
-	s7kr_fileheader *fileheader;
-	s7kr_subsystem *subsystem;
-	unsigned int checksum;
-	int	index;
-	char	*buffer;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       bufferalloc:%d\n",*bufferalloc);
-		fprintf(stderr,"dbg2       bufferptr:  %p\n",(void *)bufferptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	fileheader = &(store->fileheader);
-	header = &(fileheader->header);
-
-	/* make sure data are defined properly */
-	if (status == MB_SUCCESS && header->RecordType != R7KRECID_7kFileHeader)
-		{
-
-		/* Reson 7k data record header information */
-		header->Version = 4;
-		header->Offset = 60;
-		header->SyncPattern = 0x0000ffff;
-		header->OffsetToOptionalData = 0;
-		header->OptionalDataIdentifier = 0;
-		header->s7kTime.Year = 0;
-		header->s7kTime.Day = 0;
-		header->s7kTime.Seconds = 0.0;
-		header->s7kTime.Hours = 0;
-		header->s7kTime.Minutes = 0;
-		header->Reserved = 0;
-		header->RecordType = R7KRECID_7kFileHeader;
-		header->DeviceId = 0;
-		header->Reserved2 = 0;
-		header->SystemEnumerator = 0;
-		header->DataSetNumber = 0;
-		header->RecordNumber = 0;
-		for (i=0;i<8;i++)
-			{
-			header->PreviousRecord[i] = -1;
-			header->NextRecord[i] = -1;
-			}
-		header->Flags = 0;
-		header->Reserved3 = 0;
-		header->Reserved4 = 0;
-		header->FragmentedTotal = 0;
-		header->FragmentNumber = 0;
-		}
-
-	/* print out the data to be output */
-#ifdef MBR_RESON7KR_DEBUG
-	if (verbose > 0)
-#else
-	if (verbose >= 2)
-#endif
-	mbsys_reson7k_print_fileheader(verbose, fileheader, error);
-
-	/* figure out size of output record */
-	*size = MBSYS_RESON7K_RECORDHEADER_SIZE + MBSYS_RESON7K_RECORDTAIL_SIZE;
-	*size += R7KHDRSIZE_7kFileHeader + R7KRDTSIZE_7kFileHeader;
-	for (i=0;i<fileheader->number_subsystems;i++)
-		*size += 6;
-
-	/* allocate memory to write rest of record if necessary */
-	if (*bufferalloc < *size)
-		{
-		status = mb_reallocd(verbose, __FILE__, __LINE__, *size,
-					(void **)bufferptr, error);
-		if (status != MB_SUCCESS)
-			{
-			*bufferalloc = 0;
-			}
-		else
-			{
-			*bufferalloc = *size;
-			}
-		}
-
-	/* proceed to write if buffer allocated */
-	if (status == MB_SUCCESS)
-		{
-		/* get buffer for writing */
-		buffer = (char *) *bufferptr;
-
-		/* insert the header */
-		index = 0;
-		status = mbr_reson7kr_wr_header(verbose, buffer, &index, header, error);
-
-		/* insert the data */
-		index = header->Offset + 4;
-		for (i=0;i<16;i++)
-			{
-			buffer[index] = fileheader->file_identifier[i]; index++;
-			}
-		mb_put_binary_short(MB_YES, fileheader->version, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, fileheader->reserved, &buffer[index]); index += 2;
-		for (i=0;i<16;i++)
-			{
-			buffer[index] = fileheader->session_identifier[i]; index++;
-			}
-		mb_put_binary_int(MB_YES, fileheader->record_data_size, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, fileheader->number_subsystems, &buffer[index]); index += 4;
-		for (i=0;i<64;i++)
-			{
-			buffer[index] = fileheader->recording_name[i]; index++;
-			}
-		for (i=0;i<16;i++)
-			{
-			buffer[index] = fileheader->recording_version[i]; index++;
-			}
-		for (i=0;i<64;i++)
-			{
-			buffer[index] = fileheader->user_defined_name[i]; index++;
-			}
-		for (i=0;i<128;i++)
-			{
-			buffer[index] = fileheader->notes[i]; index++;
-			}
-		for (i=0;i<fileheader->number_subsystems;i++)
-			{
-			subsystem = &(fileheader->subsystem[i]);
-			mb_put_binary_int(MB_YES, subsystem->device_identifier, &buffer[index]); index += 4;
-			mb_put_binary_short(MB_YES, subsystem->system_enumerator, &buffer[index]); index += 2;
-			}
-
-		/* reset the header size value */
-		mb_put_binary_int(MB_YES, ((unsigned int)(index + 4)), &buffer[8]);
-
-		/* now add the checksum */
-		checksum = 0;
-		for (i=0;i<index;i++)
-			checksum += (unsigned char) buffer[i];
-		mb_put_binary_int(MB_YES, checksum, &buffer[index]); index += 4;
-
-		/* check size */
-		if (*size != index)
-			{
-fprintf(stderr,"Bad size comparison: file:%s line:%d size:%d index:%d\n", __FILE__, __LINE__, *size, index);
-			status = MB_FAILURE;
-			*error = MB_ERROR_BAD_DATA;
-			*size = 0;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       bufferalloc:%d\n",*bufferalloc);
-		fprintf(stderr,"dbg2       size:       %d\n",*size);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_wr_systemeventmessage(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error)
-{
-	char	*function_name = "mbr_reson7kr_wr_systemeventmessage";
-	int	status = MB_SUCCESS;
-	struct mbsys_reson7k_struct *store;
-	s7k_header *header;
-	s7kr_systemeventmessage *systemeventmessage;
-	unsigned int checksum;
-	int	index;
-	char	*buffer;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       bufferalloc:%d\n",*bufferalloc);
-		fprintf(stderr,"dbg2       bufferptr:  %p\n",(void *)bufferptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	systemeventmessage = &(store->systemeventmessage);
-	header = &(systemeventmessage->header);
-
-	/* print out the data to be output */
-#ifdef MBR_RESON7KR_DEBUG
-	if (verbose > 0)
-#else
-	if (verbose >= 2)
-#endif
-	mbsys_reson7k_print_systemeventmessage(verbose, systemeventmessage, error);
-
-	/* figure out size of output record */
-	*size = MBSYS_RESON7K_RECORDHEADER_SIZE + MBSYS_RESON7K_RECORDTAIL_SIZE;
-	*size += R7KHDRSIZE_7kSystemEventMessage;
-	*size += systemeventmessage->message_length;
-
-	/* allocate memory to write rest of record if necessary */
-	if (*bufferalloc < *size)
-		{
-		status = mb_reallocd(verbose, __FILE__, __LINE__, *size,
-					(void **)bufferptr, error);
-		if (status != MB_SUCCESS)
-			{
-			*bufferalloc = 0;
-			}
-		else
-			{
-			*bufferalloc = *size;
-			}
-		}
-
-	/* proceed to write if buffer allocated */
-	if (status == MB_SUCCESS)
-		{
-		/* get buffer for writing */
-		buffer = (char *) *bufferptr;
-
-		/* insert the header */
-		index = 0;
-		status = mbr_reson7kr_wr_header(verbose, buffer, &index, header, error);
-
-		/* insert the data */
-		index = header->Offset + 4;
-		mb_put_binary_long(MB_YES, systemeventmessage->serial_number, &buffer[index]); index += 8;
-		mb_put_binary_short(MB_YES, systemeventmessage->event_id, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, systemeventmessage->message_length, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, systemeventmessage->event_identifier, &buffer[index]); index += 2;
-
-		/* insert the data */
-		for (i=0;i<systemeventmessage->message_length;i++)
-			{
-			buffer[index] = systemeventmessage->message[i]; index++;
-			}
-
-		/* reset the header size value */
-		mb_put_binary_int(MB_YES, ((unsigned int)(index + 4)), &buffer[8]);
-
-		/* now add the checksum */
-		checksum = 0;
-		for (i=0;i<index;i++)
-			checksum += (unsigned char) buffer[i];
-		mb_put_binary_int(MB_YES, checksum, &buffer[index]); index += 4;
-
-		/* check size */
-		if (*size != index)
-			{
-fprintf(stderr,"Bad size comparison: file:%s line:%d size:%d index:%d\n", __FILE__, __LINE__, *size, index);
-			status = MB_FAILURE;
-			*error = MB_ERROR_BAD_DATA;
-			*size = 0;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       bufferalloc:%d\n",*bufferalloc);
-		fprintf(stderr,"dbg2       size:       %d\n",*size);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_wr_remotecontrolsettings(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error)
-{
-	char	*function_name = "mbr_reson7kr_wr_remotecontrolsettings";
-	int	status = MB_SUCCESS;
-	struct mbsys_reson7k_struct *store;
-	s7k_header *header;
-	s7kr_remotecontrolsettings *remotecontrolsettings;
-	unsigned int checksum;
-	int	index;
-	char	*buffer;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       bufferalloc:%d\n",*bufferalloc);
-		fprintf(stderr,"dbg2       bufferptr:  %p\n",(void *)bufferptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	remotecontrolsettings = &(store->remotecontrolsettings);
-	header = &(remotecontrolsettings->header);
-
-	/* print out the data to be output */
-#ifdef MBR_RESON7KR_DEBUG
-	if (verbose > 0)
-#else
-	if (verbose >= 2)
-#endif
-	mbsys_reson7k_print_remotecontrolsettings(verbose, remotecontrolsettings, error);
-
-	/* figure out size of output record */
-	*size = MBSYS_RESON7K_RECORDHEADER_SIZE + MBSYS_RESON7K_RECORDTAIL_SIZE;
-	*size += R7KHDRSIZE_7kRemoteControlSonarSettings;
-
-	/* allocate memory to write rest of record if necessary */
-	if (*bufferalloc < *size)
-		{
-		status = mb_reallocd(verbose, __FILE__, __LINE__, *size,
-					(void **)bufferptr, error);
-		if (status != MB_SUCCESS)
-			{
-			*bufferalloc = 0;
-			}
-		else
-			{
-			*bufferalloc = *size;
-			}
-		}
-
-	/* proceed to write if buffer allocated */
-	if (status == MB_SUCCESS)
-		{
-		/* get buffer for writing */
-		buffer = (char *) *bufferptr;
-
-		/* insert the header */
-		index = 0;
-		status = mbr_reson7kr_wr_header(verbose, buffer, &index, header, error);
-
-		/* insert the data */
-		index = header->Offset + 4;
-		mb_put_binary_long(MB_YES, remotecontrolsettings->serial_number, &buffer[index]); index += 8;
-		mb_put_binary_int(MB_YES, remotecontrolsettings->ping_number, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, remotecontrolsettings->frequency, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, remotecontrolsettings->sample_rate, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, remotecontrolsettings->receiver_bandwidth, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, remotecontrolsettings->pulse_width, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, remotecontrolsettings->pulse_type, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, remotecontrolsettings->pulse_envelope, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, remotecontrolsettings->pulse_envelope_par, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, remotecontrolsettings->pulse_reserved, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, remotecontrolsettings->max_ping_rate, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, remotecontrolsettings->ping_period, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, remotecontrolsettings->range_selection, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, remotecontrolsettings->power_selection, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, remotecontrolsettings->gain_selection, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, remotecontrolsettings->control_flags, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, remotecontrolsettings->projector_magic_no, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, remotecontrolsettings->steering_vertical, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, remotecontrolsettings->steering_horizontal, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, remotecontrolsettings->beamwidth_vertical, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, remotecontrolsettings->beamwidth_horizontal, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, remotecontrolsettings->focal_point, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, remotecontrolsettings->projector_weighting, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, remotecontrolsettings->projector_weighting_par, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, remotecontrolsettings->transmit_flags, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, remotecontrolsettings->hydrophone_magic_no, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, remotecontrolsettings->receive_weighting, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, remotecontrolsettings->receive_weighting_par, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, remotecontrolsettings->receive_flags, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, remotecontrolsettings->range_minimum, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, remotecontrolsettings->range_maximum, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, remotecontrolsettings->depth_minimum, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, remotecontrolsettings->depth_maximum, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, remotecontrolsettings->absorption, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, remotecontrolsettings->sound_velocity, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, remotecontrolsettings->spreading, &buffer[index]); index += 4;
-		mb_put_binary_short(MB_YES, remotecontrolsettings->reserved, &buffer[index]); index += 2;
-		mb_put_binary_float(MB_YES, remotecontrolsettings->tx_offset_x, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, remotecontrolsettings->tx_offset_y, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, remotecontrolsettings->tx_offset_z, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, remotecontrolsettings->head_tilt_x, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, remotecontrolsettings->head_tilt_y, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, remotecontrolsettings->head_tilt_z, &buffer[index]); index += 4;
-		mb_put_binary_short(MB_YES, remotecontrolsettings->ping_on_off, &buffer[index]); index += 2;
-		buffer[index] = remotecontrolsettings->data_sample_types; index++;
-		buffer[index] = remotecontrolsettings->projector_orientation; index++;
-		mb_put_binary_short(MB_YES, remotecontrolsettings->beam_angle_mode, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_YES, remotecontrolsettings->r7kcenter_mode, &buffer[index]); index += 2;
-		mb_put_binary_float(MB_YES, remotecontrolsettings->gate_depth_min, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, remotecontrolsettings->gate_depth_max, &buffer[index]); index += 4;
-		for (i=0;i<35;i++)
-			{
-			mb_put_binary_short(MB_YES, remotecontrolsettings->reserved2[i], &buffer[index]); index += 2;
-			}
-
-		/* reset the header size value */
-		mb_put_binary_int(MB_YES, ((unsigned int)(index + 4)), &buffer[8]);
-
-		/* now add the checksum */
-		checksum = 0;
-		for (i=0;i<index;i++)
-			checksum += (unsigned char) buffer[i];
-		mb_put_binary_int(MB_YES, checksum, &buffer[index]); index += 4;
-
-		/* check size */
-		if (*size != index)
-			{
-fprintf(stderr,"Bad size comparison: file:%s line:%d size:%d index:%d\n", __FILE__, __LINE__, *size, index);
-			status = MB_FAILURE;
-			*error = MB_ERROR_BAD_DATA;
-			*size = 0;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       bufferalloc:%d\n",*bufferalloc);
-		fprintf(stderr,"dbg2       size:       %d\n",*size);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_wr_reserved(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error)
-{
-	char	*function_name = "mbr_reson7kr_wr_reserved";
-	int	status = MB_SUCCESS;
-	struct mbsys_reson7k_struct *store;
-	s7k_header *header;
-	s7kr_reserved *reserved;
-	unsigned int checksum;
-	int	index;
-	char	*buffer;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       bufferalloc:%d\n",*bufferalloc);
-		fprintf(stderr,"dbg2       bufferptr:  %p\n",(void *)bufferptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	reserved = &(store->reserved);
-	header = &(reserved->header);
-
-	/* print out the data to be output */
-#ifdef MBR_RESON7KR_DEBUG
-	if (verbose > 0)
-#else
-	if (verbose >= 2)
-#endif
-	mbsys_reson7k_print_reserved(verbose, reserved, error);
-
-	/* figure out size of output record */
-	*size = MBSYS_RESON7K_RECORDHEADER_SIZE + MBSYS_RESON7K_RECORDTAIL_SIZE;
-	*size += R7KHDRSIZE_7kReserved;
-
-	/* allocate memory to write rest of record if necessary */
-	if (*bufferalloc < *size)
-		{
-		status = mb_reallocd(verbose, __FILE__, __LINE__, *size,
-					(void **)bufferptr, error);
-		if (status != MB_SUCCESS)
-			{
-			*bufferalloc = 0;
-			}
-		else
-			{
-			*bufferalloc = *size;
-			}
-		}
-
-	/* proceed to write if buffer allocated */
-	if (status == MB_SUCCESS)
-		{
-		/* get buffer for writing */
-		buffer = (char *) *bufferptr;
-
-		/* insert the header */
-		index = 0;
-		status = mbr_reson7kr_wr_header(verbose, buffer, &index, header, error);
-
-		/* insert the data */
-		index = header->Offset + 4;
-		for (i=0;i<R7KHDRSIZE_7kReserved;i++)
-			{
-			buffer[index] = reserved->reserved[i]; index++;
-			}
-
-		/* reset the header size value */
-		mb_put_binary_int(MB_YES, ((unsigned int)(index + 4)), &buffer[8]);
-
-		/* now add the checksum */
-		checksum = 0;
-		for (i=0;i<index;i++)
-			checksum += (unsigned char) buffer[i];
-		mb_put_binary_int(MB_YES, checksum, &buffer[index]); index += 4;
-
-		/* check size */
-		if (*size != index)
-			{
-fprintf(stderr,"Bad size comparison: file:%s line:%d size:%d index:%d\n", __FILE__, __LINE__, *size, index);
-			status = MB_FAILURE;
-			*error = MB_ERROR_BAD_DATA;
-			*size = 0;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       bufferalloc:%d\n",*bufferalloc);
-		fprintf(stderr,"dbg2       size:       %d\n",*size);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_wr_roll(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error)
-{
-	char	*function_name = "mbr_reson7kr_wr_roll";
-	int	status = MB_SUCCESS;
-	struct mbsys_reson7k_struct *store;
-	s7k_header *header;
-	s7kr_roll *roll;
-	unsigned int checksum;
-	int	index;
-	char	*buffer;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       bufferalloc:%d\n",*bufferalloc);
-		fprintf(stderr,"dbg2       bufferptr:  %p\n",(void *)bufferptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	roll = &(store->roll);
-	header = &(roll->header);
-
-	/* print out the data to be output */
-#ifdef MBR_RESON7KR_DEBUG
-	if (verbose > 0)
-#else
-	if (verbose >= 2)
-#endif
-	mbsys_reson7k_print_roll(verbose, roll, error);
-
-	/* figure out size of output record */
-	*size = MBSYS_RESON7K_RECORDHEADER_SIZE + MBSYS_RESON7K_RECORDTAIL_SIZE;
-	*size += R7KHDRSIZE_7kRoll;
-
-	/* allocate memory to write rest of record if necessary */
-	if (*bufferalloc < *size)
-		{
-		status = mb_reallocd(verbose, __FILE__, __LINE__, *size,
-					(void **)bufferptr, error);
-		if (status != MB_SUCCESS)
-			{
-			*bufferalloc = 0;
-			}
-		else
-			{
-			*bufferalloc = *size;
-			}
-		}
-
-	/* proceed to write if buffer allocated */
-	if (status == MB_SUCCESS)
-		{
-		/* get buffer for writing */
-		buffer = (char *) *bufferptr;
-
-		/* insert the header */
-		index = 0;
-		status = mbr_reson7kr_wr_header(verbose, buffer, &index, header, error);
-
-		/* insert the data */
-		index = header->Offset + 4;
-		mb_put_binary_float(MB_YES, roll->roll, &buffer[index]); index += 4;
-
-		/* reset the header size value */
-		mb_put_binary_int(MB_YES, ((unsigned int)(index + 4)), &buffer[8]);
-
-		/* now add the checksum */
-		checksum = 0;
-		for (i=0;i<index;i++)
-			checksum += (unsigned char) buffer[i];
-		mb_put_binary_int(MB_YES, checksum, &buffer[index]); index += 4;
-
-		/* check size */
-		if (*size != index)
-			{
-fprintf(stderr,"Bad size comparison: file:%s line:%d size:%d index:%d\n", __FILE__, __LINE__, *size, index);
-			status = MB_FAILURE;
-			*error = MB_ERROR_BAD_DATA;
-			*size = 0;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       bufferalloc:%d\n",*bufferalloc);
-		fprintf(stderr,"dbg2       size:       %d\n",*size);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_wr_pitch(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error)
-{
-	char	*function_name = "mbr_reson7kr_wr_pitch";
-	int	status = MB_SUCCESS;
-	struct mbsys_reson7k_struct *store;
-	s7k_header *header;
-	s7kr_pitch *pitch;
-	unsigned int checksum;
-	int	index;
-	char	*buffer;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       bufferalloc:%d\n",*bufferalloc);
-		fprintf(stderr,"dbg2       bufferptr:  %p\n",(void *)bufferptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	pitch = &(store->pitch);
-	header = &(pitch->header);
-
-	/* print out the data to be output */
-#ifdef MBR_RESON7KR_DEBUG
-	if (verbose > 0)
-#else
-	if (verbose >= 2)
-#endif
-	mbsys_reson7k_print_pitch(verbose, pitch, error);
-
-	/* figure out size of output record */
-	*size = MBSYS_RESON7K_RECORDHEADER_SIZE + MBSYS_RESON7K_RECORDTAIL_SIZE;
-	*size += R7KHDRSIZE_7kPitch;
-
-	/* allocate memory to write rest of record if necessary */
-	if (*bufferalloc < *size)
-		{
-		status = mb_reallocd(verbose, __FILE__, __LINE__, *size,
-					(void **)bufferptr, error);
-		if (status != MB_SUCCESS)
-			{
-			*bufferalloc = 0;
-			}
-		else
-			{
-			*bufferalloc = *size;
-			}
-		}
-
-	/* proceed to write if buffer allocated */
-	if (status == MB_SUCCESS)
-		{
-		/* get buffer for writing */
-		buffer = (char *) *bufferptr;
-
-		/* insert the header */
-		index = 0;
-		status = mbr_reson7kr_wr_header(verbose, buffer, &index, header, error);
-
-		/* insert the data */
-		index = header->Offset + 4;
-		mb_put_binary_float(MB_YES, pitch->pitch, &buffer[index]); index += 4;
-
-		/* reset the header size value */
-		mb_put_binary_int(MB_YES, ((unsigned int)(index + 4)), &buffer[8]);
-
-		/* now add the checksum */
-		checksum = 0;
-		for (i=0;i<index;i++)
-			checksum += (unsigned char) buffer[i];
-		mb_put_binary_int(MB_YES, checksum, &buffer[index]); index += 4;
-
-		/* check size */
-		if (*size != index)
-			{
-fprintf(stderr,"Bad size comparison: file:%s line:%d size:%d index:%d\n", __FILE__, __LINE__, *size, index);
-			status = MB_FAILURE;
-			*error = MB_ERROR_BAD_DATA;
-			*size = 0;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       bufferalloc:%d\n",*bufferalloc);
-		fprintf(stderr,"dbg2       size:       %d\n",*size);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_wr_soundvelocity(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error)
-{
-	char	*function_name = "mbr_reson7kr_wr_soundvelocity";
-	int	status = MB_SUCCESS;
-	struct mbsys_reson7k_struct *store;
-	s7k_header *header;
-	s7kr_soundvelocity *soundvelocity;
-	unsigned int checksum;
-	int	index;
-	char	*buffer;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       bufferalloc:%d\n",*bufferalloc);
-		fprintf(stderr,"dbg2       bufferptr:  %p\n",(void *)bufferptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	soundvelocity = &(store->soundvelocity);
-	header = &(soundvelocity->header);
-
-	/* print out the data to be output */
-#ifdef MBR_RESON7KR_DEBUG
-	if (verbose > 0)
-#else
-	if (verbose >= 2)
-#endif
-	mbsys_reson7k_print_soundvelocity(verbose, soundvelocity, error);
-
-	/* figure out size of output record */
-	*size = MBSYS_RESON7K_RECORDHEADER_SIZE + MBSYS_RESON7K_RECORDTAIL_SIZE;
-	*size += R7KHDRSIZE_7kSoundVelocity;
-
-	/* allocate memory to write rest of record if necessary */
-	if (*bufferalloc < *size)
-		{
-		status = mb_reallocd(verbose, __FILE__, __LINE__, *size,
-					(void **)bufferptr, error);
-		if (status != MB_SUCCESS)
-			{
-			*bufferalloc = 0;
-			}
-		else
-			{
-			*bufferalloc = *size;
-			}
-		}
-
-	/* proceed to write if buffer allocated */
-	if (status == MB_SUCCESS)
-		{
-		/* get buffer for writing */
-		buffer = (char *) *bufferptr;
-
-		/* insert the header */
-		index = 0;
-		status = mbr_reson7kr_wr_header(verbose, buffer, &index, header, error);
-
-		/* insert the data */
-		index = header->Offset + 4;
-		mb_put_binary_float(MB_YES, soundvelocity->soundvelocity, &buffer[index]); index += 4;
-
-		/* reset the header size value */
-		mb_put_binary_int(MB_YES, ((unsigned int)(index + 4)), &buffer[8]);
-
-		/* now add the checksum */
-		checksum = 0;
-		for (i=0;i<index;i++)
-			checksum += (unsigned char) buffer[i];
-		mb_put_binary_int(MB_YES, checksum, &buffer[index]); index += 4;
-
-		/* check size */
-		if (*size != index)
-			{
-fprintf(stderr,"Bad size comparison: file:%s line:%d size:%d index:%d\n", __FILE__, __LINE__, *size, index);
-			status = MB_FAILURE;
-			*error = MB_ERROR_BAD_DATA;
-			*size = 0;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       bufferalloc:%d\n",*bufferalloc);
-		fprintf(stderr,"dbg2       size:       %d\n",*size);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_wr_absorptionloss(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error)
-{
-	char	*function_name = "mbr_reson7kr_wr_absorptionloss";
-	int	status = MB_SUCCESS;
-	struct mbsys_reson7k_struct *store;
-	s7k_header *header;
-	s7kr_absorptionloss *absorptionloss;
-	unsigned int checksum;
-	int	index;
-	char	*buffer;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       bufferalloc:%d\n",*bufferalloc);
-		fprintf(stderr,"dbg2       bufferptr:  %p\n",(void *)bufferptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	absorptionloss = &(store->absorptionloss);
-	header = &(absorptionloss->header);
-
-	/* print out the data to be output */
-#ifdef MBR_RESON7KR_DEBUG
-	if (verbose > 0)
-#else
-	if (verbose >= 2)
-#endif
-	mbsys_reson7k_print_absorptionloss(verbose, absorptionloss, error);
-
-	/* figure out size of output record */
-	*size = MBSYS_RESON7K_RECORDHEADER_SIZE + MBSYS_RESON7K_RECORDTAIL_SIZE;
-	*size += R7KHDRSIZE_7kAbsorptionLoss;
-
-	/* allocate memory to write rest of record if necessary */
-	if (*bufferalloc < *size)
-		{
-		status = mb_reallocd(verbose, __FILE__, __LINE__, *size,
-					(void **)bufferptr, error);
-		if (status != MB_SUCCESS)
-			{
-			*bufferalloc = 0;
-			}
-		else
-			{
-			*bufferalloc = *size;
-			}
-		}
-
-	/* proceed to write if buffer allocated */
-	if (status == MB_SUCCESS)
-		{
-		/* get buffer for writing */
-		buffer = (char *) *bufferptr;
-
-		/* insert the header */
-		index = 0;
-		status = mbr_reson7kr_wr_header(verbose, buffer, &index, header, error);
-
-		/* insert the data */
-		index = header->Offset + 4;
-		mb_put_binary_float(MB_YES, absorptionloss->absorptionloss, &buffer[index]); index += 4;
-
-		/* reset the header size value */
-		mb_put_binary_int(MB_YES, ((unsigned int)(index + 4)), &buffer[8]);
-
-		/* now add the checksum */
-		checksum = 0;
-		for (i=0;i<index;i++)
-			checksum += (unsigned char) buffer[i];
-		mb_put_binary_int(MB_YES, checksum, &buffer[index]); index += 4;
-
-		/* check size */
-		if (*size != index)
-			{
-fprintf(stderr,"Bad size comparison: file:%s line:%d size:%d index:%d\n", __FILE__, __LINE__, *size, index);
-			status = MB_FAILURE;
-			*error = MB_ERROR_BAD_DATA;
-			*size = 0;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       bufferalloc:%d\n",*bufferalloc);
-		fprintf(stderr,"dbg2       size:       %d\n",*size);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_reson7kr_wr_spreadingloss(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error)
-{
-	char	*function_name = "mbr_reson7kr_wr_spreadingloss";
-	int	status = MB_SUCCESS;
-	struct mbsys_reson7k_struct *store;
-	s7k_header *header;
-	s7kr_spreadingloss *spreadingloss;
-	unsigned int checksum;
-	int	index;
-	char	*buffer;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       bufferalloc:%d\n",*bufferalloc);
-		fprintf(stderr,"dbg2       bufferptr:  %p\n",(void *)bufferptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	spreadingloss = &(store->spreadingloss);
-	header = &(spreadingloss->header);
-
-	/* print out the data to be output */
-#ifdef MBR_RESON7KR_DEBUG
-	if (verbose > 0)
-#else
-	if (verbose >= 2)
-#endif
-	mbsys_reson7k_print_spreadingloss(verbose, spreadingloss, error);
-
-	/* figure out size of output record */
-	*size = MBSYS_RESON7K_RECORDHEADER_SIZE + MBSYS_RESON7K_RECORDTAIL_SIZE;
-	*size += R7KHDRSIZE_7kSpreadingLoss;
-
-	/* allocate memory to write rest of record if necessary */
-	if (*bufferalloc < *size)
-		{
-		status = mb_reallocd(verbose, __FILE__, __LINE__, *size,
-					(void **)bufferptr, error);
-		if (status != MB_SUCCESS)
-			{
-			*bufferalloc = 0;
-			}
-		else
-			{
-			*bufferalloc = *size;
-			}
-		}
-
-	/* proceed to write if buffer allocated */
-	if (status == MB_SUCCESS)
-		{
-		/* get buffer for writing */
-		buffer = (char *) *bufferptr;
-
-		/* insert the header */
-		index = 0;
-		status = mbr_reson7kr_wr_header(verbose, buffer, &index, header, error);
-
-		/* insert the data */
-		index = header->Offset + 4;
-		mb_put_binary_float(MB_YES, spreadingloss->spreadingloss, &buffer[index]); index += 4;
-
-		/* reset the header size value */
-		mb_put_binary_int(MB_YES, ((unsigned int)(index + 4)), &buffer[8]);
-
-		/* now add the checksum */
-		checksum = 0;
-		for (i=0;i<index;i++)
-			checksum += (unsigned char) buffer[i];
-		mb_put_binary_int(MB_YES, checksum, &buffer[index]); index += 4;
-
-		/* check size */
-		if (*size != index)
-			{
-fprintf(stderr,"Bad size comparison: file:%s line:%d size:%d index:%d\n", __FILE__, __LINE__, *size, index);
-			status = MB_FAILURE;
-			*error = MB_ERROR_BAD_DATA;
-			*size = 0;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       bufferalloc:%d\n",*bufferalloc);
-		fprintf(stderr,"dbg2       size:       %d\n",*size);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mbr_samesurf.c b/src/mbio/mbr_samesurf.c
deleted file mode 100644
index 0be3edb..0000000
--- a/src/mbio/mbr_samesurf.c
+++ /dev/null
@@ -1,949 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbr_samesurf.c	6/13/2002
- *	$Id: mbr_samesurf.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 2002-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbr_samesurf.c contains the functions for reading and writing
- * multibeam data in the SAMESURF format.
- * These functions include:
- *   mbr_alm_samesurf	- allocate read/write memory
- *   mbr_dem_samesurf	- deallocate read/write memory
- *   mbr_rt_samesurf	- read and translate data
- *   mbr_wt_samesurf	- translate and write data
- *
- * Author:	D. W. Caress
- * Date:	June 13, 2002
- * $Log: mbr_samesurf.c,v $
- * Revision 5.9  2005/11/05 00:48:05  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.8  2003/11/24 21:04:29  caress
- * Implement Reinhard Holtkamp's suggested mods for better SURF format support.
- *
- * Revision 5.6  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.5  2003/03/06 00:14:52  caress
- * Put in Reinhard Holtkamp's mod's to support SVP data.
- *
- * Revision 5.4  2003/02/27 04:33:33  caress
- * Fixed handling of SURF format data.
- *
- * Revision 5.3  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.2  2002/08/02 01:01:10  caress
- * 5.0.beta22
- *
- * Revision 5.1  2002/07/20 20:42:40  caress
- * Release 5.0.beta20
- *
- * Revision 5.0  2002/06/13 22:56:59  caress
- * Initial Revision
- *
- *
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mb_define.h"
-#include "../surf/mb_sapi.h"
-#include "mbsys_surf.h"
-
-/* essential function prototypes */
-int mbr_register_samesurf(int verbose, void *mbio_ptr,
-		int *error);
-int mbr_info_samesurf(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_alm_samesurf(int verbose, void *mbio_ptr, int *error);
-int mbr_dem_samesurf(int verbose, void *mbio_ptr, int *error);
-int mbr_rt_samesurf(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_wt_samesurf(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-
-static char rcs_id[]="$Id: mbr_samesurf.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mbr_register_samesurf(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_register_samesurf";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* get mb_io_ptr */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set format info parameters */
-	status = mbr_info_samesurf(verbose,
-			&mb_io_ptr->system,
-			&mb_io_ptr->beams_bath_max,
-			&mb_io_ptr->beams_amp_max,
-			&mb_io_ptr->pixels_ss_max,
-			mb_io_ptr->format_name,
-			mb_io_ptr->system_name,
-			mb_io_ptr->format_description,
-			&mb_io_ptr->numfile,
-			&mb_io_ptr->filetype,
-			&mb_io_ptr->variable_beams,
-			&mb_io_ptr->traveltime,
-			&mb_io_ptr->beam_flagging,
-			&mb_io_ptr->nav_source,
-			&mb_io_ptr->heading_source,
-			&mb_io_ptr->vru_source,
-			&mb_io_ptr->svp_source,
-			&mb_io_ptr->beamwidth_xtrack,
-			&mb_io_ptr->beamwidth_ltrack,
-			error);
-
-	/* set format and system specific function pointers */
-	mb_io_ptr->mb_io_format_alloc = &mbr_alm_samesurf;
-	mb_io_ptr->mb_io_format_free = &mbr_dem_samesurf;
-	mb_io_ptr->mb_io_store_alloc = &mbsys_surf_alloc;
-	mb_io_ptr->mb_io_store_free = &mbsys_surf_deall;
-	mb_io_ptr->mb_io_read_ping = &mbr_rt_samesurf;
-	mb_io_ptr->mb_io_write_ping = &mbr_wt_samesurf;
-	mb_io_ptr->mb_io_dimensions = &mbsys_surf_dimensions;
-	mb_io_ptr->mb_io_extract = &mbsys_surf_extract;
-	mb_io_ptr->mb_io_insert = &mbsys_surf_insert;
-	mb_io_ptr->mb_io_extract_nav = &mbsys_surf_extract_nav;
-	mb_io_ptr->mb_io_insert_nav = &mbsys_surf_insert_nav;
-	mb_io_ptr->mb_io_extract_altitude = &mbsys_surf_extract_altitude;
-	mb_io_ptr->mb_io_insert_altitude = NULL;
-	mb_io_ptr->mb_io_extract_svp = &mbsys_surf_extract_svp;
-	mb_io_ptr->mb_io_insert_svp = &mbsys_surf_insert_svp;
-	mb_io_ptr->mb_io_ttimes = &mbsys_surf_ttimes;
-	mb_io_ptr->mb_io_detects = &mbsys_surf_detects;
-	mb_io_ptr->mb_io_copyrecord = &mbsys_surf_copy;
-	mb_io_ptr->mb_io_extract_rawss = NULL;
-	mb_io_ptr->mb_io_insert_rawss = NULL;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",mb_io_ptr->system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",mb_io_ptr->beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",mb_io_ptr->beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",mb_io_ptr->pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",mb_io_ptr->format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",mb_io_ptr->system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",mb_io_ptr->format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",mb_io_ptr->numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",mb_io_ptr->filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",mb_io_ptr->variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",mb_io_ptr->traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",mb_io_ptr->beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",mb_io_ptr->nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",mb_io_ptr->heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",mb_io_ptr->vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",mb_io_ptr->svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",mb_io_ptr->beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",mb_io_ptr->beamwidth_ltrack);
-		fprintf(stderr,"dbg2       format_alloc:       %p\n",(void *)mb_io_ptr->mb_io_format_alloc);
-		fprintf(stderr,"dbg2       format_free:        %p\n",(void *)mb_io_ptr->mb_io_format_free);
-		fprintf(stderr,"dbg2       store_alloc:        %p\n",(void *)mb_io_ptr->mb_io_store_alloc);
-		fprintf(stderr,"dbg2       store_free:         %p\n",(void *)mb_io_ptr->mb_io_store_free);
-		fprintf(stderr,"dbg2       read_ping:          %p\n",(void *)mb_io_ptr->mb_io_read_ping);
-		fprintf(stderr,"dbg2       write_ping:         %p\n",(void *)mb_io_ptr->mb_io_write_ping);
-		fprintf(stderr,"dbg2       extract:            %p\n",(void *)mb_io_ptr->mb_io_extract);
-		fprintf(stderr,"dbg2       insert:             %p\n",(void *)mb_io_ptr->mb_io_insert);
-		fprintf(stderr,"dbg2       extract_nav:        %p\n",(void *)mb_io_ptr->mb_io_extract_nav);
-		fprintf(stderr,"dbg2       insert_nav:         %p\n",(void *)mb_io_ptr->mb_io_insert_nav);
-		fprintf(stderr,"dbg2       extract_altitude:   %p\n",(void *)mb_io_ptr->mb_io_extract_altitude);
-		fprintf(stderr,"dbg2       insert_altitude:    %p\n",(void *)mb_io_ptr->mb_io_insert_altitude);
-		fprintf(stderr,"dbg2       extract_svp:        %p\n",(void *)mb_io_ptr->mb_io_extract_svp);
-		fprintf(stderr,"dbg2       insert_svp:         %p\n",(void *)mb_io_ptr->mb_io_insert_svp);
-		fprintf(stderr,"dbg2       ttimes:             %p\n",(void *)mb_io_ptr->mb_io_ttimes);
-		fprintf(stderr,"dbg2       extract_rawss:      %p\n",(void *)mb_io_ptr->mb_io_extract_rawss);
-		fprintf(stderr,"dbg2       insert_rawss:       %p\n",(void *)mb_io_ptr->mb_io_insert_rawss);
-		fprintf(stderr,"dbg2       copyrecord:         %p\n",(void *)mb_io_ptr->mb_io_copyrecord);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbr_info_samesurf(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error)
-{
-	char	*function_name = "mbr_info_samesurf";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* set format info parameters */
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-	*system = MB_SYS_SURF;
-	*beams_bath_max = MBSYS_SURF_MAXBEAMS;
-	*beams_amp_max = MBSYS_SURF_MAXBEAMS;
-	*pixels_ss_max = MBSYS_SURF_MAXPIXELS;
-	strncpy(format_name, "SAMESURF", MB_NAME_LENGTH);
-	strncpy(system_name, "SURF", MB_NAME_LENGTH);
-	strncpy(format_description, "Format name:          MBF_SAMESURF\nInformal Description: SAM Electronics SURF format.\nAttributes:           variable beams,  bathymetry, amplitude,  and sidescan,\n                      binary, single files, SAM Electronics (formerly Krupp-Atlas Electronik). \n", MB_DESCRIPTION_LENGTH);
-	*numfile = 1;
-	*filetype = MB_FILETYPE_SURF;
-	*variable_beams = MB_YES;
-	*traveltime = MB_YES;
-	*beam_flagging = MB_YES;
-	*nav_source = MB_DATA_DATA;
-	*heading_source = MB_DATA_DATA;
-	*vru_source = MB_DATA_DATA;
-	*svp_source = MB_DATA_DATA;
-	*beamwidth_xtrack = 0.0;
-	*beamwidth_ltrack = 0.0;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",*system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",*beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",*beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",*pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",*numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",*filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",*variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",*traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",*beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",*nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",*heading_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",*heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",*vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",*svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",*beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",*beamwidth_ltrack);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_alm_samesurf(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_alm_samesurf";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set initial status */
-	status = MB_SUCCESS;
-
-	/* allocate memory for data structure */
-	status = mbsys_surf_alloc(verbose,mbio_ptr,
-		&mb_io_ptr->store_data,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_dem_samesurf(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_dem_samesurf";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* deallocate memory for data descriptor */
-	status = mbsys_surf_deall(verbose,mbio_ptr,
-		&mb_io_ptr->store_data,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_rt_samesurf(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_rt_samesurf";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_surf_struct *store;
-	int	sapi_verbose;
-	int	sapi_status;
-	SurfSoundingData		*SoundingDataPtr;
-	SurfTransducerParameterTable	*ActualTransducerTablePtr;
-	SurfMultiBeamAngleTable		*ActualAngleTablePtr;
-	SurfCProfileTable		*ActualCProfileTablePtr;
-	SurfCenterPosition		*CenterPositionPtr;
-	SurfSingleBeamDepth		*SingleBeamDepthPtr;
-	SurfMultiBeamDepth		*MultiBeamDepthPtr;
-	SurfMultiBeamTT			*MultiBeamTraveltimePtr;
-	SurfMultiBeamReceive		*MultiBeamReceiveParamsPtr;
-	SurfAmplitudes			*MultibeamBeamAmplitudesPtr;
-	SurfExtendedAmplitudes		*MultibeamExtendedBeamAmplitudesPtr;
-	SurfSignalParameter		*MultibeamSignalParametersPtr;
-	SurfTxParameter			*MultibeamTransmitterParametersPtr;
-	SurfSidescanData		*SidescanDataPtr;
-	int	utm_zone;
-	char	projection[MB_NAME_LENGTH];
-	double	easting, northing, lon, lat;
-	double	*refeasting, *refnorthing;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor and data structure */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-	store = (struct mbsys_surf_struct *) store_ptr;
-	refeasting = &(mb_io_ptr->saved1);
-	refnorthing = &(mb_io_ptr->saved2);
-
-	/* set sapi verbosity */
-	if (verbose > 1)
-	    sapi_verbose = verbose;
-	else
-	    sapi_verbose = 0;
-
-	/* read global info if the structure is blank (usually first time through) */
-	if (store->initialized == MB_NO)
-		{
-		strncpy(store->NameOfShip, SAPI_getNameOfShip(),LABEL_SIZE);
-		strncpy(store->NameOfSounder, SAPI_getNameOfSounder(),LABEL_SIZE);
-		strncpy(store->TypeOfSounder, SAPI_getTypeOfSounder(),LABEL_SIZE);
-		store->NrSoundings = SAPI_getNrSoundings();
-		store->NrBeams = SAPI_getNrBeams();
-		store->SAPI_posPresentationIsRad = SAPI_posPresentationIsRad();
-		store->NrPositionsensors = SAPI_getNrPositionsensors();
-		store->NrSoundvelocityProfiles = SAPI_getNrSoundvelocityProfiles();
-		store->NrEvents = SAPI_getNrEvents();
-		store->NrPolygonElements = SAPI_getNrPolygonElements();
-		store->AbsoluteStartTimeOfProfile = SAPI_getAbsoluteStartTimeOfProfile();
-
-		store->GlobalData = *(SAPI_getGlobalData());
-		store->Statistics = *(SAPI_getStatistics());
-
-		for (i=0; i<MIN(MBSYS_SURF_MAXCPOS,
-				store->NrPositionsensors); i++)
-			{
-			store->PositionSensor[i] = *(SAPI_getPositionSensor(i));
-			}
-
-		/* initialize UTM projection if required */
-		if (store->GlobalData.presentationOfPosition == 'X'
-			&& mb_io_ptr->projection_initialized == MB_NO)
-			{
-			/* initialize UTM projection */
-			utm_zone = (int)(((RTD * store->GlobalData.referenceMeridian + 183.0)
-					/ 6.0) + 0.5);
-			sprintf(projection,"UTM%2.2dN", utm_zone);
-			mb_proj_init(verbose, projection, &(mb_io_ptr->pjptr), error);
-			store->GlobalData.presentationOfPosition = 'E';
-			mb_io_ptr->projection_initialized = MB_YES;
-
-			/* Set reference longitude and latitude */
-			easting = store->GlobalData.referenceOfPositionX;
-			northing = store->GlobalData.referenceOfPositionY;
-			mb_proj_inverse(verbose, mb_io_ptr->pjptr,
-							easting, northing,
-							&lon, &lat,
-							error);
-			store->GlobalData.referenceOfPositionX = DTR * lon;
-			store->GlobalData.referenceOfPositionY = DTR * lat;
-			*refeasting = easting;
-			*refnorthing = northing;
-
-			/* Set min longitude and latitude */
-			easting = store->Statistics.minEasting;
-			northing = store->Statistics.minNorthing;
-			mb_proj_inverse(verbose, mb_io_ptr->pjptr,
-							easting, northing,
-							&lon, &lat,
-							error);
-			store->Statistics.minEasting = DTR * lon;
-			store->Statistics.minNorthing = DTR * lat;
-
-			/* Set max longitude and latitude */
-			easting = store->Statistics.maxEasting;
-			northing = store->Statistics.maxNorthing;
-			mb_proj_inverse(verbose, mb_io_ptr->pjptr,
-							easting, northing,
-							&lon, &lat,
-							error);
-			store->Statistics.maxEasting = DTR * lon;
-			store->Statistics.maxNorthing = DTR * lat;
-			}
-
-		store->initialized = MB_YES;
-		}
-
-	/* else get access to next sounding */
-	else
-		{
-		sapi_status = SAPI_nextSounding(sapi_verbose);
-		if (sapi_status != 0)
-			{
-			*error = MB_ERROR_EOF;
-			status = MB_FAILURE;
-			}
-		}
-
-	/* extract data for current sounding */
-	if (status == MB_SUCCESS)
-		{
-		/* set kind */
-		store->kind = MB_DATA_DATA;
-
-		/* extract data */
-		SoundingDataPtr = SAPI_getSoundingData();
-		if (SoundingDataPtr != NULL)
-			store->SoundingData = *SoundingDataPtr;
-
-		ActualTransducerTablePtr = SAPI_getActualTransducerTable();
-		if (ActualTransducerTablePtr != NULL)
-			store->ActualTransducerTable = *ActualTransducerTablePtr;
-
-		ActualAngleTablePtr = SAPI_getActualAngleTable();
-		if (ActualAngleTablePtr != NULL)
-			{
-			store->ActualAngleTable = *ActualAngleTablePtr;
-			for (i=1; i<MIN(MBSYS_SURF_MAXBEAMS,
-					ActualAngleTablePtr->actualNumberOfBeams); i++)
-				{
-				store->ActualAngleTable.beamAngle[i]
-					= ActualAngleTablePtr->beamAngle[i];
-				}
-			}
-
-		ActualCProfileTablePtr = SAPI_getActualCProfileTable();
-		if (ActualCProfileTablePtr != NULL)
-			{
-			store->ActualCProfileTable = *ActualCProfileTablePtr;
-			for (i=1; i<MIN(MBSYS_SURF_MAXCVALUES,
-					ActualCProfileTablePtr->numberOfActualValues); i++)
-				{
-				store->ActualCProfileTable.values[i]
-					= ActualCProfileTablePtr->values[i];
-				}
-			}
-
-		for (i=0; i<MIN(MBSYS_SURF_MAXCPOS,
-				store->NrPositionsensors); i++)
-			{
-			CenterPositionPtr = SAPI_getCenterPosition(i);
-			if (CenterPositionPtr != NULL)
-				{
-				store->CenterPosition[i] = *CenterPositionPtr;
-
-				/* convert position from UTM easting and northing
-					to lon lat if necessary */
-				if (mb_io_ptr->projection_initialized == MB_YES)
-					{
-					easting = store->CenterPosition[i].centerPositionX
-							+ *refeasting;
-					northing = store->CenterPosition[i].centerPositionY
-							+ *refnorthing;
-					mb_proj_inverse(verbose, mb_io_ptr->pjptr,
-								easting, northing,
-								&lon, &lat,
-								error);
-					store->CenterPosition[i].centerPositionX = (float)
-						(DTR * lon - store->GlobalData.referenceOfPositionX);
-					store->CenterPosition[i].centerPositionY = (float)
-						(DTR * lat - store->GlobalData.referenceOfPositionY);
-					}
-				}
-			}
-
-		SingleBeamDepthPtr = SAPI_getSingleBeamDepth();
-		if (SingleBeamDepthPtr != NULL)
-			store->SingleBeamDepth = *SingleBeamDepthPtr;
-
-		i = 0;
-		while ( (i < MIN(MBSYS_SURF_MAXBEAMS, store->NrBeams)) &&
-				((MultiBeamDepthPtr = SAPI_getMultiBeamDepth(i)) != NULL) )
-			{
-			store->MultiBeamDepth[i++] = *MultiBeamDepthPtr;
-			}
-		store->NrDepths = i;
-
-		i = 0;
-		while ( (i < MIN(MBSYS_SURF_MAXBEAMS, store->NrBeams)) &&
-				((MultiBeamTraveltimePtr = SAPI_getMultiBeamTraveltime(i)) != NULL) )
-			{
-			store->MultiBeamTraveltime[i++] = *MultiBeamTraveltimePtr;
-			}
-		store->NrTravelTimes = i;
-
-		i = 0;
-		while ( (i < MIN(MBSYS_SURF_MAXBEAMS, store->NrBeams)) &&
-				((MultiBeamReceiveParamsPtr = SAPI_getMultiBeamReceiveParams(i)) != NULL) )
-			{
-			store->MultiBeamReceiveParams[i++] = *MultiBeamReceiveParamsPtr;
-			}
-		store->NrRxSets = i;
-
-		i = 0;
-		while ( (i < MIN(MBSYS_SURF_MAXBEAMS, store->NrBeams)) &&
-				((MultibeamBeamAmplitudesPtr = SAPI_getMultibeamBeamAmplitudes(i)) != NULL) )
-			{
-			store->MultibeamBeamAmplitudes[i++] = *MultibeamBeamAmplitudesPtr;
-			}
-		store->NrAmplitudes = i;
-
-		i = 0;
-		while ( (i < MIN(MBSYS_SURF_MAXBEAMS, store->NrBeams)) &&
-				((MultibeamExtendedBeamAmplitudesPtr = SAPI_getMultibeamExtendedBeamAmplitudes(i)) != NULL) )
-			{
-			store->MultibeamExtendedBeamAmplitudes[i++] = *MultibeamExtendedBeamAmplitudesPtr;
-			}
-		store->NrExtAmplitudes = i;
-
-		MultibeamSignalParametersPtr = SAPI_getMultibeamSignalParameters();
-		if (MultibeamSignalParametersPtr != NULL)
-			{
-			store->MultibeamSignalParameters = *MultibeamSignalParametersPtr;
-			for (i=1; i<MIN(MBSYS_SURF_MAXRXSETS,
-					MultibeamSignalParametersPtr->nrActualGainSets);
-					i++)
-				{
-				store->MultibeamSignalParameters.rxSets[i]
-					= MultibeamSignalParametersPtr->rxSets[i];
-				}
-			}
-
-		store->NrTxSets = 0;
-		MultibeamTransmitterParametersPtr =
-			SAPI_getMultibeamTransmitterParameters(&store->NrTxSets);
-		if (MultibeamTransmitterParametersPtr != NULL)
-			{
-			store->NrTxSets = MIN(MBSYS_SURF_MAXTXSETS,store->NrTxSets);
-			store->MultibeamTransmitterParameters = *MultibeamTransmitterParametersPtr;
-			for (i=1; i<store->NrTxSets; i++)
-				{
-				store->MultibeamTransmitterParameters.txSets[i]
-					= MultibeamTransmitterParametersPtr->txSets[i];
-				}
- 			}
-
-		store->NrSidescan = 0;
-		SidescanDataPtr = SAPI_getSidescanData();
-		if (SidescanDataPtr != NULL)
-			{
-			store->SidescanData = *SidescanDataPtr;
-			store->NrSidescan = MIN(MBSYS_SURF_MAXPIXELS,
-					SidescanDataPtr->actualNrOfSsDataPort
-					+ SidescanDataPtr->actualNrOfSsDataStb);
-			for (i=1; i<store->NrSidescan; i++)
-				{
-				store->SidescanData.ssData[i]
-					= SidescanDataPtr->ssData[i];
-				}
-			}
-		}
-
-	/* set error and kind in mb_io_ptr */
-	mb_io_ptr->new_error = *error;
-	mb_io_ptr->new_kind = store->kind;
-
-	/* output debug info */
-	if (verbose >= 4)
-		{
-		fprintf(stderr,"\ndbg4  New record read by MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg4  New record kind:\n");
-		fprintf(stderr,"dbg4       error:      %d\n",
-			mb_io_ptr->new_error);
-		fprintf(stderr,"dbg4       kind:       %d\n",
-			mb_io_ptr->new_kind);
-		}
-	if (verbose >= 4 && store->kind == MB_DATA_DATA)
-		{
-		fprintf(stderr,"\ndbg4  New ping read by MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg4  New ping values:\n");
-		fprintf(stderr,"dbg4       kind:               %d\n", store->kind);
-		fprintf(stderr,"dbg4       initialized:        %d\n", store->initialized);
-		fprintf(stderr,"dbg4       NameOfShip:         %s\n", store->NameOfShip);
-		fprintf(stderr,"dbg4       TypeOfSounder:      %s\n", store->TypeOfSounder);
-		fprintf(stderr,"dbg4       NameOfSounder:      %s\n", store->NameOfSounder);
-		fprintf(stderr,"dbg4       NrSoundings:               %d\n", store->NrSoundings);
-		fprintf(stderr,"dbg4       NrBeams:                   %d\n", store->NrBeams);
-		fprintf(stderr,"dbg4       SAPI_posPresentationIsRad: %d\n", store->SAPI_posPresentationIsRad);
-		fprintf(stderr,"dbg4       NrPositionsensors:         %d\n", store->NrPositionsensors);
-		fprintf(stderr,"dbg4       NrSoundvelocityProfiles:   %d\n", store->NrSoundvelocityProfiles);
-		fprintf(stderr,"dbg4       NrEvents:                  %d\n", store->NrEvents);
-		fprintf(stderr,"dbg4       NrPolygonElements:         %d\n", store->NrPolygonElements);
-		fprintf(stderr,"dbg4       AbsoluteStartTimeOfProfile:%f\n", store->AbsoluteStartTimeOfProfile);
-
-		fprintf(stderr,"dbg4       GlobalData.label:                       %s\n", store->GlobalData.label);
-		fprintf(stderr,"dbg4       GlobalData.shipsName:                   %s\n", store->GlobalData.shipsName);
-		fprintf(stderr,"dbg4       GlobalData.startTimeOfProfile:          %s\n", store->GlobalData.startTimeOfProfile);
-		fprintf(stderr,"dbg4       GlobalData.regionOfProfile:             %s\n", store->GlobalData.regionOfProfile);
-		fprintf(stderr,"dbg4       GlobalData.numberOfProfile:             %s\n", store->GlobalData.numberOfProfile);
-		fprintf(stderr,"dbg4       GlobalData.chartZero:                   %f\n", store->GlobalData.chartZero);
-		fprintf(stderr,"dbg4       GlobalData.tideZero:                    %f\n", store->GlobalData.tideZero);
-		fprintf(stderr,"dbg4       GlobalData.numberOfMeasuredSoundings:   %d\n", store->GlobalData.numberOfMeasuredSoundings);
-		fprintf(stderr,"dbg4       GlobalData.actualNumberOfSoundingSets:  %d\n", store->GlobalData.actualNumberOfSoundingSets);
-		fprintf(stderr,"dbg4       GlobalData.timeDateOfTideModification:  %s\n", store->GlobalData.timeDateOfTideModification);
-		fprintf(stderr,"dbg4       GlobalData.timeDateOfDepthModification: %s\n", store->GlobalData.timeDateOfDepthModification);
-		fprintf(stderr,"dbg4       GlobalData.timeDateOfPosiModification:  %s\n", store->GlobalData.timeDateOfPosiModification);
-		fprintf(stderr,"dbg4       GlobalData.timeDateOfParaModification:  %s\n", store->GlobalData.timeDateOfParaModification);
-		fprintf(stderr,"dbg4       GlobalData.correctedParameterFlags:     %d\n", store->GlobalData.correctedParameterFlags);
-		fprintf(stderr,"dbg4       GlobalData.offsetHeave:                 %f\n", store->GlobalData.offsetHeave);
-		fprintf(stderr,"dbg4       GlobalData.offsetRollPort:              %f\n", store->GlobalData.offsetRollPort);
-		fprintf(stderr,"dbg4       GlobalData.offsetRollStar:              %f\n", store->GlobalData.offsetRollStar);
-		fprintf(stderr,"dbg4       GlobalData.offsetPitchFore:             %f\n", store->GlobalData.offsetPitchFore);
-		fprintf(stderr,"dbg4       GlobalData.offsetPitchAft:              %f\n", store->GlobalData.offsetPitchAft);
-		fprintf(stderr,"dbg4       GlobalData.nameOfSounder:               %s\n", store->GlobalData.nameOfSounder);
-		fprintf(stderr,"dbg4       GlobalData.typeOfSounder:               %c\n", store->GlobalData.typeOfSounder);
-		fprintf(stderr,"dbg4       GlobalData.highFrequency:               %f\n", store->GlobalData.highFrequency);
-		fprintf(stderr,"dbg4       GlobalData.mediumFrequency:             %f\n", store->GlobalData.mediumFrequency);
-		fprintf(stderr,"dbg4       GlobalData.lowFrequency:                %f\n", store->GlobalData.lowFrequency);
-		fprintf(stderr,"dbg4       GlobalData.nameOfEllipsoid:             %s\n", store->GlobalData.nameOfEllipsoid);
-		fprintf(stderr,"dbg4       GlobalData.semiMajorAxis:               %f\n", store->GlobalData.semiMajorAxis);
-		fprintf(stderr,"dbg4       GlobalData.flattening:                  %f\n", store->GlobalData.flattening);
-		fprintf(stderr,"dbg4       GlobalData.projection:                  %s\n", store->GlobalData.projection);
-		fprintf(stderr,"dbg4       GlobalData.presentationOfPosition:      %c\n", store->GlobalData.presentationOfPosition);
-		fprintf(stderr,"dbg4       GlobalData.referenceMeridian:           %f\n", store->GlobalData.referenceMeridian);
-		fprintf(stderr,"dbg4       GlobalData.falseEasting:                %f\n", store->GlobalData.falseEasting);
-		fprintf(stderr,"dbg4       GlobalData.falseNorthing:               %f\n", store->GlobalData.falseNorthing);
-		fprintf(stderr,"dbg4       GlobalData.referenceOfPositionX:        %f\n", store->GlobalData.referenceOfPositionX);
-		fprintf(stderr,"dbg4       GlobalData.referenceOfPositionY:        %f\n", store->GlobalData.referenceOfPositionY);
-		fprintf(stderr,"dbg4       GlobalData.presentationOfRelWay:        %c\n", store->GlobalData.presentationOfRelWay);
-		fprintf(stderr,"dbg4       GlobalData.planedTrackStartX:           %f\n", store->GlobalData.planedTrackStartX);
-		fprintf(stderr,"dbg4       GlobalData.planedTrackStartY:           %f\n", store->GlobalData.planedTrackStartY);
-		fprintf(stderr,"dbg4       GlobalData.planedTrackStopX:            %f\n", store->GlobalData.planedTrackStopX);
-		fprintf(stderr,"dbg4       GlobalData.planedTrackStopY: 	   %f\n", store->GlobalData.planedTrackStopY);
-		fprintf(stderr,"dbg4       GlobalData.originalTrackStartX:         %f\n", store->GlobalData.originalTrackStartX);
-		fprintf(stderr,"dbg4       GlobalData.originalTrackStartY:         %f\n", store->GlobalData.originalTrackStartY);
-		fprintf(stderr,"dbg4       GlobalData.originalTrackStopX:          %f\n", store->GlobalData.originalTrackStopX);
-		fprintf(stderr,"dbg4       GlobalData.originalTrackStopY:          %f\n", store->GlobalData.originalTrackStopY);
-		fprintf(stderr,"dbg4       GlobalData.originalStartStopDistance:   %f\n", store->GlobalData.originalStartStopDistance);
-		fprintf(stderr,"dbg4       GlobalData.originalStartStopTime:       %f\n", store->GlobalData.originalStartStopTime);
-		fprintf(stderr,"dbg4       GlobalData.timeDateOfTrackModification: %s\n", store->GlobalData.timeDateOfTrackModification);
-		fprintf(stderr,"dbg4       GlobalData.modifiedTrackStartX:         %f\n", store->GlobalData.modifiedTrackStartX);
-		fprintf(stderr,"dbg4       GlobalData.modifiedTrackStartY:         %f\n", store->GlobalData.modifiedTrackStartY);
-		fprintf(stderr,"dbg4       GlobalData.modifiedTrackStopX:          %f\n", store->GlobalData.modifiedTrackStopX);
-		fprintf(stderr,"dbg4       GlobalData.modifiedTrackStopY:          %f\n", store->GlobalData.modifiedTrackStopY);
-		fprintf(stderr,"dbg4       GlobalData.modifiedStartStopDistance:   %f\n", store->GlobalData.modifiedStartStopDistance);
-
-		fprintf(stderr,"dbg4       Statistics.label:                       %s\n", store->Statistics.label);
-		fprintf(stderr,"dbg4       Statistics.minNorthing:                 %f\n", store->Statistics.minNorthing);
-		fprintf(stderr,"dbg4       Statistics.maxNorthing:                 %f\n", store->Statistics.maxNorthing);
-		fprintf(stderr,"dbg4       Statistics.minEasting:                  %f\n", store->Statistics.minEasting);
-		fprintf(stderr,"dbg4       Statistics.maxEasting:                  %f\n", store->Statistics.maxEasting);
-		fprintf(stderr,"dbg4       Statistics.minSpeed:                    %f\n", store->Statistics.minSpeed);
-		fprintf(stderr,"dbg4       Statistics.maxSpeed:                    %f\n", store->Statistics.maxSpeed);
-		fprintf(stderr,"dbg4       Statistics.minRoll:                     %f\n", store->Statistics.minRoll);
-		fprintf(stderr,"dbg4       Statistics.maxRoll:                     %f\n", store->Statistics.maxRoll);
-		fprintf(stderr,"dbg4       Statistics.minPitch:                    %f\n", store->Statistics.minPitch);
-		fprintf(stderr,"dbg4       Statistics.maxPitch:                    %f\n", store->Statistics.maxPitch);
-		fprintf(stderr,"dbg4       Statistics.minHeave:                    %f\n", store->Statistics.minHeave);
-		fprintf(stderr,"dbg4       Statistics.maxHeave:                    %f\n", store->Statistics.maxHeave);
-		fprintf(stderr,"dbg4       Statistics.minBeamPositionStar:         %f\n", store->Statistics.minBeamPositionStar);
-		fprintf(stderr,"dbg4       Statistics.maxBeamPositionStar:         %f\n", store->Statistics.maxBeamPositionStar);
-		fprintf(stderr,"dbg4       Statistics.minBeamPositionAhead:        %f\n", store->Statistics.minBeamPositionAhead);
-		fprintf(stderr,"dbg4       Statistics.maxBeamPositionAhead:        %f\n", store->Statistics.maxBeamPositionAhead);
-		fprintf(stderr,"dbg4       Statistics.minDepth:                    %f\n", store->Statistics.minDepth);
-		fprintf(stderr,"dbg4       Statistics.maxDepth:                    %f\n", store->Statistics.maxDepth);
-
-		for (i=0; i<MIN(MBSYS_SURF_MAXCPOS,
-				store->NrPositionsensors); i++)
-		{
-		fprintf(stderr,"dbg4       PositionSensor[%2d].label:                   %s\n", i, store->PositionSensor[i].label);
-		fprintf(stderr,"dbg4       PositionSensor[%2d].positionSensorName:      %s\n", i, store->PositionSensor[i].positionSensorName);
-		fprintf(stderr,"dbg4       PositionSensor[%2d].none1:                   %f\n", i, store->PositionSensor[i].none1);
-		fprintf(stderr,"dbg4       PositionSensor[%2d].none2:                   %f\n", i, store->PositionSensor[i].none2);
-		fprintf(stderr,"dbg4       PositionSensor[%2d].none3:                   %f\n", i, store->PositionSensor[i].none3);
-		fprintf(stderr,"dbg4       PositionSensor[%2d].none4:                   %f\n", i, store->PositionSensor[i].none4);
-		fprintf(stderr,"dbg4       PositionSensor[%2d].none5:                   %f\n", i, store->PositionSensor[i].none5);
-		fprintf(stderr,"dbg4       PositionSensor[%2d].none6:                   %f\n", i, store->PositionSensor[i].none6);
-		fprintf(stderr,"dbg4       PositionSensor[%2d].none7:                   %f\n", i, store->PositionSensor[i].none7);
-		fprintf(stderr,"dbg4       PositionSensor[%2d].none8:                   %f\n", i, store->PositionSensor[i].none8);
-		fprintf(stderr,"dbg4       PositionSensor[%2d].time9:                   %s\n", i, store->PositionSensor[i].time9);
-		fprintf(stderr,"dbg4       PositionSensor[%2d].none10:                  %f\n", i, store->PositionSensor[i].none10);
-		fprintf(stderr,"dbg4       PositionSensor[%2d].none11:                  %f\n", i, store->PositionSensor[i].none11);
-		fprintf(stderr,"dbg4       PositionSensor[%2d].none12:                  %f\n", i, store->PositionSensor[i].none12);
-		fprintf(stderr,"dbg4       PositionSensor[%2d].none13:                  %f\n", i, store->PositionSensor[i].none13);
-		fprintf(stderr,"dbg4       PositionSensor[%2d].none14:                  %f\n", i, store->PositionSensor[i].none14);
-		fprintf(stderr,"dbg4       PositionSensor[%2d].none15:                  %f\n", i, store->PositionSensor[i].none15);
-		fprintf(stderr,"dbg4       PositionSensor[%2d].none16:                  %f\n", i, store->PositionSensor[i].none16);
-		fprintf(stderr,"dbg4       PositionSensor[%2d].none17:                  %f\n", i, store->PositionSensor[i].none17);
-		fprintf(stderr,"dbg4       PositionSensor[%2d].sensorAntennaPositionAhead:  %f\n", i, store->PositionSensor[i].sensorAntennaPositionAhead);
-		fprintf(stderr,"dbg4       PositionSensor[%2d].sensorAntennaPositionStar:   %f\n", i, store->PositionSensor[i].sensorAntennaPositionStar);
-		fprintf(stderr,"dbg4       PositionSensor[%2d].sensorAntennaPositionHeight: %f\n", i, store->PositionSensor[i].sensorAntennaPositionHeight);
-		}
-
-		fprintf(stderr,"dbg4       SoundingData.soundingFlag:              %d\n", store->SoundingData.soundingFlag);
-		fprintf(stderr,"dbg4       SoundingData.indexToAngle:              %d\n", store->SoundingData.indexToAngle);
-		fprintf(stderr,"dbg4       SoundingData.indexToTransducer:         %d\n", store->SoundingData.indexToTransducer);
-		fprintf(stderr,"dbg4       SoundingData.indexToCProfile:           %d\n", store->SoundingData.indexToCProfile);
-		fprintf(stderr,"dbg4       SoundingData.relTime:                   %f\n", store->SoundingData.relTime);
-		fprintf(stderr,"dbg4       SoundingData.relWay:                    %f\n", store->SoundingData.relWay);
-		fprintf(stderr,"dbg4       SoundingData.tide:                      %f\n", store->SoundingData.tide);
-		fprintf(stderr,"dbg4       SoundingData.headingWhileTransmitting:  %f\n", store->SoundingData.headingWhileTransmitting);
-		fprintf(stderr,"dbg4       SoundingData.heaveWhileTransmitting:    %f\n", store->SoundingData.heaveWhileTransmitting);
-		fprintf(stderr,"dbg4       SoundingData.rollWhileTransmitting:     %f\n", store->SoundingData.rollWhileTransmitting);
-		fprintf(stderr,"dbg4       SoundingData.pitchWhileTransmitting:    %f\n", store->SoundingData.pitchWhileTransmitting);
-		fprintf(stderr,"dbg4       SoundingData.cKeel:                     %f\n", store->SoundingData.cKeel);
-		fprintf(stderr,"dbg4       SoundingData.cMean:                     %f\n", store->SoundingData.cMean);
-		fprintf(stderr,"dbg4       SoundingData.dynChartZero:              %f\n", store->SoundingData.dynChartZero);
-
-		fprintf(stderr,"dbg4       ActualTransducerTable.label:                   %s\n", store->ActualTransducerTable.label);
-		fprintf(stderr,"dbg4       ActualTransducerTable.transducerDepth:         %f\n", store->ActualTransducerTable.transducerDepth);
-		fprintf(stderr,"dbg4       ActualTransducerTable.transducerPositionAhead: %f\n", store->ActualTransducerTable.transducerPositionAhead);
-		fprintf(stderr,"dbg4       ActualTransducerTable.transducerPositionStar:  %f\n", store->ActualTransducerTable.transducerPositionStar);
-		fprintf(stderr,"dbg4       ActualTransducerTable.transducerTwoThetaHFreq: %f\n", store->ActualTransducerTable.transducerTwoThetaHFreq);
-		fprintf(stderr,"dbg4       ActualTransducerTable.transducerTwoThetaMFreq: %f\n", store->ActualTransducerTable.transducerTwoThetaMFreq);
-		fprintf(stderr,"dbg4       ActualTransducerTable.transducerTwoThetaLFreq: %f\n", store->ActualTransducerTable.transducerTwoThetaLFreq);
-
-		fprintf(stderr,"dbg4       ActualAngleTable.label:                 %s\n", store->ActualAngleTable.label);
-		fprintf(stderr,"dbg4       ActualAngleTable.actualNumberOfBeams:   %d\n", store->ActualAngleTable.actualNumberOfBeams);
-		for (i=0; i<MIN(MBSYS_SURF_MAXBEAMS,
-				store->ActualAngleTable.actualNumberOfBeams); i++)
-		fprintf(stderr,"dbg4       ActualAngleTable.beamAngle[%3d]:        %f\n", i, store->ActualAngleTable.beamAngle[i]);
-
-		fprintf(stderr,"dbg4       ActualCProfileTable.label:                     %s\n", store->ActualCProfileTable.label);
-		fprintf(stderr,"dbg4       ActualCProfileTable.relTime:                   %f\n", store->ActualCProfileTable.relTime);
-		fprintf(stderr,"dbg4       ActualCProfileTable.numberOfActualValues:      %d\n", store->ActualCProfileTable.numberOfActualValues);
-		for (i=0; i<MIN(MBSYS_SURF_MAXCVALUES,
-				store->ActualCProfileTable.numberOfActualValues); i++)
-		fprintf(stderr,"dbg4       ActualCProfileTable.values[%3d]:               %f %f\n",
-			i, store->ActualCProfileTable.values[i].depth, store->ActualCProfileTable.values[i].cValue);
-
-		for (i=0; i<MIN(MBSYS_SURF_MAXCPOS,
-				store->NrPositionsensors); i++)
-		{
-		fprintf(stderr,"dbg4       CenterPosition[%2d].positionFlag:            %d\n", i, store->CenterPosition[i].positionFlag);
-		fprintf(stderr,"dbg4       CenterPosition[%2d].centerPositionX:         %f\n", i, store->CenterPosition[i].centerPositionX);
-		fprintf(stderr,"dbg4       CenterPosition[%2d].centerPositionY:         %f\n", i, store->CenterPosition[i].centerPositionY);
-		fprintf(stderr,"dbg4       CenterPosition[%2d].speed:                   %f\n", i, store->CenterPosition[i].speed);
-		}
-
-		fprintf(stderr,"dbg4       SingleBeamDepth.depthFlag:              %d\n", store->SingleBeamDepth.depthFlag);
-		fprintf(stderr,"dbg4       SingleBeamDepth.travelTimeOfRay:        %f\n", store->SingleBeamDepth.travelTimeOfRay);
-		fprintf(stderr,"dbg4       SingleBeamDepth.depthHFreq:             %f\n", store->SingleBeamDepth.depthHFreq);
-		fprintf(stderr,"dbg4       SingleBeamDepth.depthMFreq:             %f\n", store->SingleBeamDepth.depthMFreq);
-		fprintf(stderr,"dbg4       SingleBeamDepth.depthLFreq:             %f\n", store->SingleBeamDepth.depthLFreq);
-
-		for (i=0; i<MIN(MBSYS_SURF_MAXBEAMS,
-				store->NrBeams); i++)
-		{
-		fprintf(stderr,"\ndbg4       MultiBeamDepth[%3d].depthFlag:                      %d\n", i, store->MultiBeamDepth[i].depthFlag);
-		fprintf(stderr,"dbg4       MultiBeamDepth[%3d].depth:                          %f\n", i, store->MultiBeamDepth[i].depth);
-		fprintf(stderr,"dbg4       MultiBeamDepth[%3d].beamPositionAhead:              %f\n", i, store->MultiBeamDepth[i].beamPositionAhead);
-		fprintf(stderr,"dbg4       MultiBeamDepth[%3d].beamPositionStar:               %f\n", i, store->MultiBeamDepth[i].beamPositionStar);
-		fprintf(stderr,"dbg4       MultiBeamTraveltime[%3d].travelTimeOfRay:           %f\n", i, store->MultiBeamTraveltime[i].travelTimeOfRay);
-		fprintf(stderr,"dbg4       MultiBeamReceiveParams[%3d].headingWhileReceiving:  %f\n", i, store->MultiBeamReceiveParams[i].headingWhileReceiving);
-		fprintf(stderr,"dbg4       MultiBeamReceiveParams[%3d].heaveWhileReceiving:    %f\n", i, store->MultiBeamReceiveParams[i].heaveWhileReceiving);
-		fprintf(stderr,"dbg4       MultibeamBeamAmplitudes[%3d].beamAmplitude:         %d\n", i, store->MultibeamBeamAmplitudes[i].beamAmplitude);
-		fprintf(stderr,"dbg4       MultibeamBeamExtendedAmplitudes[%3d].mtau:          %f\n", i, store->MultibeamExtendedBeamAmplitudes[i].mtau);
-		fprintf(stderr,"dbg4       MultibeamBeamExtendedAmplitudes[%3d].nis:           %d\n", i, store->MultibeamExtendedBeamAmplitudes[i].nis);
-		fprintf(stderr,"dbg4       MultibeamBeamExtendedAmplitudes[%3d].beamAmplitude: %d\n", i, store->MultibeamExtendedBeamAmplitudes[i].beamAmplitude);
-		}
-
-		fprintf(stderr,"\ndbg4       MultibeamSignalParameters.bscatClass:          %d\n", store->MultibeamSignalParameters.bscatClass);
-		fprintf(stderr,"dbg4       MultibeamSignalParameters.nrActualGainSets:    %d\n", store->MultibeamSignalParameters.nrActualGainSets);
-		fprintf(stderr,"dbg4       MultibeamSignalParameters.rxGup:               %f\n", store->MultibeamSignalParameters.rxGup);
-		fprintf(stderr,"dbg4       MultibeamSignalParameters.rxGain:              %f\n", store->MultibeamSignalParameters.rxGain);
-		fprintf(stderr,"dbg4       MultibeamSignalParameters.ar:                  %f\n", store->MultibeamSignalParameters.ar);
-		for (i=0; i<MIN(MBSYS_SURF_MAXRXSETS,
-				store->MultibeamSignalParameters.nrActualGainSets); i++)
-		fprintf(stderr,"dbg4       MultibeamSignalParameters.rxSets[%3d]:               %f %f\n",
-			i, store->MultibeamSignalParameters.rxSets[i].time, store->MultibeamSignalParameters.rxSets[i].gain);
-
-		fprintf(stderr,"dbg4       MultibeamTransmitterParameters.txSets[0].txBeamIndex: %d\n", store->MultibeamTransmitterParameters.txSets[0].txBeamIndex);
-		fprintf(stderr,"dbg4       MultibeamTransmitterParameters.txSets[0].txLevel:     %f\n", store->MultibeamTransmitterParameters.txSets[0].txLevel);
-		fprintf(stderr,"dbg4       MultibeamTransmitterParameters.txSets[0].txBeamAngle: %f\n", store->MultibeamTransmitterParameters.txSets[0].txBeamAngle);
-		fprintf(stderr,"dbg4       MultibeamTransmitterParameters.txSets[0].pulseLength: %f\n", store->MultibeamTransmitterParameters.txSets[0].pulseLength);
-
-		fprintf(stderr,"dbg4       SidescanData.sidescanFlag:              %d\n", store->SidescanData.sidescanFlag);
-		fprintf(stderr,"dbg4       SidescanData.actualNrOfSsDataPort:      %d\n", store->SidescanData.actualNrOfSsDataPort);
-		fprintf(stderr,"dbg4       SidescanData.actualNrOfSsDataStb:       %d\n", store->SidescanData.actualNrOfSsDataStb);
-		fprintf(stderr,"dbg4       SidescanData.minSsTimePort:             %f\n", store->SidescanData.minSsTimePort);
-		fprintf(stderr,"dbg4       SidescanData.minSsTimeStb:              %f\n", store->SidescanData.minSsTimeStb);
-		fprintf(stderr,"dbg4       SidescanData.maxSsTimePort:             %f\n", store->SidescanData.maxSsTimePort);
-		fprintf(stderr,"dbg4       SidescanData.maxSsTimeStb:              %f\n", store->SidescanData.maxSsTimeStb);
-		for (i=0; i<MIN(MBSYS_SURF_MAXPIXELS,
-				store->SidescanData.actualNrOfSsDataPort
-				+ store->SidescanData.actualNrOfSsDataPort);
-				i++)
-		fprintf(stderr,"dbg4       SidescanData.ssData[%d]:        %d\n", i, store->SidescanData.ssData[i]);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_wt_samesurf(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_wt_samesurf";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_surf_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor and data structure */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-	store = (struct mbsys_surf_struct *) store_ptr;
-
-	/* write failure always */
-	status = MB_FAILURE;
-	*error = MB_ERROR_WRITE_FAIL;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mbr_sb2000sb.c b/src/mbio/mbr_sb2000sb.c
deleted file mode 100644
index 5e73355..0000000
--- a/src/mbio/mbr_sb2000sb.c
+++ /dev/null
@@ -1,1209 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbr_sb2000sb.c	10/11/94
- *	$Id: mbr_sb2000sb.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1994-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbr_sb2000sb.c contains the functions for reading and writing
- * multibeam data in the SB2000SB format.
- * These functions include:
- *   mbr_alm_sb2000sb	- allocate read/write memory
- *   mbr_dem_sb2000sb	- deallocate read/write memory
- *   mbr_rt_sb2000sb	- read and translate data
- *   mbr_wt_sb2000sb	- translate and write data
- *
- * Author:	D. W. Caress
- * Date:	October 11, 1994
- * $Log: mbr_sb2000sb.c,v $
- * Revision 5.10  2005/11/05 00:48:05  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.9  2003/08/07 22:32:59  caress
- * Fixed problem with broken SB2000 records in data sample supplied by Mike Sexton.
- *
- * Revision 5.8  2003/05/20 18:05:32  caress
- * Added svp_source to data source parameters.
- *
- * Revision 5.7  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.6  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.5  2002/02/26 07:50:41  caress
- * Release 5.0.beta14
- *
- * Revision 5.4  2002/02/22 09:03:43  caress
- * Release 5.0.beta13
- *
- * Revision 5.3  2001/07/20 00:32:54  caress
- * Release 5.0.beta03
- *
- * Revision 5.2  2001/03/22  20:50:02  caress
- * Trying to make version 5.0.beta0
- *
- * Revision 5.1  2001/01/22  07:43:34  caress
- * Version 5.0.beta01
- *
- * Revision 5.0  2000/12/01  22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.7  2000/10/11  01:03:21  caress
- * Convert to ANSI C
- *
- * Revision 4.6  2000/09/30  06:34:20  caress
- * Snapshot for Dale.
- *
- * Revision 4.5  1998/10/05  17:46:15  caress
- * MB-System version 4.6beta
- *
- * Revision 4.4  1997/07/25  14:19:53  caress
- * Version 4.5beta2.
- * Much mucking, particularly with Simrad formats.
- *
- * Revision 4.3  1997/04/21  17:02:07  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.2  1996/04/22  13:21:19  caress
- * Now have DTR and MIN/MAX defines in mb_define.h
- *
- * Revision 4.2  1996/04/22  13:21:19  caress
- * Now have DTR and MIN/MAX defines in mb_define.h
- *
- * Revision 4.1  1995/03/06  19:38:54  caress
- * Changed include strings.h to string.h for POSIX compliance.
- *
- * Revision 4.0  1994/10/21  12:34:57  caress
- * Release V4.0
- *
- * Revision 1.1  1994/10/21  12:20:01  caress
- * Initial revision
- *
- *
- */
-/*--------------------------------------------------------------------
- *
- * Notes on the MBF_SB2000SB data format:
- *   1. This data format is used to store bathymetry and
- *      and sidescan data from Sea Beam 2000 sonars.
- *      This format was created and used by the Scripps
- *      Institution of Oceanography; most data files in this format
- *      consist of Sea Beam data collected on the R/V George Melville.
- *      This format is one of the "swathbathy" formats created by
- *      Jim Charters of Scripps.
- *   2. The data records consist of three logical records: the header
- *      record, the sensor specific record and the data record.
- *   3. The header record consists of 36 bytes, including the sizes
- *      of the following sensor specific and data records.
- *   4. The sensor specific records are 24 bytes long.
- *   5. The data record lengths are variable.
- *   6. Comments are included in text records, which are of variable
- *      length.
- *   7. Information on this format was obtained from the Geological
- *      Data Center and the Shipboard Computer Group at the Scripps
- *      Institution of Oceanography
- *
- * The kind value in the mbf_sb2000sb_struct indicates whether the
- * mbf_sb2000sb_data_struct structure holds data (kind = 1) or an
- * ascii comment record (kind = 2).
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mb_define.h"
-#include "mbsys_sb2000.h"
-
-/* include for byte swapping on little-endian machines */
-#ifdef BYTESWAPPED
-#include "mb_swap.h"
-#endif
-
-/* essential function prototypes */
-int mbr_register_sb2000sb(int verbose, void *mbio_ptr,
-		int *error);
-int mbr_info_sb2000sb(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_alm_sb2000sb(int verbose, void *mbio_ptr, int *error);
-int mbr_dem_sb2000sb(int verbose, void *mbio_ptr, int *error);
-int mbr_rt_sb2000sb(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_wt_sb2000sb(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-
-static char rcs_id[]="$Id: mbr_sb2000sb.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mbr_register_sb2000sb(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_register_sb2000sb";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* get mb_io_ptr */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set format info parameters */
-	status = mbr_info_sb2000sb(verbose,
-			&mb_io_ptr->system,
-			&mb_io_ptr->beams_bath_max,
-			&mb_io_ptr->beams_amp_max,
-			&mb_io_ptr->pixels_ss_max,
-			mb_io_ptr->format_name,
-			mb_io_ptr->system_name,
-			mb_io_ptr->format_description,
-			&mb_io_ptr->numfile,
-			&mb_io_ptr->filetype,
-			&mb_io_ptr->variable_beams,
-			&mb_io_ptr->traveltime,
-			&mb_io_ptr->beam_flagging,
-			&mb_io_ptr->nav_source,
-			&mb_io_ptr->heading_source,
-			&mb_io_ptr->vru_source,
-			&mb_io_ptr->svp_source,
-			&mb_io_ptr->beamwidth_xtrack,
-			&mb_io_ptr->beamwidth_ltrack,
-			error);
-
-	/* set format and system specific function pointers */
-	mb_io_ptr->mb_io_format_alloc = &mbr_alm_sb2000sb;
-	mb_io_ptr->mb_io_format_free = &mbr_dem_sb2000sb;
-	mb_io_ptr->mb_io_store_alloc = &mbsys_sb2000_alloc;
-	mb_io_ptr->mb_io_store_free = &mbsys_sb2000_deall;
-	mb_io_ptr->mb_io_read_ping = &mbr_rt_sb2000sb;
-	mb_io_ptr->mb_io_write_ping = &mbr_wt_sb2000sb;
-	mb_io_ptr->mb_io_dimensions = &mbsys_sb2000_dimensions;
-	mb_io_ptr->mb_io_extract = &mbsys_sb2000_extract;
-	mb_io_ptr->mb_io_insert = &mbsys_sb2000_insert;
-	mb_io_ptr->mb_io_extract_nav = &mbsys_sb2000_extract_nav;
-	mb_io_ptr->mb_io_insert_nav = &mbsys_sb2000_insert_nav;
-	mb_io_ptr->mb_io_extract_altitude = &mbsys_sb2000_extract_altitude;
-	mb_io_ptr->mb_io_insert_altitude = NULL;
-	mb_io_ptr->mb_io_extract_svp = NULL;
-	mb_io_ptr->mb_io_insert_svp = NULL;
-	mb_io_ptr->mb_io_ttimes = &mbsys_sb2000_ttimes;
-	mb_io_ptr->mb_io_detects = &mbsys_sb2000_detects;
-	mb_io_ptr->mb_io_copyrecord = &mbsys_sb2000_copy;
-	mb_io_ptr->mb_io_extract_rawss = NULL;
-	mb_io_ptr->mb_io_insert_rawss = NULL;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",mb_io_ptr->system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",mb_io_ptr->beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",mb_io_ptr->beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",mb_io_ptr->pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",mb_io_ptr->format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",mb_io_ptr->system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",mb_io_ptr->format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",mb_io_ptr->numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",mb_io_ptr->filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",mb_io_ptr->variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",mb_io_ptr->traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",mb_io_ptr->beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",mb_io_ptr->nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",mb_io_ptr->heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",mb_io_ptr->vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",mb_io_ptr->svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",mb_io_ptr->beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",mb_io_ptr->beamwidth_ltrack);
-		fprintf(stderr,"dbg2       format_alloc:       %p\n",(void *)mb_io_ptr->mb_io_format_alloc);
-		fprintf(stderr,"dbg2       format_free:        %p\n",(void *)mb_io_ptr->mb_io_format_free);
-		fprintf(stderr,"dbg2       store_alloc:        %p\n",(void *)mb_io_ptr->mb_io_store_alloc);
-		fprintf(stderr,"dbg2       store_free:         %p\n",(void *)mb_io_ptr->mb_io_store_free);
-		fprintf(stderr,"dbg2       read_ping:          %p\n",(void *)mb_io_ptr->mb_io_read_ping);
-		fprintf(stderr,"dbg2       write_ping:         %p\n",(void *)mb_io_ptr->mb_io_write_ping);
-		fprintf(stderr,"dbg2       extract:            %p\n",(void *)mb_io_ptr->mb_io_extract);
-		fprintf(stderr,"dbg2       insert:             %p\n",(void *)mb_io_ptr->mb_io_insert);
-		fprintf(stderr,"dbg2       extract_nav:        %p\n",(void *)mb_io_ptr->mb_io_extract_nav);
-		fprintf(stderr,"dbg2       insert_nav:         %p\n",(void *)mb_io_ptr->mb_io_insert_nav);
-		fprintf(stderr,"dbg2       extract_altitude:   %p\n",(void *)mb_io_ptr->mb_io_extract_altitude);
-		fprintf(stderr,"dbg2       insert_altitude:    %p\n",(void *)mb_io_ptr->mb_io_insert_altitude);
-		fprintf(stderr,"dbg2       extract_svp:        %p\n",(void *)mb_io_ptr->mb_io_extract_svp);
-		fprintf(stderr,"dbg2       insert_svp:         %p\n",(void *)mb_io_ptr->mb_io_insert_svp);
-		fprintf(stderr,"dbg2       ttimes:             %p\n",(void *)mb_io_ptr->mb_io_ttimes);
-		fprintf(stderr,"dbg2       detects:            %p\n",(void *)mb_io_ptr->mb_io_detects);
-		fprintf(stderr,"dbg2       extract_rawss:      %p\n",(void *)mb_io_ptr->mb_io_extract_rawss);
-		fprintf(stderr,"dbg2       insert_rawss:       %p\n",(void *)mb_io_ptr->mb_io_insert_rawss);
-		fprintf(stderr,"dbg2       copyrecord:         %p\n",(void *)mb_io_ptr->mb_io_copyrecord);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbr_info_sb2000sb(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error)
-{
-	char	*function_name = "mbr_info_sb2000sb";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* set format info parameters */
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-	*system = MB_SYS_SB2000;
-	*beams_bath_max = 121;
-	*beams_amp_max = 0;
-	*pixels_ss_max = 0;
-	strncpy(format_name, "SB2000SB", MB_NAME_LENGTH);
-	strncpy(system_name, "SB2000", MB_NAME_LENGTH);
-	strncpy(format_description, "Format name:          MBF_SB2000SB\nInformal Description: SIO Swath-bathy SeaBeam 2000 format\nAttributes:           SeaBeam 2000, bathymetry, 121 beams, \n                      binary,  SIO.\n", MB_DESCRIPTION_LENGTH);
-	*numfile = 1;
-	*filetype = MB_FILETYPE_NORMAL;
-	*variable_beams = MB_NO;
-	*traveltime = MB_NO;
-	*beam_flagging = MB_YES;
-	*nav_source = MB_DATA_DATA;
-	*heading_source = MB_DATA_DATA;
-	*vru_source = MB_DATA_DATA;
-	*svp_source = MB_DATA_NONE;
-	*beamwidth_xtrack = 2.0;
-	*beamwidth_ltrack = 2.0;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",*system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",*beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",*beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",*pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",*numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",*filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",*variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",*traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",*beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",*nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",*heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",*vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",*svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",*beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",*beamwidth_ltrack);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_alm_sb2000sb(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_alm_sb2000sb";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set initial status */
-	status = MB_SUCCESS;
-
-	/* allocate memory for data structure */
-	status = mb_malloc(verbose,sizeof(struct mbsys_sb2000_struct),
-				&mb_io_ptr->store_data,error);
-	memset(mb_io_ptr->store_data, 0, sizeof(struct mbsys_sb2000_struct));
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_dem_sb2000sb(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_dem_sb2000sb";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* deallocate memory for data descriptor */
-	status = mb_free(verbose,&mb_io_ptr->raw_data,error);
-	status = mb_free(verbose,&mb_io_ptr->store_data,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_rt_sb2000sb(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_rt_sb2000sb";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_sb2000_struct *store;
-	int	read_status;
-	char	buffer[2*MBSYS_SB2000_PIXELS+4];
-	short	test_sensor_size, test_data_size;
-	int 	found, skip;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_sb2000_struct *) store_ptr;
-
-	/* read next header record from file */
-	mb_io_ptr->file_pos = mb_io_ptr->file_bytes;
-	skip = 0;
-	found = MB_NO;
-	if ((status = fread(buffer,1,MBSYS_SB2000_HEADER_SIZE,
-			mb_io_ptr->mbfp)) == MBSYS_SB2000_HEADER_SIZE)
-		{
-		mb_io_ptr->file_bytes += status;
-		status = MB_SUCCESS;
-		*error = MB_ERROR_NO_ERROR;
-
-		/* check if header is ok */
-		if (strncmp(&buffer[34],"SR",2) == 0
-		    || strncmp(&buffer[34],"RS",2) == 0
-		    || strncmp(&buffer[34],"SP",2) == 0
-		    || strncmp(&buffer[34],"TR",2) == 0
-		    || strncmp(&buffer[34],"IR",2) == 0
-		    || strncmp(&buffer[34],"AT",2) == 0
-		    || strncmp(&buffer[34],"SC",2) == 0)
-		    {
-		    mb_get_binary_short(MB_NO, &buffer[26], &test_sensor_size);
-		    mb_get_binary_short(MB_NO, &buffer[28], &test_data_size);
-		    if (test_sensor_size <= 32 && test_data_size <= 2*MBSYS_SB2000_PIXELS+4)
-			found = MB_YES;
-		    }
-		}
-	else
-		{
-		mb_io_ptr->file_bytes += status;
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	/* if not a good header search through file to find one */
-	while (status == MB_SUCCESS && found == MB_NO)
-		{
-		/* shift bytes by one */
-		for (i=0;i<MBSYS_SB2000_HEADER_SIZE-1;i++)
-			buffer[i] = buffer[i+1];
-		mb_io_ptr->file_pos += 1;
-		skip++;
-
-		/* read next byte */
-		if ((read_status = fread(&buffer[MBSYS_SB2000_HEADER_SIZE-1],
-			1,1,mb_io_ptr->mbfp)) == 1)
-			{
-			mb_io_ptr->file_bytes += read_status;
-			status = MB_SUCCESS;
-			*error = MB_ERROR_NO_ERROR;
-
-			if (strncmp(&buffer[34],"SR",2) == 0
-			    || strncmp(&buffer[34],"RS",2) == 0
-			    || strncmp(&buffer[34],"SP",2) == 0
-			    || strncmp(&buffer[34],"TR",2) == 0
-			    || strncmp(&buffer[34],"IR",2) == 0
-			    || strncmp(&buffer[34],"AT",2) == 0
-			    || strncmp(&buffer[34],"SC",2) == 0)
-			    {
-			    mb_get_binary_short(MB_NO, &buffer[26], &test_sensor_size);
-			    mb_get_binary_short(MB_NO, &buffer[28], &test_data_size);
-			    if (test_sensor_size <= 32 && test_data_size <= 2*MBSYS_SB2000_PIXELS+4)
-				found = MB_YES;
-			    }
-			}
-		else
-			{
-			found = MB_YES;
-			mb_io_ptr->file_bytes += status;
-			status = MB_FAILURE;
-			*error = MB_ERROR_EOF;
-			}
-		}
-
-	/* report data skips */
-	if (skip > 0 && verbose >= 2)
-	    fprintf(stderr, "\ndgb2           DATA SKIPPED: %d bytes\n", skip);
-
-	/* get header values */
-	mb_get_binary_short(MB_NO, &buffer[0], &store->year);
-	mb_get_binary_short(MB_NO, &buffer[2], &store->day);
-	mb_get_binary_short(MB_NO, &buffer[4], &store->min);
-	mb_get_binary_short(MB_NO, &buffer[6], &store->sec);
-	mb_get_binary_int(MB_NO, &buffer[8], &store->lat);
-	mb_get_binary_int(MB_NO, &buffer[12], &store->lon);
-	mb_get_binary_short(MB_NO, &buffer[16], &store->heading);
-	mb_get_binary_short(MB_NO, &buffer[18], &store->course);
-	mb_get_binary_short(MB_NO, &buffer[20], &store->speed);
-	mb_get_binary_short(MB_NO, &buffer[22], &store->speed_ps);
-	mb_get_binary_short(MB_NO, &buffer[24], &store->quality);
-	mb_get_binary_short(MB_NO, &buffer[26], (short *) &store->sensor_size);
-	mb_get_binary_short(MB_NO, &buffer[28], (short *) &store->data_size);
-	store->speed_ref[0] = buffer[30];
-	store->speed_ref[1] = buffer[31];
-	store->sensor_type[0] = buffer[32];
-	store->sensor_type[1] = buffer[33];
-	store->data_type[0] = buffer[34];
-	store->data_type[1] = buffer[35];
-
-	/* check for unintelligible records */
-	if (status == MB_SUCCESS)
-		{
-		if ((strncmp(store->sensor_type,"S2",2) != 0 ||
-			strncmp(store->data_type,"SR",2) != 0)
-			&& strncmp(store->data_type,"TR",2) != 0
-			&& strncmp(store->data_type,"SP",2) != 0)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_UNINTELLIGIBLE;
-			store->kind = MB_DATA_NONE;
-
-			/* read rest of record */
-			if ((read_status = fread(buffer,1,store->sensor_size,
-				mb_io_ptr->mbfp)) !=store->sensor_size)
-				{
-				status = MB_FAILURE;
-				*error = MB_ERROR_EOF;
-				}
-			mb_io_ptr->file_bytes += read_status;
-			if ((read_status = fread(buffer,1,store->data_size,
-				mb_io_ptr->mbfp)) != store->data_size)
-				{
-				status = MB_FAILURE;
-				*error = MB_ERROR_EOF;
-				}
-			mb_io_ptr->file_bytes += read_status;
-			}
-		else if (strncmp(store->data_type,"SR",2) == 0)
-			{
-			store->kind = MB_DATA_DATA;
-			}
-		else if (strncmp(store->data_type,"SP",2) == 0)
-			{
-			store->kind = MB_DATA_VELOCITY_PROFILE;
-			}
-		else
-			{
-			store->kind = MB_DATA_COMMENT;
-			}
-		}
-
-	/* print debug statements */
-	if (status == MB_SUCCESS && verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  New header record in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5  New header values:\n");
-		fprintf(stderr,"dbg5       year:       %d\n",store->year);
-		fprintf(stderr,"dbg5       day:        %d\n",store->day);
-		fprintf(stderr,"dbg5       min:        %d\n",store->min);
-		fprintf(stderr,"dbg5       sec:        %d\n",store->sec);
-		fprintf(stderr,"dbg5       lat:        %d\n",store->lat);
-		fprintf(stderr,"dbg5       lon:        %d\n",store->lon);
-		fprintf(stderr,"dbg5       heading:    %d\n",store->heading);
-		fprintf(stderr,"dbg5       course:     %d\n",store->course);
-		fprintf(stderr,"dbg5       speed:      %d\n",store->speed);
-		fprintf(stderr,"dbg5       speed_ps:   %d\n",store->speed_ps);
-		fprintf(stderr,"dbg5       quality:    %d\n",store->quality);
-		fprintf(stderr,"dbg5       sensor size:%d\n",store->sensor_size);
-		fprintf(stderr,"dbg5       data size:  %d\n",store->data_size);
-		fprintf(stderr,"dbg5       speed_ref:  %c%c\n",
-			store->speed_ref[0],store->speed_ref[1]);
-		fprintf(stderr,"dbg5       sensor_type:%c%c\n",
-			store->sensor_type[0],store->sensor_type[1]);
-		fprintf(stderr,"dbg5       data_type:  %c%c\n",
-			store->data_type[0],store->data_type[1]);
-		}
-
-	/* read sensor record from file */
-	if (status == MB_SUCCESS && store->sensor_size > 0)
-		{
-		if ((status = fread(buffer,1,store->sensor_size,
-			mb_io_ptr->mbfp)) == store->sensor_size)
-			{
-			mb_io_ptr->file_bytes += status;
-			status = MB_SUCCESS;
-			*error = MB_ERROR_NO_ERROR;
-			}
-		else
-			{
-			mb_io_ptr->file_bytes += status;
-			status = MB_FAILURE;
-			*error = MB_ERROR_EOF;
-			}
-		}
-
-	/* extract sensor data */
-	if (status == MB_SUCCESS && store->sensor_size > 0)
-		{
-		/* extract the values */
-		mb_get_binary_short(MB_NO, &buffer[0], &store->pitch);
-		mb_get_binary_short(MB_NO, &buffer[2], &store->roll);
-		mb_get_binary_short(MB_NO, &buffer[4], &store->gain);
-		mb_get_binary_short(MB_NO, &buffer[6], &store->correction);
-		mb_get_binary_short(MB_NO, &buffer[8], &store->surface_vel);
-		mb_get_binary_short(MB_NO, &buffer[10], &store->pulse_width);
-		mb_get_binary_short(MB_NO, &buffer[12], &store->attenuation);
-		mb_get_binary_short(MB_NO, &buffer[14], &store->spare1);
-		if (store->sensor_size >= 18)
-			mb_get_binary_short(MB_NO, &buffer[16], &store->spare2);
-		if (store->sensor_size >= 20)
-			{
-			store->mode[0] = buffer[18];
-			store->mode[1] = buffer[19];
-			}
-		if (store->sensor_size >= 22)
-			{
-			store->data_correction[0] = buffer[20];
-			store->data_correction[1] = buffer[21];
-			}
-		if (store->sensor_size >= 24)
-			{
-			store->ssv_source[0] = buffer[22];
-			store->ssv_source[1] = buffer[23];
-			}
-
-		/* print debug statements */
-		if (status == MB_SUCCESS && verbose >= 5)
-			{
-			fprintf(stderr,"\ndbg5  New sensor record read by MBIO function <%s>\n",function_name);
-			fprintf(stderr,"dbg5  New sensor values:\n");
-			fprintf(stderr,"dbg5       pitch:           %d\n",
-				store->pitch);
-			fprintf(stderr,"dbg5       roll:            %d\n",
-				store->roll);
-			fprintf(stderr,"dbg5       gain:            %d\n",
-				store->gain);
-			fprintf(stderr,"dbg5       correction:      %d\n",
-				store->correction);
-			fprintf(stderr,"dbg5       surface_vel:     %d\n",
-				store->surface_vel);
-			fprintf(stderr,"dbg5       pulse_width:     %d\n",
-				store->pulse_width);
-			fprintf(stderr,"dbg5       attenuation:     %d\n",
-				store->attenuation);
-			fprintf(stderr,"dbg5       spare1:          %d\n",
-				store->spare1);
-			fprintf(stderr,"dbg5       spare2:          %d\n",
-				store->spare2);
-			fprintf(stderr,"dbg5       mode:            %c%c\n",
-				store->mode[0], store->mode[1]);
-			fprintf(stderr,"dbg5       data_correction: %c%c\n",
-				store->data_correction[0], store->data_correction[1]);
-			fprintf(stderr,"dbg5       ssv_source:      %c%c\n",
-				store->ssv_source[0], store->ssv_source[1]);
-			}
-		}
-
-	/* read data record from file */
-	if (status == MB_SUCCESS
-		&& store->data_size > 0)
-		{
-		if ((status = fread(buffer,1,store->data_size,
-			mb_io_ptr->mbfp)) == store->data_size)
-			{
-			mb_io_ptr->file_bytes += status;
-			status = MB_SUCCESS;
-			*error = MB_ERROR_NO_ERROR;
-			}
-		else
-			{
-			mb_io_ptr->file_bytes += status;
-			status = MB_FAILURE;
-			*error = MB_ERROR_EOF;
-			}
-		}
-
-	/* extract survey data */
-	if (status == MB_SUCCESS && store->kind == MB_DATA_DATA)
-		{
-		/* extract the beams_bath and scale_factor values */
-		mb_get_binary_short(MB_NO, &buffer[0], &store->beams_bath);
-		mb_get_binary_short(MB_NO, &buffer[2], &store->scale_factor);
-
-		/* check for unreasonable beams_bath */
-		if (store->beams_bath > (store->data_size - 4) / 4)
-			{
-			store->beams_bath = (store->data_size - 4) / 4;
-			}
-
-		/* extract the values */
-		for (i=0;i<store->beams_bath;i++)
-			{
-			mb_get_binary_short(MB_NO, &buffer[4+i*4], &store->bath[i]);
-			mb_get_binary_short(MB_NO, &buffer[6+i*4], &store->bath_acrosstrack[i]);
-			}
-
-		/* print debug statements */
-		if (verbose >= 5)
-			{
-			fprintf(stderr,"\ndbg5  New data record read by MBIO function <%s>\n",function_name);
-			fprintf(stderr,"dbg5  New data values:\n");
-			fprintf(stderr,"dbg5       beams_bath:   %d\n",
-				store->beams_bath);
-			fprintf(stderr,"dbg5       scale_factor: %d\n",
-				store->scale_factor);
-			for (i=0;i<store->beams_bath;i++)
-				fprintf(stderr,"dbg5       beam: %d  bath: %d  across_track: %d\n",
-					i,store->bath[i],
-					store->bath_acrosstrack[i]);
-			}
-		}
-
-	/* extract velocity profile record */
-	if (status == MB_SUCCESS && store->kind == MB_DATA_VELOCITY_PROFILE)
-		{
-		/* extract the values */
-		mb_get_binary_int(MB_NO, &buffer[0], &store->svp_mean);
-		mb_get_binary_short(MB_NO, &buffer[4], &store->svp_number);
-		mb_get_binary_short(MB_NO, &buffer[6], &store->svp_spare);
-		for (i=0;i<MIN(store->svp_number, 30);i++)
-			{
-			mb_get_binary_short(MB_NO, &buffer[8+i*4], &store->svp_depth[i]);
-			mb_get_binary_short(MB_NO, &buffer[10+i*4], &store->svp_vel[i]);
-			}
-		mb_get_binary_short(MB_NO, &buffer[128], &store->vru1);
-		mb_get_binary_short(MB_NO, &buffer[130], &store->vru1_port);
-		mb_get_binary_short(MB_NO, &buffer[132], &store->vru1_forward);
-		mb_get_binary_short(MB_NO, &buffer[134], &store->vru1_vert);
-		mb_get_binary_short(MB_NO, &buffer[136], &store->vru2);
-		mb_get_binary_short(MB_NO, &buffer[138], &store->vru2_port);
-		mb_get_binary_short(MB_NO, &buffer[140], &store->vru2_forward);
-		mb_get_binary_short(MB_NO, &buffer[142], &store->vru2_vert);
-
-		/* print debug statements */
-		if (verbose >= 5)
-			{
-			fprintf(stderr,"\ndbg5  New svp record read by MBIO function <%s>\n",function_name);
-			fprintf(stderr,"dbg5  New svp values:\n");
-			fprintf(stderr,"dbg5       svp_mean:     %d\n",
-				store->svp_mean);
-			fprintf(stderr,"dbg5       svp_number:   %d\n",
-				store->svp_number);
-			fprintf(stderr,"dbg5       svp_spare:    %d\n",
-				store->svp_spare);
-			for (i=0;i<30;i++)
-				fprintf(stderr,"dbg5       %d  depth: %d  vel: %d\n",
-					i,store->svp_depth[i],
-					store->svp_vel[i]);
-			fprintf(stderr,"dbg5       vru1:         %d\n",
-				store->vru1);
-			fprintf(stderr,"dbg5       vru1_port:    %d\n",
-				store->vru1_port);
-			fprintf(stderr,"dbg5       vru1_forward: %d\n",
-				store->vru1_forward);
-			fprintf(stderr,"dbg5       vru1_vert:    %d\n",
-				store->vru1_vert);
-			fprintf(stderr,"dbg5       vru2:         %d\n",
-				store->vru2);
-			fprintf(stderr,"dbg5       vru2_port:    %d\n",
-				store->vru2_port);
-			fprintf(stderr,"dbg5       vru2_forward: %d\n",
-				store->vru2_forward);
-			fprintf(stderr,"dbg5       vru2_vert:    %d\n",
-				store->vru2_vert);
-			fprintf(stderr,"dbg5       pitch_bias:    %d\n",
-				store->pitch_bias);
-			fprintf(stderr,"dbg5       roll_bias:    %d\n",
-				store->roll_bias);
-			fprintf(stderr,"dbg5       vru:          %c%c%c%c%c%c%c%c\n",
-				store->vru[0],store->vru[1],store->vru[2],store->vru[3],
-				store->vru[4],store->vru[5],store->vru[6],store->vru[7]);
-			}
-		}
-
-	/* extract comment record */
-	if (status == MB_SUCCESS && store->kind == MB_DATA_COMMENT)
-		{
-		strncpy(store->comment, buffer,
-			MIN(store->data_size, MBSYS_SB2000_COMMENT_LENGTH-1));
-		store->comment[MIN(store->data_size,
-			MBSYS_SB2000_COMMENT_LENGTH-1)] = '\0';
-
-		/* print debug statements */
-		if (verbose >= 5)
-			{
-			fprintf(stderr,"\ndbg5  New comment record read by MBIO function <%s>\n",function_name);
-			fprintf(stderr,"dbg5  New comment:\n");
-			fprintf(stderr,"dbg5       comment:   %s\n",
-				store->comment);
-			}
-		}
-
-	/* set kind and error in mb_io_ptr */
-	mb_io_ptr->new_kind = store->kind;
-	mb_io_ptr->new_error = *error;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_wt_sb2000sb(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_wt_sb2000sb";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_sb2000_struct *store;
-	char	buffer[2*MBSYS_SB2000_PIXELS+4];
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_sb2000_struct *) store_ptr;
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Ready to write data in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       kind:       %d\n",store->kind);
-		fprintf(stderr,"dbg5       error:      %d\n",*error);
-		fprintf(stderr,"dbg5       status:     %d\n",status);
-		}
-
-	/* print debug statements */
-	if (status == MB_SUCCESS && verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Header record to be written by MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5  Header values:\n");
-		fprintf(stderr,"dbg5       year:       %d\n",store->year);
-		fprintf(stderr,"dbg5       day:        %d\n",store->day);
-		fprintf(stderr,"dbg5       min:        %d\n",store->min);
-		fprintf(stderr,"dbg5       sec:        %d\n",store->sec);
-		fprintf(stderr,"dbg5       lat:        %d\n",store->lat);
-		fprintf(stderr,"dbg5       lon:        %d\n",store->lon);
-		fprintf(stderr,"dbg5       heading:    %d\n",store->heading);
-		fprintf(stderr,"dbg5       course:     %d\n",store->course);
-		fprintf(stderr,"dbg5       speed:      %d\n",store->speed);
-		fprintf(stderr,"dbg5       speed_ps:   %d\n",store->speed_ps);
-		fprintf(stderr,"dbg5       quality:    %d\n",store->quality);
-		fprintf(stderr,"dbg5       sensor size:%d\n",store->sensor_size);
-		fprintf(stderr,"dbg5       data size:  %d\n",store->data_size);
-		fprintf(stderr,"dbg5       speed_ref:  %c%c\n",
-			store->speed_ref[0],store->speed_ref[1]);
-		fprintf(stderr,"dbg5       sensor_type:%c%c\n",
-			store->sensor_type[0],store->sensor_type[1]);
-		fprintf(stderr,"dbg5       data_type:  %c%c\n",
-			store->data_type[0],store->data_type[1]);
-		}
-
-	/* print debug statements */
-	if (status == MB_SUCCESS && verbose >= 5
-		&& store->kind == MB_DATA_DATA)
-		{
-		fprintf(stderr,"\ndbg5  Sensor record to be written by MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5  Sensor values:\n");
-		fprintf(stderr,"dbg5       pitch:           %d\n",
-			store->pitch);
-		fprintf(stderr,"dbg5       roll:            %d\n",
-			store->roll);
-		fprintf(stderr,"dbg5       gain:            %d\n",
-			store->gain);
-		fprintf(stderr,"dbg5       correction:      %d\n",
-			store->correction);
-		fprintf(stderr,"dbg5       surface_vel:     %d\n",
-			store->surface_vel);
-		fprintf(stderr,"dbg5       pulse_width:     %d\n",
-			store->pulse_width);
-		fprintf(stderr,"dbg5       attenuation:     %d\n",
-			store->attenuation);
-		fprintf(stderr,"dbg5       spare1:          %d\n",
-			store->spare1);
-		fprintf(stderr,"dbg5       spare2:          %d\n",
-			store->spare2);
-		fprintf(stderr,"dbg5       mode:            %c%c\n",
-			store->mode[0], store->mode[1]);
-		fprintf(stderr,"dbg5       data_correction: %c%c\n",
-			store->data_correction[0], store->data_correction[1]);
-		fprintf(stderr,"dbg5       ssv_source:      %c%c\n",
-			store->ssv_source[0], store->ssv_source[1]);
-		}
-
-	/* print debug statements */
-	if (status == MB_SUCCESS && verbose >= 5
-		&& store->kind == MB_DATA_VELOCITY_PROFILE)
-		{
-		fprintf(stderr,"\ndbg5  SVP record to be written by MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5  SVP values:\n");
-		fprintf(stderr,"dbg5       svp_mean:     %d\n",
-			store->svp_mean);
-		fprintf(stderr,"dbg5       svp_number:   %d\n",
-			store->svp_number);
-		fprintf(stderr,"dbg5       svp_spare:   %d\n",
-			store->svp_spare);
-		for (i=0;i<30;i++)
-			fprintf(stderr,"dbg5       %d  depth: %d  vel: %d\n",
-				i,store->svp_depth[i],
-				store->svp_vel[i]);
-		fprintf(stderr,"dbg5       vru1:         %d\n",
-			store->vru1);
-		fprintf(stderr,"dbg5       vru1_port:    %d\n",
-			store->vru1_port);
-		fprintf(stderr,"dbg5       vru1_forward: %d\n",
-			store->vru1_forward);
-		fprintf(stderr,"dbg5       vru1_vert:    %d\n",
-			store->vru1_vert);
-		fprintf(stderr,"dbg5       vru2:         %d\n",
-			store->vru2);
-		fprintf(stderr,"dbg5       vru2_port:    %d\n",
-			store->vru2_port);
-		fprintf(stderr,"dbg5       vru2_forward: %d\n",
-			store->vru2_forward);
-		fprintf(stderr,"dbg5       vru2_vert:    %d\n",
-			store->vru2_vert);
-		fprintf(stderr,"dbg5       pitch_bias:    %d\n",
-			store->pitch_bias);
-		fprintf(stderr,"dbg5       roll_bias:    %d\n",
-			store->roll_bias);
-		fprintf(stderr,"dbg5       vru:          %c%c%c%c%c%c%c%c\n",
-			store->vru[0],store->vru[1],store->vru[2],store->vru[3],
-			store->vru[4],store->vru[5],store->vru[6],store->vru[7]);
-		}
-
-	/* print debug statements */
-	if (status == MB_SUCCESS && verbose >= 5
-		&& store->kind == MB_DATA_DATA)
-		{
-		fprintf(stderr,"\ndbg5  Data record to be written by MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5  Data values:\n");
-		fprintf(stderr,"dbg5       beams_bath:   %d\n",
-			store->beams_bath);
-		fprintf(stderr,"dbg5       scale_factor: %d\n",
-			store->scale_factor);
-		for (i=0;i<store->beams_bath;i++)
-			fprintf(stderr,"dbg5       beam: %d  bath: %d  across_track: %d\n",
-				i,store->bath[i],
-				store->bath_acrosstrack[i]);
-		}
-
-	/* print debug statements */
-	if (status == MB_SUCCESS && verbose >= 5
-		&& store->kind == MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"\ndbg5  Comment record to be written by MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5  Comment:\n");
-		fprintf(stderr,"dbg5       comment:   %s\n",
-			store->comment);
-		}
-
-	/* put header values */
-	if (status == MB_SUCCESS)
-		{
-		/* put header values */
-		mb_put_binary_short(MB_NO, store->year, &buffer[0]);
-		mb_put_binary_short(MB_NO, store->day, &buffer[2]);
-		mb_put_binary_short(MB_NO, store->min, &buffer[4]);
-		mb_put_binary_short(MB_NO, store->sec, &buffer[6]);
-		mb_put_binary_int(MB_NO, store->lat, &buffer[8]);
-		mb_put_binary_int(MB_NO, store->lon, &buffer[12]);
-		mb_put_binary_short(MB_NO, store->heading, &buffer[16]);
-		mb_put_binary_short(MB_NO, store->course, &buffer[18]);
-		mb_put_binary_short(MB_NO, store->speed, &buffer[20]);
-		mb_put_binary_short(MB_NO, store->speed_ps, &buffer[22]);
-		mb_put_binary_short(MB_NO, store->quality, &buffer[24]);
-		mb_put_binary_short(MB_NO, store->sensor_size, &buffer[26]);
-		mb_put_binary_short(MB_NO, store->data_size, &buffer[28]);
-		buffer[30] = store->speed_ref[0];
-		buffer[31] = store->speed_ref[1];
-		buffer[32] = store->sensor_type[0];
-		buffer[33] = store->sensor_type[1];
-		buffer[34] = store->data_type[0];
-		buffer[35] = store->data_type[1];
-
-		/* write header record to file */
-		if ((status = fwrite(buffer,1,MBSYS_SB2000_HEADER_SIZE,
-			mb_io_ptr->mbfp)) == MBSYS_SB2000_HEADER_SIZE)
-			{
-			status = MB_SUCCESS;
-			*error = MB_ERROR_NO_ERROR;
-			}
-		else
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_WRITE_FAIL;
-			}
-		}
-
-	/* put sensor data */
-	if (status == MB_SUCCESS
-		&& store->kind == MB_DATA_DATA
-		&& store->sensor_size > 0)
-		{
-		/* put sensor values */
-		mb_put_binary_short(MB_NO, store->pitch, &buffer[0]);
-		mb_put_binary_short(MB_NO, store->roll, &buffer[2]);
-		mb_put_binary_short(MB_NO, store->gain, &buffer[4]);
-		mb_put_binary_short(MB_NO, store->correction, &buffer[6]);
-		mb_put_binary_short(MB_NO, store->surface_vel, &buffer[8]);
-		mb_put_binary_short(MB_NO, store->pulse_width, &buffer[10]);
-		mb_put_binary_short(MB_NO, store->attenuation, &buffer[12]);
-		mb_put_binary_short(MB_NO, store->spare1, &buffer[14]);
-		mb_put_binary_short(MB_NO, store->spare2, &buffer[16]);
-		store->mode[0] = buffer[18];
-		store->mode[1] = buffer[19];
-		store->data_correction[0] = buffer[20];
-		store->data_correction[1] = buffer[21];
-		store->ssv_source[0] = buffer[22];
-		store->ssv_source[1] = buffer[23];
-
-		/* write sensor record to file */
-		if ((status = fwrite(buffer,1,store->sensor_size,
-			mb_io_ptr->mbfp)) == store->sensor_size)
-			{
-			status = MB_SUCCESS;
-			*error = MB_ERROR_NO_ERROR;
-			}
-		else
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_WRITE_FAIL;
-			}
-		}
-
-	if (status == MB_SUCCESS
-		&& store->kind == MB_DATA_VELOCITY_PROFILE
-		&& store->data_size > 0)
-		{
-		/* extract the values */
-		mb_put_binary_int(MB_NO, store->svp_mean, &buffer[0]);
-		mb_put_binary_short(MB_NO, store->svp_number, &buffer[4]);
-		mb_put_binary_short(MB_NO, store->svp_spare, &buffer[6]);
-		for (i=0;i<MIN(store->svp_number, 30);i++)
-			{
-			mb_put_binary_short(MB_NO, store->svp_depth[i], &buffer[8+i*4]);
-			mb_put_binary_short(MB_NO, store->svp_vel[i], &buffer[10+i*4]);
-			}
-		mb_put_binary_short(MB_NO, store->vru1, &buffer[128]);
-		mb_put_binary_short(MB_NO, store->vru1_port, &buffer[130]);
-		mb_put_binary_short(MB_NO, store->vru1_forward, &buffer[132]);
-		mb_put_binary_short(MB_NO, store->vru1_vert, &buffer[134]);
-		mb_put_binary_short(MB_NO, store->vru2, &buffer[136]);
-		mb_put_binary_short(MB_NO, store->vru2_port, &buffer[138]);
-		mb_put_binary_short(MB_NO, store->vru2_forward, &buffer[140]);
-		mb_put_binary_short(MB_NO, store->vru2_vert, &buffer[142]);
-
-		/* write svp profile */
-		if ((status = fwrite(buffer,1,store->data_size,
-			mb_io_ptr->mbfp)) == store->data_size)
-			{
-			status = MB_SUCCESS;
-			*error = MB_ERROR_NO_ERROR;
-			}
-		else
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_WRITE_FAIL;
-			}
-		}
-
-	if (status == MB_SUCCESS
-		&& store->kind == MB_DATA_DATA
-		&& store->data_size > 0)
-		{
-		/* put the values */
-		mb_put_binary_short(MB_NO, store->beams_bath, &buffer[0]);
-		mb_put_binary_short(MB_NO, store->scale_factor, &buffer[2]);
-		for (i=0;i<store->beams_bath;i++)
-			{
-			mb_put_binary_short(MB_NO, store->bath[i], &buffer[4+i*4]);
-			mb_put_binary_short(MB_NO, store->bath_acrosstrack[i], &buffer[6+i*4]);
-			}
-
-		/* write survey data */
-		if ((status = fwrite(buffer,1,store->data_size,
-			mb_io_ptr->mbfp)) == store->data_size)
-			{
-			status = MB_SUCCESS;
-			*error = MB_ERROR_NO_ERROR;
-			}
-		else
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_WRITE_FAIL;
-			}
-		}
-
-	if (status == MB_SUCCESS
-		&& store->kind == MB_DATA_COMMENT
-		&& store->data_size > 0)
-		{
-		/* put the comment */
-		strncpy(buffer, store->comment,
-			MIN(store->data_size, MBSYS_SB2000_COMMENT_LENGTH-1));
-		buffer[MIN(store->data_size,
-			MBSYS_SB2000_COMMENT_LENGTH-1)] = '\0';
-
-		/* write comment */
-		if ((status = fwrite(buffer,1,store->data_size,
-			mb_io_ptr->mbfp)) == store->data_size)
-			{
-			status = MB_SUCCESS;
-			*error = MB_ERROR_NO_ERROR;
-			}
-		else
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_WRITE_FAIL;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mbr_sb2000ss.c b/src/mbio/mbr_sb2000ss.c
deleted file mode 100644
index aede275..0000000
--- a/src/mbio/mbr_sb2000ss.c
+++ /dev/null
@@ -1,1277 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbr_sb2000ss.c	10/14/94
- *	$Id: mbr_sb2000ss.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1994-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbr_sb2000ss.c contains the functions for reading and writing
- * multibeam data in the SB2000SS format.
- * These functions include:
- *   mbr_alm_sb2000ss	- allocate read/write memory
- *   mbr_dem_sb2000ss	- deallocate read/write memory
- *   mbr_rt_sb2000ss	- read and translate data
- *   mbr_wt_sb2000ss	- translate and write data
- *
- * Author:	D. W. Caress
- * Date:	October 14, 1994
- * $Log: mbr_sb2000ss.c,v $
- * Revision 5.13  2005/11/05 00:48:05  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.12  2003/05/20 18:05:32  caress
- * Added svp_source to data source parameters.
- *
- * Revision 5.11  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.10  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.9  2002/04/08 21:29:49  caress
- * Removed errant debug message.
- *
- * Revision 5.8  2002/04/08 20:59:38  caress
- * Release 5.0.beta17
- *
- * Revision 5.7  2002/02/26 07:50:41  caress
- * Release 5.0.beta14
- *
- * Revision 5.6  2002/02/22 09:03:43  caress
- * Release 5.0.beta13
- *
- * Revision 5.5  2001/07/20 00:32:54  caress
- * Release 5.0.beta03
- *
- * Revision 5.4  2001/04/06  22:05:59  caress
- * Consolidated xse formats into one format.
- *
- * Revision 5.3  2001/03/22  20:50:02  caress
- * Trying to make version 5.0.beta0
- *
- * Revision 5.1  2001/01/22  07:43:34  caress
- * Version 5.0.beta01
- *
- * Revision 5.0  2000/12/01  22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.9  2000/10/11  01:03:21  caress
- * Convert to ANSI C
- *
- * Revision 4.8  2000/09/30  06:34:20  caress
- * Snapshot for Dale.
- *
- * Revision 4.7  1998/10/05  17:46:15  caress
- * MB-System version 4.6beta
- *
- * Revision 4.6  1997/07/25  14:19:53  caress
- * Version 4.5beta2.
- * Much mucking, particularly with Simrad formats.
- *
- * Revision 4.5  1997/04/21  17:02:07  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.5  1997/04/17  15:07:36  caress
- * MB-System 4.5 Beta Release
- *
- * Revision 4.4  1996/04/22  13:21:19  caress
- * Now have DTR and MIN/MAX defines in mb_define.h
- *
- * Revision 4.3  1995/03/06  19:38:54  caress
- * Changed include strings.h to string.h for POSIX compliance.
- *
- * Revision 4.2  1994/12/21  20:21:09  caress
- * Changes to support high resolution SeaBeam 2000 sidescan files
- * from R/V Melville data.
- *
- * Revision 4.0  1994/10/21  12:34:58  caress
- * Release V4.0
- *
- * Revision 1.1  1994/10/21  12:20:01  caress
- * Initial revision
- *
- *
- */
-/*--------------------------------------------------------------------
- * Notes on the MBF_SB2000SS data format:
- *   1. This data format is used to store sidescan data from
- *      Sea Beam 2000 sonars.
- *      This format was created and used by the Scripps
- *      Institution of Oceanography; most data files in this format
- *      consist of Sea Beam data collected on the R/V George Melville.
- *      This format is one of the "swathbathy" formats created by
- *      Jim Charters of Scripps.
- *   2. The data records consist of three logical records: the header
- *      record, the sensor specific record and the data record.
- *   3. The header record consists of 36 bytes, including the sizes
- *      of the following sensor specific and data records.
- *   4. The sensor specific records are 32 bytes long.
- *   5. The data record lengths are variable.
- *   6. Comments are included in text records, which are of variable
- *      length.
- *   7. Information on this format was obtained from the Geological
- *      Data Center and the Shipboard Computer Group at the Scripps
- *      Institution of Oceanography
- *
- * The kind value in the mbf_sb2000ss_struct indicates whether the
- * mbf_sb2000ss_data_struct structure holds data (kind = 1) or an
- * ascii comment record (kind = 2).
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mb_define.h"
-#include "mbsys_sb2000.h"
-
-/* include for byte swapping on little-endian machines */
-#ifdef BYTESWAPPED
-#include "mb_swap.h"
-#endif
-
-/* essential function prototypes */
-int mbr_register_sb2000ss(int verbose, void *mbio_ptr,
-		int *error);
-int mbr_info_sb2000ss(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_alm_sb2000ss(int verbose, void *mbio_ptr, int *error);
-int mbr_dem_sb2000ss(int verbose, void *mbio_ptr, int *error);
-int mbr_rt_sb2000ss(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_wt_sb2000ss(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-
-static char rcs_id[]="$Id: mbr_sb2000ss.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mbr_register_sb2000ss(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_register_sb2000ss";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* get mb_io_ptr */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set format info parameters */
-	status = mbr_info_sb2000ss(verbose,
-			&mb_io_ptr->system,
-			&mb_io_ptr->beams_bath_max,
-			&mb_io_ptr->beams_amp_max,
-			&mb_io_ptr->pixels_ss_max,
-			mb_io_ptr->format_name,
-			mb_io_ptr->system_name,
-			mb_io_ptr->format_description,
-			&mb_io_ptr->numfile,
-			&mb_io_ptr->filetype,
-			&mb_io_ptr->variable_beams,
-			&mb_io_ptr->traveltime,
-			&mb_io_ptr->beam_flagging,
-			&mb_io_ptr->nav_source,
-			&mb_io_ptr->heading_source,
-			&mb_io_ptr->vru_source,
-			&mb_io_ptr->svp_source,
-			&mb_io_ptr->beamwidth_xtrack,
-			&mb_io_ptr->beamwidth_ltrack,
-			error);
-
-	/* set format and system specific function pointers */
-	mb_io_ptr->mb_io_format_alloc = &mbr_alm_sb2000ss;
-	mb_io_ptr->mb_io_format_free = &mbr_dem_sb2000ss;
-	mb_io_ptr->mb_io_store_alloc = &mbsys_sb2000_alloc;
-	mb_io_ptr->mb_io_store_free = &mbsys_sb2000_deall;
-	mb_io_ptr->mb_io_read_ping = &mbr_rt_sb2000ss;
-	mb_io_ptr->mb_io_write_ping = &mbr_wt_sb2000ss;
-	mb_io_ptr->mb_io_dimensions = &mbsys_sb2000_dimensions;
-	mb_io_ptr->mb_io_extract = &mbsys_sb2000_extract;
-	mb_io_ptr->mb_io_insert = &mbsys_sb2000_insert;
-	mb_io_ptr->mb_io_extract_nav = &mbsys_sb2000_extract_nav;
-	mb_io_ptr->mb_io_insert_nav = &mbsys_sb2000_insert_nav;
-	mb_io_ptr->mb_io_extract_altitude = &mbsys_sb2000_extract_altitude;
-	mb_io_ptr->mb_io_insert_altitude = NULL;
-	mb_io_ptr->mb_io_extract_svp = NULL;
-	mb_io_ptr->mb_io_insert_svp = NULL;
-	mb_io_ptr->mb_io_ttimes = &mbsys_sb2000_ttimes;
-	mb_io_ptr->mb_io_detects = &mbsys_sb2000_detects;
-	mb_io_ptr->mb_io_copyrecord = &mbsys_sb2000_copy;
-	mb_io_ptr->mb_io_extract_rawss = NULL;
-	mb_io_ptr->mb_io_insert_rawss = NULL;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",mb_io_ptr->system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",mb_io_ptr->beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",mb_io_ptr->beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",mb_io_ptr->pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",mb_io_ptr->format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",mb_io_ptr->system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",mb_io_ptr->format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",mb_io_ptr->numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",mb_io_ptr->filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",mb_io_ptr->variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",mb_io_ptr->traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",mb_io_ptr->beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",mb_io_ptr->nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",mb_io_ptr->heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",mb_io_ptr->vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",mb_io_ptr->svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",mb_io_ptr->beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",mb_io_ptr->beamwidth_ltrack);
-		fprintf(stderr,"dbg2       format_alloc:       %p\n",(void *)mb_io_ptr->mb_io_format_alloc);
-		fprintf(stderr,"dbg2       format_free:        %p\n",(void *)mb_io_ptr->mb_io_format_free);
-		fprintf(stderr,"dbg2       store_alloc:        %p\n",(void *)mb_io_ptr->mb_io_store_alloc);
-		fprintf(stderr,"dbg2       store_free:         %p\n",(void *)mb_io_ptr->mb_io_store_free);
-		fprintf(stderr,"dbg2       read_ping:          %p\n",(void *)mb_io_ptr->mb_io_read_ping);
-		fprintf(stderr,"dbg2       write_ping:         %p\n",(void *)mb_io_ptr->mb_io_write_ping);
-		fprintf(stderr,"dbg2       extract:            %p\n",(void *)mb_io_ptr->mb_io_extract);
-		fprintf(stderr,"dbg2       insert:             %p\n",(void *)mb_io_ptr->mb_io_insert);
-		fprintf(stderr,"dbg2       extract_nav:        %p\n",(void *)mb_io_ptr->mb_io_extract_nav);
-		fprintf(stderr,"dbg2       insert_nav:         %p\n",(void *)mb_io_ptr->mb_io_insert_nav);
-		fprintf(stderr,"dbg2       extract_altitude:   %p\n",(void *)mb_io_ptr->mb_io_extract_altitude);
-		fprintf(stderr,"dbg2       insert_altitude:    %p\n",(void *)mb_io_ptr->mb_io_insert_altitude);
-		fprintf(stderr,"dbg2       extract_svp:        %p\n",(void *)mb_io_ptr->mb_io_extract_svp);
-		fprintf(stderr,"dbg2       insert_svp:         %p\n",(void *)mb_io_ptr->mb_io_insert_svp);
-		fprintf(stderr,"dbg2       ttimes:             %p\n",(void *)mb_io_ptr->mb_io_ttimes);
-		fprintf(stderr,"dbg2       detects:            %p\n",(void *)mb_io_ptr->mb_io_detects);
-		fprintf(stderr,"dbg2       extract_rawss:      %p\n",(void *)mb_io_ptr->mb_io_extract_rawss);
-		fprintf(stderr,"dbg2       insert_rawss:       %p\n",(void *)mb_io_ptr->mb_io_insert_rawss);
-		fprintf(stderr,"dbg2       copyrecord:         %p\n",(void *)mb_io_ptr->mb_io_copyrecord);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbr_info_sb2000ss(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error)
-{
-	char	*function_name = "mbr_info_sb2000ss";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* set format info parameters */
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-	*system = MB_SYS_SB2000;
-	*beams_bath_max = 0;
-	*beams_amp_max = 0;
-	*pixels_ss_max = 2000;
-	strncpy(format_name, "SB2000SS", MB_NAME_LENGTH);
-	strncpy(system_name, "SB2000", MB_NAME_LENGTH);
-	strncpy(format_description, "Format name:          MBF_SB2000SS\nInformal Description: SIO Swath-bathy SeaBeam 2000 format\nAttributes:           SeaBeam 2000, sidescan,\n                      1000 pixels for 4-bit sidescan,\n                      2000 pixels for 12+-bit sidescan,\n                      binary,  SIO.\n", MB_DESCRIPTION_LENGTH);
-	*numfile = 1;
-	*filetype = MB_FILETYPE_NORMAL;
-	*variable_beams = MB_NO;
-	*traveltime = MB_NO;
-	*beam_flagging = MB_YES;
-	*nav_source = MB_DATA_DATA;
-	*heading_source = MB_DATA_DATA;
-	*vru_source = MB_DATA_DATA;
-	*svp_source = MB_DATA_NONE;
-	*beamwidth_xtrack = 2.0;
-	*beamwidth_ltrack = 2.0;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",*system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",*beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",*beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",*pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",*numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",*filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",*variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",*traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",*beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",*nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",*heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",*vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",*svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",*beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",*beamwidth_ltrack);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_alm_sb2000ss(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_alm_sb2000ss";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set initial status */
-	status = MB_SUCCESS;
-
-	/* allocate memory for data structure */
-	status = mb_malloc(verbose,sizeof(struct mbsys_sb2000_struct),
-				&mb_io_ptr->store_data,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_dem_sb2000ss(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_dem_sb2000ss";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* deallocate memory for data descriptor */
-	status = mb_free(verbose,&mb_io_ptr->store_data,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_rt_sb2000ss(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_rt_sb2000ss";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_sb2000_struct *store;
-	int	read_status;
-	char	buffer[2*MBSYS_SB2000_PIXELS+4];
-	unsigned short *short_ptr;
-	short	test_sensor_size, test_data_size;
-	int 	found, skip;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_sb2000_struct *) store_ptr;
-
-	/* read next header record from file */
-	mb_io_ptr->file_pos = mb_io_ptr->file_bytes;
-	skip = 0;
-	found = MB_NO;
-	if ((status = fread(buffer,1,MBSYS_SB2000_HEADER_SIZE,
-			mb_io_ptr->mbfp)) == MBSYS_SB2000_HEADER_SIZE)
-		{
-		mb_io_ptr->file_bytes += status;
-		status = MB_SUCCESS;
-		*error = MB_ERROR_NO_ERROR;
-
-		/* check if header is ok */
-		if (strncmp(&buffer[34],"SR",2) == 0
-		    || strncmp(&buffer[34],"RS",2) == 0
-		    || strncmp(&buffer[34],"SP",2) == 0
-		    || strncmp(&buffer[34],"TR",2) == 0
-		    || strncmp(&buffer[34],"IR",2) == 0
-		    || strncmp(&buffer[34],"AT",2) == 0
-		    || strncmp(&buffer[34],"SC",2) == 0)
-		    {
-		    mb_get_binary_short(MB_NO, &buffer[26], &test_sensor_size);
-		    mb_get_binary_short(MB_NO, &buffer[28], &test_data_size);
-		    if (test_sensor_size <= 32 && test_data_size <= 2*MBSYS_SB2000_PIXELS+4)
-			found = MB_YES;
-		    }
-		}
-	else
-		{
-		mb_io_ptr->file_bytes += status;
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	/* if not a good header search through file to find one */
-	while (status == MB_SUCCESS && found == MB_NO)
-		{
-		/* shift bytes by one */
-		for (i=0;i<MBSYS_SB2000_HEADER_SIZE-1;i++)
-			buffer[i] = buffer[i+1];
-		mb_io_ptr->file_pos += 1;
-		skip++;
-
-		/* read next byte */
-		if ((read_status = fread(&buffer[MBSYS_SB2000_HEADER_SIZE-1],
-			1,1,mb_io_ptr->mbfp)) == 1)
-			{
-			mb_io_ptr->file_bytes += read_status;
-			status = MB_SUCCESS;
-			*error = MB_ERROR_NO_ERROR;
-
-			if (strncmp(&buffer[34],"SR",2) == 0
-			    || strncmp(&buffer[34],"RS",2) == 0
-			    || strncmp(&buffer[34],"SP",2) == 0
-			    || strncmp(&buffer[34],"TR",2) == 0
-			    || strncmp(&buffer[34],"IR",2) == 0
-			    || strncmp(&buffer[34],"AT",2) == 0
-			    || strncmp(&buffer[34],"SC",2) == 0)
-			    {
-			    mb_get_binary_short(MB_NO, &buffer[26], &test_sensor_size);
-			    mb_get_binary_short(MB_NO, &buffer[28], &test_data_size);
-			    if (test_sensor_size <= 32 && test_data_size <= 2*MBSYS_SB2000_PIXELS+4)
-				found = MB_YES;
-			    }
-
-			}
-		else
-			{
-			found = MB_YES;
-			mb_io_ptr->file_bytes += status;
-			status = MB_FAILURE;
-			*error = MB_ERROR_EOF;
-			}
-		}
-
-	/* report data skips */
-	if (skip > 0 && verbose >= 2)
-	    fprintf(stderr, "\ndgb2           DATA SKIPPED: %d bytes\n", skip);
-
-	/* get header values */
-	mb_get_binary_short(MB_NO, &buffer[0], &store->year);
-	mb_get_binary_short(MB_NO, &buffer[2], &store->day);
-	mb_get_binary_short(MB_NO, &buffer[4], &store->min);
-	mb_get_binary_short(MB_NO, &buffer[6], &store->sec);
-	mb_get_binary_int(MB_NO, &buffer[8], &store->lat);
-	mb_get_binary_int(MB_NO, &buffer[12], &store->lon);
-	mb_get_binary_short(MB_NO, &buffer[16], &store->heading);
-	mb_get_binary_short(MB_NO, &buffer[18], &store->course);
-	mb_get_binary_short(MB_NO, &buffer[20], &store->speed);
-	mb_get_binary_short(MB_NO, &buffer[22], &store->speed_ps);
-	mb_get_binary_short(MB_NO, &buffer[24], &store->quality);
-	mb_get_binary_short(MB_NO, &buffer[26], (short *)&store->sensor_size);
-	mb_get_binary_short(MB_NO, &buffer[28], (short *)&store->data_size);
-	store->speed_ref[0] = buffer[30];
-	store->speed_ref[1] = buffer[31];
-	store->sensor_type[0] = buffer[32];
-	store->sensor_type[1] = buffer[33];
-	store->data_type[0] = buffer[34];
-	store->data_type[1] = buffer[35];
-
-	/* check for unintelligible records */
-	if (status == MB_SUCCESS)
-		{
-		if ((strncmp(store->sensor_type,"SS",2) != 0 ||
-			strncmp(store->data_type,"SC",2) != 0)
-			&& strncmp(store->data_type,"TR",2) != 0
-			&& strncmp(store->data_type,"SP",2) != 0)
-			{
-			/* read rest of record */
-			for (i=0;
-			    (i < store->sensor_size + store->data_size)
-				&& status == MB_SUCCESS;
-			    i++)
-			    {
-			    if ((read_status = fread(buffer,1,1,
-				mb_io_ptr->mbfp)) != 1)
-				{
-				status = MB_FAILURE;
-				*error = MB_ERROR_EOF;
-				store->kind = MB_DATA_NONE;
-				}
-			    else
-				{
-				mb_io_ptr->file_bytes += read_status;
-				}
-			    }
-
-			/* if eof not reached set unintelligible error */
-			if (status == MB_SUCCESS)
-			    {
-			    status = MB_FAILURE;
-			    *error = MB_ERROR_UNINTELLIGIBLE;
-			    store->kind = MB_DATA_NONE;
-			    }
-			}
-		else if (strncmp(store->data_type,"SC",2) == 0)
-			{
-			store->kind = MB_DATA_DATA;
-			}
-		else if (strncmp(store->data_type,"SP",2) == 0)
-			{
-			store->kind = MB_DATA_VELOCITY_PROFILE;
-			}
-		else
-			{
-			store->kind = MB_DATA_COMMENT;
-			}
-		}
-
-	/* fix incorrect header records */
-	if (status == MB_SUCCESS
-		&& store->kind == MB_DATA_DATA
-		&& store->data_size == 1000)
-		{
-		store->sensor_size = 32;
-		store->data_size = 1001;
-		}
-
-	/* print debug statements */
-	if (status == MB_SUCCESS && verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  New header record in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5  New header values:\n");
-		fprintf(stderr,"dbg5       year:       %d\n",store->year);
-		fprintf(stderr,"dbg5       day:        %d\n",store->day);
-		fprintf(stderr,"dbg5       min:        %d\n",store->min);
-		fprintf(stderr,"dbg5       sec:        %d\n",store->sec);
-		fprintf(stderr,"dbg5       lat:        %d\n",store->lat);
-		fprintf(stderr,"dbg5       lon:        %d\n",store->lon);
-		fprintf(stderr,"dbg5       heading:    %d\n",store->heading);
-		fprintf(stderr,"dbg5       course:     %d\n",store->course);
-		fprintf(stderr,"dbg5       speed:      %d\n",store->speed);
-		fprintf(stderr,"dbg5       speed_ps:   %d\n",store->speed_ps);
-		fprintf(stderr,"dbg5       quality:    %d\n",store->quality);
-		fprintf(stderr,"dbg5       sensor size:%d\n",store->sensor_size);
-		fprintf(stderr,"dbg5       data size:  %d\n",store->data_size);
-		fprintf(stderr,"dbg5       speed_ref:  %c%c\n",
-			store->speed_ref[0],store->speed_ref[1]);
-		fprintf(stderr,"dbg5       sensor_type:%c%c\n",
-			store->sensor_type[0],store->sensor_type[1]);
-		fprintf(stderr,"dbg5       data_type:  %c%c\n",
-			store->data_type[0],store->data_type[1]);
-		}
-
-	/* read sensor record from file */
-	if (status == MB_SUCCESS && store->sensor_size > 0)
-		{
-		if ((status = fread(buffer,1,store->sensor_size,
-			mb_io_ptr->mbfp)) == store->sensor_size)
-			{
-			mb_io_ptr->file_bytes += status;
-			status = MB_SUCCESS;
-			*error = MB_ERROR_NO_ERROR;
-			}
-		else
-			{
-			mb_io_ptr->file_bytes += status;
-			status = MB_FAILURE;
-			*error = MB_ERROR_EOF;
-			}
-		}
-
-	/* extract sensor data */
-	if (status == MB_SUCCESS && store->sensor_size > 0)
-		{
-		/* extract the values */
-		mb_get_binary_int(MB_NO, &buffer[0], &store->ping_number);
-		mb_get_binary_short(MB_NO, &buffer[4], &store->ping_length);
-		mb_get_binary_short(MB_NO, &buffer[6], &store->pixel_size);
-		mb_get_binary_short(MB_NO, &buffer[8], &store->ss_min);
-		mb_get_binary_short(MB_NO, &buffer[10], &store->ss_max);
-		mb_get_binary_short(MB_NO, &buffer[12], &store->sample_rate);
-		mb_get_binary_short(MB_NO, &buffer[14], &store->start_time);
-		mb_get_binary_short(MB_NO, &buffer[16], &store->tot_slice);
-		mb_get_binary_short(MB_NO, &buffer[18], &store->pixels_ss);
-		for (i=0;i<store->sensor_size - 20;i++)
-			store->spare_ss[i] = buffer[18+i];
-		}
-
-	/* read data record from file */
-	if (status == MB_SUCCESS
-		&& store->data_size > 0)
-		{
-		if ((status = fread(buffer,1,store->data_size,
-			mb_io_ptr->mbfp)) == store->data_size)
-			{
-			mb_io_ptr->file_bytes += status;
-			status = MB_SUCCESS;
-			*error = MB_ERROR_NO_ERROR;
-			}
-		else
-			{
-			mb_io_ptr->file_bytes += status;
-			status = MB_FAILURE;
-			*error = MB_ERROR_EOF;
-			}
-		}
-
-	/* extract sidescan data */
-	if (status == MB_SUCCESS
-		&& store->kind == MB_DATA_DATA)
-		{
-
-		/* fix some files with incorrect sensor records */
-		if (buffer[0] == 'G'
-			&& (store->data_size == 1001
-			    || store->data_size == 1004)
-			&& store->pixels_ss != 1000)
-			{
-			store->pixels_ss = 1000;
-			}
-
-		/* correct data size if needed */
-		if (buffer[0] == 'G' && store->data_size == 1001)
-		    {
-		    store->data_size = 1004;
-		    store->ss[1001] = 'G';
-		    store->ss[1002] = 'G';
-		    store->ss[1003] = 'G';
-		    }
-
-		/* fix some files with incorrect data size id's */
-		if (buffer[0] == 'R'
-			&& (2 * store->pixels_ss) > store->data_size
-			&& store->pixels_ss <= MBSYS_SB2000_PIXELS)
-			{
-			buffer[0] = 'G';
-			}
-
-		/* deal with 1-byte data */
-		if (buffer[0] == 'G')
-		    {
-		    store->ss_type = 'G';
-		    for (i=0;i<store->pixels_ss;i++)
-			{
-			store->ss[i] = buffer[i+1];
-			}
-		    }
-
-		/* deal with 2-byte data */
-		else if (buffer[0] == 'R')
-		    {
-		    store->ss_type = 'R';
-		    for (i=0;i<store->pixels_ss;i++)
-			{
-			mb_get_binary_short(MB_NO, (short *)&(buffer[4+2*i]),
-					    (short *)&(store->ss[2*i]));
-			}
-		    }
-
-		/* print debug statements */
-		if (verbose >= 5)
-			{
-			fprintf(stderr,"\ndbg5  New data record read by MBIO function <%s>\n",function_name);
-			fprintf(stderr,"dbg5  New data values:\n");
-			fprintf(stderr,"dbg5       ping_number:     %d\n",
-				store->ping_number);
-			fprintf(stderr,"dbg5       ping_length:     %d\n",
-				store->ping_length);
-			fprintf(stderr,"dbg5       pixel_size:      %d\n",
-				store->pixel_size);
-			fprintf(stderr,"dbg5       ss_min:          %d\n",
-				store->ss_min);
-			fprintf(stderr,"dbg5       ss_max:          %d\n",
-				store->ss_max);
-			fprintf(stderr,"dbg5       sample_rate:     %d\n",
-				store->sample_rate);
-			fprintf(stderr,"dbg5       start_time:      %d\n",
-				store->start_time);
-			fprintf(stderr,"dbg5       tot_slice:       %d\n",
-				store->tot_slice);
-			fprintf(stderr,"dbg5       pixels_ss:       %d\n",
-				store->pixels_ss);
-			fprintf(stderr,"dbg5       spare_ss:        ");
-			for (i=0;i<12;i++)
-				fprintf(stderr,"%c", store->spare_ss[i]);
-			fprintf(stderr,"dbg5       sidescan_type:%c\n",
-				store->ss_type);
-			if (store->ss_type == 'G')
-				{
-				for (i=0;i<store->pixels_ss;i++)
-					fprintf(stderr,"dbg5       pixel: %d  ss: %d\n",
-						i,store->ss[i]);
-				}
-			else if (store->ss_type == 'R')
-				{
-				for (i=1;i<=store->pixels_ss;i++)
-					{
-					short_ptr = (unsigned short *) &store->ss[i*2];
-					fprintf(stderr,"dbg5       pixel: %d  ss: %d\n",
-						i,*short_ptr);
-					}
-				}
-			}
-		}
-
-	/* extract velocity profile record */
-	if (status == MB_SUCCESS
-		&& store->kind == MB_DATA_VELOCITY_PROFILE)
-		{
-		/* extract the values */
-		mb_get_binary_int(MB_NO, &buffer[0], &store->svp_mean);
-		mb_get_binary_short(MB_NO, &buffer[4], &store->svp_number);
-		mb_get_binary_short(MB_NO, &buffer[6], &store->svp_spare);
-		for (i=0;i<MIN(store->svp_number, 30);i++)
-			{
-			mb_get_binary_short(MB_NO, &buffer[8+i*4], &store->svp_depth[i]);
-			mb_get_binary_short(MB_NO, &buffer[10+i*4], &store->svp_vel[i]);
-			}
-		mb_get_binary_short(MB_NO, &buffer[128], &store->vru1);
-		mb_get_binary_short(MB_NO, &buffer[130], &store->vru1_port);
-		mb_get_binary_short(MB_NO, &buffer[132], &store->vru1_forward);
-		mb_get_binary_short(MB_NO, &buffer[134], &store->vru1_vert);
-		mb_get_binary_short(MB_NO, &buffer[136], &store->vru2);
-		mb_get_binary_short(MB_NO, &buffer[138], &store->vru2_port);
-		mb_get_binary_short(MB_NO, &buffer[140], &store->vru2_forward);
-		mb_get_binary_short(MB_NO, &buffer[142], &store->vru2_vert);
-
-		/* print debug statements */
-		if (verbose >= 5)
-			{
-			fprintf(stderr,"\ndbg5  New svp record read by MBIO function <%s>\n",function_name);
-			fprintf(stderr,"dbg5  New svp values:\n");
-			fprintf(stderr,"dbg5       svp_mean:     %d\n",
-				store->svp_mean);
-			fprintf(stderr,"dbg5       svp_number:   %d\n",
-				store->svp_number);
-			fprintf(stderr,"dbg5       svp_spare:    %d\n",
-				store->svp_spare);
-			for (i=0;i<30;i++)
-				fprintf(stderr,"dbg5       %d  depth: %d  vel: %d\n",
-					i,store->svp_depth[i],
-					store->svp_vel[i]);
-			fprintf(stderr,"dbg5       vru1:         %d\n",
-				store->vru1);
-			fprintf(stderr,"dbg5       vru1_port:    %d\n",
-				store->vru1_port);
-			fprintf(stderr,"dbg5       vru1_forward: %d\n",
-				store->vru1_forward);
-			fprintf(stderr,"dbg5       vru1_vert:    %d\n",
-				store->vru1_vert);
-			fprintf(stderr,"dbg5       vru2:         %d\n",
-				store->vru2);
-			fprintf(stderr,"dbg5       vru2_port:    %d\n",
-				store->vru2_port);
-			fprintf(stderr,"dbg5       vru2_forward: %d\n",
-				store->vru2_forward);
-			fprintf(stderr,"dbg5       vru2_vert:    %d\n",
-				store->vru2_vert);
-			fprintf(stderr,"dbg5       pitch_bias:    %d\n",
-				store->pitch_bias);
-			fprintf(stderr,"dbg5       roll_bias:    %d\n",
-				store->roll_bias);
-			fprintf(stderr,"dbg5       vru:          %c%c%c%c%c%c%c%c\n",
-				store->vru[0],store->vru[1],store->vru[2],store->vru[3],
-				store->vru[4],store->vru[5],store->vru[6],store->vru[7]);
-			}
-		}
-
-	/* extract comment record */
-	if (status == MB_SUCCESS && store->kind == MB_DATA_COMMENT)
-		{
-		strncpy(store->comment, buffer,
-			MIN(store->data_size, MBSYS_SB2000_COMMENT_LENGTH-1));
-		store->comment[MIN(store->data_size,
-			MBSYS_SB2000_COMMENT_LENGTH-1)] = '\0';
-
-		/* print debug statements */
-		if (verbose >= 5)
-			{
-			fprintf(stderr,"\ndbg5  New comment record read by MBIO function <%s>\n",function_name);
-			fprintf(stderr,"dbg5  New comment:\n");
-			fprintf(stderr,"dbg5       comment:   %s\n",
-				store->comment);
-			}
-		}
-
-	/* set kind and error in mb_io_ptr */
-	mb_io_ptr->new_kind = store->kind;
-	mb_io_ptr->new_error = *error;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_wt_sb2000ss(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_wt_sb2000ss";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_sb2000_struct *store;
-	char	buffer[2*MBSYS_SB2000_PIXELS+4];
-	unsigned short *short_ptr;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_sb2000_struct *) store_ptr;
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Ready to write data in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       kind:       %d\n",
-			store->kind);
-		fprintf(stderr,"dbg5       error:      %d\n",*error);
-		fprintf(stderr,"dbg5       status:     %d\n",status);
-		}
-
-	/* print debug statements */
-	if (status == MB_SUCCESS && verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Header record to be written by MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5  Header values:\n");
-		fprintf(stderr,"dbg5       year:       %d\n",store->year);
-		fprintf(stderr,"dbg5       day:        %d\n",store->day);
-		fprintf(stderr,"dbg5       min:        %d\n",store->min);
-		fprintf(stderr,"dbg5       sec:        %d\n",store->sec);
-		fprintf(stderr,"dbg5       lat:        %d\n",store->lat);
-		fprintf(stderr,"dbg5       lon:        %d\n",store->lon);
-		fprintf(stderr,"dbg5       heading:    %d\n",store->heading);
-		fprintf(stderr,"dbg5       course:     %d\n",store->course);
-		fprintf(stderr,"dbg5       speed:      %d\n",store->speed);
-		fprintf(stderr,"dbg5       speed_ps:   %d\n",store->speed_ps);
-		fprintf(stderr,"dbg5       quality:    %d\n",store->quality);
-		fprintf(stderr,"dbg5       sensor size:%d\n",store->sensor_size);
-		fprintf(stderr,"dbg5       data size:  %d\n",store->data_size);
-		fprintf(stderr,"dbg5       speed_ref:  %c%c\n",
-			store->speed_ref[0],store->speed_ref[1]);
-		fprintf(stderr,"dbg5       sensor_type:%c%c\n",
-			store->sensor_type[0],store->sensor_type[1]);
-		fprintf(stderr,"dbg5       data_type:  %c%c\n",
-			store->data_type[0],store->data_type[1]);
-		}
-
-	/* print debug statements */
-	if (status == MB_SUCCESS && verbose >= 5
-		&& store->kind == MB_DATA_DATA)
-		{
-		fprintf(stderr,"\ndbg5  Sensor record to be written by MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5  Sensor values:\n");
-		fprintf(stderr,"dbg5       ping_number:     %d\n",
-			store->ping_number);
-		fprintf(stderr,"dbg5       ping_length:     %d\n",
-			store->ping_length);
-		fprintf(stderr,"dbg5       pixel_size:      %d\n",
-			store->pixel_size);
-		fprintf(stderr,"dbg5       ss_min:          %d\n",
-			store->ss_min);
-		fprintf(stderr,"dbg5       ss_max:          %d\n",
-			store->ss_max);
-		fprintf(stderr,"dbg5       sample_rate:     %d\n",
-			store->sample_rate);
-		fprintf(stderr,"dbg5       start_time:      %d\n",
-			store->start_time);
-		fprintf(stderr,"dbg5       tot_slice:       %d\n",
-			store->tot_slice);
-		fprintf(stderr,"dbg5       pixels_ss:       %d\n",
-			store->pixels_ss);
-		fprintf(stderr,"dbg5       spare_ss:        ");
-		for (i=0;i<12;i++)
-			fprintf(stderr,"%c", store->spare_ss[i]);
-		fprintf(stderr, "\n");
-		}
-
-	/* print debug statements */
-	if (status == MB_SUCCESS && verbose >= 5
-		&& store->kind == MB_DATA_VELOCITY_PROFILE)
-		{
-		fprintf(stderr,"\ndbg5  SVP record to be written by MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5  SVP values:\n");
-		fprintf(stderr,"dbg5       svp_mean:     %d\n",
-			store->svp_mean);
-		fprintf(stderr,"dbg5       svp_number:   %d\n",
-			store->svp_number);
-		fprintf(stderr,"dbg5       svp_spare:   %d\n",
-			store->svp_spare);
-		for (i=0;i<30;i++)
-			fprintf(stderr,"dbg5       %d  depth: %d  vel: %d\n",
-				i,store->svp_depth[i],
-				store->svp_vel[i]);
-		fprintf(stderr,"dbg5       vru1:         %d\n",
-			store->vru1);
-		fprintf(stderr,"dbg5       vru1_port:    %d\n",
-			store->vru1_port);
-		fprintf(stderr,"dbg5       vru1_forward: %d\n",
-			store->vru1_forward);
-		fprintf(stderr,"dbg5       vru1_vert:    %d\n",
-			store->vru1_vert);
-		fprintf(stderr,"dbg5       vru2:         %d\n",
-			store->vru2);
-		fprintf(stderr,"dbg5       vru2_port:    %d\n",
-			store->vru2_port);
-		fprintf(stderr,"dbg5       vru2_forward: %d\n",
-			store->vru2_forward);
-		fprintf(stderr,"dbg5       vru2_vert:    %d\n",
-			store->vru2_vert);
-		fprintf(stderr,"dbg5       pitch_bias:    %d\n",
-			store->pitch_bias);
-		fprintf(stderr,"dbg5       roll_bias:    %d\n",
-			store->roll_bias);
-		fprintf(stderr,"dbg5       vru:          %c%c%c%c%c%c%c%c\n",
-			store->vru[0],store->vru[1],store->vru[2],store->vru[3],
-			store->vru[4],store->vru[5],store->vru[6],store->vru[7]);
-		}
-
-	/* print debug statements */
-	if (status == MB_SUCCESS && verbose >= 5
-		&& store->kind == MB_DATA_DATA)
-		{
-		fprintf(stderr,"\ndbg5  Data record to be written by MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5  Data values:\n");
-		fprintf(stderr,"dbg5       sidescan_type:%c\n",
-			store->ss_type);
-		if (store->ss_type == 'G')
-			{
-			for (i=0;i<store->pixels_ss;i++)
-				fprintf(stderr,"dbg5       pixel: %d  ss: %d\n",
-					i,store->ss[i]);
-			}
-		else if (store->ss_type == 'R')
-			{
-			for (i=1;i<=store->pixels_ss;i++)
-				{
-				short_ptr = (unsigned short *) &store->ss[i*2];
-				fprintf(stderr,"dbg5       pixel: %d  ss: %d\n",
-					i,*short_ptr);
-				}
-			}
-		}
-
-	/* print debug statements */
-	if (status == MB_SUCCESS && verbose >= 5
-		&& store->kind == MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"\ndbg5  Comment record to be written by MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5  Comment:\n");
-		fprintf(stderr,"dbg5       comment:   %s\n",
-			store->comment);
-		}
-
-	/* put header values */
-	if (status == MB_SUCCESS)
-		{
-		/* put header values */
-		mb_put_binary_short(MB_NO, store->year, &buffer[0]);
-		mb_put_binary_short(MB_NO, store->day, &buffer[2]);
-		mb_put_binary_short(MB_NO, store->min, &buffer[4]);
-		mb_put_binary_short(MB_NO, store->sec, &buffer[6]);
-		mb_put_binary_int(MB_NO, store->lat, &buffer[8]);
-		mb_put_binary_int(MB_NO, store->lon, &buffer[12]);
-		mb_put_binary_short(MB_NO, store->heading, &buffer[16]);
-		mb_put_binary_short(MB_NO, store->course, &buffer[18]);
-		mb_put_binary_short(MB_NO, store->speed, &buffer[20]);
-		mb_put_binary_short(MB_NO, store->speed_ps, &buffer[22]);
-		mb_put_binary_short(MB_NO, store->quality, &buffer[24]);
-		mb_put_binary_short(MB_NO, store->sensor_size, &buffer[26]);
-		mb_put_binary_short(MB_NO, store->data_size, &buffer[28]);
-		buffer[30] = store->speed_ref[0];
-		buffer[31] = store->speed_ref[1];
-		buffer[32] = store->sensor_type[0];
-		buffer[33] = store->sensor_type[1];
-		buffer[34] = store->data_type[0];
-		buffer[35] = store->data_type[1];
-
-		/* write header record to file */
-		if ((status = fwrite(buffer,1,MBSYS_SB2000_HEADER_SIZE,
-			mb_io_ptr->mbfp)) == MBSYS_SB2000_HEADER_SIZE)
-			{
-			status = MB_SUCCESS;
-			*error = MB_ERROR_NO_ERROR;
-			}
-		else
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_WRITE_FAIL;
-			}
-		}
-
-	/* put sensor data */
-	if (status == MB_SUCCESS
-		&& store->kind == MB_DATA_DATA
-		&& store->sensor_size > 0)
-		{
-		/* put sensor values */
-		mb_put_binary_int(MB_NO, store->ping_number, &buffer[0]);
-		mb_put_binary_short(MB_NO, store->ping_length, &buffer[4]);
-		mb_put_binary_short(MB_NO, store->pixel_size, &buffer[6]);
-		mb_put_binary_short(MB_NO, store->ss_min, &buffer[8]);
-		mb_put_binary_short(MB_NO, store->ss_max, &buffer[10]);
-		mb_put_binary_short(MB_NO, store->sample_rate, &buffer[12]);
-		mb_put_binary_short(MB_NO, store->start_time, &buffer[14]);
-		mb_put_binary_short(MB_NO, store->tot_slice, &buffer[16]);
-		mb_put_binary_short(MB_NO, store->pixels_ss, &buffer[18]);
-		for (i=0;i<store->sensor_size - 20;i++)
-			buffer[18+i] = store->spare_ss[i];
-
-		/* write sensor record to file */
-		if ((status = fwrite(buffer,1,store->sensor_size,
-			mb_io_ptr->mbfp)) == store->sensor_size)
-			{
-			status = MB_SUCCESS;
-			*error = MB_ERROR_NO_ERROR;
-			}
-		else
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_WRITE_FAIL;
-			}
-		}
-
-	if (status == MB_SUCCESS
-		&& store->kind == MB_DATA_VELOCITY_PROFILE
-		&& store->data_size > 0)
-		{
-		/* extract the values */
-		mb_put_binary_int(MB_NO, store->svp_mean, &buffer[0]);
-		mb_put_binary_short(MB_NO, store->svp_number, &buffer[4]);
-		mb_put_binary_short(MB_NO, store->svp_spare, &buffer[6]);
-		for (i=0;i<MIN(store->svp_number, 30);i++)
-			{
-			mb_put_binary_short(MB_NO, store->svp_depth[i], &buffer[8+i*4]);
-			mb_put_binary_short(MB_NO, store->svp_vel[i], &buffer[10+i*4]);
-			}
-		mb_put_binary_short(MB_NO, store->vru1, &buffer[128]);
-		mb_put_binary_short(MB_NO, store->vru1_port, &buffer[130]);
-		mb_put_binary_short(MB_NO, store->vru1_forward, &buffer[132]);
-		mb_put_binary_short(MB_NO, store->vru1_vert, &buffer[134]);
-		mb_put_binary_short(MB_NO, store->vru2, &buffer[136]);
-		mb_put_binary_short(MB_NO, store->vru2_port, &buffer[138]);
-		mb_put_binary_short(MB_NO, store->vru2_forward, &buffer[140]);
-		mb_put_binary_short(MB_NO, store->vru2_vert, &buffer[142]);
-
-		/* write svp profile */
-		if ((status = fwrite(buffer,1,store->data_size,
-			mb_io_ptr->mbfp)) == store->data_size)
-			{
-			status = MB_SUCCESS;
-			*error = MB_ERROR_NO_ERROR;
-			}
-		else
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_WRITE_FAIL;
-			}
-		}
-
-	if (status == MB_SUCCESS
-		&& store->kind == MB_DATA_DATA
-		&& store->data_size > 0)
-		{
-		/* put the values */
-
-		/* deal with 1-byte data */
-		if (store->ss_type == 'G')
-		    {
-		    buffer[0] = 'G';
-		    for (i=0;i<store->pixels_ss;i++)
-			{
-			buffer[i+1] = store->ss[i];
-			}
-		    buffer[store->pixels_ss+1] = 'G';
-		    buffer[store->pixels_ss+2] = 'G';
-		    buffer[store->pixels_ss+3] = 'G';
-		    }
-
-		/* deal with 2-byte data */
-		else if (store->ss_type == 'R')
-		    {
-		    buffer[0] = 'R';
-		    buffer[1] = 'R';
-		    buffer[2] = 'R';
-		    buffer[3] = 'R';
-		    for (i=0;i<store->pixels_ss;i++)
-			{
-			mb_get_binary_short(MB_NO, (short *)&(store->ss[2*i]),
-					    (short *)&(buffer[4+2*i]));
-			}
-		    }
-
-		/* write survey data */
-		if ((status = fwrite(buffer,1,store->data_size,
-			mb_io_ptr->mbfp)) == store->data_size)
-			{
-			status = MB_SUCCESS;
-			*error = MB_ERROR_NO_ERROR;
-			}
-		else
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_WRITE_FAIL;
-			}
-		}
-
-	if (status == MB_SUCCESS
-		&& store->kind == MB_DATA_COMMENT
-		&& store->data_size > 0)
-		{
-		/* put the comment */
-		strncpy(buffer, store->comment,
-			MIN(store->data_size, MBSYS_SB2000_COMMENT_LENGTH-1));
-		buffer[MIN(store->data_size,
-			MBSYS_SB2000_COMMENT_LENGTH-1)] = '\0';
-
-		/* write comment */
-		if ((status = fwrite(buffer,1,store->data_size,
-			mb_io_ptr->mbfp)) == store->data_size)
-			{
-			status = MB_SUCCESS;
-			*error = MB_ERROR_NO_ERROR;
-			}
-		else
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_WRITE_FAIL;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mbr_sb2100bi.c b/src/mbio/mbr_sb2100bi.c
deleted file mode 100644
index cddd55c..0000000
--- a/src/mbio/mbr_sb2100bi.c
+++ /dev/null
@@ -1,3015 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbr_sb2100bi.c	12/23/2004
- *	$Id: mbr_sb2100bi.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1997-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbr_sb2100bi.c contains the functions for reading and writing
- * multibeam data in the SB2100B2 format.
- * These functions include:
- *   mbr_alm_sb2100bi	- allocate read/write memory
- *   mbr_dem_sb2100bi	- deallocate read/write memory
- *   mbr_rt_sb2100bi	- read and translate data
- *   mbr_wt_sb2100bi	- translate and write data
- *
- * Author:	D. W. Caress
- * Date:	March 3, 1994
- *              (Original files:
- *                 mbr_sb2100b1.c
- *                 mbf_sb2100b1.h
- *                 mbr_sb2100b2.c
- *                 mbf_sb2100b2.h)
- *
- *
- * Date:	December 23, 2003
- *              (New file:
- *                 mbr_sb2100bi.c)
- *
- * $Log: mbr_sb2100bi.c,v $
- * Revision 5.5  2008/03/01 09:14:03  caress
- * Some housekeeping changes.
- *
- * Revision 5.4  2006/04/19 18:27:55  caress
- * Fixed error.
- *
- * Revision 5.3  2006/01/24 19:11:17  caress
- * Version 5.0.8 beta.
- *
- * Revision 5.2  2005/11/05 00:48:04  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.1  2004/02/26 22:39:37  caress
- * Fixed writing on byteswapping systems.
- *
- * Revision 5.0  2003/12/24 07:00:18  caress
- * Fixed problem with formats 42 and 43. Combined former files mbr_sb2100b1.c and mbr_sb2100b2.c into new file mbr_sb2100bi.c. Files mbf_sb2100b1.h and mbf_sb2100b2.h are no longer part of the archive.
- *
- * Revision 5.8  2003/05/20 18:05:32  caress
- * Added svp_source to data source parameters.
- *
- * Revision 5.7  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.6  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.5  2002/07/20 20:42:40  caress
- * Release 5.0.beta20
- *
- * Revision 5.4  2001/07/27 19:07:16  caress
- * Added data cutting.
- *
- * Revision 5.3  2001/07/20 00:32:54  caress
- * Release 5.0.beta03
- *
- * Revision 5.2  2001/03/22  20:50:02  caress
- * Trying to make version 5.0.beta0
- *
- * Revision 5.1  2001/01/22  07:43:34  caress
- * Version 5.0.beta01
- *
- * Revision 5.0  2000/12/01  22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.5  2000/10/11  01:03:21  caress
- * Convert to ANSI C
- *
- * Revision 4.4  2000/09/30  06:34:20  caress
- * Snapshot for Dale.
- *
- * Revision 4.3  1999/09/14  20:39:11  caress
- * Fixed bugs handling HSMD
- *
- * Revision 4.2  1998/10/05  17:46:15  caress
- * MB-System version 4.6beta
- *
- * Revision 4.1  1997/09/15  19:06:40  caress
- * Real Version 4.5
- *
- * Revision 4.0  1997/04/21  17:01:19  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.0  1997/04/17  15:11:34  caress
- * MB-System 4.5 Beta Release
- *
- * Revision 1.1  1997/04/17  15:07:36  caress
- * Initial revision
- *
- *
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mb_define.h"
-#include "mbsys_sb2100.h"
-
-/* define id's for the different types of raw records */
-#define	MBF_SB2100BI_RECORDS	6
-#define	MBF_SB2100BI_NONE	0
-#define	MBF_SB2100BI_FH		1
-#define	MBF_SB2100BI_TR		2
-#define	MBF_SB2100BI_PR		3
-#define	MBF_SB2100BI_DH		4
-#define	MBF_SB2100BI_BR		5
-#define	MBF_SB2100BI_SR		6
-char *mbf_sb2100bi_labels[] = {
-	"NONE    ", "SB21BIFH", "SB21BITR", "SB21BIPR",
-	"SB21BIDH", "SB21BIBR", "SB21BISR"};
-
-#define MBF_SB2100BI_PR_WRITE_LEN   284
-#define MBF_SB2100BI_DH_WRITE_LEN   80
-#define MBF_SB2100BI_BR_WRITE_LEN   32
-#define MBF_SB2100BI_SR_WRITE_LEN   4
-#define MBF_SB2100BI_LABEL_LEN	    8
-
-/* define end of record label */
-char	mbf_sb2100bi_eor[2] = {'\r', '\n'};
-
-/* essential function prototypes */
-int mbr_register_sb2100b1(int verbose, void *mbio_ptr,
-		int *error);
-int mbr_info_sb2100b1(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_register_sb2100b2(int verbose, void *mbio_ptr,
-		int *error);
-int mbr_info_sb2100b2(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_alm_sb2100bi(int verbose, void *mbio_ptr, int *error);
-int mbr_dem_sb2100bi(int verbose, void *mbio_ptr, int *error);
-int mbr_zero_sb2100bi(int verbose, char *store_ptr, int *error);
-int mbr_rt_sb2100bi(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_wt_sb2100bi(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_sb2100bi_rd_data(int verbose, void *mbio_ptr, char *store_ptr, int *error);
-int mbr_sb2100bi_rd_fh(int verbose, FILE *mbfp, int record_length, int *error);
-int mbr_sb2100bi_rd_pr(int verbose, FILE *mbfp, struct mbsys_sb2100_struct *store, short record_length, int *error);
-int mbr_sb2100bi_rd_tr(int verbose, FILE *mbfp, struct mbsys_sb2100_struct *store, short record_length, int *error);
-int mbr_sb2100bi_rd_dh(int verbose, FILE *mbfp, struct mbsys_sb2100_struct *store, short record_length, int *error);
-int mbr_sb2100bi_rd_br(int verbose, FILE *mbfp, struct mbsys_sb2100_struct *store, short record_length, int *error);
-int mbr_sb2100bi_rd_sr(int verbose, FILE *mbfp, struct mbsys_sb2100_struct *store, short record_length, int *error);
-int mbr_sb2100bi_wr_data(int verbose, void *mbio_ptr, char *store_ptr, int *error);
-int mbr_sb2100bi_wr_fh(int verbose, FILE *mbfp, int *error);
-int mbr_sb2100bi_wr_pr(int verbose, FILE *mbfp, struct mbsys_sb2100_struct *store, int *error);
-int mbr_sb2100bi_wr_tr(int verbose, FILE *mbfp, struct mbsys_sb2100_struct *store, int *error);
-int mbr_sb2100bi_wr_dh(int verbose, FILE *mbfp, struct mbsys_sb2100_struct *store, int *error);
-int mbr_sb2100bi_wr_br(int verbose, FILE *mbfp, struct mbsys_sb2100_struct *store, int *error);
-int mbr_sb2100bi_wr_sr(int verbose, FILE *mbfp, struct mbsys_sb2100_struct *store, int *error);
-
-/* text for ascii file header */
-char	*mbf_sb2100bi_file_header_text_1 =
-{"\
-\nSeaBeam 2100 multibeam sonar binary data format\n\
-MB-System formats 42 and 43\n\
-Format specification 1.2 defined March 20, 1997\n\
-David W. Caress\n\
-SeaBeam Instruments, Inc.\n\
-\n\
-Format specification 1.3 updated December 23, 2003\n\
-David W. Caress\n\
-Monterey Bay Aquarium Research Institute.\n\
-\n\
-Format 42 is a binary data format for storing all \n\
-bathymetry and sidescan data obtained from a SeaBeam\n\
-2100 multibeam sonar. Each file consists of an\n\
-ASCII file header followed by a series of binary data records.\n\
-All binary integer and float values are \"big-endian\" ordered.\n\
-All floating point values (float and double) are in the\n\
-IEEE standard format.\n\
-\n\
-Format 43 is identical to format 42 except that the\n\
-number of sidescan pixels is always set to zero.\n\
-\n\
-The data records are:\n\
-        Sonar Text Record (comments)\n\
-        Sonar Parameter Record (roll bias, pitch bias, SVP)\n\
-        Sonar Data Header\n\
-        Sonar Bathymetry Record\n\
-        Sonar Sidescan Record\n\
-\n\
-All data files will begin with the ascii File Header Record.\n\
-\n\
-All data files created by a sonar should include a Sonar\n\
-Parameter Record before any ping data. Data files originating\n\
-in the original SeaBeam 2100 format may not have a Sonar\n\
-Parameter Record. Sonar Text Records may occur between the \n\
-File Header Record and any other data records.\n\
-\n\
-Each sonar ping produces three data records in the following\n\
-order:\n\
-        Sonar Data Header\n\
-        Sonar Bathymetry Record\n\
-        Sonar Sidescan Record\n\
-The Sonar Bathymetry Record and Sonar Sidescan Record will\n\
-appear even if the numbers of beams and/or pixels are zero.\n\
-The Sonar Bathymetry Record and Sonar Sidescan Record are\n\
-variable in length, depending on the number of bathymetry\n\
-beams and sidescan pixels, respectively.\n\
-\n\
-The structure of this format is designed to maximize i/o\n\
-throughput with MB-System programs. Most numeric parameters,\n\
-except for the sidescan amplitude and alongtrack values,\n\
-are stored as IEEE float or double values. The data records\n\
-are constructed so that the records can be read directly into\n\
-C structures on machines that enforce 4-byte boundaries in\n\
-memory. \n\
-\n\
-The data record definitions follow:\n\
-----------------------------------------------------------------------------\n\
-\n\
-File Header Record (variable length ASCII, at start of each file):\n\
-----------------------------------------------------------------------------\n\
-Item            Units           Valid           # of    Byte    Coding\n\
-                                Range           Bytes   Offset  \n\
-----------------------------------------------------------------------------\n\
-Record ID 1                     SB21            4       0       ASCII\n\
-  >>Note: binary equivalent: 1396847153\n\
-Record ID 2                     BIFH            4       4       ASCII\n\
-  >>Note: binary equivalent: 1112098376\n\
-Record Length   bytes           0 - 999999      6       8       ASCII\n\
-  >>Note: Length of header text plus Record End in bytes Header\n\
-\n\
-Text                                            varies  14      ASCII Record\n\
-\n\
-Record End                      [CR][LF]        2       varies  ASCII\n\
-----------------------------------------------------------------------------\n\
-\n\
-Sonar Text Record (variable length - comments derived from sonar or in processing):\n\
-----------------------------------------------------------------------------\n\
-Item            Units           Valid           # of    Byte    Coding\n\
-                                Range           Bytes   Offset  \n\
-----------------------------------------------------------------------------\n\
-Record ID 1                     1396847153      4       0       unsigned int\n\
-  >>Note: ASCII equivalent: \"SB21\"\n\
-Record ID 2                     1112101970      4       4       unsigned int\n\
-  >>Note: ASCII equivalent: \"BITR\"\n\
-Record Length   bytes           6 - 1926        2       8       int\n\
-  >>Note: Length of the rest of the record in bytes\n\
-\n\
-Comment text                                    varies  10      ASCII\n\
-  >>Note: The comment string is null terminated unless it is 1920 bytes long.\n\
-\n\
-Checksum                                        4       varies  unsigned int\n\
-Record End                      03338           2       varies  unsigned short\n\
-  >>Note: ASCII equivalent: \"[CR][LF]\"\n\
-----------------------------------------------------------------------------\n\
-\n\
-Sonar Parameter Record (300 bytes - roll bias, pitch bias, SVP):\n\
-----------------------------------------------------------------------------\n\
-Item            Units           Valid           # of    Byte    Coding\n\
-                                Range           Bytes   Offset  \n\
-----------------------------------------------------------------------------\n\
-Record ID 1                     1396847153      4       0       unsigned int\n\
-  >>Note: ASCII equivalent: \"SB21\"\n\
-Record ID 2                     1112100946      4       4       unsigned int\n\
-  >>Note: ASCII equivalent: \"BIPR\"\n\
-Record Length   bytes           290             2       8       short\n\
-  >>Note: Length of the rest of the record in bytes\n\
-\n\
-Year                            1994 -          2       10      short\n\
-Day                             1 - 366         2       12      short\n\
-  >>Note: Day of year\n\
-Hour                            0 - 23          2       14      short\n\
-Minute                          0 - 59          2       16      short\n\
-Second                          0 - 59          2       18      short\n\
-Millisecond                     0 - 999         2       20      short\n\
-\n\
-Roll bias port  degree          -5.0 - +5.0     4       22      float\n\
-  >>Note: signed so + is port up\n\
-Roll bias stbd  degree          -5.0 - +5.0     4       26      float\n\
-  >>Note: signed so + is port up\n\
-Pitch bias      degree          -5.0 - +5.0     4       30      float\n\
-  >>Note: signed so + is stern up\n\
-\n\
-Ship's draft    m               0.0 - 10.0      4       34      float\n\
-Nav X offset    m               -50.0 - 50.0    4       38      float\n\
-Nav Y offset    m               -100.0 - 100.0  4       42      float\n\
-Nav Z offset    m               0.0 - 20.0      4       46      float\n\
-\n\
-# of SVP points                 2 - 30          4       50      int\n\
-\n\
-SVP depth[0]    m               0 - 12000.0     4       54      float\n\
-SVP depth[1]    m               0 - 12000.0     4       58      float\n\
-.........\n\
-SVP depth[29]   m               0 - 12000.0     4       170     float\n\
-\n\
-SVP velocity[0] m/s             1300.0 - 1700.0 4       174      float\n\
-SVP velocity[1] m/s             1300.0 - 1700.0 4       178      float\n\
-.........\n\
-SVP velocity[29] m/s            1300.0 - 1700.0 4       290     float\n\
-\n\
-Checksum                                        4       294     unsigned int\n\
-Record End                      03338           2       298     unsigned short\n\
-  >>Note: ASCII equivalent: \"[CR][LF]\"\n\
-----------------------------------------------------------------------------\n\
-\n\
-"};
-
-char	*mbf_sb2100bi_file_header_text_2 =
-{"\
-Sonar Data Header Record (96 bytes - navigation and sonar parameters):\n\
-----------------------------------------------------------------------------\n\
-Item            Units           Valid           # of    Byte    Coding\n\
-                                Range           Bytes   Offset  \n\
-----------------------------------------------------------------------------\n\
-Record ID 1                     1396847153      4       0       unsigned int\n\
-  >>Note: ASCII equivalent: \"SB21\"\n\
-Record ID 2                     1112097864      4       4       unsigned int\n\
-  >>Note: ASCII equivalent: \"BIDH\"\n\
-Record Length    bytes          86              2       8       short\n\
-  >>Note: Length of the rest of the record in bytes\n\
-\n\
-Year                            1994 -          2       10      short\n\
-Day                             1 - 366         2       12      short\n\
-  >>Note: Day of year\n\
-Hour                            0 - 23          2       14      short\n\
-Minute                          0 - 59          2       16      short\n\
-Second                          0 - 59          2       18      short\n\
-Millisecond                     0 - 999         2       20      short\n\
-\n\
-Spare                           0               2       22      short\n\
-Spare                           0               2       24      short\n\
-Longitude       degree E of 0E  0.0 - 359.99999 8       26      double\n\
-Latitude        degree N of 0N  -90.0 - +90.0   8       34      double\n\
-\n\
-Heading at ping degree          0.0 - 359.999   4       42      float\n\
-Speed           knot            0.0 - 100.0     4       46      float\n\
-Roll at ping    degree          -45.0 - +45.0   4       50      float\n\
-  >>Note: + = port up\n\
-Pitch at ping   degree          -10.0 - +10.0   4       54      float\n\
-  >>Note: + = stern up\n\
-Heave at ping   m               -10.0 - +10.0   4       58      float\n\
-  >>Note: + = above mean level\n\
-Surface sound   m/s             1435.0 - 1565.0 4       62      float\n\
-  velocity\n\
-\n\
-Frequency       kHz             L, H            1       66      char\n\
-  >>Note: L = 12 kHz, H = 36 kHz\n\
-Depth gate mode                 A, M            1       67      char\n\
-  >>Note: A = auto, M = manual\n\
-Ping gain       dB              0 - 45          1       68      unsigned char\n\
-Ping pulse      0.001 s         1 - 20          1       69      unsigned char\n\
-  width\n\
-Transmitter     dB              0 - 18          1       70      unsigned char\n\
-  attenuation\n\
-SSV source                      V, M, T, E, U   1       71      char\n\
-  >>Note: V = velocimeter, M = manual, T = temperature, \n\
-          E = external, U = unknown\n\
-SVP correction                  0, T            1       72      char\n\
-  >>Note: 0 = None, T = true depth and true position\n\
-\n\
-Pixel intensity                 D, L            1       73      char\n\
-  algorithm\n\
-  >>Note: D = logarithm, L = linear; should always be linear for new data\n\
-Pixel size      m               0.125 - 20.0    4       74      float\n\
-\n\
-Number of beams                 0 - 151         2       78      short\n\
-Number of pixels                0 - 2000        2       80      short\n\
-\n\
-Spare                           0               2       82      short\n\
-Spare                           0               2       84      short\n\
-Spare                           0               2       86      short\n\
-Spare                           0               2       88      short\n\
-\n\
-Checksum                                        4       90      unsigned int\n\
-Record End                      03338           2       94      unsigned short\n\
-  >>Note: ASCII equivalent: \"[CR][LF]\"\n\
-----------------------------------------------------------------------------\n\
-\n\
-Sonar Data Bathymetry Record (variable length - (16 + nbeams * 32) bytes \n\
-                              - bathymetry and amplitude):\n\
-----------------------------------------------------------------------------\n\
-Item            Units           Valid           # of    Byte    Coding\n\
-                                Range           Bytes   Offset  \n\
-----------------------------------------------------------------------------\n\
-Record ID 1                     1396847153      4       0       unsigned int\n\
-  >>Note: ASCII equivalent: \"SB21\"\n\
-Record ID 2                     1112097362      4       4       unsigned int\n\
-  >>Note: ASCII equivalent: \"BIBR\"\n\
-Record Length   bytes           6 - 4838        2       8       short\n\
-  >>Note: Length of the rest of the record in bytes\n\
-\n\
-  >>Note: This record contains \"number of beams\" instances \n\
-          of the following structure, where the \"number of beams\" \n\
-          value is found near the end of the preceding \n\
-          SB21BIDH header record\n\
-Depth           m                               4       10      float\n\
-Acrosstrack     m                               4       14      float\n\
-  >>Note: + is starboard\n\
-Alongtrack      m                               4       18      float\n\
-  >>Note: + is forward\n\
-Range           sec                             4       22      float\n\
-  >>Note: raw round trip echo time\n\
-Angle from      degree          -100.0 - +100.0 4       26      float\n\
-  vertical\n\
-  >>Note: see SeaBeam documentation figure for meaning of signs\n\
-Angle forward   degree          -100.0 - +100.0 4       30      float\n\
-  >>Note: see SeaBeam documentation figure for meaning of signs\n\
-Beam amplitude  0.25 dB         0 - 400         2       34      short\n\
-Signal to noise dB              0 - 99          2       36      short\n\
-Echo length     sample interval 0 - 999         2       38      short\n\
-Signal quality                  0, Q, F, G      1       40      char\n\
-  >>Note: 0 = no data, Q = sonar flagged, \n\
-          F = processing flagged, G = good data\n\
-Beam algorithm                  W, B            1       41      char\n\
-  >>Note: W = weighted mean time, B = BDI\n\
-\n\
-  >>Note: The usual checksum and record end tag are placed after\n\
-          the last instance of the per-beam data\n\
-Checksum                                        4       varies  unsigned int\n\
-Record End                      03338           2       varies  unsigned short\n\
-  >>Note: ASCII equivalent: \"[CR][LF]\"\n\
-----------------------------------------------------------------------------\n\
-\n\
-Sonar Data Sidescan Record (variable length - (16 + 4 * npixels) bytes \n\
-                            - 2000 pixels : 8016 bytes\n\
-                            - sidescan):\n\
-----------------------------------------------------------------------------\n\
-Item            Units           Valid           # of    Byte    Coding\n\
-                                Range           Bytes   Offset  \n\
-----------------------------------------------------------------------------\n\
-Record ID 1                     1396847153      4       0       unsigned int\n\
-  >>Note: ASCII equivalent: \"SB21\"\n\
-Record ID 2                     1112101714      4       4       unsigned int\n\
-  >>Note: ASCII equivalent: \"BISR\"\n\
-Record Length   bytes           6 - 16006       2       8       short\n\
-  >>Note: Length of the rest of the record in bytes\n\
-\n\
-  >>Note: This record contains \"number of pixels\" instances \n\
-          of the following structure, where the \"number of pixels\" \n\
-          value is found near the end of the preceding \n\
-          SB21BIDH header record\n\
-  >>Note: The \"number of pixels\" is always 0 for format 43.\n\
-\n\
-Amplitude                       0 - 65535       2       10      unsigned short\n\
-Alongtrack      0.1 m           -32767 - 32767  2       12      short\n\
-  >>Note: + is forward\n\
-\n\
-  >>Note: The usual checksum and record end tag are placed after\n\
-          the last instance of the per-pixel data\n\
-Checksum                                        4       varies  unsigned int\n\
-Record End                      03338           2       varies  unsigned short\n\
-  >>Note: ASCII equivalent: \"[CR][LF]\"\n\
-----------------------------------------------------------------------------\n\
-\n\r\n\
-"};
-
-/* read & write buffer */
-char	buffer[4*MBSYS_SB2100_PIXELS];
-
-static char rcs_id[]="$Id: mbr_sb2100bi.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mbr_register_sb2100b1(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_register_sb2100b1";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* get mb_io_ptr */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set format info parameters */
-	status = mbr_info_sb2100b1(verbose,
-			&mb_io_ptr->system,
-			&mb_io_ptr->beams_bath_max,
-			&mb_io_ptr->beams_amp_max,
-			&mb_io_ptr->pixels_ss_max,
-			mb_io_ptr->format_name,
-			mb_io_ptr->system_name,
-			mb_io_ptr->format_description,
-			&mb_io_ptr->numfile,
-			&mb_io_ptr->filetype,
-			&mb_io_ptr->variable_beams,
-			&mb_io_ptr->traveltime,
-			&mb_io_ptr->beam_flagging,
-			&mb_io_ptr->nav_source,
-			&mb_io_ptr->heading_source,
-			&mb_io_ptr->vru_source,
-			&mb_io_ptr->svp_source,
-			&mb_io_ptr->beamwidth_xtrack,
-			&mb_io_ptr->beamwidth_ltrack,
-			error);
-
-	/* set format and system specific function pointers */
-	mb_io_ptr->mb_io_format_alloc = &mbr_alm_sb2100bi;
-	mb_io_ptr->mb_io_format_free = &mbr_dem_sb2100bi;
-	mb_io_ptr->mb_io_store_alloc = &mbsys_sb2100_alloc;
-	mb_io_ptr->mb_io_store_free = &mbsys_sb2100_deall;
-	mb_io_ptr->mb_io_read_ping = &mbr_rt_sb2100bi;
-	mb_io_ptr->mb_io_write_ping = &mbr_wt_sb2100bi;
-	mb_io_ptr->mb_io_dimensions = &mbsys_sb2100_dimensions;
-	mb_io_ptr->mb_io_extract = &mbsys_sb2100_extract;
-	mb_io_ptr->mb_io_insert = &mbsys_sb2100_insert;
-	mb_io_ptr->mb_io_extract_nav = &mbsys_sb2100_extract_nav;
-	mb_io_ptr->mb_io_insert_nav = &mbsys_sb2100_insert_nav;
-	mb_io_ptr->mb_io_extract_altitude = &mbsys_sb2100_extract_altitude;
-	mb_io_ptr->mb_io_insert_altitude = NULL;
-	mb_io_ptr->mb_io_extract_svp = &mbsys_sb2100_extract_svp;
-	mb_io_ptr->mb_io_insert_svp = &mbsys_sb2100_insert_svp;
-	mb_io_ptr->mb_io_ttimes = &mbsys_sb2100_ttimes;
-	mb_io_ptr->mb_io_detects = &mbsys_sb2100_detects;
-	mb_io_ptr->mb_io_copyrecord = &mbsys_sb2100_copy;
-	mb_io_ptr->mb_io_extract_rawss = NULL;
-	mb_io_ptr->mb_io_insert_rawss = NULL;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",mb_io_ptr->system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",mb_io_ptr->beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",mb_io_ptr->beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",mb_io_ptr->pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",mb_io_ptr->format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",mb_io_ptr->system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",mb_io_ptr->format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",mb_io_ptr->numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",mb_io_ptr->filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",mb_io_ptr->variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",mb_io_ptr->traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",mb_io_ptr->beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",mb_io_ptr->nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",mb_io_ptr->heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",mb_io_ptr->vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",mb_io_ptr->svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",mb_io_ptr->beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",mb_io_ptr->beamwidth_ltrack);
-		fprintf(stderr,"dbg2       format_alloc:       %p\n",(void *)mb_io_ptr->mb_io_format_alloc);
-		fprintf(stderr,"dbg2       format_free:        %p\n",(void *)mb_io_ptr->mb_io_format_free);
-		fprintf(stderr,"dbg2       store_alloc:        %p\n",(void *)mb_io_ptr->mb_io_store_alloc);
-		fprintf(stderr,"dbg2       store_free:         %p\n",(void *)mb_io_ptr->mb_io_store_free);
-		fprintf(stderr,"dbg2       read_ping:          %p\n",(void *)mb_io_ptr->mb_io_read_ping);
-		fprintf(stderr,"dbg2       write_ping:         %p\n",(void *)mb_io_ptr->mb_io_write_ping);
-		fprintf(stderr,"dbg2       extract:            %p\n",(void *)mb_io_ptr->mb_io_extract);
-		fprintf(stderr,"dbg2       insert:             %p\n",(void *)mb_io_ptr->mb_io_insert);
-		fprintf(stderr,"dbg2       extract_nav:        %p\n",(void *)mb_io_ptr->mb_io_extract_nav);
-		fprintf(stderr,"dbg2       insert_nav:         %p\n",(void *)mb_io_ptr->mb_io_insert_nav);
-		fprintf(stderr,"dbg2       extract_altitude:   %p\n",(void *)mb_io_ptr->mb_io_extract_altitude);
-		fprintf(stderr,"dbg2       insert_altitude:    %p\n",(void *)mb_io_ptr->mb_io_insert_altitude);
-		fprintf(stderr,"dbg2       extract_svp:        %p\n",(void *)mb_io_ptr->mb_io_extract_svp);
-		fprintf(stderr,"dbg2       insert_svp:         %p\n",(void *)mb_io_ptr->mb_io_insert_svp);
-		fprintf(stderr,"dbg2       ttimes:             %p\n",(void *)mb_io_ptr->mb_io_ttimes);
-		fprintf(stderr,"dbg2       detects:            %p\n",(void *)mb_io_ptr->mb_io_detects);
-		fprintf(stderr,"dbg2       extract_rawss:      %p\n",(void *)mb_io_ptr->mb_io_extract_rawss);
-		fprintf(stderr,"dbg2       insert_rawss:       %p\n",(void *)mb_io_ptr->mb_io_insert_rawss);
-		fprintf(stderr,"dbg2       copyrecord:         %p\n",(void *)mb_io_ptr->mb_io_copyrecord);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbr_info_sb2100b1(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error)
-{
-	char	*function_name = "mbr_info_sb2100b1";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* set format info parameters */
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-	*system = MB_SYS_SB2100;
-	*beams_bath_max = 151;
-	*beams_amp_max = 151;
-	*pixels_ss_max = 2000;
-	strncpy(format_name, "SB2100B1", MB_NAME_LENGTH);
-	strncpy(system_name, "SB2100", MB_NAME_LENGTH);
-	strncpy(format_description, "Format name:          MBF_SB2100B1\nInformal Description: SeaBeam 2100 series vender format\nAttributes:           SeaBeam 2100, bathymetry, amplitude \n                      and sidescan, 151 beams bathymetry,\n                      2000 pixels sidescan, binary,\n                      SeaBeam Instruments and L-DEO.\n", MB_DESCRIPTION_LENGTH);
-	*numfile = 1;
-	*filetype = MB_FILETYPE_NORMAL;
-	*variable_beams = MB_YES;
-	*traveltime = MB_YES;
-	*beam_flagging = MB_YES;
-	*nav_source = MB_DATA_DATA;
-	*heading_source = MB_DATA_DATA;
-	*vru_source = MB_DATA_DATA;
-	*svp_source = MB_DATA_VELOCITY_PROFILE;
-	*beamwidth_xtrack = 2.0;
-	*beamwidth_ltrack = 2.0;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",*system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",*beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",*beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",*pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",*numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",*filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",*variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",*traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",*beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",*nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",*heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",*vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",*svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",*beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",*beamwidth_ltrack);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_register_sb2100b2(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_register_sb2100b2";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* get mb_io_ptr */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set format info parameters */
-	status = mbr_info_sb2100b2(verbose,
-			&mb_io_ptr->system,
-			&mb_io_ptr->beams_bath_max,
-			&mb_io_ptr->beams_amp_max,
-			&mb_io_ptr->pixels_ss_max,
-			mb_io_ptr->format_name,
-			mb_io_ptr->system_name,
-			mb_io_ptr->format_description,
-			&mb_io_ptr->numfile,
-			&mb_io_ptr->filetype,
-			&mb_io_ptr->variable_beams,
-			&mb_io_ptr->traveltime,
-			&mb_io_ptr->beam_flagging,
-			&mb_io_ptr->nav_source,
-			&mb_io_ptr->heading_source,
-			&mb_io_ptr->vru_source,
-			&mb_io_ptr->svp_source,
-			&mb_io_ptr->beamwidth_xtrack,
-			&mb_io_ptr->beamwidth_ltrack,
-			error);
-
-	/* set format and system specific function pointers */
-	mb_io_ptr->mb_io_format_alloc = &mbr_alm_sb2100bi;
-	mb_io_ptr->mb_io_format_free = &mbr_dem_sb2100bi;
-	mb_io_ptr->mb_io_store_alloc = &mbsys_sb2100_alloc;
-	mb_io_ptr->mb_io_store_free = &mbsys_sb2100_deall;
-	mb_io_ptr->mb_io_read_ping = &mbr_rt_sb2100bi;
-	mb_io_ptr->mb_io_write_ping = &mbr_wt_sb2100bi;
-	mb_io_ptr->mb_io_dimensions = &mbsys_sb2100_dimensions;
-	mb_io_ptr->mb_io_extract = &mbsys_sb2100_extract;
-	mb_io_ptr->mb_io_insert = &mbsys_sb2100_insert;
-	mb_io_ptr->mb_io_extract_nav = &mbsys_sb2100_extract_nav;
-	mb_io_ptr->mb_io_insert_nav = &mbsys_sb2100_insert_nav;
-	mb_io_ptr->mb_io_extract_altitude = &mbsys_sb2100_extract_altitude;
-	mb_io_ptr->mb_io_insert_altitude = NULL;
-	mb_io_ptr->mb_io_extract_svp = &mbsys_sb2100_extract_svp;
-	mb_io_ptr->mb_io_insert_svp = &mbsys_sb2100_insert_svp;
-	mb_io_ptr->mb_io_ttimes = &mbsys_sb2100_ttimes;
-	mb_io_ptr->mb_io_detects = &mbsys_sb2100_detects;
-	mb_io_ptr->mb_io_gains = &mbsys_sb2100_gains;
-	mb_io_ptr->mb_io_copyrecord = &mbsys_sb2100_copy;
-	mb_io_ptr->mb_io_extract_rawss = NULL;
-	mb_io_ptr->mb_io_insert_rawss = NULL;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",mb_io_ptr->system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",mb_io_ptr->beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",mb_io_ptr->beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",mb_io_ptr->pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",mb_io_ptr->format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",mb_io_ptr->system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",mb_io_ptr->format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",mb_io_ptr->numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",mb_io_ptr->filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",mb_io_ptr->variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",mb_io_ptr->traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",mb_io_ptr->beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",mb_io_ptr->nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",mb_io_ptr->heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",mb_io_ptr->vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",mb_io_ptr->svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",mb_io_ptr->beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",mb_io_ptr->beamwidth_ltrack);
-		fprintf(stderr,"dbg2       format_alloc:       %p\n",(void *)mb_io_ptr->mb_io_format_alloc);
-		fprintf(stderr,"dbg2       format_free:        %p\n",(void *)mb_io_ptr->mb_io_format_free);
-		fprintf(stderr,"dbg2       store_alloc:        %p\n",(void *)mb_io_ptr->mb_io_store_alloc);
-		fprintf(stderr,"dbg2       store_free:         %p\n",(void *)mb_io_ptr->mb_io_store_free);
-		fprintf(stderr,"dbg2       read_ping:          %p\n",(void *)mb_io_ptr->mb_io_read_ping);
-		fprintf(stderr,"dbg2       write_ping:         %p\n",(void *)mb_io_ptr->mb_io_write_ping);
-		fprintf(stderr,"dbg2       extract:            %p\n",(void *)mb_io_ptr->mb_io_extract);
-		fprintf(stderr,"dbg2       insert:             %p\n",(void *)mb_io_ptr->mb_io_insert);
-		fprintf(stderr,"dbg2       extract_nav:        %p\n",(void *)mb_io_ptr->mb_io_extract_nav);
-		fprintf(stderr,"dbg2       insert_nav:         %p\n",(void *)mb_io_ptr->mb_io_insert_nav);
-		fprintf(stderr,"dbg2       extract_altitude:   %p\n",(void *)mb_io_ptr->mb_io_extract_altitude);
-		fprintf(stderr,"dbg2       insert_altitude:    %p\n",(void *)mb_io_ptr->mb_io_insert_altitude);
-		fprintf(stderr,"dbg2       extract_svp:        %p\n",(void *)mb_io_ptr->mb_io_extract_svp);
-		fprintf(stderr,"dbg2       insert_svp:         %p\n",(void *)mb_io_ptr->mb_io_insert_svp);
-		fprintf(stderr,"dbg2       ttimes:             %p\n",(void *)mb_io_ptr->mb_io_ttimes);
-		fprintf(stderr,"dbg2       detects:            %p\n",(void *)mb_io_ptr->mb_io_detects);
-		fprintf(stderr,"dbg2       extract_rawss:      %p\n",(void *)mb_io_ptr->mb_io_extract_rawss);
-		fprintf(stderr,"dbg2       insert_rawss:       %p\n",(void *)mb_io_ptr->mb_io_insert_rawss);
-		fprintf(stderr,"dbg2       copyrecord:         %p\n",(void *)mb_io_ptr->mb_io_copyrecord);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbr_info_sb2100b2(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error)
-{
-	char	*function_name = "mbr_info_sb2100b2";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* set format info parameters */
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-	*system = MB_SYS_SB2100;
-	*beams_bath_max = 151;
-	*beams_amp_max = 151;
-	*pixels_ss_max = 0;
-	strncpy(format_name, "SB2100B2", MB_NAME_LENGTH);
-	strncpy(system_name, "SB2100", MB_NAME_LENGTH);
-	strncpy(format_description, "Format name:          MBF_SB2100B2\nInformal Description: SeaBeam 2100 series vender format\nAttributes:           SeaBeam 2100, bathymetry and amplitude,  \n                      151 beams bathymetry,\n                      binary,\n                      SeaBeam Instruments and L-DEO.\n", MB_DESCRIPTION_LENGTH);
-	*numfile = 1;
-	*filetype = MB_FILETYPE_NORMAL;
-	*variable_beams = MB_YES;
-	*traveltime = MB_YES;
-	*beam_flagging = MB_YES;
-	*nav_source = MB_DATA_DATA;
-	*heading_source = MB_DATA_DATA;
-	*vru_source = MB_DATA_DATA;
-	*svp_source = MB_DATA_VELOCITY_PROFILE;
-	*beamwidth_xtrack = 2.0;
-	*beamwidth_ltrack = 2.0;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",*system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",*beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",*beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",*pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",*numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",*filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",*variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",*traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",*beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",*nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",*heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",*vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",*svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",*beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",*beamwidth_ltrack);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbr_alm_sb2100bi(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_alm_sb2100bi";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_sb2100_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set initial status */
-	status = MB_SUCCESS;
-
-	/* allocate memory for data structure */
-	mb_io_ptr->structure_size = sizeof(struct mbsys_sb2100_struct);
-	mb_io_ptr->data_structure_size = 0;
-	status = mb_malloc(verbose,sizeof(struct mbsys_sb2100_struct),
-				&mb_io_ptr->store_data,error);
-
-	/* get store structure pointer */
-	store = (struct mbsys_sb2100_struct *) mb_io_ptr->store_data;
-
-	/* set comment pointer */
-	store->comment = (char *) &(store->roll_bias_port);
-
-	/* initialize everything to zeros */
-	mbr_zero_sb2100bi(verbose,mb_io_ptr->raw_data,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_dem_sb2100bi(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_dem_sb2100bi";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* deallocate memory for data descriptor */
-	status = mb_free(verbose,&mb_io_ptr->store_data,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_zero_sb2100bi(int verbose, char *store_ptr, int *error)
-{
-	char	*function_name = "mbr_zero_sb2100bi";
-	int	status = MB_SUCCESS;
-	struct mbsys_sb2100_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       store_ptr: %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to data descriptor */
-	store = (struct mbsys_sb2100_struct *) store_ptr;
-
-	/* initialize everything to zeros */
-	if (store != NULL)
-		{
-		/* type of data record */
-		store->kind = MB_DATA_NONE;
-
-		/* set comment pointer */
-		store->comment = (char *) &store->roll_bias_port;
-
-		/* sonar parameters (SB21BIPR) */
-		store->roll_bias_port = 0.0;		/* deg */
-		store->roll_bias_starboard = 0.0;	/* deg */
-		store->pitch_bias = 0.0;			/* deg */
-		store->ship_draft = 0.0;			/* m */
-		store->offset_x = 0.0;			/* m */
-		store->offset_y = 0.0;			/* m */
-		store->offset_z = 0.0;			/* m */
-		store->num_svp = 0;
-		for (i=0;i<MBSYS_SB2100_MAXVEL;i++)
-		    {
-		    store->svp[i].depth = 0.0;
-		    store->svp[i].velocity = 0.0;
-		    }
-
-		/* sonar data header (SB21BIDH) */
-		store->year = 0;
-		store->jday = 0;
-		store->hour = 0;
-		store->minute = 0;
-		store->sec = 0;
-		store->msec = 0;
-		store->spare1 = 0;
-		store->spare2 = 0;
-		store->longitude = 0.0;			/* degrees */
-		store->latitude = 0.0;			/* degrees */
-		store->heading = 0.0;			/* degrees */
-		store->speed = 0.0;			/* m/sec */
-		store->roll = 0.0;			/* degrees */
-		store->pitch = 0.0;			/* degrees */
-		store->heave = 0.0;			/* m */
-		store->ssv = 0.0;			/* m/sec */
-		store->frequency = 'L';			/* L=12kHz; H=36kHz; 2=20kHz */
-		store->depth_gate_mode = 'A';		/* A=Auto, M=Manual */
-		store->ping_gain = 0;			/* dB */
-		store->ping_pulse_width = 0;		/* msec */
-		store->transmitter_attenuation = 0;	/* dB */
-		store->ssv_source = 'M';			/* V=Velocimeter, M=Manual,
-							    T=Temperature */
-		store->svp_correction = 'T';		/* 0=None; A=True Xtrack
-							    and Apparent Depth;
-							    T=True Xtrack and True Depth */
-		store->pixel_algorithm = 'L';		/* pixel intensity algorithm
-							    D = logarithm, L = linear */
-		store->pixel_size = 0.0;			/* m */
-		store->nbeams = 0;			/* up to 151 */
-		store->npixels = 0;			/* up to 2000 */
-		store->spare3 = 0;
-		store->spare4 = 0;
-		store->spare5 = 0;
-		store->spare6 = 0;
-
-		/* bathymetry record (SB21BIBR) */
-		for (i=0;i<MBSYS_SB2100_BEAMS;i++)
-			{
-			store->beams[i].depth = 0.0;		/* m */
-			store->beams[i].acrosstrack = 0.0;	/* m */
-			store->beams[i].alongtrack = 0.0;	/* m */
-			store->beams[i].range = 0.0;		/* seconds */
-			store->beams[i].angle_across = 0.0;	/* degrees */
-			store->beams[i].angle_forward = 0.0;	/* degrees */
-			store->beams[i].amplitude = 0;	/* 0.25 dB */
-			store->beams[i].signal_to_noise = 0;	/* dB */
-			store->beams[i].echo_length = 0;		/* samples */
-			store->beams[i].quality = '0';		/* 0=no data,
-							    Q=poor quality,
-							    blank otherwise */
-			store->beams[i].source = 'W';		/* B=BDI, W=WMT */
-			}
-
-		/* sidescan record (SB21BISR) */
-		for (i=0;i<MBSYS_SB2100_PIXELS;i++)
-			{
-			store->pixels[i].amplitude = 0;
-			store->pixels[i].alongtrack = 0;		/* 0.1 m */
-			}
-
-		}
-
-	/* assume success */
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_rt_sb2100bi(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_rt_sb2100bi";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_sb2100_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointers to mbio descriptor and data structures */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-	store = (struct mbsys_sb2100_struct *) store_ptr;
-
-	/* read next data from file */
-	status = mbr_sb2100bi_rd_data(verbose,mbio_ptr,store_ptr,error);
-
-	/* set error and kind in mb_io_ptr */
-	mb_io_ptr->new_error = *error;
-	mb_io_ptr->new_kind = store->kind;
-
-	/* zero sidescan for format MBF_SB2100B2 (43) */
-	if (status == MB_SUCCESS
-		&& store != NULL
-		&& store->kind != MB_DATA_COMMENT
-		&& mb_io_ptr->format == MBF_SB2100B2)
-		store->npixels = 0;
-
-	/* set unset parameters in sb2100 data storage structure */
-	if (status == MB_SUCCESS
-		&& store != NULL
-		&& store->kind != MB_DATA_COMMENT)
-		{
-		/* parameters for MBF_SB2100RW format */
-		store->range_scale = ' ';
-		store->spare_dr[0] = ' ';
-		store->spare_dr[1] = ' ';
-		store->num_algorithms = 1;
-		for (i=0;i<4;i++)
-		    store->algorithm_order[i] = ' ';
-		store->svp_corr_ss = 0;
-		store->ss_data_length = 4 * MBSYS_SB2100_PIXELS;
-		store->pixel_size_scale = 'D';
-		store->spare_ss = ' ';
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_wt_sb2100bi(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_wt_sb2100bi";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_sb2100_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_sb2100_struct *) store_ptr;
-
-	/* make sure no sidescan is written for format MBF_SB2100B2 (43) */
-	if (status == MB_SUCCESS
-		&& store != NULL
-		&& store->kind != MB_DATA_COMMENT
-		&& mb_io_ptr->format == MBF_SB2100B2)
-		store->npixels = 0;
-
-	/* write next data to file */
-	status = mbr_sb2100bi_wr_data(verbose,mbio_ptr,store_ptr,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_sb2100bi_rd_data(int verbose, void *mbio_ptr, char *store_ptr, int *error)
-{
-	char	*function_name = "mbr_sb2100bi_rd_data";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_sb2100_struct *store;
-	FILE	*mbfp;
-	int	done;
-	char	*label;
-	int	*label_save_flag;
-	int	type;
-	int	expect;
-	short	record_length;
-	char	*record_length_ptr;
-	char	record_length_fh_str[8];
-	int	record_length_fh;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_sb2100_struct *) store_ptr;
-	mbfp = mb_io_ptr->mbfp;
-
-	/* get saved values */
-	label = (char *) mb_io_ptr->save_label;
-	label_save_flag = (int *) &mb_io_ptr->save_label_flag;
-	record_length_ptr = (char *) &record_length;
-
-	/* initialize everything to zeros */
-	mbr_zero_sb2100bi(verbose,store_ptr,error);
-
-	done = MB_NO;
-	expect = MBF_SB2100BI_NONE;
-	while (done == MB_NO)
-		{
-		/* if no label saved get next record label */
-		status = MB_SUCCESS;
-		*error = MB_ERROR_NO_ERROR;
-		if (*label_save_flag == MB_NO)
-			{
-			/* get next 10 bytes */
-			if ((status = fread(&label[0],
-				10,
-				1, mbfp)) != 1)
-				{
-				status = MB_FAILURE;
-				*error = MB_ERROR_EOF;
-				}
-
-			/* if not a format 42 label read individual
-			    bytes until label found or eof */
-			while (status == MB_SUCCESS
-			    && strncmp(label, "SB21BI", 6) != 0)
-			    {
-			    for (i=0;i<9;i++)
-				label[i] = label[i+1];
-			    if ((status = fread(&label[9],
-				    1, 1, mbfp)) != 1)
-				{
-				status = MB_FAILURE;
-				*error = MB_ERROR_EOF;
-				}
-			    }
-			}
-
-		/* else use saved label */
-		else
-			*label_save_flag = MB_NO;
-
-		/* get the label type */
-		if (status == MB_SUCCESS)
-			{
-			/* get type */
-			type = MBF_SB2100BI_NONE;
-			for (i=1;i<=MBF_SB2100BI_RECORDS;i++)
-				if (strncmp(label, mbf_sb2100bi_labels[i], 8) == 0)
-				    type = i;
-
-			/* get the record length */
-			if (type != MBF_SB2100BI_FH)
-			    {
-			    mb_get_binary_short(MB_NO, &label[8], &record_length);
-			    }
-			else
-			    {
-			    record_length_fh_str[0] = label[8];
-			    record_length_fh_str[1] = label[9];
-			    if ((status = fread(&record_length_fh_str[2],
-				    4, 1, mbfp)) != 1)
-				    {
-				    status = MB_FAILURE;
-				    *error = MB_ERROR_EOF;
-				    }
-			    record_length_fh_str[6] = 0;
-			    record_length_fh_str[7] = 0;
-			    sscanf(record_length_fh_str, "%d", &record_length_fh);
-			    }
-			}
-
-		/* read the appropriate data records */
-		if ((status == MB_FAILURE || type == MBF_SB2100BI_NONE)
-			&& expect == MBF_SB2100BI_NONE)
-			{
-			done = MB_YES;
-			}
-		else if ((status == MB_FAILURE || type == MBF_SB2100BI_NONE)
-			&& expect != MBF_SB2100BI_NONE)
-			{
-			done = MB_YES;
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		else if (expect != MBF_SB2100BI_NONE && expect != type)
-			{
-			done = MB_YES;
-			expect = MBF_SB2100BI_NONE;
-			*label_save_flag = MB_YES;
-			}
-		else if (type == MBF_SB2100BI_FH)
-			{
-			status = mbr_sb2100bi_rd_fh(
-				verbose,mbfp,record_length_fh,error);
-			if (status == MB_SUCCESS)
-				{
-				done = MB_NO;
-				expect = MBF_SB2100BI_NONE;
-				store->kind = MB_DATA_NONE;
-				}
-			}
-		else if (type == MBF_SB2100BI_PR)
-			{
-			status = mbr_sb2100bi_rd_pr(
-				verbose,mbfp,store,record_length,error);
-			if (status == MB_SUCCESS)
-				{
-				done = MB_YES;
-				store->kind = MB_DATA_VELOCITY_PROFILE;
-				}
-			}
-		else if (type == MBF_SB2100BI_TR)
-			{
-			status = mbr_sb2100bi_rd_tr(
-				verbose,mbfp,store,record_length,error);
-			if (status == MB_SUCCESS)
-				{
-				done = MB_YES;
-				store->kind = MB_DATA_COMMENT;
-				}
-			}
-		else if (type == MBF_SB2100BI_DH)
-			{
-			status = mbr_sb2100bi_rd_dh(
-				verbose,mbfp,store,record_length,error);
-			if (status == MB_SUCCESS)
-				{
-				done = MB_NO;
-				store->kind = MB_DATA_DATA;
-				expect = MBF_SB2100BI_BR;
-				}
-			}
-		else if (type == MBF_SB2100BI_BR)
-			{
-			status = mbr_sb2100bi_rd_br(
-				verbose,mbfp,store,record_length,error);
-			if (status == MB_SUCCESS
-				&& expect == MBF_SB2100BI_BR)
-				{
-				done = MB_NO;
-				store->kind = MB_DATA_DATA;
-				expect = MBF_SB2100BI_SR;
-				}
-			else if (status == MB_SUCCESS)
-				{
-				done = MB_YES;
-				expect = MBF_SB2100BI_NONE;
-				*error = MB_ERROR_UNINTELLIGIBLE;
-				status = MB_FAILURE;
-				}
-			else if (status == MB_FAILURE)
-				{
-				done = MB_YES;
-				expect = MBF_SB2100BI_NONE;
-				}
-			}
-		else if (type == MBF_SB2100BI_SR)
-			{
-			status = mbr_sb2100bi_rd_sr(
-				verbose,mbfp,store,record_length,error);
-			if (status == MB_SUCCESS
-				&& expect == MBF_SB2100BI_SR)
-				{
-				done = MB_YES;
-				}
-			else if (status == MB_SUCCESS)
-				{
-				done = MB_YES;
-				expect = MBF_SB2100BI_NONE;
-				*error = MB_ERROR_UNINTELLIGIBLE;
-				status = MB_FAILURE;
-				}
-			else if (status == MB_FAILURE
-				&& *error ==  MB_ERROR_UNINTELLIGIBLE
-				&& expect == MBF_SB2100BI_SR)
-				{
-				/* this preserves the bathymetry
-				   that has already been read */
-				done = MB_YES;
-				status = MB_SUCCESS;
-				*error = MB_ERROR_NO_ERROR;
-				}
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_sb2100bi_rd_fh(int verbose, FILE *mbfp, int record_length, int *error)
-{
-	char	*function_name = "mbr_sb2100bi_rd_fh";
-	int	status = MB_SUCCESS;
-	int	nread;
-	int	nlast;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       record_len: %d\n",record_length);
-		}
-
-	/* check record size */
-	if (record_length > 100000)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_UNINTELLIGIBLE;
-		}
-
-	/* if success read rest of record */
-	if (status == MB_SUCCESS)
-		{
-		/* read data into buffer */
-		nread = record_length / 100;
-		nlast = record_length % 100;
-		for (i=0;i<nread;i++)
-		    if ((status = fread(buffer,
-			    100, 1, mbfp)) != 1)
-			    {
-			    status = MB_FAILURE;
-			    *error = MB_ERROR_EOF;
-			    }
-		if (nlast > 0)
-		    if ((status = fread(buffer,
-			    nlast, 1, mbfp)) != 1)
-			    {
-			    status = MB_FAILURE;
-			    *error = MB_ERROR_EOF;
-			    }
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_sb2100bi_rd_pr(int verbose, FILE *mbfp,
-		struct mbsys_sb2100_struct *store, short record_length,
-		int *error)
-{
-	char	*function_name = "mbr_sb2100bi_rd_pr";
-	int	status = MB_SUCCESS;
-	int	read_length;
-	unsigned int	checksum_read;
-	unsigned int	checksum;
-	char	eor_read[6];
-	int	index;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		fprintf(stderr,"dbg2       record_len: %d\n",record_length);
-		}
-
-	/* check record size */
-	if (record_length != MBF_SB2100BI_PR_WRITE_LEN + 6)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_UNINTELLIGIBLE;
-		}
-
-	/* if success read rest of record */
-	if (status == MB_SUCCESS)
-		{
-		/* read data into structure */
-		read_length = MBF_SB2100BI_PR_WRITE_LEN;
-		if ((status = fread(buffer, 1,
-			MBF_SB2100BI_PR_WRITE_LEN, mbfp))
-			!= MBF_SB2100BI_PR_WRITE_LEN)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_EOF;
-			}
-		index = 0;
-		mb_get_binary_short(MB_NO, &buffer[index], &store->year); index += 2;
-		mb_get_binary_short(MB_NO, &buffer[index], &store->jday); index += 2;
-		mb_get_binary_short(MB_NO, &buffer[index], &store->hour); index += 2;
-		mb_get_binary_short(MB_NO, &buffer[index], &store->minute); index += 2;
-		mb_get_binary_short(MB_NO, &buffer[index], &store->sec); index += 2;
-		mb_get_binary_short(MB_NO, &buffer[index], &store->msec); index += 2;
-		mb_get_binary_float(MB_NO, &buffer[index], &store->roll_bias_port); index += 4;
-		mb_get_binary_float(MB_NO, &buffer[index], &store->roll_bias_starboard); index += 4;
-		mb_get_binary_float(MB_NO, &buffer[index], &store->pitch_bias); index += 4;
-		mb_get_binary_float(MB_NO, &buffer[index], &store->ship_draft); index += 4;
-		mb_get_binary_float(MB_NO, &buffer[index], &store->offset_x); index += 4;
-		mb_get_binary_float(MB_NO, &buffer[index], &store->offset_y); index += 4;
-		mb_get_binary_float(MB_NO, &buffer[index], &store->offset_z); index += 4;
-		mb_get_binary_int(MB_NO, &buffer[index], &store->num_svp); index += 4;
-		for (i=0;i<store->num_svp;i++)
-			{
-			mb_get_binary_float(MB_NO, &buffer[index], &(store->svp[i].depth)); index += 4;
-			mb_get_binary_float(MB_NO, &buffer[index], &(store->svp[i].velocity)); index += 4;
-			}
-
-		/* read checksum and eor */
-		if ((status = fread(&eor_read[0],
-			6, 1, mbfp)) != 1)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_EOF;
-			}
-		mb_get_binary_int(MB_NO, &eor_read[0], (int *) &checksum_read);
-
-
-		/* do checksum */
-		if (verbose >= 2)
-		    {
-		    checksum = 0;
-		    for (i=0;i<read_length;i++)
-			    checksum += (unsigned int) buffer[i];
-
-		    /* check checksum and report */
-		    fprintf(stderr,"\ndbg5  Checksum test done in MBIO function <%s>\n",function_name);
-		    fprintf(stderr,"dbg5       checksum read:       %d\n",checksum_read);
-		    fprintf(stderr,"dbg5       checksum calculated: %d\n",checksum);
-		    if (checksum != checksum_read)
-			    {
-		    	    fprintf(stderr,"dbg5       CHECKSUM ERROR!!\n");
-			    }
-		    else
-			    {
-		    	    fprintf(stderr,"dbg5       checksum ok\n");
-			    }
-		    }
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       year:             %d\n",store->year);
-		fprintf(stderr,"dbg5       julian day:       %d\n",store->jday);
-		fprintf(stderr,"dbg5       hour:             %d\n",store->hour);
-		fprintf(stderr,"dbg5       minute:           %d\n",store->minute);
-		fprintf(stderr,"dbg5       sec:              %d\n",store->sec);
-		fprintf(stderr,"dbg5       msec:             %d\n",store->msec);
-		fprintf(stderr,"dbg5       roll_bias_port:   %f\n",store->roll_bias_port);
-		fprintf(stderr,"dbg5       roll_bias_strbrd: %f\n",store->roll_bias_starboard);
-		fprintf(stderr,"dbg5       pitch_bias:       %f\n",store->pitch_bias);
-		fprintf(stderr,"dbg5       ship_draft:       %f\n",store->ship_draft);
-		fprintf(stderr,"dbg5       offset_x:         %f\n",store->offset_x);
-		fprintf(stderr,"dbg5       offset_y:         %f\n",store->offset_y);
-		fprintf(stderr,"dbg5       offset_z:         %f\n",store->offset_z);
-		fprintf(stderr,"dbg5       num_svp:          %d\n",store->num_svp);
-		fprintf(stderr,"dbg5       Sound Velocity Profile:\n");
-		for (i=0;i<store->num_svp;i++)
-			fprintf(stderr,"dbg5       %d  depth:%f  velocity:%f\n",
-				i,store->svp[i].depth,store->svp[i].velocity);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_sb2100bi_rd_tr(int verbose, FILE *mbfp,
-		struct mbsys_sb2100_struct *store, short record_length,
-		int *error)
-{
-	char	*function_name = "mbr_sb2100bi_rd_tr";
-	int	status = MB_SUCCESS;
-	int	read_length;
-	unsigned int	checksum_read;
-	unsigned int	checksum;
-	char	eor_read[6];
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		fprintf(stderr,"dbg2       record_len: %d\n",record_length);
-		}
-
-	/* check record size */
-	if (record_length > MBSYS_SB2100_MAXLINE + 6)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_UNINTELLIGIBLE;
-		}
-
-	/* if success read rest of record */
-	if (status == MB_SUCCESS)
-		{
-		/* read data into structure */
-		read_length = record_length - 6;
-		if ((status = fread(store->comment,
-			read_length, 1, mbfp)) != 1)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_EOF;
-			}
-
-		/* read checksum and eor */
-		if ((status = fread(&eor_read[0],
-			6, 1, mbfp)) != 1)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_EOF;
-			}
-		mb_get_binary_int(MB_NO, &eor_read[0], (int *) &checksum_read);
-
-
-		/* do checksum */
-		if (verbose >= 2)
-		    {
-		    checksum = 0;
-		    for (i=0;i<read_length;i++)
-			    checksum += (unsigned int) buffer[i];
-
-		    /* check checksum and report */
-		    fprintf(stderr,"\ndbg5  Checksum test done in MBIO function <%s>\n",function_name);
-		    fprintf(stderr,"dbg5       checksum read:       %d\n",checksum_read);
-		    fprintf(stderr,"dbg5       checksum calculated: %d\n",checksum);
-		    if (checksum != checksum_read)
-			    {
-		    	    fprintf(stderr,"dbg5       CHECKSUM ERROR!!\n");
-			    }
-		    else
-			    {
-		    	    fprintf(stderr,"dbg5       checksum ok\n");
-			    }
-		    }
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Value read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       comment:          %s\n",
-			store->comment);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_sb2100bi_rd_dh(int verbose, FILE *mbfp,
-		struct mbsys_sb2100_struct *store, short record_length,
-		int *error)
-{
-	char	*function_name = "mbr_sb2100bi_rd_dh";
-	int	status = MB_SUCCESS;
-	int	read_length;
-	unsigned int	checksum_read;
-	unsigned int	checksum;
-	char	eor_read[6];
-	int	index;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		fprintf(stderr,"dbg2       record_len: %d\n",record_length);
-		}
-
-	/* check record size */
-	if (record_length != MBF_SB2100BI_DH_WRITE_LEN + 6)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_UNINTELLIGIBLE;
-		}
-
-	/* if success read rest of record */
-	if (status == MB_SUCCESS)
-		{
-		/* read data into structure */
-		read_length = MBF_SB2100BI_DH_WRITE_LEN;
-		if ((status = fread(buffer,
-			read_length, 1, mbfp)) != 1)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_EOF;
-			}
-		index = 0;
-		mb_get_binary_short(MB_NO, &buffer[index], &store->year); index += 2;
-		mb_get_binary_short(MB_NO, &buffer[index], &store->jday); index += 2;
-		mb_get_binary_short(MB_NO, &buffer[index], &store->hour); index += 2;
-		mb_get_binary_short(MB_NO, &buffer[index], &store->minute); index += 2;
-		mb_get_binary_short(MB_NO, &buffer[index], &store->sec); index += 2;
-		mb_get_binary_short(MB_NO, &buffer[index], &store->msec); index += 2;
-		mb_get_binary_short(MB_NO, &buffer[index], &store->spare1); index += 2;
-		mb_get_binary_short(MB_NO, &buffer[index], &store->spare2); index += 2;
-		mb_get_binary_double(MB_NO, &buffer[index], &store->longitude); index += 8;
-		mb_get_binary_double(MB_NO, &buffer[index], &store->latitude); index += 8;
-		mb_get_binary_float(MB_NO, &buffer[index], &store->heading); index += 4;
-		mb_get_binary_float(MB_NO, &buffer[index], &store->speed); index += 4;
-		mb_get_binary_float(MB_NO, &buffer[index], &store->roll); index += 4;
-		mb_get_binary_float(MB_NO, &buffer[index], &store->pitch); index += 4;
-		mb_get_binary_float(MB_NO, &buffer[index], &store->heave); index += 4;
-		mb_get_binary_float(MB_NO, &buffer[index], &store->ssv); index += 4;
-		store->frequency = buffer[index]; index++;
-		store->depth_gate_mode = buffer[index]; index++;
-		store->ping_gain = buffer[index]; index++;
-		store->ping_pulse_width = buffer[index]; index++;
-		store->transmitter_attenuation = buffer[index]; index++;
-		store->ssv_source = buffer[index]; index++;
-		store->svp_correction = buffer[index]; index++;
-		store->pixel_algorithm = buffer[index]; index++;
-		mb_get_binary_float(MB_NO, &buffer[index], &store->pixel_size); index += 4;
-		mb_get_binary_int(MB_NO, &buffer[index], &store->nbeams); index += 4;
-		mb_get_binary_int(MB_NO, &buffer[index], &store->npixels); index += 4;
-		mb_get_binary_short(MB_NO, &buffer[index], &store->spare3); index += 2;
-		mb_get_binary_short(MB_NO, &buffer[index], &store->spare4); index += 2;
-		mb_get_binary_short(MB_NO, &buffer[index], &store->spare5); index += 2;
-		mb_get_binary_short(MB_NO, &buffer[index], &store->spare6); index += 2;
-
-		/* read checksum and eor */
-		if ((status = fread(&eor_read[0],
-			6, 1, mbfp)) != 1)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_EOF;
-			}
-		mb_get_binary_int(MB_NO, &eor_read[0], (int *) &checksum_read);
-
-		/* do checksum */
-		if (verbose >= 2)
-		    {
-		    checksum = 0;
-		    for (i=0;i<read_length;i++)
-			    checksum += (unsigned int) buffer[i];
-
-		    /* check checksum and report */
-		    fprintf(stderr,"\ndbg5  Checksum test done in MBIO function <%s>\n",function_name);
-		    fprintf(stderr,"dbg5       checksum read:       %d\n",checksum_read);
-		    fprintf(stderr,"dbg5       checksum calculated: %d\n",checksum);
-		    if (checksum != checksum_read)
-			    {
-		    	    fprintf(stderr,"dbg5       CHECKSUM ERROR!!\n");
-			    }
-		    else
-			    {
-		    	    fprintf(stderr,"dbg5       checksum ok\n");
-			    }
-		    }
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       year:             %d\n",store->year);
-		fprintf(stderr,"dbg5       julian day:       %d\n",store->jday);
-		fprintf(stderr,"dbg5       hour:             %d\n",store->hour);
-		fprintf(stderr,"dbg5       minute:           %d\n",store->minute);
-		fprintf(stderr,"dbg5       sec:              %d\n",store->sec);
-		fprintf(stderr,"dbg5       msec:             %d\n",store->msec);
-		fprintf(stderr,"dbg5       longitude:        %f\n",store->longitude);
-		fprintf(stderr,"dbg5       latitude:         %f\n",store->latitude);
-		fprintf(stderr,"dbg5       heading:          %f\n",store->heading);
-		fprintf(stderr,"dbg5       speed:            %f\n",store->speed);
-		fprintf(stderr,"dbg5       roll:             %f\n",store->roll);
-		fprintf(stderr,"dbg5       pitch:            %f\n",store->pitch);
-		fprintf(stderr,"dbg5       heave:            %f\n",store->heave);
-		fprintf(stderr,"dbg5       ssv:              %f\n",store->ssv);
-		fprintf(stderr,"dbg5       frequency:        %c\n",store->frequency);
-		fprintf(stderr,"dbg5       depth_gate_mode:  %c\n",store->depth_gate_mode);
-		fprintf(stderr,"dbg5       ping_gain:        %d\n",store->ping_gain);
-		fprintf(stderr,"dbg5       ping_pulse_width: %d\n",store->ping_pulse_width);
-		fprintf(stderr,"dbg5       trans_atten:      %d\n",store->transmitter_attenuation);
-		fprintf(stderr,"dbg5       ssv_source:       %c\n",store->ssv_source);
-		fprintf(stderr,"dbg5       svp_correction:   %c\n",store->svp_correction);
-		fprintf(stderr,"dbg5       pixel_algorithm:  %c\n",store->pixel_algorithm);
-		fprintf(stderr,"dbg5       pixel_size:       %f\n",store->pixel_size);
-		fprintf(stderr,"dbg5       nbeams:           %d\n",store->nbeams);
-		fprintf(stderr,"dbg5       npixels:          %d\n",store->npixels);
-		fprintf(stderr,"dbg5       spare1:           %d\n",store->spare1);
-		fprintf(stderr,"dbg5       spare2:           %d\n",store->spare2);
-		fprintf(stderr,"dbg5       spare3:           %d\n",store->spare3);
-		fprintf(stderr,"dbg5       spare4:           %d\n",store->spare4);
-		fprintf(stderr,"dbg5       spare5:           %d\n",store->spare5);
-		fprintf(stderr,"dbg5       spare6:           %d\n",store->spare6);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_sb2100bi_rd_br(int verbose, FILE *mbfp,
-		struct mbsys_sb2100_struct *store, short record_length,
-		int *error)
-{
-	char	*function_name = "mbr_sb2100bi_rd_br";
-	int	status = MB_SUCCESS;
-	int	read_length;
-	unsigned int	checksum_read;
-	unsigned int	checksum;
-	char	eor_read[6];
-	int	index;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		fprintf(stderr,"dbg2       record_len: %d\n",record_length);
-		}
-
-	/* check record size */
-	if (record_length != store->nbeams * MBF_SB2100BI_BR_WRITE_LEN + 6)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_UNINTELLIGIBLE;
-		}
-
-	/* if success read rest of record */
-	if (status == MB_SUCCESS)
-		{
-		/* read data into structure */
-		read_length = store->nbeams * MBF_SB2100BI_BR_WRITE_LEN;
-		if (read_length > 0)
-		if ((status = fread(buffer,
-			read_length, 1, mbfp)) != 1)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_EOF;
-			}
-
-		index = 0;
-		for (i=0;i<store->nbeams;i++)
-			{
-			mb_get_binary_float(MB_NO, &buffer[index], &store->beams[i].depth); index += 4;
-			mb_get_binary_float(MB_NO, &buffer[index], &store->beams[i].acrosstrack); index += 4;
-			mb_get_binary_float(MB_NO, &buffer[index], &store->beams[i].alongtrack); index += 4;
-			mb_get_binary_float(MB_NO, &buffer[index], &store->beams[i].range); index += 4;
-			mb_get_binary_float(MB_NO, &buffer[index], &store->beams[i].angle_across); index += 4;
-			mb_get_binary_float(MB_NO, &buffer[index], &store->beams[i].angle_forward); index += 4;
-			mb_get_binary_short(MB_NO, &buffer[index], &store->beams[i].amplitude); index += 2;
-			mb_get_binary_short(MB_NO, &buffer[index], &store->beams[i].signal_to_noise); index += 2;
-			mb_get_binary_short(MB_NO, &buffer[index], &store->beams[i].echo_length); index += 2;
-			store->beams[i].quality = buffer[index]; index++;
-			store->beams[i].source = buffer[index]; index++;
-			}
-
-		/* read checksum and eor */
-		if ((status = fread(&eor_read[0],
-			6, 1, mbfp)) != 1)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_EOF;
-			}
-		mb_get_binary_int(MB_NO, &eor_read[0], (int *) &checksum_read);
-
-
-		/* do checksum */
-		if (verbose >= 2)
-		    {
-		    checksum = 0;
-		    for (i=0;i<read_length;i++)
-			    checksum += (unsigned int) buffer[i];
-
-		    /* check checksum and report */
-		    fprintf(stderr,"\ndbg5  Checksum test done in MBIO function <%s>\n",function_name);
-		    fprintf(stderr,"dbg5       checksum read:       %d\n",checksum_read);
-		    fprintf(stderr,"dbg5       checksum calculated: %d\n",checksum);
-		    if (checksum != checksum_read)
-			    {
-		    	    fprintf(stderr,"dbg5       CHECKSUM ERROR!!\n");
-			    }
-		    else
-			    {
-		    	    fprintf(stderr,"dbg5       checksum ok\n");
-			    }
-		    }
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       beam depth xtrack ltrack tt angle angfor amp sig2noise echo src quality\n");
-		for (i=0;i<store->nbeams;i++)
-		  {
-		  fprintf(stderr,"dbg5       %3d %8.2f %9.2f %8.2f %6.3f %7.3f %7.3f %3d %3d %3d %c %c\n",
-			i,
-			store->beams[i].depth,
-			store->beams[i].acrosstrack,
-			store->beams[i].alongtrack,
-			store->beams[i].range,
-			store->beams[i].angle_across,
-			store->beams[i].angle_forward,
-			store->beams[i].amplitude,
-			store->beams[i].signal_to_noise,
-			store->beams[i].echo_length,
-			store->beams[i].source,
-			store->beams[i].quality);
-		  }
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_sb2100bi_rd_sr(int verbose, FILE *mbfp,
-		struct mbsys_sb2100_struct *store, short record_length,
-		int *error)
-{
-	char	*function_name = "mbr_sb2100bi_rd_sr";
-	int	status = MB_SUCCESS;
-	int	read_length;
-	unsigned int	checksum_read;
-	unsigned int	checksum;
-	char	eor_read[6];
-	short	amplitude_short;
-	short	alongtrack_short;
-	int	index;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		fprintf(stderr,"dbg2       record_len: %d\n",record_length);
-		}
-
-	/* check record size */
-	if (record_length != store->npixels * MBF_SB2100BI_SR_WRITE_LEN + 6)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_UNINTELLIGIBLE;
-		}
-
-	/* if success read rest of record */
-	if (status == MB_SUCCESS)
-		{
-		/* read store into structure */
-		read_length = store->npixels * MBF_SB2100BI_SR_WRITE_LEN;
-		if (read_length > 0)
-		if ((status = fread(buffer,
-			read_length, 1, mbfp)) != 1)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_EOF;
-			}
-
-		index = 0;
-		for (i=0;i<store->npixels;i++)
-			{
-			mb_get_binary_short(MB_NO, &buffer[index], &amplitude_short); index += 2;
-			mb_get_binary_short(MB_NO, &buffer[index], &alongtrack_short); index += 2;
-			store->pixels[i].amplitude = (float) amplitude_short;
-			store->pixels[i].alongtrack = 0.1 * ((float) alongtrack_short);
-			}
-
-		/* read checksum and eor */
-		if ((status = fread(&eor_read[0],
-			6, 1, mbfp)) != 1)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_EOF;
-			}
-		mb_get_binary_int(MB_NO, &eor_read[0], (int *) &checksum_read);
-
-
-		/* do checksum */
-		if (verbose >= 2)
-		    {
-		    checksum = 0;
-		    for (i=0;i<read_length;i++)
-			    checksum += (unsigned int) buffer[i];
-
-		    /* check checksum and report */
-		    fprintf(stderr,"\ndbg5  Checksum test done in MBIO function <%s>\n",function_name);
-		    fprintf(stderr,"dbg5       checksum read:       %d\n",checksum_read);
-		    fprintf(stderr,"dbg5       checksum calculated: %d\n",checksum);
-		    if (checksum != checksum_read)
-			    {
-		    	    fprintf(stderr,"dbg5       CHECKSUM ERROR!!\n");
-			    }
-		    else
-			    {
-		    	    fprintf(stderr,"dbg5       checksum ok\n");
-			    }
-		    }
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       pixel amplitude alongtrack\n");
-		for (i=0;i<store->npixels;i++)
-		    {
-		    fprintf(stderr,"dbg5       %3d   %f   %f\n",
-			  i,
-			  store->pixels[i].amplitude,
-			  store->pixels[i].alongtrack);
-		    }
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_sb2100bi_wr_data(int verbose, void *mbio_ptr, char *store_ptr, int *error)
-{
-	char	*function_name = "mbr_sb2100bi_wr_data";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_sb2100_struct *store;
-	FILE	*mbfp;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_sb2100_struct *) store_ptr;
-	mbfp = mb_io_ptr->mbfp;
-
-	/* write file header if not written yet */
-	if (mb_io_ptr->save_flag == MB_NO)
-		{
-		status = mbr_sb2100bi_wr_fh(verbose,mbfp,error);
-		mb_io_ptr->save_flag = MB_YES;
-		}
-
-	if (store->kind == MB_DATA_VELOCITY_PROFILE)
-		{
-		status = mbr_sb2100bi_wr_pr(verbose,mbfp,store,error);
-		}
-	else if (store->kind == MB_DATA_COMMENT)
-		{
-		status = mbr_sb2100bi_wr_tr(verbose,mbfp,store,error);
-		}
-	else if (store->kind == MB_DATA_DATA)
-		{
-		status = mbr_sb2100bi_wr_dh(verbose,mbfp,store,error);
-		status = mbr_sb2100bi_wr_br(verbose,mbfp,store,error);
-		status = mbr_sb2100bi_wr_sr(verbose,mbfp,store,error);
-		}
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_BAD_KIND;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  store record kind in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       kind:       %d\n",store->kind);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_sb2100bi_wr_fh(int verbose, FILE *mbfp, int *error)
-{
-	char	*function_name = "mbr_sb2100bi_wr_fh";
-	int	status = MB_SUCCESS;
-	int	record_length;
-	char	record_length_str[8];
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       file_header_text: \n%s%s\n",
-			mbf_sb2100bi_file_header_text_1,
-			mbf_sb2100bi_file_header_text_2);
-		}
-
-	/* write the record label */
-	if (fwrite(mbf_sb2100bi_labels[MBF_SB2100BI_FH],
-		MBF_SB2100BI_LABEL_LEN, 1, mbfp) != 1)
-		{
-		*error = MB_ERROR_WRITE_FAIL;
-		status = MB_FAILURE;
-		}
-	else
-		{
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-		}
-
-	/* write the record length */
-	if (status == MB_SUCCESS)
-		{
-		record_length = strlen(mbf_sb2100bi_file_header_text_1)
-		    + strlen(mbf_sb2100bi_file_header_text_2);
-		sprintf(record_length_str, "%6d", record_length);
-		if (fwrite(record_length_str, 6, 1, mbfp) != 1)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* write out the store */
-	if (status == MB_SUCCESS)
-		{
-		/* write the data */
-		if (fwrite(mbf_sb2100bi_file_header_text_1,
-			strlen(mbf_sb2100bi_file_header_text_1),
-			1, mbfp) != 1)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		if (fwrite(mbf_sb2100bi_file_header_text_2,
-			strlen(mbf_sb2100bi_file_header_text_2),
-			1, mbfp) != 1)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_sb2100bi_wr_pr(int verbose, FILE *mbfp, struct mbsys_sb2100_struct *store, int *error)
-{
-	char	*function_name = "mbr_sb2100bi_wr_pr";
-	int	status = MB_SUCCESS;
-	short	record_length;
-	int	write_length;
-	unsigned int	checksum;
-	int	index;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       year:             %d\n",store->year);
-		fprintf(stderr,"dbg5       julian day:       %d\n",store->jday);
-		fprintf(stderr,"dbg5       hour:             %d\n",store->hour);
-		fprintf(stderr,"dbg5       minute:           %d\n",store->minute);
-		fprintf(stderr,"dbg5       sec:              %d\n",store->sec);
-		fprintf(stderr,"dbg5       msec:             %d\n",store->msec);
-		fprintf(stderr,"dbg5       roll_bias_port:   %f\n",store->roll_bias_port);
-		fprintf(stderr,"dbg5       roll_bias_strbrd: %f\n",store->roll_bias_starboard);
-		fprintf(stderr,"dbg5       pitch_bias:       %f\n",store->pitch_bias);
-		fprintf(stderr,"dbg5       ship_draft:       %f\n",store->ship_draft);
-		fprintf(stderr,"dbg5       offset_x:         %f\n",store->offset_x);
-		fprintf(stderr,"dbg5       offset_y:         %f\n",store->offset_y);
-		fprintf(stderr,"dbg5       offset_z:         %f\n",store->offset_z);
-		fprintf(stderr,"dbg5       num_svp:          %d\n",store->num_svp);
-		fprintf(stderr,"dbg5       Sound Velocity Profile:\n");
-		for (i=0;i<store->num_svp;i++)
-			fprintf(stderr,"dbg5       %d  depth:%f  velocity:%f\n",
-				i,store->svp[i].depth,store->svp[i].velocity);
-		}
-
-	/* write the record label */
-	if (fwrite(mbf_sb2100bi_labels[MBF_SB2100BI_PR],
-		MBF_SB2100BI_LABEL_LEN, 1, mbfp) != 1)
-		{
-		*error = MB_ERROR_WRITE_FAIL;
-		status = MB_FAILURE;
-		}
-	else
-		{
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-		}
-
-	/* write the record length */
-	if (status == MB_SUCCESS)
-		{
-		record_length = MBF_SB2100BI_PR_WRITE_LEN + 6;
-		mb_put_binary_short(MB_NO, record_length, &buffer[0]);
-		if (fwrite(buffer, 2, 1, mbfp) != 1)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* write out the data */
-	if (status == MB_SUCCESS)
-		{
-		index = 0;
-		mb_put_binary_short(MB_NO, store->year, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_NO, store->jday, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_NO, store->hour, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_NO, store->minute, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_NO, store->sec, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_NO, store->msec, &buffer[index]); index += 2;
-		mb_put_binary_float(MB_NO, store->roll_bias_port, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_NO, store->roll_bias_starboard, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_NO, store->pitch_bias, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_NO, store->ship_draft, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_NO, store->offset_x, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_NO, store->offset_y, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_NO, store->offset_z, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_NO, store->num_svp, &buffer[index]); index += 4;
-		for (i=0;i<store->num_svp;i++)
-			{
-			mb_put_binary_float(MB_NO, store->svp[i].depth, &buffer[index]); index += 4;
-			mb_put_binary_float(MB_NO, store->svp[i].velocity, &buffer[index]); index += 4;
-			}
-
-		/* do checksum */
-		write_length = MBF_SB2100BI_PR_WRITE_LEN;
-		checksum = 0;
-		for (i=0;i<write_length;i++)
-			checksum += (unsigned int) buffer[i];
-		mb_put_binary_int(MB_NO, checksum, &buffer[index]); index += 4;
-		buffer[index] = mbf_sb2100bi_eor[0]; index++;
-		buffer[index] = mbf_sb2100bi_eor[1]; index++;
-		write_length += 6;
-
-		/* write the data */
-		if (fwrite(buffer, write_length,
-			1, mbfp) != 1)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_sb2100bi_wr_tr(int verbose, FILE *mbfp, struct mbsys_sb2100_struct *store, int *error)
-{
-	char	*function_name = "mbr_sb2100bi_wr_tr";
-	int	status = MB_SUCCESS;
-	short	record_length;
-	int	write_length;
-	unsigned int	checksum;
-	int	index;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       comment:          %s\n",
-			store->comment);
-		}
-
-	/* write the record label */
-	if (fwrite(mbf_sb2100bi_labels[MBF_SB2100BI_TR],
-		MBF_SB2100BI_LABEL_LEN, 1, mbfp) != 1)
-		{
-		*error = MB_ERROR_WRITE_FAIL;
-		status = MB_FAILURE;
-		}
-	else
-		{
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-		}
-
-	/* write the record length */
-	if (status == MB_SUCCESS)
-		{
-		record_length = strlen(store->comment) + 1;
-		if (record_length >= MBSYS_SB2100_MAXLINE)
-			{
-			store->comment[MBSYS_SB2100_MAXLINE-1] = '\0';
-			record_length = MBSYS_SB2100_MAXLINE;
-			}
-		record_length += 6;
-		mb_put_binary_short(MB_NO, record_length, &buffer[0]);
-		if (fwrite(buffer, 2, 1, mbfp) != 1)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* write out the data */
-	if (status == MB_SUCCESS)
-		{
-		/* do checksum */
-		strcpy(buffer,store->comment);
-		write_length = strlen(buffer) + 1;
-		checksum = 0;
-		for (i=0;i<write_length;i++)
-			checksum += (unsigned int) buffer[i];
-		index = write_length;
-		mb_put_binary_int(MB_NO, checksum, &buffer[index]); index += 4;
-		buffer[index] = mbf_sb2100bi_eor[0]; index++;
-		buffer[index] = mbf_sb2100bi_eor[1]; index++;
-		write_length += 6;
-
-		/* write the data */
-		if (fwrite(buffer, write_length,
-			1, mbfp) != 1)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_sb2100bi_wr_dh(int verbose, FILE *mbfp, struct mbsys_sb2100_struct *store, int *error)
-{
-	char	*function_name = "mbr_sb2100bi_wr_dh";
-	int	status = MB_SUCCESS;
-	short	record_length;
-	int	write_length;
-	unsigned int	checksum;
-	int	index;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       year:             %d\n",store->year);
-		fprintf(stderr,"dbg5       julian day:       %d\n",store->jday);
-		fprintf(stderr,"dbg5       hour:             %d\n",store->hour);
-		fprintf(stderr,"dbg5       minute:           %d\n",store->minute);
-		fprintf(stderr,"dbg5       sec:              %d\n",store->sec);
-		fprintf(stderr,"dbg5       msec:             %d\n",store->msec);
-		fprintf(stderr,"dbg5       longitude:        %f\n",store->longitude);
-		fprintf(stderr,"dbg5       latitude:         %f\n",store->latitude);
-		fprintf(stderr,"dbg5       heading:          %f\n",store->heading);
-		fprintf(stderr,"dbg5       speed:            %f\n",store->speed);
-		fprintf(stderr,"dbg5       roll:             %f\n",store->roll);
-		fprintf(stderr,"dbg5       pitch:            %f\n",store->pitch);
-		fprintf(stderr,"dbg5       heave:            %f\n",store->heave);
-		fprintf(stderr,"dbg5       ssv:              %f\n",store->ssv);
-		fprintf(stderr,"dbg5       frequency:        %c\n",store->frequency);
-		fprintf(stderr,"dbg5       depth_gate_mode:  %d\n",store->depth_gate_mode);
-		fprintf(stderr,"dbg5       ping_gain:        %d\n",store->ping_gain);
-		fprintf(stderr,"dbg5       ping_pulse_width: %d\n",store->ping_pulse_width);
-		fprintf(stderr,"dbg5       trans_atten:      %d\n",store->transmitter_attenuation);
-		fprintf(stderr,"dbg5       ssv_source:       %c\n",store->ssv_source);
-		fprintf(stderr,"dbg5       svp_correction:   %c\n",store->svp_correction);
-		fprintf(stderr,"dbg5       pixel_algorithm:  %c\n",store->pixel_algorithm);
-		fprintf(stderr,"dbg5       pixel_size:       %f\n",store->pixel_size);
-		fprintf(stderr,"dbg5       nbeams:           %d\n",store->nbeams);
-		fprintf(stderr,"dbg5       npixels:          %d\n",store->npixels);
-		fprintf(stderr,"dbg5       spare1:           %d\n",store->spare1);
-		fprintf(stderr,"dbg5       spare2:           %d\n",store->spare2);
-		fprintf(stderr,"dbg5       spare3:           %d\n",store->spare3);
-		fprintf(stderr,"dbg5       spare4:           %d\n",store->spare4);
-		fprintf(stderr,"dbg5       spare5:           %d\n",store->spare5);
-		fprintf(stderr,"dbg5       spare6:           %d\n",store->spare6);
-		}
-
-	/* write the record label */
-	if (fwrite(mbf_sb2100bi_labels[MBF_SB2100BI_DH],
-		MBF_SB2100BI_LABEL_LEN, 1, mbfp) != 1)
-		{
-		*error = MB_ERROR_WRITE_FAIL;
-		status = MB_FAILURE;
-		}
-	else
-		{
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-		}
-
-	/* write the record length */
-	if (status == MB_SUCCESS)
-		{
-		record_length = MBF_SB2100BI_DH_WRITE_LEN + 6;
-		mb_put_binary_short(MB_NO, record_length, &buffer[0]);
-		if (fwrite(buffer, 2, 1, mbfp) != 1)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* write out the data */
-	if (status == MB_SUCCESS)
-		{
-		index = 0;
-		mb_put_binary_short(MB_NO, store->year, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_NO, store->jday, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_NO, store->hour, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_NO, store->minute, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_NO, store->sec, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_NO, store->msec, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_NO, store->spare1, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_NO, store->spare2, &buffer[index]); index += 2;
-		mb_put_binary_double(MB_NO, store->longitude, &buffer[index]); index += 8;
-		mb_put_binary_double(MB_NO, store->latitude, &buffer[index]); index += 8;
-		mb_put_binary_float(MB_NO, store->heading, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_NO, store->speed, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_NO, store->roll, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_NO, store->pitch, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_NO, store->heave, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_NO, store->ssv, &buffer[index]); index += 4;
-		buffer[index] = store->frequency; index++;
-		buffer[index] = store->depth_gate_mode; index++;
-		buffer[index] = store->ping_gain; index++;
-		buffer[index] = store->ping_pulse_width; index++;
-		buffer[index] = store->transmitter_attenuation; index++;
-		buffer[index] = store->ssv_source; index++;
-		buffer[index] = store->svp_correction; index++;
-		buffer[index] = store->pixel_algorithm; index++;
-		mb_put_binary_float(MB_NO, store->pixel_size, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_NO, store->nbeams, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_NO, store->npixels, &buffer[index]); index += 4;
-		mb_put_binary_short(MB_NO, store->spare3, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_NO, store->spare4, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_NO, store->spare5, &buffer[index]); index += 2;
-		mb_put_binary_short(MB_NO, store->spare6, &buffer[index]); index += 2;
-
-		/* do checksum */
-		checksum = 0;
-		write_length = MBF_SB2100BI_DH_WRITE_LEN;
-		for (i=0;i<write_length;i++)
-			checksum += (unsigned int) buffer[i];
-		mb_put_binary_int(MB_NO, checksum, &buffer[index]); index += 4;
-		buffer[index] = mbf_sb2100bi_eor[0]; index++;
-		buffer[index] = mbf_sb2100bi_eor[1]; index++;
-		write_length += 6;
-
-		/* write the store */
-		if (fwrite(buffer, write_length,
-			1, mbfp) != 1)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_sb2100bi_wr_br(int verbose, FILE *mbfp, struct mbsys_sb2100_struct *store, int *error)
-{
-	char	*function_name = "mbr_sb2100bi_wr_br";
-	int	status = MB_SUCCESS;
-	short	record_length;
-	int	write_length;
-	unsigned int	checksum;
-	int	index;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       beam depth xtrack ltrack tt angle angfor amp sig2noise echo src quality\n");
-		for (i=0;i<store->nbeams;i++)
-		  {
-		  fprintf(stderr,"dbg5       %3d %8.2f %9.2f %8.2f %6.3f %7.3f %7.3f %3d %3d %3d %c %c\n",
-			i,
-			store->beams[i].depth,
-			store->beams[i].acrosstrack,
-			store->beams[i].alongtrack,
-			store->beams[i].range,
-			store->beams[i].angle_across,
-			store->beams[i].angle_forward,
-			store->beams[i].amplitude,
-			store->beams[i].signal_to_noise,
-			store->beams[i].echo_length,
-			store->beams[i].source,
-			store->beams[i].quality);
-		  }
-		}
-
-	/* write the record label */
-	if (fwrite(mbf_sb2100bi_labels[MBF_SB2100BI_BR],
-		MBF_SB2100BI_LABEL_LEN, 1, mbfp) != 1)
-		{
-		*error = MB_ERROR_WRITE_FAIL;
-		status = MB_FAILURE;
-		}
-	else
-		{
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-		}
-
-	/* write the record length */
-	if (status == MB_SUCCESS)
-		{
-		record_length = store->nbeams * MBF_SB2100BI_BR_WRITE_LEN + 6;
-		mb_put_binary_short(MB_NO, record_length, &buffer[0]);
-		if (fwrite(buffer, 2, 1, mbfp) != 1)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* write out the data */
-	if (status == MB_SUCCESS)
-		{
-		index = 0;
-		for (i=0;i<store->nbeams;i++)
-			{
-			mb_put_binary_float(MB_NO, store->beams[i].depth, &buffer[index]); index += 4;
-			mb_put_binary_float(MB_NO, store->beams[i].acrosstrack, &buffer[index]); index += 4;
-			mb_put_binary_float(MB_NO, store->beams[i].alongtrack, &buffer[index]); index += 4;
-			mb_put_binary_float(MB_NO, store->beams[i].range, &buffer[index]); index += 4;
-			mb_put_binary_float(MB_NO, store->beams[i].angle_across, &buffer[index]); index += 4;
-			mb_put_binary_float(MB_NO, store->beams[i].angle_forward, &buffer[index]); index += 4;
-			mb_put_binary_short(MB_NO, store->beams[i].amplitude, &buffer[index]); index += 2;
-			mb_put_binary_short(MB_NO, store->beams[i].signal_to_noise, &buffer[index]); index += 2;
-			mb_put_binary_short(MB_NO, store->beams[i].echo_length, &buffer[index]); index += 2;
-			buffer[index] = store->beams[i].quality; index++;
-			buffer[index] = store->beams[i].source; index++;
-			}
-
-		/* do checksum */
-		checksum = 0;
-		write_length = store->nbeams * MBF_SB2100BI_BR_WRITE_LEN;
-		for (i=0;i<write_length;i++)
-			checksum += (unsigned int) buffer[i];
-		mb_put_binary_int(MB_NO, checksum, &buffer[index]); index += 4;
-		buffer[index] = mbf_sb2100bi_eor[0]; index++;
-		buffer[index] = mbf_sb2100bi_eor[1]; index++;
-		write_length += 6;
-
-		/* write the data */
-		if (fwrite(buffer, write_length,
-			1, mbfp) != 1)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_sb2100bi_wr_sr(int verbose, FILE *mbfp, struct mbsys_sb2100_struct *store, int *error)
-{
-	char	*function_name = "mbr_sb2100bi_wr_sr";
-	int	status = MB_SUCCESS;
-	short	record_length;
-	int	write_length;
-	unsigned int	checksum;
-	short	amplitude_short;
-	short	alongtrack_short;
-	int	index;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       store:      %p\n",(void *)store);
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       pixel amplitude alongtrack\n");
-		for (i=0;i<store->npixels;i++)
-		  {
-		  fprintf(stderr,"dbg5       %3d   %f   %f\n",
-			i,
-			store->pixels[i].amplitude,
-			store->pixels[i].alongtrack);
-		  }
-		}
-
-	/* write the record label */
-	if (fwrite(mbf_sb2100bi_labels[MBF_SB2100BI_SR],
-		MBF_SB2100BI_LABEL_LEN, 1, mbfp) != 1)
-		{
-		*error = MB_ERROR_WRITE_FAIL;
-		status = MB_FAILURE;
-		}
-	else
-		{
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-		}
-
-	/* write the record length */
-	if (status == MB_SUCCESS)
-		{
-		record_length = store->npixels * MBF_SB2100BI_SR_WRITE_LEN + 6;
-		mb_put_binary_short(MB_NO, record_length, &buffer[0]);
-		if (fwrite(buffer, 2, 1, mbfp) != 1)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* write out the data */
-	if (status == MB_SUCCESS)
-		{
-		index = 0;
-		for (i=0;i<store->npixels;i++)
-			{
-			amplitude_short = (short) store->pixels[i].amplitude;
-			alongtrack_short = (short) (10 * store->pixels[i].alongtrack);
-			mb_put_binary_short(MB_NO, amplitude_short, &buffer[index]); index += 2;
-			mb_put_binary_short(MB_NO, alongtrack_short, &buffer[index]); index += 2;
-			}
-
-		/* do checksum */
-		checksum = 0;
-		write_length = store->npixels * MBF_SB2100BI_SR_WRITE_LEN;
-		for (i=0;i<write_length;i++)
-			checksum += (unsigned int) buffer[i];
-		mb_put_binary_int(MB_NO, checksum, &buffer[index]); index += 4;
-		buffer[index] = mbf_sb2100bi_eor[0]; index++;
-		buffer[index] = mbf_sb2100bi_eor[1]; index++;
-		write_length += 6;
-
-		/* write the data */
-		if (fwrite(buffer, write_length,
-			1, mbfp) != 1)
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mbr_sb2100rw.c b/src/mbio/mbr_sb2100rw.c
deleted file mode 100644
index ef79c2e..0000000
--- a/src/mbio/mbr_sb2100rw.c
+++ /dev/null
@@ -1,2907 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbr_sb2100rw.c	3/3/94
- *	$Id: mbr_sb2100rw.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1994-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbr_sb2100rw.c contains the functions for reading and writing
- * multibeam data in the SB2100RW format.
- * These functions include:
- *   mbr_alm_sb2100rw	- allocate read/write memory
- *   mbr_dem_sb2100rw	- deallocate read/write memory
- *   mbr_rt_sb2100rw	- read and translate data
- *   mbr_wt_sb2100rw	- translate and write data
- *
- * Author:	D. W. Caress
- * Date:	March 3, 1994
- * $Log: mbr_sb2100rw.c,v $
- * Revision 5.13  2008/03/01 09:14:03  caress
- * Some housekeeping changes.
- *
- * Revision 5.12  2005/11/05 00:48:04  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.11  2003/05/20 18:05:32  caress
- * Added svp_source to data source parameters.
- *
- * Revision 5.10  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.9  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.8  2002/07/20 20:42:40  caress
- * Release 5.0.beta20
- *
- * Revision 5.7  2002/04/30 17:41:29  caress
- * Fixed writing of number of pixels.
- *
- * Revision 5.6  2001/12/18 04:27:45  caress
- * Release 5.0.beta11.
- *
- * Revision 5.5  2001/07/27  19:07:16  caress
- * Added data cutting.
- *
- * Revision 5.4  2001/07/20 00:32:54  caress
- * Release 5.0.beta03
- *
- * Revision 5.3  2001/03/22  20:50:02  caress
- * Trying to make version 5.0.beta0
- *
- * Revision 5.2  2001/01/23  01:16:54  caress
- * Fixed passing of bathymetry when sidescan records don't
- * have range scale value.
- *
- * Revision 5.1  2001/01/22  07:43:34  caress
- * Version 5.0.beta01
- *
- * Revision 5.0  2000/12/01  22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.29  2000/10/11  01:03:21  caress
- * Convert to ANSI C
- *
- * Revision 4.28  2000/09/30  06:34:20  caress
- * Snapshot for Dale.
- *
- * Revision 4.27  1999/09/14  20:39:11  caress
- * Fixed bugs handling HSMD
- *
- * Revision 4.26  1998/10/05  17:46:15  caress
- * MB-System version 4.6beta
- *
- * Revision 4.25  1997/07/25  14:19:53  caress
- * Version 4.5beta2.
- * Much mucking, particularly with Simrad formats.
- *
- * Revision 4.24  1997/04/21  17:02:07  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.24  1997/04/17  15:07:36  caress
- * MB-System 4.5 Beta Release
- *
- * Revision 4.23  1996/06/05  21:06:27  caress
- * Fixed problem handling gain of sidescan and amplitude data.
- * Previously transmit attenuation was treated as a gain value
- * (positive) rather than an attenuation value.
- *
- * Revision 4.22  1996/04/22  13:21:19  caress
- * Now have DTR and MIN/MAX defines in mb_define.h
- *
- * Revision 4.21  1996/01/26  21:23:30  caress
- * Version 4.3 distribution
- *
- * Revision 4.20  1995/09/28  18:10:48  caress
- * Various bug fixes working toward release 4.3.
- *
- * Revision 4.19  1995/08/17  14:42:45  caress
- * Revision for release 4.3.
- *
- * Revision 4.18  1995/07/18  15:38:29  caress
- * Added rounding to calculation of output navigation.
- *
- * Revision 4.17  1995/07/13  19:13:36  caress
- * Intermediate check-in during major bug-fixing flail.
- *
- * Revision 4.16  1995/06/06  13:28:49  caress
- * Explicit cast to int on line 1298 fixes warning under Solaris 2.4
- *
- * Revision 4.15  1995/06/03  03:25:13  caress
- * Fixes to handling of changes to vendor SB2100 format
- *
- * Revision 4.14  1995/05/08  21:26:28  caress
- * Made changes consistent with new i/o spec for SB2100 data.
- *
- * Revision 4.13  1995/03/06  19:38:54  caress
- * Changed include strings.h to string.h for POSIX compliance.
- *
- * Revision 4.12  1995/02/15  14:37:51  caress
- * Changed "signed short" declarations to "short" in order to
- * placate the SunOS 4.1 compiler.
- *
- * Revision 4.11  1995/02/14  21:59:53  caress
- * Version 4.2
- *
- * Revision 4.10  1995/01/17  23:19:57  caress
- * Fixed bug where fractional seconds were set to zero
- * when writing data.
- *
- * Revision 4.9  1995/01/16  12:32:15  caress
- * Changed output of transmit_attenuation values so they
- * are not prepended with a "+", as Dale Chayes found
- * this was breaking Palmer data.
- *
- * Revision 4.8  1994/12/21  20:18:10  caress
- * Not sure what changes have been made.
- *
- * Revision 4.7  1994/11/07  14:04:33  caress
- * Fixed data flagging.
- *
- * Revision 4.6  1994/10/21  12:20:01  caress
- * Release V4.0
- *
- * Revision 4.5  1994/07/29  18:46:51  caress
- * Changes associated with supporting Lynx OS (byte swapped) and
- * using unix second time base (for time_d values).
- *
- * Revision 4.4  1994/06/21  22:54:21  caress
- * Added #ifdef statements to handle byte swapping.
- *
- * Revision 4.3  1994/04/09  15:49:21  caress
- * Altered to fit latest iteration of SeaBeam 2100 vendor format.
- *
- * Revision 4.2  1994/03/25  14:02:38  caress
- * Made changes in accordance with latest iteration of
- * SeaBeam 2100 vendor format.
- *
- * Revision 4.1  1994/03/13  04:48:05  caress
- * Changed order in which parameters are read and written.
- *
- * Revision 4.0  1994/03/06  00:01:56  caress
- * First cut at version 4.0
- *
- * Revision 4.0  1994/03/05  02:13:52  caress
- * First cut for MBF_SB2100RW format.
- *
- * Revision 1.1  1994/03/05  02:09:29  caress
- * Initial revision
- *
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mb_define.h"
-#include "mbsys_sb2100.h"
-#include "mbf_sb2100rw.h"
-
-/* include for byte swapping on little-endian machines */
-#ifdef BYTESWAPPED
-#include "mb_swap.h"
-#endif
-
-/* essential function prototypes */
-int mbr_register_sb2100rw(int verbose, void *mbio_ptr,
-		int *error);
-int mbr_info_sb2100rw(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_alm_sb2100rw(int verbose, void *mbio_ptr, int *error);
-int mbr_dem_sb2100rw(int verbose, void *mbio_ptr, int *error);
-int mbr_zero_sb2100rw(int verbose, void *data_ptr, int *error);
-int mbr_rt_sb2100rw(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_wt_sb2100rw(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-
-int mbr_sb2100rw_rd_data(int verbose, void *mbio_ptr, int *error);
-int mbr_sb2100rw_read_line(int verbose, FILE *mbfp,int minimum_size, char *line, int *error);
-int mbr_sb2100rw_rd_label(int verbose, FILE *mbfp, char *line, int *type, int *error);
-int mbr_sb2100rw_rd_pr(int verbose, FILE *mbfp, struct mbf_sb2100rw_struct *data, int *error);
-int mbr_sb2100rw_rd_tr(int verbose, FILE *mbfp, struct mbf_sb2100rw_struct *data, int *error);
-int mbr_sb2100rw_rd_dr(int verbose, FILE *mbfp, struct mbf_sb2100rw_struct *data, int *error);
-int mbr_sb2100rw_rd_ss(int verbose, FILE *mbfp, struct mbf_sb2100rw_struct *data, int *error);
-int mbr_sb2100rw_wr_data(int verbose, void *mbio_ptr, void *data_ptr, int *error);
-int mbr_sb2100rw_wr_label(int verbose, FILE *mbfp, char type, int *error);
-int mbr_sb2100rw_write_line(int verbose, FILE *mbfp, char *line, int *error);
-int mbr_sb2100rw_wr_rawline(int verbose, FILE *mbfp, void *data_ptr, int *error);
-int mbr_sb2100rw_wr_pr(int verbose, FILE *mbfp, void *data_ptr, int *error);
-int mbr_sb2100rw_wr_tr(int verbose, FILE *mbfp, void *data_ptr, int *error);
-int mbr_sb2100rw_wr_dr(int verbose, FILE *mbfp, void *data_ptr, int *error);
-int mbr_sb2100rw_wr_ss(int verbose, FILE *mbfp, void *data_ptr, int *error);
-
-static char rcs_id[]="$Id: mbr_sb2100rw.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mbr_register_sb2100rw(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_register_sb2100rw";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* get mb_io_ptr */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set format info parameters */
-	status = mbr_info_sb2100rw(verbose,
-			&mb_io_ptr->system,
-			&mb_io_ptr->beams_bath_max,
-			&mb_io_ptr->beams_amp_max,
-			&mb_io_ptr->pixels_ss_max,
-			mb_io_ptr->format_name,
-			mb_io_ptr->system_name,
-			mb_io_ptr->format_description,
-			&mb_io_ptr->numfile,
-			&mb_io_ptr->filetype,
-			&mb_io_ptr->variable_beams,
-			&mb_io_ptr->traveltime,
-			&mb_io_ptr->beam_flagging,
-			&mb_io_ptr->nav_source,
-			&mb_io_ptr->heading_source,
-			&mb_io_ptr->vru_source,
-			&mb_io_ptr->svp_source,
-			&mb_io_ptr->beamwidth_xtrack,
-			&mb_io_ptr->beamwidth_ltrack,
-			error);
-
-	/* set format and system specific function pointers */
-	mb_io_ptr->mb_io_format_alloc = &mbr_alm_sb2100rw;
-	mb_io_ptr->mb_io_format_free = &mbr_dem_sb2100rw;
-	mb_io_ptr->mb_io_store_alloc = &mbsys_sb2100_alloc;
-	mb_io_ptr->mb_io_store_free = &mbsys_sb2100_deall;
-	mb_io_ptr->mb_io_read_ping = &mbr_rt_sb2100rw;
-	mb_io_ptr->mb_io_write_ping = &mbr_wt_sb2100rw;
-	mb_io_ptr->mb_io_dimensions = &mbsys_sb2100_dimensions;
-	mb_io_ptr->mb_io_extract = &mbsys_sb2100_extract;
-	mb_io_ptr->mb_io_insert = &mbsys_sb2100_insert;
-	mb_io_ptr->mb_io_extract_nav = &mbsys_sb2100_extract_nav;
-	mb_io_ptr->mb_io_insert_nav = &mbsys_sb2100_insert_nav;
-	mb_io_ptr->mb_io_extract_altitude = &mbsys_sb2100_extract_altitude;
-	mb_io_ptr->mb_io_insert_altitude = NULL;
-	mb_io_ptr->mb_io_extract_svp = &mbsys_sb2100_extract_svp;
-	mb_io_ptr->mb_io_insert_svp = &mbsys_sb2100_insert_svp;
-	mb_io_ptr->mb_io_ttimes = &mbsys_sb2100_ttimes;
-	mb_io_ptr->mb_io_detects = &mbsys_sb2100_detects;
-	mb_io_ptr->mb_io_gains = &mbsys_sb2100_gains;
-	mb_io_ptr->mb_io_copyrecord = &mbsys_sb2100_copy;
-	mb_io_ptr->mb_io_extract_rawss = NULL;
-	mb_io_ptr->mb_io_insert_rawss = NULL;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",mb_io_ptr->system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",mb_io_ptr->beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",mb_io_ptr->beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",mb_io_ptr->pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",mb_io_ptr->format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",mb_io_ptr->system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",mb_io_ptr->format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",mb_io_ptr->numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",mb_io_ptr->filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",mb_io_ptr->variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",mb_io_ptr->traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",mb_io_ptr->beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",mb_io_ptr->nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",mb_io_ptr->heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",mb_io_ptr->vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",mb_io_ptr->svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",mb_io_ptr->beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",mb_io_ptr->beamwidth_ltrack);
-		fprintf(stderr,"dbg2       format_alloc:       %p\n",(void *)mb_io_ptr->mb_io_format_alloc);
-		fprintf(stderr,"dbg2       format_free:        %p\n",(void *)mb_io_ptr->mb_io_format_free);
-		fprintf(stderr,"dbg2       store_alloc:        %p\n",(void *)mb_io_ptr->mb_io_store_alloc);
-		fprintf(stderr,"dbg2       store_free:         %p\n",(void *)mb_io_ptr->mb_io_store_free);
-		fprintf(stderr,"dbg2       read_ping:          %p\n",(void *)mb_io_ptr->mb_io_read_ping);
-		fprintf(stderr,"dbg2       write_ping:         %p\n",(void *)mb_io_ptr->mb_io_write_ping);
-		fprintf(stderr,"dbg2       extract:            %p\n",(void *)mb_io_ptr->mb_io_extract);
-		fprintf(stderr,"dbg2       insert:             %p\n",(void *)mb_io_ptr->mb_io_insert);
-		fprintf(stderr,"dbg2       extract_nav:        %p\n",(void *)mb_io_ptr->mb_io_extract_nav);
-		fprintf(stderr,"dbg2       insert_nav:         %p\n",(void *)mb_io_ptr->mb_io_insert_nav);
-		fprintf(stderr,"dbg2       extract_altitude:   %p\n",(void *)mb_io_ptr->mb_io_extract_altitude);
-		fprintf(stderr,"dbg2       insert_altitude:    %p\n",(void *)mb_io_ptr->mb_io_insert_altitude);
-		fprintf(stderr,"dbg2       extract_svp:        %p\n",(void *)mb_io_ptr->mb_io_extract_svp);
-		fprintf(stderr,"dbg2       insert_svp:         %p\n",(void *)mb_io_ptr->mb_io_insert_svp);
-		fprintf(stderr,"dbg2       ttimes:             %p\n",(void *)mb_io_ptr->mb_io_ttimes);
-		fprintf(stderr,"dbg2       detects:            %p\n",(void *)mb_io_ptr->mb_io_detects);
-		fprintf(stderr,"dbg2       extract_rawss:      %p\n",(void *)mb_io_ptr->mb_io_extract_rawss);
-		fprintf(stderr,"dbg2       insert_rawss:       %p\n",(void *)mb_io_ptr->mb_io_insert_rawss);
-		fprintf(stderr,"dbg2       copyrecord:         %p\n",(void *)mb_io_ptr->mb_io_copyrecord);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbr_info_sb2100rw(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error)
-{
-	char	*function_name = "mbr_info_sb2100rw";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* set format info parameters */
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-	*system = MB_SYS_SB2100;
-	*beams_bath_max = 151;
-	*beams_amp_max = 151;
-	*pixels_ss_max = 2000;
-	strncpy(format_name, "SB2100RW", MB_NAME_LENGTH);
-	strncpy(system_name, "SB2100", MB_NAME_LENGTH);
-	strncpy(format_description, "Format name:          MBF_SB2100RW\nInformal Description: SeaBeam 2100 series vender format\nAttributes:           SeaBeam 2100, bathymetry, amplitude \n                      and sidescan, 151 beams and 2000 pixels, ascii \n                      with binary sidescan, SeaBeam Instruments.\n", MB_DESCRIPTION_LENGTH);
-	*numfile = 1;
-	*filetype = MB_FILETYPE_NORMAL;
-	*variable_beams = MB_YES;
-	*traveltime = MB_YES;
-	*beam_flagging = MB_YES;
-	*nav_source = MB_DATA_DATA;
-	*heading_source = MB_DATA_DATA;
-	*vru_source = MB_DATA_DATA;
-	*svp_source = MB_DATA_VELOCITY_PROFILE;
-	*beamwidth_xtrack = 2.0;
-	*beamwidth_ltrack = 2.0;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",*system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",*beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",*beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",*pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",*numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",*filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",*variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",*traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",*beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",*nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",*heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",*vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",*svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",*beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",*beamwidth_ltrack);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_alm_sb2100rw(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_alm_sb2100rw";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_sb2100_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set initial status */
-	status = MB_SUCCESS;
-
-	/* allocate memory for data structure */
-	mb_io_ptr->structure_size = sizeof(struct mbf_sb2100rw_struct);
-	mb_io_ptr->data_structure_size = 0;
-	status = mb_malloc(verbose,mb_io_ptr->structure_size,
-				&mb_io_ptr->raw_data,error);
-	status = mb_malloc(verbose,sizeof(struct mbsys_sb2100_struct),
-				&mb_io_ptr->store_data,error);
-
-	/* get store structure pointer */
-	store = (struct mbsys_sb2100_struct *) mb_io_ptr->store_data;
-
-	/* set comment pointer */
-	store->comment = (char *) &(store->roll_bias_port);
-
-	/* initialize everything to zeros */
-	mbr_zero_sb2100rw(verbose,mb_io_ptr->raw_data,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_dem_sb2100rw(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_dem_sb2100rw";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* deallocate memory for data descriptor */
-	status = mb_free(verbose,&mb_io_ptr->raw_data,error);
-	status = mb_free(verbose,&mb_io_ptr->store_data,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_zero_sb2100rw(int verbose, void *data_ptr, int *error)
-{
-	char	*function_name = "mbr_zero_sb2100rw";
-	int	status = MB_SUCCESS;
-	struct mbf_sb2100rw_struct *data;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       data_ptr:   %p\n",(void *)data_ptr);
-		}
-
-	/* get pointer to data descriptor */
-	data = (struct mbf_sb2100rw_struct *) data_ptr;
-
-	/* initialize everything to zeros */
-	if (data != NULL)
-		{
-		/* type of data record */
-		data->kind = MB_DATA_NONE;
-
-		/* time stamp (all records ) */
-		data->year = 0;
-		data->jday = 0;
-		data->hour = 0;
-		data->minute = 0;
-		data->msec = 0;
-
-		/* sonar parameters (PR) */
-		data->roll_bias_port = 0;
-		data->roll_bias_starboard = 0;
-		data->pitch_bias = 0;
-		data->ship_draft = 0;
-		data->num_svp = 0;
-		for (i=0;i<MBF_SB2100RW_MAXVEL;i++)
-			{
-			data->vdepth[i] = 0;
-			data->velocity[i] = 0;
-			}
-
-		/* DR and SS header info */
-		data->longitude = 0.0;
-		data->latitude = 0.0;
-		data->speed = 0;
-		data->heave = 0;
-		data->range_scale = 'D';
-		data->surface_sound_velocity = 0;
-		data->ssv_source = 'U';
-		data->depth_gate_mode = 'U';
-
-		/* DR header info */
-		data->num_beams = 0;
-		data->svp_corr_beams = '0';
-		for (i=0;i<2;i++)
-			data->spare_dr[i] = ' ';
-		data->num_algorithms = 1;
-		for (i=0;i<4;i++)
-			data->algorithm_order[i] = ' ';
-
-		/* SS header info */
-		data->num_pixels = 0;
-		data->ss_data_length = 0;
-		data->pixel_algorithm = 'D';
-		data->pixel_size_scale = 'D';
-		data->svp_corr_ss = '0';
-		data->num_pixels_12khz = 0;
-		data->pixel_size_12khz = 0.0;
-		data->num_pixels_36khz = 0;
-		data->pixel_size_36khz = 0.0;
-		data->spare_ss = ' ';
-
-		/* transmit parameters and navigation (DR and SS) */
-		data->frequency[0] = 'L';
-		data->frequency[1] = 'L';
-		data->ping_gain_12khz = 0;
-		data->ping_pulse_width_12khz = 0;
-		data->transmitter_attenuation_12khz = 0;
-		data->pitch_12khz = 0;
-		data->roll_12khz = 0;
-		data->heading_12khz = 0;
-		data->ping_gain_36khz = 0;
-		data->ping_pulse_width_36khz = 0;
-		data->transmitter_attenuation_36khz = 0;
-		data->pitch_36khz = 0;
-		data->roll_36khz = 0;
-		data->heading_36khz = 0;
-
-		/* formed beam data (DR) */
-		for (i=0;i<MBF_SB2100RW_BEAMS;i++)
-			{
-			data->source[i] = 'U';
-			data->travel_time[i] = 0;
-			data->angle_across[i] = 0;
-			data->angle_forward[i] = 0;
-			data->depth[i] = 0;
-			data->acrosstrack_beam[i] = 0;
-			data->alongtrack_beam[i] = 0;
-			data->amplitude_beam[i] = 0;
-			data->signal_to_noise[i] = 0;
-			data->echo_length[i] = 0;
-			data->quality[i] = '0';
-			}
-
-		/* sidescan data (SS) */
-		for (i=0;i<MBF_SB2100RW_PIXELS;i++)
-			{
-			data->amplitude_ss[i] = 0;
-			data->alongtrack_ss[i] = 0;
-			}
-
-		/* comment (TR) */
-		strncpy(data->comment,"\0",MBF_SB2100RW_MAXLINE);
-
-		}
-
-	/* assume success */
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_rt_sb2100rw(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_rt_sb2100rw";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_sb2100rw_struct *data;
-	struct mbsys_sb2100_struct *store;
-	double	scale;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointers to mbio descriptor and data structures */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-	data = (struct mbf_sb2100rw_struct *) mb_io_ptr->raw_data;
-	store = (struct mbsys_sb2100_struct *) store_ptr;
-
-	/* read next data from file */
-	status = mbr_sb2100rw_rd_data(verbose,mbio_ptr,error);
-
-	/* set error and kind in mb_io_ptr */
-	mb_io_ptr->new_error = *error;
-	mb_io_ptr->new_kind = data->kind;
-
-	/* translate values to sb2100 data storage structure */
-	if (status == MB_SUCCESS
-		&& store != NULL)
-		{
-		/* type of data record */
-		store->kind = data->kind;
-
-		/* sonar parameters (PR) */
-		if (data->kind == MB_DATA_VELOCITY_PROFILE)
-		    {
-		    store->year = data->year;
-		    store->jday = data->jday;
-		    store->hour = data->hour;
-		    store->minute = data->minute;
-		    store->sec = 0.001 * data->msec;
-		    store->msec = data->msec - 1000 * store->sec;
-		    store->roll_bias_port = 0.01 * data->roll_bias_port;
-		    store->roll_bias_starboard = 0.01 * data->roll_bias_starboard;
-		    store->pitch_bias = 0.01 * data->pitch_bias;
-		    store->ship_draft = 0.01 * data->ship_draft;
-		    store->offset_x = 0.0;
-		    store->offset_y = 0.0;
-		    store->offset_z = 0.0;
-		    store->num_svp = data->num_svp;
-		    for (i=0;i<MBF_SB2100RW_MAXVEL;i++)
-			    {
-			    store->svp[i].depth = 0.01 * data->vdepth[i];
-			    store->svp[i].velocity = 0.01 * data->velocity[i];
-			    }
-		    }
-
-		/* ping data */
-		else if (data->kind == MB_DATA_DATA)
-		    {
-		    /* time stamp */
-		    store->year = data->year;
-		    store->jday = data->jday;
-		    store->hour = data->hour;
-		    store->minute = data->minute;
-		    store->sec = 0.001 * data->msec;
-		    store->msec = data->msec - 1000 * store->sec;
-
-		    /* DR and SS header info */
-		    store->longitude = data->longitude;
-		    store->latitude = data->latitude;
-		    store->speed = 0.01 * data->speed;
-		    store->heave = 0.001 * data->heave;
-		    store->range_scale = data->range_scale;
-		    store->ssv = 0.01 * data->surface_sound_velocity;
-		    store->ssv_source = data->ssv_source;
-		    store->depth_gate_mode = data->depth_gate_mode;
-
-		    /* DR header info */
-		    store->nbeams = data->num_beams;
-		    store->svp_correction = data->svp_corr_beams;
-		    for (i=0;i<2;i++)
-			    store->spare_dr[i] = data->spare_dr[i];
-		    store->num_algorithms = data->num_algorithms;
-		    for (i=0;i<4;i++)
-			    store->algorithm_order[i] = data->algorithm_order[i];
-
-		    /* transmit parameters and navigation (DR and SS) */
-		    store->frequency = data->frequency[0];
-		    if (data->frequency[0] != 'H')
-			{
-			store->ping_gain = data->ping_gain_12khz;
-			store->ping_pulse_width = data->ping_pulse_width_12khz;
-			store->transmitter_attenuation
-				= data->transmitter_attenuation_12khz;
-			store->pitch = 0.001 * data->pitch_12khz;
-			store->roll = 0.001 * data->roll_12khz;
-			store->heading = 0.001 * data->heading_12khz;
-			}
-		    else
-			{
-			store->ping_gain = data->ping_gain_36khz;
-			store->ping_pulse_width = data->ping_pulse_width_36khz;
-			store->transmitter_attenuation
-				= data->transmitter_attenuation_36khz;
-			store->pitch = 0.001 * data->pitch_36khz;
-			store->roll = 0.001 * data->roll_36khz;
-			store->heading = 0.001 * data->heading_36khz;
-			}
-
-		    /* formed beam data (DR) */
-		    if (data->range_scale == 'S')
-			    scale = 0.01;
-		    else if (data->range_scale == 'I')
-			    scale = 0.1;
-		    else if (data->range_scale == 'D')
-			    scale = 1.0;
-		    for (i=0;i<MBF_SB2100RW_BEAMS;i++)
-			    {
-			    store->beams[i].depth = scale * data->depth[i];
-			    store->beams[i].acrosstrack = scale * data->acrosstrack_beam[i];
-			    store->beams[i].alongtrack = scale * data->alongtrack_beam[i];
-			    store->beams[i].range = 0.001 * data->travel_time[i];
-			    store->beams[i].angle_across = 0.001 * data->angle_across[i];
-			    store->beams[i].angle_forward = 0.01 * data->angle_forward[i];
-			    store->beams[i].amplitude = data->amplitude_beam[i];
-			    store->beams[i].signal_to_noise = data->signal_to_noise[i];
-			    store->beams[i].echo_length = data->echo_length[i];
-			    store->beams[i].quality = data->quality[i];
-			    store->beams[i].source = data->source[i];
-			    }
-
-		    /* SS header info */
-		    store->ss_data_length = data->ss_data_length;
-		    store->npixels = data->num_pixels;
-		    store->pixel_algorithm = data->pixel_algorithm;
-		    store->pixel_size_scale = data->pixel_size_scale;
-		    store->svp_corr_ss = data->svp_corr_ss;
-		    if (data->frequency[0] != 'H')
-			store->pixel_size = data->pixel_size_12khz;
-		    else
-			store->pixel_size = data->pixel_size_36khz;
-		    store->spare_ss = data->spare_ss;
-
-		    /* sidescan data (SS) */
-		    for (i=0;i<MBF_SB2100RW_PIXELS;i++)
-			    {
-			    store->pixels[i].amplitude = data->amplitude_ss[i];
-			    store->pixels[i].alongtrack = scale * data->alongtrack_ss[i];
-			    }
-		    }
-
-		/* comment (TR) */
-		else if (data->kind == MB_DATA_COMMENT)
-		    strncpy(store->comment,data->comment,
-			    MBF_SB2100RW_MAXLINE);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_wt_sb2100rw(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_wt_sb2100rw";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_sb2100rw_struct *data;
-	char	*data_ptr;
-	struct mbsys_sb2100_struct *store;
-	double	scale;
-	double	depth_max, across_max, along_max;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_sb2100rw_struct *) mb_io_ptr->raw_data;
-	data_ptr = (char *) data;
-	store = (struct mbsys_sb2100_struct *) store_ptr;
-
-	/* first translate values from data storage structure */
-	if (store != NULL)
-		{
-		/* type of data record */
-		data->kind = store->kind;
-
-		/* sonar parameters (PR) */
-		if (data->kind == MB_DATA_VELOCITY_PROFILE)
-		    {
-		    data->year = store->year;
-		    data->jday = store->jday;
-		    data->hour = store->hour;
-		    data->minute = store->minute;
-		    data->msec = 1000 * store->sec + store->msec;
-		    data->roll_bias_port = 100 * store->roll_bias_port;
-		    data->roll_bias_starboard = 100 * store->roll_bias_starboard;
-		    data->pitch_bias = 100 * store->pitch_bias;
-		    data->ship_draft = 100 * store->ship_draft;
-		    data->num_svp = store->num_svp;
-		    for (i=0;i<MBF_SB2100RW_MAXVEL;i++)
-			    {
-			    data->vdepth[i] = 100 * store->svp[i].depth;
-			    data->velocity[i] = 100 * store->svp[i].velocity;
-			    }
-		    }
-
-		/* ping data */
-		else if (data->kind == MB_DATA_DATA)
-		    {
-		    /* time stamp */
-		    data->year = store->year;
-		    data->jday = store->jday;
-		    data->hour = store->hour;
-		    data->minute = store->minute;
-		    data->msec = 1000 * store->sec + store->msec;
-
-		    /* DR and SS header info */
-		    data->longitude = store->longitude;
-		    data->latitude = store->latitude;
-		    data->speed = 100 * store->speed;
-		    data->heave = 1000 * store->heave;
-		    data->range_scale = store->range_scale;
-		    data->surface_sound_velocity = 100 * store->ssv;
-		    data->ssv_source = store->ssv_source;
-		    data->depth_gate_mode = store->depth_gate_mode;
-
-		    /* DR header info */
-		    data->num_beams = store->nbeams;
-		    data->svp_corr_beams = store->svp_correction;
-		    for (i=0;i<2;i++)
-			    data->spare_dr[i] = store->spare_dr[i];
-		    data->num_algorithms = store->num_algorithms;
-		    for (i=0;i<4;i++)
-			    data->algorithm_order[i] = store->algorithm_order[i];
-
-		    /* transmit parameters and navigation (DR and SS) */
-		    data->frequency[0] = store->frequency;
-		    data->frequency[1] = store->frequency;
-		    if (store->frequency != 'H')
-			{
-			if (store->frequency == 'L')
-				{
-				data->frequency[0] = 'L';
-				data->frequency[1] = 'L';
-				}
-			else if (store->frequency == '2')
-				{
-				data->frequency[0] = '2';
-                                data->frequency[1] = '0';
-                                }
-			data->ping_gain_12khz = store->ping_gain;
-			data->ping_pulse_width_12khz
-				= store->ping_pulse_width;
-			data->transmitter_attenuation_12khz
-				= store->transmitter_attenuation;
-			data->pitch_12khz = 1000 * store->pitch;
-			data->roll_12khz = 1000 * store->roll;
-			data->heading_12khz = 1000 * store->heading;
-			data->ping_gain_36khz = 0;
-			data->ping_pulse_width_36khz = 0;
-			data->transmitter_attenuation_36khz = 0;
-			data->pitch_36khz = 0;
-			data->roll_36khz = 0;
-			data->heading_36khz = 0;
-			}
-		    else
-			{
-                        data->frequency[0] = 'H';
-                        data->frequency[1] = 'H';
-			data->ping_gain_12khz = 0;
-			data->ping_pulse_width_12khz = 0;
-			data->transmitter_attenuation_12khz = 0;
-			data->pitch_12khz = 0;
-			data->roll_12khz = 0;
-			data->heading_12khz = 0;
-			data->ping_gain_36khz = store->ping_gain;
-			data->ping_pulse_width_36khz
-				= store->ping_pulse_width;
-			data->transmitter_attenuation_36khz
-				= store->transmitter_attenuation;
-			data->pitch_36khz = 1000 * store->pitch;
-			data->roll_36khz = 1000 * store->roll;
-			data->heading_36khz = 1000 * store->heading;
-			}
-
-		    /* formed beam data (DR) */
-		    if (data->range_scale == 'S')
-			    scale = 0.01;
-		    else if (data->range_scale == 'I')
-			    scale = 0.1;
-		    else if (data->range_scale == 'D')
-			    scale = 1.0;
-		    else
-			    {
-			    /* find best scale for data */
-			    depth_max = 0.0;
-			    across_max = 0.0;
-			    along_max = 0.0;
-			    for (i=0;i<MBF_SB2100RW_BEAMS;i++)
-				{
-				if (store->beams[i].depth != 0.0
-					&& store->beams[i].quality == ' ')
-				    {
-				    depth_max = MAX(depth_max, fabs(store->beams[i].depth));
-				    across_max = MAX(across_max, fabs(store->beams[i].acrosstrack));
-				    along_max = MAX(along_max, fabs(store->beams[i].alongtrack));
-				    }
-				}
-			    if (depth_max > 9999.9
-				|| across_max > 9999.9
-				|| along_max > 9999.9)
-				{
-				scale = 1.0;
-				data->range_scale = 'D';
-				}
-			    else if (depth_max > 999.9
-				|| across_max > 999.9
-				|| along_max > 999.9)
-				{
-				scale = 0.1;
-				data->range_scale = 'I';
-				}
-			    else
-				{
-				scale = 0.01;
-				data->range_scale = 'S';
-				}
-			    }
-		    for (i=0;i<MBF_SB2100RW_BEAMS;i++)
-			    {
-			    data->depth[i] = store->beams[i].depth / scale;
-			    data->acrosstrack_beam[i] = store->beams[i].acrosstrack / scale;
-			    data->alongtrack_beam[i] = store->beams[i].alongtrack / scale;
-			    data->travel_time[i] = 1000 * store->beams[i].range;
-			    data->angle_across[i] = 1000 * store->beams[i].angle_across;
-			    data->angle_forward[i] = 100 * store->beams[i].angle_forward;
-			    data->amplitude_beam[i] = store->beams[i].amplitude;
-			    data->signal_to_noise[i] = store->beams[i].signal_to_noise;
-			    data->echo_length[i] = store->beams[i].echo_length;
-			    data->quality[i] = store->beams[i].quality;
-			    data->source[i] = store->beams[i].source;
-			    }
-
-		    /* SS header info */
-		    data->ss_data_length = store->ss_data_length;
-		    data->num_pixels = store->npixels;
-		    data->pixel_algorithm = store->pixel_algorithm;
-		    data->pixel_size_scale = 'D';
-		    data->svp_corr_ss = store->svp_corr_ss;
-		    if (data->frequency[0] != 'H')
-			{
-			data->num_pixels_12khz = store->npixels;
-			data->pixel_size_12khz = store->pixel_size;
-			data->num_pixels_36khz = 0;
-			data->pixel_size_36khz = 0.0;
-			}
-		    else
-			{
-			data->num_pixels_12khz = 0;
-			data->pixel_size_12khz = 0.0;
-			data->num_pixels_36khz = store->npixels;
-			data->pixel_size_36khz = store->pixel_size;
-			}
-		    store->spare_ss = data->spare_ss;
-
-		    /* sidescan data (SS) */
-		    for (i=0;i<MBF_SB2100RW_PIXELS;i++)
-			    {
-			    data->amplitude_ss[i] = store->pixels[i].amplitude;
-			    data->alongtrack_ss[i] = store->pixels[i].alongtrack / scale;
-			    }
-		    }
-
-		/* comment (TR) */
-		else if (data->kind == MB_DATA_COMMENT)
-		    strncpy(data->comment,store->comment,
-			    MBF_SB2100RW_MAXLINE);
-
-		}
-
-	/* write next data to file */
-	status = mbr_sb2100rw_wr_data(verbose,mbio_ptr,data_ptr,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_sb2100rw_rd_data(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_sb2100rw_rd_data";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_sb2100rw_struct *data;
-	char	*data_ptr;
-	FILE	*mbfp;
-	int	done;
-	int	expect;
-
-	static int line_save_flag = MB_NO;
-	static char raw_line[MBF_SB2100RW_MAXLINE] = "\0";
-	static int type = MBF_SB2100RW_NONE;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_sb2100rw_struct *) mb_io_ptr->raw_data;
-	data_ptr = (char *) data;
-	mbfp = mb_io_ptr->mbfp;
-
-	/* initialize everything to zeros */
-	mbr_zero_sb2100rw(verbose,data_ptr,error);
-
-	/* get file position at record beginning */
-	mb_io_ptr->file_pos = mb_io_ptr->file_bytes;
-
-	done = MB_NO;
-	expect = MBF_SB2100RW_NONE;
-	while (done == MB_NO)
-		{
-
-		/* get next record label */
-		if (line_save_flag == MB_NO)
-			{
-			/* save position in file */
-			mb_io_ptr->file_bytes = ftell(mbfp);
-
-			/* read the label */
-			status = mbr_sb2100rw_rd_label(verbose,mbfp,
-				raw_line,&type,error);
-			}
-		else
-			line_save_flag = MB_NO;
-
-		/* read the appropriate data records */
-		if (status == MB_FAILURE && expect == MBF_SB2100RW_NONE)
-			{
-			mb_io_ptr->file_bytes = ftell(mbfp);
-			done = MB_YES;
-			}
-		else if (status == MB_FAILURE && expect != MBF_SB2100RW_NONE)
-			{
-			mb_io_ptr->file_bytes = ftell(mbfp);
-			done = MB_YES;
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		else if (expect != MBF_SB2100RW_NONE && expect != type)
-			{
-			done = MB_YES;
-			expect = MBF_SB2100RW_NONE;
-			line_save_flag = MB_YES;
-			}
-		else if (type == MBF_SB2100RW_RAW_LINE)
-			{
-			strcpy(data->comment,raw_line);
-			mb_io_ptr->file_bytes = ftell(mbfp);
-			done = MB_YES;
-			data->kind = MB_DATA_RAW_LINE;
-			*error = MB_ERROR_UNINTELLIGIBLE;
-			status = MB_FAILURE;
-			}
-		else if (type == MBF_SB2100RW_PR)
-			{
-			status = mbr_sb2100rw_rd_pr(
-				verbose,mbfp,data,error);
-			mb_io_ptr->file_bytes = ftell(mbfp);
-			if (status == MB_SUCCESS)
-				{
-				done = MB_YES;
-				data->kind = MB_DATA_VELOCITY_PROFILE;
-				}
-			}
-		else if (type == MBF_SB2100RW_TR)
-			{
-			status = mbr_sb2100rw_rd_tr(
-				verbose,mbfp,data,error);
-			mb_io_ptr->file_bytes = ftell(mbfp);
-			if (status == MB_SUCCESS)
-				{
-				done = MB_YES;
-				data->kind = MB_DATA_COMMENT;
-				}
-			}
-		else if (type == MBF_SB2100RW_DR)
-			{
-			status = mbr_sb2100rw_rd_dr(
-				verbose,mbfp,data,error);
-			mb_io_ptr->file_bytes = ftell(mbfp);
-			if (status == MB_SUCCESS)
-				{
-				done = MB_NO;
-				data->kind = MB_DATA_DATA;
-				expect = MBF_SB2100RW_SS;
-				}
-			}
-		else if (type == MBF_SB2100RW_SS)
-			{
-			status = mbr_sb2100rw_rd_ss(
-				verbose,mbfp,data,error);
-			mb_io_ptr->file_bytes = ftell(mbfp);
-			if (status == MB_SUCCESS
-				&& expect == MBF_SB2100RW_SS)
-				{
-				done = MB_YES;
-				}
-			else if (status == MB_SUCCESS)
-				{
-				done = MB_YES;
-				expect = MBF_SB2100RW_NONE;
-				*error = MB_ERROR_UNINTELLIGIBLE;
-				status = MB_FAILURE;
-				}
-			else if (status == MB_FAILURE
-				&& *error ==  MB_ERROR_UNINTELLIGIBLE
-				&& expect == MBF_SB2100RW_SS)
-				{
-				/* this preserves the bathymetry
-				   that has already been read */
-				done = MB_YES;
-				status = MB_SUCCESS;
-				*error = MB_ERROR_NO_ERROR;
-				}
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int	mbr_sb2100rw_rd_label(int verbose, FILE *mbfp,
-		char *line, int *type, int *error)
-{
-	char	*function_name = "mbr_sb2100rw_rd_label";
-	int	status = MB_SUCCESS;
-	int	i, j;
-	char	*label;
-	int	icmp;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		}
-
-	/* read next line in file */
-	status = mbr_sb2100rw_read_line(verbose,mbfp,1,line,error);
-
-	/* see if we just encountered an identifier record */
-	if (status == MB_SUCCESS)
-		{
-		*type = MBF_SB2100RW_RAW_LINE;
-		for (i=1;i<MBF_SB2100RW_RECORDS;i++)
-			{
-			icmp = strncmp(line,mbf_sb2100rw_labels[i],8);
-			if (icmp == 0)
-				*type = i;
-			}
-
-		/* if it looks like a raw line, check for up to
-		   four lost bytes */
-		if (*type == MBF_SB2100RW_RAW_LINE)
-		for (i=1;i<MBF_SB2100RW_RECORDS;i++)
-		    for (j=1;j<5;j++)
-			{
-			label = mbf_sb2100rw_labels[i];
-			icmp = strncmp(line,&label[j],8-j);
-			if (icmp == 0)
-				*type = i;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       line:       %s\n",line);
-		fprintf(stderr,"dbg2       type:       %d\n",*type);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int	mbr_sb2100rw_read_line(int verbose, FILE *mbfp,
-		int minimum_size, char *line, int *error)
-{
-	char	*function_name = "mbr_sb2100rw_read_line";
-	int	status = MB_SUCCESS;
-	int	nchars;
-	int	done;
-	char	*result;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		}
-
-	/* read next good line in file */
-	done = MB_NO;
-	do
-		{
-		/* read next line in file */
-		strncpy(line,"\0",MBF_SB2100RW_MAXLINE);
-		result = fgets(line,MBF_SB2100RW_MAXLINE,mbfp);
-
-		/* check size of line */
-		nchars = strlen(line);
-
-		/* check for eof */
-		if (result == line)
-			{
-			if (nchars >= minimum_size)
-				done = MB_YES;
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		else
-			{
-			done = MB_YES;
-			*error = MB_ERROR_EOF;
-			status = MB_FAILURE;
-			}
-
-		/* print debug statements */
-		if (verbose >= 5)
-			{
-			fprintf(stderr,"\ndbg5  New line read in function <%s>\n",function_name);
-			fprintf(stderr,"dbg5       line:       %s\n",line);
-			fprintf(stderr,"dbg5       chars:      %d\n",nchars);
-			}
-
-		}
-	while (done == MB_NO);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       line:       %s\n",line);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_sb2100rw_rd_pr(int verbose, FILE *mbfp,
-		struct mbf_sb2100rw_struct *data, int *error)
-{
-	char	*function_name = "mbr_sb2100rw_rd_pr";
-	int	status = MB_SUCCESS;
-	char	line[MBF_SB2100RW_MAXLINE];
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       data:       %p\n",(void *)data);
-		}
-
-	/* read and parse data from first line of record */
-	status = mbr_sb2100rw_read_line(verbose,mbfp,1,line,error);
-
-	/* parse data from first line */
-	if (status == MB_SUCCESS)
-		{
-		mb_get_int(&(data->year),                 line,     4);
-		mb_get_int(&(data->jday),                 line+4,   3);
-		mb_get_int(&(data->hour),                 line+7,   2);
-		mb_get_int(&(data->minute),               line+9,   2);
-		mb_get_int(&(data->msec),                 line+11,  5);
-		if ((int)strlen(line) >= 39)
-			{
-			mb_get_int(&(data->roll_bias_port),       line+16,  6);
-			data->roll_bias_starboard = data->roll_bias_port;
-			mb_get_int(&(data->pitch_bias),           line+22,  6);
-			mb_get_int(&(data->num_svp),              line+28,  2);
-			mb_get_int(&(data->ship_draft),           line+30,  7);
-			}
-		else
-			{
-			mb_get_int(&(data->roll_bias_port),       line+16,  6);
-			mb_get_int(&(data->roll_bias_starboard),  line+22,  6);
-			mb_get_int(&(data->pitch_bias),           line+28,  6);
-			mb_get_int(&(data->num_svp),              line+34,  2);
-			data->ship_draft = 0;
-			}
-		}
-
-	/* read and parse data from other lines of record */
-	for (i=0;i<data->num_svp;i++)
-		{
-		if ((status = mbr_sb2100rw_read_line(verbose,mbfp,1,line,error))
-			== MB_SUCCESS)
-			{
-			mb_get_int(&(data->vdepth[i]),line,7);
-			mb_get_int(&(data->velocity[i]),line+7,6);
-			}
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       year:             %d\n",data->year);
-		fprintf(stderr,"dbg5       julian day:       %d\n",data->jday);
-		fprintf(stderr,"dbg5       hour:             %d\n",data->hour);
-		fprintf(stderr,"dbg5       minute:           %d\n",data->minute);
-		fprintf(stderr,"dbg5       msec:             %d\n",data->msec);
-		fprintf(stderr,"dbg5       roll_bias_port:   %d\n",data->roll_bias_port);
-		fprintf(stderr,"dbg5       roll_bias_strbrd: %d\n",data->roll_bias_starboard);
-		fprintf(stderr,"dbg5       pitch_bias:       %d\n",data->pitch_bias);
-		fprintf(stderr,"dbg5       num_svp:          %d\n",data->num_svp);
-		fprintf(stderr,"dbg5       ship_draft:       %d\n",data->ship_draft);
-		fprintf(stderr,"dbg5       Sound Velocity Profile:\n");
-		for (i=0;i<data->num_svp;i++)
-			fprintf(stderr,"dbg5       %d  depth:%d  velocity:%d\n",
-				i,data->vdepth[i],data->velocity[i]);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_sb2100rw_rd_tr(int verbose, FILE *mbfp,
-		struct mbf_sb2100rw_struct *data, int *error)
-{
-	char	*function_name = "mbr_sb2100rw_rd_tr";
-	int	status = MB_SUCCESS;
-	char	line[MBF_SB2100RW_MAXLINE];
-	int	nchars;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       data:       %p\n",(void *)data);
-		}
-
-	/* read comment record from file */
-	status = mbr_sb2100rw_read_line(verbose,mbfp,1,line,error);
-
-	/* copy comment into data structure */
-	if (status == MB_SUCCESS)
-		{
-		nchars = strlen(line);
-		strncpy(data->comment,line,nchars-1);
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Value read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       comment:          %s\n",
-			data->comment);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_sb2100rw_rd_dr(int verbose, FILE *mbfp,
-		struct mbf_sb2100rw_struct *data, int *error)
-{
-	char	*function_name = "mbr_sb2100rw_rd_dr";
-	int	status = MB_SUCCESS;
-	char	line[MBF_SB2100RW_MAXLINE];
-	int	shift;
-	char	ew, ns;
-	int	degrees, minutes;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       data:       %p\n",(void *)data);
-		}
-
-	/* read and parse data from first line of record */
-	status = mbr_sb2100rw_read_line(verbose,mbfp,1,line,error);
-
-	/* parse data from first line */
-	if (status == MB_SUCCESS)
-		{
-		/* get time and navigation */
-		mb_get_int(&(data->year),                 line,     4);
-		mb_get_int(&(data->jday),                 line+4,   3);
-		mb_get_int(&(data->hour),                 line+7,   2);
-		mb_get_int(&(data->minute),               line+9,   2);
-		mb_get_int(&(data->msec),                 line+11,  5);
-		ns = line[16];
-		mb_get_int(&degrees,    line+17,2);
-		mb_get_int(&minutes,    line+19,6);
-		data->latitude = degrees + 0.0001*minutes/60.;
-		if (ns == 's' || ns == 'S')
-			data->latitude = -data->latitude;
-		ew = line[25];
-		mb_get_int(&degrees,    line+26,3);
-		mb_get_int(&minutes,    line+29,6);
-		data->longitude = degrees + 0.0001*minutes/60.;
-		if (ew == 'W' || ns == 'w')
-			data->longitude = -data->longitude;
-		mb_get_int(&(data->speed),                 line+35,7);
-
-		/* now get other stuff */
-		mb_get_int(&(data->num_beams),            line+42,  4);
-		data->svp_corr_beams = line[46];
-		data->frequency[0] = line[47];
-		data->frequency[1] = line[48];
-		mb_get_int(&(data->heave),                line+49,  6);
-		for (i=0;i<2;i++)
-			data->spare_dr[i] = line[55+i];
-		data->range_scale = line[57];
-		mb_get_int(&(data->surface_sound_velocity),line+58,6);
-		data->ssv_source = line[64];
-		data->depth_gate_mode = line[65];
-
-		/* handle 12 kHz parameters if not in 36 kHz mode */
-		shift = 66;
-		if (data->frequency[0] != 'H')
-		  {
-		  mb_get_int(&(data->ping_gain_12khz),    line+shift,    2);
-		  mb_get_int(&(data->ping_pulse_width_12khz),
-							  line+2+shift,  2);
-		  mb_get_int(&(data->transmitter_attenuation_12khz),
-							  line+4+shift,  2);
-		  mb_get_int(&(data->pitch_12khz),        line+6+shift,  6);
-		  mb_get_int(&(data->roll_12khz),         line+12+shift, 6);
-		  mb_get_int(&(data->heading_12khz),      line+18+shift, 6);
-		  shift = shift + 24;
-		  }
-
-		/* handle 36 kHz parameters if if in 36 kHz
-			or dual frequency mode */
-		else
-		  {
-		  mb_get_int(&(data->ping_gain_36khz),    line+shift,    2);
-		  mb_get_int(&(data->ping_pulse_width_36khz),
-							  line+2+shift,  2);
-		  mb_get_int(&(data->transmitter_attenuation_36khz),
-							  line+4+shift,  2);
-		  mb_get_int(&(data->pitch_36khz),        line+6+shift,  6);
-		  mb_get_int(&(data->roll_36khz),         line+12+shift, 6);
-		  mb_get_int(&(data->heading_36khz),      line+18+shift, 6);
-		  shift = shift + 24;
-		  }
-
-		/* now get last things in header */
-		mb_get_int(&(data->num_algorithms),       line+shift,  1);
-		for (i=0;i<4;i++)
-			data->algorithm_order[i] = line[1+shift+i];
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       year:             %d\n",data->year);
-		fprintf(stderr,"dbg5       julian day:       %d\n",data->jday);
-		fprintf(stderr,"dbg5       hour:             %d\n",data->hour);
-		fprintf(stderr,"dbg5       minute:           %d\n",
-			data->minute);
-		fprintf(stderr,"dbg5       msec:             %d\n",data->msec);
-		fprintf(stderr,"dbg5       latitude:         %f\n",
-			data->latitude);
-		fprintf(stderr,"dbg5       longitude:        %f\n",
-			data->longitude);
-		fprintf(stderr,"dbg5       speed:            %d\n",
-			data->speed);
-		fprintf(stderr,"dbg5       num_beams:        %d\n",
-			data->num_beams);
-		fprintf(stderr,"dbg5       svp_corr_beams:   %c\n",
-			data->svp_corr_beams);
-		fprintf(stderr,"dbg5       frequency:        %c%c\n",
-			data->frequency[0],data->frequency[1]);
-		fprintf(stderr,"dbg5       heave:            %d\n",
-			data->heave);
-		fprintf(stderr,"dbg5       spare:            ");
-		for (i=0;i<2;i++)
-			fprintf(stderr,"%c",data->spare_dr[i]);
-		fprintf(stderr,"\n");
-		fprintf(stderr,"dbg5       range_scale:      %c\n",
-			data->range_scale);
-		fprintf(stderr,"dbg5       surface_sound_velocity: %d\n",
-			data->surface_sound_velocity);
-		fprintf(stderr,"dbg5       ssv_source:       %c\n",
-			data->ssv_source);
-		fprintf(stderr,"dbg5       depth_gate_mode:  %c\n",
-			data->depth_gate_mode);
-		fprintf(stderr,"dbg5       ping_gain_12khz:  %d\n",
-			data->ping_gain_12khz);
-		fprintf(stderr,"dbg5       ping_pulse_width_12khz:        %d\n",
-			data->ping_pulse_width_12khz);
-		fprintf(stderr,"dbg5       transmitter_attenuation_12khz: %d\n",
-			data->transmitter_attenuation_12khz);
-		fprintf(stderr,"dbg5       pitch_12khz:      %d\n",
-			data->pitch_12khz);
-		fprintf(stderr,"dbg5       roll_12khz:       %d\n",
-			data->roll_12khz);
-		fprintf(stderr,"dbg5       heading_12khz:    %d\n",
-			data->heading_12khz);
-		fprintf(stderr,"dbg5       ping_gain_36khz:  %d\n",
-			data->ping_gain_36khz);
-		fprintf(stderr,"dbg5       ping_pulse_width_36khz:        %d\n",
-			data->ping_pulse_width_36khz);
-		fprintf(stderr,"dbg5       transmitter_attenuation_36khz: %d\n",
-			data->transmitter_attenuation_36khz);
-		fprintf(stderr,"dbg5       pitch_36khz:      %d\n",
-			data->pitch_36khz);
-		fprintf(stderr,"dbg5       roll_36khz:       %d\n",
-			data->roll_36khz);
-		fprintf(stderr,"dbg5       heading_36khz:    %d\n",
-			data->heading_36khz);
-		fprintf(stderr,"dbg5       num_algorithms:   %d\n",
-			data->num_algorithms);
-		fprintf(stderr,"dbg5       algorithm_order:  ");
-		for (i=0;i<4;i++)
-			fprintf(stderr,"%c",data->algorithm_order[i]);
-		fprintf(stderr,"\n");
-		}
-
-	/* read and parse data from subsequent lines of record
-		- one line per beam */
-	for (i=0;i<data->num_beams;i++)
-	  {
-	  if ((status = mbr_sb2100rw_read_line(verbose,mbfp,1,line,error))
-		== MB_SUCCESS)
-		{
-		data->source[i] = line[0];
-		mb_get_int(&(data->travel_time[i]),      line+1,  5);
-		mb_get_int(&(data->angle_across[i]),     line+6,  6);
-		mb_get_int(&(data->angle_forward[i]),    line+12, 5);
-		mb_get_int(&(data->depth[i]),            line+17, 5);
-		mb_get_int(&(data->acrosstrack_beam[i]), line+22, 6);
-		mb_get_int(&(data->alongtrack_beam[i]),  line+28, 6);
-		mb_get_int(&(data->amplitude_beam[i]),   line+34, 3);
-		mb_get_int(&(data->signal_to_noise[i]),  line+37, 2);
-		mb_get_int(&(data->echo_length[i]),      line+39, 3);
-		data->quality[i] = line[42];
-		}
-	  }
-
-	/* make sure the rest of the beam arrays are null */
-	/** This reads too far????
-	for (i=data->num_beams;i<MBSYS_SB2100_BEAMS;i++)
-	  {
-	  if ((status = mbr_sb2100rw_read_line(verbose,mbfp,1,line,error))
-		== MB_SUCCESS)
-		{
-		data->source[i] = ' ';
-		data->travel_time[i] = 0;
-		data->angle_across[i] = 0;
-		data->angle_forward[i] = 0;
-		data->depth[i] = 0;
-		data->acrosstrack_beam[i] = 0;
-		data->alongtrack_beam[i] = 0;
-		data->amplitude_beam[i] = 0;
-		data->signal_to_noise[i] = 0;
-		data->echo_length[i] = 0;
-		data->quality[i] = '0';
-		}
-	  }
-	**/
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"dbg5       beam src tt angle angfor depth xtrack ltrack amp sig2noise echo quality\n");
-		for (i=0;i<data->num_beams;i++)
-		  {
-		  fprintf(stderr,"dbg5       %3d %c %5d %6d %5d %5d %6d %6d %3d %2d %3d %c\n",
-			i,
-			data->source[i],
-			data->travel_time[i],
-			data->angle_across[i],
-			data->angle_forward[i],
-			data->depth[i],
-			data->acrosstrack_beam[i],
-			data->alongtrack_beam[i],
-			data->amplitude_beam[i],
-			data->signal_to_noise[i],
-			data->echo_length[i],
-			data->quality[i]);
-		  }
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_sb2100rw_rd_ss(int verbose, FILE *mbfp,
-		struct mbf_sb2100rw_struct *data, int *error)
-{
-	char	*function_name = "mbr_sb2100rw_rd_ss";
-	int	status = MB_SUCCESS;
-	char	line[MBF_SB2100RW_MAXLINE];
-	int	shift;
-	char	ew, ns;
-	unsigned short	read_ss[2*MBF_SB2100RW_PIXELS+2];
-	char	*char_ptr;
-	short	*read_ss_ptr;
-	int	degrees, minutes;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       data:       %p\n",(void *)data);
-		}
-
-	/* read and parse data from first line of record */
-	status = mbr_sb2100rw_read_line(verbose,mbfp,1,line,error);
-
-	/* parse data from first line */
-	if (status == MB_SUCCESS)
-		{
-		/* get time and navigation */
-		mb_get_int(&(data->year),                 line,     4);
-		mb_get_int(&(data->jday),                 line+4,   3);
-		mb_get_int(&(data->hour),                 line+7,   2);
-		mb_get_int(&(data->minute),               line+9,   2);
-		mb_get_int(&(data->msec),                 line+11,  5);
-		ns = line[16];
-		mb_get_int(&degrees,    line+17,2);
-		mb_get_int(&minutes,    line+19,6);
-		data->latitude = degrees + 0.0001*minutes/60.;
-		if (ns == 's' || ns == 'S')
-			data->latitude = -data->latitude;
-		ew = line[25];
-		mb_get_int(&degrees,    line+26,3);
-		mb_get_int(&minutes,    line+29,6);
-		data->longitude = degrees + 0.0001*minutes/60.;
-		if (ew == 'W' || ns == 'w')
-			data->longitude = -data->longitude;
-		mb_get_int(&(data->speed),                 line+35,  7);
-
-		/* now get other stuff */
-		mb_get_int(&(data->ss_data_length),        line+42,  4);
-		data->num_pixels = (data->ss_data_length)/4;
-
-		data->svp_corr_beams = line[46];
-		data->frequency[0] = line[47];
-		data->frequency[1] = line[48];
-		mb_get_int(&(data->heave),                 line+49,  6);
-		if (line[55] != ' ')
-		    data->range_scale = line[55];
-		data->spare_ss = line[56];
-		data->pixel_size_scale = line[57];
-		data->pixel_algorithm = line[58];
-		mb_get_int(&(data->surface_sound_velocity),line+59,6);
-		data->ssv_source = line[65];
-		data->depth_gate_mode = line[66];
-
-		/* handle 12 kHz parameters if not in 36 kHz mode */
-		shift = 67;
-		if (data->frequency[0] != 'H')
-		  {
-		  mb_get_int(&(data->num_pixels_12khz),   line+shift,     4);
-		  mb_get_double(&(data->pixel_size_12khz),line+4+shift,   4);
-		  mb_get_int(&(data->ping_gain_12khz),    line+8+shift,   2);
-		  mb_get_int(&(data->ping_pulse_width_12khz),
-							  line+10+shift,   2);
-		  mb_get_int(&(data->transmitter_attenuation_12khz),
-							  line+12+shift,  2);
-		  mb_get_int(&(data->pitch_12khz),        line+14+shift,  6);
-		  mb_get_int(&(data->roll_12khz),         line+20+shift,  6);
-		  mb_get_int(&(data->heading_12khz),      line+26+shift,  6);
-		  shift = shift + 32;
-		  }
-
-		/* handle 36 kHz parameters if if in 36 kHz
-			or dual frequency mode */
-		else
-		  {
-		  mb_get_int(&(data->num_pixels_36khz),   line+shift,  4);
-		  mb_get_double(&(data->pixel_size_36khz),line+4+shift,  4);
-		  mb_get_int(&(data->ping_gain_36khz),    line+8+shift,2);
-		  mb_get_int(&(data->ping_pulse_width_36khz),
-							  line+10+shift,2);
-		  mb_get_int(&(data->transmitter_attenuation_36khz),
-							  line+12+shift,2);
-		  mb_get_int(&(data->pitch_36khz),        line+14+shift,6);
-		  mb_get_int(&(data->roll_36khz),         line+20+shift,6);
-		  mb_get_int(&(data->heading_36khz),      line+26+shift,6);
-		  shift = shift + 32;
-		  }
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       year:             %d\n",data->year);
-		fprintf(stderr,"dbg5       julian day:       %d\n",data->jday);
-		fprintf(stderr,"dbg5       hour:             %d\n",data->hour);
-		fprintf(stderr,"dbg5       minute:           %d\n",
-			data->minute);
-		fprintf(stderr,"dbg5       msec:             %d\n",data->msec);
-		fprintf(stderr,"dbg5       latitude:         %f\n",
-			data->latitude);
-		fprintf(stderr,"dbg5       longitude:        %f\n",
-			data->longitude);
-		fprintf(stderr,"dbg5       speed:            %d\n",
-			data->speed);
-		fprintf(stderr,"dbg5       num_pixels:       %d\n",
-			data->num_pixels);
-		fprintf(stderr,"dbg5       svp_corr_beams:   %c\n",
-			data->svp_corr_beams);
-		fprintf(stderr,"dbg5       frequency:        %c%c\n",
-			data->frequency[0],data->frequency[1]);
-		fprintf(stderr,"dbg5       heave:            %d\n",
-			data->heave);
-		fprintf(stderr,"dbg5       range_scale:      %c\n",
-			data->range_scale);
-		fprintf(stderr,"dbg5       spare_ss:         %c\n",
-			data->spare_ss);
-		fprintf(stderr,"dbg5       pixel_size_scale: %c\n",
-			data->pixel_size_scale);
-		fprintf(stderr,"dbg5       pixel_algorithm:  %c\n",
-			data->pixel_algorithm);
-		fprintf(stderr,"dbg5       surface_sound_velocity: %d\n",
-			data->surface_sound_velocity);
-		fprintf(stderr,"dbg5       ssv_source:       %c\n",
-			data->ssv_source);
-		fprintf(stderr,"dbg5       depth_gate_mode:  %c\n",
-			data->depth_gate_mode);
-		fprintf(stderr,"dbg5       num_pixels_12khz: %d\n",
-			data->num_pixels_12khz);
-		fprintf(stderr,"dbg5       pixel_size_12khz: %f\n",
-			data->pixel_size_12khz);
-		fprintf(stderr,"dbg5       ping_gain_12khz:  %d\n",
-			data->ping_gain_12khz);
-		fprintf(stderr,"dbg5       ping_pulse_width_12khz:        %d\n",
-			data->ping_pulse_width_12khz);
-		fprintf(stderr,"dbg5       transmitter_attenuation_12khz: %d\n",
-			data->transmitter_attenuation_12khz);
-		fprintf(stderr,"dbg5       pitch_12khz:      %d\n",
-			data->pitch_12khz);
-		fprintf(stderr,"dbg5       roll_12khz:       %d\n",
-			data->roll_12khz);
-		fprintf(stderr,"dbg5       heading_12khz:    %d\n",
-			data->heading_12khz);
-		fprintf(stderr,"dbg5       num_pixels_36khz: %d\n",
-			data->num_pixels_36khz);
-		fprintf(stderr,"dbg5       pixel_size_36khz: %f\n",
-			data->pixel_size_36khz);
-		fprintf(stderr,"dbg5       ping_gain_36khz:  %d\n",
-			data->ping_gain_36khz);
-		fprintf(stderr,"dbg5       ping_pulse_width_36khz:        %d\n",
-			data->ping_pulse_width_36khz);
-		fprintf(stderr,"dbg5       transmitter_attenuation_36khz: %d\n",
-			data->transmitter_attenuation_36khz);
-		fprintf(stderr,"dbg5       pitch_36khz:      %d\n",
-			data->pitch_36khz);
-		fprintf(stderr,"dbg5       roll_36khz:       %d\n",
-			data->roll_36khz);
-		fprintf(stderr,"dbg5       heading_36khz:    %d\n",
-			data->heading_36khz);
-		fprintf(stderr,"dbg5       ss_data_length:   %d\n",
-			data->ss_data_length);
-		}
-
-	/* read sidescan data from character array */
-	if ((status = fread(read_ss,1,data->ss_data_length+2,
-		mbfp)) != data->ss_data_length+2)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-	else
-		{
-		status = MB_SUCCESS;
-		*error = MB_ERROR_NO_ERROR;
-		}
-
-	/* check for CR LF end of record - if out of place
-	    we have a broken record */
-	if (status == MB_SUCCESS)
-		{
-		char_ptr = ((char *) &read_ss[0]) + data->ss_data_length;
-		if (char_ptr[0] != '\r'
-			|| char_ptr[1] != '\n')
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_UNINTELLIGIBLE;
-			}
-		}
-
-	/* get the data */
-	if (status == MB_SUCCESS)
-		{
-		read_ss_ptr = (short *) read_ss;
-		for (i=0;i<data->num_pixels;i++)
-			{
-			/* deal with byte swapping if necessary */
-#ifdef BYTESWAPPED
-                        data->amplitude_ss[i] =
-				(int) mb_swap_short(read_ss[2*i]);
-                        data->alongtrack_ss[i] =
-				(int) ((short) mb_swap_short(read_ss_ptr[2*i+1]));
-#else
-			data->amplitude_ss[i] = (int) read_ss[2*i];
-			data->alongtrack_ss[i] = (int) read_ss_ptr[2*i+1];
-#endif
-	  		}
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"dbg5       beam amp_ss ltrack\n");
-		for (i=0;i<data->num_pixels;i++)
-		  {
-		  fprintf(stderr,"dbg5       %3d %6d %6d\n",
-			i,
-			data->amplitude_ss[i],
-			data->alongtrack_ss[i]);
-		  }
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_sb2100rw_wr_data(int verbose, void *mbio_ptr, void *data_ptr, int *error)
-{
-	char	*function_name = "mbr_sb2100rw_wr_data";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_sb2100rw_struct *data;
-	FILE	*mbfp;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       data_ptr:   %p\n",(void *)data_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_sb2100rw_struct *) data_ptr;
-	mbfp = mb_io_ptr->mbfp;
-
-	if (data->kind == MB_DATA_RAW_LINE)
-		{
-		status = mbr_sb2100rw_wr_rawline(verbose,mbfp,data,error);
-		}
-	else if (data->kind == MB_DATA_VELOCITY_PROFILE)
-		{
-		status = mbr_sb2100rw_wr_pr(verbose,mbfp,data,error);
-		}
-	else if (data->kind == MB_DATA_COMMENT)
-		{
-		status = mbr_sb2100rw_wr_tr(verbose,mbfp,data,error);
-		}
-	else if (data->kind == MB_DATA_DATA)
-		{
-		status = mbr_sb2100rw_wr_dr(verbose,mbfp,data,error);
-		status = mbr_sb2100rw_wr_ss(verbose,mbfp,data,error);
-		}
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_BAD_KIND;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Data record kind in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       kind:       %d\n",data->kind);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int	mbr_sb2100rw_wr_label(int verbose, FILE *mbfp, char type, int *error)
-{
-	char	*function_name = "mbr_sb2100rw_wr_label";
-	int	status = MB_SUCCESS;
-	char	line[MBF_SB2100RW_MAXLINE];
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       type:       %d\n",(int)type);
-		}
-
-	/* write label in file */
-	sprintf(line,"%8s\r\n",mbf_sb2100rw_labels[(int)type]);
-	status = mbr_sb2100rw_write_line(verbose,mbfp,line,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int	mbr_sb2100rw_write_line(int verbose, FILE *mbfp, char *line, int *error)
-{
-	char	*function_name = "mbr_sb2100rw_write_line";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       line:       %s\n",line);
-		}
-
-	/* write next line in file */
-	if ((status = fputs(line,mbfp)) != EOF)
-		{
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-		}
-	else
-		{
-		*error = MB_ERROR_WRITE_FAIL;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_sb2100rw_wr_rawline(int verbose, FILE *mbfp, void *data_ptr, int *error)
-{
-	char	*function_name = "mbr_sb2100rw_wr_rawline";
-	int	status = MB_SUCCESS;
-	struct mbf_sb2100rw_struct *data;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       data_ptr:   %p\n",(void *)data_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_sb2100rw_struct *) data_ptr;
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       raw line:         %s\n",
-			data->comment);
-		}
-
-	/* write out the data */
-	if (status == MB_SUCCESS)
-		{
-		/* output the line */
-		status = fprintf(mbfp,"%s\n",data->comment);
-		if (status >= 0)
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		else
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_sb2100rw_wr_pr(int verbose, FILE *mbfp, void *data_ptr, int *error)
-{
-	char	*function_name = "mbr_sb2100rw_wr_pr";
-	int	status = MB_SUCCESS;
-	struct mbf_sb2100rw_struct *data;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       data_ptr:   %p\n",(void *)data_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_sb2100rw_struct *) data_ptr;
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       year:             %d\n",data->year);
-		fprintf(stderr,"dbg5       julian day:       %d\n",data->jday);
-		fprintf(stderr,"dbg5       hour:             %d\n",data->hour);
-		fprintf(stderr,"dbg5       minute:           %d\n",data->minute);
-		fprintf(stderr,"dbg5       msec:             %d\n",data->msec);
-		fprintf(stderr,"dbg5       roll_bias_port:   %d\n",data->roll_bias_port);
-		fprintf(stderr,"dbg5       roll_bias_strbrd: %d\n",data->roll_bias_starboard);
-		fprintf(stderr,"dbg5       pitch_bias:       %d\n",data->pitch_bias);
-		fprintf(stderr,"dbg5       ship_draft:       %d\n",data->ship_draft);
-		fprintf(stderr,"dbg5       num_svp:          %d\n",data->num_svp);
-		fprintf(stderr,"dbg5       Sound Velocity Profile:\n");
-		for (i=0;i<data->num_svp;i++)
-			fprintf(stderr,"dbg5       %d  depth:%d  velocity:%d\n",
-				i,data->vdepth[i],data->velocity[i]);
-		}
-
-	/* write the record label */
-	status = mbr_sb2100rw_wr_label(verbose,mbfp,
-		MBF_SB2100RW_PR,error);
-
-	/* write out the data */
-	if (status == MB_SUCCESS)
-		{
-		/* output the first line */
-		status = fprintf(mbfp,"%4.4d",data->year);
-		status = fprintf(mbfp,"%3.3d",data->jday);
-		status = fprintf(mbfp,"%2.2d",data->hour);
-		status = fprintf(mbfp,"%2.2d",data->minute);
-		status = fprintf(mbfp,"%5.5d",data->msec);
-		status = fprintf(mbfp,"%+06d",data->roll_bias_port);
-		status = fprintf(mbfp,"%+06d",data->pitch_bias);
-		status = fprintf(mbfp,"%2.2d",data->num_svp);
-		status = fprintf(mbfp,"%7.7d",data->ship_draft);
-		status = fprintf(mbfp,"\r\n");
-
-		/* output the second line */
-		for (i=0;i<data->num_svp;i++)
-			{
-			status = fprintf(mbfp,"%7.7d",data->vdepth[i]);
-			status = fprintf(mbfp,"%6.6d",data->velocity[i]);
-			status = fprintf(mbfp,"\r\n");
-			}
-
-		/* check for an error */
-		if (status > 0)
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		else
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_sb2100rw_wr_tr(int verbose, FILE *mbfp, void *data_ptr, int *error)
-{
-	char	*function_name = "mbr_sb2100rw_wr_tr";
-	int	status = MB_SUCCESS;
-	struct mbf_sb2100rw_struct *data;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       data_ptr:   %p\n",(void *)data_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_sb2100rw_struct *) data_ptr;
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       comment:          %s\n",
-			data->comment);
-		}
-
-	/* write the record label */
-	status = mbr_sb2100rw_wr_label(verbose,mbfp,
-		MBF_SB2100RW_TR,error);
-
-	/* write out the data */
-	if (status == MB_SUCCESS)
-		{
-		/* output the event line */
-		status = fprintf(mbfp,"%s\r\n",data->comment);
-
-		/* check for an error */
-		if (status >= 0)
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		else
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_sb2100rw_wr_dr(int verbose, FILE *mbfp, void *data_ptr, int *error)
-{
-	char	*function_name = "mbr_sb2100rw_wr_dr";
-	int	status = MB_SUCCESS;
-	struct mbf_sb2100rw_struct *data;
-	double	degrees;
-	int	idegrees, minutes;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       data_ptr:   %p\n",(void *)data_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_sb2100rw_struct *) data_ptr;
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       year:             %d\n",data->year);
-		fprintf(stderr,"dbg5       julian day:       %d\n",data->jday);
-		fprintf(stderr,"dbg5       hour:             %d\n",data->hour);
-		fprintf(stderr,"dbg5       minute:           %d\n",
-			data->minute);
-		fprintf(stderr,"dbg5       msec:             %d\n",data->msec);
-		fprintf(stderr,"dbg5       latitude:         %f\n",
-			data->latitude);
-		fprintf(stderr,"dbg5       longitude:        %f\n",
-			data->longitude);
-		fprintf(stderr,"dbg5       speed:            %d\n",
-			data->speed);
-		fprintf(stderr,"dbg5       num_beams:        %d\n",
-			data->num_beams);
-		fprintf(stderr,"dbg5       svp_corr_beams:   %c\n",
-			data->svp_corr_beams);
-		fprintf(stderr,"dbg5       frequency:        %c%c\n",
-			data->frequency[0],data->frequency[1]);
-		fprintf(stderr,"dbg5       heave:            %d\n",
-			data->heave);
-		fprintf(stderr,"dbg5       spare:            ");
-		for (i=0;i<2;i++)
-			fprintf(stderr,"%c",data->spare_dr[i]);
-		fprintf(stderr,"\n");
-		fprintf(stderr,"dbg5       range_scale:      %c\n",
-			data->range_scale);
-		fprintf(stderr,"dbg5       num_algorithms:   %d\n",
-			data->num_algorithms);
-		fprintf(stderr,"dbg5       algorithm_order:  ");
-		for (i=0;i<4;i++)
-			fprintf(stderr,"%c",data->algorithm_order[i]);
-		fprintf(stderr,"\n");
-		fprintf(stderr,"dbg5       ping_gain_12khz:  %d\n",
-			data->ping_gain_12khz);
-		fprintf(stderr,"dbg5       ping_pulse_width_12khz:        %d\n",
-			data->ping_pulse_width_12khz);
-		fprintf(stderr,"dbg5       transmitter_attenuation_12khz: %d\n",
-			data->transmitter_attenuation_12khz);
-		fprintf(stderr,"dbg5       pitch_12khz:      %d\n",
-			data->pitch_12khz);
-		fprintf(stderr,"dbg5       roll_12khz:       %d\n",
-			data->roll_12khz);
-		fprintf(stderr,"dbg5       heading_12khz:    %d\n",
-			data->heading_12khz);
-		fprintf(stderr,"dbg5       ping_gain_36khz:  %d\n",
-			data->ping_gain_36khz);
-		fprintf(stderr,"dbg5       ping_pulse_width_36khz:        %d\n",
-			data->ping_pulse_width_36khz);
-		fprintf(stderr,"dbg5       transmitter_attenuation_36khz: %d\n",
-			data->transmitter_attenuation_36khz);
-		fprintf(stderr,"dbg5       pitch_36khz:      %d\n",
-			data->pitch_36khz);
-		fprintf(stderr,"dbg5       roll_36khz:       %d\n",
-			data->roll_36khz);
-		fprintf(stderr,"dbg5       heading_36khz:    %d\n",
-			data->heading_36khz);
-		fprintf(stderr,"dbg5       surface_sound_velocity: %d\n",
-			data->surface_sound_velocity);
-		fprintf(stderr,"dbg5       ssv_source:       %c\n",
-			data->ssv_source);
-		fprintf(stderr,"dbg5       depth_gate_mode:  %c\n",
-			data->depth_gate_mode);
-		fprintf(stderr,"dbg5       beam src tt angle angfor depth xtrack ltrack amp sig2noise echo quality\n");
-		for (i=0;i<data->num_beams;i++)
-		  {
-		  fprintf(stderr,"dbg5       %3d %c %5d %6d %5d %5d %6d %6d %3d %2d %3d %c\n",
-			i,
-			data->source[i],
-			data->travel_time[i],
-			data->angle_across[i],
-			data->angle_forward[i],
-			data->depth[i],
-			data->acrosstrack_beam[i],
-			data->alongtrack_beam[i],
-			data->amplitude_beam[i],
-			data->signal_to_noise[i],
-			data->echo_length[i],
-			data->quality[i]);
-		  }
-		}
-
-	/* write the record label */
-	status = mbr_sb2100rw_wr_label(verbose,mbfp,
-		MBF_SB2100RW_DR,error);
-
-	/* write out the data */
-	if (status == MB_SUCCESS)
-		{
-		/* output the first line */
-		status = fprintf(mbfp,"%4.4d",data->year);
-		status = fprintf(mbfp,"%3.3d",data->jday);
-		status = fprintf(mbfp,"%2.2d",data->hour);
-		status = fprintf(mbfp,"%2.2d",data->minute);
-		status = fprintf(mbfp,"%5.5d",data->msec);
-		degrees = data->latitude;
-		if (degrees < 0.0)
-			{
-			status = fprintf(mbfp,"S");
-			degrees = -degrees;
-			}
-		else
-			status = fprintf(mbfp,"N");
-		idegrees = (int) degrees;
-		minutes = (int) (600000.0*(degrees - idegrees) + 0.5);
-		status = fprintf(mbfp,"%2.2d",idegrees);
-		status = fprintf(mbfp,"%6.6d",minutes);
-		degrees = data->longitude;
-		if (degrees < -180.0)
-			degrees = degrees + 360.0;
-		if (degrees > 180.0)
-			degrees = degrees - 360.0;
-		if (degrees < 0.0)
-			{
-			status = fprintf(mbfp,"W");
-			degrees = -degrees;
-			}
-		else
-			status = fprintf(mbfp,"E");
-		idegrees = (int) degrees;
-		minutes = (int) (600000.0*(degrees - idegrees) + 0.5);
-		status = fprintf(mbfp,"%3.3d",idegrees);
-		status = fprintf(mbfp,"%6.6d",minutes);
-		if (data->speed > 999999 || data->speed < -999999)
-			data->speed = 0;
-		status = fprintf(mbfp,"%+07d",data->speed);
-
-		status = fprintf(mbfp,"%4.4d",data->num_beams);
-		status = fprintf(mbfp,"%c",data->svp_corr_beams);
-		status = fprintf(mbfp,"%c%c",
-			data->frequency[0],data->frequency[1]);
-		status = fprintf(mbfp,"%+06d",data->heave);
-		for (i=0;i<2;i++)
-			status = fprintf(mbfp,"%c",data->spare_dr[i]);
-		status = fprintf(mbfp,"%c",data->range_scale);
-		status = fprintf(mbfp,"%6.6d",data->surface_sound_velocity);
-		status = fprintf(mbfp,"%c",data->ssv_source);
-		status = fprintf(mbfp,"%c",data->depth_gate_mode);
-		if (data->frequency[0] != 'H')
-			{
-			status = fprintf(mbfp,"%2.2d",data->ping_gain_12khz);
-			status = fprintf(mbfp,"%2.2d",
-				data->ping_pulse_width_12khz);
-			status = fprintf(mbfp,"%02d",
-				data->transmitter_attenuation_12khz);
-			status = fprintf(mbfp,"%+06d",data->pitch_12khz);
-			status = fprintf(mbfp,"%+06d",data->roll_12khz);
-			status = fprintf(mbfp,"%6.6d",data->heading_12khz);
-			}
-		else
-			{
-			status = fprintf(mbfp,"%2.2d",data->ping_gain_36khz);
-			status = fprintf(mbfp,"%2.2d",data->
-				ping_pulse_width_36khz);
-			status = fprintf(mbfp,"%02d",
-				data->transmitter_attenuation_36khz);
-			status = fprintf(mbfp,"%+06d",data->pitch_36khz);
-			status = fprintf(mbfp,"%+06d",data->roll_36khz);
-			status = fprintf(mbfp,"%6.6d",data->heading_36khz);
-			}
-		status = fprintf(mbfp,"%1d",data->num_algorithms);
-		for (i=0;i<4;i++)
-			status = fprintf(mbfp,"%c",data->algorithm_order[i]);
-		status = fprintf(mbfp,"\r\n");
-
-		/* output a line for each beam */
-		for (i=0;i<data->num_beams;i++)
-			{
-			if (data->quality[i] == '0')
-				{
-				status = fprintf(mbfp,"                                          0\r\n");
-				}
-			else
-				{
-			        status = fprintf(mbfp,"%c",data->source[i]);
-				status = fprintf(mbfp,"%5.5d",data->travel_time[i]);
-				status = fprintf(mbfp,"%+06d",data->angle_across[i]);
-				status = fprintf(mbfp,"%+05d",data->angle_forward[i]);
-				status = fprintf(mbfp,"%5.5d",data->depth[i]);
-				status = fprintf(mbfp,"%+06d",data->acrosstrack_beam[i]);
-				status = fprintf(mbfp,"%+06d",data->alongtrack_beam[i]);
-				status = fprintf(mbfp,"%3.3d",data->amplitude_beam[i]);
-				status = fprintf(mbfp,"%2.2d",data->signal_to_noise[i]);
-				status = fprintf(mbfp,"%3.3d",data->echo_length[i]);
-				status = fprintf(mbfp,"%c",data->quality[i]);
-				status = fprintf(mbfp,"\r\n");
-				}
-			}
-
-		/* check for an error */
-		if (status > 0)
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		else
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_sb2100rw_wr_ss(int verbose, FILE *mbfp, void *data_ptr, int *error)
-{
-	char	*function_name = "mbr_sb2100rw_wr_ss";
-	int	status = MB_SUCCESS;
-	struct mbf_sb2100rw_struct *data;
-	unsigned short	write_ss[2*MBF_SB2100RW_PIXELS];
-	short	*write_ss_ptr;
-	double	degrees;
-	int	idegrees, minutes;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbfp:       %p\n",(void *)mbfp);
-		fprintf(stderr,"dbg2       data_ptr:   %p\n",(void *)data_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_sb2100rw_struct *) data_ptr;
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       year:             %d\n",data->year);
-		fprintf(stderr,"dbg5       julian day:       %d\n",data->jday);
-		fprintf(stderr,"dbg5       hour:             %d\n",data->hour);
-		fprintf(stderr,"dbg5       minute:           %d\n",
-			data->minute);
-		fprintf(stderr,"dbg5       msec:             %d\n",data->msec);
-		fprintf(stderr,"dbg5       latitude:         %f\n",
-			data->latitude);
-		fprintf(stderr,"dbg5       longitude:        %f\n",
-			data->longitude);
-		fprintf(stderr,"dbg5       speed:            %d\n",
-			data->speed);
-		fprintf(stderr,"dbg5       num_pixels:       %d\n",
-			data->num_pixels);
-		fprintf(stderr,"dbg5       ss_data_length:   %d\n",
-			data->ss_data_length);
-		fprintf(stderr,"dbg5       svp_corr_beams:   %c\n",
-			data->svp_corr_beams);
-		fprintf(stderr,"dbg5       frequency:        %c%c\n",
-			data->frequency[0],data->frequency[1]);
-		fprintf(stderr,"dbg5       heave:            %d\n",
-			data->heave);
-		fprintf(stderr,"dbg5       range_scale:      %c\n",
-			data->range_scale);
-		fprintf(stderr,"dbg5       spare_ss:         %c\n",
-			data->spare_ss);
-		fprintf(stderr,"dbg5       pixel_size_scale: %c\n",
-			data->pixel_size_scale);
-		fprintf(stderr,"dbg5       pixel_algorithm:  %c\n",
-			data->pixel_algorithm);
-		fprintf(stderr,"dbg5       surface_sound_velocity: %d\n",
-			data->surface_sound_velocity);
-		fprintf(stderr,"dbg5       ssv_source:       %c\n",
-			data->ssv_source);
-		fprintf(stderr,"dbg5       depth_gate_mode:  %c\n",
-			data->depth_gate_mode);
-		fprintf(stderr,"dbg5       num_pixels_12khz: %d\n",
-			data->num_pixels_12khz);
-		fprintf(stderr,"dbg5       pixel_size_12khz: %f\n",
-			data->pixel_size_12khz);
-		fprintf(stderr,"dbg5       ping_gain_12khz:  %d\n",
-			data->ping_gain_12khz);
-		fprintf(stderr,"dbg5       ping_pulse_width_12khz:        %d\n",
-			data->ping_pulse_width_12khz);
-		fprintf(stderr,"dbg5       transmitter_attenuation_12khz: %d\n",
-			data->transmitter_attenuation_12khz);
-		fprintf(stderr,"dbg5       pitch_12khz:      %d\n",
-			data->pitch_12khz);
-		fprintf(stderr,"dbg5       roll_12khz:       %d\n",
-			data->roll_12khz);
-		fprintf(stderr,"dbg5       heading_12khz:    %d\n",
-			data->heading_12khz);
-		fprintf(stderr,"dbg5       num_pixels_36khz: %d\n",
-			data->num_pixels_36khz);
-		fprintf(stderr,"dbg5       pixel_size_36khz: %f\n",
-			data->pixel_size_36khz);
-		fprintf(stderr,"dbg5       ping_gain_36khz:  %d\n",
-			data->ping_gain_36khz);
-		fprintf(stderr,"dbg5       ping_pulse_width_36khz:        %d\n",
-			data->ping_pulse_width_36khz);
-		fprintf(stderr,"dbg5       transmitter_attenuation_36khz: %d\n",
-			data->transmitter_attenuation_36khz);
-		fprintf(stderr,"dbg5       pitch_36khz:      %d\n",
-			data->pitch_36khz);
-		fprintf(stderr,"dbg5       roll_36khz:       %d\n",
-			data->roll_36khz);
-		fprintf(stderr,"dbg5       heading_36khz:    %d\n",
-			data->heading_36khz);
-		fprintf(stderr,"dbg5       beam amp_ss ltrack\n");
-		for (i=0;i<data->num_pixels;i++)
-		  {
-		  fprintf(stderr,"dbg5       %3d %6d %6d\n",
-			i,
-			data->amplitude_ss[i],
-			data->alongtrack_ss[i]);
-		  }
-		}
-
-	/* write the record label */
-	status = mbr_sb2100rw_wr_label(verbose,mbfp,
-		MBF_SB2100RW_SS,error);
-
-	/* write out the data */
-	if (status == MB_SUCCESS)
-		{
-		/* output the event line */
-		status = fprintf(mbfp,"%4.4d",data->year);
-		status = fprintf(mbfp,"%3.3d",data->jday);
-		status = fprintf(mbfp,"%2.2d",data->hour);
-		status = fprintf(mbfp,"%2.2d",data->minute);
-		status = fprintf(mbfp,"%5.5d",data->msec);
-		degrees = data->latitude;
-		if (degrees < 0.0)
-			{
-			status = fprintf(mbfp,"S");
-			degrees = -degrees;
-			}
-		else
-			status = fprintf(mbfp,"N");
-		idegrees = (int) degrees;
-		minutes = (int) (600000.0*(degrees - idegrees) + 0.5);
-		status = fprintf(mbfp,"%2.2d",idegrees);
-		status = fprintf(mbfp,"%6.6d",minutes);
-		degrees = data->longitude;
-		if (degrees < -180.0)
-			degrees = degrees + 360.0;
-		if (degrees > 180.0)
-			degrees = degrees - 360.0;
-		if (degrees < 0.0)
-			{
-			status = fprintf(mbfp,"W");
-			degrees = -degrees;
-			}
-		else
-			status = fprintf(mbfp,"E");
-		idegrees = (int) degrees;
-		minutes = (int) (600000.0*(degrees - idegrees) + 0.5);
-		status = fprintf(mbfp,"%3.3d",idegrees);
-		status = fprintf(mbfp,"%6.6d",minutes);
-		status = fprintf(mbfp,"%+07d",data->speed);
-		data->ss_data_length = 4*data->num_pixels;
-		status = fprintf(mbfp,"%4.4d",data->ss_data_length);
-		status = fprintf(mbfp,"%c",data->svp_corr_beams);
-		status = fprintf(mbfp,"%c%c",
-			data->frequency[0],data->frequency[1]);
-		status = fprintf(mbfp,"%+06d",data->heave);
-		status = fprintf(mbfp,"%c",data->range_scale);
-		status = fprintf(mbfp,"%c",data->spare_ss);
-		status = fprintf(mbfp,"%c",data->pixel_size_scale);
-		status = fprintf(mbfp,"%c",data->pixel_algorithm);
-		status = fprintf(mbfp,"%6.6d",data->surface_sound_velocity);
-		status = fprintf(mbfp,"%c",data->ssv_source);
-		status = fprintf(mbfp,"%c",data->depth_gate_mode);
-		if (data->frequency[0] != 'H')
-			{
-			status = fprintf(mbfp,"%4.4d",data->num_pixels_12khz);
-			if (data->pixel_size_12khz > 9.99)
-				status = fprintf(mbfp,"%4.1f",
-					data->pixel_size_12khz);
-			else if (data->pixel_size_12khz > 0.999)
-				status = fprintf(mbfp,"%4.2f",
-					data->pixel_size_12khz);
-			else
-				status = fprintf(mbfp,".%03d",
-					(int)(1000*data->pixel_size_12khz));
-			status = fprintf(mbfp,"%2.2d",data->ping_gain_12khz);
-			status = fprintf(mbfp,"%2.2d",
-				data->ping_pulse_width_12khz);
-			status = fprintf(mbfp,"%02d",
-				data->transmitter_attenuation_12khz);
-			status = fprintf(mbfp,"%+06d",data->pitch_12khz);
-			status = fprintf(mbfp,"%+06d",data->roll_12khz);
-			status = fprintf(mbfp,"%6.6d",data->heading_12khz);
-			}
-		else
-			{
-			status = fprintf(mbfp,"%4.4d",data->num_pixels_36khz);
-			if (data->pixel_size_36khz > 9.99)
-				status = fprintf(mbfp,"%4.1f",
-					data->pixel_size_36khz);
-			else if (data->pixel_size_36khz > 0.999)
-				status = fprintf(mbfp,"%4.2f",
-					data->pixel_size_36khz);
-			else
-				status = fprintf(mbfp,".%03d",
-					(int)(1000*data->pixel_size_36khz));
-			status = fprintf(mbfp,"%2.2d",data->ping_gain_36khz);
-			status = fprintf(mbfp,"%2.2d",data->
-				ping_pulse_width_36khz);
-			status = fprintf(mbfp,"%02d",
-				data->transmitter_attenuation_36khz);
-			status = fprintf(mbfp,"%+06d",data->pitch_36khz);
-			status = fprintf(mbfp,"%+06d",data->roll_36khz);
-			status = fprintf(mbfp,"%6.6d",data->heading_36khz);
-			}
-		status = fprintf(mbfp,"\r\n");
-
-		/* construct and write out sidescan data */
-		write_ss_ptr = (short *) write_ss;
-		for (i=0;i<data->num_pixels;i++)
-			{
-			/* deal with byte swapping if necessary */
-#ifdef BYTESWAPPED
-			write_ss[2*i] = mb_swap_short((unsigned short)
-				data->amplitude_ss[i]);
-			write_ss_ptr[2*i+1] = mb_swap_short((short)
-				data->alongtrack_ss[i]);
-#else
-			write_ss[2*i] = (unsigned short) data->amplitude_ss[i];
-			write_ss_ptr[2*i+1] = (short) data->alongtrack_ss[i];
-#endif
-	  		}
-		if ((status = fwrite(write_ss,1,data->ss_data_length,mbfp))
-			!= data->ss_data_length)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_EOF;
-			}
-		else
-			{
-			status = MB_SUCCESS;
-			*error = MB_ERROR_NO_ERROR;
-			status = fprintf(mbfp,"\r\n");
-			}
-
-
-		/* check for an error */
-		if (status > 0)
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		else
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mbr_sbifremr.c b/src/mbio/mbr_sbifremr.c
deleted file mode 100644
index fcaf6f9..0000000
--- a/src/mbio/mbr_sbifremr.c
+++ /dev/null
@@ -1,1077 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbr_sbifremr.c	3/29/96
- *	$Id: mbr_sbifremr.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1996-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbr_sbifremr.c contains the functions for reading and writing
- * multibeam data in the SBIFREMR format.
- * These functions include:
- *   mbr_alm_sbifremr	- allocate read/write memory
- *   mbr_dem_sbifremr	- deallocate read/write memory
- *   mbr_rt_sbifremr	- read and translate data
- *   mbr_wt_sbifremr	- translate and write data
- *
- * Author:	D. W. Caress
- * Date:	March 29, 1996
- * Location:	152 39.061W; 34 09.150S on R/V Ewing
- *
- * $Log: mbr_sbifremr.c,v $
- * Revision 5.8  2005/11/05 00:48:04  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.7  2003/05/20 18:05:32  caress
- * Added svp_source to data source parameters.
- *
- * Revision 5.6  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.5  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.4  2002/02/26 07:50:41  caress
- * Release 5.0.beta14
- *
- * Revision 5.3  2001/07/20 00:32:54  caress
- * Release 5.0.beta03
- *
- * Revision 5.2  2001/03/22  20:50:02  caress
- * Trying to make version 5.0.beta0
- *
- * Revision 5.1  2001/01/22  07:43:34  caress
- * Version 5.0.beta01
- *
- * Revision 5.0  2000/12/01  22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.8  2000/10/11  01:03:21  caress
- * Convert to ANSI C
- *
- * Revision 4.7  2000/09/30  06:34:20  caress
- * Snapshot for Dale.
- *
- * Revision 4.6  1999/03/31  18:11:35  caress
- * MB-System 4.6beta7
- *
- * Revision 4.5  1998/10/05  17:46:15  caress
- * MB-System version 4.6beta
- *
- * Revision 4.4  1997/07/28  15:04:13  caress
- * Fixed time_j typo.
- *
- * Revision 4.3  1997/07/25  14:19:53  caress
- * Version 4.5beta2.
- * Much mucking, particularly with Simrad formats.
- *
- * Revision 4.2  1997/04/21  17:02:07  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.1  1996/04/22  13:21:19  caress
- * Now have DTR and MIN/MAX defines in mb_define.h
- *
- * Revision 4.1  1996/04/22  13:21:19  caress
- * Now have DTR and MIN/MAX defines in mb_define.h
- *
- * Revision 4.0  1996/04/22  11:01:20  caress
- * Initial version.
- *
- * Revision 1.1  1996/04/22  10:57:09  caress
- * Initial revision
- *
- * Revision 4.4  1995/03/06  19:38:54  caress
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mb_define.h"
-#include "mbsys_sb.h"
-#include "mbf_sbifremr.h"
-
-/* angle spacing for SeaBeam Classic */
-#define	ANGLE_SPACING 3.75
-
-/* essential function prototypes */
-int mbr_register_sbifremr(int verbose, void *mbio_ptr,
-		int *error);
-int mbr_info_sbifremr(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_alm_sbifremr(int verbose, void *mbio_ptr, int *error);
-int mbr_dem_sbifremr(int verbose, void *mbio_ptr, int *error);
-int mbr_rt_sbifremr(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_wt_sbifremr(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_sbifremr_rd_data(int verbose, void *mbio_ptr, int *error);
-int mbr_sbifremr_wr_data(int verbose, void *mbio_ptr, int *error);
-
-static char rcs_id[]="$Id: mbr_sbifremr.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mbr_register_sbifremr(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_register_sbifremr";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* get mb_io_ptr */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set format info parameters */
-	status = mbr_info_sbifremr(verbose,
-			&mb_io_ptr->system,
-			&mb_io_ptr->beams_bath_max,
-			&mb_io_ptr->beams_amp_max,
-			&mb_io_ptr->pixels_ss_max,
-			mb_io_ptr->format_name,
-			mb_io_ptr->system_name,
-			mb_io_ptr->format_description,
-			&mb_io_ptr->numfile,
-			&mb_io_ptr->filetype,
-			&mb_io_ptr->variable_beams,
-			&mb_io_ptr->traveltime,
-			&mb_io_ptr->beam_flagging,
-			&mb_io_ptr->nav_source,
-			&mb_io_ptr->heading_source,
-			&mb_io_ptr->vru_source,
-			&mb_io_ptr->svp_source,
-			&mb_io_ptr->beamwidth_xtrack,
-			&mb_io_ptr->beamwidth_ltrack,
-			error);
-
-	/* set format and system specific function pointers */
-	mb_io_ptr->mb_io_format_alloc = &mbr_alm_sbifremr;
-	mb_io_ptr->mb_io_format_free = &mbr_dem_sbifremr;
-	mb_io_ptr->mb_io_store_alloc = &mbsys_sb_alloc;
-	mb_io_ptr->mb_io_store_free = &mbsys_sb_deall;
-	mb_io_ptr->mb_io_read_ping = &mbr_rt_sbifremr;
-	mb_io_ptr->mb_io_write_ping = &mbr_wt_sbifremr;
-	mb_io_ptr->mb_io_dimensions = &mbsys_sb_dimensions;
-	mb_io_ptr->mb_io_extract = &mbsys_sb_extract;
-	mb_io_ptr->mb_io_insert = &mbsys_sb_insert;
-	mb_io_ptr->mb_io_extract_nav = &mbsys_sb_extract_nav;
-	mb_io_ptr->mb_io_insert_nav = &mbsys_sb_insert_nav;
-	mb_io_ptr->mb_io_extract_altitude = &mbsys_sb_extract_altitude;
-	mb_io_ptr->mb_io_insert_altitude = NULL;
-	mb_io_ptr->mb_io_extract_svp = NULL;
-	mb_io_ptr->mb_io_insert_svp = NULL;
-	mb_io_ptr->mb_io_ttimes = &mbsys_sb_ttimes;
-	mb_io_ptr->mb_io_detects = &mbsys_sb_detects;
-	mb_io_ptr->mb_io_copyrecord = &mbsys_sb_copy;
-	mb_io_ptr->mb_io_extract_rawss = NULL;
-	mb_io_ptr->mb_io_insert_rawss = NULL;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",mb_io_ptr->system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",mb_io_ptr->beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",mb_io_ptr->beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",mb_io_ptr->pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",mb_io_ptr->format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",mb_io_ptr->system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",mb_io_ptr->format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",mb_io_ptr->numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",mb_io_ptr->filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",mb_io_ptr->variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",mb_io_ptr->traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",mb_io_ptr->beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",mb_io_ptr->nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",mb_io_ptr->heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",mb_io_ptr->vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",mb_io_ptr->svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",mb_io_ptr->beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",mb_io_ptr->beamwidth_ltrack);
-		fprintf(stderr,"dbg2       format_alloc:       %p\n",(void *)mb_io_ptr->mb_io_format_alloc);
-		fprintf(stderr,"dbg2       format_free:        %p\n",(void *)mb_io_ptr->mb_io_format_free);
-		fprintf(stderr,"dbg2       store_alloc:        %p\n",(void *)mb_io_ptr->mb_io_store_alloc);
-		fprintf(stderr,"dbg2       store_free:         %p\n",(void *)mb_io_ptr->mb_io_store_free);
-		fprintf(stderr,"dbg2       read_ping:          %p\n",(void *)mb_io_ptr->mb_io_read_ping);
-		fprintf(stderr,"dbg2       write_ping:         %p\n",(void *)mb_io_ptr->mb_io_write_ping);
-		fprintf(stderr,"dbg2       extract:            %p\n",(void *)mb_io_ptr->mb_io_extract);
-		fprintf(stderr,"dbg2       insert:             %p\n",(void *)mb_io_ptr->mb_io_insert);
-		fprintf(stderr,"dbg2       extract_nav:        %p\n",(void *)mb_io_ptr->mb_io_extract_nav);
-		fprintf(stderr,"dbg2       insert_nav:         %p\n",(void *)mb_io_ptr->mb_io_insert_nav);
-		fprintf(stderr,"dbg2       extract_altitude:   %p\n",(void *)mb_io_ptr->mb_io_extract_altitude);
-		fprintf(stderr,"dbg2       insert_altitude:    %p\n",(void *)mb_io_ptr->mb_io_insert_altitude);
-		fprintf(stderr,"dbg2       extract_svp:        %p\n",(void *)mb_io_ptr->mb_io_extract_svp);
-		fprintf(stderr,"dbg2       insert_svp:         %p\n",(void *)mb_io_ptr->mb_io_insert_svp);
-		fprintf(stderr,"dbg2       ttimes:             %p\n",(void *)mb_io_ptr->mb_io_ttimes);
-		fprintf(stderr,"dbg2       detects:            %p\n",(void *)mb_io_ptr->mb_io_detects);
-		fprintf(stderr,"dbg2       extract_rawss:      %p\n",(void *)mb_io_ptr->mb_io_extract_rawss);
-		fprintf(stderr,"dbg2       insert_rawss:       %p\n",(void *)mb_io_ptr->mb_io_insert_rawss);
-		fprintf(stderr,"dbg2       copyrecord:         %p\n",(void *)mb_io_ptr->mb_io_copyrecord);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbr_info_sbifremr(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error)
-{
-	char	*function_name = "mbr_info_sbifremr";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* set format info parameters */
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-	*system = MB_SYS_SB;
-	*beams_bath_max = 19;
-	*beams_amp_max = 0;
-	*pixels_ss_max = 0;
-	strncpy(format_name, "SBIFREMR", MB_NAME_LENGTH);
-	strncpy(system_name, "SB", MB_NAME_LENGTH);
-	strncpy(format_description, "Format name:          MBF_SBIFREMR\nInformal Description: IFREMER Archive SeaBeam\nAttributes:           Sea Beam, bathymetry, 19 beams, ascii, centered,\n                      IFREMER.\n", MB_DESCRIPTION_LENGTH);
-	*numfile = 1;
-	*filetype = MB_FILETYPE_NORMAL;
-	*variable_beams = MB_NO;
-	*traveltime = MB_NO;
-	*beam_flagging = MB_YES;
-	*nav_source = MB_DATA_DATA;
-	*heading_source = MB_DATA_DATA;
-	*vru_source = MB_DATA_DATA;
-	*svp_source = MB_DATA_NONE;
-	*beamwidth_xtrack = 2.67;
-	*beamwidth_ltrack = 2.67;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",*system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",*beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",*beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",*pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",*numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",*filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",*variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",*traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",*beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",*nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",*heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",*vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",*svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",*beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",*beamwidth_ltrack);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_alm_sbifremr(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_alm_sbifremr";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set initial status */
-	status = MB_SUCCESS;
-
-	/* allocate memory for data structure */
-	mb_io_ptr->structure_size = sizeof(struct mbf_sbifremr_struct);
-	mb_io_ptr->data_structure_size = 0;
-	status = mb_malloc(verbose,mb_io_ptr->structure_size,
-				&mb_io_ptr->raw_data,error);
-	status = mb_malloc(verbose,sizeof(struct mbsys_sb_struct),
-				&mb_io_ptr->store_data,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_dem_sbifremr(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_dem_sbifremr";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* deallocate memory for data descriptor */
-	status = mb_free(verbose,&mb_io_ptr->raw_data,error);
-	status = mb_free(verbose,&mb_io_ptr->store_data,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_rt_sbifremr(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_rt_sbifremr";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_sbifremr_struct *data;
-	struct mbsys_sb_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_sbifremr_struct *) mb_io_ptr->raw_data;
-	data->kind = MB_DATA_DATA;
-	store = (struct mbsys_sb_struct *) store_ptr;
-
-	/* read next record from file */
-	status = mbr_sbifremr_rd_data(verbose,mbio_ptr,error);
-
-	/* set kind and error in mb_io_ptr */
-	mb_io_ptr->new_kind = data->kind;
-	mb_io_ptr->new_error = *error;
-
-	/* translate values to sea beam data storage structure */
-	if (status == MB_SUCCESS
-		&& store != NULL)
-		{
-		/* type of data record */
-		store->kind = data->kind;
-
-		/* position */
-		store->lon2u = data->lon2u;
-		store->lon2b = data->lon2b;
-		store->lat2u = data->lat2u;
-		store->lat2b = data->lat2b;
-
-		/* time stamp */
-		store->year = data->year;
-		store->day = data->day;
-		store->min = data->min;
-		store->sec = data->sec;
-
-		/* depths and distances */
-		for (i=0;i<MBSYS_SB_BEAMS;i++)
-			{
-			store->dist[i] = data->dist[i];
-			store->deph[i] = data->deph[i];
-			}
-
-		/* additional values */
-		store->sbtim = 0;
-		store->sbhdg = data->sbhdg;
-		store->axis = 0;
-		store->major = 0;
-		store->minor = 0;
-
-		/* comment */
-		strncpy(store->comment,data->comment,
-			MBSYS_SB_MAXLINE);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_wt_sbifremr(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_wt_sbifremr";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_sbifremr_struct *data;
-	struct mbsys_sb_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_sbifremr_struct *) mb_io_ptr->raw_data;
-	store = (struct mbsys_sb_struct *) store_ptr;
-
-	/* second translate values from seabeam data storage structure */
-	if (store != NULL)
-		{
-		data->kind = store->kind;
-		if (store->kind == MB_DATA_DATA)
-			{
-			/* position */
-			data->lon2u = store->lon2u;
-			data->lon2b = store->lon2b;
-			data->lat2u = store->lat2u;
-			data->lat2b = store->lat2b;
-
-			/* time stamp */
-			data->year = store->year;
-			data->day = store->day;
-			data->min = store->min;
-			data->sec = store->sec;
-
-			/* depths and distances */
-			for (i=0;i<MBSYS_SB_BEAMS;i++)
-				{
-				data->dist[i] = store->dist[i];
-				data->deph[i] = store->deph[i];
-				}
-
-			/* additional values */
-			data->sbhdg = store->sbhdg;
-			}
-
-		/* comment */
-		else if (store->kind == MB_DATA_COMMENT)
-			{
-			strncpy(data->comment,store->comment,
-				MBSYS_SB_MAXLINE-1);
-			}
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Ready to write data in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       kind:       %d\n",
-			data->kind);
-		fprintf(stderr,"dbg5       error:      %d\n",*error);
-		fprintf(stderr,"dbg5       status:     %d\n",status);
-		}
-
-	/* write next record to file */
-	if (data->kind == MB_DATA_DATA
-		|| data->kind == MB_DATA_COMMENT)
-		{
-		status = mbr_sbifremr_wr_data(verbose,mbio_ptr,error);
-		}
-	else
-		{
-		status = MB_SUCCESS;
-		*error = MB_ERROR_NO_ERROR;
-		if (verbose >= 5)
-			fprintf(stderr,"\ndbg5  No data written in MBIO function <%s>\n",function_name);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_sbifremr_rd_data(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_sbifremr_rd_data";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_sbifremr_struct *data;
-	FILE	*mbfp;
-	int	done;
-	static char line[MBF_SBIFREMR_MAXLINE];
-	static int  line_save = MB_NO;
-	static int  first = MB_YES;
-	char	*result;
-	int	nchars;
-	char	NorS, EorW;
-	int	lon_deg, lat_deg;
-	double	lon_min, lat_min;
-	double	depth;
-	double  heading;
-	static int ping_num_save = 0;
-	int	ping_num;
-	int	beam_num;
-	int	day, month, year, hour, minute, second, tsecond;
-	int	time_i[7], time_j[5];
-	static double	heading_save = 0.0;
-	int	center;
-	double	mtodeglon, mtodeglat;
-	int	beam_port, beam_starboard;
-	double	denom;
-	double	dx,  dy, distance;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_sbifremr_struct *) mb_io_ptr->raw_data;
-	mbfp = mb_io_ptr->mbfp;
-
-	/* initialize beams to zeros */
-	for (i=0;i<MBF_SBIFREMR_NUM_BEAMS;i++)
-		{
-		data->deph[i] = 0;
-		data->dist[i] = 0;
-		}
-
-	done = MB_NO;
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-	center = MBF_SBIFREMR_NUM_BEAMS / 2;
-	mb_io_ptr->file_pos = mb_io_ptr->file_bytes;
-	while (done == MB_NO)
-		{
-
-		/* get next line */
-		if (line_save == MB_NO)
-			{
-			mb_io_ptr->file_bytes = ftell(mbfp);
-			strncpy(line,"\0",MBF_SBIFREMR_MAXLINE);
-			result = fgets(line,MBF_SBIFREMR_MAXLINE,mbfp);
-			}
-		else
-			{
-			line_save = MB_NO;
-			result = line;
-			}
-
-		/* check size of line */
-		nchars = strlen(line);
-
-		/* deal with end of file */
-		if (result == NULL)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_EOF;
-			done = MB_YES;
-			}
-
-		/* deal with comment */
-		else if (nchars > 2 && line[0] == '#' && line[1] == '#')
-			{
-			strncpy(data->comment, &line[2], MBF_SBIFREMR_MAXLINE-3);
-			data->kind = MB_DATA_COMMENT;
-			done = MB_YES;
-			first = MB_YES;
-			}
-
-		/* deal with good line */
-		else if (nchars > 96)
-			{
-			/* get ping number */
-			mb_get_int    (&ping_num,   line+52,  7);
-			mb_get_int    (&beam_num,   line+59,  4);
-			beam_num = 19 - beam_num;
-
-			/* check if new ping */
-			if (ping_num != ping_num_save && first == MB_NO)
-				{
-				done = MB_YES;
-				line_save = MB_YES;
-				first = MB_YES;
-				}
-
-			/* else convert and store the data */
-			else if (beam_num > -1 && beam_num < 19)
-				{
-				/* parse the line */
-				NorS = line[0];
-				mb_get_int    (&lat_deg,    line+1,   2);
-				mb_get_double (&lat_min,    line+3,   8);
-				EorW = line[12];
-				mb_get_int    (&lon_deg,    line+13,  3);
-				mb_get_double (&lon_min,    line+16,  8);
-				mb_get_double (&depth,      line+24, 11);
-				mb_get_int    (&day,        line+76,  2);
-				mb_get_int    (&month,      line+79,  2);
-				mb_get_int    (&year,       line+82,  2);
-				mb_get_int    (&hour,       line+85,  2);
-				mb_get_int    (&minute,     line+88,  2);
-				mb_get_int    (&second,     line+91,  2);
-				mb_get_int    (&tsecond,    line+94,  2);
-
-				/* convert data */
-				data->kind = MB_DATA_DATA;
-				data->lon[beam_num] =
-					lon_deg + lon_min / 60.0;
-				if (EorW == 'W')
-					data->lon[beam_num]
-						= -1.0 * data->lon[beam_num];
-				data->lat[beam_num] =
-					lat_deg + lat_min / 60.0;
-				if (NorS == 'S')
-					data->lat[beam_num]
-						= -1.0 * data->lat[beam_num];
-				data->deph[beam_num] = -depth;
-				first = MB_NO;
-				ping_num_save = ping_num;
-				}
-			}
-		}
-
-	/* if success convert the data */
-	if (status == MB_SUCCESS && data->kind == MB_DATA_DATA)
-		{
-		/* do time */
-		mb_fix_y2k(verbose,year, &time_i[0]);
-		time_i[1] = month;
-		time_i[2] = day;
-		time_i[3] = hour;
-		time_i[4] = minute;
-		time_i[5] = second;
-		time_i[6] = 0;
-		mb_get_jtime(verbose,time_i,time_j);
-		data->year = time_j[0];
-		data->day = time_j[1];
-		data->min = time_j[2];
-		data->sec = time_j[3];
-
-		/* do nav */
-		data->lon2u = (short int) 60.0 * data->lon[center];
-		data->lon2b = (short int) (600000.0
-			* (data->lon[center] - data->lon2u / 60.0));
-		data->lat2u = (short int) 60.0 * (90.0 + data->lat[center]);
-		data->lat2b = (short int) (600000.0
-			* (data->lat[center] + 90.0 - data->lat2u/60.0));
-
-		/* get coordinate scaling */
-		mb_coor_scale(verbose,data->lat[center],&mtodeglon,&mtodeglat);
-
-		/* find port-most and starboard-most beams */
-		beam_port = MBF_SBIFREMR_NUM_BEAMS;
-		beam_starboard = -1;
-		for (i=0;i<MBF_SBIFREMR_NUM_BEAMS;i++)
-			{
-			if (data->deph[i] != 0)
-				{
-				if (beam_port > i)
-					beam_port = i;
-				if (beam_starboard < i)
-					beam_starboard = i;
-				}
-			}
-		if (beam_starboard > beam_port)
-			{
-			dx = (data->lon[beam_port] - data->lon[beam_starboard])
-				/ mtodeglon;
-			dy = (data->lat[beam_port] - data->lat[beam_starboard])
-				/ mtodeglat;
-			denom = sqrt(dx * dx + dy * dy);
-			if (denom > 0.0)
-				{
-				dx = dx/denom;
-				dy = dy/denom;
-				heading = RTD*atan2(dx,dy) - 90.0;
-				if (heading < 0.0)
-					heading = heading + 360.0;
-				if (heading > 360.0)
-					heading = heading - 360.0;
-				}
-			else
-				heading = heading_save;
-			}
-		else
-			heading = heading_save;
-
-
-		/* do heading */
-		heading_save = heading;
-		data->sbhdg = (short int) (heading * 182.044444);
-
-		/* if needed try to get center beam lon and lat */
-		if (data->deph[center] == 0)
-			{
-/* the code below commented out because it does not work well enough
-	- simply ignore pings without center beams */
-			status = MB_FAILURE;
-			*error = MB_ERROR_UNINTELLIGIBLE;
-
-/*			headingx = sin(heading * DTR);
-			headingy = cos(heading * DTR);
-			data->lon[center] = 0.0;
-			data->lat[center] = 0.0;
-			count = 0;
-			for (i=0;i<MBF_SBIFREMR_NUM_BEAMS;i++)
-				{
-				if (data->deph[i] != 0)
-					{
-					depth = fabs((double)data->deph[i]);
-					angle = DTR * fabs(MBF_SBIFREMR_ANGLE_SPACING * (i - center));
-					distance = depth * tan(angle);
-					data->lon[center] +=
-					    data->lon[i]
-					    - mtodeglon * headingy
-					    * distance;
-					data->lat[center] +=
-					    data->lat[i]
-					    + mtodeglat * headingx
-					    * distance;
-					count++;
-					}
-				}
-			if (count > 0)
-				{
-				data->lon[center] =
-					data->lon[center] / count;
-				data->lat[center] =
-					data->lat[center] / count;
-				}
-			else
-				{
-				status = MB_FAILURE;
-				*error = MB_ERROR_UNINTELLIGIBLE;
-				}
-*/
-/* end code commented out */
-			}
-
-		/* do acrosstrack distances */
-		if (status == MB_SUCCESS)
-			{
-			for (i=0;i<MBF_SBIFREMR_NUM_BEAMS;i++)
-			    if (data->deph[i] != 0)
-			    {
-			    dx = (data->lon[i] - data->lon[center])
-				    / mtodeglon;
-			    dy = (data->lat[i] - data->lat[center])
-				    / mtodeglat;
-			    distance = sqrt(dx * dx + dy * dy);
-			    if (i > center)
-				distance = -distance;
-			    data->dist[i] = distance;
-			    }
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_sbifremr_wr_data(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_sbifremr_wr_data";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_sbifremr_struct *data;
-	FILE	*mbfp;
-	char	NorS, EorW;
-	int	lon_deg, lat_deg;
-	double	lon, lat, lon_min, lat_min;
-	double	depth;
-	double  heading;
-	static int ping_num_save = 0;
-	static int sounding_num_save = 0;
-	int	beam_num;
-	int	day, month, year, hour, minute, second, tsecond;
-	int	time_i[7], time_j[5];
-	double	mtodeglon, mtodeglat;
-	double	headingx, headingy;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_sbifremr_struct *) mb_io_ptr->raw_data;
-	mbfp = mb_io_ptr->mbfp;
-
-	/* write comment */
-	if (data->kind == MB_DATA_COMMENT)
-		{
-		/* output the line */
-		status = fprintf(mbfp,"##%s\n",data->comment);
-		if (status >= 0)
-			{
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		else
-			{
-			*error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		}
-
-	/* write data */
-	else if (data->kind == MB_DATA_DATA)
-		{
-		/* increment ping counter */
-		ping_num_save++;
-
-		/* get time */
-		time_j[0] = data->year;
-		time_j[1] = data->day;
-		time_j[2] = data->min;
-		time_j[3] = data->sec;
-		time_j[4] = 0;
-		mb_get_itime(verbose,time_j,time_i);
-		mb_unfix_y2k(verbose,time_i[0],&year);
-		month = time_i[1];
-		day = time_i[2];
-		hour = time_i[3];
-		minute = time_i[4];
-		second = time_i[5];
-		tsecond = 0;
-
-		/* get lon lat */
-		lon = data->lon2u/60. + data->lon2b/600000.;
-		lat = data->lat2u/60. + data->lat2b/600000. - 90.;
-		if (lon > 180.0)
-			lon = lon - 360.0;
-		else if (lon < -180.0)
-			lon = lon + 360.0;
-
-		/* get coordinate scaling */
-		heading = 0.0054932 * data->sbhdg;
-		data->sbhdg = (short int) (heading * 182.044444);
-		mb_coor_scale(verbose,lat,&mtodeglon,&mtodeglat);
-		headingx = sin(heading * DTR);
-		headingy = cos(heading * DTR);
-
-		/* write beams */
-		for (i=0;i<MBF_SBIFREMR_NUM_BEAMS;i++)
-		    {
-		    if (data->deph[i] != 0)
-			{
-			/* increment sounding counter */
-			sounding_num_save++;
-
-			/* get lon lat for beam */
-			data->lon[i] = lon + headingy * mtodeglon
-					* data->dist[i];
-			data->lat[i] = lat - headingx * mtodeglat
-					*data->dist[i];
-
-			/* get printing values */
-			beam_num = 19 - i;
-			if (data->lon[i] > 180.0)
-				data->lon[i] = data->lon[i] - 360.0;
-			else if (data->lon[i] < -180.0)
-				data->lon[i] = data->lon[i] + 360.0;
-			if (data->lon[i] < 0.0)
-				{
-				EorW = 'W';
-				data->lon[i] = -data->lon[i];
-				}
-			else
-				EorW = 'E';
-			lon_deg = (int) data->lon[i];
-			lon_min = (data->lon[i] - lon_deg) * 60.0;
-			if (data->lat[i] < 0.0)
-				{
-				NorS = 'S';
-				data->lat[i] = -data->lat[i];
-				}
-			else
-				NorS = 'N';
-			lat_deg = (int) data->lat[i];
-			lat_min = (data->lat[i] - lat_deg) * 60.0;
-
-			/* print out beam */
-			fprintf(mbfp, "%c%2.2d%8.4f %c%3.3d%8.4f",
-				NorS, lat_deg, lat_min,
-				EorW, lon_deg, lon_min);
-			depth = -data->deph[i];
-			fprintf(mbfp,"%11.3f ****************",
-				depth);
-			fprintf(mbfp, "%7d%4d%7d    0 ",
-				ping_num_save, beam_num, sounding_num_save);
-			fprintf(mbfp, "%2d/%2d/%2d %2dh%2dm%2ds00\n",
-				day, month, year, hour, minute, second);
-			}
-		    }
-		}
-
-	/* else fail */
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_BAD_KIND;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mbr_sbsiocen.c b/src/mbio/mbr_sbsiocen.c
deleted file mode 100644
index f845d6c..0000000
--- a/src/mbio/mbr_sbsiocen.c
+++ /dev/null
@@ -1,743 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbr_sbsiocen.c	2/2/93
- *	$Id: mbr_sbsiocen.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1993-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbr_sbsiocen.c contains the functions for reading and writing
- * multibeam data in the SBSIOCEN format.
- * These functions include:
- *   mbr_alm_sbsiocen	- allocate read/write memory
- *   mbr_dem_sbsiocen	- deallocate read/write memory
- *   mbr_rt_sbsiocen	- read and translate data
- *   mbr_wt_sbsiocen	- translate and write data
- *
- * Author:	D. W. Caress
- * Date:	February 2, 1993
- * $Log: mbr_sbsiocen.c,v $
- * Revision 5.9  2005/11/05 00:48:04  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.8  2003/05/20 18:05:32  caress
- * Added svp_source to data source parameters.
- *
- * Revision 5.7  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.6  2002/10/15 18:34:58  caress
- * Release 5.0.beta25
- *
- * Revision 5.5  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.4  2002/02/26 07:50:41  caress
- * Release 5.0.beta14
- *
- * Revision 5.3  2001/07/20 00:32:54  caress
- * Release 5.0.beta03
- *
- * Revision 5.2  2001/03/22  20:50:02  caress
- * Trying to make version 5.0.beta0
- *
- * Revision 5.1  2001/01/22  07:43:34  caress
- * Version 5.0.beta01
- *
- * Revision 5.0  2000/12/01  22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.10  2000/10/11  01:03:21  caress
- * Convert to ANSI C
- *
- * Revision 4.9  2000/09/30  06:34:20  caress
- * Snapshot for Dale.
- *
- * Revision 4.8  1998/10/05  17:46:15  caress
- * MB-System version 4.6beta
- *
- * Revision 4.7  1997/07/25  14:19:53  caress
- * Version 4.5beta2.
- * Much mucking, particularly with Simrad formats.
- *
- * Revision 4.6  1997/04/21  17:02:07  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.5  1996/04/22  13:21:19  caress
- * Now have DTR and MIN/MAX defines in mb_define.h
- *
- * Revision 4.5  1996/04/22  13:21:19  caress
- * Now have DTR and MIN/MAX defines in mb_define.h
- *
- * Revision 4.4  1995/03/06  19:38:54  caress
- * Changed include strings.h to string.h for POSIX compliance.
- *
- * Revision 4.3  1994/10/21  12:20:01  caress
- * Release V4.0
- *
- * Revision 4.2  1994/07/29  18:46:51  caress
- * Changes associated with supporting Lynx OS (byte swapped) and
- * using unix second time base (for time_d values).
- *
- * Revision 4.1  1994/05/11  21:23:01  caress
- * Added initialization of bathalongtrack array.
- *
- * Revision 4.0  1994/03/06  00:01:56  caress
- * First cut at version 4.0
- *
- * Revision 4.1  1994/03/03  03:39:43  caress
- * Fixed copyright message.
- *
- * Revision 4.0  1994/02/21  03:59:50  caress
- * First cut at new version. Altered to be consistent
- * with passing of three types of data: bathymetry,
- * amplitude, and sidescan.
- *
- * Revision 3.0  1993/05/14  22:57:19  sohara
- * initial version
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mb_define.h"
-#include "mbsys_sb.h"
-#include "mbf_sbsiocen.h"
-
-/* include for byte swapping on little-endian machines */
-#ifdef BYTESWAPPED
-#include "mb_swap.h"
-#endif
-
-/* essential function prototypes */
-int mbr_register_sbsiocen(int verbose, void *mbio_ptr,
-		int *error);
-int mbr_info_sbsiocen(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_alm_sbsiocen(int verbose, void *mbio_ptr, int *error);
-int mbr_dem_sbsiocen(int verbose, void *mbio_ptr, int *error);
-int mbr_rt_sbsiocen(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_wt_sbsiocen(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-
-static char rcs_id[]="$Id: mbr_sbsiocen.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mbr_register_sbsiocen(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_register_sbsiocen";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* get mb_io_ptr */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set format info parameters */
-	status = mbr_info_sbsiocen(verbose,
-			&mb_io_ptr->system,
-			&mb_io_ptr->beams_bath_max,
-			&mb_io_ptr->beams_amp_max,
-			&mb_io_ptr->pixels_ss_max,
-			mb_io_ptr->format_name,
-			mb_io_ptr->system_name,
-			mb_io_ptr->format_description,
-			&mb_io_ptr->numfile,
-			&mb_io_ptr->filetype,
-			&mb_io_ptr->variable_beams,
-			&mb_io_ptr->traveltime,
-			&mb_io_ptr->beam_flagging,
-			&mb_io_ptr->nav_source,
-			&mb_io_ptr->heading_source,
-			&mb_io_ptr->vru_source,
-			&mb_io_ptr->svp_source,
-			&mb_io_ptr->beamwidth_xtrack,
-			&mb_io_ptr->beamwidth_ltrack,
-			error);
-
-	/* set format and system specific function pointers */
-	mb_io_ptr->mb_io_format_alloc = &mbr_alm_sbsiocen;
-	mb_io_ptr->mb_io_format_free = &mbr_dem_sbsiocen;
-	mb_io_ptr->mb_io_store_alloc = &mbsys_sb_alloc;
-	mb_io_ptr->mb_io_store_free = &mbsys_sb_deall;
-	mb_io_ptr->mb_io_read_ping = &mbr_rt_sbsiocen;
-	mb_io_ptr->mb_io_write_ping = &mbr_wt_sbsiocen;
-	mb_io_ptr->mb_io_dimensions = &mbsys_sb_dimensions;
-	mb_io_ptr->mb_io_extract = &mbsys_sb_extract;
-	mb_io_ptr->mb_io_insert = &mbsys_sb_insert;
-	mb_io_ptr->mb_io_extract_nav = &mbsys_sb_extract_nav;
-	mb_io_ptr->mb_io_insert_nav = &mbsys_sb_insert_nav;
-	mb_io_ptr->mb_io_extract_altitude = &mbsys_sb_extract_altitude;
-	mb_io_ptr->mb_io_insert_altitude = NULL;
-	mb_io_ptr->mb_io_extract_svp = NULL;
-	mb_io_ptr->mb_io_insert_svp = NULL;
-	mb_io_ptr->mb_io_ttimes = &mbsys_sb_ttimes;
-	mb_io_ptr->mb_io_detects = &mbsys_sb_detects;
-	mb_io_ptr->mb_io_copyrecord = &mbsys_sb_copy;
-	mb_io_ptr->mb_io_extract_rawss = NULL;
-	mb_io_ptr->mb_io_insert_rawss = NULL;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",mb_io_ptr->system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",mb_io_ptr->beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",mb_io_ptr->beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",mb_io_ptr->pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",mb_io_ptr->format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",mb_io_ptr->system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",mb_io_ptr->format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",mb_io_ptr->numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",mb_io_ptr->filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",mb_io_ptr->variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",mb_io_ptr->traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",mb_io_ptr->beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",mb_io_ptr->nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",mb_io_ptr->heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",mb_io_ptr->vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",mb_io_ptr->svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",mb_io_ptr->beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",mb_io_ptr->beamwidth_ltrack);
-		fprintf(stderr,"dbg2       format_alloc:       %p\n",(void *)mb_io_ptr->mb_io_format_alloc);
-		fprintf(stderr,"dbg2       format_free:        %p\n",(void *)mb_io_ptr->mb_io_format_free);
-		fprintf(stderr,"dbg2       store_alloc:        %p\n",(void *)mb_io_ptr->mb_io_store_alloc);
-		fprintf(stderr,"dbg2       store_free:         %p\n",(void *)mb_io_ptr->mb_io_store_free);
-		fprintf(stderr,"dbg2       read_ping:          %p\n",(void *)mb_io_ptr->mb_io_read_ping);
-		fprintf(stderr,"dbg2       write_ping:         %p\n",(void *)mb_io_ptr->mb_io_write_ping);
-		fprintf(stderr,"dbg2       extract:            %p\n",(void *)mb_io_ptr->mb_io_extract);
-		fprintf(stderr,"dbg2       insert:             %p\n",(void *)mb_io_ptr->mb_io_insert);
-		fprintf(stderr,"dbg2       extract_nav:        %p\n",(void *)mb_io_ptr->mb_io_extract_nav);
-		fprintf(stderr,"dbg2       insert_nav:         %p\n",(void *)mb_io_ptr->mb_io_insert_nav);
-		fprintf(stderr,"dbg2       extract_altitude:   %p\n",(void *)mb_io_ptr->mb_io_extract_altitude);
-		fprintf(stderr,"dbg2       insert_altitude:    %p\n",(void *)mb_io_ptr->mb_io_insert_altitude);
-		fprintf(stderr,"dbg2       extract_svp:        %p\n",(void *)mb_io_ptr->mb_io_extract_svp);
-		fprintf(stderr,"dbg2       insert_svp:         %p\n",(void *)mb_io_ptr->mb_io_insert_svp);
-		fprintf(stderr,"dbg2       ttimes:             %p\n",(void *)mb_io_ptr->mb_io_ttimes);
-		fprintf(stderr,"dbg2       detects:            %p\n",(void *)mb_io_ptr->mb_io_detects);
-		fprintf(stderr,"dbg2       extract_rawss:      %p\n",(void *)mb_io_ptr->mb_io_extract_rawss);
-		fprintf(stderr,"dbg2       insert_rawss:       %p\n",(void *)mb_io_ptr->mb_io_insert_rawss);
-		fprintf(stderr,"dbg2       copyrecord:         %p\n",(void *)mb_io_ptr->mb_io_copyrecord);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbr_info_sbsiocen(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error)
-{
-	char	*function_name = "mbr_info_sbsiocen";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* set format info parameters */
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-	*system = MB_SYS_SB;
-	*beams_bath_max = 19;
-	*beams_amp_max = 0;
-	*pixels_ss_max = 0;
-	strncpy(format_name, "SBSIOCEN", MB_NAME_LENGTH);
-	strncpy(system_name, "SB", MB_NAME_LENGTH);
-	strncpy(format_description, "Format name:          MBF_SBSIOCEN\nInformal Description: SIO centered Sea Beam\nAttributes:           Sea Beam, bathymetry, 19 beams, binary, centered,\n                      SIO.\n", MB_DESCRIPTION_LENGTH);
-	*numfile = 1;
-	*filetype = MB_FILETYPE_NORMAL;
-	*variable_beams = MB_NO;
-	*traveltime = MB_NO;
-	*beam_flagging = MB_YES;
-	*nav_source = MB_DATA_DATA;
-	*heading_source = MB_DATA_DATA;
-	*vru_source = MB_DATA_DATA;
-	*svp_source = MB_DATA_NONE;
-	*beamwidth_xtrack = 2.67;
-	*beamwidth_ltrack = 2.67;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",*system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",*beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",*beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",*pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",*numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",*filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",*variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",*traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",*beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",*nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",*heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",*vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",*svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",*beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",*beamwidth_ltrack);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_alm_sbsiocen(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_alm_sbsiocen";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set initial status */
-	status = MB_SUCCESS;
-
-	/* allocate memory for data structure */
-	mb_io_ptr->structure_size = sizeof(struct mbf_sbsiocen_struct);
-	mb_io_ptr->data_structure_size =
-		sizeof(struct mbf_sbsiocen_data_struct);
-	status = mb_malloc(verbose,mb_io_ptr->structure_size,
-				&mb_io_ptr->raw_data,error);
-	status = mb_malloc(verbose,sizeof(struct mbsys_sb_struct),
-				&mb_io_ptr->store_data,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_dem_sbsiocen(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_dem_sbsiocen";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* deallocate memory for data descriptor */
-	status = mb_free(verbose,&mb_io_ptr->raw_data,error);
-	status = mb_free(verbose,&mb_io_ptr->store_data,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_rt_sbsiocen(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_rt_sbsiocen";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_sbsiocen_struct *dataplus;
-	struct mbf_sbsiocen_data_struct *data;
-	struct mbsys_sb_struct *store;
-	char	*datacomment;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	dataplus = (struct mbf_sbsiocen_struct *) mb_io_ptr->raw_data;
-	data = &(dataplus->data);
-	datacomment = (char *) data;
-	dataplus->kind = MB_DATA_DATA;
-	store = (struct mbsys_sb_struct *) store_ptr;
-
-	/* read next record from file */
-	mb_io_ptr->file_pos = mb_io_ptr->file_bytes;
-	if ((status = fread(data,1,mb_io_ptr->data_structure_size,
-			mb_io_ptr->mbfp)) == mb_io_ptr->data_structure_size)
-		{
-		mb_io_ptr->file_bytes += status;
-		status = MB_SUCCESS;
-		*error = MB_ERROR_NO_ERROR;
-		}
-	else
-		{
-		mb_io_ptr->file_bytes += status;
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	/* byte swap the data if necessary */
-#ifdef BYTESWAPPED
-	if (status == MB_SUCCESS)
-		{
-		data->year = mb_swap_short(data->year);
-		data->day = mb_swap_short(data->day);
-		data->min = mb_swap_short(data->min);
-		data->sec = mb_swap_short(data->sec);
-		data->major = mb_swap_short(data->major);
-		data->minor = mb_swap_short(data->minor);
-		data->axis = mb_swap_short(data->axis);
-		data->lat2u = mb_swap_short(data->lat2u);
-		data->lat2b = mb_swap_short(data->lat2b);
-		data->lon2u = mb_swap_short(data->lon2u);
-		data->lon2b = mb_swap_short(data->lon2b);
-		data->sbtim = mb_swap_short(data->sbtim);
-		data->sbhdg = mb_swap_short(data->sbhdg);
-		for (i=0;i<MBSYS_SB_BEAMS;i++)
-			{
-			data->dist[i] = mb_swap_short(data->dist[i]);
-			data->deph[i] = mb_swap_short(data->deph[i]);
-			}
-		data->spare = mb_swap_short(data->spare);
-		}
-#endif
-
-	/* check for comment or unintelligible records */
-	if (status == MB_SUCCESS)
-		{
-		if (data->year > 7000)
-			{
-			dataplus->kind = MB_DATA_COMMENT;
-			}
-		else if (data->year == 0)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_UNINTELLIGIBLE;
-			}
-		else
-			{
-			dataplus->kind = MB_DATA_DATA;
-			}
-		}
-
-	/* set kind and error in mb_io_ptr */
-	mb_io_ptr->new_kind = dataplus->kind;
-	mb_io_ptr->new_error = *error;
-
-	/* translate values to sea beam data storage structure */
-	if (status == MB_SUCCESS
-		&& store != NULL)
-		{
-		/* type of data record */
-		store->kind = dataplus->kind;
-
-		if (store->kind == MB_DATA_DATA)
-			{
-			/* position */
-			store->lon2u = data->lon2u;
-			store->lon2b = data->lon2b;
-			store->lat2u = data->lat2u;
-			store->lat2b = data->lat2b;
-
-			/* time stamp */
-			store->year = data->year;
-			store->day = data->day;
-			store->min = data->min;
-			store->sec = data->sec;
-
-			/* depths and distances */
-			for (i=0;i<MBSYS_SB_BEAMS;i++)
-				{
-				store->dist[i] = data->dist[i];
-				store->deph[i] = data->deph[i];
-				}
-
-			/* additional values */
-			store->sbtim = data->sbtim;
-			store->sbhdg = data->sbhdg;
-			store->axis = data->axis;
-			store->major = data->major;
-			store->minor = data->minor;
-			}
-
-		else if (store->kind == MB_DATA_COMMENT)
-			{
-			/* comment */
-			strncpy(store->comment,&datacomment[2],
-				MBSYS_SB_MAXLINE);
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_wt_sbsiocen(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_wt_sbsiocen";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_sbsiocen_struct *dataplus;
-	struct mbf_sbsiocen_data_struct *data;
-	struct mbsys_sb_struct *store;
-	char	*datacomment;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	dataplus = (struct mbf_sbsiocen_struct *) mb_io_ptr->raw_data;
-	data = &(dataplus->data);
-	datacomment = (char *) data;
-	store = (struct mbsys_sb_struct *) store_ptr;
-
-	/* first set some plausible amounts for some of the
-		variables in the MBURICEN record */
-	data->sbtim = 0;
-	data->axis = 0;
-	data->major = 0;
-	data->minor = 0;
-
-	/* translate values from seabeam data storage structure */
-	dataplus->kind = store->kind;
-	if (store->kind == MB_DATA_DATA)
-		{
-		/* position */
-		data->lon2u = store->lon2u;
-		data->lon2b = store->lon2b;
-		data->lat2u = store->lat2u;
-		data->lat2b = store->lat2b;
-
-		/* time stamp */
-		data->year = store->year;
-		data->day = store->day;
-		data->min = store->min;
-		data->sec = store->sec;
-
-		/* depths and distances */
-		for (i=0;i<MBSYS_SB_BEAMS;i++)
-			{
-			data->dist[i] = store->dist[i];
-			data->deph[i] = store->deph[i];
-			}
-
-		/* additional values */
-		data->sbtim = store->sbtim;
-		data->sbhdg = store->sbhdg;
-		data->axis = store->axis;
-		data->major = store->major;
-		data->minor = store->minor;
-		}
-
-	/* comment */
-	else if (store->kind == MB_DATA_COMMENT)
-		{
-		strcpy(datacomment,"cc");
-		strncat(datacomment,store->comment,MBSYS_SB_MAXLINE-1);
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Ready to write data in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       kind:       %d\n",
-			dataplus->kind);
-		fprintf(stderr,"dbg5       error:      %d\n",*error);
-		fprintf(stderr,"dbg5       status:     %d\n",status);
-		}
-
-	/* byte swap the data if necessary */
-#ifdef BYTESWAPPED
-	if (dataplus->kind == MB_DATA_DATA)
-		{
-		data->year = mb_swap_short(data->year);
-		data->day = mb_swap_short(data->day);
-		data->min = mb_swap_short(data->min);
-		data->sec = mb_swap_short(data->sec);
-		data->major = mb_swap_short(data->major);
-		data->minor = mb_swap_short(data->minor);
-		data->axis = mb_swap_short(data->axis);
-		data->lat2u = mb_swap_short(data->lat2u);
-		data->lat2b = mb_swap_short(data->lat2b);
-		data->lon2u = mb_swap_short(data->lon2u);
-		data->lon2b = mb_swap_short(data->lon2b);
-		data->sbtim = mb_swap_short(data->sbtim);
-		data->sbhdg = mb_swap_short(data->sbhdg);
-		for (i=0;i<MBSYS_SB_BEAMS;i++)
-			{
-			data->dist[i] = mb_swap_short(data->dist[i]);
-			data->deph[i] = mb_swap_short(data->deph[i]);
-			}
-		data->spare = mb_swap_short(data->spare);
-		}
-#endif
-
-	/* write next record to file */
-	if (dataplus->kind == MB_DATA_DATA
-		|| dataplus->kind == MB_DATA_COMMENT)
-		{
-		if ((status = fwrite(data,1,mb_io_ptr->data_structure_size,
-			mb_io_ptr->mbfp)) == mb_io_ptr->data_structure_size)
-			{
-			status = MB_SUCCESS;
-			*error = MB_ERROR_NO_ERROR;
-			}
-		else
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_WRITE_FAIL;
-			}
-		}
-	else
-		{
-		status = MB_SUCCESS;
-		*error = MB_ERROR_NO_ERROR;
-		if (verbose >= 5)
-			fprintf(stderr,"\ndbg5  No data written in MBIO function <%s>\n",function_name);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mbr_sbsiolsi.c b/src/mbio/mbr_sbsiolsi.c
deleted file mode 100644
index 23adddb..0000000
--- a/src/mbio/mbr_sbsiolsi.c
+++ /dev/null
@@ -1,743 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbr_sbsiolsi.c	2/2/93
- *	$Id: mbr_sbsiolsi.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1993-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbr_sbsiolsi.c contains the functions for reading and writing
- * multibeam data in the SBSIOLSI format.
- * These functions include:
- *   mbr_alm_sbsiolsi	- allocate read/write memory
- *   mbr_dem_sbsiolsi	- deallocate read/write memory
- *   mbr_rt_sbsiolsi	- read and translate data
- *   mbr_wt_sbsiolsi	- translate and write data
- *
- * Author:	D. W. Caress
- * Date:	February 2, 1993
- * $Log: mbr_sbsiolsi.c,v $
- * Revision 5.9  2005/11/05 00:48:03  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.8  2003/05/20 18:05:32  caress
- * Added svp_source to data source parameters.
- *
- * Revision 5.7  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.6  2002/10/15 18:34:58  caress
- * Release 5.0.beta25
- *
- * Revision 5.5  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.4  2002/02/26 07:50:41  caress
- * Release 5.0.beta14
- *
- * Revision 5.3  2001/07/20 00:32:54  caress
- * Release 5.0.beta03
- *
- * Revision 5.2  2001/03/22  20:50:02  caress
- * Trying to make version 5.0.beta0
- *
- * Revision 5.1  2001/01/22  07:43:34  caress
- * Version 5.0.beta01
- *
- * Revision 5.0  2000/12/01  22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.10  2000/10/11  01:03:21  caress
- * Convert to ANSI C
- *
- * Revision 4.9  2000/09/30  06:34:20  caress
- * Snapshot for Dale.
- *
- * Revision 4.8  1998/10/05  18:32:27  caress
- * MB-System version 4.6beta
- *
- * Revision 1.1  1998/10/05  17:46:15  caress
- * Initial revision
- *
- * Revision 4.7  1997/07/25  14:19:53  caress
- * Version 4.5beta2.
- * Much mucking, particularly with Simrad formats.
- *
- * Revision 4.6  1997/04/21  17:02:07  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.5  1996/04/22  13:21:19  caress
- * Now have DTR and MIN/MAX defines in mb_define.h
- *
- * Revision 4.5  1996/04/22  13:21:19  caress
- * Now have DTR and MIN/MAX defines in mb_define.h
- *
- * Revision 4.4  1995/03/06  19:38:54  caress
- * Changed include strings.h to string.h for POSIX compliance.
- *
- * Revision 4.3  1994/10/21  12:20:01  caress
- * Release V4.0
- *
- * Revision 4.2  1994/07/29  18:46:51  caress
- * Changes associated with supporting Lynx OS (byte swapped) and
- * using unix second time base (for time_d values).
- *
- * Revision 4.1  1994/05/11  21:23:01  caress
- * Added initialization of bathalongtrack array.
- *
- * Revision 4.0  1994/03/06  00:01:56  caress
- * First cut at version 4.0
- *
- * Revision 4.1  1994/03/03  03:39:43  caress
- * Fixed copyright message.
- *
- * Revision 4.0  1994/02/21  03:59:50  caress
- * First cut at new version. Altered to be consistent
- * with passing of three types of data: bathymetry,
- * amplitude, and sidescan.
- *
- * Revision 3.0  1993/05/14  22:57:44  sohara
- * initial version
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mb_define.h"
-#include "mbsys_sb.h"
-#include "mbf_sbsiolsi.h"
-
-/* include for byte swapping on little-endian machines */
-#ifdef BYTESWAPPED
-#include "mb_swap.h"
-#endif
-
-/* essential function prototypes */
-int mbr_register_sbsiolsi(int verbose, void *mbio_ptr,
-		int *error);
-int mbr_info_sbsiolsi(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_alm_sbsiolsi(int verbose, void *mbio_ptr, int *error);
-int mbr_dem_sbsiolsi(int verbose, void *mbio_ptr, int *error);
-int mbr_rt_sbsiolsi(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_wt_sbsiolsi(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-
-static char rcs_id[]="$Id: mbr_sbsiolsi.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mbr_register_sbsiolsi(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_register_sbsiolsi";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* get mb_io_ptr */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set format info parameters */
-	status = mbr_info_sbsiolsi(verbose,
-			&mb_io_ptr->system,
-			&mb_io_ptr->beams_bath_max,
-			&mb_io_ptr->beams_amp_max,
-			&mb_io_ptr->pixels_ss_max,
-			mb_io_ptr->format_name,
-			mb_io_ptr->system_name,
-			mb_io_ptr->format_description,
-			&mb_io_ptr->numfile,
-			&mb_io_ptr->filetype,
-			&mb_io_ptr->variable_beams,
-			&mb_io_ptr->traveltime,
-			&mb_io_ptr->beam_flagging,
-			&mb_io_ptr->nav_source,
-			&mb_io_ptr->heading_source,
-			&mb_io_ptr->vru_source,
-			&mb_io_ptr->svp_source,
-			&mb_io_ptr->beamwidth_xtrack,
-			&mb_io_ptr->beamwidth_ltrack,
-			error);
-
-	/* set format and system specific function pointers */
-	mb_io_ptr->mb_io_format_alloc = &mbr_alm_sbsiolsi;
-	mb_io_ptr->mb_io_format_free = &mbr_dem_sbsiolsi;
-	mb_io_ptr->mb_io_store_alloc = &mbsys_sb_alloc;
-	mb_io_ptr->mb_io_store_free = &mbsys_sb_deall;
-	mb_io_ptr->mb_io_read_ping = &mbr_rt_sbsiolsi;
-	mb_io_ptr->mb_io_write_ping = &mbr_wt_sbsiolsi;
-	mb_io_ptr->mb_io_dimensions = &mbsys_sb_dimensions;
-	mb_io_ptr->mb_io_extract = &mbsys_sb_extract;
-	mb_io_ptr->mb_io_insert = &mbsys_sb_insert;
-	mb_io_ptr->mb_io_extract_nav = &mbsys_sb_extract_nav;
-	mb_io_ptr->mb_io_insert_nav = &mbsys_sb_insert_nav;
-	mb_io_ptr->mb_io_extract_altitude = &mbsys_sb_extract_altitude;
-	mb_io_ptr->mb_io_insert_altitude = NULL;
-	mb_io_ptr->mb_io_extract_svp = NULL;
-	mb_io_ptr->mb_io_insert_svp = NULL;
-	mb_io_ptr->mb_io_ttimes = &mbsys_sb_ttimes;
-	mb_io_ptr->mb_io_detects = &mbsys_sb_detects;
-	mb_io_ptr->mb_io_copyrecord = &mbsys_sb_copy;
-	mb_io_ptr->mb_io_extract_rawss = NULL;
-	mb_io_ptr->mb_io_insert_rawss = NULL;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",mb_io_ptr->system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",mb_io_ptr->beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",mb_io_ptr->beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",mb_io_ptr->pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",mb_io_ptr->format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",mb_io_ptr->system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",mb_io_ptr->format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",mb_io_ptr->numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",mb_io_ptr->filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",mb_io_ptr->variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",mb_io_ptr->traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",mb_io_ptr->beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",mb_io_ptr->nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",mb_io_ptr->heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",mb_io_ptr->vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",mb_io_ptr->svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",mb_io_ptr->beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",mb_io_ptr->beamwidth_ltrack);
-		fprintf(stderr,"dbg2       format_alloc:       %p\n",(void *)mb_io_ptr->mb_io_format_alloc);
-		fprintf(stderr,"dbg2       format_free:        %p\n",(void *)mb_io_ptr->mb_io_format_free);
-		fprintf(stderr,"dbg2       store_alloc:        %p\n",(void *)mb_io_ptr->mb_io_store_alloc);
-		fprintf(stderr,"dbg2       store_free:         %p\n",(void *)mb_io_ptr->mb_io_store_free);
-		fprintf(stderr,"dbg2       read_ping:          %p\n",(void *)mb_io_ptr->mb_io_read_ping);
-		fprintf(stderr,"dbg2       write_ping:         %p\n",(void *)mb_io_ptr->mb_io_write_ping);
-		fprintf(stderr,"dbg2       extract:            %p\n",(void *)mb_io_ptr->mb_io_extract);
-		fprintf(stderr,"dbg2       insert:             %p\n",(void *)mb_io_ptr->mb_io_insert);
-		fprintf(stderr,"dbg2       extract_nav:        %p\n",(void *)mb_io_ptr->mb_io_extract_nav);
-		fprintf(stderr,"dbg2       insert_nav:         %p\n",(void *)mb_io_ptr->mb_io_insert_nav);
-		fprintf(stderr,"dbg2       extract_altitude:   %p\n",(void *)mb_io_ptr->mb_io_extract_altitude);
-		fprintf(stderr,"dbg2       insert_altitude:    %p\n",(void *)mb_io_ptr->mb_io_insert_altitude);
-		fprintf(stderr,"dbg2       extract_svp:        %p\n",(void *)mb_io_ptr->mb_io_extract_svp);
-		fprintf(stderr,"dbg2       insert_svp:         %p\n",(void *)mb_io_ptr->mb_io_insert_svp);
-		fprintf(stderr,"dbg2       ttimes:             %p\n",(void *)mb_io_ptr->mb_io_ttimes);
-		fprintf(stderr,"dbg2       detects:            %p\n",(void *)mb_io_ptr->mb_io_detects);
-		fprintf(stderr,"dbg2       extract_rawss:      %p\n",(void *)mb_io_ptr->mb_io_extract_rawss);
-		fprintf(stderr,"dbg2       insert_rawss:       %p\n",(void *)mb_io_ptr->mb_io_insert_rawss);
-		fprintf(stderr,"dbg2       copyrecord:         %p\n",(void *)mb_io_ptr->mb_io_copyrecord);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbr_info_sbsiolsi(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error)
-{
-	char	*function_name = "mbr_info_sbsiolsi";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* set format info parameters */
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-	*system = MB_SYS_SB;
-	*beams_bath_max = 19;
-	*beams_amp_max = 0;
-	*pixels_ss_max = 0;
-	strncpy(format_name, "SBSIOLSI", MB_NAME_LENGTH);
-	strncpy(system_name, "SB", MB_NAME_LENGTH);
-	strncpy(format_description, "Format name:          MBF_SBSIOLSI\nInformal Description: SIO LSI Sea Beam\nAttributes:           Sea Beam, bathymetry, 19 beams, binary, centered, \n                      obsolete, SIO.\n", MB_DESCRIPTION_LENGTH);
-	*numfile = 1;
-	*filetype = MB_FILETYPE_NORMAL;
-	*variable_beams = MB_NO;
-	*traveltime = MB_NO;
-	*beam_flagging = MB_YES;
-	*nav_source = MB_DATA_DATA;
-	*heading_source = MB_DATA_DATA;
-	*vru_source = MB_DATA_DATA;
-	*svp_source = MB_DATA_NONE;
-	*beamwidth_xtrack = 2.67;
-	*beamwidth_ltrack = 2.67;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",*system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",*beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",*beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",*pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",*numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",*filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",*variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",*traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",*beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",*nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",*heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",*vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",*svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",*beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",*beamwidth_ltrack);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_alm_sbsiolsi(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_alm_sbsiolsi";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set initial status */
-	status = MB_SUCCESS;
-
-	/* allocate memory for data structure */
-	mb_io_ptr->structure_size = sizeof(struct mbf_sbsiolsi_struct);
-	mb_io_ptr->data_structure_size =
-		sizeof(struct mbf_sbsiolsi_data_struct);
-	status = mb_malloc(verbose,mb_io_ptr->structure_size,
-				&mb_io_ptr->raw_data,error);
-	status = mb_malloc(verbose,sizeof(struct mbsys_sb_struct),
-				&mb_io_ptr->store_data,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_dem_sbsiolsi(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_dem_sbsiolsi";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* deallocate memory for data descriptor */
-	status = mb_free(verbose,&mb_io_ptr->raw_data,error);
-	status = mb_free(verbose,&mb_io_ptr->store_data,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_rt_sbsiolsi(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_rt_sbsiolsi";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_sbsiolsi_struct *dataplus;
-	struct mbf_sbsiolsi_data_struct *data;
-	struct mbsys_sb_struct *store;
-	char	*datacomment;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	dataplus = (struct mbf_sbsiolsi_struct *) mb_io_ptr->raw_data;
-	data = &(dataplus->data);
-	datacomment = (char *) data;
-	dataplus->kind = MB_DATA_DATA;
-	store = (struct mbsys_sb_struct *) store_ptr;
-
-	/* read next record from file */
-	mb_io_ptr->file_pos = mb_io_ptr->file_bytes;
-	if ((status = fread(data,1,mb_io_ptr->data_structure_size,
-			mb_io_ptr->mbfp)) == mb_io_ptr->data_structure_size)
-		{
-		mb_io_ptr->file_bytes += status;
-		status = MB_SUCCESS;
-		*error = MB_ERROR_NO_ERROR;
-		}
-	else
-		{
-		mb_io_ptr->file_bytes += status;
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	/* byte swap the data if necessary */
-#ifdef BYTESWAPPED
-	if (status == MB_SUCCESS)
-		{
-		for (i=0;i<MBSYS_SB_BEAMS;i++)
-			{
-			data->dist[i] = mb_swap_short(data->dist[i]);
-			data->deph[i] = mb_swap_short(data->deph[i]);
-			}
-		data->axis = mb_swap_short(data->axis);
-		data->major = mb_swap_short(data->major);
-		data->minor = mb_swap_short(data->minor);
-		data->sbhdg = mb_swap_short(data->sbhdg);
-		data->lat2b = mb_swap_short(data->lat2b);
-		data->lat2u = mb_swap_short(data->lat2u);
-		data->lon2b = mb_swap_short(data->lon2b);
-		data->lon2u = mb_swap_short(data->lon2u);
-		data->sec = mb_swap_short(data->sec);
-		data->min = mb_swap_short(data->min);
-		data->day = mb_swap_short(data->day);
-		data->year = mb_swap_short(data->year);
-		}
-#endif
-
-	/* check for comment or unintelligible records */
-	if (status == MB_SUCCESS)
-		{
-		if (data->deph[0] > 15000)
-			{
-			dataplus->kind = MB_DATA_COMMENT;
-			}
-		else if (data->year == 0)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_UNINTELLIGIBLE;
-			}
-		else
-			{
-			dataplus->kind = MB_DATA_DATA;
-			}
-		}
-
-	/* set kind and error in mb_io_ptr */
-	mb_io_ptr->new_kind = dataplus->kind;
-	mb_io_ptr->new_error = *error;
-
-	/* translate values to seabeam data storage structure */
-	if (status == MB_SUCCESS
-		&& store != NULL)
-		{
-		/* type of data record */
-		store->kind = dataplus->kind;
-
-		if (store->kind == MB_DATA_DATA)
-			{
-			/* position */
-			store->lon2u = data->lon2u;
-			store->lon2b = data->lon2b;
-			store->lat2u = data->lat2u;
-			store->lat2b = data->lat2b;
-
-			/* time stamp */
-			store->year = data->year;
-			store->day = data->day;
-			store->min = data->min;
-			store->sec = data->sec;
-
-			/* depths and distances */
-			for (i=0;i<MBSYS_SB_BEAMS;i++)
-				{
-				store->dist[i] = data->dist[i];
-				store->deph[i] = data->deph[i];
-				}
-
-			/* additional values */
-			store->sbtim = 0;
-			store->sbhdg = data->sbhdg;
-			store->axis = data->axis;
-			store->major = data->major;
-			store->minor = data->minor;
-			}
-
-		else if (store->kind == MB_DATA_COMMENT)
-			{
-			/* comment */
-			strncpy(store->comment,&datacomment[2],
-				MBSYS_SB_MAXLINE);
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_wt_sbsiolsi(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_wt_sbsiolsi";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_sbsiolsi_struct *dataplus;
-	struct mbf_sbsiolsi_data_struct *data;
-	struct mbsys_sb_struct *store;
-	char	*datacomment;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	dataplus = (struct mbf_sbsiolsi_struct *) mb_io_ptr->raw_data;
-	data = &(dataplus->data);
-	datacomment = (char *) data;
-	store = (struct mbsys_sb_struct *) store_ptr;
-
-	/* first set some plausible amounts for some of the
-		variables in the MBURICEN record */
-	data->axis = 0;
-	data->major = 0;
-	data->minor = 0;
-
-	/* second translate values from seabeam data storage structure */
-	if (store != NULL)
-		{
-		dataplus->kind = store->kind;
-		if (store->kind == MB_DATA_DATA)
-			{
-			/* position */
-			data->lon2u = store->lon2u;
-			data->lon2b = store->lon2b;
-			data->lat2u = store->lat2u;
-			data->lat2b = store->lat2b;
-
-			/* time stamp */
-			data->year = store->year;
-			data->day = store->day;
-			data->min = store->min;
-			data->sec = store->sec;
-
-			/* depths and distances */
-			for (i=0;i<MBSYS_SB_BEAMS;i++)
-				{
-				data->dist[i] = store->dist[i];
-				data->deph[i] = store->deph[i];
-				}
-
-			/* additional values */
-			data->sbhdg = store->sbhdg;
-			data->axis = store->axis;
-			data->major = store->major;
-			data->minor = store->minor;
-			}
-
-		/* comment */
-		else if (store->kind == MB_DATA_COMMENT)
-			{
-			strcpy(datacomment,"cc");
-			strncat(datacomment,store->comment,MBSYS_SB_MAXLINE-1);
-			}
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Ready to write data in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       kind:       %d\n",
-			dataplus->kind);
-		fprintf(stderr,"dbg5       error:      %d\n",*error);
-		fprintf(stderr,"dbg5       status:     %d\n",status);
-		}
-
-	/* byte swap the data if necessary */
-#ifdef BYTESWAPPED
-	if (dataplus->kind == MB_DATA_DATA)
-		{
-		for (i=0;i<MBSYS_SB_BEAMS;i++)
-			{
-			data->dist[i] = mb_swap_short(data->dist[i]);
-			data->deph[i] = mb_swap_short(data->deph[i]);
-			}
-		data->axis = mb_swap_short(data->axis);
-		data->major = mb_swap_short(data->major);
-		data->minor = mb_swap_short(data->minor);
-		data->sbhdg = mb_swap_short(data->sbhdg);
-		data->lat2b = mb_swap_short(data->lat2b);
-		data->lat2u = mb_swap_short(data->lat2u);
-		data->lon2b = mb_swap_short(data->lon2b);
-		data->lon2u = mb_swap_short(data->lon2u);
-		data->sec = mb_swap_short(data->sec);
-		data->min = mb_swap_short(data->min);
-		data->day = mb_swap_short(data->day);
-		data->year = mb_swap_short(data->year);
-		}
-#endif
-
-	/* write next record to file */
-	if (dataplus->kind == MB_DATA_DATA
-		|| dataplus->kind == MB_DATA_COMMENT)
-		{
-		if ((status = fwrite(data,1,mb_io_ptr->data_structure_size,
-			mb_io_ptr->mbfp)) == mb_io_ptr->data_structure_size)
-			{
-			status = MB_SUCCESS;
-			*error = MB_ERROR_NO_ERROR;
-			}
-		else
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_WRITE_FAIL;
-			}
-		}
-	else
-		{
-		status = MB_SUCCESS;
-		*error = MB_ERROR_NO_ERROR;
-		if (verbose >= 5)
-			fprintf(stderr,"\ndbg5  No data written in MBIO function <%s>\n",function_name);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mbr_sbsiomrg.c b/src/mbio/mbr_sbsiomrg.c
deleted file mode 100644
index ea18320..0000000
--- a/src/mbio/mbr_sbsiomrg.c
+++ /dev/null
@@ -1,909 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbr_sbsiomrg.c	2/2/93
- *	$Id: mbr_sbsiomrg.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1993-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbr_sbsiomrg.c contains the functions for reading and writing
- * multibeam data in the SBSIOMRG format.
- * These functions include:
- *   mbr_alm_sbsiomrg	- allocate read/write memory
- *   mbr_dem_sbsiomrg	- deallocate read/write memory
- *   mbr_rt_sbsiomrg	- read and translate data
- *   mbr_wt_sbsiomrg	- translate and write data
- *
- * Author:	D. W. Caress
- * Date:	February 2, 1993
- * $Log: mbr_sbsiomrg.c,v $
- * Revision 5.9  2005/11/05 00:48:05  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.8  2003/05/20 18:05:32  caress
- * Added svp_source to data source parameters.
- *
- * Revision 5.7  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.6  2002/10/15 18:34:58  caress
- * Release 5.0.beta25
- *
- * Revision 5.5  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.4  2002/02/26 07:50:41  caress
- * Release 5.0.beta14
- *
- * Revision 5.3  2001/07/20 00:32:54  caress
- * Release 5.0.beta03
- *
- * Revision 5.2  2001/03/22  20:50:02  caress
- * Trying to make version 5.0.beta0
- *
- * Revision 5.1  2001/01/22  07:43:34  caress
- * Version 5.0.beta01
- *
- * Revision 5.0  2000/12/01  22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.12  2000/10/11  01:03:21  caress
- * Convert to ANSI C
- *
- * Revision 4.11  2000/09/30  06:34:20  caress
- * Snapshot for Dale.
- *
- * Revision 4.10  1998/10/05  17:46:15  caress
- * MB-System version 4.6beta
- *
- * Revision 4.9  1997/07/25  14:19:53  caress
- * Version 4.5beta2.
- * Much mucking, particularly with Simrad formats.
- *
- * Revision 4.8  1997/04/21  17:02:07  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.7  1996/04/22  13:21:19  caress
- * Now have DTR and MIN/MAX defines in mb_define.h
- *
- * Revision 4.7  1996/04/22  13:21:19  caress
- * Now have DTR and MIN/MAX defines in mb_define.h
- *
- * Revision 4.6  1995/03/06  19:38:54  caress
- * Changed include strings.h to string.h for POSIX compliance.
- *
- * Revision 4.5  1995/02/14  15:10:38  caress
- * Fixed typo that set all acrosstrack distances to zero!!!
- *
- * Revision 4.4  1994/10/21  12:20:01  caress
- * Release V4.0
- *
- * Revision 4.3  1994/07/29  18:46:51  caress
- * Changes associated with supporting Lynx OS (byte swapped) and
- * using unix second time base (for time_d values).
- *
- * Revision 4.2  1994/05/21  02:23:29  caress
- * Made sure that mb_io_ptr->new_bath_alongtrack is set to zero on reading.
- *
- * Revision 4.1  1994/05/11  21:23:01  caress
- * Added initialization of bathalongtrack array.
- *
- * Revision 4.0  1994/03/06  00:01:56  caress
- * First cut at version 4.0
- *
- * Revision 4.1  1994/03/03  03:39:43  caress
- * Fixed copyright message.
- *
- * Revision 4.0  1994/02/21  03:59:50  caress
- * First cut at new version. Altered to be consistent
- * with passing of three types of data: bathymetry,
- * amplitude, and sidescan.
- *
- * Revision 3.1  1993/07/03  02:28:20  caress
- * Fixed bug where ping with single nonzero beam which is off-center
- * caused a divide by zero.  Such a beam will not be passed on by
- * the reading subroutines because the center beam is unknown.
- *
- * Revision 3.0  1993/05/14  22:58:04  sohara
- * initial version
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mb_define.h"
-#include "mbsys_sb.h"
-#include "mbf_sbsiomrg.h"
-
-/* include for byte swapping on little-endian machines */
-#ifdef BYTESWAPPED
-#include "mb_swap.h"
-#endif
-
-/* essential function prototypes */
-int mbr_register_sbsiomrg(int verbose, void *mbio_ptr,
-		int *error);
-int mbr_info_sbsiomrg(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_alm_sbsiomrg(int verbose, void *mbio_ptr, int *error);
-int mbr_dem_sbsiomrg(int verbose, void *mbio_ptr, int *error);
-int mbr_rt_sbsiomrg(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_wt_sbsiomrg(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-
-static char rcs_id[]="$Id: mbr_sbsiomrg.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mbr_register_sbsiomrg(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_register_sbsiomrg";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* get mb_io_ptr */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set format info parameters */
-	status = mbr_info_sbsiomrg(verbose,
-			&mb_io_ptr->system,
-			&mb_io_ptr->beams_bath_max,
-			&mb_io_ptr->beams_amp_max,
-			&mb_io_ptr->pixels_ss_max,
-			mb_io_ptr->format_name,
-			mb_io_ptr->system_name,
-			mb_io_ptr->format_description,
-			&mb_io_ptr->numfile,
-			&mb_io_ptr->filetype,
-			&mb_io_ptr->variable_beams,
-			&mb_io_ptr->traveltime,
-			&mb_io_ptr->beam_flagging,
-			&mb_io_ptr->nav_source,
-			&mb_io_ptr->heading_source,
-			&mb_io_ptr->vru_source,
-			&mb_io_ptr->svp_source,
-			&mb_io_ptr->beamwidth_xtrack,
-			&mb_io_ptr->beamwidth_ltrack,
-			error);
-
-	/* set format and system specific function pointers */
-	mb_io_ptr->mb_io_format_alloc = &mbr_alm_sbsiomrg;
-	mb_io_ptr->mb_io_format_free = &mbr_dem_sbsiomrg;
-	mb_io_ptr->mb_io_store_alloc = &mbsys_sb_alloc;
-	mb_io_ptr->mb_io_store_free = &mbsys_sb_deall;
-	mb_io_ptr->mb_io_read_ping = &mbr_rt_sbsiomrg;
-	mb_io_ptr->mb_io_write_ping = &mbr_wt_sbsiomrg;
-	mb_io_ptr->mb_io_dimensions = &mbsys_sb_dimensions;
-	mb_io_ptr->mb_io_extract = &mbsys_sb_extract;
-	mb_io_ptr->mb_io_insert = &mbsys_sb_insert;
-	mb_io_ptr->mb_io_extract_nav = &mbsys_sb_extract_nav;
-	mb_io_ptr->mb_io_insert_nav = &mbsys_sb_insert_nav;
-	mb_io_ptr->mb_io_extract_altitude = &mbsys_sb_extract_altitude;
-	mb_io_ptr->mb_io_insert_altitude = NULL;
-	mb_io_ptr->mb_io_extract_svp = NULL;
-	mb_io_ptr->mb_io_insert_svp = NULL;
-	mb_io_ptr->mb_io_ttimes = &mbsys_sb_ttimes;
-	mb_io_ptr->mb_io_detects = &mbsys_sb_detects;
-	mb_io_ptr->mb_io_copyrecord = &mbsys_sb_copy;
-	mb_io_ptr->mb_io_extract_rawss = NULL;
-	mb_io_ptr->mb_io_insert_rawss = NULL;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",mb_io_ptr->system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",mb_io_ptr->beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",mb_io_ptr->beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",mb_io_ptr->pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",mb_io_ptr->format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",mb_io_ptr->system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",mb_io_ptr->format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",mb_io_ptr->numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",mb_io_ptr->filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",mb_io_ptr->variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",mb_io_ptr->traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",mb_io_ptr->beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",mb_io_ptr->nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",mb_io_ptr->heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",mb_io_ptr->vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",mb_io_ptr->svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",mb_io_ptr->beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",mb_io_ptr->beamwidth_ltrack);
-		fprintf(stderr,"dbg2       format_alloc:       %p\n",(void *)mb_io_ptr->mb_io_format_alloc);
-		fprintf(stderr,"dbg2       format_free:        %p\n",(void *)mb_io_ptr->mb_io_format_free);
-		fprintf(stderr,"dbg2       store_alloc:        %p\n",(void *)mb_io_ptr->mb_io_store_alloc);
-		fprintf(stderr,"dbg2       store_free:         %p\n",(void *)mb_io_ptr->mb_io_store_free);
-		fprintf(stderr,"dbg2       read_ping:          %p\n",(void *)mb_io_ptr->mb_io_read_ping);
-		fprintf(stderr,"dbg2       write_ping:         %p\n",(void *)mb_io_ptr->mb_io_write_ping);
-		fprintf(stderr,"dbg2       extract:            %p\n",(void *)mb_io_ptr->mb_io_extract);
-		fprintf(stderr,"dbg2       insert:             %p\n",(void *)mb_io_ptr->mb_io_insert);
-		fprintf(stderr,"dbg2       extract_nav:        %p\n",(void *)mb_io_ptr->mb_io_extract_nav);
-		fprintf(stderr,"dbg2       insert_nav:         %p\n",(void *)mb_io_ptr->mb_io_insert_nav);
-		fprintf(stderr,"dbg2       extract_altitude:   %p\n",(void *)mb_io_ptr->mb_io_extract_altitude);
-		fprintf(stderr,"dbg2       insert_altitude:    %p\n",(void *)mb_io_ptr->mb_io_insert_altitude);
-		fprintf(stderr,"dbg2       extract_svp:        %p\n",(void *)mb_io_ptr->mb_io_extract_svp);
-		fprintf(stderr,"dbg2       insert_svp:         %p\n",(void *)mb_io_ptr->mb_io_insert_svp);
-		fprintf(stderr,"dbg2       ttimes:             %p\n",(void *)mb_io_ptr->mb_io_ttimes);
-		fprintf(stderr,"dbg2       detects:            %p\n",(void *)mb_io_ptr->mb_io_detects);
-		fprintf(stderr,"dbg2       extract_rawss:      %p\n",(void *)mb_io_ptr->mb_io_extract_rawss);
-		fprintf(stderr,"dbg2       insert_rawss:       %p\n",(void *)mb_io_ptr->mb_io_insert_rawss);
-		fprintf(stderr,"dbg2       copyrecord:         %p\n",(void *)mb_io_ptr->mb_io_copyrecord);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbr_info_sbsiomrg(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error)
-{
-	char	*function_name = "mbr_info_sbsiomrg";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* set format info parameters */
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-	*system = MB_SYS_SB;
-	*beams_bath_max = 19;
-	*beams_amp_max = 0;
-	*pixels_ss_max = 0;
-	strncpy(format_name, "SBSIOMRG", MB_NAME_LENGTH);
-	strncpy(system_name, "SB", MB_NAME_LENGTH);
-	strncpy(format_description, "Format name:          MBF_SBSIOMRG\nInformal Description: SIO merge Sea Beam\nAttributes:           Sea Beam, bathymetry, 16 beams, binary, uncentered,\n                      SIO.\n", MB_DESCRIPTION_LENGTH);
-	*numfile = 1;
-	*filetype = MB_FILETYPE_NORMAL;
-	*variable_beams = MB_NO;
-	*traveltime = MB_NO;
-	*beam_flagging = MB_YES;
-	*nav_source = MB_DATA_DATA;
-	*heading_source = MB_DATA_DATA;
-	*vru_source = MB_DATA_DATA;
-	*svp_source = MB_DATA_NONE;
-	*beamwidth_xtrack = 2.67;
-	*beamwidth_ltrack = 2.67;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",*system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",*beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",*beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",*pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",*numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",*filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",*variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",*traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",*beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",*nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",*heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",*vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",*svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",*beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",*beamwidth_ltrack);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_alm_sbsiomrg(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_alm_sbsiomrg";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set initial status */
-	status = MB_SUCCESS;
-
-	/* allocate memory for data structure */
-	mb_io_ptr->structure_size = sizeof(struct mbf_sbsiomrg_struct);
-	mb_io_ptr->data_structure_size =
-		sizeof(struct mbf_sbsiomrg_data_struct);
-	status = mb_malloc(verbose,mb_io_ptr->structure_size,
-				&mb_io_ptr->raw_data,error);
-	status = mb_malloc(verbose,sizeof(struct mbsys_sb_struct),
-				&mb_io_ptr->store_data,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_dem_sbsiomrg(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_dem_sbsiomrg";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* deallocate memory for data descriptor */
-	status = mb_free(verbose,&mb_io_ptr->raw_data,error);
-	status = mb_free(verbose,&mb_io_ptr->store_data,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_rt_sbsiomrg(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_rt_sbsiomrg";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_sbsiomrg_struct *dataplus;
-	struct mbf_sbsiomrg_data_struct *data;
-	struct mbsys_sb_struct *store;
-	char	*datacomment;
-	int	i, j, k, l;
-	int	icenter;
-	int	jpos, jneg;
-	int	ipos, ineg;
-	int	apos, aneg;
-	int	id;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	dataplus = (struct mbf_sbsiomrg_struct *) mb_io_ptr->raw_data;
-	data = &(dataplus->data);
-	datacomment = (char *) data;
-	dataplus->kind = MB_DATA_DATA;
-	store = (struct mbsys_sb_struct *) store_ptr;
-
-	/* read next record from file */
-	mb_io_ptr->file_pos = mb_io_ptr->file_bytes;
-	if ((status = fread(data,1,mb_io_ptr->data_structure_size,
-			mb_io_ptr->mbfp)) == mb_io_ptr->data_structure_size)
-		{
-		mb_io_ptr->file_bytes += status;
-		status = MB_SUCCESS;
-		*error = MB_ERROR_NO_ERROR;
-		}
-	else
-		{
-		mb_io_ptr->file_bytes += status;
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	/* check for comment or unintelligible records */
-	if (status == MB_SUCCESS)
-		{
-		if (datacomment[0] == '#')
-			{
-			dataplus->kind = MB_DATA_COMMENT;
-			}
-		else if (data->year == 0)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_UNINTELLIGIBLE;
-			}
-		else
-			{
-			dataplus->kind = MB_DATA_DATA;
-			}
-		}
-
-	/* byte swap the data if necessary */
-#ifdef BYTESWAPPED
-	if (status == MB_SUCCESS
-		&& dataplus->kind == MB_DATA_DATA)
-		{
-		data->year = mb_swap_short(data->year);
-		data->day = mb_swap_short(data->day);
-		data->min = mb_swap_short(data->min);
-		data->sec = mb_swap_short(data->sec);
-		data->lat2u = mb_swap_short(data->lat2u);
-		data->lat2b = mb_swap_short(data->lat2b);
-		data->lon2u = mb_swap_short(data->lon2u);
-		data->lon2b = mb_swap_short(data->lon2b);
-		for (i=0;i<3;i++)
-			data->spare1[i] = mb_swap_short(data->spare1[i]);
-		data->sbtim = mb_swap_short(data->sbtim);
-		data->sbhdg = mb_swap_short(data->sbhdg);
-		for (i=0;i<MB_BEAMS_RAW_SBSIOMRG;i++)
-			{
-			data->dist[i] = mb_swap_short(data->dist[i]);
-			data->deph[i] = mb_swap_short(data->deph[i]);
-			}
-		for (i=0;i<5;i++)
-			data->spare2[i] = mb_swap_short(data->spare2[i]);
-		}
-#endif
-
-	/* set kind and error in mb_io_ptr */
-	mb_io_ptr->new_kind = dataplus->kind;
-	mb_io_ptr->new_error = *error;
-
-	/* print debug statements */
-	if (verbose >= 5 && status == MB_SUCCESS
-		&& dataplus->kind == MB_DATA_DATA)
-		{
-		fprintf(stderr,"\ndbg5  New ping read by MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5  Raw ping values:\n");
-		fprintf(stderr,"dbg5       year:       %d\n",data->year);
-		fprintf(stderr,"dbg5       day:        %d\n",data->day);
-		fprintf(stderr,"dbg5       min:        %d\n",data->min);
-		fprintf(stderr,"dbg5       sec:        %d\n",data->sec);
-		fprintf(stderr,"dbg5       lon2u:      %d\n",data->lon2u);
-		fprintf(stderr,"dbg5       lon2b:      %d\n",data->lon2b);
-		fprintf(stderr,"dbg5       lat2u:      %d\n",data->lat2u);
-		fprintf(stderr,"dbg5       lat2b:      %d\n",data->lat2b);
-		fprintf(stderr,"dbg5       spare1[0]:  %d\n",data->spare1[0]);
-		fprintf(stderr,"dbg5       spare1[1]:  %d\n",data->spare1[1]);
-		fprintf(stderr,"dbg5       spare1[2]:  %d\n",data->spare1[2]);
-		fprintf(stderr,"dbg5       sbtim:      %d\n",data->sbtim);
-		fprintf(stderr,"dbg5       sbhdg:      %d\n",data->sbhdg);
-		fprintf(stderr,"dbg5       spare2[0]:  %d\n",data->spare2[0]);
-		fprintf(stderr,"dbg5       spare2[1]:  %d\n",data->spare2[1]);
-		fprintf(stderr,"dbg5       spare2[2]:  %d\n",data->spare2[2]);
-		fprintf(stderr,"dbg5       spare2[3]:  %d\n",data->spare2[3]);
-		fprintf(stderr,"dbg5       spare2[4]:  %d\n",data->spare2[4]);
-		for (i=0;i<MB_BEAMS_RAW_SBSIOMRG;i++)
-			fprintf(stderr,"dbg5       deph[%d]: %d  dist[%d]: %d\n",
-				i,data->deph[i],
-				i,data->dist[i]);
-		}
-
-	/* translate values to seabeam data storage structure */
-	if (status == MB_SUCCESS)
-		{
-		/* type of data record */
-		store->kind = dataplus->kind;
-
-		if (store->kind == MB_DATA_DATA)
-			{
-			/* position */
-			store->lon2u = data->lon2u;
-			store->lon2b = data->lon2b;
-			store->lat2u = data->lat2u;
-			store->lat2b = data->lat2b;
-
-			/* time stamp */
-			store->year = data->year;
-			store->day = data->day;
-			store->min = data->min;
-			store->sec = data->sec;
-
-			/* zero arrays */
-			for (i=0;i<MBSYS_SB_BEAMS;i++)
-				{
-				store->deph[i] = 0;
-				store->dist[i] = 0;
-				}
-
-			/* find center beam */
-			icenter = -1;
-			for (i=0;i<MB_BEAMS_RAW_SBSIOMRG;i++)
-				{
-				if (data->dist[i] == 0
-					&& data->deph[i] != 0)
-					icenter = i;
-				if (icenter < 0 && data->dist[i] == 0
-					&& data->dist[i-1] < 0
-					&& data->dist[i+1] > 0)
-					icenter = i;
-				}
-
-			/* get center beam from closest distances if still needed */
-			if (icenter < 0)
-				{
-				jpos = 0;
-				jneg = 0;
-				for (i=0;i<MB_BEAMS_RAW_SBSIOMRG;i++)
-					{
-					if (data->dist[i] > 0
-					&& (data->dist[i] < jpos
-						|| jpos == 0))
-						{
-						jpos = data->dist[i];
-						ipos = i;
-						}
-					if (data->dist[i] < 0
-						&& (data->dist[i] > jneg
-						|| jneg == 0))
-						{
-						jneg = data->dist[i];
-						ineg = i;
-						}
-					}
-				if (jpos > 0 && jneg < 0)
-					{
-					apos = jpos;
-					aneg = jneg;
-					icenter = ineg + (int)((ipos-ineg)*
-						((0 - aneg)/(apos-aneg)) + 0.5);
-					}
-				if (icenter < 0 || icenter >= MB_BEAMS_RAW_SBSIOMRG)
-					icenter = -1;
-				}
-
-			/* get center beam from any distances if still needed */
-			if (icenter < 0)
-				{
-				jneg = 0;
-				jpos = 0;
-				for (i=0;i<MB_BEAMS_RAW_SBSIOMRG;i++)
-					{
-					if (data->dist[i] != 0)
-						{
-						if (jneg == 0 && jpos == 0)
-							{
-							jneg = data->dist[i];
-							ineg = i;
-							jpos = data->dist[i];
-							ipos = i;
-							}
-						else if (data->dist[i] < jneg)
-							{
-							jneg = data->dist[i];
-							ineg = i;
-							}
-						else if (data->dist[i] > jpos)
-							{
-							jpos = data->dist[i];
-							ipos = i;
-							}
-						}
-					}
-				if (jpos != 0 && jneg != 0 && jpos != jneg)
-					{
-					apos = jpos;
-					aneg = jneg;
-					icenter = ineg + (int)((ipos-ineg)*
-						((0 - aneg)/(apos-aneg)) + 0.5);
-					}
-				if (icenter < 0 || icenter >= MB_BEAMS_RAW_SBSIOMRG)
-					icenter = -1;
-				}
-
-			/* center the data in the global arrays */
-			if (icenter >= 0)
-				{
-				id = MB_BEAMS_PROC_SBSIOMRG/2 - icenter;
-				j = 0;
-				k = MB_BEAMS_RAW_SBSIOMRG;
-				if (id < 0) j = -id;
-				if (id > (MB_BEAMS_PROC_SBSIOMRG
-					- MB_BEAMS_RAW_SBSIOMRG))
-					k = MB_BEAMS_PROC_SBSIOMRG - id;
-				for (i=j;i<k;i++)
-					{
-					l = MBSYS_SB_BEAMS - 1 - id - i;
-					store->deph[l] = data->deph[i];
-					store->dist[l] = data->dist[i];
-					}
-				}
-
-			/* additional values */
-			store->sbtim = data->sbtim;
-			store->sbhdg = data->sbhdg;
-			store->axis = 0;
-			store->major = 0;
-			store->minor = 0;
-			}
-
-		else if (store->kind == MB_DATA_COMMENT)
-			{
-			/* comment */
-			strncpy(store->comment,&datacomment[2],
-				MBSYS_SB_MAXLINE);
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_wt_sbsiomrg(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_wt_sbsiomrg";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_sbsiomrg_struct *dataplus;
-	struct mbf_sbsiomrg_data_struct *data;
-	struct mbsys_sb_struct *store;
-	char	*datacomment;
-	int	i, j;
-	int	offset, iend, id;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	dataplus = (struct mbf_sbsiomrg_struct *) mb_io_ptr->raw_data;
-	data = &(dataplus->data);
-	datacomment = (char *) data;
-	store = (struct mbsys_sb_struct *) store_ptr;
-
-	/* translate values from seabeam data storage structure */
-		dataplus->kind = store->kind;
-	if (store->kind == MB_DATA_DATA)
-		{
-		/* position */
-		data->lon2u = store->lon2u;
-		data->lon2b = store->lon2b;
-		data->lat2u = store->lat2u;
-		data->lat2b = store->lat2b;
-
-		/* time stamp */
-		data->year = store->year;
-		data->day = store->day;
-		data->min = store->min;
-		data->sec = store->sec;
-
-		/* put distance and depth values
-			into sbsiomrg data structure */
-
-		/* initialize depth and distance in
-			output structure */
-		for (i=0;i<MB_BEAMS_RAW_SBSIOMRG;i++)
-			{
-			data->deph[i] = 0;
-			data->dist[i] = 0;
-			}
-
-		/* find first nonzero beam */
-		id = MB_BEAMS_PROC_SBSIOMRG - 1;
-		offset = -1;
-		for (i=0;i<MB_BEAMS_PROC_SBSIOMRG;i++)
-			if (store->deph[id-i] != 0
-				&& offset == -1)
-				offset = i;
-		if (offset == -1) offset = 0;
-		iend = MB_BEAMS_RAW_SBSIOMRG;
-		if (iend + offset > MB_BEAMS_PROC_SBSIOMRG)
-			iend = MB_BEAMS_PROC_SBSIOMRG - offset;
-
-		/* read depth and distance values into
-			output structure */
-		for (i=0;i<iend;i++)
-			{
-			j = id - i - offset;
-			data->deph[i] = store->deph[j];
-			data->dist[i] = store->dist[j];
-			}
-
-		/* additional values */
-		data->sbtim = store->sbtim;
-		data->sbhdg = store->sbhdg;
-		}
-
-	/* comment */
-	else if (store->kind == MB_DATA_COMMENT)
-		{
-		strcpy(datacomment,"##");
-		strncat(datacomment,store->comment,
-			mb_io_ptr->data_structure_size-3);
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Ready to write data in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       kind:       %d\n",
-			dataplus->kind);
-		fprintf(stderr,"dbg5       error:      %d\n",*error);
-		fprintf(stderr,"dbg5       status:     %d\n",status);
-		}
-
-	/* byte swap the data if necessary */
-#ifdef BYTESWAPPED
-	if (dataplus->kind == MB_DATA_DATA)
-		{
-		data->year = mb_swap_short(data->year);
-		data->day = mb_swap_short(data->day);
-		data->min = mb_swap_short(data->min);
-		data->sec = mb_swap_short(data->sec);
-		data->lat2u = mb_swap_short(data->lat2u);
-		data->lat2b = mb_swap_short(data->lat2b);
-		data->lon2u = mb_swap_short(data->lon2u);
-		data->lon2b = mb_swap_short(data->lon2b);
-		for (i=0;i<3;i++)
-			data->spare1[i] = mb_swap_short(data->spare1[i]);
-		data->sbtim = mb_swap_short(data->sbtim);
-		data->sbhdg = mb_swap_short(data->sbhdg);
-		for (i=0;i<MB_BEAMS_RAW_SBSIOMRG;i++)
-			{
-			data->dist[i] = mb_swap_short(data->dist[i]);
-			data->deph[i] = mb_swap_short(data->deph[i]);
-			}
-		for (i=0;i<5;i++)
-			data->spare2[i] = mb_swap_short(data->spare2[i]);
-		}
-#endif
-
-	/* write next record to file */
-	if (dataplus->kind == MB_DATA_DATA
-		|| dataplus->kind == MB_DATA_COMMENT)
-		{
-		if ((status = fwrite(data,1,mb_io_ptr->data_structure_size,
-			mb_io_ptr->mbfp)) == mb_io_ptr->data_structure_size)
-			{
-			status = MB_SUCCESS;
-			*error = MB_ERROR_NO_ERROR;
-			}
-		else
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_WRITE_FAIL;
-			}
-		}
-	else
-		{
-		status = MB_SUCCESS;
-		*error = MB_ERROR_NO_ERROR;
-		if (verbose >= 5)
-			fprintf(stderr,"\ndbg5  No data written in MBIO function <%s>\n",function_name);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mbr_sbsioswb.c b/src/mbio/mbr_sbsioswb.c
deleted file mode 100644
index 70016a1..0000000
--- a/src/mbio/mbr_sbsioswb.c
+++ /dev/null
@@ -1,1304 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbr_sbsioswb.c	9/18/93
- *	$Id: mbr_sbsioswb.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1994-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbr_sbsioswb.c contains the functions for reading and writing
- * multibeam data in the SBSIOSWB format.
- * These functions include:
- *   mbr_alm_sbsioswb	- allocate read/write memory
- *   mbr_dem_sbsioswb	- deallocate read/write memory
- *   mbr_rt_sbsioswb	- read and translate data
- *   mbr_wt_sbsioswb	- translate and write data
- *
- * Author:	D. W. Caress
- * Date:	February 2, 1993
- * $Log: mbr_sbsioswb.c,v $
- * Revision 5.13  2009/03/08 09:21:00  caress
- * Fixed problem reading and writing format 16 (MBF_SBSIOSWB) data on little endian systems.
- *
- * Revision 5.12  2009/01/07 17:46:44  caress
- * Moved macro round() into mb_define.h as ROUND()
- *
- * Revision 5.11  2005/11/05 00:48:04  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.10  2003/05/20 18:05:32  caress
- * Added svp_source to data source parameters.
- *
- * Revision 5.9  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.8  2002/10/15 18:34:58  caress
- * Release 5.0.beta25
- *
- * Revision 5.7  2002/09/25 20:41:04  caress
- * Added check for corrupted records.
- *
- * Revision 5.6  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.5  2002/02/26 07:50:41  caress
- * Release 5.0.beta14
- *
- * Revision 5.4  2002/02/22 09:03:43  caress
- * Release 5.0.beta13
- *
- * Revision 5.3  2001/07/20 00:32:54  caress
- * Release 5.0.beta03
- *
- * Revision 5.2  2001/03/22  20:50:02  caress
- * Trying to make version 5.0.beta0
- *
- * Revision 5.1  2001/01/22  07:43:34  caress
- * Version 5.0.beta01
- *
- * Revision 5.0  2000/12/01  22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.12  2000/10/11  01:03:21  caress
- * Convert to ANSI C
- *
- * Revision 4.11  2000/09/30  06:34:20  caress
- * Snapshot for Dale.
- *
- * Revision 4.10  1999/08/06  00:47:44  caress
- * Added code to handle case where fewer beams than listed are actually
- * in the data.
- *
- * Revision 4.9  1999/02/04  23:52:54  caress
- * MB-System version 4.6beta7
- *
- * Revision 4.8  1998/10/05  17:46:15  caress
- * MB-System version 4.6beta
- *
- * Revision 4.7  1997/07/25  14:19:53  caress
- * Version 4.5beta2.
- * Much mucking, particularly with Simrad formats.
- *
- * Revision 4.6  1997/04/21  17:02:07  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.5  1996/04/22  13:21:19  caress
- * Now have DTR and MIN/MAX defines in mb_define.h
- *
- * Revision 4.5  1996/04/22  13:21:19  caress
- * Now have DTR and MIN/MAX defines in mb_define.h
- *
- * Revision 4.4  1995/03/22  19:44:26  caress
- * Added explicit casts to shorts divided by doubles for
- * ansi C compliance.
- *
- * Revision 4.3  1995/03/06  19:38:54  caress
- * Changed include strings.h to string.h for POSIX compliance.
- *
- * Revision 4.2  1994/11/01  16:00:08  caress
- * Fixed heading output handling.
- *
- * Revision 4.1  1994/10/21  15:42:42  caress
- * Release V4.0
- *
- * Revision 4.0  1994/10/21  12:34:58  caress
- * Release V4.0
- *
- * Revision 1.1  1994/10/21  12:20:01  caress
- * Initial revision
- *
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mb_define.h"
-#include "mbsys_sb.h"
-#include "mbf_sbsioswb.h"
-
-/* include for byte swapping on little-endian machines */
-#ifdef BYTESWAPPED
-#include "mb_swap.h"
-#endif
-
-/* essential function prototypes */
-int mbr_register_sbsioswb(int verbose, void *mbio_ptr,
-		int *error);
-int mbr_info_sbsioswb(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_alm_sbsioswb(int verbose, void *mbio_ptr, int *error);
-int mbr_dem_sbsioswb(int verbose, void *mbio_ptr, int *error);
-int mbr_rt_sbsioswb(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_wt_sbsioswb(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-
-static char rcs_id[]="$Id: mbr_sbsioswb.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mbr_register_sbsioswb(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_register_sbsioswb";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* get mb_io_ptr */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set format info parameters */
-	status = mbr_info_sbsioswb(verbose,
-			&mb_io_ptr->system,
-			&mb_io_ptr->beams_bath_max,
-			&mb_io_ptr->beams_amp_max,
-			&mb_io_ptr->pixels_ss_max,
-			mb_io_ptr->format_name,
-			mb_io_ptr->system_name,
-			mb_io_ptr->format_description,
-			&mb_io_ptr->numfile,
-			&mb_io_ptr->filetype,
-			&mb_io_ptr->variable_beams,
-			&mb_io_ptr->traveltime,
-			&mb_io_ptr->beam_flagging,
-			&mb_io_ptr->nav_source,
-			&mb_io_ptr->heading_source,
-			&mb_io_ptr->vru_source,
-			&mb_io_ptr->svp_source,
-			&mb_io_ptr->beamwidth_xtrack,
-			&mb_io_ptr->beamwidth_ltrack,
-			error);
-
-	/* set format and system specific function pointers */
-	mb_io_ptr->mb_io_format_alloc = &mbr_alm_sbsioswb;
-	mb_io_ptr->mb_io_format_free = &mbr_dem_sbsioswb;
-	mb_io_ptr->mb_io_store_alloc = &mbsys_sb_alloc;
-	mb_io_ptr->mb_io_store_free = &mbsys_sb_deall;
-	mb_io_ptr->mb_io_read_ping = &mbr_rt_sbsioswb;
-	mb_io_ptr->mb_io_write_ping = &mbr_wt_sbsioswb;
-	mb_io_ptr->mb_io_dimensions = &mbsys_sb_dimensions;
-	mb_io_ptr->mb_io_extract = &mbsys_sb_extract;
-	mb_io_ptr->mb_io_insert = &mbsys_sb_insert;
-	mb_io_ptr->mb_io_extract_nav = &mbsys_sb_extract_nav;
-	mb_io_ptr->mb_io_insert_nav = &mbsys_sb_insert_nav;
-	mb_io_ptr->mb_io_extract_altitude = &mbsys_sb_extract_altitude;
-	mb_io_ptr->mb_io_insert_altitude = NULL;
-	mb_io_ptr->mb_io_extract_svp = NULL;
-	mb_io_ptr->mb_io_insert_svp = NULL;
-	mb_io_ptr->mb_io_ttimes = &mbsys_sb_ttimes;
-	mb_io_ptr->mb_io_detects = &mbsys_sb_detects;
-	mb_io_ptr->mb_io_copyrecord = &mbsys_sb_copy;
-	mb_io_ptr->mb_io_extract_rawss = NULL;
-	mb_io_ptr->mb_io_insert_rawss = NULL;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",mb_io_ptr->system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",mb_io_ptr->beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",mb_io_ptr->beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",mb_io_ptr->pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",mb_io_ptr->format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",mb_io_ptr->system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",mb_io_ptr->format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",mb_io_ptr->numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",mb_io_ptr->filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",mb_io_ptr->variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",mb_io_ptr->traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",mb_io_ptr->beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",mb_io_ptr->nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",mb_io_ptr->heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",mb_io_ptr->vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",mb_io_ptr->svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",mb_io_ptr->beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",mb_io_ptr->beamwidth_ltrack);
-		fprintf(stderr,"dbg2       format_alloc:       %p\n",(void *)mb_io_ptr->mb_io_format_alloc);
-		fprintf(stderr,"dbg2       format_free:        %p\n",(void *)mb_io_ptr->mb_io_format_free);
-		fprintf(stderr,"dbg2       store_alloc:        %p\n",(void *)mb_io_ptr->mb_io_store_alloc);
-		fprintf(stderr,"dbg2       store_free:         %p\n",(void *)mb_io_ptr->mb_io_store_free);
-		fprintf(stderr,"dbg2       read_ping:          %p\n",(void *)mb_io_ptr->mb_io_read_ping);
-		fprintf(stderr,"dbg2       write_ping:         %p\n",(void *)mb_io_ptr->mb_io_write_ping);
-		fprintf(stderr,"dbg2       extract:            %p\n",(void *)mb_io_ptr->mb_io_extract);
-		fprintf(stderr,"dbg2       insert:             %p\n",(void *)mb_io_ptr->mb_io_insert);
-		fprintf(stderr,"dbg2       extract_nav:        %p\n",(void *)mb_io_ptr->mb_io_extract_nav);
-		fprintf(stderr,"dbg2       insert_nav:         %p\n",(void *)mb_io_ptr->mb_io_insert_nav);
-		fprintf(stderr,"dbg2       extract_altitude:   %p\n",(void *)mb_io_ptr->mb_io_extract_altitude);
-		fprintf(stderr,"dbg2       insert_altitude:    %p\n",(void *)mb_io_ptr->mb_io_insert_altitude);
-		fprintf(stderr,"dbg2       extract_svp:        %p\n",(void *)mb_io_ptr->mb_io_extract_svp);
-		fprintf(stderr,"dbg2       insert_svp:         %p\n",(void *)mb_io_ptr->mb_io_insert_svp);
-		fprintf(stderr,"dbg2       ttimes:             %p\n",(void *)mb_io_ptr->mb_io_ttimes);
-		fprintf(stderr,"dbg2       detects:            %p\n",(void *)mb_io_ptr->mb_io_detects);
-		fprintf(stderr,"dbg2       extract_rawss:      %p\n",(void *)mb_io_ptr->mb_io_extract_rawss);
-		fprintf(stderr,"dbg2       insert_rawss:       %p\n",(void *)mb_io_ptr->mb_io_insert_rawss);
-		fprintf(stderr,"dbg2       copyrecord:         %p\n",(void *)mb_io_ptr->mb_io_copyrecord);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbr_info_sbsioswb(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error)
-{
-	char	*function_name = "mbr_info_sbsioswb";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* set format info parameters */
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-	*system = MB_SYS_SB;
-	*beams_bath_max = 19;
-	*beams_amp_max = 0;
-	*pixels_ss_max = 0;
-	strncpy(format_name, "SBSIOSWB", MB_NAME_LENGTH);
-	strncpy(system_name, "SB", MB_NAME_LENGTH);
-	strncpy(format_description, "Format name:          MBF_SBSIOSWB\nInformal Description: SIO Swath-bathy SeaBeam\nAttributes:           Sea Beam, bathymetry, 19 beams, binary, centered,\n                      SIO.\n", MB_DESCRIPTION_LENGTH);
-	*numfile = 1;
-	*filetype = MB_FILETYPE_NORMAL;
-	*variable_beams = MB_NO;
-	*traveltime = MB_NO;
-	*beam_flagging = MB_YES;
-	*nav_source = MB_DATA_DATA;
-	*heading_source = MB_DATA_DATA;
-	*vru_source = MB_DATA_DATA;
-	*svp_source = MB_DATA_VELOCITY_PROFILE;
-	*beamwidth_xtrack = 2.67;
-	*beamwidth_ltrack = 2.67;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",*system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",*beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",*beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",*pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",*numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",*filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",*variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",*traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",*beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",*nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",*heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",*vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",*svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",*beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",*beamwidth_ltrack);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_alm_sbsioswb(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_alm_sbsioswb";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set initial status */
-	status = MB_SUCCESS;
-
-	/* allocate memory for data structure */
-	mb_io_ptr->structure_size = sizeof(struct mbf_sbsioswb_struct);
-	status = mb_malloc(verbose,mb_io_ptr->structure_size,
-				&mb_io_ptr->raw_data,error);
-	status = mb_malloc(verbose,sizeof(struct mbsys_sb_struct),
-				&mb_io_ptr->store_data,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_dem_sbsioswb(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_dem_sbsioswb";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* deallocate memory for data descriptor */
-	status = mb_free(verbose,&mb_io_ptr->raw_data,error);
-	status = mb_free(verbose,&mb_io_ptr->store_data,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_rt_sbsioswb(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_rt_sbsioswb";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_sbsioswb_struct *data;
-	struct mbsys_sb_struct *store;
-	char	*headerptr;
-	char	*sensorptr;
-	char	*datarecptr;
-	char	*commentptr;
-	int	read_status;
-	char	dummy[2];
-	double	lon, lat;
-	int	id;
-	int	skip;
-	int	i, k;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_sbsioswb_struct *) mb_io_ptr->raw_data;
-	store = (struct mbsys_sb_struct *) store_ptr;
-
-	/* get pointers to records */
-	headerptr = (char *) &data->year;
-	sensorptr = (char *) &data->eclipse_time;
-	datarecptr = (char *) &data->beams_bath;
-	commentptr = (char *) &data->comment[0];
-	skip = 0;
-
-	/* read next header record from file */
-	mb_io_ptr->file_pos = mb_io_ptr->file_bytes;
-	if ((status = fread(headerptr,1,MB_SBSIOSWB_HEADER_SIZE,
-			mb_io_ptr->mbfp)) == MB_SBSIOSWB_HEADER_SIZE)
-		{
-		mb_io_ptr->file_bytes += status;
-		status = MB_SUCCESS;
-		*error = MB_ERROR_NO_ERROR;
-		}
-	else
-		{
-		mb_io_ptr->file_bytes += status;
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	/* byte swap the data if necessary */
-#ifdef BYTESWAPPED
-	if (status == MB_SUCCESS)
-		{
-		data->year = mb_swap_short(data->year);
-		data->day = mb_swap_short(data->day);
-		data->min = mb_swap_short(data->min);
-		data->sec = mb_swap_short(data->sec);
-		data->lat = mb_swap_int(data->lat);
-		data->lon = mb_swap_int(data->lon);
-		data->heading = mb_swap_short(data->heading);
-		data->course = mb_swap_short(data->course);
-		data->speed = mb_swap_short(data->speed);
-		data->speed_ps = mb_swap_short(data->speed_ps);
-		data->quality = mb_swap_short(data->quality);
-		data->sensor_size = mb_swap_short(data->sensor_size);
-		data->data_size = mb_swap_short(data->data_size);
-		}
-#endif
-
-	/* print debug statements */
-	if (status == MB_SUCCESS && verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  New header record read by MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5  New header values:\n");
-		fprintf(stderr,"dbg5       year:       %d\n",data->year);
-		fprintf(stderr,"dbg5       day:        %d\n",data->day);
-		fprintf(stderr,"dbg5       min:        %d\n",data->min);
-		fprintf(stderr,"dbg5       sec:        %d\n",data->sec);
-		fprintf(stderr,"dbg5       lat:        %d\n",data->lat);
-		fprintf(stderr,"dbg5       lon:        %d\n",data->lon);
-		fprintf(stderr,"dbg5       heading:    %d\n",data->heading);
-		fprintf(stderr,"dbg5       course:     %d\n",data->course);
-		fprintf(stderr,"dbg5       speed:      %d\n",data->speed);
-		fprintf(stderr,"dbg5       speed_ps:   %d\n",data->speed_ps);
-		fprintf(stderr,"dbg5       quality:    %d\n",data->quality);
-		fprintf(stderr,"dbg5       sensor size:%d\n",data->sensor_size);
-		fprintf(stderr,"dbg5       data size:  %d\n",data->data_size);
-		fprintf(stderr,"dbg5       speed_ref:  %c%c\n",
-			data->speed_ref[0],data->speed_ref[1]);
-		fprintf(stderr,"dbg5       sensor_type:%c%c\n",
-			data->sensor_type[0],data->sensor_type[1]);
-		fprintf(stderr,"dbg5       data_type:  %c%c\n",
-			data->data_type[0],data->data_type[1]);
-		}
-
-	/* if not a good header search through file to find one */
-	while (status == MB_SUCCESS &&
-		(strncmp(data->data_type,"SR",2) != 0
-		&& strncmp(data->data_type,"RS",2) != 0
-		&& strncmp(data->data_type,"SP",2) != 0
-		&& strncmp(data->data_type,"TR",2) != 0
-		&& strncmp(data->data_type,"IR",2) != 0
-		&& strncmp(data->data_type,"AT",2) != 0
-		&& strncmp(data->data_type,"SC",2) != 0))
-		{
-		/* unswap data if necessary */
-#ifdef BYTESWAPPED
-		data->year = mb_swap_short(data->year);
-		data->day = mb_swap_short(data->day);
-		data->min = mb_swap_short(data->min);
-		data->sec = mb_swap_short(data->sec);
-		data->lat = mb_swap_int(data->lat);
-		data->lon = mb_swap_int(data->lon);
-		data->heading = mb_swap_short(data->heading);
-		data->course = mb_swap_short(data->course);
-		data->speed = mb_swap_short(data->speed);
-		data->speed_ps = mb_swap_short(data->speed_ps);
-		data->quality = mb_swap_short(data->quality);
-		data->sensor_size = mb_swap_short(data->sensor_size);
-		data->data_size = mb_swap_short(data->data_size);
-#endif
-
-		/* shift bytes by one */
-		for (i=0;i<MB_SBSIOSWB_HEADER_SIZE-1;i++)
-			headerptr[i] = headerptr[i+1];
-		mb_io_ptr->file_pos += 1;
-
-		/* read next byte */
-		if ((status = fread(&headerptr[MB_SBSIOSWB_HEADER_SIZE-1],
-			1,1,mb_io_ptr->mbfp)) == 1)
-			{
-			mb_io_ptr->file_bytes += status;
-			skip++;
-			status = MB_SUCCESS;
-			*error = MB_ERROR_NO_ERROR;
-			}
-		else
-			{
-			mb_io_ptr->file_bytes += status;
-			status = MB_FAILURE;
-			*error = MB_ERROR_EOF;
-			}
-
-		/* swap data if necessary */
-#ifdef BYTESWAPPED
-		data->year = mb_swap_short(data->year);
-		data->day = mb_swap_short(data->day);
-		data->min = mb_swap_short(data->min);
-		data->sec = mb_swap_short(data->sec);
-		data->lat = mb_swap_int(data->lat);
-		data->lon = mb_swap_int(data->lon);
-		data->heading = mb_swap_short(data->heading);
-		data->course = mb_swap_short(data->course);
-		data->speed = mb_swap_short(data->speed);
-		data->speed_ps = mb_swap_short(data->speed_ps);
-		data->quality = mb_swap_short(data->quality);
-		data->sensor_size = mb_swap_short(data->sensor_size);
-		data->data_size = mb_swap_short(data->data_size);
-#endif
-
-		/* print debug statements */
-		if (status == MB_SUCCESS && verbose >= 5)
-			{
-			fprintf(stderr,"\ndbg5  Header record after byte shift in MBIO function <%s>\n",function_name);
-			fprintf(stderr,"dbg5  New header values:\n");
-			fprintf(stderr,"dbg5       skip:       %d\n",skip);
-			fprintf(stderr,"dbg5       year:       %d\n",data->year);
-			fprintf(stderr,"dbg5       day:        %d\n",data->day);
-			fprintf(stderr,"dbg5       min:        %d\n",data->min);
-			fprintf(stderr,"dbg5       sec:        %d\n",data->sec);
-			fprintf(stderr,"dbg5       lat:        %d\n",data->lat);
-			fprintf(stderr,"dbg5       lon:        %d\n",data->lon);
-			fprintf(stderr,"dbg5       heading:    %d\n",data->heading);
-			fprintf(stderr,"dbg5       course:     %d\n",data->course);
-			fprintf(stderr,"dbg5       speed:      %d\n",data->speed);
-			fprintf(stderr,"dbg5       speed_ps:   %d\n",data->speed_ps);
-			fprintf(stderr,"dbg5       quality:    %d\n",data->quality);
-			fprintf(stderr,"dbg5       sensor size:%d\n",data->sensor_size);
-			fprintf(stderr,"dbg5       data size:  %d\n",data->data_size);
-			fprintf(stderr,"dbg5       speed_ref:  %c%c\n",
-				data->speed_ref[0],data->speed_ref[1]);
-			fprintf(stderr,"dbg5       sensor_type:%c%c\n",
-				data->sensor_type[0],data->sensor_type[1]);
-			fprintf(stderr,"dbg5       data_type:  %c%c\n",
-				data->data_type[0],data->data_type[1]);
-			}
-		}
-
-	/* check for unintelligible records */
-	if (status == MB_SUCCESS)
-		{
-		if ((strncmp(data->sensor_type,"SB",2) != 0 ||
-			strncmp(data->data_type,"SR",2) != 0)
-			&& strncmp(data->data_type,"TR",2) != 0)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_UNINTELLIGIBLE;
-			data->kind = MB_DATA_NONE;
-			}
-		else if (strncmp(data->data_type,"SR",2) == 0
-			&& data->year == 0)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_UNINTELLIGIBLE;
-			data->kind = MB_DATA_NONE;
-			}
-		else if (strncmp(data->data_type,"SR",2) == 0)
-			{
-			data->kind = MB_DATA_DATA;
-			}
-		else
-			{
-			data->kind = MB_DATA_COMMENT;
-			}
-		}
-
-	/* deal with unintelligible record */
-	if (status == MB_FAILURE
-	    && *error == MB_ERROR_UNINTELLIGIBLE)
-		{
-		/* read rest of record into dummy */
-		for (i=0;i<data->sensor_size;i++)
-			{
-			if ((read_status = fread(dummy,1,1,
-				mb_io_ptr->mbfp)) != 1)
-				{
-				status = MB_FAILURE;
-				*error = MB_ERROR_EOF;
-				}
-			mb_io_ptr->file_bytes
-					+= read_status;
-			}
-		for (i=0;i<data->data_size;i++)
-			{
-			if ((read_status = fread(dummy,1,1,
-				mb_io_ptr->mbfp)) != 1)
-				{
-				status = MB_FAILURE;
-				*error = MB_ERROR_EOF;
-				}
-			mb_io_ptr->file_bytes
-					+= read_status;
-			}
-		}
-
-	/* read sensor record from file */
-	if (status == MB_SUCCESS && data->sensor_size > 0)
-		{
-		if ((status = fread(sensorptr,1,data->sensor_size,
-			mb_io_ptr->mbfp)) == data->sensor_size)
-			{
-			mb_io_ptr->file_bytes += status;
-			status = MB_SUCCESS;
-			*error = MB_ERROR_NO_ERROR;
-			}
-		else
-			{
-			mb_io_ptr->file_bytes += status;
-			status = MB_FAILURE;
-			*error = MB_ERROR_EOF;
-			}
-
-		/* byte swap the data if necessary */
-#ifdef BYTESWAPPED
-		if (status == MB_SUCCESS)
-			{
-			data->eclipse_time = mb_swap_short(data->eclipse_time);
-			data->eclipse_heading = mb_swap_short(data->eclipse_heading);
-			}
-#endif
-
-		/* print debug statements */
-		if (status == MB_SUCCESS && verbose >= 5)
-			{
-			fprintf(stderr,"\ndbg5  New sensor record read by MBIO function <%s>\n",function_name);
-			fprintf(stderr,"dbg5  New sensor values:\n");
-			fprintf(stderr,"dbg5       eclipse_time:    %d\n",
-				data->eclipse_time);
-			fprintf(stderr,"dbg5       eclipse_heading: %d\n",
-				data->eclipse_heading);
-			}
-		}
-
-	/* read data record from file */
-	if (status == MB_SUCCESS && data->kind == MB_DATA_DATA
-		&& data->data_size > 0)
-		{
-		if ((status = fread(datarecptr,1,data->data_size,
-			mb_io_ptr->mbfp)) == data->data_size)
-			{
-			mb_io_ptr->file_bytes += status;
-			status = MB_SUCCESS;
-			*error = MB_ERROR_NO_ERROR;
-			}
-		else
-			{
-			mb_io_ptr->file_bytes += status;
-			status = MB_FAILURE;
-			*error = MB_ERROR_EOF;
-			}
-
-		/* byte swap the data if necessary */
-#ifdef BYTESWAPPED
-		if (status == MB_SUCCESS && data->kind == MB_DATA_DATA)
-			{
-			data->beams_bath = mb_swap_short(data->beams_bath);
-			data->scale_factor = mb_swap_short(data->scale_factor);
-			}
-#endif
-
-		/* check for unintelligible records */
-		if (status == MB_SUCCESS)
-			{
-			if (data->beams_bath < 0
-				|| data->beams_bath > MB_BEAMS_SBSIOSWB)
-				{
-				status = MB_FAILURE;
-				*error = MB_ERROR_UNINTELLIGIBLE;
-				data->kind = MB_DATA_NONE;
-				}
-			}
-
-		/* byte swap the data if necessary */
-#ifdef BYTESWAPPED
-		if (status == MB_SUCCESS && data->kind == MB_DATA_DATA)
-			{
-			for (i=0;i<data->beams_bath;i++)
-				{
-				data->bath_struct[i].bath =
-					mb_swap_short(data->bath_struct[i].bath);
-				data->bath_struct[i].bath_acrosstrack =
-					mb_swap_short(data->bath_struct[i].bath_acrosstrack);
-				}
-			}
-#endif
-
-		/* check for fewer than expected beams */
-		if (status == MB_SUCCESS
-			&& (data->data_size / 4) - 1 < data->beams_bath)
-			{
-			k = (data->data_size / 4) - 2;
-			for (i=k;i<data->beams_bath;i++)
-			    {
-			    data->bath_struct[i].bath = 0;
-			    data->bath_struct[i].bath_acrosstrack = 0;
-			    }
-			}
-
-		/* zero ridiculous soundings */
-		if (status == MB_SUCCESS && data->kind == MB_DATA_DATA)
-			{
-			for (i=0;i<data->beams_bath;i++)
-			    {
-			    if (data->bath_struct[i].bath > 11000
-				|| data->bath_struct[i].bath_acrosstrack > 11000
-				    || data->bath_struct[i].bath_acrosstrack < -11000)
-				{
-				data->bath_struct[i].bath = 0;
-				data->bath_struct[i].bath_acrosstrack = 0;
-				}
-			    }
-			}
-
-		/* print debug statements */
-		if (status == MB_SUCCESS && verbose >= 5
-			&& data->kind == MB_DATA_DATA)
-			{
-			fprintf(stderr,"\ndbg5  New data record read by MBIO function <%s>\n",function_name);
-			fprintf(stderr,"dbg5  New data values:\n");
-			fprintf(stderr,"dbg5       beams_bath:   %d\n",
-				data->beams_bath);
-			fprintf(stderr,"dbg5       scale_factor: %d\n",
-				data->scale_factor);
-			for (i=0;i<data->beams_bath;i++)
-				fprintf(stderr,"dbg5       beam: %d  bath: %d  across_track: %d\n",
-					i,data->bath_struct[i].bath,
-					data->bath_struct[i].bath_acrosstrack);
-			}
-		}
-
-	/* read comment record from file */
-	if (status == MB_SUCCESS && data->kind == MB_DATA_COMMENT)
-		{
-		if ((status = fread(commentptr,1,data->data_size,
-			mb_io_ptr->mbfp)) == data->data_size)
-			{
-			mb_io_ptr->file_bytes += status;
-			status = MB_SUCCESS;
-			*error = MB_ERROR_NO_ERROR;
-			for (i=data->data_size;i<MBSYS_SB_MAXLINE;i++)
-				commentptr[i] = '\0';
-			}
-		else
-			{
-			mb_io_ptr->file_bytes += status;
-			status = MB_FAILURE;
-			*error = MB_ERROR_EOF;
-			}
-
-		/* print debug statements */
-		if (status == MB_SUCCESS && verbose >= 5)
-			{
-			fprintf(stderr,"\ndbg5  New comment record read by MBIO function <%s>\n",function_name);
-			fprintf(stderr,"dbg5  New comment:\n");
-			fprintf(stderr,"dbg5       comment:   %s\n",
-				data->comment);
-			}
-		}
-
-	/* set kind and error in mb_io_ptr */
-	mb_io_ptr->new_kind = data->kind;
-	mb_io_ptr->new_error = *error;
-
-	/* translate values to seabeam data storage structure */
-	if (status == MB_SUCCESS)
-		{
-		/* type of data record */
-		store->kind = data->kind;
-
-		if (store->kind == MB_DATA_DATA)
-			{
-			/* position */
-			lon = 0.0000001*data->lon;
-			if (lon < 0.0) lon = lon + 360.0;
-			store->lon2u = (short) 60.0*lon;
-			store->lon2b = (short) ROUND(600000.0*
-				(lon - store->lon2u/60.0));
-			lat = 0.0000001*data->lat + 90.0;
-			store->lat2u = (short) 60.0*lat;
-			store->lat2b = (short) ROUND(600000.0*
-				(lat - store->lat2u/60.0));
-
-			/* time stamp */
-			store->year = data->year;
-			store->day = data->day;
-			store->min = data->min;
-			store->sec = 0.01*data->sec;
-
-			/* heading */
-			store->sbhdg = (data->heading < (short) 0)
-			    ? (unsigned short) ROUND(((int)data->heading + 3600)*18.204444444)
-			    : (unsigned short) ROUND(data->heading*18.204444444);
-
-			/* depths and distances */
-			id = data->beams_bath - 1;
-			for (i=0;i<data->beams_bath;i++)
-				{
-				store->deph[id-i] = data->bath_struct[i].bath;
-				store->dist[id-i] =
-					data->bath_struct[i].bath_acrosstrack;
-				}
-
-			/* additional values */
-			store->sbtim = data->eclipse_time;
-			store->axis = 0;
-			store->major = 0;
-			store->minor = 0;
-			}
-
-		else if (store->kind == MB_DATA_COMMENT)
-			{
-			/* comment */
-			strncpy(store->comment,data->comment,
-				MBSYS_SB_MAXLINE);
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_wt_sbsioswb(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_wt_sbsioswb";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_sbsioswb_struct *data;
-	struct mbsys_sb_struct *store;
-	char	*headerptr;
-	char	*sensorptr;
-	char	*datarecptr;
-	char	*commentptr;
-	double	lon, lat;
-	int	id;
-	int	sensor_size;
-	int	data_size;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_sbsioswb_struct *) mb_io_ptr->raw_data;
-	store = (struct mbsys_sb_struct *) store_ptr;
-
-	/* get pointers to records */
-	headerptr = (char *) &data->year;
-	sensorptr = (char *) &data->eclipse_time;
-	datarecptr = (char *) &data->beams_bath;
-	commentptr = (char *) &data->comment[0];
-
-	/* print output debug statements */
-	if (verbose >= 2 && (store->kind == MB_DATA_DATA || store->kind == MB_DATA_NAV))
-		{
-		fprintf(stderr,"dbg2   Data to be extracted from storage structure: %p %p\n",
-			(void *)store_ptr,(void *)store);
-		fprintf(stderr,"dbg2       kind:       %d\n",store->kind);
-		fprintf(stderr,"dbg2       lon2u:      %d\n",store->lon2u);
-		fprintf(stderr,"dbg2       lon2b:      %d\n",store->lon2b);
-		fprintf(stderr,"dbg2       lat2u:      %d\n",store->lat2u);
-		fprintf(stderr,"dbg2       lat2b:      %d\n",store->lat2b);
-		fprintf(stderr,"dbg2       year:       %d\n",store->year);
-		fprintf(stderr,"dbg2       day:        %d\n",store->day);
-		fprintf(stderr,"dbg2       min:        %d\n",store->min);
-		fprintf(stderr,"dbg2       sec:        %d\n",store->sec);
-		}
-	if (verbose >= 2 && store->kind == MB_DATA_DATA)
-		{
-		for (i=0;i<MBSYS_SB_BEAMS;i++)
-		  fprintf(stderr,"dbg3       dist[%d]: %d  deph[%d]: %d\n",
-			i,store->dist[i],i,store->deph[i]);
-		fprintf(stderr,"dbg2       sbtim:        %d\n",store->sbtim);
-		fprintf(stderr,"dbg2       sbhdg:        %d\n",store->sbhdg);
-		fprintf(stderr,"dbg2       axis:         %d\n",store->axis);
-		fprintf(stderr,"dbg2       major:        %d\n",store->major);
-		fprintf(stderr,"dbg2       minor:        %d\n",store->minor);
-		}
-	if (verbose >= 2 && store->kind == MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"dbg2   Data inserted into storage structure:\n");
-		fprintf(stderr,"dbg2       comment:     \ndbg2       %s\n",
-			store->comment);
-		}
-
-	/* first set some plausible amounts for some of the
-		variables in the SBSIOSWB record */
-	data->year = 0;
-	data->day = 0;
-	data->min = 0;
-	data->sec = 0;
-	data->lat = 0;
-	data->lon = 0;
-	data->heading = 0;
-	data->course = 0;
-	data->speed = 0;
-	data->speed_ps = 0;
-	data->quality = 0;
-	data->sensor_size = 0;
-	data->data_size = 0;
-	data->speed_ref[0] = 0;
-	data->speed_ref[1] = 0;
-	if (store->kind == MB_DATA_DATA)
-		{
-		data->sensor_type[0] = 'S';
-		data->sensor_type[1] = 'B';
-		data->data_type[0] = 'S';
-		data->data_type[1] = 'R';
-		}
-	else
-		{
-		data->sensor_type[0] = 0;
-		data->sensor_type[1] = 0;
-		data->data_type[0] = 'T';
-		data->data_type[1] = 'R';
-		}
-	data->eclipse_time = 0;
-	data->eclipse_heading = 0;
-	data->beams_bath = MB_BEAMS_SBSIOSWB;
-	data->sensor_size = 4;
-	data->data_size = 4 + 4*data->beams_bath;
-	data->scale_factor = 100;
-	for (i=0;i<MB_BEAMS_SBSIOSWB;i++)
-		{
-		data->bath_struct[i].bath = 0;
-		data->bath_struct[i].bath_acrosstrack = 0;
-		}
-
-	/* translate values from seabeam data storage structure */
-	data->kind = store->kind;
-	if (store->kind == MB_DATA_DATA)
-		{
-		data->sensor_type[0] = 'S';
-		data->sensor_type[1] = 'B';
-		data->data_type[0] = 'S';
-		data->data_type[1] = 'R';
-
-		/* position */
-		lon = 10000000*(store->lon2u/60.
-			+ store->lon2b/600000.);
-		if (lon > 1800000000.)
-			lon = lon - 3600000000.;
-		lat = 10000000*(store->lat2u/60.
-			+ store->lat2b/600000. - 90.);
-		data->lon = lon;
-		data->lat = lat;
-
-		/* time stamp */
-		data->year = store->year;
-		data->day = store->day;
-		data->min = store->min;
-		data->sec = 100*store->sec;
-
-		/* heading */
-		data->heading =
-		    (short) ROUND(((int)store->sbhdg)*0.054931641625);
-
-		/* additional values */
-		data->eclipse_time = store->sbtim;
-		data->eclipse_heading = store->sbhdg;
-
-		/* put distance and depth values
-			into sbsioswb data structure */
-		id = data->beams_bath - 1;
-		for (i=0;i<MB_BEAMS_SBSIOSWB;i++)
-			{
-			data->bath_struct[id-i].bath = store->deph[i];;
-			data->bath_struct[id-i].bath_acrosstrack =
-				store->dist[i];;
-			}
-		}
-
-	/* comment */
-	else if (store->kind == MB_DATA_COMMENT)
-		{
-		data->sensor_type[0] = 0;
-		data->sensor_type[1] = 0;
-		data->data_type[0] = 'T';
-		data->data_type[1] = 'R';
-
-		data->data_size = strlen(store->comment);
-		if (data->data_size > MBSYS_SB_MAXLINE - 1)
-			data->data_size = MBSYS_SB_MAXLINE - 1;
-		strncpy(commentptr,store->comment,data->data_size);
-		commentptr[data->data_size] = 0;
-		data->sensor_size = 0;
-		}
-
-	/* save sensor_size and data_size before possible byte swapping */
-	sensor_size = data->sensor_size;
-	data_size = data->data_size;
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Ready to write data in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       kind:       %d\n",
-			data->kind);
-		fprintf(stderr,"dbg5       error:      %d\n",*error);
-		fprintf(stderr,"dbg5       status:     %d\n",status);
-		}
-
-	/* print debug statements */
-	if (status == MB_SUCCESS && verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Header record to be written by MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5  Header values:\n");
-		fprintf(stderr,"dbg5       year:       %d\n",data->year);
-		fprintf(stderr,"dbg5       day:        %d\n",data->day);
-		fprintf(stderr,"dbg5       min:        %d\n",data->min);
-		fprintf(stderr,"dbg5       sec:        %d\n",data->sec);
-		fprintf(stderr,"dbg5       lat:        %d\n",data->lat);
-		fprintf(stderr,"dbg5       lon:        %d\n",data->lon);
-		fprintf(stderr,"dbg5       heading:    %d\n",data->heading);
-		fprintf(stderr,"dbg5       course:     %d\n",data->course);
-		fprintf(stderr,"dbg5       speed:      %d\n",data->speed);
-		fprintf(stderr,"dbg5       speed_ps:   %d\n",data->speed_ps);
-		fprintf(stderr,"dbg5       quality:    %d\n",data->quality);
-		fprintf(stderr,"dbg5       sensor size:%d\n",data->sensor_size);
-		fprintf(stderr,"dbg5       data size:  %d\n",data->data_size);
-		fprintf(stderr,"dbg5       speed_ref:  %c%c\n",
-			data->speed_ref[0],data->speed_ref[1]);
-		fprintf(stderr,"dbg5       sensor_type:%c%c\n",
-			data->sensor_type[0],data->sensor_type[1]);
-		fprintf(stderr,"dbg5       data_type:  %c%c\n",
-			data->data_type[0],data->data_type[1]);
-		}
-
-	/* print debug statements */
-	if (status == MB_SUCCESS && verbose >= 5
-		&& data->kind == MB_DATA_DATA)
-		{
-		fprintf(stderr,"\ndbg5  Sensor record to be written by MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5  Sensor values:\n");
-		fprintf(stderr,"dbg5       eclipse_time:    %d\n",
-			data->eclipse_time);
-		fprintf(stderr,"dbg5       eclipse_heading: %d\n",
-			data->eclipse_heading);
-		}
-
-	/* print debug statements */
-	if (status == MB_SUCCESS && verbose >= 5
-		&& data->kind == MB_DATA_DATA)
-		{
-		fprintf(stderr,"\ndbg5  Data record to be written by MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5  Data values:\n");
-		fprintf(stderr,"dbg5       beams_bath:   %d\n",
-			data->beams_bath);
-		fprintf(stderr,"dbg5       scale_factor: %d\n",
-			data->scale_factor);
-		for (i=0;i<data->beams_bath;i++)
-			fprintf(stderr,"dbg5       beam: %d  bath: %d  across_track: %d\n",
-				i,data->bath_struct[i].bath,
-				data->bath_struct[i].bath_acrosstrack);
-		}
-
-	/* print debug statements */
-	if (status == MB_SUCCESS && verbose >= 5
-		&& data->kind == MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"\ndbg5  Comment record to be written by MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5  Comment:\n");
-		fprintf(stderr,"dbg5       comment:   %s\n",
-			data->comment);
-		}
-
-	/* byte swap the data if necessary */
-#ifdef BYTESWAPPED
-	data->year = mb_swap_short(data->year);
-	data->day = mb_swap_short(data->day);
-	data->min = mb_swap_short(data->min);
-	data->sec = mb_swap_short(data->sec);
-	data->lat = mb_swap_int(data->lat);
-	data->lon = mb_swap_int(data->lon);
-	data->heading = mb_swap_short(data->heading);
-	data->course = mb_swap_short(data->course);
-	data->speed = mb_swap_short(data->speed);
-	data->speed_ps = mb_swap_short(data->speed_ps);
-	data->quality = mb_swap_short(data->quality);
-	data->sensor_size = mb_swap_short(data->sensor_size);
-	data->data_size = mb_swap_short(data->data_size);
-	data->eclipse_time = mb_swap_short(data->eclipse_time);
-	data->eclipse_heading = mb_swap_short(data->eclipse_heading);
-	data->beams_bath = mb_swap_short(data->beams_bath);
-	data->scale_factor = mb_swap_short(data->scale_factor);
-	if (store->kind == MB_DATA_DATA)
-		{
-		for (i=0;i<MB_BEAMS_SBSIOSWB;i++)
-			{
-			data->bath_struct[i].bath =
-				mb_swap_short(data->bath_struct[i].bath);
-			data->bath_struct[i].bath_acrosstrack =
-				mb_swap_short(data->bath_struct[i].bath_acrosstrack);
-			}
-		}
-#endif
-
-	/* write header record to file */
-	if (status == MB_SUCCESS)
-		{
-		if ((status = fwrite(headerptr,1,MB_SBSIOSWB_HEADER_SIZE,
-			mb_io_ptr->mbfp)) == MB_SBSIOSWB_HEADER_SIZE)
-			{
-			status = MB_SUCCESS;
-			*error = MB_ERROR_NO_ERROR;
-			}
-		else
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_WRITE_FAIL;
-			}
-		}
-
-	/* write sensor record to file */
-	if (status == MB_SUCCESS)
-		{
-		if ((status = fwrite(sensorptr,1,sensor_size,
-			mb_io_ptr->mbfp)) == sensor_size)
-			{
-			status = MB_SUCCESS;
-			*error = MB_ERROR_NO_ERROR;
-			}
-		else
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_WRITE_FAIL;
-			}
-		}
-
-	/* write data record to file */
-	if (status == MB_SUCCESS && data->kind == MB_DATA_DATA)
-		{
-		if ((status = fwrite(datarecptr,1,data_size,
-			mb_io_ptr->mbfp)) == data_size)
-			{
-			status = MB_SUCCESS;
-			*error = MB_ERROR_NO_ERROR;
-			}
-		else
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_WRITE_FAIL;
-			}
-		}
-
-	/* write comment record to file */
-	if (status == MB_SUCCESS && data->kind == MB_DATA_COMMENT)
-		{
-		if ((status = fwrite(commentptr,1,strlen(data->comment),
-			mb_io_ptr->mbfp)) == strlen(data->comment))
-			{
-			status = MB_SUCCESS;
-			*error = MB_ERROR_NO_ERROR;
-			}
-		else
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_WRITE_FAIL;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mbr_sburicen.c b/src/mbio/mbr_sburicen.c
deleted file mode 100644
index 66bf30b..0000000
--- a/src/mbio/mbr_sburicen.c
+++ /dev/null
@@ -1,751 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbr_sburicen.c	2/2/93
- *	$Id: mbr_sburicen.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1993-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbr_sburicen.c contains the functions for reading and writing
- * multibeam data in the SBURICEN format.
- * These functions include:
- *   mbr_alm_sburicen	- allocate read/write memory
- *   mbr_dem_sburicen	- deallocate read/write memory
- *   mbr_rt_sburicen	- read and translate data
- *   mbr_wt_sburicen	- translate and write data
- *
- * Author:	D. W. Caress
- * Date:	February 2, 1993
- * $Log: mbr_sburicen.c,v $
- * Revision 5.9  2005/11/05 00:48:04  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.8  2003/05/20 18:05:32  caress
- * Added svp_source to data source parameters.
- *
- * Revision 5.7  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.6  2002/10/15 18:34:58  caress
- * Release 5.0.beta25
- *
- * Revision 5.5  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.4  2002/02/26 07:50:41  caress
- * Release 5.0.beta14
- *
- * Revision 5.3  2001/07/20 00:32:54  caress
- * Release 5.0.beta03
- *
- * Revision 5.2  2001/03/22  20:50:02  caress
- * Trying to make version 5.0.beta0
- *
- * Revision 5.1  2001/01/22  07:43:34  caress
- * Version 5.0.beta01
- *
- * Revision 5.0  2000/12/01  22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.10  2000/10/11  01:03:21  caress
- * Convert to ANSI C
- *
- * Revision 4.9  2000/09/30  06:34:20  caress
- * Snapshot for Dale.
- *
- * Revision 4.8  1998/10/05  17:46:15  caress
- * MB-System version 4.6beta
- *
- * Revision 4.7  1997/07/25  14:19:53  caress
- * Version 4.5beta2.
- * Much mucking, particularly with Simrad formats.
- *
- * Revision 4.6  1997/04/21  17:02:07  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.5  1996/04/22  13:21:19  caress
- * Now have DTR and MIN/MAX defines in mb_define.h
- *
- * Revision 4.5  1996/04/22  13:21:19  caress
- * Now have DTR and MIN/MAX defines in mb_define.h
- *
- * Revision 4.4  1995/03/06  19:38:54  caress
- * Changed include strings.h to string.h for POSIX compliance.
- *
- * Revision 4.3  1994/10/21  12:20:01  caress
- * Release V4.0
- *
- * Revision 4.2  1994/07/29  18:46:51  caress
- * Changes associated with supporting Lynx OS (byte swapped) and
- * using unix second time base (for time_d values).
- *
- * Revision 4.1  1994/05/11  21:23:01  caress
- * Added initialization of bathalongtrack array.
- * Also reversed order of beams in arrays.
- *
- * Revision 4.0  1994/03/06  00:01:56  caress
- * First cut at version 4.0
- *
- * Revision 4.1  1994/03/03  03:39:43  caress
- * Fixed copyright message.
- *
- * Revision 4.0  1994/02/21  03:59:50  caress
- * First cut at new version. Altered to be consistent
- * with passing of three types of data: bathymetry,
- * amplitude, and sidescan.
- *
- * Revision 3.0  1993/05/14  22:58:26  sohara
- * initial version
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mb_define.h"
-#include "mbsys_sb.h"
-#include "mbf_sburicen.h"
-
-/* include for byte swapping on little-endian machines */
-#ifdef BYTESWAPPED
-#include "mb_swap.h"
-#endif
-
-/* essential function prototypes */
-int mbr_register_sburicen(int verbose, void *mbio_ptr,
-		int *error);
-int mbr_info_sburicen(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_alm_sburicen(int verbose, void *mbio_ptr, int *error);
-int mbr_dem_sburicen(int verbose, void *mbio_ptr, int *error);
-int mbr_rt_sburicen(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_wt_sburicen(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-
-static char rcs_id[]="$Id: mbr_sburicen.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mbr_register_sburicen(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_register_sburicen";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* get mb_io_ptr */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set format info parameters */
-	status = mbr_info_sburicen(verbose,
-			&mb_io_ptr->system,
-			&mb_io_ptr->beams_bath_max,
-			&mb_io_ptr->beams_amp_max,
-			&mb_io_ptr->pixels_ss_max,
-			mb_io_ptr->format_name,
-			mb_io_ptr->system_name,
-			mb_io_ptr->format_description,
-			&mb_io_ptr->numfile,
-			&mb_io_ptr->filetype,
-			&mb_io_ptr->variable_beams,
-			&mb_io_ptr->traveltime,
-			&mb_io_ptr->beam_flagging,
-			&mb_io_ptr->nav_source,
-			&mb_io_ptr->heading_source,
-			&mb_io_ptr->vru_source,
-			&mb_io_ptr->svp_source,
-			&mb_io_ptr->beamwidth_xtrack,
-			&mb_io_ptr->beamwidth_ltrack,
-			error);
-
-	/* set format and system specific function pointers */
-	mb_io_ptr->mb_io_format_alloc = &mbr_alm_sburicen;
-	mb_io_ptr->mb_io_format_free = &mbr_dem_sburicen;
-	mb_io_ptr->mb_io_store_alloc = &mbsys_sb_alloc;
-	mb_io_ptr->mb_io_store_free = &mbsys_sb_deall;
-	mb_io_ptr->mb_io_read_ping = &mbr_rt_sburicen;
-	mb_io_ptr->mb_io_write_ping = &mbr_wt_sburicen;
-	mb_io_ptr->mb_io_dimensions = &mbsys_sb_dimensions;
-	mb_io_ptr->mb_io_extract = &mbsys_sb_extract;
-	mb_io_ptr->mb_io_insert = &mbsys_sb_insert;
-	mb_io_ptr->mb_io_extract_nav = &mbsys_sb_extract_nav;
-	mb_io_ptr->mb_io_insert_nav = &mbsys_sb_insert_nav;
-	mb_io_ptr->mb_io_extract_altitude = &mbsys_sb_extract_altitude;
-	mb_io_ptr->mb_io_insert_altitude = NULL;
-	mb_io_ptr->mb_io_extract_svp = NULL;
-	mb_io_ptr->mb_io_insert_svp = NULL;
-	mb_io_ptr->mb_io_ttimes = &mbsys_sb_ttimes;
-	mb_io_ptr->mb_io_detects = &mbsys_sb_detects;
-	mb_io_ptr->mb_io_copyrecord = &mbsys_sb_copy;
-	mb_io_ptr->mb_io_extract_rawss = NULL;
-	mb_io_ptr->mb_io_insert_rawss = NULL;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",mb_io_ptr->system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",mb_io_ptr->beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",mb_io_ptr->beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",mb_io_ptr->pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",mb_io_ptr->format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",mb_io_ptr->system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",mb_io_ptr->format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",mb_io_ptr->numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",mb_io_ptr->filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",mb_io_ptr->variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",mb_io_ptr->traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",mb_io_ptr->beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",mb_io_ptr->nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",mb_io_ptr->heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",mb_io_ptr->vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",mb_io_ptr->svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",mb_io_ptr->beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",mb_io_ptr->beamwidth_ltrack);
-		fprintf(stderr,"dbg2       format_alloc:       %p\n",(void *)mb_io_ptr->mb_io_format_alloc);
-		fprintf(stderr,"dbg2       format_free:        %p\n",(void *)mb_io_ptr->mb_io_format_free);
-		fprintf(stderr,"dbg2       store_alloc:        %p\n",(void *)mb_io_ptr->mb_io_store_alloc);
-		fprintf(stderr,"dbg2       store_free:         %p\n",(void *)mb_io_ptr->mb_io_store_free);
-		fprintf(stderr,"dbg2       read_ping:          %p\n",(void *)mb_io_ptr->mb_io_read_ping);
-		fprintf(stderr,"dbg2       write_ping:         %p\n",(void *)mb_io_ptr->mb_io_write_ping);
-		fprintf(stderr,"dbg2       extract:            %p\n",(void *)mb_io_ptr->mb_io_extract);
-		fprintf(stderr,"dbg2       insert:             %p\n",(void *)mb_io_ptr->mb_io_insert);
-		fprintf(stderr,"dbg2       extract_nav:        %p\n",(void *)mb_io_ptr->mb_io_extract_nav);
-		fprintf(stderr,"dbg2       insert_nav:         %p\n",(void *)mb_io_ptr->mb_io_insert_nav);
-		fprintf(stderr,"dbg2       extract_altitude:   %p\n",(void *)mb_io_ptr->mb_io_extract_altitude);
-		fprintf(stderr,"dbg2       insert_altitude:    %p\n",(void *)mb_io_ptr->mb_io_insert_altitude);
-		fprintf(stderr,"dbg2       extract_svp:        %p\n",(void *)mb_io_ptr->mb_io_extract_svp);
-		fprintf(stderr,"dbg2       insert_svp:         %p\n",(void *)mb_io_ptr->mb_io_insert_svp);
-		fprintf(stderr,"dbg2       ttimes:             %p\n",(void *)mb_io_ptr->mb_io_ttimes);
-		fprintf(stderr,"dbg2       detects:            %p\n",(void *)mb_io_ptr->mb_io_detects);
-		fprintf(stderr,"dbg2       extract_rawss:      %p\n",(void *)mb_io_ptr->mb_io_extract_rawss);
-		fprintf(stderr,"dbg2       insert_rawss:       %p\n",(void *)mb_io_ptr->mb_io_insert_rawss);
-		fprintf(stderr,"dbg2       copyrecord:         %p\n",(void *)mb_io_ptr->mb_io_copyrecord);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbr_info_sburicen(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error)
-{
-	char	*function_name = "mbr_info_sburicen";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* set format info parameters */
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-	*system = MB_SYS_SB;
-	*beams_bath_max = 19;
-	*beams_amp_max = 0;
-	*pixels_ss_max = 0;
-	strncpy(format_name, "SBURICEN", MB_NAME_LENGTH);
-	strncpy(system_name, "SB", MB_NAME_LENGTH);
-	strncpy(format_description, "Format name:          MBF_SBURICEN\nInformal Description: URI Sea Beam\nAttributes:           Sea Beam, bathymetry, 19 beams, binary, centered,\n                      URI.\n", MB_DESCRIPTION_LENGTH);
-	*numfile = 1;
-	*filetype = MB_FILETYPE_NORMAL;
-	*variable_beams = MB_NO;
-	*traveltime = MB_NO;
-	*beam_flagging = MB_YES;
-	*nav_source = MB_DATA_DATA;
-	*heading_source = MB_DATA_DATA;
-	*vru_source = MB_DATA_DATA;
-	*svp_source = MB_DATA_NONE;
-	*beamwidth_xtrack = 2.67;
-	*beamwidth_ltrack = 2.67;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",*system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",*beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",*beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",*pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",*numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",*filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",*variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",*traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",*beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",*nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",*heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",*vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",*svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",*beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",*beamwidth_ltrack);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_alm_sburicen(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_alm_sburicen";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set initial status */
-	status = MB_SUCCESS;
-
-	/* allocate memory for data structure */
-	mb_io_ptr->structure_size = sizeof(struct mbf_sburicen_struct);
-	mb_io_ptr->data_structure_size =
-		sizeof(struct mbf_sburicen_data_struct);
-	status = mb_malloc(verbose,mb_io_ptr->structure_size,
-				&mb_io_ptr->raw_data,error);
-	status = mb_malloc(verbose,sizeof(struct mbsys_sb_struct),
-				&mb_io_ptr->store_data,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_dem_sburicen(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_dem_sburicen";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* deallocate memory for data descriptor */
-	status = mb_free(verbose,&mb_io_ptr->raw_data,error);
-	status = mb_free(verbose,&mb_io_ptr->store_data,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_rt_sburicen(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_rt_sburicen";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_sburicen_struct *dataplus;
-	struct mbf_sburicen_data_struct *data;
-	struct mbsys_sb_struct *store;
-	char	*datacomment;
-	int	id;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	dataplus = (struct mbf_sburicen_struct *) mb_io_ptr->raw_data;
-	data = &(dataplus->data);
-	datacomment = (char *) data;
-	dataplus->kind = MB_DATA_DATA;
-	store = (struct mbsys_sb_struct *) store_ptr;
-
-	/* read next record from file */
-	mb_io_ptr->file_pos = mb_io_ptr->file_bytes;
-	if ((status = fread(data,1,mb_io_ptr->data_structure_size,
-			mb_io_ptr->mbfp)) == mb_io_ptr->data_structure_size)
-		{
-		mb_io_ptr->file_bytes += status;
-		status = MB_SUCCESS;
-		*error = MB_ERROR_NO_ERROR;
-		}
-	else
-		{
-		mb_io_ptr->file_bytes += status;
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	/* byte swap the data if necessary */
-#ifdef BYTESWAPPED
-	if (status == MB_SUCCESS)
-		{
-		for (i=0;i<MBSYS_SB_BEAMS;i++)
-			{
-			data->dist[i] = mb_swap_short(data->dist[i]);
-			data->deph[i] = mb_swap_short(data->deph[i]);
-			}
-		data->axis = mb_swap_short(data->axis);
-		data->major = mb_swap_short(data->major);
-		data->minor = mb_swap_short(data->minor);
-		data->sbhdg = mb_swap_short(data->sbhdg);
-		data->lat2b = mb_swap_short(data->lat2b);
-		data->lat2u = mb_swap_short(data->lat2u);
-		data->lon2b = mb_swap_short(data->lon2b);
-		data->lon2u = mb_swap_short(data->lon2u);
-		data->sec = mb_swap_short(data->sec);
-		data->min = mb_swap_short(data->min);
-		data->day = mb_swap_short(data->day);
-		data->year = mb_swap_short(data->year);
-		data->sbtim = mb_swap_short(data->sbtim);
-		}
-#endif
-
-	/* check for comment or unintelligible records */
-	if (status == MB_SUCCESS)
-		{
-		if (data->deph[0] > 15000)
-			{
-			dataplus->kind = MB_DATA_COMMENT;
-			}
-		else if (data->year == 0)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_UNINTELLIGIBLE;
-			}
-		else
-			{
-			dataplus->kind = MB_DATA_DATA;
-			}
-		}
-
-	/* set kind and error in mb_io_ptr */
-	mb_io_ptr->new_kind = dataplus->kind;
-	mb_io_ptr->new_error = *error;
-
-	/* translate values to seabeam data storage structure */
-	if (status == MB_SUCCESS
-		&& store != NULL)
-		{
-		/* type of data record */
-		store->kind = dataplus->kind;
-
-		if (store->kind == MB_DATA_DATA)
-			{
-			/* position */
-			store->lon2u = data->lon2u;
-			store->lon2b = data->lon2b;
-			store->lat2u = data->lat2u;
-			store->lat2b = data->lat2b;
-
-			/* time stamp */
-			store->year = data->year;
-			store->day = data->day;
-			store->min = data->min;
-			store->sec = data->sec;
-
-			/* depths and distances */
-			/* switch order of data as it is read into the global arrays */
-			id = MBSYS_SB_BEAMS - 1;
-			for (i=0;i<MBSYS_SB_BEAMS;i++)
-				{
-				store->dist[id-i] = data->dist[i];
-				store->deph[id-i] = data->deph[i];
-				}
-
-			/* additional values */
-			store->sbtim = data->sbtim;
-			store->sbhdg = data->sbhdg;
-			store->axis = data->axis;
-			store->major = data->major;
-			store->minor = data->minor;
-			}
-
-		else if (store->kind == MB_DATA_COMMENT)
-			{
-			/* comment */
-			strncpy(store->comment,&datacomment[2],
-				MBSYS_SB_MAXLINE);
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_wt_sburicen(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_wt_sburicen";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_sburicen_struct *dataplus;
-	struct mbf_sburicen_data_struct *data;
-	struct mbsys_sb_struct *store;
-	char	*datacomment;
-	int	id;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	dataplus = (struct mbf_sburicen_struct *) mb_io_ptr->raw_data;
-	data = &(dataplus->data);
-	datacomment = (char *) data;
-	store = (struct mbsys_sb_struct *) store_ptr;
-
-	/* first set some plausible amounts for some of the
-		variables in the MBURICEN record */
-	data->sbtim = 0;
-	data->axis = 0;
-	data->major = 0;
-	data->minor = 0;
-
-	/* translate values from seabeam data storage structure */
-	dataplus->kind = store->kind;
-	if (store->kind == MB_DATA_DATA)
-		{
-		/* position */
-		data->lon2u = store->lon2u;
-		data->lon2b = store->lon2b;
-		data->lat2u = store->lat2u;
-		data->lat2b = store->lat2b;
-
-		/* time stamp */
-		data->year = store->year;
-		data->day = store->day;
-		data->min = store->min;
-		data->sec = store->sec;
-
-		/* depths and distances */
-		/* switch order of data as it is read
-			into the output arrays */
-		id = MBSYS_SB_BEAMS - 1;
-		for (i=0;i<MBSYS_SB_BEAMS;i++)
-			{
-			data->dist[i] = store->dist[id-i];
-			data->deph[i] = store->deph[id-i];
-			}
-
-		/* additional values */
-		data->sbtim = store->sbtim;
-		data->sbhdg = store->sbhdg;
-		data->axis = store->axis;
-		data->major = store->major;
-		data->minor = store->minor;
-		}
-
-	/* comment */
-	else if (store->kind == MB_DATA_COMMENT)
-		{
-		strcpy(datacomment,"cc");
-		strncat(datacomment,store->comment,MBSYS_SB_MAXLINE-1);
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Ready to write data in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       kind:       %d\n",
-			dataplus->kind);
-		fprintf(stderr,"dbg5       error:      %d\n",*error);
-		fprintf(stderr,"dbg5       status:     %d\n",status);
-		}
-
-	/* byte swap the data if necessary */
-#ifdef BYTESWAPPED
-	if (dataplus->kind == MB_DATA_DATA
-		|| dataplus->kind == MB_DATA_COMMENT)
-		{
-		for (i=0;i<MBSYS_SB_BEAMS;i++)
-			{
-			data->dist[i] = mb_swap_short(data->dist[i]);
-			data->deph[i] = mb_swap_short(data->deph[i]);
-			}
-		data->axis = mb_swap_short(data->axis);
-		data->major = mb_swap_short(data->major);
-		data->minor = mb_swap_short(data->minor);
-		data->sbhdg = mb_swap_short(data->sbhdg);
-		data->lat2b = mb_swap_short(data->lat2b);
-		data->lat2u = mb_swap_short(data->lat2u);
-		data->lon2b = mb_swap_short(data->lon2b);
-		data->lon2u = mb_swap_short(data->lon2u);
-		data->sec = mb_swap_short(data->sec);
-		data->min = mb_swap_short(data->min);
-		data->day = mb_swap_short(data->day);
-		data->year = mb_swap_short(data->year);
-		data->sbtim = mb_swap_short(data->sbtim);
-		}
-#endif
-
-	/* write next record to file */
-	if (dataplus->kind == MB_DATA_DATA
-		|| dataplus->kind == MB_DATA_COMMENT)
-		{
-		if ((status = fwrite(data,1,mb_io_ptr->data_structure_size,
-			mb_io_ptr->mbfp))
-			== mb_io_ptr->data_structure_size)
-			{
-			status = MB_SUCCESS;
-			*error = MB_ERROR_NO_ERROR;
-			}
-		else
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_WRITE_FAIL;
-			}
-		}
-	else
-		{
-		status = MB_SUCCESS;
-		*error = MB_ERROR_NO_ERROR;
-		if (verbose >= 5)
-			fprintf(stderr,"\ndbg5  No data written in MBIO function <%s>\n",function_name);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mbr_sburivax.c b/src/mbio/mbr_sburivax.c
deleted file mode 100644
index d91f5d2..0000000
--- a/src/mbio/mbr_sburivax.c
+++ /dev/null
@@ -1,765 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbr_sburivax.c	2/2/93
- *	$Id: mbr_sburivax.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1993-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbr_sburivax.c contains the functions for reading and writing
- * multibeam data in the SBURIVAX format. The only difference between
- * the SBURIVAX format and the SBURICEN format is that the data files
- * are stored in VAX byte order ("little endian"). This is why the
- * format structure definitions are taken from the include file
- * mbf_sburicen.h.
- * These functions include:
- *   mbr_alm_sburivax	- allocate read/write memory
- *   mbr_dem_sburivax	- deallocate read/write memory
- *   mbr_rt_sburivax	- read and translate data
- *   mbr_wt_sburivax	- translate and write data
- *
- * Author:	D. W. Caress
- * Date:	February 2, 1993
- * $Log: mbr_sburivax.c,v $
- * Revision 5.8  2005/11/05 00:48:03  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.7  2003/05/20 18:05:32  caress
- * Added svp_source to data source parameters.
- *
- * Revision 5.6  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.5  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.4  2002/02/26 07:50:41  caress
- * Release 5.0.beta14
- *
- * Revision 5.3  2001/07/20 00:32:54  caress
- * Release 5.0.beta03
- *
- * Revision 5.2  2001/03/22  20:50:02  caress
- * Trying to make version 5.0.beta0
- *
- * Revision 5.1  2001/01/22  07:43:34  caress
- * Version 5.0.beta01
- *
- * Revision 5.0  2000/12/01  22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.9  2000/10/11  01:03:21  caress
- * Convert to ANSI C
- *
- * Revision 4.8  2000/09/30  06:34:20  caress
- * Snapshot for Dale.
- *
- * Revision 4.7  1998/10/05  17:46:15  caress
- * MB-System version 4.6beta
- *
- * Revision 4.6  1997/07/25  14:19:53  caress
- * Version 4.5beta2.
- * Much mucking, particularly with Simrad formats.
- *
- * Revision 4.5  1997/04/21  17:02:07  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.4  1996/04/22  13:21:19  caress
- * Now have DTR and MIN/MAX defines in mb_define.h
- *
- * Revision 4.4  1996/04/22  13:21:19  caress
- * Now have DTR and MIN/MAX defines in mb_define.h
- *
- * Revision 4.3  1995/03/22  18:58:09  caress
- * Added handling of extra 2 bytes which occurs every 5 records in
- * data derived from VAX VMS.
- *
- * Revision 4.2  1995/03/06  19:38:54  caress
- * Changed include strings.h to string.h for POSIX compliance.
- *
- * Revision 4.1  1994/10/21  12:20:01  caress
- * Release V4.0
- *
- * Revision 4.0  1994/07/29  18:59:33  caress
- * Initial Revision.
- *
- * Revision 1.1  1994/07/29  18:46:51  caress
- * Initial revision
- *
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mb_define.h"
-#include "mbsys_sb.h"
-#include "mbf_sburicen.h"
-
-/* include for byte swapping on little-endian machines */
-#ifndef BYTESWAPPED
-#include "mb_swap.h"
-#endif
-
-/* essential function prototypes */
-int mbr_register_sburivax(int verbose, void *mbio_ptr,
-		int *error);
-int mbr_info_sburivax(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_alm_sburivax(int verbose, void *mbio_ptr, int *error);
-int mbr_dem_sburivax(int verbose, void *mbio_ptr, int *error);
-int mbr_rt_sburivax(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_wt_sburivax(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-
-static char rcs_id[]="$Id: mbr_sburivax.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mbr_register_sburivax(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_register_sburivax";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* get mb_io_ptr */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set format info parameters */
-	status = mbr_info_sburivax(verbose,
-			&mb_io_ptr->system,
-			&mb_io_ptr->beams_bath_max,
-			&mb_io_ptr->beams_amp_max,
-			&mb_io_ptr->pixels_ss_max,
-			mb_io_ptr->format_name,
-			mb_io_ptr->system_name,
-			mb_io_ptr->format_description,
-			&mb_io_ptr->numfile,
-			&mb_io_ptr->filetype,
-			&mb_io_ptr->variable_beams,
-			&mb_io_ptr->traveltime,
-			&mb_io_ptr->beam_flagging,
-			&mb_io_ptr->nav_source,
-			&mb_io_ptr->heading_source,
-			&mb_io_ptr->vru_source,
-			&mb_io_ptr->svp_source,
-			&mb_io_ptr->beamwidth_xtrack,
-			&mb_io_ptr->beamwidth_ltrack,
-			error);
-
-	/* set format and system specific function pointers */
-	mb_io_ptr->mb_io_format_alloc = &mbr_alm_sburivax;
-	mb_io_ptr->mb_io_format_free = &mbr_dem_sburivax;
-	mb_io_ptr->mb_io_store_alloc = &mbsys_sb_alloc;
-	mb_io_ptr->mb_io_store_free = &mbsys_sb_deall;
-	mb_io_ptr->mb_io_read_ping = &mbr_rt_sburivax;
-	mb_io_ptr->mb_io_write_ping = &mbr_wt_sburivax;
-	mb_io_ptr->mb_io_dimensions = &mbsys_sb_dimensions;
-	mb_io_ptr->mb_io_extract = &mbsys_sb_extract;
-	mb_io_ptr->mb_io_insert = &mbsys_sb_insert;
-	mb_io_ptr->mb_io_extract_nav = &mbsys_sb_extract_nav;
-	mb_io_ptr->mb_io_insert_nav = &mbsys_sb_insert_nav;
-	mb_io_ptr->mb_io_extract_altitude = &mbsys_sb_extract_altitude;
-	mb_io_ptr->mb_io_insert_altitude = NULL;
-	mb_io_ptr->mb_io_extract_svp = NULL;
-	mb_io_ptr->mb_io_insert_svp = NULL;
-	mb_io_ptr->mb_io_ttimes = &mbsys_sb_ttimes;
-	mb_io_ptr->mb_io_detects = &mbsys_sb_detects;
-	mb_io_ptr->mb_io_copyrecord = &mbsys_sb_copy;
-	mb_io_ptr->mb_io_extract_rawss = NULL;
-	mb_io_ptr->mb_io_insert_rawss = NULL;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",mb_io_ptr->system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",mb_io_ptr->beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",mb_io_ptr->beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",mb_io_ptr->pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",mb_io_ptr->format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",mb_io_ptr->system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",mb_io_ptr->format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",mb_io_ptr->numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",mb_io_ptr->filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",mb_io_ptr->variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",mb_io_ptr->traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",mb_io_ptr->beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",mb_io_ptr->nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",mb_io_ptr->heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",mb_io_ptr->vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",mb_io_ptr->svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",mb_io_ptr->beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",mb_io_ptr->beamwidth_ltrack);
-		fprintf(stderr,"dbg2       format_alloc:       %p\n",(void *)mb_io_ptr->mb_io_format_alloc);
-		fprintf(stderr,"dbg2       format_free:        %p\n",(void *)mb_io_ptr->mb_io_format_free);
-		fprintf(stderr,"dbg2       store_alloc:        %p\n",(void *)mb_io_ptr->mb_io_store_alloc);
-		fprintf(stderr,"dbg2       store_free:         %p\n",(void *)mb_io_ptr->mb_io_store_free);
-		fprintf(stderr,"dbg2       read_ping:          %p\n",(void *)mb_io_ptr->mb_io_read_ping);
-		fprintf(stderr,"dbg2       write_ping:         %p\n",(void *)mb_io_ptr->mb_io_write_ping);
-		fprintf(stderr,"dbg2       extract:            %p\n",(void *)mb_io_ptr->mb_io_extract);
-		fprintf(stderr,"dbg2       insert:             %p\n",(void *)mb_io_ptr->mb_io_insert);
-		fprintf(stderr,"dbg2       extract_nav:        %p\n",(void *)mb_io_ptr->mb_io_extract_nav);
-		fprintf(stderr,"dbg2       insert_nav:         %p\n",(void *)mb_io_ptr->mb_io_insert_nav);
-		fprintf(stderr,"dbg2       extract_altitude:   %p\n",(void *)mb_io_ptr->mb_io_extract_altitude);
-		fprintf(stderr,"dbg2       insert_altitude:    %p\n",(void *)mb_io_ptr->mb_io_insert_altitude);
-		fprintf(stderr,"dbg2       extract_svp:        %p\n",(void *)mb_io_ptr->mb_io_extract_svp);
-		fprintf(stderr,"dbg2       insert_svp:         %p\n",(void *)mb_io_ptr->mb_io_insert_svp);
-		fprintf(stderr,"dbg2       ttimes:             %p\n",(void *)mb_io_ptr->mb_io_ttimes);
-		fprintf(stderr,"dbg2       detects:            %p\n",(void *)mb_io_ptr->mb_io_detects);
-		fprintf(stderr,"dbg2       extract_rawss:      %p\n",(void *)mb_io_ptr->mb_io_extract_rawss);
-		fprintf(stderr,"dbg2       insert_rawss:       %p\n",(void *)mb_io_ptr->mb_io_insert_rawss);
-		fprintf(stderr,"dbg2       copyrecord:         %p\n",(void *)mb_io_ptr->mb_io_copyrecord);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbr_info_sburivax(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error)
-{
-	char	*function_name = "mbr_info_sburivax";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* set format info parameters */
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-	*system = MB_SYS_SB;
-	*beams_bath_max = 19;
-	*beams_amp_max = 0;
-	*pixels_ss_max = 0;
-	strncpy(format_name, "SBURIVAX", MB_NAME_LENGTH);
-	strncpy(system_name, "SB", MB_NAME_LENGTH);
-	strncpy(format_description, "Format name:          MBF_SBURIVAX\nInformal Description: URI Sea Beam from VAX\nAttributes:           Sea Beam, bathymetry, 19 beams, binary, centered,\n                      VAX byte order, URI.\n", MB_DESCRIPTION_LENGTH);
-	*numfile = 1;
-	*filetype = MB_FILETYPE_NORMAL;
-	*variable_beams = MB_NO;
-	*traveltime = MB_NO;
-	*beam_flagging = MB_YES;
-	*nav_source = MB_DATA_DATA;
-	*heading_source = MB_DATA_DATA;
-	*vru_source = MB_DATA_DATA;
-	*svp_source = MB_DATA_NONE;
-	*beamwidth_xtrack = 2.67;
-	*beamwidth_ltrack = 2.67;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",*system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",*beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",*beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",*pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",*numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",*filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",*variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",*traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",*beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",*nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",*heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",*vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",*svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",*beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",*beamwidth_ltrack);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_alm_sburivax(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_alm_sburivax";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set initial status */
-	status = MB_SUCCESS;
-
-	/* allocate memory for data structure */
-	mb_io_ptr->structure_size = sizeof(struct mbf_sburicen_struct);
-	mb_io_ptr->data_structure_size =
-		sizeof(struct mbf_sburicen_data_struct);
-	status = mb_malloc(verbose,mb_io_ptr->structure_size,
-				&mb_io_ptr->raw_data,error);
-	status = mb_malloc(verbose,sizeof(struct mbsys_sb_struct),
-				&mb_io_ptr->store_data,error);
-
-	/* set record counters to zero */
-	mb_io_ptr->irecord_count = 0;
-	mb_io_ptr->orecord_count = 0;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_dem_sburivax(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_dem_sburivax";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* deallocate memory for data descriptor */
-	status = mb_free(verbose,&mb_io_ptr->raw_data,error);
-	status = mb_free(verbose,&mb_io_ptr->store_data,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_rt_sburivax(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_rt_sburivax";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_sburicen_struct *dataplus;
-	struct mbf_sburicen_data_struct *data;
-	struct mbsys_sb_struct *store;
-	char	*datacomment;
-	short	dummy;
-	int	i;
-	int	id;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	dataplus = (struct mbf_sburicen_struct *) mb_io_ptr->raw_data;
-	data = &(dataplus->data);
-	datacomment = (char *) data;
-	dataplus->kind = MB_DATA_DATA;
-	store = (struct mbsys_sb_struct *) store_ptr;
-
-	/* set file position */
-	mb_io_ptr->file_pos = mb_io_ptr->file_bytes;
-
-	/* read next record from file */
-	if ((status = fread(data,1,mb_io_ptr->data_structure_size,
-			mb_io_ptr->mbfp)) == mb_io_ptr->data_structure_size)
-		{
-		mb_io_ptr->file_bytes += status;
-		status = MB_SUCCESS;
-		*error = MB_ERROR_NO_ERROR;
-		mb_io_ptr->irecord_count++;
-		}
-	else
-		{
-		mb_io_ptr->file_bytes += status;
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-
-	/* if needed read the extra two bytes that occur
-		every five records */
-	if (status == MB_SUCCESS && mb_io_ptr->irecord_count >= 5)
-		{
-		mb_io_ptr->irecord_count = 0;
-		fread(&dummy, 1, sizeof(short), mb_io_ptr->mbfp);
-		mb_io_ptr->file_bytes += sizeof(short);
-		}
-
-	/* byte swap the data if necessary */
-#ifndef BYTESWAPPED
-	if (status == MB_SUCCESS)
-		{
-		for (i=0;i<MBSYS_SB_BEAMS;i++)
-			{
-			data->dist[i] = mb_swap_short(data->dist[i]);
-			data->deph[i] = mb_swap_short(data->deph[i]);
-			}
-		data->axis = mb_swap_short(data->axis);
-		data->major = mb_swap_short(data->major);
-		data->minor = mb_swap_short(data->minor);
-		data->sbhdg = mb_swap_short(data->sbhdg);
-		data->lat2b = mb_swap_short(data->lat2b);
-		data->lat2u = mb_swap_short(data->lat2u);
-		data->lon2b = mb_swap_short(data->lon2b);
-		data->lon2u = mb_swap_short(data->lon2u);
-		data->sec = mb_swap_short(data->sec);
-		data->min = mb_swap_short(data->min);
-		data->day = mb_swap_short(data->day);
-		data->year = mb_swap_short(data->year);
-		data->sbtim = mb_swap_short(data->sbtim);
-		}
-#endif
-
-	/* check for comment or unintelligible records */
-	if (status == MB_SUCCESS)
-		{
-		if (data->deph[0] > 15000)
-			{
-			dataplus->kind = MB_DATA_COMMENT;
-			}
-		else if (data->year == 0)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_UNINTELLIGIBLE;
-			}
-		else
-			{
-			dataplus->kind = MB_DATA_DATA;
-			}
-		}
-
-	/* set kind and error in mb_io_ptr */
-	mb_io_ptr->new_kind = dataplus->kind;
-	mb_io_ptr->new_error = *error;
-
-	/* translate values to seabeam data storage structure */
-	if (status == MB_SUCCESS
-		&& store != NULL)
-		{
-		/* type of data record */
-		store->kind = dataplus->kind;
-
-		/* position */
-		store->lon2u = data->lon2u;
-		store->lon2b = data->lon2b;
-		store->lat2u = data->lat2u;
-		store->lat2b = data->lat2b;
-
-		/* time stamp */
-		store->year = data->year;
-		store->day = data->day;
-		store->min = data->min;
-		store->sec = data->sec;
-
-		/* depths and distances */
-		/* switch order of data as it is read into the global arrays */
-		id = MBSYS_SB_BEAMS - 1;
-		for (i=0;i<MBSYS_SB_BEAMS;i++)
-			{
-			store->dist[id-i] = data->dist[i];
-			store->deph[id-i] = data->deph[i];
-			}
-
-		/* additional values */
-		store->sbtim = data->sbtim;
-		store->sbhdg = data->sbhdg;
-		store->axis = data->axis;
-		store->major = data->major;
-		store->minor = data->minor;
-
-		/* comment */
-		strncpy(store->comment,&datacomment[2],
-			MBSYS_SB_MAXLINE);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_wt_sburivax(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_wt_sburivax";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_sburicen_struct *dataplus;
-	struct mbf_sburicen_data_struct *data;
-	struct mbsys_sb_struct *store;
-	char	*datacomment;
-	short	dummy = 0;
-	int	i;
-	int	id;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	dataplus = (struct mbf_sburicen_struct *) mb_io_ptr->raw_data;
-	data = &(dataplus->data);
-	datacomment = (char *) data;
-	store = (struct mbsys_sb_struct *) store_ptr;
-
-	/* first set some plausible amounts for some of the
-		variables in the MBURICEN record */
-	data->sbtim = 0;
-	data->axis = 0;
-	data->major = 0;
-	data->minor = 0;
-
-	/* second translate values from seabeam data storage structure */
-	if (store != NULL)
-		{
-		dataplus->kind = store->kind;
-		if (store->kind == MB_DATA_DATA)
-			{
-			/* position */
-			data->lon2u = store->lon2u;
-			data->lon2b = store->lon2b;
-			data->lat2u = store->lat2u;
-			data->lat2b = store->lat2b;
-
-			/* time stamp */
-			data->year = store->year;
-			data->day = store->day;
-			data->min = store->min;
-			data->sec = store->sec;
-
-			/* depths and distances */
-			/* switch order of data as it is read
-				into the output arrays */
-			id = MBSYS_SB_BEAMS - 1;
-			for (i=0;i<MBSYS_SB_BEAMS;i++)
-				{
-				data->dist[i] = store->dist[id-i];
-				data->deph[i] = store->deph[id-i];
-				}
-
-			/* additional values */
-			data->sbtim = store->sbtim;
-			data->sbhdg = store->sbhdg;
-			data->axis = store->axis;
-			data->major = store->major;
-			data->minor = store->minor;
-			}
-
-		/* comment */
-		else if (store->kind == MB_DATA_COMMENT)
-			{
-			strcpy(datacomment,"cc");
-			strncat(datacomment,store->comment,MBSYS_SB_MAXLINE-1);
-			}
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Ready to write data in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       kind:       %d\n",
-			dataplus->kind);
-		fprintf(stderr,"dbg5       error:      %d\n",*error);
-		fprintf(stderr,"dbg5       status:     %d\n",status);
-		}
-
-	/* byte swap the data if necessary */
-#ifndef BYTESWAPPED
-	if (dataplus->kind == MB_DATA_DATA
-		|| dataplus->kind == MB_DATA_COMMENT)
-		{
-		for (i=0;i<MBSYS_SB_BEAMS;i++)
-			{
-			data->dist[i] = mb_swap_short(data->dist[i]);
-			data->deph[i] = mb_swap_short(data->deph[i]);
-			}
-		data->axis = mb_swap_short(data->axis);
-		data->major = mb_swap_short(data->major);
-		data->minor = mb_swap_short(data->minor);
-		data->sbhdg = mb_swap_short(data->sbhdg);
-		data->lat2b = mb_swap_short(data->lat2b);
-		data->lat2u = mb_swap_short(data->lat2u);
-		data->lon2b = mb_swap_short(data->lon2b);
-		data->lon2u = mb_swap_short(data->lon2u);
-		data->sec = mb_swap_short(data->sec);
-		data->min = mb_swap_short(data->min);
-		data->day = mb_swap_short(data->day);
-		data->year = mb_swap_short(data->year);
-		data->sbtim = mb_swap_short(data->sbtim);
-		}
-#endif
-
-	/* write next record to file */
-	if (dataplus->kind == MB_DATA_DATA
-		|| dataplus->kind == MB_DATA_COMMENT)
-		{
-		if ((status = fwrite(data,1,mb_io_ptr->data_structure_size,
-			mb_io_ptr->mbfp))
-			== mb_io_ptr->data_structure_size)
-			{
-			status = MB_SUCCESS;
-			*error = MB_ERROR_NO_ERROR;
-			mb_io_ptr->orecord_count++;
-			}
-		else
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_WRITE_FAIL;
-			}
-
-		/* if needed write the extra two bytes that occur
-			every five records */
-		if (status == MB_SUCCESS && mb_io_ptr->orecord_count >= 5)
-			{
-			mb_io_ptr->orecord_count = 0;
-			fwrite(&dummy, 1, sizeof(short), mb_io_ptr->mbfp);
-			}
-		}
-	else
-		{
-		status = MB_SUCCESS;
-		*error = MB_ERROR_NO_ERROR;
-		if (verbose >= 5)
-			fprintf(stderr,"\ndbg5  No data written in MBIO function <%s>\n",function_name);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mbr_segysegy.c b/src/mbio/mbr_segysegy.c
deleted file mode 100644
index f100d96..0000000
--- a/src/mbio/mbr_segysegy.c
+++ /dev/null
@@ -1,536 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbr_segysegy.c	10/27/2006
- *	$Id: mbr_segysegy.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 2006-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbr_segysegy.c contains the functions for reading and writing
- * multibeam data in the SEGYSEGY format.
- * These functions include:
- *   mbr_alm_segysegy	- allocate read/write memory
- *   mbr_dem_segysegy	- deallocate read/write memory
- *   mbr_rt_segysegy	- read and translate data
- *   mbr_wt_segysegy	- translate and write data
- *
- * Author:	D. W. Caress
- * Date:	October 27, 2006
-
- * $Log: mbr_segysegy.c,v $
- * Revision 5.0  2007/01/04 23:52:24  caress
- * Support for segy data as format 160
- *
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mb_define.h"
-#include "mbsys_singlebeam.h"
-#include "mb_segy.h"
-
-/* essential function prototypes */
-int mbr_register_segysegy(int verbose, void *mbio_ptr,
-		int *error);
-int mbr_info_segysegy(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_alm_segysegy(int verbose, void *mbio_ptr, int *error);
-int mbr_dem_segysegy(int verbose, void *mbio_ptr, int *error);
-int mbr_rt_segysegy(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_wt_segysegy(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-
-static char rcs_id[]="$Id: mbr_segysegy.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mbr_register_segysegy(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_register_segysegy";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* get mb_io_ptr */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set format info parameters */
-	status = mbr_info_segysegy(verbose,
-			&mb_io_ptr->system,
-			&mb_io_ptr->beams_bath_max,
-			&mb_io_ptr->beams_amp_max,
-			&mb_io_ptr->pixels_ss_max,
-			mb_io_ptr->format_name,
-			mb_io_ptr->system_name,
-			mb_io_ptr->format_description,
-			&mb_io_ptr->numfile,
-			&mb_io_ptr->filetype,
-			&mb_io_ptr->variable_beams,
-			&mb_io_ptr->traveltime,
-			&mb_io_ptr->beam_flagging,
-			&mb_io_ptr->nav_source,
-			&mb_io_ptr->heading_source,
-			&mb_io_ptr->vru_source,
-			&mb_io_ptr->svp_source,
-			&mb_io_ptr->beamwidth_xtrack,
-			&mb_io_ptr->beamwidth_ltrack,
-			error);
-
-	/* set format and system specific function pointers */
-	mb_io_ptr->mb_io_format_alloc = &mbr_alm_segysegy;
-	mb_io_ptr->mb_io_format_free = &mbr_dem_segysegy;
-	mb_io_ptr->mb_io_store_alloc = &mbsys_singlebeam_alloc;
-	mb_io_ptr->mb_io_store_free = &mbsys_singlebeam_deall;
-	mb_io_ptr->mb_io_read_ping = &mbr_rt_segysegy;
-	mb_io_ptr->mb_io_write_ping = &mbr_wt_segysegy;
-	mb_io_ptr->mb_io_dimensions = &mbsys_singlebeam_dimensions;
-	mb_io_ptr->mb_io_pingnumber = &mbsys_singlebeam_pingnumber;
-	mb_io_ptr->mb_io_segynumber = &mbsys_singlebeam_segynumber;
-	mb_io_ptr->mb_io_extract = &mbsys_singlebeam_extract;
-	mb_io_ptr->mb_io_insert = &mbsys_singlebeam_insert;
-	mb_io_ptr->mb_io_extract_nav = &mbsys_singlebeam_extract_nav;
-	mb_io_ptr->mb_io_insert_nav = &mbsys_singlebeam_insert_nav;
-	mb_io_ptr->mb_io_extract_altitude = &mbsys_singlebeam_extract_altitude;
-	mb_io_ptr->mb_io_insert_altitude = NULL;
-	mb_io_ptr->mb_io_extract_svp = NULL;
-	mb_io_ptr->mb_io_insert_svp = NULL;
-	mb_io_ptr->mb_io_ttimes = &mbsys_singlebeam_ttimes;
-	mb_io_ptr->mb_io_detects = &mbsys_singlebeam_detects;
-	mb_io_ptr->mb_io_copyrecord = &mbsys_singlebeam_copy;
-	mb_io_ptr->mb_io_extract_rawss = NULL;
-	mb_io_ptr->mb_io_insert_rawss = NULL;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",mb_io_ptr->system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",mb_io_ptr->beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",mb_io_ptr->beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",mb_io_ptr->pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",mb_io_ptr->format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",mb_io_ptr->system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",mb_io_ptr->format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",mb_io_ptr->numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",mb_io_ptr->filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",mb_io_ptr->variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",mb_io_ptr->traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",mb_io_ptr->beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",mb_io_ptr->nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",mb_io_ptr->heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",mb_io_ptr->vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",mb_io_ptr->svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",mb_io_ptr->beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",mb_io_ptr->beamwidth_ltrack);
-		fprintf(stderr,"dbg2       format_alloc:       %p\n",(void *)mb_io_ptr->mb_io_format_alloc);
-		fprintf(stderr,"dbg2       format_free:        %p\n",(void *)mb_io_ptr->mb_io_format_free);
-		fprintf(stderr,"dbg2       store_alloc:        %p\n",(void *)mb_io_ptr->mb_io_store_alloc);
-		fprintf(stderr,"dbg2       store_free:         %p\n",(void *)mb_io_ptr->mb_io_store_free);
-		fprintf(stderr,"dbg2       read_ping:          %p\n",(void *)mb_io_ptr->mb_io_read_ping);
-		fprintf(stderr,"dbg2       write_ping:         %p\n",(void *)mb_io_ptr->mb_io_write_ping);
-		fprintf(stderr,"dbg2       extract:            %p\n",(void *)mb_io_ptr->mb_io_extract);
-		fprintf(stderr,"dbg2       insert:             %p\n",(void *)mb_io_ptr->mb_io_insert);
-		fprintf(stderr,"dbg2       extract_nav:        %p\n",(void *)mb_io_ptr->mb_io_extract_nav);
-		fprintf(stderr,"dbg2       insert_nav:         %p\n",(void *)mb_io_ptr->mb_io_insert_nav);
-		fprintf(stderr,"dbg2       extract_altitude:   %p\n",(void *)mb_io_ptr->mb_io_extract_altitude);
-		fprintf(stderr,"dbg2       insert_altitude:    %p\n",(void *)mb_io_ptr->mb_io_insert_altitude);
-		fprintf(stderr,"dbg2       extract_svp:        %p\n",(void *)mb_io_ptr->mb_io_extract_svp);
-		fprintf(stderr,"dbg2       insert_svp:         %p\n",(void *)mb_io_ptr->mb_io_insert_svp);
-		fprintf(stderr,"dbg2       ttimes:             %p\n",(void *)mb_io_ptr->mb_io_ttimes);
-		fprintf(stderr,"dbg2       detects:            %p\n",(void *)mb_io_ptr->mb_io_detects);
-		fprintf(stderr,"dbg2       extract_rawss:      %p\n",(void *)mb_io_ptr->mb_io_extract_rawss);
-		fprintf(stderr,"dbg2       insert_rawss:       %p\n",(void *)mb_io_ptr->mb_io_insert_rawss);
-		fprintf(stderr,"dbg2       copyrecord:         %p\n",(void *)mb_io_ptr->mb_io_copyrecord);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbr_info_segysegy(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error)
-{
-	char	*function_name = "mbr_info_segysegy";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* set format info parameters */
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-	*system = MB_SYS_SINGLEBEAM;
-	*beams_bath_max = 1;
-	*beams_amp_max = 0;
-	*pixels_ss_max = 0;
-	strncpy(format_name, "SEGYSEGY", MB_NAME_LENGTH);
-	strncpy(system_name, "SINGLEBEAM", MB_NAME_LENGTH);
-	strncpy(format_description, "Format name:          MBF_SEGYSEGY\nInformal Description: SEGY seismic data format\nAttributes:           seismic or subbottom trace data,\n                      single beam bathymetry, nav,\n                      binary, SEG (SIOSEIS variant)\n", MB_DESCRIPTION_LENGTH);
-	*numfile = 1;
-	*filetype = MB_FILETYPE_SEGY;
-	*variable_beams = MB_NO;
-	*traveltime = MB_YES;
-	*beam_flagging = MB_NO;
-	*nav_source = MB_DATA_DATA;
-	*heading_source = MB_DATA_DATA;
-	*vru_source = MB_DATA_DATA;
-	*svp_source = MB_DATA_NONE;
-	*beamwidth_xtrack = 0.0;
-	*beamwidth_ltrack = 0.0;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",*system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",*beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",*beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",*pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",*numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",*filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",*variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",*traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",*beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",*nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",*heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",*vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",*svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",*beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",*beamwidth_ltrack);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_alm_segysegy(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_alm_segysegy";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set initial status */
-	status = MB_SUCCESS;
-
-	/* allocate memory for data structure */
-	mb_io_ptr->structure_size = 0;
-	mb_io_ptr->data_structure_size = 0;
-	status = mb_malloc(verbose,sizeof(struct mbsys_singlebeam_struct),
-				&mb_io_ptr->store_data,error);
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_dem_segysegy(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_dem_segysegy";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* deallocate memory for data descriptor */
-	status = mb_free(verbose,&mb_io_ptr->store_data,error);
-	if (mb_io_ptr->data_structure_size > 0)
-		{
-		status = mb_free(verbose,&mb_io_ptr->raw_data,error);
-		mb_io_ptr->data_structure_size = 0;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_rt_segysegy(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_rt_segysegy";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_singlebeam_struct *store;
-	struct mb_segyio_struct *mb_segyio_ptr;
-	struct mb_segytraceheader_struct traceheader;
-	float	*trace;
-	int	time_j[5];
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointers to mbio descriptor and data structures */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-	store = (struct mbsys_singlebeam_struct *) store_ptr;
-	mb_segyio_ptr = (struct mb_segyio_struct *) (mb_io_ptr->mbfp);
-
-	/* read next data from file */
-	status = mb_segy_read_trace(verbose, (void *) mb_segyio_ptr,
-		&traceheader, &trace, error);
-
-	/* set error and kind in mb_io_ptr */
-	mb_io_ptr->new_error = *error;
-	mb_io_ptr->new_kind = MB_DATA_DATA;
-
-	/* translate values to data storage structure */
-	if (status == MB_SUCCESS
-		&& store != NULL)
-		{
-		store->kind = MB_DATA_DATA;
-		for (i=0;i<8;i++)
-		    store->survey_id[i] = '\0';
-		time_j[0] = traceheader.year;
-		time_j[1] = traceheader.day_of_yr;
-		time_j[2] = 60 * traceheader.hour + traceheader.min;
-		time_j[3] = traceheader.sec;
-		time_j[4] = 1000 * traceheader.mils;
-		mb_get_itime(verbose,time_j,store->time_i);
-		mb_get_time(verbose,store->time_i,&store->time_d);
-		store->timezone = 0;
-		store->longitude = ((double)traceheader.src_long) / 360000.0;
-		store->latitude = ((double)traceheader.src_lat) / 360000.0;
-		store->easting = 0.0;
-		store->northing = 0.0;
-		store->heading = traceheader.heading;
-		store->speed = 0.0;
-		store->nav_type = 9;
-		store->nav_quality = 9;
-		store->roll = 0.0;
-		store->pitch = 0.0;
-		store->heave = 0.0;
-		store->sonar_depth = 0.01 * traceheader.src_depth;
-		store->rov_pressure = 0.0;
-		store->rov_altitude = 0.01 * traceheader.src_wbd - 0.01 * traceheader.src_depth;
-		store->flag = MB_FLAG_NONE;
-		store->tt = traceheader.wbt_secs;
-		store->bath = 0.01 * traceheader.src_wbd;
-		store->tide = 0.0;
-		store->bath_corr = 99;
-		store->bath_type = 1;
-		store->mag_tot_1 = 0.0;
-		store->mag_tot_2 = 0.0;
-		store->mag_res = 0.0;
-		store->mag_res_sensor = 0.0;
-		store->mag_diurnal = 0.0;
-		store->mag_altitude = 0.0;
-		store->gravity = 0.0;
-		store->eotvos = 0.0;
-		store->free_air = 0.0;
-		store->seismic_line = mb_segyio_ptr->fileheader.line;
-		store->seismic_shot = traceheader.shot_num;
-		store->seismic_cdp = traceheader.rp_num;
-		for (i=0;i<MB_COMMENT_MAXLINE;i++)
-		    store->comment[i] = '\0';
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_wt_segysegy(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_wt_segysegy";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_singlebeam_struct *store;
-	struct mb_segyio_struct *mb_segyio_ptr;
-	struct mb_segytraceheader_struct traceheader;
-	float	*trace;
-	int	time_j[5];
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_singlebeam_struct *) store_ptr;
-	mb_segyio_ptr = (struct mb_segyio_struct *) (mb_io_ptr->mbfp);
-	traceheader = mb_segyio_ptr->traceheader;
-	trace = (float *) &mb_segyio_ptr->trace;
-
-	/* first translate values from data storage structure */
-	if (store != NULL)
-		{
-		mb_get_jtime(verbose,store->time_i,time_j);
-		traceheader.year	= store->time_i[0];
-		traceheader.day_of_yr	= time_j[1];
-		traceheader.hour	= store->time_i[3];
-		traceheader.min		= store->time_i[4];
-		traceheader.sec		= store->time_i[5];
-		traceheader.mils	= store->time_i[6] / 1000;
-		traceheader.src_long = store->longitude * 360000.0;
-		traceheader.src_lat = store->latitude * 360000.0;
-		traceheader.heading = store->heading;
-		traceheader.src_depth = 100.0 * store->sonar_depth;
-		traceheader.wbt_secs = store->tt;
-		traceheader.src_wbd = 100.0 * store->bath;
-		traceheader.shot_num = store->seismic_shot;
-		traceheader.rp_num = store->seismic_cdp;
-		}
-
-	/* write next data to file */
-	status = mb_segy_write_trace(verbose, (void *) mb_segyio_ptr,
-		&traceheader, trace, error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mbr_swplssxi.c b/src/mbio/mbr_swplssxi.c
deleted file mode 100644
index 0a441eb..0000000
--- a/src/mbio/mbr_swplssxi.c
+++ /dev/null
@@ -1,907 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbr_swplssxi.c	5/6/2013
- *	$Id: mbr_swplssxi.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 2013-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-
-/*
- * mbr_swplssxi.c contains the functions for reading and writing
- * interferometric sonar data in the MBF_SWPLSSXI format.
- * These functions include:
- *   mbr_alm_swplssxi	- allocate read/write memory
- *   mbr_dem_swplssxi	- deallocate read/write memory
- *   mbr_rt_swplssxi	- read and translate data
- *   mbr_wt_swplssxi	- translate and write data
- *
- * Author:	David Finlayson and D. W. Caress
- * Date:	February 26, 2013
- *
- * $Log: mbr_swplssxi.c,v $
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_define.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mbsys_swathplus.h"
-
-/* include for byte swapping */
-#include "mb_swap.h"
-
-/* turn on debug statements here
-   #define MBF_SWPLSSXI_DEBUG 1 */
-
-/* essential function prototypes */
-int mbr_register_swplssxi(int verbose, void *mbio_ptr, int *error);
-int mbr_info_swplssxi(int verbose, int *system, int *beams_bath_max,
-	int *beams_amp_max, int *pixels_ss_max, char *format_name,
-	char *system_name, char *format_description, int *numfile,
-	int *filetype, int *variable_beams, int *traveltime,
-	int *beam_flagging, int *nav_source, int *heading_source,
-	int *vru_source, int *svp_source,
-	double *beamwidth_xtrack, double *beamwidth_ltrack,
-	int *error);
-int mbr_alm_swplssxi(int verbose, void *mbio_ptr, int *error);
-int mbr_dem_swplssxi(int verbose, void *mbio_ptr, int *error);
-int mbr_rt_swplssxi(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_wt_swplssxi(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_swplssxi_rd_data(int verbose, void *mbio_ptr, void *store_ptr,
-	int *error);
-
-static char rcs_id[] = "$Id: mbr_swplssxi.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mbr_register_swplssxi(int verbose, void *mbio_ptr, int *error)
-{
-	char *function_name = "mbr_register_swplssxi";
-	int status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> called\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n");
-		fprintf(stderr, "dbg2       verbose:    %d\n", verbose);
-		}
-
-	/* get mb_io_ptr */
-	mb_io_ptr = (struct mb_io_struct *)mbio_ptr;
-
-	/* set format info parameters */
-	status = mbr_info_swplssxi(verbose, &mb_io_ptr->system,
-		&mb_io_ptr->beams_bath_max,
-		&mb_io_ptr->beams_amp_max,
-		&mb_io_ptr->pixels_ss_max,
-		mb_io_ptr->format_name, mb_io_ptr->system_name,
-		mb_io_ptr->format_description,
-		&mb_io_ptr->numfile, &mb_io_ptr->filetype,
-		&mb_io_ptr->variable_beams,
-		&mb_io_ptr->traveltime,
-		&mb_io_ptr->beam_flagging,
-		&mb_io_ptr->nav_source,
-		&mb_io_ptr->heading_source,
-		&mb_io_ptr->vru_source, &mb_io_ptr->svp_source,
-		&mb_io_ptr->beamwidth_xtrack,
-		&mb_io_ptr->beamwidth_ltrack, error);
-
-	/* set format and system specific function pointers */
-	mb_io_ptr->mb_io_format_alloc = &mbr_alm_swplssxi;
-	mb_io_ptr->mb_io_format_free = &mbr_dem_swplssxi;
-	mb_io_ptr->mb_io_store_alloc = &mbsys_swathplus_alloc;
-	mb_io_ptr->mb_io_store_free = &mbsys_swathplus_deall;
-	mb_io_ptr->mb_io_read_ping = &mbr_rt_swplssxi;
-	mb_io_ptr->mb_io_write_ping = &mbr_wt_swplssxi;
-	mb_io_ptr->mb_io_dimensions = &mbsys_swathplus_dimensions;
-	mb_io_ptr->mb_io_pingnumber = &mbsys_swathplus_pingnumber;
-	mb_io_ptr->mb_io_sonartype = &mbsys_swathplus_sonartype;
-	mb_io_ptr->mb_io_sidescantype = &mbsys_swathplus_sidescantype;
-	mb_io_ptr->mb_io_extract = &mbsys_swathplus_extract;
-	mb_io_ptr->mb_io_insert = &mbsys_swathplus_insert;
-	mb_io_ptr->mb_io_extract_nav = &mbsys_swathplus_extract_nav;
-	mb_io_ptr->mb_io_extract_nnav = NULL;
-	mb_io_ptr->mb_io_insert_nav = &mbsys_swathplus_insert_nav;
-	mb_io_ptr->mb_io_extract_altitude = &mbsys_swathplus_extract_altitude;
-	mb_io_ptr->mb_io_insert_altitude = NULL;
-	mb_io_ptr->mb_io_extract_svp = NULL;
-	mb_io_ptr->mb_io_insert_svp = NULL;
-	mb_io_ptr->mb_io_ttimes = &mbsys_swathplus_ttimes;
-	mb_io_ptr->mb_io_detects = &mbsys_swathplus_detects;
-	mb_io_ptr->mb_io_gains = &mbsys_swathplus_gains;
-	mb_io_ptr->mb_io_pulses = NULL;
-	mb_io_ptr->mb_io_copyrecord = &mbsys_swathplus_copy;
-	mb_io_ptr->mb_io_extract_rawss = NULL;
-	mb_io_ptr->mb_io_insert_rawss = NULL;
-	mb_io_ptr->mb_io_extract_segytraceheader = NULL;
-	mb_io_ptr->mb_io_extract_segy = NULL;
-	mb_io_ptr->mb_io_insert_segy = NULL;
-	mb_io_ptr->mb_io_ctd = NULL;
-	mb_io_ptr->mb_io_ancilliarysensor = NULL;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		fprintf(stderr, "dbg2       system:             %d\n",
-			mb_io_ptr->system);
-		fprintf(stderr, "dbg2       beams_bath_max:     %d\n",
-			mb_io_ptr->beams_bath_max);
-		fprintf(stderr, "dbg2       beams_amp_max:      %d\n",
-			mb_io_ptr->beams_amp_max);
-		fprintf(stderr, "dbg2       pixels_ss_max:      %d\n",
-			mb_io_ptr->pixels_ss_max);
-		fprintf(stderr, "dbg2       format_name:        %s\n",
-			mb_io_ptr->format_name);
-		fprintf(stderr, "dbg2       system_name:        %s\n",
-			mb_io_ptr->system_name);
-		fprintf(stderr, "dbg2       format_description: %s\n",
-			mb_io_ptr->format_description);
-		fprintf(stderr, "dbg2       numfile:            %d\n",
-			mb_io_ptr->numfile);
-		fprintf(stderr, "dbg2       filetype:           %d\n",
-			mb_io_ptr->filetype);
-		fprintf(stderr, "dbg2       variable_beams:     %d\n",
-			mb_io_ptr->variable_beams);
-		fprintf(stderr, "dbg2       traveltime:         %d\n",
-			mb_io_ptr->traveltime);
-		fprintf(stderr, "dbg2       beam_flagging:      %d\n",
-			mb_io_ptr->beam_flagging);
-		fprintf(stderr, "dbg2       nav_source:         %d\n",
-			mb_io_ptr->nav_source);
-		fprintf(stderr, "dbg2       heading_source:     %d\n",
-			mb_io_ptr->heading_source);
-		fprintf(stderr, "dbg2       vru_source:         %d\n",
-			mb_io_ptr->vru_source);
-		fprintf(stderr, "dbg2       svp_source:         %d\n",
-			mb_io_ptr->svp_source);
-		fprintf(stderr, "dbg2       beamwidth_xtrack:   %f\n",
-			mb_io_ptr->beamwidth_xtrack);
-		fprintf(stderr, "dbg2       beamwidth_ltrack:   %f\n",
-			mb_io_ptr->beamwidth_ltrack);
-		fprintf(stderr, "dbg2       format_alloc:       %p\n",
-			(void *)mb_io_ptr->mb_io_format_alloc);
-		fprintf(stderr, "dbg2       format_free:        %p\n",
-			(void *)mb_io_ptr->mb_io_format_free);
-		fprintf(stderr, "dbg2       store_alloc:        %p\n",
-			(void *)mb_io_ptr->mb_io_store_alloc);
-		fprintf(stderr, "dbg2       store_free:         %p\n",
-			(void *)mb_io_ptr->mb_io_store_free);
-		fprintf(stderr, "dbg2       read_ping:          %p\n",
-			(void *)mb_io_ptr->mb_io_read_ping);
-		fprintf(stderr, "dbg2       write_ping:         %p\n",
-			(void *)mb_io_ptr->mb_io_write_ping);
-		fprintf(stderr, "dbg2       extract:            %p\n",
-			(void *)mb_io_ptr->mb_io_extract);
-		fprintf(stderr, "dbg2       insert:             %p\n",
-			(void *)mb_io_ptr->mb_io_insert);
-		fprintf(stderr, "dbg2       extract_nav:        %p\n",
-			(void *)mb_io_ptr->mb_io_extract_nav);
-		fprintf(stderr, "dbg2       insert_nav:         %p\n",
-			(void *)mb_io_ptr->mb_io_insert_nav);
-		fprintf(stderr, "dbg2       extract_altitude:   %p\n",
-			(void *)mb_io_ptr->mb_io_extract_altitude);
-		fprintf(stderr, "dbg2       insert_altitude:    %p\n",
-			(void *)mb_io_ptr->mb_io_insert_altitude);
-		fprintf(stderr, "dbg2       extract_svp:        %p\n",
-			(void *)mb_io_ptr->mb_io_extract_svp);
-		fprintf(stderr, "dbg2       insert_svp:         %p\n",
-			(void *)mb_io_ptr->mb_io_insert_svp);
-		fprintf(stderr, "dbg2       ttimes:             %p\n",
-			(void *)mb_io_ptr->mb_io_ttimes);
-		fprintf(stderr, "dbg2       detects:            %p\n",
-			(void *)mb_io_ptr->mb_io_detects);
-		fprintf(stderr, "dbg2       pulses:             %p\n",
-			(void *)mb_io_ptr->mb_io_pulses);
-		fprintf(stderr, "dbg2       extract_rawss:      %p\n",
-			(void *)mb_io_ptr->mb_io_extract_rawss);
-		fprintf(stderr, "dbg2       insert_rawss:       %p\n",
-			(void *)mb_io_ptr->mb_io_insert_rawss);
-		fprintf(stderr, "dbg2       extract_segytraceheader: %p\n",
-			(void *)mb_io_ptr->mb_io_extract_segytraceheader);
-		fprintf(stderr, "dbg2       extract_segy:       %p\n",
-			(void *)mb_io_ptr->mb_io_extract_segy);
-		fprintf(stderr, "dbg2       insert_segy:        %p\n",
-			(void *)mb_io_ptr->mb_io_insert_segy);
-		fprintf(stderr, "dbg2       copyrecord:         %p\n",
-			(void *)mb_io_ptr->mb_io_copyrecord);
-		fprintf(stderr, "dbg2       error:              %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2       status:         %d\n", status);
-		}
-
-	/* return status */
-	return (status);
-} /* mbr_register_swplssxi */
-/*--------------------------------------------------------------------*/
-int mbr_info_swplssxi(int verbose, int *system, int *beams_bath_max,
-	int *beams_amp_max, int *pixels_ss_max, char *format_name,
-	char *system_name, char *format_description, int *numfile,
-	int *filetype, int *variable_beams, int *traveltime,
-	int *beam_flagging, int *nav_source, int *heading_source,
-	int *vru_source, int *svp_source,
-	double *beamwidth_xtrack, double *beamwidth_ltrack,
-	int *error)
-{
-	char *function_name = "mbr_info_swplssxi";
-	int status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> called\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n");
-		fprintf(stderr, "dbg2       verbose:    %d\n", verbose);
-		}
-
-	/* set format info parameters */
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-	*system = MB_SYS_SWATHPLUS;
-	*beams_bath_max = SWPLS_MAX_BEAMS;
-	*beams_amp_max = SWPLS_MAX_BEAMS;
-	*pixels_ss_max = SWPLS_MAX_PIXELS;
-	strncpy(format_name, "SWPLSSXI", MB_NAME_LENGTH);
-	strncpy(system_name, "SWATHPLUS", MB_NAME_LENGTH);
-	strncpy(format_description,
-		"Format name:          MBF_SWPLSSXI\nInformal Description: SEA interferometric sonar vendor intermediate format\n"
-		"Attributes:           SEA SWATHplus,\n"
-		"                      bathymetry and amplitude,\n"
-		"                      variable beams, binary, SEA.\n",
-		MB_DESCRIPTION_LENGTH);
-	*numfile = 1;
-	*filetype = MB_FILETYPE_SINGLE;
-	*variable_beams = MB_YES;
-	*traveltime = MB_YES;
-	*beam_flagging = MB_YES;
-	*nav_source = MB_DATA_NAV;
-	*heading_source = MB_DATA_ATTITUDE;
-	*vru_source = MB_DATA_ATTITUDE;
-	*svp_source = MB_DATA_NONE;
-	*beamwidth_xtrack = SWPLS_TYPE_M_BEAM_WIDTH;
-	*beamwidth_ltrack = SWPLS_TYPE_M_BEAM_WIDTH;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		fprintf(stderr, "dbg2       system:             %d\n", *system);
-		fprintf(stderr, "dbg2       beams_bath_max:     %d\n", *beams_bath_max);
-		fprintf(stderr, "dbg2       beams_amp_max:      %d\n", *beams_amp_max);
-		fprintf(stderr, "dbg2       pixels_ss_max:      %d\n", *pixels_ss_max);
-		fprintf(stderr, "dbg2       format_name:        %s\n", format_name);
-		fprintf(stderr, "dbg2       system_name:        %s\n", system_name);
-		fprintf(stderr, "dbg2       format_description: %s\n",
-			format_description);
-		fprintf(stderr, "dbg2       numfile:            %d\n", *numfile);
-		fprintf(stderr, "dbg2       filetype:           %d\n", *filetype);
-		fprintf(stderr, "dbg2       variable_beams:     %d\n", *variable_beams);
-		fprintf(stderr, "dbg2       traveltime:         %d\n", *traveltime);
-		fprintf(stderr, "dbg2       beam_flagging:      %d\n", *beam_flagging);
-		fprintf(stderr, "dbg2       nav_source:         %d\n", *nav_source);
-		fprintf(stderr, "dbg2       heading_source:     %d\n", *heading_source);
-		fprintf(stderr, "dbg2       vru_source:         %d\n", *vru_source);
-		fprintf(stderr, "dbg2       svp_source:         %d\n", *svp_source);
-		fprintf(stderr, "dbg2       beamwidth_xtrack:   %f\n",
-			*beamwidth_xtrack);
-		fprintf(stderr, "dbg2       beamwidth_ltrack:   %f\n",
-			*beamwidth_ltrack);
-		fprintf(stderr, "dbg2       error:              %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2       status:         %d\n", status);
-		}
-
-	/* return status */
-	return (status);
-} /* mbr_info_swplssxi */
-/*--------------------------------------------------------------------*/
-int mbr_alm_swplssxi(int verbose, void *mbio_ptr, int *error)
-{
-	char *function_name = "mbr_alm_swplssxi";
-	int status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	int *current_ping;
-	int *last_ping;
-	int *save_flag;
-	int *recordid;
-	int *recordidlast;
-	char **bufferptr;
-	char *buffer;
-	int *bufferalloc;
-	int *size;
-	int *nbadrec;
-	int *deviceid;
-	int *projection_file_created;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> called\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n");
-		fprintf(stderr, "dbg2       verbose:    %d\n", verbose);
-		fprintf(stderr, "dbg2       mbio_ptr:   %p\n", (void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *)mbio_ptr;
-
-	/* set initial status */
-	status = MB_SUCCESS;
-
-	/* allocate memory for data structure */
-	mb_io_ptr->structure_size = 0;
-	mb_io_ptr->data_structure_size = 0;
-	status = mbsys_swathplus_alloc(verbose, mbio_ptr, &mb_io_ptr->store_data,
-		error);
-	save_flag = (int *)&mb_io_ptr->save_flag;
-	current_ping = (int *)&mb_io_ptr->save14;
-	last_ping = (int *)&mb_io_ptr->save1;
-	recordid = (int *)&mb_io_ptr->save3;
-	recordidlast = (int *)&mb_io_ptr->save4;
-	bufferptr = (char **)&mb_io_ptr->saveptr1;
-	buffer = (char *)*bufferptr;
-	bufferalloc = (int *)&mb_io_ptr->save6;
-	size = (int *)&mb_io_ptr->save8;
-	nbadrec = (int *)&mb_io_ptr->save9;
-	deviceid = (int *)&mb_io_ptr->save10;
-	projection_file_created = (int *)&mb_io_ptr->save5;
-
-	*current_ping = -1;
-	*last_ping = -1;
-	*save_flag = MB_NO;
-	*recordid = SWPLS_ID_NONE;
-	*recordidlast = SWPLS_ID_NONE;
-	*bufferptr = NULL;
-	*bufferalloc = 0;
-	*size = 0;
-	*nbadrec = 0;
-	*deviceid = 0;
-	*projection_file_created = MB_NO;
-
-	/* allocate memory if necessary */
-	if (status == MB_SUCCESS)
-		{
-		status = mb_reallocd(verbose, __FILE__, __LINE__,
-			SWPLS_BUFFER_STARTSIZE, (void **)bufferptr, error);
-		if (status == MB_SUCCESS)
-			{
-			*bufferalloc = SWPLS_BUFFER_STARTSIZE;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		fprintf(stderr, "dbg2       error:      %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2       status:  %d\n", status);
-		}
-
-	/* return status */
-	return (status);
-} /* mbr_alm_swplssxi */
-/*--------------------------------------------------------------------*/
-int mbr_dem_swplssxi(int verbose, void *mbio_ptr, int *error)
-{
-	char *function_name = "mbr_dem_swplssxi";
-	int status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	char **bufferptr;
-	char *buffer;
-	int *bufferalloc;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> called\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n");
-		fprintf(stderr, "dbg2       verbose:    %d\n", verbose);
-		fprintf(stderr, "dbg2       mbio_ptr:   %p\n", (void *)mbio_ptr);
-		}
-
-	/* get pointers to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *)mbio_ptr;
-
-	/* deallocate memory for reading/writing buffer */
-	bufferptr = (char **)&mb_io_ptr->saveptr1;
-	buffer = (char *)*bufferptr;
-	bufferalloc = (int *)&mb_io_ptr->save6;
-	status = mb_freed(verbose, __FILE__, __LINE__, (void **)bufferptr, error);
-	*bufferalloc = 0;
-
-	/* deallocate memory for data descriptor */
-	status = mbsys_swathplus_deall(verbose, mbio_ptr, &mb_io_ptr->store_data,
-		error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		fprintf(stderr, "dbg2       error:      %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2       status:  %d\n", status);
-		}
-
-	/* return status */
-	return (status);
-} /* mbr_dem_swplssxi */
-/*--------------------------------------------------------------------*/
-int mbr_rt_swplssxi(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char *function_name = "mbr_rt_swplssxi";
-	int status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_swathplus_struct *store;
-	swpls_projection *projection;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> called\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n");
-		fprintf(stderr, "dbg2       verbose:    %d\n", verbose);
-		fprintf(stderr, "dbg2       mbio_ptr:   %p\n", (void *)mbio_ptr);
-		fprintf(stderr, "dbg2       store_ptr:  %p\n", (void *)store_ptr);
-		}
-
-	/* get pointers to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *)mbio_ptr;
-
-	/* read next data from file */
-	status = mbr_swplssxi_rd_data(verbose, mbio_ptr, store_ptr, error);
-
-	/* get pointers to data structures */
-	store = (struct mbsys_swathplus_struct *)store_ptr;
-	projection = &store->projection;
-
-	/* check if projection has been set from *.prj file, if so, copy into projection structure */
-	if ((store->projection_set == MB_NO) &&
-		(mb_io_ptr->projection_initialized == MB_YES))
-		{
-		projection->time_d = time(NULL);
-		projection->microsec = 0;
-		projection->nchars = strnlen(mb_io_ptr->projection_id, MB_NAME_LENGTH);
-		if (projection->projection_alloc < projection->nchars)
-			{
-			status = mb_reallocd(verbose, __FILE__, __LINE__,
-				(size_t)projection->nchars,
-				(void **)&(projection->projection_id), error);
-			if (status != MB_SUCCESS)
-				{
-				projection->projection_alloc = 0;
-				}
-			else
-				{
-				projection->projection_alloc = projection->nchars;
-				}
-			}
-			
-		if (status == MB_SUCCESS)
-			{
-			strncpy(projection->projection_id, mb_io_ptr->projection_id, 
-				(size_t)projection->nchars);
-			store->projection_set = MB_YES;
-			}		
-		}
-	/* check if projection has been read from *mb222 file, if so, tell mb system */
-	else if ((store->projection_set == MB_YES) &&
-		(mb_io_ptr->projection_initialized == MB_NO))
-		{
-		mb_proj_init(verbose, projection->projection_id, &(mb_io_ptr->pjptr), error);
-		strncpy(mb_io_ptr->projection_id, projection->projection_id, MB_NAME_LENGTH);
-		mb_io_ptr->projection_initialized = MB_YES;
-		}
-
-	/* throw away multibeam data if the time stamp makes no sense */
-	if ((status == MB_SUCCESS) && (store->kind == MB_DATA_DATA) &&
-		(store->time_i[0] < 2003))
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_UNINTELLIGIBLE;
-		}
-	/* save geographic position fix data */
-	else if ((status == MB_SUCCESS) && (store->kind == MB_DATA_NAV) &&
-		(store->projection_set == MB_NO))
-		{
-		mb_navint_add(verbose, mbio_ptr, store->time_d, store->posll.longitude,
-			store->posll.latitude, error);
-		}
-	/* save projected position fix data */
-	else if ((status == MB_SUCCESS) && (store->kind == MB_DATA_NAV1) &&
-		(store->projection_set == MB_YES))
-		{
-		mb_navint_add(verbose, mbio_ptr, store->time_d, store->posen.easting,
-			store->posen.northing, error);
-		}
-	/* save heading and attitude fix data */
-	else if ((status == MB_SUCCESS) && (store->kind == MB_DATA_ATTITUDE))
-		{
-		mb_attint_add(verbose, mbio_ptr, store->time_d, store->attitude.height,
-			store->attitude.roll, store->attitude.pitch, error);
-		mb_hedint_add(verbose, mbio_ptr, store->time_d, store->attitude.heading,
-			error);
-		}
-	/* save tide data (as altitude) */
-	else if ((status == MB_SUCCESS) && (store->kind == MB_DATA_TIDE))
-		{
-		mb_altint_add(verbose, mbio_ptr, store->time_d, store->tide.tide,
-			error);
-		}
-
-	/* set error and kind in mb_io_ptr */
-	mb_io_ptr->new_error = *error;
-	mb_io_ptr->new_kind = store->kind;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		fprintf(stderr, "dbg2       error:      %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2       status:  %d\n", status);
-		}
-
-	/* return status */
-	return (status);
-} /* mbr_rt_swplssxi */
-/*--------------------------------------------------------------------*/
-int mbr_wt_swplssxi(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char *function_name = "mbr_wt_swplssxi";
-	int status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_swathplus_struct *store;
-	int *header_rec_written;
-	int *projection_rec_written;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> called\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n");
-		fprintf(stderr, "dbg2       verbose:    %d\n", verbose);
-		fprintf(stderr, "dbg2       mbio_ptr:   %p\n", (void *)mbio_ptr);
-		fprintf(stderr, "dbg2       store_ptr:  %p\n", (void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *)mbio_ptr;
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_swathplus_struct *)store_ptr;
-
-	/* get pointers to saved data */
-	header_rec_written = &(mb_io_ptr->save1);
-	projection_rec_written = &(mb_io_ptr->save2);
-	
-	/* write header record if needed */
-	if ((store->sxi_header_set == MB_YES) &&
-		(*header_rec_written == MB_NO))
-		{
-		int origkind = store->kind;
-		int origtype = store->type;
-		store->kind = MB_DATA_HEADER;
-		store->type = SWPLS_ID_SXI_HEADER_DATA;
-		status = swpls_wr_data(verbose, mbio_ptr, store_ptr, error);
-		if (status == MB_SUCCESS)
-			{
-			*header_rec_written = MB_YES;
-			}
-		store->kind = origkind;
-		store->type = origtype;
-		}
-
-	/* write projection record if needed */
-	if ((store->projection_set == MB_YES) &&
-		(*projection_rec_written == MB_NO))
-		{
-		int origkind = store->kind;
-		int origtype = store->type;
-		store->kind = MB_DATA_PARAMETER;
-		store->type = SWPLS_ID_PROJECTION;
-		status = swpls_wr_data(verbose, mbio_ptr, store_ptr, error);
-		if (status == MB_SUCCESS)
-			{
-			*projection_rec_written = MB_YES;
-			}
-		store->kind = origkind;
-		store->type = origtype;
-		}
-
-	/* write projection file if needed */
-//	if ((*projection_file_created == MB_NO) &&
-//		(store->projection_set == MB_YES))
-//		{
-//		sprintf(projection_file, "%s.prj", mb_io_ptr->file);
-//		if ((pfp = fopen(projection_file, "w")) != NULL)
-//			{
-//			fprintf(pfp, "%s\n", store->projection_id);
-//			*projection_file_created = MB_YES;
-//			}
-//		fclose(pfp);
-//		}
-
-	/* write next data to file */
-	status = swpls_wr_data(verbose, mbio_ptr, store_ptr, error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		fprintf(stderr, "dbg2       error:      %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2       status:  %d\n", status);
-		}
-
-	/* return status */
-	return (status);
-} /* mbr_wt_swplssxi */
-/*--------------------------------------------------------------------*/
-int mbr_swplssxi_rd_data(int verbose, void *mbio_ptr, void *store_ptr,
-	int *error)
-{
-	char *function_name = "mbr_swplssxi_rd_data";
-	int status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_swathplus_struct *store;
-	char **bufferptr;
-	char *buffer;
-	int *bufferalloc;
-	int *recordid;
-	int *recordidlast;
-	int *size;
-	int *nbadrec;
-	int done;
-	size_t read_len;
-	int skip;
-	int i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> called\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n");
-		fprintf(stderr, "dbg2       verbose:    %d\n", verbose);
-		fprintf(stderr, "dbg2       mbio_ptr:   %p\n", (void *)mbio_ptr);
-		fprintf(stderr, "dbg2       store_ptr:  %p\n", (void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *)mbio_ptr;
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_swathplus_struct *)store_ptr;
-
-	/* get saved values */
-	recordid = (int *)&mb_io_ptr->save3;
-	recordidlast = (int *)&mb_io_ptr->save4;
-	bufferptr = (char **)&mb_io_ptr->saveptr1;
-	buffer = (char *)*bufferptr;
-	bufferalloc = (int *)&mb_io_ptr->save6;
-	size = (int *)&mb_io_ptr->save8;
-	nbadrec = (int *)&mb_io_ptr->save9;
-
-	/* set file position */
-	mb_io_ptr->file_pos = mb_io_ptr->file_bytes;
-
-	/* loop over reading data until a record is ready for return */
-	done = MB_NO;
-	*error = MB_ERROR_NO_ERROR;
-	while (done == MB_NO)
-		{
-		/* read next record header into buffer */
-		read_len = (size_t)SWPLS_SIZE_BLOCKHEADER;
-		status = mb_fileio_get(verbose, mbio_ptr, buffer, &read_len, error);
-
-		/* check header - if not a good header read a byte
-		   at a time until a good header is found */
-		skip = 0;
-		while (status == MB_SUCCESS &&
-			swpls_chk_header(verbose, mbio_ptr, buffer, recordid, size,
-			error) != MB_SUCCESS)
-			{
-			/* get next byte */
-			for (i = 0; i < SWPLS_SIZE_BLOCKHEADER - 1; i++)
-				{
-				buffer[i] = buffer[i + 1];
-				}
-			read_len = (size_t)1;
-			status =
-				mb_fileio_get(verbose, mbio_ptr,
-				&buffer[SWPLS_SIZE_BLOCKHEADER - 1], &read_len, error);
-			skip++;
-			}
-
-		/* report problem */
-		if ((skip > 0) && (verbose >= 0))
-			{
-			if (*nbadrec == 0)
-				{
-				fprintf(stderr,
-					"The MBR_SWPLSSXI module skipped data between identified\n" 
-					"data records. Something is broken, most probably the data...\n" 
-					"However, the data may include a data record type that we\n" 
-					"haven't seen yet, or there could be an error in the code.\n" 
-					"If skipped data are reported multiple times,\n" 
-					"we recommend you send a data sample and problem\n" 
-					"description to the MB-System team\n" 
-					"(caress at mbari.org and dale at ldeo.columbia.edu)\n"
-					 "Have a nice day...\n");
-				}
-			fprintf(stderr,
-				"MBR_SWPLSSXI skipped %d bytes between records %4.4X:%d and %4.4X:%d\n", skip, *recordidlast, *recordidlast, *recordid,
-				*recordid);
-			(*nbadrec)++;
-			}
-
-		*recordidlast = *recordid;
-		store->type = *recordid;
-
-		/* allocate memory to read rest of record if necessary */
-		if (*bufferalloc < *size + SWPLS_SIZE_BLOCKHEADER)
-			{
-			status = mb_reallocd(verbose, __FILE__, __LINE__,
-				*size + SWPLS_SIZE_BLOCKHEADER,
-				(void **)bufferptr, error);
-			if (status != MB_SUCCESS)
-				{
-				*bufferalloc = 0;
-				done = MB_YES;
-				}
-			else
-				{
-				*bufferalloc = *size + SWPLS_SIZE_BLOCKHEADER;
-				buffer = (char *)*bufferptr;
-				}
-			}
-
-		/* read the rest of the record */
-		if (status == MB_SUCCESS)
-			{
-			read_len = (size_t)*size;
-			status =
-				mb_fileio_get(verbose, mbio_ptr,
-				&buffer[SWPLS_SIZE_BLOCKHEADER], &read_len,
-				error);
-			}
-
-		/* parse the data record */
-		if ((status == MB_SUCCESS) && (done == MB_NO))
-			{
-			if (*recordid == SWPLS_ID_SXI_HEADER_DATA)
-				{
-				status = swpls_rd_sxiheader(verbose, buffer, store_ptr, error);
-				done = MB_YES;
-				}
-			else if (*recordid == SWPLS_ID_PARSED_PING)
-				{
-				status = swpls_rd_sxiping(verbose, buffer, store_ptr, error);
-				done = MB_YES;
-				}
-			else if (*recordid == SWPLS_ID_PARSED_ATTITUDE)
-				{
-				status = swpls_rd_attitude(verbose, buffer, store_ptr, error);
-				done = MB_YES;
-				}
-			else if (*recordid == SWPLS_ID_PARSED_POSITION_LL)
-				{
-				status = swpls_rd_posll(verbose, buffer, store_ptr, error);
-				done = MB_YES;
-				}
-			else if (*recordid == SWPLS_ID_PARSED_POSITION_EN)
-				{
-				status = swpls_rd_posen(verbose, buffer, store_ptr, error);
-				done = MB_YES;
-				}
-			else if (*recordid == SWPLS_ID_PARSED_SSV)
-				{
-				status = swpls_rd_ssv(verbose, buffer, store_ptr, error);
-				done = MB_YES;
-				}
-			else if (*recordid == SWPLS_ID_PARSED_ECHOSOUNDER)
-				{
-				status =
-					swpls_rd_echosounder(verbose, buffer, store_ptr, error);
-				done = MB_YES;
-				}
-			else if (*recordid == SWPLS_ID_PARSED_TIDE)
-				{
-				status = swpls_rd_tide(verbose, buffer, store_ptr, error);
-				done = MB_YES;
-				}
-			else if (*recordid == SWPLS_ID_PARSED_AGDS)
-				{
-				status = swpls_rd_agds(verbose, buffer, store_ptr, error);
-				done = MB_YES;
-				}
-			else if (*recordid == SWPLS_ID_COMMENT)
-				{
-				status = swpls_rd_comment(verbose, buffer, store_ptr, error);
-				done = MB_YES;
-				}
-			else if (*recordid == SWPLS_ID_POS_OFFSET)
-				{
-				status = swpls_rd_pos_offset(verbose, buffer, store_ptr, error);
-				done = MB_YES;
-				}
-			else if (*recordid == SWPLS_ID_IMU_OFFSET)
-				{
-				status = swpls_rd_imu_offset(verbose, buffer, store_ptr, error);
-				done = MB_YES;
-				}
-			else if (*recordid == SWPLS_ID_TXER_OFFSET)
-				{
-				status =
-					swpls_rd_txer_offset(verbose, buffer, store_ptr, error);
-				done = MB_YES;
-				}
-			else if (*recordid == SWPLS_ID_WL_OFFSET)
-				{
-				status = swpls_rd_wl_offset(verbose, buffer, store_ptr, error);
-				done = MB_YES;
-				}
-			else
-				{
-				done = MB_NO;
-				}
-			}
-
-		if (status == MB_FAILURE)
-			{
-			done = MB_YES;
-			}
-		}
-
-	/* get file position */
-	mb_io_ptr->file_bytes = ftell(mb_io_ptr->mbfp);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		fprintf(stderr, "dbg2       error:      %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2       status:  %d\n", status);
-		}
-
-	/* return status */
-	return (status);
-} /* mbr_swplssxi_rd_data */
-
diff --git a/src/mbio/mbr_swplssxp.c b/src/mbio/mbr_swplssxp.c
deleted file mode 100644
index 856bccf..0000000
--- a/src/mbio/mbr_swplssxp.c
+++ /dev/null
@@ -1,828 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:    mbr_swplssxp.c  5/6/2013
- *  $Id: mbr_swplssxp.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 2013-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-
-/*
- * mbr_swplssxp.c contains the functions for reading and writing
- * interferometric sonar data in the MBF_SWPLSSXP format.
- * These functions include:
- *   mbr_alm_swplssxp   - allocate read/write memory
- *   mbr_dem_swplssxp   - deallocate read/write memory
- *   mbr_rt_swplssxp    - read and translate data
- *   mbr_wt_swplssxp    - translate and write data
- *
- * Author:  D. P. Finlayson and D. W. Caress
- * Date:    February 22, 2014
- * $Log: mbr_swplssxp.c,v $
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_define.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mbsys_swathplus.h"
-
-/* include for byte swapping */
-#include "mb_swap.h"
-
-/* turn on debug statements here
-   #define MBF_SWPLSSXP_DEBUG 1 */
-
-/* essential function prototypes */
-int mbr_register_swplssxp(int verbose, void *mbio_ptr, int *error);
-int mbr_info_swplssxp(int verbose, int *system, int *beams_bath_max,
-	int *beams_amp_max, int *pixels_ss_max, char *format_name,
-	char *system_name, char *format_description, int *numfile,
-	int *filetype, int *variable_beams, int *traveltime,
-	int *beam_flagging, int *nav_source, int *heading_source,
-	int *vru_source, int *svp_source,
-	double *beamwidth_xtrack, double *beamwidth_ltrack,
-	int *error);
-int mbr_alm_swplssxp(int verbose, void *mbio_ptr, int *error);
-int mbr_dem_swplssxp(int verbose, void *mbio_ptr, int *error);
-int mbr_rt_swplssxp(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_wt_swplssxp(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_swplssxp_rd_data(int verbose, void *mbio_ptr, void *store_ptr,
-	int *error);
-
-static char rcs_id[] = "$Id: mbr_swplssxp.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mbr_register_swplssxp(int verbose, void *mbio_ptr, int *error)
-{
-	char *function_name = "mbr_register_swplssxp";
-	int status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> called\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n");
-		fprintf(stderr, "dbg2       verbose:    %d\n", verbose);
-		}
-
-	/* get mb_io_ptr */
-	mb_io_ptr = (struct mb_io_struct *)mbio_ptr;
-
-	/* set format info parameters */
-	status = mbr_info_swplssxp(verbose, &mb_io_ptr->system,
-		&mb_io_ptr->beams_bath_max,
-		&mb_io_ptr->beams_amp_max,
-		&mb_io_ptr->pixels_ss_max,
-		mb_io_ptr->format_name, mb_io_ptr->system_name,
-		mb_io_ptr->format_description,
-		&mb_io_ptr->numfile, &mb_io_ptr->filetype,
-		&mb_io_ptr->variable_beams,
-		&mb_io_ptr->traveltime,
-		&mb_io_ptr->beam_flagging,
-		&mb_io_ptr->nav_source,
-		&mb_io_ptr->heading_source,
-		&mb_io_ptr->vru_source, &mb_io_ptr->svp_source,
-		&mb_io_ptr->beamwidth_xtrack,
-		&mb_io_ptr->beamwidth_ltrack, error);
-
-	/* set format and system specific function pointers */
-	mb_io_ptr->mb_io_format_alloc = &mbr_alm_swplssxp;
-	mb_io_ptr->mb_io_format_free = &mbr_dem_swplssxp;
-	mb_io_ptr->mb_io_store_alloc = &mbsys_swathplus_alloc;
-	mb_io_ptr->mb_io_store_free = &mbsys_swathplus_deall;
-	mb_io_ptr->mb_io_read_ping = &mbr_rt_swplssxp;
-	mb_io_ptr->mb_io_write_ping = &mbr_wt_swplssxp;
-	mb_io_ptr->mb_io_dimensions = &mbsys_swathplus_dimensions;
-	mb_io_ptr->mb_io_pingnumber = &mbsys_swathplus_pingnumber;
-	mb_io_ptr->mb_io_sonartype = &mbsys_swathplus_sonartype;
-	mb_io_ptr->mb_io_sidescantype = &mbsys_swathplus_sidescantype;
-	mb_io_ptr->mb_io_extract = &mbsys_swathplus_extract;
-	mb_io_ptr->mb_io_insert = &mbsys_swathplus_insert;
-	mb_io_ptr->mb_io_extract_nav = &mbsys_swathplus_extract_nav;
-	mb_io_ptr->mb_io_extract_nnav = NULL;
-	mb_io_ptr->mb_io_insert_nav = &mbsys_swathplus_insert_nav;
-	mb_io_ptr->mb_io_extract_altitude = &mbsys_swathplus_extract_altitude;
-	mb_io_ptr->mb_io_insert_altitude = NULL;
-	mb_io_ptr->mb_io_extract_svp = NULL;
-	mb_io_ptr->mb_io_insert_svp = NULL;
-	mb_io_ptr->mb_io_ttimes = &mbsys_swathplus_ttimes;
-	mb_io_ptr->mb_io_detects = &mbsys_swathplus_detects;
-	mb_io_ptr->mb_io_gains = &mbsys_swathplus_gains;
-	mb_io_ptr->mb_io_copyrecord = &mbsys_swathplus_copy;
-	mb_io_ptr->mb_io_extract_rawss = NULL;
-	mb_io_ptr->mb_io_insert_rawss = NULL;
-	mb_io_ptr->mb_io_pulses = NULL;
-	mb_io_ptr->mb_io_extract_segytraceheader = NULL;
-	mb_io_ptr->mb_io_extract_segy = NULL;
-	mb_io_ptr->mb_io_insert_segy = NULL;
-	mb_io_ptr->mb_io_ctd = NULL;
-	mb_io_ptr->mb_io_ancilliarysensor = NULL;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		fprintf(stderr, "dbg2       system:             %d\n",
-			mb_io_ptr->system);
-		fprintf(stderr, "dbg2       beams_bath_max:     %d\n",
-			mb_io_ptr->beams_bath_max);
-		fprintf(stderr, "dbg2       beams_amp_max:      %d\n",
-			mb_io_ptr->beams_amp_max);
-		fprintf(stderr, "dbg2       pixels_ss_max:      %d\n",
-			mb_io_ptr->pixels_ss_max);
-		fprintf(stderr, "dbg2       format_name:        %s\n",
-			mb_io_ptr->format_name);
-		fprintf(stderr, "dbg2       system_name:        %s\n",
-			mb_io_ptr->system_name);
-		fprintf(stderr, "dbg2       format_description: %s\n",
-			mb_io_ptr->format_description);
-		fprintf(stderr, "dbg2       numfile:            %d\n",
-			mb_io_ptr->numfile);
-		fprintf(stderr, "dbg2       filetype:           %d\n",
-			mb_io_ptr->filetype);
-		fprintf(stderr, "dbg2       variable_beams:     %d\n",
-			mb_io_ptr->variable_beams);
-		fprintf(stderr, "dbg2       traveltime:         %d\n",
-			mb_io_ptr->traveltime);
-		fprintf(stderr, "dbg2       beam_flagging:      %d\n",
-			mb_io_ptr->beam_flagging);
-		fprintf(stderr, "dbg2       nav_source:         %d\n",
-			mb_io_ptr->nav_source);
-		fprintf(stderr, "dbg2       heading_source:     %d\n",
-			mb_io_ptr->heading_source);
-		fprintf(stderr, "dbg2       vru_source:         %d\n",
-			mb_io_ptr->vru_source);
-		fprintf(stderr, "dbg2       svp_source:         %d\n",
-			mb_io_ptr->svp_source);
-		fprintf(stderr, "dbg2       beamwidth_xtrack:   %f\n",
-			mb_io_ptr->beamwidth_xtrack);
-		fprintf(stderr, "dbg2       beamwidth_ltrack:   %f\n",
-			mb_io_ptr->beamwidth_ltrack);
-		fprintf(stderr, "dbg2       format_alloc:       %p\n",
-			mb_io_ptr->mb_io_format_alloc);
-		fprintf(stderr, "dbg2       format_free:        %p\n",
-			mb_io_ptr->mb_io_format_free);
-		fprintf(stderr, "dbg2       store_alloc:        %p\n",
-			mb_io_ptr->mb_io_store_alloc);
-		fprintf(stderr, "dbg2       store_free:         %p\n",
-			mb_io_ptr->mb_io_store_free);
-		fprintf(stderr, "dbg2       read_ping:          %p\n",
-			mb_io_ptr->mb_io_read_ping);
-		fprintf(stderr, "dbg2       write_ping:         %p\n",
-			mb_io_ptr->mb_io_write_ping);
-		fprintf(stderr, "dbg2       extract:            %p\n",
-			mb_io_ptr->mb_io_extract);
-		fprintf(stderr, "dbg2       insert:             %p\n",
-			mb_io_ptr->mb_io_insert);
-		fprintf(stderr, "dbg2       extract_nav:        %p\n",
-			mb_io_ptr->mb_io_extract_nav);
-		fprintf(stderr, "dbg2       insert_nav:         %p\n",
-			mb_io_ptr->mb_io_insert_nav);
-		fprintf(stderr, "dbg2       extract_altitude:   %p\n",
-			mb_io_ptr->mb_io_extract_altitude);
-		fprintf(stderr, "dbg2       insert_altitude:    %p\n",
-			mb_io_ptr->mb_io_insert_altitude);
-		fprintf(stderr, "dbg2       extract_svp:        %p\n",
-			mb_io_ptr->mb_io_extract_svp);
-		fprintf(stderr, "dbg2       insert_svp:         %p\n",
-			mb_io_ptr->mb_io_insert_svp);
-		fprintf(stderr, "dbg2       ttimes:             %p\n",
-			mb_io_ptr->mb_io_ttimes);
-		fprintf(stderr, "dbg2       detects:            %p\n",
-			mb_io_ptr->mb_io_detects);
-		fprintf(stderr, "dbg2       pulses:             %p\n",
-			mb_io_ptr->mb_io_pulses);
-		fprintf(stderr, "dbg2       extract_rawss:      %p\n",
-			mb_io_ptr->mb_io_extract_rawss);
-		fprintf(stderr, "dbg2       insert_rawss:       %p\n",
-			mb_io_ptr->mb_io_insert_rawss);
-		fprintf(stderr, "dbg2       extract_segytraceheader: %p\n",
-			mb_io_ptr->mb_io_extract_segytraceheader);
-		fprintf(stderr, "dbg2       extract_segy:       %p\n",
-			mb_io_ptr->mb_io_extract_segy);
-		fprintf(stderr, "dbg2       insert_segy:        %p\n",
-			mb_io_ptr->mb_io_insert_segy);
-		fprintf(stderr, "dbg2       copyrecord:         %p\n",
-			mb_io_ptr->mb_io_copyrecord);
-		fprintf(stderr, "dbg2       error:              %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2       status:         %d\n", status);
-		}
-
-	/* return status */
-	return (status);
-} /* mbr_register_swplssxp */
-/*--------------------------------------------------------------------*/
-int mbr_info_swplssxp(
-	int verbose, int *system, int *beams_bath_max, int *beams_amp_max,
-	int *pixels_ss_max, char *format_name, char *system_name,
-	char *format_description, int *numfile, int *filetype, int *variable_beams,
-	int *traveltime, int *beam_flagging, int *nav_source, int *heading_source,
-	int *vru_source, int *svp_source, double *beamwidth_xtrack,
-	double *beamwidth_ltrack, int *error)
-{
-	char *function_name = "mbr_info_swplssxp";
-	int status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> called\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n");
-		fprintf(stderr, "dbg2       verbose:    %d\n", verbose);
-		}
-
-	/* set format info parameters */
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-	*system = MB_SYS_SWATHPLUS;
-	*beams_bath_max = SWPLS_MAX_BEAMS;
-	*beams_amp_max = SWPLS_MAX_BEAMS;
-	*pixels_ss_max = SWPLS_MAX_PIXELS;
-	strncpy(format_name, "SWPLSSXP", MB_NAME_LENGTH);
-	strncpy(system_name, "SWATHPLUS", MB_NAME_LENGTH);
-	strncpy(format_description,
-		"Format name:          MBF_SWPLSSXP\nInformal Description: SEA interferometric sonar vendor processed data format\n"
-		"Attributes:           SEA SWATHplus,\n"
-		"                      bathymetry and amplitude,\n"
-		"                      variable beams, binary, SEA.\n",
-		MB_DESCRIPTION_LENGTH);
-	*numfile = 1;
-	*filetype = MB_FILETYPE_SINGLE;
-	*variable_beams = MB_YES;
-	*traveltime = MB_YES;
-	*beam_flagging = MB_YES;
-	*nav_source = MB_DATA_DATA;
-	*heading_source = MB_DATA_DATA;
-	*vru_source = MB_DATA_DATA;
-	*svp_source = MB_DATA_NONE;
-	*beamwidth_xtrack = SWPLS_TYPE_M_BEAM_WIDTH;
-	*beamwidth_ltrack = SWPLS_TYPE_M_BEAM_WIDTH;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		fprintf(stderr, "dbg2       system:             %d\n", *system);
-		fprintf(stderr, "dbg2       beams_bath_max:     %d\n", *beams_bath_max);
-		fprintf(stderr, "dbg2       beams_amp_max:      %d\n", *beams_amp_max);
-		fprintf(stderr, "dbg2       pixels_ss_max:      %d\n", *pixels_ss_max);
-		fprintf(stderr, "dbg2       format_name:        %s\n", format_name);
-		fprintf(stderr, "dbg2       system_name:        %s\n", system_name);
-		fprintf(stderr, "dbg2       format_description: %s\n",
-			format_description);
-		fprintf(stderr, "dbg2       numfile:            %d\n", *numfile);
-		fprintf(stderr, "dbg2       filetype:           %d\n", *filetype);
-		fprintf(stderr, "dbg2       variable_beams:     %d\n", *variable_beams);
-		fprintf(stderr, "dbg2       traveltime:         %d\n", *traveltime);
-		fprintf(stderr, "dbg2       beam_flagging:      %d\n", *beam_flagging);
-		fprintf(stderr, "dbg2       nav_source:         %d\n", *nav_source);
-		fprintf(stderr, "dbg2       heading_source:     %d\n", *heading_source);
-		fprintf(stderr, "dbg2       vru_source:         %d\n", *vru_source);
-		fprintf(stderr, "dbg2       svp_source:         %d\n", *svp_source);
-		fprintf(stderr, "dbg2       beamwidth_xtrack:   %f\n",
-			*beamwidth_xtrack);
-		fprintf(stderr, "dbg2       beamwidth_ltrack:   %f\n",
-			*beamwidth_ltrack);
-		fprintf(stderr, "dbg2       error:              %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2       status:         %d\n", status);
-		}
-
-	/* return status */
-	return (status);
-} /* mbr_info_swplssxp */
-/*--------------------------------------------------------------------*/
-int mbr_alm_swplssxp(int verbose, void *mbio_ptr, int *error)
-{
-	char *function_name = "mbr_alm_swplssxp";
-	int status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	int *recordid;
-	int *recordidlast;
-	char **bufferptr;
-	char *buffer;
-	int *bufferalloc;
-	int *size;
-	int *nbadrec;
-	int *header_rec_written;
-	int *projection_rec_written;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> called\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n");
-		fprintf(stderr, "dbg2       verbose:    %d\n", verbose);
-		fprintf(stderr, "dbg2       mbio_ptr:   %p\n", mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *)mbio_ptr;
-
-	/* set initial status */
-	status = MB_SUCCESS;
-
-	/* allocate memory for data structure */
-	mb_io_ptr->structure_size = 0;
-	mb_io_ptr->data_structure_size = 0;
-	status = mbsys_swathplus_alloc(verbose, mbio_ptr, &mb_io_ptr->store_data,
-		error);
-	recordid = (int *)&mb_io_ptr->save3;
-	recordidlast = (int *)&mb_io_ptr->save4;
-	bufferptr = (char **)&mb_io_ptr->saveptr1;
-	buffer = (char *)*bufferptr;
-	bufferalloc = (int *)&mb_io_ptr->save6;
-	size = (int *)&mb_io_ptr->save8;
-	nbadrec = (int *)&mb_io_ptr->save9;
-	header_rec_written = (int *)&(mb_io_ptr->save1);
-	projection_rec_written = (int *)&(mb_io_ptr->save2);
-
-	*recordid = SWPLS_ID_NONE;
-	*recordidlast = SWPLS_ID_NONE;
-	*bufferptr = NULL;
-	*bufferalloc = 0;
-	*size = 0;
-	*nbadrec = 0;
-	*header_rec_written = MB_NO;
-	*projection_rec_written = MB_NO;
-	
-	/* allocate memory if necessary */
-	if (status == MB_SUCCESS)
-		{
-		status = mb_reallocd(verbose, __FILE__, __LINE__,
-			SWPLS_BUFFER_STARTSIZE, (void **)bufferptr, error);
-		if (status == MB_SUCCESS)
-			{
-			*bufferalloc = SWPLS_BUFFER_STARTSIZE;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		fprintf(stderr, "dbg2       error:      %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2       status:  %d\n", status);
-		}
-
-	/* return status */
-	return (status);
-} /* mbr_alm_swplssxp */
-/*--------------------------------------------------------------------*/
-int mbr_dem_swplssxp(int verbose, void *mbio_ptr, int *error)
-{
-	char *function_name = "mbr_dem_swplssxp";
-	int status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	char **bufferptr;
-	char *buffer;
-	int *bufferalloc;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> called\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n");
-		fprintf(stderr, "dbg2       verbose:    %d\n", verbose);
-		fprintf(stderr, "dbg2       mbio_ptr:   %p\n", mbio_ptr);
-		}
-
-	/* get pointers to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *)mbio_ptr;
-
-	/* deallocate memory for data descriptor */
-	status = mbsys_swathplus_deall(verbose, mbio_ptr, &mb_io_ptr->store_data,
-		error);
-
-	/* deallocate memory for reading/writing buffer */
-	bufferptr = (char **)&mb_io_ptr->saveptr1;
-	buffer = (char *)*bufferptr;
-	bufferalloc = (int *)&mb_io_ptr->save6;
-	status = mb_freed(verbose, __FILE__, __LINE__, (void **)bufferptr, error);
-	*bufferalloc = 0;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		fprintf(stderr, "dbg2       error:   %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2       status:  %d\n", status);
-		}
-
-	/* return status */
-	return (status);
-} /* mbr_dem_swplssxp */
-/*--------------------------------------------------------------------*/
-int mbr_rt_swplssxp(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char *function_name = "mbr_rt_swplssxp";
-	int status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_swathplus_struct *store;
-	swpls_header *header;
-	swpls_sxpping *ping;
-	swpls_comment *comment;
-	swpls_projection *projection;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> called\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n");
-		fprintf(stderr, "dbg2       verbose:    %d\n", verbose);
-		fprintf(stderr, "dbg2       mbio_ptr:   %p\n", mbio_ptr);
-		fprintf(stderr, "dbg2       store_ptr:  %p\n", store_ptr);
-		}
-
-	/* get pointers to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *)mbio_ptr;
-
-	/* read next data from file */
-	status = mbr_swplssxp_rd_data(verbose, mbio_ptr, store_ptr, error);
-
-	/* get pointer to data structure */
-	store = (struct mbsys_swathplus_struct *)store_ptr;
-	header = &store->sxp_header;
-	ping = &store->sxp_ping;
-	comment = &store->comment;
-	projection = &store->projection;
-
-	/* check if projection has been set from *.prj file, if so, copy into projection structure */
-	if ((store->projection_set == MB_NO) &&
-		(mb_io_ptr->projection_initialized == MB_YES))
-		{
-		projection->time_d = time(NULL);
-		projection->microsec = 0;
-		projection->nchars = strnlen(mb_io_ptr->projection_id, MB_NAME_LENGTH);
-		if (projection->projection_alloc < projection->nchars)
-			{
-			status = mb_reallocd(verbose, __FILE__, __LINE__,
-				(size_t)projection->nchars,
-				(void **)&(projection->projection_id), error);
-			if (status != MB_SUCCESS)
-				{
-				projection->projection_alloc = 0;
-				}
-			else
-				{
-				projection->projection_alloc = projection->nchars;
-				}
-			}
-			
-		if (status == MB_SUCCESS)
-			{
-			strncpy(projection->projection_id, mb_io_ptr->projection_id, 
-				(size_t)projection->nchars);
-			store->projection_set = MB_YES;
-			}		
-		}
-	/* check if projection has been read from *mb222 file, if so, tell mb system */
-	else if ((store->projection_set == MB_YES) &&
-		(mb_io_ptr->projection_initialized == MB_NO))
-		{
-		mb_proj_init(verbose, projection->projection_id, &(mb_io_ptr->pjptr), error);
-		strncpy(mb_io_ptr->projection_id, projection->projection_id, MB_NAME_LENGTH);
-		mb_io_ptr->projection_initialized = MB_YES;
-		}
-
-	/* throw away data if the time stamp makes no sense */
-	if ((status == MB_SUCCESS) && (store->kind == MB_DATA_DATA) &&
-		(store->time_i[0] < 2003))
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_UNINTELLIGIBLE;
-		}
-
-	/* save fix data, used to calculate vessel speed */
-	if ((status == MB_SUCCESS) && (store->kind == MB_DATA_DATA))
-		{
-		/* add latest fix */
-		mb_navint_add(verbose, mbio_ptr, store->time_d, store->sxp_ping.txer_e,
-			store->sxp_ping.txer_n, error);
-		}
-
-	/* set error and kind in mb_io_ptr */
-	mb_io_ptr->new_error = *error;
-	mb_io_ptr->new_kind = store->kind;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		fprintf(stderr, "dbg2       error:      %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2       status:  %d\n", status);
-		}
-
-	/* return status */
-	return (status);
-} /* mbr_rt_swplssxp */
-/*--------------------------------------------------------------------*/
-int mbr_wt_swplssxp(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char *function_name = "mbr_wt_swplssxp";
-	int status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_swathplus_struct *store;
-	int *header_rec_written;
-	int *projection_rec_written;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> called\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n");
-		fprintf(stderr, "dbg2       verbose:    %d\n", verbose);
-		fprintf(stderr, "dbg2       mbio_ptr:   %p\n", mbio_ptr);
-		fprintf(stderr, "dbg2       store_ptr:  %p\n", store_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *)mbio_ptr;
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_swathplus_struct *)store_ptr;
-
-	/* get pointers to saved data */
-	header_rec_written = &(mb_io_ptr->save1);
-	projection_rec_written = &(mb_io_ptr->save2);
-	
-	/* write header record if needed (just once, here at top of file) */
-	if ((store->sxp_header_set == MB_YES) &&
-		(*header_rec_written == MB_NO))
-		{
-		int origkind = store->kind;
-		int origtype = store->type;
-		store->kind = MB_DATA_HEADER;
-		store->type = SWPLS_ID_SXP_HEADER_DATA;
-		status = swpls_wr_data(verbose, mbio_ptr, store_ptr, error);
-		if (status == MB_SUCCESS)
-			{
-			*header_rec_written = MB_YES;
-			}
-		store->kind = origkind;
-		store->type = origtype;
-		}
-
-	/* write projection record if needed (just once, here at top of file) */
-	if ((store->projection_set == MB_YES) &&
-		(*projection_rec_written == MB_NO))
-		{
-		int origkind = store->kind;
-		int origtype = store->type;
-		store->kind = MB_DATA_PARAMETER;
-		store->type = SWPLS_ID_PROJECTION;
-		status = swpls_wr_data(verbose, mbio_ptr, store_ptr, error);
-		if (status == MB_SUCCESS)
-			{
-			*projection_rec_written = MB_YES;
-			}
-		store->kind = origkind;
-		store->type = origtype;
-		}
-
-	/* write the record to file EXCEPT headers and projections */
-	if ((store->type != SWPLS_ID_SXP_HEADER_DATA) &&
-		(store->type != SWPLS_ID_PROJECTION))
-		{
-		status = swpls_wr_data(verbose, mbio_ptr, store_ptr, error);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		fprintf(stderr, "dbg2       error:      %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2       status:  %d\n", status);
-		}
-
-	/* return status */
-	return (status);
-} /* mbr_wt_swplssxp */
-/*--------------------------------------------------------------------*/
-int mbr_swplssxp_rd_data(int verbose, void *mbio_ptr, void *store_ptr,
-	int *error)
-{
-	char *function_name = "mbr_swplssxp_rd_data";
-	int status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_swathplus_struct *store;
-	char **bufferptr;
-	char *buffer;
-	int *bufferalloc;
-	int *recordid;
-	int *recordidlast;
-	int *size;
-	int *nbadrec;
-	int done;
-	size_t read_len;
-	int skip;
-	int i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> called\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n");
-		fprintf(stderr, "dbg2       verbose:    %d\n", verbose);
-		fprintf(stderr, "dbg2       mbio_ptr:   %p\n", mbio_ptr);
-		fprintf(stderr, "dbg2       store_ptr:  %p\n", store_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *)mbio_ptr;
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_swathplus_struct *)store_ptr;
-
-	/* get saved values */
-	recordid = (int *)&mb_io_ptr->save3;
-	recordidlast = (int *)&mb_io_ptr->save4;
-	bufferptr = (char **)&mb_io_ptr->saveptr1;
-	buffer = (char *)*bufferptr;
-	bufferalloc = (int *)&mb_io_ptr->save6;
-	size = (int *)&mb_io_ptr->save8;
-	nbadrec = (int *)&mb_io_ptr->save9;
-
-	/* set file position */
-	mb_io_ptr->file_pos = mb_io_ptr->file_bytes;
-
-	/* loop over reading data until a record is ready for return */
-	done = MB_NO;
-	*error = MB_ERROR_NO_ERROR;
-	while (done == MB_NO)
-		{
-		/* read next record header into buffer */
-		read_len = (size_t)SWPLS_SIZE_BLOCKHEADER;
-		status = mb_fileio_get(verbose, mbio_ptr, buffer, &read_len, error);
-
-		/* check header - if not a good header read a byte
-		    at a time until a good header is found */
-		skip = 0;
-		while (status == MB_SUCCESS &&
-			swpls_chk_header(verbose, mbio_ptr, buffer, recordid, size,
-			error) != MB_SUCCESS)
-			{
-			/* get next byte */
-			for (i = 0; i < SWPLS_SIZE_BLOCKHEADER - 1; i++)
-				{
-				buffer[i] = buffer[i + 1];
-				}
-			read_len = (size_t)1;
-			status =
-				mb_fileio_get(verbose, mbio_ptr,
-				&buffer[SWPLS_SIZE_BLOCKHEADER - 1], &read_len, error);
-			skip++;
-			}
-
-		/* report problem */
-		if ((skip > 0) && (verbose >= 0))
-			{
-			if (*nbadrec == 0)
-				{
-				fprintf(stderr,
-					"The MBR_SWPLSSXP module skipped data between identified\n" 
-					"data records. Something is broken, most probably the data...\n" 
-					"However, the data may include a data record type that we\n" 
-					"haven't seen yet, or there could be an error in the code.\n" 
-					"If skipped data are reported multiple times, \n" 
-					"we recommend you send a data sample and problem \n" 
-					"description to the MB-System team \n" 
-					"(caress at mbari.org and dale at ldeo.columbia.edu)\n"																										"Have a nice day...\n");
-				}
-			fprintf(stderr,
-				"MBR_SWPLSSXP skipped %d bytes between records %4.4X:%d and %4.4X:%d\n", 
-				skip, *recordidlast, *recordidlast, *recordid, *recordid);
-			(*nbadrec)++;
-			}
-
-		*recordidlast = *recordid;
-		store->type = *recordid;
-
-		/* allocate memory to read rest of record if necessary */
-		if (*bufferalloc < *size + SWPLS_SIZE_BLOCKHEADER)
-			{
-			status = mb_reallocd(verbose, __FILE__, __LINE__,
-				*size + SWPLS_SIZE_BLOCKHEADER,
-				(void **)bufferptr, error);
-			if (status != MB_SUCCESS)
-				{
-				*bufferalloc = 0;
-				done = MB_YES;
-				}
-			else
-				{
-				*bufferalloc = *size + SWPLS_SIZE_BLOCKHEADER;
-				buffer = (char *)*bufferptr;
-				}
-			}
-
-		/* read the rest of the record */
-		if (status == MB_SUCCESS)
-			{
-			read_len = (size_t)*size;
-			status =
-				mb_fileio_get(verbose, mbio_ptr,
-				&buffer[SWPLS_SIZE_BLOCKHEADER], &read_len,
-				error);
-			}
-
-		/* parse the data record */
-		if ((status == MB_SUCCESS) && (done == MB_NO))
-			{
-			if (*recordid == SWPLS_ID_SXP_HEADER_DATA)
-				{
-				status = swpls_rd_sxpheader(verbose, buffer, store_ptr, error);
-				done = MB_YES;
-				}
-			else if (*recordid == SWPLS_ID_PROCESSED_PING)
-				{
-				status = swpls_rd_sxpping(verbose, buffer, store_ptr,
-					SWPLS_ID_PROCESSED_PING, error);
-				done = MB_YES;
-				}
-			else if (*recordid == SWPLS_ID_PROCESSED_PING2)
-				{
-				status = swpls_rd_sxpping(verbose, buffer, store_ptr,
-					SWPLS_ID_PROCESSED_PING2, error);
-				done = MB_YES;
-				}
-			else if (*recordid == SWPLS_ID_COMMENT)
-				{
-				status = swpls_rd_comment(verbose, buffer, store_ptr, error);
-				done = MB_YES;
-				}
-			else if (*recordid == SWPLS_ID_PROJECTION)
-				{
-				status = swpls_rd_projection(verbose, buffer, store_ptr, error);
-				done = MB_YES;
-				}
-			else
-				{
-				done = MB_NO;
-				}
-			}
-
-		if (status == MB_FAILURE)
-			{
-			done = MB_YES;
-			}
-		}
-
-	/* get file position */
-	mb_io_ptr->file_bytes = ftell(mb_io_ptr->mbfp);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		fprintf(stderr, "dbg2       error:      %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2       status:  %d\n", status);
-		}
-
-	/* return status */
-	return (status);
-} /* mbr_swplssxp_rd_data */
-
diff --git a/src/mbio/mbr_tempform.c b/src/mbio/mbr_tempform.c
deleted file mode 100644
index ad8304f..0000000
--- a/src/mbio/mbr_tempform.c
+++ /dev/null
@@ -1,671 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbr_tempform.c	1/27/2014
- *	$Id: mbr_tempform.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 2014-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbr_tempform.c contains the functions for reading and writing
- * multibeam data in the TEMPFORM format.
- * These functions include:
- *   mbr_alm_tempform	- allocate read/write memory
- *   mbr_dem_tempform	- deallocate read/write memory
- *   mbr_rt_tempform	- read and translate data
- *   mbr_wt_tempform	- translate and write data
- *
- * Author:	D. W. Caress
- * Date:	January 27, 2014
- * $Log: mbr_tempform.c,v $
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mb_define.h"
-#include "mbsys_templatesystem.h"
-
-/* include for byte swapping */
-#include "mb_swap.h"
-
-/* turn on debug statements here */
-/* #define MBR_TEMPFORM_DEBUG 1 */
-
-/* essential function prototypes */
-int mbr_register_tempform(int verbose, void *mbio_ptr,
-		int *error);
-int mbr_info_tempform(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_alm_tempform(int verbose, void *mbio_ptr, int *error);
-int mbr_dem_tempform(int verbose, void *mbio_ptr, int *error);
-int mbr_rt_tempform(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_wt_tempform(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_tempform_rd_data(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_tempform_wr_data(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-
-static char rcs_id[]="$Id: mbr_tempform.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mbr_register_tempform(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_register_tempform";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* get mb_io_ptr */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set format info parameters */
-	status = mbr_info_tempform(verbose,
-			&mb_io_ptr->system,
-			&mb_io_ptr->beams_bath_max,
-			&mb_io_ptr->beams_amp_max,
-			&mb_io_ptr->pixels_ss_max,
-			mb_io_ptr->format_name,
-			mb_io_ptr->system_name,
-			mb_io_ptr->format_description,
-			&mb_io_ptr->numfile,
-			&mb_io_ptr->filetype,
-			&mb_io_ptr->variable_beams,
-			&mb_io_ptr->traveltime,
-			&mb_io_ptr->beam_flagging,
-			&mb_io_ptr->nav_source,
-			&mb_io_ptr->heading_source,
-			&mb_io_ptr->vru_source,
-			&mb_io_ptr->svp_source,
-			&mb_io_ptr->beamwidth_xtrack,
-			&mb_io_ptr->beamwidth_ltrack,
-			error);
-
-	/* set format and system specific function pointers */
-	mb_io_ptr->mb_io_format_alloc = &mbr_alm_tempform;
-	mb_io_ptr->mb_io_format_free = &mbr_dem_tempform;
-	mb_io_ptr->mb_io_store_alloc = &mbsys_templatesystem_alloc;
-	mb_io_ptr->mb_io_store_free = &mbsys_templatesystem_deall;
-	mb_io_ptr->mb_io_read_ping = &mbr_rt_tempform;
-	mb_io_ptr->mb_io_write_ping = &mbr_wt_tempform;
-	mb_io_ptr->mb_io_dimensions = &mbsys_templatesystem_dimensions;
-	mb_io_ptr->mb_io_pingnumber = &mbsys_templatesystem_pingnumber;
-	mb_io_ptr->mb_io_sonartype = &mbsys_templatesystem_sonartype;
-	mb_io_ptr->mb_io_sidescantype = &mbsys_templatesystem_sidescantype;
-	mb_io_ptr->mb_io_extract = &mbsys_templatesystem_extract;
-	mb_io_ptr->mb_io_insert = &mbsys_templatesystem_insert;
-	mb_io_ptr->mb_io_extract_nav = &mbsys_templatesystem_extract_nav;
-	mb_io_ptr->mb_io_extract_nnav = &mbsys_templatesystem_extract_nnav;
-	mb_io_ptr->mb_io_insert_nav = &mbsys_templatesystem_insert_nav;
-	mb_io_ptr->mb_io_extract_altitude = &mbsys_templatesystem_extract_altitude;
-	mb_io_ptr->mb_io_insert_altitude = NULL;
-	mb_io_ptr->mb_io_extract_svp = &mbsys_templatesystem_extract_svp;
-	mb_io_ptr->mb_io_insert_svp = &mbsys_templatesystem_insert_svp;
-	mb_io_ptr->mb_io_ttimes = &mbsys_templatesystem_ttimes;
-	mb_io_ptr->mb_io_detects = &mbsys_templatesystem_detects;
-	mb_io_ptr->mb_io_gains = &mbsys_templatesystem_gains;
-	mb_io_ptr->mb_io_copyrecord = &mbsys_templatesystem_copy;
-	mb_io_ptr->mb_io_extract_rawss = NULL;
-	mb_io_ptr->mb_io_insert_rawss = NULL;
-	mb_io_ptr->mb_io_extract_segytraceheader = NULL;
-	mb_io_ptr->mb_io_extract_segy = NULL;
-	mb_io_ptr->mb_io_insert_segy = NULL;
-	mb_io_ptr->mb_io_ctd = NULL;
-	mb_io_ptr->mb_io_ancilliarysensor = NULL;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",mb_io_ptr->system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",mb_io_ptr->beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",mb_io_ptr->beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",mb_io_ptr->pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",mb_io_ptr->format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",mb_io_ptr->system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",mb_io_ptr->format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",mb_io_ptr->numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",mb_io_ptr->filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",mb_io_ptr->variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",mb_io_ptr->traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",mb_io_ptr->beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",mb_io_ptr->nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",mb_io_ptr->heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",mb_io_ptr->vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",mb_io_ptr->svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",mb_io_ptr->beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",mb_io_ptr->beamwidth_ltrack);
-		fprintf(stderr,"dbg2       format_alloc:       %p\n",(void *)mb_io_ptr->mb_io_format_alloc);
-		fprintf(stderr,"dbg2       format_free:        %p\n",(void *)mb_io_ptr->mb_io_format_free);
-		fprintf(stderr,"dbg2       store_alloc:        %p\n",(void *)mb_io_ptr->mb_io_store_alloc);
-		fprintf(stderr,"dbg2       store_free:         %p\n",(void *)mb_io_ptr->mb_io_store_free);
-		fprintf(stderr,"dbg2       read_ping:          %p\n",(void *)mb_io_ptr->mb_io_read_ping);
-		fprintf(stderr,"dbg2       write_ping:         %p\n",(void *)mb_io_ptr->mb_io_write_ping);
-		fprintf(stderr,"dbg2       extract:            %p\n",(void *)mb_io_ptr->mb_io_extract);
-		fprintf(stderr,"dbg2       insert:             %p\n",(void *)mb_io_ptr->mb_io_insert);
-		fprintf(stderr,"dbg2       extract_nav:        %p\n",(void *)mb_io_ptr->mb_io_extract_nav);
-		fprintf(stderr,"dbg2       insert_nav:         %p\n",(void *)mb_io_ptr->mb_io_insert_nav);
-		fprintf(stderr,"dbg2       extract_altitude:   %p\n",(void *)mb_io_ptr->mb_io_extract_altitude);
-		fprintf(stderr,"dbg2       insert_altitude:    %p\n",(void *)mb_io_ptr->mb_io_insert_altitude);
-		fprintf(stderr,"dbg2       extract_svp:        %p\n",(void *)mb_io_ptr->mb_io_extract_svp);
-		fprintf(stderr,"dbg2       insert_svp:         %p\n",(void *)mb_io_ptr->mb_io_insert_svp);
-		fprintf(stderr,"dbg2       ttimes:             %p\n",(void *)mb_io_ptr->mb_io_ttimes);
-		fprintf(stderr,"dbg2       detects:            %p\n",(void *)mb_io_ptr->mb_io_detects);
-		fprintf(stderr,"dbg2       extract_rawss:      %p\n",(void *)mb_io_ptr->mb_io_extract_rawss);
-		fprintf(stderr,"dbg2       insert_rawss:       %p\n",(void *)mb_io_ptr->mb_io_insert_rawss);
-		fprintf(stderr,"dbg2       extract_segytraceheader: %p\n",(void *)mb_io_ptr->mb_io_extract_segytraceheader);
-		fprintf(stderr,"dbg2       extract_segy:       %p\n",(void *)mb_io_ptr->mb_io_extract_segy);
-		fprintf(stderr,"dbg2       insert_segy:        %p\n",(void *)mb_io_ptr->mb_io_insert_segy);
-		fprintf(stderr,"dbg2       copyrecord:         %p\n",(void *)mb_io_ptr->mb_io_copyrecord);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbr_info_tempform(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error)
-{
-	char	*function_name = "mbr_info_tempform";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* set format info parameters */
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-	*system = MB_SYS_TEMPLATESYSTEM;
-	*beams_bath_max = MBSYS_TEMPLATESYSTEM_MAX_BEAMS;
-	*beams_amp_max = MBSYS_TEMPLATESYSTEM_MAX_BEAMS;
-	*pixels_ss_max = MBSYS_TEMPLATESYSTEM_MAX_PIXELS;
-	strncpy(format_name, "TEMPFORM", MB_NAME_LENGTH);
-	strncpy(system_name, "TEMPLATESYSTEM", MB_NAME_LENGTH);
-	strncpy(format_description, "Format name:          MBF_TEMPFORM\nInformal Description: Example format\nAttributes:           Name the relevant sensor(s), \n                      what data types are supported\n                      how many beams and pixels, file type (ascii, binary, netCDF), Organization that defined this format.\n", MB_DESCRIPTION_LENGTH);
-	*numfile = 1;
-	*filetype = MB_FILETYPE_SINGLE;
-	*variable_beams = MB_YES;
-	*traveltime = MB_YES;
-	*beam_flagging = MB_YES;
-	*nav_source = MB_DATA_DATA;
-	*heading_source = MB_DATA_DATA;
-	*vru_source = MB_DATA_DATA;
-	*svp_source = MB_DATA_VELOCITY_PROFILE;
-	*beamwidth_xtrack = 1.0;
-	*beamwidth_ltrack = 1.0;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",*system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",*beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",*beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",*pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",*numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",*filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",*variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",*traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",*beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",*nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",*heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",*vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",*svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",*beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",*beamwidth_ltrack);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_alm_tempform(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_alm_tempform";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set initial status */
-	status = MB_SUCCESS;
-
-	/* allocate memory for data structure */
-	mb_io_ptr->structure_size = 0;
-	mb_io_ptr->data_structure_size = 0;
-	status = mbsys_templatesystem_alloc(
-			verbose,mbio_ptr,
-			&mb_io_ptr->store_data,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_dem_tempform(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_dem_tempform";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointers to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* deallocate memory for data descriptor */
-	status = mbsys_templatesystem_deall(
-			verbose,mbio_ptr,
-			&mb_io_ptr->store_data,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_rt_tempform(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_rt_tempform";
-	int	status = MB_SUCCESS;
-	int	interp_status;
-	int	interp_error = MB_ERROR_NO_ERROR;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_templatesystem_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointers to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-#ifdef MBR_TEMPFORM_DEBUG
-	fprintf(stderr,"About to call mbr_tempform_rd_data...\n");
-#endif
-
-	/* read next data from file */
-	status = mbr_tempform_rd_data(verbose,mbio_ptr,store_ptr,error);
-
-	/* get pointers to data structures */
-	store = (struct mbsys_templatesystem_struct *) store_ptr;
-
-	/* set error and kind in mb_io_ptr */
-	mb_io_ptr->new_error = *error;
-	mb_io_ptr->new_kind = store->kind;
-
-#ifdef MBR_TEMPFORM_DEBUG
-	fprintf(stderr,"Done with mbr_tempform_rd_data: status:%d error:%d record kind:%d\n", status, *error, store->kind);
-#endif
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_wt_tempform(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_wt_tempform";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_templatesystem_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_templatesystem_struct *) store_ptr;
-
-#ifdef MBR_TEMPFORM_DEBUG
-	fprintf(stderr,"About to call mbr_tempform_wr_data record kind:%d\n", store->kind);
-#endif
-
-	/* write next data to file */
-	status = mbr_tempform_wr_data(verbose,mbio_ptr,store_ptr,error);
-
-#ifdef MBR_TEMPFORM_DEBUG
-	fprintf(stderr,"Done with mbr_tempform_wr_data: status:%d error:%d\n", status, *error);
-#endif
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_tempform_rd_data(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_tempform_rd_data";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_templatesystem_struct *store;
-	int	read_kind;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_templatesystem_struct *) store_ptr;
-	mbfp = mb_io_ptr->mbfp;
-
-	/* set file position */
-	mb_io_ptr->file_pos = mb_io_ptr->file_bytes;
-
-	/* loop over reading data until a record is ready for return */
-	done = MB_NO;
-	*error = MB_ERROR_NO_ERROR;
-	while (done == MB_NO)
-		{
-		/* read the next record header - set read_kind value */
-		
-		/* if valid read the record type */
-		if (status == MB_SUCCESS)
-			{
-	
-			/* read survey data */
-			if (read_kind == MB_DATA_DATA)
-				{
-				
-				store->kind = MB_DATA_DATA;
-				}
-				
-			/* read asynchronous navigation data */
-			else if (read_kind == MB_DATA_NAV)
-				{
-					
-				store->kind = MB_DATA_NAV;
-				}
-				
-			/* read asynchronous sensordepth data */
-			else if (read_kind == MB_DATA_SONARDEPTH)
-				{
-					
-				store->kind = MB_DATA_SONARDEPTH;
-				}
-				
-			/* read asynchronous attitude data */
-			else if (read_kind == MB_DATA_ATTITUDE)
-				{
-					
-				store->kind = MB_DATA_ATTITUDE;
-				}
-				
-			/* read comment */
-			else if (read_kind == MB_DATA_COMMENT)
-				{
-					
-				store->kind = MB_DATA_COMMENT;
-				}
-				
-			/* done if read success or EOF */
-			if (status == MB_SUCCESS)
-				{
-				done = MB_YES;
-				}
-			else if (*error == MB_ERROR_EOF)
-				{
-				done = MB_YES;
-				}
-			}
-
-		/* set done if read failure */
-		else
-			{
-			done = MB_YES;
-			}
-		}
-
-	/* get file position */
-	if (*save_flag == MB_YES)
-		mb_io_ptr->file_bytes = ftell(mbfp) - *size;
-	else
-		mb_io_ptr->file_bytes = ftell(mbfp);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_tempform_wr_data(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_tempform_wr_data";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_templatesystem_struct *store;
-	FILE	*mbfp;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_templatesystem_struct *) store_ptr;
-	mbfp = mb_io_ptr->mbfp;
-
-	/* write fileheader if needed (not all formats have distinct fileheaders) */
-
-	/* write the current data record type */
-	
-	/* write survey data */
-	if (store->kind == MB_DATA_DATA)
-		{
-		}
-		
-	/* write asynchronous navigation data */
-	else if (store->kind == MB_DATA_NAV)
-		{
-		}
-		
-	/* write asynchronous sensordepth data */
-	else if (store->kind == MB_DATA_SONARDEPTH)
-		{
-		}
-		
-	/* write asynchronous attitude data */
-	else if (store->kind == MB_DATA_ATTITUDE)
-		{
-		}
-		
-	/* write asynchronous attitude data */
-	else if (store->kind == MB_DATA_ATTITUDE)
-		{
-		}
-		
-	/* write comment */
-	else if (store->kind == MB_DATA_COMMENT)
-		{
-		}
-
-#ifdef MBR_TEMPFORM_DEBUG
-	fprintf(stderr,"TEMPFORM DATA WRITTEN: type:%d status:%d error:%d\n\n",
-	store->kind, status, *error);
-#endif
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mbr_wasspenl.c b/src/mbio/mbr_wasspenl.c
deleted file mode 100644
index f4198fe..0000000
--- a/src/mbio/mbr_wasspenl.c
+++ /dev/null
@@ -1,3152 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbr_wasspenl.c	1/27/2014
- *	$Id: mbr_wasspenl.c 2239 2015-05-07 00:51:42Z caress $
- *
- *    Copyright (c) 2014-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbr_wasspenl.c contains the functions for reading and writing
- * multibeam data in the WASSPENL format.
- * These functions include:
- *   mbr_alm_wasspenl	- allocate read/write memory
- *   mbr_dem_wasspenl	- deallocate read/write memory
- *   mbr_rt_wasspenl	- read and translate data
- *   mbr_wt_wasspenl	- translate and write data
- *
- * Author:	D. W. Caress
- * Date:	January 27, 2014
- * $Log: mbr_wasspenl.c,v $
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mb_define.h"
-#include "mbsys_wassp.h"
-
-/* include for byte swapping */
-#include "mb_swap.h"
-
-/* turn on debug statements here */
-/* #define MBR_WASSPENLDEBUG 1 */
-
-/* essential function prototypes */
-int mbr_register_wasspenl(int verbose, void *mbio_ptr,
-		int *error);
-int mbr_info_wasspenl(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_alm_wasspenl(int verbose, void *mbio_ptr, int *error);
-int mbr_dem_wasspenl(int verbose, void *mbio_ptr, int *error);
-int mbr_rt_wasspenl(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_wt_wasspenl(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_wasspenl_rd_data(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_wasspenl_wr_data(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_wasspenl_rd_genbathy(int verbose, char *buffer, void *store_ptr, int *error);
-int mbr_wasspenl_rd_corbathy(int verbose, char *buffer, void *store_ptr, int *error);
-int mbr_wasspenl_rd_rawsonar(int verbose, char *buffer, void *store_ptr, int *error);
-int mbr_wasspenl_rd_gen_sens(int verbose, char *buffer, void *store_ptr, int *error);
-int mbr_wasspenl_rd_nvupdate(int verbose, char *buffer, void *store_ptr, int *error);
-int mbr_wasspenl_rd_wcd_navi(int verbose, char *buffer, void *store_ptr, int *error);
-int mbr_wasspenl_rd_sensprop(int verbose, char *buffer, void *store_ptr, int *error);
-int mbr_wasspenl_rd_sys_prop(int verbose, char *buffer, void *store_ptr, int *error);
-int mbr_wasspenl_rd_sys_cfg1(int verbose, char *buffer, void *store_ptr, int *error);
-int mbr_wasspenl_rd_mcomment(int verbose, char *buffer, void *store_ptr, int *error);
-int mbr_wasspenl_rd_unknown1(int verbose, char *buffer, void *store_ptr, int *error);
-int mbr_wasspenl_wr_genbathy(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error);
-int mbr_wasspenl_wr_corbathy(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error);
-int mbr_wasspenl_wr_rawsonar(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error);
-int mbr_wasspenl_wr_gen_sens(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error);
-int mbr_wasspenl_wr_nvupdate(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error);
-int mbr_wasspenl_wr_wcd_navi(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error);
-int mbr_wasspenl_wr_sensprop(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error);
-int mbr_wasspenl_wr_sys_prop(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error);
-int mbr_wasspenl_wr_sys_cfg1(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error);
-int mbr_wasspenl_wr_mcomment(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error);
-int mbr_wasspenl_wr_unknown1(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error);
-
-static char rcs_id[]="$Id: mbr_wasspenl.c 2239 2015-05-07 00:51:42Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mbr_register_wasspenl(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_register_wasspenl";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* get mb_io_ptr */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set format info parameters */
-	status = mbr_info_wasspenl(verbose,
-			&mb_io_ptr->system,
-			&mb_io_ptr->beams_bath_max,
-			&mb_io_ptr->beams_amp_max,
-			&mb_io_ptr->pixels_ss_max,
-			mb_io_ptr->format_name,
-			mb_io_ptr->system_name,
-			mb_io_ptr->format_description,
-			&mb_io_ptr->numfile,
-			&mb_io_ptr->filetype,
-			&mb_io_ptr->variable_beams,
-			&mb_io_ptr->traveltime,
-			&mb_io_ptr->beam_flagging,
-			&mb_io_ptr->nav_source,
-			&mb_io_ptr->heading_source,
-			&mb_io_ptr->vru_source,
-			&mb_io_ptr->svp_source,
-			&mb_io_ptr->beamwidth_xtrack,
-			&mb_io_ptr->beamwidth_ltrack,
-			error);
-
-	/* set format and system specific function pointers */
-	mb_io_ptr->mb_io_format_alloc = &mbr_alm_wasspenl;
-	mb_io_ptr->mb_io_format_free = &mbr_dem_wasspenl;
-	mb_io_ptr->mb_io_store_alloc = &mbsys_wassp_alloc;
-	mb_io_ptr->mb_io_store_free = &mbsys_wassp_deall;
-	mb_io_ptr->mb_io_read_ping = &mbr_rt_wasspenl;
-	mb_io_ptr->mb_io_write_ping = &mbr_wt_wasspenl;
-	mb_io_ptr->mb_io_dimensions = &mbsys_wassp_dimensions;
-	mb_io_ptr->mb_io_pingnumber = &mbsys_wassp_pingnumber;
-	mb_io_ptr->mb_io_sonartype = &mbsys_wassp_sonartype;
-	mb_io_ptr->mb_io_sidescantype = NULL;
-	mb_io_ptr->mb_io_extract = &mbsys_wassp_extract;
-	mb_io_ptr->mb_io_insert = &mbsys_wassp_insert;
-	mb_io_ptr->mb_io_extract_nav = &mbsys_wassp_extract_nav;
-	mb_io_ptr->mb_io_extract_nnav = NULL;
-	mb_io_ptr->mb_io_insert_nav = &mbsys_wassp_insert_nav;
-	mb_io_ptr->mb_io_extract_altitude = &mbsys_wassp_extract_altitude;
-	mb_io_ptr->mb_io_insert_altitude = NULL;
-	mb_io_ptr->mb_io_extract_svp = NULL;
-	mb_io_ptr->mb_io_insert_svp = NULL;
-	mb_io_ptr->mb_io_ttimes = &mbsys_wassp_ttimes;
-	mb_io_ptr->mb_io_detects = &mbsys_wassp_detects;
-	mb_io_ptr->mb_io_gains = &mbsys_wassp_gains;
-	mb_io_ptr->mb_io_copyrecord = &mbsys_wassp_copy;
-	mb_io_ptr->mb_io_extract_rawss = NULL;
-	mb_io_ptr->mb_io_insert_rawss = NULL;
-	mb_io_ptr->mb_io_extract_segytraceheader = NULL;
-	mb_io_ptr->mb_io_extract_segy = NULL;
-	mb_io_ptr->mb_io_insert_segy = NULL;
-	mb_io_ptr->mb_io_ctd = NULL;
-	mb_io_ptr->mb_io_ancilliarysensor = NULL;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",mb_io_ptr->system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",mb_io_ptr->beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",mb_io_ptr->beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",mb_io_ptr->pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",mb_io_ptr->format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",mb_io_ptr->system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",mb_io_ptr->format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",mb_io_ptr->numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",mb_io_ptr->filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",mb_io_ptr->variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",mb_io_ptr->traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",mb_io_ptr->beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",mb_io_ptr->nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",mb_io_ptr->heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",mb_io_ptr->vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",mb_io_ptr->svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",mb_io_ptr->beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",mb_io_ptr->beamwidth_ltrack);
-		fprintf(stderr,"dbg2       format_alloc:       %p\n",(void *)mb_io_ptr->mb_io_format_alloc);
-		fprintf(stderr,"dbg2       format_free:        %p\n",(void *)mb_io_ptr->mb_io_format_free);
-		fprintf(stderr,"dbg2       store_alloc:        %p\n",(void *)mb_io_ptr->mb_io_store_alloc);
-		fprintf(stderr,"dbg2       store_free:         %p\n",(void *)mb_io_ptr->mb_io_store_free);
-		fprintf(stderr,"dbg2       read_ping:          %p\n",(void *)mb_io_ptr->mb_io_read_ping);
-		fprintf(stderr,"dbg2       write_ping:         %p\n",(void *)mb_io_ptr->mb_io_write_ping);
-		fprintf(stderr,"dbg2       extract:            %p\n",(void *)mb_io_ptr->mb_io_extract);
-		fprintf(stderr,"dbg2       insert:             %p\n",(void *)mb_io_ptr->mb_io_insert);
-		fprintf(stderr,"dbg2       extract_nav:        %p\n",(void *)mb_io_ptr->mb_io_extract_nav);
-		fprintf(stderr,"dbg2       insert_nav:         %p\n",(void *)mb_io_ptr->mb_io_insert_nav);
-		fprintf(stderr,"dbg2       extract_altitude:   %p\n",(void *)mb_io_ptr->mb_io_extract_altitude);
-		fprintf(stderr,"dbg2       insert_altitude:    %p\n",(void *)mb_io_ptr->mb_io_insert_altitude);
-		fprintf(stderr,"dbg2       extract_svp:        %p\n",(void *)mb_io_ptr->mb_io_extract_svp);
-		fprintf(stderr,"dbg2       insert_svp:         %p\n",(void *)mb_io_ptr->mb_io_insert_svp);
-		fprintf(stderr,"dbg2       ttimes:             %p\n",(void *)mb_io_ptr->mb_io_ttimes);
-		fprintf(stderr,"dbg2       detects:            %p\n",(void *)mb_io_ptr->mb_io_detects);
-		fprintf(stderr,"dbg2       extract_rawss:      %p\n",(void *)mb_io_ptr->mb_io_extract_rawss);
-		fprintf(stderr,"dbg2       insert_rawss:       %p\n",(void *)mb_io_ptr->mb_io_insert_rawss);
-		fprintf(stderr,"dbg2       extract_segytraceheader: %p\n",(void *)mb_io_ptr->mb_io_extract_segytraceheader);
-		fprintf(stderr,"dbg2       extract_segy:       %p\n",(void *)mb_io_ptr->mb_io_extract_segy);
-		fprintf(stderr,"dbg2       insert_segy:        %p\n",(void *)mb_io_ptr->mb_io_insert_segy);
-		fprintf(stderr,"dbg2       copyrecord:         %p\n",(void *)mb_io_ptr->mb_io_copyrecord);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbr_info_wasspenl(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error)
-{
-	char	*function_name = "mbr_info_wasspenl";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* set format info parameters */
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-	*system = MB_SYS_WASSP;
-	*beams_bath_max = MBSYS_WASSP_MAX_BEAMS;
-	*beams_amp_max = MBSYS_WASSP_MAX_BEAMS;
-	*pixels_ss_max = MBSYS_WASSP_MAX_PIXELS;
-	strncpy(format_name, "WASSPENL", MB_NAME_LENGTH);
-	strncpy(system_name, "WASSP", MB_NAME_LENGTH);
-	strncpy(format_description, "Format name:          MBF_WASSPENL\nInformal Description: WASSP Multibeam Vendor Format\nAttributes:           WASSP multibeams, \n                      bathymetry and amplitude,\n		      122 or 244 beams, binary, Electronic Navigation Ltd.\n", MB_DESCRIPTION_LENGTH);
-	*numfile = 1;
-	*filetype = MB_FILETYPE_SINGLE;
-	*variable_beams = MB_YES;
-	*traveltime = MB_YES;
-	*beam_flagging = MB_YES;
-	*nav_source = MB_DATA_DATA;
-	*heading_source = MB_DATA_DATA;
-	*vru_source = MB_DATA_DATA;
-	*svp_source = MB_DATA_NONE;
-	*beamwidth_xtrack = 4.0;
-	*beamwidth_ltrack = 4.0;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",*system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",*beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",*beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",*pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",*numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",*filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",*variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",*traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",*beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",*nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",*heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",*vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",*svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",*beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",*beamwidth_ltrack);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_alm_wasspenl(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_alm_wasspenl";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	char	**bufferptr;
-	char	*buffer;
-	int	*bufferalloc;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set initial status */
-	status = MB_SUCCESS;
-
-	/* allocate memory for data structure */
-	mb_io_ptr->structure_size = 0;
-	mb_io_ptr->data_structure_size = 0;
-	status = mbsys_wassp_alloc(
-			verbose,mbio_ptr,
-			&mb_io_ptr->store_data,error);
-	
-	/* allocate starting memory for data record buffer */
-	bufferptr = (char **) &mb_io_ptr->saveptr1;
-	buffer = (char *) *bufferptr;
-	bufferalloc = (int *) &mb_io_ptr->save6;
-	*bufferptr = NULL;
-	*bufferalloc = 0;
-	if (status == MB_SUCCESS)
-		{
-		status = mb_reallocd(verbose, __FILE__, __LINE__, MBSYS_WASSP_BUFFER_STARTSIZE,
-					(void **)bufferptr, error);
-		if (status == MB_SUCCESS)
-			*bufferalloc = MBSYS_WASSP_BUFFER_STARTSIZE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_dem_wasspenl(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_dem_wasspenl";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	char	**bufferptr;
-	char	*buffer;
-	int	*bufferalloc;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointers to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* deallocate memory for reading/writing buffer */
-	bufferptr = (char **) &mb_io_ptr->saveptr1;
-	buffer = (char *) *bufferptr;
-	bufferalloc = (int *) &mb_io_ptr->save6;
-	status = mb_freed(verbose,__FILE__,__LINE__,(void **)bufferptr,error);
-	*bufferalloc = 0;
-
-	/* deallocate memory for data descriptor */
-	status = mbsys_wassp_deall(
-			verbose,mbio_ptr,
-			&mb_io_ptr->store_data,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_rt_wasspenl(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_rt_wasspenl";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_wassp_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointers to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-#ifdef MBR_WASSPENLDEBUG
-	fprintf(stderr,"About to call mbr_wasspenl_rd_data...\n");
-#endif
-
-	/* read next data from file */
-	status = mbr_wasspenl_rd_data(verbose,mbio_ptr,store_ptr,error);
-
-	/* get pointers to data structures */
-	store = (struct mbsys_wassp_struct *) store_ptr;
-
-	/* set error and kind in mb_io_ptr */
-	mb_io_ptr->new_error = *error;
-	mb_io_ptr->new_kind = store->kind;
-
-#ifdef MBR_WASSPENLDEBUG
-	fprintf(stderr,"Done with mbr_wasspenl_rd_data: status:%d error:%d record kind:%d\n\n", status, *error, store->kind);
-#endif
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_wt_wasspenl(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_wt_wasspenl";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_wassp_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_wassp_struct *) store_ptr;
-
-#ifdef MBR_WASSPENLDEBUG
-	fprintf(stderr,"About to call mbr_wasspenl_wr_data record kind:%d\n", store->kind);
-#endif
-
-	/* write next data to file */
-	status = mbr_wasspenl_wr_data(verbose,mbio_ptr,store_ptr,error);
-
-#ifdef MBR_WASSPENLDEBUG
-	fprintf(stderr,"Done with mbr_wasspenl_wr_data: status:%d error:%d\n", status, *error);
-#endif
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_wasspenl_rd_data(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_wasspenl_rd_data";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_wassp_struct *store;
-        struct mbsys_wassp_genbathy_struct *genbathy;
-        struct mbsys_wassp_corbathy_struct *corbathy;
-        struct mbsys_wassp_rawsonar_struct *rawsonar;
-        struct mbsys_wassp_gen_sens_struct *gen_sens;
-        struct mbsys_wassp_nvupdate_struct *nvupdate;
-        struct mbsys_wassp_wcd_navi_struct *wcd_navi;
-        struct mbsys_wassp_sensprop_struct *sensprop;
-        struct mbsys_wassp_sys_prop_struct *sys_prop;
-	struct mbsys_wassp_sys_cfg1_struct *sys_cfg1;
-	struct mbsys_wassp_mcomment_struct *mcomment;
-	char	**bufferptr;
-	char	*buffer;
-	int	*bufferalloc;
-	unsigned int syncvalue;
-	char	recordid[12];
-	size_t	read_len;
-	int	skip;
-	unsigned int *record_size;
-	int	reset_beamflags;
-	int	done;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_wassp_struct *) store_ptr;
-        genbathy = (struct mbsys_wassp_genbathy_struct *) &(store->genbathy);
-        corbathy = (struct mbsys_wassp_corbathy_struct *) &(store->corbathy);
-        rawsonar = (struct mbsys_wassp_rawsonar_struct *) &(store->rawsonar);
-        gen_sens = (struct mbsys_wassp_gen_sens_struct *) &(store->gen_sens);
-        nvupdate = (struct mbsys_wassp_nvupdate_struct *) &(store->nvupdate);
-        wcd_navi = (struct mbsys_wassp_wcd_navi_struct *) &(store->wcd_navi);
-        sensprop = (struct mbsys_wassp_sensprop_struct *) &(store->sensprop);
-        sys_prop = (struct mbsys_wassp_sys_prop_struct *) &(store->sys_prop);
-        sys_cfg1 = (struct mbsys_wassp_sys_cfg1_struct *) &(store->sys_cfg1);
-        mcomment = (struct mbsys_wassp_mcomment_struct *) &(store->mcomment);
-
-	bufferptr = (char **) &mb_io_ptr->saveptr1;
-	buffer = (char *) *bufferptr;
-	bufferalloc = (int *) &mb_io_ptr->save6;
-	record_size = (unsigned int *)&buffer[4];
-	
-	/* set file position */
-	mb_io_ptr->file_pos = mb_io_ptr->file_bytes;
-
-	/* loop over reading data until a record is ready for return */
-	done = MB_NO;
-	*error = MB_ERROR_NO_ERROR;
-	memset((void *)recordid, 0 , (size_t)12);
-	while (done == MB_NO)
-		{
-		/* read next record header into buffer */
-		read_len = (size_t)16;
-		status = mb_fileio_get(verbose, mbio_ptr, buffer, &read_len, error);
-
-		/* check header - if not a good header read a byte
-			at a time until a good header is found */
-		skip = 0;
-		mb_get_binary_int(MB_YES, buffer, &syncvalue);
-		while (status == MB_SUCCESS
-			&& syncvalue != MBSYS_WASSP_SYNC)
-			{
-			/* get next byte */
-			for (i=0;i<15;i++)
-			    buffer[i] = buffer[i+1];
-			read_len = (size_t)1;
-			status = mb_fileio_get(verbose, mbio_ptr, &buffer[15], &read_len, error);
-			mb_get_binary_int(MB_YES, buffer, &syncvalue);
-			skip++;
-			}
-		    
-		/* get record id string */
-		memcpy((void *)recordid, (void *)&buffer[8], (size_t)8);
-#ifdef MBR_WASSPENLDEBUG
-	fprintf(stderr,"Found sync - skip:%d record:%s\n", skip,recordid);
-#endif
-
-		/* report problem */
-		if (skip > 0 && verbose >= 0)
-		    	{
-			fprintf(stderr,
-				"\nThe MBF_WASSPENL module skipped data between identified\n"
-				"data records. Something is broken, most probably the data...\n"
-				"However, the data may include a data record type that we\n"
-				"haven't seen yet, or there could be an error in the code.\n"
-				"If skipped data are reported multiple times, \n"
-				"we recommend you send a data sample and problem \n"
-				"description to the MB-System team \n"
-				"(caress at mbari.org and dale at ldeo.columbia.edu)\n"
-				"Have a nice day...\n");
-			fprintf(stderr, "MBF_WASSPENL skipped %d bytes before record %s\n",
-					skip, recordid);
-		    }
-
-		/* allocate memory to read rest of record if necessary */
-		if (*bufferalloc < *record_size)
-			{
-			status = mb_reallocd(verbose, __FILE__, __LINE__, *record_size,
-						(void **)bufferptr, error);
-			if (status != MB_SUCCESS)
-				{
-				*bufferalloc = 0;
-				done = MB_YES;
-				}
-			else
-				{
-				*bufferalloc = *record_size;
-				buffer = (char *) *bufferptr;
-				}
-			}
-
-		/* read the rest of the record */
-		if (status == MB_SUCCESS)
-			{
-			read_len = (size_t)(*record_size - 16);
-			status = mb_fileio_get(verbose, mbio_ptr, &buffer[16],
-				       &read_len, error);
-			}
-		
-		/* if valid parse the record */
-		if (status == MB_SUCCESS)
-			{
-			/* read GENBATHY record */
-			if (strncmp(recordid, "GENBATHY", 8) == 0)
-				{
-				status = mbr_wasspenl_rd_genbathy(verbose, buffer, store_ptr, error);
-				}
-
-			/* read CORBATHY record */
-			else if (strncmp(recordid, "CORBATHY", 8) == 0)
-				{
-				status = mbr_wasspenl_rd_corbathy(verbose, buffer, store_ptr, error);
-				if (status == MB_SUCCESS)
-					{
-					if (genbathy->ping_number == corbathy->ping_number)
-						{
-						done = MB_YES;
-						
-						/* reset beam flags if necessary */
-						reset_beamflags = MB_NO;
-						for (i=0;i<corbathy->num_beams;i++)
-							{
-							if (corbathy->z[i] == 0 && corbathy->empty[i] != MB_FLAG_NULL)
-								reset_beamflags = MB_YES;
-							}
-						if (reset_beamflags == MB_YES)
-						for (i=0;i<corbathy->num_beams;i++)
-							{
-							j = corbathy->beam_index[i];
-							if (corbathy->z[i] == 0)
-								corbathy->empty[i] = MB_FLAG_NULL;
-							else if (genbathy->flags[j] & 0x01)
-								corbathy->empty[i] = MB_FLAG_NONE;
-							else
-								corbathy->empty[i] = MB_FLAG_FLAG + MB_FLAG_SONAR;
-							}
-						}
-					else
-						{
-						status = MB_FAILURE;
-						*error = MB_ERROR_UNINTELLIGIBLE;
-						done = MB_YES;
-						}
-					}
-				}
-
-			/* read RAWSONAR record */
-			else if (strncmp(recordid, "RAWSONAR", 8) == 0)
-				{
-				status = mbr_wasspenl_rd_rawsonar(verbose, buffer, store_ptr, error);
-				if (status == MB_SUCCESS)
-					done = MB_YES;
-				}
-
-			/* read GEN_SENS record */
-			else if (strncmp(recordid, "GEN_SENS", 8) == 0)
-				{
-				status = mbr_wasspenl_rd_gen_sens(verbose, buffer, store_ptr, error);
-				if (status == MB_SUCCESS)
-					done = MB_YES;
-				}
-
-			/* read NVUPDATE record */
-			else if (strncmp(recordid, "NVUPDATE", 8) == 0)
-				{
-				status = mbr_wasspenl_rd_nvupdate(verbose, buffer, store_ptr, error);
-				if (status == MB_SUCCESS)
-					done = MB_YES;
-				}
-
-			/* read WCD_NAVI record */
-			else if (strncmp(recordid, "WCD_NAVI", 8) == 0)
-				{
-				status = mbr_wasspenl_rd_wcd_navi(verbose, buffer, store_ptr, error);
-				if (status == MB_SUCCESS)
-					done = MB_YES;
-				}
-
-			/* read SENSPROP record */
-			else if (strncmp(recordid, "SENSPROP", 8) == 0)
-				{
-				status = mbr_wasspenl_rd_sensprop(verbose, buffer, store_ptr, error);
-				if (status == MB_SUCCESS)
-					done = MB_YES;
-				}
-
-			/* read SYS_PROP record */
-			else if (strncmp(recordid, "SYS_PROP", 8) == 0)
-				{
-				status = mbr_wasspenl_rd_sys_prop(verbose, buffer, store_ptr, error);
-				if (status == MB_SUCCESS)
-					done = MB_YES;
-				}
-
-			/* read SYS_CFG1 record */
-			else if (strncmp(recordid, "SYS_CFG1", 8) == 0)
-				{
-				status = mbr_wasspenl_rd_sys_cfg1(verbose, buffer, store_ptr, error);
-				if (status == MB_SUCCESS)
-					done = MB_YES;
-				}
-
-			/* read MCOMMENT_ record */
-			else if (strncmp(recordid, "MCOMMENT", 8) == 0)
-				{
-				status = mbr_wasspenl_rd_mcomment(verbose, buffer, store_ptr, error);
-				if (status == MB_SUCCESS)
-					done = MB_YES;
-				}
-
-			/* read an unknown1 record */
-			else
-				{
-				status = mbr_wasspenl_rd_unknown1(verbose, buffer, store_ptr, error);
-				if (status == MB_SUCCESS)
-					done = MB_YES;
-				}
-			}
-
-		/* set done if read failure */
-		else
-			{
-			done = MB_YES;
-			}
-		}
-
-	/* get file position */
-	mb_io_ptr->file_bytes = ftell(mb_io_ptr->mbfp);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_wasspenl_wr_data(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_wasspenl_wr_data";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_wassp_struct *store;
-	char	**bufferptr;
-	char	*buffer;
-	int	*bufferalloc;
-	int	size;
-	size_t	write_len;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_wassp_struct *) store_ptr;
-
-	/* get saved values */
-	bufferptr = (char **) &mb_io_ptr->saveptr1;
-	buffer = (char *) *bufferptr;
-	bufferalloc = (int *) &mb_io_ptr->save6;
-
-	/* write the current data record */
-	
-	/* write GENBATHY record */
-	if (store->kind == MB_DATA_DATA)
-		{
-		status = mbr_wasspenl_wr_genbathy(verbose, bufferalloc, bufferptr, store_ptr, &size, error);
-		buffer = (char *) *bufferptr;
-		write_len = (size_t)size;
-		status = mb_fileio_put(verbose, mbio_ptr, buffer, &write_len, error);
-
-		status = mbr_wasspenl_wr_corbathy(verbose, bufferalloc, bufferptr, store_ptr, &size, error);
-		buffer = (char *) *bufferptr;
-		write_len = (size_t)size;
-		status = mb_fileio_put(verbose, mbio_ptr, buffer, &write_len, error);
-		}
-
-	/* write RAWSONAR record */
-	else if (store->kind == MB_DATA_WATER_COLUMN)
-		{
-		status = mbr_wasspenl_wr_rawsonar(verbose, bufferalloc, bufferptr, store_ptr, &size, error);
-		buffer = (char *) *bufferptr;
-		write_len = (size_t)size;
-		status = mb_fileio_put(verbose, mbio_ptr, buffer, &write_len, error);
-		}
-
-	/* write GEN_SENS record */
-	else if (store->kind == MB_DATA_GEN_SENS)
-		{
-		status = mbr_wasspenl_wr_gen_sens(verbose, bufferalloc, bufferptr, store_ptr, &size, error);
-		buffer = (char *) *bufferptr;
-		write_len = (size_t)size;
-		status = mb_fileio_put(verbose, mbio_ptr, buffer, &write_len, error);
-		}
-
-	/* write NVUPDATE record */
-	else if (store->kind == MB_DATA_NAV)
-		{
-		status = mbr_wasspenl_wr_nvupdate(verbose, bufferalloc, bufferptr, store_ptr, &size, error);
-		buffer = (char *) *bufferptr;
-		write_len = (size_t)size;
-		status = mb_fileio_put(verbose, mbio_ptr, buffer, &write_len, error);
-		}
-
-	/* write WCD_NAVI record */
-	else if (store->kind == MB_DATA_WC_PICKS)
-		{
-		status = mbr_wasspenl_wr_wcd_navi(verbose, bufferalloc, bufferptr, store_ptr, &size, error);
-		buffer = (char *) *bufferptr;
-		write_len = (size_t)size;
-		status = mb_fileio_put(verbose, mbio_ptr, buffer, &write_len, error);
-		}
-
-	/* write SENSPROP record */
-	else if (store->kind == MB_DATA_SENSOR_PARAMETERS)
-		{
-		status = mbr_wasspenl_wr_sensprop(verbose, bufferalloc, bufferptr, store_ptr, &size, error);
-		buffer = (char *) *bufferptr;
-		write_len = (size_t)size;
-		status = mb_fileio_put(verbose, mbio_ptr, buffer, &write_len, error);
-		}
-
-	/* write SYS_PROP record */
-	else if (store->kind == MB_DATA_INSTALLATION)
-		{
-		status = mbr_wasspenl_wr_sys_prop(verbose, bufferalloc, bufferptr, store_ptr, &size, error);
-		buffer = (char *) *bufferptr;
-		write_len = (size_t)size;
-		status = mb_fileio_put(verbose, mbio_ptr, buffer, &write_len, error);
-		}
-
-	/* write SYS_CFG1 record */
-	else if (store->kind == MB_DATA_PARAMETER)
-		{
-		status = mbr_wasspenl_wr_sys_cfg1(verbose, bufferalloc, bufferptr, store_ptr, &size, error);
-		buffer = (char *) *bufferptr;
-		write_len = (size_t)size;
-		status = mb_fileio_put(verbose, mbio_ptr, buffer, &write_len, error);
-		}
-
-	/* write MCOMMENT_ record */
-	else if (store->kind == MB_DATA_COMMENT)
-		{
-		status = mbr_wasspenl_wr_mcomment(verbose, bufferalloc, bufferptr, store_ptr, &size, error);
-		buffer = (char *) *bufferptr;
-		write_len = (size_t)size;
-		status = mb_fileio_put(verbose, mbio_ptr, buffer, &write_len, error);
-		}
-
-	/* write unknown1 record */
-	else if (store->kind == MB_DATA_RAW_LINE)
-		{
-		status = mbr_wasspenl_wr_sys_cfg1(verbose, bufferalloc, bufferptr, store_ptr, &size, error);
-		buffer = (char *) *bufferptr;
-		write_len = (size_t)size;
-		status = mb_fileio_put(verbose, mbio_ptr, buffer, &write_len, error);
-		}
-
-#ifdef MBR_WASSPENLDEBUG
-	fprintf(stderr,"WASSPENL DATA WRITTEN: type:%d status:%d error:%d\n\n",
-	store->kind, status, *error);
-#endif
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_wasspenl_rd_genbathy(int verbose, char *buffer, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_wasspenl_rd_genbathy";
-	int	status = MB_SUCCESS;
-	struct mbsys_wassp_struct *store;
-        struct mbsys_wassp_genbathy_struct *genbathy;
-	int	index;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       buffer:     %p\n",(void *)buffer);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_wassp_struct *) store_ptr;
-	genbathy = &(store->genbathy);
-
-	/* extract the data */
-	index = 16;
-	mb_get_binary_int(MB_YES, &buffer[index], &(genbathy->version)); index += 4;
-	mb_get_binary_double(MB_YES, &buffer[index], &(genbathy->msec)); index += 8;
-	genbathy->day = buffer[index]; index++;
-	genbathy->month = buffer[index]; index++;
-	mb_get_binary_short(MB_YES, &buffer[index], &(genbathy->year)); index += 2;
-	mb_get_binary_int(MB_YES, &buffer[index], &(genbathy->ping_number)); index += 4;
-	mb_get_binary_int(MB_YES, &buffer[index], &(genbathy->sonar_model)); index += 4;
-	mb_get_binary_long(MB_YES, &buffer[index], &(genbathy->transducer_serial_number)); index += 8;
-	mb_get_binary_int(MB_YES, &buffer[index], &(genbathy->number_beams)); index += 4;
-	mb_get_binary_int(MB_YES, &buffer[index], &(genbathy->modeflags)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(genbathy->sampling_frequency)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(genbathy->acoustic_frequency)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(genbathy->tx_power)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(genbathy->pulse_width)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(genbathy->absorption_loss)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(genbathy->spreading_loss)); index += 4;
-	mb_get_binary_int(MB_YES, &buffer[index], &(genbathy->sample_type)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(genbathy->sound_velocity)); index += 4;
-	for (i=0;i<genbathy->number_beams;i++)
-		{
-		mb_get_binary_float(MB_YES, &buffer[index], &(genbathy->detection_point[i])); index += 4;
-		mb_get_binary_float(MB_YES, &buffer[index], &(genbathy->rx_angle[i])); index += 4;
-		mb_get_binary_int(MB_YES, &buffer[index], &(genbathy->flags[i])); index += 4;
-		mb_get_binary_float(MB_YES, &buffer[index], &(genbathy->backscatter[i])); index += 4;
-		}
-	mb_get_binary_int(MB_YES, &buffer[index], &(genbathy->checksum)); index += 4;
-
-	/* set kind */
-	if (status == MB_SUCCESS)
-		{
-		/* set kind */
-		store->kind = MB_DATA_DATA;
-
-		/* get the time */
-		store->time_i[0] = genbathy->year;
-		store->time_i[1] = genbathy->month;
-		store->time_i[2] = genbathy->day;
-		store->time_i[3] = (int)floor(genbathy->msec / 3600000.0);
-		store->time_i[4] = (int)floor((genbathy->msec - 3600000.0 * store->time_i[3]) / 60000.0);
-		store->time_i[5] = (int)floor((genbathy->msec
-					       - 3600000.0 * store->time_i[3]
-					       - 60000.0 * store->time_i[4]) / 1000.0);;
-		store->time_i[6] = (int)((genbathy->msec
-					       - 3600000.0 * store->time_i[3]
-					       - 60000.0 * store->time_i[4]
-					       - 1000.0 * store->time_i[5]) * 1000.0);;
-		mb_get_time(verbose, store->time_i, &(store->time_d));
-		}
-	else
-		{
-		store->kind = MB_DATA_NONE;
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       genbathy->version:                    %u\n",genbathy->version);
-		fprintf(stderr,"dbg5       genbathy->msec:                       %f\n",genbathy->msec);
-		fprintf(stderr,"dbg5       genbathy->day:                        %u\n",genbathy->day);
-		fprintf(stderr,"dbg5       genbathy->month:                      %u\n",genbathy->month);
-		fprintf(stderr,"dbg5       genbathy->year:                       %u\n",genbathy->year);
-		fprintf(stderr,"dbg5       genbathy->ping_number:                %u\n",genbathy->ping_number);
-		fprintf(stderr,"dbg5       genbathy->sonar_model:                %u\n",genbathy->sonar_model);
-		fprintf(stderr,"dbg5       genbathy->transducer_serial_number:   %lu\n",genbathy->transducer_serial_number);
-		fprintf(stderr,"dbg5       genbathy->number_beams:               %u\n",genbathy->number_beams);
-		fprintf(stderr,"dbg5       genbathy->modeflags:                  %u\n",genbathy->modeflags);
-		fprintf(stderr,"dbg5       genbathy->sampling_frequency:         %f\n",genbathy->sampling_frequency);
-		fprintf(stderr,"dbg5       genbathy->acoustic_frequency:         %f\n",genbathy->acoustic_frequency);
-		fprintf(stderr,"dbg5       genbathy->tx_power:                   %f\n",genbathy->tx_power);
-		fprintf(stderr,"dbg5       genbathy->pulse_width:                %f\n",genbathy->pulse_width);
-		fprintf(stderr,"dbg5       genbathy->absorption_loss:            %f\n",genbathy->absorption_loss);
-		fprintf(stderr,"dbg5       genbathy->spreading_loss:             %f\n",genbathy->spreading_loss);
-		fprintf(stderr,"dbg5       genbathy->sample_type:                %u\n",genbathy->sample_type);
-		fprintf(stderr,"dbg5       genbathy->sound_velocity:             %f\n",genbathy->sound_velocity);
-		for (i=0;i<genbathy->number_beams;i++)
-			{
-			fprintf(stderr,"dbg5       genbathy->detection_point[%3d]:       %f\n",i,genbathy->detection_point[i]);
-			fprintf(stderr,"dbg5       genbathy->rx_angle[%3d]:              %f\n",i,genbathy->rx_angle[i]);	
-			fprintf(stderr,"dbg5       genbathy->flags[%3d]:                 %u\n",i,genbathy->flags[i]);	
-			fprintf(stderr,"dbg5       genbathy->backscatter[%3d]:           %f\n",i,genbathy->backscatter[i]);
-			}
-		fprintf(stderr,"dbg5       genbathy->checksum:                   %u\n",genbathy->checksum);	
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_wasspenl_rd_corbathy(int verbose, char *buffer, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_wasspenl_rd_corbathy";
-	int	status = MB_SUCCESS;
-	struct mbsys_wassp_struct *store;
-        struct mbsys_wassp_corbathy_struct *corbathy;
-	int	index;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       buffer:     %p\n",(void *)buffer);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_wassp_struct *) store_ptr;
-	corbathy = &(store->corbathy);
-
-	/* extract the data */
-	index = 16;
-	mb_get_binary_int(MB_YES, &buffer[index], &(corbathy->version)); index += 4;
-	mb_get_binary_double(MB_YES, &buffer[index], &(corbathy->msec)); index += 8;
-	mb_get_binary_int(MB_YES, &buffer[index], &(corbathy->num_beams)); index += 4;
-	mb_get_binary_int(MB_YES, &buffer[index], &(corbathy->ping_number)); index += 4;
-	mb_get_binary_double(MB_YES, &buffer[index], &(corbathy->latitude)); index += 8;
-	mb_get_binary_double(MB_YES, &buffer[index], &(corbathy->longitude)); index += 8;
-	mb_get_binary_float(MB_YES, &buffer[index], &(corbathy->bearing)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(corbathy->roll)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(corbathy->pitch)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(corbathy->heave)); index += 4;
-	mb_get_binary_int(MB_YES, &buffer[index], &(corbathy->sample_type)); index += 4;
-	for (i=0;i<6;i++)
-		{
-		mb_get_binary_int(MB_YES, &buffer[index], &(corbathy->spare[i])); index += 4;
-		}
-	for (i=0;i<corbathy->num_beams;i++)
-		{
-		mb_get_binary_int(MB_YES, &buffer[index], &(corbathy->beam_index[i])); index += 4;
-		mb_get_binary_float(MB_YES, &buffer[index], &(corbathy->x[i])); index += 4;
-		mb_get_binary_float(MB_YES, &buffer[index], &(corbathy->y[i])); index += 4;
-		mb_get_binary_float(MB_YES, &buffer[index], &(corbathy->z[i])); index += 4;
-		mb_get_binary_float(MB_YES, &buffer[index], &(corbathy->beam_angle[i])); index += 4;
-		mb_get_binary_float(MB_YES, &buffer[index], &(corbathy->backscatter[i])); index += 4;
-		corbathy->quality[i] = buffer[index]; index++;
-		corbathy->fish[i] = buffer[index]; index++;
-		corbathy->roughness[i] = buffer[index]; index++;
-		corbathy->empty[i] = buffer[index]; index++;
-		mb_get_binary_int(MB_YES, &buffer[index], &(corbathy->pad[i])); index += 4;
-		}
-	mb_get_binary_int(MB_YES, &buffer[index], &(corbathy->checksum)); index += 4;
-
-	/* set kind */
-	if (status == MB_SUCCESS)
-		{
-		/* set kind */
-		store->kind = MB_DATA_DATA;
-		}
-	else
-		{
-		store->kind = MB_DATA_NONE;
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       corbathy->version:                    %u\n",corbathy->version);
-		fprintf(stderr,"dbg5       corbathy->msec:                       %f\n",corbathy->msec);
-		fprintf(stderr,"dbg5       corbathy->num_beams:                  %u\n",corbathy->num_beams);
-		fprintf(stderr,"dbg5       corbathy->ping_number:                %u\n",corbathy->ping_number);
-		fprintf(stderr,"dbg5       corbathy->latitude:                   %f\n",corbathy->latitude);
-		fprintf(stderr,"dbg5       corbathy->longitude:                  %f\n",corbathy->longitude);
-		fprintf(stderr,"dbg5       corbathy->bearing:                    %f\n",corbathy->bearing);
-		fprintf(stderr,"dbg5       corbathy->roll:                       %f\n",corbathy->roll);
-		fprintf(stderr,"dbg5       corbathy->pitch:                      %f\n",corbathy->pitch);
-		fprintf(stderr,"dbg5       corbathy->heave:                      %f\n",corbathy->heave);
-		fprintf(stderr,"dbg5       corbathy->sample_type:                %u\n",corbathy->sample_type);
-		for (i=0;i<6;i++)
-			{
-			fprintf(stderr,"dbg5       corbathy->spare[%3d]:                 %u\n",i,corbathy->spare[i]);	
-			}
-		for (i=0;i<corbathy->num_beams;i++)
-			{
-			fprintf(stderr,"dbg5       corbathy->beam_index[%3d]:            %u\n",i,corbathy->beam_index[i]);	
-			fprintf(stderr,"dbg5       corbathy->x[%3d]:                     %f\n",i,corbathy->x[i]);
-			fprintf(stderr,"dbg5       corbathy->y[%3d]:                     %f\n",i,corbathy->y[i]);
-			fprintf(stderr,"dbg5       corbathy->z[%3d]:                     %f\n",i,corbathy->z[i]);
-			fprintf(stderr,"dbg5       corbathy->beam_angle[%3d]:            %f\n",i,corbathy->beam_angle[i]);	
-			fprintf(stderr,"dbg5       corbathy->backscatter[%3d]:           %f\n",i,corbathy->backscatter[i]);	
-			fprintf(stderr,"dbg5       corbathy->quality[%3d]:               %u\n",i,corbathy->quality[i]);	
-			fprintf(stderr,"dbg5       corbathy->fish[%3d]:                  %u\n",i,corbathy->fish[i]);	
-			fprintf(stderr,"dbg5       corbathy->roughness[%3d]:             %u\n",i,corbathy->roughness[i]);	
-			fprintf(stderr,"dbg5       corbathy->empty[%3d]:                 %u\n",i,corbathy->empty[i]);	
-			fprintf(stderr,"dbg5       corbathy->pad[%3d]:                   %u\n",i,corbathy->pad[i]);	
-			}
-		fprintf(stderr,"dbg5       corbathy->checksum:                   %u\n",corbathy->checksum);	
-		}
-		
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_wasspenl_rd_rawsonar(int verbose, char *buffer, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_wasspenl_rd_rawsonar";
-	int	status = MB_SUCCESS;
-	struct mbsys_wassp_struct *store;
-        struct mbsys_wassp_rawsonar_struct *rawsonar;
-	int	index;
-	size_t	rawdata_len;
-	int	i, j, k;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       buffer:     %p\n",(void *)buffer);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_wassp_struct *) store_ptr;
-	rawsonar = &(store->rawsonar);
-
-	/* extract the data */
-	index = 16;
-	mb_get_binary_int(MB_YES, &buffer[index], &(rawsonar->version)); index += 4;
-	mb_get_binary_double(MB_YES, &buffer[index], &(rawsonar->msec)); index += 8;
-	mb_get_binary_int(MB_YES, &buffer[index], &(rawsonar->ping_number)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(rawsonar->sample_rate)); index += 4;
-	mb_get_binary_int(MB_YES, &buffer[index], &(rawsonar->n)); index += 4;
-	mb_get_binary_int(MB_YES, &buffer[index], &(rawsonar->m)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(rawsonar->tx_power)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(rawsonar->pulse_width)); index += 4;
-	mb_get_binary_int(MB_YES, &buffer[index], &(rawsonar->sample_type)); index += 4;
-	for (i=0;i<rawsonar->n;i++)
-		{
-		mb_get_binary_int(MB_YES, &buffer[index], &(rawsonar->spare[i])); index += 4;
-		}
-	for (i=0;i<rawsonar->n;i++)
-		{
-		mb_get_binary_int(MB_YES, &buffer[index], &(rawsonar->beam_index[i])); index += 4;
-		}
-	for (i=0;i<rawsonar->n;i++)
-		{
-		mb_get_binary_int(MB_YES, &buffer[index], &(rawsonar->detection_point[i])); index += 4;
-		}
-	for (i=0;i<rawsonar->n;i++)
-		{
-		mb_get_binary_float(MB_YES, &buffer[index], &(rawsonar->beam_angle[i])); index += 4;
-		}
-	rawdata_len = (size_t)(rawsonar->n * rawsonar->m);
-	if (rawsonar->rawdata_alloc < rawdata_len)
-		{
-		status = mb_reallocd(verbose, __FILE__, __LINE__, rawdata_len,
-						(void **)&(rawsonar->rawdata), error);
-		if (status != MB_SUCCESS)
-			rawsonar->rawdata_alloc = 0;
-		else
-			rawsonar->rawdata_alloc = rawdata_len;
-		}
-	memcpy(rawsonar->rawdata, &buffer[index], rawdata_len); index += rawdata_len;
-	mb_get_binary_int(MB_YES, &buffer[index], &(rawsonar->checksum)); index += 4;
-
-	/* set kind */
-	if (status == MB_SUCCESS)
-		{
-		/* set kind */
-		store->kind = MB_DATA_WATER_COLUMN;
-		}
-	else
-		{
-		store->kind = MB_DATA_NONE;
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       rawsonar->version:                    %u\n",rawsonar->version);
-		fprintf(stderr,"dbg5       rawsonar->msec:                       %f\n",rawsonar->msec);
-		fprintf(stderr,"dbg5       rawsonar->ping_number:                %u\n",rawsonar->ping_number);
-		fprintf(stderr,"dbg5       rawsonar->sample_rate:                %f\n",rawsonar->sample_rate);
-		fprintf(stderr,"dbg5       rawsonar->n:                          %u\n",rawsonar->n);
-		fprintf(stderr,"dbg5       rawsonar->m:                          %u\n",rawsonar->m);
-		fprintf(stderr,"dbg5       rawsonar->tx_power:                   %f\n",rawsonar->tx_power);
-		fprintf(stderr,"dbg5       rawsonar->pulse_width:                %f\n",rawsonar->pulse_width);
-		fprintf(stderr,"dbg5       rawsonar->sample_type:                %u\n",rawsonar->sample_type);
-		for (i=0;i<rawsonar->n;i++)
-			{
-			fprintf(stderr,"dbg5       rawsonar->spare[%3d]:                 %u\n",i,rawsonar->spare[i]);	
-			fprintf(stderr,"dbg5       rawsonar->beam_index[%3d]:            %u\n",i,rawsonar->beam_index[i]);	
-			fprintf(stderr,"dbg5       rawsonar->detection_point[%3d]:       %u\n",i,rawsonar->detection_point[i]);	
-			fprintf(stderr,"dbg5       rawsonar->beam_angle[%3d]:            %f\n",i,rawsonar->beam_angle[i]);	
-			}
-		fprintf(stderr,"dbg5       rawsonar->rawdata_alloc:              %zu\n",rawsonar->rawdata_alloc);
-		for (i=0;i<rawsonar->m;i++)
-		for (j=0;j<rawsonar->n;j++)
-			{
-			k = i * rawsonar->n + j;
-			fprintf(stderr,"dbg5       rawsonar->rawdata[%4d][%4d]:          %u\n",i,j,rawsonar->rawdata[k]);	
-			}
-		fprintf(stderr,"dbg5       rawsonar->checksum:                   %u\n",rawsonar->checksum);	
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_wasspenl_rd_gen_sens(int verbose, char *buffer, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_wasspenl_rd_gen_sens";
-	int	status = MB_SUCCESS;
-	struct mbsys_wassp_struct *store;
-        struct mbsys_wassp_gen_sens_struct *gen_sens;
-	int	index;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       buffer:     %p\n",(void *)buffer);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_wassp_struct *) store_ptr;
-	gen_sens = &(store->gen_sens);
-
-	/* extract the data */
-	index = 16;
-	mb_get_binary_int(MB_YES, &buffer[index], &(gen_sens->version)); index += 4;
-	mb_get_binary_double(MB_YES, &buffer[index], &(gen_sens->msec)); index += 8;
-	mb_get_binary_int(MB_YES, &buffer[index], &(gen_sens->port_number)); index += 4;
-	gen_sens->message_length = buffer[index]; index++;
-	memcpy(gen_sens->message, &buffer[index], (size_t)gen_sens->message_length); index += gen_sens->message_length;
-	mb_get_binary_int(MB_YES, &buffer[index], &(gen_sens->checksum)); index += 4;
-
-	/* set kind */
-	if (status == MB_SUCCESS)
-		{
-		/* set kind */
-		store->kind = MB_DATA_GEN_SENS;
-		}
-	else
-		{
-		store->kind = MB_DATA_NONE;
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       gen_sens->version:                    %u\n",gen_sens->version);
-		fprintf(stderr,"dbg5       gen_sens->msec:                       %f\n",gen_sens->msec);
-		fprintf(stderr,"dbg5       gen_sens->port_number:                %u\n",gen_sens->port_number);
-		fprintf(stderr,"dbg5       gen_sens->message_length:             %u\n",gen_sens->message_length);
-		fprintf(stderr,"dbg5       gen_sens->message:                    %s\n",gen_sens->message);
-		fprintf(stderr,"dbg5       gen_sens->checksum:                   %u\n",gen_sens->checksum);	
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-
-int mbr_wasspenl_rd_nvupdate(int verbose, char *buffer, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_wasspenl_rd_nvupdate";
-	int	status = MB_SUCCESS;
-	struct mbsys_wassp_struct *store;
-        struct mbsys_wassp_nvupdate_struct *nvupdate;
-	int	index;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       buffer:     %p\n",(void *)buffer);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_wassp_struct *) store_ptr;
-	nvupdate = &(store->nvupdate);
-
-	/* extract the data */
-	index = 16;
-	mb_get_binary_int(MB_YES, &buffer[index], &(nvupdate->version)); index += 4;
-	mb_get_binary_double(MB_YES, &buffer[index], &(nvupdate->latitude)); index += 8;
-	mb_get_binary_double(MB_YES, &buffer[index], &(nvupdate->longitude)); index += 8;
-	mb_get_binary_float(MB_YES, &buffer[index], &(nvupdate->sog)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(nvupdate->cog)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(nvupdate->heading)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(nvupdate->roll)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(nvupdate->pitch)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(nvupdate->heave)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(nvupdate->nadir_depth)); index += 4;
-	mb_get_binary_int(MB_YES, &buffer[index], &(nvupdate->checksum)); index += 4;
-
-	/* set kind */
-	if (status == MB_SUCCESS)
-		{
-		/* set kind */
-		store->kind = MB_DATA_NAV;
-		}
-	else
-		{
-		store->kind = MB_DATA_NONE;
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       nvupdate->version:                    %u\n",nvupdate->version);
-		fprintf(stderr,"dbg5       nvupdate->latitude:                   %f\n",nvupdate->latitude);
-		fprintf(stderr,"dbg5       nvupdate->longitude:                  %f\n",nvupdate->longitude);
-		fprintf(stderr,"dbg5       nvupdate->sog:                        %f\n",nvupdate->sog);
-		fprintf(stderr,"dbg5       nvupdate->cog:                        %f\n",nvupdate->cog);
-		fprintf(stderr,"dbg5       nvupdate->heading:                    %f\n",nvupdate->heading);
-		fprintf(stderr,"dbg5       nvupdate->roll:                       %f\n",nvupdate->roll);
-		fprintf(stderr,"dbg5       nvupdate->pitch:                      %f\n",nvupdate->pitch);
-		fprintf(stderr,"dbg5       nvupdate->heave:                      %f\n",nvupdate->heave);
-		fprintf(stderr,"dbg5       nvupdate->nadir_depth:                %f\n",nvupdate->nadir_depth);
-		fprintf(stderr,"dbg5       nvupdate->checksum:                   %u\n",nvupdate->checksum);	
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-
-int mbr_wasspenl_rd_wcd_navi(int verbose, char *buffer, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_wasspenl_rd_wcd_navi";
-	int	status = MB_SUCCESS;
-	struct mbsys_wassp_struct *store;
-        struct mbsys_wassp_wcd_navi_struct *wcd_navi;
-	int	index;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       buffer:     %p\n",(void *)buffer);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_wassp_struct *) store_ptr;
-	wcd_navi = &(store->wcd_navi);
-
-	/* extract the data */
-	index = 16;
-	mb_get_binary_int(MB_YES, &buffer[index], &(wcd_navi->version)); index += 4;
-	mb_get_binary_double(MB_YES, &buffer[index], &(wcd_navi->latitude)); index += 8;
-	mb_get_binary_double(MB_YES, &buffer[index], &(wcd_navi->longitude)); index += 8;
-	mb_get_binary_int(MB_YES, &buffer[index], &(wcd_navi->num_points)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(wcd_navi->bearing)); index += 4;
-	mb_get_binary_double(MB_YES, &buffer[index], &(wcd_navi->msec)); index += 8;
-	mb_get_binary_int(MB_YES, &buffer[index], &(wcd_navi->ping_number)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(wcd_navi->sample_rate)); index += 4;
-	if (wcd_navi->wcdata_alloc < wcd_navi->num_points)
-		{
-		status = mb_reallocd(verbose, __FILE__, __LINE__, wcd_navi->num_points * sizeof(float),
-						(void **)&(wcd_navi->wcdata_x), error);
-		status = mb_reallocd(verbose, __FILE__, __LINE__, wcd_navi->num_points * sizeof(float),
-						(void **)&(wcd_navi->wcdata_y), error);
-		status = mb_reallocd(verbose, __FILE__, __LINE__, wcd_navi->num_points * sizeof(float),
-						(void **)&(wcd_navi->wcdata_mag), error);
-		if (status != MB_SUCCESS)
-			wcd_navi->wcdata_alloc = 0;
-		else
-			wcd_navi->wcdata_alloc = wcd_navi->num_points;
-		}
-	for (i=0;i<wcd_navi->num_points;i++)
-		{
-		mb_get_binary_float(MB_YES, &buffer[index], &(wcd_navi->wcdata_x[i])); index += 4;
-		mb_get_binary_float(MB_YES, &buffer[index], &(wcd_navi->wcdata_y[i])); index += 4;
-		mb_get_binary_float(MB_YES, &buffer[index], &(wcd_navi->wcdata_mag[i])); index += 4;
-		}
-	mb_get_binary_int(MB_YES, &buffer[index], &(wcd_navi->checksum)); index += 4;
-
-	/* set kind */
-	if (status == MB_SUCCESS)
-		{
-		/* set kind */
-		store->kind = MB_DATA_WC_PICKS;
-		}
-	else
-		{
-		store->kind = MB_DATA_NONE;
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       wcd_navi->version:                    %u\n",wcd_navi->version);
-		fprintf(stderr,"dbg5       wcd_navi->latitude:                   %f\n",wcd_navi->latitude);
-		fprintf(stderr,"dbg5       wcd_navi->longitude:                  %f\n",wcd_navi->longitude);
-		fprintf(stderr,"dbg5       wcd_navi->num_points:                 %u\n",wcd_navi->num_points);
-		fprintf(stderr,"dbg5       wcd_navi->bearing:                    %f\n",wcd_navi->bearing);
-		fprintf(stderr,"dbg5       wcd_navi->msec:                       %f\n",wcd_navi->msec);
-		fprintf(stderr,"dbg5       wcd_navi->ping_number:                %u\n",wcd_navi->ping_number);
-		fprintf(stderr,"dbg5       wcd_navi->sample_type:                %f\n",wcd_navi->sample_rate);
-		for (i=0;i<wcd_navi->num_points;i++)
-			{
-			fprintf(stderr,"dbg5       wcd_navi->wcdata_x[%3d]:              %f\n",i,wcd_navi->wcdata_x[i]);	
-			fprintf(stderr,"dbg5       wcd_navi->wcdata_y[%3d]:              %f\n",i,wcd_navi->wcdata_y[i]);	
-			fprintf(stderr,"dbg5       wcd_navi->wcdata_mag[%3d]:            %f\n",i,wcd_navi->wcdata_mag[i]);	
-			}
-		fprintf(stderr,"dbg5       wcd_navi->checksum:                   %u\n",wcd_navi->checksum);	
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-
-int mbr_wasspenl_rd_sensprop(int verbose, char *buffer, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_wasspenl_rd_sensprop";
-	int	status = MB_SUCCESS;
-	struct mbsys_wassp_struct *store;
-        struct mbsys_wassp_sensprop_struct *sensprop;
-	int	index;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       buffer:     %p\n",(void *)buffer);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_wassp_struct *) store_ptr;
-	sensprop = &(store->sensprop);
-
-	/* extract the data */
-	index = 16;
-	mb_get_binary_int(MB_YES, &buffer[index], &(sensprop->version)); index += 4;
-	mb_get_binary_int(MB_YES, &buffer[index], &(sensprop->flags)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(sensprop->sea_level_reference)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(sensprop->element_spacing)); index += 4;
-	for (i=0;i<8;i++)
-		{
-		mb_get_binary_int(MB_YES, &buffer[index], &(sensprop->spare[i])); index += 4;
-		}
-	mb_get_binary_int(MB_YES, &buffer[index], &(sensprop->n)); index += 4;
-	if (sensprop->n_alloc < sensprop->n)
-		{
-		status = mb_reallocd(verbose, __FILE__, __LINE__, sensprop->n * sizeof(struct mbsys_wassp_sensor_struct),
-						(void **)&(sensprop->sensors), error);
-		if (status != MB_SUCCESS)
-			sensprop->n_alloc = 0;
-		else
-			sensprop->n_alloc = sensprop->n;
-		}
-	for (i=0;i<sensprop->n;i++)
-		{
-		mb_get_binary_int(MB_YES, &buffer[index], &(sensprop->sensors[i].sensor_type)); index += 4;
-		mb_get_binary_int(MB_YES, &buffer[index], &(sensprop->sensors[i].flags)); index += 4;
-		sensprop->sensors[i].port_number = buffer[index]; index++;
-		sensprop->sensors[i].device = buffer[index]; index++;
-		sensprop->sensors[i].sentence = buffer[index]; index++;
-		sensprop->sensors[i].sensor_model = buffer[index]; index++;
-		mb_get_binary_float(MB_YES, &buffer[index], &(sensprop->sensors[i].latency)); index += 4;
-		mb_get_binary_float(MB_YES, &buffer[index], &(sensprop->sensors[i].roll_bias)); index += 4;
-		mb_get_binary_float(MB_YES, &buffer[index], &(sensprop->sensors[i].pitch_bias)); index += 4;
-		mb_get_binary_float(MB_YES, &buffer[index], &(sensprop->sensors[i].yaw_bias)); index += 4;
-		mb_get_binary_float(MB_YES, &buffer[index], &(sensprop->sensors[i].offset_x)); index += 4;
-		mb_get_binary_float(MB_YES, &buffer[index], &(sensprop->sensors[i].offset_y)); index += 4;
-		mb_get_binary_float(MB_YES, &buffer[index], &(sensprop->sensors[i].offset_z)); index += 4;
-		}
-	mb_get_binary_int(MB_YES, &buffer[index], &(sensprop->checksum)); index += 4;
-
-	/* set kind */
-	if (status == MB_SUCCESS)
-		{
-		/* set kind */
-		store->kind = MB_DATA_SENSOR_PARAMETERS;
-		}
-	else
-		{
-		store->kind = MB_DATA_NONE;
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       sensprop->version:                    %u\n",sensprop->version);
-		fprintf(stderr,"dbg5       sensprop->flags:                      %u\n",sensprop->flags);
-		fprintf(stderr,"dbg5       sensprop->sea_level_reference:        %f\n",sensprop->sea_level_reference);
-		fprintf(stderr,"dbg5       sensprop->element_spacing:            %f\n",sensprop->element_spacing);
-		for (i=0;i<8;i++)
-			fprintf(stderr,"dbg5       sensprop->spare[%d]:                   %d\n",i,sensprop->spare[i]);
-		fprintf(stderr,"dbg5       sensprop->n:                          %d\n",sensprop->n);
-		for (i=0;i<sensprop->n;i++)
-			{
-			fprintf(stderr,"dbg5       sensprop->sensors[%d].sensor_type:    %u\n",i,sensprop->sensors[i].sensor_type);	
-			fprintf(stderr,"dbg5       sensprop->sensors[%d].flags:          %u\n",i,sensprop->sensors[i].flags);	
-			fprintf(stderr,"dbg5       sensprop->sensors[%d].port_number:    %u\n",i,sensprop->sensors[i].port_number);	
-			fprintf(stderr,"dbg5       sensprop->sensors[%d].device:         %u\n",i,sensprop->sensors[i].device);	
-			fprintf(stderr,"dbg5       sensprop->sensors[%d].sentence:       %u\n",i,sensprop->sensors[i].sentence);	
-			fprintf(stderr,"dbg5       sensprop->sensors[%d].sensor_model:   %u\n",i,sensprop->sensors[i].sensor_model);	
-			fprintf(stderr,"dbg5       sensprop->sensors[%d].latency:        %f\n",i,sensprop->sensors[i].latency);	
-			fprintf(stderr,"dbg5       sensprop->sensors[%d].roll_bias:      %f\n",i,sensprop->sensors[i].roll_bias);	
-			fprintf(stderr,"dbg5       sensprop->sensors[%d].pitch_bias:     %f\n",i,sensprop->sensors[i].pitch_bias);	
-			fprintf(stderr,"dbg5       sensprop->sensors[%d].yaw_bias:       %f\n",i,sensprop->sensors[i].yaw_bias);	
-			fprintf(stderr,"dbg5       sensprop->sensors[%d].offset_x:       %f\n",i,sensprop->sensors[i].offset_x);	
-			fprintf(stderr,"dbg5       sensprop->sensors[%d].offset_y:       %f\n",i,sensprop->sensors[i].offset_y);	
-			fprintf(stderr,"dbg5       sensprop->sensors[%d].offset_z:       %f\n",i,sensprop->sensors[i].offset_z);	
-			}
-		fprintf(stderr,"dbg5       sensprop->checksum:                   %u\n",sensprop->checksum);	
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-
-int mbr_wasspenl_rd_sys_prop(int verbose, char *buffer, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_wasspenl_rd_sys_prop";
-	int	status = MB_SUCCESS;
-	struct mbsys_wassp_struct *store;
-        struct mbsys_wassp_sys_prop_struct *sys_prop;
-	int	index;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       buffer:     %p\n",(void *)buffer);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_wassp_struct *) store_ptr;
-	sys_prop = &(store->sys_prop);
-
-	/* extract the data */
-	index = 16;
-	mb_get_binary_int(MB_YES, &buffer[index], &(sys_prop->version)); index += 4;
-	mb_get_binary_int(MB_YES, &buffer[index], &(sys_prop->product_type)); index += 4;
-	mb_get_binary_int(MB_YES, &buffer[index], &(sys_prop->protocol_version)); index += 4;
-	for (i=0;i<4;i++)
-		{
-		mb_get_binary_int(MB_YES, &buffer[index], &(sys_prop->sw_version[i])); index += 4;
-		}
-	mb_get_binary_int(MB_YES, &buffer[index], &(sys_prop->fw_version)); index += 4;
-	mb_get_binary_int(MB_YES, &buffer[index], &(sys_prop->hw_version)); index += 4;
-	mb_get_binary_int(MB_YES, &buffer[index], &(sys_prop->transducer_sn)); index += 4;
-	mb_get_binary_int(MB_YES, &buffer[index], &(sys_prop->transceiver_sn)); index += 4;
-	for (i=0;i<8;i++)
-		{
-		mb_get_binary_int(MB_YES, &buffer[index], &(sys_prop->spare[i])); index += 4;
-		}
-	mb_get_binary_int(MB_YES, &buffer[index], &(sys_prop->checksum)); index += 4;
-
-	/* set kind */
-	if (status == MB_SUCCESS)
-		{
-		/* set kind */
-		store->kind = MB_DATA_INSTALLATION;
-		}
-	else
-		{
-		store->kind = MB_DATA_NONE;
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       sys_prop->version:                    %u\n",sys_prop->version);
-		fprintf(stderr,"dbg5       sys_prop->product_type:               %u\n",sys_prop->product_type);
-		fprintf(stderr,"dbg5       sys_prop->protocol_version:           %u\n",sys_prop->protocol_version);
-		for (i=0;i<4;i++)
-			fprintf(stderr,"dbg5       sys_prop->sw_version[%d]:             %u\n",i,sys_prop->sw_version[i]);
-		fprintf(stderr,"dbg5       sys_prop->fw_version:                 %u\n",sys_prop->fw_version);
-		fprintf(stderr,"dbg5       sys_prop->hw_version:                 %u\n",sys_prop->hw_version);
-		fprintf(stderr,"dbg5       sys_prop->transducer_sn:              %u\n",sys_prop->transducer_sn);
-		fprintf(stderr,"dbg5       sys_prop->transceiver_sn:             %u\n",sys_prop->transceiver_sn);
-		for (i=0;i<8;i++)
-			fprintf(stderr,"dbg5       sys_prop->spare[%d]:                  %u\n",i,sys_prop->spare[i]);
-		fprintf(stderr,"dbg5       sys_prop->checksum:                   %u\n",sys_prop->checksum);	
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-
-int mbr_wasspenl_rd_sys_cfg1(int verbose, char *buffer, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_wasspenl_rd_sys_cfg1";
-	int	status = MB_SUCCESS;
-	struct mbsys_wassp_struct *store;
-        struct mbsys_wassp_sys_cfg1_struct *sys_cfg1;
-	int	index;
-	unsigned int size;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       buffer:     %p\n",(void *)buffer);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_wassp_struct *) store_ptr;
-	sys_cfg1 = &(store->sys_cfg1);
-	
-	/* get the size */
-	index = 4;
-	mb_get_binary_int(MB_YES, &buffer[index], &size);
-	sys_cfg1->sys_cfg1_len = size;
-
-	/* extract the data */
-	if (sys_cfg1->sys_cfg1_data_alloc < size)
-		{
-		status = mb_reallocd(verbose, __FILE__, __LINE__, (size_t)size,
-						(void **)&(sys_cfg1->sys_cfg1_data), error);
-		if (status != MB_SUCCESS)
-			sys_cfg1->sys_cfg1_data_alloc = 0;
-		else
-			sys_cfg1->sys_cfg1_data_alloc = size;
-		}
-	memcpy(sys_cfg1->sys_cfg1_data, buffer, (size_t)sys_cfg1->sys_cfg1_len);
-
-	/* set kind */
-	if (status == MB_SUCCESS)
-		{
-		/* set kind */
-		store->kind = MB_DATA_PARAMETER;
-		}
-	else
-		{
-		store->kind = MB_DATA_NONE;
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		for (i=0;i<sys_cfg1->sys_cfg1_len;i++)
-			{
-			fprintf(stderr,"dbg5       sys_cfg1->sys_cfg1_data[%3d]:           %u\n",i,sys_cfg1->sys_cfg1_data[i]);	
-			}
-		}
-
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-
-int mbr_wasspenl_rd_mcomment(int verbose, char *buffer, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_wasspenl_rd_mcomment";
-	int	status = MB_SUCCESS;
-	struct mbsys_wassp_struct *store;
-        struct mbsys_wassp_mcomment_struct *mcomment;
-	int	index;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       buffer:     %p\n",(void *)buffer);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_wassp_struct *) store_ptr;
-	mcomment = &(store->mcomment);
-
-	/* extract the data */
-	index = 16;
-	mb_get_binary_int(MB_YES, &buffer[index], &(mcomment->comment_length)); index += 4;
-	memcpy(mcomment->comment_message, &buffer[index], (size_t)mcomment->comment_length);
-
-	/* set kind */
-	if (status == MB_SUCCESS)
-		{
-		/* set kind */
-		store->kind = MB_DATA_COMMENT;
-		}
-	else
-		{
-		store->kind = MB_DATA_NONE;
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       mcomment->comment_length:             %u\n",mcomment->comment_length);
-		fprintf(stderr,"dbg5       mcomment->comment_message:            %s\n",mcomment->comment_message);
-		fprintf(stderr,"dbg5       mcomment->checksum:                   %u\n",mcomment->checksum);	
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-
-int mbr_wasspenl_rd_unknown1(int verbose, char *buffer, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_wasspenl_rd_unknown1";
-	int	status = MB_SUCCESS;
-	struct mbsys_wassp_struct *store;
-        struct mbsys_wassp_unknown1_struct *unknown1;
-	int	index;
-	unsigned int size;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       buffer:     %p\n",(void *)buffer);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_wassp_struct *) store_ptr;
-	unknown1 = &(store->unknown1);
-	
-	/* get the size */
-	index = 4;
-	mb_get_binary_int(MB_YES, &buffer[index], &size);
-	unknown1->unknown1_len = size;
-
-	/* extract the data */
-	if (unknown1->unknown1_data_alloc < size)
-		{
-		status = mb_reallocd(verbose, __FILE__, __LINE__, (size_t)size,
-						(void **)&(unknown1->unknown1_data), error);
-		if (status != MB_SUCCESS)
-			unknown1->unknown1_data_alloc = 0;
-		else
-			unknown1->unknown1_data_alloc = size;
-		}
-	memcpy(unknown1->unknown1_data, buffer, (size_t)unknown1->unknown1_len);
-
-	/* set kind */
-	if (status == MB_SUCCESS)
-		{
-		/* set kind */
-		store->kind = MB_DATA_RAW_LINE;
-		}
-	else
-		{
-		store->kind = MB_DATA_NONE;
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		for (i=0;i<unknown1->unknown1_len;i++)
-			{
-			fprintf(stderr,"dbg5       unknown1->unknown1_data[%3d]:           %u\n",i,unknown1->unknown1_data[i]);	
-			}
-		}
-
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_wasspenl_wr_genbathy(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error)
-{
-	char	*function_name = "mbr_wasspenl_wr_genbathy";
-	int	status = MB_SUCCESS;
-	struct mbsys_wassp_struct *store;
-        struct mbsys_wassp_genbathy_struct *genbathy;
-	char	*buffer;
-	int	index;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       bufferalloc:%d\n",*bufferalloc);
-		fprintf(stderr,"dbg2       bufferptr:  %p\n",(void *)bufferptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_wassp_struct *) store_ptr;
-	genbathy = &(store->genbathy);
-	genbathy->version = 3;
-	genbathy->checksum = 0x8806CBA5;
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       genbathy->version:                    %u\n",genbathy->version);
-		fprintf(stderr,"dbg5       genbathy->msec:                       %f\n",genbathy->msec);
-		fprintf(stderr,"dbg5       genbathy->day:                        %u\n",genbathy->day);
-		fprintf(stderr,"dbg5       genbathy->month:                      %u\n",genbathy->month);
-		fprintf(stderr,"dbg5       genbathy->year:                       %u\n",genbathy->year);
-		fprintf(stderr,"dbg5       genbathy->ping_number:                %u\n",genbathy->ping_number);
-		fprintf(stderr,"dbg5       genbathy->sonar_model:                %u\n",genbathy->sonar_model);
-		fprintf(stderr,"dbg5       genbathy->transducer_serial_number:   %lu\n",genbathy->transducer_serial_number);
-		fprintf(stderr,"dbg5       genbathy->number_beams:               %u\n",genbathy->number_beams);
-		fprintf(stderr,"dbg5       genbathy->modeflags:                  %u\n",genbathy->modeflags);
-		fprintf(stderr,"dbg5       genbathy->sampling_frequency:         %f\n",genbathy->sampling_frequency);
-		fprintf(stderr,"dbg5       genbathy->acoustic_frequency:         %f\n",genbathy->acoustic_frequency);
-		fprintf(stderr,"dbg5       genbathy->tx_power:                   %f\n",genbathy->tx_power);
-		fprintf(stderr,"dbg5       genbathy->pulse_width:                %f\n",genbathy->pulse_width);
-		fprintf(stderr,"dbg5       genbathy->absorption_loss:            %f\n",genbathy->absorption_loss);
-		fprintf(stderr,"dbg5       genbathy->spreading_loss:             %f\n",genbathy->spreading_loss);
-		fprintf(stderr,"dbg5       genbathy->sample_type:                %u\n",genbathy->sample_type);
-		fprintf(stderr,"dbg5       genbathy->sound_velocity:             %f\n",genbathy->sound_velocity);
-		for (i=0;i<genbathy->number_beams;i++)
-			{
-			fprintf(stderr,"dbg5       genbathy->detection_point[%3d]:       %f\n",i,genbathy->detection_point[i]);
-			fprintf(stderr,"dbg5       genbathy->rx_angle[%3d]:              %f\n",i,genbathy->rx_angle[i]);	
-			fprintf(stderr,"dbg5       genbathy->flags[%3d]:                 %u\n",i,genbathy->flags[i]);	
-			fprintf(stderr,"dbg5       genbathy->backscatter[%3d]:           %f\n",i,genbathy->backscatter[i]);
-			}
-		fprintf(stderr,"dbg5       genbathy->checksum:                   %u\n",genbathy->checksum);	
-		}
-
-	/* figure out size of output record */
-	*size = 92 + 16 * genbathy->number_beams;
-
-	/* allocate memory to write rest of record if necessary */
-	if (*bufferalloc < *size)
-		{
-		status = mb_reallocd(verbose, __FILE__, __LINE__, *size,
-					(void **)bufferptr, error);
-		if (status != MB_SUCCESS)
-			*bufferalloc = 0;
-		else
-			*bufferalloc = *size;
-		}
-
-	/* proceed to write if buffer allocated */
-	if (status == MB_SUCCESS)
-		{
-		/* get buffer for writing */
-		buffer = (char *) *bufferptr;
-
-		/* insert the data */
-		index = 0;
-		mb_put_binary_int(MB_YES, MBSYS_WASSP_SYNC, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, *size, &buffer[index]); index += 4;
-		strncpy(&buffer[index], "GENBATHY", 8); index += 8;
-		mb_put_binary_int(MB_YES, genbathy->version, &buffer[index]); index += 4;
-		mb_put_binary_double(MB_YES, genbathy->msec, &buffer[index]); index += 8;
-		buffer[index] = genbathy->day; index++;
-		buffer[index] = genbathy->month; index++;
-		mb_put_binary_short(MB_YES, genbathy->year, &buffer[index]); index += 2;
-		mb_put_binary_int(MB_YES, genbathy->ping_number, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, genbathy->sonar_model, &buffer[index]); index += 4;
-		mb_put_binary_long(MB_YES, genbathy->transducer_serial_number, &buffer[index]); index += 8;
-		mb_put_binary_int(MB_YES, genbathy->number_beams, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, genbathy->modeflags, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, genbathy->sampling_frequency, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, genbathy->acoustic_frequency, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, genbathy->tx_power, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, genbathy->pulse_width, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, genbathy->absorption_loss, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, genbathy->spreading_loss, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, genbathy->sample_type, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, genbathy->sound_velocity, &buffer[index]); index += 4;
-		for (i=0;i<genbathy->number_beams;i++)
-			{
-			mb_put_binary_float(MB_YES, genbathy->detection_point[i], &buffer[index]); index += 4;
-			mb_put_binary_float(MB_YES, genbathy->rx_angle[i], &buffer[index]); index += 4;
-			mb_put_binary_int(MB_YES, genbathy->flags[i], &buffer[index]); index += 4;
-			mb_put_binary_float(MB_YES, genbathy->backscatter[i], &buffer[index]); index += 4;
-			}
-
-		/* now add the checksum */
-		mb_put_binary_int(MB_YES, genbathy->checksum, &buffer[index]); index += 4;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_wasspenl_wr_corbathy(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error)
-{
-	char	*function_name = "mbr_wasspenl_wr_corbathy";
-	int	status = MB_SUCCESS;
-	struct mbsys_wassp_struct *store;
-        struct mbsys_wassp_corbathy_struct *corbathy;
-	char	*buffer;
-	int	index;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       bufferalloc:%d\n",*bufferalloc);
-		fprintf(stderr,"dbg2       bufferptr:  %p\n",(void *)bufferptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_wassp_struct *) store_ptr;
-	corbathy = &(store->corbathy);
-	corbathy->version = 4;
-	corbathy->checksum = 0x8806CBA5;
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       corbathy->version:                    %u\n",corbathy->version);
-		fprintf(stderr,"dbg5       corbathy->msec:                       %f\n",corbathy->msec);
-		fprintf(stderr,"dbg5       corbathy->num_beams:                  %u\n",corbathy->num_beams);
-		fprintf(stderr,"dbg5       corbathy->ping_number:                %u\n",corbathy->ping_number);
-		fprintf(stderr,"dbg5       corbathy->latitude:                   %f\n",corbathy->latitude);
-		fprintf(stderr,"dbg5       corbathy->longitude:                  %f\n",corbathy->longitude);
-		fprintf(stderr,"dbg5       corbathy->bearing:                    %f\n",corbathy->bearing);
-		fprintf(stderr,"dbg5       corbathy->roll:                       %f\n",corbathy->roll);
-		fprintf(stderr,"dbg5       corbathy->pitch:                      %f\n",corbathy->pitch);
-		fprintf(stderr,"dbg5       corbathy->heave:                      %f\n",corbathy->heave);
-		fprintf(stderr,"dbg5       corbathy->sample_type:                %u\n",corbathy->sample_type);
-		for (i=0;i<6;i++)
-			{
-			fprintf(stderr,"dbg5       corbathy->spare[%3d]:                 %u\n",i,corbathy->spare[i]);	
-			}
-		for (i=0;i<corbathy->num_beams;i++)
-			{
-			fprintf(stderr,"dbg5       corbathy->beam_index[%3d]:            %u\n",i,corbathy->beam_index[i]);	
-			fprintf(stderr,"dbg5       corbathy->x[%3d]:                     %f\n",i,corbathy->x[i]);
-			fprintf(stderr,"dbg5       corbathy->y[%3d]:                     %f\n",i,corbathy->y[i]);
-			fprintf(stderr,"dbg5       corbathy->z[%3d]:                     %f\n",i,corbathy->z[i]);
-			fprintf(stderr,"dbg5       corbathy->beam_angle[%3d]:            %f\n",i,corbathy->beam_angle[i]);	
-			fprintf(stderr,"dbg5       corbathy->backscatter[%3d]:           %f\n",i,corbathy->backscatter[i]);	
-			fprintf(stderr,"dbg5       corbathy->quality[%3d]:               %u\n",i,corbathy->quality[i]);	
-			fprintf(stderr,"dbg5       corbathy->fish[%3d]:                  %u\n",i,corbathy->fish[i]);	
-			fprintf(stderr,"dbg5       corbathy->roughness[%3d]:             %u\n",i,corbathy->roughness[i]);	
-			fprintf(stderr,"dbg5       corbathy->empty[%3d]:                 %u\n",i,corbathy->empty[i]);	
-			fprintf(stderr,"dbg5       corbathy->pad[%3d]:                   %u\n",i,corbathy->pad[i]);	
-			}
-		fprintf(stderr,"dbg5       corbathy->checksum:                   %u\n",corbathy->checksum);	
-		}
-
-	/* figure out size of output record */
-	*size = 100 + 32 * corbathy->num_beams;
-
-	/* allocate memory to write rest of record if necessary */
-	if (*bufferalloc < *size)
-		{
-		status = mb_reallocd(verbose, __FILE__, __LINE__, *size,
-					(void **)bufferptr, error);
-		if (status != MB_SUCCESS)
-			*bufferalloc = 0;
-		else
-			*bufferalloc = *size;
-		}
-
-	/* proceed to write if buffer allocated */
-	if (status == MB_SUCCESS)
-		{
-		/* get buffer for writing */
-		buffer = (char *) *bufferptr;
-
-		/* insert the data */
-		index = 0;
-		mb_put_binary_int(MB_YES, MBSYS_WASSP_SYNC, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, *size, &buffer[index]); index += 4;
-		strncpy(&buffer[index], "CORBATHY", 8); index += 8;
-		mb_put_binary_int(MB_YES, corbathy->version, &buffer[index]); index += 4;
-		mb_put_binary_double(MB_YES, corbathy->msec, &buffer[index]); index += 8;
-		mb_put_binary_int(MB_YES, corbathy->num_beams, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, corbathy->ping_number, &buffer[index]); index += 4;
-		mb_put_binary_double(MB_YES, corbathy->latitude, &buffer[index]); index += 8;
-		mb_put_binary_double(MB_YES, corbathy->longitude, &buffer[index]); index += 8;
-		mb_put_binary_float(MB_YES, corbathy->bearing, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, corbathy->roll, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, corbathy->pitch, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, corbathy->heave, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, corbathy->sample_type, &buffer[index]); index += 4;
-		for (i=0;i<6;i++)
-			{
-			mb_put_binary_int(MB_YES, corbathy->spare[i], &buffer[index]); index += 4;
-			}
-		for (i=0;i<corbathy->num_beams;i++)
-			{
-			mb_put_binary_int(MB_YES, corbathy->beam_index[i], &buffer[index]); index += 4;
-			mb_put_binary_float(MB_YES, corbathy->x[i], &buffer[index]); index += 4;
-			mb_put_binary_float(MB_YES, corbathy->y[i], &buffer[index]); index += 4;
-			mb_put_binary_float(MB_YES, corbathy->z[i], &buffer[index]); index += 4;
-			mb_put_binary_float(MB_YES, corbathy->beam_angle[i], &buffer[index]); index += 4;
-			mb_put_binary_float(MB_YES, corbathy->backscatter[i], &buffer[index]); index += 4;
-			buffer[index] = corbathy->quality[i]; index++;
-			buffer[index] = corbathy->fish[i]; index++;
-			buffer[index] = corbathy->roughness[i]; index++;
-			buffer[index] = corbathy->empty[i]; index++;
-			mb_put_binary_int(MB_YES, corbathy->pad[i], &buffer[index]); index += 4;
-			}
-
-		/* now add the checksum */
-		mb_put_binary_int(MB_YES, corbathy->checksum, &buffer[index]); index += 4;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_wasspenl_wr_rawsonar(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error)
-{
-	char	*function_name = "mbr_wasspenl_wr_rawsonar";
-	int	status = MB_SUCCESS;
-	struct mbsys_wassp_struct *store;
-        struct mbsys_wassp_rawsonar_struct *rawsonar;
-	char	*buffer;
-	int	index;
-	size_t	rawdata_len;
-	int	i, j, k;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       bufferalloc:%d\n",*bufferalloc);
-		fprintf(stderr,"dbg2       bufferptr:  %p\n",(void *)bufferptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_wassp_struct *) store_ptr;
-	rawsonar = &(store->rawsonar);
-	rawsonar->version = 2;
-	rawsonar->checksum = 0x8806CBA5;
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       rawsonar->version:                    %u\n",rawsonar->version);
-		fprintf(stderr,"dbg5       rawsonar->msec:                       %f\n",rawsonar->msec);
-		fprintf(stderr,"dbg5       rawsonar->ping_number:                %u\n",rawsonar->ping_number);
-		fprintf(stderr,"dbg5       rawsonar->sample_rate:                %f\n",rawsonar->sample_rate);
-		fprintf(stderr,"dbg5       rawsonar->n:                          %u\n",rawsonar->n);
-		fprintf(stderr,"dbg5       rawsonar->m:                          %u\n",rawsonar->m);
-		fprintf(stderr,"dbg5       rawsonar->tx_power:                   %f\n",rawsonar->tx_power);
-		fprintf(stderr,"dbg5       rawsonar->pulse_width:                %f\n",rawsonar->pulse_width);
-		fprintf(stderr,"dbg5       rawsonar->sample_type:                %u\n",rawsonar->sample_type);
-		for (i=0;i<rawsonar->n;i++)
-			{
-			fprintf(stderr,"dbg5       rawsonar->spare[%3d]:                 %u\n",i,rawsonar->spare[i]);	
-			fprintf(stderr,"dbg5       rawsonar->beam_index[%3d]:            %u\n",i,rawsonar->beam_index[i]);	
-			fprintf(stderr,"dbg5       rawsonar->detection_point[%3d]:       %u\n",i,rawsonar->detection_point[i]);	
-			fprintf(stderr,"dbg5       rawsonar->beam_angle[%3d]:            %f\n",i,rawsonar->beam_angle[i]);	
-			}
-		fprintf(stderr,"dbg5       rawsonar->rawdata_alloc:              %zu\n",rawsonar->rawdata_alloc);
-		for (i=0;i<rawsonar->m;i++)
-		for (j=0;j<rawsonar->n;j++)
-			{
-			k = i * rawsonar->n + j;
-			fprintf(stderr,"dbg5       rawsonar->rawdata[%4d][%4d]:          %u\n",i,j,rawsonar->rawdata[k]);	
-			}
-		fprintf(stderr,"dbg5       rawsonar->checksum:                   %u\n",rawsonar->checksum);	
-		}
-
-	/* figure out size of output record */
-	*size = 60 + 12 * rawsonar->n + 2 * rawsonar->m * rawsonar->n;
-
-	/* allocate memory to write rest of record if necessary */
-	if (*bufferalloc < *size)
-		{
-		status = mb_reallocd(verbose, __FILE__, __LINE__, *size,
-					(void **)bufferptr, error);
-		if (status != MB_SUCCESS)
-			*bufferalloc = 0;
-		else
-			*bufferalloc = *size;
-		}
-
-	/* proceed to write if buffer allocated */
-	if (status == MB_SUCCESS)
-		{
-		/* get buffer for writing */
-		buffer = (char *) *bufferptr;
-
-		/* insert the data */
-		index = 0;
-		mb_put_binary_int(MB_YES, MBSYS_WASSP_SYNC, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, *size, &buffer[index]); index += 4;
-		strncpy(&buffer[index], "RAWSONAR", 8); index += 8;
-		mb_put_binary_int(MB_YES, rawsonar->version, &buffer[index]); index += 4;
-		mb_put_binary_double(MB_YES, rawsonar->msec, &buffer[index]); index += 8;
-		mb_put_binary_int(MB_YES, rawsonar->ping_number, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, rawsonar->sample_rate, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, rawsonar->n, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, rawsonar->m, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, rawsonar->tx_power, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, rawsonar->pulse_width, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, rawsonar->sample_type, &buffer[index]); index += 4;
-		for (i=0;i<rawsonar->n;i++)
-			{
-			mb_put_binary_int(MB_YES, rawsonar->spare[i], &buffer[index]); index += 4;
-			}
-		for (i=0;i<rawsonar->n;i++)
-			{
-			mb_put_binary_int(MB_YES, rawsonar->beam_index[i], &buffer[index]); index += 4;
-			}
-		for (i=0;i<rawsonar->n;i++)
-			{
-			mb_put_binary_int(MB_YES, rawsonar->detection_point[i], &buffer[index]); index += 4;
-			}
-		for (i=0;i<rawsonar->n;i++)
-			{
-			mb_put_binary_float(MB_YES, rawsonar->beam_angle[i], &buffer[index]); index += 4;
-			}
-		rawdata_len = (size_t)(rawsonar->n * rawsonar->m);
-		memcpy(&buffer[index], rawsonar->rawdata, rawdata_len); index += rawdata_len;
-
-		/* now add the checksum */
-		mb_put_binary_int(MB_YES, rawsonar->checksum, &buffer[index]); index += 4;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_wasspenl_wr_gen_sens(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error)
-{
-	char	*function_name = "mbr_wasspenl_wr_gen_sens";
-	int	status = MB_SUCCESS;
-	struct mbsys_wassp_struct *store;
-        struct mbsys_wassp_gen_sens_struct *gen_sens;
-	char	*buffer;
-	int	index;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       bufferalloc:%d\n",*bufferalloc);
-		fprintf(stderr,"dbg2       bufferptr:  %p\n",(void *)bufferptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_wassp_struct *) store_ptr;
-	gen_sens = &(store->gen_sens);
-	gen_sens->version = 2;
-	gen_sens->checksum = 0x8806CBA5;
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       gen_sens->version:                    %u\n",gen_sens->version);
-		fprintf(stderr,"dbg5       gen_sens->msec:                       %f\n",gen_sens->msec);
-		fprintf(stderr,"dbg5       gen_sens->port_number:                %u\n",gen_sens->port_number);
-		fprintf(stderr,"dbg5       gen_sens->message_length:             %u\n",gen_sens->message_length);
-		fprintf(stderr,"dbg5       gen_sens->message:                    %s\n",gen_sens->message);
-		fprintf(stderr,"dbg5       gen_sens->checksum:                   %u\n",gen_sens->checksum);	
-		}
-
-	/* figure out size of output record */
-	*size = 33 + gen_sens->message_length;
-
-	/* allocate memory to write rest of record if necessary */
-	if (*bufferalloc < *size)
-		{
-		status = mb_reallocd(verbose, __FILE__, __LINE__, *size,
-					(void **)bufferptr, error);
-		if (status != MB_SUCCESS)
-			*bufferalloc = 0;
-		else
-			*bufferalloc = *size;
-		}
-
-	/* proceed to write if buffer allocated */
-	if (status == MB_SUCCESS)
-		{
-		/* get buffer for writing */
-		buffer = (char *) *bufferptr;
-
-		/* insert the data */
-		index = 0;
-		mb_put_binary_int(MB_YES, MBSYS_WASSP_SYNC, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, *size, &buffer[index]); index += 4;
-		strncpy(&buffer[index], "GEN_SENS", 8); index += 8;
-		mb_put_binary_int(MB_YES, gen_sens->version, &buffer[index]); index += 4;
-		mb_put_binary_double(MB_YES, gen_sens->msec, &buffer[index]); index += 8;
-		mb_put_binary_int(MB_YES, gen_sens->port_number, &buffer[index]); index += 4;
-		buffer[index] = gen_sens->message_length; index++;
-		memcpy(&buffer[index], gen_sens->message, (size_t)gen_sens->message_length); index += gen_sens->message_length;
-
-		/* now add the checksum */
-		mb_put_binary_int(MB_YES, gen_sens->checksum, &buffer[index]); index += 4;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-
-int mbr_wasspenl_wr_nvupdate(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error)
-{
-	char	*function_name = "mbr_wasspenl_wr_nvupdate";
-	int	status = MB_SUCCESS;
-	struct mbsys_wassp_struct *store;
-        struct mbsys_wassp_nvupdate_struct *nvupdate;
-	char	*buffer;
-	int	index;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       bufferalloc:%d\n",*bufferalloc);
-		fprintf(stderr,"dbg2       bufferptr:  %p\n",(void *)bufferptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_wassp_struct *) store_ptr;
-	nvupdate = &(store->nvupdate);
-	nvupdate->version = 4;
-	nvupdate->checksum = 0x8806CBA5;
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       nvupdate->version:                    %u\n",nvupdate->version);
-		fprintf(stderr,"dbg5       nvupdate->latitude:                   %f\n",nvupdate->latitude);
-		fprintf(stderr,"dbg5       nvupdate->longitude:                  %f\n",nvupdate->longitude);
-		fprintf(stderr,"dbg5       nvupdate->sog:                        %f\n",nvupdate->sog);
-		fprintf(stderr,"dbg5       nvupdate->cog:                        %f\n",nvupdate->cog);
-		fprintf(stderr,"dbg5       nvupdate->heading:                    %f\n",nvupdate->heading);
-		fprintf(stderr,"dbg5       nvupdate->roll:                       %f\n",nvupdate->roll);
-		fprintf(stderr,"dbg5       nvupdate->pitch:                      %f\n",nvupdate->pitch);
-		fprintf(stderr,"dbg5       nvupdate->heave:                      %f\n",nvupdate->heave);
-		fprintf(stderr,"dbg5       nvupdate->nadir_depth:                %f\n",nvupdate->nadir_depth);
-		fprintf(stderr,"dbg5       nvupdate->checksum:                   %u\n",nvupdate->checksum);	
-		}
-
-	/* figure out size of output record */
-	*size = 68;
-
-	/* allocate memory to write rest of record if necessary */
-	if (*bufferalloc < *size)
-		{
-		status = mb_reallocd(verbose, __FILE__, __LINE__, *size,
-					(void **)bufferptr, error);
-		if (status != MB_SUCCESS)
-			*bufferalloc = 0;
-		else
-			*bufferalloc = *size;
-		}
-
-	/* proceed to write if buffer allocated */
-	if (status == MB_SUCCESS)
-		{
-		/* get buffer for writing */
-		buffer = (char *) *bufferptr;
-
-		/* insert the data */
-		index = 0;
-		mb_put_binary_int(MB_YES, MBSYS_WASSP_SYNC, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, *size, &buffer[index]); index += 4;
-		strncpy(&buffer[index], "NVUPDATE", 8); index += 8;
-		mb_put_binary_int(MB_YES, nvupdate->version, &buffer[index]); index += 4;
-		mb_put_binary_double(MB_YES, nvupdate->latitude, &buffer[index]); index += 8;
-		mb_put_binary_double(MB_YES, nvupdate->longitude, &buffer[index]); index += 8;
-		mb_put_binary_float(MB_YES, nvupdate->sog, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, nvupdate->cog, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, nvupdate->heading, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, nvupdate->roll, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, nvupdate->pitch, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, nvupdate->heave, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, nvupdate->nadir_depth, &buffer[index]); index += 4;
-
-		/* now add the checksum */
-		mb_put_binary_int(MB_YES, nvupdate->checksum, &buffer[index]); index += 4;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-
-int mbr_wasspenl_wr_wcd_navi(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error)
-{
-	char	*function_name = "mbr_wasspenl_wr_wcd_navi";
-	int	status = MB_SUCCESS;
-	struct mbsys_wassp_struct *store;
-        struct mbsys_wassp_wcd_navi_struct *wcd_navi;
-	char	*buffer;
-	int	index;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       bufferalloc:%d\n",*bufferalloc);
-		fprintf(stderr,"dbg2       bufferptr:  %p\n",(void *)bufferptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_wassp_struct *) store_ptr;
-	wcd_navi = &(store->wcd_navi);
-	wcd_navi->version = 4;
-	wcd_navi->checksum = 0x8806CBA5;
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       wcd_navi->version:                    %u\n",wcd_navi->version);
-		fprintf(stderr,"dbg5       wcd_navi->latitude:                   %f\n",wcd_navi->latitude);
-		fprintf(stderr,"dbg5       wcd_navi->longitude:                  %f\n",wcd_navi->longitude);
-		fprintf(stderr,"dbg5       wcd_navi->num_points:                 %u\n",wcd_navi->num_points);
-		fprintf(stderr,"dbg5       wcd_navi->bearing:                    %f\n",wcd_navi->bearing);
-		fprintf(stderr,"dbg5       wcd_navi->msec:                       %f\n",wcd_navi->msec);
-		fprintf(stderr,"dbg5       wcd_navi->ping_number:                %u\n",wcd_navi->ping_number);
-		fprintf(stderr,"dbg5       wcd_navi->sample_type:                %f\n",wcd_navi->sample_rate);
-		for (i=0;i<wcd_navi->num_points;i++)
-			{
-			fprintf(stderr,"dbg5       wcd_navi->wcdata_x[%3d]:              %f\n",i,wcd_navi->wcdata_x[i]);	
-			fprintf(stderr,"dbg5       wcd_navi->wcdata_y[%3d]:              %f\n",i,wcd_navi->wcdata_y[i]);	
-			fprintf(stderr,"dbg5       wcd_navi->wcdata_mag[%3d]:            %f\n",i,wcd_navi->wcdata_mag[i]);	
-			}
-		fprintf(stderr,"dbg5       wcd_navi->checksum:                   %u\n",wcd_navi->checksum);	
-		}
-
-	/* figure out size of output record */
-	*size = 64 + 12 * wcd_navi->num_points;
-
-	/* allocate memory to write rest of record if necessary */
-	if (*bufferalloc < *size)
-		{
-		status = mb_reallocd(verbose, __FILE__, __LINE__, *size,
-					(void **)bufferptr, error);
-		if (status != MB_SUCCESS)
-			*bufferalloc = 0;
-		else
-			*bufferalloc = *size;
-		}
-
-	/* proceed to write if buffer allocated */
-	if (status == MB_SUCCESS)
-		{
-		/* get buffer for writing */
-		buffer = (char *) *bufferptr;
-
-		/* insert the data */
-		index = 0;
-		mb_put_binary_int(MB_YES, MBSYS_WASSP_SYNC, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, *size, &buffer[index]); index += 4;
-		strncpy(&buffer[index], "WCD_NAVI", 8); index += 8;
-		mb_put_binary_int(MB_YES, wcd_navi->version, &buffer[index]); index += 4;
-		mb_put_binary_double(MB_YES, wcd_navi->latitude, &buffer[index]); index += 8;
-		mb_put_binary_double(MB_YES, wcd_navi->longitude, &buffer[index]); index += 8;
-		mb_put_binary_int(MB_YES, wcd_navi->num_points, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, wcd_navi->bearing, &buffer[index]); index += 4;
-		mb_put_binary_double(MB_YES, wcd_navi->msec, &buffer[index]); index += 8;
-		mb_put_binary_int(MB_YES, wcd_navi->ping_number, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, wcd_navi->sample_rate, &buffer[index]); index += 4;
-		for (i=0;i<wcd_navi->num_points;i++)
-			{
-			mb_put_binary_float(MB_YES, wcd_navi->wcdata_x[i], &buffer[index]); index += 4;
-			mb_put_binary_float(MB_YES, wcd_navi->wcdata_y[i], &buffer[index]); index += 4;
-			mb_put_binary_float(MB_YES, wcd_navi->wcdata_mag[i], &buffer[index]); index += 4;
-			}
-
-		/* now add the checksum */
-		mb_put_binary_int(MB_YES, wcd_navi->checksum, &buffer[index]); index += 4;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-
-int mbr_wasspenl_wr_sensprop(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error)
-{
-	char	*function_name = "mbr_wasspenl_wr_sensprop";
-	int	status = MB_SUCCESS;
-	struct mbsys_wassp_struct *store;
-        struct mbsys_wassp_sensprop_struct *sensprop;
-	char	*buffer;
-	int	index;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       bufferalloc:%d\n",*bufferalloc);
-		fprintf(stderr,"dbg2       bufferptr:  %p\n",(void *)bufferptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_wassp_struct *) store_ptr;
-	sensprop = &(store->sensprop);
-	sensprop->version = 1;
-	sensprop->checksum = 0x8806CBA5;
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       sensprop->version:                    %u\n",sensprop->version);
-		fprintf(stderr,"dbg5       sensprop->flags:                      %u\n",sensprop->flags);
-		fprintf(stderr,"dbg5       sensprop->sea_level_reference:        %f\n",sensprop->sea_level_reference);
-		fprintf(stderr,"dbg5       sensprop->element_spacing:            %f\n",sensprop->element_spacing);
-		for (i=0;i<8;i++)
-			fprintf(stderr,"dbg5       sensprop->spare[%d]:                   %d\n",i,sensprop->spare[i]);
-		fprintf(stderr,"dbg5       sensprop->n:                          %d\n",sensprop->n);
-		for (i=0;i<sensprop->n;i++)
-			{
-			fprintf(stderr,"dbg5       sensprop->sensors[%d].sensor_type:    %u\n",i,sensprop->sensors[i].sensor_type);	
-			fprintf(stderr,"dbg5       sensprop->sensors[%d].flags:          %u\n",i,sensprop->sensors[i].flags);	
-			fprintf(stderr,"dbg5       sensprop->sensors[%d].port_number:    %u\n",i,sensprop->sensors[i].port_number);	
-			fprintf(stderr,"dbg5       sensprop->sensors[%d].device:         %u\n",i,sensprop->sensors[i].device);	
-			fprintf(stderr,"dbg5       sensprop->sensors[%d].sentence:       %u\n",i,sensprop->sensors[i].sentence);	
-			fprintf(stderr,"dbg5       sensprop->sensors[%d].sensor_model:   %u\n",i,sensprop->sensors[i].sensor_model);	
-			fprintf(stderr,"dbg5       sensprop->sensors[%d].latency:        %f\n",i,sensprop->sensors[i].latency);	
-			fprintf(stderr,"dbg5       sensprop->sensors[%d].roll_bias:      %f\n",i,sensprop->sensors[i].roll_bias);	
-			fprintf(stderr,"dbg5       sensprop->sensors[%d].pitch_bias:     %f\n",i,sensprop->sensors[i].pitch_bias);	
-			fprintf(stderr,"dbg5       sensprop->sensors[%d].yaw_bias:       %f\n",i,sensprop->sensors[i].yaw_bias);	
-			fprintf(stderr,"dbg5       sensprop->sensors[%d].offset_x:       %f\n",i,sensprop->sensors[i].offset_x);	
-			fprintf(stderr,"dbg5       sensprop->sensors[%d].offset_y:       %f\n",i,sensprop->sensors[i].offset_y);	
-			fprintf(stderr,"dbg5       sensprop->sensors[%d].offset_z:       %f\n",i,sensprop->sensors[i].offset_z);	
-			}
-		fprintf(stderr,"dbg5       sensprop->checksum:                   %u\n",sensprop->checksum);	
-		}
-
-	/* figure out size of output record */
-	*size = 72 + 40 * sensprop->n;
-
-	/* allocate memory to write rest of record if necessary */
-	if (*bufferalloc < *size)
-		{
-		status = mb_reallocd(verbose, __FILE__, __LINE__, *size,
-					(void **)bufferptr, error);
-		if (status != MB_SUCCESS)
-			*bufferalloc = 0;
-		else
-			*bufferalloc = *size;
-		}
-
-	/* proceed to write if buffer allocated */
-	if (status == MB_SUCCESS)
-		{
-		/* get buffer for writing */
-		buffer = (char *) *bufferptr;
-
-		/* insert the data */
-		index = 0;
-		mb_put_binary_int(MB_YES, MBSYS_WASSP_SYNC, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, *size, &buffer[index]); index += 4;
-		strncpy(&buffer[index], "SENSPROP", 8); index += 8;
-		mb_put_binary_int(MB_YES, sensprop->version, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, sensprop->flags, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, sensprop->sea_level_reference, &buffer[index]); index += 4;
-		mb_put_binary_float(MB_YES, sensprop->element_spacing, &buffer[index]); index += 4;
-		for (i=0;i<8;i++)
-			{
-			mb_put_binary_int(MB_YES, sensprop->spare[i], &buffer[index]); index += 4;
-			}
-		mb_put_binary_int(MB_YES, sensprop->n, &buffer[index]); index += 4;
-		for (i=0;i<sensprop->n;i++)
-			{
-			mb_put_binary_int(MB_YES, sensprop->sensors[i].sensor_type, &buffer[index]); index += 4;
-			mb_put_binary_int(MB_YES, sensprop->sensors[i].flags, &buffer[index]); index += 4;
-			buffer[index] = sensprop->sensors[i].port_number; index++;
-			buffer[index] = sensprop->sensors[i].device; index++;
-			buffer[index] = sensprop->sensors[i].sentence; index++;
-			buffer[index] = sensprop->sensors[i].sensor_model; index++;
-			mb_put_binary_float(MB_YES, sensprop->sensors[i].latency, &buffer[index]); index += 4;
-			mb_put_binary_float(MB_YES, sensprop->sensors[i].roll_bias, &buffer[index]); index += 4;
-			mb_put_binary_float(MB_YES, sensprop->sensors[i].pitch_bias, &buffer[index]); index += 4;
-			mb_put_binary_float(MB_YES, sensprop->sensors[i].yaw_bias, &buffer[index]); index += 4;
-			mb_put_binary_float(MB_YES, sensprop->sensors[i].offset_x, &buffer[index]); index += 4;
-			mb_put_binary_float(MB_YES, sensprop->sensors[i].offset_y, &buffer[index]); index += 4;
-			mb_put_binary_float(MB_YES, sensprop->sensors[i].offset_z, &buffer[index]); index += 4;
-			}
-
-		/* now add the checksum */
-		mb_put_binary_int(MB_YES, sensprop->checksum, &buffer[index]); index += 4;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-
-int mbr_wasspenl_wr_sys_prop(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error)
-{
-	char	*function_name = "mbr_wasspenl_wr_sys_prop";
-	int	status = MB_SUCCESS;
-	struct mbsys_wassp_struct *store;
-        struct mbsys_wassp_sys_prop_struct *sys_prop;
-	char	*buffer;
-	int	index;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       bufferalloc:%d\n",*bufferalloc);
-		fprintf(stderr,"dbg2       bufferptr:  %p\n",(void *)bufferptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_wassp_struct *) store_ptr;
-	sys_prop = &(store->sys_prop);
-	sys_prop->version = 1;
-	sys_prop->checksum = 0x8806CBA5;
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       sys_prop->version:                    %u\n",sys_prop->version);
-		fprintf(stderr,"dbg5       sys_prop->product_type:               %u\n",sys_prop->product_type);
-		fprintf(stderr,"dbg5       sys_prop->protocol_version:           %u\n",sys_prop->protocol_version);
-		for (i=0;i<4;i++)
-			fprintf(stderr,"dbg5       sys_prop->sw_version[%d]:             %u\n",i,sys_prop->sw_version[i]);
-		fprintf(stderr,"dbg5       sys_prop->fw_version:                 %u\n",sys_prop->fw_version);
-		fprintf(stderr,"dbg5       sys_prop->hw_version:                 %u\n",sys_prop->hw_version);
-		fprintf(stderr,"dbg5       sys_prop->transducer_sn:              %u\n",sys_prop->transducer_sn);
-		fprintf(stderr,"dbg5       sys_prop->transceiver_sn:             %u\n",sys_prop->transceiver_sn);
-		for (i=0;i<8;i++)
-			fprintf(stderr,"dbg5       sys_prop->spare[%d]:                  %u\n",i,sys_prop->spare[i]);
-		fprintf(stderr,"dbg5       sys_prop->checksum:                   %u\n",sys_prop->checksum);	
-		}
-
-	/* figure out size of output record */
-	*size = 96;
-
-	/* allocate memory to write rest of record if necessary */
-	if (*bufferalloc < *size)
-		{
-		status = mb_reallocd(verbose, __FILE__, __LINE__, *size,
-					(void **)bufferptr, error);
-		if (status != MB_SUCCESS)
-			*bufferalloc = 0;
-		else
-			*bufferalloc = *size;
-		}
-
-	/* proceed to write if buffer allocated */
-	if (status == MB_SUCCESS)
-		{
-		/* get buffer for writing */
-		buffer = (char *) *bufferptr;
-
-		/* insert the data */
-		index = 0;
-		mb_put_binary_int(MB_YES, MBSYS_WASSP_SYNC, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, *size, &buffer[index]); index += 4;
-		strncpy(&buffer[index], "SYS_PROP", 8); index += 8;
-		mb_put_binary_int(MB_YES, sys_prop->version, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, sys_prop->product_type, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, sys_prop->protocol_version, &buffer[index]); index += 4;
-		for (i=0;i<4;i++)
-			{
-			mb_put_binary_int(MB_YES, sys_prop->sw_version[i], &buffer[index]); index += 4;
-			}
-		mb_put_binary_int(MB_YES, sys_prop->fw_version, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, sys_prop->hw_version, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, sys_prop->transducer_sn, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, sys_prop->transceiver_sn, &buffer[index]); index += 4;
-		for (i=0;i<8;i++)
-			{
-			mb_put_binary_int(MB_YES, sys_prop->spare[i], &buffer[index]); index += 4;
-			}
-
-		/* now add the checksum */
-		mb_put_binary_int(MB_YES, sys_prop->checksum, &buffer[index]); index += 4;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-
-int mbr_wasspenl_wr_sys_cfg1(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error)
-{
-	char	*function_name = "mbr_wasspenl_wr_sys_cfg1";
-	int	status = MB_SUCCESS;
-	struct mbsys_wassp_struct *store;
-        struct mbsys_wassp_sys_cfg1_struct *sys_cfg1;
-	char	*buffer;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       bufferalloc:%d\n",*bufferalloc);
-		fprintf(stderr,"dbg2       bufferptr:  %p\n",(void *)bufferptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_wassp_struct *) store_ptr;
-	sys_cfg1 = &(store->sys_cfg1);
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		for (i=0;i<sys_cfg1->sys_cfg1_len;i++)
-			{
-			fprintf(stderr,"dbg5       sys_cfg1->sys_cfg1_data[%3d]:           %u\n",i,sys_cfg1->sys_cfg1_data[i]);	
-			}
-		}
-
-	/* figure out size of output record */
-	*size = sys_cfg1->sys_cfg1_len;
-
-	/* allocate memory to write rest of record if necessary */
-	if (*bufferalloc < *size)
-		{
-		status = mb_reallocd(verbose, __FILE__, __LINE__, *size,
-					(void **)bufferptr, error);
-		if (status != MB_SUCCESS)
-			*bufferalloc = 0;
-		else
-			*bufferalloc = *size;
-		}
-
-	/* proceed to write if buffer allocated */
-	if (status == MB_SUCCESS)
-		{
-		/* get buffer for writing */
-		buffer = (char *) *bufferptr;
-
-		/* insert the data */
-		memcpy(buffer, sys_cfg1->sys_cfg1_data, (size_t)sys_cfg1->sys_cfg1_len);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-
-int mbr_wasspenl_wr_mcomment(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error)
-{
-	char	*function_name = "mbr_wasspenl_wr_mcomment";
-	int	status = MB_SUCCESS;
-	struct mbsys_wassp_struct *store;
-        struct mbsys_wassp_mcomment_struct *mcomment;
-	char	*buffer;
-	int	index;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       bufferalloc:%d\n",*bufferalloc);
-		fprintf(stderr,"dbg2       bufferptr:  %p\n",(void *)bufferptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_wassp_struct *) store_ptr;
-	mcomment = &(store->mcomment);
-	mcomment->checksum = 0x8806CBA5;
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		fprintf(stderr,"dbg5       mcomment->comment_length:             %u\n",mcomment->comment_length);
-		fprintf(stderr,"dbg5       mcomment->comment_message:            %s\n",mcomment->comment_message);
-		fprintf(stderr,"dbg5       mcomment->checksum:                   %u\n",mcomment->checksum);	
-		}
-
-	/* figure out size of output record */
-	*size = 24 + mcomment->comment_length;
-
-	/* allocate memory to write rest of record if necessary */
-	if (*bufferalloc < *size)
-		{
-		status = mb_reallocd(verbose, __FILE__, __LINE__, *size,
-					(void **)bufferptr, error);
-		if (status != MB_SUCCESS)
-			*bufferalloc = 0;
-		else
-			*bufferalloc = *size;
-		}
-
-	/* proceed to write if buffer allocated */
-	if (status == MB_SUCCESS)
-		{
-		/* get buffer for writing */
-		buffer = (char *) *bufferptr;
-
-		/* insert the data */
-		index = 0;
-		mb_put_binary_int(MB_YES, MBSYS_WASSP_SYNC, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, *size, &buffer[index]); index += 4;
-		strncpy(&buffer[index], "MCOMMENT", 8); index += 8;
-		mb_put_binary_int(MB_YES, mcomment->comment_length, &buffer[index]); index += 4;
-		memcpy(&buffer[index], mcomment->comment_message, (size_t)mcomment->comment_length); index += mcomment->comment_length;
-
-		/* now add the checksum */
-		mb_put_binary_int(MB_YES, mcomment->checksum, &buffer[index]); index += 4;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-
-int mbr_wasspenl_wr_unknown1(int verbose, int *bufferalloc, char **bufferptr, void *store_ptr, int *size, int *error)
-{
-	char	*function_name = "mbr_wasspenl_wr_unknown1";
-	int	status = MB_SUCCESS;
-	struct mbsys_wassp_struct *store;
-        struct mbsys_wassp_unknown1_struct *unknown1;
-	char	*buffer;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       bufferalloc:%d\n",*bufferalloc);
-		fprintf(stderr,"dbg2       bufferptr:  %p\n",(void *)bufferptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_wassp_struct *) store_ptr;
-	unknown1 = &(store->unknown1);
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg5  Values to be written in MBIO function <%s>\n",function_name);
-		for (i=0;i<unknown1->unknown1_len;i++)
-			{
-			fprintf(stderr,"dbg5       unknown1->unknown1_data[%3d]:           %u\n",i,unknown1->unknown1_data[i]);	
-			}
-		}
-
-	/* figure out size of output record */
-	*size = unknown1->unknown1_len;
-
-	/* allocate memory to write rest of record if necessary */
-	if (*bufferalloc < *size)
-		{
-		status = mb_reallocd(verbose, __FILE__, __LINE__, *size,
-					(void **)bufferptr, error);
-		if (status != MB_SUCCESS)
-			*bufferalloc = 0;
-		else
-			*bufferalloc = *size;
-		}
-
-	/* proceed to write if buffer allocated */
-	if (status == MB_SUCCESS)
-		{
-		/* get buffer for writing */
-		buffer = (char *) *bufferptr;
-
-		/* insert the data */
-		memcpy(buffer, unknown1->unknown1_data, (size_t)unknown1->unknown1_len);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mbr_xtfb1624.c b/src/mbio/mbr_xtfb1624.c
deleted file mode 100644
index ac2e38d..0000000
--- a/src/mbio/mbr_xtfb1624.c
+++ /dev/null
@@ -1,2195 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbr_xtfb1624.c	3/29/2011
- *	$Id: mbr_xtfb1624.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 2012-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbr_xtfb1624.c contains the functions for reading and writing
- * sidescan data in the XTFSIS1624 format.
- * These functions include:
- *   mbr_alm_xtfb1624	- allocate read/write memory
- *   mbr_dem_xtfb1624	- deallocate read/write memory
- *   mbr_rt_xtfb1624	- read and translate data
- *   mbr_wt_xtfb1624	- translate and write data
- *
- * Author:	Jens Renken (MARUM/University of Bremen)
- * Date:	March 29, 2011
- *
- * Author:	D. W. Caress
- * Date:	2 May 2012 (when the code was brought into the MB-System archive as a read-only i/o module)
- *
- * $Log: $
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mb_define.h"
-#include "mbsys_benthos.h"
-
-/* turn on debug statements here */
-/* #define MBR_XTFB1624_DEBUG 1 */
-
-/* maximum number of beams and pixels */
-#define	MBF_XTFB1624_MAXBEAMS		1
-#define	MBF_XTFB1624_MAXRAWPIXELS	15360
-#define	MBF_XTFB1624_COMMENT_LENGTH	200
-#define	MBF_XTFB1624_MAXLINE		16384
-#define	MBF_XTFB1624_FILEHEADERLEN	1024
-#define XTF_MAGIC_NUMBER		0xFACE
-#define XTF_DATA_SIDESCAN		0
-#define XTF_DATA_ANNOTATION		1
-#define XTF_DATA_BATHYMETRY		2
-#define XTF_DATA_ATTITUDE		3
-#define XTF_DATA_POSITION		100
-#define XTF_HEADER_SONAR                     0 // sidescan and subbottom
-#define XTF_HEADER_NOTES                     1 // notes - text annotation
-#define XTF_HEADER_BATHY                     2 // bathymetry (Seabat, Odom)
-#define XTF_HEADER_ATTITUDE                  3 // TSS or MRU attitude (pitch, roll, heave, yaw)
-#define XTF_HEADER_FORWARD                   4 // forward-look sonar (polar display)
-#define XTF_HEADER_ELAC                      5 // Elac multibeam
-#define XTF_HEADER_RAW_SERIAL                6 // Raw data from serial port
-#define XTF_HEADER_EMBED_HEAD                7 // Embedded header structure
-#define XTF_HEADER_HIDDEN_SONAR              8 // hidden (non-displayable) ping
-#define XTF_HEADER_SEAVIEW_ANGLES            9 // Bathymetry (angles) for Seaview
-#define XTF_HEADER_SEAVIEW_DEPTHS           10 // Bathymetry from Seaview data (depths)
-#define XTF_HEADER_HIGHSPEED_SENSOR         11 // used by Klein (Cliff Chase) 0=roll, 1=yaw
-#define XTF_HEADER_ECHOSTRENGTH             12 // Elac EchoStrength (10 values)
-#define XTF_HEADER_GEOREC                   13 // Used to store mosaic params
-#define XTF_HEADER_K5000_BATHYMETRY         14 // Bathymetry data from the Klein 5000
-#define XTF_HEADER_HIGHSPEED_SENSOR2        15 // High speed sensor from Klein 5000
-#define XTF_HEADER_RAW_CUSTOM               199 // Raw Custom Header
-
-struct mbf_xtfb1624_xtfchaninfo
-	{
-	char		TypeOfChannel;
-	char		SubChannelNumber;
-	unsigned short	CorrectionFlags;
-	unsigned short	UniPolar;
-	unsigned short	BytesPerSample;
-	unsigned int	SamplesPerChannel;
-	char		ChannelName[16];
-	float		VoltScale;		/* maximum value (V) */
-	float		Frequency;		/* Hz */
-	float		HorizBeamAngle;		/* degrees */
-	float		TiltAngle;
-	float		BeamWidth;
-	float		OffsetX;
-	float		OffsetY;
-	float		OffsetZ;
-	float		OffsetYaw;
-	float		OffsetPitch;
-	float		OffsetRoll;
-	char		ReservedArea[56];
-	};
-
-struct mbf_xtfb1624_xtffileheader
-	{
-	char		FileFormat;		/* Set to 123 (0x7B */
-	char		SystemType;		/* Set to 1 */
-	char		RecordingProgramName[8];
-	char		RecordingProgramVersion[8];
-	char		SonarName[16];
-	unsigned short	SonarType;		/* 	0 = Reserved
-							1 = JAMSTEC
-							2 = Analog_c31
-							3 = SIS1000
-							4 = Analog_32chan
-							5 = Klein2000
-							6 = RWS
-							7 = DF1000
-							8 = SeaBat 9001
-							9 = Klein595
-							10 = EGG260
-							11 = Sonatech_DDS
-							12 = Echoscan
-							13 = Elac Bottomchart 1180
-							14 = Klein 5000
-							15 = Reson SeaBat 8101
-							16 = Imagenex model 858
-							17 = USN SILOS with 3-channel analog
-							18 = Sonatech super high res sidescan sonar
-							19 = Delph AU32 Analog input (2 channel)
-							20 = Generic sonar using the memory-mapped
-								file interface
-							21 = Simrad SM2000
-							22 = Standard multibedia audio
-							23 = Edgetech ACI card for 260 sonar throug PC31 card
-							24 = Edgetech black box
-							25 = Fugro deeptow
-							26 = C&C Edgetech chirp conversion program
-							27 = DTI SAS synthetic aperture processor (mmap file)
-							*/
-	char		NoteString[64];
-	char		ThisFileName[64];
-	unsigned short	NavUnits;		/* 0 = meters, 3 = degrees */
-	unsigned short	NumberOfSonarChannels;	/* if <= 6 use 1024 byte header,
-							if > 6 use 2048 byte header */
-	unsigned short	NumberOfBathymetryChannels;
-	unsigned short	Reserved1;
-	unsigned short	Reserved2;
-	unsigned short	Reserved3;
-	unsigned short	Reserved4;
-	unsigned short	Reserved5;
-	unsigned short	Reserved6;
-	char		ProjectionType[12];	/* not currently used */
-	char		SpheroidType[10];	/* not currently used */
-	int		NavigationLatency;	/* GPS_time_received - GPS_time_sent (msec) */
-	float		OriginY;		/* not currently used */
-	float		OriginX; 		/* not currently used */
-	float		NavOffsetY;		/* Multibeam nav offset (m) */
-	float		NavOffsetX;		/* Multibeam nav offset (m) */
-	float		NavOffsetZ; 		/* Multibeam nav z offset (m) */
-	float		NavOffsetYaw;		/* Multibeam heading offset (m) */
-	float		MRUOffsetY;		/* Multibeam MRU y offset (m) */
-	float		MRUOffsetX;		/* Multibeam MRU x offset (m) */
-	float		MRUOffsetZ; 		/* Multibeam MRU z offset (m) */
-	float		MRUOffsetYaw;		/* Multibeam MRU heading offset (m) */
-	float		MRUOffsetPitch; 	/* Multibeam MRU pitch offset (degrees) */
-	float		MRUOffsetRoll;		/* Multibeam MRU roll offset (degrees) */
-	struct mbf_xtfb1624_xtfchaninfo chaninfo[6];
-	};
-
-struct mbf_xtfpacketheader
-	{
-	mb_u_char	MagicNumber[2];		/* 0xFACE */
-	mb_u_char	HeaderType;		/* 0 = sonar ping, 1 = annotation, 2 = bathymetry, 3 = attitude */
-	mb_u_char	SubChannelNumber;	/* which multibeam head */
-	unsigned short	NumChansToFollow;	/* Number of beams to follow */
-	unsigned short	Reserved1[2];
-	unsigned int	NumBytesThisRecord;	/* total byte count including this header */
-	};
-
-struct mbf_xtfattitudeheader
-	{
-	struct mbf_xtfpacketheader packetheader;
-	unsigned int	Reserved2[4];
-	float		Pitch;
-	float		Roll;
-	float		Heave;
-	float		Yaw;
-	unsigned int	TimeTag;		/* time tag (msec) */
-	float		Heading;
-	char		Reserved3[10];
-	};
-
-struct mbf_xtfpingheader
-	{
-	struct mbf_xtfpacketheader packetheader;
-	unsigned short	Year;
-	mb_u_char	Month;
-	mb_u_char	Day;
-	mb_u_char	Hour;
-	mb_u_char	Minute;
-	mb_u_char	Second;
-	mb_u_char	HSeconds;
-	unsigned short	JulianDay;
-	unsigned short	CurrentLineID;
-	unsigned short	EventNumber;
-	unsigned int	PingNumber;
-	float		SoundVelocity;		/* Half sound speed (e.g. 750 m/sec instead of 1500 m/sec) */
-	float		OceanTide;		/* (m) */
-	unsigned int	Reserved2;
-	float		ConductivityFreq;	/* Raw CTD conductivity frequency (Hz) */
-	float		TemperatureFreq;	/* Raw CTD temperature frequency (Hz) */
-	float		PressureFreq;		/* Raw CTD pressure frequency (Hz) */
-	float		PressureTemp;		/* Raw CTD pressure temperature (deg C) */
-	float		Conductivity;		/* computed CTD conductivity (siemens/m) */
-	float		WaterTemperature;	/* computed CTD temperature (deg C) */
-	float		Pressure;		/* computed CTD water pressure (psia) */
-	float		ComputedSoundVelocity;	/* water sound velocity (m/sec) */
-	float		MagX;			/* X-axis magnetometer (mGauss) */
-	float		MagY;			/* Y-axis magnetometer (mGauss) */
-	float		MagZ;			/* Z-axis magnetometer (mGauss) */
-	float		AuxVal1;
-	float		AuxVal2;
-	float		AuxVal3;
-	float		AuxVal4;
-	float		AuxVal5;
-	float		AuxVal6;
-	float		SpeedLog;	/* towfish speed (kts) */
-	float		Turbidity;	/* turbity (0-5V * 10000) */
-	float		ShipSpeed;	/* ship speed (kts) */
-	float		ShipGyro;	/* ship heading (deg) */
-	double		ShipYcoordinate;/* ship latitude or northing */
-	double		ShipXcoordinate;/* ship longitude or easting */
-	short		ShipAltitude;	/* ship altitude (decimeters) */
-	short		ShipDepth;	/* ship depth (decimeters) */
-	mb_u_char	FixTimeHour;	/* last nav fix time (hour) */
-	mb_u_char	FixTimeMinute;	/* last nav fix time (min) */
-	mb_u_char	FixTimeSecond;	/* last nav fix time (sec) */
-	char		Reserved4;
-	float		SensorSpeed; 	/* towfish speed (kts) */
-	float		KP;		/* kilometers pipe (km) */
-	double		SensorYcoordinate; /* towfish latitude or northing */
-	double		SensorXcoordinate; /* towfish longitude or easting */
-	short		Reserved6;
-	short		RangeToSensor;	/* slant range to towfish * 10 */
-	short		BearingToSensor;/* bearing to towfish * 100 */
-	short		CableOut;	/* cable out (m) */
-	float		Layback;	/* distance from ship to sensor (m) */
-	float		CableTension;	/* cable tension */
-	float		SensorDepth;	/* towfish depth (m) */
-	float		SensorPrimaryAltitude; /* towfish altitude (m) */
-	float		SensorAuxAltitude; /* towfish altitude (m) */
-	float		SensorPitch;	/* sensor pitch (deg) */
-	float		SensorRoll;	/* sensor roll (deg) */
-	float		SensorHeading;	/* sensor heading (deg) */
-	float		Heave;		/* sensor heave (m) */
-	float		Yaw;		/* sensor yaw (deg) */
-	int		AttitudeTimeTag;/* time tag from MRU */
-	float		DOT;		/* distance off track */
-	char		ReservedSpace[20];
-	};
-
-struct mbf_xtfpingchanheader
-        {
-        unsigned short	ChannelNumber;	/* Typically,  */
-					/* 0=port (low frequency) */
-					/* 1=stbd (low frequency) */
-					/* 2=port (high frequency) */
-					/* 3=stbd (high frequency) */
-        unsigned short	DownsampleMethod;   /* 2=MAX, 4=RMS */
-        float		SlantRange;	/* Slant range of the data in meters */
-        float		GroundRange;	/* Ground range of the data in meters */
-                                             /*   (SlantRange^2 - Altitude^2) */
-        float		TimeDelay;	/* Amount of time (in seconds) to the start of recorded data */
-                                             /*   almost always 0.0 */
-        float		TimeDuration;	/* Amount of time (in seconds) recorded */
-        float		SecondsPerPing;	/* Amount of time (in seconds) from ping to ping */
-
-        unsigned short	ProcessingFlags;/* 4=TVG, 8=BAC&GAC, 16=Filter, etc... */
-                                             /*   almost always 0 */
-        unsigned short	Frequency;	/* Center transmit frequency for this channel. */
-                                             /*   when non-zero, replaces value found in file */
-                                             /*   header CHANINFO struct ChanInfo->SamplesPerChannel. */
-                                             /*   This allows samples per channel to change on the fly. */
-
-        unsigned short	InitialGainCode;/* Settings as transmitted by sonar */
-        unsigned short	GainCode;
-        unsigned short	BandWidth;
-
-        /* Contact information - updated when contacts are saved through Target.exe */
-        unsigned int		ContactNumber;
-        unsigned short	ContactClassification;
-        mb_u_char		ContactSubNumber;
-        mb_u_char		ContactType;
-
-
-        unsigned int		NumSamples;	/* Number of samples that will follow this structure.  The */
-                                             /* number of bytes will be this value multipied by the */
-                                             /* number of bytes per sample (given in the file header) */
-
-        unsigned short	Reserved;	/* Obsolete. */
-        float		ContactTimeOffTrack;	/* Time off track to this contact (stored in milliseconds) */
-        mb_u_char	ContactCloseNumber;
-        mb_u_char	Reserved2;
-
-        float		FixedVSOP;	/* Fixed along-track size of each ping, stored in cm. */
-                                             /*  on multibeam system with zero beam spread, this value */
-                                             /*  needs to be filled in to prevent Isis from calculating */
-                                             /*  along-track ground coverage based on beam spread and  */
-                                             /*  speed over ground.  In order for */
-                                             /* Target to use this number, "223" */
-                                             /* or later must be set in */
-                                             /* XTFFILEHEADER.RecordingProgramVersion */
-
-        mb_u_char	ReservedSpace[6];   /* reserved for future expansion */
-};
-
-struct mbf_xftnotesheader {
-	struct mbf_xtfpacketheader packetheader;
-	//
-	// Date and time of the annotation
-	//
-	unsigned short	Year;
-	mb_u_char	Month;
-	mb_u_char	Day;
-	mb_u_char	Hour;
-	mb_u_char	Minute;
-	mb_u_char	Second;
-	mb_u_char	HSeconds;
-
-	char  NotesText[256-56];
-};
-
-struct mbf_xtfrawcustomheader {
-	mb_u_char		MagicNumber[2];	/* 0xFACE */
-	mb_u_char		HeaderType;		/* 199 = XTFRAWCUSTOMHEADER*/
-	mb_u_char		ManufacturerID;	/* 1 = Benthos */
-	unsigned short 	SonarID;		/* 1624 = 1624	*/
-	unsigned short 	PacketID;	/* TBD */
-	unsigned short 	Reserved1[1];
-	unsigned int 	NumBytesThisRecord; // Total byte count for this update
-
-	unsigned short	Year;
-	mb_u_char	Month;
-	mb_u_char	Day;
-	mb_u_char	Hour;
-	mb_u_char	Minute;
-	mb_u_char	Second;
-	mb_u_char	HSeconds;
-
-	unsigned short JulianDay;
-	unsigned short Reserved2[2];
-	unsigned int   PingNumber;
-	unsigned int   TimeTag;
-	unsigned int   NumCustomerBytes;
-	mb_u_char Reserved3[24]; 		// Padding to make the structure 64 bytes
-};
-
-struct mbf_xtfb1624_struct
-	{
-	/* type of data record */
-	int	kind;			/* Data vs Comment */
-
-	/* type of sonar */
-	int	sonar;			/* Type of Benthos sonar */
-
-	/* xtf file header */
-	struct mbf_xtfb1624_xtffileheader fileheader;
-
-	/* xtf attitude record */
-	struct mbf_xtfattitudeheader attitudeheader;
-
-	/* xtf raw custom record */
-	struct mbf_xtfrawcustomheader rawcustomheader;
-
-	/* xtf Benthos sidescan ping record */
-	struct mbf_xtfpingheader pingheader;
-	struct mbf_xtfpingchanheader pingchanportheader;
-	unsigned short ssrawport[MBF_XTFB1624_MAXRAWPIXELS];
-	struct mbf_xtfpingchanheader pingchanstbdheader;
-	unsigned short ssrawstbd[MBF_XTFB1624_MAXRAWPIXELS];
-
-	/* comment */
-	char comment[MBF_XTFB1624_COMMENT_LENGTH];
-	};
-
-/* essential function prototypes */
-int mbr_register_xtfb1624(int verbose, void *mbio_ptr,
-		int *error);
-int mbr_info_xtfb1624(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_alm_xtfb1624(int verbose, void *mbio_ptr, int *error);
-int mbr_dem_xtfb1624(int verbose, void *mbio_ptr, int *error);
-int mbr_zero_xtfb1624(int verbose, char *data_ptr, int *error);
-int mbr_rt_xtfb1624(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_wt_xtfb1624(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_xtfb1624_rd_data(int verbose, void *mbio_ptr, int *error);
-
-static char rcs_id[]="$Id: mbr_xtfb1624.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mbr_register_xtfb1624(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_register_xtfb1624";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* get mb_io_ptr */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set format info parameters */
-	status = mbr_info_xtfb1624(verbose,
-			&mb_io_ptr->system,
-			&mb_io_ptr->beams_bath_max,
-			&mb_io_ptr->beams_amp_max,
-			&mb_io_ptr->pixels_ss_max,
-			mb_io_ptr->format_name,
-			mb_io_ptr->system_name,
-			mb_io_ptr->format_description,
-			&mb_io_ptr->numfile,
-			&mb_io_ptr->filetype,
-			&mb_io_ptr->variable_beams,
-			&mb_io_ptr->traveltime,
-			&mb_io_ptr->beam_flagging,
-			&mb_io_ptr->nav_source,
-			&mb_io_ptr->heading_source,
-			&mb_io_ptr->vru_source,
-			&mb_io_ptr->svp_source,
-			&mb_io_ptr->beamwidth_xtrack,
-			&mb_io_ptr->beamwidth_ltrack,
-			error);
-
-	/* set format and system specific function pointers */
-	mb_io_ptr->mb_io_format_alloc = &mbr_alm_xtfb1624;
-	mb_io_ptr->mb_io_format_free = &mbr_dem_xtfb1624;
-	mb_io_ptr->mb_io_store_alloc = &mbsys_benthos_alloc;
-	mb_io_ptr->mb_io_store_free = &mbsys_benthos_deall;
-	mb_io_ptr->mb_io_read_ping = &mbr_rt_xtfb1624;
-	mb_io_ptr->mb_io_write_ping = &mbr_wt_xtfb1624;
-	mb_io_ptr->mb_io_dimensions = &mbsys_benthos_dimensions;
-	mb_io_ptr->mb_io_extract = &mbsys_benthos_extract;
-	mb_io_ptr->mb_io_insert = &mbsys_benthos_insert;
-	mb_io_ptr->mb_io_extract_nav = &mbsys_benthos_extract_nav;
-	mb_io_ptr->mb_io_insert_nav = &mbsys_benthos_insert_nav;
-	mb_io_ptr->mb_io_extract_altitude = &mbsys_benthos_extract_altitude;
-	mb_io_ptr->mb_io_insert_altitude = NULL;
-	mb_io_ptr->mb_io_extract_svp = NULL;		// &mbsys_benthos_extract_svp;
-	mb_io_ptr->mb_io_insert_svp = NULL; 		// &mbsys_benthos_insert_svp;
-	mb_io_ptr->mb_io_ttimes = &mbsys_benthos_ttimes;
-	mb_io_ptr->mb_io_copyrecord = &mbsys_benthos_copy;
-	mb_io_ptr->mb_io_extract_rawss = NULL;
-	mb_io_ptr->mb_io_insert_rawss = NULL;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",mb_io_ptr->system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",mb_io_ptr->beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",mb_io_ptr->beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",mb_io_ptr->pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",mb_io_ptr->format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",mb_io_ptr->system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",mb_io_ptr->format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",mb_io_ptr->numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",mb_io_ptr->filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",mb_io_ptr->variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",mb_io_ptr->traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",mb_io_ptr->beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",mb_io_ptr->nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",mb_io_ptr->heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",mb_io_ptr->vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",mb_io_ptr->svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",mb_io_ptr->beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",mb_io_ptr->beamwidth_ltrack);
-		fprintf(stderr,"dbg2       format_alloc:       %p\n",(void *)mb_io_ptr->mb_io_format_alloc);
-		fprintf(stderr,"dbg2       format_free:        %p\n",(void *)mb_io_ptr->mb_io_format_free);
-		fprintf(stderr,"dbg2       store_alloc:        %p\n",(void *)mb_io_ptr->mb_io_store_alloc);
-		fprintf(stderr,"dbg2       store_free:         %p\n",(void *)mb_io_ptr->mb_io_store_free);
-		fprintf(stderr,"dbg2       read_ping:          %p\n",(void *)mb_io_ptr->mb_io_read_ping);
-		fprintf(stderr,"dbg2       write_ping:         %p\n",(void *)mb_io_ptr->mb_io_write_ping);
-		fprintf(stderr,"dbg2       extract:            %p\n",(void *)mb_io_ptr->mb_io_extract);
-		fprintf(stderr,"dbg2       insert:             %p\n",(void *)mb_io_ptr->mb_io_insert);
-		fprintf(stderr,"dbg2       extract_nav:        %p\n",(void *)mb_io_ptr->mb_io_extract_nav);
-		fprintf(stderr,"dbg2       insert_nav:         %p\n",(void *)mb_io_ptr->mb_io_insert_nav);
-		fprintf(stderr,"dbg2       extract_altitude:   %p\n",(void *)mb_io_ptr->mb_io_extract_altitude);
-		fprintf(stderr,"dbg2       insert_altitude:    %p\n",(void *)mb_io_ptr->mb_io_insert_altitude);
-		fprintf(stderr,"dbg2       extract_svp:        %p\n",(void *)mb_io_ptr->mb_io_extract_svp);
-		fprintf(stderr,"dbg2       insert_svp:         %p\n",(void *)mb_io_ptr->mb_io_insert_svp);
-		fprintf(stderr,"dbg2       ttimes:             %p\n",(void *)mb_io_ptr->mb_io_ttimes);
-		fprintf(stderr,"dbg2       extract_rawss:      %p\n",(void *)mb_io_ptr->mb_io_extract_rawss);
-		fprintf(stderr,"dbg2       insert_rawss:       %p\n",(void *)mb_io_ptr->mb_io_insert_rawss);
-		fprintf(stderr,"dbg2       copyrecord:         %p\n",(void *)mb_io_ptr->mb_io_copyrecord);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbr_info_xtfb1624(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error)
-{
-	char	*function_name = "mbr_info_xtfb1624";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* set format info parameters */
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-	*system = MB_SYS_BENTHOS;
-	*beams_bath_max = MBSYS_BENTHOS_MAXBEAMS;
-	*beams_amp_max = MBSYS_BENTHOS_MAXBEAMS;
-	*pixels_ss_max = MBSYS_BENTHOS_MAXPIXELS;
-	strncpy(format_name, "XTFB1624", MB_NAME_LENGTH);
-	strncpy(system_name, "BENTHOS", MB_NAME_LENGTH);
-	strncpy(format_description, "Format name:          MBF_XTFB1624\nInformal Description: XTF format Benthos Sidescan SIS1624\nAttributes:           variable pixels, dual frequency sidescan and subbottom,\n                      xtf variant, single files,\n                      low frequency sidescan returned as\n                      survey data, Benthos. \n", MB_DESCRIPTION_LENGTH);
-	*numfile = 1;
-	*filetype = MB_FILETYPE_NORMAL;
-	*variable_beams = MB_NO;
-	*traveltime = MB_NO;
-	*beam_flagging = MB_NO;
-	*nav_source = MB_DATA_DATA;
-	*heading_source = MB_DATA_DATA;
-	*vru_source = MB_DATA_DATA;
-	*svp_source = MB_DATA_VELOCITY_PROFILE;
-	*beamwidth_xtrack = 2.0;
-	*beamwidth_ltrack = 2.0;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",*system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",*beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",*beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",*pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",*numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",*filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",*variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",*traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",*beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",*nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",*heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",*vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",*svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",*beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",*beamwidth_ltrack);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_alm_xtfb1624(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_alm_xtfb1624";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	int	*fileheaderread;
-	double	*pixel_size;
-	double	*swath_width;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set initial status */
-	status = MB_SUCCESS;
-
-	/* allocate memory for data structure */
-	mb_io_ptr->structure_size = sizeof(struct mbf_xtfb1624_struct);
-	mb_io_ptr->data_structure_size = 0;
-	status = mb_malloc(verbose,mb_io_ptr->structure_size,
-				&mb_io_ptr->raw_data,error);
-	status = mb_malloc(verbose,sizeof(struct mbsys_benthos_struct),
-				&mb_io_ptr->store_data,error);
-
-	/* set saved flags */
-	fileheaderread = (int *) &(mb_io_ptr->save1);
-	pixel_size = &mb_io_ptr->saved1;
-	swath_width = &mb_io_ptr->saved2;
-	*fileheaderread = MB_NO;
-	*pixel_size = 0.0;
-	*swath_width = 0.0;
-
-	/* initialize everything to zeros */
-	mbr_zero_xtfb1624(verbose,mb_io_ptr->raw_data,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_dem_xtfb1624(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_dem_xtfb1624";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointers to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* deallocate memory for data descriptor */
-	status = mb_free(verbose,&mb_io_ptr->raw_data,error);
-	status = mb_free(verbose,&mb_io_ptr->store_data,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_zero_xtfb1624(int verbose, char *data_ptr, int *error)
-{
-	char	*function_name = "mbr_zero_xtfb1624";
-	int	status = MB_SUCCESS;
-	struct mbf_xtfb1624_struct *data;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       data_ptr:   %p\n",(void *)data_ptr);
-		}
-
-	/* get pointer to data descriptor */
-	data = (struct mbf_xtfb1624_struct *) data_ptr;
-
-	/* initialize everything to zeros */
-	if (data != NULL)
-		{
-		data->kind = MB_DATA_NONE;
-		data->sonar = MBSYS_BENTHOS_UNKNOWN;
-		}
-
-	/* assume success */
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_rt_xtfb1624(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_rt_xtfb1624";
-	int	status = MB_SUCCESS;
-
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_xtfb1624_struct *data;
-	struct mbsys_benthos_struct *store;
-	int	nchan;
-	int	time_i[7];
-	double	time_d, ntime_d, dtime;
-	double	*pixel_size, *swath_width;
-	int	badtime;
-	double	lon, lat;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointers to mbio descriptor and data structures */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-	data = (struct mbf_xtfb1624_struct *) mb_io_ptr->raw_data;
-	store = (struct mbsys_benthos_struct *) store_ptr;
-	pixel_size = (double *) &mb_io_ptr->saved1;
-	swath_width = (double *) &mb_io_ptr->saved2;
-
-	/* read next data from file */
-	status = mbr_xtfb1624_rd_data(verbose,mbio_ptr,error);
-
-	/* set error and kind in mb_io_ptr */
-	mb_io_ptr->new_error = *error;
-	mb_io_ptr->new_kind = data->kind;
-
-	/* handle navigation fix delay */
-	if (status == MB_SUCCESS && data->kind == MB_DATA_DATA)
-		{
-		/* get ping time */
-		time_i[0] = data->pingheader.Year;
-		time_i[1] = data->pingheader.Month;
-		time_i[2] = data->pingheader.Day;
-		time_i[3] = data->pingheader.Hour;
-		time_i[4] = data->pingheader.Minute;
-		time_i[5] = data->pingheader.Second;
-		time_i[6] = 10000 * data->pingheader.HSeconds;
-		mb_get_time(verbose, time_i, &time_d);
-
-		/* do check on time here - we sometimes get a bad fix */
-		badtime = MB_NO;
-		if (time_i[0] < 1970 && time_i[0] > 2100 ) badtime = MB_YES;
-		if (time_i[1] < 0 && time_i[1] > 12) badtime = MB_YES;
-		if (time_i[2] < 0 && time_i[2] > 31 ) badtime = MB_YES;
-		if (badtime == MB_YES)
-			{
-			if (verbose > 0)
-				fprintf(stderr," Bad time from XTF in ping header\n");
-			data->kind = MB_DATA_NONE;
-			status = MB_FAILURE;
-			*error = MB_ERROR_UNINTELLIGIBLE;
-			}
-
-		/* get nav time */
-		ntime_d = time_d;
-		/* Check if fixtime is valid */
-		if (data->pingheader.FixTimeHour || data->pingheader.FixTimeMinute
-										 || data->pingheader.FixTimeSecond) {
-			dtime = 3600.0 * (data->pingheader.FixTimeHour - data->pingheader.Hour)
-				+ 60.0 * (data->pingheader.FixTimeMinute - data->pingheader.Minute)
-				+ data->pingheader.FixTimeSecond - data->pingheader.Second
-				- 0.01 * data->pingheader.HSeconds;
-			if (data->pingheader.FixTimeHour - data->pingheader.Hour > 1)
-				dtime -= 3600.0 * 24;
-			ntime_d = time_d + dtime;
-		}
-		/* check for use of projected coordinates
-			XTF allows projected coordinates like UTM but the format spec
-			lists the projection specification values as unused!
-			Assume UTM zone 1N as we have to assume something */
-		if (mb_io_ptr->projection_initialized == MB_YES)
-			{
-			mb_proj_inverse(verbose, mb_io_ptr->pjptr,
-							data->pingheader.SensorXcoordinate,
-							data->pingheader.SensorYcoordinate,
-							&lon, &lat,
-							error);
-			}
-		else
-			{
-			lon = data->pingheader.SensorXcoordinate;
-			lat = data->pingheader.SensorYcoordinate;
-			}
-
-		/* add latest fix to list */
-		mb_navint_add(verbose, mbio_ptr, ntime_d, lon, lat, error);
-		}
-
-	/* translate values to benthos data storage structure */
-	if (status == MB_SUCCESS
-		&& store != NULL)
-		{
-		/* type of data record */
-		store->kind = data->kind;
-
-		/* type of sonar */
-		store->sonar = data->sonar;			/* Type of Reson sonar */
-
-		/* parameter info */
-		nchan = data->fileheader.NumberOfSonarChannels
-			+ data->fileheader.NumberOfBathymetryChannels;
-		for (i=0;i<nchan;i++)
-			{
-			if (data->fileheader.chaninfo[i].TypeOfChannel == 3)
-			    {
-			    store->MBOffsetX = data->fileheader.chaninfo[i].OffsetX;
-			    store->MBOffsetY = data->fileheader.chaninfo[i].OffsetY;
-			    store->MBOffsetZ = data->fileheader.chaninfo[i].OffsetZ;
-			    }
-			}
-		store->NavLatency = data->fileheader.NavigationLatency;		/* GPS_time_received - GPS_time_sent (sec) */
-		store->NavOffsetY = data->fileheader.NavOffsetY;		/* Nav offset (m) */
-		store->NavOffsetX = data->fileheader.NavOffsetX;		/* Nav offset (m) */
-		store->NavOffsetZ = data->fileheader.NavOffsetZ; 		/* Nav z offset (m) */
-		store->NavOffsetYaw = data->fileheader.NavOffsetZ;		/* Heading offset (m) */
-		store->MRUOffsetY = data->fileheader.MRUOffsetY;		/* Multibeam MRU y offset (m) */
-		store->MRUOffsetX = data->fileheader.MRUOffsetX;		/* Multibeam MRU x offset (m) */
-		store->MRUOffsetZ = data->fileheader.MRUOffsetZ; 		/* Multibeam MRU z offset (m) */
-		store->MRUOffsetPitch = data->fileheader.MRUOffsetPitch; 		/* Multibeam MRU pitch offset (degrees) */
-		store->MRUOffsetRoll = data->fileheader.MRUOffsetRoll;		/* Multibeam MRU roll offset (degrees) */
-
-		/* attitude data */
-		store->att_timetag = data->pingheader.AttitudeTimeTag;
-		store->att_heading = data->pingheader.SensorHeading;
-		store->att_heave = data->pingheader.Heave;
-		store->att_roll = data->pingheader.SensorRoll;
-		store->att_pitch = data->pingheader.SensorPitch;
-
-		/* comment */
-		for (i=0;i<MBSYS_BENTHOS_COMMENT_LENGTH;i++)
-			store->comment[i] = data->comment[i];
-
-		/* survey data */
-		time_i[0] = data->pingheader.Year;
-		time_i[1] = data->pingheader.Month;
-		time_i[2] = data->pingheader.Day;
-		time_i[3] = data->pingheader.Hour;
-		time_i[4] = data->pingheader.Minute;
-		time_i[5] = data->pingheader.Second;
-		time_i[6] = 10000 * data->pingheader.HSeconds;
-		mb_get_time(verbose, time_i,  &(store->png_time_d));
-		store->png_time_d -= store->png_latency;
-		store->png_longitude = data->pingheader.SensorXcoordinate;
-		store->png_latitude = data->pingheader.SensorYcoordinate;
-		store->png_speed = data->pingheader.SensorSpeed;
-
-		/* interpolate attitude if possible */
-		if (mb_io_ptr->nattitude > 1)
-		    {
-#ifdef JRBENTH
-                    /* time tag is on receive;  average reception is closer
-		    	to the midpoint of the two way travel time
-		        but will vary on beam angle and water depth
-		        set the receive time delay to the average
-			( 0 to 60 deg)  two way travel time for a seabed
-		        located at 80% of the maximum range
-		        Old code:
-		    timetag = 0.001 * data->bathheader.AttitudeTimeTag
-				    - store->png_latency
-				    + 2.0 * ((double)data->reson8100rit.range_set)
-					    / ((double)data->reson8100rit.velocity); */
-		    timetag = 0.001 * data->pingheader.AttitudeTimeTag
-				    - store->png_latency
-				    + 1.4*((double)data->reson8100rit.range_set)
-					    / ((double)data->reson8100rit.velocity);
-		    mb_attint_interp(verbose, mbio_ptr, timetag,
-			    &(store->png_heave), &(store->png_roll),
-			    &(store->png_pitch), error);
-		    mb_hedint_interp(verbose, mbio_ptr, timetag,
-			    &(store->png_heading), error);
-#ifdef MBR_XTFB1624_DEBUG
-			fprintf(stderr, "roll: %d %f %f %f %f   latency:%f time:%f %f roll:%f\n",
-			mb_io_ptr->nattitude,
-			mb_io_ptr->attitude_time_d[0],
-			mb_io_ptr->attitude_time_d[mb_io_ptr->nattitude-1],
-			mb_io_ptr->attitude_roll[0],
-			mb_io_ptr->attitude_roll[mb_io_ptr->nattitude-1],
-			store->png_latency, (double)(0.001 * data->pingheader.AttitudeTimeTag),
-			timetag, store->png_roll);
-#endif
-#endif
-		    }
-		else
-		    {
-		    store->png_roll = data->pingheader.SensorRoll;
-		    store->png_pitch = data->pingheader.SensorPitch;
-		    store->png_heading = data->pingheader.SensorHeading;
-		    store->png_heave = data->pingheader.Heave;
-		    }
-
-		/* interpolate nav if possible */
-		if (mb_io_ptr->nfix > 0)
-			{
-			mb_navint_interp(verbose, mbio_ptr, store->png_time_d, store->png_heading, 0.0,
-			    &(store->png_longitude), &(store->png_latitude), &(store->png_speed), error);
-
-			/* now deal with odd case where original nav is in eastings and northings
-				- since the projection is initialized, it will be applied when data
-				are extracted using mb_extract(), mb_extract_nav(), etc., so we have
-				to reproject the lon lat values to eastings northings for now */
-			if (mb_io_ptr->projection_initialized == MB_YES)
-				{
-				mb_proj_forward(verbose, mb_io_ptr->pjptr,
-							store->png_longitude, store->png_latitude,
-							&(store->png_longitude), &(store->png_latitude),
-							error);
-				}
-			}
-
-		store->png_rtsv = data->pingheader.SoundVelocity;
-		if (data->pingheader.ComputedSoundVelocity > 1000)
-			store->png_computedsv = data->pingheader.ComputedSoundVelocity;
-		else
-			store->png_computedsv = data->pingheader.SoundVelocity * 2.0;
-		store->png_pressure = data->pingheader.Pressure;
-		store->png_depth = data->pingheader.SensorDepth;
-
-#ifdef JRBENTH
-		store->ping_number = data->reson8100rit.ping_number;			/* sequential ping number from sonar startup/reset */
-		store->sonar_id = data->reson8100rit.sonar_id;				/* least significant four bytes of Ethernet address */
-		store->sonar_model = data->reson8100rit.sonar_model;			/* coded model number of sonar */
-		store->frequency = data->reson8100rit.frequency;			/* sonar frequency in KHz */
-		store->velocity = data->reson8100rit.velocity;         			/* programmed sound velocity (LSB = 1 m/sec) */
-		store->sample_rate = data->reson8100rit.sample_rate;      		/* A/D sample rate (samples per second) */
-		store->ping_rate = data->reson8100rit.ping_rate;        		/* Ping rate (pings per second * 1000) */
-		store->range_set = data->reson8100rit.range_set;        		/* range setting for SeaBat (meters ) */
-		store->power = data->reson8100rit.power;            			/* power setting for SeaBat  	 */
-											/* bits	0-4 -	power (0 - 8) */
-		store->gain = data->reson8100rit.gain;             			/* gain setting for SeaBat */
-											/* bits	0-6 -	gain (1 - 45) */
-											/* bit 	14	(0 = fixed, 1 = tvg) */
-											/* bit	15	(0 = manual, 1 = auto) */
-		store->pulse_width = data->reson8100rit.pulse_width;      		/* transmit pulse width (microseconds) */
-		store->tvg_spread = data->reson8100rit.tvg_spread;			/* spreading coefficient for tvg * 4  */
-											/* valid values = 0 to 240 (0.0 to 60.0 in 0.25 steps) */
-		store->tvg_absorp = data->reson8100rit.tvg_absorp;			/* absorption coefficient for tvg */
-		store->projector_type = data->reson8100rit.projector_type;      	/* bits 0-4 = projector type */
-							/* 0 = stick projector */
-							/* 1 = array face */
-							/* 2 = ER projector */
-							/* bit 7 - pitch steering (1=enabled, 0=disabled) */
-		store->projector_beam_width = data->reson8100rit.projector_beam_width;	/* along track transmit beam width (degrees * 10) */
-		store->beam_width_num = data->reson8100rit.beam_width_num;   	/* cross track receive beam width numerator */
-		store->beam_width_denom = data->reson8100rit.beam_width_denom; 	/* cross track receive beam width denominator */
-							/* beam width degrees = numerator / denominator */
-		store->projector_angle = data->reson8100rit.projector_angle;		/* projector pitch steering angle (degrees * 100) */
-		store->min_range = data->reson8100rit.min_range;		/* sonar filter settings */
-		store->max_range = data->reson8100rit.max_range;
-		store->min_depth = data->reson8100rit.min_depth;
-		store->max_depth = data->reson8100rit.max_depth;
-		store->filters_active = data->reson8100rit.filters_active;		/* range/depth filters active  */
-							/* bit 0 - range filter (0 = off, 1 = active) */
-							/* bit 1 - depth filter (0 = off, 1 = active) */
-		store->temperature = data->reson8100rit.temperature;		/* temperature at sonar head (deg C * 10) */
-		store->beam_count = data->reson8100rit.beam_count;       		/* number of sets of beam data in packet */
-		for (i=0;i<store->beam_count;i++)
-			store->range[i] = data->reson8100rit.range[i]; 		/* range for beam where n = Beam Count */
-							/* range units = sample cells * 4 */
-		for (i=0;i<store->beam_count/2+1;i++)
-			store->quality[i] = data->reson8100rit.quality[i];   		/* packed quality array (two 4 bit values/char) */
-							/* cnt = n/2 if beam count even, n/2+1 if odd */
-							/* cnt then rounded up to next even number */
-							/* e.g. if beam count=101, cnt=52  */
-							/* unused trailing quality values set to zero */
-							/* bit 0 - brightness test (0=failed, 1=passed) */
-							/* bit 1 - colinearity test (0=failed, 1=passed) */
-							/* bit 2 - amplitude bottom detect used */
-							/* bit 3 - phase bottom detect used */
-							/* bottom detect can be amplitude, phase or both */
-		intensity_max = 0;
-		for (i=0;i<store->beam_count;i++)
-			{
-			store->intensity[i] = data->reson8100rit.intensity[i];   		/* intensities at bottom detect  */
-			intensity_max = MAX(intensity_max, (int)store->intensity[i]);
-			}
-
-		store->beams_bath = data->reson8100rit.beam_count;
-		if (intensity_max > 0)
-			store->beams_amp = store->beams_bath;
-		else
-			store->beams_amp = 0;
-
-		/* ttscale in seconds per range count ( 4 counts per time interval) */
-		ttscale = 0.25 / store->sample_rate;
-		icenter = store->beams_bath / 2;
-		angscale = ((double)store->beam_width_num)
-			/ ((double)store->beam_width_denom);
-		for (i=0;i<store->beams_bath;i++)
-			{
-			/* get beamflag */
-			if (i % 2 == 0)
-				quality = ((store->quality[i/2]) & 15) & 3;
-			else
-				quality = ((store->quality[i/2] >> 4) & 15) & 3;
-			if (quality == 0)
-				store->beamflag[i] = MB_FLAG_NULL;
-			else if (quality < 3)
-				store->beamflag[i] = MB_FLAG_FLAG + MB_FLAG_SONAR;
-			else
-				store->beamflag[i] = MB_FLAG_NONE;
-
-			if (store->beamflag[i] == MB_FLAG_NULL)
-				{
-				store->bath[i] = 0.0;		/* bathymetry (m) */
-				store->bath_acrosstrack[i] = 0.0;/* acrosstrack distance (m) */
-				store->bath_alongtrack[i] = 0.0;	/* alongtrack distance (m) */
-				}
-			else
-				{
-				angle = 90.0 + (icenter - i) * angscale + store->png_roll;
-				mb_rollpitch_to_takeoff(
-					verbose,
-					store->png_pitch, angle,
-					&theta, &phi,
-					error);
-				rr = 0.5 * store->velocity * ttscale * store->range[i];
-				xx = rr * sin(DTR * theta);
-				zz = rr * cos(DTR * theta);
-				store->bath_acrosstrack[i]
-					= xx * cos(DTR * phi);
-				store->bath_alongtrack[i]
-					= xx * sin(DTR * phi);
-				store->bath[i] = zz - store->png_heave
-						+ store->MBOffsetZ;
-/*if (i==store->beams_bath/2 && timetag > 1.0)
-fprintf(stderr,"%f %f %f %f %f\n",timetag,zz,store->png_heave,lever_z,store->bath[i]);*/
-				}
-			}
-		gain_correction = 2.2 * (store->gain & 63) + 6 * store->power;
-		for (i=0;i<store->beams_amp;i++)
-			{
-			store->amp[i] = (double)(40.0 * log10(store->intensity[i])- gain_correction);
-			}
-#endif
-
-		store->beams_bath = 1;
-		store->bath[0] = data->pingheader.SensorPrimaryAltitude;		/* bathymetry (m) */
-
-		store->ssrawtimedelay = data->pingchanportheader.TimeDelay;
-		store->ssrawtimeduration = data->pingchanportheader.TimeDuration;
-		store->ssrawbottompick = data->pingheader.SensorPrimaryAltitude
-					    / data->pingheader.SoundVelocity;
-
-		store->ssrawslantrange = data->pingchanportheader.SlantRange;
-		store->ssrawgroundrange = data->pingchanportheader.GroundRange;
-		store->ssfrequency = data->pingchanportheader.Frequency;
-
-		store->ssportinitgain = data->pingchanportheader.InitialGainCode;
-		store->ssstbdinitgain = data->pingchanstbdheader.InitialGainCode;
-		store->ssportgain = data->pingchanportheader.GainCode;
-		store->ssstbdgain = data->pingchanstbdheader.GainCode;
-
-		store->ssrawportsamples = data->pingchanportheader.NumSamples;
-		store->ssrawstbdsamples = data->pingchanstbdheader.NumSamples;
-		for (i=0;i<store->ssrawportsamples;i++)
-		    store->ssrawport[i] = data->ssrawport[ /* store->ssrawportsamples - 1 -  */ i];
-		for (i=0;i<store->ssrawstbdsamples;i++)
-		    store->ssrawstbd[i] = data->ssrawstbd[i];
-
-		/* generate processed sidescan */
-		store->pixel_size = 0.0;
-		store->pixels_ss = store->ssrawportsamples + store->ssrawstbdsamples;
-		status = mbsys_benthos_makess(verbose,
-				mbio_ptr, store_ptr,
-				MB_NO, pixel_size,
-				MB_NO, swath_width,
-				error);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_wt_xtfb1624(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_wt_xtfb1624";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set error as this is a read only format */
-	status = MB_FAILURE;
-	*error = MB_ERROR_WRITE_FAIL;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_xtfb1624_rd_data(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_xtfb1624_rd_data";
-	int	status = MB_SUCCESS;
-
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_xtfb1624_struct *data;
-	char	line[MBF_XTFB1624_MAXLINE];
-	int	*fileheaderread;
-	struct mbf_xtfb1624_xtffileheader *fileheader;
-	struct mbf_xtfpacketheader packetheader;
-	struct mbf_xtfattitudeheader *attitudeheader;
-	struct mbf_xtfrawcustomheader *rawcustomheader;
-	struct mbf_xtfpingheader *pingheader;
-	struct mbf_xtfpingchanheader *pingchanportheader;
-	struct mbf_xtfpingchanheader *pingchanstbdheader;
-	int	index;
-	int	ichan;
-	int	done, found;
-	int	read_len, read_bytes;
-	int	skip;
-	mb_u_char *mb_u_char_ptr;
-	double	timetag, heave, roll, pitch, heading;
-	int	utm_zone;
-	char	projection[MB_NAME_LENGTH];
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set saved flags */
-	fileheaderread = (int *) &(mb_io_ptr->save1);
-	/* get pointer to raw data structure */
-	data = (struct mbf_xtfb1624_struct *) mb_io_ptr->raw_data;
-	fileheader = (struct mbf_xtfb1624_xtffileheader *) &(data->fileheader);
-	attitudeheader = (struct mbf_xtfattitudeheader *) &(data->attitudeheader);
-	rawcustomheader = (struct mbf_xtfrawcustomheader *) &(data->rawcustomheader);
-	pingheader = (struct mbf_xtfpingheader *) &(data->pingheader);
-	pingchanportheader = (struct mbf_xtfpingchanheader *) &(data->pingchanportheader);
-	pingchanstbdheader = (struct mbf_xtfpingchanheader *) &(data->pingchanstbdheader);
-
-	/* set file position */
-	mb_io_ptr->file_pos = mb_io_ptr->file_bytes;
-
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-
-	/* read file header if required */
-	if (*fileheaderread == MB_NO)
-	    {
-	    read_len = fread(line,1,MBF_XTFB1624_FILEHEADERLEN,mb_io_ptr->mbfp);
-	    if (read_len == MBF_XTFB1624_FILEHEADERLEN)
-		{
-		/* extract data from buffer */
-		*fileheaderread = MB_YES;
-		status = MB_SUCCESS;
-		index = 0;
-		fileheader->FileFormat = line[index];
-		index++;
-		fileheader->SystemType = line[index];
-		index++;
-		for (i=0;i<8;i++)
-			fileheader->RecordingProgramName[i] = line[index+i];
-		index += 8;
-		for (i=0;i<8;i++)
-			fileheader->RecordingProgramVersion[i] = line[index+i];
-		index += 8;
-		for (i=0;i<16;i++)
-			fileheader->SonarName[i] = line[index+i];
-		index += 16;
-		mb_get_binary_short(MB_YES, &line[index], (short int *)&(fileheader->SonarType));
-		index += 2;
-		for (i=0;i<64;i++)
-			fileheader->NoteString[i] = line[index+i];
-		index += 64;
-		for (i=0;i<64;i++)
-			fileheader->ThisFileName[i] = line[index+i];
-		index += 64;
-		mb_get_binary_short(MB_YES, &line[index], (short int *)&(fileheader->NavUnits));
-		index += 2;
-		mb_get_binary_short(MB_YES, &line[index], (short int *)&(fileheader->NumberOfSonarChannels));
-		index += 2;
-		mb_get_binary_short(MB_YES, &line[index], (short int *)&(fileheader->NumberOfBathymetryChannels));
-		index += 2;
-		mb_get_binary_short(MB_YES, &line[index], (short int *)&(fileheader->Reserved1));
-		index += 2;
-		mb_get_binary_short(MB_YES, &line[index], (short int *)&(fileheader->Reserved2));
-		index += 2;
-		mb_get_binary_short(MB_YES, &line[index], (short int *)&(fileheader->Reserved3));
-		index += 2;
-		mb_get_binary_short(MB_YES, &line[index], (short int *)&(fileheader->Reserved4));
-		index += 2;
-		mb_get_binary_short(MB_YES, &line[index], (short int *)&(fileheader->Reserved5));
-		index += 2;
-		mb_get_binary_short(MB_YES, &line[index], (short int *)&(fileheader->Reserved6));
-		index += 2;
-		for (i=0;i<12;i++)
-			fileheader->ProjectionType[i] = line[index+i];
-		index += 12;
-		for (i=0;i<10;i++)
-			fileheader->SpheroidType[i] = line[index+i];
-		index += 10;
-		mb_get_binary_int(MB_YES, &line[index], (int *)&(fileheader->NavigationLatency));
-		index += 4;
-		mb_get_binary_float(MB_YES, &line[index], &(fileheader->OriginY));
-		index += 4;
-		mb_get_binary_float(MB_YES, &line[index], &(fileheader->OriginX));
-		index += 4;
-		mb_get_binary_float(MB_YES, &line[index], &(fileheader->NavOffsetY));
-		index += 4;
-		mb_get_binary_float(MB_YES, &line[index], &(fileheader->NavOffsetX));
-		index += 4;
-		mb_get_binary_float(MB_YES, &line[index], &(fileheader->NavOffsetZ));
-		index += 4;
-		mb_get_binary_float(MB_YES, &line[index], &(fileheader->NavOffsetYaw));
-		index += 4;
-		mb_get_binary_float(MB_YES, &line[index], &(fileheader->MRUOffsetY));
-		index += 4;
-		mb_get_binary_float(MB_YES, &line[index], &(fileheader->MRUOffsetX));
-		index += 4;
-		mb_get_binary_float(MB_YES, &line[index], &(fileheader->MRUOffsetZ));
-		index += 4;
-		mb_get_binary_float(MB_YES, &line[index], &(fileheader->MRUOffsetYaw));
-		index += 4;
-		mb_get_binary_float(MB_YES, &line[index], &(fileheader->MRUOffsetPitch));
-		index += 4;
-		mb_get_binary_float(MB_YES, &line[index], &(fileheader->MRUOffsetRoll));
-		index += 4;
-		for (ichan=0;ichan<6;ichan++)
-			{
-			fileheader->chaninfo[ichan].TypeOfChannel = line[index];
-			index++;
-			fileheader->chaninfo[ichan].SubChannelNumber = line[index];
-			index++;
-			mb_get_binary_short(MB_YES, &line[index], (short int *)&(fileheader->chaninfo[ichan].CorrectionFlags));
-			index += 2;
-			mb_get_binary_short(MB_YES, &line[index], (short int *)&(fileheader->chaninfo[ichan].UniPolar));
-			index += 2;
-			mb_get_binary_short(MB_YES, &line[index], (short int *)&(fileheader->chaninfo[ichan].BytesPerSample));
-			index += 2;
-			mb_get_binary_int(MB_YES, &line[index], (int *)&(fileheader->chaninfo[ichan].SamplesPerChannel));
-			index += 4;
-			for (i=0;i<16;i++)
-				fileheader->chaninfo[ichan].ChannelName[i] = line[index+i];
-			index += 16;
-			mb_get_binary_float(MB_YES, &line[index], &(fileheader->chaninfo[ichan].VoltScale));
-			index += 4;
-			mb_get_binary_float(MB_YES, &line[index], &(fileheader->chaninfo[ichan].Frequency));
-			index += 4;
-			mb_get_binary_float(MB_YES, &line[index], &(fileheader->chaninfo[ichan].HorizBeamAngle));
-			index += 4;
-			mb_get_binary_float(MB_YES, &line[index], &(fileheader->chaninfo[ichan].TiltAngle));
-			index += 4;
-			mb_get_binary_float(MB_YES, &line[index], &(fileheader->chaninfo[ichan].BeamWidth));
-			index += 4;
-			mb_get_binary_float(MB_YES, &line[index], &(fileheader->chaninfo[ichan].OffsetX));
-			index += 4;
-			mb_get_binary_float(MB_YES, &line[index], &(fileheader->chaninfo[ichan].OffsetY));
-			index += 4;
-			mb_get_binary_float(MB_YES, &line[index], &(fileheader->chaninfo[ichan].OffsetZ));
-			index += 4;
-			mb_get_binary_float(MB_YES, &line[index], &(fileheader->chaninfo[ichan].OffsetYaw));
-			index += 4;
-			mb_get_binary_float(MB_YES, &line[index], &(fileheader->chaninfo[ichan].OffsetPitch));
-			index += 4;
-			mb_get_binary_float(MB_YES, &line[index], &(fileheader->chaninfo[ichan].OffsetRoll));
-			index += 4;
-			for (i=0;i<56;i++)
-				fileheader->chaninfo[ichan].ReservedArea[i] = line[index+i];
-			index += 56;
-			}
-
-		/* if NavUnits indicates use of projected coordinates (the format spec
-			indicates the projection parameters are unused!) assume UTM zone 1N
-			and set up the projection */
-		if (fileheader->NavUnits == 0 && mb_io_ptr->projection_initialized == MB_NO)
-			{
-			/* initialize UTM projection */
-			utm_zone = (int)(((RTD * 0.0 + 183.0)
-					/ 6.0) + 0.5);
-			sprintf(projection,"UTM%2.2dN", utm_zone);
-			mb_proj_init(verbose, projection, &(mb_io_ptr->pjptr), error);
-			mb_io_ptr->projection_initialized = MB_YES;
-			}
-
-		/* print debug statements */
-		if (verbose >= 5)
-			{
-			fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-			fprintf(stderr,"dbg5       FileFormat:                 %d\n",fileheader->FileFormat);
-			fprintf(stderr,"dbg5       SystemType:                 %d\n",fileheader->SystemType);
-			fprintf(stderr,"dbg5       RecordingProgramName:       %s\n",fileheader->RecordingProgramName);
-			fprintf(stderr,"dbg5       RecordingProgramVersion:    %s\n",fileheader->RecordingProgramVersion);
-			fprintf(stderr,"dbg5       SonarName:                  %s\n",fileheader->SonarName);
-			fprintf(stderr,"dbg5       SonarType:                  %d\n",fileheader->SonarType);
-			fprintf(stderr,"dbg5       NoteString:                 %s\n",fileheader->NoteString);
-			fprintf(stderr,"dbg5       ThisFileName:               %s\n",fileheader->ThisFileName);
-			fprintf(stderr,"dbg5       NavUnits:                   %d\n",fileheader->NavUnits);
-			fprintf(stderr,"dbg5       NumberOfSonarChannels:      %d\n",fileheader->NumberOfSonarChannels);
-			fprintf(stderr,"dbg5       NumberOfBathymetryChannels: %d\n",fileheader->NumberOfBathymetryChannels);
-			fprintf(stderr,"dbg5       Reserved1:                  %d\n",fileheader->Reserved1);
-			fprintf(stderr,"dbg5       Reserved2:                  %d\n",fileheader->Reserved2);
-			fprintf(stderr,"dbg5       Reserved3:                  %d\n",fileheader->Reserved3);
-			fprintf(stderr,"dbg5       Reserved4:                  %d\n",fileheader->Reserved4);
-			fprintf(stderr,"dbg5       Reserved5:                  %d\n",fileheader->Reserved5);
-			fprintf(stderr,"dbg5       Reserved6:                  %d\n",fileheader->Reserved6);
-			fprintf(stderr,"dbg5       ProjectionType:             %s\n",fileheader->ProjectionType);
-			fprintf(stderr,"dbg5       SpheroidType:               %s\n",fileheader->SpheroidType);
-			fprintf(stderr,"dbg5       NavigationLatency:          %d\n",fileheader->NavigationLatency);
-			fprintf(stderr,"dbg5       OriginY:                    %f\n",fileheader->OriginY);
-			fprintf(stderr,"dbg5       OriginX:                    %f\n",fileheader->OriginX);
-			fprintf(stderr,"dbg5       NavOffsetY:                 %f\n",fileheader->NavOffsetY);
-			fprintf(stderr,"dbg5       NavOffsetX:                 %f\n",fileheader->NavOffsetX);
-			fprintf(stderr,"dbg5       NavOffsetZ:                 %f\n",fileheader->NavOffsetZ);
-			fprintf(stderr,"dbg5       NavOffsetYaw:               %f\n",fileheader->NavOffsetYaw);
-			fprintf(stderr,"dbg5       MRUOffsetY:                 %f\n",fileheader->MRUOffsetY);
-			fprintf(stderr,"dbg5       MRUOffsetX:                 %f\n",fileheader->MRUOffsetX);
-			fprintf(stderr,"dbg5       MRUOffsetZ:                 %f\n",fileheader->MRUOffsetZ);
-			fprintf(stderr,"dbg5       MRUOffsetYaw:               %f\n",fileheader->MRUOffsetYaw);
-			fprintf(stderr,"dbg5       MRUOffsetPitch:             %f\n",fileheader->MRUOffsetPitch);
-			fprintf(stderr,"dbg5       MRUOffsetRoll:              %f\n",fileheader->MRUOffsetRoll);
-			for (i=0;i<fileheader->NumberOfSonarChannels
-				+ fileheader->NumberOfBathymetryChannels;i++)
-			    {
-			    fprintf(stderr,"dbg5       TypeOfChannel:              %d\n",fileheader->chaninfo[i].TypeOfChannel);
-			    fprintf(stderr,"dbg5       SubChannelNumber:           %d\n",fileheader->chaninfo[i].SubChannelNumber);
-			    fprintf(stderr,"dbg5       CorrectionFlags:            %d\n",fileheader->chaninfo[i].CorrectionFlags);
-			    fprintf(stderr,"dbg5       UniPolar:                   %d\n",fileheader->chaninfo[i].UniPolar);
-			    fprintf(stderr,"dbg5       BytesPerSample:             %d\n",fileheader->chaninfo[i].BytesPerSample);
-			    fprintf(stderr,"dbg5       SamplesPerChannel:          %d\n",fileheader->chaninfo[i].SamplesPerChannel);
-			    fprintf(stderr,"dbg5       ChannelName:                %s\n",fileheader->chaninfo[i].ChannelName);
-			    fprintf(stderr,"dbg5       VoltScale:                  %f\n",fileheader->chaninfo[i].VoltScale);
-			    fprintf(stderr,"dbg5       Frequency:                  %f\n",fileheader->chaninfo[i].Frequency);
-			    fprintf(stderr,"dbg5       HorizBeamAngle:             %f\n",fileheader->chaninfo[i].HorizBeamAngle);
-			    fprintf(stderr,"dbg5       TiltAngle:                  %f\n",fileheader->chaninfo[i].TiltAngle);
-			    fprintf(stderr,"dbg5       BeamWidth:                  %f\n",fileheader->chaninfo[i].BeamWidth);
-			    fprintf(stderr,"dbg5       OffsetX:                    %f\n",fileheader->chaninfo[i].OffsetX);
-			    fprintf(stderr,"dbg5       OffsetY:                    %f\n",fileheader->chaninfo[i].OffsetY);
-			    fprintf(stderr,"dbg5       OffsetZ:                    %f\n",fileheader->chaninfo[i].OffsetZ);
-			    fprintf(stderr,"dbg5       OffsetYaw:                  %f\n",fileheader->chaninfo[i].OffsetYaw);
-			    fprintf(stderr,"dbg5       OffsetPitch:                %f\n",fileheader->chaninfo[i].OffsetPitch);
-			    fprintf(stderr,"dbg5       OffsetRoll:                 %f\n",fileheader->chaninfo[i].OffsetRoll);
-			    fprintf(stderr,"dbg5       ReservedArea:               %s\n",fileheader->chaninfo[i].ReservedArea);
-			    }
-			}
-		}
-	    else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-	    }
-
-	/* look for next recognizable record */
-	done = MB_NO;
-	while (status == MB_SUCCESS && done == MB_NO)
-	    {
-	    /* find the next packet beginning */
-	    found = MB_NO;
-	    skip = 0;
-	    read_len = fread(line,1,2,mb_io_ptr->mbfp);
-	    if (read_len != 2)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-	    else if (((mb_u_char)line[0]) == 0xce && ((mb_u_char)line[1] == 0xfa))
-		found = MB_YES;
-	    while (status == MB_SUCCESS
-		&& found == MB_NO)
-		{
-		line[0] = line[1];
-		read_len = fread(&(line[1]),1,1,mb_io_ptr->mbfp);
-		skip++;
-		if (read_len != 1)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_EOF;
-			}
-		else if (((mb_u_char)line[0]) == 0xce && ((mb_u_char)line[1] == 0xfa))
-			found = MB_YES;
-		}
-
-	    /* read the next packet header */
-	    read_len = fread(&(line[2]),1,12,mb_io_ptr->mbfp);
-	    if (read_len == 12)
-		{
-		/* extract data from buffer */
-		index = 0;
-		packetheader.MagicNumber[0] = line[index];
-		index++;
-		packetheader.MagicNumber[1] = line[index];
-		index++;
-		packetheader.HeaderType = line[index];
-		index++;
-		packetheader.SubChannelNumber = line[index];
-		index++;
-		mb_get_binary_short(MB_YES, &line[index], (short int *)&(packetheader.NumChansToFollow));
-		index += 2;
-		mb_get_binary_short(MB_YES, &line[index], (short int *)&(packetheader.Reserved1[0]));
-		index += 2;
-		mb_get_binary_short(MB_YES, &line[index], (short int *)&(packetheader.Reserved1[1]));
-		index += 2;
-		mb_get_binary_int(MB_YES, &line[index], (int *)&(packetheader.NumBytesThisRecord));
-		index += 4;
-
-		/* check packet header details */
-		if( packetheader.NumChansToFollow > 20)
-			{
-			if (verbose > 0)
-				fprintf(stderr,"Bad packet header in xtf - skip this record\n");
-			packetheader.NumBytesThisRecord = 0;
-			packetheader.HeaderType = 99;
-			}
-
-		/* print debug statements */
-		if (verbose >= 5)
-			{
-			fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-			fprintf(stderr,"dbg5       Bytes Skipped:              %d\n",skip);
-			fprintf(stderr,"dbg5       MagicNumber:                %d %d %x%x\n",
-					packetheader.MagicNumber[0],packetheader.MagicNumber[1],
-					packetheader.MagicNumber[0],packetheader.MagicNumber[1]);
-			fprintf(stderr,"dbg5       HeaderType:                 %d\n",packetheader.HeaderType);
-			fprintf(stderr,"dbg5       SubChannelNumber:           %d\n",packetheader.SubChannelNumber);
-			fprintf(stderr,"dbg5       NumChansToFollow:           %d\n",packetheader.NumChansToFollow);
-			fprintf(stderr,"dbg5       Reserved1:                  %d %d\n",packetheader.Reserved1[0],packetheader.Reserved1[1]);
-			fprintf(stderr,"dbg5       NumBytesThisRecord:         %d\n",packetheader.NumBytesThisRecord);
-			}
-		}
-	    else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		done = MB_YES;
-		}
-
-	    /* read rest of attitude packet */
-	    if (status == MB_SUCCESS
-		&& packetheader.HeaderType == XTF_DATA_ATTITUDE
-		&& packetheader.NumBytesThisRecord == 64)
-		{
-#ifdef MBR_xtfb1624_DEBUG
-fprintf(stderr,"Reading attitude packet type:%d bytes:%d\n",
-packetheader.HeaderType,packetheader.NumBytesThisRecord);
-#endif
-		attitudeheader->packetheader = packetheader;
-		read_len = fread(line,1,50,mb_io_ptr->mbfp);
-		if (read_len == 50)
-		    {
-		    /* parse the rest of the attitude record */
-		    index = 0;
-		    for (i=0;i<4;i++)
-			{
-			mb_get_binary_int(MB_YES, &line[index], (int *)&(attitudeheader->Reserved2[i]));
-			index += 4;
-			}
-		    mb_get_binary_float(MB_YES, &line[index], &(attitudeheader->Pitch));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(attitudeheader->Roll));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(attitudeheader->Heave));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(attitudeheader->Yaw));
-		    index += 4;
-		    mb_get_binary_int(MB_YES, &line[index], (int *)&(attitudeheader->TimeTag));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(attitudeheader->Heading));
-		    index += 4;
-		    for (i=0;i<10;i++)
-			{
-			attitudeheader->Reserved3[i] = line[index];
-			index++;
-			}
-
-		    /* add attitude to list for interpolation */
-		    timetag = 0.001 *  attitudeheader->TimeTag;
-		    heave = attitudeheader->Heave;
-		    roll = attitudeheader->Roll;
-		    pitch = attitudeheader->Pitch;
-		    heading = attitudeheader->Heading;
-
-		    /* add latest attitude to list */
-		    mb_attint_add(verbose, mbio_ptr,
-				    timetag, heave, roll, pitch,
-				    error);
-		    mb_hedint_add(verbose, mbio_ptr,
-				    timetag, heading, error);
-
-		    /* print debug statements */
-		    if (verbose >= 5)
-			{
-			fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-			fprintf(stderr,"dbg5       MagicNumber:                %d %d %x%x\n",
-					attitudeheader->packetheader.MagicNumber[0],attitudeheader->packetheader.MagicNumber[1],
-					attitudeheader->packetheader.MagicNumber[0],attitudeheader->packetheader.MagicNumber[1]);
-			fprintf(stderr,"dbg5       HeaderType:                 %d\n",attitudeheader->packetheader.HeaderType);
-			fprintf(stderr,"dbg5       SubChannelNumber:           %d\n",attitudeheader->packetheader.SubChannelNumber);
-			fprintf(stderr,"dbg5       NumChansToFollow:           %d\n",attitudeheader->packetheader.NumChansToFollow);
-			fprintf(stderr,"dbg5       Reserved1:                  %d %d\n",attitudeheader->packetheader.Reserved1[0],attitudeheader->packetheader.Reserved1[1]);
-			fprintf(stderr,"dbg5       NumBytesThisRecord:         %d\n",attitudeheader->packetheader.NumBytesThisRecord);
-			fprintf(stderr,"dbg5       Reserved2[0]:               %d\n",attitudeheader->Reserved2[0]);
-			fprintf(stderr,"dbg5       Reserved2[1]:               %d\n",attitudeheader->Reserved2[1]);
-			fprintf(stderr,"dbg5       Reserved2[2]:               %d\n",attitudeheader->Reserved2[2]);
-			fprintf(stderr,"dbg5       Reserved2[3]:               %d\n",attitudeheader->Reserved2[3]);
-			fprintf(stderr,"dbg5       Pitch:                      %f\n",attitudeheader->Pitch);
-			fprintf(stderr,"dbg5       Roll:                       %f\n",attitudeheader->Roll);
-			fprintf(stderr,"dbg5       Heave:                      %f\n",attitudeheader->Heave);
-			fprintf(stderr,"dbg5       Yaw:                        %f\n",attitudeheader->Yaw);
-			fprintf(stderr,"dbg5       TimeTag:                    %d\n",attitudeheader->TimeTag);
-			fprintf(stderr,"dbg5       Heading:                    %f\n",attitudeheader->Heading);
-			}
-		    }
-		else
-		    {
-		    status = MB_FAILURE;
-		    *error = MB_ERROR_EOF;
-		    done = MB_YES;
-		    }
-		}
-
-	    /* read rest of sidescan packet */
-	    else if (status == MB_SUCCESS
-		&& packetheader.HeaderType == XTF_DATA_SIDESCAN)
-		{
-#ifdef MBR_xtfb1624_DEBUG
-fprintf(stderr,"Reading sidescan packet type:%d bytes:%d\n",
-packetheader.HeaderType,packetheader.NumBytesThisRecord);
-#endif
-		/* read and parse the the sidescan header */
-		data->kind = MB_DATA_DATA;
-		pingheader->packetheader = packetheader;
-		read_len = fread(line,1,242,mb_io_ptr->mbfp);
-		if (read_len == 242)
-		    {
-		    index = 0;
-		    mb_get_binary_short(MB_YES, &line[index], (short int *)&(pingheader->Year));
-		    index += 2;
-		    pingheader->Month = line[index];
-		    index++;
-		    pingheader->Day = line[index];
-		    index++;
-		    pingheader->Hour = line[index];
-		    index++;
-		    pingheader->Minute = line[index];
-		    index++;
-		    pingheader->Second = line[index];
-		    index++;
-		    pingheader->HSeconds = line[index];
-		    index++;
-		    mb_get_binary_short(MB_YES, &line[index], (short int *)&(pingheader->JulianDay));
-		    index += 2;
-		    mb_get_binary_short(MB_YES, &line[index], (short int *)&(pingheader->CurrentLineID));
-		    index += 2;
-		    mb_get_binary_short(MB_YES, &line[index], (short int *)&(pingheader->EventNumber));
-		    index += 2;
-		    mb_get_binary_int(MB_YES, &line[index], (int *)&(pingheader->PingNumber));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(pingheader->SoundVelocity));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(pingheader->OceanTide));
-		    index += 4;
-		    mb_get_binary_int(MB_YES, &line[index], (int *)&(pingheader->Reserved2));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(pingheader->ConductivityFreq));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(pingheader->TemperatureFreq));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(pingheader->PressureFreq));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(pingheader->PressureTemp));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(pingheader->Conductivity));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(pingheader->WaterTemperature));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(pingheader->Pressure));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(pingheader->ComputedSoundVelocity));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(pingheader->MagX));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(pingheader->MagY));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(pingheader->MagZ));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(pingheader->AuxVal1));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(pingheader->AuxVal2));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(pingheader->AuxVal3));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(pingheader->AuxVal4));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(pingheader->AuxVal5));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(pingheader->AuxVal6));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(pingheader->SpeedLog));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(pingheader->Turbidity));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(pingheader->ShipSpeed));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(pingheader->ShipGyro));
-		    index += 4;
-		    mb_get_binary_double(MB_YES, &line[index], &(pingheader->ShipYcoordinate));
-		    index += 8;
-		    mb_get_binary_double(MB_YES, &line[index], &(pingheader->ShipXcoordinate));
-		    index += 8;
-		    mb_get_binary_short(MB_YES, &line[index], (short int *)&(pingheader->ShipAltitude));
-		    index += 2;
-		    mb_get_binary_short(MB_YES, &line[index], (short int *)&(pingheader->ShipDepth));
-		    index += 2;
-		    pingheader->FixTimeHour = line[index];
-		    index++;
-		    pingheader->FixTimeMinute = line[index];
-		    index++;
-		    pingheader->FixTimeSecond = line[index];
-		    index++;
-		    pingheader->Reserved4 = line[index];
-		    index++;
-		    mb_get_binary_float(MB_YES, &line[index], &(pingheader->SensorSpeed));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(pingheader->KP));
-		    index += 4;
-		    mb_get_binary_double(MB_YES, &line[index], &(pingheader->SensorYcoordinate));
-		    index += 8;
-		    mb_get_binary_double(MB_YES, &line[index], &(pingheader->SensorXcoordinate));
-		    index += 8;
-		    mb_get_binary_short(MB_YES, &line[index], &(pingheader->Reserved6));
-		    index += 2;
-		    mb_get_binary_short(MB_YES, &line[index], &(pingheader->RangeToSensor));
-		    index += 2;
-		    mb_get_binary_short(MB_YES, &line[index], &(pingheader->BearingToSensor));
-		    index += 2;
-		    mb_get_binary_short(MB_YES, &line[index], &(pingheader->CableOut));
-		    index += 2;
-		    mb_get_binary_float(MB_YES, &line[index], &(pingheader->Layback));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(pingheader->CableTension));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(pingheader->SensorDepth));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(pingheader->SensorPrimaryAltitude));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(pingheader->SensorAuxAltitude));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(pingheader->SensorPitch));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(pingheader->SensorRoll));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(pingheader->SensorHeading));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(pingheader->Heave));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(pingheader->Yaw));
-		    index += 4;
-		    mb_get_binary_int(MB_YES, &line[index], &(pingheader->AttitudeTimeTag));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(pingheader->DOT));
-		    index += 4;
-		    for (i=0;i<20;i++)
-			{
-			pingheader->ReservedSpace[i] = line[index];
-			index++;
-			}
-		    }
-		else
-		    {
-		    status = MB_FAILURE;
-		    *error = MB_ERROR_EOF;
-		    done = MB_YES;
-		    }
-
-		/* read and parse the port sidescan channel header */
-		if (status == MB_SUCCESS)
-		    read_len = fread(line,1,64,mb_io_ptr->mbfp);
-		if (status == MB_SUCCESS && read_len == 64)
-		    {
-		    index = 0;
-		    mb_get_binary_short(MB_YES, &line[index], (short int *)&(pingchanportheader->ChannelNumber));
-		    index += 2;
-		    mb_get_binary_short(MB_YES, &line[index], (short int *)&(pingchanportheader->DownsampleMethod));
-		    index += 2;
-		    mb_get_binary_float(MB_YES, &line[index], &(pingchanportheader->SlantRange));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(pingchanportheader->GroundRange));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(pingchanportheader->TimeDelay));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(pingchanportheader->TimeDuration));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(pingchanportheader->SecondsPerPing));
-		    index += 4;
-		    mb_get_binary_short(MB_YES, &line[index], (short int *)&(pingchanportheader->ProcessingFlags));
-		    index += 2;
-		    mb_get_binary_short(MB_YES, &line[index], (short int *)&(pingchanportheader->Frequency));
-		    index += 2;
-		    mb_get_binary_short(MB_YES, &line[index], (short int *)&(pingchanportheader->InitialGainCode));
-		    index += 2;
-		    mb_get_binary_short(MB_YES, &line[index], (short int *)&(pingchanportheader->GainCode));
-		    index += 2;
-		    mb_get_binary_short(MB_YES, &line[index], (short int *)&(pingchanportheader->BandWidth));
-		    index += 2;
-		    mb_get_binary_int(MB_YES, &line[index], (int *)&(pingchanportheader->ContactNumber));
-		    index += 4;
-		    mb_get_binary_short(MB_YES, &line[index], (short int *)&(pingchanportheader->ContactClassification));
-		    index += 2;
-		    pingchanportheader->ContactSubNumber = (mb_u_char) line[index];
-		    index++;
-		    pingchanportheader->ContactType = (mb_u_char) line[index];
-		    index++;
-		    mb_get_binary_int(MB_YES, &line[index], (int *)&(pingchanportheader->NumSamples));
-		    index += 4;
-		    mb_get_binary_short(MB_YES, &line[index], (short int *)&(pingchanportheader->Reserved));
-		    index += 2;
-		    mb_get_binary_float(MB_YES, &line[index], &(pingchanportheader->ContactTimeOffTrack));
-		    index += 4;
-		    pingchanportheader->ContactCloseNumber = (mb_u_char) line[index];
-		    index++;
-		    pingchanportheader->Reserved2 = (mb_u_char) line[index];
-		    index++;
-		    mb_get_binary_float(MB_YES, &line[index], &(pingchanportheader->FixedVSOP));
-		    index += 4;
-		    for (i=0;i<6;i++)
-			{
-			pingchanportheader->ReservedSpace[i] = (mb_u_char) line[index];
-			index++;
-			}
-
-		    /* fix up on time duration if needed */
-		    if ( pingchanportheader->TimeDuration == 0.0)
-		    	{
-		    	pingchanportheader->TimeDuration
-				= pingchanportheader->SlantRange
-					/ pingheader->SoundVelocity;
-		    	}
-		    }
-		else
-		    {
-		    status = MB_FAILURE;
-		    *error = MB_ERROR_EOF;
-		    done = MB_YES;
-		    }
-
-		/* check for corrupted record */
-		if (pingchanportheader->ChannelNumber
-			> (fileheader->NumberOfSonarChannels
-				+ fileheader->NumberOfBathymetryChannels - 1))
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_UNINTELLIGIBLE;
-			}
-/*		else if (pingchanportheader->NumSamples
-			> fileheader->chaninfo[pingchanportheader->ChannelNumber].SamplesPerChannel)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_UNINTELLIGIBLE;
-			}
-jrenken: SamplesPerChannel not used anymore, value can change dependend on range
-*/
-		/* read port sidescan data */
-		if (status == MB_SUCCESS)
-		    {
-		    read_bytes = pingchanportheader->NumSamples
-				    * fileheader->chaninfo[pingchanportheader->ChannelNumber].BytesPerSample;
-		    read_len = fread(line,1,read_bytes,mb_io_ptr->mbfp);
-		    }
-		if (status == MB_SUCCESS && read_len == read_bytes)
-		    {
-		    if (fileheader->chaninfo[pingchanportheader->ChannelNumber].BytesPerSample == 1)
-			{
-			for (i=0;i<pingchanportheader->NumSamples;i++)
-			    {
-			    mb_u_char_ptr = (mb_u_char *) &line[i];
-			    data->ssrawport[i] = (unsigned short) (*mb_u_char_ptr);
-			    }
-			}
-		    else if (fileheader->chaninfo[pingchanportheader->ChannelNumber].BytesPerSample == 2)
-			{
-			index = 0;
-			for (i=0;i<pingchanportheader->NumSamples;i++)
-			    {
-			    mb_get_binary_short(MB_YES, &line[index], (short *)&(data->ssrawport[i]));
-			    index += 2;
-			    }
-			}
-		    }
-		else
-		    {
-		    status = MB_FAILURE;
-		    *error = MB_ERROR_EOF;
-		    done = MB_YES;
-		    }
-
-		/* read and parse the starboard sidescan channel header */
-		if (status == MB_SUCCESS)
-		    read_len = fread(line,1,64,mb_io_ptr->mbfp);
-		if (status == MB_SUCCESS && read_len == 64)
-		    {
-		    index = 0;
-		    mb_get_binary_short(MB_YES, &line[index], (short int *)&(pingchanstbdheader->ChannelNumber));
-		    index += 2;
-		    mb_get_binary_short(MB_YES, &line[index], (short int *)&(pingchanstbdheader->DownsampleMethod));
-		    index += 2;
-		    mb_get_binary_float(MB_YES, &line[index], &(pingchanstbdheader->SlantRange));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(pingchanstbdheader->GroundRange));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(pingchanstbdheader->TimeDelay));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(pingchanstbdheader->TimeDuration));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(pingchanstbdheader->SecondsPerPing));
-		    index += 4;
-		    mb_get_binary_short(MB_YES, &line[index], (short int *)&(pingchanstbdheader->ProcessingFlags));
-		    index += 2;
-		    mb_get_binary_short(MB_YES, &line[index], (short int *)&(pingchanstbdheader->Frequency));
-		    index += 2;
-		    mb_get_binary_short(MB_YES, &line[index], (short int *)&(pingchanstbdheader->InitialGainCode));
-		    index += 2;
-		    mb_get_binary_short(MB_YES, &line[index], (short int *)&(pingchanstbdheader->GainCode));
-		    index += 2;
-		    mb_get_binary_short(MB_YES, &line[index], (short int *)&(pingchanstbdheader->BandWidth));
-		    index += 2;
-		    mb_get_binary_int(MB_YES, &line[index], (int *)&(pingchanstbdheader->ContactNumber));
-		    index += 4;
-		    mb_get_binary_short(MB_YES, &line[index], (short int *)&(pingchanstbdheader->ContactClassification));
-		    index += 2;
-		    pingchanstbdheader->ContactSubNumber = (mb_u_char) line[index];
-		    index++;
-		    pingchanstbdheader->ContactType = (mb_u_char) line[index];
-		    index++;
-		    mb_get_binary_int(MB_YES, &line[index], (int *)&(pingchanstbdheader->NumSamples));
-		    index += 4;
-		    mb_get_binary_short(MB_YES, &line[index], (short int *)&(pingchanstbdheader->Reserved));
-		    index += 2;
-		    mb_get_binary_float(MB_YES, &line[index], &(pingchanstbdheader->ContactTimeOffTrack));
-		    index += 4;
-		    pingchanstbdheader->ContactCloseNumber = (mb_u_char) line[index];
-		    index++;
-		    pingchanstbdheader->Reserved2 = (mb_u_char) line[index];
-		    index++;
-		    mb_get_binary_float(MB_YES, &line[index], &(pingchanstbdheader->FixedVSOP));
-		    index += 4;
-		    for (i=0;i<6;i++)
-			{
-			pingchanstbdheader->ReservedSpace[i] = (mb_u_char) line[index];
-			index++;
-			}
-
-		    /* fix up on time duration if needed */
-		    if ( pingchanstbdheader->TimeDuration == 0.0)
-		    	{
-		    	pingchanstbdheader->TimeDuration
-				= pingchanstbdheader->SlantRange
-					/ pingheader->SoundVelocity;
-		    	}
-		    }
-		else
-		    {
-		    status = MB_FAILURE;
-		    *error = MB_ERROR_EOF;
-		    done = MB_YES;
-		    }
-
-		/* check for corrupted record */
-		if (pingchanstbdheader->ChannelNumber
-			> (fileheader->NumberOfSonarChannels
-				+ fileheader->NumberOfBathymetryChannels - 1))
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_UNINTELLIGIBLE;
-			}
-/*		else if (pingchanstbdheader->NumSamples
-			> fileheader->chaninfo[pingchanstbdheader->ChannelNumber].SamplesPerChannel)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_UNINTELLIGIBLE;
-			}
-jrenken: SamplesPerChannel not used anymore, value can change depending on range
-*/
-		/* read starboard sidescan data */
-		if (status == MB_SUCCESS)
-		    {
-		    read_bytes = pingchanstbdheader->NumSamples
-				    * fileheader->chaninfo[pingchanstbdheader->ChannelNumber].BytesPerSample;
-		    read_len = fread(line,1,read_bytes,mb_io_ptr->mbfp);
-		    }
-		if (status == MB_SUCCESS && read_len == read_bytes)
-		    {
-		    if (fileheader->chaninfo[pingchanstbdheader->ChannelNumber].BytesPerSample == 1)
-			{
-			for (i=0;i<pingchanstbdheader->NumSamples;i++)
-			    {
-			    mb_u_char_ptr = (mb_u_char *) &line[i];
-			    data->ssrawstbd[i] = (unsigned short) (*mb_u_char_ptr);
-			    }
-			}
-		    else if (fileheader->chaninfo[pingchanstbdheader->ChannelNumber].BytesPerSample == 2)
-			{
-			index = 0;
-			for (i=0;i<pingchanstbdheader->NumSamples;i++)
-			    {
-			    mb_get_binary_short(MB_YES, &line[index], (short *)&(data->ssrawstbd[i]));
-			    index += 2;
-			    }
-			}
-		    }
-		else
-		    {
-		    status = MB_FAILURE;
-		    *error = MB_ERROR_EOF;
-		    done = MB_YES;
-		    }
-
-		/* print debug statements */
-		if (verbose >= 5)
-		    {
-		    fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		    fprintf(stderr,"dbg5       MagicNumber:                %d %d %x%x\n",
-				    pingheader->packetheader.MagicNumber[0],pingheader->packetheader.MagicNumber[1],
-				    pingheader->packetheader.MagicNumber[0],pingheader->packetheader.MagicNumber[1]);
-		    fprintf(stderr,"dbg5       HeaderType:                 %d\n",pingheader->packetheader.HeaderType);
-		    fprintf(stderr,"dbg5       SubChannelNumber:           %d\n",pingheader->packetheader.SubChannelNumber);
-		    fprintf(stderr,"dbg5       NumChansToFollow:           %d\n",pingheader->packetheader.NumChansToFollow);
-		    fprintf(stderr,"dbg5       Reserved1:                  %d %d\n",pingheader->packetheader.Reserved1[0],pingheader->packetheader.Reserved1[1]);
-		    fprintf(stderr,"dbg5       NumBytesThisRecord:         %d\n",pingheader->packetheader.NumBytesThisRecord);
-		    fprintf(stderr,"dbg5       Year:                       %d\n",pingheader->Year);
-		    fprintf(stderr,"dbg5       Month:                      %d\n",pingheader->Month);
-		    fprintf(stderr,"dbg5       Day:                        %d\n",pingheader->Day);
-		    fprintf(stderr,"dbg5       Hour:                       %d\n",pingheader->Hour);
-		    fprintf(stderr,"dbg5       Minute:                     %d\n",pingheader->Minute);
-		    fprintf(stderr,"dbg5       Second:                     %d\n",pingheader->Second);
-		    fprintf(stderr,"dbg5       HSeconds:                   %d\n",pingheader->HSeconds);
-		    fprintf(stderr,"dbg5       JulianDay:                  %d\n",pingheader->JulianDay);
-		    fprintf(stderr,"dbg5       CurrentLineID:              %d\n",pingheader->CurrentLineID);
-		    fprintf(stderr,"dbg5       EventNumber:                %d\n",pingheader->EventNumber);
-		    fprintf(stderr,"dbg5       PingNumber:                 %d\n",pingheader->PingNumber);
-		    fprintf(stderr,"dbg5       SoundVelocity:              %f\n",pingheader->SoundVelocity);
-		    fprintf(stderr,"dbg5       OceanTide:                  %f\n",pingheader->OceanTide);
-		    fprintf(stderr,"dbg5       Reserved2:                  %d\n",pingheader->Reserved2);
-		    fprintf(stderr,"dbg5       ConductivityFreq:           %f\n",pingheader->ConductivityFreq);
-		    fprintf(stderr,"dbg5       TemperatureFreq:            %f\n",pingheader->TemperatureFreq);
-		    fprintf(stderr,"dbg5       PressureFreq:               %f\n",pingheader->PressureFreq);
-		    fprintf(stderr,"dbg5       PressureTemp:               %f\n",pingheader->PressureTemp);
-		    fprintf(stderr,"dbg5       Conductivity:               %f\n",pingheader->Conductivity);
-		    fprintf(stderr,"dbg5       WaterTemperature:           %f\n",pingheader->WaterTemperature);
-		    fprintf(stderr,"dbg5       Pressure:                   %f\n",pingheader->Pressure);
-		    fprintf(stderr,"dbg5       ComputedSoundVelocity:      %f\n",pingheader->ComputedSoundVelocity);
-		    fprintf(stderr,"dbg5       MagX:                       %f\n",pingheader->MagX);
-		    fprintf(stderr,"dbg5       MagY:                       %f\n",pingheader->MagY);
-		    fprintf(stderr,"dbg5       MagZ:                       %f\n",pingheader->MagZ);
-		    fprintf(stderr,"dbg5       AuxVal1:                    %f\n",pingheader->AuxVal1);
-		    fprintf(stderr,"dbg5       AuxVal2:                    %f\n",pingheader->AuxVal2);
-		    fprintf(stderr,"dbg5       AuxVal3:                    %f\n",pingheader->AuxVal3);
-		    fprintf(stderr,"dbg5       AuxVal4:                    %f\n",pingheader->AuxVal4);
-		    fprintf(stderr,"dbg5       AuxVal5:                    %f\n",pingheader->AuxVal5);
-		    fprintf(stderr,"dbg5       AuxVal6:                    %f\n",pingheader->AuxVal6);
-		    fprintf(stderr,"dbg5       SpeedLog:                   %f\n",pingheader->SpeedLog);
-		    fprintf(stderr,"dbg5       Turbidity:                  %f\n",pingheader->Turbidity);
-		    fprintf(stderr,"dbg5       ShipSpeed:                  %f\n",pingheader->ShipSpeed);
-		    fprintf(stderr,"dbg5       ShipGyro:                   %f\n",pingheader->ShipGyro);
-		    fprintf(stderr,"dbg5       ShipYcoordinate:            %f\n",pingheader->ShipYcoordinate);
-		    fprintf(stderr,"dbg5       ShipXcoordinate:            %f\n",pingheader->ShipXcoordinate);
-		    fprintf(stderr,"dbg5       ShipAltitude:               %d\n",pingheader->ShipAltitude);
-		    fprintf(stderr,"dbg5       ShipDepth:                  %d\n",pingheader->ShipDepth);
-		    fprintf(stderr,"dbg5       FixTimeHour:                %d\n",pingheader->FixTimeHour);
-		    fprintf(stderr,"dbg5       FixTimeMinute:              %d\n",pingheader->FixTimeMinute);
-		    fprintf(stderr,"dbg5       FixTimeSecond:              %d\n",pingheader->FixTimeSecond);
-		    fprintf(stderr,"dbg5       Reserved4:                  %d\n",pingheader->Reserved4);
-		    fprintf(stderr,"dbg5       SensorSpeed:                %f\n",pingheader->SensorSpeed);
-		    fprintf(stderr,"dbg5       KP:                         %f\n",pingheader->KP);
-		    fprintf(stderr,"dbg5       SensorYcoordinate:          %f\n",pingheader->SensorYcoordinate);
-		    fprintf(stderr,"dbg5       SensorXcoordinate:          %f\n",pingheader->SensorXcoordinate);
-		    fprintf(stderr,"dbg5       Reserved6:                  %d\n",pingheader->Reserved6);
-		    fprintf(stderr,"dbg5       RangeToSensor:              %d\n",pingheader->RangeToSensor);
-		    fprintf(stderr,"dbg5       BearingToSensor:            %d\n",pingheader->BearingToSensor);
-		    fprintf(stderr,"dbg5       CableOut:                   %d\n",pingheader->CableOut);
-		    fprintf(stderr,"dbg5       Layback:                    %f\n",pingheader->Layback);
-		    fprintf(stderr,"dbg5       CableTension:               %f\n",pingheader->CableTension);
-		    fprintf(stderr,"dbg5       SensorDepth:                %f\n",pingheader->SensorDepth);
-		    fprintf(stderr,"dbg5       SensorPrimaryAltitude:      %f\n",pingheader->SensorPrimaryAltitude);
-		    fprintf(stderr,"dbg5       SensorAuxAltitude:          %f\n",pingheader->SensorAuxAltitude);
-		    fprintf(stderr,"dbg5       SensorPitch:                %f\n",pingheader->SensorPitch);
-		    fprintf(stderr,"dbg5       SensorRoll:                 %f\n",pingheader->SensorRoll);
-		    fprintf(stderr,"dbg5       SensorHeading:              %f\n",pingheader->SensorHeading);
-		    fprintf(stderr,"dbg5       Heave:                      %f\n",pingheader->Heave);
-		    fprintf(stderr,"dbg5       Yaw:                        %f\n",pingheader->Yaw);
-		    fprintf(stderr,"dbg5       AttitudeTimeTag:            %d\n",pingheader->AttitudeTimeTag);
-		    fprintf(stderr,"dbg5       DOT:                        %f\n",pingheader->DOT);
-		    for (i=0;i<20;i++)
-			fprintf(stderr,"dbg5       ReservedSpace[%2.2d]:          %d\n",i,pingheader->ReservedSpace[i]);
-		    fprintf(stderr,"dbg5       ChannelNumber:              %d\n",pingchanportheader->ChannelNumber);
-		    fprintf(stderr,"dbg5       DownsampleMethod:           %d\n",pingchanportheader->DownsampleMethod);
-		    fprintf(stderr,"dbg5       SlantRange:                 %f\n",pingchanportheader->SlantRange);
-		    fprintf(stderr,"dbg5       GroundRange:                %f\n",pingchanportheader->GroundRange);
-		    fprintf(stderr,"dbg5       TimeDelay:                  %f\n",pingchanportheader->TimeDelay);
-		    fprintf(stderr,"dbg5       TimeDuration:               %f\n",pingchanportheader->TimeDuration);
-		    fprintf(stderr,"dbg5       SecondsPerPing:             %f\n",pingchanportheader->SecondsPerPing);
-		    fprintf(stderr,"dbg5       ProcessingFlags:            %d\n",pingchanportheader->ProcessingFlags);
-		    fprintf(stderr,"dbg5       Frequency:                  %d\n",pingchanportheader->Frequency);
-		    fprintf(stderr,"dbg5       InitialGainCode:            %d\n",pingchanportheader->InitialGainCode);
-		    fprintf(stderr,"dbg5       GainCode:                   %d\n",pingchanportheader->GainCode);
-		    fprintf(stderr,"dbg5       BandWidth:                  %d\n",pingchanportheader->BandWidth);
-		    fprintf(stderr,"dbg5       ContactNumber:              %d\n",pingchanportheader->ContactNumber);
-		    fprintf(stderr,"dbg5       ContactClassification:      %d\n",pingchanportheader->ContactClassification);
-		    fprintf(stderr,"dbg5       ContactSubNumber:           %d\n",pingchanportheader->ContactSubNumber);
-		    fprintf(stderr,"dbg5       ContactType:                %d\n",pingchanportheader->ContactType);
-		    fprintf(stderr,"dbg5       NumSamples:                 %d\n",pingchanportheader->NumSamples);
-		    fprintf(stderr,"dbg5       Reserved:                   %d\n",pingchanportheader->Reserved);
-		    fprintf(stderr,"dbg5       ContactTimeOffTrack:        %f\n",pingchanportheader->ContactTimeOffTrack);
-		    fprintf(stderr,"dbg5       ContactCloseNumber:         %d\n",pingchanportheader->ContactCloseNumber);
-		    fprintf(stderr,"dbg5       Reserved2:                  %d\n",pingchanportheader->Reserved2);
-		    fprintf(stderr,"dbg5       FixedVSOP:                  %f\n",pingchanportheader->FixedVSOP);
-		    for (i=0;i<6;i++)
-			fprintf(stderr,"dbg5       ReservedSpace[%2.2d]:          %d\n",i,pingchanportheader->ReservedSpace[i]);
-		    fprintf(stderr,"dbg5       ChannelNumber:              %d\n",pingchanstbdheader->ChannelNumber);
-		    fprintf(stderr,"dbg5       DownsampleMethod:           %d\n",pingchanstbdheader->DownsampleMethod);
-		    fprintf(stderr,"dbg5       SlantRange:                 %f\n",pingchanstbdheader->SlantRange);
-		    fprintf(stderr,"dbg5       GroundRange:                %f\n",pingchanstbdheader->GroundRange);
-		    fprintf(stderr,"dbg5       TimeDelay:                  %f\n",pingchanstbdheader->TimeDelay);
-		    fprintf(stderr,"dbg5       TimeDuration:               %f\n",pingchanstbdheader->TimeDuration);
-		    fprintf(stderr,"dbg5       SecondsPerPing:             %f\n",pingchanstbdheader->SecondsPerPing);
-		    fprintf(stderr,"dbg5       ProcessingFlags:            %d\n",pingchanstbdheader->ProcessingFlags);
-		    fprintf(stderr,"dbg5       Frequency:                  %d\n",pingchanstbdheader->Frequency);
-		    fprintf(stderr,"dbg5       InitialGainCode:            %d\n",pingchanstbdheader->InitialGainCode);
-		    fprintf(stderr,"dbg5       GainCode:                   %d\n",pingchanstbdheader->GainCode);
-		    fprintf(stderr,"dbg5       BandWidth:                  %d\n",pingchanstbdheader->BandWidth);
-		    fprintf(stderr,"dbg5       ContactNumber:              %d\n",pingchanstbdheader->ContactNumber);
-		    fprintf(stderr,"dbg5       ContactClassification:      %d\n",pingchanstbdheader->ContactClassification);
-		    fprintf(stderr,"dbg5       ContactSubNumber:           %d\n",pingchanstbdheader->ContactSubNumber);
-		    fprintf(stderr,"dbg5       ContactType:                %d\n",pingchanstbdheader->ContactType);
-		    fprintf(stderr,"dbg5       NumSamples:                 %d\n",pingchanstbdheader->NumSamples);
-		    fprintf(stderr,"dbg5       Reserved:                   %d\n",pingchanstbdheader->Reserved);
-		    fprintf(stderr,"dbg5       ContactTimeOffTrack:        %f\n",pingchanstbdheader->ContactTimeOffTrack);
-		    fprintf(stderr,"dbg5       ContactCloseNumber:         %d\n",pingchanstbdheader->ContactCloseNumber);
-		    fprintf(stderr,"dbg5       Reserved2:                  %d\n",pingchanstbdheader->Reserved2);
-		    fprintf(stderr,"dbg5       FixedVSOP:                  %f\n",pingchanstbdheader->FixedVSOP);
-		    for (i=0;i<6;i++)
-			fprintf(stderr,"dbg5       ReservedSpace[%2.2d]:          %d\n",i,pingchanstbdheader->ReservedSpace[i]);
-		    for (i=0;i<MAX(pingchanportheader->NumSamples,pingchanstbdheader->NumSamples);i++)
-			fprintf(stderr,"dbg5       sidescan[%4.4d]: %d %d\n",i,data->ssrawport[i], data->ssrawstbd[i]);
-		    }
-	    /* set success */
-	    status = MB_SUCCESS;
-	    *error = MB_ERROR_NO_ERROR;
-	    done = MB_YES;
-
-		}
-
-
-	    /* else read rest of unknown packet */
-	    else if (status == MB_SUCCESS)
-		{
-		if (((int)packetheader.NumBytesThisRecord) > 14)
-			{
-			for (i=0;i<((int)packetheader.NumBytesThisRecord)-14;i++)
-				{
-				read_len = fread(line,1,1,mb_io_ptr->mbfp);
-				}
-			if (read_len != 1)
-		    		{
-				status = MB_FAILURE;
-				*error = MB_ERROR_EOF;
-				done = MB_YES;
-				}
-			}
-#ifdef MBR_xtfb1624_DEBUG
-fprintf(stderr,"Reading unknown packet type:%d bytes:%d\n",
-packetheader.HeaderType,packetheader.NumBytesThisRecord);
-#endif
-		}
-	    }
-
-	/* get file position */
-	mb_io_ptr->file_bytes = ftell(mb_io_ptr->mbfp);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mbr_xtfr8101.c b/src/mbio/mbr_xtfr8101.c
deleted file mode 100644
index 5cf54db..0000000
--- a/src/mbio/mbr_xtfr8101.c
+++ /dev/null
@@ -1,2412 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbr_xtfr8101.c	8/8/94
- *	$Id: mbr_xtfr8101.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 2001-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbr_xtfr8101.c contains the functions for reading and writing
- * multibeam data in the XTFR8101 format.
- * These functions include:
- *   mbr_alm_xtfr8101	- allocate read/write memory
- *   mbr_dem_xtfr8101	- deallocate read/write memory
- *   mbr_rt_xtfr8101	- read and translate data
- *   mbr_wt_xtfr8101	- translate and write data
- *
- * Author:	D. W. Caress
- * Date:	August 26, 2001
- *
- * $Log: mbr_xtfr8101.c,v $
- * Revision 5.11  2008/09/13 06:08:09  caress
- * Updates to apply suggested patches to segy handling. Also fixes to remove compiler warnings.
- *
- * Revision 5.10  2006/03/06 21:47:48  caress
- * Implemented changes suggested by Bob Courtney of the Geological Survey of Canada to support translating Reson data to GSF.
- *
- * Revision 5.9  2005/11/05 00:48:05  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.8  2003/05/20 18:05:32  caress
- * Added svp_source to data source parameters.
- *
- * Revision 5.7  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.6  2003/01/15 20:51:48  caress
- * Release 5.0.beta28
- *
- * Revision 5.5  2002/09/25 20:41:04  caress
- * Fixed some problems.
- *
- * Revision 5.4  2002/09/19 01:12:39  caress
- * Release 5.0.beta23
- *
- * Revision 5.3  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.2  2001/11/16 01:32:31  caress
- * Working on it...
- *
- * Revision 5.1  2001/10/12  21:08:37  caress
- * Added interpolation of attitude data.
- *
- * Revision 5.0  2001/09/17  23:24:10  caress
- * Added XTF format.
- *
-*
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mb_define.h"
-#include "mbsys_reson8k.h"
-#include "mbf_xtfr8101.h"
-
-/* turn on debug statements here */
-/* #define MBR_XTFR8101_DEBUG 1 */
-
-/* essential function prototypes */
-int mbr_register_xtfr8101(int verbose, void *mbio_ptr,
-		int *error);
-int mbr_info_xtfr8101(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error);
-int mbr_alm_xtfr8101(int verbose, void *mbio_ptr, int *error);
-int mbr_dem_xtfr8101(int verbose, void *mbio_ptr, int *error);
-int mbr_zero_xtfr8101(int verbose, char *data_ptr, int *error);
-int mbr_rt_xtfr8101(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_wt_xtfr8101(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-int mbr_xtfr8101_rd_data(int verbose, void *mbio_ptr, int *error);
-
-static char rcs_id[]="$Id: mbr_xtfr8101.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mbr_register_xtfr8101(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_register_xtfr8101";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* get mb_io_ptr */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set format info parameters */
-	status = mbr_info_xtfr8101(verbose,
-			&mb_io_ptr->system,
-			&mb_io_ptr->beams_bath_max,
-			&mb_io_ptr->beams_amp_max,
-			&mb_io_ptr->pixels_ss_max,
-			mb_io_ptr->format_name,
-			mb_io_ptr->system_name,
-			mb_io_ptr->format_description,
-			&mb_io_ptr->numfile,
-			&mb_io_ptr->filetype,
-			&mb_io_ptr->variable_beams,
-			&mb_io_ptr->traveltime,
-			&mb_io_ptr->beam_flagging,
-			&mb_io_ptr->nav_source,
-			&mb_io_ptr->heading_source,
-			&mb_io_ptr->vru_source,
-			&mb_io_ptr->svp_source,
-			&mb_io_ptr->beamwidth_xtrack,
-			&mb_io_ptr->beamwidth_ltrack,
-			error);
-
-	/* set format and system specific function pointers */
-	mb_io_ptr->mb_io_format_alloc = &mbr_alm_xtfr8101;
-	mb_io_ptr->mb_io_format_free = &mbr_dem_xtfr8101;
-	mb_io_ptr->mb_io_store_alloc = &mbsys_reson8k_alloc;
-	mb_io_ptr->mb_io_store_free = &mbsys_reson8k_deall;
-	mb_io_ptr->mb_io_read_ping = &mbr_rt_xtfr8101;
-	mb_io_ptr->mb_io_write_ping = &mbr_wt_xtfr8101;
-	mb_io_ptr->mb_io_dimensions = &mbsys_reson8k_dimensions;
-	mb_io_ptr->mb_io_extract = &mbsys_reson8k_extract;
-	mb_io_ptr->mb_io_insert = &mbsys_reson8k_insert;
-	mb_io_ptr->mb_io_extract_nav = &mbsys_reson8k_extract_nav;
-	mb_io_ptr->mb_io_insert_nav = &mbsys_reson8k_insert_nav;
-	mb_io_ptr->mb_io_extract_altitude = &mbsys_reson8k_extract_altitude;
-	mb_io_ptr->mb_io_insert_altitude = NULL;
-	mb_io_ptr->mb_io_extract_svp = &mbsys_reson8k_extract_svp;
-	mb_io_ptr->mb_io_insert_svp = &mbsys_reson8k_insert_svp;
-	mb_io_ptr->mb_io_ttimes = &mbsys_reson8k_ttimes;
-	mb_io_ptr->mb_io_detects = &mbsys_reson8k_detects;
-	mb_io_ptr->mb_io_copyrecord = &mbsys_reson8k_copy;
-	mb_io_ptr->mb_io_extract_rawss = NULL;
-	mb_io_ptr->mb_io_insert_rawss = NULL;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",mb_io_ptr->system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",mb_io_ptr->beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",mb_io_ptr->beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",mb_io_ptr->pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",mb_io_ptr->format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",mb_io_ptr->system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",mb_io_ptr->format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",mb_io_ptr->numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",mb_io_ptr->filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",mb_io_ptr->variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",mb_io_ptr->traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",mb_io_ptr->beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",mb_io_ptr->nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",mb_io_ptr->heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",mb_io_ptr->vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",mb_io_ptr->svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",mb_io_ptr->beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",mb_io_ptr->beamwidth_ltrack);
-		fprintf(stderr,"dbg2       format_alloc:       %p\n",(void *)mb_io_ptr->mb_io_format_alloc);
-		fprintf(stderr,"dbg2       format_free:        %p\n",(void *)mb_io_ptr->mb_io_format_free);
-		fprintf(stderr,"dbg2       store_alloc:        %p\n",(void *)mb_io_ptr->mb_io_store_alloc);
-		fprintf(stderr,"dbg2       store_free:         %p\n",(void *)mb_io_ptr->mb_io_store_free);
-		fprintf(stderr,"dbg2       read_ping:          %p\n",(void *)mb_io_ptr->mb_io_read_ping);
-		fprintf(stderr,"dbg2       write_ping:         %p\n",(void *)mb_io_ptr->mb_io_write_ping);
-		fprintf(stderr,"dbg2       extract:            %p\n",(void *)mb_io_ptr->mb_io_extract);
-		fprintf(stderr,"dbg2       insert:             %p\n",(void *)mb_io_ptr->mb_io_insert);
-		fprintf(stderr,"dbg2       extract_nav:        %p\n",(void *)mb_io_ptr->mb_io_extract_nav);
-		fprintf(stderr,"dbg2       insert_nav:         %p\n",(void *)mb_io_ptr->mb_io_insert_nav);
-		fprintf(stderr,"dbg2       extract_altitude:   %p\n",(void *)mb_io_ptr->mb_io_extract_altitude);
-		fprintf(stderr,"dbg2       insert_altitude:    %p\n",(void *)mb_io_ptr->mb_io_insert_altitude);
-		fprintf(stderr,"dbg2       extract_svp:        %p\n",(void *)mb_io_ptr->mb_io_extract_svp);
-		fprintf(stderr,"dbg2       insert_svp:         %p\n",(void *)mb_io_ptr->mb_io_insert_svp);
-		fprintf(stderr,"dbg2       ttimes:             %p\n",(void *)mb_io_ptr->mb_io_ttimes);
-		fprintf(stderr,"dbg2       detects:            %p\n",(void *)mb_io_ptr->mb_io_detects);
-		fprintf(stderr,"dbg2       extract_rawss:      %p\n",(void *)mb_io_ptr->mb_io_extract_rawss);
-		fprintf(stderr,"dbg2       insert_rawss:       %p\n",(void *)mb_io_ptr->mb_io_insert_rawss);
-		fprintf(stderr,"dbg2       copyrecord:         %p\n",(void *)mb_io_ptr->mb_io_copyrecord);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbr_info_xtfr8101(int verbose,
-			int *system,
-			int *beams_bath_max,
-			int *beams_amp_max,
-			int *pixels_ss_max,
-			char *format_name,
-			char *system_name,
-			char *format_description,
-			int *numfile,
-			int *filetype,
-			int *variable_beams,
-			int *traveltime,
-			int *beam_flagging,
-			int *nav_source,
-			int *heading_source,
-			int *vru_source,
-			int *svp_source,
-			double *beamwidth_xtrack,
-			double *beamwidth_ltrack,
-			int *error)
-{
-	char	*function_name = "mbr_info_xtfr8101";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		}
-
-	/* set format info parameters */
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-	*system = MB_SYS_RESON8K;
-	*beams_bath_max = MBSYS_RESON8K_MAXBEAMS;
-	*beams_amp_max = MBSYS_RESON8K_MAXBEAMS;
-	*pixels_ss_max = MBSYS_RESON8K_MAXPIXELS;
-	strncpy(format_name, "XTFR8101", MB_NAME_LENGTH);
-	strncpy(system_name, "RESON8K", MB_NAME_LENGTH);
-	strncpy(format_description, "Format name:          MBF_XTFR8101\nInformal Description: XTF format Reson SeaBat 81XX\nAttributes:           240 beam bathymetry and amplitude,\n		      1024 pixel sidescan\n                      binary, read-only,\n                      Triton-Elics.\n", MB_DESCRIPTION_LENGTH);
-	*numfile = 1;
-	*filetype = MB_FILETYPE_NORMAL;
-	*variable_beams = MB_NO;
-	*traveltime = MB_YES;
-	*beam_flagging = MB_YES;
-	*nav_source = MB_DATA_DATA;
-	*heading_source = MB_DATA_DATA;
-	*vru_source = MB_DATA_DATA;
-	*svp_source = MB_DATA_VELOCITY_PROFILE;
-	*beamwidth_xtrack = 1.5;
-	*beamwidth_ltrack = 1.5;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       system:             %d\n",*system);
-		fprintf(stderr,"dbg2       beams_bath_max:     %d\n",*beams_bath_max);
-		fprintf(stderr,"dbg2       beams_amp_max:      %d\n",*beams_amp_max);
-		fprintf(stderr,"dbg2       pixels_ss_max:      %d\n",*pixels_ss_max);
-		fprintf(stderr,"dbg2       format_name:        %s\n",format_name);
-		fprintf(stderr,"dbg2       system_name:        %s\n",system_name);
-		fprintf(stderr,"dbg2       format_description: %s\n",format_description);
-		fprintf(stderr,"dbg2       numfile:            %d\n",*numfile);
-		fprintf(stderr,"dbg2       filetype:           %d\n",*filetype);
-		fprintf(stderr,"dbg2       variable_beams:     %d\n",*variable_beams);
-		fprintf(stderr,"dbg2       traveltime:         %d\n",*traveltime);
-		fprintf(stderr,"dbg2       beam_flagging:      %d\n",*beam_flagging);
-		fprintf(stderr,"dbg2       nav_source:         %d\n",*nav_source);
-		fprintf(stderr,"dbg2       heading_source:     %d\n",*heading_source);
-		fprintf(stderr,"dbg2       vru_source:         %d\n",*vru_source);
-		fprintf(stderr,"dbg2       svp_source:         %d\n",*svp_source);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:   %f\n",*beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:   %f\n",*beamwidth_ltrack);
-		fprintf(stderr,"dbg2       error:              %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_alm_xtfr8101(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_alm_xtfr8101";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	int	*fileheaderread;
-	double	*pixel_size;
-	double	*swath_width;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set initial status */
-	status = MB_SUCCESS;
-
-	/* allocate memory for data structure */
-	mb_io_ptr->structure_size = sizeof(struct mbf_xtfr8101_struct);
-	mb_io_ptr->data_structure_size = 0;
-	status = mb_malloc(verbose,mb_io_ptr->structure_size,
-				&mb_io_ptr->raw_data,error);
-	status = mb_malloc(verbose,sizeof(struct mbsys_reson8k_struct),
-				&mb_io_ptr->store_data,error);
-
-	/* set saved flags */
-	fileheaderread = (int *) &(mb_io_ptr->save1);
-	pixel_size = &mb_io_ptr->saved1;
-	swath_width = &mb_io_ptr->saved2;
-	*fileheaderread = MB_NO;
-	*pixel_size = 0.0;
-	*swath_width = 0.0;
-
-	/* initialize everything to zeros */
-	mbr_zero_xtfr8101(verbose,mb_io_ptr->raw_data,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_dem_xtfr8101(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_dem_xtfr8101";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointers to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* deallocate memory for data descriptor */
-	status = mb_free(verbose,&mb_io_ptr->raw_data,error);
-	status = mb_free(verbose,&mb_io_ptr->store_data,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_zero_xtfr8101(int verbose, char *data_ptr, int *error)
-{
-	char	*function_name = "mbr_zero_xtfr8101";
-	int	status = MB_SUCCESS;
-	struct mbf_xtfr8101_struct *data;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       data_ptr:   %p\n",(void *)data_ptr);
-		}
-
-	/* get pointer to data descriptor */
-	data = (struct mbf_xtfr8101_struct *) data_ptr;
-
-	/* initialize everything to zeros */
-	if (data != NULL)
-		{
-		memset(data, 0, sizeof(struct mbf_xtfr8101_struct));
-		data->kind = MB_DATA_NONE;
-		data->sonar = MBSYS_RESON8K_UNKNOWN;
-		}
-
-	/* assume success */
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_rt_xtfr8101(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_rt_xtfr8101";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_xtfr8101_struct *data;
-	struct mbsys_reson8k_struct *store;
-	int	nchan;
-	int	time_i[7];
-	double	time_d, ntime_d, dtime, timetag;
-	double	ttscale, angscale;
-	int	icenter, quality;
-	int	intensity_max;
-	double	angle, theta, phi;
-	double	rr, xx, zz;
-	double	*pixel_size, *swath_width;
-	double	lever_x, lever_y, lever_z;
-	int	badtime;
-	double	gain_correction;
-	double	lon, lat;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointers to mbio descriptor and data structures */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-	data = (struct mbf_xtfr8101_struct *) mb_io_ptr->raw_data;
-	store = (struct mbsys_reson8k_struct *) store_ptr;
-	pixel_size = (double *) &mb_io_ptr->saved1;
-	swath_width = (double *) &mb_io_ptr->saved2;
-
-	/* read next data from file */
-	status = mbr_xtfr8101_rd_data(verbose,mbio_ptr,error);
-
-	/* set error and kind in mb_io_ptr */
-	mb_io_ptr->new_error = *error;
-	mb_io_ptr->new_kind = data->kind;
-
-	/* handle navigation fix delay */
-	if (status == MB_SUCCESS && data->kind == MB_DATA_DATA)
-		{
-		/* get ping time */
-		time_i[0] = data->bathheader.Year;
-		time_i[1] = data->bathheader.Month;
-		time_i[2] = data->bathheader.Day;
-		time_i[3] = data->bathheader.Hour;
-		time_i[4] = data->bathheader.Minute;
-		time_i[5] = data->bathheader.Second;
-		time_i[6] = 10000 * data->bathheader.HSeconds;
-		mb_get_time(verbose, time_i, &time_d);
-
-		/* do check on time here - we sometimes get a bad fix */
-		badtime = MB_NO;
-		if (time_i[0] < 1970 && time_i[0] > 2100 ) badtime = MB_YES;
-		if (time_i[1] < 0 && time_i[1] > 12) badtime = MB_YES;
-		if (time_i[2] < 0 && time_i[2] > 31 ) badtime = MB_YES;
-		if (badtime == MB_YES)
-			{
-			if (verbose > 0)
-				fprintf(stderr," Bad time from XTF in bathy header\n");
-			data->kind = MB_DATA_NONE;
-			status = MB_FAILURE;
-			*error = MB_ERROR_UNINTELLIGIBLE;
-			}
-
-		/* get nav time */
-		dtime = 3600.0 * (data->bathheader.FixTimeHour - data->bathheader.Hour)
-		    + 60.0 * (data->bathheader.FixTimeMinute - data->bathheader.Minute)
-		    + data->bathheader.FixTimeSecond - data->bathheader.Second
-		    - 0.01 * data->bathheader.HSeconds;
-		if (data->bathheader.FixTimeHour - data->bathheader.Hour > 1)
-		    dtime -= 3600.0 * 24;
-		ntime_d = time_d + dtime;
-
-		/* check for use of projected coordinates
-			XTF allows projected coordinates like UTM but the format spec
-			lists the projection specification values as unused!
-			Assume UTM zone 1N as we have to assume something */
-		if (mb_io_ptr->projection_initialized == MB_YES)
-			{
-			mb_proj_inverse(verbose, mb_io_ptr->pjptr,
-							data->bathheader.SensorXcoordinate,
-							data->bathheader.SensorYcoordinate,
-							&lon, &lat,
-							error);
-			}
-		else
-			{
-			lon = data->bathheader.SensorXcoordinate;
-			lat = data->bathheader.SensorYcoordinate;
-			}
-
-		/* add latest fix to list */
-		mb_navint_add(verbose, mbio_ptr, ntime_d, lon, lat, error);
-		}
-
-	/* translate values to reson data storage structure */
-	if (status == MB_SUCCESS
-		&& store != NULL)
-		{
-		/* type of data record */
-		store->kind = data->kind;
-
-		/* type of sonar */
-		store->sonar = data->sonar;			/* Type of Reson sonar */
-
-		/* parameter info */
-		nchan = data->fileheader.NumberOfSonarChannels
-			+ data->fileheader.NumberOfBathymetryChannels;
-		for (i=0;i<nchan;i++)
-			{
-			if (data->fileheader.chaninfo[i].TypeOfChannel == 3)
-			    {
-			    store->MBOffsetX = data->fileheader.chaninfo[i].OffsetX;
-			    store->MBOffsetY = data->fileheader.chaninfo[i].OffsetY;
-			    store->MBOffsetZ = data->fileheader.chaninfo[i].OffsetZ;
-			    }
-			}
-		store->NavLatency = data->fileheader.NavigationLatency;		/* GPS_time_received - GPS_time_sent (sec) */
-		store->NavOffsetY = data->fileheader.NavOffsetY;		/* Nav offset (m) */
-		store->NavOffsetX = data->fileheader.NavOffsetX;		/* Nav offset (m) */
-		store->NavOffsetZ = data->fileheader.NavOffsetZ; 		/* Nav z offset (m) */
-		store->NavOffsetYaw = data->fileheader.NavOffsetZ;		/* Heading offset (m) */
-		store->MRUOffsetY = data->fileheader.MRUOffsetY;		/* Multibeam MRU y offset (m) */
-		store->MRUOffsetX = data->fileheader.MRUOffsetX;		/* Multibeam MRU x offset (m) */
-		store->MRUOffsetZ = data->fileheader.MRUOffsetZ; 		/* Multibeam MRU z offset (m) */
-		store->MRUOffsetPitch = data->fileheader.MRUOffsetPitch; 		/* Multibeam MRU pitch offset (degrees) */
-		store->MRUOffsetRoll = data->fileheader.MRUOffsetRoll;		/* Multibeam MRU roll offset (degrees) */
-
-		/* attitude data */
-		store->att_timetag = data->attitudeheader.TimeTag;
-		store->att_heading = data->attitudeheader.Heading;
-		store->att_heave = data->attitudeheader.Heave;
-		store->att_roll = data->attitudeheader.Roll;
-		store->att_pitch = data->attitudeheader.Pitch;
-
-		/* comment */
-		for (i=0;i<MBSYS_RESON8K_COMMENT_LENGTH;i++)
-			store->comment[i] = data->comment[i];
-
-		/* survey data */
-		store->png_latency = 0.001 * data->reson8100rit.latency;
-		time_i[0] = data->bathheader.Year;
-		time_i[1] = data->bathheader.Month;
-		time_i[2] = data->bathheader.Day;
-		time_i[3] = data->bathheader.Hour;
-		time_i[4] = data->bathheader.Minute;
-		time_i[5] = data->bathheader.Second;
-		time_i[6] = 10000 * data->bathheader.HSeconds;
-		mb_get_time(verbose, time_i,  &(store->png_time_d));
-		store->png_time_d -= store->png_latency;
-		store->png_longitude = data->bathheader.SensorXcoordinate;
-		store->png_latitude = data->bathheader.SensorYcoordinate;
-		store->png_speed = 0.0;
-
-		/* interpolate attitude if possible */
-		if (mb_io_ptr->nattitude > 1)
-		    {
-                    /* time tag is on receive;  average reception is closer
-		    	to the midpoint of the two way travel time
-		        but will vary on beam angle and water depth
-		        set the receive time delay to the average
-			( 0 to 60 deg)  two way travel time for a seabed
-		        located at 80% of the maximum range
-		        Old code:
-		    timetag = 0.001 * data->bathheader.AttitudeTimeTag
-				    - store->png_latency
-				    + 2.0 * ((double)data->reson8100rit.range_set)
-					    / ((double)data->reson8100rit.velocity); */
-		    timetag = 0.001 * data->bathheader.AttitudeTimeTag
-				    - store->png_latency
-				    + 1.4*((double)data->reson8100rit.range_set)
-					    / ((double)data->reson8100rit.velocity);
-		    mb_attint_interp(verbose, mbio_ptr, timetag,
-			    &(store->png_heave), &(store->png_roll),
-			    &(store->png_pitch), error);
-		    mb_hedint_interp(verbose, mbio_ptr, timetag,
-			    &(store->png_heading), error);
-#ifdef MBR_XTFR8101_DEBUG
-fprintf(stderr, "roll: %d %f %f %f %f   latency:%f time:%f %f roll:%f\n",
-mb_io_ptr->nattitude,
-mb_io_ptr->attitude_time_d[0],
-mb_io_ptr->attitude_time_d[mb_io_ptr->nattitude-1],
-mb_io_ptr->attitude_roll[0],
-mb_io_ptr->attitude_roll[mb_io_ptr->nattitude-1],
-store->png_latency, (double)(0.001 * data->bathheader.AttitudeTimeTag),
-timetag, store->png_roll);
-#endif
-		    }
-		else
-		    {
-		    store->png_roll = data->bathheader.SensorRoll;
-		    store->png_pitch = data->bathheader.SensorPitch;
-		    store->png_heading = data->bathheader.SensorHeading;
-		    store->png_heave = data->bathheader.Heave;
-		    }
-
-		/* interpolate nav if possible */
-		if (mb_io_ptr->nfix > 0)
-			{
-			mb_navint_interp(verbose, mbio_ptr, store->png_time_d, store->png_heading, 0.0,
-			    &(store->png_longitude), &(store->png_latitude), &(store->png_speed), error);
-
-			/* now deal with odd case where original nav is in eastings and northings
-				- since the projection is initialized, it will be applied when data
-				are extracted using mb_extract(), mb_extract_nav(), etc., so we have
-				to reproject the lon lat values to eastings northings for now */
-			if (mb_io_ptr->projection_initialized == MB_YES)
-				{
-				mb_proj_forward(verbose, mb_io_ptr->pjptr,
-							store->png_longitude, store->png_latitude,
-							&(store->png_longitude), &(store->png_latitude),
-							error);
-				}
-			}
-
-		/* get lever arm correction for heave */
-		mb_lever(verbose,
-			    (double) store->MBOffsetX,
-			    (double) store->MBOffsetY,
-			    (double) store->MBOffsetZ,
-			    (double) store->NavOffsetX,
-			    (double) store->NavOffsetY,
-			    (double) store->NavOffsetZ,
-			    (double) store->MRUOffsetX,
-			    (double) store->MRUOffsetY,
-			    (double) store->MRUOffsetZ,
-			    (double) (store->png_roll - store->MRUOffsetRoll),
-			    (double) (store->MRUOffsetPitch - store->png_pitch),
-			    &lever_x,
-			    &lever_y,
-			    &lever_z,
-			    error);
-		store->png_heave -= lever_z;
-#ifdef MBR_XTFR8101_DEBUG
-fprintf(stderr,"offsets: %f %f %f   roll:%f pitch:%f    dz:%f\n",
-store->MBOffsetX - store->MRUOffsetX,
-store->MBOffsetY - store->MRUOffsetY,
-store->MBOffsetZ - store->MRUOffsetZ,
-(double) (store->png_roll - store->MRUOffsetRoll),
-(double) (store->MRUOffsetPitch - store->png_pitch),
-lever_z);
-#endif
-
-		store->packet_type = data->reson8100rit.packet_type;      		/* identifier for packet type  */
-		store->packet_subtype = data->reson8100rit.packet_subtype;   		/* identifier for packet subtype */
-											/* for dual head system, most significant bit (bit 7) */
-											/* indicates which sonar head to associate with packet */
-											/* 	head 1 - bit 7 set to 0 */
-											/* 	head 2 -	bit 7 set to 1 		 */
-		store->latency = data->reson8100rit.latency;          			/* time from ping to output (milliseconds) */
-		store->Seconds = data->reson8100rit.Seconds;				/* seconds since 00:00:00, 1 January 1970 */
-		store->Millisecs = data->reson8100rit.Millisecs;			/* milliseconds, LSB = 1 ms */
-		store->ping_number = data->reson8100rit.ping_number;			/* sequential ping number from sonar startup/reset */
-		store->sonar_id = data->reson8100rit.sonar_id;				/* least significant four bytes of Ethernet address */
-		store->sonar_model = data->reson8100rit.sonar_model;			/* coded model number of sonar */
-		store->frequency = data->reson8100rit.frequency;			/* sonar frequency in KHz */
-		store->velocity = data->reson8100rit.velocity;         			/* programmed sound velocity (LSB = 1 m/sec) */
-		store->sample_rate = data->reson8100rit.sample_rate;      		/* A/D sample rate (samples per second) */
-		store->ping_rate = data->reson8100rit.ping_rate;        		/* Ping rate (pings per second * 1000) */
-		store->range_set = data->reson8100rit.range_set;        		/* range setting for SeaBat (meters ) */
-		store->power = data->reson8100rit.power;            			/* power setting for SeaBat  	 */
-											/* bits	0-4 -	power (0 - 8) */
-		store->gain = data->reson8100rit.gain;             			/* gain setting for SeaBat */
-											/* bits	0-6 -	gain (1 - 45) */
-											/* bit 	14	(0 = fixed, 1 = tvg) */
-											/* bit	15	(0 = manual, 1 = auto) */
-		store->pulse_width = data->reson8100rit.pulse_width;      		/* transmit pulse width (microseconds) */
-		store->tvg_spread = data->reson8100rit.tvg_spread;			/* spreading coefficient for tvg * 4  */
-											/* valid values = 0 to 240 (0.0 to 60.0 in 0.25 steps) */
-		store->tvg_absorp = data->reson8100rit.tvg_absorp;			/* absorption coefficient for tvg */
-		store->projector_type = data->reson8100rit.projector_type;      	/* bits 0-4 = projector type */
-							/* 0 = stick projector */
-							/* 1 = array face */
-							/* 2 = ER projector */
-							/* bit 7 - pitch steering (1=enabled, 0=disabled) */
-		store->projector_beam_width = data->reson8100rit.projector_beam_width;	/* along track transmit beam width (degrees * 10) */
-		store->beam_width_num = data->reson8100rit.beam_width_num;   	/* cross track receive beam width numerator */
-		store->beam_width_denom = data->reson8100rit.beam_width_denom; 	/* cross track receive beam width denominator */
-							/* beam width degrees = numerator / denominator */
-		store->projector_angle = data->reson8100rit.projector_angle;		/* projector pitch steering angle (degrees * 100) */
-		store->min_range = data->reson8100rit.min_range;		/* sonar filter settings */
-		store->max_range = data->reson8100rit.max_range;
-		store->min_depth = data->reson8100rit.min_depth;
-		store->max_depth = data->reson8100rit.max_depth;
-		store->filters_active = data->reson8100rit.filters_active;		/* range/depth filters active  */
-							/* bit 0 - range filter (0 = off, 1 = active) */
-							/* bit 1 - depth filter (0 = off, 1 = active) */
-		store->temperature = data->reson8100rit.temperature;		/* temperature at sonar head (deg C * 10) */
-		store->beam_count = data->reson8100rit.beam_count;       		/* number of sets of beam data in packet */
-		for (i=0;i<store->beam_count;i++)
-			store->range[i] = data->reson8100rit.range[i]; 		/* range for beam where n = Beam Count */
-							/* range units = sample cells * 4 */
-		for (i=0;i<store->beam_count/2+1;i++)
-			store->quality[i] = data->reson8100rit.quality[i];   		/* packed quality array (two 4 bit values/char) */
-							/* cnt = n/2 if beam count even, n/2+1 if odd */
-							/* cnt then rounded up to next even number */
-							/* e.g. if beam count=101, cnt=52  */
-							/* unused trailing quality values set to zero */
-							/* bit 0 - brightness test (0=failed, 1=passed) */
-							/* bit 1 - colinearity test (0=failed, 1=passed) */
-							/* bit 2 - amplitude bottom detect used */
-							/* bit 3 - phase bottom detect used */
-							/* bottom detect can be amplitude, phase or both */
-		intensity_max = 0;
-		for (i=0;i<store->beam_count;i++)
-			{
-			store->intensity[i] = data->reson8100rit.intensity[i];   		/* intensities at bottom detect  */
-			intensity_max = MAX(intensity_max, (int)store->intensity[i]);
-			}
-
-		store->beams_bath = data->reson8100rit.beam_count;
-		if (intensity_max > 0)
-			store->beams_amp = store->beams_bath;
-		else
-			store->beams_amp = 0;
-
-		/* ttscale in seconds per range count ( 4 counts per time interval) */
-		ttscale = 0.25 / store->sample_rate;
-		icenter = store->beams_bath / 2;
-		angscale = ((double)store->beam_width_num)
-			/ ((double)store->beam_width_denom);
-		for (i=0;i<store->beams_bath;i++)
-			{
-			/* get beamflag */
-			if (i % 2 == 0)
-				quality = ((store->quality[i/2]) & 15) & 3;
-			else
-				quality = ((store->quality[i/2] >> 4) & 15) & 3;
-			if (quality == 0)
-				store->beamflag[i] = MB_FLAG_NULL;
-			else if (quality < 3)
-				store->beamflag[i] = MB_FLAG_FLAG + MB_FLAG_SONAR;
-			else
-				store->beamflag[i] = MB_FLAG_NONE;
-
-			if (store->beamflag[i] == MB_FLAG_NULL)
-				{
-				store->bath[i] = 0.0;		/* bathymetry (m) */
-				store->bath_acrosstrack[i] = 0.0;/* acrosstrack distance (m) */
-				store->bath_alongtrack[i] = 0.0;	/* alongtrack distance (m) */
-				}
-			else
-				{
-				angle = 90.0 + (icenter - i) * angscale + store->png_roll;
-				mb_rollpitch_to_takeoff(
-					verbose,
-					store->png_pitch, angle,
-					&theta, &phi,
-					error);
-				rr = 0.5 * store->velocity * ttscale * store->range[i];
-				xx = rr * sin(DTR * theta);
-				zz = rr * cos(DTR * theta);
-				store->bath_acrosstrack[i]
-					= xx * cos(DTR * phi);
-				store->bath_alongtrack[i]
-					= xx * sin(DTR * phi);
-				store->bath[i] = zz - store->png_heave
-						+ store->MBOffsetZ;
-/*if (i==store->beams_bath/2 && timetag > 1.0)
-fprintf(stderr,"%f %f %f %f %f\n",timetag,zz,store->png_heave,lever_z,store->bath[i]);*/
-				}
-			}
-		gain_correction = 2.2 * (store->gain & 63) + 6 * store->power;
-		for (i=0;i<store->beams_amp;i++)
-			{
-			store->amp[i] = (double)(40.0 * log10(store->intensity[i])- gain_correction);
-			}
-		store->ssrawtimedelay = data->pingchanportheader.TimeDelay;
-		store->ssrawtimeduration = data->pingchanportheader.TimeDuration;
-		store->ssrawbottompick = data->sidescanheader.SensorPrimaryAltitude
-					    / data->sidescanheader.SoundVelocity;
-		store->ssrawportsamples = data->pingchanportheader.NumSamples;
-		store->ssrawstbdsamples = data->pingchanstbdheader.NumSamples;
-		for (i=0;i<store->ssrawportsamples;i++)
-		    store->ssrawport[i] = data->ssrawport[store->ssrawportsamples - i - 1];
-		for (i=0;i<store->ssrawstbdsamples;i++)
-		    store->ssrawstbd[i] = data->ssrawstbd[i];
-
-		/* generate processed sidescan */
-		store->pixel_size = 0.0;
-		store->pixels_ss = 0;
-		status = mbsys_reson8k_makess(verbose,
-				mbio_ptr, store_ptr,
-				MB_NO, pixel_size,
-				MB_NO, swath_width,
-				error);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_wt_xtfr8101(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char	*function_name = "mbr_wt_xtfr8101";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set error as this is a read only format */
-	status = MB_FAILURE;
-	*error = MB_ERROR_WRITE_FAIL;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbr_xtfr8101_rd_data(int verbose, void *mbio_ptr, int *error)
-{
-	char	*function_name = "mbr_xtfr8101_rd_data";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbf_xtfr8101_struct *data;
-	char	line[MBF_XTFR8101_MAXLINE];
-	int	*fileheaderread;
-	struct mbf_xtfr8101_xtffileheader *fileheader;
-	struct mbf_xtfpacketheader packetheader;
-	struct mbf_xtfattitudeheader *attitudeheader;
-	struct mbf_xtfbathheader *bathheader;
-	struct RESON8100_RIT *reson8100rit;
-	struct mbf_xtfbathheader *sidescanheader;
-	struct mbf_xtfpingchanheader *pingchanportheader;
-	struct mbf_xtfpingchanheader *pingchanstbdheader;
-	int	index;
-	int	ichan;
-	int	done, found;
-	int	synch;
-	int	read_len, read_bytes;
-	int	skip;
-	int	quality;
-	mb_u_char *mb_u_char_ptr;
-	double	timetag, heave, roll, pitch, heading;
-	int	utm_zone;
-	char	projection[MB_NAME_LENGTH];
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* set saved flags */
-	fileheaderread = (int *) &(mb_io_ptr->save1);
-
-	/* get pointer to raw data structure */
-	data = (struct mbf_xtfr8101_struct *) mb_io_ptr->raw_data;
-	fileheader = (struct mbf_xtfr8101_xtffileheader *) &(data->fileheader);
-	attitudeheader = (struct mbf_xtfattitudeheader *) &(data->attitudeheader);
-	bathheader = (struct mbf_xtfbathheader *) &(data->bathheader);
-	reson8100rit = (struct RESON8100_RIT *) &(data->reson8100rit);
-	sidescanheader = (struct mbf_xtfbathheader *) &(data->sidescanheader);
-	pingchanportheader = (struct mbf_xtfpingchanheader *) &(data->pingchanportheader);
-	pingchanstbdheader = (struct mbf_xtfpingchanheader *) &(data->pingchanstbdheader);
-
-	/* set file position */
-	mb_io_ptr->file_pos = mb_io_ptr->file_bytes;
-
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-
-	/* read file header if required */
-	if (*fileheaderread == MB_NO)
-	    {
-	    read_len = fread(line,1,MBF_XTFR8101_FILEHEADERLEN,mb_io_ptr->mbfp);
-	    if (read_len == MBF_XTFR8101_FILEHEADERLEN)
-		{
-		/* extract data from buffer */
-		*fileheaderread = MB_YES;
-		status = MB_SUCCESS;
-		index = 0;
-		fileheader->FileFormat = line[index];
-		index++;
-		fileheader->SystemType = line[index];
-		index++;
-		for (i=0;i<8;i++)
-			fileheader->RecordingProgramName[i] = line[index+i];
-		index += 8;
-		for (i=0;i<8;i++)
-			fileheader->RecordingProgramVersion[i] = line[index+i];
-		index += 8;
-		for (i=0;i<16;i++)
-			fileheader->SonarName[i] = line[index+i];
-		index += 16;
-		mb_get_binary_short(MB_YES, &line[index], (short int *)&(fileheader->SonarType));
-		index += 2;
-		for (i=0;i<64;i++)
-			fileheader->NoteString[i] = line[index+i];
-		index += 64;
-		for (i=0;i<64;i++)
-			fileheader->ThisFileName[i] = line[index+i];
-		index += 64;
-		mb_get_binary_short(MB_YES, &line[index], (short int *)&(fileheader->NavUnits));
-		index += 2;
-		mb_get_binary_short(MB_YES, &line[index], (short int *)&(fileheader->NumberOfSonarChannels));
-		index += 2;
-		mb_get_binary_short(MB_YES, &line[index], (short int *)&(fileheader->NumberOfBathymetryChannels));
-		index += 2;
-		mb_get_binary_short(MB_YES, &line[index], (short int *)&(fileheader->Reserved1));
-		index += 2;
-		mb_get_binary_short(MB_YES, &line[index], (short int *)&(fileheader->Reserved2));
-		index += 2;
-		mb_get_binary_short(MB_YES, &line[index], (short int *)&(fileheader->Reserved3));
-		index += 2;
-		mb_get_binary_short(MB_YES, &line[index], (short int *)&(fileheader->Reserved4));
-		index += 2;
-		mb_get_binary_short(MB_YES, &line[index], (short int *)&(fileheader->Reserved5));
-		index += 2;
-		mb_get_binary_short(MB_YES, &line[index], (short int *)&(fileheader->Reserved6));
-		index += 2;
-		for (i=0;i<12;i++)
-			fileheader->ProjectionType[i] = line[index+i];
-		index += 12;
-		for (i=0;i<10;i++)
-			fileheader->SpheroidType[i] = line[index+i];
-		index += 10;
-		mb_get_binary_int(MB_YES, &line[index], (int *)&(fileheader->NavigationLatency));
-		index += 4;
-		mb_get_binary_float(MB_YES, &line[index], &(fileheader->OriginY));
-		index += 4;
-		mb_get_binary_float(MB_YES, &line[index], &(fileheader->OriginX));
-		index += 4;
-		mb_get_binary_float(MB_YES, &line[index], &(fileheader->NavOffsetY));
-		index += 4;
-		mb_get_binary_float(MB_YES, &line[index], &(fileheader->NavOffsetX));
-		index += 4;
-		mb_get_binary_float(MB_YES, &line[index], &(fileheader->NavOffsetZ));
-		index += 4;
-		mb_get_binary_float(MB_YES, &line[index], &(fileheader->NavOffsetYaw));
-		index += 4;
-		mb_get_binary_float(MB_YES, &line[index], &(fileheader->MRUOffsetY));
-		index += 4;
-		mb_get_binary_float(MB_YES, &line[index], &(fileheader->MRUOffsetX));
-		index += 4;
-		mb_get_binary_float(MB_YES, &line[index], &(fileheader->MRUOffsetZ));
-		index += 4;
-		mb_get_binary_float(MB_YES, &line[index], &(fileheader->MRUOffsetYaw));
-		index += 4;
-		mb_get_binary_float(MB_YES, &line[index], &(fileheader->MRUOffsetPitch));
-		index += 4;
-		mb_get_binary_float(MB_YES, &line[index], &(fileheader->MRUOffsetRoll));
-		index += 4;
-		for (ichan=0;ichan<6;ichan++)
-			{
-			fileheader->chaninfo[ichan].TypeOfChannel = line[index];
-			index++;
-			fileheader->chaninfo[ichan].SubChannelNumber = line[index];
-			index++;
-			mb_get_binary_short(MB_YES, &line[index], (short int *)&(fileheader->chaninfo[ichan].CorrectionFlags));
-			index += 2;
-			mb_get_binary_short(MB_YES, &line[index], (short int *)&(fileheader->chaninfo[ichan].UniPolar));
-			index += 2;
-			mb_get_binary_short(MB_YES, &line[index], (short int *)&(fileheader->chaninfo[ichan].BytesPerSample));
-			index += 2;
-			mb_get_binary_int(MB_YES, &line[index], (int *)&(fileheader->chaninfo[ichan].SamplesPerChannel));
-			index += 4;
-			for (i=0;i<16;i++)
-				fileheader->chaninfo[ichan].ChannelName[i] = line[index+i];
-			index += 16;
-			mb_get_binary_float(MB_YES, &line[index], &(fileheader->chaninfo[ichan].VoltScale));
-			index += 4;
-			mb_get_binary_float(MB_YES, &line[index], &(fileheader->chaninfo[ichan].Frequency));
-			index += 4;
-			mb_get_binary_float(MB_YES, &line[index], &(fileheader->chaninfo[ichan].HorizBeamAngle));
-			index += 4;
-			mb_get_binary_float(MB_YES, &line[index], &(fileheader->chaninfo[ichan].TiltAngle));
-			index += 4;
-			mb_get_binary_float(MB_YES, &line[index], &(fileheader->chaninfo[ichan].BeamWidth));
-			index += 4;
-			mb_get_binary_float(MB_YES, &line[index], &(fileheader->chaninfo[ichan].OffsetX));
-			index += 4;
-			mb_get_binary_float(MB_YES, &line[index], &(fileheader->chaninfo[ichan].OffsetY));
-			index += 4;
-			mb_get_binary_float(MB_YES, &line[index], &(fileheader->chaninfo[ichan].OffsetZ));
-			index += 4;
-			mb_get_binary_float(MB_YES, &line[index], &(fileheader->chaninfo[ichan].OffsetYaw));
-			index += 4;
-			mb_get_binary_float(MB_YES, &line[index], &(fileheader->chaninfo[ichan].OffsetPitch));
-			index += 4;
-			mb_get_binary_float(MB_YES, &line[index], &(fileheader->chaninfo[ichan].OffsetRoll));
-			index += 4;
-			for (i=0;i<56;i++)
-				fileheader->chaninfo[ichan].ReservedArea[i] = line[index+i];
-			index += 56;
-			}
-
-		/* if NavUnits indicates use of projected coordinates (the format spec
-			indicates the projection parameters are unused!) assume UTM zone 1N
-			and set up the projection */
-		if (fileheader->NavUnits == 0 && mb_io_ptr->projection_initialized == MB_NO)
-			{
-			/* initialize UTM projection */
-			utm_zone = (int)(((RTD * 0.0 + 183.0)
-					/ 6.0) + 0.5);
-			sprintf(projection,"UTM%2.2dN", utm_zone);
-			mb_proj_init(verbose, projection, &(mb_io_ptr->pjptr), error);
-			mb_io_ptr->projection_initialized = MB_YES;
-			}
-
-		/* print debug statements */
-		if (verbose >= 5)
-			{
-			fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-			fprintf(stderr,"dbg5       FileFormat:                 %d\n",fileheader->FileFormat);
-			fprintf(stderr,"dbg5       SystemType:                 %d\n",fileheader->SystemType);
-			fprintf(stderr,"dbg5       RecordingProgramName:       %s\n",fileheader->RecordingProgramName);
-			fprintf(stderr,"dbg5       RecordingProgramVersion:    %s\n",fileheader->RecordingProgramVersion);
-			fprintf(stderr,"dbg5       SonarName:                  %s\n",fileheader->SonarName);
-			fprintf(stderr,"dbg5       SonarType:                  %d\n",fileheader->SonarType);
-			fprintf(stderr,"dbg5       NoteString:                 %s\n",fileheader->NoteString);
-			fprintf(stderr,"dbg5       ThisFileName:               %s\n",fileheader->ThisFileName);
-			fprintf(stderr,"dbg5       NavUnits:                   %d\n",fileheader->NavUnits);
-			fprintf(stderr,"dbg5       NumberOfSonarChannels:      %d\n",fileheader->NumberOfSonarChannels);
-			fprintf(stderr,"dbg5       NumberOfBathymetryChannels: %d\n",fileheader->NumberOfBathymetryChannels);
-			fprintf(stderr,"dbg5       Reserved1:                  %d\n",fileheader->Reserved1);
-			fprintf(stderr,"dbg5       Reserved2:                  %d\n",fileheader->Reserved2);
-			fprintf(stderr,"dbg5       Reserved3:                  %d\n",fileheader->Reserved3);
-			fprintf(stderr,"dbg5       Reserved4:                  %d\n",fileheader->Reserved4);
-			fprintf(stderr,"dbg5       Reserved5:                  %d\n",fileheader->Reserved5);
-			fprintf(stderr,"dbg5       Reserved6:                  %d\n",fileheader->Reserved6);
-			fprintf(stderr,"dbg5       ProjectionType:             %s\n",fileheader->ProjectionType);
-			fprintf(stderr,"dbg5       SpheroidType:               %s\n",fileheader->SpheroidType);
-			fprintf(stderr,"dbg5       NavigationLatency:          %d\n",fileheader->NavigationLatency);
-			fprintf(stderr,"dbg5       OriginY:                    %f\n",fileheader->OriginY);
-			fprintf(stderr,"dbg5       OriginX:                    %f\n",fileheader->OriginX);
-			fprintf(stderr,"dbg5       NavOffsetY:                 %f\n",fileheader->NavOffsetY);
-			fprintf(stderr,"dbg5       NavOffsetX:                 %f\n",fileheader->NavOffsetX);
-			fprintf(stderr,"dbg5       NavOffsetZ:                 %f\n",fileheader->NavOffsetZ);
-			fprintf(stderr,"dbg5       NavOffsetYaw:               %f\n",fileheader->NavOffsetYaw);
-			fprintf(stderr,"dbg5       MRUOffsetY:                 %f\n",fileheader->MRUOffsetY);
-			fprintf(stderr,"dbg5       MRUOffsetX:                 %f\n",fileheader->MRUOffsetX);
-			fprintf(stderr,"dbg5       MRUOffsetZ:                 %f\n",fileheader->MRUOffsetZ);
-			fprintf(stderr,"dbg5       MRUOffsetYaw:               %f\n",fileheader->MRUOffsetYaw);
-			fprintf(stderr,"dbg5       MRUOffsetPitch:             %f\n",fileheader->MRUOffsetPitch);
-			fprintf(stderr,"dbg5       MRUOffsetRoll:              %f\n",fileheader->MRUOffsetRoll);
-			for (i=0;i<fileheader->NumberOfSonarChannels
-				+ fileheader->NumberOfBathymetryChannels;i++)
-			    {
-			    fprintf(stderr,"dbg5       TypeOfChannel:              %d\n",fileheader->chaninfo[i].TypeOfChannel);
-			    fprintf(stderr,"dbg5       SubChannelNumber:           %d\n",fileheader->chaninfo[i].SubChannelNumber);
-			    fprintf(stderr,"dbg5       CorrectionFlags:            %d\n",fileheader->chaninfo[i].CorrectionFlags);
-			    fprintf(stderr,"dbg5       UniPolar:                   %d\n",fileheader->chaninfo[i].UniPolar);
-			    fprintf(stderr,"dbg5       BytesPerSample:             %d\n",fileheader->chaninfo[i].BytesPerSample);
-			    fprintf(stderr,"dbg5       SamplesPerChannel:          %d\n",fileheader->chaninfo[i].SamplesPerChannel);
-			    fprintf(stderr,"dbg5       ChannelName:                %s\n",fileheader->chaninfo[i].ChannelName);
-			    fprintf(stderr,"dbg5       VoltScale:                  %f\n",fileheader->chaninfo[i].VoltScale);
-			    fprintf(stderr,"dbg5       Frequency:                  %f\n",fileheader->chaninfo[i].Frequency);
-			    fprintf(stderr,"dbg5       HorizBeamAngle:             %f\n",fileheader->chaninfo[i].HorizBeamAngle);
-			    fprintf(stderr,"dbg5       TiltAngle:                  %f\n",fileheader->chaninfo[i].TiltAngle);
-			    fprintf(stderr,"dbg5       BeamWidth:                  %f\n",fileheader->chaninfo[i].BeamWidth);
-			    fprintf(stderr,"dbg5       OffsetX:                    %f\n",fileheader->chaninfo[i].OffsetX);
-			    fprintf(stderr,"dbg5       OffsetY:                    %f\n",fileheader->chaninfo[i].OffsetY);
-			    fprintf(stderr,"dbg5       OffsetZ:                    %f\n",fileheader->chaninfo[i].OffsetZ);
-			    fprintf(stderr,"dbg5       OffsetYaw:                  %f\n",fileheader->chaninfo[i].OffsetYaw);
-			    fprintf(stderr,"dbg5       OffsetPitch:                %f\n",fileheader->chaninfo[i].OffsetPitch);
-			    fprintf(stderr,"dbg5       OffsetRoll:                 %f\n",fileheader->chaninfo[i].OffsetRoll);
-			    fprintf(stderr,"dbg5       ReservedArea:               %s\n",fileheader->chaninfo[i].ReservedArea);
-			    }
-			}
-		}
-	    else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-	    }
-
-	/* look for next recognizable record */
-	done = MB_NO;
-	while (status == MB_SUCCESS && done == MB_NO)
-	    {
-	    /* find the next packet beginning */
-	    found = MB_NO;
-	    skip = 0;
-	    read_len = fread(line,1,2,mb_io_ptr->mbfp);
-	    if (read_len != 2)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		}
-	    else if (((mb_u_char)line[0]) == 0xce && ((mb_u_char)line[1] == 0xfa))
-		found = MB_YES;
-	    while (status == MB_SUCCESS
-		&& found == MB_NO)
-		{
-		line[0] = line[1];
-		read_len = fread(&(line[1]),1,1,mb_io_ptr->mbfp);
-		skip++;
-		if (read_len != 1)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_EOF;
-			}
-		else if (((mb_u_char)line[0]) == 0xce && ((mb_u_char)line[1] == 0xfa))
-			found = MB_YES;
-		}
-
-	    /* read the next packet header */
-	    read_len = fread(&(line[2]),1,12,mb_io_ptr->mbfp);
-	    if (read_len == 12)
-		{
-		/* extract data from buffer */
-		index = 0;
-		packetheader.MagicNumber[0] = line[index];
-		index++;
-		packetheader.MagicNumber[1] = line[index];
-		index++;
-		packetheader.HeaderType = line[index];
-		index++;
-		packetheader.SubChannelNumber = line[index];
-		index++;
-		mb_get_binary_short(MB_YES, &line[index], (short int *)&(packetheader.NumChansToFollow));
-		index += 2;
-		mb_get_binary_short(MB_YES, &line[index], (short int *)&(packetheader.Reserved1[0]));
-		index += 2;
-		mb_get_binary_short(MB_YES, &line[index], (short int *)&(packetheader.Reserved1[1]));
-		index += 2;
-		mb_get_binary_int(MB_YES, &line[index], (int *)&(packetheader.NumBytesThisRecord));
-		index += 4;
-
-		/* check packet header details */
-		if( packetheader.NumChansToFollow > 20)
-			{
-			if (verbose > 0)
-				fprintf(stderr,"Bad packet header in xtf - skip this record\n");
-			packetheader.NumBytesThisRecord = 0;
-			packetheader.HeaderType = 99;
-			}
-
-		/* print debug statements */
-		if (verbose >= 5)
-			{
-			fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-			fprintf(stderr,"dbg5       Bytes Skipped:              %d\n",skip);
-			fprintf(stderr,"dbg5       MagicNumber:                %d %d %x%x\n",
-					packetheader.MagicNumber[0],packetheader.MagicNumber[1],
-					packetheader.MagicNumber[0],packetheader.MagicNumber[1]);
-			fprintf(stderr,"dbg5       HeaderType:                 %d\n",packetheader.HeaderType);
-			fprintf(stderr,"dbg5       SubChannelNumber:           %d\n",packetheader.SubChannelNumber);
-			fprintf(stderr,"dbg5       NumChansToFollow:           %d\n",packetheader.NumChansToFollow);
-			fprintf(stderr,"dbg5       Reserved1:                  %d %d\n",packetheader.Reserved1[0],packetheader.Reserved1[1]);
-			fprintf(stderr,"dbg5       NumBytesThisRecord:         %d\n",packetheader.NumBytesThisRecord);
-			}
-		}
-	    else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_EOF;
-		done = MB_YES;
-		}
-
-	    /* read rest of attitude packet */
-	    if (status == MB_SUCCESS
-		&& packetheader.HeaderType == XTF_DATA_ATTITUDE
-		&& packetheader.NumBytesThisRecord == 64)
-		{
-#ifdef MBR_XTFR8101_DEBUG
-fprintf(stderr,"Reading attitude packet type:%d bytes:%d\n",
-packetheader.HeaderType,packetheader.NumBytesThisRecord);
-#endif
-		attitudeheader->packetheader = packetheader;
-		read_len = fread(line,1,50,mb_io_ptr->mbfp);
-		if (read_len == 50)
-		    {
-		    /* parse the rest of the attitude record */
-		    index = 0;
-		    for (i=0;i<4;i++)
-			{
-			mb_get_binary_int(MB_YES, &line[index], (int *)&(attitudeheader->Reserved2[i]));
-			index += 4;
-			}
-		    mb_get_binary_float(MB_YES, &line[index], &(attitudeheader->Pitch));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(attitudeheader->Roll));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(attitudeheader->Heave));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(attitudeheader->Yaw));
-		    index += 4;
-		    mb_get_binary_int(MB_YES, &line[index], (int *)&(attitudeheader->TimeTag));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(attitudeheader->Heading));
-		    index += 4;
-		    for (i=0;i<10;i++)
-			{
-			attitudeheader->Reserved3[i] = line[index];
-			index++;
-			}
-
-		    /* add attitude to list for interpolation */
-		    timetag = 0.001 *  attitudeheader->TimeTag;
-		    heave = attitudeheader->Heave;
-		    roll = attitudeheader->Roll;
-		    pitch = attitudeheader->Pitch;
-		    heading = attitudeheader->Heading;
-
-		    /* add latest attitude to list */
-		    mb_attint_add(verbose, mbio_ptr,
-				    timetag, heave, roll, pitch,
-				    error);
-		    mb_hedint_add(verbose, mbio_ptr,
-				    timetag, heading, error);
-
-		    /* print debug statements */
-		    if (verbose >= 5)
-			{
-			fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-			fprintf(stderr,"dbg5       MagicNumber:                %d %d %x%x\n",
-					attitudeheader->packetheader.MagicNumber[0],attitudeheader->packetheader.MagicNumber[1],
-					attitudeheader->packetheader.MagicNumber[0],attitudeheader->packetheader.MagicNumber[1]);
-			fprintf(stderr,"dbg5       HeaderType:                 %d\n",attitudeheader->packetheader.HeaderType);
-			fprintf(stderr,"dbg5       SubChannelNumber:           %d\n",attitudeheader->packetheader.SubChannelNumber);
-			fprintf(stderr,"dbg5       NumChansToFollow:           %d\n",attitudeheader->packetheader.NumChansToFollow);
-			fprintf(stderr,"dbg5       Reserved1:                  %d %d\n",attitudeheader->packetheader.Reserved1[0],attitudeheader->packetheader.Reserved1[1]);
-			fprintf(stderr,"dbg5       NumBytesThisRecord:         %d\n",attitudeheader->packetheader.NumBytesThisRecord);
-			fprintf(stderr,"dbg5       Reserved2[0]:               %d\n",attitudeheader->Reserved2[0]);
-			fprintf(stderr,"dbg5       Reserved2[1]:               %d\n",attitudeheader->Reserved2[1]);
-			fprintf(stderr,"dbg5       Reserved2[2]:               %d\n",attitudeheader->Reserved2[2]);
-			fprintf(stderr,"dbg5       Reserved2[3]:               %d\n",attitudeheader->Reserved2[3]);
-			fprintf(stderr,"dbg5       Pitch:                      %f\n",attitudeheader->Pitch);
-			fprintf(stderr,"dbg5       Roll:                       %f\n",attitudeheader->Roll);
-			fprintf(stderr,"dbg5       Heave:                      %f\n",attitudeheader->Heave);
-			fprintf(stderr,"dbg5       Yaw:                        %f\n",attitudeheader->Yaw);
-			fprintf(stderr,"dbg5       TimeTag:                    %d\n",attitudeheader->TimeTag);
-			fprintf(stderr,"dbg5       Heading:                    %f\n",attitudeheader->Heading);
-			}
-		    }
-		else
-		    {
-		    status = MB_FAILURE;
-		    *error = MB_ERROR_EOF;
-		    done = MB_YES;
-		    }
-		}
-
-	    /* read rest of sidescan packet */
-	    else if (status == MB_SUCCESS
-		&& packetheader.HeaderType == XTF_DATA_SIDESCAN)
-		{
-#ifdef MBR_XTFR8101_DEBUG
-fprintf(stderr,"Reading sidescan packet type:%d bytes:%d\n",
-packetheader.HeaderType,packetheader.NumBytesThisRecord);
-#endif
-		/* read and parse the the sidescan header */
-		sidescanheader->packetheader = packetheader;
-		read_len = fread(line,1,242,mb_io_ptr->mbfp);
-		if (read_len == 242)
-		    {
-		    index = 0;
-		    mb_get_binary_short(MB_YES, &line[index], (short int *)&(sidescanheader->Year));
-		    index += 2;
-		    sidescanheader->Month = line[index];
-		    index++;
-		    sidescanheader->Day = line[index];
-		    index++;
-		    sidescanheader->Hour = line[index];
-		    index++;
-		    sidescanheader->Minute = line[index];
-		    index++;
-		    sidescanheader->Second = line[index];
-		    index++;
-		    sidescanheader->HSeconds = line[index];
-		    index++;
-		    mb_get_binary_short(MB_YES, &line[index], (short int *)&(sidescanheader->JulianDay));
-		    index += 2;
-		    mb_get_binary_short(MB_YES, &line[index], (short int *)&(sidescanheader->CurrentLineID));
-		    index += 2;
-		    mb_get_binary_short(MB_YES, &line[index], (short int *)&(sidescanheader->EventNumber));
-		    index += 2;
-		    mb_get_binary_int(MB_YES, &line[index], (int *)&(sidescanheader->PingNumber));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(sidescanheader->SoundVelocity));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(sidescanheader->OceanTide));
-		    index += 4;
-		    mb_get_binary_int(MB_YES, &line[index], (int *)&(sidescanheader->Reserved2));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(sidescanheader->ConductivityFreq));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(sidescanheader->TemperatureFreq));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(sidescanheader->PressureFreq));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(sidescanheader->PressureTemp));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(sidescanheader->Conductivity));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(sidescanheader->WaterTemperature));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(sidescanheader->Pressure));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(sidescanheader->ComputedSoundVelocity));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(sidescanheader->MagX));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(sidescanheader->MagY));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(sidescanheader->MagZ));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(sidescanheader->AuxVal1));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(sidescanheader->AuxVal2));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(sidescanheader->AuxVal3));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(sidescanheader->AuxVal4));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(sidescanheader->AuxVal5));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(sidescanheader->AuxVal6));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(sidescanheader->SpeedLog));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(sidescanheader->Turbidity));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(sidescanheader->ShipSpeed));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(sidescanheader->ShipGyro));
-		    index += 4;
-		    mb_get_binary_double(MB_YES, &line[index], &(sidescanheader->ShipYcoordinate));
-		    index += 8;
-		    mb_get_binary_double(MB_YES, &line[index], &(sidescanheader->ShipXcoordinate));
-		    index += 8;
-		    mb_get_binary_short(MB_YES, &line[index], (short int *)&(sidescanheader->ShipAltitude));
-		    index += 2;
-		    mb_get_binary_short(MB_YES, &line[index], (short int *)&(sidescanheader->ShipDepth));
-		    index += 2;
-		    sidescanheader->FixTimeHour = line[index];
-		    index++;
-		    sidescanheader->FixTimeMinute = line[index];
-		    index++;
-		    sidescanheader->FixTimeSecond = line[index];
-		    index++;
-		    sidescanheader->Reserved4 = line[index];
-		    index++;
-		    mb_get_binary_float(MB_YES, &line[index], &(sidescanheader->SensorSpeed));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(sidescanheader->KP));
-		    index += 4;
-		    mb_get_binary_double(MB_YES, &line[index], &(sidescanheader->SensorYcoordinate));
-		    index += 8;
-		    mb_get_binary_double(MB_YES, &line[index], &(sidescanheader->SensorXcoordinate));
-		    index += 8;
-		    mb_get_binary_short(MB_YES, &line[index], &(sidescanheader->Reserved6));
-		    index += 2;
-		    mb_get_binary_short(MB_YES, &line[index], &(sidescanheader->RangeToSensor));
-		    index += 2;
-		    mb_get_binary_short(MB_YES, &line[index], &(sidescanheader->BearingToSensor));
-		    index += 2;
-		    mb_get_binary_short(MB_YES, &line[index], &(sidescanheader->CableOut));
-		    index += 2;
-		    mb_get_binary_float(MB_YES, &line[index], &(sidescanheader->Layback));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(sidescanheader->CableTension));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(sidescanheader->SensorDepth));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(sidescanheader->SensorPrimaryAltitude));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(sidescanheader->SensorAuxAltitude));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(sidescanheader->SensorPitch));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(sidescanheader->SensorRoll));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(sidescanheader->SensorHeading));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(sidescanheader->Heave));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(sidescanheader->Yaw));
-		    index += 4;
-		    mb_get_binary_int(MB_YES, &line[index], &(sidescanheader->AttitudeTimeTag));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(sidescanheader->DOT));
-		    index += 4;
-		    for (i=0;i<20;i++)
-			{
-			sidescanheader->ReservedSpace[i] = line[index];
-			index++;
-			}
-		    }
-		else
-		    {
-		    status = MB_FAILURE;
-		    *error = MB_ERROR_EOF;
-		    done = MB_YES;
-		    }
-
-		/* read and parse the port sidescan channel header */
-		if (status == MB_SUCCESS)
-		    read_len = fread(line,1,64,mb_io_ptr->mbfp);
-		if (status == MB_SUCCESS && read_len == 64)
-		    {
-		    index = 0;
-		    mb_get_binary_short(MB_YES, &line[index], (short int *)&(pingchanportheader->ChannelNumber));
-		    index += 2;
-		    mb_get_binary_short(MB_YES, &line[index], (short int *)&(pingchanportheader->DownsampleMethod));
-		    index += 2;
-		    mb_get_binary_float(MB_YES, &line[index], &(pingchanportheader->SlantRange));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(pingchanportheader->GroundRange));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(pingchanportheader->TimeDelay));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(pingchanportheader->TimeDuration));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(pingchanportheader->SecondsPerPing));
-		    index += 4;
-		    mb_get_binary_short(MB_YES, &line[index], (short int *)&(pingchanportheader->ProcessingFlags));
-		    index += 2;
-		    mb_get_binary_short(MB_YES, &line[index], (short int *)&(pingchanportheader->Frequency));
-		    index += 2;
-		    mb_get_binary_short(MB_YES, &line[index], (short int *)&(pingchanportheader->InitialGainCode));
-		    index += 2;
-		    mb_get_binary_short(MB_YES, &line[index], (short int *)&(pingchanportheader->GainCode));
-		    index += 2;
-		    mb_get_binary_short(MB_YES, &line[index], (short int *)&(pingchanportheader->BandWidth));
-		    index += 2;
-		    mb_get_binary_int(MB_YES, &line[index], (int *)&(pingchanportheader->ContactNumber));
-		    index += 4;
-		    mb_get_binary_short(MB_YES, &line[index], (short int *)&(pingchanportheader->ContactClassification));
-		    index += 2;
-		    pingchanportheader->ContactSubNumber = (mb_u_char) line[index];
-		    index++;
-		    pingchanportheader->ContactType = (mb_u_char) line[index];
-		    index++;
-		    mb_get_binary_int(MB_YES, &line[index], (int *)&(pingchanportheader->NumSamples));
-		    index += 4;
-		    mb_get_binary_short(MB_YES, &line[index], (short int *)&(pingchanportheader->Reserved));
-		    index += 2;
-		    mb_get_binary_float(MB_YES, &line[index], &(pingchanportheader->ContactTimeOffTrack));
-		    index += 4;
-		    pingchanportheader->ContactCloseNumber = (mb_u_char) line[index];
-		    index++;
-		    pingchanportheader->Reserved2 = (mb_u_char) line[index];
-		    index++;
-		    mb_get_binary_float(MB_YES, &line[index], &(pingchanportheader->FixedVSOP));
-		    index += 4;
-		    for (i=0;i<6;i++)
-			{
-			pingchanportheader->ReservedSpace[i] = (mb_u_char) line[index];
-			index++;
-			}
-
-		    /* fix up on time duration if needed */
-		    if ( pingchanportheader->TimeDuration == 0.0)
-		    	{
-		    	pingchanportheader->TimeDuration
-				= pingchanportheader->SlantRange
-					/ sidescanheader->SoundVelocity;
-		    	}
-		    }
-		else
-		    {
-		    status = MB_FAILURE;
-		    *error = MB_ERROR_EOF;
-		    done = MB_YES;
-		    }
-
-		/* check for corrupted record */
-		if (pingchanportheader->ChannelNumber
-			> (fileheader->NumberOfSonarChannels
-				+ fileheader->NumberOfBathymetryChannels - 1))
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_UNINTELLIGIBLE;
-			}
-		else if (pingchanportheader->NumSamples
-			> fileheader->chaninfo[pingchanportheader->ChannelNumber].SamplesPerChannel)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_UNINTELLIGIBLE;
-			}
-
-		/* read port sidescan data */
-		if (status == MB_SUCCESS)
-		    {
-		    read_bytes = pingchanportheader->NumSamples
-				    * fileheader->chaninfo[pingchanportheader->ChannelNumber].BytesPerSample;
-		    read_len = fread(line,1,read_bytes,mb_io_ptr->mbfp);
-		    }
-		if (status == MB_SUCCESS && read_len == read_bytes)
-		    {
-		    if (fileheader->chaninfo[pingchanportheader->ChannelNumber].BytesPerSample == 1)
-			{
-			for (i=0;i<pingchanportheader->NumSamples;i++)
-			    {
-			    mb_u_char_ptr = (mb_u_char *) &line[i];
-			    data->ssrawport[i] = (unsigned short) (*mb_u_char_ptr);
-			    }
-			}
-		    else if (fileheader->chaninfo[pingchanportheader->ChannelNumber].BytesPerSample == 2)
-			{
-			index = 0;
-			for (i=0;i<pingchanportheader->NumSamples;i++)
-			    {
-			    mb_get_binary_short(MB_YES, &line[index], (short *)&(data->ssrawport[i]));
-			    index += 2;
-			    }
-			}
-		    }
-		else
-		    {
-		    status = MB_FAILURE;
-		    *error = MB_ERROR_EOF;
-		    done = MB_YES;
-		    }
-
-		/* read and parse the starboard sidescan channel header */
-		if (status == MB_SUCCESS)
-		    read_len = fread(line,1,64,mb_io_ptr->mbfp);
-		if (status == MB_SUCCESS && read_len == 64)
-		    {
-		    index = 0;
-		    mb_get_binary_short(MB_YES, &line[index], (short int *)&(pingchanstbdheader->ChannelNumber));
-		    index += 2;
-		    mb_get_binary_short(MB_YES, &line[index], (short int *)&(pingchanstbdheader->DownsampleMethod));
-		    index += 2;
-		    mb_get_binary_float(MB_YES, &line[index], &(pingchanstbdheader->SlantRange));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(pingchanstbdheader->GroundRange));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(pingchanstbdheader->TimeDelay));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(pingchanstbdheader->TimeDuration));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(pingchanstbdheader->SecondsPerPing));
-		    index += 4;
-		    mb_get_binary_short(MB_YES, &line[index], (short int *)&(pingchanstbdheader->ProcessingFlags));
-		    index += 2;
-		    mb_get_binary_short(MB_YES, &line[index], (short int *)&(pingchanstbdheader->Frequency));
-		    index += 2;
-		    mb_get_binary_short(MB_YES, &line[index], (short int *)&(pingchanstbdheader->InitialGainCode));
-		    index += 2;
-		    mb_get_binary_short(MB_YES, &line[index], (short int *)&(pingchanstbdheader->GainCode));
-		    index += 2;
-		    mb_get_binary_short(MB_YES, &line[index], (short int *)&(pingchanstbdheader->BandWidth));
-		    index += 2;
-		    mb_get_binary_int(MB_YES, &line[index], (int *)&(pingchanstbdheader->ContactNumber));
-		    index += 4;
-		    mb_get_binary_short(MB_YES, &line[index], (short int *)&(pingchanstbdheader->ContactClassification));
-		    index += 2;
-		    pingchanstbdheader->ContactSubNumber = (mb_u_char) line[index];
-		    index++;
-		    pingchanstbdheader->ContactType = (mb_u_char) line[index];
-		    index++;
-		    mb_get_binary_int(MB_YES, &line[index], (int *)&(pingchanstbdheader->NumSamples));
-		    index += 4;
-		    mb_get_binary_short(MB_YES, &line[index], (short int *)&(pingchanstbdheader->Reserved));
-		    index += 2;
-		    mb_get_binary_float(MB_YES, &line[index], &(pingchanstbdheader->ContactTimeOffTrack));
-		    index += 4;
-		    pingchanstbdheader->ContactCloseNumber = (mb_u_char) line[index];
-		    index++;
-		    pingchanstbdheader->Reserved2 = (mb_u_char) line[index];
-		    index++;
-		    mb_get_binary_float(MB_YES, &line[index], &(pingchanstbdheader->FixedVSOP));
-		    index += 4;
-		    for (i=0;i<6;i++)
-			{
-			pingchanstbdheader->ReservedSpace[i] = (mb_u_char) line[index];
-			index++;
-			}
-
-		    /* fix up on time duration if needed */
-		    if ( pingchanstbdheader->TimeDuration == 0.0)
-		    	{
-		    	pingchanstbdheader->TimeDuration
-				= pingchanstbdheader->SlantRange
-					/ sidescanheader->SoundVelocity;
-		    	}
-		    }
-		else
-		    {
-		    status = MB_FAILURE;
-		    *error = MB_ERROR_EOF;
-		    done = MB_YES;
-		    }
-
-		/* check for corrupted record */
-		if (pingchanstbdheader->ChannelNumber
-			> (fileheader->NumberOfSonarChannels
-				+ fileheader->NumberOfBathymetryChannels - 1))
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_UNINTELLIGIBLE;
-			}
-		else if (pingchanstbdheader->NumSamples
-			> fileheader->chaninfo[pingchanstbdheader->ChannelNumber].SamplesPerChannel)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_UNINTELLIGIBLE;
-			}
-
-		/* read starboard sidescan data */
-		if (status == MB_SUCCESS)
-		    {
-		    read_bytes = pingchanstbdheader->NumSamples
-				    * fileheader->chaninfo[pingchanstbdheader->ChannelNumber].BytesPerSample;
-		    read_len = fread(line,1,read_bytes,mb_io_ptr->mbfp);
-		    }
-		if (status == MB_SUCCESS && read_len == read_bytes)
-		    {
-		    if (fileheader->chaninfo[pingchanstbdheader->ChannelNumber].BytesPerSample == 1)
-			{
-			for (i=0;i<pingchanstbdheader->NumSamples;i++)
-			    {
-			    mb_u_char_ptr = (mb_u_char *) &line[i];
-			    data->ssrawstbd[i] = (unsigned short) (*mb_u_char_ptr);
-			    }
-			}
-		    else if (fileheader->chaninfo[pingchanstbdheader->ChannelNumber].BytesPerSample == 2)
-			{
-			index = 0;
-			for (i=0;i<pingchanstbdheader->NumSamples;i++)
-			    {
-			    mb_get_binary_short(MB_YES, &line[index], (short *)&(data->ssrawstbd[i]));
-			    index += 2;
-			    }
-			}
-		    }
-		else
-		    {
-		    status = MB_FAILURE;
-		    *error = MB_ERROR_EOF;
-		    done = MB_YES;
-		    }
-
-		/* print debug statements */
-		if (verbose >= 5)
-		    {
-		    fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-		    fprintf(stderr,"dbg5       MagicNumber:                %d %d %x%x\n",
-				    sidescanheader->packetheader.MagicNumber[0],sidescanheader->packetheader.MagicNumber[1],
-				    sidescanheader->packetheader.MagicNumber[0],sidescanheader->packetheader.MagicNumber[1]);
-		    fprintf(stderr,"dbg5       HeaderType:                 %d\n",sidescanheader->packetheader.HeaderType);
-		    fprintf(stderr,"dbg5       SubChannelNumber:           %d\n",sidescanheader->packetheader.SubChannelNumber);
-		    fprintf(stderr,"dbg5       NumChansToFollow:           %d\n",sidescanheader->packetheader.NumChansToFollow);
-		    fprintf(stderr,"dbg5       Reserved1:                  %d %d\n",sidescanheader->packetheader.Reserved1[0],sidescanheader->packetheader.Reserved1[1]);
-		    fprintf(stderr,"dbg5       NumBytesThisRecord:         %d\n",sidescanheader->packetheader.NumBytesThisRecord);
-		    fprintf(stderr,"dbg5       Year:                       %d\n",sidescanheader->Year);
-		    fprintf(stderr,"dbg5       Month:                      %d\n",sidescanheader->Month);
-		    fprintf(stderr,"dbg5       Day:                        %d\n",sidescanheader->Day);
-		    fprintf(stderr,"dbg5       Hour:                       %d\n",sidescanheader->Hour);
-		    fprintf(stderr,"dbg5       Minute:                     %d\n",sidescanheader->Minute);
-		    fprintf(stderr,"dbg5       Second:                     %d\n",sidescanheader->Second);
-		    fprintf(stderr,"dbg5       HSeconds:                   %d\n",sidescanheader->HSeconds);
-		    fprintf(stderr,"dbg5       JulianDay:                  %d\n",sidescanheader->JulianDay);
-		    fprintf(stderr,"dbg5       CurrentLineID:              %d\n",sidescanheader->CurrentLineID);
-		    fprintf(stderr,"dbg5       EventNumber:                %d\n",sidescanheader->EventNumber);
-		    fprintf(stderr,"dbg5       PingNumber:                 %d\n",sidescanheader->PingNumber);
-		    fprintf(stderr,"dbg5       SoundVelocity:              %f\n",sidescanheader->SoundVelocity);
-		    fprintf(stderr,"dbg5       OceanTide:                  %f\n",sidescanheader->OceanTide);
-		    fprintf(stderr,"dbg5       Reserved2:                  %d\n",sidescanheader->Reserved2);
-		    fprintf(stderr,"dbg5       ConductivityFreq:           %f\n",sidescanheader->ConductivityFreq);
-		    fprintf(stderr,"dbg5       TemperatureFreq:            %f\n",sidescanheader->TemperatureFreq);
-		    fprintf(stderr,"dbg5       PressureFreq:               %f\n",sidescanheader->PressureFreq);
-		    fprintf(stderr,"dbg5       PressureTemp:               %f\n",sidescanheader->PressureTemp);
-		    fprintf(stderr,"dbg5       Conductivity:               %f\n",sidescanheader->Conductivity);
-		    fprintf(stderr,"dbg5       WaterTemperature:           %f\n",sidescanheader->WaterTemperature);
-		    fprintf(stderr,"dbg5       Pressure:                   %f\n",sidescanheader->Pressure);
-		    fprintf(stderr,"dbg5       ComputedSoundVelocity:      %f\n",sidescanheader->ComputedSoundVelocity);
-		    fprintf(stderr,"dbg5       MagX:                       %f\n",sidescanheader->MagX);
-		    fprintf(stderr,"dbg5       MagY:                       %f\n",sidescanheader->MagY);
-		    fprintf(stderr,"dbg5       MagZ:                       %f\n",sidescanheader->MagZ);
-		    fprintf(stderr,"dbg5       AuxVal1:                    %f\n",sidescanheader->AuxVal1);
-		    fprintf(stderr,"dbg5       AuxVal2:                    %f\n",sidescanheader->AuxVal2);
-		    fprintf(stderr,"dbg5       AuxVal3:                    %f\n",sidescanheader->AuxVal3);
-		    fprintf(stderr,"dbg5       AuxVal4:                    %f\n",sidescanheader->AuxVal4);
-		    fprintf(stderr,"dbg5       AuxVal5:                    %f\n",sidescanheader->AuxVal5);
-		    fprintf(stderr,"dbg5       AuxVal6:                    %f\n",sidescanheader->AuxVal6);
-		    fprintf(stderr,"dbg5       SpeedLog:                   %f\n",sidescanheader->SpeedLog);
-		    fprintf(stderr,"dbg5       Turbidity:                  %f\n",sidescanheader->Turbidity);
-		    fprintf(stderr,"dbg5       ShipSpeed:                  %f\n",sidescanheader->ShipSpeed);
-		    fprintf(stderr,"dbg5       ShipGyro:                   %f\n",sidescanheader->ShipGyro);
-		    fprintf(stderr,"dbg5       ShipYcoordinate:            %f\n",sidescanheader->ShipYcoordinate);
-		    fprintf(stderr,"dbg5       ShipXcoordinate:            %f\n",sidescanheader->ShipXcoordinate);
-		    fprintf(stderr,"dbg5       ShipAltitude:               %d\n",sidescanheader->ShipAltitude);
-		    fprintf(stderr,"dbg5       ShipDepth:                  %d\n",sidescanheader->ShipDepth);
-		    fprintf(stderr,"dbg5       FixTimeHour:                %d\n",sidescanheader->FixTimeHour);
-		    fprintf(stderr,"dbg5       FixTimeMinute:              %d\n",sidescanheader->FixTimeMinute);
-		    fprintf(stderr,"dbg5       FixTimeSecond:              %d\n",sidescanheader->FixTimeSecond);
-		    fprintf(stderr,"dbg5       Reserved4:                  %d\n",sidescanheader->Reserved4);
-		    fprintf(stderr,"dbg5       SensorSpeed:                %f\n",sidescanheader->SensorSpeed);
-		    fprintf(stderr,"dbg5       KP:                         %f\n",sidescanheader->KP);
-		    fprintf(stderr,"dbg5       SensorYcoordinate:          %f\n",sidescanheader->SensorYcoordinate);
-		    fprintf(stderr,"dbg5       SensorXcoordinate:          %f\n",sidescanheader->SensorXcoordinate);
-		    fprintf(stderr,"dbg5       Reserved6:                  %d\n",sidescanheader->Reserved6);
-		    fprintf(stderr,"dbg5       RangeToSensor:              %d\n",sidescanheader->RangeToSensor);
-		    fprintf(stderr,"dbg5       BearingToSensor:            %d\n",sidescanheader->BearingToSensor);
-		    fprintf(stderr,"dbg5       CableOut:                   %d\n",sidescanheader->CableOut);
-		    fprintf(stderr,"dbg5       Layback:                    %f\n",sidescanheader->Layback);
-		    fprintf(stderr,"dbg5       CableTension:               %f\n",sidescanheader->CableTension);
-		    fprintf(stderr,"dbg5       SensorDepth:                %f\n",sidescanheader->SensorDepth);
-		    fprintf(stderr,"dbg5       SensorPrimaryAltitude:      %f\n",sidescanheader->SensorPrimaryAltitude);
-		    fprintf(stderr,"dbg5       SensorAuxAltitude:          %f\n",sidescanheader->SensorAuxAltitude);
-		    fprintf(stderr,"dbg5       SensorPitch:                %f\n",sidescanheader->SensorPitch);
-		    fprintf(stderr,"dbg5       SensorRoll:                 %f\n",sidescanheader->SensorRoll);
-		    fprintf(stderr,"dbg5       SensorHeading:              %f\n",sidescanheader->SensorHeading);
-		    fprintf(stderr,"dbg5       Heave:                      %f\n",sidescanheader->Heave);
-		    fprintf(stderr,"dbg5       Yaw:                        %f\n",sidescanheader->Yaw);
-		    fprintf(stderr,"dbg5       AttitudeTimeTag:            %d\n",sidescanheader->AttitudeTimeTag);
-		    fprintf(stderr,"dbg5       DOT:                        %f\n",sidescanheader->DOT);
-		    for (i=0;i<20;i++)
-			fprintf(stderr,"dbg5       ReservedSpace[%2.2d]:          %d\n",i,sidescanheader->ReservedSpace[i]);
-		    fprintf(stderr,"dbg5       ChannelNumber:              %d\n",pingchanportheader->ChannelNumber);
-		    fprintf(stderr,"dbg5       DownsampleMethod:           %d\n",pingchanportheader->DownsampleMethod);
-		    fprintf(stderr,"dbg5       SlantRange:                 %f\n",pingchanportheader->SlantRange);
-		    fprintf(stderr,"dbg5       GroundRange:                %f\n",pingchanportheader->GroundRange);
-		    fprintf(stderr,"dbg5       TimeDelay:                  %f\n",pingchanportheader->TimeDelay);
-		    fprintf(stderr,"dbg5       TimeDuration:               %f\n",pingchanportheader->TimeDuration);
-		    fprintf(stderr,"dbg5       SecondsPerPing:             %f\n",pingchanportheader->SecondsPerPing);
-		    fprintf(stderr,"dbg5       ProcessingFlags:            %d\n",pingchanportheader->ProcessingFlags);
-		    fprintf(stderr,"dbg5       Frequency:                  %d\n",pingchanportheader->Frequency);
-		    fprintf(stderr,"dbg5       InitialGainCode:            %d\n",pingchanportheader->InitialGainCode);
-		    fprintf(stderr,"dbg5       GainCode:                   %d\n",pingchanportheader->GainCode);
-		    fprintf(stderr,"dbg5       BandWidth:                  %d\n",pingchanportheader->BandWidth);
-		    fprintf(stderr,"dbg5       ContactNumber:              %d\n",pingchanportheader->ContactNumber);
-		    fprintf(stderr,"dbg5       ContactClassification:      %d\n",pingchanportheader->ContactClassification);
-		    fprintf(stderr,"dbg5       ContactSubNumber:           %d\n",pingchanportheader->ContactSubNumber);
-		    fprintf(stderr,"dbg5       ContactType:                %d\n",pingchanportheader->ContactType);
-		    fprintf(stderr,"dbg5       NumSamples:                 %d\n",pingchanportheader->NumSamples);
-		    fprintf(stderr,"dbg5       Reserved:                   %d\n",pingchanportheader->Reserved);
-		    fprintf(stderr,"dbg5       ContactTimeOffTrack:        %f\n",pingchanportheader->ContactTimeOffTrack);
-		    fprintf(stderr,"dbg5       ContactCloseNumber:         %d\n",pingchanportheader->ContactCloseNumber);
-		    fprintf(stderr,"dbg5       Reserved2:                  %d\n",pingchanportheader->Reserved2);
-		    fprintf(stderr,"dbg5       FixedVSOP:                  %f\n",pingchanportheader->FixedVSOP);
-		    for (i=0;i<6;i++)
-			fprintf(stderr,"dbg5       ReservedSpace[%2.2d]:          %d\n",i,pingchanportheader->ReservedSpace[i]);
-		    fprintf(stderr,"dbg5       ChannelNumber:              %d\n",pingchanstbdheader->ChannelNumber);
-		    fprintf(stderr,"dbg5       DownsampleMethod:           %d\n",pingchanstbdheader->DownsampleMethod);
-		    fprintf(stderr,"dbg5       SlantRange:                 %f\n",pingchanstbdheader->SlantRange);
-		    fprintf(stderr,"dbg5       GroundRange:                %f\n",pingchanstbdheader->GroundRange);
-		    fprintf(stderr,"dbg5       TimeDelay:                  %f\n",pingchanstbdheader->TimeDelay);
-		    fprintf(stderr,"dbg5       TimeDuration:               %f\n",pingchanstbdheader->TimeDuration);
-		    fprintf(stderr,"dbg5       SecondsPerPing:             %f\n",pingchanstbdheader->SecondsPerPing);
-		    fprintf(stderr,"dbg5       ProcessingFlags:            %d\n",pingchanstbdheader->ProcessingFlags);
-		    fprintf(stderr,"dbg5       Frequency:                  %d\n",pingchanstbdheader->Frequency);
-		    fprintf(stderr,"dbg5       InitialGainCode:            %d\n",pingchanstbdheader->InitialGainCode);
-		    fprintf(stderr,"dbg5       GainCode:                   %d\n",pingchanstbdheader->GainCode);
-		    fprintf(stderr,"dbg5       BandWidth:                  %d\n",pingchanstbdheader->BandWidth);
-		    fprintf(stderr,"dbg5       ContactNumber:              %d\n",pingchanstbdheader->ContactNumber);
-		    fprintf(stderr,"dbg5       ContactClassification:      %d\n",pingchanstbdheader->ContactClassification);
-		    fprintf(stderr,"dbg5       ContactSubNumber:           %d\n",pingchanstbdheader->ContactSubNumber);
-		    fprintf(stderr,"dbg5       ContactType:                %d\n",pingchanstbdheader->ContactType);
-		    fprintf(stderr,"dbg5       NumSamples:                 %d\n",pingchanstbdheader->NumSamples);
-		    fprintf(stderr,"dbg5       Reserved:                   %d\n",pingchanstbdheader->Reserved);
-		    fprintf(stderr,"dbg5       ContactTimeOffTrack:        %f\n",pingchanstbdheader->ContactTimeOffTrack);
-		    fprintf(stderr,"dbg5       ContactCloseNumber:         %d\n",pingchanstbdheader->ContactCloseNumber);
-		    fprintf(stderr,"dbg5       Reserved2:                  %d\n",pingchanstbdheader->Reserved2);
-		    fprintf(stderr,"dbg5       FixedVSOP:                  %f\n",pingchanstbdheader->FixedVSOP);
-		    for (i=0;i<6;i++)
-			fprintf(stderr,"dbg5       ReservedSpace[%2.2d]:          %d\n",i,pingchanstbdheader->ReservedSpace[i]);
-		    for (i=0;i<MAX(pingchanportheader->NumSamples,pingchanstbdheader->NumSamples);i++)
-			fprintf(stderr,"dbg5       sidescan[%4.4d]: %d %d\n",i,data->ssrawport[i], data->ssrawstbd[i]);
-		    }
-		}
-
-	    /* read rest of bathymetry packet */
-	    else if (status == MB_SUCCESS
-		&& packetheader.HeaderType == XTF_DATA_BATHYMETRY)
-		{
-#ifdef MBR_XTFR8101_DEBUG
-fprintf(stderr,"Reading bathymetry packet type:%d bytes:%d\n",
-packetheader.HeaderType,packetheader.NumBytesThisRecord);
-#endif
-		data->kind = MB_DATA_DATA;
-		bathheader->packetheader = packetheader;
-		read_len = fread(line,1,242,mb_io_ptr->mbfp);
-		if (read_len == 242)
-		    {
-		    /* parse the rest of the bathymetry header */
-		    index = 0;
-
-		    mb_get_binary_short(MB_YES, &line[index], (short int *)&(bathheader->Year));
-		    index += 2;
-		    bathheader->Month = line[index];
-		    index++;
-		    bathheader->Day = line[index];
-		    index++;
-		    bathheader->Hour = line[index];
-		    index++;
-		    bathheader->Minute = line[index];
-		    index++;
-		    bathheader->Second = line[index];
-		    index++;
-		    bathheader->HSeconds = line[index];
-		    index++;
-		    mb_get_binary_short(MB_YES, &line[index], (short int *)&(bathheader->JulianDay));
-		    index += 2;
-		    mb_get_binary_short(MB_YES, &line[index], (short int *)&(bathheader->CurrentLineID));
-		    index += 2;
-		    mb_get_binary_short(MB_YES, &line[index], (short int *)&(bathheader->EventNumber));
-		    index += 2;
-		    mb_get_binary_int(MB_YES, &line[index], (int *)&(bathheader->PingNumber));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(bathheader->SoundVelocity));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(bathheader->OceanTide));
-		    index += 4;
-		    mb_get_binary_int(MB_YES, &line[index], (int *)&(bathheader->Reserved2));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(bathheader->ConductivityFreq));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(bathheader->TemperatureFreq));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(bathheader->PressureFreq));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(bathheader->PressureTemp));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(bathheader->Conductivity));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(bathheader->WaterTemperature));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(bathheader->Pressure));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(bathheader->ComputedSoundVelocity));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(bathheader->MagX));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(bathheader->MagY));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(bathheader->MagZ));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(bathheader->AuxVal1));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(bathheader->AuxVal2));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(bathheader->AuxVal3));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(bathheader->AuxVal4));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(bathheader->AuxVal5));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(bathheader->AuxVal6));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(bathheader->SpeedLog));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(bathheader->Turbidity));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(bathheader->ShipSpeed));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(bathheader->ShipGyro));
-		    index += 4;
-		    mb_get_binary_double(MB_YES, &line[index], &(bathheader->ShipYcoordinate));
-		    index += 8;
-		    mb_get_binary_double(MB_YES, &line[index], &(bathheader->ShipXcoordinate));
-		    index += 8;
-		    mb_get_binary_short(MB_YES, &line[index], (short int *)&(bathheader->ShipAltitude));
-		    index += 2;
-		    mb_get_binary_short(MB_YES, &line[index], (short int *)&(bathheader->ShipDepth));
-		    index += 2;
-		    bathheader->FixTimeHour = line[index];
-		    index++;
-		    bathheader->FixTimeMinute = line[index];
-		    index++;
-		    bathheader->FixTimeSecond = line[index];
-		    index++;
-		    bathheader->Reserved4 = line[index];
-		    index++;
-		    mb_get_binary_float(MB_YES, &line[index], &(bathheader->SensorSpeed));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(bathheader->KP));
-		    index += 4;
-		    mb_get_binary_double(MB_YES, &line[index], &(bathheader->SensorYcoordinate));
-		    index += 8;
-		    mb_get_binary_double(MB_YES, &line[index], &(bathheader->SensorXcoordinate));
-		    index += 8;
-		    mb_get_binary_short(MB_YES, &line[index], &(bathheader->Reserved6));
-		    index += 2;
-		    mb_get_binary_short(MB_YES, &line[index], &(bathheader->RangeToSensor));
-		    index += 2;
-		    mb_get_binary_short(MB_YES, &line[index], &(bathheader->BearingToSensor));
-		    index += 2;
-		    mb_get_binary_short(MB_YES, &line[index], &(bathheader->CableOut));
-		    index += 2;
-		    mb_get_binary_float(MB_YES, &line[index], &(bathheader->Layback));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(bathheader->CableTension));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(bathheader->SensorDepth));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(bathheader->SensorPrimaryAltitude));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(bathheader->SensorAuxAltitude));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(bathheader->SensorPitch));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(bathheader->SensorRoll));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(bathheader->SensorHeading));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(bathheader->Heave));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(bathheader->Yaw));
-		    index += 4;
-		    mb_get_binary_int(MB_YES, &line[index], &(bathheader->AttitudeTimeTag));
-		    index += 4;
-		    mb_get_binary_float(MB_YES, &line[index], &(bathheader->DOT));
-		    index += 4;
-		    for (i=0;i<20;i++)
-			{
-			bathheader->ReservedSpace[i] = line[index];
-			index++;
-			}
-
-		    /* read rest of record */
-		    read_len = fread(line,1,bathheader->packetheader.NumBytesThisRecord-242-14,mb_io_ptr->mbfp);
-		    if (read_len == bathheader->packetheader.NumBytesThisRecord-242-14)
-			{
-			/* check synch value */
-			mb_get_binary_int(MB_YES, &line[0], (int *)&(synch));
-			if (synch != 65535)
-			    {
-			    status = MB_FAILURE;
-			    *error = MB_ERROR_UNINTELLIGIBLE;
-			    done = MB_YES;
-			    }
-
-			/* handle RESON_PACKETID_RT_VERY_OLD */
-			else if (line[4] == 0x13)
-			    {
-			    index = 0;
-			    for (i=0;i<4;i++)
-				{
-				reson8100rit->synch_header[i] = line[index];
-				index++;
-				}
-			    reson8100rit->packet_type = line[index];
-			    index++;
-			    reson8100rit->packet_subtype = line[index];
-			    index++;
-			    mb_get_binary_int(MB_NO, &line[index], (int *)&(reson8100rit->Seconds));
-			    index += 4;
-			    mb_get_binary_int(MB_NO, &line[index], (int *)&(reson8100rit->Millisecs));
-			    index += 4;
-			    mb_get_binary_short(MB_NO, &line[index], (short int *)&(reson8100rit->latency));
-			    index += 2;
-			    reson8100rit->ping_number = 0;
-			    reson8100rit->sonar_id = 0;
-			    reson8100rit->sonar_model = 0;
-			    reson8100rit->frequency = 0;
-			    mb_get_binary_short(MB_NO, &line[index], (short int *)&(reson8100rit->velocity));
-			    index += 2;
-			    mb_get_binary_short(MB_NO, &line[index], (short int *)&(reson8100rit->sample_rate));
-			    index += 2;
-			    reson8100rit->pulse_width = (unsigned short) (mb_u_char) line[index];
-			    index++;
-			    mb_get_binary_short(MB_NO, &line[index], (short int *)&(reson8100rit->ping_rate));
-			    index += 2;
-			    mb_get_binary_short(MB_NO, &line[index], (short int *)&(reson8100rit->range_set));
-			    index += 2;
-			    mb_get_binary_short(MB_NO, &line[index], (short int *)&(reson8100rit->power));
-			    index += 2;
-			    mb_get_binary_short(MB_NO, &line[index], (short int *)&(reson8100rit->gain));
-			    index += 2;
-			    index += 2; /* skip projector value */
-			    reson8100rit->tvg_spread = (mb_u_char) line[index];
-			    index++;
-			    reson8100rit->tvg_absorp = (mb_u_char) line[index];
-			    index++;
-			    reson8100rit->projector_beam_width = 0;
-			    reson8100rit->beam_width_num = (mb_u_char) line[index];
-			    reson8100rit->beam_width_denom = 10;
-			    index++;
-			    reson8100rit->projector_angle = 0;
-			    reson8100rit->min_range = 0;
-			    reson8100rit->max_range = 0;
-			    reson8100rit->min_depth = 0;
-			    reson8100rit->max_depth = 0;
-			    reson8100rit->filters_active = 0;
-			    reson8100rit->spare[0] = 0;
-			    reson8100rit->spare[1] = 0;
-			    reson8100rit->spare[2] = 0;
-			    reson8100rit->temperature = 0;
-			    mb_get_binary_short(MB_NO, &line[index], (short int *)&(reson8100rit->beam_count));
-			    index += 2;
-			    for (i=0;i<reson8100rit->beam_count;i++)
-				{
-				mb_get_binary_short(MB_NO, &line[index], (short int *)&(reson8100rit->range[i]));
-				reson8100rit->intensity[i] = 0;
-				index += 2;
-				}
-			    for (i=0;i<reson8100rit->beam_count/2+reson8100rit->beam_count%2;i++)
-				{
-				reson8100rit->quality[i] = (mb_u_char) line[index];
-				index++;
-				}
-
-			    }
-
-			/* handle RESON_PACKETID_RIT */
-			else if (line[4] == 0x18)
-			    {
-			    index = 0;
-			    for (i=0;i<4;i++)
-				{
-				reson8100rit->synch_header[i] = line[index];
-				index++;
-				}
-			    reson8100rit->packet_type = line[index];
-			    index++;
-			    reson8100rit->packet_subtype = line[index];
-			    index++;
-			    mb_get_binary_short(MB_NO, &line[index], (short int *)&(reson8100rit->latency));
-			    index += 2;
-			    mb_get_binary_int(MB_NO, &line[index], (int *)&(reson8100rit->Seconds));
-			    index += 4;
-			    mb_get_binary_int(MB_NO, &line[index], (int *)&(reson8100rit->Millisecs));
-			    index += 4;
-
-			    mb_get_binary_int(MB_NO, &line[index], (int *)&(reson8100rit->ping_number));
-			    index += 4;
-
-			    mb_get_binary_int(MB_NO, &line[index], (int *)&(reson8100rit->sonar_id));
-			    index += 4;
-
-			    mb_get_binary_short(MB_NO, &line[index], (short int *)&(reson8100rit->sonar_model));
-			    index += 2;
-
-			    mb_get_binary_short(MB_NO, &line[index], (short int *)&(reson8100rit->frequency));
-			    index += 2;
-
-			    mb_get_binary_short(MB_NO, &line[index], (short int *)&(reson8100rit->velocity));
-			    index += 2;
-
-			    mb_get_binary_short(MB_NO, &line[index], (short int *)&(reson8100rit->sample_rate));
-			    index += 2;
-
-
-			    mb_get_binary_short(MB_NO, &line[index], (short int *)&(reson8100rit->ping_rate));
-			    index += 2;
-
-			    mb_get_binary_short(MB_NO, &line[index], (short int *)&(reson8100rit->range_set));
-			    index += 2;
-
-			    mb_get_binary_short(MB_NO, &line[index], (short int *)&(reson8100rit->power));
-			    index += 2;
-
-			    mb_get_binary_short(MB_NO, &line[index], (short int *)&(reson8100rit->gain));
-			    index += 2;
-
-			     mb_get_binary_short(MB_NO, &line[index], (short int *)&(reson8100rit->pulse_width));
-			    index += 2;
-
-			    reson8100rit->tvg_spread = (mb_u_char) line[index];
-			    index++;
-
-			    reson8100rit->tvg_absorp = (mb_u_char) line[index];
-			    index++;
-
-			    reson8100rit->projector_type = (mb_u_char) line[index];
-			    index++;
-
-			    reson8100rit->projector_beam_width = (mb_u_char) line[index];
-			    index++;
-
-			     mb_get_binary_short(MB_NO, &line[index], (short int *)&(reson8100rit->beam_width_num));
-			    index += 2;
-
-			     mb_get_binary_short(MB_NO, &line[index], (short int *)&(reson8100rit->beam_width_denom));
-			    index += 2;
-
-			    mb_get_binary_short(MB_NO, &line[index], (short int *)&(reson8100rit->projector_angle));
-			    index += 2;
-
-			    mb_get_binary_short(MB_NO, &line[index], (short int *)&(reson8100rit->min_range));
-			    index += 2;
-
-			    mb_get_binary_short(MB_NO, &line[index], (short int *)&(reson8100rit->max_range));
-			    index += 2;
-
-			    mb_get_binary_short(MB_NO, &line[index], (short int *)&(reson8100rit->min_depth));
-			    index += 2;
-
-			    mb_get_binary_short(MB_NO, &line[index], (short int *)&(reson8100rit->max_depth));
-			    index += 2;
-
-			    reson8100rit->filters_active = (mb_u_char) line[index];
-			    index++;
-
-			    reson8100rit->spare[0] = (mb_u_char) line[index];
-			    index++;
-
-			    reson8100rit->spare[1] = (mb_u_char) line[index];
-			    index++;
-
-			    reson8100rit->spare[2] = (mb_u_char) line[index];
-			    index++;
-
-			    mb_get_binary_short(MB_NO, &line[index], (short int *)&(reson8100rit->temperature));
-			    index += 2;
-
-			    mb_get_binary_short(MB_NO, &line[index], (short int *)&(reson8100rit->beam_count));
-			    index += 2;
-
-			    for (i=0;i<reson8100rit->beam_count;i++)
-				{
-				mb_get_binary_short(MB_NO, &line[index], (short int *)&(reson8100rit->range[i]));
-				index += 2;
-				}
-			    for (i=0;i<reson8100rit->beam_count/2+reson8100rit->beam_count%2;i++)
-				{
-				reson8100rit->quality[i] = (mb_u_char) line[index];
-				index++;
-				}
-			    for (i=0;i<reson8100rit->beam_count;i++)
-				{
-				mb_get_binary_short(MB_NO, &line[index], (short int *)&(reson8100rit->intensity[i]));
-				index += 2;
-			        }
-
-			    }
-			else
-			    {
-			    status = MB_FAILURE;
-			    *error = MB_ERROR_UNINTELLIGIBLE;
-			    done = MB_YES;
-			    }
-			}
-		    else
-		    	{
-		    	status = MB_FAILURE;
-		    	*error = MB_ERROR_EOF;
-		    	done = MB_YES;
-		    	}
-
-		    /* print debug statements */
-		    if (verbose >= 5)
-			{
-			fprintf(stderr,"\ndbg5  Values read in MBIO function <%s>\n",function_name);
-			fprintf(stderr,"dbg5       MagicNumber:                %d %d %x%x\n",
-					bathheader->packetheader.MagicNumber[0],bathheader->packetheader.MagicNumber[1],
-					bathheader->packetheader.MagicNumber[0],bathheader->packetheader.MagicNumber[1]);
-			fprintf(stderr,"dbg5       HeaderType:                 %d\n",bathheader->packetheader.HeaderType);
-			fprintf(stderr,"dbg5       SubChannelNumber:           %d\n",bathheader->packetheader.SubChannelNumber);
-			fprintf(stderr,"dbg5       NumChansToFollow:           %d\n",bathheader->packetheader.NumChansToFollow);
-			fprintf(stderr,"dbg5       Reserved1:                  %d %d\n",bathheader->packetheader.Reserved1[0],bathheader->packetheader.Reserved1[1]);
-			fprintf(stderr,"dbg5       NumBytesThisRecord:         %d\n",bathheader->packetheader.NumBytesThisRecord);
-			fprintf(stderr,"dbg5       Year:                       %d\n",bathheader->Year);
-			fprintf(stderr,"dbg5       Month:                      %d\n",bathheader->Month);
-			fprintf(stderr,"dbg5       Day:                        %d\n",bathheader->Day);
-			fprintf(stderr,"dbg5       Hour:                       %d\n",bathheader->Hour);
-			fprintf(stderr,"dbg5       Minute:                     %d\n",bathheader->Minute);
-			fprintf(stderr,"dbg5       Second:                     %d\n",bathheader->Second);
-			fprintf(stderr,"dbg5       HSeconds:                   %d\n",bathheader->HSeconds);
-			fprintf(stderr,"dbg5       JulianDay:                  %d\n",bathheader->JulianDay);
-			fprintf(stderr,"dbg5       CurrentLineID:              %d\n",bathheader->CurrentLineID);
-			fprintf(stderr,"dbg5       EventNumber:                %d\n",bathheader->EventNumber);
-			fprintf(stderr,"dbg5       PingNumber:                 %d\n",bathheader->PingNumber);
-			fprintf(stderr,"dbg5       SoundVelocity:              %f\n",bathheader->SoundVelocity);
-			fprintf(stderr,"dbg5       OceanTide:                  %f\n",bathheader->OceanTide);
-			fprintf(stderr,"dbg5       Reserved2:                  %d\n",bathheader->Reserved2);
-			fprintf(stderr,"dbg5       ConductivityFreq:           %f\n",bathheader->ConductivityFreq);
-			fprintf(stderr,"dbg5       TemperatureFreq:            %f\n",bathheader->TemperatureFreq);
-			fprintf(stderr,"dbg5       PressureFreq:               %f\n",bathheader->PressureFreq);
-			fprintf(stderr,"dbg5       PressureTemp:               %f\n",bathheader->PressureTemp);
-			fprintf(stderr,"dbg5       Conductivity:               %f\n",bathheader->Conductivity);
-			fprintf(stderr,"dbg5       WaterTemperature:           %f\n",bathheader->WaterTemperature);
-			fprintf(stderr,"dbg5       Pressure:                   %f\n",bathheader->Pressure);
-			fprintf(stderr,"dbg5       ComputedSoundVelocity:      %f\n",bathheader->ComputedSoundVelocity);
-			fprintf(stderr,"dbg5       MagX:                       %f\n",bathheader->MagX);
-			fprintf(stderr,"dbg5       MagY:                       %f\n",bathheader->MagY);
-			fprintf(stderr,"dbg5       MagZ:                       %f\n",bathheader->MagZ);
-			fprintf(stderr,"dbg5       AuxVal1:                    %f\n",bathheader->AuxVal1);
-			fprintf(stderr,"dbg5       AuxVal2:                    %f\n",bathheader->AuxVal2);
-			fprintf(stderr,"dbg5       AuxVal3:                    %f\n",bathheader->AuxVal3);
-			fprintf(stderr,"dbg5       AuxVal4:                    %f\n",bathheader->AuxVal4);
-			fprintf(stderr,"dbg5       AuxVal5:                    %f\n",bathheader->AuxVal5);
-			fprintf(stderr,"dbg5       AuxVal6:                    %f\n",bathheader->AuxVal6);
-			fprintf(stderr,"dbg5       SpeedLog:                   %f\n",bathheader->SpeedLog);
-			fprintf(stderr,"dbg5       Turbidity:                  %f\n",bathheader->Turbidity);
-			fprintf(stderr,"dbg5       ShipSpeed:                  %f\n",bathheader->ShipSpeed);
-			fprintf(stderr,"dbg5       ShipGyro:                   %f\n",bathheader->ShipGyro);
-			fprintf(stderr,"dbg5       ShipYcoordinate:            %f\n",bathheader->ShipYcoordinate);
-			fprintf(stderr,"dbg5       ShipXcoordinate:            %f\n",bathheader->ShipXcoordinate);
-			fprintf(stderr,"dbg5       ShipAltitude:               %d\n",bathheader->ShipAltitude);
-			fprintf(stderr,"dbg5       ShipDepth:                  %d\n",bathheader->ShipDepth);
-			fprintf(stderr,"dbg5       FixTimeHour:                %d\n",bathheader->FixTimeHour);
-			fprintf(stderr,"dbg5       FixTimeMinute:              %d\n",bathheader->FixTimeMinute);
-			fprintf(stderr,"dbg5       FixTimeSecond:              %d\n",bathheader->FixTimeSecond);
-			fprintf(stderr,"dbg5       Reserved4:                  %d\n",bathheader->Reserved4);
-			fprintf(stderr,"dbg5       SensorSpeed:                %f\n",bathheader->SensorSpeed);
-			fprintf(stderr,"dbg5       KP:                         %f\n",bathheader->KP);
-			fprintf(stderr,"dbg5       SensorYcoordinate:          %f\n",bathheader->SensorYcoordinate);
-			fprintf(stderr,"dbg5       SensorXcoordinate:          %f\n",bathheader->SensorXcoordinate);
-			fprintf(stderr,"dbg5       Reserved6:                  %d\n",bathheader->Reserved6);
-			fprintf(stderr,"dbg5       RangeToSensor:              %d\n",bathheader->RangeToSensor);
-			fprintf(stderr,"dbg5       BearingToSensor:            %d\n",bathheader->BearingToSensor);
-			fprintf(stderr,"dbg5       CableOut:                   %d\n",bathheader->CableOut);
-			fprintf(stderr,"dbg5       Layback:                    %f\n",bathheader->Layback);
-			fprintf(stderr,"dbg5       CableTension:               %f\n",bathheader->CableTension);
-			fprintf(stderr,"dbg5       SensorDepth:                %f\n",bathheader->SensorDepth);
-			fprintf(stderr,"dbg5       SensorPrimaryAltitude:      %f\n",bathheader->SensorPrimaryAltitude);
-			fprintf(stderr,"dbg5       SensorAuxAltitude:          %f\n",bathheader->SensorAuxAltitude);
-			fprintf(stderr,"dbg5       SensorPitch:                %f\n",bathheader->SensorPitch);
-			fprintf(stderr,"dbg5       SensorRoll:                 %f\n",bathheader->SensorRoll);
-			fprintf(stderr,"dbg5       SensorHeading:              %f\n",bathheader->SensorHeading);
-			fprintf(stderr,"dbg5       Heave:                      %f\n",bathheader->Heave);
-			fprintf(stderr,"dbg5       Yaw:                        %f\n",bathheader->Yaw);
-			fprintf(stderr,"dbg5       AttitudeTimeTag:            %d\n",bathheader->AttitudeTimeTag);
-			fprintf(stderr,"dbg5       DOT:                        %f\n",bathheader->DOT);
-			for (i=0;i<20;i++)
-			    fprintf(stderr,"dbg5       ReservedSpace[%2.2d]:          %d\n",i,bathheader->ReservedSpace[i]);
-			fprintf(stderr,"dbg5       synch_header:               %x %x %x %x \n",
-				    reson8100rit->synch_header[0], reson8100rit->synch_header[1],
-				    reson8100rit->synch_header[2], reson8100rit->synch_header[3]);
-			fprintf(stderr,"dbg5       packet_type:                %d\n",reson8100rit->packet_type);
-			fprintf(stderr,"dbg5       packet_subtype:             %d\n",reson8100rit->packet_subtype);
-			fprintf(stderr,"dbg5       latency:                    %d\n",reson8100rit->latency);
-			fprintf(stderr,"dbg5       Seconds:                    %d\n",reson8100rit->Seconds);
-			fprintf(stderr,"dbg5       Millisecs:                  %d\n",reson8100rit->Millisecs);
-			fprintf(stderr,"dbg5       ping_number:                %d\n",reson8100rit->ping_number);
-			fprintf(stderr,"dbg5       sonar_id:                   %d\n",reson8100rit->sonar_id);
-			fprintf(stderr,"dbg5       sonar_model:                %d\n",reson8100rit->sonar_model);
-			fprintf(stderr,"dbg5       frequency:                  %d\n",reson8100rit->frequency);
-			fprintf(stderr,"dbg5       velocity:                   %d\n",reson8100rit->velocity);
-			fprintf(stderr,"dbg5       sample_rate:                %d\n",reson8100rit->sample_rate);
-			fprintf(stderr,"dbg5       ping_rate:                  %d\n",reson8100rit->ping_rate);
-			fprintf(stderr,"dbg5       range_set:                  %d\n",reson8100rit->range_set);
-			fprintf(stderr,"dbg5       power:                      %d\n",reson8100rit->power);
-			fprintf(stderr,"dbg5       gain:                       %d\n",reson8100rit->gain);
-			fprintf(stderr,"dbg5       tvg_spread:                 %d\n",reson8100rit->tvg_spread);
-			fprintf(stderr,"dbg5       tvg_absorp:                 %d\n",reson8100rit->tvg_absorp);
-			fprintf(stderr,"dbg5       projector_type:             %d\n",reson8100rit->projector_type);
-			fprintf(stderr,"dbg5       projector_beam_width:       %d\n",reson8100rit->projector_beam_width);
-			fprintf(stderr,"dbg5       beam_width_num:             %d\n",reson8100rit->beam_width_num);
-			fprintf(stderr,"dbg5       beam_width_denom:           %d\n",reson8100rit->beam_width_denom);
-			fprintf(stderr,"dbg5       projector_angle:            %d\n",reson8100rit->projector_angle);
-			fprintf(stderr,"dbg5       min_range:                  %d\n",reson8100rit->min_range);
-			fprintf(stderr,"dbg5       max_range:                  %d\n",reson8100rit->max_range);
-			fprintf(stderr,"dbg5       min_depth:                  %d\n",reson8100rit->min_depth);
-			fprintf(stderr,"dbg5       max_depth:                  %d\n",reson8100rit->max_depth);
-			fprintf(stderr,"dbg5       filters_active:             %d\n",reson8100rit->filters_active);
-			fprintf(stderr,"dbg5       spare:                      %d\n",reson8100rit->spare[0]);
-			fprintf(stderr,"dbg5       spare:                      %d\n",reson8100rit->spare[1]);
-			fprintf(stderr,"dbg5       spare:                      %d\n",reson8100rit->spare[2]);
-			fprintf(stderr,"dbg5       temperature:                %d\n",reson8100rit->temperature);
-			fprintf(stderr,"dbg5       beam_count:                 %d\n",reson8100rit->beam_count);
-			for (i=0;i<reson8100rit->beam_count;i++)
-			    {
-			    fprintf(stderr,"dbg5       beam[%3.3d]   range:%5.5d",
-				    i,reson8100rit->range[i]);
-			    if (i % 2 == 0)
-				    quality = ((reson8100rit->quality[i/2]) & 15);
-			    else
-				    quality = ((reson8100rit->quality[i/2] >> 4) & 15);
-			    fprintf(stderr,"  quality:%3.3d %d%d%d%d\n",quality,quality & 1, quality >>1 & 1,
-						    quality >> 2 & 1, quality >> 3 & 1);
-			    }
-			}
-
-		    /* set success */
-		    status = MB_SUCCESS;
-		    *error = MB_ERROR_NO_ERROR;
-		    done = MB_YES;
-		    }
-		else
-		    {
-		    status = MB_FAILURE;
-		    *error = MB_ERROR_EOF;
-		    done = MB_YES;
-		    }
-		}
-
-	    /* else read rest of unknown packet */
-	    else if (status == MB_SUCCESS)
-		{
-		if (((int)packetheader.NumBytesThisRecord) > 14)
-			{
-			for (i=0;i<((int)packetheader.NumBytesThisRecord)-14;i++)
-				{
-				read_len = fread(line,1,1,mb_io_ptr->mbfp);
-				}
-			if (read_len != 1)
-		    		{
-				status = MB_FAILURE;
-				*error = MB_ERROR_EOF;
-				done = MB_YES;
-				}
-			}
-#ifdef MBR_XTFR8101_DEBUG
-fprintf(stderr,"Reading unknown packet type:%d bytes:%d\n",
-packetheader.HeaderType,packetheader.NumBytesThisRecord);
-#endif
-		}
-	    }
-
-	/* get file position */
-	mb_io_ptr->file_bytes = ftell(mb_io_ptr->mbfp);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mbsys_3datdepthlidar.c b/src/mbio/mbsys_3datdepthlidar.c
deleted file mode 100644
index e2a727a..0000000
--- a/src/mbio/mbsys_3datdepthlidar.c
+++ /dev/null
@@ -1,2200 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbsys_3datdepthlidar.c	3.00	5/7/2013
- *	$Id: mbsys_3datdepthlidar.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 2013-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * Notes on the MBSYS_3DATDEPTHLIDAR data structure:
- *
- * Vendor processed format from 3DatDepth, produced from raw LIDAR
- * time series files by proprietary 3DatDepth software
- *
- *--------------------------------------------------------------------------------
- * Processing Tool Data Output
- * 
- * The 3D at Depth Processing Tool reads binary sensor data and
- * processes it to provide corresponding range angle data, saved
- * to a binary file. A timestamp is provided for each scan recorded
- * in the file. This timestamp is the time of the first laser pulse
- * for that scan. The μsec time value listed for each laser pulse
- * is the relative time between each successive pulse, offset from
- * the timestamp. The value for the first pulse should be subtracted
- * from all pulses in that scan (including itself), such that the
- * first pulse would be 0 μsec accordingly.
- * 
- * ---------------------------------------------------------------------------------------
- * Range Angle Angle data format (binary)
- *              Item	                                Value	            Bytes
- * ---------------------------------------------------------------------------------------
- * File Header Record	
- *           File header record id	                0x3D46	            2   (1 UINT16)
- *           File magic number	                        0x3D07	            2   (1 UINT16)
- *           File version	                        1	            2   (1 UINT16)
- *           File sub version	                        1	            2   (1 UINT16)
- * Scan Information		
- *           Scan type (AZ raster, AZEL raster, bowtie)	2, 3, 4             2   (1 UINT16)
- *           Cross track angle start (deg)		                    4   (1 float32)
- *           Cross track angle end (deg)		                    4   (1 float32)
- *           Forward track angle start (deg)		                    4   (1 float32)
- *           Forward track angle end (deg)		                    4   (1 float32)
- *           Counts per Scan (AZ raster and bowtie)		            2   (1 UINT16)
- *           Counts per cross track (AZEL raster)		            2   (1 UINT16)
- *           Counts per forward track (AZEL raster)		            2   (1 UINT16)
- *           Scanner Efficiency		                                    2   (1 UINT16)
- *           Scans per File		                                    2   (1 UINT16)
- *           Scan count		                                            4   (1 UINT32)
- *           
- * ---------------------------------------------------------------------------------------
- * Lidar Scan Record	
- *           Lidar scan record id	                0x3D52	            2   (1 UINT16)
- * First Pulse Timestamp ( 1 to n Scans )		
- *           Timestamp year		                                    2   (1 UINT16)
- *           Timestamp month		                                    1   (1 UINT8)
- *           Timestamp day		                                    1   (1 UINT8)
- *           Timestamp days since Jan 1		                            2   (1 UINT16)
- *           Timestamp hour		                                    2   (1 UINT16)
- *           Timestamp minutes		                                    1   (1 UINT8)
- *           Timestamp seconds		                                    1   (1 UINT8)
- *           Timestamp nano seconds		                            4   (1 UINT32)
- * Laser Pulse Data ( 1 to m pulses per scan )		
- *           Range ( from glass front ) meters                              4   (1 float32)
- *           Amplitude / peak of signal	                         	    2   (1 short int)
- *           SNR of signal return		                            4   (1 float32)
- *           Cross track angle (deg)		                            4   (1 float32)
- *           Forward track angle (deg)		                            4   (1 float32)
- *           Cross track offset (m)		                            4   (1 float32)
- *           Forward track offset (m)		                            4   (1 float32)
- *           Pulse time offset (µsec)		                            4   (1 UINT32)
- *           Saturated (0/1)    		                            1   (1 UINT8)
- *           
- * For each scan per file, a “First Pulse Timestamp” and “m” sets of
- * “Laser Pulse Data” will exist.  For example, for a Continuous Scan
- * file with 500 scans per file, and 200 pts per scan, the following
- * data would be present:
- * 	File Header
- * 	Scan Information
- *      (1) First Pulse Timestamp
- * 		200	 Laser Pulse Data sets
- *      (2) First Pulse Timestamp
- *              200	Laser Pulse Data sets
- * 		…
- *      (500) First Pulse Timestamp
- * 	        200	 Laser Pulse Data sets
- * 
- * A Bowtie scan file would be the same as above.  A Full scan file
- * will only contain one scan of data but with “Counts per Cross track”
- * multiplied by “Counts per Forward track” sets of laser pulse data.
- * 
- * The timestamp is the time of the first laser pulse for that scan.
- * The pulse time offset (µsec) value listed for each laser pulse is
- * the relative time between each successive pulse.  The value for the
- * first pulse should be subtracted from all pulses in that scan, such
- * that the first pulse would be 0 µsec accordingly.  The Pt Valid term
- * is provided to specify range validity.  If “valid” is given as 0, a
- * range could not be determined for that laser pulse, or it fell
- * outside of the processing limits.
- * 
- * Note, if processing is interrupted by hitting the “Cancel Processing”
- * button, an indeterminate number of records may exist in the current
- * processing file.  All processed files will be written to the same
- * folder location of the raw file.  The same file name is used for
- * processed files, but with a “.csv” or “.bin” file extension.  If data
- * is reprocessed in the same folder location, previously processed data
- * files will be overwritten.
- *
- *--------------------------------------------------------------------------------
- * INS Data Format
- * 
- * INU serial packets are archived to data files located at %RAW_DATA_PATH%/INU/.
- * %RAW_DATA_PATH% is set in the sensor configuration file. Data files are
- * named INU_MMDDYYYY_HHMMSS.bin. 3000 navigation messages are stored per
- * each archived data file, representing approximately 5 minutes data storage
- * if collecting messages at 10 Hz. The binary data file storage is provided
- * below, for the first record. Additional records follow to 3000 per file.
- * The latency from first character received to the timestamp is approximately
- * 100 msec. If an error occurs, or the first byte read from the serial port is
- * not equal to the INU magic character, the software will begin reading byte
- * by byte in an attempt to resync.
- *              Item                                Value                   Bytes
- *           Header Magic Number                    0xE32F                  2 (1 UINT16)
- *           Timestamp year                                                 2 (1 UINT16)
- *           Timestamp month                                                1 (1 UINT8)
- *           Timestamp day                                                  1 (1 UINT8)
- *           Timestamp days since Jan 1                                     2 (1 UINT16)
- *           Timestamp hour                                                 2 (1 UINT16)
- *           Timestamp minutes                                              1 (1 UINT8)
- *           Timestamp seconds                                              1 (1 UINT8)
- *           Timestamp nano seconds                                         4 (1 UINT32)
- *           Latency (μseconds) – latency from first                        4 (1 float32)
- *                                 character received to timestamp
- *           INU Nav message 1
- *                      complete message as received from INU               Len / packet ‐ reference the INU specification
- *                      1 magic, 1 ID, 1 data len, N NAV bytes                          
- * 
- *--------------------------------------------------------------------------------
- * CTD Ethernet Interface
- * 
- * The 3D at Depth laser sensor listens for CTD data packets available on port
- * 2003 of the static IP address for the sensor. The sensor reads and timestamps
- * these packets and saves the data to a binary file, located at %RAW_DATA_PATH%/CTD/.
- * %RAW_DATA_PATH% is set in the sensor configuration file.
- * Data files are named CTD_MMDDYYYY_HHMMSS.bin. The file format is as follows.
- * CTD Packets
- *              Item                                Value                   Bytes
- *           Header Magic Number                    0x3D07                  2 (1 UINT16)
- *           Timestamp year                                                 2 (1 UINT16)
- *           Timestamp month                                                1 (1 UINT8)
- *           Timestamp day                                                  1 (1 UINT8)
- *           Timestamp days since Jan 1                                     2 (1 UINT16)
- *           Timestamp hour                                                 2 (1 UINT16)
- *           Timestamp minutes                                              1 (1 UINT8)
- *           Timestamp seconds                                              1 (1 UINT8)
- *           Timestamp nano seconds                                         4 (1 UINT32)
- *           Header project code                    0x3D03                  2 (1 UINT16)
- *           Header version                         1                       1 (1 UINT8)
- *           Water Temperature C                                            8 (1 double)
- *           Water Salinity psu                                             8 (1 double)
- *           Water Pressure dbar                                            8 (1 double)
- *--------------------------------------------------------------------------------
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#include <string.h>
-#include <assert.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mb_define.h"
-#include "mbsys_3datdepthlidar.h"
-
-#define MBF_3DDEPTHP_DEBUG 1
-
-static char rcs_id[]="$Id: mbsys_3datdepthlidar.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*-------------------------------------------------------------------- */
-int mbsys_3datdepthlidar_alloc
-(
-	int verbose,		/* in: verbosity level set on command line 0..N */
-	void *mbio_ptr,		/* in: see mb_io.h:/^struct mb_io_struct/ */
-	void **store_ptr,	/* in: see mbsys_3datdepthlidar.h:/^struct mbsys_3datdepthlidar_struct/ */
-	int *error		/* out: see mb_status.h:/MB_ERROR/ */
-)
-{
-	char *function_name = "mbsys_3datdepthlidar_alloc";
-	int status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_3datdepthlidar_struct *store;
-
-	/* check for non-null data */
-	assert(mbio_ptr != NULL);
-	assert(store_ptr != NULL);
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> called\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n");
-		fprintf(stderr, "dbg2       verbose:    %d\n", verbose);
-		fprintf(stderr, "dbg2       mbio_ptr:   %p\n", mbio_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* allocate memory for data structure */
-	status = mb_mallocd(verbose,
-		__FILE__,
-		__LINE__,
-		sizeof(struct mbsys_3datdepthlidar_struct),
-		(void **)store_ptr,
-		error);
-	mb_io_ptr->structure_size = 0;
-
-	/* get data structure pointer */
-	store = (struct mbsys_3datdepthlidar_struct *) *store_ptr;
-
-	/* initialize everything */
-	store->kind = MB_DATA_NONE;              /* MB-System record ID */
-
-        /* File Header */
-	store->file_version = 1;                 /* 1 */
-	store->sub_version = 0;                  /* 0 */
-        
-        /* Scan Information */
-	store->scan_type = 0x0101;               /* continuous: 0x0101, bowtie: 0x0102, full: 0x0103 */
-	store->cross_track_angle_start = 0.0;    /* degrees */
-	store->cross_track_angle_end = 0.0;      /* degrees */
-	store->forward_track_angle_start = 0.0;  /* degrees */
-	store->forward_track_angle_end = 0.0;    /* degrees */
-        store->counts_per_scan = 0;		 /* AZ raster and bowtie*/
-        store->counts_per_cross_track = 0;       /* AZEL raster */
-        store->counts_per_forward_track = 0;     /* AZEL raster */
-        store->scanner_efficiency = 0;           /* */
-        store->scans_per_file = 0;               /* */
-	store->scan_count = 0;
-        
-        /* Id of most recently read record */
-        store->record_id = 0;
-        
-        /* Laser Scan Data (1 to scans_per_file Scans) */
-        store->current_scan = 0;
-        
-        /* First Pulse Timestamp (1 to n Scans) */
-        store->year = 0;
-        store->month = 0;
-        store->day = 0;
-        store->days_since_jan_1 = 0;
-        store->hour = 0;
-        store->minutes = 0;
-        store->seconds = 0;
-        store->nanoseconds = 0;
-        
-        /* position and attitude per first pulse */
-        store->time_d = 0.0;
-        store->navlon = 0.0;
-        store->navlat = 0.0;
-        store->sensordepth = 0.0;
-        store->heading = 0.0;
-        store->roll = 0.0;
-        store->pitch = 0.0;
-        store->speed = 0.0;
-
-        /* Laser Scan Data (1 to m pulses per scan) */
-	store->num_pulses = 0;
-	store->num_pulses_alloc = 0;
-        store->pulses = NULL;
-        
-        /* comment */
-        store->comment_len = 0;
-        store->comment[0] = 0;    /* comment string */
-
-        /* position data */
-        store->pos_time_d = 0.0;
-        store->pos_longitude = 0.0;
-        store->pos_latitude = 0.0;
-        
-        /* attitude data */
-        store->att_time_d = 0.0;
-        store->att_roll = 0.0;
-        store->att_pitch = 0.0;
-        store->att_heave = 0.0;
-        
-        /* heading data */
-        store->hdg_time_d = 0.0;
-        store->hdg_heading = 0.0;
-        
-        /* sensordepth data */
-        store->sdp_time_d = 0.0;
-        store->sdp_sensordepth = 0.0;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> completed\n", function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		fprintf(stderr, "dbg2       store_ptr:  %p\n", *store_ptr);
-		fprintf(stderr, "dbg2       error:      %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2       status:     %d\n", status);
-		}
-
-	/* return status */
-	return status;
-}					/* mbsys_3datdepthlidar_alloc */
-/*----------------------------------------------------------------------*/
-int mbsys_3datdepthlidar_deall
-(
-	int verbose,		/* in: verbosity level set on command line 0..N */
-	void *mbio_ptr,		/* in: see mb_io.h:/^struct mb_io_struct/ */
-	void **store_ptr,	/* in: see mbsys_3datdepthlidar.h:/^struct mbsys_3datdepthlidar_struct/ */
-	int *error			/* out: see mb_status.h:/error values/ */
-)
-{
-	char *function_name = "mbsys_3datdepthlidar_deall";
-	int status = MB_SUCCESS;
-	struct mbsys_3datdepthlidar_struct *store;
-
-	/* check for non-null data */
-	assert(mbio_ptr != NULL);
-	assert(store_ptr != NULL);
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> called\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n");
-		fprintf(stderr, "dbg2       verbose:    %d\n", verbose);
-		fprintf(stderr, "dbg2       mbio_ptr:   %p\n", mbio_ptr);
-		fprintf(stderr, "dbg2       store_ptr:  %p\n", *store_ptr);
-		}
-
-	/* get data structure pointer */
-	store = (struct mbsys_3datdepthlidar_struct *) *store_ptr;
-	
-	/* deallocate pulses */
-	if (store->pulses != NULL)
-		{
-		status = mb_freed(verbose, __FILE__, __LINE__, (void **)(&store->pulses), error);
-		}
-
-	/* deallocate memory for data structure */
-	status = mb_freed(verbose, __FILE__, __LINE__, (void **)store_ptr, error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> completed\n", function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		fprintf(stderr, "dbg2       error:      %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2       status:     %d\n", status);
-		}
-
-	/* return status */
-	return status;
-}					/* mbsys_3datdepthlidar_deall */
-/*----------------------------------------------------------------------*/
-int mbsys_3datdepthlidar_dimensions
-(
-	int verbose,
-	void *mbio_ptr,	/* in: verbosity level set on command line 0..N */
-	void *store_ptr,/* in: see mbsys_3datdepthlidar.h:/^struct mbsys_3datdepthlidar_struct/ */
-	int *kind,		/* in: see mb_status.h:0+/MBIO data type/ */
-	int *nbath,		/* out: number of bathymetric samples 0..MBSYS_SWPLS_MAX_BEAMS */
-	int *namp,		/* out: number of amplitude samples 0..MBSYS_SWPLS_MAX_BEAMS */
-	int *nss,		/* out: number of sidescan samples 0..MBSYS_SWPLS_MAX_BEAMS */
-	int *error		/* out: see mb_status.h:/error values/ */
-)
-{
-	char    *function_name = "mbsys_3datdepthlidar_dimensions";
-	int status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_3datdepthlidar_struct *store;
-
-	/* check for non-null data */
-	assert(mbio_ptr != NULL);
-	assert(store_ptr != NULL);
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> called\n", function_name);
-		fprintf(stderr, "dbg2  Input arguments:\n");
-		fprintf(stderr, "dbg2       verbose:    %d\n", verbose);
-		fprintf(stderr, "dbg2       mb_ptr:     %p\n", mbio_ptr);
-		fprintf(stderr, "dbg2       store_ptr:  %p\n", store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_3datdepthlidar_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract beam and pixel numbers from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		if (store->counts_per_scan > 0)
-			{
-			*nbath = store->counts_per_scan;
-			}
-		else
-			{
-			*nbath = store->counts_per_cross_track * store->counts_per_forward_track;
-			}
-		*namp = *nbath;
-		*nss = 0;
-		}
-	else
-		{
-		*nbath = 0;
-		*namp = 0;
-		*nss = 0;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> completed\n", function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		fprintf(stderr, "dbg2       kind:       %d\n", *kind);
-		fprintf(stderr, "dbg2       nbath:      %d\n", *nbath);
-		fprintf(stderr, "dbg2        namp:      %d\n", *namp);
-		fprintf(stderr, "dbg2        nss:       %d\n", *nss);
-		fprintf(stderr, "dbg2       error:      %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2       status:     %d\n", status);
-		}
-
-	/* print return status */
-	return status;
-}					/* mbsys_3datdepthlidar_dimensions */
-/*--------------------------------------------------------------------*/
-int mbsys_3datdepthlidar_pingnumber
-(
-	int verbose,	/* in: verbosity level set on command line 0..N */
-	void *mbio_ptr,	/* in: see mb_io.h:/^struct mb_io_struct/ */
-	int *pingnumber,/* out: swathplus ping number */
-	int *error		/* out: see mb_status.h:/MB_ERROR/ */
-)
-{
-	char    *function_name = "mbsys_3datdepthlidar_pingnumber";
-	int status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_3datdepthlidar_struct *store;
-
-	/* check for non-null data */
-	assert(mbio_ptr != NULL);
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> called\n", function_name);
-		fprintf(stderr, "dbg2  Input arguments:\n");
-		fprintf(stderr, "dbg2       verbose:    %d\n", verbose);
-		fprintf(stderr, "dbg2       mb_ptr:     %p\n", mbio_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_3datdepthlidar_struct *) mb_io_ptr->store_data;
-
-	/* extract ping number from structure */
-	*pingnumber = store->current_scan;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> completed\n", function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		fprintf(stderr, "dbg2       pingnumber: %d\n", *pingnumber);
-		fprintf(stderr, "dbg2       error:      %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2       status:     %d\n", status);
-		}
-
-	return status;
-}							/* mbsys_3datdepthlidar_pingnumber */
-/*--------------------------------------------------------------------*/
-int mbsys_3datdepthlidar_preprocess(int verbose, void *mbio_ptr, void *store_ptr,
-		double time_d, double navlon, double navlat,
-		double speed, double heading, double sonardepth,
-		double roll, double pitch, double heave,
-		int *error)
-{
-	char    *function_name = "mbsys_3datdepthlidar_preprocess";
-	struct mbsys_3datdepthlidar_struct *store;
-	struct mbsys_3datdepthlidar_pulse_struct *pulse;
-	int status = MB_SUCCESS;
-	int time_i[7];
-	int i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:       %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:      %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:     %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       time_d:        %f\n",time_d);
-		fprintf(stderr,"dbg2       longitude:     %f\n",navlon);
-		fprintf(stderr,"dbg2       latitude:      %f\n",navlat);
-		fprintf(stderr,"dbg2       speed:         %f\n",speed);
-		fprintf(stderr,"dbg2       heading:       %f\n",heading);
-		fprintf(stderr,"dbg2       sonardepth:    %f\n",sonardepth);
-		fprintf(stderr,"dbg2       roll:          %f\n",roll);
-		fprintf(stderr,"dbg2       pitch:         %f\n",pitch);
-		fprintf(stderr,"dbg2       heave:         %f\n",heave);
-		}
-
-	/* check for non-null data */
-	assert(store_ptr != NULL);
-
-	/* always successful */
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-
-	/* get data structure pointers */
-	store = (struct mbsys_3datdepthlidar_struct *) store_ptr;
-
-	/* insert navigation and attitude */
-	store->time_d = time_d;
-	mb_get_date(verbose, time_d, time_i);
-	store->year = time_i[0];
-	store->month = time_i[1];
-	store->day = time_i[2];
-	store->hour = time_i[3];
-	store->minutes = time_i[4];
-	store->seconds = time_i[5];
-	store->nanoseconds = 1000 * ((unsigned int)time_i[6]);
-
-	store->navlon = navlon;
-	store->navlat = navlat;
-	store->heading = heading;
-	store->speed = speed;
-	store->sensordepth = sonardepth;
-	store->roll = roll;
-	store->pitch = pitch;
-
-	/* loop over all pulses */
-	for (i=0;i<store->num_pulses;i++)
-		{
-		/* get pulse */
-		pulse = (struct mbsys_3datdepthlidar_pulse_struct *) &store->pulses[i];
-		
-		/* set time */
-		pulse->time_d = store->time_d + 0.000001 * pulse->pulse_time_offset;
-		
-		/* set navigation and attitude for pulses */
-		pulse->heading = store->heading;
-		pulse->navlon = store->navlon;
-		pulse->navlat = store->navlat;
-		pulse->sensordepth = store->sensordepth;
-		pulse->roll = store->roll;
-		pulse->pitch = store->pitch;
-		}
-			
-	/* calculate the bathymetry using the newly inserted values */
-	status = mbsys_3datdepthlidar_calculatebathymetry(verbose, mbio_ptr, store_ptr, error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:         %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:        %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_3datdepthlidar_extract
-(
-	int verbose,			/* in: verbosity level set on command line 0..N */
-	void *mbio_ptr,			/* in: see mb_io.h:/^struct mb_io_struct/ */
-	void *store_ptr,		/* in: see mbsys_3datdepthlidar.h:/^struct mbsys_3datdepthlidar_struct/ */
-	int *kind,				/* out: MBIO data type; see mb_status.h:0+/MBIO data type/ */
-	int time_i[7],			/* out: MBIO time array; see mb_time.c:0+/mb_get_time/ */
-	double *time_d,			/* out: MBIO time (seconds since 1,1,1970) */
-	double *navlon,			/* out: transducer longitude -180.0..+180.0 */
-	double *navlat,			/* out: transducer latitude -180.0..+180.0 */
-	double *speed,			/* out: vessel speed (km/hr) */
-	double *heading,		/* out: vessel heading -180.0..+180.0 */
-	int *nbath,				/* out: number of bathymetry samples (beams) */
-	int *namp,				/* out: number of amplitude samples, usually namp = nbath */
-	int *nss,				/* out: number of side scan pixels */
-	char *beamflag,			/* out: array[nbath] of beam flags; see mb_status.h:/FLAG category/ */
-	double *bath,			/* out: array[nbath] of depth values (m) positive down */
-	double *amp,			/* out: array[namp] of amplitude values */
-	double *bathacrosstrack,/* out: array[nbath] bathy across-track offsets from transducer (m) */
-	double *bathalongtrack,	/* out: array[nbath] bathy along-track offsets from transducer (m) */
-	double *ss,				/* out: array[nss] sidescan pixel values */
-	double *ssacrosstrack,	/* out: array[nss] sidescan across-track offsets from transducer (m) */
-	double *ssalongtrack,	/* out: array[nss] sidescan along-track offsets from transducer (m) */
-	char *comment,			/* out: comment string (not supported by SWATHplus SXP) */
-	int *error				/* out: see mb_status.h:/MB_ERROR/ */
-)
-{
-	char    *function_name = "mbsys_3datdepthlidar_extract";
-	int status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_3datdepthlidar_struct *store;
-	struct mbsys_3datdepthlidar_pulse_struct *pulse;
-	int	i;
-
-	/* check for non-null data */
-	assert(mbio_ptr != NULL);
-	assert(store_ptr != NULL);
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> called\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n");
-		fprintf(stderr, "dbg2       verbose:    %d\n", verbose);
-		fprintf(stderr, "dbg2       mb_ptr:     %p\n", mbio_ptr);
-		fprintf(stderr, "dbg2       store_ptr:  %p\n", store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_3datdepthlidar_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from store and copy into mb-system slots */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get the timestamp */
-		time_i[0] = store->year;
-		time_i[1] = store->month;
-		time_i[2] = store->day;
-		time_i[3] = store->hour;
-		time_i[4] = store->minutes;
-		time_i[5] = store->seconds;
-		time_i[6] = (int)(0.001 * store->nanoseconds);
-		mb_get_time(verbose, time_i, time_d);
-		
-		/* get the navigation */
-		*navlon = store->navlon;
-		*navlat = store->navlat;
-		*speed = store->speed;
-		*heading = store->heading;
-		
-		/* get the number of soundings according to mode */
-		if (store->counts_per_scan > 0)
-			{
-			*nbath = store->counts_per_scan;
-			}
-		else
-			{
-			*nbath = store->counts_per_cross_track * store->counts_per_forward_track;
-			}
-		*namp = *nbath;
-		*nss = 0;
-
-		/* we are poking into the mb_io_ptr to change the beamwidth here
-			350 microradians for the LIDAR laser */
-		mb_io_ptr->beamwidth_xtrack = 0.02;
-		mb_io_ptr->beamwidth_ltrack = 0.02;
-		
-		/* get the bathymetry */
-		for (i=0;i<*nbath;i++)
-			{
-			pulse = &store->pulses[i];
-			beamflag[i] = pulse->beamflag;
-			bath[i] = pulse->depth + pulse->sensordepth; 
-			amp[i] = pulse->amplitude; 
-			bathacrosstrack[i] = pulse->acrosstrack; 
-			bathalongtrack[i] = pulse->alongtrack;
-			}
-
-		/* always successful */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-		}
-
-	else if (*kind == MB_DATA_COMMENT)
-		strncpy(comment, store->comment, MB_COMMENT_MAXLINE);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> completed\n", function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		fprintf(stderr, "dbg2       kind:       %d\n", *kind);
-		fprintf(stderr, "dbg2       error:      %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2       status:     %d\n", status);
-		}
-
-	return status;
-}							/* mbsys_3datdepthlidar_extract */
-/*--------------------------------------------------------------------*/
-int mbsys_3datdepthlidar_insert
-(
-	int verbose,			/* in: verbosity level set on command line 0..N */
-	void *mbio_ptr,			/* in: see mb_io.h:/^struct mb_io_struct/ */
-	void *store_ptr,		/* in: see mbsys_3datdepthlidar.h:/^struct mbsys_3datdepthlidar_struct/ */
-	int kind,				/* in: see mb_status.h:0+/MBIO data type/ */
-	int time_i[7],			/* in: see mb_time.c:0+/mb_get_time/ */
-	double time_d,			/* in: time in seconds since 1,1,1970) */
-	double navlon,			/* in: transducer longitude -180.0..+180.0 */
-	double navlat,			/* in: transducer latitude -180.0..+180.0 */
-	double speed,			/* in: vessel speed (km/hr) */
-	double heading,			/* in: vessel heading -180.0..+180.0 */
-	int nbath,				/* in: number of bathymetry samples/beams */
-	int namp,				/* in: number of amplitude samples, usually namp == nbath */
-	int nss,				/* in: number of sidescan pixels */
-	char *beamflag,			/* in: array[nbath] of beam flags; see mb_status.h:/FLAG category/ */
-	double *bath,			/* in: array[nbath] of depth values (m) positive down */
-	double *amp,			/* in: array[namp] of amplitude values */
-	double *bathacrosstrack,/* in: array[nbath] bathy across-track offsets from transducer (m) */
-	double *bathalongtrack,	/* in: array[nbath] bathy along-track offsets from transducer (m) */
-	double *ss,				/* in: array[nss] sidescan pixel values */
-	double *ssacrosstrack,	/* in: array[nss] sidescan across-track offsets from transducer (m) */
-	double *ssalongtrack,	/* in: array[nss] sidescan along-track offsets from transducer (m) */
-	char *comment,			/* in: comment string (not supported by SWATHplus SXP) */
-	int *error				/* out: see mb_status.h:/MB_ERROR/ */
-)
-{
-	char    *function_name = "mbsys_3datdepthlidar_insert";
-	int status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_3datdepthlidar_struct *store;
-	struct mbsys_3datdepthlidar_pulse_struct *pulse;
-	int	i;
-
-	/* check for non-null data */
-	assert(mbio_ptr != NULL);
-	assert(store_ptr != NULL);
-	assert(time_i != NULL);
-	assert(0 <= nbath);
-	assert(0 <= namp);
-	assert(namp == nbath);
-	assert(0 <= nss);
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> called\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n");
-		fprintf(stderr, "dbg2       verbose:    %d\n", verbose);
-		fprintf(stderr, "dbg2       mbio_ptr:   %p\n", mbio_ptr);
-		fprintf(stderr, "dbg2       store_ptr:  %p\n", store_ptr);
-		fprintf(stderr, "dbg2       kind:       %d\n", kind);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_3datdepthlidar_struct *) store_ptr;
-
-	/* get data kind */
-	store->kind = kind;
-
-	/* insert data in structure */
-	if (store->kind == MB_DATA_DATA)
-		{
-		/* set the timestamp */
-		store->year = time_i[0];
-		store->month = time_i[1];
-		store->day = time_i[2];
-		store->hour = time_i[3];
-		store->minutes = time_i[4];
-		store->seconds = time_i[5];
-		store->nanoseconds = 1000 * ((unsigned int)time_i[6]);
-		mb_get_time(verbose, time_i, &time_d);
-		
-		/* set the navigation */
-		store->navlon = navlon;
-		store->navlat = navlat;
-		store->speed = speed;
-		store->heading = heading;
-
-		/* set the bathymetry */
-		for (i=0;i<nbath;i++)
-			{
-			pulse = &store->pulses[i];
-			pulse->beamflag = beamflag[i];
-			pulse->depth = bath[i] - pulse->sensordepth; 
-			pulse->amplitude = amp[i]; 
-			pulse->acrosstrack = bathacrosstrack[i]; 
-			pulse->alongtrack = bathalongtrack[i]; 
-			}
-
-		/* insert the sidescan pixel data */
-		}
-
-	/* deal with comments */
-	else if (store->kind == MB_DATA_COMMENT)
-		{
-		store->time_d = time_d;
-		store->comment_len = strlen(comment) + 1;
-		strncpy(store->comment, comment, MB_COMMENT_MAXLINE);
-		}
-
-	/* deal with other records types  */
-	else
-		{
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 4)
-		mbsys_3datdepthlidar_print_store(verbose, store, error);
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> completed\n", function_name);
-		fprintf(stderr, "dbg2  Return value:\n");
-		fprintf(stderr, "dbg2       error:      %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2       status:  %d\n", status);
-		}
-
-	/* return status */
-	return status;
-}							/* mbsys_3datdepthlidar_insert */
-/*--------------------------------------------------------------------*/
-int mbsys_3datdepthlidar_ttimes
-(
-	int verbose,			/* in: verbosity level set on command line 0..N */
-	void *mbio_ptr,			/* in: see mb_io.h:/^struct mb_io_struct/ */
-	void *store_ptr,		/* in: see mbsys_3datdepthlidar.h:/^struct mbsys_3datdepthlidar_struct/ */
-	int *kind,				/* out: MBIO data type; see mb_status.h:0+/MBIO data type/ */
-	int *nbeams,			/* out: number of beams (samples) in this ping */
-	double *ttimes,			/* out: array[nbeams] travel time of beam (secs) */
-	double *angles,			/* out: array[nbeams] across-track angle of beam (deg) */
-	double *angles_forward,	/* out: array[nbeams] along-track angle of beam (deg) */
-	double *angles_null,	/* out: array[nbeams] ?? */
-	double *heave,			/* out: array[nbeams] heave for each beam ?? */
-	double *alongtrack_offset,	/* out: array[nbeams] ?? */
-	double *draft,			/* out: draft of transducer below waterline ?? (m) */
-	double *ssv,			/* out: sound velocity at head (m/s) */
-	int *error				/* out: see mb_status.h:/MB_ERROR/ */
-)
-{
-	char    *function_name = "mbsys_3datdepthlidar_ttimes";
-	int status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_3datdepthlidar_struct *store;
-	int i;
-
-	/* check for non-null data */
-	assert(mbio_ptr != NULL);
-	assert(store_ptr != NULL);
-	assert(ttimes != NULL);
-	assert(angles != NULL);
-	assert(angles_forward != NULL);
-	assert(angles_null != NULL);
-	assert(heave != NULL);
-	assert(alongtrack_offset != NULL);
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> called\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n");
-		fprintf(stderr, "dbg2       verbose:    %d\n", verbose);
-		fprintf(stderr, "dbg2       mb_ptr:     %p\n", mbio_ptr);
-		fprintf(stderr, "dbg2       store_ptr:  %p\n", store_ptr);
-		}
-
-	/* get mb_io_ptr */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structre pointer */
-	store = (struct mbsys_3datdepthlidar_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract travel time data */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get the number of soundings according to mode */
-		if (store->counts_per_scan > 0)
-			{
-			*nbeams = store->counts_per_scan;
-			}
-		else
-			{
-			*nbeams = store->counts_per_cross_track * store->counts_per_forward_track;
-			}
-
-		/* get travel times, angles */
-		for (i=0;i<*nbeams;i++)
-			{
-			ttimes[i] = 0.0;
-			angles[i] = 0.0;
-			angles_forward[i] = 0.0;
-			angles_null[i] = 0.0;
-			heave[i] = 0.0;
-			alongtrack_offset[i] = 0.0;
-			}
-
-		/* get ssv */
-		*ssv = 0.0;
-		*draft = 0.0;
-
-		/* set status */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-
-		/* done translating values */
-
-		}
-	/* deal with comment record type */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-	/* deal with other record types */
-	else
-		{
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debu statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> completed\n", function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		fprintf(stderr, "dbg2       kind:       %d\n", *kind);
-		fprintf(stderr, "dbg2       error:      %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2       status:     %d\n", status);
-		}
-
-	return status;
-}					/* mbsys_3datdepthlidar_ttimes */
-/*--------------------------------------------------------------------*/
-int mbsys_3datdepthlidar_detects
-(
-	int verbose,	/* in: verbosity level set on command line 0..N */
-	void *mbio_ptr,	/* in: see mb_io.h:/^struct mb_io_struct/ */
-	void *store_ptr,/* in: see mbsys_3datdepthlidar.h:/^struct mbsys_3datdepthlidar_struct/ */
-	int *kind,		/* out: MBIO data type; see mb_status.h:0+/MBIO data type/ */
-	int *nbeams,	/* out: number of beams (samples) in this ping */
-	int *detects,	/* out: array[nbeams] detection flag;
-					    see mb_status.h:/Bottom detect flags/ */
-	int *error		/* out: see mb_status.h:/MB_ERROR/ */
-)
-{
-	char    *function_name = "mbsys_3datdepthlidar_detects";
-	int status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_3datdepthlidar_struct *store;
-	int i;
-
-	/* check for non-null data */
-	assert(mbio_ptr != NULL);
-	assert(store_ptr != NULL);
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> called\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n");
-		fprintf(stderr, "dbg2       verbose:    %d\n", verbose);
-		fprintf(stderr, "dbg2       mb_ptr:     %p\n", mbio_ptr);
-		fprintf(stderr, "dbg2       store_ptr:  %p\n", store_ptr);
-		fprintf(stderr, "dbg2       detects:    %p\n", detects);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_3datdepthlidar_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get the number of soundings according to mode */
-		if (store->counts_per_scan > 0)
-			{
-			*nbeams = store->counts_per_scan;
-			}
-		else
-			{
-			*nbeams = store->counts_per_cross_track * store->counts_per_forward_track;
-			}
-			
-		/* LIDAR detects */
-		for (i = 0; i < *nbeams; i++)
-			detects[i] = MB_DETECT_LIDAR;
-
-		/* always successful */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> completed\n", function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		fprintf(stderr, "dbg2       kind:       %d\n", *kind);
-		}
-	if ((verbose >= 2) && (*error == MB_ERROR_NO_ERROR))
-		{
-		fprintf(stderr, "dbg2       nbeams:     %d\n", *nbeams);
-		for (i=0; i<*nbeams; i++)
-			fprintf(stderr, "dbg2       beam %d: detects:%d\n", i, detects[i]);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "dbg2       error:      %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2       status:     %d\n", status);
-		}
-
-	/* return status */
-	return status;
-}					/* mbsys_3datdepthlidar_detects */
-/*--------------------------------------------------------------------*/
-int mbsys_3datdepthlidar_pulses
-(
-	int verbose,	/* in: verbosity level set on command line 0..N */
-	void *mbio_ptr,	/* in: see mb_io.h:/^struct mb_io_struct/ */
-	void *store_ptr,/* in: see mbsys_3datdepthlidar.h:/^struct mbsys_3datdepthlidar_struct/ */
-	int *kind,		/* out: MBIO data type; see mb_status.h:0+/MBIO data type/ */
-	int *nbeams,	/* out: number of beams (samples) in this ping */
-	int *pulses,	/* out: array[nbeams] pulse type; see mb_status.h:/Source pulse/ */
-	int *error		/* out: see mb_status.h:/MB_ERROR/ */
-)
-{
-	char    *function_name = "mbsys_3datdepthlidar_pulses";
-	int status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_3datdepthlidar_struct *store;
-	int i;
-
-	/* check for non-null data */
-	assert(mbio_ptr != NULL);
-	assert(store_ptr != NULL);
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> called\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n");
-		fprintf(stderr, "dbg2       verbose:    %d\n", verbose);
-		fprintf(stderr, "dbg2       mb_ptr:     %p\n", mbio_ptr);
-		fprintf(stderr, "dbg2       store_ptr:  %p\n", store_ptr);
-		fprintf(stderr, "dbg2       pulses:     %p\n", pulses);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_3datdepthlidar_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get the number of soundings according to mode */
-		if (store->counts_per_scan > 0)
-			{
-			*nbeams = store->counts_per_scan;
-			}
-		else
-			{
-			*nbeams = store->counts_per_cross_track * store->counts_per_forward_track;
-			}
-
-		/* get pulse type */
-		for (i=0;i<*nbeams;i++)
-			{
-			pulses[i] = MB_PULSE_LIDAR;
-			}
-
-		/* set status */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-		}
-
-	/* deal with comments */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> completed\n", function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		fprintf(stderr, "dbg2       kind:       %d\n", *kind);
-		}
-	if (( verbose >= 2) && ( *error == MB_ERROR_NO_ERROR) )
-		{
-		fprintf(stderr, "dbg2       nbeams:     %d\n", *nbeams);
-		for (i=0; i<*nbeams; i++)
-			fprintf(stderr, "dbg2       beam %d: pulses:%d\n", i, pulses[i]);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "dbg2       error:      %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2       status:     %d\n", status);
-		}
-
-	return status;
-}							/* mbsys_3datdepthlidar_pulses */
-/*--------------------------------------------------------------------*/
-int mbsys_3datdepthlidar_gains
-(
-	int verbose,			/* in: verbosity level set on command line 0..N */
-	void *mbio_ptr,			/* in: see mb_io.h:/^struct mb_io_struct/ */
-	void *store_ptr,		/* in: see mbsys_3datdepthlidar.h:/^struct mbsys_3datdepthlidar_struct/ */
-	int *kind,				/* in: MBIO data type; see mb_status.h:0+/MBIO data type/ */
-	double *transmit_gain,	/* out: transmit gain (dB) */
-	double *pulse_length,	/* out: pulse width (usec) */
-	double *receive_gain,	/* out: receive gain (dB) */
-	int *error				/* out: see mb_status.h:/MB_ERROR/ */
-)
-{
-	char    *function_name = "mbsys_3datdepthlidar_gains";
-	int status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_3datdepthlidar_struct *store;
-
-	/* check for non-null data */
-	assert(mbio_ptr != NULL);
-	assert(store_ptr != NULL);
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> called\n", function_name);
-		fprintf(stderr, "dbg2  Input arguments:\n");
-		fprintf(stderr, "dbg2       verbose:    %d\n", verbose);
-		fprintf(stderr, "dbg2       mb_ptr:     %p\n", mbio_ptr);
-		fprintf(stderr, "dbg2       store_ptr:  %p\n", store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_3datdepthlidar_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-
-		/* get transmit_gain (dB) [I don't know how to convert this to db]*/
-		*transmit_gain = 0.0;
-
-		/* get pulse_length */
-		*pulse_length = 0.0;
-		
-		/* get receive_gain (dB) [I don't know how to convert to db] */
-		*receive_gain = 0.0;
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record types */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> completed\n", function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		fprintf(stderr, "dbg2       kind:       %d\n", *kind);
-		}
-	if ((verbose >= 2) && (*error == MB_ERROR_NO_ERROR))
-		{
-		fprintf(stderr, "dbg2       transmit_gain: %f\n", *transmit_gain);
-		fprintf(stderr, "dbg2       pulse_length:  %f\n", *pulse_length);
-		fprintf(stderr, "dbg2       receive_gain:  %f\n", *receive_gain);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "dbg2       error:      %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2       status:     %d\n", status);
-		}
-
-	/* return status */
-	return status;
-}								/* mbsys_3datdepthlidar_gains */
-/*--------------------------------------------------------------------*/
-int mbsys_3datdepthlidar_extract_altitude
-(
-	int verbose,				/* in: verbosity level set on command line 0..N */
-	void *mbio_ptr,				/* in: see mb_io.h:/^struct mb_io_struct/ */
-	void *store_ptr,			/* in: see mbsys_3datdepthlidar.h:/^struct mbsys_3datdepthlidar_struct/ */
-	int *kind,					/* in: MBIO data type; see mb_status.h:0+/MBIO data type/ */
-	double *transducer_depth,	/* out: transducer depth below water line (m) */
-	double *altitude,			/* out: transducer altitude above seafloor (m) */
-	int *error					/* out: see mb_status.h:/MB_ERROR/ */
-)
-{
-	char    *function_name = "mbsys_3datdepthlidar_extract_altitude";
-	int 	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_3datdepthlidar_struct *store;
-	struct mbsys_3datdepthlidar_pulse_struct *pulse;
-	int 	i;
-	double	rmin, r;
-
-	/* check for non-null data */
-	assert(mbio_ptr != NULL);
-	assert(store_ptr != NULL);
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> called\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n");
-		fprintf(stderr, "dbg2       verbose:    %d\n", verbose);
-		fprintf(stderr, "dbg2       mb_ptr:     %p\n", mbio_ptr);
-		fprintf(stderr, "dbg2       store_ptr:  %p\n", store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_3datdepthlidar_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get sonar depth */
-		*transducer_depth = store->sensordepth;
-		
-		/* loop over all soundings looking for most nadir */
-		rmin = 9999999.9;
-		for (i=0;i<store->num_pulses;i++)
-			{
-			pulse = &store->pulses[i];
-			r = sqrt(pulse->acrosstrack * pulse->acrosstrack
-					+ pulse->alongtrack * pulse->alongtrack);
-			if (r < rmin)
-				{
-				rmin = r;
-				*altitude = pulse->depth;
-				}
-			}
-
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> completed\n", function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		fprintf(stderr, "dbg2       kind:              %d\n", *kind);
-		fprintf(stderr, "dbg2       transducer_depth:  %f\n", *transducer_depth);
-		fprintf(stderr, "dbg2       altitude:          %f\n", *altitude);
-		fprintf(stderr, "dbg2       error:             %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2       status:            %d\n", status);
-		}
-
-	/* return status */
-	return status;
-}					/* mbsys_3datdepthlidar_extract_altitude */
-/*--------------------------------------------------------------------*/
-int mbsys_3datdepthlidar_extract_nnav
-(
-	int verbose,	/* in: verbosity level set on command line 0..N */
-	void *mbio_ptr,	/* in: see mb_io.h:/^struct mb_io_struct/ */
-	void *store_ptr,/* in: see mbsys_3datdepthlidar.h:/^struct mbsys_3datdepthlidar_struct/ */
-	int nmax,		/* in: maximum size available to n; e.g., n < nmax */
-	int *kind,		/* out: MBIO data type; see mb_status.h:0+/MBIO data type/ */
-	int *n,			/* out: number of navigation values extracted */
-	int *time_i,	/* out: array[n] time_i[7] values; see mb_time.c:0+/mb_get_time/ */
-	double *time_d,	/* out: array[n] time_d values; seconds since 1,1,1970 */
-	double *navlon,	/* out: array[n] longitude (degrees); -180.0..+180.0 */
-	double *navlat,	/* out: array[n] latitude (degree); -90..+90 */
-	double *speed,	/* out: array[n] speed (m/s) */
-	double *heading,/* out: array[n] heading (degree): 0..360 */
-	double *draft,	/* out: array[n] txer depth below datum (m) */
-	double *roll,	/* out: array[n] roll (degrees) */
-	double *pitch,	/* out: array[n] pitch (degrees) */
-	double *heave,	/* out: array[n] heave (m) */
-	int *error		/* out: see mb_status.h:/MB_ERROR/ */
-)
-{
-	char    *function_name = "mbsys_3datdepthlidar_extract_nnav";
-	int status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_3datdepthlidar_struct *store;
-	int inav;
-	int i;
-
-	/* check for non-null data */
-	assert(mbio_ptr != NULL);
-	assert(store_ptr != NULL);
-	assert(nmax > 0);
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> called\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n");
-		fprintf(stderr, "dbg2       verbose:    %d\n", verbose);
-		fprintf(stderr, "dbg2       mb_ptr:     %p\n", mbio_ptr);
-		fprintf(stderr, "dbg2       store_ptr:  %p\n", store_ptr);
-		fprintf(stderr, "dbg2       nmax:       %d\n", nmax);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_3datdepthlidar_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from ping structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* just one navigation value */
-		*n = 1;
-
-		/* get time */
-		time_d[0] = store->time_d;
-		mb_get_date(verbose, store->time_d, time_i);
-
-		/* get navigation and heading */
-		navlon[0] = store->navlon;
-		navlat[0] = store->navlat;
-		speed[0] = store->speed;
-		heading[0] = store->heading;
-
-		/* get draft */
-		draft[0] = store->sensordepth;
-
-		/* get roll pitch and heave. In SXP heave is included in height. */
-		roll[0] = store->roll;
-		pitch[0] = store->pitch;
-		heave[0] = 0.0;
-
-		/* done translating values */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-		}
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		*n = 0;
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-	/* deal with other record type */
-	else
-		{
-		*n = 0;
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> completed\n", function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		fprintf(stderr, "dbg2       kind:       %d\n", *kind);
-		fprintf(stderr, "dbg2       n:          %d\n", *n);
-		for (inav=0; inav<*n; inav++)
-			{
-			for (i=0; i<7; i++)
-				fprintf(stderr, "dbg2       %d time_i[%d]:     %d\n", inav, i,
-					time_i[inav * 7 + i]);
-			fprintf(stderr, "dbg2       %d time_d:        %f\n", inav, time_d[inav]);
-			fprintf(stderr, "dbg2       %d longitude:     %f\n", inav, navlon[inav]);
-			fprintf(stderr, "dbg2       %d latitude:      %f\n", inav, navlat[inav]);
-			fprintf(stderr, "dbg2       %d speed:         %f\n", inav, speed[inav]);
-			fprintf(stderr, "dbg2       %d heading:       %f\n", inav, heading[inav]);
-			fprintf(stderr, "dbg2       %d draft:         %f\n", inav, draft[inav]);
-			fprintf(stderr, "dbg2       %d roll:          %f\n", inav, roll[inav]);
-			fprintf(stderr, "dbg2       %d pitch:         %f\n", inav, pitch[inav]);
-			fprintf(stderr, "dbg2       %d heave:         %f\n", inav, heave[inav]);
-			}
-		fprintf(stderr, "dbg2       error:      %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2       status:     %d\n", status);
-		}
-
-	return status;
-}					/* mbsys_3datdepthlidar_extract_nnav */
-/*--------------------------------------------------------------------*/
-int mbsys_3datdepthlidar_extract_nav
-(
-	int verbose,
-	void *mbio_ptr,	/* in: verbosity level set on command line 0..N */
-	void *store_ptr,/* in: see mb_io.h:/^struct mb_io_struct/ */
-	int *kind,		/* out: see mbsys_3datdepthlidar.h:/^struct mbsys_3datdepthlidar_struct/ */
-	int time_i[7],	/* out: time_i[7] values; see mb_time.c */
-	double *time_d,	/* out: time in seconds since 1,1,1970 */
-	double *navlon,	/* out: longitude (degrees) -180..+180.0 */
-	double *navlat,	/* out: latittude (degrees) -90..+90 */
-	double *speed,	/* out: speed (km/s) */
-	double *heading,/* out: heading (degrees) 0..360 */
-	double *draft,	/* out: draft (m) */
-	double *roll,	/* out: roll (degrees) */
-	double *pitch,	/* out: pitch (degrees) */
-	double *heave,	/* out: heave (degrees) */
-	int *error		/* out: see mb_status.h:MB_ERROR */
-)
-{
-	char    *function_name = "mbsys_3datdepthlidar_extract_nav";
-	int status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_3datdepthlidar_struct *store;
-
-	/* check for non-null data */
-	assert(mbio_ptr != NULL);
-	assert(store_ptr != NULL);
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> called\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n");
-		fprintf(stderr, "dbg2       verbose:    %d\n", verbose);
-		fprintf(stderr, "dbg2       mb_ptr:     %p\n", mbio_ptr);
-		fprintf(stderr, "dbg2       store_ptr:  %p\n", store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure */
-	store = (struct mbsys_3datdepthlidar_struct *) store_ptr;
-
-	/* extract data from structure */
-	*kind = store->kind;	
-	
-	/* extract data from ping structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		mb_get_date(verbose,store->time_d,time_i);
-		*time_d = store->time_d;
-		*navlon = store->navlon;
-		*navlat = store->navlat;
-		*speed = store->speed;
-		*heading = store->heading;
-		*draft = store->sensordepth;
-		*roll = store->roll;
-		*pitch = store->pitch;
-		*heave = 0.0;
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-	/* deal with other record type */
-	else
-		{
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> completed\n", function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		fprintf(stderr, "dbg2       kind:       %d\n", *kind);
-		}
-	if ((verbose >= 2) && (*error <= MB_ERROR_NO_ERROR) && (*kind == MB_DATA_DATA))
-		{
-		fprintf(stderr, "dbg2       time_i[0]:     %d\n", time_i[0]);
-		fprintf(stderr, "dbg2       time_i[1]:     %d\n", time_i[1]);
-		fprintf(stderr, "dbg2       time_i[2]:     %d\n", time_i[2]);
-		fprintf(stderr, "dbg2       time_i[3]:     %d\n", time_i[3]);
-		fprintf(stderr, "dbg2       time_i[4]:     %d\n", time_i[4]);
-		fprintf(stderr, "dbg2       time_i[5]:     %d\n", time_i[5]);
-		fprintf(stderr, "dbg2       time_i[6]:     %d\n", time_i[6]);
-		fprintf(stderr, "dbg2       time_d:        %f\n", *time_d);
-		fprintf(stderr, "dbg2       longitude:     %f\n", *navlon);
-		fprintf(stderr, "dbg2       latitude:      %f\n", *navlat);
-		fprintf(stderr, "dbg2       speed:         %f\n", *speed);
-		fprintf(stderr, "dbg2       heading:       %f\n", *heading);
-		fprintf(stderr, "dbg2       draft:         %f\n", *draft);
-		fprintf(stderr, "dbg2       roll:          %f\n", *roll);
-		fprintf(stderr, "dbg2       pitch:         %f\n", *pitch);
-		fprintf(stderr, "dbg2       heave:         %f\n", *heave);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "dbg2       error:      %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2       status:     %d\n", status);
-		}
-
-	return status;
-}					/* mbsys_3datdepthlidar_extract_nav */
-/*----------------------------------------------------------------------*/
-int mbsys_3datdepthlidar_insert_nav
-(
-	int verbose,
-	void *mbio_ptr,	/* in: verbosity level set on command line */
-	void *store_ptr,/* in: see mb_io.h:mb_io_struct */
-	int time_i[7],	/* in: time_i struct; see mb_time.c */
-	double time_d,	/* in: time in seconds since 1,1,1970 */
-	double navlon,	/* in: longitude in degrees -180..+180 */
-	double navlat,	/* in: latitude in degrees -90..+90 */
-	double speed,	/* in: speed (m/s) */
-	double heading,	/* in: heading (degrees) */
-	double draft,	/* in: draft (m) */
-	double roll,	/* in: roll (degrees) */
-	double pitch,	/* in: pitch (degreees) */
-	double heave,	/* in: heave (m) */
-	int *error		/* out: see mb_status.h:MB_ERROR */
-)
-{
-	char    *function_name = "mbsys_3datdepthlidar_insert_nav";
-	int status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_3datdepthlidar_struct *store;
-	struct mbsys_3datdepthlidar_pulse_struct *pulse;
-	int	i;
-
-	/* check for non-null data */
-	assert(mbio_ptr != NULL);
-	assert(store_ptr != NULL);
-	assert(time_i != NULL);
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> called\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n");
-		fprintf(stderr, "dbg2       verbose:    %d\n", verbose);
-		fprintf(stderr, "dbg2       mbio_ptr:   %p\n", mbio_ptr);
-		fprintf(stderr, "dbg2       store_ptr:  %p\n", store_ptr);
-		fprintf(stderr, "dbg2       time_i[0]:  %d\n", time_i[0]);
-		fprintf(stderr, "dbg2       time_i[1]:  %d\n", time_i[1]);
-		fprintf(stderr, "dbg2       time_i[2]:  %d\n", time_i[2]);
-		fprintf(stderr, "dbg2       time_i[3]:  %d\n", time_i[3]);
-		fprintf(stderr, "dbg2       time_i[4]:  %d\n", time_i[4]);
-		fprintf(stderr, "dbg2       time_i[5]:  %d\n", time_i[5]);
-		fprintf(stderr, "dbg2       time_i[6]:  %d\n", time_i[6]);
-		fprintf(stderr, "dbg2       time_d:     %f\n", time_d);
-		fprintf(stderr, "dbg2       navlon:     %f\n", navlon);
-		fprintf(stderr, "dbg2       navlat:     %f\n", navlat);
-		fprintf(stderr, "dbg2       speed:      %f\n", speed);
-		fprintf(stderr, "dbg2       heading:    %f\n", heading);
-		fprintf(stderr, "dbg2       draft:      %f\n", draft);
-		fprintf(stderr, "dbg2       roll:       %f\n", roll);
-		fprintf(stderr, "dbg2       pitch:      %f\n", pitch);
-		fprintf(stderr, "dbg2       heave:      %f\n", heave);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_3datdepthlidar_struct *) store_ptr;
-
-	/* insert data in swathplus data structure */
-	if (store->kind == MB_DATA_DATA)
-		{
-		store->time_d = time_d;
-		store->navlon = navlon;
-		store->navlat = navlat;
-		store->speed = speed;
-		store->heading = heading;
-		store->sensordepth = draft - heave;
-		store->roll = roll;
-		store->pitch = pitch;
-
-		/* need to apply nav values to all pulses */
-		for (i=0;i<store->num_pulses;i++)
-			{
-			pulse = &store->pulses[i];
-			pulse->navlon = store->navlon;
-			pulse->navlat = store->navlat; 
-			pulse->sensordepth = store->sensordepth; 
-			pulse->heading = store->heading; 
-			pulse->roll = store->roll; 
-			pulse->pitch = store->pitch; 
-			}
-
-		/* done translating values */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> completed\n", function_name);
-		fprintf(stderr, "dbg2  Return value:\n");
-		fprintf(stderr, "dbg2       error:      %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2       status:  %d\n", status);
-		}
-
-	return status;
-}						/* mbsys_3datdepthlidar_insert_nav */
-/*----------------------------------------------------------------------*/
-int mbsys_3datdepthlidar_extract_svp
-(
-	int verbose,		/* in: verbosity level set on command line 0..N */
-	void *mbio_ptr,		/* in: see mb_io.h:mb_io_struct */
-	void *store_ptr,	/* in: see mbsys_3datdepthlidar.h:mbsys_3datdepthlidar_struct */
-	int *kind,			/* out: see mb_status.h:MBIO data type */
-	int *nsvp,			/* out: number of svp measurements */
-	double *depth,		/* out: array[nsvp] depths (m) */
-	double *velocity,	/* out: array[nsvp] velocity (m) */
-	int *error			/* out: see: mb_status.h:MB_ERROR */
-)
-{
-	char    *function_name = "mbsys_3datdepthlidar_extract_svp";
-	int status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_3datdepthlidar_struct *store;
-	int i;
-
-	/* check for non-null data */
-	assert(mbio_ptr != NULL);
-	assert(store_ptr != NULL);
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> called\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n");
-		fprintf(stderr, "dbg2       verbose:    %d\n", verbose);
-		fprintf(stderr, "dbg2       mb_ptr:     %p\n", mbio_ptr);
-		fprintf(stderr, "dbg2       store_ptr:  %p\n", store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_3datdepthlidar_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> completed\n", function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		fprintf(stderr, "dbg2       kind:              %d\n", *kind);
-		fprintf(stderr, "dbg2       nsvp:              %d\n", *nsvp);
-		for (i=0; i<*nsvp; i++)
-			fprintf(stderr,
-				"dbg2       depth[%d]: %f   velocity[%d]: %f\n",
-				i,
-				depth[i],
-				i,
-				velocity[i]);
-		fprintf(stderr, "dbg2       error:             %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2       status:            %d\n", status);
-		}
-
-	/* return status */
-	return status;
-}						/* mbsys_3datdepthlidar_extract_svp */
-/*----------------------------------------------------------------------*/
-int mbsys_3datdepthlidar_insert_svp
-(
-	int verbose,		/* in: verbosity level set on command line 0..N */
-	void *mbio_ptr,		/* in: mbio.h:mb_io_struct */
-	void *store_ptr,	/* in: mbsys_3datdepthlidar_struct */
-	int nsvp,			/* in: number of svp records to insert */
-	double *depth,		/* in: array[nsvp] depth records (m) */
-	double *velocity,	/* in: array[nsvp] sound velocity records (m/s) */
-	int *error			/* out: see mb_status.h:MB_ERROR */
-)
-{
-	char    *function_name = "mbsys_3datdepthlidar_insert_svp";
-	int status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_3datdepthlidar_struct *store;
-	int i;
-
-	/* check for non-null data */
-	assert(mbio_ptr != NULL);
-	assert(store_ptr != NULL);
-	assert(nsvp > 0);
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> called\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n");
-		fprintf(stderr, "dbg2       verbose:    %d\n", verbose);
-		fprintf(stderr, "dbg2       mbio_ptr:   %p\n", mbio_ptr);
-		fprintf(stderr, "dbg2       store_ptr:  %p\n", store_ptr);
-		fprintf(stderr, "dbg2       nsvp:       %d\n", nsvp);
-		for (i=0; i<nsvp; i++)
-			fprintf(stderr,
-				"dbg2       depth[%d]: %f   velocity[%d]: %f\n",
-				i,
-				depth[i],
-				i,
-				velocity[i]);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_3datdepthlidar_struct *) store_ptr;
-
-	/* insert data in structure */
-	if (store->kind == MB_DATA_COMMENT)
-		{
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-		
-	/* handle other types */
-	else
-		{
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> completed\n", function_name);
-		fprintf(stderr, "dbg2  Return value:\n");
-		fprintf(stderr, "dbg2       error:      %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2       status:  %d\n", status);
-		}
-
-	/* return status */
-	return status;
-}					/* mbsys_3datdepthlidar_insert_svp */
-/*----------------------------------------------------------------------*/
-int mbsys_3datdepthlidar_copy
-(
-	int verbose,	/* in: verbosity level set on command line */
-	void *mbio_ptr,	/* in: see mb_io.h:mb_io_struct */
-	void *store_ptr,/* in: see mbsys_3datdepthlidar.h:mbsys_3datdepthlidar_struct */
-	void *copy_ptr,	/* out: see mbsys_3datdepthlidar.h:mbsys_3datdepthlidar_struct */
-	int *error		/* out: see mb_status.h:MB_ERROR */
-)
-{
-	char    *function_name = "mbsys_3datdepthlidar_copy";
-	int status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_3datdepthlidar_struct *store;
-	struct mbsys_3datdepthlidar_struct *copy;
-	int	npulses;
-
-	/* check for non-null data */
-	assert(mbio_ptr != NULL);
-	assert(store_ptr != NULL);
-	assert(copy_ptr != NULL);
-	assert(store_ptr != copy_ptr);
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> called\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n");
-		fprintf(stderr, "dbg2       verbose:    %d\n", verbose);
-		fprintf(stderr, "dbg2       mbio_ptr:   %p\n", mbio_ptr);
-		fprintf(stderr, "dbg2       store_ptr:  %p\n", store_ptr);
-		fprintf(stderr, "dbg2       copy_ptr:   %p\n", copy_ptr);
-		}
-
-	/* set error status */
-	*error = MB_ERROR_NO_ERROR;
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointers */
-	store = (struct mbsys_3datdepthlidar_struct *) store_ptr;
-	copy = (struct mbsys_3datdepthlidar_struct *) copy_ptr;
-
-	/* copy structure */
-	copy = store;
-	
-	/* allocate array of pulse structures */
-	copy->pulses = NULL;
-
-	/* allocate memory for data structure */
-	if (store->counts_per_scan > 0)
-		{
-		npulses = store->counts_per_scan;
-		}
-	else
-		{
-		npulses = store->counts_per_cross_track * store->counts_per_forward_track;
-		}
-	status = mb_mallocd(verbose, __FILE__, __LINE__,
-		npulses * sizeof(struct mbsys_3datdepthlidar_pulse_struct),
-		(void **)store_ptr, error);
-	
-	/* copy pulses */
-	memcpy((void *)copy->pulses, (void *)store->pulses,
-		npulses * sizeof(struct mbsys_3datdepthlidar_pulse_struct));
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> completed\n", function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		fprintf(stderr, "dbg2       error:      %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2       status:     %d\n", status);
-		}
-
-	return status;
-}						/* mbsys_3datdepthlidar_copy */
-/*----------------------------------------------------------------------*/
-int mbsys_3datdepthlidar_print_store
-(
-	int verbose,					/* in: verbosity level set on command line 0..N */
-	void *store_ptr,				/* in: see mbsys_3datdepthlidar.h:mbsys_3datdepthlidar_struct */
-	int *error					/* out: see mb_status.h:MB_ERROR */
-)
-{
-	char    *function_name = "mbsys_3datdepthlidar_print_store";
-	struct mbsys_3datdepthlidar_struct *store;
-	struct mbsys_3datdepthlidar_pulse_struct *pulse;
-	int 	status;
-	char	*debug_str = "dbg2  ";
-	char	*nodebug_str = "  ";
-	char	*first;
-	int	npulses;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> called\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n");
-		fprintf(stderr, "dbg2       verbose:    %d\n", verbose);
-		fprintf(stderr, "dbg2         store:    %p\n", store_ptr);
-		}
-
-	/* check for non-null data */
-	assert(store_ptr != NULL);
-
-	/* always successful */
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-
-	/* get data structure pointers */
-	store = (struct mbsys_3datdepthlidar_struct *) store_ptr;
-
-	/* print 3datdepthlidar store structure contents */
-	if (verbose >= 2)
-		first = debug_str;
-	else
-		{
-		first = nodebug_str;
-		fprintf(stderr,"\n%sMBIO function <%s> called\n",
-			first,function_name);
-		}
-	fprintf(stderr,"%s struct mbsys_3datdepthlidar contents:\n", first);
-	fprintf(stderr,"%s     kind:                          %d\n",first,store->kind);
-	fprintf(stderr,"%s     file_version:                  %u\n",first,store->file_version);
-	fprintf(stderr,"%s     sub_version:                   %u\n",first,store->sub_version);
-	fprintf(stderr,"%s     scan_type:                     %u\n",first,store->scan_type);
-	fprintf(stderr,"%s     cross_track_angle_start:       %f\n",first,store->cross_track_angle_start);
-	fprintf(stderr,"%s     cross_track_angle_end:         %f\n",first,store->cross_track_angle_end);
-	fprintf(stderr,"%s     forward_track_angle_start:     %f\n",first,store->forward_track_angle_start);
-	fprintf(stderr,"%s     forward_track_angle_end:       %f\n",first,store->forward_track_angle_end);
-	fprintf(stderr,"%s     counts_per_scan:               %u\n",first,store->counts_per_scan);
-	fprintf(stderr,"%s     counts_per_cross_track:        %u\n",first,store->counts_per_cross_track);
-	fprintf(stderr,"%s     counts_per_forward_track:      %u\n",first,store->counts_per_forward_track);
-	fprintf(stderr,"%s     scanner_efficiency:            %u\n",first,store->scanner_efficiency);
-	fprintf(stderr,"%s     scans_per_file:                %u\n",first,store->scans_per_file);
-	fprintf(stderr,"%s     scan_count:                    %u\n",first,store->scan_count);
-	fprintf(stderr,"%s     record_id:                     %u\n",first,store->record_id);
-	if (store->kind == MB_DATA_DATA)
-		{
-		fprintf(stderr,"%s     current_scan:                  %d\n",first,store->current_scan);
-		fprintf(stderr,"%s     year:                          %u\n",first,store->year);
-		fprintf(stderr,"%s     month:                         %u\n",first,store->month);
-		fprintf(stderr,"%s     day:                           %u\n",first,store->day);
-		fprintf(stderr,"%s     days_since_jan_1:              %u\n",first,store->days_since_jan_1);
-		fprintf(stderr,"%s     hour:                          %u\n",first,store->hour);
-		fprintf(stderr,"%s     minutes:                       %u\n",first,store->minutes);
-		fprintf(stderr,"%s     seconds:                       %u\n",first,store->seconds);
-		fprintf(stderr,"%s     nanoseconds:                   %u\n",first,store->nanoseconds);
-		fprintf(stderr,"%s     time_d:                        %f\n",first,store->time_d);
-		fprintf(stderr,"%s     navlon:                        %f\n",first,store->navlon);
-		fprintf(stderr,"%s     navlat:                        %f\n",first,store->navlat);
-		fprintf(stderr,"%s     sonardepth:                    %f\n",first,store->sensordepth);
-		fprintf(stderr,"%s     heading:                       %f\n",first,store->heading);
-		fprintf(stderr,"%s     roll:                          %f\n",first,store->roll);
-		fprintf(stderr,"%s     pitch:                         %f\n",first,store->pitch);
-		fprintf(stderr,"%s     speed:                         %f\n",first,store->speed);
-		fprintf(stderr,"%s     bathymetry_calculated:         %d\n",first,store->bathymetry_calculated);
-		fprintf(stderr,"%s     num_pulses:                    %d\n",first,store->num_pulses);
-		fprintf(stderr,"%s     num_pulses_alloc:              %d\n",first,store->num_pulses_alloc);
-		if (store->counts_per_scan > 0)
-			{
-			npulses = store->counts_per_scan;
-			}
-		else
-			{
-			npulses = store->counts_per_cross_track * store->counts_per_forward_track;
-			}
-		for (i=0;i<store->num_pulses;i++)
-			{
-			pulse = &(store->pulses[i]);
-			fprintf(stderr,"%s------------------------------------------\n",first);
-			fprintf(stderr,"%s     pulse:                         %d\n",first,i);
-			fprintf(stderr,"%s     range:                         %f\n",first,pulse->range);
-			fprintf(stderr,"%s     amplitude:                     %d\n",first,pulse->amplitude);
-			fprintf(stderr,"%s     snr:                           %f\n",first,pulse->snr);
-			fprintf(stderr,"%s     cross_track_angle:             %f\n",first,pulse->cross_track_angle);
-			fprintf(stderr,"%s     forward_track_angle:           %f\n",first,pulse->forward_track_angle);
-			fprintf(stderr,"%s     cross_track_offset:            %f\n",first,pulse->cross_track_offset);
-			fprintf(stderr,"%s     forward_track_offset:          %f\n",first,pulse->forward_track_offset);
-			fprintf(stderr,"%s     pulse_time_offset:             %d\n",first,pulse->pulse_time_offset);
-			fprintf(stderr,"%s     saturated:                     %u\n",first,pulse->saturated);
-			fprintf(stderr,"%s     time_d:                        %f\n",first,pulse->time_d);
-			fprintf(stderr,"%s     beamflag:                      %u\n",first,pulse->beamflag);
-			fprintf(stderr,"%s     acrosstrack:                   %f\n",first,pulse->acrosstrack);
-			fprintf(stderr,"%s     alongtrack:                    %f\n",first,pulse->alongtrack);
-			fprintf(stderr,"%s     depth:                         %f\n",first,pulse->depth);
-			fprintf(stderr,"%s     navlon:                        %f\n",first,pulse->navlon);
-			fprintf(stderr,"%s     navlat:                        %f\n",first,pulse->navlat);
-			fprintf(stderr,"%s     sonardepth:                    %f\n",first,pulse->sensordepth);
-			fprintf(stderr,"%s     heading:                       %f\n",first,pulse->heading);
-			fprintf(stderr,"%s     roll:                          %f\n",first,pulse->roll);
-			fprintf(stderr,"%s     pitch:                         %f\n",first,pulse->pitch);
-			}
-		}
-	else if (store->kind == MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"%s     comment_len:                   %d\n",first,store->comment_len);
-		fprintf(stderr,"%s     comment:                       %s\n",first,store->comment);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> completed\n", function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		fprintf(stderr, "dbg2       error:      %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2       status:     %d\n", status);
-		}
-
-	/* return status */
-	return status;
-}							/* mbsys_3datdepthlidar_print_store */
-/*--------------------------------------------------------------------*/
-int mbsys_3datdepthlidar_calculatebathymetry
-(
-	int verbose,					/* in: verbosity level set on command line 0..N */
-	void *mbio_ptr,					/* in: see mb_io.h:mb_io_struct */
-	void *store_ptr,				/* in: see mbsys_3datdepthlidar.h:mbsys_3datdepthlidar_struct */
-	int *error					/* out: see mb_status.h:MB_ERROR */
-)
-{
-	char    *function_name = "mbsys_3datdepthlidar_calculatebathymetry";
-	struct mbsys_3datdepthlidar_struct *store;
-	struct mbsys_3datdepthlidar_pulse_struct *pulse;
-	int 	status;
-	int	time_i[7];
-	double	alpha, beta, theta, phi;
-	double	mtodeglon, mtodeglat;
-	double	xx;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> called\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n");
-		fprintf(stderr, "dbg2       verbose:    %d\n", verbose);
-		fprintf(stderr, "dbg2         store:    %p\n", store_ptr);
-		}
-
-	/* check for non-null data */
-	assert(store_ptr != NULL);
-
-	/* always successful */
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-
-	/* get data structure pointers */
-	store = (struct mbsys_3datdepthlidar_struct *) store_ptr;
-	
-	/* recalculate bathymetry from LIDAR data */
-	if (store->kind == MB_DATA_DATA)
-		{
-		/* get time_d timestamp */
-		time_i[0] = store->year;
-		time_i[1] = store->month;
-		time_i[2] = store->day;
-		time_i[3] = store->hour;
-		time_i[4] = store->minutes;
-		time_i[5] = store->seconds;
-		time_i[6] = (int)(0.001 * store->nanoseconds);
-		mb_get_time(verbose, time_i, &store->time_d);
-		
-		/* get scaling */
-		mb_coor_scale(verbose,store->navlat,&mtodeglon,&mtodeglat);
-
-		/* loop over all pulses */
-		for (i=0;i<store->num_pulses;i++)
-			{
-			/* get pulse */
-			pulse = (struct mbsys_3datdepthlidar_pulse_struct *) &store->pulses[i];
-
-			/* valid pulses have nonzero ranges */
-			if (pulse->range > 0.001)
-				{
-				/* set beamflag */
-				pulse->beamflag = MB_FLAG_NONE;
-				
-				/* apply pitch and roll */
-				alpha = pulse->forward_track_angle + pulse->pitch;
-				beta = 90.0 - pulse->cross_track_angle - pulse->roll;
-				
-				/* translate to takeoff coordinates */
-				mb_rollpitch_to_takeoff(
-						verbose,
-						alpha, beta,
-						&theta, &phi,
-						error);
-				
-				/* get lateral and vertical components of range */
-				xx = pulse->range * sin(DTR * theta);
-				pulse->depth = pulse->range * cos(DTR * theta);
-				pulse->acrosstrack = xx * cos(DTR * phi) + pulse->cross_track_offset;
-				pulse->alongtrack = xx * sin(DTR * phi) + pulse->forward_track_offset
-							+ 0.0000002777777 * pulse->pulse_time_offset * store->speed;
-				}
-			else
-				{
-				/* null everything */
-				pulse->beamflag = MB_FLAG_NULL;
-				pulse->depth = 0.0;
-				pulse->acrosstrack = 0.0;
-				pulse->alongtrack = 0.0;
-				}
-			}
-		
-		/* set the bathymetry_calculated flag */
-		store->bathymetry_calculated = MB_YES;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> completed\n", function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		fprintf(stderr, "dbg2       error:      %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2       status:     %d\n", status);
-		}
-
-	/* return status */
-	return status;
-}							/* mbsys_3datdepthlidar_print_store */
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mbsys_3datdepthlidar.h b/src/mbio/mbsys_3datdepthlidar.h
deleted file mode 100644
index 43b1b34..0000000
--- a/src/mbio/mbsys_3datdepthlidar.h
+++ /dev/null
@@ -1,500 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbsys_3datdepthlidar.h	11/29/2013
- *	$Id: mbsys_3datdepthlidar.h 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 2013-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbsys_3datdepthlidar.h defines the MBIO data structures for handling data from
- * 3DatDepth LIDAR laser scanning system: 
- *      MBF_3DDEPTHP : MBIO ID 231 - SWATHplus processed format
- *
- * Author:	David W. Caress
- * Date:	November 29, 2013
- *
- * $Log: mbsys_3datdepthlidar.c,v $
- *
- */
-/*
- * Notes on the MBSYS_3DATDEPTHLIDAR data structure:
- *
- * Vendor processed format from 3DatDepth, produced from raw LIDAR
- * time series files by proprietary 3DatDepth software
- *
- *--------------------------------------------------------------------------------
- * Processing Tool Data Output
- * 
- * The 3D at Depth Processing Tool reads binary sensor data and
- * processes it to provide corresponding range angle data, saved
- * to a binary file. A timestamp is provided for each scan recorded
- * in the file. This timestamp is the time of the first laser pulse
- * for that scan. The μsec time value listed for each laser pulse
- * is the relative time between each successive pulse, offset from
- * the timestamp. The value for the first pulse should be subtracted
- * from all pulses in that scan (including itself), such that the
- * first pulse would be 0 μsec accordingly.
- * 
- * ---------------------------------------------------------------------------------------
- * Range Angle Angle data format (binary)
- *              Item	                                Value	            Bytes
- * ---------------------------------------------------------------------------------------
- * File Header Record	
- *           File magic number	                        0x3D46	            2   (1 UINT16)
- *           Parameter record id	                0x3D07	            2   (1 UINT16)
- *           File version	                        1	            2   (1 UINT16)
- *           File sub version	                        1	            2   (1 UINT16)
- * Scan Information		
- *           Scan type (AZ raster, AZEL raster, bowtie)	2, 3, 4             2   (1 UINT16)
- *           Cross track angle start (deg)		                    4   (1 float32)
- *           Cross track angle end (deg)		                    4   (1 float32)
- *           Forward track angle start (deg)		                    4   (1 float32)
- *           Forward track angle end (deg)		                    4   (1 float32)
- *           Counts per Scan (AZ raster and bowtie)		            2   (1 UINT16)
- *           Counts per cross track (AZEL raster)		            2   (1 UINT16)
- *           Counts per forward track (AZEL raster)		            2   (1 UINT16)
- *           Scanner Efficiency		                                    2   (1 UINT16)
- *           Scans per File		                                    2   (1 UINT16)
- *           Scan count		                                            4   (1 UINT32)
- *           
- * ---------------------------------------------------------------------------------------
- * Lidar Scan Record	
- *           Lidar scan record id	                0x3D52	            2   (1 UINT16)
- * First Pulse Timestamp ( 1 to n Scans )		
- *           Timestamp year		                                    2   (1 UINT16)
- *           Timestamp month		                                    1   (1 UINT8)
- *           Timestamp day		                                    1   (1 UINT8)
- *           Timestamp days since Jan 1		                            2   (1 UINT16)
- *           Timestamp hour		                                    2   (1 UINT16)
- *           Timestamp minutes		                                    1   (1 UINT8)
- *           Timestamp seconds		                                    1   (1 UINT8)
- *           Timestamp nano seconds		                            4   (1 UINT32)
- * Laser Pulse Data ( 1 to m pulses per scan )		
- *           Range ( from glass front ) meters                              4   (1 float32)
- *           Amplitude / peak of signal	                         	    2   (1 short int)
- *           SNR of signal return		                            4   (1 float32)
- *           Cross track angle (deg)		                            4   (1 float32)
- *           Forward track angle (deg)		                            4   (1 float32)
- *           Cross track offset (m)		                            4   (1 float32)
- *           Forward track offset (m)		                            4   (1 float32)
- *           Pulse time offset (µsec)		                            4   (1 UINT32)
- *           Saturated (0/1)    		                            1   (1 UINT8)
- *           
- * For each scan per file, a “First Pulse Timestamp” and “m” sets of
- * “Laser Pulse Data” will exist.  For example, for a Continuous Scan
- * file with 500 scans per file, and 200 pts per scan, the following
- * data would be present:
- * 	File Header
- * 	Scan Information
- *      (1) First Pulse Timestamp
- * 		200	 Laser Pulse Data sets
- *      (2) First Pulse Timestamp
- *              200	Laser Pulse Data sets
- * 		…
- *      (500) First Pulse Timestamp
- * 	        200	 Laser Pulse Data sets
- * 
- * A Bowtie scan file would be the same as above.  A Full scan file
- * will only contain one scan of data but with “Counts per Cross track”
- * multiplied by “Counts per Forward track” sets of laser pulse data.
- * 
- * The timestamp is the time of the first laser pulse for that scan.
- * The pulse time offset (µsec) value listed for each laser pulse is
- * the relative time between each successive pulse.  The value for the
- * first pulse should be subtracted from all pulses in that scan, such
- * that the first pulse would be 0 µsec accordingly.  The Pt Valid term
- * is provided to specify range validity.  If “valid” is given as 0, a
- * range could not be determined for that laser pulse, or it fell
- * outside of the processing limits.
- * 
- * Note, if processing is interrupted by hitting the “Cancel Processing”
- * button, an indeterminate number of records may exist in the current
- * processing file.  All processed files will be written to the same
- * folder location of the raw file.  The same file name is used for
- * processed files, but with a “.csv” or “.bin” file extension.  If data
- * is reprocessed in the same folder location, previously processed data
- * files will be overwritten.
- *
- *--------------------------------------------------------------------------------
- * INS Data Format
- * 
- * INU serial packets are archived to data files located at %RAW_DATA_PATH%/INU/.
- * %RAW_DATA_PATH% is set in the sensor configuration file. Data files are
- * named INU_MMDDYYYY_HHMMSS.bin. 3000 navigation messages are stored per
- * each archived data file, representing approximately 5 minutes data storage
- * if collecting messages at 10 Hz. The binary data file storage is provided
- * below, for the first record. Additional records follow to 3000 per file.
- * The latency from first character received to the timestamp is approximately
- * 100 msec. If an error occurs, or the first byte read from the serial port is
- * not equal to the INU magic character, the software will begin reading byte
- * by byte in an attempt to resync.
- *              Item                                Value                   Bytes
- *           Header Magic Number                    0xE32F                  2 (1 UINT16)
- *           Timestamp year                                                 2 (1 UINT16)
- *           Timestamp month                                                1 (1 UINT8)
- *           Timestamp day                                                  1 (1 UINT8)
- *           Timestamp days since Jan 1                                     2 (1 UINT16)
- *           Timestamp hour                                                 2 (1 UINT16)
- *           Timestamp minutes                                              1 (1 UINT8)
- *           Timestamp seconds                                              1 (1 UINT8)
- *           Timestamp nano seconds                                         4 (1 UINT32)
- *           Latency (μseconds) – latency from first                        4 (1 float32)
- *                                 character received to timestamp
- *           INU Nav message 1
- *                      complete message as received from INU               Len / packet ‐ reference the INU specification
- *                      1 magic, 1 ID, 1 data len, N NAV bytes                          
- * 
- *--------------------------------------------------------------------------------
- * CTD Ethernet Interface
- * 
- * The 3D at Depth laser sensor listens for CTD data packets available on port
- * 2003 of the static IP address for the sensor. The sensor reads and timestamps
- * these packets and saves the data to a binary file, located at %RAW_DATA_PATH%/CTD/.
- * %RAW_DATA_PATH% is set in the sensor configuration file.
- * Data files are named CTD_MMDDYYYY_HHMMSS.bin. The file format is as follows.
- * CTD Packets
- *              Item                                Value                   Bytes
- *           Header Magic Number                    0x3D07                  2 (1 UINT16)
- *           Timestamp year                                                 2 (1 UINT16)
- *           Timestamp month                                                1 (1 UINT8)
- *           Timestamp day                                                  1 (1 UINT8)
- *           Timestamp days since Jan 1                                     2 (1 UINT16)
- *           Timestamp hour                                                 2 (1 UINT16)
- *           Timestamp minutes                                              1 (1 UINT8)
- *           Timestamp seconds                                              1 (1 UINT8)
- *           Timestamp nano seconds                                         4 (1 UINT32)
- *           Header project code                    0x3D03                  2 (1 UINT16)
- *           Header version                         1                       1 (1 UINT8)
- *           Water Temperature C                                            8 (1 double)
- *           Water Salinity psu                                             8 (1 double)
- *           Water Pressure dbar                                            8 (1 double)
- *--------------------------------------------------------------------------------
- *
- */
-
-/* include mb_define.h */
-#ifndef MB_DEFINE_DEF
-#include "mb_define.h"
-#endif
-
-/* defines */
-#define MBF_3DDEPTHP_MAGICNUMBER                    0x3D46    /* '=''F' */
-#define MBF_3DDEPTHP_RECORD_PARAMETER               0x3D07    /* '=', Bell */
-#define MBF_3DDEPTHP_RECORD_RAWLIDAR                0x3D52    /* '=''R' */
-#define MBF_3DDEPTHP_RECORD_COMMENT                 0x3D43    /* '=''C' */
-#define MBF_3DDEPTHP_RECORD_LIDAR                   0x3D4C    /* '=''L' */
-#define MBF_3DDEPTHP_RECORD_POSITION                0x3D50    /* '=''P' */
-#define MBF_3DDEPTHP_RECORD_ATTITUDE                0x3D41    /* '=''A' */
-#define MBF_3DDEPTHP_RECORD_HEADING                 0x3D48    /* '=''H' */
-#define MBF_3DDEPTHP_RECORD_SENSORDEPTH             0x3D5A    /* '=''Z' */
-#define MBF_3DDEPTHP_VERSION_1_0_PARAMETER_SIZE     36
-#define MBF_3DDEPTHP_VERSION_1_1_PARAMETER_SIZE     38
-#define MBF_3DDEPTHP_VERSION_1_0_SCANHEADER_SIZE    14
-#define MBF_3DDEPTHP_VERSION_1_1_RAWSCANHEADER_SIZE 18
-#define MBF_3DDEPTHP_VERSION_1_1_SCANHEADER_SIZE    66
-#define MBF_3DDEPTHP_VERSION_1_0_PULSE_SIZE         31
-#define MBF_3DDEPTHP_VERSION_1_1_RAWPULSE_SIZE      31
-#define MBF_3DDEPTHP_VERSION_1_1_PULSE_SIZE         100
-
-/* Kearfoot INS position and attitude data structure */
-
-/* 3DatDepth LIDAR data structure */
-struct mbsys_3datdepthlidar_pulse_struct
-	{
-        /* Laser Pulse Data (1 to counts_per_scan pulses per scan) */
-        float           range;                      /* meters from glass front */
-        short           amplitude;                  /* peak of signal - to 1023 */
-        float           snr;                        /* SNR of signal return */
-        float           cross_track_angle;          /* degrees */
-        float           forward_track_angle;        /* degrees */
-        float           cross_track_offset;         /* m */
-        float           forward_track_offset;       /* m */
-        unsigned int    pulse_time_offset;          /* time offset relative to start of scan (usec) */
-        mb_u_char       saturated;                  /* boolean */
-        
-        /* processed information */
-        double          time_d;                     /* epoch time */
-        mb_u_char       beamflag;                   /* MB-System beam flag */
-        double          acrosstrack;                /* acrosstrack distance relative to survey system reference point (meters) */
-        double          alongtrack;                 /* alongtrack distance relative to survey system reference point (meters) */
-        double          depth;                      /* m relative to survey system reference point */
-        double          navlon;                     /* absolute position longitude (degrees) */
-        double          navlat;                     /* absolute position latitude (degrees) */
-        double          sensordepth;                 /* absolute position depth below sea surface (meters), includes any tide correction */
-        float           heading;                    /* lidar heading (degrees) */
-        float           roll;                       /* lidar roll (degrees) */
-        float           pitch;                      /* lidar pitch (degrees) */
-	};
-
-/* 3DatDepth LIDAR data structure */
-struct mbsys_3datdepthlidar_struct
-	{
-        /* Type of data record */
-        int             kind;                       /* MB-System record ID */
-
-        /* File Header */
-        unsigned short  file_version;               /* 1 */
-        unsigned short  sub_version;                /* 0 = initial version from 3DatDepth,
-                                                       1 = first extended version for MB-System */
-        
-        /* Scan Information */
-        unsigned short  scan_type;                  /* (2: AZ raster, 3: AZEL raster, 4: bowtie) */
-        float           cross_track_angle_start;    /* across track angle start relative to lidar (degrees) */
-        float           cross_track_angle_end;      /* across track angle end relative to lidar (degrees) */
-        float           forward_track_angle_start;  /* across track angle end relative to lidar (degrees) */
-        float           forward_track_angle_end;    /* across track angle end relative to lidar (degrees) */
-        unsigned short  counts_per_scan;            /* pulse count for scan types AZ raster and bowtie*/
-        unsigned short  counts_per_cross_track;     /* across track pulse count for scan type AZEL raster */
-        unsigned short  counts_per_forward_track;   /* along track pulse count for scan type AZEL raster */
-        unsigned short  scanner_efficiency;         /* */
-        unsigned short  scans_per_file;             /* number of scans in this file */
-        unsigned int    scan_count;                 /* global scan count */
-        
-        /* Id of most recently read record */
-        unsigned short  record_id;                  /* MBF_3DDEPTHP_RECORD_RAWLIDAR     0x0000          */
-                                                    /* MBF_3DDEPTHP_RECORD_COMMENT      0x3D43   'R''C' */
-                                                    /* MBF_3DDEPTHP_RECORD_LIDAR        0x3D4C   'R''L' */
-                                                    /* MBF_3DDEPTHP_RECORD_POSITION     0x3D50   'R''P' */
-                                                    /* MBF_3DDEPTHP_RECORD_ATTITUDE     0x3D41   'R''A' */
-                                                    /* MBF_3DDEPTHP_RECORD_HEADING      0x3D48   'R''H' */
-                                                    /* MBF_3DDEPTHP_RECORD_SENSORDEPTH  0x3D5A   'R''Z' */
-
-        /* Number of Current Laser Scan Data (1 to scans_per_file Scans) */
-        int             current_scan;               /* sequential count of current scan, starting with 0 */
-        
-        /* First Pulse Timestamp (1 to n Scans) */
-        unsigned short  year;
-        mb_u_char       month;
-        mb_u_char       day;
-        unsigned short  days_since_jan_1;           /* day of year minus 1 */
-        unsigned short  hour;
-        mb_u_char       minutes;
-        mb_u_char       seconds;
-        unsigned int    nanoseconds;
-        
-        /* position and attitude per first pulse */
-        double          time_d;                     /* epoch time */
-        double          navlon;                     /* lidar reference position longitude (degrees) */
-        double          navlat;                     /* lidar reference position latitude (degrees) */
-        double          sensordepth;                 /* lidar reference position depth (meters) */
-        float           heading;                    /* heading (degrees) */
-        float           roll;                       /* roll (degrees) */
-        float           pitch;                      /* pitch (degrees) */
-        float           speed;                      /* speed (degrees) */
-
-        /* Laser Scan Data (1 to counts_per_scan pulses per scan) */
-        int             bathymetry_calculated;      /* boolean flag re calculation of bathymetry from ranges and angles */
-        int             num_pulses;                 /* number of pulses */
-        int             num_pulses_alloc;           /* array allocated for this number of pulses */
-        struct mbsys_3datdepthlidar_pulse_struct *pulses;
-        
-        /* comment */
-        unsigned short  comment_len;                    /* comment length in bytes */
-        char            comment[MB_COMMENT_MAXLINE];    /* comment string */
- 
-        /* position data */
-        double  pos_time_d;
-        double  pos_longitude;
-        double  pos_latitude;
-        
-        /* attitude data */
-        double  att_time_d;
-        double  att_roll;
-        double  att_pitch;
-        double  att_heave;
-        
-        /* heading data */
-        double  hdg_time_d;
-        double  hdg_heading;
-        
-        /* sensordepth data */
-        double  sdp_time_d;
-        double  sdp_sensordepth;
-	};
-
-
-/* System specific function prototypes */
-int mbsys_3datdepthlidar_alloc(int verbose, void *mbio_ptr, void **store_ptr, int *error);
-int mbsys_3datdepthlidar_deall(int verbose, void *mbio_ptr, void **store_ptr, int *error);
-int mbsys_3datdepthlidar_dimensions(int verbose,
-	void *mbio_ptr,
-	void *store_ptr,
-	int *kind,
-	int *nbath,
-	int *namp,
-	int *nss,
-	int *error);
-int mbsys_3datdepthlidar_pingnumber(int verbose, void *mbio_ptr, int *pingnumber, int *error);
-int mbsys_3datdepthlidar_preprocess(int verbose,
-        void *mbio_ptr,
-        void *store_ptr,
-	double time_d,
-        double navlon,
-        double navlat,
-	double speed,
-        double heading,
-        double sensordepth,
-	double roll,
-        double pitch,
-        double heave,
-	int *error);
-int mbsys_3datdepthlidar_extract(int verbose,
-	void *mbio_ptr,
-	void *store_ptr,
-	int *kind,
-	int time_i[7],
-	double *time_d,
-	double *navlon,
-	double *navlat,
-	double *speed,
-	double *heading,
-	int *nbath,
-	int *namp,
-	int *nss,
-	char *beamflag,
-	double *bath,
-	double *amp,
-	double *bathacrosstrack,
-	double *bathalongtrack,
-	double *ss,
-	double *ssacrosstrack,
-	double *ssalongtrack,
-	char *comment,
-	int *error);
-int mbsys_3datdepthlidar_insert(int verbose,
-	void *mbio_ptr,
-	void *store_ptr,
-	int kind,
-	int time_i[7],
-	double time_d,
-	double navlon,
-	double navlat,
-	double speed,
-	double heading,
-	int nbath,
-	int namp,
-	int nss,
-	char *beamflag,
-	double *bath,
-	double *amp,
-	double *bathacrosstrack,
-	double *bathalongtrack,
-	double *ss,
-	double *ssacrosstrack,
-	double *ssalongtrack,
-	char *comment,
-	int *error);
-int mbsys_3datdepthlidar_ttimes(int verbose,
-	void *mbio_ptr,
-	void *store_ptr,
-	int *kind,
-	int *nbeams,
-	double *ttimes,
-	double *angles,
-	double *angles_forward,
-	double *angles_null,
-	double *heave,
-	double *alongtrack_offset,
-	double *draft,
-	double *ssv,
-	int *error);
-int mbsys_3datdepthlidar_detects(int verbose,
-	void *mbio_ptr,
-	void *store_ptr,
-	int *kind,
-	int *nbeams,
-	int *detects,
-	int *error);
-int mbsys_3datdepthlidar_pulses(int verbose,
-	void *mbio_ptr,
-	void *store_ptr,
-	int *kind,
-	int *nbeams,
-	int *pulses,
-	int *error);
-int mbsys_3datdepthlidar_gains(int verbose,
-	void *mbio_ptr,
-	void *store_ptr,
-	int *kind,
-	double *transmit_gain,
-	double *pulse_length,
-	double *receive_gain,
-	int *error);
-int mbsys_3datdepthlidar_extract_altitude(int verbose,
-	void *mbio_ptr,
-	void *store_ptr,
-	int *kind,
-	double *transducer_depth,
-	double *altitude,
-	int *error);
-int mbsys_3datdepthlidar_extract_nnav(int verbose,
-	void *mbio_ptr,
-	void *store_ptr,
-	int nmax,
-	int *kind,
-	int *n,
-	int *time_i,
-	double *time_d,
-	double *navlon,
-	double *navlat,
-	double *speed,
-	double *heading,
-	double *draft,
-	double *roll,
-	double *pitch,
-	double *heave,
-	int *error);
-int mbsys_3datdepthlidar_extract_nav(int verbose,
-	void *mbio_ptr,
-	void *store_ptr,
-	int *kind,
-	int time_i[7],
-	double *time_d,
-	double *navlon,
-	double *navlat,
-	double *speed,
-	double *heading,
-	double *draft,
-	double *roll,
-	double *pitch,
-	double *heave,
-	int *error);
-int mbsys_3datdepthlidar_insert_nav(int verbose,
-	void *mbio_ptr,
-	void *store_ptr,
-	int time_i[7],
-	double time_d,
-	double navlon,
-	double navlat,
-	double speed,
-	double heading,
-	double draft,
-	double roll,
-	double pitch,
-	double heave,
-	int *error);
-int mbsys_3datdepthlidar_extract_svp(int verbose,
-	void *mbio_ptr,
-	void *store_ptr,
-	int *kind,
-	int *nsvp,
-	double *depth,
-	double *velocity,
-	int *error);
-int mbsys_3datdepthlidar_insert_svp(int verbose,
-	void *mbio_ptr,
-	void *store_ptr,
-	int nsvp,
-	double *depth,
-	double *velocity,
-	int *error);
-int mbsys_3datdepthlidar_copy(int verbose, void *mbio_ptr, void *store_ptr, void *copy_ptr, int *error);
-int mbsys_3datdepthlidar_print_store(int verbose, void *store_ptr, int *error);
-int mbsys_3datdepthlidar_calculatebathymetry(int verbose, void *mbio_ptr, void *store_ptr, int *error);
\ No newline at end of file
diff --git a/src/mbio/mbsys_atlas.c b/src/mbio/mbsys_atlas.c
deleted file mode 100644
index f72467e..0000000
--- a/src/mbio/mbsys_atlas.c
+++ /dev/null
@@ -1,1544 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbsys_atlas.c	3.00	6/25/01
- *	$Id: mbsys_atlas.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 2001-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbsys_atlas.c contains the MBIO functions for handling data from
- * STN Atlas Marine Electronics multibeam sonars.
- * The relevant sonars include Hydrosweep DS2 and Fansweep sonars.
- * The older  Hydrosweep DS and MD sonars produce data in different
- * formats (e.g. 21-24 and 101-102).
- * The data formats associated with (newer) STN Atlas sonars
- * include:
- *    MBSYS_ATLAS formats (code in mbsys_atlas.c and mbsys_atlas.h):
- *      MBF_HSDS2RAW : MBIO ID 182 - Vendor raw HSDS2 and Fansweep format
- *      MBF_HSDS2LAM : MBIO ID 183 - L-DEO HSDS2 and Fansweep processing format
- *
- * Author:	D. W. Caress
- * Author:	D. N. Chayes
- * Date:	June 25, 2001
- *
- * $Log: mbsys_atlas.c,v $
- * Revision 5.11  2005/11/05 00:48:05  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.10  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.9  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.8  2002/07/20 20:42:40  caress
- * Release 5.0.beta20
- *
- * Revision 5.7  2001/12/18 04:27:45  caress
- * Release 5.0.beta11.
- *
- * Revision 5.6  2001/08/25 00:54:13  caress
- * Adding beamwidth values to extract functions.
- *
- * Revision 5.5  2001/08/10  22:41:19  dcaress
- * Release 5.0.beta07
- *
- * Revision 5.4  2001-07-30 17:40:52-07  caress
- * Fixed typos.
- *
- * Revision 5.3  2001/07/26  03:40:56  caress
- * Fixed handling of sidescan.
- *
- * Revision 5.2  2001/07/20 00:32:54  caress
- * Release 5.0.beta03
- *
- * Revision 5.1  2001/06/30  17:40:14  caress
- * Release 5.0.beta02
- *
- * Revision 5.0  2001/06/29  22:49:07  caress
- * Added support for HSDS2RAW
- *
- *
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mb_define.h"
-#define MBSYS_ATLAS_C
-#include "mbsys_atlas.h"
-
-static char rcs_id[]="$Id: mbsys_atlas.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mbsys_atlas_alloc(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_atlas_alloc";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_atlas_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* allocate memory for data structure */
-	status = mb_malloc(verbose,sizeof(struct mbsys_atlas_struct),
-				store_ptr,error);
-
-	/* get data structure pointer */
-	store = (struct mbsys_atlas_struct *) *store_ptr;
-
-	/* initialize everything */
-	store->kind = MB_DATA_NONE;
-
-	/* start telegram */
-	store->start_ping_no = 0;		/* ping number */
-	store->start_transmit_time_d = 0.0;	/* ping timestamp */
-	for (i=0;i<32;i++)
-	    store->start_opmode[i] = 0;		/* 32 single byte mode indicators:			*/
-						/*	start_opmode[ 0] = OPMODE_SOUNDING = 0		*/
-						/*		OM_SOUNDING_OFF = 0			*/
-						/*		OM_SOUNDING_ON = 1			*/
-						/*	start_opmode[ 1] = OPMODE_SEARCH = 1		*/
-						/*		OM_SEARCH_OFF = 0			*/
-						/*		OM_SEARCH_ON = 1			*/
-						/*	start_opmode[ 2] = OPMODE_SIMULATION = 2	*/
-						/*		OM_SIMULATION_OFF = 0			*/
-						/*		OM_SIMULATION_ON = 1			*/
-						/*	start_opmode[ 3] = OPMODE_COVERAGE = 3		*/
-						/*		OM_COVERAGE_90_DEG = 0			*/
-						/*		OM_COVERAGE_120_DEG = 1			*/
-						/*	start_opmode[ 4] = OPMODE_SUBRANGE = 4		*/
-						/*		OM_SUBRANGE_0 = 0			*/
-						/*		OM_SUBRANGE_1 = 1			*/
-						/*		OM_SUBRANGE_2 = 2			*/
-						/*		OM_SUBRANGE_3 = 3			*/
-						/*	start_opmode[ 5] = OPMODE_DUMMY1 = 5		*/
-						/*	start_opmode[ 6] = OPMODE_RANGE = 6		*/
-						/*		OM_RANGE_SHALLOW_WATER = 0		*/
-						/*		OM_RANGE_MEDIUM_DEPTH = 1		*/
-						/*		OM_RANGE_DEEP_SEA = 2			*/
-						/*	start_opmode[ 7] = OPMODE_DUMMY2 = 7		*/
-						/*	start_opmode[ 8] = OPMODE_SWATH = 8		*/
-						/*		OM_SWATH_FULL = 0			*/
-						/*		OM_SWATH_HALF = 1			*/
-						/*	start_opmode[ 9] = OPMODE_SIDE = 9		*/
-						/*		OM_SIDE_PORT = 0			*/
-						/*		OM_SIDE_STAR = 1			*/
-						/*	start_opmode[10] = OPMODE_HOPPING = 10		*/
-						/*		OM_HOPPING_OFF = 0			*/
-						/*		OM_HOPPING_ON = 1			*/
-						/*	start_opmode[11] = OPMODE_SEQUENCE = 11		*/
-						/*		OM_SEQUENCE_NORMAL = 0			*/
-						/*		OM_SEQUENCE_REVERSE = 1			*/
-						/*	start_opmode[12] = OPMODE_CALIBR = 12		*/
-						/*		OM_CALIBRATION_OFF = 0			*/
-						/*		OM_CALIBRATION_ON = 1			*/
-						/*	start_opmode[13] = OPMODE_TEST = 13		*/
-						/*		OM_TEST_OFF = 0				*/
-						/*		OM_TEST_TRANSMITTER_FULL = 1		*/
-						/*		OM_TEST_TRANSMITTER_1_GROUP = 2		*/
-						/*		OM_TEST_RECEIVER = 3			*/
-						/*	start_opmode[14] = OPMODE_SONARTYPE = 14	*/
-						/*		OM_SONAR_FS20 = 0			*/
-						/*		OM_SONAR_FS10 = 1			*/
-						/*		OM_SONAR_Boma = 2			*/
-						/*		OM_SONAR_MD = 3				*/
-						/*		OM_SONAR_MD2 = 4			*/
-						/*		OM_SONAR_DS = 5				*/
-						/*		OM_SONAR_DS2 = 6			*/
-						/*		OM_SONAR_VLOT = 7			*/
-						/*		OM_SONAR_VLOT2 = 8			*/
-						/*	start_opmode[15] = OPMODE_EXTENSION = 15	*/
-						/*		OM_EXTENSION_NOT_USED = 0		*/
-						/*	start_opmode[16] = OPMODE_FREQUENCY = 16	*/
-						/*		OM_FREQUENCY_HIGH = 0			*/
-						/*		OM_FREQUENCY_LOW = 1			*/
-						/*	start_opmode[17] = OPMODE_TRANS_MODE = 17	*/
-						/*		OM_TRANSMISSION_MODE_0 = 0		*/
-						/*		OM_TRANSMISSION_MODE_1 = 1		*/
-						/*		OM_TRANSMISSION_MODE_2 = 2		*/
-						/*		OM_TRANSMISSION_MODE_3 = 3		*/
-						/*		OM_TRANSMISSION_MODE_4 = 4		*/
-						/*		OM_TRANSMISSION_MODE_5 = 5		*/
-						/*		OM_TRANSMISSION_MODE_6 = 6		*/
-						/*		OM_TRANSMISSION_MODE_7 = 7		*/
-						/*	start_opmode[18] = OPMODE_RESERVED_18 = 18	*/
-						/*	start_opmode[19] = OPMODE_RESERVED_19 = 19	*/
-						/*	start_opmode[20] = OPMODE_RESERVED_20 = 20	*/
-						/*	start_opmode[21] = OPMODE_RESERVED_21 = 21	*/
-						/*	start_opmode[22] = OPMODE_RESERVED_22 = 22	*/
-						/*	start_opmode[23] = OPMODE_RESERVED_23 = 23	*/
-						/*	start_opmode[24] = OPMODE_RESERVED_24 = 24	*/
-						/*	start_opmode[25] = OPMODE_RESERVED_25 = 25	*/
-						/*	start_opmode[26] = OPMODE_RESERVED_26 = 26	*/
-						/*	start_opmode[27] = OPMODE_RESERVED_27 = 27	*/
-						/*	start_opmode[28] = OPMODE_RESERVED_28 = 28	*/
-						/*	start_opmode[29] = OPMODE_RESERVED_29 = 29	*/
-						/*	start_opmode[30] = OPMODE_RESERVED_30 = 30	*/
-						/*	start_opmode[31] = OPMODE_RESERVED_31 = 31	*/
-
-	store->start_heave = 0.0;		/* heave at transmit (m) */
-	store->start_roll = 0.0;		/* roll at transmit (radians) */
-	store->start_pitch = 0.0;		/* pitch at transmit (radians) */
-	store->start_heading = 0.0;		/* heading at transmit (radians) */
-	store->start_ckeel = 0.0;		/* water sound speed at transducer (m/s) */
-	store->start_cmean = 0.0;		/* mean water sound speed (m/s) */
-	store->start_depth_min = 0.0;	/* minimum depth from GUI (m) */
-	store->start_depth_max = 0.0;	/* maximum depth from GUI (m) */
-
-	/* travel times telegrams */
-	store->tt_ping_no = 0;		/* ping number */
-	store->tt_transmit_time_d = 0.0;/* ping timestamp */
-	store->tt_beam_table_index = 0;	/* index to beam angle table	*/
-					/* tt_beam_table_index = 1 : ds2_ang_120[] */
-					/* tt_beam_table_index = 2 : ds2_ang_90[] */
-	store->tt_beam_cnt = 0;		/* number of beam values in this ping (max 1440) */
-	store->tt_long1 = 0;		/* reserve */
-	store->tt_long2 = 0;		/* reserve */
-	store->tt_long3 = 0;		/* reserve */
-	store->tt_xdraught = 0;		/* draft flag: */
-						/* tt_xdraught = 0 : inst-draft	*/
-						/* tt_xdraught = 1 : system-draft	*/
-	store->tt_double1 = 0.0;		/* DS2: backscatter TVG (dB?) */
-						/* FS10: period of time */
-	store->tt_double2 = 0.0;		/* FS10: data age */
-	store->tt_sensdraught = 0.0;		/* sens/inst draft */
-	store->tt_draught = 0.0;		/* system draft (m) */
-	for (i=0;i<MBSYS_ATLAS_MAXBEAMS;i++)
-	    {
-	    store->tt_lruntime[i] = 0.0;	/* array of beam traveltimes with   */
-						/* each entry related to the beam   */
-						/* angle in the actual angle table  */
-	    store->tt_lamplitude[i] = 0;	/* array of beam amplitudes:	    */
-	    store->tt_lstatus[i] = 0;		/* array of beam states:	    */
-						/*	DS2: NIS data		    */
-						/*	FS:			    */
-						/*	    bit 0 => beamside	    */
-						/*		0 = port	    */
-						/*		1 = starboard	    */
-						/*	    bit 1 => lobe	    */
-						/*		0 = cond. lobe	    */
-						/*		1 = wide lobe	    */
-						/*	    bit 2 => valid	    */
-						/*		0 = unvalid	    */
-						/*		1 = valid	    */
-						/*	    bits 3-7 unused	    */
-	    }
-
-	/* processed bathymetry */
-	store->pr_navlon = 0.0;			/* longitude (degrees) */
-	store->pr_navlat = 0.0;			/* latitude (degrees) */
-	store->pr_speed = 0.0;			/* speed made good (m/s) */
-	for (i=0;i<MBSYS_ATLAS_MAXBEAMS;i++)
-	    {
-	    store->pr_bath[i] = 0.0;			/* bathymetry (m) */
-	    store->pr_bathacrosstrack[i] = 0.0;		/* acrosstrack distance (m) */
-	    store->pr_bathalongtrack[i] = 0.0;		/* alongtrack distance (m) */
-	    store->pr_beamflag[i] = MB_FLAG_NULL;	/* beam edit/status flags */
-	    }
-
-	/* sidescan telegrams */
-	store->ss_ping_no = 0;		/* ping number */
-	store->ss_transmit_time_d = 0.0;	/* ping timestamp */
-	store->ss_timedelay = 0.0;		/* time from transmit to first sidescan value (s) */
-	store->ss_timespacing = 0.0;		/* time spacing between sidescan values (s) */
-	store->ss_max_side_bb_cnt = 0;	/* total number of values to port */
-	store->ss_max_side_sb_cnt = 0;	/* total number of values to starboard */
-	for (i=0;i<MBSYS_ATLAS_MAXPIXELS;i++)
-	    store->ss_sidescan[i] = 0;
-
-	/* tracking windows telegram */
-	store->tr_transmit_time_d = 0.0;	/* ping timestamp */
-	store->tr_ping_no = 0;		/* ping number */
-	store->tr_window_mode = 0;		/* window mode */
-	store->tr_no_of_win_groups = 0;	/* number of window groups  */
-						/* DS2 & MD => 8	    */
-						/* Fansweep => 20	    */
-	for (i=0;i<MBSYS_ATLAS_MAXWINDOWS;i++)
-	    {
-	    store->tr_repeat_count[i] = 0;	/* this window repeats n times  */
-						/* DS2 => 6,8,8,8,8,8,8,5	    */
-						/* MD => 5,5,5,5,5,5,5,5	    */
-	    store->tr_start[i] = 0.0;		/* start time (s) - two way	    */
-	    store->tr_stop[i] = 0.0;		/* stop time (s) - two way	    */
-	    }
-
-	/* backscatter telegram */
-	store->bs_transmit_time_d = 0.0;	/* ping timestamp */
-	store->bs_ping_no = 0;		/* ping number */
-	store->bs_nrActualGainSets = 0;	/* 10 to 20 gain sets */
-	store->bs_rxGup = 0.0;		/* DS2: -175.0 dB relative to 1 V/uPa */
-					/* MD: -185.0 dB relative to 1 V/uPa */
-	store->bs_rxGain = 0.0;		/* scale : dB */
-	store->bs_ar = 0.0;		/* scale : dB/m */
-	for (i=0;i<MBSYS_ATLAS_HSDS2_RX_PAR;i++)
-	    {
-	    store->bs_TvgRx_time[i] = 0.0;	/* two way time (s) */
-	    store->bs_TvgRx_gain[i] = 0.0;	/* receiver gain (dB) */
-	    }
-	store->bs_nrTxSets = 0;			/* number of transmit sets (1, 3, 5) */
-	for (i=0;i<MBSYS_ATLAS_HSDS2_TX_PAR;i++)
-	    {
-	    store->bs_txBeamIndex[i] = 0;	/* code of external beamshape table */
-	    store->bs_txLevel[i] = 0.0;		/* transmit level: dB relative to 1 uPa */
-	    store->bs_txBeamAngle[i] = 0.0;	/* transmit beam angle (radians) */
-	    store->bs_pulseLength[i] = 0.0;	/* transmit pulse length (s) */
-	    }
-	store->bs_nrBsSets = 0;			/* number of backscatter sets */
-	for (i=0;i<MBSYS_ATLAS_HSDS2_PFB_NUM;i++)
-	    {
-	    store->bs_m_tau[i] = 0.0;		/* echo duration (s) */
-	    store->bs_eff_ampli[i] = 0;		/* effective amplitude */
-	    store->bs_nis[i] = 0;		/* noise isotropic */
-	    }
-
-	/* comment */
-	for (i=0;i<MBSYS_ATLAS_COMMENT_LENGTH;i++)
-	    {
-	    store->comment[i] = '\0';
-	    }
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)*store_ptr);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_atlas_deall(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_atlas_deall";
-	int	status = MB_SUCCESS;
-	struct mbsys_atlas_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)*store_ptr);
-		}
-
-	/* get data structure pointer */
-	store = (struct mbsys_atlas_struct *) *store_ptr;
-
-	/* deallocate memory for data structure */
-	status = mb_free(verbose,store_ptr,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_atlas_dimensions(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int *nbath, int *namp, int *nss, int *error)
-{
-	char	*function_name = "mbsys_atlas_dimensions";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_atlas_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_atlas_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get beam and pixel numbers */
-		*nbath = store->tt_beam_cnt;
-		*namp = *nbath;
-		*nss = store->ss_max_side_bb_cnt
-			+ store->ss_max_side_sb_cnt;
-		}
-	else
-		{
-		/* get beam and pixel numbers */
-		*nbath = 0;
-		*namp = 0;
-		*nss = 0;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		fprintf(stderr,"dbg2       nbath:      %d\n",*nbath);
-		fprintf(stderr,"dbg2        namp:      %d\n",*namp);
-		fprintf(stderr,"dbg2        nss:       %d\n",*nss);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_atlas_extract(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int time_i[7], double *time_d,
-		double *navlon, double *navlat,
-		double *speed, double *heading,
-		int *nbath, int *namp, int *nss,
-		char *beamflag, double *bath, double *amp,
-		double *bathacrosstrack, double *bathalongtrack,
-		double *ss, double *ssacrosstrack, double *ssalongtrack,
-		char *comment, int *error)
-{
-	char	*function_name = "mbsys_atlas_extract";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_atlas_struct *store;
-	double	pixel_size;
-	double	range, tt, ttmin, ssdepth;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_atlas_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get time */
-		*time_d = store->start_transmit_time_d;
-		mb_get_date(verbose, *time_d, time_i);
-
-		/* get navigation */
-		*navlon = store->pr_navlon;
-		*navlat = store->pr_navlat;
-
-		/* get heading */
-		*heading = RTD * store->start_heading;
-
-		/* get speed  */
-		*speed = 3.6 * store->pr_speed;
-
-		/* set beamwidths in mb_io structure */
-		mb_io_ptr->beamwidth_ltrack = 2.3;
-		mb_io_ptr->beamwidth_xtrack = 2.3;
-
-		/* read distance and depth values into storage arrays */
-		*nbath = store->tt_beam_cnt;
-		for (i=0;i<MBSYS_ATLAS_MAXBEAMS;i++)
-			{
-			bath[i] = 0.0;
-			beamflag[i] = MB_FLAG_NULL;
-			amp[i] = 0.0;
-			bathacrosstrack[i] = 0.0;
-			bathalongtrack[i] = 0.0;
-			}
-		ttmin = 999999.9;
-		for (i=0;i<store->tt_beam_cnt;i++)
-			{
-			bath[i] = store->pr_bath[i];
-			beamflag[i] = store->pr_beamflag[i];
-			bathacrosstrack[i] = store->pr_bathacrosstrack[i];
-			bathalongtrack[i] = store->pr_bathalongtrack[i];
-			amp[i] = store->tt_lamplitude[i];
-			if (beamflag[i] != MB_FLAG_NULL
-				&& store->tt_lruntime[i] < ttmin)
-				ttmin = store->tt_lruntime[i];
-			}
-		*namp = *nbath;
-		*nss = store->ss_max_side_bb_cnt
-			+ store->ss_max_side_sb_cnt;
-		pixel_size = store->start_cmean * store->ss_timespacing;
-		ssdepth = store->start_cmean * ttmin / 2.0;
-		for (i=0;i<*nss;i++)
-			{
-			ss[i] = 0.0;
-			ssacrosstrack[i] = 0.0;
-			ssalongtrack[i] = 0.0;
-			}
-		for (i=0;i<store->ss_max_side_bb_cnt;i++)
-			{
-			j = store->ss_max_side_bb_cnt - i;
-			tt = store->ss_timedelay + store->ss_timespacing * (i - 1);
-			if (tt > ttmin)
-				{
-				ss[j] = store->ss_sidescan[i];
-				range = store->start_cmean * tt / 2.0;
-				ssacrosstrack[j] = -sqrt(range * range - ssdepth * ssdepth);
-				ssalongtrack[j] = 0.0;
-				}
-			}
-		for (i=store->ss_max_side_bb_cnt;i<*nss;i++)
-			{
-			tt = store->ss_timedelay + store->ss_timespacing * (i - store->ss_max_side_bb_cnt);
-			if (tt > ttmin)
-				{
-				ss[i] = store->ss_sidescan[i];
-				range = store->start_cmean * tt / 2.0;
-				ssacrosstrack[i] = sqrt(range * range - ssdepth * ssdepth);
-				ssalongtrack[i] = 0.0;
-				}
-			}
-
-		/* print debug statements */
-		if (verbose >= 5)
-			{
-			fprintf(stderr,"\ndbg4  Data extracted by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  Extracted values:\n");
-			fprintf(stderr,"dbg4       kind:       %d\n",
-				*kind);
-			fprintf(stderr,"dbg4       error:      %d\n",
-				*error);
-			fprintf(stderr,"dbg4       time_i[0]:  %d\n",
-				time_i[0]);
-			fprintf(stderr,"dbg4       time_i[1]:  %d\n",
-				time_i[1]);
-			fprintf(stderr,"dbg4       time_i[2]:  %d\n",
-				time_i[2]);
-			fprintf(stderr,"dbg4       time_i[3]:  %d\n",
-				time_i[3]);
-			fprintf(stderr,"dbg4       time_i[4]:  %d\n",
-				time_i[4]);
-			fprintf(stderr,"dbg4       time_i[5]:  %d\n",
-				time_i[5]);
-			fprintf(stderr,"dbg4       time_i[6]:  %d\n",
-				time_i[6]);
-			fprintf(stderr,"dbg4       time_d:     %f\n",
-				*time_d);
-			fprintf(stderr,"dbg4       longitude:  %f\n",
-				*navlon);
-			fprintf(stderr,"dbg4       latitude:   %f\n",
-				*navlat);
-			fprintf(stderr,"dbg4       speed:      %f\n",
-				*speed);
-			fprintf(stderr,"dbg4       heading:    %f\n",
-				*heading);
-			fprintf(stderr,"dbg4       nbath:      %d\n",
-				*nbath);
-			for (i=0;i<*nbath;i++)
-			  fprintf(stderr,"dbg4       beam:%d  flag:%3d  bath:%f  acrosstrack:%f  alongtrack:%f\n",
-				i,beamflag[i],bath[i],
-				bathacrosstrack[i],bathalongtrack[i]);
-			fprintf(stderr,"dbg4        namp:     %d\n",
-				*namp);
-			for (i=0;i<*namp;i++)
-			  fprintf(stderr,"dbg4        beam:%d   amp:%f  acrosstrack:%f  alongtrack:%f\n",
-				i,amp[i],bathacrosstrack[i],bathalongtrack[i]);
-			fprintf(stderr,"dbg4        nss:      %d\n",
-				*nss);
-			for (i=0;i<*nss;i++)
-			  fprintf(stderr,"dbg4        pixel:%d   ss:%f  acrosstrack:%f  alongtrack:%f\n",
-				i,ss[i],ssacrosstrack[i],ssalongtrack[i]);
-			}
-
-		/* done translating values */
-
-		}
-
-	/* extract comment from structure */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* copy comment */
-		strncpy(comment,store->comment,
-			MBSYS_ATLAS_COMMENT_LENGTH);
-
-		/* print debug statements */
-		if (verbose >= 4)
-			{
-			fprintf(stderr,"\ndbg4  New ping read by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  New ping values:\n");
-			fprintf(stderr,"dbg4       error:      %d\n",
-				*error);
-			fprintf(stderr,"dbg4       comment:    %s\n",
-				comment);
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind == MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"dbg2       comment:     \ndbg2       %s\n",
-			comment);
-		}
-	else if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind != MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"dbg2       time_i[0]:     %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:     %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:     %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:     %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:     %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:     %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:     %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:        %f\n",*time_d);
-		fprintf(stderr,"dbg2       longitude:     %f\n",*navlon);
-		fprintf(stderr,"dbg2       latitude:      %f\n",*navlat);
-		fprintf(stderr,"dbg2       speed:         %f\n",*speed);
-		fprintf(stderr,"dbg2       heading:       %f\n",*heading);
-		}
-	if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind == MB_DATA_DATA)
-		{
-		fprintf(stderr,"dbg2       nbath:      %d\n",
-			*nbath);
-		for (i=0;i<*nbath;i++)
-		  fprintf(stderr,"dbg2       beam:%d  flag:%3d  bath:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,beamflag[i],bath[i],
-			bathacrosstrack[i],bathalongtrack[i]);
-		fprintf(stderr,"dbg2        namp:     %d\n",
-			*namp);
-		for (i=0;i<*namp;i++)
-		  fprintf(stderr,"dbg2       beam:%d   amp:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,amp[i],bathacrosstrack[i],bathalongtrack[i]);
-		fprintf(stderr,"dbg2        nss:      %d\n",
-			*nss);
-		for (i=0;i<*nss;i++)
-		  fprintf(stderr,"dbg2        pixel:%d   ss:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,ss[i],ssacrosstrack[i],ssalongtrack[i]);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_atlas_insert(int verbose, void *mbio_ptr, void *store_ptr,
-		int kind, int time_i[7], double time_d,
-		double navlon, double navlat,
-		double speed, double heading,
-		int nbath, int namp, int nss,
-		char *beamflag, double *bath, double *amp,
-		double *bathacrosstrack, double *bathalongtrack,
-		double *ss, double *ssacrosstrack, double *ssalongtrack,
-		char *comment, int *error)
-{
-	char	*function_name = "mbsys_atlas_insert";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_atlas_struct *store;
-	double	xtrackmin;
-	int	centerpixel;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       kind:       %d\n",kind);
-		}
-	if (verbose >= 2 && kind == MB_DATA_DATA)
-		{
-		fprintf(stderr,"dbg2       time_i[0]:  %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:  %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:  %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:  %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:  %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:  %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:  %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:     %f\n",time_d);
-		fprintf(stderr,"dbg2       navlon:     %f\n",navlon);
-		fprintf(stderr,"dbg2       navlat:     %f\n",navlat);
-		fprintf(stderr,"dbg2       speed:      %f\n",speed);
-		fprintf(stderr,"dbg2       heading:    %f\n",heading);
-		fprintf(stderr,"dbg2       nbath:      %d\n",nbath);
-		if (verbose >= 3)
-		 for (i=0;i<nbath;i++)
-		  fprintf(stderr,"dbg3       beam:%d  flag:%3d  bath:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,beamflag[i],bath[i],
-			bathacrosstrack[i],bathalongtrack[i]);
-		fprintf(stderr,"dbg2       namp:       %d\n",namp);
-		if (verbose >= 3)
-		 for (i=0;i<namp;i++)
-		  fprintf(stderr,"dbg3        beam:%d   amp:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,amp[i],bathacrosstrack[i],bathalongtrack[i]);
-		fprintf(stderr,"dbg2        nss:       %d\n",nss);
-		if (verbose >= 3)
-		 for (i=0;i<nss;i++)
-		  fprintf(stderr,"dbg3        beam:%d   ss:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,ss[i],ssacrosstrack[i],ssalongtrack[i]);
-		}
-	if (verbose >= 2 && kind == MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"dbg2       comment:     \ndbg2       %s\n",
-			comment);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_atlas_struct *) store_ptr;
-
-	/* set data kind */
-	store->kind = kind;
-
-	/* insert data in structure */
-	if (store->kind == MB_DATA_DATA)
-		{
-		/* get time */
-		store->start_transmit_time_d = time_d;
-
-		/* get navigation */
-		store->pr_navlon = navlon;
-		store->pr_navlat = navlat;
-
-		/* get heading */
-		store->start_heading = DTR * heading;
-
-		/* get speed  */
-		store->pr_speed = speed / 3.6;
-
-		/* read distance and depth values into storage arrays */
-		store->tt_beam_cnt = nbath;
-		for (i=0;i<store->tt_beam_cnt;i++)
-			{
-			store->pr_bath[i] = bath[i];
-			store->pr_beamflag[i] = beamflag[i];
-			store->pr_bathacrosstrack[i] = bathacrosstrack[i];
-			store->pr_bathalongtrack[i] = bathalongtrack[i];
-			store->tt_lamplitude[i] = amp[i];
-			}
-		if (store->ss_max_side_bb_cnt + store->ss_max_side_sb_cnt != nss)
-			{
-			xtrackmin = 99999.9;
-			centerpixel = 0;
-			for (i=0;i<nss;i++)
-				{
-				if (ss[i] > 0.0 && fabs(ssacrosstrack[i]) < xtrackmin)
-					{
-					xtrackmin = fabs(ssacrosstrack[i]);
-					centerpixel = i;
-					}
-				}
-			if (centerpixel > 0)
-				{
-				store->ss_max_side_bb_cnt = centerpixel;
-				store->ss_max_side_sb_cnt = nss - centerpixel;
-				}
-			else
-				{
-				store->ss_max_side_bb_cnt = nss / 2;
-				store->ss_max_side_sb_cnt = nss / 2;
-				}
-			}
-		for (i=0;i<store->ss_max_side_bb_cnt;i++)
-			{
-			store->ss_sidescan[i] = ss[store->ss_max_side_bb_cnt - i];
-			}
-		for (i=store->ss_max_side_bb_cnt;i<nss;i++)
-			{
-			store->ss_sidescan[i] = ss[i];
-			}
-		}
-
-	/* insert comment in structure */
-	else if (store->kind == MB_DATA_COMMENT)
-		{
-		strncpy(store->comment,comment,
-			MBSYS_ATLAS_COMMENT_LENGTH);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_atlas_ttimes(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, int *nbeams,
-	double *ttimes, double *angles,
-	double *angles_forward, double *angles_null,
-	double *heave, double *alongtrack_offset,
-	double *draft, double *ssv, int *error)
-{
-	char	*function_name = "mbsys_atlas_ttimes";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_atlas_struct *store;
-	double	*angle_table;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       ttimes:     %p\n",(void *)ttimes);
-		fprintf(stderr,"dbg2       angles_xtrk:%p\n",(void *)angles);
-		fprintf(stderr,"dbg2       angles_ltrk:%p\n",(void *)angles_forward);
-		fprintf(stderr,"dbg2       angles_null:%p\n",(void *)angles_null);
-		fprintf(stderr,"dbg2       heave:      %p\n",(void *)heave);
-		fprintf(stderr,"dbg2       ltrk_off:   %p\n",(void *)alongtrack_offset);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_atlas_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get angle_table for 90 degree coverage */
-		if (store->start_opmode[3] == 0)
-		    {
-		    if (store->tt_beam_cnt == 140)
-			angle_table = (double *) ds2_ang_90d_140b;
-		    else if (store->tt_beam_cnt == 59)
-			angle_table = (double *) ds2_ang_90d_59b;
-		    }
-
-		/* get angle_table for 120 degree coverage */
-		else if (store->start_opmode[3] == 1)
-		    {
-		    if (store->tt_beam_cnt == 140)
-			angle_table = (double *) ds2_ang_120d_140b;
-		    else if (store->tt_beam_cnt == 59)
-			angle_table = (double *) ds2_ang_120d_59b;
-		    }
-
-		/* get travel times */
-		*nbeams = store->tt_beam_cnt;
-		for (i=0;i<*nbeams;i++)
-			{
-			ttimes[i] = 0.0;
-			angles[i] = 0.0;
-			angles_forward[i] = 0.0;
-			angles_null[i] = 0.0;
-			heave[i] = 0.0;
-			alongtrack_offset[i] = 0.0;
-			}
-		for (i=0;i<store->tt_beam_cnt;i++)
-			{
-			ttimes[i] = store->tt_lruntime[i];
-			angles[i] = RTD * fabs(angle_table[i]);
-			if (angle_table[i] < 0.0)
-			    angles_forward[i] = 180.0;
-			else
-			    angles_forward[i] = 0.0;
-			angles_null[i] = 0.0;
-			heave[i] = store->start_heave;
-			alongtrack_offset[i] = 0.0;
-			}
-
-		/* set status */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error == MB_ERROR_NO_ERROR)
-		{
-		fprintf(stderr,"dbg2       draft:      %f\n",*draft);
-		fprintf(stderr,"dbg2       ssv:        %f\n",*ssv);
-		fprintf(stderr,"dbg2       nbeams:     %d\n",*nbeams);
-		for (i=0;i<*nbeams;i++)
-			fprintf(stderr,"dbg2       beam %d: tt:%f  angle_xtrk:%f  angle_ltrk:%f  angle_null:%f  depth_off:%f  ltrk_off:%f\n",
-				i,ttimes[i],angles[i],
-				angles_forward[i],angles_null[i],
-				heave[i],alongtrack_offset[i]);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_atlas_detects(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, int *nbeams,
-	int *detects, int *error)
-{
-	char	*function_name = "mbsys_atlas_detects";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_atlas_struct *store;
-	int	detect;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       detects:    %p\n",(void *)detects);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_atlas_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get sonar type */
-		if (store->start_opmode[14] <= 1)
-			detect = MB_DETECT_PHASE;
-		else
-			detect = MB_DETECT_AMPLITUDE;
-
-		/* get detects */
-		*nbeams = store->tt_beam_cnt;
-		for (i=0;i<store->tt_beam_cnt;i++)
-			{
-			detects[i] = detect;
-			}
-
-		/* set status */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error == MB_ERROR_NO_ERROR)
-		{
-		fprintf(stderr,"dbg2       nbeams:     %d\n",*nbeams);
-		for (i=0;i<*nbeams;i++)
-			fprintf(stderr,"dbg2       beam %d: detects:%d\n",
-				i,detects[i]);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_atlas_extract_altitude(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, double *transducer_depth, double *altitude,
-	int *error)
-{
-	char	*function_name = "mbsys_atlas_extract_altitude";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_atlas_struct *store;
-	double	bath_best;
-	double	xtrack_min;
-	int	found;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_atlas_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get transducer depth and altitude */
-		*transducer_depth = store->tt_draught + store->start_heave;
-		found = MB_NO;
-		bath_best = 0.0;
-		xtrack_min = 99999999.9;
-		for (i=0;i<store->tt_beam_cnt;i++)
-		    {
-		    if (mb_beam_ok(store->pr_beamflag[i])
-			&& fabs(store->pr_bathacrosstrack[i]) < xtrack_min)
-			{
-			xtrack_min = fabs(store->pr_bathacrosstrack[i]);
-			bath_best = store->pr_bath[i];
-			found = MB_YES;
-			}
-		    }
-		if (found == MB_NO)
-		    {
-		    xtrack_min = 99999999.9;
-		    for (i=0;i<store->tt_beam_cnt;i++)
-			{
-			if (store->pr_beamflag[i]!= MB_FLAG_NULL
-			    && fabs(store->pr_bathacrosstrack[i]) < xtrack_min)
-			    {
-			    xtrack_min = fabs(store->pr_bathacrosstrack[i]);
-			    bath_best = store->pr_bath[i];
-			    found = MB_YES;
-			    }
-			}
-		    }
-		if (found == MB_YES)
-		    *altitude = bath_best - *transducer_depth;
-		else
-		    *altitude = 0.0;
-
-		/* set status */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:              %d\n",*kind);
-		fprintf(stderr,"dbg2       transducer_depth:  %f\n",*transducer_depth);
-		fprintf(stderr,"dbg2       altitude:          %f\n",*altitude);
-		fprintf(stderr,"dbg2       error:             %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:            %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_atlas_extract_nav(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int time_i[7], double *time_d,
-		double *navlon, double *navlat,
-		double *speed, double *heading, double *draft,
-		double *roll, double *pitch, double *heave,
-		int *error)
-{
-	char	*function_name = "mbsys_atlas_extract_nav";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_atlas_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_atlas_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from ping structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get time */
-		*time_d = store->start_transmit_time_d;
-		mb_get_date(verbose, *time_d, time_i);
-
-		/* get navigation */
-		*navlon = store->pr_navlon;
-		*navlat = store->pr_navlat;
-
-		/* get heading */
-		*heading = RTD * store->start_heading;
-
-		/* get speed  */
-		*speed = 3.6 * store->pr_speed;
-
-		/* get draft  */
-		*draft = store->tt_draught;
-
-		/* get roll pitch and heave */
-		*roll = RTD * store->start_roll;
-		*pitch = RTD * store->start_pitch;
-		*heave = store->start_heave;
-
-		/* print debug statements */
-		if (verbose >= 5)
-			{
-			fprintf(stderr,"\ndbg4  Data extracted by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  Extracted values:\n");
-			fprintf(stderr,"dbg4       kind:       %d\n",
-				*kind);
-			fprintf(stderr,"dbg4       error:      %d\n",
-				*error);
-			fprintf(stderr,"dbg4       time_i[0]:  %d\n",
-				time_i[0]);
-			fprintf(stderr,"dbg4       time_i[1]:  %d\n",
-				time_i[1]);
-			fprintf(stderr,"dbg4       time_i[2]:  %d\n",
-				time_i[2]);
-			fprintf(stderr,"dbg4       time_i[3]:  %d\n",
-				time_i[3]);
-			fprintf(stderr,"dbg4       time_i[4]:  %d\n",
-				time_i[4]);
-			fprintf(stderr,"dbg4       time_i[5]:  %d\n",
-				time_i[5]);
-			fprintf(stderr,"dbg4       time_i[6]:  %d\n",
-				time_i[6]);
-			fprintf(stderr,"dbg4       time_d:     %f\n",
-				*time_d);
-			fprintf(stderr,"dbg4       longitude:  %f\n",
-				*navlon);
-			fprintf(stderr,"dbg4       latitude:   %f\n",
-				*navlat);
-			fprintf(stderr,"dbg4       speed:      %f\n",
-				*speed);
-			fprintf(stderr,"dbg4       heading:    %f\n",
-				*heading);
-			fprintf(stderr,"dbg4       draft:      %f\n",
-				*draft);
-			fprintf(stderr,"dbg4       roll:       %f\n",
-				*roll);
-			fprintf(stderr,"dbg4       pitch:      %f\n",
-				*pitch);
-			fprintf(stderr,"dbg4       heave:      %f\n",
-				*heave);
-			}
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind == MB_DATA_DATA)
-		{
-		fprintf(stderr,"dbg2       time_i[0]:     %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:     %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:     %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:     %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:     %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:     %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:     %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:        %f\n",*time_d);
-		fprintf(stderr,"dbg2       longitude:     %f\n",*navlon);
-		fprintf(stderr,"dbg2       latitude:      %f\n",*navlat);
-		fprintf(stderr,"dbg2       speed:         %f\n",*speed);
-		fprintf(stderr,"dbg2       heading:       %f\n",*heading);
-		fprintf(stderr,"dbg2       draft:         %f\n",*draft);
-		fprintf(stderr,"dbg2       roll:          %f\n",*roll);
-		fprintf(stderr,"dbg2       pitch:         %f\n",*pitch);
-		fprintf(stderr,"dbg2       heave:         %f\n",*heave);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_atlas_insert_nav(int verbose, void *mbio_ptr, void *store_ptr,
-		int time_i[7], double time_d,
-		double navlon, double navlat,
-		double speed, double heading, double draft,
-		double roll, double pitch, double heave,
-		int *error)
-{
-	char	*function_name = "mbsys_atlas_insert_nav";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_atlas_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       time_i[0]:  %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:  %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:  %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:  %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:  %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:  %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:  %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:     %f\n",time_d);
-		fprintf(stderr,"dbg2       navlon:     %f\n",navlon);
-		fprintf(stderr,"dbg2       navlat:     %f\n",navlat);
-		fprintf(stderr,"dbg2       speed:      %f\n",speed);
-		fprintf(stderr,"dbg2       heading:    %f\n",heading);
-		fprintf(stderr,"dbg2       draft:      %f\n",draft);
-		fprintf(stderr,"dbg2       roll:       %f\n",roll);
-		fprintf(stderr,"dbg2       pitch:      %f\n",pitch);
-		fprintf(stderr,"dbg2       heave:      %f\n",heave);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_atlas_struct *) store_ptr;
-
-	/* insert data in structure */
-	if (store->kind == MB_DATA_DATA)
-		{
-		/* get time */
-		store->start_transmit_time_d = time_d;
-
-		/* get navigation */
-		store->pr_navlon = navlon;
-		store->pr_navlat = navlat;
-
-		/* get heading */
-		store->start_heading = DTR * heading;
-
-		/* get speed  */
-		store->pr_speed = speed / 3.6;
-
-		/* get draft  */
-		store->tt_draught = draft;
-
-		/* get roll pitch and heave */
-		store->start_roll = DTR * roll;
-		store->start_pitch = DTR * pitch;
-		store->start_heave = heave;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_atlas_copy(int verbose, void *mbio_ptr,
-			void *store_ptr, void *copy_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_atlas_copy";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_atlas_struct *store;
-	struct mbsys_atlas_struct *copy;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       copy_ptr:   %p\n",(void *)copy_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointers */
-	store = (struct mbsys_atlas_struct *) store_ptr;
-	copy = (struct mbsys_atlas_struct *) copy_ptr;
-
-	/* copy the main structure */
-	*copy = *store;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_atlas_ttcorr(int verbose, void *mbio_ptr,
-			void *store_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_atlas_ttcorr";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_atlas_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointers */
-	store = (struct mbsys_atlas_struct *) store_ptr;
-
-	/* check for correct kind of data - hsd2 */
-	if (store->start_opmode[14] == 6
-		&& store->kind == MB_DATA_DATA
-		&& store->tt_beam_cnt == 140)
-		{
-		if (store->start_opmode[6] == 1)
-			{
-			for (i=0;i<store->tt_beam_cnt;i++)
-				{
-				store->tt_lruntime[i] += 0.001 * DS2_TimeCorrMedium1[i];
-				}
-			}
-		else if (store->start_opmode[6] == 2)
-			{
-			for (i=0;i<store->tt_beam_cnt;i++)
-				{
-				store->tt_lruntime[i] -= DS2_TimeCorrDeep3[i];
-				}
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mbsys_atlas.h b/src/mbio/mbsys_atlas.h
deleted file mode 100644
index 0cd4e0b..0000000
--- a/src/mbio/mbsys_atlas.h
+++ /dev/null
@@ -1,1406 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbsys_atlas.h	6/22/01
- *	$Id: mbsys_atlas.h 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 2001-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbsys_atlas.h defines the MBIO data structures for handling data from
- * STN Atlas Marine Electronics multibeam sonars.
- * The relevant sonars include Hydrosweep DS2 and Fansweep sonars.
- * The older  Hydrosweep DS and MD sonars produce data in different
- * formats (e.g. 21-24 and 101-102).
- * The data formats associated with (newer) STN Atlas sonars
- * include:
- *    MBSYS_ATLAS formats (code in mbsys_atlas.c and mbsys_atlas.h):
- *      MBF_HSDS2RAW : MBIO ID 182 - Vendor raw HSDS2 and Fansweep format
- *      MBF_HSDS2LAM : MBIO ID 183 - L-DEO HSDS2 and Fansweep processing format
- *
- *
- * Author:	D. W. Caress
- * Author:	D. N. Chayes
- * Date:	June 22, 2001
- *
- * $Log: mbsys_atlas.h,v $
- * Revision 5.7  2005/11/05 00:48:03  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.6  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.5  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.4  2002/07/20 20:42:40  caress
- * Release 5.0.beta20
- *
- * Revision 5.3  2001/12/18 04:27:45  caress
- * Release 5.0.beta11.
- *
- * Revision 5.2  2001/08/10 22:41:19  dcaress
- * Release 5.0.beta07
- *
- * Revision 5.1  2001-07-19 17:32:54-07  caress
- * Release 5.0.beta03
- *
- * Revision 5.0  2001/06/29  22:49:07  caress
- * Added support for HSDS2RAW
- *
- *
- */
-/*
- * Notes on the MBSYS_ATLAS data structure:
- *
- * 1) STN Atlas Marine Electronics (aka SAM) sonars write raw data in real-time
- *    as binary XDR encoded data. Files are stored on disk by the HYDROMAP
- *    Online workstation. The workstation on the Ewing is an HP Vectra
- *    running SuSe Linux (2.2 kernel.)
- *
- * 2) Files are 10 minutes long.
- *
- * 3) Multiple (parallel files are created). For example:
- *
- *  64k 00010529004010.adt
- *  28k 00010529004010.ang      Angle data
- *  28k 00010529004010.cdt      Sound speed profile(s)
- * 8.0k 00010529004010.evt      Event data, comments, etc.
- * 344k 00010529004010.fsw      Sounding (travel time, sidescan, backscatter...
- * 148k 00010529004010.lev      Level (tide gage) data
- * 664k 00010529004010.lot	center beam (telegram 26) and lots of zeros
- *  60k 00010529004010.mot      Motion sensor (attitude)
- * 388k 00010529004010.nav      Navigation sensors
- *
- * lot file:    26 (center beam) and lots of zeros
- *
- * For starters (June, 2001) we are assuming fixed beam spacing w/ a 90 or
- * 120 degree swath so all of the swath mapping data we need is in the  ".fsw"
- * data file.
- *
- * 4) Data record type ids:
- *    MB-System critical records are:
- *
- *      Sounding data     10   T0, nav, attitude,
- *      Depths            11   travel time+amp/beam
- *      Sidescan          12   Multiple packets of sidescan data
- *      Tracking windows  19
- *      Amplitude         28   TX and RX data necessary for calculating true amp
- *
- *    Other potentially interesting things:
- *      "Center beam"     26
- *
- * 5) Time values are in Unix seconds (seconds since 1/1/1970 00:00:00
- */
-
-/* include mb_define.h */
-#ifndef MB_DEFINE_DEF
-#include "mb_define.h"
-#endif
-
-/* sonar models */
-#define	MBSYS_ATLAS_UNKNOWN	0
-#define	MBSYS_ATLAS_HSDS2	1
-#define	MBSYS_ATLAS_FANSWEEP15	2
-#define	MBSYS_ATLAS_FANSWEEP20	3
-
-/* maximum number of beams and pixels */
-#define	MBSYS_ATLAS_MAXBEAMS		1440
-#define	MBSYS_ATLAS_MAXPIXELS		4096
-#define	MBSYS_ATLAS_MAXBEAMTELEGRAM	200
-#define	MBSYS_ATLAS_MAXPIXELTELEGRAM	1024
-#define	MBSYS_ATLAS_MAXWINDOWS		100
-#define	MBSYS_ATLAS_HSDS2_PFB_NUM	59
-#define	MBSYS_ATLAS_HSDS2_RX_PAR		20
-#define	MBSYS_ATLAS_HSDS2_TX_PAR		10
-#define	MBSYS_ATLAS_COMMENT_LENGTH	256
-#define	MBSYS_ATLAS_HSDS2_MAXBEAMS	140
-
-/* datagram type id's */
-#define	MBSYS_ATLAS_TELEGRAM_NONE		0
-#define	MBSYS_ATLAS_TELEGRAM_START		10
-#define	MBSYS_ATLAS_TELEGRAM_TRAVELTIMES		11
-#define	MBSYS_ATLAS_TELEGRAM_SIDESCAN		12
-#define	MBSYS_ATLAS_TELEGRAM_TRACKINGWINDOWS	19
-#define	MBSYS_ATLAS_TELEGRAM_CENTERBEAM		26
-#define	MBSYS_ATLAS_TELEGRAM_BACKSCATTER		28
-#define	MBSYS_ATLAS_TELEGRAM_SYSTEM		40
-#define	MBSYS_ATLAS_TELEGRAM_HSDS2LAM		1179799367
-#define	MBSYS_ATLAS_TELEGRAM_COMMENTLAM		1129270605
-
-/* internal data structure for survey data */
-struct mbsys_atlas_struct
-	{
-	int		kind;
-
-	/* navigation telegram */
-	double		sys_pos_lat;		/* latitude (radians) */
-	double		sys_pos_lon;		/* longitude (radians) */
-	char		sys_pos_sensor[8];	/* position sensor name */
-	double		sys_pos_time_d;		/* position fix time (s) */
-
-	/* start telegram */
-	unsigned int	start_ping_no;		/* ping number */
-	double		start_transmit_time_d;	/* ping timestamp */
-	mb_u_char	start_opmode[32];	/* 32 single byte mode indicators:			*/
-						/*	start_opmode[ 0] = OPMODE_SOUNDING = 0		*/
-						/*		OM_SOUNDING_OFF = 0			*/
-						/*		OM_SOUNDING_ON = 1			*/
-						/*	start_opmode[ 1] = OPMODE_SEARCH = 1		*/
-						/*		OM_SEARCH_OFF = 0			*/
-						/*		OM_SEARCH_ON = 1			*/
-						/*	start_opmode[ 2] = OPMODE_SIMULATION = 2	*/
-						/*		OM_SIMULATION_OFF = 0			*/
-						/*		OM_SIMULATION_ON = 1			*/
-						/*	start_opmode[ 3] = OPMODE_COVERAGE = 3		*/
-						/*		OM_COVERAGE_90_DEG = 0			*/
-						/*		OM_COVERAGE_120_DEG = 1			*/
-						/*	start_opmode[ 4] = OPMODE_SUBRANGE = 4		*/
-						/*		OM_SUBRANGE_0 = 0			*/
-						/*		OM_SUBRANGE_1 = 1			*/
-						/*		OM_SUBRANGE_2 = 2			*/
-						/*		OM_SUBRANGE_3 = 3			*/
-						/*	start_opmode[ 5] = OPMODE_DUMMY1 = 5		*/
-						/*	start_opmode[ 6] = OPMODE_RANGE = 6		*/
-						/*		OM_RANGE_SHALLOW_WATER = 0		*/
-						/*		OM_RANGE_MEDIUM_DEPTH = 1		*/
-						/*		OM_RANGE_DEEP_SEA = 2			*/
-						/*	start_opmode[ 7] = OPMODE_DUMMY2 = 7		*/
-						/*	start_opmode[ 8] = OPMODE_SWATH = 8		*/
-						/*		OM_SWATH_FULL = 0			*/
-						/*		OM_SWATH_HALF = 1			*/
-						/*	start_opmode[ 9] = OPMODE_SIDE = 9		*/
-						/*		OM_SIDE_PORT = 0			*/
-						/*		OM_SIDE_STAR = 1			*/
-						/*	start_opmode[10] = OPMODE_HOPPING = 10		*/
-						/*		OM_HOPPING_OFF = 0			*/
-						/*		OM_HOPPING_ON = 1			*/
-						/*	start_opmode[11] = OPMODE_SEQUENCE = 11		*/
-						/*		OM_SEQUENCE_NORMAL = 0			*/
-						/*		OM_SEQUENCE_REVERSE = 1			*/
-						/*	start_opmode[12] = OPMODE_CALIBR = 12		*/
-						/*		OM_CALIBRATION_OFF = 0			*/
-						/*		OM_CALIBRATION_ON = 1			*/
-						/*	start_opmode[13] = OPMODE_TEST = 13		*/
-						/*		OM_TEST_OFF = 0				*/
-						/*		OM_TEST_TRANSMITTER_FULL = 1		*/
-						/*		OM_TEST_TRANSMITTER_1_GROUP = 2		*/
-						/*		OM_TEST_RECEIVER = 3			*/
-						/*	start_opmode[14] = OPMODE_SONARTYPE = 14	*/
-						/*		OM_SONAR_FS20 = 0			*/
-						/*		OM_SONAR_FS10 = 1			*/
-						/*		OM_SONAR_Boma = 2			*/
-						/*		OM_SONAR_MD = 3				*/
-						/*		OM_SONAR_MD2 = 4			*/
-						/*		OM_SONAR_DS = 5				*/
-						/*		OM_SONAR_DS2 = 6			*/
-						/*		OM_SONAR_VLOT = 7			*/
-						/*		OM_SONAR_VLOT2 = 8			*/
-						/*	start_opmode[15] = OPMODE_EXTENSION = 15	*/
-						/*		OM_EXTENSION_NOT_USED = 0		*/
-						/*	start_opmode[16] = OPMODE_FREQUENCY = 16	*/
-						/*		OM_FREQUENCY_HIGH = 0			*/
-						/*		OM_FREQUENCY_LOW = 1			*/
-						/*	start_opmode[17] = OPMODE_TRANS_MODE = 17	*/
-						/*		OM_TRANSMISSION_MODE_0 = 0		*/
-						/*		OM_TRANSMISSION_MODE_1 = 1		*/
-						/*		OM_TRANSMISSION_MODE_2 = 2		*/
-						/*		OM_TRANSMISSION_MODE_3 = 3		*/
-						/*		OM_TRANSMISSION_MODE_4 = 4		*/
-						/*		OM_TRANSMISSION_MODE_5 = 5		*/
-						/*		OM_TRANSMISSION_MODE_6 = 6		*/
-						/*		OM_TRANSMISSION_MODE_7 = 7		*/
-						/*	start_opmode[18] = OPMODE_RESERVED_18 = 18	*/
-						/*	start_opmode[19] = OPMODE_RESERVED_19 = 19	*/
-						/*	start_opmode[20] = OPMODE_RESERVED_20 = 20	*/
-						/*	start_opmode[21] = OPMODE_RESERVED_21 = 21	*/
-						/*	start_opmode[22] = OPMODE_RESERVED_22 = 22	*/
-						/*	start_opmode[23] = OPMODE_RESERVED_23 = 23	*/
-						/*	start_opmode[24] = OPMODE_RESERVED_24 = 24	*/
-						/*	start_opmode[25] = OPMODE_RESERVED_25 = 25	*/
-						/*	start_opmode[26] = OPMODE_RESERVED_26 = 26	*/
-						/*	start_opmode[27] = OPMODE_RESERVED_27 = 27	*/
-						/*	start_opmode[28] = OPMODE_RESERVED_28 = 28	*/
-						/*	start_opmode[29] = OPMODE_RESERVED_29 = 29	*/
-						/*	start_opmode[30] = OPMODE_RESERVED_30 = 30	*/
-						/*	start_opmode[31] = OPMODE_RESERVED_31 = 31	*/
-
-	double		start_heave;		/* heave at transmit (m) */
-	double		start_roll;		/* roll at transmit (radians) */
-	double		start_pitch;		/* pitch at transmit (radians) */
-	double		start_heading;		/* heading at transmit (radians) */
-	double		start_ckeel;		/* water sound speed at transducer (m/s) */
-	double		start_cmean;		/* mean water sound speed (m/s) */
-	double		start_depth_min;	/* minimum depth from GUI (m) */
-	double		start_depth_max;	/* maximum depth from GUI (m) */
-
-	/* travel times telegrams */
-	unsigned int	tt_ping_no;		/* ping number */
-	double		tt_transmit_time_d;	/* ping timestamp */
-	int		tt_beam_table_index;	/* index to beam angle table	*/
-						/*	tt_beam_table_index = 1 : ds2_ang_120[] */
-						/*	tt_beam_table_index = 2 : ds2_ang_90[] */
-	int		tt_beam_cnt;		/* number of beam values in this ping (max 1440) */
-	int		tt_long1;		/* reserve */
-	int		tt_long2;		/* reserve */
-	int		tt_long3;		/* reserve */
-	int		tt_xdraught;		/* draft flag: */
-						/*	tt_xdraught = 0 : inst-draft	*/
-						/*	tt_xdraught = 1 : system-draft	*/
-	double		tt_double1;		/* DS2: backscatter TVG (dB?) */
-						/* FS10: period of time */
-	double		tt_double2;		/* FS10: data age */
-	double		tt_sensdraught;		/* sens/inst draft */
-	double		tt_draught;		/* system draft (m) */
-	float		tt_lruntime[MBSYS_ATLAS_MAXBEAMS];	/* array of beam traveltimes with   */
-								/* each entry related to the beam   */
-								/* angle in the actual angle table  */
-	mb_u_char	tt_lamplitude[MBSYS_ATLAS_MAXBEAMS];	/* array of beam amplitudes:	    */
-	mb_u_char	tt_lstatus[MBSYS_ATLAS_MAXBEAMS];	/* array of beam states:	    */
-								/*	DS2: NIS data		    */
-								/*	FS:			    */
-								/*	    bit 0 => beamside	    */
-								/*		0 = port	    */
-								/*		1 = starboard	    */
-								/*	    bit 1 => lobe	    */
-								/*		0 = cond. lobe	    */
-								/*		1 = wide lobe	    */
-								/*	    bit 2 => valid	    */
-								/*		0 = unvalid	    */
-								/*		1 = valid	    */
-								/*	    bits 3-7 unused	    */
-
-	/* processed bathymetry */
-	double		pr_navlon;					/* longitude (degrees) */
-	double		pr_navlat;					/* latitude (degrees) */
-	double		pr_speed;					/* speed made good (m/s) */
-	double		pr_bath[MBSYS_ATLAS_MAXBEAMS];			/* bathymetry (m) */
-	double		pr_bathacrosstrack[MBSYS_ATLAS_MAXBEAMS];	/* acrosstrack distance (m) */
-	double		pr_bathalongtrack[MBSYS_ATLAS_MAXBEAMS];		/* alongtrack distance (m) */
-	char		pr_beamflag[MBSYS_ATLAS_MAXBEAMS];		/* beam edit/status flags */
-
-	/* sidescan telegrams */
-	unsigned int	ss_ping_no;		/* ping number */
-	double		ss_transmit_time_d;	/* ping timestamp */
-	double		ss_timedelay;		/* time from transmit to first sidescan value (s) */
-	double		ss_timespacing;		/* time spacing between sidescan values (s) */
-	int		ss_max_side_bb_cnt;	/* total number of values to port */
-	int		ss_max_side_sb_cnt;	/* total number of values to starboard */
-	mb_u_char		ss_sidescan[MBSYS_ATLAS_MAXPIXELS];
-
-	/* tracking windows telegram */
-	double		tr_transmit_time_d;	/* ping timestamp */
-	unsigned int	tr_ping_no;		/* ping number */
-	int		tr_window_mode;		/* window mode */
-	int		tr_no_of_win_groups;	/* number of window groups  */
-						/* DS2 & MD => 8	    */
-						/* Fansweep => 20	    */
-	int		tr_repeat_count[MBSYS_ATLAS_MAXWINDOWS];	    /* this window repeats n times  */
-								    /* DS2 => 6,8,8,8,8,8,8,5	    */
-								    /* MD => 5,5,5,5,5,5,5,5	    */
-	float		tr_start[MBSYS_ATLAS_MAXWINDOWS];	    /* start time (s) - two way	    */
-	float		tr_stop[MBSYS_ATLAS_MAXWINDOWS];		    /* stop time (s) - two way	    */
-
-	/* backscatter telegram */
-	double		bs_transmit_time_d;	/* ping timestamp */
-	int		bs_ping_no;		/* ping number */
-	unsigned short	bs_nrActualGainSets;	/* 10 to 20 gain sets */
-	float		bs_rxGup;		/* DS2: -175.0 dB relative to 1 V/uPa */
-						/* MD: -185.0 dB relative to 1 V/uPa */
-	float		bs_rxGain;		/* scale : dB */
-	float		bs_ar;			/* scale : dB/m */
-	float		bs_TvgRx_time[MBSYS_ATLAS_HSDS2_RX_PAR];	    /* two way time (s) */
-	float		bs_TvgRx_gain[MBSYS_ATLAS_HSDS2_RX_PAR];	    /* receiver gain (dB) */
-	unsigned short	bs_nrTxSets;				    /* number of transmit sets (1, 3, 5) */
-	unsigned int	bs_txBeamIndex[MBSYS_ATLAS_HSDS2_TX_PAR];    /* code of external beamshape table */
-	float		bs_txLevel[MBSYS_ATLAS_HSDS2_TX_PAR];	    /* transmit level: dB relative to 1 uPa */
-	float		bs_txBeamAngle[MBSYS_ATLAS_HSDS2_TX_PAR];    /* transmit beam angle (radians) */
-	float		bs_pulseLength[MBSYS_ATLAS_HSDS2_TX_PAR];    /* transmit pulse length (s) */
-	unsigned short	bs_nrBsSets;				    /* number of backscatter sets */
-	float		bs_m_tau[MBSYS_ATLAS_HSDS2_PFB_NUM];	    /* echo duration (s) */
-	char		bs_eff_ampli[MBSYS_ATLAS_HSDS2_PFB_NUM];	    /* effective amplitude */
-	char		bs_nis[MBSYS_ATLAS_HSDS2_PFB_NUM];	    /* noise isotropic */
-
-	/* comment */
-	char		comment[MBSYS_ATLAS_COMMENT_LENGTH];
-	};
-
-
-/*
- * These two arrays represent the angle from the vertical for each of the
- * two modes of operation of the HS-DS2 on the Ewing in June, 2001.
- *
- * The values were extracted from a sample "raw" angle data file.
- *
- */
-#ifndef MBSYS_ATLAS_C
-extern double ds2_ang_120d_59b[];
-extern double ds2_ang_90d_59b[];
-extern double ds2_ang_120d_140b[];
-extern double ds2_ang_90d_140b[];
-#else
-double ds2_ang_120d_59b[] =
-	{
-	-1.040042,
-	-1.004178,
-	-0.968315,
-	-0.932451,
-	-0.896588,
-	-0.860724,
-	-0.824861,
-	-0.788997,
-	-0.753134,
-	-0.717270,
-	-0.681407,
-	-0.645543,
-	-0.609680,
-	-0.573816,
-	-0.537953,
-	-0.502089,
-	-0.466226,
-	-0.430362,
-	-0.394499,
-	-0.358635,
-	-0.322772,
-	-0.286908,
-	-0.251045,
-	-0.215181,
-	-0.179318,
-	-0.143454,
-	-0.107591,
-	-0.071727,
-	-0.035864,
-	0.000000,
-	0.035864,
-	0.071727,
-	0.107591,
-	0.143454,
-	0.179318,
-	0.215181,
-	0.251045,
-	0.286908,
-	0.322772,
-	0.358635,
-	0.394499,
-	0.430362,
-	0.466226,
-	0.502089,
-	0.537953,
-	0.573816,
-	0.609680,
-	0.645543,
-	0.681407,
-	0.717270,
-	0.753134,
-	0.788997,
-	0.824861,
-	0.860724,
-	0.896588,
-	0.932451,
-	0.968315,
-	1.004178,
-	1.040042
-	};
-
-double ds2_ang_90d_59b[] =
-	{
-	-0.779988,
-	-0.753092,
-	-0.726195,
-	-0.699299,
-	-0.672403,
-	-0.645507,
-	-0.618611,
-	-0.591715,
-	-0.564819,
-	-0.537923,
-	-0.511026,
-	-0.484130,
-	-0.457234,
-	-0.430338,
-	-0.403442,
-	-0.376546,
-	-0.349650,
-	-0.322754,
-	-0.295857,
-	-0.268961,
-	-0.242065,
-	-0.215169,
-	-0.188273,
-	-0.161377,
-	-0.134481,
-	-0.107584,
-	-0.080688,
-	-0.053792,
-	-0.026896,
-	0.000000,
-	0.026896,
-	0.053792,
-	0.080688,
-	0.107584,
-	0.134481,
-	0.161377,
-	0.188273,
-	0.215169,
-	0.242065,
-	0.268961,
-	0.295857,
-	0.322754,
-	0.349650,
-	0.376546,
-	0.403442,
-	0.430338,
-	0.457234,
-	0.484130,
-	0.511026,
-	0.537923,
-	0.564819,
-	0.591715,
-	0.618611,
-	0.645507,
-	0.672403,
-	0.699299,
-	0.726195,
-	0.753092,
-	0.779988
-	};
-
-double ds2_ang_120d_140b[] =
-	{
-	-1.040042,
-	-1.025077,
-	-1.010112,
-	-0.995148,
-	-0.980183,
-	-0.965219,
-	-0.950254,
-	-0.935289,
-	-0.920325,
-	-0.905360,
-	-0.890395,
-	-0.875431,
-	-0.860466,
-	-0.845502,
-	-0.830537,
-	-0.815572,
-	-0.800608,
-	-0.785643,
-	-0.770678,
-	-0.755714,
-	-0.740749,
-	-0.725784,
-	-0.710820,
-	-0.695855,
-	-0.680891,
-	-0.665926,
-	-0.650961,
-	-0.635997,
-	-0.621032,
-	-0.606067,
-	-0.591103,
-	-0.576138,
-	-0.561174,
-	-0.546209,
-	-0.531244,
-	-0.516280,
-	-0.501315,
-	-0.486350,
-	-0.471386,
-	-0.456421,
-	-0.441457,
-	-0.426492,
-	-0.411527,
-	-0.396563,
-	-0.381598,
-	-0.366633,
-	-0.351669,
-	-0.336704,
-	-0.321740,
-	-0.306775,
-	-0.291810,
-	-0.276846,
-	-0.261881,
-	-0.246916,
-	-0.231952,
-	-0.216987,
-	-0.202022,
-	-0.187058,
-	-0.172093,
-	-0.157129,
-	-0.142164,
-	-0.127199,
-	-0.112235,
-	-0.097270,
-	-0.082305,
-	-0.067341,
-	-0.052376,
-	-0.037412,
-	-0.022447,
-	-0.007482,
-	0.007482,
-	0.022447,
-	0.037412,
-	0.052376,
-	0.067341,
-	0.082305,
-	0.097270,
-	0.112235,
-	0.127199,
-	0.142164,
-	0.157129,
-	0.172093,
-	0.187058,
-	0.202022,
-	0.216987,
-	0.231952,
-	0.246916,
-	0.261881,
-	0.276846,
-	0.291810,
-	0.306775,
-	0.321740,
-	0.336704,
-	0.351669,
-	0.366633,
-	0.381598,
-	0.396563,
-	0.411527,
-	0.426492,
-	0.441457,
-	0.456421,
-	0.471386,
-	0.486350,
-	0.501315,
-	0.516280,
-	0.531244,
-	0.546209,
-	0.561174,
-	0.576138,
-	0.591103,
-	0.606067,
-	0.621032,
-	0.635997,
-	0.650961,
-	0.665926,
-	0.680891,
-	0.695855,
-	0.710820,
-	0.725784,
-	0.740749,
-	0.755714,
-	0.770678,
-	0.785643,
-	0.800608,
-	0.815572,
-	0.830537,
-	0.845502,
-	0.860466,
-	0.875431,
-	0.890395,
-	0.905360,
-	0.920325,
-	0.935289,
-	0.950254,
-	0.965219,
-	0.980183,
-	0.995148,
-	1.010112,
-	1.025077,
-	1.040042
-	};
-
-double ds2_ang_90d_140b[] =
-	{
-	-0.77998,
-	-0.76876,
-	-0.75754,
-	-0.74631,
-	-0.73509,
-	-0.72387,
-	-0.71265,
-	-0.70142,
-	-0.69020,
-	-0.67898,
-	-0.66775,
-	-0.65653,
-	-0.64531,
-	-0.63409,
-	-0.62286,
-	-0.61164,
-	-0.60042,
-	-0.58919,
-	-0.57797,
-	-0.56675,
-	-0.55553,
-	-0.54430,
-	-0.53308,
-	-0.52186,
-	-0.51063,
-	-0.49941,
-	-0.48819,
-	-0.47697,
-	-0.46574,
-	-0.45452,
-	-0.44330,
-	-0.43207,
-	-0.42085,
-	-0.40963,
-	-0.39841,
-	-0.38718,
-	-0.37596,
-	-0.36474,
-	-0.35352,
-	-0.34229,
-	-0.33107,
-	-0.31985,
-	-0.30862,
-	-0.29740,
-	-0.28618,
-	-0.27496,
-	-0.26373,
-	-0.25251,
-	-0.24129,
-	-0.23006,
-	-0.21884,
-	-0.20762,
-	-0.19640,
-	-0.18517,
-	-0.17395,
-	-0.16273,
-	-0.15150,
-	-0.14028,
-	-0.12906,
-	-0.11784,
-	-0.10661,
-	-0.09539,
-	-0.08417,
-	-0.07294,
-	-0.06172,
-	-0.05050,
-	-0.03928,
-	-0.02805,
-	-0.01683,
-	-0.00561,
-	0.005611,
-	0.016834,
-	0.028057,
-	0.039280,
-	0.050503,
-	0.061726,
-	0.072948,
-	0.084171,
-	0.095394,
-	0.106617,
-	0.117840,
-	0.129063,
-	0.140286,
-	0.151508,
-	0.162731,
-	0.173954,
-	0.185177,
-	0.196400,
-	0.207623,
-	0.218845,
-	0.230068,
-	0.241291,
-	0.252514,
-	0.263737,
-	0.274960,
-	0.286183,
-	0.297405,
-	0.308628,
-	0.319851,
-	0.331074,
-	0.342297,
-	0.353520,
-	0.364742,
-	0.375965,
-	0.387188,
-	0.398411,
-	0.409634,
-	0.420857,
-	0.432079,
-	0.443302,
-	0.454525,
-	0.465748,
-	0.476971,
-	0.488194,
-	0.499417,
-	0.510639,
-	0.521862,
-	0.533085,
-	0.544308,
-	0.555531,
-	0.566754,
-	0.577976,
-	0.589199,
-	0.600422,
-	0.611645,
-	0.622868,
-	0.634091,
-	0.645314,
-	0.656536,
-	0.667759,
-	0.678982,
-	0.690205,
-	0.701428,
-	0.712651,
-	0.723873,
-	0.735096,
-	0.746319,
-	0.757542,
-	0.768765,
-	0.779988
-	};
-
-/*-----------------------------------------------------------------------------*/
-/* Hydrosweep DS2 Transmit Instant Correction Tables
- *
- * Mode: Medium Depth 1 ( 100 -  450 m), additive corr. values for runtimes [msec]
- *       Opmode[6] = 1
- */
-double DS2_TimeCorrMedium1[] = {
-		-24.000,
-		-24.000,
-		-24.000,
-		-24.000,
-		-24.000,
-		-24.000,
-		-24.000,
-		-24.000,
-		-24.000,
-		-24.000,
-		-24.000,
-		-24.000,
-		-24.000,
-		-24.000,
-		-24.000,
-		-24.000,
-		-24.000,
-		-24.000,
-		-24.000,
-		-24.000,
-		-24.000,
-		-23.973,
-		-23.907,
-		-23.760,
-		-23.520,
-		-23.200,
-		-22.840,
-		-22.453,
-		-22.067,
-		-21.680,
-		-21.320,
-		-21.000,
-		-20.760,
-		-20.600,
-		-20.533,
-		-20.507,
-		-20.507,
-		-20.507,
-		-20.507,
-		-20.507,
-		-20.507,
-		-20.507,
-		-20.507,
-		-20.507,
-		-20.507,
-		-20.507,
-		-20.507,
-		-20.507,
-		-20.493,
-		-20.453,
-		-20.373,
-		-20.253,
-		-20.080,
-		-19.880,
-		-19.680,
-		-19.467,
-		-19.253,
-		-19.053,
-		-18.840,
-		-18.627,
-		-18.440,
-		-18.267,
-		-18.133,
-		-18.053,
-		-18.013,
-		-18.000,
-		-18.000,
-		-18.000,
-		-18.000,
-		-18.000,
-		-18.000,
-		-18.000,
-		-18.000,
-		-18.000,
-		-17.920,
-		-17.693,
-		-17.240,
-		-16.493,
-		-15.507,
-		-14.387,
-		-13.173,
-		-11.973,
-		-10.760,
-		-9.547,
-		-8.347,
-		-7.133,
-		-6.013,
-		-5.027,
-		-4.267,
-		-3.813,
-		-3.587,
-		-3.507,
-		-3.507,
-		-3.507,
-		-3.507,
-		-3.507,
-		-3.507,
-		-3.507,
-		-3.507,
-		-3.507,
-		-3.507,
-		-3.507,
-		-3.507,
-		-3.507,
-		-3.480,
-		-3.413,
-		-3.267,
-		-3.027,
-		-2.707,
-		-2.347,
-		-1.960,
-		-1.560,
-		-1.173,
-		-0.813,
-		-0.493,
-		-0.253,
-		-0.093,
-		-0.027,
-		0.000,
-		0.000,
-		0.000,
-		0.000,
-		0.000,
-		0.000,
-		0.000,
-		0.000,
-		0.000,
-		0.000,
-		0.000,
-		0.000,
-		0.000,
-		0.000,
-		0.000,
-		0.000,
-		0.000,
-		0.000,
-		0.000,
-		0.000,
-		0.000,
-		0.000};
-
-/*
- *
- * Mode: Medium Depth 2 ( 400 - 1000 m), additive corr. values for runtimes [msec]
- *       Opmode[6] = 1
- */
-double DS2_TimeCorrMedium2[] = {
-		-34.000,
-		-34.000,
-		-34.000,
-		-34.000,
-		-34.000,
-		-34.000,
-		-34.000,
-		-34.000,
-		-34.000,
-		-34.000,
-		-34.000,
-		-34.000,
-		-34.000,
-		-34.000,
-		-34.000,
-		-34.000,
-		-34.000,
-		-34.000,
-		-34.000,
-		-34.000,
-		-34.000,
-		-33.960,
-		-33.867,
-		-33.653,
-		-33.307,
-		-32.853,
-		-32.333,
-		-31.787,
-		-31.227,
-		-30.667,
-		-30.147,
-		-29.693,
-		-29.347,
-		-29.147,
-		-29.040,
-		-29.000,
-		-29.000,
-		-29.000,
-		-29.000,
-		-29.000,
-		-29.000,
-		-29.000,
-		-29.000,
-		-29.000,
-		-29.000,
-		-29.000,
-		-29.000,
-		-29.000,
-		-28.987,
-		-28.933,
-		-28.827,
-		-28.640,
-		-28.400,
-		-28.133,
-		-27.840,
-		-27.547,
-		-27.253,
-		-26.973,
-		-26.680,
-		-26.387,
-		-26.107,
-		-25.880,
-		-25.693,
-		-25.587,
-		-25.520,
-		-25.507,
-		-25.507,
-		-25.507,
-		-25.507,
-		-25.507,
-		-25.507,
-		-25.507,
-		-25.507,
-		-25.507,
-		-25.400,
-		-25.093,
-		-24.453,
-		-23.373,
-		-21.987,
-		-20.400,
-		-18.680,
-		-16.973,
-		-15.267,
-		-13.560,
-		-11.840,
-		-10.133,
-		-8.533,
-		-7.147,
-		-6.080,
-		-5.440,
-		-5.107,
-		-5.000,
-		-5.000,
-		-5.000,
-		-5.000,
-		-5.000,
-		-5.000,
-		-5.000,
-		-5.000,
-		-5.000,
-		-5.000,
-		-5.000,
-		-5.000,
-		-5.000,
-		-4.960,
-		-4.867,
-		-4.653,
-		-4.307,
-		-3.853,
-		-3.333,
-		-2.787,
-		-2.227,
-		-1.667,
-		-1.147,
-		-0.693,
-		-0.347,
-		-0.147,
-		-0.040,
-		0.000,
-		0.000,
-		0.000,
-		0.000,
-		0.000,
-		0.000,
-		0.000,
-		0.000,
-		0.000,
-		0.000,
-		0.000,
-		0.000,
-		0.000,
-		0.000,
-		0.000,
-		0.000,
-		0.000,
-		0.000,
-		0.000,
-		0.000,
-		0.000,
-		0.000};
-
-/*
- *
- * Mode: Deep Sea 3 ( 800 - 3700 m), additive corr. values for runtimes [msec]
- *       Opmode[6] = 2
- */
-double DS2_TimeCorrDeep3[] = {
-		-64.000,
-		-64.000,
-		-64.000,
-		-64.000,
-		-64.000,
-		-64.000,
-		-64.000,
-		-63.960,
-		-63.840,
-		-63.587,
-		-63.173,
-		-62.627,
-		-62.000,
-		-61.333,
-		-60.667,
-		-60.000,
-		-59.333,
-		-58.667,
-		-58.000,
-		-57.333,
-		-56.667,
-		-56.000,
-		-55.373,
-		-54.840,
-		-54.413,
-		-54.173,
-		-54.040,
-		-54.000,
-		-54.000,
-		-54.000,
-		-54.000,
-		-54.000,
-		-54.000,
-		-54.000,
-		-54.000,
-		-54.000,
-		-54.000,
-		-54.000,
-		-54.000,
-		-54.000,
-		-54.000,
-		-54.000,
-		-53.973,
-		-53.920,
-		-53.787,
-		-53.587,
-		-53.307,
-		-53.000,
-		-52.667,
-		-52.333,
-		-52.000,
-		-51.667,
-		-51.333,
-		-51.000,
-		-50.667,
-		-50.333,
-		-50.000,
-		-49.667,
-		-49.333,
-		-49.000,
-		-48.693,
-		-48.413,
-		-48.213,
-		-48.080,
-		-48.027,
-		-48.000,
-		-48.000,
-		-48.000,
-		-48.000,
-		-48.000,
-		-48.000,
-		-48.000,
-		-48.000,
-		-48.000,
-		-47.853,
-		-47.387,
-		-46.467,
-		-44.947,
-		-42.960,
-		-40.653,
-		-38.213,
-		-35.760,
-		-33.307,
-		-30.867,
-		-28.413,
-		-25.960,
-		-23.520,
-		-21.067,
-		-18.613,
-		-16.307,
-		-14.253,
-		-12.600,
-		-11.493,
-		-10.787,
-		-10.400,
-		-10.200,
-		-10.080,
-		-10.027,
-		-10.000,
-		-10.000,
-		-10.000,
-		-10.000,
-		-10.000,
-		-10.000,
-		-10.000,
-		-10.000,
-		-10.000,
-		-10.000,
-		-10.000,
-		-10.000,
-		-10.000,
-		-9.960,
-		-9.840,
-		-9.613,
-		-9.227,
-		-8.720,
-		-8.133,
-		-7.507,
-		-6.880,
-		-6.253,
-		-5.627,
-		-5.000,
-		-4.387,
-		-3.760,
-		-3.133,
-		-2.507,
-		-1.880,
-		-1.293,
-		-0.787,
-		-0.387,
-		-0.160,
-		-0.040,
-		0.000,
-		0.000,
-		0.000,
-		0.000,
-		0.000,
-		0.000,
-		0.000,
-		0.000};
-
-/*
- *
- * Mode: Deep Sea 4 (3300 - max. m), additive corr. values for runtimes [msec]
- *       Opmode[6] = 2
- */
-double DS2_TimeCorrDeep4[] = {
-		-88.000,
-		-88.000,
-		-88.000,
-		-88.000,
-		-88.000,
-		-88.000,
-		-88.000,
-		-87.947,
-		-87.787,
-		-87.453,
-		-86.920,
-		-86.213,
-		-85.400,
-		-84.533,
-		-83.667,
-		-82.800,
-		-81.933,
-		-81.067,
-		-80.200,
-		-79.333,
-		-78.467,
-		-77.600,
-		-76.787,
-		-76.080,
-		-75.547,
-		-75.213,
-		-75.053,
-		-75.000,
-		-75.000,
-		-75.000,
-		-75.000,
-		-75.000,
-		-75.000,
-		-75.000,
-		-75.000,
-		-75.000,
-		-75.000,
-		-75.000,
-		-75.000,
-		-75.000,
-		-75.000,
-		-75.000,
-		-74.973,
-		-74.880,
-		-74.693,
-		-74.373,
-		-73.973,
-		-73.507,
-		-73.000,
-		-72.507,
-		-72.000,
-		-71.507,
-		-71.000,
-		-70.507,
-		-70.000,
-		-69.507,
-		-69.000,
-		-68.507,
-		-68.000,
-		-67.507,
-		-67.040,
-		-66.627,
-		-66.320,
-		-66.120,
-		-66.027,
-		-66.000,
-		-66.000,
-		-66.000,
-		-66.000,
-		-66.000,
-		-66.000,
-		-66.000,
-		-66.000,
-		-66.000,
-		-65.827,
-		-65.307,
-		-64.267,
-		-62.520,
-		-60.253,
-		-57.640,
-		-54.853,
-		-52.067,
-		-49.267,
-		-46.493,
-		-43.693,
-		-40.907,
-		-38.120,
-		-35.333,
-		-32.533,
-		-29.760,
-		-26.960,
-		-24.173,
-		-21.387,
-		-18.773,
-		-16.493,
-		-14.747,
-		-13.707,
-		-13.173,
-		-13.000,
-		-13.000,
-		-13.000,
-		-13.000,
-		-13.000,
-		-13.000,
-		-13.000,
-		-13.000,
-		-13.000,
-		-13.000,
-		-13.000,
-		-13.000,
-		-13.000,
-		-12.947,
-		-12.800,
-		-12.493,
-		-11.987,
-		-11.333,
-		-10.573,
-		-9.760,
-		-8.947,
-		-8.133,
-		-7.320,
-		-6.507,
-		-5.693,
-		-4.880,
-		-4.067,
-		-3.253,
-		-2.440,
-		-1.680,
-		-1.013,
-		-0.507,
-		-0.200,
-		-0.053,
-		0.000,
-		0.000,
-		0.000,
-		0.000,
-		0.000,
-		0.000,
-		0.000,
-		0.000};
-
-#endif
-
-/* system specific function prototypes */
-int mbsys_atlas_alloc(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error);
-int mbsys_atlas_deall(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error);
-int mbsys_atlas_dimensions(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int *nbath, int *namp, int *nss, int *error);
-int mbsys_atlas_extract(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int time_i[7], double *time_d,
-			double *navlon, double *navlat,
-			double *speed, double *heading,
-			int *nbath, int *namp, int *nss,
-			char *beamflag, double *bath, double *amp,
-			double *bathacrosstrack, double *bathalongtrack,
-			double *ss, double *ssacrosstrack, double *ssalongtrack,
-			char *comment, int *error);
-int mbsys_atlas_insert(int verbose, void *mbio_ptr, void *store_ptr,
-			int kind, int time_i[7], double time_d,
-			double navlon, double navlat,
-			double speed, double heading,
-			int nbath, int namp, int nss,
-			char *beamflag, double *bath, double *amp,
-			double *bathacrosstrack, double *bathalongtrack,
-			double *ss, double *ssacrosstrack, double *ssalongtrack,
-			char *comment, int *error);
-int mbsys_atlas_ttimes(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int *nbeams,
-			double *ttimes, double *angles,
-			double *angles_forward, double *angles_null,
-			double *heave, double *alongtrack_offset,
-			double *draft, double *ssv, int *error);
-int mbsys_atlas_detects(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int *nbeams, int *detects, int *error);
-int mbsys_atlas_extract_altitude(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, double *transducer_depth, double *altitude,
-			int *error);
-int mbsys_atlas_extract_nav(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int time_i[7], double *time_d,
-			double *navlon, double *navlat,
-			double *speed, double *heading, double *draft,
-			double *roll, double *pitch, double *heave,
-			int *error);
-int mbsys_atlas_insert_nav(int verbose, void *mbio_ptr, void *store_ptr,
-			int time_i[7], double time_d,
-			double navlon, double navlat,
-			double speed, double heading, double draft,
-			double roll, double pitch, double heave,
-			int *error);
-int mbsys_atlas_copy(int verbose, void *mbio_ptr,
-			void *store_ptr, void *copy_ptr,
-			int *error);
-int mbsys_atlas_ttcorr(int verbose, void *mbio_ptr,
-			void *store_ptr,
-			int *error);
diff --git a/src/mbio/mbsys_benthos.c b/src/mbio/mbsys_benthos.c
deleted file mode 100644
index 341e741..0000000
--- a/src/mbio/mbsys_benthos.c
+++ /dev/null
@@ -1,1398 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbsys_benthos.c	3.00	3/29/2011
- *	$Id: mbsys_benthos.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 2012-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbsys_benthos.c includes the functions used to insert data into and extract
- * data out of the structures used to store data from Benthos sidescan sonars.
- * The formats associated with this i/o module are:
- *      MBF_XTFB1624 : MBIO ID 211
- *
- * Author:	Jens Renken (MARUM/University of Bremen)
- * Date:	March 29, 2011
- *
- * Author:	D. W. Caress
- * Date:	2 May 2012 (when the code was brought into the MB-System archive as a read-only i/o module)
- *
- * $Log: $
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mb_define.h"
-#include "mbsys_benthos.h"
-
-static char rcs_id[]="$Id: mbsys_benthos.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mbsys_benthos_alloc(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_benthos_alloc";
-	int	status = MB_SUCCESS;
-
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_benthos_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* allocate memory for data structure */
-	status = mb_malloc(verbose,sizeof(struct mbsys_benthos_struct),
-				store_ptr,error);
-
-	/* get data structure pointer */
-	store = (struct mbsys_benthos_struct *) *store_ptr;
-
-	/* initialize everything */
-
-	/* type of data record */
-	store->kind = MB_DATA_NONE;			/* Data kind */
-
-	/* type of sonar */
-	store->sonar = MBSYS_BENTHOS_UNKNOWN;			/* Type of Reson sonar */
-
-	/* parameter info */
-	store->MBOffsetX = 0.0;
-	store->MBOffsetY = 0.0;
-	store->MBOffsetZ = 0.0;
-	store->NavLatency = 0.0;		/* GPS_time_received - GPS_time_sent (sec) */
-	store->NavOffsetY = 0.0;		/* Nav offset (m) */
-	store->NavOffsetX = 0.0;		/* Nav offset (m) */
-	store->NavOffsetZ = 0.0; 		/* Nav z offset (m) */
-	store->NavOffsetYaw = 0.0;		/* Heading offset (m) */
-	store->MRUOffsetY = 0.0;		/* Multibeam MRU y offset (m) */
-	store->MRUOffsetX = 0.0;		/* Multibeam MRU x offset (m) */
-	store->MRUOffsetZ = 0.0; 		/* Multibeam MRU z offset (m) */
-	store->MRUOffsetPitch = 0.0; 		/* Multibeam MRU pitch offset (degrees) */
-	store->MRUOffsetRoll = 0.0;		/* Multibeam MRU roll offset (degrees) */
-
-	/* nav data */
-	store->nav_time_d = 0.0;
-	store->nav_longitude = 0.0;
-	store->nav_latitude = 0.0;
-	store->nav_heading = 0.0;
-
-	/* attitude data */
-	store->att_timetag = 0.0;
-	store->att_heading = 0.0;
-	store->att_heave = 0.0;
-	store->att_roll = 0.0;
-	store->att_pitch = 0.0;
-
-	/* comment */
-	store->comment[0] = '\0';
-
-	/* sound velocity profile */
-
-	/* survey data */
-	store->png_time_d = 0.0;
-	store->png_latency = 0.0;
-	store->png_latitude = 0.0;
-	store->png_longitude = 0.0;
-	store->png_roll = 0.0;
-	store->png_pitch = 0.0;
-	store->png_heading = 0.0;
-	store->png_heave = 0.0;
-
-	store->Seconds = 0;	/* seconds since 00:00:00, 1 January 1970 */
-	store->Millisecs = 0;	/* milliseconds, LSB = 1 ms */
-	store->ping_number = 0;		/* sequential ping number from sonar startup/reset */
-
-	store->ssrawtimedelay = 0.0;			/* raw sidescan delay (sec) */
-	store->ssrawtimeduration = 0.0;			/* raw sidescan duration (sec) */
-	store->ssrawbottompick = 0.0;			/* bottom pick time (sec) */
-	store->ssrawportsamples = 0;			/* number of port raw sidescan samples */
-	store->ssrawstbdsamples = 0;			/* number of stbd raw sidescan samples */
-	for (i=0;i<MBSYS_BENTHOS_MAXRAWPIXELS;i++)
-		{
-		store->ssrawport[i] = 0;		/* raw port sidescan */
-		store->ssrawstbd[i] = 0;		/* raw starboard sidescan */
-		}
-
-	store->beams_bath = 0;
-	store->pixels_ss = 0;
-	store->pixel_size = 0.0;
-	for (i=0;i<MBSYS_BENTHOS_MAXBEAMS;i++)
-		{
-		store->beamflag[i] = MB_FLAG_NULL; 	/* beamflags */
-		store->bath[i] = 0.0;			/* bathymetry (m) */
-		}
-	for (i=0;i<MBSYS_BENTHOS_MAXPIXELS;i++)
-		{
-		store->ss[i] = 0.0;			/* sidescan */
-		store->ss_alongtrack[i] = 0.0;		/* alongtrack distance (m) */
-		store->ss_acrosstrack[i] = 0.0;		/* alongtrack distance (m) */
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)*store_ptr);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_benthos_deall(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_benthos_deall";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)*store_ptr);
-		}
-
-	/* deallocate memory for data structure */
-	status = mb_free(verbose,store_ptr,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_benthos_dimensions(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int *nbath, int *namp, int *nss, int *error)
-{
-	char	*function_name = "mbsys_benthos_dimensions";
-	int	status = MB_SUCCESS;
-
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_benthos_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_benthos_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get beam and pixel numbers */
-		*nbath = store->beams_bath;
-		*namp = 0;
-		*nss = store->pixels_ss;;
-		}
-	else
-		{
-		/* get beam and pixel numbers */
-		*nbath = 0;
-		*namp = 0;
-		*nss = 0;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		fprintf(stderr,"dbg2       nbath:      %d\n",*nbath);
-		fprintf(stderr,"dbg2        namp:      %d\n",*namp);
-		fprintf(stderr,"dbg2        nss:       %d\n",*nss);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_benthos_extract(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int time_i[7], double *time_d,
-		double *navlon, double *navlat,
-		double *speed, double *heading,
-		int *nbath, int *namp, int *nss,
-		char *beamflag, double *bath, double *amp,
-		double *bathacrosstrack, double *bathalongtrack,
-		double *ss, double *ssacrosstrack, double *ssalongtrack,
-		char *comment, int *error)
-{
-	char	*function_name = "mbsys_benthos_extract";
-	int	status = MB_SUCCESS;
-
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_benthos_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_benthos_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get time */
-		*time_d = store->png_time_d;
-		mb_get_date(verbose, *time_d, time_i);
-
-		/* get navigation */
-		*navlon = store->png_longitude;
-		*navlat = store->png_latitude;
-
-		/* get heading */
-		*heading = store->png_heading;
-
-		/* get speed  */
-		*speed = store->png_speed;
-
-		/* set beamwidths in mb_io structure */
-		mb_io_ptr->beamwidth_ltrack = 2.0;
-		mb_io_ptr->beamwidth_xtrack = 2.0;
-
-		/* read distance and depth values into storage arrays */
-		*nbath = store->beams_bath;
-		*namp = 0;
-		*nss = store->pixels_ss;;
-		for (i=0;i<*nbath;i++)
-			{
-			beamflag[i] = 0;
-			bath[i] = store->bath[i];
-			bathacrosstrack[i] = 0;
-			bathalongtrack[i] = 0;
-			}
-		for (i=0;i<*nss;i++)
-			{
-			ss[i] = store->ss[i];
-			ssacrosstrack[i]
-				= store->ss_acrosstrack[i];
-//				= store->pixel_size * (i - store->pixels_ss / 2);
-			ssalongtrack[i]
-				= 0;
-			}
-
-		/* print debug statements */
-		if (verbose >= 5)
-			{
-			fprintf(stderr,"\ndbg4  Data extracted by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  Extracted values:\n");
-			fprintf(stderr,"dbg4       kind:       %d\n",
-				*kind);
-			fprintf(stderr,"dbg4       error:      %d\n",
-				*error);
-			fprintf(stderr,"dbg4       time_i[0]:  %d\n",
-				time_i[0]);
-			fprintf(stderr,"dbg4       time_i[1]:  %d\n",
-				time_i[1]);
-			fprintf(stderr,"dbg4       time_i[2]:  %d\n",
-				time_i[2]);
-			fprintf(stderr,"dbg4       time_i[3]:  %d\n",
-				time_i[3]);
-			fprintf(stderr,"dbg4       time_i[4]:  %d\n",
-				time_i[4]);
-			fprintf(stderr,"dbg4       time_i[5]:  %d\n",
-				time_i[5]);
-			fprintf(stderr,"dbg4       time_i[6]:  %d\n",
-				time_i[6]);
-			fprintf(stderr,"dbg4       time_d:     %f\n",
-				*time_d);
-			fprintf(stderr,"dbg4       longitude:  %f\n",
-				*navlon);
-			fprintf(stderr,"dbg4       latitude:   %f\n",
-				*navlat);
-			fprintf(stderr,"dbg4       speed:      %f\n",
-				*speed);
-			fprintf(stderr,"dbg4       heading:    %f\n",
-				*heading);
-			fprintf(stderr,"dbg4       nbath:      %d\n",
-				*nbath);
-			for (i=0;i<*nbath;i++)
-			  fprintf(stderr,"dbg4       beam:%d  flag:%3d  bath:%f  acrosstrack:%f  alongtrack:%f\n",
-				i,beamflag[i],bath[i],
-				bathacrosstrack[i],bathalongtrack[i]);
-			fprintf(stderr,"dbg4        namp:     %d\n",
-				*namp);
-			for (i=0;i<*namp;i++)
-			  fprintf(stderr,"dbg4        beam:%d   amp:%f  acrosstrack:%f  alongtrack:%f\n",
-				i,amp[i],bathacrosstrack[i],bathalongtrack[i]);
-			}
-
-		/* done translating values */
-
-		}
-
-	/* extract nav from structure */
-	else if (*kind == MB_DATA_NAV)
-		{
-		/* get time */
-		*time_d = store->nav_time_d;
-		mb_get_date(verbose, *time_d, time_i);
-
-		/* get navigation */
-		*navlon = store->nav_longitude;
-		*navlat = store->nav_latitude;
-
-		/* get heading */
-		*heading = store->nav_heading;
-
-		/* get speed  */
-		*speed = 0.0;
-
-		/* read distance and depth values into storage arrays */
-		*nbath = 0;
-		*namp = 0;
-		*nss = 0;
-
-		/* print debug statements */
-		if (verbose >= 5)
-			{
-			fprintf(stderr,"\ndbg4  Data extracted by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  Extracted values:\n");
-			fprintf(stderr,"dbg4       kind:       %d\n",
-				*kind);
-			fprintf(stderr,"dbg4       error:      %d\n",
-				*error);
-			fprintf(stderr,"dbg4       time_i[0]:  %d\n",
-				time_i[0]);
-			fprintf(stderr,"dbg4       time_i[1]:  %d\n",
-				time_i[1]);
-			fprintf(stderr,"dbg4       time_i[2]:  %d\n",
-				time_i[2]);
-			fprintf(stderr,"dbg4       time_i[3]:  %d\n",
-				time_i[3]);
-			fprintf(stderr,"dbg4       time_i[4]:  %d\n",
-				time_i[4]);
-			fprintf(stderr,"dbg4       time_i[5]:  %d\n",
-				time_i[5]);
-			fprintf(stderr,"dbg4       time_i[6]:  %d\n",
-				time_i[6]);
-			fprintf(stderr,"dbg4       time_d:     %f\n",
-				*time_d);
-			fprintf(stderr,"dbg4       longitude:  %f\n",
-				*navlon);
-			fprintf(stderr,"dbg4       latitude:   %f\n",
-				*navlat);
-			fprintf(stderr,"dbg4       speed:      %f\n",
-				*speed);
-			fprintf(stderr,"dbg4       heading:    %f\n",
-				*heading);
-			}
-
-		/* done translating values */
-
-		}
-
-	/* extract comment from structure */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* copy comment */
-		strcpy(comment,store->comment);
-
-		/* print debug statements */
-		if (verbose >= 4)
-			{
-			fprintf(stderr,"\ndbg4  New ping read by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  New ping values:\n");
-			fprintf(stderr,"dbg4       error:      %d\n",
-				*error);
-			fprintf(stderr,"dbg4       comment:    %s\n",
-				comment);
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind == MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"dbg2       comment:     \ndbg2       %s\n",
-			comment);
-		}
-	else if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind != MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"dbg2       time_i[0]:     %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:     %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:     %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:     %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:     %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:     %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:     %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:        %f\n",*time_d);
-		fprintf(stderr,"dbg2       longitude:     %f\n",*navlon);
-		fprintf(stderr,"dbg2       latitude:      %f\n",*navlat);
-		fprintf(stderr,"dbg2       speed:         %f\n",*speed);
-		fprintf(stderr,"dbg2       heading:       %f\n",*heading);
-		}
-	if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind == MB_DATA_DATA)
-		{
-		fprintf(stderr,"dbg2       nbath:      %d\n",
-			*nbath);
-		for (i=0;i<*nbath;i++)
-		  fprintf(stderr,"dbg2       beam:%d  flag:%3d  bath:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,beamflag[i],bath[i],
-			bathacrosstrack[i],bathalongtrack[i]);
-		fprintf(stderr,"dbg2        namp:     %d\n",
-			*namp);
-		for (i=0;i<*namp;i++)
-		  fprintf(stderr,"dbg2       beam:%d   amp:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,amp[i],bathacrosstrack[i],bathalongtrack[i]);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_benthos_insert(int verbose, void *mbio_ptr, void *store_ptr,
-		int kind, int time_i[7], double time_d,
-		double navlon, double navlat,
-		double speed, double heading,
-		int nbath, int namp, int nss,
-		char *beamflag, double *bath, double *amp,
-		double *bathacrosstrack, double *bathalongtrack,
-		double *ss, double *ssacrosstrack, double *ssalongtrack,
-		char *comment, int *error)
-{
-	char	*function_name = "mbsys_benthos_insert";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_benthos_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       kind:       %d\n",kind);
-		}
-	if (verbose >= 2 && (kind == MB_DATA_DATA || kind == MB_DATA_NAV))
-		{
-		fprintf(stderr,"dbg2       time_i[0]:  %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:  %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:  %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:  %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:  %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:  %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:  %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:     %f\n",time_d);
-		fprintf(stderr,"dbg2       navlon:     %f\n",navlon);
-		fprintf(stderr,"dbg2       navlat:     %f\n",navlat);
-		fprintf(stderr,"dbg2       speed:      %f\n",speed);
-		fprintf(stderr,"dbg2       heading:    %f\n",heading);
-		}
-	if (verbose >= 2 && kind == MB_DATA_DATA)
-		{
-		fprintf(stderr,"dbg2       nbath:      %d\n",nbath);
-		if (verbose >= 3)
-		 for (i=0;i<nbath;i++)
-		  fprintf(stderr,"dbg3       beam:%d  flag:%3d  bath:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,beamflag[i],bath[i],
-			bathacrosstrack[i],bathalongtrack[i]);
-		fprintf(stderr,"dbg2       namp:       %d\n",namp);
-		if (verbose >= 3)
-		 for (i=0;i<namp;i++)
-		  fprintf(stderr,"dbg3        beam:%d   amp:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,amp[i],bathacrosstrack[i],bathalongtrack[i]);
-		}
-	if (verbose >= 2 && kind == MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"dbg2       comment:     \ndbg2       %s\n",
-			comment);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_benthos_struct *) store_ptr;
-
-	/* set data kind */
-	store->kind = kind;
-
-	/* insert data in structure */
-	if (store->kind == MB_DATA_DATA)
-		{
-		}
-
-	/* insert comment in structure */
-	else if (store->kind == MB_DATA_COMMENT)
-		{
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_benthos_ttimes(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, int *nbeams,
-	double *ttimes, double *angles,
-	double *angles_forward, double *angles_null,
-	double *heave, double *alongtrack_offset,
-	double *draft, double *ssv, int *error)
-{
-	char	*function_name = "mbsys_benthos_ttimes";
-	int	status = MB_SUCCESS;
-
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_benthos_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       ttimes:     %p\n",(void *)ttimes);
-		fprintf(stderr,"dbg2       angles_xtrk:%p\n",(void *)angles);
-		fprintf(stderr,"dbg2       angles_ltrk:%p\n",(void *)angles_forward);
-		fprintf(stderr,"dbg2       angles_null:%p\n",(void *)angles_null);
-		fprintf(stderr,"dbg2       heave:      %p\n",(void *)heave);
-		fprintf(stderr,"dbg2       ltrk_off:   %p\n",(void *)alongtrack_offset);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_benthos_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		*nbeams = 1;
-		ttimes[0] = 0;
-		angles_forward[0] = 0;
-		angles_null[0] = 0;
-		heave[0] = 0;
-		alongtrack_offset[0] = 0;
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error == MB_ERROR_NO_ERROR)
-		{
-		fprintf(stderr,"dbg2       draft:      %f\n",*draft);
-		fprintf(stderr,"dbg2       ssv:        %f\n",*ssv);
-		fprintf(stderr,"dbg2       nbeams:     %d\n",*nbeams);
-		for (i=0;i<*nbeams;i++)
-			fprintf(stderr,"dbg2       beam %d: tt:%f  angle_xtrk:%f  angle_ltrk:%f  angle_null:%f  heave:%f  ltrk_off:%f\n",
-				i,ttimes[i],angles[i],
-				angles_forward[i],angles_null[i],
-				heave[i],alongtrack_offset[i]);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_benthos_extract_altitude(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, double *transducer_depth, double *altitude,
-	int *error)
-{
-	char	*function_name = "mbsys_benthos_extract_altitude";
-	int	status = MB_SUCCESS;
-
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_benthos_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_benthos_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		*transducer_depth = store->MBOffsetZ + store->png_heave + store->png_depth;
-		*altitude = store->bath[0];
-
-		/* set status */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:              %d\n",*kind);
-		fprintf(stderr,"dbg2       transducer_depth:  %f\n",*transducer_depth);
-		fprintf(stderr,"dbg2       altitude:          %f\n",*altitude);
-		fprintf(stderr,"dbg2       error:             %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_benthos_extract_nav(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int time_i[7], double *time_d,
-		double *navlon, double *navlat,
-		double *speed, double *heading, double *draft,
-		double *roll, double *pitch, double *heave,
-		int *error)
-{
-	char	*function_name = "mbsys_benthos_extract_nav";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_benthos_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_benthos_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get time */
-		*time_d = store->png_time_d;
-		mb_get_date(verbose, *time_d, time_i);
-
-		/* get navigation */
-		*navlon = store->png_longitude;
-		*navlat = store->png_latitude;
-
-		/* get heading */
-		*heading = store->png_heading;
-
-		/* get speed  */
-		*speed = store->png_speed;
-
-		/* get draft  */
-		*draft = store->MBOffsetZ;
-
-		/* get roll pitch and heave */
-		*roll = store->png_roll;
-		*pitch = store->png_pitch;
-		*heave = store->png_heave;
-
-		/* print debug statements */
-		if (verbose >= 5)
-			{
-			fprintf(stderr,"\ndbg4  Data extracted by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  Extracted values:\n");
-			fprintf(stderr,"dbg4       kind:       %d\n",
-				*kind);
-			fprintf(stderr,"dbg4       error:      %d\n",
-				*error);
-			fprintf(stderr,"dbg4       time_i[0]:  %d\n",
-				time_i[0]);
-			fprintf(stderr,"dbg4       time_i[1]:  %d\n",
-				time_i[1]);
-			fprintf(stderr,"dbg4       time_i[2]:  %d\n",
-				time_i[2]);
-			fprintf(stderr,"dbg4       time_i[3]:  %d\n",
-				time_i[3]);
-			fprintf(stderr,"dbg4       time_i[4]:  %d\n",
-				time_i[4]);
-			fprintf(stderr,"dbg4       time_i[5]:  %d\n",
-				time_i[5]);
-			fprintf(stderr,"dbg4       time_i[6]:  %d\n",
-				time_i[6]);
-			fprintf(stderr,"dbg4       time_d:     %f\n",
-				*time_d);
-			fprintf(stderr,"dbg4       longitude:  %f\n",
-				*navlon);
-			fprintf(stderr,"dbg4       latitude:   %f\n",
-				*navlat);
-			fprintf(stderr,"dbg4       speed:      %f\n",
-				*speed);
-			fprintf(stderr,"dbg4       heading:    %f\n",
-				*heading);
-			fprintf(stderr,"dbg4       draft:      %f\n",
-				*draft);
-			fprintf(stderr,"dbg4       roll:       %f\n",
-				*roll);
-			fprintf(stderr,"dbg4       pitch:      %f\n",
-				*pitch);
-			fprintf(stderr,"dbg4       heave:      %f\n",
-				*heave);
-			}
-
-		/* done translating values */
-
-		}
-
-	/* extract nav from structure */
-	else if (*kind == MB_DATA_NAV)
-		{
-		/* get time */
-		*time_d = store->nav_time_d;
-		mb_get_date(verbose, *time_d, time_i);
-
-		/* get navigation */
-		*navlon = store->nav_longitude;
-		*navlat = store->nav_latitude;
-
-		/* get heading */
-		*heading = store->nav_heading;
-
-		/* get speed  */
-		*speed = 0.0;
-		/* get time */
-
-		/* get draft  */
-		*draft = store->MBOffsetZ;
-
-		/* get roll pitch and heave */
-		*roll = store->png_roll;
-		*pitch = store->png_pitch;
-		*heave = store->png_heave;
-
-		/* print debug statements */
-		if (verbose >= 5)
-			{
-			fprintf(stderr,"\ndbg4  Data extracted by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  Extracted values:\n");
-			fprintf(stderr,"dbg4       kind:       %d\n",
-				*kind);
-			fprintf(stderr,"dbg4       error:      %d\n",
-				*error);
-			fprintf(stderr,"dbg4       time_i[0]:  %d\n",
-				time_i[0]);
-			fprintf(stderr,"dbg4       time_i[1]:  %d\n",
-				time_i[1]);
-			fprintf(stderr,"dbg4       time_i[2]:  %d\n",
-				time_i[2]);
-			fprintf(stderr,"dbg4       time_i[3]:  %d\n",
-				time_i[3]);
-			fprintf(stderr,"dbg4       time_i[4]:  %d\n",
-				time_i[4]);
-			fprintf(stderr,"dbg4       time_i[5]:  %d\n",
-				time_i[5]);
-			fprintf(stderr,"dbg4       time_i[6]:  %d\n",
-				time_i[6]);
-			fprintf(stderr,"dbg4       time_d:     %f\n",
-				*time_d);
-			fprintf(stderr,"dbg4       longitude:  %f\n",
-				*navlon);
-			fprintf(stderr,"dbg4       latitude:   %f\n",
-				*navlat);
-			fprintf(stderr,"dbg4       speed:      %f\n",
-				*speed);
-			fprintf(stderr,"dbg4       heading:    %f\n",
-				*heading);
-			fprintf(stderr,"dbg4       draft:      %f\n",
-				*draft);
-			}
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind == MB_DATA_DATA)
-		{
-		fprintf(stderr,"dbg2       time_i[0]:     %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:     %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:     %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:     %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:     %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:     %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:     %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:        %f\n",*time_d);
-		fprintf(stderr,"dbg2       longitude:     %f\n",*navlon);
-		fprintf(stderr,"dbg2       latitude:      %f\n",*navlat);
-		fprintf(stderr,"dbg2       speed:         %f\n",*speed);
-		fprintf(stderr,"dbg2       heading:       %f\n",*heading);
-		fprintf(stderr,"dbg2       draft:         %f\n",*draft);
-		fprintf(stderr,"dbg2       roll:          %f\n",*roll);
-		fprintf(stderr,"dbg2       pitch:         %f\n",*pitch);
-		fprintf(stderr,"dbg2       heave:         %f\n",*heave);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_benthos_insert_nav(int verbose, void *mbio_ptr, void *store_ptr,
-		int time_i[7], double time_d,
-		double navlon, double navlat,
-		double speed, double heading, double draft,
-		double roll, double pitch, double heave,
-		int *error)
-{
-	char	*function_name = "mbsys_benthos_insert_nav";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_benthos_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       time_i[0]:  %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:  %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:  %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:  %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:  %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:  %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:  %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:     %f\n",time_d);
-		fprintf(stderr,"dbg2       navlon:     %f\n",navlon);
-		fprintf(stderr,"dbg2       navlat:     %f\n",navlat);
-		fprintf(stderr,"dbg2       speed:      %f\n",speed);
-		fprintf(stderr,"dbg2       heading:    %f\n",heading);
-		fprintf(stderr,"dbg2       draft:      %f\n",draft);
-		fprintf(stderr,"dbg2       roll:       %f\n",roll);
-		fprintf(stderr,"dbg2       pitch:      %f\n",pitch);
-		fprintf(stderr,"dbg2       heave:      %f\n",heave);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_benthos_struct *) store_ptr;
-
-	/* insert data in structure */
-	if (store->kind == MB_DATA_DATA)
-		{
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_benthos_copy(int verbose, void *mbio_ptr,
-			void *store_ptr, void *copy_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_benthos_copy";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_benthos_struct *store;
-	struct mbsys_benthos_struct *copy;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       copy_ptr:   %p\n",(void *)copy_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointers */
-	store = (struct mbsys_benthos_struct *) store_ptr;
-	copy = (struct mbsys_benthos_struct *) copy_ptr;
-
-	/* copy the data */
-	*copy = *store;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_benthos_makess(int verbose, void *mbio_ptr, void *store_ptr,
-		int pixel_size_set, double *pixel_size,
-		int swath_width_set, double *swath_width,
-		int *error)
-{
-	char	*function_name = "mbsys_benthos_makess";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_benthos_struct *store;
-	double	ss[MBSYS_BENTHOS_MAXPIXELS];
-	int	ss_cnt[MBSYS_BENTHOS_MAXPIXELS];
-	double	ssacrosstrack[MBSYS_BENTHOS_MAXPIXELS];
-	double	ssalongtrack[MBSYS_BENTHOS_MAXPIXELS];
-	double  pixel_size_calc;
-	double	ss_spacing;
-	double	xtrackss;
-	int groundsamples;
-	double groundrange;
-	int	pixel1;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:         %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:        %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:       %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       pixel_size_set:  %d\n",pixel_size_set);
-		fprintf(stderr,"dbg2       pixel_size:      %f\n",*pixel_size);
-		fprintf(stderr,"dbg2       swath_width_set: %d\n",swath_width_set);
-		fprintf(stderr,"dbg2       swath_width:     %f\n",*swath_width);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_benthos_struct *) store_ptr;
-
-	/* insert data in structure */
-	if (store->kind == MB_DATA_DATA
-		&& store->ssrawstbdsamples > 0
-		&& store->ssrawportsamples > 0)
-		{
-		/* zero the sidescan */
-		for (i=0;i<MBSYS_BENTHOS_MAXPIXELS;i++)
-			{
-			ss[i] = 0.0;
-			ssacrosstrack[i] = 0.0;
-			ssalongtrack[i] = 0.0;
-			ss_cnt[i] = 0;
-			}
-
-		/* get raw pixel size */
-		ss_spacing = store->ssrawtimeduration / store->ssrawportsamples;
-
-
-		/* get sidescan pixel size */
-		pixel1 = (2.0 * store->bath[0]
-                / ( store->png_computedsv * ss_spacing)) + 1;
-		groundsamples = store->ssrawportsamples - pixel1;
-
-		groundrange = sqrt(pow(store->ssrawslantrange, 2) - pow(store->bath[0], 2));
-
-		if (swath_width_set == MB_NO) {
-			*swath_width = 2.0 * groundrange;
-		}
-
-		if (pixel_size_set == MB_NO) {
-			pixel_size_calc = groundrange / groundsamples;
-
-			if ((*pixel_size) <= 0.0)
-		    	(*pixel_size) = pixel_size_calc;
-		    else if (0.95 * (*pixel_size) > pixel_size_calc)
-		    	(*pixel_size) = 0.95 * (*pixel_size);
-		    else if (1.05 * (*pixel_size) < pixel_size_calc)
-		    	(*pixel_size) = 1.05 * (*pixel_size);
-		    else
-		    	(*pixel_size) = pixel_size_calc;
-	    }
-
-
-
-
-		/* loop over the port beams, figuring out
-			acrosstrack distance for each raw sidescan sample */
-		for ( i = 0; i < store->ssrawportsamples; i++ ) {
-			if (i > (store->ssrawportsamples - pixel1)) {
-				xtrackss = 0;
-			} else {
-				xtrackss = - sqrt( pow(0.5 * ss_spacing * (store->ssrawportsamples - i) * store->png_computedsv, 2)
-						- pow( store->bath[0], 2) );
-			}
-			ss[i]  += store->ssrawport[i];
-			ssacrosstrack[i] = xtrackss;
-			ss_cnt[i]++;
-		}
-
-
-//		kk = store->ssrawportsamples - 1;
-//		ipixel = pixel1 + 1;
-//		for (i = store->ssrawportsamples - pixel1 - 1; i >= 0; i-- ) {
-////			double q1 = pow(0.5 * ss_spacing * ipixel * store->png_computedsv, 2);
-////			double q2 = pow( store->bath[0], 2);
-////			xtrackss = sqrt(q1 -q2);
-//			xtrackss = sqrt( pow(0.5 * ss_spacing * ipixel * store->png_computedsv, 2)
-//					- pow( store->bath[0], 2) );
-//			ipixel++;
-//			if (kk > 0) {
-//				ss[kk]  += store->ssrawport[i];
-//				ssacrosstrack[kk] = xtrackss;
-//				ss_cnt[kk]++;
-//			}
-//			kk--;
-//		}
-
-		/* loop over the starboard beams, figuring out
-			acrosstrack distance for each raw sidescan sample */
-		for ( i = 0; i < store->ssrawstbdsamples; i++ ) {
-			if (i < pixel1) {
-				xtrackss = 0;
-			} else {
-				xtrackss = sqrt( pow(0.5 * ss_spacing * i * store->png_computedsv, 2)
-						- pow( store->bath[0], 2) );
-			}
-			ss[i + store->ssrawportsamples]  += store->ssrawstbd[i];
-			ssacrosstrack[i+ store->ssrawportsamples] = xtrackss;
-			ss_cnt[i + store->ssrawportsamples]++;
-		}
-
-//		kk = MBSYS_BENTHOS_MAXPIXELS / 2;
-//		ipixel = pixel1 + 1;
-//		for (i = pixel1; i < store->ssrawstbdsamples; i++) {
-//			xtrackss = sqrt( pow(0.5 * ss_spacing * ipixel * store->png_computedsv, 2)
-//					- pow( store->bath[0], 2) );
-//			ipixel++;
-//			if (kk < MBSYS_BENTHOS_MAXPIXELS) {
-//				ss[kk] = store->ssrawstbd[i];
-//				ssacrosstrack[kk] = xtrackss;
-//				ss_cnt[kk]++;
-//			}
-//			kk++;
-//		}
-
-		/* average the sidescan */
-//		first = MBSYS_BENTHOS_MAXPIXELS;
-//		last = -1;
-//		for (k=0;k<MBSYS_BENTHOS_MAXPIXELS;k++)
-//		    {
-//		    if (ss_cnt[k] > 0)
-//			    {
-//			    ss[k] /= ss_cnt[k];
-//			    ssalongtrack[k] /= ss_cnt[k];
-//			    ssacrosstrack[k]
-//				    = (k - MBSYS_BENTHOS_MAXPIXELS / 2)
-//					    * (*pixel_size);
-//			    first = MIN(first, k);
-//			    last = k;
-//			    }
-//			else
-//				ss[k] = MB_SIDESCAN_NULL;
-//		    }
-//
-//		/* interpolate the sidescan */
-//		k1 = first;
-//		k2 = first;
-//		for (k=first+1;k<last;k++)
-//		    {
-//		    if (ss_cnt[k] <= 0)
-//			{
-//			if (k2 <= k)
-//			    {
-//			    k2 = k+1;
-//			    while (ss_cnt[k2] <= 0 && k2 < last)
-//				k2++;
-//			    }
-//			ss[k] = ss[k1]
-//			    + (ss[k2] - ss[k1])
-//				* ((double)(k - k1)) / ((double)(k2 - k1));
-//			ssacrosstrack[k]
-//				= (k - MBSYS_BENTHOS_MAXPIXELS / 2)
-//					* (*pixel_size);
-//			ssalongtrack[k] = ssalongtrack[k1]
-//			    + (ssalongtrack[k2] - ssalongtrack[k1])
-//				* ((double)(k - k1)) / ((double)(k2 - k1));
-//			}
-//		    else
-//			{
-//			k1 = k;
-//			}
-//		    }
-//
-		/* insert the new sidescan into store */
-		store->pixel_size = (*pixel_size);
-//		if (last > first)
-//		    store->pixels_ss = MBSYS_BENTHOS_MAXPIXELS;
-//		else
-//		    store->pixels_ss = 0;
-		for (i=0;i < store->pixels_ss;i++)
-		    {
-		    store->ss[i] = ss[i];
-		    store->ss_alongtrack[i] = ssalongtrack[i];
-		    store->ss_acrosstrack[i] = ssacrosstrack[i];
-		    }
-
-		/* print debug statements */
-		if (verbose >= 2)
-			{
-			fprintf(stderr,"\ndbg2  Sidescan regenerated in <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg2       beams_bath:    %d\n",
-				store->beams_bath);
-//			for (i=0;i<store->beams_bath;i++)
-//			  fprintf(stderr,"dbg2       beam:%d  flag:%3d  bath:%10f  amp:%10f  acrosstrack:%10f  alongtrack:%10f\n",
-//				i,
-//				store->beamflag[i],
-//				store->bath[i],
-//				store->amp[i],
-//				store->bath_acrosstrack[i],
-//				store->bath_alongtrack[i]);
-			fprintf(stderr,"dbg2       pixels_ss:  %d\n",
-				MBSYS_BENTHOS_MAXPIXELS);
-			for (i=0;i<MBSYS_BENTHOS_MAXPIXELS;i++)
-			  fprintf(stderr,"dbg2       pixel:%4d  cnt:%3d  ss:%10f  xtrack:%10f  ltrack:%10f\n",
-				i,ss_cnt[i],ss[i],
-				ssacrosstrack[i],
-				ssalongtrack[i]);
-			fprintf(stderr,"dbg2       pixels_ss:  %d\n",
-				store->pixels_ss);
-			for (i=0;i<MBSYS_BENTHOS_MAXPIXELS;i++)
-			  fprintf(stderr,"dbg2       pixel:%4d  ss:%10f  xtrack:%10f  ltrack:%10f\n",
-				i,store->ss[i],store->ss_acrosstrack[i],store->ss_alongtrack[i]);
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       pixel_size:      %f\n",*pixel_size);
-		fprintf(stderr,"dbg2       swath_width:     %f\n",*swath_width);
-		fprintf(stderr,"dbg2       error:           %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:          %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mbsys_benthos.h b/src/mbio/mbsys_benthos.h
deleted file mode 100644
index 8ff6a0a..0000000
--- a/src/mbio/mbsys_benthos.h
+++ /dev/null
@@ -1,193 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbsys_benthos.h	3/29/2011
- *	$Id: mbsys_benthos.h 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 2012-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbsys_benthos.h defines the data structures used by MBIO functions
- * to store data from Benthos SIS1624 Sidescan sonar systems.
- * The formats associated with this i/o module are:
- *      MBF_XTFB1624 : MBIO ID 211
- *
- * Author:	Jens Renken (MARUM/University of Bremen)
- * Date:	March 29, 2011
- *
- * Author:	D. W. Caress
- * Date:	2 May 2012 (when the code was brought into the MB-System archive as a read-only i/o module)
- *
- * $Log: $
- *
- */
-/*
- * Notes on the MBSYS_BENTHOS data:
- *
- */
-
-/* sonar types */
-#define	MBSYS_BENTHOS_UNKNOWN		0
-#define	MBSYS_BENTHOS_SIS1624		1624
-
-/* maximum number of beams and pixels */
-#define	MBSYS_BENTHOS_MAXBEAMS	1
-#define	MBSYS_BENTHOS_MAXRAWPIXELS	15360
-#define	MBSYS_BENTHOS_MAXPIXELS	(15360 * 2)
-#define	MBSYS_BENTHOS_MAXSVP	0
-#define	MBSYS_BENTHOS_COMMENT_LENGTH	200
-
-/* internal data structure */
-struct mbsys_benthos_struct
-{
-	/* type of data record */
-	int	kind;			/* Data kind */
-
-	/* type of sonar */
-	int	sonar;			/* Type of Benthos sonar */
-
-	/* parameter info */
-	float		MBOffsetX;
-	float		MBOffsetY;
-	float		MBOffsetZ;
-	float		NavLatency;		/* GPS_time_received - GPS_time_sent (sec) */
-	float		NavOffsetY;		/* Nav offset (m) */
-	float		NavOffsetX;		/* Nav offset (m) */
-	float		NavOffsetZ; 		/* Nav z offset (m) */
-	float		NavOffsetYaw;		/* Heading offset (m) */
-	float		MRUOffsetY;		/* Multibeam MRU y offset (m) */
-	float		MRUOffsetX;		/* Multibeam MRU x offset (m) */
-	float		MRUOffsetZ; 		/* Multibeam MRU z offset (m) */
-	float		MRUOffsetPitch; 	/* Multibeam MRU pitch offset (degrees) */
-	float		MRUOffsetRoll;		/* Multibeam MRU roll offset (degrees) */
-
-	/* nav data */
-	double	nav_time_d;
-	double	nav_longitude;
-	double	nav_latitude;
-	float	nav_heading;
-
-	/* attitude data */
-	double	att_timetag;
-	float	att_heading;
-	float	att_heave;
-	float	att_roll;
-	float	att_pitch;
-
-	/* comment */
-	char	comment[MBSYS_BENTHOS_COMMENT_LENGTH];
-	/* sound velocity profile -> discarded */
-
-	/* survey data */
-	double	png_time_d;
-	double	png_latency;
-	double	png_latitude;
-	double	png_longitude;
-	double	png_speed;			/* km/hr */
-	double	png_roll;
-	double	png_pitch;
-	double	png_heading;
-	double	png_heave;
-
-
-	float	png_rtsv;		/* round trip soundvelocity */
-	float   png_computedsv;	/* computed sound velocity	*/
-	float	png_pressure;	/* pressure in psi	*/
-	float	png_depth;		/* depth in meter	*/
-
-
-	unsigned int	Seconds;	/* seconds since 00:00:00, 1 January 1970 */
-	unsigned int	Millisecs;	/* milliseconds, LSB = 1 ms */
-	unsigned int	ping_number;		/* sequential ping number from sonar startup/reset */
-
-
-
-	float ssrawtimedelay;				/* raw sidescan delay (sec) */
-	float ssrawtimeduration;			/* raw sidescan duration (sec) */
-	float ssrawbottompick;				/* bottom pick time (sec) 	*/
-
-	float ssrawslantrange;				/* slant range (m) */
-	float ssrawgroundrange;				/* ground range (m) */
-
-	unsigned short ssfrequency;
-
-	unsigned short ssportinitgain;
-	unsigned short ssstbdinitgain;
-	unsigned short ssportgain;
-	unsigned short ssstbdgain;
-
-	unsigned short ssrawportsamples;		/* number of port raw sidescan samples */
-	unsigned short ssrawstbdsamples;		/* number of stbd raw sidescan samples */
-	unsigned short ssrawport[MBSYS_BENTHOS_MAXRAWPIXELS];		/* raw port sidescan */
-	unsigned short ssrawstbd[MBSYS_BENTHOS_MAXRAWPIXELS];		/* raw starboard sidescan */
-
-	int	beams_bath;
-	int	pixels_ss;
-	double	pixel_size;
-	char 	beamflag[MBSYS_BENTHOS_MAXBEAMS]; 		/* beamflags */
-	double 	bath[MBSYS_BENTHOS_MAXBEAMS];			/* bathymetry (m) */
-	double	ss[MBSYS_BENTHOS_MAXPIXELS];			/* sidescan */
-	double 	ss_acrosstrack[MBSYS_BENTHOS_MAXPIXELS];	/* acrosstrack distance (m) */
-	double 	ss_alongtrack[MBSYS_BENTHOS_MAXPIXELS];		/* alongtrack distance (m) */
-
-};
-
-/* system specific function prototypes */
-int mbsys_benthos_alloc(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error);
-int mbsys_benthos_deall(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error);
-int mbsys_benthos_dimensions(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int *nbath, int *namp, int *nss, int *error);
-int mbsys_benthos_extract(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int time_i[7], double *time_d,
-			double *navlon, double *navlat,
-			double *speed, double *heading,
-			int *nbath, int *namp, int *nss,
-			char *beamflag, double *bath, double *amp,
-			double *bathacrosstrack, double *bathalongtrack,
-			double *ss, double *ssacrosstrack, double *ssalongtrack,
-			char *comment, int *error);
-int mbsys_benthos_insert(int verbose, void *mbio_ptr, void *store_ptr,
-			int kind, int time_i[7], double time_d,
-			double navlon, double navlat,
-			double speed, double heading,
-			int nbath, int namp, int nss,
-			char *beamflag, double *bath, double *amp,
-			double *bathacrosstrack, double *bathalongtrack,
-			double *ss, double *ssacrosstrack, double *ssalongtrack,
-			char *comment, int *error);
-int mbsys_benthos_ttimes(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int *nbeams,
-			double *ttimes, double *angles,
-			double *angles_forward, double *angles_null,
-			double *heave, double *alongtrack_offset,
-			double *draft, double *ssv, int *error);
-int mbsys_benthos_extract_altitude(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, double *transducer_depth, double *altitude,
-			int *error);
-int mbsys_benthos_extract_nav(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int time_i[7], double *time_d,
-			double *navlon, double *navlat,
-			double *speed, double *heading, double *draft,
-			double *roll, double *pitch, double *heave,
-			int *error);
-int mbsys_benthos_insert_nav(int verbose, void *mbio_ptr, void *store_ptr,
-			int time_i[7], double time_d,
-			double navlon, double navlat,
-			double speed, double heading, double draft,
-			double roll, double pitch, double heave,
-			int *error);
-int mbsys_benthos_copy(int verbose, void *mbio_ptr,
-			void *store_ptr, void *copy_ptr,
-			int *error);
-int mbsys_benthos_makess(int verbose, void *mbio_ptr, void *store_ptr,
-			int pixel_size_set, double *pixel_size,
-			int swath_width_set, double *swath_width,
-			int *error);
diff --git a/src/mbio/mbsys_dsl.c b/src/mbio/mbsys_dsl.c
deleted file mode 100644
index 5db0f07..0000000
--- a/src/mbio/mbsys_dsl.c
+++ /dev/null
@@ -1,1304 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbsys_dsl.c	3.00	8/5/96
- *	$Id: mbsys_dsl.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1996-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbsys_dsl.c contains the functions for handling the data structure
- * used by MBIO functions to store data from the WHOI DSL AMS-120
- * interferometric sonar. This is a 120 khz deep-towed sonar which
- * produces both sidescan and bathymetry.
- * The data formats used to store the DSL AMS-120 data are
- *      MBF_DSL120PF : MBIO ID 111
- *      MBF_DSL120SF : MBIO ID 112
- *
- * Author:	D. W. Caress
- * Date:	August 5, 1996
- *
- * $Log: mbsys_dsl.c,v $
- * Revision 5.8  2005/11/05 00:48:05  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.7  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.6  2002/09/25 20:41:04  caress
- * Fixed old DSL120 format.
- *
- * Revision 5.5  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.4  2002/07/20 20:42:40  caress
- * Release 5.0.beta20
- *
- * Revision 5.3  2001/08/25 00:54:13  caress
- * Adding beamwidth values to extract functions.
- *
- * Revision 5.2  2001/07/20  00:32:54  caress
- * Release 5.0.beta03
- *
- * Revision 5.1  2001/01/22  07:43:34  caress
- * Version 5.0.beta01
- *
- * Revision 5.0  2000/12/01  22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.5  2000/10/11  01:03:21  caress
- * Convert to ANSI C
- *
- * Revision 4.4  2000/09/30  06:32:52  caress
- * Snapshot for Dale.
- *
- * Revision 4.3  1998/10/05  18:32:27  caress
- * MB-System version 4.6beta
- *
- * Revision 1.1  1998/10/05  17:46:15  caress
- * Initial revision
- *
- * Revision 4.2  1997/07/25  14:19:53  caress
- * Version 4.5beta2.
- * Much mucking, particularly with Simrad formats.
- *
- * Revision 4.1  1997/04/21  17:02:07  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.0  1996/08/26  17:29:56  caress
- * Release 4.4 revision.
- *
- * Revision 4.0  1996/08/26  17:29:56  caress
- * Release 4.4 revision.
- *
- * Revision 1.1  1996/08/26  17:24:56  caress
- * Initial revision
- *
- *
- *
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mb_define.h"
-#include "mbsys_dsl.h"
-
-static char rcs_id[]="$Id: mbsys_dsl.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mbsys_dsl_alloc(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_dsl_alloc";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_dsl_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* allocate memory for data structure */
-	status = mb_malloc(verbose,sizeof(struct mbsys_dsl_struct),
-				store_ptr,error);
-
-	/* get data structure pointer */
-	store = (struct mbsys_dsl_struct *) *store_ptr;
-
-	/* initialize everything */
-	store->kind = MB_DATA_NONE;
-	store->rec_type = DSL_NONE;
-	store->rec_len = 0;
-	store->rec_hdr_len = 0;
-	store->p_flags = 0;
-	store->num_data_types = 0;
-	store->ping = 0;
-	for (i=0;i<4;i++)
-		store->sonar_cmd[i] = '\0';
-	for (i=0;i<24;i++)
-		store->time_stamp[i] = '\0';
-	store->nav_x = 0.0;
-	store->nav_y = 0.0;
-	store->depth = 0.0;
-	store->heading = 0.0;
-	store->pitch = 0.0;
-	store->roll = 0.0;
-	store->alt = 0.0;
-	store->ang_offset = 0.0;
-	store->transmit_pwr = 0;
-	store->gain_port = 0;
-	store->gain_starbd = 0;
-	store->pulse_width = 0.0;
-	store->swath_width = 0;
-	store->side = 0;
-	store->swapped = 3;
-	store->tv_sec = 0;
-	store->tv_usec = 0;
-	store->digitalinterface = 0;
-	for (i=0;i<5;i++)
-		store->reserved[i] = 0;
-	store->bat_type = DSL_BATH;
-	store->bat_len = 0;
-	store->bat_hdr_len = 0;
-	store->bat_num_bins = 0;
-	store->bat_sampleSize = 0.0;
-	store->bat_p_flags = 0;
-	store->bat_max_range = 0.0;
-	for (i=0;i<10;i++)
-		store->bat_future[i] = 0;
-	for (i=0;i<MBSYS_DSL_MAXBEAMS_SIDE;i++)
-		{
-		store->bat_port[i] = 0.0;
-		store->bat_stbd[i] = 0.0;
-		}
-	store->amp_type = DSL_AMP;
-	store->amp_len = 0;
-	store->amp_hdr_len = 0;
-	store->amp_num_samp = 0;
-	store->amp_sampleSize = 0.0;
-	store->amp_p_flags = 0;
-	store->amp_max_range = 0.0;
-	store->amp_channel = 0.0;
-	for (i=0;i<9;i++)
-		store->amp_future[i] = 0;
-	for (i=0;i<MBSYS_DSL_MAXBEAMS_SIDE;i++)
-		{
-		store->amp_port[i] = 0.0;
-		store->amp_stbd[i] = 0.0;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)*store_ptr);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbsys_dsl_deall(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_dsl_deall";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)*store_ptr);
-		}
-
-	/* deallocate memory for data structure */
-	status = mb_free(verbose,store_ptr,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_dsl_dimensions(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int *nbath, int *namp, int *nss, int *error)
-{
-	char	*function_name = "mbsys_dsl_dimensions";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_dsl_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_dsl_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get beam and pixel numbers */
-		*nbath = 2 * store->bat_num_bins;
-		*namp = 0;
-		*nss = 2 * store->amp_num_samp;
-		}
-	else
-		{
-		/* get beam and pixel numbers */
-		*nbath = 0;
-		*namp = 0;
-		*nss = 0;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		fprintf(stderr,"dbg2       nbath:      %d\n",*nbath);
-		fprintf(stderr,"dbg2        namp:      %d\n",*namp);
-		fprintf(stderr,"dbg2        nss:       %d\n",*nss);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_dsl_extract(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int time_i[7], double *time_d,
-		double *navlon, double *navlat,
-		double *speed, double *heading,
-		int *nbath, int *namp, int *nss,
-		char *beamflag, double *bath, double *amp,
-		double *bathacrosstrack, double *bathalongtrack,
-		double *ss, double *ssacrosstrack, double *ssalongtrack,
-		char *comment, int *error)
-{
-	char	*function_name = "mbsys_dsl_extract";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_dsl_struct *store;
-	double	dx;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_dsl_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get time */
-		*time_d = store->tv_sec + 0.000001 * store->tv_usec;
-		mb_get_date(verbose,*time_d,time_i);
-
-		/* get navigation */
-		if (store->nav_x <= 360.0 && store->nav_x >= -360.0
-			&& store->nav_y <= 90.0 && store->nav_y >= -90.0)
-			{
-			*navlon = store->nav_x;
-			*navlat = store->nav_y;
-			}
-		else
-			{
-			*navlon = 0.0;
-			*navlat = 0.0;
-			}
-
-		/* get heading */
-		*heading = store->heading;
-
-		/* get speed  */
-		*speed = 0.0;
-
-		/* set beamwidths in mb_io structure */
-		mb_io_ptr->beamwidth_ltrack = 2.0;
-		mb_io_ptr->beamwidth_xtrack = 0.2;
-
-		/* read bathymetry values into storage arrays */
-		*nbath = 2 * store->bat_num_bins;
-		*namp = 0;
-		dx = 0.5 * store->swath_width / store->bat_num_bins;
-		for (i=0;i<store->bat_num_bins;i++)
-			{
-			j = store->bat_num_bins - i - 1;
-			if (store->bat_port[i] > 0.0)
-			    {
-			    beamflag[j] = MB_FLAG_NONE;
-			    bath[j] = store->bat_port[i];
-			    }
-			else if (store->bat_port[i] < 0.0)
-			    {
-			    beamflag[j] =
-				MB_FLAG_MANUAL + MB_FLAG_FLAG;
-			    bath[j] = -store->bat_port[i];
-			    }
-			else
-			    {
-			    beamflag[j] = MB_FLAG_NULL;
-			    bath[j] = store->bat_port[i];
-			    }
-			bathacrosstrack[j] = -dx * (i + 0.5);
-			j = store->bat_num_bins + i;
-			if (store->bat_stbd[i] > 0.0)
-			    {
-			    beamflag[j] = MB_FLAG_NONE;
-			    bath[j] = store->bat_stbd[i];
-			    }
-			else if (store->bat_stbd[i] < 0.0)
-			    {
-			    beamflag[j] =
-				MB_FLAG_MANUAL + MB_FLAG_FLAG;
-			    bath[j] = -store->bat_stbd[i];
-			    }
-			else
-			    {
-			    beamflag[j] = MB_FLAG_NULL;
-			    bath[j] = store->bat_stbd[i];
-			    }
-			bathacrosstrack[j] = dx * (i + 0.5);
-			}
-
-		/* read sidescan values into storage arrays */
-		*nss = 2 * store->amp_num_samp;
-		dx = 0.5 * store->swath_width / store->amp_num_samp;
-		for (i=0;i<store->amp_num_samp;i++)
-			{
-			j = store->amp_num_samp - i - 1;
-			ss[j] = store->amp_port[i];
-			ssacrosstrack[j] = -dx * (i + 0.5);
-			j = store->amp_num_samp + i;
-			ss[j] = store->amp_stbd[i];
-			ssacrosstrack[j] = dx * (i + 0.5);
-			}
-
-		/* print debug statements */
-		if (verbose >= 4)
-			{
-			fprintf(stderr,"\ndbg4  Data extracted by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  Extracted values:\n");
-			fprintf(stderr,"dbg4       kind:       %d\n",
-				*kind);
-			fprintf(stderr,"dbg4       error:      %d\n",
-				*error);
-			fprintf(stderr,"dbg4       time_i[0]:  %d\n",
-				time_i[0]);
-			fprintf(stderr,"dbg4       time_i[1]:  %d\n",
-				time_i[1]);
-			fprintf(stderr,"dbg4       time_i[2]:  %d\n",
-				time_i[2]);
-			fprintf(stderr,"dbg4       time_i[3]:  %d\n",
-				time_i[3]);
-			fprintf(stderr,"dbg4       time_i[4]:  %d\n",
-				time_i[4]);
-			fprintf(stderr,"dbg4       time_i[5]:  %d\n",
-				time_i[5]);
-			fprintf(stderr,"dbg4       time_i[6]:  %d\n",
-				time_i[6]);
-			fprintf(stderr,"dbg4       time_d:     %f\n",
-				*time_d);
-			fprintf(stderr,"dbg4       longitude:  %f\n",
-				*navlon);
-			fprintf(stderr,"dbg4       latitude:   %f\n",
-				*navlat);
-			fprintf(stderr,"dbg4       speed:      %f\n",
-				*speed);
-			fprintf(stderr,"dbg4       heading:    %f\n",
-				*heading);
-			fprintf(stderr,"dbg4       nbath:      %d\n",
-				*nbath);
-			for (i=0;i<*nbath;i++)
-			  fprintf(stderr,"dbg4       beam:%d  flag:%3d  bath:%f  acrosstrack:%f  alongtrack:%f\n",
-				i,beamflag[i],
-				bath[i],bathacrosstrack[i],
-				bathalongtrack[i]);
-			fprintf(stderr,"dbg4        namp:     %d\n",
-				*namp);
-			for (i=0;i<*namp;i++)
-			  fprintf(stderr,"dbg4        beam:%d   amp:%f  acrosstrack:%f  alongtrack:%f\n",
-				i,amp[i],bathacrosstrack[i],bathalongtrack[i]);
-			for (i=0;i<*nss;i++)
-			  fprintf(stderr,"dbg4        pixel:%d   ss:%f  acrosstrack:%f  alongtrack:%f\n",
-				i,ss[i],ssacrosstrack[i],ssalongtrack[i]);
-			}
-
-		/* done translating values */
-
-		}
-
-	/* extract comment from structure */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* copy comment */
-		strcpy(comment,store->comment);
-
-		/* print debug statements */
-		if (verbose >= 4)
-			{
-			fprintf(stderr,"\ndbg4  New ping read by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  New ping values:\n");
-			fprintf(stderr,"dbg4       error:      %d\n",
-				*error);
-			fprintf(stderr,"dbg4       comment:    %s\n",
-				comment);
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind == MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"dbg2       comment:     \ndbg2       %s\n",
-			comment);
-		}
-	else if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind != MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"dbg2       time_i[0]:     %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:     %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:     %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:     %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:     %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:     %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:     %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:        %f\n",*time_d);
-		fprintf(stderr,"dbg2       longitude:     %f\n",*navlon);
-		fprintf(stderr,"dbg2       latitude:      %f\n",*navlat);
-		fprintf(stderr,"dbg2       speed:         %f\n",*speed);
-		fprintf(stderr,"dbg2       heading:       %f\n",*heading);
-		}
-	if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind == MB_DATA_DATA)
-		{
-		fprintf(stderr,"dbg2       nbath:      %d\n",
-			*nbath);
-		for (i=0;i<*nbath;i++)
-		  fprintf(stderr,"dbg2       beam:%d  flag:%3d  bath:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,beamflag[i],
-			bath[i],bathacrosstrack[i],
-			bathalongtrack[i]);
-		fprintf(stderr,"dbg2        namp:     %d\n",
-			*namp);
-		for (i=0;i<*namp;i++)
-		  fprintf(stderr,"dbg2       beam:%d   amp:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,amp[i],bathacrosstrack[i],bathalongtrack[i]);
-		fprintf(stderr,"dbg2        nss:      %d\n",
-			*nss);
-		for (i=0;i<*nss;i++)
-		  fprintf(stderr,"dbg2        pixel:%d   ss:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,ss[i],ssacrosstrack[i],ssalongtrack[i]);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_dsl_insert(int verbose, void *mbio_ptr, void *store_ptr,
-		int kind, int time_i[7], double time_d,
-		double navlon, double navlat,
-		double speed, double heading,
-		int nbath, int namp, int nss,
-		char *beamflag, double *bath, double *amp,
-		double *bathacrosstrack, double *bathalongtrack,
-		double *ss, double *ssacrosstrack, double *ssalongtrack,
-		char *comment, int *error)
-{
-	char	*function_name = "mbsys_dsl_insert";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_dsl_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       kind:       %d\n",kind);
-		}
-	if (verbose >= 2 && (kind == MB_DATA_DATA || kind == MB_DATA_NAV))
-		{
-		fprintf(stderr,"dbg2       time_i[0]:  %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:  %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:  %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:  %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:  %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:  %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:  %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:     %f\n",time_d);
-		fprintf(stderr,"dbg2       navlon:     %f\n",navlon);
-		fprintf(stderr,"dbg2       navlat:     %f\n",navlat);
-		fprintf(stderr,"dbg2       speed:      %f\n",speed);
-		fprintf(stderr,"dbg2       heading:    %f\n",heading);
-		}
-	if (verbose >= 2 && kind == MB_DATA_DATA)
-		{
-		fprintf(stderr,"dbg2       nbath:      %d\n",nbath);
-		if (verbose >= 3)
-		 for (i=0;i<nbath;i++)
-		  fprintf(stderr,"dbg3       beam:%d  flag:%3d  bath:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,beamflag[i],bath[i],bathacrosstrack[i],bathalongtrack[i]);
-		fprintf(stderr,"dbg2       namp:       %d\n",namp);
-		if (verbose >= 3)
-		 for (i=0;i<namp;i++)
-		  fprintf(stderr,"dbg3        beam:%d   amp:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,amp[i],bathacrosstrack[i],bathalongtrack[i]);
-		fprintf(stderr,"dbg2        nss:       %d\n",nss);
-		if (verbose >= 3)
-		 for (i=0;i<nss;i++)
-		  fprintf(stderr,"dbg3        beam:%d   ss:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,ss[i],ssacrosstrack[i],ssalongtrack[i]);
-		}
-	if (verbose >= 2 && kind == MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"dbg2       comment:     \ndbg2       %s\n",
-			comment);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_dsl_struct *) store_ptr;
-
-	/* set data kind */
-	store->kind = kind;
-
-	/* insert data in structure */
-	if (store->kind == MB_DATA_DATA)
-		{
-		/* get time */
-		store->tv_sec = (int) time_d;
-		store->tv_usec = 1000000 * (time_d - (double) store->tv_sec);
-
-		/* get nav */
-		store->nav_x = navlon;
-		store->nav_y = navlat;
-
-		/* get heading */
-		store->heading = heading;
-
-		/* insert bathymetry values into storage arrays */
-		for (i=0;i<store->bat_num_bins;i++)
-			{
-			if (mb_beam_check_flag(beamflag[store->bat_num_bins - i - 1]))
-			    store->bat_port[i] = -bath[store->bat_num_bins - i - 1];
-			else
-			    store->bat_port[i] = bath[store->bat_num_bins - i - 1];
-			if (mb_beam_check_flag(beamflag[store->bat_num_bins + i]))
-			    store->bat_stbd[i] = -bath[store->bat_num_bins + i];
-			else
-			    store->bat_stbd[i] = bath[store->bat_num_bins + i];
-			}
-
-		/* insert sidescan values into storage arrays */
-		for (i=0;i<store->amp_num_samp;i++)
-			{
-			store->amp_port[i] = ss[store->amp_num_samp - i - 1];
-			store->amp_stbd[i] = ss[store->amp_num_samp + i];
-			}
-		}
-
-	/* insert comment in structure */
-	else if (store->kind == MB_DATA_COMMENT)
-		{
-		strncpy(store->comment,comment,79);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_dsl_ttimes(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, int *nbeams,
-	double *ttimes, double *angles,
-	double *angles_forward, double *angles_null,
-	double *heave, double *alongtrack_offset,
-	double *draft, double *ssv, int *error)
-{
-	char	*function_name = "mbsys_dsl_ttimes";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_dsl_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       ttimes:     %p\n",(void *)ttimes);
-		fprintf(stderr,"dbg2       angles_xtrk:%p\n",(void *)angles);
-		fprintf(stderr,"dbg2       angles_ltrk:%p\n",(void *)angles_forward);
-		fprintf(stderr,"dbg2       angles_null:%p\n",(void *)angles_null);
-		fprintf(stderr,"dbg2       heave:      %p\n",(void *)heave);
-		fprintf(stderr,"dbg2       ltrk_off:   %p\n",(void *)alongtrack_offset);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_dsl_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get nbeams */
-		*nbeams = 2 * store->bat_num_bins;
-		for (i=0;i<*nbeams;i++)
-			{
-			ttimes[i] = 0.0;
-			angles[i] = 0.0;
-			angles_forward[i] = 0.0;
-			angles_null[i] = angles[i];
-			heave[i] = 0.0;
-			alongtrack_offset[i] = 0.0;
-			}
-
-		/* get ssv */
-		*ssv = 0.0;
-		*draft = 0.0;
-
-		/* set status */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error == MB_ERROR_NO_ERROR)
-		{
-		fprintf(stderr,"dbg2       draft:      %f\n",*draft);
-		fprintf(stderr,"dbg2       ssv:        %f\n",*ssv);
-		fprintf(stderr,"dbg2       nbeams:     %d\n",*nbeams);
-		for (i=0;i<*nbeams;i++)
-			fprintf(stderr,"dbg2       beam %d: tt:%f  angle_xtrk:%f  angle_ltrk:%f  angle_null:%f  depth_off:%f  ltrk_off:%f\n",
-				i,ttimes[i],angles[i],
-				angles_forward[i],angles_null[i],
-				heave[i],alongtrack_offset[i]);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_dsl_detects(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, int *nbeams,
-	int *detects, int *error)
-{
-	char	*function_name = "mbsys_dsl_detects";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_dsl_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       detects:    %p\n",(void *)detects);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_dsl_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get nbeams */
-		*nbeams = 2 * store->bat_num_bins;
-		for (i=0;i<*nbeams;i++)
-			{
-			detects[i] = MB_DETECT_PHASE;
-			}
-
-		/* set status */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error == MB_ERROR_NO_ERROR)
-		{
-		fprintf(stderr,"dbg2       nbeams:     %d\n",*nbeams);
-		for (i=0;i<*nbeams;i++)
-			fprintf(stderr,"dbg2       beam %d: detect:%d\n",
-				i,detects[i]);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_dsl_extract_altitude(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, double *transducer_depth, double *altitude,
-	int *error)
-{
-	char	*function_name = "mbsys_dsl_extract_altitude";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_dsl_struct *store;
-	double	dx;
-	double	bath_best;
-	double	xtrack_min;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_dsl_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		*transducer_depth = store->depth;
-		bath_best = 0.0;
-		xtrack_min = 99999999.9;
-		dx = 0.5 * store->swath_width / store->bat_num_bins;
-		for (i=0;i<store->bat_num_bins;i++)
-		    {
-		    if (store->bat_port[i] > 0.0
-			&& dx * (i + 0.5) < xtrack_min)
-			{
-			xtrack_min = dx * (i + 0.5);
-			bath_best = store->bat_port[i];
-			}
-		    if (store->bat_stbd[i] > 0.0
-			&& dx * (i + 0.5) < xtrack_min)
-			{
-			xtrack_min = dx * (i + 0.5);
-			bath_best = store->bat_stbd[i];
-			}
-		    }
-		if (bath_best <= 0.0)
-		    {
-		    xtrack_min = 99999999.9;
-		    for (i=0;i<store->bat_num_bins;i++)
-			{
-			if (store->bat_port[i] != 0.0
-			    && dx * (i + 0.5) < xtrack_min)
-			    {
-			    xtrack_min = dx * (i + 0.5);
-			    bath_best = fabs(store->bat_port[i]);
-			    }
-			if (store->bat_stbd[i] != 0.0
-			    && dx * (i + 0.5) < xtrack_min)
-			    {
-			    xtrack_min = dx * (i + 0.5);
-			    bath_best = fabs(store->bat_stbd[i]);
-			    }
-			}
-		    }
-		*altitude = bath_best - *transducer_depth;
-
-		/* set status */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:              %d\n",*kind);
-		fprintf(stderr,"dbg2       transducer_depth:  %f\n",*transducer_depth);
-		fprintf(stderr,"dbg2       altitude:          %f\n",*altitude);
-		fprintf(stderr,"dbg2       error:             %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:            %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_dsl_extract_nav(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int time_i[7], double *time_d,
-		double *navlon, double *navlat,
-		double *speed, double *heading, double *draft,
-		double *roll, double *pitch, double *heave,
-		int *error)
-{
-	char	*function_name = "mbsys_dsl_extract_nav";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_dsl_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_dsl_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get time */
-		*time_d = store->tv_sec + 0.000001 * store->tv_usec;
-		mb_get_date(verbose,*time_d,time_i);
-
-		/* get navigation */
-		if (store->nav_x <= 360.0 && store->nav_x >= -360.0
-			&& store->nav_y <= 90.0 && store->nav_y >= -90.0)
-			{
-			*navlon = store->nav_x;
-			*navlat = store->nav_y;
-			}
-		else
-			{
-			*navlon = 0.0;
-			*navlat = 0.0;
-			}
-
-		/* get heading */
-		*heading = store->heading;
-
-		/* get speed  */
-		*speed = 0.0;
-
-		/* get draft  */
-		*draft = store->depth;
-
-		/* get roll pitch and heave */
-		*roll = store->roll;
-		*pitch = store->pitch;
-		*heave = 0.0;
-
-		/* print debug statements */
-		if (verbose >= 5)
-			{
-			fprintf(stderr,"\ndbg4  Data extracted by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  Extracted values:\n");
-			fprintf(stderr,"dbg4       kind:       %d\n",
-				*kind);
-			fprintf(stderr,"dbg4       error:      %d\n",
-				*error);
-			fprintf(stderr,"dbg4       time_i[0]:  %d\n",
-				time_i[0]);
-			fprintf(stderr,"dbg4       time_i[1]:  %d\n",
-				time_i[1]);
-			fprintf(stderr,"dbg4       time_i[2]:  %d\n",
-				time_i[2]);
-			fprintf(stderr,"dbg4       time_i[3]:  %d\n",
-				time_i[3]);
-			fprintf(stderr,"dbg4       time_i[4]:  %d\n",
-				time_i[4]);
-			fprintf(stderr,"dbg4       time_i[5]:  %d\n",
-				time_i[5]);
-			fprintf(stderr,"dbg4       time_i[6]:  %d\n",
-				time_i[6]);
-			fprintf(stderr,"dbg4       time_d:     %f\n",
-				*time_d);
-			fprintf(stderr,"dbg4       longitude:  %f\n",
-				*navlon);
-			fprintf(stderr,"dbg4       latitude:   %f\n",
-				*navlat);
-			fprintf(stderr,"dbg4       speed:      %f\n",
-				*speed);
-			fprintf(stderr,"dbg4       heading:    %f\n",
-				*heading);
-			fprintf(stderr,"dbg4       draft:      %f\n",
-				*draft);
-			fprintf(stderr,"dbg4       roll:       %f\n",
-				*roll);
-			fprintf(stderr,"dbg4       pitch:      %f\n",
-				*pitch);
-			fprintf(stderr,"dbg4       heave:      %f\n",
-				*heave);
-			}
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind == MB_DATA_DATA)
-		{
-		fprintf(stderr,"dbg2       time_i[0]:     %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:     %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:     %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:     %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:     %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:     %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:     %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:        %f\n",*time_d);
-		fprintf(stderr,"dbg2       longitude:     %f\n",*navlon);
-		fprintf(stderr,"dbg2       latitude:      %f\n",*navlat);
-		fprintf(stderr,"dbg2       speed:         %f\n",*speed);
-		fprintf(stderr,"dbg2       heading:       %f\n",*heading);
-		fprintf(stderr,"dbg2       draft:         %f\n",*draft);
-		fprintf(stderr,"dbg2       roll:          %f\n",*roll);
-		fprintf(stderr,"dbg2       pitch:         %f\n",*pitch);
-		fprintf(stderr,"dbg2       heave:         %f\n",*heave);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_dsl_insert_nav(int verbose, void *mbio_ptr, void *store_ptr,
-		int time_i[7], double time_d,
-		double navlon, double navlat,
-		double speed, double heading, double draft,
-		double roll, double pitch, double heave,
-		int *error)
-{
-	char	*function_name = "mbsys_dsl_insert_nav";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_dsl_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       time_i[0]:  %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:  %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:  %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:  %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:  %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:  %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:  %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:     %f\n",time_d);
-		fprintf(stderr,"dbg2       navlon:     %f\n",navlon);
-		fprintf(stderr,"dbg2       navlat:     %f\n",navlat);
-		fprintf(stderr,"dbg2       speed:      %f\n",speed);
-		fprintf(stderr,"dbg2       heading:    %f\n",heading);
-		fprintf(stderr,"dbg2       draft:      %f\n",draft);
-		fprintf(stderr,"dbg2       roll:       %f\n",roll);
-		fprintf(stderr,"dbg2       pitch:      %f\n",pitch);
-		fprintf(stderr,"dbg2       heave:      %f\n",heave);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_dsl_struct *) store_ptr;
-
-	/* insert data in structure */
-	if (store->kind == MB_DATA_DATA)
-		{
-		/* get time */
-		store->tv_sec = (int) time_d;
-		store->tv_usec = 1000000 * (time_d - (double) store->tv_sec);
-
-		/* get nav */
-		store->nav_x = navlon;
-		store->nav_y = navlat;
-
-		/* get heading */
-		store->heading = heading;
-
-		/* get draft  */
-		store->depth = draft;
-
-		/* get roll pitch and heave */
-		store->roll = roll;
-		store->pitch = pitch;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_dsl_copy(int verbose, void *mbio_ptr,
-			void *store_ptr, void *copy_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_dsl_copy";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_dsl_struct *store;
-	struct mbsys_dsl_struct *copy;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       copy_ptr:   %p\n",(void *)copy_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointers */
-	store = (struct mbsys_dsl_struct *) store_ptr;
-	copy = (struct mbsys_dsl_struct *) copy_ptr;
-
-	/* copy the structure */
-	*copy = *store;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mbsys_dsl.h b/src/mbio/mbsys_dsl.h
deleted file mode 100644
index 95f2e27..0000000
--- a/src/mbio/mbsys_dsl.h
+++ /dev/null
@@ -1,257 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbsys_dsl.h	8/5/94
- *	$Id: mbsys_dsl.h 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1996-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbsys_dsl.h defines the data structures used by MBIO functions
- * to store data from the DSL AMS-120 sonar system. This is a 120 khz
- * deep-towed sonar which produces both sidescan and bathymetry.
- * The data formats used to store the DSL AMS-120 data are:
- *      MBF_DSL120PF : MBIO ID 111
- *      MBF_DSL120SF : MBIO ID 112
- *
- *
- * Author:	D. W. Caress
- * Date:	August 5, 1996
- *
- * $Log: mbsys_dsl.h,v $
- * Revision 5.6  2005/11/05 00:48:03  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.5  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.4  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.3  2002/07/20 20:42:40  caress
- * Release 5.0.beta20
- *
- * Revision 5.2  2001/07/20 00:32:54  caress
- * Release 5.0.beta03
- *
- * Revision 5.1  2001/01/22  07:43:34  caress
- * Version 5.0.beta01
- *
- * Revision 5.0  2000/12/01  22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.3  2000/09/30  06:31:19  caress
- * Snapshot for Dale.
- *
- * Revision 4.2  1998/10/05  18:32:27  caress
- * MB-System version 4.6beta
- *
- * Revision 4.1  1997/04/21  17:02:07  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.1  1997/04/21  17:02:07  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.1  1997/04/17  15:07:36  caress
- * MB-System 4.5 Beta Release
- *
- * Revision 4.0  1996/08/26  17:29:56  caress
- * Release 4.4 revision.
- *
- * Revision 1.1  1996/08/26  17:24:56  caress
- * Initial revision
- *
- *
- */
-/*
- * Notes on the MBSYS_DSL data structure:
- *   1. The DSL processing system used a parallel file scheme
- *      in which bathymetry, sidescan, and navigation are kept
- *      in separate files. Some examples of the filenames are:
- *         DSL120.940630_1100.bat.dat	- bathymetry
- *         DSL120.940630_1100.amp.dat	- sidescan
- *         DSL120.940630_1100.nav	- navigation
- *   2. The DSL parallel file scheme is supported under MB-System
- *      data format 111 (MBF_DSL120PF); a single file scheme is
- *      supported under data format 112 (MBF_DSL120SF). The
- *      single file scheme is within the DSL format specification.
- *   3. The bathymetry and sidescan data are stored in binary
- *      data structures; the navigation is stored in ASCII.
- *   4. The DSL format supports arbitrary numbers of bathymetry
- *      and sidescan values. The MB-System implementation has
- *      maximum numbers of values hardwired in the #defines
- *      below.
- *   5. The bathymetry and sidescan data have navigation
- *      fields,  but these navigation values typically repeat
- *      for many pings, often being the same for entire files.
- *      The separate navigation files contain the post-processed
- *      navigation with distinct values for each ping.
- *   6. The original navigation values supplied by WHOI/DSL
- *      so far are in projected eastings and northings rather
- *      than in longitude and latitude. Since MB-System only
- *      works with longitude and latitude, a special program
- *      will need to be used to translate the navigation to
- *      longitude and latitude.
- *   7. Due to the above problem, the following scheme will
- *      be used to handle MBF_DSL120DT data in MB-System:
- *        a) Run a perl macro called mbdslnavfix on the
- *           DSL120.*.nav files,  producing DSL.*.mbnav
- *           files in a format understood by mbmerge.
- *        b) Run mbmerge on the DSL120.*.bat.dat and DSL120.*.amp.dat
- *           files to merge the navigation from the DSL120.*.mbnav
- *           in with the bathymetry and sidescan data.
- *   8. The parallel file structure is difficult to deal with
- *      in the MB-System world where programs expect a single
- *      input and a single output file name. Handling the two
- *      files (bat.dat and amp.dat) will be handled in low level
- *      i/o routines. If the input file name has a "bat" in it,
- *      the code will attempt to open a second file with the
- *      same name except that "amp" is substituted for "bat".
- *      If the specified input file has "amp" in it,  then the
- *      second file will have "bat". The same will be true for
- *      the output files.
- *   9. The comment records reside only in the "bat" files in
- *      the parallel file scheme of format 111.
- *      The comment records are an MB-System extension to the
- *      DSL format. The program mbcopy can be used to strip
- *      the comments out of the data files prior to reusing
- *      DSL processing software.
- *
- */
-
-/* maximum number of beams and pixels */
-#define	MBSYS_DSL_MAXBEAMS_SIDE	    1024
-#define	MBSYS_DSL_MAXBEAMS	    2 * MBSYS_DSL_MAXBEAMS_SIDE
-#define	MBSYS_DSL_MAXPIXELS_SIDE    4096
-#define	MBSYS_DSL_MAXPIXELS	    2 * MBSYS_DSL_MAXPIXELS_SIDE
-#define	MBSYS_DSL_COMMENT_LENGTH	80
-
-/* datagram types */
-#define	DSL_NONE		0x00000000L
-#define	DSL_HEADER		0x44534C20L	/* "DSL " */
-#define	DSL_BATH		0x42415448L	/* "BATH" */
-#define	DSL_AMP			0x414D5020L	/* "AMP " */
-#define	DSL_COMMENT		0x434f4d4dL	/* "COMM" */
-
-/* internal data structure */
-struct mbsys_dsl_struct
-	{
-	/* type of data record */
-	int	kind;			/* Data vs Comment */
-
-	/* record header */
-	int	rec_type;		/* always "DSL " */
-	int	rec_len;
-	int	rec_hdr_len;
-	unsigned int p_flags;		/* processing flags */
-	int	num_data_types;		/* number of data types in rec */
-   	int	ping;			/* ping number */
-   	char	sonar_cmd[4];		/* sonar parameters */
-   	char	time_stamp[24];		/* ascii event time */
-  	float	nav_x;			/* x position */
-   	float	nav_y;			/* y position */
-   	float	depth;			/* depth - meters */
-   	float	heading;		/* heading of vehicle - degrees */
-   	float	pitch;			/* pitch - degrees */
-   	float	roll;			/* roll - degrees */
-   	float	alt;			/* altitude - meters */
-   	float	ang_offset;	 	/* pointing ang relative to nose - deg*/
-   	int	transmit_pwr;  		/* transmit power decibels */
-   	int	gain_port;		/* db - not sure if belongs here */
-   	int	gain_starbd;		/* db - not sure if belongs here */
-   	float	pulse_width;		/* pulse width */
-   	int	swath_width;		/* meters */
-   	char	side;			/* 0 - port, 1 - stbd for fwd scan */
-   	char	swapped;		/* data,header: 00-PC 01-SunHdr 11-Sun*/
-	int	tv_sec;			/* seconds */
-	int	tv_usec;		/* and microseconds */
-   	short	digitalinterface;       /* digital interface: 0,1,or 2 -
-					 * must be specified in config file */
-    	short reserved[5];
-
-	/* bathymetry record */
-	int	bat_type;		/* always "BATH" */
-	int	bat_len;
-	int	bat_hdr_len;
-	int	bat_num_bins;
-	float	bat_sampleSize;
-	unsigned int bat_p_flags;
-	float	bat_max_range; /* meters */
-	int	bat_future[9];
-	float	bat_port[MBSYS_DSL_MAXBEAMS_SIDE];
-	float	bat_stbd[MBSYS_DSL_MAXBEAMS_SIDE];
-
-	/* amplitude record */
-	int	amp_type;		/* always "AMP " */
-	int	amp_len;
-	int	amp_hdr_len;
-	int	amp_num_samp;
-	float	amp_sampleSize;
-	unsigned int amp_p_flags; /* offset/slr, ... */
-	float	amp_max_range; /* meters */
-	int	amp_channel;     /* 1-upper/0-lower */
-	int	amp_future[8];
-	float	amp_port[MBSYS_DSL_MAXPIXELS];
-	float	amp_stbd[MBSYS_DSL_MAXPIXELS_SIDE];
-
-	/* comment */
-	char	comment[MBSYS_DSL_COMMENT_LENGTH];
-	};
-
-/* system specific function prototypes */
-int mbsys_dsl_alloc(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error);
-int mbsys_dsl_deall(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error);
-int mbsys_dsl_dimensions(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int *nbath, int *namp, int *nss, int *error);
-int mbsys_dsl_extract(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int time_i[7], double *time_d,
-			double *navlon, double *navlat,
-			double *speed, double *heading,
-			int *nbath, int *namp, int *nss,
-			char *beamflag, double *bath, double *amp,
-			double *bathacrosstrack, double *bathalongtrack,
-			double *ss, double *ssacrosstrack, double *ssalongtrack,
-			char *comment, int *error);
-int mbsys_dsl_insert(int verbose, void *mbio_ptr, void *store_ptr,
-			int kind, int time_i[7], double time_d,
-			double navlon, double navlat,
-			double speed, double heading,
-			int nbath, int namp, int nss,
-			char *beamflag, double *bath, double *amp,
-			double *bathacrosstrack, double *bathalongtrack,
-			double *ss, double *ssacrosstrack, double *ssalongtrack,
-			char *comment, int *error);
-int mbsys_dsl_ttimes(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int *nbeams,
-			double *ttimes, double *angles,
-			double *angles_forward, double *angles_null,
-			double *heave, double *alongtrack_offset,
-			double *draft, double *ssv, int *error);
-int mbsys_dsl_detects(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int *nbeams, int *detects, int *error);
-int mbsys_dsl_extract_altitude(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, double *transducer_depth, double *altitude,
-			int *error);
-int mbsys_dsl_extract_nav(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int time_i[7], double *time_d,
-			double *navlon, double *navlat,
-			double *speed, double *heading, double *draft,
-			double *roll, double *pitch, double *heave,
-			int *error);
-int mbsys_dsl_insert_nav(int verbose, void *mbio_ptr, void *store_ptr,
-			int time_i[7], double time_d,
-			double navlon, double navlat,
-			double speed, double heading, double draft,
-			double roll, double pitch, double heave,
-			int *error);
-int mbsys_dsl_copy(int verbose, void *mbio_ptr,
-			void *store_ptr, void *copy_ptr,
-			int *error);
diff --git a/src/mbio/mbsys_elac.c b/src/mbio/mbsys_elac.c
deleted file mode 100644
index 841f8e1..0000000
--- a/src/mbio/mbsys_elac.c
+++ /dev/null
@@ -1,1569 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbsys_elac.c	3.00	8/20/94
- *	$Id: mbsys_elac.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1994-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbsys_elac.c contains the functions for handling the data structure
- * used by MBIO functions to store data from Reson SEABAT 9001
- * multibeam sonar systems.
- * The data formats which are commonly used to store EM-12
- * data in files include
- *      MBF_BCHRTUNB : MBIO ID 91
- *
- * Author:	D. W. Caress
- * Date:	August 20, 1994
- *
- * $Log: mbsys_elac.c,v $
- * Revision 5.7  2005/11/05 00:48:04  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.6  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.5  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.4  2002/07/20 20:42:40  caress
- * Release 5.0.beta20
- *
- * Revision 5.3  2001/08/25 00:54:13  caress
- * Adding beamwidth values to extract functions.
- *
- * Revision 5.2  2001/07/20  00:32:54  caress
- * Release 5.0.beta03
- *
- * Revision 5.1  2001/01/22  07:43:34  caress
- * Version 5.0.beta01
- *
- * Revision 5.0  2000/12/01  22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.16  2000/10/11  01:03:21  caress
- * Convert to ANSI C
- *
- * Revision 4.15  2000/09/30  06:32:52  caress
- * Snapshot for Dale.
- *
- * Revision 4.14  1999/03/31  18:11:35  caress
- * MB-System 4.6beta7
- *
- * Revision 4.13  1998/10/05  17:46:15  caress
- * MB-System version 4.6beta
- *
- * Revision 4.12  1997/09/15  19:06:40  caress
- * Real Version 4.5
- *
- * Revision 4.11  1997/07/25  14:19:53  caress
- * Version 4.5beta2.
- * Much mucking, particularly with Simrad formats.
- *
- * Revision 4.10  1997/04/21  17:02:07  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.9  1996/08/05  15:21:58  caress
- * Just redid i/o for Simrad sonars, including adding EM12S and EM121 support.
- *
- * Revision 4.9  1996/08/05  15:21:58  caress
- * Just redid i/o for Simrad sonars, including adding EM12S and EM121 support.
- *
- * Revision 4.8  1996/04/22  13:21:19  caress
- * Now have DTR and MIN/MAX defines in mb_define.h
- *
- * Revision 4.7  1996/04/22  10:57:09  caress
- * DTR define now in mb_io.h
- *
- * Revision 4.6  1995/11/27  21:50:06  caress
- * New version of mb_ttimes with ssv and angles_null.
- *
- * Revision 4.5  1995/09/28  18:10:48  caress
- * Various bug fixes working toward release 4.3.
- *
- * Revision 4.4  1995/08/17  14:41:09  caress
- * Revision for release 4.3.
- *
- * Revision 4.3  1995/07/13  19:13:36  caress
- * Intermediate check-in during major bug-fixing flail.
- *
- * Revision 4.2  1995/03/06  19:38:54  caress
- * Changed include strings.h to string.h for POSIX compliance.
- *
- * Revision 4.1  1994/11/09  21:40:34  caress
- * Changed ttimes extraction routines to handle forward beam angles
- * so that alongtrack distances can be calculated.
- *
- * Revision 4.0  1994/10/21  12:34:59  caress
- * Release V4.0
- *
- * Revision 1.1  1994/10/21  12:20:01  caress
- * Initial revision
- *
- *
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mb_define.h"
-#include "mbsys_elac.h"
-
-static char rcs_id[]="$Id: mbsys_elac.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mbsys_elac_alloc(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_elac_alloc";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_elac_struct *store;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* allocate memory for data structure */
-	status = mb_malloc(verbose,sizeof(struct mbsys_elac_struct),
-				store_ptr,error);
-
-	/* get data structure pointer */
-	store = (struct mbsys_elac_struct *) *store_ptr;
-
-	/* initialize everything */
-	store->kind = MB_DATA_NONE;
-	store->sonar = MBSYS_ELAC_UNKNOWN;
-
-	/* parameter telegram */
-	store->par_year = 0;
-	store->par_month = 0;
-	store->par_day = 0;
-	store->par_hour = 0;
-	store->par_minute = 0;
-	store->par_second = 0;
-	store->par_hundredth_sec = 0;
-	store->par_thousandth_sec = 0;
-	store->roll_offset = 0;		/* roll offset (degrees) */
-	store->pitch_offset = 0;	/* pitch offset (degrees) */
-	store->heading_offset = 0;	/* heading offset (degrees) */
-	store->time_delay = 0;		/* positioning system delay (sec) */
-	store->transducer_port_height = 0;
-	store->transducer_starboard_height = 0;
-	store->transducer_port_depth = 0;
-	store->transducer_starboard_depth = 0;
-	store->transducer_port_x = 0;
-	store->transducer_starboard_x = 0;
-	store->transducer_port_y = 0;
-	store->transducer_starboard_y = 0;
-	store->transducer_port_error = 0;
-	store->transducer_starboard_error = 0;
-	store->antenna_height = 0;
-	store->antenna_x = 0;
-	store->antenna_y = 0;
-	store->vru_height = 0;
-	store->vru_x = 0;
-	store->vru_y = 0;
-	store->heave_offset = 0;
-	store->line_number = 0;
-	store->start_or_stop = 0;
-	store->transducer_serial_number = 0;
-	for (i=0;i<MBSYS_ELAC_COMMENT_LENGTH;i++)
-		store->comment[i] = '\0';
-
-	/* position (position telegrams) */
-	store->pos_year = 0;
-	store->pos_month = 0;
-	store->pos_day = 0;
-	store->pos_hour = 0;
-	store->pos_minute = 0;
-	store->pos_second = 0;
-	store->pos_hundredth_sec = 0;
-	store->pos_thousandth_sec = 0;
-	store->pos_latitude = 0;
-	store->pos_longitude = 0;
-	store->utm_northing = 0;
-	store->utm_easting = 0;
-	store->utm_zone_lon = 0;
-	store->utm_zone = 0;
-	store->hemisphere = 0;
-	store->ellipsoid = 0;
-	store->pos_spare = 0;
-	store->semi_major_axis = 0;
-	store->other_quality = 0;
-
-	/* sound velocity profile */
-	store->svp_year = 0;
-	store->svp_month = 0;
-	store->svp_day = 0;
-	store->svp_hour = 0;
-	store->svp_minute = 0;
-	store->svp_second = 0;
-	store->svp_hundredth_sec = 0;
-	store->svp_thousandth_sec = 0;
-	store->svp_num = 0;
-	for (i=0;i<500;i++)
-		{
-		store->svp_depth[i] = 0; /* 0.1 meters */
-		store->svp_vel[i] = 0;	/* 0.1 meters/sec */
-		}
-
-	/* depth telegram */
-	store->ping_num = 0;
-	store->sound_vel = 0;
-	store->mode = 0;
-	store->pulse_length = 0;
-	store->source_power = 0;
-	store->receiver_gain = 0;
-	store->profile_num = 0;
-	store->beams_bath = 0;
-	for (i=0;i<7;i++)
-		{
-		store->profile[i].year = 0;
-		store->profile[i].month = 0;
-		store->profile[i].day = 0;
-		store->profile[i].hour = 0;
-		store->profile[i].minute = 0;
-		store->profile[i].second = 0;
-		store->profile[i].hundredth_sec = 0;
-		store->profile[i].thousandth_sec = 0;
-		store->profile[i].roll = 0;
-		store->profile[i].pitch = 0;
-		store->profile[i].heading = 0;
-		store->profile[i].heave = 0;
-		for (j=0;j<8;j++)
-			{
-			store->profile[i].bath[j] = 0;
-			store->profile[i].bath_acrosstrack[j] = 0;
-			store->profile[i].bath_alongtrack[j] = 0;
-			store->profile[i].tt[j] = 0;
-			store->profile[i].angle[j] = 0;
-			store->profile[i].quality[j] = 0;
-			store->profile[i].amp[j] = 0;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)*store_ptr);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_elac_deall(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_elac_deall";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)*store_ptr);
-		}
-
-	/* deallocate memory for data structure */
-	status = mb_free(verbose,store_ptr,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_elac_dimensions(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int *nbath, int *namp, int *nss, int *error)
-{
-	char	*function_name = "mbsys_elac_dimensions";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_elac_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_elac_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get beam and pixel numbers */
-		*nbath = store->beams_bath;
-		*namp = store->beams_bath;
-		*nss = 0;
-		}
-	else
-		{
-		/* get beam and pixel numbers */
-		*nbath = 0;
-		*namp = 0;
-		*nss = 0;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		fprintf(stderr,"dbg2       nbath:      %d\n",*nbath);
-		fprintf(stderr,"dbg2        namp:      %d\n",*namp);
-		fprintf(stderr,"dbg2        nss:       %d\n",*nss);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_elac_extract(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int time_i[7], double *time_d,
-		double *navlon, double *navlat,
-		double *speed, double *heading,
-		int *nbath, int *namp, int *nss,
-		char *beamflag, double *bath, double *amp,
-		double *bathacrosstrack, double *bathalongtrack,
-		double *ss, double *ssacrosstrack, double *ssalongtrack,
-		char *comment, int *error)
-{
-	char	*function_name = "mbsys_elac_extract";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_elac_struct *store;
-	double	depthscale, dacrscale, daloscale,reflscale;
-	int	ibeam;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_elac_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get time */
-		mb_fix_y2k(verbose, store->profile[0].year, &time_i[0]);
-		time_i[1] = store->profile[0].month;
-		time_i[2] = store->profile[0].day;
-		time_i[3] = store->profile[0].hour;
-		time_i[4] = store->profile[0].minute;
-		time_i[5] = store->profile[0].second;
-		time_i[6] = 10000*store->profile[0].hundredth_sec
-			+ 100*store->profile[0].thousandth_sec;
-		mb_get_time(verbose,time_i,time_d);
-
-		/* get navigation */
-		*navlon = store->profile[0].longitude*0.00000009;
-		*navlat = store->profile[0].latitude*0.00000009;
-
-		/* get heading */
-		*heading = 0.01*store->profile[0].heading;
-
-		/* get speed  */
-		*speed = 0.0;
-
-		/* set beamwidths in mb_io structure */
-		mb_io_ptr->beamwidth_ltrack = 6.0;
-		mb_io_ptr->beamwidth_xtrack = 3.0;
-
-		/* read distance and depth values into storage arrays */
-		*nbath = store->beams_bath;
-		*namp = store->beams_bath;
-		*nss = 0;
-		depthscale = 0.01;
-		dacrscale  = -0.02;
-		daloscale  = 0.01;
-		reflscale  = 1.0;
-		for (i=0;i<store->profile_num;i++)
-		  for (j=0;j<8;j++)
-			{
-			ibeam = (store->profile_num - 1 - i)
-					+ store->profile_num*(7 - j);
-			if (store->profile[i].quality[j] == 1)
-			    beamflag[ibeam]
-				= MB_FLAG_NONE;
-			else if (store->profile[i].quality[j] < 8)
-			    beamflag[ibeam]
-				= MB_FLAG_SONAR + MB_FLAG_FLAG;
-			else if (store->profile[i].quality[j] == 8)
-			    beamflag[ibeam]
-				= MB_FLAG_NULL;
-			else if (store->profile[i].quality[j] == 10)
-			    beamflag[ibeam]
-				= MB_FLAG_MANUAL + MB_FLAG_FLAG;
-			else if (store->profile[i].quality[j] == 20)
-			    beamflag[ibeam]
-				= MB_FLAG_FILTER + MB_FLAG_FLAG;
-			else
-			    beamflag[ibeam]
-				= MB_FLAG_NULL;
-			bath[ibeam] = depthscale*store->profile[i].bath[j];
-			bathacrosstrack[ibeam] = dacrscale
-				*store->profile[i].bath_acrosstrack[j];
-			bathalongtrack[ibeam] = daloscale
-				*store->profile[i].bath_alongtrack[j];
-			amp[ibeam] = reflscale*store->profile[i].amp[j];
-			}
-
-		/* print debug statements */
-		if (verbose >= 5)
-			{
-			fprintf(stderr,"\ndbg4  Data extracted by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  Extracted values:\n");
-			fprintf(stderr,"dbg4       kind:       %d\n",
-				*kind);
-			fprintf(stderr,"dbg4       error:      %d\n",
-				*error);
-			fprintf(stderr,"dbg4       time_i[0]:  %d\n",
-				time_i[0]);
-			fprintf(stderr,"dbg4       time_i[1]:  %d\n",
-				time_i[1]);
-			fprintf(stderr,"dbg4       time_i[2]:  %d\n",
-				time_i[2]);
-			fprintf(stderr,"dbg4       time_i[3]:  %d\n",
-				time_i[3]);
-			fprintf(stderr,"dbg4       time_i[4]:  %d\n",
-				time_i[4]);
-			fprintf(stderr,"dbg4       time_i[5]:  %d\n",
-				time_i[5]);
-			fprintf(stderr,"dbg4       time_i[6]:  %d\n",
-				time_i[6]);
-			fprintf(stderr,"dbg4       time_d:     %f\n",
-				*time_d);
-			fprintf(stderr,"dbg4       longitude:  %f\n",
-				*navlon);
-			fprintf(stderr,"dbg4       latitude:   %f\n",
-				*navlat);
-			fprintf(stderr,"dbg4       speed:      %f\n",
-				*speed);
-			fprintf(stderr,"dbg4       heading:    %f\n",
-				*heading);
-			fprintf(stderr,"dbg4       nbath:      %d\n",
-				*nbath);
-			for (i=0;i<*nbath;i++)
-			  fprintf(stderr,"dbg4       beam:%d  flag:%3d  bath:%f  acrosstrack:%f  alongtrack:%f\n",
-				i,beamflag[i],bath[i],bathacrosstrack[i],bathalongtrack[i]);
-			fprintf(stderr,"dbg4        namp:     %d\n",
-				*namp);
-			for (i=0;i<*namp;i++)
-			  fprintf(stderr,"dbg4        beam:%d   amp:%f  acrosstrack:%f  alongtrack:%f\n",
-				i,amp[i],bathacrosstrack[i],bathalongtrack[i]);
-			}
-
-		/* done translating values */
-
-		}
-
-	/* extract comment from structure */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* copy comment */
-		strcpy(comment,store->comment);
-
-		/* print debug statements */
-		if (verbose >= 4)
-			{
-			fprintf(stderr,"\ndbg4  New ping read by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  New ping values:\n");
-			fprintf(stderr,"dbg4       error:      %d\n",
-				*error);
-			fprintf(stderr,"dbg4       comment:    %s\n",
-				comment);
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind == MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"dbg2       comment:     \ndbg2       %s\n",
-			comment);
-		}
-	else if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind != MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"dbg2       time_i[0]:     %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:     %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:     %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:     %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:     %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:     %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:     %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:        %f\n",*time_d);
-		fprintf(stderr,"dbg2       longitude:     %f\n",*navlon);
-		fprintf(stderr,"dbg2       latitude:      %f\n",*navlat);
-		fprintf(stderr,"dbg2       speed:         %f\n",*speed);
-		fprintf(stderr,"dbg2       heading:       %f\n",*heading);
-		}
-	if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind == MB_DATA_DATA)
-		{
-		fprintf(stderr,"dbg2       nbath:      %d\n",
-			*nbath);
-		for (i=0;i<*nbath;i++)
-		  fprintf(stderr,"dbg2       beam:%d  flag:%3d  bath:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,beamflag[i],bath[i],
-			bathacrosstrack[i],bathalongtrack[i]);
-		fprintf(stderr,"dbg2        namp:     %d\n",
-			*namp);
-		for (i=0;i<*namp;i++)
-		  fprintf(stderr,"dbg2       beam:%d   amp:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,amp[i],bathacrosstrack[i],bathalongtrack[i]);
-		fprintf(stderr,"dbg2        nss:      %d\n",
-			*nss);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_elac_insert(int verbose, void *mbio_ptr, void *store_ptr,
-		int kind, int time_i[7], double time_d,
-		double navlon, double navlat,
-		double speed, double heading,
-		int nbath, int namp, int nss,
-		char *beamflag, double *bath, double *amp,
-		double *bathacrosstrack, double *bathalongtrack,
-		double *ss, double *ssacrosstrack, double *ssalongtrack,
-		char *comment, int *error)
-{
-	char	*function_name = "mbsys_elac_insert";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_elac_struct *store;
-	double	depthscale, dacrscale,daloscale,reflscale;
-	int	ibeam;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       kind:       %d\n",kind);
-		}
-	if (verbose >= 2 && (kind == MB_DATA_DATA || kind == MB_DATA_NAV))
-		{
-		fprintf(stderr,"dbg2       time_i[0]:  %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:  %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:  %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:  %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:  %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:  %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:  %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:     %f\n",time_d);
-		fprintf(stderr,"dbg2       navlon:     %f\n",navlon);
-		fprintf(stderr,"dbg2       navlat:     %f\n",navlat);
-		fprintf(stderr,"dbg2       speed:      %f\n",speed);
-		fprintf(stderr,"dbg2       heading:    %f\n",heading);
-		}
-	if (verbose >= 2 && kind == MB_DATA_DATA)
-		{
-		fprintf(stderr,"dbg2       nbath:      %d\n",nbath);
-		if (verbose >= 3)
-		 for (i=0;i<nbath;i++)
-		  fprintf(stderr,"dbg3       beam:%d  flag:%3d  bath:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,beamflag[i],bath[i],
-			bathacrosstrack[i],bathalongtrack[i]);
-		fprintf(stderr,"dbg2       namp:       %d\n",namp);
-		if (verbose >= 3)
-		 for (i=0;i<namp;i++)
-		  fprintf(stderr,"dbg3        beam:%d   amp:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,amp[i],bathacrosstrack[i],bathalongtrack[i]);
-		}
-	if (verbose >= 2 && kind == MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"dbg2       comment:     \ndbg2       %s\n",
-			comment);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_elac_struct *) store_ptr;
-
-	/* set data kind */
-	store->kind = kind;
-
-	/* insert data in structure */
-	if (store->kind == MB_DATA_DATA)
-		{
-		/* get time */
-		mb_unfix_y2k(verbose, time_i[0], &store->profile[0].year);
-		store->profile[0].month = time_i[1];
-		store->profile[0].day = time_i[2];
-		store->profile[0].hour = time_i[3];
-		store->profile[0].minute = time_i[4];
-		store->profile[0].second = time_i[5];
-		store->profile[0].hundredth_sec = time_i[6]/10000;
-		store->profile[0].thousandth_sec
-			= (time_i[6]
-			- 10000*store->profile[0].hundredth_sec)/100;
-
-		/*get navigation */
-		store->profile[0].longitude = (int) (navlon*11111111.0);
-		store->profile[0].latitude = (int) (navlat*11111111.0);
-
-		/* get heading */
-		store->profile[0].heading = (int) (heading * 100);
-
-		/* insert distance and depth values into storage arrays */
-		if (store->beams_bath == nbath)
-			{
-			depthscale = 0.01;
-			dacrscale  = -0.02;
-			daloscale  = 0.01;
-			reflscale  = 1.0;
-			for (i=0;i<store->profile_num;i++)
-			  for (j=0;j<8;j++)
-				{
-				ibeam = (store->profile_num - 1 - i)
-					+ store->profile_num*(7 - j);
-				if (mb_beam_check_flag(beamflag[i]))
-				    {
-				    if (mb_beam_check_flag_null(beamflag[i]))
-					store->profile[i].quality[j] = 8;
-				    else if (mb_beam_check_flag_manual(beamflag[i]))
-					store->profile[i].quality[j] = 10;
-				    else if (mb_beam_check_flag_filter(beamflag[i]))
-					store->profile[i].quality[j] = 20;
-				    else if (store->profile[i].quality[j] == 1)
-					store->profile[i].quality[j] = 7;
-				    }
-				else
-				    store->profile[i].quality[j] = 1;
-				store->profile[i].bath[j]
-					= bath[ibeam]/depthscale;
-				store->profile[i].bath_acrosstrack[j]
-					= bathacrosstrack[ibeam]/dacrscale;
-				store->profile[i].bath_alongtrack[j]
-					= bathalongtrack[ibeam]/daloscale;
-				store->profile[i].amp[j] = amp[ibeam]/reflscale;
-				}
-
-			}
-		}
-
-	/* insert comment in structure */
-	else if (store->kind == MB_DATA_COMMENT)
-		{
-		strncpy(store->comment,comment,199);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_elac_ttimes(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, int *nbeams,
-	double *ttimes, double *angles,
-	double *angles_forward, double *angles_null,
-	double *heave, double *alongtrack_offset,
-	double *draft, double *ssv, int *error)
-{
-	char	*function_name = "mbsys_elac_ttimes";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_elac_struct *store;
-	double	daloscale, ttscale, angscale;
-	int	ibeam;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       ttimes:     %p\n",(void *)ttimes);
-		fprintf(stderr,"dbg2       angles_xtrk:%p\n",(void *)angles);
-		fprintf(stderr,"dbg2       angles_ltrk:%p\n",(void *)angles_forward);
-		fprintf(stderr,"dbg2       angles_null:%p\n",(void *)angles_null);
-		fprintf(stderr,"dbg2       heave:      %p\n",(void *)heave);
-		fprintf(stderr,"dbg2       ltrk_off:   %p\n",(void *)alongtrack_offset);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_elac_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get nbeams */
-		*nbeams = store->beams_bath;
-
-		/* get draft */
-		/* *draft = 0.005 * (store->transducer_starboard_depth
-				    + store->transducer_port_depth); */
-		*draft = 0.0; /* parameter records only found
-				    sporadically */
-
-		/* get ssv */
-		*ssv = store->sound_vel;
-		if (*ssv < 1400.0 || *ssv > 1600.0)
-			*ssv = 1480.0; /* hard wired for UNB MB course 96 */
-
-		/* get travel times, angles */
-		daloscale  = 0.01;
-		ttscale = 0.0001;
-		angscale = 0.005;
-		for (i=0;i<store->profile_num;i++)
-		  for (j=0;j<8;j++)
-			{
-			ibeam = (store->profile_num - 1 - i)
-					+ store->profile_num*(7 - j);
-			ttimes[ibeam] = ttscale*store->profile[i].tt[j];
-			angles[ibeam] = angscale*store->profile[i].angle[j];
-			if (angles[ibeam] < 0.0)
-				{
-				angles[ibeam] = -angles[ibeam];
-				angles_forward[ibeam] = 0.0;
-				angles_null[ibeam] = 30.0
-					+ angscale
-					* store->transducer_port_error;
-				}
-			else
-				{
-				angles_forward[ibeam] = 180.0;
-				angles_null[ibeam] = 30.0
-					+ angscale
-					* store->transducer_starboard_error;
-				}
-			heave[ibeam] = 0.001 * store->profile[i].heave;
-			alongtrack_offset[ibeam] = daloscale
-				*store->profile[i].bath_alongtrack[j];
-			}
-
-		/* set status */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error == MB_ERROR_NO_ERROR)
-		{
-		fprintf(stderr,"dbg2       draft:      %f\n",*draft);
-		fprintf(stderr,"dbg2       ssv:        %f\n",*ssv);
-		fprintf(stderr,"dbg2       nbeams:     %d\n",*nbeams);
-		for (i=0;i<*nbeams;i++)
-			fprintf(stderr,"dbg2       beam %d: tt:%f angle_xtrk:%f  angle_ltrk:%f  angle_null:%f depth_off:%f  ltrk_off:%f\n",
-				i,ttimes[i],angles[i],
-				angles_forward[i],angles_null[i],
-				heave[i],alongtrack_offset[i]);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_elac_detects(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, int *nbeams,
-	int *detects, int *error)
-{
-	char	*function_name = "mbsys_elac_detects";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_elac_struct *store;
-	int	ibeam;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       detects:    %p\n",(void *)detects);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_elac_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get nbeams */
-		*nbeams = store->beams_bath;
-
-		/* get detects */
-		for (i=0;i<store->profile_num;i++)
-		  for (j=0;j<8;j++)
-			{
-			ibeam = (store->profile_num - 1 - i)
-					+ store->profile_num*(7 - j);
-			detects[ibeam] = MB_DETECT_AMPLITUDE;
-			}
-
-		/* set status */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error == MB_ERROR_NO_ERROR)
-		{
-		fprintf(stderr,"dbg2       nbeams:     %d\n",*nbeams);
-		for (i=0;i<*nbeams;i++)
-			fprintf(stderr,"dbg2       beam %d: detect:%d\n",
-				i,detects[i]);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_elac_extract_altitude(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, double *transducer_depth, double *altitude,
-	int *error)
-{
-	char	*function_name = "mbsys_elac_extract_altitude";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_elac_struct *store;
-	double	depthscale;
-	double	dacrscale;
-	double	bath_best;
-	double	xtrack_min;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_elac_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get draft */
-		*transducer_depth = 0.005
-				    * (store->transducer_starboard_depth
-					+ store->transducer_port_depth);
-		depthscale = 0.01;
-		dacrscale  = -0.02;
-		bath_best = 0.0;
-		if (store->profile[0].quality[4] == 1)
-		    bath_best = depthscale * store->profile[0].bath[4];
-		else
-		    {
-		    xtrack_min = 99999999.9;
-		    for (i=0;i<store->profile_num;i++)
-		      for (j=0;j<8;j++)
-			{
-			if (store->profile[i].quality[j] == 1
-			    && fabs(dacrscale
-				    * store->profile[i].bath_acrosstrack[j])
-				< xtrack_min)
-			    {
-			    xtrack_min = fabs(dacrscale
-				* store->profile[i].bath_acrosstrack[j]);
-			    bath_best = depthscale * store->profile[i].bath[j];
-			    }
-			}
-		    }
-		if (bath_best <= 0.0)
-		    {
-		    xtrack_min = 99999999.9;
-		    for (i=0;i<store->profile_num;i++)
-		      for (j=0;j<8;j++)
-			{
-			if (store->profile[i].quality[j] < 8
-			    && fabs(dacrscale
-				    * store->profile[i].bath_acrosstrack[j])
-				< xtrack_min)
-			    {
-			    xtrack_min = fabs(dacrscale
-				* store->profile[i].bath_acrosstrack[j]);
-			    bath_best = depthscale * store->profile[i].bath[j];
-			    }
-			}
-		    }
-		*altitude = bath_best - *transducer_depth;
-
-		/* set status */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:              %d\n",*kind);
-		fprintf(stderr,"dbg2       transducer_depth:  %f\n",*transducer_depth);
-		fprintf(stderr,"dbg2       altitude:          %f\n",*altitude);
-		fprintf(stderr,"dbg2       error:             %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:            %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_elac_extract_nav(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int time_i[7], double *time_d,
-		double *navlon, double *navlat,
-		double *speed, double *heading, double *draft,
-		double *roll, double *pitch, double *heave,
-		int *error)
-{
-	char	*function_name = "mbsys_elac_extract_nav";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_elac_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_elac_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get time */
-		mb_fix_y2k(verbose, store->profile[0].year, &time_i[0]);
-		time_i[1] = store->profile[0].month;
-		time_i[2] = store->profile[0].day;
-		time_i[3] = store->profile[0].hour;
-		time_i[4] = store->profile[0].minute;
-		time_i[5] = store->profile[0].second;
-		time_i[6] = 10000*store->profile[0].hundredth_sec
-			+ 100*store->profile[0].thousandth_sec;
-		mb_get_time(verbose,time_i,time_d);
-
-		/* get navigation */
-		*navlon = store->profile[0].longitude*0.00000009;
-		*navlat = store->profile[0].latitude*0.00000009;
-
-		/* get heading */
-		*heading = 0.01*store->profile[0].heading;
-
-		/* get speed  */
-		*speed = 0.0;
-
-		/* get draft  */
-		*draft = 0.005 * (store->transducer_starboard_depth
-					+ store->transducer_port_depth);
-
-		/* get roll pitch and heave */
-		*roll = 0.005 * store->profile[0].roll;
-		*pitch = 0.005 * store->profile[0].pitch;
-		*heave = 0.001 * store->profile[0].heave;
-
-		/* print debug statements */
-		if (verbose >= 5)
-			{
-			fprintf(stderr,"\ndbg4  Data extracted by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  Extracted values:\n");
-			fprintf(stderr,"dbg4       kind:       %d\n",
-				*kind);
-			fprintf(stderr,"dbg4       error:      %d\n",
-				*error);
-			fprintf(stderr,"dbg4       time_i[0]:  %d\n",
-				time_i[0]);
-			fprintf(stderr,"dbg4       time_i[1]:  %d\n",
-				time_i[1]);
-			fprintf(stderr,"dbg4       time_i[2]:  %d\n",
-				time_i[2]);
-			fprintf(stderr,"dbg4       time_i[3]:  %d\n",
-				time_i[3]);
-			fprintf(stderr,"dbg4       time_i[4]:  %d\n",
-				time_i[4]);
-			fprintf(stderr,"dbg4       time_i[5]:  %d\n",
-				time_i[5]);
-			fprintf(stderr,"dbg4       time_i[6]:  %d\n",
-				time_i[6]);
-			fprintf(stderr,"dbg4       time_d:     %f\n",
-				*time_d);
-			fprintf(stderr,"dbg4       longitude:  %f\n",
-				*navlon);
-			fprintf(stderr,"dbg4       latitude:   %f\n",
-				*navlat);
-			fprintf(stderr,"dbg4       speed:      %f\n",
-				*speed);
-			fprintf(stderr,"dbg4       heading:    %f\n",
-				*heading);
-			fprintf(stderr,"dbg4       draft:      %f\n",
-				*draft);
-			fprintf(stderr,"dbg4       roll:       %f\n",
-				*roll);
-			fprintf(stderr,"dbg4       pitch:      %f\n",
-				*pitch);
-			fprintf(stderr,"dbg4       heave:      %f\n",
-				*heave);
-			}
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind == MB_DATA_DATA)
-		{
-		fprintf(stderr,"dbg2       time_i[0]:     %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:     %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:     %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:     %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:     %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:     %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:     %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:        %f\n",*time_d);
-		fprintf(stderr,"dbg2       longitude:     %f\n",*navlon);
-		fprintf(stderr,"dbg2       latitude:      %f\n",*navlat);
-		fprintf(stderr,"dbg2       speed:         %f\n",*speed);
-		fprintf(stderr,"dbg2       heading:       %f\n",*heading);
-		fprintf(stderr,"dbg2       draft:         %f\n",*draft);
-		fprintf(stderr,"dbg2       roll:          %f\n",*roll);
-		fprintf(stderr,"dbg2       pitch:         %f\n",*pitch);
-		fprintf(stderr,"dbg2       heave:         %f\n",*heave);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_elac_insert_nav(int verbose, void *mbio_ptr, void *store_ptr,
-		int time_i[7], double time_d,
-		double navlon, double navlat,
-		double speed, double heading, double draft,
-		double roll, double pitch, double heave,
-		int *error)
-{
-	char	*function_name = "mbsys_elac_insert_nav";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_elac_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       time_i[0]:  %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:  %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:  %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:  %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:  %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:  %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:  %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:     %f\n",time_d);
-		fprintf(stderr,"dbg2       navlon:     %f\n",navlon);
-		fprintf(stderr,"dbg2       navlat:     %f\n",navlat);
-		fprintf(stderr,"dbg2       speed:      %f\n",speed);
-		fprintf(stderr,"dbg2       heading:    %f\n",heading);
-		fprintf(stderr,"dbg2       draft:      %f\n",draft);
-		fprintf(stderr,"dbg2       roll:       %f\n",roll);
-		fprintf(stderr,"dbg2       pitch:      %f\n",pitch);
-		fprintf(stderr,"dbg2       heave:      %f\n",heave);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_elac_struct *) store_ptr;
-
-	/* insert data in structure */
-	if (store->kind == MB_DATA_DATA)
-		{
-		/* get time */
-		mb_unfix_y2k(verbose, time_i[0], &store->profile[0].year);
-		store->profile[0].month = time_i[1];
-		store->profile[0].day = time_i[2];
-		store->profile[0].hour = time_i[3];
-		store->profile[0].minute = time_i[4];
-		store->profile[0].second = time_i[5];
-		store->profile[0].hundredth_sec = time_i[6]/10000;
-		store->profile[0].thousandth_sec
-			= (time_i[6]
-			- 10000*store->profile[0].hundredth_sec)/100;
-
-		/*get navigation */
-		store->profile[0].longitude = (int) (navlon*11111111.0);
-		store->profile[0].latitude = (int) (navlat*11111111.0);
-
-		/* get heading */
-		store->profile[0].heading = (int) (heading *100);
-
-		/* get draft  */
-		store->transducer_starboard_depth = 200 * draft;
-		store->transducer_port_depth = 200 * draft;
-
-		/* get roll pitch and heave */
-		store->profile[0].roll = 200 * roll;
-		store->profile[0].pitch = 200 * pitch;
-		store->profile[0].heave = 1000 * heave;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_elac_extract_svp(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int *nsvp,
-		double *depth, double *velocity,
-		int *error)
-{
-	char	*function_name = "mbsys_elac_extract_svp";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_elac_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_elac_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_VELOCITY_PROFILE)
-		{
-		/* get number of depth-velocity pairs */
-		*nsvp = store->svp_num;
-
-		/* get profile */
-		for (i=0;i<*nsvp;i++)
-			{
-			depth[i] = 0.1 * store->svp_depth[i];
-			velocity[i] = 0.1 * store->svp_vel[i];
-			}
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:              %d\n",*kind);
-		fprintf(stderr,"dbg2       nsvp:              %d\n",*nsvp);
-		for (i=0;i<*nsvp;i++)
-		    fprintf(stderr,"dbg2       depth[%d]: %f   velocity[%d]: %f\n",i, depth[i], i, velocity[i]);
-		fprintf(stderr,"dbg2       error:             %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:            %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_elac_insert_svp(int verbose, void *mbio_ptr, void *store_ptr,
-		int nsvp,
-		double *depth, double *velocity,
-		int *error)
-{
-	char	*function_name = "mbsys_elac_insert_svp";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_elac_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       nsvp:       %d\n",nsvp);
-		for (i=0;i<nsvp;i++)
-		    fprintf(stderr,"dbg2       depth[%d]: %f   velocity[%d]: %f\n",i, depth[i], i, velocity[i]);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_elac_struct *) store_ptr;
-
-	/* insert data in structure */
-	if (store->kind == MB_DATA_VELOCITY_PROFILE)
-		{
-		/* get number of depth-velocity pairs */
-		store->svp_num = MIN(nsvp, MBSYS_ELAC_MAXSVP);
-
-		/* get profile */
-		for (i=0;i<store->svp_num;i++)
-			{
-			store->svp_depth[i] = (int) (10 * depth[i]);
-			store->svp_vel[i] = (int) (10 * velocity[i]);
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_elac_copy(int verbose, void *mbio_ptr,
-			void *store_ptr, void *copy_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_elac_copy";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_elac_struct *store;
-	struct mbsys_elac_struct *copy;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       copy_ptr:   %p\n",(void *)copy_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointers */
-	store = (struct mbsys_elac_struct *) store_ptr;
-	copy = (struct mbsys_elac_struct *) copy_ptr;
-
-	/* copy the data */
-	*copy = *store;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mbsys_elac.h b/src/mbio/mbsys_elac.h
deleted file mode 100644
index 5dfa275..0000000
--- a/src/mbio/mbsys_elac.h
+++ /dev/null
@@ -1,330 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbsys_elac.h	8/20/94
- *	$Id: mbsys_elac.h 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1994-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbsys_elac.h defines the data structures used by MBIO functions
- * to store data from Elac SeaBat 9001 multibeam sonar systems.
- * The data formats which are commonly used to store Elac
- * data in files include
- *      MBF_BCHRTUNB : MBIO ID 91
- *
- *
- * Author:	D. W. Caress (L-DEO)
- * Date:	August 20, 1994
- *
- * $Log: mbsys_elac.h,v $
- * Revision 5.6  2005/11/05 00:48:05  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.5  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.4  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.3  2002/07/20 20:42:40  caress
- * Release 5.0.beta20
- *
- * Revision 5.2  2001/07/20 00:32:54  caress
- * Release 5.0.beta03
- *
- * Revision 5.1  2001/01/22  07:43:34  caress
- * Version 5.0.beta01
- *
- * Revision 5.0  2000/12/01  22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.6  2000/09/30  06:31:19  caress
- * Snapshot for Dale.
- *
- * Revision 4.5  1998/10/05  18:32:27  caress
- * MB-System version 4.6beta
- *
- * Revision 1.1  1998/10/05  17:46:15  caress
- * Initial revision
- *
- * Revision 4.4  1997/09/15  19:06:40  caress
- * Real Version 4.5
- *
- * Revision 4.3  1997/07/25  14:19:53  caress
- * Version 4.5beta2.
- * Much mucking, particularly with Simrad formats.
- *
- * Revision 4.2  1997/04/21  17:02:07  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.1  1995/07/13  19:15:09  caress
- * Intermediate check-in during major bug-fixing flail.
- *
- * Revision 4.1  1995/07/13  19:15:09  caress
- * Intermediate check-in during major bug-fixing flail.
- *
- * Revision 4.0  1994/10/21  12:35:07  caress
- * Release V4.0
- *
- * Revision 1.1  1994/10/21  12:20:01  caress
- * Initial revision
- *
- *
- *
- */
-/*
- * Notes on the MBSYS_ELAC data structure:
- *   1. Elac multibeam systems output binary data telegrams.
- *   2. Elac BottomChart sonar systems output both bathymetry
- *      and amplitude information for up to 56 beams per telegram.
- *   3. Each ping produces 8 beams.  A wide swath is constructed
- *      by successively pinging in different directions.
- *   4. Each telegram is preceded by a two byte start code and
- *      followed by a three byte end code consisting of 0x03
- *      followed by two bytes representing the checksum for
- *      the data bytes.  MB-System does not calculate checksums
- *      and puts 0's in the checksum bytes.
- *   5. The relevent telegram start codes, types, and sizes are:
- *         0x0250: Comment (Defined only for MB-System)   200 data bytes
- *         0x0251: Position                                36 data bytes
- *         0x0252: Parameter                            56/54 data bytes
- *         0x0253: Sound velocity profile                2016 data bytes
- *         0x0254: BottomChart 56 beam bathymetry         848 data bytes
- *         0x0255: BottomChart 40 beam bathymetry         608 data bytes
- *         0x0256: BottomChart 32 beam bathymetry         488 data bytes
- *   6. Elac systems record navigation fixes using the position
- *      telegram; navigation is not always included in the per ping data.
- *      Since speed is not recorded, it is impossible to extrapolate
- *      position from the last navigation fix when processing the
- *      data serially, as MBIO does.  It may thus be necessary to extract
- *      the navigation from the position telegrams and remerge it with
- *      the ping telegrams using the program mbmerge.
- *
- */
-
-/* sonar types */
-#define	MBSYS_ELAC_UNKNOWN	0
-#define	MBSYS_ELAC_BOTTOMCHART	1
-
-/* maximum number of beams and pixels */
-#define	MBSYS_ELAC_MAXBEAMS	56
-#define	MBSYS_ELAC_MAXSVP	500
-#define	MBSYS_ELAC_COMMENT_LENGTH	200
-
-/* telegram types */
-#define	ELAC_NONE		0
-#define	ELAC_COMMENT		0x0250
-#define	ELAC_POS		0x0251
-#define	ELAC_PARAMETER		0x0252
-#define	ELAC_SVP		0x0253
-#define	ELAC_BATH56		0x0254
-#define	ELAC_BATH40		0x0255
-#define	ELAC_BATH32		0x0256
-#define	ELAC_XBATH56		0x0260
-#define	ELAC_XBATH40		0x0261
-#define	ELAC_XBATH32		0x0262
-
-/* telegram sizes */
-#define	ELAC_COMMENT_SIZE	200
-#define	ELAC_POS_SIZE		36
-#define	ELAC_PARAMETER_SIZE	56
-#define	ELAC_SVP_SIZE		2016
-#define	ELAC_BATH56_SIZE	848
-#define	ELAC_BATH40_SIZE	608
-#define	ELAC_BATH32_SIZE	488
-#define	ELAC_XPARAMETER_SIZE	54
-#define	ELAC_XBATH56_SIZE	1072
-#define	ELAC_XBATH40_SIZE	768
-#define	ELAC_XBATH32_SIZE	616
-
-/* internal data structure */
-
-struct mbsys_elac_profile_struct
-	{
-	int	year;
-	int	month;
-	int	day;
-	int	hour;
-	int	minute;
-	int	second;
-	int	hundredth_sec;
-	int	thousandth_sec;
-	int	latitude;		/* 180 deg = 2*pi*e9 */
-	int	longitude;		/* 180 deg = 2*pi*e9 */
-	int	roll;			/* 0.005 degrees */
-	int	pitch;			/* 0.005 degrees */
-	int	heading;		/* PI/180 degrees */
-	int	heave;			/* 0.001 meters */
-	int	bath[8];		/* depths:  0.01 meters */
-	int	bath_acrosstrack[8];
-				/* acrosstrack distances: 0.01 meters */
-	short int bath_alongtrack[8];
-				/* alongtrack distances: 0.01 meters */
-	short int tt[8];	/* travel times:         0.05 msec */
-	short int angle[8];	/* 0.005 degrees */
-	short int quality[8];	/* 0 (bad) to 3 (good) */
-	short int amp[8];	/* ??? */
-
-	};
-
-struct mbsys_elac_struct
-	{
-	/* type of data record */
-	int	kind;			/* Data vs Comment */
-
-	/* type of sonar */
-	int	sonar;			/* Type of Elac sonar */
-
-	/* parameter info (parameter telegrams) */
-	int	par_year;
-	int	par_month;
-	int	par_day;
-	int	par_hour;
-	int	par_minute;
-	int	par_second;
-	int	par_hundredth_sec;
-	int	par_thousandth_sec;
-	short	roll_offset;	/* roll offset (degrees) */
-	short	pitch_offset;	/* pitch offset (degrees) */
-	short	heading_offset;	/* heading offset (degrees) */
-	short	time_delay;	/* positioning system delay (sec) */
-	short	transducer_port_height;
-	short	transducer_starboard_height;
-	short	transducer_port_depth;
-	short	transducer_starboard_depth;
-	short	transducer_port_x;
-	short	transducer_starboard_x;
-	short	transducer_port_y;
-	short	transducer_starboard_y;
-	short	transducer_port_error;
-	short	transducer_starboard_error;
-	short	antenna_height;
-	short	antenna_x;
-	short	antenna_y;
-	short	vru_height;
-	short	vru_x;
-	short	vru_y;
-	short	heave_offset;
-	short	line_number;
-	short	start_or_stop;
-	short	transducer_serial_number;
-
-	/* comment */
-	char	comment[MBSYS_ELAC_COMMENT_LENGTH];
-
-	/* position (position telegrams) */
-	int	pos_year;
-	int	pos_month;
-	int	pos_day;
-	int	pos_hour;
-	int	pos_minute;
-	int	pos_second;
-	int	pos_hundredth_sec;
-	int	pos_thousandth_sec;
-	int	pos_latitude;		/* 180 deg = 2e9 */
-	int	pos_longitude;		/* 180 deg = 2e9 */
-	unsigned int	utm_northing;
-	unsigned int	utm_easting;
-	int	utm_zone_lon;		/* 180 deg = 2e9 */
-	char	utm_zone;
-	char	hemisphere;
-	char	ellipsoid;
-	char	pos_spare;
-	int	semi_major_axis;
-	int	other_quality;
-
-	/* sound velocity profile */
-	int	svp_year;
-	int	svp_month;
-	int	svp_day;
-	int	svp_hour;
-	int	svp_minute;
-	int	svp_second;
-	int	svp_hundredth_sec;
-	int	svp_thousandth_sec;
-	int	svp_latitude;		/* 180 deg = 2e9 */
-	int	svp_longitude;		/* 180 deg = 2e9 */
-	int	svp_num;
-	int	svp_depth[MBSYS_ELAC_MAXSVP]; /* 0.1 meters */
-	int	svp_vel[MBSYS_ELAC_MAXSVP];	/* 0.1 meters/sec */
-
-	/* bathymetry */
-	int	ping_num;
-	int	sound_vel;
-	int	mode;
-	int	pulse_length;
-	int	source_power;
-	int	receiver_gain;
-	int	profile_num;	/* number of profiles stored */
-	int	beams_bath;	/* number of beams stored */
-	struct mbsys_elac_profile_struct profile[7];
-	};
-
-/* system specific function prototypes */
-int mbsys_elac_alloc(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error);
-int mbsys_elac_deall(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error);
-int mbsys_elac_dimensions(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int *nbath, int *namp, int *nss, int *error);
-int mbsys_elac_extract(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int time_i[7], double *time_d,
-			double *navlon, double *navlat,
-			double *speed, double *heading,
-			int *nbath, int *namp, int *nss,
-			char *beamflag, double *bath, double *amp,
-			double *bathacrosstrack, double *bathalongtrack,
-			double *ss, double *ssacrosstrack, double *ssalongtrack,
-			char *comment, int *error);
-int mbsys_elac_insert(int verbose, void *mbio_ptr, void *store_ptr,
-			int kind, int time_i[7], double time_d,
-			double navlon, double navlat,
-			double speed, double heading,
-			int nbath, int namp, int nss,
-			char *beamflag, double *bath, double *amp,
-			double *bathacrosstrack, double *bathalongtrack,
-			double *ss, double *ssacrosstrack, double *ssalongtrack,
-			char *comment, int *error);
-int mbsys_elac_ttimes(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int *nbeams,
-			double *ttimes, double *angles,
-			double *angles_forward, double *angles_null,
-			double *heave, double *alongtrack_offset,
-			double *draft, double *ssv, int *error);
-int mbsys_elac_detects(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int *nbeams,
-			int *detects, int *error);
-int mbsys_elac_extract_altitude(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, double *transducer_depth, double *altitude,
-			int *error);
-int mbsys_elac_extract_nav(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int time_i[7], double *time_d,
-			double *navlon, double *navlat,
-			double *speed, double *heading, double *draft,
-			double *roll, double *pitch, double *heave,
-			int *error);
-int mbsys_elac_insert_nav(int verbose, void *mbio_ptr, void *store_ptr,
-			int time_i[7], double time_d,
-			double navlon, double navlat,
-			double speed, double heading, double draft,
-			double roll, double pitch, double heave,
-			int *error);
-int mbsys_elac_extract_svp(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind,
-			int *nsvp,
-			double *depth, double *velocity,
-			int *error);
-int mbsys_elac_insert_svp(int verbose, void *mbio_ptr, void *store_ptr,
-			int nsvp,
-			double *depth, double *velocity,
-			int *error);
-int mbsys_elac_copy(int verbose, void *mbio_ptr,
-			void *store_ptr, void *copy_ptr,
-			int *error);
diff --git a/src/mbio/mbsys_elacmk2.c b/src/mbio/mbsys_elacmk2.c
deleted file mode 100644
index 08d0872..0000000
--- a/src/mbio/mbsys_elacmk2.c
+++ /dev/null
@@ -1,1790 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbsys_elac.c	3.00	8/20/94
- *	$Id: mbsys_elacmk2.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1994-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbsys_elac.c contains the functions for handling the data structure
- * used by MBIO functions to store data
- * from Elac BottomChart Mark II multibeam sonar systems.
- * The data formats which are commonly used to store Elac
- * data in files include
- *      MBF_ELMK2UNB : MBIO ID 92
- *
- * Author:	D. W. Caress
- * Date:	August 20, 1994
- *
- * $Log: mbsys_elacmk2.c,v $
- * Revision 5.9  2005/11/05 00:48:05  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.8  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.7  2003/01/15 20:51:48  caress
- * Release 5.0.beta28
- *
- * Revision 5.6  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.5  2002/07/20 20:42:40  caress
- * Release 5.0.beta20
- *
- * Revision 5.4  2001/08/25 00:54:13  caress
- * Adding beamwidth values to extract functions.
- *
- * Revision 5.3  2001/07/20  00:32:54  caress
- * Release 5.0.beta03
- *
- * Revision 5.2  2001/06/08  21:44:01  caress
- * Version 5.0.beta01
- *
- * Revision 5.1  2001/01/22  07:43:34  caress
- * Version 5.0.beta01
- *
- * Revision 5.0  2000/12/01  22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.5  2000/10/11  01:03:21  caress
- * Convert to ANSI C
- *
- * Revision 4.4  2000/09/30  06:32:52  caress
- * Snapshot for Dale.
- *
- * Revision 4.3  1999/04/02  00:55:11  caress
- * Handles nav and nav records more properly.
- *
- * Revision 4.2  1999/03/31  18:11:35  caress
- * MB-System 4.6beta7
- *
- * Revision 4.1  1998/10/05  17:46:15  caress
- * MB-System version 4.6beta
- *
- * Revision 4.0  1997/07/25  14:25:40  caress
- * Version 4.5beta2.
- *
- * Revision 1.1  1997/07/25  14:19:53  caress
- * Initial revision
- *
- * Revision 4.10  1997/04/21  17:02:07  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.9  1996/08/05  15:21:58  caress
- * Just redid i/o for Simrad sonars, including adding EM12S and EM121 support.
- *
- * Revision 4.9  1996/08/05  15:21:58  caress
- * Just redid i/o for Simrad sonars, including adding EM12S and EM121 support.
- *
- * Revision 4.8  1996/04/22  13:21:19  caress
- * Now have DTR and MIN/MAX defines in mb_define.h
- *
- * Revision 4.7  1996/04/22  10:57:09  caress
- * DTR define now in mb_io.h
- *
- * Revision 4.6  1995/11/27  21:50:06  caress
- * New version of mb_ttimes with ssv and angles_null.
- *
- * Revision 4.5  1995/09/28  18:10:48  caress
- * Various bug fixes working toward release 4.3.
- *
- * Revision 4.4  1995/08/17  14:41:09  caress
- * Revision for release 4.3.
- *
- * Revision 4.3  1995/07/13  19:13:36  caress
- * Intermediate check-in during major bug-fixing flail.
- *
- * Revision 4.2  1995/03/06  19:38:54  caress
- * Changed include strings.h to string.h for POSIX compliance.
- *
- * Revision 4.1  1994/11/09  21:40:34  caress
- * Changed ttimes extraction routines to handle forward beam angles
- * so that alongtrack distances can be calculated.
- *
- * Revision 4.0  1994/10/21  12:34:59  caress
- * Release V4.0
- *
- * Revision 1.1  1994/10/21  12:20:01  caress
- * Initial revision
- *
- *
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mb_define.h"
-#include "mbsys_elacmk2.h"
-
- static char rcs_id[]="$Id: mbsys_elacmk2.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mbsys_elacmk2_alloc(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_elacmk2_alloc";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_elacmk2_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* allocate memory for data structure */
-	status = mb_malloc(verbose,sizeof(struct mbsys_elacmk2_struct),
-				store_ptr,error);
-
-	/* get data structure pointer */
-	store = (struct mbsys_elacmk2_struct *) *store_ptr;
-
-	/* initialize everything */
-	store->kind = MB_DATA_NONE;
-	store->sonar = MBSYS_ELACMK2_UNKNOWN;
-
-	/* parameter telegram */
-	store->par_year = 0;
-	store->par_month = 0;
-	store->par_day = 0;
-	store->par_hour = 0;
-	store->par_minute = 0;
-	store->par_second = 0;
-	store->par_hundredth_sec = 0;
-	store->par_thousandth_sec = 0;
-	store->roll_offset = 0;		/* roll offset (degrees) */
-	store->pitch_offset = 0;	/* pitch offset (degrees) */
-	store->heading_offset = 0;	/* heading offset (degrees) */
-	store->time_delay = 0;		/* positioning system delay (sec) */
-	store->transducer_port_height = 0;
-	store->transducer_starboard_height = 0;
-	store->transducer_port_depth = 0;
-	store->transducer_starboard_depth = 0;
-	store->transducer_port_x = 0;
-	store->transducer_starboard_x = 0;
-	store->transducer_port_y = 0;
-	store->transducer_starboard_y = 0;
-	store->transducer_port_error = 0;
-	store->transducer_starboard_error = 0;
-	store->antenna_height = 0;
-	store->antenna_x = 0;
-	store->antenna_y = 0;
-	store->vru_height = 0;
-	store->vru_x = 0;
-	store->vru_y = 0;
-	store->line_number = 0;
-	store->start_or_stop = 0;
-	store->transducer_serial_number = 0;
-	for (i=0;i<MBSYS_ELACMK2_COMMENT_LENGTH;i++)
-		store->comment[i] = '\0';
-
-	/* position (position telegrams) */
-	store->pos_year = 0;
-	store->pos_month = 0;
-	store->pos_day = 0;
-	store->pos_hour = 0;
-	store->pos_minute = 0;
-	store->pos_second = 0;
-	store->pos_hundredth_sec = 0;
-	store->pos_thousandth_sec = 0;
-	store->pos_latitude = 0;
-	store->pos_longitude = 0;
-	store->utm_northing = 0;
-	store->utm_easting = 0;
-	store->utm_zone_lon = 0;
-	store->utm_zone = 0;
-	store->hemisphere = 0;
-	store->ellipsoid = 0;
-	store->pos_spare = 0;
-	store->semi_major_axis = 0;
-	store->other_quality = 0;
-
-	/* sound velocity profile */
-	store->svp_year = 0;
-	store->svp_month = 0;
-	store->svp_day = 0;
-	store->svp_hour = 0;
-	store->svp_minute = 0;
-	store->svp_second = 0;
-	store->svp_hundredth_sec = 0;
-	store->svp_thousandth_sec = 0;
-	store->svp_num = 0;
-	for (i=0;i<500;i++)
-		{
-		store->svp_depth[i] = 0; /* 0.1 meters */
-		store->svp_vel[i] = 0;	/* 0.1 meters/sec */
-		}
-
-	/* depth telegram */
-	store->year = 0;
-	store->month = 0;
-	store->day = 0;
-	store->hour = 0;
-	store->minute = 0;
-	store->second = 0;
-	store->hundredth_sec = 0;
-	store->thousandth_sec = 0;
-	store->longitude = 0.0;
-	store->latitude = 0.0;
-	store->speed = 0.0;
-	store->ping_num = 0;
-	store->sound_vel = 0;
-	store->heading = 0;
-	store->pulse_length = 0;
-	store->mode = 0;
-	store->pulse_length = 0;
-	store->source_power = 0;
-	store->receiver_gain_stbd = 0;
-	store->receiver_gain_port = 0;
-	store->reserved = 0;
-	store->beams_bath = 0;
-	for (i=0;i<MBSYS_ELACMK2_MAXBEAMS;i++)
-		{
-		store->beams[i].bath = 0;
-		store->beams[i].bath_acrosstrack = 0;
-		store->beams[i].bath_alongtrack = 0;
-		store->beams[i].tt = 0;
-		store->beams[i].quality = 0;
-		store->beams[i].amplitude = 0;
-		store->beams[i].time_offset = 0;
-		store->beams[i].heave = 0;
-		store->beams[i].roll = 0;
-		store->beams[i].pitch = 0;
-		store->beams[i].angle = 0;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)*store_ptr);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_elacmk2_deall(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_elacmk2_deall";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)*store_ptr);
-		}
-
-	/* deallocate memory for data structure */
-	status = mb_free(verbose,store_ptr,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_elacmk2_dimensions(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int *nbath, int *namp, int *nss, int *error)
-{
-	char	*function_name = "mbsys_elacmk2_dimensions";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_elacmk2_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_elacmk2_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get beam and pixel numbers */
-		*nbath = store->beams_bath;
-		*namp = store->beams_bath;
-		*nss = 0;
-		}
-	else
-		{
-		/* get beam and pixel numbers */
-		*nbath = 0;
-		*namp = 0;
-		*nss = 0;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		fprintf(stderr,"dbg2       nbath:      %d\n",*nbath);
-		fprintf(stderr,"dbg2        namp:      %d\n",*namp);
-		fprintf(stderr,"dbg2        nss:       %d\n",*nss);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_elacmk2_extract(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int time_i[7], double *time_d,
-		double *navlon, double *navlat,
-		double *speed, double *heading,
-		int *nbath, int *namp, int *nss,
-		char *beamflag, double *bath, double *amp,
-		double *bathacrosstrack, double *bathalongtrack,
-		double *ss, double *ssacrosstrack, double *ssalongtrack,
-		char *comment, int *error)
-{
-	char	*function_name = "mbsys_elacmk2_extract";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_elacmk2_struct *store;
-	double	depthscale, dacrscale, daloscale,reflscale;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_elacmk2_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get time */
-		mb_fix_y2k(verbose, store->year, &time_i[0]);
-		time_i[1] = store->month;
-		time_i[2] = store->day;
-		time_i[3] = store->hour;
-		time_i[4] = store->minute;
-		time_i[5] = store->second;
-		time_i[6] = 10000*store->hundredth_sec
-			+ 100*store->thousandth_sec;
-		mb_get_time(verbose,time_i,time_d);
-
-		/* get navigation */
-		*navlon = store->longitude;
-		*navlat = store->latitude;
-
-		/* get heading */
-		*heading = 0.01*store->heading;
-
-		/* get speed  */
-		*speed = 3.6 * store->speed;
-
-		/* set beamwidths in mb_io structure */
-		mb_io_ptr->beamwidth_ltrack = 2.8;
-		mb_io_ptr->beamwidth_xtrack = 1.5;
-
-		/* read distance and depth values into storage arrays */
-		*nbath = store->beams_bath;
-		*namp = store->beams_bath;
-		*nss = 0;
-		depthscale = 0.01;
-		dacrscale  = -0.01;
-		daloscale  = 0.01;
-		reflscale  = 1.0;
-		for (i=0;i<store->beams_bath;i++)
-			{
-			j = store->beams_bath - i - 1;
-			if (store->beams[j].quality == 1)
-			    beamflag[i]
-				= MB_FLAG_NONE;
-			else if (store->beams[j].quality < 8)
-			    beamflag[i]
-				= MB_FLAG_SONAR + MB_FLAG_FLAG;
-			else if (store->beams[j].quality == 8)
-			    beamflag[i]
-				= MB_FLAG_NULL;
-			else if (store->beams[j].quality == 10)
-			    beamflag[i]
-				= MB_FLAG_MANUAL + MB_FLAG_FLAG;
-			else if (store->beams[j].quality == 20)
-			    beamflag[i]
-				= MB_FLAG_FILTER + MB_FLAG_FLAG;
-			else
-			    beamflag[i]
-				= MB_FLAG_NULL;
-			bath[i] = depthscale * store->beams[j].bath;
-			bathacrosstrack[i] = dacrscale
-				* store->beams[j].bath_acrosstrack;
-			bathalongtrack[i] = daloscale
-				* store->beams[j].bath_alongtrack;
-			amp[i] = reflscale
-				* store->beams[j].amplitude;
-			}
-
-		/* print debug statements */
-		if (verbose >= 5)
-			{
-			fprintf(stderr,"\ndbg4  Data extracted by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  Extracted values:\n");
-			fprintf(stderr,"dbg4       kind:       %d\n",
-				*kind);
-			fprintf(stderr,"dbg4       error:      %d\n",
-				*error);
-			fprintf(stderr,"dbg4       time_i[0]:  %d\n",
-				time_i[0]);
-			fprintf(stderr,"dbg4       time_i[1]:  %d\n",
-				time_i[1]);
-			fprintf(stderr,"dbg4       time_i[2]:  %d\n",
-				time_i[2]);
-			fprintf(stderr,"dbg4       time_i[3]:  %d\n",
-				time_i[3]);
-			fprintf(stderr,"dbg4       time_i[4]:  %d\n",
-				time_i[4]);
-			fprintf(stderr,"dbg4       time_i[5]:  %d\n",
-				time_i[5]);
-			fprintf(stderr,"dbg4       time_i[6]:  %d\n",
-				time_i[6]);
-			fprintf(stderr,"dbg4       time_d:     %f\n",
-				*time_d);
-			fprintf(stderr,"dbg4       longitude:  %f\n",
-				*navlon);
-			fprintf(stderr,"dbg4       latitude:   %f\n",
-				*navlat);
-			fprintf(stderr,"dbg4       speed:      %f\n",
-				*speed);
-			fprintf(stderr,"dbg4       heading:    %f\n",
-				*heading);
-			fprintf(stderr,"dbg4       nbath:      %d\n",
-				*nbath);
-			for (i=0;i<*nbath;i++)
-			  fprintf(stderr,"dbg4       beam:%d  flag:%3d  bath:%f  acrosstrack:%f  alongtrack:%f\n",
-				i,beamflag[i],bath[i],bathacrosstrack[i],bathalongtrack[i]);
-			fprintf(stderr,"dbg4        namp:     %d\n",
-				*namp);
-			for (i=0;i<*namp;i++)
-			  fprintf(stderr,"dbg4        beam:%d   amp:%f  acrosstrack:%f  alongtrack:%f\n",
-				i,amp[i],bathacrosstrack[i],bathalongtrack[i]);
-			}
-
-		/* done translating values */
-
-		}
-
-	/* extract data from structure */
-	else if (*kind == MB_DATA_NAV)
-		{
-		/* get time */
-		mb_fix_y2k(verbose, store->pos_year, &time_i[0]);
-		time_i[1] = store->pos_month;
-		time_i[2] = store->pos_day;
-		time_i[3] = store->pos_hour;
-		time_i[4] = store->pos_minute;
-		time_i[5] = store->pos_second;
-		time_i[6] = 10000*store->pos_hundredth_sec
-			+ 100*store->pos_thousandth_sec;
-		mb_get_time(verbose,time_i,time_d);
-
-		/* get navigation */
-		*navlon = 0.00000009 * store->pos_longitude;
-		*navlat = 0.00000009 * store->pos_latitude;
-
-		/* get heading */
-		*heading = 0.01*store->heading;
-
-		/* get speed  */
-		*speed = 0.0;
-
-		/* print debug statements */
-		if (verbose >= 5)
-			{
-			fprintf(stderr,"\ndbg4  Data extracted by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  Extracted values:\n");
-			fprintf(stderr,"dbg4       kind:       %d\n",
-				*kind);
-			fprintf(stderr,"dbg4       error:      %d\n",
-				*error);
-			fprintf(stderr,"dbg4       time_i[0]:  %d\n",
-				time_i[0]);
-			fprintf(stderr,"dbg4       time_i[1]:  %d\n",
-				time_i[1]);
-			fprintf(stderr,"dbg4       time_i[2]:  %d\n",
-				time_i[2]);
-			fprintf(stderr,"dbg4       time_i[3]:  %d\n",
-				time_i[3]);
-			fprintf(stderr,"dbg4       time_i[4]:  %d\n",
-				time_i[4]);
-			fprintf(stderr,"dbg4       time_i[5]:  %d\n",
-				time_i[5]);
-			fprintf(stderr,"dbg4       time_i[6]:  %d\n",
-				time_i[6]);
-			fprintf(stderr,"dbg4       time_d:     %f\n",
-				*time_d);
-			fprintf(stderr,"dbg4       longitude:  %f\n",
-				*navlon);
-			fprintf(stderr,"dbg4       latitude:   %f\n",
-				*navlat);
-			fprintf(stderr,"dbg4       speed:      %f\n",
-				*speed);
-			fprintf(stderr,"dbg4       heading:    %f\n",
-				*heading);
-			fprintf(stderr,"dbg4       nbath:      %d\n",
-				*nbath);
-			fprintf(stderr,"dbg4        namp:     %d\n",
-				*namp);
-			}
-
-		/* done translating values */
-
-		}
-
-	/* extract comment from structure */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* copy comment */
-		strcpy(comment,store->comment);
-
-		/* print debug statements */
-		if (verbose >= 4)
-			{
-			fprintf(stderr,"\ndbg4  New ping read by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  New ping values:\n");
-			fprintf(stderr,"dbg4       error:      %d\n",
-				*error);
-			fprintf(stderr,"dbg4       comment:    %s\n",
-				comment);
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind == MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"dbg2       comment:     \ndbg2       %s\n",
-			comment);
-		}
-	else if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind != MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"dbg2       time_i[0]:     %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:     %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:     %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:     %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:     %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:     %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:     %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:        %f\n",*time_d);
-		fprintf(stderr,"dbg2       longitude:     %f\n",*navlon);
-		fprintf(stderr,"dbg2       latitude:      %f\n",*navlat);
-		fprintf(stderr,"dbg2       speed:         %f\n",*speed);
-		fprintf(stderr,"dbg2       heading:       %f\n",*heading);
-		}
-	if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind == MB_DATA_DATA)
-		{
-		fprintf(stderr,"dbg2       nbath:      %d\n",
-			*nbath);
-		for (i=0;i<*nbath;i++)
-		  fprintf(stderr,"dbg2       beam:%d  flag:%3d  bath:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,beamflag[i],bath[i],
-			bathacrosstrack[i],bathalongtrack[i]);
-		fprintf(stderr,"dbg2        namp:     %d\n",
-			*namp);
-		for (i=0;i<*namp;i++)
-		  fprintf(stderr,"dbg2       beam:%d   amp:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,amp[i],bathacrosstrack[i],bathalongtrack[i]);
-		fprintf(stderr,"dbg2        nss:      %d\n",
-			*nss);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_elacmk2_insert(int verbose, void *mbio_ptr, void *store_ptr,
-		int kind, int time_i[7], double time_d,
-		double navlon, double navlat,
-		double speed, double heading,
-		int nbath, int namp, int nss,
-		char *beamflag, double *bath, double *amp,
-		double *bathacrosstrack, double *bathalongtrack,
-		double *ss, double *ssacrosstrack, double *ssalongtrack,
-		char *comment, int *error)
-{
-	char	*function_name = "mbsys_elacmk2_insert";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_elacmk2_struct *store;
-	double	depthscale, dacrscale,daloscale,reflscale;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       kind:       %d\n",kind);
-		}
-	if (verbose >= 2 && (kind == MB_DATA_DATA || kind == MB_DATA_NAV))
-		{
-		fprintf(stderr,"dbg2       time_i[0]:  %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:  %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:  %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:  %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:  %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:  %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:  %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:     %f\n",time_d);
-		fprintf(stderr,"dbg2       navlon:     %f\n",navlon);
-		fprintf(stderr,"dbg2       navlat:     %f\n",navlat);
-		fprintf(stderr,"dbg2       speed:      %f\n",speed);
-		fprintf(stderr,"dbg2       heading:    %f\n",heading);
-		}
-	if (verbose >= 2 && kind == MB_DATA_DATA)
-		{
-		fprintf(stderr,"dbg2       nbath:      %d\n",nbath);
-		if (verbose >= 3)
-		 for (i=0;i<nbath;i++)
-		  fprintf(stderr,"dbg3       beam:%d  flag:%3d  bath:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,beamflag[i],bath[i],
-			bathacrosstrack[i],bathalongtrack[i]);
-		fprintf(stderr,"dbg2       namp:       %d\n",namp);
-		if (verbose >= 3)
-		 for (i=0;i<namp;i++)
-		  fprintf(stderr,"dbg3        beam:%d   amp:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,amp[i],bathacrosstrack[i],bathalongtrack[i]);
-		}
-	if (verbose >= 2 && kind == MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"dbg2       comment:     \ndbg2       %s\n",
-			comment);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_elacmk2_struct *) store_ptr;
-
-	/* set data kind */
-	store->kind = kind;
-
-	/* insert data in structure */
-	if (store->kind == MB_DATA_DATA)
-		{
-		/* get time */
-		mb_unfix_y2k(verbose, time_i[0], &store->year);
-		store->month = time_i[1];
-		store->day = time_i[2];
-		store->hour = time_i[3];
-		store->minute = time_i[4];
-		store->second = time_i[5];
-		store->hundredth_sec = time_i[6]/10000;
-		store->thousandth_sec
-			= (time_i[6]
-			- 10000*store->hundredth_sec)/100;
-
-		/*get navigation */
-		store->longitude = navlon;
-		store->latitude = navlat;
-
-		/* get heading */
-		store->heading = (int) (heading * 100);
-
-		/* get speed */
-		store->speed = speed / 3.6;
-
-		/* insert distance and depth values into storage arrays */
-		if (store->beams_bath == nbath)
-			{
-			depthscale = 0.01;
-			dacrscale  = -0.01;
-			daloscale  = 0.01;
-			reflscale  = 1.0;
-			for (i=0;i<store->beams_bath;i++)
-				{
-				j = store->beams_bath - i - 1;
-				if (mb_beam_check_flag(beamflag[i]))
-				    {
-				    if (mb_beam_check_flag_null(beamflag[i]))
-					store->beams[j].quality = 8;
-				    else if (mb_beam_check_flag_manual(beamflag[i]))
-					store->beams[j].quality = 10;
-				    else if (mb_beam_check_flag_filter(beamflag[i]))
-					store->beams[j].quality = 20;
-				    else if (store->beams[j].quality == 1)
-					store->beams[j].quality = 7;
-				    }
-				else
-				    store->beams[j].quality = 1;
-				store->beams[j].bath
-					= (unsigned int)
-					    fabs(bath[i] / depthscale);
-				store->beams[j].bath_acrosstrack
-					= (int) (bathacrosstrack[i]
-						/ dacrscale);
-				store->beams[j].bath_alongtrack
-					= (int) (bathalongtrack[i]
-						/ daloscale);
-				store->beams[j].amplitude
-					= (int) (amp[i] / reflscale);
-				}
-
-			}
-		}
-
-	/* insert data in structure */
-	else if (store->kind == MB_DATA_NAV)
-		{
-		/* get time */
-		mb_unfix_y2k(verbose, time_i[0], &store->pos_year);
-		store->pos_month = time_i[1];
-		store->pos_day = time_i[2];
-		store->pos_hour = time_i[3];
-		store->pos_minute = time_i[4];
-		store->pos_second = time_i[5];
-		store->pos_hundredth_sec = time_i[6]/10000;
-		store->pos_thousandth_sec
-			= (time_i[6]
-			- 10000*store->hundredth_sec)/100;
-
-		/*get navigation */
-		store->pos_longitude = navlon / 0.00000009;
-		store->pos_latitude = navlat / 0.00000009;
-
-		/* get heading */
-		store->heading = (int) (heading *100);
-		}
-
-	/* insert comment in structure */
-	else if (store->kind == MB_DATA_COMMENT)
-		{
-		strncpy(store->comment,comment,199);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_elacmk2_ttimes(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, int *nbeams,
-	double *ttimes, double *angles,
-	double *angles_forward, double *angles_null,
-	double *heave, double *alongtrack_offset,
-	double *draft, double *ssv, int *error)
-{
-	char	*function_name = "mbsys_elacmk2_ttimes";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_elacmk2_struct *store;
-	double	angle, pitch;
-	double	daloscale, ttscale, angscale;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       ttimes:     %p\n",(void *)ttimes);
-		fprintf(stderr,"dbg2       angles_xtrk:%p\n",(void *)angles);
-		fprintf(stderr,"dbg2       angles_ltrk:%p\n",(void *)angles_forward);
-		fprintf(stderr,"dbg2       angles_null:%p\n",(void *)angles_null);
-		fprintf(stderr,"dbg2       heave:      %p\n",(void *)heave);
-		fprintf(stderr,"dbg2       ltrk_off:   %p\n",(void *)alongtrack_offset);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_elacmk2_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get nbeams */
-		*nbeams = store->beams_bath;
-
-		/* get draft */
-		*draft = 0.005 * (store->transducer_starboard_depth
-				    + store->transducer_port_depth);
-
-		/* get ssv */
-		*ssv = 0.1 * store->sound_vel;
-
-		/* get travel times, angles */
-		daloscale  = 0.01;
-		ttscale = 0.0001;
-		angscale = 0.005;
-		for (i=0;i<*nbeams;i++)
-			{
-			j = store->beams_bath - i - 1;
-			ttimes[i] = ttscale * store->beams[j].tt;
-			angle = 90.0 + angscale * store->beams[j].angle;
-			pitch = angscale * store->beams[j].pitch;
-			mb_rollpitch_to_takeoff(
-				verbose, pitch, angle,
-				&angles[i],
-				&angles_forward[i], error);
-			if (store->beams[j].angle < 0)
-				{
-				angles_null[i] = 37.5
-					+ angscale
-					* store->transducer_port_error;
-				}
-			else
-				{
-				angles_null[i] = 37.5
-					+ angscale
-					* store->transducer_starboard_error;
-				}
-			heave[i] = 0.001 * store->beams[j].heave;
-			alongtrack_offset[i] = daloscale
-				* store->beams[j].bath_alongtrack;;
-			}
-
-		/* set status */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error == MB_ERROR_NO_ERROR)
-		{
-		fprintf(stderr,"dbg2       draft:      %f\n",*draft);
-		fprintf(stderr,"dbg2       ssv:        %f\n",*ssv);
-		fprintf(stderr,"dbg2       nbeams:     %d\n",*nbeams);
-		for (i=0;i<*nbeams;i++)
-			fprintf(stderr,"dbg2       beam %d: tt:%f  angle_xtrk:%f  angle_ltrk:%f  angle_null:%f  heave:%f  ltrk_off:%f\n",
-				i,ttimes[i],angles[i],
-				angles_forward[i],angles_null[i],
-				heave[i],alongtrack_offset[i]);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_elacmk2_detects(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, int *nbeams,
-	int *detects, int *error)
-{
-	char	*function_name = "mbsys_elacmk2_detects";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_elacmk2_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       detects:    %p\n",(void *)detects);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_elacmk2_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get nbeams */
-		*nbeams = store->beams_bath;
-
-		/* get detects */
-		for (i=0;i<*nbeams;i++)
-			{
-			detects[i] = MB_DETECT_AMPLITUDE;
-			}
-
-		/* set status */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error == MB_ERROR_NO_ERROR)
-		{
-		fprintf(stderr,"dbg2       nbeams:     %d\n",*nbeams);
-		for (i=0;i<*nbeams;i++)
-			fprintf(stderr,"dbg2       beam %d: detect:%d\n",
-				i,detects[i]);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_elacmk2_extract_altitude(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, double *transducer_depth, double *altitude,
-	int *error)
-{
-	char	*function_name = "mbsys_elacmk2_extract_altitude";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_elacmk2_struct *store;
-	double	depthscale;
-	double	dacrscale;
-	double	bath_best;
-	double	xtrack_min;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_elacmk2_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get draft */
-		*transducer_depth = 0.005
-				    * (store->transducer_starboard_depth
-					+ store->transducer_port_depth);
-		depthscale = 0.01;
-		dacrscale  = -0.01;
-		bath_best = 0.0;
-		if (store->beams[store->beams_bath/2].quality == 1)
-		    bath_best = depthscale * store->beams[store->beams_bath/2].bath;
-		else
-		    {
-		    xtrack_min = 99999999.9;
-		    for (i=0;i<store->beams_bath;i++)
-			{
-			if (store->beams[i].quality == 1
-			    && fabs(dacrscale
-				    * store->beams[i].bath_acrosstrack)
-				< xtrack_min)
-			    {
-			    xtrack_min = fabs(dacrscale
-				* store->beams[i].bath_acrosstrack);
-			    bath_best = depthscale * store->beams[i].bath;
-			    }
-			}
-		    }
-		if (bath_best <= 0.0)
-		    {
-		    xtrack_min = 99999999.9;
-		    for (i=0;i<store->beams_bath;i++)
-			{
-			if (store->beams[i].quality < 8
-			    && fabs(dacrscale
-				    * store->beams[i].bath_acrosstrack)
-				< xtrack_min)
-			    {
-			    xtrack_min = fabs(dacrscale
-				* store->beams[i].bath_acrosstrack);
-			    bath_best = depthscale * store->beams[i].bath;
-			    }
-			}
-		    }
-		*altitude = bath_best - *transducer_depth;
-
-		/* set status */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:              %d\n",*kind);
-		fprintf(stderr,"dbg2       transducer_depth:  %f\n",*transducer_depth);
-		fprintf(stderr,"dbg2       altitude:          %f\n",*altitude);
-		fprintf(stderr,"dbg2       error:             %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:            %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_elacmk2_extract_nav(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int time_i[7], double *time_d,
-		double *navlon, double *navlat,
-		double *speed, double *heading, double *draft,
-		double *roll, double *pitch, double *heave,
-		int *error)
-{
-	char	*function_name = "mbsys_elacmk2_extract_nav";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_elacmk2_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_elacmk2_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get time */
-		mb_fix_y2k(verbose, store->year, &time_i[0]);
-		time_i[1] = store->month;
-		time_i[2] = store->day;
-		time_i[3] = store->hour;
-		time_i[4] = store->minute;
-		time_i[5] = store->second;
-		time_i[6] = 10000*store->hundredth_sec
-			+ 100*store->thousandth_sec;
-		mb_get_time(verbose,time_i,time_d);
-
-		/* get navigation */
-		*navlon = store->longitude;
-		*navlat = store->latitude;
-
-		/* get heading */
-		*heading = 0.01*store->heading;
-
-		/* get speed  */
-		*speed = 3.6 * store->speed;
-
-		/* get draft */
-		*draft = 0.005 * (store->transducer_starboard_depth
-				    + store->transducer_port_depth);
-
-		/* get roll pitch and heave */
-		if (store->beams_bath > 4)
-			{
-			*roll = 0.005 * store->beams[4].roll;
-			*pitch = 0.005 * store->beams[4].pitch;
-			*heave = 0.001 * store->beams[4].heave;
-			}
-		else
-			{
-			*roll = 0.0;
-			*pitch = 0.0;
-			*heave = 0.0;
-			}
-
-		/* print debug statements */
-		if (verbose >= 5)
-			{
-			fprintf(stderr,"\ndbg4  Data extracted by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  Extracted values:\n");
-			fprintf(stderr,"dbg4       kind:       %d\n",
-				*kind);
-			fprintf(stderr,"dbg4       error:      %d\n",
-				*error);
-			fprintf(stderr,"dbg4       time_i[0]:  %d\n",
-				time_i[0]);
-			fprintf(stderr,"dbg4       time_i[1]:  %d\n",
-				time_i[1]);
-			fprintf(stderr,"dbg4       time_i[2]:  %d\n",
-				time_i[2]);
-			fprintf(stderr,"dbg4       time_i[3]:  %d\n",
-				time_i[3]);
-			fprintf(stderr,"dbg4       time_i[4]:  %d\n",
-				time_i[4]);
-			fprintf(stderr,"dbg4       time_i[5]:  %d\n",
-				time_i[5]);
-			fprintf(stderr,"dbg4       time_i[6]:  %d\n",
-				time_i[6]);
-			fprintf(stderr,"dbg4       time_d:     %f\n",
-				*time_d);
-			fprintf(stderr,"dbg4       longitude:  %f\n",
-				*navlon);
-			fprintf(stderr,"dbg4       latitude:   %f\n",
-				*navlat);
-			fprintf(stderr,"dbg4       speed:      %f\n",
-				*speed);
-			fprintf(stderr,"dbg4       heading:    %f\n",
-				*heading);
-			fprintf(stderr,"dbg4       draft:      %f\n",
-				*draft);
-			fprintf(stderr,"dbg4       roll:       %f\n",
-				*roll);
-			fprintf(stderr,"dbg4       pitch:      %f\n",
-				*pitch);
-			fprintf(stderr,"dbg4       heave:      %f\n",
-				*heave);
-			}
-
-		/* done translating values */
-
-		}
-
-	/* extract data from structure */
-	else if (*kind == MB_DATA_NAV)
-		{
-		/* get time */
-		mb_fix_y2k(verbose, store->pos_year, &time_i[0]);
-		time_i[1] = store->pos_month;
-		time_i[2] = store->pos_day;
-		time_i[3] = store->pos_hour;
-		time_i[4] = store->pos_minute;
-		time_i[5] = store->pos_second;
-		time_i[6] = 10000*store->pos_hundredth_sec
-			+ 100*store->pos_thousandth_sec;
-		mb_get_time(verbose,time_i,time_d);
-
-		/* get navigation */
-		*navlon = 0.00000009 * store->pos_longitude;
-		*navlat = 0.00000009 * store->pos_latitude;
-
-		/* get heading */
-		*heading = 0.01*store->heading;
-
-		/* get speed  */
-		*speed = 0.0;
-
-		/* get draft */
-		*draft = 0.005 * (store->transducer_starboard_depth
-				    + store->transducer_port_depth);
-
-		/* get roll pitch and heave */
-		if (store->beams_bath > 4)
-			{
-			*roll = 0.005 * store->beams[4].roll;
-			*pitch = 0.005 * store->beams[4].pitch;
-			*heave = 0.001 * store->beams[4].heave;
-			}
-		else
-			{
-			*roll = 0.0;
-			*pitch = 0.0;
-			*heave = 0.0;
-			}
-
-		/* print debug statements */
-		if (verbose >= 5)
-			{
-			fprintf(stderr,"\ndbg4  Data extracted by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  Extracted values:\n");
-			fprintf(stderr,"dbg4       kind:       %d\n",
-				*kind);
-			fprintf(stderr,"dbg4       error:      %d\n",
-				*error);
-			fprintf(stderr,"dbg4       time_i[0]:  %d\n",
-				time_i[0]);
-			fprintf(stderr,"dbg4       time_i[1]:  %d\n",
-				time_i[1]);
-			fprintf(stderr,"dbg4       time_i[2]:  %d\n",
-				time_i[2]);
-			fprintf(stderr,"dbg4       time_i[3]:  %d\n",
-				time_i[3]);
-			fprintf(stderr,"dbg4       time_i[4]:  %d\n",
-				time_i[4]);
-			fprintf(stderr,"dbg4       time_i[5]:  %d\n",
-				time_i[5]);
-			fprintf(stderr,"dbg4       time_i[6]:  %d\n",
-				time_i[6]);
-			fprintf(stderr,"dbg4       time_d:     %f\n",
-				*time_d);
-			fprintf(stderr,"dbg4       longitude:  %f\n",
-				*navlon);
-			fprintf(stderr,"dbg4       latitude:   %f\n",
-				*navlat);
-			fprintf(stderr,"dbg4       speed:      %f\n",
-				*speed);
-			fprintf(stderr,"dbg4       heading:    %f\n",
-				*heading);
-			fprintf(stderr,"dbg4       draft:      %f\n",
-				*draft);
-			fprintf(stderr,"dbg4       roll:       %f\n",
-				*roll);
-			fprintf(stderr,"dbg4       pitch:      %f\n",
-				*pitch);
-			fprintf(stderr,"dbg4       heave:      %f\n",
-				*heave);
-			}
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind == MB_DATA_DATA)
-		{
-		fprintf(stderr,"dbg2       time_i[0]:     %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:     %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:     %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:     %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:     %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:     %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:     %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:        %f\n",*time_d);
-		fprintf(stderr,"dbg2       longitude:     %f\n",*navlon);
-		fprintf(stderr,"dbg2       latitude:      %f\n",*navlat);
-		fprintf(stderr,"dbg2       speed:         %f\n",*speed);
-		fprintf(stderr,"dbg2       heading:       %f\n",*heading);
-		fprintf(stderr,"dbg2       draft:         %f\n",*draft);
-		fprintf(stderr,"dbg2       roll:          %f\n",*roll);
-		fprintf(stderr,"dbg2       pitch:         %f\n",*pitch);
-		fprintf(stderr,"dbg2       heave:         %f\n",*heave);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_elacmk2_insert_nav(int verbose, void *mbio_ptr, void *store_ptr,
-		int time_i[7], double time_d,
-		double navlon, double navlat,
-		double speed, double heading, double draft,
-		double roll, double pitch, double heave,
-		int *error)
-{
-	char	*function_name = "mbsys_elacmk2_insert_nav";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_elacmk2_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       time_i[0]:  %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:  %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:  %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:  %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:  %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:  %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:  %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:     %f\n",time_d);
-		fprintf(stderr,"dbg2       navlon:     %f\n",navlon);
-		fprintf(stderr,"dbg2       navlat:     %f\n",navlat);
-		fprintf(stderr,"dbg2       speed:      %f\n",speed);
-		fprintf(stderr,"dbg2       heading:    %f\n",heading);
-		fprintf(stderr,"dbg2       draft:      %f\n",draft);
-		fprintf(stderr,"dbg2       roll:       %f\n",roll);
-		fprintf(stderr,"dbg2       pitch:      %f\n",pitch);
-		fprintf(stderr,"dbg2       heave:      %f\n",heave);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_elacmk2_struct *) store_ptr;
-
-	/* insert data in structure */
-	if (store->kind == MB_DATA_DATA)
-		{
-		/* get time */
-		mb_unfix_y2k(verbose, time_i[0], &store->year);
-		store->month = time_i[1];
-		store->day = time_i[2];
-		store->hour = time_i[3];
-		store->minute = time_i[4];
-		store->second = time_i[5];
-		store->hundredth_sec = time_i[6]/10000;
-		store->thousandth_sec
-			= (time_i[6]
-			- 10000*store->hundredth_sec)/100;
-
-		/*get navigation */
-		store->longitude = navlon;
-		store->latitude = navlat;
-
-		/* get heading */
-		store->heading = (int) (heading *100);
-
-		/* get speed */
-		store->speed = speed / 3.6;
-
-		/* get draft */
-		store->transducer_starboard_depth = 100 * draft;
-		store->transducer_port_depth = 100 * draft;
-
-		/* get roll pitch and heave */
-		}
-
-	/* insert data in structure */
-	else if (store->kind == MB_DATA_NAV)
-		{
-		/* get time */
-		mb_unfix_y2k(verbose, time_i[0], &store->pos_year);
-		store->pos_month = time_i[1];
-		store->pos_day = time_i[2];
-		store->pos_hour = time_i[3];
-		store->pos_minute = time_i[4];
-		store->pos_second = time_i[5];
-		store->pos_hundredth_sec = time_i[6]/10000;
-		store->pos_thousandth_sec
-			= (time_i[6]
-			- 10000*store->hundredth_sec)/100;
-
-		/*get navigation */
-		store->pos_longitude = navlon / 0.00000009;
-		store->pos_latitude = navlat / 0.00000009;
-
-		/* get heading */
-		store->heading = (int) (heading *100);
-
-		/* get draft */
-		store->transducer_starboard_depth = 100 * draft;
-		store->transducer_port_depth = 100 * draft;
-
-		/* get roll pitch and heave */
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_elacmk2_extract_svp(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int *nsvp,
-		double *depth, double *velocity,
-		int *error)
-{
-	char	*function_name = "mbsys_elacmk2_extract_svp";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_elacmk2_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_elacmk2_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_VELOCITY_PROFILE)
-		{
-		/* get number of depth-velocity pairs */
-		*nsvp = store->svp_num;
-
-		/* get profile */
-		for (i=0;i<*nsvp;i++)
-			{
-			depth[i] = 0.1 * store->svp_depth[i];
-			velocity[i] = 0.1 * store->svp_vel[i];
-			}
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:              %d\n",*kind);
-		fprintf(stderr,"dbg2       nsvp:              %d\n",*nsvp);
-		for (i=0;i<*nsvp;i++)
-		    fprintf(stderr,"dbg2       depth[%d]: %f   velocity[%d]: %f\n",i, depth[i], i, velocity[i]);
-		fprintf(stderr,"dbg2       error:             %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:            %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_elacmk2_insert_svp(int verbose, void *mbio_ptr, void *store_ptr,
-		int nsvp,
-		double *depth, double *velocity,
-		int *error)
-{
-	char	*function_name = "mbsys_elacmk2_insert_svp";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_elacmk2_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       nsvp:       %d\n",nsvp);
-		for (i=0;i<nsvp;i++)
-		    fprintf(stderr,"dbg2       depth[%d]: %f   velocity[%d]: %f\n",i, depth[i], i, velocity[i]);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_elacmk2_struct *) store_ptr;
-
-	/* insert data in structure */
-	if (store->kind == MB_DATA_VELOCITY_PROFILE)
-		{
-		/* get number of depth-velocity pairs */
-		store->svp_num = MIN(nsvp, MBSYS_ELACMK2_MAXSVP);
-
-		/* get profile */
-		for (i=0;i<store->svp_num;i++)
-			{
-			store->svp_depth[i] = (int) (10 * depth[i]);
-			store->svp_vel[i] = (int) (10 * velocity[i]);
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_elacmk2_copy(int verbose, void *mbio_ptr,
-			void *store_ptr, void *copy_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_elacmk2_copy";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_elacmk2_struct *store;
-	struct mbsys_elacmk2_struct *copy;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       copy_ptr:   %p\n",(void *)copy_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointers */
-	store = (struct mbsys_elacmk2_struct *) store_ptr;
-	copy = (struct mbsys_elacmk2_struct *) copy_ptr;
-
-	/* copy the data */
-	*copy = *store;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mbsys_elacmk2.h b/src/mbio/mbsys_elacmk2.h
deleted file mode 100644
index 724331c..0000000
--- a/src/mbio/mbsys_elacmk2.h
+++ /dev/null
@@ -1,302 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbsys_elacmk2.h	6/10/97
- *	$Id: mbsys_elacmk2.h 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1997-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbsys_elacmk2.h defines the data structures used by MBIO functions
- * to store data from Elac BottomChart Mark II multibeam sonar systems.
- * The data formats which are commonly used to store Elac
- * data in files include
- *      MBF_ELMK2UNB : MBIO ID 92
- *
- *
- * Author:	D. W. Caress (L-DEO)
- * Date:	August 20, 1994
- *
- * $Log: mbsys_elacmk2.h,v $
- * Revision 5.7  2005/11/05 00:48:03  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.6  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.5  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.4  2002/07/20 20:42:40  caress
- * Release 5.0.beta20
- *
- * Revision 5.3  2001/07/20 00:32:54  caress
- * Release 5.0.beta03
- *
- * Revision 5.2  2001/06/08  21:44:01  caress
- * Version 5.0.beta01
- *
- * Revision 5.1  2001/01/22  07:43:34  caress
- * Version 5.0.beta01
- *
- * Revision 5.0  2000/12/01  22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.2  2000/09/30  06:31:19  caress
- * Snapshot for Dale.
- *
- * Revision 4.1  1998/10/05  17:46:15  caress
- * MB-System version 4.6beta
- *
- * Revision 4.0  1997/07/25  14:25:40  caress
- * Version 4.5beta2.
- *
- * Revision 1.1  1997/07/25  14:19:53  caress
- * Initial revision
- *
- */
-/*
- * Notes on the MBF_ELMK2UNB data format:
- *   1. Elac multibeam systems output binary data telegrams.
- *   2. Elac BottomChart Mark II sonar systems output both bathymetry
- *      and amplitude information for 126 beams per telegram.
- *   3. Each ping produces 42 beams.  A wide swath is constructed
- *      by successively pinging in different directions.
- *   4. Each telegram is preceded by a two byte start code and
- *      followed by a three byte end code consisting of 0x03
- *      followed by two bytes representing the checksum for
- *      the data bytes.  MB-System does not calculate checksums
- *      and puts 0's in the checksum bytes.
- *   5. The relevent telegram start codes, types, and sizes are:
- *         0x0250: Comment (Defined only for MB-System)   200 data bytes
- *         0x0251: Position                                36 data bytes
- *         0x0252: Parameter                               54 data bytes
- *         0x0253: Sound velocity profile                2016 data bytes
- *         0x0258: Mark II general bathymetry wrapper      24 data bytes
- *                 Mark II general bathymetry beam         28 data bytes
- *   6. Elac systems record navigation fixes using the position
- *      telegram; navigation is not included in the per ping data.
- *      Since speed is not recorded, it is impossible to extrapolate
- *      position from the last navigation fix when processing the
- *      data serially, as MBIO does.  It may thus be necessary to extract
- *      the navigation from the position telegrams and remerge it with
- *      the ping telegrams using the program mbmerge.
- *
- */
-
-/* sonar types */
-#define	MBSYS_ELACMK2_UNKNOWN	0
-#define	MBSYS_ELACMK2_BOTTOMCHART_MARKII	3
-
-/* maximum number of beams and pixels */
-#define	MBSYS_ELACMK2_MAXBEAMS		126
-#define	MBSYS_ELACMK2_MAXSVP		500
-#define	MBSYS_ELACMK2_COMMENT_LENGTH	200
-
-/* telegram types */
-#define	ELACMK2_NONE			0
-#define	ELACMK2_COMMENT			0x0250
-#define	ELACMK2_POS			0x0251
-#define	ELACMK2_PARAMETER		0x0252
-#define	ELACMK2_SVP			0x0253
-#define	ELACMK2_BATHGEN			0x0258
-
-/* telegram sizes */
-#define	ELACMK2_COMMENT_SIZE		200
-#define	ELACMK2_POS_SIZE		36
-#define	ELACMK2_PARAMETER_SIZE		54
-#define	ELACMK2_SVP_SIZE		2016
-#define	ELACMK2_BATH56_SIZE		848
-#define	ELACMK2_BATH40_SIZE		608
-#define	ELACMK2_BATH32_SIZE		488
-#define	ELACMK2_BATHGEN_HDR_SIZE	24
-#define	ELACMK2_BATHGEN_BEAM_SIZE	28
-
-/* internal data structure */
-
-struct mbsys_elacmk2_beam_struct
-	{
-	unsigned int	bath;		/* 0.01 m */
-	int	bath_acrosstrack;	/* 0.01 m */
-	int	bath_alongtrack;	/* 0.01 m */
-	unsigned int	tt;		/* 0.05 ms */
-	int	quality;		/* 1 (best) to 8 (worst) */
-	int	amplitude;		/* dB + 128 */
-	unsigned short	time_offset;	/* 0.5 ms */
-	short	heave;			/* 0.001 meters */
-	short	roll;			/* 0.005 degrees */
-	short	pitch;			/* 0.005 degrees */
-	short	angle;			/* 0.005 degrees */
-	};
-
-struct mbsys_elacmk2_struct
-	{
-	/* type of data record */
-	int	kind;			/* Data vs Comment */
-
-	/* type of sonar */
-	int	sonar;			/* Type of Elac sonar */
-
-	/* parameter info (parameter telegrams) */
-	int	par_year;
-	int	par_month;
-	int	par_day;
-	int	par_hour;
-	int	par_minute;
-	int	par_second;
-	int	par_hundredth_sec;
-	int	par_thousandth_sec;
-	short	roll_offset;	/* roll offset (degrees) */
-	short	pitch_offset;	/* pitch offset (degrees) */
-	short	heading_offset;	/* heading offset (degrees) */
-	short	time_delay;	/* positioning system delay (sec) */
-	short	transducer_port_height;
-	short	transducer_starboard_height;
-	short	transducer_port_depth;
-	short	transducer_starboard_depth;
-	short	transducer_port_x;
-	short	transducer_starboard_x;
-	short	transducer_port_y;
-	short	transducer_starboard_y;
-	short	transducer_port_error;
-	short	transducer_starboard_error;
-	short	antenna_height;
-	short	antenna_x;
-	short	antenna_y;
-	short	vru_height;
-	short	vru_x;
-	short	vru_y;
-	short	line_number;
-	short	start_or_stop;
-	short	transducer_serial_number;
-
-	/* comment */
-	char	comment[MBSYS_ELACMK2_COMMENT_LENGTH];
-
-	/* position (position telegrams) */
-	int	pos_year;
-	int	pos_month;
-	int	pos_day;
-	int	pos_hour;
-	int	pos_minute;
-	int	pos_second;
-	int	pos_hundredth_sec;
-	int	pos_thousandth_sec;
-	int	pos_latitude;		/* 180 deg = 2e9 */
-	int	pos_longitude;		/* 180 deg = 2e9 */
-	unsigned int	utm_northing;
-	unsigned int	utm_easting;
-	int	utm_zone_lon;		/* 180 deg = 2e9 */
-	char	utm_zone;
-	char	hemisphere;
-	char	ellipsoid;
-	char	pos_spare;
-	int	semi_major_axis;
-	int	other_quality;
-
-	/* sound velocity profile */
-	int	svp_year;
-	int	svp_month;
-	int	svp_day;
-	int	svp_hour;
-	int	svp_minute;
-	int	svp_second;
-	int	svp_hundredth_sec;
-	int	svp_thousandth_sec;
-	int	svp_latitude;		/* 180 deg = 2e9 */
-	int	svp_longitude;		/* 180 deg = 2e9 */
-	int	svp_num;
-	int	svp_depth[MBSYS_ELACMK2_MAXSVP]; /* 0.1 meters */
-	int	svp_vel[MBSYS_ELACMK2_MAXSVP];	/* 0.1 meters/sec */
-
-	/* general bathymetry */
-	int	year;
-	int	month;
-	int	day;
-	int	hour;
-	int	minute;
-	int	second;
-	int	hundredth_sec;
-	int	thousandth_sec;
-	double	longitude;
-	double	latitude;
-	double	speed;
-	int	ping_num;
-	int	sound_vel;		/* 0.1 m/s */
-	int	heading;		/* 0.01 deg */
-	int	pulse_length;		/* 0.01 ms */
-	int	mode;			/* 0: omni, 1: RDT (def) */
-	int	source_power;		/* 0: low, 1: high */
-	int	receiver_gain_stbd;	/* db */
-	int	receiver_gain_port;	/* db */
-	int	reserved;
-	int	beams_bath;		/* number of beams stored */
-	struct mbsys_elacmk2_beam_struct beams[MBSYS_ELACMK2_MAXBEAMS];
-	};
-
-/* system specific function prototypes */
-int mbsys_elacmk2_alloc(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error);
-int mbsys_elacmk2_deall(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error);
-int mbsys_elacmk2_dimensions(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int *nbath, int *namp, int *nss, int *error);
-int mbsys_elacmk2_extract(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int time_i[7], double *time_d,
-			double *navlon, double *navlat,
-			double *speed, double *heading,
-			int *nbath, int *namp, int *nss,
-			char *beamflag, double *bath, double *amp,
-			double *bathacrosstrack, double *bathalongtrack,
-			double *ss, double *ssacrosstrack, double *ssalongtrack,
-			char *comment, int *error);
-int mbsys_elacmk2_insert(int verbose, void *mbio_ptr, void *store_ptr,
-			int kind, int time_i[7], double time_d,
-			double navlon, double navlat,
-			double speed, double heading,
-			int nbath, int namp, int nss,
-			char *beamflag, double *bath, double *amp,
-			double *bathacrosstrack, double *bathalongtrack,
-			double *ss, double *ssacrosstrack, double *ssalongtrack,
-			char *comment, int *error);
-int mbsys_elacmk2_ttimes(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int *nbeams,
-			double *ttimes, double *angles,
-			double *angles_forward, double *angles_null,
-			double *heave, double *alongtrack_offset,
-			double *draft, double *ssv, int *error);
-int mbsys_elacmk2_detects(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int *nbeams, int *detects, int *error);
-int mbsys_elacmk2_extract_altitude(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, double *transducer_depth, double *altitude,
-			int *error);
-int mbsys_elacmk2_extract_nav(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int time_i[7], double *time_d,
-			double *navlon, double *navlat,
-			double *speed, double *heading, double *draft,
-			double *roll, double *pitch, double *heave,
-			int *error);
-int mbsys_elacmk2_insert_nav(int verbose, void *mbio_ptr, void *store_ptr,
-			int time_i[7], double time_d,
-			double navlon, double navlat,
-			double speed, double heading, double draft,
-			double roll, double pitch, double heave,
-			int *error);
-int mbsys_elacmk2_extract_svp(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind,
-			int *nsvp,
-			double *depth, double *velocity,
-			int *error);
-int mbsys_elacmk2_insert_svp(int verbose, void *mbio_ptr, void *store_ptr,
-			int nsvp,
-			double *depth, double *velocity,
-			int *error);
-int mbsys_elacmk2_copy(int verbose, void *mbio_ptr,
-			void *store_ptr, void *copy_ptr,
-			int *error);
diff --git a/src/mbio/mbsys_gsf.c b/src/mbio/mbsys_gsf.c
deleted file mode 100644
index 2c5b0ce..0000000
--- a/src/mbio/mbsys_gsf.c
+++ /dev/null
@@ -1,2709 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbsys_gsf.c	3.00	8/20/94
- *	$Id: mbsys_gsf.c 2249 2015-06-26 19:26:09Z caress $
- *
- *    Copyright (c) 1994-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbsys_gsf.c contains the functions for handling the data structure
- * used by MBIO functions to store data
- * from Gsf BottomChart Mark II multibeam sonar systems.
- * The data formats which are commonly used to store Gsf
- * data in files include
- *      MBF_ELUNB : MBIO ID 92
- *
- * Author:	D. W. Caress
- * Date:	March 5, 1998
- *
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mb_define.h"
-#include "mbsys_gsf.h"
-
-static char rcs_id[]="$Id: mbsys_gsf.c 2249 2015-06-26 19:26:09Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mbsys_gsf_alloc(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_gsf_alloc";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* allocate memory for data structure */
-	status = mb_malloc(verbose,sizeof(struct mbsys_gsf_struct),
-				store_ptr,error);
-	memset(*store_ptr, 0, sizeof(struct mbsys_gsf_struct));
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)*store_ptr);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_gsf_deall(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_gsf_deall";
-	int	status = MB_SUCCESS;
-	struct mbsys_gsf_struct *store;
-	gsfRecords	    *records;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)*store_ptr);
-		}
-
-	/* deallocate memory for data structure */
-	store =  (struct mbsys_gsf_struct *) *store_ptr;
-	records = &(store->records);
-	gsfFree(records);
-	status = mb_free(verbose,store_ptr,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_gsf_dimensions(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int *nbath, int *namp, int *nss, int *error)
-{
-	char	*function_name = "mbsys_gsf_dimensions";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_gsf_struct *store;
-	gsfDataID	    *dataID;
-	gsfRecords	    *records;
-	gsfSwathBathyPing   *mb_ping;
-	gsfTimeSeriesIntensity	*snippet;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_gsf_struct *) store_ptr;
-	dataID = &(store->dataID);
-	records = &(store->records);
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get beam and pixel numbers */
-		mb_ping = &(records->mb_ping);
-
-		if (mb_ping->depth != NULL)
-		    *nbath = mb_ping->number_beams;
-		else
-		    *nbath = 0;
-		if (mb_ping->mc_amplitude != NULL
-		    || mb_ping->mr_amplitude != NULL)
-		    *namp = mb_ping->number_beams;
-		else
-		    *namp = 0;
-		*nss = 0;
-		if (mb_ping->brb_inten != NULL)
-			{
-			for (i=0;i<*nbath;i++)
-				{
-				snippet = &(mb_ping->brb_inten->time_series[i]);
-				(*nss) += snippet->sample_count;
-				}
-			}
-		}
-	else
-		{
-		/* get beam and pixel numbers */
-		*nbath = 0;
-		*namp = 0;
-		*nss = 0;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		fprintf(stderr,"dbg2       nbath:      %d\n",*nbath);
-		fprintf(stderr,"dbg2        namp:      %d\n",*namp);
-		fprintf(stderr,"dbg2        nss:       %d\n",*nss);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_gsf_sonartype(int verbose, void *mbio_ptr, void *store_ptr,
-		int *sonartype, int *error)
-{
-	char	*function_name = "mbsys_gsf_sonartype";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_gsf_struct *store;
-	gsfDataID	    *dataID;
-	gsfRecords	    *records;
-	gsfSwathBathyPing   *mb_ping;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_gsf_struct *) store_ptr;
-	dataID = &(store->dataID);
-	records = &(store->records);
-	mb_ping = &(records->mb_ping);
-
-	/* get sonar type */
-	if (mb_ping->sensor_id == GSF_SWATH_BATHY_SUBRECORD_SEABEAM_SPECIFIC          /* 102 */
-		|| mb_ping->sensor_id == GSF_SWATH_BATHY_SUBRECORD_EM12_SPECIFIC      /* 103 */
-		|| mb_ping->sensor_id == GSF_SWATH_BATHY_SUBRECORD_EM100_SPECIFIC            /* 104 */
-		|| mb_ping->sensor_id == GSF_SWATH_BATHY_SUBRECORD_EM950_SPECIFIC            /* 105 */
-		|| mb_ping->sensor_id == GSF_SWATH_BATHY_SUBRECORD_EM121A_SPECIFIC           /* 106 */
-		|| mb_ping->sensor_id == GSF_SWATH_BATHY_SUBRECORD_EM121_SPECIFIC            /* 107 */
-		|| mb_ping->sensor_id == GSF_SWATH_BATHY_SUBRECORD_SASS_SPECIFIC             /* 108 */
-		|| mb_ping->sensor_id == GSF_SWATH_BATHY_SUBRECORD_SEAMAP_SPECIFIC           /* 109 */
-		|| mb_ping->sensor_id == GSF_SWATH_BATHY_SUBRECORD_SEABAT_SPECIFIC           /* 110 */
-		|| mb_ping->sensor_id == GSF_SWATH_BATHY_SUBRECORD_EM1000_SPECIFIC           /* 111 */
-		|| mb_ping->sensor_id == GSF_SWATH_BATHY_SUBRECORD_TYPEIII_SEABEAM_SPECIFIC  /* 112 */
-		|| mb_ping->sensor_id == GSF_SWATH_BATHY_SUBRECORD_SB_AMP_SPECIFIC           /* 113 */
-		|| mb_ping->sensor_id == GSF_SWATH_BATHY_SUBRECORD_SEABAT_II_SPECIFIC        /* 114 */
-		|| mb_ping->sensor_id == GSF_SWATH_BATHY_SUBRECORD_SEABAT_8101_SPECIFIC      /* 115 */
-		|| mb_ping->sensor_id == GSF_SWATH_BATHY_SUBRECORD_SEABEAM_2112_SPECIFIC     /* 116 */
-		|| mb_ping->sensor_id == GSF_SWATH_BATHY_SUBRECORD_ELAC_MKII_SPECIFIC        /* 117 */
-		|| mb_ping->sensor_id == GSF_SWATH_BATHY_SUBRECORD_EM3000_SPECIFIC           /* 118 */
-		|| mb_ping->sensor_id == GSF_SWATH_BATHY_SUBRECORD_EM1002_SPECIFIC           /* 119 */
-		|| mb_ping->sensor_id == GSF_SWATH_BATHY_SUBRECORD_EM300_SPECIFIC            /* 120 */
-		|| mb_ping->sensor_id == GSF_SWATH_BATHY_SUBRECORD_CMP_SASS_SPECIFIC         /* 121 */
-		|| mb_ping->sensor_id == GSF_SWATH_BATHY_SUBRECORD_RESON_8101_SPECIFIC       /* 122 */
-		|| mb_ping->sensor_id == GSF_SWATH_BATHY_SUBRECORD_RESON_8111_SPECIFIC       /* 123 */
-		|| mb_ping->sensor_id == GSF_SWATH_BATHY_SUBRECORD_RESON_8124_SPECIFIC       /* 124 */
-		|| mb_ping->sensor_id == GSF_SWATH_BATHY_SUBRECORD_RESON_8125_SPECIFIC       /* 125 */
-		|| mb_ping->sensor_id == GSF_SWATH_BATHY_SUBRECORD_RESON_8150_SPECIFIC       /* 126 */
-		|| mb_ping->sensor_id == GSF_SWATH_BATHY_SUBRECORD_RESON_8160_SPECIFIC       /* 127 */
-		|| mb_ping->sensor_id == GSF_SWATH_BATHY_SUBRECORD_EM120_SPECIFIC            /* 128 */
-		|| mb_ping->sensor_id == GSF_SWATH_BATHY_SUBRECORD_EM3002_SPECIFIC           /* 129 */
-		|| mb_ping->sensor_id == GSF_SWATH_BATHY_SUBRECORD_EM3000D_SPECIFIC          /* 130 */
-		|| mb_ping->sensor_id == GSF_SWATH_BATHY_SUBRECORD_EM3002D_SPECIFIC          /* 131 */
-		|| mb_ping->sensor_id == GSF_SWATH_BATHY_SUBRECORD_EM121A_SIS_SPECIFIC       /* 132 */
-		|| mb_ping->sensor_id == GSF_SWATH_BATHY_SUBRECORD_EM710_SPECIFIC            /* 133 */
-		|| mb_ping->sensor_id == GSF_SWATH_BATHY_SUBRECORD_EM302_SPECIFIC            /* 134 */
-		|| mb_ping->sensor_id == GSF_SWATH_BATHY_SUBRECORD_EM122_SPECIFIC            /* 135 */
-		|| mb_ping->sensor_id == GSF_SWATH_BATHY_SUBRECORD_RESON_7125_SPECIFIC       /* 138 */
-		|| mb_ping->sensor_id == GSF_SWATH_BATHY_SUBRECORD_EM2000_SPECIFIC           /* 139 */
-		|| mb_ping->sensor_id == GSF_SWATH_BATHY_SUBRECORD_EM300_RAW_SPECIFIC        /* 140 */
-		|| mb_ping->sensor_id == GSF_SWATH_BATHY_SUBRECORD_EM1002_RAW_SPECIFIC       /* 141 */
-		|| mb_ping->sensor_id == GSF_SWATH_BATHY_SUBRECORD_EM2000_RAW_SPECIFIC       /* 142 */
-		|| mb_ping->sensor_id == GSF_SWATH_BATHY_SUBRECORD_EM3000_RAW_SPECIFIC       /* 143 */
-		|| mb_ping->sensor_id == GSF_SWATH_BATHY_SUBRECORD_EM120_RAW_SPECIFIC        /* 144 */
-		|| mb_ping->sensor_id == GSF_SWATH_BATHY_SUBRECORD_EM3002_RAW_SPECIFIC       /* 145 */
-		|| mb_ping->sensor_id == GSF_SWATH_BATHY_SUBRECORD_EM3000D_RAW_SPECIFIC      /* 146 */
-		|| mb_ping->sensor_id == GSF_SWATH_BATHY_SUBRECORD_EM3002D_RAW_SPECIFIC      /* 147 */
-		|| mb_ping->sensor_id == GSF_SWATH_BATHY_SUBRECORD_EM121A_SIS_RAW_SPECIFIC   /* 148 */
-		|| mb_ping->sensor_id == GSF_SWATH_BATHY_SUBRECORD_EM2040_SPECIFIC           /* 149 */
-		|| mb_ping->sensor_id == GSF_SWATH_BATHY_SUBRECORD_DELTA_T_SPECIFIC          /* 150 */
-		|| mb_ping->sensor_id == GSF_SWATH_BATHY_SUBRECORD_R2SONIC_2022_SPECIFIC     /* 151 */
-		|| mb_ping->sensor_id == GSF_SWATH_BATHY_SUBRECORD_R2SONIC_2024_SPECIFIC     /* 152 */)
-		{
-		*sonartype = MB_TOPOGRAPHY_TYPE_MULTIBEAM;
-		}
-	else if (mb_ping->sensor_id == GSF_SWATH_BATHY_SUBRECORD_GEOSWATH_PLUS_SPECIFIC    /* 136 */
-		|| mb_ping->sensor_id == GSF_SWATH_BATHY_SUBRECORD_KLEIN_5410_BSS_SPECIFIC   /* 137 */)
-		{
-		*sonartype = MB_TOPOGRAPHY_TYPE_INTERFEROMETRIC;
-		}
-	else if (mb_ping->sensor_id == GSF_SWATH_BATHY_SUBRECORD_GEOSWATH_PLUS_SPECIFIC    /* 136 */
-		|| mb_ping->sensor_id == GSF_SWATH_BATHY_SUBRECORD_KLEIN_5410_BSS_SPECIFIC   /* 137 */)
-		{
-		*sonartype = MB_TOPOGRAPHY_TYPE_SIDESCAN;
-		}
-	else if (mb_ping->sensor_id == GSF_SINGLE_BEAM_SUBRECORD_ECHOTRAC_SPECIFIC     		/* 201 */
-		|| mb_ping->sensor_id == GSF_SINGLE_BEAM_SUBRECORD_BATHY2000_SPECIFIC		/* 202 */
-		|| mb_ping->sensor_id == GSF_SINGLE_BEAM_SUBRECORD_MGD77_SPECIFIC        	/* 203 */
-		|| mb_ping->sensor_id == GSF_SINGLE_BEAM_SUBRECORD_BDB_SPECIFIC          	/* 204 */
-		|| mb_ping->sensor_id == GSF_SINGLE_BEAM_SUBRECORD_NOSHDB_SPECIFIC       	/* 205 */
-		|| mb_ping->sensor_id == GSF_SWATH_BATHY_SB_SUBRECORD_ECHOTRAC_SPECIFIC		/* 206 */
-		|| mb_ping->sensor_id == GSF_SWATH_BATHY_SB_SUBRECORD_BATHY2000_SPECIFIC	/* 207 */
-		|| mb_ping->sensor_id == GSF_SWATH_BATHY_SB_SUBRECORD_MGD77_SPECIFIC		/* 208 */
-		|| mb_ping->sensor_id == GSF_SWATH_BATHY_SB_SUBRECORD_BDB_SPECIFIC		/* 209 */
-		|| mb_ping->sensor_id == GSF_SWATH_BATHY_SB_SUBRECORD_NOSHDB_SPECIFIC		/* 210 */
-		|| mb_ping->sensor_id == GSF_SWATH_BATHY_SB_SUBRECORD_PDD_SPECIFIC		/* 211 */
-		|| mb_ping->sensor_id == GSF_SWATH_BATHY_SB_SUBRECORD_NAVISOUND_SPECIFIC	/* 212 */)
-		{
-		*sonartype = MB_TOPOGRAPHY_TYPE_ECHOSOUNDER;
-		}
-	else
-		{
-		*sonartype = MB_TOPOGRAPHY_TYPE_UNKNOWN;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       sensor_id:  %d\n",mb_ping->sensor_id);
-		fprintf(stderr,"dbg2       sonartype:  %d\n",*sonartype);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_gsf_sidescantype(int verbose, void *mbio_ptr, void *store_ptr,
-		int *ss_type, int *error)
-{
-	char	*function_name = "mbsys_gsf_sidescantype";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_gsf_struct *store;
-	gsfDataID	    *dataID;
-	gsfRecords	    *records;
-	gsfSwathBathyPing   *mb_ping;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_gsf_struct *) store_ptr;
-	dataID = &(store->dataID);
-	records = &(store->records);
-	mb_ping = &(records->mb_ping);
-
-	/* get sidescan type */
-	if (mb_ping->sensor_id == GSF_SWATH_BATHY_SUBRECORD_SEABEAM_2112_SPECIFIC)
-		{
-		*ss_type = MB_SIDESCAN_LINEAR;
-		}
-	else
-		{
-		*ss_type = MB_SIDESCAN_LOGARITHMIC;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       ss_type:    %d\n",*ss_type);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_gsf_extract(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int time_i[7], double *time_d,
-		double *navlon, double *navlat,
-		double *speed, double *heading,
-		int *nbath, int *namp, int *nss,
-		char *beamflag, double *bath, double *amp,
-		double *bathacrosstrack, double *bathalongtrack,
-		double *ss, double *ssacrosstrack, double *ssalongtrack,
-		char *comment, int *error)
-{
-	char	*function_name = "mbsys_gsf_extract";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_gsf_struct *store;
-	gsfDataID	    *dataID;
-	gsfRecords	    *records;
-	gsfSwathBathyPing   *mb_ping;
-	gsfTimeSeriesIntensity	*snippet;
-	double	ss_spacing, ss_spacing_use;
-	double	vertical, range, beam_foot, sint, angle;
-	int	gsfstatus;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_gsf_struct *) store_ptr;
-	dataID = &(store->dataID);
-	records = &(store->records);
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		mb_ping = &(records->mb_ping);
-
-		/* get time */
-		*time_d = mb_ping->ping_time.tv_sec
-				+ 0.000000001 * mb_ping->ping_time.tv_nsec;
-		mb_get_date(verbose,*time_d,time_i);
-
-		/* get navigation */
-		if (mb_ping->longitude != GSF_NULL_LONGITUDE)
-			*navlon = mb_ping->longitude;
-		else
-			*navlon = 0.0;
-		if (mb_ping->latitude != GSF_NULL_LATITUDE)
-			*navlat = mb_ping->latitude;
-		else
-			*navlat = 0.0;
-
-		/* get heading */
-		if (mb_ping->heading != GSF_NULL_HEADING)
-			*heading = mb_ping->heading;
-		else
-			*heading = 0.0;
-
-		/* get speed */
-		if (mb_ping->speed != GSF_NULL_SPEED)
-			*speed = 1.852 * mb_ping->speed;
-		else
-			*speed = 0.0;
-
-		/* set beamwidths in mb_io structure */
-		gsfstatus = gsfGetSwathBathyBeamWidths(records,
-			&(mb_io_ptr->beamwidth_ltrack),
-			&(mb_io_ptr->beamwidth_xtrack));
-
-		/* if not set then use hard coded values */
-		if (mb_io_ptr->beamwidth_ltrack <= 0.0
-			|| mb_io_ptr->beamwidth_xtrack <= 0.0)
-			{
-			if (mb_ping->sensor_id
-			    == GSF_SWATH_BATHY_SUBRECORD_SEABEAM_SPECIFIC)
-			    {
-			    mb_io_ptr->beamwidth_ltrack = 2.67;
-			    mb_io_ptr->beamwidth_xtrack = 2.67;
-			    }
-			else if (mb_ping->sensor_id
-			    == GSF_SWATH_BATHY_SUBRECORD_EM100_SPECIFIC)
-			    {
-			    mb_io_ptr->beamwidth_ltrack = 3.3;
-			    mb_io_ptr->beamwidth_xtrack = 3.3;
-			    }
-			else if (mb_ping->sensor_id
-			    == GSF_SWATH_BATHY_SUBRECORD_EM950_SPECIFIC)
-			    {
-			    mb_io_ptr->beamwidth_ltrack = 3.3;
-			    mb_io_ptr->beamwidth_xtrack = 3.3;
-			    }
-			else if (mb_ping->sensor_id
-			    == GSF_SWATH_BATHY_SUBRECORD_EM121A_SPECIFIC)
-			    {
-			    mb_io_ptr->beamwidth_ltrack = 1.0;
-			    mb_io_ptr->beamwidth_xtrack = 1.0;
-			    }
-			else if (mb_ping->sensor_id
-			    == GSF_SWATH_BATHY_SUBRECORD_EM121_SPECIFIC)
-			    {
-			    mb_io_ptr->beamwidth_ltrack = 1.0;
-			    mb_io_ptr->beamwidth_xtrack = 1.0;
-			    }
-			else if (mb_ping->sensor_id
-			    == GSF_SWATH_BATHY_SUBRECORD_SEAMAP_SPECIFIC)
-			    {
-			    mb_io_ptr->beamwidth_ltrack = 2.0;
-			    mb_io_ptr->beamwidth_xtrack = 2.0;
-			    }
-			else if (mb_ping->sensor_id
-			    == GSF_SWATH_BATHY_SUBRECORD_SEABAT_SPECIFIC)
-			    {
-			    mb_io_ptr->beamwidth_ltrack = 1.5;
-			    mb_io_ptr->beamwidth_xtrack = 1.5;
-			    }
-			else if (mb_ping->sensor_id
-			    == GSF_SWATH_BATHY_SUBRECORD_EM1000_SPECIFIC)
-			    {
-			    mb_io_ptr->beamwidth_ltrack = 3.3;
-			    mb_io_ptr->beamwidth_xtrack = 3.3;
-			    }
-			else if (mb_ping->sensor_id
-			    == GSF_SWATH_BATHY_SUBRECORD_TYPEIII_SEABEAM_SPECIFIC)
-			    {
-			    mb_io_ptr->beamwidth_ltrack = 2.67;
-			    mb_io_ptr->beamwidth_xtrack = 2.67;
-			    }
-			else if (mb_ping->sensor_id
-			    == GSF_SWATH_BATHY_SUBRECORD_SB_AMP_SPECIFIC)
-			    {
-			    mb_io_ptr->beamwidth_ltrack = 2.0;
-			    mb_io_ptr->beamwidth_xtrack = 2.0;
-			    }
-			else if (mb_ping->sensor_id
-			    == GSF_SWATH_BATHY_SUBRECORD_SEABAT_II_SPECIFIC)
-			    {
-			    mb_io_ptr->beamwidth_ltrack = 1.5;
-			    mb_io_ptr->beamwidth_xtrack = 1.5;
-			    }
-			else if (mb_ping->sensor_id
-			    == GSF_SWATH_BATHY_SUBRECORD_SEABAT_8101_SPECIFIC)
-			    {
-			    mb_io_ptr->beamwidth_ltrack = 1.5;
-			    mb_io_ptr->beamwidth_xtrack = 1.5;
-			    }
-			else if (mb_ping->sensor_id
-			    == GSF_SWATH_BATHY_SUBRECORD_SEABEAM_2112_SPECIFIC)
-			    {
-			    mb_io_ptr->beamwidth_ltrack = 2.0;
-			    mb_io_ptr->beamwidth_xtrack = 2.0;
-			    }
-			else if (mb_ping->sensor_id
-			    == GSF_SWATH_BATHY_SUBRECORD_ELAC_MKII_SPECIFIC)
-			    {
-			    mb_io_ptr->beamwidth_ltrack = 1.5;
-			    mb_io_ptr->beamwidth_xtrack = 2.8;
-			    }
-			else if (mb_ping->sensor_id
-			    == GSF_SWATH_BATHY_SUBRECORD_ELAC_MKII_SPECIFIC)
-			    {
-			    mb_io_ptr->beamwidth_ltrack = 1.5;
-			    mb_io_ptr->beamwidth_xtrack = 2.8;
-			    }
-			else if (mb_ping->sensor_id
-			    == GSF_SWATH_BATHY_SUBRECORD_GEOSWATH_PLUS_SPECIFIC)
-			    {
-			    mb_io_ptr->beamwidth_ltrack = 1.0;
-			    mb_io_ptr->beamwidth_xtrack = 0.1;
-			    }
-			else
-			    {
-			    mb_io_ptr->beamwidth_ltrack = 2.0;
-			    mb_io_ptr->beamwidth_xtrack = 2.0;
-			    }
-			}
-
-		/* get numbers of beams and pixels */
-		if (mb_ping->depth != NULL)
-		    *nbath = mb_ping->number_beams;
-		else
-		    *nbath = 0;
-		if (mb_ping->mc_amplitude != NULL
-		    || mb_ping->mr_amplitude != NULL)
-		    *namp = mb_ping->number_beams;
-		else
-		    *namp = 0;
-		*nss = 0;
-
-		/* read depth and beam location values into storage arrays */
-		for (i=0;i<*nbath;i++)
-			{
-			/* set null beam flag if required */
-			if (mb_ping->depth[i] == 0.0
-			    && mb_ping->across_track[i] == 0.0
-			    && mb_ping->beam_flags[i] != MB_FLAG_NULL)
-			    mb_ping->beam_flags[i] = MB_FLAG_NULL;
-
-			beamflag[i] = mb_ping->beam_flags[i];
-			bath[i] = mb_ping->depth[i];
-			bathacrosstrack[i] = mb_ping->across_track[i];
-			bathalongtrack[i] = mb_ping->along_track[i];
-			}
-
-		/* set beamflags if ping flag set */
-/*		if (mb_ping->ping_flags != 0)
-		    {
-		    for (i=0;i<*nbath;i++)
-			if (mb_beam_ok(beamflag[i]))
-			    beamflag[i]
-				= mb_beam_set_flag_manual(beamflag[i]);
-		    }*/
-
-		/* read amplitude values into storage arrays */
-		if (mb_ping->mc_amplitude != NULL)
-		for (i=0;i<*namp;i++)
-			{
-			amp[i] = mb_ping->mc_amplitude[i];
-			}
-		else if (mb_ping->mr_amplitude != NULL)
-		for (i=0;i<*namp;i++)
-			{
-			amp[i] = mb_ping->mr_amplitude[i];
-			}
-
-		/* read multibeam sidescan if available */
-		if (mb_ping->brb_inten != NULL)
-			{
-			/* get sample rate and raw sidescan sample size */
-			if (mb_ping->sensor_id
-					== GSF_SWATH_BATHY_SUBRECORD_RESON_8101_SPECIFIC
-				|| mb_ping->sensor_id
-					== GSF_SWATH_BATHY_SUBRECORD_RESON_8111_SPECIFIC
-				|| mb_ping->sensor_id
-					== GSF_SWATH_BATHY_SUBRECORD_RESON_8124_SPECIFIC
-				|| mb_ping->sensor_id
-					== GSF_SWATH_BATHY_SUBRECORD_RESON_8125_SPECIFIC
-				|| mb_ping->sensor_id
-					== GSF_SWATH_BATHY_SUBRECORD_RESON_8150_SPECIFIC
-				|| mb_ping->sensor_id
-					== GSF_SWATH_BATHY_SUBRECORD_RESON_8160_SPECIFIC)
-				{
-				ss_spacing = 750.0 / ((double)mb_ping->sensor_data.gsfReson8100Specific.sample_rate);
-				}
-			else if (mb_ping->sensor_id
-					== GSF_SWATH_BATHY_SUBRECORD_EM3000_SPECIFIC
-				|| mb_ping->sensor_id
-					== GSF_SWATH_BATHY_SUBRECORD_EM1002_SPECIFIC
-				|| mb_ping->sensor_id
-					== GSF_SWATH_BATHY_SUBRECORD_EM300_SPECIFIC
-				|| mb_ping->sensor_id
-					== GSF_SWATH_BATHY_SUBRECORD_EM120_SPECIFIC
-				|| mb_ping->sensor_id
-					== GSF_SWATH_BATHY_SUBRECORD_EM3002_SPECIFIC
-				|| mb_ping->sensor_id
-					== GSF_SWATH_BATHY_SUBRECORD_EM3000D_SPECIFIC
-				|| mb_ping->sensor_id
-					== GSF_SWATH_BATHY_SUBRECORD_EM3002D_SPECIFIC)
-				{
-				ss_spacing = 750.0 / ((double)mb_ping->sensor_data.gsfEM3Specific.sample_rate);
-				}
-			*nss = 0;
-			for (i=0;i<*nbath;i++)
-				{
-				/* get pixel sample size */
-				snippet = &(mb_ping->brb_inten->time_series[i]);
-				vertical = mb_ping->depth[i] - mb_ping->depth_corrector;
-				range = sqrt(vertical * vertical + bathacrosstrack[i] * bathacrosstrack[i]);
-				angle = 90.0 - fabs(mb_ping->beam_angle[i]);
-				beam_foot = range * sin(DTR * mb_io_ptr->beamwidth_xtrack)
-							/ cos(DTR * angle);
-				sint = fabs(sin(DTR * angle));
-				if (sint < snippet->sample_count * ss_spacing / beam_foot)
-				    ss_spacing_use = beam_foot / snippet->sample_count;
-				else
-				    ss_spacing_use = ss_spacing / sint;
-				for (j=0;j<snippet->sample_count;j++)
-					{
-					ss[*nss] = snippet->samples[j];
-					ssacrosstrack[*nss] = bathacrosstrack[i]
-						+ ss_spacing_use * (j - snippet->detect_sample);
-					ssalongtrack[*nss] = bathalongtrack[i];
-					(*nss)++;
-					}
-				}
-			}
-			
-		/* print debug statements */
-		if (verbose >= 5)
-			{
-			fprintf(stderr,"\ndbg4  Data extracted by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  Extracted values:\n");
-			fprintf(stderr,"dbg4       kind:       %d\n",
-				*kind);
-			fprintf(stderr,"dbg4       error:      %d\n",
-				*error);
-			fprintf(stderr,"dbg4       time_i[0]:  %d\n",
-				time_i[0]);
-			fprintf(stderr,"dbg4       time_i[1]:  %d\n",
-				time_i[1]);
-			fprintf(stderr,"dbg4       time_i[2]:  %d\n",
-				time_i[2]);
-			fprintf(stderr,"dbg4       time_i[3]:  %d\n",
-				time_i[3]);
-			fprintf(stderr,"dbg4       time_i[4]:  %d\n",
-				time_i[4]);
-			fprintf(stderr,"dbg4       time_i[5]:  %d\n",
-				time_i[5]);
-			fprintf(stderr,"dbg4       time_i[6]:  %d\n",
-				time_i[6]);
-			fprintf(stderr,"dbg4       time_d:     %f\n",
-				*time_d);
-			fprintf(stderr,"dbg4       longitude:  %f\n",
-				*navlon);
-			fprintf(stderr,"dbg4       latitude:   %f\n",
-				*navlat);
-			fprintf(stderr,"dbg4       speed:      %f\n",
-				*speed);
-			fprintf(stderr,"dbg4       heading:    %f\n",
-				*heading);
-			fprintf(stderr,"dbg4       nbath:      %d\n",
-				*nbath);
-			for (i=0;i<*nbath;i++)
-			  fprintf(stderr,"dbg4       beam:%d  flag:%3d  bath:%f  acrosstrack:%f  alongtrack:%f\n",
-				i,beamflag[i],bath[i],bathacrosstrack[i],bathalongtrack[i]);
-			fprintf(stderr,"dbg4        namp:     %d\n",
-				*namp);
-			for (i=0;i<*namp;i++)
-			  fprintf(stderr,"dbg4        beam:%d   amp:%f  acrosstrack:%f  alongtrack:%f\n",
-				i,amp[i],bathacrosstrack[i],bathalongtrack[i]);
-			}
-
-		/* done translating values */
-
-		}
-
-	/* extract comment from structure */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* copy comment */
-		if (records->comment.comment_length > 0
-		    && records->comment.comment != NULL)
-			strcpy(comment, records->comment.comment);
-		else
-			comment[0] = '\0';
-
-		/* print debug statements */
-		if (verbose >= 4)
-			{
-			fprintf(stderr,"\ndbg4  Comment extracted by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  New ping values:\n");
-			fprintf(stderr,"dbg4       error:      %d\n",
-				*error);
-			fprintf(stderr,"dbg4       comment:    %s\n",
-				comment);
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind == MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"dbg2       comment:     \ndbg2       %s\n",
-			comment);
-		}
-	else if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind != MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"dbg2       time_i[0]:     %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:     %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:     %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:     %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:     %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:     %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:     %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:        %f\n",*time_d);
-		fprintf(stderr,"dbg2       longitude:     %f\n",*navlon);
-		fprintf(stderr,"dbg2       latitude:      %f\n",*navlat);
-		fprintf(stderr,"dbg2       speed:         %f\n",*speed);
-		fprintf(stderr,"dbg2       heading:       %f\n",*heading);
-		}
-	if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind == MB_DATA_DATA)
-		{
-		fprintf(stderr,"dbg2       nbath:      %d\n",
-			*nbath);
-		for (i=0;i<*nbath;i++)
-		  fprintf(stderr,"dbg2       beam:%d  flag:%3d  bath:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,beamflag[i],bath[i],
-			bathacrosstrack[i],bathalongtrack[i]);
-		fprintf(stderr,"dbg2        namp:     %d\n",
-			*namp);
-		for (i=0;i<*namp;i++)
-		  fprintf(stderr,"dbg2       beam:%d   amp:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,amp[i],bathacrosstrack[i],bathalongtrack[i]);
-		fprintf(stderr,"dbg2        nss:      %d\n",
-			*nss);
-		for (i=0;i<*nss;i++)
-		  fprintf(stderr,"dbg2       pixel:%d   ss:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,ss[i],ssacrosstrack[i],ssalongtrack[i]);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_gsf_insert(int verbose, void *mbio_ptr, void *store_ptr,
-		int kind, int time_i[7], double time_d,
-		double navlon, double navlat,
-		double speed, double heading,
-		int nbath, int namp, int nss,
-		char *beamflag, double *bath, double *amp,
-		double *bathacrosstrack, double *bathalongtrack,
-		double *ss, double *ssacrosstrack, double *ssalongtrack,
-		char *comment, int *error)
-{
-	char	*function_name = "mbsys_gsf_insert";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_gsf_struct *store;
-	gsfDataID	    *dataID;
-	gsfRecords	    *records;
-	gsfSwathBathyPing   *mb_ping;
-	int	anyunflagged;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       kind:       %d\n",kind);
-		}
-	if (verbose >= 2 && (kind == MB_DATA_DATA || kind == MB_DATA_NAV))
-		{
-		fprintf(stderr,"dbg2       time_i[0]:  %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:  %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:  %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:  %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:  %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:  %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:  %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:     %f\n",time_d);
-		fprintf(stderr,"dbg2       navlon:     %f\n",navlon);
-		fprintf(stderr,"dbg2       navlat:     %f\n",navlat);
-		fprintf(stderr,"dbg2       speed:      %f\n",speed);
-		fprintf(stderr,"dbg2       heading:    %f\n",heading);
-		}
-	if (verbose >= 2 && kind == MB_DATA_DATA)
-		{
-		fprintf(stderr,"dbg2       nbath:      %d\n",nbath);
-		if (verbose >= 3)
-		 for (i=0;i<nbath;i++)
-		  fprintf(stderr,"dbg3       beam:%d  flag:%3d  bath:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,beamflag[i],bath[i],
-			bathacrosstrack[i],bathalongtrack[i]);
-		fprintf(stderr,"dbg2       namp:       %d\n",namp);
-		if (verbose >= 3)
-		 for (i=0;i<namp;i++)
-		  fprintf(stderr,"dbg3        beam:%d   amp:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,amp[i],bathacrosstrack[i],bathalongtrack[i]);
-		}
-	if (verbose >= 2 && kind == MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"dbg2       comment:     \ndbg2       %s\n",
-			comment);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_gsf_struct *) store_ptr;
-	records = &(store->records);
-	dataID = &(store->dataID);
-	mb_ping = &(records->mb_ping);
-
-	/* set data kind */
-	store->kind = kind;
-
-	/* insert data in structure */
-	if (store->kind == MB_DATA_DATA)
-		{
-		dataID->recordID = GSF_RECORD_SWATH_BATHYMETRY_PING;
-		mb_ping = &(records->mb_ping);
-
-		/* get time */
-		mb_ping->ping_time.tv_sec = (int) time_d;
-		mb_ping->ping_time.tv_nsec = (int) (1000000000 * (time_d - mb_ping->ping_time.tv_sec));
-
-		/* get navigation */
-		if (navlon != 0.0)
-			mb_ping->longitude = navlon;
-		else
-			mb_ping->longitude = GSF_NULL_LONGITUDE;
-		if (navlat != 0.0)
-			mb_ping->latitude = navlat;
-		else
-			mb_ping->longitude = GSF_NULL_LATITUDE;
-
-		/* get heading */
-		if (heading != 0.0)
-			mb_ping->heading = heading;
-		else
-			mb_ping->heading = GSF_NULL_HEADING;
-
-		/* get speed */
-		if (speed != 0.0)
-			mb_ping->speed = speed / 1.852;
-		else
-			mb_ping->speed = speed;
-
-		/* get numbers of beams */
-		mb_ping->number_beams = nbath;
-
-		/* allocate memory in arrays if required */
-		if (nbath > mb_ping->number_beams)
-		    {
-		    mb_ping->beam_flags
-			= (unsigned char *)
-			    realloc(mb_ping->beam_flags,
-					nbath * sizeof(char));
-		    mb_ping->depth
-			= (double *) realloc(mb_ping->depth, nbath * sizeof(double));
-		    mb_ping->across_track = (double *) realloc(mb_ping->across_track, nbath * sizeof(double));
-		    mb_ping->along_track = (double *) realloc(mb_ping->along_track, nbath * sizeof(double));
-		    if (mb_ping->beam_flags == NULL
-			|| mb_ping->depth == NULL
-			|| mb_ping->across_track == NULL
-			|| mb_ping->along_track == NULL)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_MEMORY_FAIL;
-			}
-		    }
-		if (namp > mb_ping->number_beams
-		    && mb_ping->mc_amplitude != NULL)
-		    {
-		    mb_ping->mc_amplitude = (double *) realloc(mb_ping->mc_amplitude, namp * sizeof(double));
-		    if (mb_ping->mc_amplitude == NULL)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_MEMORY_FAIL;
-			}
-		    }
-		else if (namp > mb_ping->number_beams
-		    && mb_ping->mr_amplitude != NULL)
-		    {
-		    mb_ping->mr_amplitude = (double *) realloc(mb_ping->mr_amplitude, namp * sizeof(double));
-		    if (mb_ping->mr_amplitude == NULL)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_MEMORY_FAIL;
-			}
-		    }
-		mb_ping->number_beams = nbath;
-
-		/* if ping flag set check for any unset
-		    beam flags - set or unset ping flag based on whether any
-		    unflagged beams are found */
-		anyunflagged = MB_NO;
-		for (i=0;i<nbath;i++)
-			{
-			if (mb_beam_ok(beamflag[i]))
-			    anyunflagged = MB_YES;
-			}
-		if (anyunflagged == MB_NO)
-			mb_ping->ping_flags = GSF_IGNORE_PING;
-		else
-			mb_ping->ping_flags = 0;
-
-		/* read depth and beam location values into storage arrays */
-		for (i=0;i<nbath;i++)
-			{
-			mb_ping->beam_flags[i] = beamflag[i];
-			if (beamflag[i] != MB_FLAG_NULL)
-			    {
-			    mb_ping->depth[i] = bath[i];
-			    mb_ping->across_track[i] = bathacrosstrack[i];
-			    mb_ping->along_track[i] = bathalongtrack[i];
-			    }
-			else
-			    {
-			    mb_ping->depth[i] = GSF_NULL_DEPTH;
-			    mb_ping->across_track[i] = GSF_NULL_ACROSS_TRACK;
-			    mb_ping->along_track[i] = GSF_NULL_ALONG_TRACK;
-			    }
-			}
-
-		/* read amplitude values into storage arrays */
-		if (mb_ping->mc_amplitude != NULL)
-		for (i=0;i<namp;i++)
-			{
-			mb_ping->mc_amplitude[i] = amp[i];
-			}
-		else if (mb_ping->mr_amplitude != NULL)
-		for (i=0;i<namp;i++)
-			{
-			mb_ping->mr_amplitude[i] = amp[i];
-			}
-
-		/* reset GSF scale factors if needed */
-		mbsys_gsf_setscalefactors(verbose, MB_NO, mb_ping, error);
-			
-		}
-
-	/* insert comment in structure */
-	else if (store->kind == MB_DATA_COMMENT)
-		{
-		dataID->recordID = GSF_RECORD_COMMENT;
-		if (records->comment.comment_length < strlen(comment) + 1)
-		    {
-		    if ((records->comment.comment
-				= (char *)
-				    realloc(records->comment.comment,
-					strlen(comment)+1))
-					    == NULL)
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_MEMORY_FAIL;
-			records->comment.comment_length = 0;
-			}
-		    }
-		if (status == MB_SUCCESS && records->comment.comment != NULL)
-		    {
-		    strcpy(records->comment.comment, comment);
-		    records->comment.comment_length = strlen(comment)+1;
-		    records->comment.comment_time.tv_sec = (int) time_d;
-		    records->comment.comment_time.tv_nsec
-			    = (int) (1000000000
-				* (time_d
-					- records->comment.comment_time.tv_sec));
-		    }
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_gsf_ttimes(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, int *nbeams,
-	double *ttimes, double *angles,
-	double *angles_forward, double *angles_null,
-	double *heave, double *alongtrack_offset,
-	double *draft, double *ssv, int *error)
-{
-	char	*function_name = "mbsys_gsf_ttimes";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_gsf_struct *store;
-	gsfDataID	    *dataID;
-	gsfRecords	    *records;
-	gsfSwathBathyPing   *mb_ping;
-	double	alpha, beta;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       ttimes:     %p\n",(void *)ttimes);
-		fprintf(stderr,"dbg2       angles_xtrk:%p\n",(void *)angles);
-		fprintf(stderr,"dbg2       angles_ltrk:%p\n",(void *)angles_forward);
-		fprintf(stderr,"dbg2       angles_null:%p\n",(void *)angles_null);
-		fprintf(stderr,"dbg2       heave:      %p\n",(void *)heave);
-		fprintf(stderr,"dbg2       ltrk_off:   %p\n",(void *)alongtrack_offset);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_gsf_struct *) store_ptr;
-	records = &(store->records);
-	dataID = &(store->dataID);
-	mb_ping = &(records->mb_ping);
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-	    {
-	    /* get nbeams */
-	    *nbeams = mb_ping->number_beams;
-
-	    /* get travel times, angles */
-	    if (mb_ping->travel_time != NULL
-		&& mb_ping->beam_angle != NULL)
-		{
-		if (mb_ping->beam_angle_forward != NULL)
-		    {
-		    for (i=0;i<*nbeams;i++)
-			{
-			ttimes[i] = mb_ping->travel_time[i];
-			angles[i] = fabs(mb_ping->beam_angle[i]);
-			angles_forward[i] = mb_ping->beam_angle_forward[i];
-			if (mb_ping->beam_angle[i] < 0.0
-				&& mb_ping->across_track[i] < 0.0
-				&& (fabs(mb_ping->beam_angle_forward[i]) < 90.0
-				    || fabs(mb_ping->beam_angle_forward[i]) > 270.0))
-				{
-				angles_forward[i] += 180.0;
-				}
-			heave[i] = mb_ping->heave;
-			alongtrack_offset[i] = 0.0;
-			}
-		    }
-		else
-		    {
-		    for (i=0;i<*nbeams;i++)
-			{
-			ttimes[i] = mb_ping->travel_time[i];
-			angles[i] = fabs(mb_ping->beam_angle[i]);
-			if (mb_ping->across_track[i] < 0.0
-			    || mb_ping->beam_angle[i] < 0.0)
-				angles_forward[i] = 180.0;
-			else
-				angles_forward[i] = 0.0;
-			heave[i] = mb_ping->heave;
-			alongtrack_offset[i] = 0.0;
-			}
-		    }
-
-		/* get surface sound velocity and
-		    effective array mount angles */
-		if (mb_ping->sensor_id
-		    == GSF_SWATH_BATHY_SUBRECORD_SEABEAM_SPECIFIC)
-		    {
-		    *ssv = 1500.0;
-		    *draft = mb_ping->depth_corrector;
-		    for (i=0;i<*nbeams;i++)
-			angles_null[i] = 0.0;
-		    }
-		else if (mb_ping->sensor_id
-		    == GSF_SWATH_BATHY_SUBRECORD_EM100_SPECIFIC)
-		    {
-		    *ssv = 1500.0;
-		    *draft = mb_ping->depth_corrector;
-		    for (i=0;i<*nbeams;i++)
-			    angles_null[i] = angles[i];
-		    }
-		else if (mb_ping->sensor_id
-		    == GSF_SWATH_BATHY_SUBRECORD_EM950_SPECIFIC)
-		    {
-		    *ssv = mb_ping->sensor_data.gsfEM950Specific.surface_velocity;
-		    *draft = mb_ping->depth_corrector;
-		    for (i=0;i<*nbeams;i++)
-			    angles_null[i] = angles[i];
-		    }
-		else if (mb_ping->sensor_id
-		    == GSF_SWATH_BATHY_SUBRECORD_EM121A_SPECIFIC)
-		    {
-		    *ssv = mb_ping->sensor_data.gsfEM121ASpecific.surface_velocity;
-		    *draft = mb_ping->depth_corrector;
-		    for (i=0;i<*nbeams;i++)
-			angles_null[i] = 0.0;
-		    }
-		else if (mb_ping->sensor_id
-		    == GSF_SWATH_BATHY_SUBRECORD_EM121_SPECIFIC)
-		    {
-		    *ssv = mb_ping->sensor_data.gsfEM121Specific.surface_velocity;
-		    *draft = mb_ping->depth_corrector;
-		    for (i=0;i<*nbeams;i++)
-			angles_null[i] = 0.0;
-		    }
-		else if (mb_ping->sensor_id
-		    == GSF_SWATH_BATHY_SUBRECORD_SEAMAP_SPECIFIC)
-		    {
-		    *ssv = 1500.0;
-		    *draft = mb_ping->depth_corrector;
-		    for (i=0;i<*nbeams;i++)
-			    angles_null[i] = 50.0;
-		    }
-		else if (mb_ping->sensor_id
-		    == GSF_SWATH_BATHY_SUBRECORD_SEABAT_SPECIFIC)
-		    {
-		    *ssv = mb_ping->sensor_data.gsfSeaBatSpecific.surface_velocity;
-		    *draft = mb_ping->depth_corrector;
-		    if (mb_ping->beam_angle_forward == NULL)
-			{
-			for (i=0;i<*nbeams;i++)
-			    {
-			    if (mb_ping->across_track[i] < 0.0
-				&& mb_ping->beam_angle[i] > 0.0)
-				beta = 90.0 + mb_ping->beam_angle[i];
-			    else
-				beta = 90.0 - mb_ping->beam_angle[i];
-			    alpha = mb_ping->pitch;
-			    mb_rollpitch_to_takeoff(verbose,
-				alpha, beta, &angles[i],
-				&angles_forward[i], error);
-			    }
-			}
-		    for (i=0;i<*nbeams;i++)
-			    angles_null[i] = angles[i];
-		    }
-		else if (mb_ping->sensor_id
-		    == GSF_SWATH_BATHY_SUBRECORD_EM1000_SPECIFIC)
-		    {
-		    *ssv = mb_ping->sensor_data.gsfEM1000Specific.surface_velocity;
-		    *draft = mb_ping->depth_corrector;
-		    for (i=0;i<*nbeams;i++)
-			    angles_null[i] = angles[i];
-		    }
-		else if (mb_ping->sensor_id
-		    == GSF_SWATH_BATHY_SUBRECORD_TYPEIII_SEABEAM_SPECIFIC)
-		    {
-		    *ssv = 1500.0;
-		    *draft = mb_ping->depth_corrector;
-		    for (i=0;i<*nbeams;i++)
-			angles_null[i] = 0.0;
-		    }
-		else if (mb_ping->sensor_id
-		    == GSF_SWATH_BATHY_SUBRECORD_SB_AMP_SPECIFIC)
-		    {
-		    *ssv = 1500.0;
-		    *draft = mb_ping->depth_corrector;
-		    for (i=0;i<*nbeams;i++)
-			angles_null[i] = 0.0;
-		    }
-		else if (mb_ping->sensor_id
-		    == GSF_SWATH_BATHY_SUBRECORD_SEABAT_II_SPECIFIC)
-		    {
-		    *ssv = mb_ping->sensor_data.gsfSeaBatIISpecific.surface_velocity;
-		    *draft = mb_ping->depth_corrector;
-		    if (mb_ping->beam_angle_forward == NULL)
-			{
-			for (i=0;i<*nbeams;i++)
-			    {
-			    if (mb_ping->across_track[i] < 0.0
-				&& mb_ping->beam_angle[i] > 0.0)
-				beta = 90.0 + mb_ping->beam_angle[i];
-			    else
-				beta = 90.0 - mb_ping->beam_angle[i];
-			    alpha = mb_ping->pitch;
-			    mb_rollpitch_to_takeoff(verbose,
-				alpha, beta, &angles[i],
-				&angles_forward[i], error);
-			    }
-			}
-		    for (i=0;i<*nbeams;i++)
-			    angles_null[i] = angles[i];
-		    }
-		else if (mb_ping->sensor_id
-		    == GSF_SWATH_BATHY_SUBRECORD_SEABAT_8101_SPECIFIC)
-		    {
-		    *ssv = mb_ping->sensor_data.gsfSeaBat8101Specific.surface_velocity;
-		    *draft = mb_ping->depth_corrector;
-		    if (mb_ping->beam_angle_forward == NULL)
-			{
-			for (i=0;i<*nbeams;i++)
-			    {
-			    if (mb_ping->across_track[i] < 0.0
-				&& mb_ping->beam_angle[i] > 0.0)
-				beta = 90.0 + mb_ping->beam_angle[i];
-			    else
-				beta = 90.0 - mb_ping->beam_angle[i];
-			    alpha = mb_ping->pitch;
-			    mb_rollpitch_to_takeoff(verbose,
-				alpha, beta, &angles[i],
-				&angles_forward[i], error);
-			    }
-			}
-		    for (i=0;i<*nbeams;i++)
-			    angles_null[i] = angles[i];
-		    }
-		else if (mb_ping->sensor_id
-		    == GSF_SWATH_BATHY_SUBRECORD_RESON_8101_SPECIFIC)
-		    {
-		    *ssv = mb_ping->sensor_data.gsfReson8100Specific.surface_velocity;
-		    *draft = mb_ping->depth_corrector;
-		    for (i=0;i<*nbeams;i++)
-			    angles_null[i] = angles[i];
-		    }
-		else if (mb_ping->sensor_id
-		    == GSF_SWATH_BATHY_SUBRECORD_SEABEAM_2112_SPECIFIC)
-		    {
-		    *ssv = mb_ping->sensor_data.gsfSeaBeam2112Specific.surface_velocity;
-		    *draft = mb_ping->depth_corrector;
-		    for (i=0;i<*nbeams;i++)
-			angles_null[i] = 0.0;
-		    }
-		else if (mb_ping->sensor_id
-		    == GSF_SWATH_BATHY_SUBRECORD_ELAC_MKII_SPECIFIC)
-		    {
-		    *ssv = mb_ping->sensor_data.gsfElacMkIISpecific.sound_vel;
-		    *draft = mb_ping->depth_corrector;
-		    if (mb_ping->beam_angle_forward == NULL)
-			{
-			for (i=0;i<*nbeams;i++)
-			    {
-			    beta = 90.0 - mb_ping->beam_angle[i];
-			    alpha = mb_ping->pitch;
-			    mb_rollpitch_to_takeoff(verbose,
-				alpha, beta, &angles[i],
-				&angles_forward[i], error);
-			    }
-			}
-		    for (i=0;i<*nbeams;i++)
-			    angles_null[i] = 37.5;
-		    }
-		else
-		    {
-		    *ssv = 1500.0;
-		    *draft = mb_ping->depth_corrector;
-		    for (i=0;i<*nbeams;i++)
-			angles_null[i] = 0.0;
-		    }
-		}
-
-	    /* set status */
-	    *error = MB_ERROR_NO_ERROR;
-	    status = MB_SUCCESS;
-
-	    /* done translating values */
-
-	    }
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error == MB_ERROR_NO_ERROR)
-		{
-		fprintf(stderr,"dbg2       draft:      %f\n",*draft);
-		fprintf(stderr,"dbg2       ssv:        %f\n",*ssv);
-		fprintf(stderr,"dbg2       nbeams:     %d\n",*nbeams);
-		for (i=0;i<*nbeams;i++)
-			fprintf(stderr,"dbg2       beam %d: tt:%f  angle_xtrk:%f  angle_ltrk:%f  angle_null:%f  heave:%f  ltrk_off:%f\n",
-				i,ttimes[i],angles[i],
-				angles_forward[i],angles_null[i],
-				heave[i],alongtrack_offset[i]);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_gsf_detects(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, int *nbeams,
-	int *detects, int *error)
-{
-	char	*function_name = "mbsys_gsf_detects";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_gsf_struct *store;
-	gsfDataID	    *dataID;
-	gsfRecords	    *records;
-	gsfSwathBathyPing   *mb_ping;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       detects:    %p\n",(void *)detects);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_gsf_struct *) store_ptr;
-	records = &(store->records);
-	dataID = &(store->dataID);
-	mb_ping = &(records->mb_ping);
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get nbeams */
-		*nbeams = mb_ping->number_beams;
-
-		/* get detects */
-		for (i=0;i<*nbeams;i++)
-			{
-			detects[i] = MB_DETECT_UNKNOWN;
-			}
-
-		/* set status */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error == MB_ERROR_NO_ERROR)
-		{
-		fprintf(stderr,"dbg2       nbeams:     %d\n",*nbeams);
-		for (i=0;i<*nbeams;i++)
-			fprintf(stderr,"dbg2       beam %d: detects:%d\n",
-				i,detects[i]);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_gsf_extract_altitude(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, double *transducer_depth, double *altitude,
-	int *error)
-{
-	char	*function_name = "mbsys_gsf_extract_altitude";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_gsf_struct *store;
-	gsfDataID	    *dataID;
-	gsfRecords	    *records;
-	gsfSwathBathyPing   *mb_ping;
-	double	bath_best;
-	double	xtrack_min;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_gsf_struct *) store_ptr;
-	records = &(store->records);
-	dataID = &(store->dataID);
-	mb_ping = &(records->mb_ping);
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-	    {
-	    /* reset depth_corrector to zero if necessary */
-	    if (mb_ping->depth_corrector == GSF_NULL_DEPTH_CORRECTOR)
-		{
-		mb_ping->depth_corrector = 0.0;
-		}
-	    if (mb_ping->heave == GSF_NULL_HEAVE)
-		{
-		mb_ping->heave = 0.0;
-		}
-
-	    /* get transducer_depth */
-	    *transducer_depth = mb_ping->depth_corrector + mb_ping->heave;
-
-	    /* get altitude if available */
-	    if (mb_ping->sensor_id
-		== GSF_SWATH_BATHY_SUBRECORD_SEAMAP_SPECIFIC)
-		{
-		*altitude = mb_ping->sensor_data.gsfSeamapSpecific.altitude;
-		}
-
-	    /* else get altitude from depth */
-	    else if (mb_ping->depth != NULL)
-		{
-		bath_best = 0.0;
-		if (mb_beam_ok(mb_ping->beam_flags[mb_ping->number_beams/2]))
-			{
-			bath_best = mb_ping->depth[mb_ping->number_beams/2];
-			}
-		else
-		    {
-		    xtrack_min = 99999999.9;
-		    for (i=0;i<mb_ping->number_beams;i++)
-			{
-			if (mb_beam_ok(mb_ping->beam_flags[i])
-			    && fabs(mb_ping->across_track[i]) < xtrack_min)
-			    {
-			    xtrack_min = fabs(mb_ping->across_track[i]);
-			    bath_best = mb_ping->depth[i];
-			    }
-			}
-		    }
-		if (bath_best <= 0.0)
-		    {
-		    xtrack_min = 99999999.9;
-		    for (i=0;i<mb_ping->number_beams;i++)
-			{
-			if (!mb_beam_check_flag(mb_ping->beam_flags[i])
-			    && fabs(mb_ping->across_track[i]) < xtrack_min)
-			    {
-			    xtrack_min = fabs(mb_ping->across_track[i]);
-			    bath_best = mb_ping->depth[i];
-			    }
-			}
-		    }
-		*altitude = bath_best - *transducer_depth;
-		}
-
-	    /* else no info */
-	    else
-		{
-		*altitude = 0.0;
-		}
-
-	    /* set status */
-	    *error = MB_ERROR_NO_ERROR;
-	    status = MB_SUCCESS;
-
-	    /* done translating values */
-
-	    }
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:              %d\n",*kind);
-		fprintf(stderr,"dbg2       transducer_depth:  %f\n",*transducer_depth);
-		fprintf(stderr,"dbg2       altitude:          %f\n",*altitude);
-		fprintf(stderr,"dbg2       error:             %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:            %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_gsf_insert_altitude(int verbose, void *mbio_ptr, void *store_ptr,
-	double transducer_depth, double altitude,
-	int *error)
-{
-	char	*function_name = "mbsys_gsf_insert_altitude";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_gsf_struct *store;
-	gsfDataID	    *dataID;
-	gsfRecords	    *records;
-	gsfSwathBathyPing   *mb_ping;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:           %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:            %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:         %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       transducer_depth:  %f\n",transducer_depth);
-		fprintf(stderr,"dbg2       altitude:          %f\n",altitude);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_gsf_struct *) store_ptr;
-	records = &(store->records);
-	dataID = &(store->dataID);
-	mb_ping = &(records->mb_ping);
-
-	/* insert data into structure */
-	if (store->kind == MB_DATA_DATA)
-	    {
-	    mb_ping->depth_corrector = transducer_depth - mb_ping->heave;
-
-	    /* set altitude if possible */
-	    if (mb_ping->sensor_id
-		== GSF_SWATH_BATHY_SUBRECORD_SEAMAP_SPECIFIC)
-		{
-		mb_ping->sensor_data.gsfSeamapSpecific.altitude = altitude;
-		}
-
-	    /* get scale factor for bathymetry */
-	    // gsfSetDefaultScaleFactor(mb_ping);
-
-	    /* set status */
-	    *error = MB_ERROR_NO_ERROR;
-	    status = MB_SUCCESS;
-
-	    /* done translating values */
-
-	    }
-
-	/* deal with comment */
-	else if (store->kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:             %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:            %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_gsf_extract_nav(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int time_i[7], double *time_d,
-		double *navlon, double *navlat,
-		double *speed, double *heading, double *draft,
-		double *roll, double *pitch, double *heave,
-		int *error)
-{
-	char	*function_name = "mbsys_gsf_extract_nav";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_gsf_struct *store;
-	gsfDataID	    *dataID;
-	gsfRecords	    *records;
-	gsfSwathBathyPing   *mb_ping;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_gsf_struct *) store_ptr;
-	records = &(store->records);
-	dataID = &(store->dataID);
-	mb_ping = &(records->mb_ping);
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get time */
-		*time_d = mb_ping->ping_time.tv_sec
-				+ 0.000000001 * mb_ping->ping_time.tv_nsec;
-		mb_get_date(verbose,*time_d,time_i);
-
-		/* get navigation */
-		if (mb_ping->longitude != GSF_NULL_LONGITUDE)
-			*navlon = mb_ping->longitude;
-		else
-			*navlon = 0.0;
-		if (mb_ping->latitude != GSF_NULL_LATITUDE)
-			*navlat = mb_ping->latitude;
-		else
-			*navlat = 0.0;
-
-		/* get heading */
-		if (mb_ping->heading != GSF_NULL_HEADING)
-			*heading = mb_ping->heading;
-		else
-			*heading = 0.0;
-
-		/* get speed */
-		if (mb_ping->speed != GSF_NULL_SPEED)
-			*speed = 1.852 * mb_ping->speed;
-		else
-			*speed = 0.0;
-
-		/* get draft */
-		if (mb_ping->depth_corrector != GSF_NULL_DEPTH_CORRECTOR)
-			*draft = mb_ping->depth_corrector;
-		else
-			*draft = 0.0;
-
-		/* get roll pitch and heave */
-		*roll = mb_ping->roll;
-		*pitch = mb_ping->pitch;
-		*heave = mb_ping->heave;
-
-		if (mb_ping->roll != GSF_NULL_ROLL)
-			*roll = mb_ping->roll;
-		else
-			*roll = 0.0;
-		if (mb_ping->pitch != GSF_NULL_PITCH)
-			*pitch = mb_ping->pitch;
-		else
-			*pitch = 0.0;
-		if (mb_ping->heave != GSF_NULL_HEAVE)
-			*heave = mb_ping->heave;
-		else
-			*heave = 0.0;
-
-		/* print debug statements */
-		if (verbose >= 5)
-			{
-			fprintf(stderr,"\ndbg4  Data extracted by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  Extracted values:\n");
-			fprintf(stderr,"dbg4       kind:       %d\n",
-				*kind);
-			fprintf(stderr,"dbg4       error:      %d\n",
-				*error);
-			fprintf(stderr,"dbg4       time_i[0]:  %d\n",
-				time_i[0]);
-			fprintf(stderr,"dbg4       time_i[1]:  %d\n",
-				time_i[1]);
-			fprintf(stderr,"dbg4       time_i[2]:  %d\n",
-				time_i[2]);
-			fprintf(stderr,"dbg4       time_i[3]:  %d\n",
-				time_i[3]);
-			fprintf(stderr,"dbg4       time_i[4]:  %d\n",
-				time_i[4]);
-			fprintf(stderr,"dbg4       time_i[5]:  %d\n",
-				time_i[5]);
-			fprintf(stderr,"dbg4       time_i[6]:  %d\n",
-				time_i[6]);
-			fprintf(stderr,"dbg4       time_d:     %f\n",
-				*time_d);
-			fprintf(stderr,"dbg4       longitude:  %f\n",
-				*navlon);
-			fprintf(stderr,"dbg4       latitude:   %f\n",
-				*navlat);
-			fprintf(stderr,"dbg4       speed:      %f\n",
-				*speed);
-			fprintf(stderr,"dbg4       heading:    %f\n",
-				*heading);
-			fprintf(stderr,"dbg4       draft:      %f\n",
-				*draft);
-			fprintf(stderr,"dbg4       roll:       %f\n",
-				*roll);
-			fprintf(stderr,"dbg4       pitch:      %f\n",
-				*pitch);
-			fprintf(stderr,"dbg4       heave:      %f\n",
-				*heave);
-			}
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind == MB_DATA_DATA)
-		{
-		fprintf(stderr,"dbg2       time_i[0]:     %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:     %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:     %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:     %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:     %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:     %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:     %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:        %f\n",*time_d);
-		fprintf(stderr,"dbg2       longitude:     %f\n",*navlon);
-		fprintf(stderr,"dbg2       latitude:      %f\n",*navlat);
-		fprintf(stderr,"dbg2       speed:         %f\n",*speed);
-		fprintf(stderr,"dbg2       heading:       %f\n",*heading);
-		fprintf(stderr,"dbg2       draft:         %f\n",*draft);
-		fprintf(stderr,"dbg2       roll:          %f\n",*roll);
-		fprintf(stderr,"dbg2       pitch:         %f\n",*pitch);
-		fprintf(stderr,"dbg2       heave:         %f\n",*heave);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_gsf_insert_nav(int verbose, void *mbio_ptr, void *store_ptr,
-		int time_i[7], double time_d,
-		double navlon, double navlat,
-		double speed, double heading, double draft,
-		double roll, double pitch, double heave,
-		int *error)
-{
-	char	*function_name = "mbsys_gsf_insert_nav";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_gsf_struct *store;
-	gsfDataID	    *dataID;
-	gsfRecords	    *records;
-	gsfSwathBathyPing   *mb_ping;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       time_i[0]:  %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:  %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:  %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:  %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:  %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:  %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:  %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:     %f\n",time_d);
-		fprintf(stderr,"dbg2       navlon:     %f\n",navlon);
-		fprintf(stderr,"dbg2       navlat:     %f\n",navlat);
-		fprintf(stderr,"dbg2       speed:      %f\n",speed);
-		fprintf(stderr,"dbg2       heading:    %f\n",heading);
-		fprintf(stderr,"dbg2       draft:      %f\n",draft);
-		fprintf(stderr,"dbg2       roll:       %f\n",roll);
-		fprintf(stderr,"dbg2       pitch:      %f\n",pitch);
-		fprintf(stderr,"dbg2       heave:      %f\n",heave);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_gsf_struct *) store_ptr;
-	records = &(store->records);
-	dataID = &(store->dataID);
-	mb_ping = &(records->mb_ping);
-
-	/* insert data in structure */
-	if (store->kind == MB_DATA_DATA)
-		{
-
-		/* get time */
-		mb_ping->ping_time.tv_sec = (int) time_d;
-		mb_ping->ping_time.tv_nsec
-			= (int) (1000000000
-			    * (time_d
-				    - mb_ping->ping_time.tv_sec));
-
-		/* get navigation */
-		if (navlon != 0.0)
-			mb_ping->longitude = navlon;
-		else
-			mb_ping->longitude = GSF_NULL_LONGITUDE;
-		if (navlat != 0.0)
-			mb_ping->latitude = navlat;
-		else
-			mb_ping->longitude = GSF_NULL_LATITUDE;
-
-		/* get heading */
-		if (heading != 0.0)
-			mb_ping->heading = heading;
-		else
-			mb_ping->heading = GSF_NULL_HEADING;
-
-		/* get speed */
-		if (speed != 0.0)
-			mb_ping->speed = speed / 1.852;
-		else
-			mb_ping->speed = speed;
-
-		/* get draft */
-		if (draft != 0.0)
-			mb_ping->depth_corrector = draft;
-		else
-			mb_ping->depth_corrector = GSF_NULL_DEPTH_CORRECTOR;
-
-		/* get roll pitch and heave */
-		if (roll != 0.0)
-			mb_ping->roll = roll;
-		else
-			mb_ping->roll = GSF_NULL_ROLL;
-		if (pitch != 0.0)
-			mb_ping->pitch = pitch;
-		else
-			mb_ping->pitch = GSF_NULL_PITCH;
-		if (heave != 0.0)
-			mb_ping->heave = heave;
-		else
-			mb_ping->heave = GSF_NULL_HEAVE;
-
-		/* get scale factors */
-		// gsfSetDefaultScaleFactor(mb_ping);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_gsf_extract_svp(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int *nsvp,
-		double *depth, double *velocity,
-		int *error)
-{
-	char	*function_name = "mbsys_gsf_extract_svp";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_gsf_struct *store;
-	gsfDataID	    *dataID;
-	gsfRecords	    *records;
-	gsfSVP		    *svp;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_gsf_struct *) store_ptr;
-	records = &(store->records);
-	dataID = &(store->dataID);
-	svp = &(records->svp);
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_VELOCITY_PROFILE)
-		{
-		/* get number of depth-velocity pairs */
-		*nsvp = svp->number_points;
-
-		/* get profile */
-		for (i=0;i<*nsvp;i++)
-			{
-			depth[i] = svp->depth[i];
-			velocity[i] = svp->sound_speed[i];
-			}
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:              %d\n",*kind);
-		fprintf(stderr,"dbg2       nsvp:              %d\n",*nsvp);
-		for (i=0;i<*nsvp;i++)
-		    fprintf(stderr,"dbg2       depth[%d]: %f   velocity[%d]: %f\n",i, depth[i], i, velocity[i]);
-		fprintf(stderr,"dbg2       error:             %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:            %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_gsf_insert_svp(int verbose, void *mbio_ptr, void *store_ptr,
-		int nsvp,
-		double *depth, double *velocity,
-		int *error)
-{
-	char	*function_name = "mbsys_gsf_insert_svp";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_gsf_struct *store;
-	gsfDataID	    *dataID;
-	gsfRecords	    *records;
-	gsfSVP		    *svp;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       nsvp:       %d\n",nsvp);
-		for (i=0;i<nsvp;i++)
-		    fprintf(stderr,"dbg2       depth[%d]: %f   velocity[%d]: %f\n",i, depth[i], i, velocity[i]);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_gsf_struct *) store_ptr;
-	records = &(store->records);
-	dataID = &(store->dataID);
-	svp = &(records->svp);
-
-	/* insert data in structure */
-	if (store->kind == MB_DATA_VELOCITY_PROFILE)
-		{
-		/* allocate memory if required */
-		if (nsvp > svp->number_points
-		    || svp->depth == NULL
-		    || svp->sound_speed == NULL)
-		    {
-		    svp->depth = (double *) realloc(svp->depth, nsvp * sizeof(double));
-		    svp->sound_speed = (double *) realloc(svp->sound_speed, nsvp * sizeof(double));
-		    }
-
-		/* get number of depth-velocity pairs */
-		svp->number_points = nsvp;
-
-		/* get profile */
-		for (i=0;i<svp->number_points;i++)
-			{
-			svp->depth[i] = depth[i];
-			svp->sound_speed[i] = velocity[i];
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_gsf_copy(int verbose, void *mbio_ptr,
-			void *store_ptr, void *copy_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_gsf_copy";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_gsf_struct *store;
-	struct mbsys_gsf_struct *copy;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       copy_ptr:   %p\n",(void *)copy_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointers */
-	store = (struct mbsys_gsf_struct *) store_ptr;
-	copy = (struct mbsys_gsf_struct *) copy_ptr;
-
-	/* clear copy structure */
-	gsfFree(&(copy->records));
-	gsfCopyRecords(&(copy->records), &(store->records));
-	copy->kind = store->kind;
-	copy->dataID = store->dataID;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_gsf_setscalefactors(int verbose, int reset_all, gsfSwathBathyPing *mb_ping, int *error)
-{
-	char	*function_name = "mbsys_gsf_setscalefactors";
-	int	status = MB_SUCCESS;
-
-	const double GSF_DEPTH_ASSUMED_HIGHEST_PRECISION = 10000;
-	const double GSF_ACROSS_TRACK_ASSUMED_HIGHEST_PRECISION = 10000;
-	const double GSF_ALONG_TRACK_ASSUMED_HIGHEST_PRECISION = 100000;
-	const double GSF_TRAVEL_TIME_ASSUMED_HIGHEST_PRECISION = 10e6;
-	const double GSF_BEAM_ANGLE_ASSUMED_HIGHEST_PRECISION = 1000;
-	const double GSF_MEAN_CAL_AMPLITUDE_ASSUMED_HIGHEST_PRECISION = 10;
-	const double GSF_MEAN_REL_AMPLITUDE_ASSUMED_HIGHEST_PRECISION = 100;
-	const double GSF_ECHO_WIDTH_ASSUMED_HIGHEST_PRECISION = 10e5;
-	const double GSF_QUALITY_FACTOR_ASSUMED_HIGHEST_PRECISION = 100;
-	const double GSF_RECEIVE_HEAVE_ASSUMED_HIGHEST_PRECISION = 10000;
-	const double GSF_DEPTH_ERROR_ASSUMED_HIGHEST_PRECISION = 10000;
-	const double GSF_ACROSS_TRACK_ERROR_ASSUMED_HIGHEST_PRECISION = 10000;
-	const double GSF_ALONG_TRACK_ERROR_ASSUMED_HIGHEST_PRECISION = 10000;
-	const double GSF_NOMINAL_DEPTH_ASSUMED_HIGHEST_PRECISION = 10000;
-	const double GSF_QUALITY_FLAGS_ASSUMED_HIGHEST_PRECISION = 100;
-	const double GSF_BEAM_FLAGS_ASSUMED_HIGHEST_PRECISION = 100;
-	const double GSF_SIGNAL_TO_NOISE_ASSUMED_HIGHEST_PRECISION = 100;
-	const double GSF_BEAM_ANGLE_FORWARD_ASSUMED_HIGHEST_PRECISION = 100;
-	const double GSF_VERTICAL_ERROR_ASSUMED_HIGHEST_PRECISION = 10000;
-	const double GSF_HORIZONTAL_ERROR_ASSUMED_HIGHEST_PRECISION = 10000;
-	const double GSF_SECTOR_NUMBER_ASSUMED_HIGHEST_PRECISION = 100;
-	const double GSF_DETECTION_INFO_ASSUMED_HIGHEST_PRECISION = 100;
-	const double GSF_INCIDENT_BEAM_ADJ_ASSUMED_HIGHEST_PRECISION = 100;
-	const double GSF_SYSTEM_CLEANING_ASSUMED_HIGHEST_PRECISION = 100;
-	const double GSF_DOPPLER_CORRECTION_ASSUMED_HIGHEST_PRECISION = 100;
-	const double GSF_SONAR_VERT_UNCERT_ASSUMED_HIGHEST_PRECISION = 10000;
-    
-	int             i, j; /* iterators */
-	double          *dptr; /* pointer to ping array */
-	unsigned short  *usptr; /* pointer to ping array */
-	unsigned char   *ucptr; /* pointer to ping array */
-	int             id; /* type of ping array subrecord */
-	double          max, min; /* min and max value of each ping array */
-	double          max_scale_factor, min_scale_factor; /* min and max allowable size of values in ping array */
-	double          highest_precision; /* starting value for multiplier */
-	double		multiplier, offset, multiplier_min, multiplier_max;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:     %d\n",verbose);
-		fprintf(stderr,"dbg2       reset_all:   %d\n",reset_all);
-		fprintf(stderr,"dbg2       mb_ping:     %p\n",(void *)mb_ping);
-		}
-
-	for (i = 1; i <= GSF_MAX_PING_ARRAY_SUBRECORDS; i++)
-		{
-		dptr = NULL;
-		usptr = NULL;
-    
-		switch (i)
-			{
-			case GSF_SWATH_BATHY_SUBRECORD_DEPTH_ARRAY:
-				dptr = mb_ping->depth;
-				highest_precision = GSF_DEPTH_ASSUMED_HIGHEST_PRECISION;
-				id = GSF_SWATH_BATHY_SUBRECORD_DEPTH_ARRAY;
-				if ((mb_ping->scaleFactors.scaleTable[i - 1].compressionFlag & 0xF0) == GSF_FIELD_SIZE_FOUR)
-					{
-					max_scale_factor = UINT_MAX;
-					min_scale_factor = 0;
-					}
-				else
-					{
-					max_scale_factor = USHRT_MAX;
-					min_scale_factor = 0;
-					}
-				break;
-			case GSF_SWATH_BATHY_SUBRECORD_ACROSS_TRACK_ARRAY:
-				dptr = mb_ping->across_track;
-				highest_precision = GSF_ACROSS_TRACK_ASSUMED_HIGHEST_PRECISION;
-				id = GSF_SWATH_BATHY_SUBRECORD_ACROSS_TRACK_ARRAY;
-				if ((mb_ping->scaleFactors.scaleTable[i - 1].compressionFlag & 0xF0) == GSF_FIELD_SIZE_FOUR)
-					{
-					max_scale_factor = INT_MAX;
-					min_scale_factor = INT_MIN;
-					}
-				else
-					{
-					max_scale_factor = SHRT_MAX;
-					min_scale_factor = SHRT_MIN;
-					}
-				break;
-			case GSF_SWATH_BATHY_SUBRECORD_ALONG_TRACK_ARRAY:
-				dptr = mb_ping->along_track;
-				highest_precision = GSF_ALONG_TRACK_ASSUMED_HIGHEST_PRECISION;
-				id = GSF_SWATH_BATHY_SUBRECORD_ALONG_TRACK_ARRAY;
-				if ((mb_ping->scaleFactors.scaleTable[i - 1].compressionFlag & 0xF0) == GSF_FIELD_SIZE_FOUR)
-					{
-					max_scale_factor = INT_MAX;
-					min_scale_factor = INT_MIN;
-					}
-				else
-					{
-					max_scale_factor = SHRT_MAX;
-					min_scale_factor = SHRT_MIN;
-					}
-				break;
-			case GSF_SWATH_BATHY_SUBRECORD_TRAVEL_TIME_ARRAY:
-				dptr = mb_ping->travel_time;
-				highest_precision = GSF_TRAVEL_TIME_ASSUMED_HIGHEST_PRECISION;
-				id = GSF_SWATH_BATHY_SUBRECORD_TRAVEL_TIME_ARRAY;
-				max_scale_factor = USHRT_MAX;
-				min_scale_factor = 0;
-				break;
-			case GSF_SWATH_BATHY_SUBRECORD_BEAM_ANGLE_ARRAY:
-				dptr = mb_ping->beam_angle;
-				highest_precision = GSF_BEAM_ANGLE_ASSUMED_HIGHEST_PRECISION;
-				id = GSF_SWATH_BATHY_SUBRECORD_BEAM_ANGLE_ARRAY;
-				if ((mb_ping->scaleFactors.scaleTable[i - 1].compressionFlag & 0xF0) == GSF_FIELD_SIZE_FOUR)
-					{
-					max_scale_factor = INT_MAX;
-					min_scale_factor = INT_MIN;
-					}
-				else
-					{
-					max_scale_factor = SHRT_MAX;
-					min_scale_factor = SHRT_MIN;
-					}
-				break;
-			case GSF_SWATH_BATHY_SUBRECORD_MEAN_CAL_AMPLITUDE_ARRAY:
-				dptr = mb_ping->mc_amplitude;
-				highest_precision = GSF_MEAN_CAL_AMPLITUDE_ASSUMED_HIGHEST_PRECISION;
-				id = GSF_SWATH_BATHY_SUBRECORD_MEAN_CAL_AMPLITUDE_ARRAY;
-				max_scale_factor = SCHAR_MAX;
-				min_scale_factor = SCHAR_MIN;
-				break;
-			case GSF_SWATH_BATHY_SUBRECORD_MEAN_REL_AMPLITUDE_ARRAY:
-				dptr = mb_ping->mr_amplitude;
-				highest_precision = GSF_MEAN_REL_AMPLITUDE_ASSUMED_HIGHEST_PRECISION;
-				id = GSF_SWATH_BATHY_SUBRECORD_MEAN_REL_AMPLITUDE_ARRAY;
-				max_scale_factor = UCHAR_MAX;
-				min_scale_factor = 0;
-				break;
-			case GSF_SWATH_BATHY_SUBRECORD_ECHO_WIDTH_ARRAY:
-				dptr = mb_ping->echo_width;
-				highest_precision = GSF_ECHO_WIDTH_ASSUMED_HIGHEST_PRECISION;
-				id = GSF_SWATH_BATHY_SUBRECORD_ECHO_WIDTH_ARRAY;
-				max_scale_factor = UCHAR_MAX;
-				min_scale_factor = 0;
-				break;
-			case GSF_SWATH_BATHY_SUBRECORD_QUALITY_FACTOR_ARRAY:
-				dptr = mb_ping->quality_factor;
-				highest_precision = GSF_QUALITY_FACTOR_ASSUMED_HIGHEST_PRECISION;
-				id = GSF_SWATH_BATHY_SUBRECORD_QUALITY_FACTOR_ARRAY;
-				max_scale_factor = UCHAR_MAX;
-				min_scale_factor = 0;
-				break;
-			case GSF_SWATH_BATHY_SUBRECORD_RECEIVE_HEAVE_ARRAY:
-				dptr = mb_ping->receive_heave;
-				highest_precision = GSF_RECEIVE_HEAVE_ASSUMED_HIGHEST_PRECISION;
-				id = GSF_SWATH_BATHY_SUBRECORD_RECEIVE_HEAVE_ARRAY;
-				max_scale_factor = UCHAR_MAX;
-				min_scale_factor = 0;
-				break;
-			case GSF_SWATH_BATHY_SUBRECORD_DEPTH_ERROR_ARRAY:
-				dptr = mb_ping->depth_error;
-				highest_precision = GSF_DEPTH_ERROR_ASSUMED_HIGHEST_PRECISION;
-				id = GSF_SWATH_BATHY_SUBRECORD_DEPTH_ERROR_ARRAY;
-				if ((mb_ping->scaleFactors.scaleTable[i - 1].compressionFlag & 0xF0) == GSF_FIELD_SIZE_FOUR)
-					{
-					max_scale_factor = UINT_MAX;
-					min_scale_factor = 0;
-					}
-				else
-					{
-					max_scale_factor = USHRT_MAX;
-					min_scale_factor = 0;
-					}
-				break;
-			case GSF_SWATH_BATHY_SUBRECORD_ACROSS_TRACK_ERROR_ARRAY:
-				dptr = mb_ping->across_track_error;
-				highest_precision = GSF_ACROSS_TRACK_ERROR_ASSUMED_HIGHEST_PRECISION;
-				id = GSF_SWATH_BATHY_SUBRECORD_ACROSS_TRACK_ERROR_ARRAY;
-				if ((mb_ping->scaleFactors.scaleTable[i - 1].compressionFlag & 0xF0) == GSF_FIELD_SIZE_FOUR)
-					{
-					max_scale_factor = UINT_MAX;
-					min_scale_factor = 0;
-					}
-				else
-					{
-					max_scale_factor = USHRT_MAX;
-					min_scale_factor = 0;
-					}
-				break;
-			case GSF_SWATH_BATHY_SUBRECORD_ALONG_TRACK_ERROR_ARRAY:
-				dptr = mb_ping->along_track_error;
-				highest_precision = GSF_ALONG_TRACK_ERROR_ASSUMED_HIGHEST_PRECISION;
-				id = GSF_SWATH_BATHY_SUBRECORD_ALONG_TRACK_ERROR_ARRAY;
-				if ((mb_ping->scaleFactors.scaleTable[i - 1].compressionFlag & 0xF0) == GSF_FIELD_SIZE_FOUR)
-					{
-					max_scale_factor = UINT_MAX;
-					min_scale_factor = 0;
-					}
-				else
-					{
-					max_scale_factor = USHRT_MAX;
-					min_scale_factor = 0;
-					}
-				break;
-			case GSF_SWATH_BATHY_SUBRECORD_NOMINAL_DEPTH_ARRAY:
-				dptr = mb_ping->nominal_depth;
-				highest_precision = GSF_NOMINAL_DEPTH_ASSUMED_HIGHEST_PRECISION;
-				id = GSF_SWATH_BATHY_SUBRECORD_NOMINAL_DEPTH_ARRAY;
-				if ((mb_ping->scaleFactors.scaleTable[i - 1].compressionFlag & 0xF0) == GSF_FIELD_SIZE_FOUR)
-					{
-					max_scale_factor = UINT_MAX;
-					min_scale_factor = 0;
-					}
-				else
-					{
-					max_scale_factor = USHRT_MAX;
-					min_scale_factor = 0;
-					}
-				break;
-			case GSF_SWATH_BATHY_SUBRECORD_QUALITY_FLAGS_ARRAY:
-				ucptr = mb_ping->quality_flags;
-				highest_precision = GSF_QUALITY_FLAGS_ASSUMED_HIGHEST_PRECISION;
-				id = GSF_SWATH_BATHY_SUBRECORD_QUALITY_FLAGS_ARRAY;
-				max_scale_factor = UCHAR_MAX;
-				min_scale_factor = 0;
-				break;
-			case GSF_SWATH_BATHY_SUBRECORD_BEAM_FLAGS_ARRAY:
-				ucptr = mb_ping->beam_flags;
-				highest_precision = GSF_BEAM_FLAGS_ASSUMED_HIGHEST_PRECISION;
-				id = GSF_SWATH_BATHY_SUBRECORD_BEAM_FLAGS_ARRAY;
-				max_scale_factor = UCHAR_MAX;
-				min_scale_factor = 0;
-				break;
-			case GSF_SWATH_BATHY_SUBRECORD_SIGNAL_TO_NOISE_ARRAY:
-				dptr = mb_ping->signal_to_noise;
-				highest_precision = GSF_SIGNAL_TO_NOISE_ASSUMED_HIGHEST_PRECISION;
-				id = GSF_SWATH_BATHY_SUBRECORD_SIGNAL_TO_NOISE_ARRAY;
-				max_scale_factor = UCHAR_MAX;
-				min_scale_factor = 0;
-				break;
-			case GSF_SWATH_BATHY_SUBRECORD_BEAM_ANGLE_FORWARD_ARRAY:
-				dptr = mb_ping->beam_angle_forward;
-				highest_precision = GSF_BEAM_ANGLE_FORWARD_ASSUMED_HIGHEST_PRECISION;
-				id = GSF_SWATH_BATHY_SUBRECORD_BEAM_ANGLE_FORWARD_ARRAY;
-				if ((mb_ping->scaleFactors.scaleTable[i - 1].compressionFlag & 0xF0) == GSF_FIELD_SIZE_FOUR)
-					{
-					max_scale_factor = UINT_MAX;
-					min_scale_factor = 0;
-					}
-				else
-					{
-					max_scale_factor = USHRT_MAX;
-					min_scale_factor = 0;
-					}
-				break;
-			case GSF_SWATH_BATHY_SUBRECORD_VERTICAL_ERROR_ARRAY:
-				dptr = mb_ping->vertical_error;
-				highest_precision = GSF_VERTICAL_ERROR_ASSUMED_HIGHEST_PRECISION;
-				id = GSF_SWATH_BATHY_SUBRECORD_VERTICAL_ERROR_ARRAY;
-				if ((mb_ping->scaleFactors.scaleTable[i - 1].compressionFlag & 0xF0) == GSF_FIELD_SIZE_FOUR)
-					{
-					max_scale_factor = UINT_MAX;
-					min_scale_factor = 0;
-					}
-				else
-					{
-					max_scale_factor = USHRT_MAX;
-					min_scale_factor = 0;
-					}
-				break;
-			case GSF_SWATH_BATHY_SUBRECORD_HORIZONTAL_ERROR_ARRAY:
-				dptr = mb_ping->horizontal_error;
-				highest_precision = GSF_HORIZONTAL_ERROR_ASSUMED_HIGHEST_PRECISION;
-				id = GSF_SWATH_BATHY_SUBRECORD_HORIZONTAL_ERROR_ARRAY;
-				if ((mb_ping->scaleFactors.scaleTable[i - 1].compressionFlag & 0xF0) == GSF_FIELD_SIZE_FOUR)
-					{
-					max_scale_factor = UINT_MAX;
-					min_scale_factor = 0;
-					}
-				else
-					{
-					max_scale_factor = USHRT_MAX;
-					min_scale_factor = 0;
-					}
-				break;
-			case GSF_SWATH_BATHY_SUBRECORD_SECTOR_NUMBER_ARRAY:
-				usptr = mb_ping->sector_number;
-				highest_precision = GSF_SECTOR_NUMBER_ASSUMED_HIGHEST_PRECISION;
-				id = GSF_SWATH_BATHY_SUBRECORD_SECTOR_NUMBER_ARRAY;
-				max_scale_factor = UCHAR_MAX;
-				min_scale_factor = 0;
-				break;
-			case GSF_SWATH_BATHY_SUBRECORD_DETECTION_INFO_ARRAY:
-				usptr = mb_ping->detection_info;
-				highest_precision = GSF_DETECTION_INFO_ASSUMED_HIGHEST_PRECISION;
-				id = GSF_SWATH_BATHY_SUBRECORD_DETECTION_INFO_ARRAY;
-				max_scale_factor = UCHAR_MAX;
-				min_scale_factor = 0;
-				break;
-			case GSF_SWATH_BATHY_SUBRECORD_INCIDENT_BEAM_ADJ_ARRAY:
-				dptr = mb_ping->incident_beam_adj;
-				highest_precision = GSF_INCIDENT_BEAM_ADJ_ASSUMED_HIGHEST_PRECISION;
-				id = GSF_SWATH_BATHY_SUBRECORD_INCIDENT_BEAM_ADJ_ARRAY;
-				max_scale_factor = SCHAR_MAX;
-				min_scale_factor = SCHAR_MIN;
-				break;
-			case GSF_SWATH_BATHY_SUBRECORD_SYSTEM_CLEANING_ARRAY:
-				usptr = mb_ping->system_cleaning;
-				highest_precision = GSF_SYSTEM_CLEANING_ASSUMED_HIGHEST_PRECISION;
-				id = GSF_SWATH_BATHY_SUBRECORD_SYSTEM_CLEANING_ARRAY;
-				max_scale_factor = UCHAR_MAX;
-				min_scale_factor = 0;
-				break;
-			case GSF_SWATH_BATHY_SUBRECORD_DOPPLER_CORRECTION_ARRAY:
-				dptr = mb_ping->doppler_corr;
-				highest_precision = GSF_DOPPLER_CORRECTION_ASSUMED_HIGHEST_PRECISION;
-				id = GSF_SWATH_BATHY_SUBRECORD_DOPPLER_CORRECTION_ARRAY;
-				max_scale_factor = SCHAR_MAX;
-				min_scale_factor = SCHAR_MIN;
-				break;
-			case GSF_SWATH_BATHY_SUBRECORD_SONAR_VERT_UNCERT_ARRAY:
-				dptr = mb_ping->sonar_vert_uncert;
-				highest_precision = GSF_SONAR_VERT_UNCERT_ASSUMED_HIGHEST_PRECISION;
-				id = GSF_SWATH_BATHY_SUBRECORD_SONAR_VERT_UNCERT_ARRAY;
-				if ((mb_ping->scaleFactors.scaleTable[i - 1].compressionFlag & 0xF0) == GSF_FIELD_SIZE_FOUR)
-					{
-					max_scale_factor = UINT_MAX;
-					min_scale_factor = 0;
-					}
-				else
-					{
-					max_scale_factor = USHRT_MAX;
-					min_scale_factor = 0;
-					}
-				break;
-    
-			}
-    
-		if (dptr != NULL || usptr != NULL)
-			{
-			max = DBL_MIN;
-			min = DBL_MAX;
-	    
-			if (dptr != NULL)
-				{
-				for (j = 0; j < mb_ping->number_beams; j++)
-					{
-					if (dptr[j] > max)
-						max = dptr[j];
-					if (dptr[j] < min)
-						min = dptr[j];
-					}
-				}
-			else if (usptr != NULL)
-				{
-				for (j = 0; j < mb_ping->number_beams; j++)
-					{
-					if (usptr[j] > max)
-						max = (double) usptr[j];
-					if (usptr[j] < min)
-						min = (double) usptr[j];
-					}
-				}
-			else if (ucptr != NULL)
-				{
-				for (j = 0; j < mb_ping->number_beams; j++)
-					{
-					if (ucptr[j] > max)
-						max = (double) ucptr[j];
-					if (ucptr[j] < min)
-						min = (double) ucptr[j];
-					}
-				}
-	    
-
-			if (min_scale_factor == 0.0 && min < 0.0)
-				offset = floor(-min) + 1.0;
-			else if (id == 1 && mb_ping->depth_corrector > 0.0)
-				offset = floor(MAX(-mb_ping->depth_corrector, -min)) + 1.0;				
-			else
-				offset = 0;
-			
-			/* calculate the ideal multiplier, but use no value larger than the max scale factor multiplier */
-			multiplier_min = highest_precision;
-			multiplier_max = highest_precision;
-			if (max > 0.0 && max > offset)
-				multiplier_max = floor(max_scale_factor / ( max + mb_ping->scaleFactors.scaleTable[id - 1].offset));
-			if (min < 0.0 && min < -offset)
-				multiplier_min = floor(min_scale_factor / ( min + mb_ping->scaleFactors.scaleTable[id - 1].offset));
-			multiplier = MAX(MIN(multiplier_min, multiplier_max), 1.0);
-			
-			if (reset_all == MB_YES
-				|| multiplier < mb_ping->scaleFactors.scaleTable[id - 1].multiplier)
-				{
-/* fprintf(stderr,"BEFORE Scale Factors %2d of %2d: minmax: %10f %10f compressionFlag:%5x offset:%10f multiplier:%10f\n",
-id, GSF_MAX_PING_ARRAY_SUBRECORDS, min, max,
-mb_ping->scaleFactors.scaleTable[id - 1].compressionFlag,
-mb_ping->scaleFactors.scaleTable[id - 1].offset,
-mb_ping->scaleFactors.scaleTable[id - 1].multiplier);
-fprintf(stderr,"     highest_precision:%f offset:%f multiplier_min:%f multiplier_max:%f multiplier:%f\n",
-highest_precision,offset,multiplier_min,multiplier_max,multiplier); */
-
-				mb_ping->scaleFactors.scaleTable[id - 1].multiplier = multiplier;
-				mb_ping->scaleFactors.scaleTable[id - 1].offset = offset;
-
-/* fprintf(stderr,"AFTER  Scale Factors %2d of %2d: minmax: %10f %10f compressionFlag:%5x offset:%10f multiplier:%10f\n\n",
-id, GSF_MAX_PING_ARRAY_SUBRECORDS, min, max,
-mb_ping->scaleFactors.scaleTable[id - 1].compressionFlag,
-mb_ping->scaleFactors.scaleTable[id - 1].offset,
-mb_ping->scaleFactors.scaleTable[id - 1].multiplier); */
-				}
-			}
-    
-		}
-				
-	/* print output debug statements */
-	if (verbose >= 4)
-		{
-		fprintf(stderr,"\ndbg4  GSF Scale Factors Calculated in MBIO function <%s>\n",function_name);
-		for (i = 1; i <= GSF_MAX_PING_ARRAY_SUBRECORDS; i++)
-			{
-			fprintf(stderr,"dbg4       Scale Factors %2d of %2d: compressionFlag:%5x offset:%10f multiplier:%10f\n",
-				i, GSF_MAX_PING_ARRAY_SUBRECORDS,
-				mb_ping->scaleFactors.scaleTable[i - 1].compressionFlag,
-				mb_ping->scaleFactors.scaleTable[i - 1].offset,
-				mb_ping->scaleFactors.scaleTable[i - 1].multiplier);
-			}
-		}
-
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mbsys_gsf.h b/src/mbio/mbsys_gsf.h
deleted file mode 100644
index 79a77e1..0000000
--- a/src/mbio/mbsys_gsf.h
+++ /dev/null
@@ -1,164 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbsys_gsf.h	6/10/97
- *	$Id: mbsys_gsf.h 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1998-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbsys_gsf.h defines the data structures used by MBIO functions
- * to store data from the Generic Sensor Format (GSF).
- * The MBIO representation of GSF is:
- *      MBF_GSFGENMB : MBIO ID 121
- *
- *
- * Author:	D. W. Caress
- * Date:	March 5, 1998
- *
- * $Log: mbsys_gsf.h,v $
- * Revision 5.7  2009/03/13 07:05:58  caress
- * Release 5.1.2beta02
- *
- * Revision 5.6  2006/03/06 21:47:48  caress
- * Implemented changes suggested by Bob Courtney of the Geological Survey of Canada to support translating Reson data to GSF.
- *
- * Revision 5.5  2005/11/05 00:48:05  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.4  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.3  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.2  2001/07/20 00:32:54  caress
- * Release 5.0.beta03
- *
- * Revision 5.1  2001/01/22  07:43:34  caress
- * Version 5.0.beta01
- *
- * Revision 5.0  2000/12/01  22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.1  2000/09/30  06:31:19  caress
- * Snapshot for Dale.
- *
- * Revision 4.0  1998/10/05  19:16:02  caress
- * MB-System version 4.6beta
- *
- * Revision 1.1  1998/10/05  18:32:27  caress
- * Initial revision
- *
- * Revision 1.1  1998/10/05  18:22:40  caress
- * Initial revision
- *
- * Revision 1.1  1998/10/05  17:46:15  caress
- * Initial revision
- *
- *
- */
-/*
- * Notes on the MBF_GSFGENMB data format:
- *   1. The underlying data format is the Generic Sensor Format (GSF)
- *      developed by Shannon Byrne of SAIC. The GSF format stores swath
- *      bathymetry, single beam bathymetry, and other data.
- *   2. This MBIO i/o module accesses swath bathymtry data stored in
- *      the GSF format using the gsflib library also written at SAIC.
- *      The gsflib calls translate the data from scaled short integers
- *      (big endian) stored in the file to double values. The sensor
- *      specific values held in the GSF data stream are not
- *      accessed by this module. However, all of the GSF records
- *      and the included information are passed when mb_get_all,
- *      mb_put_all, and the mb_buffer routines are used for
- *      reading and writing.
- *
- */
-
-#include "gsf.h"
-#include "gsf_ft.h"
-#include "gsf_enc.h"
-
-/* internal data structure */
-struct mbsys_gsf_struct
-	{
-	int	    kind;
-	gsfDataID   dataID;
-	gsfRecords  records;
-	};
-
-
-/* system specific function prototypes */
-int mbsys_gsf_alloc(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error);
-int mbsys_gsf_deall(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error);
-int mbsys_gsf_dimensions(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int *nbath, int *namp, int *nss, int *error);
-int mbsys_gsf_sonartype(int verbose, void *mbio_ptr, void *store_ptr,
-		int *sonartype, int *error);
-int mbsys_gsf_sidescantype(int verbose, void *mbio_ptr, void *store_ptr,
-		int *ss_type, int *error);
-int mbsys_gsf_extract(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int time_i[7], double *time_d,
-			double *navlon, double *navlat,
-			double *speed, double *heading,
-			int *nbath, int *namp, int *nss,
-			char *beamflag, double *bath, double *amp,
-			double *bathacrosstrack, double *bathalongtrack,
-			double *ss, double *ssacrosstrack, double *ssalongtrack,
-			char *comment, int *error);
-int mbsys_gsf_insert(int verbose, void *mbio_ptr, void *store_ptr,
-			int kind, int time_i[7], double time_d,
-			double navlon, double navlat,
-			double speed, double heading,
-			int nbath, int namp, int nss,
-			char *beamflag, double *bath, double *amp,
-			double *bathacrosstrack, double *bathalongtrack,
-			double *ss, double *ssacrosstrack, double *ssalongtrack,
-			char *comment, int *error);
-int mbsys_gsf_ttimes(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int *nbeams,
-			double *ttimes, double *angles,
-			double *angles_forward, double *angles_null,
-			double *heave, double *alongtrack_offset,
-			double *draft, double *ssv, int *error);
-int mbsys_gsf_detects(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int *nbeams, int *detects, int *error);
-int mbsys_gsf_extract_altitude(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, double *transducer_depth, double *altitude,
-			int *error);
-int mbsys_gsf_insert_altitude(int verbose, void *mbio_ptr, void *store_ptr,
-			double transducer_depth, double altitude,
-			int *error);
-int mbsys_gsf_extract_nav(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int time_i[7], double *time_d,
-			double *navlon, double *navlat,
-			double *speed, double *heading, double *draft,
-			double *roll, double *pitch, double *heave,
-			int *error);
-int mbsys_gsf_insert_nav(int verbose, void *mbio_ptr, void *store_ptr,
-			int time_i[7], double time_d,
-			double navlon, double navlat,
-			double speed, double heading, double draft,
-			double roll, double pitch, double heave,
-			int *error);
-int mbsys_gsf_extract_svp(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind,
-			int *nsvp,
-			double *depth, double *velocity,
-			int *error);
-int mbsys_gsf_insert_svp(int verbose, void *mbio_ptr, void *store_ptr,
-			int nsvp,
-			double *depth, double *velocity,
-			int *error);
-int mbsys_gsf_copy(int verbose, void *mbio_ptr,
-			void *store_ptr, void *copy_ptr,
-			int *error);
-int mbsys_gsf_setscalefactors(int verbose, int reset_all, gsfSwathBathyPing *mb_ping, int *error);
diff --git a/src/mbio/mbsys_hdcs.c b/src/mbio/mbsys_hdcs.c
deleted file mode 100644
index 1fe271f..0000000
--- a/src/mbio/mbsys_hdcs.c
+++ /dev/null
@@ -1,1854 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbsys_hdcs.c	3/1/99
- *	$Id: mbsys_hdcs.c 2247 2015-05-29 21:28:28Z caress $
- *
- *    Copyright (c) 1999-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbsys_hdcs.c contains the functions for handling the data structure
- * used by MBIO functions to store swath sonar data stored
- * in UNB OMG HDCS formats:
- *      MBF_OMGHDCSJ : MBIO ID 151
- *
- * Author:	D. W. Caress
- * Date:	March 16, 1999
- *
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mb_define.h"
-#include "mbsys_hdcs.h"
-
-static char rcs_id[]="$Id: mbsys_hdcs.c 2247 2015-05-29 21:28:28Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mbsys_hdcs_alloc(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_hdcs_alloc";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_hdcs_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* allocate memory for data structure */
-	status = mb_mallocd(verbose,__FILE__, __LINE__,sizeof(struct mbsys_hdcs_struct),
-				(void **)store_ptr,error);
-
-	if (status == MB_SUCCESS)
-	    {
-	    /* get pointer to data structure */
-	    store = (struct mbsys_hdcs_struct *) *store_ptr;
-
-	    /* initialize values in structure */
-	    store->kind = MB_DATA_NONE;
-	    store->sensorNumber = 1;
-	    store->subFileID = 1;
-	    store->fileVersion = 0;
-	    store->toolType = MBSYS_HDCS_None;
-	    store->numProfiles = 0;
-	    store->numDepths_sum = 0;
-	    store->timeScale = 0;
-	    store->refTime = 0;
-	    store->minTime = 0;
-	    store->maxTime = 0;
-	    store->positionType = 0;
-	    store->positionScale = 0;
-	    store->refLat = 0;
-	    store->minLat = 0;
-	    store->maxLat = 0;
-	    store->refLong = 0;
-	    store->minLong = 0;
-	    store->maxLong = 0;
-	    store->minObsDepth = 0;
-	    store->maxObsDepth = 0;
-	    store->minProcDepth = 0;
-	    store->maxProcDepth = 0;
-	    store->status_sum = 0;
-	    store->status_pro = 0;		/* status is either OK (0)
-						or no nav (1)
-						or unwanted for gridding (2) */
-	    store->numDepths_pro = 0;		/* Number of depths in profile        */
-	    store->numSamples = 0;	/* Number of sidescan samples in parallel file        */
-	    store->timeOffset = 0;	/* Time offset  wrt. header           */
-	    store->vesselLatOffset = 0;	/* Latitude offset wrt. header        */
-	    store->vesselLongOffset = 0;	/* Longitude offset wrt. header       */
-	    store->vesselHeading = 0;	/* Heading (100 nRadians)             */
-	    store->vesselHeave = 0;	/* Heave (mm)                         */
-	    store->vesselPitch = 0;	/* Vessel pitch (100 nRadians)        */
-	    store->vesselRoll = 0;	/* Vessel roll (100 nRadians)         */
-	    store->tide = 0;		/* Tide (mm)                          */
-	    store->vesselVelocity = 0;	/* Vessel Velocity (mm/s)
-						note - transducer pitch is
-						generally tucked into the vel field     */
-	    store->power = 0;
-	    store->TVG = 0;
-	    store->attenuation = 0;
-	    store->edflag = 0;
-	    store->soundVelocity = 0; 	/* mm/s */
-	    store->lengthImageDataField = 0;
-	    store->pingNo = 0;
-	    store->mode = 0;
-	    store->Q_factor = 0;
-	    store->pulseLength = 0;   /* centisecs*/
-	    store->unassigned = 0;
-	    store->td_sound_speed = 0;
-	    store->samp_rate = 0;
-	    store->z_res_cm = 0;
-	    store->xy_res_cm = 0;
-	    store->ssp_source = 0;
-	    store->filter_ID = 0;
-	    store->absorp_coeff = 0;
-	    store->tx_pulse_len = 0;
-	    store->tx_beam_width = 0;
-	    store->max_swath_width = 0;
-	    store->tx_power_reduction = 0;
-	    store->rx_beam_width = 0;
-	    store->rx_bandwidth = 0;
-	    store->rx_gain_reduction = 0;
-	    store->tvg_crossover = 0;
-	    store->beam_spacing = 0;
-	    store->coverage_sector = 0;
-	    store->yaw_stab_mode = 0;
-	    store->beams = NULL;
-	    store->ss_raw = NULL;
-	    store->pixel_size = 0;
-	    store->pixels_ss = 0;
-	    for (i=0;i<MBSYS_HDCS_MAX_PIXELS;i++)
-		{
-		store->ss_proc[i] = 0;
-		store->ssalongtrack[i] = 0;
-		}
-	    store->comment[0] = 0;
-	    }
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)*store_ptr);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_hdcs_deall(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_hdcs_deall";
-	int	status = MB_SUCCESS;
-	struct mbsys_hdcs_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)*store_ptr);
-		}
-
-	/* get pointer to data structure */
-	store = (struct mbsys_hdcs_struct *) *store_ptr;
-
-	/* deallocate memory for data structures */
-	if (store->beams != NULL)
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&(store->beams),error);
-	if (store->ss_raw != NULL)
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&(store->ss_raw),error);
-
-	/* deallocate memory for data structure */
-	status = mb_freed(verbose,__FILE__, __LINE__, (void **)store_ptr,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_hdcs_dimensions(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int *nbath, int *namp, int *nss, int *error)
-{
-	char	*function_name = "mbsys_hdcs_dimensions";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_hdcs_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_hdcs_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get beam and pixel numbers */
-		*nbath = store->numDepths_pro;
-		*namp = store->numDepths_pro;
-		*nss = store->pixels_ss;
-		}
-	else
-		{
-		/* get beam and pixel numbers */
-		*nbath = 0;
-		*namp = 0;
-		*nss = 0;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		fprintf(stderr,"dbg2       nbath:      %d\n",*nbath);
-		fprintf(stderr,"dbg2        namp:      %d\n",*namp);
-		fprintf(stderr,"dbg2        nss:       %d\n",*nss);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_hdcs_sonartype(int verbose, void *mbio_ptr, void *store_ptr,
-		int *sonartype, int *error)
-{
-	char	*function_name = "mbsys_hdcs_sonartype";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_hdcs_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-	    {
-	    fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-		    function_name);
-	    fprintf(stderr,"dbg2  Input arguments:\n");
-	    fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-	    fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-	    fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-	    }
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_hdcs_struct *) store_ptr;
-
-	/* get sonar type */
-	if (store->toolType == MBSYS_HDCS_ELAC_BottomChart		/* 1 */
-		|| store->toolType == MBSYS_HDCS_EM12_dual		/* 2 */
-		|| store->toolType == MBSYS_HDCS_EM100_depth		/* 3 */
-		|| store->toolType == MBSYS_HDCS_SeaBeam		/* 5 */
-		|| store->toolType == MBSYS_HDCS_EM3000			/* 6 */
-		|| store->toolType == MBSYS_HDCS_EM12_single		/* 8 */
-		|| store->toolType == MBSYS_HDCS_EM100_depth_ss		/* 9 */
-		|| store->toolType == MBSYS_HDCS_EM1000			/* 10 */
-		|| store->toolType == MBSYS_HDCS_EM3000D		/* 12 */
-		|| store->toolType == MBSYS_HDCS_SB2100			/* 13 */
-		|| store->toolType == MBSYS_HDCS_EM1000_ampl		/* 15 */
-		|| store->toolType == MBSYS_HDCS_SB2K			/* 16 */
-		|| store->toolType == MBSYS_HDCS_Seabat9001		/* 17 */
-		|| store->toolType == MBSYS_HDCS_SeaBeam_1180_MkII	/* 21 */
-		|| store->toolType == MBSYS_HDCS_SeaBat_8101		/* 22 */
-		|| store->toolType == MBSYS_HDCS_EM300 			/* 23 */
-		|| store->toolType == MBSYS_HDCS_EM121A 		/* 24 */
-		|| store->toolType == MBSYS_HDCS_SM2000 		/* 25 */
-		|| store->toolType == MBSYS_HDCS_HydroSweep_MD2		/* 26 */
-		|| store->toolType == MBSYS_HDCS_EM1002			/* 27 */
-		|| store->toolType == MBSYS_HDCS_EM120			/* 30 */
-		|| store->toolType == MBSYS_HDCS_SeaBat_8125		/* 31 */
-		|| store->toolType == MBSYS_HDCS_SeaBat_8111		/* 32 */
-		|| store->toolType == MBSYS_HDCS_SeaBat_8150		/* 33 */
-		|| store->toolType == MBSYS_HDCS_EM3002			/* 34 */
-		|| store->toolType == MBSYS_HDCS_EM710			/* 36 */
-		|| store->toolType == MBSYS_HDCS_EM3002D		/* 37 */
-		|| store->toolType == MBSYS_HDCS_SeaBat_8160		/* 38 */
-		|| store->toolType == MBSYS_HDCS_EM122			/* 40 */
-		|| store->toolType == MBSYS_HDCS_EM302			/* 41 */
-		|| store->toolType == MBSYS_HDCS_SeaBat_7125		/* 42 */
-		|| store->toolType == MBSYS_HDCS_R2Sonic_2024		/* 43 */
-		|| store->toolType == MBSYS_HDCS_SeaBat_7150 		/* 44 */)
-		{
-		*sonartype = MB_TOPOGRAPHY_TYPE_MULTIBEAM;
-		}
-	else if (store->toolType == MBSYS_HDCS_FanSweep		/* 4 */
-		|| store->toolType == MBSYS_HDCS_ISIS_Submetrix		/* 14 */
-		|| store->toolType == MBSYS_HDCS_FanSweep_10A		/* 18 */
-		|| store->toolType == MBSYS_HDCS_FanSweep_20		/* 19 */
-		|| store->toolType == MBSYS_HDCS_ISIS_SWA		/* 20 */
-		|| store->toolType == MBSYS_HDCS_SEA_SwathPlus 		/* 39 */)
-		{
-		*sonartype = MB_TOPOGRAPHY_TYPE_INTERFEROMETRIC;
-		}
-	else if (store->toolType == MBSYS_HDCS_Humminbird		/* 28 */
-		|| store->toolType == MBSYS_HDCS_OMG_GLORIA		/* 45 */)
-		{
-		*sonartype = MB_TOPOGRAPHY_TYPE_SIDESCAN;
-		}
-	else if (store->toolType == MBSYS_HDCS_SingleBeam		/* 0 */
-		 || store->toolType == MBSYS_HDCS_ROSS_Profiler		/* 7 */
-		|| store->toolType == MBSYS_HDCS_LADS_2ndary		/* 11 */
-		|| store->toolType == MBSYS_HDCS_Knudsen_320		/* 29 */
-		|| store->toolType == MBSYS_HDCS_Optech_Laser		/* 35 */)
-		{
-		*sonartype = MB_TOPOGRAPHY_TYPE_ECHOSOUNDER;
-		}
-	else
-		{
-		*sonartype = MB_TOPOGRAPHY_TYPE_UNKNOWN;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       sonartype:  %d\n",*sonartype);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_hdcs_sidescantype(int verbose, void *mbio_ptr, void *store_ptr,
-		int *ss_type, int *error)
-{
-	char	*function_name = "mbsys_hdcs_sidescantype";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_hdcs_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-	    {
-	    fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-		    function_name);
-	    fprintf(stderr,"dbg2  Input arguments:\n");
-	    fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-	    fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-	    fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-	    }
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_hdcs_struct *) store_ptr;
-
-	/* get sidescan type */
-	if (store->toolType == MBSYS_HDCS_SB2100)
-		{
-		*ss_type = MB_SIDESCAN_LINEAR;
-		}
-	else
-		{
-		*ss_type = MB_SIDESCAN_LOGARITHMIC;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       ss_type:    %d\n",*ss_type);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_hdcs_extract(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int time_i[7], double *time_d,
-		double *navlon, double *navlat,
-		double *speed, double *heading,
-		int *nbath, int *namp, int *nss,
-		char *beamflag, double *bath, double *amp,
-		double *bathacrosstrack, double *bathalongtrack,
-		double *ss, double *ssacrosstrack, double *ssalongtrack,
-		char *comment, int *error)
-{
-	char	*function_name = "mbsys_hdcs_extract";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_hdcs_struct *store;
-	struct mbsys_hdcs_beam_struct *beam;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-	    {
-	    fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-		    function_name);
-	    fprintf(stderr,"dbg2  Input arguments:\n");
-	    fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-	    fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-	    fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-	    }
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_hdcs_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-	    {
-	    /* get time */
-	    *time_d = 100.0 * store->refTime
-					+ 1.0e-6
-					    * ((double)store->timeScale)
-					    * ((double)store->timeOffset);
-	    mb_get_date(verbose,*time_d,time_i);
-
-	    /* get navigation */
-	    if (store->positionType == 1)
-		{
-		*navlon =
-			RTD * (1.0E-7 * (double)store->refLong
-				+ 1.0E-9 * (double)store->vesselLongOffset
-				    * (double)store->positionScale);
-		*navlat =
-			RTD * (1.0E-7 * (double)store->refLat
-				+ 1.0E-9 * (double)store->vesselLatOffset
-				    * (double)store->positionScale);
-		}
-	    else
-		{
-		*navlon = 0.0;
-		*navlat = 0.0;
-		}
-
-	    /* get heading */
-	    *heading = RTD * ((double)store->vesselHeading) * 1.0E-07;
-	    if (*heading < 0.0)
-	    	*heading += 360.0;
-
-	    /* get speed */
-	    *speed = 3.6e-3 * store->vesselVelocity;
-
-	    /* print debug statements */
-	    if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg4  Extracting data by MBIO function <%s>\n",
-			function_name);
-		fprintf(stderr,"dbg4  Data type:\n");
-		fprintf(stderr,"dbg4       kind:       %d\n",*kind);
-		fprintf(stderr,"dbg4       toolType:   %d\n",store->toolType);
-		fprintf(stderr,"dbg4       toolType:   %s\n",mbsys_hdcs_tool_names[store->toolType]);
-		}
-
-	    /* set beamwidths in mb_io structure */
-	    if (store->rx_beam_width > 0 && store->rx_beam_width < 255
-	    	&& store->tx_beam_width > 0 && store->tx_beam_width < 65535)
-		{
-		mb_io_ptr->beamwidth_ltrack = 0.1 * store->tx_beam_width;
-		mb_io_ptr->beamwidth_xtrack = 0.1 * store->rx_beam_width;
-		}
-	    else if (store->toolType == MBSYS_HDCS_SingleBeam)
-		{
-		mb_io_ptr->beamwidth_ltrack = 4.0;
-		mb_io_ptr->beamwidth_xtrack = 4.0;
-		}
-	    else if (store->toolType == MBSYS_HDCS_ELAC_BottomChart)
-		{
-		mb_io_ptr->beamwidth_ltrack = 6.0;
-		mb_io_ptr->beamwidth_xtrack = 3.0;
-		}
-	    else if (store->toolType == MBSYS_HDCS_SeaBeam_1180_MkII)
-		{
-		mb_io_ptr->beamwidth_ltrack = 1.5;
-		mb_io_ptr->beamwidth_xtrack = 2.8;
-		}
-	    else if (store->toolType == MBSYS_HDCS_EM12_single
-		|| store->toolType == MBSYS_HDCS_EM12_dual)
-		{
-		mb_io_ptr->beamwidth_ltrack = 1.7;
-		mb_io_ptr->beamwidth_xtrack = 3.5;
-		}
-	    else if (store->toolType == MBSYS_HDCS_EM100_depth
-		|| store->toolType == MBSYS_HDCS_EM100_depth_ss
-		|| store->toolType == MBSYS_HDCS_EM1000
-		|| store->toolType == MBSYS_HDCS_EM1000_ampl)
-		{
-		mb_io_ptr->beamwidth_ltrack = 3.3;
-		mb_io_ptr->beamwidth_xtrack = 3.3;
-		}
-	    else if (store->toolType == MBSYS_HDCS_FanSweep
-		|| store->toolType == MBSYS_HDCS_FanSweep_10A
-		|| store->toolType == MBSYS_HDCS_FanSweep_20)
-		{
-		mb_io_ptr->beamwidth_ltrack = 2.0;
-		mb_io_ptr->beamwidth_xtrack = 2.0;
-		}
-	    else if (store->toolType == MBSYS_HDCS_SeaBeam)
-		{
-		mb_io_ptr->beamwidth_ltrack = 2.67;
-		mb_io_ptr->beamwidth_xtrack = 2.67;
-		}
-	    else if (store->toolType == MBSYS_HDCS_EM3000
-		|| store->toolType == MBSYS_HDCS_EM3000D)
-		{
-		mb_io_ptr->beamwidth_ltrack = 1.5;
-		mb_io_ptr->beamwidth_xtrack = 1.5;
-		}
-	    else if (store->toolType == MBSYS_HDCS_ROSS_Profiler)
-		{
-		mb_io_ptr->beamwidth_ltrack = 4.0;
-		mb_io_ptr->beamwidth_xtrack = 4.0;
-		}
-	    else if (store->toolType == MBSYS_HDCS_SB2100
-		|| store->toolType == MBSYS_HDCS_SB2K)
-		{
-		mb_io_ptr->beamwidth_ltrack = 2.0;
-		mb_io_ptr->beamwidth_xtrack = 2.0;
-		}
-	    else if (store->toolType == MBSYS_HDCS_ISIS_Submetrix
-		|| store->toolType == MBSYS_HDCS_ISIS_SWA)
-		{
-		mb_io_ptr->beamwidth_ltrack = 2.0;
-		mb_io_ptr->beamwidth_xtrack = 2.0;
-		}
-	    else if (store->toolType == MBSYS_HDCS_Seabat9001)
-		{
-		mb_io_ptr->beamwidth_ltrack = 1.5;
-		mb_io_ptr->beamwidth_xtrack = 1.5;
-		}
-	    else if (store->toolType == MBSYS_HDCS_SeaBat_8101)
-		{
-		mb_io_ptr->beamwidth_ltrack = 1.5;
-		mb_io_ptr->beamwidth_xtrack = 1.5;
-		}
-	    else if (store->toolType == MBSYS_HDCS_EM300)
-		{
-		mb_io_ptr->beamwidth_ltrack = 2.0;
-		mb_io_ptr->beamwidth_xtrack = 2.0;
-		}
-	    else if (store->toolType == MBSYS_HDCS_EM121A)
-		{
-		mb_io_ptr->beamwidth_ltrack = 1.0;
-		mb_io_ptr->beamwidth_xtrack = 1.0;
-		}
-	    else if (store->toolType == MBSYS_HDCS_SM2000)
-		{
-		mb_io_ptr->beamwidth_ltrack = 2.0;
-		mb_io_ptr->beamwidth_xtrack = 2.0;
-		}
-	    else if (store->toolType == MBSYS_HDCS_HydroSweep_MD2)
-		{
-		mb_io_ptr->beamwidth_ltrack = 2.0;
-		mb_io_ptr->beamwidth_xtrack = 2.0;
-		}
-	    else if (store->toolType == MBSYS_HDCS_EM1002)
-		{
-		mb_io_ptr->beamwidth_ltrack = 2.0;
-		mb_io_ptr->beamwidth_xtrack = 2.0;
-		}
-	    else if (store->toolType == MBSYS_HDCS_Humminbird)
-		{
-		mb_io_ptr->beamwidth_ltrack = 2.0;
-		mb_io_ptr->beamwidth_xtrack = 2.0;
-		}
-	    else if (store->toolType == MBSYS_HDCS_Knudsen_320)
-		{
-		mb_io_ptr->beamwidth_ltrack = 2.0;
-		mb_io_ptr->beamwidth_xtrack = 2.0;
-		}
-	    else if (store->toolType == MBSYS_HDCS_EM120)
-		{
-		mb_io_ptr->beamwidth_ltrack = 2.0;
-		mb_io_ptr->beamwidth_xtrack = 2.0;
-		}
-	    else if (store->toolType == MBSYS_HDCS_SeaBat_8125)
-		{
-		mb_io_ptr->beamwidth_ltrack = 2.0;
-		mb_io_ptr->beamwidth_xtrack = 2.0;
-		}
-	    else if (store->toolType == MBSYS_HDCS_SeaBat_8111)
-		{
-		mb_io_ptr->beamwidth_ltrack = 2.0;
-		mb_io_ptr->beamwidth_xtrack = 2.0;
-		}
-	    else if (store->toolType == MBSYS_HDCS_SeaBat_8150)
-		{
-		mb_io_ptr->beamwidth_ltrack = 2.0;
-		mb_io_ptr->beamwidth_xtrack = 2.0;
-		}
-	    else if (store->toolType == MBSYS_HDCS_EM3002)
-		{
-		mb_io_ptr->beamwidth_ltrack = 2.0;
-		mb_io_ptr->beamwidth_xtrack = 2.0;
-		}
-	    else if (store->toolType == MBSYS_HDCS_Optech_Laser)
-		{
-		mb_io_ptr->beamwidth_ltrack = 2.0;
-		mb_io_ptr->beamwidth_xtrack = 2.0;
-		}
-	    else if (store->toolType == MBSYS_HDCS_EM710)
-		{
-		mb_io_ptr->beamwidth_ltrack = 2.0;
-		mb_io_ptr->beamwidth_xtrack = 2.0;
-		}
-	    else if (store->toolType == MBSYS_HDCS_EM3002D)
-		{
-		mb_io_ptr->beamwidth_ltrack = 2.0;
-		mb_io_ptr->beamwidth_xtrack = 2.0;
-		}
-	    else if (store->toolType == MBSYS_HDCS_SeaBat_8160)
-		{
-		mb_io_ptr->beamwidth_ltrack = 2.0;
-		mb_io_ptr->beamwidth_xtrack = 2.0;
-		}
-	    else if (store->toolType == MBSYS_HDCS_SEA_SwathPlus)
-		{
-		mb_io_ptr->beamwidth_ltrack = 2.0;
-		mb_io_ptr->beamwidth_xtrack = 2.0;
-		}
-
-	    /* read distance, depth, and backscatter
-		    values into storage arrays */
-	    *nbath = store->numDepths_pro;
-	    *namp = store->numDepths_pro;
-	    *nss = store->pixels_ss;
-	    for (i=0;i<*nbath;i++)
-		{
-		beam = &store->beams[i];
-		if (beam->observedDepth == 0)
-		    beamflag[i] = MB_FLAG_NULL;
-		else if (beam->status == 0)
-		    beamflag[i] = MB_FLAG_NONE;
-		else if (beam->status == 22)
-		    beamflag[i] = MB_FLAG_MANUAL + MB_FLAG_FLAG;
-		else
-		    beamflag[i] = MB_FLAG_NULL;
-		if (beamflag[i] != MB_FLAG_NULL)
-		    bath[i] = 0.001 * (abs(beam->observedDepth)
-				- store->tide);
-		else
-		    bath[i] = 0.0;
-		bathacrosstrack[i] = 0.001 * beam->acrossTrack;
-		bathalongtrack[i] =  0.001 * beam->alongTrack;
-		}
-	    for (i=0;i<*namp;i++)
-		{
-		beam = &store->beams[i];
-		amp[i] = beam->reflectivity;
-		}
-	    for (i=0;i<*nss;i++)
-		{
-		ss[i] = store->ss_proc[i];
-		ssacrosstrack[i] = 0.001 * (i - MBSYS_HDCS_MAX_PIXELS / 2)
-					* store->pixel_size;
-		ssalongtrack[i] =  0.001 * store->ssalongtrack[i];
-		}
-
-	    /* print debug statements */
-	    if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg4  Data extracted by MBIO function <%s>\n",
-			function_name);
-		fprintf(stderr,"dbg4  Extracted values:\n");
-		fprintf(stderr,"dbg4       kind:       %d\n",
-			*kind);
-		fprintf(stderr,"dbg4       error:      %d\n",
-			*error);
-		fprintf(stderr,"dbg4       time_i[0]:  %d\n",
-			time_i[0]);
-		fprintf(stderr,"dbg4       time_i[1]:  %d\n",
-			time_i[1]);
-		fprintf(stderr,"dbg4       time_i[2]:  %d\n",
-			time_i[2]);
-		fprintf(stderr,"dbg4       time_i[3]:  %d\n",
-			time_i[3]);
-		fprintf(stderr,"dbg4       time_i[4]:  %d\n",
-			time_i[4]);
-		fprintf(stderr,"dbg4       time_i[5]:  %d\n",
-			time_i[5]);
-		fprintf(stderr,"dbg4       time_i[6]:  %d\n",
-			time_i[6]);
-		fprintf(stderr,"dbg4       time_d:     %f\n",
-			*time_d);
-		fprintf(stderr,"dbg4       longitude:  %f\n",
-			*navlon);
-		fprintf(stderr,"dbg4       latitude:   %f\n",
-			*navlat);
-		fprintf(stderr,"dbg4       speed:      %f\n",
-			*speed);
-		fprintf(stderr,"dbg4       heading:    %f\n",
-			*heading);
-		fprintf(stderr,"dbg4       nbath:      %d\n",
-			*nbath);
-		for (i=0;i<*nbath;i++)
-		  fprintf(stderr,"dbg4       beam:%d  flag:%3d  bath:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,beamflag[i],bath[i],bathacrosstrack[i],bathalongtrack[i]);
-		fprintf(stderr,"dbg4        namp:     %d\n",
-			*namp);
-		for (i=0;i<*namp;i++)
-		  fprintf(stderr,"dbg4        beam:%d   amp:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,amp[i],bathacrosstrack[i],bathalongtrack[i]);
-		fprintf(stderr,"dbg4        nss:      %d\n",
-			*nss);
-		for (i=0;i<*nss;i++)
-		  fprintf(stderr,"dbg4        pixel:%d   ss:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,ss[i],ssacrosstrack[i],ssalongtrack[i]);
-		}
-
-	    /* done translating values */
-
-	    }
-
-	/* extract comment from structure */
-	else if (*kind == MB_DATA_COMMENT)
-	    {
-	    /* copy comment */
-	    strncpy(comment,store->comment,MBSYS_HDCS_MAX_COMMENT);
-
-	    /* print debug statements */
-	    if (verbose >= 4)
-		{
-		fprintf(stderr,"\ndbg4  New ping read by MBIO function <%s>\n",
-			function_name);
-		fprintf(stderr,"dbg4  New ping values:\n");
-		fprintf(stderr,"dbg4       error:      %d\n",
-			*error);
-		fprintf(stderr,"dbg4       comment:    %s\n",
-			comment);
-		}
-	    }
-
-	/* print output debug statements */
-	if (verbose >= 2)
-	    {
-	    fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-		    function_name);
-	    fprintf(stderr,"dbg2  Return values:\n");
-	    fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-	    }
-	if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-	    && *kind == MB_DATA_COMMENT)
-	    {
-	    fprintf(stderr,"dbg2       comment:     \ndbg2       %s\n",
-		    comment);
-	    }
-	else if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-	    && *kind != MB_DATA_COMMENT)
-	    {
-	    fprintf(stderr,"dbg2       time_i[0]:     %d\n",time_i[0]);
-	    fprintf(stderr,"dbg2       time_i[1]:     %d\n",time_i[1]);
-	    fprintf(stderr,"dbg2       time_i[2]:     %d\n",time_i[2]);
-	    fprintf(stderr,"dbg2       time_i[3]:     %d\n",time_i[3]);
-	    fprintf(stderr,"dbg2       time_i[4]:     %d\n",time_i[4]);
-	    fprintf(stderr,"dbg2       time_i[5]:     %d\n",time_i[5]);
-	    fprintf(stderr,"dbg2       time_i[6]:     %d\n",time_i[6]);
-	    fprintf(stderr,"dbg2       time_d:        %f\n",*time_d);
-	    fprintf(stderr,"dbg2       longitude:     %f\n",*navlon);
-	    fprintf(stderr,"dbg2       latitude:      %f\n",*navlat);
-	    fprintf(stderr,"dbg2       speed:         %f\n",*speed);
-	    fprintf(stderr,"dbg2       heading:       %f\n",*heading);
-	    }
-	if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-	    && *kind == MB_DATA_DATA)
-	    {
-	    fprintf(stderr,"dbg2       nbath:      %d\n",
-		    *nbath);
-	    for (i=0;i<*nbath;i++)
-	      fprintf(stderr,"dbg2       beam:%d  flag:%3d  bath:%f  acrosstrack:%f  alongtrack:%f\n",
-		    i,beamflag[i],bath[i],
-		    bathacrosstrack[i],bathalongtrack[i]);
-	    fprintf(stderr,"dbg2        namp:     %d\n",
-		    *namp);
-	    for (i=0;i<*namp;i++)
-	      fprintf(stderr,"dbg2       beam:%d   amp:%f  acrosstrack:%f  alongtrack:%f\n",
-		    i,amp[i],bathacrosstrack[i],bathalongtrack[i]);
-	    fprintf(stderr,"dbg2        nss:      %d\n",
-		    *nss);
-	    for (i=0;i<*nss;i++)
-	      fprintf(stderr,"dbg2        pixel:%d   ss:%f  acrosstrack:%f  alongtrack:%f\n",
-		    i,ss[i],ssacrosstrack[i],ssalongtrack[i]);
-	    }
-	if (verbose >= 2)
-	    {
-	    fprintf(stderr,"dbg2       error:      %d\n",*error);
-	    fprintf(stderr,"dbg2  Return status:\n");
-	    fprintf(stderr,"dbg2       status:     %d\n",status);
-	    }
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_hdcs_insert(int verbose, void *mbio_ptr, void *store_ptr,
-		int kind, int time_i[7], double time_d,
-		double navlon, double navlat,
-		double speed, double heading,
-		int nbath, int namp, int nss,
-		char *beamflag, double *bath, double *amp,
-		double *bathacrosstrack, double *bathalongtrack,
-		double *ss, double *ssacrosstrack, double *ssalongtrack,
-		char *comment, int *error)
-{
-	char	*function_name = "mbsys_hdcs_insert";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_hdcs_struct *store;
-	struct mbsys_hdcs_beam_struct *beam;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-	    {
-	    fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-		    function_name);
-	    fprintf(stderr,"dbg2  Input arguments:\n");
-	    fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-	    fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-	    fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-	    fprintf(stderr,"dbg2       kind:       %d\n",kind);
-	    }
-	if (verbose >= 2 && (kind == MB_DATA_DATA || kind == MB_DATA_NAV))
-	    {
-	    fprintf(stderr,"dbg2       time_i[0]:  %d\n",time_i[0]);
-	    fprintf(stderr,"dbg2       time_i[1]:  %d\n",time_i[1]);
-	    fprintf(stderr,"dbg2       time_i[2]:  %d\n",time_i[2]);
-	    fprintf(stderr,"dbg2       time_i[3]:  %d\n",time_i[3]);
-	    fprintf(stderr,"dbg2       time_i[4]:  %d\n",time_i[4]);
-	    fprintf(stderr,"dbg2       time_i[5]:  %d\n",time_i[5]);
-	    fprintf(stderr,"dbg2       time_i[6]:  %d\n",time_i[6]);
-	    fprintf(stderr,"dbg2       time_d:     %f\n",time_d);
-	    fprintf(stderr,"dbg2       navlon:     %f\n",navlon);
-	    fprintf(stderr,"dbg2       navlat:     %f\n",navlat);
-	    fprintf(stderr,"dbg2       speed:      %f\n",speed);
-	    fprintf(stderr,"dbg2       heading:    %f\n",heading);
-	    }
-	if (verbose >= 2 && kind == MB_DATA_DATA)
-	    {
-	    fprintf(stderr,"dbg2       nbath:      %d\n",
-		    nbath);
-	    if (verbose >= 3)
-	     for (i=0;i<nbath;i++)
-	      fprintf(stderr,"dbg3       beam:%d  flag:%3d  bath:%f  acrosstrack:%f  alongtrack:%f\n",
-		    i,beamflag[i],bath[i],
-		    bathacrosstrack[i],bathalongtrack[i]);
-	    fprintf(stderr,"dbg2       namp:       %d\n",namp);
-	    if (verbose >= 3)
-	     for (i=0;i<namp;i++)
-	      fprintf(stderr,"dbg3        beam:%d   amp:%f  acrosstrack:%f  alongtrack:%f\n",
-		    i,amp[i],bathacrosstrack[i],bathalongtrack[i]);
-	    fprintf(stderr,"dbg2        nss:       %d\n",nss);
-	    if (verbose >= 3)
-	     for (i=0;i<nss;i++)
-	      fprintf(stderr,"dbg3        pixel:%d   ss:%f  acrosstrack:%f  alongtrack:%f\n",
-		    i,ss[i],ssacrosstrack[i],ssalongtrack[i]);
-	    }
-	if (verbose >= 2 && kind == MB_DATA_COMMENT)
-	    {
-	    fprintf(stderr,"dbg2       comment:     \ndbg2       %s\n",
-		    comment);
-	    }
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_hdcs_struct *) store_ptr;
-
-	/* set data kind */
-	store->kind = kind;
-
-	/* insert data in structure */
-	if (store->kind == MB_DATA_DATA)
-	    {
-	    /* get time */
-	    store->timeOffset = (int) rint((time_d - 100.0 * store->refTime)
-				    / (1.0e-6 * store->timeScale));
-
-	    /* get navigation */
-	    if (navlon != 0.0
-		|| navlat != 0.0)
-		{
-		store->positionType = 1;
-		store->vesselLongOffset = 1.0E9 * (DTR * navlon
-						- 1.0E-7 * (double)store->refLong)
-						/ ((double)store->positionScale);
-		store->vesselLatOffset = 1.0E9 * (DTR * navlat
-						- 1.0E-7 * (double)store->refLat)
-						/ ((double)store->positionScale);
-		}
-
-	    /* get heading */
-	    store->vesselHeading = (int)(1.0E7 * DTR * heading);
-
-	    /* get speed */
-	    store->vesselVelocity = speed / 3.6E-3;
-
-	    /* set numbers of beams and sidescan */
-	    if (store->num_beam >= nbath
-		&& store->beams == NULL)
-		{
-		status = mb_mallocd(verbose,__FILE__, __LINE__,
-			    store->num_beam * sizeof(struct mbsys_hdcs_beam_struct),
-			    (void **)&store->beams,error);
-		}
-
-	    /* get bath and sidescan */
-	    if (status == MB_SUCCESS
-		&& store->num_beam >= nbath)
-		{
-		store->numDepths_pro = nbath;
-		for (i=0;i<store->numDepths_pro;i++)
-		    {
-		    beam = &store->beams[i];
-		    if (mb_beam_check_flag_null(beamflag[i]))
-			{
-			beam->status = 0;
-			beam->observedDepth = 0;
-			}
-		    else
-			{
-			beam->observedDepth
-				= 1000 * bath[i] + store->tide;
-			if (mb_beam_ok(beamflag[i]))
-			    beam->status = 0;
-			else
-			    beam->status = 22;
-			}
-		    }
-
-		/* read amplitude values into storage arrays */
-		for (i=0;i<store->numDepths_pro;i++)
-		    {
-		    beam->reflectivity = amp[i];
-		    }
-		}
-	    }
-
-	/* insert comment in structure */
-	else if (store->kind == MB_DATA_COMMENT)
-	    {
-	    strncpy(store->comment,comment,MBSYS_HDCS_MAX_COMMENT);
-	    }
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_hdcs_ttimes(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, int *nbeams,
-	double *ttimes, double *angles,
-	double *angles_forward, double *angles_null,
-	double *heave, double *alongtrack_offset,
-	double *draft, double *ssv, int *error)
-{
-	char	*function_name = "mbsys_hdcs_ttimes";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_hdcs_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-	    {
-	    fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-		    function_name);
-	    fprintf(stderr,"dbg2  Input arguments:\n");
-	    fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-	    fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-	    fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-	    fprintf(stderr,"dbg2       ttimes:     %p\n",(void *)ttimes);
-	    fprintf(stderr,"dbg2       angles_xtrk:%p\n",(void *)angles);
-	    fprintf(stderr,"dbg2       angles_ltrk:%p\n",(void *)angles_forward);
-	    fprintf(stderr,"dbg2       angles_null:%p\n",(void *)angles_null);
-	    fprintf(stderr,"dbg2       heave:      %p\n",(void *)heave);
-	    fprintf(stderr,"dbg2       ltrk_off:   %p\n",(void *)alongtrack_offset);
-	    }
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_hdcs_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-	    {
-	    /* get nbeams */
-	    *nbeams = store->numDepths_pro;
-
-	    /* initialize */
-	    for (i=0;i<store->numDepths_pro;i++)
-		{
-		ttimes[i] = 0.0;
-		angles[i] = 0.0;
-		angles_forward[i] = 0.0;
-		angles_null[i] = 0.0;
-		heave[i] = 0.0;
-		alongtrack_offset[i] = 0.0;
-		}
-
-	    /* get ssv */
-	    *ssv = 0.0;
-	    *draft = 0.0;
-
-	    /* set status */
-	    *error = MB_ERROR_NO_ERROR;
-	    status = MB_SUCCESS;
-
-	    /* done translating values */
-
-	    }
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-	    {
-	    /* set status */
-	    *error = MB_ERROR_COMMENT;
-	    status = MB_FAILURE;
-	    }
-
-	/* deal with other record type */
-	else
-	    {
-	    /* set status */
-	    *error = MB_ERROR_OTHER;
-	    status = MB_FAILURE;
-	    }
-
-	/* print output debug statements */
-	if (verbose >= 2)
-	    {
-	    fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-		    function_name);
-	    fprintf(stderr,"dbg2  Return values:\n");
-	    fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-	    }
-	if (verbose >= 2 && *error == MB_ERROR_NO_ERROR)
-	    {
-	    fprintf(stderr,"dbg2       draft:      %f\n",*draft);
-	    fprintf(stderr,"dbg2       ssv:        %f\n",*ssv);
-	    fprintf(stderr,"dbg2       nbeams:     %d\n",*nbeams);
-	    for (i=0;i<*nbeams;i++)
-		    fprintf(stderr,"dbg2       beam %d: tt:%f  angle_xtrk:%f angle_ltrk:%f  angle_null:%f  depth_off:%f  ltrk_off:%f\n",
-			    i,ttimes[i],angles[i],
-			    angles_forward[i],angles_null[i],
-			    heave[i],alongtrack_offset[i]);
-	    }
-	if (verbose >= 2)
-	    {
-	    fprintf(stderr,"dbg2       error:      %d\n",*error);
-	    fprintf(stderr,"dbg2  Return status:\n");
-	    fprintf(stderr,"dbg2       status:     %d\n",status);
-	    }
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_hdcs_detects(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, int *nbeams,
-	int *detects, int *error)
-{
-	char	*function_name = "mbsys_hdcs_detects";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_hdcs_struct *store;
-	struct mbsys_hdcs_beam_struct *beam;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       detects:    %p\n",(void *)detects);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_hdcs_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get nbeams */
-		*nbeams = store->numDepths_pro;
-
-		/* get detects */
-		for (i=0;i<*nbeams;i++)
-			{
-			beam = &store->beams[i];
-			if (beam->Q_factor)
-				detects[i] = MB_DETECT_PHASE;
-			else
-				detects[i] = MB_DETECT_AMPLITUDE;
-			}
-
-		/* set status */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error == MB_ERROR_NO_ERROR)
-		{
-		fprintf(stderr,"dbg2       nbeams:     %d\n",*nbeams);
-		for (i=0;i<*nbeams;i++)
-			fprintf(stderr,"dbg2       beam %d: detects:%d\n",
-				i,detects[i]);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_hdcs_extract_altitude(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, double *transducer_depth, double *altitude,
-	int *error)
-{
-	char	*function_name = "mbsys_hdcs_extract_altitude";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_hdcs_struct *store;
-	struct mbsys_hdcs_beam_struct *beam;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-	    {
-	    fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-		    function_name);
-	    fprintf(stderr,"dbg2  Input arguments:\n");
-	    fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-	    fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-	    fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-	    }
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_hdcs_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-	    {
-	    *transducer_depth = 0.0;
-	    if (store->num_beam > 0)
-	    	{
-		beam = 	(struct mbsys_hdcs_beam_struct *) &(store->beams[store->num_beam/2]);
-	    	*altitude = 0.001 * beam->observedDepth - *transducer_depth;
-		}
-	    }
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-	    {
-	    /* set status */
-	    *error = MB_ERROR_COMMENT;
-	    status = MB_FAILURE;
-	    }
-
-	/* deal with other record type */
-	else
-	    {
-	    /* set status */
-	    *error = MB_ERROR_OTHER;
-	    status = MB_FAILURE;
-	    }
-
-	/* print output debug statements */
-	if (verbose >= 2)
-	    {
-	    fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-		    function_name);
-	    fprintf(stderr,"dbg2  Return values:\n");
-	    fprintf(stderr,"dbg2       kind:              %d\n",*kind);
-	    fprintf(stderr,"dbg2       transducer_depth:  %f\n",*transducer_depth);
-	    fprintf(stderr,"dbg2       altitude:          %f\n",*altitude);
-	    fprintf(stderr,"dbg2       error:             %d\n",*error);
-	    fprintf(stderr,"dbg2  Return status:\n");
-	    fprintf(stderr,"dbg2       status:            %d\n",status);
-	    }
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_hdcs_insert_altitude(int verbose, void *mbio_ptr, void *store_ptr,
-	double transducer_depth, double altitude,
-	int *error)
-{
-	char	*function_name = "mbsys_hdcs_insert_altitude";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_hdcs_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-	    {
-	    fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-		    function_name);
-	    fprintf(stderr,"dbg2  Input arguments:\n");
-	    fprintf(stderr,"dbg2       verbose:           %d\n",verbose);
-	    fprintf(stderr,"dbg2       mb_ptr:            %p\n",(void *)mbio_ptr);
-	    fprintf(stderr,"dbg2       store_ptr:         %p\n",(void *)store_ptr);
-	    fprintf(stderr,"dbg2       transducer_depth:  %f\n",transducer_depth);
-	    fprintf(stderr,"dbg2       altitude:          %f\n",altitude);
-	    }
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_hdcs_struct *) store_ptr;
-
-	/* insert data into structure */
-	if (store->kind == MB_DATA_DATA)
-	    {
-	    }
-
-	/* deal with comment */
-	else if (store->kind == MB_DATA_COMMENT)
-	    {
-	    /* set status */
-	    *error = MB_ERROR_COMMENT;
-	    status = MB_FAILURE;
-	    }
-
-	/* deal with other record type */
-	else
-	    {
-	    /* set status */
-	    *error = MB_ERROR_OTHER;
-	    status = MB_FAILURE;
-	    }
-
-	/* print output debug statements */
-	if (verbose >= 2)
-	    {
-	    fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-		    function_name);
-	    fprintf(stderr,"dbg2  Return values:\n");
-	    fprintf(stderr,"dbg2       error:             %d\n",*error);
-	    fprintf(stderr,"dbg2  Return status:\n");
-	    fprintf(stderr,"dbg2       status:            %d\n",status);
-	    }
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_hdcs_extract_nav(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int time_i[7], double *time_d,
-		double *navlon, double *navlat,
-		double *speed, double *heading, double *draft,
-		double *roll, double *pitch, double *heave,
-		int *error)
-{
-	char	*function_name = "mbsys_hdcs_extract_nav";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_hdcs_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-	    {
-	    fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-		    function_name);
-	    fprintf(stderr,"dbg2  Input arguments:\n");
-	    fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-	    fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-	    fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-	    }
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_hdcs_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-	    {
-	    /* get time */
-	    *time_d = 100.0 * store->refTime
-					+ 1.0e-6
-					    * ((double)store->timeScale)
-					    * ((double)store->timeOffset);
-	    mb_get_date(verbose,*time_d,time_i);
-
-	    /* get navigation */
-	    if (store->positionType == 1)
-		{
-		*navlon =
-			RTD * (1.0E-7 * (double)store->refLong
-				+ 1.0E-9 * (double)store->vesselLongOffset
-				    * (double)store->positionScale);
-		*navlat =
-			RTD * (1.0E-7 * (double)store->refLat
-				+ 1.0E-9 * (double)store->vesselLatOffset
-				    * (double)store->positionScale);
-		}
-	    else
-		{
-		*navlon = 0.0;
-		*navlat = 0.0;
-		}
-
-	    /* get heading */
-	    *heading = RTD * ((double)store->vesselHeading) * 1.0E-07;
-	    if (*heading < 0.0)
-	    	*heading += 360.0;
-
-	    /* get speed */
-	    *speed = 3.6e-3 * store->vesselVelocity;
-
-	    /* get draft */
-	    *draft = 0.0;;
-
-	    /* get roll pitch and heave */
-	    *roll = RTD * 1E-7 * store->vesselRoll;
-	    *pitch = RTD * 1E-7 * store->vesselPitch;
-	    *heave = 0.001 * store->vesselHeave;
-
-	    /* print debug statements */
-	    if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg4  Data extracted by MBIO function <%s>\n",
-			function_name);
-		fprintf(stderr,"dbg4  Extracted values:\n");
-		fprintf(stderr,"dbg4       kind:       %d\n",
-			*kind);
-		fprintf(stderr,"dbg4       error:      %d\n",
-			*error);
-		fprintf(stderr,"dbg4       time_i[0]:  %d\n",
-			time_i[0]);
-		fprintf(stderr,"dbg4       time_i[1]:  %d\n",
-			time_i[1]);
-		fprintf(stderr,"dbg4       time_i[2]:  %d\n",
-			time_i[2]);
-		fprintf(stderr,"dbg4       time_i[3]:  %d\n",
-			time_i[3]);
-		fprintf(stderr,"dbg4       time_i[4]:  %d\n",
-			time_i[4]);
-		fprintf(stderr,"dbg4       time_i[5]:  %d\n",
-			time_i[5]);
-		fprintf(stderr,"dbg4       time_i[6]:  %d\n",
-			time_i[6]);
-		fprintf(stderr,"dbg4       time_d:     %f\n",
-			*time_d);
-		fprintf(stderr,"dbg4       longitude:  %f\n",
-			*navlon);
-		fprintf(stderr,"dbg4       latitude:   %f\n",
-			*navlat);
-		fprintf(stderr,"dbg4       speed:      %f\n",
-			*speed);
-		fprintf(stderr,"dbg4       heading:    %f\n",
-			*heading);
-		fprintf(stderr,"dbg4       draft:      %f\n",
-			*draft);
-		fprintf(stderr,"dbg4       roll:       %f\n",
-			*roll);
-		fprintf(stderr,"dbg4       pitch:      %f\n",
-			*pitch);
-		fprintf(stderr,"dbg4       heave:      %f\n",
-			*heave);
-		}
-
-	    /* done translating values */
-
-	    }
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-	    {
-	    /* set status */
-	    *error = MB_ERROR_COMMENT;
-	    status = MB_FAILURE;
-	    }
-
-	/* deal with other record type */
-	else
-	    {
-	    /* set status */
-	    *error = MB_ERROR_OTHER;
-	    status = MB_FAILURE;
-	    }
-
-	/* print output debug statements */
-	if (verbose >= 2)
-	    {
-	    fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-		    function_name);
-	    fprintf(stderr,"dbg2  Return values:\n");
-	    fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-	    }
-	if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind == MB_DATA_DATA)
-	    {
-	    fprintf(stderr,"dbg2       time_i[0]:     %d\n",time_i[0]);
-	    fprintf(stderr,"dbg2       time_i[1]:     %d\n",time_i[1]);
-	    fprintf(stderr,"dbg2       time_i[2]:     %d\n",time_i[2]);
-	    fprintf(stderr,"dbg2       time_i[3]:     %d\n",time_i[3]);
-	    fprintf(stderr,"dbg2       time_i[4]:     %d\n",time_i[4]);
-	    fprintf(stderr,"dbg2       time_i[5]:     %d\n",time_i[5]);
-	    fprintf(stderr,"dbg2       time_i[6]:     %d\n",time_i[6]);
-	    fprintf(stderr,"dbg2       time_d:        %f\n",*time_d);
-	    fprintf(stderr,"dbg2       longitude:     %f\n",*navlon);
-	    fprintf(stderr,"dbg2       latitude:      %f\n",*navlat);
-	    fprintf(stderr,"dbg2       speed:         %f\n",*speed);
-	    fprintf(stderr,"dbg2       heading:       %f\n",*heading);
-	    fprintf(stderr,"dbg2       draft:         %f\n",*draft);
-	    fprintf(stderr,"dbg2       roll:          %f\n",*roll);
-	    fprintf(stderr,"dbg2       pitch:         %f\n",*pitch);
-	    fprintf(stderr,"dbg2       heave:         %f\n",*heave);
-	    }
-	if (verbose >= 2)
-	    {
-	    fprintf(stderr,"dbg2       error:      %d\n",*error);
-	    fprintf(stderr,"dbg2  Return status:\n");
-	    fprintf(stderr,"dbg2       status:     %d\n",status);
-	    }
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_hdcs_insert_nav(int verbose, void *mbio_ptr, void *store_ptr,
-		int time_i[7], double time_d,
-		double navlon, double navlat,
-		double speed, double heading, double draft,
-		double roll, double pitch, double heave,
-		int *error)
-{
-	char	*function_name = "mbsys_hdcs_insert_nav";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_hdcs_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-	    {
-	    fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-		    function_name);
-	    fprintf(stderr,"dbg2  Input arguments:\n");
-	    fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-	    fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-	    fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-	    fprintf(stderr,"dbg2       time_i[0]:  %d\n",time_i[0]);
-	    fprintf(stderr,"dbg2       time_i[1]:  %d\n",time_i[1]);
-	    fprintf(stderr,"dbg2       time_i[2]:  %d\n",time_i[2]);
-	    fprintf(stderr,"dbg2       time_i[3]:  %d\n",time_i[3]);
-	    fprintf(stderr,"dbg2       time_i[4]:  %d\n",time_i[4]);
-	    fprintf(stderr,"dbg2       time_i[5]:  %d\n",time_i[5]);
-	    fprintf(stderr,"dbg2       time_i[6]:  %d\n",time_i[6]);
-	    fprintf(stderr,"dbg2       time_d:     %f\n",time_d);
-	    fprintf(stderr,"dbg2       navlon:     %f\n",navlon);
-	    fprintf(stderr,"dbg2       navlat:     %f\n",navlat);
-	    fprintf(stderr,"dbg2       speed:      %f\n",speed);
-	    fprintf(stderr,"dbg2       heading:    %f\n",heading);
-	    fprintf(stderr,"dbg2       draft:      %f\n",draft);
-	    fprintf(stderr,"dbg2       roll:       %f\n",roll);
-	    fprintf(stderr,"dbg2       pitch:      %f\n",pitch);
-	    fprintf(stderr,"dbg2       heave:      %f\n",heave);
-	    }
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_hdcs_struct *) store_ptr;
-
-	/* insert data in structure */
-	if (store->kind == MB_DATA_DATA)
-	    {
-	    /* get time */
-	    store->timeOffset = (int) rint((time_d - 100.0 * store->refTime)
-				    / (1.0e-6 * store->timeScale));
-
-	    /* get navigation */
-	    if (navlon != 0.0
-		|| navlat != 0.0)
-		{
-		store->positionType = 1;
-		store->vesselLongOffset = 1.0E9 * (DTR * navlon
-						- 1.0E-7 * (double)store->refLong)
-						/ ((double)store->positionScale);
-		store->vesselLatOffset = 1.0E9 * (DTR * navlat
-						- 1.0E-7 * (double)store->refLat)
-						/ ((double)store->positionScale);
-		}
-
-	    /* get heading */
-	    store->vesselHeading = (int)(1.0E7 * DTR * heading);
-
-	    /* get speed */
-	    store->vesselVelocity = speed / 3.6E-3;
-
-	    /* get draft */
-
-	    /* get roll pitch and heave */
-	    store->vesselRoll = DTR * 1E7 * roll;
-	    store->vesselPitch = DTR * 1E7 * pitch;
-	    store->vesselHeave = 1000 * heave;
-	    }
-
-	/* print output debug statements */
-	if (verbose >= 2)
-	    {
-	    fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-		    function_name);
-	    fprintf(stderr,"dbg2  Return value:\n");
-	    fprintf(stderr,"dbg2       error:      %d\n",*error);
-	    fprintf(stderr,"dbg2  Return status:\n");
-	    fprintf(stderr,"dbg2       status:  %d\n",status);
-	    }
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_hdcs_copy(int verbose, void *mbio_ptr,
-			void *store_ptr, void *copy_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_hdcs_copy";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_hdcs_struct *store;
-	struct mbsys_hdcs_struct *copy;
-	struct mbsys_hdcs_beam_struct *beam;
-	struct mbsys_hdcs_beam_struct *cbeam;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       copy_ptr:   %p\n",(void *)copy_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointers */
-	store = (struct mbsys_hdcs_struct *) store_ptr;
-	copy = (struct mbsys_hdcs_struct *) copy_ptr;
-
-	/* copy the basic header data */
-	if (store != NULL && copy != NULL)
-	    {
-	    /* type of data record */
-	    copy->kind = store->kind;
-	    copy->read_summary = store->read_summary;
-	    copy->fileVersion = store->fileVersion;
-	    copy->toolType = store->toolType;
-	    copy->profile_size = store->profile_size;
-	    copy->num_beam = store->num_beam;
-	    copy->beam_size = store->beam_size;
-	    copy->data_size = store->data_size;
-	    copy->image_size = store->image_size;
-
-	    /* summary values */
-	    copy->sensorNumber = store->sensorNumber;
-	    copy->subFileID = store->subFileID;
-	    copy->fileVersion = store->fileVersion;
-	    copy->toolType = store->toolType;
-	    copy->numProfiles = store->numProfiles;
-	    copy->numDepths_sum = store->numDepths_sum;
-	    copy->timeScale = store->timeScale;
-	    copy->refTime = store->refTime;
-	    copy->minTime = store->minTime;
-	    copy->maxTime = store->maxTime;
-	    copy->positionType = store->positionType;
-	    copy->positionScale = store->positionScale;
-	    copy->refLat = store->refLat;
-	    copy->minLat = store->minLat;
-	    copy->maxLat = store->maxLat;
-	    copy->refLong = store->refLong;
-	    copy->minLong = store->minLong;
-	    copy->maxLong = store->maxLong;
-	    copy->minObsDepth = store->minObsDepth;
-	    copy->maxObsDepth = store->maxObsDepth;
-	    copy->minProcDepth = store->minProcDepth;
-	    copy->maxProcDepth = store->maxProcDepth;
-	    copy->status_sum = store->status_sum;
-
-	    /* profile values */
-	    copy->status_pro = store->status_pro;
-	    copy->numDepths_pro = store->numDepths_pro;
-	    copy->numSamples = store->numSamples;
-	    copy->timeOffset = store->timeOffset;
-	    copy->vesselLatOffset = store->vesselLatOffset;
-	    copy->vesselLongOffset = store->vesselLongOffset;
-	    copy->vesselHeading = store->vesselHeading;
-	    copy->vesselHeave = store->vesselHeave;
-	    copy->vesselPitch = store->vesselPitch;
-	    copy->vesselRoll = store->vesselRoll;
-	    copy->tide = store->tide;
-	    copy->vesselVelocity = store->vesselVelocity;
-	    copy->power = store->power;
-	    copy->TVG = store->TVG;
-	    copy->attenuation = store->attenuation;
-	    copy->edflag = store->edflag;
-	    copy->soundVelocity = store->soundVelocity;
-	    copy->lengthImageDataField = store->lengthImageDataField;
-	    copy->pingNo = store->pingNo;
-	    copy->mode = store->mode;
-	    copy->Q_factor = store->Q_factor;
-	    copy->pulseLength = store->pulseLength;
-	    copy->unassigned = store->unassigned;
-	    copy->td_sound_speed = store->td_sound_speed;
-	    copy->samp_rate = store->samp_rate;
-	    copy->z_res_cm = store->z_res_cm;
-	    copy->xy_res_cm = store->xy_res_cm;
-	    copy->ssp_source = store->ssp_source;
-	    copy->filter_ID = store->filter_ID;
-	    copy->absorp_coeff = store->absorp_coeff;
-	    copy->tx_pulse_len = store->tx_pulse_len;
-	    copy->tx_beam_width = store->tx_beam_width;
-	    copy->max_swath_width = store->max_swath_width;
-	    copy->tx_power_reduction = store->tx_power_reduction;
-	    copy->rx_beam_width = store->rx_beam_width;
-	    copy->rx_bandwidth = store->rx_bandwidth;
-	    copy->rx_gain_reduction = store->rx_gain_reduction;
-	    copy->tvg_crossover = store->tvg_crossover;
-	    copy->beam_spacing = store->beam_spacing;
-	    copy->coverage_sector = store->coverage_sector;
-	    copy->yaw_stab_mode = store->yaw_stab_mode;
-
-	    /* don't copy beams that aren't there */
-	    if (store->beams == NULL)
-		{
-		if (copy->beams != NULL)
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&copy->beams,error);
-		}
-
-	    /* else copy beams */
-	    else
-		{
-		/* reallocate memory for beams */
-		if (copy->beams != NULL)
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&copy->beams,error);
-		status = mb_mallocd(verbose,__FILE__, __LINE__,
-				copy->num_beam * sizeof(struct mbsys_hdcs_beam_struct),
-				(void **)&copy->beams,error);
-		if (status == MB_SUCCESS)
-		    {
-		    for (i=0;i<copy->numDepths_pro;i++)
-			{
-			beam = &store->beams[i];
-			cbeam = &copy->beams[i];
-
-			cbeam->status = beam->status;
-			cbeam->scaling_factor = beam->scaling_factor;
-			cbeam->observedDepth = beam->observedDepth;
-			cbeam->acrossTrack = beam->acrossTrack;
-			cbeam->alongTrack = beam->alongTrack;
-			cbeam->latOffset = beam->latOffset;
-			cbeam->longOffset = beam->longOffset;
-			cbeam->processedDepth = beam->processedDepth;
-			cbeam->timeOffset = beam->timeOffset;
-			cbeam->depthAccuracy = beam->depthAccuracy;
-			cbeam->reflectivity = beam->reflectivity;
-			cbeam->Q_factor = beam->Q_factor;
-			cbeam->beam_no = beam->beam_no;
-			cbeam->freq = beam->freq;
-			cbeam->calibratedBackscatter = beam->calibratedBackscatter;
-			cbeam->mindB = beam->mindB;
-			cbeam->maxdB = beam->maxdB;
-			cbeam->pseudoAngleIndependentBackscatter = beam->pseudoAngleIndependentBackscatter;
-			cbeam->range = beam->range;
-			cbeam->no_samples = beam->no_samples;
-			cbeam->offset = beam->offset;
-			cbeam->centre_no = beam->centre_no;
-			cbeam->sample_unit = beam->sample_unit;
-			cbeam->sample_interval = beam->sample_interval;
-			cbeam->dummy[0] = beam->dummy[0];
-			cbeam->dummy[1] = beam->dummy[1];
-			cbeam->samp_win_length = beam->samp_win_length;
-			cbeam->beam_depress_angle = beam->beam_depress_angle;
-			cbeam->beam_heading_angle = beam->beam_heading_angle;
-			}
-		    }
-		}
-
-	    /* don't copy sidescan samples that aren't there */
-	    if (store->numSamples == 0
-		|| store->ss_raw == NULL)
-		{
-		if (copy->ss_raw != NULL)
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&copy->ss_raw,error);
-		copy->numSamples = 0;
-		}
-
-	    /* else copy sidescan samples */
-	    else
-		{
-		/* reallocate memory for ss_raw */
-		if (copy->ss_raw != NULL)
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&copy->ss_raw,error);
-		status = mb_mallocd(verbose,__FILE__, __LINE__,
-				copy->numSamples,
-				(void **)&copy->ss_raw,error);
-		if (status == MB_SUCCESS)
-		    {
-		    for (i=0;i<copy->numSamples;i++)
-			{
-			copy->ss_raw[i] = store->ss_raw[i];
-			}
-		    }
-		}
-	    }
-
-	/* print output debug statements */
-	if (verbose >= 2)
-	    {
-	    fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-		    function_name);
-	    fprintf(stderr,"dbg2  Return values:\n");
-	    fprintf(stderr,"dbg2       error:      %d\n",*error);
-	    fprintf(stderr,"dbg2  Return status:\n");
-	    fprintf(stderr,"dbg2       status:     %d\n",status);
-	    }
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mbsys_hdcs.h b/src/mbio/mbsys_hdcs.h
deleted file mode 100644
index 26ea4e9..0000000
--- a/src/mbio/mbsys_hdcs.h
+++ /dev/null
@@ -1,484 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbsys_hdcs.h	3/16/99
- *	$Id: mbsys_hdcs.h 2247 2015-05-29 21:28:28Z caress $
- *
- *    Copyright (c) 1999-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbsys_hdcs.h defines the data structure used by MBIO functions
- * to store swath sonar data in the UNB OMG HDCS format:
- *      MBF_OMGHDCSJ : MBIO ID 151
- *
- * Author:	D. W. Caress
- * Date:	March 16, 1999
- *
- */
-/*
- * Notes on the MBSYS_HDCS data structure:
- *   1. The OMG-HDCS format is a collection of similar data
- *      formats used by the seafloor mapping software
- *      developed by Dr. John Hughes Clarke (Ocean Mapping
- *      Group of the University of New Brunswick). A variety
- *      of sonars are supported in OMG-HDCS.
- *   2. OMG-HDCS files all begin with a summary header that
- *      specifies the format version, the data source
- *      (type of sonar), the number of records,  and the
- *      minimum and maximum values of position and data
- *      values.
- *   3. The summary header is followed by a set of uniformly
- *      sized data records. The data record size is determined
- *      by the format version and data source. Ecch record is
- *      is divided into a profile (header) and an array of
- *      beam structures.
- *   4. Sidescan imagery can be stored in parallel files in
- *      the same directory as the primary bathymetry and
- *      amplitude files. The sidescan files have the suffix
- *      ".ss_data" added to the end of the primary file's name.
- *   5. Comment records are encoded in MBIO by setting the first
- *      eight bytes of the data record header (profile) to '#'
- *      values. The profile part of the comment record will have
- *      the same size as expected for data from the tool type
- *      listed in the summary. However, the data section for
- *      comment records will always be 256 bytes long regardless
- *      of the tool type. This mechanism is supported only by
- *      MB-System.
- *
- */
-
-/* defines sizes and maximums */
-#define	MBSYS_HDCS_SUMMARY_SIZE	96
-#define	MBSYS_HDCS_MAX_COMMENT	252
-#define	MBSYS_HDCS_MAX_BEAMS		1440
-#define	MBSYS_HDCS_MAX_PIXELS		1024
-
-/* define tools (sonars) supported by OMG_HDCS */
-#define MBSYS_HDCS_NUM_TOOLS		55   /* as of Sept. 2013 */
-#define MBSYS_HDCS_None			-1
-#define MBSYS_HDCS_SingleBeam		0
-#define MBSYS_HDCS_ELAC_BottomChart	1
-#define MBSYS_HDCS_EM12_dual		2
-#define MBSYS_HDCS_EM100_depth		3
-#define MBSYS_HDCS_FanSweep		4
-#define MBSYS_HDCS_SeaBeam		5
-#define MBSYS_HDCS_EM3000		6
-#define MBSYS_HDCS_ROSS_Profiler	7
-#define MBSYS_HDCS_EM12_single		8
-#define MBSYS_HDCS_EM100_depth_ss	9
-#define MBSYS_HDCS_EM1000		10
-#define MBSYS_HDCS_LADS_2ndary		11
-#define MBSYS_HDCS_EM3000D		12
-#define MBSYS_HDCS_SB2100		13
-#define MBSYS_HDCS_ISIS_Submetrix	14
-#define MBSYS_HDCS_EM1000_ampl		15
-#define MBSYS_HDCS_SB2K			16
-#define MBSYS_HDCS_Seabat9001		17
-#define MBSYS_HDCS_FanSweep_10A		18
-#define MBSYS_HDCS_FanSweep_20		19
-#define MBSYS_HDCS_ISIS_SWA		20
-#define MBSYS_HDCS_SeaBeam_1180_MkII	21
-#define MBSYS_HDCS_SeaBat_8101		22
-#define MBSYS_HDCS_EM300 		23
-#define MBSYS_HDCS_EM121A 		24
-#define MBSYS_HDCS_SM2000 		25
-#define MBSYS_HDCS_HydroSweep_MD2	26
-#define MBSYS_HDCS_EM1002		27
-#define MBSYS_HDCS_Humminbird		28
-#define MBSYS_HDCS_Knudsen_320		29
-#define MBSYS_HDCS_EM120		30
-#define MBSYS_HDCS_SeaBat_8125		31
-#define MBSYS_HDCS_SeaBat_8111		32
-#define MBSYS_HDCS_SeaBat_8150		33
-#define MBSYS_HDCS_EM3002		34
-#define MBSYS_HDCS_Optech_Laser		35
-#define MBSYS_HDCS_EM710		36
-#define MBSYS_HDCS_EM3002D		37
-#define MBSYS_HDCS_SeaBat_8160		38
-#define MBSYS_HDCS_SEA_SwathPlus 	39
-#define MBSYS_HDCS_EM122		40
-#define MBSYS_HDCS_EM302		41
-#define MBSYS_HDCS_SeaBat_7125		42
-#define MBSYS_HDCS_R2Sonic_2024		43
-#define MBSYS_HDCS_SeaBat_7150 		44
-#define MBSYS_HDCS_OMG_GLORIA		45
-#define MBSYS_HDCS_ODOM_ES3 		46
-#define MBSYS_HDCS_EM2040 		47
-#define MBSYS_HDCS_HC5K 		48
-#define MBSYS_HDCS_R2Sonic_2022 	49
-#define MBSYS_HDCS_SeaBat_7111 		50
-#define MBSYS_HDCS_EdgeTech_4600 	51
-#define MBSYS_HDCS_ME70 		52
-#define MBSYS_HDCS_SeaBat_7101 		53
-#define MBSYS_HDCS_EM2040D 		54
-#define MBSYS_HDCS_COMMENT		999
-
-static char *mbsys_hdcs_tool_names[MBSYS_HDCS_NUM_TOOLS] = {
-   "Single Beam Echo-Sounder",
-   "HoneyWell Elac BottomChart Mk I",
-   "Simrad EM-12 (dual system)",
-   "Simrad EM-100 (depths only)",
-   "Krupp-Atlas FanSweep 10",
-   "General Instruments SeaBeam (Classic)",
-   "Simrad - EM3000S",
-   "ROSS Sweep - MV Profiler DPW",
-   "Simrad EM-12 (single system)",
-   "Simrad EM-100 (depths and amplitudes)",
-   "Simrad EM-1000",
-   "RAN -- LADS (secondary format) ",
-   "Simrad - EM3000 dual head",
-   "SeaBeam 2100 series",
-   "ISIS Submetrix 100/ 2000",
-   "EM1000 with reflectivities",
-   "Seabeam 2000 ",
-   "Reson Seabat 9001 ",
-   "STN-Atlas FanSweep 10A",
-   "STN-Atlas FanSweep 20",
-   "ISIS Submetrix 100SWA",
-   "SeaBeam 1180 MkII",
-   "Reson 8101",
-   "Simrad EM300",
-   "Simrad EM121A",
-   "Simrad SM2000",
-   "HydroSweep MD2",
-   "Simrad EM1002",
-   "Hummin'bird 3D",
-   "Knudsen 320",
-   "Kongsberg Simrad EM120",
-   "Reson 8125",
-   "Reson 8111",
-   "Reson 8150",
-   "Kongsberg - EM3002",
-   "Optech - Laser",
-   "Kongsberg - EM710",
-   "Kongsberg - EM3002D",
-   "Reson 8160",
-   "SEA SwathPlus - Dual sided",
-   "Kongsberg - EM122",
-   "Kongsberg - EM302",
-   "Reson 7125",
-   "R2Sonic 2024",
-   "Reson 7150",
-   "OMG GLORIA",
-   "ODOM ES3",
-   "Kongsberg - EM2040",
-   "HydroChart 5000",
-   "R2Sonic 2022",
-   "Reson 7111",
-   "EdgeTech 4600",
-   "ME70",
-   "Reson 7101",
-   "Kongsberg - EM2040D"
-};
-
-
-/* define beam record structure */
-struct mbsys_hdcs_beam_struct
-	{
-        int	status;           /* status is either OK (0) or bad (other) */
-        mb_u_char scaling_factor; /* V4 */
-        int	observedDepth;    /* Depth (mm)                            */
-        int	acrossTrack;      /* Across track position of depth (mm)   */
-        int	alongTrack;       /* Along track position of depth (mm)    */
-        int	latOffset;        /* Latitude offset wrt. profile          */
-        int	longOffset;       /* Longitude offset wrt. profile         */
-        int	processedDepth;    /* Depth (mm)                            */
-	int	timeOffset;
-        int	depthAccuracy;    /* Depth accuracy (mm)                   */
-	mb_u_char reflectivity;
-	char	Q_factor;  /* phase or amplitude detection */
-	char	beam_no;
-	char	freq;   /* 12.7, 13.0, 13.3, 95.0, Smii, GLORIA */
-
-	char	calibratedBackscatter; /* effects of power/TVG and atten.
-					    removed*/
-	char	mindB;
-	char	maxdB;
-	mb_u_char	pseudoAngleIndependentBackscatter;
-					/* corrected for mean angular dependence
-					    for geological visualisation */
-	int	range;   /* other option on EM 12 */
-	int	no_samples;
-	int	offset;
-	int	centre_no;
-	char	sample_unit; /* whether in time or distance */
-	char	sample_interval; /* seconds or metres */
-	char	dummy[2];
-	mb_u_char	samp_win_length;
-	short	beam_depress_angle;
-	unsigned short	beam_heading_angle;
-	/* V4 */
-	unsigned short other_range;
-	signed short Tx_steer;
-	signed short Rc_steer;
-	mb_u_char TxSector;
-	float Ifremer_qfactor;
-	unsigned int timestampOffset; /* really is a 64 bit integer, trying to compress */
-					/* would'nt even need if didn't have to relate wavefile
-			 		by this number */
-	unsigned short no_RAMAN;
-	unsigned short no_IR;
-	unsigned short no_GAPD;
-	unsigned short no_PMT;
-	mb_u_char prim_depth_conf;
-	mb_u_char seco_depth_conf;
-	signed short scan_azimuth; 	/* 100ths of degree */
-	unsigned short nadir_angle; 	/* 100ths of degree */
-					/* always dynamically compressed for v4 using scaling factor */
-	signed int secondaryDepth;	/* Depth (mm) remember can be +ve or -ve  */
-	signed short wave_height;
-	signed int opaqueDepth_PMT;	/* Depth (mm)                            */
-	signed int extinctionDepth_PMT;/* Depth (mm)                            */
-	signed int pimDepth_PMT;	/* Depth (mm)                            */
-	signed int opaqueDepth_GAPD;	/* Depth (mm)                            */
-	signed int extinctionDepth_GAPD;/* Depth (mm)                            */
-	signed int pimDepth_GAPD;	/* Depth (mm)                            */
-	float twtt;
-	unsigned int snippet_first_sample;
-	unsigned int snippet_last_sample;
-	float intensity;
-	};
-
-/* specific FOR ATLAS SAPI data */
-struct mbsys_omghdcs_profile_subparams_struct
-{
-
-  unsigned short txBeamIndex;
-  unsigned short txLevel;
-  short txBeamAngle;
-  unsigned short txPulseLength;
-
-  unsigned int ss_offset;
-  unsigned short no_skipped_ss;
-  unsigned short no_acquired_ss;
-  unsigned short ss_sample_interval;
-
-  unsigned short bscatClass;
-  unsigned short nrActualGainSets;
-  short rxGup;
-  short rxGain;
-  short ar;
-  unsigned short rxtime[20];
-  short rxgain[20];
-
-};
-
-/* structure to hold everything */
-struct mbsys_hdcs_struct
-	{
-	int    kind;
-	int    read_summary;
-	int    profile_size;
-	int    num_beam;
-	int    beam_size;
-	int    data_size;
-	int    image_size;
-        int    sensorNumber;	/*  1 = depth file */
-        int    subFileID;	/*  1 = data (as opposed to index) */
-        int    fileVersion;	/* 1 = original format */
-				/* 2 = packed format for EM1000 and others */
-				/* 3 = packed format for EM300 */
-        int    toolType;	/* Tool Type implies Profile Record Size
-					and Depth Record Size
-					and Image Record Size */
-        int    numProfiles;	/* # of profiles in the file             */
-        int    numDepths_sum;	/* # of depths in the file             */
-        int    timeScale;	/* time scale (# of uSec. units) */
-        int    refTime;		/* Reference time (100 sec. units)       */
-        int    minTime;		/* Minimum time (offset wrt. ref.)       */
-        int    maxTime;		/* Maximum time (offset wrt. ref.)       */
-        int    positionType;	/* Geographic(1)/ UTM(2) */
-        int    positionScale;	/* Position scale (# of nRad. units)     */
-        int    refLat;		/* Reference latitude (100 nRadians)     */
-        int    minLat;		/* Minimum latitude (offset wrt. ref.)   */
-        int    maxLat;		/* Maximum latitude (offset wrt. ref.)   */
-        int    refLong;		/* Reference longitude (100 nRadians)    */
-        int    minLong;		/* Minimum longitude (offset wrt. ref.)  */
-        int    maxLong;		/* Maximum longitude (offset wrt. ref.)  */
-        int    minObsDepth;	/* Minimum depth (mm)                    */
-        int    maxObsDepth;	/* Maximum depth (mm)                    */
-        int    minProcDepth;	/* Minimum depth (mm)                    */
-        int    maxProcDepth;	/* Maximum depth (mm)                    */
-        int    status_sum;	/* status not actually used at all ....  */
-
-        /* V4 */
-	int totalProfileBytes;
-	int Profile_BitsDefining[20];
-	int totalBeamBytes;
-	int Beam_BitsDefining[20];
-	/* End V4 Summary */
-
-        int    status_pro;	/* status is either OK (0)
-					or no nav (1)
-					or unwanted for gridding (2)
-					or comment record (999) (MB-System only) */
-        int    numDepths_pro;	/* Number of depths in profile        */
-        int    numSamples;	/* Number of sidescan samples in parallel file        */
-        int    timeOffset;	/* Time offset  wrt. header           */
-        int    vesselLatOffset;	/* Latitude offset wrt. header        */
-        int    vesselLongOffset;/* Longitude offset wrt. header       */
-        int    vesselHeading;	/* Heading (100 nRadians)             */
-        int    vesselHeave;	/* Heave (mm)                         */
-        int    vesselPitch;	/* Vessel pitch (100 nRadians)        */
-        int    vesselRoll;	/* Vessel roll (100 nRadians)         */
-        int    tide;		/* Tide (mm)                          */
-        int    vesselVelocity;	/* Vessel Velocity (mm/s)
-					note - transducer pitch is
-					generally tucked into the vel field     */
-	char    power;
-	char    TVG;
-	char    attenuation;
-	char    edflag;
-        int	soundVelocity; 	/* mm/s */
-	int	lengthImageDataField;
-        int	pingNo;
-	char	mode;
-	char	Q_factor;
-	char	pulseLength;   /* centisecs*/
-	mb_u_char unassigned;
-	unsigned short td_sound_speed;
-	unsigned short samp_rate;
-	mb_u_char z_res_cm;
-	mb_u_char xy_res_cm;
-	mb_u_char ssp_source;
-	mb_u_char filter_ID;
-	unsigned short absorp_coeff;
-	unsigned short tx_pulse_len;
-	unsigned short tx_beam_width;
-	unsigned short max_swath_width;
-	mb_u_char tx_power_reduction;
-	mb_u_char rx_beam_width;
-	mb_u_char rx_bandwidth;
-	mb_u_char rx_gain_reduction;
-	mb_u_char tvg_crossover;
-	mb_u_char beam_spacing;
-	mb_u_char coverage_sector;
-	mb_u_char yaw_stab_mode;
-
-	/* V4 */
-	struct mbsys_omghdcs_profile_subparams_struct params[2];
-
-  	int transducerDepth;		/* transducer or  towfish depth */
-  	int transducerPitch;		/* Transducer pitch (100 nRadians)    */
-  	int transducerRoll;		/* Transducer roll (100 nRadians)     */
-  					/* enough for dyn. stab transducer */
-  	int transducerHeading;		/* Transducer pitch (100 nRadians)    */
-  	int transducerLatOffset;	/* Latitude offset wrt. vessel        */
-  	int transducerLongOffset;	/* Longitude offset wrt. vessel       */
-  	int transducerSlantRange;	/*slantRange(mm) wrt. vessel (cable out) */
-  	int transducerAcross;		/* horizontal Range (mm) wrt. vessel */
-  	int transducerAlong;		/* horizontal Range (mm) wrt. vessel */
-  	int transducerBearing;		/* Bearing (100nRads) wrt. vessel       */
-  	short longperiod_heaveCorrection;
-  	short dynamic_draftCorrection;
-  	short deepdraftoffset_in_metres;
-  	short draft_at_Tx;
-  	short alternateRoll;
-  	short alternatePitch;
-  	short alternateHeave;
-  	short alternateHeading;
-  	short standaloneHeading;
-  	short RTK_at_RP;  		/* in cm units so that can support +/- 320m. */
-  	short Lowpass_RTK_at_RP;  	/* in cm units so that can support +/- 320m. */
-  	short WLZ;
-  	unsigned short samp_rate_SecondHead;
-  	signed int clock_drift_millis;
-  	unsigned int watercol_offset;
-  	unsigned int watercol_size;
-  	unsigned int watercol_offset_2nd;
-  	unsigned int watercol_size_2nd;
-  	unsigned short range_to_normal_incidence;
-  	unsigned int laser_timestampRef;
-  	unsigned int tx_sector_offset;
-  	unsigned short num_tx_sectors;
-  	unsigned int sonar_settings_offset;
-  	unsigned int ping_number;
-  	unsigned short multi_ping_sequence;
-  	unsigned int num_beams;	/* Which is different than numDepths...*/
-					/* (which is usually the number of possible depths and not ACTUAL depths */
-					/* e.g. high-density vs. low-density mode in KM systems) */
-  	unsigned char layer_compensation_flag;
-  	float    bs_beam_position;
-  	unsigned int bs_control_flags;
-  	unsigned short bs_num_beams_per_side;
-  	unsigned short bs_current_beam_number;
-  	unsigned char bs_sample_descriptor;
-  	unsigned int snippet_sample_descriptor;
-  	/* End V4 Profile */
-
-	struct mbsys_hdcs_beam_struct *beams;
-	mb_s_char	*ss_raw;
-	int	pixel_size;	/* processed sidescan pixel size in mm */
-	int	pixels_ss;	/* number of processed sidescan pixels stored */
-	short	ss_proc[MBSYS_HDCS_MAX_PIXELS];
-				/* the processed sidescan ordered port to starboard */
-	int	ssalongtrack[MBSYS_HDCS_MAX_PIXELS];
-				/* the processed sidescan alongtrack distances
-					in mm */
-	char	comment[MBSYS_HDCS_MAX_COMMENT];
-	};
-
-/* system specific function prototypes */
-int mbsys_hdcs_alloc(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error);
-int mbsys_hdcs_deall(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error);
-int mbsys_hdcs_dimensions(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int *nbath, int *namp, int *nss, int *error);
-int mbsys_hdcs_sonartype(int verbose, void *mbio_ptr, void *store_ptr,
-                        int *sonartype, int *error);
-int mbsys_hdcs_sidescantype(int verbose, void *mbio_ptr, void *store_ptr,
-                        int *ss_type, int *error);
-int mbsys_hdcs_extract(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int time_i[7], double *time_d,
-			double *navlon, double *navlat,
-			double *speed, double *heading,
-			int *nbath, int *namp, int *nss,
-			char *beamflag, double *bath, double *amp,
-			double *bathacrosstrack, double *bathalongtrack,
-			double *ss, double *ssacrosstrack, double *ssalongtrack,
-			char *comment, int *error);
-int mbsys_hdcs_insert(int verbose, void *mbio_ptr, void *store_ptr,
-			int kind, int time_i[7], double time_d,
-			double navlon, double navlat,
-			double speed, double heading,
-			int nbath, int namp, int nss,
-			char *beamflag, double *bath, double *amp,
-			double *bathacrosstrack, double *bathalongtrack,
-			double *ss, double *ssacrosstrack, double *ssalongtrack,
-			char *comment, int *error);
-int mbsys_hdcs_ttimes(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int *nbeams,
-			double *ttimes, double *angles,
-			double *angles_forward, double *angles_null,
-			double *heave, double *alongtrack_offset,
-			double *draft, double *ssv, int *error);
-int mbsys_hdcs_detects(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int *nbeams, int *detects, int *error);
-int mbsys_hdcs_extract_altitude(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, double *transducer_depth, double *altitude,
-			int *error);
-int mbsys_hdcs_insert_altitude(int verbose, void *mbio_ptr, void *store_ptr,
-			double transducer_depth, double altitude,
-			int *error);
-int mbsys_hdcs_extract_nav(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int time_i[7], double *time_d,
-			double *navlon, double *navlat,
-			double *speed, double *heading, double *draft,
-			double *roll, double *pitch, double *heave,
-			int *error);
-int mbsys_hdcs_insert_nav(int verbose, void *mbio_ptr, void *store_ptr,
-			int time_i[7], double time_d,
-			double navlon, double navlat,
-			double speed, double heading, double draft,
-			double roll, double pitch, double heave,
-			int *error);
-int mbsys_hdcs_copy(int verbose, void *mbio_ptr,
-			void *store_ptr, void *copy_ptr,
-			int *error);
diff --git a/src/mbio/mbsys_hs10.c b/src/mbio/mbsys_hs10.c
deleted file mode 100644
index ed9880b..0000000
--- a/src/mbio/mbsys_hs10.c
+++ /dev/null
@@ -1,1177 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbsys_hs10.c	12/4/00
- *	$Id: mbsys_hs10.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 2000-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbsys_hs10.c contains the functions for handling the data structure
- * used by MBIO functions to store data from the 45-beam Furuno HS-10
- * multibeam sonar system.
- * The data formats which are commonly used to store HS-10
- * data in files include
- *      MBF_HS10JAMS : MBIO ID 171
- *
- * Author:	D. W. Caress
- * Date:	December 4, 2000
- * $Log: mbsys_hs10.c,v $
- * Revision 5.6  2005/11/05 00:48:03  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.5  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.4  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.3  2001/08/25 00:54:13  caress
- * Adding beamwidth values to extract functions.
- *
- * Revision 5.2  2001/07/20  00:32:54  caress
- * Release 5.0.beta03
- *
- * Revision 5.1  2001/01/22  07:43:34  caress
- * Version 5.0.beta01
- *
- * Revision 5.0  2000/12/10  20:24:25  caress
- * Initial revision.
- *
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mb_define.h"
-#include "mbsys_hs10.h"
-
-static char rcs_id[]="$Id: mbsys_hs10.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mbsys_hs10_alloc(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_hs10_alloc";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* allocate memory for data structure */
-	status = mb_malloc(verbose,sizeof(struct mbsys_hs10_struct),
-				store_ptr,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)*store_ptr);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_hs10_deall(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_hs10_deall";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)*store_ptr);
-		}
-
-	/* deallocate memory for data structure */
-	status = mb_free(verbose,store_ptr,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_hs10_dimensions(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int *nbath, int *namp, int *nss, int *error)
-{
-	char	*function_name = "mbsys_hs10_dimensions";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_hs10_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_hs10_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get beam and pixel numbers */
-		*nbath = MBSYS_HS10_BEAMS;
-		*namp = MBSYS_HS10_BEAMS;
-		*nss = 0;
-		}
-	else
-		{
-		/* get beam and pixel numbers */
-		*nbath = 0;
-		*namp = 0;
-		*nss = 0;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		fprintf(stderr,"dbg2       nbath:      %d\n",*nbath);
-		fprintf(stderr,"dbg2        namp:      %d\n",*namp);
-		fprintf(stderr,"dbg2        nss:       %d\n",*nss);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_hs10_extract(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int time_i[7], double *time_d,
-		double *navlon, double *navlat,
-		double *speed, double *heading,
-		int *nbath, int *namp, int *nss,
-		char *beamflag, double *bath, double *amp,
-		double *bathacrosstrack, double *bathalongtrack,
-		double *ss, double *ssacrosstrack, double *ssalongtrack,
-		char *comment, int *error)
-{
-	char	*function_name = "mbsys_hs10_extract";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_hs10_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_hs10_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get time */
-		mb_fix_y2k(verbose, store->year, &time_i[0]);
-		time_i[1] = store->month;
-		time_i[2] = store->day;
-		time_i[3] = store->hour;
-		time_i[4] = store->minute;
-		time_i[5] = store->tenth_second / 10;
-		time_i[6] = 100000 * (store->tenth_second - 10 * time_i[5]);
-		mb_get_time(verbose,time_i,time_d);
-
-		/* get navigation */
-		*navlon = ((double) store->londeg) + (store->lonmin / 60000.0);
-		if (store->EorW == 'W')
-		    *navlon *= -1.0;
-		*navlat = ((double) store->latdeg) + (store->latmin / 60000.0);
-		if (store->NorS == 'S')
-		    *navlat *= -1.0;
-
-		/* get heading */
-		*heading = (0.1 * (double) store->heading);
-
-		/* get speed */
-		*speed = 0.0;
-
-		/* set beamwidths in mb_io structure */
-		mb_io_ptr->beamwidth_ltrack = 3.0;
-		mb_io_ptr->beamwidth_xtrack = 3.0;
-
-		/* read distance and depth values into storage arrays */
-		*nbath = MBSYS_HS10_BEAMS;
-		*namp = MBSYS_HS10_BEAMS;
-		*nss = 0;
-		for (i=0;i<*nbath;i++)
-			{
-			if (store->depth[i] >= 29999)
-			    {
-			    beamflag[i] = MB_FLAG_NULL;
-			    bath[i] = 0.0;
-			    bathacrosstrack[i] = 0.0;
-			    }
-			else if (store->depth[i] > 0)
-			    {
-			    beamflag[i] = MB_FLAG_NONE;
-			    bath[i] = (double) store->depth[i];
-			    bathacrosstrack[i] = (double) store->acrosstrack[i];
-			    }
-			else if (store->depth[i] < 0)
-			    {
-			    beamflag[i]
-				= MB_FLAG_MANUAL + MB_FLAG_FLAG;
-			    bath[i] = (double) -store->depth[i];
-			    bathacrosstrack[i] = (double) store->acrosstrack[i];
-			    }
-			amp[i] = store->amplitude[i];
-			bathalongtrack[i] = 0.0;
-			}
-
-		/* print debug statements */
-		if (verbose >= 5)
-			{
-			fprintf(stderr,"\ndbg4  Data extracted by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  Extracted values:\n");
-			fprintf(stderr,"dbg4       kind:       %d\n",
-				*kind);
-			fprintf(stderr,"dbg4       error:      %d\n",
-				*error);
-			fprintf(stderr,"dbg4       time_i[0]:  %d\n",
-				time_i[0]);
-			fprintf(stderr,"dbg4       time_i[1]:  %d\n",
-				time_i[1]);
-			fprintf(stderr,"dbg4       time_i[2]:  %d\n",
-				time_i[2]);
-			fprintf(stderr,"dbg4       time_i[3]:  %d\n",
-				time_i[3]);
-			fprintf(stderr,"dbg4       time_i[4]:  %d\n",
-				time_i[4]);
-			fprintf(stderr,"dbg4       time_i[5]:  %d\n",
-				time_i[5]);
-			fprintf(stderr,"dbg4       time_i[6]:  %d\n",
-				time_i[6]);
-			fprintf(stderr,"dbg4       time_d:     %f\n",
-				*time_d);
-			fprintf(stderr,"dbg4       longitude:  %f\n",
-				*navlon);
-			fprintf(stderr,"dbg4       latitude:   %f\n",
-				*navlat);
-			fprintf(stderr,"dbg4       speed:      %f\n",
-				*speed);
-			fprintf(stderr,"dbg4       heading:    %f\n",
-				*heading);
-			fprintf(stderr,"dbg4       nbath:      %d\n",
-				*nbath);
-			for (i=0;i<*nbath;i++)
-			  fprintf(stderr,"dbg4       beam:%d  flag:%3d  bath:%f  acrosstrack:%f  alongtrack:%f\n",
-				i,beamflag[i],bath[i],bathacrosstrack[i],bathalongtrack[i]);
-			fprintf(stderr,"dbg4        namp:     %d\n",
-				*namp);
-			for (i=0;i<*namp;i++)
-			  fprintf(stderr,"dbg4        beam:%d   amp:%f  acrosstrack:%f  alongtrack:%f\n",
-				i,amp[i],bathacrosstrack[i],bathalongtrack[i]);
-			}
-
-		/* done translating values */
-
-		}
-
-	/* extract comment from structure */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* copy comment */
-		strncpy(comment, store->comment, MBSYS_HS10_COMMENT);
-
-		/* print debug statements */
-		if (verbose >= 4)
-			{
-			fprintf(stderr,"\ndbg4  New ping read by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  New ping values:\n");
-			fprintf(stderr,"dbg4       error:      %d\n",
-				*error);
-			fprintf(stderr,"dbg4       comment:    %s\n",
-				comment);
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind == MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"dbg2       comment:     \ndbg2       %s\n",
-			comment);
-		}
-	else if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind != MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"dbg2       time_i[0]:     %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:     %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:     %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:     %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:     %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:     %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:     %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:        %f\n",*time_d);
-		fprintf(stderr,"dbg2       longitude:     %f\n",*navlon);
-		fprintf(stderr,"dbg2       latitude:      %f\n",*navlat);
-		fprintf(stderr,"dbg2       speed:         %f\n",*speed);
-		fprintf(stderr,"dbg2       heading:       %f\n",*heading);
-		}
-	if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind == MB_DATA_DATA)
-		{
-		fprintf(stderr,"dbg2       nbath:      %d\n",
-			*nbath);
-		for (i=0;i<*nbath;i++)
-		  fprintf(stderr,"dbg2       beam:%d  flag:%3d  bath:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,beamflag[i],bath[i],
-			bathacrosstrack[i],bathalongtrack[i]);
-		fprintf(stderr,"dbg2        namp:     %d\n",
-			*namp);
-		for (i=0;i<*namp;i++)
-		  fprintf(stderr,"dbg2       beam:%d   amp:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,amp[i],bathacrosstrack[i],bathalongtrack[i]);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_hs10_insert(int verbose, void *mbio_ptr, void *store_ptr,
-		int kind, int time_i[7], double time_d,
-		double navlon, double navlat,
-		double speed, double heading,
-		int nbath, int namp, int nss,
-		char *beamflag, double *bath, double *amp,
-		double *bathacrosstrack, double *bathalongtrack,
-		double *ss, double *ssacrosstrack, double *ssalongtrack,
-		char *comment, int *error)
-{
-	char	*function_name = "mbsys_hs10_insert";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_hs10_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       kind:       %d\n",kind);
-		}
-	if (verbose >= 2 && (kind == MB_DATA_DATA || kind == MB_DATA_NAV))
-		{
-		fprintf(stderr,"dbg2       time_i[0]:  %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:  %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:  %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:  %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:  %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:  %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:  %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:     %f\n",time_d);
-		fprintf(stderr,"dbg2       navlon:     %f\n",navlon);
-		fprintf(stderr,"dbg2       navlat:     %f\n",navlat);
-		fprintf(stderr,"dbg2       speed:      %f\n",speed);
-		fprintf(stderr,"dbg2       heading:    %f\n",heading);
-		}
-	if (verbose >= 2 && kind == MB_DATA_DATA)
-		{
-		fprintf(stderr,"dbg2       nbath:      %d\n",nbath);
-		if (verbose >= 3)
-		 for (i=0;i<nbath;i++)
-		  fprintf(stderr,"dbg3       beam:%d  flag:%3d  bath:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,beamflag[i],bath[i],
-			bathacrosstrack[i],bathalongtrack[i]);
-		fprintf(stderr,"dbg2       namp:       %d\n",namp);
-		if (verbose >= 3)
-		 for (i=0;i<namp;i++)
-		  fprintf(stderr,"dbg3        beam:%d   amp:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,amp[i],bathacrosstrack[i],bathalongtrack[i]);
-		fprintf(stderr,"dbg2        nss:       %d\n",nss);
-		if (verbose >= 3)
-		 for (i=0;i<nss;i++)
-		  fprintf(stderr,"dbg3        pixel:%d   ss:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,ss[i],ssacrosstrack[i],ssalongtrack[i]);
-		}
-	if (verbose >= 2 && kind == MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"dbg2       comment:     \ndbg2       %s\n",
-			comment);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_hs10_struct *) store_ptr;
-
-	/* set data kind */
-	store->kind = kind;
-
-	/* insert data in structure */
-	if (store->kind == MB_DATA_DATA)
-		{
-		/* get time */
-		mb_unfix_y2k(verbose, time_i[0], &store->year);
-		store->month = time_i[1];
-		store->day = time_i[2];
-		store->hour = time_i[3];
-		store->minute = time_i[4];
-		store->tenth_second = (10 * time_i[5]) + (time_i[6] / 100000);
-
-		/* get navigation */
-		if (navlon < -180.0)
-		    navlon = navlon + 360.0;
-		if (navlon > 180.0)
-		    navlon = navlon - 360.0;
-		if (navlon < 0.0)
-		    store->EorW = 'W';
-		else
-		    store->EorW = 'E';
-		store->londeg = (int) fabs(navlon);
-		store->lonmin = (int) (60000.0 * (fabs(navlon) - store->londeg));
-		if (navlat < 0.0)
-		    store->NorS = 'S';
-		else
-		    store->NorS = 'N';
-		store->latdeg = (int) fabs(navlat);
-		store->latmin = (int) (60000.0 * (fabs(navlat) - store->latdeg));
-
-		/* get heading */
-		store->heading = (int) (10 * heading);
-
-		/* get speed */
-
-		/* put distance and depth values
-			into data structure */
-		for (i=0;i<nbath;i++)
-			{
-			if (mb_beam_check_flag_null(beamflag[i]))
-			    {
-			    store->depth[i] = 29999;
-			    store->acrosstrack[i] = 99999;
-			    }
-			else if (mb_beam_check_flag(beamflag[i]))
-			    {
-			    store->depth[i] = (int) -bath[i];
-			    store->acrosstrack[i] = (int) bathacrosstrack[i];
-			    }
-			else
-			    {
-			    store->depth[i] = (int) bath[i];
-			    store->acrosstrack[i] = (int) bathacrosstrack[i];
-			    }
-			store->amplitude[i] = (int) amp[i];
-			}
-		}
-
-	/* insert comment in structure */
-	else if (store->kind == MB_DATA_COMMENT)
-		{
-		strncpy(store->comment,comment, MBSYS_HS10_COMMENT);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_hs10_ttimes(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, int *nbeams,
-	double *ttimes, double *angles,
-	double *angles_forward, double *angles_null,
-	double *heave, double *alongtrack_offset,
-	double *draft, double *ssv, int *error)
-{
-	char	*function_name = "mbsys_hs10_ttimes";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_hs10_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       ttimes:     %p\n",(void *)ttimes);
-		fprintf(stderr,"dbg2       angles_xtrk:%p\n",(void *)angles);
-		fprintf(stderr,"dbg2       angles_ltrk:%p\n",(void *)angles_forward);
-		fprintf(stderr,"dbg2       angles_null:%p\n",(void *)angles_null);
-		fprintf(stderr,"dbg2       heave:      %p\n",(void *)heave);
-		fprintf(stderr,"dbg2       ltrk_off:   %p\n",(void *)alongtrack_offset);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_hs10_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA
-		|| *kind == MB_DATA_CALIBRATE)
-		{
-		/* get nbeams */
-		*nbeams = MBSYS_HS10_BEAMS;
-
-		/* get travel times, angles */
-		for (i=0;i<mb_io_ptr->beams_bath_max;i++)
-			{
-			ttimes[i] = 0.0;
-			angles[i] = (i - MBSYS_HS10_BEAMS / 2)
-				* MBSYS_HS10_BEAMSPACING;
-			if (angles[i] < 0.0)
-				{
-				angles[i] = -angles[i];
-				angles_forward[i] = 180.0;
-				}
-			else
-				angles_forward[i] = 0.0;
-			angles_null[i] = 0.0;
-			heave[i] = 0.0;
-			alongtrack_offset[i] = 0.0;
-			}
-
-		/* get ssv */
- 		*ssv = 0.0;
- 		*draft = 0.0;
-
-		/* set status */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error == MB_ERROR_NO_ERROR)
-		{
-		fprintf(stderr,"dbg2       draft:      %f\n",*draft);
-		fprintf(stderr,"dbg2       ssv:        %f\n",*ssv);
-		fprintf(stderr,"dbg2       nbeams:     %d\n",*nbeams);
-		for (i=0;i<*nbeams;i++)
-			fprintf(stderr,"dbg2       beam %d: tt:%f  angle_xtrk:%f  angle_ltrk:%f  angle_null:%f  depth_off:%f  ltrk_off:%f\n",
-				i,ttimes[i],angles[i],
-				angles_forward[i],angles_null[i],
-				heave[i],alongtrack_offset[i]);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_hs10_detects(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, int *nbeams,
-	int *detects, int *error)
-{
-	char	*function_name = "mbsys_hs10_detects";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_hs10_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       detects:    %p\n",(void *)detects);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_hs10_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get nbeams */
-		*nbeams = MBSYS_HS10_BEAMS;
-
-		/* get detects */
-		for (i=0;i<*nbeams;i++)
-			{
-			detects[i] = MB_DETECT_AMPLITUDE;
-			}
-
-		/* set status */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error == MB_ERROR_NO_ERROR)
-		{
-		fprintf(stderr,"dbg2       nbeams:     %d\n",*nbeams);
-		for (i=0;i<*nbeams;i++)
-			fprintf(stderr,"dbg2       beam %d: detects:%d\n",
-				i,detects[i]);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_hs10_extract_altitude(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, double *transducer_depth, double *altitude,
-	int *error)
-{
-	char	*function_name = "mbsys_hs10_extract_altitude";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_hs10_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_hs10_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA
-		|| *kind == MB_DATA_CALIBRATE)
-		{
-		*transducer_depth = 0.0;
-		*altitude = store->center_depth;
-
-		/* set status */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:              %d\n",*kind);
-		fprintf(stderr,"dbg2       transducer_depth:  %f\n",*transducer_depth);
-		fprintf(stderr,"dbg2       altitude:          %f\n",*altitude);
-		fprintf(stderr,"dbg2       error:             %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:            %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_hs10_extract_nav(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int time_i[7], double *time_d,
-		double *navlon, double *navlat,
-		double *speed, double *heading, double *draft,
-		double *roll, double *pitch, double *heave,
-		int *error)
-{
-	char	*function_name = "mbsys_hs10_extract_nav";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_hs10_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_hs10_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get time */
-		mb_fix_y2k(verbose, store->year, &time_i[0]);
-		time_i[1] = store->month;
-		time_i[2] = store->day;
-		time_i[3] = store->hour;
-		time_i[4] = store->minute;
-		time_i[5] = store->tenth_second / 10;
-		time_i[6] = 100000 * (store->tenth_second - 10 * time_i[5]);
-		mb_get_time(verbose,time_i,time_d);
-
-		/* get navigation */
-		*navlon = ((double) store->londeg) + (store->lonmin / 60000.0);
-		if (store->EorW == 'W')
-		    *navlon *= -1.0;
-		*navlat = ((double) store->latdeg) + (store->latmin / 60000.0);
-		if (store->NorS == 'S')
-		    *navlat *= -1.0;
-
-		/* get heading */
-		*heading = (0.1 * (double) store->heading);
-
-		/* get speed */
-		*speed = 0.0;
-
-		/* get draft */
- 		*draft = 0.0;
-
-		/* get roll pitch and heave */
-		*roll = 0.0;
-		*pitch = 0.0;
-		*heave = 0.0;
-
-		/* print debug statements */
-		if (verbose >= 5)
-			{
-			fprintf(stderr,"\ndbg4  Data extracted by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  Extracted values:\n");
-			fprintf(stderr,"dbg4       kind:       %d\n",
-				*kind);
-			fprintf(stderr,"dbg4       error:      %d\n",
-				*error);
-			fprintf(stderr,"dbg4       time_i[0]:  %d\n",
-				time_i[0]);
-			fprintf(stderr,"dbg4       time_i[1]:  %d\n",
-				time_i[1]);
-			fprintf(stderr,"dbg4       time_i[2]:  %d\n",
-				time_i[2]);
-			fprintf(stderr,"dbg4       time_i[3]:  %d\n",
-				time_i[3]);
-			fprintf(stderr,"dbg4       time_i[4]:  %d\n",
-				time_i[4]);
-			fprintf(stderr,"dbg4       time_i[5]:  %d\n",
-				time_i[5]);
-			fprintf(stderr,"dbg4       time_i[6]:  %d\n",
-				time_i[6]);
-			fprintf(stderr,"dbg4       time_d:     %f\n",
-				*time_d);
-			fprintf(stderr,"dbg4       longitude:  %f\n",
-				*navlon);
-			fprintf(stderr,"dbg4       latitude:   %f\n",
-				*navlat);
-			fprintf(stderr,"dbg4       speed:      %f\n",
-				*speed);
-			fprintf(stderr,"dbg4       heading:    %f\n",
-				*heading);
-			fprintf(stderr,"dbg4       draft:      %f\n",
-				*draft);
-			fprintf(stderr,"dbg4       roll:       %f\n",
-				*roll);
-			fprintf(stderr,"dbg4       pitch:      %f\n",
-				*pitch);
-			fprintf(stderr,"dbg4       heave:      %f\n",
-				*heave);
-			}
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind == MB_DATA_DATA)
-		{
-		fprintf(stderr,"dbg2       time_i[0]:     %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:     %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:     %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:     %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:     %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:     %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:     %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:        %f\n",*time_d);
-		fprintf(stderr,"dbg2       longitude:     %f\n",*navlon);
-		fprintf(stderr,"dbg2       latitude:      %f\n",*navlat);
-		fprintf(stderr,"dbg2       speed:         %f\n",*speed);
-		fprintf(stderr,"dbg2       heading:       %f\n",*heading);
-		fprintf(stderr,"dbg2       draft:         %f\n",*draft);
-		fprintf(stderr,"dbg2       roll:          %f\n",*roll);
-		fprintf(stderr,"dbg2       pitch:         %f\n",*pitch);
-		fprintf(stderr,"dbg2       heave:         %f\n",*heave);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_hs10_insert_nav(int verbose, void *mbio_ptr, void *store_ptr,
-		int time_i[7], double time_d,
-		double navlon, double navlat,
-		double speed, double heading, double draft,
-		double roll, double pitch, double heave,
-		int *error)
-{
-	char	*function_name = "mbsys_hs10_insert_nav";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_hs10_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       time_i[0]:  %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:  %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:  %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:  %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:  %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:  %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:  %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:     %f\n",time_d);
-		fprintf(stderr,"dbg2       navlon:     %f\n",navlon);
-		fprintf(stderr,"dbg2       navlat:     %f\n",navlat);
-		fprintf(stderr,"dbg2       speed:      %f\n",speed);
-		fprintf(stderr,"dbg2       heading:    %f\n",heading);
-		fprintf(stderr,"dbg2       draft:      %f\n",draft);
-		fprintf(stderr,"dbg2       roll:       %f\n",roll);
-		fprintf(stderr,"dbg2       pitch:      %f\n",pitch);
-		fprintf(stderr,"dbg2       heave:      %f\n",heave);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_hs10_struct *) store_ptr;
-
-	/* insert data in structure */
-	if (store->kind == MB_DATA_DATA)
-		{
-		/* get time */
-		mb_unfix_y2k(verbose, time_i[0], &store->year);
-		store->month = time_i[1];
-		store->day = time_i[2];
-		store->hour = time_i[3];
-		store->minute = time_i[4];
-		store->tenth_second = (10 * time_i[5]) + (time_i[6] / 100000);
-
-		/* get navigation */
-		if (navlon < -180.0)
-		    navlon = navlon + 360.0;
-		if (navlon > 180.0)
-		    navlon = navlon - 360.0;
-		if (navlon < 0.0)
-		    store->EorW = 'W';
-		else
-		    store->EorW = 'E';
-		store->londeg = (int) fabs(navlon);
-		store->lonmin = (int) (60000.0 * (fabs(navlon) - store->londeg));
-		if (navlat < 0.0)
-		    store->NorS = 'S';
-		else
-		    store->NorS = 'N';
-		store->latdeg = (int) fabs(navlat);
-		store->latmin = (int) (60000.0 * (fabs(navlat) - store->latdeg));
-
-		/* get heading */
-		store->heading = (int) (10 * heading);
-
-		/* get speed */
-
-		/* get draft */
-
-		/* get roll pitch and heave */
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_hs10_copy(int verbose, void *mbio_ptr,
-			void *store_ptr, void *copy_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_hs10_copy";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_hs10_struct *store;
-	struct mbsys_hs10_struct *copy;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       copy_ptr:   %p\n",(void *)copy_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointers */
-	store = (struct mbsys_hs10_struct *) store_ptr;
-	copy = (struct mbsys_hs10_struct *) copy_ptr;
-
-	/* copy the data */
-	*copy = *store;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mbsys_hs10.h b/src/mbio/mbsys_hs10.h
deleted file mode 100644
index 46ec38b..0000000
--- a/src/mbio/mbsys_hs10.h
+++ /dev/null
@@ -1,247 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbsys_hs10.h	12/4/00
- *	$Id: mbsys_hs10.h 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 2000-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbsys_hs10.h defines the data structures used by MBIO functions
- * to store data from the Furuno HS-10 multibeam sonar system.
- * The data formats which are commonly used to store Furuno HS-10
- * data in files include
- *      MBF_HS10JAMS : MBIO ID 171
- *
- * Author:	D. W. Caress
- * Date:	December 4, 2000
- * $Log: mbsys_hs10.h,v $
- * Revision 5.5  2005/11/05 00:48:04  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.4  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.3  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.2  2001/07/20 00:32:54  caress
- * Release 5.0.beta03
- *
- * Revision 5.1  2001/01/22  07:43:34  caress
- * Version 5.0.beta01
- *
- * Revision 5.0  2000/12/10  20:24:25  caress
- * Initial revision.
- *
- *
- */
-/*
- * Notes on the MBSYS_HSDS data structure:
- *   1. The Furuno HS-10 multibeam sonar generated 45 beams
- *      of bathymetry and amplitude.
- *   2. To my knowledge, only one Furuno HS-10 multibeam sonar
- *      has been operated. It was installed on S/V Yokosuka,
- *      a JAMSTEC research vessel. The Furuno HS-10 has since been
- *      replaced by a SeaBeam 2112 multibeam sonar.
- *   3. A specification for the raw HS-10 data format was
- *      provided by JAMSTEC, and is included below. The raw format
- *      consists of 800 byte binary records in which only the
- *      lower 4 bits of each byte are used.
- *   4. The actual data files provided to WHOI seem to be simple
- *      717 byte ASCII records with time, lat, lon, heading,
- *      center beam depth, 45 depths, 45 acrosstrack distances,
- *      45 beam amplitudes, and a <CR><LF> terminator. Format
- *      171 supports the actual data we received.
- *   5. The data received use 5 characters each for depth,
- *      acrosstrack, and amplitude values. Null beams have
- *      depth values of 29999 and acrosstrack values of 99999.
- *      MB-System supports beam flagging by setting flagged
- *      beams negative.
- *   6. The internal data structure supports the data included
- *      in the format 171 files, and does not yet include values
- *      listed in the raw format spec but not seen in the data
- *      provided.
- *   7. Comment records are supported as an MB-System extension
- *      where the first two bytes of the record are "##".
- *      Comment records are variable length.
- *   8. The raw data format specification is as follows:
- *
- *      ----------------------------------------------------------
- *      HS-10 MNBES Data Format - JAMSTEC
- *
- *      800 bytes/record, 10 records/block
- *
- *      Note: 4 bits from LSB is effective in each byte.
- *           zB. 30 30 35 39 ---> 0 0 5 9 (HEX) = 89 (DEC)
- *               30 30 32 3D ---> 0 0 2 D (HEX) = 45 (DEC)
- *      The HS-10 processor calculates the water depth by use of
- *      average sound velocity and by correcting the difference
- *      between the true angle of the sound path (obtained by the
- *      true sound velocity profile) and the nominal angle of each
- *      beam (every 2 degrees). The horizontal distance of the n-th
- *      beam is
- *              Distance(n) = Depth(n) * tan[T(n)],
- *      where T(n) is the nominal angle of the n-th beam:
- *              ( T(n) = 2 * (n-23) degrees, n=1,45 ).
- *
- *      No.  Bytes  Data
- *       1.    4    Year
- *       2.    4    Month
- *       3.    4    Day
- *       4.    4    Hour
- *       5.    4    Minute
- *       6.    4    Second
- *       7.    8    Latitude in 1/10000 minute
- *       8.    8    Longitude in 1/10000 minute
- *       9.    8    X in 1/10 metre
- *      10.    8    Y in 1/10 metre
- *      11.    4    Ship's speed in 1/10 knot
- *      12.    4    Ship's heading in 1/10 degree
- *      13. 4x45    45 Water depths in metre
- *      14. 4x45    45 Intensity of reflection in dB
- *      15.    4    Selection of navigation
- *                    0:HYB, 1:ANS, 2:MANU(L/L) 3:MANU(X/Y)
- *      16.    4    Surface sound velocity in 1/10 m/sec
- *      17.    8    Initial latitude in 1/10000 minute
- *      18.    8    Initial longitude in 1/10000 minute
- *      19.    8    Initial X in 1/10 metre
- *      20.    8    Initial Y in 1/10 metre
- *      21.    4    Manual bearing in 1/10 degree
- *      22.    4    Manual ship's speed in 1/10 knot
- *      23.    4    Ship's draft in 1/10 metre
- *      24.    4    Offset X in 1/10 metre
- *      25.    4    Offset Y in 1/10 metre
- *      26.    4    Selection of sound velocity
- *                    0:no correction, 1:manual input, 2:calculation correction
- *      27.    4    Average sound velocity in 1/10 m/sec
- *      28.    4    Input selection of water temperature
- *                    0:AUTO, 1:MANUAL
- *      29.    4    Water temperature in 1/10 degree
- *      30.    4    Tide level in 1/10 metre
- *      31. 4x10    10 Depth of layer in metre
- *      32. 4x10    10 Temperature of layer in 1/10 degree
- *      33. 4x10    10 Salinity in 1/10 per mille
- *      34. 4x10    10 Sound velocity in 1/10 m/sec
- *      35.    4    Transmitted pulse width
- *                    0:1m, 1:2m, 2:4m, 3:8m
- *      36.    4    Level of transmission [1-16]
- *                    1:Off, 16:Max, -2dB in each step
- *      37.    4    Selection of period of tranmission
- *                    0:Auto, 1:Manual
- *      38:    4    Period of tranmission in second
- *      39:    4    Pre-amp ATT
- *                    0:OFF, 1:ON
- *      40:    4    Receiving gain [1-16]
- *                    1:Off, 16:Max, -2dB in each step
- *      41.    4    TVG [1-4]
- *      42.    4    AVG [1-4]
- *      43.    4    Threshold [1-16]
- *      44.    4    Gate width (R/L) [1-4]
- *      45.    4    Gate width (F/B) [1-4]
- *      46.    4    Selection of beam pattern [1-3]
- *      47.    4    Interferance removal
- *                    0:OFF, 1:ON
- *      48.    4    KP shift [1-32]
- *      49.    4    Sonar mode [0]
- *      50.         not used
- *      ----------------------------------------------------------
- *
- */
-
-/* number of beams for Furuno HS-10 */
-#define MBSYS_HS10_BEAMS 45
-
-/* beam spacing is 2.0 degrees for Furuno HS-10 */
-#define MBSYS_HS10_BEAMSPACING 2.0
-
-/* length of comment record */
-#define MBSYS_HS10_COMMENT 256
-
-struct mbsys_hs10_struct
-	{
-	/* type of data record */
-	int	kind;
-
-	/* time stamp */
-	int	year;
-	int	month;
-	int	day;
-	int	hour;
-	int	minute;
-	int	tenth_second;
-
-	/* navigation */
-	char	NorS;
-	int	latdeg;
-	int	latmin;
-	int	EorW;
-	int	londeg;
-	int	lonmin;
-	int	heading;
-	int	center_depth;
-	int	depth[MBSYS_HS10_BEAMS];
-	int	acrosstrack[MBSYS_HS10_BEAMS];
-	int	amplitude[MBSYS_HS10_BEAMS];
-
-	/* comment */
-	char	comment[MBSYS_HS10_COMMENT];
-	};
-
-/* system specific function prototypes */
-int mbsys_hs10_alloc(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error);
-int mbsys_hs10_deall(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error);
-int mbsys_hs10_dimensions(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int *nbath, int *namp, int *nss, int *error);
-int mbsys_hs10_extract(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int time_i[7], double *time_d,
-			double *navlon, double *navlat,
-			double *speed, double *heading,
-			int *nbath, int *namp, int *nss,
-			char *beamflag, double *bath, double *amp,
-			double *bathacrosstrack, double *bathalongtrack,
-			double *ss, double *ssacrosstrack, double *ssalongtrack,
-			char *comment, int *error);
-int mbsys_hs10_insert(int verbose, void *mbio_ptr, void *store_ptr,
-			int kind, int time_i[7], double time_d,
-			double navlon, double navlat,
-			double speed, double heading,
-			int nbath, int namp, int nss,
-			char *beamflag, double *bath, double *amp,
-			double *bathacrosstrack, double *bathalongtrack,
-			double *ss, double *ssacrosstrack, double *ssalongtrack,
-			char *comment, int *error);
-int mbsys_hs10_ttimes(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int *nbeams,
-			double *ttimes, double *angles,
-			double *angles_forward, double *angles_null,
-			double *heave, double *alongtrack_offset,
-			double *draft, double *ssv, int *error);
-int mbsys_hs10_detects(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int *nbeams, int *detects, int *error);
-int mbsys_hs10_extract_altitude(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, double *transducer_depth, double *altitude,
-			int *error);
-int mbsys_hs10_extract_nav(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int time_i[7], double *time_d,
-			double *navlon, double *navlat,
-			double *speed, double *heading, double *draft,
-			double *roll, double *pitch, double *heave,
-			int *error);
-int mbsys_hs10_insert_nav(int verbose, void *mbio_ptr, void *store_ptr,
-			int time_i[7], double time_d,
-			double navlon, double navlat,
-			double speed, double heading, double draft,
-			double roll, double pitch, double heave,
-			int *error);
-int mbsys_hs10_copy(int verbose, void *mbio_ptr,
-			void *store_ptr, void *copy_ptr,
-			int *error);
diff --git a/src/mbio/mbsys_hsds.c b/src/mbio/mbsys_hsds.c
deleted file mode 100644
index 10350e5..0000000
--- a/src/mbio/mbsys_hsds.c
+++ /dev/null
@@ -1,1450 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbsys_hsds.c	3/2/93
- *	$Id: mbsys_hsds.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1993-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbsys_hsds.c contains the functions for handling the data structure
- * used by MBIO functions to store data from the 59-beam Hydrosweep DS
- * multibeam sonar systems.
- * The data formats which are commonly used to store Hydrosweep DS
- * data in files include
- *      MBF_HSATLRAW : MBIO ID 21
- *      MBF_HSLDEDMB : MBIO ID 22
- *      MBF_HSURICEN : MBIO ID 23
- *      MBF_HSLDEOIH : MBIO ID 24
- *
- * Author:	D. W. Caress
- * Date:	March 2, 1993
- * $Log: mbsys_hsds.c,v $
- * Revision 5.10  2008/10/17 07:30:22  caress
- * Added format 26 supporting Hydrosweep DS data used by SOPAC.
- *
- * Revision 5.9  2005/11/05 00:48:05  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.8  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.7  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.6  2002/05/02 03:55:34  caress
- * Release 5.0.beta17
- *
- * Revision 5.5  2002/03/26 07:43:25  caress
- * Release 5.0.beta15
- *
- * Revision 5.4  2001/08/25 00:54:13  caress
- * Adding beamwidth values to extract functions.
- *
- * Revision 5.3  2001/07/20  00:32:54  caress
- * Release 5.0.beta03
- *
- * Revision 5.2  2001/01/22  07:43:34  caress
- * Version 5.0.beta01
- *
- * Revision 5.1  2000/12/10  20:26:50  caress
- * Version 5.0.alpha02
- *
- * Revision 5.0  2000/12/01  22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.17  2000/10/11  01:03:21  caress
- * Convert to ANSI C
- *
- * Revision 4.16  2000/09/30  06:32:52  caress
- * Snapshot for Dale.
- *
- * Revision 4.15  1998/10/05  17:46:15  caress
- * MB-System version 4.6beta
- *
- * Revision 4.14  1997/07/25  14:19:53  caress
- * Version 4.5beta2.
- * Much mucking, particularly with Simrad formats.
- *
- * Revision 4.13  1997/04/21  17:02:07  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.12  1996/08/05  15:21:58  caress
- * Just redid i/o for Simrad sonars, including adding EM12S and EM121 support.
- *
- * Revision 4.12  1996/08/05  15:21:58  caress
- * Just redid i/o for Simrad sonars, including adding EM12S and EM121 support.
- *
- * Revision 4.11  1996/04/22  13:21:19  caress
- * Now have DTR and MIN/MAX defines in mb_define.h
- *
- * Revision 4.10  1995/11/27  21:50:55  caress
- * New version of mb_ttimes with ssv and angles_null.
- *
- * Revision 4.9  1995/09/28  18:10:48  caress
- * Various bug fixes working toward release 4.3.
- *
- * Revision 4.8  1995/08/17  14:41:09  caress
- * Revision for release 4.3.
- *
- * Revision 4.7  1995/07/26  14:45:39  caress
- * Fixed problems related to shallow water data.
- *
- * Revision 4.6  1995/07/13  19:13:36  caress
- * Intermediate check-in during major bug-fixing flail.
- *
- * Revision 4.5  1995/03/08  13:31:09  caress
- * Fixed bug related to handling of shallow water data and the depth scale.
- *
- * Revision 4.4  1995/03/06  19:38:54  caress
- * Changed include strings.h to string.h for POSIX compliance.
- *
- * Revision 4.3  1994/11/09  21:40:34  caress
- * Changed ttimes extraction routines to handle forward beam angles
- * so that alongtrack distances can be calculated.
- *
- * Revision 4.2  1994/10/21  12:20:01  caress
- * Release V4.0
- *
- * Revision 4.1  1994/04/11  23:34:41  caress
- * Added function to extract travel time and beam angle data
- * from multibeam data in an internal data structure.
- *
- * Revision 4.1  1994/04/11  23:34:41  caress
- * Added function to extract travel time and beam angle data
- * from multibeam data in an internal data structure.
- *
- * Revision 4.0  1994/03/06  00:01:56  caress
- * First cut at version 4.0
- *
- * Revision 4.1  1994/03/03  03:39:43  caress
- * Fixed copyright message.
- *
- * Revision 4.0  1994/02/20  04:25:19  caress
- * First cut at new version.  Now handles passing of
- * amplitude arrays and unused sidescan arrays.
- *
- * Revision 3.0  1993/05/14  22:59:07  sohara
- * initial version
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mb_define.h"
-#include "mbsys_hsds.h"
-
-static char rcs_id[]="$Id: mbsys_hsds.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mbsys_hsds_alloc(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_hsds_alloc";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* allocate memory for data structure */
-	status = mb_malloc(verbose,sizeof(struct mbsys_hsds_struct),
-				store_ptr,error);
-	memset(*store_ptr, 0, sizeof(struct mbsys_hsds_struct));
-
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)*store_ptr);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_hsds_deall(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_hsds_deall";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)*store_ptr);
-		}
-
-	/* deallocate memory for data structure */
-	status = mb_free(verbose,store_ptr,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_hsds_dimensions(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int *nbath, int *namp, int *nss, int *error)
-{
-	char	*function_name = "mbsys_hsds_dimensions";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_hsds_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_hsds_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get beam and pixel numbers */
-		*nbath = mb_io_ptr->beams_bath_max;
-		*namp = mb_io_ptr->beams_amp_max;
-		*nss = 0;
-		}
-	else
-		{
-		/* get beam and pixel numbers */
-		*nbath = 0;
-		*namp = 0;
-		*nss = 0;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		fprintf(stderr,"dbg2       nbath:      %d\n",*nbath);
-		fprintf(stderr,"dbg2        namp:      %d\n",*namp);
-		fprintf(stderr,"dbg2        nss:       %d\n",*nss);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_hsds_extract(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int time_i[7], double *time_d,
-		double *navlon, double *navlat,
-		double *speed, double *heading,
-		int *nbath, int *namp, int *nss,
-		char *beamflag, double *bath, double *amp,
-		double *bathacrosstrack, double *bathalongtrack,
-		double *ss, double *ssacrosstrack, double *ssalongtrack,
-		char *comment, int *error)
-{
-	char	*function_name = "mbsys_hsds_extract";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_hsds_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_hsds_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get time */
-		time_i[0] = store->year;
-		time_i[1] = store->month;
-		time_i[2] = store->day;
-		time_i[3] = store->hour;
-		time_i[4] = store->minute;
-		time_i[5] = store->second;
-		time_i[6] = 0;
-		mb_get_time(verbose,time_i,time_d);
-
-		/* get navigation */
-		*navlon = store->lon;
-		*navlat = store->lat;
-
-		/* get heading */
-		*heading = store->course_true;
-
-		/* get speed (convert m/s to km/hr) */
-		*speed = 3.6*store->speed;
-
-		/* set beamwidths in mb_io structure */
-		mb_io_ptr->beamwidth_ltrack = 2.3;
-		mb_io_ptr->beamwidth_xtrack = 2.3;
-
-		/* read distance and depth values into storage arrays */
-		*nbath = mb_io_ptr->beams_bath_max;
-		*namp = mb_io_ptr->beams_amp_max;
-		*nss = 0;
-		for (i=0;i<*nbath;i++)
-			{
-			if (store->depth[i] > 0)
-			    {
-			    beamflag[i] = MB_FLAG_NONE;
-			    bath[i] = store->depth_scale*store->depth[i];
-			    }
-			else if (store->depth[i] < 0)
-			    {
-			    beamflag[i]
-				= MB_FLAG_MANUAL + MB_FLAG_FLAG;
-			    bath[i] = -store->depth_scale*store->depth[i];
-			    }
-			else
-			    {
-			    beamflag[i] = MB_FLAG_NULL;
-			    bath[i] = store->depth_scale*store->depth[i];
-			    }
-			bathacrosstrack[i] =
-				store->depth_scale*store->distance[i];
-			bathalongtrack[i] = 0.0;
-			}
-		if (store->depth_center < 0.0)
-		    bath[29] = -store->depth_center;
-		else
-		    bath[29] = store->depth_center;
-		bathacrosstrack[29] = 0.0;
-		if (store->back_scale <= 0.0)
-			store->back_scale = 1.0;
-		for (i=0;i<*namp;i++)
-			{
-			amp[i] = store->back_scale * store->back[i];
-			}
-
-		/* print debug statements */
-		if (verbose >= 5)
-			{
-			fprintf(stderr,"\ndbg4  Data extracted by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  Extracted values:\n");
-			fprintf(stderr,"dbg4       kind:       %d\n",
-				*kind);
-			fprintf(stderr,"dbg4       error:      %d\n",
-				*error);
-			fprintf(stderr,"dbg4       time_i[0]:  %d\n",
-				time_i[0]);
-			fprintf(stderr,"dbg4       time_i[1]:  %d\n",
-				time_i[1]);
-			fprintf(stderr,"dbg4       time_i[2]:  %d\n",
-				time_i[2]);
-			fprintf(stderr,"dbg4       time_i[3]:  %d\n",
-				time_i[3]);
-			fprintf(stderr,"dbg4       time_i[4]:  %d\n",
-				time_i[4]);
-			fprintf(stderr,"dbg4       time_i[5]:  %d\n",
-				time_i[5]);
-			fprintf(stderr,"dbg4       time_i[6]:  %d\n",
-				time_i[6]);
-			fprintf(stderr,"dbg4       time_d:     %f\n",
-				*time_d);
-			fprintf(stderr,"dbg4       longitude:  %f\n",
-				*navlon);
-			fprintf(stderr,"dbg4       latitude:   %f\n",
-				*navlat);
-			fprintf(stderr,"dbg4       speed:      %f\n",
-				*speed);
-			fprintf(stderr,"dbg4       heading:    %f\n",
-				*heading);
-			fprintf(stderr,"dbg4       nbath:      %d\n",
-				*nbath);
-			for (i=0;i<*nbath;i++)
-			  fprintf(stderr,"dbg4       beam:%d  flag:%3d  bath:%f  acrosstrack:%f  alongtrack:%f\n",
-				i,beamflag[i],bath[i],bathacrosstrack[i],bathalongtrack[i]);
-			fprintf(stderr,"dbg4        namp:     %d\n",
-				*namp);
-			for (i=0;i<*namp;i++)
-			  fprintf(stderr,"dbg4        beam:%d   amp:%f  acrosstrack:%f  alongtrack:%f\n",
-				i,amp[i],bathacrosstrack[i],bathalongtrack[i]);
-			}
-
-		/* done translating values */
-
-		}
-
-	/* extract comment from structure */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* copy comment */
-		strcpy(comment,store->comment);
-
-		/* print debug statements */
-		if (verbose >= 4)
-			{
-			fprintf(stderr,"\ndbg4  New ping read by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  New ping values:\n");
-			fprintf(stderr,"dbg4       error:      %d\n",
-				*error);
-			fprintf(stderr,"dbg4       comment:    %s\n",
-				comment);
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind == MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"dbg2       comment:     \ndbg2       %s\n",
-			comment);
-		}
-	else if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind != MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"dbg2       time_i[0]:     %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:     %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:     %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:     %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:     %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:     %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:     %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:        %f\n",*time_d);
-		fprintf(stderr,"dbg2       longitude:     %f\n",*navlon);
-		fprintf(stderr,"dbg2       latitude:      %f\n",*navlat);
-		fprintf(stderr,"dbg2       speed:         %f\n",*speed);
-		fprintf(stderr,"dbg2       heading:       %f\n",*heading);
-		}
-	if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind == MB_DATA_DATA)
-		{
-		fprintf(stderr,"dbg2       nbath:      %d\n",
-			*nbath);
-		for (i=0;i<*nbath;i++)
-		  fprintf(stderr,"dbg2       beam:%d  flag:%3d  bath:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,beamflag[i],bath[i],
-			bathacrosstrack[i],bathalongtrack[i]);
-		fprintf(stderr,"dbg2        namp:     %d\n",
-			*namp);
-		for (i=0;i<*namp;i++)
-		  fprintf(stderr,"dbg2       beam:%d   amp:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,amp[i],bathacrosstrack[i],bathalongtrack[i]);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_hsds_insert(int verbose, void *mbio_ptr, void *store_ptr,
-		int kind, int time_i[7], double time_d,
-		double navlon, double navlat,
-		double speed, double heading,
-		int nbath, int namp, int nss,
-		char *beamflag, double *bath, double *amp,
-		double *bathacrosstrack, double *bathalongtrack,
-		double *ss, double *ssacrosstrack, double *ssalongtrack,
-		char *comment, int *error)
-{
-	char	*function_name = "mbsys_hsds_insert";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_hsds_struct *store;
-	double	scalefactor;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       kind:       %d\n",kind);
-		}
-	if (verbose >= 2 && (kind == MB_DATA_DATA || kind == MB_DATA_NAV))
-		{
-		fprintf(stderr,"dbg2       time_i[0]:  %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:  %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:  %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:  %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:  %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:  %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:  %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:     %f\n",time_d);
-		fprintf(stderr,"dbg2       navlon:     %f\n",navlon);
-		fprintf(stderr,"dbg2       navlat:     %f\n",navlat);
-		fprintf(stderr,"dbg2       speed:      %f\n",speed);
-		fprintf(stderr,"dbg2       heading:    %f\n",heading);
-		}
-	if (verbose >= 2 && kind == MB_DATA_DATA)
-		{
-		fprintf(stderr,"dbg2       nbath:      %d\n",nbath);
-		if (verbose >= 3)
-		 for (i=0;i<nbath;i++)
-		  fprintf(stderr,"dbg3       beam:%d  flag:%3d  bath:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,beamflag[i],bath[i],
-			bathacrosstrack[i],bathalongtrack[i]);
-		fprintf(stderr,"dbg2       namp:       %d\n",namp);
-		if (verbose >= 3)
-		 for (i=0;i<namp;i++)
-		  fprintf(stderr,"dbg3        beam:%d   amp:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,amp[i],bathacrosstrack[i],bathalongtrack[i]);
-		fprintf(stderr,"dbg2        nss:       %d\n",nss);
-		if (verbose >= 3)
-		 for (i=0;i<nss;i++)
-		  fprintf(stderr,"dbg3        pixel:%d   ss:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,ss[i],ssacrosstrack[i],ssalongtrack[i]);
-		}
-	if (verbose >= 2 && kind == MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"dbg2       comment:     \ndbg2       %s\n",
-			comment);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_hsds_struct *) store_ptr;
-
-	/* set data kind */
-	store->kind = kind;
-
-	/* insert data in structure */
-	if (store->kind == MB_DATA_DATA)
-		{
-		/* get time */
-		store->year = time_i[0];
-		store->month = time_i[1];
-		store->day = time_i[2];
-		store->hour = time_i[3];
-		store->minute = time_i[4];
-		store->second = time_i[5];
-
-		/* get navigation */
-		if (navlon < 0.0) navlon = navlon + 360.0;
-		store->lon = navlon;
-		store->lat = navlat;
-
-		/* get heading (360 degrees = 65536) */
-		store->course_true = heading;
-
-		/* get speed (convert km/hr to m/s) */
-		store->speed = 0.2777777778*speed;
-
-		/* put distance and depth values
-			into data structure */
-		if (store->depth_scale > 0.0)
-			scalefactor = 1.0/store->depth_scale;
-		else
-			scalefactor = 1.0;
-		for (i=0;i<nbath;i++)
-			{
-			if (mb_beam_check_flag_null(beamflag[i]))
-			    {
-			    store->depth[i] = 0.0;
-/*fprintf(stderr, "NULL: time_d:%f i:%d flag:%d bath: %f %d\n",
-time_d, i, beamflag[i], bath[i], store->depth[i]);*/
-			    }
-			else if (mb_beam_check_flag(beamflag[i]))
-			    {
-			    store->depth[i] = -scalefactor*bath[i];
-/*fprintf(stderr, "FLAG: time_d:%f i:%d flag:%d bath: %f %d\n",
-time_d, i, beamflag[i], bath[i], store->depth[i]);*/
-			    }
-			else
-			    {
-			    store->depth[i] = scalefactor*bath[i];
-			    }
-			store->distance[i] =
-				scalefactor*bathacrosstrack[i];
-			}
-		if (mb_beam_check_flag_null(beamflag[29]))
-		    store->depth_center = 0.0;
-		else if (mb_beam_check_flag(beamflag[29]))
-		    store->depth_center = -bath[29];
-		else
-		    store->depth_center = bath[29];
-		if (store->back_scale <= 0.0)
-			store->back_scale = 1.0;
-		for (i=0;i<namp;i++)
-			store->back[i] = amp[i] / store->back_scale;
-		}
-
-	/* insert comment in structure */
-	else if (store->kind == MB_DATA_COMMENT)
-		{
-		strcpy(store->comment,comment);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_hsds_ttimes(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, int *nbeams,
-	double *ttimes, double *angles,
-	double *angles_forward, double *angles_null,
-	double *heave, double *alongtrack_offset,
-	double *draft, double *ssv, int *error)
-{
-	char	*function_name = "mbsys_hsds_ttimes";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_hsds_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       ttimes:     %p\n",(void *)ttimes);
-		fprintf(stderr,"dbg2       angles_xtrk:%p\n",(void *)angles);
-		fprintf(stderr,"dbg2       angles_ltrk:%p\n",(void *)angles_forward);
-		fprintf(stderr,"dbg2       angles_null:%p\n",(void *)angles_null);
-		fprintf(stderr,"dbg2       heave:      %p\n",(void *)heave);
-		fprintf(stderr,"dbg2       ltrk_off:   %p\n",(void *)alongtrack_offset);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_hsds_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA
-		|| *kind == MB_DATA_CALIBRATE)
-		{
-		/* get nbeams */
-		*nbeams = mb_io_ptr->beams_bath_max;
-
-		/* get travel times, angles */
-		for (i=0;i<mb_io_ptr->beams_bath_max;i++)
-			{
-			ttimes[i] = store->time_scale*store->time[i];
-			angles[i] = (i-MBSYS_HSDS_BEAMS/2)
-				*MBSYS_HSDS_BEAM_SPACING;
-			if (angles[i] < 0.0)
-				{
-				angles[i] = -angles[i];
-				angles_forward[i] = 180.0;
-				}
-			else
-				angles_forward[i] = 0.0;
-			angles_null[i] = 0.0;
-			heave[i] = store->heave;
-			alongtrack_offset[i] = 0.0;
-			}
-
-		/* get ssv */
- 		*ssv = store->vel_keel;
- 		*draft = store->draught;
-
-		/* set status */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error == MB_ERROR_NO_ERROR)
-		{
-		fprintf(stderr,"dbg2       draft:      %f\n",*draft);
-		fprintf(stderr,"dbg2       ssv:        %f\n",*ssv);
-		fprintf(stderr,"dbg2       nbeams:     %d\n",*nbeams);
-		for (i=0;i<*nbeams;i++)
-			fprintf(stderr,"dbg2       beam %d: tt:%f  angle_xtrk:%f  angle_ltrk:%f  angle_null:%f  depth_off:%f  ltrk_off:%f\n",
-				i,ttimes[i],angles[i],
-				angles_forward[i],angles_null[i],
-				heave[i],alongtrack_offset[i]);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_hsds_detects(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, int *nbeams,
-	int *detects, int *error)
-{
-	char	*function_name = "mbsys_hsds_detects";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_hsds_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       detects:    %p\n",(void *)detects);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_hsds_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get nbeams */
-		*nbeams = mb_io_ptr->beams_bath_max;
-
-		/* get detects */
-		for (i=0;i<*nbeams;i++)
-			{
-			detects[i] = MB_DETECT_AMPLITUDE;
-			}
-
-		/* set status */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error == MB_ERROR_NO_ERROR)
-		{
-		fprintf(stderr,"dbg2       nbeams:     %d\n",*nbeams);
-		for (i=0;i<*nbeams;i++)
-			fprintf(stderr,"dbg2       beam %d: detects:%d\n",
-				i,detects[i]);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_hsds_extract_altitude(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, double *transducer_depth, double *altitude,
-	int *error)
-{
-	char	*function_name = "mbsys_hsds_extract_altitude";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_hsds_struct *store;
-	double	bath_best;
-	double	xtrack_min;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_hsds_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA
-		|| *kind == MB_DATA_CALIBRATE)
-		{
-		bath_best = 0.0;
-		if (store->depth[mb_io_ptr->beams_bath_max/2] > 0.0)
-		    bath_best = store->depth_scale*store->depth[mb_io_ptr->beams_bath_max/2];
-		else
-		    {
-		    xtrack_min = 99999999.9;
-		    for (i=0;i<mb_io_ptr->beams_bath_max;i++)
-			{
-			if (store->depth_scale*store->depth[i] > 0.0
-			    && fabs(store->depth_scale*store->distance[i]) < xtrack_min)
-			    {
-			    xtrack_min = fabs(store->depth_scale*store->distance[i]);
-			    bath_best = store->depth_scale*store->depth[i];
-			    }
-			}
-		    }
-		if (bath_best <= 0.0)
-		    {
-		    xtrack_min = 99999999.9;
-		    for (i=0;i<mb_io_ptr->beams_bath_max;i++)
-			{
-			if (store->depth_scale*store->depth[i] < 0.0
-			    && fabs(store->depth_scale*store->distance[i]) < xtrack_min)
-			    {
-			    xtrack_min = fabs(store->depth_scale*store->distance[i]);
-			    bath_best = -store->depth_scale*store->depth[i];
-			    }
-			}
-		    }
-		*transducer_depth = store->draught;
-		*altitude = bath_best - *transducer_depth;
-
-		/* set status */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:              %d\n",*kind);
-		fprintf(stderr,"dbg2       transducer_depth:  %f\n",*transducer_depth);
-		fprintf(stderr,"dbg2       altitude:          %f\n",*altitude);
-		fprintf(stderr,"dbg2       error:             %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:            %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_hsds_extract_nav(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int time_i[7], double *time_d,
-		double *navlon, double *navlat,
-		double *speed, double *heading, double *draft,
-		double *roll, double *pitch, double *heave,
-		int *error)
-{
-	char	*function_name = "mbsys_hsds_extract_nav";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_hsds_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_hsds_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get time */
-		time_i[0] = store->year;
-		time_i[1] = store->month;
-		time_i[2] = store->day;
-		time_i[3] = store->hour;
-		time_i[4] = store->minute;
-		time_i[5] = store->second;
-		time_i[6] = 0;
-		mb_get_time(verbose,time_i,time_d);
-
-		/* get navigation */
-		*navlon = store->lon;
-		*navlat = store->lat;
-
-		/* get heading */
-		*heading = store->course_true;
-
-		/* get speed (convert m/s to km/hr) */
-		*speed = 3.6*store->speed;
-
-		/* get draft */
- 		*draft = store->draught;
-
-		/* get roll pitch and heave */
-		*roll = store->roll;
-		*pitch = store->pitch;
-		*heave = store->heave;
-
-		/* print debug statements */
-		if (verbose >= 5)
-			{
-			fprintf(stderr,"\ndbg4  Data extracted by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  Extracted values:\n");
-			fprintf(stderr,"dbg4       kind:       %d\n",
-				*kind);
-			fprintf(stderr,"dbg4       error:      %d\n",
-				*error);
-			fprintf(stderr,"dbg4       time_i[0]:  %d\n",
-				time_i[0]);
-			fprintf(stderr,"dbg4       time_i[1]:  %d\n",
-				time_i[1]);
-			fprintf(stderr,"dbg4       time_i[2]:  %d\n",
-				time_i[2]);
-			fprintf(stderr,"dbg4       time_i[3]:  %d\n",
-				time_i[3]);
-			fprintf(stderr,"dbg4       time_i[4]:  %d\n",
-				time_i[4]);
-			fprintf(stderr,"dbg4       time_i[5]:  %d\n",
-				time_i[5]);
-			fprintf(stderr,"dbg4       time_i[6]:  %d\n",
-				time_i[6]);
-			fprintf(stderr,"dbg4       time_d:     %f\n",
-				*time_d);
-			fprintf(stderr,"dbg4       longitude:  %f\n",
-				*navlon);
-			fprintf(stderr,"dbg4       latitude:   %f\n",
-				*navlat);
-			fprintf(stderr,"dbg4       speed:      %f\n",
-				*speed);
-			fprintf(stderr,"dbg4       heading:    %f\n",
-				*heading);
-			fprintf(stderr,"dbg4       draft:      %f\n",
-				*draft);
-			fprintf(stderr,"dbg4       roll:       %f\n",
-				*roll);
-			fprintf(stderr,"dbg4       pitch:      %f\n",
-				*pitch);
-			fprintf(stderr,"dbg4       heave:      %f\n",
-				*heave);
-			}
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind == MB_DATA_DATA)
-		{
-		fprintf(stderr,"dbg2       time_i[0]:     %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:     %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:     %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:     %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:     %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:     %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:     %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:        %f\n",*time_d);
-		fprintf(stderr,"dbg2       longitude:     %f\n",*navlon);
-		fprintf(stderr,"dbg2       latitude:      %f\n",*navlat);
-		fprintf(stderr,"dbg2       speed:         %f\n",*speed);
-		fprintf(stderr,"dbg2       heading:       %f\n",*heading);
-		fprintf(stderr,"dbg2       draft:         %f\n",*draft);
-		fprintf(stderr,"dbg2       roll:          %f\n",*roll);
-		fprintf(stderr,"dbg2       pitch:         %f\n",*pitch);
-		fprintf(stderr,"dbg2       heave:         %f\n",*heave);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_hsds_insert_nav(int verbose, void *mbio_ptr, void *store_ptr,
-		int time_i[7], double time_d,
-		double navlon, double navlat,
-		double speed, double heading, double draft,
-		double roll, double pitch, double heave,
-		int *error)
-{
-	char	*function_name = "mbsys_hsds_insert_nav";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_hsds_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       time_i[0]:  %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:  %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:  %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:  %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:  %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:  %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:  %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:     %f\n",time_d);
-		fprintf(stderr,"dbg2       navlon:     %f\n",navlon);
-		fprintf(stderr,"dbg2       navlat:     %f\n",navlat);
-		fprintf(stderr,"dbg2       speed:      %f\n",speed);
-		fprintf(stderr,"dbg2       heading:    %f\n",heading);
-		fprintf(stderr,"dbg2       draft:      %f\n",draft);
-		fprintf(stderr,"dbg2       roll:       %f\n",roll);
-		fprintf(stderr,"dbg2       pitch:      %f\n",pitch);
-		fprintf(stderr,"dbg2       heave:      %f\n",heave);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_hsds_struct *) store_ptr;
-
-	/* insert data in structure */
-	if (store->kind == MB_DATA_DATA)
-		{
-		/* get time */
-		store->year = time_i[0];
-		store->month = time_i[1];
-		store->day = time_i[2];
-		store->hour = time_i[3];
-		store->minute = time_i[4];
-		store->second = time_i[5];
-
-		/* get navigation */
-		if (navlon < 0.0) navlon = navlon + 360.0;
-		store->lon = navlon;
-		store->lat = navlat;
-
-		/* get heading (360 degrees = 65536) */
-		store->course_true = heading;
-
-		/* get speed (convert km/hr to m/s) */
-		store->speed = 0.2777777778*speed;
-
-		/* get draft */
- 		store->draught = draft;
-
-		/* get roll pitch and heave */
-		store->roll = roll;
-		store->pitch = pitch;
-		store->heave = heave;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_hsds_extract_svp(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int *nsvp,
-		double *depth, double *velocity,
-		int *error)
-{
-	char	*function_name = "mbsys_hsds_extract_svp";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_hsds_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_hsds_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_VELOCITY_PROFILE)
-		{
-		/* get number of depth-velocity pairs */
-		*nsvp = store->num_vel;
-
-		/* get profile */
-		for (i=0;i<*nsvp;i++)
-			{
-			depth[i] = store->vdepth[i];
-			velocity[i] = store->velocity[i];
-			}
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:              %d\n",*kind);
-		fprintf(stderr,"dbg2       nsvp:              %d\n",*nsvp);
-		for (i=0;i<*nsvp;i++)
-		    fprintf(stderr,"dbg2       depth[%d]: %f   velocity[%d]: %f\n",i, depth[i], i, velocity[i]);
-		fprintf(stderr,"dbg2       error:             %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:            %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_hsds_insert_svp(int verbose, void *mbio_ptr, void *store_ptr,
-		int nsvp,
-		double *depth, double *velocity,
-		int *error)
-{
-	char	*function_name = "mbsys_hsds_insert_svp";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_hsds_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       nsvp:       %d\n",nsvp);
-		for (i=0;i<nsvp;i++)
-		    fprintf(stderr,"dbg2       depth[%d]: %f   velocity[%d]: %f\n",i, depth[i], i, velocity[i]);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_hsds_struct *) store_ptr;
-
-	/* insert data in structure */
-	if (store->kind == MB_DATA_VELOCITY_PROFILE)
-		{
-		/* get number of depth-velocity pairs */
-		store->num_vel = MIN(nsvp, MBSYS_HSDS_MAXVEL);
-
-		/* get profile */
-		for (i=0;i<store->num_vel;i++)
-			{
-			store->vdepth[i] = depth[i];
-			store->velocity[i] = velocity[i];
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_hsds_copy(int verbose, void *mbio_ptr,
-			void *store_ptr, void *copy_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_hsds_copy";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_hsds_struct *store;
-	struct mbsys_hsds_struct *copy;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       copy_ptr:   %p\n",(void *)copy_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointers */
-	store = (struct mbsys_hsds_struct *) store_ptr;
-	copy = (struct mbsys_hsds_struct *) copy_ptr;
-
-	/* copy the data */
-	*copy = *store;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mbsys_hsds.h b/src/mbio/mbsys_hsds.h
deleted file mode 100644
index 6154caf..0000000
--- a/src/mbio/mbsys_hsds.h
+++ /dev/null
@@ -1,299 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbsys_hsds.h	2/16/93
- *	$Id: mbsys_hsds.h 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1993-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbsys_hsds.h defines the data structures used by MBIO functions
- * to store data from Hydrosweep DS multibeam sonar systems.
- * The data formats which are commonly used to store Hydrosweep DS
- * data in files include
- *      MBF_HSATLRAW : MBIO ID 21
- *      MBF_HSLDEDMB : MBIO ID 22
- *      MBF_HSURICEN : MBIO ID 23
- *      MBF_HSLDEOIH : MBIO ID 24
- *
- * Author:	D. W. Caress
- * Date:	February 16, 1993
- * $Log: mbsys_hsds.h,v $
- * Revision 5.5  2005/11/05 00:48:03  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.4  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.3  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.2  2001/07/20 00:32:54  caress
- * Release 5.0.beta03
- *
- * Revision 5.1  2001/01/22  07:43:34  caress
- * Version 5.0.beta01
- *
- * Revision 5.0  2000/12/01  22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.5  2000/09/30  06:31:19  caress
- * Snapshot for Dale.
- *
- * Revision 4.4  1998/10/05  18:32:27  caress
- * MB-System version 4.6beta
- *
- * Revision 1.1  1998/10/05  17:46:15  caress
- * Initial revision
- *
- * Revision 4.3  1997/04/21  17:02:07  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.3  1997/04/21  17:02:07  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.2  1995/02/22  21:56:08  caress
- * Put array of per beam gain values in this include file.
- *
- * Revision 4.2  1995/02/22  21:56:08  caress
- * Put array of per beam gain values in this include file.
- *
- * Revision 4.1  1994/10/21  12:20:01  caress
- * Release V4.0
- *
- * Revision 4.0  1994/03/06  00:01:56  caress
- * First cut at version 4.0
- *
- * Revision 4.1  1994/03/03  03:39:43  caress
- * Fixed copyright message.
- *
- * Revision 4.0  1994/02/17  20:36:40  caress
- * First cut at new version.  Comment changes only.
- *
- * Revision 3.1  1993/06/09  08:21:11  caress
- * Added definition of beam angle spacing.  The actual spacing
- * seems to be 1.510 degrees instead of the 1.525 degrees listed
- * in the Atlas manuals (based on Hydrosweep DS data collected
- * on the R/V Ewing on June 9, 1993.
- *
- * Revision 3.0  1993/05/14  22:59:28  sohara
- * initial version
- *
- */
-/*
- * Notes on the MBSYS_HSDS data structure:
- *   1. Hydrosweep DS multibeam systems output raw data in an
- *      ascii format.  The data consists of a number of different
- *      multi-line ascii records.
- *   2. The DS systems output 59 beams of bathymetry and 59 beams
- *      of amplitude measurements, along with a plethora of other
- *      information.
- *   3. The records all include navigation and time stamp information.
- *      The record types are:
- *        ERGNHYDI:  mean and keel water velocity values
- *        ERGNPARA:  navigation when system in standby
- *        ERGNPOSI:  navigation source
- *        ERGNMESS:  across-track "survey" bathymetry
- *        ERGNEICH:  along-track "calibration" bathymetry
- *        ERGNLSZT:  travel times associated with
- *                   ERGNMESS or ERGNEICH records
- *        ERGNCTDS:  water sound velocity profile
- *        ERGNAMPL:  amplitudes associated with
- *                   ERGNMESS or ERGNEICH records
- *        LDEOCOMM:  comment records (an L-DEO extension)
- *   4. A single ping usually results in the following series of
- *      of records:
- *        1. ERGNMESS or ERGNEICH
- *        2. ERGNSLZT
- *        3. ERGNAMPL
- *      The ERGNHYDI, ERGNPARA, ERGNPOSI and ERGNCTDS records occur
- *      at system startup and when the associated operational
- *      parameters of the Hydrosweep are changed.
- *   5. The kind value in the mbsys_hsds_struct indicates whether the
- *      mbsys_hsds_data_struct structure holds data from a ping or
- *      data from some other record:
- *        kind = 1 : data from a survey ping
- *                   (ERGNMESS + ERGNSLZT + ERGNAMPL)
- *        kind = 2 : comment (LDEOCOMM)
- *        kind = 3 : data from a calibrate ping
- *                   (ERGNEICH + ERGNSLZT + ERGNAMPL)
- *        kind = 4 : mean and keel velocity (ERGNHYDI)
- *        kind = 5 : water velocity profile (ERGNCTDS)
- *        kind = 6 : standby navigation (ERGNPARA)
- *        kind = 7 : navigation source (ERGNPOSI)
- *   6. The data structure defined below includes all of the values
- *      which are passed in Hydrosweep records.
- */
-
-/* maximum number of depth-velocity pairs */
-#define MBSYS_HSDS_MAXVEL 30
-
-/* maximum line length in characters */
-#define MBSYS_HSDS_MAXLINE 200
-
-/* number of beams for hydrosweep */
-#define MBSYS_HSDS_BEAMS 59
-
-/* angular beam spacing for Hydrosweep DS
-	- this is supposed to be 1.525 degrees but seems
-	to really be 1.510 degrees */
-#define MBSYS_HSDS_BEAM_SPACING 1.510
-
-struct mbsys_hsds_struct
-	{
-	/* type of data record */
-	int	kind;
-
-	/* position (all records but comment ) */
-	double	lon;
-	double	lat;
-
-	/* time stamp (all records but comment ) */
-	int	year;
-	int	month;
-	int	day;
-	int	hour;
-	int	minute;
-	int	second;
-	int	alt_minute;
-	int	alt_second;
-
-	/* additional navigation and depths (ERGNMESS and ERGNEICH) */
-	double	course_true;
-	double	speed_transverse;
-	double	speed;
-	char	speed_reference[2];
-	double	pitch;
-	int	track;
-	double	depth_center;
-	double	depth_scale;
-	int	spare;
-	int	distance[MBSYS_HSDS_BEAMS];
-	int	depth[MBSYS_HSDS_BEAMS];
-
-	/* travel time data (ERGNSLZT) */
-	double	course_ground;
-	double	speed_ground;
-	double	heave;
-	double	roll;
-	double	time_center;
-	double	time_scale;
-	int	time[MBSYS_HSDS_BEAMS];
-	double	gyro[11];
-
-	/* amplitude data (ERGNAMPL) */
-	char	mode[2];
-	int	trans_strbd;
-	int	trans_vert;
-	int	trans_port;
-	int	pulse_len_strbd;
-	int	pulse_len_vert;
-	int	pulse_len_port;
-	int	gain_start;
-	int	r_compensation_factor;
-	int	compensation_start;
-	int	increase_start;
-	int	tvc_near;
-	int	tvc_far;
-	int	increase_int_near;
-	int	increase_int_far;
-	int	gain_center;
-	double	filter_gain;
-	int	amplitude_center;
-	int	echo_duration_center;
-	int	echo_scale_center;
-	int	gain[16];
-	int	amplitude[MBSYS_HSDS_BEAMS];
-	int	echo_scale[16];
-	int	echo_duration[MBSYS_HSDS_BEAMS];
-
-	/* mean velocity (ERGNHYDI) */
-	double	draught;
-	double	vel_mean;
-	double	vel_keel;
-	double	tide;
-
-	/* water velocity profile (HS_ERGNCTDS) */
-	int	num_vel;
-	double	vdepth[MBSYS_HSDS_MAXVEL];
-	double	velocity[MBSYS_HSDS_MAXVEL];
-
-	/* navigation source (ERGNPOSI) */
-	double	pos_corr_x;
-	double	pos_corr_y;
-	char	sensors[10];
-
-	/* comment (LDEOCMNT) */
-	char	comment[MBSYS_HSDS_MAXLINE];
-
-	/* processed amplitude data */
-	double	back_scale;
-	int	back[MBSYS_HSDS_BEAMS];
-	};
-
-/* system specific function prototypes */
-int mbsys_hsds_alloc(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error);
-int mbsys_hsds_deall(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error);
-int mbsys_hsds_dimensions(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int *nbath, int *namp, int *nss, int *error);
-int mbsys_hsds_extract(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int time_i[7], double *time_d,
-			double *navlon, double *navlat,
-			double *speed, double *heading,
-			int *nbath, int *namp, int *nss,
-			char *beamflag, double *bath, double *amp,
-			double *bathacrosstrack, double *bathalongtrack,
-			double *ss, double *ssacrosstrack, double *ssalongtrack,
-			char *comment, int *error);
-int mbsys_hsds_insert(int verbose, void *mbio_ptr, void *store_ptr,
-			int kind, int time_i[7], double time_d,
-			double navlon, double navlat,
-			double speed, double heading,
-			int nbath, int namp, int nss,
-			char *beamflag, double *bath, double *amp,
-			double *bathacrosstrack, double *bathalongtrack,
-			double *ss, double *ssacrosstrack, double *ssalongtrack,
-			char *comment, int *error);
-int mbsys_hsds_ttimes(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int *nbeams,
-			double *ttimes, double *angles,
-			double *angles_forward, double *angles_null,
-			double *heave, double *alongtrack_offset,
-			double *draft, double *ssv, int *error);
-int mbsys_hsds_detects(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int *nbeams, int *detects, int *error);
-int mbsys_hsds_extract_altitude(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, double *transducer_depth, double *altitude,
-			int *error);
-int mbsys_hsds_extract_nav(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int time_i[7], double *time_d,
-			double *navlon, double *navlat,
-			double *speed, double *heading, double *draft,
-			double *roll, double *pitch, double *heave,
-			int *error);
-int mbsys_hsds_insert_nav(int verbose, void *mbio_ptr, void *store_ptr,
-			int time_i[7], double time_d,
-			double navlon, double navlat,
-			double speed, double heading, double draft,
-			double roll, double pitch, double heave,
-			int *error);
-int mbsys_hsds_extract_svp(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind,
-			int *nsvp,
-			double *depth, double *velocity,
-			int *error);
-int mbsys_hsds_insert_svp(int verbose, void *mbio_ptr, void *store_ptr,
-			int nsvp,
-			double *depth, double *velocity,
-			int *error);
-int mbsys_hsds_copy(int verbose, void *mbio_ptr,
-			void *store_ptr, void *copy_ptr,
-			int *error);
diff --git a/src/mbio/mbsys_hsmd.c b/src/mbio/mbsys_hsmd.c
deleted file mode 100644
index 3f828f4..0000000
--- a/src/mbio/mbsys_hsmd.c
+++ /dev/null
@@ -1,1397 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbsys_hsmd.c	Aug 10, 1995
- *	$Header: /system/link/server/cvs/root/mbsystem/src/mbio/mbsys_hsmd.c,v 5.6 2005/11/05 00:48:03 caress Exp $
- *
- *    Copyright (c) 1993-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbsys_hsmd.c contains the functions for handling the data structure
- * used by MBIO functions to store data from the 40/80-beam Hydrosweep M
- * multibeam sonar systems.
- * The data formats which are commonly used to store Hydrosweep MD
- * Medium Depth data in files include:
- *
- *      MBF_HSMDRAW : MBIO ID 101
- *
- * Author:	Dale Chayes
- * Date:	August 10, 1995
- *
- * $Log: mbsys_hsmd.c,v $
- * Revision 5.6  2005/11/05 00:48:03  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.5  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.4  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.3  2001/08/25 00:54:13  caress
- * Adding beamwidth values to extract functions.
- *
- * Revision 5.2  2001/07/20  00:32:54  caress
- * Release 5.0.beta03
- *
- * Revision 5.1  2001/01/22  07:43:34  caress
- * Version 5.0.beta01
- *
- * Revision 5.0  2000/12/01  22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.9  2000/10/11  01:03:21  caress
- * Convert to ANSI C
- *
- * Revision 4.8  2000/09/30  06:32:52  caress
- * Snapshot for Dale.
- *
- * Revision 4.7  1999/09/14  20:39:11  caress
- * Fixed bugs handling HSMD
- *
- * Revision 4.6  1998/10/05  17:46:15  caress
- * MB-System version 4.6beta
- *
- * Revision 4.5  1997/07/25  14:19:53  caress
- * Version 4.5beta2.
- * Much mucking, particularly with Simrad formats.
- *
- * Revision 4.4  1997/04/21  17:02:07  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.3  1996/07/16  22:07:12  caress
- * Fixed port/starboard mixup and made null angles for raytracing 40 degrees to
- * reflect 40 degree tranducer array mounting.
- *
- * Revision 4.3  1996/07/16  22:07:12  caress
- * Fixed port/starboard mixup and made null angles for raytracing 40 degrees to
- * reflect 40 degree tranducer array mounting.
- *
- * Revision 4.2  1996/04/22  13:21:19  caress
- * Now have DTR and MIN/MAX defines in mb_define.h
- *
- * Revision 4.1  1996/01/26  21:23:30  caress
- * Version 4.3 distribution
- *
- * Revision 4.0  1995/09/28  18:14:11  caress
- * First cut.
- *
- * Revision 1.1  1995/09/28  18:10:48  caress
- * Initial revision
- *
- * Revision 4.2  95/08/16  07:08:05  07:08:05  dale (Dale Chayes)
- * Appears to work for some things.
- *  - does not write data correctly yet
- *  - beams may not come out on the correct side/offset
- *
- * Revision 4.1  95/08/14  20:56:02  20:56:02  dale (Dale Chayes)
- * HSMD is sort of working.... needs work and testing.
- *
- * Revision 4.0  95/08/10  15:58:00  15:58:00  dale (Dale Chayes)
- * Adjust the version number, 1.1 was an error
- *
- * Revision 1.1  95/08/10  15:56:08  15:56:08  dale (Dale Chayes)
- * Initial revision
- *
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mb_define.h"
-#include "mbsys_hsmd.h"
-
-static char rcs_id[]="$Id: mbsys_hsmd.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mbsys_hsmd_alloc(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_hsmd_alloc";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-    		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-    		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* allocate memory for data structure */
-	status = mb_malloc(verbose,sizeof(struct mbsys_hsmd_struct),
-		     store_ptr,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-    		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)*store_ptr);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-    		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_hsmd_deall(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_hsmd_deall";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)*store_ptr);
-		}
-
-	/* deallocate memory for data structure */
-	status = mb_free(verbose,store_ptr,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_hsmd_dimensions(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int *nbath, int *namp, int *nss, int *error)
-{
-	char	*function_name = "mbsys_hsmd_dimensions";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_hsmd_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_hsmd_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get beam and pixel numbers */
-		*nbath = MBSYS_HSMD_BEAMS;
-		*namp = *nbath;
-		*nss = MBSYS_HSMD_PIXELS;
-		}
-	else
-		{
-		/* get beam and pixel numbers */
-		*nbath = 0;
-		*namp = 0;
-		*nss = 0;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		fprintf(stderr,"dbg2       nbath:      %d\n",*nbath);
-		fprintf(stderr,"dbg2        namp:      %d\n",*namp);
-		fprintf(stderr,"dbg2        nss:       %d\n",*nss);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_hsmd_extract(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int time_i[7], double *time_d,
-		double *navlon, double *navlat,
-		double *speed, double *heading,
-		int *nbath, int *namp, int *nss,
-		char *beamflag, double *bath, double *amp,
-		double *bathacrosstrack, double *bathalongtrack,
-		double *ss, double *ssacrosstrack, double *ssalongtrack,
-		char *comment, int *error)
-{
-	char	*function_name = "mbsys_hsmd_extract";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_hsmd_struct *store;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_hsmd_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get time */
-		time_i[0] = store->year;
-		time_i[1] = store->month;
-		time_i[2] = store->day;
-		time_i[3] = store->hour;
-		time_i[4] = store->minute;
-		time_i[5] = store->second;
-		time_i[6] = store->millisecond;
-		mb_get_time(verbose,time_i,time_d);
-
-		/* get navigation */
-		*navlon = store->lon;
-		*navlat = store->lat;
-
-		/* get heading */
-		*heading = store->heading_tx;
-
-		/* set speed to zero */
-		*speed = store->speed;
-
-		/* set beamwidths in mb_io structure */
-		mb_io_ptr->beamwidth_ltrack = 1.7;
-		mb_io_ptr->beamwidth_xtrack = 1.7;
-
-		/* zero bathymetry and sidescan */
-		for (i=0;i<MBSYS_HSMD_BEAMS;i++)
-			{
-			beamflag[i] = MB_FLAG_NULL;
-			bath[i] = 0.0;
-			bathacrosstrack[i] = 0.0;
-			bathalongtrack[i] = 0.0;
-			}
-		for (i=0;i<MBSYS_HSMD_PIXELS;i++)
-			{
-			ss[i] = 0.0;
-			ssacrosstrack[i] = 0.0;
-			ssalongtrack[i] = 0.0;
-			}
-
-		/* get bathymetry */
-		*nbath = MBSYS_HSMD_BEAMS;
-
-		/* deal with a ping to port */
-		if (store->Port == -1)
-			{
-			for (i=0;i<MBSYS_HSMD_BEAMS_PING;i++)
-				{
-				j = MBSYS_HSMD_BEAMS_PING - i - 1;
-				if (store->depth[i] > 0.0)
-				    {
-				    beamflag[j] = MB_FLAG_NONE;
-				    bath[j] = store->depth[i];
-				    }
-				else if (store->depth[i] < 0.0)
-				    {
-				    beamflag[j] =
-					MB_FLAG_MANUAL + MB_FLAG_FLAG;
-				    bath[j] = -store->depth[i];
-				    }
-				else
-				    {
-				    beamflag[j] = MB_FLAG_NULL;
-				    bath[j] = store->depth[i];
-				    }
-				bathacrosstrack[j] = store->distance[i];
-	 			bathalongtrack[j] = 0.0;
-     	 			}
-    			}
-
-		/* deal with a ping to starboard */
-		else
-			{
-			for (i=0;i<MBSYS_HSMD_BEAMS_PING;i++)
-				{
-				j = i + MBSYS_HSMD_BEAMS_PING - 1;
-				if (store->depth[i] > 0.0)
-				    {
-				    beamflag[j] = MB_FLAG_NONE;
-				    bath[j] = store->depth[i];
-				    }
-				else if (store->depth[i] < 0.0)
-				    {
-				    beamflag[j] =
-					MB_FLAG_MANUAL + MB_FLAG_FLAG;
-				    bath[j] = -store->depth[i];
-				    }
-				else
-				    {
-				    beamflag[j] = MB_FLAG_NULL;
-				    bath[j] = store->depth[i];
-				    }
-	 			bathacrosstrack[j] =
-	    					store->distance[i];
-	 			bathalongtrack[j] = 0.0;
-      				}
-    			}
-
-		/* Deal with the sidescan */
-		*nss = MBSYS_HSMD_PIXELS;
-
-		/* deal with a ping to port */
-		if (store->Port == -1)
-			{
-			for (i=0;i<MBSYS_HSMD_PIXELS_PING;i++)
-				{
-				j = MBSYS_HSMD_PIXELS_PING - i - 1;
-				ss[j] = store->ss[i];
-				ssacrosstrack[j] =
-					-store->ss_range * i
-					/ ((double)(MBSYS_HSMD_PIXELS_PING - 1));
-	 			ssalongtrack[j] = 0.0;
-      				}
-    			}
-
-		/* deal with a ping to starboard */
-		else
-			{
-			for (i=0;i<MBSYS_HSMD_PIXELS_PING;i++)
-				{
-				j = i + MBSYS_HSMD_PIXELS_PING - 1;
-				ss[j] = store->ss[i];
-				ssacrosstrack[j] =
-					store->ss_range * i
-					/ ((double)(MBSYS_HSMD_PIXELS_PING - 1));
-	 			ssalongtrack[j] = 0.0;
-      				}
-    			}
-
-		/* print debug statements */
-		if (verbose >= 5)
-			{
-			fprintf(stderr,"\ndbg4  Data extracted by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  Extracted values:\n");
-			fprintf(stderr,"dbg4       kind:       %d\n",
-				*kind);
-			fprintf(stderr,"dbg4       error:      %d\n",
-				*error);
-			fprintf(stderr,"dbg4       time_i[0]:  %d\n",
-				time_i[0]);
-			fprintf(stderr,"dbg4       time_i[1]:  %d\n",
-				time_i[1]);
-			fprintf(stderr,"dbg4       time_i[2]:  %d\n",
-				time_i[2]);
-			fprintf(stderr,"dbg4       time_i[3]:  %d\n",
-				time_i[3]);
-			fprintf(stderr,"dbg4       time_i[4]:  %d\n",
-				time_i[4]);
-			fprintf(stderr,"dbg4       time_i[5]:  %d\n",
-				time_i[5]);
-			fprintf(stderr,"dbg4       time_i[6]:  %d\n",
-				time_i[6]);
-			fprintf(stderr,"dbg4       time_d:     %f\n",
-				*time_d);
-			fprintf(stderr,"dbg4       longitude:  %f\n",
-				*navlon);
-			fprintf(stderr,"dbg4       latitude:   %f\n",
-				*navlat);
-			fprintf(stderr,"dbg4       speed:      %f\n",
-				*speed);
-			fprintf(stderr,"dbg4       heading:    %f\n",
-				*heading);
-			fprintf(stderr,"dbg4       nbath:      %d\n",
-				*nbath);
-			for (i=0;i<*nbath;i++)
-			  fprintf(stderr,"dbg4       beam:%d  flag:%3d  bath:%f  acrosstrack:%f  alongtrack:%f\n",
-				i,beamflag[i],bath[i],
-				bathacrosstrack[i],bathalongtrack[i]);
-			fprintf(stderr,"dbg4        namp:      %d\n",
-				*namp);
-			for (i=0;i<*nss;i++)
-			  fprintf(stderr,"dbg4        ss[%d]: %f  ssdist[%d]:%f\n",
-				i,ss[i],i,ssacrosstrack[i]);
-			}
-
-		/* done translating values */
-
-		}
-
-	/* extract comment from structure */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* copy comment */
-		strcpy(comment,store->comment);
-
-		/* print debug statements */
-		if (verbose >= 4)
-			{
-			fprintf(stderr,"\ndbg4  New ping read by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  New ping values:\n");
-			fprintf(stderr,"dbg4       error:      %d\n",
-				*error);
-			fprintf(stderr,"dbg4       comment:    %s\n",
-				comment);
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind == MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"dbg2       comment:     \ndbg2       %s\n",
-			comment);
-		}
-	else if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind != MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"dbg2       time_i[0]:     %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:     %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:     %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:     %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:     %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:     %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:     %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:        %f\n",*time_d);
-		fprintf(stderr,"dbg2       longitude:     %f\n",*navlon);
-		fprintf(stderr,"dbg2       latitude:      %f\n",*navlat);
-		fprintf(stderr,"dbg2       speed:         %f\n",*speed);
-		fprintf(stderr,"dbg2       heading:       %f\n",*heading);
-		}
-	if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind == MB_DATA_DATA)
-		{
-		fprintf(stderr,"dbg2         nbath:         %d\n",*nbath);
-		for (i=0;i<*nbath;i++)
-		  fprintf(stderr,"dbg2       beam:%d  flag:%3d  bath:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,beamflag[i],bath[i],
-			bathacrosstrack[i],bathalongtrack[i]);
-		fprintf(stderr,"dbg2         nss:           %d\n",*nss);
-		for (i=0;i<*nss;i++)
-		  fprintf(stderr,"dbg2       ss[%d]:   %f  ssdist[%d]:   %f\n",
-			i,ss[i],i,ssacrosstrack[i]);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_hsmd_insert(int verbose, void *mbio_ptr, void *store_ptr,
-		int kind, int time_i[7], double time_d,
-		double navlon, double navlat,
-		double speed, double heading,
-		int nbath, int namp, int nss,
-		char *beamflag, double *bath, double *amp,
-		double *bathacrosstrack, double *bathalongtrack,
-		double *ss, double *ssacrosstrack, double *ssalongtrack,
-		char *comment, int *error)
-{
-	char	*function_name = "mbsys_hsmd_insert";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_hsmd_struct *store;
-	int	first;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       kind:       %d\n",kind);
-		}
-	if (verbose >= 2 && (kind == MB_DATA_DATA || kind == MB_DATA_NAV))
-		{
-		fprintf(stderr,"dbg2       time_i[0]:  %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:  %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:  %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:  %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:  %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:  %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:  %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:     %f\n",time_d);
-		fprintf(stderr,"dbg2       navlon:     %f\n",navlon);
-		fprintf(stderr,"dbg2       navlat:     %f\n",navlat);
-		fprintf(stderr,"dbg2       speed:      %f\n",speed);
-		fprintf(stderr,"dbg2       heading:    %f\n",heading);
-		}
-	if (verbose >= 2 && kind == MB_DATA_DATA)
-		{
-		fprintf(stderr,"dbg2       nbath:      %d\n",nbath);
-		if (verbose >= 3)
-		 for (i=0;i<nbath;i++)
-		  fprintf(stderr,"dbg3       beam:%d  flag:%3d  bath:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,beamflag[i],bath[i],
-			bathacrosstrack[i],bathalongtrack[i]);
-		fprintf(stderr,"dbg2       namp:       %d\n",namp);
-		if (verbose >= 3)
-		 for (i=0;i<namp;i++)
-		  fprintf(stderr,"dbg3        amp[%d]: %f\n",
-			i,amp[i]);
-		fprintf(stderr,"dbg2        nss:       %d\n",nss);
-		if (verbose >= 3)
-		 for (i=0;i<nss;i++)
-		  fprintf(stderr,"dbg3        ss[%d]: %f    ssdist[%d]: %f\n",
-			i,ss[i],i,ssacrosstrack[i]);
-		}
-	if (verbose >= 2 && kind == MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"dbg2       comment:     \ndbg2       %s\n",
-			comment);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_hsmd_struct *) store_ptr;
-
-	/* set data kind */
-	store->kind = kind;
-
-	/* insert data in structure */
-	if (store->kind == MB_DATA_DATA)
-    		{
-		/* get time */
-		store->year = time_i[0];
-		store->month = time_i[1];
-		store->day = time_i[2];
-		store->hour = time_i[3];
-		store->minute = time_i[4];
-		store->second = time_i[5];
-
-		/* get navigation */
-		if (navlon < 0.0) navlon = navlon + 360.0;
-		store->lon = navlon;
-		store->lat = navlat;
-
-		/* get heading */
-		store->heading_tx = heading;
-
-		/* figure out if port or starboard ping */
-		first = -1;
-		for (i=0;i<nbath;i++)
-			{
-			if (first == -1 && bath[i] != 0.0)
-				first = i;
-			}
-		if (first >= MBSYS_HSMD_BEAMS_PING - 1)
-			store->Port = 1;
-		else
-			store->Port = -1;
-
-		/* get bathymetry */
-
-		/* deal with a ping to port */
-		if (store->Port == -1)
-			{
-			for (i=0;i<MBSYS_HSMD_BEAMS_PING;i++)
-				{
-				j = MBSYS_HSMD_BEAMS_PING - i - 1;
-				if (mb_beam_check_flag_null(beamflag[j]))
-				    store->depth[i] = 0.0;
-				else if (mb_beam_check_flag(beamflag[j]))
-				    store->depth[i] = -bath[j];
-				else
-				    store->depth[i] = bath[j];
-	 			store->distance[i] =
-	    					bathacrosstrack[j];
-     	 			}
-    			}
-
-		/* deal with a ping to starboard */
-		else
-			{
-			for (i=0;i<MBSYS_HSMD_BEAMS_PING;i++)
-				{
-				j = i + MBSYS_HSMD_BEAMS_PING - 1;
-				if (mb_beam_check_flag_null(beamflag[j]))
-				    store->depth[i] = 0.0;
-				else if (mb_beam_check_flag(beamflag[j]))
-				    store->depth[i] = -bath[j];
-				else
-				    store->depth[i] = bath[j];
-	 			store->distance[i] =
-	    					bathacrosstrack[j];
-      				}
-    			}
-
-		/* Deal with the sidescan */
-
-		/* deal with a ping to port */
-		if (store->Port == -1)
-			{
-			store->ss_range = fabs(ssacrosstrack[0]);
-			for (i=0;i<MBSYS_HSMD_PIXELS_PING;i++)
-				{
-				j = MBSYS_HSMD_PIXELS_PING - i - 1;
-				store->ss[i] = ss[j];
-      				}
-    			}
-
-		/* deal with a ping to starboard */
-		else
-			{
-			store->ss_range =
-				ssacrosstrack[MBSYS_HSMD_PIXELS_PING - 1];
-			for (i=0;i<MBSYS_HSMD_PIXELS_PING;i++)
-				{
-				j = i + MBSYS_HSMD_PIXELS_PING - 1;
-				store->ss[i] = ss[j];
-      				}
-    			}
-		}
-
-	/* insert comment in structure */
-	else if (store->kind == MB_DATA_COMMENT)
-		{
-		strcpy(store->comment,comment);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_hsmd_ttimes(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, int *nbeams,
-	double *ttimes, double *angles,
-	double *angles_forward, double *angles_null,
-	double *heave, double *alongtrack_offset,
-	double *draft, double *ssv, int *error)
-{
-	char	*function_name = "mbsys_hsmd_ttimes";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_hsmd_struct *store;
-	double	scale;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       ttimes:     %p\n",(void *)ttimes);
-		fprintf(stderr,"dbg2       angles_xtrk:%p\n",(void *)angles);
-		fprintf(stderr,"dbg2       angles_ltrk:%p\n",(void *)angles_forward);
-		fprintf(stderr,"dbg2       angles_null:%p\n",(void *)angles_null);
-		fprintf(stderr,"dbg2       heave:      %p\n",(void *)heave);
-		fprintf(stderr,"dbg2       ltrk_off:   %p\n",(void *)alongtrack_offset);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_hsmd_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get nbeams */
-		*nbeams = MBSYS_HSMD_BEAMS;
-
-		/* zero travel times, angles */
-		for (i=0;i<*nbeams;i++)
-			{
-			ttimes[i] = 0.0;
-			angles[i] = 0.0;
-			angles_forward[i] = 0.0;
-			angles_null[i] = 40.0;
-			heave[i] = 0.0;
-			alongtrack_offset[i] = 0.0;
-			}
-
-		/* get travel times, angles */
-		if (store->skals)
-			scale = 0.00015;
-		else
-			scale = 0.000015;
-
-		/* deal with a ping to port */
-		if (store->Port == -1)
-			{
-			for (i=0;i<MBSYS_HSMD_BEAMS_PING;i++)
-				{
-				j = MBSYS_HSMD_BEAMS_PING - i - 1;
-				ttimes[j] = fabs(scale * store->spfb[i]);
-
-				/* angle convention in raw data
-				   is positive to port */
-				if (store->angle[i] < 0.0)
-					{
-					angles[j] = -store->angle[i];
-					angles_forward[j] = 0.0;
-					}
-				else
-					{
-					angles[j] = store->angle[i];
-					angles_forward[j] = 180.0;
-					}
-				heave[j] = store->heave;
-     	 			}
-    			}
-
-		/* deal with a ping to starboard */
-		else
-			{
-			for (i=0;i<MBSYS_HSMD_BEAMS_PING;i++)
-				{
-				j = i + MBSYS_HSMD_BEAMS_PING - 1;
-				ttimes[j] = fabs(scale * store->spfb[i]);
-				angles[j] = store->angle[i];
-				heave[j] = store->heave;
-      				}
-    			}
-
-		/* get sound velocity at transducers */
-		*ssv = store->ckeel;
-		*draft = 0.0;
-
-		/* set status */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error == MB_ERROR_NO_ERROR)
-		{
-		fprintf(stderr,"dbg2       draft:      %f\n",*draft);
-		fprintf(stderr,"dbg2       ssv:        %f\n",*ssv);
-		fprintf(stderr,"dbg2       nbeams:     %d\n",*nbeams);
-		for (i=0;i<*nbeams;i++)
-			fprintf(stderr,"dbg2       beam %d: tt:%f  angle_xtrk:%f  angle_ltrk:%f  angle_null:%f  heave:%f  ltrk_off:%f\n",
-				i,ttimes[i],angles[i],
-				angles_forward[i],angles_null[i],
-				heave[i],alongtrack_offset[i]);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_hsmd_detects(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, int *nbeams,
-	int *detects, int *error)
-{
-	char	*function_name = "mbsys_hsmd_detects";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_hsmd_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       detects:    %p\n",(void *)detects);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_hsmd_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get nbeams */
-		*nbeams = MBSYS_HSMD_BEAMS;
-
-		/* get detects */
-		for (i=0;i<*nbeams;i++)
-			{
-			detects[i] = MB_DETECT_AMPLITUDE;
-			}
-
-		/* set status */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error == MB_ERROR_NO_ERROR)
-		{
-		fprintf(stderr,"dbg2       nbeams:     %d\n",*nbeams);
-		for (i=0;i<*nbeams;i++)
-			fprintf(stderr,"dbg2       beam %d: detects:%d\n",
-				i,detects[i]);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_hsmd_extract_altitude(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, double *transducer_depth, double *altitude,
-	int *error)
-{
-	char	*function_name = "mbsys_hsmd_extract_altitude";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_hsmd_struct *store;
-	double	bath_best;
-	double	xtrack_min;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_hsmd_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		bath_best = 0.0;
-		if (store->depth[0] > 0.0)
-		    bath_best = store->depth[0];
-		else
-		    {
-		    xtrack_min = 99999999.9;
-		    for (i=0;i<MBSYS_HSMD_BEAMS_PING;i++)
-			{
-			if (store->depth[i] > 0.0
-			    && fabs(store->distance[i]) < xtrack_min)
-			    {
-			    xtrack_min = fabs(store->distance[i]);
-			    bath_best = store->depth[i];
-			    }
-			}
-		    }
-		if (bath_best <= 0.0)
-		    {
-		    xtrack_min = 99999999.9;
-		    for (i=0;i<MBSYS_HSMD_BEAMS_PING;i++)
-			{
-			if (store->depth[i] < 0.0
-			    && fabs(store->distance[i]) < xtrack_min)
-			    {
-			    xtrack_min = fabs(store->distance[i]);
-			    bath_best = -store->depth[i];
-			    }
-			}
-		    }
-		*transducer_depth = 0.0;
-		*altitude = bath_best - *transducer_depth;
-
-		/* set status */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:              %d\n",*kind);
-		fprintf(stderr,"dbg2       transducer_depth:  %f\n",*transducer_depth);
-		fprintf(stderr,"dbg2       altitude:          %f\n",*altitude);
-		fprintf(stderr,"dbg2       error:             %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:            %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_hsmd_extract_nav(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int time_i[7], double *time_d,
-		double *navlon, double *navlat,
-		double *speed, double *heading, double *draft,
-		double *roll, double *pitch, double *heave,
-		int *error)
-{
-	char	*function_name = "mbsys_hsmd_extract_nav";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_hsmd_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_hsmd_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA
-		|| *kind == MB_DATA_NAV)
-		{
-		/* get time */
-		time_i[0] = store->year;
-		time_i[1] = store->month;
-		time_i[2] = store->day;
-		time_i[3] = store->hour;
-		time_i[4] = store->minute;
-		time_i[5] = store->second;
-		time_i[6] = store->millisecond;
-		mb_get_time(verbose,time_i,time_d);
-
-		/* get navigation */
-		*navlon = store->lon;
-		*navlat = store->lat;
-
-		/* get heading */
-		*heading = store->heading_tx;
-
-		/* get speed */
-		*speed = store->speed;
-
-		/* get draft */
-		*draft = 0.0;
-
-		/* get roll pitch and heave */
-		*roll = store->roll_tx;
-		*pitch = store->pitch_tx;
-		*heave = store->heave;
-
-		/* print debug statements */
-		if (verbose >= 5)
-			{
-			fprintf(stderr,"\ndbg4  Data extracted by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  Extracted values:\n");
-			fprintf(stderr,"dbg4       kind:       %d\n",
-				*kind);
-			fprintf(stderr,"dbg4       error:      %d\n",
-				*error);
-			fprintf(stderr,"dbg4       time_i[0]:  %d\n",
-				time_i[0]);
-			fprintf(stderr,"dbg4       time_i[1]:  %d\n",
-				time_i[1]);
-			fprintf(stderr,"dbg4       time_i[2]:  %d\n",
-				time_i[2]);
-			fprintf(stderr,"dbg4       time_i[3]:  %d\n",
-				time_i[3]);
-			fprintf(stderr,"dbg4       time_i[4]:  %d\n",
-				time_i[4]);
-			fprintf(stderr,"dbg4       time_i[5]:  %d\n",
-				time_i[5]);
-			fprintf(stderr,"dbg4       time_i[6]:  %d\n",
-				time_i[6]);
-			fprintf(stderr,"dbg4       time_d:     %f\n",
-				*time_d);
-			fprintf(stderr,"dbg4       longitude:  %f\n",
-				*navlon);
-			fprintf(stderr,"dbg4       latitude:   %f\n",
-				*navlat);
-			fprintf(stderr,"dbg4       speed:      %f\n",
-				*speed);
-			fprintf(stderr,"dbg4       heading:    %f\n",
-				*heading);
-			fprintf(stderr,"dbg4       draft:      %f\n",
-				*draft);
-			fprintf(stderr,"dbg4       roll:       %f\n",
-				*roll);
-			fprintf(stderr,"dbg4       pitch:      %f\n",
-				*pitch);
-			fprintf(stderr,"dbg4       heave:      %f\n",
-				*heave);
-			}
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& (*kind == MB_DATA_DATA
-		    || *kind == MB_DATA_NAV))
-		{
-		fprintf(stderr,"dbg2       time_i[0]:     %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:     %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:     %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:     %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:     %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:     %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:     %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:        %f\n",*time_d);
-		fprintf(stderr,"dbg2       longitude:     %f\n",*navlon);
-		fprintf(stderr,"dbg2       latitude:      %f\n",*navlat);
-		fprintf(stderr,"dbg2       speed:         %f\n",*speed);
-		fprintf(stderr,"dbg2       heading:       %f\n",*heading);
-		fprintf(stderr,"dbg2       draft:         %f\n",*draft);
-		fprintf(stderr,"dbg2       roll:          %f\n",*roll);
-		fprintf(stderr,"dbg2       pitch:         %f\n",*pitch);
-		fprintf(stderr,"dbg2       heave:         %f\n",*heave);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_hsmd_insert_nav(int verbose, void *mbio_ptr, void *store_ptr,
-		int time_i[7], double time_d,
-		double navlon, double navlat,
-		double speed, double heading, double draft,
-		double roll, double pitch, double heave,
-		int *error)
-{
-	char	*function_name = "mbsys_hsmd_insert_nav";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_hsmd_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       time_i[0]:  %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:  %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:  %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:  %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:  %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:  %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:  %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:     %f\n",time_d);
-		fprintf(stderr,"dbg2       navlon:     %f\n",navlon);
-		fprintf(stderr,"dbg2       navlat:     %f\n",navlat);
-		fprintf(stderr,"dbg2       speed:      %f\n",speed);
-		fprintf(stderr,"dbg2       heading:    %f\n",heading);
-		fprintf(stderr,"dbg2       draft:      %f\n",draft);
-		fprintf(stderr,"dbg2       roll:       %f\n",roll);
-		fprintf(stderr,"dbg2       pitch:      %f\n",pitch);
-		fprintf(stderr,"dbg2       heave:      %f\n",heave);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_hsmd_struct *) store_ptr;
-
-	/* insert data in structure */
-	if (store->kind == MB_DATA_DATA)
-		{
-		/* get time */
-		store->year = time_i[0];
-		store->month = time_i[1];
-		store->day = time_i[2];
-		store->hour = time_i[3];
-		store->minute = time_i[4];
-		store->second = time_i[5];
-
-		/* get navigation */
-		if (navlon < 0.0) navlon = navlon + 360.0;
-		store->lon = navlon;
-		store->lat = navlat;
-
-		/* get heading */
-		store->heading_tx = heading;
-
-		/* get speed */
-		store->speed = speed;
-
-		/* get draft */
-
-		/* get roll pitch and heave */
-		store->roll_tx = roll;
-		store->pitch_tx = pitch;
-		store->heave = heave;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_hsmd_copy(int verbose, void *mbio_ptr,
-			void *store_ptr, void *copy_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_hsmd_copy";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_hsmd_struct *store;
-	struct mbsys_hsmd_struct *copy;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       copy_ptr:   %p\n",(void *)copy_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointers */
-	store = (struct mbsys_hsmd_struct *) store_ptr;
-	copy = (struct mbsys_hsmd_struct *) copy_ptr;
-
-	/* copy the data */
-	*copy = *store;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mbsys_hsmd.h b/src/mbio/mbsys_hsmd.h
deleted file mode 100644
index 6d490fa..0000000
--- a/src/mbio/mbsys_hsmd.h
+++ /dev/null
@@ -1,274 +0,0 @@
-/* --------------------------------------------------------------------
- *    The MB-system:	mbsys_hsmd.h	8/12/95
- *	$Header: /system/link/server/cvs/root/mbsystem/src/mbio/mbsys_hsmd.h,v 5.5 2005/11/05 00:48:04 caress Exp $
- *
- *    Copyright (c) 1995-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- * --------------------------------------------------------------------
- *
- * mbsys_hsmd.h defines the data structures used by MBIO functions
- * to store data from Hydrosweep MD (Medium Depth) multibeam sonar systems.
- * The data formats which are commonly used to store Hydrosweep MD (Medium
- * Depth data in files include
- *      MBF_HSMBARAW : MBIO ID 101
- *      MBF_HSMBLDIH : MBIO ID 102
- *
- * Based on mbsys_hsds.h
- *
- * Author:	Dale Chayes
- * 		David W. Caress
- * Date:	August 10, 1995
- *
- * $Log: mbsys_hsmd.h,v $
- * Revision 5.5  2005/11/05 00:48:04  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.4  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.3  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.2  2001/07/20 00:32:54  caress
- * Release 5.0.beta03
- *
- * Revision 5.1  2001/01/22  07:43:34  caress
- * Version 5.0.beta01
- *
- * Revision 5.0  2000/12/01  22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.4  2000/09/30  06:31:19  caress
- * Snapshot for Dale.
- *
- * Revision 4.3  1998/10/05  18:32:27  caress
- * MB-System version 4.6beta
- *
- * Revision 4.2  1997/09/15  19:06:40  caress
- * Real Version 4.5
- *
- * Revision 4.2  1997/09/15  19:06:40  caress
- * Real Version 4.5
- *
- * Revision 4.1  1997/04/21  17:02:07  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.0  1995/09/28  18:14:11  caress
- * First cut.
- *
- * Revision 4.0  1995/09/28  18:14:11  caress
- * First cut.
- *
- * Revision 1.1  1995/09/28  18:10:48  caress
- * Initial revision
- *
- * Revision 4.2  95/08/16  07:08:50  07:08:50  dale (Dale Chayes)
- * Works but not quite right.
- *
- * Revision 4.1  95/08/14  20:56:19  20:56:19  dale (Dale Chayes)
- * HSMD is sort of working.... needs work and testing.
- *
- * Revision 4.0  95/08/10  15:58:27  15:58:27  dale (Dale Chayes)
- * first crack, with formatting and "hs" ds" -> "md" conversions but
- * not with substantial functional changes.
- *
- *
- * Notes on the MBSYS_HSMD data structure:
- *   1. The Atlas Hydrosweep MD generates several types of data files
- *      including:
- *           "*.P"    Profile data files that contain bathy data
- *           "*.W"    Wreck data files with info about obstructions
- *           "*.R"    Raw data files. At present, this is the only
- *                    data file format that is supported by MB. These
- *                    files are written in XDR format. Code to assist
- *                    in parsing these files was provided by STN Atlas.
- *
- *   2. The MD systems output 40 beams of bathymetry on one side and
- *      160 beams of amplitude measurements, along with a moras of other
- *      information.  MD systems ping to one side (making 40 beams & 160
- *      amplitude measurements), wait for all the returns and then ping
- *      to the other side. The "Raw.beamside" variable indicates which side
- *      the current ping is pointed. I've elected to call it "Pirt" for now.
- *
- *   3. The records all include navigation and time stamp information.
- *      There is a Header block in front of every data record. The
- *      record types are:
- *        - Raw Event (RAW in the case statement) which contains the
- *          travel time and amplitude data along with other interesting
- *          parameters.
- *        - Navigation (NAV -------"------------) which contains one
- *          input record from the NAV system.
- *        - MD Event
- *        - Beam angle data (ANG) which contains the pointing angles
- *          of the beams. The MD system is supposed to be able to operate
- *          in a beam hopping mode where the beam angles shift from ping
- *          to ping, but this is not yet enabled. The Raw.noho variable
- *          indicated the "hopping" state.
- *        - Sound Velocity (SVP) can contain a sound speed profile.
- *        - Raw Event (REV) which seems to happen at the beginging of
- *          each data file.
- *
- *   4. A single ping usually insonifies one side of the track and results
- *      in RAW data record. Sequential RAW records occur for alternating
- *      sides. NAV records appear to happen at the rate at which they are
- *      supplied by either of the possible Navigation inputs. In early legs
- *      (1994) on the Alliance, two different nav systems were inserting
- *      records, one flagged with an "I" for Integrated Nav and the other
- *      using a "G" to signify GPS. Some time early in 1995, the onboard
- *      nav system was changed and now there appears to be only one type
- *      "I" of input nav data. It appears to happen once per second.
- *
- *   5. The data structure defined below includes all of the values
- *      which are passed in Hydrosweep MD records.
- *
- *   6. Comment records have been implemented for use with MB-System
- *      programs. Comment records are NOT part of the vendor format
- *      definition and are NOT supported by Atlas software. Using
- *      mbcopy with the -N option will remove all comments and make
- *      the data compatible with Atlas software.
- */
-
-
-/* maximum number of depth-velocity pairs */
-#define MBSYS_HSMD_MAXVEL 20	/* As dimensioned in the Atlas code */
-
-/* array sizes */
-#define MBSYS_HSMD_BEAMS	79
-#define MBSYS_HSMD_PIXELS	319
-#define MBSYS_HSMD_BEAMS_PING	40
-#define MBSYS_HSMD_PIXELS_PING	160
-#define MBSYS_HSMD_COMMENT	128	/* length of a comment string */
-
-struct mbsys_hsmd_struct
-	{
-	int	kind;
-
-	/* ------------------------------- Header data */
-	char	scsid[4];		/* Typically "DXT" */
-	char	scsart[4];		/* Typically "REI" or "RMM" */
-	int	scslng;			/* length of subsequent data */
-	int	scsext;			/* seems to be 0 */
-	int	scsblcnt;		/* seems to be ping number */
-	double	scsres1;		/* seems to be 0 */
-	int	transid;		/* ID of the type of data to follow */
-	double	reftime;		/* Internal time of day reference */
-
-					/* data from a "Raw Event" */
-	double	datuhr;			/* Unix epoch time + decimal seconds */
-	char	mksysint[8];		/* Text message eg. "START" */
-	char	mktext[84];		/* Text message eg.  "KAE HMS Start-Marke" */
-
-	/* -------------------------------- Navigation data */
-	int	navid;			/* Which nav input  */
-	int	year;			/* "Date" type */
-	int	month;			/* month */
-	int	day;			/* day of the month */
-	int	hour;			/* hour of the day */
-	int	minute;			/* minute of the hour */
-	int	second;			/* seconds of the minute */
-	double	secf;			/* seconds of the minute */
-	int	millisecond;
-	double	PingTime;		/* floating point time */
-
-	double	lat;			/* Position, decimal degrees */
-	double	lon;			/* North and East are positive */
-	char	pos_sens[2];		/* "G"== GPS,  "I"== Integrated */
-
-	/* ------------------------------- From "Raw" data record */
-	double	ckeel;			/* sound speed at the keel */
-	double	cmean;			/* mean sound speed for water column */
-	int	Port;			/* Port or Starboard ping (beamside)*/
-	int	noho;			/* Indicates beam "hopping" mode */
-	int	skals;			/* scale factor flag (0 -> .1, else .01 */
-	int	spfb[MBSYS_HSMD_BEAMS_PING];		/* unscaled travel times */
-	double	depth[MBSYS_HSMD_BEAMS_PING];		/* cross track depths */
-	double	distance[MBSYS_HSMD_BEAMS_PING];	/* cross track distances */
-	double	ss_range;				/* distance to outermost
-								sidescan
-								sample (meters) */
-	mb_u_char	ss[MBSYS_HSMD_PIXELS_PING];	/* sidescan pixels */
-	double	heading_tx;		/* Heading at transmit */
-	double	heading_rx[5];		/* Heading during the receive window */
-	double	roll_tx;		/* Roll at transmit */
-	double	roll_rx[5];		/* Roll during receive window */
-	double	pitch_tx;		/* Pitch at transmit */
-	double	pitch_rx[5];		/* Pitch during receive window */
-
-	/* ------------------------------- From the Angle data record */
-	double	angle[MBSYS_HSMD_BEAMS_PING];	/* Table of beam angles */
-
-	int	evid;			/* from MD Events */
-	char	evtext[84];
-
-	/* ------------------------------- Theoretical data from Sound Speed record */
-
-	int	num_vel;		/* number of Depth/Sound Speed pairs */
-	double	vdepth[20];		/* array of depths */
-	double	velocity[20];		/* array of sound speeds */
-
-	/* ----------------- derived data --------------------------------  */
-
-	char	comment[MBSYS_HSMD_COMMENT]; /* I guess we will have comments
-						    for MB records some day? */
-	double	heave;
-	double	speed;			/* not provided in HSMD */
-	};
-
-/* system specific function prototypes */
-int mbsys_hsmd_alloc(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error);
-int mbsys_hsmd_deall(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error);
-int mbsys_hsmd_dimensions(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int *nbath, int *namp, int *nss, int *error);
-int mbsys_hsmd_extract(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int time_i[7], double *time_d,
-			double *navlon, double *navlat,
-			double *speed, double *heading,
-			int *nbath, int *namp, int *nss,
-			char *beamflag, double *bath, double *amp,
-			double *bathacrosstrack, double *bathalongtrack,
-			double *ss, double *ssacrosstrack, double *ssalongtrack,
-			char *comment, int *error);
-int mbsys_hsmd_insert(int verbose, void *mbio_ptr, void *store_ptr,
-			int kind, int time_i[7], double time_d,
-			double navlon, double navlat,
-			double speed, double heading,
-			int nbath, int namp, int nss,
-			char *beamflag, double *bath, double *amp,
-			double *bathacrosstrack, double *bathalongtrack,
-			double *ss, double *ssacrosstrack, double *ssalongtrack,
-			char *comment, int *error);
-int mbsys_hsmd_ttimes(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int *nbeams,
-			double *ttimes, double *angles,
-			double *angles_forward, double *angles_null,
-			double *heave, double *alongtrack_offset,
-			double *draft, double *ssv, int *error);
-int mbsys_hsmd_detects(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int *nbeams, int *detects, int *error);
-int mbsys_hsmd_extract_altitude(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, double *transducer_depth, double *altitude,
-			int *error);
-int mbsys_hsmd_extract_nav(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int time_i[7], double *time_d,
-			double *navlon, double *navlat,
-			double *speed, double *heading, double *draft,
-			double *roll, double *pitch, double *heave,
-			int *error);
-int mbsys_hsmd_insert_nav(int verbose, void *mbio_ptr, void *store_ptr,
-			int time_i[7], double time_d,
-			double navlon, double navlat,
-			double speed, double heading, double draft,
-			double roll, double pitch, double heave,
-			int *error);
-int mbsys_hsmd_copy(int verbose, void *mbio_ptr,
-			void *store_ptr, void *copy_ptr,
-			int *error);
diff --git a/src/mbio/mbsys_hysweep.c b/src/mbio/mbsys_hysweep.c
deleted file mode 100644
index 6efe24f..0000000
--- a/src/mbio/mbsys_hysweep.c
+++ /dev/null
@@ -1,2743 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbsys_hysweep.c	3.00	12/23/2011
- *	$Id: mbsys_hysweep.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 2011-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbsys_hysweep.c contains the MBIO functions for handling data logged
- * in the HYSWEEP format using HYSWEEP from HYPACK Inc.
- * The data format associated with this representation is:
- *      MBF_HYSWEEP1 : MBIO ID 201
- *
- * Author:	D. W. Caress
- * Date:	December 23, 2011
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mb_define.h"
-#include "mbsys_hysweep.h"
-
-/* turn on debug statements here */
-/* #define MSYS_HYSWEEP_DEBUG 1 */
-
-static char rcs_id[]="$Id: mbsys_hysweep.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mbsys_hysweep_alloc(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_hysweep_alloc";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_hysweep_struct *store;
-	struct mbsys_hysweep_device_struct *device;
-	struct mbsys_hysweep_device_offset_struct *offset;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* allocate memory for data structure */
-	status = mb_mallocd(verbose, __FILE__, __LINE__, sizeof(struct mbsys_hysweep_struct),
-				(void **)store_ptr, error);
-
-	/* get data structure pointer */
-	store = (struct mbsys_hysweep_struct *) *store_ptr;
-
-	/* initialize everything */
-
-	/* Type of data record */
-	store->kind = MB_DATA_NONE;
-	store->type = MBSYS_HYSWEEP_RECORDTYPE_NONE;
-
-	/* HYSWEEP file header */
-	for (i=0;i<MB_NAME_LENGTH;i++)
-		store->FTP_record[i] = '\0';	/* FTP NEW 2: HYSWEEP file type */
-	store->HSX_record = 0;			/* HSX: HYSWEEP format version number */
-	for (i=0;i<MB_NAME_LENGTH;i++)
-		store->VER_version[i] = '\0';	/* VER: HYSWEEP distribution version */
-	for (i=0;i<7;i++)
-		store->TND_survey_time_i[i] = 0;/* TND: Survey time and date (system startup)
-							hh:mm:ss mm/dd/yy */
-	store->TND_survey_time_d = 0.0;
-	for (i=0;i<MB_NAME_LENGTH;i++)
-		store->INF_surveyor[i] = '\0';	/* INF: surveyor name */
-	for (i=0;i<MB_NAME_LENGTH;i++)
-		store->INF_boat[i] = '\0';	/* INF: boat name */
-	for (i=0;i<MB_NAME_LENGTH;i++)
-		store->INF_project[i] = '\0';	/* INF: project name */
-	for (i=0;i<MB_NAME_LENGTH;i++)
-		store->INF_area[i] = '\0';	/* INF: area name */
-	store->INF_tide_correction = 0.0;	/* INF: initial tide correction */
-	store->INF_draft_correction = 0.0;	/* INF: initial draft correction */
-	store->INF_sound_velocity = 0.0;	/* INF: initial sound velocity */
-	store->HSP_minimum_depth = 0.0;	/* HSP: minimum depth in work units */
-	store->HSP_maximum_depth = 0.0;	/* HSP: maximum depth in work units */
-	store->HSP_port_offset_limit = 0.0;	/* HSP: port side offset limit in work units */
-	store->HSP_stbd_offset_limit = 0.0;	/* HSP: starboard side offset limit in work units */
-	store->HSP_port_angle_limit = 0.0;	/* HSP: port side angle limit in degrees */
-	store->HSP_stbd_angle_limit = 0.0;	/* HSP: starboard side angle limit in degrees */
-	store->HSP_high_beam_quality = 0;	/* HSP: high beam quality; codes >= this are good */
-	store->HSP_low_beam_quality = 0;	/* HSP: low beam quality; codes < this are bad */
-	store->HSP_sonar_range = 0.0;	/* HSP: sonar range setting in work units */
-	store->HSP_towfish_layback = 0.0;	/* HSP: towfish layback in work units */
-	store->HSP_units = 0;		/* HSP: work units:
-						0: = meters
-						1 = US foot
-						2 = international foot */
-	store->HSP_sonar_id = 0;		/* HSP: sonar id for advanced processing (see defines above) */
-	for (i=0;i<MB_NAME_LENGTH;i++)
-		store->PRJ_proj4_command[i] = '\0';	/* PRJ: projection in use defined as either
-								a PROJ4 command string or as an
-								EPSG identifier */
-
-	/* HYSWEEP devices */
-	store->num_devices = 0;		/* number of devices defined */
-	for (i=0;i<MBSYS_HYSWEEP_DEVICE_NUM_MAX;i++)
-		{
-		device = (struct mbsys_hysweep_device_struct *) &(store->devices[i]);
-
-		/* DEV: first line of device declaration
-			DEV dn dc "name"
-			DEV 0 544 "IXSEA OCTANS Serial" */
-		device->DEV_device_number = 0;
-		device->DEV_device_capability = 0;	/* Hypack device capabilities (bit code)
-							1 - device provides range/range position
-							2 - device provides range/azimuth position
-							4 - device provides lat/long (e.g. GPS)
-							8 - device provides grid positions XY
-							16 - device provides echo soundings
-							32 - device provides heading
-							64 - device provides ship speed
-							128 - Hypack clock is synched to device clock
-							256 - device provides tide
-							512 - device provides heave, pitch, and roll
-							1024 - device is a ROV
-							2048 - device is a left/right indicator
-							4096 - device accepts annotations strings
-							8192 - device accepts output from Hypack
-							16384 - xxx
-							32768 - device has extended capability */
-		for (j=0;j<MB_PATH_MAXLINE;j++)
-			device->DEV_device_name[j] = '\0';		/* e.g. "GPS" */
-
-		/* DV2: second line of device declaration
-			DV2 dn dc tf en
-			DV2 0 220 0 1 */
-		device->DV2_device_capability = 0;	/* Hysweep device capabilities (bit coded hexadecimal)
-							0001 - multibeam sonar
-							0002 - multiple transducer sonar
-							0004 - GPS (boat position)
-							0008 - sidescan sonar
-							0010 - single beam echosounder
-							0020 - gyro (boat heading)
-							0040 - tide
-							0200 - MRU (heave, pitch, and roll compensation) */
-		device->DV2_towfish = 0;		/* 1 if device is mountedc on a tow fish */
-		device->DV2_enabled = 0;		/* 1 if device is enabled */
-
-		/* OF2: Hysweep device offsets  */
-		device->num_offsets = 0;		/* number of offsets identified for this device */
-		for (j=0;j<MBSYS_HYSWEEP_OFFSET_NUM_MAX;j++)
-			{
-			offset = (struct mbsys_hysweep_device_offset_struct *) &(device->offsets[j]);
-
-			/* OF2: Hysweep device offsets
-				OF2 dn on n1 n2 n3 n4 n5 n6 n7 */
-			offset->OF2_device_number = 0;	/* device number */
-			offset->OF2_offset_type = 0;	/* offset type
-								0 - position antenna offsets
-								1 - gyro heading offset
-								2 - MRU device offsets
-								3 - sonar head 1 / transducer 1 offsets
-								4 - sonar head 2 / transducer 2 offsets
-								........
-								131 - transducer 128 offsets */
-			offset->OF2_offset_starboard = 0.0;	/* starboard/port mounting offset, positive to starboard */
-			offset->OF2_offset_forward = 0.0;	/* forward/aft mounting offset, positive to forward */
-			offset->OF2_offset_vertical = 0.0;	/* vertical mounting offset, positive downward from waterline */
-			offset->OF2_offset_yaw = 0.0;		/* yaw rotation angle, positive for clockwise rotation */
-			offset->OF2_offset_roll = 0.0;	/* roll rotation angle, port side up is positive */
-			offset->OF2_offset_pitch = 0.0;	/* pitch rotation angle, bow up is positive */
-			offset->OF2_offset_time = 0.0;	/* time latency in seconds */
-			}
-
-		/* PRI: device set as primary navigational device */
-		device->PRI_primary_nav_device = 0;	/* 1 if device is primary navigational device */
-
-		/* MBI: multibeam / multiple transducer device information
-			MBI dn st sf db n1 n2 fa ai */
-		device->MBI_sonar_id = 0;	/* sonar id from table, not part of MBI record
-							but instead inferred from device name in the
-							corresponding DEV record */
-		device->MBI_sonar_receive_shape = 0;	/* sonar receive head shape, not part of MBI record
-								but instead inferred from device name in the
-								corresponding DEV record
-									0 - flat
-									1 - circular */
-		device->MBI_sonar_type = 0;	/* sonar type code:
-							0 - invalid
-							1 - fixed beam roll angles (e.g. Reson Seabat )
-							2 - variable beam roll angles (e.g. Seabeam SB1185)
-							3 - beam info in spherical coordinates (e.g. Simrad EM3000)
-							4 - multiple transducer (e.g. Odom Miniscan) */
-		device->MBI_sonar_flags = 0;	/* sonar flags (bit coded hexadecimal)
-							0x0001 - roll corrected by sonar
-							0x0002 - pitch corrected by sonar
-							0x0004 - dual head
-							0x0008 - heading corrected by sonar (ver 1)
-							0x0010 - medium depth: slant ranges recorded to 1 dm
-									resolution (version 2)
-							0x0020 - deep water: slant ranges divided by 1 m
-									resolution (ver 2)
-							0x0040 - SVP corrected by sonar (ver 5)
-							0x0080 - topographic device, upgoing beams accepted (ver 6) */
-		device->MBI_beam_data_available = 0;/* beam data (bit coded hexadecimal)
-							0x0001 - beam ranges are available (survey units)
-							0x0002 - sounding point casting available (survey units)
-							0x0004 - point northing available (survey units)
-							0x0008 - point corrected depth available (survey units)
-							0x0010 - along track distance available (survey units)
-							0x0020 - across track distance available (survey units)
-							0x0040 - beam pitch angles available (degrees, TSS convention)
-							0x0080 - beam roll angles available (degrees, TSS convention)
-							0x0100 - beam takeoff angles available (degrees from vertical)
-							0x0200 - beam direction angles available (degrees from forward)
-							0x0400 - ping delay times included (milliseconds)
-							0x0800 - beam intensity data available
-							0x1000 - beam quality codes (from sonar unit) available
-							0x2000 - sounding flags included
-							0x4000 - spare
-							0x8000 - spare */
-		device->MBI_num_beams_1 = 0;	/* number of beams, head 1 (multibeam) or number of transducers
-							(multitransducer) */
-		device->MBI_num_beams_2 = 0;	/* number of beams, head 2 (multibeam) */
-		device->MBI_first_beam_angle = 0.0;	/* first beam angle is for sonar type = fixed angle
-							(degrees, TSS convention) */
-		device->MBI_angle_increment = 0.0;	/* angle increment is for sonare type = fixed angle
-							(degrees, TSS convention) */
-
-		/* SSI: sidescan device information
-			SSI dn sf np ns */
-		device->SSI_sonar_flags = 0;	/* sonar flags (bit coded hexadecimal)
-							0x0100 - amplitude is bit-shifted into byte storage */
-		device->SSI_port_num_samples = 0;	/* number of samples per ping, port transducer */
-		device->SSI_starboard_num_samples = 0;	/* number of samples per ping, starboard transducer */
-		}
-	store->primary_nav_device = 0;	/* device number of primary navigational device */
-
-	/* HYSWEEP HVF - Hysweep view filters - always first record after end of file header
-		HVF dn tt p1 p2 p3 p4 p5 p6
-			dn: dummy device number, always = 99
-			tt: time tag this filter set became active (in seconds past midnight)
-			p1: minimum depth in work units
-			p2: maximum depth in work units
-			p3: port side offset limit in work units
-			p4: starboard side offset limit in work units
-			p5: minimum beam angle limit, 0 to -90 degrees
-			p6: maximum beam angle limit, 0 to 90 degrees
-		Example:
-		HVF 99 80491.965 0.0 95.0 35.6 35.6 -75.0 75.0 */
-	store->HVF_time_after_midnight = 0.0;	/* time this filter set became active
-							seconds after midnight */
-	store->HVF_minimum_depth = 0.0;	/* minimum depth in work units */
-	store->HVF_maximum_depth = 0.0;	/* maximum depth in work units */
-	store->HVF_port_offset_limit = 0.0;	/* port side offset limit in work units */
-	store->HVF_starboard_offset_limit = 0.0;	/* starboard side offset limit in work units */
-	store->HVF_minimum_angle_limit = 0.0;	/* minimum beam angle limit, 0 to -90 degrees */
-	store->HVF_maximum_angle_limit = 0.0;	/* maximum beam angle limit, 0 to 90 degrees */
-
-	/* HYSWEEP FIX - fix (event) mark - always second record after end of file header
-		FIX dn tt en  */
-	store->FIX_device_number = 0;	/* device number */
-	store->FIX_time_after_midnight = 0.0;	/* time in seconds after midnight */
-	store->FIX_event_number = 0;		/* FIX event number */
-
-	/* HYSWEEP RMB - raw multibeam data
-		RMB dn t st sf bd n sv pn psa
-			dn: device number�
-			t: time tag (seconds past midnight)�
-			st: sonar type code (see MBI above)�
-			sf: sonar flags (see MBI above)�
-			bd: available beam data (see MBI above)�
-			n: number of beams to follow�
-			sv: sound�velocity in m/sec�
-			pn: ping number (or 0 if not tracked)
-
-		Immediately following the RMB record is a record containing slant ranges (multibeam)�
-		or raw depths (multiple transducer). Following the ranges are 0 to n additional records�
-		depending on the bd (beam�data) field.
-
-		Example (Seabat 9001 storing slant ranges and quality codes):�
-			RMB 1 27244.135 1 0 1001 1500.00 0 60�
-			19.50 19.31 18.60 1.66 18.47 ... (60 slant ranges in work units)�
-			3 3 3 0 3 ... (60 quality codes)
-
-		Example (multiple transducer storing 8 raw depths):�
-			RMB 1 27244.135 4 0 1 1500.00 0 60�
-			31.44 33.01 32.83 32.80 ... (8 raw depths in work units)
-
-		Example (Dual-head Seabeam SB1185 storing range, beam pitch and roll angles,�
-			ping delay times, beam quality code and sounding flags):�
-			RMB 1 27244.135 2 5 1481 1500.00 0�
-			108 93.18 88.30 84.74 80.46 ...�(108 slant ranges in working units)
-			-69.72 -68.53 -67.36 -66.15 ... (108 beam roll angles in degrees)�
-			0 0 0 67 ... (108 ping delay times in msecs)�
-			7 7 7 7 ... (108 beam quality codes) */
-	store->RMB_device_number = 0;	/* device number */
-	store->RMB_time = 0.0;		/* time tag (seconds past midnight) */
-	store->RMB_sonar_type = 0;		/* sonar type code:
-						0 - invalid
-						1 - fixed beam roll angles (e.g. Reson Seabat )
-						2 - variable beam roll angles (e.g. Seabeam SB1185)
-						3 - beam info in spherical coordinates (e.g. Simrad EM3000)
-						4 - multiple transducer (e.g. Odom Miniscan) */
-	store->RMB_sonar_flags = 0;	/* sonar flags (bit coded hexadecimal)
-						0x0001 - roll corrected by sonar
-						0x0002 - pitch corrected by sonar
-						0x0004 - dual head
-						0x0008 - heading corrected by sonar (ver 1)
-						0x0010 - medium depth: slant ranges recorded to 1 dm
-								resolution (version 2)
-						0x0020 - deep water: slant ranges divided by 1 m
-								resolution (ver 2)
-						0x0040 - SVP corrected by sonar (ver 5)
-						0x0080 - topographic device, upgoing beams accepted (ver 6) */
-	store->RMB_beam_data_available = 0;/* beam data (bit coded hexadecimal)
-						0x0001 - beam ranges are available (survey units)
-						0x0002 - sounding point casting available (survey units)
-						0x0004 - point northing available (survey units)
-						0x0008 - point corrected depth available (survey units)
-						0x0010 - along track distance available (survey units)
-						0x0020 - across track distance available (survey units)
-						0x0040 - beam pitch angles available (degrees, TSS convention)
-						0x0080 - beam roll angles available (degrees, TSS convention)
-						0x0100 - beam takeoff angles available (degrees from vertical)
-						0x0200 - beam direction angles available (degrees from forward)
-						0x0400 - ping delay times included (milliseconds)
-						0x0800 - beam intensity data available
-						0x1000 - beam quality codes (from sonar unit) available
-						0x2000 - sounding flags included
-						0x4000 - spare
-						0x8000 - spare */
-	store->RMB_num_beams = 0;		/* number of beams to follow */
-	store->RMB_num_beams_alloc = 0;		/* number of beams allocated to non-null arrays */
-	store->RMB_sound_velocity = 0.0;	/* sound velocity in m/sec */
-	store->RMB_ping_number = 0;	/* ping number (or 0 if not tracked) */
-	store->RMB_beam_ranges = NULL;	/* beam ranges (survey units) */
-	store->RMB_multi_ranges = NULL;	/* sounding point casting (survey units) (multi-transducer rangers) */
-	store->RMB_sounding_eastings = NULL;	/* easting positions of soundings */
-	store->RMB_sounding_northings = NULL;/* northing positions of soundings */
-	store->RMB_sounding_depths = NULL;	/* corrected depths of soundings */
-	store->RMB_sounding_across = NULL;	/* acrosstrack positions of soundings */
-	store->RMB_sounding_along = NULL;	/* alongtrack positions of soundings */
-	store->RMB_sounding_pitchangles = NULL;	/* beam pitch angles of soundings (degrees, TSS convention) */
-	store->RMB_sounding_rollangles = NULL;	/* beam roll angles of soundings (degrees, TSS convention) */
-	store->RMB_sounding_takeoffangles = NULL;	/* beam takeoff angles of soundings (degrees from vertical) */
-	store->RMB_sounding_azimuthalangles = NULL;	/* beam azimuthal angles of soundings (degrees from forward) */
-	store->RMB_sounding_timedelays = NULL;	/* beam delay times (milliseconds) */
-	store->RMB_sounding_intensities = NULL;	/* beam intensities */
-	store->RMB_sounding_quality = NULL;		/* beam quality codes (from sonar unit) */
-	store->RMB_sounding_flags = NULL;		/* beam edit flags */
-
-	/* RSS - Raw Sidescan
-		RSS dn t sf np ns sv pn alt sr amin amax bs freq
-			dn: device number
-			t: time tag (seconds past midnight)
-			sf: sonar flags (bit coded hexadecimal)
-				0100 - amplitude is bit-shifted into byte storage
-			np: number of samples, port transducer (down-sampled to 4096 max)
-			ns: number of samples, starboard transducer (down-sampled to 4096 max)
-			sv: sound velocity in m/sec
-			pn: ping number (or 0 if not tracked)
-			alt: altitude in work units
-			sr: sample rate (samples per second after down-sample)
-			amin: amplitude minimum
-			amax: amplitude maximum
-			bs: bit shift for byte recording
-			freq: frequency 0 or 1 for simultaneous dual frequency operation
-
-		Immediately following the RSS record are two records containing port and
-		starboard amplitude samples.
-
-		Example:
-		RSS 3 61323.082 100 341 341 1460.00 0 10.75 4983.47 0 4096 4 0
-		109 97 84 95 120 111 ... (341 port samples)
-		106 93 163 106 114 127 ... (341 starboard samples) */
-	store->RSS_device_number = 0;	/* device number */
-	store->RSS_time = 0.0;		/* time tag (seconds past midnight) */
-	store->RSS_sonar_flags = 0;	/* sonar flags:
-						0100 - amplitude is bit-shifted into byte storage */
-	store->RSS_port_num_samples = 0; 	/* number of samples, port transducer (down-sampled to 4096 max) */
-	store->RSS_starboard_num_samples = 0; 	/* number of samples, starboard transducer
-						(down-sampled to 4096 max) */
-	store->RSS_port_num_samples_alloc = 0;
-	store->RSS_starboard_num_samples_alloc = 0;
-	store->RSS_sound_velocity = 0.0;	/* sound velocity in m/sec  */
-	store->RSS_ping_number = 0.0;	/* ping number (or 0 if not tracked) */
-	store->RSS_altitude = 0.0;		/* altitude in work units  */
-	store->RSS_sample_rate = 0.0;	/* sample rate (samples per second after down-sample)  */
-	store->RSS_minimum_amplitude = 0;	/* amplitude minimum  */
-	store->RSS_maximum_amplitude = 0;	/* amplitude maximum  */
-	store->RSS_bit_shift = 0;		/* bit shift for byte recording  */
-	store->RSS_frequency = 0;		/* frequency 0 or 1 for simultaneous dual frequency operation */
-	store->RSS_port = NULL;		/* port sidescan amplitude samples */
-	store->RSS_starboard = NULL;		/* starboard sidescan amplitude samples */
-
-        /* MSS - MB-System Sidescan
-                MSS dn t pn n ps
-			dn: device number
-			t: time tag (seconds past midnight)
-			pn: ping number (or 0 if not tracked)
-			n: number of pixels
-			ps: pixel size in meters
-
-		Immediately following the MSS record is one record containing
-		the amplitude samples. Zero samples are null values
-		indicating no data.
-
-		Example:
-		MSS 3 61323.082 1500.00 1024 0.340 27535
-		0.00 0.00 109.25 97.13 .... 95.34 120.76 111.26 0.00 (1024 samples) */
-	store->MSS_device_number = 0;	/* device number */
-	store->MSS_time = 0.0;		/* time tag (seconds past midnight) */
-	store->MSS_sound_velocity = 0.0;	/* sound velocity in m/sec  */
-	store->MSS_num_pixels = 0;	        /* number of pixels (typically 1024) */
-	store->MSS_pixel_size = 0.0;	        /* pixel size (meters) */
-	store->MSS_ping_number = 0;	/* ping number (or 0 if not tracked) */
-	for (i=0;i<MBSYS_HYSWEEP_MSS_NUM_PIXELS;i++)
-		{
-		store->MSS_ss[i] = 0.0;
-		store->MSS_ss_across[i] = 0.0;
-		store->MSS_ss_along[i] = 0.0;
-		}
-        store->MSS_table_num_alloc = 0;          /* sidescan working array allocated dimensions */
-        store->MSS_table_altitude_sort = NULL;   /* sidescan working array - altitude = depth - draft + heave */
-        store->MSS_table_range = NULL;           /* sidescan working array - range */
-        store->MSS_table_acrosstrack = NULL;     /* sidescan working array - acrosstrack */
-        store->MSS_table_alongtrack = NULL;      /* sidescan working array - alongtrack */
-
-	/* SNR - dynamic sonar settings
-		up to 12 fields depending on sonar type
-		SNR dn t pn sonar ns s0 --- s11
-			dn: device number�
-			t: time tag (seconds past midnight)�
-			pn: ping number (or 0 if not tracked)
-			sonar: sonar ID code (see defines above)�
-			ns: number of settings to follow
-			s: up to 12 settings
-
-		Up to 12 fields are included in SNR records, providing sonar runtime settings.
-		Not available for all systems. Defined differently depending on sonar model
-		and manufacturer.
-
-		For Seabat 81XX Serial and 81XX Network Drivers:
-			Sonar id: 1, 23, 24, 25, 39
-			P0: Sonar range setting in meters.
-			P1: power setting, 0 - 8
-			P2: gain setting, 1 � 45
-			P3: gain modes: bit 0 = TVG on/off, bit 1 = auto gain on/off.
-
-		For Seabat 7K drivers (7125, 7101, 7150, 7111)
-			Sonar id: 22, 53, 60, 62
-			P0: Sonar range selection in meters.
-			P1: Transmit power selection in dBs relative to 1 uPa.
-			P2: Receiver gain selection in 0.1 dBs.
-			P3: Transmitter frequency in KHz.
-			P4: Transmit pulse width in microseconds.
-
-		For EdgeTech 4200 Driver
-			Sonar id: 7-10
-			P0: Pulse power setting, 0 to 100 percent.
-			P1: ADC Gain factor.
-			P2: Start Frequency in 10 * Hz.
-			P3: End Frequency in 10 * Hz.
-			P4: Sweep length in milliseconds. */
-	store->SNR_device_number = 0;	/* device number */
-	store->SNR_time = 0.0;		/* time tag (seconds past midnight) */
-	store->SNR_ping_number = 0.0;	/* ping number (or 0 if not tracked) */
-	store->SNR_sonar_id = 0.0;		/* sonar ID (see defines above) */
-	store->SNR_num_settings = 0.0;	/* number of settings to follow */
-	for (i=0;i<12;i++)
-		store->SNR_settings[i] = 0;	/* sonar settings */
-
-	/* PSA - pitch stabilization angle
-		PSA dn t pn a0 a1
-			dn: device number�
-			t: time tag (seconds past midnight)�
-			pn: ping number (or 0 if not tracked)
-			a0: projector (head 0) pitch angle
-			a1: projector (head 1) pitch angle
-
-		Note: PSA records are recorded only when pitch stabilization
-		is active. They immediately proceed corresponding RMB records. */
-	store->PSA_device_number = 0;	/* device number */
-	store->PSA_time = 0.0;		/* time tag (seconds past midnight) */
-	store->PSA_ping_number = 0.0;	/* ping number (or 0 if not tracked) */
-	store->PSA_a0 = 0.0;			/* projector (head 0) pitch angle */
-	store->PSA_a1 = 0.0;			/* projector (head 1) pitch angle */
-
-	/* HCP - heave compensation
-		HCP dn t h r p
-			dn: device number
-			t: time tag (seconds past midnight)
-			h: heave in meters
-			r: roll in degrees (+ port side up)
-			p: pitch in degrees (+ bow up)
-		Example:
-		HCP 0 80492.021 -0.65 -0.51 -1.73 */
-	store->HCP_device_number = 0;	/* device number */
-	store->HCP_time = 0.0;		/* time tag (seconds past midnight) */
-	store->HCP_heave = 0.0;		/* heave (meters) */
-	store->HCP_roll = 0.0;		/* roll (+ port side up) */
-	store->HCP_pitch = 0.0;		/* pitch (+ bow up) */
-
-	/* EC1 - echo sounding (single frequency)
-		EC1 dn t rd
-			dn: device number
-			t: time tag (seconds past midnight)
-			rd: raw depth
-		Example:
-		EC1 1 80491.897 99.02 */
-	store->EC1_device_number = 0;	/* device number */
-	store->EC1_time = 0.0;		/* time tag (seconds past midnight) */
-	store->EC1_rawdepth = 0.0;		/* raw depth */
-
-	/* GPS - GPS measurements
-		GPS dn t cog sog hdeop mode nsats
-			dn: device number
-			t: time tag (seconds past midnight)
-			cog: course over ground (degrees)
-			sog: speed over ground (knots)
-			hdop: GPS hdop
-			mode: GPS mode
-				0 - unknown
-				1 - stand alone
-				2 - differential
-				3 - rtk
-			nsats: number of satellites
-		Example:
-		GPS 1 80491.897 178.16 0.23 1.2 2 8 */
-	store->GPS_device_number = 0;	/* device number */
-	store->GPS_time = 0.0;		/* time tag (seconds past midnight) */
-	store->GPS_cog = 0.0;		/* course over ground (degrees) */
-	store->GPS_sog = 0.0;		/* speed over ground (knots) */
-	store->GPS_hdop = 0.0;		/* GPS hdop */
-	store->GPS_mode = 0;		/* GPS mode
-						0 - unknown
-						1 - stand alone
-						2 - differential
-						3 - rtk */
-	store->GPS_nsats = 0;		/* number of satellites */
-
-	/* GYR - gyro data (heading)
-		GYR dn t h
-			dn: device number
-			t: time tag (seconds past midnight)
-			h: heading (degrees)
-		Example:
-		GYR 1 80491.897 178.16 */
-	store->GYR_device_number = 0;	/* device number */
-	store->GYR_time = 0.0;		/* time tag (seconds past midnight) */
-	store->GYR_heading = 0.0;		/* heading (degrees) */
-
-	/* POS - position
-		POS dn t x y
-			dn: device number
-			t: time tag (seconds past midnight)
-			x: easting
-			y: northing
-		Example:
-		POS 1 80491.897 308214.82 1414714.97 */
-	store->POS_device_number = 0;	/* device number */
-	store->POS_time = 0.0;		/* time tag (seconds past midnight) */
-	store->POS_x = 0.0;			/* easting */
-	store->POS_y = 0.0;			/* northing */
-
-	/* DFT - dynamic draft (squat) correction
-		DFT dn t dc
-			dn: device number
-			t: time tag (seconds past midnight)
-			dc: draft correction
-		Example:
-		DFT 1 80491.897 1453.44 */
-	store->DFT_device_number = 0;	/* device number */
-	store->DFT_time = 0.0;		/* time tag (seconds past midnight) */
-	store->DFT_draft = 0.0;		/* draft correction */
-
-	/* TID - tide correction
-		TID dn t tc
-			dn: device number
-			t: time tag (seconds past midnight)
-			tc: tide correction
-		Example:
-		TID 1 80491.897 0.00 */
-	store->TID_device_number = 0;	/* device number */
-	store->TID_time = 0.0;		/* time tag (seconds past midnight) */
-	store->TID_tide = 0.0;		/* tide correction */
-
-	/* COM - comment record - MB-System extension
-		COM c
-			c: comment string
-		Example:
-		COM everything after the first four characters is part of the comment */
-	for (i=0;i<MB_COMMENT_MAXLINE;i++)
-		store->COM_comment[i] = '\0';		/* comment string */
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)*store_ptr);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_hysweep_deall(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_hysweep_deall";
-	int	status = MB_SUCCESS;
-	struct mbsys_hysweep_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)*store_ptr);
-		}
-
-	/* get data structure pointer */
-	store = (struct mbsys_hysweep_struct *) *store_ptr;
-
-	/* deallocate arrays */
-	if (store->RMB_beam_ranges != NULL)
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)(&store->RMB_beam_ranges), error);	/* beam ranges (survey units) */
-	if (store->RMB_multi_ranges != NULL)
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)(&store->RMB_multi_ranges), error);	/* sounding point casting (survey units) (multi-transducer rangers) */
-	if (store->RMB_sounding_eastings != NULL)
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)(&store->RMB_sounding_eastings), error);	/* easting positions of soundings */
-	if (store->RMB_sounding_northings != NULL)
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)(&store->RMB_sounding_northings), error);/* northing positions of soundings */
-	if (store->RMB_sounding_depths != NULL)
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)(&store->RMB_sounding_depths), error);	/* corrected depths of soundings */
-	if (store->RMB_sounding_across != NULL)
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)(&store->RMB_sounding_across), error);	/* acrosstrack positions of soundings */
-	if (store->RMB_sounding_along != NULL)
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)(&store->RMB_sounding_along), error);	/* alongtrack positions of soundings */
-	if (store->RMB_sounding_pitchangles != NULL)
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)(&store->RMB_sounding_pitchangles), error);	/* beam pitch angles of soundings (degrees, TSS convention) */
-	if (store->RMB_sounding_rollangles != NULL)
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)(&store->RMB_sounding_rollangles), error);	/* beam roll angles of soundings (degrees, TSS convention) */
-	if (store->RMB_sounding_takeoffangles != NULL)
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)(&store->RMB_sounding_takeoffangles), error);	/* beam takeoff angles of soundings (degrees from vertical) */
-	if (store->RMB_sounding_azimuthalangles != NULL)
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)(&store->RMB_sounding_azimuthalangles), error);	/* beam azimuthal angles of soundings (degrees from forward) */
-	if (store->RMB_sounding_timedelays != NULL)
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)(&store->RMB_sounding_timedelays), error);	/* beam delay times (milliseconds) */
-	if (store->RMB_sounding_intensities != NULL)
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)(&store->RMB_sounding_intensities), error);	/* beam intensities */
-	if (store->RMB_sounding_quality != NULL)
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)(&store->RMB_sounding_quality), error);		/* beam quality codes (from sonar unit) */
-	if (store->RMB_sounding_flags != NULL)
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)(&store->RMB_sounding_flags), error);		/* beam edit flags */
-	if (store->RSS_port != NULL)
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)(&store->RSS_port), error);		/* port sidescan amplitude samples */
-	if (store->RSS_starboard != NULL)
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)(&store->RSS_starboard), error);		/* starboard sidescan amplitude samples */
-        if (store->MSS_table_altitude_sort != NULL)
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)(&store->MSS_table_altitude_sort), error);   /* sidescan working array - altitude = depth - draft + heave */
-        if (store->MSS_table_range != NULL)
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)(&store->MSS_table_range), error);           /* sidescan working array - range */
-        if (store->MSS_table_acrosstrack != NULL)
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)(&store->MSS_table_acrosstrack), error);     /* sidescan working array - acrosstrack */
-        if (store->MSS_table_alongtrack != NULL)
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)(&store->MSS_table_alongtrack), error);      /* sidescan working array - alongtrack */
-
-	/* deallocate memory for data structure */
-	status = mb_freed(verbose,__FILE__,__LINE__,(void **)store_ptr,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbsys_hysweep_dimensions(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int *nbath, int *namp, int *nss, int *error)
-{
-	char	*function_name = "mbsys_hysweep_dimensions";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_hysweep_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_hysweep_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get beam and pixel numbers */
-		*nbath = store->RMB_num_beams;
-		if (store->RMB_beam_data_available | 0x0800)
-			*namp = store->RMB_num_beams;
-		else
-			*namp = 0;
-		*nss = 0;
-		}
-	else
-		{
-		/* get beam and pixel numbers */
-		*nbath = 0;
-		*namp = 0;
-		*nss = 0;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		fprintf(stderr,"dbg2       nbath:      %d\n",*nbath);
-		fprintf(stderr,"dbg2        namp:      %d\n",*namp);
-		fprintf(stderr,"dbg2        nss:       %d\n",*nss);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_hysweep_pingnumber(int verbose, void *mbio_ptr,
-		int *pingnumber, int *error)
-{
-	char	*function_name = "mbsys_hysweep_pingnumber";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_hysweep_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_hysweep_struct *) mb_io_ptr->store_data;
-
-	/* extract data from structure */
-	*pingnumber = store->RMB_ping_number;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       pingnumber: %d\n",*pingnumber);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_hysweep_sonartype(int verbose, void *mbio_ptr, void *store_ptr,
-		int *sonartype, int *error)
-{
-	char	*function_name = "mbsys_hysweep_sonartype";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_hysweep_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_hysweep_struct *) store_ptr;
-
-	/* get sonar type */
-	if (store->HSP_sonar_id == MBSYS_HYSWEEP_SONAR_RESON_SEABAT8101_150		/* Reson Seabat 8101 - 150 Deg - 1 */
-		|| store->HSP_sonar_id == MBSYS_HYSWEEP_SONAR_RESON_SEABAT7125		/* Reson Seabat 7125 - 22 */
-		|| store->HSP_sonar_id == MBSYS_HYSWEEP_SONAR_RESON_SEABAT8111		/* Reson Seabat 8111 - 23 */
-		|| store->HSP_sonar_id == MBSYS_HYSWEEP_SONAR_RESON_SEABAT8124		/* Reson Seabat 8124 - 24 */
-		|| store->HSP_sonar_id == MBSYS_HYSWEEP_SONAR_RESON_SEABAT8125		/* Reson Seabat 8125 - 25 */
-		|| store->HSP_sonar_id == MBSYS_HYSWEEP_SONAR_RESON_SEABAT9001		/* Reson Seabat 9001 - 26 */
-		|| store->HSP_sonar_id == MBSYS_HYSWEEP_SONAR_RESON_SEABAT9003		/* Reson Seabat 9003 - 27 */
-		|| store->HSP_sonar_id == MBSYS_HYSWEEP_SONAR_SEABEAM_2100		/* Seabeam 2100 - 29 */
-		|| store->HSP_sonar_id == MBSYS_HYSWEEP_SONAR_SEABEAM_1185		/* Seabeam SB1185 - 30 */
-		|| store->HSP_sonar_id == MBSYS_HYSWEEP_SONAR_SIMRAD_EA400		/* Simrad EA400 - 31 */
-		|| store->HSP_sonar_id == MBSYS_HYSWEEP_SONAR_SIMRAD_EM102		/* Simrad EM102 - 32 */
-		|| store->HSP_sonar_id == MBSYS_HYSWEEP_SONAR_SIMRAD_EM1002		/* Simrad EM1002 - 33 */
-		|| store->HSP_sonar_id == MBSYS_HYSWEEP_SONAR_SIMRAD_EM2000		/* Simrad EM2000 - 34 */
-		|| store->HSP_sonar_id == MBSYS_HYSWEEP_SONAR_SIMRAD_EM3000		/* Simrad EM3000 - 35 */
-		|| store->HSP_sonar_id == MBSYS_HYSWEEP_SONAR_SIMRAD_EM3000D		/* Simrad EM3000D - 36 */
-		|| store->HSP_sonar_id == MBSYS_HYSWEEP_SONAR_SIMRAD_EM3002		/* Simrad EM3002 - 37 */
-		|| store->HSP_sonar_id == MBSYS_HYSWEEP_SONAR_SIMRAD_EM3002D		/* Simrad EM3002D - 38 */
-		|| store->HSP_sonar_id == MBSYS_HYSWEEP_SONAR_RESON_SEABAT8101_210	/* Reson Seabat 8101 - 210 Deg - 39 */
-		|| store->HSP_sonar_id == MBSYS_HYSWEEP_SONAR_IMAGENEX_DELTAT		/* Imagenex Delta T - 40 */
-		|| store->HSP_sonar_id == MBSYS_HYSWEEP_SONAR_ATLAS_HYDROSWEEPMD2	/* Atlas Hydrosweep MD2 - 41 */
-		|| store->HSP_sonar_id == MBSYS_HYSWEEP_SONAR_SIMRAD_SM2000		/* Simrad SM2000 - 42 */
-		|| store->HSP_sonar_id == MBSYS_HYSWEEP_SONAR_SIMRAD_EM710		/* Simrad EM710 - 43 */
-		|| store->HSP_sonar_id == MBSYS_HYSWEEP_SONAR_SIMRAD_EM302		/* Simrad EM302 - 44 */
-		|| store->HSP_sonar_id == MBSYS_HYSWEEP_SONAR_BLUEVIEW_MB1350_45	/* Blueview MB1350-45 - 45 */
-		|| store->HSP_sonar_id == MBSYS_HYSWEEP_SONAR_BLUEVIEW_MB2250_45	/* Blueview MB2250-45 - 46 */
-		|| store->HSP_sonar_id == MBSYS_HYSWEEP_SONAR_BLUEVIEW_MB1350_90	/* Blueview MB1350-90 - 47 */
-		|| store->HSP_sonar_id == MBSYS_HYSWEEP_SONAR_BLUEVIEW_MB2250_90	/* Blueview MB2250-90 - 48 */
-		|| store->HSP_sonar_id == MBSYS_HYSWEEP_SONAR_RESON_7101		/* Reson Seabat 7101 - 53 */
-		|| store->HSP_sonar_id == MBSYS_HYSWEEP_SONAR_FURUNO_HS300F		/* Furuno HS-300F - 54 */
-		|| store->HSP_sonar_id == MBSYS_HYSWEEP_SONAR_FURUNO_HS600		/* Furuno HS-600 - 55 */
-		|| store->HSP_sonar_id == MBSYS_HYSWEEP_SONAR_FURUNO_HS600F		/* Furuno HS-600F - 56 */
-		|| store->HSP_sonar_id == MBSYS_HYSWEEP_SONAR_RESON_8150		/* Reson 8150 - 58 */
-		|| store->HSP_sonar_id == MBSYS_HYSWEEP_SONAR_RESON_8160		/* Reson 8160 - 59 */
-		|| store->HSP_sonar_id == MBSYS_HYSWEEP_SONAR_RESON_7150		/* Reson 7150 - 60 */
-		|| store->HSP_sonar_id == MBSYS_HYSWEEP_SONAR_RESON_7111		/* Reson Seabat 7111 - 62 */
-		|| store->HSP_sonar_id == MBSYS_HYSWEEP_SONAR_R2SONIC_SONIC2024		/* R2Sonic SONIC 2024 - 63 */
-		|| store->HSP_sonar_id == MBSYS_HYSWEEP_SONAR_WASSP_MULTIBEAM		/* WASSP Multibeam - 65 */
-		|| store->HSP_sonar_id == MBSYS_HYSWEEP_SONAR_ATLAS_HYDROSWEEPMD50	/* Atlas Hydrosweep  MD/50 - 66 */
-		|| store->HSP_sonar_id == MBSYS_HYSWEEP_SONAR_ATLAS_HYDROSWEEPMD30	/* Atlas Hydrosweep  MD/30 - 67 */
-		|| store->HSP_sonar_id == MBSYS_HYSWEEP_SONAR_ATLAS_HYDROSWEEPDS	/* Atlas Hydrosweep  DS - 68 */
-		|| store->HSP_sonar_id == MBSYS_HYSWEEP_SONAR_SEABEAM_3012		/* SeaBeam 3012 - 70 */
-		|| store->HSP_sonar_id == MBSYS_HYSWEEP_SONAR_SEABEAM_3020		/* SeaBeam 3020 - 71 */
-		|| store->HSP_sonar_id == MBSYS_HYSWEEP_SONAR_SEABEAM_3050		/* SeaBeam 3050 - 72 */)
-		{
-		*sonartype = MB_TOPOGRAPHY_TYPE_MULTIBEAM;
-		}
-	else if (store->HSP_sonar_id == MBSYS_HYSWEEP_SONAR_ATLAS_FANSWEEP20		/* Atlas Fansweep 20 - 2 */
-		|| store->HSP_sonar_id == MBSYS_HYSWEEP_SONAR_BENTHOS_C3D		/* Benthos C3D - 3 */
-		|| store->HSP_sonar_id == MBSYS_HYSWEEP_SONAR_GEOACOUSTICS_GEOSWATH	/* GeoAcoustics GeoSwath - 11 */
-		|| store->HSP_sonar_id == MBSYS_HYSWEEP_SONAR_KLEIN_5000		/* Klein 5000 - 18 */
-		|| store->HSP_sonar_id == MBSYS_HYSWEEP_SONAR_SEA_SWATHPLUS		/* SEA Swathplus - 28 */
-		|| store->HSP_sonar_id == MBSYS_HYSWEEP_SONAR_GEOACOUSTICS_DSS		/* Geoacoustics digital sidescan - 49 */
-		|| store->HSP_sonar_id == MBSYS_HYSWEEP_SONAR_EDGETECH_4600		/* Edgetech 4600 - 61 */)
-		{
-		*sonartype = MB_TOPOGRAPHY_TYPE_INTERFEROMETRIC;
-		}
-	else if (store->HSP_sonar_id == MBSYS_HYSWEEP_SONAR_EDGETECH_272		/* EdgeTech 272 - 5 */
-		|| store->HSP_sonar_id == MBSYS_HYSWEEP_SONAR_EDGETECH_4100		/* EdgeTech 4100 - 6 */
-		|| store->HSP_sonar_id == MBSYS_HYSWEEP_SONAR_EDGETECH_4125		/* EdgeTech 4125 - 7 */
-		|| store->HSP_sonar_id == MBSYS_HYSWEEP_SONAR_EDGETECH_4150		/* EdgeTech 4150 - 8 */
-		|| store->HSP_sonar_id == MBSYS_HYSWEEP_SONAR_EDGETECH_4200		/* EdgeTech 4200 - 9 */
-		|| store->HSP_sonar_id == MBSYS_HYSWEEP_SONAR_EDGETECH_4300		/* EdgeTech 4300 - 10 */
-		|| store->HSP_sonar_id == MBSYS_HYSWEEP_SONAR_KLEIN_595			/* Klein 595 - 14 */
-		|| store->HSP_sonar_id == MBSYS_HYSWEEP_SONAR_KLEIN_2000		/* Klein 2000 - 15 */
-		|| store->HSP_sonar_id == MBSYS_HYSWEEP_SONAR_KLEIN_3000		/* Klein 3000 - 16 */
-		|| store->HSP_sonar_id == MBSYS_HYSWEEP_SONAR_KLEIN_3900		/* Klein 3900 - 17 */
-		|| store->HSP_sonar_id == MBSYS_HYSWEEP_SONAR_BENTHOS_1624		/* Benthos 1624 - 50 */
-		|| store->HSP_sonar_id == MBSYS_HYSWEEP_SONAR_BENTHOS_1625		/* Benthos 1625 - 51 */
-		|| store->HSP_sonar_id == MBSYS_HYSWEEP_SONAR_MARINESONIC_SEASCAN	/* Marine Sonic Sea Scan - 52 */
-		|| store->HSP_sonar_id == MBSYS_HYSWEEP_SONAR_TRITECH_STARFISH		/* Tritech Starfish - 57 */
-		|| store->HSP_sonar_id == MBSYS_HYSWEEP_SONAR_INNOMAR_SES		/* Innomar SES - 69 */)
-		{
-		*sonartype = MB_TOPOGRAPHY_TYPE_SIDESCAN;
-		}
-	else if (store->HSP_sonar_id == MBSYS_HYSWEEP_SONAR_CMAX_CM2			/* CMAX CM-2 - 4 */
-		|| store->HSP_sonar_id == MBSYS_HYSWEEP_SONAR_IMAGENEX_SPORTSCAN	/* Imagenex Sportscan - 12 */
-		|| store->HSP_sonar_id == MBSYS_HYSWEEP_SONAR_IMAGENEX_YELLOWFIN	/* Imagenex Yellowfin - 13 */
-		|| store->HSP_sonar_id == MBSYS_HYSWEEP_SONAR_ODOM_CV3			/* Odom CV3 - 19 */
-		|| store->HSP_sonar_id == MBSYS_HYSWEEP_SONAR_ODOM_ECHOSCAN2		/* Odom Echoscan 2 - 20 */
-		|| store->HSP_sonar_id == MBSYS_HYSWEEP_SONAR_ODOM_ES3			/* Odom ES3 - 21 */
-		|| store->HSP_sonar_id == MBSYS_HYSWEEP_SONAR_MDL_DYNASCAN		/* MDL Dynascan - 64 */)
-		{
-		*sonartype = MB_TOPOGRAPHY_TYPE_ECHOSOUNDER;
-		}
-	else
-		{
-		*sonartype = MB_TOPOGRAPHY_TYPE_UNKNOWN;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       sonartype:  %d\n",*sonartype);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_hysweep_sidescantype(int verbose, void *mbio_ptr, void *store_ptr,
-		int *ss_type, int *error)
-{
-	char	*function_name = "mbsys_hysweep_sidescantype";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_hysweep_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_hysweep_struct *) store_ptr;
-
-	/* get sidescan type */
-	if (store->HSP_sonar_id == MBSYS_HYSWEEP_SONAR_SEABEAM_2100		/* Seabeam 2100 - 29 */)
-		{
-		*ss_type = MB_SIDESCAN_LINEAR;
-		}
-	else
-		{
-		*ss_type = MB_SIDESCAN_LOGARITHMIC;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       ss_type:    %d\n",*ss_type);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_hysweep_extract(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int time_i[7], double *time_d,
-		double *navlon, double *navlat,
-		double *speed, double *heading,
-		int *nbath, int *namp, int *nss,
-		char *beamflag, double *bath, double *amp,
-		double *bathacrosstrack, double *bathalongtrack,
-		double *ss, double *ssacrosstrack, double *ssalongtrack,
-		char *comment, int *error)
-{
-	char	*function_name = "mbsys_hysweep_extract";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_hysweep_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_hysweep_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get time */
-		for (i=0;i<7;i++)
-			time_i[i] = store->time_i[i];
-		*time_d = store->time_d;
-
-		/* get interpolated nav heading and speed  */
-		*speed = 0.0;
-		if (mb_io_ptr->nfix > 0)
-			mb_navint_interp(verbose, mbio_ptr, store->time_d, *heading, *speed,
-				    navlon, navlat, speed, error);
-
-		/* get heading */
-		*heading = store->RMBint_heading;
-
-		/* get navigation - actually return the easting northing because
-			the projection is set and so the position will be inverse
-			projected */
-		*navlon = store->RMBint_x;
-		*navlat = store->RMBint_y;
-
-		/* read distance and depth values into storage arrays */
-		*nbath = store->RMB_num_beams;
-		if (store->RMB_beam_data_available | 0x0800)
-			*namp = store->RMB_num_beams;
-		else
-			*namp = 0;
-		for (i=0;i<*nbath;i++)
-			{
-			if (store->RMB_sounding_depths != NULL)
-				bath[i] = store->RMB_sounding_depths[i];
-			else
-				bath[i] = 0.0;
-			if (store->RMB_sounding_depths != NULL)
-				bathacrosstrack[i] = store->RMB_sounding_across[i];
-			else
-				bathacrosstrack[i] = 0.0;
-			if (store->RMB_sounding_depths != NULL)
-				bathalongtrack[i] = store->RMB_sounding_along[i];
-			else
-				bathalongtrack[i] = 0.0;
-			if (store->RMB_sounding_depths != NULL)
-				amp[i] = store->RMB_sounding_intensities[i];
-			else
-				amp[i] = 0.0;
-			if (store->RMB_sounding_flags != NULL)
-				{
-				beamflag[i] = store->RMB_sounding_flags[i];
-				}
-			else
-				{
-				if (store->RMB_sounding_quality[i] >= store->HSP_high_beam_quality)
-					{
-					beamflag[i] = MB_FLAG_NONE;
-					}
-				else
-					{
-					beamflag[i] = MB_FLAG_FLAG + MB_FLAG_FILTER;
-					}
-				}
-			}
-
-		/* initialize sidescan */
-		if (store->MSS_num_pixels > 0
-			&& (store->MSS_ping_number == store->RMB_ping_number
-				|| 10 * store->MSS_ping_number == store->RMB_ping_number))
-			{
-			*nss = store->MSS_num_pixels;
-			for (i=0;i<*nss;i++)
-				{
-				ss[i] =store->MSS_ss[i];
-				ssacrosstrack[i] =store->MSS_ss_across[i];
-				ssalongtrack[i] = store->MSS_ss_along[i];
-				}
-			}
-		else
-			*nss = 0;
-
-		/* print debug statements */
-		if (verbose >= 5)
-			{
-			fprintf(stderr,"\ndbg4  Data extracted by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  Extracted values:\n");
-			fprintf(stderr,"dbg4       kind:       %d\n",
-				*kind);
-			fprintf(stderr,"dbg4       error:      %d\n",
-				*error);
-			fprintf(stderr,"dbg4       time_i[0]:  %d\n",
-				time_i[0]);
-			fprintf(stderr,"dbg4       time_i[1]:  %d\n",
-				time_i[1]);
-			fprintf(stderr,"dbg4       time_i[2]:  %d\n",
-				time_i[2]);
-			fprintf(stderr,"dbg4       time_i[3]:  %d\n",
-				time_i[3]);
-			fprintf(stderr,"dbg4       time_i[4]:  %d\n",
-				time_i[4]);
-			fprintf(stderr,"dbg4       time_i[5]:  %d\n",
-				time_i[5]);
-			fprintf(stderr,"dbg4       time_i[6]:  %d\n",
-				time_i[6]);
-			fprintf(stderr,"dbg4       time_d:     %f\n",
-				*time_d);
-			fprintf(stderr,"dbg4       longitude:  %f\n",
-				*navlon);
-			fprintf(stderr,"dbg4       latitude:   %f\n",
-				*navlat);
-			fprintf(stderr,"dbg4       speed:      %f\n",
-				*speed);
-			fprintf(stderr,"dbg4       heading:    %f\n",
-				*heading);
-			fprintf(stderr,"dbg4       nbath:      %d\n",
-				*nbath);
-			for (i=0;i<*nbath;i++)
-			  fprintf(stderr,"dbg4       beam:%d  flag:%3d  bath:%f  acrosstrack:%f  alongtrack:%f\n",
-				i,beamflag[i],bath[i],
-				bathacrosstrack[i],bathalongtrack[i]);
-			fprintf(stderr,"dbg4        namp:     %d\n",
-				*namp);
-			for (i=0;i<*namp;i++)
-			  fprintf(stderr,"dbg4        beam:%d   amp:%f  acrosstrack:%f  alongtrack:%f\n",
-				i,amp[i],bathacrosstrack[i],bathalongtrack[i]);
-			fprintf(stderr,"dbg4        nss:      %d\n",
-				*nss);
-			for (i=0;i<*nss;i++)
-			  fprintf(stderr,"dbg4        pixel:%d   ss:%f  acrosstrack:%f  alongtrack:%f\n",
-				i,ss[i],ssacrosstrack[i],ssalongtrack[i]);
-			}
-
-		/* done translating values */
-
-		}
-
-	/* extract data from structure */
-	else if (*kind == MB_DATA_NAV
-		|| *kind == MB_DATA_NAV1
-		|| *kind == MB_DATA_NAV2)
-		{
-		/* get time */
-		for (i=0;i<7;i++)
-			time_i[i] = store->time_i[i];
-		*time_d = store->time_d;
-
-		/* get heading */
-		if (mb_io_ptr->nheading > 0)
-			mb_hedint_interp(verbose, mbio_ptr, store->time_d,
-				    heading, error);
-
-		/* get nav and speed */
-		*speed = 0.0;
-		if (mb_io_ptr->nfix > 0)
-			mb_navint_interp(verbose, mbio_ptr, store->time_d, *heading, *speed,
-				    navlon, navlat, speed, error);
-
-		/* get navigation - actually return the easting northing because
-			the projection is set and so the position will be inverse
-			projected */
-		*navlon = store->POS_x;
-		*navlat = store->POS_y;
-
-		/* set beam and pixel numbers */
-		*nbath = 0;
-		*namp = 0;
-		*nss = 0;
-
-		/* print debug statements */
-		if (verbose >= 5)
-			{
-			fprintf(stderr,"\ndbg4  Data extracted by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  Extracted values:\n");
-			fprintf(stderr,"dbg4       kind:       %d\n",
-				*kind);
-			fprintf(stderr,"dbg4       error:      %d\n",
-				*error);
-			fprintf(stderr,"dbg4       time_i[0]:  %d\n",
-				time_i[0]);
-			fprintf(stderr,"dbg4       time_i[1]:  %d\n",
-				time_i[1]);
-			fprintf(stderr,"dbg4       time_i[2]:  %d\n",
-				time_i[2]);
-			fprintf(stderr,"dbg4       time_i[3]:  %d\n",
-				time_i[3]);
-			fprintf(stderr,"dbg4       time_i[4]:  %d\n",
-				time_i[4]);
-			fprintf(stderr,"dbg4       time_i[5]:  %d\n",
-				time_i[5]);
-			fprintf(stderr,"dbg4       time_i[6]:  %d\n",
-				time_i[6]);
-			fprintf(stderr,"dbg4       time_d:     %f\n",
-				*time_d);
-			fprintf(stderr,"dbg4       longitude:  %f\n",
-				*navlon);
-			fprintf(stderr,"dbg4       latitude:   %f\n",
-				*navlat);
-			fprintf(stderr,"dbg4       speed:      %f\n",
-				*speed);
-			fprintf(stderr,"dbg4       heading:    %f\n",
-				*heading);
-			}
-
-		/* done translating values */
-
-		}
-
-	/* extract comment from structure */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* get time */
-		for (i=0;i<7;i++)
-			time_i[i] = store->time_i[i];
-		*time_d = store->time_d;
-
-		/* copy comment */
-		if (strlen(store->COM_comment) > 0)
-			strncpy(comment, store->COM_comment, MB_COMMENT_MAXLINE);
-		else
-			comment[0] = '\0';
-
-		/* print debug statements */
-		if (verbose >= 4)
-			{
-			fprintf(stderr,"\ndbg4  Comment extracted by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  New ping values:\n");
-			fprintf(stderr,"dbg4       kind:       %d\n",
-				*kind);
-			fprintf(stderr,"dbg4       error:      %d\n",
-				*error);
-			fprintf(stderr,"dbg4       time_i[0]:  %d\n",
-				time_i[0]);
-			fprintf(stderr,"dbg4       time_i[1]:  %d\n",
-				time_i[1]);
-			fprintf(stderr,"dbg4       time_i[2]:  %d\n",
-				time_i[2]);
-			fprintf(stderr,"dbg4       time_i[3]:  %d\n",
-				time_i[3]);
-			fprintf(stderr,"dbg4       time_i[4]:  %d\n",
-				time_i[4]);
-			fprintf(stderr,"dbg4       time_i[5]:  %d\n",
-				time_i[5]);
-			fprintf(stderr,"dbg4       time_i[6]:  %d\n",
-				time_i[6]);
-			fprintf(stderr,"dbg4       time_d:     %f\n",
-				*time_d);
-			fprintf(stderr,"dbg4       comment:    %s\n",
-				comment);
-			}
-		}
-
-	/* set time for other data records */
-	else
-		{
-		/* get time */
-		for (i=0;i<7;i++)
-			time_i[i] = store->time_i[i];
-		*time_d = store->time_d;
-
-		/* print debug statements */
-		if (verbose >= 4)
-			{
-			fprintf(stderr,"\ndbg4  Data extracted by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  Extracted values:\n");
-			fprintf(stderr,"dbg4       kind:       %d\n",
-				*kind);
-			fprintf(stderr,"dbg4       error:      %d\n",
-				*error);
-			fprintf(stderr,"dbg4       time_i[0]:  %d\n",
-				time_i[0]);
-			fprintf(stderr,"dbg4       time_i[1]:  %d\n",
-				time_i[1]);
-			fprintf(stderr,"dbg4       time_i[2]:  %d\n",
-				time_i[2]);
-			fprintf(stderr,"dbg4       time_i[3]:  %d\n",
-				time_i[3]);
-			fprintf(stderr,"dbg4       time_i[4]:  %d\n",
-				time_i[4]);
-			fprintf(stderr,"dbg4       time_i[5]:  %d\n",
-				time_i[5]);
-			fprintf(stderr,"dbg4       time_i[6]:  %d\n",
-				time_i[6]);
-			fprintf(stderr,"dbg4       time_d:     %f\n",
-				*time_d);
-			fprintf(stderr,"dbg4       comment:    %s\n",
-				comment);
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind == MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"dbg2       comment:     \ndbg2       %s\n",
-			comment);
-		}
-	else if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind != MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"dbg2       time_i[0]:     %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:     %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:     %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:     %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:     %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:     %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:     %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:        %f\n",*time_d);
-		fprintf(stderr,"dbg2       longitude:     %f\n",*navlon);
-		fprintf(stderr,"dbg2       latitude:      %f\n",*navlat);
-		fprintf(stderr,"dbg2       speed:         %f\n",*speed);
-		fprintf(stderr,"dbg2       heading:       %f\n",*heading);
-		}
-	if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind == MB_DATA_DATA)
-		{
-		fprintf(stderr,"dbg2       nbath:      %d\n",
-			*nbath);
-		for (i=0;i<*nbath;i++)
-		  fprintf(stderr,"dbg2       beam:%d  flag:%3d  bath:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,beamflag[i],bath[i],
-			bathacrosstrack[i],bathalongtrack[i]);
-		fprintf(stderr,"dbg2        namp:     %d\n",
-			*namp);
-		for (i=0;i<*namp;i++)
-		  fprintf(stderr,"dbg2       beam:%d   amp:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,amp[i],bathacrosstrack[i],bathalongtrack[i]);
-		fprintf(stderr,"dbg2        nss:      %d\n",
-			*nss);
-		for (i=0;i<*nss;i++)
-		  fprintf(stderr,"dbg2        pixel:%d   ss:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,ss[i],ssacrosstrack[i],ssalongtrack[i]);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_hysweep_insert(int verbose, void *mbio_ptr, void *store_ptr,
-		int kind, int time_i[7], double time_d,
-		double navlon, double navlat,
-		double speed, double heading,
-		int nbath, int namp, int nss,
-		char *beamflag, double *bath, double *amp,
-		double *bathacrosstrack, double *bathalongtrack,
-		double *ss, double *ssacrosstrack, double *ssalongtrack,
-		char *comment, int *error)
-{
-	char	*function_name = "mbsys_hysweep_insert";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_hysweep_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       kind:       %d\n",kind);
-		}
-	if (verbose >= 2 && (kind == MB_DATA_DATA || kind == MB_DATA_NAV1 || kind == MB_DATA_NAV2))
-		{
-		fprintf(stderr,"dbg2       time_i[0]:  %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:  %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:  %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:  %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:  %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:  %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:  %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:     %f\n",time_d);
-		fprintf(stderr,"dbg2       navlon:     %f\n",navlon);
-		fprintf(stderr,"dbg2       navlat:     %f\n",navlat);
-		fprintf(stderr,"dbg2       speed:      %f\n",speed);
-		fprintf(stderr,"dbg2       heading:    %f\n",heading);
-		}
-	if (verbose >= 2 && kind == MB_DATA_DATA)
-		{
-		fprintf(stderr,"dbg2       nbath:      %d\n",nbath);
-		if (verbose >= 3)
-		 for (i=0;i<nbath;i++)
-		  fprintf(stderr,"dbg3       beam:%d  flag:%3d  bath:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,beamflag[i],bath[i],
-			bathacrosstrack[i],bathalongtrack[i]);
-		fprintf(stderr,"dbg2       namp:       %d\n",namp);
-		if (verbose >= 3)
-		 for (i=0;i<namp;i++)
-		  fprintf(stderr,"dbg3        beam:%d   amp:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,amp[i],bathacrosstrack[i],bathalongtrack[i]);
-		fprintf(stderr,"dbg2        nss:       %d\n",nss);
-		if (verbose >= 3)
-		 for (i=0;i<nss;i++)
-		  fprintf(stderr,"dbg3        beam:%d   ss:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,ss[i],ssacrosstrack[i],ssalongtrack[i]);
-		}
-	if (verbose >= 2 && kind == MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"dbg2       comment:     \ndbg2       %s\n",
-			comment);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_hysweep_struct *) store_ptr;
-
-	/* set data kind */
-	store->kind = kind;
-
-	/* insert data in structure */
-	if (store->kind == MB_DATA_DATA)
-		{
-		/* get time */
-		for (i=0;i<7;i++)
-			store->time_i[i] = time_i[i];
-		store->time_d = time_d;
-
-		/* get navigation - actually easting northings show up here because
-			the projection is set and so the position has been
-			projected */
-		/* get navigation */
-		store->RMBint_x = navlon;
-		store->RMBint_y = navlat;
-		mb_proj_inverse(verbose, mb_io_ptr->pjptr, navlon, navlat,
-							&(store->RMBint_lon), &(store->RMBint_lat),
-							error);
-
-		/* get heading */
-		store->RMBint_heading = heading;
-
-		/* get speed  */
-
-		/* only insert data if the number of beams matchs */
-		if (nbath ==  store->RMB_num_beams)
-			{
-			/* allocate storage arrays if needed */
-			if (store->RMB_sounding_depths == NULL)
-				status = mb_reallocd(verbose, __FILE__, __LINE__, nbath * sizeof(double),
-							(void **)&(store->RMB_sounding_depths), error);
-			if (store->RMB_sounding_across == NULL)
-				status = mb_reallocd(verbose, __FILE__, __LINE__, nbath * sizeof(double),
-							(void **)&(store->RMB_sounding_across), error);
-			if (store->RMB_sounding_along == NULL)
-				status = mb_reallocd(verbose, __FILE__, __LINE__, nbath * sizeof(double),
-							(void **)&(store->RMB_sounding_along), error);
-
-			/* insert the depth and distance values into the storage arrays */
-			for (i=0;i<store->RMB_num_beams;i++)
-				{
-				store->RMB_sounding_depths[i] = bath[i];
-				store->RMB_sounding_across[i] = bathacrosstrack[i];
-				store->RMB_sounding_along[i] = bathalongtrack[i];
-				store->RMB_sounding_flags[i] = beamflag[i];
-				}
-			}
-		if (namp ==  store->RMB_num_beams)
-			{
-			/* allocate storage arrays if needed */
-			if (store->RMB_sounding_intensities == NULL)
-				status = mb_reallocd(verbose, __FILE__, __LINE__, namp * sizeof(double),
-							(void **)&(store->RMB_sounding_intensities), error);
-
-			/* insert the amplitude values into the storage arrays */
-			for (i=0;i<store->RMB_num_beams;i++)
-				{
-				store->RMB_sounding_intensities[i] = amp[i];
-				}
-			}
-
-		/* only insert sidescan if the number of pixels matches */
-
-		/* initialize sidescan */
-		if (nss == store->MSS_num_pixels
-			&& (store->MSS_ping_number == store->RMB_ping_number
-				|| 10 * store->MSS_ping_number == store->RMB_ping_number))
-			{
-			for (i=0;i<nss;i++)
-				{
-				store->MSS_ss[i] = ss[i];
-				store->MSS_ss_across[i] = ssacrosstrack[i];
-				store->MSS_ss_along[i] = ssalongtrack[i];
-				}
-			}
-		}
-
-	/* insert data in nav structure */
-	else if (store->kind == MB_DATA_NAV
-		|| store->kind == MB_DATA_NAV1
-		|| store->kind == MB_DATA_NAV2)
-		{
-		/* get time */
-		for (i=0;i<7;i++)
-			store->time_i[i] = time_i[i];
-		store->time_d = time_d;
-
-		/* get navigation - actually easting northings show up here because
-			the projection is set and so the position has been
-			projected */
-		store->POS_x = navlon;
-		store->POS_y = navlat;
-fprintf(stderr, "INSERT1b %.3f %.2f %.2f\r\n",
-	store->POS_time,
-	store->POS_x,
-	store->POS_y);
-
-		/* get heading */
-
-		/* get speed  */
-		}
-
-	/* insert comment in structure */
-	else if (store->kind == MB_DATA_COMMENT)
-		{
-		strncpy(store->COM_comment, comment, MB_COMMENT_MAXLINE);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_hysweep_ttimes(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, int *nbeams,
-	double *ttimes, double *angles,
-	double *angles_forward, double *angles_null,
-	double *heave, double *alongtrack_offset,
-	double *draft, double *ssv, int *error)
-{
-	char	*function_name = "mbsys_hysweep_ttimes";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_hysweep_struct *store;
-	struct mbsys_hysweep_device_struct *device;
-	double	alpha, beta, theta, phi;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       ttimes:     %p\n",(void *)ttimes);
-		fprintf(stderr,"dbg2       angles_xtrk:%p\n",(void *)angles);
-		fprintf(stderr,"dbg2       angles_ltrk:%p\n",(void *)angles_forward);
-		fprintf(stderr,"dbg2       angles_null:%p\n",(void *)angles_null);
-		fprintf(stderr,"dbg2       heave:      %p\n",(void *)heave);
-		fprintf(stderr,"dbg2       ltrk_off:   %p\n",(void *)alongtrack_offset);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_hysweep_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get sound velocity */
-		*ssv = store->RMB_sound_velocity;
-
-		/* get draft */
-		*draft = store->RMBint_draft;
-
-		/* get travel times, angles */
-		*nbeams = store->RMB_num_beams;
-		device = (struct mbsys_hysweep_device_struct *) &(store->devices[store->RMB_device_number]);
-		for (i=0;i<store->RMB_num_beams;i++)
-			{
-			ttimes[i] = 2.0 * store->RMB_beam_ranges[i] / (*ssv);
-			if (store->RMB_sounding_takeoffangles != NULL && store->RMB_sounding_azimuthalangles != NULL)
-				{
-				angles[i] = store->RMB_sounding_takeoffangles[i];
-				angles_forward[i] = store->RMB_sounding_azimuthalangles[i] + 90.0;
-				}
-			else if (store->RMB_sounding_pitchangles != NULL && store->RMB_sounding_rollangles != NULL)
-				{
-				alpha = store->RMB_sounding_pitchangles[i];
-				beta = 90.0 + store->RMB_sounding_rollangles[i];
-
-				/* correct alpha for pitch if necessary */
-				if (!(device->MBI_sonar_flags & 0x0002))
-					alpha += store->RMBint_pitch;
-
-				/* correct beta for roll if necessary */
-				if (!(device->MBI_sonar_flags & 0x0001))
-					beta -= store->RMBint_roll;
-
-				mb_rollpitch_to_takeoff(
-					verbose,
-					alpha, beta,
-					&theta, &phi,
-					error);
-				angles[i] = theta;
-				angles_forward[i] = phi;
-				}
-			if (device->MBI_sonar_receive_shape == 1)
-				angles_null[i] = angles[i];
-			else
-				angles_null[i] = 0.0;
-			heave[i] = store->RMBint_heave;
-			if (store->RMB_beam_data_available & 0x0400)
-				alongtrack_offset[i] = store->GPS_sog * 0.0005144 * store->RMB_sounding_timedelays[i];
-			else
-				alongtrack_offset[i] = 0.0;
-			}
-
-		/* set status */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error == MB_ERROR_NO_ERROR)
-		{
-		fprintf(stderr,"dbg2       draft:      %f\n",*draft);
-		fprintf(stderr,"dbg2       ssv:        %f\n",*ssv);
-		fprintf(stderr,"dbg2       nbeams:     %d\n",*nbeams);
-		for (i=0;i<*nbeams;i++)
-			fprintf(stderr,"dbg2       beam %d: tt:%f  angle_xtrk:%f  angle_ltrk:%f  angle_null:%f  depth_off:%f  ltrk_off:%f\n",
-				i,ttimes[i],angles[i],
-				angles_forward[i],angles_null[i],
-				heave[i],alongtrack_offset[i]);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_hysweep_detects(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, int *nbeams, int *detects, int *error)
-{
-	char	*function_name = "mbsys_hysweep_detects";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_hysweep_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       detects:    %p\n",(void *)detects);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_hysweep_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* read distance and depth values into storage arrays */
-		*nbeams = store->RMB_num_beams;
-		for (i=0;i<*nbeams;i++)
-			{
-			detects[i] = MB_DETECT_UNKNOWN;
-			}
-
-		/* set status */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error == MB_ERROR_NO_ERROR)
-		{
-		fprintf(stderr,"dbg2       nbeams:     %d\n",*nbeams);
-		for (i=0;i<*nbeams;i++)
-			fprintf(stderr,"dbg2       beam %d: detects:%d\n",
-				i,detects[i]);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_hysweep_gains(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, double *transmit_gain, double *pulse_length,
-			double *receive_gain, int *error)
-{
-	char	*function_name = "mbsys_hysweep_gains";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_hysweep_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_hysweep_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get transmit_gain (dB) */
-		*transmit_gain = (double)0.0;
-
-		/* get pulse_length (usec) */
-		*pulse_length = (double)0.0;
-
-		/* get receive_gain (dB) */
-		*receive_gain = (double)0.0;
-
-		/* set status */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error == MB_ERROR_NO_ERROR)
-		{
-		fprintf(stderr,"dbg2       transmit_gain: %f\n",*transmit_gain);
-		fprintf(stderr,"dbg2       pulse_length:  %f\n",*pulse_length);
-		fprintf(stderr,"dbg2       receive_gain:  %f\n",*receive_gain);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_hysweep_extract_altitude(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, double *transducer_depth, double *altitudev,
-	int *error)
-{
-	char	*function_name = "mbsys_hysweep_extract_altitude";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_hysweep_struct *store;
-	double	xtrackmin;
-	int	altitude_found;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_hysweep_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get transducer depth */
-		*transducer_depth = store->RMBint_draft - store->RMBint_heave;
-
-		/* get altitude */
-		altitude_found = MB_NO;
-		if (mb_io_ptr->naltitude > 0)
-			{
-			mb_altint_interp(verbose, mbio_ptr, store->time_d,
-				    altitudev, error);
-			altitude_found = MB_YES;
-			}
-		if (altitude_found == MB_NO)
-			{
-			/* get depth closest to nadir */
-			xtrackmin = 999999.9;
-			for (i=0;i<store->RMB_num_beams;i++)
-				{
-				if ((store->RMB_sounding_flags[i] == MB_FLAG_NONE)
-					&& fabs((double)store->RMB_sounding_across[i]) < xtrackmin)
-					{
-					*altitudev = store->RMB_sounding_depths[i] - *transducer_depth;
-					altitude_found = MB_YES;
-					xtrackmin = fabs((double)store->RMB_sounding_across[i]);
-					}
-				}
-			}
-		if (altitude_found == MB_NO)
-			{
-			*altitudev = 0.0;
-			}
-
-		/* set status */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:              %d\n",*kind);
-		fprintf(stderr,"dbg2       transducer_depth:  %f\n",*transducer_depth);
-		fprintf(stderr,"dbg2       altitude:          %f\n",*altitudev);
-		fprintf(stderr,"dbg2       error:             %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:            %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_hysweep_extract_nav(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int time_i[7], double *time_d,
-		double *navlon, double *navlat,
-		double *speed, double *heading, double *draft,
-		double *roll, double *pitch, double *heave,
-		int *error)
-{
-	char	*function_name = "mbsys_hysweep_extract_nav";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_hysweep_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_hysweep_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from ping structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get time */
-		for (i=0;i<7;i++)
-			time_i[i] = store->time_i[i];
-		*time_d = store->time_d;
-
-		/* get heading */
-		*heading = store->RMBint_heading;
-
-		/* get interpolated nav heading and speed  */
-		*speed = 0.0;
-		if (mb_io_ptr->nfix > 0)
-			mb_navint_interp(verbose, mbio_ptr, store->time_d, *heading, *speed,
-				    navlon, navlat, speed, error);
-
-
-		/* get navigation - actually return the easting northing because
-			the projection is set and so the position will be inverse
-			projected */
-		*navlon = store->RMBint_x;
-		*navlat = store->RMBint_y;
-
-		/* get draft  */
-		*draft = store->RMBint_draft;
-
-		/* get attitude  */
-		*roll = store->RMBint_roll;
-		*pitch = store->RMBint_pitch;
-		*heave = store->RMBint_heave;
-
-		/* done translating values */
-
-		}
-
-	/* extract data from nav structure */
-	else if (*kind == MB_DATA_NAV
-		|| *kind == MB_DATA_NAV1
-		|| *kind == MB_DATA_NAV2)
-		{
-		/* get time */
-		for (i=0;i<7;i++)
-			time_i[i] = store->time_i[i];
-		*time_d = store->time_d;
-
-		/* get heading */
-		if (mb_io_ptr->nheading > 0)
-			mb_hedint_interp(verbose, mbio_ptr, store->time_d,
-				    heading, error);
-
-		/* get speed */
-		*speed = 0.0;
-		if (mb_io_ptr->nfix > 0)
-			mb_navint_interp(verbose, mbio_ptr, store->time_d, *heading, *speed,
-				    navlon, navlat, speed, error);
-
-
-		/* get navigation - actually return the easting northing because
-			the projection is set and so the position will be inverse
-			projected */
-		*navlon = store->POS_x;
-		*navlat = store->POS_y;
-
-		/* get roll pitch and heave */
-		if (mb_io_ptr->nattitude > 0)
-			{
-			mb_attint_interp(verbose, mbio_ptr, *time_d,
-				    heave, roll, pitch, error);
-			}
-
-		/* get draft  */
-		if (mb_io_ptr->nsonardepth > 0)
-			{
-			if (mb_io_ptr->nsonardepth > 0)
-				mb_depint_interp(verbose, mbio_ptr, store->time_d,
-				    draft, error);
-			*heave = 0.0;
-			}
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-
-		/* get time */
-		for (i=0;i<7;i++)
-			time_i[i] = store->time_i[i];
-		*time_d = store->time_d;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-
-		/* get time */
-		for (i=0;i<7;i++)
-			time_i[i] = store->time_i[i];
-		*time_d = store->time_d;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:          %d\n",*kind);
-		fprintf(stderr,"dbg2       time_i[0]:     %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:     %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:     %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:     %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:     %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:     %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:     %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:        %f\n",*time_d);
-		fprintf(stderr,"dbg2       longitude:     %f\n",*navlon);
-		fprintf(stderr,"dbg2       latitude:      %f\n",*navlat);
-		fprintf(stderr,"dbg2       speed:         %f\n",*speed);
-		fprintf(stderr,"dbg2       heading:       %f\n",*heading);
-		fprintf(stderr,"dbg2       draft:         %f\n",*draft);
-		fprintf(stderr,"dbg2       roll:          %f\n",*roll);
-		fprintf(stderr,"dbg2       pitch:         %f\n",*pitch);
-		fprintf(stderr,"dbg2       heave:         %f\n",*heave);
-		fprintf(stderr,"dbg2       error:         %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:        %d\n",status);
-		}
-/*if (status == MB_SUCCESS)
-fprintf(stderr,"%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d %f %f %f %f %f %f %f %f\n",
-time_i[0],time_i[1],time_i[2],time_i[3],time_i[4],time_i[5],time_i[6],
-*navlon,*navlat,*speed,*heading,*draft,*roll,*pitch,*heave);*/
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_hysweep_insert_nav(int verbose, void *mbio_ptr, void *store_ptr,
-		int time_i[7], double time_d,
-		double navlon, double navlat,
-		double speed, double heading, double draft,
-		double roll, double pitch, double heave,
-		int *error)
-{
-	char	*function_name = "mbsys_hysweep_insert_nav";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_hysweep_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       time_i[0]:  %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:  %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:  %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:  %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:  %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:  %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:  %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:     %f\n",time_d);
-		fprintf(stderr,"dbg2       navlon:     %f\n",navlon);
-		fprintf(stderr,"dbg2       navlat:     %f\n",navlat);
-		fprintf(stderr,"dbg2       speed:      %f\n",speed);
-		fprintf(stderr,"dbg2       heading:    %f\n",heading);
-		fprintf(stderr,"dbg2       draft:      %f\n",draft);
-		fprintf(stderr,"dbg2       roll:       %f\n",roll);
-		fprintf(stderr,"dbg2       pitch:      %f\n",pitch);
-		fprintf(stderr,"dbg2       heave:      %f\n",heave);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_hysweep_struct *) store_ptr;
-
-	/* insert data in ping structure */
-	if (store->kind == MB_DATA_DATA)
-		{
-		/* get time */
-		for (i=0;i<7;i++)
-			store->time_i[i] = time_i[i];
-		store->time_d = time_d;
-
-		/* get navigation - actually easting northings show up here because
-			the projection is set and so the position has been
-			projected */
-		/* get navigation */
-		store->RMBint_x = navlon;
-		store->RMBint_y = navlat;
-		mb_proj_inverse(verbose, mb_io_ptr->pjptr, navlon, navlat,
-							&(store->RMBint_lon), &(store->RMBint_lat),
-							error);
-
-		/* get heading */
-		store->RMBint_heading = heading;
-
-		/* get speed  */
-
-		/* get draft  */
-		store->RMBint_draft = draft;
-
-		/* get roll pitch and heave */
-		store->RMBint_heave = heave;
-		store->RMBint_pitch = pitch;
-		store->RMBint_roll = roll;
-		}
-
-	/* insert data in nav structure */
-	else if (store->kind == MB_DATA_NAV
-		|| store->kind == MB_DATA_NAV1
-		|| store->kind == MB_DATA_NAV2)
-		{
-		/* get time */
-		for (i=0;i<7;i++)
-			store->time_i[i] = time_i[i];
-		store->time_d = time_d;
-
-		/* get navigation - actually easting northings show up here because
-			the projection is set and so the position has been
-			projected */
-		store->POS_x = navlon;
-		store->POS_y = navlat;
-
-		/* get heading */
-
-		/* get speed  */
-
-		/* get draft  */
-
-		/* get roll pitch and heave */
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_hysweep_copy(int verbose, void *mbio_ptr,
-			void *store_ptr, void *copy_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_hysweep_copy";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_hysweep_struct *store;
-	struct mbsys_hysweep_struct *copy;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       copy_ptr:   %p\n",(void *)copy_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointers */
-	store = (struct mbsys_hysweep_struct *) store_ptr;
-	copy = (struct mbsys_hysweep_struct *) copy_ptr;
-
-	/* copy over structures, allocating memory where necessary */
-	(*copy) = (*store);
-	copy->RMB_beam_ranges = NULL;	/* beam ranges (survey units) */
-	copy->RMB_multi_ranges = NULL;	/* sounding point casting (survey units) (multi-transducer rangers) */
-	copy->RMB_sounding_eastings = NULL;	/* easting positions of soundings */
-	copy->RMB_sounding_northings = NULL;/* northing positions of soundings */
-	copy->RMB_sounding_depths = NULL;	/* corrected depths of soundings */
-	copy->RMB_sounding_across = NULL;	/* acrosstrack positions of soundings */
-	copy->RMB_sounding_along = NULL;	/* alongtrack positions of soundings */
-	copy->RMB_sounding_pitchangles = NULL;	/* beam pitch angles of soundings (degrees, TSS convention) */
-	copy->RMB_sounding_rollangles = NULL;	/* beam roll angles of soundings (degrees, TSS convention) */
-	copy->RMB_sounding_takeoffangles = NULL;	/* beam takeoff angles of soundings (degrees from vertical) */
-	copy->RMB_sounding_azimuthalangles = NULL;	/* beam azimuthal angles of soundings (degrees from forward) */
-	copy->RMB_sounding_timedelays = NULL;	/* beam delay times (milliseconds) */
-	copy->RMB_sounding_intensities = NULL;	/* beam intensities */
-	copy->RMB_sounding_quality = NULL;		/* beam quality codes (from sonar unit) */
-	copy->RMB_sounding_flags = NULL;		/* beam edit flags */
-	if (copy->RMB_num_beams > 0)
-		{
-		if (store->RMB_beam_ranges != NULL)
-		status = mb_mallocd(verbose, __FILE__, __LINE__, copy->RMB_num_beams * sizeof(double),
-					(void **)&(copy->RMB_beam_ranges), error);
-		if (store->RMB_multi_ranges != NULL)
-		status = mb_mallocd(verbose, __FILE__, __LINE__, copy->RMB_num_beams * sizeof(double),
-					(void **)&(copy->RMB_multi_ranges), error);
-		if (store->RMB_sounding_eastings != NULL)
-		status = mb_mallocd(verbose, __FILE__, __LINE__, copy->RMB_num_beams * sizeof(double),
-					(void **)&(copy->RMB_sounding_eastings), error);
-		if (store->RMB_sounding_northings != NULL)
-		status = mb_mallocd(verbose, __FILE__, __LINE__, copy->RMB_num_beams * sizeof(double),
-					(void **)&(copy->RMB_sounding_northings), error);
-		if (store->RMB_sounding_depths != NULL)
-		status = mb_mallocd(verbose, __FILE__, __LINE__, copy->RMB_num_beams * sizeof(double),
-					(void **)&(copy->RMB_sounding_depths), error);
-		if (store->RMB_sounding_across != NULL)
-		status = mb_mallocd(verbose, __FILE__, __LINE__, copy->RMB_num_beams * sizeof(double),
-					(void **)&(copy->RMB_sounding_across), error);
-		if (store->RMB_sounding_along != NULL)
-		status = mb_mallocd(verbose, __FILE__, __LINE__, copy->RMB_num_beams * sizeof(double),
-					(void **)&(copy->RMB_sounding_along), error);
-		if (store->RMB_sounding_pitchangles != NULL)
-		status = mb_mallocd(verbose, __FILE__, __LINE__, copy->RMB_num_beams * sizeof(double),
-					(void **)&(copy->RMB_sounding_pitchangles), error);
-		if (store->RMB_sounding_rollangles != NULL)
-		status = mb_mallocd(verbose, __FILE__, __LINE__, copy->RMB_num_beams * sizeof(double),
-					(void **)&(copy->RMB_sounding_rollangles), error);
-		if (store->RMB_sounding_takeoffangles != NULL)
-		status = mb_mallocd(verbose, __FILE__, __LINE__, copy->RMB_num_beams * sizeof(double),
-					(void **)&(copy->RMB_sounding_takeoffangles), error);
-		if (store->RMB_sounding_azimuthalangles != NULL)
-		status = mb_mallocd(verbose, __FILE__, __LINE__, copy->RMB_num_beams * sizeof(double),
-					(void **)&(copy->RMB_sounding_azimuthalangles), error);
-		if (store->RMB_sounding_timedelays != NULL)
-		status = mb_mallocd(verbose, __FILE__, __LINE__, copy->RMB_num_beams * sizeof(int),
-					(void **)&(copy->RMB_sounding_timedelays), error);
-		if (store->RMB_sounding_intensities != NULL)
-		status = mb_mallocd(verbose, __FILE__, __LINE__, copy->RMB_num_beams * sizeof(int),
-					(void **)&(copy->RMB_sounding_intensities), error);
-		if (store->RMB_sounding_quality != NULL)
-		status = mb_mallocd(verbose, __FILE__, __LINE__, copy->RMB_num_beams * sizeof(int),
-					(void **)&(copy->RMB_sounding_quality), error);
-		if (store->RMB_sounding_flags != NULL)
-		status = mb_mallocd(verbose, __FILE__, __LINE__, copy->RMB_num_beams * sizeof(int),
-					(void **)&(copy->RMB_sounding_flags), error);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_hysweep_makess(int verbose, void *mbio_ptr, void *store_ptr,
-		int pixel_size_set, double *pixel_size,
-		int swath_width_set, double *swath_width,
-		int pixel_int, int *error)
-{
-	char	*function_name = "mbsys_hysweep_makess";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_hysweep_struct *store;
-	int	nbathsort;
-	double  pixel_size_calc;
-	double	ss_spacing;
-	int	iminxtrack;
-	double	minxtrack;
-	double	maxxtrack;
-	int	nrangetable;
-	double	acrosstracktablemin;
-	int	irangenadir, irange;
-	int	found;
-	int	pixel_int_use;
-	int	sample_start, sample_end;
-	double	xtrackss, ltrackss, factor;
-	double	range;
-	int	first, last, k1, k2;
-	int	i, j, k, kk;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:         %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:        %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:       %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       pixel_size_set:  %d\n",pixel_size_set);
-		fprintf(stderr,"dbg2       pixel_size:      %f\n",*pixel_size);
-		fprintf(stderr,"dbg2       swath_width_set: %d\n",swath_width_set);
-		fprintf(stderr,"dbg2       swath_width:     %f\n",*swath_width);
-		fprintf(stderr,"dbg2       pixel_int:       %d\n",pixel_int);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_hysweep_struct *) store_ptr;
-
-	/* generate processed sidescan if multibeam and sidescan records both exist */
-	if (store->RMB_ping_number > 0
-		&& (store->RMB_ping_number == store->RSS_ping_number
-			|| store->RMB_ping_number == 10 * store->RSS_ping_number))
-		{
-		/* allocate working arrays as needed */
-		if (store->MSS_table_num_alloc < store->RMB_num_beams)
-			{
-			status = mb_reallocd(verbose, __FILE__, __LINE__, store->RMB_num_beams * sizeof(double),
-						(void **)&(store->MSS_table_altitude_sort), error);
-			status = mb_reallocd(verbose, __FILE__, __LINE__, store->RMB_num_beams * sizeof(double),
-						(void **)&(store->MSS_table_range), error);
-			status = mb_reallocd(verbose, __FILE__, __LINE__, store->RMB_num_beams * sizeof(double),
-						(void **)&(store->MSS_table_acrosstrack), error);
-			status = mb_reallocd(verbose, __FILE__, __LINE__, store->RMB_num_beams * sizeof(double),
-						(void **)&(store->MSS_table_alongtrack), error);
-			if (status == MB_SUCCESS)
-				store->MSS_table_num_alloc = store->RMB_num_beams;
-			}
-
-		/* set basic parameters */
-		store->MSS_device_number = store->RSS_device_number;
-		store->MSS_time = store->RSS_time;
-		store->MSS_sound_velocity = store->RSS_sound_velocity;
-		store->MSS_ping_number = store->RSS_ping_number;
-
-		/* get raw pixel size */
-		ss_spacing = 0.5 * store->RSS_sound_velocity / store->RSS_sample_rate;
-
-		/* get median depth relative to the sonar and check for min max xtrack */
-		nbathsort = 0;
-		minxtrack = 0.0;
-		maxxtrack = 0.0;
-		iminxtrack = store->RMB_num_beams / 2;
-		found = MB_NO;
-		for (i=0;i<store->RMB_num_beams;i++)
-			{
-			if (mb_beam_ok(store->RMB_sounding_flags[i]))
-				{
-				store->MSS_table_altitude_sort[nbathsort] = store->RMB_sounding_depths[i]
-										- store->RMBint_draft
-										+ store->RMBint_heave;
-				nbathsort++;
-
-				if (found == MB_NO || fabs(store->RMB_sounding_across[i] < minxtrack))
-					{
-					minxtrack = fabs(store->RMB_sounding_across[i]);
-					iminxtrack = i;
-					found = MB_YES;
-					}
-
-				maxxtrack = MAX(fabs(store->RMB_sounding_across[i]), maxxtrack);
-				}
-			}
-		if (nbathsort > 0)
-			qsort((char *)store->MSS_table_altitude_sort, nbathsort, sizeof(double), mb_double_compare);
-
-		/* set number of pixels */
-		store->MSS_num_pixels = MBSYS_HYSWEEP_MSS_NUM_PIXELS;
-
-		/* get sidescan swath width and pixel size */
-		if (swath_width_set == MB_NO && store->RMB_num_beams > 0)
-			{
-			(*swath_width) = MAX(fabs(store->RMB_sounding_rollangles[0]),
-					fabs(store->RMB_sounding_rollangles[store->RMB_num_beams-1]));
-			}
-		if (pixel_size_set == MB_NO
-		    && nbathsort > 0)
-			{
-			/* calculate pixel size implied using swath width and nadir altitude */
-			pixel_size_calc = 2.1 * tan(DTR * (*swath_width)) * store->MSS_table_altitude_sort[nbathsort/2]
-										/ store->MSS_num_pixels;
-
-			/* use pixel size based on actual swath width if that is larger than the first value */
-			pixel_size_calc = MAX(pixel_size_calc, 2.1 * maxxtrack / store->MSS_num_pixels);
-
-			/* make sure the pixel size is at least equivalent to a 0.1 degree nadir beamwidth */
-			pixel_size_calc = MAX(pixel_size_calc, store->MSS_table_altitude_sort[nbathsort/2] * sin(DTR * 0.1));
-
-			/* if the pixel size appears to be changing in size, moderate the change */
-			if ((*pixel_size) <= 0.0)
-				(*pixel_size) = pixel_size_calc;
-			else if (0.95 * (*pixel_size) > pixel_size_calc)
-				(*pixel_size) = 0.95 * (*pixel_size);
-			else if (1.05 * (*pixel_size) < pixel_size_calc)
-				(*pixel_size) = 1.05 * (*pixel_size);
-			else
-				(*pixel_size) = pixel_size_calc;
-			}
-		store->MSS_pixel_size = *pixel_size;
-
-		/* get pixel interpolation */
-		pixel_int_use = pixel_int + 1;
-
-		/* zero the sidescan */
-		for (i=0;i<store->MSS_num_pixels;i++)
-			{
-			store->MSS_ss[i] = 0.0;
-			store->MSS_ss_across[i] = 0.0;
-			store->MSS_ss_along[i] = 0.0;
-			store->MSS_ss_cnt[i] = 0;
-			}
-		for (i=0;i<store->MSS_num_pixels;i++)
-			{
-			store->MSS_ss_across[i] = (*pixel_size) * (double)(i - (store->MSS_num_pixels / 2));;
-			}
-
-/* fprintf(stderr,"pixel_size:%f swath_width:%f altitude:%f\n",*pixel_size,*swath_width,
-store->MSS_table_altitude_sort[nbathsort/2]); */
-
-		/* loop over raw sidescan putting each raw sample into the binning arrays */
-		/* get acrosstrack distance versus range table from bathymetry */
-		nrangetable = 0;
-		irangenadir = 0;
-		acrosstracktablemin = 99999.99;
-		for (i=0;i<store->RMB_num_beams;i++)
-			{
-			if (mb_beam_ok(store->RMB_sounding_flags[i]))
-				{
-				store->MSS_table_range[nrangetable] = 2.0 * store->RMB_beam_ranges[i]
-									/ store->RSS_sound_velocity;
-				store->MSS_table_acrosstrack[nrangetable] = store->RMB_sounding_across[i];
-				store->MSS_table_alongtrack[nrangetable] = store->RMB_sounding_along[i];
-				if (nrangetable == 0
-					|| fabs(store->MSS_table_acrosstrack[nrangetable])
-						< acrosstracktablemin)
-					{
-					irangenadir = nrangetable;
-					acrosstracktablemin = fabs(store->MSS_table_acrosstrack[nrangetable]);
-					}
-				nrangetable++;
-				}
-			}
-
-		/* lay out port side */
-		sample_start = store->MSS_table_range[irangenadir] * store->RSS_sample_rate;
-		sample_end = MIN(store->MSS_table_range[0] * store->RSS_sample_rate,
-					store->RSS_port_num_samples - 1);
-		irange = irangenadir;
-/* fprintf(stderr,"Port: irangenadir:%d sample_start:%d sample_end:%d\n",irangenadir,sample_start, sample_end); */
-		for (i=sample_start;i<sample_end;i++)
-			{
-			range = ((double)i) / ((double)store->RSS_sample_rate);
-			found = MB_NO;
-			for (j=irange;j>0 && found == MB_NO;j--)
-				{
-				if (range >= store->MSS_table_range[j] && range < store->MSS_table_range[j-1])
-					{
-					irange = j;
-					found = MB_YES;
-					}
-				}
-			factor = (range - store->MSS_table_range[irange])
-						/ (store->MSS_table_range[irange-1] - store->MSS_table_range[irange]);
-			xtrackss = store->MSS_table_acrosstrack[irange]
-					+ factor * (store->MSS_table_acrosstrack[irange-1] - store->MSS_table_acrosstrack[irange]);
-			ltrackss = store->MSS_table_alongtrack[irange]
-					+ factor * (store->MSS_table_alongtrack[irange-1] - store->MSS_table_alongtrack[irange]);
-			kk = store->MSS_num_pixels / 2 + (int)(xtrackss / (*pixel_size));
-			if (kk >= 0 && kk < store->MSS_num_pixels)
-				{
-				store->MSS_ss[kk]  += (double) store->RSS_port[i];
-				store->MSS_ss_along[kk] += ltrackss;
-				store->MSS_ss_cnt[kk]++;
-				}
-			}
-
-		/* lay out starboard side */
-		sample_start = store->MSS_table_range[irangenadir] * store->RSS_sample_rate;
-		sample_end = MIN(store->MSS_table_range[nrangetable-1] * store->RSS_sample_rate,
-					store->RSS_starboard_num_samples - 1);
-		irange = irangenadir;
-/* fprintf(stderr,"Starboard: irangenadir:%d sample_start:%d sample_end:%d\n",irangenadir,sample_start, sample_end); */
-		for (i=sample_start;i<sample_end;i++)
-			{
-			range = ((double)i) / ((double)store->RSS_sample_rate);
-			found = MB_NO;
-			for (j=irange;j<nrangetable-1 && found == MB_NO;j++)
-				{
-				if (range >= store->MSS_table_range[j] && range < store->MSS_table_range[j+1])
-					{
-					irange = j;
-					found = MB_YES;
-					}
-				}
-			factor = (range - store->MSS_table_range[irange])
-						/ (store->MSS_table_range[irange+1] - store->MSS_table_range[irange]);
-			xtrackss = store->MSS_table_acrosstrack[irange]
-					+ factor * (store->MSS_table_acrosstrack[irange+1] - store->MSS_table_acrosstrack[irange]);
-			ltrackss = store->MSS_table_alongtrack[irange]
-					+ factor * (store->MSS_table_alongtrack[irange+1] - store->MSS_table_alongtrack[irange]);
-			kk = store->MSS_num_pixels / 2 + (int)(xtrackss / (*pixel_size));
-			if (kk >= 0 && kk < store->MSS_num_pixels)
-				{
-				store->MSS_ss[kk]  += (double) store->RSS_starboard[i];
-				store->MSS_ss_along[kk] += ltrackss;
-				store->MSS_ss_cnt[kk]++;
-				}
-			}
-
-		/* average the sidescan */
-		first = store->MSS_num_pixels;
-		last = -1;
-		for (k=0;k<store->MSS_num_pixels;k++)
-			{
-			if (store->MSS_ss_cnt[k] > 0)
-				{
-				store->MSS_ss[k] /= store->MSS_ss_cnt[k];
-				store->MSS_ss_along[k] /= store->MSS_ss_cnt[k];
-				first = MIN(first, k);
-				last = k;
-				}
-			else
-				store->MSS_ss[k] = MB_SIDESCAN_NULL;
-			}
-
-		/* interpolate the sidescan */
-		k1 = first;
-		k2 = first;
-		for (k=first+1;k<last;k++)
-			{
-			if (store->MSS_ss_cnt[k] <= 0)
-				{
-				if (k2 <= k)
-					{
-					k2 = k+1;
-					while (store->MSS_ss_cnt[k2] <= 0 && k2 < last)
-					    k2++;
-					}
-				if (k2 - k1 <= pixel_int_use)
-					{
-					store->MSS_ss[k] = store->MSS_ss[k1] + (store->MSS_ss[k2] - store->MSS_ss[k1])
-						* ((double)(k - k1)) / ((double)(k2 - k1));
-					store->MSS_ss_across[k] = (k - store->MSS_num_pixels / 2) * (*pixel_size);
-					store->MSS_ss_along[k] = store->MSS_ss_along[k1]
-								+ (store->MSS_ss_along[k2] - store->MSS_ss_along[k1])
-									* ((double)(k - k1)) / ((double)(k2 - k1));
-					}
-				}
-			else
-				{
-				k1 = k;
-				 }
-			}
-
-		/* print debug statements */
-		if (verbose >= 2)
-			{
-			fprintf(stderr,"\ndbg2  Sidescan regenerated in <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg2       pixels_ss:  %d\n", store->MSS_num_pixels);
-			for (i=0;i<store->MSS_num_pixels;i++)
-			  fprintf(stderr,"dbg2       pixel:%4d  cnt:%3d  ss:%10f  xtrack:%10f  ltrack:%10f\n",
-				i,store->MSS_ss_cnt[i],store->MSS_ss[i],
-				store->MSS_ss_across[i],
-				store->MSS_ss_along[i]);
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       pixel_size:      %f\n",*pixel_size);
-		fprintf(stderr,"dbg2       swath_width:     %f\n",*swath_width);
-		fprintf(stderr,"dbg2       error:           %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:          %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mbsys_hysweep.h b/src/mbio/mbsys_hysweep.h
deleted file mode 100644
index 8776bd1..0000000
--- a/src/mbio/mbsys_hysweep.h
+++ /dev/null
@@ -1,917 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbsys_hysweep.h	12/23/2011
- *	$Id: mbsys_hysweep.h 2247 2015-05-29 21:28:28Z caress $
- *
- *    Copyright (c) 2011-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * This header file mbsys_hysweep.h defines the data structures used by
- * MBIO functions to store data multibeam sonar systems logged using
- * HYSWEEP software by HYPACK Inc.
- *
- * The data format associated with this representation is:
- *      MBF_HYSWEEP1 : MBIO ID 201
- *
- * Author:	D. W. Caress (MBARI)
- * Date:	December 23, 2011
- *
- *
- */
-/*
- * Notes on the MBSYS_HYSWEEP HYPACK and HYSWEEP data:
- *   1. The raw HYPACK and HYSWEEP data formats are associated with HYPACK software
- *      from Hypack Inc. of Middletown, CT, USA, formally known as Coastal
- *      Oceanographics. The raw format produced by the Hypack dataloggers
- *      is constructed of pure ASCII text.
- *
- *      The following information is take more or less verbatim from the
- *	2010 HSX format specification.
- *
- *	Coastal Oceanographics, Inc.
- *	Technical Note:
- *	HSX Format - Hysweep Text (ASCII) Logging
- *	Hysweep survey has a Text logging option (HSX format), allowing raw data
- *	to be stored in a format that can be inspected and modified by most
- *	editing program (Windows Wordpad for example). Easy inspection of files
- *	is the advantage of text logging - the disadvantage is larger files and
- *	slower load time. If file size and load time are important to you, it is
- *	best to choose the Hysweep binary format (HS2).
- *
- *	HSX files are generally compatible with Hypack Survey raw format, allowing
- *	Hypack programs (Hypack Max, Hyplot, etc.) to work with HSX files. The
- *	differences involve logging and processing of multibeam data, which is
- *	by the Hysweep extensions to Hypack.
- *
- *	Each file contains two sections; a header, which is written when data
- *	logging starts, and a data section, which is written as data is collected.
- *	Most records starts with a three character tag.
- *
- *	Header Tags:
- *	DEV	Hypack Device Information
- *	DV2	Hysweep Device Information
- *	EOH	End of Header
- *	EOL	End of Planned Line
- *	FTP	File Type (Hypack File Identifier)
- *	HSP	Hysweep Survey Parameters
- *	HSX	HSX File Identifier
- *	HVF	Hysweep View Filters
- *	INF	General Information
- *	LBP	Planned Line Begin Point
- *	LIN	Planned Line Data follows
- *	LNN	Planned Line Name
- *	MBI	Multibeam / Multiple Transducer Device information
- *	0F2	Hysweep Device Offsets
- *	PRI	Primary Navigation Device
- *	PTS	Planned Line Waypoint
- *	SSI	Sidescan Device Information
- *	SVC	Sound Velocity Correction
- *	TND	Survey Time and Date
- *	PRJ	Projected coordinate system - MB-System extension
- *
- *	Data Tags:
- *	DFT	Dynamic Draft (Squat) Correction
- *	FIX	Fix (Event) Mark
- *	HCP	Heave Compensation
- *	EC1	Echo Sounding (single frequency)
- *	GPS	GPS Measurements
- *	GYR	Gyro Data (Heading)
- *	POS	Position
- *	PSA	Pitch Stabilization Angle.
- *	RMB	Raw Multibeam data
- *	RSS	Raw Sidescan data
- *	SNR	Sonar Runtime Settings
- *	TID	Tide Correction
- *	COM	Comment - MB-System extension
- *	PRJ	Projected coordinate system definition for eastings and
- *	            northings in file - MB-System extension
- *	MSS	Sidescan laid out on seafloor - MB-System extension
- *
- */
-
-/* HYSWEEP record type */
-#define MBSYS_HYSWEEP_RECORDTYPE_NONE	0	/* No record */
-#define MBSYS_HYSWEEP_RECORDTYPE_DEV	1
-#define MBSYS_HYSWEEP_RECORDTYPE_DV2	2
-#define MBSYS_HYSWEEP_RECORDTYPE_EOH	3
-#define MBSYS_HYSWEEP_RECORDTYPE_EOL	4
-#define MBSYS_HYSWEEP_RECORDTYPE_FTP	5
-#define MBSYS_HYSWEEP_RECORDTYPE_HSP	6
-#define MBSYS_HYSWEEP_RECORDTYPE_HSX	7
-#define MBSYS_HYSWEEP_RECORDTYPE_HVF	8
-#define MBSYS_HYSWEEP_RECORDTYPE_INF	9
-#define MBSYS_HYSWEEP_RECORDTYPE_LBP	11
-#define MBSYS_HYSWEEP_RECORDTYPE_LIN	12
-#define MBSYS_HYSWEEP_RECORDTYPE_LNN	13
-#define MBSYS_HYSWEEP_RECORDTYPE_MBI	14
-#define MBSYS_HYSWEEP_RECORDTYPE_OF2	15
-#define MBSYS_HYSWEEP_RECORDTYPE_PRI	16
-#define MBSYS_HYSWEEP_RECORDTYPE_PTS	17
-#define MBSYS_HYSWEEP_RECORDTYPE_SSI	18
-#define MBSYS_HYSWEEP_RECORDTYPE_SVC	19
-#define MBSYS_HYSWEEP_RECORDTYPE_TND	20
-#define MBSYS_HYSWEEP_RECORDTYPE_DFT	21
-#define MBSYS_HYSWEEP_RECORDTYPE_FIX	22
-#define MBSYS_HYSWEEP_RECORDTYPE_HCP	23
-#define MBSYS_HYSWEEP_RECORDTYPE_EC1	24
-#define MBSYS_HYSWEEP_RECORDTYPE_GPS	25
-#define MBSYS_HYSWEEP_RECORDTYPE_GYR	26
-#define MBSYS_HYSWEEP_RECORDTYPE_POS	27
-#define MBSYS_HYSWEEP_RECORDTYPE_PSA	28
-#define MBSYS_HYSWEEP_RECORDTYPE_RMB	29
-#define MBSYS_HYSWEEP_RECORDTYPE_RSS	30
-#define MBSYS_HYSWEEP_RECORDTYPE_SNR	31
-#define MBSYS_HYSWEEP_RECORDTYPE_TID	32
-#define MBSYS_HYSWEEP_RECORDTYPE_VER	33
-#define MBSYS_HYSWEEP_RECORDTYPE_COM	101
-#define MBSYS_HYSWEEP_RECORDTYPE_PRJ	102
-#define MBSYS_HYSWEEP_RECORDTYPE_MSS	103
-
-/* sonar types */
-#define	MBSYS_HYSWEEP_SONAR_UNKNOWN			0	/* *Not Specified - 0 */
-#define	MBSYS_HYSWEEP_SONAR_RESON_SEABAT8101_150	1	/* Reson Seabat 8101 - 150 Deg - 1 */
-#define	MBSYS_HYSWEEP_SONAR_ATLAS_FANSWEEP20		2	/* Atlas Fansweep 20 - 2 */
-#define	MBSYS_HYSWEEP_SONAR_BENTHOS_C3D			3	/* Benthos C3D - 3 */
-#define	MBSYS_HYSWEEP_SONAR_CMAX_CM2			4	/* CMAX CM-2 - 4 */
-#define	MBSYS_HYSWEEP_SONAR_EDGETECH_272		5	/* EdgeTech 272 - 5 */
-#define	MBSYS_HYSWEEP_SONAR_EDGETECH_4100		6	/* EdgeTech 4100 - 6 */
-#define	MBSYS_HYSWEEP_SONAR_EDGETECH_4125		7	/* EdgeTech 4125 - 7 */
-#define	MBSYS_HYSWEEP_SONAR_EDGETECH_4150		8	/* EdgeTech 4150 - 8 */
-#define	MBSYS_HYSWEEP_SONAR_EDGETECH_4200		9	/* EdgeTech 4200 - 9 */
-#define	MBSYS_HYSWEEP_SONAR_EDGETECH_4300		10	/* EdgeTech 4300 - 10 */
-#define	MBSYS_HYSWEEP_SONAR_GEOACOUSTICS_GEOSWATH	11	/* GeoAcoustics GeoSwath - 11 */
-#define	MBSYS_HYSWEEP_SONAR_IMAGENEX_SPORTSCAN		12	/* Imagenex Sportscan - 12 */
-#define	MBSYS_HYSWEEP_SONAR_IMAGENEX_YELLOWFIN		13	/* Imagenex Yellowfin - 13 */
-#define	MBSYS_HYSWEEP_SONAR_KLEIN_595			14	/* Klein 595 - 14 */
-#define	MBSYS_HYSWEEP_SONAR_KLEIN_2000			15	/* Klein 2000 - 15 */
-#define	MBSYS_HYSWEEP_SONAR_KLEIN_3000			16	/* Klein 3000 - 16 */
-#define	MBSYS_HYSWEEP_SONAR_KLEIN_3900			17	/* Klein 3900 - 17 */
-#define	MBSYS_HYSWEEP_SONAR_KLEIN_5000			18	/* Klein 5000 - 18 */
-#define	MBSYS_HYSWEEP_SONAR_ODOM_CV3			19	/* Odom CV3 - 19 */
-#define	MBSYS_HYSWEEP_SONAR_ODOM_ECHOSCAN2		20	/* Odom Echoscan 2 - 20 */
-#define	MBSYS_HYSWEEP_SONAR_ODOM_ES3			21	/* Odom ES3 - 21 */
-#define	MBSYS_HYSWEEP_SONAR_RESON_SEABAT7125		22	/* Reson Seabat 7125 - 22 */
-#define	MBSYS_HYSWEEP_SONAR_RESON_SEABAT8111		23	/* Reson Seabat 8111 - 23 */
-#define	MBSYS_HYSWEEP_SONAR_RESON_SEABAT8124		24	/* Reson Seabat 8124 - 24 */
-#define	MBSYS_HYSWEEP_SONAR_RESON_SEABAT8125		25	/* Reson Seabat 8125 - 25 */
-#define	MBSYS_HYSWEEP_SONAR_RESON_SEABAT9001		26	/* Reson Seabat 9001 - 26 */
-#define	MBSYS_HYSWEEP_SONAR_RESON_SEABAT9003		27	/* Reson Seabat 9003 - 27 */
-#define	MBSYS_HYSWEEP_SONAR_SEA_SWATHPLUS		28	/* SEA Swathplus - 28 */
-#define	MBSYS_HYSWEEP_SONAR_SEABEAM_2100		29	/* Seabeam 2100 - 29 */
-#define	MBSYS_HYSWEEP_SONAR_SEABEAM_1185		30	/* Seabeam SB1185 - 30 */
-#define	MBSYS_HYSWEEP_SONAR_SIMRAD_EA400		31	/* Simrad EA400 - 31 */
-#define	MBSYS_HYSWEEP_SONAR_SIMRAD_EM102		32	/* Simrad EM102 - 32 */
-#define	MBSYS_HYSWEEP_SONAR_SIMRAD_EM1002		33	/* Simrad EM1002 - 33 */
-#define	MBSYS_HYSWEEP_SONAR_SIMRAD_EM2000		34	/* Simrad EM2000 - 34 */
-#define	MBSYS_HYSWEEP_SONAR_SIMRAD_EM3000		35	/* Simrad EM3000 - 35 */
-#define	MBSYS_HYSWEEP_SONAR_SIMRAD_EM3000D		36	/* Simrad EM3000D - 36 */
-#define	MBSYS_HYSWEEP_SONAR_SIMRAD_EM3002		37	/* Simrad EM3002 - 37 */
-#define	MBSYS_HYSWEEP_SONAR_SIMRAD_EM3002D		38	/* Simrad EM3002D - 38 */
-#define	MBSYS_HYSWEEP_SONAR_RESON_SEABAT8101_210	39	/* Reson Seabat 8101 - 210 Deg - 39 */
-#define	MBSYS_HYSWEEP_SONAR_IMAGENEX_DELTAT		40	/* Imagenex Delta T - 40 */
-#define	MBSYS_HYSWEEP_SONAR_ATLAS_HYDROSWEEPMD2		41	/* Atlas Hydrosweep MD2 - 41 */
-#define	MBSYS_HYSWEEP_SONAR_SIMRAD_SM2000		42	/* Simrad SM2000 - 42 */
-#define	MBSYS_HYSWEEP_SONAR_SIMRAD_EM710		43	/* Simrad EM710 - 43 */
-#define	MBSYS_HYSWEEP_SONAR_SIMRAD_EM302		44	/* Simrad EM302 - 44 */
-#define	MBSYS_HYSWEEP_SONAR_BLUEVIEW_MB1350_45		45	/* Blueview MB1350-45 - 45 */
-#define	MBSYS_HYSWEEP_SONAR_BLUEVIEW_MB2250_45		46	/* Blueview MB2250-45 - 46 */
-#define	MBSYS_HYSWEEP_SONAR_BLUEVIEW_MB1350_90		47	/* Blueview MB1350-90 - 47 */
-#define	MBSYS_HYSWEEP_SONAR_BLUEVIEW_MB2250_90		48	/* Blueview MB2250-90 - 48 */
-#define	MBSYS_HYSWEEP_SONAR_GEOACOUSTICS_DSS		49	/* Geoacoustics digital sidescan - 49 */
-#define	MBSYS_HYSWEEP_SONAR_BENTHOS_1624		50	/* Benthos 1624 - 50 */
-#define	MBSYS_HYSWEEP_SONAR_BENTHOS_1625		51	/* Benthos 1625 - 51 */
-#define	MBSYS_HYSWEEP_SONAR_MARINESONIC_SEASCAN		52	/* Marine Sonic Sea Scan - 52 */
-#define	MBSYS_HYSWEEP_SONAR_RESON_7101			53	/* Reson Seabat 7101 - 53 */
-#define	MBSYS_HYSWEEP_SONAR_FURUNO_HS300F		54	/* Furuno HS-300F - 54 */
-#define	MBSYS_HYSWEEP_SONAR_FURUNO_HS600		55	/* Furuno HS-600 - 55 */
-#define	MBSYS_HYSWEEP_SONAR_FURUNO_HS600F		56	/* Furuno HS-600F - 56 */
-#define	MBSYS_HYSWEEP_SONAR_TRITECH_STARFISH		57	/* Tritech Starfish - 57 */
-#define	MBSYS_HYSWEEP_SONAR_RESON_8150			58	/* Reson 8150 - 58 */
-#define	MBSYS_HYSWEEP_SONAR_RESON_8160			59	/* Reson 8160 - 59 */
-#define	MBSYS_HYSWEEP_SONAR_RESON_7150			60	/* Reson 7150 - 60 */
-#define	MBSYS_HYSWEEP_SONAR_EDGETECH_4600		61	/* Edgetech 4600 - 61 */
-#define	MBSYS_HYSWEEP_SONAR_RESON_7111			62	/* Reson Seabat 7111 - 62 */
-#define	MBSYS_HYSWEEP_SONAR_R2SONIC_SONIC2024		63	/* R2Sonic SONIC 2024 - 63 */
-#define	MBSYS_HYSWEEP_SONAR_MDL_DYNASCAN		64	/* MDL Dynascan - 64 */
-#define	MBSYS_HYSWEEP_SONAR_WASSP_MULTIBEAM		65	/* WASSP Multibeam - 65 */
-#define	MBSYS_HYSWEEP_SONAR_ATLAS_HYDROSWEEPMD50	66	/* Atlas Hydrosweep  MD/50 - 66 */
-#define	MBSYS_HYSWEEP_SONAR_ATLAS_HYDROSWEEPMD30	67	/* Atlas Hydrosweep  MD/30 - 67 */
-#define	MBSYS_HYSWEEP_SONAR_ATLAS_HYDROSWEEPDS		68	/* Atlas Hydrosweep  DS - 68 */
-#define	MBSYS_HYSWEEP_SONAR_INNOMAR_SES			69	/* Innomar SES - 69 */
-#define	MBSYS_HYSWEEP_SONAR_SEABEAM_3012		70	/* SeaBeam 3012 - 70 */
-#define	MBSYS_HYSWEEP_SONAR_SEABEAM_3020		71	/* SeaBeam 3020 - 71 */
-#define	MBSYS_HYSWEEP_SONAR_SEABEAM_3050		72	/* SeaBeam 3050 - 72 */
-
-#define	MBSYS_HYSWEEP_DEVICE_NUM_MAX	12
-#define	MBSYS_HYSWEEP_OFFSET_NUM_MAX	12
-
-#define MBSYS_HYSWEEP_MSS_NUM_PIXELS    1024
-#define	MBSYS_HYSWEEP_MAXLINE	        32768
-
-/* HYSWEEP device offset structure */
-struct mbsys_hysweep_device_offset_struct
-	{
-	/* OF2: Hysweep device offsets
-		OF2 dn on n1 n2 n3 n4 n5 n6 n7 */
-	int	OF2_device_number;	/* device number */
-	int	OF2_offset_type;	/* offset type
-						0 - position antenna offsets
-						1 - gyro heading offset
-						2 - MRU device offsets
-						3 - sonar head 1 / transducer 1 offsets
-						4 - sonar head 2 / transducer 2 offsets
-						........
-						131 - transducer 128 offsets */
-	double	OF2_offset_starboard;	/* starboard/port mounting offset, positive to starboard */
-	double	OF2_offset_forward;	/* forward/aft mounting offset, positive to forward */
-	double	OF2_offset_vertical;	/* vertical mounting offset, positive downward from waterline */
-	double	OF2_offset_yaw;		/* yaw rotation angle, positive for clockwise rotation */
-	double	OF2_offset_roll;	/* roll rotation angle, port side up is positive */
-	double	OF2_offset_pitch;	/* pitch rotation angle, bow up is positive */
-	double	OF2_offset_time;	/* time latency in seconds */
-	};
-
-/* HYSWEEP device structure */
-struct mbsys_hysweep_device_struct
-	{
-	/* DEV: first line of device declaration
-		DEV dn dc "name"
-		DEV 0 544 "IXSEA OCTANS Serial" */
-	int	DEV_device_number;
-	int	DEV_device_capability;	/* Hypack device capabilities (bit code)
-						1 - device provides range/range position
-						2 - device provides range/azimuth position
-						4 - device provides lat/long (e.g. GPS)
-						8 - device provides grid positions XY
-						16 - device provides echo soundings
-						32 - device provides heading
-						64 - device provides ship speed
-						128 - Hypack clock is synched to device clock
-						256 - device provides tide
-						512 - device provides heave, pitch, and roll
-						1024 - device is a ROV
-						2048 - device is a left/right indicator
-						4096 - device accepts annotations strings
-						8192 - device accepts output from Hypack
-						16384 - xxx
-						32768 - device has extended capability
-					NOTE: an MB-System extension to allow */
-	mb_path	DEV_device_name;		/* e.g. "GPS" */
-
-	/* DV2: second line of device declaration
-		DV2 dn dc tf en
-		DV2 0 220 0 1 */
-	int	DV2_device_capability;	/* Hysweep device capabilities (bit coded hexadecimal)
-						0001 - multibeam sonar
-						0002 - multiple transducer sonar
-						0004 - GPS (boat position)
-						0008 - sidescan sonar
-						0010 - single beam echosounder
-						0020 - gyro (boat heading)
-						0040 - tide
-						0200 - MRU (heave, pitch, and roll compensation) */
-	int	DV2_towfish;		/* 1 if device is mountedc on a tow fish */
-	int	DV2_enabled;		/* 1 if device is enabled */
-
-	/* OF2: Hysweep device offsets  */
-	int	num_offsets;		/* number of offsets identified for this device */
-	struct mbsys_hysweep_device_offset_struct offsets[MBSYS_HYSWEEP_OFFSET_NUM_MAX];
-
-	/* PRI: device set as primary navigational device */
-	int	PRI_primary_nav_device;	/* 1 if device is primary navigational device */
-
-	/* MBI: multibeam / multiple transducer device information
-		MBI dn st sf db n1 n2 fa ai */
-	int	MBI_sonar_id;		/* sonar id from table above, not part of MBI record
-						but instead inferred from device name in the
-						corresponding DEV record */
-	int	MBI_sonar_receive_shape;/* sonar receive head shape, not part of MBI record
-						but instead inferred from device name in the
-						corresponding DEV record
-						0 - flat
-						1 - circular */
-	int	MBI_sonar_type;		/* sonar type code:
-						0 - invalid
-						1 - fixed beam roll angles (e.g. Reson Seabat )
-						2 - variable beam roll angles (e.g. Seabeam SB1185)
-						3 - beam info in spherical coordinates (e.g. Simrad EM3000)
-						4 - multiple transducer (e.g. Odom Miniscan) */
-	int	MBI_sonar_flags;	/* sonar flags (bit coded hexadecimal)
-						0x0001 - roll corrected by sonar
-						0x0002 - pitch corrected by sonar
-						0x0004 - dual head
-						0x0008 - heading corrected by sonar (ver 1)
-						0x0010 - medium depth: slant ranges recorded to 1 dm
-								resolution (version 2)
-						0x0020 - deep water: slant ranges divided by 1 m
-								resolution (ver 2)
-						0x0040 - SVP corrected by sonar (ver 5)
-						0x0080 - topographic device, upgoing beams accepted (ver 6) */
-	int	MBI_beam_data_available;/* beam data (bit coded hexadecimal)
-						0x0001 - beam ranges are available (survey units)
-						0x0002 - sounding point casting available (survey units)
-						0x0004 - point northing available (survey units)
-						0x0008 - point corrected depth available (survey units)
-						0x0010 - along track distance available (survey units)
-						0x0020 - across track distance available (survey units)
-						0x0040 - beam pitch angles available (degrees, TSS convention)
-						0x0080 - beam roll angles available (degrees, TSS convention)
-						0x0100 - beam takeoff angles available (degrees from vertical)
-						0x0200 - beam direction angles available (degrees from forward)
-						0x0400 - ping delay times included (milliseconds)
-						0x0800 - beam intensity data available
-						0x1000 - beam quality codes (from sonar unit) available
-						0x2000 - sounding flags included
-						0x4000 - spare
-						0x8000 - spare */
-	int	MBI_num_beams_1;	/* number of beams, head 1 (multibeam) or number of transducers
-						(multitransducer) */
-	int	MBI_num_beams_2;	/* number of beams, head 2 (multibeam) */
-	double	MBI_first_beam_angle;	/* first beam angle is for sonar type = fixed angle
-						(degrees, TSS convention) */
-	double	MBI_angle_increment;	/* angle increment is for sonare type = fixed angle
-						(degrees, TSS convention) */
-
-	/* SSI: sidescan device information */
-	int	SSI_sonar_flags;	/* sonar flags (bit coded hexadecimal)
-						0x0100 - amplitude is bit-shifted into byte storage */
-	int	SSI_port_num_samples;	/* number of samples per ping, port transducer */
-	int	SSI_starboard_num_samples;	/* number of samples per ping, starboard transducer */
-
-	};
-
-/* internal data structure */
-struct mbsys_hysweep_struct
-	{
-	/* MBIO kind of current data record */
-	int	kind;
-
-	/* MBIO time stamp of current data record */
-	int	time_i[7];
-	double	time_d;
-
-        /* Char array used to read data */
-        char    readline[MBSYS_HYSWEEP_MAXLINE];
-        char    writeline[MBSYS_HYSWEEP_MAXLINE];
-
-	/* HYSWEEP type of current data record */
-	int	type;			/* HYSWEEP current data record type */
-
-	/* HYSWEEP file header records */
-
-	/* FTP - first record of header - file type identifier
-		Always:
-		FTP NEW 2 */
-	mb_name	FTP_record;		/* FTP NEW 2: HYSWEEP file type */
-
-	/* HSX - HSX format version
-		HSX vr
-			vr: version id
-		Example:
-		HSX 7 */
-	int	HSX_record;		/* HSX: HYSWEEP format version number
-						0: HYPACK Max 0.4 29-Mar-2000
-						1: HYPACK Max 0.5 11-Sep-2000
-						2: HYPACK Max 0.5b 18-Jun-2001
-						3: HYPACK Max 2.12A 05-Jun-2003 */
-
-	/* VER - HYSWEEP version
-		VER vr
-			vr: version string
-		Example:
-		VER 10.0.7.0 */
-	mb_name	VER_version;		/* VER: HYSWEEP distribution version */
-
-	/* TND - Survey time and date
-		TND t d
-			t: time string
-			d: date string
-		Example:
-		TND 22:21:31 11/27/2010 */
-	int	TND_survey_time_i[7];	/* TND: Survey time and date (system startup)
-						hh:mm:ss mm/dd/yy */
-	double	TND_survey_time_d;	/* TND: Survey time */
-
-	/* INF - General information
-		INF "surveyor" "boat" "project" "area" tc dc sv
-			tc: initial tide correction
-			dc: initial draft correction
-			sv: sound velocity
-		Example:
-		INF "" "" "" "" 0.00 0.00 1500.00 */
-	mb_name	INF_surveyor;		/* INF: surveyor name */
-	mb_name	INF_boat;		/* INF: boat name */
-	mb_name	INF_project;		/* INF: project name */
-	mb_name	INF_area;		/* INF: area name */
-	double	INF_tide_correction;	/* INF: initial tide correction */
-	double	INF_draft_correction;	/* INF: initial draft correction */
-	double	INF_sound_velocity;	/* INF: initial sound velocity */
-
-	/* PRJ - Projected coordinate system definition - MB-System extension
-		PRJ pr
-			pr: projection system definition string
-				- either a PROJ4 command string or an MB-System
-				projection ID enclosed in <>. For instance, the
-				UTM projection for zone 10 north can be defined using
-				any of the following examples:
-		Example:
-		PRJ <UTM10N>
-		PRJ <epsg32610>
-		PRJ +proj=utm +zone=10 +ellps=WGS84 +datum=WGS84 +units=m +no_defs */
-	mb_path	PRJ_proj4_command;	/* PRJ: projection in use defined as either
-						a PROJ4 command string or as an
-						EPSG identifier */
-
-	/* EOH - end file header records */
-
-	/* HSP - Hysweep survey parameters
-		HSP p1 p2 p3 p4 p5 p6 p7 p8 p9 p10 p11 p12
-			p1: minimum depth in work units
-			p2: maximum depth in work units
-			p3: port side offset limit
-			p4: starboard side offset limit
-			p5: port side angle limit in degrees
-			p6: starboard side angle limit in degrees
-			p7: high beam quality; codes >= this are good
-			p8: low beam quality; codes < this are bad
-			p9: sonar range setting in work units
-			p10: towfish layback in work units
-			p11: work units:
-						0: = meters
-						1 = US foot
-						2 = international footin work units
-			p12: sonar id for advanced processing (see defines above)
-		Example:
-		HSP 0.00 95.00 35.62 35.62 75 75 1 1 0.50 0.00 0 0 */
-	double	HSP_minimum_depth;	/* HSP: minimum depth in work units */
-	double	HSP_maximum_depth;	/* HSP: maximum depth in work units */
-	double	HSP_port_offset_limit;	/* HSP: port side offset limit in work units */
-	double	HSP_stbd_offset_limit;	/* HSP: starboard side offset limit in work units */
-	double	HSP_port_angle_limit;	/* HSP: port side angle limit in degrees */
-	double	HSP_stbd_angle_limit;	/* HSP: starboard side angle limit in degrees */
-	int	HSP_high_beam_quality;	/* HSP: high beam quality; codes >= this are good */
-	int	HSP_low_beam_quality;	/* HSP: low beam quality; codes < this are bad */
-	double	HSP_sonar_range;	/* HSP: sonar range setting in work units */
-	double	HSP_towfish_layback;	/* HSP: towfish layback in work units */
-	int	HSP_units;		/* HSP: work units:
-						0: = meters
-						1 = US foot
-						2 = international foot */
-	int	HSP_sonar_id;		/* HSP: sonar id for advanced processing (see defines above) */
-
-	/* HYSWEEP devices */
-	int	num_devices;		/* number of devices defined */
-	struct mbsys_hysweep_device_struct devices[MBSYS_HYSWEEP_DEVICE_NUM_MAX];
-	int	primary_nav_device;	/* device number of primary navigational device */
-
-	/* HYSWEEP HVF - Hysweep view filters - always first record after end of file header
-		HVF dn tt p1 p2 p3 p4 p5 p6
-			dn: dummy device number, always = 99
-			tt: time tag this filter set became active (in seconds past midnight)
-			p1: minimum depth in work units
-			p2: maximum depth in work units
-			p3: port side offset limit in work units
-			p4: starboard side offset limit in work units
-			p5: minimum beam angle limit, 0 to -90 degrees
-			p6: maximum beam angle limit, 0 to 90 degrees
-		Example:
-		HVF 99 80491.965 0.0 95.0 35.6 35.6 -75.0 75.0 */
-	double	HVF_time_after_midnight;	/* time this filter set became active
-							seconds after midnight */
-	double	HVF_minimum_depth;	/* minimum depth in work units */
-	double	HVF_maximum_depth;	/* maximum depth in work units */
-	double	HVF_port_offset_limit;	/* port side offset limit in work units */
-	double	HVF_starboard_offset_limit;	/* starboard side offset limit in work units */
-	double	HVF_minimum_angle_limit;	/* minimum beam angle limit, 0 to -90 degrees */
-	double	HVF_maximum_angle_limit;	/* maximum beam angle limit, 0 to 90 degrees */
-
-	/* HYSWEEP FIX - fix (event) mark - always second record after end of file header
-		HVF dn t n */
-	int	FIX_device_number;		/* device number */
-	double	FIX_time_after_midnight;	/* time in seconds after midnight */
-	int	FIX_event_number;		/* FIX event number */
-
-	/* HYSWEEP RMB - raw multibeam data
-		RMB dn t st sf bd n sv pn psa
-			dn: device number�
-			t: time tag (seconds past midnight)�
-			st: sonar type code (see MBI above)�
-			sf: sonar flags (see MBI above)�
-			bd: available beam data (see MBI above)�
-			n: number of beams to follow�
-			sv: sound�velocity in m/sec�
-			pn: ping number (or 0 if not tracked)
-
-		Immediately following the RMB record is a record containing slant ranges (multibeam)�
-		or raw depths (multiple transducer). Following the ranges are 0 to n additional records�
-		depending on the bd (beam�data) field.
-
-		Example (Seabat 9001 storing slant ranges and quality codes):�
-			RMB 1 27244.135 1 0 1001 1500.00 0 60�
-			19.50 19.31 18.60 1.66 18.47 ... (60 slant ranges in work units)�
-			3 3 3 0 3 ... (60 quality codes)
-
-		Example (multiple transducer storing 8 raw depths):�
-			RMB 1 27244.135 4 0 1 1500.00 0 60�
-			31.44 33.01 32.83 32.80 ... (8 raw depths in work units)
-
-		Example (Dual-head Seabeam SB1185 storing range, beam pitch and roll angles,�
-			ping delay times, beam quality code and sounding flags):�
-			RMB 1 27244.135 2 5 1481 1500.00 0�
-			108 93.18 88.30 84.74 80.46 ...�(108 slant ranges in working units)
-			-69.72 -68.53 -67.36 -66.15 ... (108 beam roll angles in degrees)�
-			0 0 0 67 ... (108 ping delay times in msecs)�
-			7 7 7 7 ... (108 beam quality codes) */
-	int	RMB_device_number;	/* device number */
-	double	RMB_time;		/* time tag (seconds past midnight) */
-	int	RMB_sonar_type;		/* sonar type code:
-						0 - invalid
-						1 - fixed beam roll angles (e.g. Reson Seabat )
-						2 - variable beam roll angles (e.g. Seabeam SB1185)
-						3 - beam info in spherical coordinates (e.g. Simrad EM3000)
-						4 - multiple transducer (e.g. Odom Miniscan) */
-	int	RMB_sonar_flags;	/* sonar flags (bit coded hexadecimal)
-						0x0001 - roll corrected by sonar
-						0x0002 - pitch corrected by sonar
-						0x0004 - dual head
-						0x0008 - heading corrected by sonar (ver 1)
-						0x0010 - medium depth: slant ranges recorded to 1 dm
-								resolution (version 2)
-						0x0020 - deep water: slant ranges divided by 1 m
-								resolution (ver 2)
-						0x0040 - SVP corrected by sonar (ver 5)
-						0x0080 - topographic device, upgoing beams accepted (ver 6) */
-	int	RMB_beam_data_available;/* beam data (bit coded hexadecimal)
-						0x0001 - beam ranges are available (survey units)
-						0x0002 - sounding point casting available (survey units)
-						0x0004 - point northing available (survey units)
-						0x0008 - point corrected depth available (survey units)
-						0x0010 - along track distance available (survey units)
-						0x0020 - across track distance available (survey units)
-						0x0040 - beam pitch angles available (degrees, TSS convention)
-						0x0080 - beam roll angles available (degrees, TSS convention)
-						0x0100 - beam takeoff angles available (degrees from vertical)
-						0x0200 - beam direction angles available (degrees from forward)
-						0x0400 - ping delay times included (milliseconds)
-						0x0800 - beam intensity data available
-						0x1000 - beam quality codes (from sonar unit) available
-						0x2000 - sounding flags included
-						0x4000 - spare
-						0x8000 - spare */
-	int	RMB_num_beams;		/* number of beams to follow */
-	int	RMB_num_beams_alloc;	/* number of beams allocated to non-null arrays */
-	double	RMB_sound_velocity;	/* sound velocity in m/sec */
-	int	RMB_ping_number;	/* ping number (or 0 if not tracked) */
-	double	*RMB_beam_ranges;	/* beam ranges (survey units) */
-	double	*RMB_multi_ranges;	/* sounding point casting (survey units) (multi-transducer rangers) */
-	double	*RMB_sounding_eastings;	/* easting positions of soundings */
-	double	*RMB_sounding_northings;/* northing positions of soundings */
-	double	*RMB_sounding_depths;	/* corrected depths of soundings */
-	double	*RMB_sounding_across;	/* acrosstrack positions of soundings */
-	double	*RMB_sounding_along;	/* alongtrack positions of soundings */
-	double	*RMB_sounding_pitchangles;	/* beam pitch angles of soundings (degrees, TSS convention) */
-	double	*RMB_sounding_rollangles;	/* beam roll angles of soundings (degrees, TSS convention) */
-	double	*RMB_sounding_takeoffangles;	/* beam takeoff angles of soundings (degrees from vertical) */
-	double	*RMB_sounding_azimuthalangles;	/* beam azimuthal angles of soundings (degrees from forward) */
-	int	*RMB_sounding_timedelays;	/* beam delay times (milliseconds) */
-	int	*RMB_sounding_intensities;	/* beam intensities */
-	int	*RMB_sounding_quality;		/* beam quality codes (from sonar unit) */
-	int	*RMB_sounding_flags;		/* beam edit flags */
-
-	/* Interpolated position and attitude data for multibeam ping
-		In the case of data previously handled by MB-System this
-		will derive from HCP, GYR, POS, DFT records with the same time
-		stamp as the multibeam RMB record that will be placed
-		immediately before the RMB record in the file.
-		In the case of data not previously handled by MB-System these
-		values will be extracted by interpolation at the time the
-		RMB record is read. Subsequent data writing will have the
-		interpolated records placed before the RMB records, and will
-		have the interpolated HCP, GYR, POS, and DFT records set
-		as "enabled". Any original asynchronous HCP, GYR, POS, and
-		DFT records will have the "enabled" flag unset. Four new
-		devices will be declared as well. */
-	double	RMBint_heave;		/* heave (meters) */
-	double	RMBint_roll;		/* roll (+ port side up) */
-	double	RMBint_pitch;		/* pitch (+ bow up) */
-	double	RMBint_heading;		/* heading (degrees) */
-	double	RMBint_x;		/* easting */
-	double	RMBint_y;		/* northing */
-	double	RMBint_lon;		/* longitude (degrees) */
-	double	RMBint_lat;		/* latitude (degrees) */
-	double	RMBint_draft;		/* draft correction */
-	double	RMBint_tide;		/* tide correction */
-
-	/* RSS - Raw Sidescan
-		RSS dn t sf np ns sv pn alt sr amin amax bs freq
-			dn: device number
-			t: time tag (seconds past midnight)
-			sf: sonar flags (bit coded hexadecimal)
-				0100 - amplitude is bit-shifted into byte storage
-			np: number of samples, port transducer (down-sampled to 4096 max)
-			ns: number of samples, starboard transducer (down-sampled to 4096 max)
-			sv: sound velocity in m/sec
-			pn: ping number (or 0 if not tracked)
-			alt: altitude in work units
-			sr: sample rate (samples per second after down-sample)
-			amin: amplitude minimum
-			amax: amplitude maximum
-			bs: bit shift for byte recording
-			freq: frequency 0 or 1 for simultaneous dual frequency operation
-
-		Immediately following the RSS record are two records containing port and
-		starboard amplitude samples.
-
-		Example:
-		RSS 3 61323.082 100 341 341 1460.00 0 10.75 4983.47 0 4096 4 0
-		109 97 84 95 120 111 ... (341 port samples)
-		106 93 163 106 114 127 ... (341 starboard samples) */
-	int	RSS_device_number;	/* device number */
-	double	RSS_time;		/* time tag (seconds past midnight) */
-	int	RSS_sonar_flags;	/* sonar flags:
-						0100 - amplitude is bit-shifted into byte storage */
-	int	RSS_port_num_samples; 	/* number of samples, port transducer (down-sampled to 4096 max) */
-	int	RSS_port_num_samples_alloc; 	/* number of samples, port transducer (down-sampled to 4096 max) */
-	int	RSS_starboard_num_samples; 	/* number of samples, starboard transducer
-						(down-sampled to 4096 max) */
-	int	RSS_starboard_num_samples_alloc; 	/* number of samples, starboard transducer
-						(down-sampled to 4096 max) */
-	double	RSS_sound_velocity;	/* sound velocity in m/sec  */
-	int	RSS_ping_number;	/* ping number (or 0 if not tracked) */
-	double	RSS_altitude;		/* altitude in work units  */
-	double	RSS_sample_rate;	/* sample rate (samples per second after down-sample)  */
-	int	RSS_minimum_amplitude;	/* amplitude minimum  */
-	int	RSS_maximum_amplitude;	/* amplitude maximum  */
-	int	RSS_bit_shift;		/* bit shift for byte recording  */
-	int	RSS_frequency;		/* frequency 0 or 1 for simultaneous dual frequency operation */
-	int	*RSS_port;		/* port sidescan amplitude samples */
-	int	*RSS_starboard;		/* starboard sidescan amplitude samples */
-
-        /* MSS - MB-System Sidescan
-                MSS dn t pn n ps
-			dn: device number
-			t: time tag (seconds past midnight)
-			pn: ping number (or 0 if not tracked)
-			n: number of pixels
-			ps: pixel size in meters
-
-		Immediately following the MSS record is one record containing
-		the amplitude samples. Zero samples are null values
-		indicating no data.
-
-		Example:
-		MSS 3 61323.082 1500.00 1024 0.340 27535
-		0.00 0.00 109.25 97.13 .... 95.34 120.76 111.26 0.00 (1024 samples) */
-	int	MSS_device_number;	/* device number */
-	double	MSS_time;		/* time tag (seconds past midnight) */
-	double	MSS_sound_velocity;	/* sound velocity in m/sec  */
-	int	MSS_num_pixels;	        /* number of pixels (typically 1024) */
-	double	MSS_pixel_size;	        /* pixel size (meters) */
-	int	MSS_ping_number;	/* ping number (or 0 if not tracked) */
-        double  MSS_ss[MBSYS_HYSWEEP_MSS_NUM_PIXELS];           /* processed sidescan */
-        int     MSS_ss_cnt[MBSYS_HYSWEEP_MSS_NUM_PIXELS];           /* processed sidescan */
-        double  MSS_ss_across[MBSYS_HYSWEEP_MSS_NUM_PIXELS];    /* processed sidescan acrosstrack (meters) */
-        double  MSS_ss_along[MBSYS_HYSWEEP_MSS_NUM_PIXELS];     /* processed sidescan alongtrack (meters) */
-        int     MSS_table_num_alloc;        /* sidescan working array allocated dimensions */
-        double  *MSS_table_altitude_sort;   /* sidescan working array - altitude = depth - draft + heave */
-        double  *MSS_table_range;           /* sidescan working array - range twtt (seconds) */
-        double  *MSS_table_acrosstrack;     /* sidescan working array - acrosstrack (meters) */
-        double  *MSS_table_alongtrack;      /* sidescan working array - alongtrack (meters) */
-
-	/* SNR - dynamic sonar settings
-		up to 12 fields depending on sonar type
-		SNR dn t pn sonar ns s0 --- s11
-			dn: device number�
-			t: time tag (seconds past midnight)�
-			pn: ping number (or 0 if not tracked)
-			sonar: sonar ID code (see defines above)�
-			ns: number of settings to follow
-			s: up to 12 settings
-
-		Up to 12 fields are included in SNR records, providing sonar runtime settings.
-		Not available for all systems. Defined differently depending on sonar model
-		and manufacturer.
-
-		For Seabat 81XX Serial and 81XX Network Drivers:
-			Sonar id: 1, 23, 24, 25, 39
-			P0: Sonar range setting in meters.
-			P1: power setting, 0 - 8
-			P2: gain setting, 1 � 45
-			P3: gain modes: bit 0 = TVG on/off, bit 1 = auto gain on/off.
-
-		For Seabat 7K drivers (7125, 7101, 7150, 7111)
-			Sonar id: 22, 53, 60, 62
-			P0: Sonar range selection in meters.
-			P1: Transmit power selection in dBs relative to 1 uPa.
-			P2: Receiver gain selection in 0.1 dBs.
-			P3: Transmitter frequency in KHz.
-			P4: Transmit pulse width in microseconds.
-
-		For EdgeTech 4200 Driver
-			Sonar id: 7-10
-			P0: Pulse power setting, 0 to 100 percent.
-			P1: ADC Gain factor.
-			P2: Start Frequency in 10 * Hz.
-			P3: End Frequency in 10 * Hz.
-			P4: Sweep length in milliseconds. */
-	int	SNR_device_number;	/* device number */
-	double	SNR_time;		/* time tag (seconds past midnight) */
-	int	SNR_ping_number;	/* ping number (or 0 if not tracked) */
-	int	SNR_sonar_id;		/* sonar ID (see defines above) */
-	int	SNR_num_settings;	/* number of settings to follow */
-	double	SNR_settings[12];	/* sonar settings */
-
-	/* PSA - pitch stabilization angle
-		PSA dn t pn a0 a1
-			dn: device number�
-			t: time tag (seconds past midnight)�
-			pn: ping number (or 0 if not tracked)
-			a0: projector (head 0) pitch angle
-			a1: projector (head 1) pitch angle
-
-		Note: PSA records are recorded only when pitch stabilization
-		is active. They immediately proceed corresponding RMB records. */
-	int	PSA_device_number;	/* device number */
-	double	PSA_time;		/* time tag (seconds past midnight) */
-	int	PSA_ping_number;	/* ping number (or 0 if not tracked) */
-	double	PSA_a0;			/* projector (head 0) pitch angle */
-	double	PSA_a1;			/* projector (head 1) pitch angle */
-
-	/* HCP - heave compensation
-		HCP dn t h r p
-			dn: device number
-			t: time tag (seconds past midnight)
-			h: heave in meters
-			r: roll in degrees (+ port side up)
-			p: pitch in degrees (+ bow up)
-		Example:
-		HCP 0 80492.021 -0.65 -0.51 -1.73 */
-	int	HCP_device_number;	/* device number */
-	double	HCP_time;		/* time tag (seconds past midnight) */
-	double	HCP_heave;		/* heave (meters) */
-	double	HCP_roll;		/* roll (+ port side up) */
-	double	HCP_pitch;		/* pitch (+ bow up) */
-
-	/* EC1 - echo sounding (single frequency)
-		EC1 dn t rd
-			dn: device number
-			t: time tag (seconds past midnight)
-			rd: raw depth
-		Example:
-		EC1 1 80491.897 99.02 */
-	int	EC1_device_number;	/* device number */
-	double	EC1_time;		/* time tag (seconds past midnight) */
-	double	EC1_rawdepth;		/* raw depth */
-
-	/* GPS - GPS measurements
-		GPS dn t cog sog hdop mode nsats
-			dn: device number
-			t: time tag (seconds past midnight)
-			cog: course over ground (degrees)
-			sog: speed over ground (knots)
-			hdop: GPS hdop
-			mode: GPS mode
-				0 - unknown
-				1 - stand alone
-				2 - differential
-				3 - rtk
-			nsats: number of satellites
-		Example:
-		GPS 1 80491.897 178.16 0.23 1.2 2 8 */
-	int	GPS_device_number;	/* device number */
-	double	GPS_time;		/* time tag (seconds past midnight) */
-	double	GPS_cog;		/* course over ground (degrees) */
-	double	GPS_sog;		/* speed over ground (knots) */
-	double	GPS_hdop;		/* GPS hdop */
-	int	GPS_mode;		/* GPS mode
-						0 - unknown
-						1 - stand alone
-						2 - differential
-						3 - rtk */
-	int	GPS_nsats;		/* number of satellites */
-
-	/* GYR - gyro data (heading)
-		GYR dn t h
-			dn: device number
-			t: time tag (seconds past midnight)
-			h: heading (degrees)
-		Example:
-		GYR 1 80491.897 178.16 */
-	int	GYR_device_number;	/* device number */
-	double	GYR_time;		/* time tag (seconds past midnight) */
-	double	GYR_heading;		/* heading (degrees) */
-
-	/* POS - position
-		POS dn t x y
-			dn: device number
-			t: time tag (seconds past midnight)
-			x: easting
-			y: northing
-		Example:
-		POS 1 80491.897 308214.82 1414714.97 */
-	int	POS_device_number;	/* device number */
-	double	POS_time;		/* time tag (seconds past midnight) */
-	double	POS_x;			/* easting */
-	double	POS_y;			/* northing */
-
-	/* DFT - dynamic draft (squat) correction
-		DFT dn t dc
-			dn: device number
-			t: time tag (seconds past midnight)
-			dc: draft correction
-		Example:
-		DFT 1 80491.897 1453.44 */
-	int	DFT_device_number;	/* device number */
-	double	DFT_time;		/* time tag (seconds past midnight) */
-	double	DFT_draft;		/* draft correction */
-
-	/* TID - tide correction
-		TID dn t tc
-			dn: device number
-			t: time tag (seconds past midnight)
-			tc: tide correction
-		Example:
-		TID 1 80491.897 0.00 */
-	int	TID_device_number;	/* device number */
-	double	TID_time;		/* time tag (seconds past midnight) */
-	double	TID_tide;		/* tide correction */
-
-	/* COM - comment record - MB-System extension
-		COM c
-			c: comment string
-		Example:
-		COM everything after the first four characters is part of the comment */
-	char	COM_comment[MB_COMMENT_MAXLINE];	/* comment string */
-	};
-
-/* system specific function prototypes */
-int mbsys_hysweep_alloc(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error);
-int mbsys_hysweep_deall(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error);
-int mbsys_hysweep_dimensions(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int *nbath, int *namp, int *nss, int *error);
-int mbsys_hysweep_sonartype(int verbose, void *mbio_ptr, void *store_ptr,
-                        int *sonartype, int *error);
-int mbsys_hysweep_sidescantype(int verbose, void *mbio_ptr, void *store_ptr,
-                        int *ss_type, int *error);
-int mbsys_hysweep_pingnumber(int verbose, void *mbio_ptr,
-		int *pingnumber, int *error);
-int mbsys_hysweep_extract(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int time_i[7], double *time_d,
-			double *navlon, double *navlat,
-			double *speed, double *heading,
-			int *nbath, int *namp, int *nss,
-			char *beamflag, double *bath, double *amp,
-			double *bathacrosstrack, double *bathalongtrack,
-			double *ss, double *ssacrosstrack, double *ssalongtrack,
-			char *comment, int *error);
-int mbsys_hysweep_insert(int verbose, void *mbio_ptr, void *store_ptr,
-			int kind, int time_i[7], double time_d,
-			double navlon, double navlat,
-			double speed, double heading,
-			int nbath, int namp, int nss,
-			char *beamflag, double *bath, double *amp,
-			double *bathacrosstrack, double *bathalongtrack,
-			double *ss, double *ssacrosstrack, double *ssalongtrack,
-			char *comment, int *error);
-int mbsys_hysweep_ttimes(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int *nbeams,
-			double *ttimes, double *angles,
-			double *angles_forward, double *angles_null,
-			double *heave, double *alongtrack_offset,
-			double *draft, double *ssv, int *error);
-int mbsys_hysweep_detects(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int *nbeams, int *detects, int *error);
-int mbsys_hysweep_gains(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, double *transmit_gain, double *pulse_length,
-			double *receive_gain, int *error);
-int mbsys_hysweep_extract_altitude(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, double *transducer_depth, double *altitude,
-			int *error);
-int mbsys_hysweep_extract_nav(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int time_i[7], double *time_d,
-			double *navlon, double *navlat,
-			double *speed, double *heading, double *draft,
-			double *roll, double *pitch, double *heave,
-			int *error);
-int mbsys_hysweep_insert_nav(int verbose, void *mbio_ptr, void *store_ptr,
-			int time_i[7], double time_d,
-			double navlon, double navlat,
-			double speed, double heading, double draft,
-			double roll, double pitch, double heave,
-			int *error);
-int mbsys_hysweep_copy(int verbose, void *mbio_ptr,
-			void *store_ptr, void *copy_ptr,
-			int *error);
-int mbsys_hysweep_makess(int verbose, void *mbio_ptr, void *store_ptr,
-                        int pixel_size_set, double *pixel_size,
-                        int swath_width_set, double *swath_width,
-                        int pixel_int, int *error);
diff --git a/src/mbio/mbsys_image83p.c b/src/mbio/mbsys_image83p.c
deleted file mode 100644
index a6cdaeb..0000000
--- a/src/mbio/mbsys_image83p.c
+++ /dev/null
@@ -1,1101 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbsys_image83p.c	5/5/2008
- *	$Id: mbsys_image83p.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 2008-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbsys_image83p.c contains the functions for handling the data structure
- * used by MBIO functions to store data from the 480 Beam Imagenex DeltaT
- * multibeam sonar systems.
- * The data formats which are commonly used to store Imagenex DeltaT
- * data in files include
- *      MBF_IMAGE83P : MBIO ID 191
- *      MBF_IMAGEMBA : MBIO ID 192
- *
- *
- * Author:	Vivek Reddy, Santa Clara University
- *       	D.W. Caress
- * Date:	May 5, 2008
- *
- * $Log: mbsys_image83p.c,v $
- * Revision 5.4  2008/07/19 07:41:14  caress
- * Added formats 191 and 192 to support Imagenex Delta T multibeam data.
- *
- * Revision 5.3  2008/07/10 18:02:39  caress
- * Proceeding towards 5.1.1beta20.
- *
- * Revision 5.0  2008/05/16 22:51:24  caress
- * Initial version.
- *
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mb_define.h"
-#include "mbsys_image83p.h"
-
- static char rcs_id[]="$Id: mbsys_image83p.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mbsys_image83p_alloc(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_image83p_alloc";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* allocate memory for data structure */
-	status = mb_malloc(verbose,sizeof(struct mbsys_image83p_struct),
-				store_ptr,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)*store_ptr);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_image83p_deall(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_image83p_deall";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)*store_ptr);
-		}
-
-	/* deallocate memory for data structure */
-	status = mb_free(verbose,store_ptr,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_image83p_dimensions(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int *nbath, int *namp, int *nss, int *error)
-{
-	char	*function_name = "mbsys_image83p_dimensions";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_image83p_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_image83p_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get beam and pixel numbers */
-		*nbath = mb_io_ptr->beams_bath_max;
-		*namp = mb_io_ptr->beams_amp_max;
-		*nss = 0;
-		}
-	else
-		{
-		/* get beam and pixel numbers */
-		*nbath = 0;
-		*namp = 0;
-		*nss = 0;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		fprintf(stderr,"dbg2       nbath:      %d\n",*nbath);
-		fprintf(stderr,"dbg2        namp:      %d\n",*namp);
-		fprintf(stderr,"dbg2        nss:       %d\n",*nss);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_image83p_extract(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int time_i[7], double *time_d,
-		double *navlon, double *navlat,
-		double *speed, double *heading,
-		int *nbath, int *namp, int *nss,
-		char *beamflag, double *bath, double *amp,
-		double *bathacrosstrack, double *bathalongtrack,
-		double *ss, double *ssacrosstrack, double *ssalongtrack,
-		char *comment, int *error)
-{
-	char	*function_name = "mbsys_image83p_extract";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_image83p_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_image83p_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get time */
-		for (i=0;i<7;i++)
-			time_i[i] = store->time_i[i];
-		*time_d = store->time_d;
-
-		/* get navigation */
-		*navlon = store->nav_long;
-		*navlat = store->nav_lat;
-
-		/* get heading */
-		*heading = 0.1 * store->heading;
-
-		/* get speed (convert knots to km/hr) */
-		*speed = 1.852 * store->nav_speed * 0.1;
-
-		/* set beamwidths in mb_io structure */
-		mb_io_ptr->beamwidth_ltrack = 0.75;
-		mb_io_ptr->beamwidth_xtrack = 0.75;
-
-		/* read distance and depth values into storage arrays */
-		*nbath = store->num_proc_beams;
-		*namp = 0;
-		*nss = 0;
-		for (i=0;i<*nbath;i++)
-			{
-			beamflag[i] = store->beamflag[i];
-			bath[i] = store->bath[i];
-			bathacrosstrack[i] = store->bathacrosstrack[i];
-			bathalongtrack[i] = store->bathalongtrack[i];
-			}
-
-		/* print debug statements */
-		if (verbose >= 5)
-			{
-			fprintf(stderr,"\ndbg4  Data extracted by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  Extracted values:\n");
-			fprintf(stderr,"dbg4       kind:       %d\n",
-				*kind);
-			fprintf(stderr,"dbg4       error:      %d\n",
-				*error);
-			fprintf(stderr,"dbg4       time_i[0]:  %d\n",
-				time_i[0]);
-			fprintf(stderr,"dbg4       time_i[1]:  %d\n",
-				time_i[1]);
-			fprintf(stderr,"dbg4       time_i[2]:  %d\n",
-				time_i[2]);
-			fprintf(stderr,"dbg4       time_i[3]:  %d\n",
-				time_i[3]);
-			fprintf(stderr,"dbg4       time_i[4]:  %d\n",
-				time_i[4]);
-			fprintf(stderr,"dbg4       time_i[5]:  %d\n",
-				time_i[5]);
-			fprintf(stderr,"dbg4       time_i[6]:  %d\n",
-				time_i[6]);
-			fprintf(stderr,"dbg4       time_d:     %f\n",
-				*time_d);
-			fprintf(stderr,"dbg4       longitude:  %f\n",
-				*navlon);
-			fprintf(stderr,"dbg4       latitude:   %f\n",
-				*navlat);
-			fprintf(stderr,"dbg4       speed:      %f\n",
-				*speed);
-			fprintf(stderr,"dbg4       heading:    %f\n",
-				*heading);
-			fprintf(stderr,"dbg4       nbath:      %d\n",
-				*nbath);
-			for (i=0;i<*nbath;i++)
-			 fprintf(stderr,"dbg4       beam:%d  flag:%3d  bath:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,beamflag[i],bath[i],
-			bathacrosstrack[i],bathalongtrack[i]);
-			}
-
-		/* done translating values */
-
-		}
-
-	/* extract comment from structure */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* copy comment */
-		strncpy(comment, store->comment, MBSYS_IMAGE83P_COMMENTLEN);
-
-		/* print debug statements */
-		if (verbose >= 4)
-			{
-			fprintf(stderr,"\ndbg4  New ping read by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  New ping values:\n");
-			fprintf(stderr,"dbg4       error:      %d\n",
-				*error);
-			fprintf(stderr,"dbg4       comment:    %s\n",
-				comment);
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind == MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"dbg2       comment:     \ndbg2       %s\n",
-			comment);
-		}
-	else if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind != MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"dbg2       time_i[0]:     %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:     %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:     %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:     %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:     %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:     %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:     %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:        %f\n",*time_d);
-		fprintf(stderr,"dbg2       longitude:     %f\n",*navlon);
-		fprintf(stderr,"dbg2       latitude:      %f\n",*navlat);
-		fprintf(stderr,"dbg2       speed:         %f\n",*speed);
-		fprintf(stderr,"dbg2       heading:       %f\n",*heading);
-		}
-	if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind == MB_DATA_DATA)
-		{
-		fprintf(stderr,"dbg2       nbath:      %d\n",
-			*nbath);
-		for (i=0;i<*nbath;i++)
-		fprintf(stderr,"dbg2       beam:%d  flag:%3d  bath:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,beamflag[i],bath[i],
-			bathacrosstrack[i],bathalongtrack[i]);
-
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_image83p_insert(int verbose, void *mbio_ptr, void *store_ptr,
-		int kind, int time_i[7], double time_d,
-		double navlon, double navlat,
-		double speed, double heading,
-		int nbath, int namp, int nss,
-		char *beamflag, double *bath, double *amp,
-		double *bathacrosstrack, double *bathalongtrack,
-		double *ss, double *ssacrosstrack, double *ssalongtrack,
-		char *comment, int *error)
-{
-	char	*function_name = "mbsys_image83p_insert";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_image83p_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       kind:       %d\n",kind);
-		}
-	if (verbose >= 2 && (kind == MB_DATA_DATA || kind == MB_DATA_NAV))
-		{
-		fprintf(stderr,"dbg2       time_i[0]:  %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:  %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:  %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:  %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:  %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:  %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:  %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:     %f\n",time_d);
-		fprintf(stderr,"dbg2       navlon:     %f\n",navlon);
-		fprintf(stderr,"dbg2       navlat:     %f\n",navlat);
-		fprintf(stderr,"dbg2       speed:      %f\n",speed);
-		fprintf(stderr,"dbg2       heading:    %f\n",heading);
-		}
-	if (verbose >= 2 && kind == MB_DATA_DATA)
-		{
-		fprintf(stderr,"dbg2       nbath:      %d\n",nbath);
-		if (verbose >= 3)
-		 for (i=0;i<nbath;i++)
-		  fprintf(stderr,"dbg3       beam:%d  flag:%3d  bath:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,beamflag[i],bath[i],
-			bathacrosstrack[i],bathalongtrack[i]);
-		fprintf(stderr,"dbg2       namp:       %d\n",namp);
-		if (verbose >= 3)
-		 for (i=0;i<namp;i++)
-		  fprintf(stderr,"dbg3        beam:%d   amp:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,amp[i],bathacrosstrack[i],bathalongtrack[i]);
-		fprintf(stderr,"dbg2        nss:       %d\n",nss);
-		if (verbose >= 3)
-		 for (i=0;i<nss;i++)
-		  fprintf(stderr,"dbg3        pixel:%d   ss:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,ss[i],ssacrosstrack[i],ssalongtrack[i]);
-		}
-	if (verbose >= 2 && kind == MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"dbg2       comment:     \ndbg2       %s\n",
-			comment);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_image83p_struct *) store_ptr;
-
-	/* set data kind */
-	store->kind = kind;
-
-	/* insert data in structure */
-	if (store->kind == MB_DATA_DATA)
-		{
-		/* get time */
-		for (i=0;i<7;i++)
-			store->time_i[i] = time_i[i];
-		store->time_d = time_d;
-
-		/* get navigation */
-
-		store->nav_long = navlon;
-		store->nav_lat = navlat;
-
-		/* get heading (360 degrees = 65536) */
-		store->heading = (int) (10 * heading);
-
-		/* get speed (convert km/hr to knots) */
-		store->nav_speed = (int) (0.539996 * speed * 10);
-
-		/* put depth values
-			into data structure */
-		store->num_proc_beams = nbath;
-		for (i=0;i<nbath;i++)
-			{
-			store->beamflag[i] = beamflag[i];
-			store->bath[i] = bath[i];
-			store->bathacrosstrack[i] = bathacrosstrack[i];
-			store->bathalongtrack[i] = bathalongtrack[i];
-			}
-		}
-
-	/* insert data in structure */
-	else if (store->kind == MB_DATA_COMMENT)
-		{
-		strncpy(store->comment, comment, MBSYS_IMAGE83P_COMMENTLEN);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_image83p_ttimes(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, int *nbeams,
-	double *ttimes, double *angles,
-	double *angles_forward, double *angles_null,
-	double *heave, double *alongtrack_offset,
-	double *draft, double *ssv, int *error)
-{
-	char	*function_name = "mbsys_image83p_ttimes";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_image83p_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       ttimes:     %p\n",(void *)ttimes);
-		fprintf(stderr,"dbg2       angles_xtrk:%p\n",(void *)angles);
-		fprintf(stderr,"dbg2       angles_ltrk:%p\n",(void *)angles_forward);
-		fprintf(stderr,"dbg2       angles_null:%p\n",(void *)angles_null);
-		fprintf(stderr,"dbg2       heave:      %p\n",(void *)heave);
-		fprintf(stderr,"dbg2       ltrk_off:   %p\n",(void *)alongtrack_offset);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_image83p_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get nbeams */
-		*nbeams = store->num_proc_beams;
-
-		*draft = store->sonar_depth;
-		if (store->sound_velocity > 13000 && store->sound_velocity < 17000)
-			*ssv = 0.1 * store->sound_velocity;
-		else
-			*ssv = 1500.0;
-
-		/* get travel times, angles */
-		for (i=0;i<store->num_proc_beams;i++)
-			{
-			ttimes[i] = store->beamrange[i];
-			angles[i] = store->angles[i];
-			angles_forward[i] = store->angles_forward[i];
-			angles_null[i] = 0.0;
-			alongtrack_offset[i] = 0.0;
-			heave[i] = store->heave;
-			}
-
-		/* set status */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error == MB_ERROR_NO_ERROR)
-		{
-		fprintf(stderr,"dbg2       draft:      %f\n",*draft);
-		fprintf(stderr,"dbg2       ssv:        %f\n",*ssv);
-		fprintf(stderr,"dbg2       nbeams:     %d\n",*nbeams);
-		for (i=0;i<*nbeams;i++)
-			fprintf(stderr,"dbg2       beam %d: tt:%f  angle_xtrk:%f  angle_ltrk:%f  angle_null:%f  depth_off:%f  ltrk_off:%f\n",
-				i,ttimes[i],angles[i],
-				angles_forward[i],angles_null[i],
-				heave[i],alongtrack_offset[i]);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_image83p_detects(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, int *nbeams,
-	int *detects, int *error)
-{
-	char	*function_name = "mbsys_image83p_detects";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_image83p_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       detects:    %p\n",(void *)detects);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_image83p_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get nbeams */
-		*nbeams = store->num_proc_beams;
-
-		/* get detects */
-		for (i=0;i<*nbeams;i++)
-			{
-			detects[i] = MB_DETECT_PHASE;
-			}
-
-		/* set status */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error == MB_ERROR_NO_ERROR)
-		{
-		fprintf(stderr,"dbg2       nbeams:     %d\n",*nbeams);
-		for (i=0;i<*nbeams;i++)
-			fprintf(stderr,"dbg2       beam %d: detects:%d\n",
-				i,detects[i]);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_image83p_extract_altitude(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, double *transducer_depth, double *altitudev,
-	int *error)
-{
-	char	*function_name = "mbsys_image83p_extract_altitude";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_image83p_struct *store;
-	double	xtrackmin;
-	int	altitude_found;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_image83p_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get transducer depth */
-		*transducer_depth = store->sonar_depth - store->heave;
-
-		/* get altitude from depth closest to nadir */
-		altitude_found = MB_NO;
-		xtrackmin = 999999.9;
-		*altitudev = 0.0;
-		for (i=0;i<store->num_proc_beams;i++)
-			{
-			if (mb_beam_ok(store->beamflag[i])
-				&& fabs(store->bathacrosstrack[i]) < xtrackmin)
-				{
-				*altitudev = store->bath[i] - *transducer_depth;
-				altitude_found = MB_YES;
-				xtrackmin = fabs(store->bathacrosstrack[i]);
-				}
-			}
-
-		/* set status */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:              %d\n",*kind);
-		fprintf(stderr,"dbg2       transducer_depth:  %f\n",*transducer_depth);
-		fprintf(stderr,"dbg2       altitude:          %f\n",*altitudev);
-		fprintf(stderr,"dbg2       error:             %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:            %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_image83p_extract_nav(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int time_i[7], double *time_d,
-		double *navlon, double *navlat,
-		double *speed, double *heading, double *draft,
-		double *roll, double *pitch, double *heave,
-		int *error)
-{
-	char	*function_name = "mbsys_image83p_extract_nav";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_image83p_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_image83p_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get time */
-		for (i=0;i<7;i++)
-			time_i[i] = store->time_i[i];
-		*time_d = store->time_d;
-
-		/* get navigation */
-		*navlon = store->nav_long;
-		*navlat = store->nav_lat;
-
-		/* get heading */
-		*heading = 0.1 * store->heading;
-
-		/* get draft */
-		*draft = store->sonar_depth;
-
-		/* get speed (convert knots to km/hr) */
-		*speed = 1.852 * store->nav_speed * 0.1;
-
-		/* get roll pitch  */
-		*roll = 0.1 * (store->roll - 900.0);
-		*pitch = 0.1 * (store->pitch - 900.0) + ((double)store->profile_tilt_angle - 180.0);
-		*heave = store->heave;
-
-		/* print debug statements */
-		if (verbose >= 5)
-			{
-			fprintf(stderr,"\ndbg4  Data extracted by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  Extracted values:\n");
-			fprintf(stderr,"dbg4       kind:       %d\n",
-				*kind);
-			fprintf(stderr,"dbg4       error:      %d\n",
-				*error);
-			fprintf(stderr,"dbg4       time_i[0]:  %d\n",
-				time_i[0]);
-			fprintf(stderr,"dbg4       time_i[1]:  %d\n",
-				time_i[1]);
-			fprintf(stderr,"dbg4       time_i[2]:  %d\n",
-				time_i[2]);
-			fprintf(stderr,"dbg4       time_i[3]:  %d\n",
-				time_i[3]);
-			fprintf(stderr,"dbg4       time_i[4]:  %d\n",
-				time_i[4]);
-			fprintf(stderr,"dbg4       time_i[5]:  %d\n",
-				time_i[5]);
-			fprintf(stderr,"dbg4       time_i[6]:  %d\n",
-				time_i[6]);
-			fprintf(stderr,"dbg4       time_d:     %f\n",
-				*time_d);
-			fprintf(stderr,"dbg4       longitude:  %f\n",
-				*navlon);
-			fprintf(stderr,"dbg4       latitude:   %f\n",
-				*navlat);
-			fprintf(stderr,"dbg4       speed:      %f\n",
-				*speed);
-			fprintf(stderr,"dbg4       heading:    %f\n",
-				*heading);
-			fprintf(stderr,"dbg4       draft:      %f\n",
-				*draft);
-			fprintf(stderr,"dbg4       roll:       %f\n",
-				*roll);
-			fprintf(stderr,"dbg4       pitch:      %f\n",
-				*pitch);
-			fprintf(stderr,"dbg4       heave:      %f\n",
-				*heave);
-			}
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind == MB_DATA_DATA)
-		{
-		fprintf(stderr,"dbg2       time_i[0]:     %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:     %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:     %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:     %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:     %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:     %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:     %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:        %f\n",*time_d);
-		fprintf(stderr,"dbg2       longitude:     %f\n",*navlon);
-		fprintf(stderr,"dbg2       latitude:      %f\n",*navlat);
-		fprintf(stderr,"dbg2       speed:         %f\n",*speed);
-		fprintf(stderr,"dbg2       heading:       %f\n",*heading);
-		fprintf(stderr,"dbg2       draft:         %f\n",*draft);
-		fprintf(stderr,"dbg2       roll:          %f\n",*roll);
-		fprintf(stderr,"dbg2       pitch:         %f\n",*pitch);
-		fprintf(stderr,"dbg2       heave:         %f\n",*heave);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_image83p_insert_nav(int verbose, void *mbio_ptr, void *store_ptr,
-		int time_i[7], double time_d,
-		double navlon, double navlat,
-		double speed, double heading, double draft,
-		double roll, double pitch, double heave,
-		int *error)
-{
-	char	*function_name = "mbsys_image83p_insert_nav";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_image83p_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       time_i[0]:  %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:  %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:  %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:  %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:  %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:  %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:  %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:     %f\n",time_d);
-		fprintf(stderr,"dbg2       navlon:     %f\n",navlon);
-		fprintf(stderr,"dbg2       navlat:     %f\n",navlat);
-		fprintf(stderr,"dbg2       speed:      %f\n",speed);
-		fprintf(stderr,"dbg2       heading:    %f\n",heading);
-		fprintf(stderr,"dbg2       draft:      %f\n",draft);
-		fprintf(stderr,"dbg2       roll:       %f\n",roll);
-		fprintf(stderr,"dbg2       pitch:      %f\n",pitch);
-		fprintf(stderr,"dbg2       heave:      %f\n",heave);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_image83p_struct *) store_ptr;
-
-	/* insert data in structure */
-	if (store->kind == MB_DATA_DATA)
-		{
-		for (i=0;i<7;i++)
-			store->time_i[i] = time_i[i];
-		store->time_d = time_d;
-
-		/* get navigation */
-
-		store->nav_long = navlon;
-		store->nav_lat = navlat;
-
-		/* get heading (360 degrees = 65536) */
-		store->heading = (int) (10 * heading);
-
-		/* get draft */
-		store->sonar_depth = draft;
-
-		/* get speed (convert km/hr to knots) */
-		store->nav_speed = (int) (0.539996 * speed * 10);
-
-		/* get roll pitch and heave */
-		store->roll = roll * 10 + 900;
-		store->pitch = pitch * 10 + 900 - ((double)store->profile_tilt_angle - 180.0);
-		store->heave = heave;
-
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbsys_image83p_copy(int verbose, void *mbio_ptr,
-			void *store_ptr, void *copy_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_image83p_copy";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_image83p_struct *store;
-	struct mbsys_image83p_struct *copy;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       copy_ptr:   %p\n",(void *)copy_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointers */
-	store = (struct mbsys_image83p_struct *) store_ptr;
-	copy = (struct mbsys_image83p_struct *) copy_ptr;
-
-	/* copy the data */
-	*copy = *store;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mbsys_image83p.h b/src/mbio/mbsys_image83p.h
deleted file mode 100644
index fca6b52..0000000
--- a/src/mbio/mbsys_image83p.h
+++ /dev/null
@@ -1,149 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbsys_image83p.h	5/5/2008
- *	$Id: mbsys_image83p.h 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 2008-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbsys_image83p.h defines the data structures used by MBIO functions
- * to store data from Imagenex DeltaT multibeam sonar systems.
- * The data formats which are commonly used to store Imagenex DeltaT
- * data in files include
- *      MBF_IMAGE83P : MBIO ID 191
- *      MBF_IMAGEMBA : MBIO ID 192
- *
- * Author:	Vivek Reddy, Santa Clara University
- *       	D.W. Caress
- * Date:	February 16, 1993
- *
- * $Log: mbsys_image83p.h,v $
- * Revision 5.1  2008/07/19 07:41:14  caress
- * Added formats 191 and 192 to support Imagenex Delta T multibeam data.
- *
- * Revision 5.0  2008/05/16 22:51:24  caress
- * Initial version.
- *
- *
- */
-/*
- * Notes on the MBSYS_HSDS data structure:
- *   1. Imagex multibeam systems output raw data in a format
- *      combining ascii and binary values.
- *   2. The system outputs 480 beams of bathymetry
- *   3. The data structure defined below includes all of the values
- *      which are passed in imagenex multibeam records
- *   4. Support for comment records is specific to MB-System.
- */
-
-/* number of beams for imagex multibeam */
-#define MBSYS_IMAGE83P_BEAMS 480
-#define MBSYS_IMAGE83P_COMMENTLEN 248
-
-struct mbsys_image83p_struct
-	{
-	/* type of data record */
-	int	kind;
-
-	/* time stamp (all records but comment ) */
-	int	time_i[7];
-	double	time_d;
-
-	/* additional navigation and depths  */
-	int	version;	/* file version */
-	double	nav_lat;
-	double	nav_long;
-	int	nav_speed; /* 0.1 knots */
-	int	nav_heading; /* 0.1 degrees */
-	int	pitch; /* degrees / 10 - 900 */
-	int	roll; /* degrees / 10 - 900 */
-	int	heading /* degrees / 10 */;
-	int	num_beams;
-	int	samples_per_beam;
-	int	sector_size; /* degrees */
-	int	start_angle; /* 0.01 degrees + 180.0 */
-	int	angle_increment; /* 0.01 degrees */
-	int	acoustic_range; /* meters */
-	int	acoustic_frequency; /* kHz */
-	int	sound_velocity; /* 0.1 m/sec */
-	int	range_resolution; /* 0.001 meters */
-	int	pulse_length; /* usec */
-	int	profile_tilt_angle; /* degrees + 180.0 */
-	int	rep_rate; /* msec */
-	int	ping_number;
-	int	range[MBSYS_IMAGE83P_BEAMS];
-
-	/* important values not in vendor format */
-	float	sonar_depth;
-	float	heave;
-	int	num_proc_beams;
-	double	beamrange[MBSYS_IMAGE83P_BEAMS];
-	double	angles[MBSYS_IMAGE83P_BEAMS];
-	double	angles_forward[MBSYS_IMAGE83P_BEAMS];
-	float	bath[MBSYS_IMAGE83P_BEAMS];
-	float	bathacrosstrack[MBSYS_IMAGE83P_BEAMS];
-	float	bathalongtrack[MBSYS_IMAGE83P_BEAMS];
-	char	beamflag[MBSYS_IMAGE83P_BEAMS];
-
-	/* comment */
-	char	comment[MBSYS_IMAGE83P_COMMENTLEN];
-	};
-
-/* system specific function prototypes */
-int mbsys_image83p_alloc(int verbose, void *mbio_ptr, void **store_ptr,
-		int *error);
-int mbsys_image83p_deall(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error);
-int mbsys_image83p_dimensions(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int *nbath, int *namp, int *nss, int *error);
-int mbsys_image83p_extract(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int time_i[7], double *time_d,
-			double *navlon, double *navlat,
-			double *speed, double *heading,
-			int *nbath, int *namp, int *nss,
-			char *beamflag, double *bath, double *amp,
-			double *bathacrosstrack, double *bathalongtrack,
-			double *ss, double *ssacrosstrack, double *ssalongtrack,
-			char *comment, int *error);
-int mbsys_image83p_insert(int verbose, void *mbio_ptr, void *store_ptr,
-			int kind, int time_i[7], double time_d,
-			double navlon, double navlat,
-			double speed, double heading,
-			int nbath, int namp, int nss,
-			char *beamflag, double *bath, double *amp,
-			double *bathacrosstrack, double *bathalongtrack,
-			double *ss, double *ssacrosstrack, double *ssalongtrack,
-			char *comment, int *error);
-int mbsys_image83p_ttimes(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int *nbeams,
-			double *ttimes, double *angles,
-			double *angles_forward, double *angles_null,
-			double *heave, double *alongtrack_offset,
-			double *draft, double *ssv, int *error);
-int mbsys_image83p_detects(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int *nbeams, int *detects, int *error);
-int mbsys_image83p_extract_altitude(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, double *transducer_depth, double *altitudev,
-			int *error);
-int mbsys_image83p_extract_nav(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int time_i[7], double *time_d,
-			double *navlon, double *navlat,
-			double *speed, double *heading, double *draft,
-			double *roll, double *pitch, double *heave,
-			int *error);
-int mbsys_image83p_insert_nav(int verbose, void *mbio_ptr, void *store_ptr,
-			int time_i[7], double time_d,
-			double navlon, double navlat,
-			double speed, double heading, double draft,
-			double roll, double pitch, double heave,
-			int *error);
-int mbsys_image83p_copy(int verbose, void *mbio_ptr,
-			void *store_ptr, void *copy_ptr,
-			int *error);
diff --git a/src/mbio/mbsys_jstar.c b/src/mbio/mbsys_jstar.c
deleted file mode 100644
index ff009ed..0000000
--- a/src/mbio/mbsys_jstar.c
+++ /dev/null
@@ -1,3432 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbsys_jstar.c	10/4/94
- *	$Id: mbsys_jstar.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 2005-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbsys_jstar.c contains the functions for handling the data structure
- * used by MBIO functions to store data from Edgetech
- * subbottom and sidescan sonar systems.
- * The native data format used to store Edgetech
- * data is called Jstar and is supported by the format:
- *      MBF_EDGJSTAR : MBIO ID 132
- *
- * Author:	D. W. Caress
- * Date:	May 4, 2005
- * $Log: mbsys_jstar.c,v $
- * Revision 5.8  2008/07/10 18:02:39  caress
- * Proceeding towards 5.1.1beta20.
- *
- * Revision 5.5  2007/10/08 15:59:34  caress
- * MBIO changes as of 8 October 2007.
- *
- * Revision 5.4  2006/11/10 22:36:05  caress
- * Working towards release 5.1.0
- *
- * Revision 5.3  2006/03/12 19:23:19  caress
- * Changed log2() and exp2() calls to log() and exp() for compatitibility with non-POSIX compliant operating systems.
- *
- * Revision 5.2  2005/11/05 00:48:05  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.1  2005/06/15 15:20:17  caress
- * Fixed problems with writing Bluefin records in 7k data and improved support for Edgetech Jstar data.
- *
- * Revision 5.0  2005/06/04 04:11:35  caress
- * Support for Edgetech Jstar format (id 132 and 133).
- *
- *
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mb_define.h"
-#include "mb_segy.h"
-#include "mbsys_jstar.h"
-
-static char rcs_id[]="$Id: mbsys_jstar.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mbsys_jstar_alloc(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_jstar_alloc";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_jstar_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* allocate memory for data structure */
-	status = mb_mallocd(verbose, __FILE__,__LINE__,sizeof(struct mbsys_jstar_struct),
-				(void **)store_ptr,error);
-
-	/* make sure trace pointers are null */
-	store = (struct mbsys_jstar_struct *) mb_io_ptr->store_data;
-	store->kind = MB_DATA_NONE;
-	store->sbp.trace_alloc = 0;
-	store->sbp.trace = NULL;
-	store->ssport.trace_alloc = 0;
-	store->ssport.trace = NULL;
-	store->ssstbd.trace_alloc = 0;
-	store->ssstbd.trace = NULL;
-	store->comment.comment[0] = 0;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)*store_ptr);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_jstar_deall(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_jstar_deall";
-	int	status = MB_SUCCESS;
-	struct mbsys_jstar_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)*store_ptr);
-		}
-
-	/* deallocate memory for data structure */
-	if (*store_ptr != NULL)
-		{
-		store = (struct mbsys_jstar_struct *) *store_ptr;
-		if (store->sbp.trace != NULL
-			&& store->sbp.trace_alloc > 0)
-			{
-			status = mb_freed(verbose,__FILE__, __LINE__, (void **)&(store->sbp.trace),error);
-			}
-		store->sbp.trace_alloc = 0;
-		if (store->ssport.trace != NULL
-			&& store->ssport.trace_alloc > 0)
-			{
-			status = mb_freed(verbose,__FILE__, __LINE__, (void **)&(store->ssport.trace),error);
-			}
-		store->ssport.trace_alloc = 0;
-		if (store->ssstbd.trace != NULL
-			&& store->ssstbd.trace_alloc > 0)
-			{
-			status = mb_freed(verbose,__FILE__, __LINE__, (void **)&(store->ssstbd.trace),error);
-			}
-		store->ssstbd.trace_alloc = 0;
-		}
-	status = mb_freed(verbose,__FILE__, __LINE__, (void **)store_ptr,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_jstar_dimensions(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int *nbath, int *namp, int *nss, int *error)
-{
-	char	*function_name = "mbsys_jstar_dimensions";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_jstar_struct *store;
-	struct mbsys_jstar_channel_struct *sbp;
-	struct mbsys_jstar_channel_struct *ssport;
-	struct mbsys_jstar_channel_struct *ssstbd;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_jstar_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* get beam and pixel numbers */
-	if (*kind == MB_DATA_SUBBOTTOM_SUBBOTTOM)
-		{
-		sbp = (struct mbsys_jstar_channel_struct *) &(store->sbp);
-		*nbath = 1;
-		*namp = 0;
-		*nss = 0;
-		}
-	else if (*kind == MB_DATA_DATA
-		|| *kind == MB_DATA_SIDESCAN2)
-		{
-		ssport = (struct mbsys_jstar_channel_struct *) &(store->ssport);
-		ssstbd = (struct mbsys_jstar_channel_struct *) &(store->ssstbd);
-		*nbath = 1;
-		*namp = 0;
-		if ((ssport->samples + ssstbd->samples) > MBSYS_JSTAR_PIXELS_MAX)
-			*nss = MBSYS_JSTAR_PIXELS_MAX;
-		else
-			*nss = ssport->samples + ssstbd->samples;
-		}
-	else
-		{
-		/* get beam and pixel numbers */
-		*nbath = 0;
-		*namp = 0;
-		*nss = 0;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		fprintf(stderr,"dbg2       nbath:      %d\n",*nbath);
-		fprintf(stderr,"dbg2        namp:      %d\n",*namp);
-		fprintf(stderr,"dbg2        nss:       %d\n",*nss);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_jstar_pingnumber(int verbose, void *mbio_ptr,
-		int *pingnumber, int *error)
-{
-	char	*function_name = "mbsys_jstar_pingnumber";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_jstar_struct *store;
-	struct mbsys_jstar_channel_struct *sbp;
-	struct mbsys_jstar_channel_struct *ssport;
-	struct mbsys_jstar_channel_struct *ssstbd;
-	int	kind;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_jstar_struct *) mb_io_ptr->store_data;
-
-	/* get data kind */
-	kind = store->kind;
-
-	/* extract data from structure */
-	if (kind == MB_DATA_SUBBOTTOM_SUBBOTTOM)
-		{
-		sbp = (struct mbsys_jstar_channel_struct *) &(store->sbp);
-		*pingnumber = sbp->pingNum;
-		}
-	else if (kind == MB_DATA_DATA
-		|| kind == MB_DATA_SIDESCAN2)
-		{
-		ssport = (struct mbsys_jstar_channel_struct *) &(store->ssport);
-		ssstbd = (struct mbsys_jstar_channel_struct *) &(store->ssstbd);
-		*pingnumber = ssport->pingNum;
-		}
-	else
-		{
-		*pingnumber = mb_io_ptr->ping_count;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       pingnumber: %d\n",*pingnumber);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_jstar_preprocess(int verbose, void *mbio_ptr, void *store_ptr,
-                        double time_d, double navlon, double navlat,
-                        double speed, double heading, double sonardepth,
-                        double roll, double pitch, double heave,
-                        int *error)
-{
-	char	*function_name = "mbsys_jstar_preprocess";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_jstar_struct *store;
-	struct mbsys_jstar_channel_struct *sbp;
-	struct mbsys_jstar_channel_struct *ssport;
-	struct mbsys_jstar_channel_struct *ssstbd;
-	int	time_i[7], time_j[5];
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       time_d:     %f\n",time_d);
-		fprintf(stderr,"dbg2       navlon:     %f\n",navlon);
-		fprintf(stderr,"dbg2       navlat:     %f\n",navlat);
-		fprintf(stderr,"dbg2       speed:      %f\n",speed);
-		fprintf(stderr,"dbg2       heading:    %f\n",heading);
-		fprintf(stderr,"dbg2       sonardepth: %f\n",sonardepth);
-		fprintf(stderr,"dbg2       roll:       %f\n",roll);
-		fprintf(stderr,"dbg2       pitch:      %f\n",pitch);
-		fprintf(stderr,"dbg2       heave:      %f\n",heave);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_jstar_struct *) store_ptr;
-
-	/* preprocess subbottom data */
-	if (store->kind == MB_DATA_SUBBOTTOM_SUBBOTTOM)
-		{
-		/* get channel */
-		sbp = (struct mbsys_jstar_channel_struct *) &(store->sbp);
-
-		/* get time */
-		mb_get_date(verbose,time_d,time_i);
-		mb_get_jtime(verbose,time_i,time_j);
-		sbp->year = time_i[0];
-		sbp->day = time_j[1];
-		sbp->hour = time_i[3];
-		sbp->minute = time_i[4];
-		sbp->second = time_i[5];
-		sbp->millisecondsToday = 0.001 * time_i[6]
-					+ 1000 * (time_i[5]
-						+ 60.0 * (time_i[4]
-							+ 60.0 * time_i[3]));
-
-		/* get navigation */
-		if (navlon < 180.0) navlon = navlon + 360.0;
-		if (navlon > 180.0) navlon = navlon - 360.0;
-		sbp->sourceCoordX = (int) (600000.0 * navlon);
-		sbp->sourceCoordY = (int) (600000.0 * navlat);
-		sbp->groupCoordX = (int) (600000.0 * navlon);
-		sbp->groupCoordY = (int) (600000.0 * navlat);
-
-		/* get heading */
-		if (heading > 180.0)
-			heading -= 360.0;
-		if (heading < -180.0)
-			heading += 360.0;
-		sbp->heading = (short) (100.0 * heading);
-
-		/* get sonardepth */
-		sbp->startDepth = sonardepth /
-				sbp->sampleInterval / 0.00000075;
-		sbp->sonardepth = 1000 * sonardepth;
-
-		/* get attitude */
-		sbp->roll = 32768 * roll / 180.0;
-		sbp->pitch = 32768 * pitch / 180.0;
-		sbp->heaveCompensation = heave /
-				sbp->sampleInterval / 0.00000075;
-		}
-
-	/* preprocess sidescan data */
-	else if (store->kind == MB_DATA_DATA
-		|| store->kind == MB_DATA_SIDESCAN2)
-		{
-		/* get channels */
-		ssport = (struct mbsys_jstar_channel_struct *) &(store->ssport);
-		ssstbd = (struct mbsys_jstar_channel_struct *) &(store->ssstbd);
-
-		/* get time */
-		mb_get_date(verbose,time_d,time_i);
-		mb_get_jtime(verbose,time_i,time_j);
-		ssport->year = time_i[0];
-		ssport->day = time_j[1];
-		ssport->hour = time_i[3];
-		ssport->minute = time_i[4];
-		ssport->second = time_i[5];
-		ssport->millisecondsToday = 0.001 * time_i[6]
-					+ 1000 * (time_i[5]
-						+ 60.0 * (time_i[4]
-							+ 60.0 * time_i[3]));
-		ssstbd->year = time_i[0];
-		ssstbd->day = time_j[1];
-		ssstbd->hour = time_i[3];
-		ssstbd->minute = time_i[4];
-		ssstbd->second = time_i[5];
-		ssstbd->millisecondsToday = 0.001 * time_i[6]
-					+ 1000 * (time_i[5]
-						+ 60.0 * (time_i[4]
-							+ 60.0 * time_i[3]));
-
-		/* get navigation */
-		if (navlon < 180.0) navlon = navlon + 360.0;
-		if (navlon > 180.0) navlon = navlon - 360.0;
-		ssport->sourceCoordX = 600000.0 * navlon;
-		ssport->sourceCoordY = 600000.0 * navlat;
-		ssstbd->sourceCoordX = 600000.0 * navlon;
-		ssstbd->sourceCoordY = 600000.0 * navlat;
-		ssport->groupCoordX = 600000.0 * navlon;
-		ssport->groupCoordY = 600000.0 * navlat;
-		ssstbd->groupCoordX = 600000.0 * navlon;
-		ssstbd->groupCoordY = 600000.0 * navlat;
-
-		/* get heading and speed */
-		if (heading > 180.0)
-			heading -= 360.0;
-		if (heading < -180.0)
-			heading += 360.0;
-		ssport->heading = (short) (100.0 * heading);
-		ssstbd->heading = (short) (100.0 * heading);
-
-		/* get sonardepth */
-		ssport->startDepth = sonardepth /
-				ssport->sampleInterval / 0.00000075;
-		ssstbd->startDepth = sonardepth /
-				ssstbd->sampleInterval / 0.00000075;
-		ssport->sonardepth = 1000 * sonardepth;
-		ssstbd->sonardepth = 1000 * sonardepth;
-
-		/* get attitude */
-		ssport->roll = 32768 * roll / 180.0;
-		ssport->pitch = 32768 * pitch / 180.0;
-		ssport->heaveCompensation = heave /
-				ssport->sampleInterval / 0.00000075;
-		ssstbd->roll = 32768 * roll / 180.0;
-		ssstbd->pitch = 32768 * pitch / 180.0;
-		ssstbd->heaveCompensation = heave /
-				ssstbd->sampleInterval / 0.00000075;
-		}
-
-	/* preprocess comment */
-	else if (store->kind == MB_DATA_COMMENT)
-		{
-		}
-
-	/* preprocess anything else */
-	else
-		{
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_jstar_extract(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int time_i[7], double *time_d,
-		double *navlon, double *navlat,
-		double *speed, double *heading,
-		int *nbath, int *namp, int *nss,
-		char *beamflag, double *bath, double *amp,
-		double *bathacrosstrack, double *bathalongtrack,
-		double *ss, double *ssacrosstrack, double *ssalongtrack,
-		char *comment, int *error)
-{
-	char	*function_name = "mbsys_jstar_extract";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_jstar_struct *store;
-	struct mbsys_jstar_channel_struct *sbp;
-	struct mbsys_jstar_channel_struct *ssport;
-	struct mbsys_jstar_channel_struct *ssstbd;
-	int	time_j[5];
-	double	rawpixelsize;
-	double	pixelsize;
-	double	range, altitude;
-	double	weight;
-	int	istart, jstart;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_jstar_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract subbottom data from structure */
-	if (*kind == MB_DATA_SUBBOTTOM_SUBBOTTOM)
-		{
-		/* get channel */
-		sbp = (struct mbsys_jstar_channel_struct *) &(store->sbp);
-
-		/* get time */
-		time_j[0] = sbp->year;
-		time_j[1] = sbp->day;
-		time_j[2] = 60 * sbp->hour + sbp->minute;
-		time_j[3] = sbp->second;
-		time_j[4] = (int)1000 * (sbp->millisecondsToday
-				- 1000 * floor(0.001 * ((double)sbp->millisecondsToday)));
-		mb_get_itime(verbose,time_j,time_i);
-		mb_get_time(verbose,time_i,time_d);
-
-		/* get navigation */
-		*navlon = sbp->groupCoordX / 600000.0;
-		*navlat = sbp->groupCoordY / 600000.0;
-
-		/* get heading */
-		*heading = sbp->heading / 100.0;
-		if (*heading > 360.0)
-			*heading -= 360.0;
-		if (*heading < 0.0)
-			*heading += 360.0;
-
-		/* get speed */
-		*speed = 0.0;
-
-		/* set beamwidths in mb_io structure */
-		mb_io_ptr->beamwidth_ltrack = 20.0;
-		mb_io_ptr->beamwidth_xtrack = 20.0;
-
-		/* read distance and depth values into storage arrays */
-		*nbath = 1;
-		*namp = 0;
-		*nss = 0;
-
-		/* get nadir depth */
-		if (sbp->depth > 0)
-			{
-			bath[0] = 0.001 * sbp->depth;
-			beamflag[0] = MB_FLAG_NONE;
-			}
-		else if (sbp->depth < 0)
-			{
-			bath[0] = -0.001 * sbp->depth;
-			beamflag[0] = MB_FLAG_MANUAL + MB_FLAG_FLAG;
-			}
-		else
-			{
-			bath[0] = 0.0;
-			beamflag[0] = MB_FLAG_NULL;
-			}
-
-		/* print debug statements */
-		if (verbose >= 5)
-			{
-			fprintf(stderr,"\ndbg4  Data extracted by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  Extracted values:\n");
-			fprintf(stderr,"dbg4       kind:       %d\n",
-				*kind);
-			fprintf(stderr,"dbg4       error:      %d\n",
-				*error);
-			fprintf(stderr,"dbg4       time_i[0]:  %d\n",
-				time_i[0]);
-			fprintf(stderr,"dbg4       time_i[1]:  %d\n",
-				time_i[1]);
-			fprintf(stderr,"dbg4       time_i[2]:  %d\n",
-				time_i[2]);
-			fprintf(stderr,"dbg4       time_i[3]:  %d\n",
-				time_i[3]);
-			fprintf(stderr,"dbg4       time_i[4]:  %d\n",
-				time_i[4]);
-			fprintf(stderr,"dbg4       time_i[5]:  %d\n",
-				time_i[5]);
-			fprintf(stderr,"dbg4       time_i[6]:  %d\n",
-				time_i[6]);
-			fprintf(stderr,"dbg4       time_d:     %f\n",
-				*time_d);
-			fprintf(stderr,"dbg4       longitude:  %f\n",
-				*navlon);
-			fprintf(stderr,"dbg4       latitude:   %f\n",
-				*navlat);
-			fprintf(stderr,"dbg4       speed:      %f\n",
-				*speed);
-			fprintf(stderr,"dbg4       heading:    %f\n",
-				*heading);
-			fprintf(stderr,"dbg4       nbath:      %d\n",
-				*nbath);
-			for (i=0;i<*nbath;i++)
-			  fprintf(stderr,"dbg4       beam:%4d  flag:%3d  bath:%f  bathdist:%f\n",
-				i,beamflag[i],bath[i],
-				bathacrosstrack[i]);
-			fprintf(stderr,"dbg4        nss:      %d\n",
-				*nss);
-			for (i=0;i<*nss;i++)
-			  fprintf(stderr,"dbg4        beam:%d   ss:%f  acrosstrack:%f  alongtrack:%f\n",
-				i,ss[i],ssacrosstrack[i],ssalongtrack[i]);
-			}
-
-		/* done translating values */
-
-		}
-
-	/* extract sidescan data from structure */
-	else if (*kind == MB_DATA_DATA
-		|| *kind == MB_DATA_SIDESCAN2)
-		{
-		/* get channels */
-		ssport = (struct mbsys_jstar_channel_struct *) &(store->ssport);
-		ssstbd = (struct mbsys_jstar_channel_struct *) &(store->ssstbd);
-
-		/* get time */
-		time_j[0] = ssport->year;
-		time_j[1] = ssport->day;
-		time_j[2] = 60 * ssport->hour + ssport->minute;
-		time_j[3] = ssport->second;
-		time_j[4] = (int)1000 * (ssport->millisecondsToday
-				- 1000 * floor(0.001 * ((double)ssport->millisecondsToday)));
-		mb_get_itime(verbose,time_j,time_i);
-		mb_get_time(verbose,time_i,time_d);
-
-		/* get navigation */
-		*navlon = ssport->groupCoordX / 600000.0;
-		*navlat = ssport->groupCoordY / 600000.0;
-
-		/* get heading */
-		*heading = ssport->heading / 100.0;
-		if (*heading > 360.0)
-			*heading -= 360.0;
-		if (*heading < 0.0)
-			*heading += 360.0;
-
-		/* get speed */
-		*speed = 0.0;
-
-		/* set beamwidths in mb_io structure */
-		mb_io_ptr->beamwidth_ltrack = 1.5;
-		mb_io_ptr->beamwidth_xtrack = 0.1;
-
-		/* read distance and depth values into storage arrays */
-		/* average sidescan into a MBSYS_JSTAR_PIXELS_MAX pixel array */
-		*nbath = 1;
-		*namp = 0;
-		if ((ssport->samples + ssstbd->samples) > MBSYS_JSTAR_PIXELS_MAX)
-			*nss = MBSYS_JSTAR_PIXELS_MAX;
-		else
-			*nss = ssport->samples + ssstbd->samples;
-
-		/* get nadir depth */
-		if (ssport->depth > 0)
-			{
-			bath[0] = 0.001 * ssport->depth;
-			beamflag[0] = MB_FLAG_NONE;
-			}
-		else if (ssport->depth < 0)
-			{
-			bath[0] = -0.001 * ssport->depth;
-			beamflag[0] = MB_FLAG_MANUAL + MB_FLAG_FLAG;
-			}
-		else
-			{
-			bath[0] = 0.0;
-			beamflag[0] = MB_FLAG_NULL;
-			}
-
-		/* get pixel sizes and bottom arrival */
-		rawpixelsize = ssport->sampleInterval * 0.00000075;
-		if ((ssport->samples + ssstbd->samples) > *nss)
-			pixelsize = rawpixelsize
-					* ((double)(ssport->samples + ssstbd->samples))
-				 	/ ((double)(*nss));
-		else
-			pixelsize = rawpixelsize;
-		altitude = 0.001 * ssport->sonaraltitude;
-/*fprintf(stderr,"rawpixelsize:%f pixelsize:%f altitude:%f\n", rawpixelsize,pixelsize,altitude);*/
-
-		/* zero the array */
-		for (i=0;i<*nss;i++)
-			{
-			ss[i] = 0.0;
-			range = altitude + fabs(pixelsize * (i - *nss / 2));
-			ssacrosstrack[i] = sqrt(range * range - altitude * altitude);
-			if (i < *nss / 2)
-				ssacrosstrack[i] = -ssacrosstrack[i];
-			ssalongtrack[i] = 0.0;
-/*fprintf(stderr,"i:%d range:%f altitude:%f xtrack:%f\n",i,range,altitude,ssacrosstrack[i]);*/
-			}
-
-		/* bin the data */
-		istart = (int)(altitude / rawpixelsize);
-/*fprintf(stderr,"istart:%d altitude:%f rawpixelsize:%f startDepth:%d\n",
-istart,altitude,rawpixelsize,ssport->startDepth);*/
-		weight = exp(MB_LN_2 * ((double)ssport->weightingFactor));
-/*fprintf(stderr, "Subsystem: %d Weights: %d %f ",ssport->message.subsystem,ssport->weightingFactor,weight);*/
-		jstart = *nss / 2;
-/*fprintf(stderr,"Port istart:%d of %d    jstart:%d of %d\n",istart,ssport->samples,jstart,*nss);*/
-		for (i=istart;i<ssport->samples;i++)
-			{
-			range = rawpixelsize * (i + ssport->startDepth);
-			j = jstart - (int)((i - istart) * rawpixelsize / pixelsize);
-			ss[j] += ssport->trace[i] / weight;
-			ssalongtrack[j] += 1.0;
-/*fprintf(stderr,"Binning Port: i:%d j:%d ss:%f\n",i,j,ss[j]/ssalongtrack[j]);*/
-			}
-		istart = MAX(0, ((int)(altitude / rawpixelsize)));
-		weight = exp(MB_LN_2 * ((double)ssstbd->weightingFactor));
-/*fprintf(stderr, "   %d %f\n",ssstbd->weightingFactor,weight);*/
-/*fprintf(stderr,"Stbd istart:%d of %d    jstart:%d of %d\n",istart,ssstbd->samples,jstart,*nss);*/
-		for (i=istart;i<ssstbd->samples;i++)
-			{
-			range = rawpixelsize * (i + ssstbd->startDepth);
-			j = jstart + (int)((i - istart) * rawpixelsize / pixelsize);
-			ss[j] += ssstbd->trace[i] / weight;
-			ssalongtrack[j] += 1.0;
-/*fprintf(stderr,"Binning Stbd: i:%d j:%d ss:%f\n",i,j,ss[j]/ssalongtrack[j]);*/
-			}
-
-		/* average the data in the bins */
-		for (i=0;i<*nss;i++)
-			{
-			if (ss[i] > 0.0 && ssalongtrack[i] > 0.0)
-				{
-				ss[i] /= ssalongtrack[i];
-				ssalongtrack[i] = 0.0;
-				}
-			else
-				{
-				ss[i] = MB_SIDESCAN_NULL;
-				}
-			}
-		for (i=*nss;i<MBSYS_JSTAR_PIXELS_MAX;i++)
-			{
-			ss[i] = MB_SIDESCAN_NULL;
-			}
-
-		/* print debug statements */
-		if (verbose >= 5)
-			{
-			fprintf(stderr,"\ndbg4  Data extracted by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  Extracted values:\n");
-			fprintf(stderr,"dbg4       kind:       %d\n",
-				*kind);
-			fprintf(stderr,"dbg4       error:      %d\n",
-				*error);
-			fprintf(stderr,"dbg4       time_i[0]:  %d\n",
-				time_i[0]);
-			fprintf(stderr,"dbg4       time_i[1]:  %d\n",
-				time_i[1]);
-			fprintf(stderr,"dbg4       time_i[2]:  %d\n",
-				time_i[2]);
-			fprintf(stderr,"dbg4       time_i[3]:  %d\n",
-				time_i[3]);
-			fprintf(stderr,"dbg4       time_i[4]:  %d\n",
-				time_i[4]);
-			fprintf(stderr,"dbg4       time_i[5]:  %d\n",
-				time_i[5]);
-			fprintf(stderr,"dbg4       time_i[6]:  %d\n",
-				time_i[6]);
-			fprintf(stderr,"dbg4       time_d:     %f\n",
-				*time_d);
-			fprintf(stderr,"dbg4       longitude:  %f\n",
-				*navlon);
-			fprintf(stderr,"dbg4       latitude:   %f\n",
-				*navlat);
-			fprintf(stderr,"dbg4       speed:      %f\n",
-				*speed);
-			fprintf(stderr,"dbg4       heading:    %f\n",
-				*heading);
-			fprintf(stderr,"dbg4       nbath:      %d\n",
-				*nbath);
-			for (i=0;i<*nbath;i++)
-			  fprintf(stderr,"dbg4       beam:%4d  flag:%3d  bath:%f  bathdist:%f\n",
-				i,beamflag[i],bath[i],
-				bathacrosstrack[i]);
-			fprintf(stderr,"dbg4        nss:      %d\n",
-				*nss);
-			for (i=0;i<*nss;i++)
-			  fprintf(stderr,"dbg4        pixel:%d   ss:%f  acrosstrack:%f  alongtrack:%f\n",
-				i,ss[i],ssacrosstrack[i],ssalongtrack[i]);
-			}
-
-		/* done translating values */
-
-		}
-
-	/* extract comment from structure */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* copy comment */
-		strcpy(comment,store->comment.comment);
-
-		/* print debug statements */
-		if (verbose >= 4)
-			{
-			fprintf(stderr,"\ndbg4  New ping read by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  New ping values:\n");
-			fprintf(stderr,"dbg4       error:      %d\n",
-				*error);
-			fprintf(stderr,"dbg4       comment:    %s\n",
-				comment);
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind == MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"dbg2       comment:     \ndbg2       %s\n",
-			comment);
-		}
-	else if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind != MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"dbg2       time_i[0]:     %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:     %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:     %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:     %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:     %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:     %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:     %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:        %f\n",*time_d);
-		fprintf(stderr,"dbg2       longitude:     %f\n",*navlon);
-		fprintf(stderr,"dbg2       latitude:      %f\n",*navlat);
-		fprintf(stderr,"dbg2       speed:         %f\n",*speed);
-		fprintf(stderr,"dbg2       heading:       %f\n",*heading);
-		}
-	if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& (*kind == MB_DATA_DATA
-		|| *kind == MB_DATA_SIDESCAN2))
-		{
-		fprintf(stderr,"dbg2       nbath:         %d\n",*nbath);
-		for (i=0;i<*nbath;i++)
-		  fprintf(stderr,"dbg2       beam:%4d  flag:%3d  bath:%f  bathdist:%f\n",
-			i,beamflag[i],bath[i],
-			bathacrosstrack[i]);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_jstar_insert(int verbose, void *mbio_ptr, void *store_ptr,
-		int kind, int time_i[7], double time_d,
-		double navlon, double navlat,
-		double speed, double heading,
-		int nbath, int namp, int nss,
-		char *beamflag, double *bath, double *amp,
-		double *bathacrosstrack, double *bathalongtrack,
-		double *ss, double *ssacrosstrack, double *ssalongtrack,
-		char *comment, int *error)
-{
-	char	*function_name = "mbsys_jstar_insert";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_jstar_struct *store;
-	struct mbsys_jstar_channel_struct *sbp;
-	struct mbsys_jstar_channel_struct *ssport;
-	struct mbsys_jstar_channel_struct *ssstbd;
-	int	time_j[5];
-	double	weight, altitude, xtrackmax, range, pixelsize, ssmax;
-	int	istart, jstart, jxtrackmax;
-	int	shortspersample;
-	int	nsamples, trace_size;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       kind:       %d\n",kind);
-		}
-	if (verbose >= 2 && (kind == MB_DATA_DATA || kind == MB_DATA_SIDESCAN2 || kind == MB_DATA_NAV))
-		{
-		fprintf(stderr,"dbg2       time_i[0]:  %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:  %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:  %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:  %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:  %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:  %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:  %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:     %f\n",time_d);
-		fprintf(stderr,"dbg2       navlon:     %f\n",navlon);
-		fprintf(stderr,"dbg2       navlat:     %f\n",navlat);
-		fprintf(stderr,"dbg2       speed:      %f\n",speed);
-		fprintf(stderr,"dbg2       heading:    %f\n",heading);
-		}
-	if (verbose >= 2 && (kind == MB_DATA_DATA || kind == MB_DATA_SIDESCAN2))
-		{
-		fprintf(stderr,"dbg2       nbath:      %d\n",nbath);
-		if (verbose >= 3)
-		 for (i=0;i<nbath;i++)
-		  fprintf(stderr,"dbg3       beam:%4d  flag:%3d  bath:%f  bathdist:%f\n",
-			i,beamflag[i],bath[i],
-			bathacrosstrack[i]);
-		fprintf(stderr,"dbg2       namp:       %d\n",namp);
-		if (verbose >= 3)
-		 for (i=0;i<namp;i++)
-		  fprintf(stderr,"dbg3        amp[%d]: %f\n",
-			i,amp[i]);
-		fprintf(stderr,"dbg2        nss:       %d\n",nss);
-		if (verbose >= 3)
-		 for (i=0;i<nss;i++)
-		  fprintf(stderr,"dbg3        ss[%d]: %f    ssdist[%d]: %f\n",
-			i,ss[i],i,ssacrosstrack[i]);
-		}
-	if (verbose >= 2 && kind == MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"dbg2       comment:     \ndbg2       %s\n",
-			comment);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_jstar_struct *) store_ptr;
-
-	/* set data kind */
-	store->kind = kind;
-
-	/* insert subbottom data into structure */
-	if (kind == MB_DATA_SUBBOTTOM_SUBBOTTOM)
-		{
-		/* get channel */
-		sbp = (struct mbsys_jstar_channel_struct *) &(store->sbp);
-
-		/* set kind and subsystem */
-		store->kind = MB_DATA_SUBBOTTOM_SUBBOTTOM;
-		store->subsystem = MBSYS_JSTAR_SUBSYSTEM_SBP;
-
-		/* get time */
-		mb_get_jtime(verbose,time_i,time_j);
-		sbp->year = time_i[0];
-		sbp->day = time_j[1];
-		sbp->hour = time_i[3];
-		sbp->minute = time_i[4];
-		sbp->second = time_i[5];
-		sbp->millisecondsToday = 0.001 * time_i[6]
-					+ 1000 * (time_i[5]
-						+ 60.0 * (time_i[4]
-							+ 60.0 * time_i[3]));
-
-		/* get navigation */
-		if (navlon < 180.0) navlon = navlon + 360.0;
-		if (navlon > 180.0) navlon = navlon - 360.0;
-		sbp->sourceCoordX = (int) (600000.0 * navlon);
-		sbp->sourceCoordY = (int) (600000.0 * navlat);
-		sbp->groupCoordX = (int) (600000.0 * navlon);
-		sbp->groupCoordY = (int) (600000.0 * navlat);
-
-		/* get heading */
-		if (heading > 180.0)
-			heading -= 360.0;
-		if (heading < -180.0)
-			heading += 360.0;
-		sbp->heading = (short) (100.0 * heading);
-
-		/* read distance and depth values into storage arrays */
-
-		}
-
-	/* insert data in structure */
-	else if (store->kind == MB_DATA_DATA || store->kind == MB_DATA_SIDESCAN2)
-		{
-		/* get channels */
-		ssport = (struct mbsys_jstar_channel_struct *) &(store->ssport);
-		ssstbd = (struct mbsys_jstar_channel_struct *) &(store->ssstbd);
-
-		/* set kind and subsystem */
-		if (ssport->message.subsystem == MBSYS_JSTAR_SUBSYSTEM_SSLOW
-			&& ssstbd->message.subsystem == MBSYS_JSTAR_SUBSYSTEM_SSLOW)
-			{
-			store->subsystem = MBSYS_JSTAR_SUBSYSTEM_SSLOW;
-			}
-		else if (ssport->message.subsystem == MBSYS_JSTAR_SUBSYSTEM_SSHIGH
-			&& ssstbd->message.subsystem == MBSYS_JSTAR_SUBSYSTEM_SSHIGH)
-			{
-			store->subsystem = MBSYS_JSTAR_SUBSYSTEM_SSHIGH;
-			}
-		else if (mb_io_ptr->format == MBF_EDGJSTAR)
-			{
-			if (store->kind == MB_DATA_DATA)
-				{
-				store->subsystem = MBSYS_JSTAR_SUBSYSTEM_SSLOW;
-				ssport->message.subsystem = MBSYS_JSTAR_SUBSYSTEM_SSLOW;
-				ssstbd->message.subsystem = MBSYS_JSTAR_SUBSYSTEM_SSLOW;
-				}
-			else
-				{
-				store->subsystem = MBSYS_JSTAR_SUBSYSTEM_SSHIGH;
-				ssport->message.subsystem = MBSYS_JSTAR_SUBSYSTEM_SSHIGH;
-				ssstbd->message.subsystem = MBSYS_JSTAR_SUBSYSTEM_SSHIGH;
-				}
-			}
-		else if (mb_io_ptr->format == MBF_EDGJSTR2)
-			{
-			if (store->kind == MB_DATA_DATA)
-				{
-				store->subsystem = MBSYS_JSTAR_SUBSYSTEM_SSHIGH;
-				ssport->message.subsystem = MBSYS_JSTAR_SUBSYSTEM_SSHIGH;
-				ssstbd->message.subsystem = MBSYS_JSTAR_SUBSYSTEM_SSHIGH;
-				}
-			else
-				{
-				store->subsystem = MBSYS_JSTAR_SUBSYSTEM_SSLOW;
-				ssport->message.subsystem = MBSYS_JSTAR_SUBSYSTEM_SSLOW;
-				ssstbd->message.subsystem = MBSYS_JSTAR_SUBSYSTEM_SSLOW;
-				}
-			}
-		else
-			{
-			ssport->message.subsystem = MBSYS_JSTAR_SUBSYSTEM_SSHIGH;
-			ssstbd->message.subsystem = MBSYS_JSTAR_SUBSYSTEM_SSHIGH;
-			}
-
-		/* get time */
-		mb_get_jtime(verbose,time_i,time_j);
-		ssport->year = time_i[0];
-		ssport->day = time_j[1];
-		ssport->hour = time_i[3];
-		ssport->minute = time_i[4];
-		ssport->second = time_i[5];
-		ssport->millisecondsToday = 0.001 * time_i[6]
-					+ 1000 * (time_i[5]
-						+ 60.0 * (time_i[4]
-							+ 60.0 * time_i[3]));
-		ssstbd->year = time_i[0];
-		ssstbd->day = time_j[1];
-		ssstbd->hour = time_i[3];
-		ssstbd->minute = time_i[4];
-		ssstbd->second = time_i[5];
-		ssstbd->millisecondsToday = 0.001 * time_i[6]
-					+ 1000 * (time_i[5]
-						+ 60.0 * (time_i[4]
-							+ 60.0 * time_i[3]));
-
-		/* get navigation */
-		if (navlon < 180.0) navlon = navlon + 360.0;
-		if (navlon > 180.0) navlon = navlon - 360.0;
-		ssport->sourceCoordX = 600000.0 * navlon;
-		ssport->sourceCoordY = 600000.0 * navlat;
-		ssstbd->sourceCoordX = 600000.0 * navlon;
-		ssstbd->sourceCoordY = 600000.0 * navlat;
-		ssport->groupCoordX = 600000.0 * navlon;
-		ssport->groupCoordY = 600000.0 * navlat;
-		ssstbd->groupCoordX = 600000.0 * navlon;
-		ssstbd->groupCoordY = 600000.0 * navlat;
-
-		/* get heading and speed */
-		if (heading > 180.0)
-			heading -= 360.0;
-		if (heading < -180.0)
-			heading += 360.0;
-		ssport->heading = (short) (100.0 * heading);
-		ssstbd->heading = (short) (100.0 * heading);
-
-		/* put distance and depth values
-			into data structure */
-
-		/* get nadir depth */
-		if (nbath > 0)
-			{
-			ssport->depth = 1000 * bath[nbath/2];
-			if (beamflag[nbath/2] == MB_FLAG_NULL)
-				ssport->depth = 0;
-			else if (mb_beam_check_flag(beamflag[nbath/2]))
-				ssport->depth = -ssport->depth;
-			}
-
-		/* get lateral pixel size */
-		altitude = 0.001 * ssport->sonaraltitude;
-		xtrackmax = 0.0;
-		jxtrackmax = nss / 2;
-		pixelsize = 2.0 * altitude / nss;
-		nsamples = nss / 2;
-		range = altitude;
-		for (j=0;j<nss;j++)
-			{
-			if (xtrackmax < fabs(ssacrosstrack[j]))
-				{
-				xtrackmax = fabs(ssacrosstrack[j]);
-				jxtrackmax = j;
-				}
-			}
-		if (altitude >= 0.0 && xtrackmax >= 0.0 && jxtrackmax != nss / 2)
-			{
-			range = sqrt(xtrackmax * xtrackmax + altitude * altitude);
-			pixelsize = (range - altitude) / (fabs(jxtrackmax - nss / 2));
-			nsamples = (int)MIN((double)(nss/2), (range / pixelsize));
-			}
-		else
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_UNINTELLIGIBLE;
-			}
-
-		/* allocate memory for the trace */
-		if (status == MB_SUCCESS)
-			{
-			ssport->dataFormat = 0;
-			ssstbd->dataFormat = 0;
-			shortspersample = 2;
-			trace_size = shortspersample * nsamples * sizeof(short);
-			if (ssport->trace_alloc < trace_size)
-				{
-				if ((status = mb_reallocd(verbose, __FILE__,__LINE__, trace_size, (void **)&(ssport->trace), error))
-					== MB_SUCCESS)
-					{
-					ssport->trace_alloc = trace_size;
-					}
-				}
-			if (ssstbd->trace_alloc < trace_size)
-				{
-				if ((status = mb_reallocd(verbose, __FILE__,__LINE__, trace_size, (void **)&(ssstbd->trace), error))
-					== MB_SUCCESS)
-					{
-					ssstbd->trace_alloc = trace_size;
-					}
-				}
-			}
-
-		/* put sidescan values
-			into data structure */
-		if (status == MB_SUCCESS)
-			{
-			/* reset sample interval */
-			ssport->sampleInterval = (int)(1000000000.0 * pixelsize / 750.0);
-			ssport->startDepth = (int)((0.001 * ssport->sonardepth)
-							/ pixelsize);
-			ssport->samples = nsamples;
-			ssstbd->sampleInterval = (int)(1000000000.0 * pixelsize / 750.0);
-			ssstbd->startDepth = (int)((0.001 * ssstbd->sonardepth)
-							/ pixelsize);
-			ssstbd->samples = nsamples;
-
-
-			/* zero trace before bottom arrival */
-			istart = (int)(altitude / pixelsize);
-			for (i=0;i<istart;i++)
-				{
-				ssport->trace[i] = 0;
-				ssstbd->trace[i] = 0;
-				}
-
-			/* get maximum value to determine scaling */
-			ssmax = 0.0;
-			for (i=0;i<nss;i++)
-				ssmax = MAX(ssmax, ss[i]);
-			if (ssmax > 0.0)
-				{
-				weight = 65535.0 / ssmax;
-				ssport->weightingFactor = log(weight) / MB_LN_2;
-				ssstbd->weightingFactor = ssport->weightingFactor;
-				}
-
-			/* insert port and starboard traces from sidescan swath */
-			jstart = nss / 2 - 1;
-			weight = exp(MB_LN_2 * ((double)ssport->weightingFactor));
-			for (j=jstart;j>=0;j--)
-				{
-				i = istart + (jstart - j);
-				ssport->trace[i] = (short) (ss[j] * weight);
-				}
-			jstart = nss / 2;
-			weight = exp(MB_LN_2 * ((double)ssstbd->weightingFactor));
-			for (j=jstart;j<nss;j++)
-				{
-				i = istart + (j - jstart);
-				ssstbd->trace[i] = (short) (ss[j] * weight);
-				}
-			}
-		}
-
-	/* insert comment in structure */
-	else if (store->kind == MB_DATA_COMMENT)
-		{
-		strcpy(store->comment.comment,comment);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_jstar_ttimes(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, int *nbeams,
-	double *ttimes, double *angles,
-	double *angles_forward, double *angles_null,
-	double *heave, double *alongtrack_offset,
-	double *draft, double *ssv, int *error)
-{
-	char	*function_name = "mbsys_jstar_ttimes";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_jstar_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       ttimes:     %p\n",(void *)ttimes);
-		fprintf(stderr,"dbg2       angles_xtrk:%p\n",(void *)angles);
-		fprintf(stderr,"dbg2       angles_ltrk:%p\n",(void *)angles_forward);
-		fprintf(stderr,"dbg2       angles_null:%p\n",(void *)angles_null);
-		fprintf(stderr,"dbg2       heave:      %p\n",(void *)heave);
-		fprintf(stderr,"dbg2       ltrk_off:   %p\n",(void *)alongtrack_offset);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_jstar_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA
-		|| *kind == MB_DATA_SIDESCAN2)
-		{
-		/* get nbeams */
-		*nbeams = 0;
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error == MB_ERROR_NO_ERROR)
-		{
-		fprintf(stderr,"dbg2       draft:      %f\n",*draft);
-		fprintf(stderr,"dbg2       ssv:        %f\n",*ssv);
-		fprintf(stderr,"dbg2       nbeams:     %d\n",*nbeams);
-		for (i=0;i<*nbeams;i++)
-			fprintf(stderr,"dbg2       beam %d: tt:%f  angle_xtrk:%f  angle_ltrk:%f  angle_null:%f  depth_off:%f  ltrk_off:%f\n",
-				i,ttimes[i],angles[i],
-				angles_forward[i],angles_null[i],
-				heave[i],alongtrack_offset[i]);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_jstar_detects(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, int *nbeams,
-	int *detects, int *error)
-{
-	char	*function_name = "mbsys_jstar_detects";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_jstar_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       detects:    %p\n",(void *)detects);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_jstar_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get nbeams */
-		*nbeams = 0;
-
-		/* set status */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error == MB_ERROR_NO_ERROR)
-		{
-		fprintf(stderr,"dbg2       nbeams:     %d\n",*nbeams);
-		for (i=0;i<*nbeams;i++)
-			fprintf(stderr,"dbg2       beam %d: detects:%d\n",
-				i,detects[i]);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_jstar_extract_altitude(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, double *transducer_depth, double *altitude,
-	int *error)
-{
-	char	*function_name = "mbsys_jstar_extract_altitude";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_jstar_struct *store;
-	struct mbsys_jstar_channel_struct *sbp;
-	struct mbsys_jstar_channel_struct *ssport;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_jstar_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_SUBBOTTOM_SUBBOTTOM)
-		{
-		/* get channel */
-		sbp = (struct mbsys_jstar_channel_struct *) &(store->sbp);
-
-		/* get transducer_depth */
-		if (sbp->sonardepth > 0)
-			*transducer_depth = 0.001 * sbp->sonardepth
-						+ sbp->heaveCompensation * sbp->sampleInterval * 0.00000075;
-		else
-			*transducer_depth = sbp->startDepth * sbp->sampleInterval * 0.00000075
-						+ sbp->heaveCompensation * sbp->sampleInterval * 0.00000075;
-		*altitude = 0.001 * sbp->sonaraltitude;
-		}
-
-	else if (*kind == MB_DATA_DATA
-		|| *kind == MB_DATA_SIDESCAN2)
-		{
-		/* get channel */
-		ssport = (struct mbsys_jstar_channel_struct *) &(store->ssport);
-
-		/* get transducer_depth */
-		if (ssport->sonardepth > 0)
-			*transducer_depth = 0.001 * ssport->sonardepth
-						+ ssport->heaveCompensation * ssport->sampleInterval * 0.00000075;
-		else
-			*transducer_depth = ssport->startDepth * ssport->sampleInterval * 0.00000075
-						+ ssport->heaveCompensation * ssport->sampleInterval * 0.00000075;
-		*altitude = 0.001 * ssport->sonaraltitude;
-
-		/* set status */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:              %d\n",*kind);
-		fprintf(stderr,"dbg2       transducer_depth:  %f\n",*transducer_depth);
-		fprintf(stderr,"dbg2       altitude:          %f\n",*altitude);
-		fprintf(stderr,"dbg2       error:             %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:            %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_jstar_insert_altitude(int verbose, void *mbio_ptr, void *store_ptr,
-	double transducer_depth, double altitude, int *error)
-{
-	char	*function_name = "mbsys_jstar_insert_altitude";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_jstar_struct *store;
-	struct mbsys_jstar_channel_struct *sbp;
-	struct mbsys_jstar_channel_struct *ssport;
-	struct mbsys_jstar_channel_struct *ssstbd;
-	int	kind;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       transducer_depth:  %f\n",transducer_depth);
-		fprintf(stderr,"dbg2       altitude:          %f\n",altitude);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_jstar_struct *) store_ptr;
-
-	/* get data kind */
-	kind = store->kind;
-
-	/* extract data from structure */
-	if (kind == MB_DATA_SUBBOTTOM_SUBBOTTOM)
-		{
-		/* get channel */
-		sbp = (struct mbsys_jstar_channel_struct *) &(store->sbp);
-
-		/* get transducer_depth and altitude */
-		sbp->sonardepth = 1000 * (transducer_depth - sbp->heaveCompensation * sbp->sampleInterval * 0.00000075);
-		sbp->sonaraltitude = 1000 * altitude;
-		}
-
-	else if (kind == MB_DATA_DATA
-		|| kind == MB_DATA_SIDESCAN2)
-		{
-		/* get channel */
-		ssport = (struct mbsys_jstar_channel_struct *) &(store->ssport);
-		ssstbd = (struct mbsys_jstar_channel_struct *) &(store->ssstbd);
-
-		/* get transducer_depth and altitude */
-		ssport->sonardepth = 1000 * (transducer_depth - ssport->heaveCompensation * ssport->sampleInterval * 0.00000075);
-		ssport->sonaraltitude = 1000 * altitude;
-		ssstbd->sonardepth = 1000 * (transducer_depth - ssstbd->heaveCompensation * ssstbd->sampleInterval * 0.00000075);
-		ssstbd->sonaraltitude = 1000 * altitude;
-
-		/* set status */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:             %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:            %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_jstar_extract_nav(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int time_i[7], double *time_d,
-		double *navlon, double *navlat,
-		double *speed, double *heading, double *draft,
-		double *roll, double *pitch, double *heave,
-		int *error)
-{
-	char	*function_name = "mbsys_jstar_extract_nav";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_jstar_struct *store;
-	struct mbsys_jstar_channel_struct *sbp;
-	struct mbsys_jstar_channel_struct *ssport;
-	int	time_j[5];
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_jstar_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract subbottom data from structure */
-	if (*kind == MB_DATA_SUBBOTTOM_SUBBOTTOM)
-		{
-		/* get channel */
-		sbp = (struct mbsys_jstar_channel_struct *) &(store->sbp);
-
-		/* get time */
-		time_j[0] = sbp->year;
-		time_j[1] = sbp->day;
-		time_j[2] = 60 * sbp->hour + sbp->minute;
-		time_j[3] = sbp->second;
-		time_j[4] = (int)1000 * (sbp->millisecondsToday
-				- 1000 * floor(0.001 * ((double)sbp->millisecondsToday)));
-		mb_get_itime(verbose,time_j,time_i);
-		mb_get_time(verbose,time_i,time_d);
-
-		/* get navigation */
-		*navlon = sbp->groupCoordX / 600000.0;
-		*navlat = sbp->groupCoordY / 600000.0;
-
-		/* get heading */
-		*heading = sbp->heading / 100.0;
-		if (*heading > 360.0)
-			*heading -= 360.0;
-		if (*heading < 0.0)
-			*heading += 360.0;
-
-		/* get speed */
-		*speed = 0.0;
-
-		/* get draft */
-		if (sbp->sonardepth > 0)
-			*draft = 0.001 * sbp->sonardepth;
-		else
-			*draft = sbp->startDepth
-				* sbp->sampleInterval * 0.00000075;
-
-		/* get attitude */
-		*roll = 180.0 / 32768.0 * (double)sbp->roll;
-		*pitch = 180.0 / 32768.0 * (double)sbp->pitch;
-		*heave = sbp->heaveCompensation
-				* sbp->sampleInterval * 0.00000075;
-
-		/* print debug statements */
-		if (verbose >= 5)
-			{
-			fprintf(stderr,"\ndbg4  Data extracted by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  Extracted values:\n");
-			fprintf(stderr,"dbg4       kind:       %d\n",
-				*kind);
-			fprintf(stderr,"dbg4       error:      %d\n",
-				*error);
-			fprintf(stderr,"dbg4       time_i[0]:  %d\n",
-				time_i[0]);
-			fprintf(stderr,"dbg4       time_i[1]:  %d\n",
-				time_i[1]);
-			fprintf(stderr,"dbg4       time_i[2]:  %d\n",
-				time_i[2]);
-			fprintf(stderr,"dbg4       time_i[3]:  %d\n",
-				time_i[3]);
-			fprintf(stderr,"dbg4       time_i[4]:  %d\n",
-				time_i[4]);
-			fprintf(stderr,"dbg4       time_i[5]:  %d\n",
-				time_i[5]);
-			fprintf(stderr,"dbg4       time_i[6]:  %d\n",
-				time_i[6]);
-			fprintf(stderr,"dbg4       time_d:     %f\n",
-				*time_d);
-			fprintf(stderr,"dbg4       longitude:  %f\n",
-				*navlon);
-			fprintf(stderr,"dbg4       latitude:   %f\n",
-				*navlat);
-			fprintf(stderr,"dbg4       speed:      %f\n",
-				*speed);
-			fprintf(stderr,"dbg4       heading:    %f\n",
-				*heading);
-			fprintf(stderr,"dbg4       draft:      %f\n",
-				*draft);
-			fprintf(stderr,"dbg4       roll:       %f\n",
-				*roll);
-			fprintf(stderr,"dbg4       pitch:      %f\n",
-				*pitch);
-			fprintf(stderr,"dbg4       heave:      %f\n",
-				*heave);
-			}
-
-		/* done translating values */
-
-		}
-
-
-	/* extract data from structure */
-	else if (*kind == MB_DATA_DATA
-		|| *kind == MB_DATA_SIDESCAN2)
-		{
-		/* get channel */
-		ssport = (struct mbsys_jstar_channel_struct *) &(store->ssport);
-
-		/* get time */
-		time_j[0] = ssport->year;
-		time_j[1] = ssport->day;
-		time_j[2] = 60 * ssport->hour + ssport->minute;
-		time_j[3] = ssport->second;
-		time_j[4] = (int)1000 * (ssport->millisecondsToday
-				- 1000 * floor(0.001 * ((double)ssport->millisecondsToday)));
-		mb_get_itime(verbose,time_j,time_i);
-		mb_get_time(verbose,time_i,time_d);
-
-		/* get navigation */
-		*navlon = ssport->groupCoordX / 600000.0;
-		*navlat = ssport->groupCoordY / 600000.0;
-
-		/* get heading */
-		*heading = ssport->heading / 100.0;
-		if (*heading > 360.0)
-			*heading -= 360.0;
-		if (*heading < 0.0)
-			*heading += 360.0;
-
-		/* get speed */
-		*speed = 0.0;
-
-		/* get draft */
-		if (ssport->sonardepth > 0)
-			*draft = 0.001 * ssport->sonardepth;
-		else
-			*draft = ssport->startDepth
-				* ssport->sampleInterval * 0.00000075;
-
-		/* get attitude */
-		*roll = 180.0 / 32768.0 * (double)ssport->roll;
-		*pitch = 180.0 / 32768.0 * (double)ssport->pitch;
-		*heave = ssport->heaveCompensation
-				* ssport->sampleInterval * 0.00000075;
-
-		/* print debug statements */
-		if (verbose >= 5)
-			{
-			fprintf(stderr,"\ndbg4  Data extracted by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  Extracted values:\n");
-			fprintf(stderr,"dbg4       kind:       %d\n",
-				*kind);
-			fprintf(stderr,"dbg4       error:      %d\n",
-				*error);
-			fprintf(stderr,"dbg4       time_i[0]:  %d\n",
-				time_i[0]);
-			fprintf(stderr,"dbg4       time_i[1]:  %d\n",
-				time_i[1]);
-			fprintf(stderr,"dbg4       time_i[2]:  %d\n",
-				time_i[2]);
-			fprintf(stderr,"dbg4       time_i[3]:  %d\n",
-				time_i[3]);
-			fprintf(stderr,"dbg4       time_i[4]:  %d\n",
-				time_i[4]);
-			fprintf(stderr,"dbg4       time_i[5]:  %d\n",
-				time_i[5]);
-			fprintf(stderr,"dbg4       time_i[6]:  %d\n",
-				time_i[6]);
-			fprintf(stderr,"dbg4       time_d:     %f\n",
-				*time_d);
-			fprintf(stderr,"dbg4       longitude:  %f\n",
-				*navlon);
-			fprintf(stderr,"dbg4       latitude:   %f\n",
-				*navlat);
-			fprintf(stderr,"dbg4       speed:      %f\n",
-				*speed);
-			fprintf(stderr,"dbg4       heading:    %f\n",
-				*heading);
-			fprintf(stderr,"dbg4       draft:      %f\n",
-				*draft);
-			fprintf(stderr,"dbg4       roll:       %f\n",
-				*roll);
-			fprintf(stderr,"dbg4       pitch:      %f\n",
-				*pitch);
-			fprintf(stderr,"dbg4       heave:      %f\n",
-				*heave);
-			}
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind != MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"dbg2       time_i[0]:     %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:     %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:     %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:     %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:     %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:     %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:     %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:        %f\n",*time_d);
-		fprintf(stderr,"dbg2       longitude:     %f\n",*navlon);
-		fprintf(stderr,"dbg2       latitude:      %f\n",*navlat);
-		fprintf(stderr,"dbg2       speed:         %f\n",*speed);
-		fprintf(stderr,"dbg2       heading:       %f\n",*heading);
-		fprintf(stderr,"dbg2       draft:         %f\n",*draft);
-		fprintf(stderr,"dbg2       roll:          %f\n",*roll);
-		fprintf(stderr,"dbg2       pitch:         %f\n",*pitch);
-		fprintf(stderr,"dbg2       heave:         %f\n",*heave);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_jstar_insert_nav(int verbose, void *mbio_ptr, void *store_ptr,
-		int time_i[7], double time_d,
-		double navlon, double navlat,
-		double speed, double heading, double draft,
-		double roll, double pitch, double heave,
-		int *error)
-{
-	char	*function_name = "mbsys_jstar_insert_nav";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_jstar_struct *store;
-	struct mbsys_jstar_channel_struct *sbp;
-	struct mbsys_jstar_channel_struct *ssport;
-	struct mbsys_jstar_channel_struct *ssstbd;
-	int	time_j[5];
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       time_i[0]:  %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:  %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:  %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:  %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:  %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:  %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:  %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:     %f\n",time_d);
-		fprintf(stderr,"dbg2       navlon:     %f\n",navlon);
-		fprintf(stderr,"dbg2       navlat:     %f\n",navlat);
-		fprintf(stderr,"dbg2       speed:      %f\n",speed);
-		fprintf(stderr,"dbg2       heading:    %f\n",heading);
-		fprintf(stderr,"dbg2       draft:      %f\n",draft);
-		fprintf(stderr,"dbg2       roll:       %f\n",roll);
-		fprintf(stderr,"dbg2       pitch:      %f\n",pitch);
-		fprintf(stderr,"dbg2       heave:      %f\n",heave);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_jstar_struct *) store_ptr;
-
-	/* insert subbottom data into structure */
-	if (store->kind == MB_DATA_SUBBOTTOM_SUBBOTTOM)
-		{
-		/* get channel */
-		sbp = (struct mbsys_jstar_channel_struct *) &(store->sbp);
-
-		/* set kind and subsystem */
-		store->kind = MB_DATA_SUBBOTTOM_SUBBOTTOM;
-		store->subsystem = MBSYS_JSTAR_SUBSYSTEM_SBP;
-
-		/* get time */
-		mb_get_jtime(verbose,time_i,time_j);
-		sbp->year = time_i[0];
-		sbp->day = time_j[1];
-		sbp->hour = time_i[3];
-		sbp->minute = time_i[4];
-		sbp->second = time_i[5];
-		sbp->millisecondsToday = 0.001 * time_i[6]
-					+ 1000 * (time_i[5]
-						+ 60.0 * (time_i[4]
-							+ 60.0 * time_i[3]));
-
-		/* get navigation */
-		if (navlon < 180.0) navlon = navlon + 360.0;
-		if (navlon > 180.0) navlon = navlon - 360.0;
-		sbp->sourceCoordX = (int) (600000.0 * navlon);
-		sbp->sourceCoordY = (int) (600000.0 * navlat);
-		sbp->groupCoordX = (int) (600000.0 * navlon);
-		sbp->groupCoordY = (int) (600000.0 * navlat);
-
-		/* get heading */
-		if (heading > 180.0)
-			heading -= 360.0;
-		if (heading < -180.0)
-			heading += 360.0;
-		sbp->heading = (short) (100.0 * heading);
-
-		/* get draft */
-		sbp->startDepth = draft /
-				sbp->sampleInterval / 0.00000075;
-		sbp->sonardepth = 1000 * draft;
-
-		/* get attitude */
-		sbp->roll = 32768 * roll / 180.0;
-		sbp->pitch = 32768 * pitch / 180.0;
-		sbp->heaveCompensation = heave /
-				sbp->sampleInterval / 0.00000075;
-
-		}
-
-	/* insert data in structure */
-	else if (store->kind == MB_DATA_DATA || store->kind == MB_DATA_SIDESCAN2)
-		{
-		/* get channels */
-		ssport = (struct mbsys_jstar_channel_struct *) &(store->ssport);
-		ssstbd = (struct mbsys_jstar_channel_struct *) &(store->ssstbd);
-
-		/* set kind and subsystem */
-		store->kind = MB_DATA_DATA;
-		if (ssport->message.subsystem == MBSYS_JSTAR_SUBSYSTEM_SSLOW
-			&& ssstbd->message.subsystem == MBSYS_JSTAR_SUBSYSTEM_SSLOW)
-			{
-			store->subsystem = MBSYS_JSTAR_SUBSYSTEM_SSLOW;
-			}
-		else if (ssport->message.subsystem == MBSYS_JSTAR_SUBSYSTEM_SSHIGH
-			&& ssstbd->message.subsystem == MBSYS_JSTAR_SUBSYSTEM_SSHIGH)
-			{
-			store->subsystem = MBSYS_JSTAR_SUBSYSTEM_SSHIGH;
-			}
-		else if (store->subsystem != MBSYS_JSTAR_SUBSYSTEM_SSHIGH)
-			{
-			store->subsystem = MBSYS_JSTAR_SUBSYSTEM_SSLOW;
-			ssport->message.subsystem = MBSYS_JSTAR_SUBSYSTEM_SSLOW;
-			ssstbd->message.subsystem = MBSYS_JSTAR_SUBSYSTEM_SSLOW;
-			}
-		else
-			{
-			ssport->message.subsystem = MBSYS_JSTAR_SUBSYSTEM_SSHIGH;
-			ssstbd->message.subsystem = MBSYS_JSTAR_SUBSYSTEM_SSHIGH;
-			}
-
-		/* get time */
-		mb_get_jtime(verbose,time_i,time_j);
-		ssport->year = time_i[0];
-		ssport->day = time_j[1];
-		ssport->hour = time_i[3];
-		ssport->minute = time_i[4];
-		ssport->second = time_i[5];
-		ssport->millisecondsToday = 0.001 * time_i[6]
-					+ 1000 * (time_i[5]
-						+ 60.0 * (time_i[4]
-							+ 60.0 * time_i[3]));
-		ssstbd->year = time_i[0];
-		ssstbd->day = time_j[1];
-		ssstbd->hour = time_i[3];
-		ssstbd->minute = time_i[4];
-		ssstbd->second = time_i[5];
-		ssstbd->millisecondsToday = 0.001 * time_i[6]
-					+ 1000 * (time_i[5]
-						+ 60.0 * (time_i[4]
-							+ 60.0 * time_i[3]));
-
-		/* get navigation */
-		if (navlon < 180.0) navlon = navlon + 360.0;
-		if (navlon > 180.0) navlon = navlon - 360.0;
-		ssport->sourceCoordX = 600000.0 * navlon;
-		ssport->sourceCoordY = 600000.0 * navlat;
-		ssstbd->sourceCoordX = 600000.0 * navlon;
-		ssstbd->sourceCoordY = 600000.0 * navlat;
-		ssport->groupCoordX = 600000.0 * navlon;
-		ssport->groupCoordY = 600000.0 * navlat;
-		ssstbd->groupCoordX = 600000.0 * navlon;
-		ssstbd->groupCoordY = 600000.0 * navlat;
-
-		/* get heading and speed */
-		if (heading > 180.0)
-			heading -= 360.0;
-		if (heading < -180.0)
-			heading += 360.0;
-		ssport->heading = (short) (100.0 * heading);
-		ssstbd->heading = (short) (100.0 * heading);
-
-		/* get draft */
-		ssport->startDepth = draft /
-				ssport->sampleInterval / 0.00000075;
-		ssstbd->startDepth = draft /
-				ssstbd->sampleInterval / 0.00000075;
-		ssport->sonardepth = 1000 * draft;
-		ssstbd->sonardepth = 1000 * draft;
-
-		/* get attitude */
-		ssport->roll = 32768 * roll / 180.0;
-		ssport->pitch = 32768 * pitch / 180.0;
-		ssport->heaveCompensation = heave /
-				ssport->sampleInterval / 0.00000075;
-		ssstbd->roll = 32768 * roll / 180.0;
-		ssstbd->pitch = 32768 * pitch / 180.0;
-		ssstbd->heaveCompensation = heave /
-				ssstbd->sampleInterval / 0.00000075;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_jstar_extract_rawssdimensions(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, double *sample_interval,
-		int *num_samples_port, int *num_samples_stbd, int *error)
-{
-	char	*function_name = "mbsys_jstar_extract_rawssdimensions";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_jstar_struct *store;
-	struct mbsys_jstar_channel_struct *ssport;
-	struct mbsys_jstar_channel_struct *ssstbd;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_jstar_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract sidescan data from structure */
-	if (*kind == MB_DATA_DATA
-		|| *kind == MB_DATA_SIDESCAN2)
-		{
-		/* get channels */
-		ssport = (struct mbsys_jstar_channel_struct *) &(store->ssport);
-		ssstbd = (struct mbsys_jstar_channel_struct *) &(store->ssstbd);
-		
-		/* get sample_interval */
-		if (ssport != NULL)
-			*sample_interval = ssport->sampleInterval;
-		else if (ssstbd != NULL)
-			*sample_interval = ssstbd->sampleInterval;
-		
-		/* get numbers of samples */
-		if (ssport != NULL)
-			*num_samples_port = ssport->samples;
-		else
-			*num_samples_port = 0;
-		if (ssstbd != NULL)
-			*num_samples_stbd = ssstbd->samples;
-		else
-			*num_samples_stbd = 0;
-		}
-
-	/* else not a sidescan record */
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_BAD_KIND;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:              %d\n",*kind);
-		fprintf(stderr,"dbg2       sample_interval:   %lf\n",*sample_interval);
-		fprintf(stderr,"dbg2       num_samples_port:  %d\n",*num_samples_port);
-		fprintf(stderr,"dbg2       num_samples_stbd:  %d\n",*num_samples_stbd);
-		fprintf(stderr,"dbg2       error:             %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:            %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_jstar_extract_rawss(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int *sidescan_type, double *sample_interval,
-		double *beamwidth_xtrack, double *beamwidth_ltrack,
-		int *num_samples_port, double *rawss_port, 
-		int *num_samples_stbd, double *rawss_stbd, int *error)
-{
-	char	*function_name = "mbsys_jstar_extract_rawss";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_jstar_struct *store;
-	struct mbsys_jstar_channel_struct *ssport;
-	struct mbsys_jstar_channel_struct *ssstbd;
-	double 	weight;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_jstar_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract sidescan data from structure */
-	if (*kind == MB_DATA_DATA
-		|| *kind == MB_DATA_SIDESCAN2)
-		{
-		/* get channels */
-		ssport = (struct mbsys_jstar_channel_struct *) &(store->ssport);
-		ssstbd = (struct mbsys_jstar_channel_struct *) &(store->ssstbd);
-		
-		/* sidescan type is always linear */
-		*sidescan_type = MB_SIDESCAN_LINEAR;
-		
-		/* get sample_interval */
-		if (ssport != NULL)
-			*sample_interval = 0.000000001 * ssport->sampleInterval;
-		else if (ssstbd != NULL)
-			*sample_interval = 0.000000001 * ssstbd->sampleInterval;
-			
-		/* set beam widths */
-		if (ssport != NULL)
-			{
-			if (ssport->startFreq < 9000)
-				*beamwidth_ltrack = 1.3;
-			else if (ssport->startFreq < 15000)
-				*beamwidth_ltrack = 0.65;
-			else
-				*beamwidth_ltrack = 0.26;
-			*beamwidth_xtrack = 0.1;
-			}
-		else if (ssstbd != NULL)
-			{
-			if (ssstbd->startFreq < 9000)
-				*beamwidth_ltrack = 1.3;
-			else if (ssstbd->startFreq < 15000)
-				*beamwidth_ltrack = 0.65;
-			else
-				*beamwidth_ltrack = 0.26;
-			*beamwidth_xtrack = 0.1;
-			}
-		else
-			{
-			*beamwidth_ltrack = 0.26;
-			*beamwidth_xtrack = 0.1;
-			}
-		
-		/* get numbers of samples and time series */
-		if (ssport != NULL)
-			{
-			*num_samples_port = ssport->samples;
-			weight = exp(MB_LN_2 * ((double)ssport->weightingFactor));
-			for (i=0;i<*num_samples_port;i++)
-				{
-				rawss_port[i] = ssport->trace[i] / weight;
-				}
-			}
-		else
-			*num_samples_port = 0;
-		if (ssstbd != NULL)
-			{
-			*num_samples_stbd = ssstbd->samples;
-			weight = exp(MB_LN_2 * ((double)ssstbd->weightingFactor));
-			for (i=0;i<*num_samples_stbd;i++)
-				{
-				rawss_stbd[i] = ssstbd->trace[i] / weight;
-				}
-			}
-		else
-			*num_samples_stbd = 0;
-		}
-
-	/* else not a sidescan record */
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_BAD_KIND;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:              %d\n",*kind);
-		fprintf(stderr,"dbg2       sidescan_type:     %d\n",*sidescan_type);
-		fprintf(stderr,"dbg2       sample_interval:   %lf\n",*sample_interval);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:  %lf\n",*beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:  %lf\n",*beamwidth_ltrack);
-		fprintf(stderr,"dbg2       num_samples_port:  %d\n",*num_samples_port);
-		for (i=0;i<*num_samples_port;i++)
-		    fprintf(stderr,"dbg2       sample: %d  rawss_port:%f\n",
-			    i, rawss_port[i]);
-		fprintf(stderr,"dbg2       num_samples_stbd:  %d\n",*num_samples_stbd);
-		for (i=0;i<*num_samples_stbd;i++)
-		    fprintf(stderr,"dbg2       sample: %d  rawss_stbd:%f\n",
-			    i, rawss_stbd[i]);
-		fprintf(stderr,"dbg2       error:             %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:            %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_jstar_insert_rawss(int verbose, void *mbio_ptr, void *store_ptr,
-		int kind, int sidescan_type, double sample_interval,
-		double beamwidth_xtrack, double beamwidth_ltrack,
-		int num_samples_port, double *rawss_port,
-		int num_samples_stbd, double *rawss_stbd, int *error)
-{
-	char	*function_name = "mbsys_jstar_insert_rawss";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_jstar_struct *store;
-	struct mbsys_jstar_channel_struct *ssport;
-	struct mbsys_jstar_channel_struct *ssstbd;
-	double 	weight;
-	size_t	data_size;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:           %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:            %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:         %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       kind:              %d\n",kind);
-		fprintf(stderr,"dbg2       sidescan_type:     %d\n",sidescan_type);
-		fprintf(stderr,"dbg2       sample_interval:   %lf\n",sample_interval);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:  %lf\n",beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:  %lf\n",beamwidth_ltrack);
-		fprintf(stderr,"dbg2       num_samples_port:  %d\n",num_samples_port);
-		for (i=0;i<num_samples_port;i++)
-		    fprintf(stderr,"dbg2       sample: %d  rawss_port:%f\n",
-			    i, rawss_port[i]);
-		fprintf(stderr,"dbg2       num_samples_stbd:  %d\n",num_samples_stbd);
-		for (i=0;i<num_samples_stbd;i++)
-		    fprintf(stderr,"dbg2       sample: %d  rawss_stbd:%f\n",
-			    i, rawss_stbd[i]);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_jstar_struct *) store_ptr;
-
-	/* set data kind */
-	store->kind = kind;
-
-	/* insert sidescan data into structure */
-	if (kind == store->kind
-		&& (store->kind == MB_DATA_DATA
-			|| store->kind == MB_DATA_SIDESCAN2))
-		{
-		/* get channels */
-		ssport = (struct mbsys_jstar_channel_struct *) &(store->ssport);
-		ssstbd = (struct mbsys_jstar_channel_struct *) &(store->ssstbd);
-		
-		/* set sample_interval */
-		if (ssport != NULL)
-			ssport->sampleInterval = 1000000000 * sample_interval;
-		if (ssstbd != NULL)
-			ssstbd->sampleInterval = 1000000000 * sample_interval;
-			
-		/* set beam widths */
-					
-		/* set numbers of samples and time series */
-		if (ssport != NULL)
-			{
-			/* set number of samples */
-			ssport->samples = num_samples_port;
-			
-			/* allocated memory for samples if needed */
-			data_size = sizeof(short) * ssport->samples;
-			if (ssport->trace_alloc < data_size)
-				{
-				status = mb_reallocd(verbose, __FILE__,__LINE__, data_size, (void **)&(ssport->trace), error);
-				if (status == MB_SUCCESS)
-					{
-					ssport->trace_alloc = data_size;
-					}
-				else
-					{
-					ssport->trace_alloc = 0;
-					ssport->samples = 0;
-					}
-				}
-			
-			/* copy the samples, correcting for weighting */
-			weight = exp(MB_LN_2 * ((double)ssport->weightingFactor));
-			for (i=0;i<num_samples_port;i++)
-				{
-				ssport->trace[i] = (short ) (weight * rawss_port[i]);
-				}
-			}
-		if (ssstbd != NULL)
-			{
-			/* set number of samples */
-			ssstbd->samples = num_samples_stbd;
-			
-			/* allocated memory for samples if needed */
-			data_size = sizeof(short) * ssstbd->samples;
-			if (ssstbd->trace_alloc < data_size)
-				{
-				status = mb_reallocd(verbose, __FILE__,__LINE__, data_size, (void **)&(ssstbd->trace), error);
-				if (status == MB_SUCCESS)
-					{
-					ssstbd->trace_alloc = data_size;
-					}
-				else
-					{
-					ssstbd->trace_alloc = 0;
-					ssstbd->samples = 0;
-					}
-				}
-			
-			/* copy the samples, correcting for weighting */
-			weight = exp(MB_LN_2 * ((double)ssstbd->weightingFactor));
-			for (i=0;i<num_samples_stbd;i++)
-				{
-				ssstbd->trace[i] = (short ) (weight * rawss_stbd[i]);
-				}
-			}
-		}
-
-	/* else not a sidescan record */
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_BAD_KIND;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:             %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:            %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_jstar_extract_segytraceheader(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, void *segytraceheader_ptr, int *error)
-{
-	char	*function_name = "mbsys_jstar_extract_segytraceheader";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_jstar_struct *store;
-	struct mbsys_jstar_channel_struct *sbp;
-	struct mb_segytraceheader_struct *mb_segytraceheader_ptr;
-	double	dsonardepth, dsonaraltitude, dwaterdepth;
-	int	sonardepth, waterdepth;
-	int	watersoundspeed;
-	float	fwatertime;
-	double	longitude, latitude;
-	int	time_i[7],time_j[5];
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:        %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:         %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:      %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       kind:           %d\n",*kind);
-		fprintf(stderr,"dbg2       segytraceheader_ptr: %p\n",(void *)segytraceheader_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_jstar_struct *) store_ptr;
-	mb_segytraceheader_ptr = (struct mb_segytraceheader_struct *) segytraceheader_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_SUBBOTTOM_SUBBOTTOM)
-		{
-		/* get channel */
-		sbp = (struct mbsys_jstar_channel_struct *) &(store->sbp);
-
-		/* get time */
-		time_j[0] = sbp->year;
-		time_j[1] = sbp->day;
-		time_j[2] = 60 * sbp->hour + sbp->minute;
-		time_j[3] = sbp->second;
-		time_j[4] = (int)1000 * (sbp->millisecondsToday
-				- 1000 * floor(0.001 * ((double)sbp->millisecondsToday)));
-		mb_get_itime(verbose,time_j,time_i);
-
-		/* get needed values */
-		/* get transducer_depth */
-		if (sbp->sonardepth > 0)
-			dsonardepth = 0.001 * sbp->sonardepth
-						+ sbp->heaveCompensation * sbp->sampleInterval * 0.00000075;
-		else
-			dsonardepth = sbp->startDepth * sbp->sampleInterval * 0.00000075
-						+ sbp->heaveCompensation * sbp->sampleInterval * 0.00000075;
-		dsonaraltitude = 0.001 * sbp->sonaraltitude;
-		if (sbp->depth > 0)
-			dwaterdepth = 0.001 * sbp->depth;
-		else
-			dwaterdepth = dsonardepth + dsonaraltitude;
-		sonardepth = (int) (100 * dsonardepth);
-		waterdepth = (int) (100 * dwaterdepth);
-		watersoundspeed = 1500;
-		fwatertime = 2.0 * dwaterdepth / ((double) watersoundspeed);
-
-		/* get navigation */
-		longitude = sbp->groupCoordX / 600000.0;
-		latitude = sbp->groupCoordY / 600000.0;
-
-		/* extract the data */
-		mb_segytraceheader_ptr->seq_num 	= sbp->pingNum;
-		mb_segytraceheader_ptr->seq_reel 	= sbp->pingNum;
-		mb_segytraceheader_ptr->shot_num 	= sbp->pingNum;
-		mb_segytraceheader_ptr->shot_tr		= 1;
-		mb_segytraceheader_ptr->espn		= 0;
-		mb_segytraceheader_ptr->rp_num		= sbp->pingNum;
-		mb_segytraceheader_ptr->rp_tr		= 1;
-		mb_segytraceheader_ptr->trc_id		= 1;
-		mb_segytraceheader_ptr->num_vstk	= 0;
-		mb_segytraceheader_ptr->cdp_fold	= 0;
-		mb_segytraceheader_ptr->use		= sbp->dataFormat;
-		mb_segytraceheader_ptr->range		= 0;
-		mb_segytraceheader_ptr->grp_elev	= -sonardepth;
-		mb_segytraceheader_ptr->src_elev	= -sonardepth;
-		mb_segytraceheader_ptr->src_depth	= sonardepth;
-		mb_segytraceheader_ptr->grp_datum	= 0;
-		mb_segytraceheader_ptr->src_datum	= 0;
-		mb_segytraceheader_ptr->src_wbd		= waterdepth;
-		mb_segytraceheader_ptr->grp_wbd		= waterdepth;
-		mb_segytraceheader_ptr->elev_scalar	= -100; 	/* 0.01 m precision for depths */
-		mb_segytraceheader_ptr->coord_scalar	= -100;		/* 0.01 arc second precision for position
-									= 0.3 m precision at equator */
-		mb_segytraceheader_ptr->src_long	= (int)(longitude * 600000.0);
-		mb_segytraceheader_ptr->src_lat		= (int)(latitude * 600000.0);
-		mb_segytraceheader_ptr->grp_long	= (int)(longitude * 600000.0);
-		mb_segytraceheader_ptr->grp_lat		= (int)(latitude * 600000.0);
-		mb_segytraceheader_ptr->coord_units	= 2;
-		mb_segytraceheader_ptr->wvel		= watersoundspeed;
-		mb_segytraceheader_ptr->sbvel		= 0;
-		mb_segytraceheader_ptr->src_up_vel	= 0;
-		mb_segytraceheader_ptr->grp_up_vel	= 0;
-		mb_segytraceheader_ptr->src_static	= 0;
-		mb_segytraceheader_ptr->grp_static	= 0;
-		mb_segytraceheader_ptr->tot_static	= 0;
-		mb_segytraceheader_ptr->laga		= 0;
-		mb_segytraceheader_ptr->delay_mils	= 0;
-		mb_segytraceheader_ptr->smute_mils	= 0;
-		mb_segytraceheader_ptr->emute_mils	= 0;
-		mb_segytraceheader_ptr->nsamps		= sbp->samples;
-		mb_segytraceheader_ptr->si_micros	= (short) (sbp->sampleInterval / 1000);
-		for (i=0;i<19;i++)
-			mb_segytraceheader_ptr->other_1[i]	= 0;
-		mb_segytraceheader_ptr->year		= time_i[0];
-		mb_segytraceheader_ptr->day_of_yr	= time_j[1];
-		mb_segytraceheader_ptr->hour		= time_i[3];
-		mb_segytraceheader_ptr->min		= time_i[4];
-		mb_segytraceheader_ptr->sec		= time_i[5];
-		mb_segytraceheader_ptr->mils		= time_i[6] / 1000;
-		mb_segytraceheader_ptr->tr_weight	= 1;
-		for (i=0;i<5;i++)
-			mb_segytraceheader_ptr->other_2[i]	= 0;
-		mb_segytraceheader_ptr->delay		= 0.0;
-		mb_segytraceheader_ptr->smute_sec	= 0.0;
-		mb_segytraceheader_ptr->emute_sec	= 0.0;
-		mb_segytraceheader_ptr->si_secs		= 0.000000001 * ((float)sbp->sampleInterval);
-		mb_segytraceheader_ptr->wbt_secs	= fwatertime;
-		mb_segytraceheader_ptr->end_of_rp	= 0;
-		mb_segytraceheader_ptr->dummy1		= 0.0;
-		mb_segytraceheader_ptr->dummy2		= 0.0;
-		mb_segytraceheader_ptr->dummy3		= 0.0;
-		mb_segytraceheader_ptr->dummy4		= 0.0;
-		mb_segytraceheader_ptr->soundspeed		= watersoundspeed;
-		mb_segytraceheader_ptr->distance		= 0.0;
-		mb_segytraceheader_ptr->roll		= 180.0 / 32768.0 * (double)sbp->roll;
-		mb_segytraceheader_ptr->pitch		= 180.0 / 32768.0 * (double)sbp->pitch;
-		mb_segytraceheader_ptr->heading		= sbp->heading / 60.0;
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:              %d\n",*kind);
-		fprintf(stderr,"dbg2       seq_num:           %d\n",mb_segytraceheader_ptr->seq_num);
-		fprintf(stderr,"dbg2       seq_reel:          %d\n",mb_segytraceheader_ptr->seq_reel);
-		fprintf(stderr,"dbg2       shot_num:          %d\n",mb_segytraceheader_ptr->shot_num);
-		fprintf(stderr,"dbg2       shot_tr:           %d\n",mb_segytraceheader_ptr->shot_tr);
-		fprintf(stderr,"dbg2       espn:              %d\n",mb_segytraceheader_ptr->espn);
-		fprintf(stderr,"dbg2       rp_num:            %d\n",mb_segytraceheader_ptr->rp_num);
-		fprintf(stderr,"dbg2       rp_tr:             %d\n",mb_segytraceheader_ptr->rp_tr);
-		fprintf(stderr,"dbg2       trc_id:            %d\n",mb_segytraceheader_ptr->trc_id);
-		fprintf(stderr,"dbg2       num_vstk:          %d\n",mb_segytraceheader_ptr->num_vstk);
-		fprintf(stderr,"dbg2       cdp_fold:          %d\n",mb_segytraceheader_ptr->cdp_fold);
-		fprintf(stderr,"dbg2       use:               %d\n",mb_segytraceheader_ptr->use);
-		fprintf(stderr,"dbg2       range:             %d\n",mb_segytraceheader_ptr->range);
-		fprintf(stderr,"dbg2       grp_elev:          %d\n",mb_segytraceheader_ptr->grp_elev);
-		fprintf(stderr,"dbg2       src_elev:          %d\n",mb_segytraceheader_ptr->src_elev);
-		fprintf(stderr,"dbg2       src_depth:         %d\n",mb_segytraceheader_ptr->src_depth);
-		fprintf(stderr,"dbg2       grp_datum:         %d\n",mb_segytraceheader_ptr->grp_datum);
-		fprintf(stderr,"dbg2       src_datum:         %d\n",mb_segytraceheader_ptr->src_datum);
-		fprintf(stderr,"dbg2       src_wbd:           %d\n",mb_segytraceheader_ptr->src_wbd);
-		fprintf(stderr,"dbg2       grp_wbd:           %d\n",mb_segytraceheader_ptr->grp_wbd);
-		fprintf(stderr,"dbg2       elev_scalar:       %d\n",mb_segytraceheader_ptr->elev_scalar);
-		fprintf(stderr,"dbg2       coord_scalar:      %d\n",mb_segytraceheader_ptr->coord_scalar);
-		fprintf(stderr,"dbg2       src_long:          %d\n",mb_segytraceheader_ptr->src_long);
-		fprintf(stderr,"dbg2       src_lat:           %d\n",mb_segytraceheader_ptr->src_lat);
-		fprintf(stderr,"dbg2       grp_long:          %d\n",mb_segytraceheader_ptr->grp_long);
-		fprintf(stderr,"dbg2       grp_lat:           %d\n",mb_segytraceheader_ptr->grp_lat);
-		fprintf(stderr,"dbg2       coord_units:       %d\n",mb_segytraceheader_ptr->coord_units);
-		fprintf(stderr,"dbg2       wvel:              %d\n",mb_segytraceheader_ptr->wvel);
-		fprintf(stderr,"dbg2       sbvel:             %d\n",mb_segytraceheader_ptr->sbvel);
-		fprintf(stderr,"dbg2       src_up_vel:        %d\n",mb_segytraceheader_ptr->src_up_vel);
-		fprintf(stderr,"dbg2       grp_up_vel:        %d\n",mb_segytraceheader_ptr->grp_up_vel);
-		fprintf(stderr,"dbg2       src_static:        %d\n",mb_segytraceheader_ptr->src_static);
-		fprintf(stderr,"dbg2       grp_static:        %d\n",mb_segytraceheader_ptr->grp_static);
-		fprintf(stderr,"dbg2       tot_static:        %d\n",mb_segytraceheader_ptr->tot_static);
-		fprintf(stderr,"dbg2       laga:              %d\n",mb_segytraceheader_ptr->laga);
-		fprintf(stderr,"dbg2       delay_mils:        %d\n",mb_segytraceheader_ptr->delay_mils);
-		fprintf(stderr,"dbg2       smute_mils:        %d\n",mb_segytraceheader_ptr->smute_mils);
-		fprintf(stderr,"dbg2       emute_mils:        %d\n",mb_segytraceheader_ptr->emute_mils);
-		fprintf(stderr,"dbg2       nsamps:            %d\n",mb_segytraceheader_ptr->nsamps);
-		fprintf(stderr,"dbg2       si_micros:         %d\n",mb_segytraceheader_ptr->si_micros);
-		for (i=0;i<19;i++)
-		fprintf(stderr,"dbg2       other_1[%2d]:       %d\n",i,mb_segytraceheader_ptr->other_1[i]);
-		fprintf(stderr,"dbg2       year:              %d\n",mb_segytraceheader_ptr->year);
-		fprintf(stderr,"dbg2       day_of_yr:         %d\n",mb_segytraceheader_ptr->day_of_yr);
-		fprintf(stderr,"dbg2       hour:              %d\n",mb_segytraceheader_ptr->hour);
-		fprintf(stderr,"dbg2       min:               %d\n",mb_segytraceheader_ptr->min);
-		fprintf(stderr,"dbg2       sec:               %d\n",mb_segytraceheader_ptr->sec);
-		fprintf(stderr,"dbg2       mils:              %d\n",mb_segytraceheader_ptr->mils);
-		fprintf(stderr,"dbg2       tr_weight:         %d\n",mb_segytraceheader_ptr->tr_weight);
-		for (i=0;i<5;i++)
-		fprintf(stderr,"dbg2       other_2[%2d]:       %d\n",i,mb_segytraceheader_ptr->other_2[i]);
-		fprintf(stderr,"dbg2       delay:             %f\n",mb_segytraceheader_ptr->delay);
-		fprintf(stderr,"dbg2       smute_sec:         %f\n",mb_segytraceheader_ptr->smute_sec);
-		fprintf(stderr,"dbg2       emute_sec:         %f\n",mb_segytraceheader_ptr->emute_sec);
-		fprintf(stderr,"dbg2       si_secs:           %f\n",mb_segytraceheader_ptr->si_secs);
-		fprintf(stderr,"dbg2       wbt_secs:          %f\n",mb_segytraceheader_ptr->wbt_secs);
-		fprintf(stderr,"dbg2       end_of_rp:         %d\n",mb_segytraceheader_ptr->end_of_rp);
-		fprintf(stderr,"dbg2       dummy1:            %f\n",mb_segytraceheader_ptr->dummy1);
-		fprintf(stderr,"dbg2       dummy2:            %f\n",mb_segytraceheader_ptr->dummy2);
-		fprintf(stderr,"dbg2       dummy3:            %f\n",mb_segytraceheader_ptr->dummy3);
-		fprintf(stderr,"dbg2       dummy4:            %f\n",mb_segytraceheader_ptr->dummy4);
-		fprintf(stderr,"dbg2       soundspeed:        %f\n",mb_segytraceheader_ptr->soundspeed);
-		fprintf(stderr,"dbg2       distance:          %f\n",mb_segytraceheader_ptr->distance);
-		fprintf(stderr,"dbg2       roll:              %f\n",mb_segytraceheader_ptr->roll);
-		fprintf(stderr,"dbg2       pitch:             %f\n",mb_segytraceheader_ptr->pitch);
-		fprintf(stderr,"dbg2       heading:           %f\n",mb_segytraceheader_ptr->heading);
-		fprintf(stderr,"dbg2       error:             %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:            %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_jstar_extract_segy(int verbose, void *mbio_ptr, void *store_ptr,
-		int *sampleformat, int *kind, void *segyheader_ptr, float *segydata, int *error)
-{
-	char	*function_name = "mbsys_jstar_extract_segy";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_jstar_struct *store;
-	struct mbsys_jstar_channel_struct *sbp;
-	struct mb_segytraceheader_struct *mb_segytraceheader_ptr;
-	short	*shortptr;
-	unsigned short	*ushortptr;
-	double	weight;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:           %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:            %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:         %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       sampleformat:      %d\n",*sampleformat);
-		fprintf(stderr,"dbg2       kind:              %d\n",*kind);
-		fprintf(stderr,"dbg2       segyheader_ptr:    %p\n",(void *)segyheader_ptr);
-		fprintf(stderr,"dbg2       segydata:          %p\n",(void *)segydata);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_jstar_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* get segy traceheader */
-	mb_segytraceheader_ptr = (struct mb_segytraceheader_struct *) segyheader_ptr;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_SUBBOTTOM_SUBBOTTOM)
-		{
-		/* get channel */
-		sbp = (struct mbsys_jstar_channel_struct *) &(store->sbp);
-		shortptr = (short *) sbp->trace;
-		ushortptr = (unsigned short *) sbp->trace;
-
-		/* extract segy header */
-		status = mbsys_jstar_extract_segytraceheader(verbose, mbio_ptr, store_ptr,
-								kind, segyheader_ptr, error);
-
-		/* get the trace weight */
-		weight = exp(MB_LN_2 * ((double)sbp->weightingFactor));
-/*fprintf(stderr, "Subsystem: %d Weight: %d %f\n",sbp->message.subsystem,sbp->weightingFactor,weight);*/
-
-		/* extract the data */
-		if (sbp->dataFormat == MBSYS_JSTAR_TRACEFORMAT_ENVELOPE)
-			{
-			*sampleformat = MB_SEGY_SAMPLEFORMAT_ENVELOPE;
-			for (i=0;i<sbp->samples;i++)
-				{
-				segydata[i] = (float) (((double)ushortptr[i]) / weight);
-				}
-			}
-		else if (sbp->dataFormat == MBSYS_JSTAR_TRACEFORMAT_ANALYTIC)
-			{
-			/* if no format specified do envelope by default */
-			if (*sampleformat == MB_SEGY_SAMPLEFORMAT_NONE)
-				*sampleformat = MB_SEGY_SAMPLEFORMAT_ENVELOPE;
-
-			/* convert analytic data to desired envelope */
-			if (*sampleformat == MB_SEGY_SAMPLEFORMAT_ENVELOPE)
-				{
-				for (i=0;i<sbp->samples;i++)
-					{
-					segydata[i] = (float) (sqrt((double) (shortptr[2*i] * shortptr[2*i]
-								+ shortptr[2*i+1] * shortptr[2*i+1]))
-								/ weight);
-					}
-				}
-
-			/* else extract desired analytic data */
-			else if (*sampleformat == MB_SEGY_SAMPLEFORMAT_ANALYTIC)
-				{
-				for (i=0;i<sbp->samples;i++)
-					{
-					segydata[2*i]   = (float) (((double)shortptr[2*i]) / weight);
-					segydata[2*i+1] = (float) (((double)shortptr[2*i+1]) / weight);
-					}
-				}
-
-			/* else extract desired real trace from analytic data */
-			else if (*sampleformat == MB_SEGY_SAMPLEFORMAT_TRACE)
-				{
-				for (i=0;i<sbp->samples;i++)
-					{
-					segydata[i] = (float) (((double)shortptr[2*i]) / weight);
-					}
-				}
-			}
-		else if (sbp->dataFormat == MBSYS_JSTAR_TRACEFORMAT_RAW)
-			{
-			*sampleformat = MB_SEGY_SAMPLEFORMAT_TRACE;
-			for (i=0;i<sbp->samples;i++)
-				{
-				segydata[i] = (float) (((double)ushortptr[i]) / weight);
-				}
-			}
-		else if (sbp->dataFormat == MBSYS_JSTAR_TRACEFORMAT_REALANALYTIC)
-			{
-			*sampleformat = MB_SEGY_SAMPLEFORMAT_TRACE;
-			for (i=0;i<sbp->samples;i++)
-				{
-				segydata[i] = (float) (((double)ushortptr[i]) / weight);
-				}
-			}
-		else if (sbp->dataFormat == MBSYS_JSTAR_TRACEFORMAT_PIXEL)
-			{
-			*sampleformat = MB_SEGY_SAMPLEFORMAT_TRACE;
-			for (i=0;i<sbp->samples;i++)
-				{
-				segydata[i] = (float) (((double)ushortptr[i]) / weight);
-				}
-			}
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       sampleformat:      %d\n",*sampleformat);
-		fprintf(stderr,"dbg2       kind:              %d\n",*kind);
-		fprintf(stderr,"dbg2       seq_num:           %d\n",mb_segytraceheader_ptr->seq_num);
-		fprintf(stderr,"dbg2       seq_reel:          %d\n",mb_segytraceheader_ptr->seq_reel);
-		fprintf(stderr,"dbg2       shot_num:          %d\n",mb_segytraceheader_ptr->shot_num);
-		fprintf(stderr,"dbg2       shot_tr:           %d\n",mb_segytraceheader_ptr->shot_tr);
-		fprintf(stderr,"dbg2       espn:              %d\n",mb_segytraceheader_ptr->espn);
-		fprintf(stderr,"dbg2       rp_num:            %d\n",mb_segytraceheader_ptr->rp_num);
-		fprintf(stderr,"dbg2       rp_tr:             %d\n",mb_segytraceheader_ptr->rp_tr);
-		fprintf(stderr,"dbg2       trc_id:            %d\n",mb_segytraceheader_ptr->trc_id);
-		fprintf(stderr,"dbg2       num_vstk:          %d\n",mb_segytraceheader_ptr->num_vstk);
-		fprintf(stderr,"dbg2       cdp_fold:          %d\n",mb_segytraceheader_ptr->cdp_fold);
-		fprintf(stderr,"dbg2       use:               %d\n",mb_segytraceheader_ptr->use);
-		fprintf(stderr,"dbg2       range:             %d\n",mb_segytraceheader_ptr->range);
-		fprintf(stderr,"dbg2       grp_elev:          %d\n",mb_segytraceheader_ptr->grp_elev);
-		fprintf(stderr,"dbg2       src_elev:          %d\n",mb_segytraceheader_ptr->src_elev);
-		fprintf(stderr,"dbg2       src_depth:         %d\n",mb_segytraceheader_ptr->src_depth);
-		fprintf(stderr,"dbg2       grp_datum:         %d\n",mb_segytraceheader_ptr->grp_datum);
-		fprintf(stderr,"dbg2       src_datum:         %d\n",mb_segytraceheader_ptr->src_datum);
-		fprintf(stderr,"dbg2       src_wbd:           %d\n",mb_segytraceheader_ptr->src_wbd);
-		fprintf(stderr,"dbg2       grp_wbd:           %d\n",mb_segytraceheader_ptr->grp_wbd);
-		fprintf(stderr,"dbg2       elev_scalar:       %d\n",mb_segytraceheader_ptr->elev_scalar);
-		fprintf(stderr,"dbg2       coord_scalar:      %d\n",mb_segytraceheader_ptr->coord_scalar);
-		fprintf(stderr,"dbg2       src_long:          %d\n",mb_segytraceheader_ptr->src_long);
-		fprintf(stderr,"dbg2       src_lat:           %d\n",mb_segytraceheader_ptr->src_lat);
-		fprintf(stderr,"dbg2       grp_long:          %d\n",mb_segytraceheader_ptr->grp_long);
-		fprintf(stderr,"dbg2       grp_lat:           %d\n",mb_segytraceheader_ptr->grp_lat);
-		fprintf(stderr,"dbg2       coord_units:       %d\n",mb_segytraceheader_ptr->coord_units);
-		fprintf(stderr,"dbg2       wvel:              %d\n",mb_segytraceheader_ptr->wvel);
-		fprintf(stderr,"dbg2       sbvel:             %d\n",mb_segytraceheader_ptr->sbvel);
-		fprintf(stderr,"dbg2       src_up_vel:        %d\n",mb_segytraceheader_ptr->src_up_vel);
-		fprintf(stderr,"dbg2       grp_up_vel:        %d\n",mb_segytraceheader_ptr->grp_up_vel);
-		fprintf(stderr,"dbg2       src_static:        %d\n",mb_segytraceheader_ptr->src_static);
-		fprintf(stderr,"dbg2       grp_static:        %d\n",mb_segytraceheader_ptr->grp_static);
-		fprintf(stderr,"dbg2       tot_static:        %d\n",mb_segytraceheader_ptr->tot_static);
-		fprintf(stderr,"dbg2       laga:              %d\n",mb_segytraceheader_ptr->laga);
-		fprintf(stderr,"dbg2       delay_mils:        %d\n",mb_segytraceheader_ptr->delay_mils);
-		fprintf(stderr,"dbg2       smute_mils:        %d\n",mb_segytraceheader_ptr->smute_mils);
-		fprintf(stderr,"dbg2       emute_mils:        %d\n",mb_segytraceheader_ptr->emute_mils);
-		fprintf(stderr,"dbg2       nsamps:            %d\n",mb_segytraceheader_ptr->nsamps);
-		fprintf(stderr,"dbg2       si_micros:         %d\n",mb_segytraceheader_ptr->si_micros);
-		for (i=0;i<19;i++)
-		fprintf(stderr,"dbg2       other_1[%2d]:       %d\n",i,mb_segytraceheader_ptr->other_1[i]);
-		fprintf(stderr,"dbg2       year:              %d\n",mb_segytraceheader_ptr->year);
-		fprintf(stderr,"dbg2       day_of_yr:         %d\n",mb_segytraceheader_ptr->day_of_yr);
-		fprintf(stderr,"dbg2       hour:              %d\n",mb_segytraceheader_ptr->hour);
-		fprintf(stderr,"dbg2       min:               %d\n",mb_segytraceheader_ptr->min);
-		fprintf(stderr,"dbg2       sec:               %d\n",mb_segytraceheader_ptr->sec);
-		fprintf(stderr,"dbg2       mils:              %d\n",mb_segytraceheader_ptr->mils);
-		fprintf(stderr,"dbg2       tr_weight:         %d\n",mb_segytraceheader_ptr->tr_weight);
-		for (i=0;i<5;i++)
-		fprintf(stderr,"dbg2       other_2[%2d]:       %d\n",i,mb_segytraceheader_ptr->other_2[i]);
-		fprintf(stderr,"dbg2       delay:             %f\n",mb_segytraceheader_ptr->delay);
-		fprintf(stderr,"dbg2       smute_sec:         %f\n",mb_segytraceheader_ptr->smute_sec);
-		fprintf(stderr,"dbg2       emute_sec:         %f\n",mb_segytraceheader_ptr->emute_sec);
-		fprintf(stderr,"dbg2       si_secs:           %f\n",mb_segytraceheader_ptr->si_secs);
-		fprintf(stderr,"dbg2       wbt_secs:          %f\n",mb_segytraceheader_ptr->wbt_secs);
-		fprintf(stderr,"dbg2       end_of_rp:         %d\n",mb_segytraceheader_ptr->end_of_rp);
-		fprintf(stderr,"dbg2       dummy1:            %f\n",mb_segytraceheader_ptr->dummy1);
-		fprintf(stderr,"dbg2       dummy2:            %f\n",mb_segytraceheader_ptr->dummy2);
-		fprintf(stderr,"dbg2       dummy3:            %f\n",mb_segytraceheader_ptr->dummy3);
-		fprintf(stderr,"dbg2       dummy4:            %f\n",mb_segytraceheader_ptr->dummy4);
-		fprintf(stderr,"dbg2       soundspeed:        %f\n",mb_segytraceheader_ptr->soundspeed);
-		fprintf(stderr,"dbg2       distance:          %f\n",mb_segytraceheader_ptr->distance);
-		fprintf(stderr,"dbg2       roll:              %f\n",mb_segytraceheader_ptr->roll);
-		fprintf(stderr,"dbg2       pitch:             %f\n",mb_segytraceheader_ptr->pitch);
-		fprintf(stderr,"dbg2       heading:           %f\n",mb_segytraceheader_ptr->heading);
-		for (i=0;i<mb_segytraceheader_ptr->nsamps;i++)
-			fprintf(stderr,"dbg2       segydata[%d]:      %f\n",i,segydata[i]);
-		fprintf(stderr,"dbg2       error:             %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:            %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_jstar_insert_segy(int verbose, void *mbio_ptr, void *store_ptr,
-		int kind, void *segyheader_ptr, float *segydata, int *error)
-{
-	char	*function_name = "mbsys_jstar_insert_segy";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_jstar_struct *store;
-	struct mbsys_jstar_channel_struct *sbp;
-	struct mb_segytraceheader_struct *mb_segytraceheader_ptr;
-	int	sonardepth, waterdepth;
-	int	time_i[7];
-	int	time_j[5];
-	float	factor;
-	float	datamax;
-	double	weight;
-	int	data_size;
-	short	*shortptr;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:        %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:         %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:      %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       kind:           %d\n",kind);
-		fprintf(stderr,"dbg2       segyheader_ptr: %p\n",(void *)segyheader_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_jstar_struct *) store_ptr;
-
-	/* get data kind */
-	store->kind = kind;
-
-	/* get segy traceheader */
-	mb_segytraceheader_ptr = (struct mb_segytraceheader_struct *) segyheader_ptr;
-
-	/* insert data to structure */
-	if (store->kind == MB_DATA_SUBBOTTOM_SUBBOTTOM)
-		{
-		/* get channel */
-		sbp = (struct mbsys_jstar_channel_struct *) &(store->sbp);
-		shortptr = (short *) sbp->trace;
-
-		/* extract the data */
-		if (mb_segytraceheader_ptr->shot_num != 0)
-			sbp->pingNum = mb_segytraceheader_ptr->shot_num;
-		else if (mb_segytraceheader_ptr->seq_reel != 0)
-			sbp->pingNum = mb_segytraceheader_ptr->seq_reel;
-		else if (mb_segytraceheader_ptr->seq_num != 0)
-			sbp->pingNum = mb_segytraceheader_ptr->seq_num;
-		else if (mb_segytraceheader_ptr->rp_num != 0)
-			sbp->pingNum = mb_segytraceheader_ptr->rp_num;
-		else
-			sbp->pingNum = 0;
-		sbp->dataFormat = mb_segytraceheader_ptr->use;
-		if (mb_segytraceheader_ptr->grp_elev != 0)
-			sonardepth = -mb_segytraceheader_ptr->grp_elev;
-		else if (mb_segytraceheader_ptr->src_elev != 0)
-			sonardepth = -mb_segytraceheader_ptr->src_elev;
-		else if (mb_segytraceheader_ptr->src_depth != 0)
-			sonardepth = mb_segytraceheader_ptr->src_depth;
-		else
-			sonardepth = 0;
-		if (mb_segytraceheader_ptr->elev_scalar < 0)
-			factor = 1.0 / ((float) (-mb_segytraceheader_ptr->elev_scalar));
-		else
-			factor = (float) mb_segytraceheader_ptr->elev_scalar;
-		if (mb_segytraceheader_ptr->src_wbd != 0)
-			waterdepth = -mb_segytraceheader_ptr->grp_elev;
-		else if (mb_segytraceheader_ptr->grp_wbd != 0)
-			waterdepth = -mb_segytraceheader_ptr->src_elev;
-		else
-			waterdepth = 0;
-		if (mb_segytraceheader_ptr->coord_scalar < 0)
-			factor = 1.0 / ((float) (-mb_segytraceheader_ptr->coord_scalar)) / 3600.0;
-		else
-			factor = (float) mb_segytraceheader_ptr->coord_scalar / 3600.0;
-		sbp->samples = mb_segytraceheader_ptr->nsamps;
-		sbp->sampleInterval = 1000 * mb_segytraceheader_ptr->si_micros;
-		time_j[0] = mb_segytraceheader_ptr->year;
-		time_j[1] = mb_segytraceheader_ptr->day_of_yr;
-		time_j[2] = 60 * mb_segytraceheader_ptr->hour + mb_segytraceheader_ptr->min;
-		time_j[3] = mb_segytraceheader_ptr->sec;
-		time_j[4] = 1000 * mb_segytraceheader_ptr->mils;
-		mb_get_itime(verbose,time_j,time_i);
-		sbp->year = time_j[0];
-		sbp->day = time_j[1];
-		sbp->second = 0.000001 * time_i[6] + time_i[5];
-		sbp->hour = time_i[3];
-		sbp->minute = time_i[4];
-		sbp->millisecondsToday = 0.001 * time_i[6]
-					+ 1000 * (time_i[5]
-						+ 60.0 * (time_i[4]
-							+ 60.0 * time_i[3]));
-
-		sbp->depth = 1000 * waterdepth;
-		sbp->sonardepth = 1000 * sonardepth;
-		sbp->sonaraltitude = 1000 * (waterdepth - sonardepth);
-		if (sbp->sonaraltitude < 0)
-			sbp->sonaraltitude = 0;
-
-		/* get max data value */
-		datamax = 0.0;
-		for (i=0;i<mb_segytraceheader_ptr->nsamps;i++)
-			{
-			if (fabs(segydata[i]) > datamax)
-				datamax = fabs(segydata[i]);
-			}
-		if (datamax > 0.0)
-			{
-			sbp->weightingFactor = (short) (log(datamax) / MB_LN_2) - 15;
-			}
-		else
-			sbp->weightingFactor = 0;
-		weight = pow(2.0, (double)sbp->weightingFactor);
-
-		/* make sure enough memory is allocated for channel data */
-		data_size = sizeof(short) * sbp->samples;
-		if (sbp->trace_alloc < data_size)
-			{
-			status = mb_reallocd(verbose, __FILE__,__LINE__, data_size, (void **)&(sbp->trace), error);
-			if (status == MB_SUCCESS)
-				{
-				sbp->trace_alloc = data_size;
-				}
-			else
-				{
-				sbp->trace_alloc = 0;
-				sbp->samples = 0;
-				}
-			}
-
-		/* copy over the data */
-		if (sbp->trace_alloc >= data_size)
-			{
-			shortptr = (short *) sbp->trace;
-			for (i=0;i<sbp->samples;i++)
-				{
-				shortptr[i] = (short) (segydata[i] * weight);
-				}
-			}
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       seq_num:           %d\n",mb_segytraceheader_ptr->seq_num);
-		fprintf(stderr,"dbg2       seq_reel:          %d\n",mb_segytraceheader_ptr->seq_reel);
-		fprintf(stderr,"dbg2       shot_num:          %d\n",mb_segytraceheader_ptr->shot_num);
-		fprintf(stderr,"dbg2       shot_tr:           %d\n",mb_segytraceheader_ptr->shot_tr);
-		fprintf(stderr,"dbg2       espn:              %d\n",mb_segytraceheader_ptr->espn);
-		fprintf(stderr,"dbg2       rp_num:            %d\n",mb_segytraceheader_ptr->rp_num);
-		fprintf(stderr,"dbg2       rp_tr:             %d\n",mb_segytraceheader_ptr->rp_tr);
-		fprintf(stderr,"dbg2       trc_id:            %d\n",mb_segytraceheader_ptr->trc_id);
-		fprintf(stderr,"dbg2       num_vstk:          %d\n",mb_segytraceheader_ptr->num_vstk);
-		fprintf(stderr,"dbg2       cdp_fold:          %d\n",mb_segytraceheader_ptr->cdp_fold);
-		fprintf(stderr,"dbg2       use:               %d\n",mb_segytraceheader_ptr->use);
-		fprintf(stderr,"dbg2       range:             %d\n",mb_segytraceheader_ptr->range);
-		fprintf(stderr,"dbg2       grp_elev:          %d\n",mb_segytraceheader_ptr->grp_elev);
-		fprintf(stderr,"dbg2       src_elev:          %d\n",mb_segytraceheader_ptr->src_elev);
-		fprintf(stderr,"dbg2       src_depth:         %d\n",mb_segytraceheader_ptr->src_depth);
-		fprintf(stderr,"dbg2       grp_datum:         %d\n",mb_segytraceheader_ptr->grp_datum);
-		fprintf(stderr,"dbg2       src_datum:         %d\n",mb_segytraceheader_ptr->src_datum);
-		fprintf(stderr,"dbg2       src_wbd:           %d\n",mb_segytraceheader_ptr->src_wbd);
-		fprintf(stderr,"dbg2       grp_wbd:           %d\n",mb_segytraceheader_ptr->grp_wbd);
-		fprintf(stderr,"dbg2       elev_scalar:       %d\n",mb_segytraceheader_ptr->elev_scalar);
-		fprintf(stderr,"dbg2       coord_scalar:      %d\n",mb_segytraceheader_ptr->coord_scalar);
-		fprintf(stderr,"dbg2       src_long:          %d\n",mb_segytraceheader_ptr->src_long);
-		fprintf(stderr,"dbg2       src_lat:           %d\n",mb_segytraceheader_ptr->src_lat);
-		fprintf(stderr,"dbg2       grp_long:          %d\n",mb_segytraceheader_ptr->grp_long);
-		fprintf(stderr,"dbg2       grp_lat:           %d\n",mb_segytraceheader_ptr->grp_lat);
-		fprintf(stderr,"dbg2       coord_units:       %d\n",mb_segytraceheader_ptr->coord_units);
-		fprintf(stderr,"dbg2       wvel:              %d\n",mb_segytraceheader_ptr->wvel);
-		fprintf(stderr,"dbg2       sbvel:             %d\n",mb_segytraceheader_ptr->sbvel);
-		fprintf(stderr,"dbg2       src_up_vel:        %d\n",mb_segytraceheader_ptr->src_up_vel);
-		fprintf(stderr,"dbg2       grp_up_vel:        %d\n",mb_segytraceheader_ptr->grp_up_vel);
-		fprintf(stderr,"dbg2       src_static:        %d\n",mb_segytraceheader_ptr->src_static);
-		fprintf(stderr,"dbg2       grp_static:        %d\n",mb_segytraceheader_ptr->grp_static);
-		fprintf(stderr,"dbg2       tot_static:        %d\n",mb_segytraceheader_ptr->tot_static);
-		fprintf(stderr,"dbg2       laga:              %d\n",mb_segytraceheader_ptr->laga);
-		fprintf(stderr,"dbg2       delay_mils:        %d\n",mb_segytraceheader_ptr->delay_mils);
-		fprintf(stderr,"dbg2       smute_mils:        %d\n",mb_segytraceheader_ptr->smute_mils);
-		fprintf(stderr,"dbg2       emute_mils:        %d\n",mb_segytraceheader_ptr->emute_mils);
-		fprintf(stderr,"dbg2       nsamps:            %d\n",mb_segytraceheader_ptr->nsamps);
-		fprintf(stderr,"dbg2       si_micros:         %d\n",mb_segytraceheader_ptr->si_micros);
-		for (i=0;i<19;i++)
-		fprintf(stderr,"dbg2       other_1[%2d]:       %d\n",i,mb_segytraceheader_ptr->other_1[i]);
-		fprintf(stderr,"dbg2       year:              %d\n",mb_segytraceheader_ptr->year);
-		fprintf(stderr,"dbg2       day_of_yr:         %d\n",mb_segytraceheader_ptr->day_of_yr);
-		fprintf(stderr,"dbg2       hour:              %d\n",mb_segytraceheader_ptr->hour);
-		fprintf(stderr,"dbg2       min:               %d\n",mb_segytraceheader_ptr->min);
-		fprintf(stderr,"dbg2       sec:               %d\n",mb_segytraceheader_ptr->sec);
-		fprintf(stderr,"dbg2       mils:              %d\n",mb_segytraceheader_ptr->mils);
-		fprintf(stderr,"dbg2       tr_weight:         %d\n",mb_segytraceheader_ptr->tr_weight);
-		for (i=0;i<5;i++)
-		fprintf(stderr,"dbg2       other_2[%2d]:       %d\n",i,mb_segytraceheader_ptr->other_2[i]);
-		fprintf(stderr,"dbg2       delay:             %f\n",mb_segytraceheader_ptr->delay);
-		fprintf(stderr,"dbg2       smute_sec:         %f\n",mb_segytraceheader_ptr->smute_sec);
-		fprintf(stderr,"dbg2       emute_sec:         %f\n",mb_segytraceheader_ptr->emute_sec);
-		fprintf(stderr,"dbg2       si_secs:           %f\n",mb_segytraceheader_ptr->si_secs);
-		fprintf(stderr,"dbg2       wbt_secs:          %f\n",mb_segytraceheader_ptr->wbt_secs);
-		fprintf(stderr,"dbg2       end_of_rp:         %d\n",mb_segytraceheader_ptr->end_of_rp);
-		fprintf(stderr,"dbg2       dummy1:            %f\n",mb_segytraceheader_ptr->dummy1);
-		fprintf(stderr,"dbg2       dummy2:            %f\n",mb_segytraceheader_ptr->dummy2);
-		fprintf(stderr,"dbg2       dummy3:            %f\n",mb_segytraceheader_ptr->dummy3);
-		fprintf(stderr,"dbg2       dummy4:            %f\n",mb_segytraceheader_ptr->dummy4);
-		fprintf(stderr,"dbg2       soundspeed:        %f\n",mb_segytraceheader_ptr->soundspeed);
-		fprintf(stderr,"dbg2       distance:          %f\n",mb_segytraceheader_ptr->distance);
-		fprintf(stderr,"dbg2       roll:              %f\n",mb_segytraceheader_ptr->roll);
-		fprintf(stderr,"dbg2       pitch:             %f\n",mb_segytraceheader_ptr->pitch);
-		fprintf(stderr,"dbg2       heading:           %f\n",mb_segytraceheader_ptr->heading);
-		fprintf(stderr,"dbg2       error:             %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:            %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_jstar_ctd(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, int *nctd, double *time_d,
-	double *conductivity, double *temperature,
-	double *depth, double *salinity, double *soundspeed, int *error)
-{
-	char	*function_name = "mbsys_jstar_ctd";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_jstar_struct *store;
-	struct mbsys_jstar_pressure_struct *pressure;
-	double	g, x, p;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_jstar_struct *) store_ptr;
-
-	/* get pressure record structure */
-	pressure = (struct mbsys_jstar_pressure_struct *) &store->pressure;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* get the ctd data from the Edgetech pressure record */
-	if (*kind == MB_DATA_CTD)
-		{
-		*nctd = 1;
-		*time_d = pressure->seconds + 0.001 * pressure->msec;
-		*conductivity = 1000000.0 * pressure->conductivity;
-		*temperature = 0.0;
-		
-		/* Convert pressure to depth using UNESCO equations in UNESCO Technical Paper Marine Science No. 44
-		 *	http://www.seabird.com/application_notes/AN69.htm */
-		p = 0.00068947 * pressure->pressure; /*convert pressure from 0.001 PSI to decibar */
-		x = 0.0; /* sin(latitude) where latitude is assumed zero here */
-		g = 9.780318 * ( 1.0 + ( 5.2788e-3  + 2.36e-5  * x) * x ) + 1.092e-6  * p;
-		
-		*depth = ((((-1.82e-15  * p + 2.279e-10 ) * p - 2.2512e-5 ) * p + 9.72659) * p) / g;
-		*salinity = 0.001 * pressure->salinity; /* convert from ppm to PSU */
-		*soundspeed = 1000.0 * pressure->soundspeed;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error == MB_ERROR_NO_ERROR)
-		{
-		fprintf(stderr,"dbg2       nctd:          %d\n",*nctd);
-		for (i=0;i<*nctd;i++)
-			{
-			fprintf(stderr,"dbg2       time_d:        %f\n",time_d[i]);
-			fprintf(stderr,"dbg2       conductivity:  %f\n",conductivity[i]);
-			fprintf(stderr,"dbg2       temperature:   %f\n",temperature[i]);
-			fprintf(stderr,"dbg2       depth:         %f\n",depth[i]);
-			fprintf(stderr,"dbg2       salinity:      %f\n",salinity[i]);
-			fprintf(stderr,"dbg2       soundspeed:    %f\n",soundspeed[i]);
-			}
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_jstar_copyrecord(int verbose, void *mbio_ptr,
-			void *store_ptr, void *copy_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_jstar_copyrecord";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_jstar_struct *store;
-	struct mbsys_jstar_struct *copy;
-	unsigned int	sbp_trace_alloc;
-	unsigned short	*sbp_trace;
-	unsigned int	ssport_trace_alloc;
-	unsigned short	*ssport_trace;
-	unsigned int	ssstbd_trace_alloc;
-	unsigned short	*ssstbd_trace;
-	int	shortspersample;
-	int	trace_size;
-	int	i;
-
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       copy_ptr:   %p\n",(void *)copy_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointers */
-	store = (struct mbsys_jstar_struct *) store_ptr;
-	copy = (struct mbsys_jstar_struct *) copy_ptr;
-
-	/* save existing trace pointers in copy */
-	sbp_trace_alloc = copy->sbp.trace_alloc;
-	sbp_trace = copy->sbp.trace;
-	ssport_trace_alloc = copy->ssport.trace_alloc;
-	ssport_trace = copy->ssport.trace;
-	ssstbd_trace_alloc = copy->ssstbd.trace_alloc;
-	ssstbd_trace = copy->ssstbd.trace;
-
-	/* copy the data */
-	*copy = *store;
-
-	/* restore the original trace pointers */
-	copy->sbp.trace_alloc = sbp_trace_alloc;
-	copy->sbp.trace = sbp_trace;
-	copy->ssport.trace_alloc = ssport_trace_alloc;
-	copy->ssport.trace = ssport_trace;
-	copy->ssstbd.trace_alloc = ssstbd_trace_alloc;
-	copy->ssstbd.trace = ssstbd_trace;
-
-	/* allocate memory and copy each trace */
-
-	/* allocate memory for the subbottom trace */
-	if (copy->sbp.dataFormat == 1)
-		shortspersample = 2;
-	else
-		shortspersample = 1;
-	trace_size = shortspersample * copy->sbp.samples * sizeof(short);
-	if (copy->sbp.trace_alloc < trace_size)
-		{
-		if ((status = mb_reallocd(verbose, __FILE__,__LINE__, trace_size, (void **)&(copy->sbp.trace), error))
-			== MB_SUCCESS)
-			{
-			copy->sbp.trace_alloc = trace_size;
-			}
-		}
-	if (copy->sbp.trace_alloc >= trace_size)
-		{
-		for (i=0;i<shortspersample * copy->sbp.samples;i++)
-			{
-			copy->sbp.trace[i] = store->sbp.trace[i];
-			}
-		}
-
-	/* allocate memory for the port sidescan trace */
-	if (copy->ssport.dataFormat == 1)
-		shortspersample = 2;
-	else
-		shortspersample = 1;
-	trace_size = shortspersample * copy->ssport.samples * sizeof(short);
-	if (copy->ssport.trace_alloc < trace_size)
-		{
-		if ((status = mb_reallocd(verbose, __FILE__,__LINE__, trace_size, (void **)&(copy->ssport.trace), error))
-			== MB_SUCCESS)
-			{
-			copy->ssport.trace_alloc = trace_size;
-			}
-		}
-	if (copy->ssport.trace_alloc >= trace_size)
-		{
-		for (i=0;i<shortspersample * copy->ssport.samples;i++)
-			{
-			copy->ssport.trace[i] = store->ssport.trace[i];
-			}
-		}
-
-	/* allocate memory for the starboard sidescan trace */
-	if (copy->ssstbd.dataFormat == 1)
-		shortspersample = 2;
-	else
-		shortspersample = 1;
-	trace_size = shortspersample * copy->ssstbd.samples * sizeof(short);
-	if (copy->ssstbd.trace_alloc < trace_size)
-		{
-		if ((status = mb_reallocd(verbose, __FILE__,__LINE__, trace_size, (void **)&(copy->ssstbd.trace), error))
-			== MB_SUCCESS)
-			{
-			copy->ssstbd.trace_alloc = trace_size;
-			}
-		}
-	if (copy->ssstbd.trace_alloc >= trace_size)
-		{
-		for (i=0;i<shortspersample * copy->ssstbd.samples;i++)
-			{
-			copy->ssstbd.trace[i] = store->ssstbd.trace[i];
-			}
-		}
-
-
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mbsys_jstar.h b/src/mbio/mbsys_jstar.h
deleted file mode 100644
index e492910..0000000
--- a/src/mbio/mbsys_jstar.h
+++ /dev/null
@@ -1,547 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbsys_jstar.h	2/21/2005
- *	$Id: mbsys_jstar.h 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 2005-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbsys_jstar.h  defines the data structure used by MBIO functions
- * to store sidescan data read from the MBF_EDGJSTAR format (MBIO id 132).
- *
- * Author:	D. W. Caress
- * Date:	February 21, 2005
- * $Log: mbsys_jstar.h,v $
- * Revision 5.2  2006/11/10 22:36:05  caress
- * Working towards release 5.1.0
- *
- * Revision 5.1  2005/11/05 00:48:03  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.0  2005/06/04 04:11:35  caress
- * Support for Edgetech Jstar format (id 132 and 133).
- *
- *
- */
-/*
- * Notes on the MBSYS_JSTAR data structure:
- *   1. The J-star data format is used to store raw sidescan data from
- *      Edgetech sidescan and subbottom profiler sonars. This format
- *      is a variant of the SEGY format.
- *   2. The J-Star variant eliminates the SEGY EGCDIC and binary reel headers,
- *      and adds a message header to the beginning of each trace header.
- *      A J-Star stander format (JSF) file consists of a collection of trace
- *      records with the following components:
- *            1. A 16-byte message header.
- *            2. A 240 byte trace header.
- *            3. Trace data (2 bytes per sample)
- */
-
-/* specify the maximum number of sidescan pixels that can be returned
-	by mbsys_jstar_extract() */
-#define	MBSYS_JSTAR_MESSAGE_SIZE	16
-#define	MBSYS_JSTAR_SBPHEADER_SIZE	240
-#define	MBSYS_JSTAR_SSHEADER_SIZE	240
-#define	MBSYS_JSTAR_SSOLDHEADER_SIZE	80
-#define	MBSYS_JSTAR_PIXELS_MAX		2000
-#define	MBSYS_JSTAR_SYSINFO_MAX		16384
-
-#define	MBSYS_JSTAR_DATA_SONAR		80
-#define	MBSYS_JSTAR_DATA_SONAR2		82
-#define	MBSYS_JSTAR_DATA_4400SAS	86
-#define	MBSYS_JSTAR_DATA_PITCHROLL	2020
-#define	MBSYS_JSTAR_DATA_NMEA		2002
-#define	MBSYS_JSTAR_DATA_MISCANALOG	2040
-#define	MBSYS_JSTAR_DATA_PRESSURE	2060
-#define	MBSYS_JSTAR_DATA_DVL		2080
-#define	MBSYS_JSTAR_DATA_MESSAGE	2090
-#define	MBSYS_JSTAR_DATA_SYSINFO	182
-#define	MBSYS_JSTAR_DATA_COMMENT	17229
-
-#define	MBSYS_JSTAR_SUBSYSTEM_SBP	0
-#define	MBSYS_JSTAR_SUBSYSTEM_SSLOW	20
-#define	MBSYS_JSTAR_SUBSYSTEM_SSHIGH	21
-
-  /* Edgetech trace data format definitions */
-#define	MBSYS_JSTAR_TRACEFORMAT_ENVELOPE		0 	/* 2 bytes/sample (unsigned) */
-#define	MBSYS_JSTAR_TRACEFORMAT_ANALYTIC		1 	/* 4 bytes/sample (I + Q) */
-#define	MBSYS_JSTAR_TRACEFORMAT_RAW		2 	/* 2 bytes/sample (signed) */
-#define	MBSYS_JSTAR_TRACEFORMAT_REALANALYTIC	3 	/* 2 bytes/sample (signed) */
-#define	MBSYS_JSTAR_TRACEFORMAT_PIXEL		4 	/* 2 bytes/sample (signed) */
-
-struct mbsys_jstar_message_struct
-	{
-	/* Message Header */
-	unsigned short	start_marker;	/* bytes 0-1,    Marker for the start of header (0x1601) */
-	mb_u_char	version;	/* byte  2,      Version of protocal used */
-	mb_u_char	session;	/* byte  3,      Session identifier */
-	unsigned short	type;		/* bytes 4-5,    Message type (80 - sonar trace data ) */
-	mb_u_char	command;	/* bytes 6,      Command type */
-	mb_u_char	subsystem;	/* bytes 7,      Subsystem:
-								 0 - subbottom
-								20 - 75 or 120 kHz sidescan
-								21 - 410 kHz sidescan */
-	mb_u_char	channel;	/* bytes 8,      Channel for multi-channel systems
-								0 = port
-								1 = starboard */
-	mb_u_char	sequence;	/* bytes 9,      Sequence number */
-	unsigned short	reserved;	/* bytes 10-11,  Reserved */
-	unsigned int	size;		/* bytes 12-15,  Size of following message in bytes */
-	};
-
-struct mbsys_jstar_comment_struct
-	{
-	/* Message Header */
-	struct mbsys_jstar_message_struct message;
-
-	/* Comment */
-	char	comment[MB_COMMENT_MAXLINE];
-	};
-
-struct mbsys_jstar_sysinfo_struct
-	{
-	/* Message Header */
-	struct mbsys_jstar_message_struct message;
-
-	/* System Information */
-	int	system_type;		/* System Type Number and Description:
-                                            1       2xxx Series, Combined Sub-Bottom / Side Scan with SIB Electronics
-                                            2       2xxx Series, Combined Sub-Bottom / Side Scan with FSIC Electronics
-                                            4       4300-MPX (Multi-Ping)
-                                            5       3200-XS, Sub-Bottom Profiler with AIC Electronics
-                                            6       4400-SAS, 12-Channel Side Scan
-                                            7       3200-XS, Sub Bottom Profiler with SIB Electronics
-                                            11      4200 Limited Multipulse Dual Frequency Side Scan
-                                            14      3100-P, Sub Bottom Profiler
-                                            16      2xxx Series, Dual Side Scan with SIB Electronics
-                                            17      4200 Multipulse Dual Frequency Side Scan
-                                            18      4700 Dynamic Focus
-                                            19      4200 Dual Frequency Side Scan
-                                            20      4200 Dual Frequency non Simultaneous Side Scan
-                                            21      2200-MP Combined Sub-Bottom / Dual Frequency Multipulse Side Scan
-                                            23      4600 Bathymetric System
-                                            128     4100, 272 /560A Side Scan */
-	int	reserved1;
-	int     version;		/* Sonar software version */
-	int     reserved2;		
-	int     platformserialnumber;	/* Serial number of platform */
-
-	/* Sysinfo message */
-        int     sysinfosize;
-	char	sysinfo[MBSYS_JSTAR_SYSINFO_MAX];
-	};
-
-
-struct mbsys_jstar_nmea_struct
-	{
-	/* Message Header */
-	struct mbsys_jstar_message_struct message;
-
-	/* Time and source */
-	int	seconds;		/* seconds since start of time */
-	int	msec;			/* milliseconds since start of time */
-	char	source;			/* 1=sonar, 2=discover, 3=ETSI */
-	char	reserve[3];
-
-	/* NMEA string */
-	char	nmea[MB_COMMENT_MAXLINE];
-	};
-
-struct mbsys_jstar_pressure_struct
-	{
-	/* Message Header */
-	struct mbsys_jstar_message_struct message;
-
-	/* Time and source */
-	int	seconds;	/* seconds since start of time */
-	int	msec;		/* milliseconds since start of time */
-	char	reserve1[4];
-	int	pressure;	/* 0.001 PSI */
-	int	salinity;	/* ppm */
-	int	datavalidflags;	/* data valid flags:
-					0 - pressure
-					1 - temp
-					2 - salt PPM
-					3 - conductivity
-					4 - sound velocity */
-	int	conductivity;	/* uSiemens/cm */
-	int	soundspeed;	/* 0.001 m/sec */
-	int	reserve2[10];
-	};
-
-struct mbsys_jstar_pitchroll_struct
-	{
-	/* Message Header */
-	struct mbsys_jstar_message_struct message;
-
-	/* Time and source */
-	int	seconds;	/* seconds since start of time */
-	int	msec;		/* milliseconds since start of time */
-	char	reserve1[4];
-	short	accelerationx;	/* x acceleration: multiply by (20 * 1.5) / (32768) to get G's */
-	short	accelerationy;	/* y acceleration: multiply by (20 * 1.5) / (32768) to get G's */
-	short	accelerationz;	/* z acceleration: multiply by (20 * 1.5) / (32768) to get G's */
-	short	gyroratex;	/* x gyro rate: multiply by (500 * 1.5) / (32768) to get deg/sec */
-	short	gyroratey;	/* y gyro rate: multiply by (500 * 1.5) / (32768) to get deg/sec */
-	short	gyroratez;	/* z gyro rate: multiply by (500 * 1.5) / (32768) to get deg/sec */
-	short	pitch;		/* pitch: multiply by (180.0 / 32768) to get degrees */
-	short	roll;		/* roll: multiply by (180.0 / 32768) to get degrees */
-	short	temperature;	/* temperature: 0.1 degree C */
-	unsigned short	deviceinfo;	/* device specific info */
-	short	heave;		/* heave: 0.001 m */
-	unsigned short	heading;/* 0.01 degrees */
-	int	datavalidflags;	/* data valid flags:
-					0 - ax
-					1 - ay
-					2 - az
-					3 - rx
-					4 - ry
-					5 - rz
-					6 - pitch
-					7 - roll
-					8 - heave
-					9 - heading
-					10 - temperature
-					11 - device info */
-	int	reserve2;
-	};
-
-struct mbsys_jstar_dvl_struct
-	{
-	/* Message Header */
-	struct mbsys_jstar_message_struct message;
-
-	/* Time and source */
-	int	seconds;	/* seconds since start of time */
-	int	msec;		/* milliseconds since start of time */
-	char	reserve1[4];
-	unsigned int	datavalidflags;	/* Bit values indicate which values are present:
-					0: X,Y velocity present
-					1: 1 = velocity in ship coordinates
-					   0 = velocity in earth coordinates
-					2: Z (vertical) velocity present
-					3: X, Y water velocity present
-					4: Z (vertical) water velocity present
-					5: Distance to bottom present
-					6: Heading present
-					7: Pitch present
-					8: Roll present
-					9: Temperature present
-					10: Depth present
-					11: Salinity present
-					12: Sound velocity present
-					---
-					31: Error detected */
-	int	beam1range;	/* 0.01 m (0 = invalid) */
-	int	beam2range;	/* 0.01 m (0 = invalid) */
-	int	beam3range;	/* 0.01 m (0 = invalid) */
-	int	beam4range;	/* 0.01 m (0 = invalid) */
-	short	velocitybottomx;	/* x velocity wrt bottom (0.001 m/s, positive to starboard or east) */
-	short	velocitybottomy;	/* y velocity wrt bottom (0.001 m/s, positive to forward or north) */
-	short	velocitybottomz;	/* z velocity wrt bottom (0.001 m/s, positive upward) */
-	short	velocitywaterx;	/* x velocity wrt water (0.001 m/s, positive to starboard or east) */
-	short	velocitywatery;	/* y velocity wrt water (0.001 m/s, positive to forward or north) */
-	short	velocitywaterz;	/* z velocity wrt water (0.001 m/s, positive upward) */
-	unsigned short	depth;	/* depth (0.1 m) */
-	short	pitch;		/* pitch (0.01 degree, positive bow up) */
-	short	roll;		/* roll (0.01 degree, positive port up) */
-	short	heading;	/* heading (0.01 degree) */
-	short	salinity;	/* salinity (ppt (part per thousand)) */
-	short	temperature;	/* temperature (0.01 degree celcius) */
-	short	soundspeed;	/* sound speed (m/sec) */
-	short	reserve2[7];
-	};
-
-struct mbsys_jstar_channel_struct
-	{
-	/* Message Header */
-	struct mbsys_jstar_message_struct message;
-
-	/* Trace Header */
-	int sequenceNumber; 			/* 0-3 : Trace Sequence Number (always 0) ** */
-	unsigned int startDepth;          	/* 4-7 : Starting depth (window offset) in samples. */
-	unsigned int pingNum;              	/* 8-11: Ping number (increments with ping) ** */
-	unsigned int channelNum;           	/* 12-15 : Channel Number (0 .. n) ** */
-	short unused1[6];          		/* 16-27 */
-
-	short traceIDCode;         		/* 28-29 : ID Code (always 1 => seismic data) ** */
-
-	short unused2[2];     			/* 30-33 */
-	short dataFormat;			/* 34-35 : DataFormatType */
-						/*   0 = 1 short  per sample  - envelope data */
-						/*   1 = 2 shorts per sample, - stored as real(1), imag(1), */
-						/*   2 = 1 short  per sample  - before matched filter */
-						/*   3 = 1 short  per sample  - real part analytic signal */
-						/*   4 = 1 short  per sample  - pixel data / ceros data */
-	short NMEAantennaeR;			/* 36-37 : Distance from towfish to antennae in cm */
-	short NMEAantennaeO;			/* 38-39 : Distance to antennae starboard direction in cm */
-	char RS232[32];				/* 40-71 : Reserved for RS232 data - TBD */
-	/* -------------------------------------------------------------------- */
-	/* Navigation data :                                                    */
-	/* If the coorUnits are seconds(2), the x values represent longitude    */
-	/* and the y values represent latitude.  A positive value designates    */
-	/* the number of seconds east of Greenwich Meridian or north of the     */
-	/* equator.                                                             */
-	/* -------------------------------------------------------------------- */
-	int sourceCoordX;			/* 72-75 : Meters or Seconds of Arc */
-	int sourceCoordY;			/* 76-79 : Meters or Seconds of Arc */
-	int groupCoordX;			/* 80-83 : mm or 10000 * (Minutes of Arc) */
-	int groupCoordY;			/* 84-87 : mm or 10000 * (Minutes of Arc) */
-	short coordUnits;			/* 88-89 : Units of coordinates - 1->length (x /y), 2->seconds of arc */
-	char annotation[24];			/* 90-113 : Annotation string */
-	unsigned short samples;			/* 114-115 : Samples in this packet ** */
-						/* Note:  Large sample sizes require multiple packets. */
-	unsigned int sampleInterval;		/* 116-119 : Sample interval in ns of stored data ** */
-	unsigned short ADCGain;			/* 120-121 : Gain factor of ADC */
-	short pulsePower;			/* 122-123 : user pulse power setting (0 - 100) percent */
-	short correlated;			/* 124-125 : correlated data 1 - No, 2 - Yes */
-	unsigned short startFreq;		/* 126-127 : Starting frequency in 10 * Hz */
-	unsigned short endFreq;			/* 128-129 : Ending frequency in 10 * Hz */
-	unsigned short sweepLength;		/* 130-131 : Sweep length in ms */
-	short unused7[4];			/* 132-139 */
-	unsigned short aliasFreq;		/* 140-141 : alias Frequency (sample frequency / 2) */
-	unsigned short pulseID;			/* 142-143 : Unique pulse identifier */
-	short unused8[6];			/* 144-155 */
-	short year;				/* 156-157 : Year data recorded (CPU time) */
-	short day;				/* 158-159 : day */
-	short hour;				/* 160-161 : hour */
-	short minute;				/* 162-163 : minute */
-	short second;				/* 164-165 : second */
-	short timeBasis;			/* 166-167 : Always 3 (other not specified by standard) */
-	short weightingFactor;			/* 168-169 :  weighting factor for block floating point expansion */
-						/*            -- defined as 2 -N volts for lsb */
-	short unused9;				/* 170-171 : */
-	/* -------------------------------------------------------------------- */
-	/* From pitch/roll/temp/heading sensor */
-	/* -------------------------------------------------------------------- */
-	short heading;				/* 172-173 : Compass heading (100 * degrees) -180.00 to 180.00 degrees */
-	short pitch;				/* 174-175 : Pitch */
-	short roll;				/* 176-177 : Roll */
-	short temperature;			/* 178-179 : Temperature (10 * degrees C) */
-	/* -------------------------------------------------------------------- */
-	/* User defined area from 180-239                                       */
-	/* -------------------------------------------------------------------- */
-	short heaveCompensation;		/* 180-181 : Heave compensation offset (samples) */
-	short trigSource;   			/* 182-183 : TriggerSource (0 = internal, 1 = external) */
-	unsigned short markNumber;		/* 184-185 : Mark Number (0 = no mark) */
-	short NMEAHour;				/* 186-187 : Hour */
-	short NMEAMinutes;			/* 188-189 : Minutes */
-	short NMEASeconds;			/* 190-191 : Seconds */
-	short NMEACourse;			/* 192-193 : Course */
-	short NMEASpeed;			/* 194-195 : Speed */
-	short NMEADay;				/* 196-197 : Day */
-	short NMEAYear;				/* 198-199 : Year */
-	unsigned int millisecondsToday;		/* 200-203 : Millieconds today */
-	unsigned short ADCMax;			/* 204-205 : Maximum absolute value for ADC samples for this packet */
-	short calConst;				/* 206-207 : System constant in tenths of a dB */
-	short vehicleID;			/* 208-209 : Vehicle ID */
-	char softwareVersion[6];		/* 210-215 : Software version number */
-	/* Following items are not in X-Star */
-	int sphericalCorrection;		/* 216-219 : Initial spherical correction factor (useful for multiping /*/
-						/* deep application) * 100 */
-	unsigned short packetNum;		/* 220-221 : Packet number (1 - N) (Each ping starts with packet 1) */
-	short ADCDecimation;			/* 222-223 : A/D decimation before FFT */
-	short decimation;			/* 224-225 : Decimation factor after FFT */
-	short unuseda;				/* 226-227 */
-
-	/* -------------------------------------------------------------------- */
-	/* MB-System-only parameters from 236-239                               */
-	/* -------------------------------------------------------------------- */
-	int depth;				/* 227-231 : Seafloor depth in 0.001 m */
-	int sonardepth;				/* 236-235 : Sonar depth in 0.001 m */
-	int sonaraltitude;			/* 236-239 : Sonar altitude in 0.001 m */
-
-	/* trace data stored as shorts */
-	unsigned int	trace_alloc;
-	unsigned short	*trace;
-	};
-
-struct mbsys_jstar_ssold_struct
-	{
-	/* Message Header */
-	struct mbsys_jstar_message_struct message;
-
-	/* Trace Header */
-	unsigned short subsystem;		/*   0 -   1 : Subsystem (0 .. n) */
-	unsigned short channelNum;		/*   2 -   3 : Channel Number (0 .. n) */
-	unsigned int pingNum;			/*   4 -   7 : Ping number (increments with ping) */
-	unsigned short packetNum;		/*   8 -   9 : Packet number (1..n) Each ping starts with packet 1 */
-	unsigned short trigSource;		/*  10 -  11 : TriggerSource (0 = internal, 1 = external) */
-	unsigned int samples;			/*  12 -  15 : Samples in this packet */
-	unsigned int sampleInterval;		/*  16 -  19 : Sample interval in ns of stored data */
-	unsigned int startDepth;		/*  20 -  23 : starting Depth (window offset) in samples */
-	short weightingFactor;			/*  24 -  25 : -- defined as 2 -N volts for lsb */
-	unsigned short ADCGain;			/*  26 -  27 : Gain factor of ADC */
-	unsigned short ADCMax;			/*  28 -  29 : Maximum absolute value for ADC samples for this packet */
-	unsigned short rangeSetting;		/*  30 -  31 : Range Setting (meters X 10) */
-	unsigned short pulseID;			/*  32 -  33 : Unique pulse identifier */
-	unsigned short markNumber;		/*  34 -  35 : Mark Number (0 = no mark) */
-	unsigned short dataFormat;		/*  36 -  37 : Data format */
-						/*   0 = 1 short  per sample  - envelope data */
-						/*   1 = 2 shorts per sample  - stored as real(1), imag(1), */
-						/*   2 = 1 short  per sample  - before matched filter (raw) */
-						/*   3 = 1 short  per sample  - real part analytic signal */
-						/*   NOTE: For type = 1, the total number of bytes of data to follow is */
-						/*   4 * samples.  For all other types the total bytes is 2 * samples */
-	unsigned short reserved;		/*  38 -  39 : Reserved field to round up to a 32-bit word boundary */
-	/* -------------------------------------------------------------------- */
-	/* computer date / time data acquired                                   */
-	/* -------------------------------------------------------------------- */
-	unsigned int millisecondsToday;		/*  40 -  43 : Millieconds today */
-	short year;				/*  44 -  45 : Year */
-	unsigned short day;			/*  46 -  47 : Day of year (1 - 366) */
-	unsigned short hour;			/*  48 -  49 : Hour of day (0 - 23) */
-	unsigned short minute;			/*  50 -  51 : Minute (0 - 59) */
-	unsigned short second;			/*  52 -  53 : Second (0 - 59) */
-	/* -------------------------------------------------------------------- */
-	/* Auxillary sensor information */
-	/* -------------------------------------------------------------------- */
-	short heading;				/*  54 -  55 : Compass heading (minutes) */
-	short pitch;				/*  56 -  57 : Pitch (minutes) */
-	short roll;				/*  58 -  59 : Roll (minutes) */
-	short heave;				/*  60 -  61 : Heave (centimeters) */
-	short yaw;				/*  62 -  63 : Yaw (minutes) */
-	unsigned int depth;			/*  64 -  67 : Vehicle depth (centimeters) */
-	short temperature;			/*  68 -  69 : Temperature (degrees Celsius X 10) */
-	char reserved2[10];			/*  70 -  79 : Reserved for future use */
-
-	/* trace data stored as shorts */
-	unsigned int	trace_alloc;
-	unsigned short	*trace;
-	};
-
-struct mbsys_jstar_struct
-	{
-	int	kind;			/* MBIO data kind */
-
-	/* Ping type */
-	mb_u_char	subsystem;	/* bytes 7,      Subsystem:
-								 0 - subbottom
-								20 - 75 or 120 kHz sidescan
-								21 - 410 kHz sidescan */
-
-	/* SBP data */
-	struct mbsys_jstar_channel_struct sbp;
-
-	/* Sidescan data */
-	struct mbsys_jstar_channel_struct ssport;
-	struct mbsys_jstar_channel_struct ssstbd;
-
-	/* Pitch Roll data */
-	struct mbsys_jstar_pitchroll_struct pitchroll;
-
-	/* NMEA */
-	struct mbsys_jstar_nmea_struct nmea;
-
-	/* DVL data */
-	struct mbsys_jstar_dvl_struct dvl;
-
-	/* Pressure data */
-	struct mbsys_jstar_pressure_struct pressure;
-        
-	/* System Information data */
-        struct mbsys_jstar_sysinfo_struct sysinfo;
-
-	/* Comment */
-	struct mbsys_jstar_comment_struct comment;
-	};
-
-/* system specific function prototypes */
-int mbsys_jstar_alloc(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error);
-int mbsys_jstar_deall(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error);
-int mbsys_jstar_dimensions(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int *nbath, int *namp, int *nss, int *error);
-int mbsys_jstar_pingnumber(int verbose, void *mbio_ptr,
-			int *pingnumber, int *error);
-int mbsys_jstar_preprocess(int verbose, void *mbio_ptr, void *store_ptr,
-                        double time_d, double navlon, double navlat,
-                        double speed, double heading, double sonardepth,
-                        double roll, double pitch, double heave,
-                        int *error);
-int mbsys_jstar_extract(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int time_i[7], double *time_d,
-			double *navlon, double *navlat,
-			double *speed, double *heading,
-			int *nbath, int *namp, int *nss,
-			char *beamflag, double *bath, double *amp,
-			double *bathacrosstrack, double *bathalongtrack,
-			double *ss, double *ssacrosstrack, double *ssalongtrack,
-			char *comment, int *error);
-int mbsys_jstar_insert(int verbose, void *mbio_ptr, void *store_ptr,
-			int kind, int time_i[7], double time_d,
-			double navlon, double navlat,
-			double speed, double heading,
-			int nbath, int namp, int nss,
-			char *beamflag, double *bath, double *amp,
-			double *bathacrosstrack, double *bathalongtrack,
-			double *ss, double *ssacrosstrack, double *ssalongtrack,
-			char *comment, int *error);
-int mbsys_jstar_ttimes(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int *nbeams,
-			double *ttimes, double *angles,
-			double *angles_forward, double *angles_null,
-			double *heave, double *alongtrack_offset,
-			double *draft, double *ssv, int *error);
-int mbsys_jstar_detects(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int *nbeams, int *detects, int *error);
-int mbsys_jstar_extract_altitude(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, double *transducer_depth, double *altitude,
-			int *error);
-int mbsys_jstar_insert_altitude(int verbose, void *mbio_ptr, void *store_ptr,
-                        double transducer_depth, double altitude, int *error);
-int mbsys_jstar_extract_nav(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int time_i[7], double *time_d,
-			double *navlon, double *navlat,
-			double *speed, double *heading, double *draft,
-			double *roll, double *pitch, double *heave,
-			int *error);
-int mbsys_jstar_insert_nav(int verbose, void *mbio_ptr, void *store_ptr,
-			int time_i[7], double time_d,
-			double navlon, double navlat,
-			double speed, double heading, double draft,
-			double roll, double pitch, double heave,
-			int *error);
-int mbsys_jstar_extract_rawssdimensions(int verbose, void *mbio_ptr, void *store_ptr,
-                        int *kind, double *sample_interval,
-                        int *num_samples_port, int *num_samples_stbd, int *error);
-int mbsys_jstar_extract_rawss(int verbose, void *mbio_ptr, void *store_ptr,
-                        int *kind, int *sidescan_type, double *sample_interval,
-                        double *beamwidth_xtrack, double *beamwidth_ltrack,
-                        int *num_samples_port, double *rawss_port, 
-                        int *num_samples_stbd, double *rawss_stbd, int *error);
-int mbsys_jstar_insert_rawss(int verbose, void *mbio_ptr, void *store_ptr,
-                        int kind, int sidescan_type, double sample_interval,
-                        double beamwidth_xtrack, double beamwidth_ltrack,
-                        int num_samples_port, double *rawss_port,
-                        int num_samples_stbd, double *rawss_stbd, int *error);
-int mbsys_jstar_extract_segytraceheader(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind,
-			void *segyheader_ptr,
-			int *error);
-int mbsys_jstar_extract_segy(int verbose, void *mbio_ptr, void *store_ptr,
-			int *sampleformat,
-			int *kind,
-			void *segyheader_ptr,
-			float *segydata,
-			int *error);
-int mbsys_jstar_insert_segy(int verbose, void *mbio_ptr, void *store_ptr,
-			int kind,
-			void *segyheader_ptr,
-			float *segydata,
-			int *error);
-int mbsys_jstar_ctd(int verbose, void *mbio_ptr, void *store_ptr,
-                        int *kind, int *nctd, double *time_d,
-                        double *conductivity, double *temperature,
-                        double *depth, double *salinity, double *soundspeed, int *error);
-int mbsys_jstar_copyrecord(int verbose, void *mbio_ptr,
-			void *store_ptr, void *copy_ptr,
-			int *error);
diff --git a/src/mbio/mbsys_ldeoih.c b/src/mbio/mbsys_ldeoih.c
deleted file mode 100644
index 450ba45..0000000
--- a/src/mbio/mbsys_ldeoih.c
+++ /dev/null
@@ -1,1634 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbsys_ldeoih.c	2/26/93
- *	$Id: mbsys_ldeoih.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1993-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbsys_ldeoih.c contains the functions for handling the data structure
- * used by MBIO functions to store data from a generic multibeam
- * format which handles data with arbitrary numbers of bathymetry,
- * amplitude, and sidescan data.  This generic format is
- *      MBF_MBLDEOIH : MBIO ID 61
- *
- * Author:	D. W. Caress
- * Date:	February 26, 1993
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mb_define.h"
-#include "mbsys_ldeoih.h"
-
-static char rcs_id[]="$Id: mbsys_ldeoih.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mbsys_ldeoih_alloc(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_ldeoih_alloc";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_ldeoih_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* allocate memory for data structure */
-	status = mb_mallocd(verbose,__FILE__, __LINE__,sizeof(struct mbsys_ldeoih_struct),
-				(void **)store_ptr,error);
-
-	/* get pointer to data structure */
-	store = (struct mbsys_ldeoih_struct *) *store_ptr;
-
-	/* initialize values in structure */
-	store->kind = MB_DATA_NONE;
-	store->time_d = 0.0;
-	store->longitude = 0.0;
-	store->latitude = 0.0;
-	store->sonardepth = 0.0;
-	store->altitude = 0.0;
-	store->heading = 0.0;
-	store->speed = 0.0;
-	store->roll = 0.0;
-	store->pitch = 0.0;
-	store->heave = 0.0;
-	store->beam_xwidth = 0.0;
-	store->beam_lwidth = 0.0;
-	store->beams_bath = 0;
-	store->beams_amp = 0;
-	store->pixels_ss = 0;
-	store->spare1 = 0;
-	store->beams_bath_alloc = 0;
-	store->beams_amp_alloc = 0;
-	store->pixels_ss_alloc = 0;
-	store->depth_scale = 0.0;
-	store->distance_scale = 0.0;
-	store->ss_scalepower = 0;
-	store->ss_type = 0;
-	store->imagery_type = MB_IMAGERY_TYPE_UNKNOWN;
-	store->topo_type = MB_TOPOGRAPHY_TYPE_UNKNOWN;
-	store->beamflag = NULL;
-	store->bath = NULL;
-	store->amp = NULL;
-	store->bath_acrosstrack = NULL;
-	store->bath_alongtrack = NULL;
-	store->ss = NULL;
-	store->ss_acrosstrack = NULL;
-	store->ss_alongtrack = NULL;
-	memset(store->comment, 0, MBSYS_LDEOIH_MAXLINE);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)*store_ptr);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_ldeoih_deall(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_ldeoih_deall";
-	int	status = MB_SUCCESS;
-	struct mbsys_ldeoih_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)*store_ptr);
-		}
-
-	/* get pointer to data structure */
-	store = (struct mbsys_ldeoih_struct *) *store_ptr;
-
-	/* deallocate memory for data structures */
-	status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->beamflag,error);
-	status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->bath,error);
-	status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->bath_acrosstrack,error);
-	status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->bath_alongtrack,error);
-	status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->amp,error);
-	status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->ss,error);
-	status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->ss_acrosstrack,error);
-	status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->ss_alongtrack,error);
-
-	/* deallocate memory for data structure */
-	status = mb_freed(verbose,__FILE__, __LINE__, (void **)store_ptr,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_ldeoih_dimensions(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int *nbath, int *namp, int *nss, int *error)
-{
-	char	*function_name = "mbsys_ldeoih_dimensions";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_ldeoih_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_ldeoih_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get beam and pixel numbers */
-		*nbath = store->beams_bath;
-		*namp = store->beams_amp;
-		*nss = store->pixels_ss;
-		}
-	else
-		{
-		/* get beam and pixel numbers */
-		*nbath = 0;
-		*namp = 0;
-		*nss = 0;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		fprintf(stderr,"dbg2       nbath:      %d\n",*nbath);
-		fprintf(stderr,"dbg2       namp:       %d\n",*namp);
-		fprintf(stderr,"dbg2       nss:        %d\n",*nss);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_ldeoih_sonartype(int verbose, void *mbio_ptr, void *store_ptr,
-		int *sonartype, int *error)
-{
-	char	*function_name = "mbsys_ldeoih_sonartype";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_ldeoih_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_ldeoih_struct *) store_ptr;
-
-	/* get sidescan type */
-	*sonartype = store->topo_type;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       sonartype:  %d\n",*sonartype);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_ldeoih_sidescantype(int verbose, void *mbio_ptr, void *store_ptr,
-		int *ss_type, int *error)
-{
-	char	*function_name = "mbsys_ldeoih_sidescantype";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_ldeoih_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_ldeoih_struct *) store_ptr;
-
-	/* get sidescan type */
-	*ss_type = store->ss_type;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       ss_type:    %d\n",*ss_type);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_ldeoih_extract(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int time_i[7], double *time_d,
-		double *navlon, double *navlat,
-		double *speed, double *heading,
-		int *nbath, int *namp, int *nss,
-		char *beamflag, double *bath, double *amp,
-		double *bathacrosstrack, double *bathalongtrack,
-		double *ss, double *ssacrosstrack, double *ssalongtrack,
-		char *comment, int *error)
-{
-	char	*function_name = "mbsys_ldeoih_extract";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_ldeoih_struct *store;
-	double	ss_scale;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_ldeoih_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get time */
-		*time_d = store->time_d;
-		mb_get_date(verbose,*time_d,time_i);
-
-		/* get navigation */
-		*navlon = store->longitude;
-		*navlat = store->latitude;
-
-		/* get heading */
-		*heading = store->heading;
-
-		/* get speed */
-		*speed = store->speed;
-
-		/* set beamwidths in mb_io structure */
-		if (store->beam_lwidth > 0)
-		    mb_io_ptr->beamwidth_ltrack = store->beam_lwidth;
-		else
-		    mb_io_ptr->beamwidth_ltrack = 2.0;
-		if (store->beam_xwidth > 0)
-		    mb_io_ptr->beamwidth_xtrack = store->beam_xwidth;
-		else
-		    mb_io_ptr->beamwidth_xtrack = 2.0;
-
-		/* read distance, depth, and backscatter
-			values into storage arrays */
-		*nbath = store->beams_bath;
-		*namp = store->beams_amp;
-		*nss = store->pixels_ss;
-		for (i=0;i<*nbath;i++)
-			{
-			beamflag[i] = store->beamflag[i];
-			if (beamflag[i] != MB_FLAG_NULL)
-				{
-				bath[i] = store->depth_scale * store->bath[i] + store->sonardepth;
-				bathacrosstrack[i] = store->distance_scale * store->bath_acrosstrack[i];
-				bathalongtrack[i] = store->distance_scale * store->bath_alongtrack[i];
-				}
-			else
-				{
-				bath[i] = 0.0;
-				bathacrosstrack[i] = 0.0;
-				bathalongtrack[i] = 0.0;
-				}
-			}
-		for (i=0;i<*namp;i++)
-			{
-			amp[i] = store->amp[i];
-			}
-		ss_scale = pow(2.0, (double)(store->ss_scalepower));
-		for (i=0;i<*nss;i++)
-			{
-			if (store->ss[i] != 0)
-				ss[i] = ss_scale * store->ss[i];
-			else
-				ss[i] = MB_SIDESCAN_NULL;
-			ssacrosstrack[i] = store->distance_scale * store->ss_acrosstrack[i];
-			ssalongtrack[i] = store->distance_scale * store->ss_alongtrack[i];
-			}
-
-		/* print debug statements */
-		if (verbose >= 5)
-			{
-			fprintf(stderr,"\ndbg4  Data extracted by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  Extracted values:\n");
-			fprintf(stderr,"dbg4       kind:       %d\n",
-				*kind);
-			fprintf(stderr,"dbg4       error:      %d\n",
-				*error);
-			fprintf(stderr,"dbg4       time_i[0]:  %d\n",
-				time_i[0]);
-			fprintf(stderr,"dbg4       time_i[1]:  %d\n",
-				time_i[1]);
-			fprintf(stderr,"dbg4       time_i[2]:  %d\n",
-				time_i[2]);
-			fprintf(stderr,"dbg4       time_i[3]:  %d\n",
-				time_i[3]);
-			fprintf(stderr,"dbg4       time_i[4]:  %d\n",
-				time_i[4]);
-			fprintf(stderr,"dbg4       time_i[5]:  %d\n",
-				time_i[5]);
-			fprintf(stderr,"dbg4       time_i[6]:  %d\n",
-				time_i[6]);
-			fprintf(stderr,"dbg4       time_d:     %f\n",
-				*time_d);
-			fprintf(stderr,"dbg4       longitude:  %f\n",
-				*navlon);
-			fprintf(stderr,"dbg4       latitude:   %f\n",
-				*navlat);
-			fprintf(stderr,"dbg4       speed:      %f\n",
-				*speed);
-			fprintf(stderr,"dbg4       heading:    %f\n",
-				*heading);
-			fprintf(stderr,"dbg4       nbath:      %d\n",
-				*nbath);
-			for (i=0;i<*nbath;i++)
-			  fprintf(stderr,"dbg4       beam:%d  flag:%3d  bath:%f  acrosstrack:%f  alongtrack:%f\n",
-				i,beamflag[i],bath[i],bathacrosstrack[i],bathalongtrack[i]);
-			fprintf(stderr,"dbg4        namp:     %d\n",
-				*namp);
-			for (i=0;i<*namp;i++)
-			  fprintf(stderr,"dbg4        beam:%d   amp:%f  acrosstrack:%f  alongtrack:%f\n",
-				i,amp[i],bathacrosstrack[i],bathalongtrack[i]);
-			fprintf(stderr,"dbg4        nss:      %d\n",
-				*nss);
-			for (i=0;i<*nss;i++)
-			  fprintf(stderr,"dbg4        pixel:%d   ss:%f  acrosstrack:%f  alongtrack:%f\n",
-				i,ss[i],ssacrosstrack[i],ssalongtrack[i]);
-			}
-
-		/* done translating values */
-
-		}
-
-	/* extract comment from structure */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* copy comment */
-		strcpy(comment,store->comment);
-
-		/* print debug statements */
-		if (verbose >= 4)
-			{
-			fprintf(stderr,"\ndbg4  New ping read by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  New ping values:\n");
-			fprintf(stderr,"dbg4       error:      %d\n",
-				*error);
-			fprintf(stderr,"dbg4       comment:    %s\n",
-				comment);
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind == MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"dbg2       comment:     \ndbg2       %s\n",
-			comment);
-		}
-	else if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind != MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"dbg2       time_i[0]:     %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:     %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:     %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:     %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:     %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:     %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:     %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:        %f\n",*time_d);
-		fprintf(stderr,"dbg2       longitude:     %f\n",*navlon);
-		fprintf(stderr,"dbg2       latitude:      %f\n",*navlat);
-		fprintf(stderr,"dbg2       speed:         %f\n",*speed);
-		fprintf(stderr,"dbg2       heading:       %f\n",*heading);
-		}
-	if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind == MB_DATA_DATA)
-		{
-		fprintf(stderr,"dbg2       nbath:      %d\n",
-			*nbath);
-		for (i=0;i<*nbath;i++)
-		  fprintf(stderr,"dbg2       beam:%d  flag:%3d  bath:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,beamflag[i],bath[i],
-			bathacrosstrack[i],bathalongtrack[i]);
-		fprintf(stderr,"dbg2        namp:     %d\n",
-			*namp);
-		for (i=0;i<*namp;i++)
-		  fprintf(stderr,"dbg2       beam:%d   amp:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,amp[i],bathacrosstrack[i],bathalongtrack[i]);
-		fprintf(stderr,"dbg2        nss:      %d\n",
-			*nss);
-		for (i=0;i<*nss;i++)
-		  fprintf(stderr,"dbg2        pixel:%d   ss:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,ss[i],ssacrosstrack[i],ssalongtrack[i]);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_ldeoih_insert(int verbose, void *mbio_ptr, void *store_ptr,
-		int kind, int time_i[7], double time_d,
-		double navlon, double navlat,
-		double speed, double heading,
-		int nbath, int namp, int nss,
-		char *beamflag, double *bath, double *amp,
-		double *bathacrosstrack, double *bathalongtrack,
-		double *ss, double *ssacrosstrack, double *ssalongtrack,
-		char *comment, int *error)
-{
-	char	*function_name = "mbsys_ldeoih_insert";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_ldeoih_struct *store;
-	double	depthmax, distmax;
-	double	ssmax, ss_scale;
-	int	ngood;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       kind:       %d\n",kind);
-		}
-	if (verbose >= 2 && (kind == MB_DATA_DATA || kind == MB_DATA_NAV))
-		{
-		fprintf(stderr,"dbg2       time_i[0]:  %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:  %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:  %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:  %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:  %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:  %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:  %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:     %f\n",time_d);
-		fprintf(stderr,"dbg2       navlon:     %f\n",navlon);
-		fprintf(stderr,"dbg2       navlat:     %f\n",navlat);
-		fprintf(stderr,"dbg2       speed:      %f\n",speed);
-		fprintf(stderr,"dbg2       heading:    %f\n",heading);
-		}
-	if (verbose >= 2 && kind == MB_DATA_DATA)
-		{
-		fprintf(stderr,"dbg2       nbath:      %d\n",
-			nbath);
-		if (verbose >= 3)
-		 for (i=0;i<nbath;i++)
-		  fprintf(stderr,"dbg3       beam:%d  flag:%3d  bath:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,beamflag[i],bath[i],
-			bathacrosstrack[i],bathalongtrack[i]);
-		fprintf(stderr,"dbg2       namp:       %d\n",namp);
-		if (verbose >= 3)
-		 for (i=0;i<namp;i++)
-		  fprintf(stderr,"dbg3        beam:%d   amp:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,amp[i],bathacrosstrack[i],bathalongtrack[i]);
-		fprintf(stderr,"dbg2        nss:       %d\n",nss);
-		if (verbose >= 3)
-		 for (i=0;i<nss;i++)
-		  fprintf(stderr,"dbg3        pixel:%d   ss:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,ss[i],ssacrosstrack[i],ssalongtrack[i]);
-		}
-	if (verbose >= 2 && kind == MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"dbg2       comment:     \ndbg2       %s\n",
-			comment);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_ldeoih_struct *) store_ptr;
-
-	/* set data kind */
-	store->kind = kind;
-
-	/* insert data in structure */
-	if (store->kind == MB_DATA_DATA)
-		{
-		/* get time */
-		store->time_d = time_d;
-
-		/* get navigation */
-		store->longitude = navlon;
-		store->latitude = navlat;
-
-		/* get heading */
-		store->heading = heading;
-		store->speed = speed;
-
-		/* if needed reset numbers of beams and allocate
-		   memory for store arrays */
-		if (nbath > store->beams_bath_alloc)
-		    {
-		    store->beams_bath_alloc = nbath;
-		    if (store->beamflag != NULL)
-			status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->beamflag, error);
-		    if (store->bath != NULL)
-			status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->bath, error);
-		    if (store->bath_acrosstrack != NULL)
-			status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->bath_acrosstrack, error);
-		    if (store->bath_alongtrack != NULL)
-			status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->bath_alongtrack, error);
-		    status = mb_mallocd(verbose,__FILE__, __LINE__,
-				store->beams_bath_alloc * sizeof(char),
-				(void **)&store->beamflag,error);
-		    status = mb_mallocd(verbose,__FILE__, __LINE__,
-				store->beams_bath_alloc * sizeof(short),
-				(void **)&store->bath,error);
-		    status = mb_mallocd(verbose,__FILE__, __LINE__,
-				store->beams_bath_alloc * sizeof(short),
-				(void **)&store->bath_acrosstrack,error);
-		    status = mb_mallocd(verbose,__FILE__, __LINE__,
-				store->beams_bath_alloc * sizeof(short),
-				(void **)&store->bath_alongtrack,error);
-
-		    /* deal with a memory allocation failure */
-		    if (status == MB_FAILURE)
-			{
-			status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->beamflag, error);
-			status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->bath, error);
-			status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->bath_acrosstrack, error);
-			status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->bath_alongtrack, error);
-			status = MB_FAILURE;
-			*error = MB_ERROR_MEMORY_FAIL;
-			if (verbose >= 2)
-				{
-				fprintf(stderr,"\ndbg2  MBcopy function <%s> terminated with error\n",
-					function_name);
-				fprintf(stderr,"dbg2  Return values:\n");
-				fprintf(stderr,"dbg2       error:      %d\n",*error);
-				fprintf(stderr,"dbg2  Return status:\n");
-				fprintf(stderr,"dbg2       status:  %d\n",status);
-				}
-			return(status);
-			}
-		    }
-		if (namp > store->beams_amp_alloc)
-		    {
-		    store->beams_amp_alloc = namp;
-		    if (store != NULL)
-			{
-			if (store->amp != NULL)
-			    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->amp, error);
-			status = mb_mallocd(verbose,__FILE__, __LINE__,
-				    store->beams_amp_alloc * sizeof(short),
-				    (void **)&store->amp,error);
-
-			/* deal with a memory allocation failure */
-			if (status == MB_FAILURE)
-			    {
-			    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->amp, error);
-			    status = MB_FAILURE;
-			    *error = MB_ERROR_MEMORY_FAIL;
-			    if (verbose >= 2)
-				    {
-				    fprintf(stderr,"\ndbg2  MBIO function <%s> terminated with error\n",
-					    function_name);
-				    fprintf(stderr,"dbg2  Return values:\n");
-				    fprintf(stderr,"dbg2       error:      %d\n",*error);
-				    fprintf(stderr,"dbg2  Return status:\n");
-				    fprintf(stderr,"dbg2       status:  %d\n",status);
-				    }
-			    return(status);
-			    }
-			}
-		    }
-		if (nss > store->pixels_ss_alloc)
-		    {
-		    store->pixels_ss_alloc = nss;
-		    if (store != NULL)
-			{
-			if (store->ss != NULL)
-			    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->ss, error);
-			if (store->ss_acrosstrack != NULL)
-			    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->ss_acrosstrack, error);
-			if (store->ss_alongtrack != NULL)
-			    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->ss_alongtrack, error);
-			status = mb_mallocd(verbose,__FILE__, __LINE__,
-				    store->pixels_ss_alloc * sizeof(short),
-				    (void **)&store->ss,error);
-			status = mb_mallocd(verbose,__FILE__, __LINE__,
-				    store->pixels_ss_alloc * sizeof(short),
-				    (void **)&store->ss_acrosstrack,error);
-			status = mb_mallocd(verbose,__FILE__, __LINE__,
-				    store->pixels_ss_alloc * sizeof(short),
-				    (void **)&store->ss_alongtrack,error);
-
-			/* deal with a memory allocation failure */
-			if (status == MB_FAILURE)
-			    {
-			    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->ss, error);
-			    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->ss_acrosstrack, error);
-			    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->ss_alongtrack, error);
-			    status = MB_FAILURE;
-			    *error = MB_ERROR_MEMORY_FAIL;
-			    if (verbose >= 2)
-				    {
-				    fprintf(stderr,"\ndbg2  MBIO function <%s> terminated with error\n",
-					    function_name);
-				    fprintf(stderr,"dbg2  Return values:\n");
-				    fprintf(stderr,"dbg2       error:      %d\n",*error);
-				    fprintf(stderr,"dbg2  Return status:\n");
-				    fprintf(stderr,"dbg2       status:  %d\n",status);
-				    }
-			    return(status);
-			    }
-			}
-		    }
-
-		/* get scaling */
-		depthmax = 0.0;
-		distmax = 0.0;
-		ssmax = 0.0;
-		for (i=0;i<nbath;i++)
-		    {
-		    if (beamflag[i] != MB_FLAG_NULL)
-			{
-			depthmax = MAX(depthmax, fabs(bath[i] - store->sonardepth));
-			distmax = MAX(distmax, fabs(bathacrosstrack[i]));
-			distmax = MAX(distmax, fabs(bathalongtrack[i]));
-			}
-		    }
-		for (i=0;i<nss;i++)
-		    {
-		    if (ss[i] > MB_SIDESCAN_NULL)
-			{
-			distmax = MAX(distmax, fabs(ssacrosstrack[i]));
-			distmax = MAX(distmax, fabs(ssalongtrack[i]));
-			ssmax = MAX(ssmax, fabs(ss[i]));
-			}
-		    }
-		if (depthmax > 0.0)
-		    store->depth_scale = 0.001 * (float)(MAX((depthmax / 30.0), 1.0));
-		if (distmax > 0.0)
-		    store->distance_scale = 0.001 * (float)(MAX((distmax / 30.0), 1.0));
-		if (ssmax > 0.0)
-			{
-			store->ss_scalepower = (mb_s_char)(log2(ssmax / 32767.0)) + 1;
-			ss_scale = pow(2.0, (double)(store->ss_scalepower));
-			}
-		else
-			{
-			store->ss_scalepower = 0;
-			ss_scale = 1.0;
-			}
-
-		/* set beam widths */
-		if (store->beam_xwidth == 0.0)
-		    store->beam_xwidth = mb_io_ptr->beamwidth_xtrack;
-		if (store->beam_lwidth == 0.0)
-		    store->beam_lwidth = mb_io_ptr->beamwidth_ltrack;
-
-		/* put distance, depth, and backscatter values
-			into data structure */
-		store->beams_bath = nbath;
-		for (i=0;i<nbath;i++)
-			{
-			if (beamflag[i] != MB_FLAG_NULL)
-				{
-				store->beamflag[i] = beamflag[i];
-				store->bath[i] = (bath[i] - store->sonardepth) / store->depth_scale;
-				store->bath_acrosstrack[i] = bathacrosstrack[i] / store->distance_scale;
-				store->bath_alongtrack[i] = bathalongtrack[i] / store->distance_scale;
-				}
-			else
-				{
-				store->beamflag[i] = beamflag[i];
-				store->bath[i] = 0;
-				store->bath_acrosstrack[i] = 0;
-				store->bath_alongtrack[i] = 0;
-				}
-			}
-		store->beams_amp = namp;
-		for (i=0;i<namp;i++)
-			{
-			store->amp[i] = amp[i];
-			}
-		store->pixels_ss = nss;
-		ngood = 0;
-		for (i=0;i<nss;i++)
-			{
-			if (ss[i] > MB_SIDESCAN_NULL)
-				{
-				store->ss[i] = (short)(ss[i] / ss_scale);
-				ngood++;
-				}
-			else
-				store->ss[i] = 0;
-			store->ss_acrosstrack[i] = ssacrosstrack[i] / store->distance_scale;
-			store->ss_alongtrack[i] = ssalongtrack[i] / store->distance_scale;
-			}
-		}
-
-	/* insert comment in structure */
-	else if (store->kind == MB_DATA_COMMENT)
-		{
-		strncpy(store->comment,comment,MBSYS_LDEOIH_MAXLINE-1);
-		if (strlen(comment) > MBSYS_LDEOIH_MAXLINE-2)
-			store->comment[MBSYS_LDEOIH_MAXLINE-1] = '\0';
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_ldeoih_ttimes(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, int *nbeams,
-	double *ttimes, double *angles,
-	double *angles_forward, double *angles_null,
-	double *heave, double *alongtrack_offset,
-	double *draft, double *ssv, int *error)
-{
-	char	*function_name = "mbsys_ldeoih_ttimes";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_ldeoih_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       ttimes:     %p\n",(void *)ttimes);
-		fprintf(stderr,"dbg2       angles_xtrk:%p\n",(void *)angles);
-		fprintf(stderr,"dbg2       angles_ltrk:%p\n",(void *)angles_forward);
-		fprintf(stderr,"dbg2       angles_null:%p\n",(void *)angles_null);
-		fprintf(stderr,"dbg2       heave:      %p\n",(void *)heave);
-		fprintf(stderr,"dbg2       ltrk_off:   %p\n",(void *)alongtrack_offset);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_ldeoih_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get nbeams */
-		*nbeams = store->beams_bath;
-
-		/* get travel times, angles */
-		for (i=0;i<store->beams_bath;i++)
-			{
-			ttimes[i] = 0.0;
-			angles[i] = 0.0;
-			angles_forward[i] = 0.0;
-			angles_null[i] = 0.0;
-			heave[i] = 0.0;
-			alongtrack_offset[i] = 0.0;
-			}
-
-		/* get ssv */
-		*ssv = 0.0;
-		*draft = 0.0;
-
-		/* set status */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error == MB_ERROR_NO_ERROR)
-		{
-		fprintf(stderr,"dbg2       draft:      %f\n",*draft);
-		fprintf(stderr,"dbg2       ssv:        %f\n",*ssv);
-		fprintf(stderr,"dbg2       nbeams:     %d\n",*nbeams);
-		for (i=0;i<*nbeams;i++)
-			fprintf(stderr,"dbg2       beam %d: tt:%f  angle_xtrk:%f angle_ltrk:%f  angle_null:%f  depth_off:%f  ltrk_off:%f\n",
-				i,ttimes[i],angles[i],
-				angles_forward[i],angles_null[i],
-				heave[i],alongtrack_offset[i]);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_ldeoih_detects(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, int *nbeams,
-	int *detects, int *error)
-{
-	char	*function_name = "mbsys_ldeoih_detects";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_ldeoih_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       detects:    %p\n",(void *)detects);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_ldeoih_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get nbeams */
-		*nbeams = store->beams_bath;
-
-		/* get detects */
-		for (i=0;i<*nbeams;i++)
-			{
-			detects[i] = MB_DETECT_UNKNOWN;
-			}
-
-		/* set status */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error == MB_ERROR_NO_ERROR)
-		{
-		fprintf(stderr,"dbg2       nbeams:     %d\n",*nbeams);
-		for (i=0;i<*nbeams;i++)
-			fprintf(stderr,"dbg2       beam %d: detects:%d\n",
-				i,detects[i]);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_ldeoih_extract_altitude(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, double *transducer_depth, double *altitude,
-	int *error)
-{
-	char	*function_name = "mbsys_ldeoih_extract_altitude";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_ldeoih_struct *store;
-	double	bath_best;
-	double	xtrack_min;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_ldeoih_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		*transducer_depth = store->sonardepth;
-		if (store->altitude <= 0.0 && store->beams_bath > 0)
-		    {
-		    bath_best = 0.0;
-		    if (store->bath[store->beams_bath/2] > 0.0)
-			bath_best = store->depth_scale * store->bath[store->beams_bath/2] + (*transducer_depth);
-		    else
-			{
-			xtrack_min = 99999999.9;
-			for (i=0;i<store->beams_bath;i++)
-			    {
-			    if (store->bath[i] > 0
-				&& fabs(store->distance_scale * store->bath_acrosstrack[i]) < xtrack_min)
-				{
-				xtrack_min = fabs(store->distance_scale * store->bath_acrosstrack[i]);
-				bath_best = store->depth_scale * store->bath[i] + (*transducer_depth);
-				}
-			    }
-			}
-		    if (bath_best <= 0.0)
-			{
-			xtrack_min = 99999999.9;
-			for (i=0;i<store->beams_bath;i++)
-			    {
-			    if (store->bath[i] < 0.0
-				&& fabs(store->distance_scale * store->bath_acrosstrack[i]) < xtrack_min)
-				{
-				xtrack_min = fabs(store->distance_scale * store->bath_acrosstrack[i]);
-				bath_best = -store->depth_scale * store->bath[i] + (*transducer_depth);
-				}
-			    }
-			}
-		    *altitude = bath_best - *transducer_depth;
-		    }
-		else
-		    *altitude = store->altitude;
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:              %d\n",*kind);
-		fprintf(stderr,"dbg2       transducer_depth:  %f\n",*transducer_depth);
-		fprintf(stderr,"dbg2       altitude:          %f\n",*altitude);
-		fprintf(stderr,"dbg2       error:             %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:            %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_ldeoih_insert_altitude(int verbose, void *mbio_ptr, void *store_ptr,
-	double transducer_depth, double altitude,
-	int *error)
-{
-	char	*function_name = "mbsys_ldeoih_insert_altitude";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_ldeoih_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:           %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:            %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:         %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       transducer_depth:  %f\n",transducer_depth);
-		fprintf(stderr,"dbg2       altitude:          %f\n",altitude);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_ldeoih_struct *) store_ptr;
-
-	/* insert data into structure */
-	if (store->kind == MB_DATA_DATA)
-		{
-		store->sonardepth = transducer_depth;
-		store->altitude = altitude;
-		}
-
-	/* deal with comment */
-	else if (store->kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:             %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:            %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_ldeoih_extract_nav(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int time_i[7], double *time_d,
-		double *navlon, double *navlat,
-		double *speed, double *heading, double *draft,
-		double *roll, double *pitch, double *heave,
-		int *error)
-{
-	char	*function_name = "mbsys_ldeoih_extract_nav";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_ldeoih_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_ldeoih_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get time */;
-		*time_d = store->time_d;
-		mb_get_date(verbose, *time_d, time_i);
-
-		/* get navigation */
-		*navlon = store->longitude;
-		*navlat = store->latitude;
-
-		/* get heading */
-		*heading = store->heading;
-
-		/* set speed */
-		*speed = store->speed;
-
-		/* set draft */
-		*draft = store->sonardepth + store->heave;
-
-		/* get roll pitch and heave */
-		*roll = store->roll;
-		*pitch = store->pitch;
-		*heave = store->heave;
-
-		/* print debug statements */
-		if (verbose >= 5)
-			{
-			fprintf(stderr,"\ndbg4  Data extracted by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  Extracted values:\n");
-			fprintf(stderr,"dbg4       kind:       %d\n",
-				*kind);
-			fprintf(stderr,"dbg4       error:      %d\n",
-				*error);
-			fprintf(stderr,"dbg4       time_i[0]:  %d\n",
-				time_i[0]);
-			fprintf(stderr,"dbg4       time_i[1]:  %d\n",
-				time_i[1]);
-			fprintf(stderr,"dbg4       time_i[2]:  %d\n",
-				time_i[2]);
-			fprintf(stderr,"dbg4       time_i[3]:  %d\n",
-				time_i[3]);
-			fprintf(stderr,"dbg4       time_i[4]:  %d\n",
-				time_i[4]);
-			fprintf(stderr,"dbg4       time_i[5]:  %d\n",
-				time_i[5]);
-			fprintf(stderr,"dbg4       time_i[6]:  %d\n",
-				time_i[6]);
-			fprintf(stderr,"dbg4       time_d:     %f\n",
-				*time_d);
-			fprintf(stderr,"dbg4       longitude:  %f\n",
-				*navlon);
-			fprintf(stderr,"dbg4       latitude:   %f\n",
-				*navlat);
-			fprintf(stderr,"dbg4       speed:      %f\n",
-				*speed);
-			fprintf(stderr,"dbg4       heading:    %f\n",
-				*heading);
-			fprintf(stderr,"dbg4       draft:      %f\n",
-				*draft);
-			fprintf(stderr,"dbg4       roll:       %f\n",
-				*roll);
-			fprintf(stderr,"dbg4       pitch:      %f\n",
-				*pitch);
-			fprintf(stderr,"dbg4       heave:      %f\n",
-				*heave);
-			}
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind == MB_DATA_DATA)
-		{
-		fprintf(stderr,"dbg2       time_i[0]:     %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:     %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:     %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:     %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:     %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:     %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:     %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:        %f\n",*time_d);
-		fprintf(stderr,"dbg2       longitude:     %f\n",*navlon);
-		fprintf(stderr,"dbg2       latitude:      %f\n",*navlat);
-		fprintf(stderr,"dbg2       speed:         %f\n",*speed);
-		fprintf(stderr,"dbg2       heading:       %f\n",*heading);
-		fprintf(stderr,"dbg2       draft:         %f\n",*draft);
-		fprintf(stderr,"dbg2       roll:          %f\n",*roll);
-		fprintf(stderr,"dbg2       pitch:         %f\n",*pitch);
-		fprintf(stderr,"dbg2       heave:         %f\n",*heave);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_ldeoih_insert_nav(int verbose, void *mbio_ptr, void *store_ptr,
-		int time_i[7], double time_d,
-		double navlon, double navlat,
-		double speed, double heading, double draft,
-		double roll, double pitch, double heave,
-		int *error)
-{
-	char	*function_name = "mbsys_ldeoih_insert_nav";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_ldeoih_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       time_i[0]:  %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:  %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:  %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:  %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:  %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:  %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:  %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:     %f\n",time_d);
-		fprintf(stderr,"dbg2       navlon:     %f\n",navlon);
-		fprintf(stderr,"dbg2       navlat:     %f\n",navlat);
-		fprintf(stderr,"dbg2       speed:      %f\n",speed);
-		fprintf(stderr,"dbg2       heading:    %f\n",heading);
-		fprintf(stderr,"dbg2       draft:      %f\n",draft);
-		fprintf(stderr,"dbg2       roll:       %f\n",roll);
-		fprintf(stderr,"dbg2       pitch:      %f\n",pitch);
-		fprintf(stderr,"dbg2       heave:      %f\n",heave);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_ldeoih_struct *) store_ptr;
-
-	/* insert data in structure */
-	if (store->kind == MB_DATA_DATA)
-		{
-		/* get time */
-		store->time_d = time_d;
-
-		/* get navigation */
-		store->longitude = navlon;
-		store->latitude = navlat;
-
-		/* get heading */
-		store->heading = heading;
-		store->speed = speed;
-
-		/* get draft */
-		store->sonardepth = draft - heave;
-
-		/* get roll pitch and heave */
-		store->roll = roll;
-		store->pitch = pitch;
-		store->heave = heave;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_ldeoih_copy(int verbose, void *mbio_ptr,
-			void *store_ptr, void *copy_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_ldeoih_copy";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_ldeoih_struct *store;
-	struct mbsys_ldeoih_struct *copy;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       copy_ptr:   %p\n",(void *)copy_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointers */
-	store = (struct mbsys_ldeoih_struct *) store_ptr;
-	copy = (struct mbsys_ldeoih_struct *) copy_ptr;
-
-	if (copy->beamflag != NULL)
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&copy->beamflag, error);
-	if (copy->bath != NULL)
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&copy->bath, error);
-	if (copy->bath_acrosstrack != NULL)
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&copy->bath_acrosstrack, error);
-	if (copy->bath_alongtrack != NULL)
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&copy->bath_alongtrack, error);
-	if (copy->amp != NULL)
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&copy->amp, error);
-	if (copy->ss != NULL)
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&copy->ss, error);
-	if (copy->ss_acrosstrack != NULL)
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&copy->ss_acrosstrack, error);
-	if (copy->ss_alongtrack != NULL)
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&copy->ss_alongtrack, error);
-	status = mb_mallocd(verbose,__FILE__, __LINE__,
-		    store->beams_bath * sizeof(char),
-		    (void **)&copy->beamflag,error);
-	status = mb_mallocd(verbose,__FILE__, __LINE__,
-		    store->beams_bath * sizeof(short),
-		    (void **)&copy->bath,error);
-	status = mb_mallocd(verbose,__FILE__, __LINE__,
-		    store->beams_bath * sizeof(short),
-		    (void **)&copy->bath_acrosstrack,error);
-	status = mb_mallocd(verbose,__FILE__, __LINE__,
-		    store->beams_bath * sizeof(short),
-		    (void **)&copy->bath_alongtrack,error);
-	status = mb_mallocd(verbose,__FILE__, __LINE__,
-		    store->beams_amp * sizeof(short),
-		    (void **)&copy->amp,error);
-	status = mb_mallocd(verbose,__FILE__, __LINE__,
-		    store->pixels_ss * sizeof(short),
-		    (void **)&copy->ss,error);
-	status = mb_mallocd(verbose,__FILE__, __LINE__,
-		    store->pixels_ss * sizeof(short),
-		    (void **)&copy->ss_acrosstrack,error);
-	status = mb_mallocd(verbose,__FILE__, __LINE__,
-		    store->pixels_ss * sizeof(short),
-		    (void **)&copy->ss_alongtrack,error);
-
-	/* deal with a memory allocation failure */
-	if (status == MB_FAILURE)
-	    {
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&copy->beamflag, error);
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&copy->bath, error);
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&copy->bath_acrosstrack, error);
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&copy->bath_alongtrack, error);
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&copy->amp, error);
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&copy->ss, error);
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&copy->ss_acrosstrack, error);
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&copy->ss_alongtrack, error);
-	    status = MB_FAILURE;
-	    *error = MB_ERROR_MEMORY_FAIL;
-	    }
-
-	/* copy the data */
-	if (status == MB_SUCCESS)
-	    {
-	    copy->kind = store->kind;
-	    copy->time_d = store->time_d;
-	    copy->longitude = store->longitude;
-	    copy->latitude = store->latitude;
-	    copy->sonardepth = store->sonardepth;
-	    copy->altitude = store->altitude;
-	    copy->heading = store->heading;
-	    copy->speed = store->speed;
-	    copy->roll = store->roll;
-	    copy->pitch = store->pitch;
-	    copy->heave = store->heave;
-	    copy->beam_xwidth = store->beam_xwidth;
-	    copy->beam_lwidth = store->beam_lwidth;
-	    copy->beams_bath = store->beams_bath;
-	    copy->beams_amp = store->beams_amp;
-	    copy->pixels_ss = store->pixels_ss;
-	    copy->spare1 = store->spare1;
-	    copy->depth_scale = store->depth_scale;
-	    copy->distance_scale = store->distance_scale;
-	    copy->ss_type = store->ss_type;
-	    copy->ss_scalepower = store->ss_scalepower;
-	    for (i=0;i<copy->beams_bath;i++)
-		    {
-		    copy->beamflag[i] = store->beamflag[i];
-		    copy->bath[i] = store->bath[i];
-		    copy->bath_acrosstrack[i] = store->bath_acrosstrack[i];
-		    copy->bath_alongtrack[i] = store->bath_alongtrack[i];
-		    }
-	    for (i=0;i<copy->beams_amp;i++)
-		    {
-		    copy->amp[i] = store->amp[i];
-		    }
-	    for (i=0;i<copy->pixels_ss;i++)
-		    {
-		    copy->ss[i] = store->ss[i];
-		    copy->ss_acrosstrack[i] = store->ss_acrosstrack[i];
-		    copy->ss_alongtrack[i] = store->ss_alongtrack[i];
-		    }
-	    strcpy(copy->comment,store->comment);
-	    }
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mbsys_ldeoih.h b/src/mbio/mbsys_ldeoih.h
deleted file mode 100644
index 70acd1a..0000000
--- a/src/mbio/mbsys_ldeoih.h
+++ /dev/null
@@ -1,263 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbsys_ldeoih.h	3/2/93
- *	$Id: mbsys_ldeoih.h 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1993-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbsys_ldeoih.h defines the data structure used by MBIO functions
- * to store multibeam data in a general purpose archive format:
- *      MBF_HSLDEOIH : MBIO ID 71
- *
- * Author:	D. W. Caress
- * Date:	March 2, 1993
- *
- */
-/*
- * Notes on the MBSYS_LDEOIH data structure:
- *   1. This data structure is used to store multibeam bathymetry
- *      and/or backscatter data with arbitrary numbers of beams.
- *	This format was created by the Lamont-Doherty Earth
- *	Observatory to serve as a general purpose archive format for
- *	processed multibeam data.
- *   2. The data consist of variable length binary records encoded
- *	entirely in 2-byte integers.
- *   3. Both the depth and backscatter arrays are centered.
- *   4. The kind value in the mbf_sbsiocen_struct indicates whether the
- *      mbf_sbsiocen_data_struct structure holds data (kind = 1) or an
- *      ascii comment record (kind = 0).
- */
-
-/* maximum line length in characters */
-#define MBSYS_LDEOIH_MAXLINE 200
-
-struct mbsys_ldeoih_struct
-	{
-	/* type of data record */
-	int	kind;
-
-	/* time stamp */
-	double	time_d;		/* decimal seconds since start of 1970 */
-
-	/* position */
-	double	longitude;	/* longitude (degrees 0-360) */
-	double	latitude;	/* latitude (degrees 0-360) */
-
-	/* sonar depth and altitude */
-	double	sonardepth;	/* meters (sonar depth for bathymetry calculation,
-					already corrected for heave if needed,
-						sonardepth = transducer_depth
-						bath = altitude + sonardepth
-						sonardepth = draft - heave
-						draft = sonardepth + heave */
-	double	altitude;	/* meters */
-
-	/* heading and speed */
-	float	heading;	/* heading (degrees 0-360) */
-	float	speed;		/* km/hour */
-
-	/* attitude */
-	float	roll;		/* degrees */
-	float	pitch;		/* degrees */
-	float	heave;		/* meters */
-
-	/* beam widths */
-	float	beam_xwidth;	/* degrees */
-	float	beam_lwidth;	/* degrees */
-
-	/* numbers of beams */
-	int	beams_bath;	/* number of depth values */
-	int	beams_amp;	/* number of amplitude values */
-	int	pixels_ss;	/* number of sidescan pixels */
-	int	spare1;
-	int	beams_bath_alloc;	/* number of depth values allocated */
-	int	beams_amp_alloc;	/* number of amplitude values allocated */
-	int	pixels_ss_alloc;	/* number of sidescan pixels allocated */
-
-	/* scaling */
-	float	depth_scale;	/* depth[i] = (bath[i] * depth_scale) + transducer_depth */
-	float	distance_scale;	/* acrosstrackdistance[i] = acrosstrack[i] * distance_scale
-					alongtrackdistance[i] = alongtrack[i] * distance_scale */
-
-	/* data type parameters */
-        mb_s_char       ss_scalepower;  /* gives scaling factor for sidescan values in powers of 10:
-                                                ss_scalepower = 0: ss = ss_stored * 1
-                                                ss_scalepower = 1: ss = ss_stored * 10
-                                                ss_scalepower = 2: ss = ss_stored * 100
-                                                ss_scalepower = 3: ss = ss_stored * 1000 */
-	mb_u_char	ss_type;	/* indicates if sidescan values are logarithmic or linear
-                                                ss_type = 0: logarithmic (dB)
-                                                ss_type = 1: linear (voltage) */
-	mb_u_char	imagery_type;   /* MBIO imagery source types defined in mb_status.h
-                                                MB_IMAGERY_TYPE_UNKNOWN		        0
-                                                MB_IMAGERY_TYPE_ECHOSOUNDER	        1
-                                                MB_IMAGERY_TYPE_MULTIBEAM		2
-                                                MB_IMAGERY_TYPE_SIDESCAN		3
-                                                MB_IMAGERY_TYPE_INTERFEROMETRIC	        4
-                                                MB_IMAGERY_TYPE_LIDAR      	        5
-                                                MB_IMAGERY_TYPE_CAMERA     	        6
-                                                MB_IMAGERY_TYPE_GRID     	        7
-                                                MB_IMAGERY_TYPE_POINT       	        8 */
-
-	mb_u_char	topo_type;      /* MBIO topography source types
-                                                MB_TOPOGRAPHY_TYPE_UNKNOWN		0
-                                                MB_TOPOGRAPHY_TYPE_ECHOSOUNDER	        1
-                                                MB_TOPOGRAPHY_TYPE_MULTIBEAM		2
-                                                MB_TOPOGRAPHY_TYPE_SIDESCAN		3
-                                                MB_TOPOGRAPHY_TYPE_INTERFEROMETRIC	4
-                                                MB_TOPOGRAPHY_TYPE_LIDAR      	        5
-                                                MB_TOPOGRAPHY_TYPE_CAMERA     	        6
-                                                MB_TOPOGRAPHY_TYPE_GRID     	        7
-                                                MB_TOPOGRAPHY_TYPE_POINT       	        8 */
-
-	/* pointers to arrays */
-	unsigned char *beamflag;
-	short	*bath;
-	short	*amp;
-	short	*bath_acrosstrack;
-	short	*bath_alongtrack;
-	short	*ss;
-	short	*ss_acrosstrack;
-	short	*ss_alongtrack;
-
-	/* comment */
-	char	comment[MBSYS_LDEOIH_MAXLINE];
-	};
-
-struct mbsys_ldeoih_old_struct
-	{
-	/* type of data record */
-	int	kind;
-
-	/* time stamp */
-	short	year;		/* year (4 digits) */
-	short	day;		/* julian day (1-366) */
-	short	min;		/* minutes from beginning of day (0-1439) */
-	short	sec;		/* seconds from beginning of minute (0-59) */
-	short	msec;		/* milliseconds from beginning of minute (0-59) */
-
-	/* position */
-	unsigned short	lon2u;	/* minutes east of prime meridian */
-	unsigned short	lon2b;	/* fraction of minute times 10000 */
-	unsigned short	lat2u;	/* number of minutes north of 90S */
-	unsigned short	lat2b;	/* fraction of minute times 10000 */
-
-	/* heading and speed */
-	unsigned short	heading;/* heading:
-					0 = 0 degrees
-					1 = 0.0055 degrees
-					16384 = 90 degrees
-					65535 = 359.9945 degrees
-					0 = 360 degrees */
-	unsigned short	speed;	/* km/s X100 */
-
-	/* numbers of beams */
-	short	beams_bath;	/* number of depth values */
-	short	beams_amp;	/* number of amplitude values */
-	short	pixels_ss;	/* number of sidescan pixels */
-	short	beams_bath_alloc;	/* number of depth values allocated */
-	short	beams_amp_alloc;	/* number of amplitude values allocated */
-	short	pixels_ss_alloc;	/* number of sidescan pixels allocated */
-
-	/* obsolete scaling */
-/* 	short	depth_scale;*/	/* 1000 X scale where depth = bath X scale */
-/* 	short	distance_scale;*//* 1000 X scale where distance = dist X scale */
-/* 	short	transducer_depth;*/ /* scaled by depth_scale */
-/* 	short	altitude;*/	/* scaled by depth_scale */
-/* 	short	beam_xwidth;*/	/* 0.01 degrees */
-/* 	short	beam_lwidth;*/	/* 0.01 degrees */
-/* 	short	ss_type;*/	/* indicates if sidescan values are logarithmic or linear
-					ss_type = 0: logarithmic (dB)
-					ss_type = 1: linear (voltage) */
-
-	/* scaling */
-	short	depth_scale;	/* 1000*scale where depth = bath*scale + transducer_depth / 1000 */
-	short	distance_scale;	/* 1000*scale where distance = dist*scale */
-	int	transducer_depth; /* 0.001 m */
-	int	altitude;	/* 0.001 m */
-	short	beam_xwidth;	/* 0.01 degrees */
-	short	beam_lwidth;	/* 0.01 degrees */
-	short	ss_type;	/* indicates if sidescan values are logarithmic or linear
-					ss_type = 0: logarithmic (dB)
-					ss_type = 1: linear (voltage) */
-
-	/* pointers to arrays */
-	unsigned char *beamflag;
-	short	*bath;
-	short	*amp;
-	short	*bath_acrosstrack;
-	short	*bath_alongtrack;
-	short	*ss;
-	short	*ss_acrosstrack;
-	short	*ss_alongtrack;
-
-	/* comment */
-	char	comment[MBSYS_LDEOIH_MAXLINE];
-	};
-
-/* system specific function prototypes */
-int mbsys_ldeoih_alloc(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error);
-int mbsys_ldeoih_deall(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error);
-int mbsys_ldeoih_dimensions(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int *nbath, int *namp, int *nss, int *error);
-int mbsys_ldeoih_sonartype(int verbose, void *mbio_ptr, void *store_ptr,
-		int *sonartype, int *error);
-int mbsys_ldeoih_sidescantype(int verbose, void *mbio_ptr, void *store_ptr,
-		int *ss_type, int *error);
-int mbsys_ldeoih_extract(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int time_i[7], double *time_d,
-			double *navlon, double *navlat,
-			double *speed, double *heading,
-			int *nbath, int *namp, int *nss,
-			char *beamflag, double *bath, double *amp,
-			double *bathacrosstrack, double *bathalongtrack,
-			double *ss, double *ssacrosstrack, double *ssalongtrack,
-			char *comment, int *error);
-int mbsys_ldeoih_insert(int verbose, void *mbio_ptr, void *store_ptr,
-			int kind, int time_i[7], double time_d,
-			double navlon, double navlat,
-			double speed, double heading,
-			int nbath, int namp, int nss,
-			char *beamflag, double *bath, double *amp,
-			double *bathacrosstrack, double *bathalongtrack,
-			double *ss, double *ssacrosstrack, double *ssalongtrack,
-			char *comment, int *error);
-int mbsys_ldeoih_ttimes(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int *nbeams,
-			double *ttimes, double *angles,
-			double *angles_forward, double *angles_null,
-			double *heave, double *alongtrack_offset,
-			double *draft, double *ssv, int *error);
-int mbsys_ldeoih_detects(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int *nbeams, int *detects, int *error);
-int mbsys_ldeoih_extract_altitude(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, double *transducer_depth, double *altitude,
-			int *error);
-int mbsys_ldeoih_insert_altitude(int verbose, void *mbio_ptr, void *store_ptr,
-			double transducer_depth, double altitude,
-			int *error);
-int mbsys_ldeoih_extract_nav(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int time_i[7], double *time_d,
-			double *navlon, double *navlat,
-			double *speed, double *heading, double *draft,
-			double *roll, double *pitch, double *heave,
-			int *error);
-int mbsys_ldeoih_insert_nav(int verbose, void *mbio_ptr, void *store_ptr,
-			int time_i[7], double time_d,
-			double navlon, double navlat,
-			double speed, double heading, double draft,
-			double roll, double pitch, double heave,
-			int *error);
-int mbsys_ldeoih_copy(int verbose, void *mbio_ptr,
-			void *store_ptr, void *copy_ptr,
-			int *error);
diff --git a/src/mbio/mbsys_mr1.c b/src/mbio/mbsys_mr1.c
deleted file mode 100644
index 11c1b6c..0000000
--- a/src/mbio/mbsys_mr1.c
+++ /dev/null
@@ -1,1411 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbsys_mr1.c	7/19/94
- *	$Id: mbsys_mr1.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1993-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbsys_mr1.c contains the functions for handling the data structure
- * used by MBIO functions to store data from the MR1 towed sonar.
- * The data formats which are commonly used to store MR1
- * data in files include
- *      MBF_MR1PRHIG : MBIO ID 61
- *
- * Author:	D. W. Caress
- * Date:	July 19, 1994
- * $Log: mbsys_mr1.c,v $
- * Revision 5.6  2005/11/05 00:48:05  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.5  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.4  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.3  2001/08/25 00:54:13  caress
- * Adding beamwidth values to extract functions.
- *
- * Revision 5.2  2001/07/20  00:32:54  caress
- * Release 5.0.beta03
- *
- * Revision 5.1  2001/01/22  07:43:34  caress
- * Version 5.0.beta01
- *
- * Revision 5.0  2000/12/01  22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.19  2000/10/11  01:03:21  caress
- * Convert to ANSI C
- *
- * Revision 4.18  2000/10/03  21:48:03  caress
- * Snapshot for Dale.
- *
- * Revision 4.17  2000/09/30  06:32:52  caress
- * Snapshot for Dale.
- *
- * Revision 4.16  1998/10/05  17:46:15  caress
- * MB-System version 4.6beta
- *
- * Revision 4.15  1997/09/15  19:06:40  caress
- * Real Version 4.5
- *
- * Revision 4.14  1997/07/25  14:19:53  caress
- * Version 4.5beta2.
- * Much mucking, particularly with Simrad formats.
- *
- * Revision 4.13  1997/04/21  17:02:07  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.12  1996/08/05  15:21:58  caress
- * Just redid i/o for Simrad sonars, including adding EM12S and EM121 support.
- *
- * Revision 4.12  1996/08/05  15:21:58  caress
- * Just redid i/o for Simrad sonars, including adding EM12S and EM121 support.
- *
- * Revision 4.11  1996/04/22  13:21:19  caress
- * Now have DTR and MIN/MAX defines in mb_define.h
- *
- * Revision 4.10  1996/04/22  11:16:30  caress
- * DTR define now in mb_io.h
- *
- * Revision 4.9  1996/01/26  21:23:30  caress
- * Version 4.3 distribution
- *
- * Revision 4.8  1995/09/28  18:10:48  caress
- * Various bug fixes working toward release 4.3.
- *
- * Revision 4.7  1995/08/17  14:41:09  caress
- * Revision for release 4.3.
- *
- * Revision 4.6  1995/07/13  19:13:36  caress
- * Intermediate check-in during major bug-fixing flail.
- *
- * Revision 4.5  1995/03/06  19:38:54  caress
- * Changed include strings.h to string.h for POSIX compliance.
- *
- * Revision 4.4  1994/11/24  01:53:22  caress
- * Some fixes related to MR1 data.
- *
- * Revision 4.3  1994/11/23  23:16:34  caress
- * Now uses png_course instead of png_heading for heading
- * value because png_heading has large errors. Will
- * change back after processing tools to correct heading
- * are created.
- *
- * Revision 4.2  1994/11/09  21:40:34  caress
- * Changed ttimes extraction routines to handle forward beam angles
- * so that alongtrack distances can be calculated.
- *
- * Revision 4.1  1994/10/21  12:20:01  caress
- * Release V4.0
- *
- * Revision 4.0  1994/07/29  18:59:33  caress
- * Initial Revision.
- *
- * Revision 1.1  1994/07/29  18:46:51  caress
- * Initial revision
- *
- *
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-#include <time.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mb_define.h"
-#include "mbsys_mr1.h"
-
- static char rcs_id[]="$Id: mbsys_mr1.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mbsys_mr1_alloc(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_mr1_alloc";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* allocate memory for data structure */
-	status = mb_malloc(verbose,sizeof(struct mbsys_mr1_struct),
-				store_ptr,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)*store_ptr);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_mr1_deall(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_mr1_deall";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)*store_ptr);
-		}
-
-	/* deallocate memory for data structure */
-	status = mb_free(verbose,store_ptr,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_mr1_dimensions(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int *nbath, int *namp, int *nss, int *error)
-{
-	char	*function_name = "mbsys_mr1_dimensions";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_mr1_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_mr1_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get beam and pixel numbers */
-		*nbath = 2 * MAX(store->port_btycount, store->stbd_btycount) + 3;
-		*namp = 0;
-		*nss = 2 * MAX(store->port_sscount, store->stbd_sscount);
-		}
-
-	/* extract data from structure */
-	else
-		{
-		/* get beam and pixel numbers */
-		*nbath = 0;
-		*namp = 0;
-		*nss = 0;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		fprintf(stderr,"dbg2       nbath:      %d\n",*nbath);
-		fprintf(stderr,"dbg2       namp:       %d\n",*namp);
-		fprintf(stderr,"dbg2       nss:        %d\n",*nss);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_mr1_extract(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int time_i[7], double *time_d,
-		double *navlon, double *navlat,
-		double *speed, double *heading,
-		int *nbath, int *namp, int *nss,
-		char *beamflag, double *bath, double *amp,
-		double *bathacrosstrack, double *bathalongtrack,
-		double *ss, double *ssacrosstrack, double *ssalongtrack,
-		char *comment, int *error)
-{
-	char	*function_name = "mbsys_mr1_extract";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_mr1_struct *store;
-	int	beam_center, pixel_center;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_mr1_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get time */
-		*time_d = store->sec + 0.000001*store->usec;
-		mb_get_date(verbose,*time_d,time_i);
-
-		/* get navigation */
-		*navlon = store->png_lon;
-		*navlat = store->png_lat;
-
-		/* get heading */
-		*heading = store->png_compass;
-		/* *heading = store->png_course;*/
-
-		/* set speed to zero */
-		*speed = 0.0;
-
-		/* set beamwidths in mb_io structure */
-		mb_io_ptr->beamwidth_ltrack = 2.0;
-		mb_io_ptr->beamwidth_xtrack = 0.1;
-
-		/* zero data arrays */
-		for (i=0;i<MBSYS_MR1_BEAMS;i++)
-			{
-			beamflag[i] = MB_FLAG_NULL;
-			bath[i] = 0.0;
-			bathacrosstrack[i] = 0.0;
-			bathalongtrack[i] = 0.0;
-			}
-		for (i=0;i<MBSYS_MR1_PIXELS;i++)
-			{
-			ss[i] = 0.0;
-			ssacrosstrack[i] = 0.0;
-			ssalongtrack[i] = 0.0;
-			}
-
-		/* read beam and pixel values into storage arrays */
-		*nbath = 2 * MAX(store->port_btycount, store->stbd_btycount) + 3;
-		*namp = 0;
-		*nss = 2 * MAX(store->port_sscount, store->stbd_sscount);
-		if (*nss > 0) *nss += 3;
-		beam_center = *nbath/2;
-		pixel_center = *nss/2;
-		for (i=0;i<store->port_btycount;i++)
-			{
-			j = beam_center - i - 2;
-			if (store->bath_port[i] > 0)
-			    {
-			    beamflag[j] = MB_FLAG_NONE;
-			    bath[j] = store->bath_port[i];
-			    }
-			else if (store->bath_port[i] < 0)
-			    {
-			    beamflag[j] =
-				MB_FLAG_MANUAL + MB_FLAG_FLAG;
-			    bath[j] = -store->bath_port[i];
-			    }
-			else
-			    {
-			    beamflag[j] = MB_FLAG_NULL;
-			    bath[j] = store->bath_port[i];
-			    }
-			bathacrosstrack[j] = -store->bath_acrosstrack_port[i];
-			bathalongtrack[j] = 0.0;
-			}
-		for (i=0;i<3;i++)
-			{
-			j = beam_center + i - 1;
-			if (j == beam_center)
-				{
-				if (store->png_alt > 0.0)
-				    {
-				    beamflag[j] = MB_FLAG_NONE;
-				    bath[j]
-					= store->png_prdepth + store->png_alt;
-				    }
-				else if (store->png_alt < 0.0)
-				    {
-				    beamflag[j] =
-					MB_FLAG_MANUAL + MB_FLAG_FLAG;
-				    bath[j]
-					= store->png_prdepth - store->png_alt;
-				    }
-				else
-				    {
-				    beamflag[j] = MB_FLAG_NULL;
-				    bath[j] = 0.0;
-				    }
-				}
-			else
-				{
-				beamflag[j] = MB_FLAG_NULL;
-				bath[j] = 0.0;
-				}
-			bathacrosstrack[j] = 0.0;
-			bathalongtrack[j] = 0.0;
-			}
-		for (i=0;i<store->stbd_btycount;i++)
-			{
-			j = beam_center + 2 + i;
-			if (store->bath_stbd[i] > 0)
-			    {
-			    beamflag[j] = MB_FLAG_NONE;
-			    bath[j] = store->bath_stbd[i];
-			    }
-			else if (store->bath_stbd[i] < 0)
-			    {
-			    beamflag[j] =
-				MB_FLAG_MANUAL + MB_FLAG_FLAG;
-			    bath[j] = -store->bath_stbd[i];
-			    }
-			else
-			    {
-			    beamflag[j] = MB_FLAG_NULL;
-			    bath[j] = store->bath_stbd[i];
-			    }
-			bathacrosstrack[j] = store->bath_acrosstrack_stbd[i];
-			bathalongtrack[j] = 0.0;
-			}
-		for (i=0;i<store->port_sscount;i++)
-			{
-			j = pixel_center - i - 2;
-			ss[j] = store->ss_port[i];
-			ssacrosstrack[j] = -store->port_ssoffset
-				- i*store->png_atssincr;
-			ssalongtrack[j] = 0.0;
-			}
-		for (i=0;i<3;i++)
-			{
-			j = pixel_center + i - 1;
-			ss[j] = 0.0;
-			ssacrosstrack[j] = 0.0;
-			ssalongtrack[j] = 0.0;
-			}
-		for (i=0;i<store->stbd_sscount;i++)
-			{
-			j = pixel_center + 2 + i;
-			ss[j] = store->ss_stbd[i];
-			ssacrosstrack[j] = store->stbd_ssoffset
-				+ i*store->png_atssincr;
-			ssalongtrack[j] = 0.0;
-			}
-
-		/* print debug statements */
-		if (verbose >= 5)
-			{
-			fprintf(stderr,"\ndbg4  Data extracted by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  Extracted values:\n");
-			fprintf(stderr,"dbg4       kind:       %d\n",
-				*kind);
-			fprintf(stderr,"dbg4       error:      %d\n",
-				*error);
-			fprintf(stderr,"dbg4       time_i[0]:  %d\n",
-				time_i[0]);
-			fprintf(stderr,"dbg4       time_i[1]:  %d\n",
-				time_i[1]);
-			fprintf(stderr,"dbg4       time_i[2]:  %d\n",
-				time_i[2]);
-			fprintf(stderr,"dbg4       time_i[3]:  %d\n",
-				time_i[3]);
-			fprintf(stderr,"dbg4       time_i[4]:  %d\n",
-				time_i[4]);
-			fprintf(stderr,"dbg4       time_i[5]:  %d\n",
-				time_i[5]);
-			fprintf(stderr,"dbg4       time_i[6]:  %d\n",
-				time_i[6]);
-			fprintf(stderr,"dbg4       time_d:     %f\n",
-				*time_d);
-			fprintf(stderr,"dbg4       longitude:  %f\n",
-				*navlon);
-			fprintf(stderr,"dbg4       latitude:   %f\n",
-				*navlat);
-			fprintf(stderr,"dbg4       speed:      %f\n",
-				*speed);
-			fprintf(stderr,"dbg4       heading:    %f\n",
-				*heading);
-			fprintf(stderr,"dbg4       nbath:      %d\n",
-				*nbath);
-			for (i=0;i<*nbath;i++)
-			  fprintf(stderr,"dbg4       beam:%d  flag:%3d  bath:%6g  acrosstrack:%6g  alongtrack:%6g\n",
-				i,beamflag[i],bath[i],
-				bathacrosstrack[i],bathalongtrack[i]);
-			fprintf(stderr,"dbg4        namp:     %d\n",
-				*namp);
-			for (i=0;i<*namp;i++)
-			  fprintf(stderr,"dbg4        beam:%d   amp:%6g  acrosstrack:%6g  alongtrack:%6g\n",
-				i,amp[i],bathacrosstrack[i],bathalongtrack[i]);
-			fprintf(stderr,"dbg4        nss:      %d\n",
-				*nss);
-			for (i=0;i<*nss;i++)
-			  fprintf(stderr,"dbg4        pixel:%d   ss:%6g  acrosstrack:%6g  alongtrack:%6g\n",
-				i,ss[i],ssacrosstrack[i],ssalongtrack[i]);
-			}
-
-		/* done translating values */
-
-		}
-
-	/* extract comment from structure */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* copy comment */
-		strcpy(comment,store->comment);
-
-		/* print debug statements */
-		if (verbose >= 4)
-			{
-			fprintf(stderr,"\ndbg4  New ping read by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  New ping values:\n");
-			fprintf(stderr,"dbg4       error:      %d\n",
-				*error);
-			fprintf(stderr,"dbg4       comment:    %s\n",
-				comment);
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind == MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"dbg2       comment:     \ndbg2       %s\n",
-			comment);
-		}
-	else if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind != MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"dbg2       time_i[0]:     %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:     %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:     %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:     %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:     %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:     %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:     %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:        %f\n",*time_d);
-		fprintf(stderr,"dbg2       longitude:     %f\n",*navlon);
-		fprintf(stderr,"dbg2       latitude:      %f\n",*navlat);
-		fprintf(stderr,"dbg2       speed:         %f\n",*speed);
-		fprintf(stderr,"dbg2       heading:       %f\n",*heading);
-		}
-	if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind == MB_DATA_DATA)
-		{
-		fprintf(stderr,"dbg2       nbath:      %d\n",
-			*nbath);
-		for (i=0;i<*nbath;i++)
-		  fprintf(stderr,"dbg2       beam:%d  flag:%3d  bath:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,beamflag[i],bath[i],
-			bathacrosstrack[i],bathalongtrack[i]);
-		fprintf(stderr,"dbg2        namp:     %d\n",
-			*namp);
-		for (i=0;i<*namp;i++)
-		  fprintf(stderr,"dbg2       beam:%d   amp:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,amp[i],bathacrosstrack[i],bathalongtrack[i]);
-		fprintf(stderr,"dbg2        nss:      %d\n",
-			*nss);
-		for (i=0;i<*nss;i++)
-		  fprintf(stderr,"dbg2        pixel:%d   ss:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,ss[i],ssacrosstrack[i],ssalongtrack[i]);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_mr1_insert(int verbose, void *mbio_ptr, void *store_ptr,
-		int kind, int time_i[7], double time_d,
-		double navlon, double navlat,
-		double speed, double heading,
-		int nbath, int namp, int nss,
-		char *beamflag, double *bath, double *amp,
-		double *bathacrosstrack, double *bathalongtrack,
-		double *ss, double *ssacrosstrack, double *ssalongtrack,
-		char *comment, int *error)
-{
-	char	*function_name = "mbsys_mr1_insert";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_mr1_struct *store;
-	int	beam_center, pixel_center;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       kind:       %d\n",kind);
-		}
-	if (verbose >= 2 && (kind == MB_DATA_DATA || kind == MB_DATA_NAV))
-		{
-		fprintf(stderr,"dbg2       time_i[0]:  %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:  %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:  %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:  %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:  %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:  %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:  %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:     %f\n",time_d);
-		fprintf(stderr,"dbg2       navlon:     %f\n",navlon);
-		fprintf(stderr,"dbg2       navlat:     %f\n",navlat);
-		fprintf(stderr,"dbg2       speed:      %f\n",speed);
-		fprintf(stderr,"dbg2       heading:    %f\n",heading);
-		}
-	if (verbose >= 2 && kind == MB_DATA_DATA)
-		{
-		fprintf(stderr,"dbg2       nbath:      %d\n",nbath);
-		if (verbose >= 3)
-		 for (i=0;i<nbath;i++)
-		  fprintf(stderr,"dbg3       beam:%d  flag:%3d bath:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,beamflag[i],bath[i],
-			bathacrosstrack[i],bathalongtrack[i]);
-		fprintf(stderr,"dbg2       namp:       %d\n",namp);
-		if (verbose >= 3)
-		 for (i=0;i<namp;i++)
-		  fprintf(stderr,"dbg3        beam:%d   amp:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,amp[i],bathacrosstrack[i],bathalongtrack[i]);
-		fprintf(stderr,"dbg2        nss:       %d\n",nss);
-		if (verbose >= 3)
-		 for (i=0;i<nss;i++)
-		  fprintf(stderr,"dbg3        pixel:%d   ss:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,ss[i],ssacrosstrack[i],ssalongtrack[i]);
-		}
-	if (verbose >= 2 && kind == MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"dbg2       comment:     \ndbg2       %s\n",
-			comment);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_mr1_struct *) store_ptr;
-
-	/* set data kind */
-	store->kind = kind;
-
-	/* insert data in structure */
-	if (store->kind == MB_DATA_DATA)
-		{
-		/* get time */
-		store->sec = (int) time_d;
-		store->usec = (int) 1000000.0*(time_d - store->sec);
-
-		/* get navigation */
-		if (navlon < 0.0) navlon = navlon + 360.0;
-		store->png_lon = navlon;
-		store->png_lat = navlat;
-
-		/* get heading */
-		store->png_compass = heading;
-		/*store->png_course = heading;*/
-
-		/* get speed */
-
-		/* get port bathymetry */
-		beam_center = nbath/2;
-		for (i=0;i<store->port_btycount;i++)
-			{
-			j = beam_center - 2 - i;
-			if (beamflag[j] != MB_FLAG_NULL)
-				{
-				if (mb_beam_check_flag(beamflag[j]))
-				    store->bath_port[i]
-					= -bath[j];
-				else
-				    store->bath_port[i]
-					= bath[j];
-				store->bath_acrosstrack_port[i]
-					= -bathacrosstrack[j];
-				}
-			else
-				{
-				store->bath_port[i] = 0.0;
-				store->bath_acrosstrack_port[i] = 0.0;
-				}
-			}
-
-		/* get center beam bathymetry */
-		if (beamflag[beam_center] == MB_FLAG_NULL)
-			{
-			store->png_alt = 0.0;
-			}
-		else if (mb_beam_check_flag(beamflag[beam_center]))
-			{
-			store->png_alt = -bath[beam_center]
-				+ store->png_prdepth;
-			}
-		else
-			{
-			store->png_alt = bath[beam_center]
-				- store->png_prdepth;
-			}
-
-		/* get starboard bathymetry */
-		for (i=0;i<store->stbd_btycount;i++)
-			{
-			j = beam_center + 2 + i;
-			if (beamflag[j] != MB_FLAG_NULL)
-				{
-				if (mb_beam_check_flag(beamflag[j]))
-				    store->bath_stbd[i]
-					= -bath[j];
-				else
-				    store->bath_stbd[i]
-					= bath[j];
-				store->bath_acrosstrack_stbd[i]
-					= bathacrosstrack[j];
-				}
-			else
-				{
-				store->bath_stbd[i] = 0.0;
-				store->bath_acrosstrack_stbd[i] = 0.0;
-				}
-			}
-
-		/* get port sidescan */
-		pixel_center = nss/2;
-		for (i=0;i<store->port_sscount;i++)
-			{
-			j = pixel_center - 2 - i;
-			store->ss_port[i]
-				= ss[j];
-			}
-
-		/* get starboard sidescan */
-		for (i=0;i<store->stbd_sscount;i++)
-			{
-			j = pixel_center + 2 + i;
-			store->ss_stbd[i]
-				= ss[j];
-			}
-		}
-
-	/* insert comment in structure */
-	else if (store->kind == MB_DATA_COMMENT)
-		{
-		strcpy(store->comment,comment);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_mr1_ttimes(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, int *nbeams,
-	double *ttimes, double *angles,
-	double *angles_forward, double *angles_null,
-	double *heave, double *alongtrack_offset,
-	double *draft, double *ssv, int *error)
-{
-	char	*function_name = "mbsys_mr1_ttimes";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_mr1_struct *store;
-	int	beam_center;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       ttimes:     %p\n",(void *)ttimes);
-		fprintf(stderr,"dbg2       angles_xtrk:%p\n",(void *)angles);
-		fprintf(stderr,"dbg2       angles_ltrk:%p\n",(void *)angles_forward);
-		fprintf(stderr,"dbg2       angles_null:%p\n",(void *)angles_null);
-		fprintf(stderr,"dbg2       heave:      %p\n",(void *)heave);
-		fprintf(stderr,"dbg2       ltrk_off:   %p\n",(void *)alongtrack_offset);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_mr1_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get sound velocity at transducers */
-		*ssv = 1500.0;
-		*draft = store->png_prdepth;
-
-		/* get nbeams */
-		*nbeams = 2 * MAX(store->port_btycount, store->stbd_btycount) + 3;
-		beam_center = *nbeams/2;
-
-		/* zero data arrays */
-		for (i=0;i<*nbeams;i++)
-			{
-			ttimes[i] = 0.0;
-			angles[i] = 0.0;
-			angles_forward[i] = 0.0;
-			angles_null[i] = 0.0;
-			heave[i] = 0.0;
-			alongtrack_offset[i] = 0.0;
-			}
-
-		/* get travel times and angles */
-		for (i=0;i<store->port_btycount;i++)
-			{
-			j = beam_center - i - 2;
-			angles_null[j] = MBSYS_MR1_XDUCER_ANGLE;
-			angles_forward[j] = 180.0;
-			if (fabs(store->bath_port[i]) > 0.0)
-				{
-				ttimes[j] = store->tt_port[i];
-				angles[j] = fabs(store->angle_port[i]);
-				heave[j] = 0.0;
-				}
-			else
-				{
-				ttimes[j] = 0.0;
-				angles[j] = 0.0;
-				}
-			}
-		for (i=0;i<3;i++)
-			{
-			j = beam_center + i - 1;
-			angles_null[j] = 0.0;
-			angles_forward[j] = 0.0;
-			if (j == beam_center)
-				{
-				ttimes[j] = store->png_tt;
-				angles[j] = 0.0;
-				heave[j] = 0.0;
-				}
-			else
-				{
-				ttimes[j] = 0.0;
-				angles[j] = 0.0;
-				}
-			}
-		for (i=0;i<store->stbd_btycount;i++)
-			{
-			j = beam_center + 2 + i;
-			angles_null[j] = MBSYS_MR1_XDUCER_ANGLE;
-			angles_forward[j] = 0.0;
-			if (fabs(store->bath_stbd[i]) > 0.0)
-				{
-				ttimes[j] = store->tt_stbd[i];
-				angles[j] = fabs(store->angle_stbd[i]);
-				angles_forward[j] = 0.0;
-				heave[j] = 0.0;
-				}
-			else
-				{
-				ttimes[j] = 0.0;
-				angles[j] = 0.0;
-				}
-			}
-
-		/* set status */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error == MB_ERROR_NO_ERROR)
-		{
-		fprintf(stderr,"dbg2       draft:      %f\n",*draft);
-		fprintf(stderr,"dbg2       ssv:        %f\n",*ssv);
-		fprintf(stderr,"dbg2       nbeams:     %d\n",*nbeams);
-		for (i=0;i<*nbeams;i++)
-			fprintf(stderr,"dbg2       beam %d: tt:%f  angle_xtrk:%f  angle_ltrk:%f  angle_null:%f  depth_off:%f  ltrk_off:%f\n",
-				i,ttimes[i],angles[i],
-				angles_forward[i],angles_null[i],
-				heave[i],alongtrack_offset[i]);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_mr1_detects(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, int *nbeams,
-	int *detects, int *error)
-{
-	char	*function_name = "mbsys_mr1_detects";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_mr1_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       detects:    %p\n",(void *)detects);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_mr1_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get nbeams */
-		*nbeams = 2 * MAX(store->port_btycount, store->stbd_btycount) + 3;
-
-		/* get detects */
-		for (i=0;i<*nbeams;i++)
-			{
-			detects[i] = MB_DETECT_PHASE;
-			}
-
-		/* set status */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error == MB_ERROR_NO_ERROR)
-		{
-		fprintf(stderr,"dbg2       nbeams:     %d\n",*nbeams);
-		for (i=0;i<*nbeams;i++)
-			fprintf(stderr,"dbg2       beam %d: detects:%d\n",
-				i,detects[i]);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_mr1_extract_altitude(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, double *transducer_depth, double *altitude,
-	int *error)
-{
-	char	*function_name = "mbsys_mr1_extract_altitude";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_mr1_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_mr1_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		*transducer_depth = fabs(store->png_prdepth);
-		*altitude = store->png_alt;
-
-		/* set status */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:              %d\n",*kind);
-		fprintf(stderr,"dbg2       transducer_depth:  %f\n",*transducer_depth);
-		fprintf(stderr,"dbg2       altitude:          %f\n",*altitude);
-		fprintf(stderr,"dbg2       error:             %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:            %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_mr1_extract_nav(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int time_i[7], double *time_d,
-		double *navlon, double *navlat,
-		double *speed, double *heading, double *draft,
-		double *roll, double *pitch, double *heave,
-		int *error)
-{
-	char	*function_name = "mbsys_mr1_extract_nav";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_mr1_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_mr1_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get time */
-		*time_d = store->sec + 0.000001*store->usec;
-		mb_get_date(verbose,*time_d,time_i);
-
-		/* get navigation */
-		*navlon = store->png_lon;
-		*navlat = store->png_lat;
-
-		/* get heading */
-		*heading = store->png_compass;
-		/* *heading = store->png_course;*/
-
-		/* set speed to zero */
-		*speed = 0.0;
-
-		/* get draft */
-		*draft = store->png_prdepth;
-
-		/* get roll pitch and heave */
-		*roll = store->png_roll;
-		*pitch = store->png_pitch;
-		*heave = 0.0;
-
-		/* print debug statements */
-		if (verbose >= 5)
-			{
-			fprintf(stderr,"\ndbg4  Data extracted by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  Extracted values:\n");
-			fprintf(stderr,"dbg4       kind:       %d\n",
-				*kind);
-			fprintf(stderr,"dbg4       error:      %d\n",
-				*error);
-			fprintf(stderr,"dbg4       time_i[0]:  %d\n",
-				time_i[0]);
-			fprintf(stderr,"dbg4       time_i[1]:  %d\n",
-				time_i[1]);
-			fprintf(stderr,"dbg4       time_i[2]:  %d\n",
-				time_i[2]);
-			fprintf(stderr,"dbg4       time_i[3]:  %d\n",
-				time_i[3]);
-			fprintf(stderr,"dbg4       time_i[4]:  %d\n",
-				time_i[4]);
-			fprintf(stderr,"dbg4       time_i[5]:  %d\n",
-				time_i[5]);
-			fprintf(stderr,"dbg4       time_i[6]:  %d\n",
-				time_i[6]);
-			fprintf(stderr,"dbg4       time_d:     %f\n",
-				*time_d);
-			fprintf(stderr,"dbg4       longitude:  %f\n",
-				*navlon);
-			fprintf(stderr,"dbg4       latitude:   %f\n",
-				*navlat);
-			fprintf(stderr,"dbg4       speed:      %f\n",
-				*speed);
-			fprintf(stderr,"dbg4       heading:    %f\n",
-				*heading);
-			fprintf(stderr,"dbg4       draft:      %f\n",
-				*draft);
-			fprintf(stderr,"dbg4       roll:       %f\n",
-				*roll);
-			fprintf(stderr,"dbg4       pitch:      %f\n",
-				*pitch);
-			fprintf(stderr,"dbg4       heave:      %f\n",
-				*heave);
-			}
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind == MB_DATA_DATA)
-		{
-		fprintf(stderr,"dbg2       time_i[0]:     %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:     %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:     %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:     %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:     %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:     %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:     %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:        %f\n",*time_d);
-		fprintf(stderr,"dbg2       longitude:     %f\n",*navlon);
-		fprintf(stderr,"dbg2       latitude:      %f\n",*navlat);
-		fprintf(stderr,"dbg2       speed:         %f\n",*speed);
-		fprintf(stderr,"dbg2       heading:       %f\n",*heading);
-		fprintf(stderr,"dbg2       draft:         %f\n",*draft);
-		fprintf(stderr,"dbg2       roll:          %f\n",*roll);
-		fprintf(stderr,"dbg2       pitch:         %f\n",*pitch);
-		fprintf(stderr,"dbg2       heave:         %f\n",*heave);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_mr1_insert_nav(int verbose, void *mbio_ptr, void *store_ptr,
-		int time_i[7], double time_d,
-		double navlon, double navlat,
-		double speed, double heading, double draft,
-		double roll, double pitch, double heave,
-		int *error)
-{
-	char	*function_name = "mbsys_mr1_insert_nav";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_mr1_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       time_i[0]:  %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:  %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:  %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:  %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:  %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:  %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:  %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:     %f\n",time_d);
-		fprintf(stderr,"dbg2       navlon:     %f\n",navlon);
-		fprintf(stderr,"dbg2       navlat:     %f\n",navlat);
-		fprintf(stderr,"dbg2       speed:      %f\n",speed);
-		fprintf(stderr,"dbg2       heading:    %f\n",heading);
-		fprintf(stderr,"dbg2       draft:      %f\n",draft);
-		fprintf(stderr,"dbg2       roll:       %f\n",roll);
-		fprintf(stderr,"dbg2       pitch:      %f\n",pitch);
-		fprintf(stderr,"dbg2       heave:      %f\n",heave);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_mr1_struct *) store_ptr;
-
-	/* insert data in structure */
-	if (store->kind == MB_DATA_DATA)
-		{
-		/* get time */
-		store->sec = (int) time_d;
-		store->usec = (int) 1000000.0*(time_d - store->sec);
-
-		/* get navigation */
-		if (navlon < 0.0) navlon = navlon + 360.0;
-		store->png_lon = navlon;
-		store->png_lat = navlat;
-
-		/* get heading */
-		store->png_compass = heading;
-		/* store->png_course = heading;*/
-
-		/* get speed */
-
-		/* get draft */
-		store->png_prdepth = draft;
-
-		/* get roll pitch and heave */
-		store->png_roll = roll;
-		store->png_pitch = pitch;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_mr1_copy(int verbose, void *mbio_ptr,
-			void *store_ptr, void *copy_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_mr1_copy";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_mr1_struct *store;
-	struct mbsys_mr1_struct *copy;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       copy_ptr:   %p\n",(void *)copy_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointers */
-	store = (struct mbsys_mr1_struct *) store_ptr;
-	copy = (struct mbsys_mr1_struct *) copy_ptr;
-
-	/* copy the data */
-	*copy = *store;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mbsys_mr1.h b/src/mbio/mbsys_mr1.h
deleted file mode 100644
index d77f9bb..0000000
--- a/src/mbio/mbsys_mr1.h
+++ /dev/null
@@ -1,227 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbsys_mr1.h	7/19/94
- *	$Id: mbsys_mr1.h 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1994-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbsys_mr1.h defines the data structures used by MBIO functions
- * to store data from the MR1 towed sonar.
- * The data formats which are commonly used to store MR1
- * data in files include
- *      MBF_MR1PRHIG : MBIO ID 61
- *
- * Author:	D. W. Caress
- * Date:	July 19, 1994
- * $Log: mbsys_mr1.h,v $
- * Revision 5.5  2005/11/05 00:48:03  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.4  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.3  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.2  2001/07/20 00:32:54  caress
- * Release 5.0.beta03
- *
- * Revision 5.1  2001/01/22  07:43:34  caress
- * Version 5.0.beta01
- *
- * Revision 5.0  2000/12/01  22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.4  2000/09/30  06:31:19  caress
- * Snapshot for Dale.
- *
- * Revision 4.3  1998/10/05  18:32:27  caress
- * MB-System version 4.6beta
- *
- * Revision 1.1  1998/10/05  17:46:15  caress
- * Initial revision
- *
- * Revision 4.2  1996/01/26  21:27:27  caress
- * Version 4.3 distribution.
- *
- * Revision 4.2  1996/01/26  21:27:27  caress
- * Version 4.3 distribution.
- *
- * Revision 4.1  1995/09/28  18:10:48  caress
- * Various bug fixes working toward release 4.3.
- *
- * Revision 4.0  1994/10/21  12:35:08  caress
- * Release V4.0
- *
- * Revision 1.2  1994/10/21  12:20:01  caress
- * Release V4.0
- *
- * Revision 1.1  1994/07/29  18:46:51  caress
- * Initial revision
- *
- *
- *
- */
-/*
- * Notes on the MBSYS_MR1 data structure:
- *   1. The MR1 post processing format uses the xdr external
- *      data representation for portability.
- *   2. The data stream consists of a file header followed
- *      by individual pings.
- *   3. The file header contains a comment string and the
- *      number of pings. The comment string is broken up
- *      into multiple comments by MBIO on reading; the comments
- *      are concatenated into a single string on writing.
- *   4. The pings each contain a header plus the bathymetry and/or
- *      sidescan data.
- *   6. The data structure defined below includes all of the values
- *      which are passed in the MR1 post processing format.
- *   7. The data structure defined below also includes travel
- *      time values for each bathymetry beam - this is an
- *      addition to the HIG MR1 post processing format.
- */
-
-/* maximum number of bathymetry beams per side for MR1 */
-#define MBSYS_MR1_BEAMS_SIDE 1500
-
-/* maximum number of sidescan pixels per side for MR1 */
-#define MBSYS_MR1_PIXELS_SIDE 3500
-
-/* maximum number of bathymetry beams for MR1 */
-#define MBSYS_MR1_BEAMS (2*MBSYS_MR1_BEAMS_SIDE + 3)
-
-/* maximum number of sidescan pixels output for MR1 */
-#define MBSYS_MR1_PIXELS (2*MBSYS_MR1_PIXELS_SIDE + 3)
-
-/* maximum length of comment */
-#define	MBSYS_MR1_MAXLINE 200
-
-/* angle from vertical of MR1 transducers */
-#define	MBSYS_MR1_XDUCER_ANGLE 50.0
-
-struct mbsys_mr1_struct
-	{
-	/* type of data record */
-	int	kind;
-
-	/* file header info */
-	int mf_magic;		/* magic cookie */
-	int mf_count;		/* number of objects */
-	char *mf_log;		/* processing log */
-
-	/* ping header */
-	int sec;		/* timestamp */
-	int usec;		/* timestamp */
-	double png_lon;		/* longitude (deg) */
-	double png_lat;		/* latitude (deg) */
-	float png_course;	/* course determined from nav (deg) */
-	float png_compass;	/* compass heading of vehicle
-					0=N,90=E, etc. (deg) */
-	float png_prdepth;	/* pressure depth (m) */
-	float png_alt;		/* altitude of vehicle (m) */
-	float png_pitch;	/* vehicle pitch (deg) */
-	float png_roll;		/* vehicle roll (deg) */
-	float png_temp;		/* water temperature (deg) */
-	float png_atssincr;	/* across-track sidescan increment (m) */
-	float png_tt;		/* nadir travel time (s) */
-
-	/* port settings */
-	float port_trans[2];	/* transmitter settings (units?) */
-	float port_gain;	/* gain setting (units?) */
-	float port_pulse;	/* pulse length (units?) */
-	int port_btycount;	/* number of valid bathymetry samples */
-	int port_btypad;	/* number of invalid trailing pad samples */
-	float port_ssoffset;	/* across-track distance to
-					first sidescan sample */
-	int port_sscount;	/* number of valid sidescan samples */
-	int port_sspad;		/* number of invalid trailing pad samples */
-
-	/* starboard settings */
-	float stbd_trans[2];	/* transmitter settings (units?) */
-	float stbd_gain;	/* gain setting (units?) */
-	float stbd_pulse;	/* pulse length (units?) */
-	int stbd_btycount;	/* number of valid bathymetry samples */
-	int stbd_btypad;	/* number of invalid trailing pad samples */
-	float stbd_ssoffset;	/* across-track distance to
-					first sidescan sample */
-	int stbd_sscount;	/* number of valid sidescan samples */
-	int stbd_sspad;		/* number of invalid trailing pad samples */
-
-	/* bathymetry */
-	float	bath_acrosstrack_port[MBSYS_MR1_BEAMS_SIDE];
-	float	bath_port[MBSYS_MR1_BEAMS_SIDE];
-	float	tt_port[MBSYS_MR1_BEAMS_SIDE];
-	float	angle_port[MBSYS_MR1_BEAMS_SIDE];
-	float	bath_acrosstrack_stbd[MBSYS_MR1_BEAMS_SIDE];
-	float	bath_stbd[MBSYS_MR1_BEAMS_SIDE];
-	float	tt_stbd[MBSYS_MR1_BEAMS_SIDE];
-	float	angle_stbd[MBSYS_MR1_BEAMS_SIDE];
-
-	/* sidescan */
-	float	ss_port[MBSYS_MR1_PIXELS_SIDE];
-	float	ss_stbd[MBSYS_MR1_PIXELS_SIDE];
-
-	/* comment */
-	char	comment[MBSYS_MR1_MAXLINE];
-};
-
-
-/* system specific function prototypes */
-int mbsys_mr1_alloc(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error);
-int mbsys_mr1_deall(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error);
-int mbsys_mr1_dimensions(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int *nbath, int *namp, int *nss, int *error);
-int mbsys_mr1_extract(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int time_i[7], double *time_d,
-			double *navlon, double *navlat,
-			double *speed, double *heading,
-			int *nbath, int *namp, int *nss,
-			char *beamflag, double *bath, double *amp,
-			double *bathacrosstrack, double *bathalongtrack,
-			double *ss, double *ssacrosstrack, double *ssalongtrack,
-			char *comment, int *error);
-int mbsys_mr1_insert(int verbose, void *mbio_ptr, void *store_ptr,
-			int kind, int time_i[7], double time_d,
-			double navlon, double navlat,
-			double speed, double heading,
-			int nbath, int namp, int nss,
-			char *beamflag, double *bath, double *amp,
-			double *bathacrosstrack, double *bathalongtrack,
-			double *ss, double *ssacrosstrack, double *ssalongtrack,
-			char *comment, int *error);
-int mbsys_mr1_ttimes(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int *nbeams,
-			double *ttimes, double *angles,
-			double *angles_forward, double *angles_null,
-			double *heave, double *alongtrack_offset,
-			double *draft, double *ssv, int *error);
-int mbsys_mr1_detects(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int *nbeams, int *detects, int *error);
-int mbsys_mr1_extract_altitude(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, double *transducer_depth, double *altitude,
-			int *error);
-int mbsys_mr1_extract_nav(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int time_i[7], double *time_d,
-			double *navlon, double *navlat,
-			double *speed, double *heading, double *draft,
-			double *roll, double *pitch, double *heave,
-			int *error);
-int mbsys_mr1_insert_nav(int verbose, void *mbio_ptr, void *store_ptr,
-			int time_i[7], double time_d,
-			double navlon, double navlat,
-			double speed, double heading, double draft,
-			double roll, double pitch, double heave,
-			int *error);
-int mbsys_mr1_copy(int verbose, void *mbio_ptr,
-			void *store_ptr, void *copy_ptr,
-			int *error);
diff --git a/src/mbio/mbsys_mr1b.c b/src/mbio/mbsys_mr1b.c
deleted file mode 100644
index 07cdd68..0000000
--- a/src/mbio/mbsys_mr1b.c
+++ /dev/null
@@ -1,1384 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbsys_mr1b.c	7/19/94
- *	$Id: mbsys_mr1b.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1993-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbsys_mr1b.c contains the functions for handling the data structure
- * used by MBIO functions to store data from the MR1 towed sonar.
- * The data formats which are commonly used to store MR1
- * data in files include
- *      MBF_MR1BPRHIG : MBIO ID 63
- *
- * Author:	D. W. Caress
- * Date:	July 19, 1994
- *
- * $Log: mbsys_mr1b.c,v $
- * Revision 5.6  2005/11/05 00:48:04  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.5  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.4  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.3  2001/08/25 00:54:13  caress
- * Adding beamwidth values to extract functions.
- *
- * Revision 5.2  2001/07/20  00:32:54  caress
- * Release 5.0.beta03
- *
- * Revision 5.1  2001/01/22  07:43:34  caress
- * Version 5.0.beta01
- *
- * Revision 5.0  2000/12/01  22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.11  2000/10/11  01:03:21  caress
- * Convert to ANSI C
- *
- * Revision 4.10  2000/10/03  21:48:03  caress
- * Snapshot for Dale.
- *
- * Revision 4.9  2000/09/30  06:32:52  caress
- * Snapshot for Dale.
- *
- * Revision 4.8  1999/05/12  00:29:23  caress
- * MB-System 4.6a
- *
- * Revision 4.7  1998/10/05  17:46:15  caress
- * MB-System version 4.6beta
- *
- * Revision 4.6  1997/09/15  19:06:40  caress
- * Real Version 4.5
- *
- * Revision 4.5  1997/07/25  14:19:53  caress
- * Version 4.5beta2.
- * Much mucking, particularly with Simrad formats.
- *
- * Revision 4.4  1997/04/21  17:02:07  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.3  1996/08/05  15:21:58  caress
- * Just redid i/o for Simrad sonars, including adding EM12S and EM121 support.
- *
- * Revision 4.3  1996/08/05  15:21:58  caress
- * Just redid i/o for Simrad sonars, including adding EM12S and EM121 support.
- *
- * Revision 4.2  1996/04/22  13:21:19  caress
- * Now have DTR and MIN/MAX defines in mb_define.h
- *
- * Revision 4.1  1996/04/22  11:16:30  caress
- * DTR define now in mb_io.h
- *
- * Revision 4.0  1996/03/12  17:23:04  caress
- * initial version.
- *
- * Revision 1.1  1996/03/12  17:21:55  caress
- * Initial revision
- *
- *
- *
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-#include <time.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mb_define.h"
-#include "mbsys_mr1b.h"
-
- static char rcs_id[]="$Id: mbsys_mr1b.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mbsys_mr1b_alloc(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_mr1b_alloc";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* allocate memory for data structure */
-	status = mb_malloc(verbose,sizeof(struct mbsys_mr1b_struct),
-				store_ptr,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)*store_ptr);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_mr1b_deall(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_mr1b_deall";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)*store_ptr);
-		}
-
-	/* deallocate memory for data structure */
-	status = mb_free(verbose,store_ptr,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_mr1b_dimensions(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int *nbath, int *namp, int *nss, int *error)
-{
-	char	*function_name = "mbsys_mr1b_dimensions";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_mr1b_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_mr1b_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get beam and pixel numbers */
-		*nbath = 2 * MAX(store->port_btycount, store->stbd_btycount) + 3;
-		*namp = 0;
-		*nss = 2 * MAX(store->port_sscount, store->stbd_sscount);
-		if (*nss > 0) *nss += 3;
-		}
-	else
-		{
-		/* get beam and pixel numbers */
-		*nbath = 0;
-		*namp = 0;
-		*nss = 0;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		fprintf(stderr,"dbg2       nbath:      %d\n",*nbath);
-		fprintf(stderr,"dbg2        namp:      %d\n",*namp);
-		fprintf(stderr,"dbg2        nss:       %d\n",*nss);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_mr1b_extract(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int time_i[7], double *time_d,
-		double *navlon, double *navlat,
-		double *speed, double *heading,
-		int *nbath, int *namp, int *nss,
-		char *beamflag, double *bath, double *amp,
-		double *bathacrosstrack, double *bathalongtrack,
-		double *ss, double *ssacrosstrack, double *ssalongtrack,
-		char *comment, int *error)
-{
-	char	*function_name = "mbsys_mr1b_extract";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_mr1b_struct *store;
-	int	beam_center, pixel_center;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_mr1b_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get time */
-		*time_d = store->sec + 0.000001*store->usec;
-		mb_get_date(verbose,*time_d,time_i);
-
-		/* get navigation */
-		*navlon = store->png_lon;
-		*navlat = store->png_lat;
-
-		/* get heading */
-		*heading = store->png_compass;
-		/* *heading = store->png_course;*/
-
-		/* set speed to zero */
-		*speed = 0.0;
-
-		/* set beamwidths in mb_io structure */
-		mb_io_ptr->beamwidth_ltrack = 2.0;
-		mb_io_ptr->beamwidth_xtrack = 0.1;
-
-		/* zero data arrays */
-		for (i=0;i<MBSYS_MR1B_BEAMS;i++)
-			{
-			beamflag[i] = MB_FLAG_NULL;
-			bath[i] = 0.0;
-			bathacrosstrack[i] = 0.0;
-			bathalongtrack[i] = 0.0;
-			}
-		for (i=0;i<MBSYS_MR1B_PIXELS;i++)
-			{
-			ss[i] = 0.0;
-			ssacrosstrack[i] = 0.0;
-			ssalongtrack[i] = 0.0;
-			}
-
-		/* read beam and pixel values into storage arrays */
-		*nbath = 2 * MAX(store->port_btycount, store->stbd_btycount) + 3;
-		*namp = 0;
-		*nss = 2 * MAX(store->port_sscount, store->stbd_sscount);
-		if (*nss > 0) *nss += 3;
-		beam_center = *nbath/2;
-		pixel_center = *nss/2;
-		for (i=0;i<store->port_btycount;i++)
-			{
-			j = beam_center - i - 2;
-			if (store->bath_port[i] > 0)
-			    {
-			    beamflag[j] = MB_FLAG_NONE;
-			    bath[j] = store->bath_port[i];
-			    }
-			else if (store->bath_port[i] < 0)
-			    {
-			    beamflag[j] =
-				MB_FLAG_MANUAL + MB_FLAG_FLAG;
-			    bath[j] = -store->bath_port[i];
-			    }
-			else
-			    {
-			    beamflag[j] = MB_FLAG_NULL;
-			    bath[j] = store->bath_port[i];
-			    }
-			bathacrosstrack[j] = -store->bath_acrosstrack_port[i];
-			bathalongtrack[j] = 0.0;
-			}
-		for (i=0;i<3;i++)
-			{
-			j = beam_center + i - 1;
-			if (j == beam_center)
-				{
-				if (store->png_alt > 0.0)
-				    {
-				    beamflag[j] = MB_FLAG_NONE;
-				    bath[j]
-					= store->png_prdepth + store->png_alt;
-				    }
-				else if (store->png_alt < 0.0)
-				    {
-				    beamflag[j] =
-					MB_FLAG_MANUAL + MB_FLAG_FLAG;
-				    bath[j]
-					= store->png_prdepth - store->png_alt;
-				    }
-				else
-				    {
-				    beamflag[j] = MB_FLAG_NULL;
-				    bath[j] = 0.0;
-				    }
-				}
-			else
-				{
-				beamflag[j] = MB_FLAG_NULL;
-				bath[j] = 0.0;
-				}
-			bathacrosstrack[j] = 0.0;
-			bathalongtrack[j] = 0.0;
-			}
-		for (i=0;i<store->stbd_btycount;i++)
-			{
-			j = beam_center + 2 + i;
-			if (store->bath_stbd[i] > 0)
-			    {
-			    beamflag[j] = MB_FLAG_NONE;
-			    bath[j] = store->bath_stbd[i];
-			    }
-			else if (store->bath_stbd[i] < 0)
-			    {
-			    beamflag[j] =
-				MB_FLAG_MANUAL + MB_FLAG_FLAG;
-			    bath[j] = -store->bath_stbd[i];
-			    }
-			else
-			    {
-			    beamflag[j] = MB_FLAG_NULL;
-			    bath[j] = store->bath_stbd[i];
-			    }
-			bathacrosstrack[j] = store->bath_acrosstrack_stbd[i];
-			bathalongtrack[j] = 0.0;
-			}
-
-		for (i=0;i<store->port_sscount;i++)
-			{
-			j = pixel_center - i - 2;
-			ss[j] = store->ss_port[i];
-			ssacrosstrack[j] = -store->port_ssoffset
-				- i*store->png_atssincr;
-			ssalongtrack[j] = 0.0;
-			}
-		for (i=0;i<3;i++)
-			{
-			j = pixel_center + i - 1;
-			ss[j] = 0.0;
-			ssacrosstrack[j] = 0.0;
-			ssalongtrack[j] = 0.0;
-			}
-		for (i=0;i<store->stbd_sscount;i++)
-			{
-			j = pixel_center + 2 + i;
-			ss[j] = store->ss_stbd[i];
-			ssacrosstrack[j] = store->stbd_ssoffset
-				+ i*store->png_atssincr;
-			ssalongtrack[j] = 0.0;
-			}
-
-		/* print debug statements */
-		if (verbose >= 5)
-			{
-			fprintf(stderr,"\ndbg4  Data extracted by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  Extracted values:\n");
-			fprintf(stderr,"dbg4       kind:       %d\n",
-				*kind);
-			fprintf(stderr,"dbg4       error:      %d\n",
-				*error);
-			fprintf(stderr,"dbg4       time_i[0]:  %d\n",
-				time_i[0]);
-			fprintf(stderr,"dbg4       time_i[1]:  %d\n",
-				time_i[1]);
-			fprintf(stderr,"dbg4       time_i[2]:  %d\n",
-				time_i[2]);
-			fprintf(stderr,"dbg4       time_i[3]:  %d\n",
-				time_i[3]);
-			fprintf(stderr,"dbg4       time_i[4]:  %d\n",
-				time_i[4]);
-			fprintf(stderr,"dbg4       time_i[5]:  %d\n",
-				time_i[5]);
-			fprintf(stderr,"dbg4       time_i[6]:  %d\n",
-				time_i[6]);
-			fprintf(stderr,"dbg4       time_d:     %f\n",
-				*time_d);
-			fprintf(stderr,"dbg4       longitude:  %f\n",
-				*navlon);
-			fprintf(stderr,"dbg4       latitude:   %f\n",
-				*navlat);
-			fprintf(stderr,"dbg4       speed:      %f\n",
-				*speed);
-			fprintf(stderr,"dbg4       heading:    %f\n",
-				*heading);
-			fprintf(stderr,"dbg4       nbath:      %d\n",
-				*nbath);
-			for (i=0;i<*nbath;i++)
-			  fprintf(stderr,"dbg4       beam:%d  flag:%3d  bath:%6g  acrosstrack:%6g  alongtrack:%6g\n",
-				i,beamflag[i],bath[i],
-				bathacrosstrack[i],bathalongtrack[i]);
-			fprintf(stderr,"dbg4        namp:     %d\n",
-				*namp);
-			for (i=0;i<*namp;i++)
-			  fprintf(stderr,"dbg4        beam:%d   amp:%6g  acrosstrack:%6g  alongtrack:%6g\n",
-				i,amp[i],bathacrosstrack[i],bathalongtrack[i]);
-			fprintf(stderr,"dbg4        nss:      %d\n",
-				*nss);
-			for (i=0;i<*nss;i++)
-			  fprintf(stderr,"dbg4        pixel:%d   ss:%6g  acrosstrack:%6g  alongtrack:%6g\n",
-				i,ss[i],ssacrosstrack[i],ssalongtrack[i]);
-			}
-
-		/* done translating values */
-
-		}
-
-	/* extract comment from structure */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* copy comment */
-		strcpy(comment,store->comment);
-
-		/* print debug statements */
-		if (verbose >= 4)
-			{
-			fprintf(stderr,"\ndbg4  New ping read by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  New ping values:\n");
-			fprintf(stderr,"dbg4       error:      %d\n",
-				*error);
-			fprintf(stderr,"dbg4       comment:    %s\n",
-				comment);
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind == MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"dbg2       comment:     \ndbg2       %s\n",
-			comment);
-		}
-	else if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind != MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"dbg2       time_i[0]:     %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:     %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:     %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:     %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:     %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:     %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:     %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:        %f\n",*time_d);
-		fprintf(stderr,"dbg2       longitude:     %f\n",*navlon);
-		fprintf(stderr,"dbg2       latitude:      %f\n",*navlat);
-		fprintf(stderr,"dbg2       speed:         %f\n",*speed);
-		fprintf(stderr,"dbg2       heading:       %f\n",*heading);
-		}
-	if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind == MB_DATA_DATA)
-		{
-		fprintf(stderr,"dbg2       nbath:      %d\n",
-			*nbath);
-		for (i=0;i<*nbath;i++)
-		  fprintf(stderr,"dbg2       beam:%d  flag:%3d  bath:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,beamflag[i],bath[i],
-			bathacrosstrack[i],bathalongtrack[i]);
-		fprintf(stderr,"dbg2        namp:     %d\n",
-			*namp);
-		for (i=0;i<*namp;i++)
-		  fprintf(stderr,"dbg2       beam:%d   amp:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,amp[i],bathacrosstrack[i],bathalongtrack[i]);
-		fprintf(stderr,"dbg2        nss:      %d\n",
-			*nss);
-		for (i=0;i<*nss;i++)
-		  fprintf(stderr,"dbg2        pixel:%d   ss:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,ss[i],ssacrosstrack[i],ssalongtrack[i]);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_mr1b_insert(int verbose, void *mbio_ptr, void *store_ptr,
-		int kind, int time_i[7], double time_d,
-		double navlon, double navlat,
-		double speed, double heading,
-		int nbath, int namp, int nss,
-		char *beamflag, double *bath, double *amp,
-		double *bathacrosstrack, double *bathalongtrack,
-		double *ss, double *ssacrosstrack, double *ssalongtrack,
-		char *comment, int *error)
-{
-	char	*function_name = "mbsys_mr1b_insert";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_mr1b_struct *store;
-	int	beam_center, pixel_center;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       kind:       %d\n",kind);
-		}
-	if (verbose >= 2 && (kind == MB_DATA_DATA || kind == MB_DATA_NAV))
-		{
-		fprintf(stderr,"dbg2       time_i[0]:  %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:  %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:  %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:  %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:  %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:  %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:  %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:     %f\n",time_d);
-		fprintf(stderr,"dbg2       navlon:     %f\n",navlon);
-		fprintf(stderr,"dbg2       navlat:     %f\n",navlat);
-		fprintf(stderr,"dbg2       speed:      %f\n",speed);
-		fprintf(stderr,"dbg2       heading:    %f\n",heading);
-		}
-	if (verbose >= 2 && kind == MB_DATA_DATA)
-		{
-		fprintf(stderr,"dbg2       nbath:      %d\n",nbath);
-		if (verbose >= 3)
-		 for (i=0;i<nbath;i++)
-		  fprintf(stderr,"dbg3       beam:%d  flag:%3d bath:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,beamflag[i],bath[i],
-			bathacrosstrack[i],bathalongtrack[i]);
-		fprintf(stderr,"dbg2       namp:       %d\n",namp);
-		if (verbose >= 3)
-		 for (i=0;i<namp;i++)
-		  fprintf(stderr,"dbg3        beam:%d   amp:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,amp[i],bathacrosstrack[i],bathalongtrack[i]);
-		fprintf(stderr,"dbg2        nss:       %d\n",nss);
-		if (verbose >= 3)
-		 for (i=0;i<nss;i++)
-		  fprintf(stderr,"dbg3        pixel:%d   ss:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,ss[i],ssacrosstrack[i],ssalongtrack[i]);
-		}
-	if (verbose >= 2 && kind == MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"dbg2       comment:     \ndbg2       %s\n",
-			comment);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_mr1b_struct *) store_ptr;
-
-	/* set data kind */
-	store->kind = kind;
-
-	/* insert data in structure */
-	if (store->kind == MB_DATA_DATA)
-		{
-		/* get time */
-		store->sec = (int) time_d;
-		store->usec = (int) 1000000.0*(time_d - store->sec);
-
-		/* get navigation */
-		if (navlon < 0.0) navlon = navlon + 360.0;
-		store->png_lon = navlon;
-		store->png_lat = navlat;
-
-		/* get heading */
-		store->png_compass = heading;
-		/*store->png_course = heading;*/
-
-		/* get speed */
-
-		/* get port bathymetry */
-		beam_center = nbath/2;
-		for (i=0;i<store->port_btycount;i++)
-			{
-			j = beam_center - 2 - i;
-			if (beamflag[j] != MB_FLAG_NULL)
-				{
-				if (mb_beam_check_flag(beamflag[j]))
-				    store->bath_port[i]
-					= -bath[j];
-				else
-				    store->bath_port[i]
-					= bath[j];
-				store->bath_acrosstrack_port[i]
-					= -bathacrosstrack[j];
-				}
-			else
-				{
-				store->bath_port[i] = 0.0;
-				store->bath_acrosstrack_port[i] = 0.0;
-				}
-			}
-
-		/* get center beam bathymetry */
-		if (beamflag[beam_center] == MB_FLAG_NULL)
-			{
-			store->png_alt = 0.0;
-			}
-		else if (mb_beam_check_flag(beamflag[beam_center]))
-			{
-			store->png_alt = -bath[beam_center]
-				+ store->png_prdepth;
-			}
-		else
-			{
-			store->png_alt = bath[beam_center]
-				- store->png_prdepth;
-			}
-
-		/* get starboard bathymetry */
-		for (i=0;i<store->stbd_btycount;i++)
-			{
-			j = beam_center + 2 + i;
-			if (beamflag[j] != MB_FLAG_NULL)
-				{
-				if (mb_beam_check_flag(beamflag[j]))
-				    store->bath_stbd[i]
-					= -bath[j];
-				else
-				    store->bath_stbd[i]
-					= bath[j];
-				store->bath_acrosstrack_stbd[i]
-					= bathacrosstrack[j];
-				}
-			else
-				{
-				store->bath_stbd[i] = 0.0;
-				store->bath_acrosstrack_stbd[i] = 0.0;
-				}
-			}
-
-		/* get port sidescan */
-		pixel_center = nss/2;
-		for (i=0;i<store->port_sscount;i++)
-			{
-			j = pixel_center - 2 - i;
-			store->ss_port[i]
-				= ss[j];
-			}
-
-		/* get starboard sidescan */
-		for (i=0;i<store->stbd_sscount;i++)
-			{
-			j = pixel_center + 2 + i;
-			store->ss_stbd[i]
-				= ss[j];
-			}
-		}
-
-	/* insert comment in structure */
-	else if (store->kind == MB_DATA_COMMENT)
-		{
-		strcpy(store->comment,comment);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_mr1b_ttimes(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, int *nbeams,
-	double *ttimes, double *angles,
-	double *angles_forward, double *angles_null,
-	double *heave, double *alongtrack_offset,
-	double *draft, double *ssv, int *error)
-{
-	char	*function_name = "mbsys_mr1b_ttimes";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_mr1b_struct *store;
-	int	beam_center;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       ttimes:     %p\n",(void *)ttimes);
-		fprintf(stderr,"dbg2       angles_xtrk:%p\n",(void *)angles);
-		fprintf(stderr,"dbg2       angles_ltrk:%p\n",(void *)angles_forward);
-		fprintf(stderr,"dbg2       angles_null:%p\n",(void *)angles_null);
-		fprintf(stderr,"dbg2       heave:      %p\n",(void *)heave);
-		fprintf(stderr,"dbg2       ltrk_off:   %p\n",(void *)alongtrack_offset);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_mr1b_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get sound velocity at transducers */
-		*ssv = 1500.0;
-		*draft = store->png_prdepth;
-
-		/* get nbeams */
-		*nbeams = store->port_btycount + store->stbd_btycount + 3;
-		beam_center = *nbeams/2;
-
-		/* zero data arrays */
-		for (i=0;i<*nbeams;i++)
-			{
-			ttimes[i] = 0.0;
-			angles[i] = 0.0;
-			angles_forward[i] = 0.0;
-			angles_null[i] = 0.0;
-			heave[i] = 0.0;
-			alongtrack_offset[i] = 0.0;
-			}
-
-		/* get travel times and angles */
-		for (i=0;i<store->port_btycount;i++)
-			{
-			j = beam_center - i - 2;
-			angles_null[j] = MBSYS_MR1B_XDUCER_ANGLE;
-			angles_forward[j] = 180.0;
-			if (fabs(store->bath_port[i]) > 0.0)
-				{
-				ttimes[j] = store->tt_port[i];
-				angles[j] = fabs(store->angle_port[i]);
-				heave[j] = 0.0;
-				}
-			else
-				{
-				ttimes[j] = 0.0;
-				angles[j] = 0.0;
-				}
-			}
-		for (i=0;i<3;i++)
-			{
-			j = beam_center + i - 1;
-			angles_forward[j] = 0.0;
-			angles_null[j] = 0.0;
-			if (j == beam_center)
-				{
-				ttimes[j] = store->png_tt;
-				angles[j] = 0.0;
-				heave[j] = 0.0;
-				}
-			else
-				{
-				ttimes[j] = 0.0;
-				angles[j] = 0.0;
-				}
-			}
-		for (i=0;i<store->stbd_btycount;i++)
-			{
-			j = beam_center + 2 + i;
-			angles_forward[j] = 0.0;
-			angles_null[j] = MBSYS_MR1B_XDUCER_ANGLE;
-			if (fabs(store->bath_stbd[i]) > 0.0)
-				{
-				ttimes[j] = store->tt_stbd[i];
-				angles[j] = fabs(store->angle_stbd[i]);
-				heave[j] = 0.0;
-				}
-			else
-				{
-				ttimes[j] = 0.0;
-				angles[j] = 0.0;
-				}
-			}
-
-		/* set status */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error == MB_ERROR_NO_ERROR)
-		{
-		fprintf(stderr,"dbg2       draft:      %f\n",*draft);
-		fprintf(stderr,"dbg2       ssv:        %f\n",*ssv);
-		fprintf(stderr,"dbg2       nbeams:     %d\n",*nbeams);
-		for (i=0;i<*nbeams;i++)
-			fprintf(stderr,"dbg2       beam %d: tt:%f  angle_xtrk:%f  angle_ltrk:%f  angle_null:%f  depth_off:%f  ltrk_off:%f\n",
-				i,ttimes[i],angles[i],
-				angles_forward[i],angles_null[i],
-				heave[i],alongtrack_offset[i]);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_mr1b_detects(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, int *nbeams,
-	int *detects, int *error)
-{
-	char	*function_name = "mbsys_mr1b_detects";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_mr1b_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       detects:    %p\n",(void *)detects);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_mr1b_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get nbeams */
-		*nbeams = store->port_btycount + store->stbd_btycount + 3;
-
-		/* get detects */
-		for (i=0;i<*nbeams;i++)
-			{
-			detects[i] = MB_DETECT_PHASE;
-			}
-
-		/* set status */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error == MB_ERROR_NO_ERROR)
-		{
-		fprintf(stderr,"dbg2       nbeams:     %d\n",*nbeams);
-		for (i=0;i<*nbeams;i++)
-			fprintf(stderr,"dbg2       beam %d: detects:%d\n",
-				i,detects[i]);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_mr1b_extract_altitude(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, double *transducer_depth, double *altitude,
-	int *error)
-{
-	char	*function_name = "mbsys_mr1b_extract_altitude";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_mr1b_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_mr1b_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		*transducer_depth = fabs(store->png_prdepth);
-		*altitude = store->png_alt;
-
-		/* set status */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:              %d\n",*kind);
-		fprintf(stderr,"dbg2       transducer_depth:  %f\n",*transducer_depth);
-		fprintf(stderr,"dbg2       altitude:          %f\n",*altitude);
-		fprintf(stderr,"dbg2       error:             %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:            %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_mr1b_extract_nav(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int time_i[7], double *time_d,
-		double *navlon, double *navlat,
-		double *speed, double *heading, double *draft,
-		double *roll, double *pitch, double *heave,
-		int *error)
-{
-	char	*function_name = "mbsys_mr1b_extract_nav";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_mr1b_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_mr1b_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get time */
-		*time_d = store->sec + 0.000001*store->usec;
-		mb_get_date(verbose,*time_d,time_i);
-
-		/* get navigation */
-		*navlon = store->png_lon;
-		*navlat = store->png_lat;
-
-		/* get heading */
-		*heading = store->png_compass;
-		/* *heading = store->png_course;*/
-
-		/* set speed to zero */
-		*speed = 0.0;
-
-		/* get draft */
-		*draft = store->png_prdepth;
-
-		/* get roll pitch and heave */
-		*roll = store->png_roll;
-		*pitch = store->png_pitch;
-		*heave = 0.0;
-
-		/* print debug statements */
-		if (verbose >= 5)
-			{
-			fprintf(stderr,"\ndbg4  Data extracted by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  Extracted values:\n");
-			fprintf(stderr,"dbg4       kind:       %d\n",
-				*kind);
-			fprintf(stderr,"dbg4       error:      %d\n",
-				*error);
-			fprintf(stderr,"dbg4       time_i[0]:  %d\n",
-				time_i[0]);
-			fprintf(stderr,"dbg4       time_i[1]:  %d\n",
-				time_i[1]);
-			fprintf(stderr,"dbg4       time_i[2]:  %d\n",
-				time_i[2]);
-			fprintf(stderr,"dbg4       time_i[3]:  %d\n",
-				time_i[3]);
-			fprintf(stderr,"dbg4       time_i[4]:  %d\n",
-				time_i[4]);
-			fprintf(stderr,"dbg4       time_i[5]:  %d\n",
-				time_i[5]);
-			fprintf(stderr,"dbg4       time_i[6]:  %d\n",
-				time_i[6]);
-			fprintf(stderr,"dbg4       time_d:     %f\n",
-				*time_d);
-			fprintf(stderr,"dbg4       longitude:  %f\n",
-				*navlon);
-			fprintf(stderr,"dbg4       latitude:   %f\n",
-				*navlat);
-			fprintf(stderr,"dbg4       speed:      %f\n",
-				*speed);
-			fprintf(stderr,"dbg4       heading:    %f\n",
-				*heading);
-			fprintf(stderr,"dbg4       draft:      %f\n",
-				*draft);
-			fprintf(stderr,"dbg4       roll:       %f\n",
-				*roll);
-			fprintf(stderr,"dbg4       pitch:      %f\n",
-				*pitch);
-			fprintf(stderr,"dbg4       heave:      %f\n",
-				*heave);
-			}
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind == MB_DATA_DATA)
-		{
-		fprintf(stderr,"dbg2       time_i[0]:     %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:     %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:     %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:     %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:     %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:     %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:     %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:        %f\n",*time_d);
-		fprintf(stderr,"dbg2       longitude:     %f\n",*navlon);
-		fprintf(stderr,"dbg2       latitude:      %f\n",*navlat);
-		fprintf(stderr,"dbg2       speed:         %f\n",*speed);
-		fprintf(stderr,"dbg2       heading:       %f\n",*heading);
-		fprintf(stderr,"dbg2       draft:         %f\n",*draft);
-		fprintf(stderr,"dbg2       roll:          %f\n",*roll);
-		fprintf(stderr,"dbg2       pitch:         %f\n",*pitch);
-		fprintf(stderr,"dbg2       heave:         %f\n",*heave);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_mr1b_insert_nav(int verbose, void *mbio_ptr, void *store_ptr,
-		int time_i[7], double time_d,
-		double navlon, double navlat,
-		double speed, double heading, double draft,
-		double roll, double pitch, double heave,
-		int *error)
-{
-	char	*function_name = "mbsys_mr1b_insert_nav";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_mr1b_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       time_i[0]:  %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:  %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:  %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:  %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:  %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:  %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:  %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:     %f\n",time_d);
-		fprintf(stderr,"dbg2       navlon:     %f\n",navlon);
-		fprintf(stderr,"dbg2       navlat:     %f\n",navlat);
-		fprintf(stderr,"dbg2       speed:      %f\n",speed);
-		fprintf(stderr,"dbg2       heading:    %f\n",heading);
-		fprintf(stderr,"dbg2       draft:      %f\n",draft);
-		fprintf(stderr,"dbg2       roll:       %f\n",roll);
-		fprintf(stderr,"dbg2       pitch:      %f\n",pitch);
-		fprintf(stderr,"dbg2       heave:      %f\n",heave);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_mr1b_struct *) store_ptr;
-
-	/* insert data in structure */
-	if (store->kind == MB_DATA_DATA)
-		{
-		/* get time */
-		store->sec = (int) time_d;
-		store->usec = (int) 1000000.0*(time_d - store->sec);
-
-		/* get navigation */
-		if (navlon < 0.0) navlon = navlon + 360.0;
-		store->png_lon = navlon;
-		store->png_lat = navlat;
-
-		/* get heading */
-		store->png_compass = heading;
-		/* store->png_course = heading;*/
-
-		/* get speed */
-
-		/* get draft */
-		store->png_prdepth = draft;
-
-		/* get roll pitch and heave */
-		store->png_roll = roll;
-		store->png_pitch = pitch;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_mr1b_copy(int verbose, void *mbio_ptr,
-			void *store_ptr, void *copy_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_mr1b_copy";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_mr1b_struct *store;
-	struct mbsys_mr1b_struct *copy;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       copy_ptr:   %p\n",(void *)copy_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointers */
-	store = (struct mbsys_mr1b_struct *) store_ptr;
-	copy = (struct mbsys_mr1b_struct *) copy_ptr;
-
-	/* copy the data */
-	*copy = *store;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mbsys_mr1b.h b/src/mbio/mbsys_mr1b.h
deleted file mode 100644
index be58357..0000000
--- a/src/mbio/mbsys_mr1b.h
+++ /dev/null
@@ -1,214 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbsys_mr1b.h	7/19/94
- *	$Id: mbsys_mr1b.h 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1994-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbsys_mr1b.h defines the data structures used by MBIO functions
- * to store data from the MR1 towed sonar.
- * The data formats which are commonly used to store MR1
- * data in files include
- *      MBF_MR1PRHIG : MBIO ID 61
- *
- * Author:	D. W. Caress
- * Date:	July 19, 1994
- *
- * $Log: mbsys_mr1b.h,v $
- * Revision 5.5  2005/11/05 00:48:05  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.4  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.3  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.2  2001/07/20 00:32:54  caress
- * Release 5.0.beta03
- *
- * Revision 5.1  2001/01/22  07:43:34  caress
- * Version 5.0.beta01
- *
- * Revision 5.0  2000/12/01  22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.2  2000/09/30  06:31:19  caress
- * Snapshot for Dale.
- *
- * Revision 4.1  1998/10/05  18:32:27  caress
- * MB-System version 4.6beta
- *
- * Revision 4.0  1996/03/12  17:23:54  caress
- * Initial version.
- *
- * Revision 4.0  1996/03/12  17:23:54  caress
- * Initial version.
- *
- *
- *
- *
- */
-/*
- * Notes on the MBSYS_MR1B data structure:
- *   1. The MR1 post processing format uses the xdr external
- *      data representation for portability.
- *   2. The data stream consists of a file header followed
- *      by individual pings.
- *   3. The file header contains a comment string and the
- *      number of pings. The comment string is broken up
- *      into multiple comments by MBIO on reading; the comments
- *      are concatenated into a single string on writing.
- *   4. The pings each contain a header plus the bathymetry and/or
- *      sidescan data.
- *   6. The data structure defined below includes all of the values
- *      which are passed in the MR1 post processing format.
- *   7. The data structure defined below also includes travel
- *      time values for each bathymetry beam - this is an
- *      addition to the HIG MR1 post processing format.
- */
-
-/* maximum number of bathymetry beams per side for MR1 */
-#define MBSYS_MR1B_BEAMS_SIDE 75
-
-/* maximum number of sidescan pixels per side for MR1 */
-#define MBSYS_MR1B_PIXELS_SIDE 2000
-
-/* maximum number of bathymetry beams for MR1 */
-#define MBSYS_MR1B_BEAMS (2*MBSYS_MR1B_BEAMS_SIDE + 3)
-
-/* maximum number of sidescan pixels output for MR1 */
-#define MBSYS_MR1B_PIXELS (2*MBSYS_MR1B_PIXELS_SIDE + 3)
-
-/* maximum length of comment */
-#define	MBSYS_MR1B_MAXLINE 200
-
-/* angle from vertical of MR1 transducers */
-#define	MBSYS_MR1B_XDUCER_ANGLE 50.0
-
-struct mbsys_mr1b_struct
-	{
-	/* type of data record */
-	int	kind;
-
-	/* file header info */
-	int mf_magic;		/* magic cookie */
-	int mf_count;		/* number of objects */
-	char *mf_log;		/* processing log */
-
-	/* ping header */
-	int sec;		/* timestamp */
-	int usec;		/* timestamp */
-	double png_lon;		/* longitude (deg) */
-	double png_lat;		/* latitude (deg) */
-	float png_course;	/* course determined from nav (deg) */
-	float png_compass;	/* compass heading of vehicle
-					0=N,90=E, etc. (deg) */
-	float png_prdepth;	/* pressure depth (m) */
-	float png_alt;		/* altitude of vehicle (m) */
-	float png_pitch;	/* vehicle pitch (deg) */
-	float png_roll;		/* vehicle roll (deg) */
-	float png_temp;		/* water temperature (deg) */
-	float png_atssincr;	/* across-track sidescan increment (m) */
-	float png_tt;		/* nadir travel time (s) */
-
-	/* port settings */
-	float port_trans[2];	/* transmitter settings (units?) */
-	float port_gain;	/* gain setting (units?) */
-	float port_pulse;	/* pulse length (units?) */
-	int port_btycount;	/* number of valid bathymetry samples */
-	int port_btypad;	/* number of invalid trailing pad samples */
-	float port_ssoffset;	/* across-track distance to
-					first sidescan sample */
-	int port_sscount;	/* number of valid sidescan samples */
-	int port_sspad;		/* number of invalid trailing pad samples */
-
-	/* starboard settings */
-	float stbd_trans[2];	/* transmitter settings (units?) */
-	float stbd_gain;	/* gain setting (units?) */
-	float stbd_pulse;	/* pulse length (units?) */
-	int stbd_btycount;	/* number of valid bathymetry samples */
-	int stbd_btypad;	/* number of invalid trailing pad samples */
-	float stbd_ssoffset;	/* across-track distance to
-					first sidescan sample */
-	int stbd_sscount;	/* number of valid sidescan samples */
-	int stbd_sspad;		/* number of invalid trailing pad samples */
-
-	/* bathymetry */
-	float	bath_acrosstrack_port[MBSYS_MR1B_BEAMS_SIDE];
-	float	bath_port[MBSYS_MR1B_BEAMS_SIDE];
-	float	tt_port[MBSYS_MR1B_BEAMS_SIDE];
-	float	angle_port[MBSYS_MR1B_BEAMS_SIDE];
-	float	bath_acrosstrack_stbd[MBSYS_MR1B_BEAMS_SIDE];
-	float	bath_stbd[MBSYS_MR1B_BEAMS_SIDE];
-	float	tt_stbd[MBSYS_MR1B_BEAMS_SIDE];
-	float	angle_stbd[MBSYS_MR1B_BEAMS_SIDE];
-
-	/* sidescan */
-	float	ss_port[MBSYS_MR1B_PIXELS_SIDE];
-	float	ss_stbd[MBSYS_MR1B_PIXELS_SIDE];
-
-	/* comment */
-	char	comment[MBSYS_MR1B_MAXLINE];
-};
-
-
-/* system specific function prototypes */
-int mbsys_mr1b_alloc(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error);
-int mbsys_mr1b_deall(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error);
-int mbsys_mr1b_dimensions(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int *nbath, int *namp, int *nss, int *error);
-int mbsys_mr1b_extract(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int time_i[7], double *time_d,
-			double *navlon, double *navlat,
-			double *speed, double *heading,
-			int *nbath, int *namp, int *nss,
-			char *beamflag, double *bath, double *amp,
-			double *bathacrosstrack, double *bathalongtrack,
-			double *ss, double *ssacrosstrack, double *ssalongtrack,
-			char *comment, int *error);
-int mbsys_mr1b_insert(int verbose, void *mbio_ptr, void *store_ptr,
-			int kind, int time_i[7], double time_d,
-			double navlon, double navlat,
-			double speed, double heading,
-			int nbath, int namp, int nss,
-			char *beamflag, double *bath, double *amp,
-			double *bathacrosstrack, double *bathalongtrack,
-			double *ss, double *ssacrosstrack, double *ssalongtrack,
-			char *comment, int *error);
-int mbsys_mr1b_ttimes(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int *nbeams,
-			double *ttimes, double *angles,
-			double *angles_forward, double *angles_null,
-			double *heave, double *alongtrack_offset,
-			double *draft, double *ssv, int *error);
-int mbsys_mr1b_detects(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int *nbeams, int *detects, int *error);
-int mbsys_mr1b_extract_altitude(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, double *transducer_depth, double *altitude,
-			int *error);
-int mbsys_mr1b_extract_nav(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int time_i[7], double *time_d,
-			double *navlon, double *navlat,
-			double *speed, double *heading, double *draft,
-			double *roll, double *pitch, double *heave,
-			int *error);
-int mbsys_mr1b_insert_nav(int verbose, void *mbio_ptr, void *store_ptr,
-			int time_i[7], double time_d,
-			double navlon, double navlat,
-			double speed, double heading, double draft,
-			double roll, double pitch, double heave,
-			int *error);
-int mbsys_mr1b_copy(int verbose, void *mbio_ptr,
-			void *store_ptr, void *copy_ptr,
-			int *error);
diff --git a/src/mbio/mbsys_mr1v2001.c b/src/mbio/mbsys_mr1v2001.c
deleted file mode 100644
index 1e903ef..0000000
--- a/src/mbio/mbsys_mr1v2001.c
+++ /dev/null
@@ -1,1783 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbsys_mr1v2001.c	3/6/2003
- *	$Id: mbsys_mr1v2001.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 2003-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbsys_mr1v2001v2001.c defines the data structures used by MBIO functions
- * to store interferometry sonard data processed by the Hawaii Mapping
- * Research Group. This includes data from the MR1, SCAMP, and WHOI
- * DSL 120
- *.
- * The data formats associated with mbsys_mr1v2001v2001 are:
- *      MBF_MR1PRVR2 : MBIO ID 64
- *
- * Author:	D. W. Caress
- * Date:	March 6, 2003
- * $Log: mbsys_mr1v2001.c,v $
- * Revision 5.2  2006/01/24 19:11:17  caress
- * Version 5.0.8 beta.
- *
- * Revision 5.1  2005/11/05 00:48:05  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.0  2003/03/10 20:03:59  caress
- * Initial version.
- *
- *
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#include <string.h>
-#include <time.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mb_define.h"
-#include "mbbs.h"
-#include "mbsys_mr1v2001.h"
-
- static char rcs_id[]="$Id: mbsys_mr1v2001.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mbsys_mr1v2001_alloc(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_mr1v2001_alloc";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* allocate memory for data structure */
-	status = mb_malloc(verbose,sizeof(struct mbsys_mr1v2001_struct),
-				store_ptr,error);
- 	memset(*store_ptr, 0, sizeof(struct mbsys_mr1v2001_struct));
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)*store_ptr);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_mr1v2001_deall(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_mr1v2001_deall";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)*store_ptr);
-		}
-
-	/* deallocate memory for data structure */
-	status = mb_free(verbose,store_ptr,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_mr1v2001_dimensions(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int *nbath, int *namp, int *nss, int *error)
-{
-	char	*function_name = "mbsys_mr1v2001_dimensions";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_mr1v2001_struct *store;
-	BSFile *header;
-	Ping *ping;
-	PingSide *pingport;
-	PingSide *pingstbd;
-	PingData *pingdata;
-	float *pbty;
-	unsigned int *pbtyflags;
-	float *pss;
-	unsigned char *pssflags;
-	AuxBeamInfo *pabi;
-	float *sbty;
-	unsigned int *sbtyflags;
-	float *sss;
-	unsigned char *sssflags;
-	AuxBeamInfo *sabi;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_mr1v2001_struct *) store_ptr;
-
-	/* get pointers */
-	header = &(store->header);
-	ping = &(store->ping);
-	pingport = &(ping->png_sides[ACP_PORT]);
-	pingstbd = &(ping->png_sides[ACP_STBD]);
-	pingdata = &(store->pingdata);
-	pbty = (float *)(pingdata->pd_bty[ACP_PORT]);
-	pbtyflags = (unsigned int *)(pingdata->pd_btyflags[ACP_PORT]);
-	pss = (float *)(pingdata->pd_ss[ACP_PORT]);
-	pssflags = (unsigned char *)(pingdata->pd_ssflags[ACP_PORT]);
-	pabi = (AuxBeamInfo *)(pingdata->pd_abi[ACP_PORT]);
-	sbty = (float *)(pingdata->pd_bty[ACP_STBD]);
-	sbtyflags = (unsigned int *)(pingdata->pd_btyflags[ACP_STBD]);
-	sss = (float *)(pingdata->pd_ss[ACP_STBD]);
-	sssflags = (unsigned char *)(pingdata->pd_ssflags[ACP_STBD]);
-	sabi = (AuxBeamInfo *)(pingdata->pd_abi[ACP_STBD]);
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get beam and pixel numbers */
-		*nbath = 2 * MAX(pingport->ps_btycount, pingstbd->ps_btycount);
-		*namp = 0;
-		*nss = 2 * MAX(pingport->ps_sscount, pingstbd->ps_sscount);
-		}
-
-	/* extract data from structure */
-	else
-		{
-		/* get beam and pixel numbers */
-		*nbath = 0;
-		*namp = 0;
-		*nss = 0;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		fprintf(stderr,"dbg2       nbath:      %d\n",*nbath);
-		fprintf(stderr,"dbg2        namp:      %d\n",*namp);
-		fprintf(stderr,"dbg2        nss:       %d\n",*nss);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_mr1v2001_extract(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int time_i[7], double *time_d,
-		double *navlon, double *navlat,
-		double *speed, double *heading,
-		int *nbath, int *namp, int *nss,
-		char *beamflag, double *bath, double *amp,
-		double *bathacrosstrack, double *bathalongtrack,
-		double *ss, double *ssacrosstrack, double *ssalongtrack,
-		char *comment, int *error)
-{
-	char	*function_name = "mbsys_mr1v2001_extract";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_mr1v2001_struct *store;
-	BSFile *header;
-	Ping *ping;
-	PingSide *pingport;
-	PingSide *pingstbd;
-	PingData *pingdata;
-	float *pbty;
-	unsigned int *pbtyflags;
-	float *pss;
-	unsigned char *pssflags;
-	AuxBeamInfo *pabi;
-	float *sbty;
-	unsigned int *sbtyflags;
-	float *sss;
-	unsigned char *sssflags;
-	AuxBeamInfo *sabi;
-	int	beam_center, pixel_center;
-	double	ssyoffset;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_mr1v2001_struct *) store_ptr;
-
-	/* get pointers */
-	header = &(store->header);
-	ping = &(store->ping);
-	pingport = &(ping->png_sides[ACP_PORT]);
-	pingstbd = &(ping->png_sides[ACP_STBD]);
-	pingdata = &(store->pingdata);
-	pbty = (float *)(pingdata->pd_bty[ACP_PORT]);
-	pbtyflags = (unsigned int *)(pingdata->pd_btyflags[ACP_PORT]);
-	pss = (float *)(pingdata->pd_ss[ACP_PORT]);
-	pssflags = (unsigned char *)(pingdata->pd_ssflags[ACP_PORT]);
-	pabi = (AuxBeamInfo *)(pingdata->pd_abi[ACP_PORT]);
-	sbty = (float *)(pingdata->pd_bty[ACP_STBD]);
-	sbtyflags = (unsigned int *)(pingdata->pd_btyflags[ACP_STBD]);
-	sss = (float *)(pingdata->pd_ss[ACP_STBD]);
-	sssflags = (unsigned char *)(pingdata->pd_ssflags[ACP_STBD]);
-	sabi = (AuxBeamInfo *)(pingdata->pd_abi[ACP_STBD]);
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get time */
-		*time_d = ping->png_tm.tv_sec + 0.000001 * ping->png_tm.tv_usec;
-		mb_get_date(verbose,*time_d,time_i);
-
-		/* get navigation */
-		if (!mbbs_isnand(ping->png_tlon)
-			&& !mbbs_isnand(ping->png_tlon))
-			{
-			*navlon = ping->png_tlon;
-			*navlat = ping->png_tlat;
-			}
-		else if (!mbbs_isnand(ping->png_slon)
-			&& !mbbs_isnand(ping->png_slon))
-			{
-			*navlon = ping->png_slon;
-			*navlat = ping->png_slat;
-			}
-		else
-			{
-			*navlon = 0.0;
-			*navlat = 0.0;
-			}
-
-		/* get heading */
-		if (!mbbs_isnand(store->ping.png_compass.sns_repval))
-			{
-			*heading = store->ping.png_compass.sns_repval;
-			if (!mbbs_isnand(store->ping.png_magcorr))
-				*heading += store->ping.png_magcorr;
-			}
-		else if (!mbbs_isnand(ping->png_tcourse))
-			*heading = ping->png_tcourse;
-		if (*heading < 0.0)
-			*heading += 360.0;
-		if (*heading >= 360.0)
-			*heading -= 360.0;
-
-		/* set speed to zero */
-		*speed = 0.0;
-
-		/* set beamwidths in mb_io structure */
-		mb_io_ptr->beamwidth_ltrack = 2.0;
-		mb_io_ptr->beamwidth_xtrack = 0.1;
-
-		/* zero data arrays */
-		for (i=0;i<MBSYS_MR1V2001_BEAMS;i++)
-			{
-			beamflag[i] = MB_FLAG_NULL;
-			bath[i] = 0.0;
-			bathacrosstrack[i] = 0.0;
-			bathalongtrack[i] = 0.0;
-			}
-		for (i=0;i<MBSYS_MR1V2001_PIXELS;i++)
-			{
-			ss[i] = 0.0;
-			ssacrosstrack[i] = 0.0;
-			ssalongtrack[i] = 0.0;
-			}
-
-		/* set up to extract beam and pixel values */
-		*nbath = 2 * MAX(pingport->ps_btycount, pingstbd->ps_btycount);
-		*namp = 0;
-		*nss = 2 * MAX(pingport->ps_sscount, pingstbd->ps_sscount);
-		if (*nss > 0) *nss += 3;
-		beam_center = *nbath/2;
-		pixel_center = *nss/2;
-			
-		/* extract bathymetry */
-		if (store->ping.png_flags & PNG_XYZ)
-			{
-			for (i=0;i<pingport->ps_btycount;i++)
-				{
-				j = beam_center - 1 - i;
-				if (pbtyflags[i] == 0)
-				    {
-				    beamflag[j] = MB_FLAG_NONE;
-				    }
-				else
-				    {
-				    beamflag[j] = MB_FLAG_MANUAL + MB_FLAG_FLAG;
-				    }
-				bathacrosstrack[j] = -pbty[3*i];
-				bathalongtrack[j] = pbty[3*i+1];
-				bath[j] = pbty[3*i+2];
-				}
-			for (i=0;i<pingstbd->ps_btycount;i++)
-				{
-				j = beam_center + i;
-				if (pbtyflags[i] == 0)
-				    {
-				    beamflag[j] = MB_FLAG_NONE;
-				    }
-				else
-				    {
-				    beamflag[j] = MB_FLAG_MANUAL + MB_FLAG_FLAG;
-				    }
-				bathacrosstrack[j] = sbty[3*i];
-				bathalongtrack[j] = sbty[3*i+1];
-				bath[j] = sbty[3*i+2];
-				}
-			}
-		else
-			{
-			for (i=0;i<pingport->ps_btycount;i++)
-				{
-				j = beam_center - i - 1;
-				if (pbtyflags[i] == 0)
-				    {
-				    beamflag[j] = MB_FLAG_NONE;
-				    }
-				else
-				    {
-				    beamflag[j] = MB_FLAG_MANUAL + MB_FLAG_FLAG;
-				    }
-				bathacrosstrack[j] = -pbty[2*i];
-				bathalongtrack[j] = 0.0;
-				bath[j] = pbty[2*i+1];
-				}
-			for (i=0;i<pingstbd->ps_btycount;i++)
-				{
-				j = beam_center + i;
-				if (sbtyflags[i] == 0)
-				    {
-				    beamflag[j] = MB_FLAG_NONE;
-				    }
-				else
-				    {
-				    beamflag[j] = MB_FLAG_MANUAL + MB_FLAG_FLAG;
-				    }
-				bathacrosstrack[j] = sbty[2*i];
-				bathalongtrack[j] = 0.0;
-				bath[j] = sbty[2*i+1];
-				}
-			}
-			
-		/* extract sidescan */
-		if (!mbbs_isnand(pingport->ps_ssyoffset))
-			ssyoffset = pingport->ps_ssyoffset;
-		else
-			ssyoffset = 0.0;
-		for (i=0;i<pingport->ps_sscount;i++)
-			{
-			j = pixel_center - i - 1;
-			ss[j] = pss[i];
-			ssacrosstrack[j] = -pingport->ps_ssxoffset
-				- i*ping->png_ssincr;
-			ssalongtrack[j] = ssyoffset;
-			}
-		if (!mbbs_isnand(pingstbd->ps_ssyoffset))
-			ssyoffset = pingstbd->ps_ssyoffset;
-		else
-			ssyoffset = 0.0;
-		for (i=0;i<pingstbd->ps_sscount;i++)
-			{
-			j = pixel_center + i;
-			ss[j] = sss[i];
-			ssacrosstrack[j] = pingstbd->ps_ssxoffset
-				+ i*ping->png_ssincr;
-			ssalongtrack[j] = ssyoffset;
-			}
-
-		/* print debug statements */
-		if (verbose >= 5)
-			{
-			fprintf(stderr,"\ndbg4  Data extracted by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  Extracted values:\n");
-			fprintf(stderr,"dbg4       kind:       %d\n",
-				*kind);
-			fprintf(stderr,"dbg4       error:      %d\n",
-				*error);
-			fprintf(stderr,"dbg4       time_i[0]:  %d\n",
-				time_i[0]);
-			fprintf(stderr,"dbg4       time_i[1]:  %d\n",
-				time_i[1]);
-			fprintf(stderr,"dbg4       time_i[2]:  %d\n",
-				time_i[2]);
-			fprintf(stderr,"dbg4       time_i[3]:  %d\n",
-				time_i[3]);
-			fprintf(stderr,"dbg4       time_i[4]:  %d\n",
-				time_i[4]);
-			fprintf(stderr,"dbg4       time_i[5]:  %d\n",
-				time_i[5]);
-			fprintf(stderr,"dbg4       time_i[6]:  %d\n",
-				time_i[6]);
-			fprintf(stderr,"dbg4       time_d:     %f\n",
-				*time_d);
-			fprintf(stderr,"dbg4       longitude:  %f\n",
-				*navlon);
-			fprintf(stderr,"dbg4       latitude:   %f\n",
-				*navlat);
-			fprintf(stderr,"dbg4       speed:      %f\n",
-				*speed);
-			fprintf(stderr,"dbg4       heading:    %f\n",
-				*heading);
-			fprintf(stderr,"dbg4       nbath:      %d\n",
-				*nbath);
-			for (i=0;i<*nbath;i++)
-			  fprintf(stderr,"dbg4       beam:%d  flag:%3d  bath:%6g  acrosstrack:%6g  alongtrack:%6g\n",
-				i,beamflag[i],bath[i],
-				bathacrosstrack[i],bathalongtrack[i]);
-			fprintf(stderr,"dbg4        namp:     %d\n",
-				*namp);
-			for (i=0;i<*namp;i++)
-			  fprintf(stderr,"dbg4        beam:%d   amp:%6g  acrosstrack:%6g  alongtrack:%6g\n",
-				i,amp[i],bathacrosstrack[i],bathalongtrack[i]);
-			fprintf(stderr,"dbg4        nss:      %d\n",
-				*nss);
-			for (i=0;i<*nss;i++)
-			  fprintf(stderr,"dbg4        pixel:%d   ss:%6g  acrosstrack:%6g  alongtrack:%6g\n",
-				i,ss[i],ssacrosstrack[i],ssalongtrack[i]);
-			}
-
-		/* done translating values */
-
-		}
-
-	/* extract comment from structure */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* copy comment */
-		strcpy(comment,store->comment);
-
-		/* print debug statements */
-		if (verbose >= 4)
-			{
-			fprintf(stderr,"\ndbg4  New ping read by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  New ping values:\n");
-			fprintf(stderr,"dbg4       error:      %d\n",
-				*error);
-			fprintf(stderr,"dbg4       comment:    %s\n",
-				comment);
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind == MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"dbg2       comment:     \ndbg2       %s\n",
-			comment);
-		}
-	else if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind != MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"dbg2       time_i[0]:     %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:     %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:     %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:     %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:     %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:     %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:     %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:        %f\n",*time_d);
-		fprintf(stderr,"dbg2       longitude:     %f\n",*navlon);
-		fprintf(stderr,"dbg2       latitude:      %f\n",*navlat);
-		fprintf(stderr,"dbg2       speed:         %f\n",*speed);
-		fprintf(stderr,"dbg2       heading:       %f\n",*heading);
-		}
-	if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind == MB_DATA_DATA)
-		{
-		fprintf(stderr,"dbg2       nbath:      %d\n",
-			*nbath);
-		for (i=0;i<*nbath;i++)
-		  fprintf(stderr,"dbg2       beam:%d  flag:%3d  bath:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,beamflag[i],bath[i],
-			bathacrosstrack[i],bathalongtrack[i]);
-		fprintf(stderr,"dbg2        namp:     %d\n",
-			*namp);
-		for (i=0;i<*namp;i++)
-		  fprintf(stderr,"dbg2       beam:%d   amp:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,amp[i],bathacrosstrack[i],bathalongtrack[i]);
-		fprintf(stderr,"dbg2        nss:      %d\n",
-			*nss);
-		for (i=0;i<*nss;i++)
-		  fprintf(stderr,"dbg2        pixel:%d   ss:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,ss[i],ssacrosstrack[i],ssalongtrack[i]);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_mr1v2001_insert(int verbose, void *mbio_ptr, void *store_ptr,
-		int kind, int time_i[7], double time_d,
-		double navlon, double navlat,
-		double speed, double heading,
-		int nbath, int namp, int nss,
-		char *beamflag, double *bath, double *amp,
-		double *bathacrosstrack, double *bathalongtrack,
-		double *ss, double *ssacrosstrack, double *ssalongtrack,
-		char *comment, int *error)
-{
-	char	*function_name = "mbsys_mr1v2001_insert";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_mr1v2001_struct *store;
-	BSFile *header;
-	Ping *ping;
-	PingSide *pingport;
-	PingSide *pingstbd;
-	PingData *pingdata;
-	float *pbty;
-	unsigned int *pbtyflags;
-	float *pss;
-	unsigned char *pssflags;
-	AuxBeamInfo *pabi;
-	float *sbty;
-	unsigned int *sbtyflags;
-	float *sss;
-	unsigned char *sssflags;
-	AuxBeamInfo *sabi;
-	int	beam_center, pixel_center;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       kind:       %d\n",kind);
-		}
-	if (verbose >= 2 && (kind == MB_DATA_DATA || kind == MB_DATA_NAV))
-		{
-		fprintf(stderr,"dbg2       time_i[0]:  %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:  %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:  %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:  %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:  %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:  %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:  %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:     %f\n",time_d);
-		fprintf(stderr,"dbg2       navlon:     %f\n",navlon);
-		fprintf(stderr,"dbg2       navlat:     %f\n",navlat);
-		fprintf(stderr,"dbg2       speed:      %f\n",speed);
-		fprintf(stderr,"dbg2       heading:    %f\n",heading);
-		}
-	if (verbose >= 2 && kind == MB_DATA_DATA)
-		{
-		fprintf(stderr,"dbg2       nbath:      %d\n",nbath);
-		if (verbose >= 3)
-		 for (i=0;i<nbath;i++)
-		  fprintf(stderr,"dbg3       beam:%d  flag:%3d bath:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,beamflag[i],bath[i],
-			bathacrosstrack[i],bathalongtrack[i]);
-		fprintf(stderr,"dbg2       namp:       %d\n",namp);
-		if (verbose >= 3)
-		 for (i=0;i<namp;i++)
-		  fprintf(stderr,"dbg3        beam:%d   amp:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,amp[i],bathacrosstrack[i],bathalongtrack[i]);
-		fprintf(stderr,"dbg2        nss:       %d\n",nss);
-		if (verbose >= 3)
-		 for (i=0;i<nss;i++)
-		  fprintf(stderr,"dbg3        pixel:%d   ss:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,ss[i],ssacrosstrack[i],ssalongtrack[i]);
-		}
-	if (verbose >= 2 && kind == MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"dbg2       comment:     \ndbg2       %s\n",
-			comment);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_mr1v2001_struct *) store_ptr;
-
-	/* get pointers */
-	header = &(store->header);
-	ping = &(store->ping);
-	pingport = &(ping->png_sides[ACP_PORT]);
-	pingstbd = &(ping->png_sides[ACP_STBD]);
-	pingdata = &(store->pingdata);
-	pbty = (float *)(pingdata->pd_bty[ACP_PORT]);
-	pbtyflags = (unsigned int *)(pingdata->pd_btyflags[ACP_PORT]);
-	pss = (float *)(pingdata->pd_ss[ACP_PORT]);
-	pssflags = (unsigned char *)(pingdata->pd_ssflags[ACP_PORT]);
-	pabi = (AuxBeamInfo *)(pingdata->pd_abi[ACP_PORT]);
-	sbty = (float *)(pingdata->pd_bty[ACP_STBD]);
-	sbtyflags = (unsigned int *)(pingdata->pd_btyflags[ACP_STBD]);
-	sss = (float *)(pingdata->pd_ss[ACP_STBD]);
-	sssflags = (unsigned char *)(pingdata->pd_ssflags[ACP_STBD]);
-	sabi = (AuxBeamInfo *)(pingdata->pd_abi[ACP_STBD]);
-
-	/* set data kind */
-	store->kind = kind;
-
-	/* insert data in structure */
-	if (store->kind == MB_DATA_DATA)
-		{
-		/* get time */
-		ping->png_tm.tv_sec = (int) time_d;
-		ping->png_tm.tv_usec = (int) 1000000.0*(time_d - ping->png_tm.tv_sec);
-
-		/* get navigation */
-		if (navlon < 0.0) navlon = navlon + 360.0;
-		ping->png_tlon = navlon;
-		ping->png_tlat = navlat;
-
-		/* get heading */
-		store->ping.png_compass.sns_repval = heading;
-		if (!mbbs_isnand(store->ping.png_magcorr))
-			store->ping.png_compass.sns_repval -= store->ping.png_magcorr;
-
-		/* get speed */
-
-		/* get bathymetry */
-		beam_center = nbath/2;
-		if (store->ping.png_flags & PNG_XYZ)
-			{
-			/* get port bathymetry */
-			for (i=0;i<pingport->ps_btycount;i++)
-				{
-				j = beam_center - i - 1;
-				if (beamflag[j] != MB_FLAG_NULL)
-					{
-					pbty[2*i] = -bathacrosstrack[j];
-					pbty[2*i+1] = bathalongtrack[j];
-					pbty[2*i+2] = bath[j];
-					if (mb_beam_check_flag(beamflag[j]))
-						pbtyflags[i] = BTYD_EXTERNAL;
-					else
-						pbtyflags[i] = 0;
-					}
-				else
-					{
-					pbty[2*i] = 0.0;
-					pbty[2*i+1] = 0.0;
-					pbty[2*i+2] = 0.0;
-					pbtyflags[i] = BTYD_EXTERNAL;
-					}
-				}
-	
-			/* get starboard bathymetry */
-			for (i=0;i<pingstbd->ps_btycount;i++)
-				{
-				j = beam_center + i;
-				if (beamflag[j] != MB_FLAG_NULL)
-					{
-					sbty[2*i] = bathacrosstrack[j];
-					sbty[2*i+1] = bathalongtrack[j];
-					sbty[2*i+2] = bath[j];
-					if (mb_beam_check_flag(beamflag[j]))
-						sbtyflags[i] = BTYD_EXTERNAL;
-					else
-						sbtyflags[i] = 0;
-					}
-				else
-					{
-					sbty[2*i] = 0.0;
-					sbty[2*i+1] = 0.0;
-					sbty[2*i+2] = 0.0;
-					sbtyflags[i] = BTYD_EXTERNAL;
-					}
-				}
-			}
-		else
-			{
-			/* get port bathymetry */
-			for (i=0;i<pingport->ps_btycount;i++)
-				{
-				j = beam_center - i - 1;
-				if (beamflag[j] != MB_FLAG_NULL)
-					{
-					pbty[2*i] = -bathacrosstrack[j];
-					pbty[2*i+1] = bath[j];
-					if (mb_beam_check_flag(beamflag[j]))
-						pbtyflags[i] = BTYD_EXTERNAL;
-					else
-						pbtyflags[i] = 0;
-					}
-				else
-					{
-					pbty[2*i] = 0.0;
-					pbty[2*i+1] = 0.0;
-					pbtyflags[i] = BTYD_EXTERNAL;
-					}
-				}
-	
-			/* get starboard bathymetry */
-			for (i=0;i<pingstbd->ps_btycount;i++)
-				{
-				j = beam_center + i;
-				if (beamflag[j] != MB_FLAG_NULL)
-					{
-					sbty[2*i] = bathacrosstrack[j];
-					sbty[2*i+1] = bath[j];
-					if (mb_beam_check_flag(beamflag[j]))
-						sbtyflags[i] = BTYD_EXTERNAL;
-					else
-						sbtyflags[i] = 0;
-					}
-				else
-					{
-					sbty[2*i] = 0.0;
-					sbty[2*i+1] = 0.0;
-					sbtyflags[i] = BTYD_EXTERNAL;
-					}
-				}
-			}
-
-		/* get port sidescan */
-		pixel_center = nss/2;
-		for (i=0;i<pingport->ps_sscount;i++)
-			{
-			j = pixel_center - 2 - i;
-			pss[i] = ss[j];
-			}
-
-		/* get starboard sidescan */
-		for (i=0;i<pingstbd->ps_sscount;i++)
-			{
-			j = pixel_center + 2 + i;
-			sss[i] = ss[j];
-			}
-		}
-
-	/* insert comment in structure */
-	else if (store->kind == MB_DATA_COMMENT)
-		{
-		strcpy(store->comment,comment);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_mr1v2001_ttimes(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, int *nbeams,
-	double *ttimes, double *angles,
-	double *angles_forward, double *angles_null,
-	double *heave, double *alongtrack_offset,
-	double *draft, double *ssv, int *error)
-{
-	char	*function_name = "mbsys_mr1v2001_ttimes";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_mr1v2001_struct *store;
-	BSFile *header;
-	Ping *ping;
-	PingSide *pingport;
-	PingSide *pingstbd;
-	PingData *pingdata;
-	float *pbty;
-	unsigned int *pbtyflags;
-	float *pss;
-	unsigned char *pssflags;
-	AuxBeamInfo *pabi;
-	float *sbty;
-	unsigned int *sbtyflags;
-	float *sss;
-	unsigned char *sssflags;
-	AuxBeamInfo *sabi;
-	double	xx, yy, zz, rr;
-	int	beam_center;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       ttimes:     %p\n",(void *)ttimes);
-		fprintf(stderr,"dbg2       angles_xtrk:%p\n",(void *)angles);
-		fprintf(stderr,"dbg2       angles_ltrk:%p\n",(void *)angles_forward);
-		fprintf(stderr,"dbg2       angles_null:%p\n",(void *)angles_null);
-		fprintf(stderr,"dbg2       heave:      %p\n",(void *)heave);
-		fprintf(stderr,"dbg2       ltrk_off:   %p\n",(void *)alongtrack_offset);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_mr1v2001_struct *) store_ptr;
-
-	/* get pointers */
-	header = &(store->header);
-	ping = &(store->ping);
-	pingport = &(ping->png_sides[ACP_PORT]);
-	pingstbd = &(ping->png_sides[ACP_STBD]);
-	pingdata = &(store->pingdata);
-	pbty = (float *)(pingdata->pd_bty[ACP_PORT]);
-	pbtyflags = (unsigned int *)(pingdata->pd_btyflags[ACP_PORT]);
-	pss = (float *)(pingdata->pd_ss[ACP_PORT]);
-	pssflags = (unsigned char *)(pingdata->pd_ssflags[ACP_PORT]);
-	pabi = (AuxBeamInfo *)(pingdata->pd_abi[ACP_PORT]);
-	sbty = (float *)(pingdata->pd_bty[ACP_STBD]);
-	sbtyflags = (unsigned int *)(pingdata->pd_btyflags[ACP_STBD]);
-	sss = (float *)(pingdata->pd_ss[ACP_STBD]);
-	sssflags = (unsigned char *)(pingdata->pd_ssflags[ACP_STBD]);
-	sabi = (AuxBeamInfo *)(pingdata->pd_abi[ACP_STBD]);
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get sound velocity at transducers */
-		if (!mbbs_isnanf(ping->png_sndvel))
-			*ssv = ping->png_sndvel;
-		else
-			*ssv = 1500.0;
-		*draft = ping->png_depth.sns_repval;
-
-		/* get nbeams */
-		*nbeams = 2 * MAX(pingport->ps_btycount, pingstbd->ps_btycount);
-		beam_center = *nbeams/2;
-
-		/* zero data arrays */
-		for (i=0;i<*nbeams;i++)
-			{
-			ttimes[i] = 0.0;
-			angles[i] = 0.0;
-			angles_forward[i] = 0.0;
-			angles_null[i] = 0.0;
-			heave[i] = 0.0;
-			alongtrack_offset[i] = 0.0;
-			}
-
-		/* get travel times and angles */
-		for (i=0;i<pingport->ps_btycount;i++)
-			{
-			j = beam_center - i - 1;
-			if (store->ping.png_flags & PNG_XYZ)
-				{
-				zz = fabs(pbty[2*i+2]) - store->ping.png_depth.sns_repval;
-				xx = -pbty[2*i];
-				yy = pbty[2*i+1];
-				}
-			else
-				{
-				zz = fabs(pbty[2*i+1]) - store->ping.png_depth.sns_repval;
-				xx = -pbty[2*i];
-				yy = 0.0;
-				}
-			rr = sqrt(xx*xx + yy*yy + zz*zz);
-			ttimes[j] = 2.0 * rr/ ping->png_sndvel;
-			mb_xyz_to_takeoff(verbose, xx, yy, zz,
-					&angles[j], &angles_forward[j], error);
-			heave[j] = 0.0;
-			angles_null[j] = MBSYS_MR1V2001_XDUCER_ANGLE;
-			}
-		for (i=0;i<pingstbd->ps_btycount;i++)
-			{
-			j = beam_center + i;
-			if (store->ping.png_flags & PNG_XYZ)
-				{
-				zz = fabs(sbty[2*i+2]) - store->ping.png_depth.sns_repval;
-				xx = sbty[2*i];
-				yy = sbty[2*i+1];
-				}
-			else
-				{
-				zz = fabs(sbty[2*i+1]) - store->ping.png_depth.sns_repval;
-				xx = sbty[2*i];
-				yy = 0.0;
-				}
-			rr = sqrt(xx*xx + yy*yy + zz*zz);
-			ttimes[j] = 2.0 * rr/ ping->png_sndvel;
-			mb_xyz_to_takeoff(verbose, xx, yy, zz,
-					&angles[j], &angles_forward[j], error);
-			heave[j] = 0.0;
-			angles_null[j] = MBSYS_MR1V2001_XDUCER_ANGLE;
-			}
-
-		/* set status */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error == MB_ERROR_NO_ERROR)
-		{
-		fprintf(stderr,"dbg2       draft:      %f\n",*draft);
-		fprintf(stderr,"dbg2       ssv:        %f\n",*ssv);
-		fprintf(stderr,"dbg2       nbeams:     %d\n",*nbeams);
-		for (i=0;i<*nbeams;i++)
-			fprintf(stderr,"dbg2       beam %d: tt:%f  angle_xtrk:%f  angle_ltrk:%f  angle_null:%f  depth_off:%f  ltrk_off:%f\n",
-				i,ttimes[i],angles[i],
-				angles_forward[i],angles_null[i],
-				heave[i],alongtrack_offset[i]);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_mr1v2001_detects(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, int *nbeams,
-	int *detects, int *error)
-{
-	char	*function_name = "mbsys_mr1v2001_detects";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_mr1v2001_struct *store;
-	BSFile *header;
-	Ping *ping;
-	PingSide *pingport;
-	PingSide *pingstbd;
-	PingData *pingdata;
-	float *pbty;
-	unsigned int *pbtyflags;
-	float *pss;
-	unsigned char *pssflags;
-	AuxBeamInfo *pabi;
-	float *sbty;
-	unsigned int *sbtyflags;
-	float *sss;
-	unsigned char *sssflags;
-	AuxBeamInfo *sabi;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       detects:    %p\n",(void *)detects);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_mr1v2001_struct *) store_ptr;
-
-	/* get pointers */
-	header = &(store->header);
-	ping = &(store->ping);
-	pingport = &(ping->png_sides[ACP_PORT]);
-	pingstbd = &(ping->png_sides[ACP_STBD]);
-	pingdata = &(store->pingdata);
-	pbty = (float *)(pingdata->pd_bty[ACP_PORT]);
-	pbtyflags = (unsigned int *)(pingdata->pd_btyflags[ACP_PORT]);
-	pss = (float *)(pingdata->pd_ss[ACP_PORT]);
-	pssflags = (unsigned char *)(pingdata->pd_ssflags[ACP_PORT]);
-	pabi = (AuxBeamInfo *)(pingdata->pd_abi[ACP_PORT]);
-	sbty = (float *)(pingdata->pd_bty[ACP_STBD]);
-	sbtyflags = (unsigned int *)(pingdata->pd_btyflags[ACP_STBD]);
-	sss = (float *)(pingdata->pd_ss[ACP_STBD]);
-	sssflags = (unsigned char *)(pingdata->pd_ssflags[ACP_STBD]);
-	sabi = (AuxBeamInfo *)(pingdata->pd_abi[ACP_STBD]);
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get nbeams */
-		*nbeams = 2 * MAX(pingport->ps_btycount, pingstbd->ps_btycount);
-
-		/* get detects */
-		for (i=0;i<*nbeams;i++)
-			{
-			detects[i] = MB_DETECT_PHASE;
-			}
-
-		/* set status */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error == MB_ERROR_NO_ERROR)
-		{
-		fprintf(stderr,"dbg2       nbeams:     %d\n",*nbeams);
-		for (i=0;i<*nbeams;i++)
-			fprintf(stderr,"dbg2       beam %d: detects:%d\n",
-				i,detects[i]);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_mr1v2001_extract_altitude(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, double *transducer_depth, double *altitude,
-	int *error)
-{
-	char	*function_name = "mbsys_mr1v2001_extract_altitude";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_mr1v2001_struct *store;
-	BSFile *header;
-	Ping *ping;
-	PingSide *pingport;
-	PingSide *pingstbd;
-	PingData *pingdata;
-	float *pbty;
-	unsigned int *pbtyflags;
-	float *pss;
-	unsigned char *pssflags;
-	AuxBeamInfo *pabi;
-	float *sbty;
-	unsigned int *sbtyflags;
-	float *sss;
-	unsigned char *sssflags;
-	AuxBeamInfo *sabi;
-	double	bestdepth, bestdepthflagged;
-	double	bestxtrack, bestxtrackflagged;
-	int	found, foundflagged;
-	double	depth, xtrack;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_mr1v2001_struct *) store_ptr;
-
-	/* get pointers */
-	header = &(store->header);
-	ping = &(store->ping);
-	pingport = &(ping->png_sides[ACP_PORT]);
-	pingstbd = &(ping->png_sides[ACP_STBD]);
-	pingdata = &(store->pingdata);
-	pbty = (float *)(pingdata->pd_bty[ACP_PORT]);
-	pbtyflags = (unsigned int *)(pingdata->pd_btyflags[ACP_PORT]);
-	pss = (float *)(pingdata->pd_ss[ACP_PORT]);
-	pssflags = (unsigned char *)(pingdata->pd_ssflags[ACP_PORT]);
-	pabi = (AuxBeamInfo *)(pingdata->pd_abi[ACP_PORT]);
-	sbty = (float *)(pingdata->pd_bty[ACP_STBD]);
-	sbtyflags = (unsigned int *)(pingdata->pd_btyflags[ACP_STBD]);
-	sss = (float *)(pingdata->pd_ss[ACP_STBD]);
-	sssflags = (unsigned char *)(pingdata->pd_ssflags[ACP_STBD]);
-	sabi = (AuxBeamInfo *)(pingdata->pd_abi[ACP_STBD]);
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		if (!mbbs_isnanf(ping->png_depth.sns_repval))
-			*transducer_depth = fabs(ping->png_depth.sns_repval);
-		else
-			*transducer_depth = 0.0;
-		if (!mbbs_isnanf(ping->png_alt)
-			&& ping->png_alt > 0.0)
-			*altitude = ping->png_alt;
-		else
-			{
-			bestxtrack = 10000.0;
-			bestxtrackflagged = 10000.0;
-			bestdepth = 0.0;
-			bestdepthflagged = 0.0;
-			found = MB_NO;
-			foundflagged = MB_NO;
-			
-			/* loop over port bathymetry */
-			for (i=0;i<pingport->ps_btycount;i++)
-				{
-				if (store->ping.png_flags & PNG_XYZ)
-					{
-					xtrack = pbty[3*i];
-					depth = pbty[3*i+2];
-					}
-				else
-					{
-					xtrack = pbty[2*i];
-					depth = pbty[2*i+1];
-					}
-				if (pbtyflags[i] == 0 && xtrack < bestxtrack)
-					{
-					bestdepth = depth;
-					bestxtrack = xtrack;
-					found = MB_YES;
-					}
-				else if (xtrack < bestxtrackflagged)
-					{
-					bestdepthflagged = depth;
-					bestxtrackflagged = xtrack;
-					foundflagged = MB_YES;
-					}
-				}
-			
-			/* loop over starboard bathymetry */
-			for (i=0;i<pingstbd->ps_btycount;i++)
-				{
-				if (store->ping.png_flags & PNG_XYZ)
-					{
-					xtrack = sbty[3*i];
-					depth = sbty[3*i+2];
-					}
-				else
-					{
-					xtrack = sbty[2*i];
-					depth = sbty[2*i+1];
-					}
-				if (sbtyflags[i] == 0 && xtrack < bestxtrack)
-					{
-					bestdepth = depth;
-					bestxtrack = xtrack;
-					found = MB_YES;
-					}
-				else if (xtrack < bestxtrackflagged)
-					{
-					bestdepthflagged = depth;
-					bestxtrackflagged = xtrack;
-					foundflagged = MB_YES;
-					}
-				}
-			if (found == MB_YES)
-				*altitude = bestdepth - *transducer_depth;
-			else if (foundflagged == MB_YES)
-				*altitude = bestdepthflagged - *transducer_depth;
-			else
-				*altitude = 0.0;
-			}
-
-		/* set status */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:              %d\n",*kind);
-		fprintf(stderr,"dbg2       transducer_depth:  %f\n",*transducer_depth);
-		fprintf(stderr,"dbg2       altitude:          %f\n",*altitude);
-		fprintf(stderr,"dbg2       error:             %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:            %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_mr1v2001_extract_nav(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int time_i[7], double *time_d,
-		double *navlon, double *navlat,
-		double *speed, double *heading, double *draft,
-		double *roll, double *pitch, double *heave,
-		int *error)
-{
-	char	*function_name = "mbsys_mr1v2001_extract_nav";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_mr1v2001_struct *store;
-	BSFile *header;
-	Ping *ping;
-	PingSide *pingport;
-	PingSide *pingstbd;
-	PingData *pingdata;
-	float *pbty;
-	unsigned int *pbtyflags;
-	float *pss;
-	unsigned char *pssflags;
-	AuxBeamInfo *pabi;
-	float *sbty;
-	unsigned int *sbtyflags;
-	float *sss;
-	unsigned char *sssflags;
-	AuxBeamInfo *sabi;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_mr1v2001_struct *) store_ptr;
-
-	/* get pointers */
-	header = &(store->header);
-	ping = &(store->ping);
-	pingport = &(ping->png_sides[ACP_PORT]);
-	pingstbd = &(ping->png_sides[ACP_STBD]);
-	pingdata = &(store->pingdata);
-	pbty = (float *)(pingdata->pd_bty[ACP_PORT]);
-	pbtyflags = (unsigned int *)(pingdata->pd_btyflags[ACP_PORT]);
-	pss = (float *)(pingdata->pd_ss[ACP_PORT]);
-	pssflags = (unsigned char *)(pingdata->pd_ssflags[ACP_PORT]);
-	pabi = (AuxBeamInfo *)(pingdata->pd_abi[ACP_PORT]);
-	sbty = (float *)(pingdata->pd_bty[ACP_STBD]);
-	sbtyflags = (unsigned int *)(pingdata->pd_btyflags[ACP_STBD]);
-	sss = (float *)(pingdata->pd_ss[ACP_STBD]);
-	sssflags = (unsigned char *)(pingdata->pd_ssflags[ACP_STBD]);
-	sabi = (AuxBeamInfo *)(pingdata->pd_abi[ACP_STBD]);
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-
-		/* get time */
-		*time_d = ping->png_tm.tv_sec + 0.000001 * ping->png_tm.tv_usec;
-		mb_get_date(verbose,*time_d,time_i);
-
-		/* get navigation */
-		if (!mbbs_isnand(ping->png_tlon)
-			&& !mbbs_isnand(ping->png_tlon))
-			{
-			*navlon = ping->png_tlon;
-			*navlat = ping->png_tlat;
-			}
-		else if (!mbbs_isnand(ping->png_slon)
-			&& !mbbs_isnand(ping->png_slon))
-			{
-			*navlon = ping->png_slon;
-			*navlat = ping->png_slat;
-			}
-		else
-			{
-			*navlon = 0.0;
-			*navlat = 0.0;
-			}
-
-		/* get heading */
-		if (!mbbs_isnand(store->ping.png_compass.sns_repval))
-			{
-			*heading = store->ping.png_compass.sns_repval;
-			if (!mbbs_isnand(store->ping.png_magcorr))
-				*heading += store->ping.png_magcorr;
-			}
-		else if (!mbbs_isnand(ping->png_tcourse))
-			*heading = ping->png_tcourse;
-		if (*heading < 0.0)
-			*heading += 360.0;
-		if (*heading >= 360.0)
-			*heading -= 360.0;
-
-		/* set speed to zero */
-		*speed = 0.0;
-
-		/* get draft */
-		*draft = ping->png_depth.sns_repval;
-
-		/* get roll pitch and heave */
-		*roll = ping->png_roll.sns_repval;
-		*pitch = ping->png_pitch.sns_repval;
-		*heave = 0.0;
-
-		/* print debug statements */
-		if (verbose >= 5)
-			{
-			fprintf(stderr,"\ndbg4  Data extracted by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  Extracted values:\n");
-			fprintf(stderr,"dbg4       kind:       %d\n",
-				*kind);
-			fprintf(stderr,"dbg4       error:      %d\n",
-				*error);
-			fprintf(stderr,"dbg4       time_i[0]:  %d\n",
-				time_i[0]);
-			fprintf(stderr,"dbg4       time_i[1]:  %d\n",
-				time_i[1]);
-			fprintf(stderr,"dbg4       time_i[2]:  %d\n",
-				time_i[2]);
-			fprintf(stderr,"dbg4       time_i[3]:  %d\n",
-				time_i[3]);
-			fprintf(stderr,"dbg4       time_i[4]:  %d\n",
-				time_i[4]);
-			fprintf(stderr,"dbg4       time_i[5]:  %d\n",
-				time_i[5]);
-			fprintf(stderr,"dbg4       time_i[6]:  %d\n",
-				time_i[6]);
-			fprintf(stderr,"dbg4       time_d:     %f\n",
-				*time_d);
-			fprintf(stderr,"dbg4       longitude:  %f\n",
-				*navlon);
-			fprintf(stderr,"dbg4       latitude:   %f\n",
-				*navlat);
-			fprintf(stderr,"dbg4       speed:      %f\n",
-				*speed);
-			fprintf(stderr,"dbg4       heading:    %f\n",
-				*heading);
-			fprintf(stderr,"dbg4       draft:      %f\n",
-				*draft);
-			fprintf(stderr,"dbg4       roll:       %f\n",
-				*roll);
-			fprintf(stderr,"dbg4       pitch:      %f\n",
-				*pitch);
-			fprintf(stderr,"dbg4       heave:      %f\n",
-				*heave);
-			}
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind == MB_DATA_DATA)
-		{
-		fprintf(stderr,"dbg2       time_i[0]:     %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:     %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:     %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:     %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:     %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:     %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:     %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:        %f\n",*time_d);
-		fprintf(stderr,"dbg2       longitude:     %f\n",*navlon);
-		fprintf(stderr,"dbg2       latitude:      %f\n",*navlat);
-		fprintf(stderr,"dbg2       speed:         %f\n",*speed);
-		fprintf(stderr,"dbg2       heading:       %f\n",*heading);
-		fprintf(stderr,"dbg2       draft:         %f\n",*draft);
-		fprintf(stderr,"dbg2       roll:          %f\n",*roll);
-		fprintf(stderr,"dbg2       pitch:         %f\n",*pitch);
-		fprintf(stderr,"dbg2       heave:         %f\n",*heave);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_mr1v2001_insert_nav(int verbose, void *mbio_ptr, void *store_ptr,
-		int time_i[7], double time_d,
-		double navlon, double navlat,
-		double speed, double heading, double draft,
-		double roll, double pitch, double heave,
-		int *error)
-{
-	char	*function_name = "mbsys_mr1v2001_insert_nav";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_mr1v2001_struct *store;
-	BSFile *header;
-	Ping *ping;
-	PingSide *pingport;
-	PingSide *pingstbd;
-	PingData *pingdata;
-	float *pbty;
-	unsigned int *pbtyflags;
-	float *pss;
-	unsigned char *pssflags;
-	AuxBeamInfo *pabi;
-	float *sbty;
-	unsigned int *sbtyflags;
-	float *sss;
-	unsigned char *sssflags;
-	AuxBeamInfo *sabi;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       time_i[0]:  %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:  %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:  %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:  %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:  %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:  %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:  %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:     %f\n",time_d);
-		fprintf(stderr,"dbg2       navlon:     %f\n",navlon);
-		fprintf(stderr,"dbg2       navlat:     %f\n",navlat);
-		fprintf(stderr,"dbg2       speed:      %f\n",speed);
-		fprintf(stderr,"dbg2       heading:    %f\n",heading);
-		fprintf(stderr,"dbg2       draft:      %f\n",draft);
-		fprintf(stderr,"dbg2       roll:       %f\n",roll);
-		fprintf(stderr,"dbg2       pitch:      %f\n",pitch);
-		fprintf(stderr,"dbg2       heave:      %f\n",heave);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_mr1v2001_struct *) store_ptr;
-
-	/* get pointers */
-	header = &(store->header);
-	ping = &(store->ping);
-	pingport = &(ping->png_sides[ACP_PORT]);
-	pingstbd = &(ping->png_sides[ACP_STBD]);
-	pingdata = &(store->pingdata);
-	pbty = (float *)(pingdata->pd_bty[ACP_PORT]);
-	pbtyflags = (unsigned int *)(pingdata->pd_btyflags[ACP_PORT]);
-	pss = (float *)(pingdata->pd_ss[ACP_PORT]);
-	pssflags = (unsigned char *)(pingdata->pd_ssflags[ACP_PORT]);
-	pabi = (AuxBeamInfo *)(pingdata->pd_abi[ACP_PORT]);
-	sbty = (float *)(pingdata->pd_bty[ACP_STBD]);
-	sbtyflags = (unsigned int *)(pingdata->pd_btyflags[ACP_STBD]);
-	sss = (float *)(pingdata->pd_ss[ACP_STBD]);
-	sssflags = (unsigned char *)(pingdata->pd_ssflags[ACP_STBD]);
-	sabi = (AuxBeamInfo *)(pingdata->pd_abi[ACP_STBD]);
-
-	/* insert data in structure */
-	if (store->kind == MB_DATA_DATA)
-		{
-		/* get time */
-		ping->png_tm.tv_sec = (int) time_d;
-		ping->png_tm.tv_usec = (int) 1000000.0*(time_d - ping->png_tm.tv_sec);
-
-		/* get navigation */
-		if (navlon < 0.0) navlon = navlon + 360.0;
-		ping->png_tlon = navlon;
-		ping->png_tlat = navlat;
-
-		/* get heading */
-		store->ping.png_compass.sns_repval = heading;
-		if (!mbbs_isnand(store->ping.png_magcorr))
-			store->ping.png_compass.sns_repval -= store->ping.png_magcorr;
-
-		/* get speed */
-
-		/* get draft */
-		ping->png_depth.sns_repval = draft;
-
-		/* get roll pitch and heave */
-		ping->png_roll.sns_repval = roll;
-		ping->png_pitch.sns_repval = pitch;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_mr1v2001_copy(int verbose, void *mbio_ptr,
-			void *store_ptr, void *copy_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_mr1v2001_copy";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_mr1v2001_struct *store;
-	struct mbsys_mr1v2001_struct *copy;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       copy_ptr:   %p\n",(void *)copy_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointers */
-	store = (struct mbsys_mr1v2001_struct *) store_ptr;
-	copy = (struct mbsys_mr1v2001_struct *) copy_ptr;
-
-	/* copy the data */
-	copy->kind = store->kind;
-	copy->header.bsf_version = store->header.bsf_version;
-	copy->header.bsf_count = store->header.bsf_count;
-	if (copy->header.bsf_log != NULL)
-		free(copy->header.bsf_log);
-	if (copy->header.bsf_count > 0)
-		{
-		copy->header.bsf_log
-			= (char *) calloc((MemSizeType) (copy->header.bsf_count+1),
-					sizeof(char));
-		if (copy->header.bsf_log != NULL)
-			{
-			memcpy(copy->header.bsf_log,
-				store->header.bsf_log,
-				copy->header.bsf_count);
-			copy->header.bsf_log[copy->header.bsf_count] = '\0';
-			}
-		else
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_MEMORY_FAIL;
-			}
-		}
-	copy->ping = store->ping;
-	copy->bsbuffersize = store->bsbuffersize;
-	if (mbbs_pngrealloc(&(copy->ping), &(copy->bsbuffer), &(copy->bsbuffersize))
-		== BS_SUCCESS)
-		{
-		status = MB_SUCCESS;
-		*error = MB_ERROR_NO_ERROR;
-		memcpy(copy->bsbuffer,store->bsbuffer,copy->bsbuffersize);
-		mbbs_getpngdataptrs(&(copy->ping), copy->bsbuffer,
-					&(copy->pingdata));
-		}
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_MEMORY_FAIL;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mbsys_mr1v2001.h b/src/mbio/mbsys_mr1v2001.h
deleted file mode 100644
index 08da5cc..0000000
--- a/src/mbio/mbsys_mr1v2001.h
+++ /dev/null
@@ -1,151 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbsys_mr1v2001.h	3/6/2003
- *	$Id: mbsys_mr1v2001.h 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 2003-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbsys_mr1v2001.h defines the data structures used by MBIO functions
- * to store interferometry sonard data processed by the Hawaii Mapping
- * Research Group. This includes data from the MR1, SCAMP, and WHOI
- * DSL 120
- *.
- * The data formats associated with mbsys_mr1v2001 are:
- *      MBF_MR1PRVR2 : MBIO ID 64
- *
- * Author:	D. W. Caress
- * Date:	March 6, 2003
- * $Log: mbsys_mr1v2001.h,v $
- * Revision 5.1  2005/11/05 00:48:03  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.0  2003/03/10 20:03:59  caress
- * Initial version.
- *
- *
- *
- */
-/*
- * Notes on the MBSYS_MR1V2001 data structure:
- *   1. The MR1 post processing format uses the xdr external
- *      data representation for portability.
- *   2. The data stream consists of a file header followed
- *      by individual pings.
- *   3. The file header contains a comment string and the
- *      number of pings. The comment string is broken up
- *      into multiple comments by MBIO on reading; the comments
- *      are concatenated into a single string on writing.
- *   4. The pings each contain a header plus the bathymetry and/or
- *      sidescan data.
- *   6. The data structure defined below includes all of the values
- *      which are passed in the MR1 post processing format.
- *   7. This code pertains to the post-2001 version of the MR1 format.
- *   8. This format is used for data processed by HMRG, including
- *      data from the MR1, SCAMP, and WHOI DSL 120.
- */
-
-/* get MBBS library header file */
-#ifndef __MBBS__
-#include "mbbs.h"
-#endif
-
-/* maximum number of bathymetry beams per side for MR1 */
-#define MBSYS_MR1V2001_BEAMS_SIDE 1500
-
-/* maximum number of sidescan pixels per side for MR1 */
-#define MBSYS_MR1V2001_PIXELS_SIDE 3500
-
-/* maximum number of bathymetry beams for MR1 */
-#define MBSYS_MR1V2001_BEAMS (2*MBSYS_MR1V2001_BEAMS_SIDE + 3)
-
-/* maximum number of sidescan pixels output for MR1 */
-#define MBSYS_MR1V2001_PIXELS (2*MBSYS_MR1V2001_PIXELS_SIDE + 3)
-
-/* maximum length of comment */
-#define	MBSYS_MR1V2001_MAXLINE 256
-
-/* angle from vertical of MR1 transducers */
-#define	MBSYS_MR1V2001_XDUCER_ANGLE 50.0
-
-struct mbsys_mr1v2001_struct
-	{
-	/* type of data record */
-	int	kind;
-
-	/* file header info */
-	BSFile header;
-
-	/* ping */
-	Ping 	ping;
-
-	/* data buffer */
-	unsigned int	bsbuffersize;
-	void 	*bsbuffer;
-
-	/* PingData including sensors */
-	PingData    pingdata;
-
-	/* comment */
-	char	comment[MBSYS_MR1V2001_MAXLINE];
-};
-
-
-/* system specific function prototypes */
-int mbsys_mr1v2001_alloc(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error);
-int mbsys_mr1v2001_deall(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error);
-int mbsys_mr1v2001_dimensions(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int *nbath, int *namp, int *nss, int *error);
-int mbsys_mr1v2001_extract(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int time_i[7], double *time_d,
-			double *navlon, double *navlat,
-			double *speed, double *heading,
-			int *nbath, int *namp, int *nss,
-			char *beamflag, double *bath, double *amp,
-			double *bathacrosstrack, double *bathalongtrack,
-			double *ss, double *ssacrosstrack, double *ssalongtrack,
-			char *comment, int *error);
-int mbsys_mr1v2001_insert(int verbose, void *mbio_ptr, void *store_ptr,
-			int kind, int time_i[7], double time_d,
-			double navlon, double navlat,
-			double speed, double heading,
-			int nbath, int namp, int nss,
-			char *beamflag, double *bath, double *amp,
-			double *bathacrosstrack, double *bathalongtrack,
-			double *ss, double *ssacrosstrack, double *ssalongtrack,
-			char *comment, int *error);
-int mbsys_mr1v2001_ttimes(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int *nbeams,
-			double *ttimes, double *angles,
-			double *angles_forward, double *angles_null,
-			double *heave, double *alongtrack_offset,
-			double *draft, double *ssv, int *error);
-int mbsys_mr1v2001_detects(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int *nbeams, int *detects, int *error);
-int mbsys_mr1v2001_extract_altitude(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, double *transducer_depth, double *altitude,
-			int *error);
-int mbsys_mr1v2001_extract_nav(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int time_i[7], double *time_d,
-			double *navlon, double *navlat,
-			double *speed, double *heading, double *draft,
-			double *roll, double *pitch, double *heave,
-			int *error);
-int mbsys_mr1v2001_insert_nav(int verbose, void *mbio_ptr, void *store_ptr,
-			int time_i[7], double time_d,
-			double navlon, double navlat,
-			double speed, double heading, double draft,
-			double roll, double pitch, double heave,
-			int *error);
-int mbsys_mr1v2001_copy(int verbose, void *mbio_ptr,
-			void *store_ptr, void *copy_ptr,
-			int *error);
diff --git a/src/mbio/mbsys_mstiff.c b/src/mbio/mbsys_mstiff.c
deleted file mode 100644
index 6417ee1..0000000
--- a/src/mbio/mbsys_mstiff.c
+++ /dev/null
@@ -1,986 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbsys_mstiff.c	4/10/98
- *	$Id: mbsys_mstiff.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1998-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbsys_mstiff.c contains the functions for handling the data structure
- * used by MBIO functions to store  sidescan data read from the
- * MBF_MSTIFFSS format (MBIO id 131).
- *
- * Author:	D. W. Caress
- * Date:	April 10,  1998
- * $Log: mbsys_mstiff.c,v $
- * Revision 5.6  2005/11/05 00:48:05  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.5  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.4  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.3  2001/08/25 00:54:13  caress
- * Adding beamwidth values to extract functions.
- *
- * Revision 5.2  2001/07/20  00:32:54  caress
- * Release 5.0.beta03
- *
- * Revision 5.1  2001/01/22  07:43:34  caress
- * Version 5.0.beta01
- *
- * Revision 5.0  2000/12/01  22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.2  2000/10/11  01:03:21  caress
- * Convert to ANSI C
- *
- * Revision 4.1  2000/09/30  06:32:52  caress
- * Snapshot for Dale.
- *
- * Revision 4.0  1998/10/05  19:16:02  caress
- * MB-System version 4.6beta
- *
- * Revision 1.1  1998/10/05  18:32:27  caress
- * Initial revision
- *
- * Revision 1.1  1998/10/05  18:22:40  caress
- * Initial revision
- *
- * Revision 1.1  1998/10/05  17:46:15  caress
- * Initial revision
- *
- *
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mb_define.h"
-#include "mbsys_mstiff.h"
-
-static char rcs_id[]="$Id: mbsys_mstiff.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mbsys_mstiff_alloc(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_mstiff_alloc";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* allocate memory for data structure */
-	status = mb_malloc(verbose,sizeof(struct mbsys_mstiff_struct),
-				store_ptr,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)*store_ptr);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_mstiff_deall(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_mstiff_deall";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)*store_ptr);
-		}
-
-	/* deallocate memory for data structure */
-	status = mb_free(verbose,store_ptr,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_mstiff_dimensions(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int *nbath, int *namp, int *nss, int *error)
-{
-	char	*function_name = "mbsys_mstiff_dimensions";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_mstiff_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_mstiff_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = MB_DATA_DATA;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get beam and pixel numbers */
-		*nbath = 0;
-		*namp = 0;
-		*nss = store->pixels_ss;
-		}
-	else
-		{
-		/* get beam and pixel numbers */
-		*nbath = 0;
-		*namp = 0;
-		*nss = 0;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		fprintf(stderr,"dbg2       nbath:      %d\n",*nbath);
-		fprintf(stderr,"dbg2        namp:      %d\n",*namp);
-		fprintf(stderr,"dbg2        nss:       %d\n",*nss);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_mstiff_extract(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int time_i[7], double *time_d,
-		double *navlon, double *navlat,
-		double *speed, double *heading,
-		int *nbath, int *namp, int *nss,
-		char *beamflag, double *bath, double *amp,
-		double *bathacrosstrack, double *bathalongtrack,
-		double *ss, double *ssacrosstrack, double *ssalongtrack,
-		char *comment, int *error)
-{
-	char	*function_name = "mbsys_mstiff_extract";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_mstiff_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_mstiff_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = MB_DATA_DATA;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get time */
-		*time_d = store->time_d;
-		mb_get_date(verbose, *time_d, time_i);
-
-		/* get navigation */
-		*navlon = store->lon;
-		*navlat = store->lat;
-
-		/* get heading */
-		*heading = store->heading;
-
-		/* get speed */
-		*speed =store->speed;
-
-		/* set beamwidths in mb_io structure */
-		mb_io_ptr->beamwidth_ltrack = 0.0;
-		mb_io_ptr->beamwidth_xtrack = 0.0;
-
-		/* read distance and depth values into storage arrays */
-		*nbath = 0;
-		*namp = 0;
-		*nss = store->pixels_ss;
-		for (i=0;i<*nss;i++)
-			{
-			ss[i] = store->ss[i];
-			ssacrosstrack[i] =
-				store->ssacrosstrack[i];
-			ssalongtrack[i] = 0.0;
-			}
-
-		/* print debug statements */
-		if (verbose >= 5)
-			{
-			fprintf(stderr,"\ndbg4  Data extracted by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  Extracted values:\n");
-			fprintf(stderr,"dbg4       kind:       %d\n",
-				*kind);
-			fprintf(stderr,"dbg4       error:      %d\n",
-				*error);
-			fprintf(stderr,"dbg4       time_i[0]:  %d\n",
-				time_i[0]);
-			fprintf(stderr,"dbg4       time_i[1]:  %d\n",
-				time_i[1]);
-			fprintf(stderr,"dbg4       time_i[2]:  %d\n",
-				time_i[2]);
-			fprintf(stderr,"dbg4       time_i[3]:  %d\n",
-				time_i[3]);
-			fprintf(stderr,"dbg4       time_i[4]:  %d\n",
-				time_i[4]);
-			fprintf(stderr,"dbg4       time_i[5]:  %d\n",
-				time_i[5]);
-			fprintf(stderr,"dbg4       time_i[6]:  %d\n",
-				time_i[6]);
-			fprintf(stderr,"dbg4       time_d:     %f\n",
-				*time_d);
-			fprintf(stderr,"dbg4       longitude:  %f\n",
-				*navlon);
-			fprintf(stderr,"dbg4       latitude:   %f\n",
-				*navlat);
-			fprintf(stderr,"dbg4       speed:      %f\n",
-				*speed);
-			fprintf(stderr,"dbg4       heading:    %f\n",
-				*heading);
-			fprintf(stderr,"dbg4       nbath:      %d\n",
-				*nbath);
-			for (i=0;i<*nbath;i++)
-			  fprintf(stderr,"dbg4       beam:%4d  flag:%3d  bath:%f  bathdist:%f\n",
-				i,beamflag[i],bath[i],
-				bathacrosstrack[i]);
-			fprintf(stderr,"dbg4        nss:      %d\n",
-				*nss);
-			for (i=0;i<*nss;i++)
-			  fprintf(stderr,"dbg4        beam:%d   ss:%f  acrosstrack:%f  alongtrack:%f\n",
-				i,ss[i],ssacrosstrack[i],ssalongtrack[i]);
-			}
-
-		/* done translating values */
-
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind != MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"dbg2       time_i[0]:     %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:     %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:     %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:     %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:     %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:     %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:     %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:        %f\n",*time_d);
-		fprintf(stderr,"dbg2       longitude:     %f\n",*navlon);
-		fprintf(stderr,"dbg2       latitude:      %f\n",*navlat);
-		fprintf(stderr,"dbg2       speed:         %f\n",*speed);
-		fprintf(stderr,"dbg2       heading:       %f\n",*heading);
-		}
-	if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind == MB_DATA_DATA)
-		{
-		fprintf(stderr,"dbg2       nbath:         %d\n",*nbath);
-		for (i=0;i<*nbath;i++)
-		  fprintf(stderr,"dbg2       beam:%4d  flag:%3d  bath:%f  bathdist:%f\n",
-			i,beamflag[i],bath[i],
-			bathacrosstrack[i]);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_mstiff_insert(int verbose, void *mbio_ptr, void *store_ptr,
-		int kind, int time_i[7], double time_d,
-		double navlon, double navlat,
-		double speed, double heading,
-		int nbath, int namp, int nss,
-		char *beamflag, double *bath, double *amp,
-		double *bathacrosstrack, double *bathalongtrack,
-		double *ss, double *ssacrosstrack, double *ssalongtrack,
-		char *comment, int *error)
-{
-	char	*function_name = "mbsys_mstiff_insert";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_mstiff_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       kind:       %d\n",kind);
-		}
-	if (verbose >= 2 && (kind == MB_DATA_DATA || kind == MB_DATA_NAV))
-		{
-		fprintf(stderr,"dbg2       time_i[0]:  %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:  %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:  %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:  %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:  %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:  %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:  %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:     %f\n",time_d);
-		fprintf(stderr,"dbg2       navlon:     %f\n",navlon);
-		fprintf(stderr,"dbg2       navlat:     %f\n",navlat);
-		fprintf(stderr,"dbg2       speed:      %f\n",speed);
-		fprintf(stderr,"dbg2       heading:    %f\n",heading);
-		}
-	if (verbose >= 2 && kind == MB_DATA_DATA)
-		{
-		fprintf(stderr,"dbg2       nbath:      %d\n",nbath);
-		if (verbose >= 3)
-		 for (i=0;i<nbath;i++)
-		  fprintf(stderr,"dbg3       beam:%4d  flag:%3d  bath:%f  bathdist:%f\n",
-			i,beamflag[i],bath[i],
-			bathacrosstrack[i]);
-		fprintf(stderr,"dbg2       namp:       %d\n",namp);
-		if (verbose >= 3)
-		 for (i=0;i<namp;i++)
-		  fprintf(stderr,"dbg3        amp[%d]: %f\n",
-			i,amp[i]);
-		fprintf(stderr,"dbg2        nss:       %d\n",nss);
-		if (verbose >= 3)
-		 for (i=0;i<nss;i++)
-		  fprintf(stderr,"dbg3        ss[%d]: %f    ssdist[%d]: %f\n",
-			i,ss[i],i,ssacrosstrack[i]);
-		}
-	if (verbose >= 2 && kind == MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"dbg2       comment:     \ndbg2       %s\n",
-			comment);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_mstiff_struct *) store_ptr;
-
-	/* insert survey data in structure */
-	if (kind == MB_DATA_DATA)
-		{
-		/* get time */
-		store->time_d = time_d;
-
-		/* get navigation */
-		if (navlon < 180.0) navlon = navlon + 360.0;
-		if (navlon > 180.0) navlon = navlon - 360.0;
-		store->lon = navlon;
-		store->lat = navlat;
-
-		/* get heading and speed */
-		store->heading = heading;
-		store->speed = speed;
-
-		/* put sidescan values
-			into data structure */
-		store->pixels_ss = nss;
-		for (i=0;i<nss;i++)
-		    {
-		    store->ss[i] = ss[i];
-		    store->ssacrosstrack[i] = ssacrosstrack[i];
-		    }
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_mstiff_ttimes(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, int *nbeams,
-	double *ttimes, double *angles,
-	double *angles_forward, double *angles_null,
-	double *heave, double *alongtrack_offset,
-	double *draft, double *ssv, int *error)
-{
-	char	*function_name = "mbsys_mstiff_ttimes";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_mstiff_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       ttimes:     %p\n",(void *)ttimes);
-		fprintf(stderr,"dbg2       angles_xtrk:%p\n",(void *)angles);
-		fprintf(stderr,"dbg2       angles_ltrk:%p\n",(void *)angles_forward);
-		fprintf(stderr,"dbg2       angles_null:%p\n",(void *)angles_null);
-		fprintf(stderr,"dbg2       heave:      %p\n",(void *)heave);
-		fprintf(stderr,"dbg2       ltrk_off:   %p\n",(void *)alongtrack_offset);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_mstiff_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = MB_DATA_DATA;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get nbeams */
-		*nbeams = 0;
-
-		/* get ssv */
-		*ssv = 0.0;
-		*draft = 0.0;
-
-		/* set status */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-
-		/* done translating values */
-
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error == MB_ERROR_NO_ERROR)
-		{
-		fprintf(stderr,"dbg2       draft:      %f\n",*draft);
-		fprintf(stderr,"dbg2       ssv:        %f\n",*ssv);
-		fprintf(stderr,"dbg2       nbeams:     %d\n",*nbeams);
-		for (i=0;i<*nbeams;i++)
-			fprintf(stderr,"dbg2       beam %d: tt:%f  angle_xtrk:%f  angle_ltrk:%f  angle_null:%f  depth_off:%f  ltrk_off:%f\n",
-				i,ttimes[i],angles[i],
-				angles_forward[i],angles_null[i],
-				heave[i],alongtrack_offset[i]);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_mstiff_detects(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, int *nbeams,
-	int *detects, int *error)
-{
-	char	*function_name = "mbsys_mstiff_detects";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_mstiff_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       detects:    %p\n",(void *)detects);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_mstiff_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = MB_DATA_DATA;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get nbeams */
-		*nbeams = 0;
-
-		/* set status */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error == MB_ERROR_NO_ERROR)
-		{
-		fprintf(stderr,"dbg2       nbeams:     %d\n",*nbeams);
-		for (i=0;i<*nbeams;i++)
-			fprintf(stderr,"dbg2       beam %d: detects:%d\n",
-				i,detects[i]);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_mstiff_extract_altitude(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, double *transducer_depth, double *altitude,
-	int *error)
-{
-	char	*function_name = "mbsys_mstiff_extract_altitude";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_mstiff_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_mstiff_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = MB_DATA_DATA;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		*transducer_depth = 0.0;
-		*altitude = store->altitude;
-
-		/* set status */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-
-		/* done translating values */
-
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:              %d\n",*kind);
-		fprintf(stderr,"dbg2       transducer_depth:  %f\n",*transducer_depth);
-		fprintf(stderr,"dbg2       altitude:          %f\n",*altitude);
-		fprintf(stderr,"dbg2       error:             %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:            %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_mstiff_extract_nav(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int time_i[7], double *time_d,
-		double *navlon, double *navlat,
-		double *speed, double *heading, double *draft,
-		double *roll, double *pitch, double *heave,
-		int *error)
-{
-	char	*function_name = "mbsys_mstiff_extract_nav";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_mstiff_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_mstiff_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = MB_DATA_DATA;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get time */
-		*time_d = store->time_d;
-		mb_get_date(verbose, *time_d, time_i);
-
-		/* get navigation */
-		*navlon = store->lon;
-		*navlat = store->lat;
-
-		/* get heading */
-		*heading = store->heading;
-
-		/* get speed */
-		*speed = store->speed;
-
-		/* get draft */
-		*draft = 0.0;
-
-		/* get roll pitch and heave */
-		*roll = 0.0;
-		*pitch = 0.0;
-		*heave = 0.0;
-
-		/* print debug statements */
-		if (verbose >= 5)
-			{
-			fprintf(stderr,"\ndbg4  Data extracted by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  Extracted values:\n");
-			fprintf(stderr,"dbg4       kind:       %d\n",
-				*kind);
-			fprintf(stderr,"dbg4       error:      %d\n",
-				*error);
-			fprintf(stderr,"dbg4       time_i[0]:  %d\n",
-				time_i[0]);
-			fprintf(stderr,"dbg4       time_i[1]:  %d\n",
-				time_i[1]);
-			fprintf(stderr,"dbg4       time_i[2]:  %d\n",
-				time_i[2]);
-			fprintf(stderr,"dbg4       time_i[3]:  %d\n",
-				time_i[3]);
-			fprintf(stderr,"dbg4       time_i[4]:  %d\n",
-				time_i[4]);
-			fprintf(stderr,"dbg4       time_i[5]:  %d\n",
-				time_i[5]);
-			fprintf(stderr,"dbg4       time_i[6]:  %d\n",
-				time_i[6]);
-			fprintf(stderr,"dbg4       time_d:     %f\n",
-				*time_d);
-			fprintf(stderr,"dbg4       longitude:  %f\n",
-				*navlon);
-			fprintf(stderr,"dbg4       latitude:   %f\n",
-				*navlat);
-			fprintf(stderr,"dbg4       speed:      %f\n",
-				*speed);
-			fprintf(stderr,"dbg4       heading:    %f\n",
-				*heading);
-			fprintf(stderr,"dbg4       draft:      %f\n",
-				*draft);
-			fprintf(stderr,"dbg4       roll:       %f\n",
-				*roll);
-			fprintf(stderr,"dbg4       pitch:      %f\n",
-				*pitch);
-			fprintf(stderr,"dbg4       heave:      %f\n",
-				*heave);
-			}
-
-		/* done translating values */
-
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR)
-		{
-		fprintf(stderr,"dbg2       time_i[0]:     %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:     %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:     %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:     %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:     %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:     %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:     %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:        %f\n",*time_d);
-		fprintf(stderr,"dbg2       longitude:     %f\n",*navlon);
-		fprintf(stderr,"dbg2       latitude:      %f\n",*navlat);
-		fprintf(stderr,"dbg2       speed:         %f\n",*speed);
-		fprintf(stderr,"dbg2       heading:       %f\n",*heading);
-		fprintf(stderr,"dbg2       draft:         %f\n",*draft);
-		fprintf(stderr,"dbg2       roll:          %f\n",*roll);
-		fprintf(stderr,"dbg2       pitch:         %f\n",*pitch);
-		fprintf(stderr,"dbg2       heave:         %f\n",*heave);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_mstiff_insert_nav(int verbose, void *mbio_ptr, void *store_ptr,
-		int time_i[7], double time_d,
-		double navlon, double navlat,
-		double speed, double heading, double draft,
-		double roll, double pitch, double heave,
-		int *error)
-{
-	char	*function_name = "mbsys_mstiff_insert_nav";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_mstiff_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       time_i[0]:  %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:  %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:  %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:  %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:  %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:  %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:  %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:     %f\n",time_d);
-		fprintf(stderr,"dbg2       navlon:     %f\n",navlon);
-		fprintf(stderr,"dbg2       navlat:     %f\n",navlat);
-		fprintf(stderr,"dbg2       speed:      %f\n",speed);
-		fprintf(stderr,"dbg2       heading:    %f\n",heading);
-		fprintf(stderr,"dbg2       draft:      %f\n",draft);
-		fprintf(stderr,"dbg2       roll:       %f\n",roll);
-		fprintf(stderr,"dbg2       pitch:      %f\n",pitch);
-		fprintf(stderr,"dbg2       heave:      %f\n",heave);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_mstiff_struct *) store_ptr;
-
-	/* insert data in structure */
-	/* get time */
-	store->time_d = time_d;
-
-	/* get navigation */
-	if (navlon < 180.0) navlon = navlon + 360.0;
-	if (navlon > 180.0) navlon = navlon - 360.0;
-	store->lon = navlon;
-	store->lat = navlat;
-
-	/* get heading and speed */
-	store->heading = heading;
-	store->speed = speed;
-
-	/* get draft */
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_mstiff_copy(int verbose, void *mbio_ptr,
-			void *store_ptr, void *copy_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_mstiff_copy";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_mstiff_struct *store;
-	struct mbsys_mstiff_struct *copy;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       copy_ptr:   %p\n",(void *)copy_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointers */
-	store = (struct mbsys_mstiff_struct *) store_ptr;
-	copy = (struct mbsys_mstiff_struct *) copy_ptr;
-
-	/* copy the data */
-	*copy = *store;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mbsys_mstiff.h b/src/mbio/mbsys_mstiff.h
deleted file mode 100644
index 14b7206..0000000
--- a/src/mbio/mbsys_mstiff.h
+++ /dev/null
@@ -1,222 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbsys_mstiff.h	4/10/98
- *	$Id: mbsys_mstiff.h 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1998-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbsys_mstiff.h  defines the data structure used by MBIO functions
- * to store sidescan data read from the MBF_MSTIFFSS format (MBIO id 131).
- *
- * Author:	D. W. Caress
- * Date:	April 10, 1988
- * $Log: mbsys_mstiff.h,v $
- * Revision 5.6  2005/11/05 00:48:03  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.5  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.4  2003/01/15 20:51:48  caress
- * Release 5.0.beta28
- *
- * Revision 5.3  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.2  2001/07/20 00:32:54  caress
- * Release 5.0.beta03
- *
- * Revision 5.1  2001/01/22  07:43:34  caress
- * Version 5.0.beta01
- *
- * Revision 5.0  2000/12/01  22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.1  2000/09/30  06:31:19  caress
- * Snapshot for Dale.
- *
- * Revision 4.0  1998/10/05  18:30:03  caress
- * MB-System version 4.6beta
- *
- * Revision 1.1  1998/10/05  18:22:40  caress
- * Initial revision
- *
- * Revision 1.1  1998/10/05  17:46:15  caress
- * Initial revision
- *
-*
- *
- */
-/*
- * Notes on the MBSYS_MSTIFF data structure:
- *   1. The MSTIFF data format is used to store raw sidescan data from
- *      Sea Scan sidescan sonars. This format is a variant of
- *      the TIFF image format with navigation and other information
- *      embedded within the file.
- *   2. The file structure consists of a bunch of pointers to
- *      data objects at various arbitrary locations within the
- *      file. The header contains a pointer to the location of
- *      the "image file directory", which in turn contains
- *      pointers to the locations of data arrays within the file.
- *   3. As far as MB-System is concerned,  this is a read-only
- *      data format.
- *   4. The raw sidescan data in the file consists of 1000 pings.
- *      Each ping produces two 512 sample arrays - one for
- *      each side (port and starboard).
- *   5. The sidescan data is not slant range corrected - the
- *      bottom detect and slant range correction is done on
- *      input by MBIO. The data stored internally by MBIO
- *      is slant range corrected.
- *   6. The MSTIFF files contain lots of information not used by
- *      MBIO,  including images of the data derived from a
- *      realtime display.
- *   7. Comments are not supported in this format.
- *   8. Each of the possible data fields is identified by a
- *      unique tag:
- *          Tag        Field Type                Default
- *          ---        ----------                -------
- *          273        Annotation
- *          272        AnnotationCount
- *          279        Annotation2
- *          278        Annotation2Count
- *          281        Annotation3
- *          280        Annotation3Count
- *          260        BinsPerChannel
- *          258        BitsPerBin                8 bits per sample (2 MSB = 0)
- *          254        Compression               1 (no compression)
- *          255        CondensedImage
- *          301        CreatorVersion
- *          256        Description
- *          287        Fathometer
- *          296        Fathometer2
- *          286        FathometerCount
- *          257        History
- *          263        LeftChannel
- *          299        LeftChannel2
- *          289        Magnetometer
- *          288        MagnetometerCount
- *          291        MagnetometerParms
- *          303        MagnetometerParms2
- *          269        Marker
- *          268        MarkerCount
- *          277        Marker2
- *          276        Marker2Count
- *          284        Marker3
- *          283        Marker3Count
- *          295        Marker4
- *          294        Marker4Count
- *          307        Marker5
- *          306        Marker5Count
- *          267        NavInfo
- *          275        NavInfo2
- *          282        NavInfo3
- *          293        NavInfo4
- *          297        NavInfo5
- *          308        NavInfo6
- *          266        NavInfoCount
- *          304        NavInterpolationTimeout
- *          274        PingNavInfo
- *          264        RightChannel
- *          300        RightChannel2
- *          261        ScrollDirection
- *          265        SonarDataInfo
- *          292        SonarDataInfo2
- *          298        SonarDataInfo3
- *          259        SonarLines
- *          271        SurveyPlotterImage
- *          270        SurveyPlotterParms
- *          290        SurveyPlotterParms2
- *          302        SurveyPlotterParms3
- *          305        SurveyPlotterParms4
- *          262        TimeCorrelation
- *          285        Y2KTimeCorrelation
- */
-
-/* number of sidescan pixels for Sea Scan sidescan sonars */
-#define MBSYS_MSTIFF_PIXELS	1024
-
-struct mbsys_mstiff_struct
-	{
-	/* time stamp */
-	double	time_d;		/* unix time */
-
-	/* position */
-	double	lat;		/* latitude in degrees */
-	double	lon;		/* longitude in degrees */
-
-	/* other values */
-	double	heading;	/* heading in degrees */
-	double	course;	    	/* course made good in degrees */
-	double	speed;		/* fore-aft speed in km/hr */
-	double	altitude;	/* altitude in m */
-	double	slant_range_max;    /* meters */
-	double	range_delay;	    /* meters */
-	double	sample_interval;    /* meters */
-	double	sonar_depth;	    /* sonar depth in meters */
-	double	frequency;    /* sonar frequency in Hz */
-
-	/* sidescan data */
-	int	pixels_ss;	/* number of pixels */
-	unsigned char	ss[MBSYS_MSTIFF_PIXELS];
-	double	ssacrosstrack[MBSYS_MSTIFF_PIXELS];
-	};
-
-/* system specific function prototypes */
-int mbsys_mstiff_alloc(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error);
-int mbsys_mstiff_deall(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error);
-int mbsys_mstiff_dimensions(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int *nbath, int *namp, int *nss, int *error);
-int mbsys_mstiff_extract(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int time_i[7], double *time_d,
-			double *navlon, double *navlat,
-			double *speed, double *heading,
-			int *nbath, int *namp, int *nss,
-			char *beamflag, double *bath, double *amp,
-			double *bathacrosstrack, double *bathalongtrack,
-			double *ss, double *ssacrosstrack, double *ssalongtrack,
-			char *comment, int *error);
-int mbsys_mstiff_insert(int verbose, void *mbio_ptr, void *store_ptr,
-			int kind, int time_i[7], double time_d,
-			double navlon, double navlat,
-			double speed, double heading,
-			int nbath, int namp, int nss,
-			char *beamflag, double *bath, double *amp,
-			double *bathacrosstrack, double *bathalongtrack,
-			double *ss, double *ssacrosstrack, double *ssalongtrack,
-			char *comment, int *error);
-int mbsys_mstiff_detects(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int *nbeams, int *detects, int *error);
-int mbsys_mstiff_ttimes(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int *nbeams,
-			double *ttimes, double *angles,
-			double *angles_forward, double *angles_null,
-			double *heave, double *alongtrack_offset,
-			double *draft, double *ssv, int *error);
-int mbsys_mstiff_extract_altitude(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, double *transducer_depth, double *altitude,
-			int *error);
-int mbsys_mstiff_extract_nav(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int time_i[7], double *time_d,
-			double *navlon, double *navlat,
-			double *speed, double *heading, double *draft,
-			double *roll, double *pitch, double *heave,
-			int *error);
-int mbsys_mstiff_insert_nav(int verbose, void *mbio_ptr, void *store_ptr,
-			int time_i[7], double time_d,
-			double navlon, double navlat,
-			double speed, double heading, double draft,
-			double roll, double pitch, double heave,
-			int *error);
-int mbsys_mstiff_copy(int verbose, void *mbio_ptr,
-			void *store_ptr, void *copy_ptr,
-			int *error);
diff --git a/src/mbio/mbsys_navnetcdf.c b/src/mbio/mbsys_navnetcdf.c
deleted file mode 100644
index b7513d9..0000000
--- a/src/mbio/mbsys_navnetcdf.c
+++ /dev/null
@@ -1,1777 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbsys_navnetcdf.c	4/11/2002
- *	$Id: mbsys_navnetcdf.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 2002-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbsys_navnetcdf.c includes the functions used by MBIO functions
- * to extract and insert data from the IFREMER netCDF multibeam format.
- * The MBIO format id is:
- *      MBF_NVNETCDF : MBIO ID 167
- *
- * Author:	D. W. Caress
- * Date:	April 11, 2002
- *
- * $Log: mbsys_navnetcdf.c,v $
- * Revision 5.8  2008/09/13 06:08:09  caress
- * Updates to apply suggested patches to segy handling. Also fixes to remove compiler warnings.
- *
- * Revision 5.7  2008/07/10 18:02:39  caress
- * Proceeding towards 5.1.1beta20.
- *
- * Revision 5.4  2008/05/16 22:56:24  caress
- * Release 5.1.1beta18.
- *
- * Revision 5.3  2005/11/05 00:48:05  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.2  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.1  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.0  2002/05/29 23:40:15  caress
- * Release 5.0.beta18
- *
-*
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mb_define.h"
-#include "mbsys_navnetcdf.h"
-
-static char rcs_id[]="$Id: mbsys_navnetcdf.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mbsys_navnetcdf_alloc(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_navnetcdf_alloc";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_navnetcdf_struct *store;
-	char	c;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* allocate memory for data structure */
-	status = mb_mallocd(verbose,__FILE__,__LINE__,sizeof(struct mbsys_navnetcdf_struct),
-				store_ptr,error);
-
-	/* get data structure pointer */
-	store = (struct mbsys_navnetcdf_struct *) *store_ptr;
-
-	/* now initialize everything */
-	if (status == MB_SUCCESS)
-	    {
-	    /* dimensions */
-	    store->mbHistoryRecNbr = 0 ;
-	    store->mbNameLength = MBSYS_NAVNETCDF_NAMELEN ;
-	    store->mbCommentLength = MBSYS_NAVNETCDF_COMMENTLEN ;
-	    store->mbPositionNbr = 0 ;
-
-	    /* global attributes */
-	    store->mbVersion = 108;
-	    strcpy(store->mbName, " ");
-	    strcpy(store->mbClasse, "MB_SWATH");
-	    store->mbLevel = 0;
-	    store->mbNbrHistoryRec = 0;
-	    strcpy(store->mbTimeReference, "Julian date for 1970/01/01 = 2 440 588");
-	    store->mbStartDate = 0;
-	    store->mbStartTime = 0;
-	    store->mbEndDate = 0;
-	    store->mbEndTime = 0;
-	    store->mbNorthLatitude = 0.;
-	    store->mbSouthLatitude = 0.;
-	    store->mbEastLongitude = 0.;
-	    store->mbWestLongitude = 0.;
-	    strcpy(store->mbMeridian180, " ");
-	    for (i=0;i<MBSYS_NAVNETCDF_ATTRIBUTELEN;i++)
-		{
-		if (i < MBSYS_NAVNETCDF_ATTRIBUTELEN-1)
-			c = ' ';
-		else
-			c = '\0';
-		store->mbGeoDictionnary[i] = c;
-		store->mbGeoRepresentation[i] = c;
-		store->mbGeodesicSystem[i] = c;
-		}
-	    store->mbEllipsoidA = 0.;
-	    store->mbEllipsoidInvF = 0.;
-	    store->mbEllipsoidE2 = 0.;
-	    store->mbProjType = -1;
-	    for (i=0;i<10;i++)
-		store->mbProjParameterValue[i] = 0.;
-	    store->mbPointCounter = 0;
-	    for (i=0;i<MBSYS_NAVNETCDF_COMMENTLEN-1;i++)
-		{
-		if (i < MBSYS_NAVNETCDF_COMMENTLEN-1)
-			c = ' ';
-		else
-			c = '\0';
-		store->mbEllipsoidName[i] = c;
-		store->mbProjParameterCode[i] = c;
-		store->mbShip[i] = c;
-		store->mbSurvey[i] = c;
-		store->mbReference[i] = c;
-		}
-
-	    /* variable attributes */
-	    strcpy(store->mbHistDate_type, "integer");
-	    strcpy(store->mbHistDate_long_name, "History date");
-	    strcpy(store->mbHistDate_name_code, "MB_HISTORY_DATE");
-	    strcpy(store->mbHistDate_units, "Julian_date");
-	    strcpy(store->mbHistDate_unit_code, "MB_JULIAN_DATE");
-	    store->mbHistDate_add_offset = 2440588;
-	    store->mbHistDate_scale_factor = 1;
-	    store->mbHistDate_minimum = -25567;
-	    store->mbHistDate_maximum = 47482;
-	    store->mbHistDate_valid_minimum = -25567;
-	    store->mbHistDate_valid_maximum = 47482;
-	    store->mbHistDate_missing_value = 2147483647;
-	    strcpy(store->mbHistDate_format_C, "%d");
-	    strcpy(store->mbHistDate_orientation, "direct");
-	    strcpy(store->mbHistTime_type, "integer");
-	    strcpy(store->mbHistTime_long_name, "History time (UT)");
-	    strcpy(store->mbHistTime_name_code, "MB_HISTORY_TIME");
-	    strcpy(store->mbHistTime_units, "ms");
-	    strcpy(store->mbHistTime_unit_code, "MB_MS");
-	    store->mbHistTime_add_offset = 0;
-	    store->mbHistTime_scale_factor = 1;
-	    store->mbHistTime_minimum = 0;
-	    store->mbHistTime_maximum = 86399999;
-	    store->mbHistTime_valid_minimum = 0;
-	    store->mbHistTime_valid_maximum = 86399999;
-	    store->mbHistTime_missing_value = -2000000000 - 147483648;
-	    strcpy(store->mbHistTime_format_C, "%d");
-	    strcpy(store->mbHistTime_orientation, "direct");
-	    strcpy(store->mbHistCode_type, "integer");
-	    strcpy(store->mbHistCode_long_name, "History code");
-	    strcpy(store->mbHistCode_name_code, "MB_HISTORY_CODE");
-	    strcpy(store->mbHistCode_units, "");
-	    strcpy(store->mbHistCode_unit_code, "MB_NOT_DEFINED");
-	    store->mbHistCode_add_offset = 0;
-	    store->mbHistCode_scale_factor = 1;
-	    store->mbHistCode_minimum = 1;
-	    store->mbHistCode_maximum = 255;
-	    store->mbHistCode_valid_minimum = 1;
-	    store->mbHistCode_valid_maximum = 255;
-	    store->mbHistCode_missing_value = 0;
-	    strcpy(store->mbHistCode_format_C, "%d");
-	    strcpy(store->mbHistCode_orientation, "direct");
-	    strcpy(store->mbHistAutor_type, "string");
-	    strcpy(store->mbHistAutor_long_name, "History autor");
-	    strcpy(store->mbHistAutor_name_code, "MB_HISTORY_AUTOR");
-	    strcpy(store->mbHistModule_type, "string");
-	    strcpy(store->mbHistModule_long_name, "History module");
-	    strcpy(store->mbHistModule_name_code, "MB_HISTORY_MODULE");
-	    strcpy(store->mbHistComment_type, "string");
-	    strcpy(store->mbHistComment_long_name, "History comment");
-	    strcpy(store->mbHistComment_name_code, "MB_HISTORY_COMMENT");
-	    strcpy(store->mbDate_type, "integer");
-	    strcpy(store->mbDate_long_name, "Date of cycle");
-	    strcpy(store->mbDate_name_code, "MB_POSITION_DATE");
-	    strcpy(store->mbDate_units, "Julian_date");
-	    strcpy(store->mbDate_unit_code, "MB_JULIAN_DATE");
-	    store->mbDate_add_offset = 2440588;
-	    store->mbDate_scale_factor = 1;
-	    store->mbDate_minimum = -25567;
-	    store->mbDate_maximum = 47482;
-	    store->mbDate_valid_minimum = -25567;
-	    store->mbDate_valid_maximum = 47482;
-	    store->mbDate_missing_value = 2147483647;
-	    strcpy(store->mbDate_format_C, "%d");
-	    strcpy(store->mbDate_orientation, "direct");
-	    strcpy(store->mbTime_type, "integer");
-	    strcpy(store->mbTime_long_name, "Time of cycle");
-	    strcpy(store->mbTime_name_code, "MB_POSITION_TIME");
-	    strcpy(store->mbTime_units, "ms");
-	    strcpy(store->mbTime_unit_code, "MB_MS");
-	    store->mbTime_add_offset = 0;
-	    store->mbTime_scale_factor = 1;
-	    store->mbTime_minimum = 0;
-	    store->mbTime_maximum = 86399999;
-	    store->mbTime_valid_minimum = 0;
-	    store->mbTime_valid_maximum = 86399999;
-	    store->mbTime_missing_value = -2000000000 - 147483648;
-	    strcpy(store->mbTime_format_C, "%d");
-	    strcpy(store->mbTime_orientation, "direct");
-	    strcpy(store->mbOrdinate_type, "real");
-	    strcpy(store->mbOrdinate_long_name, "Latitude");
-	    strcpy(store->mbOrdinate_name_code, "MB_POSITION_LATITUDE");
-	    strcpy(store->mbOrdinate_units, "degree");
-	    strcpy(store->mbOrdinate_unit_code, "MB_DEGREE");
-	    store->mbOrdinate_add_offset = 0.;
-	    store->mbOrdinate_scale_factor = 5.e-08;
-	    store->mbOrdinate_minimum = -1800000000;
-	    store->mbOrdinate_maximum = 1800000000;
-	    store->mbOrdinate_valid_minimum = -1800000000;
-	    store->mbOrdinate_valid_maximum = 1800000000;
-	    store->mbOrdinate_missing_value = -2000000000 - 147483648;
-	    strcpy(store->mbOrdinate_format_C, "%f");
-	    strcpy(store->mbOrdinate_orientation, "direct");
-	    strcpy(store->mbAbscissa_type, "real");
-	    strcpy(store->mbAbscissa_long_name, "Longitude");
-	    strcpy(store->mbAbscissa_name_code, "MB_POSITION_LONGITUDE");
-	    strcpy(store->mbAbscissa_units, "degree");
-	    strcpy(store->mbAbscissa_unit_code, "MB_DEGREE");
-	    store->mbAbscissa_add_offset = 0.;
-	    store->mbAbscissa_scale_factor = 1.e-07;
-	    store->mbAbscissa_minimum = -1800000000;
-	    store->mbAbscissa_maximum = 1800000000;
-	    store->mbAbscissa_valid_minimum = -1800000000;
-	    store->mbAbscissa_valid_maximum = 1800000000;
-	    store->mbAbscissa_missing_value = -2000000000 - 147483648;
-	    strcpy(store->mbAbscissa_format_C, "%f");
-	    strcpy(store->mbAbscissa_orientation, "direct");
-	    strcpy(store->mbAltitude_type, "real");
-	    strcpy(store->mbAltitude_long_name, "Altitude");
-	    strcpy(store->mbAltitude_name_code, "MB_POSITION_ALTITUDE");
-	    strcpy(store->mbAltitude_units, "m");
-	    strcpy(store->mbAltitude_unit_code, "MB_M");
-	    store->mbAltitude_add_offset = 0. ;
-	    store->mbAltitude_scale_factor = 0.2 ;
-	    store->mbAltitude_minimum = -32767 ;
-	    store->mbAltitude_maximum = 32767 ;
-	    store->mbAltitude_valid_minimum = -32767 ;
-	    store->mbAltitude_valid_maximum = 32767 ;
-	    store->mbAltitude_missing_value = -32768 ;
-	    strcpy(store->mbAltitude_format_C, "%.2f");
-	    strcpy(store->mbAltitude_orientation, "direct");
-	    strcpy(store->mbImmersion_type, "real");
-	    strcpy(store->mbImmersion_long_name, "Immersion");
-	    strcpy(store->mbImmersion_name_code, "MB_POSITION_IMMERSION");
-	    strcpy(store->mbImmersion_units, "m");
-	    strcpy(store->mbImmersion_unit_code, "MB_M");
-	    store->mbImmersion_add_offset = 0. ;
-	    store->mbImmersion_scale_factor = 0.2 ;
-	    store->mbImmersion_minimum = -32767 ;
-	    store->mbImmersion_maximum = 32767 ;
-	    store->mbImmersion_valid_minimum = -32767 ;
-	    store->mbImmersion_valid_maximum = 32767 ;
-	    store->mbImmersion_missing_value = -32768 ;
-	    strcpy(store->mbImmersion_format_C, "%.2f");
-	    strcpy(store->mbImmersion_orientation, "direct");
-	    strcpy(store->mbHeading_type, "real");
-	    strcpy(store->mbHeading_long_name, "Ship heading");
-	    strcpy(store->mbHeading_name_code, "MB_POSITION_HEADING");
-	    strcpy(store->mbHeading_units, "degree");
-	    strcpy(store->mbHeading_unit_code, "MB_DEGREE");
-	    store->mbHeading_add_offset = 0. ;
-	    store->mbHeading_scale_factor = 0.01 ;
-	    store->mbHeading_minimum = 1 ;
-	    store->mbHeading_maximum = 35999 ;
-	    store->mbHeading_valid_minimum = 1 ;
-	    store->mbHeading_valid_maximum = 35999 ;
-	    store->mbHeading_missing_value = 65535 ;
-	    strcpy(store->mbHeading_format_C, "%.2f");
-	    strcpy(store->mbHeading_orientation, "direct");
-	    strcpy(store->mbSpeed_type, "real");
-	    strcpy(store->mbSpeed_long_name, "Vessel speed");
-	    strcpy(store->mbSpeed_name_code, "MB_POSITION_SPEED");
-	    strcpy(store->mbSpeed_units, "knot");
-	    strcpy(store->mbSpeed_unit_code, "MB_KNOT");
-	    store->mbSpeed_add_offset = 0. ;
-	    store->mbSpeed_scale_factor = 0.01 ;
-	    store->mbSpeed_minimum = -32767 ;
-	    store->mbSpeed_maximum = 32767 ;
-	    store->mbSpeed_valid_minimum = -32767 ;
-	    store->mbSpeed_valid_maximum = 32767 ;
-	    store->mbSpeed_missing_value = -32768 ;
-	    strcpy(store->mbSpeed_format_C, "%.2f");
-	    strcpy(store->mbSpeed_orientation, "direct");
-	    strcpy(store->mbPType_type, "integer");
-	    strcpy(store->mbPType_long_name, "PType of captor");
-	    strcpy(store->mbPType_name_code, "MB_POSITION_TYPE");
-	    strcpy(store->mbPType_units, "");
-	    strcpy(store->mbPType_unit_code, "MB_NOT_DEFINED");
-	    store->mbPType_add_offset = 0 ;
-	    store->mbPType_scale_factor = 1 ;
-	    store->mbPType_minimum = 1 ;
-	    store->mbPType_maximum = 255 ;
-	    store->mbPType_valid_minimum = 1 ;
-	    store->mbPType_valid_maximum = 255 ;
-	    store->mbPType_missing_value = 0 ;
-	    strcpy(store->mbPType_format_C, "%d");
-	    strcpy(store->mbPType_orientation, "direct");
-	    strcpy(store->mbPQuality_type, "integer");
-	    strcpy(store->mbPQuality_long_name, "Factor of quality    ");
-	    strcpy(store->mbPQuality_name_code, "MB_POSITION_QUALITY");
-	    strcpy(store->mbPQuality_units, "");
-	    strcpy(store->mbPQuality_unit_code, "MB_NOT_DEFINED");
-	    store->mbPQuality_add_offset = 0 ;
-	    store->mbPQuality_scale_factor = 1 ;
-	    store->mbPQuality_minimum = 1 ;
-	    store->mbPQuality_maximum = 255 ;
-	    store->mbPQuality_valid_minimum = 1 ;
-	    store->mbPQuality_valid_maximum = 255 ;
-	    store->mbPQuality_missing_value = 0 ;
-	    strcpy(store->mbPQuality_format_C, "%d");
-	    strcpy(store->mbPQuality_orientation, "direct");
-	    strcpy(store->mbPFlag_type, "integer");
-	    strcpy(store->mbPFlag_long_name, "Flag of position   ");
-	    strcpy(store->mbPFlag_name_code, "MB_POSITION_Flag");
-	    strcpy(store->mbPFlag_units, "");
-	    strcpy(store->mbPFlag_unit_code, "MB_NOT_DEFINED");
-	    store->mbPFlag_add_offset = 0 ;
-	    store->mbPFlag_scale_factor = 1 ;
-	    store->mbPFlag_minimum = -127 ;
-	    store->mbPFlag_maximum = 127 ;
-	    store->mbPFlag_valid_minimum = -127 ;
-	    store->mbPFlag_valid_maximum = 127 ;
-	    store->mbPFlag_missing_value = -128 ;
-	    strcpy(store->mbPFlag_format_C, "%d");
-	    strcpy(store->mbPFlag_orientation, "direct");
-
-	    /* variable ids */
-	    store->mbHistDate_id = -1;
-	    store->mbHistTime_id = -1;
-	    store->mbHistCode_id = -1;
-	    store->mbHistAutor_id = -1;
-	    store->mbHistModule_id = -1;
-	    store->mbHistComment_id = -1;
-	    store->mbDate_id = -1;
-	    store->mbTime_id = -1;
-	    store->mbOrdinate_id = -1;
-	    store->mbAbscissa_id = -1;
-	    store->mbAltitude_id = -1;
-	    store->mbImmersion_id = -1;
-	    store->mbHeading_id = -1;
-	    store->mbSpeed_id = -1;
-	    store->mbPType_id = -1;
-	    store->mbPQuality_id = -1;
-	    store->mbPFlag_id = -1;
-
-	    /* variable pointers */
-	    store->mbHistDate = NULL;
-	    store->mbHistTime = NULL;
-	    store->mbHistCode = NULL;
-	    store->mbHistAutor = NULL;
-	    store->mbHistModule = NULL;
-	    store->mbHistComment = NULL;
-	    }
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       store_ptr:  %d\n",*error);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_navnetcdf_deall(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_navnetcdf_deall";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_navnetcdf_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %d\n",*error);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_navnetcdf_struct *) *store_ptr;
-
-	/* deallocate any allocated arrays */
-	if (store->mbHistDate != NULL)
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **) &store->mbHistDate, error);
-	if (store->mbHistTime != NULL)
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **) &store->mbHistTime, error);
-	if (store->mbHistCode != NULL)
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **) &store->mbHistCode, error);
-	if (store->mbHistAutor != NULL)
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **) &store->mbHistAutor, error);
-	if (store->mbHistModule != NULL)
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **) &store->mbHistModule, error);
-	if (store->mbHistComment != NULL)
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **) &store->mbHistComment, error);
-
-	/* deallocate memory for data structure */
-	status = mb_freed(verbose,__FILE__, __LINE__, (void **)store_ptr,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_navnetcdf_dimensions(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int *nbath, int *namp, int *nss, int *error)
-{
-	char	*function_name = "mbsys_navnetcdf_dimensions";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_navnetcdf_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_navnetcdf_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get beam and pixel numbers */
-		*nbath = 0;
-		*namp = 0;
-		*nss = 0;
-		}
-
-	/* extract data from structure */
-	else
-		{
-		/* get beam and pixel numbers */
-		*nbath = 0;
-		*namp = 0;
-		*nss = 0;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		fprintf(stderr,"dbg2       nbath:      %d\n",*nbath);
-		fprintf(stderr,"dbg2        namp:      %d\n",*namp);
-		fprintf(stderr,"dbg2        nss:       %d\n",*nss);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_navnetcdf_extract(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int time_i[7], double *time_d,
-		double *navlon, double *navlat,
-		double *speed, double *heading,
-		int *nbath, int *namp, int *nss,
-		char *beamflag, double *bath, double *amp,
-		double *bathacrosstrack, double *bathalongtrack,
-		double *ss, double *ssacrosstrack, double *ssalongtrack,
-		char *comment, int *error)
-{
-	char	*function_name = "mbsys_navnetcdf_extract";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_navnetcdf_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_navnetcdf_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* reset error and status */
-	*error = MB_ERROR_NO_ERROR;
-	status = MB_SUCCESS;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get time */
-		*time_d = store->mbDate * SECINDAY
-			    + store->mbTime * 0.001;
-		mb_get_date(verbose,*time_d,time_i);
-
-		/* get navigation */
-		*navlon = (double) store->mbAbscissa_scale_factor * store->mbAbscissa;
-		*navlat = (double) store->mbOrdinate_scale_factor * store->mbOrdinate;
-
-		/* get heading */
-		*heading = store->mbHeading * store->mbHeading_scale_factor;
-
-		/* get speed */
-		*speed = store->mbSpeed * store->mbSpeed_scale_factor;
-
-		/* set beamwidths in mb_io structure */
-		mb_io_ptr->beamwidth_ltrack = 2.0;
-		mb_io_ptr->beamwidth_xtrack = 2.0;
-
-		/* read distance, depth, and backscatter
-			values into storage arrays */
-		*nbath = 0;
-		*namp = 0;
-		*nss = 0;
-
-		/* print debug statements */
-		if (verbose >= 5)
-			{
-			fprintf(stderr,"\ndbg4  Data extracted by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  Extracted values:\n");
-			fprintf(stderr,"dbg4       kind:       %d\n",
-				*kind);
-			fprintf(stderr,"dbg4       error:      %d\n",
-				*error);
-			fprintf(stderr,"dbg4       time_i[0]:  %d\n",
-				time_i[0]);
-			fprintf(stderr,"dbg4       time_i[1]:  %d\n",
-				time_i[1]);
-			fprintf(stderr,"dbg4       time_i[2]:  %d\n",
-				time_i[2]);
-			fprintf(stderr,"dbg4       time_i[3]:  %d\n",
-				time_i[3]);
-			fprintf(stderr,"dbg4       time_i[4]:  %d\n",
-				time_i[4]);
-			fprintf(stderr,"dbg4       time_i[5]:  %d\n",
-				time_i[5]);
-			fprintf(stderr,"dbg4       time_i[6]:  %d\n",
-				time_i[6]);
-			fprintf(stderr,"dbg4       time_d:     %f\n",
-				*time_d);
-			fprintf(stderr,"dbg4       longitude:  %f\n",
-				*navlon);
-			fprintf(stderr,"dbg4       latitude:   %f\n",
-				*navlat);
-			fprintf(stderr,"dbg4       speed:      %f\n",
-				*speed);
-			fprintf(stderr,"dbg4       heading:    %f\n",
-				*heading);
-			fprintf(stderr,"dbg4       nbath:      %d\n",
-				*nbath);
-			for (i=0;i<*nbath;i++)
-			  fprintf(stderr,"dbg4       beam:%d  flag:%3d  bath:%f  acrosstrack:%f  alongtrack:%f\n",
-				i,beamflag[i],bath[i],bathacrosstrack[i],bathalongtrack[i]);
-			fprintf(stderr,"dbg4        namp:     %d\n",
-				*namp);
-			for (i=0;i<*namp;i++)
-			  fprintf(stderr,"dbg4        beam:%d   amp:%f  acrosstrack:%f  alongtrack:%f\n",
-				i,amp[i],bathacrosstrack[i],bathalongtrack[i]);
-			fprintf(stderr,"dbg4        nss:      %d\n",
-				*nss);
-			for (i=0;i<*nss;i++)
-			  fprintf(stderr,"dbg4        pixel:%d   ss:%f  acrosstrack:%f  alongtrack:%f\n",
-				i,ss[i],ssacrosstrack[i],ssalongtrack[i]);
-			}
-
-		/* done translating values */
-
-		}
-
-	/* extract comment from structure */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* copy comment */
-		strcpy(comment, store->comment);
-
-		/* print debug statements */
-		if (verbose >= 4)
-			{
-			fprintf(stderr,"\ndbg4  New ping read by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  New ping values:\n");
-			fprintf(stderr,"dbg4       error:      %d\n",
-				*error);
-			fprintf(stderr,"dbg4       comment:    %s\n",
-				comment);
-			}
-		}
-
-	/* else set error */
-	else
-		{
-		/* set error */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind == MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"dbg2       comment:     \ndbg2       %s\n",
-			comment);
-		}
-	else if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind != MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"dbg2       time_i[0]:     %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:     %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:     %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:     %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:     %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:     %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:     %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:        %f\n",*time_d);
-		fprintf(stderr,"dbg2       longitude:     %f\n",*navlon);
-		fprintf(stderr,"dbg2       latitude:      %f\n",*navlat);
-		fprintf(stderr,"dbg2       speed:         %f\n",*speed);
-		fprintf(stderr,"dbg2       heading:       %f\n",*heading);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_navnetcdf_insert(int verbose, void *mbio_ptr, void *store_ptr,
-		int kind, int time_i[7], double time_d,
-		double navlon, double navlat,
-		double speed, double heading,
-		int nbath, int namp, int nss,
-		char *beamflag, double *bath, double *amp,
-		double *bathacrosstrack, double *bathalongtrack,
-		double *ss, double *ssacrosstrack, double *ssalongtrack,
-		char *comment, int *error)
-{
-	char	*function_name = "mbsys_navnetcdf_insert";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_navnetcdf_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       kind:       %d\n",kind);
-		}
-	if (verbose >= 2 && (kind == MB_DATA_DATA))
-		{
-		fprintf(stderr,"dbg2       time_i[0]:  %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:  %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:  %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:  %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:  %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:  %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:  %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:     %f\n",time_d);
-		fprintf(stderr,"dbg2       navlon:     %f\n",navlon);
-		fprintf(stderr,"dbg2       navlat:     %f\n",navlat);
-		fprintf(stderr,"dbg2       speed:      %f\n",speed);
-		fprintf(stderr,"dbg2       heading:    %f\n",heading);
-		}
-	if (verbose >= 2 && kind == MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"dbg2       comment:     \ndbg2       %s\n",
-			comment);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_navnetcdf_struct *) store_ptr;
-
-	/* set data kind */
-	store->kind = kind;
-
-	/* insert data in structure */
-	if (store->kind == MB_DATA_DATA)
-		{
-		/* get stuff */
-		/* get time */
-		store->mbDate = (int)(time_d / SECINDAY);
-		store->mbTime = (int)(1000 * (time_d - store->mbDate * SECINDAY));
-
-		/* get navigation */
-		store->mbAbscissa = (int)(navlon / store->mbAbscissa_scale_factor);
-		store->mbOrdinate = (int)(navlat / store->mbOrdinate_scale_factor);
-
-		/* get heading */
-		store->mbHeading = heading / store->mbHeading_scale_factor;
-		}
-
-	/* insert comment in structure */
-	else if (store->kind == MB_DATA_COMMENT)
-		{
-		/* copy in comment */
-		strcpy(store->comment, comment);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_navnetcdf_ttimes(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, int *nbeams,
-	double *ttimes, double *angles,
-	double *angles_forward, double *angles_null,
-	double *heave, double *alongtrack_offset,
-	double *draft, double *ssv, int *error)
-{
-	char	*function_name = "mbsys_navnetcdf_ttimes";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_navnetcdf_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       ttimes:     %p\n",(void *)ttimes);
-		fprintf(stderr,"dbg2       angles_xtrk:%p\n",(void *)angles);
-		fprintf(stderr,"dbg2       angles_ltrk:%p\n",(void *)angles_forward);
-		fprintf(stderr,"dbg2       angles_null:%p\n",(void *)angles_null);
-		fprintf(stderr,"dbg2       heave:      %p\n",(void *)heave);
-		fprintf(stderr,"dbg2       ltrk_off:   %p\n",(void *)alongtrack_offset);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_navnetcdf_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* no travel times in this data format */
-		*nbeams = 0;
-
-		/* set status */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error == MB_ERROR_NO_ERROR)
-		{
-		fprintf(stderr,"dbg2       draft:      %f\n",*draft);
-		fprintf(stderr,"dbg2       ssv:        %f\n",*ssv);
-		fprintf(stderr,"dbg2       nbeams:     %d\n",*nbeams);
-		for (i=0;i<*nbeams;i++)
-			fprintf(stderr,"dbg2       beam %d: tt:%f  angle_xtrk:%f angle_ltrk:%f  angle_null:%f  depth_off:%f  ltrk_off:%f\n",
-				i,ttimes[i],angles[i],
-				angles_forward[i],angles_null[i],
-				heave[i],alongtrack_offset[i]);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_navnetcdf_detects(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, int *nbeams,
-	int *detects, int *error)
-{
-	char	*function_name = "mbsys_navnetcdf_detects";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_navnetcdf_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       detects:    %p\n",(void *)detects);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_navnetcdf_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get nbeams */
-		*nbeams = 0;
-
-		/* set status */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error == MB_ERROR_NO_ERROR)
-		{
-		fprintf(stderr,"dbg2       nbeams:     %d\n",*nbeams);
-		for (i=0;i<*nbeams;i++)
-			fprintf(stderr,"dbg2       beam %d: detects:%d\n",
-				i,detects[i]);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_navnetcdf_extract_altitude(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, double *transducer_depth, double *altitude,
-	int *error)
-{
-	char	*function_name = "mbsys_navnetcdf_extract_altitude";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_navnetcdf_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_navnetcdf_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* set values */
-		*transducer_depth = store->mbImmersion * store->mbImmersion_scale_factor;
-		*altitude = store->mbAltitude * store->mbAltitude_scale_factor;
-
-		/* set status */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:              %d\n",*kind);
-		fprintf(stderr,"dbg2       transducer_depth:  %f\n",*transducer_depth);
-		fprintf(stderr,"dbg2       altitude:          %f\n",*altitude);
-		fprintf(stderr,"dbg2       error:             %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:            %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_navnetcdf_insert_altitude(int verbose, void *mbio_ptr, void *store_ptr,
-	double transducer_depth, double altitude,
-	int *error)
-{
-	char	*function_name = "mbsys_navnetcdf_insert_altitude";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_navnetcdf_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:           %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:            %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:         %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       transducer_depth:  %f\n",transducer_depth);
-		fprintf(stderr,"dbg2       altitude:          %f\n",altitude);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_navnetcdf_struct *) store_ptr;
-
-	/* insert data into structure */
-	if (store->kind == MB_DATA_DATA)
-		{
-		/* set values */
-		store->mbImmersion = (int)(transducer_depth / store->mbImmersion_scale_factor);
-		store->mbAltitude = (int)(altitude / store->mbAltitude_scale_factor);
-
-		/* set status */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-		}
-
-	/* deal with comment */
-	else if (store->kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:             %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:            %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_navnetcdf_extract_nav(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int time_i[7], double *time_d,
-		double *navlon, double *navlat,
-		double *speed, double *heading, double *draft,
-		double *roll, double *pitch, double *heave,
-		int *error)
-{
-	char	*function_name = "mbsys_navnetcdf_extract_nav";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_navnetcdf_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_navnetcdf_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get time */
-		*time_d = store->mbDate * SECINDAY
-			    + store->mbTime * 0.001;
-		mb_get_date(verbose,*time_d,time_i);
-
-		/* get navigation */
-		*navlon = (double) store->mbAbscissa_scale_factor * store->mbAbscissa;
-		*navlat = (double) store->mbOrdinate_scale_factor * store->mbOrdinate;
-
-		/* get heading */
-		*heading = store->mbHeading * store->mbHeading_scale_factor;
-
-		/* set speed to zero */
-		*speed = store->mbSpeed * store->mbSpeed_scale_factor;
-
-		/* set draft to zero */
-		*draft = store->mbImmersion * store->mbImmersion_scale_factor;
-
-		/* get roll pitch and heave */
-		*roll = 0.0;
-		*pitch = 0.0;
-		*heave = 0.0;
-
-		/* print debug statements */
-		if (verbose >= 5)
-			{
-			fprintf(stderr,"\ndbg4  Data extracted by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  Extracted values:\n");
-			fprintf(stderr,"dbg4       kind:       %d\n",
-				*kind);
-			fprintf(stderr,"dbg4       error:      %d\n",
-				*error);
-			fprintf(stderr,"dbg4       time_i[0]:  %d\n",
-				time_i[0]);
-			fprintf(stderr,"dbg4       time_i[1]:  %d\n",
-				time_i[1]);
-			fprintf(stderr,"dbg4       time_i[2]:  %d\n",
-				time_i[2]);
-			fprintf(stderr,"dbg4       time_i[3]:  %d\n",
-				time_i[3]);
-			fprintf(stderr,"dbg4       time_i[4]:  %d\n",
-				time_i[4]);
-			fprintf(stderr,"dbg4       time_i[5]:  %d\n",
-				time_i[5]);
-			fprintf(stderr,"dbg4       time_i[6]:  %d\n",
-				time_i[6]);
-			fprintf(stderr,"dbg4       time_d:     %f\n",
-				*time_d);
-			fprintf(stderr,"dbg4       longitude:  %f\n",
-				*navlon);
-			fprintf(stderr,"dbg4       latitude:   %f\n",
-				*navlat);
-			fprintf(stderr,"dbg4       speed:      %f\n",
-				*speed);
-			fprintf(stderr,"dbg4       heading:    %f\n",
-				*heading);
-			fprintf(stderr,"dbg4       draft:      %f\n",
-				*draft);
-			fprintf(stderr,"dbg4       roll:       %f\n",
-				*roll);
-			fprintf(stderr,"dbg4       pitch:      %f\n",
-				*pitch);
-			fprintf(stderr,"dbg4       heave:      %f\n",
-				*heave);
-			}
-
-		/* done translating values */
-		/* set status */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind == MB_DATA_DATA)
-		{
-		fprintf(stderr,"dbg2       time_i[0]:     %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:     %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:     %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:     %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:     %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:     %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:     %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:        %f\n",*time_d);
-		fprintf(stderr,"dbg2       longitude:     %f\n",*navlon);
-		fprintf(stderr,"dbg2       latitude:      %f\n",*navlat);
-		fprintf(stderr,"dbg2       speed:         %f\n",*speed);
-		fprintf(stderr,"dbg2       heading:       %f\n",*heading);
-		fprintf(stderr,"dbg2       draft:         %f\n",*draft);
-		fprintf(stderr,"dbg2       roll:          %f\n",*roll);
-		fprintf(stderr,"dbg2       pitch:         %f\n",*pitch);
-		fprintf(stderr,"dbg2       heave:         %f\n",*heave);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_navnetcdf_insert_nav(int verbose, void *mbio_ptr, void *store_ptr,
-		int time_i[7], double time_d,
-		double navlon, double navlat,
-		double speed, double heading, double draft,
-		double roll, double pitch, double heave,
-		int *error)
-{
-	char	*function_name = "mbsys_navnetcdf_insert_nav";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_navnetcdf_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       time_i[0]:  %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:  %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:  %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:  %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:  %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:  %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:  %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:     %f\n",time_d);
-		fprintf(stderr,"dbg2       navlon:     %f\n",navlon);
-		fprintf(stderr,"dbg2       navlat:     %f\n",navlat);
-		fprintf(stderr,"dbg2       speed:      %f\n",speed);
-		fprintf(stderr,"dbg2       heading:    %f\n",heading);
-		fprintf(stderr,"dbg2       draft:      %f\n",draft);
-		fprintf(stderr,"dbg2       roll:       %f\n",roll);
-		fprintf(stderr,"dbg2       pitch:      %f\n",pitch);
-		fprintf(stderr,"dbg2       heave:      %f\n",heave);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_navnetcdf_struct *) store_ptr;
-
-	/* insert data in structure */
-	if (store->kind == MB_DATA_DATA)
-		{
-		/* get time */
-		store->mbDate = (int)(time_d / SECINDAY);
-		store->mbTime = (int)(1000 * (time_d - store->mbDate * SECINDAY));
-
-		/* get navigation */
-		store->mbAbscissa = (int)(navlon / store->mbAbscissa_scale_factor);
-		store->mbOrdinate = (int)(navlat / store->mbOrdinate_scale_factor);
-
-		/* get heading */
-		store->mbHeading = heading / store->mbHeading_scale_factor;
-
-		/* get speed */
-		store->mbSpeed = speed / store->mbSpeed_scale_factor;
-
-		/* get draft */
-		store->mbImmersion = draft / store->mbImmersion_scale_factor;
-
-		/* get roll pitch and heave */
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_navnetcdf_copy(int verbose, void *mbio_ptr,
-			void *store_ptr, void *copy_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_navnetcdf_copy";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_navnetcdf_struct *store;
-	struct mbsys_navnetcdf_struct *copy;
-	int     i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       copy_ptr:   %p\n",(void *)copy_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointers */
-	store = (struct mbsys_navnetcdf_struct *) store_ptr;
-	copy = (struct mbsys_navnetcdf_struct *) copy_ptr;
-
-
-	/* deallocate memory if required */
-	if (store->mbHistoryRecNbr > copy->mbHistoryRecNbr)
-	    {
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **) &store->mbHistDate, error);
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **) &store->mbHistTime, error);
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **) &store->mbHistCode, error);
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **) &store->mbHistAutor, error);
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **) &store->mbHistModule, error);
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **) &store->mbHistComment, error);
-	    }
-
-	/* allocate the memory in copy */
-	if (status == MB_SUCCESS)
-	    {
-	    copy->mbHistoryRecNbr = store->mbHistoryRecNbr;
-	    copy->mbNameLength = store->mbNameLength;
-	    copy->mbCommentLength = store->mbCommentLength;
-	    copy->mbPositionNbr = store->mbPositionNbr;
-	    status = mb_mallocd(verbose,__FILE__,__LINE__,
-			copy->mbHistoryRecNbr * sizeof(int),
-			(void **)&copy->mbHistDate,error);
-	    status = mb_mallocd(verbose,__FILE__,__LINE__,
-			copy->mbHistoryRecNbr * sizeof(int),
-			(void **)&copy->mbHistTime,error);
-	    status = mb_mallocd(verbose,__FILE__,__LINE__,
-			copy->mbHistoryRecNbr * sizeof(char),
-			(void **)&copy->mbHistCode,error);
-	    status = mb_mallocd(verbose,__FILE__,__LINE__,
-			copy->mbHistoryRecNbr * copy->mbNameLength * sizeof(char),
-			(void **)&copy->mbHistAutor,error);
-	    status = mb_mallocd(verbose,__FILE__,__LINE__,
-			copy->mbHistoryRecNbr * copy->mbNameLength * sizeof(char),
-			(void **)&copy->mbHistModule,error);
-	    status = mb_mallocd(verbose,__FILE__,__LINE__,
-			copy->mbHistoryRecNbr * copy->mbCommentLength * sizeof(char),
-			(void **)&copy->mbHistComment,error);
-	    }
-
-	/* deal with a memory allocation failure */
-	if (status == MB_FAILURE)
-	    {
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **) &store->mbHistDate, error);
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **) &store->mbHistTime, error);
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **) &store->mbHistCode, error);
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **) &store->mbHistAutor, error);
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **) &store->mbHistModule, error);
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **) &store->mbHistComment, error);
-	    status = MB_FAILURE;
-	    *error = MB_ERROR_MEMORY_FAIL;
-	    if (verbose >= 2)
-		    {
-		    fprintf(stderr,"\ndbg2  MBIO function <%s> terminated with error\n",
-			    function_name);
-		    fprintf(stderr,"dbg2  Return values:\n");
-		    fprintf(stderr,"dbg2       error:      %d\n",*error);
-		    fprintf(stderr,"dbg2  Return status:\n");
-		    fprintf(stderr,"dbg2       status:  %d\n",status);
-		    }
-	    return(status);
-	    }
-
-	/* copy the data */
-	if (status == MB_SUCCESS)
-	    {
-	    copy->kind = store->kind;
-
-	    /* global attributes */
-	    copy->mbVersion = store->mbVersion;
-	    for (i=0;i<MBSYS_NAVNETCDF_ATTRIBUTELEN;i++)
-		{
-		copy->mbName[i] = store->mbName[i];
-		copy->mbClasse[i] = store->mbClasse[i];
-		copy->mbTimeReference[i] = store->mbTimeReference[i];
-		copy->mbMeridian180[i] = store->mbMeridian180[i];
-		copy->mbGeoDictionnary[i] = store->mbGeoDictionnary[i];
-		copy->mbGeoRepresentation[i] = store->mbGeoRepresentation[i];
-		copy->mbGeodesicSystem[i] = store->mbGeodesicSystem[i];
-		}
-	    for (i=0;i<MBSYS_NAVNETCDF_ATTRIBUTELEN;i++)
-		{
-		copy->mbEllipsoidName[i] = store->mbEllipsoidName[i];
-		copy->mbProjParameterCode[i] = store->mbProjParameterCode[i];
-		copy->mbShip[i] = store->mbShip[i];
-		copy->mbSurvey[i] = store->mbSurvey[i];
-		copy->mbReference[i] = store->mbReference[i];
-		}
-	    copy->mbLevel = store->mbLevel;
-	    copy->mbNbrHistoryRec = store->mbNbrHistoryRec;
-	    copy->mbStartDate = store->mbStartDate;
-	    copy->mbStartTime = store->mbStartTime;
-	    copy->mbEndDate = store->mbEndDate;
-	    copy->mbEndTime = store->mbEndTime;
-	    copy->mbNorthLatitude = store->mbNorthLatitude;
-	    copy->mbSouthLatitude = store->mbSouthLatitude;
-	    copy->mbEastLongitude = store->mbEastLongitude;
-	    copy->mbWestLongitude = store->mbWestLongitude;
-	    copy->mbEllipsoidA = store->mbEllipsoidA;
-	    copy->mbEllipsoidInvF = store->mbEllipsoidInvF;
-	    copy->mbEllipsoidE2 = store->mbEllipsoidE2;
-	    copy->mbProjType = store->mbProjType;
-	    for (i=0;i<10;i++)
-		copy->mbProjParameterValue[i] = store->mbProjParameterValue[i];
-	    copy->mbPointCounter = store->mbPointCounter;
-
-	    /* variable ids */
-	    copy->mbHistDate_id = store->mbHistDate_id;
-	    copy->mbHistTime_id = store->mbHistTime_id;
-	    copy->mbHistCode_id = store->mbHistCode_id;
-	    copy->mbHistAutor_id = store->mbHistAutor_id;
-	    copy->mbHistModule_id = store->mbHistModule_id;
-	    copy->mbHistComment_id = store->mbHistComment_id;
-	    copy->mbDate_id = store->mbDate_id;
-	    copy->mbTime_id = store->mbTime_id;
-	    copy->mbOrdinate_id = store->mbOrdinate_id;
-	    copy->mbAbscissa_id = store->mbAbscissa_id;
-	    copy->mbAltitude_id = store->mbAltitude_id;
-	    copy->mbImmersion_id = store->mbImmersion_id;
-	    copy->mbHeading_id = store->mbHeading_id;
-	    copy->mbSpeed_id = store->mbSpeed_id;
-	    copy->mbPType_id = store->mbPType_id;
-	    copy->mbPQuality_id = store->mbPQuality_id;
-	    copy->mbPFlag_id = store->mbPFlag_id;
-
-	    /* variable pointers */
-	    for (i=0;i<copy->mbHistoryRecNbr;i++)
-	        {
-	        copy->mbHistDate[i] = store->mbHistDate[i];
-	        copy->mbHistTime[i] = store->mbHistTime[i];
-	        copy->mbHistCode[i] = store->mbHistCode[i];
-	        copy->mbHistAutor[i] = store->mbHistAutor[i];
-	        copy->mbHistModule[i] = store->mbHistModule[i];
-	        copy->mbHistComment[i] = store->mbHistComment[i];
-	        }
-	    copy->mbDate = store->mbDate;
-	    copy->mbTime = store->mbTime;
-	    copy->mbOrdinate = store->mbOrdinate;
-	    copy->mbAbscissa = store->mbAbscissa;
-	    copy->mbAltitude = store->mbAltitude;
-	    copy->mbImmersion = store->mbImmersion;
-	    copy->mbHeading = store->mbHeading;
-	    copy->mbSpeed = store->mbSpeed;
-	    copy->mbPType = store->mbPType;
-	    copy->mbPQuality = store->mbPQuality;
-	    copy->mbPFlag = store->mbPFlag;
-
-	    /* variable attributes */
-	    for (i=0;i<MBSYS_NAVNETCDF_ATTRIBUTELEN;i++)
-		{
-		copy->mbHistDate_type[i] = store->mbHistDate_type[i];
-		copy->mbHistDate_long_name[i] = store->mbHistDate_long_name[i];
-		copy->mbHistDate_name_code[i] = store->mbHistDate_name_code[i];
-		copy->mbHistDate_units[i] = store->mbHistDate_units[i];
-		copy->mbHistDate_unit_code[i] = store->mbHistDate_unit_code[i];
-		copy->mbHistDate_format_C[i] = store->mbHistDate_format_C[i];
-		copy->mbHistDate_orientation[i] = store->mbHistDate_orientation[i];
-		copy->mbHistTime_type[i] = store->mbHistTime_type[i];
-		copy->mbHistTime_long_name[i] = store->mbHistTime_long_name[i];
-		copy->mbHistTime_name_code[i] = store->mbHistTime_name_code[i];
-		copy->mbHistTime_units[i] = store->mbHistTime_units[i];
-		copy->mbHistTime_unit_code[i] = store->mbHistTime_unit_code[i];
-		copy->mbHistTime_format_C[i] = store->mbHistTime_format_C[i];
-		copy->mbHistTime_orientation[i] = store->mbHistTime_orientation[i];
-		copy->mbHistCode_type[i] = store->mbHistCode_type[i];
-		copy->mbHistCode_long_name[i] = store->mbHistCode_long_name[i];
-		copy->mbHistCode_name_code[i] = store->mbHistCode_name_code[i];
-		copy->mbHistCode_units[i] = store->mbHistCode_units[i];
-		copy->mbHistCode_unit_code[i] = store->mbHistCode_unit_code[i];
-		copy->mbHistCode_format_C[i] = store->mbHistCode_format_C[i];
-		copy->mbHistCode_orientation[i] = store->mbHistCode_orientation[i];
-		copy->mbHistAutor_type[i] = store->mbHistAutor_type[i];
-		copy->mbHistAutor_long_name[i] = store->mbHistAutor_long_name[i];
-		copy->mbHistAutor_name_code[i] = store->mbHistAutor_name_code[i];
-		copy->mbHistModule_type[i] = store->mbHistModule_type[i];
-		copy->mbHistModule_long_name[i] = store->mbHistModule_long_name[i];
-		copy->mbHistModule_name_code[i] = store->mbHistModule_name_code[i];
-		copy->mbHistComment_type[i] = store->mbHistComment_type[i];
-		copy->mbHistComment_long_name[i] = store->mbHistComment_long_name[i];
-		copy->mbHistComment_name_code[i] = store->mbHistComment_name_code[i];
-		copy->mbDate_type[i] = store->mbDate_type[i];
-		copy->mbDate_long_name[i] = store->mbDate_long_name[i];
-		copy->mbDate_name_code[i] = store->mbDate_name_code[i];
-		copy->mbDate_units[i] = store->mbDate_units[i];
-		copy->mbDate_unit_code[i] = store->mbDate_unit_code[i];
-		copy->mbDate_format_C[i] = store->mbDate_format_C[i];
-		copy->mbDate_orientation[i] = store->mbDate_orientation[i];
-		copy->mbTime_type[i] = store->mbTime_type[i];
-		copy->mbTime_long_name[i] = store->mbTime_long_name[i];
-		copy->mbTime_name_code[i] = store->mbTime_name_code[i];
-		copy->mbTime_units[i] = store->mbTime_units[i];
-		copy->mbTime_unit_code[i] = store->mbTime_unit_code[i];
-		copy->mbTime_format_C[i] = store->mbTime_format_C[i];
-		copy->mbTime_orientation[i] = store->mbTime_orientation[i];
-		copy->mbOrdinate_type[i] = store->mbOrdinate_type[i];
-		copy->mbOrdinate_long_name[i] = store->mbOrdinate_long_name[i];
-		copy->mbOrdinate_name_code[i] = store->mbOrdinate_name_code[i];
-		copy->mbOrdinate_units[i] = store->mbOrdinate_units[i];
-		copy->mbOrdinate_unit_code[i] = store->mbOrdinate_unit_code[i];
-		copy->mbOrdinate_format_C[i] = store->mbOrdinate_format_C[i];
-		copy->mbOrdinate_orientation[i] = store->mbOrdinate_orientation[i];
-		copy->mbAbscissa_type[i] = store->mbAbscissa_type[i];
-		copy->mbAbscissa_long_name[i] = store->mbAbscissa_long_name[i];
-		copy->mbAbscissa_name_code[i] = store->mbAbscissa_name_code[i];
-		copy->mbAbscissa_units[i] = store->mbAbscissa_units[i];
-		copy->mbAbscissa_unit_code[i] = store->mbAbscissa_unit_code[i];
-		copy->mbAbscissa_format_C[i] = store->mbAbscissa_format_C[i];
-		copy->mbAbscissa_orientation[i] = store->mbAbscissa_orientation[i];
-		copy->mbAltitude_type[i] = store->mbAltitude_type[i];
-		copy->mbAltitude_long_name[i] = store->mbAltitude_long_name[i];
-		copy->mbAltitude_name_code[i] = store->mbAltitude_name_code[i];
-		copy->mbAltitude_units[i] = store->mbAltitude_units[i];
-		copy->mbAltitude_unit_code[i] = store->mbAltitude_unit_code[i];
-		copy->mbAltitude_format_C[i] = store->mbAltitude_format_C[i];
-		copy->mbAltitude_orientation[i] = store->mbAltitude_orientation[i];
-		copy->mbImmersion_type[i] = store->mbImmersion_type[i];
-		copy->mbImmersion_long_name[i] = store->mbImmersion_long_name[i];
-		copy->mbImmersion_name_code[i] = store->mbImmersion_name_code[i];
-		copy->mbImmersion_units[i] = store->mbImmersion_units[i];
-		copy->mbImmersion_unit_code[i] = store->mbImmersion_unit_code[i];
-		copy->mbImmersion_format_C[i] = store->mbImmersion_format_C[i];
-		copy->mbImmersion_orientation[i] = store->mbImmersion_orientation[i];
-		copy->mbHeading_type[i] = store->mbHeading_type[i];
-		copy->mbHeading_long_name[i] = store->mbHeading_long_name[i];
-		copy->mbHeading_name_code[i] = store->mbHeading_name_code[i];
-		copy->mbHeading_units[i] = store->mbHeading_units[i];
-		copy->mbHeading_unit_code[i] = store->mbHeading_unit_code[i];
-		copy->mbHeading_format_C[i] = store->mbHeading_format_C[i];
-		copy->mbHeading_orientation[i] = store->mbHeading_orientation[i];
-		copy->mbSpeed_type[i] = store->mbSpeed_type[i];
-		copy->mbSpeed_long_name[i] = store->mbSpeed_long_name[i];
-		copy->mbSpeed_name_code[i] = store->mbSpeed_name_code[i];
-		copy->mbSpeed_units[i] = store->mbSpeed_units[i];
-		copy->mbSpeed_unit_code[i] = store->mbSpeed_unit_code[i];
-		copy->mbSpeed_format_C[i] = store->mbSpeed_format_C[i];
-		copy->mbSpeed_orientation[i] = store->mbSpeed_orientation[i];
-		copy->mbPType_type[i] = store->mbPType_type[i];
-		copy->mbPType_long_name[i] = store->mbPType_long_name[i];
-		copy->mbPType_name_code[i] = store->mbPType_name_code[i];
-		copy->mbPType_units[i] = store->mbPType_units[i];
-		copy->mbPType_unit_code[i] = store->mbPType_unit_code[i];
-		copy->mbPType_format_C[i] = store->mbPType_format_C[i];
-		copy->mbPType_orientation[i] = store->mbPType_orientation[i];
-		copy->mbPQuality_type[i] = store->mbPQuality_type[i];
-		copy->mbPQuality_long_name[i] = store->mbPQuality_long_name[i];
-		copy->mbPQuality_name_code[i] = store->mbPQuality_name_code[i];
-		copy->mbPQuality_units[i] = store->mbPQuality_units[i];
-		copy->mbPQuality_unit_code[i] = store->mbPQuality_unit_code[i];
-		copy->mbPQuality_format_C[i] = store->mbPQuality_format_C[i];
-		copy->mbPQuality_orientation[i] = store->mbPQuality_orientation[i];
-		copy->mbPFlag_type[i] = store->mbPFlag_type[i];
-		copy->mbPFlag_long_name[i] = store->mbPFlag_long_name[i];
-		copy->mbPFlag_name_code[i] = store->mbPFlag_name_code[i];
-		copy->mbPFlag_units[i] = store->mbPFlag_units[i];
-		copy->mbPFlag_unit_code[i] = store->mbPFlag_unit_code[i];
-		copy->mbPFlag_format_C[i] = store->mbPFlag_format_C[i];
-		copy->mbPFlag_orientation[i] = store->mbPFlag_orientation[i];
-		}
-	    copy->mbHistDate_add_offset = store->mbHistDate_add_offset;
-	    copy->mbHistDate_scale_factor = store->mbHistDate_scale_factor;
-	    copy->mbHistDate_minimum = store->mbHistDate_minimum;
-	    copy->mbHistDate_maximum = store->mbHistDate_maximum;
-	    copy->mbHistDate_valid_minimum = store->mbHistDate_valid_minimum;
-	    copy->mbHistDate_valid_maximum = store->mbHistDate_valid_maximum;
-	    copy->mbHistDate_missing_value = store->mbHistDate_missing_value;
-	    copy->mbHistTime_add_offset = store->mbHistTime_add_offset;
-	    copy->mbHistTime_scale_factor = store->mbHistTime_scale_factor;
-	    copy->mbHistTime_minimum = store->mbHistTime_minimum;
-	    copy->mbHistTime_maximum = store->mbHistTime_maximum;
-	    copy->mbHistTime_valid_minimum = store->mbHistTime_valid_minimum;
-	    copy->mbHistTime_valid_maximum = store->mbHistTime_valid_maximum;
-	    copy->mbHistTime_missing_value = store->mbHistTime_missing_value;
-	    copy->mbHistCode_add_offset = store->mbHistCode_add_offset;
-	    copy->mbHistCode_scale_factor = store->mbHistCode_scale_factor;
-	    copy->mbHistCode_minimum = store->mbHistCode_minimum;
-	    copy->mbHistCode_maximum = store->mbHistCode_maximum;
-	    copy->mbHistCode_valid_minimum = store->mbHistCode_valid_minimum;
-	    copy->mbHistCode_valid_maximum = store->mbHistCode_valid_maximum;
-	    copy->mbHistCode_missing_value = store->mbHistCode_missing_value;
-	    copy->mbDate_add_offset = store->mbDate_add_offset;
-	    copy->mbDate_scale_factor = store->mbDate_scale_factor;
-	    copy->mbDate_minimum = store->mbDate_minimum;
-	    copy->mbDate_maximum = store->mbDate_maximum;
-	    copy->mbDate_valid_minimum = store->mbDate_valid_minimum;
-	    copy->mbDate_valid_maximum = store->mbDate_valid_maximum;
-	    copy->mbDate_missing_value = store->mbDate_missing_value;
-	    copy->mbTime_add_offset = store->mbTime_add_offset;
-	    copy->mbTime_scale_factor = store->mbTime_scale_factor;
-	    copy->mbTime_minimum = store->mbTime_minimum;
-	    copy->mbTime_maximum = store->mbTime_maximum;
-	    copy->mbTime_valid_minimum = store->mbTime_valid_minimum;
-	    copy->mbTime_valid_maximum = store->mbTime_valid_maximum;
-	    copy->mbTime_missing_value = store->mbTime_missing_value;
-	    copy->mbOrdinate_add_offset = store->mbOrdinate_add_offset;
-	    copy->mbOrdinate_scale_factor = store->mbOrdinate_scale_factor;
-	    copy->mbOrdinate_minimum = store->mbOrdinate_minimum;
-	    copy->mbOrdinate_maximum = store->mbOrdinate_maximum;
-	    copy->mbOrdinate_valid_minimum = store->mbOrdinate_valid_minimum;
-	    copy->mbOrdinate_valid_maximum = store->mbOrdinate_valid_maximum;
-	    copy->mbOrdinate_missing_value = store->mbOrdinate_missing_value;
-	    copy->mbAbscissa_add_offset = store->mbAbscissa_add_offset;
-	    copy->mbAbscissa_scale_factor = store->mbAbscissa_scale_factor;
-	    copy->mbAbscissa_minimum = store->mbAbscissa_minimum;
-	    copy->mbAbscissa_maximum = store->mbAbscissa_maximum;
-	    copy->mbAbscissa_valid_minimum = store->mbAbscissa_valid_minimum;
-	    copy->mbAbscissa_valid_maximum = store->mbAbscissa_valid_maximum;
-	    copy->mbAbscissa_missing_value = store->mbAbscissa_missing_value;
-	    copy->mbAltitude_add_offset = store->mbAltitude_add_offset;
-	    copy->mbAltitude_scale_factor = store->mbAltitude_scale_factor;
-	    copy->mbAltitude_minimum = store->mbAltitude_minimum;
-	    copy->mbAltitude_maximum = store->mbAltitude_maximum;
-	    copy->mbAltitude_valid_minimum = store->mbAltitude_valid_minimum;
-	    copy->mbAltitude_valid_maximum = store->mbAltitude_valid_maximum;
-	    copy->mbAltitude_missing_value = store->mbAltitude_missing_value;
-	    copy->mbImmersion_add_offset = store->mbImmersion_add_offset;
-	    copy->mbImmersion_scale_factor = store->mbImmersion_scale_factor;
-	    copy->mbImmersion_minimum = store->mbImmersion_minimum;
-	    copy->mbImmersion_maximum = store->mbImmersion_maximum;
-	    copy->mbImmersion_valid_minimum = store->mbImmersion_valid_minimum;
-	    copy->mbImmersion_valid_maximum = store->mbImmersion_valid_maximum;
-	    copy->mbImmersion_missing_value = store->mbImmersion_missing_value;
-	    copy->mbHeading_add_offset = store->mbHeading_add_offset;
-	    copy->mbHeading_scale_factor = store->mbHeading_scale_factor;
-	    copy->mbHeading_minimum = store->mbHeading_minimum;
-	    copy->mbHeading_maximum = store->mbHeading_maximum;
-	    copy->mbHeading_valid_minimum = store->mbHeading_valid_minimum;
-	    copy->mbHeading_valid_maximum = store->mbHeading_valid_maximum;
-	    copy->mbHeading_missing_value = store->mbHeading_missing_value;
-	    copy->mbSpeed_add_offset = store->mbSpeed_add_offset;
-	    copy->mbSpeed_scale_factor = store->mbSpeed_scale_factor;
-	    copy->mbSpeed_minimum = store->mbSpeed_minimum;
-	    copy->mbSpeed_maximum = store->mbSpeed_maximum;
-	    copy->mbSpeed_valid_minimum = store->mbSpeed_valid_minimum;
-	    copy->mbSpeed_valid_maximum = store->mbSpeed_valid_maximum;
-	    copy->mbSpeed_missing_value = store->mbSpeed_missing_value;
-	    copy->mbPType_add_offset = store->mbPType_add_offset;
-	    copy->mbPType_scale_factor = store->mbPType_scale_factor;
-	    copy->mbPType_minimum = store->mbPType_minimum;
-	    copy->mbPType_maximum = store->mbPType_maximum;
-	    copy->mbPType_valid_minimum = store->mbPType_valid_minimum;
-	    copy->mbPType_valid_maximum = store->mbPType_valid_maximum;
-	    copy->mbPType_missing_value = store->mbPType_missing_value;
-	    copy->mbPQuality_add_offset = store->mbPQuality_add_offset;
-	    copy->mbPQuality_scale_factor = store->mbPQuality_scale_factor;
-	    copy->mbPQuality_minimum = store->mbPQuality_minimum;
-	    copy->mbPQuality_maximum = store->mbPQuality_maximum;
-	    copy->mbPQuality_valid_minimum = store->mbPQuality_valid_minimum;
-	    copy->mbPQuality_valid_maximum = store->mbPQuality_valid_maximum;
-	    copy->mbPQuality_missing_value = store->mbPQuality_missing_value;
-	    copy->mbPFlag_add_offset = store->mbPFlag_add_offset;
-	    copy->mbPFlag_scale_factor = store->mbPFlag_scale_factor;
-	    copy->mbPFlag_minimum = store->mbPFlag_minimum;
-	    copy->mbPFlag_maximum = store->mbPFlag_maximum;
-	    copy->mbPFlag_valid_minimum = store->mbPFlag_valid_minimum;
-	    copy->mbPFlag_valid_maximum = store->mbPFlag_valid_maximum;
-	    copy->mbPFlag_missing_value = store->mbPFlag_missing_value;
-
-	    /* storage comment string */
-	    for (i=0;i<MBSYS_NAVNETCDF_COMMENTLEN;i++)
-	        copy->comment[i] = store->comment[i];
-	    }
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mbsys_navnetcdf.h b/src/mbio/mbsys_navnetcdf.h
deleted file mode 100644
index 5102ec5..0000000
--- a/src/mbio/mbsys_navnetcdf.h
+++ /dev/null
@@ -1,409 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbsys_navnetcdf.h	5/4/2002
- *	$Id: mbsys_navnetcdf.h 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 2002-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbsys_navnetcdf.h defines the data structures used by MBIO functions
- * to store data from the IFREMER netCDF navigation format.
- * The MBIO format id is:
- *      MBF_NVNETCDF : MBIO ID 167
- *
- *
- * Author:	D. W. Caress
- * Date:	May 4, 2002
- *
- * $Log: mbsys_navnetcdf.h,v $
- * Revision 5.3  2008/05/16 22:56:24  caress
- * Release 5.1.1beta18.
- *
- * Revision 5.2  2005/11/05 00:48:03  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.1  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.0  2002/05/29 23:41:20  caress
- * Release 5.0.beta18
- *
- *
- *
- */
-/*
- * Notes on the MBF_MBNAVNETCDF data format:
- *   1.
- *   2.
- *
- */
-
-/* dimension lengths */
-#define MBSYS_NAVNETCDF_COMMENTLEN	    256
-#define MBSYS_NAVNETCDF_ATTRIBUTELEN   64
-#define MBSYS_NAVNETCDF_NAMELEN	    20
-
-/* seconds in day */
-#define SECINDAY     86400.0
-
-/* internal data structure */
-struct mbsys_navnetcdf_struct
-	{
-	int	 kind;
-
-	/* global attributes */
-	short mbVersion;
-	char mbName[MBSYS_NAVNETCDF_ATTRIBUTELEN];
-	char mbClasse[MBSYS_NAVNETCDF_ATTRIBUTELEN];
-	char mbTimeReference[MBSYS_NAVNETCDF_ATTRIBUTELEN];
-	char mbMeridian180[MBSYS_NAVNETCDF_ATTRIBUTELEN];
-	char mbGeoDictionnary[MBSYS_NAVNETCDF_ATTRIBUTELEN];
-	char mbGeoRepresentation[MBSYS_NAVNETCDF_ATTRIBUTELEN];
-	char mbGeodesicSystem[MBSYS_NAVNETCDF_ATTRIBUTELEN];
-	char mbEllipsoidName[MBSYS_NAVNETCDF_COMMENTLEN];
-	char mbProjParameterCode[MBSYS_NAVNETCDF_COMMENTLEN];
-	char mbShip[MBSYS_NAVNETCDF_COMMENTLEN];
-	char mbSurvey[MBSYS_NAVNETCDF_COMMENTLEN];
-	char mbReference[MBSYS_NAVNETCDF_COMMENTLEN];
-	short mbLevel;
-	short mbNbrHistoryRec;
-	int mbStartDate;
-	int mbStartTime;
-	int mbEndDate;
-	int mbEndTime;
-	double mbNorthLatitude;
-	double mbSouthLatitude;
-	double mbEastLongitude;
-	double mbWestLongitude;
-	double mbEllipsoidA;
-	double mbEllipsoidInvF;
-	double mbEllipsoidE2;
-	short mbProjType;
-	double mbProjParameterValue[10];
-	int mbPointCounter;
-
-	/* dimensions */
-	size_t mbHistoryRecNbr;
-	size_t mbNameLength;
-	size_t mbCommentLength;
-	size_t mbPositionNbr;
-
-	/* variable ids */
-	int mbHistDate_id;
-	int mbHistTime_id;
-	int mbHistCode_id;
-	int mbHistAutor_id;
-	int mbHistModule_id;
-	int mbHistComment_id;
-	int mbDate_id;
-	int mbTime_id;
-	int mbOrdinate_id;
-	int mbAbscissa_id;
-	int mbAltitude_id;
-	int mbImmersion_id;
-	int mbHeading_id;
-	int mbSpeed_id;
-	int mbPType_id;
-	int mbPQuality_id;
-	int mbPFlag_id;
-
-	/* variables */
-        int *mbHistDate;
-        int *mbHistTime;
-        char *mbHistCode;
-        char *mbHistAutor;
-        char *mbHistModule;
-        char *mbHistComment;
-        int mbDate;
-        int mbTime;
-        int mbOrdinate;
-        int mbAbscissa;
-	short mbAltitude;
-	short mbImmersion;
-	int mbHeading;
-	short mbSpeed;
-	char mbPType;
-	char mbPQuality;
-	char mbPFlag;
-
-	/* variable attributes */
-	char mbHistDate_type[MBSYS_NAVNETCDF_ATTRIBUTELEN];
-	char mbHistDate_long_name[MBSYS_NAVNETCDF_ATTRIBUTELEN];
-	char mbHistDate_name_code[MBSYS_NAVNETCDF_ATTRIBUTELEN];
-	char mbHistDate_units[MBSYS_NAVNETCDF_ATTRIBUTELEN];
-	char mbHistDate_unit_code[MBSYS_NAVNETCDF_ATTRIBUTELEN];
-	char mbHistDate_format_C[MBSYS_NAVNETCDF_ATTRIBUTELEN];
-	char mbHistDate_orientation[MBSYS_NAVNETCDF_ATTRIBUTELEN];
-	int mbHistDate_add_offset;
-	int mbHistDate_scale_factor;
-	int mbHistDate_minimum;
-	int mbHistDate_maximum;
-	int mbHistDate_valid_minimum;
-	int mbHistDate_valid_maximum;
-	int mbHistDate_missing_value;
-	char mbHistTime_type[MBSYS_NAVNETCDF_ATTRIBUTELEN];
-	char mbHistTime_long_name[MBSYS_NAVNETCDF_ATTRIBUTELEN];
-	char mbHistTime_name_code[MBSYS_NAVNETCDF_ATTRIBUTELEN];
-	char mbHistTime_units[MBSYS_NAVNETCDF_ATTRIBUTELEN];
-	char mbHistTime_unit_code[MBSYS_NAVNETCDF_ATTRIBUTELEN];
-	char mbHistTime_format_C[MBSYS_NAVNETCDF_ATTRIBUTELEN];
-	char mbHistTime_orientation[MBSYS_NAVNETCDF_ATTRIBUTELEN];
-	int mbHistTime_add_offset;
-	int mbHistTime_scale_factor;
-	int mbHistTime_minimum;
-	int mbHistTime_maximum;
-	int mbHistTime_valid_minimum;
-	int mbHistTime_valid_maximum;
-	int mbHistTime_missing_value;
-	char mbHistCode_type[MBSYS_NAVNETCDF_ATTRIBUTELEN];
-	char mbHistCode_long_name[MBSYS_NAVNETCDF_ATTRIBUTELEN];
-	char mbHistCode_name_code[MBSYS_NAVNETCDF_ATTRIBUTELEN];
-	char mbHistCode_units[MBSYS_NAVNETCDF_ATTRIBUTELEN];
-	char mbHistCode_unit_code[MBSYS_NAVNETCDF_ATTRIBUTELEN];
-	char mbHistCode_format_C[MBSYS_NAVNETCDF_ATTRIBUTELEN];
-	char mbHistCode_orientation[MBSYS_NAVNETCDF_ATTRIBUTELEN];
-	int mbHistCode_add_offset;
-	int mbHistCode_scale_factor;
-	int mbHistCode_minimum;
-	int mbHistCode_maximum;
-	int mbHistCode_valid_minimum;
-	int mbHistCode_valid_maximum;
-	int mbHistCode_missing_value;
-	char mbHistAutor_type[MBSYS_NAVNETCDF_ATTRIBUTELEN];
-	char mbHistAutor_long_name[MBSYS_NAVNETCDF_ATTRIBUTELEN];
-	char mbHistAutor_name_code[MBSYS_NAVNETCDF_ATTRIBUTELEN];
-	char mbHistModule_type[MBSYS_NAVNETCDF_ATTRIBUTELEN];
-	char mbHistModule_long_name[MBSYS_NAVNETCDF_ATTRIBUTELEN];
-	char mbHistModule_name_code[MBSYS_NAVNETCDF_ATTRIBUTELEN];
-	char mbHistComment_type[MBSYS_NAVNETCDF_ATTRIBUTELEN];
-	char mbHistComment_long_name[MBSYS_NAVNETCDF_ATTRIBUTELEN];
-	char mbHistComment_name_code[MBSYS_NAVNETCDF_ATTRIBUTELEN];
-	char mbDate_type[MBSYS_NAVNETCDF_ATTRIBUTELEN];
-	char mbDate_long_name[MBSYS_NAVNETCDF_ATTRIBUTELEN];
-	char mbDate_name_code[MBSYS_NAVNETCDF_ATTRIBUTELEN];
-	char mbDate_units[MBSYS_NAVNETCDF_ATTRIBUTELEN];
-	char mbDate_unit_code[MBSYS_NAVNETCDF_ATTRIBUTELEN];
-	char mbDate_format_C[MBSYS_NAVNETCDF_ATTRIBUTELEN];
-	char mbDate_orientation[MBSYS_NAVNETCDF_ATTRIBUTELEN];
-	int mbDate_add_offset;
-	int mbDate_scale_factor;
-	int mbDate_minimum;
-	int mbDate_maximum;
-	int mbDate_valid_minimum;
-	int mbDate_valid_maximum;
-	int mbDate_missing_value;
-	char mbTime_type[MBSYS_NAVNETCDF_ATTRIBUTELEN];
-	char mbTime_long_name[MBSYS_NAVNETCDF_ATTRIBUTELEN];
-	char mbTime_name_code[MBSYS_NAVNETCDF_ATTRIBUTELEN];
-	char mbTime_units[MBSYS_NAVNETCDF_ATTRIBUTELEN];
-	char mbTime_unit_code[MBSYS_NAVNETCDF_ATTRIBUTELEN];
-	char mbTime_format_C[MBSYS_NAVNETCDF_ATTRIBUTELEN];
-	char mbTime_orientation[MBSYS_NAVNETCDF_ATTRIBUTELEN];
-	int mbTime_add_offset;
-	int mbTime_scale_factor;
-	int mbTime_minimum;
-	int mbTime_maximum;
-	int mbTime_valid_minimum;
-	int mbTime_valid_maximum;
-	int mbTime_missing_value;
-	char mbOrdinate_type[MBSYS_NAVNETCDF_ATTRIBUTELEN];
-	char mbOrdinate_long_name[MBSYS_NAVNETCDF_ATTRIBUTELEN];
-	char mbOrdinate_name_code[MBSYS_NAVNETCDF_ATTRIBUTELEN];
-	char mbOrdinate_units[MBSYS_NAVNETCDF_ATTRIBUTELEN];
-	char mbOrdinate_unit_code[MBSYS_NAVNETCDF_ATTRIBUTELEN];
-	char mbOrdinate_format_C[MBSYS_NAVNETCDF_ATTRIBUTELEN];
-	char mbOrdinate_orientation[MBSYS_NAVNETCDF_ATTRIBUTELEN];
-	double mbOrdinate_add_offset;
-	double mbOrdinate_scale_factor;
-	int mbOrdinate_minimum;
-	int mbOrdinate_maximum;
-	int mbOrdinate_valid_minimum;
-	int mbOrdinate_valid_maximum;
-	int mbOrdinate_missing_value;
-	char mbAbscissa_type[MBSYS_NAVNETCDF_ATTRIBUTELEN];
-	char mbAbscissa_long_name[MBSYS_NAVNETCDF_ATTRIBUTELEN];
-	char mbAbscissa_name_code[MBSYS_NAVNETCDF_ATTRIBUTELEN];
-	char mbAbscissa_units[MBSYS_NAVNETCDF_ATTRIBUTELEN];
-	char mbAbscissa_unit_code[MBSYS_NAVNETCDF_ATTRIBUTELEN];
-	char mbAbscissa_format_C[MBSYS_NAVNETCDF_ATTRIBUTELEN];
-	char mbAbscissa_orientation[MBSYS_NAVNETCDF_ATTRIBUTELEN];
-	double mbAbscissa_add_offset;
-	double mbAbscissa_scale_factor;
-	int mbAbscissa_minimum;
-	int mbAbscissa_maximum;
-	int mbAbscissa_valid_minimum;
-	int mbAbscissa_valid_maximum;
-	int mbAbscissa_missing_value;
-	char mbAltitude_type[MBSYS_NAVNETCDF_ATTRIBUTELEN];
-	char mbAltitude_long_name[MBSYS_NAVNETCDF_ATTRIBUTELEN];
-	char mbAltitude_name_code[MBSYS_NAVNETCDF_ATTRIBUTELEN];
-	char mbAltitude_units[MBSYS_NAVNETCDF_ATTRIBUTELEN];
-	char mbAltitude_unit_code[MBSYS_NAVNETCDF_ATTRIBUTELEN];
-	char mbAltitude_format_C[MBSYS_NAVNETCDF_ATTRIBUTELEN];
-	char mbAltitude_orientation[MBSYS_NAVNETCDF_ATTRIBUTELEN];
-	double mbAltitude_add_offset;
-	double mbAltitude_scale_factor;
-	int mbAltitude_minimum;
-	int mbAltitude_maximum;
-	int mbAltitude_valid_minimum;
-	int mbAltitude_valid_maximum;
-	int mbAltitude_missing_value;
-	char mbImmersion_type[MBSYS_NAVNETCDF_ATTRIBUTELEN];
-	char mbImmersion_long_name[MBSYS_NAVNETCDF_ATTRIBUTELEN];
-	char mbImmersion_name_code[MBSYS_NAVNETCDF_ATTRIBUTELEN];
-	char mbImmersion_units[MBSYS_NAVNETCDF_ATTRIBUTELEN];
-	char mbImmersion_unit_code[MBSYS_NAVNETCDF_ATTRIBUTELEN];
-	char mbImmersion_format_C[MBSYS_NAVNETCDF_ATTRIBUTELEN];
-	char mbImmersion_orientation[MBSYS_NAVNETCDF_ATTRIBUTELEN];
-	double mbImmersion_add_offset;
-	double mbImmersion_scale_factor;
-	int mbImmersion_minimum;
-	int mbImmersion_maximum;
-	int mbImmersion_valid_minimum;
-	int mbImmersion_valid_maximum;
-	int mbImmersion_missing_value;
-	char mbHeading_type[MBSYS_NAVNETCDF_ATTRIBUTELEN];
-	char mbHeading_long_name[MBSYS_NAVNETCDF_ATTRIBUTELEN];
-	char mbHeading_name_code[MBSYS_NAVNETCDF_ATTRIBUTELEN];
-	char mbHeading_units[MBSYS_NAVNETCDF_ATTRIBUTELEN];
-	char mbHeading_unit_code[MBSYS_NAVNETCDF_ATTRIBUTELEN];
-	char mbHeading_format_C[MBSYS_NAVNETCDF_ATTRIBUTELEN];
-	char mbHeading_orientation[MBSYS_NAVNETCDF_ATTRIBUTELEN];
-	double mbHeading_add_offset;
-	double mbHeading_scale_factor;
-	int mbHeading_minimum;
-	int mbHeading_maximum;
-	int mbHeading_valid_minimum;
-	int mbHeading_valid_maximum;
-	int mbHeading_missing_value;
-	char mbSpeed_type[MBSYS_NAVNETCDF_ATTRIBUTELEN];
-	char mbSpeed_long_name[MBSYS_NAVNETCDF_ATTRIBUTELEN];
-	char mbSpeed_name_code[MBSYS_NAVNETCDF_ATTRIBUTELEN];
-	char mbSpeed_units[MBSYS_NAVNETCDF_ATTRIBUTELEN];
-	char mbSpeed_unit_code[MBSYS_NAVNETCDF_ATTRIBUTELEN];
-	char mbSpeed_format_C[MBSYS_NAVNETCDF_ATTRIBUTELEN];
-	char mbSpeed_orientation[MBSYS_NAVNETCDF_ATTRIBUTELEN];
-	double mbSpeed_add_offset;
-	double mbSpeed_scale_factor;
-	int mbSpeed_minimum;
-	int mbSpeed_maximum;
-	int mbSpeed_valid_minimum;
-	int mbSpeed_valid_maximum;
-	int mbSpeed_missing_value;
-	char mbPType_type[MBSYS_NAVNETCDF_ATTRIBUTELEN];
-	char mbPType_long_name[MBSYS_NAVNETCDF_ATTRIBUTELEN];
-	char mbPType_name_code[MBSYS_NAVNETCDF_ATTRIBUTELEN];
-	char mbPType_units[MBSYS_NAVNETCDF_ATTRIBUTELEN];
-	char mbPType_unit_code[MBSYS_NAVNETCDF_ATTRIBUTELEN];
-	char mbPType_format_C[MBSYS_NAVNETCDF_ATTRIBUTELEN];
-	char mbPType_orientation[MBSYS_NAVNETCDF_ATTRIBUTELEN];
-	int mbPType_add_offset;
-	int mbPType_scale_factor;
-	int mbPType_minimum;
-	int mbPType_maximum;
-	int mbPType_valid_minimum;
-	int mbPType_valid_maximum;
-	int mbPType_missing_value;
-	char mbPQuality_type[MBSYS_NAVNETCDF_ATTRIBUTELEN];
-	char mbPQuality_long_name[MBSYS_NAVNETCDF_ATTRIBUTELEN];
-	char mbPQuality_name_code[MBSYS_NAVNETCDF_ATTRIBUTELEN];
-	char mbPQuality_units[MBSYS_NAVNETCDF_ATTRIBUTELEN];
-	char mbPQuality_unit_code[MBSYS_NAVNETCDF_ATTRIBUTELEN];
-	char mbPQuality_format_C[MBSYS_NAVNETCDF_ATTRIBUTELEN];
-	char mbPQuality_orientation[MBSYS_NAVNETCDF_ATTRIBUTELEN];
-	int mbPQuality_add_offset;
-	int mbPQuality_scale_factor;
-	int mbPQuality_minimum;
-	int mbPQuality_maximum;
-	int mbPQuality_valid_minimum;
-	int mbPQuality_valid_maximum;
-	int mbPQuality_missing_value;
-	char mbPFlag_type[MBSYS_NAVNETCDF_ATTRIBUTELEN];
-	char mbPFlag_long_name[MBSYS_NAVNETCDF_ATTRIBUTELEN];
-	char mbPFlag_name_code[MBSYS_NAVNETCDF_ATTRIBUTELEN];
-	char mbPFlag_units[MBSYS_NAVNETCDF_ATTRIBUTELEN];
-	char mbPFlag_unit_code[MBSYS_NAVNETCDF_ATTRIBUTELEN];
-	char mbPFlag_format_C[MBSYS_NAVNETCDF_ATTRIBUTELEN];
-	char mbPFlag_orientation[MBSYS_NAVNETCDF_ATTRIBUTELEN];
-	int mbPFlag_add_offset;
-	int mbPFlag_scale_factor;
-	int mbPFlag_minimum;
-	int mbPFlag_maximum;
-	int mbPFlag_valid_minimum;
-	int mbPFlag_valid_maximum;
-	int mbPFlag_missing_value;
-
-	/* storage comment string */
-	char	comment[MBSYS_NAVNETCDF_COMMENTLEN];
-	};
-
-/* system specific function prototypes */
-int mbsys_navnetcdf_alloc(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error);
-int mbsys_navnetcdf_deall(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error);
-int mbsys_navnetcdf_dimensions(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int *nbath, int *namp, int *nss, int *error);
-int mbsys_navnetcdf_extract(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int time_i[7], double *time_d,
-			double *navlon, double *navlat,
-			double *speed, double *heading,
-			int *nbath, int *namp, int *nss,
-			char *beamflag, double *bath, double *amp,
-			double *bathacrosstrack, double *bathalongtrack,
-			double *ss, double *ssacrosstrack, double *ssalongtrack,
-			char *comment, int *error);
-int mbsys_navnetcdf_insert(int verbose, void *mbio_ptr, void *store_ptr,
-			int kind, int time_i[7], double time_d,
-			double navlon, double navlat,
-			double speed, double heading,
-			int nbath, int namp, int nss,
-			char *beamflag, double *bath, double *amp,
-			double *bathacrosstrack, double *bathalongtrack,
-			double *ss, double *ssacrosstrack, double *ssalongtrack,
-			char *comment, int *error);
-int mbsys_navnetcdf_ttimes(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int *nbeams,
-			double *ttimes, double *angles,
-			double *angles_forward, double *angles_null,
-			double *heave, double *alongtrack_offset,
-			double *draft, double *ssv, int *error);
-int mbsys_navnetcdf_detects(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int *nbeams, int *detects, int *error);
-int mbsys_navnetcdf_extract_altitude(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, double *transducer_depth, double *altitude,
-			int *error);
-int mbsys_navnetcdf_insert_altitude(int verbose, void *mbio_ptr, void *store_ptr,
-			double transducer_depth, double altitude,
-			int *error);
-int mbsys_navnetcdf_extract_nav(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int time_i[7], double *time_d,
-			double *navlon, double *navlat,
-			double *speed, double *heading, double *draft,
-			double *roll, double *pitch, double *heave,
-			int *error);
-int mbsys_navnetcdf_insert_nav(int verbose, void *mbio_ptr, void *store_ptr,
-			int time_i[7], double time_d,
-			double navlon, double navlat,
-			double speed, double heading, double draft,
-			double roll, double pitch, double heave,
-			int *error);
-int mbsys_navnetcdf_extract_svp(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind,
-			int *nsvp,
-			double *depth, double *velocity,
-			int *error);
-int mbsys_navnetcdf_insert_svp(int verbose, void *mbio_ptr, void *store_ptr,
-			int nsvp,
-			double *depth, double *velocity,
-			int *error);
-int mbsys_navnetcdf_copy(int verbose, void *mbio_ptr,
-			void *store_ptr, void *copy_ptr,
-			int *error);
diff --git a/src/mbio/mbsys_netcdf.c b/src/mbio/mbsys_netcdf.c
deleted file mode 100644
index 8d47b14..0000000
--- a/src/mbio/mbsys_netcdf.c
+++ /dev/null
@@ -1,3799 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbsys_netcdf.c	4/11/2002
- *	$Id: mbsys_netcdf.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 2002-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbsys_netcdf.c includes the functions used by MBIO functions
- * to extract and insert data from the IFREMER netCDF multibeam format.
- * The MBIO format id is:
- *      MBF_MBNETCDF : MBIO ID 75
- *
- * Author:	D. W. Caress
- * Date:	April 11, 2002
- *
- * $Log: mbsys_netcdf.c,v $
- * Revision 5.12  2008/12/05 17:32:52  caress
- * Check-in mods 5 December 2008 including contributions from Gordon Keith.
- *
- * Revision 5.11  2008/09/13 06:08:09  caress
- * Updates to apply suggested patches to segy handling. Also fixes to remove compiler warnings.
- *
- * Revision 5.10  2008/07/10 18:02:39  caress
- * Proceeding towards 5.1.1beta20.
- *
- * Revision 5.7  2008/05/16 22:56:24  caress
- * Release 5.1.1beta18.
- *
- * Revision 5.6  2005/11/05 00:48:03  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.5  2003/12/04 23:10:23  caress
- * Fixed problems with format 54 EM12DARW due to old code assuming how internal structure was packed. Also changed handling of beamflags for formats that don't support beamflags. Now flagged beams will always be nulled in such cases.
- *
- * Revision 5.4  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.3  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.2  2002/07/20 20:42:40  caress
- * Release 5.0.beta20
- *
- * Revision 5.1  2002/05/29 23:40:48  caress
- * Release 5.0.beta18
- *
- * Revision 5.0  2002/05/02 03:56:34  caress
- * Release 5.0.beta17
- *
- *
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mb_define.h"
-#include "mbsys_netcdf.h"
-
-static char rcs_id[]="$Id: mbsys_netcdf.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mbsys_netcdf_alloc(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_netcdf_alloc";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_netcdf_struct *store;
-	char	c;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* allocate memory for data structure */
-	status = mb_mallocd(verbose,__FILE__,__LINE__,sizeof(struct mbsys_netcdf_struct),
-				(void **)store_ptr,error);
-
-	/* get data structure pointer */
-	store = (struct mbsys_netcdf_struct *) *store_ptr;
-
-	/* now initialize everything */
-	if (status == MB_SUCCESS)
-	    {
-	    memset(store, 0, sizeof(struct mbsys_netcdf_struct));
-
-	    /* dimensions */
-	    store->CIB_BLOCK_DIM = 0 ;
-	    store->mbHistoryRecNbr = 0 ;
-	    store->mbNameLength = MBSYS_NETCDF_NAMELEN ;
-	    store->mbCommentLength = MBSYS_NETCDF_COMMENTLEN ;
-	    store->mbAntennaNbr = 1 ;
-	    store->mbBeamNbr = 0 ;
-	    store->mbCycleNbr = 0 ;
-	    store->mbVelocityProfilNbr = MBSYS_NETCDF_VELPROFNBR ;
-
-	    /* global attributes */
-	    store->mbVersion = 108;
-	    strcpy(store->mbName, " ");
-	    strcpy(store->mbClasse, "MB_SWATH");
-	    store->mbLevel = 0;
-	    store->mbNbrHistoryRec = 0;
-	    strcpy(store->mbTimeReference, "Julian date for 1970/01/01 = 2 440 588");
-	    store->mbStartDate = 0;
-	    store->mbStartTime = 0;
-	    store->mbEndDate = 0;
-	    store->mbEndTime = 0;
-	    store->mbNorthLatitude = 0.;
-	    store->mbSouthLatitude = 0.;
-	    store->mbEastLongitude = 0.;
-	    store->mbWestLongitude = 0.;
-	    strcpy(store->mbMeridian180, " ");
-	    for (i=0;i<MBSYS_NETCDF_ATTRIBUTELEN;i++)
-		{
-		if (i < MBSYS_NETCDF_ATTRIBUTELEN-1)
-			c = ' ';
-		else
-			c = '\0';
-		store->mbGeoDictionnary[i] = c;
-		store->mbGeoRepresentation[i] = c;
-		store->mbGeodesicSystem[i] = c;
-		}
-	    store->mbEllipsoidA = 0.;
-	    store->mbEllipsoidInvF = 0.;
-	    store->mbEllipsoidE2 = 0.;
-	    store->mbProjType = -1;
-	    for (i=0;i<10;i++)
-		store->mbProjParameterValue[i] = 0.;
-	    store->mbSounder = MBSYS_NETCDF_SONAR_UNKNOWN;
-	    for (i=0;i<3;i++)
-		store->mbAntennaOffset[i] = 0.;
-	    store->mbAntennaDelay = 0.;
-	    for (i=0;i<3;i++)
-		store->mbSounderOffset[i] = 0.;
-	    store->mbSounderDelay = 0.;
-	    for (i=0;i<3;i++)
-		store->mbVRUOffset[i] = 0.;
-	    store->mbVRUDelay = 0.;
-	    store->mbHeadingBias = 0.;
-	    store->mbRollBias = 0.;
-	    store->mbPitchBias = 0.;
-	    store->mbHeaveBias = 0.;
-	    store->mbDraught = 0.;
-	    store->mbNavType = 0;
-	    store->mbTideType = 0;
-	    store->mbMinDepth = 0.;
-	    store->mbMaxDepth = 0.;
-	    store->mbCycleCounter = 0;
-	    for (i=0;i<MBSYS_NETCDF_COMMENTLEN-1;i++)
-		{
-		if (i < MBSYS_NETCDF_COMMENTLEN-1)
-			c = ' ';
-		else
-			c = '\0';
-		store->mbEllipsoidName[i] = c;
-		store->mbProjParameterCode[i] = c;
-		store->mbShip[i] = c;
-		store->mbSurvey[i] = c;
-		store->mbReference[i] = c;
-		store->mbNavRef[i] = c;
-		store->mbTideRef[i] = c;
-		}
-
-	    /* variable attributes */
-	    strcpy(store->mbHistDate_type, "integer");
-	    strcpy(store->mbHistDate_long_name, "History date");
-	    strcpy(store->mbHistDate_name_code, "MB_HISTORY_DATE");
-	    strcpy(store->mbHistDate_units, "Julian_date");
-	    strcpy(store->mbHistDate_unit_code, "MB_JULIAN_DATE");
-	    store->mbHistDate_add_offset = 2440588;
-	    store->mbHistDate_scale_factor = 1;
-	    store->mbHistDate_minimum = -25567;
-	    store->mbHistDate_maximum = 47482;
-	    store->mbHistDate_valid_minimum = -25567;
-	    store->mbHistDate_valid_maximum = 47482;
-	    store->mbHistDate_missing_value = 2147483647;
-	    strcpy(store->mbHistDate_format_C, "%d");
-	    strcpy(store->mbHistDate_orientation, "direct");
-	    strcpy(store->mbHistTime_type, "integer");
-	    strcpy(store->mbHistTime_long_name, "History time (UT)");
-	    strcpy(store->mbHistTime_name_code, "MB_HISTORY_TIME");
-	    strcpy(store->mbHistTime_units, "ms");
-	    strcpy(store->mbHistTime_unit_code, "MB_MS");
-	    store->mbHistTime_add_offset = 0;
-	    store->mbHistTime_scale_factor = 1;
-	    store->mbHistTime_minimum = 0;
-	    store->mbHistTime_maximum = 86399999;
-	    store->mbHistTime_valid_minimum = 0;
-	    store->mbHistTime_valid_maximum = 86399999;
-	    store->mbHistTime_missing_value = -2000000000 - 147483648;
-	    strcpy(store->mbHistTime_format_C, "%d");
-	    strcpy(store->mbHistTime_orientation, "direct");
-	    strcpy(store->mbHistCode_type, "integer");
-	    strcpy(store->mbHistCode_long_name, "History code");
-	    strcpy(store->mbHistCode_name_code, "MB_HISTORY_CODE");
-	    strcpy(store->mbHistCode_units, "");
-	    strcpy(store->mbHistCode_unit_code, "MB_NOT_DEFINED");
-	    store->mbHistCode_add_offset = 0;
-	    store->mbHistCode_scale_factor = 1;
-	    store->mbHistCode_minimum = 1;
-	    store->mbHistCode_maximum = 255;
-	    store->mbHistCode_valid_minimum = 1;
-	    store->mbHistCode_valid_maximum = 255;
-	    store->mbHistCode_missing_value = 0;
-	    strcpy(store->mbHistCode_format_C, "%d");
-	    strcpy(store->mbHistCode_orientation, "direct");
-	    strcpy(store->mbHistAutor_type, "string");
-	    strcpy(store->mbHistAutor_long_name, "History autor");
-	    strcpy(store->mbHistAutor_name_code, "MB_HISTORY_AUTOR");
-	    strcpy(store->mbHistModule_type, "string");
-	    strcpy(store->mbHistModule_long_name, "History module");
-	    strcpy(store->mbHistModule_name_code, "MB_HISTORY_MODULE");
-	    strcpy(store->mbHistComment_type, "string");
-	    strcpy(store->mbHistComment_long_name, "History comment");
-	    strcpy(store->mbHistComment_name_code, "MB_HISTORY_COMMENT");
-	    strcpy(store->mbCycle_type, "integer");
-	    strcpy(store->mbCycle_long_name, "Cycle number");
-	    strcpy(store->mbCycle_name_code, "MB_CYCLE_NUMBER");
-	    strcpy(store->mbCycle_units, "");
-	    strcpy(store->mbCycle_unit_code, "MB_NOT_DEFINED");
-	    store->mbCycle_add_offset = 0;
-	    store->mbCycle_scale_factor = 1;
-	    store->mbCycle_minimum = 1;
-	    store->mbCycle_maximum = 2147483647;
-	    store->mbCycle_valid_minimum = 1;
-	    store->mbCycle_valid_maximum = 2147483647;
-	    store->mbCycle_missing_value = 0;
-	    strcpy(store->mbCycle_format_C, "%d");
-	    strcpy(store->mbCycle_orientation, "direct");
-	    strcpy(store->mbDate_type, "integer");
-	    strcpy(store->mbDate_long_name, "Date of cycle");
-	    strcpy(store->mbDate_name_code, "MB_CYCLE_DATE");
-	    strcpy(store->mbDate_units, "Julian_date");
-	    strcpy(store->mbDate_unit_code, "MB_JULIAN_DATE");
-	    store->mbDate_add_offset = 2440588;
-	    store->mbDate_scale_factor = 1;
-	    store->mbDate_minimum = -25567;
-	    store->mbDate_maximum = 47482;
-	    store->mbDate_valid_minimum = -25567;
-	    store->mbDate_valid_maximum = 47482;
-	    store->mbDate_missing_value = 2147483647;
-	    strcpy(store->mbDate_format_C, "%d");
-	    strcpy(store->mbDate_orientation, "direct");
-	    strcpy(store->mbTime_type, "integer");
-	    strcpy(store->mbTime_long_name, "Time of cycle");
-	    strcpy(store->mbTime_name_code, "MB_CYCLE_TIME");
-	    strcpy(store->mbTime_units, "ms");
-	    strcpy(store->mbTime_unit_code, "MB_MS");
-	    store->mbTime_add_offset = 0;
-	    store->mbTime_scale_factor = 1;
-	    store->mbTime_minimum = 0;
-	    store->mbTime_maximum = 86399999;
-	    store->mbTime_valid_minimum = 0;
-	    store->mbTime_valid_maximum = 86399999;
-	    store->mbTime_missing_value = -2000000000 - 147483648;
-	    strcpy(store->mbTime_format_C, "%d");
-	    strcpy(store->mbTime_orientation, "direct");
-	    strcpy(store->mbOrdinate_type, "real");
-	    strcpy(store->mbOrdinate_long_name, "Latitude");
-	    strcpy(store->mbOrdinate_name_code, "MB_CYCLE_LATITUDE");
-	    strcpy(store->mbOrdinate_units, "degree");
-	    strcpy(store->mbOrdinate_unit_code, "MB_DEGREE");
-	    store->mbOrdinate_add_offset = 0.;
-	    store->mbOrdinate_scale_factor = 5.e-08;
-	    store->mbOrdinate_minimum = -1800000000;
-	    store->mbOrdinate_maximum = 1800000000;
-	    store->mbOrdinate_valid_minimum = -1800000000;
-	    store->mbOrdinate_valid_maximum = 1800000000;
-	    store->mbOrdinate_missing_value = -2000000000 - 147483648;
-	    strcpy(store->mbOrdinate_format_C, "%f");
-	    strcpy(store->mbOrdinate_orientation, "direct");
-	    strcpy(store->mbAbscissa_type, "real");
-	    strcpy(store->mbAbscissa_long_name, "Longitude");
-	    strcpy(store->mbAbscissa_name_code, "MB_CYCLE_LONGITUDE");
-	    strcpy(store->mbAbscissa_units, "degree");
-	    strcpy(store->mbAbscissa_unit_code, "MB_DEGREE");
-	    store->mbAbscissa_add_offset = 0.;
-	    store->mbAbscissa_scale_factor = 1.e-07;
-	    store->mbAbscissa_minimum = -1800000000;
-	    store->mbAbscissa_maximum = 1800000000;
-	    store->mbAbscissa_valid_minimum = -1800000000;
-	    store->mbAbscissa_valid_maximum = 1800000000;
-	    store->mbAbscissa_missing_value = -2000000000 - 147483648;
-	    strcpy(store->mbAbscissa_format_C, "%f");
-	    strcpy(store->mbAbscissa_orientation, "direct");
-	    strcpy(store->mbFrequency_type, "integer");
-	    strcpy(store->mbFrequency_long_name, "Frequency of cycle");
-	    strcpy(store->mbFrequency_name_code, "MB_CYCLE_FREQUENCY");
-	    strcpy(store->mbFrequency_units, "");
-	    strcpy(store->mbFrequency_unit_code, "MB_NOT_DEFINED");
-	    store->mbFrequency_add_offset = 0;
-	    store->mbFrequency_scale_factor = 1;
-	    store->mbFrequency_minimum = 1;
-	    store->mbFrequency_maximum = 255;
-	    store->mbFrequency_valid_minimum = 1;
-	    store->mbFrequency_valid_maximum = 255;
-	    store->mbFrequency_missing_value = 0;
-	    strcpy(store->mbFrequency_format_C, "%d");
-	    strcpy(store->mbFrequency_orientation, "direct");
-	    strcpy(store->mbSonarFrequency_type, "real");
-	    strcpy(store->mbSonarFrequency_long_name, "Sonar frequency of ping");
-	    strcpy(store->mbSonarFrequency_name_code, "MB_CYCLE_SONAR_FREQUENCY");
-	    strcpy(store->mbSonarFrequency_units, "Khz");
-	    strcpy(store->mbSonarFrequency_unit_code, "MB_KHERTZ");
-	    store->mbSonarFrequency_add_offset = 0;
-	    store->mbSonarFrequency_scale_factor = 1.e-06;
-	    store->mbSonarFrequency_minimum = 1000.;
-	    store->mbSonarFrequency_maximum = 1000000000.;
-	    store->mbSonarFrequency_valid_minimum = 1000;
-	    store->mbSonarFrequency_valid_maximum = 1000000000;
-	    store->mbSonarFrequency_missing_value = 0;
-	    strcpy(store->mbSonarFrequency_format_C, "%f");
-	    strcpy(store->mbSonarFrequency_orientation, "direct");
-	    strcpy(store->mbSounderMode_type, "integer");
-	    strcpy(store->mbSounderMode_long_name, "Sounder mode");
-	    strcpy(store->mbSounderMode_name_code, "MB_CYCLE_MODE");
-	    strcpy(store->mbSounderMode_units, "");
-	    strcpy(store->mbSounderMode_unit_code, "MB_NOT_DEFINED");
-	    store->mbSounderMode_add_offset = 0;
-	    store->mbSounderMode_scale_factor = 1;
-	    store->mbSounderMode_minimum = 1;
-	    store->mbSounderMode_maximum = 255;
-	    store->mbSounderMode_valid_minimum = 1;
-	    store->mbSounderMode_valid_maximum = 255;
-	    store->mbSounderMode_missing_value = 0;
-	    strcpy(store->mbSounderMode_format_C, "%d");
-	    strcpy(store->mbSounderMode_orientation, "direct");
-	    strcpy(store->mbReferenceDepth_type, "real");
-	    strcpy(store->mbReferenceDepth_long_name, "Depth of the reference point");
-	    strcpy(store->mbReferenceDepth_name_code, "MB_CYCLE_REFERENCE_DEPTH");
-	    strcpy(store->mbReferenceDepth_units, "m");
-	    strcpy(store->mbReferenceDepth_unit_code, "MB_M");
-	    store->mbReferenceDepth_add_offset = 0.;
-	    store->mbReferenceDepth_scale_factor = 0.01;
-	    store->mbReferenceDepth_minimum = -2147483647;
-	    store->mbReferenceDepth_maximum = 2147483647;
-	    store->mbReferenceDepth_valid_minimum = -2147483647;
-	    store->mbReferenceDepth_valid_maximum = 2147483647;
-	    store->mbReferenceDepth_missing_value = -2147483648LL;
-	    strcpy(store->mbReferenceDepth_format_C, "%.2f");
-	    strcpy(store->mbReferenceDepth_orientation, "direct");
-	    strcpy(store->mbDynamicDraught_type, "real");
-	    strcpy(store->mbDynamicDraught_long_name, "Dynamic draught correction");
-	    strcpy(store->mbDynamicDraught_name_code, "MB_CYCLE_DRAUGHT");
-	    strcpy(store->mbDynamicDraught_units, "m");
-	    strcpy(store->mbDynamicDraught_unit_code, "MB_M");
-	    store->mbDynamicDraught_add_offset = 0.;
-	    store->mbDynamicDraught_scale_factor = 0.01;
-	    store->mbDynamicDraught_minimum = -1000;
-	    store->mbDynamicDraught_maximum = 1000;
-	    store->mbDynamicDraught_valid_minimum = -1000;
-	    store->mbDynamicDraught_valid_maximum = 1000;
-	    store->mbDynamicDraught_missing_value = -32768;
-	    strcpy(store->mbDynamicDraught_format_C, "%.2f");
-	    strcpy(store->mbDynamicDraught_orientation, "direct");
-	    strcpy(store->mbTide_type, "real");
-	    strcpy(store->mbTide_long_name, "Tide correction");
-	    strcpy(store->mbTide_name_code, "MB_CYCLE_TIDE");
-	    strcpy(store->mbTide_units, "m");
-	    strcpy(store->mbTide_unit_code, "MB_M");
-	    store->mbTide_add_offset = 0.;
-	    store->mbTide_scale_factor = 0.01;
-	    store->mbTide_minimum = -2000;
-	    store->mbTide_maximum = 2000;
-	    store->mbTide_valid_minimum = -2000;
-	    store->mbTide_valid_maximum = 2000;
-	    store->mbTide_missing_value = -32768;
-	    strcpy(store->mbTide_format_C, "%.2f");
-	    strcpy(store->mbTide_orientation, "direct");
-	    strcpy(store->mbSoundVelocity_type, "real");
-	    strcpy(store->mbSoundVelocity_long_name, "Surface sound velocity");
-	    strcpy(store->mbSoundVelocity_name_code, "MB_CYCLE_VELOCITY");
-	    strcpy(store->mbSoundVelocity_units, "m/s");
-	    strcpy(store->mbSoundVelocity_unit_code, "MB_M/S");
-	    store->mbSoundVelocity_add_offset = 1400.;
-	    store->mbSoundVelocity_scale_factor = 0.01;
-	    store->mbSoundVelocity_minimum = 0;
-	    store->mbSoundVelocity_maximum = 32767;
-	    store->mbSoundVelocity_valid_minimum = 0;
-	    store->mbSoundVelocity_valid_maximum = 32767;
-	    store->mbSoundVelocity_missing_value = -32768;
-	    strcpy(store->mbSoundVelocity_format_C, "%.2f");
-	    strcpy(store->mbSoundVelocity_orientation, "direct");
-	    strcpy(store->mbHeading_type, "real");
-	    strcpy(store->mbHeading_long_name, "Heading of ship");
-	    strcpy(store->mbHeading_name_code, "MB_CYCLE_HEADING");
-	    strcpy(store->mbHeading_units, "degree");
-	    strcpy(store->mbHeading_unit_code, "MB_DEGREE");
-	    store->mbHeading_add_offset = 0.;
-	    store->mbHeading_scale_factor = 0.01;
-	    store->mbHeading_minimum = 0;
-	    store->mbHeading_maximum = 35999;
-	    store->mbHeading_valid_minimum = 0;
-	    store->mbHeading_valid_maximum = 35999;
-	    store->mbHeading_missing_value = 65535;
-	    strcpy(store->mbHeading_format_C, "%.2f");
-	    strcpy(store->mbHeading_orientation, "direct");
-	    strcpy(store->mbRoll_type, "real");
-	    strcpy(store->mbRoll_long_name, "Roll");
-	    strcpy(store->mbRoll_name_code, "MB_CYCLE_ROLL");
-	    strcpy(store->mbRoll_units, "degree");
-	    strcpy(store->mbRoll_unit_code, "MB_DEGREE");
-	    store->mbRoll_add_offset = 0.;
-	    store->mbRoll_scale_factor = 0.01;
-	    store->mbRoll_minimum = -2100;
-	    store->mbRoll_maximum = 2100;
-	    store->mbRoll_valid_minimum = -2100;
-	    store->mbRoll_valid_maximum = 2100;
-	    store->mbRoll_missing_value = -32768;
-	    strcpy(store->mbRoll_format_C, "%.2f");
-	    strcpy(store->mbRoll_orientation, "direct");
-	    strcpy(store->mbPitch_type, "real");
-	    strcpy(store->mbPitch_long_name, "Pitch");
-	    strcpy(store->mbPitch_name_code, "MB_CYCLE_PITCH");
-	    strcpy(store->mbPitch_units, "degree");
-	    strcpy(store->mbPitch_unit_code, "MB_DEGREE");
-	    store->mbPitch_add_offset = 0.;
-	    store->mbPitch_scale_factor = 0.01;
-	    store->mbPitch_minimum = -2100;
-	    store->mbPitch_maximum = 2100;
-	    store->mbPitch_valid_minimum = -2100;
-	    store->mbPitch_valid_maximum = 2100;
-	    store->mbPitch_missing_value = -32768;
-	    strcpy(store->mbPitch_format_C, "%.2f");
-	    strcpy(store->mbPitch_orientation, "direct");
-	    strcpy(store->mbTransmissionHeave_type, "real");
-	    strcpy(store->mbTransmissionHeave_long_name, "Emission heave");
-	    strcpy(store->mbTransmissionHeave_name_code, "MB_CYCLE_HEAVE");
-	    strcpy(store->mbTransmissionHeave_units, "m");
-	    strcpy(store->mbTransmissionHeave_unit_code, "MB_M");
-	    store->mbTransmissionHeave_add_offset = 0.;
-	    store->mbTransmissionHeave_scale_factor = 0.01;
-	    store->mbTransmissionHeave_minimum = -1000;
-	    store->mbTransmissionHeave_maximum = 1000;
-	    store->mbTransmissionHeave_valid_minimum = -1000;
-	    store->mbTransmissionHeave_valid_maximum = 1000;
-	    store->mbTransmissionHeave_missing_value = -32768;
-	    strcpy(store->mbTransmissionHeave_format_C, "%.2f");
-	    strcpy(store->mbTransmissionHeave_orientation, "direct");
-	    strcpy(store->mbDistanceScale_type, "real");
-	    strcpy(store->mbDistanceScale_long_name, "Horizontal scale");
-	    strcpy(store->mbDistanceScale_name_code, "MB_CYCLE_XY_SCALE");
-	    strcpy(store->mbDistanceScale_units, "m");
-	    strcpy(store->mbDistanceScale_unit_code, "MB_M");
-	    store->mbDistanceScale_add_offset = 0.;
-	    store->mbDistanceScale_scale_factor = 0.01;
-	    store->mbDistanceScale_minimum = 1;
-	    store->mbDistanceScale_maximum = 255;
-	    store->mbDistanceScale_valid_minimum = 1;
-	    store->mbDistanceScale_valid_maximum = 255;
-	    store->mbDistanceScale_missing_value = 0;
-	    strcpy(store->mbDistanceScale_format_C, "%.2f");
-	    strcpy(store->mbDistanceScale_orientation, "direct");
-	    strcpy(store->mbRangeScale_type, "real");
-	    strcpy(store->mbRangeScale_long_name, "Range scale");
-	    strcpy(store->mbRangeScale_name_code, "MB_CYCLE_RANGE_SCALE");
-	    strcpy(store->mbRangeScale_units, "s");
-	    strcpy(store->mbRangeScale_unit_code, "MB_S");
-	    store->mbRangeScale_add_offset = 0;
-	    store->mbRangeScale_scale_factor = 2.e-08;
-	    store->mbRangeScale_minimum = 1.;
-	    store->mbRangeScale_maximum = 65535.;
-	    store->mbRangeScale_valid_minimum = 1;
-	    store->mbRangeScale_valid_maximum = 65535;
-	    store->mbRangeScale_missing_value = 0;
-	    strcpy(store->mbRangeScale_format_C, "%.7f");
-	    strcpy(store->mbRangeScale_orientation, "direct");
-	    strcpy(store->mbDepthScale_type, "real");
-	    strcpy(store->mbDepthScale_long_name, "Depth scale");
-	    strcpy(store->mbDepthScale_name_code, "MB_CYCLE_Z_SCALE");
-	    strcpy(store->mbDepthScale_units, "m");
-	    strcpy(store->mbDepthScale_unit_code, "MB_M");
-	    store->mbDepthScale_add_offset = 0.;
-	    store->mbDepthScale_scale_factor = 0.01;
-	    store->mbDepthScale_minimum = 1;
-	    store->mbDepthScale_maximum = 255;
-	    store->mbDepthScale_valid_minimum = 1;
-	    store->mbDepthScale_valid_maximum = 255;
-	    store->mbDepthScale_missing_value = 0;
-	    strcpy(store->mbDepthScale_format_C, "%.2f");
-	    strcpy(store->mbDepthScale_orientation, "direct");
-	    strcpy(store->mbVerticalDepth_type, "integer");
-	    strcpy(store->mbVerticalDepth_long_name, "Vertical depth");
-	    strcpy(store->mbVerticalDepth_name_code, "MB_CYCLE_DEPTH");
-	    strcpy(store->mbVerticalDepth_units, "");
-	    strcpy(store->mbVerticalDepth_unit_code, "MB_NOT_DEFINED");
-	    store->mbVerticalDepth_add_offset = 0;
-	    store->mbVerticalDepth_scale_factor = 1;
-	    store->mbVerticalDepth_minimum = -2147483647;
-	    store->mbVerticalDepth_maximum = 2147483647;
-	    store->mbVerticalDepth_valid_minimum = -2147483647;
-	    store->mbVerticalDepth_valid_maximum = 2147483647;
-	    store->mbVerticalDepth_missing_value = -2000000000 - 147483648;
-	    strcpy(store->mbVerticalDepth_format_C, "%d");
-	    strcpy(store->mbVerticalDepth_orientation, "direct");
-	    strcpy(store->mbCQuality_type, "integer");
-	    strcpy(store->mbCQuality_long_name, "Quality factor");
-	    strcpy(store->mbCQuality_name_code, "MB_CYCLE_QUALITY");
-	    strcpy(store->mbCQuality_units, "");
-	    strcpy(store->mbCQuality_unit_code, "MB_NOT_DEFINED");
-	    store->mbCQuality_add_offset = 0;
-	    store->mbCQuality_scale_factor = 1;
-	    store->mbCQuality_minimum = 1;
-	    store->mbCQuality_maximum = 255;
-	    store->mbCQuality_valid_minimum = 1;
-	    store->mbCQuality_valid_maximum = 255;
-	    store->mbCQuality_missing_value = 0;
-	    strcpy(store->mbCQuality_format_C, "%d");
-	    strcpy(store->mbCQuality_orientation, "direct");
-	    strcpy(store->mbCFlag_type, "integer");
-	    strcpy(store->mbCFlag_long_name, "Flag of cycle");
-	    strcpy(store->mbCFlag_name_code, "MB_CYCLE_FLAG");
-	    strcpy(store->mbCFlag_units, "");
-	    strcpy(store->mbCFlag_unit_code, "MB_NOT_DEFINED");
-	    store->mbCFlag_add_offset = 0;
-	    store->mbCFlag_scale_factor = 1;
-	    store->mbCFlag_minimum = -127;
-	    store->mbCFlag_maximum = 127;
-	    store->mbCFlag_valid_minimum = -127;
-	    store->mbCFlag_valid_maximum = 127;
-	    store->mbCFlag_missing_value = -128;
-	    strcpy(store->mbCFlag_format_C, "%d");
-	    strcpy(store->mbCFlag_orientation, "direct");
-	    strcpy(store->mbInterlacing_type, "integer");
-	    strcpy(store->mbInterlacing_long_name, "Interlacing 1=Port 2=Starboard");
-	    strcpy(store->mbInterlacing_name_code, "MB_CYCLE_INTERLACING");
-	    strcpy(store->mbInterlacing_units, "");
-	    strcpy(store->mbInterlacing_unit_code, "MB_NOT_DEFINED");
-	    store->mbInterlacing_add_offset = 0;
-	    store->mbInterlacing_scale_factor = 1;
-	    store->mbInterlacing_minimum = 1;
-	    store->mbInterlacing_maximum = 2;
-	    store->mbInterlacing_valid_minimum = 1;
-	    store->mbInterlacing_valid_maximum = 2;
-	    store->mbInterlacing_missing_value = 0;
-	    strcpy(store->mbInterlacing_format_C, "%d");
-	    strcpy(store->mbInterlacing_orientation, "direct");
-	    strcpy(store->mbSamplingRate_type, "integer");
-	    strcpy(store->mbSamplingRate_long_name, "Sampling Rate");
-	    strcpy(store->mbSamplingRate_name_code, "MB_SAMPLING_RATE");
-	    strcpy(store->mbSamplingRate_units, "Hz");
-	    strcpy(store->mbSamplingRate_unit_code, "MB_HZ");
-	    store->mbSamplingRate_add_offset = 0;
-	    store->mbSamplingRate_scale_factor = 1;
-	    store->mbSamplingRate_minimum = 1;
-	    store->mbSamplingRate_maximum = 65535;
-	    store->mbSamplingRate_valid_minimum = 1;
-	    store->mbSamplingRate_valid_maximum = 65535;
-	    store->mbSamplingRate_missing_value = 0;
-	    strcpy(store->mbSamplingRate_format_C, "%d");
-	    strcpy(store->mbSamplingRate_orientation, "direct");
-	    strcpy(store->mbCompensationLayerMode_type, "integer");
-	    strcpy(store->mbCompensationLayerMode_long_name, "Compensation layer mode");
-	    strcpy(store->mbCompensationLayerMode_name_code, "MB_CYCLE_COMPLAYER_MODE");
-	    strcpy(store->mbCompensationLayerMode_units, "");
-	    strcpy(store->mbCompensationLayerMode_unit_code, "MB_NOT_DEFINED");
-	    store->mbCompensationLayerMode_add_offset = 0;
-	    store->mbCompensationLayerMode_scale_factor = 1;
-	    store->mbCompensationLayerMode_minimum = 1;
-	    store->mbCompensationLayerMode_maximum = 255;
-	    store->mbCompensationLayerMode_valid_minimum = 1;
-	    store->mbCompensationLayerMode_valid_maximum = 255;
-	    store->mbCompensationLayerMode_missing_value = 0;
-	    strcpy(store->mbCompensationLayerMode_format_C, "%d");
-	    strcpy(store->mbCompensationLayerMode_orientation, "direct");
-	    strcpy(store->mbTransmitBeamwidth_type, "integer");
-	    strcpy(store->mbTransmitBeamwidth_long_name, "Transmit Beamwidth");
-	    strcpy(store->mbTransmitBeamwidth_name_code, "MB_TRANSMIT_BEAMWIDTH");
-	    strcpy(store->mbTransmitBeamwidth_units, "Hz");
-	    strcpy(store->mbTransmitBeamwidth_unit_code, "MB_DEGREE");
-	    store->mbTransmitBeamwidth_add_offset = 0;
-	    store->mbTransmitBeamwidth_scale_factor = 1;
-	    store->mbTransmitBeamwidth_minimum = 1;
-	    store->mbTransmitBeamwidth_maximum = 65535;
-	    store->mbTransmitBeamwidth_valid_minimum = 1;
-	    store->mbTransmitBeamwidth_valid_maximum = 65535;
-	    store->mbTransmitBeamwidth_missing_value = 0;
-	    strcpy(store->mbTransmitBeamwidth_format_C, "%0.1f");
-	    strcpy(store->mbTransmitBeamwidth_orientation, "direct");
-	    strcpy(store->mbReceiveBeamwidth_type, "integer");
-	    strcpy(store->mbReceiveBeamwidth_long_name, "Receive Beamwidth");
-	    strcpy(store->mbReceiveBeamwidth_name_code, "MB_RECEIVE_BEAMWIDTH");
-	    strcpy(store->mbReceiveBeamwidth_units, "Hz");
-	    strcpy(store->mbReceiveBeamwidth_unit_code, "MB_DEGREE");
-	    store->mbReceiveBeamwidth_add_offset = 0;
-	    store->mbReceiveBeamwidth_scale_factor = 1;
-	    store->mbReceiveBeamwidth_minimum = 1;
-	    store->mbReceiveBeamwidth_maximum = 255;
-	    store->mbReceiveBeamwidth_valid_minimum = 1;
-	    store->mbReceiveBeamwidth_valid_maximum = 255;
-	    store->mbReceiveBeamwidth_missing_value = 0;
-	    strcpy(store->mbReceiveBeamwidth_format_C, "%0.1f");
-	    strcpy(store->mbReceiveBeamwidth_orientation, "direct");
-	    strcpy(store->mbTransmitPulseLength_type, "integer");
-	    strcpy(store->mbTransmitPulseLength_long_name, "Transmit PulseLength");
-	    strcpy(store->mbTransmitPulseLength_name_code, "MB_TRANSMIT_PULSELENGTH");
-	    strcpy(store->mbTransmitPulseLength_units, "");
-	    strcpy(store->mbTransmitPulseLength_unit_code, "MB_NOT_DEFINED");
-	    store->mbTransmitPulseLength_add_offset = 0;
-	    store->mbTransmitPulseLength_scale_factor = 1;
-	    store->mbTransmitPulseLength_minimum = 1;
-	    store->mbTransmitPulseLength_maximum = 65535;
-	    store->mbTransmitPulseLength_valid_minimum = 1;
-	    store->mbTransmitPulseLength_valid_maximum = 65535;
-	    store->mbTransmitPulseLength_missing_value = 0;
-	    strcpy(store->mbTransmitPulseLength_format_C, "%d");
-	    strcpy(store->mbTransmitPulseLength_orientation, "direct");
-	    strcpy(store->mbAlongDistance_type, "integer");
-	    strcpy(store->mbAlongDistance_long_name, "Along distance");
-	    strcpy(store->mbAlongDistance_name_code, "MB_SOUNDING_X");
-	    strcpy(store->mbAlongDistance_units, "");
-	    strcpy(store->mbAlongDistance_unit_code, "MB_NOT_DEFINED");
-	    store->mbAlongDistance_add_offset = 0;
-	    store->mbAlongDistance_scale_factor = 1;
-	    store->mbAlongDistance_minimum = -32767;
-	    store->mbAlongDistance_maximum = 32767;
-	    store->mbAlongDistance_valid_minimum = -32767;
-	    store->mbAlongDistance_valid_maximum = 32767;
-	    store->mbAlongDistance_missing_value = -32768;
-	    strcpy(store->mbAlongDistance_format_C, "%d");
-	    strcpy(store->mbAlongDistance_orientation, "direct");
-	    strcpy(store->mbAcrossDistance_type, "integer");
-	    strcpy(store->mbAcrossDistance_long_name, "Across distance");
-	    strcpy(store->mbAcrossDistance_name_code, "MB_SOUNDING_Y");
-	    strcpy(store->mbAcrossDistance_units, "");
-	    strcpy(store->mbAcrossDistance_unit_code, "MB_NOT_DEFINED");
-	    store->mbAcrossDistance_add_offset = 0;
-	    store->mbAcrossDistance_scale_factor = 1;
-	    store->mbAcrossDistance_minimum = -32767;
-	    store->mbAcrossDistance_maximum = 32767;
-	    store->mbAcrossDistance_valid_minimum = -32767;
-	    store->mbAcrossDistance_valid_maximum = 32767;
-	    store->mbAcrossDistance_missing_value = -32768;
-	    strcpy(store->mbAcrossDistance_format_C, "%d");
-	    strcpy(store->mbAcrossDistance_orientation, "direct");
-	    strcpy(store->mbDepth_type, "integer");
-	    strcpy(store->mbDepth_long_name, "Depth");
-	    strcpy(store->mbDepth_name_code, "MB_SOUNDING_Z");
-	    strcpy(store->mbDepth_units, "");
-	    strcpy(store->mbDepth_unit_code, "MB_NOT_DEFINED");
-	    store->mbDepth_add_offset = 0;
-	    store->mbDepth_scale_factor = 1;
-	    store->mbDepth_minimum = -2147483647;
-	    store->mbDepth_maximum = 2147483647;
-	    store->mbDepth_valid_minimum = -2147483647;
-	    store->mbDepth_valid_maximum = 2147483647;
-	    store->mbDepth_missing_value = -2147483648LL;
-	    strcpy(store->mbDepth_format_C, "%d");
-	    strcpy(store->mbDepth_orientation, "inverse");
-	    strcpy(store->mbAcrossBeamAngle_type, "real");
-	    strcpy(store->mbAcrossBeamAngle_long_name, "Across angle");
-	    strcpy(store->mbAcrossBeamAngle_name_code, "MB_ACROSS_BEAM_ANGLE");
-	    strcpy(store->mbAcrossBeamAngle_units, "degree");
-	    strcpy(store->mbAcrossBeamAngle_unit_code, "MB_DEGREE");
-	    store->mbAcrossBeamAngle_add_offset = 0;
-	    store->mbAcrossBeamAngle_scale_factor = 0.01;
-	    store->mbAcrossBeamAngle_minimum = -9000;
-	    store->mbAcrossBeamAngle_maximum = 9000;
-	    store->mbAcrossBeamAngle_valid_minimum = -9000;
-	    store->mbAcrossBeamAngle_valid_maximum = 9000;
-	    store->mbAcrossBeamAngle_missing_value = -32768;
-	    strcpy(store->mbAcrossBeamAngle_format_C, "%.2f");
-	    strcpy(store->mbAcrossBeamAngle_orientation, "direct");
-	    strcpy(store->mbAzimutBeamAngle_type, "real");
-	    strcpy(store->mbAzimutBeamAngle_long_name, "Beam azimut");
-	    strcpy(store->mbAzimutBeamAngle_name_code, "MB_AZIMUT_BEAM_ANGLE");
-	    strcpy(store->mbAzimutBeamAngle_units, "degree");
-	    strcpy(store->mbAzimutBeamAngle_unit_code, "MB_DEGREE");
-	    store->mbAzimutBeamAngle_add_offset = 0;
-	    store->mbAzimutBeamAngle_scale_factor = 0.01;
-	    store->mbAzimutBeamAngle_minimum = 0;
-	    store->mbAzimutBeamAngle_maximum = 35999;
-	    store->mbAzimutBeamAngle_valid_minimum = 0;
-	    store->mbAzimutBeamAngle_valid_maximum = 35999;
-	    store->mbAzimutBeamAngle_missing_value = 32767;
-	    strcpy(store->mbAzimutBeamAngle_format_C, "%.2f");
-	    strcpy(store->mbAzimutBeamAngle_orientation, "direct");
-	    strcpy(store->mbRange_type, "integer");
-	    strcpy(store->mbRange_long_name, "Range");
-	    strcpy(store->mbRange_name_code, "MB_SOUNDING_RANGE");
-	    strcpy(store->mbRange_units, "");
-	    strcpy(store->mbRange_unit_code, "MB_NOT_DEFINED");
-	    store->mbRange_add_offset = 0;
-	    store->mbRange_scale_factor = 1;
-	    store->mbRange_minimum = 1;
-	    store->mbRange_maximum = 65535;
-	    store->mbRange_valid_minimum = 1;
-	    store->mbRange_valid_maximum = 65535;
-	    store->mbRange_missing_value = 0;
-	    strcpy(store->mbRange_format_C, "%.d");
-	    strcpy(store->mbRange_orientation, "direct");
-	    strcpy(store->mbSoundingBias_type, "real");
-	    strcpy(store->mbSoundingBias_long_name, "Sounding bias");
-	    strcpy(store->mbSoundingBias_name_code, "MB_SOUNDING_BIAS");
-	    strcpy(store->mbSoundingBias_units, "m");
-	    strcpy(store->mbSoundingBias_unit_code, "MB_B");
-	    store->mbSoundingBias_add_offset = 0;
-	    store->mbSoundingBias_scale_factor = 0.01;
-	    store->mbSoundingBias_minimum = -32767.;
-	    store->mbSoundingBias_maximum = 32767.;
-	    store->mbSoundingBias_valid_minimum = -32767;
-	    store->mbSoundingBias_valid_maximum = 32767;
-	    store->mbSoundingBias_missing_value = -32768;
-	    strcpy(store->mbSoundingBias_format_C, "%d");
-	    strcpy(store->mbSoundingBias_orientation, "direct");
-	    strcpy(store->mbSQuality_type, "integer");
-	    strcpy(store->mbSQuality_long_name, "Quality factor");
-	    strcpy(store->mbSQuality_name_code, "MB_SOUNDING_QUALITY");
-	    strcpy(store->mbSQuality_units, "");
-	    strcpy(store->mbSQuality_unit_code, "MB_NOT_DEFINED");
-	    store->mbSQuality_add_offset = 0;
-	    store->mbSQuality_scale_factor = 1;
-	    store->mbSQuality_minimum = 1;
-	    store->mbSQuality_maximum = 255;
-	    store->mbSQuality_valid_minimum = 1;
-	    store->mbSQuality_valid_maximum = 255;
-	    store->mbSQuality_missing_value = 0;
-	    strcpy(store->mbSQuality_format_C, "%d");
-	    strcpy(store->mbSQuality_orientation, "direct");
-	    strcpy(store->mbReflectivity_type, "real");
-	    strcpy(store->mbReflectivity_long_name, "Reflectivity");
-	    strcpy(store->mbReflectivity_name_code, "MB_SOUNDING_REFLECTIVITY");
-	    strcpy(store->mbReflectivity_units, "dB");
-	    strcpy(store->mbReflectivity_unit_code, "MB_DB");
-	    store->mbReflectivity_add_offset = 0;
-	    store->mbReflectivity_scale_factor = 0.5;
-	    store->mbReflectivity_minimum = -127;
-	    store->mbReflectivity_maximum = 127;
-	    store->mbReflectivity_valid_minimum = -127;
-	    store->mbReflectivity_valid_maximum = 127;
-	    store->mbReflectivity_missing_value = -128;
-	    strcpy(store->mbReflectivity_format_C, "%.2f");
-	    strcpy(store->mbReflectivity_orientation, "direct");
-	    strcpy(store->mbReceptionHeave_type, "real");
-	    strcpy(store->mbReceptionHeave_long_name, "Reception heave");
-	    strcpy(store->mbReceptionHeave_name_code, "MB_SOUNDING_HEAVE");
-	    strcpy(store->mbReceptionHeave_units, "m");
-	    strcpy(store->mbReceptionHeave_unit_code, "MB_M");
-	    store->mbReceptionHeave_add_offset = 0;
-	    store->mbReceptionHeave_scale_factor = 0.1;
-	    store->mbReceptionHeave_minimum = -127;
-	    store->mbReceptionHeave_maximum = 127;
-	    store->mbReceptionHeave_valid_minimum = -127;
-	    store->mbReceptionHeave_valid_maximum = 127;
-	    store->mbReceptionHeave_missing_value = -128;
-	    strcpy(store->mbReceptionHeave_format_C, "%.1f");
-	    strcpy(store->mbReceptionHeave_orientation, "direct");
-	    strcpy(store->mbAlongSlope_type, "real");
-	    strcpy(store->mbAlongSlope_long_name, "Along slope");
-	    strcpy(store->mbAlongSlope_name_code, "MB_SOUNDING_X_SLOPE");
-	    strcpy(store->mbAlongSlope_units, "%");
-	    strcpy(store->mbAlongSlope_unit_code, "MB_PERCENT");
-	    store->mbAlongSlope_add_offset = 0;
-	    store->mbAlongSlope_scale_factor = 0.01;
-	    store->mbAlongSlope_minimum = -32767;
-	    store->mbAlongSlope_maximum = 32767;
-	    store->mbAlongSlope_valid_minimum = -32767;
-	    store->mbAlongSlope_valid_maximum = 32767;
-	    store->mbAlongSlope_missing_value = -32768;
-	    strcpy(store->mbAlongSlope_format_C, "%.2f");
-	    strcpy(store->mbAlongSlope_orientation, "direct");
-	    strcpy(store->mbAcrossSlope_type, "real");
-	    strcpy(store->mbAcrossSlope_long_name, "Across slope");
-	    strcpy(store->mbAcrossSlope_name_code, "MB_SOUNDING_Y_SLOPE");
-	    strcpy(store->mbAcrossSlope_units, "%");
-	    strcpy(store->mbAcrossSlope_unit_code, "MB_PERCENT");
-	    store->mbAcrossSlope_add_offset = 0;
-	    store->mbAcrossSlope_scale_factor = 0.01;
-	    store->mbAcrossSlope_minimum = -32767;
-	    store->mbAcrossSlope_maximum = 32767;
-	    store->mbAcrossSlope_valid_minimum = -32767;
-	    store->mbAcrossSlope_valid_maximum = 32767;
-	    store->mbAcrossSlope_missing_value = -32768;
-	    strcpy(store->mbAcrossSlope_format_C, "%.2f");
-	    strcpy(store->mbAcrossSlope_orientation, "direct");
-	    strcpy(store->mbSFlag_type, "integer");
-	    strcpy(store->mbSFlag_long_name, "Flag of sounding");
-	    strcpy(store->mbSFlag_name_code, "MB_SOUNDING_FLAG");
-	    strcpy(store->mbSFlag_units, "");
-	    strcpy(store->mbSFlag_unit_code, "MB_NOT_DEFINED");
-	    store->mbSFlag_add_offset = 0;
-	    store->mbSFlag_scale_factor = 1;
-	    store->mbSFlag_minimum = -127;
-	    store->mbSFlag_maximum = 127;
-	    store->mbSFlag_valid_minimum = -127;
-	    store->mbSFlag_valid_maximum = 127;
-	    store->mbSFlag_missing_value = -128;
-	    strcpy(store->mbSFlag_format_C, "%d");
-	    strcpy(store->mbSFlag_orientation, "direct");
-	    strcpy(store->mbSLengthOfDetection_type, "integer");
-	    strcpy(store->mbSLengthOfDetection_long_name, "Length of detection");
-	    strcpy(store->mbSLengthOfDetection_name_code, "MB_LENGTH_DETECTION");
-	    strcpy(store->mbSLengthOfDetection_units, "");
-	    strcpy(store->mbSLengthOfDetection_unit_code, "MB_NOT_DEFINED");
-	    store->mbSLengthOfDetection_add_offset = 0;
-	    store->mbSLengthOfDetection_scale_factor = 1;
-	    store->mbSLengthOfDetection_minimum = 1;
-	    store->mbSLengthOfDetection_maximum = 255;
-	    store->mbSLengthOfDetection_valid_minimum = 1;
-	    store->mbSLengthOfDetection_valid_maximum = 255;
-	    store->mbSLengthOfDetection_missing_value = 0;
-	    strcpy(store->mbSLengthOfDetection_format_C, "%d");
-	    strcpy(store->mbSLengthOfDetection_orientation, "direct");
-	    strcpy(store->mbAntenna_type, "integer");
-	    strcpy(store->mbAntenna_long_name, "Antenna index");
-	    strcpy(store->mbAntenna_name_code, "MB_BEAM_ANTENNA");
-	    strcpy(store->mbAntenna_units, "");
-	    strcpy(store->mbAntenna_unit_code, "MB_NOT_DEFINED");
-	    store->mbAntenna_add_offset = 0;
-	    store->mbAntenna_scale_factor = 1;
-	    store->mbAntenna_minimum = 0;
-	    store->mbAntenna_maximum = 127;
-	    store->mbAntenna_valid_minimum = 0;
-	    store->mbAntenna_valid_maximum = 127;
-	    store->mbAntenna_missing_value = -128;
-	    strcpy(store->mbAntenna_format_C, "%d");
-	    strcpy(store->mbAntenna_orientation, "direct");
-	    strcpy(store->mbBeamBias_type, "real");
-	    strcpy(store->mbBeamBias_long_name, "Beam bias");
-	    strcpy(store->mbBeamBias_name_code, "MB_BEAM_BIAS");
-	    strcpy(store->mbBeamBias_units, "m");
-	    strcpy(store->mbBeamBias_unit_code, "MB_M");
-	    store->mbBeamBias_add_offset = 0.;
-	    store->mbBeamBias_scale_factor = 0.1;
-	    store->mbBeamBias_minimum = -32767;
-	    store->mbBeamBias_maximum = 32767;
-	    store->mbBeamBias_valid_minimum = -32767;
-	    store->mbBeamBias_valid_maximum = 32767;
-	    store->mbBeamBias_missing_value = -32768;
-	    strcpy(store->mbBeamBias_format_C, "%d");
-	    strcpy(store->mbBeamBias_orientation, "direct");
-	    strcpy(store->mbBFlag_type, "integer");
-	    strcpy(store->mbBFlag_long_name, "Flag of beam");
-	    strcpy(store->mbBFlag_name_code, "MB_BEAM_FLAG");
-	    strcpy(store->mbBFlag_units, "");
-	    strcpy(store->mbBFlag_unit_code, "MB_NOT_DEFINED");
-	    store->mbBFlag_add_offset = 0;
-	    store->mbBFlag_scale_factor = 1;
-	    store->mbBFlag_minimum = -127;
-	    store->mbBFlag_maximum = 127;
-	    store->mbBFlag_valid_minimum = -127;
-	    store->mbBFlag_valid_maximum = 127;
-	    store->mbBFlag_missing_value = -128;
-	    strcpy(store->mbBFlag_format_C, "%d");
-	    strcpy(store->mbBFlag_orientation, "direct");
-	    strcpy(store->mbBeam_type, "integer");
-	    strcpy(store->mbBeam_long_name, "Number of beams");
-	    strcpy(store->mbBeam_name_code, "MB_ANTENNA_BEAM");
-	    strcpy(store->mbBeam_units, "");
-	    strcpy(store->mbBeam_unit_code, "MB_NOT_DEFINED");
-	    store->mbBeam_add_offset = 0;
-	    store->mbBeam_scale_factor = 1;
-	    store->mbBeam_minimum = 1;
-	    store->mbBeam_maximum = 65535;
-	    store->mbBeam_valid_minimum = 1;
-	    store->mbBeam_valid_maximum = 65535;
-	    store->mbBeam_missing_value = 0;
-	    strcpy(store->mbBeam_format_C, "%d");
-	    strcpy(store->mbBeam_orientation, "direct");
-	    strcpy(store->mbAFlag_type, "integer");
-	    strcpy(store->mbAFlag_long_name, "Flag of antenna");
-	    strcpy(store->mbAFlag_name_code, "MB_ANTENNA_FLAG");
-	    strcpy(store->mbAFlag_units, "");
-	    strcpy(store->mbAFlag_unit_code, "MB_NOT_DEFINED");
-	    store->mbAFlag_add_offset = 0;
-	    store->mbAFlag_scale_factor = 1;
-	    store->mbAFlag_minimum = -127;
-	    store->mbAFlag_maximum = 127;
-	    store->mbAFlag_valid_minimum = -127;
-	    store->mbAFlag_valid_maximum = 127;
-	    store->mbAFlag_missing_value = -128;
-	    strcpy(store->mbAFlag_format_C, "%d");
-	    strcpy(store->mbAFlag_orientation, "direct");
-	    strcpy(store->mbVelProfilRef_type, "string");
-	    strcpy(store->mbVelProfilRef_long_name, "Reference to a velocity file");
-	    strcpy(store->mbVelProfilRef_name_code, "MB_PROFIL_REF");
-	    strcpy(store->mbVelProfilIdx_type, "integer");
-	    strcpy(store->mbVelProfilIdx_long_name, "Index of the sound velocity profil");
-	    strcpy(store->mbVelProfilIdx_name_code, "MB_PROFIL_IDX");
-	    strcpy(store->mbVelProfilIdx_units, "");
-	    strcpy(store->mbVelProfilIdx_unit_code, "MB_NOT_DEFINED");
-	    store->mbVelProfilIdx_add_offset = 0;
-	    store->mbVelProfilIdx_scale_factor = 1;
-	    store->mbVelProfilIdx_minimum = 0;
-	    store->mbVelProfilIdx_maximum = 32767;
-	    store->mbVelProfilIdx_valid_minimum = 0;
-	    store->mbVelProfilIdx_valid_maximum = 32767;
-	    store->mbVelProfilIdx_missing_value = -32768;
-	    strcpy(store->mbVelProfilIdx_format_C, "%d");
-	    strcpy(store->mbVelProfilIdx_orientation, "direct");
-	    strcpy(store->mbVelProfilDate_type, "integer");
-	    strcpy(store->mbVelProfilDate_long_name, "Date of cycle");
-	    strcpy(store->mbVelProfilDate_name_code, "MB_PROFIL_DATE");
-	    strcpy(store->mbVelProfilDate_units, "Julian_date");
-	    strcpy(store->mbVelProfilDate_unit_code, "MB_JULIAN_DATE");
-	    store->mbVelProfilDate_add_offset = 2440588;
-	    store->mbVelProfilDate_scale_factor = 1;
-	    store->mbVelProfilDate_minimum = -25567;
-	    store->mbVelProfilDate_maximum = 47482;
-	    store->mbVelProfilDate_valid_minimum = -25567;
-	    store->mbVelProfilDate_valid_maximum = 47482;
-	    store->mbVelProfilDate_missing_value = 2147483647;
-	    strcpy(store->mbVelProfilDate_format_C, "%d");
-	    strcpy(store->mbVelProfilDate_orientation, "direct");
-	    strcpy(store->mbVelProfilTime_type, "integer");
-	    strcpy(store->mbVelProfilTime_long_name, "Time of cycle");
-	    strcpy(store->mbVelProfilTime_name_code, "MB_PROFIL_TIME");
-	    strcpy(store->mbVelProfilTime_units, "ms");
-	    strcpy(store->mbVelProfilTime_unit_code, "MB_MS");
-	    store->mbVelProfilTime_add_offset = 0;
-	    store->mbVelProfilTime_scale_factor = 1;
-	    store->mbVelProfilTime_minimum = 0;
-	    store->mbVelProfilTime_maximum = 86399999;
-	    store->mbVelProfilTime_valid_minimum = 0;
-	    store->mbVelProfilTime_valid_maximum = 86399999;
-	    store->mbVelProfilTime_missing_value = -2000000000 - 147483648;
-	    strcpy(store->mbVelProfilTime_format_C, "%d");
-	    strcpy(store->mbVelProfilTime_orientation, "direct");
-
-	    /* variable ids */
-	    store->mbHistDate_id = -1;
-	    store->mbHistTime_id = -1;
-	    store->mbHistCode_id = -1;
-	    store->mbHistAutor_id = -1;
-	    store->mbHistModule_id = -1;
-	    store->mbHistComment_id = -1;
-	    store->mbCycle_id = -1;
-	    store->mbDate_id = -1;
-	    store->mbTime_id = -1;
-	    store->mbOrdinate_id = -1;
-	    store->mbAbscissa_id = -1;
-	    store->mbFrequency_id = -1;
-	    store->mbSonarFrequency_id = -1;
-	    store->mbSounderMode_id = -1;
-	    store->mbReferenceDepth_id = -1;
-	    store->mbDynamicDraught_id = -1;
-	    store->mbTide_id = -1;
-	    store->mbSoundVelocity_id = -1;
-	    store->mbHeading_id = -1;
-	    store->mbRoll_id = -1;
-	    store->mbPitch_id = -1;
-	    store->mbTransmissionHeave_id = -1;
-	    store->mbDistanceScale_id = -1;
-	    store->mbRangeScale_id = -1;
-	    store->mbDepthScale_id = -1;
-	    store->mbVerticalDepth_id = -1;
-	    store->mbCQuality_id = -1;
-	    store->mbCFlag_id = -1;
-	    store->mbInterlacing_id = -1;
-	    store->mbSamplingRate_id = -1;
-	    store->mbCompensationLayerMode_id = -1;
-	    store->mbTransmitBeamwidth_id = -1;
-	    store->mbReceiveBeamwidth_id = -1;
-	    store->mbTransmitPulseLength_id = -1;
-	    store->mbAlongDistance_id = -1;
-	    store->mbAcrossDistance_id = -1;
-	    store->mbDepth_id = -1;
-	    store->mbAcrossBeamAngle_id = -1;
-	    store->mbAzimutBeamAngle_id = -1;
-	    store->mbRange_id = -1;
-	    store->mbSoundingBias_id = -1;
-	    store->mbSQuality_id = -1;
-	    store->mbReflectivity_id = -1;
-	    store->mbReceptionHeave_id = -1;
-	    store->mbAlongSlope_id = -1;
-	    store->mbAcrossSlope_id = -1;
-	    store->mbSFlag_id = -1;
-	    store->mbSLengthOfDetection_id = -1;
-	    store->mbAntenna_id = -1;
-	    store->mbBeamBias_id = -1;
-	    store->mbBFlag_id = -1;
-	    store->mbBeam_id = -1;
-	    store->mbAFlag_id = -1;
-	    store->mbVelProfilRef_id = -1;
-	    store->mbVelProfilIdx_id = -1;
-	    store->mbVelProfilDate_id = -1;
-	    store->mbVelProfilTime_id = -1;
-
-	    /* variable pointers */
-	    store->mbHistDate = NULL;
-	    store->mbHistTime = NULL;
-	    store->mbHistCode = NULL;
-	    store->mbHistAutor = NULL;
-	    store->mbHistModule = NULL;
-	    store->mbHistComment = NULL;
-	    store->mbCycle = NULL;
-	    store->mbDate = NULL;
-	    store->mbTime = NULL;
-	    store->mbOrdinate = NULL;
-	    store->mbAbscissa = NULL;
-	    store->mbFrequency = NULL;
-	    store->mbSonarFrequency = NULL;
-	    store->mbSounderMode = NULL;
-	    store->mbReferenceDepth = NULL;
-	    store->mbDynamicDraught = NULL;
-	    store->mbTide = NULL;
-	    store->mbSoundVelocity = NULL;
-	    store->mbHeading = NULL;
-	    store->mbRoll = NULL;
-	    store->mbPitch = NULL;
-	    store->mbTransmissionHeave = NULL;
-	    store->mbDistanceScale = NULL;
-	    store->mbRangeScale = NULL;
-	    store->mbDepthScale = NULL;
-	    store->mbVerticalDepth = NULL;
-	    store->mbCQuality = NULL;
-	    store->mbCFlag = NULL;
-	    store->mbInterlacing = NULL;
-	    store->mbSamplingRate = NULL;
-	    store->mbCompensationLayerMode = NULL;
-	    store->mbTransmitBeamwidth = NULL;
-	    store->mbReceiveBeamwidth = NULL;
-	    store->mbSamplingRate = NULL;
-	    store->mbAlongDistance = NULL;
-	    store->mbAcrossDistance = NULL;
-	    store->mbDepth = NULL;
-	    store->mbAcrossBeamAngle = NULL;
-	    store->mbAzimutBeamAngle = NULL;
-	    store->mbRange = NULL;
-	    store->mbSoundingBias = NULL;
-	    store->mbSQuality = NULL;
-	    store->mbReflectivity = NULL;
-	    store->mbReceptionHeave = NULL;
-	    store->mbAlongSlope = NULL;
-	    store->mbAcrossSlope = NULL;
-	    store->mbSFlag = NULL;
-	    store->mbSLengthOfDetection = NULL;
-	    store->mbAntenna = NULL;
-	    store->mbBeamBias = NULL;
-	    store->mbBFlag = NULL;
-	    store->mbBeam = NULL;
-	    store->mbAFlag = NULL;
-	    store->mbVelProfilRef = NULL;
-	    store->mbVelProfilIdx = NULL;
-	    store->mbVelProfilDate = NULL;
-	    store->mbVelProfilTime = NULL;
-
-	    /* go ahead and allocate history arrays */
-/*	    status = mb_mallocd(verbose,__FILE__,__LINE__,
-			store->mbHistoryRecNbr * sizeof(int),
-			(void **)&store->mbHistDate,error);
-	    if (status == MB_SUCCESS)
-	    status = mb_mallocd(verbose,__FILE__,__LINE__,
-			store->mbHistoryRecNbr * sizeof(int),
-			(void **)&store->mbHistTime,error);
-	    if (status == MB_SUCCESS)
-	    status = mb_mallocd(verbose,__FILE__,__LINE__,
-			store->mbHistoryRecNbr * sizeof(char),
-			(void **)&store->mbHistCode,error);
-	    if (status == MB_SUCCESS)
-	    status = mb_mallocd(verbose,__FILE__,__LINE__,
-			store->mbHistoryRecNbr * store->mbNameLength * sizeof(char),
-			(void **)&store->mbHistAutor,error);
-	    if (status == MB_SUCCESS)
-	    status = mb_mallocd(verbose,__FILE__,__LINE__,
-			store->mbHistoryRecNbr * store->mbNameLength * sizeof(char),
-			(void **)&store->mbHistModule,error);
-	    if (status == MB_SUCCESS)
-	    status = mb_mallocd(verbose,__FILE__,__LINE__,
-			store->mbHistoryRecNbr * store->mbCommentLength * sizeof(char),
-			(void **)&store->mbHistComment,error);
-*/
-	    }
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)*store_ptr);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_netcdf_deall(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_netcdf_deall";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_netcdf_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)*store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_netcdf_struct *) *store_ptr;
-
-	/* deallocate any allocated arrays */
-	if (store->mbHistDate != NULL)
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbHistDate, error);
-	if (store->mbHistTime != NULL)
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbHistTime, error);
-	if (store->mbHistCode != NULL)
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbHistCode, error);
-	if (store->mbHistAutor != NULL)
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbHistAutor, error);
-	if (store->mbHistModule != NULL)
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbHistModule, error);
-	if (store->mbHistComment != NULL)
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbHistComment, error);
-	if (store->mbCycle != NULL)
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbCycle, error);
-	if (store->mbDate != NULL)
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbDate, error);
-	if (store->mbTime != NULL)
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbTime, error);
-	if (store->mbOrdinate != NULL)
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbOrdinate, error);
-	if (store->mbAbscissa != NULL)
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbAbscissa, error);
-	if (store->mbFrequency != NULL)
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbFrequency, error);
-	if (store->mbSonarFrequency != NULL)
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbSonarFrequency, error);
-	if (store->mbSounderMode != NULL)
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbSounderMode, error);
-	if (store->mbReferenceDepth != NULL)
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbReferenceDepth, error);
-	if (store->mbDynamicDraught != NULL)
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbDynamicDraught, error);
-	if (store->mbTide != NULL)
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbTide, error);
-	if (store->mbSoundVelocity != NULL)
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbSoundVelocity, error);
-	if (store->mbHeading != NULL)
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbHeading, error);
-	if (store->mbRoll != NULL)
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbRoll, error);
-	if (store->mbPitch != NULL)
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbPitch, error);
-	if (store->mbTransmissionHeave != NULL)
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbTransmissionHeave, error);
-	if (store->mbDistanceScale != NULL)
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbDistanceScale, error);
-	if (store->mbRangeScale != NULL)
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbRangeScale, error);
-	if (store->mbDepthScale != NULL)
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbDepthScale, error);
-	if (store->mbVerticalDepth != NULL)
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbVerticalDepth, error);
-	if (store->mbCQuality != NULL)
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbCQuality, error);
-	if (store->mbCFlag != NULL)
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbCFlag, error);
-	if (store->mbInterlacing != NULL)
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbInterlacing, error);
-	if (store->mbSamplingRate != NULL)
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbSamplingRate, error);
-	if (store->mbCompensationLayerMode != NULL)
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbCompensationLayerMode, error);
-	if (store->mbTransmitBeamwidth != NULL)
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbTransmitBeamwidth, error);
-	if (store->mbReceiveBeamwidth != NULL)
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbReceiveBeamwidth, error);
-	if (store->mbTransmitPulseLength != NULL)
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbTransmitPulseLength, error);
-	if (store->mbAlongDistance != NULL)
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbAlongDistance, error);
-	if (store->mbAcrossDistance != NULL)
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbAcrossDistance, error);
-	if (store->mbDepth != NULL)
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbDepth, error);
-	if (store->mbAcrossBeamAngle != NULL)
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbAcrossBeamAngle, error);
-	if (store->mbAzimutBeamAngle != NULL)
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbAzimutBeamAngle, error);
-	if (store->mbRange != NULL)
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbRange, error);
-	if (store->mbSoundingBias != NULL)
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbSoundingBias, error);
-	if (store->mbSQuality != NULL)
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbSQuality, error);
-	if (store->mbReflectivity != NULL)
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbReflectivity, error);
-	if (store->mbReceptionHeave != NULL)
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbReceptionHeave, error);
-	if (store->mbAlongSlope != NULL)
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbAlongSlope, error);
-	if (store->mbAcrossSlope != NULL)
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbAcrossSlope, error);
-	if (store->mbSFlag != NULL)
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbSFlag, error);
-	if (store->mbSLengthOfDetection != NULL)
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbSLengthOfDetection, error);
-	if (store->mbAntenna != NULL)
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbAntenna, error);
-	if (store->mbBeamBias != NULL)
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbBeamBias, error);
-	if (store->mbBFlag != NULL)
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbBFlag, error);
-	if (store->mbBeam != NULL)
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbBeam, error);
-	if (store->mbAFlag != NULL)
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbAFlag, error);
-	if (store->mbVelProfilRef != NULL)
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbVelProfilRef, error);
-	if (store->mbVelProfilIdx != NULL)
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbVelProfilIdx, error);
-	if (store->mbVelProfilDate != NULL)
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbVelProfilDate, error);
-	if (store->mbVelProfilTime != NULL)
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbVelProfilTime, error);
-
-	/* deallocate memory for data structure */
-	status = mb_free(verbose,store_ptr,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_netcdf_dimensions(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int *nbath, int *namp, int *nss, int *error)
-{
-	char	*function_name = "mbsys_netcdf_dimensions";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_netcdf_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_netcdf_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get beam and pixel numbers */
-		*nbath = store->mbBeamNbr;
-		*namp = 0;
-		if (store->mbReflectivity_id >= 0) *namp = store->mbBeamNbr;
-		*nss = 0;
-		}
-	else
-		{
-		/* get beam and pixel numbers */
-		*nbath = 0;
-		*namp = 0;
-		*nss = 0;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		fprintf(stderr,"dbg2       nbath:      %d\n",*nbath);
-		fprintf(stderr,"dbg2        namp:      %d\n",*namp);
-		fprintf(stderr,"dbg2        nss:       %d\n",*nss);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_netcdf_extract(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int time_i[7], double *time_d,
-		double *navlon, double *navlat,
-		double *speed, double *heading,
-		int *nbath, int *namp, int *nss,
-		char *beamflag, double *bath, double *amp,
-		double *bathacrosstrack, double *bathalongtrack,
-		double *ss, double *ssacrosstrack, double *ssalongtrack,
-		char *comment, int *error)
-{
-	char	*function_name = "mbsys_netcdf_extract";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_netcdf_struct *store;
-	double	depthscale, distancescale;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_netcdf_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* reset error and status */
-	*error = MB_ERROR_NO_ERROR;
-	status = MB_SUCCESS;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get time */
-		*time_d = store->mbDate[0] * SECINDAY
-			    + store->mbTime[0] * 0.001;
-		mb_get_date(verbose,*time_d,time_i);
-
-		/* get navigation */
-		*navlon = (double) store->mbAbscissa_scale_factor * store->mbAbscissa[0];
-		*navlat = (double) store->mbOrdinate_scale_factor * store->mbOrdinate[0];
-
-		/* get heading */
-		*heading = store->mbHeading[0] * store->mbHeading_scale_factor;
-
-		/* set speed to zero */
-		*speed = 0.0;
-
-		/* set beamwidths in mb_io structure */
-		mb_io_ptr->beamwidth_ltrack = 2.0;
-		mb_io_ptr->beamwidth_xtrack = 2.0;
-
-		/* read distance, depth, and backscatter
-			values into storage arrays */
-		*nbath = store->mbBeamNbr;
-		*namp = 0;
-		if (store->mbReflectivity_id >= 0) *namp = store->mbBeamNbr;
-		*nss = 0;
-		depthscale = store->mbDepthScale[0] * store->mbDepthScale_scale_factor;
-		distancescale = store->mbDistanceScale[0] * store->mbDistanceScale_scale_factor;
-		for (i=0;i<*nbath;i++)
-			{
-			if (store->mbSFlag[i] == 0)
-			    beamflag[i] = MB_FLAG_NULL;
-			else if (store->mbSFlag[i] == 2)
-			    beamflag[i] = MB_FLAG_NONE;
-			else
-			    beamflag[i] = MB_FLAG_FLAG + MB_FLAG_MANUAL;
-			bath[i] = depthscale * store->mbDepth[i];
-			bathacrosstrack[i] = distancescale * store->mbAcrossDistance[i];
-			bathalongtrack[i] = distancescale * store->mbAlongDistance[i];
-			if (store->mbReflectivity_id >= 0)
-			    {
-			    amp[i] = store->mbReflectivity[i] * store->mbReflectivity_scale_factor;
-			    }
-			}
-
-		/* print debug statements */
-		if (verbose >= 5)
-			{
-			fprintf(stderr,"\ndbg4  Data extracted by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  Extracted values:\n");
-			fprintf(stderr,"dbg4       kind:       %d\n",
-				*kind);
-			fprintf(stderr,"dbg4       error:      %d\n",
-				*error);
-			fprintf(stderr,"dbg4       time_i[0]:  %d\n",
-				time_i[0]);
-			fprintf(stderr,"dbg4       time_i[1]:  %d\n",
-				time_i[1]);
-			fprintf(stderr,"dbg4       time_i[2]:  %d\n",
-				time_i[2]);
-			fprintf(stderr,"dbg4       time_i[3]:  %d\n",
-				time_i[3]);
-			fprintf(stderr,"dbg4       time_i[4]:  %d\n",
-				time_i[4]);
-			fprintf(stderr,"dbg4       time_i[5]:  %d\n",
-				time_i[5]);
-			fprintf(stderr,"dbg4       time_i[6]:  %d\n",
-				time_i[6]);
-			fprintf(stderr,"dbg4       time_d:     %f\n",
-				*time_d);
-			fprintf(stderr,"dbg4       longitude:  %f\n",
-				*navlon);
-			fprintf(stderr,"dbg4       latitude:   %f\n",
-				*navlat);
-			fprintf(stderr,"dbg4       speed:      %f\n",
-				*speed);
-			fprintf(stderr,"dbg4       heading:    %f\n",
-				*heading);
-			fprintf(stderr,"dbg4       nbath:      %d\n",
-				*nbath);
-			for (i=0;i<*nbath;i++)
-			  fprintf(stderr,"dbg4       beam:%d  flag:%3d  bath:%f  acrosstrack:%f  alongtrack:%f\n",
-				i,beamflag[i],bath[i],bathacrosstrack[i],bathalongtrack[i]);
-			fprintf(stderr,"dbg4        namp:     %d\n",
-				*namp);
-			for (i=0;i<*namp;i++)
-			  fprintf(stderr,"dbg4        beam:%d   amp:%f  acrosstrack:%f  alongtrack:%f\n",
-				i,amp[i],bathacrosstrack[i],bathalongtrack[i]);
-			fprintf(stderr,"dbg4        nss:      %d\n",
-				*nss);
-			for (i=0;i<*nss;i++)
-			  fprintf(stderr,"dbg4        pixel:%d   ss:%f  acrosstrack:%f  alongtrack:%f\n",
-				i,ss[i],ssacrosstrack[i],ssalongtrack[i]);
-			}
-
-		/* done translating values */
-
-		}
-
-	/* extract comment from structure */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* copy comment */
-		strcpy(comment, store->comment);
-
-		/* print debug statements */
-		if (verbose >= 4)
-			{
-			fprintf(stderr,"\ndbg4  New ping read by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  New ping values:\n");
-			fprintf(stderr,"dbg4       error:      %d\n",
-				*error);
-			fprintf(stderr,"dbg4       comment:    %s\n",
-				comment);
-			}
-		}
-
-	/* else set error */
-	else
-		{
-		/* set error */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind == MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"dbg2       comment:     \ndbg2       %s\n",
-			comment);
-		}
-	else if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind != MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"dbg2       time_i[0]:     %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:     %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:     %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:     %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:     %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:     %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:     %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:        %f\n",*time_d);
-		fprintf(stderr,"dbg2       longitude:     %f\n",*navlon);
-		fprintf(stderr,"dbg2       latitude:      %f\n",*navlat);
-		fprintf(stderr,"dbg2       speed:         %f\n",*speed);
-		fprintf(stderr,"dbg2       heading:       %f\n",*heading);
-		}
-	if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind == MB_DATA_DATA)
-		{
-		fprintf(stderr,"dbg2       nbath:      %d\n",
-			*nbath);
-		for (i=0;i<*nbath;i++)
-		  fprintf(stderr,"dbg2       beam:%d  flag:%3d  bath:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,beamflag[i],bath[i],
-			bathacrosstrack[i],bathalongtrack[i]);
-		fprintf(stderr,"dbg2        namp:     %d\n",
-			*namp);
-		for (i=0;i<*namp;i++)
-		  fprintf(stderr,"dbg2       beam:%d   amp:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,amp[i],bathacrosstrack[i],bathalongtrack[i]);
-		fprintf(stderr,"dbg2        nss:      %d\n",
-			*nss);
-		for (i=0;i<*nss;i++)
-		  fprintf(stderr,"dbg2        pixel:%d   ss:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,ss[i],ssacrosstrack[i],ssalongtrack[i]);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_netcdf_insert(int verbose, void *mbio_ptr, void *store_ptr,
-		int kind, int time_i[7], double time_d,
-		double navlon, double navlat,
-		double speed, double heading,
-		int nbath, int namp, int nss,
-		char *beamflag, double *bath, double *amp,
-		double *bathacrosstrack, double *bathalongtrack,
-		double *ss, double *ssacrosstrack, double *ssalongtrack,
-		char *comment, int *error)
-{
-	char	*function_name = "mbsys_netcdf_insert";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_netcdf_struct *store;
-	double	depthscale, distancescale;
-	double	depthmax, distancemax;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       kind:       %d\n",kind);
-		}
-	if (verbose >= 2 && (kind == MB_DATA_DATA))
-		{
-		fprintf(stderr,"dbg2       time_i[0]:  %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:  %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:  %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:  %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:  %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:  %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:  %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:     %f\n",time_d);
-		fprintf(stderr,"dbg2       navlon:     %f\n",navlon);
-		fprintf(stderr,"dbg2       navlat:     %f\n",navlat);
-		fprintf(stderr,"dbg2       speed:      %f\n",speed);
-		fprintf(stderr,"dbg2       heading:    %f\n",heading);
-		}
-	if (verbose >= 2 && kind == MB_DATA_DATA)
-		{
-		fprintf(stderr,"dbg2       nbath:      %d\n",
-			nbath);
-		if (verbose >= 3)
-		 for (i=0;i<nbath;i++)
-		  fprintf(stderr,"dbg3       beam:%d  flag:%3d  bath:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,beamflag[i],bath[i],
-			bathacrosstrack[i],bathalongtrack[i]);
-		fprintf(stderr,"dbg2       namp:       %d\n",namp);
-		if (verbose >= 3)
-		 for (i=0;i<namp;i++)
-		  fprintf(stderr,"dbg3        beam:%d   amp:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,amp[i],bathacrosstrack[i],bathalongtrack[i]);
-		fprintf(stderr,"dbg2        nss:       %d\n",nss);
-		if (verbose >= 3)
-		 for (i=0;i<nss;i++)
-		  fprintf(stderr,"dbg3        pixel:%d   ss:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,ss[i],ssacrosstrack[i],ssalongtrack[i]);
-		}
-	if (verbose >= 2 && kind == MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"dbg2       comment:     \ndbg2       %s\n",
-			comment);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_netcdf_struct *) store_ptr;
-
-	/* set data kind */
-	store->kind = kind;
-
-	/* allocate memory if needed */
-	if (store->kind == MB_DATA_DATA
-	    && nbath > 0
-	    && store->mbAntennaNbr <= 0
-	    && store->mbBeamNbr <= 0)
-	    {
-	    /* set sonar system */
-	    if (nbath  == MBSYS_NETCDF_SONAR_BEAMS_SEABEAM)
-		{
-		store->mbSounder = MBSYS_NETCDF_SONAR_SEABEAM;
-		store->mbBeamNbr = MBSYS_NETCDF_SONAR_BEAMS_SEABEAM;
-		store->mbAntennaNbr = 1;
-		}
-	    else if (nbath  == MBSYS_NETCDF_SONAR_BEAMS_ECHOSXD15)
-		{
-		store->mbSounder = MBSYS_NETCDF_SONAR_ECHOSXD15;
-		store->mbBeamNbr = MBSYS_NETCDF_SONAR_BEAMS_ECHOSXD15;
-		store->mbAntennaNbr = 1;
-		}
-	    else if (nbath  == MBSYS_NETCDF_SONAR_BEAMS_ECHOSXD60)
-		{
-		store->mbSounder = MBSYS_NETCDF_SONAR_ECHOSXD60;
-		store->mbBeamNbr = MBSYS_NETCDF_SONAR_BEAMS_ECHOSXD60;
-		store->mbAntennaNbr = 1;
-		}
-	    else if (nbath  == MBSYS_NETCDF_SONAR_BEAMS_HSDS)
-		{
-		store->mbSounder = MBSYS_NETCDF_SONAR_HSDS;
-		store->mbBeamNbr = MBSYS_NETCDF_SONAR_BEAMS_HSDS;
-		store->mbAntennaNbr = 1;
-		}
-	    else if (nbath  == MBSYS_NETCDF_SONAR_BEAMS_LENNEMOR)
-		{
-		store->mbSounder = MBSYS_NETCDF_SONAR_LENNEMOR;
-		store->mbBeamNbr = MBSYS_NETCDF_SONAR_BEAMS_LENNEMOR;
-		store->mbAntennaNbr = 1;
-		}
-	    else if (nbath  == MBSYS_NETCDF_SONAR_BEAMS_TMS5265B)
-		{
-		store->mbSounder = MBSYS_NETCDF_SONAR_TMS5265B;
-		store->mbBeamNbr = MBSYS_NETCDF_SONAR_BEAMS_TMS5265B;
-		store->mbAntennaNbr = 1;
-		}
-	    else if (nbath  == MBSYS_NETCDF_SONAR_BEAMS_EM100)
-		{
-		store->mbSounder = MBSYS_NETCDF_SONAR_EM100;
-		store->mbBeamNbr = MBSYS_NETCDF_SONAR_BEAMS_EM100;
-		store->mbAntennaNbr = 1;
-		}
-	    else if (nbath  == MBSYS_NETCDF_SONAR_BEAMS_EM1000)
-		{
-		store->mbSounder = MBSYS_NETCDF_SONAR_EM1000;
-		store->mbBeamNbr = MBSYS_NETCDF_SONAR_BEAMS_EM1000;
-		store->mbAntennaNbr = 1;
-		}
-	    else if (nbath  == MBSYS_NETCDF_SONAR_BEAMS_EM12S)
-		{
-		store->mbSounder = MBSYS_NETCDF_SONAR_EM12S;
-		store->mbBeamNbr = MBSYS_NETCDF_SONAR_BEAMS_EM12S;
-		store->mbAntennaNbr = 1;
-		}
-	    else if (nbath  == MBSYS_NETCDF_SONAR_BEAMS_EM12D)
-		{
-		store->mbSounder = MBSYS_NETCDF_SONAR_EM12D;
-		store->mbBeamNbr = MBSYS_NETCDF_SONAR_BEAMS_EM12D;
-		store->mbAntennaNbr = 2;
-		}
-	    else if (nbath  == MBSYS_NETCDF_SONAR_BEAMS_EM3000S)
-		{
-		store->mbSounder = MBSYS_NETCDF_SONAR_EM3000S;
-		store->mbBeamNbr = MBSYS_NETCDF_SONAR_BEAMS_EM3000S;
-		store->mbAntennaNbr = 1;
-		}
-	    else if (nbath  == MBSYS_NETCDF_SONAR_BEAMS_EM3000D)
-		{
-		store->mbSounder = MBSYS_NETCDF_SONAR_EM3000D;
-		store->mbBeamNbr = MBSYS_NETCDF_SONAR_BEAMS_EM3000D;
-		store->mbAntennaNbr = 2;
-		}
-	    else if (nbath  == MBSYS_NETCDF_SONAR_BEAMS_EM300)
-		{
-		store->mbSounder = MBSYS_NETCDF_SONAR_EM300;
-		store->mbBeamNbr = MBSYS_NETCDF_SONAR_BEAMS_EM300;
-		store->mbAntennaNbr = 1;
-		}
-	    else if (nbath  == MBSYS_NETCDF_SONAR_BEAMS_FURUNO)
-		{
-		store->mbSounder = MBSYS_NETCDF_SONAR_FURUNO;
-		store->mbBeamNbr = MBSYS_NETCDF_SONAR_BEAMS_FURUNO;
-		store->mbAntennaNbr = 1;
-		}
-	    else if (nbath > 0)
-		{
-		store->mbSounder = MBSYS_NETCDF_SONAR_UNKNOWN;
-		store->mbBeamNbr = nbath;
-		store->mbAntennaNbr = 1;
-		}
-
-	    /* allocate arrays */
-	    status = mb_mallocd(verbose,__FILE__,__LINE__,
-			store->mbAntennaNbr * sizeof(short),
-			(void **)&store->mbCycle,error);
-	    status = mb_mallocd(verbose,__FILE__,__LINE__,
-			store->mbAntennaNbr * sizeof(int),
-			(void **)&store->mbDate,error);
-	    status = mb_mallocd(verbose,__FILE__,__LINE__,
-			store->mbAntennaNbr * sizeof(int),
-			(void **)&store->mbTime,error);
-	    status = mb_mallocd(verbose,__FILE__,__LINE__,
-			store->mbAntennaNbr * sizeof(int),
-			(void **)&store->mbOrdinate,error);
-	    status = mb_mallocd(verbose,__FILE__,__LINE__,
-			store->mbAntennaNbr * sizeof(int),
-			(void **)&store->mbAbscissa,error);
-	    status = mb_mallocd(verbose,__FILE__,__LINE__,
-			store->mbAntennaNbr * sizeof(char),
-			(void **)&store->mbFrequency,error);
-	    status = mb_mallocd(verbose,__FILE__,__LINE__,
-			store->mbAntennaNbr * sizeof(int),
-			(void **)&store->mbSonarFrequency,error);
-	    status = mb_mallocd(verbose,__FILE__,__LINE__,
-			store->mbAntennaNbr * sizeof(char),
-			(void **)&store->mbSounderMode,error);
-	    status = mb_mallocd(verbose,__FILE__,__LINE__,
-			store->mbAntennaNbr * sizeof(int),
-			(void **)&store->mbReferenceDepth,error);
-	    status = mb_mallocd(verbose,__FILE__,__LINE__,
-			store->mbAntennaNbr * sizeof(short),
-			(void **)&store->mbDynamicDraught,error);
-	    status = mb_mallocd(verbose,__FILE__,__LINE__,
-			store->mbAntennaNbr * sizeof(short),
-			(void **)&store->mbTide,error);
-	    status = mb_mallocd(verbose,__FILE__,__LINE__,
-			store->mbAntennaNbr * sizeof(short),
-			(void **)&store->mbSoundVelocity,error);
-	    status = mb_mallocd(verbose,__FILE__,__LINE__,
-			store->mbAntennaNbr * sizeof(short),
-			(void **)&store->mbHeading,error);
-	    status = mb_mallocd(verbose,__FILE__,__LINE__,
-			store->mbAntennaNbr * sizeof(short),
-			(void **)&store->mbRoll,error);
-	    status = mb_mallocd(verbose,__FILE__,__LINE__,
-			store->mbAntennaNbr * sizeof(short),
-			(void **)&store->mbPitch,error);
-	    status = mb_mallocd(verbose,__FILE__,__LINE__,
-			store->mbAntennaNbr * sizeof(short),
-			(void **)&store->mbTransmissionHeave,error);
-	    status = mb_mallocd(verbose,__FILE__,__LINE__,
-			store->mbAntennaNbr * sizeof(char),
-			(void **)&store->mbDistanceScale,error);
-	    status = mb_mallocd(verbose,__FILE__,__LINE__,
-			store->mbAntennaNbr * sizeof(short),
-			(void **)&store->mbRangeScale,error);
-	    status = mb_mallocd(verbose,__FILE__,__LINE__,
-			store->mbAntennaNbr * sizeof(char),
-			(void **)&store->mbDepthScale,error);
-	    status = mb_mallocd(verbose,__FILE__,__LINE__,
-			store->mbAntennaNbr * sizeof(int),
-			(void **)&store->mbVerticalDepth,error);
-	    status = mb_mallocd(verbose,__FILE__,__LINE__,
-			store->mbAntennaNbr * sizeof(char),
-			(void **)&store->mbCQuality,error);
-	    status = mb_mallocd(verbose,__FILE__,__LINE__,
-			store->mbAntennaNbr * sizeof(char),
-			(void **)&store->mbCFlag,error);
-	    status = mb_mallocd(verbose,__FILE__,__LINE__,
-			store->mbAntennaNbr * sizeof(char),
-			(void **)&store->mbInterlacing,error);
-	    status = mb_mallocd(verbose,__FILE__,__LINE__,
-			store->mbAntennaNbr * sizeof(short),
-			(void **)&store->mbSamplingRate,error);
-	    status = mb_mallocd(verbose,__FILE__,__LINE__,
-			store->mbAntennaNbr * sizeof(char),
-			(void **)&store->mbCompensationLayerMode,error);
-	    status = mb_mallocd(verbose,__FILE__,__LINE__,
-			store->mbAntennaNbr * sizeof(short),
-			(void **)&store->mbTransmitBeamwidth,error);
-	    status = mb_mallocd(verbose,__FILE__,__LINE__,
-			store->mbAntennaNbr * sizeof(char),
-			(void **)&store->mbReceiveBeamwidth,error);
-	    status = mb_mallocd(verbose,__FILE__,__LINE__,
-			store->mbAntennaNbr * sizeof(short),
-			(void **)&store->mbTransmitPulseLength,error);
-	    status = mb_mallocd(verbose,__FILE__,__LINE__,
-			store->mbBeamNbr * sizeof(short),
-			(void **)&store->mbAlongDistance,error);
-	    status = mb_mallocd(verbose,__FILE__,__LINE__,
-			store->mbBeamNbr * sizeof(short),
-			(void **)&store->mbAcrossDistance,error);
-	    status = mb_mallocd(verbose,__FILE__,__LINE__,
-			store->mbBeamNbr * sizeof(int),
-			(void **)&store->mbDepth,error);
-	    status = mb_mallocd(verbose,__FILE__,__LINE__,
-			store->mbBeamNbr * sizeof(short),
-			(void **)&store->mbAcrossBeamAngle,error);
-	    status = mb_mallocd(verbose,__FILE__,__LINE__,
-			store->mbBeamNbr * sizeof(short),
-			(void **)&store->mbAzimutBeamAngle,error);
-	    status = mb_mallocd(verbose,__FILE__,__LINE__,
-			store->mbBeamNbr * sizeof(short),
-			(void **)&store->mbRange,error);
-	    status = mb_mallocd(verbose,__FILE__,__LINE__,
-			store->mbBeamNbr * sizeof(short),
-			(void **)&store->mbSoundingBias,error);
-	    status = mb_mallocd(verbose,__FILE__,__LINE__,
-			store->mbBeamNbr * sizeof(char),
-			(void **)&store->mbSQuality,error);
-	    status = mb_mallocd(verbose,__FILE__,__LINE__,
-			store->mbBeamNbr * sizeof(char),
-			(void **)&store->mbReflectivity,error);
-	    status = mb_mallocd(verbose,__FILE__,__LINE__,
-			store->mbBeamNbr * sizeof(char),
-			(void **)&store->mbReceptionHeave,error);
-	    status = mb_mallocd(verbose,__FILE__,__LINE__,
-			store->mbBeamNbr * sizeof(short),
-			(void **)&store->mbAlongSlope,error);
-	    status = mb_mallocd(verbose,__FILE__,__LINE__,
-			store->mbBeamNbr * sizeof(short),
-			(void **)&store->mbAcrossSlope,error);
-	    status = mb_mallocd(verbose,__FILE__,__LINE__,
-			store->mbBeamNbr * sizeof(char),
-			(void **)&store->mbSFlag,error);
-	    status = mb_mallocd(verbose,__FILE__,__LINE__,
-			store->mbBeamNbr * sizeof(char),
-			(void **)&store->mbSLengthOfDetection,error);
-	    status = mb_mallocd(verbose,__FILE__,__LINE__,
-			store->mbBeamNbr * sizeof(char),
-			(void **)&store->mbAntenna,error);
-	    status = mb_mallocd(verbose,__FILE__,__LINE__,
-			store->mbBeamNbr * sizeof(short),
-			(void **)&store->mbBeamBias,error);
-	    status = mb_mallocd(verbose,__FILE__,__LINE__,
-			store->mbBeamNbr * sizeof(char),
-			(void **)&store->mbBFlag,error);
-	    status = mb_mallocd(verbose,__FILE__,__LINE__,
-			store->mbAntennaNbr * sizeof(short),
-			(void **)&store->mbBeam,error);
-	    status = mb_mallocd(verbose,__FILE__,__LINE__,
-			store->mbAntennaNbr * sizeof(char),
-			(void **)&store->mbAFlag,error);
-	    status = mb_mallocd(verbose,__FILE__,__LINE__,
-			store->mbVelocityProfilNbr * store->mbCommentLength * sizeof(char),
-			(void **)&store->mbVelProfilRef,error);
-	    status = mb_mallocd(verbose,__FILE__,__LINE__,
-			store->mbVelocityProfilNbr * sizeof(short),
-			(void **)&store->mbVelProfilIdx,error);
-	    status = mb_mallocd(verbose,__FILE__,__LINE__,
-			store->mbVelocityProfilNbr * sizeof(int),
-			(void **)&store->mbVelProfilDate,error);
-	    status = mb_mallocd(verbose,__FILE__,__LINE__,
-			store->mbVelocityProfilNbr * sizeof(int),
-			(void **)&store->mbVelProfilTime,error);
-
-	    /* deal with a memory allocation failure */
-	    if (status == MB_FAILURE)
-		{
-		status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbCycle, error);
-		status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbDate, error);
-		status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbTime, error);
-		status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbOrdinate, error);
-		status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbAbscissa, error);
-		status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbFrequency, error);
-		status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbSonarFrequency, error);
-		status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbSounderMode, error);
-		status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbReferenceDepth, error);
-		status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbDynamicDraught, error);
-		status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbTide, error);
-		status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbSoundVelocity, error);
-		status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbHeading, error);
-		status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbRoll, error);
-		status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbPitch, error);
-		status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbTransmissionHeave, error);
-		status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbDistanceScale, error);
-		status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbRangeScale, error);
-		status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbDepthScale, error);
-		status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbVerticalDepth, error);
-		status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbCQuality, error);
-		status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbCFlag, error);
-		status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbInterlacing, error);
-		status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbSamplingRate, error);
-		status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbCompensationLayerMode, error);
-		status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbTransmitBeamwidth, error);
-		status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbReceiveBeamwidth, error);
-		status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbTransmitPulseLength, error);
-		status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbAlongDistance, error);
-		status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbAcrossDistance, error);
-		status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbDepth, error);
-		status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbAcrossBeamAngle, error);
-		status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbAzimutBeamAngle, error);
-		status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbRange, error);
-		status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbSoundingBias, error);
-		status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbSQuality, error);
-		status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbReflectivity, error);
-		status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbReceptionHeave, error);
-		status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbAlongSlope, error);
-		status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbAcrossSlope, error);
-		status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbSFlag, error);
-		status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbSLengthOfDetection, error);
-		status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbAntenna, error);
-		status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbBeamBias, error);
-		status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbBFlag, error);
-		status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbBeam, error);
-		status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbAFlag, error);
-		status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbVelProfilRef, error);
-		status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbVelProfilIdx, error);
-		status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbVelProfilDate, error);
-		status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbVelProfilTime, error);
-		status = MB_FAILURE;
-		*error = MB_ERROR_MEMORY_FAIL;
-		if (verbose >= 2)
-			{
-			fprintf(stderr,"\ndbg2  MBIO function <%s> terminated with error\n",
-				function_name);
-			fprintf(stderr,"dbg2  Return values:\n");
-			fprintf(stderr,"dbg2       error:      %d\n",*error);
-			fprintf(stderr,"dbg2  Return status:\n");
-			fprintf(stderr,"dbg2       status:  %d\n",status);
-			}
-		return(status);
-		}
-	    }
-
-	/* insert data in structure */
-	if (store->kind == MB_DATA_DATA)
-		{
-		/* reset lon and lat attributes */
-		if (strcmp(store->mbOrdinate_name_code, "MB_POSITION_LATITUDE") != 0)
-		    {
-		    strcpy(store->mbOrdinate_type, "real");
-		    strcpy(store->mbOrdinate_long_name, "Latitude");
-		    strcpy(store->mbOrdinate_name_code, "MB_POSITION_LATITUDE");
-		    strcpy(store->mbOrdinate_units, "degree");
-		    strcpy(store->mbOrdinate_unit_code, "MB_DEGREE");
-		    store->mbOrdinate_add_offset = 0.;
-		    store->mbOrdinate_scale_factor = 5.e-08;
-		    store->mbOrdinate_minimum = -1800000000;
-		    store->mbOrdinate_maximum = 1800000000;
-		    store->mbOrdinate_valid_minimum = -1800000000;
-		    store->mbOrdinate_valid_maximum = 1800000000;
-		    store->mbOrdinate_missing_value = -2000000000 - 147483648;
-		    strcpy(store->mbOrdinate_format_C, "%f");
-		    strcpy(store->mbOrdinate_orientation, "direct");
-		    }
-		if (strcmp(store->mbAbscissa_name_code, "MB_POSITION_LONGITUDE") != 0)
-		    {
-		    strcpy(store->mbAbscissa_type, "real");
-		    strcpy(store->mbAbscissa_long_name, "Longitude");
-		    strcpy(store->mbAbscissa_name_code, "MB_POSITION_LONGITUDE");
-		    strcpy(store->mbAbscissa_units, "degree");
-		    strcpy(store->mbAbscissa_unit_code, "MB_DEGREE");
-		    store->mbAbscissa_add_offset = 0.;
-		    store->mbAbscissa_scale_factor = 1.e-07;
-		    store->mbAbscissa_minimum = -1800000000;
-		    store->mbAbscissa_maximum = 1800000000;
-		    store->mbAbscissa_valid_minimum = -1800000000;
-		    store->mbAbscissa_valid_maximum = 1800000000;
-		    store->mbAbscissa_missing_value = -2000000000 - 147483648;
-		    strcpy(store->mbAbscissa_format_C, "%f");
-		    strcpy(store->mbAbscissa_orientation, "direct");
-		    }
-
-		/* get stuff */
-		for (i=0;i<store->mbAntennaNbr;i++)
-		    {
-		    /* get time */
-		    store->mbDate[i] = (int)(time_d / SECINDAY);
-		    store->mbTime[i] = (int)(1000 * (time_d - store->mbDate[0] * SECINDAY));
-
-		    /* get navigation */
-		    store->mbAbscissa[i] = (int)(navlon / store->mbAbscissa_scale_factor);
-		    store->mbOrdinate[i] = (int)(navlat / store->mbOrdinate_scale_factor);
-
-		    /* get heading */
-		    store->mbHeading[i] = heading / store->mbHeading_scale_factor;
-		    }
-
-		/* get depth and distance scales */
-		depthmax = 0.0;
-		distancemax = 0.0;
-		for (i=0;i<nbath;i++)
-		    {
-		    if (beamflag[i] != MB_FLAG_NULL)
-			{
-			depthmax = MAX(fabs(bath[i]), depthmax);
-			distancemax = MAX(fabs(bathacrosstrack[i]), distancemax);
-			}
-		    }
-		depthscale = 2.1 * depthmax / ((double)store->mbDepth_valid_maximum);
-		distancescale = 2.1 * distancemax / store->mbAcrossDistance_valid_maximum;
-
-		/* put distance, depth, and backscatter values
-			into data structure */
-		store->mbBeamNbr = nbath;
-		/* if (store->mbDepthScale[0] <= 0
-		    || (depthmax */
-		for (i=0;i<store->mbAntennaNbr;i++)
-		    {
-		    store->mbDepthScale[i] = 1 + (int)(depthscale / store->mbDepthScale_scale_factor);
-		    store->mbDistanceScale[i] = 1 + (int)(distancescale / store->mbDistanceScale_scale_factor);
-		    }
-		depthscale = store->mbDepthScale[0] * store->mbDepthScale_scale_factor;
-		distancescale = store->mbDistanceScale[0] * store->mbDistanceScale_scale_factor;
-		for (i=0;i<nbath;i++)
-			{
-			if (beamflag[i] == MB_FLAG_NONE)
-			    store->mbSFlag[i] = 2;
-			else if (beamflag[i] == MB_FLAG_NULL)
-			    store->mbSFlag[i] = 0;
-			else if (!mb_beam_ok(beamflag[i]))
-			    store->mbSFlag[i] = 4;
-			if (beamflag[i] != MB_FLAG_NULL)
-			    {
-			    store->mbDepth[i] = (int)(bath[i] / depthscale);
-			    store->mbAcrossDistance[i] = (int)(bathacrosstrack[i] / distancescale);
-			    store->mbAlongDistance[i] = (int)(bathalongtrack[i] / distancescale);
-			    }
-			else
-			    {
-			    store->mbDepth[i] = 0;
-			    store->mbAcrossDistance[i] = 0;
-			    store->mbAlongDistance[i] = 0;
-			    }
-			}
-		for (i=0;i<namp;i++)
-		    {
-			if (beamflag[i] != MB_FLAG_NULL)
-			    store->mbReflectivity[i] = (char)(amp[i] / store->mbReflectivity_scale_factor);
-			else
-			    store->mbReflectivity[i] = 0;
-		    }
-		}
-
-	/* insert comment in structure */
-	else if (store->kind == MB_DATA_COMMENT)
-		{
-		/* copy in comment */
-		strcpy(store->comment, comment);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_netcdf_ttimes(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, int *nbeams,
-	double *ttimes, double *angles,
-	double *angles_forward, double *angles_null,
-	double *heave, double *alongtrack_offset,
-	double *draft, double *ssv, int *error)
-{
-	char	*function_name = "mbsys_netcdf_ttimes";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_netcdf_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       ttimes:     %p\n",(void *)ttimes);
-		fprintf(stderr,"dbg2       angles_xtrk:%p\n",(void *)angles);
-		fprintf(stderr,"dbg2       angles_ltrk:%p\n",(void *)angles_forward);
-		fprintf(stderr,"dbg2       angles_null:%p\n",(void *)angles_null);
-		fprintf(stderr,"dbg2       heave:      %p\n",(void *)heave);
-		fprintf(stderr,"dbg2       ltrk_off:   %p\n",(void *)alongtrack_offset);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_netcdf_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* no travel times in this data format */
-		*nbeams = 0;
-
-		/* set status */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error == MB_ERROR_NO_ERROR)
-		{
-		fprintf(stderr,"dbg2       draft:      %f\n",*draft);
-		fprintf(stderr,"dbg2       ssv:        %f\n",*ssv);
-		fprintf(stderr,"dbg2       nbeams:     %d\n",*nbeams);
-		for (i=0;i<*nbeams;i++)
-			fprintf(stderr,"dbg2       beam %d: tt:%f  angle_xtrk:%f angle_ltrk:%f  angle_null:%f  depth_off:%f  ltrk_off:%f\n",
-				i,ttimes[i],angles[i],
-				angles_forward[i],angles_null[i],
-				heave[i],alongtrack_offset[i]);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_netcdf_detects(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, int *nbeams,
-	int *detects, int *error)
-{
-	char	*function_name = "mbsys_netcdf_detects";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_netcdf_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       detects:    %p\n",(void *)detects);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_netcdf_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get nbeams */
-		*nbeams = store->mbBeamNbr;
-
-		/* get detects */
-		for (i=0;i<*nbeams;i++)
-			{
-			detects[i] = MB_DETECT_UNKNOWN;
-			}
-
-		/* set status */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error == MB_ERROR_NO_ERROR)
-		{
-		fprintf(stderr,"dbg2       nbeams:     %d\n",*nbeams);
-		for (i=0;i<*nbeams;i++)
-			fprintf(stderr,"dbg2       beam %d: detects:%d\n",
-				i,detects[i]);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_netcdf_extract_altitude(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, double *transducer_depth, double *altitude,
-	int *error)
-{
-	char	*function_name = "mbsys_netcdf_extract_altitude";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_netcdf_struct *store;
-	double depthscale;
-	double distancescale;
-	double xtrackminbest;
-	double vdepthbest;
-	double xtrackmin;
-	double vdepth;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_netcdf_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* set starting values */
-	*transducer_depth = 0.0;
-	*altitude = 0.0;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get transducer depth */
-		if (store->mbDynamicDraught[0] > 0)
-		    {
-		    *transducer_depth = store->mbDynamicDraught[0] * store->mbDynamicDraught_scale_factor;
-		    }
-		else
-		    {
-		    *transducer_depth = store->mbDraught
-					    + store->mbTransmissionHeave[0]
-						    * store->mbTransmissionHeave_scale_factor;
-		    }
-
-		/* get altitude if nonzero */
-		if (store->mbVerticalDepth[0] > 0)
-		    {
-		    *altitude = store->mbVerticalDepth[0] * store->mbVerticalDepth_scale_factor
-			    - *transducer_depth;
-		    }
-		else
-		    {
-		    /* loop over soundings */
-		    depthscale = store->mbDepthScale[0] * store->mbDepthScale_scale_factor;
-		    distancescale = store->mbDistanceScale[0] * store->mbDistanceScale_scale_factor;
-		    xtrackminbest = 10000000.0;
-		    vdepthbest = 0.0;
-		    xtrackmin = 10000000.0;
-		    vdepth = 0.0;
-		    for (i=0;i<store->mbBeamNbr;i++)
-			{
-			if (store->mbSFlag[i] == 2)
-			    {
-			    if (fabs((double) store->mbAcrossDistance[i]) < xtrackminbest)
-				{
-				xtrackminbest = (double) store->mbAcrossDistance[i];
-				vdepthbest = (double) store->mbDepth[i];
-				}
-			    }
-			if (store->mbSFlag[i] != 0)
-			    {
-			    if (fabs((double) store->mbAcrossDistance[i]) < xtrackmin)
-				{
-				xtrackmin = (double) store->mbAcrossDistance[i];
-				vdepth = (double) store->mbDepth[i];
-				}
-			    }
-			}
-		    if (vdepthbest > 0.0)
-			{
-			*altitude = depthscale * vdepthbest - *transducer_depth;
-			}
-		    else if (vdepth > 0.0)
-			{
-			*altitude = depthscale * vdepth - *transducer_depth;
-			}
-		    }
-
-		/* set status */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:              %d\n",*kind);
-		fprintf(stderr,"dbg2       transducer_depth:  %f\n",*transducer_depth);
-		fprintf(stderr,"dbg2       altitude:          %f\n",*altitude);
-		fprintf(stderr,"dbg2       error:             %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:            %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_netcdf_insert_altitude(int verbose, void *mbio_ptr, void *store_ptr,
-	double transducer_depth, double altitude,
-	int *error)
-{
-	char	*function_name = "mbsys_netcdf_insert_altitude";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_netcdf_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:           %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:            %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:         %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       transducer_depth:  %f\n",transducer_depth);
-		fprintf(stderr,"dbg2       altitude:          %f\n",altitude);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_netcdf_struct *) store_ptr;
-
-	/* insert data into structure */
-	if (store->kind == MB_DATA_DATA)
-		{
-		/* get stuff */
-		for (i=0;i<store->mbAntennaNbr;i++)
-		    {
-		    /* set draft */
-		    store->mbDynamicDraught[i] = (int)(transducer_depth
-						    / store->mbDynamicDraught_scale_factor);
-
-		    /* set vertical depth */
-		    store->mbVerticalDepth[i] = (int)((altitude + transducer_depth)
-						    / store->mbVerticalDepth_scale_factor);
-		    }
-
-		/* set status */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-		}
-
-	/* deal with comment */
-	else if (store->kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:             %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:            %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_netcdf_extract_nav(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int time_i[7], double *time_d,
-		double *navlon, double *navlat,
-		double *speed, double *heading, double *draft,
-		double *roll, double *pitch, double *heave,
-		int *error)
-{
-	char	*function_name = "mbsys_netcdf_extract_nav";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_netcdf_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_netcdf_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get time */
-		*time_d = store->mbDate[0] * SECINDAY
-			    + store->mbTime[0] * 0.001;
-		mb_get_date(verbose,*time_d,time_i);
-
-		/* get navigation */
-		*navlon = (double) store->mbAbscissa_scale_factor * store->mbAbscissa[0];
-		*navlat = (double) store->mbOrdinate_scale_factor * store->mbOrdinate[0];
-
-		/* get heading */
-		*heading = store->mbHeading[0] * store->mbHeading_scale_factor;
-
-		/* set speed to zero */
-		*speed = 0.0;
-
-		/* set draft to zero */
-		*draft = store->mbDraught;
-
-		/* get roll pitch and heave */
-		*roll = store->mbRoll[0] * store->mbRoll_scale_factor;
-		*pitch = store->mbPitch[0] * store->mbPitch_scale_factor;
-		*heave = store->mbTransmissionHeave[0] * store->mbTransmissionHeave_scale_factor;
-
-		/* print debug statements */
-		if (verbose >= 5)
-			{
-			fprintf(stderr,"\ndbg4  Data extracted by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  Extracted values:\n");
-			fprintf(stderr,"dbg4       kind:       %d\n",
-				*kind);
-			fprintf(stderr,"dbg4       error:      %d\n",
-				*error);
-			fprintf(stderr,"dbg4       time_i[0]:  %d\n",
-				time_i[0]);
-			fprintf(stderr,"dbg4       time_i[1]:  %d\n",
-				time_i[1]);
-			fprintf(stderr,"dbg4       time_i[2]:  %d\n",
-				time_i[2]);
-			fprintf(stderr,"dbg4       time_i[3]:  %d\n",
-				time_i[3]);
-			fprintf(stderr,"dbg4       time_i[4]:  %d\n",
-				time_i[4]);
-			fprintf(stderr,"dbg4       time_i[5]:  %d\n",
-				time_i[5]);
-			fprintf(stderr,"dbg4       time_i[6]:  %d\n",
-				time_i[6]);
-			fprintf(stderr,"dbg4       time_d:     %f\n",
-				*time_d);
-			fprintf(stderr,"dbg4       longitude:  %f\n",
-				*navlon);
-			fprintf(stderr,"dbg4       latitude:   %f\n",
-				*navlat);
-			fprintf(stderr,"dbg4       speed:      %f\n",
-				*speed);
-			fprintf(stderr,"dbg4       heading:    %f\n",
-				*heading);
-			fprintf(stderr,"dbg4       draft:      %f\n",
-				*draft);
-			fprintf(stderr,"dbg4       roll:       %f\n",
-				*roll);
-			fprintf(stderr,"dbg4       pitch:      %f\n",
-				*pitch);
-			fprintf(stderr,"dbg4       heave:      %f\n",
-				*heave);
-			}
-
-		/* done translating values */
-		/* set status */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind == MB_DATA_DATA)
-		{
-		fprintf(stderr,"dbg2       time_i[0]:     %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:     %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:     %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:     %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:     %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:     %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:     %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:        %f\n",*time_d);
-		fprintf(stderr,"dbg2       longitude:     %f\n",*navlon);
-		fprintf(stderr,"dbg2       latitude:      %f\n",*navlat);
-		fprintf(stderr,"dbg2       speed:         %f\n",*speed);
-		fprintf(stderr,"dbg2       heading:       %f\n",*heading);
-		fprintf(stderr,"dbg2       draft:         %f\n",*draft);
-		fprintf(stderr,"dbg2       roll:          %f\n",*roll);
-		fprintf(stderr,"dbg2       pitch:         %f\n",*pitch);
-		fprintf(stderr,"dbg2       heave:         %f\n",*heave);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_netcdf_insert_nav(int verbose, void *mbio_ptr, void *store_ptr,
-		int time_i[7], double time_d,
-		double navlon, double navlat,
-		double speed, double heading, double draft,
-		double roll, double pitch, double heave,
-		int *error)
-{
-	char	*function_name = "mbsys_netcdf_insert_nav";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_netcdf_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       time_i[0]:  %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:  %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:  %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:  %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:  %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:  %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:  %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:     %f\n",time_d);
-		fprintf(stderr,"dbg2       navlon:     %f\n",navlon);
-		fprintf(stderr,"dbg2       navlat:     %f\n",navlat);
-		fprintf(stderr,"dbg2       speed:      %f\n",speed);
-		fprintf(stderr,"dbg2       heading:    %f\n",heading);
-		fprintf(stderr,"dbg2       draft:      %f\n",draft);
-		fprintf(stderr,"dbg2       roll:       %f\n",roll);
-		fprintf(stderr,"dbg2       pitch:      %f\n",pitch);
-		fprintf(stderr,"dbg2       heave:      %f\n",heave);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_netcdf_struct *) store_ptr;
-
-	/* insert data in structure */
-	if (store->kind == MB_DATA_DATA)
-		{
-		/* reset lon and lat attributes */
-		if (strcmp(store->mbOrdinate_name_code, "MB_POSITION_LATITUDE") != 0)
-		    {
-		    strcpy(store->mbOrdinate_type, "real");
-		    strcpy(store->mbOrdinate_long_name, "Latitude");
-		    strcpy(store->mbOrdinate_name_code, "MB_POSITION_LATITUDE");
-		    strcpy(store->mbOrdinate_units, "degree");
-		    strcpy(store->mbOrdinate_unit_code, "MB_DEGREE");
-		    store->mbOrdinate_add_offset = 0.;
-		    store->mbOrdinate_scale_factor = 5.e-08;
-		    store->mbOrdinate_minimum = -1800000000;
-		    store->mbOrdinate_maximum = 1800000000;
-		    store->mbOrdinate_valid_minimum = -1800000000;
-		    store->mbOrdinate_valid_maximum = 1800000000;
-		    store->mbOrdinate_missing_value = -2000000000 - 147483648;
-		    strcpy(store->mbOrdinate_format_C, "%f");
-		    strcpy(store->mbOrdinate_orientation, "direct");
-		    }
-		if (strcmp(store->mbAbscissa_name_code, "MB_POSITION_LONGITUDE") != 0)
-		    {
-		    strcpy(store->mbAbscissa_type, "real");
-		    strcpy(store->mbAbscissa_long_name, "Longitude");
-		    strcpy(store->mbAbscissa_name_code, "MB_POSITION_LONGITUDE");
-		    strcpy(store->mbAbscissa_units, "degree");
-		    strcpy(store->mbAbscissa_unit_code, "MB_DEGREE");
-		    store->mbAbscissa_add_offset = 0.;
-		    store->mbAbscissa_scale_factor = 1.e-07;
-		    store->mbAbscissa_minimum = -1800000000;
-		    store->mbAbscissa_maximum = 1800000000;
-		    store->mbAbscissa_valid_minimum = -1800000000;
-		    store->mbAbscissa_valid_maximum = 1800000000;
-		    store->mbAbscissa_missing_value = -2000000000 - 147483648;
-		    strcpy(store->mbAbscissa_format_C, "%f");
-		    strcpy(store->mbAbscissa_orientation, "direct");
-		    }
-
-		/* get stuff */
-		for (i=0;i<store->mbAntennaNbr;i++)
-		    {
-		    /* get time */
-		    store->mbDate[i] = (int)(time_d / SECINDAY);
-		    store->mbTime[i] = (int)(1000 * (time_d - store->mbDate[0] * SECINDAY));
-
-		    /* get navigation */
-		    store->mbAbscissa[i] = (int)(navlon / store->mbAbscissa_scale_factor);
-		    store->mbOrdinate[i] = (int)(navlat / store->mbOrdinate_scale_factor);
-
-		    /* get heading */
-		    store->mbHeading[i] = heading / store->mbHeading_scale_factor;
-
-		    /* get speed */
-
-		    /* get draft */
-		    store->mbDraught = draft;
-
-		    /* get roll pitch and heave */
-		    store->mbRoll[i] = roll / store->mbRoll_scale_factor;
-		    store->mbPitch[i] = pitch / store->mbPitch_scale_factor;
-		    store->mbTransmissionHeave[i] = heave / store->mbTransmissionHeave_scale_factor;
-		    }
-
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_netcdf_copy(int verbose, void *mbio_ptr,
-			void *store_ptr, void *copy_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_netcdf_copy";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_netcdf_struct *store;
-	struct mbsys_netcdf_struct *copy;
-	int     i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       copy_ptr:   %p\n",(void *)copy_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointers */
-	store = (struct mbsys_netcdf_struct *) store_ptr;
-	copy = (struct mbsys_netcdf_struct *) copy_ptr;
-
-
-	/* deallocate memory if required */
-	if (store->mbHistoryRecNbr > copy->mbHistoryRecNbr)
-	    {
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbHistDate, error);
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbHistTime, error);
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbHistCode, error);
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbHistAutor, error);
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbHistModule, error);
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbHistComment, error);
-	    }
-	if (store->mbAntennaNbr > copy->mbAntennaNbr)
-	    {
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbCycle, error);
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbDate, error);
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbTime, error);
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbOrdinate, error);
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbAbscissa, error);
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbFrequency, error);
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbSounderMode, error);
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbReferenceDepth, error);
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbDynamicDraught, error);
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbTide, error);
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbSoundVelocity, error);
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbHeading, error);
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbRoll, error);
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbPitch, error);
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbTransmissionHeave, error);
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbDistanceScale, error);
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbDepthScale, error);
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbVerticalDepth, error);
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbCQuality, error);
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbCFlag, error);
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbInterlacing, error);
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbSamplingRate, error);
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbBeam, error);
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbAFlag, error);
-	    }
-	if (store->mbBeamNbr > copy->mbBeamNbr)
-	    {
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbAlongDistance, error);
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbAcrossDistance, error);
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbDepth, error);
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbSQuality, error);
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbSFlag, error);
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbAntenna, error);
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbBeamBias, error);
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbBFlag, error);
-	    }
-	if (store->mbVelocityProfilNbr > copy->mbVelocityProfilNbr)
-	    {
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbVelProfilRef, error);
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbVelProfilIdx, error);
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbVelProfilDate, error);
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbVelProfilTime, error);
-	    }
-
-	/* allocate the memory in copy */
-	if (status == MB_SUCCESS)
-	    {
-	    copy->mbHistoryRecNbr = store->mbHistoryRecNbr;
-	    copy->mbNameLength = store->mbNameLength;
-	    copy->mbCommentLength = store->mbCommentLength;
-	    copy->mbAntennaNbr = store->mbAntennaNbr;
-	    copy->mbBeamNbr = store->mbBeamNbr;
-	    copy->mbCycleNbr = store->mbCycleNbr;
-	    copy->mbVelocityProfilNbr = store->mbVelocityProfilNbr;
-	    status = mb_mallocd(verbose,__FILE__,__LINE__,
-			copy->mbHistoryRecNbr * sizeof(int),
-			(void **)&copy->mbHistDate,error);
-	    status = mb_mallocd(verbose,__FILE__,__LINE__,
-			copy->mbHistoryRecNbr * sizeof(int),
-			(void **)&copy->mbHistTime,error);
-	    status = mb_mallocd(verbose,__FILE__,__LINE__,
-			copy->mbHistoryRecNbr * sizeof(char),
-			(void **)&copy->mbHistCode,error);
-	    status = mb_mallocd(verbose,__FILE__,__LINE__,
-			copy->mbHistoryRecNbr * copy->mbNameLength * sizeof(char),
-			(void **)&copy->mbHistAutor,error);
-	    status = mb_mallocd(verbose,__FILE__,__LINE__,
-			copy->mbHistoryRecNbr * copy->mbNameLength * sizeof(char),
-			(void **)&copy->mbHistModule,error);
-	    status = mb_mallocd(verbose,__FILE__,__LINE__,
-			copy->mbHistoryRecNbr * copy->mbCommentLength * sizeof(char),
-			(void **)&copy->mbHistComment,error);
-	    status = mb_mallocd(verbose,__FILE__,__LINE__,
-			copy->mbAntennaNbr * sizeof(short),
-			(void **)&copy->mbCycle,error);
-	    status = mb_mallocd(verbose,__FILE__,__LINE__,
-			copy->mbAntennaNbr * sizeof(int),
-			(void **)&copy->mbDate,error);
-	    status = mb_mallocd(verbose,__FILE__,__LINE__,
-			copy->mbAntennaNbr * sizeof(int),
-			(void **)&copy->mbTime,error);
-	    status = mb_mallocd(verbose,__FILE__,__LINE__,
-			copy->mbAntennaNbr * sizeof(int),
-			(void **)&copy->mbOrdinate,error);
-	    status = mb_mallocd(verbose,__FILE__,__LINE__,
-			copy->mbAntennaNbr * sizeof(int),
-			(void **)&copy->mbAbscissa,error);
-	    status = mb_mallocd(verbose,__FILE__,__LINE__,
-			copy->mbAntennaNbr * sizeof(char),
-			(void **)&copy->mbFrequency,error);
-	    status = mb_mallocd(verbose,__FILE__,__LINE__,
-			copy->mbAntennaNbr * sizeof(char),
-			(void **)&copy->mbSounderMode,error);
-	    status = mb_mallocd(verbose,__FILE__,__LINE__,
-			copy->mbAntennaNbr * sizeof(int),
-			(void **)&copy->mbReferenceDepth,error);
-	    status = mb_mallocd(verbose,__FILE__,__LINE__,
-			copy->mbAntennaNbr * sizeof(short),
-			(void **)&copy->mbDynamicDraught,error);
-	    status = mb_mallocd(verbose,__FILE__,__LINE__,
-			copy->mbAntennaNbr * sizeof(short),
-			(void **)&copy->mbTide,error);
-	    status = mb_mallocd(verbose,__FILE__,__LINE__,
-			copy->mbAntennaNbr * sizeof(short),
-			(void **)&copy->mbSoundVelocity,error);
-	    status = mb_mallocd(verbose,__FILE__,__LINE__,
-			copy->mbAntennaNbr * sizeof(short),
-			(void **)&copy->mbHeading,error);
-	    status = mb_mallocd(verbose,__FILE__,__LINE__,
-			copy->mbAntennaNbr * sizeof(short),
-			(void **)&copy->mbRoll,error);
-	    status = mb_mallocd(verbose,__FILE__,__LINE__,
-			copy->mbAntennaNbr * sizeof(short),
-			(void **)&copy->mbPitch,error);
-	    status = mb_mallocd(verbose,__FILE__,__LINE__,
-			copy->mbAntennaNbr * sizeof(short),
-			(void **)&copy->mbTransmissionHeave,error);
-	    status = mb_mallocd(verbose,__FILE__,__LINE__,
-			copy->mbAntennaNbr * sizeof(char),
-			(void **)&copy->mbDistanceScale,error);
-	    status = mb_mallocd(verbose,__FILE__,__LINE__,
-			copy->mbAntennaNbr * sizeof(char),
-			(void **)&copy->mbDepthScale,error);
-	    status = mb_mallocd(verbose,__FILE__,__LINE__,
-			copy->mbAntennaNbr * sizeof(int),
-			(void **)&copy->mbVerticalDepth,error);
-	    status = mb_mallocd(verbose,__FILE__,__LINE__,
-			copy->mbAntennaNbr * sizeof(char),
-			(void **)&copy->mbCQuality,error);
-	    status = mb_mallocd(verbose,__FILE__,__LINE__,
-			copy->mbAntennaNbr * sizeof(char),
-			(void **)&copy->mbCFlag,error);
-	    status = mb_mallocd(verbose,__FILE__,__LINE__,
-			copy->mbAntennaNbr * sizeof(char),
-			(void **)&copy->mbInterlacing,error);
-	    status = mb_mallocd(verbose,__FILE__,__LINE__,
-			copy->mbAntennaNbr * sizeof(short),
-			(void **)&copy->mbSamplingRate,error);
-	    status = mb_mallocd(verbose,__FILE__,__LINE__,
-			copy->mbBeamNbr * sizeof(short),
-			(void **)&copy->mbAlongDistance,error);
-	    status = mb_mallocd(verbose,__FILE__,__LINE__,
-			copy->mbBeamNbr * sizeof(short),
-			(void **)&copy->mbAcrossDistance,error);
-	    status = mb_mallocd(verbose,__FILE__,__LINE__,
-			copy->mbBeamNbr * sizeof(int),
-			(void **)&copy->mbDepth,error);
-	    status = mb_mallocd(verbose,__FILE__,__LINE__,
-			copy->mbBeamNbr * sizeof(char),
-			(void **)&copy->mbSQuality,error);
-	    status = mb_mallocd(verbose,__FILE__,__LINE__,
-			copy->mbBeamNbr * sizeof(char),
-			(void **)&copy->mbSFlag,error);
-	    status = mb_mallocd(verbose,__FILE__,__LINE__,
-			copy->mbBeamNbr * sizeof(char),
-			(void **)&copy->mbAntenna,error);
-	    status = mb_mallocd(verbose,__FILE__,__LINE__,
-			copy->mbBeamNbr * sizeof(short),
-			(void **)&copy->mbBeamBias,error);
-	    status = mb_mallocd(verbose,__FILE__,__LINE__,
-			copy->mbBeamNbr * sizeof(char),
-			(void **)&copy->mbBFlag,error);
-	    status = mb_mallocd(verbose,__FILE__,__LINE__,
-			copy->mbAntennaNbr * sizeof(short),
-			(void **)&copy->mbBeam,error);
-	    status = mb_mallocd(verbose,__FILE__,__LINE__,
-			copy->mbAntennaNbr * sizeof(char),
-			(void **)&copy->mbAFlag,error);
-	    status = mb_mallocd(verbose,__FILE__,__LINE__,
-			copy->mbVelocityProfilNbr * copy->mbCommentLength * sizeof(char),
-			(void **)&copy->mbVelProfilRef,error);
-	    status = mb_mallocd(verbose,__FILE__,__LINE__,
-			copy->mbVelocityProfilNbr * sizeof(short),
-			(void **)&copy->mbVelProfilIdx,error);
-	    status = mb_mallocd(verbose,__FILE__,__LINE__,
-			copy->mbVelocityProfilNbr * sizeof(int),
-			(void **)&copy->mbVelProfilDate,error);
-	    status = mb_mallocd(verbose,__FILE__,__LINE__,
-			copy->mbVelocityProfilNbr * sizeof(int),
-			(void **)&copy->mbVelProfilTime,error);
-	    }
-
-	/* deal with a memory allocation failure */
-	if (status == MB_FAILURE)
-	    {
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbHistDate, error);
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbHistTime, error);
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbHistCode, error);
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbHistAutor, error);
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbHistModule, error);
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbHistComment, error);
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbCycle, error);
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbDate, error);
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbTime, error);
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbOrdinate, error);
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbAbscissa, error);
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbFrequency, error);
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbSounderMode, error);
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbReferenceDepth, error);
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbDynamicDraught, error);
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbTide, error);
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbSoundVelocity, error);
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbHeading, error);
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbRoll, error);
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbPitch, error);
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbTransmissionHeave, error);
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbDistanceScale, error);
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbDepthScale, error);
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbVerticalDepth, error);
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbCQuality, error);
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbCFlag, error);
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbInterlacing, error);
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbSamplingRate, error);
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbAlongDistance, error);
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbAcrossDistance, error);
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbDepth, error);
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbSQuality, error);
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbSFlag, error);
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbAntenna, error);
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbBeamBias, error);
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbBFlag, error);
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbBeam, error);
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbAFlag, error);
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbVelProfilRef, error);
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbVelProfilIdx, error);
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbVelProfilDate, error);
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->mbVelProfilTime, error);
-	    status = MB_FAILURE;
-	    *error = MB_ERROR_MEMORY_FAIL;
-	    if (verbose >= 2)
-		    {
-		    fprintf(stderr,"\ndbg2  MBIO function <%s> terminated with error\n",
-			    function_name);
-		    fprintf(stderr,"dbg2  Return values:\n");
-		    fprintf(stderr,"dbg2       error:      %d\n",*error);
-		    fprintf(stderr,"dbg2  Return status:\n");
-		    fprintf(stderr,"dbg2       status:  %d\n",status);
-		    }
-	    return(status);
-	    }
-
-	/* copy the data */
-	if (status == MB_SUCCESS)
-	    {
-	    copy->kind = store->kind;
-
-	    /* global attributes */
-	    copy->mbVersion = store->mbVersion;
-	    for (i=0;i<64;i++)
-		{
-		copy->mbName[i] = store->mbName[i];
-		copy->mbClasse[i] = store->mbClasse[i];
-		copy->mbTimeReference[i] = store->mbTimeReference[i];
-		copy->mbMeridian180[i] = store->mbMeridian180[i];
-		copy->mbGeoDictionnary[i] = store->mbGeoDictionnary[i];
-		copy->mbGeoRepresentation[i] = store->mbGeoRepresentation[i];
-		copy->mbGeodesicSystem[i] = store->mbGeodesicSystem[i];
-		}
-	    for (i=0;i<256;i++)
-		{
-		copy->mbEllipsoidName[i] = store->mbEllipsoidName[i];
-		copy->mbProjParameterCode[i] = store->mbProjParameterCode[i];
-		copy->mbShip[i] = store->mbShip[i];
-		copy->mbSurvey[i] = store->mbSurvey[i];
-		copy->mbReference[i] = store->mbReference[i];
-		copy->mbNavRef[i] = store->mbNavRef[i];
-		copy->mbTideRef[i] = store->mbTideRef[i];
-		}
-	    copy->mbLevel = store->mbLevel;
-	    copy->mbNbrHistoryRec = store->mbNbrHistoryRec;
-	    copy->mbStartDate = store->mbStartDate;
-	    copy->mbStartTime = store->mbStartTime;
-	    copy->mbEndDate = store->mbEndDate;
-	    copy->mbEndTime = store->mbEndTime;
-	    copy->mbNorthLatitude = store->mbNorthLatitude;
-	    copy->mbSouthLatitude = store->mbSouthLatitude;
-	    copy->mbEastLongitude = store->mbEastLongitude;
-	    copy->mbWestLongitude = store->mbWestLongitude;
-	    copy->mbEllipsoidA = store->mbEllipsoidA;
-	    copy->mbEllipsoidInvF = store->mbEllipsoidInvF;
-	    copy->mbEllipsoidE2 = store->mbEllipsoidE2;
-	    copy->mbProjType = store->mbProjType;
-	    for (i=0;i<10;i++)
-		copy->mbProjParameterValue[i] = store->mbProjParameterValue[i];
-	    copy->mbSounder = store->mbSounder = store->mbSounder;
-	    for (i=0;i<3;i++)
-		{
-		copy->mbAntennaOffset[i] = store->mbAntennaOffset[i];
-		copy->mbSounderOffset[i] = store->mbSounderOffset[i];
-		copy->mbVRUOffset[i] = store->mbVRUOffset[i];
-		}
-	    copy->mbAntennaDelay = store->mbAntennaDelay;
-	    copy->mbSounderDelay = store->mbSounderDelay;
-	    copy->mbVRUDelay = store->mbVRUDelay;
-	    copy->mbHeadingBias = store->mbHeadingBias;
-	    copy->mbRollBias = store->mbRollBias;
-	    copy->mbPitchBias = store->mbPitchBias;
-	    copy->mbHeaveBias = store->mbHeaveBias;
-	    copy->mbDraught = store->mbDraught;
-	    copy->mbNavType = store->mbNavType;
-	    copy->mbTideType = store->mbTideType;
-	    copy->mbMinDepth = store->mbMinDepth;
-	    copy->mbMaxDepth = store->mbMaxDepth;
-	    copy->mbCycleCounter = store->mbCycleCounter;
-
-	    /* variable ids */
-	    copy->mbHistDate_id = store->mbHistDate_id;
-	    copy->mbHistTime_id = store->mbHistTime_id;
-	    copy->mbHistCode_id = store->mbHistCode_id;
-	    copy->mbHistAutor_id = store->mbHistAutor_id;
-	    copy->mbHistModule_id = store->mbHistModule_id;
-	    copy->mbHistComment_id = store->mbHistComment_id;
-	    copy->mbCycle_id = store->mbCycle_id;
-	    copy->mbDate_id = store->mbDate_id;
-	    copy->mbTime_id = store->mbTime_id;
-	    copy->mbOrdinate_id = store->mbOrdinate_id;
-	    copy->mbAbscissa_id = store->mbAbscissa_id;
-	    copy->mbFrequency_id = store->mbFrequency_id;
-	    copy->mbSounderMode_id = store->mbSounderMode_id;
-	    copy->mbReferenceDepth_id = store->mbReferenceDepth_id;
-	    copy->mbDynamicDraught_id = store->mbDynamicDraught_id;
-	    copy->mbTide_id = store->mbTide_id;
-	    copy->mbSoundVelocity_id = store->mbSoundVelocity_id;
-	    copy->mbHeading_id = store->mbHeading_id;
-	    copy->mbRoll_id = store->mbRoll_id;
-	    copy->mbPitch_id = store->mbPitch_id;
-	    copy->mbTransmissionHeave_id = store->mbTransmissionHeave_id;
-	    copy->mbDistanceScale_id = store->mbDistanceScale_id;
-	    copy->mbDepthScale_id = store->mbDepthScale_id;
-	    copy->mbVerticalDepth_id = store->mbVerticalDepth_id;
-	    copy->mbCQuality_id = store->mbCQuality_id;
-	    copy->mbCFlag_id = store->mbCFlag_id;
-	    copy->mbInterlacing_id = store->mbInterlacing_id;
-	    copy->mbSamplingRate_id = store->mbSamplingRate_id;
-	    copy->mbAlongDistance_id = store->mbAlongDistance_id;
-	    copy->mbAcrossDistance_id = store->mbAcrossDistance_id;
-	    copy->mbDepth_id = store->mbDepth_id;
-	    copy->mbSQuality_id = store->mbSQuality_id;
-	    copy->mbSFlag_id = store->mbSFlag_id;
-	    copy->mbAntenna_id = store->mbAntenna_id;
-	    copy->mbBeamBias_id = store->mbBeamBias_id;
-	    copy->mbBFlag_id = store->mbBFlag_id;
-	    copy->mbBeam_id = store->mbBeam_id;
-	    copy->mbAFlag_id = store->mbAFlag_id;
-	    copy->mbVelProfilRef_id = store->mbVelProfilRef_id;
-	    copy->mbVelProfilIdx_id = store->mbVelProfilIdx_id;
-	    copy->mbVelProfilDate_id = store->mbVelProfilDate_id;
-	    copy->mbVelProfilTime_id = store->mbVelProfilTime_id;
-
-	    /* variable pointers */
-	    for (i=0;i<copy->mbHistoryRecNbr;i++)
-	        {
-	        copy->mbHistDate[i] = store->mbHistDate[i];
-	        copy->mbHistTime[i] = store->mbHistTime[i];
-	        copy->mbHistCode[i] = store->mbHistCode[i];
-	        copy->mbHistAutor[i] = store->mbHistAutor[i];
-	        copy->mbHistModule[i] = store->mbHistModule[i];
-	        copy->mbHistComment[i] = store->mbHistComment[i];
-	        }
-	    for (i=0;i<copy->mbAntennaNbr;i++)
-	        {
-		copy->mbCycle[i] = store->mbCycle[i];
-		copy->mbDate[i] = store->mbDate[i];
-		copy->mbTime[i] = store->mbTime[i];
-		copy->mbOrdinate[i] = store->mbOrdinate[i];
-		copy->mbAbscissa[i] = store->mbAbscissa[i];
-		copy->mbFrequency[i] = store->mbFrequency[i];
-		copy->mbSounderMode[i] = store->mbSounderMode[i];
-		copy->mbReferenceDepth[i] = store->mbReferenceDepth[i];
-		copy->mbDynamicDraught[i] = store->mbDynamicDraught[i];
-		copy->mbTide[i] = store->mbTide[i];
-		copy->mbSoundVelocity[i] = store->mbSoundVelocity[i];
-		copy->mbHeading[i] = store->mbHeading[i];
-		copy->mbRoll[i] = store->mbRoll[i];
-		copy->mbPitch[i] = store->mbPitch[i];
-		copy->mbTransmissionHeave[i] = store->mbTransmissionHeave[i];
-		copy->mbDistanceScale[i] = store->mbDistanceScale[i];
-		copy->mbDepthScale[i] = store->mbDepthScale[i];
-		copy->mbVerticalDepth[i] = store->mbVerticalDepth[i];
-		copy->mbCQuality[i] = store->mbCQuality[i];
-		copy->mbCFlag[i] = store->mbCFlag[i];
-		copy->mbInterlacing[i] = store->mbInterlacing[i];
-		copy->mbSamplingRate[i] = store->mbSamplingRate[i];
-		}
-	    for (i=0;i<copy->mbBeamNbr;i++)
-	        {
-		copy->mbAlongDistance[i] = store->mbAlongDistance[i];
-		copy->mbAcrossDistance[i] = store->mbAcrossDistance[i];
-		copy->mbDepth[i] = store->mbDepth[i];
-		copy->mbSQuality[i] = store->mbSQuality[i];
-		copy->mbSFlag[i] = store->mbSFlag[i];
-		copy->mbAntenna[i] = store->mbAntenna[i];
-		copy->mbBeamBias[i] = store->mbBeamBias[i];
-		copy->mbBFlag[i] = store->mbBFlag[i];
-		}
-	    for (i=0;i<copy->mbAntennaNbr;i++)
-	        {
-		copy->mbBeam[i] = store->mbBeam[i];
-		copy->mbAFlag[i] = store->mbAFlag[i];
-		}
-	    for (i=0;i<copy->mbVelocityProfilNbr;i++)
-	        {
-		copy->mbVelProfilRef[i] = store->mbVelProfilRef[i];
-		copy->mbVelProfilIdx[i] = store->mbVelProfilIdx[i];
-		copy->mbVelProfilDate[i] = store->mbVelProfilDate[i];
-		copy->mbVelProfilTime[i] = store->mbVelProfilTime[i];
-		}
-
-	    /* variable attributes */
-	    for (i=0;i<64;i++)
-		{
-		copy->mbHistDate_type[i] = store->mbHistDate_type[i];
-		copy->mbHistDate_long_name[i] = store->mbHistDate_long_name[i];
-		copy->mbHistDate_name_code[i] = store->mbHistDate_name_code[i];
-		copy->mbHistDate_units[i] = store->mbHistDate_units[i];
-		copy->mbHistDate_unit_code[i] = store->mbHistDate_unit_code[i];
-		copy->mbHistDate_format_C[i] = store->mbHistDate_format_C[i];
-		copy->mbHistDate_orientation[i] = store->mbHistDate_orientation[i];
-		copy->mbHistTime_type[i] = store->mbHistTime_type[i];
-		copy->mbHistTime_long_name[i] = store->mbHistTime_long_name[i];
-		copy->mbHistTime_name_code[i] = store->mbHistTime_name_code[i];
-		copy->mbHistTime_units[i] = store->mbHistTime_units[i];
-		copy->mbHistTime_unit_code[i] = store->mbHistTime_unit_code[i];
-		copy->mbHistTime_format_C[i] = store->mbHistTime_format_C[i];
-		copy->mbHistTime_orientation[i] = store->mbHistTime_orientation[i];
-		copy->mbHistCode_type[i] = store->mbHistCode_type[i];
-		copy->mbHistCode_long_name[i] = store->mbHistCode_long_name[i];
-		copy->mbHistCode_name_code[i] = store->mbHistCode_name_code[i];
-		copy->mbHistCode_units[i] = store->mbHistCode_units[i];
-		copy->mbHistCode_unit_code[i] = store->mbHistCode_unit_code[i];
-		copy->mbHistCode_format_C[i] = store->mbHistCode_format_C[i];
-		copy->mbHistCode_orientation[i] = store->mbHistCode_orientation[i];
-		copy->mbHistAutor_type[i] = store->mbHistAutor_type[i];
-		copy->mbHistAutor_long_name[i] = store->mbHistAutor_long_name[i];
-		copy->mbHistAutor_name_code[i] = store->mbHistAutor_name_code[i];
-		copy->mbHistModule_type[i] = store->mbHistModule_type[i];
-		copy->mbHistModule_long_name[i] = store->mbHistModule_long_name[i];
-		copy->mbHistModule_name_code[i] = store->mbHistModule_name_code[i];
-		copy->mbHistComment_type[i] = store->mbHistComment_type[i];
-		copy->mbHistComment_long_name[i] = store->mbHistComment_long_name[i];
-		copy->mbHistComment_name_code[i] = store->mbHistComment_name_code[i];
-		copy->mbCycle_type[i] = store->mbCycle_type[i];
-		copy->mbCycle_long_name[i] = store->mbCycle_long_name[i];
-		copy->mbCycle_name_code[i] = store->mbCycle_name_code[i];
-		copy->mbCycle_units[i] = store->mbCycle_units[i];
-		copy->mbCycle_unit_code[i] = store->mbCycle_unit_code[i];
-		copy->mbCycle_format_C[i] = store->mbCycle_format_C[i];
-		copy->mbCycle_orientation[i] = store->mbCycle_orientation[i];
-		copy->mbDate_type[i] = store->mbDate_type[i];
-		copy->mbDate_long_name[i] = store->mbDate_long_name[i];
-		copy->mbDate_name_code[i] = store->mbDate_name_code[i];
-		copy->mbDate_units[i] = store->mbDate_units[i];
-		copy->mbDate_unit_code[i] = store->mbDate_unit_code[i];
-		copy->mbDate_format_C[i] = store->mbDate_format_C[i];
-		copy->mbDate_orientation[i] = store->mbDate_orientation[i];
-		copy->mbTime_type[i] = store->mbTime_type[i];
-		copy->mbTime_long_name[i] = store->mbTime_long_name[i];
-		copy->mbTime_name_code[i] = store->mbTime_name_code[i];
-		copy->mbTime_units[i] = store->mbTime_units[i];
-		copy->mbTime_unit_code[i] = store->mbTime_unit_code[i];
-		copy->mbTime_format_C[i] = store->mbTime_format_C[i];
-		copy->mbTime_orientation[i] = store->mbTime_orientation[i];
-		copy->mbOrdinate_type[i] = store->mbOrdinate_type[i];
-		copy->mbOrdinate_long_name[i] = store->mbOrdinate_long_name[i];
-		copy->mbOrdinate_name_code[i] = store->mbOrdinate_name_code[i];
-		copy->mbOrdinate_units[i] = store->mbOrdinate_units[i];
-		copy->mbOrdinate_unit_code[i] = store->mbOrdinate_unit_code[i];
-		copy->mbOrdinate_format_C[i] = store->mbOrdinate_format_C[i];
-		copy->mbOrdinate_orientation[i] = store->mbOrdinate_orientation[i];
-		copy->mbAbscissa_type[i] = store->mbAbscissa_type[i];
-		copy->mbAbscissa_long_name[i] = store->mbAbscissa_long_name[i];
-		copy->mbAbscissa_name_code[i] = store->mbAbscissa_name_code[i];
-		copy->mbAbscissa_units[i] = store->mbAbscissa_units[i];
-		copy->mbAbscissa_unit_code[i] = store->mbAbscissa_unit_code[i];
-		copy->mbAbscissa_format_C[i] = store->mbAbscissa_format_C[i];
-		copy->mbAbscissa_orientation[i] = store->mbAbscissa_orientation[i];
-		copy->mbFrequency_type[i] = store->mbFrequency_type[i];
-		copy->mbFrequency_long_name[i] = store->mbFrequency_long_name[i];
-		copy->mbFrequency_name_code[i] = store->mbFrequency_name_code[i];
-		copy->mbFrequency_units[i] = store->mbFrequency_units[i];
-		copy->mbFrequency_unit_code[i] = store->mbFrequency_unit_code[i];
-		copy->mbFrequency_format_C[i] = store->mbFrequency_format_C[i];
-		copy->mbFrequency_orientation[i] = store->mbFrequency_orientation[i];
-		copy->mbSounderMode_type[i] = store->mbSounderMode_type[i];
-		copy->mbSounderMode_long_name[i] = store->mbSounderMode_long_name[i];
-		copy->mbSounderMode_name_code[i] = store->mbSounderMode_name_code[i];
-		copy->mbSounderMode_units[i] = store->mbSounderMode_units[i];
-		copy->mbSounderMode_unit_code[i] = store->mbSounderMode_unit_code[i];
-		copy->mbSounderMode_format_C[i] = store->mbSounderMode_format_C[i];
-		copy->mbSounderMode_orientation[i] = store->mbSounderMode_orientation[i];
-		copy->mbReferenceDepth_type[i] = store->mbReferenceDepth_type[i];
-		copy->mbReferenceDepth_long_name[i] = store->mbReferenceDepth_long_name[i];
-		copy->mbReferenceDepth_name_code[i] = store->mbReferenceDepth_name_code[i];
-		copy->mbReferenceDepth_units[i] = store->mbReferenceDepth_units[i];
-		copy->mbReferenceDepth_unit_code[i] = store->mbReferenceDepth_unit_code[i];
-		copy->mbReferenceDepth_format_C[i] = store->mbReferenceDepth_format_C[i];
-		copy->mbReferenceDepth_orientation[i] = store->mbReferenceDepth_orientation[i];
-		copy->mbDynamicDraught_type[i] = store->mbDynamicDraught_type[i];
-		copy->mbDynamicDraught_long_name[i] = store->mbDynamicDraught_long_name[i];
-		copy->mbDynamicDraught_name_code[i] = store->mbDynamicDraught_name_code[i];
-		copy->mbDynamicDraught_units[i] = store->mbDynamicDraught_units[i];
-		copy->mbDynamicDraught_unit_code[i] = store->mbDynamicDraught_unit_code[i];
-		copy->mbDynamicDraught_format_C[i] = store->mbDynamicDraught_format_C[i];
-		copy->mbDynamicDraught_orientation[i] = store->mbDynamicDraught_orientation[i];
-		copy->mbTide_type[i] = store->mbTide_type[i];
-		copy->mbTide_long_name[i] = store->mbTide_long_name[i];
-		copy->mbTide_name_code[i] = store->mbTide_name_code[i];
-		copy->mbTide_units[i] = store->mbTide_units[i];
-		copy->mbTide_unit_code[i] = store->mbTide_unit_code[i];
-		copy->mbTide_format_C[i] = store->mbTide_format_C[i];
-		copy->mbTide_orientation[i] = store->mbTide_orientation[i];
-		copy->mbSoundVelocity_type[i] = store->mbSoundVelocity_type[i];
-		copy->mbSoundVelocity_long_name[i] = store->mbSoundVelocity_long_name[i];
-		copy->mbSoundVelocity_name_code[i] = store->mbSoundVelocity_name_code[i];
-		copy->mbSoundVelocity_units[i] = store->mbSoundVelocity_units[i];
-		copy->mbSoundVelocity_unit_code[i] = store->mbSoundVelocity_unit_code[i];
-		copy->mbSoundVelocity_format_C[i] = store->mbSoundVelocity_format_C[i];
-		copy->mbSoundVelocity_orientation[i] = store->mbSoundVelocity_orientation[i];
-		copy->mbHeading_type[i] = store->mbHeading_type[i];
-		copy->mbHeading_long_name[i] = store->mbHeading_long_name[i];
-		copy->mbHeading_name_code[i] = store->mbHeading_name_code[i];
-		copy->mbHeading_units[i] = store->mbHeading_units[i];
-		copy->mbHeading_unit_code[i] = store->mbHeading_unit_code[i];
-		copy->mbHeading_format_C[i] = store->mbHeading_format_C[i];
-		copy->mbHeading_orientation[i] = store->mbHeading_orientation[i];
-		copy->mbRoll_type[i] = store->mbRoll_type[i];
-		copy->mbRoll_long_name[i] = store->mbRoll_long_name[i];
-		copy->mbRoll_name_code[i] = store->mbRoll_name_code[i];
-		copy->mbRoll_units[i] = store->mbRoll_units[i];
-		copy->mbRoll_unit_code[i] = store->mbRoll_unit_code[i];
-		copy->mbRoll_format_C[i] = store->mbRoll_format_C[i];
-		copy->mbRoll_orientation[i] = store->mbRoll_orientation[i];
-		copy->mbPitch_type[i] = store->mbPitch_type[i];
-		copy->mbPitch_long_name[i] = store->mbPitch_long_name[i];
-		copy->mbPitch_name_code[i] = store->mbPitch_name_code[i];
-		copy->mbPitch_units[i] = store->mbPitch_units[i];
-		copy->mbPitch_unit_code[i] = store->mbPitch_unit_code[i];
-		copy->mbPitch_format_C[i] = store->mbPitch_format_C[i];
-		copy->mbPitch_orientation[i] = store->mbPitch_orientation[i];
-		copy->mbTransmissionHeave_type[i] = store->mbTransmissionHeave_type[i];
-		copy->mbTransmissionHeave_long_name[i] = store->mbTransmissionHeave_long_name[i];
-		copy->mbTransmissionHeave_name_code[i] = store->mbTransmissionHeave_name_code[i];
-		copy->mbTransmissionHeave_units[i] = store->mbTransmissionHeave_units[i];
-		copy->mbTransmissionHeave_unit_code[i] = store->mbTransmissionHeave_unit_code[i];
-		copy->mbTransmissionHeave_format_C[i] = store->mbTransmissionHeave_format_C[i];
-		copy->mbTransmissionHeave_orientation[i] = store->mbTransmissionHeave_orientation[i];
-		copy->mbDistanceScale_type[i] = store->mbDistanceScale_type[i];
-		copy->mbDistanceScale_long_name[i] = store->mbDistanceScale_long_name[i];
-		copy->mbDistanceScale_name_code[i] = store->mbDistanceScale_name_code[i];
-		copy->mbDistanceScale_units[i] = store->mbDistanceScale_units[i];
-		copy->mbDistanceScale_unit_code[i] = store->mbDistanceScale_unit_code[i];
-		copy->mbDistanceScale_format_C[i] = store->mbDistanceScale_format_C[i];
-		copy->mbDistanceScale_orientation[i] = store->mbDistanceScale_orientation[i];
-		copy->mbDepthScale_type[i] = store->mbDepthScale_type[i];
-		copy->mbDepthScale_long_name[i] = store->mbDepthScale_long_name[i];
-		copy->mbDepthScale_name_code[i] = store->mbDepthScale_name_code[i];
-		copy->mbDepthScale_units[i] = store->mbDepthScale_units[i];
-		copy->mbDepthScale_unit_code[i] = store->mbDepthScale_unit_code[i];
-		copy->mbDepthScale_format_C[i] = store->mbDepthScale_format_C[i];
-		copy->mbDepthScale_orientation[i] = store->mbDepthScale_orientation[i];
-		copy->mbVerticalDepth_type[i] = store->mbVerticalDepth_type[i];
-		copy->mbVerticalDepth_long_name[i] = store->mbVerticalDepth_long_name[i];
-		copy->mbVerticalDepth_name_code[i] = store->mbVerticalDepth_name_code[i];
-		copy->mbVerticalDepth_units[i] = store->mbVerticalDepth_units[i];
-		copy->mbVerticalDepth_unit_code[i] = store->mbVerticalDepth_unit_code[i];
-		copy->mbVerticalDepth_format_C[i] = store->mbVerticalDepth_format_C[i];
-		copy->mbVerticalDepth_orientation[i] = store->mbVerticalDepth_orientation[i];
-		copy->mbCQuality_type[i] = store->mbCQuality_type[i];
-		copy->mbCQuality_long_name[i] = store->mbCQuality_long_name[i];
-		copy->mbCQuality_name_code[i] = store->mbCQuality_name_code[i];
-		copy->mbCQuality_units[i] = store->mbCQuality_units[i];
-		copy->mbCQuality_unit_code[i] = store->mbCQuality_unit_code[i];
-		copy->mbCQuality_format_C[i] = store->mbCQuality_format_C[i];
-		copy->mbCQuality_orientation[i] = store->mbCQuality_orientation[i];
-		copy->mbCFlag_type[i] = store->mbCFlag_type[i];
-		copy->mbCFlag_long_name[i] = store->mbCFlag_long_name[i];
-		copy->mbCFlag_name_code[i] = store->mbCFlag_name_code[i];
-		copy->mbCFlag_units[i] = store->mbCFlag_units[i];
-		copy->mbCFlag_unit_code[i] = store->mbCFlag_unit_code[i];
-		copy->mbCFlag_format_C[i] = store->mbCFlag_format_C[i];
-		copy->mbCFlag_orientation[i] = store->mbCFlag_orientation[i];
-		copy->mbInterlacing_type[i] = store->mbInterlacing_type[i];
-		copy->mbInterlacing_long_name[i] = store->mbInterlacing_long_name[i];
-		copy->mbInterlacing_name_code[i] = store->mbInterlacing_name_code[i];
-		copy->mbInterlacing_units[i] = store->mbInterlacing_units[i];
-		copy->mbInterlacing_unit_code[i] = store->mbInterlacing_unit_code[i];
-		copy->mbInterlacing_format_C[i] = store->mbInterlacing_format_C[i];
-		copy->mbInterlacing_orientation[i] = store->mbInterlacing_orientation[i];
-		copy->mbSamplingRate_type[i] = store->mbSamplingRate_type[i];
-		copy->mbSamplingRate_long_name[i] = store->mbSamplingRate_long_name[i];
-		copy->mbSamplingRate_name_code[i] = store->mbSamplingRate_name_code[i];
-		copy->mbSamplingRate_units[i] = store->mbSamplingRate_units[i];
-		copy->mbSamplingRate_unit_code[i] = store->mbSamplingRate_unit_code[i];
-		copy->mbSamplingRate_format_C[i] = store->mbSamplingRate_format_C[i];
-		copy->mbSamplingRate_orientation[i] = store->mbSamplingRate_orientation[i];
-		copy->mbAlongDistance_type[i] = store->mbAlongDistance_type[i];
-		copy->mbAlongDistance_long_name[i] = store->mbAlongDistance_long_name[i];
-		copy->mbAlongDistance_name_code[i] = store->mbAlongDistance_name_code[i];
-		copy->mbAlongDistance_units[i] = store->mbAlongDistance_units[i];
-		copy->mbAlongDistance_unit_code[i] = store->mbAlongDistance_unit_code[i];
-		copy->mbAlongDistance_format_C[i] = store->mbAlongDistance_format_C[i];
-		copy->mbAlongDistance_orientation[i] = store->mbAlongDistance_orientation[i];
-		copy->mbAcrossDistance_type[i] = store->mbAcrossDistance_type[i];
-		copy->mbAcrossDistance_long_name[i] = store->mbAcrossDistance_long_name[i];
-		copy->mbAcrossDistance_name_code[i] = store->mbAcrossDistance_name_code[i];
-		copy->mbAcrossDistance_units[i] = store->mbAcrossDistance_units[i];
-		copy->mbAcrossDistance_unit_code[i] = store->mbAcrossDistance_unit_code[i];
-		copy->mbAcrossDistance_format_C[i] = store->mbAcrossDistance_format_C[i];
-		copy->mbAcrossDistance_orientation[i] = store->mbAcrossDistance_orientation[i];
-		copy->mbDepth_type[i] = store->mbDepth_type[i];
-		copy->mbDepth_long_name[i] = store->mbDepth_long_name[i];
-		copy->mbDepth_name_code[i] = store->mbDepth_name_code[i];
-		copy->mbDepth_units[i] = store->mbDepth_units[i];
-		copy->mbDepth_unit_code[i] = store->mbDepth_unit_code[i];
-		copy->mbDepth_format_C[i] = store->mbDepth_format_C[i];
-		copy->mbDepth_orientation[i] = store->mbDepth_orientation[i];
-		copy->mbSQuality_type[i] = store->mbSQuality_type[i];
-		copy->mbSQuality_long_name[i] = store->mbSQuality_long_name[i];
-		copy->mbSQuality_name_code[i] = store->mbSQuality_name_code[i];
-		copy->mbSQuality_units[i] = store->mbSQuality_units[i];
-		copy->mbSQuality_unit_code[i] = store->mbSQuality_unit_code[i];
-		copy->mbSQuality_format_C[i] = store->mbSQuality_format_C[i];
-		copy->mbSQuality_orientation[i] = store->mbSQuality_orientation[i];
-		copy->mbSFlag_type[i] = store->mbSFlag_type[i];
-		copy->mbSFlag_long_name[i] = store->mbSFlag_long_name[i];
-		copy->mbSFlag_name_code[i] = store->mbSFlag_name_code[i];
-		copy->mbSFlag_units[i] = store->mbSFlag_units[i];
-		copy->mbSFlag_unit_code[i] = store->mbSFlag_unit_code[i];
-		copy->mbSFlag_format_C[i] = store->mbSFlag_format_C[i];
-		copy->mbSFlag_orientation[i] = store->mbSFlag_orientation[i];
-		copy->mbAntenna_type[i] = store->mbAntenna_type[i];
-		copy->mbAntenna_long_name[i] = store->mbAntenna_long_name[i];
-		copy->mbAntenna_name_code[i] = store->mbAntenna_name_code[i];
-		copy->mbAntenna_units[i] = store->mbAntenna_units[i];
-		copy->mbAntenna_unit_code[i] = store->mbAntenna_unit_code[i];
-		copy->mbAntenna_format_C[i] = store->mbAntenna_format_C[i];
-		copy->mbAntenna_orientation[i] = store->mbAntenna_orientation[i];
-		copy->mbBeamBias_type[i] = store->mbBeamBias_type[i];
-		copy->mbBeamBias_long_name[i] = store->mbBeamBias_long_name[i];
-		copy->mbBeamBias_name_code[i] = store->mbBeamBias_name_code[i];
-		copy->mbBeamBias_units[i] = store->mbBeamBias_units[i];
-		copy->mbBeamBias_unit_code[i] = store->mbBeamBias_unit_code[i];
-		copy->mbBeamBias_format_C[i] = store->mbBeamBias_format_C[i];
-		copy->mbBeamBias_orientation[i] = store->mbBeamBias_orientation[i];
-		copy->mbBFlag_type[i] = store->mbBFlag_type[i];
-		copy->mbBFlag_long_name[i] = store->mbBFlag_long_name[i];
-		copy->mbBFlag_name_code[i] = store->mbBFlag_name_code[i];
-		copy->mbBFlag_units[i] = store->mbBFlag_units[i];
-		copy->mbBFlag_unit_code[i] = store->mbBFlag_unit_code[i];
-		copy->mbBFlag_format_C[i] = store->mbBFlag_format_C[i];
-		copy->mbBFlag_orientation[i] = store->mbBFlag_orientation[i];
-		copy->mbBeam_type[i] = store->mbBeam_type[i];
-		copy->mbBeam_long_name[i] = store->mbBeam_long_name[i];
-		copy->mbBeam_name_code[i] = store->mbBeam_name_code[i];
-		copy->mbBeam_units[i] = store->mbBeam_units[i];
-		copy->mbBeam_unit_code[i] = store->mbBeam_unit_code[i];
-		copy->mbBeam_format_C[i] = store->mbBeam_format_C[i];
-		copy->mbBeam_orientation[i] = store->mbBeam_orientation[i];
-		copy->mbAFlag_type[i] = store->mbAFlag_type[i];
-		copy->mbAFlag_long_name[i] = store->mbAFlag_long_name[i];
-		copy->mbAFlag_name_code[i] = store->mbAFlag_name_code[i];
-		copy->mbAFlag_units[i] = store->mbAFlag_units[i];
-		copy->mbAFlag_unit_code[i] = store->mbAFlag_unit_code[i];
-		copy->mbAFlag_format_C[i] = store->mbAFlag_format_C[i];
-		copy->mbAFlag_orientation[i] = store->mbAFlag_orientation[i];
-		copy->mbVelProfilRef_type[i] = store->mbVelProfilRef_type[i];
-		copy->mbVelProfilRef_long_name[i] = store->mbVelProfilRef_long_name[i];
-		copy->mbVelProfilRef_name_code[i] = store->mbVelProfilRef_name_code[i];
-		copy->mbVelProfilIdx_type[i] = store->mbVelProfilIdx_type[i];
-		copy->mbVelProfilIdx_long_name[i] = store->mbVelProfilIdx_long_name[i];
-		copy->mbVelProfilIdx_name_code[i] = store->mbVelProfilIdx_name_code[i];
-		copy->mbVelProfilIdx_units[i] = store->mbVelProfilIdx_units[i];
-		copy->mbVelProfilIdx_unit_code[i] = store->mbVelProfilIdx_unit_code[i];
-		copy->mbVelProfilIdx_format_C[i] = store->mbVelProfilIdx_format_C[i];
-		copy->mbVelProfilIdx_orientation[i] = store->mbVelProfilIdx_orientation[i];
-		copy->mbVelProfilDate_type[i] = store->mbVelProfilDate_type[i];
-		copy->mbVelProfilDate_long_name[i] = store->mbVelProfilDate_long_name[i];
-		copy->mbVelProfilDate_name_code[i] = store->mbVelProfilDate_name_code[i];
-		copy->mbVelProfilDate_units[i] = store->mbVelProfilDate_units[i];
-		copy->mbVelProfilDate_unit_code[i] = store->mbVelProfilDate_unit_code[i];
-		copy->mbVelProfilDate_format_C[i] = store->mbVelProfilDate_format_C[i];
-		copy->mbVelProfilDate_orientation[i] = store->mbVelProfilDate_orientation[i];
-		copy->mbVelProfilTime_type[i] = store->mbVelProfilTime_type[i];
-		copy->mbVelProfilTime_long_name[i] = store->mbVelProfilTime_long_name[i];
-		copy->mbVelProfilTime_name_code[i] = store->mbVelProfilTime_name_code[i];
-		copy->mbVelProfilTime_units[i] = store->mbVelProfilTime_units[i];
-		copy->mbVelProfilTime_unit_code[i] = store->mbVelProfilTime_unit_code[i];
-		copy->mbVelProfilTime_format_C[i] = store->mbVelProfilTime_format_C[i];
-		copy->mbVelProfilTime_orientation[i] = store->mbVelProfilTime_orientation[i];
-		}
-	    copy->mbHistDate_add_offset = store->mbHistDate_add_offset;
-	    copy->mbHistDate_scale_factor = store->mbHistDate_scale_factor;
-	    copy->mbHistDate_minimum = store->mbHistDate_minimum;
-	    copy->mbHistDate_maximum = store->mbHistDate_maximum;
-	    copy->mbHistDate_valid_minimum = store->mbHistDate_valid_minimum;
-	    copy->mbHistDate_valid_maximum = store->mbHistDate_valid_maximum;
-	    copy->mbHistDate_missing_value = store->mbHistDate_missing_value;
-	    copy->mbHistTime_add_offset = store->mbHistTime_add_offset;
-	    copy->mbHistTime_scale_factor = store->mbHistTime_scale_factor;
-	    copy->mbHistTime_minimum = store->mbHistTime_minimum;
-	    copy->mbHistTime_maximum = store->mbHistTime_maximum;
-	    copy->mbHistTime_valid_minimum = store->mbHistTime_valid_minimum;
-	    copy->mbHistTime_valid_maximum = store->mbHistTime_valid_maximum;
-	    copy->mbHistTime_missing_value = store->mbHistTime_missing_value;
-	    copy->mbHistCode_add_offset = store->mbHistCode_add_offset;
-	    copy->mbHistCode_scale_factor = store->mbHistCode_scale_factor;
-	    copy->mbHistCode_minimum = store->mbHistCode_minimum;
-	    copy->mbHistCode_maximum = store->mbHistCode_maximum;
-	    copy->mbHistCode_valid_minimum = store->mbHistCode_valid_minimum;
-	    copy->mbHistCode_valid_maximum = store->mbHistCode_valid_maximum;
-	    copy->mbHistCode_missing_value = store->mbHistCode_missing_value;
-	    copy->mbCycle_add_offset = store->mbCycle_add_offset;
-	    copy->mbCycle_scale_factor = store->mbCycle_scale_factor;
-	    copy->mbCycle_minimum = store->mbCycle_minimum;
-	    copy->mbCycle_maximum = store->mbCycle_maximum;
-	    copy->mbCycle_valid_minimum = store->mbCycle_valid_minimum;
-	    copy->mbCycle_valid_maximum = store->mbCycle_valid_maximum;
-	    copy->mbCycle_missing_value = store->mbCycle_missing_value;
-	    copy->mbDate_add_offset = store->mbDate_add_offset;
-	    copy->mbDate_scale_factor = store->mbDate_scale_factor;
-	    copy->mbDate_minimum = store->mbDate_minimum;
-	    copy->mbDate_maximum = store->mbDate_maximum;
-	    copy->mbDate_valid_minimum = store->mbDate_valid_minimum;
-	    copy->mbDate_valid_maximum = store->mbDate_valid_maximum;
-	    copy->mbDate_missing_value = store->mbDate_missing_value;
-	    copy->mbTime_add_offset = store->mbTime_add_offset;
-	    copy->mbTime_scale_factor = store->mbTime_scale_factor;
-	    copy->mbTime_minimum = store->mbTime_minimum;
-	    copy->mbTime_maximum = store->mbTime_maximum;
-	    copy->mbTime_valid_minimum = store->mbTime_valid_minimum;
-	    copy->mbTime_valid_maximum = store->mbTime_valid_maximum;
-	    copy->mbTime_missing_value = store->mbTime_missing_value;
-	    copy->mbOrdinate_add_offset = store->mbOrdinate_add_offset;
-	    copy->mbOrdinate_scale_factor = store->mbOrdinate_scale_factor;
-	    copy->mbOrdinate_minimum = store->mbOrdinate_minimum;
-	    copy->mbOrdinate_maximum = store->mbOrdinate_maximum;
-	    copy->mbOrdinate_valid_minimum = store->mbOrdinate_valid_minimum;
-	    copy->mbOrdinate_valid_maximum = store->mbOrdinate_valid_maximum;
-	    copy->mbOrdinate_missing_value = store->mbOrdinate_missing_value;
-	    copy->mbAbscissa_add_offset = store->mbAbscissa_add_offset;
-	    copy->mbAbscissa_scale_factor = store->mbAbscissa_scale_factor;
-	    copy->mbAbscissa_minimum = store->mbAbscissa_minimum;
-	    copy->mbAbscissa_maximum = store->mbAbscissa_maximum;
-	    copy->mbAbscissa_valid_minimum = store->mbAbscissa_valid_minimum;
-	    copy->mbAbscissa_valid_maximum = store->mbAbscissa_valid_maximum;
-	    copy->mbAbscissa_missing_value = store->mbAbscissa_missing_value;
-	    copy->mbFrequency_add_offset = store->mbFrequency_add_offset;
-	    copy->mbFrequency_scale_factor = store->mbFrequency_scale_factor;
-	    copy->mbFrequency_minimum = store->mbFrequency_minimum;
-	    copy->mbFrequency_maximum = store->mbFrequency_maximum;
-	    copy->mbFrequency_valid_minimum = store->mbFrequency_valid_minimum;
-	    copy->mbFrequency_valid_maximum = store->mbFrequency_valid_maximum;
-	    copy->mbFrequency_missing_value = store->mbFrequency_missing_value;
-	    copy->mbSounderMode_add_offset = store->mbSounderMode_add_offset;
-	    copy->mbSounderMode_scale_factor = store->mbSounderMode_scale_factor;
-	    copy->mbSounderMode_minimum = store->mbSounderMode_minimum;
-	    copy->mbSounderMode_maximum = store->mbSounderMode_maximum;
-	    copy->mbSounderMode_valid_minimum = store->mbSounderMode_valid_minimum;
-	    copy->mbSounderMode_valid_maximum = store->mbSounderMode_valid_maximum;
-	    copy->mbSounderMode_missing_value = store->mbSounderMode_missing_value;
-	    copy->mbReferenceDepth_add_offset = store->mbReferenceDepth_add_offset;
-	    copy->mbReferenceDepth_scale_factor = store->mbReferenceDepth_scale_factor;
-	    copy->mbReferenceDepth_minimum = store->mbReferenceDepth_minimum;
-	    copy->mbReferenceDepth_maximum = store->mbReferenceDepth_maximum;
-	    copy->mbReferenceDepth_valid_minimum = store->mbReferenceDepth_valid_minimum;
-	    copy->mbReferenceDepth_valid_maximum = store->mbReferenceDepth_valid_maximum;
-	    copy->mbReferenceDepth_missing_value = store->mbReferenceDepth_missing_value;
-	    copy->mbDynamicDraught_add_offset = store->mbDynamicDraught_add_offset;
-	    copy->mbDynamicDraught_scale_factor = store->mbDynamicDraught_scale_factor;
-	    copy->mbDynamicDraught_minimum = store->mbDynamicDraught_minimum;
-	    copy->mbDynamicDraught_maximum = store->mbDynamicDraught_maximum;
-	    copy->mbDynamicDraught_valid_minimum = store->mbDynamicDraught_valid_minimum;
-	    copy->mbDynamicDraught_valid_maximum = store->mbDynamicDraught_valid_maximum;
-	    copy->mbDynamicDraught_missing_value = store->mbDynamicDraught_missing_value;
-	    copy->mbTide_add_offset = store->mbTide_add_offset;
-	    copy->mbTide_scale_factor = store->mbTide_scale_factor;
-	    copy->mbTide_minimum = store->mbTide_minimum;
-	    copy->mbTide_maximum = store->mbTide_maximum;
-	    copy->mbTide_valid_minimum = store->mbTide_valid_minimum;
-	    copy->mbTide_valid_maximum = store->mbTide_valid_maximum;
-	    copy->mbTide_missing_value = store->mbTide_missing_value;
-	    copy->mbSoundVelocity_add_offset = store->mbSoundVelocity_add_offset;
-	    copy->mbSoundVelocity_scale_factor = store->mbSoundVelocity_scale_factor;
-	    copy->mbSoundVelocity_minimum = store->mbSoundVelocity_minimum;
-	    copy->mbSoundVelocity_maximum = store->mbSoundVelocity_maximum;
-	    copy->mbSoundVelocity_valid_minimum = store->mbSoundVelocity_valid_minimum;
-	    copy->mbSoundVelocity_valid_maximum = store->mbSoundVelocity_valid_maximum;
-	    copy->mbSoundVelocity_missing_value = store->mbSoundVelocity_missing_value;
-	    copy->mbHeading_add_offset = store->mbHeading_add_offset;
-	    copy->mbHeading_scale_factor = store->mbHeading_scale_factor;
-	    copy->mbHeading_minimum = store->mbHeading_minimum;
-	    copy->mbHeading_maximum = store->mbHeading_maximum;
-	    copy->mbHeading_valid_minimum = store->mbHeading_valid_minimum;
-	    copy->mbHeading_valid_maximum = store->mbHeading_valid_maximum;
-	    copy->mbHeading_missing_value = store->mbHeading_missing_value;
-	    copy->mbRoll_add_offset = store->mbRoll_add_offset;
-	    copy->mbRoll_scale_factor = store->mbRoll_scale_factor;
-	    copy->mbRoll_minimum = store->mbRoll_minimum;
-	    copy->mbRoll_maximum = store->mbRoll_maximum;
-	    copy->mbRoll_valid_minimum = store->mbRoll_valid_minimum;
-	    copy->mbRoll_valid_maximum = store->mbRoll_valid_maximum;
-	    copy->mbRoll_missing_value = store->mbRoll_missing_value;
-	    copy->mbPitch_add_offset = store->mbPitch_add_offset;
-	    copy->mbPitch_scale_factor = store->mbPitch_scale_factor;
-	    copy->mbPitch_minimum = store->mbPitch_minimum;
-	    copy->mbPitch_maximum = store->mbPitch_maximum;
-	    copy->mbPitch_valid_minimum = store->mbPitch_valid_minimum;
-	    copy->mbPitch_valid_maximum = store->mbPitch_valid_maximum;
-	    copy->mbPitch_missing_value = store->mbPitch_missing_value;
-	    copy->mbTransmissionHeave_add_offset = store->mbTransmissionHeave_add_offset;
-	    copy->mbTransmissionHeave_scale_factor = store->mbTransmissionHeave_scale_factor;
-	    copy->mbTransmissionHeave_minimum = store->mbTransmissionHeave_minimum;
-	    copy->mbTransmissionHeave_maximum = store->mbTransmissionHeave_maximum;
-	    copy->mbTransmissionHeave_valid_minimum = store->mbTransmissionHeave_valid_minimum;
-	    copy->mbTransmissionHeave_valid_maximum = store->mbTransmissionHeave_valid_maximum;
-	    copy->mbTransmissionHeave_missing_value = store->mbTransmissionHeave_missing_value;
-	    copy->mbDistanceScale_add_offset = store->mbDistanceScale_add_offset;
-	    copy->mbDistanceScale_scale_factor = store->mbDistanceScale_scale_factor;
-	    copy->mbDistanceScale_minimum = store->mbDistanceScale_minimum;
-	    copy->mbDistanceScale_maximum = store->mbDistanceScale_maximum;
-	    copy->mbDistanceScale_valid_minimum = store->mbDistanceScale_valid_minimum;
-	    copy->mbDistanceScale_valid_maximum = store->mbDistanceScale_valid_maximum;
-	    copy->mbDistanceScale_missing_value = store->mbDistanceScale_missing_value;
-	    copy->mbDepthScale_add_offset = store->mbDepthScale_add_offset;
-	    copy->mbDepthScale_scale_factor = store->mbDepthScale_scale_factor;
-	    copy->mbDepthScale_minimum = store->mbDepthScale_minimum;
-	    copy->mbDepthScale_maximum = store->mbDepthScale_maximum;
-	    copy->mbDepthScale_valid_minimum = store->mbDepthScale_valid_minimum;
-	    copy->mbDepthScale_valid_maximum = store->mbDepthScale_valid_maximum;
-	    copy->mbDepthScale_missing_value = store->mbDepthScale_missing_value;
-	    copy->mbVerticalDepth_add_offset = store->mbVerticalDepth_add_offset;
-	    copy->mbVerticalDepth_scale_factor = store->mbVerticalDepth_scale_factor;
-	    copy->mbVerticalDepth_minimum = store->mbVerticalDepth_minimum;
-	    copy->mbVerticalDepth_maximum = store->mbVerticalDepth_maximum;
-	    copy->mbVerticalDepth_valid_minimum = store->mbVerticalDepth_valid_minimum;
-	    copy->mbVerticalDepth_valid_maximum = store->mbVerticalDepth_valid_maximum;
-	    copy->mbVerticalDepth_missing_value = store->mbVerticalDepth_missing_value;
-	    copy->mbCQuality_add_offset = store->mbCQuality_add_offset;
-	    copy->mbCQuality_scale_factor = store->mbCQuality_scale_factor;
-	    copy->mbCQuality_minimum = store->mbCQuality_minimum;
-	    copy->mbCQuality_maximum = store->mbCQuality_maximum;
-	    copy->mbCQuality_valid_minimum = store->mbCQuality_valid_minimum;
-	    copy->mbCQuality_valid_maximum = store->mbCQuality_valid_maximum;
-	    copy->mbCQuality_missing_value = store->mbCQuality_missing_value;
-	    copy->mbCFlag_add_offset = store->mbCFlag_add_offset;
-	    copy->mbCFlag_scale_factor = store->mbCFlag_scale_factor;
-	    copy->mbCFlag_minimum = store->mbCFlag_minimum;
-	    copy->mbCFlag_maximum = store->mbCFlag_maximum;
-	    copy->mbCFlag_valid_minimum = store->mbCFlag_valid_minimum;
-	    copy->mbCFlag_valid_maximum = store->mbCFlag_valid_maximum;
-	    copy->mbCFlag_missing_value = store->mbCFlag_missing_value;
-	    copy->mbInterlacing_add_offset = store->mbInterlacing_add_offset;
-	    copy->mbInterlacing_scale_factor = store->mbInterlacing_scale_factor;
-	    copy->mbInterlacing_minimum = store->mbInterlacing_minimum;
-	    copy->mbInterlacing_maximum = store->mbInterlacing_maximum;
-	    copy->mbInterlacing_valid_minimum = store->mbInterlacing_valid_minimum;
-	    copy->mbInterlacing_valid_maximum = store->mbInterlacing_valid_maximum;
-	    copy->mbInterlacing_missing_value = store->mbInterlacing_missing_value;
-	    copy->mbSamplingRate_add_offset = store->mbSamplingRate_add_offset;
-	    copy->mbSamplingRate_scale_factor = store->mbSamplingRate_scale_factor;
-	    copy->mbSamplingRate_minimum = store->mbSamplingRate_minimum;
-	    copy->mbSamplingRate_maximum = store->mbSamplingRate_maximum;
-	    copy->mbSamplingRate_valid_minimum = store->mbSamplingRate_valid_minimum;
-	    copy->mbSamplingRate_valid_maximum = store->mbSamplingRate_valid_maximum;
-	    copy->mbSamplingRate_missing_value = store->mbSamplingRate_missing_value;
-	    copy->mbAlongDistance_add_offset = store->mbAlongDistance_add_offset;
-	    copy->mbAlongDistance_scale_factor = store->mbAlongDistance_scale_factor;
-	    copy->mbAlongDistance_minimum = store->mbAlongDistance_minimum;
-	    copy->mbAlongDistance_maximum = store->mbAlongDistance_maximum;
-	    copy->mbAlongDistance_valid_minimum = store->mbAlongDistance_valid_minimum;
-	    copy->mbAlongDistance_valid_maximum = store->mbAlongDistance_valid_maximum;
-	    copy->mbAlongDistance_missing_value = store->mbAlongDistance_missing_value;
-	    copy->mbAcrossDistance_add_offset = store->mbAcrossDistance_add_offset;
-	    copy->mbAcrossDistance_scale_factor = store->mbAcrossDistance_scale_factor;
-	    copy->mbAcrossDistance_minimum = store->mbAcrossDistance_minimum;
-	    copy->mbAcrossDistance_maximum = store->mbAcrossDistance_maximum;
-	    copy->mbAcrossDistance_valid_minimum = store->mbAcrossDistance_valid_minimum;
-	    copy->mbAcrossDistance_valid_maximum = store->mbAcrossDistance_valid_maximum;
-	    copy->mbAcrossDistance_missing_value = store->mbAcrossDistance_missing_value;
-	    copy->mbDepth_add_offset = store->mbDepth_add_offset;
-	    copy->mbDepth_scale_factor = store->mbDepth_scale_factor;
-	    copy->mbDepth_minimum = store->mbDepth_minimum;
-	    copy->mbDepth_maximum = store->mbDepth_maximum;
-	    copy->mbDepth_valid_minimum = store->mbDepth_valid_minimum;
-	    copy->mbDepth_valid_maximum = store->mbDepth_valid_maximum;
-	    copy->mbDepth_missing_value = store->mbDepth_missing_value;
-	    copy->mbSQuality_add_offset = store->mbSQuality_add_offset;
-	    copy->mbSQuality_scale_factor = store->mbSQuality_scale_factor;
-	    copy->mbSQuality_minimum = store->mbSQuality_minimum;
-	    copy->mbSQuality_maximum = store->mbSQuality_maximum;
-	    copy->mbSQuality_valid_minimum = store->mbSQuality_valid_minimum;
-	    copy->mbSQuality_valid_maximum = store->mbSQuality_valid_maximum;
-	    copy->mbSQuality_missing_value = store->mbSQuality_missing_value;
-	    copy->mbSFlag_add_offset = store->mbSFlag_add_offset;
-	    copy->mbSFlag_scale_factor = store->mbSFlag_scale_factor;
-	    copy->mbSFlag_minimum = store->mbSFlag_minimum;
-	    copy->mbSFlag_maximum = store->mbSFlag_maximum;
-	    copy->mbSFlag_valid_minimum = store->mbSFlag_valid_minimum;
-	    copy->mbSFlag_valid_maximum = store->mbSFlag_valid_maximum;
-	    copy->mbSFlag_missing_value = store->mbSFlag_missing_value;
-	    copy->mbAntenna_add_offset = store->mbAntenna_add_offset;
-	    copy->mbAntenna_scale_factor = store->mbAntenna_scale_factor;
-	    copy->mbAntenna_minimum = store->mbAntenna_minimum;
-	    copy->mbAntenna_maximum = store->mbAntenna_maximum;
-	    copy->mbAntenna_valid_minimum = store->mbAntenna_valid_minimum;
-	    copy->mbAntenna_valid_maximum = store->mbAntenna_valid_maximum;
-	    copy->mbAntenna_missing_value = store->mbAntenna_missing_value;
-	    copy->mbBeamBias_add_offset = store->mbBeamBias_add_offset;
-	    copy->mbBeamBias_scale_factor = store->mbBeamBias_scale_factor;
-	    copy->mbBeamBias_minimum = store->mbBeamBias_minimum;
-	    copy->mbBeamBias_maximum = store->mbBeamBias_maximum;
-	    copy->mbBeamBias_valid_minimum = store->mbBeamBias_valid_minimum;
-	    copy->mbBeamBias_valid_maximum = store->mbBeamBias_valid_maximum;
-	    copy->mbBeamBias_missing_value = store->mbBeamBias_missing_value;
-	    copy->mbBFlag_add_offset = store->mbBFlag_add_offset;
-	    copy->mbBFlag_scale_factor = store->mbBFlag_scale_factor;
-	    copy->mbBFlag_minimum = store->mbBFlag_minimum;
-	    copy->mbBFlag_maximum = store->mbBFlag_maximum;
-	    copy->mbBFlag_valid_minimum = store->mbBFlag_valid_minimum;
-	    copy->mbBFlag_valid_maximum = store->mbBFlag_valid_maximum;
-	    copy->mbBFlag_missing_value = store->mbBFlag_missing_value;
-	    copy->mbBeam_add_offset = store->mbBeam_add_offset;
-	    copy->mbBeam_scale_factor = store->mbBeam_scale_factor;
-	    copy->mbBeam_minimum = store->mbBeam_minimum;
-	    copy->mbBeam_maximum = store->mbBeam_maximum;
-	    copy->mbBeam_valid_minimum = store->mbBeam_valid_minimum;
-	    copy->mbBeam_valid_maximum = store->mbBeam_valid_maximum;
-	    copy->mbBeam_missing_value = store->mbBeam_missing_value;
-	    copy->mbAFlag_add_offset = store->mbAFlag_add_offset;
-	    copy->mbAFlag_scale_factor = store->mbAFlag_scale_factor;
-	    copy->mbAFlag_minimum = store->mbAFlag_minimum;
-	    copy->mbAFlag_maximum = store->mbAFlag_maximum;
-	    copy->mbAFlag_valid_minimum = store->mbAFlag_valid_minimum;
-	    copy->mbAFlag_valid_maximum = store->mbAFlag_valid_maximum;
-	    copy->mbAFlag_missing_value = store->mbAFlag_missing_value;
-	    copy->mbVelProfilIdx_add_offset = store->mbVelProfilIdx_add_offset;
-	    copy->mbVelProfilIdx_scale_factor = store->mbVelProfilIdx_scale_factor;
-	    copy->mbVelProfilIdx_minimum = store->mbVelProfilIdx_minimum;
-	    copy->mbVelProfilIdx_maximum = store->mbVelProfilIdx_maximum;
-	    copy->mbVelProfilIdx_valid_minimum = store->mbVelProfilIdx_valid_minimum;
-	    copy->mbVelProfilIdx_valid_maximum = store->mbVelProfilIdx_valid_maximum;
-	    copy->mbVelProfilIdx_missing_value = store->mbVelProfilIdx_missing_value;
-	    copy->mbVelProfilDate_add_offset = store->mbVelProfilDate_add_offset;
-	    copy->mbVelProfilDate_scale_factor = store->mbVelProfilDate_scale_factor;
-	    copy->mbVelProfilDate_minimum = store->mbVelProfilDate_minimum;
-	    copy->mbVelProfilDate_maximum = store->mbVelProfilDate_maximum;
-	    copy->mbVelProfilDate_valid_minimum = store->mbVelProfilDate_valid_minimum;
-	    copy->mbVelProfilDate_valid_maximum = store->mbVelProfilDate_valid_maximum;
-	    copy->mbVelProfilDate_missing_value = store->mbVelProfilDate_missing_value;
-	    copy->mbVelProfilTime_add_offset = store->mbVelProfilTime_add_offset;
-	    copy->mbVelProfilTime_scale_factor = store->mbVelProfilTime_scale_factor;
-	    copy->mbVelProfilTime_minimum = store->mbVelProfilTime_minimum;
-	    copy->mbVelProfilTime_maximum = store->mbVelProfilTime_maximum;
-	    copy->mbVelProfilTime_valid_minimum = store->mbVelProfilTime_valid_minimum;
-	    copy->mbVelProfilTime_valid_maximum = store->mbVelProfilTime_valid_maximum;
-	    copy->mbVelProfilTime_missing_value = store->mbVelProfilTime_missing_value;
-
-	    /* storage comment string */
-	    for (i=0;i<MBSYS_NETCDF_COMMENTLEN;i++)
-	        copy->comment[i] = store->comment[i];
-	    }
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mbsys_netcdf.h b/src/mbio/mbsys_netcdf.h
deleted file mode 100644
index cd1ff4f..0000000
--- a/src/mbio/mbsys_netcdf.h
+++ /dev/null
@@ -1,1108 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbsys_netcdf.h	4/8/2002
- *	$Id: mbsys_netcdf.h 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 2002-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbsys_netcdf.h defines the data structures used by MBIO functions
- * to store data from the IFREMER netCDF multibeam format.
- * The MBIO format id is:
- *      MBF_MBNETCDF : MBIO ID 75
- *
- *
- * Author:	D. W. Caress
- * Date:	April 8, 2002
- *
- * $Log: mbsys_netcdf.h,v $
- * Revision 5.6  2008/12/05 17:32:52  caress
- * Check-in mods 5 December 2008 including contributions from Gordon Keith.
- *
- * Revision 5.5  2008/05/16 22:56:24  caress
- * Release 5.1.1beta18.
- *
- * Revision 5.4  2008/03/01 09:14:03  caress
- * Some housekeeping changes.
- *
- * Revision 5.3  2005/11/05 00:48:04  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.2  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.1  2002/05/29 23:41:49  caress
- * Release 5.0.beta18
- *
- * Revision 5.0  2002/05/02 03:56:34  caress
- * Release 5.0.beta17
- *
- *
- */
-/*
- * Notes on the MBF_MBNETCDF data format:
- *   1.
- *   2.
- *
- */
-
-/* dimension lengths */
-#define MBSYS_NETCDF_COMMENTLEN	    256
-#define MBSYS_NETCDF_ATTRIBUTELEN   64
-#define MBSYS_NETCDF_NAMELEN	    20
-#define MBSYS_NETCDF_VELPROFNBR	    2
-
-/* sonar id numbers */
-#define MBSYS_NETCDF_SONAR_UNKNOWN	    0
-#define MBSYS_NETCDF_SONAR_SEABEAM	    10
-#define MBSYS_NETCDF_SONAR_ECHOSXD15	    20
-#define MBSYS_NETCDF_SONAR_ECHOSXD60	    21
-#define MBSYS_NETCDF_SONAR_HSDS		    30
-#define MBSYS_NETCDF_SONAR_LENNEMOR	    40
-#define MBSYS_NETCDF_SONAR_TMS5265B	    41
-#define MBSYS_NETCDF_SONAR_EM100	    50
-#define MBSYS_NETCDF_SONAR_EM1000	    51
-#define MBSYS_NETCDF_SONAR_EM12S	    52
-#define MBSYS_NETCDF_SONAR_EM12D	    53
-#define MBSYS_NETCDF_SONAR_EM3000S	    54
-#define MBSYS_NETCDF_SONAR_EM3000D	    55
-#define MBSYS_NETCDF_SONAR_EM300	    56
-#define MBSYS_NETCDF_SONAR_FURUNO	    70
-
-/* sonar beam numbers */
-#define MBSYS_NETCDF_SONAR_BEAMS_UNKNOWN    0
-#define MBSYS_NETCDF_SONAR_BEAMS_SEABEAM    19
-#define MBSYS_NETCDF_SONAR_BEAMS_ECHOSXD15  15
-#define MBSYS_NETCDF_SONAR_BEAMS_ECHOSXD60  60
-#define MBSYS_NETCDF_SONAR_BEAMS_HSDS	    59
-#define MBSYS_NETCDF_SONAR_BEAMS_LENNEMOR   20
-#define MBSYS_NETCDF_SONAR_BEAMS_TMS5265B   500
-#define MBSYS_NETCDF_SONAR_BEAMS_EM100	    32
-#define MBSYS_NETCDF_SONAR_BEAMS_EM1000	    60
-#define MBSYS_NETCDF_SONAR_BEAMS_EM12S	    81
-#define MBSYS_NETCDF_SONAR_BEAMS_EM12D	    162
-#define MBSYS_NETCDF_SONAR_BEAMS_EM3000S    127
-#define MBSYS_NETCDF_SONAR_BEAMS_EM3000D    254
-#define MBSYS_NETCDF_SONAR_BEAMS_EM300	    127
-#define MBSYS_NETCDF_SONAR_BEAMS_FURUNO	    45
-
-/* seconds in day */
-#define SECINDAY     86400.0
-
-/* internal data structure */
-struct mbsys_netcdf_struct
-	{
-	int	 kind;
-
-	/* global attributes */
-	short mbVersion;
-	char mbName[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbClasse[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbTimeReference[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbMeridian180[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbGeoDictionnary[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbGeoRepresentation[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbGeodesicSystem[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbEllipsoidName[MBSYS_NETCDF_COMMENTLEN];
-	char mbProjParameterCode[MBSYS_NETCDF_COMMENTLEN];
-	char mbShip[MBSYS_NETCDF_COMMENTLEN];
-	char mbSurvey[MBSYS_NETCDF_COMMENTLEN];
-	char mbReference[MBSYS_NETCDF_COMMENTLEN];
-	char mbNavRef[MBSYS_NETCDF_COMMENTLEN];
-	char mbTideRef[MBSYS_NETCDF_COMMENTLEN];
-	short mbLevel;
-	short mbNbrHistoryRec;
-	int mbStartDate;
-	int mbStartTime;
-	int mbEndDate;
-	int mbEndTime;
-	double mbNorthLatitude;
-	double mbSouthLatitude;
-	double mbEastLongitude;
-	double mbWestLongitude;
-	double mbEllipsoidA;
-	double mbEllipsoidInvF;
-	double mbEllipsoidE2;
-	short mbProjType;
-	double mbProjParameterValue[10];
-	short mbSounder;
-	double mbAntennaOffset[3];
-	double mbAntennaDelay;
-	double mbSounderOffset[3];
-	double mbSounderDelay;
-	double mbVRUOffset[3];
-	double mbVRUDelay;
-	double mbHeadingBias;
-	double mbRollBias;
-	double mbPitchBias;
-	double mbHeaveBias;
-	double mbDraught;
-	short mbNavType;
-	short mbTideType;
-	double mbMinDepth;
-	double mbMaxDepth;
-	int mbCycleCounter;
-
-	/* dimensions */
-	size_t CIB_BLOCK_DIM; /* not in extended format */
-	size_t mbHistoryRecNbr;
-	size_t mbNameLength;
-	size_t mbCommentLength;
-	size_t mbAntennaNbr;
-	size_t mbBeamNbr;
-	size_t mbCycleNbr;
-	size_t mbVelocityProfilNbr;
-
-	/* variable ids */
-	int mbHistDate_id;
-	int mbHistTime_id;
-	int mbHistCode_id;
-	int mbHistAutor_id;
-	int mbHistModule_id;
-	int mbHistComment_id;
-	int mbCycle_id;
-	int mbDate_id;
-	int mbTime_id;
-	int mbOrdinate_id;
-	int mbAbscissa_id;
-	int mbFrequency_id;
-	int mbSonarFrequency_id;
-	int mbSounderMode_id;
-	int mbReferenceDepth_id;
-	int mbDynamicDraught_id;
-	int mbTide_id;
-	int mbSoundVelocity_id;
-	int mbHeading_id;
-	int mbRoll_id;
-	int mbPitch_id;
-	int mbTransmissionHeave_id;
-	int mbDistanceScale_id;
-	int mbRangeScale_id;
-	int mbDepthScale_id;
-	int mbVerticalDepth_id;
-	int mbCQuality_id;
-	int mbCFlag_id;
-	int mbInterlacing_id;
-	int mbSamplingRate_id;
-	int mbCompensationLayerMode_id;
-	int mbTransmitBeamwidth_id;
-	int mbReceiveBeamwidth_id;
-	int mbTransmitPulseLength_id;
-	int mbAlongDistance_id;
-	int mbAcrossDistance_id;
-	int mbDepth_id;
-	int mbAcrossBeamAngle_id;
-	int mbAzimutBeamAngle_id;
-	int mbRange_id;
-	int mbSoundingBias_id;
-	int mbSQuality_id;
-	int mbReflectivity_id;
-	int mbReceptionHeave_id;
-	int mbAlongSlope_id;
-	int mbAcrossSlope_id;
-	int mbSFlag_id;
-	int mbSLengthOfDetection_id;
-	int mbAntenna_id;
-	int mbBeamBias_id;
-	int mbBFlag_id;
-	int mbBeam_id;
-	int mbAFlag_id;
-	int mbVelProfilRef_id;
-	int mbVelProfilIdx_id;
-	int mbVelProfilDate_id;
-	int mbVelProfilTime_id;
-
-	/* variable pointers */
-        int *mbHistDate;
-        int *mbHistTime;
-        char *mbHistCode;
-        char *mbHistAutor;
-        char *mbHistModule;
-        char *mbHistComment;
-
-        int *mbCycle;
-        int *mbDate;
-        int *mbTime;
-        int *mbOrdinate;
-        int *mbAbscissa;
-        char *mbFrequency;
-        int *mbSonarFrequency;	/* extended mode */
-        char *mbSounderMode;
-        int *mbReferenceDepth;
-        short *mbDynamicDraught;
-        short *mbTide;
-        short *mbSoundVelocity;
-        unsigned short *mbHeading;
-        short *mbRoll;
-        short *mbPitch;
-        short *mbTransmissionHeave;
-        char *mbDistanceScale;
-        short *mbRangeScale;	/* extended mode */
-        char *mbDepthScale;
-        int *mbVerticalDepth;
-        char *mbCQuality;
-        char *mbCFlag;
-        char *mbInterlacing;
-        short *mbSamplingRate;
-        char *mbCompensationLayerMode;	/* extended mode */
-        short *mbTransmitBeamwidth;	/* extended mode */
-        char *mbReceiveBeamwidth;	/* extended mode */
-        short *mbTransmitPulseLength;	/* extended mode */
-
-        short *mbAlongDistance;
-        short *mbAcrossDistance;
-        int *mbDepth;
-        short *mbAcrossBeamAngle;	/* extended mode */
-        short *mbAzimutBeamAngle;	/* extended mode */
-        short *mbRange;		/* extended mode */
-        short *mbSoundingBias;	/* extended mode */
-        char *mbSQuality;
-        char *mbReflectivity ;	/* extended mode */
-        char *mbReceptionHeave;	/* extended mode */
-        short *mbAlongSlope;	/* extended mode */
-        short *mbAcrossSlope;	/* extended mode */
-        char *mbSFlag;
-        char *mbSLengthOfDetection;	/* extended mode */
-
-        char *mbAntenna;
-        short *mbBeamBias;	/* not in extended mode */
-        char *mbBFlag;
-
-        short *mbBeam;
-        char *mbAFlag;
-
-        char *mbVelProfilRef;
-        short *mbVelProfilIdx;
-        int *mbVelProfilDate;
-        int *mbVelProfilTime;
-
-	/* variable attributes */
-	char mbHistDate_type[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbHistDate_long_name[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbHistDate_name_code[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbHistDate_units[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbHistDate_unit_code[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbHistDate_format_C[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbHistDate_orientation[MBSYS_NETCDF_ATTRIBUTELEN];
-	int mbHistDate_add_offset;
-	int mbHistDate_scale_factor;
-	int mbHistDate_minimum;
-	int mbHistDate_maximum;
-	int mbHistDate_valid_minimum;
-	int mbHistDate_valid_maximum;
-	int mbHistDate_missing_value;
-	char mbHistTime_type[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbHistTime_long_name[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbHistTime_name_code[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbHistTime_units[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbHistTime_unit_code[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbHistTime_format_C[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbHistTime_orientation[MBSYS_NETCDF_ATTRIBUTELEN];
-	int mbHistTime_add_offset;
-	int mbHistTime_scale_factor;
-	int mbHistTime_minimum;
-	int mbHistTime_maximum;
-	int mbHistTime_valid_minimum;
-	int mbHistTime_valid_maximum;
-	int mbHistTime_missing_value;
-	char mbHistCode_type[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbHistCode_long_name[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbHistCode_name_code[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbHistCode_units[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbHistCode_unit_code[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbHistCode_format_C[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbHistCode_orientation[MBSYS_NETCDF_ATTRIBUTELEN];
-	int mbHistCode_add_offset;
-	int mbHistCode_scale_factor;
-	int mbHistCode_minimum;
-	int mbHistCode_maximum;
-	int mbHistCode_valid_minimum;
-	int mbHistCode_valid_maximum;
-	int mbHistCode_missing_value;
-	char mbHistAutor_type[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbHistAutor_long_name[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbHistAutor_name_code[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbHistModule_type[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbHistModule_long_name[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbHistModule_name_code[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbHistComment_type[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbHistComment_long_name[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbHistComment_name_code[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbCycle_type[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbCycle_long_name[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbCycle_name_code[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbCycle_units[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbCycle_unit_code[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbCycle_format_C[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbCycle_orientation[MBSYS_NETCDF_ATTRIBUTELEN];
-	int mbCycle_add_offset;
-	int mbCycle_scale_factor;
-	int mbCycle_minimum;
-	int mbCycle_maximum;
-	int mbCycle_valid_minimum;
-	int mbCycle_valid_maximum;
-	int mbCycle_missing_value;
-	char mbDate_type[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbDate_long_name[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbDate_name_code[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbDate_units[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbDate_unit_code[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbDate_format_C[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbDate_orientation[MBSYS_NETCDF_ATTRIBUTELEN];
-	int mbDate_add_offset;
-	int mbDate_scale_factor;
-	int mbDate_minimum;
-	int mbDate_maximum;
-	int mbDate_valid_minimum;
-	int mbDate_valid_maximum;
-	int mbDate_missing_value;
-	char mbTime_type[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbTime_long_name[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbTime_name_code[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbTime_units[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbTime_unit_code[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbTime_format_C[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbTime_orientation[MBSYS_NETCDF_ATTRIBUTELEN];
-	int mbTime_add_offset;
-	int mbTime_scale_factor;
-	int mbTime_minimum;
-	int mbTime_maximum;
-	int mbTime_valid_minimum;
-	int mbTime_valid_maximum;
-	int mbTime_missing_value;
-	char mbOrdinate_type[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbOrdinate_long_name[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbOrdinate_name_code[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbOrdinate_units[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbOrdinate_unit_code[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbOrdinate_format_C[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbOrdinate_orientation[MBSYS_NETCDF_ATTRIBUTELEN];
-	double mbOrdinate_add_offset;
-	double mbOrdinate_scale_factor;
-	double mbOrdinate_minimum;
-	double mbOrdinate_maximum;
-	int mbOrdinate_valid_minimum;
-	int mbOrdinate_valid_maximum;
-	int mbOrdinate_missing_value;
-	char mbAbscissa_type[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbAbscissa_long_name[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbAbscissa_name_code[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbAbscissa_units[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbAbscissa_unit_code[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbAbscissa_format_C[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbAbscissa_orientation[MBSYS_NETCDF_ATTRIBUTELEN];
-	double mbAbscissa_add_offset;
-	double mbAbscissa_scale_factor;
-	double mbAbscissa_minimum;
-	double mbAbscissa_maximum;
-	int mbAbscissa_valid_minimum;
-	int mbAbscissa_valid_maximum;
-	int mbAbscissa_missing_value;
-	char mbFrequency_type[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbFrequency_long_name[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbFrequency_name_code[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbFrequency_units[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbFrequency_unit_code[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbFrequency_format_C[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbFrequency_orientation[MBSYS_NETCDF_ATTRIBUTELEN];
-	int mbFrequency_add_offset;
-	int mbFrequency_scale_factor;
-	int mbFrequency_minimum;
-	int mbFrequency_maximum;
-	int mbFrequency_valid_minimum;
-	int mbFrequency_valid_maximum;
-	int mbFrequency_missing_value;
-	char mbSonarFrequency_type[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbSonarFrequency_long_name[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbSonarFrequency_name_code[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbSonarFrequency_units[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbSonarFrequency_unit_code[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbSonarFrequency_format_C[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbSonarFrequency_orientation[MBSYS_NETCDF_ATTRIBUTELEN];
-	double mbSonarFrequency_add_offset;
-	double mbSonarFrequency_scale_factor;
-	double mbSonarFrequency_minimum;
-	double mbSonarFrequency_maximum;
-	int mbSonarFrequency_valid_minimum;
-	int mbSonarFrequency_valid_maximum;
-	int mbSonarFrequency_missing_value;
-	char mbSounderMode_type[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbSounderMode_long_name[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbSounderMode_name_code[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbSounderMode_units[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbSounderMode_unit_code[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbSounderMode_format_C[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbSounderMode_orientation[MBSYS_NETCDF_ATTRIBUTELEN];
-	int mbSounderMode_add_offset;
-	int mbSounderMode_scale_factor;
-	int mbSounderMode_minimum;
-	int mbSounderMode_maximum;
-	int mbSounderMode_valid_minimum;
-	int mbSounderMode_valid_maximum;
-	int mbSounderMode_missing_value;
-	char mbReferenceDepth_type[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbReferenceDepth_long_name[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbReferenceDepth_name_code[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbReferenceDepth_units[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbReferenceDepth_unit_code[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbReferenceDepth_format_C[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbReferenceDepth_orientation[MBSYS_NETCDF_ATTRIBUTELEN];
-	double mbReferenceDepth_add_offset;
-	double mbReferenceDepth_scale_factor;
-	double mbReferenceDepth_minimum;
-	double mbReferenceDepth_maximum;
-	int mbReferenceDepth_valid_minimum;
-	int mbReferenceDepth_valid_maximum;
-	int mbReferenceDepth_missing_value;
-	char mbDynamicDraught_type[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbDynamicDraught_long_name[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbDynamicDraught_name_code[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbDynamicDraught_units[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbDynamicDraught_unit_code[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbDynamicDraught_format_C[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbDynamicDraught_orientation[MBSYS_NETCDF_ATTRIBUTELEN];
-	double mbDynamicDraught_add_offset;
-	double mbDynamicDraught_scale_factor;
-	double mbDynamicDraught_minimum;
-	double mbDynamicDraught_maximum;
-	int mbDynamicDraught_valid_minimum;
-	int mbDynamicDraught_valid_maximum;
-	int mbDynamicDraught_missing_value;
-	char mbTide_type[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbTide_long_name[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbTide_name_code[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbTide_units[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbTide_unit_code[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbTide_format_C[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbTide_orientation[MBSYS_NETCDF_ATTRIBUTELEN];
-	double mbTide_add_offset;
-	double mbTide_scale_factor;
-	double mbTide_minimum;
-	double mbTide_maximum;
-	int mbTide_valid_minimum;
-	int mbTide_valid_maximum;
-	int mbTide_missing_value;
-	char mbSoundVelocity_type[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbSoundVelocity_long_name[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbSoundVelocity_name_code[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbSoundVelocity_units[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbSoundVelocity_unit_code[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbSoundVelocity_format_C[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbSoundVelocity_orientation[MBSYS_NETCDF_ATTRIBUTELEN];
-	double mbSoundVelocity_add_offset;
-	double mbSoundVelocity_scale_factor;
-	double mbSoundVelocity_minimum;
-	double mbSoundVelocity_maximum;
-	int mbSoundVelocity_valid_minimum;
-	int mbSoundVelocity_valid_maximum;
-	int mbSoundVelocity_missing_value;
-	char mbHeading_type[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbHeading_long_name[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbHeading_name_code[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbHeading_units[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbHeading_unit_code[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbHeading_format_C[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbHeading_orientation[MBSYS_NETCDF_ATTRIBUTELEN];
-	double mbHeading_add_offset;
-	double mbHeading_scale_factor;
-	double mbHeading_minimum;
-	double mbHeading_maximum;
-	int mbHeading_valid_minimum;
-	int mbHeading_valid_maximum;
-	int mbHeading_missing_value;
-	char mbRoll_type[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbRoll_long_name[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbRoll_name_code[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbRoll_units[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbRoll_unit_code[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbRoll_format_C[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbRoll_orientation[MBSYS_NETCDF_ATTRIBUTELEN];
-	double mbRoll_add_offset;
-	double mbRoll_scale_factor;
-	double mbRoll_minimum;
-	double mbRoll_maximum;
-	int mbRoll_valid_minimum;
-	int mbRoll_valid_maximum;
-	int mbRoll_missing_value;
-	char mbPitch_type[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbPitch_long_name[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbPitch_name_code[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbPitch_units[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbPitch_unit_code[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbPitch_format_C[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbPitch_orientation[MBSYS_NETCDF_ATTRIBUTELEN];
-	double mbPitch_add_offset;
-	double mbPitch_scale_factor;
-	double mbPitch_minimum;
-	double mbPitch_maximum;
-	int mbPitch_valid_minimum;
-	int mbPitch_valid_maximum;
-	int mbPitch_missing_value;
-	char mbTransmissionHeave_type[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbTransmissionHeave_long_name[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbTransmissionHeave_name_code[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbTransmissionHeave_units[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbTransmissionHeave_unit_code[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbTransmissionHeave_format_C[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbTransmissionHeave_orientation[MBSYS_NETCDF_ATTRIBUTELEN];
-	double mbTransmissionHeave_add_offset;
-	double mbTransmissionHeave_scale_factor;
-	double mbTransmissionHeave_minimum;
-	double mbTransmissionHeave_maximum;
-	int mbTransmissionHeave_valid_minimum;
-	int mbTransmissionHeave_valid_maximum;
-	int mbTransmissionHeave_missing_value;
-	char mbDistanceScale_type[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbDistanceScale_long_name[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbDistanceScale_name_code[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbDistanceScale_units[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbDistanceScale_unit_code[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbDistanceScale_format_C[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbDistanceScale_orientation[MBSYS_NETCDF_ATTRIBUTELEN];
-	double mbDistanceScale_add_offset;
-	double mbDistanceScale_scale_factor;
-	double mbDistanceScale_minimum;
-	double mbDistanceScale_maximum;
-	int mbDistanceScale_valid_minimum;
-	int mbDistanceScale_valid_maximum;
-	int mbDistanceScale_missing_value;
-	char mbRangeScale_type[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbRangeScale_long_name[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbRangeScale_name_code[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbRangeScale_units[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbRangeScale_unit_code[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbRangeScale_format_C[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbRangeScale_orientation[MBSYS_NETCDF_ATTRIBUTELEN];
-	double mbRangeScale_add_offset;
-	double mbRangeScale_scale_factor;
-	double mbRangeScale_minimum;
-	double mbRangeScale_maximum;
-	int mbRangeScale_valid_minimum;
-	int mbRangeScale_valid_maximum;
-	int mbRangeScale_missing_value;
-	char mbDepthScale_type[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbDepthScale_long_name[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbDepthScale_name_code[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbDepthScale_units[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbDepthScale_unit_code[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbDepthScale_format_C[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbDepthScale_orientation[MBSYS_NETCDF_ATTRIBUTELEN];
-	double mbDepthScale_add_offset;
-	double mbDepthScale_scale_factor;
-	double mbDepthScale_minimum;
-	double mbDepthScale_maximum;
-	int mbDepthScale_valid_minimum;
-	int mbDepthScale_valid_maximum;
-	int mbDepthScale_missing_value;
-	char mbVerticalDepth_type[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbVerticalDepth_long_name[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbVerticalDepth_name_code[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbVerticalDepth_units[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbVerticalDepth_unit_code[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbVerticalDepth_format_C[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbVerticalDepth_orientation[MBSYS_NETCDF_ATTRIBUTELEN];
-	int mbVerticalDepth_add_offset;
-	int mbVerticalDepth_scale_factor;
-	int mbVerticalDepth_minimum;
-	int mbVerticalDepth_maximum;
-	int mbVerticalDepth_valid_minimum;
-	int mbVerticalDepth_valid_maximum;
-	int mbVerticalDepth_missing_value;
-	char mbCQuality_type[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbCQuality_long_name[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbCQuality_name_code[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbCQuality_units[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbCQuality_unit_code[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbCQuality_format_C[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbCQuality_orientation[MBSYS_NETCDF_ATTRIBUTELEN];
-	int mbCQuality_add_offset;
-	int mbCQuality_scale_factor;
-	int mbCQuality_minimum;
-	int mbCQuality_maximum;
-	int mbCQuality_valid_minimum;
-	int mbCQuality_valid_maximum;
-	int mbCQuality_missing_value;
-	char mbCFlag_type[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbCFlag_long_name[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbCFlag_name_code[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbCFlag_units[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbCFlag_unit_code[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbCFlag_format_C[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbCFlag_orientation[MBSYS_NETCDF_ATTRIBUTELEN];
-	int mbCFlag_add_offset;
-	int mbCFlag_scale_factor;
-	int mbCFlag_minimum;
-	int mbCFlag_maximum;
-	int mbCFlag_valid_minimum;
-	int mbCFlag_valid_maximum;
-	int mbCFlag_missing_value;
-	char mbInterlacing_type[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbInterlacing_long_name[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbInterlacing_name_code[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbInterlacing_units[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbInterlacing_unit_code[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbInterlacing_format_C[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbInterlacing_orientation[MBSYS_NETCDF_ATTRIBUTELEN];
-	int mbInterlacing_add_offset;
-	int mbInterlacing_scale_factor;
-	int mbInterlacing_minimum;
-	int mbInterlacing_maximum;
-	int mbInterlacing_valid_minimum;
-	int mbInterlacing_valid_maximum;
-	int mbInterlacing_missing_value;
-	char mbSamplingRate_type[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbSamplingRate_long_name[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbSamplingRate_name_code[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbSamplingRate_units[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbSamplingRate_unit_code[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbSamplingRate_format_C[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbSamplingRate_orientation[MBSYS_NETCDF_ATTRIBUTELEN];
-	int mbSamplingRate_add_offset;
-	int mbSamplingRate_scale_factor;
-	int mbSamplingRate_minimum;
-	int mbSamplingRate_maximum;
-	int mbSamplingRate_valid_minimum;
-	int mbSamplingRate_valid_maximum;
-	int mbSamplingRate_missing_value;
-	char mbCompensationLayerMode_type[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbCompensationLayerMode_long_name[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbCompensationLayerMode_name_code[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbCompensationLayerMode_units[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbCompensationLayerMode_unit_code[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbCompensationLayerMode_format_C[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbCompensationLayerMode_orientation[MBSYS_NETCDF_ATTRIBUTELEN];
-	int mbCompensationLayerMode_add_offset;
-	int mbCompensationLayerMode_scale_factor;
-	int mbCompensationLayerMode_minimum;
-	int mbCompensationLayerMode_maximum;
-	int mbCompensationLayerMode_valid_minimum;
-	int mbCompensationLayerMode_valid_maximum;
-	int mbCompensationLayerMode_missing_value;
-	char mbTransmitBeamwidth_type[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbTransmitBeamwidth_long_name[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbTransmitBeamwidth_name_code[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbTransmitBeamwidth_units[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbTransmitBeamwidth_unit_code[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbTransmitBeamwidth_format_C[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbTransmitBeamwidth_orientation[MBSYS_NETCDF_ATTRIBUTELEN];
-	int mbTransmitBeamwidth_add_offset;
-	int mbTransmitBeamwidth_scale_factor;
-	int mbTransmitBeamwidth_minimum;
-	int mbTransmitBeamwidth_maximum;
-	int mbTransmitBeamwidth_valid_minimum;
-	int mbTransmitBeamwidth_valid_maximum;
-	int mbTransmitBeamwidth_missing_value;
-	char mbReceiveBeamwidth_type[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbReceiveBeamwidth_long_name[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbReceiveBeamwidth_name_code[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbReceiveBeamwidth_units[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbReceiveBeamwidth_unit_code[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbReceiveBeamwidth_format_C[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbReceiveBeamwidth_orientation[MBSYS_NETCDF_ATTRIBUTELEN];
-	int mbReceiveBeamwidth_add_offset;
-	int mbReceiveBeamwidth_scale_factor;
-	int mbReceiveBeamwidth_minimum;
-	int mbReceiveBeamwidth_maximum;
-	int mbReceiveBeamwidth_valid_minimum;
-	int mbReceiveBeamwidth_valid_maximum;
-	int mbReceiveBeamwidth_missing_value;
-	char mbTransmitPulseLength_type[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbTransmitPulseLength_long_name[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbTransmitPulseLength_name_code[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbTransmitPulseLength_units[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbTransmitPulseLength_unit_code[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbTransmitPulseLength_format_C[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbTransmitPulseLength_orientation[MBSYS_NETCDF_ATTRIBUTELEN];
-	int mbTransmitPulseLength_add_offset;
-	int mbTransmitPulseLength_scale_factor;
-	int mbTransmitPulseLength_minimum;
-	int mbTransmitPulseLength_maximum;
-	int mbTransmitPulseLength_valid_minimum;
-	int mbTransmitPulseLength_valid_maximum;
-	int mbTransmitPulseLength_missing_value;
-	char mbAlongDistance_type[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbAlongDistance_long_name[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbAlongDistance_name_code[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbAlongDistance_units[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbAlongDistance_unit_code[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbAlongDistance_format_C[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbAlongDistance_orientation[MBSYS_NETCDF_ATTRIBUTELEN];
-	int mbAlongDistance_add_offset;
-	int mbAlongDistance_scale_factor;
-	int mbAlongDistance_minimum;
-	int mbAlongDistance_maximum;
-	int mbAlongDistance_valid_minimum;
-	int mbAlongDistance_valid_maximum;
-	int mbAlongDistance_missing_value;
-	char mbAcrossDistance_type[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbAcrossDistance_long_name[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbAcrossDistance_name_code[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbAcrossDistance_units[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbAcrossDistance_unit_code[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbAcrossDistance_format_C[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbAcrossDistance_orientation[MBSYS_NETCDF_ATTRIBUTELEN];
-	int mbAcrossDistance_add_offset;
-	int mbAcrossDistance_scale_factor;
-	int mbAcrossDistance_minimum;
-	int mbAcrossDistance_maximum;
-	int mbAcrossDistance_valid_minimum;
-	int mbAcrossDistance_valid_maximum;
-	int mbAcrossDistance_missing_value;
-	char mbDepth_type[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbDepth_long_name[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbDepth_name_code[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbDepth_units[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbDepth_unit_code[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbDepth_format_C[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbDepth_orientation[MBSYS_NETCDF_ATTRIBUTELEN];
-	int mbDepth_add_offset;
-	int mbDepth_scale_factor;
-	int mbDepth_minimum;
-	int mbDepth_maximum;
-	int mbDepth_valid_minimum;
-	int mbDepth_valid_maximum;
-	int mbDepth_missing_value;
-	char mbAcrossBeamAngle_type[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbAcrossBeamAngle_long_name[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbAcrossBeamAngle_name_code[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbAcrossBeamAngle_units[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbAcrossBeamAngle_unit_code[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbAcrossBeamAngle_format_C[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbAcrossBeamAngle_orientation[MBSYS_NETCDF_ATTRIBUTELEN];
-	double mbAcrossBeamAngle_add_offset;
-	double mbAcrossBeamAngle_scale_factor;
-	double mbAcrossBeamAngle_minimum;
-	double mbAcrossBeamAngle_maximum;
-	int mbAcrossBeamAngle_valid_minimum;
-	int mbAcrossBeamAngle_valid_maximum;
-	int mbAcrossBeamAngle_missing_value;
-	char mbAzimutBeamAngle_type[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbAzimutBeamAngle_long_name[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbAzimutBeamAngle_name_code[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbAzimutBeamAngle_units[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbAzimutBeamAngle_unit_code[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbAzimutBeamAngle_format_C[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbAzimutBeamAngle_orientation[MBSYS_NETCDF_ATTRIBUTELEN];
-	double mbAzimutBeamAngle_add_offset;
-	double mbAzimutBeamAngle_scale_factor;
-	double mbAzimutBeamAngle_minimum;
-	double mbAzimutBeamAngle_maximum;
-	int mbAzimutBeamAngle_valid_minimum;
-	int mbAzimutBeamAngle_valid_maximum;
-	int mbAzimutBeamAngle_missing_value;
-	char mbRange_type[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbRange_long_name[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbRange_name_code[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbRange_units[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbRange_unit_code[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbRange_format_C[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbRange_orientation[MBSYS_NETCDF_ATTRIBUTELEN];
-	int mbRange_add_offset;
-	int mbRange_scale_factor;
-	int mbRange_minimum;
-	int mbRange_maximum;
-	int mbRange_valid_minimum;
-	int mbRange_valid_maximum;
-	int mbRange_missing_value;
-	char mbSoundingBias_type[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbSoundingBias_long_name[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbSoundingBias_name_code[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbSoundingBias_units[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbSoundingBias_unit_code[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbSoundingBias_format_C[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbSoundingBias_orientation[MBSYS_NETCDF_ATTRIBUTELEN];
-	double mbSoundingBias_add_offset;
-	double mbSoundingBias_scale_factor;
-	double mbSoundingBias_minimum;
-	double mbSoundingBias_maximum;
-	int mbSoundingBias_valid_minimum;
-	int mbSoundingBias_valid_maximum;
-	int mbSoundingBias_missing_value;
-	char mbSQuality_type[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbSQuality_long_name[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbSQuality_name_code[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbSQuality_units[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbSQuality_unit_code[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbSQuality_format_C[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbSQuality_orientation[MBSYS_NETCDF_ATTRIBUTELEN];
-	int mbSQuality_add_offset;
-	int mbSQuality_scale_factor;
-	int mbSQuality_minimum;
-	int mbSQuality_maximum;
-	int mbSQuality_valid_minimum;
-	int mbSQuality_valid_maximum;
-	int mbSQuality_missing_value;
-	char mbReflectivity_type[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbReflectivity_long_name[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbReflectivity_name_code[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbReflectivity_units[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbReflectivity_unit_code[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbReflectivity_format_C[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbReflectivity_orientation[MBSYS_NETCDF_ATTRIBUTELEN];
-	double mbReflectivity_add_offset;
-	double mbReflectivity_scale_factor;
-	double mbReflectivity_minimum;
-	double mbReflectivity_maximum;
-	int mbReflectivity_valid_minimum;
-	int mbReflectivity_valid_maximum;
-	int mbReflectivity_missing_value;
-	char mbReceptionHeave_type[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbReceptionHeave_long_name[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbReceptionHeave_name_code[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbReceptionHeave_units[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbReceptionHeave_unit_code[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbReceptionHeave_format_C[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbReceptionHeave_orientation[MBSYS_NETCDF_ATTRIBUTELEN];
-	double mbReceptionHeave_add_offset;
-	double mbReceptionHeave_scale_factor;
-	double mbReceptionHeave_minimum;
-	double mbReceptionHeave_maximum;
-	int mbReceptionHeave_valid_minimum;
-	int mbReceptionHeave_valid_maximum;
-	int mbReceptionHeave_missing_value;
-	char mbAlongSlope_type[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbAlongSlope_long_name[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbAlongSlope_name_code[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbAlongSlope_units[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbAlongSlope_unit_code[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbAlongSlope_format_C[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbAlongSlope_orientation[MBSYS_NETCDF_ATTRIBUTELEN];
-	double mbAlongSlope_add_offset;
-	double mbAlongSlope_scale_factor;
-	double mbAlongSlope_minimum;
-	double mbAlongSlope_maximum;
-	int mbAlongSlope_valid_minimum;
-	int mbAlongSlope_valid_maximum;
-	int mbAlongSlope_missing_value;
-	char mbAcrossSlope_type[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbAcrossSlope_long_name[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbAcrossSlope_name_code[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbAcrossSlope_units[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbAcrossSlope_unit_code[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbAcrossSlope_format_C[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbAcrossSlope_orientation[MBSYS_NETCDF_ATTRIBUTELEN];
-	double mbAcrossSlope_add_offset;
-	double mbAcrossSlope_scale_factor;
-	double mbAcrossSlope_minimum;
-	double mbAcrossSlope_maximum;
-	int mbAcrossSlope_valid_minimum;
-	int mbAcrossSlope_valid_maximum;
-	int mbAcrossSlope_missing_value;
-	char mbSFlag_type[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbSFlag_long_name[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbSFlag_name_code[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbSFlag_units[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbSFlag_unit_code[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbSFlag_format_C[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbSFlag_orientation[MBSYS_NETCDF_ATTRIBUTELEN];
-	int mbSFlag_add_offset;
-	int mbSFlag_scale_factor;
-	int mbSFlag_minimum;
-	int mbSFlag_maximum;
-	int mbSFlag_valid_minimum;
-	int mbSFlag_valid_maximum;
-	int mbSFlag_missing_value;
-	char mbSLengthOfDetection_type[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbSLengthOfDetection_long_name[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbSLengthOfDetection_name_code[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbSLengthOfDetection_units[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbSLengthOfDetection_unit_code[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbSLengthOfDetection_format_C[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbSLengthOfDetection_orientation[MBSYS_NETCDF_ATTRIBUTELEN];
-	int mbSLengthOfDetection_add_offset;
-	int mbSLengthOfDetection_scale_factor;
-	int mbSLengthOfDetection_minimum;
-	int mbSLengthOfDetection_maximum;
-	int mbSLengthOfDetection_valid_minimum;
-	int mbSLengthOfDetection_valid_maximum;
-	int mbSLengthOfDetection_missing_value;
-	char mbAntenna_type[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbAntenna_long_name[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbAntenna_name_code[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbAntenna_units[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbAntenna_unit_code[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbAntenna_format_C[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbAntenna_orientation[MBSYS_NETCDF_ATTRIBUTELEN];
-	int mbAntenna_add_offset;
-	int mbAntenna_scale_factor;
-	int mbAntenna_minimum;
-	int mbAntenna_maximum;
-	int mbAntenna_valid_minimum;
-	int mbAntenna_valid_maximum;
-	int mbAntenna_missing_value;
-	char mbBeamBias_type[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbBeamBias_long_name[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbBeamBias_name_code[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbBeamBias_units[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbBeamBias_unit_code[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbBeamBias_format_C[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbBeamBias_orientation[MBSYS_NETCDF_ATTRIBUTELEN];
-	double mbBeamBias_add_offset;
-	double mbBeamBias_scale_factor;
-	int mbBeamBias_minimum;
-	int mbBeamBias_maximum;
-	int mbBeamBias_valid_minimum;
-	int mbBeamBias_valid_maximum;
-	int mbBeamBias_missing_value;
-	char mbBFlag_type[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbBFlag_long_name[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbBFlag_name_code[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbBFlag_units[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbBFlag_unit_code[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbBFlag_format_C[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbBFlag_orientation[MBSYS_NETCDF_ATTRIBUTELEN];
-	int mbBFlag_add_offset;
-	int mbBFlag_scale_factor;
-	int mbBFlag_minimum;
-	int mbBFlag_maximum;
-	int mbBFlag_valid_minimum;
-	int mbBFlag_valid_maximum;
-	int mbBFlag_missing_value;
-	char mbBeam_type[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbBeam_long_name[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbBeam_name_code[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbBeam_units[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbBeam_unit_code[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbBeam_format_C[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbBeam_orientation[MBSYS_NETCDF_ATTRIBUTELEN];
-	int mbBeam_add_offset;
-	int mbBeam_scale_factor;
-	int mbBeam_minimum;
-	int mbBeam_maximum;
-	int mbBeam_valid_minimum;
-	int mbBeam_valid_maximum;
-	int mbBeam_missing_value;
-	char mbAFlag_type[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbAFlag_long_name[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbAFlag_name_code[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbAFlag_units[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbAFlag_unit_code[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbAFlag_format_C[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbAFlag_orientation[MBSYS_NETCDF_ATTRIBUTELEN];
-	int mbAFlag_add_offset;
-	int mbAFlag_scale_factor;
-	int mbAFlag_minimum;
-	int mbAFlag_maximum;
-	int mbAFlag_valid_minimum;
-	int mbAFlag_valid_maximum;
-	int mbAFlag_missing_value;
-	char mbVelProfilRef_type[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbVelProfilRef_long_name[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbVelProfilRef_name_code[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbVelProfilIdx_type[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbVelProfilIdx_long_name[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbVelProfilIdx_name_code[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbVelProfilIdx_units[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbVelProfilIdx_unit_code[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbVelProfilIdx_format_C[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbVelProfilIdx_orientation[MBSYS_NETCDF_ATTRIBUTELEN];
-	int mbVelProfilIdx_add_offset;
-	int mbVelProfilIdx_scale_factor;
-	int mbVelProfilIdx_minimum;
-	int mbVelProfilIdx_maximum;
-	int mbVelProfilIdx_valid_minimum;
-	int mbVelProfilIdx_valid_maximum;
-	int mbVelProfilIdx_missing_value;
-	char mbVelProfilDate_type[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbVelProfilDate_long_name[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbVelProfilDate_name_code[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbVelProfilDate_units[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbVelProfilDate_unit_code[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbVelProfilDate_format_C[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbVelProfilDate_orientation[MBSYS_NETCDF_ATTRIBUTELEN];
-	int mbVelProfilDate_add_offset;
-	int mbVelProfilDate_scale_factor;
-	int mbVelProfilDate_minimum;
-	int mbVelProfilDate_maximum;
-	int mbVelProfilDate_valid_minimum;
-	int mbVelProfilDate_valid_maximum;
-	int mbVelProfilDate_missing_value;
-	char mbVelProfilTime_type[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbVelProfilTime_long_name[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbVelProfilTime_name_code[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbVelProfilTime_units[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbVelProfilTime_unit_code[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbVelProfilTime_format_C[MBSYS_NETCDF_ATTRIBUTELEN];
-	char mbVelProfilTime_orientation[MBSYS_NETCDF_ATTRIBUTELEN];
-	int mbVelProfilTime_add_offset;
-	int mbVelProfilTime_scale_factor;
-	int mbVelProfilTime_minimum;
-	int mbVelProfilTime_maximum;
-	int mbVelProfilTime_valid_minimum;
-	int mbVelProfilTime_valid_maximum;
-	int mbVelProfilTime_missing_value;
-
-	/* storage comment string */
-	char	comment[MBSYS_NETCDF_COMMENTLEN];
-	};
-
-/* system specific function prototypes */
-int mbsys_netcdf_alloc(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error);
-int mbsys_netcdf_deall(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error);
-int mbsys_netcdf_dimensions(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int *nbath, int *namp, int *nss, int *error);
-int mbsys_netcdf_extract(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int time_i[7], double *time_d,
-			double *navlon, double *navlat,
-			double *speed, double *heading,
-			int *nbath, int *namp, int *nss,
-			char *beamflag, double *bath, double *amp,
-			double *bathacrosstrack, double *bathalongtrack,
-			double *ss, double *ssacrosstrack, double *ssalongtrack,
-			char *comment, int *error);
-int mbsys_netcdf_insert(int verbose, void *mbio_ptr, void *store_ptr,
-			int kind, int time_i[7], double time_d,
-			double navlon, double navlat,
-			double speed, double heading,
-			int nbath, int namp, int nss,
-			char *beamflag, double *bath, double *amp,
-			double *bathacrosstrack, double *bathalongtrack,
-			double *ss, double *ssacrosstrack, double *ssalongtrack,
-			char *comment, int *error);
-int mbsys_netcdf_ttimes(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int *nbeams,
-			double *ttimes, double *angles,
-			double *angles_forward, double *angles_null,
-			double *heave, double *alongtrack_offset,
-			double *draft, double *ssv, int *error);
-int mbsys_netcdf_detects(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int *nbeams, int *detects, int *error);
-int mbsys_netcdf_extract_altitude(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, double *transducer_depth, double *altitude,
-			int *error);
-int mbsys_netcdf_insert_altitude(int verbose, void *mbio_ptr, void *store_ptr,
-			double transducer_depth, double altitude,
-			int *error);
-int mbsys_netcdf_extract_nav(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int time_i[7], double *time_d,
-			double *navlon, double *navlat,
-			double *speed, double *heading, double *draft,
-			double *roll, double *pitch, double *heave,
-			int *error);
-int mbsys_netcdf_insert_nav(int verbose, void *mbio_ptr, void *store_ptr,
-			int time_i[7], double time_d,
-			double navlon, double navlat,
-			double speed, double heading, double draft,
-			double roll, double pitch, double heave,
-			int *error);
-int mbsys_netcdf_extract_svp(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind,
-			int *nsvp,
-			double *depth, double *velocity,
-			int *error);
-int mbsys_netcdf_insert_svp(int verbose, void *mbio_ptr, void *store_ptr,
-			int nsvp,
-			double *depth, double *velocity,
-			int *error);
-int mbsys_netcdf_copy(int verbose, void *mbio_ptr,
-			void *store_ptr, void *copy_ptr,
-			int *error);
diff --git a/src/mbio/mbsys_oic.c b/src/mbio/mbsys_oic.c
deleted file mode 100644
index c7772d7..0000000
--- a/src/mbio/mbsys_oic.c
+++ /dev/null
@@ -1,1622 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbsys_oic.c	3/1/99
- *	$Id: mbsys_oic.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1999-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbsys_oic.c contains the functions for handling the data structure
- * used by MBIO functions to store swath sonar data derived
- * from OIC systems:
- *      MBF_OICGEODA : MBIO ID 141
- *      MBF_OICMBARI : MBIO ID 142
- *
- * Author:	D. W. Caress
- * Date:	March 1, 1999
- *
- * $Log: mbsys_oic.c,v $
- * Revision 5.10  2008/07/10 18:02:39  caress
- * Proceeding towards 5.1.1beta20.
- *
- * Revision 5.7  2005/11/05 00:48:04  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.6  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.5  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.4  2001/08/25 00:54:13  caress
- * Adding beamwidth values to extract functions.
- *
- * Revision 5.3  2001/07/20  00:32:54  caress
- * Release 5.0.beta03
- *
- * Revision 5.2  2001/03/22  20:50:02  caress
- * Trying to make version 5.0.beta0
- *
- * Revision 5.1  2001/01/22  07:43:34  caress
- * Version 5.0.beta01
- *
- * Revision 5.0  2000/12/01  22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.2  2000/10/11  01:03:21  caress
- * Convert to ANSI C
- *
- * Revision 4.1  2000/09/30  06:32:52  caress
- * Snapshot for Dale.
- *
- * Revision 4.0  1999/03/31  18:29:20  caress
- * MB-System 4.6beta7
- *
- * Revision 1.1  1999/03/31  18:11:35  caress
- * Initial revision
- *
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mb_define.h"
-#include "mbsys_oic.h"
-
-static char rcs_id[]="$Id: mbsys_oic.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mbsys_oic_alloc(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_oic_alloc";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_oic_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* allocate memory for data structure */
-	status = mb_mallocd(verbose,__FILE__,__LINE__,sizeof(struct mbsys_oic_struct),
-				(void **)store_ptr,error);
-
-	/* get pointer to data structure */
-	store = (struct mbsys_oic_struct *) *store_ptr;
-
-	/* initialize values in structure */
-	store->kind = MB_DATA_NONE;
-	store->type = 0;
-	store->proc_status = 0;
-	store->data_size = 0;
-	store->client_size = 0;
-	store->fish_status = 0;
-	store->nav_used = 0;
-	store->nav_type = 0;
-	store->utm_zone = 0;
-	store->ship_x = 0.0;
-	store->ship_y = 0.0;
-	store->ship_course = 0.0;
-	store->ship_speed = 0.0;
-	store->sec = 0;
-	store->usec = 0;
-	store->spare_gain = 0.0;
-	store->fish_heading = 0.0;
-	store->fish_depth = 0.0;
-	store->fish_range = 0.0;
-	store->fish_pulse_width = 0.0;
-	store->gain_c0 = 0.0;
-	store->gain_c1 = 0.0;
-	store->gain_c2 = 0.0;
-	store->fish_pitch = 0.0;
-	store->fish_roll = 0.0;
-	store->fish_yaw = 0.0;
-	store->fish_x = 0.0;
-	store->fish_y = 0.0;
-	store->fish_layback = 0.0;
-	store->fish_altitude = 0.0;
-	store->fish_altitude_samples = 0;
-	store->fish_ping_period = 0.0;
-	store->sound_velocity = 0.0;
-	store->num_chan = 0;
-	store->beams_bath = 0;
-	store->beams_amp = 0;
-	store->bath_chan_port = 0;
-	store->bath_chan_stbd = 0;
-	store->pixels_ss = 0;
-	store->ss_chan_port = 0;
-	store->ss_chan_stbd = 0;
-	store->beamflag = NULL;
-	store->bath = NULL;
-	store->bathacrosstrack = NULL;
-	store->bathalongtrack = NULL;
-	store->tt = NULL;
-	store->angle = NULL;
-	store->amp = NULL;
-	store->ss = NULL;
-	store->ssacrosstrack = NULL;
-	store->ssalongtrack = NULL;
-	for (i=0;i<MBSYS_OIC_MAX_CHANNELS;i++)
-	    {
-	    store->channel[i].offset = 0;
-	    store->channel[i].type = 0;
-	    store->channel[i].side = 0;
-	    store->channel[i].size = 0;
-	    store->channel[i].empty = 0;
-	    store->channel[i].frequency = 0;
-	    store->channel[i].num_samples = 0;
-	    }
-	memset(store->client, 0, MBSYS_OIC_MAX_CLIENT);
-	for (i=0;i<MBSYS_OIC_MAX_CHANNELS;i++)
-	    {
-	    store->rawsize[i] = 0;
-	    store->raw[i] = NULL;
-	    }
-	store->beams_bath_alloc = 0;
-	store->beams_amp_alloc = 0;
-	store->pixels_ss_alloc = 0;
-	store->beamflag = NULL;
-	store->bath = NULL;
-	store->amp = NULL;
-	store->bathacrosstrack = NULL;
-	store->bathalongtrack = NULL;
-	store->tt = NULL;
-	store->angle = NULL;
-	store->ss = NULL;
-	store->ssacrosstrack = NULL;
-	store->ssalongtrack = NULL;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)*store_ptr);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_oic_deall(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_oic_deall";
-	int	status = MB_SUCCESS;
-	struct mbsys_oic_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)*store_ptr);
-		}
-
-	/* get pointer to data structure */
-	store = (struct mbsys_oic_struct *) *store_ptr;
-
-	/* deallocate memory for data structures */
-	for (i=0;i<store->num_chan;i++)
-	    status = mb_freed(verbose,__FILE__, __LINE__, (void **)&(store->raw[i]),error);
-	status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->beamflag,error);
-	status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->bath,error);
-	status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->bathacrosstrack,error);
-	status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->bathalongtrack,error);
-	status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->tt,error);
-	status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->angle,error);
-	status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->amp,error);
-	status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->ss,error);
-	status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->ssacrosstrack,error);
-	status = mb_freed(verbose,__FILE__, __LINE__, (void **)&store->ssalongtrack,error);
-
-	/* deallocate memory for data structure */
-	status = mb_freed(verbose,__FILE__, __LINE__, (void **)store_ptr,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_oic_dimensions(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int *nbath, int *namp, int *nss, int *error)
-{
-	char	*function_name = "mbsys_oic_dimensions";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_oic_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_oic_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get beam and pixel numbers */
-		*nbath = store->beams_bath;
-		*namp = store->beams_amp;
-		*nss = store->pixels_ss;
-		}
-	else
-		{
-		/* get beam and pixel numbers */
-		*nbath = 0;
-		*namp = 0;
-		*nss = 0;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		fprintf(stderr,"dbg2       nbath:      %d\n",*nbath);
-		fprintf(stderr,"dbg2        namp:      %d\n",*namp);
-		fprintf(stderr,"dbg2        nss:       %d\n",*nss);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_oic_extract(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int time_i[7], double *time_d,
-		double *navlon, double *navlat,
-		double *speed, double *heading,
-		int *nbath, int *namp, int *nss,
-		char *beamflag, double *bath, double *amp,
-		double *bathacrosstrack, double *bathalongtrack,
-		double *ss, double *ssacrosstrack, double *ssalongtrack,
-		char *comment, int *error)
-{
-	char	*function_name = "mbsys_oic_extract";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_oic_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-	    {
-	    fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-		    function_name);
-	    fprintf(stderr,"dbg2  Input arguments:\n");
-	    fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-	    fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-	    fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-	    }
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_oic_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-	    {
-	    /* get time */
-	    *time_d = store->sec + 0.000001 * store->usec;
-	    mb_get_date(verbose,*time_d,time_i);
-
-	    /* get navigation */
-	    if (store->nav_type == OIC_NAV_LONLAT)
-		{
-		*navlon = store->fish_x;
-		*navlat = store->fish_y;
-		}
-	    else
-		{
-		*navlon = 0.0;
-		*navlat = 0.0;
-		}
-
-	    /* get heading */
-	    *heading = store->fish_heading;
-
-	    /* get speed */
-	    *speed = 3.6 * store->ship_speed;
-
-	    /* set beamwidths in mb_io structure */
-	    mb_io_ptr->beamwidth_ltrack = 2.0;
-	    mb_io_ptr->beamwidth_xtrack = 0.2;
-
-	    /* read distance, depth, and backscatter
-		    values into storage arrays */
-	    *nbath = store->beams_bath;
-	    *namp = store->beams_amp;
-	    *nss = store->pixels_ss;
-	    for (i=0;i<*nbath;i++)
-		{
-		beamflag[i] = store->beamflag[i];
-		bath[i] = store->bath[i];
-		bathacrosstrack[i] = store->bathacrosstrack[i];
-		bathalongtrack[i] = store->bathalongtrack[i];
-		}
-	    for (i=0;i<*namp;i++)
-		{
-		amp[i] = store->amp[i];
-		}
-	    for (i=0;i<*nss;i++)
-		{
-		ss[i] = store->ss[i];
-		ssacrosstrack[i] = store->ssacrosstrack[i];
-		ssalongtrack[i] = store->ssalongtrack[i];
-		}
-
-	    /* print debug statements */
-	    if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg4  Data extracted by MBIO function <%s>\n",
-			function_name);
-		fprintf(stderr,"dbg4  Extracted values:\n");
-		fprintf(stderr,"dbg4       kind:       %d\n",
-			*kind);
-		fprintf(stderr,"dbg4       error:      %d\n",
-			*error);
-		fprintf(stderr,"dbg4       time_i[0]:  %d\n",
-			time_i[0]);
-		fprintf(stderr,"dbg4       time_i[1]:  %d\n",
-			time_i[1]);
-		fprintf(stderr,"dbg4       time_i[2]:  %d\n",
-			time_i[2]);
-		fprintf(stderr,"dbg4       time_i[3]:  %d\n",
-			time_i[3]);
-		fprintf(stderr,"dbg4       time_i[4]:  %d\n",
-			time_i[4]);
-		fprintf(stderr,"dbg4       time_i[5]:  %d\n",
-			time_i[5]);
-		fprintf(stderr,"dbg4       time_i[6]:  %d\n",
-			time_i[6]);
-		fprintf(stderr,"dbg4       time_d:     %f\n",
-			*time_d);
-		fprintf(stderr,"dbg4       longitude:  %f\n",
-			*navlon);
-		fprintf(stderr,"dbg4       latitude:   %f\n",
-			*navlat);
-		fprintf(stderr,"dbg4       speed:      %f\n",
-			*speed);
-		fprintf(stderr,"dbg4       heading:    %f\n",
-			*heading);
-		fprintf(stderr,"dbg4       nbath:      %d\n",
-			*nbath);
-		for (i=0;i<*nbath;i++)
-		  fprintf(stderr,"dbg4       beam:%d  flag:%3d  bath:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,beamflag[i],bath[i],bathacrosstrack[i],bathalongtrack[i]);
-		fprintf(stderr,"dbg4        namp:     %d\n",
-			*namp);
-		for (i=0;i<*namp;i++)
-		  fprintf(stderr,"dbg4        beam:%d   amp:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,amp[i],bathacrosstrack[i],bathalongtrack[i]);
-		fprintf(stderr,"dbg4        nss:      %d\n",
-			*nss);
-		for (i=0;i<*nss;i++)
-		  fprintf(stderr,"dbg4        pixel:%d   ss:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,ss[i],ssacrosstrack[i],ssalongtrack[i]);
-		}
-
-	    /* done translating values */
-
-	    }
-
-	/* extract comment from structure */
-	else if (*kind == MB_DATA_COMMENT)
-	    {
-	    /* copy comment */
-	    strncpy(comment,store->client,MBSYS_OIC_MAX_COMMENT);
-
-	    /* print debug statements */
-	    if (verbose >= 4)
-		{
-		fprintf(stderr,"\ndbg4  New ping read by MBIO function <%s>\n",
-			function_name);
-		fprintf(stderr,"dbg4  New ping values:\n");
-		fprintf(stderr,"dbg4       error:      %d\n",
-			*error);
-		fprintf(stderr,"dbg4       comment:    %s\n",
-			comment);
-		}
-	    }
-
-	/* print output debug statements */
-	if (verbose >= 2)
-	    {
-	    fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-		    function_name);
-	    fprintf(stderr,"dbg2  Return values:\n");
-	    fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-	    }
-	if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-	    && *kind == MB_DATA_COMMENT)
-	    {
-	    fprintf(stderr,"dbg2       comment:     \ndbg2       %s\n",
-		    comment);
-	    }
-	else if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-	    && *kind != MB_DATA_COMMENT)
-	    {
-	    fprintf(stderr,"dbg2       time_i[0]:     %d\n",time_i[0]);
-	    fprintf(stderr,"dbg2       time_i[1]:     %d\n",time_i[1]);
-	    fprintf(stderr,"dbg2       time_i[2]:     %d\n",time_i[2]);
-	    fprintf(stderr,"dbg2       time_i[3]:     %d\n",time_i[3]);
-	    fprintf(stderr,"dbg2       time_i[4]:     %d\n",time_i[4]);
-	    fprintf(stderr,"dbg2       time_i[5]:     %d\n",time_i[5]);
-	    fprintf(stderr,"dbg2       time_i[6]:     %d\n",time_i[6]);
-	    fprintf(stderr,"dbg2       time_d:        %f\n",*time_d);
-	    fprintf(stderr,"dbg2       longitude:     %f\n",*navlon);
-	    fprintf(stderr,"dbg2       latitude:      %f\n",*navlat);
-	    fprintf(stderr,"dbg2       speed:         %f\n",*speed);
-	    fprintf(stderr,"dbg2       heading:       %f\n",*heading);
-	    }
-	if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-	    && *kind == MB_DATA_DATA)
-	    {
-	    fprintf(stderr,"dbg2       nbath:      %d\n",
-		    *nbath);
-	    for (i=0;i<*nbath;i++)
-	      fprintf(stderr,"dbg2       beam:%d  flag:%3d  bath:%f  acrosstrack:%f  alongtrack:%f\n",
-		    i,beamflag[i],bath[i],
-		    bathacrosstrack[i],bathalongtrack[i]);
-	    fprintf(stderr,"dbg2        namp:     %d\n",
-		    *namp);
-	    for (i=0;i<*namp;i++)
-	      fprintf(stderr,"dbg2       beam:%d   amp:%f  acrosstrack:%f  alongtrack:%f\n",
-		    i,amp[i],bathacrosstrack[i],bathalongtrack[i]);
-	    fprintf(stderr,"dbg2        nss:      %d\n",
-		    *nss);
-	    for (i=0;i<*nss;i++)
-	      fprintf(stderr,"dbg2        pixel:%d   ss:%f  acrosstrack:%f  alongtrack:%f\n",
-		    i,ss[i],ssacrosstrack[i],ssalongtrack[i]);
-	    }
-	if (verbose >= 2)
-	    {
-	    fprintf(stderr,"dbg2       error:      %d\n",*error);
-	    fprintf(stderr,"dbg2  Return status:\n");
-	    fprintf(stderr,"dbg2       status:     %d\n",status);
-	    }
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_oic_insert(int verbose, void *mbio_ptr, void *store_ptr,
-		int kind, int time_i[7], double time_d,
-		double navlon, double navlat,
-		double speed, double heading,
-		int nbath, int namp, int nss,
-		char *beamflag, double *bath, double *amp,
-		double *bathacrosstrack, double *bathalongtrack,
-		double *ss, double *ssacrosstrack, double *ssalongtrack,
-		char *comment, int *error)
-{
-	char	*function_name = "mbsys_oic_insert";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_oic_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-	    {
-	    fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-		    function_name);
-	    fprintf(stderr,"dbg2  Input arguments:\n");
-	    fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-	    fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-	    fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-	    fprintf(stderr,"dbg2       kind:       %d\n",kind);
-	    }
-	if (verbose >= 2 && (kind == MB_DATA_DATA || kind == MB_DATA_NAV))
-	    {
-	    fprintf(stderr,"dbg2       time_i[0]:  %d\n",time_i[0]);
-	    fprintf(stderr,"dbg2       time_i[1]:  %d\n",time_i[1]);
-	    fprintf(stderr,"dbg2       time_i[2]:  %d\n",time_i[2]);
-	    fprintf(stderr,"dbg2       time_i[3]:  %d\n",time_i[3]);
-	    fprintf(stderr,"dbg2       time_i[4]:  %d\n",time_i[4]);
-	    fprintf(stderr,"dbg2       time_i[5]:  %d\n",time_i[5]);
-	    fprintf(stderr,"dbg2       time_i[6]:  %d\n",time_i[6]);
-	    fprintf(stderr,"dbg2       time_d:     %f\n",time_d);
-	    fprintf(stderr,"dbg2       navlon:     %f\n",navlon);
-	    fprintf(stderr,"dbg2       navlat:     %f\n",navlat);
-	    fprintf(stderr,"dbg2       speed:      %f\n",speed);
-	    fprintf(stderr,"dbg2       heading:    %f\n",heading);
-	    }
-	if (verbose >= 2 && kind == MB_DATA_DATA)
-	    {
-	    fprintf(stderr,"dbg2       nbath:      %d\n",
-		    nbath);
-	    if (verbose >= 3)
-	     for (i=0;i<nbath;i++)
-	      fprintf(stderr,"dbg3       beam:%d  flag:%3d  bath:%f  acrosstrack:%f  alongtrack:%f\n",
-		    i,beamflag[i],bath[i],
-		    bathacrosstrack[i],bathalongtrack[i]);
-	    fprintf(stderr,"dbg2       namp:       %d\n",namp);
-	    if (verbose >= 3)
-	     for (i=0;i<namp;i++)
-	      fprintf(stderr,"dbg3        beam:%d   amp:%f  acrosstrack:%f  alongtrack:%f\n",
-		    i,amp[i],bathacrosstrack[i],bathalongtrack[i]);
-	    fprintf(stderr,"dbg2        nss:       %d\n",nss);
-	    if (verbose >= 3)
-	     for (i=0;i<nss;i++)
-	      fprintf(stderr,"dbg3        pixel:%d   ss:%f  acrosstrack:%f  alongtrack:%f\n",
-		    i,ss[i],ssacrosstrack[i],ssalongtrack[i]);
-	    }
-	if (verbose >= 2 && kind == MB_DATA_COMMENT)
-	    {
-	    fprintf(stderr,"dbg2       comment:     \ndbg2       %s\n",
-			comment);
-	    }
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_oic_struct *) store_ptr;
-
-	/* set data kind */
-	store->kind = kind;
-
-	/* insert data in structure */
-	if (store->kind == MB_DATA_DATA)
-	    {
-	    /* get time */
-	    store->sec = (int) time_d;
-	    store->usec = (int) (1000000 * (time_d - store->sec));
-
-	    /* get navigation */
-	    if (navlon < 0.0) navlon = navlon + 360.0;
-	    store->nav_type = OIC_NAV_LONLAT;
-	    store->fish_x = navlon;
-	    store->fish_y = navlat;
-
-	    /* get heading */
-	    store->fish_heading = heading;
-
-	    /* get speed */
-	    store->ship_speed = speed / 3.6;
-
-	    /* set numbers of beams and sidescan */
-	    store->beams_bath = nbath;
-	    store->beams_amp = namp;
-	    store->pixels_ss = nss;
-
-	    /* get bath and sidescan */
-	    if (store->beams_bath > store->beams_bath_alloc
-		|| store->beamflag == NULL
-		|| store->bath == NULL
-		|| store->bathacrosstrack == NULL
-		|| store->bathalongtrack == NULL
-		|| store->tt == NULL
-		|| store->angle == NULL)
-		{
-		store->beams_bath_alloc = store->beams_bath;
-		if (store->beamflag != NULL)
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **) &(store->beamflag), error);
-		if (store->bath != NULL)
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **) &(store->bath), error);
-		if (store->bathacrosstrack != NULL)
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **) &(store->bathacrosstrack), error);
-		if (store->bathalongtrack != NULL)
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **) &(store->bathalongtrack), error);
-		if (store->tt != NULL)
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **) &(store->bathalongtrack), error);
-		if (store->angle != NULL)
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **) &(store->bathalongtrack), error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,store->beams_bath_alloc * sizeof(char),
-				    (void **)&(store->beamflag),error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,store->beams_bath_alloc * sizeof(float),
-				    (void **)&(store->bath),error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,store->beams_bath_alloc * sizeof(float),
-				    (void **)&(store->bathacrosstrack),error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,store->beams_bath_alloc * sizeof(float),
-				    (void **)&(store->bathalongtrack),error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,store->beams_bath_alloc * sizeof(float),
-				    (void **)&(store->tt),error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,store->beams_bath_alloc * sizeof(float),
-				    (void **)&(store->angle),error);
-		}
-	    if (store->beams_amp > store->beams_amp_alloc
-		|| store->amp == NULL)
-		{
-		store->beams_amp_alloc = store->beams_amp;
-		if (store->amp != NULL)
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **) &(store->amp), error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,store->beams_bath_alloc * sizeof(char),
-				    (void **)&(store->amp),error);
-		}
-	    if (store->pixels_ss > store->pixels_ss_alloc
-		|| store->ss == NULL
-		|| store->ssacrosstrack == NULL
-		|| store->ssalongtrack == NULL)
-		{
-		store->pixels_ss_alloc = store->pixels_ss;
-		if (store->ss != NULL)
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **) &(store->ss), error);
-		if (store->ssacrosstrack != NULL)
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **) &(store->ssacrosstrack), error);
-		if (store->ssalongtrack != NULL)
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **) &(store->ssalongtrack), error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,store->pixels_ss_alloc * sizeof(float),
-				    (void **)&(store->ss),error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,store->pixels_ss_alloc * sizeof(float),
-				    (void **)&(store->ssacrosstrack),error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,store->pixels_ss_alloc * sizeof(float),
-				    (void **)&(store->ssalongtrack),error);
-		}
-	    for (i=0;i<store->beams_bath;i++)
-		{
-		store->beamflag[i] = beamflag[i];
-		store->bath[i] = bath[i];
-		store->bathacrosstrack[i] = bathacrosstrack[i];
-		store->bathalongtrack[i] = bathalongtrack[i];
-		}
-	    for (i=0;i<store->beams_amp;i++)
-		{
-		store->amp[i] = amp[i];
-		}
-	    for (i=0;i<store->pixels_ss;i++)
-		{
-		store->ss[i] = ss[i];
-		store->ssacrosstrack[i] = ssacrosstrack[i];
-		store->ssalongtrack[i] = ssalongtrack[i];
-		}
-	    }
-
-	/* insert comment in structure */
-	else if (store->kind == MB_DATA_COMMENT)
-	    {
-	    strncpy(store->client,comment,MBSYS_OIC_MAX_COMMENT);
-	    store->client_size = strlen(comment) + 1;
-	    store->type = OIC_ID_COMMENT;
-	    }
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_oic_ttimes(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, int *nbeams,
-	double *ttimes, double *angles,
-	double *angles_forward, double *angles_null,
-	double *heave, double *alongtrack_offset,
-	double *draft, double *ssv, int *error)
-{
-	char	*function_name = "mbsys_oic_ttimes";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_oic_struct *store;
-	double	alpha, beta;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-	    {
-	    fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-		    function_name);
-	    fprintf(stderr,"dbg2  Input arguments:\n");
-	    fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-	    fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-	    fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-	    fprintf(stderr,"dbg2       ttimes:     %p\n",(void *)ttimes);
-	    fprintf(stderr,"dbg2       angles_xtrk:%p\n",(void *)angles);
-	    fprintf(stderr,"dbg2       angles_ltrk:%p\n",(void *)angles_forward);
-	    fprintf(stderr,"dbg2       angles_null:%p\n",(void *)angles_null);
-	    fprintf(stderr,"dbg2       heave:      %p\n",(void *)heave);
-	    fprintf(stderr,"dbg2       ltrk_off:   %p\n",(void *)alongtrack_offset);
-	    }
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_oic_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-	    {
-	    /* get nbeams */
-	    *nbeams = store->beams_bath;
-
-	    /* initialize */
-	    for (i=0;i<store->beams_bath;i++)
-		{
-		ttimes[i] = store->tt[i];
-		beta = store->angle[i];
-		alpha = store->fish_pitch;
-		status = mb_rollpitch_to_takeoff(verbose,
-				    alpha, beta,
-				    &angles[i],
-				    &angles_forward[i],error);
-		angles_null[i] = 0.0;
-		heave[i] = 0.0;
-		alongtrack_offset[i] = 0.0;
-		}
-
-	    /* get ssv */
-	    *ssv = store->sound_velocity;
-
-	    /* get draft */
-	    *draft = store->fish_depth;
-
-	    /* set status */
-	    *error = MB_ERROR_NO_ERROR;
-	    status = MB_SUCCESS;
-
-	    /* done translating values */
-
-	    }
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-	    {
-	    /* set status */
-	    *error = MB_ERROR_COMMENT;
-	    status = MB_FAILURE;
-	    }
-
-	/* deal with other record type */
-	else
-	    {
-	    /* set status */
-	    *error = MB_ERROR_OTHER;
-	    status = MB_FAILURE;
-	    }
-
-	/* print output debug statements */
-	if (verbose >= 2)
-	    {
-	    fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-		    function_name);
-	    fprintf(stderr,"dbg2  Return values:\n");
-	    fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-	    }
-	if (verbose >= 2 && *error == MB_ERROR_NO_ERROR)
-	    {
-	    fprintf(stderr,"dbg2       draft:      %f\n",*draft);
-	    fprintf(stderr,"dbg2       ssv:        %f\n",*ssv);
-	    fprintf(stderr,"dbg2       nbeams:     %d\n",*nbeams);
-	    for (i=0;i<*nbeams;i++)
-		    fprintf(stderr,"dbg2       beam %d: tt:%f  angle_xtrk:%f angle_ltrk:%f  angle_null:%f  depth_off:%f  ltrk_off:%f\n",
-			    i,ttimes[i],angles[i],
-			    angles_forward[i],angles_null[i],
-			    heave[i],alongtrack_offset[i]);
-	    }
-	if (verbose >= 2)
-	    {
-	    fprintf(stderr,"dbg2       error:      %d\n",*error);
-	    fprintf(stderr,"dbg2  Return status:\n");
-	    fprintf(stderr,"dbg2       status:     %d\n",status);
-	    }
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_oic_detects(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, int *nbeams,
-	int *detects, int *error)
-{
-	char	*function_name = "mbsys_oic_detects";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_oic_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       detects:    %p\n",(void *)detects);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_oic_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get nbeams */
-		*nbeams = store->beams_bath;
-
-		/* get detects */
-		for (i=0;i<*nbeams;i++)
-			{
-			detects[i] = MB_DETECT_PHASE;
-			}
-
-		/* set status */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error == MB_ERROR_NO_ERROR)
-		{
-		fprintf(stderr,"dbg2       nbeams:     %d\n",*nbeams);
-		for (i=0;i<*nbeams;i++)
-			fprintf(stderr,"dbg2       beam %d: detects:%d\n",
-				i,detects[i]);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_oic_extract_altitude(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, double *transducer_depth, double *altitude,
-	int *error)
-{
-	char	*function_name = "mbsys_oic_extract_altitude";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_oic_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-	    {
-	    fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-		    function_name);
-	    fprintf(stderr,"dbg2  Input arguments:\n");
-	    fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-	    fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-	    fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-	    }
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_oic_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-	    {
-	    *transducer_depth = store->fish_depth;
-	    *altitude = store->fish_altitude;
-	    }
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-	    {
-	    /* set status */
-	    *error = MB_ERROR_COMMENT;
-	    status = MB_FAILURE;
-	    }
-
-	/* deal with other record type */
-	else
-	    {
-	    /* set status */
-	    *error = MB_ERROR_OTHER;
-	    status = MB_FAILURE;
-	    }
-
-	/* print output debug statements */
-	if (verbose >= 2)
-	    {
-	    fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-		    function_name);
-	    fprintf(stderr,"dbg2  Return values:\n");
-	    fprintf(stderr,"dbg2       kind:              %d\n",*kind);
-	    fprintf(stderr,"dbg2       transducer_depth:  %f\n",*transducer_depth);
-	    fprintf(stderr,"dbg2       altitude:          %f\n",*altitude);
-	    fprintf(stderr,"dbg2       error:             %d\n",*error);
-	    fprintf(stderr,"dbg2  Return status:\n");
-	    fprintf(stderr,"dbg2       status:            %d\n",status);
-	    }
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_oic_insert_altitude(int verbose, void *mbio_ptr, void *store_ptr,
-	double transducer_depth, double altitude,
-	int *error)
-{
-	char	*function_name = "mbsys_oic_insert_altitude";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_oic_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-	    {
-	    fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-		    function_name);
-	    fprintf(stderr,"dbg2  Input arguments:\n");
-	    fprintf(stderr,"dbg2       verbose:           %d\n",verbose);
-	    fprintf(stderr,"dbg2       mb_ptr:            %p\n",(void *)mbio_ptr);
-	    fprintf(stderr,"dbg2       store_ptr:         %p\n",(void *)store_ptr);
-	    fprintf(stderr,"dbg2       transducer_depth:  %f\n",transducer_depth);
-	    fprintf(stderr,"dbg2       altitude:          %f\n",altitude);
-	    }
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_oic_struct *) store_ptr;
-
-	/* insert data into structure */
-	if (store->kind == MB_DATA_DATA)
-	    {
-	    store->fish_depth = transducer_depth;
-	    store->fish_altitude = altitude;
-	    }
-
-	/* deal with comment */
-	else if (store->kind == MB_DATA_COMMENT)
-	    {
-	    /* set status */
-	    *error = MB_ERROR_COMMENT;
-	    status = MB_FAILURE;
-	    }
-
-	/* deal with other record type */
-	else
-	    {
-	    /* set status */
-	    *error = MB_ERROR_OTHER;
-	    status = MB_FAILURE;
-	    }
-
-	/* print output debug statements */
-	if (verbose >= 2)
-	    {
-	    fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-		    function_name);
-	    fprintf(stderr,"dbg2  Return values:\n");
-	    fprintf(stderr,"dbg2       error:             %d\n",*error);
-	    fprintf(stderr,"dbg2  Return status:\n");
-	    fprintf(stderr,"dbg2       status:            %d\n",status);
-	    }
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_oic_extract_nav(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int time_i[7], double *time_d,
-		double *navlon, double *navlat,
-		double *speed, double *heading, double *draft,
-		double *roll, double *pitch, double *heave,
-		int *error)
-{
-	char	*function_name = "mbsys_oic_extract_nav";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_oic_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-	    {
-	    fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-		    function_name);
-	    fprintf(stderr,"dbg2  Input arguments:\n");
-	    fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-	    fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-	    fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-	    }
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_oic_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-	    {
-	    /* get time */
-	    *time_d = store->sec + 0.000001 * store->usec;
-	    mb_get_date(verbose,*time_d,time_i);
-
-	    /* get navigation */
-	    if (store->nav_type == OIC_NAV_LONLAT)
-		{
-		*navlon = store->fish_x;
-		*navlat = store->fish_y;
-		}
-	    else
-		{
-		*navlon = 0.0;
-		*navlat = 0.0;
-		}
-
-	    /* get heading */
-	    *heading = store->fish_heading;
-
-	    /* get speed */
-	    *speed = 3.6 * store->ship_speed;
-
-	    /* get draft */
-	    *draft = store->fish_depth;
-
-	    /* get roll pitch and heave */
-	    *roll = store->fish_roll;
-	    *pitch = store->fish_pitch;
-	    *heave = 0.0;
-
-	    /* print debug statements */
-	    if (verbose >= 5)
-		{
-		fprintf(stderr,"\ndbg4  Data extracted by MBIO function <%s>\n",
-			function_name);
-		fprintf(stderr,"dbg4  Extracted values:\n");
-		fprintf(stderr,"dbg4       kind:       %d\n",
-			*kind);
-		fprintf(stderr,"dbg4       error:      %d\n",
-			*error);
-		fprintf(stderr,"dbg4       time_i[0]:  %d\n",
-			time_i[0]);
-		fprintf(stderr,"dbg4       time_i[1]:  %d\n",
-			time_i[1]);
-		fprintf(stderr,"dbg4       time_i[2]:  %d\n",
-			time_i[2]);
-		fprintf(stderr,"dbg4       time_i[3]:  %d\n",
-			time_i[3]);
-		fprintf(stderr,"dbg4       time_i[4]:  %d\n",
-			time_i[4]);
-		fprintf(stderr,"dbg4       time_i[5]:  %d\n",
-			time_i[5]);
-		fprintf(stderr,"dbg4       time_i[6]:  %d\n",
-			time_i[6]);
-		fprintf(stderr,"dbg4       time_d:     %f\n",
-			*time_d);
-		fprintf(stderr,"dbg4       longitude:  %f\n",
-			*navlon);
-		fprintf(stderr,"dbg4       latitude:   %f\n",
-			*navlat);
-		fprintf(stderr,"dbg4       speed:      %f\n",
-			*speed);
-		fprintf(stderr,"dbg4       heading:    %f\n",
-			*heading);
-		fprintf(stderr,"dbg4       draft:      %f\n",
-			*draft);
-		fprintf(stderr,"dbg4       roll:       %f\n",
-			*roll);
-		fprintf(stderr,"dbg4       pitch:      %f\n",
-			*pitch);
-		fprintf(stderr,"dbg4       heave:      %f\n",
-			*heave);
-		}
-
-	    /* done translating values */
-
-	    }
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-	    {
-	    /* set status */
-	    *error = MB_ERROR_COMMENT;
-	    status = MB_FAILURE;
-	    }
-
-	/* deal with other record type */
-	else
-	    {
-	    /* set status */
-	    *error = MB_ERROR_OTHER;
-	    status = MB_FAILURE;
-	    }
-
-	/* print output debug statements */
-	if (verbose >= 2)
-	    {
-	    fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-		    function_name);
-	    fprintf(stderr,"dbg2  Return values:\n");
-	    fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-	    }
-	if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind == MB_DATA_DATA)
-	    {
-	    fprintf(stderr,"dbg2       time_i[0]:     %d\n",time_i[0]);
-	    fprintf(stderr,"dbg2       time_i[1]:     %d\n",time_i[1]);
-	    fprintf(stderr,"dbg2       time_i[2]:     %d\n",time_i[2]);
-	    fprintf(stderr,"dbg2       time_i[3]:     %d\n",time_i[3]);
-	    fprintf(stderr,"dbg2       time_i[4]:     %d\n",time_i[4]);
-	    fprintf(stderr,"dbg2       time_i[5]:     %d\n",time_i[5]);
-	    fprintf(stderr,"dbg2       time_i[6]:     %d\n",time_i[6]);
-	    fprintf(stderr,"dbg2       time_d:        %f\n",*time_d);
-	    fprintf(stderr,"dbg2       longitude:     %f\n",*navlon);
-	    fprintf(stderr,"dbg2       latitude:      %f\n",*navlat);
-	    fprintf(stderr,"dbg2       speed:         %f\n",*speed);
-	    fprintf(stderr,"dbg2       heading:       %f\n",*heading);
-	    fprintf(stderr,"dbg2       draft:         %f\n",*draft);
-	    fprintf(stderr,"dbg2       roll:          %f\n",*roll);
-	    fprintf(stderr,"dbg2       pitch:         %f\n",*pitch);
-	    fprintf(stderr,"dbg2       heave:         %f\n",*heave);
-	    }
-	if (verbose >= 2)
-	    {
-	    fprintf(stderr,"dbg2       error:      %d\n",*error);
-	    fprintf(stderr,"dbg2  Return status:\n");
-	    fprintf(stderr,"dbg2       status:     %d\n",status);
-	    }
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_oic_insert_nav(int verbose, void *mbio_ptr, void *store_ptr,
-		int time_i[7], double time_d,
-		double navlon, double navlat,
-		double speed, double heading, double draft,
-		double roll, double pitch, double heave,
-		int *error)
-{
-	char	*function_name = "mbsys_oic_insert_nav";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_oic_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-	    {
-	    fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-		    function_name);
-	    fprintf(stderr,"dbg2  Input arguments:\n");
-	    fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-	    fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-	    fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-	    fprintf(stderr,"dbg2       time_i[0]:  %d\n",time_i[0]);
-	    fprintf(stderr,"dbg2       time_i[1]:  %d\n",time_i[1]);
-	    fprintf(stderr,"dbg2       time_i[2]:  %d\n",time_i[2]);
-	    fprintf(stderr,"dbg2       time_i[3]:  %d\n",time_i[3]);
-	    fprintf(stderr,"dbg2       time_i[4]:  %d\n",time_i[4]);
-	    fprintf(stderr,"dbg2       time_i[5]:  %d\n",time_i[5]);
-	    fprintf(stderr,"dbg2       time_i[6]:  %d\n",time_i[6]);
-	    fprintf(stderr,"dbg2       time_d:     %f\n",time_d);
-	    fprintf(stderr,"dbg2       navlon:     %f\n",navlon);
-	    fprintf(stderr,"dbg2       navlat:     %f\n",navlat);
-	    fprintf(stderr,"dbg2       speed:      %f\n",speed);
-	    fprintf(stderr,"dbg2       heading:    %f\n",heading);
-	    fprintf(stderr,"dbg2       draft:      %f\n",draft);
-	    fprintf(stderr,"dbg2       roll:       %f\n",roll);
-	    fprintf(stderr,"dbg2       pitch:      %f\n",pitch);
-	    fprintf(stderr,"dbg2       heave:      %f\n",heave);
-	    }
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_oic_struct *) store_ptr;
-
-	/* insert data in structure */
-	if (store->kind == MB_DATA_DATA)
-	    {
-	    /* get time */
-	    store->sec = (int) time_d;
-	    store->usec = (int) (1000000 * (time_d - store->sec));
-
-	    /* get navigation */
-	    if (navlon < 0.0) navlon = navlon + 360.0;
-	    store->nav_type = OIC_NAV_LONLAT;
-	    store->fish_x = navlon;
-	    store->fish_y = navlat;
-
-	    /* get heading */
-	    store->fish_heading = heading;
-
-	    /* get speed */
-	    store->ship_speed = speed / 3.6;
-
-	    /* get draft */
-	    store->fish_depth = draft;
-
-	    /* get roll pitch and heave */
-	    store->fish_roll = roll;
-	    store->fish_pitch = pitch;
-	    }
-
-	/* print output debug statements */
-	if (verbose >= 2)
-	    {
-	    fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-		    function_name);
-	    fprintf(stderr,"dbg2  Return value:\n");
-	    fprintf(stderr,"dbg2       error:      %d\n",*error);
-	    fprintf(stderr,"dbg2  Return status:\n");
-	    fprintf(stderr,"dbg2       status:  %d\n",status);
-	    }
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_oic_copy(int verbose, void *mbio_ptr,
-			void *store_ptr, void *copy_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_oic_copy";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_oic_struct *store;
-	struct mbsys_oic_struct *copy;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       copy_ptr:   %p\n",(void *)copy_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointers */
-	store = (struct mbsys_oic_struct *) store_ptr;
-	copy = (struct mbsys_oic_struct *) copy_ptr;
-
-	/* copy the basic header data */
-	if (store != NULL && copy != NULL)
-	    {
-	    /* type of data record */
-	    copy->kind = store->kind;
-	    copy->type = store->type;
-
-	    /* status and size */
-	    copy->proc_status = store->proc_status;
-	    copy->data_size = store->data_size;
-	    copy->client_size = store->client_size;
-	    copy->fish_status = store->fish_status;
-	    copy->type = store->type;
-	    copy->type = store->type;
-
-	    /* nav */
-	    copy->nav_used = store->nav_used;
-	    copy->nav_type = store->nav_type;
-	    copy->utm_zone = store->utm_zone;
-	    copy->ship_x = store->ship_x;
-	    copy->ship_y = store->ship_y;
-	    copy->ship_course = store->ship_course;
-	    copy->ship_speed = store->ship_speed;
-	    copy->ship_x = store->ship_x;
-
-	    /* time stamp */
-	    copy->sec = store->sec;
-	    copy->usec = store->usec;
-
-	    /* more stuff */
-	    copy->spare_gain = store->spare_gain;
-	    copy->fish_heading = store->fish_heading;
-	    copy->fish_depth = store->fish_depth;
-	    copy->fish_range = store->fish_range;
-	    copy->fish_pulse_width = store->fish_pulse_width;
-	    copy->gain_c0 = store->gain_c0;
-	    copy->gain_c1 = store->gain_c1;
-	    copy->gain_c2 = store->gain_c2;
-	    copy->fish_pitch = store->fish_pitch;
-	    copy->fish_roll = store->fish_roll;
-	    copy->fish_yaw = store->fish_yaw;
-	    copy->fish_x = store->fish_x;
-	    copy->fish_y = store->fish_y;
-	    copy->fish_layback = store->fish_layback;
-	    copy->fish_altitude = store->fish_altitude;
-	    copy->fish_altitude_samples = store->fish_altitude_samples;
-	    copy->fish_ping_period = store->fish_ping_period;
-	    copy->sound_velocity = store->sound_velocity;
-
-	    /* numbers of beams and scaling */
-	    copy->num_chan = store->num_chan;
-	    copy->beams_bath = store->beams_bath;
-	    copy->beams_amp = store->beams_amp;
-	    copy->bath_chan_port = store->bath_chan_port;
-	    copy->bath_chan_stbd = store->bath_chan_stbd;
-	    copy->pixels_ss = store->pixels_ss;
-	    copy->ss_chan_port = store->ss_chan_port;
-	    copy->ss_chan_stbd = store->ss_chan_stbd;
-	    }
-
-	/* allocate the raw data */
-	if (store != NULL && copy != NULL)
-	    {
-	    for (i=0;i<copy->num_chan;i++)
-		{
-		/* copy channel info */
-		copy->channel[i].offset = store->channel[i].offset;
-		copy->channel[i].type = store->channel[i].type;
-		copy->channel[i].side = store->channel[i].side;
-		copy->channel[i].size = store->channel[i].size;
-		copy->channel[i].empty = store->channel[i].empty;
-		copy->channel[i].frequency = store->channel[i].frequency;
-		copy->channel[i].num_samples = store->channel[i].num_samples;
-
-		/* allocate data if needed */
-		if (store->rawsize[i] > copy->rawsize[i]
-		    || copy->raw[i] == NULL)
-		    {
-		    if (copy->raw[i] != NULL)
-			status = mb_freed(verbose,__FILE__, __LINE__, (void **) &(copy->raw[i]), error);
-		    copy->rawsize[i] = store->rawsize[i];
-		    status = mb_mallocd(verbose,__FILE__,__LINE__, copy->rawsize[i], (void **)&(copy->raw[i]),error);
-		    }
-
-		/* copy the raw data */
-		for (j=0;j<copy->rawsize[i];j++)
-		    {
-		    copy->raw[i][j] = store->raw[i][j];
-		    }
-		}
-	    }
-
-	/* allocate the depths and sidescan */
-	if (status == MB_SUCCESS
-	    && store != NULL && copy != NULL)
-	    {
-	    if (store->beams_bath > copy->beams_bath_alloc
-		|| copy->beamflag == NULL
-		|| copy->bath == NULL
-		|| copy->bathacrosstrack == NULL
-		|| copy->bathalongtrack == NULL
-		|| copy->tt == NULL
-		|| copy->angle == NULL)
-		{
-		copy->beams_bath_alloc = store->beams_bath;
-		if (copy->beamflag != NULL)
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **) &(copy->beamflag), error);
-		if (copy->bath != NULL)
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **) &(copy->bath), error);
-		if (copy->bathacrosstrack != NULL)
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **) &(copy->bathacrosstrack), error);
-		if (copy->bathalongtrack != NULL)
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **) &(copy->bathalongtrack), error);
-		if (copy->tt != NULL)
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **) &(copy->tt), error);
-		if (copy->angle != NULL)
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **) &(copy->angle), error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,copy->beams_bath_alloc * sizeof(char),
-				    (void **)&(copy->beamflag),error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,copy->beams_bath_alloc * sizeof(float),
-				    (void **)&(copy->bath),error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,copy->beams_bath_alloc * sizeof(float),
-				   (void **) &(copy->bathacrosstrack),error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,copy->beams_bath_alloc * sizeof(float),
-				    (void **)&(copy->bathalongtrack),error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,copy->beams_bath_alloc * sizeof(float),
-				    (void **)&(copy->tt),error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,copy->beams_bath_alloc * sizeof(float),
-				    (void **)&(copy->angle),error);
-		}
-	    if (store->beams_amp > copy->beams_amp_alloc
-		|| copy->amp == NULL)
-		{
-		copy->beams_amp_alloc = store->beams_amp;
-		if (copy->amp != NULL)
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **) &(copy->amp), error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,copy->beams_bath_alloc * sizeof(char),
-				    (void **)&(copy->amp),error);
-		}
-	    if (store->pixels_ss > copy->pixels_ss_alloc
-		|| copy->ss == NULL
-		|| copy->ssacrosstrack == NULL
-		|| copy->ssalongtrack == NULL)
-		{
-		copy->pixels_ss_alloc = store->pixels_ss;
-		if (copy->ss != NULL)
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **) &(copy->ss), error);
-		if (copy->ssacrosstrack != NULL)
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **) &(copy->ssacrosstrack), error);
-		if (copy->ssalongtrack != NULL)
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **) &(copy->ssalongtrack), error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,copy->pixels_ss_alloc * sizeof(float),
-				    (void **)&(copy->ss),error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,copy->pixels_ss_alloc * sizeof(float),
-				    (void **)&(copy->ssacrosstrack),error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,copy->pixels_ss_alloc * sizeof(float),
-				    (void **)&(copy->ssalongtrack),error);
-		}
-	    }
-
-	/* copy the depths and sidescan */
-	if (status == MB_SUCCESS
-	    && store != NULL && copy != NULL)
-	    {
-	    for (i=0;i<copy->beams_bath;i++)
-		{
-		copy->beamflag[i] = store->beamflag[i];
-		copy->bath[i] = store->bath[i];
-		copy->bathacrosstrack[i] = store->bathacrosstrack[i];
-		copy->bathalongtrack[i] = store->bathalongtrack[i];
-		copy->tt[i] = store->tt[i];
-		copy->angle[i] = store->angle[i];
-		}
-	    for (i=0;i<copy->beams_amp;i++)
-		{
-		copy->amp[i] = store->amp[i];
-		}
-	    for (i=0;i<copy->pixels_ss;i++)
-		{
-		copy->ss[i] = store->ss[i];
-		copy->ssacrosstrack[i] = store->ssacrosstrack[i];
-		copy->ssalongtrack[i] = store->ssalongtrack[i];
-		}
-
-	    /* client */
-	    for (i=0;i<store->client_size;i++)
-		copy->client[i] = store->client[i];
-	    }
-
-	/* deal with a memory allocation failure */
-	if (status == MB_FAILURE)
-	    {
-	    for (i=0;i<copy->num_chan;i++)
-		{
-		if (copy->raw[i] != NULL)
-		    status = mb_freed(verbose,__FILE__, __LINE__, (void **) &(copy->raw[i]), error);
-		}
-	    if (copy->beamflag != NULL)
-		status = mb_freed(verbose,__FILE__, __LINE__, (void **) &copy->beamflag, error);
-	    if (copy->bath != NULL)
-		status = mb_freed(verbose,__FILE__, __LINE__, (void **) &copy->bath, error);
-	    if (copy->bathacrosstrack != NULL)
-		status = mb_freed(verbose,__FILE__, __LINE__, (void **) &copy->bathacrosstrack, error);
-	    if (copy->bathalongtrack != NULL)
-		status = mb_freed(verbose,__FILE__, __LINE__, (void **) &copy->bathalongtrack, error);
-	    if (copy->tt != NULL)
-		status = mb_freed(verbose,__FILE__, __LINE__, (void **) &copy->tt, error);
-	    if (copy->angle != NULL)
-		status = mb_freed(verbose,__FILE__, __LINE__, (void **) &copy->angle, error);
-	    if (copy->amp != NULL)
-		status = mb_freed(verbose,__FILE__, __LINE__, (void **) &copy->amp, error);
-	    if (copy->ss != NULL)
-		status = mb_freed(verbose,__FILE__, __LINE__, (void **) &copy->ss, error);
-	    if (copy->ssacrosstrack != NULL)
-		status = mb_freed(verbose,__FILE__, __LINE__, (void **) &copy->ssacrosstrack, error);
-	    if (copy->ssalongtrack != NULL)
-		status = mb_freed(verbose,__FILE__, __LINE__, (void **) &copy->ssalongtrack, error);
-	    if (copy->beamflag != NULL)
-		status = MB_FAILURE;
-	    *error = MB_ERROR_MEMORY_FAIL;
-	    }
-
-	/* print output debug statements */
-	if (verbose >= 2)
-	    {
-	    fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-		    function_name);
-	    fprintf(stderr,"dbg2  Return values:\n");
-	    fprintf(stderr,"dbg2       error:      %d\n",*error);
-	    fprintf(stderr,"dbg2  Return status:\n");
-	    fprintf(stderr,"dbg2       status:     %d\n",status);
-	    }
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mbsys_oic.h b/src/mbio/mbsys_oic.h
deleted file mode 100644
index 13c520f..0000000
--- a/src/mbio/mbsys_oic.h
+++ /dev/null
@@ -1,310 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbsys_oic.h	3/1/99
- *	$Id: mbsys_oic.h 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1999-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbsys_oic.h defines the data structure used by MBIO functions
- * to store swath sonar data derived from OIC systems:
- *      MBF_OICGEODA : MBIO ID 141
- *      MBF_OICMBARI : MBIO ID 142
- *
- * Author:	D. W. Caress
- * Date:	March 1, 1999
- *
- * $Log: mbsys_oic.h,v $
- * Revision 5.5  2005/11/05 00:48:05  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.4  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.3  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.2  2001/07/20 00:32:54  caress
- * Release 5.0.beta03
- *
- * Revision 5.1  2001/01/22  07:43:34  caress
- * Version 5.0.beta01
- *
- * Revision 5.0  2000/12/01  22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.1  2000/09/30  06:31:19  caress
- * Snapshot for Dale.
- *
- * Revision 4.0  1999/03/31  18:29:20  caress
- * MB-System 4.6beta7
- *
- * Revision 1.1  1999/03/31  18:11:35  caress
- * Initial revision
- *
- *
- */
-/*
- * Notes on the MBSYS_OIC data structure:
- *   1. This data structure is used to store swath sonar data
- *      collected and recorded using the GeoDAS-SV1 system
- *      developed and sold by Ocean Imaging Consultants.
- *      In particular, the Deep Submergence Lab (DSL) of
- *      the Woods Hole Oceanographic Institution (WHOI) now
- *      uses an OIC GeoDAS-SV1 package as the front end for
- *      their deep towed 120 kHz interferometry sonar (AMS-120).
- *   2. Two data formats are supported. The first, MBF_OICGEODA,
- *      is the vendor format containing unflaggable bathymetry
- *      and raw sidescan. The MBIO i/o module for this format
- *      generates complete bathymetry and sidescan out of the
- *      raw information, but does not support flagging of bad
- *      bathymetry or the storage of corrected sidescan.
- *      The second,  MBF_OICMBARI, is intended as a processing
- *      and archiving format as it allows the storage of both
- *      the unaltered raw values and editable and correctable
- *      bathymetry and sidescan.
- *   3. In both formats the  data consist of variable length
- *      binary records.
- *   4. Each data record has three parts.  First there is a 248-byte
- *      header section containing the time stamp, navigation, a
- *      variety of other values, the numbers and sizes of sonar
- *      data included in the record.  The second, optional, part of
- *      the record is "client specific information" of arbitrary
- *      length. The third part contains up to eight arrays of
- *      "raw" sonar data followed by, in the MBF_OICMBARI format,
- *      arrays of processing bathymetry and sidescan.
- *   5. The header begins with a four byte magic number. For the
- *      MBF_OICGEODA format the first three bytes are 'G', 'E',
- *      and 'O'. For the MBF_OICMBARI format the first three bytes
- *      are 'G', 'E', and '2'.The fourth byte is the id number for
- *      the data source.
- *   6. The maximum numbers of beams and pixels defined below are
- *      limitations specific to MBIO - the formats themselves
- *      contain no limits on the amount of data per record.
- *   7. Comment records are encoded in MBIO using the "client
- *      specific information" section of the record and an unused
- *      sonar type value.
- *
- */
-
-/* defines sizes of things */
-#define	MBSYS_OIC_MAX_CLIENT		252
-#define	MBSYS_OIC_MAX_COMMENT		MBSYS_OIC_MAX_CLIENT
-#define	MBSYS_OIC_MAX_CHANNELS		8
-
-/* define maximum number of beams */
-#define	MBSYS_OIC_MAX_BEAMS		1024
-#define	MBSYS_OIC_MAX_PIXELS		2048
-
-/* define sonar types */
-#define	OIC_ID_EGANDG			0
-#define	OIC_ID_SEAVIEW			1
-#define	OIC_ID_DEEPSCAN			2
-#define	OIC_ID_STEST			3
-#define	OIC_ID_QMIPS			4
-#define	OIC_ID_SEAMARC2			5
-#define	OIC_ID_DSLAMS120		22
-#define	OIC_ID_DSLAMS200		23
-#define	OIC_ID_COMMENT			255
-
-/* define nav types */
-#define	OIC_NAV_UTM			0
-#define	OIC_NAV_LOCAL			1
-#define	OIC_NAV_LONLAT			2
-
-/* define sonar data types */
-#define	OIC_TYPE_SIDESCAN		0
-#define	OIC_TYPE_ANGLE			1
-#define	OIC_TYPE_MULTIBEAM		2
-
-/* define side */
-#define	OIC_PORT			0
-#define	OIC_STARBOARD			1
-#define	OIC_SUBBOTTOM			2
-
-/* define sonar data sizes */
-#define	OIC_SIZE_CHAR			0
-#define	OIC_SIZE_SHORT			1
-#define	OIC_SIZE_INT			2
-#define	OIC_SIZE_FLOAT			3
-#define	OIC_SIZE_3FLOAT			4
-
-struct mbsys_oic_channel_struct
-	{
-	int		offset;		/* offset in bytes to channel data */
-	mb_u_char	type;		/* sonar type:
-					    0 = sidescan
-					    1 = angle
-					    2 = multibeam */
-	mb_u_char	side;		/* sonar side:
-					    0 = port
-					    1 = starboard */
-	mb_u_char	size;		/* data sample type and size:
-					    0 = 1 byte integer
-					    1 = 2 byte integer
-					    2 = 4 byte integer
-					    3 = 4 byte float
-					    4 = 12 byte set of three
-						floats - range, theta, amp */
-	mb_u_char	empty;		/* spare */
-	int		frequency;	/* Hz */
-	int		num_samples;	/* number of samples stored for
-					    sidescan and angle sonar types,
-					    number of beams for multibeam */
-	};
-
-struct mbsys_oic_seaview_struct
-	{
-	double		longitude;	/* longitude in degrees */
-	double		latitude;	/* latitude in degrees */
-	int		x;		/* local x coordinates in yards */
-	int		y;		/* local y coordinates in yards */
-	int		uncertainty;	/* navigation uncertainty in yards */
-	float		speed;		/* speed over ground in knots */
-	float		altitude;	/* platform altitude in feet */
-	float		depth;		/* platform depth in feet */
-	float		sound_velocity;	/* sound velocity in feet/sec */
-	char		id[20];		/* client id string */
-	};
-
-struct mbsys_oic_struct
-	{
-	int		kind;
-	mb_u_char	type;		/* Magic number:
-					    0 - EG&G sonar
-					    1 - SEAVIEW sonar
-					    2 - DEEPSCAN sonar
-					    3 - STEST SEAVIEW test
-					    4 - QTEST QMIPs test
-					    5 - SM2 SeaMARC2 test
-					    22 - WHOI DSL AMS120 */
-	int		proc_status;	/* OIC processing status in
-					    bit mask form */
-	int		data_size;
-	mb_u_char	client_size;
-	mb_u_char	fish_status;	/* status bit field:
-						0:  FocusAutoManual
-						1:  FocusManualDisableEnable
-						2:  PingRate AutoManual
-						3:  TvgAutoManual
-						4:  CalibOffOn
-						5:  OutputModeProcRaw
-						6:  ShadowMask
-						7:  QualityBit */
-	mb_s_char	nav_used;
-	mb_s_char	nav_type;	/*  0 = UTM coordinates in m
-					    1 = Local coordinates in m
-					    2 = Latitude and longitude */
-	int		utm_zone;
-	float		ship_x;		/* meters or degrees  */
-	float		ship_y;		/* meters or degrees  */
-	float		ship_course;	/* degrees */
-	float		ship_speed;	/* m/sec */
-	int		sec;
-	int		usec;
-	float		spare_gain;
-	float		fish_heading;	/* degrees */
-	float		fish_depth;	/* meters */
-	float		fish_range;	/* meters */
-	float		fish_pulse_width;   /* msec */
-	float		gain_c0;
-	float		gain_c1;
-	float		gain_c2;
-	float		fish_pitch;	/* degrees */
-	float		fish_roll;	/* degrees */
-	float		fish_yaw;	/* degrees */
-	float		fish_x;		/* meters or degrees  */
-	float		fish_y;		/* meters or degrees  */
-	float		fish_layback;	/* meters */
-	float		fish_altitude;	/* meters */
-	int		fish_altitude_samples;
-	float		fish_ping_period;   /* seconds per ping */
-	float		sound_velocity;	/* m/sec */
-	int		num_chan;
-	int		beams_bath;
-	int		beams_amp;
-	int		bath_chan_port;
-	int		bath_chan_stbd;
-	int		pixels_ss;
-	int		ss_chan_port;
-	int		ss_chan_stbd;
-	struct mbsys_oic_channel_struct channel[MBSYS_OIC_MAX_CHANNELS];
-	char	client[MBSYS_OIC_MAX_CLIENT];
-	int		rawsize[MBSYS_OIC_MAX_CHANNELS];
-	char		*raw[MBSYS_OIC_MAX_CHANNELS];
-	int		beams_bath_alloc;
-	int		beams_amp_alloc;
-	int		pixels_ss_alloc;
-	char		*beamflag;
-	float		*bath;
-	float		*amp;
-	float		*bathacrosstrack;
-	float		*bathalongtrack;
-	float		*tt;
-	float		*angle;
-	float		*ss;
-	float		*ssacrosstrack;
-	float		*ssalongtrack;
-	};
-
-/* system specific function prototypes */
-int mbsys_oic_alloc(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error);
-int mbsys_oic_deall(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error);
-int mbsys_oic_dimensions(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int *nbath, int *namp, int *nss, int *error);
-int mbsys_oic_extract(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int time_i[7], double *time_d,
-			double *navlon, double *navlat,
-			double *speed, double *heading,
-			int *nbath, int *namp, int *nss,
-			char *beamflag, double *bath, double *amp,
-			double *bathacrosstrack, double *bathalongtrack,
-			double *ss, double *ssacrosstrack, double *ssalongtrack,
-			char *comment, int *error);
-int mbsys_oic_insert(int verbose, void *mbio_ptr, void *store_ptr,
-			int kind, int time_i[7], double time_d,
-			double navlon, double navlat,
-			double speed, double heading,
-			int nbath, int namp, int nss,
-			char *beamflag, double *bath, double *amp,
-			double *bathacrosstrack, double *bathalongtrack,
-			double *ss, double *ssacrosstrack, double *ssalongtrack,
-			char *comment, int *error);
-int mbsys_oic_ttimes(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int *nbeams,
-			double *ttimes, double *angles,
-			double *angles_forward, double *angles_null,
-			double *heave, double *alongtrack_offset,
-			double *draft, double *ssv, int *error);
-int mbsys_oic_detects(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int *nbeams, int *detects, int *error);
-int mbsys_oic_extract_altitude(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, double *transducer_depth, double *altitude,
-			int *error);
-int mbsys_oic_insert_altitude(int verbose, void *mbio_ptr, void *store_ptr,
-			double transducer_depth, double altitude,
-			int *error);
-int mbsys_oic_extract_nav(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int time_i[7], double *time_d,
-			double *navlon, double *navlat,
-			double *speed, double *heading, double *draft,
-			double *roll, double *pitch, double *heave,
-			int *error);
-int mbsys_oic_insert_nav(int verbose, void *mbio_ptr, void *store_ptr,
-			int time_i[7], double time_d,
-			double navlon, double navlat,
-			double speed, double heading, double draft,
-			double roll, double pitch, double heave,
-			int *error);
-int mbsys_oic_copy(int verbose, void *mbio_ptr,
-			void *store_ptr, void *copy_ptr,
-			int *error);
diff --git a/src/mbio/mbsys_reson.c b/src/mbio/mbsys_reson.c
deleted file mode 100644
index 08bacde..0000000
--- a/src/mbio/mbsys_reson.c
+++ /dev/null
@@ -1,1747 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbsys_reson.c	3.00	8/20/94
- *	$Id: mbsys_reson.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1994-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbsys_reson.c contains the functions for handling the data structure
- * used by MBIO functions to store data from Reson SEABAT multibeam
- * sonar systems, including the 9001, 9002, and 8101 sonars.
- * The data formats which are commonly used to store Reson SeaBat
- * data in files include
- *      MBF_CBAT9001/9002 : MBIO ID 81
- *      MBF_CBAT8101 : MBIO ID 82/83
- *
- * Author:	D. W. Caress
- * Date:	August 20, 1994
- *
- * $Log: mbsys_reson.c,v $
- * Revision 5.7  2005/11/05 00:48:03  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.6  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.5  2003/01/15 20:51:48  caress
- * Release 5.0.beta28
- *
- * Revision 5.4  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.3  2001/08/25 00:57:48  caress
- * Adding beamwidth values to extract functions.
- *
- * Revision 5.2  2001/07/20  00:32:54  caress
- * Release 5.0.beta03
- *
- * Revision 5.1  2001/01/22  07:43:34  caress
- * Version 5.0.beta01
- *
- * Revision 5.0  2000/12/01  22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.17  2000/10/11  01:03:21  caress
- * Convert to ANSI C
- *
- * Revision 4.16  2000/09/30  06:32:52  caress
- * Snapshot for Dale.
- *
- * Revision 4.15  1999/08/16  23:14:41  caress
- * Added ability to handle Mesotech SM2000 data
- *
- * Revision 4.14  1999/03/31  18:11:35  caress
- * MB-System 4.6beta7
- *
- * Revision 4.13  1999/01/01  23:41:06  caress
- * MB-System version 4.6beta6
- *
- * Revision 4.12  1998/10/05 17:46:15  caress
- * MB-System version 4.6beta
- *
- * Revision 4.11  1997/07/25  14:19:53  caress
- * Version 4.5beta2.
- * Much mucking, particularly with Simrad formats.
- *
- * Revision 4.10  1997/04/21  17:02:07  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.9  1996/08/05  15:21:58  caress
- * Just redid i/o for Simrad sonars, including adding EM12S and EM121 support.
- *
- * Revision 4.9  1996/08/05  15:21:58  caress
- * Just redid i/o for Simrad sonars, including adding EM12S and EM121 support.
- *
- * Revision 4.8  1996/04/22  13:21:19  caress
- * Now have DTR and MIN/MAX defines in mb_define.h
- *
- * Revision 4.7  1996/04/22  10:57:09  caress
- * DTR define now in mb_io.h
- *
- * Revision 4.6  1995/11/27  21:52:10  caress
- * New version of mb_ttimes with ssv and angles_null.
- *
- * Revision 4.5  1995/09/28  18:10:48  caress
- * Various bug fixes working toward release 4.3.
- *
- * Revision 4.4  1995/08/17  14:41:09  caress
- * Revision for release 4.3.
- *
- * Revision 4.3  1995/07/13  21:41:13  caress
- * Check in in midst of general bug fixing flail.
- *
- * Revision 4.2  1995/03/06  19:38:54  caress
- * Changed include strings.h to string.h for POSIX compliance.
- *
- * Revision 4.1  1994/11/09  21:40:34  caress
- * Changed ttimes extraction routines to handle forward beam angles
- * so that alongtrack distances can be calculated.
- *
- * Revision 4.0  1994/10/21  12:35:00  caress
- * Release V4.0
- *
- * Revision 1.1  1994/10/21  12:20:01  caress
- * Initial revision
- *
- *
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mb_define.h"
-#include "mbsys_reson.h"
-
-static char rcs_id[]="$Id: mbsys_reson.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mbsys_reson_alloc(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_reson_alloc";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_reson_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* allocate memory for data structure */
-	status = mb_malloc(verbose,sizeof(struct mbsys_reson_struct),
-				store_ptr,error);
-
-	/* get data structure pointer */
-	store = (struct mbsys_reson_struct *) *store_ptr;
-
-	/* initialize everything */
-	store->kind = MB_DATA_NONE;
-	store->sonar = MBSYS_RESON_UNKNOWN;
-
-	/* parameter telegram */
-	store->par_year = 0;
-	store->par_month = 0;
-	store->par_day = 0;
-	store->par_hour = 0;
-	store->par_minute = 0;
-	store->par_second = 0;
-	store->par_hundredth_sec = 0;
-	store->par_thousandth_sec = 0;
-	store->roll_offset = 0;	/* roll offset (degrees) */
-	store->pitch_offset = 0;	/* pitch offset (degrees) */
-	store->heading_offset = 0;	/* heading offset (degrees) */
-	store->time_delay = 0;		/* positioning system delay (sec) */
-	store->transducer_depth = 0;	/* tranducer depth (meters) */
-	store->transducer_height = 0;	/* reference height (meters) */
-	store->transducer_x = 0;	/* reference fore-aft offset (meters) */
-	store->transducer_y = 0;	/* reference athwartships
-						offset (meters) */
-	store->antenna_x = 0;		/* antenna athwartships
-						offset (meters) */
-	store->antenna_y = 0;		/* antenna athwartships
-						offset (meters) */
-	store->antenna_z = 0;		/* antenna height (meters) */
-	store->motion_sensor_x = 0;	/* motion sensor
-						athwartships offset (meters) */
-	store->motion_sensor_y = 0;	/* motion sensor
-						athwartships offset (meters) */
-	store->motion_sensor_z = 0;	/* motion sensor
-						height offset (meters) */
-	store->spare = 0;
-	store->line_number = 0;
-	store->start_or_stop = 0;
-	store->transducer_serial_number = 0;
-	for (i=0;i<MBSYS_RESON_COMMENT_LENGTH;i++)
-		store->comment[i] = '\0';
-
-	/* position (position telegrams) */
-	store->pos_year = 0;
-	store->pos_month = 0;
-	store->pos_day = 0;
-	store->pos_hour = 0;
-	store->pos_minute = 0;
-	store->pos_second = 0;
-	store->pos_hundredth_sec = 0;
-	store->pos_thousandth_sec = 0;
-	store->pos_latitude = 0;
-	store->pos_longitude = 0;
-	store->utm_northing = 0;
-	store->utm_easting = 0;
-	store->utm_zone_lon = 0;
-	store->utm_zone = 0;
-	store->hemisphere = 0;
-	store->ellipsoid = 0;
-	store->pos_spare = 0;
-	store->semi_major_axis = 0;
-	store->other_quality = 0;
-
-	/* sound velocity profile */
-	store->svp_year = 0;
-	store->svp_month = 0;
-	store->svp_day = 0;
-	store->svp_hour = 0;
-	store->svp_minute = 0;
-	store->svp_second = 0;
-	store->svp_hundredth_sec = 0;
-	store->svp_thousandth_sec = 0;
-	store->svp_num = 0;
-	for (i=0;i<500;i++)
-		{
-		store->svp_depth[i] = 0; /* 0.1 meters */
-		store->svp_vel[i] = 0;	/* 0.1 meters/sec */
-		}
-
-	/* time stamp */
-	store->year = 0;
-	store->month = 0;
-	store->day = 0;
-	store->hour = 0;
-	store->minute = 0;
-	store->second = 0;
-	store->hundredth_sec = 0;
-	store->thousandth_sec = 0;
-	store->roll = 0;
-	store->pitch = 0;
-	store->heading = 0;
-	store->heave = 0;
-	store->ping_number = 0;
-	store->sound_vel = 0;
-	store->mode = 0;
-	store->gain1 = 0;
-	store->gain2 = 0;
-	store->gain3 = 0;
-	store->beams_bath = MBSYS_RESON_MAXBEAMS;
-	for (i=0;i<MBSYS_RESON_MAXBEAMS;i++)
-		{
-		store->bath[i] = 0;
-		store->bath_acrosstrack[i] = 0;
-		store->bath_alongtrack[i] = 0;
-		store->tt[i] = 0;
-		store->angle[i] = 0;
-		store->quality[i] = 0;
-		store->amp[i] = 0;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)*store_ptr);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_reson_deall(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_reson_deall";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)*store_ptr);
-		}
-
-	/* deallocate memory for data structure */
-	status = mb_free(verbose,store_ptr,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_reson_dimensions(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int *nbath, int *namp, int *nss, int *error)
-{
-	char	*function_name = "mbsys_reson_dimensions";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_reson_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_reson_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get beam and pixel numbers */
-		*nbath = store->beams_bath;
-		*namp = store->beams_bath;
-		*nss = 0;
-		}
-	else
-		{
-		/* get beam and pixel numbers */
-		*nbath = 0;
-		*namp = 0;
-		*nss = 0;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		fprintf(stderr,"dbg2       nbath:      %d\n",*nbath);
-		fprintf(stderr,"dbg2        namp:      %d\n",*namp);
-		fprintf(stderr,"dbg2        nss:       %d\n",*nss);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_reson_extract(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int time_i[7], double *time_d,
-		double *navlon, double *navlat,
-		double *speed, double *heading,
-		int *nbath, int *namp, int *nss,
-		char *beamflag, double *bath, double *amp,
-		double *bathacrosstrack, double *bathalongtrack,
-		double *ss, double *ssacrosstrack, double *ssalongtrack,
-		char *comment, int *error)
-{
-	char	*function_name = "mbsys_reson_extract";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_reson_struct *store;
-	double	depthscale, dacrscale, daloscale,reflscale;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_reson_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get time */
-		mb_fix_y2k(verbose, store->year, &time_i[0]);
-		time_i[1] = store->month;
-		time_i[2] = store->day;
-		time_i[3] = store->hour;
-		time_i[4] = store->minute;
-		time_i[5] = store->second;
-		time_i[6] = 10000*store->hundredth_sec
-			+ 100*store->thousandth_sec;
-		mb_get_time(verbose,time_i,time_d);
-
-		/* get navigation */
-		*navlon = store->longitude*0.00000009;
-		*navlat = store->latitude*0.00000009;
-
-		/* get heading */
-		*heading = 0.01*store->heading;
-
-		/* get speed  */
-		*speed = 0.0;
-
-		/* set beamwidths in mb_io structure */
-		mb_io_ptr->beamwidth_ltrack = 1.5;
-		mb_io_ptr->beamwidth_xtrack = 1.5;
-
-		/* read distance and depth values into storage arrays */
-		*nbath = store->beams_bath;
-		*namp = store->beams_bath;
-		*nss = 0;
-		depthscale = 0.01;
-		dacrscale  = 0.01;
-		daloscale  = 0.01;
-		reflscale  = 1.0;
-		for (i=0;i<*nbath;i++)
-			{
-			if (store->quality[i] == 0
-			    || store->bath[i] == 0)
-			    {
-			    beamflag[i] = MB_FLAG_NULL;
-			    bath[i] = depthscale*store->bath[i];
-			    }
-			else if (store->quality[i] >= 3)
-			    {
-			    beamflag[i] = MB_FLAG_NONE;
-			    bath[i] = depthscale*store->bath[i];
-			    }
-			else
-			    {
-			    beamflag[i]
-				= MB_FLAG_MANUAL + MB_FLAG_FLAG;
-			    bath[i] = depthscale*store->bath[i];
-			    }
-			bathacrosstrack[i]
-				= dacrscale*store->bath_acrosstrack[i];
-			bathalongtrack[i]
-				= daloscale*store->bath_alongtrack[i];
-			}
-		for (i=0;i<*namp;i++)
-			{
-			amp[i] = reflscale*store->amp[i];
-			}
-
-		/* print debug statements */
-		if (verbose >= 5)
-			{
-			fprintf(stderr,"\ndbg4  Data extracted by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  Extracted values:\n");
-			fprintf(stderr,"dbg4       kind:       %d\n",
-				*kind);
-			fprintf(stderr,"dbg4       error:      %d\n",
-				*error);
-			fprintf(stderr,"dbg4       time_i[0]:  %d\n",
-				time_i[0]);
-			fprintf(stderr,"dbg4       time_i[1]:  %d\n",
-				time_i[1]);
-			fprintf(stderr,"dbg4       time_i[2]:  %d\n",
-				time_i[2]);
-			fprintf(stderr,"dbg4       time_i[3]:  %d\n",
-				time_i[3]);
-			fprintf(stderr,"dbg4       time_i[4]:  %d\n",
-				time_i[4]);
-			fprintf(stderr,"dbg4       time_i[5]:  %d\n",
-				time_i[5]);
-			fprintf(stderr,"dbg4       time_i[6]:  %d\n",
-				time_i[6]);
-			fprintf(stderr,"dbg4       time_d:     %f\n",
-				*time_d);
-			fprintf(stderr,"dbg4       longitude:  %f\n",
-				*navlon);
-			fprintf(stderr,"dbg4       latitude:   %f\n",
-				*navlat);
-			fprintf(stderr,"dbg4       speed:      %f\n",
-				*speed);
-			fprintf(stderr,"dbg4       heading:    %f\n",
-				*heading);
-			fprintf(stderr,"dbg4       nbath:      %d\n",
-				*nbath);
-			for (i=0;i<*nbath;i++)
-			  fprintf(stderr,"dbg4       beam:%d  flag:%3d  bath:%f  acrosstrack:%f  alongtrack:%f\n",
-				i,beamflag[i],bath[i],
-				bathacrosstrack[i],bathalongtrack[i]);
-			fprintf(stderr,"dbg4        namp:     %d\n",
-				*namp);
-			for (i=0;i<*namp;i++)
-			  fprintf(stderr,"dbg4        beam:%d   amp:%f  acrosstrack:%f  alongtrack:%f\n",
-				i,amp[i],bathacrosstrack[i],bathalongtrack[i]);
-			}
-
-		/* done translating values */
-
-		}
-
-	/* extract nav from structure */
-	else if (*kind == MB_DATA_NAV)
-		{
-		/* get time */
-		mb_fix_y2k(verbose, store->pos_year, &time_i[0]);
-		time_i[1] = store->pos_month;
-		time_i[2] = store->pos_day;
-		time_i[3] = store->pos_hour;
-		time_i[4] = store->pos_minute;
-		time_i[5] = store->pos_second;
-		time_i[6] = 10000*store->pos_hundredth_sec
-			+ 100*store->pos_thousandth_sec;
-		mb_get_time(verbose,time_i,time_d);
-
-		/* get navigation */
-		*navlon = store->pos_longitude*0.00000009;
-		*navlat = store->pos_latitude*0.00000009;
-
-		/* get heading */
-		*heading = 0.01*store->heading;
-
-		/* get speed  */
-		*speed = 0.0;
-
-		/* read distance and depth values into storage arrays */
-		*nbath = 0;
-		*namp = 0;
-		*nss = 0;
-
-		/* print debug statements */
-		if (verbose >= 5)
-			{
-			fprintf(stderr,"\ndbg4  Data extracted by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  Extracted values:\n");
-			fprintf(stderr,"dbg4       kind:       %d\n",
-				*kind);
-			fprintf(stderr,"dbg4       error:      %d\n",
-				*error);
-			fprintf(stderr,"dbg4       time_i[0]:  %d\n",
-				time_i[0]);
-			fprintf(stderr,"dbg4       time_i[1]:  %d\n",
-				time_i[1]);
-			fprintf(stderr,"dbg4       time_i[2]:  %d\n",
-				time_i[2]);
-			fprintf(stderr,"dbg4       time_i[3]:  %d\n",
-				time_i[3]);
-			fprintf(stderr,"dbg4       time_i[4]:  %d\n",
-				time_i[4]);
-			fprintf(stderr,"dbg4       time_i[5]:  %d\n",
-				time_i[5]);
-			fprintf(stderr,"dbg4       time_i[6]:  %d\n",
-				time_i[6]);
-			fprintf(stderr,"dbg4       time_d:     %f\n",
-				*time_d);
-			fprintf(stderr,"dbg4       longitude:  %f\n",
-				*navlon);
-			fprintf(stderr,"dbg4       latitude:   %f\n",
-				*navlat);
-			fprintf(stderr,"dbg4       speed:      %f\n",
-				*speed);
-			fprintf(stderr,"dbg4       heading:    %f\n",
-				*heading);
-			}
-
-		/* done translating values */
-
-		}
-
-	/* extract comment from structure */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* copy comment */
-		strcpy(comment,store->comment);
-
-		/* print debug statements */
-		if (verbose >= 4)
-			{
-			fprintf(stderr,"\ndbg4  New ping read by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  New ping values:\n");
-			fprintf(stderr,"dbg4       error:      %d\n",
-				*error);
-			fprintf(stderr,"dbg4       comment:    %s\n",
-				comment);
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind == MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"dbg2       comment:     \ndbg2       %s\n",
-			comment);
-		}
-	else if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind != MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"dbg2       time_i[0]:     %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:     %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:     %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:     %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:     %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:     %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:     %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:        %f\n",*time_d);
-		fprintf(stderr,"dbg2       longitude:     %f\n",*navlon);
-		fprintf(stderr,"dbg2       latitude:      %f\n",*navlat);
-		fprintf(stderr,"dbg2       speed:         %f\n",*speed);
-		fprintf(stderr,"dbg2       heading:       %f\n",*heading);
-		}
-	if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind == MB_DATA_DATA)
-		{
-		fprintf(stderr,"dbg2       nbath:      %d\n",
-			*nbath);
-		for (i=0;i<*nbath;i++)
-		  fprintf(stderr,"dbg2       beam:%d  flag:%3d  bath:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,beamflag[i],bath[i],
-			bathacrosstrack[i],bathalongtrack[i]);
-		fprintf(stderr,"dbg2        namp:     %d\n",
-			*namp);
-		for (i=0;i<*namp;i++)
-		  fprintf(stderr,"dbg2       beam:%d   amp:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,amp[i],bathacrosstrack[i],bathalongtrack[i]);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_reson_insert(int verbose, void *mbio_ptr, void *store_ptr,
-		int kind, int time_i[7], double time_d,
-		double navlon, double navlat,
-		double speed, double heading,
-		int nbath, int namp, int nss,
-		char *beamflag, double *bath, double *amp,
-		double *bathacrosstrack, double *bathalongtrack,
-		double *ss, double *ssacrosstrack, double *ssalongtrack,
-		char *comment, int *error)
-{
-	char	*function_name = "mbsys_reson_insert";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_reson_struct *store;
-	double	depthscale, dacrscale,daloscale,reflscale;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       kind:       %d\n",kind);
-		}
-	if (verbose >= 2 && (kind == MB_DATA_DATA || kind == MB_DATA_NAV))
-		{
-		fprintf(stderr,"dbg2       time_i[0]:  %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:  %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:  %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:  %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:  %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:  %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:  %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:     %f\n",time_d);
-		fprintf(stderr,"dbg2       navlon:     %f\n",navlon);
-		fprintf(stderr,"dbg2       navlat:     %f\n",navlat);
-		fprintf(stderr,"dbg2       speed:      %f\n",speed);
-		fprintf(stderr,"dbg2       heading:    %f\n",heading);
-		}
-	if (verbose >= 2 && kind == MB_DATA_DATA)
-		{
-		fprintf(stderr,"dbg2       nbath:      %d\n",nbath);
-		if (verbose >= 3)
-		 for (i=0;i<nbath;i++)
-		  fprintf(stderr,"dbg3       beam:%d  flag:%3d  bath:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,beamflag[i],bath[i],
-			bathacrosstrack[i],bathalongtrack[i]);
-		fprintf(stderr,"dbg2       namp:       %d\n",namp);
-		if (verbose >= 3)
-		 for (i=0;i<namp;i++)
-		  fprintf(stderr,"dbg3        beam:%d   amp:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,amp[i],bathacrosstrack[i],bathalongtrack[i]);
-		}
-	if (verbose >= 2 && kind == MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"dbg2       comment:     \ndbg2       %s\n",
-			comment);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_reson_struct *) store_ptr;
-
-	/* set data kind */
-	store->kind = kind;
-
-	/* insert data in structure */
-	if (store->kind == MB_DATA_DATA)
-		{
-		/* get time */
-		mb_unfix_y2k(verbose, time_i[0], &store->year);
-		store->month = time_i[1];
-		store->day = time_i[2];
-		store->hour = time_i[3];
-		store->minute = time_i[4];
-		store->second = time_i[5];
-		store->hundredth_sec = time_i[6]/10000;
-		store->thousandth_sec =
-			(time_i[6] - 10000*store->hundredth_sec)/100;
-
-		/*get navigation */
-		store->longitude = (int) (navlon/0.00000009);
-		store->latitude = (int) (navlat/0.00000009);
-
-		/* get heading */
-		store->heading = (int) (heading * 100);
-
-		/* insert distance and depth values into storage arrays */
-		store->beams_bath = nbath;
-		depthscale = 0.01;
-		dacrscale  = 0.01;
-		daloscale  = 0.01;
-		reflscale  = 1.0;
-		for (i=0;i<nbath;i++)
-			{
-			if (beamflag[i]
-			    == MB_FLAG_NULL)
-			    {
-			    store->bath[i] = bath[i]/depthscale;
-			    store->quality[i] = 0;
-			    }
-			else if (mb_beam_check_flag(beamflag[i]))
-			    {
-			    store->bath[i] = bath[i]/depthscale;
-			    store->quality[i] = 1;
-			    }
-			else
-			    {
-			    store->bath[i] = bath[i]/depthscale;
-			    store->quality[i] = 3;
-			    }
-			store->bath_acrosstrack[i]
-				= bathacrosstrack[i]/dacrscale;
-			store->bath_alongtrack[i]
-				= bathalongtrack[i]/daloscale;
-			}
-		for (i=0;i<namp;i++)
-			{
-			store->amp[i] = amp[i]/reflscale;
-			}
-		}
-
-	/* insert nav in structure */
-	else if (store->kind == MB_DATA_NAV)
-		{
-		/* get time */
-		mb_unfix_y2k(verbose, time_i[0], &store->pos_year);
-		store->pos_month = time_i[1];
-		store->pos_day = time_i[2];
-		store->pos_hour = time_i[3];
-		store->pos_minute = time_i[4];
-		store->pos_second = time_i[5];
-		store->pos_hundredth_sec = time_i[6]/10000;
-		store->pos_thousandth_sec =
-			(time_i[6] - 10000*store->pos_hundredth_sec)/100;
-
-		/*get navigation */
-		store->pos_longitude = (int) (navlon/0.00000009);
-		store->pos_latitude = (int) (navlat/0.00000009);
-
-		/* get heading */
-		store->heading = (int) (heading * 100);
-		}
-
-	/* insert comment in structure */
-	else if (store->kind == MB_DATA_COMMENT)
-		{
-		strncpy(store->comment,comment,199);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_reson_ttimes(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, int *nbeams,
-	double *ttimes, double *angles,
-	double *angles_forward, double *angles_null,
-	double *heave, double *alongtrack_offset,
-	double *draft, double *ssv, int *error)
-{
-	char	*function_name = "mbsys_reson_ttimes";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_reson_struct *store;
-	double	ttscale, angscale;
-	double	heave_use;
-	double	angle, pitch;
-	int	icenter, anglemin;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       ttimes:     %p\n",(void *)ttimes);
-		fprintf(stderr,"dbg2       angles_xtrk:%p\n",(void *)angles);
-		fprintf(stderr,"dbg2       angles_ltrk:%p\n",(void *)angles_forward);
-		fprintf(stderr,"dbg2       angles_null:%p\n",(void *)angles_null);
-		fprintf(stderr,"dbg2       heave:      %p\n",(void *)heave);
-		fprintf(stderr,"dbg2       ltrk_off:   %p\n",(void *)alongtrack_offset);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_reson_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get nbeams */
-		*nbeams = store->beams_bath;
-
-		/* get depth offset (heave + transducer_depth) */
-		heave_use = 0.001 * store->heave;
-		*draft = 0.001 * store->transducer_depth;
-		*ssv = 0.1 * store->sound_vel;
-
-		/* get first starboard angle */
-		icenter = 0;
-		anglemin = 32000;
-		for (i=0;i<*nbeams;i++)
-			{
-			if (store->angle[i] != 0
-			    && store->angle[i] < anglemin)
-			    {
-			    anglemin = store->angle[i];
-			    icenter = i;
-			    }
-			}
-		if (icenter > 0
-		    && icenter < *nbeams - 1)
-		    {
-		    if (store->angle[icenter+1] < store->angle[icenter-1])
-			icenter++;
-		    }
-
-		/* get travel times, angles */
-		ttscale = 0.00001;
-		angscale = 0.005;
-		for (i=0;i<*nbeams;i++)
-			{
-			ttimes[i] = ttscale * store->tt[i];
-			if (i < icenter)
-			    angle = 90.0 + angscale * store->angle[i];
-			else
-			    angle = 90.0 - angscale * store->angle[i];
-			pitch = angscale * store->pitch;
-			mb_rollpitch_to_takeoff(
-				verbose, pitch, angle,
-				&angles[i],
-				&angles_forward[i], error);
-			angles_null[i] = angles[i];
-			heave[i] = heave_use;
-			alongtrack_offset[i] = 0.0;
-			}
-
-		/* set status */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error == MB_ERROR_NO_ERROR)
-		{
-		fprintf(stderr,"dbg2       draft:      %f\n",*draft);
-		fprintf(stderr,"dbg2       ssv:        %f\n",*ssv);
-		fprintf(stderr,"dbg2       nbeams:     %d\n",*nbeams);
-		for (i=0;i<*nbeams;i++)
-			fprintf(stderr,"dbg2       beam %d: tt:%f  angle_xtrk:%f  angle_ltrk:%f  angle_null:%f  heave:%f  ltrk_off:%f\n",
-				i,ttimes[i],angles[i],
-				angles_forward[i],angles_null[i],
-				heave[i],alongtrack_offset[i]);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_reson_detects(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, int *nbeams,
-	int *detects, int *error)
-{
-	char	*function_name = "mbsys_reson_detects";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_reson_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       detects:    %p\n",(void *)detects);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_reson_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get nbeams */
-		*nbeams = store->beams_bath;
-
-		/* get detects */
-		for (i=0;i<*nbeams;i++)
-			{
-			detects[i] = MB_DETECT_AMPLITUDE;
-			}
-
-		/* set status */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error == MB_ERROR_NO_ERROR)
-		{
-		fprintf(stderr,"dbg2       nbeams:     %d\n",*nbeams);
-		for (i=0;i<*nbeams;i++)
-			fprintf(stderr,"dbg2       beam %d: detects:%d\n",
-				i,detects[i]);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_reson_extract_altitude(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, double *transducer_depth, double *altitude,
-	int *error)
-{
-	char	*function_name = "mbsys_reson_extract_altitude";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_reson_struct *store;
-	double	depthscale;
-	double	dacrscale;
-	double	bath_best;
-	double	xtrack_min;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_reson_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		bath_best = 0.0;
-		depthscale = 0.01;
-		dacrscale  = 0.01;
-		if (store->bath[store->beams_bath/2] != 0
-		    && store->quality[store->beams_bath/2] >= 3)
-		    bath_best = depthscale
-				* store->bath[store->beams_bath/2];
-		else
-		    {
-		    xtrack_min = 99999999.9;
-		    for (i=0;i<store->beams_bath;i++)
-			{
-			if (store->bath[i] != 0
-			    && store->quality[i] >= 3
-			    && fabs(store->bath_acrosstrack[i]) < xtrack_min)
-			    {
-			    xtrack_min = fabs(dacrscale * store->bath_acrosstrack[i]);
-			    bath_best = depthscale * store->bath[i];
-			    }
-			}
-		    }
-		if (bath_best == 0.0)
-		    {
-		    xtrack_min = 99999999.9;
-		    for (i=0;i<store->beams_bath;i++)
-			{
-			if (store->quality[i] > 0
-			    && store->quality[i] < 3
-			    && fabs(dacrscale * store->bath_acrosstrack[i]) < xtrack_min)
-			    {
-			    xtrack_min = fabs(dacrscale * store->bath_acrosstrack[i]);
-			    bath_best = depthscale * store->bath[i];
-			    }
-			}
-		    }
-		*transducer_depth = 0.001 * store->transducer_depth
-				    + 0.001 * store->heave;
-		*altitude = bath_best - *transducer_depth;
-
-		/* set status */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:              %d\n",*kind);
-		fprintf(stderr,"dbg2       transducer_depth:  %f\n",*transducer_depth);
-		fprintf(stderr,"dbg2       altitude:          %f\n",*altitude);
-		fprintf(stderr,"dbg2       error:             %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_reson_extract_nav(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int time_i[7], double *time_d,
-		double *navlon, double *navlat,
-		double *speed, double *heading, double *draft,
-		double *roll, double *pitch, double *heave,
-		int *error)
-{
-	char	*function_name = "mbsys_reson_extract_nav";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_reson_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_reson_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get time */
-		mb_fix_y2k(verbose, store->year, &time_i[0]);
-		time_i[1] = store->month;
-		time_i[2] = store->day;
-		time_i[3] = store->hour;
-		time_i[4] = store->minute;
-		time_i[5] = store->second;
-		time_i[6] = 10000*store->hundredth_sec
-			+ 100*store->thousandth_sec;
-		mb_get_time(verbose,time_i,time_d);
-
-		/* get navigation */
-		*navlon = store->longitude*0.00000009;
-		*navlat = store->latitude*0.00000009;
-
-		/* get heading */
-		*heading = 0.01*store->heading;
-
-		/* get speed  */
-		*speed = 0.0;
-
-		/* get draft  */
-		*draft = 0.001 * store->transducer_depth;
-
-		/* get roll pitch and heave */
-		*roll = 0.005*store->roll;
-		*pitch = 0.005*store->pitch;
-		*heave = 0.001*store->heave;
-
-		/* print debug statements */
-		if (verbose >= 5)
-			{
-			fprintf(stderr,"\ndbg4  Data extracted by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  Extracted values:\n");
-			fprintf(stderr,"dbg4       kind:       %d\n",
-				*kind);
-			fprintf(stderr,"dbg4       error:      %d\n",
-				*error);
-			fprintf(stderr,"dbg4       time_i[0]:  %d\n",
-				time_i[0]);
-			fprintf(stderr,"dbg4       time_i[1]:  %d\n",
-				time_i[1]);
-			fprintf(stderr,"dbg4       time_i[2]:  %d\n",
-				time_i[2]);
-			fprintf(stderr,"dbg4       time_i[3]:  %d\n",
-				time_i[3]);
-			fprintf(stderr,"dbg4       time_i[4]:  %d\n",
-				time_i[4]);
-			fprintf(stderr,"dbg4       time_i[5]:  %d\n",
-				time_i[5]);
-			fprintf(stderr,"dbg4       time_i[6]:  %d\n",
-				time_i[6]);
-			fprintf(stderr,"dbg4       time_d:     %f\n",
-				*time_d);
-			fprintf(stderr,"dbg4       longitude:  %f\n",
-				*navlon);
-			fprintf(stderr,"dbg4       latitude:   %f\n",
-				*navlat);
-			fprintf(stderr,"dbg4       speed:      %f\n",
-				*speed);
-			fprintf(stderr,"dbg4       heading:    %f\n",
-				*heading);
-			fprintf(stderr,"dbg4       draft:      %f\n",
-				*draft);
-			fprintf(stderr,"dbg4       roll:       %f\n",
-				*roll);
-			fprintf(stderr,"dbg4       pitch:      %f\n",
-				*pitch);
-			fprintf(stderr,"dbg4       heave:      %f\n",
-				*heave);
-			}
-
-		/* done translating values */
-
-		}
-
-	/* extract nav from structure */
-	else if (*kind == MB_DATA_NAV)
-		{
-		/* get time */
-		mb_fix_y2k(verbose, store->pos_year, &time_i[0]);
-		time_i[1] = store->pos_month;
-		time_i[2] = store->pos_day;
-		time_i[3] = store->pos_hour;
-		time_i[4] = store->pos_minute;
-		time_i[5] = store->pos_second;
-		time_i[6] = 10000*store->pos_hundredth_sec
-			+ 100*store->pos_thousandth_sec;
-		mb_get_time(verbose,time_i,time_d);
-
-		/* get navigation */
-		*navlon = store->pos_longitude*0.00000009;
-		*navlat = store->pos_latitude*0.00000009;
-
-		/* get heading */
-		*heading = 0.01*store->heading;
-
-		/* get speed  */
-		*speed = 0.0;
-
-		/* get draft  */
-		*draft = 0.001 * store->transducer_depth;
-
-		/* get roll pitch and heave */
-		*roll = 0.005*store->roll;
-		*pitch = 0.005*store->pitch;
-		*heave = 0.001*store->heave;
-
-		/* print debug statements */
-		if (verbose >= 5)
-			{
-			fprintf(stderr,"\ndbg4  Data extracted by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  Extracted values:\n");
-			fprintf(stderr,"dbg4       kind:       %d\n",
-				*kind);
-			fprintf(stderr,"dbg4       error:      %d\n",
-				*error);
-			fprintf(stderr,"dbg4       time_i[0]:  %d\n",
-				time_i[0]);
-			fprintf(stderr,"dbg4       time_i[1]:  %d\n",
-				time_i[1]);
-			fprintf(stderr,"dbg4       time_i[2]:  %d\n",
-				time_i[2]);
-			fprintf(stderr,"dbg4       time_i[3]:  %d\n",
-				time_i[3]);
-			fprintf(stderr,"dbg4       time_i[4]:  %d\n",
-				time_i[4]);
-			fprintf(stderr,"dbg4       time_i[5]:  %d\n",
-				time_i[5]);
-			fprintf(stderr,"dbg4       time_i[6]:  %d\n",
-				time_i[6]);
-			fprintf(stderr,"dbg4       time_d:     %f\n",
-				*time_d);
-			fprintf(stderr,"dbg4       longitude:  %f\n",
-				*navlon);
-			fprintf(stderr,"dbg4       latitude:   %f\n",
-				*navlat);
-			fprintf(stderr,"dbg4       speed:      %f\n",
-				*speed);
-			fprintf(stderr,"dbg4       heading:    %f\n",
-				*heading);
-			fprintf(stderr,"dbg4       draft:      %f\n",
-				*draft);
-			}
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind == MB_DATA_DATA)
-		{
-		fprintf(stderr,"dbg2       time_i[0]:     %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:     %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:     %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:     %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:     %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:     %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:     %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:        %f\n",*time_d);
-		fprintf(stderr,"dbg2       longitude:     %f\n",*navlon);
-		fprintf(stderr,"dbg2       latitude:      %f\n",*navlat);
-		fprintf(stderr,"dbg2       speed:         %f\n",*speed);
-		fprintf(stderr,"dbg2       heading:       %f\n",*heading);
-		fprintf(stderr,"dbg2       draft:         %f\n",*draft);
-		fprintf(stderr,"dbg2       roll:          %f\n",*roll);
-		fprintf(stderr,"dbg2       pitch:         %f\n",*pitch);
-		fprintf(stderr,"dbg2       heave:         %f\n",*heave);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_reson_insert_nav(int verbose, void *mbio_ptr, void *store_ptr,
-		int time_i[7], double time_d,
-		double navlon, double navlat,
-		double speed, double heading, double draft,
-		double roll, double pitch, double heave,
-		int *error)
-{
-	char	*function_name = "mbsys_reson_insert_nav";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_reson_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       time_i[0]:  %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:  %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:  %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:  %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:  %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:  %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:  %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:     %f\n",time_d);
-		fprintf(stderr,"dbg2       navlon:     %f\n",navlon);
-		fprintf(stderr,"dbg2       navlat:     %f\n",navlat);
-		fprintf(stderr,"dbg2       speed:      %f\n",speed);
-		fprintf(stderr,"dbg2       heading:    %f\n",heading);
-		fprintf(stderr,"dbg2       draft:      %f\n",draft);
-		fprintf(stderr,"dbg2       roll:       %f\n",roll);
-		fprintf(stderr,"dbg2       pitch:      %f\n",pitch);
-		fprintf(stderr,"dbg2       heave:      %f\n",heave);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_reson_struct *) store_ptr;
-
-	/* insert data in structure */
-	if (store->kind == MB_DATA_DATA)
-		{
-		/* get time */
-		mb_unfix_y2k(verbose, time_i[0], &store->year);
-		store->month = time_i[1];
-		store->day = time_i[2];
-		store->hour = time_i[3];
-		store->minute = time_i[4];
-		store->second = time_i[5];
-		store->hundredth_sec = time_i[6]/10000;
-		store->thousandth_sec =
-			(time_i[6] - 10000*store->hundredth_sec)/100;
-
-		/*get navigation */
-		store->longitude = (int) (navlon/0.00000009);
-		store->latitude = (int) (navlat/0.00000009);
-
-		/* get heading */
-		store->heading = (int) (heading * 100);
-
-		/* get draft  */
-		store->transducer_depth = 1000 * draft;
-
-		/* get roll pitch and heave */
-		store->roll = roll*200.0;
-		store->pitch = pitch*200.0;
-		store->heave = heave*200.0;
-		}
-
-	/* insert nav in structure */
-	else if (store->kind == MB_DATA_NAV)
-		{
-		/* get time */
-		mb_unfix_y2k(verbose, time_i[0], &store->pos_year);
-		store->pos_month = time_i[1];
-		store->pos_day = time_i[2];
-		store->pos_hour = time_i[3];
-		store->pos_minute = time_i[4];
-		store->pos_second = time_i[5];
-		store->pos_hundredth_sec = time_i[6]/10000;
-		store->pos_thousandth_sec =
-			(time_i[6] - 10000*store->pos_hundredth_sec)/100;
-
-		/*get navigation */
-		store->pos_longitude = (int) (navlon/0.00000009);
-		store->pos_latitude = (int) (navlat/0.00000009);
-
-		/* get heading */
-		store->heading = (int) (heading * 100);
-
-		/* get draft  */
-		store->transducer_depth = 1000 * draft;
-
-		/* get roll pitch and heave */
-		store->roll = roll*200.0;
-		store->pitch = pitch*200.0;
-		store->heave = heave*200.0;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_reson_extract_svp(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int *nsvp,
-		double *depth, double *velocity,
-		int *error)
-{
-	char	*function_name = "mbsys_reson_extract_svp";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_reson_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_reson_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_VELOCITY_PROFILE)
-		{
-		/* get number of depth-velocity pairs */
-		*nsvp = store->svp_num;
-
-		/* get profile */
-		for (i=0;i<*nsvp;i++)
-			{
-			depth[i] = 0.1 * store->svp_depth[i];
-			velocity[i] = 0.1 * store->svp_vel[i];
-			}
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:              %d\n",*kind);
-		fprintf(stderr,"dbg2       nsvp:              %d\n",*nsvp);
-		for (i=0;i<*nsvp;i++)
-		    fprintf(stderr,"dbg2       depth[%d]: %f   velocity[%d]: %f\n",i, depth[i], i, velocity[i]);
-		fprintf(stderr,"dbg2       error:             %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:            %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_reson_insert_svp(int verbose, void *mbio_ptr, void *store_ptr,
-		int nsvp,
-		double *depth, double *velocity,
-		int *error)
-{
-	char	*function_name = "mbsys_reson_insert_svp";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_reson_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       nsvp:       %d\n",nsvp);
-		for (i=0;i<nsvp;i++)
-		    fprintf(stderr,"dbg2       depth[%d]: %f   velocity[%d]: %f\n",i, depth[i], i, velocity[i]);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_reson_struct *) store_ptr;
-
-	/* insert data in structure */
-	if (store->kind == MB_DATA_VELOCITY_PROFILE)
-		{
-		/* get number of depth-velocity pairs */
-		store->svp_num = MIN(nsvp, MBSYS_RESON_MAXSVP);
-
-		/* get profile */
-		for (i=0;i<store->svp_num;i++)
-			{
-			store->svp_depth[i] = (int) (10 * depth[i]);
-			store->svp_vel[i] = (int) (10 * velocity[i]);
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_reson_copy(int verbose, void *mbio_ptr,
-			void *store_ptr, void *copy_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_reson_copy";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_reson_struct *store;
-	struct mbsys_reson_struct *copy;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       copy_ptr:   %p\n",(void *)copy_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointers */
-	store = (struct mbsys_reson_struct *) store_ptr;
-	copy = (struct mbsys_reson_struct *) copy_ptr;
-
-	/* copy the data */
-	*copy = *store;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mbsys_reson.h b/src/mbio/mbsys_reson.h
deleted file mode 100644
index 29584b5..0000000
--- a/src/mbio/mbsys_reson.h
+++ /dev/null
@@ -1,675 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbsys_reson.h	8/20/94
- *	$Id: mbsys_reson.h 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1994-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbsys_reson.h defines the data structures used by MBIO functions
- * to store data from Reson SeaBat 9001 multibeam sonar systems.
- * The data formats which are commonly used to store Reson
- * data in files include
- *      MBF_CBAT9001 : MBIO ID 81
- *
- *
- * Author:	D. W. Caress (L-DEO)
- * Date:	August 20, 1994
- *
- * $Log: mbsys_reson.h,v $
- * Revision 5.5  2005/11/05 00:48:04  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.4  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.3  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.2  2001/07/20 00:32:54  caress
- * Release 5.0.beta03
- *
- * Revision 5.1  2001/01/22  07:43:34  caress
- * Version 5.0.beta01
- *
- * Revision 5.0  2000/12/01  22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.6  2000/09/30  06:31:19  caress
- * Snapshot for Dale.
- *
- * Revision 4.5  1999/08/16  23:14:41  caress
- * Added ability to handle Mesotech SM2000 data
- *
- * Revision 4.4  1999/01/01  23:41:06  caress
- * MB-System version 4.6beta6
- *
- * Revision 4.3  1998/10/05 17:46:15  caress
- * MB-System version 4.6beta
- *
- * Revision 4.2  1997/04/21  17:02:07  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.1  1995/07/13  19:15:09  caress
- * Intermediate check-in during major bug-fixing flail.
- *
- * Revision 4.1  1995/07/13  19:15:09  caress
- * Intermediate check-in during major bug-fixing flail.
- *
- * Revision 4.0  1994/10/21  12:35:08  caress
- * Release V4.0
- *
- * Revision 1.1  1994/10/21  12:20:01  caress
- * Initial revision
- *
- *
- *
- */
-/*
- * Notes on the MBSYS_RESON data:
- *   1. Reson SeaBat products are high frequency,
- *      shallow water multibeam sonars.
- *      Reson SeaBat 9001 systems output both bathymetry
- *      and amplitude information for 60 beams.
- *      Reson SeaBat 8101 systems output both bathymetry
- *      and amplitude information for up to 101 beams.
- *      These sonars use fixed, analog beamforming followed
- *      by a combination of amplitude and phase bottom
- *      detection.
- *   2. Reson multibeam systems output raw range and amplitude
- *      data in a binary format. The data acquisition systems
- *      associated with the sonars calculate bathymetry using
- *      a water sound velocity, roll, pitch, and heave data.
- *   3. Generally, Reson data acquisition systems record
- *      navigation asynchronously in the data stream, without
- *      providing speed information. This means that the
- *      navigation must be interpolated on the fly as the
- *      data is read.
- *   4. The navigation is frequently provided in projected
- *      coordinates (eastings and northings) rather than in
- *      longitude and latitude. Since MB-System operates solely
- *      in longitude and latitude, the original navigation must
- *      be unprojected.
- *   5. The Reson data formats supported by MB-System include:
- *        MBF_CBAT9001 - a binary format designed by John Hughes Clarke
- *           of the University of New Brunswick. Parameter and
- *           sound velocity profile records are included.
- *        MBF_CBAT8101 - a modified version of the above format
- *           supporting Reson 8101 data.
- *        MBF_HYPC8101 - the ASCII format used by the HYPACK system
- *           of Coastal Oceanographics in conjunction with
- *           Reson 8101 data. This format is supported as read-only
- *           by MB-System.
- *        MBF_GSFGENMB - the generic sensor format of SAIC which
- *           supports data from a large number of sonars, including
- *           Reson sonars. MB-System handles GSF separately from
- *           other formats.
- *   6. For the UNB-style formats MBF_CBAT9001 and MBF_CBAT8101,
- *      each data telegram is preceded by a two byte start code and
- *      followed by a three byte end code consisting of 0x03
- *      followed by two bytes representing the checksum for
- *      the data bytes.  MB-System does not calculate checksums
- *      and puts 0's in the checksum bytes.
- *      The relevent telegram start codes, types, and sizes are:
- *         0x0240: Comment***                             200 data bytes
- *         0x0241: Position                                36 data bytes
- *         0x0242: Parameter                               44 data bytes
- *         0x0243: Sound velocity profile                2016 data bytes
- *         0x0244: SeaBat 9001 bathymetry                 752 data bytes
- *         0x0245: Short sound velocity profile           816 data bytes
- *         0x0246: SeaBat 8101 bathymetry***              752 data bytes
- *         0x0247: Heading***                             752 data bytes
- *         0x0248: Attitude***                            752 data bytes
- *            *** Defined only for MB-System
- *   7. For the ASCII HYPACK format, the following information
- *      is take verbatim from Coastal Oceanographics documentation:
- *
- *        Coastal Oceanographics, Inc.
- *        Technical Note: Hypack Raw Data Format
- *
- *        Data collected by the Hypack Survey program is recorded
- *        in Raw format, one file per survey line. Raw files are
- *        recorded as text, allowing them to be loaded into any
- *        text editor that reads large files (Windows Notepad, Write
- *        and Wordpad for example).
- *
- *        When inspecting raw files, one of the first things noticed
- *        is that the format is not tabular. That is, there is not a record for
- *        each sounding containing depth, position, tide corrections,
- *        etc. Instead, there are separate records for each device
- *        measurement and the correlation between measurements is
- *        through time tags.
- *
- *        Every raw file contains two section; a header, which is
- *        written when data logging starts, and a data section, which is
- *        written as data is collected. Each record starts with a
- *        three character tag. The tags are:
- *
- *        Header
- *        ------
- *        DEV - Device Information
- *        EOH - End of Header
- *        EOL - End of Planned Line
- *        FTP - File Type
- *        INF - General Information
- *        LBP - Planned Line Begin Point
- *        LIN - Planned Line Data follows
- *        LNN - Planned Line Name
- *        OFF - Device Offsets
- *        PRD - Private Device Data
- *        PRI - Primary Navigation Device
- *        PTS - Planned Line Waypoint
- *        TND - Survey Time and Date
- *
- *        Data
- *        ----
- *        FIX - Fix (Event) Mark
- *        HCP - Heave Compensation
- *        EC1 - Echo Sounding (single frequency)
- *        EC2 - Echo Sounding (dual frequency)
- *        ECM - Echo Soundings (multiple transducer system)
- *        GYR - Gyro Data (Heading)
- *        POS - Position
- *        ROX - Roxann data
- *        SB2 - Multibeam data
- *
- *        --------------
- *        Header Section
- *        --------------
- *
- *        DEV - Device Information
- *        ------------------------
- *        DEV dn dc "Device Name"
- *        dn: Device Number
- *        dc: Device Capabilities is a bit coded field. The bit definitions are:
- *        Bit Mask Meaning
- *        0 1 Device provides Range/Range positions
- *        1 2 Device provides Range/Azimuth positions
- *        2 4 Device provides Lat/Long (e.g. GPS)
- *        3 8 Device provides grid positions XY
- *        4 16 Device provides echo soundings
- *        5 32 Device provides heading
- *        6 64 Device provides ship speed
- *        7 128 Hypack clock is synched to device clock
- *        8 256 Device provides tides
- *        9 512 Device provides heave, pitch and roll
- *        10 1024 Device is an ROV
- *        11 2048 Device is a Left/Right Indicator
- *        12 4096 Device accepts annotation strings
- *        13 8192 Device accepts output from Hypack
- *        14 16384 xxx
- *        15 32768 Device has extended capabilities
- *
- *        Example:
- *        DEV 0 100 "GPS"
- *
- *        INF - General Information
- *        -------------------------
- *        INF "surveyor" "boat" "project" "area" tc dc sv
- *        tc: initial tide correction
- *        dc: initial draft correction
- *        sv: sound velocity
- *
- *        Example:
- *        INF "steve" "LCH 19" "mcmillen" "617.6 to 618.2" -0.7 0 1500.0
- *
- *        EOH - End of Header
- *        -------------------
- *        This tag simply indicates end of header and has no data.
- *
- *        EOL - End of Planned Line
- *        -------------------------
- *        This tag simply indicates end of planned line information no data.
- *
- *        LBP - Planned Line Begin Point.
- *        -------------------------------
- *        LBP x y
- *        x: x grid position
- *        y: y grid position
- *
- *        Example:
- *        LBP 5567222.42 3771640.72
- *
- *        LIN - Planned Line Data follows
- *        -------------------------------
- *        LIN nw
- *        nw: Number of waypoints
- *
- *        Example:
- *        LIN 5
- *
- *        LNN - Planned Line Name
- *        -----------------------
- *        LNN text
- *        text: line name or number
- *
- *        Example:
- *        LNN 14
- *
- *        OFF - Device Offsets
- *        --------------------
- *        OFF dn n1 n2 n3 n4 n5 n6 n7
- *        dn: device number
- *        n1: starboard, port offset. Positive starboard.
- *        n2: forward, aft offset. Positive forward
- *        n3: height (antenna) or depth (transducer draft) offset. Always positive.
- *        n4: yaw rotation angle. Positive for clockwise rotation.
- *        n5: roll rotation angle. Port side up is positive.
- *        n6: pitch rotation angle. Bow up is positive.
- *        n7: device latency in seconds.
- *
- *        Example:
- *        OFF 0 0 0 13.35 0 0 0 0.86
- *
- *        PRD - Private Device Data
- *        -------------------------
- *        PRD - Multiple transducer offset
- *        PRD dn OFF n1 n2 n3
- *        dn: device number
- *        n1: transducer starboard offset
- *        n2: transducer forward offset
- *        n3: transducer depth offset (draft)
- *
- *        Example:
- *        PRD 1 OFF -25.60 0.00 0.40
- *
- *        PRD - Odom Echoscan II Multibeam Identifier
- *        -------------------------------------------
- *        PRD dn ECHOSCN2 n1 n2
- *        dn: device number
- *        n1: Not used
- *        n2: Beam width
- *
- *        Example:
- *        PRD 1 ECHOSCN2 -43.5 3.0
- *
- *        PRD - Reson Seabat 9001 Multibeam Identifier
- *        --------------------------------------------
- *        PRD dn SEABAT n1 n2
- *        dn: device number
- *        n1: Not used
- *        n2: Beam width
- *
- *        Example:
- *        PRD 1 SEABAT -44.2 1.5
- *
- *        PRD - Reson Seabat 9003 Multibeam Identifier
- *        --------------------------------------------
- *        PRD dn SEA9003 n1 n2
- *        dn: device number
- *        n1: Not used
- *        n2: Beam width
- *
- *        Example:
- *        PRD 1 SEA9003 -60.0 3.0
- *
- *        PRD - Reson Seabat 8101 Multibeam Identifier
- *        --------------------------------------------
- *        PRD dn SEA8101 n1 n2 n3
- *        dn: device number
- *        n1: Beam 1 angle
- *        n2: Angle increment
- *        n3: Number of beams
- *
- *        Example:
- *        PRD 1 SEA8101 -75.00 1.50 101
- *
- *        PRI - Primary Navigation Device
- *        -------------------------------
- *        PRI dn
- *        dn: device number
- *
- *        Example:
- *        PRI 0
- *
- *        PTS - Planned Line Waypoint
- *        ---------------------------
- *        PTS x y
- *        x: waypoint easting
- *        y: waypoint northing
- *
- *        Example:
- *        PTS 5569134.63 3774182.61
- *
- *        TND - Survey Time and Date
- *        --------------------------
- *        TND t d
- *        t: time string
- *        d: date string
- *
- *        Example:
- *        TND 15:54:33 08/28/95
- *
- *        --------------------------
- *        Data Section
- *        --------------------------
- *
- *        FIX - Fix (Event) Mark
- *        ----------------------
- *        FIX n
- *        n: event number
- *
- *        Example:
- *        FIX 152
- *
- *        HCP - Heave Compensation
- *        ------------------------
- *        HCP dn t h r p
- *        dn: device number
- *        t: time tag (seconds past midnight)
- *        h: heave in meters
- *        r: roll in degrees (+ port side up)
- *        p: pitch in degrees (+ bow up)
- *
- *        Example:
- *        HCP 2 57273.81 0 3.61 0
- *
- *        EC1 - Echo Sounding (single frequency)
- *        --------------------------------------
- *        EC1 dn t rd
- *        dn: device number
- *        t: time tag (seconds past midnight)
- *        rd: raw depth
- *
- *        Example:
- *        EC1 0 48077.365 3.20
- *
- *        EC2 - Echo Sounding (dual frequency)
- *        ------------------------------------
- *        EC2 dn t rd1 rd2
- *        dn: device number
- *        t: time tag (seconds past midnight)
- *        rd1: raw depth 1
- *        rd2: raw depth 2
- *
- *        Example:
- *        EC2 0 48077.365 3.20 3.15
- *
- *        ECM - Echo Soundings (multiple transducer system)
- *        -------------------------------------------------
- *        ECM dn t n rd1 rd2 ... rdn
- *        dn: device number
- *        t: time tag (seconds past midnight)
- *        n: number of transducers
- *        rd1: raw depth 1
- *        rd2: raw depth 2
- *        ...
- *        rdn: raw depth, transducer n
- *
- *        Example:
- *        ECM 1 57274.82 9 11 10.8 10.7 11.4 11.8 13 15.1 15.5 15.6
- *
- *        GYR - Gyro Data (Heading)
- *        -------------------------
- *        GYR dn t h
- *        dn: device number
- *        t: time tag (seconds past midnight)
- *        h: ship heading angle
- *
- *        Example:
- *        GYR 0 57274.04 193
- *
- *        POS - Position
- *        --------------
- *        POS dn t x y
- *        dn: device number
- *        t: time tag (seconds past midnight)
- *        x: easting
- *        y: northing
- *
- *        Example:
- *        POS 0 57274.04 5569070.02 3774080.46
- *
- *        ROX - Roxann data
- *        -----------------
- *        ROX dn t n e1 e2
- *        dn: device number
- *        t: time tag (seconds past midnight)
- *        n: number of values to follow (always 2)
- *        e1: roxann e1 measurement
- *        e2: roxann e2 measurement
- *
- *        Example:
- *        ROX 2 48077.474 2 0.03 0.13
- *
- *        SB2 - Multibeam data
- *        --------------------
- *        SB2 dn t n sv r1 r2 r3 ... rn q1 q2 ... qn
- *        dn: device number
- *        t: time tag (seconds past midnight)
- *        n: number of values to follow. Depends on device type.
- *        sv: sound velocity from device.
- *        r1-n: ranges in device units.
- *        q1-n: quality codes (0 to 3 range, 0=bad). Packed 4 per number.
- *
- *        Example (Echoscan II):
- *        SB2 1 48077.474 39 1500.00 19.50 19.31 ...
- *
- *        Example (Seabat 9001):
- *        SB2 1 48077.474 76 1500.00 19.50 19.31 ...
- *
- *        Example (Seabat 9003):
- *        SB2 1 48077.474 51 1500.00 19.50 19.31 ...
- *
- *        Example (Seabat 8101 using 101 beams):
- *        SB2 1 48077.474 51 1500.00 19.50 19.31 ...
- *
- */
-
-/* sonar types */
-#define	MBSYS_RESON_UNKNOWN		0
-#define	MBSYS_RESON_SEABAT9001		1
-#define	MBSYS_RESON_SEABAT8101		2
-#define	MBSYS_RESON_MESOTECHSM2000	3
-
-/* maximum number of beams and pixels */
-#define	MBSYS_RESON_MAXBEAMS	101
-#define	MBSYS_RESON_MAXSVP	500
-#define	MBSYS_RESON_COMMENT_LENGTH	200
-
-/* telegram types */
-#define	RESON_NONE		0
-#define	RESON_COMMENT		0x0240
-#define	RESON_NAV		0x0241
-#define	RESON_PARAMETER		0x0242
-#define	RESON_SVP		0x0243
-#define	RESON_BATH_9001		0x0244
-#define	RESON_SHORT_SVP		0x0245
-#define	RESON_BATH_8101		0x0246
-#define	RESON_POS		0x0247
-#define	RESON_HEADING		0x0248
-#define	RESON_ATTITUDE		0x0249
-
-/* telegram sizes */
-#define	RESON_COMMENT_SIZE	200
-#define	RESON_NAV_SIZE		36
-#define	RESON_PARAMETER_SIZE	44
-#define	RESON_SVP_SIZE		2016
-#define	RESON_BATH_9001_SIZE	752
-#define	RESON_SHORT_SVP_SIZE	816
-#define	RESON_BATH_8101_SIZE	1244
-#define	RESON_HEADING_SIZE	10
-#define	RESON_ATTITUDE_SIZE	14
-
-/* internal data structure */
-struct mbsys_reson_struct
-	{
-	/* type of data record */
-	int	kind;			/* Data vs Comment */
-
-	/* type of sonar */
-	int	sonar;			/* Type of Reson sonar */
-
-	/* parameter info (parameter telegrams) */
-	int	par_year;
-	int	par_month;
-	int	par_day;
-	int	par_hour;
-	int	par_minute;
-	int	par_second;
-	int	par_hundredth_sec;
-	int	par_thousandth_sec;
-	short	roll_offset;	/* roll offset (degrees) */
-	short	pitch_offset;	/* pitch offset (degrees) */
-	short	heading_offset;	/* heading offset (degrees) */
-	short	time_delay;	/* positioning system delay (sec) */
-	short	transducer_depth;	/* tranducer depth (meters) */
-	short	transducer_height;	/* reference height (meters) */
-	short	transducer_x;	/* reference athwartships offset (meters) */
-	short	transducer_y;	/* reference fore-aft offset (meters) */
-	short	antenna_x;	/* antenna athwartships offset (meters) */
-	short	antenna_y;	/* antenna fore-aft offset (meters) */
-	short	antenna_z;	/* antenna height (meters) */
-	short	motion_sensor_x;/* motion sensor athwartships offset (meters) */
-	short	motion_sensor_y;/* motion sensor fore-aft offset (meters) */
-	short	motion_sensor_z;/* motion sensor height offset (meters) */
-	short	spare;
-	short	line_number;
-	short	start_or_stop;
-	short	transducer_serial_number;
-
-	/* comment */
-	char	comment[MBSYS_RESON_COMMENT_LENGTH];
-
-	/* position (navigation telegrams) */
-	int	pos_year;
-	int	pos_month;
-	int	pos_day;
-	int	pos_hour;
-	int	pos_minute;
-	int	pos_second;
-	int	pos_hundredth_sec;
-	int	pos_thousandth_sec;
-	int	pos_latitude;		/* 180 deg = 2e9 */
-	int	pos_longitude;		/* 180 deg = 2e9 */
-	int	utm_northing;		/* 0.01 m */
-	int	utm_easting;		/* 0.01 m */
-	int	utm_zone_lon;		/* 180 deg = 2e9 */
-	char	utm_zone;
-	char	hemisphere;
-	char	ellipsoid;
-	char	pos_spare;
-	int	semi_major_axis;
-	int	other_quality;
-
-	/* sound velocity profile */
-	int	svp_year;
-	int	svp_month;
-	int	svp_day;
-	int	svp_hour;
-	int	svp_minute;
-	int	svp_second;
-	int	svp_hundredth_sec;
-	int	svp_thousandth_sec;
-	int	svp_latitude;		/* 180 deg = 2e9 */
-	int	svp_longitude;		/* 180 deg = 2e9 */
-	int	svp_num;
-	int	svp_depth[MBSYS_RESON_MAXSVP]; /* 0.1 meters */
-	int	svp_vel[MBSYS_RESON_MAXSVP];	/* 0.1 meters/sec */
-
-	/* bathymetry */
-	int	year;
-	int	month;
-	int	day;
-	int	hour;
-	int	minute;
-	int	second;
-	int	hundredth_sec;
-	int	thousandth_sec;
-	int	latitude;		/* 180 deg = 2e9 */
-	int	longitude;		/* 180 deg = 2e9 */
-	int	roll;			/* 0.005 degrees */
-	int	pitch;			/* 0.005 degrees */
-	int	heading;		/* 0.01 degrees */
-	int	heave;			/* 0.001 meters */
-	int	ping_number;
-	int	sound_vel;	/* 0.1 meters/sec */
-	int	mode;		/* unused */
-	int	gain1;		/* unused */
-	int	gain2;		/* unused */
-	int	gain3;		/* unused */
-	int	beams_bath;
-	short bath[MBSYS_RESON_MAXBEAMS];
-				/* depths:  0.01 meters */
-	short int bath_acrosstrack[MBSYS_RESON_MAXBEAMS];
-				/* acrosstrack distances: 0.01 meters */
-	short int bath_alongtrack[MBSYS_RESON_MAXBEAMS];
-				/* alongtrack distances: 0.01 meters */
-	short int tt[MBSYS_RESON_MAXBEAMS];
-				/* travel times:         0.05 msec */
-	short int angle[MBSYS_RESON_MAXBEAMS];
-				/* 0.005 degrees */
-	short int quality[MBSYS_RESON_MAXBEAMS];
-				/* 0 (bad) to 3 (good) */
-	short int amp[MBSYS_RESON_MAXBEAMS];
-				/* ??? */
-
-	};
-
-/* system specific function prototypes */
-int mbsys_reson_alloc(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error);
-int mbsys_reson_deall(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error);
-int mbsys_reson_dimensions(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int *nbath, int *namp, int *nss, int *error);
-int mbsys_reson_extract(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int time_i[7], double *time_d,
-			double *navlon, double *navlat,
-			double *speed, double *heading,
-			int *nbath, int *namp, int *nss,
-			char *beamflag, double *bath, double *amp,
-			double *bathacrosstrack, double *bathalongtrack,
-			double *ss, double *ssacrosstrack, double *ssalongtrack,
-			char *comment, int *error);
-int mbsys_reson_insert(int verbose, void *mbio_ptr, void *store_ptr,
-			int kind, int time_i[7], double time_d,
-			double navlon, double navlat,
-			double speed, double heading,
-			int nbath, int namp, int nss,
-			char *beamflag, double *bath, double *amp,
-			double *bathacrosstrack, double *bathalongtrack,
-			double *ss, double *ssacrosstrack, double *ssalongtrack,
-			char *comment, int *error);
-int mbsys_reson_ttimes(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int *nbeams,
-			double *ttimes, double *angles,
-			double *angles_forward, double *angles_null,
-			double *heave, double *alongtrack_offset,
-			double *draft, double *ssv, int *error);
-int mbsys_reson_detects(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int *nbeams, int *detects, int *error);
-int mbsys_reson_extract_altitude(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, double *transducer_depth, double *altitude,
-			int *error);
-int mbsys_reson_extract_nav(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int time_i[7], double *time_d,
-			double *navlon, double *navlat,
-			double *speed, double *heading, double *draft,
-			double *roll, double *pitch, double *heave,
-			int *error);
-int mbsys_reson_insert_nav(int verbose, void *mbio_ptr, void *store_ptr,
-			int time_i[7], double time_d,
-			double navlon, double navlat,
-			double speed, double heading, double draft,
-			double roll, double pitch, double heave,
-			int *error);
-int mbsys_reson_extract_svp(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind,
-			int *nsvp,
-			double *depth, double *velocity,
-			int *error);
-int mbsys_reson_insert_svp(int verbose, void *mbio_ptr, void *store_ptr,
-			int nsvp,
-			double *depth, double *velocity,
-			int *error);
-int mbsys_reson_copy(int verbose, void *mbio_ptr,
-			void *store_ptr, void *copy_ptr,
-			int *error);
diff --git a/src/mbio/mbsys_reson7k.c b/src/mbio/mbsys_reson7k.c
deleted file mode 100644
index 607c752..0000000
--- a/src/mbio/mbsys_reson7k.c
+++ /dev/null
@@ -1,10475 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbsys_reson7k.c	3.00	3/23/2004
- *	$Id: mbsys_reson7k.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 2004-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbsys_reson7k.c contains the MBIO functions for handling data from
- * Reson SeaBat 7k series sonars.
- * The data formats associated with Reson SeaBat 7k multibeams
- * include:
- *    MBSYS_RESON7K formats (code in mbsys_reson7k.c and mbsys_reson7k.h):
- *      MBF_RESON7KR : MBIO ID 191 - Raw vendor format
- *      MBF_RESON7KP : MBIO ID 192 - Full processed data
- *      MBF_RESON7KP : MBIO ID 193 - Stripped processed data
- *
- * Author:	D. W. Caress
- * Date:	March 23, 2004
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mb_define.h"
-#include "mbsys_reson7k.h"
-#include "mb_segy.h"
-
-/* turn on debug statements here */
-/* #define MSYS_RESON7KR_DEBUG 1 */
-
-static char rcs_id[]="$Id: mbsys_reson7k.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mbsys_reson7k_zero7kheader(int verbose, s7k_header	*header,
-			int *error)
-{
-	char	*function_name = "mbsys_reson7k_zero7kheader";
-	int	status = MB_SUCCESS;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       header:     %p\n",(void *)header);
-		}
-
-	/* Reson 7k data record header information */
-	header->Version = 0;
-	header->Offset = 0;
-	header->SyncPattern = 0;
-	header->OffsetToOptionalData = 0;
-	header->OptionalDataIdentifier = 0;
-	header->s7kTime.Year = 0;
-	header->s7kTime.Day = 0;
-	header->s7kTime.Seconds = 0.0;
-	header->s7kTime.Hours = 0;
-	header->s7kTime.Minutes = 0;
-	header->Reserved = 0;
-	header->RecordType = 0;
-	header->DeviceId = 0;
-	header->Reserved2 = 0;
-	header->SystemEnumerator = 0;
-	header->DataSetNumber = 0;
-	header->RecordNumber = 0;
-	for (i=0;i<8;i++)
-		{
-		header->PreviousRecord[i] = 0;
-		header->NextRecord[i] = 0;
-		}
-	header->Flags = 0;
-	header->Reserved3 = 0;
-	header->Reserved4 = 0;
-	header->FragmentedTotal = 0;
-	header->FragmentNumber = 0;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbsys_reson7k_alloc(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_reson7k_alloc";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_reson7k_struct *store;
-	s7kr_reference		*reference;
-	s7kr_sensoruncal	*sensoruncal;
-	s7kr_sensorcal		*sensorcal;
-	s7kr_position		*position;
-	s7kr_customattitude	*customattitude;
-	s7kr_tide		*tide;
-	s7kr_altitude		*altitude;
-	s7kr_motion		*motion;
-	s7kr_depth		*depth;
-	s7kr_svp		*svp;
-	s7kr_ctd		*ctd;
-	s7kr_geodesy		*geodesy;
-	s7kr_rollpitchheave	*rollpitchheave;
-	s7kr_heading		*heading;
-	s7kr_surveyline		*surveyline;
-	s7kr_navigation		*navigation;
-	s7kr_attitude		*attitude;
-	s7kr_fsdwss		*fsdwsslo;
-	s7kr_fsdwss		*fsdwsshi;
-	s7kr_fsdwsb		*fsdwsb;
-	s7kr_bluefin		*bluefin;
-	s7kr_processedsidescan	*processedsidescan;
-	s7kr_volatilesettings	*volatilesettings;
-	s7kr_configuration	*configuration;
-	s7kr_matchfilter	*matchfilter;
-	s7kr_v2firmwarehardwareconfiguration	*v2firmwarehardwareconfiguration;
-	s7kr_beamgeometry	*beamgeometry;
-	s7kr_calibration	*calibration;
-	s7kr_bathymetry		*bathymetry;
-	s7kr_backscatter	*backscatter;
-	s7kr_beam		*beam;
-	s7kr_verticaldepth	*verticaldepth;
-	s7kr_tvg		*tvg;
-	s7kr_image		*image;
-	s7kr_v2pingmotion	*v2pingmotion;
-	s7kr_v2detectionsetup	*v2detectionsetup;
-	s7kr_v2amplitudephase	*v2amplitudephase;
-	s7kr_v2beamformed	*v2beamformed;
-	s7kr_v2bite		*v2bite;
-	s7kr_v27kcenterversion	*v27kcenterversion;
-	s7kr_v28kwetendversion	*v28kwetendversion;
-	s7kr_v2detection	*v2detection;
-	s7kr_v2rawdetection	*v2rawdetection;
-	s7kr_v2snippettimeseries	*v2snippettimeseries;
-	s7kr_v2snippet		*v2snippet;
-	s7kr_calibratedsnippettimeseries *calibratedsnippettimeseries;
-	s7kr_calibratedsnippet *calibratedsnippet;
-	s7kr_installation	*installation;
-	s7kr_systemeventmessage	*systemeventmessage;
-	s7kr_fileheader		*fileheader;
-	s7kr_remotecontrolsettings	*remotecontrolsettings;
-	s7kr_reserved		*reserved;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* allocate memory for data structure */
-	status = mb_mallocd(verbose, __FILE__, __LINE__, sizeof(struct mbsys_reson7k_struct),
-				(void **)store_ptr, error);
-
-	/* get data structure pointer */
-	store = (struct mbsys_reson7k_struct *) *store_ptr;
-
-	/* initialize everything */
-
-	/* Type of data record */
-	store->kind = MB_DATA_NONE;
-	store->type = R7KRECID_None;
-
-	/* ping record id's */
-	store->current_ping_number = -1;
-	store->read_volatilesettings = MB_NO;
-	store->read_matchfilter = MB_NO;
-	store->read_beamgeometry = MB_NO;
-	store->read_bathymetry = MB_NO;
-	store->read_backscatter = MB_NO;
-	store->read_beam = MB_NO;
-	store->read_verticaldepth = MB_NO;
-	store->read_tvg = MB_NO;
-	store->read_image = MB_NO;
-	store->read_v2pingmotion = MB_NO;
-	store->read_v2detectionsetup = MB_NO;
-	store->read_v2beamformed = MB_NO;
-	store->read_v2detection = MB_NO;
-	store->read_v2rawdetection = MB_NO;
-	store->read_v2snippet = MB_NO;
-	store->read_calibratedsnippet = MB_NO;
-	store->read_processedsidescan = MB_NO;
-
-	/* MB-System time stamp */
-	store->time_d = 0;
-	for (i=0;i<7;i++)
-		store->time_i[i] = 0;
-
-	/* Reference point information (record 1000) */
-	reference = &store->reference;
-	mbsys_reson7k_zero7kheader(verbose, &reference->header, error);
-	reference->offset_x = 0.0;
-	reference->offset_y = 0.0;
-	reference->offset_z = 0.0;
-	reference->water_z = 0.0;
-
-	/* Sensor uncalibrated offset position information (record 1001) */
-	sensoruncal = &store->sensoruncal;
-	mbsys_reson7k_zero7kheader(verbose, &sensoruncal->header, error);
-	sensoruncal->offset_x = 0.0;
-	sensoruncal->offset_y = 0.0;
-	sensoruncal->offset_z = 0.0;
-	sensoruncal->offset_roll = 0.0;
-	sensoruncal->offset_pitch = 0.0;
-	sensoruncal->offset_yaw = 0.0;
-
-	/* Sensor calibrated offset position information (record 1002) */
-	sensorcal = &store->sensorcal;
-	mbsys_reson7k_zero7kheader(verbose, &sensorcal->header, error);
-	sensorcal->offset_x = 0.0;
-	sensorcal->offset_y = 0.0;
-	sensorcal->offset_z = 0.0;
-	sensorcal->offset_roll = 0.0;
-	sensorcal->offset_pitch = 0.0;
-	sensorcal->offset_yaw = 0.0;
-
-	/* Position (record 1003) */
-	position = &store->position;
-	mbsys_reson7k_zero7kheader(verbose, &position->header, error);
-	position->datum = 0;
-	position->latency = 0.0;
-	position->latitude = 0.0;
-	position->longitude = 0.0;
-	position->height = 0.0;
-	position->type = 0;
-	position->utm_zone = 0;
-	position->quality = 0;
-	position->method = 0;
-
-	/* Custom attitude (record 1004) */
-	customattitude = &store->customattitude;
-	mbsys_reson7k_zero7kheader(verbose, &customattitude->header, error);
-	customattitude->bitfield = 0;
-	customattitude->reserved = 0;
-	customattitude->n = 0;
-	customattitude->frequency = 0;
-	customattitude->nalloc = 0;
-	customattitude->pitch = NULL;
-	customattitude->roll = NULL;
-	customattitude->heading = NULL;
-	customattitude->heave = NULL;
-	customattitude->pitchrate = NULL;
-	customattitude->rollrate = NULL;
-	customattitude->headingrate = NULL;
-	customattitude->heaverate = NULL;
-
-	/* Tide (record 1005) */
-	tide = &store->tide;
-	mbsys_reson7k_zero7kheader(verbose, &tide->header, error);
-	tide->tide = 0.0;
-	tide->source = 0;
-	tide->flags = 0;
-	tide->gauge = 0;
-	tide->datum = 0;
-	tide->latency = 0.0;
-	tide->latitude = 0.0;
-	tide->longitude = 0.0;
-	tide->height = 0.0;
-	tide->type = 0;
-	tide->utm_zone = 0;
-
-	/* Altitude (record 1006) */
-	altitude = &store->altitude;
-	mbsys_reson7k_zero7kheader(verbose, &altitude->header, error);
-	altitude->altitude = 0.0;
-
-	/* Motion over ground (record 1007) */
-	motion = &store->motion;
-	mbsys_reson7k_zero7kheader(verbose, &motion->header, error);
-	motion->bitfield = 0;
-	motion->reserved = 0;
-	motion->n = 0;
-	motion->frequency = 0;
-	motion->nalloc = 0;
-	motion->x = NULL;
-	motion->y = NULL;
-	motion->z = NULL;
-	motion->xa = NULL;
-	motion->ya = NULL;
-	motion->za = NULL;
-
-	/* Depth (record 1008) */
-	depth = &store->depth;
-	mbsys_reson7k_zero7kheader(verbose, &depth->header, error);
-	depth->descriptor = 0;
-	depth->correction = 0;
-	depth->reserved = 0;
-	depth->depth = 0.0;
-
-	/* Sound velocity profile (record 1009) */
-	svp = &store->svp;
-	mbsys_reson7k_zero7kheader(verbose, &svp->header, error);
-	svp->position_flag = 0;
-	svp->reserved1 = 0;
-	svp->reserved2 = 0;
-	svp->latitude = 0.0;
-	svp->longitude = 0.0;
-	svp->n = 0;
-	svp->nalloc = 0;
-	svp->depth = NULL;
-	svp->sound_velocity = NULL;
-
-	/* CTD (record 1010) */
-	ctd = &store->ctd;
-	mbsys_reson7k_zero7kheader(verbose, &ctd->header, error);
-	ctd->frequency = 0.0;
-	ctd->velocity_source_flag = 0;
-	ctd->velocity_algorithm = 0;
-	ctd->conductivity_flag = 0;
-	ctd->pressure_flag = 0;
-	ctd->position_flag = 0;
-	ctd->validity = 0;
-	ctd->reserved = 0;
-	ctd->latitude = 0.0;
-	ctd->longitude = 0.0;
-	ctd->sample_rate = 0.0;
-	ctd->n = 0;
-	ctd->nalloc = 0;
-	ctd->conductivity_salinity = NULL;
-	ctd->temperature = NULL;
-	ctd->pressure_depth = NULL;
-	ctd->sound_velocity = NULL;
-	ctd->absorption = NULL;
-
-	/* Geodesy (record 1011) */
-	geodesy = &store->geodesy;
-	mbsys_reson7k_zero7kheader(verbose, &geodesy->header, error);
-	for (i=0;i<32;i++)
-		geodesy->spheroid[i] = '\0';
-	geodesy->semimajoraxis = 0.0;
-	geodesy->flattening = 0.0;
-	for (i=0;i<16;i++)
-		geodesy->reserved1[i] = '\0';
-	for (i=0;i<32;i++)
-		geodesy->datum[i] = '\0';
-	geodesy->calculation_method = 0;
-	geodesy->number_parameters = 0;
-	geodesy->dx = 0.0;
-	geodesy->dy = 0.0;
-	geodesy->dz = 0.0;
-	geodesy->rx = 0.0;
-	geodesy->ry = 0.0;
-	geodesy->rz = 0.0;
-	geodesy->scale = 0.0;
-	for (i=0;i<35;i++)
-		geodesy->reserved2[i] = '\0';
-	for (i=0;i<32;i++)
-		geodesy->grid_name[i] = '\0';
-	geodesy->distance_units = 0;
-	geodesy->angular_units = 0;
-	geodesy->latitude_origin = 0.0;
-	geodesy->central_meriidan = 0.0;
-	geodesy->false_easting = 0.0;
-	geodesy->false_northing = 0.0;
-	geodesy->central_scale_factor = 0.0;
-	geodesy->custum_identifier = 0;
-	for (i=0;i<50;i++)
-		geodesy->reserved3[i] = '\0';
-
-	/* Roll pitch heave (record 1012) */
-	rollpitchheave = &store->rollpitchheave;
-	mbsys_reson7k_zero7kheader(verbose, &rollpitchheave->header, error);
-	rollpitchheave->roll = 0.0;
-	rollpitchheave->pitch = 0.0;
-	rollpitchheave->heave = 0.0;
-
-	/* Heading (record 1013) */
-	heading = &store->heading;
-	mbsys_reson7k_zero7kheader(verbose, &heading->header, error);
-	heading->heading = 0.0;
-
-	/* Survey Line (record 1014) */
-	surveyline = &store->surveyline;
-	mbsys_reson7k_zero7kheader(verbose, &surveyline->header, error);
-	surveyline->n = 0;
-	surveyline->type = 0;
-	surveyline->turnradius = 0.0;
-	for (i=0;i<64;i++)
-		surveyline->name[i] = '\0';
-	surveyline->nalloc = 0;
-	surveyline->latitude = NULL;
-	surveyline->longitude = NULL;
-
-	/* Navigation (record 1015) */
-	navigation = &store->navigation;
-	mbsys_reson7k_zero7kheader(verbose, &navigation->header, error);
-	navigation->vertical_reference = 0;
-	navigation->latitude = 0.0;
-	navigation->longitude = 0.0;
-	navigation->position_accuracy = 0.0;
-	navigation->height = 0.0;
-	navigation->height_accuracy = 0.0;
-	navigation->speed = 0.0;
-	navigation->course = 0.0;
-	navigation->heading = 0.0;
-
-	/* Attitude (record 1016) */
-	attitude = &store->attitude;
-	mbsys_reson7k_zero7kheader(verbose, &attitude->header, error);
-	attitude->n = 0;
-	attitude->nalloc = 0;
-	attitude->delta_time = NULL;
-	attitude->roll = NULL;
-	attitude->pitch = NULL;
-	attitude->heave = NULL;
-	attitude->heading = NULL;
-
-	/* Edgetech FS-DW low frequency sidescan (record 3000) */
-	fsdwsslo = &store->fsdwsslo;
-	mbsys_reson7k_zero7kheader(verbose, &fsdwsslo->header, error);
-	fsdwsslo->msec_timestamp = 0;
-	fsdwsslo->ping_number = 0;
-	fsdwsslo->number_channels = 0;
-	fsdwsslo->total_bytes = 0;
-	fsdwsslo->data_format = 0;
-	for (i=0;i<2;i++)
-		{
-		fsdwsslo->channel[i].number = 0;
-		fsdwsslo->channel[i].type = 0;
-		fsdwsslo->channel[i].data_type = 0;
-		fsdwsslo->channel[i].polarity = 0;
-		fsdwsslo->channel[i].bytespersample = 0;
-		fsdwsslo->channel[i].reserved1[0] = 0;
-		fsdwsslo->channel[i].reserved1[1] = 0;
-		fsdwsslo->channel[i].reserved1[2] = 0;
-		fsdwsslo->channel[i].number_samples = 0;
-		fsdwsslo->channel[i].start_time = 0;
-		fsdwsslo->channel[i].sample_interval = 0;
-		fsdwsslo->channel[i].range = 0.0;
-		fsdwsslo->channel[i].voltage = 0.0;
-		for (j=0;j<16;j++)
-			fsdwsslo->channel[i].name[j] = '\0';
-		for (j=0;j<20;j++)
-			fsdwsslo->channel[i].reserved2[j] = 0;
-		fsdwsslo->channel[i].data_alloc = 0;
-		fsdwsslo->channel[i].data = NULL;
-		}
-
-	/* Edgetech FS-DW high frequency sidescan (record 3000) */
-	fsdwsshi = &store->fsdwsshi;
-	mbsys_reson7k_zero7kheader(verbose, &fsdwsshi->header, error);
-	fsdwsshi->msec_timestamp = 0;
-	fsdwsshi->ping_number = 0;
-	fsdwsshi->number_channels = 0;
-	fsdwsshi->total_bytes = 0;
-	fsdwsshi->data_format = 0;
-	for (i=0;i<2;i++)
-		{
-		fsdwsshi->channel[i].number = 0;
-		fsdwsshi->channel[i].type = 0;
-		fsdwsshi->channel[i].data_type = 0;
-		fsdwsshi->channel[i].polarity = 0;
-		fsdwsshi->channel[i].bytespersample = 0;
-		fsdwsshi->channel[i].reserved1[0] = 0;
-		fsdwsshi->channel[i].reserved1[1] = 0;
-		fsdwsshi->channel[i].reserved1[2] = 0;
-		fsdwsshi->channel[i].number_samples = 0;
-		fsdwsshi->channel[i].start_time = 0;
-		fsdwsshi->channel[i].sample_interval = 0;
-		fsdwsshi->channel[i].range = 0.0;
-		fsdwsshi->channel[i].voltage = 0.0;
-		for (j=0;j<16;j++)
-			fsdwsshi->channel[i].name[j] = '\0';
-		for (j=0;j<20;j++)
-			fsdwsshi->channel[i].reserved2[j] = 0;
-		fsdwsshi->channel[i].data_alloc = 0;
-		fsdwsshi->channel[i].data = NULL;
-		}
-
-	/* Edgetech FS-DW subbottom (record 3001) */
-	fsdwsb = &store->fsdwsb;
-	mbsys_reson7k_zero7kheader(verbose, &fsdwsb->header, error);
-	fsdwsb->msec_timestamp = 0;
-	fsdwsb->ping_number = 0;
-	fsdwsb->number_channels = 0;
-	fsdwsb->total_bytes = 0;
-	fsdwsb->data_format = 0;
-	fsdwsb->channel.number = 0;
-	fsdwsb->channel.type = 0;
-	fsdwsb->channel.data_type = 0;
-	fsdwsb->channel.polarity = 0;
-	fsdwsb->channel.bytespersample = 0;
-	fsdwsb->channel.reserved1[0] = 0;
-	fsdwsb->channel.reserved1[1] = 0;
-	fsdwsb->channel.reserved1[2] = 0;
-	fsdwsb->channel.number_samples = 0;
-	fsdwsb->channel.start_time = 0;
-	fsdwsb->channel.sample_interval = 0;
-	fsdwsb->channel.range = 0.0;
-	fsdwsb->channel.voltage = 0.0;
-	for (j=0;j<16;j++)
-		fsdwsb->channel.name[j] = '\0';
-	for (j=0;j<20;j++)
-		fsdwsb->channel.reserved2[j] = '\0';
-	fsdwsb->channel.data_alloc = 0;
-	fsdwsb->channel.data = NULL;
-
-	/* Bluefin data frames (record 3100) */
-	bluefin = &store->bluefin;
-	mbsys_reson7k_zero7kheader(verbose, &bluefin->header, error);
-	bluefin->msec_timestamp = 0;
-	bluefin->number_frames = 0;
-	bluefin->frame_size = 0;
-	bluefin->data_format = 0;
-	for (i=0;i<16;i++)
-		bluefin->reserved[i] = 0;
-	for (i=0;i<BLUEFIN_MAX_FRAMES;i++)
-		{
-		bluefin->nav[i].packet_size = 0;
-		bluefin->nav[i].version = 0;
-		bluefin->nav[i].offset = 0;
-		bluefin->nav[i].data_type = 0;
-		bluefin->nav[i].data_size = 0;
-		bluefin->nav[i].s7kTime.Year = 0;
-		bluefin->nav[i].s7kTime.Day = 0;
-		bluefin->nav[i].s7kTime.Seconds = 0.0;
-		bluefin->nav[i].s7kTime.Hours = 0;
-		bluefin->nav[i].s7kTime.Minutes = 0;
-		bluefin->nav[i].checksum = 0;
-		bluefin->nav[i].timedelay = 0;
-		bluefin->nav[i].quality = 0;
-		bluefin->nav[i].latitude = 0.0;
-		bluefin->nav[i].longitude = 0.0;
-		bluefin->nav[i].speed = 0.0;
-		bluefin->nav[i].depth = 0.0;
-		bluefin->nav[i].altitude = 0.0;
-		bluefin->nav[i].roll = 0.0;
-		bluefin->nav[i].pitch = 0.0;
-		bluefin->nav[i].yaw = 0.0;
-		bluefin->nav[i].northing_rate = 0.0;
-		bluefin->nav[i].easting_rate = 0.0;
-		bluefin->nav[i].depth_rate = 0.0;
-		bluefin->nav[i].altitude_rate = 0.0;
-		bluefin->nav[i].roll_rate = 0.0;
-		bluefin->nav[i].pitch_rate = 0.0;
-		bluefin->nav[i].yaw_rate = 0.0;
-		bluefin->nav[i].position_time = 0.0;
-		bluefin->nav[i].depth_time = 0.0;
-		bluefin->environmental[i].packet_size = 0;
-		bluefin->environmental[i].version = 0;
-		bluefin->environmental[i].offset = 0;
-		bluefin->environmental[i].data_type = 0;
-		bluefin->environmental[i].data_size = 0;
-		bluefin->environmental[i].s7kTime.Year = 0;
-		bluefin->environmental[i].s7kTime.Day = 0;
-		bluefin->environmental[i].s7kTime.Seconds = 0.0;
-		bluefin->environmental[i].s7kTime.Hours = 0;
-		bluefin->environmental[i].s7kTime.Minutes = 0;
-		bluefin->environmental[i].checksum = 0;
-		bluefin->environmental[i].reserved1 = 0;
-		bluefin->environmental[i].quality = 0;
-		bluefin->environmental[i].sound_speed = 0.0;
-		bluefin->environmental[i].conductivity = 0.0;
-		bluefin->environmental[i].temperature = 0.0;
-		bluefin->environmental[i].pressure = 0.0;
-		bluefin->environmental[i].salinity = 0.0;
-		bluefin->environmental[i].ctd_time = 0.0;
-		bluefin->environmental[i].temperature_time = 0.0;
-		bluefin->environmental[i].surface_pressure = 0.0;
-		bluefin->environmental[i].temperature_counts = 0;
-		bluefin->environmental[i].conductivity_frequency = 0.0;
-		bluefin->environmental[i].pressure_counts = 0;
-		bluefin->environmental[i].pressure_comp_voltage = 0.0;
-		bluefin->environmental[i].sensor1 = 0;
-		bluefin->environmental[i].sensor2 = 0;
-		bluefin->environmental[i].sensor3 = 0;
-		bluefin->environmental[i].sensor4 = 0;
-		bluefin->environmental[i].sensor5 = 0;
-		bluefin->environmental[i].sensor6 = 0;
-		bluefin->environmental[i].sensor7 = 0;
-		bluefin->environmental[i].sensor8 = 0;
-		for (j=0;j<8;j++)
-			bluefin->environmental[i].reserved2[j] = 0;
-		}
-
-	/* Processed sidescan - MB-System extension to 7k format (record 3199) */
-	processedsidescan = &store->processedsidescan;
-	mbsys_reson7k_zero7kheader(verbose, &processedsidescan->header, error);
-	processedsidescan->serial_number = 0;
-	processedsidescan->ping_number = 0;
-	processedsidescan->multi_ping = 0;
-	processedsidescan->recordversion = 0;
-	processedsidescan->ss_source = 0;
-	processedsidescan->number_pixels = 0;
-	processedsidescan->ss_type = 0;
-	processedsidescan->pixelwidth = 0;
-	processedsidescan->sonardepth = 0;
-	processedsidescan->altitude = 0;
-	for (i=0;i<MBSYS_RESON7K_MAX_PIXELS;i++)
-		{
-		processedsidescan->sidescan[i] = 0.0;
-		processedsidescan->alongtrack[i] = 0.0;
-		}
-
-	/* Reson 7k volatile sonar settings (record 7000) */
-	volatilesettings = &store->volatilesettings;
-	mbsys_reson7k_zero7kheader(verbose, &volatilesettings->header, error);
-	volatilesettings->serial_number = 0;
-	volatilesettings->ping_number = 0;
-	volatilesettings->multi_ping = 0;
-	volatilesettings->frequency = 0.0;
-	volatilesettings->sample_rate = 0.0;
-	volatilesettings->receiver_bandwidth = 0.0;
-	volatilesettings->pulse_width = 0.0;
-	volatilesettings->pulse_type = 0;
-	volatilesettings->pulse_envelope = 0;
-	volatilesettings->pulse_envelope_par = 0.0;
-	volatilesettings->pulse_reserved = 0;
-	volatilesettings->max_ping_rate = 0.0;
-	volatilesettings->ping_period = 0.0;
-	volatilesettings->range_selection = 0.0;
-	volatilesettings->power_selection = 0.0;
-	volatilesettings->gain_selection = 0.0;
-	volatilesettings->control_flags = 0;
-	volatilesettings->projector_magic_no = 0;
-	volatilesettings->steering_vertical = 0.0;
-	volatilesettings->steering_horizontal = 0.0;
-	volatilesettings->beamwidth_vertical = 0.0;
-	volatilesettings->beamwidth_horizontal = 0.0;
-	volatilesettings->focal_point = 0.0;
-	volatilesettings->projector_weighting = 0;
-	volatilesettings->projector_weighting_par = 0.0;
-	volatilesettings->transmit_flags = 0;
-	volatilesettings->hydrophone_magic_no = 0;
-	volatilesettings->receive_weighting = 0;
-	volatilesettings->receive_weighting_par = 0.0;
-	volatilesettings->receive_flags = 0;
-	volatilesettings->receive_width = 0.0;
-	volatilesettings->range_minimum = 0.0;
-	volatilesettings->range_maximum = 0.0;
-	volatilesettings->depth_minimum = 0.0;
-	volatilesettings->depth_maximum = 0.0;
-	volatilesettings->absorption = 0.0;
-	volatilesettings->sound_velocity = 0.0;
-	volatilesettings->spreading = 0.0;
-	volatilesettings->reserved = 0;
-
-	/* Reson 7k configuration (record 7001) */
-	configuration = &store->configuration;
-	mbsys_reson7k_zero7kheader(verbose, &configuration->header, error);
-	configuration->serial_number = 0;
-	configuration->number_devices = 0;
-	for (i=0;i<MBSYS_RESON7K_MAX_DEVICE;i++)
-		{
-		configuration->device[i].magic_number = 0;
-		for (j=0;j<16;j++)
-			configuration->device[i].description[j] = '\0';
-		configuration->device[i].serial_number = 0;
-		configuration->device[i].info_length = 0;
-		configuration->device[i].info_alloc = 0;
-		configuration->device[i].info = NULL;
-		}
-
-	/* Reson 7k match filter (record 7002) */
-	matchfilter = &store->matchfilter;
-	mbsys_reson7k_zero7kheader(verbose, &matchfilter->header, error);
-	matchfilter->serial_number = 0;
-	matchfilter->ping_number = 0;
-	matchfilter->operation = 0;
-	matchfilter->start_frequency = 0.0;
-	matchfilter->end_frequency = 0.0;
-
-	/* Reson 7k firmware and hardware configuration (record 7003) */
-	v2firmwarehardwareconfiguration = &store->v2firmwarehardwareconfiguration;
-	mbsys_reson7k_zero7kheader(verbose, &v2firmwarehardwareconfiguration->header, error);
-	v2firmwarehardwareconfiguration->device_count = 0;
-	v2firmwarehardwareconfiguration->info_length = 0;
-	v2firmwarehardwareconfiguration->info_alloc = 0;
-	v2firmwarehardwareconfiguration->info = NULL;
-
-	/* Reson 7k beam geometry (record 7004) */
-	beamgeometry = &store->beamgeometry;
-	mbsys_reson7k_zero7kheader(verbose, &beamgeometry->header, error);
-	beamgeometry->serial_number = 0;
-	beamgeometry->number_beams = 0;
-	for (i=0;i<MBSYS_RESON7K_MAX_BEAMS;i++)
-		{
-		beamgeometry->angle_alongtrack[i] = 0.0;
-		beamgeometry->angle_acrosstrack[i] = 0.0;
-		beamgeometry->beamwidth_alongtrack[i] = 0.0;
-		beamgeometry->beamwidth_acrosstrack[i] = 0.0;
-		}
-
-	/* Reson 7k calibration data (record 7005) */
-	calibration = &store->calibration;
-	mbsys_reson7k_zero7kheader(verbose, &calibration->header, error);
-	calibration->serial_number = 0;
-	calibration->number_channels = 0;
-	for (i=0;i<MBSYS_RESON7K_MAX_RECEIVERS;i++)
-		{
-		calibration->gain[i] = 0.0;
-		calibration->phase[i] = 0.0;
-		}
-
-	/* Reson 7k bathymetry (record 7006) */
-	bathymetry = &store->bathymetry;
-	mbsys_reson7k_zero7kheader(verbose, &bathymetry->header, error);
-	bathymetry->serial_number = 0;
-	bathymetry->ping_number = 0;
-	bathymetry->multi_ping = 0;
-	bathymetry->number_beams = 0;
-	for (i=0;i<MBSYS_RESON7K_MAX_BEAMS;i++)
-		{
-		bathymetry->range[i] = 0.0;
-		bathymetry->quality[i] = 0;
-		bathymetry->intensity[i] = 0.0;
-		bathymetry->min_depth_gate[i] = 0.0;
-		bathymetry->max_depth_gate[i] = 0.0;
-		}
-	bathymetry->optionaldata = MB_NO;
-	bathymetry->frequency = 0.0;
-	bathymetry->latitude = 0.0;
-	bathymetry->longitude = 0.0;
-	bathymetry->heading = 0.0;
-	bathymetry->height_source = 0;
-	bathymetry->tide = 0.0;
-	bathymetry->roll = 0.0;
-	bathymetry->pitch = 0.0;
-	bathymetry->heave = 0.0;
-	bathymetry->vehicle_height = 0.0;
-	for (i=0;i<MBSYS_RESON7K_MAX_BEAMS;i++)
-		{
-		bathymetry->depth[i] = 0.0;
-		bathymetry->alongtrack[i] = 0.0;
-		bathymetry->acrosstrack[i] = 0.0;
-		bathymetry->pointing_angle[i] = 0.0;
-		bathymetry->azimuth_angle[i] = 0.0;
-		}
-	bathymetry->acrossalongerror = MB_MAYBE;
-	bathymetry->nacrossalongerroryes = 0;
-	bathymetry->nacrossalongerrorno = 0;
-
-	/* Reson 7k backscatter imagery data (record 7007) */
-	backscatter = &store->backscatter;
-	mbsys_reson7k_zero7kheader(verbose, &backscatter->header, error);
-	backscatter->serial_number = 0;
-	backscatter->ping_number = 0;
-	backscatter->multi_ping = 0;
-	backscatter->beam_position = 0.0;
-	backscatter->control_flags = 0;
-	backscatter->number_samples = 0;
-	backscatter->port_beamwidth_x = 0.0;
-	backscatter->port_beamwidth_y = 0.0;
-	backscatter->stbd_beamwidth_x = 0.0;
-	backscatter->stbd_beamwidth_y = 0.0;
-	backscatter->port_steering_x = 0.0;
-	backscatter->port_steering_y = 0.0;
-	backscatter->stbd_steering_x = 0.0;
-	backscatter->stbd_steering_y = 0.0;
-	backscatter->number_beams = 0;
-	backscatter->current_beam = 0;
-	backscatter->sample_size = 0;
-	backscatter->data_type = 0;
-	backscatter->nalloc = 0;
-	backscatter->port_data = NULL;
-	backscatter->stbd_data = NULL;
-	backscatter->optionaldata = MB_NO;
-	backscatter->frequency = 0.0;
-	backscatter->latitude = 0.0;
-	backscatter->longitude = 0.0;
-	backscatter->heading = 0.0;
-	backscatter->altitude = 0.0;
-
-	/* Reson 7k beam data (record 7008) */
-	beam = &store->beam;
-	mbsys_reson7k_zero7kheader(verbose, &beam->header, error);
-	beam->serial_number = 0;
-	beam->ping_number = 0;
-	beam->multi_ping = 0;
-	beam->number_beams = 0;
-	beam->reserved = 0;
-	beam->number_samples = 0;
-	beam->record_subset_flag = 0;
-	beam->row_column_flag = 0;
-	beam->sample_header_id = 0;
-	beam->sample_type = 0;
-	for (i=0;i<MBSYS_RESON7K_MAX_RECEIVERS;i++)
-		{
-		beam->snippets[i].beam_number = 0;
-		beam->snippets[i].begin_sample = 0;
-		beam->snippets[i].end_sample = 0;
-		beam->snippets[i].nalloc_amp = 0;
-		beam->snippets[i].nalloc_phase = 0;
-		beam->snippets[i].amplitude = NULL;
-		beam->snippets[i].phase = NULL;
-		}
-
-	/* Reson 7k vertical depth (record 7009) */
-	verticaldepth = &store->verticaldepth;
-	mbsys_reson7k_zero7kheader(verbose, &verticaldepth->header, error);
-	verticaldepth->frequency = 0.0;
-	verticaldepth->ping_number = 0;
-	verticaldepth->multi_ping = 0;
-	verticaldepth->latitude = 0.0;
-	verticaldepth->longitude = 0.0;
-	verticaldepth->heading = 0.0;
-	verticaldepth->alongtrack = 0.0;
-	verticaldepth->acrosstrack = 0.0;
-	verticaldepth->vertical_depth = 0;
-
-	/* Reson 7k tvg data (record 7010) */
-	tvg = &store->tvg;
-	mbsys_reson7k_zero7kheader(verbose, &tvg->header, error);
-	tvg->serial_number = 0;
-	tvg->ping_number = 0;
-	tvg->multi_ping = 0;
-	tvg->n = 0;
-	for (i=0;i<8;i++)
-		tvg->reserved[i] = 0;
-	tvg->nalloc = 0;
-	tvg->tvg = NULL;
-
-	/* Reson 7k image data (record 7011) */
-	image = &store->image;
-	mbsys_reson7k_zero7kheader(verbose, &image->header, error);
-	image->ping_number = 0;
-	image->multi_ping = 0;
-	image->width = 0;
-	image->height = 0;
-	image->color_depth = 0;
-	image->width_height_flag = 0;
-	image->compression = 0;
-	image->nalloc = 0;
-	image->image = NULL;
-
-	/* Ping motion (record 7012) */
-	v2pingmotion = &store->v2pingmotion;
-	mbsys_reson7k_zero7kheader(verbose, &v2pingmotion->header, error);
-	v2pingmotion->serial_number = 0;
-	v2pingmotion->ping_number = 0;
-	v2pingmotion->multi_ping = 0;
-	v2pingmotion->n = 0;
-	v2pingmotion->flags = 0;
-	v2pingmotion->error_flags = 0;
-	v2pingmotion->frequency = 0.0;
-	v2pingmotion->nalloc = 0;
-	v2pingmotion->pitch = 0.0;
-	v2pingmotion->roll = NULL;
-	v2pingmotion->heading = NULL;
-	v2pingmotion->heave = NULL;
-
-	/* Detection setup (record 7017) */
-	v2detectionsetup = &store->v2detectionsetup;
-	mbsys_reson7k_zero7kheader(verbose, &v2detectionsetup->header, error);
-	v2detectionsetup->serial_number = 0;
-	v2detectionsetup->ping_number = 0;
-	v2detectionsetup->multi_ping = 0;
-	v2detectionsetup->number_beams = 0;
-	v2detectionsetup->data_field_size = 0;
-	v2detectionsetup->detection_algorithm = 0;
-	v2detectionsetup->detection_flags = 0;
-	v2detectionsetup->minimum_depth = 0.0;
-	v2detectionsetup->maximum_depth = 0.0;
-	v2detectionsetup->minimum_range = 0.0;
-	v2detectionsetup->maximum_range = 0.0;
-	v2detectionsetup->minimum_nadir_search = 0.0;
-	v2detectionsetup->maximum_nadir_search = 0.0;
-	v2detectionsetup->automatic_filter_window = 0.0;
-	v2detectionsetup->applied_roll = 0.0;
-	v2detectionsetup->depth_gate_tilt = 0.0;
-	for (i=0;i<14;i++)
-		v2detectionsetup->reserved[i] = 0.0;
-	for (i=0;i<MBSYS_RESON7K_MAX_BEAMS;i++)
-		{
-		v2detectionsetup->beam_descriptor[i] = 0;
-		v2detectionsetup->detection_point[i] = 0.0;
-		v2detectionsetup->flags[i] = 0;
-		v2detectionsetup->auto_limits_min_sample[i] = 0;
-		v2detectionsetup->auto_limits_max_sample[i] = 0;
-		v2detectionsetup->user_limits_min_sample[i] = 0;
-		v2detectionsetup->user_limits_max_sample[i] = 0;
-		v2detectionsetup->quality[i] = 0;
-		v2detectionsetup->uncertainty[i] = 0;
-		}
-
-	/* Reson 7k beamformed magnitude and phase data (record 7018) */
-	v2beamformed = &store->v2beamformed;
-	mbsys_reson7k_zero7kheader(verbose, &v2beamformed->header, error);
-	v2beamformed->serial_number = 0;
-	v2beamformed->ping_number = 0;
-	v2beamformed->multi_ping = 0;
-	v2beamformed->number_beams = 0;
-	v2beamformed->number_samples = 0;
-	for (i=0;i<32;i++)
-		v2beamformed->reserved[i] = 0;
-	for (i=0;i<MBSYS_RESON7K_MAX_BEAMS;i++)
-		{
-		v2amplitudephase = &v2beamformed->amplitudephase[i];
-		v2amplitudephase->beam_number = 0;
-		v2amplitudephase->number_samples = 0;
-		v2amplitudephase->nalloc = 0;
-		v2amplitudephase->amplitude = NULL;
-		v2amplitudephase->phase = NULL;
-		}
-
-	/* Reson 7k BITE (record 7021) */
-	v2bite = &store->v2bite;
-	mbsys_reson7k_zero7kheader(verbose, &v2bite->header, error);
-	v2bite->number_reports = 0;
-	v2bite->nalloc = 0;
-	v2bite->reports = NULL;
-
-	/* Reson 7k center version (record 7022) */
-	v27kcenterversion = &store->v27kcenterversion;
-	mbsys_reson7k_zero7kheader(verbose, &v27kcenterversion->header, error);
-	for (i=0;i<32;i++)
-		v27kcenterversion->version[i] = 0;
-
-	/* Reson 7k 8k wet end version (record 7023) */
-	v28kwetendversion = &store->v28kwetendversion;
-	mbsys_reson7k_zero7kheader(verbose, &v28kwetendversion->header, error);
-	for (i=0;i<32;i++)
-		v28kwetendversion->version[i] = 0;
-
-	/* Reson 7k version 2 detection (record 7026) */
-	v2detection = &store->v2detection;
-	mbsys_reson7k_zero7kheader(verbose, &v2detection->header, error);
-	v2detection->serial_number = 0;
-	v2detection->ping_number = 0;
-	v2detection->multi_ping = 0;
-	v2detection->number_beams = 0;
-	v2detection->data_field_size = 0;
-	v2detection->corrections = 0;
-	v2detection->detection_algorithm = 0;
-	v2detection->flags = 0;
-	for (i=0;i<64;i++)
-		v2detection->reserved[i] = 0;
-	for (i=0;i<MBSYS_RESON7K_MAX_BEAMS;i++)
-		{
-		v2detection->range[i] = 0.0;
-		v2detection->angle_x[i] = 0.0;
-		v2detection->angle_y[i] = 0.0;
-		v2detection->range_error[i] = 0.0;
-		v2detection->angle_x_error[i] = 0.0;
-		v2detection->angle_y_error[i] = 0.0;
-		}
-
-	/* Reson 7k version 2 raw detection (record 7027) */
-	v2rawdetection = &store->v2rawdetection;
-	mbsys_reson7k_zero7kheader(verbose, &v2rawdetection->header, error);
-	v2rawdetection->serial_number = 0;
-	v2rawdetection->ping_number = 0;
-	v2rawdetection->multi_ping = 0;
-	v2rawdetection->number_beams = 0;
-	v2rawdetection->data_field_size = 0;
-	v2rawdetection->detection_algorithm = 0;
-	v2rawdetection->detection_flags = 0;
-	v2rawdetection->sampling_rate = 0.0;
-	v2rawdetection->tx_angle = 0.0;
-	for (i=0;i<64;i++)
-		v2rawdetection->reserved[i] = 0;
-	for (i=0;i<MBSYS_RESON7K_MAX_BEAMS;i++)
-		{
-		v2rawdetection->beam_descriptor[i] = 0;
-		v2rawdetection->detection_point[i] = 0;
-		v2rawdetection->rx_angle[i] = 0;
-		v2rawdetection->flags[i] = 0;
-		v2rawdetection->quality[i] = 0;
-		v2rawdetection->uncertainty[i] = 0;
-		}
-
-	/* Reson 7k version 2 snippet (record 7028) */
-	v2snippet = &store->v2snippet;
-	mbsys_reson7k_zero7kheader(verbose, &v2snippet->header, error);
-	v2snippet->serial_number = 0;
-	v2snippet->ping_number = 0;
-	v2snippet->multi_ping = 0;
-	v2snippet->number_beams = 0;
-	v2snippet->error_flag = 0;
-	v2snippet->control_flags = 0;
-	for (i=0;i<28;i++)
-		v2snippet->reserved[i] = 0;
-	for (i=0;i<MBSYS_RESON7K_MAX_BEAMS;i++)
-		{
-		v2snippettimeseries = &v2snippet->snippettimeseries[i];
-		v2snippettimeseries->beam_number = 0;
-		v2snippettimeseries->begin_sample = 0;
-		v2snippettimeseries->detect_sample = 0;
-		v2snippettimeseries->end_sample = 0;
-		v2snippettimeseries->nalloc = 0;
-		v2snippettimeseries->amplitude = NULL;
-		}
-
-	/* Reson 7k sonar installation parameters (record 7051) */
-	installation = &store->installation;
-	mbsys_reson7k_zero7kheader(verbose, &installation->header, error);
-	installation->frequency = 0.0;
-	installation->firmware_version_len = 0;
-	for (i=0;i<128;i++)
-		installation->firmware_version[i] = 0;
-	installation->software_version_len = 0;
-	for (i=0;i<128;i++)
-		installation->software_version[i] = 0;
-	installation->s7k_version_len = 0;
-	for (i=0;i<128;i++)
-		installation->s7k_version[i] = 0;
-	installation->protocal_version_len = 0;
-	installation->protocal_version[i] = 0;
-	installation->transmit_x = 0.0;
-	installation->transmit_y = 0.0;
-	installation->transmit_z = 0.0;
-	installation->transmit_roll = 0.0;
-	installation->transmit_pitch = 0.0;
-	installation->transmit_heading = 0.0;
-	installation->receive_x = 0.0;
-	installation->receive_y = 0.0;
-	installation->receive_z = 0.0;
-	installation->receive_roll = 0.0;
-	installation->receive_pitch = 0.0;
-	installation->receive_heading = 0.0;
-	installation->motion_x = 0.0;
-	installation->motion_y = 0.0;
-	installation->motion_z = 0.0;
-	installation->motion_roll = 0.0;
-	installation->motion_pitch = 0.0;
-	installation->motion_heading = 0.0;
-	installation->motion_time_delay = 0;
-	installation->position_x = 0.0;
-	installation->position_y = 0.0;
-	installation->position_z = 0.0;
-	installation->position_time_delay = 0;
-	installation->waterline_z = 0.0;
-
-	/* Reson 7k system event (record 7051) */
-	systemeventmessage = &store->systemeventmessage;
-	mbsys_reson7k_zero7kheader(verbose, &systemeventmessage->header, error);
-	systemeventmessage->serial_number = 0;
-	systemeventmessage->event_id = 0;
-	systemeventmessage->message_length = 0;
-	systemeventmessage->event_identifier = 0;
-	systemeventmessage->message_alloc = 0;
-	systemeventmessage->message = NULL;
-
-	/* Reson 7k calibrated snippet (record 7058) */
-	calibratedsnippet = &store->calibratedsnippet;
-	mbsys_reson7k_zero7kheader(verbose, &calibratedsnippet->header, error);
-	calibratedsnippet->serial_number = 0;
-	calibratedsnippet->ping_number = 0;
-	calibratedsnippet->multi_ping = 0;
-	calibratedsnippet->number_beams = 0;
-	calibratedsnippet->error_flag = 0;
-	calibratedsnippet->control_flags = 0;
-	for (i=0;i<28;i++)
-		calibratedsnippet->reserved[i] = 0;
-	for (i=0;i<MBSYS_RESON7K_MAX_BEAMS;i++)
-		{
-		calibratedsnippettimeseries = &calibratedsnippet->calibratedsnippettimeseries[i];
-		calibratedsnippettimeseries->beam_number = 0;
-		calibratedsnippettimeseries->begin_sample = 0;
-		calibratedsnippettimeseries->detect_sample = 0;
-		calibratedsnippettimeseries->end_sample = 0;
-		calibratedsnippettimeseries->nalloc = 0;
-		calibratedsnippettimeseries->amplitude = NULL;
-		}
-
-	/* Reson 7k file header (record 7200) */
-	fileheader = &store->fileheader;
-	mbsys_reson7k_zero7kheader(verbose, &fileheader->header, error);
-	for (i=0;i<16;i++)
-		fileheader->file_identifier[i] = '\0';
-	fileheader->version = 0;
-	fileheader->reserved = 0;
-	for (i=0;i<16;i++)
-		fileheader->session_identifier[i] = '\0';
-	fileheader->record_data_size = 0;
-	fileheader->number_subsystems = 0;
-	for (i=0;i<64;i++)
-		fileheader->recording_name[i] = '\0';
-	for (i=0;i<16;i++)
-		fileheader->recording_version[i] = '\0';
-	for (i=0;i<64;i++)
-		fileheader->user_defined_name[i] = '\0';
-	for (i=0;i<128;i++)
-		fileheader->notes[i] = '\0';
-	for (j=0;j<MBSYS_RESON7K_MAX_DEVICE;j++)
-		{
-		fileheader->subsystem[j].device_identifier = 0;
-		fileheader->subsystem[j].system_enumerator = 0;
-		}
-
-	/* Reson 7k remote control sonar settings (record 7503) */
-	remotecontrolsettings = &store->remotecontrolsettings;
-	mbsys_reson7k_zero7kheader(verbose, &remotecontrolsettings->header, error);
-	remotecontrolsettings->serial_number = 0;
-	remotecontrolsettings->ping_number = 0;
-	remotecontrolsettings->frequency = 0.0;
-	remotecontrolsettings->sample_rate = 0.0;
-	remotecontrolsettings->receiver_bandwidth = 0.0;
-	remotecontrolsettings->pulse_width = 0.0;
-	remotecontrolsettings->pulse_type = 0;
-	remotecontrolsettings->pulse_envelope = 0;
-	remotecontrolsettings->pulse_envelope_par = 0.0;
-	remotecontrolsettings->pulse_reserved = 0;
-	remotecontrolsettings->max_ping_rate = 0.0;
-	remotecontrolsettings->ping_period = 0.0;
-	remotecontrolsettings->range_selection = 0.0;
-	remotecontrolsettings->power_selection = 0.0;
-	remotecontrolsettings->gain_selection = 0.0;
-	remotecontrolsettings->control_flags = 0;
-	remotecontrolsettings->projector_magic_no = 0;
-	remotecontrolsettings->steering_vertical = 0.0;
-	remotecontrolsettings->steering_horizontal = 0.0;
-	remotecontrolsettings->beamwidth_vertical = 0.0;
-	remotecontrolsettings->beamwidth_horizontal = 0.0;
-	remotecontrolsettings->focal_point = 0.0;
-	remotecontrolsettings->projector_weighting = 0;
-	remotecontrolsettings->projector_weighting_par = 0.0;
-	remotecontrolsettings->transmit_flags = 0;
-	remotecontrolsettings->hydrophone_magic_no = 0;
-	remotecontrolsettings->receive_weighting = 0;
-	remotecontrolsettings->receive_weighting_par = 0.0;
-	remotecontrolsettings->receive_flags = 0;
-	remotecontrolsettings->range_minimum = 0.0;
-	remotecontrolsettings->range_maximum = 0.0;
-	remotecontrolsettings->depth_minimum = 0.0;
-	remotecontrolsettings->depth_maximum = 0.0;
-	remotecontrolsettings->absorption = 0.0;
-	remotecontrolsettings->sound_velocity = 0.0;
-	remotecontrolsettings->spreading = 0.0;
-	remotecontrolsettings->reserved = 0;
-	remotecontrolsettings->tx_offset_x = 0.0;
-	remotecontrolsettings->tx_offset_y = 0.0;
-	remotecontrolsettings->tx_offset_z = 0.0;
-	remotecontrolsettings->head_tilt_x = 0.0;
-	remotecontrolsettings->head_tilt_y = 0.0;
-	remotecontrolsettings->head_tilt_z = 0.0;
-	remotecontrolsettings->ping_on_off = 0;
-	remotecontrolsettings->data_sample_types = 0;
-	remotecontrolsettings->projector_orientation = 0;
-	remotecontrolsettings->beam_angle_mode = 0;
-	remotecontrolsettings->r7kcenter_mode = 0;
-	remotecontrolsettings->gate_depth_min = 0.0;
-	remotecontrolsettings->gate_depth_max = 0.0;
-	for (i=0;i<35;i++)
-		remotecontrolsettings->reserved2[i] = 0;
-
-	/* Reson 7k remote control sonar settings (record 7503) */
-	reserved = &store->reserved;
-	mbsys_reson7k_zero7kheader(verbose, &reserved->header, error);
-	for (i=0;i<R7KHDRSIZE_7kReserved;i++)
-		reserved->reserved[i] = 0;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)*store_ptr);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_reson7k_deall(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_reson7k_deall";
-	int	status = MB_SUCCESS;
-	struct mbsys_reson7k_struct *store;
-	s7kr_customattitude	*customattitude;
-	s7kr_motion		*motion;
-	s7kr_svp		*svp;
-	s7kr_ctd		*ctd;
-	s7kr_surveyline		*surveyline;
-	s7kr_attitude		*attitude;
-	s7kr_fsdwss		*fsdwsslo;
-	s7kr_fsdwss		*fsdwsshi;
-	s7kr_fsdwsb		*fsdwsb;
-	s7kr_configuration	*configuration;
-	s7kr_v2firmwarehardwareconfiguration	*v2firmwarehardwareconfiguration;
-	s7kr_backscatter	*backscatter;
-	s7kr_beam		*beam;
-	s7kr_image		*image;
-	s7kr_v2pingmotion	*v2pingmotion;
-	s7kr_v2amplitudephase	*amplitudephase;
-	s7kr_v2beamformed	*v2beamformed;
-	s7kr_v2bite		*v2bite;
-	s7kr_v2snippettimeseries	*v2snippettimeseries;
-	s7kr_v2snippet		*v2snippet;
-	s7kr_calibratedsnippettimeseries *calibratedsnippettimeseries;
-	s7kr_calibratedsnippet *calibratedsnippet;
-	s7kr_systemeventmessage	*systemeventmessage;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)*store_ptr);
-		}
-
-	/* get data structure pointer */
-	store = (struct mbsys_reson7k_struct *) *store_ptr;
-
-	/* Custom attitude (record 1004) */
-	customattitude = &store->customattitude;
-	customattitude->n = 0;
-	customattitude->nalloc = 0;
-	if (customattitude->pitch != NULL)
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&(customattitude->pitch),error);
-	if (customattitude->roll != NULL)
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&(customattitude->roll),error);
-	if (customattitude->heading != NULL)
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&(customattitude->heading),error);
-	if (customattitude->heave != NULL)
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&(customattitude->heave),error);
-	if (customattitude->pitchrate != NULL)
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&(customattitude->pitchrate),error);
-	if (customattitude->rollrate != NULL)
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&(customattitude->rollrate),error);
-	if (customattitude->headingrate != NULL)
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&(customattitude->headingrate),error);
-	if (customattitude->heaverate != NULL)
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&(customattitude->heaverate),error);
-
-	/* Motion over ground (record 1007) */
-	motion = &store->motion;
-	motion->n = 0;
-	motion->nalloc = 0;
-	if (motion->x != NULL)
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&(motion->x),error);
-	if (motion->y != NULL)
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&(motion->y),error);
-	if (motion->z != NULL)
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&(motion->z),error);
-	if (motion->xa != NULL)
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&(motion->xa),error);
-	if (motion->ya != NULL)
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&(motion->ya),error);
-	if (motion->za != NULL)
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&(motion->za),error);
-
-	/* Sound velocity profile (record 1009) */
-	svp = &store->svp;
-	svp->n = 0;
-	svp->nalloc = 0;
-	if (svp->depth != NULL)
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&(svp->depth),error);
-	if (svp->sound_velocity != NULL)
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&(svp->sound_velocity),error);
-
-	/* CTD (record 1010) */
-	ctd = &store->ctd;
-	ctd->n = 0;
-	ctd->nalloc = 0;
-	if (ctd->conductivity_salinity != NULL)
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&(ctd->conductivity_salinity),error);
-	if (ctd->temperature != NULL)
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&(ctd->temperature),error);
-	if (ctd->pressure_depth != NULL)
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&(ctd->pressure_depth),error);
-	if (ctd->sound_velocity != NULL)
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&(ctd->sound_velocity),error);
-	if (ctd->absorption != NULL)
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&(ctd->absorption),error);
-
-	/* Survey Line (record 1014) */
-	surveyline = &store->surveyline;
-	surveyline->n = 0;
-	surveyline->nalloc = 0;
-	if (surveyline->latitude != NULL)
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&(surveyline->latitude),error);
-	if (surveyline->longitude != NULL)
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&(surveyline->longitude),error);
-
-	/* Attitude (record 1016) */
-	attitude = &store->attitude;
-	attitude->n = 0;
-	attitude->nalloc = 0;
-	if (attitude->delta_time != NULL)
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&(attitude->delta_time),error);
-	if (attitude->pitch != NULL)
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&(attitude->pitch),error);
-	if (attitude->roll != NULL)
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&(attitude->roll),error);
-	if (attitude->heave != NULL)
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&(attitude->heave),error);
-	if (attitude->heading != NULL)
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&(attitude->heading),error);
-
-	/* Edgetech FS-DW low frequency sidescan (record 3000) */
-	fsdwsslo = &store->fsdwsslo;
-	for (i=0;i<2;i++)
-		{
-		fsdwsslo->channel[i].data_alloc = 0;
-		if (fsdwsslo->channel[i].data != NULL)
-			status = mb_freed(verbose,__FILE__,__LINE__,(void **)&(fsdwsslo->channel[i].data),error);
-		}
-
-	/* Edgetech FS-DW high frequency sidescan (record 3000) */
-	fsdwsshi = &store->fsdwsshi;
-	for (i=0;i<2;i++)
-		{
-		fsdwsshi->channel[i].data_alloc = 0;
-		if (fsdwsshi->channel[i].data != NULL)
-			status = mb_freed(verbose,__FILE__,__LINE__,(void **)&(fsdwsshi->channel[i].data),error);
-		}
-
-	/* Edgetech FS-DW subbottom (record 3001) */
-	fsdwsb = &store->fsdwsb;
-	fsdwsb->channel.data_alloc = 0;
-	if (fsdwsb->channel.data != NULL)
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&(fsdwsb->channel.data),error);
-
-	/* Reson 7k configuration (record 7001) */
-	configuration = &store->configuration;
-	for (i=0;i<MBSYS_RESON7K_MAX_DEVICE;i++)
-		{
-		configuration->device[i].info_length = 0;
-		configuration->device[i].info_alloc = 0;
-		if (configuration->device[i].info != NULL)
-			status = mb_freed(verbose,__FILE__,__LINE__,(void **)&(configuration->device[i].info),error);
-		}
-
-	/* Reson 7k firmware and hardware configuration (record 7003) */
-	v2firmwarehardwareconfiguration = &store->v2firmwarehardwareconfiguration;
-	if (v2firmwarehardwareconfiguration->info != NULL && v2firmwarehardwareconfiguration->info_alloc > 0)
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&(v2firmwarehardwareconfiguration->info),error);
-	v2firmwarehardwareconfiguration->info_length = 0;
-	v2firmwarehardwareconfiguration->info_alloc = 0;
-
-	/* Reson 7k backscatter imagery data (record 7007) */
-	backscatter = &store->backscatter;
-	backscatter->number_samples = 0;
-	backscatter->nalloc = 0;
-	if (backscatter->port_data != NULL)
-			status = mb_freed(verbose,__FILE__,__LINE__,(void **)&(backscatter->port_data),error);
-	if (backscatter->stbd_data != NULL)
-			status = mb_freed(verbose,__FILE__,__LINE__,(void **)&(backscatter->stbd_data),error);
-
-	/* Reson 7k beam data (record 7008) */
-	beam = &store->beam;
-	for (i=0;i<MBSYS_RESON7K_MAX_RECEIVERS;i++)
-		{
-		beam->snippets[i].begin_sample = 0;
-		beam->snippets[i].end_sample = 0;
-		beam->snippets[i].nalloc_amp = 0;
-		beam->snippets[i].nalloc_phase = 0;
-		if (beam->snippets[i].amplitude != NULL)
-			status = mb_freed(verbose,__FILE__,__LINE__,(void **)&(beam->snippets[i].amplitude),error);
-		if (beam->snippets[i].phase != NULL)
-			status = mb_freed(verbose,__FILE__,__LINE__,(void **)&(beam->snippets[i].phase),error);
-		}
-
-	/* Reson 7k image data (record 7011) */
-	image = &store->image;
-	image->width = 0;
-	image->height = 0;
-	image->nalloc = 0;
-	if (image->image != NULL)
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&(image->image),error);
-
-	/* Reson 7k ping motion (record 7012) */
-	v2pingmotion = &store->v2pingmotion;
-	v2pingmotion->n = 0;
-	v2pingmotion->nalloc = 0;
-	if (v2pingmotion->roll != NULL)
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&(v2pingmotion->roll),error);
-	if (v2pingmotion->heading != NULL)
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&(v2pingmotion->heading),error);
-	if (v2pingmotion->heave != NULL)
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&(v2pingmotion->heave),error);
-
-	/* Reson 7k beamformed magnitude and phase data (record 7018) */
-	v2beamformed = &store->v2beamformed;
-	for (i=0;i<MBSYS_RESON7K_MAX_BEAMS;i++)
-		{
-		amplitudephase = &(v2beamformed->amplitudephase[i]);
-		amplitudephase->number_samples = 0;
-		amplitudephase->nalloc = 0;
-		if (amplitudephase->amplitude != NULL)
-			status = mb_freed(verbose,__FILE__,__LINE__,(void **)&(amplitudephase->amplitude),error);
-		if (amplitudephase->phase != NULL)
-			status = mb_freed(verbose,__FILE__,__LINE__,(void **)&(amplitudephase->phase),error);
-		}
-
-	/* Reson 7k BITE (record 7021) */
-	v2bite = &store->v2bite;
-	v2bite->number_reports = 0;
-	v2bite->nalloc = 0;
-	if (v2bite->reports != NULL)
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&(v2bite->reports),error);
-
-	/* Reson 7k version 2 snippet (record 7028) */
-	v2snippet = &store->v2snippet;
-	v2snippet->number_beams = 0;
-	for (i=0;i<MBSYS_RESON7K_MAX_BEAMS;i++)
-		{
-		v2snippettimeseries = &(v2snippet->snippettimeseries[i]);
-		v2snippettimeseries->beam_number = 0;
-		v2snippettimeseries->begin_sample = 0;
-		v2snippettimeseries->detect_sample = 0;
-		v2snippettimeseries->end_sample = 0;
-		v2snippettimeseries->nalloc = 0;
-		if (amplitudephase->amplitude != NULL)
-			status = mb_freed(verbose,__FILE__,__LINE__,(void **)&(v2snippettimeseries->amplitude),error);
-		}
-
-	/* Reson 7k system event (record 7051) */
-	systemeventmessage = &store->systemeventmessage;
-	systemeventmessage->message_length = 0;
-	systemeventmessage->event_identifier = 0;
-	systemeventmessage->message_alloc = 0;
-	if (systemeventmessage->message != NULL)
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&(systemeventmessage->message),error);
-
-	/* Reson 7k calibrated snippet (record 7058) */
-	calibratedsnippet = &store->calibratedsnippet;
-	calibratedsnippet->number_beams = 0;
-	for (i=0;i<MBSYS_RESON7K_MAX_BEAMS;i++)
-		{
-		calibratedsnippettimeseries = &(calibratedsnippet->calibratedsnippettimeseries[i]);
-		calibratedsnippettimeseries->beam_number = 0;
-		calibratedsnippettimeseries->begin_sample = 0;
-		calibratedsnippettimeseries->detect_sample = 0;
-		calibratedsnippettimeseries->end_sample = 0;
-		calibratedsnippettimeseries->nalloc = 0;
-		if (amplitudephase->amplitude != NULL)
-			status = mb_freed(verbose,__FILE__,__LINE__,(void **)&(calibratedsnippettimeseries->amplitude),error);
-		}
-
-	/* deallocate memory for data structure */
-	status = mb_freed(verbose,__FILE__,__LINE__,(void **)store_ptr,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-/* 7K Macros */
-int mbsys_reson7k_checkheader(s7k_header header)
-    {
-        return ( ( header.Version          >   0                                  ) &&
-                 ( header.SyncPattern      ==  0x0000ffff                         ) &&
-                 ( header.Size             >   MBSYS_RESON7K_RECORDHEADER_SIZE    ) &&
-                 ( header.s7kTime.Day     >= 1    ) &&
-                 ( header.s7kTime.Day     <= 366  ) &&
-                 ( header.s7kTime.Seconds  >= 0.0f ) &&
-                 ( header.s7kTime.Seconds  < 60.0f ) &&
-                 ( header.s7kTime.Hours   <= 23   ) &&
-                 ( header.s7kTime.Minutes <= 59   )  );
-    }
-
-
-/*--------------------------------------------------------------------*/
-int mbsys_reson7k_print_header(int verbose,
-			s7k_header *header,
-			int *error)
-{
-	char	*function_name = "mbsys_reson7k_print_header";
-	int	status = MB_SUCCESS;
-	char	*debug_str = "dbg2  ";
-	char	*nodebug_str = "  ";
-	char	*first;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       header:     %p\n",(void *)header);
-		}
-
-	/* print Reson 7k data record header information */
-	if (verbose >= 2)
-		first = debug_str;
-	else
-		{
-		first = nodebug_str;
-		fprintf(stderr,"\n%sMBIO function <%s> called\n",
-			first,function_name);
-		}
-	fprintf(stderr,"%sStructure Contents:\n", first);
-	fprintf(stderr,"%s     Version:                 %d\n",first,header->Version);
-	fprintf(stderr,"%s     Offset:                  %d\n",first,header->Offset);
-	fprintf(stderr,"%s     SyncPattern:             %d\n",first,header->SyncPattern);
-	fprintf(stderr,"%s     Size:                    %d\n",first,header->Size);
-	fprintf(stderr,"%s     OffsetToOptionalData:    %d\n",first,header->OffsetToOptionalData);
-	fprintf(stderr,"%s     OptionalDataIdentifier:  %d\n",first,header->OptionalDataIdentifier);
-	fprintf(stderr,"%s     s7kTime.Year:            %d\n",first,header->s7kTime.Year);
-	fprintf(stderr,"%s     s7kTime.Day:             %d\n",first,header->s7kTime.Day);
-	fprintf(stderr,"%s     s7kTime.Seconds:         %f\n",first,header->s7kTime.Seconds);
-	fprintf(stderr,"%s     s7kTime.Hours:           %d\n",first,header->s7kTime.Hours);
-	fprintf(stderr,"%s     7kTime->Minutes:         %d\n",first,header->s7kTime.Minutes);
-	fprintf(stderr,"%s     Reserved:                %d\n",first,header->Reserved);
-	fprintf(stderr,"%s     RecordType:              %d\n",first,header->RecordType);
-	fprintf(stderr,"%s     DeviceId:                %d\n",first,header->DeviceId);
-	fprintf(stderr,"%s     Reserved2:               %d\n",first,header->Reserved2);
-	fprintf(stderr,"%s     SystemEnumerator:        %d\n",first,header->SystemEnumerator);
-	fprintf(stderr,"%s     DataSetNumber:           %d\n",first,header->DataSetNumber);
-	fprintf(stderr,"%s     RecordNumber:            %d\n",first,header->RecordNumber);
-	for (i=0;i<8;i++)
-		{
-		fprintf(stderr,"%s     PreviousRecord[%d]:       %d\n",first,i,header->PreviousRecord[i]);
-		fprintf(stderr,"%s     NextRecord[%d]:           %d\n",first,i,header->NextRecord[i]);
-		}
-	fprintf(stderr,"%s     Flags:                   %d\n",first,header->Flags);
-	fprintf(stderr,"%s     Reserved3:               %d\n",first,header->Reserved3);
-	fprintf(stderr,"%s     Reserved4:               %d\n",first,header->Reserved4);
-	fprintf(stderr,"%s     FragmentedTotal:         %d\n",first,header->FragmentedTotal);
-	fprintf(stderr,"%s     FragmentNumber:          %d\n",first,header->FragmentNumber);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbsys_reson7k_print_reference(int verbose,
-			s7kr_reference *reference,
-			int *error)
-{
-	char	*function_name = "mbsys_reson7k_print_reference";
-	int	status = MB_SUCCESS;
-	char	*debug_str = "dbg2  ";
-	char	*nodebug_str = "  ";
-	char	*first;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       reference:  %p\n",(void *)reference);
-		}
-
-	/* print Reson 7k data record header information */
-	mbsys_reson7k_print_header(verbose, &reference->header, error);
-
-	/* print Reference point information (record 1000) */
-	if (verbose >= 2)
-		first = debug_str;
-	else
-		{
-		first = nodebug_str;
-		fprintf(stderr,"\n%sMBIO function <%s> called\n",
-			first,function_name);
-		}
-	fprintf(stderr,"%sStructure Contents:\n", first);
-	fprintf(stderr,"%s     offset_x:                %f\n",first,reference->offset_x);
-	fprintf(stderr,"%s     offset_y:                %f\n",first,reference->offset_y);
-	fprintf(stderr,"%s     offset_z:                %f\n",first,reference->offset_z);
-	fprintf(stderr,"%s     water_z:                 %f\n",first,reference->water_z);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbsys_reson7k_print_sensoruncal(int verbose,
-			s7kr_sensoruncal *sensoruncal,
-			int *error)
-{
-	char	*function_name = "mbsys_reson7k_print_sensoruncal";
-	int	status = MB_SUCCESS;
-	char	*debug_str = "dbg2  ";
-	char	*nodebug_str = "  ";
-	char	*first;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:      %d\n",verbose);
-		fprintf(stderr,"dbg2       sensoruncal:  %p\n",(void *)sensoruncal);
-		}
-
-	/* print Reson 7k data record header information */
-	mbsys_reson7k_print_header(verbose, &sensoruncal->header, error);
-
-	/* print Sensor uncalibrated offset position information (record 1001) */
-	if (verbose >= 2)
-		first = debug_str;
-	else
-		{
-		first = nodebug_str;
-		fprintf(stderr,"\n%sMBIO function <%s> called\n",
-			first,function_name);
-		}
-	fprintf(stderr,"%sStructure Contents:\n", first);
-	fprintf(stderr,"%s     offset_x:                %f\n",first,sensoruncal->offset_x);
-	fprintf(stderr,"%s     offset_y:                %f\n",first,sensoruncal->offset_y);
-	fprintf(stderr,"%s     offset_z:                %f\n",first,sensoruncal->offset_z);
-	fprintf(stderr,"%s     offset_roll:             %f\n",first,sensoruncal->offset_roll);
-	fprintf(stderr,"%s     offset_pitch:            %f\n",first,sensoruncal->offset_pitch);
-	fprintf(stderr,"%s     offset_yaw:              %f\n",first,sensoruncal->offset_yaw);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbsys_reson7k_print_sensorcal(int verbose,
-			s7kr_sensorcal *sensorcal,
-			int *error)
-{
-	char	*function_name = "mbsys_reson7k_print_sensorcal";
-	int	status = MB_SUCCESS;
-	char	*debug_str = "dbg2  ";
-	char	*nodebug_str = "  ";
-	char	*first;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:      %d\n",verbose);
-		fprintf(stderr,"dbg2       sensorcal:    %p\n",(void *)sensorcal);
-		}
-
-	/* print Reson 7k data record header information */
-	mbsys_reson7k_print_header(verbose, &sensorcal->header, error);
-
-	/* print Sensor Calibrated offset position information (record 1001) */
-	if (verbose >= 2)
-		first = debug_str;
-	else
-		{
-		first = nodebug_str;
-		}
-	fprintf(stderr,"%sStructure Contents:\n", first);
-	fprintf(stderr,"%s     offset_x:                %f\n",first,sensorcal->offset_x);
-	fprintf(stderr,"%s     offset_y:                %f\n",first,sensorcal->offset_y);
-	fprintf(stderr,"%s     offset_z:                %f\n",first,sensorcal->offset_z);
-	fprintf(stderr,"%s     offset_roll:             %f\n",first,sensorcal->offset_roll);
-	fprintf(stderr,"%s     offset_pitch:            %f\n",first,sensorcal->offset_pitch);
-	fprintf(stderr,"%s     offset_yaw:              %f\n",first,sensorcal->offset_yaw);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbsys_reson7k_print_position(int verbose,
-			s7kr_position *position,
-			int *error)
-{
-	char	*function_name = "mbsys_reson7k_print_position";
-	int	status = MB_SUCCESS;
-	char	*debug_str = "dbg2  ";
-	char	*nodebug_str = "  ";
-	char	*first;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:      %d\n",verbose);
-		fprintf(stderr,"dbg2       position:     %p\n",(void *)position);
-		}
-
-	/* print Reson 7k data record header information */
-	mbsys_reson7k_print_header(verbose, &position->header, error);
-
-	/* print Sensor Calibrated offset position information (record 1001) */
-	if (verbose >= 2)
-		first = debug_str;
-	else
-		{
-		first = nodebug_str;
-		fprintf(stderr,"\n%sMBIO function <%s> called\n",
-			first,function_name);
-		}
-	fprintf(stderr,"%sStructure Contents:\n", first);
-	fprintf(stderr,"%s     datum:                   %d\n",first,position->datum);
-	fprintf(stderr,"%s     latency:                 %f\n",first,position->latency);
-	fprintf(stderr,"%s     latitude:                %f\n",first,position->latitude);
-	fprintf(stderr,"%s     longitude:               %f\n",first,position->longitude);
-	fprintf(stderr,"%s     height:                  %f\n",first,position->height);
-	fprintf(stderr,"%s     type:                    %d\n",first,position->type);
-	fprintf(stderr,"%s     utm_zone:                %d\n",first,position->utm_zone);
-	fprintf(stderr,"%s     quality:                 %d\n",first,position->quality);
-	fprintf(stderr,"%s     method:                  %d\n",first,position->method);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbsys_reson7k_print_customattitude(int verbose,
-			s7kr_customattitude *customattitude,
-			int *error)
-{
-	char	*function_name = "mbsys_reson7k_print_customattitude";
-	int	status = MB_SUCCESS;
-	char	*debug_str = "dbg2  ";
-	char	*nodebug_str = "  ";
-	char	*first;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:       %d\n",verbose);
-		fprintf(stderr,"dbg2       customattitude:%p\n",(void *)customattitude);
-		}
-
-	/* print Reson 7k data record header information */
-	mbsys_reson7k_print_header(verbose, &customattitude->header, error);
-
-	/* print Custom attitude (record 1004) */
-	if (verbose >= 2)
-		first = debug_str;
-	else
-		{
-		first = nodebug_str;
-		fprintf(stderr,"\n%sMBIO function <%s> called\n",
-			first,function_name);
-		}
-	fprintf(stderr,"%sStructure Contents:\n", first);
-	fprintf(stderr,"%s     bitfield:                   %d\n",first,customattitude->bitfield);
-	fprintf(stderr,"%s     reserved:                   %d\n",first,customattitude->reserved);
-	fprintf(stderr,"%s     n:                          %d\n",first,customattitude->n);
-	fprintf(stderr,"%s     frequency:                  %f\n",first,customattitude->frequency);
-	fprintf(stderr,"%s     nalloc:                     %d\n",first,customattitude->nalloc);
-	for (i=0;i<customattitude->n;i++)
-		fprintf(stderr,"%s     i:%d pitch:%f roll:%f heading:%f heave:%f\n",
-					first,i,customattitude->pitch[i],customattitude->roll[i],
-					customattitude->heading[i],customattitude->heave[i]);
-	for (i=0;i<customattitude->n;i++)
-		fprintf(stderr,"%s     i:%d pitchrate:%f rollrate:%f headingrate:%f heaverate:%f\n",
-					first,i,customattitude->pitchrate[i],customattitude->rollrate[i],
-					customattitude->headingrate[i],customattitude->heaverate[i]);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbsys_reson7k_print_tide(int verbose,
-			s7kr_tide *tide,
-			int *error)
-{
-	char	*function_name = "mbsys_reson7k_print_tide";
-	int	status = MB_SUCCESS;
-	char	*debug_str = "dbg2  ";
-	char	*nodebug_str = "  ";
-	char	*first;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:      %d\n",verbose);
-		fprintf(stderr,"dbg2       tide:         %p\n",(void *)tide);
-		}
-
-	/* print Reson 7k data record header information */
-	mbsys_reson7k_print_header(verbose, &tide->header, error);
-
-	/* print Tide (record 1005) */
-	if (verbose >= 2)
-		first = debug_str;
-	else
-		{
-		first = nodebug_str;
-		fprintf(stderr,"\n%sMBIO function <%s> called\n",
-			first,function_name);
-		}
-	fprintf(stderr,"%sStructure Contents:\n", first);
-	fprintf(stderr,"%s     tide:                       %f\n",first,tide->tide);
-	fprintf(stderr,"%s     source:                     %d\n",first,tide->source);
-	fprintf(stderr,"%s     flags:                      %d\n",first,tide->flags);
-	fprintf(stderr,"%s     gauge:                      %d\n",first,tide->gauge);
-	fprintf(stderr,"%s     datum:                      %d\n",first,tide->datum);
-	fprintf(stderr,"%s     latency:                    %f\n",first,tide->latency);
-	fprintf(stderr,"%s     latitude:                   %f\n",first,tide->latitude);
-	fprintf(stderr,"%s     longitude:                  %f\n",first,tide->longitude);
-	fprintf(stderr,"%s     height:                     %f\n",first,tide->height);
-	fprintf(stderr,"%s     type:                       %d\n",first,tide->type);
-	fprintf(stderr,"%s     utm_zone:                   %d\n",first,tide->utm_zone);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbsys_reson7k_print_altitude(int verbose,
-			s7kr_altitude *altitude,
-			int *error)
-{
-	char	*function_name = "mbsys_reson7k_print_altitude";
-	int	status = MB_SUCCESS;
-	char	*debug_str = "dbg2  ";
-	char	*nodebug_str = "  ";
-	char	*first;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:      %d\n",verbose);
-		fprintf(stderr,"dbg2       altitude:     %p\n",(void *)altitude);
-		}
-
-	/* print Reson 7k data record header information */
-	mbsys_reson7k_print_header(verbose, &altitude->header, error);
-
-	/* print Altitude (record 1006) */
-	if (verbose >= 2)
-		first = debug_str;
-	else
-		{
-		first = nodebug_str;
-		fprintf(stderr,"\n%sMBIO function <%s> called\n",
-			first,function_name);
-		}
-	fprintf(stderr,"%sStructure Contents:\n", first);
-	fprintf(stderr,"%s     altitude:                   %f\n",first,altitude->altitude);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbsys_reson7k_print_motion(int verbose,
-			s7kr_motion *motion,
-			int *error)
-{
-	char	*function_name = "mbsys_reson7k_print_motion";
-	int	status = MB_SUCCESS;
-	char	*debug_str = "dbg2  ";
-	char	*nodebug_str = "  ";
-	char	*first;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:      %d\n",verbose);
-		fprintf(stderr,"dbg2       motion:       %p\n",(void *)motion);
-		}
-
-	/* print Reson 7k data record header information */
-	mbsys_reson7k_print_header(verbose, &motion->header, error);
-
-	/* print Motion over ground (record 1007) */
-	if (verbose >= 2)
-		first = debug_str;
-	else
-		{
-		first = nodebug_str;
-		fprintf(stderr,"\n%sMBIO function <%s> called\n",
-			first,function_name);
-		}
-	fprintf(stderr,"%sStructure Contents:\n", first);
-	fprintf(stderr,"%s     bitfield:                   %d\n",first,motion->bitfield);
-	fprintf(stderr,"%s     reserved:                   %d\n",first,motion->reserved);
-	fprintf(stderr,"%s     n:                          %d\n",first,motion->n);
-	fprintf(stderr,"%s     frequency:                  %f\n",first,motion->frequency);
-	fprintf(stderr,"%s     nalloc:                     %d\n",first,motion->nalloc);
-	for (i=0;i<motion->n;i++)
-		fprintf(stderr,"%s     i:%d x:%f y:%f z:%f xa:%f ya:%f za:%f\n",
-					first,i,motion->x[i],motion->y[i],motion->z[i],
-					motion->xa[i],motion->ya[i],motion->za[i]);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_reson7k_print_depth(int verbose,
-			s7kr_depth *depth,
-			int *error)
-{
-	char	*function_name = "mbsys_reson7k_print_depth";
-	int	status = MB_SUCCESS;
-	char	*debug_str = "dbg2  ";
-	char	*nodebug_str = "  ";
-	char	*first;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:      %d\n",verbose);
-		fprintf(stderr,"dbg2       depth:        %p\n",(void *)depth);
-		}
-
-	/* print Reson 7k data record header information */
-	mbsys_reson7k_print_header(verbose, &depth->header, error);
-
-	/* print Depth (record 1008) */
-	if (verbose >= 2)
-		first = debug_str;
-	else
-		{
-		first = nodebug_str;
-		fprintf(stderr,"\n%sMBIO function <%s> called\n",
-			first,function_name);
-		}
-	fprintf(stderr,"%sStructure Contents:\n", first);
-	fprintf(stderr,"%s     descriptor:                  %d\n",first,depth->descriptor);
-	fprintf(stderr,"%s     correction:                  %d\n",first,depth->correction);
-	fprintf(stderr,"%s     reserved:                    %d\n",first,depth->reserved);
-	fprintf(stderr,"%s     depth:                       %f\n",first,depth->depth);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbsys_reson7k_print_svp(int verbose,
-			s7kr_svp *svp,
-			int *error)
-{
-	char	*function_name = "mbsys_reson7k_print_svp";
-	int	status = MB_SUCCESS;
-	char	*debug_str = "dbg2  ";
-	char	*nodebug_str = "  ";
-	char	*first;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:      %d\n",verbose);
-		fprintf(stderr,"dbg2       svp:          %p\n",(void *)svp);
-		}
-
-	/* print Reson 7k data record header information */
-	mbsys_reson7k_print_header(verbose, &svp->header, error);
-
-	/* print Sound velocity profile (record 1009) */
-	if (verbose >= 2)
-		first = debug_str;
-	else
-		{
-		first = nodebug_str;
-		fprintf(stderr,"\n%sMBIO function <%s> called\n",
-			first,function_name);
-		}
-	fprintf(stderr,"%sStructure Contents:\n", first);
-	fprintf(stderr,"%s     position_flag:              %d\n",first,svp->position_flag);
-	fprintf(stderr,"%s     reserved1:                  %d\n",first,svp->reserved1);
-	fprintf(stderr,"%s     reserved2:                  %d\n",first,svp->reserved2);
-	fprintf(stderr,"%s     latitude:                   %f\n",first,svp->latitude);
-	fprintf(stderr,"%s     longitude:                  %f\n",first,svp->longitude);
-	fprintf(stderr,"%s     n:                          %d\n",first,svp->n);
-	fprintf(stderr,"%s     nalloc:                     %d\n",first,svp->nalloc);
-	for (i=0;i<svp->n;i++)
-		fprintf(stderr,"%s     i:%d depth:%f sound_velocity:%f\n",
-					first,i,svp->depth[i],svp->sound_velocity[i]);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbsys_reson7k_print_ctd(int verbose,
-			s7kr_ctd *ctd,
-			int *error)
-{
-	char	*function_name = "mbsys_reson7k_print_ctd";
-	int	status = MB_SUCCESS;
-	char	*debug_str = "dbg2  ";
-	char	*nodebug_str = "  ";
-	char	*first;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:      %d\n",verbose);
-		fprintf(stderr,"dbg2       ctd:          %p\n",(void *)ctd);
-		}
-
-	/* print Reson 7k data record header information */
-	mbsys_reson7k_print_header(verbose, &ctd->header, error);
-
-	/* print CTD (record 1010) */
-	if (verbose >= 2)
-		first = debug_str;
-	else
-		{
-		first = nodebug_str;
-		fprintf(stderr,"\n%sMBIO function <%s> called\n",
-			first,function_name);
-		}
-	fprintf(stderr,"%sStructure Contents:\n", first);
-	fprintf(stderr,"%s     frequency:                  %f\n",first,ctd->frequency);
-	fprintf(stderr,"%s     velocity_source_flag:       %d\n",first,ctd->velocity_source_flag);
-	fprintf(stderr,"%s     velocity_algorithm:         %d\n",first,ctd->velocity_algorithm);
-	fprintf(stderr,"%s     conductivity_flag:          %d\n",first,ctd->conductivity_flag);
-	fprintf(stderr,"%s     pressure_flag:              %d\n",first,ctd->pressure_flag);
-	fprintf(stderr,"%s     position_flag:              %d\n",first,ctd->position_flag);
-	fprintf(stderr,"%s     validity:                   %d\n",first,ctd->validity);
-	fprintf(stderr,"%s     reserved:                   %d\n",first,ctd->reserved);
-	fprintf(stderr,"%s     latitude:                   %f\n",first,ctd->latitude);
-	fprintf(stderr,"%s     longitude:                  %f\n",first,ctd->longitude);
-	fprintf(stderr,"%s     sample_rate:                %f\n",first,ctd->sample_rate);
-	fprintf(stderr,"%s     n:                          %d\n",first,ctd->n);
-	fprintf(stderr,"%s     nalloc:                     %d\n",first,ctd->nalloc);
-	for (i=0;i<ctd->n;i++)
-		fprintf(stderr,"%s     i:%d conductivity_salinity:%f temperature:%f pressure_depth:%f sound_velocity:%f absorption:%f\n",
-					first,i,ctd->conductivity_salinity[i],
-					ctd->temperature[i],ctd->pressure_depth[i],
-					ctd->sound_velocity[i],ctd->absorption[i]);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbsys_reson7k_print_geodesy(int verbose,
-			s7kr_geodesy *geodesy,
-			int *error)
-{
-	char	*function_name = "mbsys_reson7k_print_geodesy";
-	int	status = MB_SUCCESS;
-	char	*debug_str = "dbg2  ";
-	char	*nodebug_str = "  ";
-	char	*first;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:      %d\n",verbose);
-		fprintf(stderr,"dbg2       geodesy:      %p\n",(void *)geodesy);
-		}
-
-	/* print Reson 7k data record header information */
-	mbsys_reson7k_print_header(verbose, &geodesy->header, error);
-
-	/* print Geodesy (record 1011) */
-	if (verbose >= 2)
-		first = debug_str;
-	else
-		{
-		first = nodebug_str;
-		fprintf(stderr,"\n%sMBIO function <%s> called\n",
-			first,function_name);
-		}
-	fprintf(stderr,"%sStructure Contents:\n", first);
-	fprintf(stderr,"%s     spheroid:                   %s\n",first,geodesy->spheroid);
-	fprintf(stderr,"%s     semimajoraxis:              %f\n",first,geodesy->semimajoraxis);
-	fprintf(stderr,"%s     flattening:                 %f\n",first,geodesy->flattening);
-	fprintf(stderr,"%s     reserved1:                  %s\n",first,geodesy->reserved1);
-	fprintf(stderr,"%s     datum:                      %s\n",first,geodesy->datum);
-	fprintf(stderr,"%s     calculation_method:         %d\n",first,geodesy->calculation_method);
-	fprintf(stderr,"%s     number_parameters:          %d\n",first,geodesy->number_parameters);
-	fprintf(stderr,"%s     dx:                         %f\n",first,geodesy->dx);
-	fprintf(stderr,"%s     dy:                         %f\n",first,geodesy->dy);
-	fprintf(stderr,"%s     dz:                         %f\n",first,geodesy->dz);
-	fprintf(stderr,"%s     rx:                         %f\n",first,geodesy->rx);
-	fprintf(stderr,"%s     ry:                         %f\n",first,geodesy->ry);
-	fprintf(stderr,"%s     rz:                         %f\n",first,geodesy->rz);
-	fprintf(stderr,"%s     scale:                      %f\n",first,geodesy->scale);
-	fprintf(stderr,"%s     reserved2:                  %s\n",first,geodesy->reserved2);
-	fprintf(stderr,"%s     grid_name:                  %s\n",first,geodesy->grid_name);
-	fprintf(stderr,"%s     distance_units:             %d\n",first,geodesy->distance_units);
-	fprintf(stderr,"%s     angular_units:              %d\n",first,geodesy->angular_units);
-	fprintf(stderr,"%s     latitude_origin:            %f\n",first,geodesy->latitude_origin);
-	fprintf(stderr,"%s     central_meriidan:           %f\n",first,geodesy->central_meriidan);
-	fprintf(stderr,"%s     false_easting:              %f\n",first,geodesy->false_easting);
-	fprintf(stderr,"%s     false_northing:             %f\n",first,geodesy->false_northing);
-	fprintf(stderr,"%s     central_scale_factor:       %f\n",first,geodesy->central_scale_factor);
-	fprintf(stderr,"%s     custum_identifier:          %d\n",first,geodesy->custum_identifier);
-	fprintf(stderr,"%s     reserved3:                  %s\n",first,geodesy->reserved3);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbsys_reson7k_print_rollpitchheave(int verbose,
-			s7kr_rollpitchheave *rollpitchheave,
-			int *error)
-{
-	char	*function_name = "mbsys_reson7k_print_rollpitchheave";
-	int	status = MB_SUCCESS;
-	char	*debug_str = "dbg2  ";
-	char	*nodebug_str = "  ";
-	char	*first;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:        %d\n",verbose);
-		fprintf(stderr,"dbg2       rollpitchheave: %p\n",(void *)rollpitchheave);
-		}
-
-	/* print Reson 7k data record header information */
-	mbsys_reson7k_print_header(verbose, &rollpitchheave->header, error);
-
-	/* print Roll pitch heave (record 1012) */
-	if (verbose >= 2)
-		first = debug_str;
-	else
-		{
-		first = nodebug_str;
-		fprintf(stderr,"\n%sMBIO function <%s> called\n",
-			first,function_name);
-		}
-	fprintf(stderr,"%sStructure Contents:\n", first);
-	fprintf(stderr,"%s     roll:                       %f\n",first,rollpitchheave->roll);
-	fprintf(stderr,"%s     pitch:                      %f\n",first,rollpitchheave->pitch);
-	fprintf(stderr,"%s     heave:                      %f\n",first,rollpitchheave->heave);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbsys_reson7k_print_heading(int verbose,
-			s7kr_heading *heading,
-			int *error)
-{
-	char	*function_name = "mbsys_reson7k_print_heading";
-	int	status = MB_SUCCESS;
-	char	*debug_str = "dbg2  ";
-	char	*nodebug_str = "  ";
-	char	*first;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:      %d\n",verbose);
-		fprintf(stderr,"dbg2       heading:      %p\n",(void *)heading);
-		}
-
-	/* print Reson 7k data record header information */
-	mbsys_reson7k_print_header(verbose, &heading->header, error);
-
-	/* print Heading (record 1013) */
-	if (verbose >= 2)
-		first = debug_str;
-	else
-		{
-		first = nodebug_str;
-		fprintf(stderr,"\n%sMBIO function <%s> called\n",
-			first,function_name);
-		}
-	fprintf(stderr,"%sStructure Contents:\n", first);
-	fprintf(stderr,"%s     heading:                    %f\n",first,heading->heading);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbsys_reson7k_print_surveyline(int verbose,
-			s7kr_surveyline *surveyline,
-			int *error)
-{
-	char	*function_name = "mbsys_reson7k_print_surveyline";
-	int	status = MB_SUCCESS;
-	char	*debug_str = "dbg2  ";
-	char	*nodebug_str = "  ";
-	char	*first;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:      %d\n",verbose);
-		fprintf(stderr,"dbg2       surveyline:   %p\n",(void *)surveyline);
-		}
-
-	/* print Reson 7k data record header information */
-	mbsys_reson7k_print_header(verbose, &surveyline->header, error);
-
-	/* print Survey Line (record 1014) */
-	if (verbose >= 2)
-		first = debug_str;
-	else
-		{
-		first = nodebug_str;
-		fprintf(stderr,"\n%sMBIO function <%s> called\n",
-			first,function_name);
-		}
-	fprintf(stderr,"%sStructure Contents:\n", first);
-	fprintf(stderr,"%s     n:                          %d\n",first,surveyline->n);
-	fprintf(stderr,"%s     type:                       %d\n",first,surveyline->type);
-	fprintf(stderr,"%s     turnradius:                 %f\n",first,surveyline->turnradius);
-	fprintf(stderr,"%s     name:                       %s\n",first,surveyline->name);
-	fprintf(stderr,"%s     nalloc:                     %d\n",first,surveyline->nalloc);
-	for (i=0;i<surveyline->n;i++)
-		fprintf(stderr,"%s     i:%d latitude:%f longitude:%f\n",
-					first,i,surveyline->latitude[i],surveyline->longitude[i]);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbsys_reson7k_print_navigation(int verbose,
-			s7kr_navigation *navigation,
-			int *error)
-{
-	char	*function_name = "mbsys_reson7k_print_navigation";
-	int	status = MB_SUCCESS;
-	char	*debug_str = "dbg2  ";
-	char	*nodebug_str = "  ";
-	char	*first;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:      %d\n",verbose);
-		fprintf(stderr,"dbg2       navigation:   %p\n",(void *)navigation);
-		}
-
-	/* print Reson 7k data record header information */
-	mbsys_reson7k_print_header(verbose, &navigation->header, error);
-
-	/* print Navigation (record 1015) */
-	if (verbose >= 2)
-		first = debug_str;
-	else
-		{
-		first = nodebug_str;
-		fprintf(stderr,"\n%sMBIO function <%s> called\n",
-			first,function_name);
-		}
-	fprintf(stderr,"%sStructure Contents:\n", first);
-	fprintf(stderr,"%s     vertical_reference:         %d\n",first,navigation->vertical_reference);
-	fprintf(stderr,"%s     latitude:                   %f\n",first,navigation->latitude);
-	fprintf(stderr,"%s     longitude:                  %f\n",first,navigation->longitude);
-	fprintf(stderr,"%s     position_accuracy:          %f\n",first,navigation->position_accuracy);
-	fprintf(stderr,"%s     height:                     %f\n",first,navigation->height);
-	fprintf(stderr,"%s     height_accuracy:            %f\n",first,navigation->height_accuracy);
-	fprintf(stderr,"%s     speed:                      %f\n",first,navigation->speed);
-	fprintf(stderr,"%s     course:                     %f\n",first,navigation->course);
-	fprintf(stderr,"%s     heading:                    %f\n",first,navigation->heading);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbsys_reson7k_print_attitude(int verbose,
-			s7kr_attitude *attitude,
-			int *error)
-{
-	char	*function_name = "mbsys_reson7k_print_attitude";
-	int	status = MB_SUCCESS;
-	char	*debug_str = "dbg2  ";
-	char	*nodebug_str = "  ";
-	char	*first;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:      %d\n",verbose);
-		fprintf(stderr,"dbg2       attitude:     %p\n",(void *)attitude);
-		}
-
-	/* print Reson 7k data record header information */
-	mbsys_reson7k_print_header(verbose, &attitude->header, error);
-
-	/* print Attitude (record 1016) */
-	if (verbose >= 2)
-		first = debug_str;
-	else
-		{
-		first = nodebug_str;
-		fprintf(stderr,"\n%sMBIO function <%s> called\n",
-			first,function_name);
-		}
-	fprintf(stderr,"%sStructure Contents:\n", first);
-	fprintf(stderr,"%s     n:                          %d\n",first,attitude->n);
-	fprintf(stderr,"%s     nalloc:                     %d\n",first,attitude->nalloc);
-	for (i=0;i<attitude->n;i++)
-		fprintf(stderr,"%s     i:%d delta_time:%d pitch:%f roll:%f heading:%f heave:%f\n",
-					first,i,attitude->delta_time[i],attitude->pitch[i],attitude->roll[i],
-					attitude->heading[i],attitude->heave[i]);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbsys_reson7k_print_rec1022(int verbose,
-			s7kr_rec1022 *rec1022,
-			int *error)
-{
-	char	*function_name = "mbsys_reson7k_print_rec1022";
-	int	status = MB_SUCCESS;
-	char	*debug_str = "dbg2  ";
-	char	*nodebug_str = "  ";
-	char	*first;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:      %d\n",verbose);
-		fprintf(stderr,"dbg2       rec1022:      %p\n",(void *)rec1022);
-		}
-
-	/* print Reson 7k data record header information */
-	mbsys_reson7k_print_header(verbose, &rec1022->header, error);
-
-	/* print Attitude (record 1016) */
-	if (verbose >= 2)
-		first = debug_str;
-	else
-		{
-		first = nodebug_str;
-		fprintf(stderr,"\n%sMBIO function <%s> called\n",
-			first,function_name);
-		}
-	fprintf(stderr,"%sStructure Contents:\n", first);
-	fprintf(stderr,"%s     record bytes in hex:        |",first);
-	for (i=0;i<R7KHDRSIZE_Rec1022;i++)
-		{
-		fprintf(stderr,"%x|",rec1022->data[i]);
-		}
-	fprintf(stderr,"\n");
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbsys_reson7k_print_fsdwchannel(int verbose, int data_format,
-			s7k_fsdwchannel *fsdwchannel,
-			int *error)
-{
-	char	*function_name = "mbsys_reson7k_print_fsdwchannel";
-	int	status = MB_SUCCESS;
-	char	*debug_str = "dbg2  ";
-	char	*nodebug_str = "  ";
-	char	*first;
-	short	*shortptr;
-	unsigned short	*ushortptr;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:      %d\n",verbose);
-		fprintf(stderr,"dbg2       data_format:  %d\n",data_format);
-		fprintf(stderr,"dbg2       fsdwchannel:  %p\n",(void *)fsdwchannel);
-		}
-
-	/* print Edgetech sidescan or subbottom channel header data */
-	if (verbose >= 2)
-		first = debug_str;
-	else
-		{
-		first = nodebug_str;
-		fprintf(stderr,"\n%sMBIO function <%s> called\n",
-			first,function_name);
-		}
-	fprintf(stderr,"%sStructure Contents:\n", first);
-	fprintf(stderr,"%s     number:                     %d\n",first,fsdwchannel->number);
-	fprintf(stderr,"%s     type:                       %d\n",first,fsdwchannel->type);
-	fprintf(stderr,"%s     data_type:                  %d\n",first,fsdwchannel->data_type);
-	fprintf(stderr,"%s     polarity:                   %d\n",first,fsdwchannel->polarity);
-	fprintf(stderr,"%s     bytespersample:             %d\n",first,fsdwchannel->bytespersample);
-	fprintf(stderr,"%s     reserved1[0]                %d\n",first,fsdwchannel->reserved1[0]);
-	fprintf(stderr,"%s     reserved1[1]                %d\n",first,fsdwchannel->reserved1[1]);
-	fprintf(stderr,"%s     reserved1[2]                %d\n",first,fsdwchannel->reserved1[2]);
-	fprintf(stderr,"%s     number_samples:             %d\n",first,fsdwchannel->number_samples);
-	fprintf(stderr,"%s     start_time:                 %d\n",first,fsdwchannel->start_time);
-	fprintf(stderr,"%s     sample_interval:            %d\n",first,fsdwchannel->sample_interval);
-	fprintf(stderr,"%s     range:                      %f\n",first,fsdwchannel->range);
-	fprintf(stderr,"%s     voltage:                    %f\n",first,fsdwchannel->voltage);
-	fprintf(stderr,"%s     name:                       %s\n",first,fsdwchannel->name);
-	fprintf(stderr,"%s     reserved2:                  %s\n",first,fsdwchannel->reserved2);
-	fprintf(stderr,"%s     data_alloc:                 %d\n",first,fsdwchannel->data_alloc);
-	shortptr = (short *) fsdwchannel->data;
-	ushortptr = (unsigned short *) fsdwchannel->data;
-	for (i=0;i<fsdwchannel->number_samples;i++)
-		{
-		if (data_format == EDGETECH_TRACEFORMAT_ENVELOPE)
-			fprintf(stderr,"%s     data[%d]:                   %d\n", first,i,ushortptr[i]);
-		else if (data_format == EDGETECH_TRACEFORMAT_ANALYTIC)
-			fprintf(stderr,"%s     data[%d]:                   %d %d\n", first,i,shortptr[2*i],shortptr[2*i+1]);
-		else if (data_format == EDGETECH_TRACEFORMAT_RAW)
-			fprintf(stderr,"%s     data[%d]:                   %d\n", first,i,ushortptr[i]);
-		else if (data_format == EDGETECH_TRACEFORMAT_REALANALYTIC)
-			fprintf(stderr,"%s     data[%d]:                   %d\n", first,i,ushortptr[i]);
-		else if (data_format == EDGETECH_TRACEFORMAT_PIXEL)
-			fprintf(stderr,"%s     data[%d]:                   %d\n", first,i,ushortptr[i]);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbsys_reson7k_print_fsdwssheader(int verbose,
-			s7k_fsdwssheader *fsdwssheader,
-			int *error)
-{
-	char	*function_name = "mbsys_reson7k_print_fsdwssheader";
-	int	status = MB_SUCCESS;
-	char	*debug_str = "dbg2  ";
-	char	*nodebug_str = "  ";
-	char	*first;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:       %d\n",verbose);
-		fprintf(stderr,"dbg2       fsdwssheader:  %p\n",(void *)fsdwssheader);
-		}
-
-	/* print Edgetech sidescan or subbottom channel header data */
-	if (verbose >= 2)
-		first = debug_str;
-	else
-		{
-		first = nodebug_str;
-		fprintf(stderr,"\n%sMBIO function <%s> called\n",
-			first,function_name);
-		}
-	fprintf(stderr,"%sStructure Contents:\n", first);
-	fprintf(stderr,"%s     subsystem:                    %d\n",first,fsdwssheader->subsystem);
-	fprintf(stderr,"%s     channelNum:                   %d\n",first,fsdwssheader->channelNum);
-	fprintf(stderr,"%s     pingNum:                      %d\n",first,fsdwssheader->pingNum);
-	fprintf(stderr,"%s     packetNum:                    %d\n",first,fsdwssheader->packetNum);
-	fprintf(stderr,"%s     trigSource:                   %d\n",first,fsdwssheader->trigSource);
-	fprintf(stderr,"%s     samples:                      %d\n",first,fsdwssheader->samples);
-	fprintf(stderr,"%s     sampleInterval:               %d\n",first,fsdwssheader->sampleInterval);
-	fprintf(stderr,"%s     startDepth:                   %d\n",first,fsdwssheader->startDepth);
-	fprintf(stderr,"%s     weightingFactor:              %d\n",first,fsdwssheader->weightingFactor);
-	fprintf(stderr,"%s     ADCGain:                      %d\n",first,fsdwssheader->ADCGain);
-	fprintf(stderr,"%s     ADCMax:                       %d\n",first,fsdwssheader->ADCMax);
-	fprintf(stderr,"%s     rangeSetting:                 %d\n",first,fsdwssheader->rangeSetting);
-	fprintf(stderr,"%s     pulseID:                      %d\n",first,fsdwssheader->pulseID);
-	fprintf(stderr,"%s     markNumber:                   %d\n",first,fsdwssheader->markNumber);
-	fprintf(stderr,"%s     dataFormat:                   %d\n",first,fsdwssheader->dataFormat);
-	fprintf(stderr,"%s     reserved:                     %d\n",first,fsdwssheader->reserved);
-	fprintf(stderr,"%s     millisecondsToday:            %d\n",first,fsdwssheader->millisecondsToday);
-	fprintf(stderr,"%s     year:                         %d\n",first,fsdwssheader->year);
-	fprintf(stderr,"%s     day:                          %d\n",first,fsdwssheader->day);
-	fprintf(stderr,"%s     hour:                         %d\n",first,fsdwssheader->hour);
-	fprintf(stderr,"%s     minute:                       %d\n",first,fsdwssheader->minute);
-	fprintf(stderr,"%s     second:                       %d\n",first,fsdwssheader->second);
-	fprintf(stderr,"%s     heading:                      %d\n",first,fsdwssheader->heading);
-	fprintf(stderr,"%s     pitch:                        %d\n",first,fsdwssheader->pitch);
-	fprintf(stderr,"%s     roll:                         %d\n",first,fsdwssheader->roll);
-	fprintf(stderr,"%s     heave:                        %d\n",first,fsdwssheader->heave);
-	fprintf(stderr,"%s     yaw:                          %d\n",first,fsdwssheader->yaw);
-	fprintf(stderr,"%s     depth:                        %d\n",first,fsdwssheader->depth);
-	fprintf(stderr,"%s     temperature:                  %d\n",first,fsdwssheader->temperature);
-	for (i=0;i<2;i++)
-		fprintf(stderr,"%s     reserved2[%d]:                 %d\n",first,i,fsdwssheader->reserved2[i]);
-	fprintf(stderr,"%s     longitude:                    %d\n",first,fsdwssheader->longitude);
-	fprintf(stderr,"%s     latitude:                     %d\n",first,fsdwssheader->latitude);
-
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbsys_reson7k_print_fsdwsegyheader(int verbose,
-			s7k_fsdwsegyheader *fsdwsegyheader,
-			int *error)
-{
-	char	*function_name = "mbsys_reson7k_print_fsdwsegyheader";
-	int	status = MB_SUCCESS;
-	char	*debug_str = "dbg2  ";
-	char	*nodebug_str = "  ";
-	char	*first;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:         %d\n",verbose);
-		fprintf(stderr,"dbg2       fsdwsegyheader:  %p\n",(void *)fsdwsegyheader);
-		}
-
-	/* print Edgetech sidescan or subbottom channel header data */
-	if (verbose >= 2)
-		first = debug_str;
-	else
-		{
-		first = nodebug_str;
-		fprintf(stderr,"\n%sMBIO function <%s> called\n",
-			first,function_name);
-		}
-	fprintf(stderr,"%sStructure Contents:\n", first);
-	fprintf(stderr,"%s     sequenceNumber:              %d\n",first,fsdwsegyheader->sequenceNumber);
-	fprintf(stderr,"%s     startDepth:                  %d\n",first,fsdwsegyheader->startDepth);
-	fprintf(stderr,"%s     pingNum:                     %d\n",first,fsdwsegyheader->pingNum);
-	fprintf(stderr,"%s     channelNum:                  %d\n",first,fsdwsegyheader->channelNum);
-	for (i=0;i<6;i++)
-		fprintf(stderr,"%s     unused1[%d]:                  %d\n",first,i,fsdwsegyheader->unused1[i]);
-	fprintf(stderr,"%s     traceIDCode:                 %d\n",first,fsdwsegyheader->traceIDCode);
-	for (i=0;i<2;i++)
-		fprintf(stderr,"%s     unused2[%d]:                  %d\n",first,i,fsdwsegyheader->unused2[i]);
-	fprintf(stderr,"%s     dataFormat:                  %d\n",first,fsdwsegyheader->dataFormat);
-	fprintf(stderr,"%s     NMEAantennaeR:               %d\n",first,fsdwsegyheader->NMEAantennaeR);
-	fprintf(stderr,"%s     NMEAantennaeO:               %d\n",first,fsdwsegyheader->NMEAantennaeO);
-	for (i=0;i<32;i++)
-		fprintf(stderr,"%s     RS232[%d]:                   %d\n",first,i,fsdwsegyheader->RS232[i]);
-	fprintf(stderr,"%s     sourceCoordX:                %d\n",first,fsdwsegyheader->sourceCoordX);
-	fprintf(stderr,"%s     sourceCoordY:                %d\n",first,fsdwsegyheader->sourceCoordY);
-	fprintf(stderr,"%s     groupCoordX:                 %d\n",first,fsdwsegyheader->groupCoordX);
-	fprintf(stderr,"%s     groupCoordY:                 %d\n",first,fsdwsegyheader->groupCoordY);
-	fprintf(stderr,"%s     coordUnits:                  %d\n",first,fsdwsegyheader->coordUnits);
-	fprintf(stderr,"%s     annotation:                  %s\n",first,fsdwsegyheader->annotation);
-	fprintf(stderr,"%s     samples:                     %d\n",first,fsdwsegyheader->samples);
-	fprintf(stderr,"%s     sampleInterval:              %d\n",first,fsdwsegyheader->sampleInterval);
-	fprintf(stderr,"%s     ADCGain:                     %d\n",first,fsdwsegyheader->ADCGain);
-	fprintf(stderr,"%s     pulsePower:                  %d\n",first,fsdwsegyheader->pulsePower);
-	fprintf(stderr,"%s     correlated:                  %d\n",first,fsdwsegyheader->correlated);
-	fprintf(stderr,"%s     startFreq:                   %d\n",first,fsdwsegyheader->startFreq);
-	fprintf(stderr,"%s     endFreq:                     %d\n",first,fsdwsegyheader->endFreq);
-	fprintf(stderr,"%s     sweepLength:                 %d\n",first,fsdwsegyheader->sweepLength);
-	for (i=0;i<4;i++)
-		fprintf(stderr,"%s     unused7[%d]:                  %d\n",first,i,fsdwsegyheader->unused7[i]);
-	fprintf(stderr,"%s     aliasFreq:                   %d\n",first,fsdwsegyheader->aliasFreq);
-	fprintf(stderr,"%s     pulseID:                     %d\n",first,fsdwsegyheader->pulseID);
-	for (i=0;i<6;i++)
-		fprintf(stderr,"%s     unused8[%d]:                  %d\n",first,i,fsdwsegyheader->unused8[i]);
-	fprintf(stderr,"%s     year:                        %d\n",first,fsdwsegyheader->year);
-	fprintf(stderr,"%s     day:                         %d\n",first,fsdwsegyheader->day);
-	fprintf(stderr,"%s     hour:                        %d\n",first,fsdwsegyheader->hour);
-	fprintf(stderr,"%s     minute:                      %d\n",first,fsdwsegyheader->minute);
-	fprintf(stderr,"%s     second:                      %d\n",first,fsdwsegyheader->second);
-	fprintf(stderr,"%s     timeBasis:                   %d\n",first,fsdwsegyheader->timeBasis);
-	fprintf(stderr,"%s     weightingFactor:             %d\n",first,fsdwsegyheader->weightingFactor);
-	fprintf(stderr,"%s     unused9:                     %d\n",first,fsdwsegyheader->unused9);
-	fprintf(stderr,"%s     heading:                     %d\n",first,fsdwsegyheader->heading);
-	fprintf(stderr,"%s     pitch:                       %d\n",first,fsdwsegyheader->pitch);
-	fprintf(stderr,"%s     roll:                        %d\n",first,fsdwsegyheader->roll);
-	fprintf(stderr,"%s     temperature:                 %d\n",first,fsdwsegyheader->temperature);
-	fprintf(stderr,"%s     heaveCompensation:           %d\n",first,fsdwsegyheader->heaveCompensation);
-	fprintf(stderr,"%s     trigSource:                  %d\n",first,fsdwsegyheader->trigSource);
-	fprintf(stderr,"%s     markNumber:                  %d\n",first,fsdwsegyheader->markNumber);
-	fprintf(stderr,"%s     NMEAHour:                    %d\n",first,fsdwsegyheader->NMEAHour);
-	fprintf(stderr,"%s     NMEAMinutes:                 %d\n",first,fsdwsegyheader->NMEAMinutes);
-	fprintf(stderr,"%s     NMEASeconds:                 %d\n",first,fsdwsegyheader->NMEASeconds);
-	fprintf(stderr,"%s     NMEACourse:                  %d\n",first,fsdwsegyheader->NMEACourse);
-	fprintf(stderr,"%s     NMEASpeed:                   %d\n",first,fsdwsegyheader->NMEASpeed);
-	fprintf(stderr,"%s     NMEADay:                     %d\n",first,fsdwsegyheader->NMEADay);
-	fprintf(stderr,"%s     NMEAYear:                    %d\n",first,fsdwsegyheader->NMEAYear);
-	fprintf(stderr,"%s     millisecondsToday:           %d\n",first,fsdwsegyheader->millisecondsToday);
-	fprintf(stderr,"%s     ADCMax:                      %d\n",first,fsdwsegyheader->ADCMax);
-	fprintf(stderr,"%s     calConst:                    %d\n",first,fsdwsegyheader->calConst);
-	fprintf(stderr,"%s     vehicleID:                   %d\n",first,fsdwsegyheader->vehicleID);
-	fprintf(stderr,"%s     softwareVersion:             %s\n",first,fsdwsegyheader->softwareVersion);
-	fprintf(stderr,"%s     sphericalCorrection:         %d\n",first,fsdwsegyheader->sphericalCorrection);
-	fprintf(stderr,"%s     packetNum:                   %d\n",first,fsdwsegyheader->packetNum);
-	fprintf(stderr,"%s     ADCDecimation:               %d\n",first,fsdwsegyheader->ADCDecimation);
-	fprintf(stderr,"%s     decimation:                  %d\n",first,fsdwsegyheader->decimation);
-	for (i=0;i<7;i++)
-		fprintf(stderr,"%s     unuseda[%d]:                  %d\n",first,i,fsdwsegyheader->unuseda[i]);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbsys_reson7k_print_fsdwss(int verbose,
-			s7kr_fsdwss *fsdwss,
-			int *error)
-{
-	char	*function_name = "mbsys_reson7k_print_fsdwss";
-	int	status = MB_SUCCESS;
-	char	*debug_str = "dbg2  ";
-	char	*nodebug_str = "  ";
-	char	*first;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:      %d\n",verbose);
-		fprintf(stderr,"dbg2       fsdwss:       %p\n",(void *)fsdwss);
-		}
-
-	/* print Reson 7k data record header information */
-	mbsys_reson7k_print_header(verbose, &fsdwss->header, error);
-
-	/* print Edgetech FS-DW sidescan (record 3000) */
-	if (verbose >= 2)
-		first = debug_str;
-	else
-		{
-		first = nodebug_str;
-		fprintf(stderr,"\n%sMBIO function <%s> called\n",
-			first,function_name);
-		}
-	fprintf(stderr,"%sStructure Contents:\n", first);
-	fprintf(stderr,"%s     msec_timestamp:             %d\n",first,fsdwss->msec_timestamp);
-	fprintf(stderr,"%s     ping_number:                %u\n",first,fsdwss->ping_number);
-	fprintf(stderr,"%s     number_channels:            %d\n",first,fsdwss->number_channels);
-	fprintf(stderr,"%s     total_bytes:                %d\n",first,fsdwss->total_bytes);
-	fprintf(stderr,"%s     data_format:                %d\n",first,fsdwss->data_format);
-	for (i=0;i<fsdwss->number_channels;i++)
-		{
-		mbsys_reson7k_print_fsdwchannel(verbose, fsdwss->data_format, &fsdwss->channel[i], error);
-		mbsys_reson7k_print_fsdwssheader(verbose, &fsdwss->ssheader[i], error);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_reson7k_print_fsdwsb(int verbose,
-			s7kr_fsdwsb *fsdwsb,
-			int *error)
-{
-	char	*function_name = "mbsys_reson7k_print_fsdwsb";
-	int	status = MB_SUCCESS;
-	char	*debug_str = "dbg2  ";
-	char	*nodebug_str = "  ";
-	char	*first;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:      %d\n",verbose);
-		fprintf(stderr,"dbg2       fsdwsb:       %p\n",(void *)fsdwsb);
-		}
-
-	/* print Reson 7k data record header information */
-	mbsys_reson7k_print_header(verbose, &fsdwsb->header, error);
-
-	/* print Edgetech FS-DW subbottom (record 3001) */
-	if (verbose >= 2)
-		first = debug_str;
-	else
-		{
-		first = nodebug_str;
-		fprintf(stderr,"\n%sMBIO function <%s> called\n",
-			first,function_name);
-		}
-	fprintf(stderr,"%sStructure Contents:\n", first);
-	fprintf(stderr,"%s     msec_timestamp:             %d\n",first,fsdwsb->msec_timestamp);
-	fprintf(stderr,"%s     ping_number:                %u\n",first,fsdwsb->ping_number);
-	fprintf(stderr,"%s     number_channels:            %d\n",first,fsdwsb->number_channels);
-	fprintf(stderr,"%s     total_bytes:                %d\n",first,fsdwsb->total_bytes);
-	fprintf(stderr,"%s     data_format:                %d\n",first,fsdwsb->data_format);
-	mbsys_reson7k_print_fsdwchannel(verbose, fsdwsb->data_format, &fsdwsb->channel, error);
-	mbsys_reson7k_print_fsdwsegyheader(verbose, &fsdwsb->segyheader, error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_reson7k_print_bluefin(int verbose,
-			s7kr_bluefin *bluefin,
-			int *error)
-{
-	char	*function_name = "mbsys_reson7k_print_bluefin";
-	int	status = MB_SUCCESS;
-	char	*debug_str = "dbg2  ";
-	char	*nodebug_str = "  ";
-	char	*first;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:      %d\n",verbose);
-		fprintf(stderr,"dbg2       bluefin:      %p\n",(void *)bluefin);
-		}
-
-	/* print Reson 7k data record header information */
-	mbsys_reson7k_print_header(verbose, &bluefin->header, error);
-
-	/* print Bluefin data frames (record 3100) */
-	if (verbose >= 2)
-		first = debug_str;
-	else
-		{
-		first = nodebug_str;
-		fprintf(stderr,"\n%sMBIO function <%s> called\n",
-			first,function_name);
-		}
-	fprintf(stderr,"%sStructure Contents:\n", first);
-	fprintf(stderr,"%s     msec_timestamp:             %d\n",first,bluefin->msec_timestamp);
-	fprintf(stderr,"%s     number_frames:              %d\n",first,bluefin->number_frames);
-	fprintf(stderr,"%s     frame_size:                 %d\n",first,bluefin->frame_size);
-	fprintf(stderr,"%s     data_format:                %d\n",first,bluefin->data_format);
-	for(i=0;i<16;i++)
-		fprintf(stderr,"%s     reserved[%d]:                %d\n",first,i,bluefin->reserved[i]);
-	if (bluefin->data_format == R7KRECID_BluefinNav)
-		{
-		for (i=0;i<MIN(bluefin->number_frames,BLUEFIN_MAX_FRAMES);i++)
-			{
-			fprintf(stderr,"%s     nav[%d].packet_size:        %d\n",first,i,bluefin->nav[i].packet_size);
-			fprintf(stderr,"%s     nav[%d].version:            %d\n",first,i,bluefin->nav[i].version);
-			fprintf(stderr,"%s     nav[%d].offset:             %d\n",first,i,bluefin->nav[i].offset);
-			fprintf(stderr,"%s     nav[%d].data_type:          %d\n",first,i,bluefin->nav[i].data_type);
-			fprintf(stderr,"%s     nav[%d].data_size:          %d\n",first,i,bluefin->nav[i].data_size);
-			fprintf(stderr,"%s     nav[%d].s7kTime.Year:       %d\n",first,i,bluefin->nav[i].s7kTime.Year);
-			fprintf(stderr,"%s     nav[%d].s7kTime.Day:        %d\n",first,i,bluefin->nav[i].s7kTime.Day);
-			fprintf(stderr,"%s     nav[%d].s7kTime.Seconds:    %f\n",first,i,bluefin->nav[i].s7kTime.Seconds);
-			fprintf(stderr,"%s     nav[%d].s7kTime.Hours:      %d\n",first,i,bluefin->nav[i].s7kTime.Hours);
-			fprintf(stderr,"%s     nav[%d].7kTime->Minutes:    %d\n",first,i,bluefin->nav[i].s7kTime.Minutes);
-			fprintf(stderr,"%s     nav[%d].checksum:           %d\n",first,i,bluefin->nav[i].checksum);
-			fprintf(stderr,"%s     nav[%d].timedelay:          %d\n",first,i,bluefin->nav[i].timedelay);
-			fprintf(stderr,"%s     nav[%d].quality:            %x\n",first,i,bluefin->nav[i].quality);
-			fprintf(stderr,"%s     nav[%d].latitude:           %f\n",first,i,bluefin->nav[i].latitude);
-			fprintf(stderr,"%s     nav[%d].longitude:          %f\n",first,i,bluefin->nav[i].longitude);
-			fprintf(stderr,"%s     nav[%d].speed:              %f\n",first,i,bluefin->nav[i].speed);
-			fprintf(stderr,"%s     nav[%d].depth:              %f\n",first,i,bluefin->nav[i].depth);
-			fprintf(stderr,"%s     nav[%d].altitude:           %f\n",first,i,bluefin->nav[i].altitude);
-			fprintf(stderr,"%s     nav[%d].roll:               %f\n",first,i,bluefin->nav[i].roll);
-			fprintf(stderr,"%s     nav[%d].pitch:              %f\n",first,i,bluefin->nav[i].pitch);
-			fprintf(stderr,"%s     nav[%d].yaw:                %f\n",first,i,bluefin->nav[i].yaw);
-			fprintf(stderr,"%s     nav[%d].northing_rate:      %f\n",first,i,bluefin->nav[i].northing_rate);
-			fprintf(stderr,"%s     nav[%d].easting_rate:       %f\n",first,i,bluefin->nav[i].easting_rate);
-			fprintf(stderr,"%s     nav[%d].depth_rate:         %f\n",first,i,bluefin->nav[i].depth_rate);
-			fprintf(stderr,"%s     nav[%d].altitude_rate:      %f\n",first,i,bluefin->nav[i].altitude_rate);
-			fprintf(stderr,"%s     nav[%d].roll_rate:          %f\n",first,i,bluefin->nav[i].roll_rate);
-			fprintf(stderr,"%s     nav[%d].pitch_rate:         %f\n",first,i,bluefin->nav[i].pitch_rate);
-			fprintf(stderr,"%s     nav[%d].yaw_rate:           %f\n",first,i,bluefin->nav[i].yaw_rate);
-			fprintf(stderr,"%s     nav[%d].position_time:      %f\n",first,i,bluefin->nav[i].position_time);
-			fprintf(stderr,"%s     nav[%d].depth_time:         %f\n",first,i,bluefin->nav[i].depth_time);
-			}
-		}
-	else if (bluefin->data_format == R7KRECID_BluefinEnvironmental)
-		{
-		for (i=0;i<MIN(bluefin->number_frames,BLUEFIN_MAX_FRAMES);i++)
-			{
-			fprintf(stderr,"%s     env[%d].packet_size:            %d\n",first,i,bluefin->environmental[i].packet_size);
-			fprintf(stderr,"%s     env[%d].version:                %d\n",first,i,bluefin->environmental[i].version);
-			fprintf(stderr,"%s     env[%d].offset:                 %d\n",first,i,bluefin->environmental[i].offset);
-			fprintf(stderr,"%s     env[%d].data_type:              %d\n",first,i,bluefin->environmental[i].data_type);
-			fprintf(stderr,"%s     env[%d].data_size:              %d\n",first,i,bluefin->environmental[i].data_size);
-			fprintf(stderr,"%s     env[%d].s7kTime.Year:           %d\n",first,i,bluefin->environmental[i].s7kTime.Year);
-			fprintf(stderr,"%s     env[%d].s7kTime.Day:            %d\n",first,i,bluefin->environmental[i].s7kTime.Day);
-			fprintf(stderr,"%s     env[%d].s7kTime.Seconds:        %f\n",first,i,bluefin->environmental[i].s7kTime.Seconds);
-			fprintf(stderr,"%s     env[%d].s7kTime.Hours:          %d\n",first,i,bluefin->environmental[i].s7kTime.Hours);
-			fprintf(stderr,"%s     env[%d].7kTime->Minutes:        %d\n",first,i,bluefin->environmental[i].s7kTime.Minutes);
-			fprintf(stderr,"%s     env[%d].checksum:               %d\n",first,i,bluefin->environmental[i].checksum);
-			fprintf(stderr,"%s     env[%d].reserved1:              %d\n",first,i,bluefin->environmental[i].reserved1);
-			fprintf(stderr,"%s     env[%d].quality:                %d\n",first,i,bluefin->environmental[i].quality);
-			fprintf(stderr,"%s     env[%d].sound_speed:            %f\n",first,i,bluefin->environmental[i].sound_speed);
-			fprintf(stderr,"%s     env[%d].conductivity:           %f\n",first,i,bluefin->environmental[i].conductivity);
-			fprintf(stderr,"%s     env[%d].temperature:            %f\n",first,i,bluefin->environmental[i].temperature);
-			fprintf(stderr,"%s     env[%d].pressure:               %f\n",first,i,bluefin->environmental[i].pressure);
-			fprintf(stderr,"%s     env[%d].salinity:               %f\n",first,i,bluefin->environmental[i].salinity);
-			fprintf(stderr,"%s     env[%d].ctd_time:               %f\n",first,i,bluefin->environmental[i].ctd_time);
-			fprintf(stderr,"%s     env[%d].temperature_time:       %f\n",first,i,bluefin->environmental[i].temperature_time);
-			fprintf(stderr,"%s     env[%d].surface_pressure:       %f\n",first,i,bluefin->environmental[i].surface_pressure);
-			fprintf(stderr,"%s     env[%d].temperature_counts:     %d\n",first,i,bluefin->environmental[i].temperature_counts);
-			fprintf(stderr,"%s     env[%d].conductivity_frequency: %f\n",first,i,bluefin->environmental[i].conductivity_frequency);
-			fprintf(stderr,"%s     env[%d].pressure_counts:        %d\n",first,i,bluefin->environmental[i].pressure_counts);
-			fprintf(stderr,"%s     env[%d].pressure_comp_voltage:  %f\n",first,i,bluefin->environmental[i].pressure_comp_voltage);
-			fprintf(stderr,"%s     env[%d].sensor_time_sec:        %d\n",first,i,bluefin->environmental[i].sensor_time_sec);
-			fprintf(stderr,"%s     env[%d].sensor_time_nsec:       %d\n",first,i,bluefin->environmental[i].sensor_time_nsec);
-			fprintf(stderr,"%s     env[%d].sensor1:                %d\n",first,i,bluefin->environmental[i].sensor1);
-			fprintf(stderr,"%s     env[%d].sensor2:                %d\n",first,i,bluefin->environmental[i].sensor2);
-			fprintf(stderr,"%s     env[%d].sensor3:                %d\n",first,i,bluefin->environmental[i].sensor3);
-			fprintf(stderr,"%s     env[%d].sensor4:                %d\n",first,i,bluefin->environmental[i].sensor4);
-			fprintf(stderr,"%s     env[%d].sensor5:                %d\n",first,i,bluefin->environmental[i].sensor5);
-			fprintf(stderr,"%s     env[%d].sensor6:                %d\n",first,i,bluefin->environmental[i].sensor6);
-			fprintf(stderr,"%s     env[%d].sensor7:                %d\n",first,i,bluefin->environmental[i].sensor7);
-			fprintf(stderr,"%s     env[%d].sensor8:                %d\n",first,i,bluefin->environmental[i].sensor8);
-			for (j=0;j<8;j++)
-				fprintf(stderr,"%s     env[%d].reserved2[%2d]:          %d\n",first,i,j,bluefin->environmental[i].reserved2[j]);
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_reson7k_print_processedsidescan(int verbose,
-			s7kr_processedsidescan *processedsidescan,
-			int *error)
-{
-	char	*function_name = "mbsys_reson7k_print_processedsidescan";
-	int	status = MB_SUCCESS;
-	char	*debug_str = "dbg2  ";
-	char	*nodebug_str = "  ";
-	char	*first;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:           %d\n",verbose);
-		fprintf(stderr,"dbg2       processedsidescan: %p\n",(void *)processedsidescan);
-		}
-
-	/* print Reson 7k data record header information */
-	mbsys_reson7k_print_header(verbose, &processedsidescan->header, error);
-
-	/* print Reson 7k beam geometry (record 7004) */
-	if (verbose >= 2)
-		first = debug_str;
-	else
-		{
-		first = nodebug_str;
-		fprintf(stderr,"\n%sMBIO function <%s> called\n",
-			first,function_name);
-		}
-	fprintf(stderr,"%sStructure Contents:\n", first);
-	fprintf(stderr,"%s     serial_number:              %llu\n",first,processedsidescan->serial_number);
-	fprintf(stderr,"%s     ping_number:                %u\n",first,processedsidescan->ping_number);
-	fprintf(stderr,"%s     multi_ping:                 %u\n",first,processedsidescan->multi_ping);
-	fprintf(stderr,"%s     recordversion:              %u\n",first,processedsidescan->recordversion);
-	fprintf(stderr,"%s     ss_source:                  %u\n",first,processedsidescan->ss_source);
-	fprintf(stderr,"%s     number_pixels:              %u\n",first,processedsidescan->number_pixels);
-	fprintf(stderr,"%s     pixelwidth:                 %f\n",first,processedsidescan->pixelwidth);
-	fprintf(stderr,"%s     sonardepth:                 %f\n",first,processedsidescan->sonardepth);
-	fprintf(stderr,"%s     altitude:                   %f\n",first,processedsidescan->altitude);
-	for (i=0;i<processedsidescan->number_pixels;i++)
-	fprintf(stderr,"%s     pixel[%d]:  sidescan:%f alongtrack:%f\n",
-			first,i,processedsidescan->sidescan[i],processedsidescan->alongtrack[i]);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_reson7k_print_volatilesettings(int verbose,
-			s7kr_volatilesettings *volatilesettings,
-			int *error)
-{
-	char	*function_name = "mbsys_reson7k_print_volatilesettings";
-	int	status = MB_SUCCESS;
-	char	*debug_str = "dbg2  ";
-	char	*nodebug_str = "  ";
-	char	*first;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:           %d\n",verbose);
-		fprintf(stderr,"dbg2       volatilesettings:  %p\n",(void *)volatilesettings);
-		}
-
-	/* print Reson 7k data record header information */
-	mbsys_reson7k_print_header(verbose, &volatilesettings->header, error);
-
-	/* print Reson 7k volatile sonar settings (record 7000) */
-	if (verbose >= 2)
-		first = debug_str;
-	else
-		{
-		first = nodebug_str;
-		fprintf(stderr,"\n%sMBIO function <%s> called\n",
-			first,function_name);
-		}
-	fprintf(stderr,"%sStructure Contents:\n", first);
-	fprintf(stderr,"%s     serial_number:              %llu\n",first,volatilesettings->serial_number);
-	fprintf(stderr,"%s     ping_number:                %u\n",first,volatilesettings->ping_number);
-	fprintf(stderr,"%s     multi_ping:                 %u\n",first,volatilesettings->multi_ping);
-	fprintf(stderr,"%s     frequency:                  %f\n",first,volatilesettings->frequency);
-	fprintf(stderr,"%s     sample_rate:                %f\n",first,volatilesettings->sample_rate);
-	fprintf(stderr,"%s     receiver_bandwidth:         %f\n",first,volatilesettings->receiver_bandwidth);
-	fprintf(stderr,"%s     pulse_width:                %f\n",first,volatilesettings->pulse_width);
-	fprintf(stderr,"%s     pulse_type:                 %d\n",first,volatilesettings->pulse_type);
-	fprintf(stderr,"%s     pulse_envelope:             %d\n",first,volatilesettings->pulse_envelope);
-	fprintf(stderr,"%s     pulse_envelope_par:         %f\n",first,volatilesettings->pulse_envelope_par);
-	fprintf(stderr,"%s     pulse_reserved:             %d\n",first,volatilesettings->pulse_reserved);
-	fprintf(stderr,"%s     max_ping_rate:              %f\n",first,volatilesettings->max_ping_rate);
-	fprintf(stderr,"%s     ping_period:                %f\n",first,volatilesettings->ping_period);
-	fprintf(stderr,"%s     range_selection:            %f\n",first,volatilesettings->range_selection);
-	fprintf(stderr,"%s     power_selection:            %f\n",first,volatilesettings->power_selection);
-	fprintf(stderr,"%s     gain_selection:             %f\n",first,volatilesettings->gain_selection);
-	fprintf(stderr,"%s     control_flags:              %d\n",first,volatilesettings->control_flags);
-	fprintf(stderr,"%s     projector_magic_no:         %d\n",first,volatilesettings->projector_magic_no);
-	fprintf(stderr,"%s     steering_vertical:          %f\n",first,volatilesettings->steering_vertical);
-	fprintf(stderr,"%s     steering_horizontal:        %f\n",first,volatilesettings->steering_horizontal);
-	fprintf(stderr,"%s     beamwidth_vertical:         %f\n",first,volatilesettings->beamwidth_vertical);
-	fprintf(stderr,"%s     beamwidth_horizontal:       %f\n",first,volatilesettings->beamwidth_horizontal);
-	fprintf(stderr,"%s     focal_point:                %f\n",first,volatilesettings->focal_point);
-	fprintf(stderr,"%s     projector_weighting:        %d\n",first,volatilesettings->projector_weighting);
-	fprintf(stderr,"%s     projector_weighting_par:    %f\n",first,volatilesettings->projector_weighting_par);
-	fprintf(stderr,"%s     transmit_flags:             %d\n",first,volatilesettings->transmit_flags);
-	fprintf(stderr,"%s     hydrophone_magic_no:        %d\n",first,volatilesettings->hydrophone_magic_no);
-	fprintf(stderr,"%s     receive_weighting:          %d\n",first,volatilesettings->receive_weighting);
-	fprintf(stderr,"%s     receive_weighting_par:      %f\n",first,volatilesettings->receive_weighting_par);
-	fprintf(stderr,"%s     receive_flags:              %d\n",first,volatilesettings->receive_flags);
-	fprintf(stderr,"%s     receive_width:              %f\n",first,volatilesettings->receive_width);
-	fprintf(stderr,"%s     range_minimum:              %f\n",first,volatilesettings->range_minimum);
-	fprintf(stderr,"%s     range_maximum:              %f\n",first,volatilesettings->range_maximum);
-	fprintf(stderr,"%s     depth_minimum:              %f\n",first,volatilesettings->depth_minimum);
-	fprintf(stderr,"%s     depth_maximum:              %f\n",first,volatilesettings->depth_maximum);
-	fprintf(stderr,"%s     absorption:                 %f\n",first,volatilesettings->absorption);
-	fprintf(stderr,"%s     sound_velocity:             %f\n",first,volatilesettings->sound_velocity);
-	fprintf(stderr,"%s     spreading:                  %f\n",first,volatilesettings->spreading);
-	fprintf(stderr,"%s     reserved:                   %d\n",first,volatilesettings->reserved);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_reson7k_print_device(int verbose,
-			s7k_device *device,
-			int *error)
-{
-	char	*function_name = "mbsys_reson7k_print_device";
-	int	status = MB_SUCCESS;
-	char	*debug_str = "dbg2  ";
-	char	*nodebug_str = "  ";
-	char	*first;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:           %d\n",verbose);
-		fprintf(stderr,"dbg2       device:            %p\n",(void *)device);
-		}
-
-	/* print Reson 7k device configuration structure */
-	if (verbose >= 2)
-		first = debug_str;
-	else
-		{
-		first = nodebug_str;
-		fprintf(stderr,"\n%sMBIO function <%s> called\n",
-			first,function_name);
-		}
-	fprintf(stderr,"%sStructure Contents:\n", first);
-	fprintf(stderr,"%s     magic_number:               %d\n",first,device->magic_number);
-	fprintf(stderr,"%s     description:                %s\n",first,device->description);
-	fprintf(stderr,"%s     serial_number:              %llu\n",first,device->serial_number);
-	fprintf(stderr,"%s     info_length:                %d\n",first,device->info_length);
-	fprintf(stderr,"%s     info_alloc:                 %d\n",first,device->info_alloc);
-	fprintf(stderr,"%s     info:                       %s\n",first,device->info);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_reson7k_print_configuration(int verbose,
-			s7kr_configuration *configuration,
-			int *error)
-{
-	char	*function_name = "mbsys_reson7k_print_configuration";
-	int	status = MB_SUCCESS;
-	char	*debug_str = "dbg2  ";
-	char	*nodebug_str = "  ";
-	char	*first;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:           %d\n",verbose);
-		fprintf(stderr,"dbg2       configuration:     %p\n",(void *)configuration);
-		}
-
-	/* print Reson 7k data record header information */
-	mbsys_reson7k_print_header(verbose, &configuration->header, error);
-
-	/* print Reson 7k configuration (record 7001) */
-	if (verbose >= 2)
-		first = debug_str;
-	else
-		{
-		first = nodebug_str;
-		fprintf(stderr,"\n%sMBIO function <%s> called\n",
-			first,function_name);
-		}
-	fprintf(stderr,"%sStructure Contents:\n", first);
-	fprintf(stderr,"%s     serial_number:              %llu\n",first,configuration->serial_number);
-	fprintf(stderr,"%s     number_devices:             %d\n",first,configuration->number_devices);
-	for (i=0;i<configuration->number_devices;i++)
-		mbsys_reson7k_print_device(verbose, &configuration->device[i], error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_reson7k_print_matchfilter(int verbose,
-			s7kr_matchfilter *matchfilter,
-			int *error)
-{
-	char	*function_name = "mbsys_reson7k_print_matchfilter";
-	int	status = MB_SUCCESS;
-	char	*debug_str = "dbg2  ";
-	char	*nodebug_str = "  ";
-	char	*first;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:           %d\n",verbose);
-		fprintf(stderr,"dbg2       matchfilter:       %p\n",(void *)matchfilter);
-		}
-
-	/* print Reson 7k data record header information */
-	mbsys_reson7k_print_header(verbose, &matchfilter->header, error);
-
-	/* print Reson 7k match filter (record 7002) */
-	if (verbose >= 2)
-		first = debug_str;
-	else
-		{
-		first = nodebug_str;
-		fprintf(stderr,"\n%sMBIO function <%s> called\n",
-			first,function_name);
-		}
-	fprintf(stderr,"%sStructure Contents:\n", first);
-	fprintf(stderr,"%s     serial_number:              %llu\n",first,matchfilter->serial_number);
-	fprintf(stderr,"%s     ping_number:                %u\n",first,matchfilter->ping_number);
-	fprintf(stderr,"%s     operation:                  %d\n",first,matchfilter->operation);
-	fprintf(stderr,"%s     start_frequency:            %f\n",first,matchfilter->start_frequency);
-	fprintf(stderr,"%s     end_frequency:              %f\n",first,matchfilter->end_frequency);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_reson7k_print_v2firmwarehardwareconfiguration(int verbose,
-			s7kr_v2firmwarehardwareconfiguration *v2firmwarehardwareconfiguration,
-			int *error)
-{
-	char	*function_name = "mbsys_reson7k_print_v2firmwarehardwareconfiguration";
-	int	status = MB_SUCCESS;
-	char	*debug_str = "dbg2  ";
-	char	*nodebug_str = "  ";
-	char	*first;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:           %d\n",verbose);
-		fprintf(stderr,"dbg2       v2firmwarehardwareconfiguration:       %p\n",(void *)v2firmwarehardwareconfiguration);
-		}
-
-	/* print Reson 7k data record header information */
-	mbsys_reson7k_print_header(verbose, &v2firmwarehardwareconfiguration->header, error);
-
-	/* print Reson 7k match filter (record 7002) */
-	if (verbose >= 2)
-		first = debug_str;
-	else
-		{
-		first = nodebug_str;
-		fprintf(stderr,"\n%sMBIO function <%s> called\n",
-			first,function_name);
-		}
-	fprintf(stderr,"%sStructure Contents:\n", first);
-	fprintf(stderr,"%s     device_count:               %d\n",first,v2firmwarehardwareconfiguration->device_count);
-	fprintf(stderr,"%s     info_length:                %d\n",first,v2firmwarehardwareconfiguration->info_length);
-	fprintf(stderr,"%s     info:                       \n",first);
-	fprintf(stderr,"%s\n%s\n",v2firmwarehardwareconfiguration->info,first);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_reson7k_print_beamgeometry(int verbose,
-			s7kr_beamgeometry *beamgeometry,
-			int *error)
-{
-	char	*function_name = "mbsys_reson7k_print_beamgeometry";
-	int	status = MB_SUCCESS;
-	char	*debug_str = "dbg2  ";
-	char	*nodebug_str = "  ";
-	char	*first;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:           %d\n",verbose);
-		fprintf(stderr,"dbg2       beamgeometry:      %p\n",(void *)beamgeometry);
-		}
-
-	/* print Reson 7k data record header information */
-	mbsys_reson7k_print_header(verbose, &beamgeometry->header, error);
-
-	/* print Reson 7k beam geometry (record 7004) */
-	if (verbose >= 2)
-		first = debug_str;
-	else
-		{
-		first = nodebug_str;
-		fprintf(stderr,"\n%sMBIO function <%s> called\n",
-			first,function_name);
-		}
-	fprintf(stderr,"%sStructure Contents:\n", first);
-	fprintf(stderr,"%s     serial_number:              %llu\n",first,beamgeometry->serial_number);
-	fprintf(stderr,"%s     number_beams:               %u\n",first,beamgeometry->number_beams);
-	for (i=0;i<beamgeometry->number_beams;i++)
-	fprintf(stderr,"%s     beam[%d]:  angle_alongtrack:%f angle_acrosstrack:%f beamwidth_alongtrack:%f beamwidth_acrosstrack:%f\n",
-			first,i,beamgeometry->angle_alongtrack[i],beamgeometry->angle_acrosstrack[i],
-			beamgeometry->beamwidth_alongtrack[i],beamgeometry->beamwidth_acrosstrack[i]);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_reson7k_print_calibration(int verbose,
-			s7kr_calibration *calibration,
-			int *error)
-{
-	char	*function_name = "mbsys_reson7k_print_calibration";
-	int	status = MB_SUCCESS;
-	char	*debug_str = "dbg2  ";
-	char	*nodebug_str = "  ";
-	char	*first;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:           %d\n",verbose);
-		fprintf(stderr,"dbg2       calibration:       %p\n",(void *)calibration);
-		}
-
-	/* print Reson 7k data record header information */
-	mbsys_reson7k_print_header(verbose, &calibration->header, error);
-
-	/* print Reson 7k calibration data (record 7005) */
-	if (verbose >= 2)
-		first = debug_str;
-	else
-		{
-		first = nodebug_str;
-		fprintf(stderr,"\n%sMBIO function <%s> called\n",
-			first,function_name);
-		}
-	fprintf(stderr,"%sStructure Contents:\n", first);
-	fprintf(stderr,"%s     serial_number:              %llu\n",first,calibration->serial_number);
-	fprintf(stderr,"%s     number_channels:            %d\n",first,calibration->number_channels);
-	for (i=0;i<calibration->number_channels;i++)
-		fprintf(stderr,"%s     channel[%d]:  gain:%f phase:%f\n",
-				first,i,calibration->gain[i],calibration->phase[i]);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_reson7k_print_bathymetry(int verbose,
-			s7kr_bathymetry *bathymetry,
-			int *error)
-{
-	char	*function_name = "mbsys_reson7k_print_bathymetry";
-	int	status = MB_SUCCESS;
-	char	*debug_str = "dbg2  ";
-	char	*nodebug_str = "  ";
-	char	*first;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:           %d\n",verbose);
-		fprintf(stderr,"dbg2       bathymetry:        %p\n",(void *)bathymetry);
-		}
-
-	/* print Reson 7k data record header information */
-	mbsys_reson7k_print_header(verbose, &bathymetry->header, error);
-
-	/* print Reson 7k bathymetry (record 7006) */
-	if (verbose >= 2)
-		first = debug_str;
-	else
-		{
-		first = nodebug_str;
-		fprintf(stderr,"\n%sMBIO function <%s> called\n",
-			first,function_name);
-		}
-	fprintf(stderr,"%sStructure Contents:\n", first);
-	fprintf(stderr,"%s     serial_number:              %llu\n",first,bathymetry->serial_number);
-	fprintf(stderr,"%s     ping_number:                %u\n",first,bathymetry->ping_number);
-	fprintf(stderr,"%s     multi_ping:                 %u\n",first,bathymetry->multi_ping);
-	fprintf(stderr,"%s     number_beams:               %u\n",first,bathymetry->number_beams);
-	fprintf(stderr,"%s     layer_comp_flag:            %d\n",first,bathymetry->layer_comp_flag);
-	fprintf(stderr,"%s     sound_vel_flag:             %d\n",first,bathymetry->sound_vel_flag);
-	fprintf(stderr,"%s     sound_velocity:             %f\n",first,bathymetry->sound_velocity);
-	for (i=0;i<bathymetry->number_beams;i++)
-		fprintf(stderr,"%s     beam[%d]:  range:%f quality:%d intensity:%f min_depth_gate:%f min_depth_gate:%f\n",
-				first,i,bathymetry->range[i],bathymetry->quality[i],bathymetry->intensity[i],
-				bathymetry->min_depth_gate[i],bathymetry->max_depth_gate[i]);
-	fprintf(stderr,"%s     optionaldata:               %d\n",first,bathymetry->optionaldata);
-	fprintf(stderr,"%s     frequency:                  %f\n",first,bathymetry->frequency);
-	fprintf(stderr,"%s     latitude:                   %f\n",first,bathymetry->latitude);
-	fprintf(stderr,"%s     longitude:                  %f\n",first,bathymetry->longitude);
-	fprintf(stderr,"%s     heading:                    %f\n",first,bathymetry->heading);
-	fprintf(stderr,"%s     height_source:              %d\n",first,bathymetry->height_source);
-	fprintf(stderr,"%s     tide:                       %f\n",first,bathymetry->tide);
-	fprintf(stderr,"%s     roll:                       %f\n",first,bathymetry->roll);
-	fprintf(stderr,"%s     pitch:                      %f\n",first,bathymetry->pitch);
-	fprintf(stderr,"%s     heave:                      %f\n",first,bathymetry->heave);
-	fprintf(stderr,"%s     vehicle_height:             %f\n",first,bathymetry->vehicle_height);
-	for (i=0;i<bathymetry->number_beams;i++)
-		fprintf(stderr,"%s     beam[%d]:  depth:%f ltrack:%f xtrack:%f angles: %f %f\n",
-				first,i,bathymetry->depth[i],bathymetry->alongtrack[i],bathymetry->acrosstrack[i],
-				bathymetry->pointing_angle[i],bathymetry->azimuth_angle[i]);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_reson7k_print_backscatter(int verbose,
-			s7kr_backscatter *backscatter,
-			int *error)
-{
-	char	*function_name = "mbsys_reson7k_print_backscatter";
-	int	status = MB_SUCCESS;
-	char	*debug_str = "dbg2  ";
-	char	*nodebug_str = "  ";
-	char	*first;
-	mb_s_char	*charptr;
-	short	*shortptr;
-	int	*intptr;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:           %d\n",verbose);
-		fprintf(stderr,"dbg2       backscatter:       %p\n",(void *)backscatter);
-		}
-
-	/* print Reson 7k data record header information */
-	mbsys_reson7k_print_header(verbose, &backscatter->header, error);
-
-	/* print Reson 7k backscatter imagery data (record 7007) */
-	if (verbose >= 2)
-		first = debug_str;
-	else
-		{
-		first = nodebug_str;
-		fprintf(stderr,"\n%sMBIO function <%s> called\n",
-			first,function_name);
-		}
-	fprintf(stderr,"%sStructure Contents:\n", first);
-	fprintf(stderr,"%s     serial_number:              %llu\n",first,backscatter->serial_number);
-	fprintf(stderr,"%s     ping_number:                %u\n",first,backscatter->ping_number);
-	fprintf(stderr,"%s     multi_ping:                 %u\n",first,backscatter->multi_ping);
-	fprintf(stderr,"%s     beam_position:              %f\n",first,backscatter->beam_position);
-	fprintf(stderr,"%s     control_flags:              %d\n",first,backscatter->control_flags);
-	fprintf(stderr,"%s     number_samples:             %d\n",first,backscatter->number_samples);
-	fprintf(stderr,"%s     port_beamwidth_x:           %f\n",first,backscatter->port_beamwidth_x);
-	fprintf(stderr,"%s     port_beamwidth_y:           %f\n",first,backscatter->port_beamwidth_y);
-	fprintf(stderr,"%s     stbd_beamwidth_x:           %f\n",first,backscatter->stbd_beamwidth_x);
-	fprintf(stderr,"%s     stbd_beamwidth_y:           %f\n",first,backscatter->stbd_beamwidth_y);
-	fprintf(stderr,"%s     port_steering_x:            %f\n",first,backscatter->port_steering_x);
-	fprintf(stderr,"%s     port_steering_y:            %f\n",first,backscatter->port_steering_y);
-	fprintf(stderr,"%s     stbd_steering_x:            %f\n",first,backscatter->stbd_steering_x);
-	fprintf(stderr,"%s     stbd_steering_y:            %f\n",first,backscatter->stbd_steering_y);
-	fprintf(stderr,"%s     number_beams:               %u\n",first,backscatter->number_beams);
-	fprintf(stderr,"%s     current_beam:               %d\n",first,backscatter->current_beam);
-	fprintf(stderr,"%s     sample_size:                %d\n",first,backscatter->sample_size);
-	fprintf(stderr,"%s     data_type:                  %d\n",first,backscatter->data_type);
-	fprintf(stderr,"%s     nalloc:                     %d\n",first,backscatter->nalloc);
-	if (backscatter->sample_size == 1)
-		{
-		charptr = (mb_s_char *) backscatter->port_data;
-		for (i=0;i<backscatter->number_samples;i++)
-			fprintf(stderr,"%s     port backscatter[%d]:  %d\n",
-				first,i,charptr[i]);
-		charptr = (mb_s_char *) backscatter->stbd_data;
-		for (i=0;i<backscatter->number_samples;i++)
-			fprintf(stderr,"%s     stbd backscatter[%d]:  %d\n",
-				first,i,charptr[i]);
-		}
-	else if (backscatter->sample_size == 2)
-		{
-		shortptr = (short *) backscatter->port_data;
-		for (i=0;i<backscatter->number_samples;i++)
-			fprintf(stderr,"%s     port backscatter[%d]:  %d\n",
-				first,i,shortptr[i]);
-		shortptr = (short *) backscatter->stbd_data;
-		for (i=0;i<backscatter->number_samples;i++)
-			fprintf(stderr,"%s     stbd backscatter[%d]:  %d\n",
-				first,i,shortptr[i]);
-		}
-	else if (backscatter->sample_size == 4)
-		{
-		intptr = (int *) backscatter->port_data;
-		for (i=0;i<backscatter->number_samples;i++)
-			fprintf(stderr,"%s     port backscatter[%d]:  %d\n",
-				first,i,intptr[i]);
-		intptr = (int *) backscatter->stbd_data;
-		for (i=0;i<backscatter->number_samples;i++)
-			fprintf(stderr,"%s     stbd backscatter[%d]:  %d\n",
-				first,i,intptr[i]);
-		}
-	fprintf(stderr,"%s     optionaldata:               %d\n",first,backscatter->optionaldata);
-	fprintf(stderr,"%s     frequency:                  %f\n",first,backscatter->frequency);
-	fprintf(stderr,"%s     latitude:                   %f\n",first,backscatter->latitude);
-	fprintf(stderr,"%s     longitude:                  %f\n",first,backscatter->longitude);
-	fprintf(stderr,"%s     heading:                    %f\n",first,backscatter->heading);
-	fprintf(stderr,"%s     altitude:                   %f\n",first,backscatter->altitude);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_reson7k_print_beam(int verbose,
-			s7kr_beam *beam,
-			int *error)
-{
-	char	*function_name = "mbsys_reson7k_print_beam";
-	int	status = MB_SUCCESS;
-	s7kr_snippet *snippet;
-	char	*debug_str = "dbg2  ";
-	char	*nodebug_str = "  ";
-	char	*first;
-	int	sample_type_amp;
-	int	sample_type_phase;
-	int	sample_type_iandq;
-	int	sample_type_beamforming;
-	mb_u_char	*ucharptramp, *ucharptrphase;
-	unsigned short	*ushortptramp, *ushortptrphase;
-	unsigned int	*uintptramp, *uintptrphase;
-	short		*shortptramp, *shortptrphase;
-	int		*intptramp, *intptrphase;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:           %d\n",verbose);
-		fprintf(stderr,"dbg2       beam:              %p\n",(void *)beam);
-		}
-
-	/* print Reson 7k data record header information */
-	mbsys_reson7k_print_header(verbose, &beam->header, error);
-
-	/* print Reson 7k beam data (record 7007) */
-	if (verbose >= 2)
-		first = debug_str;
-	else
-		{
-		first = nodebug_str;
-		fprintf(stderr,"\n%sMBIO function <%s> called\n",
-			first,function_name);
-		}
-	fprintf(stderr,"%sStructure Contents:\n", first);
-	fprintf(stderr,"%s     serial_number:              %llu\n",first,beam->serial_number);
-	fprintf(stderr,"%s     ping_number:                %u\n",first,beam->ping_number);
-	fprintf(stderr,"%s     multi_ping:                 %u\n",first,beam->multi_ping);
-	fprintf(stderr,"%s     number_beams:               %u\n",first,beam->number_beams);
-	fprintf(stderr,"%s     reserved:                   %d\n",first,beam->reserved);
-	fprintf(stderr,"%s     number_samples:             %d\n",first,beam->number_samples);
-	fprintf(stderr,"%s     record_subset_flag:         %d\n",first,beam->record_subset_flag);
-	fprintf(stderr,"%s     row_column_flag:            %d\n",first,beam->row_column_flag);
-	fprintf(stderr,"%s     sample_header_id:           %d\n",first,beam->sample_header_id);
-	fprintf(stderr,"%s     sample_type:                %d\n",first,beam->sample_type);
-	sample_type_amp = beam->sample_type & 15;
-	sample_type_phase = (beam->sample_type >> 4) & 15;
-	sample_type_iandq = (beam->sample_type >> 8) & 15;
-	sample_type_beamforming = (beam->sample_type >> 12) & 15;
-	fprintf(stderr,"%s     sample_type amplitude:      %d\n",first,sample_type_amp);
-	fprintf(stderr,"%s     sample_type phase:          %d\n",first,sample_type_phase);
-	fprintf(stderr,"%s     sample_type I and Q:        %d\n",first,sample_type_iandq);
-	fprintf(stderr,"%s     sample_type beamforming:    %d\n",first,sample_type_beamforming);
-	for (i=0;i<beam->number_beams;i++)
-		{
-		snippet = &beam->snippets[i];
-		fprintf(stderr,"%s     beam[%d]:%d   begin_sample:%d end_sample:%d nalloc_amp:%d nalloc_phase:%d\n",
-						first,i,snippet->beam_number,snippet->begin_sample,
-						snippet->end_sample,snippet->nalloc_amp,snippet->nalloc_phase);
-		ucharptramp = (mb_u_char *) snippet->amplitude;
-		ucharptrphase = (mb_u_char *) snippet->phase;
-		ushortptramp = (unsigned short *) snippet->amplitude;
-		ushortptrphase = (unsigned short *) snippet->phase;
-		uintptramp = (unsigned int *) snippet->amplitude;
-		uintptrphase = (unsigned int *) snippet->phase;
-		shortptramp = (short *) snippet->amplitude;
-		shortptrphase = (short *) snippet->phase;
-		intptramp = (int *) snippet->amplitude;
-		intptrphase = (int *) snippet->phase;
-		for (j=0;j<=snippet->end_sample-snippet->begin_sample;j++)
-			{
-			fprintf(stderr,"%s     sample[%d]:%d",first,j,snippet->begin_sample+j);
-			if (sample_type_amp == 1)
-				fprintf(stderr,"   amplitude:%d",ucharptramp[j]);
-			else if (sample_type_amp == 2)
-				fprintf(stderr,"   amplitude:%d",ushortptramp[j]);
-			else if (sample_type_amp == 3)
-				fprintf(stderr,"   amplitude:%d",uintptramp[j]);
-			if (sample_type_phase == 1)
-				fprintf(stderr,"   phase:%d",ucharptrphase[j]);
-			else if (sample_type_phase == 2)
-				fprintf(stderr,"   phase:%d",ushortptrphase[j]);
-			else if (sample_type_phase == 3)
-				fprintf(stderr,"   phase:%d",uintptrphase[j]);
-			if (sample_type_iandq == 1)
-				fprintf(stderr,"   amplitude:%d   phase:%d",shortptramp[j],shortptrphase[j]);
-			else if (sample_type_iandq == 2)
-				fprintf(stderr,"   amplitude:%d   phase:%d",intptramp[j],intptrphase[j]);
-			fprintf(stderr,"\n");
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_reson7k_print_verticaldepth(int verbose,
-			s7kr_verticaldepth *verticaldepth,
-			int *error)
-{
-	char	*function_name = "mbsys_reson7k_print_verticaldepth";
-	int	status = MB_SUCCESS;
-	char	*debug_str = "dbg2  ";
-	char	*nodebug_str = "  ";
-	char	*first;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:           %d\n",verbose);
-		fprintf(stderr,"dbg2       verticaldepth:     %p\n",(void *)verticaldepth);
-		}
-
-	/* print Reson 7k data record header information */
-	mbsys_reson7k_print_header(verbose, &verticaldepth->header, error);
-
-	/* print Reson 7k vertical depth data (record 7009) */
-	if (verbose >= 2)
-		first = debug_str;
-	else
-		{
-		first = nodebug_str;
-		fprintf(stderr,"\n%sMBIO function <%s> called\n",
-			first,function_name);
-		}
-	fprintf(stderr,"%sStructure Contents:\n", first);
-	fprintf(stderr,"%s     frequency:                  %f\n",first,verticaldepth->frequency);
-	fprintf(stderr,"%s     ping_number:                %u\n",first,verticaldepth->ping_number);
-	fprintf(stderr,"%s     multi_ping:                 %u\n",first,verticaldepth->multi_ping);
-	fprintf(stderr,"%s     latitude:                   %f\n",first,verticaldepth->latitude);
-	fprintf(stderr,"%s     longitude:                  %f\n",first,verticaldepth->longitude);
-	fprintf(stderr,"%s     heading:                    %f\n",first,verticaldepth->heading);
-	fprintf(stderr,"%s     alongtrack:                 %f\n",first,verticaldepth->alongtrack);
-	fprintf(stderr,"%s     acrosstrack:                %f\n",first,verticaldepth->acrosstrack);
-	fprintf(stderr,"%s     vertical_depth:             %f\n",first,verticaldepth->vertical_depth);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_reson7k_print_tvg(int verbose,
-			s7kr_tvg *tvg,
-			int *error)
-{
-	char	*function_name = "mbsys_reson7k_print_tvg";
-	int	status = MB_SUCCESS;
-	char	*debug_str = "dbg2  ";
-	char	*nodebug_str = "  ";
-	char	*first;
-	float	*tvg_float;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:           %d\n",verbose);
-		fprintf(stderr,"dbg2       tvg:               %p\n",(void *)tvg);
-		}
-
-	/* print Reson 7k data record header information */
-	mbsys_reson7k_print_header(verbose, &tvg->header, error);
-
-	/* print Reson 7k tvg data (record 7010) */
-	if (verbose >= 2)
-		first = debug_str;
-	else
-		{
-		first = nodebug_str;
-		fprintf(stderr,"\n%sMBIO function <%s> called\n",
-			first,function_name);
-		}
-	fprintf(stderr,"%sStructure Contents:\n", first);
-	fprintf(stderr,"%s     serial_number:              %llu\n",first,tvg->serial_number);
-	fprintf(stderr,"%s     ping_number:                %u\n",first,tvg->ping_number);
-	fprintf(stderr,"%s     multi_ping:                 %u\n",first,tvg->multi_ping);
-	fprintf(stderr,"%s     n:                          %d\n",first,tvg->n);
-	for (i=0;i<8;i++)
-		fprintf(stderr,"%s     reserved[%d]:                %d\n",first,i,tvg->reserved[i]);
-	for (i=0;i<tvg->n;i++)
-		{
-		tvg_float = (float *)tvg->tvg;
-		fprintf(stderr,"%s     tvg[%d]:  %f\n", first,i,tvg_float[i]);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_reson7k_print_image(int verbose,
-			s7kr_image *image,
-			int *error)
-{
-	char	*function_name = "mbsys_reson7k_print_image";
-	int	status = MB_SUCCESS;
-	char	*debug_str = "dbg2  ";
-	char	*nodebug_str = "  ";
-	char	*first;
-	mb_s_char	*charptr;
-	short	*shortptr;
-	int	*intptr;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:           %d\n",verbose);
-		fprintf(stderr,"dbg2       image:             %p\n",(void *)image);
-		}
-
-	/* print Reson 7k data record header information */
-	mbsys_reson7k_print_header(verbose, &image->header, error);
-
-	/* print Reson 7k image imagery data (record 7007) */
-	if (verbose >= 2)
-		first = debug_str;
-	else
-		{
-		first = nodebug_str;
-		fprintf(stderr,"\n%sMBIO function <%s> called\n",
-			first,function_name);
-		}
-	fprintf(stderr,"%sStructure Contents:\n", first);
-	fprintf(stderr,"%s     ping_number:                %u\n",first,image->ping_number);
-	fprintf(stderr,"%s     multi_ping:                 %u\n",first,image->multi_ping);
-	fprintf(stderr,"%s     width:                      %d\n",first,image->width);
-	fprintf(stderr,"%s     height:                     %d\n",first,image->height);
-	fprintf(stderr,"%s     color_depth:                %d\n",first,image->color_depth);
-	fprintf(stderr,"%s     width_height_flag:          %d\n",first,image->width_height_flag);
-	fprintf(stderr,"%s     compression:                %d\n",first,image->compression);
-	fprintf(stderr,"%s     nalloc:                     %d\n",first,image->nalloc);
-	if (image->color_depth == 1)
-		{
-		charptr = (mb_s_char *) image->image;
-		for (i=0;i<image->width*image->height;i++)
-			fprintf(stderr,"%s     image[%d]:  %hhu\n",
-				first,i,charptr[i]);
-		}
-	else if (image->color_depth == 2)
-		{
-		shortptr = (short *) image->image;
-		for (i=0;i<image->width*image->height;i++)
-			fprintf(stderr,"%s     image[%d]:  %hu\n",
-				first,i,shortptr[i]);
-		}
-	else if (image->color_depth == 4)
-		{
-		intptr = (int *) image->image;
-		for (i=0;i<image->width*image->height;i++)
-			fprintf(stderr,"%s     image[%d]:  %u\n",
-				first,i,intptr[i]);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_reson7k_print_v2pingmotion(int verbose,
-			s7kr_v2pingmotion *v2pingmotion,
-			int *error)
-{
-	char	*function_name = "mbsys_reson7k_print_v2pingmotion";
-	int	status = MB_SUCCESS;
-	char	*debug_str = "dbg2  ";
-	char	*nodebug_str = "  ";
-	char	*first;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:           %d\n",verbose);
-		fprintf(stderr,"dbg2       v2pingmotion:      %p\n",(void *)v2pingmotion);
-		}
-
-	/* print Reson 7k data record header information */
-	mbsys_reson7k_print_header(verbose, &v2pingmotion->header, error);
-
-	/* print Reson 7k ping motion (record 7012) */
-	if (verbose >= 2)
-		first = debug_str;
-	else
-		{
-		first = nodebug_str;
-		fprintf(stderr,"\n%sMBIO function <%s> called\n",
-			first,function_name);
-		}
-	fprintf(stderr,"%sStructure Contents:\n", first);
-	fprintf(stderr,"%s     serial_number:              %llu\n",first,v2pingmotion->serial_number);
-	fprintf(stderr,"%s     ping_number:                %u\n",first,v2pingmotion->ping_number);
-	fprintf(stderr,"%s     multi_ping:                 %u\n",first,v2pingmotion->multi_ping);
-	fprintf(stderr,"%s     n:                          %d\n",first,v2pingmotion->n);
-	fprintf(stderr,"%s     flags:                      %d\n",first,v2pingmotion->flags);
-	fprintf(stderr,"%s     error_flags:                %d\n",first,v2pingmotion->error_flags);
-	fprintf(stderr,"%s     frequency:                  %f\n",first,v2pingmotion->frequency);
-	fprintf(stderr,"%s     pitch:                      %f\n",first,v2pingmotion->pitch);
-	fprintf(stderr,"%s     nalloc:                     %d\n",first,v2pingmotion->nalloc);
-	fprintf(stderr,"%s     beam	roll    heading    heave\n",first);
-	fprintf(stderr,"%s     ----	----    -------    -----\n",first);
-	for (i=0;i<v2pingmotion->n;i++)
-		{
-		fprintf(stderr,"%s     %3d  %10g  %10g  %10g\n",
-			first,i,v2pingmotion->roll[i],v2pingmotion->heading[i],v2pingmotion->heave[i]);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_reson7k_print_v2detectionsetup(int verbose,
-			s7kr_v2detectionsetup *v2detectionsetup,
-			int *error)
-{
-	char	*function_name = "mbsys_reson7k_print_v2detectionsetup";
-	int	status = MB_SUCCESS;
-	char	*debug_str = "dbg2  ";
-	char	*nodebug_str = "  ";
-	char	*first;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:           %d\n",verbose);
-		fprintf(stderr,"dbg2       v2detectionsetup:  %p\n",(void *)v2detectionsetup);
-		}
-
-	/* print Reson 7k data record header information */
-	mbsys_reson7k_print_header(verbose, &v2detectionsetup->header, error);
-
-	/* print Reson 7k detection setup (record 7017) */
-	if (verbose >= 2)
-		first = debug_str;
-	else
-		{
-		first = nodebug_str;
-		fprintf(stderr,"\n%sMBIO function <%s> called\n",
-			first,function_name);
-		}
-	fprintf(stderr,"%sStructure Contents:\n", first);
-	fprintf(stderr,"%s     serial_number:              %llu\n",first,v2detectionsetup->serial_number);
-	fprintf(stderr,"%s     ping_number:                %u\n",first,v2detectionsetup->ping_number);
-	fprintf(stderr,"%s     multi_ping:                 %u\n",first,v2detectionsetup->multi_ping);
-	fprintf(stderr,"%s     number_beams:               %u\n",first,v2detectionsetup->number_beams);
-	fprintf(stderr,"%s     data_field_size:            %d\n",first,v2detectionsetup->data_field_size);
-	fprintf(stderr,"%s     detection_algorithm:        %d\n",first,v2detectionsetup->detection_algorithm);
-	fprintf(stderr,"%s     detection_flags:            %d\n",first,v2detectionsetup->detection_flags);
-	fprintf(stderr,"%s     minimum_depth:              %f\n",first,v2detectionsetup->minimum_depth);
-	fprintf(stderr,"%s     maximum_depth:              %f\n",first,v2detectionsetup->maximum_depth);
-	fprintf(stderr,"%s     minimum_range:              %f\n",first,v2detectionsetup->minimum_range);
-	fprintf(stderr,"%s     maximum_range:              %f\n",first,v2detectionsetup->maximum_range);
-	fprintf(stderr,"%s     minimum_nadir_search:       %f\n",first,v2detectionsetup->minimum_nadir_search);
-	fprintf(stderr,"%s     maximum_nadir_search:       %f\n",first,v2detectionsetup->maximum_nadir_search);
-	fprintf(stderr,"%s     automatic_filter_window:    %u\n",first,v2detectionsetup->automatic_filter_window);
-	fprintf(stderr,"%s     applied_roll:               %f\n",first,v2detectionsetup->applied_roll);
-	fprintf(stderr,"%s     depth_gate_tilt:            %f\n",first,v2detectionsetup->depth_gate_tilt);
-	for (i=0;i<14;i++)
-		{
-		fprintf(stderr,"%s     reserved[%2d]:               %f\n",first,i,v2detectionsetup->reserved[i]);
-		}
-	fprintf(stderr,"%s     beam	descriptor pick flag amin amax umin umax quality uncertainty\n",first);
-	fprintf(stderr,"%s     ---------------------------------------------------------\n",first);
-	for (i=0;i<v2detectionsetup->number_beams;i++)
-		{
-		fprintf(stderr,"%s     %3d %u %10.3f %u %u %u %u %u %u %f\n",
-			first,i,v2detectionsetup->beam_descriptor[i],
-			v2detectionsetup->detection_point[i],
-			v2detectionsetup->flags[i],
-			v2detectionsetup->auto_limits_min_sample[i],
-			v2detectionsetup->auto_limits_max_sample[i],
-			v2detectionsetup->user_limits_min_sample[i],
-			v2detectionsetup->user_limits_max_sample[i],
-			v2detectionsetup->quality[i],
-			v2detectionsetup->uncertainty[i]);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_reson7k_print_v2beamformed(int verbose,
-			s7kr_v2beamformed *v2beamformed,
-			int *error)
-{
-	char	*function_name = "mbsys_reson7k_print_v2beamformed";
-	int	status = MB_SUCCESS;
-	s7kr_v2amplitudephase *v2amplitudephase;
-	char	*debug_str = "dbg2  ";
-	char	*nodebug_str = "  ";
-	char	*first;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:           %d\n",verbose);
-		fprintf(stderr,"dbg2       v2beamformed:      %p\n",(void *)v2beamformed);
-		}
-
-	/* Reson 7k beamformed magnitude and phase data (record 7018) */
-	mbsys_reson7k_print_header(verbose, &v2beamformed->header, error);
-
-	/* print Reson 7k detection setup (record 7017) */
-	if (verbose >= 2)
-		first = debug_str;
-	else
-		{
-		first = nodebug_str;
-		fprintf(stderr,"\n%sMBIO function <%s> called\n",
-			first,function_name);
-		}
-	fprintf(stderr,"%sStructure Contents:\n", first);
-	fprintf(stderr,"%s     serial_number:              %llu\n",first,v2beamformed->serial_number);
-	fprintf(stderr,"%s     ping_number:                %u\n",first,v2beamformed->ping_number);
-	fprintf(stderr,"%s     multi_ping:                 %u\n",first,v2beamformed->multi_ping);
-	fprintf(stderr,"%s     number_beams:               %u\n",first,v2beamformed->number_beams);
-	fprintf(stderr,"%s     number_samples:             %d\n",first,v2beamformed->number_samples);
-	fprintf(stderr,"%s     reserved:                   ",first);
-	for (i=0;i<32;i++)
-		fprintf(stderr,"%u ",v2beamformed->reserved[i]);
-	fprintf(stderr,"\n");
-	for (i=0;i<v2beamformed->number_beams;i++)
-		{
-		v2amplitudephase = &(v2beamformed->amplitudephase[i]);
-		fprintf(stderr,"%s     beam_number:                %d\n",first,v2amplitudephase->beam_number);
-		fprintf(stderr,"%s     number_samples:             %d\n",first,v2amplitudephase->number_samples);
-		for (j=0;j<v2amplitudephase->number_samples;j++)
-			{
-			fprintf(stderr,"%s     beam[%d] sample[%d] amplitude:%u phase:%d\n",
-				first,i,j,v2amplitudephase->amplitude[j],v2amplitudephase->phase[j]);
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_reson7k_print_v2bite(int verbose,
-			s7kr_v2bite *v2bite,
-			int *error)
-{
-	char	*function_name = "mbsys_reson7k_print_v2bite";
-	int	status = MB_SUCCESS;
-	s7kr_v2bitereport *v2bitereport;
-	s7kr_v2bitefield *v2bitefield;
-	s7k_time *s7ktime;
-	char	*debug_str = "dbg2  ";
-	char	*nodebug_str = "  ";
-	char	*first;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:           %d\n",verbose);
-		fprintf(stderr,"dbg2       v2bite:      %p\n",(void *)v2bite);
-		}
-
-	/* print Reson 7k data record header information */
-	mbsys_reson7k_print_header(verbose, &v2bite->header, error);
-
-	/* Reson 7k BITE (record 7021) */
-	if (verbose >= 2)
-		first = debug_str;
-	else
-		{
-		first = nodebug_str;
-		fprintf(stderr,"\n%sMBIO function <%s> called\n",
-			first,function_name);
-		}
-	fprintf(stderr,"%sStructure Contents:\n", first);
-	fprintf(stderr,"%s     number_reports:             %u\n",first,v2bite->number_reports);
-	for (i=0;i<v2bite->number_reports;i++)
-		{
-		v2bitereport = &(v2bite->reports[i]);
-		fprintf(stderr,"%s     source_name:                %s\n",first,v2bitereport->source_name);
-		fprintf(stderr,"%s     source_address:             %u\n",first,v2bitereport->source_address);
-		fprintf(stderr,"%s     frequency:                  %f\n",first,v2bitereport->frequency);
-		fprintf(stderr,"%s     enumerator:                 %u\n",first,v2bitereport->enumerator);
-		s7ktime = &(v2bitereport->downlink_time);
-		fprintf(stderr,"%s     downlink_time:              %4.4d/%3.3d %2.2d:%2.2d:%9.6f\n",
-			first,s7ktime->Year,s7ktime->Day,s7ktime->Hours,s7ktime->Minutes,s7ktime->Seconds);
-		s7ktime = &(v2bitereport->uplink_time);
-		fprintf(stderr,"%s     uplink_time:                %4.4d/%3.3d %2.2d:%2.2d:%9.6f\n",
-			first,s7ktime->Year,s7ktime->Day,s7ktime->Hours,s7ktime->Minutes,s7ktime->Seconds);
-		s7ktime = &(v2bitereport->bite_time);
-		fprintf(stderr,"%s     bite_time:                  %4.4d/%3.3d %2.2d:%2.2d:%9.6f\n",
-			first,s7ktime->Year,s7ktime->Day,s7ktime->Hours,s7ktime->Minutes,s7ktime->Seconds);
-		fprintf(stderr,"%s     status:                     %u\n",first,v2bitereport->status);
-		fprintf(stderr,"%s     number_bite:                %u\n",first,v2bitereport->number_bite);
-		fprintf(stderr,"%s     bite_status:                ",first);
-		for (j=0;j<32;j++)
-			fprintf(stderr,"%u ",v2bitereport->bite_status[j]);
-		fprintf(stderr,"\n");
-		for (j=0;j<v2bitereport->number_bite;j++)
-			{
-			v2bitefield = &(v2bitereport->bitefield[j]);
-			fprintf(stderr,"%s     reserved[%2d]:               %u\n",first,j,v2bitefield->reserved);
-			fprintf(stderr,"%s     name[%2d]:                   %s\n",first,j,v2bitefield->name);
-			fprintf(stderr,"%s     device_type[%2d]:            %d\n",first,j,v2bitefield->device_type);
-			fprintf(stderr,"%s     minimum[%2d]:                %f\n",first,j,v2bitefield->minimum);
-			fprintf(stderr,"%s     maximum[%2d]:                %f\n",first,j,v2bitefield->maximum);
-			fprintf(stderr,"%s     value[%2d]:                  %f\n",first,j,v2bitefield->value);
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_reson7k_print_v27kcenterversion(int verbose,
-			s7kr_v27kcenterversion *v27kcenterversion,
-			int *error)
-{
-	char	*function_name = "mbsys_reson7k_print_v27kcenterversion";
-	int	status = MB_SUCCESS;
-	char	*debug_str = "dbg2  ";
-	char	*nodebug_str = "  ";
-	char	*first;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:           %d\n",verbose);
-		fprintf(stderr,"dbg2       v27kcenterversion: %p\n",(void *)v27kcenterversion);
-		}
-
-	/* print Reson 7k data record header information */
-	mbsys_reson7k_print_header(verbose, &v27kcenterversion->header, error);
-
-	/* Reson 7k center version (record 7022) */
-	if (verbose >= 2)
-		first = debug_str;
-	else
-		{
-		first = nodebug_str;
-		fprintf(stderr,"\n%sMBIO function <%s> called\n",
-			first,function_name);
-		}
-	fprintf(stderr,"%sStructure Contents:\n", first);
-	fprintf(stderr,"%s     version:                    %s\n",first,v27kcenterversion->version);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_reson7k_print_v28kwetendversion(int verbose,
-			s7kr_v28kwetendversion *v28kwetendversion,
-			int *error)
-{
-	char	*function_name = "mbsys_reson7k_print_v28kwetendversion";
-	int	status = MB_SUCCESS;
-	char	*debug_str = "dbg2  ";
-	char	*nodebug_str = "  ";
-	char	*first;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:           %d\n",verbose);
-		fprintf(stderr,"dbg2       v28kwetendversion:      %p\n",(void *)v28kwetendversion);
-		}
-
-	/* print Reson 7k data record header information */
-	mbsys_reson7k_print_header(verbose, &v28kwetendversion->header, error);
-
-	/* Reson 7k 8k wet end version (record 7023) */
-	if (verbose >= 2)
-		first = debug_str;
-	else
-		{
-		first = nodebug_str;
-		fprintf(stderr,"\n%sMBIO function <%s> called\n",
-			first,function_name);
-		}
-	fprintf(stderr,"%sStructure Contents:\n", first);
-	fprintf(stderr,"%s     version:                    %s\n",first,v28kwetendversion->version);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_reson7k_print_v2detection(int verbose,
-			s7kr_v2detection *v2detection,
-			int *error)
-{
-	char	*function_name = "mbsys_reson7k_print_v2detection";
-	int	status = MB_SUCCESS;
-	char	*debug_str = "dbg2  ";
-	char	*nodebug_str = "  ";
-	char	*first;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:           %d\n",verbose);
-		fprintf(stderr,"dbg2       v2detection:      %p\n",(void *)v2detection);
-		}
-
-	/* print Reson 7k data record header information */
-	mbsys_reson7k_print_header(verbose, &v2detection->header, error);
-
-	/* print Reson 7k version 2 detection (record 7026) */
-	if (verbose >= 2)
-		first = debug_str;
-	else
-		{
-		first = nodebug_str;
-		fprintf(stderr,"\n%sMBIO function <%s> called\n",
-			first,function_name);
-		}
-	fprintf(stderr,"%sStructure Contents:\n", first);
-	fprintf(stderr,"%s     serial_number:              %llu\n",first,v2detection->serial_number);
-	fprintf(stderr,"%s     ping_number:                %u\n",first,v2detection->ping_number);
-	fprintf(stderr,"%s     multi_ping:                 %u\n",first,v2detection->multi_ping);
-	fprintf(stderr,"%s     number_beams:               %u\n",first,v2detection->number_beams);
-	fprintf(stderr,"%s     data_field_size:            %d\n",first,v2detection->data_field_size);
-	fprintf(stderr,"%s     corrections:                %llu\n",first,v2detection->corrections);
-	fprintf(stderr,"%s     detection_algorithm:        %d\n",first,v2detection->detection_algorithm);
-	fprintf(stderr,"%s     flags:                      %d\n",first,v2detection->flags);
-	for (i=0;i<64;i++)
-		fprintf(stderr,"%u ",v2detection->reserved[i]);
-	fprintf(stderr,"%s     beam	range angle_x angle_y range_error angle_x_error angle_y_error\n",first);
-	fprintf(stderr,"%s     ----------------------------------------------------------------------\n",first);
-	for (i=0;i<v2detection->number_beams;i++)
-		{
-		fprintf(stderr,"%s     %3d %f %f %f %f %f %f\n",
-			first,i,v2detection->range[i],
-			v2detection->angle_x[i],
-			v2detection->angle_y[i],
-			v2detection->range_error[i],
-			v2detection->angle_x_error[i],
-			v2detection->angle_y_error[i]);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_reson7k_print_v2rawdetection(int verbose,
-			s7kr_v2rawdetection *v2rawdetection,
-			int *error)
-{
-	char	*function_name = "mbsys_reson7k_print_v2rawdetection";
-	int	status = MB_SUCCESS;
-	char	*debug_str = "dbg2  ";
-	char	*nodebug_str = "  ";
-	char	*first;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:           %d\n",verbose);
-		fprintf(stderr,"dbg2       v2rawdetection:      %p\n",(void *)v2rawdetection);
-		}
-
-	/* print Reson 7k data record header information */
-	mbsys_reson7k_print_header(verbose, &v2rawdetection->header, error);
-
-	/* print Reson 7k version 2 raw detection (record 7027) */
-	if (verbose >= 2)
-		first = debug_str;
-	else
-		{
-		first = nodebug_str;
-		fprintf(stderr,"\n%sMBIO function <%s> called\n",
-			first,function_name);
-		}
-	fprintf(stderr,"%sStructure Contents:\n", first);
-	fprintf(stderr,"%s     serial_number:              %llu\n",first,v2rawdetection->serial_number);
-	fprintf(stderr,"%s     ping_number:                %u\n",first,v2rawdetection->ping_number);
-	fprintf(stderr,"%s     multi_ping:                 %u\n",first,v2rawdetection->multi_ping);
-	fprintf(stderr,"%s     number_beams:               %u\n",first,v2rawdetection->number_beams);
-	fprintf(stderr,"%s     data_field_size:            %d\n",first,v2rawdetection->data_field_size);
-	fprintf(stderr,"%s     detection_algorithm:        %d\n",first,v2rawdetection->detection_algorithm);
-	fprintf(stderr,"%s     detection_flags:            %d\n",first,v2rawdetection->detection_flags);
-	fprintf(stderr,"%s     sampling_rate:              %f\n",first,v2rawdetection->sampling_rate);
-	fprintf(stderr,"%s     tx_angle:                   %f\n",first,v2rawdetection->tx_angle);
-	fprintf(stderr,"%s     reserved:                   ",first);
-	for (i=0;i<64;i++)
-		fprintf(stderr,"%u ",v2rawdetection->reserved[i]);
-	fprintf(stderr,"\n%s     beam	beam_descriptor detection_point rx_angle flags quality uncertainty\n",first);
-	fprintf(stderr,"%s     ----------------------------------------------------------------------\n",first);
-	for (i=0;i<v2rawdetection->number_beams;i++)
-		{
-		fprintf(stderr,"%s     %3d %u %f %f %u %u %f\n",
-			first,i,v2rawdetection->beam_descriptor[i],
-			v2rawdetection->detection_point[i],
-			v2rawdetection->rx_angle[i],
-			v2rawdetection->flags[i],
-			v2rawdetection->quality[i],
-			v2rawdetection->uncertainty[i]);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_reson7k_print_v2snippet(int verbose,
-			s7kr_v2snippet *v2snippet,
-			int *error)
-{
-	char	*function_name = "mbsys_reson7k_print_v2snippet";
-	int	status = MB_SUCCESS;
-	s7kr_v2snippettimeseries *v2snippettimeseries;
-	char	*debug_str = "dbg2  ";
-	char	*nodebug_str = "  ";
-	char	*first;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:           %d\n",verbose);
-		fprintf(stderr,"dbg2       v2snippet:      %p\n",(void *)v2snippet);
-		}
-
-	/* print Reson 7k data record header information */
-	mbsys_reson7k_print_header(verbose, &v2snippet->header, error);
-
-	/* print Reson 7k version 2 snippet (record 7028) */
-	if (verbose >= 2)
-		first = debug_str;
-	else
-		{
-		first = nodebug_str;
-		fprintf(stderr,"\n%sMBIO function <%s> called\n",
-			first,function_name);
-		}
-	fprintf(stderr,"%sStructure Contents:\n", first);
-	fprintf(stderr,"%s     serial_number:              %llu\n",first,v2snippet->serial_number);
-	fprintf(stderr,"%s     ping_number:                %u\n",first,v2snippet->ping_number);
-	fprintf(stderr,"%s     multi_ping:                 %u\n",first,v2snippet->multi_ping);
-	fprintf(stderr,"%s     number_beams:               %u\n",first,v2snippet->number_beams);
-	fprintf(stderr,"%s     error_flag:                 %u\n",first,v2snippet->error_flag);
-	fprintf(stderr,"%s     control_flags:              %u\n",first,v2snippet->control_flags);
-	for (i=0;i<28;i++)
-		fprintf(stderr,"%u ",v2snippet->reserved[i]);
-	for (i=0;i<v2snippet->number_beams;i++)
-		{
-		v2snippettimeseries = &(v2snippet->snippettimeseries[i]);
-		fprintf(stderr,"%s     beam: %u begin:%u detect:%u end:%u\n",
-			first,v2snippettimeseries->beam_number,
-			v2snippettimeseries->begin_sample,
-			v2snippettimeseries->detect_sample,
-			v2snippettimeseries->end_sample);
-		for (j=0;j<v2snippettimeseries->end_sample-v2snippettimeseries->begin_sample+1;j++)
-			fprintf(stderr,"%s     amplitude[%d]:%d\n",
-				first,v2snippettimeseries->begin_sample+j,v2snippettimeseries->amplitude[j]);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_reson7k_print_calibratedsnippet(int verbose,
-			s7kr_calibratedsnippet *calibratedsnippet,
-			int *error)
-{
-	char	*function_name = "mbsys_reson7k_print_calibratedsnippet";
-	int	status = MB_SUCCESS;
-	s7kr_calibratedsnippettimeseries *calibratedsnippettimeseries;
-	char	*debug_str = "dbg2  ";
-	char	*nodebug_str = "  ";
-	char	*first;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:           %d\n",verbose);
-		fprintf(stderr,"dbg2       calibratedsnippet:      %p\n",(void *)calibratedsnippet);
-		}
-
-	/* print Reson 7k data record header information */
-	mbsys_reson7k_print_header(verbose, &calibratedsnippet->header, error);
-
-	/* print Reson 7k version 2 snippet (record 7028) */
-	if (verbose >= 2)
-		first = debug_str;
-	else
-		{
-		first = nodebug_str;
-		fprintf(stderr,"\n%sMBIO function <%s> called\n",
-			first,function_name);
-		}
-	fprintf(stderr,"%sStructure Contents:\n", first);
-	fprintf(stderr,"%s     serial_number:              %llu\n",first,calibratedsnippet->serial_number);
-	fprintf(stderr,"%s     ping_number:                %u\n",first,calibratedsnippet->ping_number);
-	fprintf(stderr,"%s     multi_ping:                 %u\n",first,calibratedsnippet->multi_ping);
-	fprintf(stderr,"%s     number_beams:               %u\n",first,calibratedsnippet->number_beams);
-	fprintf(stderr,"%s     error_flag:                 %u\n",first,calibratedsnippet->error_flag);
-	fprintf(stderr,"%s     control_flags:              %u\n",first,calibratedsnippet->control_flags);
-	for (i=0;i<28;i++)
-		fprintf(stderr,"%s     reserved[%d]:                %u\n", first, i, calibratedsnippet->reserved[i]);
-	for (i=0;i<calibratedsnippet->number_beams;i++)
-		{
-		calibratedsnippettimeseries = &(calibratedsnippet->calibratedsnippettimeseries[i]);
-		fprintf(stderr,"%s     beam: %u begin:%u detect:%u end:%u\n",
-			first,calibratedsnippettimeseries->beam_number,
-			calibratedsnippettimeseries->begin_sample,
-			calibratedsnippettimeseries->detect_sample,
-			calibratedsnippettimeseries->end_sample);
-		for (j=0;j<calibratedsnippettimeseries->end_sample-calibratedsnippettimeseries->begin_sample+1;j++)
-			fprintf(stderr,"%s     snippet amplitude[%d]:%f\n",
-				first,calibratedsnippettimeseries->begin_sample+j,calibratedsnippettimeseries->amplitude[j]);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_reson7k_print_installation(int verbose,
-			s7kr_installation *installation,
-			int *error)
-{
-	char	*function_name = "mbsys_reson7k_print_installation";
-	int	status = MB_SUCCESS;
-	char	*debug_str = "dbg2  ";
-	char	*nodebug_str = "  ";
-	char	*first;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:           %d\n",verbose);
-		fprintf(stderr,"dbg2       installation:      %p\n",(void *)installation);
-		}
-
-	/* print Reson 7k data record header information */
-	mbsys_reson7k_print_header(verbose, &installation->header, error);
-
-	/* print Reson 7k sonar installation parameters (record 7051) */
-	if (verbose >= 2)
-		first = debug_str;
-	else
-		{
-		first = nodebug_str;
-		fprintf(stderr,"\n%sMBIO function <%s> called\n",
-			first,function_name);
-		}
-	fprintf(stderr,"%sStructure Contents:\n", first);
-	fprintf(stderr,"%s     frequency:                  %f\n",first,installation->frequency);
-	fprintf(stderr,"%s     firmware_version_len:       %d\n",first,installation->firmware_version_len);
-	fprintf(stderr,"%s     firmware_version:           %s\n",first,installation->firmware_version);
-	fprintf(stderr,"%s     software_version_len:       %d\n",first,installation->software_version_len);
-	fprintf(stderr,"%s     software_version:           %s\n",first,installation->software_version);
-	fprintf(stderr,"%s     s7k_version_len:            %d\n",first,installation->s7k_version_len);
-	fprintf(stderr,"%s     s7k_version:                %s\n",first,installation->s7k_version);
-	fprintf(stderr,"%s     protocal_version_len:       %d\n",first,installation->protocal_version_len);
-	fprintf(stderr,"%s     protocal_version:           %s\n",first,installation->protocal_version);
-	fprintf(stderr,"%s     transmit_x:                 %f\n",first,installation->transmit_x);
-	fprintf(stderr,"%s     transmit_y:                 %f\n",first,installation->transmit_y);
-	fprintf(stderr,"%s     transmit_z:                 %f\n",first,installation->transmit_z);
-	fprintf(stderr,"%s     transmit_roll:              %f\n",first,installation->transmit_roll);
-	fprintf(stderr,"%s     transmit_pitch:             %f\n",first,installation->transmit_pitch);
-	fprintf(stderr,"%s     transmit_heading:           %f\n",first,installation->transmit_heading);
-	fprintf(stderr,"%s     transmit_x:                 %f\n",first,installation->transmit_x);
-	fprintf(stderr,"%s     transmit_x:                 %f\n",first,installation->transmit_x);
-	fprintf(stderr,"%s     receive_x:                  %f\n",first,installation->receive_x);
-	fprintf(stderr,"%s     receive_y:                  %f\n",first,installation->receive_y);
-	fprintf(stderr,"%s     receive_z:                  %f\n",first,installation->receive_z);
-	fprintf(stderr,"%s     receive_roll:               %f\n",first,installation->receive_roll);
-	fprintf(stderr,"%s     receive_pitch:              %f\n",first,installation->receive_pitch);
-	fprintf(stderr,"%s     receive_heading:            %f\n",first,installation->receive_heading);
-	fprintf(stderr,"%s     receive_x:                  %f\n",first,installation->receive_x);
-	fprintf(stderr,"%s     receive_x:                  %f\n",first,installation->receive_x);
-	fprintf(stderr,"%s     motion_x:                   %f\n",first,installation->motion_x);
-	fprintf(stderr,"%s     motion_y:                   %f\n",first,installation->motion_y);
-	fprintf(stderr,"%s     motion_z:                   %f\n",first,installation->motion_z);
-	fprintf(stderr,"%s     motion_roll:                %f\n",first,installation->motion_roll);
-	fprintf(stderr,"%s     motion_pitch:               %f\n",first,installation->motion_pitch);
-	fprintf(stderr,"%s     motion_heading:             %f\n",first,installation->motion_heading);
-	fprintf(stderr,"%s     motion_x:                   %f\n",first,installation->motion_x);
-	fprintf(stderr,"%s     motion_x:                   %f\n",first,installation->motion_x);
-	fprintf(stderr,"%s     motion_time_delay:          %d\n",first,installation->motion_time_delay);
-	fprintf(stderr,"%s     position_x:                 %f\n",first,installation->position_x);
-	fprintf(stderr,"%s     position_y:                 %f\n",first,installation->position_y);
-	fprintf(stderr,"%s     position_z:                 %f\n",first,installation->position_z);
-	fprintf(stderr,"%s     position_time_delay:        %d\n",first,installation->position_time_delay);
-	fprintf(stderr,"%s     waterline_z:                %f\n",first,installation->waterline_z);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_reson7k_print_systemeventmessage(int verbose,
-			s7kr_systemeventmessage *systemeventmessage,
-			int *error)
-{
-	char	*function_name = "mbsys_reson7k_print_systemeventmessage";
-	int	status = MB_SUCCESS;
-	char	*debug_str = "dbg2  ";
-	char	*nodebug_str = "  ";
-	char	*first;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:           %d\n",verbose);
-		fprintf(stderr,"dbg2       systemeventmessage:%p\n",(void *)systemeventmessage);
-		}
-
-	/* print Reson 7k data record header information */
-	mbsys_reson7k_print_header(verbose, &systemeventmessage->header, error);
-
-	/* print Reson 7k system event (record 7051) */
-	if (verbose >= 2)
-		first = debug_str;
-	else
-		{
-		first = nodebug_str;
-		fprintf(stderr,"\n%sMBIO function <%s> called\n",
-			first,function_name);
-		}
-	fprintf(stderr,"%sStructure Contents:\n", first);
-	fprintf(stderr,"%s     serial_number:              %llu\n",first,systemeventmessage->serial_number);
-	fprintf(stderr,"%s     event_id:                   %d\n",first,systemeventmessage->event_id);
-	fprintf(stderr,"%s     message_length:             %d\n",first,systemeventmessage->message_length);
-	fprintf(stderr,"%s     event_identifier:           %d\n",first,systemeventmessage->event_identifier);
-	fprintf(stderr,"%s     message_alloc:              %d\n",first,systemeventmessage->message_alloc);
-	fprintf(stderr,"%s     message:                    %s\n",first,systemeventmessage->message);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_reson7k_print_subsystem(int verbose,
-			s7kr_subsystem *subsystem,
-			int *error)
-{
-	char	*function_name = "mbsys_reson7k_print_subsystem";
-	int	status = MB_SUCCESS;
-	char	*debug_str = "dbg2  ";
-	char	*nodebug_str = "  ";
-	char	*first;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:           %d\n",verbose);
-		fprintf(stderr,"dbg2       subsystem:         %p\n",(void *)subsystem);
-		}
-
-	/* print Reson 7k subsystem structure */
-	if (verbose >= 2)
-		first = debug_str;
-	else
-		{
-		first = nodebug_str;
-		fprintf(stderr,"\n%sMBIO function <%s> called\n",
-			first,function_name);
-		}
-	fprintf(stderr,"%sStructure Contents:\n", first);
-	fprintf(stderr,"%s     device_identifier:          %d\n",first,subsystem->device_identifier);
-	fprintf(stderr,"%s     system_enumerator:          %d\n",first,subsystem->system_enumerator);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_reson7k_print_fileheader(int verbose,
-			s7kr_fileheader *fileheader,
-			int *error)
-{
-	char	*function_name = "mbsys_reson7k_print_fileheader";
-	int	status = MB_SUCCESS;
-	char	*debug_str = "dbg2  ";
-	char	*nodebug_str = "  ";
-	char	*first;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:           %d\n",verbose);
-		fprintf(stderr,"dbg2       fileheader:        %p\n",(void *)fileheader);
-		}
-
-	/* print Reson 7k data record header information */
-	mbsys_reson7k_print_header(verbose, &fileheader->header, error);
-
-	/* print Reson 7k system event (record 7051) */
-	if (verbose >= 2)
-		first = debug_str;
-	else
-		{
-		first = nodebug_str;
-		fprintf(stderr,"\n%sMBIO function <%s> called\n",
-			first,function_name);
-		}
-	fprintf(stderr,"%sStructure Contents:\n", first);
-	fprintf(stderr,"%s     file_identifier:            0x",first);
-	for (i=0;i<16;i++)
-		fprintf(stderr,"%hhx",fileheader->file_identifier[i]);
-	fprintf(stderr,"\n");
-	fprintf(stderr,"%s     version:                    %d\n",first,fileheader->version);
-	fprintf(stderr,"%s     reserved:                   %d\n",first,fileheader->reserved);
-	fprintf(stderr,"%s     session_identifier:         %s\n",first,fileheader->session_identifier);
-	fprintf(stderr,"%s     record_data_size:           %d\n",first,fileheader->record_data_size);
-	fprintf(stderr,"%s     number_subsystems:          %d\n",first,fileheader->number_subsystems);
-	fprintf(stderr,"%s     recording_name:             %s\n",first,fileheader->recording_name);
-	fprintf(stderr,"%s     recording_version:          %s\n",first,fileheader->recording_version);
-	fprintf(stderr,"%s     user_defined_name:          %s\n",first,fileheader->user_defined_name);
-	fprintf(stderr,"%s     notes:                      %s\n",first,fileheader->notes);
-	for (i=0;i<fileheader->number_subsystems;i++)
-		mbsys_reson7k_print_subsystem(verbose, &fileheader->subsystem[i], error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_reson7k_print_remotecontrolsettings(int verbose,
-			s7kr_remotecontrolsettings *remotecontrolsettings,
-			int *error)
-{
-	char	*function_name = "mbsys_reson7k_print_remotecontrolsettings";
-	int	status = MB_SUCCESS;
-	char	*debug_str = "dbg2  ";
-	char	*nodebug_str = "  ";
-	char	*first;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:           %d\n",verbose);
-		fprintf(stderr,"dbg2       remotecontrolsettings:  %p\n",(void *)remotecontrolsettings);
-		}
-
-	/* print Reson 7k data record header information */
-	mbsys_reson7k_print_header(verbose, &remotecontrolsettings->header, error);
-
-	/* print Reson 7k remote control sonar settings (record 7503) */
-	if (verbose >= 2)
-		first = debug_str;
-	else
-		{
-		first = nodebug_str;
-		fprintf(stderr,"\n%sMBIO function <%s> called\n",
-			first,function_name);
-		}
-	fprintf(stderr,"%sStructure Contents:\n", first);
-	fprintf(stderr,"%s     serial_number:              %llu\n",first,remotecontrolsettings->serial_number);
-	fprintf(stderr,"%s     ping_number:                %u\n",first,remotecontrolsettings->ping_number);
-	fprintf(stderr,"%s     frequency:                  %f\n",first,remotecontrolsettings->frequency);
-	fprintf(stderr,"%s     sample_rate:                %f\n",first,remotecontrolsettings->sample_rate);
-	fprintf(stderr,"%s     receiver_bandwidth:         %f\n",first,remotecontrolsettings->receiver_bandwidth);
-	fprintf(stderr,"%s     pulse_width:                %f\n",first,remotecontrolsettings->pulse_width);
-	fprintf(stderr,"%s     pulse_type:                 %d\n",first,remotecontrolsettings->pulse_type);
-	fprintf(stderr,"%s     pulse_envelope:             %d\n",first,remotecontrolsettings->pulse_envelope);
-	fprintf(stderr,"%s     pulse_envelope_par:         %f\n",first,remotecontrolsettings->pulse_envelope_par);
-	fprintf(stderr,"%s     pulse_reserved:             %d\n",first,remotecontrolsettings->pulse_reserved);
-	fprintf(stderr,"%s     max_ping_rate:              %f\n",first,remotecontrolsettings->max_ping_rate);
-	fprintf(stderr,"%s     ping_period:                %f\n",first,remotecontrolsettings->ping_period);
-	fprintf(stderr,"%s     range_selection:            %f\n",first,remotecontrolsettings->range_selection);
-	fprintf(stderr,"%s     power_selection:            %f\n",first,remotecontrolsettings->power_selection);
-	fprintf(stderr,"%s     gain_selection:             %f\n",first,remotecontrolsettings->gain_selection);
-	fprintf(stderr,"%s     control_flags:              %d\n",first,remotecontrolsettings->control_flags);
-	fprintf(stderr,"%s     projector_magic_no:         %d\n",first,remotecontrolsettings->projector_magic_no);
-	fprintf(stderr,"%s     steering_vertical:          %f\n",first,remotecontrolsettings->steering_vertical);
-	fprintf(stderr,"%s     steering_horizontal:        %f\n",first,remotecontrolsettings->steering_horizontal);
-	fprintf(stderr,"%s     beamwidth_vertical:         %f\n",first,remotecontrolsettings->beamwidth_vertical);
-	fprintf(stderr,"%s     beamwidth_horizontal:       %f\n",first,remotecontrolsettings->beamwidth_horizontal);
-	fprintf(stderr,"%s     focal_point:                %f\n",first,remotecontrolsettings->focal_point);
-	fprintf(stderr,"%s     projector_weighting:        %d\n",first,remotecontrolsettings->projector_weighting);
-	fprintf(stderr,"%s     projector_weighting_par:    %f\n",first,remotecontrolsettings->projector_weighting_par);
-	fprintf(stderr,"%s     transmit_flags:             %d\n",first,remotecontrolsettings->transmit_flags);
-	fprintf(stderr,"%s     hydrophone_magic_no:        %d\n",first,remotecontrolsettings->hydrophone_magic_no);
-	fprintf(stderr,"%s     receive_weighting:          %d\n",first,remotecontrolsettings->receive_weighting);
-	fprintf(stderr,"%s     receive_weighting_par:      %f\n",first,remotecontrolsettings->receive_weighting_par);
-	fprintf(stderr,"%s     receive_flags:              %d\n",first,remotecontrolsettings->receive_flags);
-	fprintf(stderr,"%s     range_minimum:              %f\n",first,remotecontrolsettings->range_minimum);
-	fprintf(stderr,"%s     range_maximum:              %f\n",first,remotecontrolsettings->range_maximum);
-	fprintf(stderr,"%s     depth_minimum:              %f\n",first,remotecontrolsettings->depth_minimum);
-	fprintf(stderr,"%s     depth_maximum:              %f\n",first,remotecontrolsettings->depth_maximum);
-	fprintf(stderr,"%s     absorption:                 %f\n",first,remotecontrolsettings->absorption);
-	fprintf(stderr,"%s     sound_velocity:             %f\n",first,remotecontrolsettings->sound_velocity);
-	fprintf(stderr,"%s     spreading:                  %f\n",first,remotecontrolsettings->spreading);
-	fprintf(stderr,"%s     reserved:                   %d\n",first,remotecontrolsettings->reserved);
-	fprintf(stderr,"%s     tx_offset_x:                %f\n",first,remotecontrolsettings->tx_offset_x);
-	fprintf(stderr,"%s     tx_offset_y:                %f\n",first,remotecontrolsettings->tx_offset_y);
-	fprintf(stderr,"%s     tx_offset_z:                %f\n",first,remotecontrolsettings->tx_offset_z);
-	fprintf(stderr,"%s     head_tilt_x:                %f\n",first,remotecontrolsettings->head_tilt_x);
-	fprintf(stderr,"%s     head_tilt_y:                %f\n",first,remotecontrolsettings->head_tilt_y);
-	fprintf(stderr,"%s     head_tilt_z:                %f\n",first,remotecontrolsettings->head_tilt_z);
-	fprintf(stderr,"%s     ping_on_off:                %d\n",first,remotecontrolsettings->ping_on_off);
-	fprintf(stderr,"%s     data_sample_types:          %d\n",first,remotecontrolsettings->data_sample_types);
-	fprintf(stderr,"%s     projector_orientation:      %d\n",first,remotecontrolsettings->projector_orientation);
-	fprintf(stderr,"%s     beam_angle_mode:            %d\n",first,remotecontrolsettings->beam_angle_mode);
-	fprintf(stderr,"%s     r7kcenter_mode:             %d\n",first,remotecontrolsettings->r7kcenter_mode);
-	fprintf(stderr,"%s     gate_depth_min:             %f\n",first,remotecontrolsettings->gate_depth_min);
-	fprintf(stderr,"%s     gate_depth_max:             %f\n",first,remotecontrolsettings->gate_depth_max);
-	for (i=0;i<35;i++)
-		fprintf(stderr,"%s     reserved2[i]:               %d\n",first,remotecontrolsettings->reserved2[i]);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_reson7k_print_reserved(int verbose,
-			s7kr_reserved *reserved,
-			int *error)
-{
-	char	*function_name = "mbsys_reson7k_print_reserved";
-	int	status = MB_SUCCESS;
-	char	*debug_str = "dbg2  ";
-	char	*nodebug_str = "  ";
-	char	*first;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:           %d\n",verbose);
-		fprintf(stderr,"dbg2       reserved:          %p\n",(void *)reserved);
-		}
-
-	/* print Reson 7k data record header information */
-	mbsys_reson7k_print_header(verbose, &reserved->header, error);
-
-	/* print Reson 7k Reserved (well, unknown really...) (record 7504) */
-	if (verbose >= 2)
-		first = debug_str;
-	else
-		{
-		first = nodebug_str;
-		fprintf(stderr,"\n%sMBIO function <%s> called\n",
-			first,function_name);
-		}
-	fprintf(stderr,"%sStructure Contents:\n", first);
-	for (i=0;i<R7KHDRSIZE_7kReserved;i++)
-		fprintf(stderr,"%s     reserved[%d]:               %u\n",first,i,reserved->reserved[i]);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_reson7k_print_roll(int verbose,
-			s7kr_roll *roll,
-			int *error)
-{
-	char	*function_name = "mbsys_reson7k_print_roll";
-	int	status = MB_SUCCESS;
-	char	*debug_str = "dbg2  ";
-	char	*nodebug_str = "  ";
-	char	*first;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:           %d\n",verbose);
-		fprintf(stderr,"dbg2       roll:              %p\n",(void *)roll);
-		}
-
-	/* print Reson 7k data record header information */
-	mbsys_reson7k_print_header(verbose, &roll->header, error);
-
-	/* print Reson 7k Roll (record 7600) */
-	if (verbose >= 2)
-		first = debug_str;
-	else
-		{
-		first = nodebug_str;
-		fprintf(stderr,"\n%sMBIO function <%s> called\n",
-			first,function_name);
-		}
-	fprintf(stderr,"%sStructure Contents:\n", first);
-	fprintf(stderr,"%s     roll:                       %f\n",first,roll->roll);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_reson7k_print_pitch(int verbose,
-			s7kr_pitch *pitch,
-			int *error)
-{
-	char	*function_name = "mbsys_reson7k_print_pitch";
-	int	status = MB_SUCCESS;
-	char	*debug_str = "dbg2  ";
-	char	*nodebug_str = "  ";
-	char	*first;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:           %d\n",verbose);
-		fprintf(stderr,"dbg2       pitch:             %p\n",(void *)pitch);
-		}
-
-	/* print Reson 7k data record header information */
-	mbsys_reson7k_print_header(verbose, &pitch->header, error);
-
-	/* print Reson 7k Pitch (record 7601) */
-	if (verbose >= 2)
-		first = debug_str;
-	else
-		{
-		first = nodebug_str;
-		fprintf(stderr,"\n%sMBIO function <%s> called\n",
-			first,function_name);
-		}
-	fprintf(stderr,"%sStructure Contents:\n", first);
-	fprintf(stderr,"%s     pitch:                      %f\n",first,pitch->pitch);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_reson7k_print_soundvelocity(int verbose,
-			s7kr_soundvelocity *soundvelocity,
-			int *error)
-{
-	char	*function_name = "mbsys_reson7k_print_soundvelocity";
-	int	status = MB_SUCCESS;
-	char	*debug_str = "dbg2  ";
-	char	*nodebug_str = "  ";
-	char	*first;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:           %d\n",verbose);
-		fprintf(stderr,"dbg2       soundvelocity:     %p\n",(void *)soundvelocity);
-		}
-
-	/* print Reson 7k data record header information */
-	mbsys_reson7k_print_header(verbose, &soundvelocity->header, error);
-
-	/* print Reson 7k Sound Velocity (record 7610) */
-	if (verbose >= 2)
-		first = debug_str;
-	else
-		{
-		first = nodebug_str;
-		fprintf(stderr,"\n%sMBIO function <%s> called\n",
-			first,function_name);
-		}
-	fprintf(stderr,"%sStructure Contents:\n", first);
-	fprintf(stderr,"%s     soundvelocity:              %f\n",first,soundvelocity->soundvelocity);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_reson7k_print_absorptionloss(int verbose,
-			s7kr_absorptionloss *absorptionloss,
-			int *error)
-{
-	char	*function_name = "mbsys_reson7k_print_absorptionloss";
-	int	status = MB_SUCCESS;
-	char	*debug_str = "dbg2  ";
-	char	*nodebug_str = "  ";
-	char	*first;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:           %d\n",verbose);
-		fprintf(stderr,"dbg2       absorptionloss:    %p\n",(void *)absorptionloss);
-		}
-
-	/* print Reson 7k data record header information */
-	mbsys_reson7k_print_header(verbose, &absorptionloss->header, error);
-
-	/* print Reson 7k Absorption Loss (record 7611) */
-	if (verbose >= 2)
-		first = debug_str;
-	else
-		{
-		first = nodebug_str;
-		fprintf(stderr,"\n%sMBIO function <%s> called\n",
-			first,function_name);
-		}
-	fprintf(stderr,"%sStructure Contents:\n", first);
-	fprintf(stderr,"%s     absorptionloss:             %f\n",first,absorptionloss->absorptionloss);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_reson7k_print_spreadingloss(int verbose,
-			s7kr_spreadingloss *spreadingloss,
-			int *error)
-{
-	char	*function_name = "mbsys_reson7k_print_spreadingloss";
-	int	status = MB_SUCCESS;
-	char	*debug_str = "dbg2  ";
-	char	*nodebug_str = "  ";
-	char	*first;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:           %d\n",verbose);
-		fprintf(stderr,"dbg2       spreadingloss:     %p\n",(void *)spreadingloss);
-		}
-
-	/* print Reson 7k data record header information */
-	mbsys_reson7k_print_header(verbose, &spreadingloss->header, error);
-
-	/* print Reson 7k Spreading Loss (record 7611) */
-	if (verbose >= 2)
-		first = debug_str;
-	else
-		{
-		first = nodebug_str;
-		fprintf(stderr,"\n%sMBIO function <%s> called\n",
-			first,function_name);
-		}
-	fprintf(stderr,"%sStructure Contents:\n", first);
-	fprintf(stderr,"%s     spreadingloss:              %f\n",first,spreadingloss->spreadingloss);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_reson7k_dimensions(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int *nbath, int *namp, int *nss, int *error)
-{
-	char	*function_name = "mbsys_reson7k_dimensions";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_reson7k_struct *store;
-	s7kr_bathymetry *bathymetry;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get beam and pixel numbers */
-		bathymetry = (s7kr_bathymetry *) &store->bathymetry;
-		*nbath = bathymetry->number_beams;
-		*namp = *nbath;
-		*nss = 0;
-		}
-	else
-		{
-		/* get beam and pixel numbers */
-		*nbath = 0;
-		*namp = 0;
-		*nss = 0;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		fprintf(stderr,"dbg2       nbath:      %d\n",*nbath);
-		fprintf(stderr,"dbg2        namp:      %d\n",*namp);
-		fprintf(stderr,"dbg2        nss:       %d\n",*nss);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_reson7k_pingnumber(int verbose, void *mbio_ptr,
-		int *pingnumber, int *error)
-{
-	char	*function_name = "mbsys_reson7k_pingnumber";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_reson7k_struct *store;
-	s7kr_bathymetry *bathymetry;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_reson7k_struct *) mb_io_ptr->store_data;
-
-	/* extract data from structure */
-	bathymetry = (s7kr_bathymetry *) &store->bathymetry;
-	*pingnumber = bathymetry->ping_number;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       pingnumber: %d\n",*pingnumber);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_reson7k_sonartype(int verbose, void *mbio_ptr, void *store_ptr,
-		int *sonartype, int *error)
-{
-	char	*function_name = "mbsys_reson7k_sonartype";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_reson7k_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-
-	/* get sonar type */
-	*sonartype = MB_TOPOGRAPHY_TYPE_MULTIBEAM;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       sonartype:  %d\n",*sonartype);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_reson7k_sidescantype(int verbose, void *mbio_ptr, void *store_ptr,
-		int *ss_type, int *error)
-{
-	char	*function_name = "mbsys_reson7k_sidescantype";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_reson7k_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-
-	/* get sidescan type */
-	*ss_type = MB_SIDESCAN_LINEAR;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       ss_type:    %d\n",*ss_type);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_reson7k_extract(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int time_i[7], double *time_d,
-		double *navlon, double *navlat,
-		double *speed, double *heading,
-		int *nbath, int *namp, int *nss,
-		char *beamflag, double *bath, double *amp,
-		double *bathacrosstrack, double *bathalongtrack,
-		double *ss, double *ssacrosstrack, double *ssalongtrack,
-		char *comment, int *error)
-{
-	char	*function_name = "mbsys_reson7k_extract";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_reson7k_struct *store;
-	s7kr_bluefin *bluefin;
-	s7kr_processedsidescan *processedsidescan;
-	s7kr_volatilesettings *volatilesettings;
-	s7kr_beamgeometry *beamgeometry;
-	s7kr_bathymetry *bathymetry;
-	s7kr_backscatter *backscatter;
-	s7kr_beam *beam;
-	s7kr_position *position;
-	s7kr_systemeventmessage *systemeventmessage;
-	s7kr_fsdwsb *fsdwsb;
-	s7kr_fsdwss *fsdwsslo;
-	s7kr_fsdwss *fsdwsshi;
-	s7k_fsdwsegyheader *fsdwsegyheader;
-	s7k_fsdwssheader *fsdwssheader;
-	double	*pixel_size;
-	double	*swath_width;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	bluefin = (s7kr_bluefin *) &store->bluefin;
-	processedsidescan = (s7kr_processedsidescan *) &store->processedsidescan;
-	volatilesettings = (s7kr_volatilesettings *) &(store->volatilesettings);
-	beamgeometry = (s7kr_beamgeometry *) &(store->beamgeometry);
-	bathymetry = (s7kr_bathymetry *) &store->bathymetry;
-	backscatter = (s7kr_backscatter *) &store->backscatter;
-	beam = (s7kr_beam *) &store->beam;
-	position = (s7kr_position *) &store->position;
-	systemeventmessage = (s7kr_systemeventmessage *) &store->systemeventmessage;
-	fsdwsb = &(store->fsdwsb);
-	fsdwsslo = &(store->fsdwsslo);
-	fsdwsshi = &(store->fsdwsshi);
-
-	/* get saved values */
-	pixel_size = (double *) &mb_io_ptr->saved1;
-	swath_width = (double *) &mb_io_ptr->saved2;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get time */
-		for (i=0;i<7;i++)
-			time_i[i] = store->time_i[i];
-		*time_d = store->time_d;
-
-		/* get interpolated nav heading and speed  */
-		*speed = 0.0;
-		if (mb_io_ptr->nfix > 0)
-			mb_navint_interp(verbose, mbio_ptr, store->time_d, *heading, *speed,
-				    navlon, navlat, speed, error);
-
-		/* get heading */
-		if (bathymetry->optionaldata == MB_YES)
-			*heading = RTD * bathymetry->heading;
-
-		/* get navigation */
-		if (bathymetry->optionaldata == MB_YES
-			&& bathymetry->longitude != 0.0 && bathymetry->latitude != 0.0)
-			{
-			*navlon = RTD * bathymetry->longitude;
-			*navlat = RTD * bathymetry->latitude;
-/* fprintf(stderr,"mbsys_reson7k_extract: radians lon lat: %.10f %.10f  degrees lon lat: %.10f %.10f\n",
-bathymetry->longitude,bathymetry->latitude,*navlon,*navlat); */
-			}
-
-		/* set beamwidths in mb_io structure */
-		if (store->read_volatilesettings == MB_YES)
-			{
-			mb_io_ptr->beamwidth_xtrack = RTD * volatilesettings->receive_width;
-			mb_io_ptr->beamwidth_ltrack = RTD * volatilesettings->beamwidth_vertical;
-			}
-		else if (store->read_beamgeometry == MB_YES)
-			{
-			mb_io_ptr->beamwidth_xtrack = RTD * beamgeometry->beamwidth_acrosstrack[beamgeometry->number_beams/2];
-			mb_io_ptr->beamwidth_ltrack = RTD * beamgeometry->beamwidth_alongtrack[beamgeometry->number_beams/2];
-			}
-		mb_io_ptr->beamwidth_xtrack = MIN(mb_io_ptr->beamwidth_xtrack, 2.0);
-		mb_io_ptr->beamwidth_ltrack = MIN(mb_io_ptr->beamwidth_ltrack, 2.0);
-
-		/* read distance and depth values into storage arrays */
-		*nbath = bathymetry->number_beams;
-		*namp = *nbath;
-		for (i=0;i<*nbath;i++)
-			{
-			bath[i] = bathymetry->depth[i];
-
-			/* beamflagging scheme:
-				Reson quality flags use bits 0-3
-					bit 0: brightness test
-					bit 1: colinearity test
-					bit 2: amplitude pick
-					bit 3: phase pick
-				Early MB scheme (through 2007) - use bits 0-5
-					null: 0
-					flagged: 2
-					good: 15
-					amplitude: +16
-					phase: +32
-				Current MB scheme (>= 2008) - use bits 4-7
-					- bits 0-3 left in original values
-					- beam valid if bit 4 or 5 are set
-					- beam flagged if bit 6 or 7 set
-					bit 4: on = amplitude
-					bit 5: on = phase
-					bit 6: on = auto flag
-					bit 7: on = manual flag */
-			if (bathymetry->quality[i] == 0)
-				{
-				beamflag[i] = MB_FLAG_NULL;
-				}
-			else if (bathymetry->quality[i] & 64)
-				{
-				beamflag[i] = MB_FLAG_FLAG + MB_FLAG_FILTER;
-				}
-			else if (bathymetry->quality[i] & 128)
-				{
-				beamflag[i] = MB_FLAG_FLAG + MB_FLAG_MANUAL;
-				}
-			else if (bathymetry->quality[i] & 240)
-				{
-				beamflag[i] = MB_FLAG_NONE;
-				}
-			else if ((bathymetry->quality[i] & 3) == 3)
-				{
-				beamflag[i] = MB_FLAG_NONE;
-				}
-			else if ((bathymetry->quality[i] & 15) == 0)
-				{
-				beamflag[i] = MB_FLAG_NULL;
-				}
-			else if ((bathymetry->quality[i] & 3) == 0)
-				{
-				beamflag[i] = MB_FLAG_FLAG + MB_FLAG_FILTER;
-				}
-			else
-				{
-				beamflag[i] = MB_FLAG_FLAG + MB_FLAG_MANUAL;
-				}
-#ifdef MSYS_RESON7KR_DEBUG
-fprintf(stderr,"EXTRACT: beam:%d quality:%d q&240:%d ",i,bathymetry->quality[i],bathymetry->quality[i] & 240);
-if (bathymetry->quality[i] & 1) fprintf(stderr,"1"); else fprintf(stderr,"0");
-if (bathymetry->quality[i] & 2) fprintf(stderr,"1"); else fprintf(stderr,"0");
-if (bathymetry->quality[i] & 4) fprintf(stderr,"1"); else fprintf(stderr,"0");
-if (bathymetry->quality[i] & 8) fprintf(stderr,"1"); else fprintf(stderr,"0");
-if (bathymetry->quality[i] & 16) fprintf(stderr,"1"); else fprintf(stderr,"0");
-if (bathymetry->quality[i] & 32) fprintf(stderr,"1"); else fprintf(stderr,"0");
-if (bathymetry->quality[i] & 64) fprintf(stderr,"1"); else fprintf(stderr,"0");
-if (bathymetry->quality[i] & 128) fprintf(stderr,"1"); else fprintf(stderr,"0");
-fprintf(stderr," flag:%d\n",beamflag[i]);
-#endif
-			bathacrosstrack[i] = bathymetry->acrosstrack[i];
-			bathalongtrack[i] = bathymetry->alongtrack[i];
-			if (bathymetry->intensity[i] > 0.0)
-				amp[i] = 20.0 * log10((double)bathymetry->intensity[i]);
-			else
-				amp[i] = 0.0;
-			}
-
-		/* extract sidescan */
-		*nss = 0;
-		if (store->read_processedsidescan == MB_YES)
-			{
-			*nss = processedsidescan->number_pixels;
-			for (i=0;i<processedsidescan->number_pixels;i++)
-				{
-				ss[i] = processedsidescan->sidescan[i];
-				ssacrosstrack[i] = processedsidescan->pixelwidth
-							* (i - (int)processedsidescan->number_pixels / 2);
-				ssalongtrack[i] = processedsidescan->alongtrack[i];
-				}
-			for (i=processedsidescan->number_pixels;i<MBSYS_RESON7K_MAX_PIXELS;i++)
-				{
-				ss[i] = MB_SIDESCAN_NULL;
-				ssacrosstrack[i] = 0.0;
-				ssalongtrack[i] = 0.0;
-				}
-			}
-		else
-			{
-			for (i=0;i<MBSYS_RESON7K_MAX_PIXELS;i++)
-				{
-				ss[i] = MB_SIDESCAN_NULL;
-				ssacrosstrack[i] = 0.0;
-				ssalongtrack[i] = 0.0;
-				}
-			}
-
-		/* print debug statements */
-		if (verbose >= 5)
-			{
-			fprintf(stderr,"\ndbg4  Data extracted by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  Extracted values:\n");
-			fprintf(stderr,"dbg4       kind:       %d\n",
-				*kind);
-			fprintf(stderr,"dbg4       error:      %d\n",
-				*error);
-			fprintf(stderr,"dbg4       time_i[0]:  %d\n",
-				time_i[0]);
-			fprintf(stderr,"dbg4       time_i[1]:  %d\n",
-				time_i[1]);
-			fprintf(stderr,"dbg4       time_i[2]:  %d\n",
-				time_i[2]);
-			fprintf(stderr,"dbg4       time_i[3]:  %d\n",
-				time_i[3]);
-			fprintf(stderr,"dbg4       time_i[4]:  %d\n",
-				time_i[4]);
-			fprintf(stderr,"dbg4       time_i[5]:  %d\n",
-				time_i[5]);
-			fprintf(stderr,"dbg4       time_i[6]:  %d\n",
-				time_i[6]);
-			fprintf(stderr,"dbg4       time_d:     %f\n",
-				*time_d);
-			fprintf(stderr,"dbg4       longitude:  %f\n",
-				*navlon);
-			fprintf(stderr,"dbg4       latitude:   %f\n",
-				*navlat);
-			fprintf(stderr,"dbg4       speed:      %f\n",
-				*speed);
-			fprintf(stderr,"dbg4       heading:    %f\n",
-				*heading);
-			fprintf(stderr,"dbg4       nbath:      %d\n",
-				*nbath);
-			for (i=0;i<*nbath;i++)
-			  fprintf(stderr,"dbg4       beam:%d  flag:%3d  bath:%f  acrosstrack:%f  alongtrack:%f\n",
-				i,beamflag[i],bath[i],
-				bathacrosstrack[i],bathalongtrack[i]);
-			fprintf(stderr,"dbg4        namp:     %d\n",
-				*namp);
-			for (i=0;i<*namp;i++)
-			  fprintf(stderr,"dbg4        beam:%d   amp:%f  acrosstrack:%f  alongtrack:%f\n",
-				i,amp[i],bathacrosstrack[i],bathalongtrack[i]);
-			fprintf(stderr,"dbg4        nss:      %d\n",
-				*nss);
-			for (i=0;i<*nss;i++)
-			  fprintf(stderr,"dbg4        pixel:%d   ss:%f  acrosstrack:%f  alongtrack:%f\n",
-				i,ss[i],ssacrosstrack[i],ssalongtrack[i]);
-			}
-
-		/* done translating values */
-
-		}
-
-	/* extract data from structure */
-	else if (*kind == MB_DATA_NAV1)
-		{
-		/* get time */
-		for (i=0;i<7;i++)
-			time_i[i] = store->time_i[i];
-		*time_d = store->time_d;
-
-		/* get heading */
-		if (mb_io_ptr->nheading > 0)
-			mb_hedint_interp(verbose, mbio_ptr, store->time_d,
-				    heading, error);
-
-		/* get speed */
-		*speed = 0.0;
-		if (mb_io_ptr->nfix > 0)
-			mb_navint_interp(verbose, mbio_ptr, store->time_d, *heading, *speed,
-				    navlon, navlat, speed, error);
-
-		/* get navigation */
-		*navlon = RTD * position->longitude;
-		*navlat = RTD * position->latitude;
-
-		/* set beam and pixel numbers */
-		*nbath = 0;
-		*namp = 0;
-		*nss = 0;
-
-		/* print debug statements */
-		if (verbose >= 5)
-			{
-			fprintf(stderr,"\ndbg4  Data extracted by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  Extracted values:\n");
-			fprintf(stderr,"dbg4       kind:       %d\n",
-				*kind);
-			fprintf(stderr,"dbg4       error:      %d\n",
-				*error);
-			fprintf(stderr,"dbg4       time_i[0]:  %d\n",
-				time_i[0]);
-			fprintf(stderr,"dbg4       time_i[1]:  %d\n",
-				time_i[1]);
-			fprintf(stderr,"dbg4       time_i[2]:  %d\n",
-				time_i[2]);
-			fprintf(stderr,"dbg4       time_i[3]:  %d\n",
-				time_i[3]);
-			fprintf(stderr,"dbg4       time_i[4]:  %d\n",
-				time_i[4]);
-			fprintf(stderr,"dbg4       time_i[5]:  %d\n",
-				time_i[5]);
-			fprintf(stderr,"dbg4       time_i[6]:  %d\n",
-				time_i[6]);
-			fprintf(stderr,"dbg4       time_d:     %f\n",
-				*time_d);
-			fprintf(stderr,"dbg4       longitude:  %f\n",
-				*navlon);
-			fprintf(stderr,"dbg4       latitude:   %f\n",
-				*navlat);
-			fprintf(stderr,"dbg4       speed:      %f\n",
-				*speed);
-			fprintf(stderr,"dbg4       heading:    %f\n",
-				*heading);
-			}
-
-		/* done translating values */
-
-		}
-
-	/* extract data from structure */
-	else if (*kind == MB_DATA_NAV2)
-		{
-		/* get time */
-		for (i=0;i<7;i++)
-			time_i[i] = store->time_i[i];
-		*time_d = store->time_d;
-
-		/* get heading */
-		*heading = RTD * bluefin->nav[0].yaw;
-
-		/* get speed */
-		*speed = 0.0;
-		if (mb_io_ptr->nfix > 0)
-			mb_navint_interp(verbose, mbio_ptr, store->time_d, *heading, *speed,
-				    navlon, navlat, speed, error);
-
-		/* get navigation */
-		*navlon = RTD * bluefin->nav[0].longitude;
-		*navlat = RTD * bluefin->nav[0].latitude;
-
-		/* set beam and pixel numbers */
-		*nbath = 0;
-		*namp = 0;
-		*nss = 0;
-
-		/* print debug statements */
-		if (verbose >= 5)
-			{
-			fprintf(stderr,"\ndbg4  Data extracted by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  Extracted values:\n");
-			fprintf(stderr,"dbg4       kind:       %d\n",
-				*kind);
-			fprintf(stderr,"dbg4       error:      %d\n",
-				*error);
-			fprintf(stderr,"dbg4       time_i[0]:  %d\n",
-				time_i[0]);
-			fprintf(stderr,"dbg4       time_i[1]:  %d\n",
-				time_i[1]);
-			fprintf(stderr,"dbg4       time_i[2]:  %d\n",
-				time_i[2]);
-			fprintf(stderr,"dbg4       time_i[3]:  %d\n",
-				time_i[3]);
-			fprintf(stderr,"dbg4       time_i[4]:  %d\n",
-				time_i[4]);
-			fprintf(stderr,"dbg4       time_i[5]:  %d\n",
-				time_i[5]);
-			fprintf(stderr,"dbg4       time_i[6]:  %d\n",
-				time_i[6]);
-			fprintf(stderr,"dbg4       time_d:     %f\n",
-				*time_d);
-			fprintf(stderr,"dbg4       longitude:  %f\n",
-				*navlon);
-			fprintf(stderr,"dbg4       latitude:   %f\n",
-				*navlat);
-			fprintf(stderr,"dbg4       speed:      %f\n",
-				*speed);
-			fprintf(stderr,"dbg4       heading:    %f\n",
-				*heading);
-			}
-
-		/* done translating values */
-
-		}
-
-	/* extract data from structure */
-	else if (*kind == MB_DATA_SUBBOTTOM_SUBBOTTOM)
-		{
-		/* get edgetech segy header */
-		fsdwsegyheader = &(fsdwsb->segyheader);
-
-		/* get time */
-		for (i=0;i<7;i++)
-			time_i[i] = store->time_i[i];
-		*time_d = store->time_d;
-
-		/* get heading */
-		if (fsdwsegyheader->heading != 0)
-			*heading = 0.01 * fsdwsegyheader->heading;
-		else if (mb_io_ptr->nheading > 0)
-			mb_hedint_interp(verbose, mbio_ptr, store->time_d,
-					    heading, error);
-
-		/* get speed and position */
-		*speed = 0.0;
-		if (mb_io_ptr->nfix > 0)
-			mb_navint_interp(verbose, mbio_ptr, store->time_d, *heading, *speed,
-				    navlon, navlat, speed, error);
-
-		/* get position */
-		if (fsdwsegyheader->sourceCoordX != 0
-			|| fsdwsegyheader->sourceCoordY != 0)
-			{
-			*navlon = ((double)fsdwsegyheader->sourceCoordX) / 360000.0;
-			*navlat = ((double)fsdwsegyheader->sourceCoordY) / 360000.0;
-			}
-
-		/* set beam and pixel numbers */
-		*nbath = 0;
-		*namp = 0;
-		*nss = 0;
-
-		/* print debug statements */
-		if (verbose >= 5)
-			{
-			fprintf(stderr,"\ndbg4  Data extracted by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  Extracted values:\n");
-			fprintf(stderr,"dbg4       kind:       %d\n",
-				*kind);
-			fprintf(stderr,"dbg4       error:      %d\n",
-				*error);
-			fprintf(stderr,"dbg4       time_i[0]:  %d\n",
-				time_i[0]);
-			fprintf(stderr,"dbg4       time_i[1]:  %d\n",
-				time_i[1]);
-			fprintf(stderr,"dbg4       time_i[2]:  %d\n",
-				time_i[2]);
-			fprintf(stderr,"dbg4       time_i[3]:  %d\n",
-				time_i[3]);
-			fprintf(stderr,"dbg4       time_i[4]:  %d\n",
-				time_i[4]);
-			fprintf(stderr,"dbg4       time_i[5]:  %d\n",
-				time_i[5]);
-			fprintf(stderr,"dbg4       time_i[6]:  %d\n",
-				time_i[6]);
-			fprintf(stderr,"dbg4       time_d:     %f\n",
-				*time_d);
-			fprintf(stderr,"dbg4       longitude:  %f\n",
-				*navlon);
-			fprintf(stderr,"dbg4       latitude:   %f\n",
-				*navlat);
-			fprintf(stderr,"dbg4       speed:      %f\n",
-				*speed);
-			fprintf(stderr,"dbg4       heading:    %f\n",
-				*heading);
-			}
-
-		/* done translating values */
-
-		}
-
-	/* extract data from sidescan structure */
-	else if (*kind == MB_DATA_SIDESCAN2
-		|| *kind == MB_DATA_SIDESCAN3)
-		{
-		/* get edgetech sidescan header */
-		if (*kind == MB_DATA_SIDESCAN2)
-			fsdwssheader = &(fsdwsslo->ssheader[0]);
-		else if (*kind == MB_DATA_SIDESCAN3)
-			fsdwssheader = &(fsdwsshi->ssheader[0]);
-
-		/* get time */
-		for (i=0;i<7;i++)
-			time_i[i] = store->time_i[i];
-		*time_d = store->time_d;
-
-		/* get heading */
-		if (fsdwssheader->heading != 0)
-			*heading = 0.01 * fsdwssheader->heading;
-		else if (mb_io_ptr->nheading > 0)
-			mb_hedint_interp(verbose, mbio_ptr, store->time_d,
-					    heading, error);
-
-		/* get speed and position */
-		*speed = 0.0;
-		mb_navint_interp(verbose, mbio_ptr, store->time_d, *heading, *speed,
-				    navlon, navlat, speed, error);
-
-		/* get position */
-		if (fsdwssheader->longitude != 0
-			|| fsdwssheader->latitude != 0)
-			{
-			*navlon = ((double)fsdwssheader->longitude)/ 360000.0;
-			*navlat = ((double)fsdwssheader->latitude)/ 360000.0;
-			}
-
-		/* set beam and pixel numbers */
-		*nbath = 0;
-		*namp = 0;
-		*nss = 0;
-
-		/* print debug statements */
-		if (verbose >= 5)
-			{
-			fprintf(stderr,"\ndbg4  Data extracted by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  Extracted values:\n");
-			fprintf(stderr,"dbg4       kind:       %d\n",
-				*kind);
-			fprintf(stderr,"dbg4       error:      %d\n",
-				*error);
-			fprintf(stderr,"dbg4       time_i[0]:  %d\n",
-				time_i[0]);
-			fprintf(stderr,"dbg4       time_i[1]:  %d\n",
-				time_i[1]);
-			fprintf(stderr,"dbg4       time_i[2]:  %d\n",
-				time_i[2]);
-			fprintf(stderr,"dbg4       time_i[3]:  %d\n",
-				time_i[3]);
-			fprintf(stderr,"dbg4       time_i[4]:  %d\n",
-				time_i[4]);
-			fprintf(stderr,"dbg4       time_i[5]:  %d\n",
-				time_i[5]);
-			fprintf(stderr,"dbg4       time_i[6]:  %d\n",
-				time_i[6]);
-			fprintf(stderr,"dbg4       time_d:     %f\n",
-				*time_d);
-			fprintf(stderr,"dbg4       longitude:  %f\n",
-				*navlon);
-			fprintf(stderr,"dbg4       latitude:   %f\n",
-				*navlat);
-			fprintf(stderr,"dbg4       speed:      %f\n",
-				*speed);
-			fprintf(stderr,"dbg4       heading:    %f\n",
-				*heading);
-			}
-
-		/* done translating values */
-
-		}
-
-	/* extract comment from structure */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* get time */
-		for (i=0;i<7;i++)
-			time_i[i] = store->time_i[i];
-		*time_d = store->time_d;
-
-		/* copy comment */
-		if (systemeventmessage->message_length > 0)
-			strncpy(comment, systemeventmessage->message, MB_COMMENT_MAXLINE);
-		else
-			comment[0] = '\0';
-
-		/* print debug statements */
-		if (verbose >= 4)
-			{
-			fprintf(stderr,"\ndbg4  Comment extracted by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  New ping values:\n");
-			fprintf(stderr,"dbg4       kind:       %d\n",
-				*kind);
-			fprintf(stderr,"dbg4       error:      %d\n",
-				*error);
-			fprintf(stderr,"dbg4       time_i[0]:  %d\n",
-				time_i[0]);
-			fprintf(stderr,"dbg4       time_i[1]:  %d\n",
-				time_i[1]);
-			fprintf(stderr,"dbg4       time_i[2]:  %d\n",
-				time_i[2]);
-			fprintf(stderr,"dbg4       time_i[3]:  %d\n",
-				time_i[3]);
-			fprintf(stderr,"dbg4       time_i[4]:  %d\n",
-				time_i[4]);
-			fprintf(stderr,"dbg4       time_i[5]:  %d\n",
-				time_i[5]);
-			fprintf(stderr,"dbg4       time_i[6]:  %d\n",
-				time_i[6]);
-			fprintf(stderr,"dbg4       time_d:     %f\n",
-				*time_d);
-			fprintf(stderr,"dbg4       comment:    %s\n",
-				comment);
-			}
-		}
-
-	/* set time for other data records */
-	else
-		{
-		/* get time */
-		for (i=0;i<7;i++)
-			time_i[i] = store->time_i[i];
-		*time_d = store->time_d;
-
-		/* print debug statements */
-		if (verbose >= 4)
-			{
-			fprintf(stderr,"\ndbg4  Data extracted by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  Extracted values:\n");
-			fprintf(stderr,"dbg4       kind:       %d\n",
-				*kind);
-			fprintf(stderr,"dbg4       error:      %d\n",
-				*error);
-			fprintf(stderr,"dbg4       time_i[0]:  %d\n",
-				time_i[0]);
-			fprintf(stderr,"dbg4       time_i[1]:  %d\n",
-				time_i[1]);
-			fprintf(stderr,"dbg4       time_i[2]:  %d\n",
-				time_i[2]);
-			fprintf(stderr,"dbg4       time_i[3]:  %d\n",
-				time_i[3]);
-			fprintf(stderr,"dbg4       time_i[4]:  %d\n",
-				time_i[4]);
-			fprintf(stderr,"dbg4       time_i[5]:  %d\n",
-				time_i[5]);
-			fprintf(stderr,"dbg4       time_i[6]:  %d\n",
-				time_i[6]);
-			fprintf(stderr,"dbg4       time_d:     %f\n",
-				*time_d);
-			fprintf(stderr,"dbg4       comment:    %s\n",
-				comment);
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind == MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"dbg2       comment:     \ndbg2       %s\n",
-			comment);
-		}
-	else if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind != MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"dbg2       time_i[0]:     %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:     %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:     %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:     %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:     %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:     %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:     %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:        %f\n",*time_d);
-		fprintf(stderr,"dbg2       longitude:     %f\n",*navlon);
-		fprintf(stderr,"dbg2       latitude:      %f\n",*navlat);
-		fprintf(stderr,"dbg2       speed:         %f\n",*speed);
-		fprintf(stderr,"dbg2       heading:       %f\n",*heading);
-		}
-	if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind == MB_DATA_DATA)
-		{
-		fprintf(stderr,"dbg2       nbath:      %d\n",
-			*nbath);
-		for (i=0;i<*nbath;i++)
-		  fprintf(stderr,"dbg2       beam:%d  flag:%3d  bath:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,beamflag[i],bath[i],
-			bathacrosstrack[i],bathalongtrack[i]);
-		fprintf(stderr,"dbg2        namp:     %d\n",
-			*namp);
-		for (i=0;i<*namp;i++)
-		  fprintf(stderr,"dbg2       beam:%d   amp:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,amp[i],bathacrosstrack[i],bathalongtrack[i]);
-		fprintf(stderr,"dbg2        nss:      %d\n",
-			*nss);
-		for (i=0;i<*nss;i++)
-		  fprintf(stderr,"dbg2        pixel:%d   ss:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,ss[i],ssacrosstrack[i],ssalongtrack[i]);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_reson7k_insert(int verbose, void *mbio_ptr, void *store_ptr,
-		int kind, int time_i[7], double time_d,
-		double navlon, double navlat,
-		double speed, double heading,
-		int nbath, int namp, int nss,
-		char *beamflag, double *bath, double *amp,
-		double *bathacrosstrack, double *bathalongtrack,
-		double *ss, double *ssacrosstrack, double *ssalongtrack,
-		char *comment, int *error)
-{
-	char	*function_name = "mbsys_reson7k_insert";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_reson7k_struct *store;
-	s7kr_bluefin *bluefin;
-	s7kr_processedsidescan *processedsidescan;
-	s7kr_volatilesettings *volatilesettings;
-	s7kr_bathymetry *bathymetry;
-	s7kr_backscatter *backscatter;
-	s7kr_beam *beam;
-	s7kr_position *position;
-	s7kr_systemeventmessage *systemeventmessage;
-	s7kr_fsdwsb *fsdwsb;
-	s7kr_fsdwss *fsdwsslo;
-	s7kr_fsdwss *fsdwsshi;
-	s7k_fsdwsegyheader *fsdwsegyheader;
-	s7k_fsdwssheader *fsdwssheader;
-	int	msglen;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       kind:       %d\n",kind);
-		}
-	if (verbose >= 2 && (kind == MB_DATA_DATA || kind == MB_DATA_NAV1 || kind == MB_DATA_NAV2))
-		{
-		fprintf(stderr,"dbg2       time_i[0]:  %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:  %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:  %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:  %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:  %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:  %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:  %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:     %f\n",time_d);
-		fprintf(stderr,"dbg2       navlon:     %f\n",navlon);
-		fprintf(stderr,"dbg2       navlat:     %f\n",navlat);
-		fprintf(stderr,"dbg2       speed:      %f\n",speed);
-		fprintf(stderr,"dbg2       heading:    %f\n",heading);
-		}
-	if (verbose >= 2 && kind == MB_DATA_DATA)
-		{
-		fprintf(stderr,"dbg2       nbath:      %d\n",nbath);
-		if (verbose >= 3)
-		 for (i=0;i<nbath;i++)
-		  fprintf(stderr,"dbg3       beam:%d  flag:%3d  bath:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,beamflag[i],bath[i],
-			bathacrosstrack[i],bathalongtrack[i]);
-		fprintf(stderr,"dbg2       namp:       %d\n",namp);
-		if (verbose >= 3)
-		 for (i=0;i<namp;i++)
-		  fprintf(stderr,"dbg3        beam:%d   amp:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,amp[i],bathacrosstrack[i],bathalongtrack[i]);
-		fprintf(stderr,"dbg2        nss:       %d\n",nss);
-		if (verbose >= 3)
-		 for (i=0;i<nss;i++)
-		  fprintf(stderr,"dbg3        beam:%d   ss:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,ss[i],ssacrosstrack[i],ssalongtrack[i]);
-		}
-	if (verbose >= 2 && kind == MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"dbg2       comment:     \ndbg2       %s\n",
-			comment);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	bluefin = (s7kr_bluefin *) &store->bluefin;
-	volatilesettings = (s7kr_volatilesettings *) &store->volatilesettings;
-	bathymetry = (s7kr_bathymetry *) &store->bathymetry;
-	backscatter = (s7kr_backscatter *) &store->backscatter;
-	beam = (s7kr_beam *) &store->beam;
-	processedsidescan = (s7kr_processedsidescan *) &store->processedsidescan;
-	position = (s7kr_position *) &store->position;
-	systemeventmessage = (s7kr_systemeventmessage *) &store->systemeventmessage;
-	fsdwsb = &(store->fsdwsb);
-	fsdwsslo = &(store->fsdwsslo);
-	fsdwsshi = &(store->fsdwsshi);
-
-	/* set data kind */
-	store->kind = kind;
-
-	/* insert data in structure */
-	if (store->kind == MB_DATA_DATA)
-		{
-		/* get time */
-		for (i=0;i<7;i++)
-			store->time_i[i] = time_i[i];
-		store->time_d = time_d;
-
-		/* get navigation */
-		bathymetry->longitude = DTR * navlon;
-		bathymetry->latitude = DTR * navlat;
-
-		/* get heading */
-		bathymetry->heading = DTR * heading;
-
-		/* get speed  */
-
-		/* read distance and depth values into storage arrays */
-		bathymetry->number_beams = nbath;
-		for (i=0;i<bathymetry->number_beams;i++)
-			{
-			bathymetry->depth[i] = bath[i];
-			if (beamflag[i] == MB_FLAG_NULL)
-				bathymetry->quality[i] = 0;
-			else if (mb_beam_check_flag_manual(beamflag[i]))
-				bathymetry->quality[i] = (bathymetry->quality[i] & 63) + 128;
-			else if (mb_beam_check_flag(beamflag[i]))
-				bathymetry->quality[i] = (bathymetry->quality[i] & 63) + 64;
-			else
-				{
-				bathymetry->quality[i] = (bathymetry->quality[i] & 63);
-				if (!(bathymetry->quality[i] & 12))
-					bathymetry->quality[i] = bathymetry->quality[i] | 16;
-				else if (bathymetry->quality[i] & 4)
-					bathymetry->quality[i] = bathymetry->quality[i] | 16;
-				else if (bathymetry->quality[i] & 8)
-					bathymetry->quality[i] = bathymetry->quality[i] | 32;
-				}
-			bathymetry->acrosstrack[i] = bathacrosstrack[i];
-			bathymetry->alongtrack[i] = bathalongtrack[i];
-			bathymetry->intensity[i] = (float)(pow(10.0, (amp[i] / 20.0)));
-#ifdef MSYS_RESON7KR_DEBUG
-fprintf(stderr,"INSERT: beam:%d quality:%d q&240:%d ",i,bathymetry->quality[i],bathymetry->quality[i] & 240);
-if (bathymetry->quality[i] & 1) fprintf(stderr,"1"); else fprintf(stderr,"0");
-if (bathymetry->quality[i] & 2) fprintf(stderr,"1"); else fprintf(stderr,"0");
-if (bathymetry->quality[i] & 4) fprintf(stderr,"1"); else fprintf(stderr,"0");
-if (bathymetry->quality[i] & 8) fprintf(stderr,"1"); else fprintf(stderr,"0");
-if (bathymetry->quality[i] & 16) fprintf(stderr,"1"); else fprintf(stderr,"0");
-if (bathymetry->quality[i] & 32) fprintf(stderr,"1"); else fprintf(stderr,"0");
-if (bathymetry->quality[i] & 64) fprintf(stderr,"1"); else fprintf(stderr,"0");
-if (bathymetry->quality[i] & 128) fprintf(stderr,"1"); else fprintf(stderr,"0");
-fprintf(stderr," flag:%d\n",beamflag[i]);
-#endif
-			}
-
-		/* insert the sidescan */
-		processedsidescan->number_pixels = nss;
-		for (i=0;i<processedsidescan->number_pixels;i++)
-			{
-			processedsidescan->sidescan[i] = ss[i];
-			processedsidescan->alongtrack[i] = processedsidescan->alongtrack[i];
-			}
-		for (i=processedsidescan->number_pixels;i<MBSYS_RESON7K_MAX_PIXELS;i++)
-			{
-			processedsidescan->sidescan[i] = 0.0;
-			processedsidescan->alongtrack[i] = 0.0;
-			}
-		}
-
-	/* insert data in nav structure */
-	else if (store->kind == MB_DATA_NAV1)
-		{
-		/* get time */
-		for (i=0;i<7;i++)
-			store->time_i[i] = time_i[i];
-		store->time_d = time_d;
-
-		/* get navigation */
-		position->longitude = DTR * navlon;
-		position->latitude = DTR * navlat;
-
-		/* get heading */
-
-		/* get speed  */
-		}
-
-	/* insert data in nav structure */
-	else if (store->kind == MB_DATA_NAV2)
-		{
-		/* get time */
-		for (i=0;i<7;i++)
-			store->time_i[i] = time_i[i];
-		store->time_d = time_d;
-
-		/* get navigation */
-		bluefin->nav[0].longitude = DTR * navlon;
-		bluefin->nav[0].latitude = DTR * navlat;
-
-		/* get heading */
-		bluefin->nav[0].yaw = DTR * heading;
-
-		/* get speed  */
-		}
-
-	/* insert data in subbottom structure */
-	else if (store->kind == MB_DATA_SUBBOTTOM_SUBBOTTOM)
-		{
-		/* get edgetech segy header */
-		fsdwsegyheader = &(fsdwsb->segyheader);
-
-		/* get time */
-		for (i=0;i<7;i++)
-			store->time_i[i] = time_i[i];
-		store->time_d = time_d;
-
-		/* get navigation */
-		fsdwsegyheader->sourceCoordX = (int)(navlon * 360000.0);
-		fsdwsegyheader->sourceCoordY = (int)(navlat * 360000.0);
-
-		/* get heading */
-		fsdwsegyheader->heading = (int)(100 * heading);
-
-		/* get speed  */
-		}
-
-	/* insert data in sidescan structure */
-	else if (store->kind == MB_DATA_SIDESCAN2
-		|| store->kind == MB_DATA_SIDESCAN3)
-		{
-		/* get edgetech sidescan header */
-		if (store->kind == MB_DATA_SIDESCAN2)
-			fsdwssheader = &(fsdwsslo->ssheader[0]);
-		else if (store->kind == MB_DATA_SIDESCAN3)
-			fsdwssheader = &(fsdwsshi->ssheader[0]);
-
-		/* get time */
-		for (i=0;i<7;i++)
-			store->time_i[i] = time_i[i];
-		store->time_d = time_d;
-
-		/* get navigation */
-		fsdwssheader->longitude = (int)(navlon * 360000.0);
-		fsdwssheader->latitude = (int)(navlat * 360000.0);
-
-		/* get heading */
-		fsdwssheader->heading = (int)(100 * heading);
-
-		/* get speed  */
-		}
-
-	/* insert comment in structure */
-	else if (store->kind == MB_DATA_COMMENT)
-		{
-		/* make sure memory is allocated for comment */
-		msglen = MIN(strlen(comment) +  1, MB_COMMENT_MAXLINE);
-		if (msglen % 2 > 0)
-			msglen++;
-		if (systemeventmessage->message_alloc < msglen)
-			{
-			status = mb_reallocd(verbose, __FILE__, __LINE__, msglen,
-						(void **)&(systemeventmessage->message), error);
-			if (status != MB_SUCCESS)
-				{
-				systemeventmessage->message_alloc = 0;
-				systemeventmessage->message = NULL;
-				}
-			else
-				{
-				systemeventmessage->message_alloc = msglen;
-				}
-			}
-
-		/* copy comment */
-		if (status == MB_SUCCESS)
-			{
-/*fprintf(stderr,"INSERTING COMMENT: %s\n",comment);
-fprintf(stderr,"INSERTING COMMENT: msglen:%d message_alloc:%d status:%d error:%d\n",
-msglen,systemeventmessage->message_alloc,status,*error);*/
-			store->type = R7KRECID_7kSystemEventMessage;
-			systemeventmessage->serial_number = 0;
-			systemeventmessage->event_id = 1;
-			systemeventmessage->message_length = msglen;
-			systemeventmessage->event_identifier = 0;
-			strncpy(systemeventmessage->message, comment, msglen);
-			systemeventmessage->header.Size = MBSYS_RESON7K_RECORDHEADER_SIZE
-							+ R7KHDRSIZE_7kSystemEventMessage
-							+ msglen
-							+ MBSYS_RESON7K_RECORDTAIL_SIZE;
-			systemeventmessage->header.OffsetToOptionalData = 0;
-			systemeventmessage->header.OptionalDataIdentifier = 0;
-			systemeventmessage->header.Reserved = 0;
-			systemeventmessage->header.RecordType = R7KRECID_7kSystemEventMessage;
-			systemeventmessage->header.DeviceId = 0;
-			systemeventmessage->header.SystemEnumerator = 0;
-			systemeventmessage->header.DataSetNumber = 0;
-			systemeventmessage->header.RecordNumber = 0;
-			for (i=0;i<8;i++)
-				{
-				systemeventmessage->header.PreviousRecord[i] = -1;
-				systemeventmessage->header.NextRecord[i] = -1;
-				}
-			systemeventmessage->header.Flags = 0;
-			systemeventmessage->header.Reserved2 = 0;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_reson7k_ttimes(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, int *nbeams,
-	double *ttimes, double *angles,
-	double *angles_forward, double *angles_null,
-	double *heave, double *alongtrack_offset,
-	double *draft, double *ssv, int *error)
-{
-	char	*function_name = "mbsys_reson7k_ttimes";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_reson7k_struct *store;
-	s7kr_bathymetry *bathymetry;
-	s7kr_depth *depth;
-	s7kr_beamgeometry *beamgeometry;
-	s7kr_attitude *attitude;
-	s7kr_ctd *ctd;
-	s7kr_reference *reference;
-	double	heave_use, roll, pitch;
-	double	alpha, beta, theta, phi;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       ttimes:     %p\n",(void *)ttimes);
-		fprintf(stderr,"dbg2       angles_xtrk:%p\n",(void *)angles);
-		fprintf(stderr,"dbg2       angles_ltrk:%p\n",(void *)angles_forward);
-		fprintf(stderr,"dbg2       angles_null:%p\n",(void *)angles_null);
-		fprintf(stderr,"dbg2       heave:      %p\n",(void *)heave);
-		fprintf(stderr,"dbg2       ltrk_off:   %p\n",(void *)alongtrack_offset);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	bathymetry = (s7kr_bathymetry *) &store->bathymetry;
-	depth = (s7kr_depth *) &store->depth;
-	attitude = (s7kr_attitude *) &store->attitude;
-	ctd = (s7kr_ctd *) &store->ctd;
-	beamgeometry = (s7kr_beamgeometry *) &store->beamgeometry;
-	reference = (s7kr_reference *) &store->reference;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get depth offset (heave + sonar depth) */
-		if (bathymetry->sound_velocity > 0.0)
-			*ssv = bathymetry->sound_velocity;
-		else if (ctd != NULL && ctd->n > 0)
-			*ssv = ctd->sound_velocity[0];
-		else
-			*ssv = 1500.0;
-
-		/* get attitude data */
-		if (bathymetry->optionaldata == MB_YES)
-			{
-			heave_use = bathymetry->heave;
-			}
-		else if (mb_io_ptr->nattitude > 0)
-			{
-			mb_attint_interp(verbose, mbio_ptr, store->time_d,
-				   	&heave_use, &roll, &pitch, error);
-			}
-
-		/* get draft */
-		if (bathymetry->optionaldata == MB_YES)
-			{
-			*draft = -bathymetry->vehicle_height + reference->water_z;
-			heave_use = 0.0;
-			}
-		else if (mb_io_ptr->nsonardepth > 0)
-			{
-			mb_depint_interp(verbose, mbio_ptr, store->time_d,
-				    draft, error);
-			heave_use = 0.0;
-			}
-		else
-			{
-			*draft = reference->water_z;
-			}
-
-		/* get travel times, angles */
-		*nbeams = bathymetry->number_beams;
-		for (i=0;i<bathymetry->number_beams;i++)
-			{
-			ttimes[i] = bathymetry->range[i];
-			if (bathymetry->optionaldata == MB_YES)
-				{
-				angles[i] = RTD * bathymetry->pointing_angle[i];
-				angles_forward[i] = RTD * bathymetry->azimuth_angle[i];
-				}
-			else
-				{
-				alpha = RTD * beamgeometry->angle_alongtrack[i] + bathymetry->pitch;
-				beta = 90.0 - RTD * beamgeometry->angle_acrosstrack[i] + bathymetry->roll;
-				mb_rollpitch_to_takeoff(
-					verbose,
-					alpha, beta,
-					&theta, &phi,
-					error);
-				angles[i] = theta;
-				angles_forward[i] = phi;
-				}
-			if (bathymetry->header.DeviceId == 7100)
-				angles_null[i] = angles[i];
-			else
-				angles_null[i] = 0.0;
-			heave[i] = heave_use;
-			alongtrack_offset[i] = 0.0;
-			}
-
-		/* set status */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error == MB_ERROR_NO_ERROR)
-		{
-		fprintf(stderr,"dbg2       draft:      %f\n",*draft);
-		fprintf(stderr,"dbg2       ssv:        %f\n",*ssv);
-		fprintf(stderr,"dbg2       nbeams:     %d\n",*nbeams);
-		for (i=0;i<*nbeams;i++)
-			fprintf(stderr,"dbg2       beam %d: tt:%f  angle_xtrk:%f  angle_ltrk:%f  angle_null:%f  depth_off:%f  ltrk_off:%f\n",
-				i,ttimes[i],angles[i],
-				angles_forward[i],angles_null[i],
-				heave[i],alongtrack_offset[i]);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_reson7k_detects(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, int *nbeams, int *detects, int *error)
-{
-	char	*function_name = "mbsys_reson7k_detects";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_reson7k_struct *store;
-	s7kr_bathymetry *bathymetry;
-	mb_u_char	detect;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       detects:    %p\n",(void *)detects);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	bathymetry = (s7kr_bathymetry *) &store->bathymetry;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* read distance and depth values into storage arrays */
-		*nbeams = bathymetry->number_beams;
-		for (i=0;i<*nbeams;i++)
-			{
-			detect = (bathymetry->quality[i] & 48) >> 4;
-			if (detect == 0)
-				detects[i] = MB_DETECT_UNKNOWN;
-			else if (detect == 1)
-				detects[i] = MB_DETECT_AMPLITUDE;
-			else if (detect == 2)
-				detects[i] = MB_DETECT_PHASE;
-			else
-				detects[i] = MB_DETECT_UNKNOWN;
-			}
-
-		/* set status */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error == MB_ERROR_NO_ERROR)
-		{
-		fprintf(stderr,"dbg2       nbeams:     %d\n",*nbeams);
-		for (i=0;i<*nbeams;i++)
-			fprintf(stderr,"dbg2       beam %d: detects:%d\n",
-				i,detects[i]);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_reson7k_gains(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, double *transmit_gain, double *pulse_length,
-			double *receive_gain, int *error)
-{
-	char	*function_name = "mbsys_reson7k_gains";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_reson7k_struct *store;
-	s7k_header *header;
-	s7kr_volatilesettings *volatilesettings;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get survey data structure */
-		volatilesettings = &(store->volatilesettings);
-		header = &(volatilesettings->header);
-
-		/* get transmit_gain (dB) */
-		*transmit_gain = (double)volatilesettings->power_selection;
-
-		/* get pulse_length (usec) */
-		*pulse_length = (double)volatilesettings->pulse_width;
-
-		/* get receive_gain (dB) */
-		*receive_gain = (double)volatilesettings->gain_selection;
-
-		/* set status */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error == MB_ERROR_NO_ERROR)
-		{
-		fprintf(stderr,"dbg2       transmit_gain: %f\n",*transmit_gain);
-		fprintf(stderr,"dbg2       pulse_length:  %f\n",*pulse_length);
-		fprintf(stderr,"dbg2       receive_gain:  %f\n",*receive_gain);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_reson7k_extract_altitude(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, double *transducer_depth, double *altitudev,
-	int *error)
-{
-	char	*function_name = "mbsys_reson7k_extract_altitude";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_reson7k_struct *store;
-	s7kr_bathymetry *bathymetry;
-	s7kr_depth *depth;
-	s7kr_altitude *altitude;
-	s7kr_attitude *attitude;
-	s7kr_reference *reference;
-	double	heave, roll, pitch;
-	double	xtrackmin;
-	int	altitude_found;
-	char	flag;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	bathymetry = (s7kr_bathymetry *) &store->bathymetry;
-	depth = (s7kr_depth *) &store->depth;
-	attitude = (s7kr_attitude *) &store->attitude;
-	altitude = (s7kr_altitude *) &store->altitude;
-	reference = (s7kr_reference *) &store->reference;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get transducer depth and altitude */
-		if (bathymetry->optionaldata == MB_YES)
-			{
-			*transducer_depth = -bathymetry->vehicle_height + reference->water_z;
-			}
-		else if (mb_io_ptr->nsonardepth > 0)
-			{
-			mb_depint_interp(verbose, mbio_ptr, store->time_d,
-				    transducer_depth, error);
-			}
-		else if (mb_io_ptr->nattitude > 0)
-			{
-			*transducer_depth = reference->water_z;
-			mb_attint_interp(verbose, mbio_ptr, store->time_d,
-				    &heave, &roll, &pitch, error);
-			*transducer_depth += heave;
-			}
-		else
-			{
-			*transducer_depth = reference->water_z;
-			}
-
-		/* get altitude */
-		altitude_found = MB_NO;
-		if (mb_io_ptr->naltitude > 0)
-			{
-			mb_altint_interp(verbose, mbio_ptr, store->time_d,
-				    altitudev, error);
-			altitude_found = MB_YES;
-			}
-		if (altitude_found == MB_NO
-			&& bathymetry->optionaldata == MB_YES)
-			{
-			/* get depth closest to nadir */
-			xtrackmin = 999999.9;
-			for (i=0;i<bathymetry->number_beams;i++)
-				{
-				if (bathymetry->quality[i] == 0)
-					{
-					flag = MB_FLAG_NULL;
-					}
-				else if (bathymetry->quality[i] & 64)
-					{
-					flag = MB_FLAG_FLAG + MB_FLAG_FILTER;
-					}
-				else if (bathymetry->quality[i] & 128)
-					{
-					flag = MB_FLAG_FLAG + MB_FLAG_MANUAL;
-					}
-				else if (bathymetry->quality[i] & 240)
-					{
-					flag = MB_FLAG_NONE;
-					}
-				else if ((bathymetry->quality[i] & 3) == 3)
-					{
-					flag = MB_FLAG_NONE;
-					}
-				else if ((bathymetry->quality[i] & 15) == 0)
-					{
-					flag = MB_FLAG_NULL;
-					}
-				else if ((bathymetry->quality[i] & 3) == 0)
-					{
-					flag = MB_FLAG_FLAG + MB_FLAG_FILTER;
-					}
-				else
-					{
-					flag = MB_FLAG_FLAG + MB_FLAG_MANUAL;
-					}
-
-				if ((flag == MB_FLAG_NONE)
-					&& fabs((double)bathymetry->acrosstrack[i]) < xtrackmin)
-					{
-					*altitudev = bathymetry->depth[i] - *transducer_depth;
-					altitude_found = MB_YES;
-					xtrackmin = fabs((double)bathymetry->acrosstrack[i]);
-					}
-				}
-			}
-		if (altitude_found == MB_NO
-			&& altitude->altitude > 0.0)
-			{
-			*altitudev = altitude->altitude;
-			}
-		else if (altitude_found == MB_NO)
-			{
-			*altitudev = 0.0;
-			}
-
-		/* set status */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:              %d\n",*kind);
-		fprintf(stderr,"dbg2       transducer_depth:  %f\n",*transducer_depth);
-		fprintf(stderr,"dbg2       altitude:          %f\n",*altitudev);
-		fprintf(stderr,"dbg2       error:             %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:            %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_reson7k_extract_nav(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int time_i[7], double *time_d,
-		double *navlon, double *navlat,
-		double *speed, double *heading, double *draft,
-		double *roll, double *pitch, double *heave,
-		int *error)
-{
-	char	*function_name = "mbsys_reson7k_extract_nav";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_reson7k_struct *store;
-	s7kr_bathymetry *bathymetry;
-	s7kr_bluefin *bluefin;
-	s7kr_position *position;
-	s7kr_depth *depth;
-	s7kr_attitude *attitude;
-	s7kr_reference *reference;
-	s7kr_navigation *navigation;
-	s7kr_fsdwsb *fsdwsb;
-	s7kr_fsdwss *fsdwsslo;
-	s7kr_fsdwss *fsdwsshi;
-	s7k_fsdwsegyheader *fsdwsegyheader;
-	s7k_fsdwssheader *fsdwssheader;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	bathymetry = (s7kr_bathymetry *) &store->bathymetry;
-	bluefin = (s7kr_bluefin *) &store->bluefin;
-	position = (s7kr_position *) &store->position;
-	depth = (s7kr_depth *) &store->depth;
-	attitude = (s7kr_attitude *) &store->attitude;
-	reference = (s7kr_reference *) &store->reference;
-	navigation = &(store->navigation);
-	fsdwsb = &(store->fsdwsb);
-	fsdwsslo = &(store->fsdwsslo);
-	fsdwsshi = &(store->fsdwsshi);
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from ping structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get time */
-		for (i=0;i<7;i++)
-			time_i[i] = store->time_i[i];
-		*time_d = store->time_d;
-
-		/* get interpolated nav heading and speed  */
-		*speed = 0.0;
-		if (mb_io_ptr->nheading > 0)
-			mb_hedint_interp(verbose, mbio_ptr, store->time_d,
-				    heading, error);
-		if (mb_io_ptr->nfix > 0)
-			mb_navint_interp(verbose, mbio_ptr, store->time_d, *heading, *speed,
-				    navlon, navlat, speed, error);
-
-		/* get heading */
-		if (bathymetry->optionaldata == MB_YES)
-			*heading = RTD * bathymetry->heading;
-
-		/* get navigation */
-		if (bathymetry->optionaldata == MB_YES)
-			{
-			*navlon = RTD * bathymetry->longitude;
-			*navlat = RTD * bathymetry->latitude;
-			}
-
-		/* get draft  */
-		if (bathymetry->optionaldata == MB_YES)
-			{
-			*draft = -bathymetry->vehicle_height + reference->water_z;
-			}
-		else if (mb_io_ptr->nsonardepth > 0)
-			{
-			mb_depint_interp(verbose, mbio_ptr, store->time_d, draft, error);
-			}
-		else
-			{
-			*draft = reference->water_z;
-			}
-
-		/* get attitude  */
-		if (bathymetry->optionaldata == MB_YES)
-			{
-			*roll = RTD * bathymetry->roll;
-			*pitch = RTD * bathymetry->pitch;
-			*heave = bathymetry->heave;
-			}
-		else
-			{
-			if (mb_io_ptr->nattitude > 0)
-				{
-				mb_attint_interp(verbose, mbio_ptr, store->time_d,
-				   	heave, roll, pitch, error);
-				}
-			}
-
-		/* done translating values */
-
-		}
-
-	/* extract data from nav structure */
-	else if (*kind == MB_DATA_NAV1)
-		{
-		/* get position data structure */
-		position = (s7kr_position *) &store->position;
-
-		/* get time */
-		for (i=0;i<7;i++)
-			time_i[i] = store->time_i[i];
-		*time_d = store->time_d;
-
-		/* get navigation and heading */
-		*speed = 0.0;
-		if (mb_io_ptr->nheading > 0)
-			mb_hedint_interp(verbose, mbio_ptr, store->time_d,
-				    heading, error);
-		if (mb_io_ptr->nfix > 0)
-			mb_navint_interp(verbose, mbio_ptr, store->time_d, *heading, *speed,
-				    navlon, navlat, speed, error);
-		*navlon = RTD * position->longitude;
-		*navlat = RTD * position->latitude;
-
-		/* get roll pitch and heave */
-		if (mb_io_ptr->nattitude > 0)
-			{
-			mb_attint_interp(verbose, mbio_ptr, *time_d,
-				    heave, roll, pitch, error);
-			}
-
-		/* get draft  */
-		if (mb_io_ptr->nsonardepth > 0)
-			{
-			if (mb_io_ptr->nsonardepth > 0)
-				mb_depint_interp(verbose, mbio_ptr, store->time_d,
-				    draft, error);
-			*heave = 0.0;
-			}
-		else if (bathymetry->optionaldata == MB_YES)
-			{
-			*draft = -bathymetry->vehicle_height + reference->water_z;
-			*heave = 0.0;
-			}
-		else
-			{
-			*draft = reference->water_z;
-			}
-
-		/* done translating values */
-
-		}
-
-	/* extract data from structure */
-	else if (*kind == MB_DATA_NAV2)
-		{
-		/* get time */
-		for (i=0;i<7;i++)
-			time_i[i] = store->time_i[i];
-		*time_d = store->time_d;
-
-		/* get heading */
-		*heading = RTD * bluefin->nav[0].yaw;
-
-		/* get speed */
-		*speed = 0.0;
-		if (mb_io_ptr->nfix > 0)
-			mb_navint_interp(verbose, mbio_ptr, store->time_d, *heading, *speed,
-				    navlon, navlat, speed, error);
-
-		/* get navigation */
-		*navlon = RTD * bluefin->nav[0].longitude;
-		*navlat = RTD * bluefin->nav[0].latitude;
-
-		/* get roll pitch and heave */
-		*roll = RTD * bluefin->nav[0].roll;
-		*pitch = RTD * bluefin->nav[0].pitch;
-		*heave = 0.0;
-
-		/* get draft  */
-		*draft = bluefin->nav[0].depth;
-
-		/* done translating values */
-
-		}
-
-	/* extract data from structure */
-	else if (*kind == MB_DATA_NAV3)
-		{
-		/* get time */
-		for (i=0;i<7;i++)
-			time_i[i] = store->time_i[i];
-		time_d[0] = store->time_d;
-
-		/* get navigation */
-		navlon[0] = RTD * navigation->longitude;
-		navlat[0] = RTD * navigation->latitude;
-
-		/* get speed  */
-		speed[0] = 0.0;
-
-		/* get heading */
-		if (mb_io_ptr->nheading > 0)
-			mb_hedint_interp(verbose, mbio_ptr, store->time_d,
-				    heading, error);
-		else if (bathymetry->optionaldata == MB_YES)
-			heading[0] = RTD * bathymetry->heading;
-
-		/* get draft  */
-		if (mb_io_ptr->nsonardepth > 0)
-			{
-			mb_depint_interp(verbose, mbio_ptr, store->time_d,
-				    &(draft[0]), error);
-			}
-		else if (bathymetry->optionaldata == MB_YES)
-			{
-			draft[0] = -bathymetry->vehicle_height + reference->water_z;
-			}
-		else
-			{
-			draft[0] = reference->water_z;
-			}
-
-		/* get attitude  */
-		if (mb_io_ptr->nattitude > 0)
-			{
-			mb_attint_interp(verbose, mbio_ptr, store->time_d,
-				   	&(heave[0]), &(roll[0]), &(pitch[0]), error);
-			}
-		else if (bathymetry->optionaldata == MB_YES)
-			{
-			roll[0] = RTD * bathymetry->roll;
-			pitch[0] = RTD * bathymetry->pitch;
-			heave[0] = bathymetry->heave;
-			}
-		else
-			{
-			roll[0] = 0.0;
-			pitch[0] = 0.0;
-			heave[0] = 0.0;
-			}
-
-		/* done translating values */
-
-		}
-
-	/* extract data from structure */
-	else if (*kind == MB_DATA_SUBBOTTOM_SUBBOTTOM)
-		{
-		/* get edgetech segy header */
-		fsdwsegyheader = &(fsdwsb->segyheader);
-
-		/* get time */
-		for (i=0;i<7;i++)
-			time_i[i] = store->time_i[i];
-		*time_d = store->time_d;
-
-		/* get heading */
-		if (fsdwsegyheader->heading != 0)
-			*heading = 0.01 * fsdwsegyheader->heading;
-		else
-			mb_hedint_interp(verbose, mbio_ptr, store->time_d,
-					    heading, error);
-
-		/* get speed and position */
-		*speed = 0.0;
-		if (mb_io_ptr->nfix > 0)
-			mb_navint_interp(verbose, mbio_ptr, store->time_d, *heading, *speed,
-				    navlon, navlat, speed, error);
-
-		/* get position */
-		if (fsdwsegyheader->sourceCoordX != 0
-			|| fsdwsegyheader->sourceCoordY != 0)
-			{
-			*navlon = ((double)fsdwsegyheader->sourceCoordX) / 360000.0;
-			*navlat = ((double)fsdwsegyheader->sourceCoordY) / 360000.0;
-			}
-
-		/* get roll pitch and heave */
-		*roll = 0.01 * fsdwsegyheader->roll;
-		*pitch = 0.01 * fsdwsegyheader->pitch;
-		*heave = 0.0;
-
-		if (mb_io_ptr->nattitude > 0)
-			{
-			mb_attint_interp(verbose, mbio_ptr, store->time_d,
-				    heave, roll, pitch, error);
-			}
-
-		/* get draft  */
-		*draft = reference->water_z;
-
-		/* done translating values */
-
-		}
-
-	/* extract data from sidescan structure */
-	else if (*kind == MB_DATA_SIDESCAN2
-		|| *kind == MB_DATA_SIDESCAN3)
-		{
-		/* get edgetech sidescan header */
-		if (*kind == MB_DATA_SIDESCAN2)
-			fsdwssheader = &(fsdwsslo->ssheader[0]);
-		else if (*kind == MB_DATA_SIDESCAN3)
-			fsdwssheader = &(fsdwsshi->ssheader[0]);
-
-		/* get time */
-		for (i=0;i<7;i++)
-			time_i[i] = store->time_i[i];
-		*time_d = store->time_d;
-
-		/* get heading */
-		if (fsdwssheader->heading != 0)
-			*heading = 0.01 * fsdwssheader->heading;
-		else
-			if (mb_io_ptr->nheading > 0)
-				mb_hedint_interp(verbose, mbio_ptr, store->time_d,
-					    heading, error);
-
-		/* get speed and position */
-		*speed = 0.0;
-		if (mb_io_ptr->nfix > 0)
-			mb_navint_interp(verbose, mbio_ptr, store->time_d, *heading, *speed,
-				    navlon, navlat, speed, error);
-
-		/* get position */
-		if (fsdwssheader->longitude != 0
-			|| fsdwssheader->latitude != 0)
-			{
-			*navlon = ((double)fsdwssheader->longitude)/ 360000.0;
-			*navlat = ((double)fsdwssheader->latitude)/ 360000.0;
-			}
-
-		/* print debug statements */
-		if (verbose >= 5)
-			{
-			fprintf(stderr,"\ndbg4  Data extracted by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  Extracted values:\n");
-			fprintf(stderr,"dbg4       kind:       %d\n",
-				*kind);
-			fprintf(stderr,"dbg4       error:      %d\n",
-				*error);
-			fprintf(stderr,"dbg4       time_i[0]:  %d\n",
-				time_i[0]);
-			fprintf(stderr,"dbg4       time_i[1]:  %d\n",
-				time_i[1]);
-			fprintf(stderr,"dbg4       time_i[2]:  %d\n",
-				time_i[2]);
-			fprintf(stderr,"dbg4       time_i[3]:  %d\n",
-				time_i[3]);
-			fprintf(stderr,"dbg4       time_i[4]:  %d\n",
-				time_i[4]);
-			fprintf(stderr,"dbg4       time_i[5]:  %d\n",
-				time_i[5]);
-			fprintf(stderr,"dbg4       time_i[6]:  %d\n",
-				time_i[6]);
-			fprintf(stderr,"dbg4       time_d:     %f\n",
-				*time_d);
-			fprintf(stderr,"dbg4       longitude:  %f\n",
-				*navlon);
-			fprintf(stderr,"dbg4       latitude:   %f\n",
-				*navlat);
-			fprintf(stderr,"dbg4       speed:      %f\n",
-				*speed);
-			fprintf(stderr,"dbg4       heading:    %f\n",
-				*heading);
-			}
-
-		/* done translating values */
-
-		}
-
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-
-		/* get time */
-		for (i=0;i<7;i++)
-			time_i[i] = store->time_i[i];
-		*time_d = store->time_d;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-
-		/* get time */
-		for (i=0;i<7;i++)
-			time_i[i] = store->time_i[i];
-		*time_d = store->time_d;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:          %d\n",*kind);
-		fprintf(stderr,"dbg2       time_i[0]:     %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:     %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:     %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:     %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:     %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:     %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:     %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:        %f\n",*time_d);
-		fprintf(stderr,"dbg2       longitude:     %f\n",*navlon);
-		fprintf(stderr,"dbg2       latitude:      %f\n",*navlat);
-		fprintf(stderr,"dbg2       speed:         %f\n",*speed);
-		fprintf(stderr,"dbg2       heading:       %f\n",*heading);
-		fprintf(stderr,"dbg2       draft:         %f\n",*draft);
-		fprintf(stderr,"dbg2       roll:          %f\n",*roll);
-		fprintf(stderr,"dbg2       pitch:         %f\n",*pitch);
-		fprintf(stderr,"dbg2       heave:         %f\n",*heave);
-		fprintf(stderr,"dbg2       error:         %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:        %d\n",status);
-		}
-/*if (status == MB_SUCCESS)
-fprintf(stderr,"%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d %f %f %f %f %f %f %f %f\n",
-time_i[0],time_i[1],time_i[2],time_i[3],time_i[4],time_i[5],time_i[6],
-*navlon,*navlat,*speed,*heading,*draft,*roll,*pitch,*heave);*/
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_reson7k_extract_nnav(int verbose, void *mbio_ptr, void *store_ptr,
-			int nmax, int *kind, int *n,
-			int *time_i, double *time_d,
-			double *navlon, double *navlat,
-			double *speed, double *heading, double *draft,
-			double *roll, double *pitch, double *heave,
-			int *error)
-{
-	char	*function_name = "mbsys_reson7k_extract_nnav";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_reson7k_struct *store;
-	s7kr_bathymetry *bathymetry;
-	s7kr_bluefin *bluefin;
-	s7kr_position *position;
-	s7kr_depth *depth;
-	s7kr_attitude *attitude;
-	s7kr_reference *reference;
-	s7kr_navigation *navigation;
-	int	i, inav;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       nmax:       %d\n",nmax);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	bathymetry = (s7kr_bathymetry *) &store->bathymetry;
-	bluefin = (s7kr_bluefin *) &store->bluefin;
-	position = (s7kr_position *) &store->position;
-	depth = (s7kr_depth *) &store->depth;
-	attitude = (s7kr_attitude *) &store->attitude;
-	reference = (s7kr_reference *) &store->reference;
-	navigation = &(store->navigation);
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from ping structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* just one navigation value */
-		*n = 1;
-
-		/* get time */
-		for (i=0;i<7;i++)
-			time_i[i] = store->time_i[i];
-		time_d[0] = store->time_d;
-
-		/* get interpolated nav heading and speed  */
-		speed[0] = 0.0;
-		mb_hedint_interp(verbose, mbio_ptr, store->time_d,
-				    &(heading[0]), error);
-		mb_navint_interp(verbose, mbio_ptr, store->time_d, heading[0], speed[0],
-				    &(navlon[0]), &(navlat[0]), &(speed[0]), error);
-
-		/* get heading */
-		if (bathymetry->optionaldata == MB_YES)
-			heading[0] = RTD * bathymetry->heading;
-
-		/* get navigation */
-		if (bathymetry->optionaldata == MB_YES)
-			{
-			navlon[0] = RTD * bathymetry->longitude;
-			navlat[0] = RTD * bathymetry->latitude;
-			}
-
-		/* get draft  */
-		if (bathymetry->optionaldata == MB_YES)
-			{
-			draft[0] = -bathymetry->vehicle_height + reference->water_z;
-			}
-		else if (mb_io_ptr->nsonardepth > 0)
-			{
-			mb_depint_interp(verbose, mbio_ptr, store->time_d,
-				    &(draft[0]), error);
-			}
-		else
-			{
-			draft[0] = reference->water_z;
-			}
-
-		/* get attitude  */
-		if (bathymetry->optionaldata == MB_YES)
-			{
-			roll[0] = RTD * bathymetry->roll;
-			pitch[0] = RTD * bathymetry->pitch;
-			heave[0] = bathymetry->heave;
-			}
-		else
-			{
-			mb_attint_interp(verbose, mbio_ptr, store->time_d,
-				   	&(heave[0]), &(roll[0]), &(pitch[0]), error);
-			}
-
-		/* done translating values */
-
-		}
-
-	/* extract data from nav structure */
-	else if (*kind == MB_DATA_NAV1)
-		{
-		/* just one navigation value */
-		*n = 1;
-
-		/* get time */
-		for (i=0;i<7;i++)
-			time_i[i] = store->time_i[i];
-		time_d[0] = store->time_d;
-
-		/* get navigation and heading */
-		speed[0] = 0.0;
-		mb_hedint_interp(verbose, mbio_ptr, store->time_d,
-				    &(heading[0]), error);
-		mb_navint_interp(verbose, mbio_ptr, store->time_d, heading[0], speed[0],
-				    &(navlon[0]), &(navlat[0]), &(speed[0]), error);
-		navlon[0] = RTD * position->longitude;
-		navlat[0] = RTD * position->latitude;
-
-		/* get roll pitch and heave */
-		mb_attint_interp(verbose, mbio_ptr, *time_d,
-				    &(heave[0]), &(roll[0]), &(pitch[0]), error);
-
-		/* get draft  */
-		if (mb_io_ptr->nsonardepth > 0)
-			{
-			mb_depint_interp(verbose, mbio_ptr, store->time_d,
-				    &draft[0], error);
-			heave[0] = 0.0;
-			}
-		else if (bathymetry->optionaldata == MB_YES)
-			{
-			draft[0] = -bathymetry->vehicle_height + reference->water_z;
-			heave[0] = 0.0;
-			}
-		else
-			{
-			draft[0] = reference->water_z;
-			}
-
-		/* done translating values */
-
-		}
-
-	/* extract data from structure */
-	else if (*kind == MB_DATA_NAV2)
-		{
-		/* get number of available navigation values */
-		if (bluefin->data_format ==  0 && bluefin->number_frames > 0)
-			*n = bluefin->number_frames;
-		else
-			*n = 0;
-
-		/* loop over navigation values */
-		for (inav=0;inav<*n;inav++)
-			{
-			/* get time */
-			time_d[inav] = bluefin->nav[inav].position_time;
-			mb_get_date(verbose, time_d[inav], &(time_i[7 * inav]));
-
-			/* get heading */
-			heading[inav] = RTD * bluefin->nav[inav].yaw;
-
-			/* get speed */
-			speed[inav] = 0.0;
-			mb_navint_interp(verbose, mbio_ptr, time_d[inav], heading[inav], speed[inav],
-					    &(navlon[inav]), &(navlat[inav]), &(speed[inav]), error);
-
-			/* get navigation */
-			navlon[inav] = RTD * bluefin->nav[inav].longitude;
-			navlat[inav] = RTD * bluefin->nav[inav].latitude;
-
-			/* get roll pitch and heave */
-			roll[inav] = RTD * bluefin->nav[inav].roll;
-			pitch[inav] = RTD * bluefin->nav[inav].pitch;
-			heave[inav] = 0.0;
-
-			/* get draft  */
-			draft[inav] = bluefin->nav[inav].depth;
-			}
-
-		/* done translating values */
-
-		}
-
-	/* extract data from structure */
-	else if (*kind == MB_DATA_NAV3)
-		{
-		/* get number of available navigation values */
-		*n = 1;
-
-		/* get time */
-		for (i=0;i<7;i++)
-			time_i[i] = store->time_i[i];
-		time_d[0] = store->time_d;
-
-		/* get navigation */
-		navlon[0] = RTD * navigation->longitude;
-		navlat[0] = RTD * navigation->latitude;
-
-		/* get speed  */
-		speed[0] = 0.0;
-
-		/* get heading */
-		if (mb_io_ptr->nheading > 0)
-			mb_hedint_interp(verbose, mbio_ptr, store->time_d,
-				    heading, error);
-		else if (bathymetry->optionaldata == MB_YES)
-			heading[0] = RTD * bathymetry->heading;
-
-		/* get draft  */
-		if (mb_io_ptr->nsonardepth > 0)
-			{
-			mb_depint_interp(verbose, mbio_ptr, store->time_d,
-				    &(draft[0]), error);
-			}
-		else if (bathymetry->optionaldata == MB_YES)
-			{
-			draft[0] = -bathymetry->vehicle_height + reference->water_z;
-			}
-		else
-			{
-			draft[0] = reference->water_z;
-			}
-
-		/* get attitude  */
-		if (mb_io_ptr->nattitude > 0)
-			{
-			mb_attint_interp(verbose, mbio_ptr, store->time_d,
-				   	&(heave[0]), &(roll[0]), &(pitch[0]), error);
-			}
-		else if (bathymetry->optionaldata == MB_YES)
-			{
-			roll[0] = RTD * bathymetry->roll;
-			pitch[0] = RTD * bathymetry->pitch;
-			heave[0] = bathymetry->heave;
-			}
-		else
-			{
-			roll[0] = 0.0;
-			pitch[0] = 0.0;
-			heave[0] = 0.0;
-			}
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-
-		/* get time */
-		for (i=0;i<7;i++)
-			time_i[i] = store->time_i[i];
-		*time_d = store->time_d;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-
-		/* get number of available navigation values */
-		*n = 1;
-
-		/* get time */
-		for (i=0;i<7;i++)
-			time_i[i] = store->time_i[i];
-		*time_d = store->time_d;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		fprintf(stderr,"dbg2       n:          %d\n",*n);
-		for (inav=0;inav<*n;inav++)
-			{
-			for (i=0;i<7;i++)
-				fprintf(stderr,"dbg2       %d time_i[%d]:     %d\n",inav,i,time_i[inav * 7 + i]);
-			fprintf(stderr,"dbg2       %d time_d:        %f\n",inav,time_d[inav]);
-			fprintf(stderr,"dbg2       %d longitude:     %f\n",inav,navlon[inav]);
-			fprintf(stderr,"dbg2       %d latitude:      %f\n",inav,navlat[inav]);
-			fprintf(stderr,"dbg2       %d speed:         %f\n",inav,speed[inav]);
-			fprintf(stderr,"dbg2       %d heading:       %f\n",inav,heading[inav]);
-			fprintf(stderr,"dbg2       %d draft:         %f\n",inav,draft[inav]);
-			fprintf(stderr,"dbg2       %d roll:          %f\n",inav,roll[inav]);
-			fprintf(stderr,"dbg2       %d pitch:         %f\n",inav,pitch[inav]);
-			fprintf(stderr,"dbg2       %d heave:         %f\n",inav,heave[inav]);
-			}
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_reson7k_insert_nav(int verbose, void *mbio_ptr, void *store_ptr,
-		int time_i[7], double time_d,
-		double navlon, double navlat,
-		double speed, double heading, double draft,
-		double roll, double pitch, double heave,
-		int *error)
-{
-	char	*function_name = "mbsys_reson7k_insert_nav";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_reson7k_struct *store;
-	s7kr_bathymetry *bathymetry;
-	s7kr_position *position;
-	s7kr_depth *depth;
-	s7kr_attitude *attitude;
-	s7kr_reference *reference;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       time_i[0]:  %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:  %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:  %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:  %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:  %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:  %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:  %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:     %f\n",time_d);
-		fprintf(stderr,"dbg2       navlon:     %f\n",navlon);
-		fprintf(stderr,"dbg2       navlat:     %f\n",navlat);
-		fprintf(stderr,"dbg2       speed:      %f\n",speed);
-		fprintf(stderr,"dbg2       heading:    %f\n",heading);
-		fprintf(stderr,"dbg2       draft:      %f\n",draft);
-		fprintf(stderr,"dbg2       roll:       %f\n",roll);
-		fprintf(stderr,"dbg2       pitch:      %f\n",pitch);
-		fprintf(stderr,"dbg2       heave:      %f\n",heave);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	bathymetry = (s7kr_bathymetry *) &store->bathymetry;
-	position = (s7kr_position *) &store->position;
-	depth = (s7kr_depth *) &store->depth;
-	attitude = (s7kr_attitude *) &store->attitude;
-	reference = (s7kr_reference *) &store->reference;
-
-	/* insert data in ping structure */
-	if (store->kind == MB_DATA_DATA)
-		{
-		/* get time */
-		for (i=0;i<7;i++)
-			store->time_i[i] = time_i[i];
-		store->time_d = time_d;
-
-		/* get navigation */
-		bathymetry->longitude = DTR * navlon;
-		bathymetry->latitude = DTR * navlat;
-
-		/* get heading */
-		bathymetry->heading = DTR * heading;
-
-		/* get speed  */
-
-		/* get draft  */
-		bathymetry->vehicle_height = reference->water_z - draft;
-
-		/* get roll pitch and heave */
-		bathymetry->heave = heave;
-		bathymetry->pitch = DTR * pitch;
-		bathymetry->roll = DTR * roll;
-		}
-
-	/* insert data in nav structure */
-	else if (store->kind == MB_DATA_NAV1)
-		{
-		/* get time */
-		for (i=0;i<7;i++)
-			store->time_i[i] = time_i[i];
-		store->time_d = time_d;
-
-		/* get navigation */
-		position->longitude = DTR * navlon;
-		position->latitude = DTR * navlat;
-
-		/* get heading */
-
-		/* get speed  */
-
-		/* get draft  */
-
-		/* get roll pitch and heave */
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_reson7k_extract_svp(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int *nsvp,
-		double *depth, double *velocity,
-		int *error)
-{
-	char	*function_name = "mbsys_reson7k_extract_svp";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_reson7k_struct *store;
-	s7kr_svp *svp;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	svp = (s7kr_svp *) &store->svp;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_VELOCITY_PROFILE)
-		{
-		/* get number of depth-velocity pairs */
-		*nsvp = svp->n;
-
-		/* get profile */
-		for (i=0;i<*nsvp;i++)
-			{
-			depth[i] = svp->depth[i];
-			velocity[i] =svp->sound_velocity[i];
-			}
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:              %d\n",*kind);
-		fprintf(stderr,"dbg2       nsvp:              %d\n",*nsvp);
-		for (i=0;i<*nsvp;i++)
-		    fprintf(stderr,"dbg2       depth[%d]: %f   velocity[%d]: %f\n",i, depth[i], i, velocity[i]);
-		fprintf(stderr,"dbg2       error:             %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:            %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_reson7k_insert_svp(int verbose, void *mbio_ptr, void *store_ptr,
-		int nsvp,
-		double *depth, double *velocity,
-		int *error)
-{
-	char	*function_name = "mbsys_reson7k_insert_svp";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_reson7k_struct *store;
-	s7kr_svp *svp;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       nsvp:       %d\n",nsvp);
-		for (i=0;i<nsvp;i++)
-		    fprintf(stderr,"dbg2       depth[%d]: %f   velocity[%d]: %f\n",i, depth[i], i, velocity[i]);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	svp = (s7kr_svp *) &store->svp;
-
-	/* insert data in structure */
-	if (store->kind == MB_DATA_VELOCITY_PROFILE)
-		{
-		/* allocate memory if necessary */
-		if (svp->nalloc < nsvp)
-			{
-			status = mb_reallocd(verbose, __FILE__, __LINE__, nsvp * sizeof(float),
-						(void **)&(svp->depth), error);
-			status = mb_reallocd(verbose, __FILE__, __LINE__, nsvp * sizeof(float),
-						(void **)&(svp->sound_velocity), error);
-			if (status == MB_SUCCESS)
-				{
-				svp->nalloc = nsvp;
-				}
-			else
-				{
-				svp->n = 0;
-				svp->nalloc = 0;
-				}
-			}
-
-		/* get profile */
-		if (status == MB_SUCCESS)
-			{
-			svp->n = nsvp;
-			for (i=0;i<svp->n;i++)
-				{
-				svp->depth[i] = depth[i];
-				svp->sound_velocity[i] = velocity[i];
-				}
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_reson7k_extract_segytraceheader(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, void *segytraceheader_ptr, int *error)
-{
-	char	*function_name = "mbsys_reson7k_extract_segytraceheader";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_reson7k_struct *store;
-	struct mb_segytraceheader_struct *mb_segytraceheader_ptr;
-	s7k_header *header;
-	s7kr_bathymetry *bathymetry;
-	s7kr_bluefin *bluefin;
-	s7kr_fsdwsb *fsdwsb;
-	s7k_fsdwchannel *fsdwchannel;
-	s7k_fsdwsegyheader *fsdwsegyheader;
-	s7kr_ctd *ctd;
-	double	dsonardepth, dsonaraltitude, dwaterdepth;
-	int	sonardepth, waterdepth;
-	int	watersoundspeed;
-	float	fwatertime;
-	double	longitude, latitude;
-	double	speed, heading;
-	double	roll, pitch, heave;
-	double	xtrackmin;
-	int	time_j[5];
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:        %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:         %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:      %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       kind:           %d\n",*kind);
-		fprintf(stderr,"dbg2       segytraceheader_ptr: %p\n",(void *)segytraceheader_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_SUBBOTTOM_SUBBOTTOM)
-		{
-		/* get relevant structures */
-		mb_segytraceheader_ptr = (struct mb_segytraceheader_struct *) segytraceheader_ptr;
-		bathymetry = &(store->bathymetry);
-		bluefin = &(store->bluefin);
-		ctd = &(store->ctd);
-		fsdwsb = &(store->fsdwsb);
-		header = &(fsdwsb->header);
-		fsdwchannel = &(fsdwsb->channel);
-		fsdwsegyheader = &(fsdwsb->segyheader);
-
-		/* get needed values */
-		mb_depint_interp(verbose, mbio_ptr, store->time_d,
-				    &dsonardepth, error);
-		mb_altint_interp(verbose, mbio_ptr, store->time_d,
-				    &dsonaraltitude, error);
-		dwaterdepth = dsonardepth + dsonaraltitude;
-
-		/* if possible get altitude from nadir of multibeam bathymetry */
-		if (bathymetry->optionaldata == MB_YES)
-			{
-			/* get depth closest to nadir */
-			xtrackmin = 999999.9;
-			for (i=0;i<bathymetry->number_beams;i++)
-				{
-				if (((bathymetry->quality[i] & 15) == 15)
-					&& fabs((double)bathymetry->acrosstrack[i]) < xtrackmin)
-					{
-					dwaterdepth = bathymetry->depth[i];
-					dsonaraltitude = bathymetry->depth[i] - dsonardepth;
-					xtrackmin = fabs((double)bathymetry->acrosstrack[i]);
-					}
-				}
-			}
-
-		/* get needed values */
-		sonardepth = (int) (100 * dsonardepth);
-		waterdepth = (int) (100 * dwaterdepth);
-		if (ctd->n > 0)
-			watersoundspeed = (int) (ctd->sound_velocity[ctd->n-1]);
-		else if (bluefin->environmental[0].sound_speed > 0.0)
-			watersoundspeed = (int) (bluefin->environmental[0].sound_speed);
-		else
-			watersoundspeed = 1500;
-		fwatertime = 2.0 * dwaterdepth / ((double) watersoundspeed);
-
-		mb_hedint_interp(verbose, mbio_ptr, store->time_d,
-				    &heading, error);
-		speed = 0.0;
-		mb_navint_interp(verbose, mbio_ptr, store->time_d, heading, speed,
-				    &longitude, &latitude, &speed, error);
-		mb_attint_interp(verbose, mbio_ptr, store->time_d,
-				    &heave, &roll, &pitch, error);
-		if (longitude == 0.0 && latitude == 0.0
-			&& bathymetry->longitude != 0.0 && bathymetry->latitude != 0.0)
-			{
-			longitude = RTD * bathymetry->longitude;
-			latitude = RTD * bathymetry->latitude;
-			}
-		mb_get_jtime(verbose, store->time_i, time_j);
-
-		/* extract the data */
-		mb_segytraceheader_ptr->seq_num 	= fsdwsb->ping_number;
-		mb_segytraceheader_ptr->seq_reel 	= fsdwsb->ping_number;
-		mb_segytraceheader_ptr->shot_num 	= fsdwsb->ping_number;
-		mb_segytraceheader_ptr->shot_tr	= 1;
-		mb_segytraceheader_ptr->espn		= 0;
-		mb_segytraceheader_ptr->rp_num	= fsdwsb->ping_number;
-		mb_segytraceheader_ptr->rp_tr	= 1;
-		mb_segytraceheader_ptr->trc_id	= 1;
-		mb_segytraceheader_ptr->num_vstk	= 0;
-		mb_segytraceheader_ptr->cdp_fold	= 0;
-		mb_segytraceheader_ptr->use		= fsdwsb->data_format;
-		mb_segytraceheader_ptr->range	= 0;
-		mb_segytraceheader_ptr->grp_elev	= -sonardepth;
-		mb_segytraceheader_ptr->src_elev	= -sonardepth;
-		mb_segytraceheader_ptr->src_depth	= sonardepth;
-		mb_segytraceheader_ptr->grp_datum	= 0;
-		mb_segytraceheader_ptr->src_datum	= 0;
-		mb_segytraceheader_ptr->src_wbd	= waterdepth;
-		mb_segytraceheader_ptr->grp_wbd	= waterdepth;
-		mb_segytraceheader_ptr->elev_scalar	= -100; 	/* 0.01 m precision for depths */
-		mb_segytraceheader_ptr->coord_scalar	= -100;		/* 0.01 arc second precision for position
-									= 0.3 m precision at equator */
-		mb_segytraceheader_ptr->src_long	= (int)(longitude * 360000.0);
-		mb_segytraceheader_ptr->src_lat	= (int)(latitude * 360000.0);
-		mb_segytraceheader_ptr->grp_long	= (int)(longitude * 360000.0);
-		mb_segytraceheader_ptr->grp_lat	= (int)(latitude * 360000.0);
-		mb_segytraceheader_ptr->coord_units	= 2;
-		mb_segytraceheader_ptr->wvel		= watersoundspeed;
-		mb_segytraceheader_ptr->sbvel	= 0;
-		mb_segytraceheader_ptr->src_up_vel	= 0;
-		mb_segytraceheader_ptr->grp_up_vel	= 0;
-		mb_segytraceheader_ptr->src_static	= 0;
-		mb_segytraceheader_ptr->grp_static	= 0;
-		mb_segytraceheader_ptr->tot_static	= 0;
-		mb_segytraceheader_ptr->laga		= 0;
-		mb_segytraceheader_ptr->delay_mils	= 0;
-		mb_segytraceheader_ptr->smute_mils	= 0;
-		mb_segytraceheader_ptr->emute_mils	= 0;
-		mb_segytraceheader_ptr->nsamps	= fsdwchannel->number_samples;
-		mb_segytraceheader_ptr->si_micros	= fsdwchannel->sample_interval;
-		for (i=0;i<19;i++)
-			mb_segytraceheader_ptr->other_1[i]	= 0;
-		mb_segytraceheader_ptr->year		= store->time_i[0];
-		mb_segytraceheader_ptr->day_of_yr	= time_j[1];
-		mb_segytraceheader_ptr->hour		= store->time_i[3];
-		mb_segytraceheader_ptr->min		= store->time_i[4];
-		mb_segytraceheader_ptr->sec		= store->time_i[5];
-		mb_segytraceheader_ptr->mils		= store->time_i[6] / 1000;
-		mb_segytraceheader_ptr->tr_weight	= 1;
-		for (i=0;i<5;i++)
-			mb_segytraceheader_ptr->other_2[i]	= 0;
-		mb_segytraceheader_ptr->delay	= 0.0;
-		mb_segytraceheader_ptr->smute_sec	= 0.0;
-		mb_segytraceheader_ptr->emute_sec	= 0.0;
-		mb_segytraceheader_ptr->si_secs		= 0.000001 * ((float)fsdwchannel->sample_interval);
-		mb_segytraceheader_ptr->wbt_secs	= fwatertime;
-		mb_segytraceheader_ptr->end_of_rp	= 0;
-		mb_segytraceheader_ptr->dummy1		= 0.0;
-		mb_segytraceheader_ptr->dummy2		= 0.0;
-		mb_segytraceheader_ptr->dummy3		= 0.0;
-		mb_segytraceheader_ptr->dummy4		= 0.0;
-		mb_segytraceheader_ptr->soundspeed 	= watersoundspeed;
-		mb_segytraceheader_ptr->distance 	= 0.0;
-		mb_segytraceheader_ptr->roll 		= (float) roll;
-		mb_segytraceheader_ptr->pitch 		= (float) pitch;
-		mb_segytraceheader_ptr->heading		= (float) heading;
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:              %d\n",*kind);
-		fprintf(stderr,"dbg2       seq_num:           %d\n",mb_segytraceheader_ptr->seq_num);
-		fprintf(stderr,"dbg2       seq_reel:          %d\n",mb_segytraceheader_ptr->seq_reel);
-		fprintf(stderr,"dbg2       shot_num:          %d\n",mb_segytraceheader_ptr->shot_num);
-		fprintf(stderr,"dbg2       shot_tr:           %d\n",mb_segytraceheader_ptr->shot_tr);
-		fprintf(stderr,"dbg2       espn:              %d\n",mb_segytraceheader_ptr->espn);
-		fprintf(stderr,"dbg2       rp_num:            %d\n",mb_segytraceheader_ptr->rp_num);
-		fprintf(stderr,"dbg2       rp_tr:             %d\n",mb_segytraceheader_ptr->rp_tr);
-		fprintf(stderr,"dbg2       trc_id:            %d\n",mb_segytraceheader_ptr->trc_id);
-		fprintf(stderr,"dbg2       num_vstk:          %d\n",mb_segytraceheader_ptr->num_vstk);
-		fprintf(stderr,"dbg2       cdp_fold:          %d\n",mb_segytraceheader_ptr->cdp_fold);
-		fprintf(stderr,"dbg2       use:               %d\n",mb_segytraceheader_ptr->use);
-		fprintf(stderr,"dbg2       range:             %d\n",mb_segytraceheader_ptr->range);
-		fprintf(stderr,"dbg2       grp_elev:          %d\n",mb_segytraceheader_ptr->grp_elev);
-		fprintf(stderr,"dbg2       src_elev:          %d\n",mb_segytraceheader_ptr->src_elev);
-		fprintf(stderr,"dbg2       src_depth:         %d\n",mb_segytraceheader_ptr->src_depth);
-		fprintf(stderr,"dbg2       grp_datum:         %d\n",mb_segytraceheader_ptr->grp_datum);
-		fprintf(stderr,"dbg2       src_datum:         %d\n",mb_segytraceheader_ptr->src_datum);
-		fprintf(stderr,"dbg2       src_wbd:           %d\n",mb_segytraceheader_ptr->src_wbd);
-		fprintf(stderr,"dbg2       grp_wbd:           %d\n",mb_segytraceheader_ptr->grp_wbd);
-		fprintf(stderr,"dbg2       elev_scalar:       %d\n",mb_segytraceheader_ptr->elev_scalar);
-		fprintf(stderr,"dbg2       coord_scalar:      %d\n",mb_segytraceheader_ptr->coord_scalar);
-		fprintf(stderr,"dbg2       src_long:          %d\n",mb_segytraceheader_ptr->src_long);
-		fprintf(stderr,"dbg2       src_lat:           %d\n",mb_segytraceheader_ptr->src_lat);
-		fprintf(stderr,"dbg2       grp_long:          %d\n",mb_segytraceheader_ptr->grp_long);
-		fprintf(stderr,"dbg2       grp_lat:           %d\n",mb_segytraceheader_ptr->grp_lat);
-		fprintf(stderr,"dbg2       coord_units:       %d\n",mb_segytraceheader_ptr->coord_units);
-		fprintf(stderr,"dbg2       wvel:              %d\n",mb_segytraceheader_ptr->wvel);
-		fprintf(stderr,"dbg2       sbvel:             %d\n",mb_segytraceheader_ptr->sbvel);
-		fprintf(stderr,"dbg2       src_up_vel:        %d\n",mb_segytraceheader_ptr->src_up_vel);
-		fprintf(stderr,"dbg2       grp_up_vel:        %d\n",mb_segytraceheader_ptr->grp_up_vel);
-		fprintf(stderr,"dbg2       src_static:        %d\n",mb_segytraceheader_ptr->src_static);
-		fprintf(stderr,"dbg2       grp_static:        %d\n",mb_segytraceheader_ptr->grp_static);
-		fprintf(stderr,"dbg2       tot_static:        %d\n",mb_segytraceheader_ptr->tot_static);
-		fprintf(stderr,"dbg2       laga:              %d\n",mb_segytraceheader_ptr->laga);
-		fprintf(stderr,"dbg2       delay_mils:        %d\n",mb_segytraceheader_ptr->delay_mils);
-		fprintf(stderr,"dbg2       smute_mils:        %d\n",mb_segytraceheader_ptr->smute_mils);
-		fprintf(stderr,"dbg2       emute_mils:        %d\n",mb_segytraceheader_ptr->emute_mils);
-		fprintf(stderr,"dbg2       nsamps:            %d\n",mb_segytraceheader_ptr->nsamps);
-		fprintf(stderr,"dbg2       si_micros:         %d\n",mb_segytraceheader_ptr->si_micros);
-		for (i=0;i<19;i++)
-		fprintf(stderr,"dbg2       other_1[%2d]:       %d\n",i,mb_segytraceheader_ptr->other_1[i]);
-		fprintf(stderr,"dbg2       year:              %d\n",mb_segytraceheader_ptr->year);
-		fprintf(stderr,"dbg2       day_of_yr:         %d\n",mb_segytraceheader_ptr->day_of_yr);
-		fprintf(stderr,"dbg2       hour:              %d\n",mb_segytraceheader_ptr->hour);
-		fprintf(stderr,"dbg2       min:               %d\n",mb_segytraceheader_ptr->min);
-		fprintf(stderr,"dbg2       sec:               %d\n",mb_segytraceheader_ptr->sec);
-		fprintf(stderr,"dbg2       mils:              %d\n",mb_segytraceheader_ptr->mils);
-		fprintf(stderr,"dbg2       tr_weight:         %d\n",mb_segytraceheader_ptr->tr_weight);
-		for (i=0;i<5;i++)
-		fprintf(stderr,"dbg2       other_2[%2d]:       %d\n",i,mb_segytraceheader_ptr->other_2[i]);
-		fprintf(stderr,"dbg2       delay:             %f\n",mb_segytraceheader_ptr->delay);
-		fprintf(stderr,"dbg2       smute_sec:         %f\n",mb_segytraceheader_ptr->smute_sec);
-		fprintf(stderr,"dbg2       emute_sec:         %f\n",mb_segytraceheader_ptr->emute_sec);
-		fprintf(stderr,"dbg2       si_secs:           %f\n",mb_segytraceheader_ptr->si_secs);
-		fprintf(stderr,"dbg2       wbt_secs:          %f\n",mb_segytraceheader_ptr->wbt_secs);
-		fprintf(stderr,"dbg2       end_of_rp:         %d\n",mb_segytraceheader_ptr->end_of_rp);
-		fprintf(stderr,"dbg2       dummy1:            %f\n",mb_segytraceheader_ptr->dummy1);
-		fprintf(stderr,"dbg2       dummy2:            %f\n",mb_segytraceheader_ptr->dummy2);
-		fprintf(stderr,"dbg2       dummy3:            %f\n",mb_segytraceheader_ptr->dummy3);
-		fprintf(stderr,"dbg2       dummy4:            %f\n",mb_segytraceheader_ptr->dummy4);
-		fprintf(stderr,"dbg2       soundspeed:        %f\n",mb_segytraceheader_ptr->soundspeed);
-		fprintf(stderr,"dbg2       distance:          %f\n",mb_segytraceheader_ptr->distance);
-		fprintf(stderr,"dbg2       roll:              %f\n",mb_segytraceheader_ptr->roll);
-		fprintf(stderr,"dbg2       pitch:             %f\n",mb_segytraceheader_ptr->pitch);
-		fprintf(stderr,"dbg2       heading:           %f\n",mb_segytraceheader_ptr->heading);
-		fprintf(stderr,"dbg2       error:             %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:            %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_reson7k_extract_segy(int verbose, void *mbio_ptr, void *store_ptr,
-		int *sampleformat, int *kind, void *segyheader_ptr, float *segydata, int *error)
-{
-	char	*function_name = "mbsys_reson7k_extract_segy";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_reson7k_struct *store;
-	struct mb_segytraceheader_struct *mb_segytraceheader_ptr;
-	s7k_header *header;
-	s7kr_fsdwsb *fsdwsb;
-	s7k_fsdwchannel *fsdwchannel;
-	s7k_fsdwsegyheader *fsdwsegyheader;
-	short	*shortptr;
-	unsigned short	*ushortptr;
-	double	weight;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:           %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:            %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:         %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       sampleformat:      %d\n",*sampleformat);
-		fprintf(stderr,"dbg2       kind:              %d\n",*kind);
-		fprintf(stderr,"dbg2       segyheader_ptr:    %p\n",(void *)segyheader_ptr);
-		fprintf(stderr,"dbg2       segydata:          %p\n",(void *)segydata);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_SUBBOTTOM_SUBBOTTOM)
-		{
-		/* extract segy header */
-		status = mbsys_reson7k_extract_segytraceheader(verbose, mbio_ptr, store_ptr,
-								kind, segyheader_ptr, error);
-
-		/* get relevant structures */
-		mb_segytraceheader_ptr = (struct mb_segytraceheader_struct *) segyheader_ptr;
-		fsdwsb = &(store->fsdwsb);
-		header = &(fsdwsb->header);
-		fsdwchannel = &(fsdwsb->channel);
-		fsdwsegyheader = &(fsdwsb->segyheader);
-		shortptr = (short *) fsdwchannel->data;
-		ushortptr = (unsigned short *) fsdwchannel->data;
-
-		/* get the trace weight */
-		weight = exp(MB_LN_2 * ((double)fsdwsegyheader->weightingFactor));
-/*fprintf(stderr, "Subbottom: Weight: %d %f\n",fsdwsegyheader->weightingFactor,weight);*/
-
-		/* extract the data */
-		if (fsdwsb->data_format == EDGETECH_TRACEFORMAT_ENVELOPE)
-			{
-			*sampleformat = MB_SEGY_SAMPLEFORMAT_ENVELOPE;
-			for (i=0;i<fsdwchannel->number_samples;i++)
-				{
-				segydata[i] = (float) (((double)ushortptr[i]) / weight);
-				}
-			}
-		else if (fsdwsb->data_format == EDGETECH_TRACEFORMAT_ANALYTIC)
-			{
-			/* if no format specified do envelope by default */
-			if (*sampleformat == MB_SEGY_SAMPLEFORMAT_NONE)
-				*sampleformat = MB_SEGY_SAMPLEFORMAT_ENVELOPE;
-
-			/* convert analytic data to desired envelope */
-			if (*sampleformat == MB_SEGY_SAMPLEFORMAT_ENVELOPE)
-				{
-				for (i=0;i<fsdwchannel->number_samples;i++)
-					{
-					segydata[i] = (float) (sqrt((double) (shortptr[2*i] * shortptr[2*i]
-								+ shortptr[2*i+1] * shortptr[2*i+1]))
-								/ weight);
-					}
-				}
-
-			/* else extract desired analytic data */
-			else if (*sampleformat == MB_SEGY_SAMPLEFORMAT_ANALYTIC)
-				{
-				for (i=0;i<fsdwchannel->number_samples;i++)
-					{
-					segydata[2*i]   = (float) (((double)shortptr[2*i]) / weight);
-					segydata[2*i+1] = (float) (((double)shortptr[2*i+1]) / weight);
-					}
-				}
-
-			/* else extract desired real trace from analytic data */
-			else if (*sampleformat == MB_SEGY_SAMPLEFORMAT_TRACE)
-				{
-				for (i=0;i<fsdwchannel->number_samples;i++)
-					{
-					segydata[i] = (float) (((double)shortptr[2*i]) / weight);
-					}
-				}
-			}
-		else if (fsdwsb->data_format == EDGETECH_TRACEFORMAT_RAW)
-			{
-			*sampleformat = MB_SEGY_SAMPLEFORMAT_TRACE;
-			for (i=0;i<fsdwchannel->number_samples;i++)
-				{
-				segydata[i] = (float) (((double)ushortptr[i]) / weight);
-				}
-			}
-		else if (fsdwsb->data_format == EDGETECH_TRACEFORMAT_REALANALYTIC)
-			{
-			*sampleformat = MB_SEGY_SAMPLEFORMAT_TRACE;
-			for (i=0;i<fsdwchannel->number_samples;i++)
-				{
-				segydata[i] = (float) (((double)ushortptr[i]) / weight);
-				}
-			}
-		else if (fsdwsb->data_format == EDGETECH_TRACEFORMAT_PIXEL)
-			{
-			*sampleformat = MB_SEGY_SAMPLEFORMAT_TRACE;
-			for (i=0;i<fsdwchannel->number_samples;i++)
-				{
-				segydata[i] = (float) (((double)ushortptr[i]) / weight);
-				}
-			}
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       sampleformat:      %d\n",*sampleformat);
-		fprintf(stderr,"dbg2       kind:              %d\n",*kind);
-		fprintf(stderr,"dbg2       seq_num:           %d\n",mb_segytraceheader_ptr->seq_num);
-		fprintf(stderr,"dbg2       seq_reel:          %d\n",mb_segytraceheader_ptr->seq_reel);
-		fprintf(stderr,"dbg2       shot_num:          %d\n",mb_segytraceheader_ptr->shot_num);
-		fprintf(stderr,"dbg2       shot_tr:           %d\n",mb_segytraceheader_ptr->shot_tr);
-		fprintf(stderr,"dbg2       espn:              %d\n",mb_segytraceheader_ptr->espn);
-		fprintf(stderr,"dbg2       rp_num:            %d\n",mb_segytraceheader_ptr->rp_num);
-		fprintf(stderr,"dbg2       rp_tr:             %d\n",mb_segytraceheader_ptr->rp_tr);
-		fprintf(stderr,"dbg2       trc_id:            %d\n",mb_segytraceheader_ptr->trc_id);
-		fprintf(stderr,"dbg2       num_vstk:          %d\n",mb_segytraceheader_ptr->num_vstk);
-		fprintf(stderr,"dbg2       cdp_fold:          %d\n",mb_segytraceheader_ptr->cdp_fold);
-		fprintf(stderr,"dbg2       use:               %d\n",mb_segytraceheader_ptr->use);
-		fprintf(stderr,"dbg2       range:             %d\n",mb_segytraceheader_ptr->range);
-		fprintf(stderr,"dbg2       grp_elev:          %d\n",mb_segytraceheader_ptr->grp_elev);
-		fprintf(stderr,"dbg2       src_elev:          %d\n",mb_segytraceheader_ptr->src_elev);
-		fprintf(stderr,"dbg2       src_depth:         %d\n",mb_segytraceheader_ptr->src_depth);
-		fprintf(stderr,"dbg2       grp_datum:         %d\n",mb_segytraceheader_ptr->grp_datum);
-		fprintf(stderr,"dbg2       src_datum:         %d\n",mb_segytraceheader_ptr->src_datum);
-		fprintf(stderr,"dbg2       src_wbd:           %d\n",mb_segytraceheader_ptr->src_wbd);
-		fprintf(stderr,"dbg2       grp_wbd:           %d\n",mb_segytraceheader_ptr->grp_wbd);
-		fprintf(stderr,"dbg2       elev_scalar:       %d\n",mb_segytraceheader_ptr->elev_scalar);
-		fprintf(stderr,"dbg2       coord_scalar:      %d\n",mb_segytraceheader_ptr->coord_scalar);
-		fprintf(stderr,"dbg2       src_long:          %d\n",mb_segytraceheader_ptr->src_long);
-		fprintf(stderr,"dbg2       src_lat:           %d\n",mb_segytraceheader_ptr->src_lat);
-		fprintf(stderr,"dbg2       grp_long:          %d\n",mb_segytraceheader_ptr->grp_long);
-		fprintf(stderr,"dbg2       grp_lat:           %d\n",mb_segytraceheader_ptr->grp_lat);
-		fprintf(stderr,"dbg2       coord_units:       %d\n",mb_segytraceheader_ptr->coord_units);
-		fprintf(stderr,"dbg2       wvel:              %d\n",mb_segytraceheader_ptr->wvel);
-		fprintf(stderr,"dbg2       sbvel:             %d\n",mb_segytraceheader_ptr->sbvel);
-		fprintf(stderr,"dbg2       src_up_vel:        %d\n",mb_segytraceheader_ptr->src_up_vel);
-		fprintf(stderr,"dbg2       grp_up_vel:        %d\n",mb_segytraceheader_ptr->grp_up_vel);
-		fprintf(stderr,"dbg2       src_static:        %d\n",mb_segytraceheader_ptr->src_static);
-		fprintf(stderr,"dbg2       grp_static:        %d\n",mb_segytraceheader_ptr->grp_static);
-		fprintf(stderr,"dbg2       tot_static:        %d\n",mb_segytraceheader_ptr->tot_static);
-		fprintf(stderr,"dbg2       laga:              %d\n",mb_segytraceheader_ptr->laga);
-		fprintf(stderr,"dbg2       delay_mils:        %d\n",mb_segytraceheader_ptr->delay_mils);
-		fprintf(stderr,"dbg2       smute_mils:        %d\n",mb_segytraceheader_ptr->smute_mils);
-		fprintf(stderr,"dbg2       emute_mils:        %d\n",mb_segytraceheader_ptr->emute_mils);
-		fprintf(stderr,"dbg2       nsamps:            %d\n",mb_segytraceheader_ptr->nsamps);
-		fprintf(stderr,"dbg2       si_micros:         %d\n",mb_segytraceheader_ptr->si_micros);
-		for (i=0;i<19;i++)
-		fprintf(stderr,"dbg2       other_1[%2d]:       %d\n",i,mb_segytraceheader_ptr->other_1[i]);
-		fprintf(stderr,"dbg2       year:              %d\n",mb_segytraceheader_ptr->year);
-		fprintf(stderr,"dbg2       day_of_yr:         %d\n",mb_segytraceheader_ptr->day_of_yr);
-		fprintf(stderr,"dbg2       hour:              %d\n",mb_segytraceheader_ptr->hour);
-		fprintf(stderr,"dbg2       min:               %d\n",mb_segytraceheader_ptr->min);
-		fprintf(stderr,"dbg2       sec:               %d\n",mb_segytraceheader_ptr->sec);
-		fprintf(stderr,"dbg2       mils:              %d\n",mb_segytraceheader_ptr->mils);
-		fprintf(stderr,"dbg2       tr_weight:         %d\n",mb_segytraceheader_ptr->tr_weight);
-		for (i=0;i<5;i++)
-		fprintf(stderr,"dbg2       other_2[%2d]:       %d\n",i,mb_segytraceheader_ptr->other_2[i]);
-		fprintf(stderr,"dbg2       delay:             %f\n",mb_segytraceheader_ptr->delay);
-		fprintf(stderr,"dbg2       smute_sec:         %f\n",mb_segytraceheader_ptr->smute_sec);
-		fprintf(stderr,"dbg2       emute_sec:         %f\n",mb_segytraceheader_ptr->emute_sec);
-		fprintf(stderr,"dbg2       si_secs:           %f\n",mb_segytraceheader_ptr->si_secs);
-		fprintf(stderr,"dbg2       wbt_secs:          %f\n",mb_segytraceheader_ptr->wbt_secs);
-		fprintf(stderr,"dbg2       end_of_rp:         %d\n",mb_segytraceheader_ptr->end_of_rp);
-		fprintf(stderr,"dbg2       dummy1:            %f\n",mb_segytraceheader_ptr->dummy1);
-		fprintf(stderr,"dbg2       dummy2:            %f\n",mb_segytraceheader_ptr->dummy2);
-		fprintf(stderr,"dbg2       dummy3:            %f\n",mb_segytraceheader_ptr->dummy3);
-		fprintf(stderr,"dbg2       dummy4:            %f\n",mb_segytraceheader_ptr->dummy4);
-		fprintf(stderr,"dbg2       soundspeed:        %f\n",mb_segytraceheader_ptr->soundspeed);
-		fprintf(stderr,"dbg2       distance:          %f\n",mb_segytraceheader_ptr->distance);
-		fprintf(stderr,"dbg2       roll:              %f\n",mb_segytraceheader_ptr->roll);
-		fprintf(stderr,"dbg2       pitch:             %f\n",mb_segytraceheader_ptr->pitch);
-		fprintf(stderr,"dbg2       heading:           %f\n",mb_segytraceheader_ptr->heading);
-		for (i=0;i<mb_segytraceheader_ptr->nsamps;i++)
-			fprintf(stderr,"dbg2       segydata[%d]:      %f\n",i,segydata[i]);
-		fprintf(stderr,"dbg2       error:             %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:            %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_reson7k_insert_segy(int verbose, void *mbio_ptr, void *store_ptr,
-		int kind, void *segyheader_ptr, float *segydata, int *error)
-{
-	char	*function_name = "mbsys_reson7k_insert_segy";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_reson7k_struct *store;
-	struct mb_segytraceheader_struct *mb_segytraceheader_ptr;
-	s7k_header *header;
-	s7kr_bathymetry *bathymetry;
-	s7kr_fsdwsb *fsdwsb;
-	s7k_fsdwchannel *fsdwchannel;
-	s7k_fsdwsegyheader *fsdwsegyheader;
-	s7kr_ctd *ctd;
-	double	dsonardepth, dsonaraltitude, dwaterdepth;
-	int	sonardepth, waterdepth;
-	int	watersoundspeed;
-	float	fwatertime;
-	int	time_j[5];
-	float	factor;
-	float	datamax;
-	double	weight;
-	int	data_size;
-	short	*shortptr;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:        %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:         %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:      %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       kind:           %d\n",kind);
-		fprintf(stderr,"dbg2       segyheader_ptr: %p\n",(void *)segyheader_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-
-	/* get data kind */
-	store->kind = kind;
-
-	/* insert data to structure */
-	if (store->kind == MB_DATA_SUBBOTTOM_SUBBOTTOM)
-		{
-		/* get relevant structures */
-		mb_segytraceheader_ptr = (struct mb_segytraceheader_struct *) segyheader_ptr;
-		bathymetry = &(store->bathymetry);
-		ctd = &(store->ctd);
-		fsdwsb = &(store->fsdwsb);
-		header = &(fsdwsb->header);
-		fsdwchannel = &(fsdwsb->channel);
-		fsdwsegyheader = &(fsdwsb->segyheader);
-
-		/* get needed values */
-		mb_depint_interp(verbose, mbio_ptr, store->time_d,
-				    &dsonardepth, error);
-		mb_altint_interp(verbose, mbio_ptr, store->time_d,
-				    &dsonaraltitude, error);
-		dwaterdepth = dsonardepth + dsonaraltitude;
-		sonardepth = (int) (100 * dsonardepth);
-		waterdepth = (int) (100 * dwaterdepth);
-		if (ctd->n > 0)
-			watersoundspeed = (int) (ctd->sound_velocity[ctd->n-1]);
-		else
-			watersoundspeed = 1500;
-		fwatertime = 2.0 * 0.01 * ((double) waterdepth) / ((double) watersoundspeed);
-		mb_get_jtime(verbose, store->time_i, time_j);
-
-		/* extract the data */
-		if (mb_segytraceheader_ptr->shot_num != 0)
-			fsdwsb->ping_number = mb_segytraceheader_ptr->shot_num;
-		else if (mb_segytraceheader_ptr->seq_reel != 0)
-			fsdwsb->ping_number = mb_segytraceheader_ptr->seq_reel;
-		else if (mb_segytraceheader_ptr->seq_num != 0)
-			fsdwsb->ping_number = mb_segytraceheader_ptr->seq_num;
-		else if (mb_segytraceheader_ptr->rp_num != 0)
-			fsdwsb->ping_number = mb_segytraceheader_ptr->rp_num;
-		else
-			fsdwsb->ping_number = 0;
-		fsdwsb->data_format = mb_segytraceheader_ptr->use;
-		if (mb_segytraceheader_ptr->grp_elev != 0)
-			sonardepth = -mb_segytraceheader_ptr->grp_elev;
-		else if (mb_segytraceheader_ptr->src_elev != 0)
-			sonardepth = -mb_segytraceheader_ptr->src_elev;
-		else if (mb_segytraceheader_ptr->src_depth != 0)
-			sonardepth = mb_segytraceheader_ptr->src_depth;
-		else
-			sonardepth = 0;
-		if (mb_segytraceheader_ptr->elev_scalar < 0)
-			factor = 1.0 / ((float) (-mb_segytraceheader_ptr->elev_scalar));
-		else
-			factor = (float) mb_segytraceheader_ptr->elev_scalar;
-		if (mb_segytraceheader_ptr->src_wbd != 0)
-			waterdepth = -mb_segytraceheader_ptr->grp_elev;
-		else if (mb_segytraceheader_ptr->grp_wbd != 0)
-			waterdepth = -mb_segytraceheader_ptr->src_elev;
-		else
-			waterdepth = 0;
-		if (mb_segytraceheader_ptr->coord_scalar < 0)
-			factor = 1.0 / ((float) (-mb_segytraceheader_ptr->coord_scalar)) / 3600.0;
-		else
-			factor = (float) mb_segytraceheader_ptr->coord_scalar / 3600.0;
-		fsdwchannel->number_samples = mb_segytraceheader_ptr->nsamps;
-		fsdwchannel->sample_interval = mb_segytraceheader_ptr->si_micros;
-		time_j[0] = mb_segytraceheader_ptr->year;
-		time_j[1] = mb_segytraceheader_ptr->day_of_yr;
-		time_j[2] = 60 * mb_segytraceheader_ptr->hour + mb_segytraceheader_ptr->min;
-		time_j[3] = mb_segytraceheader_ptr->sec;
-		time_j[4] = 1000 * mb_segytraceheader_ptr->mils;
-		mb_get_itime(verbose,time_j,store->time_i);
-		mb_get_time(verbose,store->time_i,&(store->time_d));
-		header->s7kTime.Year = time_j[0];
-		header->s7kTime.Day = time_j[1];
-		header->s7kTime.Seconds = 0.000001 * store->time_i[6] + store->time_i[5];
-		header->s7kTime.Hours = store->time_i[3];
-		header->s7kTime.Minutes = store->time_i[4];
-
-		/* get max data value */
-		datamax = 0.0;
-		for (i=0;i<mb_segytraceheader_ptr->nsamps;i++)
-			{
-			if (fabs(segydata[i]) > datamax)
-				datamax = fabs(segydata[i]);
-			}
-		if (datamax > 0.0)
-			{
-			fsdwsegyheader->weightingFactor = (short) (log(datamax) / MB_LN_2) - 15;
-			}
-		else
-			fsdwsegyheader->weightingFactor = 0;
-		weight = pow(2.0, (double)fsdwsegyheader->weightingFactor);
-		fsdwchannel->bytespersample = 2;
-
-		/* make sure enough memory is allocated for channel data */
-		data_size = fsdwchannel->bytespersample * fsdwchannel->number_samples;
-		if (fsdwchannel->data_alloc < data_size)
-			{
-			status = mb_reallocd(verbose, __FILE__, __LINE__, data_size, (void **)&(fsdwchannel->data), error);
-			if (status == MB_SUCCESS)
-				{
-				fsdwchannel->data_alloc = data_size;
-				}
-			else
-				{
-				fsdwchannel->data_alloc = 0;
-				fsdwchannel->number_samples = 0;
-				}
-			}
-
-		/* copy over the data */
-		if (fsdwchannel->data_alloc >= data_size)
-			{
-			shortptr = (short *) fsdwchannel->data;
-			for (i=0;i<fsdwchannel->number_samples;i++)
-				{
-				shortptr[i] = (short) (segydata[i] * weight);
-				}
-			}
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       seq_num:           %d\n",mb_segytraceheader_ptr->seq_num);
-		fprintf(stderr,"dbg2       seq_reel:          %d\n",mb_segytraceheader_ptr->seq_reel);
-		fprintf(stderr,"dbg2       shot_num:          %d\n",mb_segytraceheader_ptr->shot_num);
-		fprintf(stderr,"dbg2       shot_tr:           %d\n",mb_segytraceheader_ptr->shot_tr);
-		fprintf(stderr,"dbg2       espn:              %d\n",mb_segytraceheader_ptr->espn);
-		fprintf(stderr,"dbg2       rp_num:            %d\n",mb_segytraceheader_ptr->rp_num);
-		fprintf(stderr,"dbg2       rp_tr:             %d\n",mb_segytraceheader_ptr->rp_tr);
-		fprintf(stderr,"dbg2       trc_id:            %d\n",mb_segytraceheader_ptr->trc_id);
-		fprintf(stderr,"dbg2       num_vstk:          %d\n",mb_segytraceheader_ptr->num_vstk);
-		fprintf(stderr,"dbg2       cdp_fold:          %d\n",mb_segytraceheader_ptr->cdp_fold);
-		fprintf(stderr,"dbg2       use:               %d\n",mb_segytraceheader_ptr->use);
-		fprintf(stderr,"dbg2       range:             %d\n",mb_segytraceheader_ptr->range);
-		fprintf(stderr,"dbg2       grp_elev:          %d\n",mb_segytraceheader_ptr->grp_elev);
-		fprintf(stderr,"dbg2       src_elev:          %d\n",mb_segytraceheader_ptr->src_elev);
-		fprintf(stderr,"dbg2       src_depth:         %d\n",mb_segytraceheader_ptr->src_depth);
-		fprintf(stderr,"dbg2       grp_datum:         %d\n",mb_segytraceheader_ptr->grp_datum);
-		fprintf(stderr,"dbg2       src_datum:         %d\n",mb_segytraceheader_ptr->src_datum);
-		fprintf(stderr,"dbg2       src_wbd:           %d\n",mb_segytraceheader_ptr->src_wbd);
-		fprintf(stderr,"dbg2       grp_wbd:           %d\n",mb_segytraceheader_ptr->grp_wbd);
-		fprintf(stderr,"dbg2       elev_scalar:       %d\n",mb_segytraceheader_ptr->elev_scalar);
-		fprintf(stderr,"dbg2       coord_scalar:      %d\n",mb_segytraceheader_ptr->coord_scalar);
-		fprintf(stderr,"dbg2       src_long:          %d\n",mb_segytraceheader_ptr->src_long);
-		fprintf(stderr,"dbg2       src_lat:           %d\n",mb_segytraceheader_ptr->src_lat);
-		fprintf(stderr,"dbg2       grp_long:          %d\n",mb_segytraceheader_ptr->grp_long);
-		fprintf(stderr,"dbg2       grp_lat:           %d\n",mb_segytraceheader_ptr->grp_lat);
-		fprintf(stderr,"dbg2       coord_units:       %d\n",mb_segytraceheader_ptr->coord_units);
-		fprintf(stderr,"dbg2       wvel:              %d\n",mb_segytraceheader_ptr->wvel);
-		fprintf(stderr,"dbg2       sbvel:             %d\n",mb_segytraceheader_ptr->sbvel);
-		fprintf(stderr,"dbg2       src_up_vel:        %d\n",mb_segytraceheader_ptr->src_up_vel);
-		fprintf(stderr,"dbg2       grp_up_vel:        %d\n",mb_segytraceheader_ptr->grp_up_vel);
-		fprintf(stderr,"dbg2       src_static:        %d\n",mb_segytraceheader_ptr->src_static);
-		fprintf(stderr,"dbg2       grp_static:        %d\n",mb_segytraceheader_ptr->grp_static);
-		fprintf(stderr,"dbg2       tot_static:        %d\n",mb_segytraceheader_ptr->tot_static);
-		fprintf(stderr,"dbg2       laga:              %d\n",mb_segytraceheader_ptr->laga);
-		fprintf(stderr,"dbg2       delay_mils:        %d\n",mb_segytraceheader_ptr->delay_mils);
-		fprintf(stderr,"dbg2       smute_mils:        %d\n",mb_segytraceheader_ptr->smute_mils);
-		fprintf(stderr,"dbg2       emute_mils:        %d\n",mb_segytraceheader_ptr->emute_mils);
-		fprintf(stderr,"dbg2       nsamps:            %d\n",mb_segytraceheader_ptr->nsamps);
-		fprintf(stderr,"dbg2       si_micros:         %d\n",mb_segytraceheader_ptr->si_micros);
-		for (i=0;i<19;i++)
-		fprintf(stderr,"dbg2       other_1[%2d]:       %d\n",i,mb_segytraceheader_ptr->other_1[i]);
-		fprintf(stderr,"dbg2       year:              %d\n",mb_segytraceheader_ptr->year);
-		fprintf(stderr,"dbg2       day_of_yr:         %d\n",mb_segytraceheader_ptr->day_of_yr);
-		fprintf(stderr,"dbg2       hour:              %d\n",mb_segytraceheader_ptr->hour);
-		fprintf(stderr,"dbg2       min:               %d\n",mb_segytraceheader_ptr->min);
-		fprintf(stderr,"dbg2       sec:               %d\n",mb_segytraceheader_ptr->sec);
-		fprintf(stderr,"dbg2       mils:              %d\n",mb_segytraceheader_ptr->mils);
-		fprintf(stderr,"dbg2       tr_weight:         %d\n",mb_segytraceheader_ptr->tr_weight);
-		for (i=0;i<5;i++)
-		fprintf(stderr,"dbg2       other_2[%2d]:       %d\n",i,mb_segytraceheader_ptr->other_2[i]);
-		fprintf(stderr,"dbg2       delay:             %f\n",mb_segytraceheader_ptr->delay);
-		fprintf(stderr,"dbg2       smute_sec:         %f\n",mb_segytraceheader_ptr->smute_sec);
-		fprintf(stderr,"dbg2       emute_sec:         %f\n",mb_segytraceheader_ptr->emute_sec);
-		fprintf(stderr,"dbg2       si_secs:           %f\n",mb_segytraceheader_ptr->si_secs);
-		fprintf(stderr,"dbg2       wbt_secs:          %f\n",mb_segytraceheader_ptr->wbt_secs);
-		fprintf(stderr,"dbg2       end_of_rp:         %d\n",mb_segytraceheader_ptr->end_of_rp);
-		fprintf(stderr,"dbg2       dummy1:            %f\n",mb_segytraceheader_ptr->dummy1);
-		fprintf(stderr,"dbg2       dummy2:            %f\n",mb_segytraceheader_ptr->dummy2);
-		fprintf(stderr,"dbg2       dummy3:            %f\n",mb_segytraceheader_ptr->dummy3);
-		fprintf(stderr,"dbg2       dummy4:            %f\n",mb_segytraceheader_ptr->dummy4);
-		fprintf(stderr,"dbg2       soundspeed:        %f\n",mb_segytraceheader_ptr->soundspeed);
-		fprintf(stderr,"dbg2       distance:          %f\n",mb_segytraceheader_ptr->distance);
-		fprintf(stderr,"dbg2       roll:              %f\n",mb_segytraceheader_ptr->roll);
-		fprintf(stderr,"dbg2       pitch:             %f\n",mb_segytraceheader_ptr->pitch);
-		fprintf(stderr,"dbg2       heading:           %f\n",mb_segytraceheader_ptr->heading);
-		fprintf(stderr,"dbg2       error:             %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:            %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_reson7k_ctd(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, int *nctd, double *time_d,
-	double *conductivity, double *temperature,
-	double *depth, double *salinity, double *soundspeed, int *error)
-{
-	char	*function_name = "mbsys_reson7k_ctd";
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_reson7k_struct *store;
-	s7k_header *header;
-	s7kr_bluefin *bluefin;
-	s7k_bluefin_environmental *environmental;
-	s7kr_ctd *ctd;
-	int	status = MB_SUCCESS;
-	int	time_j[5];
-	int	time_i[7];
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract ctd data from bluefin environmental SSV record */
-	if (*kind == MB_DATA_SSV)
-		{
-		bluefin = &(store->bluefin);
-		header = &(bluefin->header);
-
-		*nctd = 0;
-		for (i=0;i<bluefin->number_frames;i++)
-			{
-			environmental = &(bluefin->environmental[i]);
-			if (environmental->ctd_time > 0.0 && *nctd < MB_CTD_MAX)
-				{
-				/* get time_d if needed */
-				if (environmental->ctd_time < 10000.0)
-					{
-					time_j[0] = environmental->s7kTime.Year;
-					time_j[1] = environmental->s7kTime.Day;
-					time_j[2] = 60 * environmental->s7kTime.Hours + environmental->s7kTime.Minutes;
-					time_j[3] = (int) environmental->s7kTime.Seconds;
-					time_j[4] = (int) (1000000 * (environmental->s7kTime.Seconds - time_j[3]));
-					mb_get_itime(verbose, time_j, time_i);
-					mb_get_time(verbose, time_i, &environmental->ctd_time);
-					}
-
-				/* get values */
-				time_d[*nctd] = environmental->ctd_time;
-				conductivity[*nctd] = environmental->conductivity;
-				temperature[*nctd] = environmental->temperature;
-				depth[*nctd] = environmental->pressure;
-				salinity[*nctd] = environmental->salinity;
-				soundspeed[*nctd] = environmental->sound_speed;
-				(*nctd)++;
-				}
-			}
-		}
-
-	/* extract ctd data from CTD record */
-	else if (*kind == MB_DATA_CTD)
-		{
-		ctd = &(store->ctd);
-		header = &(ctd->header);
-
-		/* get time */
-		time_j[0] = header->s7kTime.Year;
-		time_j[1] = header->s7kTime.Day;
-		time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-		time_j[3] = (int) header->s7kTime.Seconds;
-		time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-		mb_get_itime(verbose, time_j, time_i);
-		mb_get_time(verbose, time_i, &time_d[0]);
-
-		*nctd = MIN(ctd->n, MB_CTD_MAX);
-		for (i=0;i<*nctd;i++)
-			{
-			time_d[i] = time_d[0];
-			if (ctd->sample_rate > 0.0)
-				time_d[i] += i * (1.0 / ctd->sample_rate);
-			if (ctd->conductivity_flag == 0)
-				conductivity[i] = ctd->conductivity_salinity[i];
-			else
-				salinity[i] = ctd->conductivity_salinity[i];
-			temperature[i] = ctd->temperature[i];
-			depth[i] = ctd->pressure_depth[i];
-			soundspeed[i] = ctd->sound_velocity[i];
-			}
-		}
-
-	/* else failure */
-	else
-		{
-		*nctd = 0;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error == MB_ERROR_NO_ERROR)
-		{
-		fprintf(stderr,"dbg2       nctd:          %d\n",*nctd);
-		for (i=0;i<*nctd;i++)
-			{
-			fprintf(stderr,"dbg2       time_d:        %f\n",time_d[i]);
-			fprintf(stderr,"dbg2       conductivity:  %f\n",conductivity[i]);
-			fprintf(stderr,"dbg2       temperature:   %f\n",temperature[i]);
-			fprintf(stderr,"dbg2       depth:         %f\n",depth[i]);
-			fprintf(stderr,"dbg2       salinity:      %f\n",salinity[i]);
-			fprintf(stderr,"dbg2       soundspeed:    %f\n",soundspeed[i]);
-			}
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_reson7k_ancilliarysensor(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, int *nsamples, double *time_d,
-	double *sensor1, double *sensor2, double *sensor3,
-	double *sensor4, double *sensor5, double *sensor6,
-	double *sensor7, double *sensor8, int *error)
-{
-	char	*function_name = "mbsys_reson7k_ancilliarysensor";
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_reson7k_struct *store;
-	s7k_header *header;
-	s7kr_bluefin *bluefin;
-	s7k_bluefin_environmental *environmental;
-	int	status = MB_SUCCESS;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract ctd data from bluefin environmental SSV record */
-	if (*kind == MB_DATA_SSV)
-		{
-		bluefin = &(store->bluefin);
-		header = &(bluefin->header);
-
-		*nsamples = 0;
-		for (i=0;i<bluefin->number_frames;i++)
-			{
-			environmental = &(bluefin->environmental[i]);
-			time_d[*nsamples] = environmental->sensor_time_sec + 0.000000001 * environmental->sensor_time_nsec;
-			sensor1[*nsamples] = -5.0 + ((double)environmental->sensor1) / 6553.6;
-			sensor2[*nsamples] = -5.0 + ((double)environmental->sensor2) / 6553.6;
-			sensor3[*nsamples] = -5.0 + ((double)environmental->sensor3) / 6553.6;
-			sensor4[*nsamples] = -5.0 + ((double)environmental->sensor4) / 6553.6;
-			sensor5[*nsamples] = -5.0 + ((double)environmental->sensor5) / 6553.6;
-			sensor6[*nsamples] = -5.0 + ((double)environmental->sensor6) / 6553.6;
-			sensor7[*nsamples] = -5.0 + ((double)environmental->sensor7) / 6553.6;
-			sensor8[*nsamples] = -5.0 + ((double)environmental->sensor8) / 6553.6;
-			(*nsamples)++;
-			}
-		}
-
-	/* else failure */
-	else
-		{
-		*nsamples = 0;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error == MB_ERROR_NO_ERROR)
-		{
-		fprintf(stderr,"dbg2       nsamples:   %d\n",*nsamples);
-		for (i=0;i<*nsamples;i++)
-			{
-			fprintf(stderr,"dbg2       time_d:        %f\n",time_d[i]);
-			fprintf(stderr,"dbg2       sensor1:       %f\n",sensor1[i]);
-			fprintf(stderr,"dbg2       sensor2:       %f\n",sensor2[i]);
-			fprintf(stderr,"dbg2       sensor3:       %f\n",sensor3[i]);
-			fprintf(stderr,"dbg2       sensor4:       %f\n",sensor4[i]);
-			fprintf(stderr,"dbg2       sensor5:       %f\n",sensor5[i]);
-			fprintf(stderr,"dbg2       sensor6:       %f\n",sensor6[i]);
-			fprintf(stderr,"dbg2       sensor7:       %f\n",sensor7[i]);
-			fprintf(stderr,"dbg2       sensor8:       %f\n",sensor8[i]);
-			}
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_reson7k_copy(int verbose, void *mbio_ptr,
-			void *store_ptr, void *copy_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_reson7k_copy";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_reson7k_struct *store;
-	struct mbsys_reson7k_struct *copy;
-	s7kr_attitude *attitude;
-	s7kr_motion *motion;
-	s7kr_svp *svp;
-	s7kr_ctd *ctd;
-	s7kr_fsdwss *fsdwsslo;
-	s7kr_fsdwss *fsdwsshi;
-	s7kr_fsdwsb *fsdwsb;
-	s7kr_configuration *configuration;
-	s7kr_backscatter *backscatter;
-	s7kr_beam		*beam;
-	s7kr_tvg		*tvg;
-	s7kr_image		*image;
-	s7kr_systemeventmessage *systemeventmessage;
-	int	nalloc;
-	char	*charptr, *copycharptr;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       copy_ptr:   %p\n",(void *)copy_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointers */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	copy = (struct mbsys_reson7k_struct *) copy_ptr;
-
-	/* copy over structures, allocating memory where necessary */
-
-	/* Type of data record */
-	copy->kind = store->kind;			/* MB-System record ID */
-	copy->type = store->type;			/* Reson record ID */
-
-	/* MB-System time stamp */
-	copy->time_d = store->time_d;
-	for (i=0;i<7;i++)
-		copy->time_i[i] = store->time_i[i];
-
-	/* Reference point information (record 1000) */
-	/*  Note: these offsets should be zero for submersible vehicles */
-	copy->reference = store->reference;
-
-	/* Sensor uncalibrated offset position information (record 1001) */
-	copy->sensoruncal = store->sensoruncal;
-
-	/* Sensor calibrated offset position information (record 1002) */
-	copy->sensorcal = store->sensorcal;
-
-	/* Position (record 1003) */
-	copy->position = store->position;
-
-	/* Attitude (record 1004) */
-	attitude = &copy->attitude;
-	copy->attitude = store->attitude;
-	copy->attitude.nalloc = attitude->nalloc;
-	copy->attitude.pitch = attitude->pitch;
-	copy->attitude.roll = attitude->roll;
-	copy->attitude.heading = attitude->heading;
-	copy->attitude.heave = attitude->heave;
-	if (status == MB_SUCCESS
-		&& copy->attitude.nalloc < copy->attitude.n * sizeof(float))
-		{
-		copy->attitude.nalloc = copy->attitude.n * sizeof(float);
-		if (status == MB_SUCCESS)
-		status = mb_reallocd(verbose, __FILE__, __LINE__, copy->attitude.nalloc,
-					(void **)&(copy->attitude.pitch), error);
-		if (status == MB_SUCCESS)
-		status = mb_reallocd(verbose, __FILE__, __LINE__, copy->attitude.nalloc,
-					(void **)&(copy->attitude.roll), error);
-		if (status == MB_SUCCESS)
-		status = mb_reallocd(verbose, __FILE__, __LINE__, copy->attitude.nalloc,
-					(void **)&(copy->attitude.heading), error);
-		if (status == MB_SUCCESS)
-		status = mb_reallocd(verbose, __FILE__, __LINE__, copy->attitude.nalloc,
-					(void **)&(copy->attitude.heave), error);
-		if (status != MB_SUCCESS)
-			{
-			copy->attitude.n = 0;
-			copy->attitude.nalloc = 0;
-			}
-		}
-	if (status == MB_SUCCESS)
-		{
-		for (i=0;i<copy->attitude.n;i++)
-			{
-			copy->attitude.pitch[i] = store->attitude.pitch[i];
-			copy->attitude.roll[i] = store->attitude.roll[i];
-			copy->attitude.heading[i] = store->attitude.heading[i];
-			copy->attitude.heave[i] = store->attitude.heave[i];
-			}
-		}
-
-	/* Tide (record 1005) */
-	copy->tide = store->tide;
-
-	/* Altitude (record 1006) */
-	copy->altitude = store->altitude;
-
-	/* Motion over ground (record 1007) */
-	motion = &copy->motion;
-	copy->motion = store->motion;
-	copy->motion.nalloc = motion->nalloc;
-	copy->motion.x = motion->x;
-	copy->motion.y = motion->y;
-	copy->motion.z = motion->z;
-	copy->motion.xa = motion->xa;
-	copy->motion.ya = motion->ya;
-	copy->motion.za = motion->za;
-	if (status == MB_SUCCESS
-		&& copy->motion.nalloc < copy->motion.n * sizeof(float))
-		{
-		copy->motion.nalloc = copy->motion.n * sizeof(float);
-		if (status == MB_SUCCESS)
-		status = mb_reallocd(verbose, __FILE__, __LINE__, copy->motion.nalloc,
-					(void **)&(copy->motion.x), error);
-		if (status == MB_SUCCESS)
-		status = mb_reallocd(verbose, __FILE__, __LINE__, copy->motion.nalloc,
-					(void **)&(copy->motion.y), error);
-		if (status == MB_SUCCESS)
-		status = mb_reallocd(verbose, __FILE__, __LINE__, copy->motion.nalloc,
-					(void **)&(copy->motion.z), error);
-		if (status == MB_SUCCESS)
-		status = mb_reallocd(verbose, __FILE__, __LINE__, copy->motion.nalloc,
-					(void **)&(copy->motion.xa), error);
-		if (status == MB_SUCCESS)
-		status = mb_reallocd(verbose, __FILE__, __LINE__, copy->motion.nalloc,
-					(void **)&(copy->motion.ya), error);
-		if (status == MB_SUCCESS)
-		status = mb_reallocd(verbose, __FILE__, __LINE__, copy->motion.nalloc,
-					(void **)&(copy->motion.za), error);
-		if (status != MB_SUCCESS)
-			{
-			copy->motion.n = 0;
-			copy->motion.nalloc = 0;
-			}
-		}
-	if (status == MB_SUCCESS)
-		{
-		for (i=0;i<copy->motion.n;i++)
-			{
-			copy->motion.x[i] = store->motion.x[i];
-			copy->motion.y[i] = store->motion.y[i];
-			copy->motion.z[i] = store->motion.z[i];
-			copy->motion.xa[i] = store->motion.xa[i];
-			copy->motion.ya[i] = store->motion.ya[i];
-			copy->motion.za[i] = store->motion.za[i];
-			}
-		}
-
-	/* Depth (record 1008) */
-	copy->depth = store->depth;
-
-	/* Sound velocity profile (record 1009) */
-	svp = &copy->svp;
-	copy->svp = store->svp;
-	copy->svp.nalloc = svp->nalloc;
-	copy->svp.depth = svp->depth;
-	copy->svp.sound_velocity = svp->sound_velocity;
-	if (status == MB_SUCCESS
-		&& copy->svp.nalloc < copy->svp.n * sizeof(float))
-		{
-		copy->svp.nalloc = copy->svp.n * sizeof(float);
-		if (status == MB_SUCCESS)
-		status = mb_reallocd(verbose, __FILE__, __LINE__, copy->svp.nalloc,
-					(void **)&(copy->svp.depth), error);
-		if (status == MB_SUCCESS)
-		status = mb_reallocd(verbose, __FILE__, __LINE__, copy->svp.nalloc,
-					(void **)&(copy->svp.sound_velocity), error);
-		if (status != MB_SUCCESS)
-			{
-			copy->svp.n = 0;
-			copy->svp.nalloc = 0;
-			}
-		}
-	if (status == MB_SUCCESS)
-		{
-		for (i=0;i<copy->svp.n;i++)
-			{
-			copy->svp.depth[i] = store->svp.depth[i];
-			copy->svp.sound_velocity[i] = store->svp.sound_velocity[i];
-			}
-		}
-
-	/* CTD (record 1010) */
-	ctd = &copy->ctd;
-	copy->ctd = store->ctd;
-	copy->ctd.nalloc = ctd->nalloc;
-	copy->ctd.conductivity_salinity = ctd->conductivity_salinity;
-	copy->ctd.temperature = ctd->temperature;
-	copy->ctd.pressure_depth = ctd->pressure_depth;
-	copy->ctd.sound_velocity = ctd->sound_velocity;
-	copy->ctd.absorption = ctd->absorption;
-	if (status == MB_SUCCESS
-		&& copy->ctd.nalloc < copy->ctd.n * sizeof(float))
-		{
-		copy->ctd.nalloc = copy->ctd.n * sizeof(float);
-		if (status == MB_SUCCESS)
-		status = mb_reallocd(verbose, __FILE__, __LINE__, copy->ctd.nalloc,
-					(void **)&(copy->ctd.conductivity_salinity), error);
-		if (status == MB_SUCCESS)
-		status = mb_reallocd(verbose, __FILE__, __LINE__, copy->ctd.nalloc,
-					(void **)&(copy->ctd.temperature), error);
-		if (status == MB_SUCCESS)
-		status = mb_reallocd(verbose, __FILE__, __LINE__, copy->ctd.nalloc,
-					(void **)&(copy->ctd.pressure_depth), error);
-		if (status == MB_SUCCESS)
-		status = mb_reallocd(verbose, __FILE__, __LINE__, copy->ctd.nalloc,
-					(void **)&(copy->ctd.sound_velocity), error);
-		if (status == MB_SUCCESS)
-		status = mb_reallocd(verbose, __FILE__, __LINE__, copy->ctd.nalloc,
-					(void **)&(copy->ctd.absorption), error);
-		if (status != MB_SUCCESS)
-			{
-			copy->ctd.n = 0;
-			copy->ctd.nalloc = 0;
-			}
-		}
-	if (status == MB_SUCCESS)
-		{
-		for (i=0;i<copy->ctd.n;i++)
-			{
-			copy->ctd.conductivity_salinity[i] = store->ctd.conductivity_salinity[i];
-			copy->ctd.temperature[i] = store->ctd.temperature[i];
-			copy->ctd.pressure_depth[i] = store->ctd.pressure_depth[i];
-			copy->ctd.sound_velocity[i] = store->ctd.sound_velocity[i];
-			copy->ctd.absorption[i] = store->ctd.absorption[i];
-			}
-		}
-
-	/* Geodesy (record 1011) */
-	copy->geodesy = store->geodesy;
-
-	/* Edgetech FS-DW low frequency sidescan (record 3000) */
-	fsdwsslo = &copy->fsdwsslo;
-	copy->fsdwsslo = store->fsdwsslo;
-	for (j=0;j<2;j++)
-		{
-		copy->fsdwsslo.channel[j].data_alloc = fsdwsslo->channel[j].data_alloc;
-		copy->fsdwsslo.channel[j].data = fsdwsslo->channel[j].data;
-		if (status == MB_SUCCESS
-			&& copy->fsdwsslo.channel[j].data_alloc
-				< copy->fsdwsslo.channel[j].number_samples
-					* copy->fsdwsslo.channel[j].bytespersample)
-			{
-			copy->fsdwsslo.channel[j].data_alloc
-				= copy->fsdwsslo.channel[j].number_samples
-					* copy->fsdwsslo.channel[j].bytespersample;
-			if (status == MB_SUCCESS)
-			status = mb_reallocd(verbose, __FILE__, __LINE__, store->fsdwsslo.channel[j].data_alloc,
-						(void **)&(copy->fsdwsslo.channel[j].data), error);
-			if (status != MB_SUCCESS)
-				{
-				copy->fsdwsslo.channel[j].data_alloc = 0;
-				copy->fsdwsslo.channel[j].number_samples = 0;
-				}
-			}
-		if (status == MB_SUCCESS)
-			{
-			for (i=0;i<copy->fsdwsslo.channel[j].data_alloc;i++)
-				{
-				copy->fsdwsslo.channel[j].data[i]
-					= store->fsdwsslo.channel[j].data[i];
-				}
-			}
-		}
-
-	/* Edgetech FS-DW high frequency sidescan (record 3000) */
-	fsdwsshi = &copy->fsdwsshi;
-	copy->fsdwsshi = store->fsdwsshi;
-	for (j=0;j<2;j++)
-		{
-		copy->fsdwsshi.channel[j].data_alloc = fsdwsshi->channel[j].data_alloc;
-		copy->fsdwsshi.channel[j].data = fsdwsshi->channel[j].data;
-		if (status == MB_SUCCESS
-			&& copy->fsdwsshi.channel[j].data_alloc
-				< copy->fsdwsshi.channel[j].number_samples
-					* copy->fsdwsshi.channel[j].bytespersample)
-			{
-			copy->fsdwsshi.channel[j].data_alloc
-				= copy->fsdwsshi.channel[j].number_samples
-					* copy->fsdwsshi.channel[j].bytespersample;
-			if (status == MB_SUCCESS)
-			status = mb_reallocd(verbose, __FILE__, __LINE__, store->fsdwsshi.channel[j].data_alloc,
-						(void **)&(copy->fsdwsshi.channel[j].data), error);
-			if (status != MB_SUCCESS)
-				{
-				copy->fsdwsshi.channel[j].data_alloc = 0;
-				copy->fsdwsshi.channel[j].number_samples = 0;
-				}
-			}
-		if (status == MB_SUCCESS)
-			{
-			for (i=0;i<copy->fsdwsshi.channel[j].data_alloc;i++)
-				{
-				copy->fsdwsshi.channel[j].data[i]
-					= store->fsdwsshi.channel[j].data[i];
-				}
-			}
-		}
-
-	/* Edgetech FS-DW subbottom (record 3001) */
-	fsdwsb = &copy->fsdwsb;
-	copy->fsdwsb = store->fsdwsb;
-	copy->fsdwsb.channel.data_alloc = fsdwsb->channel.data_alloc;
-	copy->fsdwsb.channel.data = fsdwsb->channel.data;
-	if (status == MB_SUCCESS
-		&& copy->fsdwsb.channel.data_alloc
-			< copy->fsdwsb.channel.number_samples
-				* copy->fsdwsb.channel.bytespersample)
-		{
-		copy->fsdwsb.channel.data_alloc
-			= copy->fsdwsb.channel.number_samples
-				* copy->fsdwsb.channel.bytespersample;
-		if (status == MB_SUCCESS)
-		status = mb_reallocd(verbose, __FILE__, __LINE__, store->fsdwsb.channel.data_alloc,
-					(void **)&(copy->fsdwsb.channel.data), error);
-		if (status != MB_SUCCESS)
-			{
-			copy->fsdwsb.channel.data_alloc = 0;
-			copy->fsdwsb.channel.number_samples = 0;
-			}
-		}
-	if (status == MB_SUCCESS)
-		{
-		for (i=0;i<copy->fsdwsb.channel.data_alloc;i++)
-			{
-			copy->fsdwsb.channel.data[i]
-				= store->fsdwsb.channel.data[i];
-			}
-		}
-
-	/* Bluefin Environmental Data Frame (can be included in record 3100) */
-	copy->bluefin = store->bluefin;
-
-	/* Reson 7k volatile sonar settings (record 7000) */
-	copy->volatilesettings = store->volatilesettings;
-
-	/* Reson 7k configuration (record 7001) */
-	configuration = &copy->configuration;
-	copy->configuration = store->configuration;
-	for (j=0;j<MBSYS_RESON7K_MAX_DEVICE;j++)
-		{
-		copy->configuration.device[j].info_alloc = configuration->device[j].info_alloc;
-		copy->configuration.device[j].info = configuration->device[j].info;
-		if (status == MB_SUCCESS
-			&& copy->configuration.device[j].info_alloc
-				< copy->configuration.device[j].info_length)
-			{
-			copy->configuration.device[j].info_alloc = copy->configuration.device[j].info_length;
-			if (status == MB_SUCCESS)
-			status = mb_reallocd(verbose, __FILE__, __LINE__, copy->configuration.device[j].info_alloc,
-						(void **)&(copy->configuration.device[j].info), error);
-			if (status != MB_SUCCESS)
-				{
-				copy->configuration.device[j].info_alloc = 0;
-				copy->configuration.device[j].info_length = 0;
-				}
-			}
-		if (status == MB_SUCCESS)
-			{
-			for (i=0;i<copy->configuration.device[j].info_length;i++)
-				{
-				copy->configuration.device[j].info[i]
-					= store->configuration.device[j].info[i];
-				}
-			}
-		}
-
-	/* Reson 7k beam geometry (record 7004) */
-	copy->beamgeometry = store->beamgeometry;
-
-	/* Reson 7k calibration (record 7005) */
-	copy->calibration = store->calibration;
-
-	/* Reson 7k bathymetry (record 7006) */
-	copy->bathymetry = store->bathymetry;
-
-	/* Reson 7k backscatter imagery data (record 7007) */
-	backscatter = &copy->backscatter;
-	copy->backscatter = store->backscatter;
-	copy->backscatter.nalloc = backscatter->nalloc;
-	copy->backscatter.port_data = backscatter->port_data;
-	copy->backscatter.stbd_data = backscatter->stbd_data;
-	if (status == MB_SUCCESS
-		&& copy->backscatter.nalloc
-			< copy->backscatter.number_samples
-				* copy->backscatter.sample_size)
-		{
-		copy->backscatter.nalloc = copy->backscatter.number_samples * copy->backscatter.sample_size;
-		if (status == MB_SUCCESS)
-		status = mb_reallocd(verbose, __FILE__, __LINE__, copy->backscatter.nalloc,
-					(void **)&(copy->backscatter.port_data), error);
-		if (status == MB_SUCCESS)
-		status = mb_reallocd(verbose, __FILE__, __LINE__, copy->backscatter.nalloc,
-					(void **)&(copy->backscatter.stbd_data), error);
-		if (status != MB_SUCCESS)
-			{
-			copy->backscatter.nalloc = 0;
-			copy->backscatter.number_samples = 0;
-			}
-		}
-	if (status == MB_SUCCESS)
-		{
-		for (i=0;i<copy->backscatter.number_samples;i++)
-			{
-			copy->backscatter.port_data[i] = store->backscatter.port_data[i];
-			copy->backscatter.stbd_data[i] = store->backscatter.stbd_data[i];
-			}
-		}
-
-	/* Reson 7k beam data (record 7008) */
-	beam = &copy->beam;
-	copy->beam = store->beam;
-	for (i=0;i<MBSYS_RESON7K_MAX_RECEIVERS;i++)
-		{
-		copy->beam.snippets[i].nalloc_amp = beam->snippets[i].nalloc_amp;
-		copy->beam.snippets[i].nalloc_phase = beam->snippets[i].nalloc_phase;
-		copy->beam.snippets[i].amplitude = beam->snippets[i].amplitude;
-		copy->beam.snippets[i].phase = beam->snippets[i].phase;
-		if (status == MB_SUCCESS
-			&& (copy->beam.snippets[i].nalloc_amp < store->beam.snippets[i].nalloc_amp
-				|| copy->beam.snippets[i].nalloc_phase < store->beam.snippets[i].nalloc_phase))
-			{
-			copy->beam.snippets[i].nalloc_amp = store->beam.snippets[i].nalloc_amp;
-			if (status == MB_SUCCESS)
-			status = mb_reallocd(verbose, __FILE__, __LINE__, copy->beam.snippets[i].nalloc_amp,
-						(void **)&(copy->beam.snippets[i].amplitude), error);
-			copy->beam.snippets[i].nalloc_phase = store->beam.snippets[i].nalloc_phase;
-			if (status == MB_SUCCESS)
-			status = mb_reallocd(verbose, __FILE__, __LINE__, copy->beam.snippets[i].nalloc_phase,
-						(void **)&(copy->beam.snippets[i].phase), error);
-			if (status != MB_SUCCESS)
-				{
-				copy->beam.snippets[i].nalloc_amp = 0;
-				copy->beam.snippets[i].nalloc_phase = 0;
-				copy->beam.snippets[i].end_sample = 0;
-				copy->beam.snippets[i].begin_sample = 0;
-				}
-			}
-		if (status == MB_SUCCESS)
-			{
-			copycharptr = (char *)(copy->beam.snippets[i].amplitude);
-			charptr = (char *)(store->beam.snippets[i].amplitude);
-			for (j=0;j<copy->beam.snippets[i].nalloc_amp;j++)
-				copycharptr[j] = charptr[j];
-			copycharptr = (char *)(copy->beam.snippets[i].phase);
-			charptr = (char *)(store->beam.snippets[i].phase);
-			for (j=0;j<copy->beam.snippets[i].nalloc_phase;j++)
-				copycharptr[j] = charptr[j];
-			}
-
-		}
-
-	/* Reson 7k vertical depth (record 7009) */
-	copy->verticaldepth = store->verticaldepth;
-
-	/* Reson 7k tvg data (record 7010) */
-	tvg = &copy->tvg;
-	copy->tvg = store->tvg;
-	copy->tvg.nalloc = tvg->nalloc;
-	copy->tvg.tvg = tvg->tvg;
-	nalloc = tvg->n * sizeof(float);
-	if (status == MB_SUCCESS
-		&& copy->tvg.nalloc < nalloc)
-		{
-		copy->tvg.nalloc = nalloc;
-		if (status == MB_SUCCESS)
-		status = mb_reallocd(verbose, __FILE__, __LINE__, copy->tvg.nalloc,
-					(void **)&(copy->tvg.tvg), error);
-		if (status != MB_SUCCESS)
-			{
-			copy->tvg.nalloc = 0;
-			copy->tvg.n = 0;
-			}
-		}
-	if (status == MB_SUCCESS)
-		{
-		copycharptr = (char *)(copy->tvg.tvg);
-		charptr = (char *)(store->tvg.tvg);
-		for (j=0;j<nalloc;j++)
-			copycharptr[j] = charptr[j];
-		}
-
-	/* Reson 7k image data (record 7011) */
-	image = &copy->image;
-	copy->image = store->image;
-	copy->image.nalloc = image->nalloc;
-	copy->image.image = image->image;
-	nalloc = image->width * image->height * image->color_depth;
-	if (status == MB_SUCCESS
-		&& copy->image.nalloc < nalloc)
-		{
-		copy->image.nalloc = nalloc;
-		if (status == MB_SUCCESS)
-		status = mb_reallocd(verbose, __FILE__, __LINE__, copy->image.nalloc,
-					(void **)&(copy->image.image), error);
-		if (status != MB_SUCCESS)
-			{
-			copy->image.nalloc = 0;
-			copy->image.width = 0;
-			copy->image.height = 0;
-			copy->image.color_depth = 0;
-			}
-		}
-	if (status == MB_SUCCESS)
-		{
-		copycharptr = (char *)(copy->image.image);
-		charptr = (char *)(store->image.image);
-		for (j=0;j<nalloc;j++)
-			copycharptr[j] = charptr[j];
-		}
-
-	/* Reson 7k system event (record 7051) */
-	systemeventmessage = &copy->systemeventmessage;
-	copy->systemeventmessage = store->systemeventmessage;
-	copy->systemeventmessage.message_alloc = systemeventmessage->message_alloc;
-	copy->systemeventmessage.message = systemeventmessage->message;
-	if (status == MB_SUCCESS
-		&& copy->systemeventmessage.message_alloc
-			< copy->systemeventmessage.message_length)
-		{
-		copy->systemeventmessage.message_alloc = copy->systemeventmessage.message_length;
-		if (status == MB_SUCCESS)
-		status = mb_reallocd(verbose, __FILE__, __LINE__, copy->systemeventmessage.message_alloc,
-					(void **)&(copy->systemeventmessage.message), error);
-		if (status != MB_SUCCESS)
-			{
-			copy->systemeventmessage.event_id = 0;
-			copy->systemeventmessage.message_alloc = 0;
-			copy->systemeventmessage.message_length = 0;
-			copy->systemeventmessage.event_identifier = 0;
-			}
-		}
-	if (status == MB_SUCCESS)
-		{
-		for (i=0;i<copy->systemeventmessage.message_length;i++)
-			{
-			copy->systemeventmessage.message[i] = store->systemeventmessage.message[i];
-			}
-		}
-
-	/* Reson 7k file header (record 7200) */
-	copy->fileheader = store->fileheader;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_reson7k_makess(int verbose, void *mbio_ptr, void *store_ptr,
-		int source, int pixel_size_set, double *pixel_size,
-		int swath_width_set, double *swath_width,
-		int pixel_int, int *error)
-{
-	char	*function_name = "mbsys_reson7k_makess";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_reson7k_struct *store;
-	s7kr_reference		*reference;
-	s7kr_volatilesettings	*volatilesettings;
-	s7kr_beamgeometry	*beamgeometry;
-	s7kr_bathymetry		*bathymetry;
-	s7kr_backscatter	*backscatter;
-	s7kr_snippet		*snippet;
-	s7kr_beam		*beam;
-	s7kr_v2snippettimeseries *snippettimeseries;
-	s7kr_v2snippet		*v2snippet;
-	s7kr_calibratedsnippettimeseries *calibratedsnippettimeseries;
-	s7kr_calibratedsnippet *calibratedsnippet;
-	s7kr_processedsidescan  *processedsidescan;
-	s7kr_bluefin		*bluefin;
-	s7kr_soundvelocity	*soundvelocity;
-	int	nss;
-	int	ss_cnt[MBSYS_RESON7K_MAX_PIXELS];
-	double	ss[MBSYS_RESON7K_MAX_PIXELS];
-	double	ssacrosstrack[MBSYS_RESON7K_MAX_PIXELS];
-	double	ssalongtrack[MBSYS_RESON7K_MAX_PIXELS];
-	int	nbathsort;
-	double	bathsort[MBSYS_RESON7K_MAX_BEAMS];
-	char	beamflag[MBSYS_RESON7K_MAX_BEAMS];
-	double  pixel_size_calc;
-	double	ss_spacing, ss_spacing_use;
-	double	soundspeed;
-	int	iminxtrack;
-	double	minxtrack;
-	double	maxxtrack;
-	int	nrangetable;
-	double	rangetable[MBSYS_RESON7K_MAX_BEAMS];
-	double	acrosstracktable[MBSYS_RESON7K_MAX_BEAMS], acrosstracktablemin;
-	double	alongtracktable[MBSYS_RESON7K_MAX_BEAMS];
-	int	irangenadir, irange;
-	int	found;
-	int	pixel_int_use;
-	int	nsample, nsample_use, sample_start, sample_detect, sample_end;
-	double	angle, altitude, xtrack, xtrackss, ltrackss, factor;
-	double	range, beam_foot, beamwidth, sint;
-	mb_u_char	*data_uchar;
-	unsigned short	*data_ushort;
-	unsigned int	*data_uint;
-	int	first, last, k1, k2;
-	int	ibeam;
-	int	i, j, k, kk;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:         %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:        %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:       %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       source:          %d\n",source);
-		fprintf(stderr,"dbg2       pixel_size_set:  %d\n",pixel_size_set);
-		fprintf(stderr,"dbg2       pixel_size:      %f\n",*pixel_size);
-		fprintf(stderr,"dbg2       swath_width_set: %d\n",swath_width_set);
-		fprintf(stderr,"dbg2       swath_width:     %f\n",*swath_width);
-		fprintf(stderr,"dbg2       pixel_int:       %d\n",pixel_int);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_reson7k_struct *) store_ptr;
-	reference = (s7kr_reference *) &store->reference;
-	volatilesettings = (s7kr_volatilesettings *) &store->volatilesettings;
-	beamgeometry = (s7kr_beamgeometry *) &store->beamgeometry;
-	bathymetry = (s7kr_bathymetry *) &store->bathymetry;
-	backscatter = (s7kr_backscatter *) &store->backscatter;
-	v2snippet = (s7kr_v2snippet *) &store->v2snippet;
-	calibratedsnippet = (s7kr_calibratedsnippet *) &store->calibratedsnippet;
-	beam = (s7kr_beam *) &store->beam;
-	processedsidescan = (s7kr_processedsidescan *) &store->processedsidescan;
-	bluefin = (s7kr_bluefin *) &store->bluefin;
-	soundvelocity = (s7kr_soundvelocity *) &store->soundvelocity;
-
-	/* calculate sidescan from the desired source data if it is available */
-	if (store->kind == MB_DATA_DATA &&
-		((source == R7KRECID_7kV2SnippetData && store->read_v2snippet == MB_YES)
-		 || (source == R7KRECID_7kCalibratedSnippetData && store->read_calibratedsnippet == MB_YES)
-		 || (source == R7KRECID_7kBeamData && store->read_beam == MB_YES)
-		 || (source == R7KRECID_7kBackscatterImageData && store->read_backscatter == MB_YES)))
-		{
-		/* get beamflags - only use snippets from good beams */
-		for (i=0;i<bathymetry->number_beams;i++)
-			{
-			/* beamflagging scheme:
-				Reson quality flags use bits 0-3
-					bit 0: brightness test
-					bit 1: colinearity test
-					bit 2: amplitude pick
-					bit 3: phase pick
-				Early MB scheme (through 2007) - use bits 0-5
-					null: 0
-					flagged: 2
-					good: 15
-					amplitude: +16
-					phase: +32
-				Current MB scheme (>= 2008) - use bits 4-7
-					- bits 0-3 left in original values
-					- beam valid if bit 4 or 5 are set
-					- beam flagged if bit 6 or 7 set
-					bit 4: on = amplitude
-					bit 5: on = phase
-					bit 6: on = auto flag
-					bit 7: on = manual flag */
-			if (bathymetry->quality[i] == 0)
-				{
-				beamflag[i] = MB_FLAG_NULL;
-				}
-			else if (bathymetry->quality[i] & 64)
-				{
-				beamflag[i] = MB_FLAG_FLAG + MB_FLAG_FILTER;
-				}
-			else if (bathymetry->quality[i] & 128)
-				{
-				beamflag[i] = MB_FLAG_FLAG + MB_FLAG_MANUAL;
-				}
-			else if (bathymetry->quality[i] & 240)
-				{
-				beamflag[i] = MB_FLAG_NONE;
-				}
-			else if ((bathymetry->quality[i] & 3) == 3)
-				{
-				beamflag[i] = MB_FLAG_NONE;
-				}
-			else if ((bathymetry->quality[i] & 15) == 0)
-				{
-				beamflag[i] = MB_FLAG_NULL;
-				}
-			else if ((bathymetry->quality[i] & 3) == 0)
-				{
-				beamflag[i] = MB_FLAG_FLAG + MB_FLAG_FILTER;
-				}
-			else
-				{
-				beamflag[i] = MB_FLAG_FLAG + MB_FLAG_MANUAL;
-				}
-			}
-
-		/* get beam angle size */
-		beamwidth = 2.0 * RTD * volatilesettings->receive_width;
-
-		/* get soundspeed */
-		if (volatilesettings->sound_velocity > 0.0)
-			soundspeed = volatilesettings->sound_velocity;
-		else if (soundvelocity->soundvelocity > 0.0)
-			soundspeed = soundvelocity->soundvelocity;
-		else if (bluefin->environmental[0].sound_speed > 0.0)
-			soundspeed = bluefin->environmental[0].sound_speed;
-		else
-			soundspeed = 1500.0;
-
-		/* get raw pixel size */
-		ss_spacing = 0.5 * soundspeed / volatilesettings->sample_rate;
-
-		/* get median depth relative to the sonar and check for min max xtrack */
-		nbathsort = 0;
-		minxtrack = 0.0;
-		maxxtrack = 0.0;
-		iminxtrack = bathymetry->number_beams / 2;
-		found = MB_NO;
-		for (i=0;i<bathymetry->number_beams;i++)
-			{
-			if (mb_beam_ok(beamflag[i]))
-				{
-				bathsort[nbathsort] = bathymetry->depth[i] + bathymetry->vehicle_height;
-				nbathsort++;
-
-				if (found == MB_NO || fabs(bathymetry->acrosstrack[i] < minxtrack))
-					{
-					minxtrack = fabs(bathymetry->acrosstrack[i]);
-					iminxtrack = i;
-					found = MB_YES;
-					}
-
-				maxxtrack = MAX(fabs(bathymetry->acrosstrack[i]), maxxtrack);
-				}
-			}
-
-		/* set number of pixels */
-		nss = MIN(4 * bathymetry->number_beams, MBSYS_RESON7K_MAX_PIXELS);
-
-		/* get sidescan pixel size */
-		if (swath_width_set == MB_NO && bathymetry->number_beams > 0)
-			{
-			(*swath_width) = MAX(fabs(RTD * beamgeometry->angle_acrosstrack[0]),
-					fabs(RTD * beamgeometry->angle_acrosstrack[bathymetry->number_beams-1]));
-			}
-		if (pixel_size_set == MB_NO
-		    && nbathsort > 0)
-			{
-			/* calculate pixel size implied using swath width and nadir altitude */
-			qsort((char *)bathsort, nbathsort, sizeof(double),(void *)mb_double_compare);
-			pixel_size_calc = 2.1 * tan(DTR * (*swath_width)) * bathsort[nbathsort/2] / nss;
-
-			/* use pixel size based on actual swath width if that is larger than the first value */
-			pixel_size_calc = MAX(pixel_size_calc, 2.1 * maxxtrack / nss);
-
-			/* make sure the pixel size is at least equivalent to a 0.1 degree nadir beamwidth */
-			pixel_size_calc = MAX(pixel_size_calc, bathsort[nbathsort/2] * sin(DTR * 0.1));
-
-			/* if the pixel size appears to be changing in size, moderate the change */
-			if ((*pixel_size) <= 0.0)
-				(*pixel_size) = pixel_size_calc;
-			else if (0.95 * (*pixel_size) > pixel_size_calc)
-				(*pixel_size) = 0.95 * (*pixel_size);
-			else if (1.05 * (*pixel_size) < pixel_size_calc)
-				(*pixel_size) = 1.05 * (*pixel_size);
-			else
-				(*pixel_size) = pixel_size_calc;
-			}
-
-		/* get pixel interpolation */
-		pixel_int_use = pixel_int + 1;
-
-		/* zero the sidescan */
-		for (i=0;i<MBSYS_RESON7K_MAX_PIXELS;i++)
-			{
-			ss[i] = 0.0;
-			ssacrosstrack[i] = 0.0;
-			ssalongtrack[i] = 0.0;
-			ss_cnt[i] = 0;
-			}
-		for (i=0;i<nss;i++)
-			{
-			ssacrosstrack[i] = (*pixel_size) * (double)(i - (nss / 2));;
-			}
-
-		/* loop over raw backscatter or sidescan from the desired source,
-		 * 	putting each raw sample into the binning arrays */
-
-		/* use calibrated snippet data 
-		   error_flag = 0 is calibrated snippet data 
-		   error_flag = 1 is uncalibrated snippet data
-		   error_flag > 1 indicates a problem */
-		if (source == R7KRECID_7kCalibratedSnippetData && calibratedsnippet->error_flag < 3)
-			{
-			for (i=0;i<calibratedsnippet->number_beams;i++)
-				{
-				calibratedsnippettimeseries = (s7kr_calibratedsnippettimeseries *)&(calibratedsnippet->calibratedsnippettimeseries[i]);
-				ibeam = calibratedsnippettimeseries->beam_number;
-
-				/* only use snippets from non-null and unflagged beams */
-				/* note: errors have been observed in data produced by a Reson
-					simulator in which the detect_sample was
-					was outside the range of begin_sample to end_sample
-					- the current code effectively ignores this case because
-					sample_end < sample_start, so no samples are processed. */
-				if (mb_beam_ok(beamflag[ibeam]))
-					{
-					nsample = calibratedsnippettimeseries->end_sample - calibratedsnippettimeseries->begin_sample + 1;
-					altitude = bathymetry->depth[ibeam] + bathymetry->vehicle_height;
-					xtrack = bathymetry->acrosstrack[ibeam];
-					range = 0.5 * soundspeed * bathymetry->range[ibeam];
-					angle = RTD * beamgeometry->angle_acrosstrack[ibeam];
-					beam_foot = range * sin(DTR * beamwidth)
-								/ cos(DTR * angle);
-					sint = fabs(sin(DTR * angle));
-					nsample_use = beam_foot / ss_spacing;
-					if (sint < nsample_use * ss_spacing / beam_foot)
-					    ss_spacing_use = beam_foot / nsample_use;
-					else
-					    ss_spacing_use = ss_spacing / sint;
-/* fprintf(stderr, "spacing: %f %f n:%d sint:%f angle:%f range:%f foot:%f factor:%f\n",
-ss_spacing, ss_spacing_use,
-nsample_use, sint, angle, range, beam_foot,
-nsample_use * ss_spacing / beam_foot); */
-					sample_start = MAX(((int)calibratedsnippettimeseries->detect_sample - (nsample_use / 2)),
-								(int)calibratedsnippettimeseries->begin_sample);
-					sample_end = MIN(((int)calibratedsnippettimeseries->detect_sample + (nsample_use / 2)),
-								(int)calibratedsnippettimeseries->end_sample);
-/* fprintf(stderr,"beam:%d snippet samples: b:%d d:%d e:%d   start:%d end:%d\n",
-ibeam,calibratedsnippettimeseries->begin_sample,calibratedsnippettimeseries->detect_sample,calibratedsnippettimeseries->end_sample,sample_start,sample_end); */
-					for (k=sample_start;k<=sample_end;k++)
-						{
-						if (xtrack < 0.0)
-							xtrackss = xtrack - ss_spacing_use * (k - (int)calibratedsnippettimeseries->detect_sample);
-						else
-							xtrackss = xtrack + ss_spacing_use * (k - (int)calibratedsnippettimeseries->detect_sample);
-						kk = nss / 2
-						    + (int)(xtrackss / (*pixel_size));
-						kk = MIN(MAX(0,kk), nss-1);
-						ss[kk]  += (double) calibratedsnippettimeseries->amplitude[k-(int)calibratedsnippettimeseries->begin_sample];
-						ssalongtrack[kk] += bathymetry->alongtrack[i];
-						ss_cnt[kk]++;
-/* fprintf(stderr,"k:%d detect:%d xtrack:%f xtrackss:%f kk:%d ss:%f ss_cnt:%d\n",
-k,snippettimeseries->detect_sample,xtrack,xtrackss,kk,ss[kk],ss_cnt[kk]); */
-						}
-					}
-				}
-			}
-
-		/* use v2 snippet data */
-		else if (source == R7KRECID_7kV2SnippetData && v2snippet->error_flag == MB_NO)
-			{
-			for (i=0;i<v2snippet->number_beams;i++)
-				{
-				snippettimeseries = (s7kr_v2snippettimeseries *)&(v2snippet->snippettimeseries[i]);
-				ibeam = snippettimeseries->beam_number;
-
-				/* only use snippets from non-null and unflagged beams */
-				/* note: errors have been observed in data produced by a Reson
-					simulator in which the detect_sample was
-					was outside the range of begin_sample to end_sample
-					- the current code effectively ignores this case because
-					sample_end < sample_start, so no samples are processed. */
-				if (mb_beam_ok(beamflag[ibeam]))
-					{
-					nsample = snippettimeseries->end_sample - snippettimeseries->begin_sample + 1;
-					altitude = bathymetry->depth[ibeam] + bathymetry->vehicle_height;
-					xtrack = bathymetry->acrosstrack[ibeam];
-					range = 0.5 * soundspeed * bathymetry->range[ibeam];
-					angle = RTD * beamgeometry->angle_acrosstrack[ibeam];
-					beam_foot = range * sin(DTR * beamwidth)
-								/ cos(DTR * angle);
-					sint = fabs(sin(DTR * angle));
-					nsample_use = beam_foot / ss_spacing;
-					if (sint < nsample_use * ss_spacing / beam_foot)
-					    ss_spacing_use = beam_foot / nsample_use;
-					else
-					    ss_spacing_use = ss_spacing / sint;
-/* fprintf(stderr, "spacing: %f %f n:%d sint:%f angle:%f range:%f foot:%f factor:%f\n",
-ss_spacing, ss_spacing_use,
-nsample_use, sint, angle, range, beam_foot,
-nsample_use * ss_spacing / beam_foot); */
-					sample_start = MAX(((int)snippettimeseries->detect_sample - (nsample_use / 2)),
-								(int)snippettimeseries->begin_sample);
-					sample_end = MIN(((int)snippettimeseries->detect_sample + (nsample_use / 2)),
-								(int)snippettimeseries->end_sample);
-/* fprintf(stderr,"beam:%d snippet samples: b:%d d:%d e:%d   start:%d end:%d\n",
-ibeam,snippettimeseries->begin_sample,snippettimeseries->detect_sample,snippettimeseries->end_sample,sample_start,sample_end); */
-					for (k=sample_start;k<=sample_end;k++)
-						{
-						if (xtrack < 0.0)
-							xtrackss = xtrack - ss_spacing_use * (k - (int)snippettimeseries->detect_sample);
-						else
-							xtrackss = xtrack + ss_spacing_use * (k - (int)snippettimeseries->detect_sample);
-						kk = nss / 2
-						    + (int)(xtrackss / (*pixel_size));
-						kk = MIN(MAX(0,kk), nss-1);
-						ss[kk]  += (double) snippettimeseries->amplitude[k-(int)snippettimeseries->begin_sample];
-						ssalongtrack[kk] += bathymetry->alongtrack[i];
-						ss_cnt[kk]++;
-/* fprintf(stderr,"k:%d detect:%d xtrack:%f xtrackss:%f kk:%d ss:%f ss_cnt:%d\n",
-k,snippettimeseries->detect_sample,xtrack,xtrackss,kk,ss[kk],ss_cnt[kk]); */
-						}
-					}
-				}
-			}
-
-		/* use old snippet data */
-		else if (source == R7KRECID_7kBeamData)
-			{
-			for (i=0;i<beam->number_beams;i++)
-				{
-				snippet = (s7kr_snippet *)&(beam->snippets[i]);
-				ibeam = snippet->beam_number;
-
-				/* only use snippets from non-null and unflagged beams */
-				if (mb_beam_ok(beamflag[ibeam]))
-					{
-					nsample = snippet->end_sample - snippet->begin_sample + 1;
-					altitude = bathymetry->depth[ibeam] + bathymetry->vehicle_height;
-					xtrack = bathymetry->acrosstrack[ibeam];
-					range = 0.5 * soundspeed * bathymetry->range[ibeam];
-					angle = RTD * beamgeometry->angle_acrosstrack[ibeam];
-					beam_foot = range * sin(DTR * beamwidth)
-								/ cos(DTR * angle);
-					sint = fabs(sin(DTR * angle));
-					nsample_use = beam_foot / ss_spacing;
-					if (sint < nsample_use * ss_spacing / beam_foot)
-					    ss_spacing_use = beam_foot / nsample_use;
-					else
-					    ss_spacing_use = ss_spacing / sint;
-/* fprintf(stderr, "spacing: %f %f xtrack:%f altitude:%f n:%d sint:%f angle:%f range:%f foot:%f factor:%f\n",
-ss_spacing, ss_spacing_use,
-xtrack,altitude,
-nsample_use, sint, angle, range, beam_foot,
-nsample_use * ss_spacing / beam_foot); */
-					sample_detect = volatilesettings->sample_rate * bathymetry->range[ibeam];
-					sample_start = MAX(sample_detect - (nsample_use / 2), snippet->begin_sample);
-					sample_end = MIN(sample_detect + (nsample_use / 2), snippet->end_sample);
-					if ((beam->sample_type & 15) == 3)
-						data_uint = (unsigned int *) snippet->amplitude;
-					else if ((beam->sample_type & 15) == 2)
-						data_ushort = (unsigned short *) snippet->amplitude;
-					else
-						data_uchar = (mb_u_char *) snippet->amplitude;
-					for (k=sample_start;k<=sample_end;k++)
-						{
-						if (xtrack < 0.0)
-							xtrackss = xtrack - ss_spacing_use * (k - sample_detect);
-						else
-							xtrackss = xtrack + ss_spacing_use * (k - sample_detect);
-						kk = nss / 2
-						    + (int)(xtrackss / (*pixel_size));
-						kk = MIN(MAX(0,kk), nss-1);
-						if ((beam->sample_type & 15) == 3)
-							ss[kk]  += (double) data_uint[k-snippet->begin_sample];
-						else if ((beam->sample_type & 15) == 2)
-							ss[kk]  += (double) data_ushort[k-snippet->begin_sample];
-						else
-							ss[kk]  += (double) data_uchar[k-snippet->begin_sample];
-						ssalongtrack[kk] += bathymetry->alongtrack[ibeam];
-						ss_cnt[kk]++;
-/* fprintf(stderr,"ibeam:%d k:%d kk:%d ss_cnt:%d ss:%f xtrackss:%f %f ssalongtrack:%f \n",
-ibeam,k,kk,ss_cnt[kk],ss[kk], xtrackss, (k-nss/2)*(*pixel_size), ssalongtrack[kk]); */
-						}
-					}
-				}
-			}
-
-		/* use backscatter record - basically a pseudosidescan */
-		else if (source == R7KRECID_7kBackscatterImageData)
-			{
-			/* get acrosstrack distance versus range table from bathymetry */
-			nrangetable = 0;
-			irangenadir = 0;
-			for (i=0;i<bathymetry->number_beams;i++)
-				{
-				if (mb_beam_ok(beamflag[i]))
-					{
-					rangetable[nrangetable] = bathymetry->range[i];
-					acrosstracktable[nrangetable] = bathymetry->acrosstrack[i];
-					alongtracktable[nrangetable] = bathymetry->alongtrack[i];
-					if (nrangetable == 0 || fabs(acrosstracktable[nrangetable]) < acrosstracktablemin)
-						{
-						irangenadir = nrangetable;
-						acrosstracktablemin = fabs(acrosstracktable[nrangetable]);
-						}
-					nrangetable++;
-					}
-				}
-
-			/* lay out port side */
-			data_uchar = (mb_u_char *) backscatter->port_data;
-			data_ushort = (unsigned short *) backscatter->port_data;
-			data_uint = (unsigned int *) backscatter->port_data;
-			sample_start = rangetable[irangenadir] * volatilesettings->sample_rate;
-			sample_end = MIN(rangetable[0] * volatilesettings->sample_rate, backscatter->number_samples - 1);
-			irange = irangenadir;
-			for (i=sample_start;i<sample_end;i++)
-				{
-				range = ((double)i) / ((double)volatilesettings->sample_rate);
-				found = MB_NO;
-				for (j=irange;j>0 && found == MB_NO;j--)
-					{
-					if (range >= rangetable[j] && range < rangetable[j-1])
-						{
-						irange = j;
-						found = MB_YES;
-						}
-					}
-				factor = (range - rangetable[irange])
-							/ (rangetable[irange-1] - rangetable[irange]);
-				xtrackss = acrosstracktable[irange]
-						+ factor * (acrosstracktable[irange-1] - acrosstracktable[irange]);
-				ltrackss = alongtracktable[irange]
-						+ factor * (alongtracktable[irange-1] - alongtracktable[irange]);
-				kk = nss / 2 + (int)(xtrackss / (*pixel_size));
-				if (kk >= 0 && kk < nss)
-					{
-					if (backscatter->sample_size == 1)
-						ss[kk]  += (double) data_uchar[i];
-					else if (backscatter->sample_size == 2)
-						ss[kk]  += (double) data_ushort[i];
-					else
-						ss[kk]  += (double) data_uint[i];
-					ssalongtrack[kk] += ltrackss;
-					ss_cnt[kk]++;
-					}
-				}
-
-			/* lay out starboard side */
-			data_uchar = (mb_u_char *) backscatter->stbd_data;
-			data_ushort = (unsigned short *) backscatter->stbd_data;
-			data_uint = (unsigned int *) backscatter->stbd_data;
-			sample_start = rangetable[irangenadir] * volatilesettings->sample_rate;
-			sample_end = MIN(rangetable[nrangetable-1] * volatilesettings->sample_rate, backscatter->number_samples - 1);
-			irange = irangenadir;
-			for (i=sample_start;i<sample_end;i++)
-				{
-				range = ((double)i) / ((double)volatilesettings->sample_rate);
-				found = MB_NO;
-				for (j=irange;j<nrangetable-1 && found == MB_NO;j++)
-					{
-					if (range >= rangetable[j] && range < rangetable[j+1])
-						{
-						irange = j;
-						found = MB_YES;
-						}
-					}
-				factor = (range - rangetable[irange])
-							/ (rangetable[irange+1] - rangetable[irange]);
-				xtrackss = acrosstracktable[irange]
-						+ factor * (acrosstracktable[irange+1] - acrosstracktable[irange]);
-				ltrackss = alongtracktable[irange]
-						+ factor * (alongtracktable[irange+1] - alongtracktable[irange]);
-				kk = nss / 2 + (int)(xtrackss / (*pixel_size));
-				if (kk >= 0 && kk < nss)
-					{
-					if (backscatter->sample_size == 1)
-						ss[kk]  += (double) data_uchar[i];
-					else if (backscatter->sample_size == 2)
-						ss[kk]  += (double) data_ushort[i];
-					else
-						ss[kk]  += (double) data_uint[i];
-					ssalongtrack[kk] += ltrackss;
-					ss_cnt[kk]++;
-					}
-				}
-
-
-			}
-
-		/* average the sidescan */
-		first = nss;
-		last = -1;
-		for (k=0;k<nss;k++)
-			{
-			if (ss_cnt[k] > 0)
-				{
-				ss[k] /= ss_cnt[k];
-				ssalongtrack[k] /= ss_cnt[k];
-				first = MIN(first, k);
-				last = k;
-				}
-			else
-				ss[k] = MB_SIDESCAN_NULL;
-			}
-
-		/* interpolate the sidescan */
-		k1 = first;
-		k2 = first;
-		for (k=first+1;k<last;k++)
-			{
-			if (ss_cnt[k] <= 0)
-				{
-				if (k2 <= k)
-					{
-					k2 = k+1;
-					while (ss_cnt[k2] <= 0 && k2 < last)
-					    k2++;
-					}
-				if (k2 - k1 <= pixel_int_use)
-					{
-					ss[k] = ss[k1] + (ss[k2] - ss[k1])
-						* ((double)(k - k1)) / ((double)(k2 - k1));
-					ssacrosstrack[k] = (k - nss / 2) * (*pixel_size);
-					ssalongtrack[k] = ssalongtrack[k1]
-								+ (ssalongtrack[k2] - ssalongtrack[k1])
-									* ((double)(k - k1)) / ((double)(k2 - k1));
-					}
-				}
-			else
-				{
-				k1 = k;
-				 }
-			}
-
-		/* embed the sidescan into the processed sidescan record */
-		store->read_processedsidescan = MB_YES;
-		processedsidescan->header = bathymetry->header;
-		processedsidescan->header.Offset = R7KRECID_ProcessedSidescan;
-		processedsidescan->header.Size = MBSYS_RESON7K_RECORDHEADER_SIZE
-							+ MBSYS_RESON7K_RECORDTAIL_SIZE
-							+ R7KHDRSIZE_ProcessedSidescan
-							+ nss * 8;
-		processedsidescan->header.OffsetToOptionalData = 0;
-		processedsidescan->header.OptionalDataIdentifier = 0;
-		processedsidescan->header.RecordType = R7KRECID_ProcessedSidescan;
-		processedsidescan->serial_number = bathymetry->serial_number;
-		processedsidescan->ping_number = bathymetry->ping_number;
-		processedsidescan->multi_ping = bathymetry->multi_ping;
-		processedsidescan->recordversion = 1;
-		processedsidescan->ss_source = source;
-		processedsidescan->number_pixels = nss;
-		processedsidescan->ss_type = MB_SIDESCAN_LINEAR;
-		processedsidescan->pixelwidth = *pixel_size;
-		processedsidescan->sonardepth = -bathymetry->vehicle_height + reference->water_z;
-		processedsidescan->altitude = bathymetry->depth[iminxtrack] - processedsidescan->sonardepth;
-		for (i=0;i<MBSYS_RESON7K_MAX_PIXELS;i++)
-			{
-			processedsidescan->sidescan[i] = ss[i];
-			processedsidescan->alongtrack[i] = ssalongtrack[i];
-			}
-
-		/* print debug statements */
-		if (verbose >= 2)
-			{
-			fprintf(stderr,"\ndbg2  Sidescan regenerated in <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg2       pixels_ss:  %d\n", nss);
-			for (i=0;i<nss;i++)
-			  fprintf(stderr,"dbg2       pixel:%4d  cnt:%3d  ss:%10f  xtrack:%10f  ltrack:%10f\n",
-				i,ss_cnt[i],ss[i],
-				ssacrosstrack[i],
-				ssalongtrack[i]);
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       pixel_size:      %f\n",*pixel_size);
-		fprintf(stderr,"dbg2       swath_width:     %f\n",*swath_width);
-		fprintf(stderr,"dbg2       error:           %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:          %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mbsys_reson7k.h b/src/mbio/mbsys_reson7k.h
deleted file mode 100644
index 9b84cd6..0000000
--- a/src/mbio/mbsys_reson7k.h
+++ /dev/null
@@ -1,2737 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbsys_reson7k.h	3/3/2004
- *	$Id: mbsys_reson7k.h 2247 2015-05-29 21:28:28Z caress $
- *
- *    Copyright (c) 2004-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbsys_reson7k.h defines the MBIO data structures for handling data from
- * Reson 7k series sonars:
- *      MBF_RESON7K1 : MBIO ID 191 - Reson 7K Series sonar
- *
- * Author:	D. W. Caress
- * Date:	March 3, 2004
- *
- *
- */
-/*
- * Notes on the mbsys_reson7k data structure:
- *   1. This format is defined by the Interface Control Document
- *      for RESON SeaBat 7k format v0.42.
- *   2. Reson 7k series multibeam sonars output bathymetry, per beam
- *      amplitude, and sidescan data.
- *   3. The Reson 6046 datalogger can also log sidescan and subbottom
- *      data from other sonars.
- *   4. The 7k record consists of a data record frame (header and checksum),
- *      a record  type header, an optional record data field and an optional
- *	data field for extra  information. The optional data field typically
- *	holds non-generic sensor specific data.   *
- *   5. Navigation data may be found in three different record types.
- *      The bathymetry records (kind = MB_DATA_DATA) hold navigation
- *      and attitude data, but these values are not initially set by
- *      the Reson 6046 datalogger. In MB-System these values get set
- *      by running the program mb7kpreprocess by interpolating the
- *      the values found in either the R7KRECID_Position records
- *      (kind = MB_DATA_NAV1) or the R7KRECID_Bluefin records
- *      (kind = MB_DATA_NAV2). MB-System uses the bathymetry records as
- *      the primary navigation source, so the interpolated values are
- *      accessed by mbnavedit and, by default, mbnavlist. The raw values
- *      of the ancillary navigation records (R7KRECID_Position and
- *      R7KRECID_Bluefin) may be accessed by mbnavlist using the -N1
- *      and -N2 options, respectably.
- *   6. Attitude data may be found in three different record types.
- *      The bathymetry records (kind = MB_DATA_DATA) hold navigation
- *      and attitude data, but these values are not initially set by
- *      the Reson 6046 datalogger. In MB-System these values get set
- *      by running the program mb7kpreprocess by interpolating the
- *      the values found in either the R7KRECID_RollPitchHeave records
- *      (kind = MB_DATA_ATTITUDE) or the R7KRECID_Bluefin records
- *      (kind = MB_DATA_NAV2). MB-System uses the bathymetry records as
- *      the primary attitude source, so the interpolated values are
- *      accessed by mbnavedit and, by default, mbnavlist. The raw values
- *      of the secondary ancillary navigation records (R7KRECID_Bluefin),
- *      including attitude, may be accessed by mbnavlist using the -N2
- *      option.
- *   7. The MB-System code assumes that a Reson 7k data file will include
- *      either R7KRECID_RollPitchHeave and R7KRECID_Position records
- *      or R7KRECID_Bluefin records. Bad things will happen if the
- *      data file contains both the generic records and the bluefin
- *      records.
- */
-
-/* include mb_define.h */
-#ifndef MB_DEFINE_DEF
-#include "mb_define.h"
-#endif
-
-/*---------------------------------------------------------------*/
-/* Record ID definitions */
-
-/* 0 means no record at all */
-#define	R7KRECID_None					0
-
-/* 1000-1999 reserved for generic sensor records */
-#define R7KRECID_ReferencePoint				1000
-#define R7KRECID_UncalibratedSensorOffset		1001
-#define R7KRECID_CalibratedSensorOffset			1002
-#define R7KRECID_Position				1003
-#define R7KRECID_CustomAttitude				1004
-#define R7KRECID_Tide					1005
-#define R7KRECID_Altitude				1006
-#define R7KRECID_MotionOverGround			1007
-#define R7KRECID_Depth					1008
-#define R7KRECID_SoundVelocityProfile			1009
-#define R7KRECID_CTD					1010
-#define R7KRECID_Geodesy				1011
-#define R7KRECID_RollPitchHeave				1012
-#define R7KRECID_Heading				1013
-#define R7KRECID_SurveyLine				1014
-#define R7KRECID_Navigation				1015
-#define R7KRECID_Attitude				1016
-#define R7KRECID_Rec1022				1022
-#define R7KRECID_GenericSensorCalibration		1050
-#define R7KRECID_GenericSidescan			1200
-
-/* 2000-2999 reserved for user defined records */
-#define R7KRECID_XYZ					2000
-
-/* 3000-6999 reserved for other vendor records */
-#define R7KRECID_FSDWsidescan				3000
-#define R7KRECID_FSDWsidescanLo				0
-#define R7KRECID_FSDWsidescanHi				1
-#define R7KRECID_FSDWsubbottom				3001
-#define R7KRECID_Bluefin				3100
-#define R7KRECID_BluefinNav				0
-#define R7KRECID_BluefinEnvironmental			1
-#define R7KRECID_ProcessedSidescan		        3199
-
-/* 7000-7999 reserved for SeaBat 7k records */
-#define R7KRECID_7kVolatileSonarSettings		7000
-#define R7KRECID_7kConfiguration			7001
-#define R7KRECID_7kMatchFilter				7002
-#define R7KRECID_7kV2FirmwareHardwareConfiguration	7003
-#define R7KRECID_7kBeamGeometry				7004
-#define R7KRECID_7kCalibrationData			7005
-#define R7KRECID_7kBathymetricData			7006
-#define R7KRECID_7kBackscatterImageData			7007
-#define R7KRECID_7kBeamData				7008
-#define R7KRECID_7kVerticalDepth			7009
-#define R7KRECID_7kTVGData       			7010
-#define R7KRECID_7kImageData				7011
-#define R7KRECID_7kV2PingMotion				7012
-#define R7KRECID_7kV2DetectionSetup			7017
-#define R7KRECID_7kV2BeamformedData			7018
-#define R7KRECID_7kV2BITEData				7021
-#define R7KRECID_7kV27kCenterVersion			7022
-#define R7KRECID_7kV28kWetEndVersion			7023
-#define R7KRECID_7kV2Detection				7026
-#define R7KRECID_7kV2RawDetection			7027
-#define R7KRECID_7kV2SnippetData			7028
-#define R7KRECID_7kInstallationParameters		7030
-#define R7KRECID_7kSystemEvents				7050
-#define R7KRECID_7kSystemEventMessage			7051
-#define R7KRECID_7kTargetData				7060
-#define R7KRECID_7kDataStorageStatus			7052
-#define R7KRECID_7kCalibratedSnippetData                7058
-#define R7KRECID_7kFileHeader				7200
-#define R7KRECID_7kTrigger				7300
-#define R7KRECID_7kTriggerSequenceSetup			7301
-#define R7KRECID_7kTriggerSequenceDone			7302
-#define R7KRECID_7kTimeMessage				7400
-#define R7KRECID_7kRemoteControl			7500
-#define R7KRECID_7kRemoteControlAcknowledge		7501
-#define R7KRECID_7kRemoteControlNotAcknowledge		7502
-#define R7KRECID_7kRemoteControlSonarSettings		7503
-#define R7KRECID_7kReserved				7504
-#define R7KRECID_7kRoll					7600
-#define R7KRECID_7kPitch				7601
-#define R7KRECID_7kSoundVelocity			7610
-#define R7KRECID_7kAbsorptionLoss			7611
-#define R7KRECID_7kSpreadingLoss			7612
-#define R7KRECID_8100SonarData				8100
-
-/* 11000-11199 reserved for Payload Controller command records */
-#define R7KRECID_7kPayloadControllerCommand		11000
-#define R7KRECID_7kPayloadControllerCommandAcknowledge	11001
-#define R7KRECID_7kPayloadControllerStatus		11002
-
-/* 11200-11999 reserved for Payload Controller sensor QC records */
-
-/*---------------------------------------------------------------*/
-/* Record size definitions */
-#define	MBSYS_RESON7K_VERSIONSYNCSIZE				64
-#define	MBSYS_RESON7K_RECORDHEADER_SIZE				64
-#define	MBSYS_RESON7K_RECORDTAIL_SIZE				4
-
-/* 0 means no record at all */
-#define	R7KHDRSIZE_None						0
-
-/* 1000-1999 reserved for generic sensor records */
-#define R7KHDRSIZE_ReferencePoint				16
-#define R7KHDRSIZE_UncalibratedSensorOffset			24
-#define R7KHDRSIZE_CalibratedSensorOffset			24
-#define R7KHDRSIZE_Position					36
-#define R7KHDRSIZE_CustomAttitude				8
-#define R7KHDRSIZE_Tide						43
-#define R7KHDRSIZE_Altitude					4
-#define R7KHDRSIZE_MotionOverGround				8
-#define R7KHDRSIZE_Depth					8
-#define R7KHDRSIZE_SoundVelocityProfile				24
-#define R7KRDTSIZE_SoundVelocityProfile				8
-#define R7KHDRSIZE_CTD						36
-#define R7KRDTSIZE_CTD						20
-#define R7KHDRSIZE_Geodesy					320
-#define R7KHDRSIZE_RollPitchHeave				12
-#define R7KHDRSIZE_Heading					4
-#define R7KHDRSIZE_SurveyLine					16
-#define R7KRDTSIZE_SurveyLine					16
-#define R7KHDRSIZE_Navigation					41
-#define R7KHDRSIZE_Attitude					1
-#define R7KRDTSIZE_Attitude					18
-#define R7KHDRSIZE_Rec1022					40
-
-/* 2000-2999 reserved for user defined records */
-
-/* 3000-6999 reserved for other vendor records */
-#define R7KHDRSIZE_FSDWsidescan					32 /* includes added 12 bytes not in Reson 7k data spec */
-#define R7KHDRSIZE_FSDWsubbottom				32 /* includes added 12 bytes not in Reson 7k data spec */
-#define R7KHDRSIZE_BluefinDataFrame				32
-#define R7KHDRSIZE_FSDWchannelinfo				64
-#define R7KHDRSIZE_FSDWssheader					80
-#define R7KHDRSIZE_FSDWsbheader					240
-#define R7KHDRSIZE_ProcessedSidescan    			48
-
-/* 7000-7999 reserved for SeaBat 7k records */
-#define R7KHDRSIZE_7kVolatileSonarSettings			156
-#define R7KHDRSIZE_7kConfiguration				12
-#define R7KHDRSIZE_7kMatchFilter				24
-#define R7KHDRSIZE_7kV2FirmwareHardwareConfiguration		8
-#define R7KHDRSIZE_7kBeamGeometry				12
-#define R7KHDRSIZE_7kCalibrationData				10
-#define R7KHDRSIZE_7kBathymetricData_v4				18
-#define R7KHDRSIZE_7kBathymetricData				24
-#define R7KHDRSIZE_7kBackscatterImageData			64
-#define R7KHDRSIZE_7kBeamData					30
-#define R7KHDRSIZE_7kVerticalDepth				42
-#define R7KHDRSIZE_7kTVGData    				50
-#define R7KHDRSIZE_7kImageData					20
-#define R7KHDRSIZE_7kV2PingMotion				28
-#define R7KHDRSIZE_7kV2DetectionSetup				116
-#define R7KRDTSIZE_7kV2DetectionSetup				30
-#define R7KHDRSIZE_7kV2BeamformedData				52
-#define R7KHDRSIZE_7kV2BITEData					2
-#define R7KRDTSIZE_7kV2BITERecordData				136
-#define R7KRDTSIZE_7kV2BITEFieldData				79
-#define R7KHDRSIZE_7kV27kCenterVersion				32
-#define R7KHDRSIZE_7kV28kWetEndVersion				32
-#define R7KHDRSIZE_7kV2Detection				99
-#define R7KHDRSIZE_7kV2RawDetection				99
-#define R7KHDRSIZE_7kV2SnippetData				46
-#define R7KRDTSIZE_7kV2SnippetTimeseries			14
-#define R7KHDRSIZE_7kCalibratedSnippetData      49
-#define R7KRDTSIZE_7kCalibratedSnippetTimeseries    14
-#define R7KHDRSIZE_7kInstallationParameters			616
-#define R7KHDRSIZE_7kSystemEvents				22
-#define R7KHDRSIZE_7kSystemEventMessage				14
-#define R7KHDRSIZE_7kTargetData					121
-#define R7KHDRSIZE_7kDataStorageStatus				0
-#define R7KHDRSIZE_7kFileHeader					44
-#define R7KRDTSIZE_7kFileHeader					272
-#define R7KHDRSIZE_7kTrigger					2
-#define R7KHDRSIZE_7kTriggerSequenceSetup			2
-#define R7KHDRSIZE_7kTriggerSequenceDone			2
-#define R7KHDRSIZE_7kTimeMessage				16
-#define R7KHDRSIZE_7kRemoteControl				20
-#define R7KHDRSIZE_7kRemoteControlAcknowledge			20
-#define R7KHDRSIZE_7kRemoteControlNotAcknowledge		24
-#define R7KHDRSIZE_7kRemoteControlSonarSettings			260
-#define R7KHDRSIZE_7kReserved					543
-#define R7KHDRSIZE_7kRoll					4
-#define R7KHDRSIZE_7kPitch					4
-#define R7KHDRSIZE_7kSoundVelocity				4
-#define R7KHDRSIZE_7kAbsorptionLoss				4
-#define R7KHDRSIZE_7kSpreadingLoss				4
-#define R7KHDRSIZE_8100SonarData				16
-
-/* 11000-11199 reserved for Payload Controller command records */
-#define R7KHDRSIZE_7kPayloadControllerCommand			16
-#define R7KHDRSIZE_7kPayloadControllerCommandAcknowledge	12
-#define R7KHDRSIZE_7kPayloadControllerStatus			16
-
-/* 11200-11999 reserved for Payload Controller sensor QC records */
-
-/*---------------------------------------------------------------*/
-
-/* Device identifiers */
-#define R7KDEVID_GenericPosition	100
-#define R7KDEVID_GenericHeading		101
-#define R7KDEVID_GenericAttitude	102
-#define R7KDEVID_GenericMBES		103
-#define R7KDEVID_GenericSidescan	104
-#define R7KDEVID_GenericSBP		105
-#define R7KDEVID_TrueTime		1001
-#define R7KDEVID_CDCSMCG		2000
-#define R7KDEVID_CDCSPG			2001
-#define R7KDEVID_EmpireMagnetics	2002
-#define R7KDEVID_ResonTC4013		4013
-#define R7KDEVID_ResonDiverDat		6000
-#define R7KDEVID_Reson7kCenter		7000
-#define R7KDEVID_Reson7kUserInterface	7001
-#define R7KDEVID_ResonPDS2000		7003
-#define R7KDEVID_SeaBat7012		7012
-#define R7KDEVID_SeaBat7100		7100
-#define R7KDEVID_SeaBat7101		7101
-#define R7KDEVID_SeaBat7102		7102
-#define R7KDEVID_SeaBat7111		7111
-#define R7KDEVID_SeaBat7112		7112
-#define R7KDEVID_SeaBat7123		7123
-#define R7KDEVID_SeaBat7125		7125
-#define R7KDEVID_SeaBat7128		7128
-#define R7KDEVID_SeaBat7150		7150
-#define R7KDEVID_SeaBat7160		7160
-#define R7KDEVID_SeaBat8100		8100
-#define R7KDEVID_SeaBat8101		8101
-#define R7KDEVID_SeaBat8102		8102
-#define R7KDEVID_SeaBat8112		8111
-#define R7KDEVID_SeaBat8123		8123
-#define R7KDEVID_SeaBat8124		8124
-#define R7KDEVID_SeaBat8125		8125
-#define R7KDEVID_SeaBat8128		8128
-#define R7KDEVID_SeaBat8150		8150
-#define R7KDEVID_SeaBat8160		8160
-#define R7KDEVID_TSSDMS05		10000
-#define R7KDEVID_TSS335B		10001
-#define R7KDEVID_TSS332B		10002
-#define R7KDEVID_SeaBirdSBE37		10010
-#define R7KDEVID_Littom200		10020
-#define R7KDEVID_EdgetechFSDW		11000
-#define R7KDEVID_EdgetechFSDWSBP	11000
-#define R7KDEVID_EdgetechFSDWSSLF	11001
-#define R7KDEVID_EdgetechFSDWSSHF	11002
-#define R7KDEVID_Bluefin		11100
-#define R7KDEVID_IfremerTechsas		11200
-#define R7KDEVID_SimradRPT319		12000
-
-/*---------------------------------------------------------------*/
-
-/* Edgetech trace data format definitions */
-#define	EDGETECH_TRACEFORMAT_ENVELOPE		0 	/* 2 bytes/sample (unsigned) */
-#define	EDGETECH_TRACEFORMAT_ANALYTIC		1 	/* 4 bytes/sample (I + Q) */
-#define	EDGETECH_TRACEFORMAT_RAW		2 	/* 2 bytes/sample (signed) */
-#define	EDGETECH_TRACEFORMAT_REALANALYTIC	3 	/* 2 bytes/sample (signed) */
-#define	EDGETECH_TRACEFORMAT_PIXEL		4 	/* 2 bytes/sample (signed) */
-
-/*---------------------------------------------------------------*/
-
-/* Bluefin data frame definitions */
-#define	BLUEFIN_MAX_FRAMES			25 	/* Maximum number of Bluefin
-								data frames contained
-								in a Bluefin data record */
-
-/*---------------------------------------------------------------*/
-
-/* Structure size definitions */
-#define	MBSYS_RESON7K_BUFFER_STARTSIZE	32768
-#define	MBSYS_RESON7K_MAX_DEVICE	10
-#define MBSYS_RESON7K_MAX_RECEIVERS	1024
-#define	MBSYS_RESON7K_MAX_BEAMS		1024
-#define	MBSYS_RESON7K_MAX_PIXELS	4096
-
-typedef struct s7k_time_struct
-{
-    unsigned short  Year;			/* Year                 u16 0 - 65535 */
-    unsigned short  Day;			/* Day                  u16 1 - 366 */
-
-    float           Seconds;			/* Seconds              f32 0.000000 - 59.000000 */
-
-    mb_u_char       Hours;			/* Hours                u8  0 - 23 */
-    mb_u_char       Minutes;			/* Minutes              u8  0 - 59 */
-}
-s7k_time;
-
-typedef struct s7k_header_struct
-{
-    unsigned short  Version;                    /* Version              u16 Version of this frame (e.g.: 1, 2 etc.) */
-    unsigned short  Offset;                     /* Offset               u16 Offset in bytes from the start of the sync
-    												pattern to the start of the DATA SECTION.
-												This allows for expansion of the header
-												whilst maintaining backward compatibility. */
-
-    unsigned int   SyncPattern;			/* Sync pattern         u32 0x0000FFFF */
-    unsigned int   Size;			/* Size                 u32 Size in bytes of this record from the start
-    												of the version field to the end of the
-												Checksum. It includes the embedded data size. */
-    unsigned int   OffsetToOptionalData;	/* Data offset          u32 Offset in bytes to optional data field from
-    												start of record. Zero implies no optional data. */
-    unsigned int   OptionalDataIdentifier;	/* Data idenfitifer     u32 Identifier for optional data field. Zero for
-    	`											no optional field. This identifier is
-												described with each record type. */
-    s7k_time 	   s7kTime;			/* 7KTIME               u8*10   UTC.*/
-    unsigned short Reserved;			/* Reserved  */
-    unsigned int   RecordType;			/* Record type          u32 Unique identifier of indicating the type of
-    												data embedded in this record. */
-    unsigned int   DeviceId;			/* Device identifier    u32 Identifier of the device to which this datum pertains. */
-    unsigned short Reserved2;			/* Reserved  */
-    unsigned short SystemEnumerator;		/* System enumerator	The enumerator is used to differentiate between devices with the
-    									same device identifiers in one installation/system. It is up to
-									each application to decide what number to populate this field with.  */
-    unsigned int   DataSetNumber;		/* Data set             u32 Data set number - OBSOLETE in version 4 header */
-    unsigned int   RecordNumber;		/* Record count         u32 Sequential record counter. */
-
-    char           PreviousRecord[8];		/* Previous record      i64 Pointer to the previous record of the same type
-    												(in bytes from start of file). This is an
-												optional field for files and shall be -1
-												if not used.
-												- OBSOLETE in version 4 header */
-    char           NextRecord[8];		/* Next record          i64 Pointer to the next record of the same type in
-    												bytes from start of file. This is an optional
-												field for files and shall be -1 if not used.
-												- OBSOLETE in version 4 header */
-
-    unsigned short Flags;			/* Flags                u16 BIT FIELD:
-    										Bit 0 - Checksum
-											0 - invalid checksum
-											1 - valid checksum
-										Bit 1 - Reserved
-										Bit 2 - Fragmentation
-											0 - data unfragmented
-											1 - fragmented sequence */
-    unsigned short Reserved3;			/* Reserved  */
-    unsigned int Reserved4;			/* Reserved  		- NEW in version 4 header */
-    unsigned int FragmentedTotal;		/* Total Fragmented	Total records in fragmented data record set (if flag is set) - NEW in version 4 header */
-    unsigned int FragmentNumber;		/* Fragment number	Fragment number (if flag is set) - NEW in version 4 header */
-
-    /* Following this header is:
-    	DATA SECTION							xx  Dynamic Record type specific data.
-    	Checksum							u32 Sum of bytes in data section
-										(optional, depends on bit 1 of Flags field).
-										Note: the checksum field  should be computed
-										as a 64 bit unsigned integer  with the least
-										significant 32 bits used to populate  this field
-										thus ensuring a valid checksum and  avoiding
-										an explicit overflow.  */
-}
-s7k_header;
-
-/* Reference point information (record 1000) */
-/*  Note: these offsets should be zero for submersible vehicles */
-typedef struct s7kr_reference_struct
-{
-	s7k_header	header;
-	float		offset_x;		/* Vehicle's X reference point ot center of gravity (meters) */
-	float		offset_y;		/* Vehicle's Y reference point ot center of gravity (meters) */
-	float		offset_z;		/* Vehicle's Z reference point ot center of gravity (meters) */
-	float		water_z;		/* Vehicle's water level to center of gravity (meters) */
-}
-s7kr_reference;
-
-/* Sensor uncalibrated offset position information (record 1001) */
-typedef struct s7kr_sensoruncal_struct
-{
-	s7k_header	header;
-	float		offset_x;		/* Sensor X offset from vehicle reference point (meters) */
-	float		offset_y;		/* Sensor Y offset from vehicle reference point (meters) */
-	float		offset_z;		/* Sensor Z offset from vehicle reference point (meters) */
-	float		offset_roll;		/* Sensor roll offset (radians - port up is positive) */
-	float		offset_pitch;		/* Sensor pitch offset (radians - bow up is positive) */
-	float		offset_yaw;		/* Sensor yaw offset (radians - bow right is positive) */
-}
-s7kr_sensoruncal;
-
-/* Sensor calibrated offset position information (record 1002) */
-typedef struct s7kr_sensorcal_struct
-{
-	s7k_header	header;
-	float		offset_x;		/* Sensor X offset from vehicle reference point (meters) */
-	float		offset_y;		/* Sensor Y offset from vehicle reference point (meters) */
-	float		offset_z;		/* Sensor Z offset from vehicle reference point (meters) */
-	float		offset_roll;		/* Sensor roll offset (radians - port up is positive) */
-	float		offset_pitch;		/* Sensor pitch offset (radians - bow up is positive) */
-	float		offset_yaw;		/* Sensor yaw offset (radians - bow right is positive) */
-}
-s7kr_sensorcal;
-
-/* Position (record 1003) */
-typedef struct s7kr_position_struct
-{
-	s7k_header	header;
-	unsigned int	datum;			/* 0=WGS84; others not yet defined */
-	float		latency;		/* Position sensor time latency (seconds) */
-	double		latitude;		/* Latitude (radians) */
-	double		longitude;		/* Longitude (radians) */
-	double		height;			/* Height relative to datum (meters) */
-	mb_u_char	type;			/* Position type flag:
-							0: Geographical coordinates
-							1: Grid coordinates */
-	mb_u_char	utm_zone;		/* UTM zone */
-	mb_u_char	quality;		/* Quality flag
-							0: Navigation data
-							1: Dead reckoning */
-	mb_u_char	method;			/* Positioning method
-							0: GPS
-							1: DGPS
-							2: Start of inertial positioning system from GPS
-							3: Start of inertial positioning system from DGPS
-							4: Start of inertial positioning system from bottom correlation
-							5: Start of inertial positioning system from bottom object
-							6: Start of inertial positioning system from inertial positioning
-							7: Start of inertial positioning system from optional data
-							8: Stop of inertial positioning system from GPS
-							9: Stop of inertial positioning system from DGPS
-							10: Stop of inertial positioning system from bottom correlation
-							11: Stop of inertial positioning system from bottom object
-							12: Stop of inertial positioning system from inertial positioning
-							13: Stop of inertial positioning system from optional data
-							14: Optional data
-							>14: Reserved */
-}
-s7kr_position;
-
-/* Custom attitude (record 1004) */
-typedef struct s7kr_customattitude_struct
-{
-	s7k_header	header;
-	mb_u_char	bitfield;		/* Boolean bitmask indicating which attitude fields are in data
-								0: pitch (radians - float)
-								1: roll (radians - float)
-								2: heading (radians - float)
-								3: heave (meters - float)
-								4-7: reserved */
-	mb_u_char	reserved;		/* reserved field */
-	unsigned short	n;			/* number of fields */
-	float		frequency;		/* sample rate (samples/second) */
-	int		nalloc;			/* number of samples allocated */
-	float		*pitch;
-	float		*roll;
-	float		*heading;
-	float		*heave;
-	float		*pitchrate;
-	float		*rollrate;
-	float		*headingrate;
-	float		*heaverate;
-}
-s7kr_customattitude;
-
-/* Tide (record 1005) */
-typedef struct s7kr_tide_struct
-{
-	s7k_header	header;
-	float		tide;			/* height correction above mean sea level (meters) */
-	unsigned short	source;			/* tide data source: 0 - table; 1- gauge */
-	mb_u_char	flags;			/* Gauge and position validity flags
-							Bit 0: 0/1 for gauge id valid/invalid
-							Bit 1: 0/1 for position valid/invalid */
-	unsigned short	gauge;			/* Optional field to permit discrimination
-							between different devices */
-	unsigned int	datum;			/* 0=WGS84; others not yet defined */
-	float		latency;		/* Position sensor time latency (seconds) */
-	double		latitude;		/* Latitude (radians) */
-	double		longitude;		/* Longitude (radians) */
-	double		height;			/* Height relative to datum (meters) */
-	mb_u_char	type;			/* Position type flag:
-							0: Geographical coordinates
-							1: Grid coordinates */
-	mb_u_char	utm_zone;		/* UTM zone */
-}
-s7kr_tide;
-
-/* Altitude (record 1006) */
-typedef struct s7kr_altitude_struct
-{
-	s7k_header	header;
-	float		altitude;		/* altitude above seafloor (meters) */
-}
-s7kr_altitude;
-
-/* Motion over ground (record 1007) */
-typedef struct s7kr_motion_struct
-{
-	s7k_header	header;
-	mb_u_char	bitfield;		/* Boolean bitmask indicating which motion over ground fields are in data
-							0: X,Y,Z speed (m/s - 3 X float)
-							1: X,Y,Z acceleration (m/s**2 - 3 X float)
-							2-7: reserved */
-	mb_u_char	reserved;		/* reserved field */
-	unsigned short	n;			/* number of fields */
-	float		frequency;		/* sample rate (samples/second) */
-	int		nalloc;			/* number of samples allocated */
-	float		*x;
-	float		*y;
-	float		*z;
-	float		*xa;
-	float		*ya;
-	float		*za;
-}
-s7kr_motion;
-
-/* Depth (record 1008) */
-typedef struct s7kr_depth_struct
-{
-	s7k_header	header;
-	mb_u_char	descriptor;		/* Depth descriptor:
-							0 = depth to sensor
-							1 = water depth */
-	mb_u_char	correction;		/* Correction flag:
-							0 = raw depth as measured
-							1 = corrected depth (relative to mean sea level) */
-	unsigned short	reserved;		/* reserved field */
-	float		depth;			/* depth (meters) */
-}
-s7kr_depth;
-
-/* Sound velocity profile (record 1009) */
-typedef struct s7kr_svp_struct
-{
-	s7k_header	header;
-	mb_u_char	position_flag;		/* Position validity flag:
-							0: invalid position fields
-							1: valid position field */
-	mb_u_char	reserved1;		/* reserved field */
-	unsigned short	reserved2;		/* reserved field */
-	double		latitude;		/* Latitude (radians) */
-	double		longitude;		/* Longitude (radians) */
-	unsigned int	n;			/* number of fields */
-	int		nalloc;			/* number of samples allocated */
-	float		*depth;			/* depth (meters) */
-	float		*sound_velocity;	/* sound velocity (meters/second) */
-}
-s7kr_svp;
-
-/* CTD (record 1010) */
-typedef struct s7kr_ctd_struct
-{
-	s7k_header	header;
-	float		frequency;		/* Sample rate */
-	mb_u_char	velocity_source_flag;	/* Velocity source flag:
-							0: not computed
-							1: CTD
-							2: user computed */
-	mb_u_char	velocity_algorithm;	/* Velocity algorithm flag:
-							0: not computed
-							1: Checn Millero
-							2: Delgrosso */
-	mb_u_char	conductivity_flag;	/* Conductivity flag:
-							0: conductivity
-							1: salinity */
-	mb_u_char	pressure_flag;		/* Pressure flag:
-							0: pressure
-							1: depth */
-	mb_u_char	position_flag;		/* Position validity flag:
-							0: invalid position fields
-							1: valid position field */
-	mb_u_char	validity;		/* Sample content validity:
-							Bit 0: conductivity/salinity
-							Bit 1: water temperature
-							Bit 2: pressure/depth
-							Bit 3: sound velocity
-							Bit 4: absorption */
-	unsigned short	reserved;		/* Reserved field */
-	double		latitude;		/* Latitude (radians) */
-	double		longitude;		/* Longitude (radians) */
-	float		sample_rate;		/* Sample rate */
-	unsigned int	n;			/* Number of fields */
-	int		nalloc;			/* Number of samples allocated */
-	float		*conductivity_salinity;	/* Conductivity (s/m) or salinity (ppt) */
-	float		*temperature;		/* Temperature (degrees celcius) */
-	float		*pressure_depth;	/* Pressure (pascals) or depth (meters) */
-	float		*sound_velocity;	/* Sound velocity (meters/second) */
-	float		*absorption;		/* Sound velocity absorption (dB/second) */
-}
-s7kr_ctd;
-
-/* Geodesy (record 1011) */
-typedef struct s7kr_geodesy_struct
-{
-	s7k_header	header;
-	char		spheroid[32];		/* Text description of the spheroid name (e.g. "WGS84") */
-	double		semimajoraxis;		/* Semi-major axis in meters (e.g. 6378137.0 for WGS84) */
-	double		flattening;		/* Inverse flattening in meters (e.g. 298.257223563 for WGS84) */
-	char		reserved1[16];		/* Reserved space */
-	char		datum[32];		/* Datum name (e.g. "WGS84") */
-	unsigned int	calculation_method;	/* Data calculation method:
-							0 - Molodensky
-							1 - Bursa / Wolfe
-							2 - DMA MRE
-							3 - NADCON
-							4 - HPGN
-							5 - Canadian National Transformation V2 */
-	unsigned int	number_parameters;	/* Seven parameter transformation supported */
-	double		dx;			/* X shift (meters) */
-	double		dy;			/* Y shift (meters) */
-	double		dz;			/* Z shift (meters) */
-	double		rx;			/* X rotation (degrees) */
-	double		ry;			/* Y rotation (degrees) */
-	double		rz;			/* Z rotation (degrees) */
-	double		scale;			/* Scale */
-	char		reserved2[35];		/* Reserved for implementation of 9 parameter transformation */
-	char		grid_name[32];		/* Name of grid system in use: (e.g. "UTM") */
-	mb_u_char	distance_units;		/* Grid distance units:
-							0 - meters
-							1 - feet
-							2 - yards
-							3 - US survey feet
-							4 - km
-							5 - miles
-							6 - US survey miles
-							7 - nautical miles
-							8 - chains
-							9 - links */
-	mb_u_char	angular_units;		/* Grid angulat units:
-							0 - radians
-							1 - degrees
-							2 - degrees, minutes, seconds
-							3 - gradians
-							4 - arc-seconds */
-	double		latitude_origin;	/* Latitude of origin */
-	double		central_meriidan;	/* Central meridian */
-	double		false_easting;		/* False easting (meters) */
-	double		false_northing;		/* False northing */
-	double		central_scale_factor;	/* Central scale factor */
-	int		custum_identifier;	/* Identifier for optional field definition in 7k record.
-							Used to define projection specific parameters.
-							-2 - custom
-							-1 - not used */
-	char		reserved3[50];		/* Reserved field */
-}
-s7kr_geodesy;
-
-/* Roll pitch heave (record 1012) */
-typedef struct s7kr_rollpitchheave_struct
-{
-	s7k_header	header;
-	float		roll;			/* Roll (radians) */
-	float		pitch;			/* Pitch (radians) */
-	float		heave;			/* Heave (m) */
-}
-s7kr_rollpitchheave;
-
-/* Heading (record 1013) */
-typedef struct s7kr_heading_struct
-{
-	s7k_header	header;
-	float		heading;		/* Heading (radians) */
-}
-s7kr_heading;
-
-/* Survey Line (record 1014) */
-typedef struct s7kr_surveyline_struct
-{
-	s7k_header	header;
-	unsigned short	n;			/* Number of points */
-	unsigned short	type;			/* Position type flag:
-							0: Geographical coordinates
-							1: Grid coordinates */
-	float		turnradius;		/* Turn radius between line segments
-							(meters, 0 = no curvature in turns) */
-	char		name[64];		/* Line name */
-	int		nalloc;			/* Number of points allocated */
-	double		*latitude;		/* Latitude (radians, -pi/2 to pi/2) */
-	double		*longitude;		/* Longitude (radians -pi to pi) */
-}
-s7kr_surveyline;
-
-/* Navigation (record 1015) */
-typedef struct s7kr_navigation_struct
-{
-	s7k_header	header;
-	mb_u_char	vertical_reference;	/* Vertical reference:
-							1 = Ellipsoid
-							2 = Geoid
-							3 = Chart datum */
-	double		latitude;		/* Latitude (radians, -pi/2 to pi/2) */
-	double		longitude;		/* Longitude (radians -pi to pi) */
-	float		position_accuracy;	/* Horizontal position accuracy (meters) */
-	float		height;			/* Height of vessel reference point above
-							vertical reference (meters) */
-	float		height_accuracy;	/* Height accuracy (meters) */
-	float		speed;			/* Speed over ground (meters/sec) */
-	float		course;			/* Course over ground (radians) */
-	float		heading;		/* Heading (radians) */
-}
-s7kr_navigation;
-
-/* Attitude (record 1016) */
-typedef struct s7kr_attitude_struct
-{
-	s7k_header	header;
-	mb_u_char	n;			/* number of datasets */
-	int		nalloc;			/* number of samples allocated */
-	unsigned short	*delta_time;		/* Time difference with record timestamp (msec) */
-	float		*roll;			/* Roll (radians) */
-	float		*pitch;			/* Pitch (radians) */
-	float		*heave;			/* Heave (m) */
-	float		*heading;		/* Heading (radians) */
-}
-s7kr_attitude;
-
-/* Unknown record 1022 (record 1022) */
-typedef struct s7kr_rec1022_struct
-{
-	s7k_header	header;
-	mb_u_char	data[R7KHDRSIZE_Rec1022];/* raw bytes in unknown record */
-}
-s7kr_rec1022;
-
-/* Edgetech sidescan or subbottom channel header data */
-typedef struct s7k_fsdwchannel_struct
-{
-	mb_u_char	number;			/* Channel number (0 to number channels - 1) */
-	mb_u_char	type;			/* Channel type:
-								0 - port
-								1 - starboard */
-	mb_u_char	data_type;		/* Channel data type:
-								0 - slant range
-								1 - ground range */
-	mb_u_char	polarity;		/* Channel polarity
-								0 - bipolar
-								1 - unipolar */
-	mb_u_char	bytespersample;		/* Bytes per sample of the imagery */
-	char		reserved1[3];		/* Reserved */
-	unsigned int	number_samples;		/* Number of samples in this channel */
-	unsigned int	start_time;		/* Start of first sample in microseconds relative
-								to the ping time stamp */
-	unsigned int	sample_interval;		/* Data sample interval in microseconds */
-	float		range;			/* Slant range or ground range in meters and
-								depends on the data type field above */
-	float		voltage;			/* Analogue maximum amplitude. Should be -1 if not used */
-	char		name[16];		/* Channel name */
-	char		reserved2[20];		/* Reserved */
-	int		data_alloc;		/* number of bytes allocated for data array */
-	char		*data;
-}
-s7k_fsdwchannel;
-
-/* Edgetech sidescan header data */
-typedef struct s7k_fsdwssheader_struct
-{
-unsigned short subsystem;		/*   0 -   1 : Subsystem (0 .. n) */
-unsigned short channelNum;		/*   2 -   3 : Channel Number (0 .. n) */
-unsigned int pingNum;			/*   4 -   7 : Ping number (increments with ping) */
-unsigned short packetNum;		/*   8 -   9 : Packet number (1..n) Each ping starts with packet 1 */
-unsigned short trigSource;		/*  10 -  11 : TriggerSource (0 = internal, 1 = external) */
-unsigned int samples;			/*  12 -  15 : Samples in this packet */
-unsigned int sampleInterval;		/*  16 -  19 : Sample interval in ns of stored data */
-unsigned int startDepth;		/*  20 -  23 : starting Depth (window offset) in samples */
-short weightingFactor;			/*  24 -  25 : -- defined as 2 -N volts for lsb */
-unsigned short ADCGain;			/*  26 -  27 : Gain factor of ADC */
-unsigned short ADCMax;			/*  28 -  29 : Maximum absolute value for ADC samples for this packet */
-unsigned short rangeSetting;		/*  30 -  31 : Range Setting (meters X 10) */
-unsigned short pulseID;			/*  32 -  33 : Unique pulse identifier */
-unsigned short markNumber;		/*  34 -  35 : Mark Number (0 = no mark) */
-unsigned short dataFormat;		/*  36 -  37 : Data format */
-					/*   0 = 1 short  per sample  - envelope data */
-					/*   1 = 2 shorts per sample  - stored as real(1), imag(1), */
-					/*   2 = 1 short  per sample  - before matched filter (raw) */
-					/*   3 = 1 short  per sample  - real part analytic signal */
-					/*   NOTE: For type = 1, the total number of bytes of data to follow is */
-					/*   4 * samples.  For all other types the total bytes is 2 * samples */
-unsigned short reserved;		/*  38 -  39 : Reserved field to round up to a 32-bit word boundary */
-/* -------------------------------------------------------------------- */
-/* computer date / time data acquired                                   */
-/* -------------------------------------------------------------------- */
-unsigned int millisecondsToday;		/*  40 -  43 : Millieconds today */
-short year;				/*  44 -  45 : Year */
-unsigned short day;			/*  46 -  47 : Day of year (1 - 366) */
-unsigned short hour;			/*  48 -  49 : Hour of day (0 - 23) */
-unsigned short minute;			/*  50 -  51 : Minute (0 - 59) */
-unsigned short second;			/*  52 -  53 : Second (0 - 59) */
-/* -------------------------------------------------------------------- */
-/* Auxillary sensor information */
-/* -------------------------------------------------------------------- */
-short heading;				/*  54 -  55 : Compass heading (minutes) */
-short pitch;				/*  56 -  57 : Pitch (minutes) */
-short roll;				/*  58 -  59 : Roll (minutes) */
-short heave;				/*  60 -  61 : Heave (centimeters) */
-short yaw;				/*  62 -  63 : Yaw (minutes) */
-unsigned int depth;			/*  64 -  67 : Vehicle depth (centimeters) */
-short temperature;			/*  68 -  69 : Temperature (degrees Celsius X 10) */
-char reserved2[2];			/*  70 -  71 : Reserved for future use */
-int longitude;				/*  72 -  75 : 0.01 Longitude (arc sec) - Reserved for future use by Edgetech */
-int latitude;				/*  76 -  79 : 0.01 Latitude (arc sec) - Reserved for future use by Edgetech */
-}
-s7k_fsdwssheader;
-
-/* Edgetech segy header data */
-typedef struct s7k_fsdwsegyheader_struct
-{
-int sequenceNumber; 			/* 0-3 : Trace Sequence Number (always 0) ** */
-unsigned int startDepth;          	/* 4-7 : Starting depth (window offset) in samples. */
-unsigned int pingNum;              	/* 8-11: Ping number (increments with ping) ** */
-unsigned int channelNum;           	/* 12-15 : Channel Number (0 .. n) ** */
-short unused1[6];          		/* 16-27 */
-
-short traceIDCode;         		/* 28-29 : ID Code (always 1 => seismic data) ** */
-
-short unused2[2];     			/* 30-33 */
-short dataFormat;			/* 34-35 : DataFormatType */
-					/*   0 = 1 short  per sample  - envelope data */
-					/*   1 = 2 shorts per sample, - stored as real(1), imag(1), */
-					/*   2 = 1 short  per sample  - before matched filter */
-					/*   3 = 1 short  per sample  - real part analytic signal */
-					/*   4 = 1 short  per sample  - pixel data / ceros data */
-short NMEAantennaeR;			/* 36-37 : Distance from towfish to antennae in cm */
-short NMEAantennaeO;			/* 38-39 : Distance to antennae starboard direction in cm */
-char RS232[32];				/* 40-71 : Reserved for RS232 data - TBD */
-/* -------------------------------------------------------------------- */
-/* Navigation data :                                                    */
-/* If the coorUnits are seconds(2), the x values represent longitude    */
-/* and the y values represent latitude.  A positive value designates    */
-/* the number of seconds east of Greenwich Meridian or north of the     */
-/* equator.                                                             */
-/* -------------------------------------------------------------------- */
-int sourceCoordX;			/* 72-75 : 0.01 arc seconds - original Meters or Seconds of Arc */
-int sourceCoordY;			/* 76-79 : 0.01 arc seconds - original Meters or Seconds of Arc */
-int groupCoordX;			/* 80-83 : mm or 10000 * (Minutes of Arc) */
-int groupCoordY;			/* 84-87 : mm or 10000 * (Minutes of Arc) */
-short coordUnits;			/* 88-89 : Units of coordinates - 1->length (x /y), 2->seconds of arc */
-char annotation[24];			/* 90-113 : Annotation string */
-unsigned short samples;			/* 114-115 : Samples in this packet ** */
-					/* Note:  Large sample sizes require multiple packets. */
-unsigned int sampleInterval;		/* 116-119 : Sample interval in ns of stored data ** */
-unsigned short ADCGain;			/* 120-121 : Gain factor of ADC */
-short pulsePower;			/* 122-123 : user pulse power setting (0 - 100) percent */
-short correlated;			/* 124-125 : correlated data 1 - No, 2 - Yes */
-unsigned short startFreq;		/* 126-127 : Starting frequency in 10 * Hz */
-unsigned short endFreq;			/* 128-129 : Ending frequency in 10 * Hz */
-unsigned short sweepLength;		/* 130-131 : Sweep length in ms */
-short unused7[4];			/* 132-139 */
-unsigned short aliasFreq;		/* 140-141 : alias Frequency (sample frequency / 2) */
-unsigned short pulseID;			/* 142-143 : Unique pulse identifier */
-short unused8[6];			/* 144-155 */
-short year;				/* 156-157 : Year data recorded (CPU time) */
-short day;				/* 158-159 : day */
-short hour;				/* 160-161 : hour */
-short minute;				/* 162-163 : minute */
-short second;				/* 164-165 : second */
-short timeBasis;			/* 166-167 : Always 3 (other not specified by standard) */
-short weightingFactor;			/* 168-169 :  weighting factor for block floating point expansion */
-					/*            -- defined as 2 -N volts for lsb */
-short unused9;				/* 170-171 : */
-/* -------------------------------------------------------------------- */
-/* From pitch/roll/temp/heading sensor */
-/* -------------------------------------------------------------------- */
-short heading;				/* 172-173 : Compass heading (100 * degrees) -180.00 to 180.00 degrees */
-short pitch;				/* 174-175 : Pitch */
-short roll;				/* 176-177 : Roll */
-short temperature;			/* 178-179 : Temperature (10 * degrees C) */
-/* -------------------------------------------------------------------- */
-/* User defined area from 180-239                                       */
-/* -------------------------------------------------------------------- */
-short heaveCompensation;		/* 180-181 : Heave compensation offset (samples) */
-short trigSource;   			/* 182-183 : TriggerSource (0 = internal, 1 = external) */
-unsigned short markNumber;		/* 184-185 : Mark Number (0 = no mark) */
-short NMEAHour;				/* 186-187 : Hour */
-short NMEAMinutes;			/* 188-189 : Minutes */
-short NMEASeconds;			/* 190-191 : Seconds */
-short NMEACourse;			/* 192-193 : Course */
-short NMEASpeed;			/* 194-195 : Speed */
-short NMEADay;				/* 196-197 : Day */
-short NMEAYear;				/* 198-199 : Year */
-unsigned int millisecondsToday;		/* 200-203 : Millieconds today */
-unsigned short ADCMax;			/* 204-205 : Maximum absolute value for ADC samples for this packet */
-short calConst;				/* 206-207 : System constant in tenths of a dB */
-short vehicleID;			/* 208-209 : Vehicle ID */
-char softwareVersion[6];		/* 210-215 : Software version number */
-/* Following items are not in X-Star */
-int sphericalCorrection;		/* 216-219 : Initial spherical correction factor (useful for multiping /*/
-					/* deep application) * 100 */
-unsigned short packetNum;		/* 220-221 : Packet number (1 - N) (Each ping starts with packet 1) */
-short ADCDecimation;			/* 222-223 : A/D decimation before FFT */
-short decimation;			/* 224-225 : Decimation factor after FFT */
-short unuseda[7];			/* 226-239 */
-}
-s7k_fsdwsegyheader;
-
-/* Edgetech FS-DW sidescan (record 3000) */
-typedef struct s7kr_fsdwss_struct
-{
-	s7k_header	header;
-	int		msec_timestamp;		/* Relative millisecond timer value */
-	int		ping_number;		/* Ping number as received from the Edgetech subsystem */
-	int		number_channels;	/* Number of imagery channels to follow (typically 2) */
-	int		total_bytes;		/* Total bytes of channel data (and headers) to follow
-							RTH (record type header) (including optional data) */
-	int		data_format;		/* Data format:
-							0 - envelope
-;							1 - I and Q (complex) */
-	s7k_fsdwchannel	channel[2];		/* Channel header and data */
-	s7k_fsdwssheader ssheader[2];	/* Edgetech sidescan header */
-}
-s7kr_fsdwss;
-
-/* Edgetech FS-DW subbottom (record 3001) */
-typedef struct s7kr_fsdwsb_struct
-{
-	s7k_header	header;
-	int		msec_timestamp;		/* Relative millisecond timer value */
-	int		ping_number;		/* Ping number as received from the Edgetech subsystem */
-	int		number_channels;	/* Number of imagery channels to follow (typically 2) */
-	int		total_bytes;		/* Total bytes of channel data (and headers) to follow
-							RTH (record type header) (including optional data) */
-	int		data_format;		/* Data format:
-							0 - envelope
-							1 - I and Q (complex) */
-	s7k_fsdwchannel	channel;		/* Channel header and data */
-	s7k_fsdwsegyheader segyheader;		/* Segy header for subbottom trace */
-}
-s7kr_fsdwsb;
-
-/* Bluefin Navigation Data Frame (can be included in record 3100) */
-typedef struct s7k_bluefin_nav_struct
-{
-	int		packet_size;		/* size in bytes of this packet including the
-							header and appended data */
-	unsigned short	version;		/* Version of this frame */
-	unsigned short	offset;			/* Offset in bytes to the start of data from the
-							start of this packet */
-	int		data_type;		/* Data type identifier
-							0 - Navigation data
-							1 - Environment data */
-	int		data_size;		/* Size of data in bytes */
-    	s7k_time 	s7kTime;		/* 7KTIME               u8*10   UTC.*/
-	unsigned int	checksum;		/* Checksum for all bytes in record */
-	short		timedelay;		/* Delay of position and altitude time values
-							compared to Reson 7k time values (msec)
-							- add this value to the position and
-							altitude time values to get the
-							times synced to the 7k multibeam data */
-	unsigned int	quality;		/* Kearfott INS quality and mode info */
-	double		latitude;		/* Latitude (radians) */
-	double		longitude;		/* Longitude (radians) */
-	float		speed;			/* Speed (m/sec) */
-	double		depth;			/* Vehicle depth (m) */
-	double		altitude;		/* Vehicle altitude (m) */
-	float		roll;			/* Vehicle roll (radians) */
-	float		pitch;			/* Vehicle pitch (radians) */
-	float		yaw;			/* Vehicle yaw (radians) */
-	float		northing_rate;		/* Vehicle northing rate (m/sec) */
-	float		easting_rate;		/* Vehicle easting rate (m/sec) */
-	float		depth_rate;		/* Vehicle depth rate (m/sec) */
-	float		altitude_rate;		/* Vehicle altitude rate (m/sec) */
-	float		roll_rate;		/* Vehicle roll rate (radians/sec) */
-	float		pitch_rate;		/* Vehicle pitch rate (radians/sec) */
-	float		yaw_rate;		/* Vehicle yaw rate (radians/sec) */
-	double		position_time;		/* Vehicle position time (unix sec) */
-	double		depth_time;		/* Vehicle depth time (unix sec) */
-}
-s7k_bluefin_nav;
-
-/* Bluefin Environmental Data Frame (can be included in record 3100) */
-typedef struct s7k_bluefin_environmental_struct
-{
-	int		packet_size;		/* size in bytes of this packet including the
-							header and appended data */
-	unsigned short	version;		/* Version of this frame */
-	unsigned short	offset;			/* Offset in bytes to the start of data from the
-							start of this packet */
-	int		data_type;		/* Data type identifier
-							0 - Navigation data
-							1 - Environment data */
-	int		data_size;		/* Size of data in bytes */
-    	s7k_time	s7kTime;		/* 7KTIME               u8*10   UTC.*/
-	unsigned int	checksum;		/* Checksum for all bytes in record */
-	short		reserved1;
-	unsigned int	quality;
-	float		sound_speed;		/* Sound speed (m/sec) */
-	float		conductivity;		/* Conductivity (S/m) */
-	float		temperature;		/* Temperature (deg C) */
-	float		pressure;		/* Pressure (dBar) */
-	float		salinity;		/* Salinity (psu) */
-	double		ctd_time;		/* CTD sample time (unix sec) */
-	double		temperature_time;	/* Temperature sample time (unix sec) */
-	double		surface_pressure;	/* dBar */
-	int		temperature_counts;	/* thermister A/D counts */
-	float		conductivity_frequency;	/* Hz */
-	int		pressure_counts;	/* strain gauge pressure sensor A/D counts */
-	float		pressure_comp_voltage;	/* Volts */
-						/* 5/10/2009 R/V Thompson TN134 Lau Basin
-							- added support for five channels
-							  of data from analog sensors integrated
-							  with the MBARI Mapping AUV
-							- Each channel is stored as unsigned 16 bit
-							  integers representing -5V to +5V
-							- initial use is for PMEL eH and optical
-							  backscatter sensors */
-	int		sensor_time_sec;	/* Ancilliary sensor time (unix seconds) */
-	int		sensor_time_nsec;	/* Ancilliary sensor time (nanno seconds) */
-	unsigned short	sensor1;		/* voltage: 0 = -5.00V, 65535 = +5.00V */
-	unsigned short	sensor2;		/* voltage: 0 = -5.00V, 65535 = +5.00V */
-	unsigned short	sensor3;		/* voltage: 0 = -5.00V, 65535 = +5.00V */
-	unsigned short	sensor4;		/* voltage: 0 = -5.00V, 65535 = +5.00V */
-	unsigned short	sensor5;		/* voltage: 0 = -5.00V, 65535 = +5.00V */
-	unsigned short	sensor6;		/* voltage: 0 = -5.00V, 65535 = +5.00V */
-	unsigned short	sensor7;		/* voltage: 0 = -5.00V, 65535 = +5.00V */
-	unsigned short	sensor8;		/* voltage: 0 = -5.00V, 65535 = +5.00V */
-	char		reserved2[8];
-}
-s7k_bluefin_environmental;
-
-/* Bluefin Data Frame (record 3100) */
-typedef struct s7kr_bluefin_struct
-{
-	s7k_header	header;
-	int		msec_timestamp;		/* Relative millisecond timer value */
-	int		number_frames;		/* Number of frames embedded in this record */
-	int		frame_size;		/* Embedded frame size in bytes */
-	int		data_format;		/* Data type identifier
-							0 - Navigation data
-							1 - Environment data */
-	char		reserved[16];		/* Reserved */
-	s7k_bluefin_nav	nav[BLUEFIN_MAX_FRAMES];			/* Bluefin navigation frames */
-	s7k_bluefin_environmental environmental[BLUEFIN_MAX_FRAMES];	/* Bluefin environmental frames */
-}
-s7kr_bluefin;
-
-/* Processed sidescan - MB-System extension to 7k format (record 3199) */
-typedef struct s7kr_processedsidescan_struct
-{
-	s7k_header	header;
-	mb_u_long	serial_number;		/* Sonar serial number */
-	unsigned int	ping_number;		/* Sequential number */
-	unsigned short	multi_ping;		/* Flag to indicate multi-ping mode
-							0 = no multi-ping
-							>0 = sequence number of ping
-								in the multi-ping
-								sequence */
-        unsigned short  recordversion;          /* allows for progression of versions of this data record
-                                                    version = 1: initial version as of 8 October 2012 */
-        unsigned int    ss_source;              /* Source of raw backscatter for this sidescan that has
-                                                    been laid out on the seafloor:
-                                                        ss_source = 0:     None
-                                                        ss_source = 1:     Non-Reson sidescan
-                                                        ss_source = 7007:  7kBackscatterImageData
-                                                        ss_source = 7008:  7kBeamData
-                                                        ss_source = 7028:  7kV2SnippetData 
-                                                        ss_source = 7058:  7kCalibratedSnippetData */
-	unsigned int	number_pixels;		/* Number of sidescan pixels across the entire swath */
-	unsigned int	ss_type;		/* indicates if sidescan values are logarithmic or linear
-                                                    ss_type = 0: logarithmic (dB)
-                                                    ss_type = 1: linear (voltage) */
-	float		pixelwidth;		/* Pixel acrosstrack width in m
-                                                    Acrosstrack distance of each pixel given by
-                                                        acrosstrack = (ipixel - number_pixels / 2) * pixelwidth
-                                                    where i = pixel number and N is the total number
-                                                    of pixels, counting from port to starboard starting at 0 */
-	double		sonardepth;		/* Sonar depth in m */
-	double		altitude;		/* Sonar nadir altitude in m */
-	float		sidescan[MBSYS_RESON7K_MAX_PIXELS];		/* Depth releative to chart datum in meters */
-	float		alongtrack[MBSYS_RESON7K_MAX_PIXELS];	/* Alongtrack distance in meters */
-}
-s7kr_processedsidescan;
-
-/* Reson 7k volatile sonar settings (record 7000) */
-typedef struct s7kr_volatilesettings_struct
-{
-	s7k_header	header;
-	mb_u_long	serial_number;		/* Sonar serial number */
-	unsigned int	ping_number;		/* Ping number */
-	unsigned short	multi_ping;		/* Flag to indicate multi-ping mode.
-							0 = no multi-ping
-							>0 = sequence number of the ping
-								in the multi-ping
-								sequence. */
-	float		frequency;		/* Transmit frequency (Hertz) */
-	float		sample_rate;		/* Sample rate (Hertz) */
-	float		receiver_bandwidth;	/* Receiver bandwidth (Hertz) */
-	float		pulse_width;		/* Transmit pulse length (seconds) */
-	unsigned int	pulse_type;		/* Pulse type identifier:
-							0 - CW
-							1 - linear chirp */
-	unsigned int	pulse_envelope;		/* Pulse envelope identifier:
-							0 - tapered rectangular
-							1 - Tukey */
-	float		pulse_envelope_par;	/* Pulse envelope parameter */
-	unsigned int	pulse_reserved;		/* Reserved pulse information */
-	float		max_ping_rate;		/* Maximum ping rate (pings/second) */
-	float		ping_period;		/* Time since last ping (seconds) */
-	float		range_selection;	/* Range selection (meters) */
-	float		power_selection;	/* Power selection (dB/uPa) */
-	float		gain_selection;		/* Gain selection (dB) */
-	unsigned int	control_flags;		/* Control flags bitfield:
-							0-3: auto range method
-							4-7: auto bottom detect filter method
-							8: bottom detect range filter
-							9: bottom detect depth filter
-							10-14: auto receiver gain method
-							15-31: reserved	*/
-	unsigned int	projector_magic_no;	/* Projector selection */
-	float		steering_vertical;	/* Projector steering angle vertical (radians) */
-	float		steering_horizontal;	/* Projector steering angle horizontal (radians) */
-	float		beamwidth_vertical;	/* Projector -3 dB beamwidth vertical (radians) */
-	float		beamwidth_horizontal;	/* Projector -3 dB beamwidth horizontal (radians) */
-	float		focal_point;		/* Projector focal point (meters) */
-	unsigned int	projector_weighting;	/* Projector beam weighting window type:
-							0 - rectangular
-							1 - Chebyshev */
-	float		projector_weighting_par;/* Projector beam weighting window parameter */
-	unsigned int	transmit_flags;		/* Transmit flags bitfield:
-							0-3: pitch stabilization method
-							4-7: yaw stabilization method
-							8-31: reserved */
-	unsigned int	hydrophone_magic_no;	/* Hydrophone selection (magic number) */
-	unsigned int	receive_weighting;	/* Receiver beam weighting window type:
-							0 - Chebyshev
-							1 - Kaiser */
-	float		receive_weighting_par;/* Receiver beam weighting window parameter */
-	unsigned int	receive_flags;		/* Receive flags bitfield:
-							0-3: roll stabilization method
-							4-7: dynamic focusing method
-							8-11: doppler compensation method
-							12-15: match filtering method
-							16-19: TVG method
-							20-23: Multi-ping mode
-								0 = no multi-ping
-								>0 = sequence number of the ping
-									in the multi-ping
-									sequence.
-							24-31: Reserved */
-	float		receive_width;		/* Receive beam width (radians) */
-	float		range_minimum;		/* Bottom detection minimum range (meters) */
-	float		range_maximum;		/* Bottom detection maximum range (meters) */
-	float		depth_minimum;		/* Bottom detection minimum depth (meters) */
-	float		depth_maximum;		/* Bottom detection maximum depth (meters) */
-	float		absorption;		/* Absorption (dB/km) */
-	float		sound_velocity;		/* Sound velocity (meters/second) */
-	float		spreading;		/* Spreading loss (dB) */
-	unsigned short	reserved;		/* reserved for future pulse shape description */
-}
-s7kr_volatilesettings;
-
-/* Reson 7k device configuration structure */
-typedef struct s7k_device_struct
-{
-	unsigned int	magic_number;		/* Unique identifier number */
-	char		description[64];	/* Device description string */
-	mb_u_long	serial_number;		/* Device serial number */
-	unsigned int	info_length;		/* Length of device specific data (bytes) */
-	unsigned int	info_alloc;		/* Memory allocated for data (bytes) */
-	char		*info;			/* Device specific data */
-}
-s7k_device;
-
-/* Reson 7k configuration (record 7001) */
-typedef struct s7kr_configuration_struct
-{
-	s7k_header	header;
-	mb_u_long	serial_number;		/* Sonar serial number */
-	unsigned int	number_devices;		/* Number of devices */
-	s7k_device	device[MBSYS_RESON7K_MAX_DEVICE];	/* Device configuration information */
-}
-s7kr_configuration;
-
-/* Reson 7k match filter (record 7002) */
-typedef struct s7kr_matchfilter_struct
-{
-	s7k_header	header;
-	mb_u_long	serial_number;		/* Sonar serial number */
-	unsigned int	ping_number;		/* Sequential number */
-	unsigned int	operation;		/* Operation
-							0 = off
-							1 = on */
-	float		start_frequency;	/* Start frequency (Hz) */
-	float		end_frequency;		/* End frequency (Hz) */
-}
-s7kr_matchfilter;
-
-/* Reson 7k firmware and hardware configuration (record 7003) */
-typedef struct s7kr_v2firmwarehardwareconfiguration_struct
-{
-	s7k_header	header;
-	unsigned int	device_count;		/* Hardware device count */
-	unsigned int	info_length;		/* Info length (bytes) */
-	unsigned int	info_alloc;		/* Memory allocated for data (bytes) */
-	char		*info;			/* Device specific data */
-}
-s7kr_v2firmwarehardwareconfiguration;
-
-/* Reson 7k beam geometry (record 7004) */
-typedef struct s7kr_beamgeometry_struct
-{
-	s7k_header	header;
-	mb_u_long	serial_number;		/* Sonar serial number */
-	unsigned int	number_beams;		/* Number of receiver beams */
-	float		angle_alongtrack[MBSYS_RESON7K_MAX_BEAMS];		/* Receiver beam X direction angle (radians) */
-	float		angle_acrosstrack[MBSYS_RESON7K_MAX_BEAMS];		/* Receiver beam Y direction angle (radians) */
-	float		beamwidth_alongtrack[MBSYS_RESON7K_MAX_BEAMS];	/* Receiver beamwidth X (radians) */
-	float		beamwidth_acrosstrack[MBSYS_RESON7K_MAX_BEAMS];	/* Receiver beamwidth Y (radians) */
-}
-s7kr_beamgeometry;
-
-/* Reson 7k calibration data (record 7005) */
-typedef struct s7kr_calibration_struct
-{
-	s7k_header	header;
-	mb_u_long	serial_number;		/* Sonar serial number */
-	unsigned short	number_channels;	/* Number of hydrophone receiver channels */
-	float		gain[MBSYS_RESON7K_MAX_RECEIVERS];	/* Receiver gain relative to a nominal gain of 1.0 */
-	float		phase[MBSYS_RESON7K_MAX_RECEIVERS];/* Receiver phase relative to a
-							nominal phase of 0.0 radians */
-}
-s7kr_calibration;
-
-/* Reson 7k bathymetry (record 7006) */
-typedef struct s7kr_bathymetry_struct
-{
-	s7k_header	header;
-	mb_u_long	serial_number;		/* Sonar serial number */
-	unsigned int	ping_number;		/* Sequential number */
-	unsigned short	multi_ping;		/* Flag to indicate multi-ping mode
-							0 = no multi-ping
-							>0 = sequence number of ping
-								in the multi-ping
-								sequence */
-	unsigned int	number_beams;		/* Number of receiver beams */
-	mb_u_char	layer_comp_flag;	/* Flag indicating if layer compensation is on
-							0 = off
-							1 = on
-							****Not present prior to Version 5!!! */
-	mb_u_char	sound_vel_flag;		/* Flag indicating if sound velocity is measured
-							or manually entered
-							0 = measured
-							1 = manually entered
-							****Not present prior to Version 5!!! */
-	float		sound_velocity;		/* Sound veocity at the sonar (m/sec)
-							****Not present prior to Version 5!!! */
-	float		range[MBSYS_RESON7K_MAX_BEAMS];	/* Two way travel time (seconds) */
-	mb_u_char	quality[MBSYS_RESON7K_MAX_BEAMS];
-                                                /* Beam quality bitfield:
-							0-3: Reson quality flags use bits 0-3
-								bit 0: brightness test
-								bit 1: colinearity test
-								bit 2: amplitude pick
-								bit 3: phase pick
-							4-7: MB beam flagging - use bits 4-7
-								- bits 0-3 left in original values
-								- beam valid if bit 4 or 5 are set
-								- beam flagged if bit 6 or 7 set
-								bit 4: on = amplitude
-								bit 5: on = phase
-								bit 6: on = auto flag
-								bit 7: on = manual flag */
-	float		intensity[MBSYS_RESON7K_MAX_BEAMS];	/* Signal strength (dB/uPa) */
-        float           min_depth_gate[MBSYS_RESON7K_MAX_BEAMS];
-                                                /* Minimum two-way travel time to filter point
-                                                   for each beam (minimum depth gate) */
-        float           max_depth_gate[MBSYS_RESON7K_MAX_BEAMS];
-                                                /* Maximum two-way travel time to filter point
-                                                   for each beam (maximum depth gate) */
-	unsigned int	optionaldata;		/* Flag indicating if bathymetry calculated and
-							values below filled in
-								0 = No
-								1 = Yes
-							This is an internal MB-System flag, not
-							a value in the data format */
-	float		frequency;		/* Ping frequency in Hz */
-	double		latitude;		/* Latitude of vessel reference point
-							in radians, -pi/2 to +pi/2 */
-	double		longitude;		/* Longitude of vessel reference point
-							in radians, -pi to +pi */
-	float		heading;		/* Heading of vessel at transmit time
-							in radians */
-	unsigned char	height_source;		/* Method used to correct to chart datum.
-							0 = None
-							1 = RTK (implies tide = 0.0)
-							2 = Tide */
-	float		tide;			/* Tide in meters */
-	float		roll;			/* Roll at transmit time */
-	float		pitch;			/* Pitch at transmit time */
-	float		heave;			/* Heave at transmit time in m*/
-	float		vehicle_height;		/* Vehicle height at transmit time in m */
-	float		depth[MBSYS_RESON7K_MAX_BEAMS];		/* Depth releative to chart datum in meters */
-	float		alongtrack[MBSYS_RESON7K_MAX_BEAMS];	/* Alongtrack distance in meters */
-	float		acrosstrack[MBSYS_RESON7K_MAX_BEAMS];	/* Acrosstrack distance in meters */
-	float		pointing_angle[MBSYS_RESON7K_MAX_BEAMS];/* Pointing angle from vertical in radians */
-	float		azimuth_angle[MBSYS_RESON7K_MAX_BEAMS];	/* Azimuth angle in radians */
-
-	int             acrossalongerror;           /* MB-System flipped the order of the alongtrack
-                                                     * and acrosstrack distance values through 4.3.2003
-                                                     * - if acrossalongerror == MB_MAYBE check max values of
-                                                     *       the acrosstrack and alongtrack arrays and treat the larger
-                                                     *       as acrosstrack - if this is found to be the case ten
-                                                     *       times then set acrossalongerro = MB_YES and always flip
-                                                     *       the values - if this is found to not be the case ten
-                                                     *       times then set acrossalongerror = MB_NO and never flip
-                                                     *       the values. */
-	int             nacrossalongerroryes;       /* counter for times acrosstrack and alongtrack values flipped */
-	int             nacrossalongerrorno;        /* counter for times acrosstrack and alongtrack values not flipped */
-}
-s7kr_bathymetry;
-
-/* Reson 7k backscatter imagery data (record 7007) */
-typedef struct s7kr_backscatter_struct
-{
-	s7k_header	header;
-	mb_u_long	serial_number;		/* Sonar serial number */
-	unsigned int	ping_number;		/* Sequential number */
-	unsigned short	multi_ping;		/* Flag to indicate multi-ping mode
-							0 = no multi-ping
-							>0 = sequence number of ping
-								in the multi-ping
-								sequence */
-	float		beam_position;		/* Beam position forward from
-							position of beam 0 (meters) */
-	unsigned int	control_flags;		/* Control flags bitfield
-							3-0: yaw stabilization method
-							7-4: beamforming method
-							31-8: reserved */
-	unsigned int	number_samples;		/* number of samples */
-	float		port_beamwidth_x;	/* Port -3 dB X beamwidth
-							(radians - typically a large angle) */
-	float		port_beamwidth_y;	/* Port -3 dB Y beamwidth
-							(radians - typically a small angle) */
-	float		stbd_beamwidth_x;	/* Starboard -3 dB X beamwidth
-							(radians - typically a large angle) */
-	float		stbd_beamwidth_y;	/* Starboard -3 dB Y beamwidth
-							(radians - typically a small angle) */
-	float		port_steering_x;	/* Port -3 dB X steering angle
-							(radians - typically slightly positive) */
-	float		port_steering_y;	/* Port -3 dB Y steering angle
-							(radians - typically pi */
-	float		stbd_steering_x;	/* Starboard -3 dB X steering angle
-							(radians - typically slightly positive) */
-	float		stbd_steering_y;	/* Starboard -3 dB Y steering angle
-							(radians - typically zero) */
-	unsigned short	number_beams;		/* Number of sidescan beams per side (usually only one) */
-	unsigned short	current_beam;		/* Beam number of this record (0 to number_beams - 1) */
-	mb_u_char	sample_size;		/* Number of bytes per sample */
-	mb_u_char	data_type;		/* Data type bitfield:
-							0: Amplitude
-							1: Phase */
-	unsigned int	nalloc;			/* Memory allocated in each array (bytes) */
-	char		*port_data;
-	char		*stbd_data;
-	unsigned int	optionaldata;		/* Flag indicating if values below filled in
-								0 = No
-								1 = Yes
-							This is an internal MB-System flag, not
-							a value in the data format */
-	float		frequency;		/* Ping frequency in Hz */
-	double		latitude;		/* Latitude of vessel reference point
-							in radians, -pi/2 to +pi/2 */
-	double		longitude;		/* Longitude of vessel reference point
-							in radians, -pi to +pi */
-	float		heading;		/* Heading of vessel at transmit time
-							in radians */
-	float		altitude;		/* Altitude in meters for slant range correction */
-}
-s7kr_backscatter;
-
-/* Reson 7k snippet data (part of record 7008) */
-typedef struct s7kr_snippet_struct
-{
-	unsigned short	beam_number;		/* Beam or element number */
-	unsigned int	begin_sample;		/* First sample number in beam from transmitter and outward. */
-	unsigned int	end_sample;		/* Last sample number in beam from transmitter and outward. */
-	unsigned int	nalloc_amp;		/* Bytes allocated to hold amplitude time series */
-	unsigned int	nalloc_phase;		/* Bytes allocated to hold phase time series */
-	void		*amplitude;		/* Amplitude or I time series as defined by sample_type */
-	void		*phase;			/* Phase or Q time series as defined by sample_type */
-}
-s7kr_snippet;
-
-/* Reson 7k beam data (record 7008) */
-typedef struct s7kr_beam_struct
-{
-	s7k_header	header;
-	mb_u_long	serial_number;		/* Sonar serial number */
-	unsigned int	ping_number;		/* Sequential number */
-	unsigned short	multi_ping;		/* Flag to indicate multi-ping mode
-							0 = no multi-ping
-							>0 = sequence number of ping
-								in the multi-ping
-								sequence */
-	unsigned short	number_beams;		/* Total number of beams or elements in record */
-	unsigned short	reserved;		/* Reserved */
-	unsigned int	number_samples;		/* Number of samples in ping. Only valid if all
-							beams and samples are in record. */
-	mb_u_char	record_subset_flag;	/* Record subset flag:
-							0 = All beams and samples in ping
-							1 = Beam and/or sample ping subset */
-	mb_u_char	row_column_flag;	/* Row column flag:
-							0 = Beam followed by samples
-							1 = Sample follows by beams */
-	unsigned short	sample_header_id;	/* Sample header identifier
-							0 = no sample header */
-	unsigned int	sample_type;		/* Data sample type
-							0-3: Amplitude:
-								0 = No amplitude
-								1 = Amplitude (8 bits)
-								2 = Amplitude (16 bits)
-								3 = Amplitude (32 bits)
-							4-7: Phase:
-								0 = No phase
-								1 = Phase (8 bits)
-								2 = Phase (16 bits)
-								3 = Phase (32 bits)
-							8-11: I and Q
-								0 = No I and Q
-								1 = Signed 16 bit I and signed 16 bit Q
-								2 = Signed 32 bit I and signed 32 bit Q
-							12-14: Beam forming flag:
-								0 = Beam formed data
-								1 = Element data */
-	s7kr_snippet	snippets[MBSYS_RESON7K_MAX_RECEIVERS];
-}
-s7kr_beam;
-
-/* Reson 7k vertical depth (record 7009) */
-typedef struct s7kr_verticaldepth_struct
-{
-	s7k_header	header;
-	float		frequency;		/* Sonar frequency in Hz */
-	unsigned int	ping_number;		/* Sequential number */
-	unsigned short	multi_ping;		/* Flag to indicate multi-ping mode
-							0 = no multi-ping
-							>0 = sequence number of ping
-								in the multi-ping
-								sequence */
-	double		latitude;		/* Latitude of vessel reference point
-							in radians, -pi/2 to +pi/2 */
-	double		longitude;		/* Longitude of vessel reference point
-							in radians, -pi to +pi */
-	float		heading;		/* Heading of vessel at transmit time
-							in radians */
-	float		alongtrack;		/* Sonar alongtrack distance from
-							vessel reference point in meters */
-	float		acrosstrack;		/* Sonar alongtrack distance from
-							vessel reference point in meters */
-	float		vertical_depth;		/* Sonar vertical depth with respect
-							to chart datum or vessel if
-							tide data are unavailable in meters */
-}
-s7kr_verticaldepth;
-
-/* Reson 7k tvg data (record 7010) */
-typedef struct s7kr_tvg_struct
-{
-	s7k_header	header;
-	mb_u_long	serial_number;		/* Sonar serial number */
-	unsigned int	ping_number;		/* Sequential number */
-	unsigned short	multi_ping;		/* Flag to indicate multi-ping mode
-							0 = no multi-ping
-							>0 = sequence number of ping
-								in the multi-ping
-								sequence */
-	unsigned int	n;			/* number of samples */
-	unsigned int	reserved[8];		/*  */
-	unsigned int	nalloc;			/* Number of bytes allocated to tvg array */
-	void		*tvg;			/* Array of tvg data */
-}
-s7kr_tvg;
-
-/* Reson 7k image data (record 7011) */
-typedef struct s7kr_image_struct
-{
-	s7k_header	header;
-	unsigned int	ping_number;		/* Sequential number */
-	unsigned short	multi_ping;		/* Flag to indicate multi-ping mode
-							0 = no multi-ping
-							>0 = sequence number of ping
-								in the multi-ping
-								sequence */
-	unsigned int	width;			/* Image width in pixels */
-	unsigned int	height;			/* Image height in pixels */
-	unsigned short	color_depth;			/* Color depth per pixel in bytes */
-	unsigned short	width_height_flag;	/* Image data width-height flag:
-							0 = Width followed by height
-							1 = Height followed by width */
-	unsigned short	compression;		/* Compression algorithm
-							0 = no compression */
-	unsigned int	nalloc;			/* Number of bytes allocated to image array */
-	void		*image;			/* Array of image data */
-}
-s7kr_image;
-
-/* Reson 7k ping motion (record 7012) */
-typedef struct s7kr_v2pingmotion_struct
-{
-	s7k_header	header;
-	mb_u_long	serial_number;		/* Sonar serial number */
-	unsigned int	ping_number;		/* Sequential number */
-	unsigned short	multi_ping;		/* Flag to indicate multi-ping mode
-							0 = no multi-ping
-							>0 = sequence number of ping
-								in the multi-ping
-								sequence */
-	unsigned int	n;			/* number of samples */
-	unsigned short	flags;			/* Bit field:
-							Bit 0:
-								1 = Pitch stabilization applied
-									/ pitch field present
-							Bit 1:
-								1 = Roll stabilization applied
-									/ roll field present
-							Bit 2: Yaw stabilization applied
-									/ yaw field present
-							Bit 3: Heave stabilization applied
-									/ heave field present
-							Bit 4-15: Reserved */
-	unsigned int	error_flags;		/* Bit field:
-							Bit 0:
-								PHINS referecne 0 = invalid, 1 = valid
-							Bit 1-3:
-								Reserved for PHINS
-							Bit 4: Roll angle > 15 degrees
-							Bit 5: Pitch angle > 35 degrees
-							Bit 6: Roll rate > 10 degrees
-							Bit 7-15: Reserved */
-	float		frequency;		/* sampling frequency (Hz) */
-	float		pitch;			/* Pitch value at the ping time (radians) */
-	int		nalloc;			/* number of samples allocated */
-	float		*roll;			/* Roll (radians) */
-	float		*heading;		/* Heading (radians) */
-	float		*heave;			/* Heave (m) */
-}
-s7kr_v2pingmotion;
-
-/* Reson 7k detection setup (record 7017) */
-typedef struct s7kr_v2detectionsetup_struct
-{
-	s7k_header	header;
-	mb_u_long	serial_number;		/* Sonar serial number */
-	unsigned int	ping_number;		/* Sequential number */
-	unsigned short	multi_ping;		/* Flag to indicate multi-ping mode
-							0 = no multi-ping
-							>0 = sequence number of ping
-								in the multi-ping
-								sequence */
-	unsigned int	number_beams;		/* Number of detection points */
-	unsigned int	data_field_size;	/* Size of detection information block in bytes */
-	mb_u_char	detection_algorithm;	/* Detection algorithm:
-							0 = G1_Simple
-							1 = G1_BlendFilt
-							2 = G2
-							3-255: Reserved for future use */
-	unsigned int	detection_flags;		/* Bit field:
-							Bit 0: 1 = User-defined depth filter enabled
-							Bit 1: 1 = User-defined range filter enabled
-							Bit 2: 1 = Automatic filter enabled
-							Bit 3: 1 = Nadir search limits enabled
-							Bit 4: 1 = Automatic window limits enabled
-							Bits 5-31: Reserved for future use */
-	float		minimum_depth;		/* Minimum depth for user-defined filter (meters) */
-	float		maximum_depth;		/* Maximum depth for user-defined filter (meters) */
-	float		minimum_range;		/* Minimum range for user-defined filter (meters) */
-	float		maximum_range;		/* Maximum range for user-defined filter (meters) */
-	float		minimum_nadir_search;	/* Minimum depth for automatic filter nadir search (meters) */
-	float		maximum_nadir_search;	/* Maximum depth for automatic filter nadir search (meters) */
-	mb_u_char	automatic_filter_window;/* Automatic filter window size (percent altitude) */
-        float           applied_roll;           /* Roll value (in radians) applied to gates; zero if roll stabilization is on */
-        float           depth_gate_tilt;        /* Angle in radians (positive to starboard) */
-	float   	reserved[14];		/* Reserved for future use */
-	unsigned short	beam_descriptor[MBSYS_RESON7K_MAX_BEAMS];
-						/* Beam number the detection is taken from */
-	float		detection_point[MBSYS_RESON7K_MAX_BEAMS];
-						/* Non-corrected fractional sample number with
-							the reference to the receiver's
-							acoustic center with the zero sample
-							at the transmit time */
-	unsigned int	flags[MBSYS_RESON7K_MAX_BEAMS];
-						/* Bit field:
-							Bit 0: 1 = automatic limits valid
-							Bit 1: 1 = User-defined limits valid
-							Bit 2-8: Quality type, defines the type of the
-									quality field
-								0: Quality not available / not used
-								1: Quality used
-							Bit 9: 1 = Quality passes user-defined criteria
-									or no user-defined criteria was
-									specified
-							Bit 10: 1 = Magnitude based detection
-							Bit 11: 1 = Phase based detection
-							Bit 12: 1 = Other detection 1
-							Bit 13-31: Reserved for future use
-						    Note that bits 1-12 are not mutually exclusive. For example,
-							bits 10 & 11 will both be set when the current "blend" of
-							magnitude and phase detection is used. */
-	unsigned int	auto_limits_min_sample[MBSYS_RESON7K_MAX_BEAMS];
-						/* Minimum sample number for automatic limits */
-	unsigned int	auto_limits_max_sample[MBSYS_RESON7K_MAX_BEAMS];
-						/* Maximum sample number for automatic limits */
-	unsigned int	user_limits_min_sample[MBSYS_RESON7K_MAX_BEAMS];
-						/* Minimum sample number for user-defined limits */
-	unsigned int	user_limits_max_sample[MBSYS_RESON7K_MAX_BEAMS];
-						/* Maximum sample number for user-defined limits */
-	unsigned int	quality[MBSYS_RESON7K_MAX_BEAMS];		/* Bit field:
-							Bit 0: 1 = Brightness filter passed
-							Bit 1: 1 = Colinearity filter passed
-							Bit 2-31: Reserved for future use */
-	float           uncertainty[MBSYS_RESON7K_MAX_BEAMS];   /* Detection uncertainty represented as an error normalized to the detection point */
-}
-s7kr_v2detectionsetup;
-
-/* Reson 7k amplitude and phase data (part of record 7018) */
-typedef struct s7kr_v2amplitudephase_struct
-{
-	unsigned short	beam_number;		/* Beam or element number */
-	unsigned int	number_samples;		/* Number of samples */
-	unsigned int	nalloc;			/* Number of samples allocated */
-	unsigned short 	*amplitude;		/* Amplitude time series  */
-	short		*phase;			/* Phase time series (radians scaled by 10430) */
-}
-s7kr_v2amplitudephase;
-
-/* Reson 7k beamformed magnitude and phase data (record 7018) */
-typedef struct s7kr_v2beamformed_struct
-{
-	s7k_header	header;
-	mb_u_long	serial_number;		/* Sonar serial number */
-	unsigned int	ping_number;		/* Sequential number */
-	unsigned short	multi_ping;		/* Flag to indicate multi-ping mode
-							0 = no multi-ping
-							>0 = sequence number of ping
-								in the multi-ping
-								sequence */
-	unsigned short	number_beams;		/* Total number of beams or elements in record */
-	unsigned int	number_samples;		/* Number of samples in each beam in this record */
-	mb_u_char	reserved[32];		/* Reserved for future use */
-	s7kr_v2amplitudephase	amplitudephase[MBSYS_RESON7K_MAX_BEAMS];
-						/* amplitude and phase data for each beam */
-}
-s7kr_v2beamformed;
-
-/* Reson 7k BITE field (part of record 7021) */
-typedef struct s7kr_v2bitefield_struct
-{
-	unsigned short	reserved;		/* Reserved */
-	char		name[64];		/* Name - null terminated ASCII string */
-	mb_u_char	device_type;		/* Device type:
-							1 = Error count
-							2 = FPGA die temperature
-							3 = Humidity
-							4 = Serial 8-channel ADC
-							5 = Firmware version
-							6 = Head Temp,_8K WetEnd
-							7 = Leak V,_8K WetEnd
-							8 = 5 Volt,_8K WetEnd
-							9 = 12 Volt,_8K WetEnd
-							10 = DipSwitch,_8K WetEnd */
-	float		minimum;		/* Minimum value */
-	float		maximum;		/* Maximum value */
-	float		value;			/* Current value */
-}
-s7kr_v2bitefield;
-
-/* Reson 7k BITE (part of record 7021) */
-typedef struct s7kr_v2bitereport_struct
-{
-	char		source_name[64];	/* source name - null terminated string */
-	mb_u_char	source_address;		/* source address */
-	float		frequency;		/* frequency for transmitter or 0 */
-	unsigned short	enumerator;		/* Enumerator for transmitter or 0 */
-	s7k_time	downlink_time;		/* Downlink time sent */
-	s7k_time	uplink_time;		/* Uplink time received */
-	s7k_time	bite_time;		/* BITE time received */
-	mb_u_char	status;			/* Bit field:
-							Bit 0:
-								0 = Uplink ok
-								1 = Uplink error
-							Bit 1:
-								0 = Downlink ok
-								1 = Downlink error
-							Bit 2:
-								0 = BITE ok
-								1 = BITE error */
-	unsigned short	number_bite;		/* Number of valid BITE fields for this board */
-	mb_u_char	bite_status[32];		/* Each bit delineates status of one BITE channel up to 256:
-							0 = BITE field within range
-							1 = BITE field out of range */
-	s7kr_v2bitefield	bitefield[256];	/* Array of BITE field data */
-}
-s7kr_v2bitereport;
-
-/* Reson 7k BITE (record 7021) */
-typedef struct s7kr_v2bite_struct
-{
-	s7k_header	header;
-	unsigned short	number_reports;		/* Number of Built In Test Environment reports */
-	unsigned int	nalloc;
-	s7kr_v2bitereport *reports;
-}
-s7kr_v2bite;
-
-/* Reson 7k center version (record 7022) */
-typedef struct s7kr_v27kcenterversion_struct
-{
-	s7k_header	header;
-	char		version[32];		/* Null terminated ASCII string */
-}
-s7kr_v27kcenterversion;
-
-/* Reson 7k 8k wet end version (record 7023) */
-typedef struct s7kr_v28kwetendversion_struct
-{
-	s7k_header	header;
-	char		version[32];		/* Null terminated ASCII string */
-}
-s7kr_v28kwetendversion;
-
-/* Reson 7k version 2 detection (record 7026) */
-typedef struct s7kr_v2detection_struct
-{
-	s7k_header	header;
-	mb_u_long	serial_number;		/* Sonar serial number */
-	unsigned int	ping_number;		/* Sequential number */
-	unsigned short	multi_ping;		/* Flag to indicate multi-ping mode
-							0 = no multi-ping
-							>0 = sequence number of ping
-								in the multi-ping
-								sequence */
-	unsigned int	number_beams;		/* Number of detection points */
-	unsigned int	data_field_size;	/* Size of detection information block in bytes */
-	mb_u_long 	corrections;		/* Corrections/Methods bit field:
-							Bit 0:
-								1 = Geometrical corrections for
-									cylindrical arrays applied
-							Bit 1-2:
-								0 = Manually entered surface sound velocity used
-								1 = Measured surface sound velocity used
-								2,3 = reserved for future use
-							Bit 3:
-								1 = Roll stabilization applied
-							Bit 4:
-								1 = Pitch stablization applied
-							Bits 5-63:
-								Reserved for future use */
-	mb_u_char	detection_algorithm;	/* Detection algorithm:
-							0 = G1_Simple
-							1 = G1_BlendFilt
-							2 = G2
-							3-255: Reserved for future use */
-	unsigned int	flags;			/* Bit field:
-							Bit 0:
-								1 = Quality filter applied. Only detections
-									that pass user-defined criteria
-									are generated.
-							Bit 1:
-								1 = Motion error(s) detected. Data may not
-									be accurate
-							Bit 2-3: Reference frame
-								0 = Sonar
-								1 = Vessel
-								2-3 = Reserved */
-	mb_u_char	reserved[64];		/* Reserved for future use */
-
-	float		range[MBSYS_RESON7K_MAX_BEAMS];
-						/* Two-way travel time to the bottom/target (seconds) */
-	float		angle_x[MBSYS_RESON7K_MAX_BEAMS];
-						/* Across-track angle to detection point (radians) */
-	float		angle_y[MBSYS_RESON7K_MAX_BEAMS];
-						/* Along-track angle to detection point (radians) */
-	float		range_error[MBSYS_RESON7K_MAX_BEAMS];
-						/* Measurement error (seconds) */
-	float		angle_x_error[MBSYS_RESON7K_MAX_BEAMS];
-						/* Measurement error (radians) */
-	float		angle_y_error[MBSYS_RESON7K_MAX_BEAMS];
-						/* Measurement error (radians) */
-}
-s7kr_v2detection;
-
-/* Reson 7k version 2 raw detection (record 7027) */
-typedef struct s7kr_v2rawdetection_struct
-{
-	s7k_header	header;
-	mb_u_long	serial_number;		/* Sonar serial number */
-	unsigned int	ping_number;		/* Sequential number */
-	unsigned short	multi_ping;		/* Flag to indicate multi-ping mode
-							0 = no multi-ping
-							>0 = sequence number of ping
-								in the multi-ping
-								sequence */
-	unsigned int	number_beams;		/* Number of detection points */
-	unsigned int	data_field_size;	/* Size of detection information block in bytes */
-	mb_u_char	detection_algorithm;	/* Detection algorithm:
-							0 = G1_Simple
-							1 = G1_BlendFilt
-							2 = G2
-							3-255: Reserved for future use */
-	unsigned int	detection_flags;	/* Bit field: Bits 0-31: Reserved for future use */
-	float		sampling_rate;		/* Sonar's sampling frequency in Hz */
-	float		tx_angle;		/* Applied transmitter steering angle, in radians */
-	mb_u_char	reserved[64];		/* Reserved for future use */
-
-	unsigned short	beam_descriptor[MBSYS_RESON7K_MAX_BEAMS];
-						/* Beam number the detection is taken from */
-	float		detection_point[MBSYS_RESON7K_MAX_BEAMS];
-						/* Non-corrected fractional sample number with
-							the reference to the receiver's
-							acoustic center with the zero sample
-							at the transmit time */
-	float		rx_angle[MBSYS_RESON7K_MAX_BEAMS];
-						/* Beam steering angle with reference to
-							receiver's acoustic center in the
-							sonar reference frame, at the detection
-							point, in radians */
-	unsigned int	flags[MBSYS_RESON7K_MAX_BEAMS];
-						/* Bit fields:
-							Bit 0: 1 = Magnitude based detection
-							Bit 1: 1 = Phase based detection
-							Bits 2-8: Quality type, defines the type
-								of the quality field below
-								0: Quality not available / not used
-								1: Quality available
-								2-31: Reserved for future use
-							Bit 9: Uncertainty information is available
-							Bits 10-31: Reserved for future use */
-	unsigned int	quality[MBSYS_RESON7K_MAX_BEAMS];
-						/* Detection quality:
-							Bit 0: 1 = Brightness filter passed
-							Bit 1: 1 = Co-linearity filter passed */
-	float		uncertainty[MBSYS_RESON7K_MAX_BEAMS];
-						/* Detection uncertainty represented as an error
-							normalized to the detection point */
-}
-s7kr_v2rawdetection;
-
-/* Reson 7k version 2 snippet data (part of record 7028) */
-typedef struct s7kr_v2snippettimeseries_struct
-{
-	unsigned short	beam_number;		/* Beam or element number */
-	unsigned int	begin_sample;		/* First sample included in snippet */
-	unsigned int	detect_sample;		/* Detection point */
-	unsigned int	end_sample;		/* Last sample included in snippet */
-	unsigned int	nalloc;			/* Bytes allocated to hold amplitude time series */
-	unsigned short	*amplitude;		/* Amplitude time series */
-}
-s7kr_v2snippettimeseries;
-
-/* Reson 7k version 2 snippet (record 7028) */
-typedef struct s7kr_v2snippet_struct
-{
-	s7k_header	header;
-	mb_u_long	serial_number;		/* Sonar serial number */
-	unsigned int	ping_number;		/* Sequential number */
-	unsigned short	multi_ping;		/* Flag to indicate multi-ping mode
-							0 = no multi-ping
-							>0 = sequence number of ping
-								in the multi-ping
-								sequence */
-	unsigned short	number_beams;		/* Number of detection points */
-	mb_u_char	error_flag;		/* If set, record will not contain any data
-							Flag itself will indicate an error:
-							0 = Ok
-							6 = Bottom detection failed
-							Other = reserved */
-	mb_u_char	control_flags;		/* Control settings from RC 1118 command:
-							Bit 0: Automatic snippet window is used
-							Bit 1: Quality filter enabled
-							Bit 2: Minimum window size is required
-							Bit 3: Maximum window size is required
-							Bit 4-7: Reserved */
-	mb_u_char	reserved[28];		/* Reserved for future use */
-	s7kr_v2snippettimeseries	snippettimeseries[MBSYS_RESON7K_MAX_BEAMS];
-						/* Snippet time series for each beam */
-}
-s7kr_v2snippet;
-
-/* Reson 7k sonar installation parameters (record 7030) */
-typedef struct s7kr_installation_struct
-{
-	s7k_header	header;
-	float		frequency;		/* Sonar frequency (Hz) */
-	unsigned short	firmware_version_len;	/* Length of firmware version info in bytes */
-	char		firmware_version[128];	/* Firmware version info */
-	unsigned short	software_version_len;	/* Length of software version info in bytes */
-	char		software_version[128];	/* Software version info */
-	unsigned short	s7k_version_len;	/* Length of 7k software version info in bytes */
-	char		s7k_version[128];	/* 7k software version info */
-	unsigned short	protocal_version_len;	/* Length of protocal version info in bytes */
-	char		protocal_version[128];	/* Protocal version info */
-	float		transmit_x;		/* Sonar transmit array X offset (m) */
-	float		transmit_y;		/* Sonar transmit array Y offset (m) */
-	float		transmit_z;		/* Sonar transmit array Z offset (m) */
-	float		transmit_roll;		/* Sonar transmit array roll offset radiansm) */
-	float		transmit_pitch;		/* Sonar transmit array pitch offset (radians) */
-	float		transmit_heading;	/* Sonar transmit array heading offset (radians) */
-	float		receive_x;		/* Sonar receive array X offset (m) */
-	float		receive_y;		/* Sonar receive array Y offset (m) */
-	float		receive_z;		/* Sonar receive array Z offset (m) */
-	float		receive_roll;		/* Sonar receive array roll offset (radians) */
-	float		receive_pitch;		/* Sonar receive array pitch offset (radians) */
-	float		receive_heading;	/* Sonar receive array heading offset (radians) */
-	float		motion_x;		/* Motion sensor X offset (m) */
-	float		motion_y;		/* Motion sensor Y offset (m) */
-	float		motion_z;		/* Motion sensor Z offset (m) */
-	float		motion_roll;		/* Motion sensor roll offset (radians) */
-	float		motion_pitch;		/* Motion sensor pitch offset (radians) */
-	float		motion_heading;		/* Motion sensor heading offset (radians) */
-	unsigned short	motion_time_delay;	/* Motion sensor time delay (msec) */
-	float		position_x;		/* Position sensor X offset (m) */
-	float		position_y;		/* Position sensor Y offset (m) */
-	float		position_z;		/* Position sensor Z offset (m) */
-	unsigned short	position_time_delay;	/* Position sensor time delay (msec) */
-	float		waterline_z;		/* Vertical offset from reference
-							point to waterline (m) */
-}
-s7kr_installation;
-
-/* Reson 7k system event (record 7051) */
-typedef struct s7kr_systemeventmessage_struct
-{
-	s7k_header	header;
-	mb_u_long	serial_number;		/* Sonar serial number */
-	unsigned short	event_id;		/* Event id:
-							0: success
-							1: information (used for MB-System comment record)
-							2: warning
-							3: error */
-	unsigned short	message_length;		/* Message length in bytes */
-	unsigned short	event_identifier;	/* Undefined */
-	unsigned int	message_alloc;		/* Number of bytes allocated for message */
-	char		*message;		/* Message string (null terminated) */
-}
-s7kr_systemeventmessage;
-
-/* Reson 7k calibrated snippet data (part of record 7058) */
-typedef struct s7kr_calibratedsnippettimeseries_struct
-{
-    unsigned short  beam_number;        /* Beam or element number */
-    unsigned int    begin_sample;       /* First sample included in snippet */
-    unsigned int    detect_sample;      /* Detection point */
-    unsigned int    end_sample;     /* Last sample included in snippet */
-    unsigned int    nalloc;         /* Bytes allocated to hold amplitude time series */
-    float  *amplitude;     /* Amplitude time series */
-}
-s7kr_calibratedsnippettimeseries;
-
-/* Reson 7k calibrated snippet (record 7058) */
-typedef struct s7kr_calibratedsnippet_struct
-{
-    s7k_header  header;
-    mb_u_long   serial_number;      /* Sonar serial number */
-    unsigned int    ping_number;        /* Sequential number */
-    unsigned short  multi_ping;     /* Flag to indicate multi-ping mode
-                            0 = no multi-ping
-                            >0 = sequence number of ping
-                                in the multi-ping
-                                sequence */
-    unsigned short  number_beams;       /* Number of detection points */
-    mb_u_char   error_flag;     /* If set, record will not contain any data
-                            Flag itself will indicate an error:
-                            0 = Ok
-                            1 = No calibration
-                            2 = TVG read error (R7010)
-                            3 = CTD not available (R1010)
-                            4 = Invalid or not available geometry (R7004)
-                            5 = Invalid sonar specifications (XML)
-                            6 = Bottom detection failed (R7006)
-                            7 = No power (Power is set to zero)
-                            8 = No gain (Gain is too low)
-                            255 = System cannot be calibrated (c7k file missing)
-                            Other = reserved */
-    unsigned int  control_flags;      /* Control settings from RC 1113 command:
-                            Bit 0: Brightness is required to pass
-                            Bit 1: Colinearity is required to pass
-                            Bit 2: Bottom detection results are used for snippet
-                            Bit 3: Snippets display min requirements are used
-                            Bit 4: Minimum window size is required
-                            Bit 5: Maximum window size is required
-                            6-31: reserved */
-    mb_u_char   reserved[28];       /* Reserved for future use */
-    s7kr_calibratedsnippettimeseries    calibratedsnippettimeseries[MBSYS_RESON7K_MAX_BEAMS];
-                        /* Snippet time series for each beam */
-}
-s7kr_calibratedsnippet;
-
-
-/* Reson 7k subsystem structure */
-typedef struct s7kr_subsystem_struct
-{
-	unsigned int	device_identifier;	/* Identifier for record type of embedded data */
-	unsigned short	system_enumerator;	/* Identifier for the device subsystem */
-}
-s7kr_subsystem;
-
-/* Reson 7k file header (record 7200) */
-typedef struct s7kr_fileheader_struct
-{
-	s7k_header	header;
-	char		file_identifier[16];	/* File identifier:
-							0xF3302F43CFB04D6FA93E2AEC33DF577D */
-	unsigned short	version;		/* File format version number */
-	unsigned short	reserved;		/* Reserved */
-	char		session_identifier[16];	/* Session identifier - used to associate multiple
-							files for a given session */
-	unsigned int	record_data_size;	/* Size of record data - 0 if not set */
-	unsigned int	number_subsystems;	/* Number of subsystems - 0 if not set */
-	char		recording_name[64];	/* Recording program name - null terminated string */
-	char		recording_version[16];	/* Recording program version number - null terminated string */
-	char		user_defined_name[64];	/* User defined name - null terminated string */
-	char		notes[128];		/* Notes - null terminated string */
-	s7kr_subsystem	subsystem[MBSYS_RESON7K_MAX_DEVICE];
-}
-s7kr_fileheader;
-
-/* Reson 7k remote control sonar settings (record 7503) */
-typedef struct s7kr_remotecontrolsettings_struct
-{
-	s7k_header	header;
-	mb_u_long	serial_number;		/* Sonar serial number */
-	unsigned int	ping_number;		/* Ping number */
-	float		frequency;		/* Transmit frequency (Hertz) */
-	float		sample_rate;		/* Sample rate (Hertz) */
-	float		receiver_bandwidth;	/* Receiver bandwidth (Hertz) */
-	float		pulse_width;		/* Transmit pulse length (seconds) */
-	unsigned int	pulse_type;		/* Pulse type identifier:
-							0 - CW
-							1 - linear chirp */
-	unsigned int	pulse_envelope;		/* Pulse envelope identifier:
-							0 - tapered rectangular
-							1 - Tukey */
-	float		pulse_envelope_par;	/* Pulse envelope parameter */
-	unsigned int	pulse_reserved;		/* Reserved pulse information */
-	float		max_ping_rate;		/* Maximum ping rate (pings/second) */
-	float		ping_period;		/* Time since last ping (seconds) */
-	float		range_selection;	/* Range selection (meters) */
-	float		power_selection;	/* Power selection (dB/uPa) */
-	float		gain_selection;		/* Gain selection (dB) */
-	unsigned int	control_flags;		/* Control flags bitfield:
-							0-3: auto range method
-							4-7: auto bottom detect filter method
-							8: bottom detect range filter
-							9: bottom detect depth filter
-							10-14: auto receiver gain method
-							15-31: reserved	*/
-	unsigned int	projector_magic_no;	/* Projector selection */
-	float		steering_vertical;	/* Projector steering angle vertical (radians) */
-	float		steering_horizontal;	/* Projector steering angle horizontal (radians) */
-	float		beamwidth_vertical;	/* Projector -3 dB beamwidth vertical (radians) */
-	float		beamwidth_horizontal;	/* Projector -3 dB beamwidth horizontal (radians) */
-	float		focal_point;		/* Projector focal point (meters) */
-	unsigned int	projector_weighting;	/* Projector beam weighting window type:
-							0 - rectangular
-							1 - Chebyshev */
-	float		projector_weighting_par;/* Projector beam weighting window parameter */
-	unsigned int	transmit_flags;		/* Transmit flags bitfield:
-							0-3: pitch stabilization method
-							4-7: yaw stabilization method
-							8-31: reserved */
-	unsigned int	hydrophone_magic_no;	/* Hydrophone selection (magic number) */
-	unsigned int	receive_weighting;	/* Receiver beam weighting window type:
-							0 - Chebyshev
-							1 - Kaiser */
-	float		receive_weighting_par;/* Receiver beam weighting window parameter */
-	unsigned int	receive_flags;		/* Receive flags bitfield:
-							0-3: roll stabilization method
-							4-7: dynamic focusing method
-							8-11: doppler compensation method
-							12-15: match filtering method
-							16-19: TVG method
-							20-23: Multi-ping mode
-								0 = no multi-ping
-								>0 = sequence number of the ping
-									in the multi-ping
-									sequence.
-							24-31: Reserved */
-	float		range_minimum;		/* Bottom detection minimum range (meters) */
-	float		range_maximum;		/* Bottom detection maximum range (meters) */
-	float		depth_minimum;		/* Bottom detection minimum depth (meters) */
-	float		depth_maximum;		/* Bottom detection maximum depth (meters) */
-	float		absorption;		/* Absorption (dB/km) */
-	float		sound_velocity;		/* Sound velocity (meters/second) */
-	float		spreading;		/* Spreading loss (dB) */
-	unsigned short	reserved;		/* reserved for future pulse shape description */
-
-	/* parameters added by version 1.0 */
-	float		tx_offset_x;		/* Offset of the transducer array in m, relative
-							to the receiver array on the x axis, positive
-							value is to the right, if the receiver faces
-							forward. */
-	float		tx_offset_y;		/* Offset of the transducer array in m, relative
-							to the receiver array on the y axis, positive
-							value is forward, if the receiver faces
-							forward. */
-	float		tx_offset_z;		/* Offset of the transducer array in m, relative
-							to the receiver array on the z axis, positive
-							value is up, if the receiver faces forward. */
-	float		head_tilt_x;		/* Head tilt x (radians) */
-	float		head_tilt_y;		/* Head tilt y (radians) */
-	float		head_tilt_z;		/* Head tilt z (radians) */
-	unsigned short	ping_on_off;		/* Ping on/off state:
-							0 = pinging disabled
-							1 = pinging enabled */
-	mb_u_char	data_sample_types;	/* */
-	mb_u_char	projector_orientation;	/* Projector orientation:
-							0: down
-							1: up */
-	unsigned short	beam_angle_mode;	/* Beam angle spacing mode:
-							1: equiangle
-							2: eqidistant */
-	unsigned short	r7kcenter_mode;		/* 7kCenter mode:
-							0: normal
-							1: autopilot
-							2: calibration (IQ)
-							3+: reserved */
-	float		gate_depth_min;		/* Adaptive gate minimum depth */
-	float		gate_depth_max;		/* Adaptive gate maximum depth */
-	unsigned short	reserved2[35];
-}
-s7kr_remotecontrolsettings;
-
-/* Reson 7k Reserved (well, unknown really...) (record 7504) */
-typedef struct s7kr_reserved_struct
-{
-	s7k_header	header;
-	mb_u_char	reserved[R7KHDRSIZE_7kReserved];	/* raw bytes of unknown record */
-}
-s7kr_reserved;
-
-/* Reson 7k Roll (record 7600) */
-typedef struct s7kr_roll_struct
-{
-	s7k_header	header;
-	float		roll;			/* Roll (radians) */
-}
-s7kr_roll;
-
-/* Reson 7k Pitch (record 7601) */
-typedef struct s7kr_pitch_struct
-{
-	s7k_header	header;
-	float		pitch;			/* Pitch (radians) */
-}
-s7kr_pitch;
-
-/* Reson 7k Sound Velocity (record 7610) */
-typedef struct s7kr_soundvelocity_struct
-{
-	s7k_header	header;
-	float		soundvelocity;		/* Water sound speed (m/s) */
-}
-s7kr_soundvelocity;
-
-/* Reson 7k Absorption Loss (record 7611) */
-typedef struct s7kr_absorptionloss_struct
-{
-	s7k_header	header;
-	float		absorptionloss;		/* Absorption loss (dB/km) */
-}
-s7kr_absorptionloss;
-
-/* Reson 7k Spreading Loss (record 7612) */
-typedef struct s7kr_spreadingloss_struct
-{
-	s7k_header	header;
-	float		spreadingloss;		/* dB (0 - 60) */
-}
-s7kr_spreadingloss;
-
-/* internal data structure */
-struct mbsys_reson7k_struct
-	{
-	/* Type of data record */
-	int		kind;			/* MB-System record ID */
-	int		type;			/* Reson record ID */
-	int		sstype;			/* If type == R7KRECID_FSDWsidescan
-							sstype: 0 = low frequency sidescan
-							 	1 = high frequency sidescan */
-
-	/* ping record id's */
-	int		current_ping_number;
-	int		read_volatilesettings;
-	int		read_matchfilter;
-	int		read_beamgeometry;
-	int		read_remotecontrolsettings;
-	int		read_bathymetry;
-	int		read_backscatter;
-	int		read_beam;
-	int		read_verticaldepth;
-	int		read_tvg;
-	int		read_image;
-	int		read_v2pingmotion;
-	int		read_v2detectionsetup;
-	int		read_v2beamformed;
-	int		read_v2detection;
-	int		read_v2rawdetection;
-	int		read_v2snippet;
-        int             read_calibratedsnippet;
-	int		read_processedsidescan;
-
-	/* MB-System time stamp */
-	double		time_d;
-	int		time_i[7];
-
-	/* Reference point information (record 1000) */
-	/*  Note: these offsets should be zero for submersible vehicles */
-	s7kr_reference	reference;
-
-	/* Sensor uncalibrated offset position information (record 1001) */
-	s7kr_sensoruncal	sensoruncal;
-
-	/* Sensor calibrated offset position information (record 1002) */
-	s7kr_sensorcal	sensorcal;
-
-	/* Position (record 1003) */
-	s7kr_position	position;
-
-	/* Custom attitude (record 1004) */
-	s7kr_customattitude	customattitude;
-
-	/* Tide (record 1005) */
-	s7kr_tide	tide;
-
-	/* Altitude (record 1006) */
-	s7kr_altitude	altitude;
-
-	/* Motion over ground (record 1007) */
-	s7kr_motion	motion;
-
-	/* Depth (record 1008) */
-	s7kr_depth	depth;
-
-	/* Sound velocity profile (record 1009) */
-	s7kr_svp	svp;
-
-	/* CTD (record 1010) */
-	s7kr_ctd	ctd;
-
-	/* Geodesy (record 1011) */
-	s7kr_geodesy	geodesy;
-
-	/* Roll pitch heave (record 1012) */
-	s7kr_rollpitchheave	rollpitchheave;
-
-	/* Heading (record 1013) */
-	s7kr_heading	heading;
-
-	/* Survey line (record 1014) */
-	s7kr_surveyline	surveyline;
-
-	/* Navigation (record 1015) */
-	s7kr_navigation	navigation;
-
-	/* Attitude (record 1016) */
-	s7kr_attitude	attitude;
-
-	/* Unknown record 1022 (record 1022) */
-	s7kr_rec1022	rec1022;
-
-	/* Edgetech FS-DW low frequency sidescan (record 3000) */
-	s7kr_fsdwss	fsdwsslo;
-
-	/* Edgetech FS-DW high frequency sidescan (record 3000) */
-	s7kr_fsdwss	fsdwsshi;
-
-	/* Edgetech FS-DW subbottom (record 3001) */
-	s7kr_fsdwsb	fsdwsb;
-
-	/* Bluefin data frames (record 3100) */
-	s7kr_bluefin	bluefin;
-
-        /* Processed sidescan - MB-System extension to 7k format (record 3199) */
-	s7kr_processedsidescan   processedsidescan;
-
-	/* Reson 7k volatile sonar settings (record 7000) */
-	s7kr_volatilesettings	volatilesettings;
-
-	/* Reson 7k configuration (record 7001) */
-	s7kr_configuration	configuration;
-
-	/* Reson 7k match filter (record 7002) */
-	s7kr_matchfilter	matchfilter;
-
-	/* Reson 7k firmware and hardware configuration (record 7003) */
-	s7kr_v2firmwarehardwareconfiguration	v2firmwarehardwareconfiguration;
-
-	/* Reson 7k beam geometry (record 7004) */
-	s7kr_beamgeometry	beamgeometry;
-
-	/* Reson 7k calibration (record 7005) */
-	s7kr_calibration	calibration;
-
-	/* Reson 7k bathymetry (record 7006) */
-	s7kr_bathymetry		bathymetry;
-
-	/* Reson 7k backscatter imagery data (record 7007) */
-	s7kr_backscatter	backscatter;
-
-	/* Reson 7k beam data (record 7008) */
-	s7kr_beam		beam;
-
-	/* Reson 7k vertical depth (record 7009) */
-	s7kr_verticaldepth	verticaldepth;
-
-	/* Reson 7k tvg data (record 7011) */
-	s7kr_tvg		tvg;
-
-	/* Reson 7k image data (record 7011) */
-	s7kr_image		image;
-
-	/* Ping motion (record 7012) */
-	s7kr_v2pingmotion	v2pingmotion;
-
-	/* Detection setup (record 7017) */
-	s7kr_v2detectionsetup	v2detectionsetup;
-
-	/* Reson 7k beamformed magnitude and phase data (record 7018) */
-	s7kr_v2beamformed	v2beamformed;
-
-	/* Reson 7k BITE (record 7021) */
-	s7kr_v2bite	v2bite;
-
-	/* Reson 7k center version (record 7022) */
-	s7kr_v27kcenterversion	v27kcenterversion;
-
-	/* Reson 7k 8k wet end version (record 7023) */
-	s7kr_v28kwetendversion	v28kwetendversion;
-
-	/* Reson 7k version 2 detection (record 7026) */
-	s7kr_v2detection	v2detection;
-
-	/* Reson 7k version 2 raw detection (record 7027) */
-	s7kr_v2rawdetection	v2rawdetection;
-
-	/* Reson 7k version 2 snippet (record 7028) */
-	s7kr_v2snippet	v2snippet;
-
-	/* Reson 7k sonar installation parameters (record 7030) */
-	s7kr_installation	installation;
-
-	/* Reson 7k system event (record 7051) */
-	s7kr_systemeventmessage	systemeventmessage;
-
-        /* Reson 7k calibrated snippet (record 7058) */
-        s7kr_calibratedsnippet calibratedsnippet;
-
-	/* Reson 7k file header (record 7200) */
-	s7kr_fileheader		fileheader;
-
-	/* Reson 7k remote control sonar settings (record 7503) */
-	s7kr_remotecontrolsettings	remotecontrolsettings;
-
-	/* Reson 7k Reserved (well, unknown really...) (record 7504) */
-	s7kr_reserved		reserved;
-
-	/* Reson 7k Roll (record 7600) */
-	s7kr_roll		roll;
-
-	/* Reson 7k Pitch (record 7601) */
-	s7kr_pitch		pitch;
-
-	/* Reson 7k Sound Velocity (record 7610) */
-	s7kr_soundvelocity	soundvelocity;
-
-	/* Reson 7k Absorption Loss (record 7611) */
-	s7kr_absorptionloss	absorptionloss;
-
-	/* Reson 7k Spreading Loss (record 7612) */
-	s7kr_spreadingloss	spreadingloss;
-
-	};
-
-
-
-/* 7K Macros */
-int mbsys_reson7k_checkheader(s7k_header header);
-
-/* system specific function prototypes */
-int mbsys_reson7k_zero7kheader(int verbose, s7k_header	*header,
-			int *error);
-int mbsys_reson7k_alloc(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error);
-int mbsys_reson7k_survey_alloc(int verbose,
-			void *mbio_ptr, void *store_ptr,
-			int *error);
-int mbsys_reson7k_attitude_alloc(int verbose,
-			void *mbio_ptr, void *store_ptr,
-			int *error);
-int mbsys_reson7k_heading_alloc(int verbose,
-			void *mbio_ptr, void *store_ptr,
-			int *error);
-int mbsys_reson7k_ssv_alloc(int verbose,
-			void *mbio_ptr, void *store_ptr,
-			int *error);
-int mbsys_reson7k_tlt_alloc(int verbose,
-			void *mbio_ptr, void *store_ptr,
-			int *error);
-int mbsys_reson7k_deall(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error);
-int mbsys_reson7k_zero_ss(int verbose, void *store_ptr, int *error);
-int mbsys_reson7k_dimensions(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int *nbath, int *namp, int *nss, int *error);
-int mbsys_reson7k_pingnumber(int verbose, void *mbio_ptr,
-			int *pingnumber, int *error);
-int mbsys_reson7k_sonartype(int verbose, void *mbio_ptr, void *store_ptr,
-		int *sonartype, int *error);
-int mbsys_reson7k_sidescantype(int verbose, void *mbio_ptr, void *store_ptr,
-		int *ss_type, int *error);
-int mbsys_reson7k_extract(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int time_i[7], double *time_d,
-			double *navlon, double *navlat,
-			double *speed, double *heading,
-			int *nbath, int *namp, int *nss,
-			char *beamflag, double *bath, double *amp,
-			double *bathacrosstrack, double *bathalongtrack,
-			double *ss, double *ssacrosstrack, double *ssalongtrack,
-			char *comment, int *error);
-int mbsys_reson7k_insert(int verbose, void *mbio_ptr, void *store_ptr,
-			int kind, int time_i[7], double time_d,
-			double navlon, double navlat,
-			double speed, double heading,
-			int nbath, int namp, int nss,
-			char *beamflag, double *bath, double *amp,
-			double *bathacrosstrack, double *bathalongtrack,
-			double *ss, double *ssacrosstrack, double *ssalongtrack,
-			char *comment, int *error);
-int mbsys_reson7k_ttimes(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int *nbeams,
-			double *ttimes, double *angles,
-			double *angles_forward, double *angles_null,
-			double *heave, double *alongtrack_offset,
-			double *draft, double *ssv, int *error);
-int mbsys_reson7k_detects(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int *nbeams, int *detects, int *error);
-int mbsys_reson7k_gains(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, double *transmit_gain, double *pulse_length,
-			double *receive_gain, int *error);
-int mbsys_reson7k_extract_altitude(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, double *transducer_depth, double *altitude,
-			int *error);
-int mbsys_reson7k_extract_nav(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int time_i[7], double *time_d,
-			double *navlon, double *navlat,
-			double *speed, double *heading, double *draft,
-			double *roll, double *pitch, double *heave,
-			int *error);
-int mbsys_reson7k_extract_nnav(int verbose, void *mbio_ptr, void *store_ptr,
-			int nmax, int *kind, int *n,
-			int *time_i, double *time_d,
-			double *navlon, double *navlat,
-			double *speed, double *heading, double *draft,
-			double *roll, double *pitch, double *heave,
-			int *error);
-int mbsys_reson7k_insert_nav(int verbose, void *mbio_ptr, void *store_ptr,
-			int time_i[7], double time_d,
-			double navlon, double navlat,
-			double speed, double heading, double draft,
-			double roll, double pitch, double heave,
-			int *error);
-int mbsys_reson7k_extract_svp(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind,
-			int *nsvp,
-			double *depth, double *velocity,
-			int *error);
-int mbsys_reson7k_insert_svp(int verbose, void *mbio_ptr, void *store_ptr,
-			int nsvp,
-			double *depth, double *velocity,
-			int *error);
-int mbsys_reson7k_extract_segytraceheader(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind,
-			void *segyheader_ptr,
-			int *error);
-int mbsys_reson7k_extract_segy(int verbose, void *mbio_ptr, void *store_ptr,
-			int *sampleformat,
-			int *kind,
-			void *segyheader_ptr,
-			float *segydata,
-			int *error);
-int mbsys_reson7k_insert_segy(int verbose, void *mbio_ptr, void *store_ptr,
-			int kind,
-			void *segyheader_ptr,
-			float *segydata,
-			int *error);
-int mbsys_reson7k_ctd(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int *nctd, double *time_d,
-			double *conductivity, double *temperature,
-			double *depth, double *salinity, double *soundspeed, int *error);
-int mbsys_reson7k_ancilliarysensor(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int *nsamples, double *time_d,
-			double *sensor1, double *sensor2, double *sensor3,
-			double *sensor4, double *sensor5, double *sensor6,
-			double *sensor7, double *sensor8, int *error);
-int mbsys_reson7k_copy(int verbose, void *mbio_ptr,
-			void *store_ptr, void *copy_ptr,
-			int *error);
-int mbsys_reson7k_checkheader(s7k_header header);
-int mbsys_reson7k_makess(int verbose, void *mbio_ptr, void *store_ptr,
-			int source, int pixel_size_set, double *pixel_size,
-			int swath_width_set, double *swath_width,
-			int pixel_int, int *error);
-int mbsys_reson7k_print_header(int verbose,
-			s7k_header *header,
-			int *error);
-int mbsys_reson7k_print_reference(int verbose,
-			s7kr_reference *reference,
-			int *error);
-int mbsys_reson7k_print_sensoruncal(int verbose,
-			s7kr_sensoruncal *sensoruncal,
-			int *error);
-int mbsys_reson7k_print_sensorcal(int verbose,
-			s7kr_sensorcal *sensorcal,
-			int *error);
-int mbsys_reson7k_print_position(int verbose,
-			s7kr_position *position,
-			int *error);
-int mbsys_reson7k_print_customattitude(int verbose,
-			s7kr_customattitude *customattitude,
-			int *error);
-int mbsys_reson7k_print_tide(int verbose,
-			s7kr_tide *tide,
-			int *error);
-int mbsys_reson7k_print_altitude(int verbose,
-			s7kr_altitude *altitude,
-			int *error);
-int mbsys_reson7k_print_motion(int verbose,
-			s7kr_motion *motion,
-			int *error);
-int mbsys_reson7k_print_depth(int verbose,
-			s7kr_depth *depth,
-			int *error);
-int mbsys_reson7k_print_svp(int verbose,
-			s7kr_svp *svp,
-			int *error);
-int mbsys_reson7k_print_ctd(int verbose,
-			s7kr_ctd *ctd,
-			int *error);
-int mbsys_reson7k_print_geodesy(int verbose,
-			s7kr_geodesy *geodesy,
-			int *error);
-int mbsys_reson7k_print_rollpitchheave(int verbose,
-			s7kr_rollpitchheave *rollpitchheave,
-			int *error);
-int mbsys_reson7k_print_heading(int verbose,
-			s7kr_heading *heading,
-			int *error);
-int mbsys_reson7k_print_surveyline(int verbose,
-			s7kr_surveyline *surveyline,
-			int *error);
-int mbsys_reson7k_print_navigation(int verbose,
-			s7kr_navigation *navigation,
-			int *error);
-int mbsys_reson7k_print_attitude(int verbose,
-			s7kr_attitude *attitude,
-			int *error);
-int mbsys_reson7k_print_rec1022(int verbose,
-			s7kr_rec1022 *rec1022,
-			int *error);
-int mbsys_reson7k_print_fsdwchannel(int verbose, int data_format,
-			s7k_fsdwchannel *fsdwchannel,
-			int *error);
-int mbsys_reson7k_print_fsdwssheader(int verbose,
-			s7k_fsdwssheader *fsdwssheader,
-			int *error);
-int mbsys_reson7k_print_fsdwsegyheader(int verbose,
-			s7k_fsdwsegyheader *fsdwsegyheader,
-			int *error);
-int mbsys_reson7k_print_fsdwss(int verbose,
-			s7kr_fsdwss *fsdwss,
-			int *error);
-int mbsys_reson7k_print_fsdwsb(int verbose,
-			s7kr_fsdwsb *fsdwsb,
-			int *error);
-int mbsys_reson7k_print_bluefin(int verbose,
-			s7kr_bluefin *bluefin,
-			int *error);
-int mbsys_reson7k_print_processedsidescan(int verbose,
-			s7kr_processedsidescan *processedsidescan,
-			int *error);
-int mbsys_reson7k_print_volatilesettings(int verbose,
-			s7kr_volatilesettings *volatilesettings,
-			int *error);
-int mbsys_reson7k_print_device(int verbose,
-			s7k_device *device,
-			int *error);
-int mbsys_reson7k_print_configuration(int verbose,
-			s7kr_configuration *configuration,
-			int *error);
-int mbsys_reson7k_print_matchfilter(int verbose,
-			s7kr_matchfilter *matchfilter,
-			int *error);
-int mbsys_reson7k_print_v2firmwarehardwareconfiguration(int verbose,
-			s7kr_v2firmwarehardwareconfiguration *v2firmwarehardwareconfiguration,
-			int *error);
-int mbsys_reson7k_print_beamgeometry(int verbose,
-			s7kr_beamgeometry *beamgeometry,
-			int *error);
-int mbsys_reson7k_print_calibration(int verbose,
-			s7kr_calibration *calibration,
-			int *error);
-int mbsys_reson7k_print_bathymetry(int verbose,
-			s7kr_bathymetry *bathymetry,
-			int *error);
-int mbsys_reson7k_print_backscatter(int verbose,
-			s7kr_backscatter *backscatter,
-			int *error);
-int mbsys_reson7k_print_beam(int verbose,
-			s7kr_beam *beam,
-			int *error);
-int mbsys_reson7k_print_verticaldepth(int verbose,
-			s7kr_verticaldepth *verticaldepth,
-			int *error);
-int mbsys_reson7k_print_tvg(int verbose,
-			s7kr_tvg *tvg,
-			int *error);
-int mbsys_reson7k_print_image(int verbose,
-			s7kr_image *image,
-			int *error);
-int mbsys_reson7k_print_v2pingmotion(int verbose,
-			s7kr_v2pingmotion *v2pingmotion,
-			int *error);
-int mbsys_reson7k_print_v2detectionsetup(int verbose,
-			s7kr_v2detectionsetup *v2detectionsetup,
-			int *error);
-int mbsys_reson7k_print_v2beamformed(int verbose,
-			s7kr_v2beamformed *v2beamformed,
-			int *error);
-int mbsys_reson7k_print_v2bite(int verbose,
-			s7kr_v2bite *v2bite,
-			int *error);
-int mbsys_reson7k_print_v27kcenterversion(int verbose,
-			s7kr_v27kcenterversion *v27kcenterversion,
-			int *error);
-int mbsys_reson7k_print_v28kwetendversion(int verbose,
-			s7kr_v28kwetendversion *v28kwetendversion,
-			int *error);
-int mbsys_reson7k_print_v2detection(int verbose,
-			s7kr_v2detection *v2detection,
-			int *error);
-int mbsys_reson7k_print_v2rawdetection(int verbose,
-			s7kr_v2rawdetection *v2rawdetection,
-			int *error);
-int mbsys_reson7k_print_v2snippet(int verbose,
-			s7kr_v2snippet *v2snippet,
-			int *error);
-int mbsys_reson7k_print_calibratedsnippet(int verbose,
-            s7kr_calibratedsnippet *calsnippet,
-			int *error);
-int mbsys_reson7k_print_installation(int verbose,
-			s7kr_installation *installation,
-			int *error);
-int mbsys_reson7k_print_systemeventmessage(int verbose,
-			s7kr_systemeventmessage *systemeventmessage,
-			int *error);
-int mbsys_reson7k_print_subsystem(int verbose,
-			s7kr_subsystem *subsystem,
-			int *error);
-int mbsys_reson7k_print_fileheader(int verbose,
-			s7kr_fileheader *fileheader,
-			int *error);
-int mbsys_reson7k_print_remotecontrolsettings(int verbose,
-			s7kr_remotecontrolsettings *remotecontrolsettings,
-			int *error);
-int mbsys_reson7k_print_reserved(int verbose,
-			s7kr_reserved *reserved,
-			int *error);
-int mbsys_reson7k_print_roll(int verbose,
-			s7kr_roll *roll,
-			int *error);
-int mbsys_reson7k_print_pitch(int verbose,
-			s7kr_pitch *pitch,
-			int *error);
-int mbsys_reson7k_print_soundvelocity(int verbose,
-			s7kr_soundvelocity *soundvelocity,
-			int *error);
-int mbsys_reson7k_print_absorptionloss(int verbose,
-			s7kr_absorptionloss *absorptionloss,
-			int *error);
-int mbsys_reson7k_print_spreadingloss(int verbose,
-			s7kr_spreadingloss *spreadingloss,
-			int *error);
diff --git a/src/mbio/mbsys_reson8k.c b/src/mbio/mbsys_reson8k.c
deleted file mode 100644
index 0b3860b..0000000
--- a/src/mbio/mbsys_reson8k.c
+++ /dev/null
@@ -1,1937 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbsys_reson8k.c	3.00	8/20/94
- *	$Id: mbsys_reson8k.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 2001-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbsys_reson.h defines the data structures used by MBIO functions
- * to store data from Reson SeaBat 8101 and other 8K series
- * multibeam sonar systems.
- * The data formats which are commonly used to store Reson 8K
- * data in files include
- *      MBF_xtfr8101 : MBIO ID 84
- *
- * Author:	D. W. Caress
- * Date:	September 3, 2001
- *
- * $Log: mbsys_reson8k.c,v $
- * Revision 5.7  2007/10/08 15:59:34  caress
- * MBIO changes as of 8 October 2007.
- *
- * Revision 5.6  2006/08/09 22:41:27  caress
- * Fixed programs that read or write grids so that they do not use the GMT_begin() function; these programs will now work when GMT is built in the default fashion, when GMT is built in the default fashion, with "advisory file locking" enabled.
- *
- * Revision 5.5  2006/03/06 21:47:48  caress
- * Implemented changes suggested by Bob Courtney of the Geological Survey of Canada to support translating Reson data to GSF.
- *
- * Revision 5.4  2005/11/05 00:48:04  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.3  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.2  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.1  2001/11/16 01:32:31  caress
- * Working on it...
- *
- * Revision 5.0  2001/09/17  23:24:10  caress
- * Added XTF format.
- *
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mb_define.h"
-#include "mbsys_reson8k.h"
-
-static char rcs_id[]="$Id: mbsys_reson8k.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mbsys_reson8k_alloc(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_reson8k_alloc";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_reson8k_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* allocate memory for data structure */
-	status = mb_malloc(verbose,sizeof(struct mbsys_reson8k_struct),
-				store_ptr,error);
-
-	/* get data structure pointer */
-	store = (struct mbsys_reson8k_struct *) *store_ptr;
-
-	/* initialize everything */
-
-	/* type of data record */
-	store->kind = MB_DATA_NONE;			/* Data kind */
-
-	/* type of sonar */
-	store->sonar = MBSYS_RESON8K_UNKNOWN;			/* Type of Reson sonar */
-
-	/* parameter info */
-	store->MBOffsetX = 0.0;
-	store->MBOffsetY = 0.0;
-	store->MBOffsetZ = 0.0;
-	store->NavLatency = 0.0;		/* GPS_time_received - GPS_time_sent (sec) */
-	store->NavOffsetY = 0.0;		/* Nav offset (m) */
-	store->NavOffsetX = 0.0;		/* Nav offset (m) */
-	store->NavOffsetZ = 0.0; 		/* Nav z offset (m) */
-	store->NavOffsetYaw = 0.0;		/* Heading offset (m) */
-	store->MRUOffsetY = 0.0;		/* Multibeam MRU y offset (m) */
-	store->MRUOffsetX = 0.0;		/* Multibeam MRU x offset (m) */
-	store->MRUOffsetZ = 0.0; 		/* Multibeam MRU z offset (m) */
-	store->MRUOffsetPitch = 0.0; 		/* Multibeam MRU pitch offset (degrees) */
-	store->MRUOffsetRoll = 0.0;		/* Multibeam MRU roll offset (degrees) */
-
-	/* nav data */
-	store->nav_time_d = 0.0;
-	store->nav_longitude = 0.0;
-	store->nav_latitude = 0.0;
-	store->nav_heading = 0.0;
-
-	/* attitude data */
-	store->att_timetag = 0.0;
-	store->att_heading = 0.0;
-	store->att_heave = 0.0;
-	store->att_roll = 0.0;
-	store->att_pitch = 0.0;
-
-	/* comment */
-	store->comment[0] = '\0';
-
-	/* sound velocity profile */
-	store->svp_time_d = 0.0;
-	store->svp_num = 0;
-	for (i=0;i<store->svp_num;i++)
-		{
-		store->svp_depth[0] = 0.0; 	/* meters */
-		store->svp_vel[0] = 0.0;	/* meters/sec */
-		}
-
-	/* survey data */
-	store->png_time_d = 0.0;
-	store->png_latency = 0.0;
-	store->png_latitude = 0.0;
-	store->png_longitude = 0.0;
-	store->png_roll = 0.0;
-	store->png_pitch = 0.0;
-	store->png_heading = 0.0;
-	store->png_heave = 0.0;
-
-   	store->packet_type = 0;      		/* identifier for packet type  */
-	store->packet_subtype = 0;   		/* identifier for packet subtype */
-						/* for dual head system, most significant bit (bit 7) */
-						/* indicates which sonar head to associate with packet */
-						/* 	head 1 - bit 7 set to 0 */
-						/* 	head 2 -	bit 7 set to 1 		 */
-	store->latency = 0;          		/* time from ping to output (milliseconds) */
-	store->Seconds = 0;	/* seconds since 00:00:00, 1 January 1970 */
-	store->Millisecs = 0;	/* milliseconds, LSB = 1 ms */
-	store->ping_number = 0;		/* sequential ping number from sonar startup/reset */
-	store->sonar_id = 0;		/* least significant four bytes of Ethernet address */
-	store->sonar_model = 0;		/* coded model number of sonar */
-	store->frequency = 0;		/* sonar frequency in KHz */
-	store->velocity = 0;         		/* programmed sound velocity (LSB = 1 m/sec) */
-   	store->sample_rate = 0;      		/* A/D sample rate (samples per second) */
-	store->ping_rate = 0;        		/* Ping rate (pings per second * 1000) */
-   	store->range_set = 0;        		/* range setting for SeaBat (meters ) */
-   	store->power = 0;            		/* power setting for SeaBat  	 */
-						/* bits	0-4 -	power (0 - 8) */
-	store->gain = 0;             		/* gain setting for SeaBat */
-					/* bits	0-6 -	gain (1 - 45) */
-					/* bit 	14	(0 = fixed, 1 = tvg) */
-					/* bit	15	(0 = manual, 1 = auto) */
-	store->pulse_width = 0;      		/* transmit pulse width (microseconds) */
-	store->tvg_spread = 0;		/* spreading coefficient for tvg * 4  */
-						/* valid values = 0 to 240 (0.0 to 60.0 in 0.25 steps) */
-	store->tvg_absorp = 0;		/* absorption coefficient for tvg */
-	store->projector_type = 0;      	/* bits 0-4 = projector type */
-						/* 0 = stick projector */
-						/* 1 = array face */
-						/* 2 = ER projector */
-						/* bit 7 - pitch steering (1=enabled, 0=disabled) */
-	store->projector_beam_width = 0;	/* along track transmit beam width (degrees * 10) */
-	store->beam_width_num = 0;   	/* cross track receive beam width numerator */
-	store->beam_width_denom = 0; 	/* cross track receive beam width denominator */
-						/* beam width degrees = numerator / denominator */
-	store->projector_angle = 0;		/* projector pitch steering angle (degrees * 100) */
-	store->min_range = 0;		/* sonar filter settings */
-	store->max_range = 0;
-	store->min_depth = 0;
-	store->max_depth = 0;
-	store->filters_active = 0;		/* range/depth filters active  */
-						/* bit 0 - range filter (0 = off, 1 = active) */
-						/* bit 1 - depth filter (0 = off, 1 = active) */
-	store->temperature = 0;		/* temperature at sonar head (deg C * 10) */
-	store->beam_count = 0;       		/* number of sets of beam data in packet */
-	for (i=0;i<MBSYS_RESON8K_MAXBEAMS;i++)
-		store->range[i] = 0; 		/* range for beam where n = Beam Count */
-						/* range units = sample cells * 4 */
-	for (i=0;i<MBSYS_RESON8K_MAXBEAMS/2+1;i++)
-		store->quality[i] = 0;   		/* packed quality array (two 4 bit values/char) */
-						/* cnt = n/2 if beam count even, n/2+1 if odd */
-						/* cnt then rounded up to next even number */
-						/* e.g. if beam count=101, cnt=52  */
-						/* unused trailing quality values set to zero */
-						/* bit 0 - brightness test (0=failed, 1=passed) */
-						/* bit 1 - colinearity test (0=failed, 1=passed) */
-						/* bit 2 - amplitude bottom detect used */
-						/* bit 3 - phase bottom detect used */
-						/* bottom detect can be amplitude, phase or both */
-	for (i=0;i<MBSYS_RESON8K_MAXBEAMS;i++)
-		store->intensity[i] = 0;   		/* intensities at bottom detect  */
-	store->ssrawtimedelay = 0.0;			/* raw sidescan delay (sec) */
-	store->ssrawtimeduration = 0.0;			/* raw sidescan duration (sec) */
-	store->ssrawbottompick = 0.0;			/* bottom pick time (sec) */
-	store->ssrawportsamples = 0;			/* number of port raw sidescan samples */
-	store->ssrawstbdsamples = 0;			/* number of stbd raw sidescan samples */
-	for (i=0;i<MBSYS_RESON8K_MAXRAWPIXELS;i++)
-		{
-		store->ssrawport[i] = 0;		/* raw port sidescan */
-		store->ssrawstbd[i] = 0;		/* raw starboard sidescan */
-		}
-
-	store->beams_bath = 0;
-	store->beams_amp = 0;
-	store->pixels_ss = 0;
-	store->pixel_size = 0.0;
-	for (i=0;i<MBSYS_RESON8K_MAXBEAMS;i++)
-		{
-		store->beamflag[i] = MB_FLAG_NULL; 	/* beamflags */
-		store->bath[i] = 0.0;			/* bathymetry (m) */
-		store->amp[i] = 0.0;			/* amplitude */
-		store->bath_acrosstrack[i] = 0.0;	/* acrosstrack distance (m) */
-		store->bath_alongtrack[i] = 0.0;	/* alongtrack distance (m) */
-		}
-	for (i=0;i<MBSYS_RESON8K_MAXPIXELS;i++)
-		{
-		store->ss[i] = 0.0;			/* sidescan */
-		store->ss_alongtrack[i] = 0.0;		/* alongtrack distance (m) */
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)*store_ptr);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_reson8k_deall(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_reson8k_deall";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)*store_ptr);
-		}
-
-	/* deallocate memory for data structure */
-	status = mb_free(verbose,store_ptr,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_reson8k_dimensions(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int *nbath, int *namp, int *nss, int *error)
-{
-	char	*function_name = "mbsys_reson8k_dimensions";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_reson8k_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_reson8k_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get beam and pixel numbers */
-		*nbath = store->beams_bath;
-		*namp = store->beams_amp;
-		*nss = store->pixels_ss;;
-		}
-	else
-		{
-		/* get beam and pixel numbers */
-		*nbath = 0;
-		*namp = 0;
-		*nss = 0;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		fprintf(stderr,"dbg2       nbath:      %d\n",*nbath);
-		fprintf(stderr,"dbg2        namp:      %d\n",*namp);
-		fprintf(stderr,"dbg2        nss:       %d\n",*nss);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_reson8k_extract(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int time_i[7], double *time_d,
-		double *navlon, double *navlat,
-		double *speed, double *heading,
-		int *nbath, int *namp, int *nss,
-		char *beamflag, double *bath, double *amp,
-		double *bathacrosstrack, double *bathalongtrack,
-		double *ss, double *ssacrosstrack, double *ssalongtrack,
-		char *comment, int *error)
-{
-	char	*function_name = "mbsys_reson8k_extract";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_reson8k_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_reson8k_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get time */
-		*time_d = store->png_time_d;
-		mb_get_date(verbose, *time_d, time_i);
-
-		/* get navigation */
-		*navlon = store->png_longitude;
-		*navlat = store->png_latitude;
-
-		/* get heading */
-		*heading = store->png_heading;
-
-		/* get speed  */
-		*speed = store->png_speed;
-
-		/* set beamwidths in mb_io structure */
-		mb_io_ptr->beamwidth_ltrack = 1.5;
-		mb_io_ptr->beamwidth_xtrack = 1.5;
-
-		/* read distance and depth values into storage arrays */
-		*nbath = store->beams_bath;
-		*namp = store->beams_amp;
-		*nss = store->pixels_ss;;
-		for (i=0;i<*nbath;i++)
-			{
-			beamflag[i] = store->beamflag[i];
-			bath[i] = store->bath[i];
-			bathacrosstrack[i]
-				= store->bath_acrosstrack[i];
-			bathalongtrack[i]
-				= store->bath_alongtrack[i];
-			}
-		for (i=0;i<*namp;i++)
-			{
-			amp[i] = store->intensity[i];
-			}
-		for (i=0;i<*nss;i++)
-			{
-			ss[i] = store->ss[i];
-			ssacrosstrack[i]
-				= store->pixel_size * (i - store->pixels_ss / 2);
-			ssalongtrack[i]
-				= store->ss_alongtrack[i];
-			}
-
-		/* print debug statements */
-		if (verbose >= 5)
-			{
-			fprintf(stderr,"\ndbg4  Data extracted by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  Extracted values:\n");
-			fprintf(stderr,"dbg4       kind:       %d\n",
-				*kind);
-			fprintf(stderr,"dbg4       error:      %d\n",
-				*error);
-			fprintf(stderr,"dbg4       time_i[0]:  %d\n",
-				time_i[0]);
-			fprintf(stderr,"dbg4       time_i[1]:  %d\n",
-				time_i[1]);
-			fprintf(stderr,"dbg4       time_i[2]:  %d\n",
-				time_i[2]);
-			fprintf(stderr,"dbg4       time_i[3]:  %d\n",
-				time_i[3]);
-			fprintf(stderr,"dbg4       time_i[4]:  %d\n",
-				time_i[4]);
-			fprintf(stderr,"dbg4       time_i[5]:  %d\n",
-				time_i[5]);
-			fprintf(stderr,"dbg4       time_i[6]:  %d\n",
-				time_i[6]);
-			fprintf(stderr,"dbg4       time_d:     %f\n",
-				*time_d);
-			fprintf(stderr,"dbg4       longitude:  %f\n",
-				*navlon);
-			fprintf(stderr,"dbg4       latitude:   %f\n",
-				*navlat);
-			fprintf(stderr,"dbg4       speed:      %f\n",
-				*speed);
-			fprintf(stderr,"dbg4       heading:    %f\n",
-				*heading);
-			fprintf(stderr,"dbg4       nbath:      %d\n",
-				*nbath);
-			for (i=0;i<*nbath;i++)
-			  fprintf(stderr,"dbg4       beam:%d  flag:%3d  bath:%f  acrosstrack:%f  alongtrack:%f\n",
-				i,beamflag[i],bath[i],
-				bathacrosstrack[i],bathalongtrack[i]);
-			fprintf(stderr,"dbg4        namp:     %d\n",
-				*namp);
-			for (i=0;i<*namp;i++)
-			  fprintf(stderr,"dbg4        beam:%d   amp:%f  acrosstrack:%f  alongtrack:%f\n",
-				i,amp[i],bathacrosstrack[i],bathalongtrack[i]);
-			}
-
-		/* done translating values */
-
-		}
-
-	/* extract nav from structure */
-	else if (*kind == MB_DATA_NAV)
-		{
-		/* get time */
-		*time_d = store->nav_time_d;
-		mb_get_date(verbose, *time_d, time_i);
-
-		/* get navigation */
-		*navlon = store->nav_longitude;
-		*navlat = store->nav_latitude;
-
-		/* get heading */
-		*heading = store->nav_heading;
-
-		/* get speed  */
-		*speed = 0.0;
-
-		/* read distance and depth values into storage arrays */
-		*nbath = 0;
-		*namp = 0;
-		*nss = 0;
-
-		/* print debug statements */
-		if (verbose >= 5)
-			{
-			fprintf(stderr,"\ndbg4  Data extracted by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  Extracted values:\n");
-			fprintf(stderr,"dbg4       kind:       %d\n",
-				*kind);
-			fprintf(stderr,"dbg4       error:      %d\n",
-				*error);
-			fprintf(stderr,"dbg4       time_i[0]:  %d\n",
-				time_i[0]);
-			fprintf(stderr,"dbg4       time_i[1]:  %d\n",
-				time_i[1]);
-			fprintf(stderr,"dbg4       time_i[2]:  %d\n",
-				time_i[2]);
-			fprintf(stderr,"dbg4       time_i[3]:  %d\n",
-				time_i[3]);
-			fprintf(stderr,"dbg4       time_i[4]:  %d\n",
-				time_i[4]);
-			fprintf(stderr,"dbg4       time_i[5]:  %d\n",
-				time_i[5]);
-			fprintf(stderr,"dbg4       time_i[6]:  %d\n",
-				time_i[6]);
-			fprintf(stderr,"dbg4       time_d:     %f\n",
-				*time_d);
-			fprintf(stderr,"dbg4       longitude:  %f\n",
-				*navlon);
-			fprintf(stderr,"dbg4       latitude:   %f\n",
-				*navlat);
-			fprintf(stderr,"dbg4       speed:      %f\n",
-				*speed);
-			fprintf(stderr,"dbg4       heading:    %f\n",
-				*heading);
-			}
-
-		/* done translating values */
-
-		}
-
-	/* extract comment from structure */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* copy comment */
-		strcpy(comment,store->comment);
-
-		/* print debug statements */
-		if (verbose >= 4)
-			{
-			fprintf(stderr,"\ndbg4  New ping read by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  New ping values:\n");
-			fprintf(stderr,"dbg4       error:      %d\n",
-				*error);
-			fprintf(stderr,"dbg4       comment:    %s\n",
-				comment);
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind == MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"dbg2       comment:     \ndbg2       %s\n",
-			comment);
-		}
-	else if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind != MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"dbg2       time_i[0]:     %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:     %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:     %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:     %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:     %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:     %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:     %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:        %f\n",*time_d);
-		fprintf(stderr,"dbg2       longitude:     %f\n",*navlon);
-		fprintf(stderr,"dbg2       latitude:      %f\n",*navlat);
-		fprintf(stderr,"dbg2       speed:         %f\n",*speed);
-		fprintf(stderr,"dbg2       heading:       %f\n",*heading);
-		}
-	if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind == MB_DATA_DATA)
-		{
-		fprintf(stderr,"dbg2       nbath:      %d\n",
-			*nbath);
-		for (i=0;i<*nbath;i++)
-		  fprintf(stderr,"dbg2       beam:%d  flag:%3d  bath:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,beamflag[i],bath[i],
-			bathacrosstrack[i],bathalongtrack[i]);
-		fprintf(stderr,"dbg2        namp:     %d\n",
-			*namp);
-		for (i=0;i<*namp;i++)
-		  fprintf(stderr,"dbg2       beam:%d   amp:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,amp[i],bathacrosstrack[i],bathalongtrack[i]);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_reson8k_insert(int verbose, void *mbio_ptr, void *store_ptr,
-		int kind, int time_i[7], double time_d,
-		double navlon, double navlat,
-		double speed, double heading,
-		int nbath, int namp, int nss,
-		char *beamflag, double *bath, double *amp,
-		double *bathacrosstrack, double *bathalongtrack,
-		double *ss, double *ssacrosstrack, double *ssalongtrack,
-		char *comment, int *error)
-{
-	char	*function_name = "mbsys_reson8k_insert";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_reson8k_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       kind:       %d\n",kind);
-		}
-	if (verbose >= 2 && (kind == MB_DATA_DATA || kind == MB_DATA_NAV))
-		{
-		fprintf(stderr,"dbg2       time_i[0]:  %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:  %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:  %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:  %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:  %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:  %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:  %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:     %f\n",time_d);
-		fprintf(stderr,"dbg2       navlon:     %f\n",navlon);
-		fprintf(stderr,"dbg2       navlat:     %f\n",navlat);
-		fprintf(stderr,"dbg2       speed:      %f\n",speed);
-		fprintf(stderr,"dbg2       heading:    %f\n",heading);
-		}
-	if (verbose >= 2 && kind == MB_DATA_DATA)
-		{
-		fprintf(stderr,"dbg2       nbath:      %d\n",nbath);
-		if (verbose >= 3)
-		 for (i=0;i<nbath;i++)
-		  fprintf(stderr,"dbg3       beam:%d  flag:%3d  bath:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,beamflag[i],bath[i],
-			bathacrosstrack[i],bathalongtrack[i]);
-		fprintf(stderr,"dbg2       namp:       %d\n",namp);
-		if (verbose >= 3)
-		 for (i=0;i<namp;i++)
-		  fprintf(stderr,"dbg3        beam:%d   amp:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,amp[i],bathacrosstrack[i],bathalongtrack[i]);
-		}
-	if (verbose >= 2 && kind == MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"dbg2       comment:     \ndbg2       %s\n",
-			comment);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_reson8k_struct *) store_ptr;
-
-	/* set data kind */
-	store->kind = kind;
-
-	/* insert data in structure */
-	if (store->kind == MB_DATA_DATA)
-		{
-		/* get time */
-		store->png_time_d = time_d;
-
-		/*get navigation */
-		store->png_longitude = navlon;
-		store->png_latitude = navlat;
-
-		/* get heading */
-		store->png_heading = heading;
-
-		/* get speed */
-		store->png_speed = speed;
-
-		/* insert distance and depth values into storage arrays */
-		store->beams_bath = nbath;
-		store->beams_amp = namp;
-		store->pixels_ss = nss;
-		if (store->pixels_ss > 0)
-		    store->pixel_size = (ssacrosstrack[store->pixels_ss-1] - ssacrosstrack[0])
-					/ store->pixels_ss;
-		for (i=0;i<nbath;i++)
-			{
-			store->beamflag[i] = beamflag[i];
-			store->bath[i] = bath[i];
-			store->bath_acrosstrack[i]
-				= bathacrosstrack[i];
-			store->bath_alongtrack[i]
-				= bathalongtrack[i];
-			}
-		for (i=0;i<namp;i++)
-			{
-			store->intensity[i] = (unsigned short) amp[i];
-			}
-		for (i=0;i<nss;i++)
-			{
-			store->ss[i] = ss[i];
-			store->ss_alongtrack[i]
-				= ssalongtrack[i];
-			}
-		}
-
-	/* insert nav in structure */
-	else if (store->kind == MB_DATA_NAV)
-		{
-		/* get time */
-		store->nav_time_d = time_d;
-
-		/*get navigation */
-		store->nav_longitude = navlon;
-		store->nav_latitude = navlat;
-
-		/* get heading */
-		store->nav_heading = heading;
-
-		/* get speed */
-		}
-
-	/* insert comment in structure */
-	else if (store->kind == MB_DATA_COMMENT)
-		{
-		strncpy(store->comment,comment,199);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_reson8k_ttimes(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, int *nbeams,
-	double *ttimes, double *angles,
-	double *angles_forward, double *angles_null,
-	double *heave, double *alongtrack_offset,
-	double *draft, double *ssv, int *error)
-{
-	char	*function_name = "mbsys_reson8k_ttimes";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_reson8k_struct *store;
-	double	ttscale, angscale;
-	double	heave_use;
-	double	angle, pitch;
-	int	icenter;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       ttimes:     %p\n",(void *)ttimes);
-		fprintf(stderr,"dbg2       angles_xtrk:%p\n",(void *)angles);
-		fprintf(stderr,"dbg2       angles_ltrk:%p\n",(void *)angles_forward);
-		fprintf(stderr,"dbg2       angles_null:%p\n",(void *)angles_null);
-		fprintf(stderr,"dbg2       heave:      %p\n",(void *)heave);
-		fprintf(stderr,"dbg2       ltrk_off:   %p\n",(void *)alongtrack_offset);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_reson8k_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get nbeams */
-		*nbeams = store->beams_bath;
-
-		/* get depth offset (heave + transducer_depth) */
-		heave_use = store->png_heave;
-		*draft = store->MBOffsetZ;
-		*ssv = (double) store->velocity;
-
-		/* get travel times, angles */
-		ttscale = 0.25 / store->sample_rate;
-		icenter = store->beams_bath / 2;
-		angscale = ((double)store->beam_width_num)
-			/ ((double)store->beam_width_denom);
-		for (i=0;i<*nbeams;i++)
-			{
-			ttimes[i] = ttscale * store->range[i];
-			angle = 90.0 + (icenter - i) * angscale + store->png_roll;
-			pitch = store->png_pitch;
-			mb_rollpitch_to_takeoff(
-				verbose, pitch, angle,
-				&angles[i],
-				&angles_forward[i], error);
-			angles_null[i] = angles[i];
-			heave[i] = store->png_heave;
-			alongtrack_offset[i] = 0.0;
-			}
-
-		/* set status */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error == MB_ERROR_NO_ERROR)
-		{
-		fprintf(stderr,"dbg2       draft:      %f\n",*draft);
-		fprintf(stderr,"dbg2       ssv:        %f\n",*ssv);
-		fprintf(stderr,"dbg2       nbeams:     %d\n",*nbeams);
-		for (i=0;i<*nbeams;i++)
-			fprintf(stderr,"dbg2       beam %d: tt:%f  angle_xtrk:%f  angle_ltrk:%f  angle_null:%f  heave:%f  ltrk_off:%f\n",
-				i,ttimes[i],angles[i],
-				angles_forward[i],angles_null[i],
-				heave[i],alongtrack_offset[i]);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_reson8k_detects(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, int *nbeams,
-	int *detects, int *error)
-{
-	char	*function_name = "mbsys_reson8k_detects";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_reson8k_struct *store;
-	int	detect;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       detects:    %p\n",(void *)detects);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_reson8k_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get nbeams */
-		*nbeams = store->beams_bath;
-
-		/* get detects */
-		for (i=0;i<*nbeams;i++)
-			{
-			detects[i] = MB_DETECT_AMPLITUDE;
-			}
-		for (i=0;i<*nbeams;i++)
-			{
-			/* get beamflag */
-			if (i % 2 == 0)
-				detect = ((store->quality[i/2]) & 15) & 12;
-			else
-				detect = ((store->quality[i/2] >> 4) & 15) & 12;
-			if (detect & 4)
-				detects[i] = MB_DETECT_AMPLITUDE;
-			else if (detect & 8)
-				detects[i] = MB_DETECT_PHASE;
-			else
-				detects[i] = MB_DETECT_UNKNOWN;
-			}
-
-		/* set status */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error == MB_ERROR_NO_ERROR)
-		{
-		fprintf(stderr,"dbg2       nbeams:     %d\n",*nbeams);
-		for (i=0;i<*nbeams;i++)
-			fprintf(stderr,"dbg2       beam %d: detects:%d\n",
-				i,detects[i]);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_reson8k_extract_altitude(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, double *transducer_depth, double *altitude,
-	int *error)
-{
-	char	*function_name = "mbsys_reson8k_extract_altitude";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_reson8k_struct *store;
-	double	bath_best;
-	double	xtrack_min;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_reson8k_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		bath_best = 0.0;
-		if (mb_beam_ok(store->beamflag[store->beams_bath/2]))
-		    bath_best = store->bath[store->beams_bath/2];
-		else
-		    {
-		    xtrack_min = 99999999.9;
-		    for (i=0;i<store->beams_bath;i++)
-			{
-			if (mb_beam_ok(store->beamflag[i])
-			    && fabs(store->bath_acrosstrack[i]) < xtrack_min)
-			    {
-			    xtrack_min = fabs(store->bath_acrosstrack[i]);
-			    bath_best = store->bath[i];
-			    }
-			}
-		    }
-		if (bath_best == 0.0)
-		    {
-		    xtrack_min = 99999999.9;
-		    for (i=0;i<store->beams_bath;i++)
-			{
-			if (store->beamflag[i] != MB_FLAG_NULL
-			    && fabs(store->bath_acrosstrack[i]) < xtrack_min)
-			    {
-			    xtrack_min = fabs(store->bath_acrosstrack[i]);
-			    bath_best = store->bath[i];
-			    }
-			}
-		    }
-		*transducer_depth = store->MBOffsetZ
-				    + store->png_heave;
-		*altitude = bath_best - *transducer_depth;
-
-		/* set status */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:              %d\n",*kind);
-		fprintf(stderr,"dbg2       transducer_depth:  %f\n",*transducer_depth);
-		fprintf(stderr,"dbg2       altitude:          %f\n",*altitude);
-		fprintf(stderr,"dbg2       error:             %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_reson8k_extract_nav(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int time_i[7], double *time_d,
-		double *navlon, double *navlat,
-		double *speed, double *heading, double *draft,
-		double *roll, double *pitch, double *heave,
-		int *error)
-{
-	char	*function_name = "mbsys_reson8k_extract_nav";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_reson8k_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_reson8k_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get time */
-		*time_d = store->png_time_d;
-		mb_get_date(verbose, *time_d, time_i);
-
-		/* get navigation */
-		*navlon = store->png_longitude;
-		*navlat = store->png_latitude;
-
-		/* get heading */
-		*heading = store->png_heading;
-
-		/* get speed  */
-		*speed = store->png_speed;
-
-		/* get draft  */
-		*draft = store->MBOffsetZ;
-
-		/* get roll pitch and heave */
-		*roll = store->png_roll;
-		*pitch = store->png_pitch;
-		*heave = store->png_heave;
-
-		/* print debug statements */
-		if (verbose >= 5)
-			{
-			fprintf(stderr,"\ndbg4  Data extracted by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  Extracted values:\n");
-			fprintf(stderr,"dbg4       kind:       %d\n",
-				*kind);
-			fprintf(stderr,"dbg4       error:      %d\n",
-				*error);
-			fprintf(stderr,"dbg4       time_i[0]:  %d\n",
-				time_i[0]);
-			fprintf(stderr,"dbg4       time_i[1]:  %d\n",
-				time_i[1]);
-			fprintf(stderr,"dbg4       time_i[2]:  %d\n",
-				time_i[2]);
-			fprintf(stderr,"dbg4       time_i[3]:  %d\n",
-				time_i[3]);
-			fprintf(stderr,"dbg4       time_i[4]:  %d\n",
-				time_i[4]);
-			fprintf(stderr,"dbg4       time_i[5]:  %d\n",
-				time_i[5]);
-			fprintf(stderr,"dbg4       time_i[6]:  %d\n",
-				time_i[6]);
-			fprintf(stderr,"dbg4       time_d:     %f\n",
-				*time_d);
-			fprintf(stderr,"dbg4       longitude:  %f\n",
-				*navlon);
-			fprintf(stderr,"dbg4       latitude:   %f\n",
-				*navlat);
-			fprintf(stderr,"dbg4       speed:      %f\n",
-				*speed);
-			fprintf(stderr,"dbg4       heading:    %f\n",
-				*heading);
-			fprintf(stderr,"dbg4       draft:      %f\n",
-				*draft);
-			fprintf(stderr,"dbg4       roll:       %f\n",
-				*roll);
-			fprintf(stderr,"dbg4       pitch:      %f\n",
-				*pitch);
-			fprintf(stderr,"dbg4       heave:      %f\n",
-				*heave);
-			}
-
-		/* done translating values */
-
-		}
-
-	/* extract nav from structure */
-	else if (*kind == MB_DATA_NAV)
-		{
-		/* get time */
-		*time_d = store->nav_time_d;
-		mb_get_date(verbose, *time_d, time_i);
-
-		/* get navigation */
-		*navlon = store->nav_longitude;
-		*navlat = store->nav_latitude;
-
-		/* get heading */
-		*heading = store->nav_heading;
-
-		/* get speed  */
-		*speed = 0.0;
-		/* get time */
-
-		/* get draft  */
-		*draft = store->MBOffsetZ;
-
-		/* get roll pitch and heave */
-		*roll = store->png_roll;
-		*pitch = store->png_pitch;
-		*heave = store->png_heave;
-
-		/* print debug statements */
-		if (verbose >= 5)
-			{
-			fprintf(stderr,"\ndbg4  Data extracted by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  Extracted values:\n");
-			fprintf(stderr,"dbg4       kind:       %d\n",
-				*kind);
-			fprintf(stderr,"dbg4       error:      %d\n",
-				*error);
-			fprintf(stderr,"dbg4       time_i[0]:  %d\n",
-				time_i[0]);
-			fprintf(stderr,"dbg4       time_i[1]:  %d\n",
-				time_i[1]);
-			fprintf(stderr,"dbg4       time_i[2]:  %d\n",
-				time_i[2]);
-			fprintf(stderr,"dbg4       time_i[3]:  %d\n",
-				time_i[3]);
-			fprintf(stderr,"dbg4       time_i[4]:  %d\n",
-				time_i[4]);
-			fprintf(stderr,"dbg4       time_i[5]:  %d\n",
-				time_i[5]);
-			fprintf(stderr,"dbg4       time_i[6]:  %d\n",
-				time_i[6]);
-			fprintf(stderr,"dbg4       time_d:     %f\n",
-				*time_d);
-			fprintf(stderr,"dbg4       longitude:  %f\n",
-				*navlon);
-			fprintf(stderr,"dbg4       latitude:   %f\n",
-				*navlat);
-			fprintf(stderr,"dbg4       speed:      %f\n",
-				*speed);
-			fprintf(stderr,"dbg4       heading:    %f\n",
-				*heading);
-			fprintf(stderr,"dbg4       draft:      %f\n",
-				*draft);
-			}
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind == MB_DATA_DATA)
-		{
-		fprintf(stderr,"dbg2       time_i[0]:     %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:     %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:     %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:     %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:     %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:     %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:     %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:        %f\n",*time_d);
-		fprintf(stderr,"dbg2       longitude:     %f\n",*navlon);
-		fprintf(stderr,"dbg2       latitude:      %f\n",*navlat);
-		fprintf(stderr,"dbg2       speed:         %f\n",*speed);
-		fprintf(stderr,"dbg2       heading:       %f\n",*heading);
-		fprintf(stderr,"dbg2       draft:         %f\n",*draft);
-		fprintf(stderr,"dbg2       roll:          %f\n",*roll);
-		fprintf(stderr,"dbg2       pitch:         %f\n",*pitch);
-		fprintf(stderr,"dbg2       heave:         %f\n",*heave);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_reson8k_insert_nav(int verbose, void *mbio_ptr, void *store_ptr,
-		int time_i[7], double time_d,
-		double navlon, double navlat,
-		double speed, double heading, double draft,
-		double roll, double pitch, double heave,
-		int *error)
-{
-	char	*function_name = "mbsys_reson8k_insert_nav";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_reson8k_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       time_i[0]:  %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:  %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:  %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:  %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:  %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:  %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:  %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:     %f\n",time_d);
-		fprintf(stderr,"dbg2       navlon:     %f\n",navlon);
-		fprintf(stderr,"dbg2       navlat:     %f\n",navlat);
-		fprintf(stderr,"dbg2       speed:      %f\n",speed);
-		fprintf(stderr,"dbg2       heading:    %f\n",heading);
-		fprintf(stderr,"dbg2       draft:      %f\n",draft);
-		fprintf(stderr,"dbg2       roll:       %f\n",roll);
-		fprintf(stderr,"dbg2       pitch:      %f\n",pitch);
-		fprintf(stderr,"dbg2       heave:      %f\n",heave);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_reson8k_struct *) store_ptr;
-
-	/* insert data in structure */
-	if (store->kind == MB_DATA_DATA)
-		{
-		/* get time */
-		store->png_time_d = time_d;
-
-		/*get navigation */
-		store->png_longitude = navlon;
-		store->png_latitude = navlat;
-
-		/* get heading */
-		store->png_heading = heading;
-
-		/* get speed */
-		store->png_speed = speed;
-
-		/* get draft  */
-		store->MBOffsetZ = draft;
-
-		/* get roll pitch and heave */
-		store->png_roll = roll;
-		store->png_pitch = pitch;
-		store->png_heave = heave;
-		}
-
-	/* insert nav in structure */
-	else if (store->kind == MB_DATA_NAV)
-		{
-		/* get time */
-		store->nav_time_d = time_d;
-
-		/*get navigation */
-		store->nav_longitude = navlon;
-		store->nav_latitude = navlat;
-
-		/* get heading */
-		store->nav_heading = heading;
-
-		/* get speed */
-
-		/* get draft  */
-		store->MBOffsetZ = draft;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_reson8k_extract_svp(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int *nsvp,
-		double *depth, double *velocity,
-		int *error)
-{
-	char	*function_name = "mbsys_reson8k_extract_svp";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_reson8k_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_reson8k_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_VELOCITY_PROFILE)
-		{
-		/* get number of depth-velocity pairs */
-		*nsvp = store->svp_num;
-
-		/* get profile */
-		for (i=0;i<*nsvp;i++)
-			{
-			depth[i] = 0.1 * store->svp_depth[i];
-			velocity[i] = 0.1 * store->svp_vel[i];
-			}
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:              %d\n",*kind);
-		fprintf(stderr,"dbg2       nsvp:              %d\n",*nsvp);
-		for (i=0;i<*nsvp;i++)
-		    fprintf(stderr,"dbg2       depth[%d]: %f   velocity[%d]: %f\n",i, depth[i], i, velocity[i]);
-		fprintf(stderr,"dbg2       error:             %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:            %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_reson8k_insert_svp(int verbose, void *mbio_ptr, void *store_ptr,
-		int nsvp,
-		double *depth, double *velocity,
-		int *error)
-{
-	char	*function_name = "mbsys_reson8k_insert_svp";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_reson8k_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       nsvp:       %d\n",nsvp);
-		for (i=0;i<nsvp;i++)
-		    fprintf(stderr,"dbg2       depth[%d]: %f   velocity[%d]: %f\n",i, depth[i], i, velocity[i]);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_reson8k_struct *) store_ptr;
-
-	/* insert data in structure */
-	if (store->kind == MB_DATA_VELOCITY_PROFILE)
-		{
-		/* get number of depth-velocity pairs */
-		store->svp_num = MIN(nsvp, MBSYS_RESON8K_MAXSVP);
-
-		/* get profile */
-		for (i=0;i<store->svp_num;i++)
-			{
-			store->svp_depth[i] = (int) (10 * depth[i]);
-			store->svp_vel[i] = (int) (10 * velocity[i]);
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_reson8k_copy(int verbose, void *mbio_ptr,
-			void *store_ptr, void *copy_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_reson8k_copy";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_reson8k_struct *store;
-	struct mbsys_reson8k_struct *copy;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       copy_ptr:   %p\n",(void *)copy_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointers */
-	store = (struct mbsys_reson8k_struct *) store_ptr;
-	copy = (struct mbsys_reson8k_struct *) copy_ptr;
-
-	/* copy the data */
-	*copy = *store;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_reson8k_makess(int verbose, void *mbio_ptr, void *store_ptr,
-		int pixel_size_set, double *pixel_size,
-		int swath_width_set, double *swath_width,
-		int *error)
-{
-	char	*function_name = "mbsys_reson8k_makess";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_reson8k_struct *store;
-	double	ss[MBSYS_RESON8K_MAXPIXELS];
-	int	ss_cnt[MBSYS_RESON8K_MAXPIXELS];
-	double	ssacrosstrack[MBSYS_RESON8K_MAXPIXELS];
-	double	ssalongtrack[MBSYS_RESON8K_MAXPIXELS];
-	int	nbathsort;
-	double	bathsort[MBSYS_RESON8K_MAXBEAMS];
-	double  pixel_size_calc;
-	double	ss_spacing;
-	double	ltrackss, xtrackss;
-	int	first, last, k1, k2;
-	int	istart, iend, icenter;
-	double	angscale, ttscale;
-	double	anglestart, angleend;
-	int	goodbeam1, goodbeam2, pixel1, pixel2, ipixel;
-	int	i, k, kk;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:         %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:        %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:       %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       pixel_size_set:  %d\n",pixel_size_set);
-		fprintf(stderr,"dbg2       pixel_size:      %f\n",*pixel_size);
-		fprintf(stderr,"dbg2       swath_width_set: %d\n",swath_width_set);
-		fprintf(stderr,"dbg2       swath_width:     %f\n",*swath_width);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_reson8k_struct *) store_ptr;
-
-	/* insert data in structure */
-	if (store->kind == MB_DATA_DATA
-		&& store->ssrawstbdsamples > 0
-		&& store->ssrawportsamples > 0)
-		{
-		/* zero the sidescan */
-		for (i=0;i<MBSYS_RESON8K_MAXPIXELS;i++)
-			{
-			ss[i] = 0.0;
-			ssacrosstrack[i] = 0.0;
-			ssalongtrack[i] = 0.0;
-			ss_cnt[i] = 0;
-			}
-
-		/* get raw pixel size */
-		ss_spacing = store->ssrawtimeduration / (store->ssrawportsamples - 1);
-
-		/* get median depth */
-		nbathsort = 0;
-		istart = store->beams_bath;
-		iend = -1;
-		for (i=0;i<store->beams_bath;i++)
-		    {
-		    if (mb_beam_ok(store->beamflag[i]))
-			{
-			bathsort[nbathsort] = store->bath[i];
-			nbathsort++;
-			}
-		    if (store->beamflag[i] != MB_FLAG_NULL)
-			{
-			istart = MIN(istart, i);
-			iend = MAX(iend, i);
-			}
-		    }
-
-		/* get sidescan pixel size */
-		angscale = ((double)store->beam_width_num)
-			/ ((double)store->beam_width_denom);
-		ttscale = 0.25 / store->sample_rate;
-		icenter = store->beams_bath / 2;
-		if (swath_width_set == MB_NO
-		    && nbathsort > 0)
-		    {
-		    (*swath_width) =
-		    anglestart = fabs((icenter - istart) * angscale + store->png_roll);
-		    angleend = fabs((icenter - iend) * angscale + store->png_roll);
-		    (*swath_width) = MAX(anglestart, angleend);
-		    (*swath_width) = MAX((*swath_width), 60.0);
-		    }
-		if (pixel_size_set == MB_NO
-		    && nbathsort > 0)
-		    {
-		    qsort((char *)bathsort, nbathsort, sizeof(double),(void *)mb_double_compare);
-		    pixel_size_calc = 2 * tan(DTR * (*swath_width)) * bathsort[nbathsort/2]
-					/ MBSYS_RESON8K_MAXPIXELS;
-		    pixel_size_calc = MAX(pixel_size_calc, bathsort[nbathsort/2] * sin(DTR * 0.1));
-		    pixel_size_calc = MIN(pixel_size_calc,
-					((double)(2.0 * store->range_set) / MBSYS_RESON8K_MAXPIXELS));
-		    if ((*pixel_size) <= 0.0)
-			(*pixel_size) = pixel_size_calc;
-		    else if (0.95 * (*pixel_size) > pixel_size_calc)
-			(*pixel_size) = 0.95 * (*pixel_size);
-		    else if (1.05 * (*pixel_size) < pixel_size_calc)
-			(*pixel_size) = 1.05 * (*pixel_size);
-		    else
-			(*pixel_size) = pixel_size_calc;
-		    }
-
-		/* loop over the port beams, figuring out
-			acrosstrack distance for each raw sidescan sample */
-		goodbeam1 = -1;
-		goodbeam2 = -1;
-		for (i=store->beams_bath/2;i>= 0;i--)
-		    {
-		    if (mb_beam_ok(store->beamflag[i]))
-			{
-			goodbeam1 = goodbeam2;
-			goodbeam2 = i;
-			if (goodbeam2 >= 0 && goodbeam1 >= 0)
-			    {
-			    pixel1 = (ttscale * store->range[goodbeam1] - store->ssrawtimedelay)
-					/ ss_spacing;
-			    pixel2 = (ttscale * store->range[goodbeam2] - store->ssrawtimedelay)
-					/ ss_spacing;
-/*fprintf(stderr, "port beams:%d %d  pixels: %d %d\n", goodbeam1, goodbeam2, pixel1, pixel2);*/
-			    for (ipixel=pixel1;ipixel<pixel2;ipixel++)
-				{
-				xtrackss = store->bath_acrosstrack[goodbeam1]
-				    + ((double)(ipixel - pixel1)) / ((double)(pixel2 - pixel1))
-					* (store->bath_acrosstrack[goodbeam2]
-					    - store->bath_acrosstrack[goodbeam1]);
-				ltrackss = store->bath_alongtrack[goodbeam1]
-				    + ((double)(ipixel - pixel1)) / ((double)(pixel2 - pixel1))
-					* (store->bath_alongtrack[goodbeam2]
-					    - store->bath_alongtrack[goodbeam1]);
-				kk = MBSYS_RESON8K_MAXPIXELS / 2
-				    + (int)(xtrackss / (*pixel_size));
-				if (kk > 0 && kk < MBSYS_RESON8K_MAXPIXELS)
-				    {
-				    ss[kk]  += store->ssrawport[ipixel];
-				    ssalongtrack[kk] += ltrackss;
-				    ss_cnt[kk]++;
-				    }
-				}
-			    }
-			}
-		    }
-
-		/* loop over the starboard beams, figuring out
-			acrosstrack distance for each raw sidescan sample */
-		goodbeam1 = -1;
-		goodbeam2 = -1;
-		for (i=store->beams_bath/2;i<store->beams_bath;i++)
-		    {
-		    if (mb_beam_ok(store->beamflag[i]))
-			{
-			goodbeam1 = goodbeam2;
-			goodbeam2 = i;
-			if (goodbeam2 >= 0 && goodbeam1 >= 0)
-			    {
-			    pixel1 = (ttscale * store->range[goodbeam1] - store->ssrawtimedelay)
-					/ ss_spacing;
-			    pixel2 = (ttscale * store->range[goodbeam2] - store->ssrawtimedelay)
-					/ ss_spacing;
-			    for (ipixel=pixel1;ipixel<pixel2;ipixel++)
-				{
-				xtrackss = store->bath_acrosstrack[goodbeam1]
-				    + ((double)(ipixel - pixel1)) / ((double)(pixel2 - pixel1))
-					* (store->bath_acrosstrack[goodbeam2]
-					    - store->bath_acrosstrack[goodbeam1]);
-				ltrackss = store->bath_alongtrack[goodbeam1]
-				    + ((double)(ipixel - pixel1)) / ((double)(pixel2 - pixel1))
-					* (store->bath_alongtrack[goodbeam2]
-					    - store->bath_alongtrack[goodbeam1]);
-				kk = MBSYS_RESON8K_MAXPIXELS / 2
-				    + (int)(xtrackss / (*pixel_size));
-				if (kk > 0 && kk < MBSYS_RESON8K_MAXPIXELS)
-				    {
-				    ss[kk]  += store->ssrawstbd[ipixel];
-				    ssalongtrack[kk] += ltrackss;
-				    ss_cnt[kk]++;
-				    }
-				}
-			    }
-			}
-		    }
-
-		/* average the sidescan */
-		first = MBSYS_RESON8K_MAXPIXELS;
-		last = -1;
-		for (k=0;k<MBSYS_RESON8K_MAXPIXELS;k++)
-		    {
-		    if (ss_cnt[k] > 0)
-			    {
-			    ss[k] /= ss_cnt[k];
-			    ssalongtrack[k] /= ss_cnt[k];
-			    ssacrosstrack[k]
-				    = (k - MBSYS_RESON8K_MAXPIXELS / 2)
-					    * (*pixel_size);
-			    first = MIN(first, k);
-			    last = k;
-			    }
-			else
-				ss[k] = MB_SIDESCAN_NULL;
-		    }
-
-		/* interpolate the sidescan */
-		k1 = first;
-		k2 = first;
-		for (k=first+1;k<last;k++)
-		    {
-		    if (ss_cnt[k] <= 0)
-			{
-			if (k2 <= k)
-			    {
-			    k2 = k+1;
-			    while (ss_cnt[k2] <= 0 && k2 < last)
-				k2++;
-			    }
-			ss[k] = ss[k1]
-			    + (ss[k2] - ss[k1])
-				* ((double)(k - k1)) / ((double)(k2 - k1));
-			ssacrosstrack[k]
-				= (k - MBSYS_RESON8K_MAXPIXELS / 2)
-					* (*pixel_size);
-			ssalongtrack[k] = ssalongtrack[k1]
-			    + (ssalongtrack[k2] - ssalongtrack[k1])
-				* ((double)(k - k1)) / ((double)(k2 - k1));
-			}
-		    else
-			{
-			k1 = k;
-			}
-		    }
-
-		/* insert the new sidescan into store */
-		store->pixel_size = (*pixel_size);
-		if (last > first)
-		    store->pixels_ss = MBSYS_RESON8K_MAXPIXELS;
-		else
-		    store->pixels_ss = 0;
-		for (i=0;i<MBSYS_RESON8K_MAXPIXELS;i++)
-		    {
-		    store->ss[i] = ss[i];
-		    store->ss_alongtrack[i] = ssalongtrack[i];
-		    }
-
-		/* print debug statements */
-		if (verbose >= 2)
-			{
-			fprintf(stderr,"\ndbg2  Sidescan regenerated in <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg2       beams_bath:    %d\n",
-				store->beams_bath);
-			for (i=0;i<store->beams_bath;i++)
-			  fprintf(stderr,"dbg2       beam:%d  flag:%3d  bath:%10f  amp:%10f  acrosstrack:%10f  alongtrack:%10f\n",
-				i,
-				store->beamflag[i],
-				store->bath[i],
-				store->amp[i],
-				store->bath_acrosstrack[i],
-				store->bath_alongtrack[i]);
-			fprintf(stderr,"dbg2       pixels_ss:  %d\n",
-				MBSYS_RESON8K_MAXPIXELS);
-			for (i=0;i<MBSYS_RESON8K_MAXPIXELS;i++)
-			  fprintf(stderr,"dbg2       pixel:%4d  cnt:%3d  ss:%10f  xtrack:%10f  ltrack:%10f\n",
-				i,ss_cnt[i],ss[i],
-				ssacrosstrack[i],
-				ssalongtrack[i]);
-			fprintf(stderr,"dbg2       pixels_ss:  %d\n",
-				store->pixels_ss);
-			for (i=0;i<MBSYS_RESON8K_MAXPIXELS;i++)
-			  fprintf(stderr,"dbg2       pixel:%4d  ss:%10f  xtrack:%10f  ltrack:%10f\n",
-				i,store->ss[i],store->ss_acrosstrack[i],store->ss_alongtrack[i]);
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       pixel_size:      %f\n",*pixel_size);
-		fprintf(stderr,"dbg2       swath_width:     %f\n",*swath_width);
-		fprintf(stderr,"dbg2       error:           %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:          %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mbsys_reson8k.h b/src/mbio/mbsys_reson8k.h
deleted file mode 100644
index 9a1b342..0000000
--- a/src/mbio/mbsys_reson8k.h
+++ /dev/null
@@ -1,281 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbsys_reson.h	8/20/94
- *	$Id: mbsys_reson8k.h 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 2001-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbsys_reson.h defines the data structures used by MBIO functions
- * to store data from Reson SeaBat 8101 and other 8K series
- * multibeam sonar systems.
- * The data formats which are commonly used to store Reson 8K
- * data in files include
- *       MBF_XTFR8101 : MBIO ID 84
- *
- *
- * Author:	D. W. Caress
- * Date:	September 2, 2001
- *
- * $Log: mbsys_reson8k.h,v $
- * Revision 5.5  2006/03/06 21:47:48  caress
- * Implemented changes suggested by Bob Courtney of the Geological Survey of Canada to support translating Reson data to GSF.
- *
- * Revision 5.4  2005/11/05 00:48:05  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.3  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.2  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.1  2001/11/15 22:36:43  caress
- * Working on it.
- *
- * Revision 5.0  2001/09/17  23:24:10  caress
- * Added XTF format.
- *
- *
- *
- */
-/*
- * Notes on the MBSYS_RESON8K data:
- *
- */
-
-/* sonar types */
-#define	MBSYS_RESON8K_UNKNOWN		0
-#define	MBSYS_RESON8K_SEABAT9001	9001
-#define	MBSYS_RESON8K_SEABAT9002	9002
-#define	MBSYS_RESON8K_SEABAT8101	8101
-#define	MBSYS_RESON8K_SEABAT8111	8111
-#define	MBSYS_RESON8K_SEABAT8125	8125
-#define	MBSYS_RESON8K_MESOTECHSM2000	2000
-
-/* maximum number of beams and pixels */
-#define	MBSYS_RESON8K_MAXBEAMS	240
-#define	MBSYS_RESON8K_MAXRAWPIXELS	8192
-#define	MBSYS_RESON8K_MAXPIXELS	1024
-#define	MBSYS_RESON8K_MAXSVP	500
-#define	MBSYS_RESON8K_COMMENT_LENGTH	200
-
-#define RESON8K_RT_1		0x11
-#define RESON8K_RIT_1		0x12
-#define RESON8K_RT_2		0x13
-#define RESON8K_RIT_2		0x14
-#define RESON8K_RT_3		0x17
-#define RESON8K_RIT_3		0x18
-
-/* internal data structure */
-struct mbsys_reson8k_struct
-	{
-	/* type of data record */
-	int	kind;			/* Data kind */
-
-	/* type of sonar */
-	int	sonar;			/* Type of Reson sonar */
-
-	/* parameter info */
-	float		MBOffsetX;
-	float		MBOffsetY;
-	float		MBOffsetZ;
-	float		NavLatency;		/* GPS_time_received - GPS_time_sent (sec) */
-	float		NavOffsetY;		/* Nav offset (m) */
-	float		NavOffsetX;		/* Nav offset (m) */
-	float		NavOffsetZ; 		/* Nav z offset (m) */
-	float		NavOffsetYaw;		/* Heading offset (m) */
-	float		MRUOffsetY;		/* Multibeam MRU y offset (m) */
-	float		MRUOffsetX;		/* Multibeam MRU x offset (m) */
-	float		MRUOffsetZ; 		/* Multibeam MRU z offset (m) */
-	float		MRUOffsetPitch; 	/* Multibeam MRU pitch offset (degrees) */
-	float		MRUOffsetRoll;		/* Multibeam MRU roll offset (degrees) */
-
-	/* nav data */
-	double	nav_time_d;
-	double	nav_longitude;
-	double	nav_latitude;
-	float	nav_heading;
-
-	/* attitude data */
-	double	att_timetag;
-	float	att_heading;
-	float	att_heave;
-	float	att_roll;
-	float	att_pitch;
-
-	/* comment */
-	char	comment[MBSYS_RESON8K_COMMENT_LENGTH];
-
-	/* sound velocity profile */
-	double	svp_time_d;
-	int	svp_num;
-	float	svp_depth[MBSYS_RESON8K_MAXSVP]; /* meters */
-	float	svp_vel[MBSYS_RESON8K_MAXSVP];	/* meters/sec */
-
-	/* survey data */
-	double	png_time_d;
-	double	png_latency;
-	double	png_latitude;
-	double	png_longitude;
-	double	png_speed;			/* km/hr */
-	double	png_roll;
-	double	png_pitch;
-	double	png_heading;
-	double	png_heave;
-
-
-   	char      	packet_type;      		/* identifier for packet type (0x18) */
-	char           	packet_subtype;   	/* identifier for packet subtype */
-						/* for dual head system, most significant bit (bit 7) */
-						/* indicates which sonar head to associate with packet */
-						/* 	head 1 - bit 7 set to 0 */
-						/* 	head 2 -	bit 7 set to 1 		 */
-	unsigned short 	latency;          		/* time from ping to output (milliseconds) */
-	unsigned int	Seconds;	/* seconds since 00:00:00, 1 January 1970 */
-	unsigned int	Millisecs;	/* milliseconds, LSB = 1 ms */
-	unsigned int	ping_number;		/* sequential ping number from sonar startup/reset */
-	unsigned int	sonar_id;		/* least significant four bytes of Ethernet address */
-	unsigned short	sonar_model;		/* coded model number of sonar */
-	unsigned short	frequency;		/* sonar frequency in KHz */
-	unsigned short 	velocity;         		/* programmed sound velocity (LSB = 1 m/sec) */
-   	unsigned short 	sample_rate;      		/* A/D sample rate (samples per second) */
-	unsigned short 	ping_rate;        		/* Ping rate (pings per second * 1000) */
-   	unsigned short 	range_set;        		/* range setting for SeaBat (meters ) */
-   	unsigned short 	power;            		/* power setting for SeaBat  	 */
-						/* bits	0-4 -	power (0 - 8) */
-	unsigned short 	gain;             		/* gain setting for SeaBat */
-					/* bits	0-6 -	gain (1 - 45) */
-					/* bit 	14	(0 = fixed, 1 = tvg) */
-					/* bit	15	(0 = manual, 1 = auto) */
-	unsigned short  	pulse_width;      		/* transmit pulse width (microseconds) */
-	mb_u_char	tvg_spread;		/* spreading coefficient for tvg * 4  */
-						/* valid values = 0 to 240 (0.0 to 60.0 in 0.25 steps) */
-	mb_u_char	tvg_absorp;		/* absorption coefficient for tvg */
-	mb_u_char     	projector_type;      	/* bits 0-4 = projector type */
-						/* 0 = stick projector */
-						/* 1 = array face */
-						/* 2 = ER projector */
-						/* bit 7 - pitch steering (1=enabled, 0=disabled) */
-	mb_u_char      projector_beam_width;	/* along track transmit beam width (degrees * 10) */
-	unsigned short  	beam_width_num;   	/* cross track receive beam width numerator */
-	unsigned short 	beam_width_denom; 	/* cross track receive beam width denominator */
-						/* beam width degrees = numerator / denominator */
-	short		projector_angle;		/* projector pitch steering angle (degrees * 100) */
-	unsigned short	min_range;		/* sonar filter settings */
-	unsigned short	max_range;
-	unsigned short	min_depth;
-	unsigned short	max_depth;
-	mb_u_char	filters_active;		/* range/depth filters active  */
-						/* bit 0 - range filter (0 = off, 1 = active) */
-						/* bit 1 - depth filter (0 = off, 1 = active) */
-	mb_u_char	spare[3];			/* spare field for future growth */
-	short		temperature;		/* temperature at sonar head (deg C * 10) */
-	short          	beam_count;       		/* number of sets of beam data in packet */
-	unsigned short 	range[MBSYS_RESON8K_MAXBEAMS]; 		/* range for beam where n = Beam Count */
-						/* range units = sample cells * 4 */
-	mb_u_char  	quality[MBSYS_RESON8K_MAXBEAMS/2+1];   		/* packed quality array (two 4 bit values/char) */
-						/* cnt = n/2 if beam count even, n/2+1 if odd */
-						/* cnt then rounded up to next even number */
-						/* e.g. if beam count=101, cnt=52  */
-						/* unused trailing quality values set to zero */
-						/* bit 0 - brightness test (0=failed, 1=passed) */
-						/* bit 1 - colinearity test (0=failed, 1=passed) */
-						/* bit 2 - amplitude bottom detect used */
-						/* bit 3 - phase bottom detect used */
-						/* bottom detect can be amplitude, phase or both */
-	unsigned short	intensity[MBSYS_RESON8K_MAXBEAMS];   		/* intensities at bottom detect  */
-
-	float ssrawtimedelay;				/* raw sidescan delay (sec) */
-	float ssrawtimeduration;			/* raw sidescan duration (sec) */
-	float ssrawbottompick;				/* bottom pick time (sec) */
-	unsigned short ssrawportsamples;		/* number of port raw sidescan samples */
-	unsigned short ssrawstbdsamples;		/* number of stbd raw sidescan samples */
-	unsigned short ssrawport[MBSYS_RESON8K_MAXRAWPIXELS];		/* raw port sidescan */
-	unsigned short ssrawstbd[MBSYS_RESON8K_MAXRAWPIXELS];		/* raw starboard sidescan */
-
-	int	beams_bath;
-	int	beams_amp;
-	int	pixels_ss;
-	double	pixel_size;
-	char 	beamflag[MBSYS_RESON8K_MAXBEAMS]; 		/* beamflags */
-	double 	bath[MBSYS_RESON8K_MAXBEAMS];			/* bathymetry (m) */
-	double 	amp[MBSYS_RESON8K_MAXBEAMS];			/* bathymetry (m) */
-	double 	bath_acrosstrack[MBSYS_RESON8K_MAXBEAMS];	/* acrosstrack distance (m) */
-	double 	bath_alongtrack[MBSYS_RESON8K_MAXBEAMS];	/* alongtrack distance (m) */
-	double	ss[MBSYS_RESON8K_MAXPIXELS];			/* sidescan */
-	double 	ss_acrosstrack[MBSYS_RESON8K_MAXPIXELS];	/* acrosstrack distance (m) */
-	double 	ss_alongtrack[MBSYS_RESON8K_MAXPIXELS];		/* alongtrack distance (m) */
-	};
-
-/* system specific function prototypes */
-int mbsys_reson8k_alloc(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error);
-int mbsys_reson8k_deall(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error);
-int mbsys_reson8k_dimensions(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int *nbath, int *namp, int *nss, int *error);
-int mbsys_reson8k_extract(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int time_i[7], double *time_d,
-			double *navlon, double *navlat,
-			double *speed, double *heading,
-			int *nbath, int *namp, int *nss,
-			char *beamflag, double *bath, double *amp,
-			double *bathacrosstrack, double *bathalongtrack,
-			double *ss, double *ssacrosstrack, double *ssalongtrack,
-			char *comment, int *error);
-int mbsys_reson8k_insert(int verbose, void *mbio_ptr, void *store_ptr,
-			int kind, int time_i[7], double time_d,
-			double navlon, double navlat,
-			double speed, double heading,
-			int nbath, int namp, int nss,
-			char *beamflag, double *bath, double *amp,
-			double *bathacrosstrack, double *bathalongtrack,
-			double *ss, double *ssacrosstrack, double *ssalongtrack,
-			char *comment, int *error);
-int mbsys_reson8k_ttimes(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int *nbeams,
-			double *ttimes, double *angles,
-			double *angles_forward, double *angles_null,
-			double *heave, double *alongtrack_offset,
-			double *draft, double *ssv, int *error);
-int mbsys_reson8k_detects(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int *nbeams, int *detects, int *error);
-int mbsys_reson8k_extract_altitude(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, double *transducer_depth, double *altitude,
-			int *error);
-int mbsys_reson8k_extract_nav(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int time_i[7], double *time_d,
-			double *navlon, double *navlat,
-			double *speed, double *heading, double *draft,
-			double *roll, double *pitch, double *heave,
-			int *error);
-int mbsys_reson8k_insert_nav(int verbose, void *mbio_ptr, void *store_ptr,
-			int time_i[7], double time_d,
-			double navlon, double navlat,
-			double speed, double heading, double draft,
-			double roll, double pitch, double heave,
-			int *error);
-int mbsys_reson8k_extract_svp(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind,
-			int *nsvp,
-			double *depth, double *velocity,
-			int *error);
-int mbsys_reson8k_insert_svp(int verbose, void *mbio_ptr, void *store_ptr,
-			int nsvp,
-			double *depth, double *velocity,
-			int *error);
-int mbsys_reson8k_copy(int verbose, void *mbio_ptr,
-			void *store_ptr, void *copy_ptr,
-			int *error);
-int mbsys_reson8k_makess(int verbose, void *mbio_ptr, void *store_ptr,
-			int pixel_size_set, double *pixel_size,
-			int swath_width_set, double *swath_width,
-			int *error);
diff --git a/src/mbio/mbsys_sb.c b/src/mbio/mbsys_sb.c
deleted file mode 100644
index b1d5aae..0000000
--- a/src/mbio/mbsys_sb.c
+++ /dev/null
@@ -1,1267 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbsys_sb.c	2/26/93
- *	$Id: mbsys_sb.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1993-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbsys_sb.c contains the functions for handling the data structure
- * used by MBIO functions to store data from the 16-beam Sea Beam
- * multibeam sonar systems.
- * The data formats which are commonly used to store Sea Beam
- * data in files include
- *      MBF_SBSIOMRG : MBIO ID 11
- *      MBF_SBSIOCEN : MBIO ID 12
- *      MBF_SBSIOLSI : MBIO ID 13
- *      MBF_SBURICEN : MBIO ID 14
- *      MBF_SBURIVAX : MBIO ID 15
- *      MBF_SBSIOSWB : MBIO ID 16
- *      MBF_SBIFREMR : MBIO ID 17
- *
- * Author:	D. W. Caress
- * Date:	February 26, 1993
- * $Log: mbsys_sb.c,v $
- * Revision 5.7  2009/03/08 09:21:00  caress
- * Fixed problem reading and writing format 16 (MBF_SBSIOSWB) data on little endian systems.
- *
- * Revision 5.6  2005/11/05 00:48:04  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.5  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.4  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.3  2001/08/25 00:54:13  caress
- * Adding beamwidth values to extract functions.
- *
- * Revision 5.2  2001/07/20  00:32:54  caress
- * Release 5.0.beta03
- *
- * Revision 5.1  2001/01/22  07:43:34  caress
- * Version 5.0.beta01
- *
- * Revision 5.0  2000/12/01  22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.14  2000/10/11  01:03:21  caress
- * Convert to ANSI C
- *
- * Revision 4.13  2000/09/30  06:32:52  caress
- * Snapshot for Dale.
- *
- * Revision 4.12  1998/10/05  18:32:27  caress
- * MB-System version 4.6beta
- *
- * Revision 1.1  1998/10/05  17:46:15  caress
- * Initial revision
- *
- * Revision 4.11  1997/07/25  14:19:53  caress
- * Version 4.5beta2.
- * Much mucking, particularly with Simrad formats.
- *
- * Revision 4.10  1997/04/21  17:02:07  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.9  1996/04/22  13:21:19  caress
- * Now have DTR and MIN/MAX defines in mb_define.h
- *
- * Revision 4.9  1996/04/22  13:21:19  caress
- * Now have DTR and MIN/MAX defines in mb_define.h
- *
- * Revision 4.8  1995/11/27  21:52:49  caress
- * New version of mb_ttimes with ssv and angles_null.
- *
- * Revision 4.7  1995/09/28  18:10:48  caress
- * Various bug fixes working toward release 4.3.
- *
- * Revision 4.6  1995/08/17  14:41:09  caress
- * Revision for release 4.3.
- *
- * Revision 4.5  1995/07/13  19:13:36  caress
- * Intermediate check-in during major bug-fixing flail.
- *
- * Revision 4.4  1995/03/06  19:38:54  caress
- * Changed include strings.h to string.h for POSIX compliance.
- *
- * Revision 4.3  1994/11/09  21:40:34  caress
- * Changed ttimes extraction routines to handle forward beam angles
- * so that alongtrack distances can be calculated.
- *
- * Revision 4.2  1994/10/21  12:20:01  caress
- * Release V4.0
- *
- * Revision 4.1  1994/04/11  23:34:41  caress
- * Added function to extract travel time and beam angle data
- * from multibeam data in an internal data structure.
- *
- * Revision 4.1  1994/04/11  23:34:41  caress
- * Added function to extract travel time and beam angle data
- * from multibeam data in an internal data structure.
- *
- * Revision 4.0  1994/03/06  00:01:56  caress
- * First cut at version 4.0
- *
- * Revision 4.1  1994/03/03  03:39:43  caress
- * Fixed copyright message.
- *
- * Revision 4.0  1994/02/20  04:13:19  caress
- * First cut at new version.  Now passes unused arrays for
- * amplitude and sidescan data.
- *
- * Revision 3.0  1993/05/14  23:05:12  sohara
- * initial version
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mb_define.h"
-#include "mbsys_sb.h"
-
-static char rcs_id[]="$Id: mbsys_sb.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mbsys_sb_alloc(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_sb_alloc";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* allocate memory for data structure */
-	status = mb_malloc(verbose,sizeof(struct mbsys_sb_struct),
-				store_ptr,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)*store_ptr);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_sb_deall(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_sb_deall";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)*store_ptr);
-		}
-
-	/* deallocate memory for data structure */
-	status = mb_free(verbose,store_ptr,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_sb_dimensions(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int *nbath, int *namp, int *nss, int *error)
-{
-	char	*function_name = "mbsys_sb_dimensions";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_sb_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_sb_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get beam and pixel numbers */
-		*nbath = mb_io_ptr->beams_bath_max;
-		*namp = 0;
-		*nss = 0;
-		}
-	else
-		{
-		/* get beam and pixel numbers */
-		*nbath = 0;
-		*namp = 0;
-		*nss = 0;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		fprintf(stderr,"dbg2       nbath:      %d\n",*nbath);
-		fprintf(stderr,"dbg2        namp:      %d\n",*namp);
-		fprintf(stderr,"dbg2        nss:       %d\n",*nss);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_sb_extract(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int time_i[7], double *time_d,
-		double *navlon, double *navlat,
-		double *speed, double *heading,
-		int *nbath, int *namp, int *nss,
-		char *beamflag, double *bath, double *amp,
-		double *bathacrosstrack, double *bathalongtrack,
-		double *ss, double *ssacrosstrack, double *ssalongtrack,
-		char *comment, int *error)
-{
-	char	*function_name = "mbsys_sb_extract";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_sb_struct *store;
-	int	time_j[5];
-	int	id;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_sb_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get time */
-		time_j[0] = store->year;
-		time_j[1] = store->day;
-		time_j[2] = store->min;
-		time_j[3] = store->sec;
-		time_j[4] = 0;
-		mb_get_itime(verbose,time_j,time_i);
-		mb_get_time(verbose,time_i,time_d);
-
-		/* get navigation */
-		*navlon = store->lon2u/60. + store->lon2b/600000.;
-		*navlat = store->lat2u/60. + store->lat2b/600000. - 90.;
-
-		/* get heading (360 degrees = 65536) */
-		*heading = store->sbhdg*0.0054932;
-
-		/* set speed to zero */
-		*speed = 0.0;
-
-		/* set beamwidths in mb_io structure */
-		mb_io_ptr->beamwidth_ltrack = 2.67;
-		mb_io_ptr->beamwidth_xtrack = 2.67;
-
-		/* read distance and depth values into storage arrays */
-		/* switch order of data as it is read into the global arrays */
-		*nbath = mb_io_ptr->beams_bath_max;
-		*namp = 0;
-		*nss = 0;
-		id = *nbath - 1;
-		for (i=0;i<*nbath;i++)
-			{
-			if (store->deph[i] > 0)
-			    {
-			    beamflag[id-i] = MB_FLAG_NONE;
-			    bath[id-i] = store->deph[i];
-			    }
-			else if (store->deph[i] < 0)
-			    {
-			    beamflag[id-i]
-				= MB_FLAG_MANUAL + MB_FLAG_FLAG;
-			    bath[id-i] = -store->deph[i];
-			    }
-			else
-			    {
-			    beamflag[id-i] = MB_FLAG_NULL;
-			    bath[id-i] = store->deph[i];
-			    }
-			bathacrosstrack[id-i] = store->dist[i];
-			bathalongtrack[id-i] = 0.0;
-			}
-
-		/* print debug statements */
-		if (verbose >= 5)
-			{
-			fprintf(stderr,"\ndbg4  Data extracted by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  Extracted values:\n");
-			fprintf(stderr,"dbg4       kind:       %d\n",
-				*kind);
-			fprintf(stderr,"dbg4       error:      %d\n",
-				*error);
-			fprintf(stderr,"dbg4       time_i[0]:  %d\n",
-				time_i[0]);
-			fprintf(stderr,"dbg4       time_i[1]:  %d\n",
-				time_i[1]);
-			fprintf(stderr,"dbg4       time_i[2]:  %d\n",
-				time_i[2]);
-			fprintf(stderr,"dbg4       time_i[3]:  %d\n",
-				time_i[3]);
-			fprintf(stderr,"dbg4       time_i[4]:  %d\n",
-				time_i[4]);
-			fprintf(stderr,"dbg4       time_i[5]:  %d\n",
-				time_i[5]);
-			fprintf(stderr,"dbg4       time_i[6]:  %d\n",
-				time_i[6]);
-			fprintf(stderr,"dbg4       time_d:     %f\n",
-				*time_d);
-			fprintf(stderr,"dbg4       longitude:  %f\n",
-				*navlon);
-			fprintf(stderr,"dbg4       latitude:   %f\n",
-				*navlat);
-			fprintf(stderr,"dbg4       speed:      %f\n",
-				*speed);
-			fprintf(stderr,"dbg4       heading:    %f\n",
-				*heading);
-			fprintf(stderr,"dbg4       nbath:      %d\n",
-				*nbath);
-			for (i=0;i<*nbath;i++)
-			  fprintf(stderr,"dbg4       beam:%2d  flag:%3d  bath:%f  bathdist:%f\n",
-				i,beamflag[i],bath[i],bathacrosstrack[i]);
-			}
-
-		/* done translating values */
-
-		}
-
-	/* extract comment from structure */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* copy comment */
-		strcpy(comment,store->comment);
-
-		/* print debug statements */
-		if (verbose >= 4)
-			{
-			fprintf(stderr,"\ndbg4  New ping read by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  New ping values:\n");
-			fprintf(stderr,"dbg4       error:      %d\n",
-				*error);
-			fprintf(stderr,"dbg4       comment:    %s\n",
-				comment);
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind == MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"dbg2       comment:     \ndbg2       %s\n",
-			comment);
-		}
-	else if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind != MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"dbg2       time_i[0]:     %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:     %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:     %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:     %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:     %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:     %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:     %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:        %f\n",*time_d);
-		fprintf(stderr,"dbg2       longitude:     %f\n",*navlon);
-		fprintf(stderr,"dbg2       latitude:      %f\n",*navlat);
-		fprintf(stderr,"dbg2       speed:         %f\n",*speed);
-		fprintf(stderr,"dbg2       heading:       %f\n",*heading);
-		}
-	if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind == MB_DATA_DATA)
-		{
-		fprintf(stderr,"dbg2       nbath:         %d\n",*nbath);
-		for (i=0;i<*nbath;i++)
-		  fprintf(stderr,"dbg2       beam:%2d  flag:%3d  bath:%f  bathdist:%f\n",
-			i,beamflag[i],bath[i],bathacrosstrack[i]);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_sb_insert(int verbose, void *mbio_ptr, void *store_ptr,
-		int kind, int time_i[7], double time_d,
-		double navlon, double navlat,
-		double speed, double heading,
-		int nbath, int namp, int nss,
-		char *beamflag, double *bath, double *amp,
-		double *bathacrosstrack, double *bathalongtrack,
-		double *ss, double *ssacrosstrack, double *ssalongtrack,
-		char *comment, int *error)
-{
-	char	*function_name = "mbsys_sb_insert";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_sb_struct *store;
-	int	time_j[5];
-	int	id;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       kind:       %d\n",kind);
-		}
-	if (verbose >= 2 && (kind == MB_DATA_DATA || kind == MB_DATA_NAV))
-		{
-		fprintf(stderr,"dbg2       time_i[0]:  %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:  %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:  %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:  %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:  %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:  %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:  %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:     %f\n",time_d);
-		fprintf(stderr,"dbg2       navlon:     %f\n",navlon);
-		fprintf(stderr,"dbg2       navlat:     %f\n",navlat);
-		fprintf(stderr,"dbg2       speed:      %f\n",speed);
-		fprintf(stderr,"dbg2       heading:    %f\n",heading);
-		}
-	if (verbose >= 2 && kind == MB_DATA_DATA)
-		{
-		fprintf(stderr,"dbg2       nbath:      %d\n",nbath);
-		if (verbose >= 3)
-		 for (i=0;i<nbath;i++)
-		  fprintf(stderr,"dbg3       flag[%d]: %d  bath[%d]: %f  bathdist[%d]: %f\n",
-			i,beamflag[i],i,bath[i],i,bathacrosstrack[i]);
-		fprintf(stderr,"dbg2       namp:       %d\n",namp);
-		if (verbose >= 3)
-		 for (i=0;i<namp;i++)
-		  fprintf(stderr,"dbg3        amp[%d]: %f\n",
-			i,amp[i]);
-		fprintf(stderr,"dbg2        nss:       %d\n",nss);
-		if (verbose >= 3)
-		 for (i=0;i<nss;i++)
-		  fprintf(stderr,"dbg3        ss[%d]: %f    ssdist[%d]: %f\n",
-			i,ss[i],i,ssacrosstrack[i]);
-		}
-	if (verbose >= 2 && kind == MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"dbg2       comment:     \ndbg2       %s\n",
-			comment);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_sb_struct *) store_ptr;
-
-	/* set data kind */
-	store->kind = kind;
-
-	/* insert data in structure */
-	if (store->kind == MB_DATA_DATA)
-		{
-		/* get time */
-		mb_get_jtime(verbose,time_i,time_j);
-		store->year = time_j[0];
-		store->day = time_j[1];
-		store->min = time_j[2];
-		store->sec = time_j[3];
-
-		/* get navigation */
-		if (navlon < 0.0) navlon = navlon + 360.0;
-		store->lon2u = (short int) 60.0*navlon;
-		store->lon2b = (short int) (600000.0*(navlon
-			- store->lon2u/60.0));
-		navlat = navlat + 90.0;
-		store->lat2u = (short int) 60.0*navlat;
-		store->lat2b = (short int) (600000.0*(navlat
-			- store->lat2u/60.0));
-
-		/* get heading (360 degrees = 65536) */
-		store->sbhdg = 182.044444*heading;
-
-		/* put distance and depth values
-			into sbsiocen data structure */
-		/* switch order of data as it is read
-			into the output arrays */
-		id = nbath - 1;
-		for (i=0;i<nbath;i++)
-			{
-			if (mb_beam_check_flag(beamflag[id-i]))
-			    store->deph[i] = -bath[id-i];
-			else
-			    store->deph[i] = bath[id-i];
-			store->dist[i] = bathacrosstrack[id-i];
-			}
-		}
-
-	/* insert comment in structure */
-	else if (store->kind == MB_DATA_COMMENT)
-		{
-		strcpy(store->comment,comment);
-		}
-
-	if (verbose >= 2 && (kind == MB_DATA_DATA || kind == MB_DATA_NAV))
-		{
-		fprintf(stderr,"dbg2   Data inserted into storage structure:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",store->kind);
-		fprintf(stderr,"dbg2       lon2u:      %d\n",store->lon2u);
-		fprintf(stderr,"dbg2       lon2b:      %d\n",store->lon2b);
-		fprintf(stderr,"dbg2       lat2u:      %d\n",store->lat2u);
-		fprintf(stderr,"dbg2       lat2b:      %d\n",store->lat2b);
-		fprintf(stderr,"dbg2       year:       %d\n",store->year);
-		fprintf(stderr,"dbg2       day:        %d\n",store->day);
-		fprintf(stderr,"dbg2       min:        %d\n",store->min);
-		fprintf(stderr,"dbg2       sec:        %d\n",store->sec);
-		}
-	if (verbose >= 2 && kind == MB_DATA_DATA)
-		{
-		for (i=0;i<MBSYS_SB_BEAMS;i++)
-		  fprintf(stderr,"dbg3       dist[%d]: %d  deph[%d]: %d\n",
-			i,store->dist[i],i,store->deph[i]);
-		fprintf(stderr,"dbg2       sbtim:        %d\n",store->sbtim);
-		fprintf(stderr,"dbg2       sbhdg:        %d\n",store->sbhdg);
-		fprintf(stderr,"dbg2       axis:         %d\n",store->axis);
-		fprintf(stderr,"dbg2       major:        %d\n",store->major);
-		fprintf(stderr,"dbg2       minor:        %d\n",store->minor);
-		}
-	if (verbose >= 2 && kind == MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"dbg2   Data inserted into storage structure:\n");
-		fprintf(stderr,"dbg2       comment:     \ndbg2       %s\n",
-			store->comment);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_sb_ttimes(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, int *nbeams,
-	double *ttimes, double *angles,
-	double *angles_forward, double *angles_null,
-	double *heave, double *alongtrack_offset,
-	double *draft, double *ssv, int *error)
-{
-	char	*function_name = "mbsys_sb_ttimes";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_sb_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       ttimes:     %p\n",(void *)ttimes);
-		fprintf(stderr,"dbg2       angles_xtrk:%p\n",(void *)angles);
-		fprintf(stderr,"dbg2       angles_ltrk:%p\n",(void *)angles_forward);
-		fprintf(stderr,"dbg2       angles_null:%p\n",(void *)angles_null);
-		fprintf(stderr,"dbg2       heave:      %p\n",(void *)heave);
-		fprintf(stderr,"dbg2       ltrk_off:   %p\n",(void *)alongtrack_offset);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_sb_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get nbeams */
-		*nbeams = mb_io_ptr->beams_bath_max;
-
-		/* get travel times, angles */
-		for (i=0;i<*nbeams;i++)
-			{
-			ttimes[i] = 0.0;
-			angles[i] = 0.0;
-			angles_forward[i] = 0.0;
-			angles_null[i] = 0.0;
-			heave[i] = 0.0;
-			alongtrack_offset[i] = 0.0;
-			}
-
-		/* get ssv */
-		*ssv = 0.0;
-		*draft = 0.0;
-
-		/* set status */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error == MB_ERROR_NO_ERROR)
-		{
-		fprintf(stderr,"dbg2       draft:      %f\n",*draft);
-		fprintf(stderr,"dbg2       ssv:        %f\n",*ssv);
-		fprintf(stderr,"dbg2       nbeams:     %d\n",*nbeams);
-		for (i=0;i<*nbeams;i++)
-			fprintf(stderr,"dbg2       beam %d: tt:%f  angle_xtrk:%f  angle_ltrk:%f  angle_null:%f  heave:%f  ltrk_off:%f\n",
-				i,ttimes[i],angles[i],
-				angles_forward[i],angles_null[i],
-				heave[i],alongtrack_offset[i]);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_sb_detects(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, int *nbeams,
-	int *detects, int *error)
-{
-	char	*function_name = "mbsys_sb_detects";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_sb_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       detects:    %p\n",(void *)detects);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_sb_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get nbeams */
-		*nbeams = mb_io_ptr->beams_bath_max;
-
-		/* get detects */
-		for (i=0;i<*nbeams;i++)
-			{
-			detects[i] = MB_DETECT_AMPLITUDE;
-			}
-
-		/* set status */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error == MB_ERROR_NO_ERROR)
-		{
-		fprintf(stderr,"dbg2       nbeams:     %d\n",*nbeams);
-		for (i=0;i<*nbeams;i++)
-			fprintf(stderr,"dbg2       beam %d: detects:%d\n",
-				i,detects[i]);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_sb_extract_altitude(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, double *transducer_depth, double *altitude,
-	int *error)
-{
-	char	*function_name = "mbsys_sb_extract_altitude";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_sb_struct *store;
-	double	bath_best;
-	double	xtrack_min;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_sb_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		bath_best = 0.0;
-		if (store->deph[mb_io_ptr->beams_bath_max/2] > 0.0)
-		    bath_best = store->deph[mb_io_ptr->beams_bath_max/2];
-		else
-		    {
-		    xtrack_min = 99999999.9;
-		    for (i=0;i<mb_io_ptr->beams_bath_max;i++)
-			{
-			if (store->deph[i] > 0.0
-			    && fabs(store->dist[i]) < xtrack_min)
-			    {
-			    xtrack_min = fabs(store->dist[i]);
-			    bath_best = store->deph[i];
-			    }
-			}
-		    }
-		if (bath_best <= 0.0)
-		    {
-		    xtrack_min = 99999999.9;
-		    for (i=0;i<mb_io_ptr->beams_bath_max;i++)
-			{
-			if (store->deph[i] < 0.0
-			    && fabs(store->dist[i]) < xtrack_min)
-			    {
-			    xtrack_min = fabs(store->dist[i]);
-			    bath_best = -store->deph[i];
-			    }
-			}
-		    }
-		*transducer_depth = 0.0;
-		*altitude = bath_best - *transducer_depth;
-
-		/* set status */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:              %d\n",*kind);
-		fprintf(stderr,"dbg2       transducer_depth:  %f\n",*transducer_depth);
-		fprintf(stderr,"dbg2       altitude:          %f\n",*altitude);
-		fprintf(stderr,"dbg2       error:             %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:            %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_sb_extract_nav(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int time_i[7], double *time_d,
-		double *navlon, double *navlat,
-		double *speed, double *heading, double *draft,
-		double *roll, double *pitch, double *heave,
-		int *error)
-{
-	char	*function_name = "mbsys_sb_extract_nav";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_sb_struct *store;
-	int	time_j[5];
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_sb_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get time */
-		time_j[0] = store->year;
-		time_j[1] = store->day;
-		time_j[2] = store->min;
-		time_j[3] = store->sec;
-		time_j[4] = 0;
-		mb_get_itime(verbose,time_j,time_i);
-		mb_get_time(verbose,time_i,time_d);
-
-		/* get navigation */
-		*navlon = store->lon2u/60. + store->lon2b/600000.;
-		*navlat = store->lat2u/60. + store->lat2b/600000. - 90.;
-
-		/* get heading (360 degrees = 65536) */
-		*heading = store->sbhdg*0.0054932;
-
-		/* get speed */
-		*speed = 0.0;
-
-		/* get draft */
-		*draft = 0.0;
-
-		/* get roll pitch and heave */
-		*roll = 0.0;
-		*pitch = 0.0;
-		*heave = 0.0;
-
-		/* print debug statements */
-		if (verbose >= 5)
-			{
-			fprintf(stderr,"\ndbg4  Data extracted by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  Extracted values:\n");
-			fprintf(stderr,"dbg4       kind:       %d\n",
-				*kind);
-			fprintf(stderr,"dbg4       error:      %d\n",
-				*error);
-			fprintf(stderr,"dbg4       time_i[0]:  %d\n",
-				time_i[0]);
-			fprintf(stderr,"dbg4       time_i[1]:  %d\n",
-				time_i[1]);
-			fprintf(stderr,"dbg4       time_i[2]:  %d\n",
-				time_i[2]);
-			fprintf(stderr,"dbg4       time_i[3]:  %d\n",
-				time_i[3]);
-			fprintf(stderr,"dbg4       time_i[4]:  %d\n",
-				time_i[4]);
-			fprintf(stderr,"dbg4       time_i[5]:  %d\n",
-				time_i[5]);
-			fprintf(stderr,"dbg4       time_i[6]:  %d\n",
-				time_i[6]);
-			fprintf(stderr,"dbg4       time_d:     %f\n",
-				*time_d);
-			fprintf(stderr,"dbg4       longitude:  %f\n",
-				*navlon);
-			fprintf(stderr,"dbg4       latitude:   %f\n",
-				*navlat);
-			fprintf(stderr,"dbg4       speed:      %f\n",
-				*speed);
-			fprintf(stderr,"dbg4       heading:    %f\n",
-				*heading);
-			fprintf(stderr,"dbg4       draft:      %f\n",
-				*draft);
-			fprintf(stderr,"dbg4       roll:       %f\n",
-				*roll);
-			fprintf(stderr,"dbg4       pitch:      %f\n",
-				*pitch);
-			fprintf(stderr,"dbg4       heave:      %f\n",
-				*heave);
-			}
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind == MB_DATA_DATA)
-		{
-		fprintf(stderr,"dbg2       time_i[0]:     %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:     %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:     %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:     %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:     %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:     %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:     %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:        %f\n",*time_d);
-		fprintf(stderr,"dbg2       longitude:     %f\n",*navlon);
-		fprintf(stderr,"dbg2       latitude:      %f\n",*navlat);
-		fprintf(stderr,"dbg2       speed:         %f\n",*speed);
-		fprintf(stderr,"dbg2       heading:       %f\n",*heading);
-		fprintf(stderr,"dbg2       draft:         %f\n",*draft);
-		fprintf(stderr,"dbg2       roll:          %f\n",*roll);
-		fprintf(stderr,"dbg2       pitch:         %f\n",*pitch);
-		fprintf(stderr,"dbg2       heave:         %f\n",*heave);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_sb_insert_nav(int verbose, void *mbio_ptr, void *store_ptr,
-		int time_i[7], double time_d,
-		double navlon, double navlat,
-		double speed, double heading, double draft,
-		double roll, double pitch, double heave,
-		int *error)
-{
-	char	*function_name = "mbsys_sb_insert_nav";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_sb_struct *store;
-	int	time_j[5];
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       time_i[0]:  %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:  %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:  %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:  %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:  %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:  %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:  %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:     %f\n",time_d);
-		fprintf(stderr,"dbg2       navlon:     %f\n",navlon);
-		fprintf(stderr,"dbg2       navlat:     %f\n",navlat);
-		fprintf(stderr,"dbg2       speed:      %f\n",speed);
-		fprintf(stderr,"dbg2       heading:    %f\n",heading);
-		fprintf(stderr,"dbg2       draft:      %f\n",draft);
-		fprintf(stderr,"dbg2       roll:       %f\n",roll);
-		fprintf(stderr,"dbg2       pitch:      %f\n",pitch);
-		fprintf(stderr,"dbg2       heave:      %f\n",heave);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_sb_struct *) store_ptr;
-
-	/* insert data in structure */
-	if (store->kind == MB_DATA_DATA)
-		{
-		/* get time */
-		mb_get_jtime(verbose,time_i,time_j);
-		store->year = time_j[0];
-		store->day = time_j[1];
-		store->min = time_j[2];
-		store->sec = time_j[3];
-
-		/* get navigation */
-		if (navlon < 0.0) navlon = navlon + 360.0;
-		store->lon2u = (short int) 60.0*navlon;
-		store->lon2b = (short int) (600000.0*(navlon
-			- store->lon2u/60.0));
-		navlat = navlat + 90.0;
-		store->lat2u = (short int) 60.0*navlat;
-		store->lat2b = (short int) (600000.0*(navlat
-			- store->lat2u/60.0));
-
-		/* get heading (360 degrees = 65536) */
-		store->sbhdg = 182.044444*heading;
-
-		/* get draft */
-
-		/* get roll pitch and heave */
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_sb_copy(int verbose, void *mbio_ptr,
-			void *store_ptr, void *copy_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_sb_copy";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_sb_struct *store;
-	struct mbsys_sb_struct *copy;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       copy_ptr:   %p\n",(void *)copy_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointers */
-	store = (struct mbsys_sb_struct *) store_ptr;
-	copy = (struct mbsys_sb_struct *) copy_ptr;
-
-	/* copy the data */
-	*copy = *store;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mbsys_sb.h b/src/mbio/mbsys_sb.h
deleted file mode 100644
index 92da8ab..0000000
--- a/src/mbio/mbsys_sb.h
+++ /dev/null
@@ -1,194 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbsys_sb.h	2/17/93
- *	$Id: mbsys_sb.h 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1993-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbsys_sb.h defines the data structures used by MBIO functions
- * to store data from the 16-beam SeaBeam multibeam sonar systems.
- * The data formats which are commonly used to store SeaBeam
- * data in files include
- *      MBF_SBSIOMRG : MBIO ID 11
- *      MBF_SBSIOCEN : MBIO ID 12
- *      MBF_SBSIOLSI : MBIO ID 13
- *      MBF_SBURICEN : MBIO ID 14
- *
- * Author:	D. W. Caress
- * Date:	February 17, 1993
- * $Log: mbsys_sb.h,v $
- * Revision 5.6  2009/03/08 09:21:00  caress
- * Fixed problem reading and writing format 16 (MBF_SBSIOSWB) data on little endian systems.
- *
- * Revision 5.5  2005/11/05 00:48:05  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.4  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.3  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.2  2001/07/20 00:32:54  caress
- * Release 5.0.beta03
- *
- * Revision 5.1  2001/01/22  07:43:34  caress
- * Version 5.0.beta01
- *
- * Revision 5.0  2000/12/01  22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.4  2000/09/30  06:31:19  caress
- * Snapshot for Dale.
- *
- * Revision 4.3  1998/10/05  18:32:27  caress
- * MB-System version 4.6beta
- *
- * Revision 1.1  1998/10/05  17:46:15  caress
- * Initial revision
- *
- * Revision 4.2  1997/04/21  17:02:07  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.2  1997/04/21  17:02:07  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.1  1994/10/21  12:20:01  caress
- * Release V4.0
- *
- * Revision 4.1  1994/10/21  12:20:01  caress
- * Release V4.0
- *
- * Revision 4.0  1994/03/06  00:01:56  caress
- * First cut at version 4.0
- *
- * Revision 4.1  1994/03/03  03:39:43  caress
- * Fixed copyright message.
- *
- * Revision 4.0  1994/02/17  20:46:50  caress
- * First cut at new version.  Comment changes only.
- *
- * Revision 3.0  1993/05/14  23:05:32  sohara
- * initial version
- *
- */
-/*
- * Notes on the MBSYS_SB data structure:
- *   1. SeaBeam multibeam systems output raw data in 16 uncentered
- *      beams.  MBIO and most data formats store the data as 19
- *      centered beams.
- *   5. The kind value in the mbsys_sb_struct indicates whether the
- *      mbsys_sb_data_struct structure holds data from a ping or
- *      data from a comment:
- *        kind = 1 : data from a ping
- *        kind = 2 : comment
- *   6. The data structure defined below includes all of the values
- *      which are passed in SeaBeam records.
- */
-
-/* maximum line length in characters */
-#define MBSYS_SB_MAXLINE 200
-
-/* number of beams for hydrosweep */
-#define MBSYS_SB_BEAMS 19
-
-struct mbsys_sb_struct
-	{
-	/* type of data record */
-	int	kind;
-
-	/* position */
-	short	lon2u;		/* minutes east of prime meridian */
-	short	lon2b;		/* fraction of minute times 10000 */
-	short	lat2u;		/* number of minutes north of 90S */
-	short	lat2b;		/* fraction of minute times 10000 */
-
-	/* time stamp */
-	int	year;		/* year (4 digits) */
-	int	day;		/* julian day (1-366) */
-	int	min;		/* minutes from beginning of day (0-1439) */
-	int	sec;		/* seconds from beginning of minute (0-59) */
-
-	/* depths and distances */
-	int	dist[MBSYS_SB_BEAMS]; /* 19 depths from SeaBeam in meters
-					assuming 1500 m/s water velocity */
-	int	deph[MBSYS_SB_BEAMS]; /* 19 cross track distances in
-					meters from port (negative)
-					to starboard (positive) */
-
-	/* additional values */
-	unsigned short	sbtim;	/* SeaBeam computer clock time in 10ths of
-					seconds from start of hour (0-3600) */
-	unsigned short	sbhdg;	/* SeaBeam gyro heading
-					0 = 0 degrees
-					1 = 0.0055 degrees
-					16384 = 90 degrees
-					65535 = 359.9945 degrees
-					0 = 360 degrees */
-	short	axis;		/* navigation error ellipse major axis angle */
-	short	major;		/* navigation error ellipse major axis */
-	short	minor;		/* navigation error ellipse minor axis */
-
-	/* comment */
-	char	comment[MBSYS_SB_MAXLINE];
-	};
-
-/* system specific function prototypes */
-int mbsys_sb_alloc(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error);
-int mbsys_sb_deall(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error);
-int mbsys_sb_dimensions(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int *nbath, int *namp, int *nss, int *error);
-int mbsys_sb_extract(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int time_i[7], double *time_d,
-			double *navlon, double *navlat,
-			double *speed, double *heading,
-			int *nbath, int *namp, int *nss,
-			char *beamflag, double *bath, double *amp,
-			double *bathacrosstrack, double *bathalongtrack,
-			double *ss, double *ssacrosstrack, double *ssalongtrack,
-			char *comment, int *error);
-int mbsys_sb_insert(int verbose, void *mbio_ptr, void *store_ptr,
-			int kind, int time_i[7], double time_d,
-			double navlon, double navlat,
-			double speed, double heading,
-			int nbath, int namp, int nss,
-			char *beamflag, double *bath, double *amp,
-			double *bathacrosstrack, double *bathalongtrack,
-			double *ss, double *ssacrosstrack, double *ssalongtrack,
-			char *comment, int *error);
-int mbsys_sb_detects(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int *nbeams, int *detects, int *error);
-int mbsys_sb_ttimes(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int *nbeams,
-			double *ttimes, double *angles,
-			double *angles_forward, double *angles_null,
-			double *heave, double *alongtrack_offset,
-			double *draft, double *ssv, int *error);
-int mbsys_sb_extract_altitude(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, double *transducer_depth, double *altitude,
-			int *error);
-int mbsys_sb_extract_nav(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int time_i[7], double *time_d,
-			double *navlon, double *navlat,
-			double *speed, double *heading, double *draft,
-			double *roll, double *pitch, double *heave,
-			int *error);
-int mbsys_sb_insert_nav(int verbose, void *mbio_ptr, void *store_ptr,
-			int time_i[7], double time_d,
-			double navlon, double navlat,
-			double speed, double heading, double draft,
-			double roll, double pitch, double heave,
-			int *error);
-int mbsys_sb_copy(int verbose, void *mbio_ptr,
-			void *store_ptr, void *copy_ptr,
-			int *error);
diff --git a/src/mbio/mbsys_sb2000.c b/src/mbio/mbsys_sb2000.c
deleted file mode 100644
index 75ea40b..0000000
--- a/src/mbio/mbsys_sb2000.c
+++ /dev/null
@@ -1,1302 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbsys_sb2000.c	10/4/94
- *	$Id: mbsys_sb2000.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1994-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbsys_sb2000.c contains the functions for handling the data structure
- * used by MBIO functions to store data from the Sea Beam 2000
- * multibeam sonar systems.
- * The data formats which are commonly used to store Sea Beam
- * data in files include
- *      MBF_SB2000RW : MBIO ID 31
- *      MBF_SB2000SB : MBIO ID 32
- *
- * Author:	D. W. Caress
- * Date:	October 4, 1994
- * $Log: mbsys_sb2000.c,v $
- * Revision 5.12  2009/03/08 09:21:00  caress
- * Fixed problem reading and writing format 16 (MBF_SBSIOSWB) data on little endian systems.
- *
- * Revision 5.11  2009/03/02 18:51:52  caress
- * Fixed problems with formats 58 and 59, and also updated copyright dates in several source files.
- *
- * Revision 5.10  2005/11/05 00:48:05  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.9  2003/08/07 22:32:59  caress
- * Fixed problem with broken SB2000 records in data sample supplied by Mike Sexton.
- *
- * Revision 5.8  2003/07/30 16:26:23  caress
- * Changes during iSSP meeting July 2003.
- *
- * Revision 5.7  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.6  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.5  2001/08/25 00:54:13  caress
- * Adding beamwidth values to extract functions.
- *
- * Revision 5.4  2001/07/20  00:32:54  caress
- * Release 5.0.beta03
- *
- * Revision 5.3  2001/04/06  22:05:59  caress
- * Consolidated xse formats into one format.
- *
- * Revision 5.2  2001/03/22  20:50:02  caress
- * Trying to make version 5.0.beta0
- *
- * Revision 5.1  2001/01/22  07:43:34  caress
- * Version 5.0.beta01
- *
- * Revision 5.0  2000/12/01  22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.14  2000/10/11  01:03:21  caress
- * Convert to ANSI C
- *
- * Revision 4.13  2000/09/30  06:32:52  caress
- * Snapshot for Dale.
- *
- * Revision 4.12  1998/10/05  17:46:15  caress
- * MB-System version 4.6beta
- *
- * Revision 4.11  1997/07/25  14:19:53  caress
- * Version 4.5beta2.
- * Much mucking, particularly with Simrad formats.
- *
- * Revision 4.10  1997/04/21  17:02:07  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.9  1996/04/22  13:21:19  caress
- * Now have DTR and MIN/MAX defines in mb_define.h
- *
- * Revision 4.9  1996/04/22  13:21:19  caress
- * Now have DTR and MIN/MAX defines in mb_define.h
- *
- * Revision 4.8  1995/11/27  21:53:18  caress
- * New version of mb_ttimes with ssv and angles_null.
- *
- * Revision 4.7  1995/09/28  18:10:48  caress
- * Various bug fixes working toward release 4.3.
- *
- * Revision 4.6  1995/08/17  14:41:09  caress
- * Revision for release 4.3.
- *
- * Revision 4.5  1995/07/13  19:13:36  caress
- * Intermediate check-in during major bug-fixing flail.
- *
- * Revision 4.4  1995/03/06  19:38:54  caress
- * Changed include strings.h to string.h for POSIX compliance.
- *
- * Revision 4.3  1995/02/14  21:59:53  caress
- * Version 4.2
- *
- * Revision 4.2  1994/12/21  20:21:09  caress
- * Changes to support high resolution SeaBeam 2000 sidescan files
- * from R/V Melville data.
- *
- * Revision 4.1  1994/11/09  21:40:34  caress
- * Changed ttimes extraction routines to handle forward beam angles
- * so that alongtrack distances can be calculated.
- *
- * Revision 4.0  1994/10/21  12:35:01  caress
- * Release V4.0
- *
- * Revision 1.1  1994/10/21  12:20:01  caress
- * Initial revision
- *
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mb_define.h"
-#include "mbsys_sb2000.h"
-
-static char rcs_id[]="$Id: mbsys_sb2000.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mbsys_sb2000_alloc(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_sb2000_alloc";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* allocate memory for data structure */
-	status = mb_malloc(verbose,sizeof(struct mbsys_sb2000_struct),
-				store_ptr,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)*store_ptr);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_sb2000_deall(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_sb2000_deall";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)*store_ptr);
-		}
-
-	/* deallocate memory for data structure */
-	status = mb_free(verbose,store_ptr,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_sb2000_dimensions(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int *nbath, int *namp, int *nss, int *error)
-{
-	char	*function_name = "mbsys_sb2000_dimensions";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_sb2000_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_sb2000_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get beam and pixel numbers */
-		*nbath = store->beams_bath;
-		*namp = 0;
-		*nss = store->pixels_ss;
-		}
-	else
-		{
-		/* get beam and pixel numbers */
-		*nbath = 0;
-		*namp = 0;
-		*nss = 0;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		fprintf(stderr,"dbg2       nbath:      %d\n",*nbath);
-		fprintf(stderr,"dbg2        namp:      %d\n",*namp);
-		fprintf(stderr,"dbg2        nss:       %d\n",*nss);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_sb2000_extract(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int time_i[7], double *time_d,
-		double *navlon, double *navlat,
-		double *speed, double *heading,
-		int *nbath, int *namp, int *nss,
-		char *beamflag, double *bath, double *amp,
-		double *bathacrosstrack, double *bathalongtrack,
-		double *ss, double *ssacrosstrack, double *ssalongtrack,
-		char *comment, int *error)
-{
-	char	*function_name = "mbsys_sb2000_extract";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_sb2000_struct *store;
-	unsigned short *short_ptr;
-	int	time_j[5];
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_sb2000_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get time */
-		time_j[0] = store->year;
-		time_j[1] = store->day;
-		time_j[2] = store->min;
-		time_j[3] = 0.01*store->sec;
-		time_j[4] = 10000*(store->sec - 100*time_j[3]);;
-		mb_get_itime(verbose,time_j,time_i);
-		mb_get_time(verbose,time_i,time_d);
-
-		/* get navigation */
-		*navlon = 0.0000001*store->lon;
-		*navlat = 0.0000001*store->lat;
-
-		/* get heading (360 degrees = 65536) */
-		*heading = 0.1*store->heading;
-
-		/* get speed */
-		*speed = 0.00185*store->speed;
-
-		/* set beamwidths in mb_io structure */
-		mb_io_ptr->beamwidth_ltrack = 2.0;
-		mb_io_ptr->beamwidth_xtrack = 2.0;
-
-		/* read distance and depth values into storage arrays */
-		*nbath = store->beams_bath;
-		*namp = 0;
-		for (i=0;i<*nbath;i++)
-			{
-			/* read distance and depth values into storage arrays */
-			if (store->bath[i] > 0)
-			    {
-			    beamflag[i] = MB_FLAG_NONE;
-			    bath[i] = store->bath[i];
-			    }
-			else if (store->bath[i] < 0)
-			    {
-			    beamflag[i] =
-				MB_FLAG_MANUAL + MB_FLAG_FLAG;
-			    bath[i] = -store->bath[i];
-			    }
-			else
-			    {
-			    beamflag[i] = MB_FLAG_NULL;
-			    bath[i] = store->bath[i];
-			    }
-			bathacrosstrack[i] = store->bath_acrosstrack[i];
-			bathalongtrack[i] = 0.0;
-			}
-		*nss = store->pixels_ss;
-		if (store->ss_type == 'G')
-			{
-			for (i=0;i<*nss;i++)
-				{
-				ss[i] = store->ss[i];
-				if (ss[i] <= 0.0)
-					ss[i] = MB_SIDESCAN_NULL;
-				ssacrosstrack[i] =
-					(i-*nss/2)*store->pixel_size;
-				ssalongtrack[i] = 0.0;
-				}
-			}
-		else
-			{
-			for (i=0;i<*nss;i++)
-				{
-				short_ptr = (unsigned short *)
-					&store->ss[2*i];
-				ss[i] = (double) (*short_ptr);
-				if (ss[i] <= 0.0)
-					ss[i] = MB_SIDESCAN_NULL;
-				ssacrosstrack[i] =
-					(i-*nss/2)*store->pixel_size;
-				ssalongtrack[i] = 0.0;
-				}
-			}
-
-		/* print debug statements */
-		if (verbose >= 5)
-			{
-			fprintf(stderr,"\ndbg4  Data extracted by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  Extracted values:\n");
-			fprintf(stderr,"dbg4       kind:       %d\n",
-				*kind);
-			fprintf(stderr,"dbg4       error:      %d\n",
-				*error);
-			fprintf(stderr,"dbg4       time_i[0]:  %d\n",
-				time_i[0]);
-			fprintf(stderr,"dbg4       time_i[1]:  %d\n",
-				time_i[1]);
-			fprintf(stderr,"dbg4       time_i[2]:  %d\n",
-				time_i[2]);
-			fprintf(stderr,"dbg4       time_i[3]:  %d\n",
-				time_i[3]);
-			fprintf(stderr,"dbg4       time_i[4]:  %d\n",
-				time_i[4]);
-			fprintf(stderr,"dbg4       time_i[5]:  %d\n",
-				time_i[5]);
-			fprintf(stderr,"dbg4       time_i[6]:  %d\n",
-				time_i[6]);
-			fprintf(stderr,"dbg4       time_d:     %f\n",
-				*time_d);
-			fprintf(stderr,"dbg4       longitude:  %f\n",
-				*navlon);
-			fprintf(stderr,"dbg4       latitude:   %f\n",
-				*navlat);
-			fprintf(stderr,"dbg4       speed:      %f\n",
-				*speed);
-			fprintf(stderr,"dbg4       heading:    %f\n",
-				*heading);
-			fprintf(stderr,"dbg4       nbath:      %d\n",
-				*nbath);
-			for (i=0;i<*nbath;i++)
-			  fprintf(stderr,"dbg4       beam:%4d  flag:%3d  bath:%f  bathdist:%f\n",
-				i,beamflag[i],bath[i],
-				bathacrosstrack[i]);
-			fprintf(stderr,"dbg4        nss:      %d\n",
-				*nss);
-			for (i=0;i<*nss;i++)
-			  fprintf(stderr,"dbg4        beam:%d   ss:%f  acrosstrack:%f  alongtrack:%f\n",
-				i,ss[i],ssacrosstrack[i],ssalongtrack[i]);
-			}
-
-		/* done translating values */
-
-		}
-
-	/* extract comment from structure */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* copy comment */
-		strcpy(comment,store->comment);
-
-		/* print debug statements */
-		if (verbose >= 4)
-			{
-			fprintf(stderr,"\ndbg4  New ping read by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  New ping values:\n");
-			fprintf(stderr,"dbg4       error:      %d\n",
-				*error);
-			fprintf(stderr,"dbg4       comment:    %s\n",
-				comment);
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind == MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"dbg2       comment:     \ndbg2       %s\n",
-			comment);
-		}
-	else if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind != MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"dbg2       time_i[0]:     %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:     %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:     %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:     %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:     %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:     %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:     %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:        %f\n",*time_d);
-		fprintf(stderr,"dbg2       longitude:     %f\n",*navlon);
-		fprintf(stderr,"dbg2       latitude:      %f\n",*navlat);
-		fprintf(stderr,"dbg2       speed:         %f\n",*speed);
-		fprintf(stderr,"dbg2       heading:       %f\n",*heading);
-		}
-	if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind == MB_DATA_DATA)
-		{
-		fprintf(stderr,"dbg2       nbath:         %d\n",*nbath);
-		for (i=0;i<*nbath;i++)
-		  fprintf(stderr,"dbg2       beam:%4d  flag:%3d  bath:%f  bathdist:%f\n",
-			i,beamflag[i],bath[i],
-			bathacrosstrack[i]);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_sb2000_insert(int verbose, void *mbio_ptr, void *store_ptr,
-		int kind, int time_i[7], double time_d,
-		double navlon, double navlat,
-		double speed, double heading,
-		int nbath, int namp, int nss,
-		char *beamflag, double *bath, double *amp,
-		double *bathacrosstrack, double *bathalongtrack,
-		double *ss, double *ssacrosstrack, double *ssalongtrack,
-		char *comment, int *error)
-{
-	char	*function_name = "mbsys_sb2000_insert";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_sb2000_struct *store;
-	int	time_j[5];
-	unsigned short *short_ptr;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       kind:       %d\n",kind);
-		}
-	if (verbose >= 2 && (kind == MB_DATA_DATA || kind == MB_DATA_NAV))
-		{
-		fprintf(stderr,"dbg2       time_i[0]:  %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:  %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:  %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:  %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:  %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:  %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:  %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:     %f\n",time_d);
-		fprintf(stderr,"dbg2       navlon:     %f\n",navlon);
-		fprintf(stderr,"dbg2       navlat:     %f\n",navlat);
-		fprintf(stderr,"dbg2       speed:      %f\n",speed);
-		fprintf(stderr,"dbg2       heading:    %f\n",heading);
-		}
-	if (verbose >= 2 && kind == MB_DATA_DATA)
-		{
-		fprintf(stderr,"dbg2       nbath:      %d\n",nbath);
-		if (verbose >= 3)
-		 for (i=0;i<nbath;i++)
-		  fprintf(stderr,"dbg3       beam:%4d  flag:%3d  bath:%f  bathdist:%f\n",
-			i,beamflag[i],bath[i],
-			bathacrosstrack[i]);
-		fprintf(stderr,"dbg2       namp:       %d\n",namp);
-		if (verbose >= 3)
-		 for (i=0;i<namp;i++)
-		  fprintf(stderr,"dbg3        amp[%d]: %f\n",
-			i,amp[i]);
-		fprintf(stderr,"dbg2        nss:       %d\n",nss);
-		if (verbose >= 3)
-		 for (i=0;i<nss;i++)
-		  fprintf(stderr,"dbg3        ss[%d]: %f    ssdist[%d]: %f\n",
-			i,ss[i],i,ssacrosstrack[i]);
-		}
-	if (verbose >= 2 && kind == MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"dbg2       comment:     \ndbg2       %s\n",
-			comment);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_sb2000_struct *) store_ptr;
-
-	/* set data kind */
-	store->kind = kind;
-
-	/* insert data in structure */
-	if (store->kind == MB_DATA_DATA)
-		{
-		/* get time */
-		mb_get_jtime(verbose,time_i,time_j);
-		store->year = time_j[0];
-		store->day = time_j[1];
-		store->min = time_j[2];
-		store->sec = 100*time_j[3] + 0.0001*time_j[4];
-
-		/* get navigation */
-		if (navlon < 180.0) navlon = navlon + 360.0;
-		if (navlon > 180.0) navlon = navlon - 360.0;
-		store->lon = (int) 10000000*navlon;
-		store->lat = (int) 10000000*navlat;
-
-		/* get heading and speed */
-		store->heading = (short int) 10*heading;
-		store->speed = (short int) 540.5405405*speed;
-
-		/* put distance and depth values
-			into data structure */
-		store->beams_bath = nbath;
-		for (i=0;i<nbath;i++)
-			{
-			if (beamflag[i] == MB_FLAG_NULL)
-			    {
-			    store->bath[i] = 0;
-			    store->bath_acrosstrack[i] = 0;
-			    if (store->bath[i] < 0)
-			    	{
-			    	store->bath[i] = 0;
-			    	store->bath_acrosstrack[i] = 0;
-				}
-			    }
-			else if (mb_beam_check_flag(beamflag[i]))
-			    {
-			    store->bath[i] = -bath[i];
-			    store->bath_acrosstrack[i] = bathacrosstrack[i];
-			    if (store->bath[i] > 0)
-			    	{
-			    	store->bath[i] = 0;
-			    	store->bath_acrosstrack[i] = 0;
-				}
-			    }
-			else
-			    {
-			    store->bath[i] = bath[i];
-			    store->bath_acrosstrack[i] = bathacrosstrack[i];
-			    }
-			}
-
-		/* put sidescan values
-			into data structure */
-		store->pixels_ss = nss;
-		if (store->ss_type == 'G')
-			{
-			for (i=0;i<nss;i++)
-				{
-				if (ss[i] > MB_SIDESCAN_NULL)
-					store->ss[i] = (mb_u_char) ss[i];
-				else
-					store->ss[i] = 0;
-				}
-			}
-		else
-			{
-			for (i=0;i<nss;i++)
-				{
-				short_ptr = (unsigned short *)
-					&store->ss[2*i];
-				if (ss[i] > MB_SIDESCAN_NULL)
-					*short_ptr = (unsigned short) ss[i];
-				else
-					*short_ptr = 0;
-				}
-			}
-		}
-
-	/* insert comment in structure */
-	else if (store->kind == MB_DATA_COMMENT)
-		{
-		store->sensor_type[0] = '\0';
-		store->sensor_type[1] = '\0';
-		store->data_type[0] = 'T';
-		store->data_type[1] = 'R';
-		store->sensor_size = 0;
-		store->data_size = strlen(comment)+1;
-		strcpy(store->comment,comment);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_sb2000_ttimes(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, int *nbeams,
-	double *ttimes, double *angles,
-	double *angles_forward, double *angles_null,
-	double *heave, double *alongtrack_offset,
-	double *draft, double *ssv, int *error)
-{
-	char	*function_name = "mbsys_sb2000_ttimes";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_sb2000_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       ttimes:     %p\n",(void *)ttimes);
-		fprintf(stderr,"dbg2       angles_xtrk:%p\n",(void *)angles);
-		fprintf(stderr,"dbg2       angles_ltrk:%p\n",(void *)angles_forward);
-		fprintf(stderr,"dbg2       angles_null:%p\n",(void *)angles_null);
-		fprintf(stderr,"dbg2       heave:      %p\n",(void *)heave);
-		fprintf(stderr,"dbg2       ltrk_off:   %p\n",(void *)alongtrack_offset);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_sb2000_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get nbeams */
-		*nbeams = store->beams_bath;
-
-		/* get travel times, angles */
-		for (i=0;i<store->beams_bath;i++)
-			{
-			ttimes[i] = 0.0;
-			angles[i] = 0.0;
-			angles_forward[i] = 0.0;
-			angles_null[i] = 0.0;
-			heave[i] = 0.0;
-			alongtrack_offset[i] = 0.0;
-			}
-
-		/* get ssv */
-		*ssv = store->surface_vel;
-		*draft = 0.0;
-
-		/* set status */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error == MB_ERROR_NO_ERROR)
-		{
-		fprintf(stderr,"dbg2       draft:      %f\n",*draft);
-		fprintf(stderr,"dbg2       ssv:        %f\n",*ssv);
-		fprintf(stderr,"dbg2       nbeams:     %d\n",*nbeams);
-		for (i=0;i<*nbeams;i++)
-			fprintf(stderr,"dbg2       beam %d: tt:%f  angle_xtrk:%f  angle_ltrk:%f  angle_null:%f  depth_off:%f  ltrk_off:%f\n",
-				i,ttimes[i],angles[i],
-				angles_forward[i],angles_null[i],
-				heave[i],alongtrack_offset[i]);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_sb2000_detects(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, int *nbeams,
-	int *detects, int *error)
-{
-	char	*function_name = "mbsys_sb2000_detects";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_sb2000_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       detects:    %p\n",(void *)detects);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_sb2000_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get nbeams */
-		*nbeams = store->beams_bath;
-
-		/* get detects */
-		for (i=0;i<*nbeams;i++)
-			{
-			detects[i] = MB_DETECT_UNKNOWN;
-			}
-
-		/* set status */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error == MB_ERROR_NO_ERROR)
-		{
-		fprintf(stderr,"dbg2       nbeams:     %d\n",*nbeams);
-		for (i=0;i<*nbeams;i++)
-			fprintf(stderr,"dbg2       beam %d: detects:%d\n",
-				i,detects[i]);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_sb2000_extract_altitude(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, double *transducer_depth, double *altitude,
-	int *error)
-{
-	char	*function_name = "mbsys_sb2000_extract_altitude";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_sb2000_struct *store;
-	double	bath_best;
-	double	xtrack_min;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_sb2000_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		bath_best = 0.0;
-		if (store->bath[store->beams_bath/2] > 0.0)
-		    bath_best = store->bath[store->beams_bath/2];
-		else
-		    {
-		    xtrack_min = 99999999.9;
-		    for (i=0;i<store->beams_bath;i++)
-			{
-			if (store->bath[i] > 0.0
-			    && fabs(store->bath_acrosstrack[i]) < xtrack_min)
-			    {
-			    xtrack_min = fabs(store->bath_acrosstrack[i]);
-			    bath_best = store->bath[i];
-			    }
-			}
-		    }
-		if (bath_best <= 0.0)
-		    {
-		    xtrack_min = 99999999.9;
-		    for (i=0;i<store->beams_bath;i++)
-			{
-			if (store->bath[i] < 0.0
-			    && fabs(store->bath_acrosstrack[i]) < xtrack_min)
-			    {
-			    xtrack_min = fabs(store->bath_acrosstrack[i]);
-			    bath_best = -store->bath[i];
-			    }
-			}
-		    }
-		*transducer_depth = 0.0;
-		*altitude = bath_best - *transducer_depth;
-
-		/* set status */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:              %d\n",*kind);
-		fprintf(stderr,"dbg2       transducer_depth:  %f\n",*transducer_depth);
-		fprintf(stderr,"dbg2       altitude:          %f\n",*altitude);
-		fprintf(stderr,"dbg2       error:             %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:            %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_sb2000_extract_nav(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int time_i[7], double *time_d,
-		double *navlon, double *navlat,
-		double *speed, double *heading, double *draft,
-		double *roll, double *pitch, double *heave,
-		int *error)
-{
-	char	*function_name = "mbsys_sb2000_extract_nav";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_sb2000_struct *store;
-	int	time_j[5];
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_sb2000_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get time */
-		time_j[0] = store->year;
-		time_j[1] = store->day;
-		time_j[2] = store->min;
-		time_j[3] = 0.01*store->sec;
-		time_j[4] = 10000*(store->sec - 100*time_j[3]);;
-		mb_get_itime(verbose,time_j,time_i);
-		mb_get_time(verbose,time_i,time_d);
-
-		/* get navigation */
-		*navlon = 0.0000001*store->lon;
-		*navlat = 0.0000001*store->lat;
-
-		/* get heading (360 degrees = 65536) */
-		*heading = 0.1*store->heading;
-
-		/* get speed */
-		*speed = 0.00185*store->speed;
-
-		/* get draft */
-		*draft = 0.0;
-
-		/* get roll pitch and heave */
-		*roll = 0.01*store->roll;
-		*pitch = 0.01*store->pitch;
-		*heave = 0.0;
-
-		/* print debug statements */
-		if (verbose >= 5)
-			{
-			fprintf(stderr,"\ndbg4  Data extracted by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  Extracted values:\n");
-			fprintf(stderr,"dbg4       kind:       %d\n",
-				*kind);
-			fprintf(stderr,"dbg4       error:      %d\n",
-				*error);
-			fprintf(stderr,"dbg4       time_i[0]:  %d\n",
-				time_i[0]);
-			fprintf(stderr,"dbg4       time_i[1]:  %d\n",
-				time_i[1]);
-			fprintf(stderr,"dbg4       time_i[2]:  %d\n",
-				time_i[2]);
-			fprintf(stderr,"dbg4       time_i[3]:  %d\n",
-				time_i[3]);
-			fprintf(stderr,"dbg4       time_i[4]:  %d\n",
-				time_i[4]);
-			fprintf(stderr,"dbg4       time_i[5]:  %d\n",
-				time_i[5]);
-			fprintf(stderr,"dbg4       time_i[6]:  %d\n",
-				time_i[6]);
-			fprintf(stderr,"dbg4       time_d:     %f\n",
-				*time_d);
-			fprintf(stderr,"dbg4       longitude:  %f\n",
-				*navlon);
-			fprintf(stderr,"dbg4       latitude:   %f\n",
-				*navlat);
-			fprintf(stderr,"dbg4       speed:      %f\n",
-				*speed);
-			fprintf(stderr,"dbg4       heading:    %f\n",
-				*heading);
-			fprintf(stderr,"dbg4       draft:      %f\n",
-				*draft);
-			fprintf(stderr,"dbg4       roll:       %f\n",
-				*roll);
-			fprintf(stderr,"dbg4       pitch:      %f\n",
-				*pitch);
-			fprintf(stderr,"dbg4       heave:      %f\n",
-				*heave);
-			}
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind != MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"dbg2       time_i[0]:     %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:     %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:     %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:     %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:     %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:     %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:     %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:        %f\n",*time_d);
-		fprintf(stderr,"dbg2       longitude:     %f\n",*navlon);
-		fprintf(stderr,"dbg2       latitude:      %f\n",*navlat);
-		fprintf(stderr,"dbg2       speed:         %f\n",*speed);
-		fprintf(stderr,"dbg2       heading:       %f\n",*heading);
-		fprintf(stderr,"dbg2       draft:         %f\n",*draft);
-		fprintf(stderr,"dbg2       roll:          %f\n",*roll);
-		fprintf(stderr,"dbg2       pitch:         %f\n",*pitch);
-		fprintf(stderr,"dbg2       heave:         %f\n",*heave);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_sb2000_insert_nav(int verbose, void *mbio_ptr, void *store_ptr,
-		int time_i[7], double time_d,
-		double navlon, double navlat,
-		double speed, double heading, double draft,
-		double roll, double pitch, double heave,
-		int *error)
-{
-	char	*function_name = "mbsys_sb2000_insert_nav";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_sb2000_struct *store;
-	int	time_j[5];
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       time_i[0]:  %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:  %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:  %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:  %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:  %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:  %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:  %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:     %f\n",time_d);
-		fprintf(stderr,"dbg2       navlon:     %f\n",navlon);
-		fprintf(stderr,"dbg2       navlat:     %f\n",navlat);
-		fprintf(stderr,"dbg2       speed:      %f\n",speed);
-		fprintf(stderr,"dbg2       heading:    %f\n",heading);
-		fprintf(stderr,"dbg2       draft:      %f\n",draft);
-		fprintf(stderr,"dbg2       roll:       %f\n",roll);
-		fprintf(stderr,"dbg2       pitch:      %f\n",pitch);
-		fprintf(stderr,"dbg2       heave:      %f\n",heave);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_sb2000_struct *) store_ptr;
-
-	/* insert data in structure */
-	if (store->kind == MB_DATA_DATA)
-		{
-		/* get time */
-		mb_get_jtime(verbose,time_i,time_j);
-		store->year = time_j[0];
-		store->day = time_j[1];
-		store->min = time_j[2];
-		store->sec = 100*time_j[3] + 0.0001*time_j[4];
-
-		/* get navigation */
-		if (navlon < 180.0) navlon = navlon + 360.0;
-		if (navlon > 180.0) navlon = navlon - 360.0;
-		store->lon = (int) 10000000*navlon;
-		store->lat = (int) 10000000*navlat;
-
-		/* get heading and speed */
-		store->heading = (short int) 10*heading;
-		store->speed = (short int) 540.5405405*speed;
-
-		/* get draft */
-
-		/* get roll pitch and heave */
-		store->roll = roll*100.0;
-		store->pitch = pitch*100.0;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_sb2000_copy(int verbose, void *mbio_ptr,
-			void *store_ptr, void *copy_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_sb2000_copy";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_sb2000_struct *store;
-	struct mbsys_sb2000_struct *copy;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       copy_ptr:   %p\n",(void *)copy_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointers */
-	store = (struct mbsys_sb2000_struct *) store_ptr;
-	copy = (struct mbsys_sb2000_struct *) copy_ptr;
-
-	/* copy the data */
-	*copy = *store;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mbsys_sb2000.h b/src/mbio/mbsys_sb2000.h
deleted file mode 100644
index 3612ae2..0000000
--- a/src/mbio/mbsys_sb2000.h
+++ /dev/null
@@ -1,243 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbsys_sb2000.h	10/4/94
- *	$Id: mbsys_sb2000.h 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1994-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbsys_sb2000.h defines the data structures used by MBIO functions
- * to store data from the SeaBeam 2000 multibeam sonar systems.
- * The data formats which are commonly used to store SeaBeam
- * data in files include
- *      MBF_SB2000RW : MBIO ID 31
- *      MBF_SB2000SB : MBIO ID 32
- *
- * Author:	D. W. Caress
- * Date:	October 4, 1994
- * $Log: mbsys_sb2000.h,v $
- * Revision 5.9  2009/03/08 09:21:00  caress
- * Fixed problem reading and writing format 16 (MBF_SBSIOSWB) data on little endian systems.
- *
- * Revision 5.8  2005/11/05 00:48:03  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.7  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.6  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.5  2002/02/26 07:50:41  caress
- * Release 5.0.beta14
- *
- * Revision 5.4  2001/07/20 00:32:54  caress
- * Release 5.0.beta03
- *
- * Revision 5.3  2001/04/06  22:05:59  caress
- * Consolidated xse formats into one format.
- *
- * Revision 5.2  2001/03/22  20:50:02  caress
- * Trying to make version 5.0.beta0
- *
- * Revision 5.1  2001/01/22  07:43:34  caress
- * Version 5.0.beta01
- *
- * Revision 5.0  2000/12/01  22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.5  2000/09/30  06:31:19  caress
- * Snapshot for Dale.
- *
- * Revision 4.4  1998/10/05  18:32:27  caress
- * MB-System version 4.6beta
- *
- * Revision 4.3  1997/04/21  17:02:07  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.3  1997/04/21  17:02:07  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.2  1995/02/14  22:01:39  caress
- * Version 4.2
- *
- * Revision 4.2  1995/02/14  22:01:39  caress
- * Version 4.2
- *
- * Revision 4.1  1994/12/21  20:21:09  caress
- * Changes to support high resolution SeaBeam 2000 sidescan files
- * from R/V Melville data.
- *
- * Revision 4.0  1994/10/21  12:35:09  caress
- * Release V4.0
- *
- * Revision 1.1  1994/10/21  12:20:01  caress
- * Initial revision
- *
- *
- */
-/*
- * Notes on the MBSYS_SB2000 data structure:
- *   1. SeaBeam 2000 multibeam systems output raw data in 121 beams.
- *   5. The kind value in the mbsys_sb2000_struct indicates whether the
- *      mbsys_sb2000_data_struct structure holds data from a ping or
- *      data from a comment:
- *        kind = 1 : data from a ping
- *        kind = 2 : comment
- *   6. The data structure defined below includes all of the values
- *      which are passed in SeaBeam 2000 records.
- */
-
-/* number of bathymetry beams for SeaBeam 2000 */
-#define MBSYS_SB2000_BEAMS 121
-
-/* number of sidescan pixels for SeaBeam 2000 */
-#define MBSYS_SB2000_PIXELS 2000
-
-/* maximum length of comments in data */
-#define	MBSYS_SB2000_COMMENT_LENGTH	250
-
-/* size in bytes of header records */
-#define	MBSYS_SB2000_HEADER_SIZE	36
-
-struct mbsys_sb2000_struct
-	{
-	/* type of data record */
-	int	kind;
-
-	/* time stamp */
-	short	year;		/* year (4 digits) */
-	short	day;		/* julian day (1-366) */
-	short	min;		/* minutes from beginning of day (0-1439) */
-	short	sec;		/* seconds from beginning of minute (0-59) */
-
-	/* position */
-	int	lat;		/* 1e-7 degrees from equator */
-	int	lon;		/* 1e-7 degrees from prime meridian */
-
-	/* other values */
-	short	heading;	/* heading in 0.1 degrees */
-	short	course;		/* course in 0.1 degrees */
-	short	speed;		/* fore-aft speed in 0.1 knots */
-	short	speed_ps;	/* port-starboard speed in 0.1 knots */
-	short	quality;	/* quality value, 0 good, bigger bad */
-	unsigned short	sensor_size;	/* size of sensor specific record in bytes */
-	unsigned short	data_size;	/* size of data record in bytes */
-	char	speed_ref[2];	/* speed reference */
-	char	sensor_type[2];	/* sensor type */
-	char	data_type[2];	/* type of data recorded */
-	short	pitch;	/* 0.01 degrees */
-	short	roll;	/* 0.01 degrees */
-	short	gain;	/* ping gain, receiver gain */
-	short	correction;	/* sonar correction */
-	short	surface_vel;	/* sea surface sound velocity */
-	short	pulse_width;	/* transmitter pulse width */
-	short	attenuation;	/* transmitter attenuation */
-	short	spare1;
-	short	spare2;
-	char	mode[2];	/* operation mode */
-	char	data_correction[2];	/* data correction */
-	char	ssv_source[2];	/* surface sound velocity source */
-
-	/* sound velocity record */
-	int	svp_mean;
-	short	svp_number;
-	short	svp_spare;
-	short	svp_depth[30];
-	short	svp_vel[30];
-	short	vru1;
-	short	vru1_port;
-	short	vru1_forward;
-	short	vru1_vert;
-	short	vru2;
-	short	vru2_port;
-	short	vru2_forward;
-	short	vru2_vert;
-	short	pitch_bias;
-	short	roll_bias;
-	char	vru[8];
-
-	/* bathymetry data */
-	short	beams_bath;	/* number of bathymetry beams */
-	short	scale_factor;	/* scale factor */
-	short	bath[MBSYS_SB2000_BEAMS];
-	short	bath_acrosstrack[MBSYS_SB2000_BEAMS];
-
-	/* comment */
-	char	comment[MBSYS_SB2000_COMMENT_LENGTH];
-
-	/* sidescan data */
-	int	ping_number;
-	short	ping_length;
-	short	pixel_size;	/* meters per pixel */
-	short	ss_min;	/* dB gray level minimum */
-	short	ss_max;	/* dB gray level maximum */
-	short	sample_rate;	/* hydrophone sampling rate 0.1 usec */
-	short	start_time;	/* first time slice */
-        short	tot_slice;	/* total time slices */
-	short	pixels_ss;	/* number of pixels */
-	char	spare_ss[12];	/* spare */
-	char	ss_type;	/* sidescan type: G=grayscale, R=raw sidescan */
-	char	ss_dummy;
-	mb_u_char	ss[2*MBSYS_SB2000_PIXELS];
-
-	};
-
-/* system specific function prototypes */
-int mbsys_sb2000_alloc(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error);
-int mbsys_sb2000_deall(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error);
-int mbsys_sb2000_dimensions(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int *nbath, int *namp, int *nss, int *error);
-int mbsys_sb2000_extract(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int time_i[7], double *time_d,
-			double *navlon, double *navlat,
-			double *speed, double *heading,
-			int *nbath, int *namp, int *nss,
-			char *beamflag, double *bath, double *amp,
-			double *bathacrosstrack, double *bathalongtrack,
-			double *ss, double *ssacrosstrack, double *ssalongtrack,
-			char *comment, int *error);
-int mbsys_sb2000_insert(int verbose, void *mbio_ptr, void *store_ptr,
-			int kind, int time_i[7], double time_d,
-			double navlon, double navlat,
-			double speed, double heading,
-			int nbath, int namp, int nss,
-			char *beamflag, double *bath, double *amp,
-			double *bathacrosstrack, double *bathalongtrack,
-			double *ss, double *ssacrosstrack, double *ssalongtrack,
-			char *comment, int *error);
-int mbsys_sb2000_ttimes(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int *nbeams,
-			double *ttimes, double *angles,
-			double *angles_forward, double *angles_null,
-			double *heave, double *alongtrack_offset,
-			double *draft, double *ssv, int *error);
-int mbsys_sb2000_detects(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int *nbeams, int *detects, int *error);
-int mbsys_sb2000_extract_altitude(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, double *transducer_depth, double *altitude,
-			int *error);
-int mbsys_sb2000_extract_nav(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int time_i[7], double *time_d,
-			double *navlon, double *navlat,
-			double *speed, double *heading, double *draft,
-			double *roll, double *pitch, double *heave,
-			int *error);
-int mbsys_sb2000_insert_nav(int verbose, void *mbio_ptr, void *store_ptr,
-			int time_i[7], double time_d,
-			double navlon, double navlat,
-			double speed, double heading, double draft,
-			double roll, double pitch, double heave,
-			int *error);
-int mbsys_sb2000_copy(int verbose, void *mbio_ptr,
-			void *store_ptr, void *copy_ptr,
-			int *error);
diff --git a/src/mbio/mbsys_sb2100.c b/src/mbio/mbsys_sb2100.c
deleted file mode 100644
index 14c4261..0000000
--- a/src/mbio/mbsys_sb2100.c
+++ /dev/null
@@ -1,1585 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbsys_sb2100.c	3/2/94
- *	$Id: mbsys_sb2100.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1993-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbsys_sb2100.c contains the functions for handling the data structure
- * used by MBIO functions to store data from the SeaBeam 2100 and
- * SeaBeam 1000 series multibeam sonar systems.
- * The data formats which are commonly used to store SeaBeam 1000/2100
- * data in files include
- *      MBF_SB2100RW : MBIO ID 41
- *      MBF_SB2100B1 : MBIO ID 42
- *      MBF_SB2100B2 : MBIO ID 43
- *
- * Author:	D. W. Caress
- * Date:	March 2, 1994
- * $Log: mbsys_sb2100.c,v $
- * Revision 5.10  2009/03/08 09:21:00  caress
- * Fixed problem reading and writing format 16 (MBF_SBSIOSWB) data on little endian systems.
- *
- * Revision 5.9  2009/03/02 18:51:52  caress
- * Fixed problems with formats 58 and 59, and also updated copyright dates in several source files.
- *
- * Revision 5.8  2008/03/01 09:14:03  caress
- * Some housekeeping changes.
- *
- * Revision 5.7  2005/11/05 00:48:03  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.6  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.5  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.4  2002/07/20 20:42:40  caress
- * Release 5.0.beta20
- *
- * Revision 5.3  2001/08/25 00:54:13  caress
- * Adding beamwidth values to extract functions.
- *
- * Revision 5.2  2001/07/20  00:32:54  caress
- * Release 5.0.beta03
- *
- * Revision 5.1  2001/01/22  07:43:34  caress
- * Version 5.0.beta01
- *
- * Revision 5.0  2000/12/01  22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.18  2000/10/11  01:03:21  caress
- * Convert to ANSI C
- *
- * Revision 4.17  2000/09/30  06:32:52  caress
- * Snapshot for Dale.
- *
- * Revision 4.16  1998/10/05  17:46:15  caress
- * MB-System version 4.6beta
- *
- * Revision 4.15  1997/07/25  14:19:53  caress
- * Version 4.5beta2.
- * Much mucking, particularly with Simrad formats.
- *
- * Revision 4.14  1997/04/21  17:02:07  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.14  1997/04/17  15:07:36  caress
- * MB-System 4.5 Beta Release
- *
- * Revision 4.13  1996/06/05  21:06:27  caress
- * Fixed problem handling gain of sidescan and amplitude data.
- * Previously transmit attenuation was treated as a gain value
- * (positive) rather than an attenuation value.
- *
- * Revision 4.12  1996/04/22  13:21:19  caress
- * Now have DTR and MIN/MAX defines in mb_define.h
- *
- * Revision 4.11  1996/01/26  21:23:30  caress
- * Version 4.3 distribution
- *
- * Revision 4.10  1995/09/28  18:10:48  caress
- * Various bug fixes working toward release 4.3.
- *
- * Revision 4.9  1995/08/17  14:41:09  caress
- * Revision for release 4.3.
- *
- * Revision 4.8  1995/07/13  19:13:36  caress
- * Intermediate check-in during major bug-fixing flail.
- *
- * Revision 4.7  1995/06/03  03:25:13  caress
- * Fixes to handling of changes to vendor SB2100 format
- *
- * Revision 4.6  1995/05/08  21:26:28  caress
- * Made changes consistent with new i/o spec for SB2100 data.
- *
- * Revision 4.5  1995/03/06  19:38:54  caress
- * Changed include strings.h to string.h for POSIX compliance.
- *
- * Revision 4.4  1994/11/09  21:40:34  caress
- * Changed ttimes extraction routines to handle forward beam angles
- * so that alongtrack distances can be calculated.
- *
- * Revision 4.3  1994/10/21  12:20:01  caress
- * Release V4.0
- *
- * Revision 4.2  1994/04/11  23:34:41  caress
- * Added function to extract travel time and beam angle data
- * from multibeam data in an internal data structure.
- *
- * Revision 4.2  1994/04/11  23:34:41  caress
- * Added function to extract travel time and beam angle data
- * from multibeam data in an internal data structure.
- *
- * Revision 4.1  1994/04/09  15:49:21  caress
- * Altered to fit latest iteration of SeaBeam 2100 vendor format.
- *
- * Revision 4.0  1994/03/06  00:01:56  caress
- * First cut at version 4.0
- *
- * Revision 4.0  1994/03/05  02:12:07  caress
- * First cut for SeaBeam 2100 i/o.
- *
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mb_define.h"
-#include "mbsys_sb2100.h"
-
-static char rcs_id[]="$Id: mbsys_sb2100.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mbsys_sb2100_alloc(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_sb2100_alloc";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_sb2100_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* allocate memory for data structure */
-	status = mb_malloc(verbose,sizeof(struct mbsys_sb2100_struct),
-				store_ptr,error);
-
-	/* get store structure pointer */
-	store = (struct mbsys_sb2100_struct *) *store_ptr;
-
-	/* set comment pointer */
-	store->comment = (char *) &(store->roll_bias_port);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)*store_ptr);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_sb2100_deall(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_sb2100_deall";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* deallocate memory for data structure */
-	status = mb_free(verbose,store_ptr,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_sb2100_dimensions(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int *nbath, int *namp, int *nss, int *error)
-{
-	char	*function_name = "mbsys_sb2100_dimensions";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_sb2100_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_sb2100_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get beam and pixel numbers */
-		*nbath = store->nbeams;
-		*namp = store->nbeams;
-		*nss = store->npixels;
-		}
-	else
-		{
-		/* get beam and pixel numbers */
-		*nbath = 0;
-		*namp = 0;
-		*nss = 0;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		fprintf(stderr,"dbg2       nbath:      %d\n",*nbath);
-		fprintf(stderr,"dbg2        namp:      %d\n",*namp);
-		fprintf(stderr,"dbg2        nss:       %d\n",*nss);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_sb2100_extract(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int time_i[7], double *time_d,
-		double *navlon, double *navlat,
-		double *speed, double *heading,
-		int *nbath, int *namp, int *nss,
-		char *beamflag, double *bath, double *amp,
-		double *bathacrosstrack, double *bathalongtrack,
-		double *ss, double *ssacrosstrack, double *ssalongtrack,
-		char *comment, int *error)
-{
-	char	*function_name = "mbsys_sb2100_extract";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_sb2100_struct *store;
-	int	time_j[5];
-	double	gain_db;
-	double	gain_factor;
-	int	center_pixel;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_sb2100_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get time */
-		time_j[0] = store->year;
-		time_j[1] = store->jday;
-		time_j[2] = 60*store->hour + store->minute;
-		time_j[3] = store->sec;
-		time_j[4] = 1000 * ((int)store->msec);
-		mb_get_itime(verbose,time_j,time_i);
-		mb_get_time(verbose,time_i,time_d);
-
-		/* get navigation */
-		*navlon = store->longitude;
-		*navlat = store->latitude;
-
-		/* get heading */
-		*heading = store->heading;
-
-		/* get speed */
-		*speed = 0.18553167*store->speed;
-
-		/* set beamwidths in mb_io structure */
-		mb_io_ptr->beamwidth_ltrack = 2.0;
-		mb_io_ptr->beamwidth_xtrack = 2.0;
-
-		/* read beam and pixel values into storage arrays */
-		*nbath = store->nbeams;
-		*namp = store->nbeams;
-		*nss = store->npixels;
-		center_pixel = store->npixels / 2;
-		gain_db = store->ping_gain
-			- store->transmitter_attenuation
-			+ 10.0 * log10( store->ping_pulse_width / 5.0)
-			- 30.0;
-		gain_factor = pow(10.0, (-gain_db / 20.0));
-		for (i=0;i<*nbath;i++)
-			{
-			if (store->beams[i].quality == ' ')
-			    beamflag[i] = MB_FLAG_NONE;
-			else if (store->beams[i].quality == '\n')
-			    beamflag[i] = MB_FLAG_NONE;
-			else if (store->beams[i].quality == '0')
-			    beamflag[i] = MB_FLAG_NULL;
-			else if (store->beams[i].quality == 'Q')
-			    beamflag[i] = MB_FLAG_SONAR + MB_FLAG_FLAG;
-			else if (store->beams[i].quality == 'E')
-			    beamflag[i] = MB_FLAG_MANUAL + MB_FLAG_FLAG;
-			else if (store->beams[i].quality == 'F')
-			    beamflag[i] = MB_FLAG_FILTER + MB_FLAG_FLAG;
-			bath[i] = store->beams[i].depth;
-			bathacrosstrack[i] = store->beams[i].acrosstrack;
-			bathalongtrack[i] = store->beams[i].alongtrack;
-			}
-		for (i=0;i<*namp;i++)
-			{
-			amp[i] = 0.25 * store->beams[i].amplitude - gain_db;
-			}
-		for (i=0;i<*nss;i++)
-			{
-			if (store->pixels[i].amplitude > 0)
-				ss[i] = gain_factor * store->pixels[i].amplitude;
-			else
-				ss[i] = MB_SIDESCAN_NULL;
-			ssacrosstrack[i] = store->pixel_size
-				* (i - center_pixel);
-			ssalongtrack[i] = store->pixels[i].alongtrack;
-			}
-
-		/* print debug statements */
-		if (verbose >= 5)
-			{
-			fprintf(stderr,"\ndbg4  Data extracted by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  Extracted values:\n");
-			fprintf(stderr,"dbg4       kind:       %d\n",
-				*kind);
-			fprintf(stderr,"dbg4       error:      %d\n",
-				*error);
-			fprintf(stderr,"dbg4       time_i[0]:  %d\n",
-				time_i[0]);
-			fprintf(stderr,"dbg4       time_i[1]:  %d\n",
-				time_i[1]);
-			fprintf(stderr,"dbg4       time_i[2]:  %d\n",
-				time_i[2]);
-			fprintf(stderr,"dbg4       time_i[3]:  %d\n",
-				time_i[3]);
-			fprintf(stderr,"dbg4       time_i[4]:  %d\n",
-				time_i[4]);
-			fprintf(stderr,"dbg4       time_i[5]:  %d\n",
-				time_i[5]);
-			fprintf(stderr,"dbg4       time_i[6]:  %d\n",
-				time_i[6]);
-			fprintf(stderr,"dbg4       time_d:     %f\n",
-				*time_d);
-			fprintf(stderr,"dbg4       longitude:  %f\n",
-				*navlon);
-			fprintf(stderr,"dbg4       latitude:   %f\n",
-				*navlat);
-			fprintf(stderr,"dbg4       speed:      %f\n",
-				*speed);
-			fprintf(stderr,"dbg4       heading:    %f\n",
-				*heading);
-			fprintf(stderr,"dbg4       nbath:      %d\n",
-				*nbath);
-			for (i=0;i<*nbath;i++)
-			  fprintf(stderr,"dbg4       beam:%d  flag:%3d  bath:%f  acrosstrack:%f  alongtrack:%f\n",
-				i,beamflag[i],bath[i],bathacrosstrack[i],bathalongtrack[i]);
-			fprintf(stderr,"dbg4        namp:     %d\n",
-				*namp);
-			for (i=0;i<*namp;i++)
-			  fprintf(stderr,"dbg4        beam:%d   amp:%f  acrosstrack:%f  alongtrack:%f\n",
-				i,amp[i],bathacrosstrack[i],bathalongtrack[i]);
-			fprintf(stderr,"dbg4        nss:      %d\n",
-				*nss);
-			for (i=0;i<*nss;i++)
-			  fprintf(stderr,"dbg4        pixel:%d   ss:%f  acrosstrack:%f  alongtrack:%f\n",
-				i,ss[i],ssacrosstrack[i],ssalongtrack[i]);
-			}
-
-		/* done translating values */
-
-		}
-
-	/* extract comment from structure */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* copy comment */
-		strcpy(comment,store->comment);
-
-		/* print debug statements */
-		if (verbose >= 4)
-			{
-			fprintf(stderr,"\ndbg4  New ping read by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  New ping values:\n");
-			fprintf(stderr,"dbg4       error:      %d\n",
-				*error);
-			fprintf(stderr,"dbg4       comment:    %s\n",
-				comment);
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind == MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"dbg2       comment:     \ndbg2       %s\n",
-			comment);
-		}
-	else if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind != MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"dbg2       time_i[0]:     %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:     %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:     %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:     %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:     %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:     %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:     %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:        %f\n",*time_d);
-		fprintf(stderr,"dbg2       longitude:     %f\n",*navlon);
-		fprintf(stderr,"dbg2       latitude:      %f\n",*navlat);
-		fprintf(stderr,"dbg2       speed:         %f\n",*speed);
-		fprintf(stderr,"dbg2       heading:       %f\n",*heading);
-		}
-	if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind == MB_DATA_DATA)
-		{
-		fprintf(stderr,"dbg2       nbath:      %d\n",
-			*nbath);
-		for (i=0;i<*nbath;i++)
-		  fprintf(stderr,"dbg2       beam:%d  flag:%3d  bath:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,beamflag[i],bath[i],
-			bathacrosstrack[i],bathalongtrack[i]);
-		fprintf(stderr,"dbg2        namp:     %d\n",
-			*namp);
-		for (i=0;i<*namp;i++)
-		  fprintf(stderr,"dbg2       beam:%d   amp:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,amp[i],bathacrosstrack[i],bathalongtrack[i]);
-		fprintf(stderr,"dbg2        nss:      %d\n",
-			*nss);
-		for (i=0;i<*nss;i++)
-		  fprintf(stderr,"dbg2        pixel:%d   ss:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,ss[i],ssacrosstrack[i],ssalongtrack[i]);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_sb2100_insert(int verbose, void *mbio_ptr, void *store_ptr,
-		int kind, int time_i[7], double time_d,
-		double navlon, double navlat,
-		double speed, double heading,
-		int nbath, int namp, int nss,
-		char *beamflag, double *bath, double *amp,
-		double *bathacrosstrack, double *bathalongtrack,
-		double *ss, double *ssacrosstrack, double *ssalongtrack,
-		char *comment, int *error)
-{
-	char	*function_name = "mbsys_sb2100_insert";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_sb2100_struct *store;
-	int	time_j[5];
-	int	set_pixel_size;
-	double	gain_db;
-	double	gain_factor;
-	int	center_pixel;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       kind:       %d\n",kind);
-		}
-	if (verbose >= 2 && (kind == MB_DATA_DATA || kind == MB_DATA_NAV))
-		{
-		fprintf(stderr,"dbg2       time_i[0]:  %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:  %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:  %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:  %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:  %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:  %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:  %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:     %f\n",time_d);
-		fprintf(stderr,"dbg2       navlon:     %f\n",navlon);
-		fprintf(stderr,"dbg2       navlat:     %f\n",navlat);
-		fprintf(stderr,"dbg2       speed:      %f\n",speed);
-		fprintf(stderr,"dbg2       heading:    %f\n",heading);
-		}
-	if (verbose >= 2 && kind == MB_DATA_DATA)
-		{
-		fprintf(stderr,"dbg2       nbath:      %d\n",nbath);
-		if (verbose >= 3)
-		 for (i=0;i<nbath;i++)
-		  fprintf(stderr,"dbg3       beam:%d  flag:%3d  bath:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,beamflag[i],bath[i],
-			bathacrosstrack[i],bathalongtrack[i]);
-		fprintf(stderr,"dbg2       namp:       %d\n",namp);
-		if (verbose >= 3)
-		 for (i=0;i<namp;i++)
-		  fprintf(stderr,"dbg3        beam:%d   amp:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,amp[i],bathacrosstrack[i],bathalongtrack[i]);
-		fprintf(stderr,"dbg2        nss:       %d\n",nss);
-		if (verbose >= 3)
-		 for (i=0;i<nss;i++)
-		  fprintf(stderr,"dbg3        pixel:%d   ss:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,ss[i],ssacrosstrack[i],ssalongtrack[i]);
-		}
-	if (verbose >= 2 && kind == MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"dbg2       comment:     \ndbg2       %s\n",
-			comment);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_sb2100_struct *) store_ptr;
-
-	/* set data kind */
-	store->kind = kind;
-
-	/* insert data in structure */
-	if (store->kind == MB_DATA_DATA)
-		{
-		/* get time */
-		mb_get_jtime(verbose,time_i,time_j);
-		store->year = time_j[0];
-		store->jday = time_j[1];
-		store->hour = time_j[2]/60;
-		store->minute = time_j[2] - 60*store->hour;
-		store->sec = time_j[3];
-		store->msec = (int) (0.001 * time_j[4]);
-
-		/* get number of beams and pixels */
-		store->nbeams = nbath;
-		store->npixels = nss;
-		center_pixel = store->npixels / 2;
-
-		/* get navigation */
-		if (navlon < 0.0) navlon = navlon + 360.0;
-		store->longitude = navlon;
-		store->latitude = navlat;
-
-		/* get heading */
-		store->heading = heading;
-
-		/* get speed */
-		store->speed = 5.3899155 * speed;
-
-		/* put beam and pixel values
-			into data structure */
-		gain_db = store->ping_gain
-			- store->transmitter_attenuation
-			+ 10.0 * log10( store->ping_pulse_width / 5.0)
-			- 30.0;
-		gain_factor = pow(10.0, (gain_db / 20.0));
-		for (i=0;i<nbath;i++)
-			{
-			if (mb_beam_check_flag(beamflag[i]))
-			    {
-			    if (mb_beam_check_flag_null(beamflag[i]))
-				store->beams[i].quality = '0';
-			    else if (mb_beam_check_flag_manual(beamflag[i]))
-				store->beams[i].quality = 'E';
-			    else if (mb_beam_check_flag_filter(beamflag[i]))
-				store->beams[i].quality = 'F';
-			    else if (mb_beam_check_flag_sonar(beamflag[i]))
-				store->beams[i].quality = 'Q';
-			    }
-			else
-			    store->beams[i].quality = ' ';
-			store->beams[i].depth = bath[i];
-			store->beams[i].acrosstrack = bathacrosstrack[i];
-			store->beams[i].alongtrack = bathalongtrack[i];
-			}
-		for (i=0;i<namp;i++)
-			store->beams[i].amplitude = 4.0 * (amp[i] + gain_db);
-		if (store->pixel_size <= 0.0)
-			set_pixel_size = MB_YES;
-		else
-			set_pixel_size = MB_NO;
-		for (i=0;i<nss;i++)
-			{
-			if (ss[i] > MB_SIDESCAN_NULL)
-				store->pixels[i].amplitude = gain_factor * ss[i];
-			else
-				store->pixels[i].amplitude = 0;
-			store->pixels[i].alongtrack = ssalongtrack[i];
-			if (set_pixel_size == MB_YES
-				&& ssacrosstrack[i] > 0)
-				{
-				store->pixel_size = ssacrosstrack[i]/
-					(i - center_pixel);
-				set_pixel_size = MB_NO;
-				}
-			}
-		}
-
-	/* insert comment in structure */
-	else if (store->kind == MB_DATA_COMMENT)
-		{
-		strcpy(store->comment,comment);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_sb2100_ttimes(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, int *nbeams,
-	double *ttimes, double *angles,
-	double *angles_forward, double *angles_null,
-	double *heave, double *alongtrack_offset,
-	double *draft, double *ssv, int *error)
-{
-	char	*function_name = "mbsys_sb2100_ttimes";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_sb2100_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       ttimes:     %p\n",(void *)ttimes);
-		fprintf(stderr,"dbg2       angles_xtrk:%p\n",(void *)angles);
-		fprintf(stderr,"dbg2       angles_ltrk:%p\n",(void *)angles_forward);
-		fprintf(stderr,"dbg2       angles_null:%p\n",(void *)angles_null);
-		fprintf(stderr,"dbg2       heave:      %p\n",(void *)heave);
-		fprintf(stderr,"dbg2       ltrk_off:   %p\n",(void *)alongtrack_offset);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_sb2100_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get nbeams */
-		*nbeams = store->nbeams;
-		/* ignore draft because the values arrive intermittently */
-		*draft = 0.0;
-		*ssv = store->ssv;
-
-		/* get travel times, angles */
-		for (i=0;i<*nbeams;i++)
-			{
-			ttimes[i] = store->beams[i].range;
-			angles[i] = store->beams[i].angle_across;
-			angles_forward[i] = store->beams[i].angle_forward;
-			if (angles[i] < 0.0)
-				{
-				angles[i] = -angles[i];
-				angles_forward[i] = angles_forward[i]
-					+ 180.0;
-				}
-			angles_null[i] = 0.0;
-			heave[i] = -store->heave;
-			alongtrack_offset[i] = 0.0;
-			}
-
-		/* set status */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error == MB_ERROR_NO_ERROR)
-		{
-		fprintf(stderr,"dbg2       draft:      %f\n",*draft);
-		fprintf(stderr,"dbg2       ssv:        %f\n",*ssv);
-		fprintf(stderr,"dbg2       nbeams:     %d\n",*nbeams);
-		for (i=0;i<*nbeams;i++)
-			fprintf(stderr,"dbg2       beam %d: tt:%f  angle_xtrk:%f  angle_ltrk:%f  angle_null:%f  depth_off:%f  ltrk_off:%f\n",
-				i,ttimes[i],angles[i],
-				angles_forward[i],angles_null[i],
-				heave[i],alongtrack_offset[i]);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_sb2100_detects(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, int *nbeams, int *detects, int *error)
-{
-	char	*function_name = "mbsys_sb2100_detects";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_sb2100_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       detects:    %p\n",(void *)detects);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_sb2100_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get nbeams */
-		*nbeams = store->nbeams;
-
-		/* get bottom detects */
-		for (i=0;i<*nbeams;i++)
-			{
-			if (store->beams[i].source == 'W')
-				detects[i] = MB_DETECT_AMPLITUDE;
-			else if (store->beams[i].source == 'B')
-				detects[i] = MB_DETECT_PHASE;
-			else
-				detects[i] = MB_DETECT_UNKNOWN;
-			}
-
-		/* set status */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error == MB_ERROR_NO_ERROR)
-		{
-		fprintf(stderr,"dbg2       nbeams:     %d\n",*nbeams);
-		for (i=0;i<*nbeams;i++)
-			fprintf(stderr,"dbg2       beam %d: detect:%d\n",
-				i,detects[i]);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_sb2100_gains(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, double *transmit_gain, double *pulse_length,
-			double *receive_gain, int *error)
-{
-	char	*function_name = "mbsys_sb2100_gains";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_sb2100_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_sb2100_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get transmit_gain (dB) */
-		*transmit_gain = (double)store->transmitter_attenuation;
-
-		/* get pulse_length (sec) */
-		*pulse_length = 0.001 * ((double)store->ping_pulse_width);
-
-		/* get receive_gain (dB) */
-		*receive_gain = (double)store->ping_gain;
-
-		/* set status */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error == MB_ERROR_NO_ERROR)
-		{
-		fprintf(stderr,"dbg2       transmit_gain: %f\n",*transmit_gain);
-		fprintf(stderr,"dbg2       pulse_length:  %f\n",*pulse_length);
-		fprintf(stderr,"dbg2       receive_gain:  %f\n",*receive_gain);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_sb2100_extract_altitude(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, double *transducer_depth, double *altitude,
-	int *error)
-{
-	char	*function_name = "mbsys_sb2100_extract_altitude";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_sb2100_struct *store;
-	double	bath_best;
-	double	xtrack_min;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_sb2100_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		bath_best = 0.0;
-		if (store->beams[store->nbeams/2].depth > 0.0)
-		    bath_best = store->beams[store->nbeams/2].depth;
-		else
-		    {
-		    xtrack_min = 99999999.9;
-		    for (i=0;i<store->nbeams;i++)
-			{
-			if (store->beams[i].depth > 0.0
-			    && fabs(store->beams[i].acrosstrack) < xtrack_min)
-			    {
-			    xtrack_min = fabs(store->beams[i].acrosstrack);
-			    bath_best = store->beams[i].depth;
-			    }
-			}
-		    }
-		if (bath_best <= 0.0)
-		    {
-		    xtrack_min = 99999999.9;
-		    for (i=0;i<store->nbeams;i++)
-			{
-			if (store->beams[i].depth < 0.0
-			    && fabs(store->beams[i].acrosstrack) < xtrack_min)
-			    {
-			    xtrack_min = fabs(store->beams[i].acrosstrack);
-			    bath_best = -store->beams[i].depth;
-			    }
-			}
-		    }
-		*transducer_depth = 0.0;
-		*altitude = bath_best - *transducer_depth;
-
-		/* set status */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:              %d\n",*kind);
-		fprintf(stderr,"dbg2       transducer_depth:  %f\n",*transducer_depth);
-		fprintf(stderr,"dbg2       altitude:          %f\n",*altitude);
-		fprintf(stderr,"dbg2       error:             %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:            %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_sb2100_extract_nav(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int time_i[7], double *time_d,
-		double *navlon, double *navlat,
-		double *speed, double *heading, double *draft,
-		double *roll, double *pitch, double *heave,
-		int *error)
-{
-	char	*function_name = "mbsys_sb2100_extract_nav";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_sb2100_struct *store;
-	int	time_j[5];
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_sb2100_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get time */
-		time_j[0] = store->year;
-		time_j[1] = store->jday;
-		time_j[2] = 60*store->hour + store->minute;
-		time_j[3] = store->sec;
-		time_j[4] = 1000 * ((int)store->msec);
-		mb_get_itime(verbose,time_j,time_i);
-		mb_get_time(verbose,time_i,time_d);
-
-		/* get navigation */
-		*navlon = store->longitude;
-		*navlat = store->latitude;
-
-		/* get heading */
-		*heading = store->heading;
-
-		/* get speed */
-		*speed = 0.18553167*store->speed;
-
-		/* get draft */
-		*draft = store->ship_draft;
-
-		/* get roll pitch and heave */
-		*roll = store->roll;
-		*pitch = store->pitch;
-		*heave = -store->heave;
-
-		/* print debug statements */
-		if (verbose >= 5)
-			{
-			fprintf(stderr,"\ndbg4  Data extracted by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  Extracted values:\n");
-			fprintf(stderr,"dbg4       kind:       %d\n",
-				*kind);
-			fprintf(stderr,"dbg4       error:      %d\n",
-				*error);
-			fprintf(stderr,"dbg4       time_i[0]:  %d\n",
-				time_i[0]);
-			fprintf(stderr,"dbg4       time_i[1]:  %d\n",
-				time_i[1]);
-			fprintf(stderr,"dbg4       time_i[2]:  %d\n",
-				time_i[2]);
-			fprintf(stderr,"dbg4       time_i[3]:  %d\n",
-				time_i[3]);
-			fprintf(stderr,"dbg4       time_i[4]:  %d\n",
-				time_i[4]);
-			fprintf(stderr,"dbg4       time_i[5]:  %d\n",
-				time_i[5]);
-			fprintf(stderr,"dbg4       time_i[6]:  %d\n",
-				time_i[6]);
-			fprintf(stderr,"dbg4       time_d:     %f\n",
-				*time_d);
-			fprintf(stderr,"dbg4       longitude:  %f\n",
-				*navlon);
-			fprintf(stderr,"dbg4       latitude:   %f\n",
-				*navlat);
-			fprintf(stderr,"dbg4       speed:      %f\n",
-				*speed);
-			fprintf(stderr,"dbg4       heading:    %f\n",
-				*heading);
-			fprintf(stderr,"dbg4       draft:      %f\n",
-				*draft);
-			fprintf(stderr,"dbg4       roll:       %f\n",
-				*roll);
-			fprintf(stderr,"dbg4       pitch:      %f\n",
-				*pitch);
-			fprintf(stderr,"dbg4       heave:      %f\n",
-				*heave);
-			}
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind == MB_DATA_DATA)
-		{
-		fprintf(stderr,"dbg2       time_i[0]:     %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:     %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:     %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:     %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:     %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:     %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:     %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:        %f\n",*time_d);
-		fprintf(stderr,"dbg2       longitude:     %f\n",*navlon);
-		fprintf(stderr,"dbg2       latitude:      %f\n",*navlat);
-		fprintf(stderr,"dbg2       speed:         %f\n",*speed);
-		fprintf(stderr,"dbg2       heading:       %f\n",*heading);
-		fprintf(stderr,"dbg2       draft:         %f\n",*draft);
-		fprintf(stderr,"dbg2       roll:          %f\n",*roll);
-		fprintf(stderr,"dbg2       pitch:         %f\n",*pitch);
-		fprintf(stderr,"dbg2       heave:         %f\n",*heave);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_sb2100_insert_nav(int verbose, void *mbio_ptr, void *store_ptr,
-		int time_i[7], double time_d,
-		double navlon, double navlat,
-		double speed, double heading, double draft,
-		double roll, double pitch, double heave,
-		int *error)
-{
-	char	*function_name = "mbsys_sb2100_insert_nav";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_sb2100_struct *store;
-	int	time_j[5];
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       time_i[0]:  %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:  %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:  %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:  %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:  %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:  %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:  %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:     %f\n",time_d);
-		fprintf(stderr,"dbg2       navlon:     %f\n",navlon);
-		fprintf(stderr,"dbg2       navlat:     %f\n",navlat);
-		fprintf(stderr,"dbg2       speed:      %f\n",speed);
-		fprintf(stderr,"dbg2       heading:    %f\n",heading);
-		fprintf(stderr,"dbg2       draft:      %f\n",draft);
-		fprintf(stderr,"dbg2       roll:       %f\n",roll);
-		fprintf(stderr,"dbg2       pitch:      %f\n",pitch);
-		fprintf(stderr,"dbg2       heave:      %f\n",heave);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_sb2100_struct *) store_ptr;
-
-	/* insert data in structure */
-	if (store->kind == MB_DATA_DATA)
-		{
-		/* get time */
-		mb_get_jtime(verbose,time_i,time_j);
-		store->year = time_j[0];
-		store->jday = time_j[1];
-		store->hour = time_j[2]/60;
-		store->minute = time_j[2] - 60*store->hour;
-		store->sec = time_j[3];
-		store->msec = (int) (0.001 * time_j[4]);
-
-		/* get navigation */
-		if (navlon < 0.0) navlon = navlon + 360.0;
-		store->longitude = navlon;
-		store->latitude = navlat;
-
-		/* get heading */
-		store->heading = heading;
-
-		/* get speed */
-		store->speed = 5.3899155*speed;
-
-		/* get draft */
-		store->ship_draft = draft;
-
-		/* get roll pitch and heave */
-		store->roll = roll;
-		store->pitch = pitch;
-		store->heave = -heave;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_sb2100_extract_svp(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int *nsvp,
-		double *depth, double *velocity,
-		int *error)
-{
-	char	*function_name = "mbsys_sb2100_extract_svp";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_sb2100_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_sb2100_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_VELOCITY_PROFILE)
-		{
-		/* get number of depth-velocity pairs */
-		*nsvp = store->num_svp;
-
-		/* get profile */
-		for (i=0;i<*nsvp;i++)
-			{
-			depth[i] = store->svp[i].depth;
-			velocity[i] = store->svp[i].velocity;
-			}
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:              %d\n",*kind);
-		fprintf(stderr,"dbg2       nsvp:              %d\n",*nsvp);
-		for (i=0;i<*nsvp;i++)
-		    fprintf(stderr,"dbg2       depth[%d]: %f   velocity[%d]: %f\n",i, depth[i], i, velocity[i]);
-		fprintf(stderr,"dbg2       error:             %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:            %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_sb2100_insert_svp(int verbose, void *mbio_ptr, void *store_ptr,
-		int nsvp,
-		double *depth, double *velocity,
-		int *error)
-{
-	char	*function_name = "mbsys_sb2100_insert_svp";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_sb2100_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       nsvp:       %d\n",nsvp);
-		for (i=0;i<nsvp;i++)
-		    fprintf(stderr,"dbg2       depth[%d]: %f   velocity[%d]: %f\n",i, depth[i], i, velocity[i]);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_sb2100_struct *) store_ptr;
-
-	/* insert data in structure */
-	if (store->kind == MB_DATA_VELOCITY_PROFILE)
-		{
-		/* get number of depth-velocity pairs */
-		store->num_svp = MIN(nsvp, MBSYS_SB2100_MAXVEL);
-
-		/* get profile */
-		for (i=0;i<store->num_svp;i++)
-			{
-			store->svp[i].depth = depth[i];
-			store->svp[i].velocity = velocity[i];
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_sb2100_copy(int verbose, void *mbio_ptr,
-			void *store_ptr, void *copy_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_sb2100_copy";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_sb2100_struct *store;
-	struct mbsys_sb2100_struct *copy;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       copy_ptr:   %p\n",(void *)copy_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointers */
-	store = (struct mbsys_sb2100_struct *) store_ptr;
-	copy = (struct mbsys_sb2100_struct *) copy_ptr;
-
-	/* copy the data */
-	*copy = *store;
-
-	/* reset the comment pointer */
-	copy->comment = (char *) &(copy->roll_bias_port);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mbsys_sb2100.h b/src/mbio/mbsys_sb2100.h
deleted file mode 100644
index f512caf..0000000
--- a/src/mbio/mbsys_sb2100.h
+++ /dev/null
@@ -1,421 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbsys_sb2100.h	2/4/94
- *	$Id: mbsys_sb2100.h 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1994-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbsys_sb2100.h defines the data structures used by MBIO functions
- * to store data from SeaBeam 2100 and 1000 multibeam sonar systems.
- * The data formats which are commonly used to store SeaBeam 1000/2100
- * data in files include
- *      MBF_SB2100RW : MBIO ID 41
- *      MBF_SB2100BN : MBIO ID 42
- *
- * Author:	D. W. Caress
- * Date:	February 4, 1994
- * $Log: mbsys_sb2100.h,v $
- * Revision 5.9  2009/03/08 09:21:00  caress
- * Fixed problem reading and writing format 16 (MBF_SBSIOSWB) data on little endian systems.
- *
- * Revision 5.8  2008/03/01 09:14:03  caress
- * Some housekeeping changes.
- *
- * Revision 5.7  2005/11/05 00:48:04  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.6  2003/12/24 06:56:34  caress
- * Fixed problem with formats 42 and 43. Combined former files mbr_sb2100b1.c and mbr_sb2100b2.c into new file mbr_sb2100bi.c. Files mbf_sb2100b1.h and mbf_sb2100b2.h are no longer part of the archive.
- *
- * Revision 5.5  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.4  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.3  2002/07/20 20:42:40  caress
- * Release 5.0.beta20
- *
- * Revision 5.2  2001/07/20 00:32:54  caress
- * Release 5.0.beta03
- *
- * Revision 5.1  2001/01/22  07:43:34  caress
- * Version 5.0.beta01
- *
- * Revision 5.0  2000/12/01  22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.8  2000/09/30  06:31:19  caress
- * Snapshot for Dale.
- *
- * Revision 4.7  1998/10/05  18:32:27  caress
- * MB-System version 4.6beta
- *
- * Revision 4.6  1997/04/21  17:02:07  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.6  1997/04/21  17:02:07  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.6  1997/04/17  15:07:36  caress
- * MB-System 4.5 Beta Release
- *
- * Revision 4.5  1995/06/07  20:39:59  caress
- * Fixed some typos.
- *
- * Revision 4.4  1995/05/08  21:26:28  caress
- * Made changes consistent with new i/o spec for SB2100 data.
- *
- * Revision 4.3  1994/10/21  12:20:01  caress
- * Release V4.0
- *
- * Revision 4.2  1994/06/21  22:54:21  caress
- * Added #ifdef statements to handle byte swapping.
- *
- * Revision 4.1  1994/04/09  15:49:21  caress
- * Altered to fit latest iteration of SeaBeam 2100 vendor format.
- *
- * Revision 4.0  1994/03/06  00:01:56  caress
- * First cut at version 4.0
- *
- * Revision 4.0  1994/03/05  02:12:07  caress
- * First cut for SeaBeam 2100 i/o.
- *
- *
- */
-/*
- * Notes on the MBSYS_SB2100 data structure:
- *   1. SeaBeam 2100 multibeam sonars output raw data in two
- *      formats,  with a third created in post processing.
- *      The older format is mostly ascii with binary
- *      sidescan (format 41).  The newer formats are entirely
- *      binary. Format 42 contains all information; format 43
- *      is identical to format 42 except that the sidescan
- *      data has been removed.
- *   2. The SeaBeam 2100 sonars output up to 151 beams of
- *      bathymetry and 2000 pixels of sidescan, along with a
- *      plethora of other information.
- *   3. The records all include navigation and time stamp information.
- *      The record types are for format 41 are:
- *        PR:  sonar parameter record (roll bias, pitch bias, sound velocity profile)
- *        TR:  sonar text record (comments)
- *        DR:  bathymetry data record (bathymetry and per-beam amplitudes)
- *        SS:  side scan data record
- *      The record types are for format 42 are:
- *        PR:  sonar parameter record (roll bias, pitch bias, sound velocity profile)
- *        TR:  sonar text record (comments)
- *        DH:  ping data header (one per ping)
- *        BR:  bathymetry data record (bathymetry and per-beam amplitudes)
- *        SR:  side scan data record
- *   4. For format 41 a single ping usually results in both DR and SS
- *      records.  The PR record occurs every 30 minutes or when
- *      the sound velocity profile or bias parameters are changed.
- *   5. For format 42 a single ping results in DH, BR, and SR records.
- *      Format 42 files created directly by the sonars will have
- *      PR records at the beginning; format 42 files created by
- *      translating format 41 files will have the same frequency of
- *      PR records as in the original files.
- *   5. The kind value in the mbsys_sb2k_struct indicates whether the
- *      mbsys_sb2k_data_struct structure holds data from a ping or
- *      data from some other record:
- *        kind = 1 : data from a ping
- *                   (DR + SS) or (DH + BR + SR)
- *        kind = 2 : comment (TR)
- *        kind = 8 : sonar parameter (PR)
- *   6. The data structure defined below includes all of the values
- *      which are passed in SeaBeam 2100 records.
- */
-/*
- * Notes on the MBF_SB2100B1 data format:
- *   1. SeaBeam 2100 multibeam sonars currently generate
- *      raw data in an hybrid ascii/binary format (41).
- *      This is a replacement fully binary (excepting file header)
- *      format which has significantly faster i/o during processing.
- *   2. The SeaBeam 2100 sonars output up to 151 beams of bathymetry
- *      and 2000 pixels of sidescan measurements, along with a plethora
- *      of other information.
- *   3. The record types are:
- *        SB21BIFH:  file header with data format description
- *                   (beginning of file only)
- *        SB21BIPR:  sonar parameter record
- *                   (roll bias, pitch bias, sound velocity profile)
- *        SB21BITR:  sonar text record (comments)
- *        SB21BIDH:  sonar data header (one for each ping)
- *        SB21BIBR:  bathymetry data record (one for each ping)
- *        SB21BISR:  sidescan data record (one for each ping)
- *   4. The file header record occurs at the beginning of each file.
- *      this is a fully ASCII record with line feeds and null
- *      termination so that uninformed users can figure out the
- *      contents of the file without additional documentation.
- *      There is no analog to this header in format 41.
- *   5. The parameter record should be generated at the beginning of
- *      every file (after the header); new files with new parameter
- *      records should be generated any time the roll bias, pitch
- *      bias, or sound velocity profile values change.
- *      The existing SeaBeam 2100 sonars output parameter records when
- *      the sonar begins logging and every 30 minutes thereafter,
- *      regardless of where it appears in files.
- *      The parameter also includes values for navigation offsets
- *      due to the offset between the transducers and the GPS antenna.
- *      SeaBeam sonars do not presently make use of such parameters.
- *   6. Individual comment records are limited to lengths of
- *      1920 characters.
- *      Each file should begin with comment records stating
- *      the sonar and sonar control software version used to
- *      generate the data. This does not occur at present.
- *   7. Each ping generates three data records in the following
- *      order:
- *        SB21BIDH:  sonar data header
- *        SB21BIBR:  bathymetry data record
- *        SB21BISR:  sidescan data record
- *   8. The data structure defined below includes all of the values
- *      which are passed in SeaBeam 2100 records.
- *
- *
- */
-/*
- * Notes on the MBF_SB2100B2 data format:
- *   1. SeaBeam 2100 multibeam sonars currently generate
- *      raw data in an hybrid ascii/binary format (41).
- *      Format 42 is a replacement fully binary (excepting file header)
- *      format which has significantly faster i/o during processing.
- *      This format is a bathymetry-only variant of format 42 which,
- *      due to the lack of sidescan data, has much smaller data files
- *      and much faster i/o.
- *   2. The SeaBeam 2100 sonars output up to 151 beams of bathymetry
- *      and 2000 pixels of sidescan measurements, along with a plethora
- *      of other information.
- *   3. The record types are:
- *        SB21BIFH:  file header with data format description
- *                   (beginning of file only)
- *        SB21BIPR:  sonar parameter record
- *                   (roll bias, pitch bias, sound velocity profile)
- *        SB21BITR:  sonar text record (comments)
- *        SB21BIDH:  sonar data header (one for each ping)
- *        SB21BIBR:  bathymetry data record (one for each ping)
- *        SB21BISR:  sidescan data record (one for each ping)
- *   4. The file header record occurs at the beginning of each file.
- *      this is a fully ASCII record with line feeds and null
- *      termination so that uninformed users can figure out the
- *      contents of the file without additional documentation.
- *      There is no analog to this header in format 41.
- *   5. The parameter record should be generated at the beginning of
- *      every file (after the header); new files with new parameter
- *      records should be generated any time the roll bias, pitch
- *      bias, or sound velocity profile values change.
- *      The existing SeaBeam 2100 sonars output parameter records when
- *      the sonar begins logging and every 30 minutes thereafter,
- *      regardless of where it appears in files.
- *      The parameter also includes values for navigation offsets
- *      due to the offset between the transducers and the GPS antenna.
- *      SeaBeam sonars do not presently make use of such parameters.
- *   6. Individual comment records are limited to lengths of
- *      1920 characters.
- *      Each file should begin with comment records stating
- *      the sonar and sonar control software version used to
- *      generate the data. This does not occur at present.
- *   7. Each ping generates three data records in the following
- *      order:
- *        SB21BIDH:  sonar data header
- *        SB21BIBR:  bathymetry data record
- *        SB21BISR:  sidescan data record
- *      The sidescan records are present in format 43, but contain
- *      no pixels. This allows format 43 files to be read as
- *      format 42 without breaking anything.
- *   8. The data structure defined below includes all of the values
- *      which are passed in SeaBeam 2100 records.
- *
- */
-
-/* maximum number of depth-velocity pairs */
-#define MBSYS_SB2100_MAXVEL 30
-
-/* maximum line length in characters */
-#define MBSYS_SB2100_MAXLINE 1944
-
-/* maximum number of formed beams for SeaBeam 1000/2100 */
-#define MBSYS_SB2100_BEAMS 151
-
-/* maximum number of sidescan pixels for SeaBeam 1000/2100 */
-#define MBSYS_SB2100_PIXELS 2000
-
-struct mbsys_sb2100_svp_struct
-	{
-	float	depth;			/* m */
-	float	velocity;		/* m/sec */
-	};
-
-struct mbsys_sb2100_beam_struct
-	{
-	float	depth;			/* m */
-	float	acrosstrack;		/* m */
-	float	alongtrack;		/* m */
-	float	range;			/* seconds */
-	float	angle_across;		/* degrees */
-	float	angle_forward;		/* degrees */
-	short	amplitude;		/* 0.25 dB */
-	short	signal_to_noise;	/* dB */
-	short	echo_length;		/* samples */
-	char	quality;		/* 0=no data,
-						Q=poor quality,
-						blank otherwise */
-	char	source;			/* B=BDI, W=WMT */
-	};
-
-struct mbsys_sb2100_ss_struct
-	{
-	float	amplitude;		/* sidescan value */
-	float	alongtrack;		/* m */
-	};
-
-struct mbsys_sb2100_struct
-	{
-	/* type of data record */
-	int	kind;
-
-	/* sonar parameters (SB21BIPR) */
-	float	roll_bias_port;			/* deg */
-	float	roll_bias_starboard;		/* deg */
-	float	pitch_bias;			/* deg */
-	float	ship_draft;			/* m */
-	float	offset_x;			/* m */
-	float	offset_y;			/* m */
-	float	offset_z;			/* m */
-	int	num_svp;
-	struct mbsys_sb2100_svp_struct  svp[MBSYS_SB2100_MAXVEL];
-
-	/* sonar data header (SB21BIDH) */
-	short	year;
-	short	jday;
-	short	hour;
-	short	minute;
-	short	sec;
-	short	msec;
-	short	spare1;
-	short	spare2;
-	double	longitude;		/* degrees */
-	double	latitude;		/* degrees */
-	float	heading;		/* degrees */
-	float	speed;			/* m/sec */
-	float	roll;			/* degrees */
-	float	pitch;			/* degrees */
-	float	heave;			/* m */
-	float	ssv;			/* m/sec */
-	char	frequency;		/* L=12kHz; H=36kHz */
-	char	depth_gate_mode;	/* A=Auto, M=Manual */
-	char	ping_gain;		/* dB */
-	char	ping_pulse_width;	/* msec */
-	char	transmitter_attenuation;    /* dB */
-	char	ssv_source;		/* V=Velocimeter, M=Manual,
-						T=Temperature */
-	char	svp_correction;		/* 0=None; A=True Xtrack
-						and Apparent Depth;
-						T=True Xtrack and True Depth */
-	char	pixel_algorithm;	/* pixel intensity algorithm
-						D = logarithm, L = linear */
-	float	pixel_size;		/* m */
-	int	nbeams;			/* up to 151 */
-	int	npixels;		/* up to 2000 */
-	short	spare3;
-	short	spare4;
-	short	spare5;
-	short	spare6;
-
-	/* bathymetry record (SB21BIBR) */
-	struct mbsys_sb2100_beam_struct beams[MBSYS_SB2100_BEAMS];
-
-	/* sidescan record (SB21BISR) */
-	struct mbsys_sb2100_ss_struct pixels[MBSYS_SB2100_PIXELS];
-
-	/* parameters unique to MBF_SB2100RW format */
-	char	range_scale; 		/* D = m; I = 0.1 m; S = 0.01 m */
-	char	spare_dr[2];
-	int	num_algorithms;		/* If 1 then only "best" algorithm
-						recorded, else multiple
-						algorithm results recorded */
-	char	algorithm_order[4];	/* blank if num_algorithms=1;
-						W=WMT and B=BDI */
-	char	svp_corr_ss;		/* 0=off; 1=on */
-	int	ss_data_length;		/* number of bytes of sidescan data */
-	char	pixel_size_scale;
-	char	spare_ss;
-
-	/* comment (SB21BITR) - comments are stored by
-	    recasting pointer to roll_bias_port to a char ptr
-	    and writing over up to MBSYS_SB2100_MAXLINE
-	    bytes in structure */
-	char	*comment;
-};
-
-
-/* system specific function prototypes */
-int mbsys_sb2100_alloc(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error);
-int mbsys_sb2100_deall(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error);
-int mbsys_sb2100_dimensions(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int *nbath, int *namp, int *nss, int *error);
-int mbsys_sb2100_extract(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int time_i[7], double *time_d,
-			double *navlon, double *navlat,
-			double *speed, double *heading,
-			int *nbath, int *namp, int *nss,
-			char *beamflag, double *bath, double *amp,
-			double *bathacrosstrack, double *bathalongtrack,
-			double *ss, double *ssacrosstrack, double *ssalongtrack,
-			char *comment, int *error);
-int mbsys_sb2100_insert(int verbose, void *mbio_ptr, void *store_ptr,
-			int kind, int time_i[7], double time_d,
-			double navlon, double navlat,
-			double speed, double heading,
-			int nbath, int namp, int nss,
-			char *beamflag, double *bath, double *amp,
-			double *bathacrosstrack, double *bathalongtrack,
-			double *ss, double *ssacrosstrack, double *ssalongtrack,
-			char *comment, int *error);
-int mbsys_sb2100_ttimes(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int *nbeams,
-			double *ttimes, double *angles,
-			double *angles_forward, double *angles_null,
-			double *heave, double *alongtrack_offset,
-			double *draft, double *ssv, int *error);
-int mbsys_sb2100_detects(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int *nbeams, int *detects, int *error);
-int mbsys_sb2100_gains(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, double *transmit_gain, double *pulse_length,
-			double *receive_gain, int *error);
-int mbsys_sb2100_extract_altitude(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, double *transducer_depth, double *altitude,
-			int *error);
-int mbsys_sb2100_extract_nav(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int time_i[7], double *time_d,
-			double *navlon, double *navlat,
-			double *speed, double *heading, double *draft,
-			double *roll, double *pitch, double *heave,
-			int *error);
-int mbsys_sb2100_insert_nav(int verbose, void *mbio_ptr, void *store_ptr,
-			int time_i[7], double time_d,
-			double navlon, double navlat,
-			double speed, double heading, double draft,
-			double roll, double pitch, double heave,
-			int *error);
-int mbsys_sb2100_extract_svp(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind,
-			int *nsvp,
-			double *depth, double *velocity,
-			int *error);
-int mbsys_sb2100_insert_svp(int verbose, void *mbio_ptr, void *store_ptr,
-			int nsvp,
-			double *depth, double *velocity,
-			int *error);
-int mbsys_sb2100_copy(int verbose, void *mbio_ptr,
-			void *store_ptr, void *copy_ptr,
-			int *error);
diff --git a/src/mbio/mbsys_simrad.c b/src/mbio/mbsys_simrad.c
deleted file mode 100644
index ef8e369..0000000
--- a/src/mbio/mbsys_simrad.c
+++ /dev/null
@@ -1,3178 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbsys_simrad.c	3.00	8/5/94
- *	$Id: mbsys_simrad.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1994-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbsys_simrad.c contains the MBIO functions for handling data from
- * old (pre-1997) Simrad multibeam sonars (e.g. EM950, EM1000, EM12S,
- * EM12D). The data formats associated with Simrad multibeams
- * (both old and new) include:
- *    MBSYS_SIMRAD formats (code in mbsys_simrad.c and mbsys_simrad.h):
- *      MBF_EMOLDRAW : MBIO ID 51 - Vendor EM1000, EM12S, EM12D, EM121
- *                   : MBIO ID 52 - aliased to 51
- *      MBF_EM12IFRM : MBIO ID 53 - IFREMER EM12S and EM12D
- *      MBF_EM12DARW : MBIO ID 54 - NERC EM12S
- *                   : MBIO ID 55 - aliased to 51
- *    MBSYS_SIMRAD2 formats (code in mbsys_simrad2.c and mbsys_simrad2.h):
- *      MBF_EM300RAW : MBIO ID 56 - Vendor EM3000, EM300, EM120
- *      MBF_EM300MBA : MBIO ID 57 - MBARI EM3000, EM300, EM120
- *
- * Author:	D. W. Caress
- * Date:	August 5, 1994
- *
- * $Log: mbsys_simrad.c,v $
- * Revision 5.21  2009/03/02 18:51:52  caress
- * Fixed problems with formats 58 and 59, and also updated copyright dates in several source files.
- *
- * Revision 5.20  2008/07/10 18:02:39  caress
- * Proceeding towards 5.1.1beta20.
- *
- * Revision 5.17  2008/03/01 09:14:03  caress
- * Some housekeeping changes.
- *
- * Revision 5.16  2007/10/31 18:38:41  caress
- * Fixed handling of null sidescan values.
- *
- * Revision 5.15  2007/10/08 15:59:34  caress
- * MBIO changes as of 8 October 2007.
- *
- * Revision 5.14  2007/06/18 01:19:48  caress
- * Changes as of 17 June 2007.
- *
- * Revision 5.13  2006/08/09 22:41:27  caress
- * Fixed programs that read or write grids so that they do not use the GMT_begin() function; these programs will now work when GMT is built in the default fashion, when GMT is built in the default fashion, with "advisory file locking" enabled.
- *
- * Revision 5.12  2005/11/05 00:48:04  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.11  2003/12/04 23:10:24  caress
- * Fixed problems with format 54 EM12DARW due to old code assuming how internal structure was packed. Also changed handling of beamflags for formats that don't support beamflags. Now flagged beams will always be nulled in such cases.
- *
- * Revision 5.10  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.9  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.8  2002/08/21 00:55:46  caress
- * Release 5.0.beta22
- *
- * Revision 5.7  2002/07/20 20:42:40  caress
- * Release 5.0.beta20
- *
- * Revision 5.6  2002/05/29 23:40:48  caress
- * Release 5.0.beta18
- *
- * Revision 5.5  2001/08/25 00:54:13  caress
- * Adding beamwidth values to extract functions.
- *
- * Revision 5.4  2001/07/20  00:32:54  caress
- * Release 5.0.beta03
- *
- * Revision 5.3  2001/03/22  20:50:02  caress
- * Trying to make version 5.0.beta0
- *
- * Revision 5.2  2001/01/22  07:43:34  caress
- * Version 5.0.beta01
- *
- * Revision 5.1  2000/12/10  20:26:50  caress
- * Version 5.0.alpha02
- *
- * Revision 5.0  2000/12/01  22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.21  2000/10/11  01:03:21  caress
- * Convert to ANSI C
- *
- * Revision 4.20  2000/09/30  06:32:52  caress
- * Snapshot for Dale.
- *
- * Revision 4.19  1999/03/31  18:11:35  caress
- * MB-System 4.6beta7
- *
- * Revision 4.18  1998/12/18  20:49:54  caress
- * MB-System version 4.6beta5
- *
- * Revision 4.17  1998/12/18  01:39:32  caress
- * MB-System version 4.6beta5
- *
- * Revision 4.16  1998/12/17  23:01:15  caress
- * MB-System version 4.6beta4
- *
- * Revision 4.15  1998/10/05  17:46:15  caress
- * MB-System version 4.6beta
- *
- * Revision 4.14  1997/09/15  19:06:40  caress
- * Real Version 4.5
- *
- * Revision 4.13  1997/07/25  14:19:53  caress
- * Version 4.5beta2.
- * Much mucking, particularly with Simrad formats.
- *
- * Revision 4.12  1997/04/21  17:02:07  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.12  1997/04/17  15:07:36  caress
- * MB-System 4.5 Beta Release
- *
- * Revision 4.11  1996/08/26  18:33:50  caress
- * Changed "signed char" to "char" for SunOs 4.1 compiler compatibility.
- *
- * Revision 4.10  1996/08/05  15:21:58  caress
- * Just redid i/o for Simrad sonars, including adding EM12S and EM121 support.
- *
- * Revision 4.9  1996/07/26  21:06:00  caress
- * Version after first cut of handling em12s and em121 data.
- *
- * Revision 4.8  1996/04/22  13:21:19  caress
- * Now have DTR and MIN/MAX defines in mb_define.h
- *
- * Revision 4.7  1996/04/22  10:57:09  caress
- * DTR define now in mb_io.h
- *
- * Revision 4.6  1995/11/27  21:53:53  caress
- * New version of mb_ttimes with ssv and angles_null.
- *
- * Revision 4.5  1995/09/28  18:10:48  caress
- * Various bug fixes working toward release 4.3.
- *
- * Revision 4.4  1995/08/17  14:41:09  caress
- * Revision for release 4.3.
- *
- * Revision 4.3  1995/07/13  19:13:36  caress
- * Intermediate check-in during major bug-fixing flail.
- *
- * Revision 4.2  1995/03/06  19:38:54  caress
- * Changed include strings.h to string.h for POSIX compliance.
- *
- * Revision 4.1  1994/11/09  21:40:34  caress
- * Changed ttimes extraction routines to handle forward beam angles
- * so that alongtrack distances can be calculated.
- *
- * Revision 4.0  1994/10/21  12:35:02  caress
- * Release V4.0
- *
- * Revision 1.1  1994/10/21  12:20:01  caress
- * Initial revision
- *
- *
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mb_define.h"
-#define MBSYS_SIMRAD_C
-#include "mbsys_simrad.h"
-
-static char rcs_id[]="$Id: mbsys_simrad.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mbsys_simrad_alloc(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_simrad_alloc";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_simrad_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* allocate memory for data structure */
-	status = mb_mallocd(verbose,__FILE__,__LINE__,sizeof(struct mbsys_simrad_struct),
-				(void **)store_ptr,error);
-
-	/* get data structure pointer */
-	store = (struct mbsys_simrad_struct *) *store_ptr;
-
-	/* initialize everything */
-	store->kind = MB_DATA_NONE;
-	store->sonar = MBSYS_SIMRAD_UNKNOWN;
-
-	/* parameter datagram */
-	store->par_year = 0;
-	store->par_month = 0;
-	store->par_day = 0;
-	store->par_hour = 0;
-	store->par_minute = 0;
-	store->par_second = 0;
-	store->par_centisecond = 0;
-	store->pos_type = 0;	/* positioning system type */
-	store->pos_delay = 0.0;	/* positioning system delay (sec) */
-	store->roll_offset = 0.0;	/* roll offset (degrees) */
-	store->pitch_offset = 0.0;	/* pitch offset (degrees) */
-	store->heading_offset = 0.0;	/* heading offset (degrees) */
-	store->em100_td = 0.0;	/* EM-100 tranducer depth (meters) */
-	store->em100_tx = 0.0;	/* EM-100 tranducer fore-aft
-					offset (meters) */
-	store->em100_ty = 0.0;	/* EM-100 tranducer athwartships
-					offset (meters) */
-	store->em12_td = 0.0;	/* EM-12 tranducer depth (meters) */
-	store->em12_tx = 0.0;	/* EM-12 tranducer fore-aft
-					offset (meters) */
-	store->em12_ty = 0.0;	/* EM-12 tranducer athwartships
-					offset (meters) */
-	store->em1000_td = 0.0;	/* EM-1000 tranducer depth (meters) */
-	store->em1000_tx = 0.0;	/* EM-1000 tranducer fore-aft
-					offset (meters) */
-	store->em1000_ty = 0.0;	/* EM-1000 tranducer athwartships
-					offset (meters) */
-	for (i=0;i<128;i++)
-		store->spare_parameter[i] = '\0';
-	store->survey_line = 0;
-	for (i=0;i<80;i++)
-		store->comment[i] = '\0';
-
-	/* position (position datagrams) */
-	store->pos_year = 0;
-	store->pos_month = 0;
-	store->pos_day = 0;
-	store->pos_hour = 0;
-	store->pos_minute = 0;
-	store->pos_second = 0;
-	store->pos_centisecond = 0;
-	store->pos_latitude = 0.0;
-	store->pos_longitude = 0.0;
-	store->utm_northing = 0.0;
-	store->utm_easting = 0.0;
-	store->utm_zone = 0;
-	store->utm_zone_lon = 0.0;
-	store->utm_system = 0;
-	store->pos_quality = 0;
-	store->speed = 0.0;			/* meters/second */
-	store->line_heading = 0.0;		/* degrees */
-
-	/* sound velocity profile */
-	store->svp_year = 0;
-	store->svp_month = 0;
-	store->svp_day = 0;
-	store->svp_hour = 0;
-	store->svp_minute = 0;
-	store->svp_second = 0;
-	store->svp_centisecond = 0;
-	store->svp_num = 0;
-	for (i=0;i<100;i++)
-		{
-		store->svp_depth[i] = 0; /* meters */
-		store->svp_vel[i] = 0;	/* 0.1 meters/sec */
-		}
-
-	/* time stamp */
-	store->year = 0;
-	store->month = 0;
-	store->day = 0;
-	store->hour = 0;
-	store->minute = 0;
-	store->second = 0;
-	store->centisecond = 0;
-
-	/* survey data structure not allocated yet */
-	store->ping = NULL;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)*store_ptr);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbsys_simrad_survey_alloc(int verbose,
-			void *mbio_ptr, void *store_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_simrad_survey_alloc";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_simrad_struct *store;
-	struct mbsys_simrad_survey_struct *ping;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_simrad_struct *) store_ptr;
-
-	/* allocate memory for data structure if needed */
-	if (store->ping == NULL)
-		status = mb_mallocd(verbose,__FILE__,__LINE__,
-			sizeof(struct mbsys_simrad_survey_struct),
-			(void **)&(store->ping),error);
-
-	if (status == MB_SUCCESS)
-		{
-
-		/* get data structure pointer */
-		ping = (struct mbsys_simrad_survey_struct *) store->ping;
-
-		/* initialize everything */
-		ping->swath_id = EM_SWATH_CENTER;
-		ping->longitude = 0.0;
-		ping->latitude = 0.0;
-		ping->ping_number = 0;
-		ping->beams_bath = MBSYS_SIMRAD_MAXBEAMS;
-		ping->bath_mode = 0;
-		ping->bath_res = 0;
-		ping->bath_quality = 0;
-		ping->bath_num = 0;
-		ping->pulse_length = 0;
-		ping->beam_width = 0;
-		ping->power_level = 0;
-		ping->tx_status = 0;
-		ping->rx_status = 0;
-		ping->along_res = 0;
-		ping->across_res = 0;
-		ping->depth_res = 0;
-		ping->range_res = 0;
-		ping->keel_depth = 0;
-		ping->heading = 0;
-		ping->roll = 0;
-		ping->pitch = 0;
-		ping->xducer_pitch = 0;
-		ping->ping_heave = 0;
-		ping->sound_vel = 0;
-		ping->ss_status = EM_SS_NONE;
-		ping->pixels_ssraw = 0;
-		ping->ss_mode = 0;
-		for (i=0;i<MBSYS_SIMRAD_MAXBEAMS;i++)
-			{
-			ping->bath[i] = 0;
-			ping->bath_acrosstrack[i] = 0;
-			ping->bath_alongtrack[i] = 0;
-			ping->tt[i] = 0;
-			ping->amp[i] = 0;
-			ping->quality[i] = 0;
-			ping->heave[i] = 0;
-			ping->beamflag[i] = MB_FLAG_NULL;
-			ping->beam_frequency[i] = 0;
-			ping->beam_samples[i] = 0;
-			ping->beam_center_sample[i] = 0;
-			ping->beam_start_sample[i] = 0;
-			}
-		ping->pixel_size = 0.0;
-		ping->pixels_ss = 0;
-		for (i=0;i<MBSYS_SIMRAD_MAXRAWPIXELS;i++)
-			{
-			ping->ssraw[i] = 0;
-			ping->ssp[i] = 0;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_simrad_deall(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_simrad_deall";
-	int	status = MB_SUCCESS;
-	struct mbsys_simrad_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)*store_ptr);
-		}
-
-	/* get data structure pointer */
-	store = (struct mbsys_simrad_struct *) *store_ptr;
-
-	/* deallocate memory for survey data structure */
-	if (store->ping != NULL)
-		status = mb_freed(verbose,__FILE__, __LINE__, (void **)&(store->ping),error);
-
-	/* deallocate memory for data structure */
-	status = mb_freed(verbose,__FILE__, __LINE__, (void **)store_ptr,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_simrad_dimensions(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int *nbath, int *namp, int *nss, int *error)
-{
-	char	*function_name = "mbsys_simrad_dimensions";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_simrad_struct *store;
-	struct mbsys_simrad_survey_struct *ping;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_simrad_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get beam and pixel numbers */
-		ping = (struct mbsys_simrad_survey_struct *) store->ping;
-		*nbath = ping->beams_bath;
-		*namp = ping->beams_bath;
-		*nss = MBSYS_SIMRAD_MAXPIXELS;
-		}
-	else
-		{
-		/* get beam and pixel numbers */
-		*nbath = 0;
-		*namp = 0;
-		*nss = 0;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		fprintf(stderr,"dbg2       nbath:      %d\n",*nbath);
-		fprintf(stderr,"dbg2        namp:      %d\n",*namp);
-		fprintf(stderr,"dbg2        nss:       %d\n",*nss);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_simrad_extract(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int time_i[7], double *time_d,
-		double *navlon, double *navlat,
-		double *speed, double *heading,
-		int *nbath, int *namp, int *nss,
-		char *beamflag, double *bath, double *amp,
-		double *bathacrosstrack, double *bathalongtrack,
-		double *ss, double *ssacrosstrack, double *ssalongtrack,
-		char *comment, int *error)
-{
-	char	*function_name = "mbsys_simrad_extract";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_simrad_struct *store;
-	struct mbsys_simrad_survey_struct *ping;
-	double	ss_spacing;
-	double	depthscale, dacrscale, daloscale, ttscale, reflscale;
-	double	pixel_size;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_simrad_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get survey data structure */
-		ping = (struct mbsys_simrad_survey_struct *) store->ping;
-
-		/* get time */
-		mb_fix_y2k(verbose, store->year, &time_i[0]);
-		time_i[1] = store->month;
-		time_i[2] = store->day;
-		time_i[3] = store->hour;
-		time_i[4] = store->minute;
-		time_i[5] = store->second;
-		time_i[6] = 10000*store->centisecond;
-		mb_get_time(verbose,time_i,time_d);
-
-		/* get navigation */
-		*navlon = ping->longitude;
-		*navlat = ping->latitude;
-
-		/* get heading */
-		if (store->sonar == MBSYS_SIMRAD_EM121)
-			*heading = 0.01 * ping->heading;
-		else
-			*heading = 0.1 * ping->heading;
-
-		/* get speed  */
-		*speed = 3.6*store->speed;
-
-		/* set beamwidths in mb_io structure */
-		if (store->sonar == MBSYS_SIMRAD_EM1000)
-		    {
-		    mb_io_ptr->beamwidth_ltrack = 3.3;
-		    mb_io_ptr->beamwidth_xtrack = 3.3;
-		    }
-		else if (store->sonar == MBSYS_SIMRAD_EM12S
-			|| store->sonar == MBSYS_SIMRAD_EM12D)
-		    {
-		    mb_io_ptr->beamwidth_ltrack = 1.7;
-		    mb_io_ptr->beamwidth_xtrack = 3.5;
-		    }
-		else if (store->sonar == MBSYS_SIMRAD_EM121)
-		    {
-		    if (ping->bath_mode == 3)
-			{
-			mb_io_ptr->beamwidth_ltrack = 4.0;
-			mb_io_ptr->beamwidth_xtrack = 4.0;
-			}
-		    else if (ping->bath_mode == 2)
-			{
-			mb_io_ptr->beamwidth_ltrack = 2.0;
-			mb_io_ptr->beamwidth_xtrack = 2.0;
-			}
-		    else
-			{
-			mb_io_ptr->beamwidth_ltrack = 1.0;
-			mb_io_ptr->beamwidth_xtrack = 1.0;
-			}
-		    }
-
-		/* read distance and depth values into storage arrays */
-		*nbath = ping->beams_bath;
-		*namp = ping->beams_bath;
-		if (store->sonar == MBSYS_SIMRAD_EM1000)
-			{
-			depthscale = 0.02;
-			dacrscale  = 0.1;
-			daloscale  = 0.1;
-			ttscale    = 0.05;
-			reflscale  = 0.5;
-			}
-		else if (store->sonar == MBSYS_SIMRAD_EM12S
-			&& ping->bath_res == 1)
-			{
-			depthscale = 0.1;
-			dacrscale  = 0.2;
-			daloscale  = 0.2;
-			ttscale    = 0.2;
-			reflscale  = 0.5;
-			}
-		else if (store->sonar == MBSYS_SIMRAD_EM12S
-			&& ping->bath_res == 2)
-			{
-			depthscale = 0.2;
-			dacrscale  = 0.5;
-			daloscale  = 0.5;
-			ttscale    = 0.8;
-			reflscale  = 0.5;
-			}
-		else if (store->sonar == MBSYS_SIMRAD_EM12D
-			&& ping->bath_res == 1)
-			{
-			depthscale = 0.1;
-			dacrscale  = 0.2;
-			daloscale  = 0.2;
-			ttscale    = 0.2;
-			reflscale  = 0.5;
-			}
-		else if (store->sonar == MBSYS_SIMRAD_EM12D
-			&& ping->bath_res == 2)
-			{
-			depthscale = 0.2;
-			dacrscale  = 0.5;
-			daloscale  = 0.5;
-			ttscale    = 0.8;
-			reflscale  = 0.5;
-			}
-		else if (store->sonar == MBSYS_SIMRAD_EM121)
-			{
-			depthscale = 0.01 * ping->depth_res;
-			dacrscale  = 0.01 * ping->across_res;
-			daloscale  = 0.01 * ping->along_res;
-			ttscale    = 0.1 * ping->range_res;
-			reflscale  = 0.5;
-			}
-		else
-			{
-			depthscale = 0.1;
-			dacrscale  = 0.2;
-			daloscale  = 0.2;
-			ttscale    = 0.2;
-			reflscale  = 0.5;
-			}
-		if (ping->ss_mode == 1)
-			ss_spacing = 0.6;
-		else if (ping->ss_mode == 2)
-			ss_spacing = 2.4;
-		else if (ping->ss_mode == 3)
-			ss_spacing = 0.3;
-		else if (ping->ss_mode == 4)
-			ss_spacing = 0.3;
-		else
-			ss_spacing = 0.15;
-		for (i=0;i<*nbath;i++)
-			{
-			beamflag[i] = ping->beamflag[i];
-			bath[i] = depthscale*ping->bath[i];
-			bathacrosstrack[i]
-				= dacrscale*ping->bath_acrosstrack[i];
-			bathalongtrack[i]
-				= daloscale*ping->bath_alongtrack[i];
-			}
-		for (i=0;i<*namp;i++)
-			{
-			amp[i] = reflscale*ping->amp[i];
-			}
-		if (ss != NULL)
-			{
-			*nss = MBSYS_SIMRAD_MAXPIXELS;
-			pixel_size = 0.01 * ping->pixel_size;
-			for (i=0;i<MBSYS_SIMRAD_MAXPIXELS;i++)
-				{
-				if (ping->ss[i] != 0)
-					{
-					ss[i] = 0.01 * ping->ss[i];
-					ssacrosstrack[i] = pixel_size
-							* (i - MBSYS_SIMRAD_MAXPIXELS / 2);
-					ssalongtrack[i] = daloscale * ping->ssalongtrack[i];
-					}
-				else
-					{
-					ss[i] = MB_SIDESCAN_NULL;
-					ssacrosstrack[i] = pixel_size
-							* (i - MBSYS_SIMRAD_MAXPIXELS / 2);
-					ssalongtrack[i] = 0.0;
-					}
-				}
-			}
-		else
-			{
-			*nss = 0;
-			}
-
-		/* print debug statements */
-		if (verbose >= 5)
-			{
-			fprintf(stderr,"\ndbg4  Data extracted by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  Extracted values:\n");
-			fprintf(stderr,"dbg4       kind:       %d\n",
-				*kind);
-			fprintf(stderr,"dbg4       error:      %d\n",
-				*error);
-			fprintf(stderr,"dbg4       time_i[0]:  %d\n",
-				time_i[0]);
-			fprintf(stderr,"dbg4       time_i[1]:  %d\n",
-				time_i[1]);
-			fprintf(stderr,"dbg4       time_i[2]:  %d\n",
-				time_i[2]);
-			fprintf(stderr,"dbg4       time_i[3]:  %d\n",
-				time_i[3]);
-			fprintf(stderr,"dbg4       time_i[4]:  %d\n",
-				time_i[4]);
-			fprintf(stderr,"dbg4       time_i[5]:  %d\n",
-				time_i[5]);
-			fprintf(stderr,"dbg4       time_i[6]:  %d\n",
-				time_i[6]);
-			fprintf(stderr,"dbg4       time_d:     %f\n",
-				*time_d);
-			fprintf(stderr,"dbg4       longitude:  %f\n",
-				*navlon);
-			fprintf(stderr,"dbg4       latitude:   %f\n",
-				*navlat);
-			fprintf(stderr,"dbg4       speed:      %f\n",
-				*speed);
-			fprintf(stderr,"dbg4       heading:    %f\n",
-				*heading);
-			fprintf(stderr,"dbg4       nbath:      %d\n",
-				*nbath);
-			for (i=0;i<*nbath;i++)
-			  fprintf(stderr,"dbg4       beam:%d  flag:%3d  bath:%f  acrosstrack:%f  alongtrack:%f\n",
-				i,beamflag[i],bath[i],
-				bathacrosstrack[i],bathalongtrack[i]);
-			fprintf(stderr,"dbg4        namp:     %d\n",
-				*namp);
-			for (i=0;i<*namp;i++)
-			  fprintf(stderr,"dbg4        beam:%d   amp:%f  acrosstrack:%f  alongtrack:%f\n",
-				i,amp[i],bathacrosstrack[i],bathalongtrack[i]);
-			for (i=0;i<*nss;i++)
-			  fprintf(stderr,"dbg4        pixel:%d   ss:%f  acrosstrack:%f  alongtrack:%f\n",
-				i,ss[i],ssacrosstrack[i],ssalongtrack[i]);
-			}
-
-		/* done translating values */
-
-		}
-
-	/* extract data from structure */
-	else if (*kind == MB_DATA_NAV)
-		{
-		/* get survey data structure */
-		ping = (struct mbsys_simrad_survey_struct *) store->ping;
-
-		/* get time */
-		mb_fix_y2k(verbose, store->pos_year, &time_i[0]);
-		time_i[1] = store->pos_month;
-		time_i[2] = store->pos_day;
-		time_i[3] = store->pos_hour;
-		time_i[4] = store->pos_minute;
-		time_i[5] = store->pos_second;
-		time_i[6] = 10000*store->pos_centisecond;
-		mb_get_time(verbose,time_i,time_d);
-		*navlon = store->pos_longitude;
-		*navlat = store->pos_latitude;
-
-		/* get heading */
-		*heading = store->line_heading;
-
-		/* get speed  */
-		*speed = 3.6*store->speed;
-
-		*nbath = 0;
-		*namp = 0;
-		*nss = 0;
-
-		/* print debug statements */
-		if (verbose >= 5)
-			{
-			fprintf(stderr,"\ndbg4  Data extracted by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  Extracted values:\n");
-			fprintf(stderr,"dbg4       kind:       %d\n",
-				*kind);
-			fprintf(stderr,"dbg4       error:      %d\n",
-				*error);
-			fprintf(stderr,"dbg4       time_i[0]:  %d\n",
-				time_i[0]);
-			fprintf(stderr,"dbg4       time_i[1]:  %d\n",
-				time_i[1]);
-			fprintf(stderr,"dbg4       time_i[2]:  %d\n",
-				time_i[2]);
-			fprintf(stderr,"dbg4       time_i[3]:  %d\n",
-				time_i[3]);
-			fprintf(stderr,"dbg4       time_i[4]:  %d\n",
-				time_i[4]);
-			fprintf(stderr,"dbg4       time_i[5]:  %d\n",
-				time_i[5]);
-			fprintf(stderr,"dbg4       time_i[6]:  %d\n",
-				time_i[6]);
-			fprintf(stderr,"dbg4       time_d:     %f\n",
-				*time_d);
-			fprintf(stderr,"dbg4       longitude:  %f\n",
-				*navlon);
-			fprintf(stderr,"dbg4       latitude:   %f\n",
-				*navlat);
-			fprintf(stderr,"dbg4       speed:      %f\n",
-				*speed);
-			fprintf(stderr,"dbg4       heading:    %f\n",
-				*heading);
-			}
-
-		/* done translating values */
-
-		}
-
-	/* extract comment from structure */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* copy comment */
-		strcpy(comment,store->comment);
-
-		/* print debug statements */
-		if (verbose >= 4)
-			{
-			fprintf(stderr,"\ndbg4  New ping read by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  New ping values:\n");
-			fprintf(stderr,"dbg4       error:      %d\n",
-				*error);
-			fprintf(stderr,"dbg4       comment:    %s\n",
-				comment);
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind == MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"dbg2       comment:     \ndbg2       %s\n",
-			comment);
-		}
-	else if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind != MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"dbg2       time_i[0]:     %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:     %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:     %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:     %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:     %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:     %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:     %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:        %f\n",*time_d);
-		fprintf(stderr,"dbg2       longitude:     %f\n",*navlon);
-		fprintf(stderr,"dbg2       latitude:      %f\n",*navlat);
-		fprintf(stderr,"dbg2       speed:         %f\n",*speed);
-		fprintf(stderr,"dbg2       heading:       %f\n",*heading);
-		}
-	if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind == MB_DATA_DATA)
-		{
-		fprintf(stderr,"dbg2       nbath:      %d\n",
-			*nbath);
-		for (i=0;i<*nbath;i++)
-		  fprintf(stderr,"dbg2       beam:%d  flag:%3d  bath:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,beamflag[i],bath[i],
-			bathacrosstrack[i],bathalongtrack[i]);
-		fprintf(stderr,"dbg2        namp:     %d\n",
-			*namp);
-		for (i=0;i<*namp;i++)
-		  fprintf(stderr,"dbg2       beam:%d   amp:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,amp[i],bathacrosstrack[i],bathalongtrack[i]);
-		fprintf(stderr,"dbg2        nss:      %d\n",
-			*nss);
-		for (i=0;i<*nss;i++)
-		  fprintf(stderr,"dbg2        pixel:%d   ss:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,ss[i],ssacrosstrack[i],ssalongtrack[i]);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_simrad_insert(int verbose, void *mbio_ptr, void *store_ptr,
-		int kind, int time_i[7], double time_d,
-		double navlon, double navlat,
-		double speed, double heading,
-		int nbath, int namp, int nss,
-		char *beamflag, double *bath, double *amp,
-		double *bathacrosstrack, double *bathalongtrack,
-		double *ss, double *ssacrosstrack, double *ssalongtrack,
-		char *comment, int *error)
-{
-	char	*function_name = "mbsys_simrad_insert";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_simrad_struct *store;
-	struct mbsys_simrad_survey_struct *ping;
-	double	depthscale, dacrscale,daloscale,ttscale,reflscale;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       kind:       %d\n",kind);
-		}
-	if (verbose >= 2 && (kind == MB_DATA_DATA || kind == MB_DATA_NAV))
-		{
-		fprintf(stderr,"dbg2       time_i[0]:  %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:  %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:  %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:  %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:  %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:  %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:  %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:     %f\n",time_d);
-		fprintf(stderr,"dbg2       navlon:     %f\n",navlon);
-		fprintf(stderr,"dbg2       navlat:     %f\n",navlat);
-		fprintf(stderr,"dbg2       speed:      %f\n",speed);
-		fprintf(stderr,"dbg2       heading:    %f\n",heading);
-		}
-	if (verbose >= 2 && kind == MB_DATA_DATA)
-		{
-		fprintf(stderr,"dbg2       nbath:      %d\n",nbath);
-		if (verbose >= 3)
-		 for (i=0;i<nbath;i++)
-		  fprintf(stderr,"dbg3       beam:%d  flag:%3d  bath:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,beamflag[i],bath[i],
-			bathacrosstrack[i],bathalongtrack[i]);
-		fprintf(stderr,"dbg2       namp:       %d\n",namp);
-		if (verbose >= 3)
-		 for (i=0;i<namp;i++)
-		  fprintf(stderr,"dbg3        beam:%d   amp:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,amp[i],bathacrosstrack[i],bathalongtrack[i]);
-		fprintf(stderr,"dbg2        nss:       %d\n",nss);
-		if (verbose >= 3)
-		 for (i=0;i<nss;i++)
-		  fprintf(stderr,"dbg3        beam:%d   ss:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,ss[i],ssacrosstrack[i],ssalongtrack[i]);
-		}
-	if (verbose >= 2 && kind == MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"dbg2       comment:     \ndbg2       %s\n",
-			comment);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_simrad_struct *) store_ptr;
-
-	/* set data kind */
-	store->kind = kind;
-
-	/* insert data in structure */
-	if (store->kind == MB_DATA_DATA)
-		{
-		/* allocate secondary data structure for
-			survey data if needed */
-		if (store->ping == NULL)
-			{
-			status = mbsys_simrad_survey_alloc(
-					verbose,mbio_ptr,
-					store_ptr,error);
-			}
-
-		/* get survey data structure */
-		ping = (struct mbsys_simrad_survey_struct *) store->ping;
-
-		/* get time */
-		mb_unfix_y2k(verbose, time_i[0], &store->year);
-		store->month = time_i[1];
-		store->day = time_i[2];
-		store->hour = time_i[3];
-		store->minute = time_i[4];
-		store->second = time_i[5];
-		store->centisecond = time_i[6]/10000;
-
-		/* get nav */
-		ping->longitude = navlon;
-		ping->latitude = navlat;
-
-		/* get heading */
-		if (store->sonar == MBSYS_SIMRAD_EM121)
-			ping->heading = (int) (heading * 100);
-		else
-			ping->heading = (int) (heading * 10);
-
-		/* get speed  */
-		store->speed = speed/3.6;
-
-		/* insert distance and depth values into storage arrays */
-		ping->beams_bath = nbath;
-		if (store->sonar == MBSYS_SIMRAD_UNKNOWN)
-			{
-			if (nbath <= 60)
-				{
-				store->sonar = MBSYS_SIMRAD_EM1000;
-				ping->bath_mode = 0;
-				}
-			else if (nbath <= 81)
-				{
-				store->sonar = MBSYS_SIMRAD_EM12S;
-				ping->bath_mode = 0;
-				ping->bath_res = 2;
-				}
-			else if (nbath <= 121)
-				{
-				store->sonar = MBSYS_SIMRAD_EM121;
-				ping->bath_mode = 0;
-				ping->bath_res = 2;
-				}
-			else
-				{
-				*error = MB_ERROR_DATA_NOT_INSERTED;
-				status = MB_FAILURE;
-				}
-			}
-		if (store->sonar == MBSYS_SIMRAD_EM1000)
-			{
-			depthscale = 0.02;
-			dacrscale  = 0.1;
-			daloscale  = 0.1;
-			ttscale    = 0.05;
-			reflscale  = 0.5;
-			}
-		else if (store->sonar == MBSYS_SIMRAD_EM12S
-			&& ping->bath_res == 1)
-			{
-			depthscale = 0.1;
-			dacrscale  = 0.2;
-			daloscale  = 0.2;
-			ttscale    = 0.2;
-			reflscale  = 0.5;
-			}
-		else if (store->sonar == MBSYS_SIMRAD_EM12S
-			&& ping->bath_res == 2)
-			{
-			depthscale = 0.2;
-			dacrscale  = 0.5;
-			daloscale  = 0.5;
-			ttscale    = 0.8;
-			reflscale  = 0.5;
-			}
-		else if (store->sonar == MBSYS_SIMRAD_EM12D
-			&& ping->bath_res == 1)
-			{
-			depthscale = 0.1;
-			dacrscale  = 0.2;
-			daloscale  = 0.2;
-			ttscale    = 0.2;
-			reflscale  = 0.5;
-			}
-		else if (store->sonar == MBSYS_SIMRAD_EM12D
-			&& ping->bath_res == 2)
-			{
-			depthscale = 0.2;
-			dacrscale  = 0.5;
-			daloscale  = 0.5;
-			ttscale    = 0.8;
-			reflscale  = 0.5;
-			}
-		else if (store->sonar == MBSYS_SIMRAD_EM121)
-			{
-			depthscale = 0.01 * ping->depth_res;
-			dacrscale  = 0.01 * ping->across_res;
-			daloscale  = 0.01 * ping->along_res;
-			ttscale    = 0.1 * ping->range_res;
-			reflscale  = 0.5;
-			}
-		else
-			{
-			*error = MB_ERROR_DATA_NOT_INSERTED;
-			status = MB_FAILURE;
-			}
-		if (status == MB_SUCCESS)
-			{
-			for (i=0;i<nbath;i++)
-				{
-				ping->bath[i] = bath[i]/depthscale;
-				ping->bath_acrosstrack[i]
-					= bathacrosstrack[i]/dacrscale;
-				ping->bath_alongtrack[i]
-					= bathalongtrack[i]/daloscale;
-				ping->beamflag[i] = beamflag[i];
-				if (beamflag[i] == MB_FLAG_NULL)
-				    ping->bath[i] = 0;
-				}
-			for (i=0;i<namp;i++)
-				{
-				ping->amp[i] = amp[i] / reflscale;
-				}
-			}
-		if (status == MB_SUCCESS)
-			{
-			for (i=0;i<nss;i++)
-				{
-				if (ss[i] > MB_SIDESCAN_NULL)
-					{
-					ping->ss[i] = 100 * ss[i];
-					ping->ssalongtrack[i] = ssalongtrack[i] / daloscale;
-					}
-				else
-					{
-					ping->ss[i] = 0;
-					ping->ssalongtrack[i] = 0;
-					}
-				}
-			}
-		}
-
-	/* insert nav in structure */
-	else if (store->kind == MB_DATA_NAV)
-		{
-		/* get time */
-		mb_unfix_y2k(verbose, time_i[0], &store->pos_year);
-		store->pos_month = time_i[1];
-		store->pos_day = time_i[2];
-		store->pos_hour = time_i[3];
-		store->pos_minute = time_i[4];
-		store->pos_second = time_i[5];
-		store->pos_centisecond = time_i[6]/10000;
-
-		/* get nav */
-		store->pos_longitude = navlon;
-		store->pos_latitude = navlat;
-
-		/* get heading */
-		store->line_heading = heading;
-
-		/* get speed  */
-		store->speed = speed/3.6;
-		}
-
-	/* insert comment in structure */
-	else if (store->kind == MB_DATA_COMMENT)
-		{
-		strncpy(store->comment,comment,79);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_simrad_ttimes(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, int *nbeams,
-	double *ttimes, double *angles,
-	double *angles_forward, double *angles_null,
-	double *heave, double *alongtrack_offset,
-	double *draft, double *ssv, int *error)
-{
-	char	*function_name = "mbsys_simrad_ttimes";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_simrad_struct *store;
-	struct mbsys_simrad_survey_struct *ping;
-	double	ttscale;
-	double	heave_use;
-	double	*angles_simrad;
-	double	alpha, beta;
-	int	istep = 0;
-	int	interleave = 0;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       ttimes:     %p\n",(void *)ttimes);
-		fprintf(stderr,"dbg2       angles_xtrk:%p\n",(void *)angles);
-		fprintf(stderr,"dbg2       angles_ltrk:%p\n",(void *)angles_forward);
-		fprintf(stderr,"dbg2       angles_null:%p\n",(void *)angles_null);
-		fprintf(stderr,"dbg2       heave:      %p\n",(void *)heave);
-		fprintf(stderr,"dbg2       ltrk_off:   %p\n",(void *)alongtrack_offset);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_simrad_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get survey data structure */
-		ping = (struct mbsys_simrad_survey_struct *) store->ping;
-
-		/* get nbeams */
-		*nbeams = ping->beams_bath;
-
-		/* get depth offset (heave + heave offset) */
-		heave_use =  0.01 * ping->ping_heave;
-		*ssv = 0.1 * ping->sound_vel;
-		if (store->sonar == MBSYS_SIMRAD_EM12S)
-			*draft = store->em12_td;
-		else if (store->sonar == MBSYS_SIMRAD_EM12D)
-			*draft = store->em12_td;
-		else if (store->sonar == MBSYS_SIMRAD_EM100)
-			*draft = store->em100_td;
-		else if (store->sonar == MBSYS_SIMRAD_EM1000)
-			*draft = store->em1000_td;
-
-		/* get travel times, angles */
-		interleave = MB_NO;
-		if (store->sonar == MBSYS_SIMRAD_EM1000)
-			{
-			if (ping->bath_mode == 1)
-			    {
-			    angles_simrad = angles_EM1000_ISO_ANG_60_2_MS_48_FAIS;
-			    interleave = MB_NO;
-			    }
-			else if (ping->bath_mode == 2)
-			    {
-			    angles_simrad = angles_EM1000_ISO_ANG_120_07_MS_48_FAIS;
-			    interleave = MB_YES;
-			    }
-			else if (ping->bath_mode == 3)
-			    {
-			    angles_simrad = angles_EM1000_ISO_ANG_150_02_MS_60_FAIS;
-			    interleave = MB_YES;
-			    }
-			else if (ping->bath_mode == 4)
-			    {
-			    angles_simrad = angles_EM1000_CHANNEL_02_MS_60_FAIS;
-			    interleave = MB_YES;
-			    }
-			else if (ping->bath_mode == 5)
-			    {
-			    angles_simrad = angles_EM1000_150_02_MS_60_FAIS;
-			    interleave = MB_YES;
-			    }
-			else if (ping->bath_mode == 6)
-			    {
-			    angles_simrad = angles_EM1000_140_02_MS_60_FAIS;
-			    interleave = MB_YES;
-			    }
-			else if (ping->bath_mode == 7)
-			    {
-			    angles_simrad = angles_EM1000_128_02_MS_60_FAIS;
-			    interleave = MB_YES;
-			    }
-			else if (ping->bath_mode == 8)
-			    {
-			    angles_simrad = angles_EM1000_120_07_MS_48_FAIS;
-			    interleave = MB_YES;
-			    }
-			else if (ping->bath_mode == 9)
-			    {
-			    angles_simrad = angles_EM1000_104_07_MS_48_FAIS;
-			    interleave = MB_YES;
-			    }
-			else if (ping->bath_mode == 10)
-			    {
-			    angles_simrad = angles_EM1000_88_07_MS_48_FAIS;
-			    interleave = MB_YES;
-			    }
-			else if (ping->bath_mode == 11)
-			    {
-			    angles_simrad = angles_EM1000_70_2_MS_48_FAIS;
-			    interleave = MB_NO;
-			    }
-			else if (ping->bath_mode == 12)
-			    {
-			    angles_simrad = angles_EM1000_BERGE_02_MS_60_FAIS;
-			    interleave = MB_YES;
-			    }
-			else if (ping->bath_mode == 13)
-			    {
-			    angles_simrad = angles_EM1000_BERGE_02_MS_60_FAIS;
-			    interleave = MB_YES;
-			    }
-			}
-		else if (store->sonar == MBSYS_SIMRAD_EM12S)
-			{
-			if (ping->bath_mode == 1)
-			    angles_simrad = angles_EM12S_ISO_ANG_SHALLOW;
-			else if (ping->bath_mode == 2)
-			    angles_simrad = angles_EM12S_ISO_ANG_DEEP;
-			else if (ping->bath_mode == 3)
-			    angles_simrad = angles_EM12S_SHALLOW;
-			else if (ping->bath_mode == 4)
-			    angles_simrad = angles_EM12S_120;
-			else if (ping->bath_mode == 5)
-			    angles_simrad = angles_EM12S_105;
-			else if (ping->bath_mode == 6)
-			    angles_simrad = angles_EM12S_90;
-			}
-		else if (store->sonar == MBSYS_SIMRAD_EM12D
-			&& ping->swath_id == EM_SWATH_PORT)
-			{
-			if (ping->bath_mode == 1)
-			    angles_simrad = angles_EM12DP_ISO_ANG_SHALLOW;
-			else if (ping->bath_mode == 2)
-			    angles_simrad = angles_EM12DP_ISO_ANG_DEEP;
-			else if (ping->bath_mode == 3)
-			    angles_simrad = angles_EM12DP_SHALLOW;
-			else if (ping->bath_mode == 4)
-			    angles_simrad = angles_EM12DP_150;
-			else if (ping->bath_mode == 5)
-			    angles_simrad = angles_EM12DP_140;
-			else if (ping->bath_mode == 6)
-			    angles_simrad = angles_EM12DP_128;
-			else if (ping->bath_mode == 7)
-			    angles_simrad = angles_EM12DP_114;
-			else if (ping->bath_mode == 8)
-			    angles_simrad = angles_EM12DP_98;
-			}
-		else if (store->sonar == MBSYS_SIMRAD_EM12D
-			&& ping->swath_id == EM_SWATH_STARBOARD)
-			{
-			if (ping->bath_mode == 1)
-			    angles_simrad = angles_EM12DS_ISO_ANG_SHALLOW;
-			else if (ping->bath_mode == 2)
-			    angles_simrad = angles_EM12DS_ISO_ANG_DEEP;
-			else if (ping->bath_mode == 3)
-			    angles_simrad = angles_EM12DS_SHALLOW;
-			else if (ping->bath_mode == 4)
-			    angles_simrad = angles_EM12DS_150;
-			else if (ping->bath_mode == 5)
-			    angles_simrad = angles_EM12DS_140;
-			else if (ping->bath_mode == 6)
-			    angles_simrad = angles_EM12DS_128;
-			else if (ping->bath_mode == 7)
-			    angles_simrad = angles_EM12DS_114;
-			else if (ping->bath_mode == 8)
-			    angles_simrad = angles_EM12DS_98;
-			}
-		else if (store->sonar == MBSYS_SIMRAD_EM121)
-			{
-			angles_simrad = angles_EM121_GUESS;
-			}
-		if (store->sonar == MBSYS_SIMRAD_EM1000)
-			{
-			ttscale = 0.00005;
-			}
-		else if ((store->sonar == MBSYS_SIMRAD_EM12S
-			    || store->sonar == MBSYS_SIMRAD_EM12D)
-			&& ping->bath_res == 1)
-			{
-			ttscale    = 0.0002;
-			}
-		else if ((store->sonar == MBSYS_SIMRAD_EM12S
-			    || store->sonar == MBSYS_SIMRAD_EM12D)
-			&& ping->bath_res == 2)
-			ttscale    = 0.0008;
-		else if (store->sonar == MBSYS_SIMRAD_EM121)
-			ttscale    = 0.0001 * ping->range_res;
-		else
-			ttscale    = 0.0002;
-
-		/* if interleaved get center beam */
-		if (interleave == MB_YES)
-			{
-			if (ping->bath_mode == 12
-			    && fabs(ping->bath_acrosstrack[28])
-				< fabs(ping->bath_acrosstrack[29]))
-			    istep = 1;
-			else if (ping->bath_mode == 13
-			    && fabs(ping->bath_acrosstrack[31])
-				< fabs(ping->bath_acrosstrack[30]))
-			    istep = 1;
-			else if (fabs(ping->bath_acrosstrack[*nbeams/2-1])
-			    < fabs(ping->bath_acrosstrack[*nbeams/2]))
-			    istep = 1;
-			else
-			    istep = 0;
-			}
-
-		/* get travel times and angles */
-		for (i=0;i<*nbeams;i++)
-			{
-			ttimes[i] = ttscale * ping->tt[i];
-			alpha = 0.01 * ping->pitch;
-			if (store->sonar == MBSYS_SIMRAD_EM1000
-			    && ping->bath_mode == 13)
-			    {
-			    beta = 90.0 - angles_simrad[*nbeams-1-(2*i+istep)];
-			    }
-			else if (store->sonar == MBSYS_SIMRAD_EM1000
-			    && interleave == MB_YES)
-			    {
-			    beta = 90.0 + angles_simrad[2*i+istep];
-			    }
-			else if (store->sonar == MBSYS_SIMRAD_EM1000)
-			    {
-			    beta = 90.0 + angles_simrad[i];
-			    }
-			else
-			    {
-			    beta = 90.0 + angles_simrad[i];
-			    }
-			mb_rollpitch_to_takeoff(verbose,
-				alpha, beta, &angles[i],
-				&angles_forward[i], error);
-			if (store->sonar == MBSYS_SIMRAD_EM1000)
-			    angles_null[i] = angles[i];
-			else if (store->sonar == MBSYS_SIMRAD_EM1000)
-			    angles_null[i] = angles[i];
-			else if (store->sonar == MBSYS_SIMRAD_EM12S)
-			    angles_null[i] = 0.0;
-			else if (store->sonar == MBSYS_SIMRAD_EM12D)
-			    angles_null[i] = 0.0; /* wrong for sure */
-			heave[i] = heave_use;
-			alongtrack_offset[i] = 0.0;
-			}
-
-		/* reset null angles for EM1000 outer beams */
-		if (store->sonar == MBSYS_SIMRAD_EM1000
-		    && *nbeams == 60)
-			{
-			for (i=0;i<6;i++)
-			    angles_null[i] = angles_null[6];
-			for (i=55;i<=60;i++)
-			    angles_null[i] = angles_null[54];
-			}
-
-		/* set status */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error == MB_ERROR_NO_ERROR)
-		{
-		fprintf(stderr,"dbg2       draft:      %f\n",*draft);
-		fprintf(stderr,"dbg2       ssv:        %f\n",*ssv);
-		fprintf(stderr,"dbg2       nbeams:     %d\n",*nbeams);
-		for (i=0;i<*nbeams;i++)
-			fprintf(stderr,"dbg2       beam %d: tt:%f  angle_xtrk:%f  angle_ltrk:%f  angle_null:%f  depth_off:%f  ltrk_off:%f\n",
-				i,ttimes[i],angles[i],
-				angles_forward[i],angles_null[i],
-				heave[i],alongtrack_offset[i]);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_simrad_detects(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, int *nbeams, int *detects, int *error)
-{
-	char	*function_name = "mbsys_simrad_detects";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_simrad_struct *store;
-	struct mbsys_simrad_survey_struct *ping;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       detects:    %p\n",(void *)detects);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_simrad_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get survey data structure */
-		ping = (struct mbsys_simrad_survey_struct *) store->ping;
-
-		*nbeams = ping->beams_bath;
-		for (i=0;i<ping->beams_bath;i++)
-			{
-			if (ping->bath[i] == 0)
-				detects[i] = MB_DETECT_UNKNOWN;
-			else if (ping->quality[i] & 128)
-				detects[i] = MB_DETECT_PHASE;
-			else
-				detects[i] = MB_DETECT_AMPLITUDE;
-			}
-
-		/* set status */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error == MB_ERROR_NO_ERROR)
-		{
-		fprintf(stderr,"dbg2       nbeams:     %d\n",*nbeams);
-		for (i=0;i<*nbeams;i++)
-			fprintf(stderr,"dbg2       beam %d: detects:%d\n",
-				i,detects[i]);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_simrad_pulses(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, int *nbeams, int *pulses, int *error)
-{
-	char	*function_name = "mbsys_simrad_pulses";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_simrad_struct *store;
-	struct mbsys_simrad_survey_struct *ping;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       pulses:     %p\n",(void *)pulses);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_simrad_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get survey data structure */
-		ping = (struct mbsys_simrad_survey_struct *) store->ping;
-
-		*nbeams = ping->beams_bath;
-		for (i=0;i<ping->beams_bath;i++)
-			{
-			pulses[i] = MB_PULSE_CW;
-			}
-
-		/* set status */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error == MB_ERROR_NO_ERROR)
-		{
-		fprintf(stderr,"dbg2       nbeams:     %d\n",*nbeams);
-		for (i=0;i<*nbeams;i++)
-			fprintf(stderr,"dbg2       beam %d: pulses:%d\n",
-				i,pulses[i]);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_simrad_gains(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, double *transmit_gain, double *pulse_length,
-			double *receive_gain, int *error)
-{
-	char	*function_name = "mbsys_simrad_gains";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_simrad_struct *store;
-	struct mbsys_simrad_survey_struct *ping;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_simrad_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get survey data structure */
-		ping = (struct mbsys_simrad_survey_struct *) store->ping;
-
-		/* get transmit_gain (dB) */
-		*transmit_gain = (double)ping->power_level;
-
-		/* get pulse_length (sec) */
-		*pulse_length = 0.001 * ((double)ping->pulse_length);
-
-		/* get receive_gain (dB) */
-		*receive_gain = (double)0.0;
-
-		/* set status */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error == MB_ERROR_NO_ERROR)
-		{
-		fprintf(stderr,"dbg2       transmit_gain: %f\n",*transmit_gain);
-		fprintf(stderr,"dbg2       pulse_length:  %f\n",*pulse_length);
-		fprintf(stderr,"dbg2       receive_gain:  %f\n",*receive_gain);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_simrad_extract_altitude(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, double *transducer_depth, double *altitude,
-	int *error)
-{
-	char	*function_name = "mbsys_simrad_extract_altitude";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_simrad_struct *store;
-	struct mbsys_simrad_survey_struct *ping;
-	double	depthscale, dacrscale;
-	double	bath_best;
-	double	xtrack_min;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_simrad_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get survey data structure */
-		ping = (struct mbsys_simrad_survey_struct *) store->ping;
-
-		/* get transducer depth and altitude */
-		if (store->sonar == MBSYS_SIMRAD_EM12S)
-			*transducer_depth = 0.01*ping->ping_heave + store->em12_td;
-		else if (store->sonar == MBSYS_SIMRAD_EM12D)
-			*transducer_depth = 0.01*ping->ping_heave + store->em12_td;
-		else if (store->sonar == MBSYS_SIMRAD_EM100)
-			*transducer_depth = 0.01*ping->ping_heave + store->em100_td;
-		else if (store->sonar == MBSYS_SIMRAD_EM1000)
-			*transducer_depth = 0.01*ping->ping_heave + store->em1000_td;
-		else if (store->sonar == MBSYS_SIMRAD_EM121)
-			*transducer_depth = 0.01*ping->ping_heave + store->em12_td;
-		else
-			*transducer_depth = 0.0;
-		if (store->sonar == MBSYS_SIMRAD_EM1000)
-			{
-			depthscale = 0.02;
-			dacrscale  = 0.1;
-			}
-		else if (store->sonar == MBSYS_SIMRAD_EM12S
-			&& ping->bath_res == 1)
-			{
-			depthscale = 0.1;
-			dacrscale  = 0.2;
-			}
-		else if (store->sonar == MBSYS_SIMRAD_EM12S
-			&& ping->bath_res == 2)
-			{
-			depthscale = 0.2;
-			dacrscale  = 0.5;
-			}
-		else if (store->sonar == MBSYS_SIMRAD_EM12D
-			&& ping->bath_res == 1)
-			{
-			depthscale = 0.1;
-			dacrscale  = 0.2;
-			}
-		else if (store->sonar == MBSYS_SIMRAD_EM12D
-			&& ping->bath_res == 2)
-			{
-			depthscale = 0.2;
-			dacrscale  = 0.5;
-			}
-		else if (store->sonar == MBSYS_SIMRAD_EM121)
-			{
-			depthscale = 0.01 * ping->depth_res;
-			dacrscale  = 0.01 * ping->across_res;
-			}
-		else
-			{
-			depthscale = 0.1;
-			dacrscale  = 0.1;
-			}
-		bath_best = 0.0;
-		if (ping->bath[ping->beams_bath/2] > 0)
-		    bath_best = depthscale * ping->bath[ping->beams_bath/2];
-		else
-		    {
-		    xtrack_min = 99999999.9;
-		    for (i=0;i<ping->beams_bath;i++)
-			{
-			if (ping->bath[i] > 0.0
-			    && fabs(dacrscale * ping->bath_acrosstrack[i]) < xtrack_min)
-			    {
-			    xtrack_min = fabs(dacrscale * ping->bath_acrosstrack[i]);
-			    bath_best = depthscale * ping->bath[i];
-			    }
-			}
-		    }
-		if (bath_best <= 0.0)
-		    {
-		    xtrack_min = 99999999.9;
-		    for (i=0;i<ping->beams_bath;i++)
-			{
-			if (ping->bath[i] < 0.0
-			    && fabs(dacrscale * ping->bath_acrosstrack[i]) < xtrack_min)
-			    {
-			    xtrack_min = fabs(dacrscale * ping->bath_acrosstrack[i]);
-			    bath_best = -depthscale * ping->bath[i];
-			    }
-			}
-		    }
-		*altitude = bath_best - *transducer_depth;
-
-		/* set status */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:              %d\n",*kind);
-		fprintf(stderr,"dbg2       transducer_depth:  %f\n",*transducer_depth);
-		fprintf(stderr,"dbg2       altitude:          %f\n",*altitude);
-		fprintf(stderr,"dbg2       error:             %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:            %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_simrad_extract_nav(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int time_i[7], double *time_d,
-		double *navlon, double *navlat,
-		double *speed, double *heading, double *draft,
-		double *roll, double *pitch, double *heave,
-		int *error)
-{
-	char	*function_name = "mbsys_simrad_extract_nav";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_simrad_struct *store;
-	struct mbsys_simrad_survey_struct *ping;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_simrad_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get survey data structure */
-		ping = (struct mbsys_simrad_survey_struct *) store->ping;
-
-		/* get time */
-		mb_fix_y2k(verbose, store->year, &time_i[0]);
-		time_i[1] = store->month;
-		time_i[2] = store->day;
-		time_i[3] = store->hour;
-		time_i[4] = store->minute;
-		time_i[5] = store->second;
-		time_i[6] = 10000*store->centisecond;
-		mb_get_time(verbose,time_i,time_d);
-
-		/* get navigation */
-		*navlon = ping->longitude;
-		*navlat = ping->latitude;
-
-		/* get heading */
-		if (store->sonar == MBSYS_SIMRAD_EM121)
-			*heading = 0.01 * ping->heading;
-		else
-			*heading = 0.1 * ping->heading;
-
-		/* get speed  */
-		*speed = 3.6*store->speed;
-
-		/* get draft  */
-		if (store->sonar == MBSYS_SIMRAD_EM12S)
-			*draft = store->em12_td;
-		else if (store->sonar == MBSYS_SIMRAD_EM12D)
-			*draft = store->em12_td;
-		else if (store->sonar == MBSYS_SIMRAD_EM100)
-			*draft = store->em100_td;
-		else if (store->sonar == MBSYS_SIMRAD_EM1000)
-			*draft = store->em1000_td;
-
-		/* get roll pitch and heave */
-		*roll = 0.01*ping->roll;
-		*pitch = 0.01*ping->pitch;
-		*heave = 0.01*ping->ping_heave;
-
-		/* print debug statements */
-		if (verbose >= 5)
-			{
-			fprintf(stderr,"\ndbg4  Data extracted by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  Extracted values:\n");
-			fprintf(stderr,"dbg4       kind:       %d\n",
-				*kind);
-			fprintf(stderr,"dbg4       error:      %d\n",
-				*error);
-			fprintf(stderr,"dbg4       time_i[0]:  %d\n",
-				time_i[0]);
-			fprintf(stderr,"dbg4       time_i[1]:  %d\n",
-				time_i[1]);
-			fprintf(stderr,"dbg4       time_i[2]:  %d\n",
-				time_i[2]);
-			fprintf(stderr,"dbg4       time_i[3]:  %d\n",
-				time_i[3]);
-			fprintf(stderr,"dbg4       time_i[4]:  %d\n",
-				time_i[4]);
-			fprintf(stderr,"dbg4       time_i[5]:  %d\n",
-				time_i[5]);
-			fprintf(stderr,"dbg4       time_i[6]:  %d\n",
-				time_i[6]);
-			fprintf(stderr,"dbg4       time_d:     %f\n",
-				*time_d);
-			fprintf(stderr,"dbg4       longitude:  %f\n",
-				*navlon);
-			fprintf(stderr,"dbg4       latitude:   %f\n",
-				*navlat);
-			fprintf(stderr,"dbg4       speed:      %f\n",
-				*speed);
-			fprintf(stderr,"dbg4       heading:    %f\n",
-				*heading);
-			fprintf(stderr,"dbg4       draft:      %f\n",
-				*draft);
-			fprintf(stderr,"dbg4       roll:       %f\n",
-				*roll);
-			fprintf(stderr,"dbg4       pitch:      %f\n",
-				*pitch);
-			fprintf(stderr,"dbg4       heave:      %f\n",
-				*heave);
-			}
-
-		/* done translating values */
-
-		}
-
-	/* extract data from structure */
-	else if (*kind == MB_DATA_NAV)
-		{
-		/* get time */
-		mb_fix_y2k(verbose, store->pos_year, &time_i[0]);
-		time_i[1] = store->pos_month;
-		time_i[2] = store->pos_day;
-		time_i[3] = store->pos_hour;
-		time_i[4] = store->pos_minute;
-		time_i[5] = store->pos_second;
-		time_i[6] = 10000*store->pos_centisecond;
-		mb_get_time(verbose,time_i,time_d);
-		*navlon = store->pos_longitude;
-		*navlat = store->pos_latitude;
-
-		/* get heading */
-		*heading = store->line_heading;
-
-		/* get speed  */
-		*speed = 3.6 * store->speed;
-
-		/* get draft  */
-		if (store->sonar == MBSYS_SIMRAD_EM12S)
-			*draft = store->em12_td;
-		else if (store->sonar == MBSYS_SIMRAD_EM12D)
-			*draft = store->em12_td;
-		else if (store->sonar == MBSYS_SIMRAD_EM100)
-			*draft = store->em100_td;
-		else if (store->sonar == MBSYS_SIMRAD_EM1000)
-			*draft = store->em1000_td;
-
-		/* get roll pitch and heave */
-		*roll = 0.0;
-		*pitch = 0.0;
-		*heave = 0.0;
-
-		/* print debug statements */
-		if (verbose >= 5)
-			{
-			fprintf(stderr,"\ndbg4  Data extracted by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  Extracted values:\n");
-			fprintf(stderr,"dbg4       kind:       %d\n",
-				*kind);
-			fprintf(stderr,"dbg4       error:      %d\n",
-				*error);
-			fprintf(stderr,"dbg4       time_i[0]:  %d\n",
-				time_i[0]);
-			fprintf(stderr,"dbg4       time_i[1]:  %d\n",
-				time_i[1]);
-			fprintf(stderr,"dbg4       time_i[2]:  %d\n",
-				time_i[2]);
-			fprintf(stderr,"dbg4       time_i[3]:  %d\n",
-				time_i[3]);
-			fprintf(stderr,"dbg4       time_i[4]:  %d\n",
-				time_i[4]);
-			fprintf(stderr,"dbg4       time_i[5]:  %d\n",
-				time_i[5]);
-			fprintf(stderr,"dbg4       time_i[6]:  %d\n",
-				time_i[6]);
-			fprintf(stderr,"dbg4       time_d:     %f\n",
-				*time_d);
-			fprintf(stderr,"dbg4       longitude:  %f\n",
-				*navlon);
-			fprintf(stderr,"dbg4       latitude:   %f\n",
-				*navlat);
-			fprintf(stderr,"dbg4       speed:      %f\n",
-				*speed);
-			fprintf(stderr,"dbg4       heading:    %f\n",
-				*heading);
-			fprintf(stderr,"dbg4       draft:      %f\n",
-				*draft);
-			fprintf(stderr,"dbg4       roll:       %f\n",
-				*roll);
-			fprintf(stderr,"dbg4       pitch:      %f\n",
-				*pitch);
-			fprintf(stderr,"dbg4       heave:      %f\n",
-				*heave);
-			}
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind == MB_DATA_DATA)
-		{
-		fprintf(stderr,"dbg2       time_i[0]:     %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:     %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:     %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:     %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:     %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:     %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:     %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:        %f\n",*time_d);
-		fprintf(stderr,"dbg2       longitude:     %f\n",*navlon);
-		fprintf(stderr,"dbg2       latitude:      %f\n",*navlat);
-		fprintf(stderr,"dbg2       speed:         %f\n",*speed);
-		fprintf(stderr,"dbg2       heading:       %f\n",*heading);
-		fprintf(stderr,"dbg2       draft:         %f\n",*draft);
-		fprintf(stderr,"dbg2       roll:          %f\n",*roll);
-		fprintf(stderr,"dbg2       pitch:         %f\n",*pitch);
-		fprintf(stderr,"dbg2       heave:         %f\n",*heave);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_simrad_insert_nav(int verbose, void *mbio_ptr, void *store_ptr,
-		int time_i[7], double time_d,
-		double navlon, double navlat,
-		double speed, double heading, double draft,
-		double roll, double pitch, double heave,
-		int *error)
-{
-	char	*function_name = "mbsys_simrad_insert_nav";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_simrad_struct *store;
-	struct mbsys_simrad_survey_struct *ping;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       time_i[0]:  %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:  %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:  %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:  %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:  %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:  %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:  %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:     %f\n",time_d);
-		fprintf(stderr,"dbg2       navlon:     %f\n",navlon);
-		fprintf(stderr,"dbg2       navlat:     %f\n",navlat);
-		fprintf(stderr,"dbg2       speed:      %f\n",speed);
-		fprintf(stderr,"dbg2       heading:    %f\n",heading);
-		fprintf(stderr,"dbg2       draft:      %f\n",draft);
-		fprintf(stderr,"dbg2       roll:       %f\n",roll);
-		fprintf(stderr,"dbg2       pitch:      %f\n",pitch);
-		fprintf(stderr,"dbg2       heave:      %f\n",heave);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_simrad_struct *) store_ptr;
-
-	/* insert data in structure */
-	if (store->kind == MB_DATA_DATA)
-		{
-		/* get survey data structure */
-		ping = (struct mbsys_simrad_survey_struct *) store->ping;
-
-		/* get time */
-		mb_unfix_y2k(verbose, time_i[0], &store->year);
-		store->month = time_i[1];
-		store->day = time_i[2];
-		store->hour = time_i[3];
-		store->minute = time_i[4];
-		store->second = time_i[5];
-		store->centisecond = time_i[6]/10000;
-
-		/* get nav */
-		ping->longitude = navlon;
-		ping->latitude = navlat;
-
-		/* get heading */
-		if (store->sonar == MBSYS_SIMRAD_EM121)
-			ping->heading = (int) (heading * 100);
-		else
-			ping->heading = (int) (heading * 10);
-
-		/* get speed  */
-		store->speed = speed/3.6;
-
-		/* get draft  */
-		if (store->sonar == MBSYS_SIMRAD_EM12S)
-			store->em12_td = draft;
-		else if (store->sonar == MBSYS_SIMRAD_EM12D)
-			store->em12_td = draft;
-		else if (store->sonar == MBSYS_SIMRAD_EM100)
-			store->em100_td = draft;
-		else if (store->sonar == MBSYS_SIMRAD_EM1000)
-			store->em1000_td = draft;
-
-		/* get roll pitch and heave */
-		ping->roll = roll*100.0;
-		ping->pitch = pitch*100.0;
-		ping->ping_heave = heave*100.0;
-		}
-
-	/* insert nav in structure */
-	else if (store->kind == MB_DATA_NAV)
-		{
-		/* get time */
-		mb_unfix_y2k(verbose, time_i[0], &store->pos_year);
-		store->pos_month = time_i[1];
-		store->pos_day = time_i[2];
-		store->pos_hour = time_i[3];
-		store->pos_minute = time_i[4];
-		store->pos_second = time_i[5];
-		store->pos_centisecond = time_i[6]/10000;
-
-		/* get nav */
-		store->pos_longitude = navlon;
-		store->pos_latitude = navlat;
-
-		/* get heading */
-		store->line_heading = heading;
-
-		/* get speed  */
-		store->speed = speed/3.6;
-
-		/* get draft  */
-		if (store->sonar == MBSYS_SIMRAD_EM12S)
-			store->em12_td = draft;
-		else if (store->sonar == MBSYS_SIMRAD_EM12D)
-			store->em12_td = draft;
-		else if (store->sonar == MBSYS_SIMRAD_EM100)
-			store->em100_td = draft;
-		else if (store->sonar == MBSYS_SIMRAD_EM1000)
-			store->em1000_td = draft;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_simrad_extract_svp(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int *nsvp,
-		double *depth, double *velocity,
-		int *error)
-{
-	char	*function_name = "mbsys_simrad_extract_svp";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_simrad_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_simrad_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_VELOCITY_PROFILE)
-		{
-		/* get number of depth-velocity pairs */
-		*nsvp = store->svp_num;
-
-		/* get profile */
-		for (i=0;i<*nsvp;i++)
-			{
-			depth[i] = store->svp_depth[i];
-			velocity[i] = 0.1 * store->svp_vel[i];
-			}
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:              %d\n",*kind);
-		fprintf(stderr,"dbg2       nsvp:              %d\n",*nsvp);
-		for (i=0;i<*nsvp;i++)
-		    fprintf(stderr,"dbg2       depth[%d]: %f   velocity[%d]: %f\n",i, depth[i], i, velocity[i]);
-		fprintf(stderr,"dbg2       error:             %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:            %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_simrad_insert_svp(int verbose, void *mbio_ptr, void *store_ptr,
-		int nsvp,
-		double *depth, double *velocity,
-		int *error)
-{
-	char	*function_name = "mbsys_simrad_insert_svp";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_simrad_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       nsvp:       %d\n",nsvp);
-		for (i=0;i<nsvp;i++)
-		    fprintf(stderr,"dbg2       depth[%d]: %f   velocity[%d]: %f\n",i, depth[i], i, velocity[i]);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_simrad_struct *) store_ptr;
-
-	/* insert data in structure */
-	if (store->kind == MB_DATA_VELOCITY_PROFILE)
-		{
-		/* get number of depth-velocity pairs */
-		store->svp_num = MIN(nsvp, MBSYS_SIMRAD_MAXSVP);
-
-		/* get profile */
-		for (i=0;i<store->svp_num;i++)
-			{
-			store->svp_depth[i] = (int) depth[i];
-			store->svp_vel[i] = (int) (10 * velocity[i]);
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_simrad_copy(int verbose, void *mbio_ptr,
-			void *store_ptr, void *copy_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_simrad_copy";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_simrad_struct *store;
-	struct mbsys_simrad_struct *copy;
-	struct mbsys_simrad_survey_struct *ping_store;
-	struct mbsys_simrad_survey_struct *ping_copy;
-	char	*ping_save;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       copy_ptr:   %p\n",(void *)copy_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointers */
-	store = (struct mbsys_simrad_struct *) store_ptr;
-	copy = (struct mbsys_simrad_struct *) copy_ptr;
-
-	/* check if survey data needs to be copied */
-	if (store->kind == MB_DATA_DATA
-		&& store->ping != NULL)
-		{
-		/* make sure a survey data structure exists to
-			be copied into */
-		if (copy->ping == NULL)
-			{
-			status = mbsys_simrad_survey_alloc(
-					verbose,mbio_ptr,
-					copy_ptr,error);
-			}
-
-		/* save pointer value */
-		ping_save = (char *)copy->ping;
-		}
-	else
-		ping_save = NULL;
-
-	/* copy the main structure */
-	*copy = *store;
-
-	/* if needed copy the survey data structure */
-	if (store->kind == MB_DATA_DATA
-		&& store->ping != NULL
-		&& status == MB_SUCCESS)
-		{
-		copy->ping = (struct mbsys_simrad_survey_struct *) ping_save;
-		ping_store = (struct mbsys_simrad_survey_struct *) store->ping;
-		ping_copy = (struct mbsys_simrad_survey_struct *) copy->ping;
-		*ping_copy = *ping_store;
-		}
-	else
-		copy->ping = NULL;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_simrad_makess(int verbose, void *mbio_ptr, void *store_ptr,
-		int pixel_size_set, double *pixel_size,
-		int swath_width_set, double *swath_width,
-		int pixel_int,
-		int *error)
-{
-	char	*function_name = "mbsys_simrad_makess";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_simrad_struct *store;
-	struct mbsys_simrad_survey_struct *ping;
-	double	ss[MBSYS_SIMRAD_MAXPIXELS];
-	int	ss_cnt[MBSYS_SIMRAD_MAXPIXELS];
-	double	ssacrosstrack[MBSYS_SIMRAD_MAXPIXELS];
-	double	ssalongtrack[MBSYS_SIMRAD_MAXPIXELS];
-	mb_s_char *beam_ss;
-	int	nbathsort;
-	double	bathsort[MBSYS_SIMRAD_MAXBEAMS];
-	double	depthscale, depthoffset;
-	double	dacrscale, daloscale;
-	double	reflscale;
-	double  pixel_size_calc;
-	double	ss_spacing, ss_spacing_use;
-	double	*angles_simrad;
-	int	pixel_int_use;
-	double	depth, xtrack, ltrack, xtrackss;
-	double	range, beam_foot, beamwidth, sint;
-	double	angle;
-	int	interleave, istep;
-	int	first, last, k1, k2;
-	int	i, k, kk;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:         %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:        %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:       %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       pixel_size_set:  %d\n",pixel_size_set);
-		fprintf(stderr,"dbg2       pixel_size:      %f\n",*pixel_size);
-		fprintf(stderr,"dbg2       swath_width_set: %d\n",swath_width_set);
-		fprintf(stderr,"dbg2       swath_width:     %f\n",*swath_width);
-		fprintf(stderr,"dbg2       pixel_int:       %d\n",pixel_int);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_simrad_struct *) store_ptr;
-
-	/* insert data in structure */
-	if (store->kind == MB_DATA_DATA)
-		{
-		/* get pointer to raw data structure */
-		ping = (struct mbsys_simrad_survey_struct *) store->ping;
-
-		/* zero the sidescan */
-		for (i=0;i<MBSYS_SIMRAD_MAXPIXELS;i++)
-			{
-			ss[i] = 0.0;
-			ssacrosstrack[i] = 0.0;
-			ssalongtrack[i] = 0.0;
-			ss_cnt[i] = 0;
-			}
-
-		/* set scaling parameters */
-		if (store->sonar == MBSYS_SIMRAD_EM1000)
-			{
-			depthscale = 0.02;
-			dacrscale  = 0.1;
-			daloscale  = 0.1;
-			reflscale  = 0.5;
-			}
-		else if (store->sonar == MBSYS_SIMRAD_EM12S
-			&& ping->bath_res == 1)
-			{
-			depthscale = 0.1;
-			dacrscale  = 0.2;
-			daloscale  = 0.2;
-			reflscale  = 0.5;
-			}
-		else if (store->sonar == MBSYS_SIMRAD_EM12S
-			&& ping->bath_res == 2)
-			{
-			depthscale = 0.2;
-			dacrscale  = 0.5;
-			daloscale  = 0.5;
-			reflscale  = 0.5;
-			}
-		else if (store->sonar == MBSYS_SIMRAD_EM12D
-			&& ping->bath_res == 1)
-			{
-			depthscale = 0.1;
-			dacrscale  = 0.2;
-			daloscale  = 0.2;
-			reflscale  = 0.5;
-			}
-		else if (store->sonar == MBSYS_SIMRAD_EM12D
-			&& ping->bath_res == 2)
-			{
-			depthscale = 0.2;
-			dacrscale  = 0.5;
-			daloscale  = 0.5;
-			reflscale  = 0.5;
-			}
-		else if (store->sonar == MBSYS_SIMRAD_EM121)
-			{
-			depthscale = 0.01 * ping->depth_res;
-			dacrscale  = 0.01 * ping->across_res;
-			daloscale  = 0.01 * ping->along_res;
-			reflscale  = 0.5;
-			}
-		else
-			{
-			depthscale = 0.1;
-			dacrscale  = 0.2;
-			daloscale  = 0.2;
-			reflscale  = 0.5;
-			}
-		depthoffset = 0.0;
-
-		/* get angles */
-		interleave = MB_NO;
-		if (store->sonar == MBSYS_SIMRAD_EM1000)
-			{
-			if (ping->bath_mode == 1)
-			    {
-			    angles_simrad = angles_EM1000_ISO_ANG_60_2_MS_48_FAIS;
-			    interleave = MB_NO;
-			    }
-			else if (ping->bath_mode == 2)
-			    {
-			    angles_simrad = angles_EM1000_ISO_ANG_120_07_MS_48_FAIS;
-			    interleave = MB_YES;
-			    }
-			else if (ping->bath_mode == 3)
-			    {
-			    angles_simrad = angles_EM1000_ISO_ANG_150_02_MS_60_FAIS;
-			    interleave = MB_YES;
-			    }
-			else if (ping->bath_mode == 4)
-			    {
-			    angles_simrad = angles_EM1000_CHANNEL_02_MS_60_FAIS;
-			    interleave = MB_YES;
-			    }
-			else if (ping->bath_mode == 5)
-			    {
-			    angles_simrad = angles_EM1000_150_02_MS_60_FAIS;
-			    interleave = MB_YES;
-			    }
-			else if (ping->bath_mode == 6)
-			    {
-			    angles_simrad = angles_EM1000_140_02_MS_60_FAIS;
-			    interleave = MB_YES;
-			    }
-			else if (ping->bath_mode == 7)
-			    {
-			    angles_simrad = angles_EM1000_128_02_MS_60_FAIS;
-			    interleave = MB_YES;
-			    }
-			else if (ping->bath_mode == 8)
-			    {
-			    angles_simrad = angles_EM1000_120_07_MS_48_FAIS;
-			    interleave = MB_YES;
-			    }
-			else if (ping->bath_mode == 9)
-			    {
-			    angles_simrad = angles_EM1000_104_07_MS_48_FAIS;
-			    interleave = MB_YES;
-			    }
-			else if (ping->bath_mode == 10)
-			    {
-			    angles_simrad = angles_EM1000_88_07_MS_48_FAIS;
-			    interleave = MB_YES;
-			    }
-			else if (ping->bath_mode == 11)
-			    {
-			    angles_simrad = angles_EM1000_70_2_MS_48_FAIS;
-			    interleave = MB_NO;
-			    }
-			else if (ping->bath_mode == 12)
-			    {
-			    angles_simrad = angles_EM1000_BERGE_02_MS_60_FAIS;
-			    interleave = MB_YES;
-			    }
-			else if (ping->bath_mode == 13)
-			    {
-			    angles_simrad = angles_EM1000_BERGE_02_MS_60_FAIS;
-			    interleave = MB_YES;
-			    }
-			}
-		else if (store->sonar == MBSYS_SIMRAD_EM12S)
-			{
-			if (ping->bath_mode == 1)
-			    angles_simrad = angles_EM12S_ISO_ANG_SHALLOW;
-			else if (ping->bath_mode == 2)
-			    angles_simrad = angles_EM12S_ISO_ANG_DEEP;
-			else if (ping->bath_mode == 3)
-			    angles_simrad = angles_EM12S_SHALLOW;
-			else if (ping->bath_mode == 4)
-			    angles_simrad = angles_EM12S_120;
-			else if (ping->bath_mode == 5)
-			    angles_simrad = angles_EM12S_105;
-			else if (ping->bath_mode == 6)
-			    angles_simrad = angles_EM12S_90;
-			}
-		else if (store->sonar == MBSYS_SIMRAD_EM12D
-			&& ping->swath_id == EM_SWATH_PORT)
-			{
-			if (ping->bath_mode == 1)
-			    angles_simrad = angles_EM12DP_ISO_ANG_SHALLOW;
-			else if (ping->bath_mode == 2)
-			    angles_simrad = angles_EM12DP_ISO_ANG_DEEP;
-			else if (ping->bath_mode == 3)
-			    angles_simrad = angles_EM12DP_SHALLOW;
-			else if (ping->bath_mode == 4)
-			    angles_simrad = angles_EM12DP_150;
-			else if (ping->bath_mode == 5)
-			    angles_simrad = angles_EM12DP_140;
-			else if (ping->bath_mode == 6)
-			    angles_simrad = angles_EM12DP_128;
-			else if (ping->bath_mode == 7)
-			    angles_simrad = angles_EM12DP_114;
-			else if (ping->bath_mode == 8)
-			    angles_simrad = angles_EM12DP_98;
-			}
-		else if (store->sonar == MBSYS_SIMRAD_EM12D
-			&& ping->swath_id == EM_SWATH_STARBOARD)
-			{
-			if (ping->bath_mode == 1)
-			    angles_simrad = angles_EM12DS_ISO_ANG_SHALLOW;
-			else if (ping->bath_mode == 2)
-			    angles_simrad = angles_EM12DS_ISO_ANG_DEEP;
-			else if (ping->bath_mode == 3)
-			    angles_simrad = angles_EM12DS_SHALLOW;
-			else if (ping->bath_mode == 4)
-			    angles_simrad = angles_EM12DS_150;
-			else if (ping->bath_mode == 5)
-			    angles_simrad = angles_EM12DS_140;
-			else if (ping->bath_mode == 6)
-			    angles_simrad = angles_EM12DS_128;
-			else if (ping->bath_mode == 7)
-			    angles_simrad = angles_EM12DS_114;
-			else if (ping->bath_mode == 8)
-			    angles_simrad = angles_EM12DS_98;
-			}
-		else if (store->sonar == MBSYS_SIMRAD_EM121)
-			{
-			angles_simrad = angles_EM121_GUESS;
-			}
-
-		/* if interleaved get center beam */
-		if (interleave == MB_YES)
-			{
-			if (ping->bath_mode == 12
-			    && fabs(ping->bath_acrosstrack[28])
-				< fabs(ping->bath_acrosstrack[29]))
-			    istep = 1;
-			else if (ping->bath_mode == 13
-			    && fabs(ping->bath_acrosstrack[31])
-				< fabs(ping->bath_acrosstrack[30]))
-			    istep = 1;
-			else if (fabs(ping->bath_acrosstrack[ping->beams_bath/2-1])
-			    < fabs(ping->bath_acrosstrack[ping->beams_bath/2]))
-			    istep = 1;
-			else
-			    istep = 0;
-			}
-
-		/* get raw pixel size */
-		if (store->sonar == MBSYS_SIMRAD_EM12D
-		    || store->sonar == MBSYS_SIMRAD_EM12S
-		    || store->sonar == MBSYS_SIMRAD_EM121)
-		    {
-		    if (ping->ss_mode == 1)
-			ss_spacing = 0.6;
-		    else if (ping->ss_mode == 2)
-			ss_spacing = 2.4;
-		    else if (ping->bath_mode == 1
-				|| ping->bath_mode == 3)
-			ss_spacing = 0.6;
-		    else
-			ss_spacing = 2.4;
-		    }
-		else if (store->sonar == MBSYS_SIMRAD_EM1000)
-		    {
-		    if (ping->ss_mode == 3)
-			ss_spacing = 0.3;
-		    else if (ping->ss_mode == 4)
-			ss_spacing = 0.3;
-		    else if (ping->ss_mode == 5)
-			ss_spacing = 0.15;
-		    else
-			ss_spacing = 0.15;
-		    }
-
-		/* get beam angle size */
-		if (store->sonar == MBSYS_SIMRAD_EM12D
-		    || store->sonar == MBSYS_SIMRAD_EM12S)
-		    {
-		    beamwidth = 2.00;
-		    }
-		else if (store->sonar == MBSYS_SIMRAD_EM121)
-		    {
-		    beamwidth = ping->beam_width;
-		    }
-		else if (store->sonar == MBSYS_SIMRAD_EM1000)
-		    {
-		    beamwidth = 2.5;
-		    }
-
-		/* get median depth */
-		nbathsort = 0;
-		for (i=0;i<ping->beams_bath;i++)
-		    {
-		    if (ping->bath[i] > 0.0)
-			{
-			bathsort[nbathsort] = depthscale
-				* ping->bath[i];
-			nbathsort++;
-			}
-		    }
-
-		/* get sidescan pixel size */
-		if (swath_width_set == MB_NO
-		    && nbathsort > 0)
-		    {
-		    (*swath_width) = 2.5 + angles_simrad[0];
-		    (*swath_width) = MAX((*swath_width), 60.0);
-		    }
-		if (pixel_size_set == MB_NO
-		    && nbathsort > 0)
-		    {
-		    qsort((char *)bathsort, nbathsort, sizeof(double),(void *)mb_double_compare);
-		    pixel_size_calc = 2 * tan(DTR * (*swath_width)) * bathsort[nbathsort/2]
-					/ MBSYS_SIMRAD_MAXPIXELS;
-		    pixel_size_calc = MAX(pixel_size_calc, bathsort[nbathsort/2] * sin(DTR * 0.1));
-		    if ((*pixel_size) <= 0.0)
-			(*pixel_size) = pixel_size_calc;
-		    else if (0.95 * (*pixel_size) > pixel_size_calc)
-			(*pixel_size) = 0.95 * (*pixel_size);
-		    else if (1.05 * (*pixel_size) < pixel_size_calc)
-			(*pixel_size) = 1.05 * (*pixel_size);
-		    else
-			(*pixel_size) = pixel_size_calc;
-		    }
-
-		/* get pixel interpolation */
-		pixel_int_use = pixel_int + 1;
-
-		/* print debug statements */
-		if (verbose >= 2)
-			{
-			fprintf(stderr,"\ndbg2  Sidescan regenerated in <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg2       depthscale:    %f\n",depthscale);
-			fprintf(stderr,"dbg2       dacrscale:     %f\n",dacrscale);
-			fprintf(stderr,"dbg2       daloscale:     %f\n",daloscale);
-			fprintf(stderr,"dbg2       reflscale:     %f\n",reflscale);
-			fprintf(stderr,"dbg2       depthscale:    %f\n",depthscale);
-			fprintf(stderr,"dbg2       depthoffset:   %f\n",depthoffset);
-			fprintf(stderr,"dbg2       depthscale:    %f\n",depthscale);
-			fprintf(stderr,"dbg2       ss_spacing:    %f\n",ss_spacing);
-			fprintf(stderr,"dbg2       pixel_size:    %f\n",*pixel_size);
-			fprintf(stderr,"dbg2       swath_width:   %f\n",*swath_width);
-			for (i=0;i<ping->beams_bath;i++)
-			  fprintf(stderr,"dbg2       beam:%d  bath: %d %d %d freq:%d nsamp:%d center:%d start:%d\n",
-				i,
-				ping->bath[i],ping->bath_acrosstrack[i],ping->bath_alongtrack[i],
-				ping->beam_frequency[i],ping->beam_samples[i],
-				ping->beam_center_sample[i],ping->beam_start_sample[i]);
-			}
-
-		/* loop over raw sidescan, putting each raw pixel into
-			the binning arrays */
-		for (i=0;i<ping->beams_bath;i++)
-			{
-			beam_ss = &ping->ssraw[ping->beam_start_sample[i]];
-			if (ping->bath[i] > 0.0)
-			    {
-			    if (ping->beam_samples[i] > 0)
-				{
-				depth = depthscale * ping->bath[i];
-				xtrack = dacrscale * ping->bath_acrosstrack[i];
-				ltrack = daloscale * ping->bath_alongtrack[i];
-				range = sqrt(depth * depth + xtrack * xtrack);
-				if (store->sonar == MBSYS_SIMRAD_EM1000
-				    && ping->bath_mode == 13)
-				    {
-				    angle = angles_simrad[ping->beams_bath-1-(2*i+istep)];
-				    }
-				else if (store->sonar == MBSYS_SIMRAD_EM1000
-				    && interleave == MB_YES)
-				    {
-				    angle = -angles_simrad[2*i+istep];
-				    }
-				else if (store->sonar == MBSYS_SIMRAD_EM1000)
-				    {
-				    angle = -angles_simrad[i];
-				    }
-				else
-				    {
-				    angle = -angles_simrad[i];
-				    }
-				beam_foot = range * sin(DTR * beamwidth)
-							/ cos(DTR * angle);
-				sint = fabs(sin(DTR * angle));
-				if (sint < ping->beam_samples[i] * ss_spacing / beam_foot)
-				    ss_spacing_use = beam_foot / ping->beam_samples[i];
-				else
-				    ss_spacing_use = ss_spacing / sint;
-/*fprintf(stderr, "spacing: %f %f n:%d sint:%f angle:%f range:%f foot:%f factor:%f\n",
-ss_spacing, ss_spacing_use,
-ping->beam_samples[i], sint, angle, range, beam_foot,
-ping->beam_samples[i] * ss_spacing / beam_foot);*/
-				}
-			    for (k=0;k<ping->beam_samples[i];k++)
-				{
-				xtrackss = xtrack
-				    + ss_spacing_use * (k - ping->beam_center_sample[i]);
-				kk = MBSYS_SIMRAD_MAXPIXELS / 2
-				    + (int)(xtrackss / (*pixel_size));
-				if (kk > 0 && kk < MBSYS_SIMRAD_MAXPIXELS)
-				    {
-				    ss[kk]  += reflscale*((double)beam_ss[k]);
-				    ssalongtrack[kk]
-					    += ltrack;
-				    ss_cnt[kk]++;
-				    }
-				}
-			    }
-			}
-
-		/* average the sidescan */
-		first = MBSYS_SIMRAD_MAXPIXELS;
-		last = -1;
-		for (k=0;k<MBSYS_SIMRAD_MAXPIXELS;k++)
-			{
-			if (ss_cnt[k] > 0)
-				{
-				ss[k] /= ss_cnt[k];
-				ssalongtrack[k] /= ss_cnt[k];
-				ssacrosstrack[k]
-					= (k - MBSYS_SIMRAD_MAXPIXELS / 2)
-						* (*pixel_size);
-				first = MIN(first, k);
-				last = k;
-				}
-			else
-				ss[k] = MB_SIDESCAN_NULL;
-			}
-
-		/* interpolate the sidescan */
-		k1 = first;
-		k2 = first;
-		for (k=first+1;k<last;k++)
-		    {
-		    if (ss_cnt[k] <= 0)
-			{
-			if (k2 <= k)
-			    {
-			    k2 = k+1;
-			    while (ss_cnt[k2] <= 0 && k2 < last)
-				k2++;
-			    }
-			if (k2 - k1 <= pixel_int_use)
-			    {
-			    ss[k] = ss[k1]
-				+ (ss[k2] - ss[k1])
-				    * ((double)(k - k1)) / ((double)(k2 - k1));
-			    ssacrosstrack[k]
-				    = (k - MBSYS_SIMRAD_MAXPIXELS / 2)
-					    * (*pixel_size);
-			    ssalongtrack[k] = ssalongtrack[k1]
-				+ (ssalongtrack[k2] - ssalongtrack[k1])
-				    * ((double)(k - k1)) / ((double)(k2 - k1));
-			    }
-			}
-		    else
-			{
-			k1 = k;
-			}
-		    }
-
-		/* insert the new sidescan into store */
-		ping->pixel_size = (int) (100 * (*pixel_size));
-		if (last > first)
-		    ping->pixels_ss = MBSYS_SIMRAD_MAXPIXELS;
-		else
-		    ping->pixels_ss = 0;
-		for (i=0;i<MBSYS_SIMRAD_MAXPIXELS;i++)
-		    {
-		    if (ss[i] > MB_SIDESCAN_NULL)
-		    	{
-		    	ping->ss[i] = (short)(100 * ss[i]);
-		    	ping->ssalongtrack[i]
-			    	= (short)(ssalongtrack[i] / daloscale);
-			}
-		    else
-		    	{
-		    	ping->ss[i] = 0;
-		    	ping->ssalongtrack[i] = 0;
-			}
-		    }
-
-		/* print debug statements */
-		if (verbose >= 2)
-			{
-			fprintf(stderr,"\ndbg2  Sidescan regenerated in <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg2       beams_bath:    %d\n",
-				ping->beams_bath);
-			for (i=0;i<ping->beams_bath;i++)
-			  fprintf(stderr,"dbg2       beam:%d  bath:%d  amp:%d  acrosstrack:%d  alongtrack:%d\n",
-				i,
-				ping->bath[i],
-				ping->amp[i],
-				ping->bath_acrosstrack[i],
-				ping->bath_alongtrack[i]);
-			fprintf(stderr,"dbg2       pixels_ss:  %d\n",
-				MBSYS_SIMRAD_MAXPIXELS);
-			for (i=0;i<MBSYS_SIMRAD_MAXPIXELS;i++)
-			  fprintf(stderr,"dbg2       pixel:%4d  cnt:%3d  ss:%10f  xtrack:%10f  ltrack:%10f\n",
-				i,ss_cnt[i],ss[i],
-				ssacrosstrack[i],
-				ssalongtrack[i]);
-			fprintf(stderr,"dbg2       pixels_ss:  %d\n",
-				ping->pixels_ss);
-			for (i=0;i<ping->pixels_ss;i++)
-			  fprintf(stderr,"dbg2       pixel:%4d  ss:%8d  ltrack:%8d\n",
-				i,ping->ss[i],ping->ssalongtrack[i]);
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       pixel_size:      %f\n",*pixel_size);
-		fprintf(stderr,"dbg2       swath_width:     %f\n",*swath_width);
-		fprintf(stderr,"dbg2       error:           %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:          %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mbsys_simrad.h b/src/mbio/mbsys_simrad.h
deleted file mode 100644
index b822741..0000000
--- a/src/mbio/mbsys_simrad.h
+++ /dev/null
@@ -1,1483 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbsys_simrad.h	8/5/94
- *	$Id: mbsys_simrad.h 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1994-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbsys_simrad.h defines the MBIO data structures for handling data from
- * old (pre-1997) Simrad multibeam sonars (e.g. EM950, EM1000, EM12S,
- * EM12D). The data formats associated with Simrad multibeams
- * (both old and new) include:
- *    MBSYS_SIMRAD formats (code in mbsys_simrad.c and mbsys_simrad.h):
- *      MBF_EMOLDRAW : MBIO ID 51 - Vendor EM1000, EM12S, EM12D, EM121
- *                   : MBIO ID 52 - aliased to 51
- *      MBF_EM12IFRM : MBIO ID 53 - IFREMER EM12S and EM12D
- *      MBF_EM12DARW : MBIO ID 54 - NERC EM12S
- *                   : MBIO ID 55 - aliased to 51
- *    MBSYS_SIMRAD2 formats (code in mbsys_simrad2.c and mbsys_simrad2.h):
- *      MBF_EM300RAW : MBIO ID 56 - Vendor EM3000, EM300, EM120
- *      MBF_EM300MBA : MBIO ID 57 - MBARI EM3000, EM300, EM120
- *
- *
- * Author:	D. W. Caress (L-DEO)
- * Date:	August 5, 1994
- *
- * $Log: mbsys_simrad.h,v $
- * Revision 5.12  2009/03/02 18:51:52  caress
- * Fixed problems with formats 58 and 59, and also updated copyright dates in several source files.
- *
- * Revision 5.11  2008/03/01 09:14:03  caress
- * Some housekeeping changes.
- *
- * Revision 5.10  2007/06/18 01:19:48  caress
- * Changes as of 17 June 2007.
- *
- * Revision 5.9  2005/11/05 00:48:03  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.8  2003/12/04 23:10:24  caress
- * Fixed problems with format 54 EM12DARW due to old code assuming how internal structure was packed. Also changed handling of beamflags for formats that don't support beamflags. Now flagged beams will always be nulled in such cases.
- *
- * Revision 5.7  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.6  2002/08/21 00:55:46  caress
- * Release 5.0.beta22
- *
- * Revision 5.5  2002/07/20 20:42:40  caress
- * Release 5.0.beta20
- *
- * Revision 5.4  2002/05/29 23:41:49  caress
- * Release 5.0.beta18
- *
- * Revision 5.3  2001/07/20 00:32:54  caress
- * Release 5.0.beta03
- *
- * Revision 5.2  2001/03/22  20:50:02  caress
- * Trying to make version 5.0.beta0
- *
- * Revision 5.1  2001/01/22  07:43:34  caress
- * Version 5.0.beta01
- *
- * Revision 5.0  2000/12/01  22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.11  2000/10/11  01:03:21  caress
- * Convert to ANSI C
- *
- * Revision 4.10  2000/09/30  06:31:19  caress
- * Snapshot for Dale.
- *
- * Revision 4.9  1998/12/17  23:01:15  caress
- * MB-System version 4.6beta4
- *
- * Revision 4.8  1998/10/05  18:32:27  caress
- * MB-System version 4.6beta
- *
- * Revision 4.7  1997/09/15  19:06:40  caress
- * Real Version 4.5
- *
- * Revision 4.7  1997/09/15  19:06:40  caress
- * Real Version 4.5
- *
- * Revision 4.6  1997/07/25  14:19:53  caress
- * Version 4.5beta2.
- * Much mucking, particularly with Simrad formats.
- *
- * Revision 4.5  1997/04/21  17:02:07  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.5  1997/04/17  15:07:36  caress
- * MB-System 4.5 Beta Release
- *
- * Revision 4.4  1996/08/26  19:03:38  caress
- * REALLY changed "signed char" to "char".
- *
- * Revision 4.3  1996/08/26  18:33:50  caress
- * Changed "signed char" to "char" for SunOs 4.1 compiler compatibility.
- *
- * Revision 4.2  1996/08/05  15:25:43  caress
- * Just redid i/o for Simrad sonars, including adding EM12S and EM121 support.
- *
- * Revision 4.1  1996/07/26  21:06:00  caress
- * Version after first cut of handling em12s and em121 data.
- *
- * Revision 4.0  1994/10/21  12:35:09  caress
- * Release V4.0
- *
- * Revision 1.1  1994/10/21  12:20:01  caress
- * Initial revision
- *
- *
- *
- */
-/*
- * Notes on the MBSYS_SIMRAD data structure:
- *   1. Simrad multibeam systems output datagrams which are
- *      a combination of ascii and binary.
- *   2. Simrad multibeam sonars output both bathymetry
- *      and amplitude information for beams and sidescan information
- *      with a higher resolution than the bathymetry and amplitude.
- *   3. There are five systems of interest:
- *         EM-1000:  Shallow water system with up to 60 beams of
- *                   bathymetry and up to 523 sidescan samples per
- *                   bathymetry beam.
- *         EM-12S:   Single array deep water system with up to 81
- *                   beams of bathymetry and up to 523 sidescan
- *                   samples per bathymetry beam.
- *         EM-12D:   Double array deep water system with up to
- *                   81 beams of bathymetry (port and starboard
- *                   calculated and recorded separately) and up
- *                   to 523 sidescan samples per bathymetry beam.
- *         EM-121:   Single array deep water system with up to 121
- *                   beams of bathymetry and up to 523 sidescan
- *                   samples per bathymetry beam.
- *   4. Each telegram is preceded by a two byte start code and
- *      followed by a three byte end code consisting of 0x03
- *      followed by two bytes representing the checksum for
- *      the data bytes.  MB-System does not calculate checksums
- *      and puts 0's in the checksum bytes.
- *   5. The relevent telegram start codes, types, and sizes are:
- *         0x0285: Start                                  421 data bytes
- *         0x0286: Stop                                   421 data bytes
- *         0x0287: Parameter                              421 data bytes
- *         0x0293: Position                                90 data bytes
- *         0x029A: Sound velocity profile                 416 data bytes
- *         0x0294: EM-12D starboard bathymetry            923 data bytes
- *         0x0295: EM-12D port bathymetry                 923 data bytes
- *         0x0296: EM-12S bathymetry                      923 data bytes
- *         0x0288: EM-121 bathymetry                      1375 data bytes
- *         0x0297: EM-1000 bathymetry                     692 data bytes
- *         0x02C8: EM-12D port sidescan                   551 data bytes
- *         0x02C9: EM-12D starboard sidescan              551 data bytes
- *         0x02CA: EM-12S or EM-1000 sidescan             551 data bytes
- *         0x02CB: EM-12D port sidescan + phase          1465 data bytes
- *         0x02CC: EM-12D starboard sidescan + phase     1465 data bytes
- *         0x02CD: EM-12S or EM-1000 sidescan + phase    1465 data bytes
- *   6. The EM-12D system records separate starboard and port datagrams
- *      for each ping.
- *   7. Multiple sidescan datagrams are recorded for each ping because
- *      there is too much information to fit in a single datagram.
- *   8. Simrad systems record navigation fixes using the position
- *      datagram; no navigation is included in the per ping data.  Thus,
- *      it is necessary to extrapolate the navigation for each ping
- *      at read time from the last navigation fix.  The frequency of
- *      GPS fixes generally assures that this is not a problem, but
- *      we offer no guarentees that this will always be the case.
- *
- */
-
-/* sonar types */
-#define	MBSYS_SIMRAD_UNKNOWN	0
-#define	MBSYS_SIMRAD_EM12S	1
-#define	MBSYS_SIMRAD_EM12D	2
-#define	MBSYS_SIMRAD_EM100	3
-#define	MBSYS_SIMRAD_EM1000	4
-#define	MBSYS_SIMRAD_EM121	5
-
-/* maximum number of beams and pixels */
-#define	MBSYS_SIMRAD_MAXBEAMS	121
-#define	MBSYS_EM1000_MAXBEAMS	60
-#define	MBSYS_EM12_MAXBEAMS	81
-#define	MBSYS_EM121_MAXBEAMS	121
-#define	MBSYS_SIMRAD_MAXPIXELS		1024
-#define	MBSYS_SIMRAD_MAXRAWPIXELS	32000
-#define	MBSYS_SIMRAD_MAXSVP	100
-#define	MBSYS_SIMRAD_COMMENT_LENGTH	80
-
-/* datagram types */
-#define	EM_NONE			0
-#define	EM_START		0x0285
-#define	EM_STOP			0x0286
-#define	EM_PARAMETER		0x0287
-#define	EM_POS			0x0293
-#define	EM_SVP			0x029A
-#define	EM_12DS_BATH		0x0294
-#define	EM_12DP_BATH		0x0295
-#define	EM_12S_BATH		0x0296
-#define	EM_121_BATH		0x0288
-#define	EM_1000_BATH		0x0297
-#define	EM_12DP_SS		0x02C8
-#define	EM_12DS_SS		0x02C9
-#define	EM_12S_SS		0x02CA
-#define	EM_12DP_SSP		0x02CB
-#define	EM_12DS_SSP		0x02CC
-#define	EM_12S_SSP		0x02CD
-
-/* datagram sizes */
-#define	EM_START_SIZE		424
-#define	EM_STOP_SIZE		424
-#define	EM_PARAMETER_SIZE	424
-#define	EM_POS_SIZE		93
-#define	EM_SVP_SIZE		419
-#define	EM_12DS_BATH_SIZE	926
-#define	EM_12DP_BATH_SIZE	926
-#define	EM_12S_BATH_SIZE	926
-#define	EM_121_BATH_SIZE	1378
-#define	EM_1000_BATH_SIZE	695
-#define	EM_SS_SIZE		554
-#define	EM_SSP_SIZE		1468
-#define	EM_12DP_SS_SIZE		554
-#define	EM_12DS_SS_SIZE		554
-#define	EM_12S_SS_SIZE		554
-#define	EM_12DP_SSP_SIZE	1468
-#define	EM_12DS_SSP_SIZE	1468
-#define	EM_12S_SSP_SIZE		1468
-
-/* swath id */
-#define	EM_SWATH_CENTER		0
-#define	EM_SWATH_PORT		-1
-#define	EM_SWATH_STARBOARD	1
-
-/* sidescan status */
-#define	EM_SS_NONE		0
-#define	EM_SS_AMPONLY		1
-#define	EM_SS_AMPPHASE		2
-
-/* The following angle tables were provided by
-    Dr. John Hughes Clarke of the University of
-    New Brunswick. Dr. Clarke obtained these tables
-    from IFREMER, which had obtained them from Simrad */
-#ifndef MBSYS_SIMRAD_C
-extern double angles_EM1000_104_07_MS_48_FAIS[96];
-extern double angles_EM1000_120_07_MS_48_FAIS[96];
-extern double angles_EM1000_128_02_MS_60_FAIS[120];
-extern double angles_EM1000_140_02_MS_60_FAIS[120];
-extern double angles_EM1000_150_02_MS_60_FAIS[120];
-extern double angles_EM1000_70_2_MS_48_FAIS[48];
-extern double angles_EM1000_88_07_MS_48_FAIS[96];
-extern double angles_EM1000_PORT_02_MS_60_FAIS[120];
-extern double angles_EM1000_BERGE_02_MS_60_FAIS[120];
-extern double angles_EM1000_CHANNEL_02_MS_60_FAIS[120];
-extern double angles_EM1000_ISO_ANG_120_07_MS_48_FAIS[96];
-extern double angles_EM1000_ISO_ANG_150_02_MS_60_FAIS[120];
-extern double angles_EM1000_ISO_ANG_60_2_MS_48_FAIS[48];
-extern double angles_EM1000_SHALLOW[60];
-extern double angles_EM12DP_114[81];
-extern double angles_EM12DS_114[81];
-extern double angles_EM12DP_128[81];
-extern double angles_EM12DS_128[81];
-extern double angles_EM12DP_140[81];
-extern double angles_EM12DS_140[81];
-extern double angles_EM12DP_150[81];
-extern double angles_EM12DS_150[81];
-extern double angles_EM12DP_98[81];
-extern double angles_EM12DS_98[81];
-extern double angles_EM12DP_ISO_ANG_DEEP[81];
-extern double angles_EM12DS_ISO_ANG_DEEP[81];
-extern double angles_EM12DP_ISO_ANG_SHALLOW[81];
-extern double angles_EM12DS_ISO_ANG_SHALLOW[81];
-extern double angles_EM12DP_SHALLOW[81];
-extern double angles_EM12DS_SHALLOW[81];
-extern double angles_EM12S_105[81];
-extern double angles_EM12S_120[81];
-extern double angles_EM12S_90[81];
-extern double angles_EM12S_ISO_ANG_DEEP[81];
-extern double angles_EM12S_ISO_ANG_SHALLOW[81];
-extern double angles_EM12S_SHALLOW[81];
-
-#else
-
-double angles_EM1000_104_07_MS_48_FAIS[96] = {
-		52.0000, 51.4375, 50.8125, 50.1875,
-		49.5625, 48.8750, 48.1875, 47.5000,
-		46.8125, 46.0625, 45.3125, 44.5000,
-		43.7500, 42.9375, 42.0625, 41.1875,
-		40.3125, 39.4375, 38.5000, 37.5000,
-		36.5625, 35.5000, 34.5000, 33.4375,
-		32.3125, 31.2500, 30.0625, 28.9375,
-		27.7500, 26.5000, 25.2500, 24.0000,
-		22.6875, 21.3125, 20.0000, 18.6250,
-		17.1875, 15.8125, 14.3750, 12.8750,
-		11.4375, 09.9375, 08.4375, 06.9375,
-		05.3750, 03.8750, 02.3125, 00.7500,
-		-0.7500, -2.3125, -3.8750, -5.3750,
-		-6.9375, -8.4375, -9.9375, -11.4375,
-		-12.8750, -14.3750, -15.8125, -17.1875,
-		-18.6250, -20.0000, -21.3125, -22.6875,
-		-24.0000, -25.2500, -26.5000, -27.7500,
-		-28.9375, -30.0625, -31.2500, -32.3125,
-		-33.4375, -34.5000, -35.5000, -36.5625,
-		-37.5000, -38.5000, -39.4375, -40.3125,
-		-41.1875, -42.0625, -42.9375, -43.7500,
-		-44.5000, -45.3125, -46.0625, -46.8125,
-		-47.5000, -48.1875, -48.8750, -49.5625,
-		-50.1875, -50.8125, -51.4375, -52.0000
-};
-double angles_EM1000_120_07_MS_48_FAIS[96] = {
-		60.0000, 59.5000, 58.9375, 58.3750,
-		57.7500, 57.1875, 56.5625, 55.8750,
-		55.2500, 54.5625, 53.8125, 53.0625,
-		52.3125, 51.5000, 50.6875, 49.8125,
-		48.9375, 48.0625, 47.0625, 46.1250,
-		45.0625, 44.0000, 42.9375, 41.7500,
-		40.5625, 39.3750, 38.1250, 36.7500,
-		35.4375, 34.0000, 32.5625, 31.0625,
-		29.5000, 27.8750, 26.1875, 24.5000,
-		22.7500, 20.9375, 19.1250, 17.2500,
-		15.3125, 13.3125, 11.3125, 09.3125,
-		07.2500, 05.1875, 03.1250, 01.0625,
-		-01.0625, -03.1250, -05.1875, -07.2500,
-		-09.3125, -11.3125, -13.3125, -15.3125,
-		-17.2500, -19.1250, -20.9375, -22.7500,
-		-24.5000, -26.1875, -27.8750, -29.5000,
-		-31.0625, -32.5625, -34.0000, -35.4375,
-		-36.7500, -38.1250, -39.3750, -40.5625,
-		-41.7500, -42.9375, -44.0000, -45.0625,
-		-46.1250, -47.0625, -48.0625, -48.9375,
-		-49.8125, -50.6875, -51.5000, -52.3125,
-		-53.0625, -53.8125, -54.5625, -55.2500,
-		-55.8750, -56.5625, -57.1875, -57.7500,
-		-58.3750, -58.9375, -59.5000, -60.0000
-};
-double angles_EM1000_128_02_MS_60_FAIS[120] = {
-	64.0000, 63.6250, 63.2500, 62.8125,
-	62.3750, 61.9375, 61.5000, 61.0625,
-	60.6250, 60.1250, 59.6250, 59.1250,
-	58.5625, 58.0625, 57.5000, 56.8750,
-	56.3125, 55.6875, 55.0625, 54.3750,
-	53.6875, 53.000, 52.2500, 51.5000,
-	50.7500, 49.9375, 49.1250, 48.2500,
-	47.3750, 46.4375, 45.5000, 44.5000,
-	43.4375, 42.3750, 41.3125, 40.1875,
-	39.0000, 37.8125, 36.5625, 35.2500,
-	33.8750, 32.5000, 31.0625, 29.6250,
-	28.1250, 26.5625, 24.9375, 23.3125,
-	21.6250, 19.8750, 18.1250, 16.3125,
-	14.5000, 12.6250, 10.7500, 08.8125,
-	06.8750, 04.9375, 02.9375, 01.0000,
-	-1.0000, -2.9375, -4.9375, -6.8750,
-	-8.8125, -10.7500, -12.6250, -14.5000,
-	-16.3125, -18.1250, -19.8750, -21.6250,
-	-23.3125, -24.9375, -26.5625, -28.1250,
-	-29.6250, -31.0625, -32.5000, -33.8750,
-	-35.2500, -36.5625, -37.8125, -39.0000,
-	-40.1875, -41.3125, -42.3750, -43.4375,
-	-44.5000, -45.5000, -46.4375, -47.3750,
-	-48.2500, -49.1250, -49.9375, -50.7500,
-	-51.5000, -52.2500, -53.0000, -53.6875,
-	-54.3750, -55.0625, -55.6875, -56.3125,
-	-56.8750, -57.5000, -58.0625, -58.5625,
-	-59.1250, -59.6250, -60.1250, -60.6250,
-	-61.0625, -61.5000, -61.9375, -62.3750,
-	-62.8125, -63.2500, -63.6250, -64.0000
-};
-double angles_EM1000_140_02_MS_60_FAIS[120] = {
-		70.0000, 69.6875, 69.3750, 69.0000,
-		68.6875, 68.3125, 67.9375, 67.5625,
-		67.1875, 66.8125, 66.3750, 65.9375,
-		65.5000, 65.0000, 64.5625, 64.0625,
-		63.5625, 63.0000, 62.4375, 61.8750,
-		61.2500, 60.6250, 60.0000, 59.3125,
-		58.6250, 57.8750, 57.1250, 56.3125,
-		55.5000, 54.6250, 53.6875, 52.7500,
-		51.7500, 50.7500, 49.6875, 48.5000,
-		47.3125, 46.1250, 44.8125, 43.4375,
-		42.0000, 40.5000, 38.9375, 37.3125,
-		35.5625, 33.8125, 31.9345, 30.0000,
-		28.0000, 25.8750, 23.6875, 21.4375,
-		19.1250, 16.6875, 14.2500, 11.7500,
-		09.1875, 06.5625, 03.9375, 01.3125,
-		-1.3125, -3.9375, -6.5625, -9.1875,
-		-11.7500, -14.2500, -16.6875, -19.1250,
-		-21.4375, -23.6875, -25.8750, -28.0000,
-		-30.0000, -31.9345, -33.8125, -35.5625,
-		-37.3125, -38.9375, -40.5000, -42.0000,
-		-43.4375, -44.8125, -46.1250, -47.3125,
-		-48.5000, -49.6875, -50.7500, -51.7500,
-		-52.7500, -53.6875, -54.6250, -55.5000,
-		-56.3125, -57.1250, -57.8750, -58.6250,
-		-59.3125, -60.0000, -60.6250, -61.2500,
-		-61.8750, -62.4375, -63.0000, -63.5625,
-		-64.0625, -64.5625, -65.0000, -65.5000,
-		-65.9375, -66.3750, -66.8125, -67.1875,
-		-67.5625, -67.9375, -68.3125, -68.6875,
-		-69.0000, -69.3750, -69.6875, -70.0000
-};
-double angles_EM1000_150_02_MS_60_FAIS[120] = {
-		75.0000, 74.7500, 74.5000, 74.2500,
-		74.0000, 73.6875, 73.3750, 73.1250,
-		72.8125, 72.5000, 72.1250, 71.8125,
-		71.4375, 71.0625, 70.6875, 70.3125,
-		69.8750, 69.4375, 69.0000, 68.5000,
-		68.0000, 67.5000, 66.9375, 66.3750,
-		65.8125, 65.1875, 64.5625, 63.8750,
-		63.1250, 62.3750, 61.6250, 60.7500,
-		59.8750, 58.9375, 58.0000, 56.9375,
-		55.8750, 54.6875, 53.4375, 52.1250,
-		50.7500, 49.2500, 47.6875, 46.0000,
-		44.1875, 42.3125, 40.2500, 38.1250,
-		35.8125, 33.3750, 30.8125, 28.0625,
-		25.1875, 22.1875, 19.0625, 15.7500,
-		12.3750, 08.9375, 05.3750, 01.8125,
-		-1.8125, -5.3750, -8.9375, -12.3750,
-		-15.7500, -19.0625, -22.1875, -25.1875,
-		-28.0625, -30.8125, -33.3750, -35.8125,
-		-38.1250, -40.2500, -42.3125, -44.1875,
-		-46.0000, -47.6875, -49.2500, -50.7500,
-		-52.1250, -53.4375, -54.6875, -55.8750,
-		-56.9375, -58.0000, -58.9375, -59.8750,
-		-60.7500, -61.6250, -62.3750, -63.1250,
-		-63.8750, -64.5625, -65.1875, -65.8125,
-		-66.3750, -66.9375, -67.5000, -68.0000,
-		-68.5000, -69.0000, -69.4375, -69.8750,
-		-70.3125, -70.6875, -71.0625, -71.4375,
-		-71.8125, -72.1250, -72.5000, -72.8125,
-		-73.1250, -73.3750, -73.6875, -74.0000,
-		-74.2500, -74.5000, -74.7500, -75.000
-};
-double angles_EM1000_70_2_MS_48_FAIS[48] = {
-		35.000, 33.8125,
-		32.6250, 31.4375,
-		30.1875, 28.8750,
-		27.5625, 26.1875,
-		24.8125, 23.3750,
-		21.9375, 20.4375,
-		18.9375, 17.3750,
-		15.8125, 14.1875,
-		12.6250, 10.9375,
-		09.3125, 07.6250,
-		05.9375, 04.2500,
-		02.5625, 00.8750,
-		-0.8750, -2.5625,
-		-3.4375, -5.1250,
-		-6.8125, -8.5000,
-		-10.1250, -11.8125,
-		-13.4375, -15.0000,
-		-16.5625, -18.1250,
-		-19.6875, -21.1875,
-		-22.6250, -24.0625,
-		-25.5000, -26.8750,
-		-28.1875, -29.5000,
-		-30.8125, -32.0625,
-		-33.2500, -34.4375
-};
-double angles_EM1000_88_07_MS_48_FAIS[96] = {
-		44.0000, 43.3750, 42.7500, 42.1250,
-		41.5000, 40.8125, 40.1250, 39.4375,
-		38.7500, 38.0625, 37.3125, 36.5625,
-		35.8125, 35.0625, 34.2500, 33.4375,
-		32.6250, 31.8125, 30.9375, 30.0625,
-		29.1875, 28.3125, 27.3750, 26.5000,
-		25.5625, 24.5625, 23.6250, 22.6250,
-		21.6250, 20.6250, 19.5625, 18.5625,
-		17.5000, 16.4375, 15.3750, 14.2500,
-		13.1875, 12.0625, 10.9375, 09.8125,
-		08.6875, 07.5000, 06.3750, 05.2500,
-		04.0625, 02.9375, 01.7500, 00.5625,
-		-0.5625, -1.7500, -2.9375, -4.0625,
-		-5.2500, -6.3750, -7.5000, -8.6875,
-		-9.8125, -10.9375, -12.0625, -13.1875,
-		-14.2500, -15.3750, -16.4375, -17.5000,
-		-18.5625, -19.5625, -20.6250, -21.6250,
-		-22.6250, -23.6250, -24.5625, -25.5625,
-		-26.5000, -27.3750, -28.3125, -29.1875,
-		-30.0625, -30.9375, -31.8125, -32.6250,
-		-33.4375, -34.2500, -35.0625, -35.8125,
-		-36.5625, -37.3125, -38.0625, -38.7500,
-		-39.4375, -40.1250, -40.8125, -41.5000,
-		-42.1250, -42.7500, -43.3750, -44.0000
-};
-double angles_EM1000_PORT_02_MS_60_FAIS[120] = {
-		95.0000, 93.5000, 92.0000, 90.5000,
-		89.0000, 87.5000, 86.0000, 84.5000,
-		83.0000, 81.5000, 80.0000, 78.5000,
-		77.0000, 75.5000, 74.0000, 72.5000,
-		71.0000, 69.5000, 68.0000, 66.5000,
-		65.0000, 63.5000, 62.0000, 61.2500,
-		60.4375, 59.6250, 58.7500, 57.8750,
-		56.8750, 55.8750, 54.8125, 53.6875,
-		52.5000, 51.1875, 49.8750, 48.4375,
-		46.9375, 45.3750, 43.6875, 41.8750,
-		40.0000, 38.0000, 35.8750, 33.6250,
-		31.3125, 28.8125, 26.1875, 23.4375,
-		20.6250, 17.6875, 14.6250, 11.4375,
-		08.2500, 05.0000, 01.6875, -01.6250,
-		-04.9375, -08.2500, -11.4375, -14.5625,
-		-17.6250, -20.6250, -23.4375, -26.1875,
-		-28.8125, -31.2500, -33.6250, -35.8750,
-		-38.0000, -40.0000, -41.8750, -43.6875,
-		-45.3750, -46.9375, -48.4375, -49.8750,
-		-51.1875, -52.5000, -53.6875, -54.8125,
-		-55.8750, -56.8750, -57.8750, -58.7500,
-		-59.6250, -60.4325, -61.2500, -62.0000,
-		-62.6875, -63.3750, -64.0625, -64.6875,
-		-65.2500, -65.8125, -66.3750, -66.8750,
-		-67.3750, -67.8750, -68.3125, -68.7500,
-		-69.1875, -69.6250, -70.0000, -70.3750,
-		-70.7500, -71.1250, -71.4375, -71.7500,
-		-72.1250, -72.3750, -72.6875, -73.0000,
-		-73.2500, -73.5625, -73.8125, -74.0625,
-		-74.3125, -74.5625, -74.7500, -75.0000
-};
-double angles_EM1000_BERGE_02_MS_60_FAIS[120] = {
-		95.0000, 93.5000, 92.0000, 90.5000,
-		89.0000, 87.5000, 86.0000, 84.5000,
-		83.0000, 81.5000, 80.0000, 78.5000,
-		77.0000, 75.5000, 74.0000, 72.5000,
-		71.0000, 69.5000, 68.0000, 66.5000,
-		65.0000, 63.5000, 62.0000, 61.2500,
-		60.4375, 59.6250, 58.7500, 57.8750,
-		56.8750, 55.8750, 54.8125, 53.6875,
-		52.5000, 51.1875, 49.8750, 48.4375,
-		46.9375, 45.3750, 43.6875, 41.8750,
-		40.0000, 38.0000, 35.8750, 33.6250,
-		31.3125, 28.8125, 26.1875, 23.4375,
-		20.6250, 17.6875, 14.6250, 11.4375,
-		08.2500, 05.0000, 01.6875, -01.6250,
-		-04.9375, -08.2500, -11.4375, -14.5625,
-		-17.6250, -20.6250, -23.4375, -26.1875,
-		-28.8125, -31.2500, -33.6250, -35.8750,
-		-38.0000, -40.0000, -41.8750, -43.6875,
-		-45.3750, -46.9375, -48.4375, -49.8750,
-		-51.1875, -52.5000, -53.6875, -54.8125,
-		-55.8750, -56.8750, -57.8750, -58.7500,
-		-59.6250, -60.4325, -61.2500, -62.0000,
-		-62.6875, -63.3750, -64.0625, -64.6875,
-		-65.2500, -65.8125, -66.3750, -66.8750,
-		-67.3750, -67.8750, -68.3125, -68.7500,
-		-69.1875, -69.6250, -70.0000, -70.3750,
-		-70.7500, -71.1250, -71.4375, -71.7500,
-		-72.1250, -72.3750, -72.6875, -73.0000,
-		-73.2500, -73.5625, -73.8125, -74.0625,
-		-74.3125, -74.5625, -74.7500, -75.0000
-};
-
-double angles_EM1000_CHANNEL_02_MS_60_FAIS[120] = {
-		95.0000, 93.5000, 92.0000, 90.5000,
-		89.0000, 87.5000, 86.0000, 84.5000,
-		83.0000, 81.5000, 80.0000, 78.5000,
-		77.0000, 75.5000, 74.0000, 72.5000,
-		71.0000, 69.5000, 68.0000, 66.5000,
-		65.0000, 63.5000, 62.0000, 61.3750,
-		60.6875, 60.0000, 59.2500, 58.5000,
-		57.6875, 56.8125, 55.9375, 55.0000,
-		54.0625, 53.0625, 52.0000, 50.8750,
-		49.6875, 48.4375, 47.1875, 45.8125,
-		44.3750, 42.8750, 41.2500, 39.6250,
-		37.8750, 36.0000, 34.1250, 32.0625,
-		30.0000, 27.7500, 25.5000, 23.0625,
-		20.6250, 18.0625, 15.4375, 12.6875,
-		09.9375, 07.1250, 04.3125, 01.4375,
-		-1.4375, -4.3125, -7.1250, -9.9375,
-		-12.6875, -15.4375, -18.0625, -20.6250,
-		-23.0625, -25.5000, -27.7500, -30.0000,
-		-32.0625, -34.1250, -36.0000, -37.8750,
-		-39.6250, -41.2500, -42.8750, -44.3750,
-		-45.8125, -47.1875, -48.4375, -49.6875,
-		-50.8750, -52.0000, -53.0625, -54.0625,
-		-55.0000, -55.9375, -56.8125, -57.6875,
-		-58.5000, -59.2500, -60.0000, -60.6875,
-		-61.3750, -62.0000, -63.5000, -65.0000,
-		-66.5000, -68.0000, -69.5000, -71.0000,
-		-72.5000, -74.0000, -75.5000, -77.0000,
-		-78.5000, -80.0000, -81.5000, -83.0000,
-		-84.5000, -86.0000, -87.5000, -89.0000,
-		-90.5000, -92.0000, -93.5000, -95.0000
-};
-double angles_EM1000_ISO_ANG_120_07_MS_48_FAIS[96] = {
-		59.3750, 58.1250, 56.8750, 55.6250,
-		54.3750, 53.1250, 51.8750, 50.6250,
-		49.3750, 48.1250, 46.8750, 45.6250,
-		44.3750, 43.1250, 41.8750, 40.6250,
-		39.3750, 38.1250, 36.8750, 35.6250,
-		34.3750, 33.1250, 31.8750, 30.6250,
-		29.3750, 28.1250, 26.8750, 25.6250,
-		24.3750, 23.1250, 21.8750, 20.6250,
-		19.3750, 18.1250, 16.8750, 15.6250,
-		14.3750, 13.1250, 11.8750, 10.6250,
-		09.3750, 08.1250, 06.8750, 05.6250,
-		04.3750, 03.1250, 01.8750, 00.6250,
-		-0.6250, -1.8750, -3.1250, -4.3750,
-		-5.6250, -6.8750, -8.1250, -9.3750,
-		-10.6250, -11.8750, -13.1250, -14.3750,
-		-15.6250, -16.8750, -18.1250, -19.3750,
-		-20.6250, -21.8750, -23.1250, -24.3750,
-		-25.6250, -26.8750, -28.1250, -29.3750,
-		-30.6250, -31.8750, -33.1250, -34.3750,
-		-35.6250, -36.8750, -38.1250, -39.3750,
-		-40.6250, -41.8750, -43.1250, -44.3750,
-		-45.6250, -46.8750, -48.1250, -49.3750,
-		-50.6250, -51.8750, -53.1250, -54.3750,
-		-55.6250, -56.8750, -58.1250, -59.3750
-};
-double angles_EM1000_ISO_ANG_150_02_MS_60_FAIS[120] = {
-		74.3750, 73.1250, 71.8750, 70.6250,
-		69.3750, 68.1250, 66.8750, 65.6250,
-		64.3750, 63.1250, 61.8750, 60.6250,
-		59.3750, 58.1250, 56.8750, 55.6250,
-		54.3750, 53.1250, 51.8750, 50.6250,
-		49.3750, 48.1250, 46.8750, 45.6250,
-		44.3750, 43.1250, 41.8750, 40.6250,
-		39.3750, 38.1250, 36.8750, 35.6250,
-		34.3750, 33.1250, 31.8750, 30.6250,
-		29.3750, 28.1250, 26.8750, 25.6250,
-		24.3750, 23.1250, 21.8750, 20.6250,
-		19.3750, 18.1250, 16.8750, 15.6250,
-		14.3750, 13.1250, 11.8750, 10.6250,
-		09.3750, 08.1250, 06.8750, 05.6250,
-		04.3750, 03.1250, 01.8750, 00.6250,
-		-0.6250, -1.8750, -3.1250, -4.3750,
-		-5.6250, -6.8750, -8.1250, -9.3750,
-		-10.6250, -11.8750, -13.1250, -14.3750,
-		-15.6250, -16.8750, -18.1250, -19.3750,
-		-20.6250, -21.8750, -23.1250, -24.3750,
-		-25.6250, -26.8750, -28.1250, -29.3750,
-		-30.6250, -31.8750, -33.1250, -34.3750,
-		-35.6250, -36.8750, -38.1250, -39.3750,
-		-40.6250, -41.8750, -43.1250, -44.3750,
-		-45.6250, -46.8750, -48.1250, -49.3750,
-		-50.6250, -51.8750, -53.1250, -54.3750,
-		-55.6250, -56.8750, -58.1250, -59.3750,
-		-60.6250, -61.8750, -63.1250, -64.3750,
-		-65.6250, -66.8750, -68.1250, -69.3750,
-		-70.6250, -71.8750, -73.1250, -74.3750
-};
-double angles_EM1000_ISO_ANG_60_2_MS_48_FAIS[48] = {
-		29.3750, 28.1250, 26.8750, 25.6250,
-		24.3750, 23.1250, 21.8750, 20.6250,
-		19.3750, 18.1250, 16.8750, 15.6250,
-		14.3750, 13.1250, 11.8750, 10.6250,
-		09.3750, 08.1250, 06.8750, 05.6250,
-		04.3750, 03.1250, 01.8750, 00.6250,
-		-0.6250, -1.8750, -3.1250, -4.3750,
-		-5.6250, -6.8750, -8.1250, -9.3750,
-		-10.6250, -11.8750, -13.1250, -14.3750,
-		-15.6250, -16.8750, -18.1250, -19.3750,
-		-20.6250, -21.8750, -23.1250, -24.3750,
-		-25.6250, -26.8750, -28.1250, -29.3750
-};
-double angles_EM1000_SHALLOW[60] = {
-		72.5000, 70.0000, 67.5000, 65.0000,
-		62.5000, 60.0000, 57.5000, 55.0000,
-		52.5000, 50.0000, 47.5000, 45.0000,
-		42.5000, 40.0000, 37.5000, 35.0000,
-		32.5000, 30.0000, 27.5000, 25.0000,
-		22.5000, 20.0000, 17.5000, 15.0000,
-		12.5000, 10.0000, 7.50000, 5.00000,
-		2.50000, 0.00000,
-		0.0000, -2.5000, -5.0000, -7.5000,
-		-10.0000, -12.5000, -15.0000, -17.5000,
-		-20.0000, -22.5000, -25.0000, -27.5000,
-		-30.0000, -32.5000, -35.0000, -37.5000,
-		-40.0000, -42.5000, -45.0000, -47.5000,
-		-50.0000, -52.5000, -55.0000, -57.5000,
-		-60.0000, -62.5000, -65.0000, -67.5000,
-		-70.0000, -72.5000
-};
-double angles_EM12DP_114[81] = {
-		57.0000, 56.6875, 56.3125, 56.0000,
-		55.6250, 55.2500, 54.8750, 54.5000,
-		54.1250, 53.7500, 53.3750, 52.9375,
-		52.5625, 52.1250, 51.6875, 51.3125,
-		50.8125, 50.3750, 49.9375, 49.4375,
-		49.0000, 48.5000, 48.0000, 47.7000,
-		47.0000, 46.4375, 45.9375, 45.3750,
-		44.8125, 44.2500, 43.6875, 43.1250,
-		42.5000, 41.8750, 41.2500, 40.6250,
-		39.9375, 39.3125, 38.6250, 37.9375,
-		37.2500, 36.5000, 35.8125, 35.0625,
-		34.3125, 33.5625, 32.7500, 31.9375,
-		31.1250, 30.3125, 29.5000, 28.6250,
-		27.7500, 26.8750, 26.0000, 25.0625,
-		24.1250, 23.1875, 22.2500, 21.3125,
-		20.3125, 19.3125, 18.3125, 17.3125,
-		16.3125, 15.2500, 14.2500, 13.1875,
-		12.1250, 11.0000, 09.9375, 08.8750,
-		07.7500, 06.6875, 05.5625, 04.4375,
-		03.3750, 02.2500, 01.1250, 00.0000,
-		-1.1250
-};
-double angles_EM12DS_114[81] = {
-		1.1250, -0.0000, -1.1250, -2.2500,
-		-3.3750, -4.4375, -5.5625, -6.6875,
-		-7.7500, -8.8750, -9.9375, -11.0000,
-		-12.1250, -13.1875, -14.2500, -15.2500,
-		-16.3125, -17.3125, -18.3125, -19.3125,
-		-20.3125, -21.3125, -22.2500, -23.1875,
-		-24.1250, -25.0625, -26.0000, -26.8750,
-		-27.7500, -28.6250, -29.5000, -30.3125,
-		-31.1250, -31.9375, -32.7500, -33.5625,
-		-34.3125, -35.0625, -35.8125, -36.5000,
-		-37.2500, -37.9375, -38.6250, -39.3125,
-		-39.9375, -40.6250, -41.2500, -41.8750,
-		-42.5000, -43.1250, -43.6875, -44.2500,
-		-44.8125, -45.3750, -45.9375, -46.4375,
-		-47.0000, -47.7000, -48.0000, -48.5000,
-		-49.0000, -49.4375, -49.9375, -50.3750,
-		-50.8125, -51.3125, -51.6875, -52.1250,
-		-52.5625, -52.9375, -53.3750, -53.7500,
-		-54.1250, -54.5000, -54.8750, -55.2500,
-		-55.6250, -56.0000, -56.3125, -56.6875,
-		-57.0000
-};
-double angles_EM12DP_128[81] = {
-		64.0000, 63.6875, 63.4375, 63.1250,
-		62.8125, 62.5000, 62.1875, 61.8750,
-		61.5000, 61.1875, 60.8125, 60.4375,
-		60.1250, 59.7500, 59.3125, 58.9375,
-		58.5625, 58.1250, 57.7500, 57.3125,
-		56.8750, 56.3750, 55.9375, 55.5000,
-		55.0000, 54.5000, 54.0000, 53.4375,
-		52.9375, 52.3750, 51.8125, 51.2500,
-		50.6250, 50.0625, 49.4375, 48.8125,
-		48.1250, 47.4375, 46.7500, 46.0625,
-		45.3750, 44.6250, 43.8125, 43.0625,
-		42.2500, 41.4375, 40.5625, 39.6875,
-		38.8125, 37.8750, 36.9375, 36.0000,
-		35.0000, 34.0000, 33.0000, 31.9375,
-		30.8125, 29.7500, 28.5625, 27.4375,
-		26.2500, 25.0625, 23.8125, 22.5625,
-		21.2500, 19.9375, 18.6250, 17.3125,
-		15.9375, 14.5625, 13.1250, 11.7500,
-		10.3125, 08.8750, 07.3750, 05.9375,
-		04.4375, 03.0000, 01.5000, 00.0000,
-		-1.5000
-};
-double angles_EM12DS_128[81] = {
-		1.5000, -0.0000, -1.5000, -3.0000,
-		-4.4375, -5.9375, -7.3750, -8.8750,
-		-10.3125, -11.7500, -13.1250, -14.5625,
-		-15.9375, -17.3125, -18.6250, -19.9375,
-		-21.2500, -22.5625, -23.8125, -25.0625,
-		-26.2500, -27.4375, -28.5625, -29.7500,
-		-30.8125, -31.9375, -33.0000, -34.0000,
-		-35.0000, -36.0000, -36.9375, -37.8750,
-		-38.8125, -39.6875, -40.5625, -41.4375,
-		-42.2500, -43.0625, -43.8125, -44.6250,
-		-45.3750, -46.0625, -46.7500, -47.4375,
-		-48.1250, -48.8125, -49.4375, -50.0625,
-		-50.6250, -51.2500, -51.8125, -52.3750,
-		-52.9375, -53.4375, -54.0000, -54.5000,
-		-55.0000, -55.5000, -55.9375, -56.3750,
-		-56.8750, -57.3125, -57.7500, -58.1250,
-		-58.5625, -58.9375, -59.3125, -59.7500,
-		-60.1250, -60.4375, -60.8125, -61.1875,
-		-61.5000, -61.8750, -62.1875, -62.5000,
-		-62.8125, -63.1250, -63.4375, -63.6875,
-		-64.0000
-};
-double angles_EM12DP_140[81] = {
-		70.000000, 69.750000, 69.500000, 69.250000,
-		69.000000, 68.750000, 68.500000, 68.250000,
-		67.937500, 67.687500, 67.375000, 67.062500,
-		66.750000, 66.437500, 66.125000, 65.812500,
-		65.437500, 65.125000, 64.750000, 64.375000,
-		64.000000, 63.625000, 63.250000, 62.812500,
-		62.375000, 61.937500, 61.500000, 61.062500,
-		60.562500, 60.125000, 59.625000, 59.062500,
-		58.562500, 58.000000, 57.437500, 56.812500,
-		56.250000, 55.625000, 54.937500, 54.312500,
-		53.625000, 52.875000, 52.125000, 51.375000,
-		50.625000, 49.750000, 48.937500, 48.062500,
-		47.125000, 46.187500, 45.250000, 44.250000,
-		43.187500, 42.125000, 41.000000, 39.875000,
-		38.687500, 37.437500, 36.125000, 34.812500,
-		33.437500, 32.062500, 30.562500, 29.125000,
-		27.562500, 25.937500, 24.312500, 22.625000,
-		20.937500, 19.187500, 17.375000, 15.562500,
-		13.687500, 11.812500, 09.875000, 07.937500,
-		05.937500, 04.000000, 02.000000, 00.000000,
-		-2.0000000
-};
-double angles_EM12DS_140[81] = {
-		2.0000, -0.0000, -2.0000, -4.0000,
-		-5.9375, -7.9375, -9.8750, -11.8125,
-		-13.6875, -15.5625, -17.3750, -19.1875,
-		-20.9375, -22.6250, -24.3125, -25.9375,
-		-27.5625, -29.1250, -30.5625, -32.0625,
-		-33.4375, -34.8125, -36.1250, -37.4375,
-		-38.6875, -39.8750, -41.0000, -42.1250,
-		-43.1875, -44.2500, -45.2500, -46.1875,
-		-47.1250, -48.0625, -48.9375, -49.7500,
-		-50.6250, -51.3750, -52.1250, -52.8750,
-		-53.6250, -54.3125, -54.9375, -55.6250,
-		-56.2500, -56.8125, -57.4375, -58.0000,
-		-58.5625, -59.0625, -59.6250, -60.1250,
-		-60.5625, -61.0625, -61.5000, -61.9375,
-		-62.3750, -62.8125, -63.2500, -63.6250,
-		-64.0000, -64.3750, -64.7500, -65.1250,
-		-65.4375, -65.8125, -66.1250, -66.4375,
-		-66.7500, -67.0625, -67.3750, -67.6875,
-		-67.9375, -68.2500, -68.5000, -68.7500,
-		-69.0000, -69.2500, -69.5000, -69.7500,
-		-70.0000
-};
-double angles_EM12DP_150[81] = {
-		75.000000, 74.812500, 74.625000, 74.437500,
-		74.250000, 74.062500, 73.812500, 73.625000,
-		73.375000, 73.187500, 72.937500, 72.687500,
-		72.437500, 72.187500, 71.937500, 71.687500,
-		71.437500, 71.125000, 70.875000, 70.562500,
-		70.250000, 69.937500, 69.625000, 69.312500,
-		68.937500, 68.625000, 68.250000, 67.875000,
-		67.437500, 67.062500, 66.625000, 66.187500,
-		65.750000, 65.312500, 64.812500, 64.312500,
-		63.812500, 63.250000, 62.687500, 62.125000,
-		61.500000, 60.875000, 60.250000, 59.562500,
-		58.812500, 58.125000, 57.312500, 56.500000,
-		55.687500, 54.812500, 53.875000, 52.937500,
-		51.875000, 50.875000, 49.750000, 48.562500,
-		47.375000, 46.125000, 44.750000, 43.375000,
-		41.937500, 40.375000, 38.750000, 37.062500,
-		35.312500, 33.500000, 31.562500, 29.562500,
-		27.437500, 25.312500, 23.063499, 20.687500,
-		18.312500, 15.812500, 13.312500, 10.687500,
-		08.0625000, 05.3750000, 02.6875000, 00.000000,
-		-2.6875000
-};
-double angles_EM12DS_150[81] = {
-		2.6875, -0.0000, -2.6875, -5.3750,
-		-8.0625, -10.6875, -13.3125, -15.8125,
-		-18.3125, -20.6875, -23.0635, -25.3125,
-		-27.4375, -29.5625, -31.5625, -33.5000,
-		-35.3125, -37.0625, -38.7500, -40.3750,
-		-41.9375, -43.3750, -44.7500, -46.1250,
-		-47.3750, -48.5625, -49.7500, -50.8750,
-		-51.8750, -52.9375, -53.8750, -54.8125,
-		-55.6875, -56.5000, -57.3125, -58.1250,
-		-58.8125, -59.5625, -60.2500, -60.8750,
-		-61.5000, -62.1250, -62.6875, -63.2500,
-		-63.8125, -64.3125, -64.8125, -65.3125,
-		-65.7500, -66.1875, -66.6250, -67.0625,
-		-67.4375, -67.8750, -68.2500, -68.6250,
-		-68.9375, -69.3125, -69.6250, -69.9375,
-		-70.2500, -70.5625, -70.8750, -71.1250,
-		-71.4375, -71.6875, -71.9375, -72.1875,
-		-72.4375, -72.6875, -72.9375, -73.1875,
-		-73.3750, -73.6250, -73.8125, -74.0625,
-		-74.2500, -74.4375, -74.6250, -74.8125,
-		-75.0000
-};
-double angles_EM12DP_98[81] = {
-		49.0000, 48.6250, 48.2500, 47.8750,
-		47.5000, 47.1250, 46.7500, 46.3750,
-		45.9375, 45.5625, 45.1250, 44.6875,
-		44.3125, 43.8750, 43.4375, 43.0000,
-		42.5625, 42.0625, 41.6250, 41.1250,
-		40.6875, 40.1875, 39.6875, 39.1875,
-		38.6875, 38.1875, 37.6875, 37.1250,
-		36.6250, 36.0625, 35.5000, 34.9375,
-		34.3750, 33.8125, 33.2500, 32.6250,
-		32.0625, 31.4375, 30.8125, 30.2500,
-		29.5625, 28.9375, 28.3125, 27.6875,
-		27.0000, 26.3125, 25.6875, 25.0000,
-		24.3125, 23.6250, 22.8750, 22.1875,
-		21.4375, 20.7500, 20.0000, 19.2500,
-		18.5000, 17.7500, 17.0000, 16.2500,
-		15.4375, 14.6875, 13.8750, 13.1250,
-		12.3125, 11.5000, 10.7500, 09.9375,
-		09.1250, 08.3125, 07.4375, 06.6250,
-		05.8125, 05.0000, 04.1875, 03.3125,
-		02.5000, 01.6875, 00.8125, 00.0000,
-		-0.8125
-};
-double angles_EM12DS_98[81] = {
-		0.8125, -0.0000, -0.8125, -1.6875,
-		-2.5000, -3.3125, -4.1875, -5.0000,
-		-5.8125, -6.6250, -7.4375, -8.3125,
-		-9.1250, -9.9375, -10.7500, -11.5000,
-		-12.3125, -13.1250, -13.8750, -14.6875,
-		-15.4375, -16.2500, -17.0000, -17.7500,
-		-18.5000, -19.2500, -20.0000, -20.7500,
-		-21.4375, -22.1875, -22.8750, -23.6250,
-		-24.3125, -25.0000, -25.6875, -26.3125,
-		-27.0000, -27.6875, -28.3125, -28.9375,
-		-29.5625, -30.2500, -30.8125, -31.4375,
-		-32.0625, -32.6250, -33.2500, -33.8125,
-		-34.3750, -34.9375, -35.5000, -36.0625,
-		-36.6250, -37.1250, -37.6875, -38.1875,
-		-38.6875, -39.1875, -39.6875, -40.1875,
-		-40.6875, -41.1250, -41.6250, -42.0625,
-		-42.5625, -43.0000, -43.4375, -43.8750,
-		-44.3125, -44.6875, -45.1250, -45.5625,
-		-45.9375, -46.3750, -46.7500, -47.1250,
-		-47.5000, -47.8750, -48.2500, -48.6250,
-		-49.0000
-};
-double angles_EM12DP_ISO_ANG_DEEP[81] = {
-		75.0000, 74.0000, 73.0000, 72.0000,
-		71.0000, 70.0000, 69.0000, 68.0000,
-		67.0000, 66.0000, 65.0000, 64.0000,
-		63.0000, 62.0000, 61.0000, 60.0000,
-		59.0000, 58.0000, 57.0000, 56.0000,
-		55.0000, 54.0000, 53.0000, 52.0000,
-		51.0000, 50.0000, 49.0000, 48.0000,
-		47.0000, 46.0000, 45.0000, 44.0000,
-		43.0000, 42.0000, 41.0000, 40.0000,
-		39.0000, 38.0000, 37.0000, 36.0000,
-		35.0000, 34.0000, 33.0000, 32.0000,
-		31.0000, 30.0000, 29.0000, 28.0000,
-		27.0000, 26.0000, 25.0000, 24.0000,
-		23.0000, 22.0000, 21.0000, 20.0000,
-		19.0000, 18.0000, 17.0000, 16.0000,
-		15.0000, 14.0000, 13.0000, 12.0000,
-		11.0000, 10.0000, 09.0000, 08.0000,
-		07.0000, 06.0000, 05.0000, 04.0000,
-		03.0000, 02.0000, 01.0000, 00.0000,
-		-1.0000, -2.0000, -3.0000, -4.0000,
-		-5.0000
-};
-double angles_EM12DS_ISO_ANG_DEEP[81] = {
-		05.0000,
-		 04.0000,  03.0000,  02.0000,  01.0000,
-		 00.0000, -01.0000, -02.0000, -03.0000,
-		-04.0000, -05.0000, -06.0000, -07.0000,
-		-08.0000, -09.0000, -10.0000, -11.0000,
-		-12.0000, -13.0000, -14.0000, -15.0000,
-		-16.0000, -17.0000, -18.0000, -19.0000,
-		-20.0000, -21.0000, -22.0000, -23.0000,
-		-24.0000, -25.0000, -26.0000, -27.0000,
-		-28.0000, -29.0000, -30.0000, -31.0000,
-		-32.0000, -33.0000, -34.0000, -35.0000,
-		-36.0000, -37.0000, -38.0000, -39.0000,
-		-40.0000, -41.0000, -42.0000, -43.0000,
-		-44.0000, -45.0000, -46.0000, -47.0000,
-		-48.0000, -49.0000, -50.0000, -51.0000,
-		-52.0000, -53.0000, -54.0000, -55.0000,
-		-56.0000, -57.0000, -58.0000, -59.0000,
-		-60.0000, -61.0000, -62.0000, -63.0000,
-		-64.0000, -65.0000, -66.0000, -67.0000,
-		-68.0000, -69.0000, -70.0000, -71.0000,
-		-72.0000, -73.0000, -74.0000, -75.0000
-};
-double angles_EM12DP_ISO_ANG_SHALLOW[81] = {
-		75.0000, 74.0000, 73.0000, 72.0000,
-		71.0000, 70.0000, 69.0000, 68.0000,
-		67.0000, 66.0000, 65.0000, 64.0000,
-		63.0000, 62.0000, 61.0000, 60.0000,
-		59.0000, 58.0000, 57.0000, 56.0000,
-		55.0000, 54.0000, 53.0000, 52.0000,
-		51.0000, 50.0000, 49.0000, 48.0000,
-		47.0000, 46.0000, 45.0000, 44.0000,
-		43.0000, 42.0000, 41.0000, 40.0000,
-		39.0000, 38.0000, 37.0000, 36.0000,
-		35.0000, 34.0000, 33.0000, 32.0000,
-		31.0000, 30.0000, 29.0000, 28.0000,
-		27.0000, 26.0000, 25.0000, 24.0000,
-		23.0000, 22.0000, 21.0000, 20.0000,
-		19.0000, 18.0000, 17.0000, 16.0000,
-		15.0000, 14.0000, 13.0000, 12.0000,
-		11.0000, 10.0000, 09.0000, 08.0000,
-		07.0000, 06.0000, 05.0000, 04.0000,
-		03.0000, 02.0000, 01.0000, 00.0000,
-		-1.0000, -2.0000, -3.0000, -4.0000,
-		-5.000
-};
-double angles_EM12DS_ISO_ANG_SHALLOW[81] = {
-		5.0000, 4.0000, 3.0000, 2.0000,
-		1.0000, -0.0000, -1.0000, -2.0000,
-		-3.0000, -4.0000, -5.0000, -6.0000,
-		-7.0000, -8.0000, -9.0000, -10.0000,
-		-11.0000, -12.0000, -13.0000, -14.0000,
-		-15.0000, -16.0000, -17.0000, -18.0000,
-		-19.0000, -20.0000, -21.0000, -22.0000,
-		-23.0000, -24.0000, -25.0000, -26.0000,
-		-27.0000, -28.0000, -29.0000, -30.0000,
-		-31.0000, -32.0000, -33.0000, -34.0000,
-		-35.0000, -36.0000, -37.0000, -38.0000,
-		-39.0000, -40.0000, -41.0000, -42.0000,
-		-43.0000, -44.0000, -45.0000, -46.0000,
-		-47.0000, -48.0000, -49.0000, -50.0000,
-		-51.0000, -52.0000, -53.0000, -54.0000,
-		-55.0000, -56.0000, -57.0000, -58.0000,
-		-59.0000, -60.0000, -61.0000, -62.0000,
-		-63.0000, -64.0000, -65.0000, -66.0000,
-		-67.0000, -68.0000, -69.0000, -70.0000,
-		-71.0000, -72.0000, -73.0000, -74.0000,
-		-75.0000
-};
-double angles_EM12DP_SHALLOW[81] = {
-		75.00000, 74.81250, 74.62500, 74.43750,
-		74.25000, 74.06250, 73.81250, 73.62500,
-		73.37500, 73.18750, 72.93750, 72.68750,
-		72.43750, 72.18750, 71.93750, 71.68750,
-		71.43750, 71.12500, 70.87500, 70.56250,
-		70.25000, 69.93750, 69.62500, 69.31250,
-		68.93750, 68.62500, 68.25000, 67.87500,
-		67.43750, 67.06250, 66.62500, 66.18750,
-		65.75000, 65.31250, 64.81250, 64.31250,
-		63.81250, 63.25000, 62.68750, 62.12500,
-		61.50000, 60.87500, 60.25000, 59.56250,
-		58.81250, 58.12500, 57.31250, 56.50000,
-		55.68750, 54.81250, 53.87500, 52.93750,
-		51.87500, 50.87500, 49.75000, 48.56250,
-		47.37500, 46.12500, 44.75000, 43.37500,
-		41.93750, 40.37500, 38.75000, 37.06250,
-		35.31250, 33.50000, 31.56250, 29.56250,
-		27.43750, 25.31250, 23.06250, 20.68750,
-		18.31250, 15.81250, 13.31250, 10.68750,
-		08.06250, 05.37500, 02.68750, 00.00000,
-		-02.6875
-};
-double angles_EM12DS_SHALLOW[81] = {
-		02.68750,
-		-00.0000, -02.6875, -05.3750, -08.0625,
-		-10.6875, -13.3125, -15.8125, -18.3125,
-		-20.6875, -23.0625, -25.3125, -27.4375,
-		-29.5625, -31.5625, -33.5000, -35.3125,
-		-37.0625, -38.7500, -40.3750, -41.9375,
-		-43.3750, -44.7500, -46.1250, -47.3750,
-		-48.5625, -49.7500, -50.8750, -51.8750,
-		-52.9375, -53.8750, -54.8125, -55.6875,
-		-56.5000, -57.3125, -58.1250, -58.8125,
-		-59.5625, -60.2500, -60.8750, -61.5000,
-		-62.1250, -62.6875, -63.2500, -63.8125,
-		-64.3125, -64.8125, -65.3125, -65.7500,
-		-66.1875, -66.6250, -67.0625, -67.4375,
-		-67.8750, -68.2500, -68.6250, -68.9375,
-		-69.3125, -69.6250, -69.9375, -70.2500,
-		-70.5625, -70.8750, -71.1250, -71.4375,
-		-71.6875, -71.9375, -72.1875, -72.4375,
-		-72.6875, -72.9375, -73.1875, -73.3750,
-		-73.6250, -73.8125, -74.0625, -74.2500,
-		-74.4375, -74.6250, -74.8125, -75.0000
-};
-double angles_EM12S_105[81] = {
-		52.5000, 51.8125, 51.0625, 50.3125,
-		49.5625, 48.7500, 47.9375, 47.0625,
-		46.1875, 45.3125, 44.3750, 43.3750,
-		42.3750, 41.3125, 40.2500, 39.1875,
-		38.0000, 36.8750, 35.6250, 34.3750,
-		33.0625, 31.7500, 30.3750, 29.0000,
-		27.5625, 26.0625, 24.5000, 22.9375,
-		21.3750, 19.6875, 18.0625, 16.3125,
-		14.6250, 12.8750, 11.0625, 09.2500,
-		07.4375, 05.5625, 03.7500, 01.8750,
-		00.0000, -1.8750, -3.7500, -5.5625,
-		-7.4375, -9.2500, -11.0625, -12.8750,
-		-14.6250, -16.3125, -18.0625, -19.6875,
-		-21.3750, -22.9375, -24.5000, -26.0625,
-		-27.5625, -29.0000, -30.3750, -31.7500,
-		-33.0625, -34.3750, -35.6250, -36.8750,
-		-38.0000, -39.1875, -40.2500, -41.3125,
-		-42.3750, -43.3750, -44.3750, -45.3125,
-		-46.1875, -47.0625, -47.9375, -48.7500,
-		-49.5625, -50.3125, -51.0625, -51.8125,
-		-52.5000
-};
-double angles_EM12S_120[81] = {
-		60.0000, 59.3750, 58.6875, 58.0000,
-		57.3125, 56.5625, 55.8125, 55.0000,
-		54.1875, 53.3125, 52.4375, 51.4375,
-		50.5000, 49.4375, 48.3750, 47.2500,
-		46.1250, 44.8750, 43.6250, 42.2500,
-		40.8750, 39.4375, 37.9375, 36.3750,
-		34.6875, 33.0000, 31.2500, 29.3750,
-		27.4375, 25.5000, 23.4375, 21.3125,
-		19.1250, 16.8750, 14.5625, 12.1875,
-		09.8125, 07.3750, 04.9375, 02.5000,
-		00.0000,
-		-2.5000, -4.9375, -7.3750,
-		-9.8125, -12.1875, -14.5625, -16.8750,
-		-19.1250, -21.3125, -23.4375, -25.5000,
-		-27.4375, -29.3750, -31.2500, -33.0000,
-		-34.6875, -36.3750, -37.9375, -39.4375,
-		-40.8750, -42.2500, -43.6250, -44.8750,
-		-46.1250, -47.2500, -48.3750, -49.4375,
-		-50.5000, -51.4375, -52.4375, -53.3125,
-		-54.1875, -55.0000, -55.8125, -56.5625,
-		-57.3125, -58.0000, -58.6875, -59.3750,
-		-60.0000
-};
-double angles_EM12S_90[81] = {
-		45.0000, 44.2500, 43.5000, 42.7500,
-		42.0000, 41.1875, 40.3750, 39.5000,
-		38.6875, 37.7500, 36.8750, 35.9375,
-		35.0000, 34.0000, 33.0000, 32.0000,
-		30.9375, 29.8750, 28.8125, 27.6875,
-		26.5625, 25.4375, 24.2500, 23.0000,
-		21.8125, 20.5625, 19.3125, 18.0000,
-		16.6875, 15.3750, 14.0625, 12.6875,
-		11.3125, 09.9375, 08.5000, 07.1250,
-		05.6875, 04.3125, 02.8750, 01.4375,
-		00.0000, -1.4375, -2.8750, -4.3125,
-		-5.6875, -7.1250, -8.5000, -9.9375,
-		-11.3125, -12.6875, -14.0625, -15.3750,
-		-16.6875, -18.0000, -19.3125, -20.5625,
-		-21.8125, -23.0000, -24.2500, -25.4375,
-		-26.5625, -27.6875, -28.8125, -29.8750,
-		-30.9375, -32.0000, -33.0000, -34.0000,
-		-35.0000, -35.9375, -36.8750, -37.7500,
-		-38.6875, -39.5000, -40.3750, -41.1875,
-		-42.0000, -42.7500, -43.5000, -44.2500,
-		-45.0000
-};
-double angles_EM12S_ISO_ANG_DEEP[81] = {
-		45.0000, 43.8750, 42.7500, 41.6250,
-		40.5000, 39.3750, 38.2500, 37.1250,
-		36.0000, 34.8750, 33.7500, 32.6250,
-		31.5000, 30.3750, 29.2500, 28.1250,
-		27.0000, 25.8750, 24.7500, 23.6250,
-		22.5000, 21.3750, 20.2500, 19.1250,
-		18.0000, 16.8750, 15.7500, 14.6250,
-		13.5000, 12.3750, 11.2500, 10.1250,
-		09.0000, 07.8750, 06.7500, 05.6250,
-		04.5000, 03.3700, 02.2500, 01.1250,
-		-0.0000,
-		-01.1250,-02.2500,-03.3700,-04.5000,
-		-05.6250,-06.7500,-07.8750,-09.0000,
-		-10.1250,-11.2500,-12.3750,-13.5000,
-		-14.6250,-15.7500,-16.8750,-18.0000,
-		-19.1250,-20.2500,-21.3750,-22.5000,
-		-23.6250,-24.7500,-25.8750,-27.0000,
-		-28.1250,-29.2500,-30.3750,-31.5000,
-		-32.6250,-33.7500,-34.8750,-36.0000,
-		-37.1250,-38.2500,-39.3750,-40.5000,
-		-41.6250,-42.7500,-43.8750,-45.0000
-};
-double angles_EM12S_ISO_ANG_SHALLOW[81] = {
-		45.0000, 43.8750, 42.7500, 41.6250,
-		40.5000, 39.3750, 38.2500, 37.1250,
-		36.0000, 34.8750, 33.7500, 32.6250,
-		31.5000, 30.3750, 29.2500, 28.1250,
-		27.0000, 25.8750, 24.7500, 23.6250,
-		22.5000, 21.3750, 20.2500, 19.1250,
-		18.0000, 16.8750, 15.7500, 14.6250,
-		13.5000, 12.3750, 11.2500, 10.1250,
-		09.0000, 07.8750, 06.7500, 05.6250,
-		04.5000, 03.3700, 02.2500, 01.1250,
-		-0.0000,
-		-1.1250, -2.2500, -3.3700,
-		-4.5000, -5.6250, -6.7500, -7.8750,
-		-9.0000, -10.1250, -11.2500, -12.3750,
-		-13.5000, -14.6250, -15.7500, -16.8750,
-		-18.0000, -19.1250, -20.2500, -21.3750,
-		-22.5000, -23.6250, -24.7500, -25.8750,
-		-27.0000, -28.1250, -29.2500, -30.3750,
-		-31.5000, -32.6250, -33.7500, -34.8750,
-		-36.0000, -37.1250, -38.2500, -39.3750,
-		-40.5000, -41.6250, -42.7500, -43.8750,
-		-45.0000
-};
-double angles_EM12S_SHALLOW[81] = {
-		60.0000, 59.3750, 58.6875, 58.0000,
-		57.3125, 56.5625, 55.8125, 55.0000,
-		54.1875, 53.3125, 52.4375, 51.4375,
-		50.5000, 49.4375, 48.3750, 47.2500,
-		46.1250, 44.8750, 43.6250, 42.2500,
-		40.8750, 39.4375, 37.9375, 36.3750,
-		34.6875, 33.0000, 31.2500, 29.3750,
-		27.4375, 25.5000, 23.4375, 21.3125,
-		19.1250, 16.8750, 14.5625, 12.1875,
-		09.8125, 07.3750, 04.9375, 02.5000,
-		00.0000,
-     		-02.5000,-04.9375,-07.3750,-09.8125,
-     		-12.1875,-14.5625,-16.8750,-19.1250,
-     		-21.3125,-23.4375,-25.5000,-27.4375,
-     		-29.3750,-31.2500,-33.0000,-34.6875,
-     		-36.3750,-37.9375,-39.4375,-40.8750,
-     		-42.2500,-43.6250,-44.8750,-46.1250,
-     		-47.2500,-48.3750,-49.4375,-50.5000,
-     		-51.4375,-52.4375,-53.3125,-54.1875,
-     		-55.0000,-55.8125,-56.5625,-57.3125,
-     		-58.0000,-58.6875,-59.3750,-60.0000
-};
-double angles_EM121_GUESS[121] = {
-		 60.0, 59.0, 58.0, 57.0, 56.0, 55.0, 54.0, 53.0, 52.0, 51.0,
-		 50.0, 49.0, 48.0, 47.0, 46.0, 45.0, 44.0, 43.0, 42.0, 41.0,
-		 40.0, 39.0, 38.0, 37.0, 36.0, 35.0, 34.0, 33.0, 32.0, 31.0,
-		 30.0, 29.0, 28.0, 27.0, 26.0, 25.0, 24.0, 23.0, 22.0, 21.0,
-		 20.0, 19.0, 18.0, 17.0, 16.0, 15.0, 14.0, 13.0, 12.0, 11.0,
-		 10.0,  9.0,  8.0,  7.0,  6.0,  5.0,  4.0,  3.0,  2.0,  1.0,
-		  0.0,
-     		 -1.0, -2.0, -3.0, -4.0, -5.0, -6.0, -7.0, -8.0, -9.0,-10.0,
-		-11.0,-12.0,-13.0,-14.0,-15.0,-16.0,-17.0,-18.0,-19.0,-20.0,
-		-21.0,-22.0,-23.0,-24.0,-25.0,-26.0,-27.0,-28.0,-29.0,-30.0,
-		-31.0,-32.0,-33.0,-34.0,-35.0,-36.0,-37.0,-38.0,-39.0,-40.0,
-		-41.0,-42.0,-43.0,-44.0,-45.0,-46.0,-47.0,-48.0,-49.0,-50.0,
-     		-51.0,-52.0,-53.0,-54.0,-55.0,-56.0,-57.0,-58.0,-59.0,-60.0
-};
-#endif
-
-/* internal data structure for survey data */
-struct mbsys_simrad_survey_struct
-	{
-	/* swath id */
-	int	swath_id;	/* EM_SWATH_CENTER:	0
-				   EM_SWATH_PORT:	-1  (EM12D only)
-				   EM_SWATH_STARBOARD:	1   (EM12D only) */
-	/* interpolated nav */
-	double	longitude;
-	double	latitude;
-
-	/* bathymetry */
-	int	ping_number;
-	int	beams_bath;	/* EM-1000:  60
-				   EM12S:    81
-				   EM121:   121
-				   EM12D:   81 */
-	int	bath_mode;	/* EM-1000: 1=deep; 2=medium; 3=shallow
-				   EM-12S:  1=shallow equiangle spacing
-				            2=deep equiangle spacing
-				            3=shallow equidistant spacing
-				            4=deep 120 degree equidistant
-				            5=deep 105 degree equidistant
-				            6=deep 90 degree equidistant
-				   EM-12D:  1=shallow equiangle spacing
-				            2=deep equiangle spacing
-				            3=shallow equidistant spacing
-				            4=deep 150 degree equidistant
-				            5=deep 140 degree equidistant
-				            6=deep 128 degree equidistant
-				            7=deep 114 degree equidistant
-				            8=deep 98 degree equidistant */
-	int	bath_res;	/* EM-12 only: 1=high res; 2=low res */
-	int	bath_quality;	/* number of good beams,
-					negative if ping rejected */
-	int	bath_num;	/* number of beams, EM-121 only, 61 or 121 */
-	int	pulse_length;	/* pulse length in ms, EM-121 only */
-	int	beam_width;	/* beam width in degree, 1, 2 or 4, EM-121 only */
-	int	power_level;	/* power level, 0-5, EM-121 only */
-	int	tx_status;	/* 0-58, EM-121 only */
-	int	rx_status;	/* 0-144, EM-121 only */
-	int	along_res;	/* alongtrack resolution, 0.01 m, EM-121 only */
-	int	across_res;	/* acrosstrack resolution, 0.01 m, EM-121 only */
-	int	depth_res;	/* depth resolution, 0.01 m, EM-121 only */
-	int	range_res;	/* range resolution, 0.1 ms, EM-121 only */
-	int	keel_depth;	/* depth of most vertical beam:
-					EM-1000:        0.02 meters
-					EM-12 high res: 0.10 meters
-					EM-12 low res:  0.20 meters
-					EM-121          depth_res meters */
-	int	heading;	/* heading:
-					EM-1000:        0.1 degrees
-					EM-12:          0.1 degrees
-					EM-121:		0.01 degrees */
-	int	roll;		/* 0.01 degrees */
-	int	pitch;		/* 0.01 degrees */
-	int	xducer_pitch;	/* 0.01 degrees */
-	int	ping_heave;	/* 0.01 meters */
-	int	sound_vel;	/* 0.1 meters/sec */
-	unsigned short int bath[MBSYS_SIMRAD_MAXBEAMS];
-				/* depths:
-					EM-1000:        0.02 meters
-					EM-12 high res: 0.10 meters
-					EM-12 low res:  0.20 meters
-					EM-121:         depth_res meters */
-	short int bath_acrosstrack[MBSYS_SIMRAD_MAXBEAMS];
-				/* acrosstrack distances:
-					EM-1000:         0.1 meters
-					EM-12 high res:  0.2 meters
-					EM-12 low res:   0.5 meters
-					EM-121:          across_res meters */
-	short int bath_alongtrack[MBSYS_SIMRAD_MAXBEAMS];
-				/* alongtrack distances:
-					EM-1000:         0.1 meters
-					EM-12 high res:  0.2 meters
-					EM-12 low res:   0.5 meters
-					EM-121:          along_res meters */
-	short int tt[MBSYS_SIMRAD_MAXBEAMS];	/* meters */
-				/* travel times:
-					EM-1000:         0.05 msec
-					EM-12 high res:  0.20 msec
-					EM-12 low res:   0.80 msec
-					EM-121:          0.1 * range_res msec */
-	mb_s_char	amp[MBSYS_SIMRAD_MAXBEAMS];	/* 0.5 dB */
-	mb_u_char	quality[MBSYS_SIMRAD_MAXBEAMS];	/* meters */
-	mb_s_char	heave[MBSYS_SIMRAD_MAXBEAMS];	/* 0.1 meters */
-	mb_s_char	beamflag[MBSYS_SIMRAD_MAXBEAMS];	/* MB-System beamflags */
-
-	/* sidescan */
-	int	ss_status;
-	int	pixels_ssraw;	/* total number of samples for this ping */
-	int	ss_mode;	/* 1 = EM-12 shallow:   0.6 m/sample
-				   2 = EM-12 deep:      2.4 m/sample
-				   3 = EM-1000 deep:    0.3 m/sample
-				   4 = EM-1000 medium:  0.3 m/sample
-				   5 = EM-1000 shallow: 0.15 m/sample */
-	short int beam_frequency[MBSYS_SIMRAD_MAXBEAMS];
-				/*	0 = 12.67 kHz
-					1 = 13.00 kHz
-					2 = 13.33 kHz
-					3 = 95.00 kHz */
-	short int beam_samples[MBSYS_SIMRAD_MAXBEAMS];
-				/* number of sidescan samples derived from
-					each beam */
-	short int beam_center_sample[MBSYS_SIMRAD_MAXBEAMS];
-				/* center beam sample number among samples
-					from one beam */
-	short int beam_start_sample[MBSYS_SIMRAD_MAXBEAMS];
-				/* start beam sample number among samples
-					from entire ping */
-	mb_s_char	ssraw[MBSYS_SIMRAD_MAXRAWPIXELS];
-	short int ssp[MBSYS_SIMRAD_MAXRAWPIXELS];
-
-	int	pixel_size;	/* processed sidescan pixel size in cm */
-	int	pixels_ss;	/* number of processed sidescan pixels stored */
-	short	ss[MBSYS_SIMRAD_MAXPIXELS];
-				/* the processed sidescan ordered port to starboard */
-	short	ssalongtrack[MBSYS_SIMRAD_MAXPIXELS];
-				/* the processed sidescan alongtrack distances
-					in distance resolution units */
-	};
-
-/* internal data structure */
-struct mbsys_simrad_struct
-	{
-	/* type of data record */
-	int	kind;			/* Data vs Comment */
-
-	/* type of sonar */
-	int	sonar;			/* Type of Simrad sonar */
-
-	/* parameter info (start, stop and parameter datagrams) */
-	int	par_year;
-	int	par_month;
-	int	par_day;
-	int	par_hour;
-	int	par_minute;
-	int	par_second;
-	int	par_centisecond;
-	int	pos_type;	/* positioning system type */
-	double	pos_delay;	/* positioning system delay (sec) */
-	double	roll_offset;	/* roll offset (degrees) */
-	double	pitch_offset;	/* pitch offset (degrees) */
-	double	heading_offset;	/* heading offset (degrees) */
-	double	em100_td;	/* EM-100 tranducer depth (meters) */
-	double	em100_tx;	/* EM-100 tranducer fore-aft
-					offset (meters) */
-	double	em100_ty;	/* EM-100 tranducer athwartships
-					offset (meters) */
-	double	em12_td;	/* EM-12 tranducer depth (meters) */
-	double	em12_tx;	/* EM-12 tranducer fore-aft
-					offset (meters) */
-	double	em12_ty;	/* EM-12 tranducer athwartships
-					offset (meters) */
-	double	em1000_td;	/* EM-1000 tranducer depth (meters) */
-	double	em1000_tx;	/* EM-1000 tranducer fore-aft
-					offset (meters) */
-	double	em1000_ty;	/* EM-1000 tranducer athwartships
-					offset (meters) */
-	char	spare_parameter[128];
-	int	survey_line;
-	char	comment[MBSYS_SIMRAD_COMMENT_LENGTH];
-
-	/* position (position datagrams) */
-	int	pos_year;
-	int	pos_month;
-	int	pos_day;
-	int	pos_hour;
-	int	pos_minute;
-	int	pos_second;
-	int	pos_centisecond;
-	double	pos_latitude;
-	double	pos_longitude;
-	double	utm_northing;
-	double	utm_easting;
-	int	utm_zone;
-	double	utm_zone_lon;
-	int	utm_system;
-	int	pos_quality;
-	double	speed;			/* meters/second */
-	double	line_heading;		/* degrees */
-
-	/* sound velocity profile */
-	int	svp_year;
-	int	svp_month;
-	int	svp_day;
-	int	svp_hour;
-	int	svp_minute;
-	int	svp_second;
-	int	svp_centisecond;
-	int	svp_num;
-	int	svp_depth[MBSYS_SIMRAD_MAXSVP]; /* meters */
-	int	svp_vel[MBSYS_SIMRAD_MAXSVP];	/* 0.1 meters/sec */
-
-	/* time stamp */
-	int	year;
-	int	month;
-	int	day;
-	int	hour;
-	int	minute;
-	int	second;
-	int	centisecond;
-
-	/* pointer to survey data structure */
-	struct mbsys_simrad_survey_struct *ping;
-	};
-
-/* system specific function prototypes */
-int mbsys_simrad_alloc(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error);
-int mbsys_simrad_survey_alloc(int verbose,
-			void *mbio_ptr, void *store_ptr,
-			int *error);
-int mbsys_simrad_deall(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error);
-int mbsys_simrad_dimensions(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int *nbath, int *namp, int *nss, int *error);
-int mbsys_simrad_extract(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int time_i[7], double *time_d,
-			double *navlon, double *navlat,
-			double *speed, double *heading,
-			int *nbath, int *namp, int *nss,
-			char *beamflag, double *bath, double *amp,
-			double *bathacrosstrack, double *bathalongtrack,
-			double *ss, double *ssacrosstrack, double *ssalongtrack,
-			char *comment, int *error);
-int mbsys_simrad_insert(int verbose, void *mbio_ptr, void *store_ptr,
-			int kind, int time_i[7], double time_d,
-			double navlon, double navlat,
-			double speed, double heading,
-			int nbath, int namp, int nss,
-			char *beamflag, double *bath, double *amp,
-			double *bathacrosstrack, double *bathalongtrack,
-			double *ss, double *ssacrosstrack, double *ssalongtrack,
-			char *comment, int *error);
-int mbsys_simrad_ttimes(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int *nbeams,
-			double *ttimes, double *angles,
-			double *angles_forward, double *angles_null,
-			double *heave, double *alongtrack_offset,
-			double *draft, double *ssv, int *error);
-int mbsys_simrad_detects(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int *nbeams,
-			int *detects, int *error);
-int mbsys_simrad_pulses(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int *nbeams,
-			int *pulses, int *error);
-int mbsys_simrad_gains(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, double *transmit_gain, double *pulse_length,
-			double *receive_gain, int *error);
-int mbsys_simrad_extract_altitude(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, double *transducer_depth, double *altitude,
-			int *error);
-int mbsys_simrad_extract_nav(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int time_i[7], double *time_d,
-			double *navlon, double *navlat,
-			double *speed, double *heading, double *draft,
-			double *roll, double *pitch, double *heave,
-			int *error);
-int mbsys_simrad_insert_nav(int verbose, void *mbio_ptr, void *store_ptr,
-			int time_i[7], double time_d,
-			double navlon, double navlat,
-			double speed, double heading, double draft,
-			double roll, double pitch, double heave,
-			int *error);
-int mbsys_simrad_extract_svp(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind,
-			int *nsvp,
-			double *depth, double *velocity,
-			int *error);
-int mbsys_simrad_insert_svp(int verbose, void *mbio_ptr, void *store_ptr,
-			int nsvp,
-			double *depth, double *velocity,
-			int *error);
-int mbsys_simrad_copy(int verbose, void *mbio_ptr,
-			void *store_ptr, void *copy_ptr,
-			int *error);
-int mbsys_simrad_makess(int verbose, void *mbio_ptr, void *store_ptr,
-		int pixel_size_set, double *pixel_size,
-		int swath_width_set, double *swath_width,
-		int pixel_int,
-		int *error);
diff --git a/src/mbio/mbsys_simrad2.c b/src/mbio/mbsys_simrad2.c
deleted file mode 100644
index cc39f9e..0000000
--- a/src/mbio/mbsys_simrad2.c
+++ /dev/null
@@ -1,5356 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbsys_simrad2.c	3.00	10/9/98
- *	$Id: mbsys_simrad2.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1998-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbsys_simrad2.c contains the MBIO functions for handling data from
- * new (post-1997) Simrad multibeam sonars (e.g. EM120, EM300, EM3000).
- * The data formats associated with Simrad multibeams
- * (both old and new) include:
- *    MBSYS_SIMRAD formats (code in mbsys_simrad.c and mbsys_simrad.h):
- *      MBF_EMOLDRAW : MBIO ID 51 - Vendor EM1000, EM12S, EM12D, EM121
- *                   : MBIO ID 52 - aliased to 51
- *      MBF_EM12IFRM : MBIO ID 53 - IFREMER EM12S and EM12D
- *      MBF_EM12DARW : MBIO ID 54 - NERC EM12S
- *                   : MBIO ID 55 - aliased to 51
- *    MBSYS_SIMRAD2 formats (code in mbsys_simrad2.c and mbsys_simrad2.h):
- *      MBF_EM300RAW : MBIO ID 56 - Vendor EM3000, EM300, EM120
- *      MBF_EM300MBA : MBIO ID 57 - MBARI EM3000, EM300, EM120
- *
- * Author:	D. W. Caress
- * Date:	October 9, 1998
- *
- * $Log: mbsys_simrad2.c,v $
- * Revision 5.33  2009/03/02 18:51:52  caress
- * Fixed problems with formats 58 and 59, and also updated copyright dates in several source files.
- *
- * Revision 5.32  2008/07/10 18:02:39  caress
- * Proceeding towards 5.1.1beta20.
- *
- * Revision 5.29  2008/03/01 09:14:03  caress
- * Some housekeeping changes.
- *
- * Revision 5.28  2007/10/31 18:38:41  caress
- * Fixed handling of null sidescan values.
- *
- * Revision 5.27  2007/10/08 15:59:34  caress
- * MBIO changes as of 8 October 2007.
- *
- * Revision 5.26  2006/11/10 22:36:05  caress
- * Working towards release 5.1.0
- *
- * Revision 5.25  2006/08/09 22:41:27  caress
- * Fixed programs that read or write grids so that they do not use the GMT_begin() function; these programs will now work when GMT is built in the default fashion, when GMT is built in the default fashion, with "advisory file locking" enabled.
- *
- * Revision 5.24  2006/07/27 18:42:52  caress
- * Working towards 5.1.0
- *
- * Revision 5.23  2006/02/07 03:12:14  caress
- * Another shot at dealing with broken simrad sidescan records. Now we will keep the raw sidescan data but not use it to make the binned sidescan returned by the standard mbio extract functions.
- *
- * Revision 5.22  2006/02/03 21:08:51  caress
- * Working on supporting water column datagrams in Simrad formats.
- *
- * Revision 5.21  2006/01/27 20:09:47  caress
- * Added support for EM3002
- *
- * Revision 5.20  2006/01/06 18:27:19  caress
- * Working towards 5.0.8
- *
- * Revision 5.19  2005/11/05 00:48:05  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.18  2003/04/22 20:51:22  caress
- * Fixed bug in inserting sonar depth value.
- *
- * Revision 5.17  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.16  2002/10/02 23:55:42  caress
- * Release 5.0.beta24
- *
- * Revision 5.15  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.14  2002/08/21 00:55:46  caress
- * Release 5.0.beta22
- *
- * Revision 5.13  2002/07/20 20:42:40  caress
- * Release 5.0.beta20
- *
- * Revision 5.12  2002/05/29 23:40:48  caress
- * Release 5.0.beta18
- *
- * Revision 5.11  2001/10/19 21:48:16  caress
- * Fixed acrosstrack scaling.
- * .,
- *
- * Revision 5.10  2001/09/12  19:27:57  caress
- * Fixed depth scaling problem.
- *
- * Revision 5.9  2001/08/25  00:54:13  caress
- * Adding beamwidth values to extract functions.
- *
- * Revision 5.8  2001/08/04  01:00:02  caress
- * Applied mods from Gordon Keith.
- *
- * Revision 5.7  2001/07/20  00:32:54  caress
- * Release 5.0.beta03
- *
- * Revision 5.6  2001/06/08  21:44:01  caress
- * Version 5.0.beta01
- *
- * Revision 5.5  2001/06/01  00:14:06  caress
- * Redid support for current Simrad multibeam data.
- *
- * Revision 5.4  2001/05/30  17:57:26  caress
- * Fixed New Simrad data handling, plus removed use of
- * intermediate data structure. Still need to reduce use
- * of #ifdefs related to byteswapping.
- *
- * Revision 5.3  2001/05/24  23:18:07  caress
- * Fixed handling of Revelle EM120 data (first cut).
- *
- * Revision 5.2  2001/03/22  20:50:02  caress
- * Trying to make version 5.0.beta0
- *
- * Revision 5.1  2001/01/22  07:43:34  caress
- * Version 5.0.beta01
- *
- * Revision 5.0  2000/12/01  22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.4  2000/10/11  01:03:21  caress
- * Convert to ANSI C
- *
- * Revision 4.3  2000/09/30  06:32:52  caress
- * Snapshot for Dale.
- *
- * Revision 4.2  2000/07/20  20:24:59  caress
- * First cut at supporting both EM120 and EM1002.
- *
- * Revision 4.1  2000/07/19  04:01:41  caress
- * Supported EM120.
- *
- * Revision 4.0  1998/12/17  22:59:14  caress
- * MB-System version 4.6beta4
- *
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mb_define.h"
-#include "mbsys_simrad2.h"
-
-static char rcs_id[]="$Id: mbsys_simrad2.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mbsys_simrad2_alloc(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_simrad2_alloc";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_simrad2_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* allocate memory for data structure */
-	status = mb_mallocd(verbose,__FILE__, __LINE__,sizeof(struct mbsys_simrad2_struct),
-				(void **)store_ptr,error);
-
-	/* get data structure pointer */
-	store = (struct mbsys_simrad2_struct *) *store_ptr;
-
-	/* initialize everything */
-	store->kind = MB_DATA_NONE;
-	store->type = EM2_NONE;
-	store->sonar = MBSYS_SIMRAD2_UNKNOWN;
-	store->numberheads = 1;
-
-	/* time stamp */
-	store->date = 0;
-	store->msec = 0;
-
-	/* installation parameter values */
-	store->par_date = 0;	/* installation parameter date = year*10000 + month*100 + day
-				    Feb 26, 1995 = 19950226 */
-	store->par_msec = 0;	/* installation parameter time since midnight in msec
-				    08:12:51.234 = 29570234 */
-	store->par_line_num = 0;/* survey line number */
-	store->par_serial_1 = 0;/* system 1 serial number */
-	store->par_serial_2 = 0;/* system 2 serial number */
-	store->par_wlz = 0.0;	/* water line vertical location (m) */
-	store->par_smh = 0;	/* system main head serial number */
-	store->par_s1z = 0.0;	/* transducer 1 vertical location (m) */
-	store->par_s1x = 0.0;	/* transducer 1 along location (m) */
-	store->par_s1y = 0.0;	/* transducer 1 athwart location (m) */
-	store->par_s1h = 0.0;	/* transducer 1 heading (deg) */
-	store->par_s1r = 0.0;	/* transducer 1 roll (m) */
-	store->par_s1p = 0.0;	/* transducer 1 pitch (m) */
-	store->par_s1n = 0;	/* transducer 1 number of modules */
-	store->par_s2z = 0.0;	/* transducer 2 vertical location (m) */
-	store->par_s2x = 0.0;	/* transducer 2 along location (m) */
-	store->par_s2y = 0.0;	/* transducer 2 athwart location (m) */
-	store->par_s2h = 0.0;	/* transducer 2 heading (deg) */
-	store->par_s2r = 0.0;	/* transducer 2 roll (m) */
-	store->par_s2p = 0.0;	/* transducer 2 pitch (m) */
-	store->par_s2n = 0;	/* transducer 2 number of modules */
-	store->par_go1 = 0.0;	/* system (sonar head 1) gain offset */
-	store->par_go2 = 0.0;	/* sonar head 2 gain offset */
-	for (i=0;i<16;i++)
-	    {
-	    store->par_tsv[i] = '\0';	/* transmitter (sonar head 1) software version */
-	    store->par_rsv[i] = '\0';	/* receiver (sonar head 2) software version */
-	    store->par_bsv[i] = '\0';	/* beamformer software version */
-	    store->par_psv[i] = '\0';	/* processing unit software version */
-	    store->par_osv[i] = '\0';	/* operator station software version */
-	    }
-	store->par_dsd = 0.0;	/* depth sensor time delay (msec) */
-	store->par_dso = 0.0;	/* depth sensor offset */
-	store->par_dsf = 0.0;	/* depth sensor scale factor */
-	store->par_dsh[0] = 'I';	/* depth sensor heave (IN or NI) */
-	store->par_dsh[1] = 'N';	/* depth sensor heave (IN or NI) */
-	store->par_aps = 0;	/* active position system number */
-	store->par_p1m = 0;	/* position system 1 motion compensation (boolean) */
-	store->par_p1t = 0;	/* position system 1 time stamp used
-				    (0=system time, 1=position input time) */
-	store->par_p1z = 0.0;	/* position system 1 vertical location (m) */
-	store->par_p1x = 0.0;	/* position system 1 along location (m) */
-	store->par_p1y = 0.0;	/* position system 1 athwart location (m) */
-	store->par_p1d = 0.0;	/* position system 1 time delay (sec) */
-	for (i=0;i<16;i++)
-	    {
-	    store->par_p1g[i] = '\0';	/* position system 1 geodetic datum */
-	    }
-	strcpy(store->par_p1g, "WGS_84");
-	store->par_p2m = 0;	/* position system 2 motion compensation (boolean) */
-	store->par_p2t = 0;	/* position system 2 time stamp used
-				    (0=system time, 1=position input time) */
-	store->par_p2z = 0.0;	/* position system 2 vertical location (m) */
-	store->par_p2x = 0.0;	/* position system 2 along location (m) */
-	store->par_p2y = 0.0;	/* position system 2 athwart location (m) */
-	store->par_p2d = 0.0;	/* position system 2 time delay (sec) */
-	for (i=0;i<16;i++)
-	    {
-	    store->par_p2g[i] = '\0';	/* position system 2 geodetic datum */
-	    }
-	store->par_p3m = 0;	/* position system 3 motion compensation (boolean) */
-	store->par_p3t = 0;	/* position system 3 time stamp used
-				    (0=system time, 1=position input time) */
-	store->par_p3z = 0.0;	/* position system 3 vertical location (m) */
-	store->par_p3x = 0.0;	/* position system 3 along location (m) */
-	store->par_p3y = 0.0;	/* position system 3 athwart location (m) */
-	store->par_p3d = 0.0;	/* position system 3 time delay (sec) */
-	for (i=0;i<16;i++)
-	    {
-	    store->par_p3g[i] = '\0';	/* position system 3 geodetic datum */
-	    }
-	store->par_msz = 0.0;	/* motion sensor vertical location (m) */
-	store->par_msx = 0.0;	/* motion sensor along location (m) */
-	store->par_msy = 0.0;	/* motion sensor athwart location (m) */
-	store->par_mrp[0] = 'H';	/* motion sensor roll reference plane (HO or RP) */
-	store->par_mrp[1] = 'O';	/* motion sensor roll reference plane (HO or RP) */
-	store->par_msd = 0.0;	/* motion sensor time delay (sec) */
-	store->par_msr = 0.0;	/* motion sensor roll offset (deg) */
-	store->par_msp = 0.0;	/* motion sensor pitch offset (deg) */
-	store->par_msg = 0.0;	/* motion sensor heading offset (deg) */
-	store->par_gcg = 0.0;	/* gyro compass heading offset (deg) */
-	for (i=0;i<4;i++)
-	    {
-	    store->par_cpr[i] = '\0';	/* cartographic projection */
-	    }
-	for (i=0;i<MBSYS_SIMRAD2_COMMENT_LENGTH;i++)
-	    {
-	    store->par_rop[i] = '\0';	/* responsible operator */
-	    store->par_sid[i] = '\0';	/* survey identifier */
-	    store->par_pll[i] = '\0';	/* survey line identifier (planned line number) */
-	    store->par_com[i] = '\0';	/* comment */
-	    }
-
-	/* runtime parameter values */
-	store->run_date = 0;		/* runtime parameter date = year*10000 + month*100 + day
-				    Feb 26, 1995 = 19950226 */
-	store->run_msec = 0;		/* runtime parameter time since midnight in msec
-				    08:12:51.234 = 29570234 */
-	store->run_ping_count = 0;	/* ping counter */
-	store->run_serial = 0;		/* system 1 or 2 serial number */
-	store->run_status = 0;		/* system status */
-	store->run_mode = 0;		/* system mode:
-				    0 : nearfield (EM3000) or very shallow (EM300)
-				    1 :	normal (EM3000) or shallow (EM300)
-				    2 : medium (EM300)
-				    3 : deep (EM300)
-				    4 : very deep (EM300) */
-	store->run_filter_id = 0;	/* filter identifier - the two lowest bits
-				    indicate spike filter strength:
-					00 : off
-					01 : weak
-					10 : medium
-					11 : strong
-				    bit 2 is set if the slope filter is on
-				    bit 3 is set if the sidelobe filter is on
-				    bit 4 is set if the range windows are expanded
-				    bit 5 is set if the smoothing filter is on
-				    bit	6 is set if the interference filter is on */
-	store->run_min_depth = 0;	/* minimum depth (m) */
-	store->run_max_depth = 0;	/* maximum depth (m) */
-	store->run_absorption = 0;	/* absorption coefficient (0.01 dB/km) */
-
-	store->run_tran_pulse = 0;	/* transmit pulse length (usec) */
-	store->run_tran_beam = 0;	/* transmit beamwidth (0.1 deg) */
-	store->run_tran_pow = 0;	/* transmit power reduction (dB) */
-	store->run_rec_beam = 0;	/* receiver beamwidth (0.1 deg) */
-	store->run_rec_beam = 0;	/* receiver bandwidth (50 hz) */
-	store->run_rec_gain = 0;	/* receiver fixed gain (dB) */
-	store->run_tvg_cross = 0;	/* TVG law crossover angle (deg) */
-	store->run_ssv_source = 0;	/* source of sound speed at transducer:
-				    0 : from sensor
-				    1 : manual
-				    2 : from profile */
-	store->run_max_swath = 0;	/* maximum swath width (m) */
-	store->run_beam_space = 0;	/* beam spacing:
-				    0 : determined by beamwidth (EM3000)
-				    1 : equidistant
-				    2 : equiangle */
-	store->run_swath_angle = 0;	/* coverage sector of swath (deg) */
-	store->run_stab_mode = 0;	/* yaw and pitch stabilization mode:
-				    The upper bit (bit 7) is set if pitch
-				    stabilization is on.
-				    The two lower bits are used to show yaw
-				    stabilization mode as follows:
-					00 : none
-					01 : to survey line heading
-					10 : to mean vessel heading
-					11 : to manually entered heading */
-	for (i=0;i<4;i++)
-	    {
-	    store->run_spare[i] = '\0';
-	    }
-
-	/* sound velocity profile */
-	store->svp_use_date = 0;	/* date at start of use
-				    date = year*10000 + month*100 + day
-				    Feb 26, 1995 = 19950226 */
-	store->svp_use_msec = 0;	/* time at start of use since midnight in msec
-				    08:12:51.234 = 29570234 */
-	store->svp_count = 0;		/* sequential counter or input identifier */
-	store->svp_serial = 0;		/* system 1 serial number */
-	store->svp_origin_date = 0;	/* date at svp origin
-				    date = year*10000 + month*100 + day
-				    Feb 26, 1995 = 19950226 */
-	store->svp_origin_msec = 0;	/* time at svp origin since midnight in msec
-				    08:12:51.234 = 29570234 */
-	store->svp_num = 0;		/* number of svp entries */
-	store->svp_depth_res = 0;	/* depth resolution (cm) */
-	for (i=0;i<MBSYS_SIMRAD2_MAXSVP;i++)
-	    {
-	    store->svp_depth[i] = 0;	/* depth of svp entries (according to svp_depth_res) */
-	    store->svp_vel[i] = 0;	/* sound speed of svp entries (0.1 m/sec) */
-	    }
-
-	/* position */
-	store->pos_date = 0;		/* position date = year*10000 + month*100 + day
-				    Feb 26, 1995 = 19950226 */
-	store->pos_msec = 0;		/* position time since midnight in msec
-				    08:12:51.234 = 29570234 */
-	store->pos_count = 0;		/* sequential counter */
-	store->pos_serial = 0;		/* system 1 serial number */
-	store->pos_latitude = 0;	/* latitude in decimal degrees * 20000000
-				    (negative in southern hemisphere)
-				    if valid, invalid = 0x7FFFFFFF */
-	store->pos_longitude = 0;	/* longitude in decimal degrees * 10000000
-				    (negative in western hemisphere)
-				    if valid, invalid = 0x7FFFFFFF */
-	store->pos_quality = 0;	/* measure of position fix quality (cm) */
-	store->pos_speed = 0;		/* speed over ground (cm/sec) if valid,
-				    invalid = 0xFFFF */
-	store->pos_course = 0;		/* course over ground (0.01 deg) if valid,
-				    invalid = 0xFFFF */
-	store->pos_heading = 0;	/* heading (0.01 deg) if valid,
-				    invalid = 0xFFFF */
-	store->pos_heave = 0;	/* heave from interpolation (0.01 m) */
-	store->pos_roll = 0;	/* roll from interpolation (0.01 deg) */
-	store->pos_pitch = 0;	/* pitch from interpolation (0.01 deg) */
-	store->pos_system = 0;		/* position system number, type, and realtime use
-				    - position system number given by two lowest bits
-				    - fifth bit set means position must be derived
-					from input Simrad 90 datagram
-				    - sixth bit set means valid time is that of
-					input datagram */
-	store->pos_input_size = 0;	/* number of bytes in input position datagram */
-	for (i=0;i<256;i++)
-	    {
-	    store->pos_input[i] = 0;	/* position input datagram as received, minus
-				    header and tail (such as NMEA 0183 $ and CRLF) */
-	    }
-
-	/* height */
-	store->hgt_date = 0;		/* height date = year*10000 + month*100 + day
-				    Feb 26, 1995 = 19950226 */
-	store->hgt_msec = 0;		/* height time since midnight in msec
-				    08:12:51.234 = 29570234 */
-	store->hgt_count = 0;		/* sequential counter */
-	store->hgt_serial = 0;		/* system 1 serial number */
-	store->hgt_height = 0;		/* height (0.01 m) */
-	store->hgt_type = 0;		/* height type as given in input datagram or if
-				    zero the height is derived from the GGK datagram
-				    and is the height of the water level re the
-				    vertical datum */
-
-	/* tide */
-	store->tid_date = 0;		/* tide date = year*10000 + month*100 + day
-				    Feb 26, 1995 = 19950226 */
-	store->tid_msec = 0;		/* tide time since midnight in msec
-				    08:12:51.234 = 29570234 */
-	store->tid_count = 0;		/* sequential counter */
-	store->tid_serial = 0;		/* system 1 serial number */
-	store->tid_origin_date = 0;	/* tide input date = year*10000 + month*100 + day
-				    Feb 26, 1995 = 19950226 */
-	store->tid_origin_msec = 0;	/* tide input time since midnight in msec
-				    08:12:51.234 = 29570234 */
-	store->tid_tide = 0;		/* tide offset (0.01 m) */
-
-	/* clock */
-	store->clk_date = 0;		/* system date = year*10000 + month*100 + day
-				    Feb 26, 1995 = 19950226 */
-	store->clk_msec = 0;		/* system time since midnight in msec
-				    08:12:51.234 = 29570234 */
-	store->clk_count = 0;		/* sequential counter */
-	store->clk_serial = 0;		/* system 1 serial number */
-	store->clk_origin_date	= 0;	/* external clock date = year*10000 + month*100 + day
-				    Feb 26, 1995 = 19950226 */
-	store->clk_origin_msec = 0;	/* external clock time since midnight in msec
-				    08:12:51.234 = 29570234 */
-	store->clk_1_pps_use = 0;	/* if 1 then the internal clock is synchronized
-				    to an external 1 PPS signal, if 0 then not */
-
-	/* pointer to attitude data structure */
-	store->attitude = NULL;
-
-	/* pointer to heading data structure */
-	store->heading = NULL;
-
-	/* pointer to ssv data structure */
-	store->ssv = NULL;
-
-	/* pointer to tilt data structure */
-	store->tilt = NULL;
-
-	/* pointer to survey data structure */
-	store->ping = NULL;
-	store->ping2 = NULL;
-
-	/* pointer to water column data structure */
-	store->wc = NULL;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)*store_ptr);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbsys_simrad2_survey_alloc(int verbose,
-			void *mbio_ptr, void *store_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_simrad2_survey_alloc";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_simrad2_struct *store;
-	struct mbsys_simrad2_ping_struct *ping;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_simrad2_struct *) store_ptr;
-
-	/* allocate memory for data structure if needed */
-	if (store->ping == NULL)
-		status = mb_mallocd(verbose,__FILE__, __LINE__,
-			sizeof(struct mbsys_simrad2_ping_struct),
-			(void **)&(store->ping),error);
-	if (status == MB_SUCCESS && store->ping != NULL)
-		{
-		/* get data structure pointer */
-		ping = (struct mbsys_simrad2_ping_struct *) store->ping;
-
-		/* initialize everything */
-		ping->png_date = 0;
-				/* date = year*10000 + month*100 + day
-				    Feb 26, 1995 = 19950226 */
-		ping->png_msec = 0;
-				/* time since midnight in msec
-				    08:12:51.234 = 29570234 */
-		ping->png_count = 0;
-				/* sequential counter or input identifier */
-		ping->png_serial = 0;
-				/* system 1 or system 2 serial number */
-		ping->png_latitude = EM2_INVALID_INT;
-				/* latitude in decimal degrees * 20000000
-				    (negative in southern hemisphere)
-				    if valid, invalid = 0x7FFFFFFF */
-		ping->png_longitude = EM2_INVALID_INT;
-				/* longitude in decimal degrees * 10000000
-				    (negative in western hemisphere)
-				    if valid, invalid = 0x7FFFFFFF */
-		ping->png_speed = 0;
-				/* speed over ground (cm/sec) if valid,
-				    invalid = 0xFFFF */
-		ping->png_heading = 0;
-				/* heading (0.01 deg) */
-		ping->png_heave = 0;
-				/* heave from interpolation (0.01 m) */
-		ping->png_roll = 0;
-				/* roll from interpolation (0.01 deg) */
-		ping->png_pitch = 0;
-				/* pitch from interpolation (0.01 deg) */
-		ping->png_ssv = 0;
-				/* sound speed at transducer (0.1 m/sec) */
-		ping->png_xducer_depth = 0;
-				/* transmit transducer depth (0.01 m)
-				    - The transmit transducer depth plus the
-					depth offset multiplier times 65536 cm
-					should be added to the beam depths to
-					derive the depths re the water line.
-					The depth offset multiplier will usually
-					be zero, except when the EM3000 sonar
-					head is on an underwater vehicle at a
-					depth greater than about 650 m. Note that
-					the offset multiplier will be negative
-					(-1) if the actual heave is large enough
-					to bring the transmit transducer above
-					the water line. This may represent a valid
-					situation,  but may also be due to an
-					erroneously set installation depth of
-					the either transducer or the water line. */
-		ping->png_offset_multiplier = 0;
-				/* transmit transducer depth offset multiplier
-				   - see note 7 above */
-
-		/* beam data */
-		ping->png_nbeams_max = 0;
-				/* maximum number of beams possible */
-		ping->png_nbeams = 0;
-				/* number of valid beams */
-		ping->png_depth_res = 0;
-				/* depth resolution (0.01 m) */
-		ping->png_distance_res = 0;
-				/* x and y resolution (0.01 m) */
-		ping->png_sample_rate = 0;
-				/* sampling rate (Hz) OR depth difference between
-				    sonar heads in EM3000D - see note 9 above */
-		for (i=0;i<MBSYS_SIMRAD2_MAXBEAMS;i++)
-		    {
-		    ping->png_depth[i] = 0;
-				/* depths in depth resolution units */
-		    ping->png_acrosstrack[i] = 0;
-				/* acrosstrack distances in distance resolution units */
-		    ping->png_alongtrack[i] = 0;
-				/* alongtrack distances in distance resolution units */
-		    ping->png_depression[i] = 0;
-				/* Primary beam angles in one of two formats (see note 10 above)
-				   1: Corrected format - gives beam depression angles
-					in 0.01 degree. These are the takeoff angles used
-					in raytracing calculations.
-				   2: Uncorrected format - gives beam pointing angles
-					in 0.01 degree. These values are relative to
-					the transducer array and have not been corrected
-					for vessel motion. */
-		    ping->png_azimuth[i] = 0;
-				/* Secondary beam angles in one of two formats (see note 10 above)
-				   1: Corrected format - gives beam azimuth angles
-					in 0.01 degree. These values used to rotate sounding
-					position relative to the sonar after raytracing.
-				   2: Uncorrected format - combines a flag indicating that
-					the angles are in the uncorrected format with
-					beam tilt angles. Values greater than
-					35999 indicate the uncorrected format is in use. The
-					beam tilt angles are given as (value - 54000) in
-					0.01 degree; the tilt angles give the tilt of the
-					transmitted ping due to compensation for vessel
-					motion. */
-		    ping->png_range[i] = 0;
-				/* Ranges in one of two formats (see note 10 above):
-				   1: Corrected format - the ranges are one way
-					travel times in time units defined as half
-					the inverse sampling rate.
-				   2: Uncorrected format - the ranges are raw two
-					way travel times in time units defined as
-					half the inverse sampling rate. These values
-					have not been corrected for changes in the
-					heave during the ping cycle. */
-		    ping->png_quality[i] = 0;
-				/* 0-254 */
-		    ping->png_window[i] = 0;
-				/* samples/4 */
-		    ping->png_amp[i] = 0;
-				/* 0.5 dB */
-		    ping->png_beam_num[i] = 0;
-				/* beam 128 is first beam on
-				    second head of EM3000D */
-		    ping->png_beamflag[i] = MB_FLAG_NULL;
-				/* uses standard MB-System beamflags */
-		    }
-
-		/* raw beam record */
-		ping->png_raw1_read = MB_NO;	/* flag indicating actual reading of old rawbeam record */
-		ping->png_raw2_read = MB_NO;	/* flag indicating actual reading of new rawbeam record */
-		ping->png_raw_date = 0;
-				/* date = year*10000 + month*100 + day
-				    Feb 26, 1995 = 19950226 */
-		ping->png_raw_msec = 0;
-				/* time since midnight in msec
-				    08:12:51.234 = 29570234 */
-		ping->png_raw_count = 0;
-				/* sequential counter or input identifier */
-		ping->png_raw_serial = 0;
-				/* system 1 or system 2 serial number */
-		ping->png_raw_heading = 0;	/* heading (0.01 deg) */
-		ping->png_raw_ssv = 0;		/* sound speed at transducer (0.1 m/sec) */
-		ping->png_raw_xducer_depth = 0;	/* transmit transducer depth (0.01 m) */
-		ping->png_raw_nbeams_max = 0;		/* maximum number of beams possible */
-		ping->png_raw_nbeams = 0;		/* number of valid beams */
-		ping->png_raw_depth_res = 0;		/* depth resolution (0.01 m) */
-		ping->png_raw_distance_res = 0;	/* x and y resolution (0.01 m) */
-		ping->png_raw_sample_rate = 0;	/* sampling rate (Hz) */
-		ping->png_raw_status = 0;		/* status from PU/TRU */
-		ping->png_raw_nbeams = 0;		/* number of raw travel times and angles
-							- nonzero only if raw beam record read */
-		ping->png_raw_rangenormal = 0;	/* normal incidence range (meters) */
-		ping->png_raw_normalbackscatter = 0; 	/* normal incidence backscatter (dB) (-60 to +9) */
-		ping->png_raw_obliquebackscatter = 0; /* oblique incidence backscatter (dB) (-60 to +9) */
-		ping->png_raw_fixedgain = 0;		/* fixed gain (dB) (0 to 30) */
-		ping->png_raw_txpower = 0;		/* transmit power (dB) (0, -10, or -20) */
-		ping->png_raw_mode = 0;		/* sonar mode:
-							0 : very shallow
-							1 : shallow
-							2 : medium
-							3 : deep
-							4 : very deep
-							5 : extra deep */
-		ping->png_raw_coverage = 0;	/* swath width (degrees) (10 to 150 degrees) */
-		ping->png_raw_yawstabheading = 0; /* yaw stabilization heading (0.01 degrees) */
-		ping->png_raw_ntx = 0;		/* number of TX pulses (1 to 9) */
-		for (i=0;i<MBSYS_SIMRAD2_MAXTX;i++)
-			{
-			ping->png_raw_txlastbeam[i] = 0;/* last beam number in this TX pulse */
-			ping->png_raw_txtiltangle[i] = 0;/* tilt angle (0.01 deg) */
-			ping->png_raw_txheading[i] = 0;	/* heading (0.01 deg) */
-			ping->png_raw_txroll[i] = 0;	/* roll (0.01 deg) */
-			ping->png_raw_txpitch[i] = 0;	/* pitch angle (0.01 deg) */
-			ping->png_raw_txheave[i] = 0;	/* heave (0.01 m) */
-			}
-		for (i=0;i<MBSYS_SIMRAD2_MAXBEAMS;i++)
-			{
-			ping->png_raw_rxrange[i] = 0;
-				/* Ranges as raw two way travel times in time
-					units defined as one-fourth the inverse
-					sampling rate. These values have not
-					been corrected for changes in the
-					heave during the ping cycle. */
-			ping->png_raw_rxquality[i] = 0;	/* beam quality flag */
-			ping->png_raw_rxwindow[i] = 0;	/* length of detection window */
-			ping->png_raw_rxamp[i] = 0;		/* 0.5 dB */
-			ping->png_raw_rxbeam_num[i] = 0;
-				/* beam 128 is first beam on
-				    second head of EM3000D */
-			ping->png_raw_rxpointangle[i] = 0;
-				/* Raw beam pointing angles in 0.01 degree,
-					positive to port.
-					These values are relative to the transducer
-					array and have not been corrected
-					for vessel motion. */
-			ping->png_raw_rxtiltangle[i] = 0;
-				/* Raw transmit tilt angles in 0.01 degree,
-					positive forward.
-					These values are relative to the transducer
-					array and have not been corrected
-					for vessel motion. */
-			ping->png_raw_rxheading[i] = 0;	/* heading (0.01 deg) */
-			ping->png_raw_rxroll[i] = 0;	/* roll (0.01 deg) */
-			ping->png_raw_rxpitch[i] = 0;	/* pitch angle (0.01 deg) */
-			ping->png_raw_rxheave[i] = 0;	/* heave (0.01 m) */
-			}
-
-		/* raw travel time and angle data version 3 */
-		ping->png_raw3_read = 0;	/* flag indicating actual reading of newer rawbeam record */
-		ping->png_raw3_date = 0;	/* date = year*10000 + month*100 + day
-				    Feb 26, 1995 = 19950226 */
-		ping->png_raw3_msec = 0;	/* time since midnight in msec
-				    08:12:51.234 = 29570234 */
-		ping->png_raw3_count = 0;	/* sequential counter or input identifier */
-		ping->png_raw3_serial = 0;	/* system 1 or system 2 serial number */
-		ping->png_raw3_ntx = 0;		/* number of TX pulses (1 to 9) */
-		ping->png_raw3_nbeams = 0;		/* number of raw travel times and angles
-					    - nonzero only if raw beam record read */
-		ping->png_raw3_sample_rate = 0;	/* sampling rate (Hz or 0.01 Hz) */
-		ping->png_raw3_xducer_depth = 0;	/* transmit transducer depth (0.01 m) */
-		ping->png_raw3_ssv = 0;		/* sound speed at transducer (0.1 m/sec) */
-		ping->png_raw3_nbeams_max = 0;	/* maximum number of beams possible */
-		for (i=0;i<MBSYS_SIMRAD2_MAXTX;i++)
-			{
-			ping->png_raw3_txtiltangle[i] = 0;/* tilt angle (0.01 deg) */
-			ping->png_raw3_txfocus[i] = 0;   /* focus range (0.1 m)
-									0 = no focus */
-			ping->png_raw3_txsignallength[i] = 0;	/* signal length (usec) */
-			ping->png_raw3_txoffset[i] = 0;	/* transmit time offset (usec) */
-			ping->png_raw3_txcenter[i] = 0;	/* center frequency (Hz) */
-			ping->png_raw3_txbandwidth[i] = 0;	/* bandwidth (10 Hz) */
-			ping->png_raw3_txwaveform[i] = 0;	/* signal waveform identifier
-										0 = CW, 1 = FM */
-			ping->png_raw3_txsector[i] = 0;	/* transmit sector number (0-19) */
-			}
-		for (i=0;i<MBSYS_SIMRAD2_MAXBEAMS;i++)
-			{
-			ping->png_raw3_rxpointangle[i] = 0;;
-					/* Raw beam pointing angles in 0.01 degree,
-						positive to port.
-						These values are relative to the transducer
-						array and have not been corrected
-						for vessel motion. */
-			ping->png_raw3_rxrange[i] = 0;;	/* Ranges (0.25 samples) */
-			ping->png_raw3_rxsector[i] = 0;;	/* transmit sector identifier */
-			ping->png_raw3_rxamp[i] = 0;;		/* 0.5 dB */
-			ping->png_raw3_rxquality[i] = 0;;	/* beam quality flag */
-			ping->png_raw3_rxwindow[i] = 0;;	/* length of detection window */
-			ping->png_raw3_rxbeam_num[i] = 0;;
-					/* beam 128 is first beam on
-					    second head of EM3000D */
-			ping->png_raw3_rxspare[i] = 0;;	/* spare */
-			}
-
-		/* sidescan */
-		ping->png_ss_read = MB_NO;
-				/* flag indicating actual reading of sidescan record */
-		ping->png_ss_count = 0;
-				/* sequential counter or input identifier */
-		ping->png_ss_serial = 0;
-				/* system 1 or system 2 serial number */
-		ping->png_max_range = 0;
-				/* max range of ping in number of samples */
-		ping->png_r_zero = 0;
-				/* range to normal incidence used in TVG
-				    (R0 predicted) in samples */
-		ping->png_r_zero_corr = 0;
-				/* range to normal incidence used to correct
-				    sample amplitudes in number of samples */
-		ping->png_tvg_start = 0;
-				/* start sample of TVG ramp if not enough
-				    dynamic range (0 otherwise) */
-		ping->png_tvg_stop = 0;	\
-				/* stop sample of TVG ramp if not enough
-				    dynamic range (0 otherwise) */
-		ping->png_bsn = 0;
-				/* normal incidence backscatter (BSN) in dB */
-		ping->png_bso = 0;
-				/* oblique incidence backscatter (BSO) in dB */
-		ping->png_tx = 0;
-				/* Tx beamwidth in 0.1 degree */
-		ping->png_tvg_crossover = 0;
-				/* TVG law crossover angle in degrees */
-		ping->png_nbeams_ss = 0;
-				/* number of beams with sidescan */
-		for (i=0;i<MBSYS_SIMRAD2_MAXBEAMS;i++)
-		    {
-		    ping->png_beam_index[i] = 0;
-				/* beam index number */
-		    ping->png_sort_direction[i] = 0;
-				/* sorting direction - first sample in beam has lowest
-				    range if 1, highest if -1. */
-		    ping->png_beam_samples[i] = 0;
-				/* number of sidescan samples derived from
-					each beam */
-		    ping->png_start_sample[i] = 0;
-				/* start sample number */
-		    ping->png_center_sample[i] = 0;
-				/* center sample number */
-		    }
-		for (i=0;i<MBSYS_SIMRAD2_MAXRAWPIXELS;i++)
-		    {
-		    ping->png_ssraw[i] = EM2_INVALID_AMP;
-				/* the raw sidescan ordered port to starboard */
-		    }
-		ping->png_pixel_size = 0;
-		ping->png_pixels_ss = 0;
-		for (i=0;i<MBSYS_SIMRAD2_MAXPIXELS;i++)
-		    {
-		    ping->png_ss[i] = EM2_INVALID_AMP;
-				/* the processed sidescan ordered port to starboard */
-		    ping->png_ssalongtrack[i] = EM2_INVALID_AMP;
-				/* the processed sidescan alongtrack distances
-					in distance resolution units */
-		    }
-		}
-
-	/* allocate memory for second data structure if needed */
-	if (store->ping2 == NULL && store->sonar == MBSYS_SIMRAD2_EM3002)
-		{
-		if ((status = mb_mallocd(verbose,__FILE__, __LINE__,
-			sizeof(struct mbsys_simrad2_ping_struct),
-			(void **)&(store->ping2),error)) == MB_SUCCESS)
-			{
-
-			/* get data structure pointer */
-			ping = (struct mbsys_simrad2_ping_struct *) store->ping2;
-
-			/* initialize everything */
-			ping->png_date = 0;
-					/* date = year*10000 + month*100 + day
-					    Feb 26, 1995 = 19950226 */
-			ping->png_msec = 0;
-					/* time since midnight in msec
-					    08:12:51.234 = 29570234 */
-			ping->png_count = 0;
-					/* sequential counter or input identifier */
-			ping->png_serial = 0;
-					/* system 1 or system 2 serial number */
-			ping->png_latitude = EM2_INVALID_INT;
-					/* latitude in decimal degrees * 20000000
-					    (negative in southern hemisphere)
-					    if valid, invalid = 0x7FFFFFFF */
-			ping->png_longitude = EM2_INVALID_INT;
-					/* longitude in decimal degrees * 10000000
-					    (negative in western hemisphere)
-					    if valid, invalid = 0x7FFFFFFF */
-			ping->png_speed = 0;
-					/* speed over ground (cm/sec) if valid,
-					    invalid = 0xFFFF */
-			ping->png_heading = 0;
-					/* heading (0.01 deg) */
-			ping->png_heave = 0;
-					/* heave from interpolation (0.01 m) */
-			ping->png_roll = 0;
-					/* roll from interpolation (0.01 deg) */
-			ping->png_pitch = 0;
-					/* pitch from interpolation (0.01 deg) */
-			ping->png_ssv = 0;
-					/* sound speed at transducer (0.1 m/sec) */
-			ping->png_xducer_depth = 0;
-					/* transmit transducer depth (0.01 m)
-					    - The transmit transducer depth plus the
-						depth offset multiplier times 65536 cm
-						should be added to the beam depths to
-						derive the depths re the water line.
-						The depth offset multiplier will usually
-						be zero, except when the EM3000 sonar
-						head is on an underwater vehicle at a
-						depth greater than about 650 m. Note that
-						the offset multiplier will be negative
-						(-1) if the actual heave is large enough
-						to bring the transmit transducer above
-						the water line. This may represent a valid
-						situation,  but may also be due to an
-						erroneously set installation depth of
-						the either transducer or the water line. */
-			ping->png_offset_multiplier = 0;
-					/* transmit transducer depth offset multiplier
-					   - see note 7 above */
-
-			/* beam data */
-			ping->png_nbeams_max = 0;
-					/* maximum number of beams possible */
-			ping->png_nbeams = 0;
-					/* number of valid beams */
-			ping->png_depth_res = 0;
-					/* depth resolution (0.01 m) */
-			ping->png_distance_res = 0;
-					/* x and y resolution (0.01 m) */
-			ping->png_sample_rate = 0;
-					/* sampling rate (Hz) OR depth difference between
-					    sonar heads in EM3000D - see note 9 above */
-			for (i=0;i<MBSYS_SIMRAD2_MAXBEAMS;i++)
-			    {
-			    ping->png_depth[i] = 0;
-					/* depths in depth resolution units */
-			    ping->png_acrosstrack[i] = 0;
-					/* acrosstrack distances in distance resolution units */
-			    ping->png_alongtrack[i] = 0;
-					/* alongtrack distances in distance resolution units */
-			    ping->png_depression[i] = 0;
-					/* Primary beam angles in one of two formats (see note 10 above)
-					   1: Corrected format - gives beam depression angles
-				        	in 0.01 degree. These are the takeoff angles used
-						in raytracing calculations.
-					   2: Uncorrected format - gives beam pointing angles
-				        	in 0.01 degree. These values are relative to
-						the transducer array and have not been corrected
-						for vessel motion. */
-			    ping->png_azimuth[i] = 0;
-					/* Secondary beam angles in one of two formats (see note 10 above)
-					   1: Corrected format - gives beam azimuth angles
-				        	in 0.01 degree. These values used to rotate sounding
-						position relative to the sonar after raytracing.
-					   2: Uncorrected format - combines a flag indicating that
-				        	the angles are in the uncorrected format with
-						beam tilt angles. Values greater than
-						35999 indicate the uncorrected format is in use. The
-						beam tilt angles are given as (value - 54000) in
-						0.01 degree; the tilt angles give the tilt of the
-						transmitted ping due to compensation for vessel
-						motion. */
-			    ping->png_range[i] = 0;
-					/* Ranges in one of two formats (see note 10 above):
-					   1: Corrected format - the ranges are one way
-				        	travel times in time units defined as half
-						the inverse sampling rate.
-					   2: Uncorrected format - the ranges are raw two
-				        	way travel times in time units defined as
-						half the inverse sampling rate. These values
-						have not been corrected for changes in the
-						heave during the ping cycle. */
-			    ping->png_quality[i] = 0;
-					/* 0-254 */
-			    ping->png_window[i] = 0;
-					/* samples/4 */
-			    ping->png_amp[i] = 0;
-					/* 0.5 dB */
-			    ping->png_beam_num[i] = 0;
-					/* beam 128 is first beam on
-					    second head of EM3000D */
-			    ping->png_beamflag[i] = MB_FLAG_NULL;
-					/* uses standard MB-System beamflags */
-			    }
-
-			/* raw beam record */
-			ping->png_raw1_read = MB_NO;	/* flag indicating actual reading of old rawbeam record */
-			ping->png_raw2_read = MB_NO;	/* flag indicating actual reading of new rawbeam record */
-			ping->png_raw_date = 0;
-					/* date = year*10000 + month*100 + day
-					    Feb 26, 1995 = 19950226 */
-			ping->png_raw_msec = 0;
-					/* time since midnight in msec
-					    08:12:51.234 = 29570234 */
-			ping->png_raw_count = 0;
-					/* sequential counter or input identifier */
-			ping->png_raw_serial = 0;
-					/* system 1 or system 2 serial number */
-			ping->png_raw_heading = 0;	/* heading (0.01 deg) */
-			ping->png_raw_ssv = 0;		/* sound speed at transducer (0.1 m/sec) */
-			ping->png_raw_xducer_depth = 0;	/* transmit transducer depth (0.01 m) */
-			ping->png_raw_nbeams_max = 0;		/* maximum number of beams possible */
-			ping->png_raw_nbeams = 0;		/* number of valid beams */
-			ping->png_raw_depth_res = 0;		/* depth resolution (0.01 m) */
-			ping->png_raw_distance_res = 0;	/* x and y resolution (0.01 m) */
-			ping->png_raw_sample_rate = 0;	/* sampling rate (Hz) */
-			ping->png_raw_status = 0;		/* status from PU/TRU */
-			ping->png_raw_nbeams = 0;		/* number of raw travel times and angles
-								- nonzero only if raw beam record read */
-			ping->png_raw_rangenormal = 0;	/* normal incidence range (meters) */
-			ping->png_raw_normalbackscatter = 0; 	/* normal incidence backscatter (dB) (-60 to +9) */
-			ping->png_raw_obliquebackscatter = 0; /* oblique incidence backscatter (dB) (-60 to +9) */
-			ping->png_raw_fixedgain = 0;		/* fixed gain (dB) (0 to 30) */
-			ping->png_raw_txpower = 0;		/* transmit power (dB) (0, -10, or -20) */
-			ping->png_raw_mode = 0;		/* sonar mode:
-								0 : very shallow
-								1 : shallow
-								2 : medium
-								3 : deep
-								4 : very deep
-								5 : extra deep */
-			ping->png_raw_coverage = 0;	/* swath width (degrees) (10 to 150 degrees) */
-			ping->png_raw_yawstabheading = 0; /* yaw stabilization heading (0.01 degrees) */
-			ping->png_raw_ntx = 0;		/* number of TX pulses (1 to 9) */
-			for (i=0;i<MBSYS_SIMRAD2_MAXTX;i++)
-				{
-				ping->png_raw_txlastbeam[i] = 0;/* last beam number in this TX pulse */
-				ping->png_raw_txtiltangle[i] = 0;/* tilt angle (0.01 deg) */
-				ping->png_raw_txheading[i] = 0;	/* heading (0.01 deg) */
-				ping->png_raw_txroll[i] = 0;	/* roll (0.01 deg) */
-				ping->png_raw_txpitch[i] = 0;	/* pitch angle (0.01 deg) */
-				ping->png_raw_txheave[i] = 0;	/* heave (0.01 m) */
-				}
-			for (i=0;i<MBSYS_SIMRAD2_MAXBEAMS;i++)
-		    		{
-				ping->png_raw_rxrange[i] = 0;
-					/* Ranges as raw two way travel times in time
-						units defined as one-fourth the inverse
-						sampling rate. These values have not
-						been corrected for changes in the
-						heave during the ping cycle. */
-				ping->png_raw_rxquality[i] = 0;	/* beam quality flag */
-				ping->png_raw_rxwindow[i] = 0;	/* length of detection window */
-				ping->png_raw_rxamp[i] = 0;		/* 0.5 dB */
-				ping->png_raw_rxbeam_num[i] = 0;
-					/* beam 128 is first beam on
-					    second head of EM3000D */
-				ping->png_raw_rxpointangle[i] = 0;
-					/* Raw beam pointing angles in 0.01 degree,
-						positive to port.
-						These values are relative to the transducer
-						array and have not been corrected
-						for vessel motion. */
-				ping->png_raw_rxtiltangle[i] = 0;
-					/* Raw transmit tilt angles in 0.01 degree,
-						positive forward.
-						These values are relative to the transducer
-						array and have not been corrected
-						for vessel motion. */
-				ping->png_raw_rxheading[i] = 0;	/* heading (0.01 deg) */
-				ping->png_raw_rxroll[i] = 0;	/* roll (0.01 deg) */
-				ping->png_raw_rxpitch[i] = 0;	/* pitch angle (0.01 deg) */
-				ping->png_raw_rxheave[i] = 0;	/* heave (0.01 m) */
-		    		}
-
-			/* raw travel time and angle data version 3 */
-			ping->png_raw3_read = 0;	/* flag indicating actual reading of newer rawbeam record */
-			ping->png_raw3_date = 0;	/* date = year*10000 + month*100 + day
-					    Feb 26, 1995 = 19950226 */
-			ping->png_raw3_msec = 0;	/* time since midnight in msec
-					    08:12:51.234 = 29570234 */
-			ping->png_raw3_count = 0;	/* sequential counter or input identifier */
-			ping->png_raw3_serial = 0;	/* system 1 or system 2 serial number */
-			ping->png_raw3_ntx = 0;		/* number of TX pulses (1 to 9) */
-			ping->png_raw3_nbeams = 0;		/* number of raw travel times and angles
-						    - nonzero only if raw beam record read */
-			ping->png_raw3_sample_rate = 0;	/* sampling rate (Hz or 0.01 Hz) */
-			ping->png_raw3_xducer_depth = 0;	/* transmit transducer depth (0.01 m) */
-			ping->png_raw3_ssv = 0;		/* sound speed at transducer (0.1 m/sec) */
-			ping->png_raw3_nbeams_max = 0;	/* maximum number of beams possible */
-			for (i=0;i<MBSYS_SIMRAD2_MAXTX;i++)
-				{
-				ping->png_raw3_txtiltangle[i] = 0;/* tilt angle (0.01 deg) */
-				ping->png_raw3_txfocus[i] = 0;   /* focus range (0.1 m)
-										0 = no focus */
-				ping->png_raw3_txsignallength[i] = 0;	/* signal length (usec) */
-				ping->png_raw3_txoffset[i] = 0;	/* transmit time offset (usec) */
-				ping->png_raw3_txcenter[i] = 0;	/* center frequency (Hz) */
-				ping->png_raw3_txbandwidth[i] = 0;	/* bandwidth (10 Hz) */
-				ping->png_raw3_txwaveform[i] = 0;	/* signal waveform identifier
-											0 = CW, 1 = FM */
-				ping->png_raw3_txsector[i] = 0;	/* transmit sector number (0-19) */
-		    		}
-			for (i=0;i<MBSYS_SIMRAD2_MAXBEAMS;i++)
-		    		{
-				ping->png_raw3_rxpointangle[i] = 0;;
-						/* Raw beam pointing angles in 0.01 degree,
-							positive to port.
-							These values are relative to the transducer
-							array and have not been corrected
-							for vessel motion. */
-				ping->png_raw3_rxrange[i] = 0;;	/* Ranges (0.25 samples) */
-				ping->png_raw3_rxsector[i] = 0;;	/* transmit sector identifier */
-				ping->png_raw3_rxamp[i] = 0;;		/* 0.5 dB */
-				ping->png_raw3_rxquality[i] = 0;;	/* beam quality flag */
-				ping->png_raw3_rxwindow[i] = 0;;	/* length of detection window */
-				ping->png_raw3_rxbeam_num[i] = 0;;
-						/* beam 128 is first beam on
-						    second head of EM3000D */
-				ping->png_raw3_rxspare[i] = 0;;	/* spare */
-		    		}
-
-			/* sidescan */
-			ping->png_ss_read = MB_NO;
-					/* flag indicating actual reading of sidescan record */
-			ping->png_ss_count = 0;
-					/* sequential counter or input identifier */
-			ping->png_ss_serial = 0;
-					/* system 1 or system 2 serial number */
-			ping->png_max_range = 0;
-					/* max range of ping in number of samples */
-			ping->png_r_zero = 0;
-					/* range to normal incidence used in TVG
-					    (R0 predicted) in samples */
-			ping->png_r_zero_corr = 0;
-					/* range to normal incidence used to correct
-					    sample amplitudes in number of samples */
-			ping->png_tvg_start = 0;
-					/* start sample of TVG ramp if not enough
-					    dynamic range (0 otherwise) */
-			ping->png_tvg_stop = 0;	\
-					/* stop sample of TVG ramp if not enough
-					    dynamic range (0 otherwise) */
-			ping->png_bsn = 0;
-					/* normal incidence backscatter (BSN) in dB */
-			ping->png_bso = 0;
-					/* oblique incidence backscatter (BSO) in dB */
-			ping->png_tx = 0;
-					/* Tx beamwidth in 0.1 degree */
-			ping->png_tvg_crossover = 0;
-					/* TVG law crossover angle in degrees */
-			ping->png_nbeams_ss = 0;
-					/* number of beams with sidescan */
-			for (i=0;i<MBSYS_SIMRAD2_MAXBEAMS;i++)
-			    {
-			    ping->png_beam_index[i] = 0;
-					/* beam index number */
-			    ping->png_sort_direction[i] = 0;
-					/* sorting direction - first sample in beam has lowest
-					    range if 1, highest if -1. */
-			    ping->png_beam_samples[i] = 0;
-					/* number of sidescan samples derived from
-						each beam */
-			    ping->png_start_sample[i] = 0;
-					/* start sample number */
-			    ping->png_center_sample[i] = 0;
-					/* center sample number */
-			    }
-			for (i=0;i<MBSYS_SIMRAD2_MAXRAWPIXELS;i++)
-			    {
-			    ping->png_ssraw[i] = EM2_INVALID_AMP;
-					/* the raw sidescan ordered port to starboard */
-			    }
-			ping->png_pixel_size = 0;
-			ping->png_pixels_ss = 0;
-			for (i=0;i<MBSYS_SIMRAD2_MAXPIXELS;i++)
-			    {
-			    ping->png_ss[i] = EM2_INVALID_AMP;
-					/* the processed sidescan ordered port to starboard */
-			    ping->png_ssalongtrack[i] = EM2_INVALID_AMP;
-					/* the processed sidescan alongtrack distances
-						in distance resolution units */
-			    }
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-
-/*--------------------------------------------------------------------*/
-int mbsys_simrad2_wc_alloc(int verbose,
-			void *mbio_ptr, void *store_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_wc_survey_alloc";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_simrad2_struct *store;
-	struct mbsys_simrad2_watercolumn_struct *wc;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_simrad2_struct *) store_ptr;
-
-	/* allocate memory for data structure if needed */
-	if (store->wc == NULL)
-		status = mb_mallocd(verbose,__FILE__, __LINE__,
-			sizeof(struct mbsys_simrad2_watercolumn_struct),
-			(void **)&(store->wc),error);
-
-	if (status == MB_SUCCESS)
-		{
-
-		/* get data structure pointer */
-		wc = (struct mbsys_simrad2_watercolumn_struct *) store->wc;
-
-		/* initialize everything */
-		wc->wtc_date = 0;	/* date = year*10000 + month*100 + day
-				    Feb 26, 1995 = 19950226 */
-		wc->wtc_msec = 0;	/* time since midnight in msec
-				    08:12:51.234 = 29570234 */
-		wc->wtc_count = 0;	/* sequential counter or input identifier */
-		wc->wtc_serial = 0;	/* system 1 or system 2 serial number */
-		wc->wtc_ndatagrams = 0;	/* number of datagrams used to represent
-						the water column for this ping */
-		wc->wtc_datagram = 0;	/* number this datagram */
-		wc->wtc_ntx = 0;	/* number of transmit sectors */
-		wc->wtc_nrx = 0;	/* number of receive beams */
-		wc->wtc_nbeam = 0;	/* number of beams in this datagram */
-		wc->wtc_ssv = 0;	/* sound speed at transducer (0.1 m/sec) */
-		wc->wtc_sfreq = 0;	/* sampling frequency (0.01 Hz) */
-		wc->wtc_heave = 0;	/* tx time heave at transducer (0.01 m) */
-		wc->wtc_spare1 = 0;	/* spare */
-		wc->wtc_spare2 = 0;	/* spare */
-		wc->wtc_spare3 = 0;	/* spare */
-		for (i=0;i<MBSYS_SIMRAD2_MAXTX;i++)
-			{
-			wc->wtc_txtiltangle[i] = 0;	/* tilt angle (0.01 deg) */
-			wc->wtc_txcenter[i] = 0;	/* center frequency (Hz) */
-			wc->wtc_txsector[i] = 0;	/* transmit sector number (0-19) */
-			}
-		for (i=0;i<MBSYS_SIMRAD2_MAXBEAMS;i++)
-			{
-			wc->beam[i].wtc_rxpointangle = 0;	/* Beam pointing angles in 0.01 degree,
-									positive to port. These values are roll stabilized. */
-			wc->beam[i].wtc_start_sample = 0;	/* start sample number */
-			wc->beam[i].wtc_beam_samples = 0;	/* number of water column samples derived from
-									each beam */
-			wc->beam[i].wtc_sector = 0;		/* transmit sector identifier */
-			wc->beam[i].wtc_beam = 0;  		/* beam 128 is first beam on
-				  	  				second head of EM3000D */
-			for (j=0;j<MBSYS_SIMRAD2_MAXRAWPIXELS;j++)
-				wc->beam[i].wtc_amp[j] = 0;	/* water column amplitude (dB) */
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbsys_simrad2_attitude_alloc(int verbose,
-			void *mbio_ptr, void *store_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_simrad2_attitude_alloc";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_simrad2_struct *store;
-	struct mbsys_simrad2_attitude_struct *attitude;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_simrad2_struct *) store_ptr;
-
-	/* allocate memory for data structure if needed */
-	if (store->attitude == NULL)
-		status = mb_mallocd(verbose,__FILE__, __LINE__,
-			sizeof(struct mbsys_simrad2_attitude_struct),
-			(void **)&(store->attitude),error);
-
-	if (status == MB_SUCCESS)
-		{
-
-		/* get data structure pointer */
-		attitude = (struct mbsys_simrad2_attitude_struct *) store->attitude;
-
-		/* initialize everything */
-		attitude->att_date = 0;
-				/* date = year*10000 + month*100 + day
-				    Feb 26, 1995 = 19950226 */
-		attitude->att_msec = 0;
-				/* time since midnight in msec
-				    08:12:51.234 = 29570234 */
-		attitude->att_count = 0;
-				/* sequential counter or input identifier */
-		attitude->att_serial = 0;
-				/* system 1 or system 2 serial number */
-		attitude->att_ndata = 0;
-				/* number of attitude data */
-		for (i=0;i<MBSYS_SIMRAD2_MAXATTITUDE;i++)
-		    {
-		    attitude->att_time[i] = 0;
-				/* time since record start (msec) */
-		    attitude->att_sensor_status[i] = 0;
-				/* see note 12 above */
-		    attitude->att_roll[i] = 0;
-				/* roll (0.01 degree) */
-		    attitude->att_pitch[i] = 0;
-				/* pitch (0.01 degree) */
-		    attitude->att_heave[i] = 0;
-				/* heave (cm) */
-		    attitude->att_heading[i] = 0;
-				/* heading (0.01 degree) */
-		    }
-		attitude->att_heading_status = 0;
-				/* heading status (0=inactive) */
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_simrad2_heading_alloc(int verbose,
-			void *mbio_ptr, void *store_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_simrad2_heading_alloc";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_simrad2_struct *store;
-	struct mbsys_simrad2_heading_struct *heading;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_simrad2_struct *) store_ptr;
-
-	/* allocate memory for data structure if needed */
-	if (store->heading == NULL)
-		status = mb_mallocd(verbose,__FILE__, __LINE__,
-			sizeof(struct mbsys_simrad2_heading_struct),
-			(void **)&(store->heading),error);
-
-	if (status == MB_SUCCESS)
-		{
-
-		/* get data structure pointer */
-		heading = (struct mbsys_simrad2_heading_struct *) store->heading;
-
-		/* initialize everything */
-		heading->hed_date = 0;
-				/* date = year*10000 + month*100 + day
-				    Feb 26, 1995 = 19950226 */
-		heading->hed_msec = 0;
-				/* time since midnight in msec
-				    08:12:51.234 = 29570234 */
-		heading->hed_count = 0;
-				/* sequential counter or input identifier */
-		heading->hed_serial = 0;
-				/* system 1 or system 2 serial number */
-		heading->hed_ndata = 0;
-				/* number of heading data */
-		for (i=0;i<MBSYS_SIMRAD2_MAXHEADING;i++)
-		    {
-		    heading->hed_time[i] = 0;
-				/* time since record start (msec) */
-		    heading->hed_heading[i] = 0;
-				/* heading (0.01 degree) */
-		    }
-		heading->hed_heading_status = 0;
-				/* heading status (0=inactive) */
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_simrad2_ssv_alloc(int verbose,
-			void *mbio_ptr, void *store_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_simrad2_ssv_alloc";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_simrad2_struct *store;
-	struct mbsys_simrad2_ssv_struct *ssv;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_simrad2_struct *) store_ptr;
-
-	/* allocate memory for data structure if needed */
-	if (store->ssv == NULL)
-		status = mb_mallocd(verbose,__FILE__, __LINE__,
-			sizeof(struct mbsys_simrad2_ssv_struct),
-			(void **)&(store->ssv),error);
-
-	if (status == MB_SUCCESS)
-		{
-
-		/* get data structure pointer */
-		ssv = (struct mbsys_simrad2_ssv_struct *) store->ssv;
-
-		/* initialize everything */
-		ssv->ssv_date = 0;
-				/* date = year*10000 + month*100 + day
-				    Feb 26, 1995 = 19950226 */
-		ssv->ssv_msec = 0;
-				/* time since midnight in msec
-				    08:12:51.234 = 29570234 */
-		ssv->ssv_count = 0;
-				/* sequential counter or input identifier */
-		ssv->ssv_serial = 0;
-				/* system 1 or system 2 serial number */
-		ssv->ssv_ndata = 0;
-				/* number of ssv data */
-		for (i=0;i<MBSYS_SIMRAD2_MAXTILT;i++)
-		    {
-		    ssv->ssv_time[i] = 0;
-				/* time since record start (msec) */
-		    ssv->ssv_ssv[i] = 0;
-				/* ssv (0.1 m/s) */
-		    }
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_simrad2_tilt_alloc(int verbose,
-			void *mbio_ptr, void *store_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_simrad2_tilt_alloc";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_simrad2_struct *store;
-	struct mbsys_simrad2_tilt_struct *tilt;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_simrad2_struct *) store_ptr;
-
-	/* allocate memory for data structure if needed */
-	if (store->tilt == NULL)
-		status = mb_mallocd(verbose,__FILE__, __LINE__,
-			sizeof(struct mbsys_simrad2_tilt_struct),
-			(void **)&(store->tilt),error);
-
-	if (status == MB_SUCCESS)
-		{
-
-		/* get data structure pointer */
-		tilt = (struct mbsys_simrad2_tilt_struct *) store->tilt;
-
-		/* initialize everything */
-		tilt->tlt_date = 0;
-				/* date = year*10000 + month*100 + day
-				    Feb 26, 1995 = 19950226 */
-		tilt->tlt_msec = 0;
-				/* time since midnight in msec
-				    08:12:51.234 = 29570234 */
-		tilt->tlt_count = 0;
-				/* sequential counter or input identifier */
-		tilt->tlt_serial = 0;
-				/* system 1 or system 2 serial number */
-		tilt->tlt_ndata = 0;
-				/* number of tilt data */
-		for (i=0;i<MBSYS_SIMRAD2_MAXTILT;i++)
-		    {
-		    tilt->tlt_time[i] = 0;
-				/* time since record start (msec) */
-		    tilt->tlt_tilt[i] = 0;
-				/* tilt + forward (0.01 deg) */
-		    }
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_simrad2_deall(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_simrad2_deall";
-	int	status = MB_SUCCESS;
-	struct mbsys_simrad2_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)*store_ptr);
-		}
-
-	/* get data structure pointer */
-	store = (struct mbsys_simrad2_struct *) *store_ptr;
-
-	/* deallocate memory for survey data structure */
-	if (store->ping != NULL)
-		status = mb_freed(verbose,__FILE__, __LINE__,(void **)&(store->ping),error);
-
-	/* deallocate memory for survey data structure */
-	if (store->ping2 != NULL)
-		status = mb_freed(verbose,__FILE__, __LINE__,(void **)&(store->ping2),error);
-
-	/* deallocate memory for water column data structure */
-	if (store->wc != NULL)
-		status = mb_freed(verbose,__FILE__, __LINE__,(void **)&(store->wc),error);
-
-	/* deallocate memory for attitude data structure */
-	if (store->attitude != NULL)
-		status = mb_freed(verbose,__FILE__, __LINE__,(void **)&(store->attitude),error);
-
-	/* deallocate memory for heading data structure */
-	if (store->heading != NULL)
-		status = mb_freed(verbose,__FILE__, __LINE__,(void **)&(store->heading),error);
-
-	/* deallocate memory for ssv data structure */
-	if (store->ssv != NULL)
-		status = mb_freed(verbose,__FILE__, __LINE__,(void **)&(store->ssv),error);
-
-	/* deallocate memory for tilt data structure */
-	if (store->tilt != NULL)
-		status = mb_freed(verbose,__FILE__, __LINE__,(void **)&(store->tilt),error);
-
-	/* deallocate memory for data structure */
-	status = mb_freed(verbose,__FILE__, __LINE__,(void **)store_ptr,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_simrad2_zero_ss(int verbose, void *store_ptr, int *error)
-{
-	char	*function_name = "mbsys_simrad2_zero_ss";
-	int	status = MB_SUCCESS;
-	struct mbsys_simrad2_struct *store;
-	struct mbsys_simrad2_ping_struct *ping;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to data descriptor */
-	store = (struct mbsys_simrad2_struct *) store_ptr;
-	if (store != NULL)
-	    ping = (struct mbsys_simrad2_ping_struct *) store->ping;
-
-	/* initialize all sidescan stuff to zeros */
-	if (store->ping != NULL)
-		{
-		ping->png_ss_date = 0;
-				/* date = year*10000 + month*100 + day
-				    Feb 26, 1995 = 19950226 */
-		ping->png_ss_msec = 0;
-				/* time since midnight in msec
-				    08:12:51.234 = 29570234 */
-		ping->png_ss_count = 0;
-				/* sequential counter or input identifier */
-		ping->png_ss_serial = 0;
-				/* system 1 or system 2 serial number */
-		ping->png_max_range = 0;
-				/* max range of ping in number of samples */
-		ping->png_r_zero = 0;
-				/* range to normal incidence used in TVG
-				    (R0 predicted) in samples */
-		ping->png_r_zero_corr = 0;
-				/* range to normal incidence used to correct
-				    sample amplitudes in number of samples */
-		ping->png_tvg_start = 0;
-				/* start sample of TVG ramp if not enough
-				    dynamic range (0 otherwise) */
-		ping->png_tvg_stop = 0;	\
-				/* stop sample of TVG ramp if not enough
-				    dynamic range (0 otherwise) */
-		ping->png_bsn = 0;
-				/* normal incidence backscatter (BSN) in dB */
-		ping->png_bso = 0;
-				/* oblique incidence backscatter (BSO) in dB */
-		ping->png_tx = 0;
-				/* Tx beamwidth in 0.1 degree */
-		ping->png_tvg_crossover = 0;
-				/* TVG law crossover angle in degrees */
-		ping->png_nbeams_ss = 0;
-				/* number of beams with sidescan */
-		ping->png_npixels = 0;
-				/* number of pixels of sidescan */
-		for (i=0;i<MBSYS_SIMRAD2_MAXBEAMS;i++)
-		    {
-		    ping->png_beam_index[i] = 0;
-				/* beam index number */
-		    ping->png_sort_direction[i] = 0;
-				/* sorting direction - first sample in beam has lowest
-				    range if 1, highest if -1. */
-		    ping->png_beam_samples[i] = 0;
-				/* number of sidescan samples derived from
-					each beam */
-		    ping->png_start_sample[i] = 0;
-				/* start sample number */
-		    ping->png_center_sample[i] = 0;
-				/* center sample number */
-		    }
-		for (i=0;i<MBSYS_SIMRAD2_MAXRAWPIXELS;i++)
-		    {
-		    ping->png_ssraw[i] = EM2_INVALID_AMP;
-				/* the sidescan ordered port to starboard */
-		    }
-		for (i=0;i<MBSYS_SIMRAD2_MAXPIXELS;i++)
-		    {
-		    ping->png_ss[i] = EM2_INVALID_AMP;
-				/* the sidescan ordered port to starboard */
-		    ping->png_ssalongtrack[i] = EM2_INVALID_AMP;
-				/* the sidescan ordered port to starboard */
-		    }
-		}
-
-	/* assume success */
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_simrad2_dimensions(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int *nbath, int *namp, int *nss, int *error)
-{
-	char	*function_name = "mbsys_simrad2_dimensions";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_simrad2_struct *store;
-	struct mbsys_simrad2_ping_struct *ping;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_simrad2_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get beam and pixel numbers */
-		ping = (struct mbsys_simrad2_ping_struct *) store->ping;
-		*nbath = ping->png_nbeams_max;
-		*namp = *nbath;
-		*nss = MBSYS_SIMRAD2_MAXPIXELS;
-
-		/* double it for the EM3002 */
-		if (store->sonar == MBSYS_SIMRAD2_EM3002)
-			{
-			ping = (struct mbsys_simrad2_ping_struct *) store->ping2;
-			*nbath += ping->png_nbeams_max;
-			*namp = *nbath;
-			*nss += MBSYS_SIMRAD2_MAXPIXELS;
-			}
-		}
-	else
-		{
-		/* get beam and pixel numbers */
-		*nbath = 0;
-		*namp = 0;
-		*nss = 0;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		fprintf(stderr,"dbg2       nbath:      %d\n",*nbath);
-		fprintf(stderr,"dbg2        namp:      %d\n",*namp);
-		fprintf(stderr,"dbg2        nss:       %d\n",*nss);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_simrad2_pingnumber(int verbose, void *mbio_ptr,
-		int *pingnumber, int *error)
-{
-	char	*function_name = "mbsys_simrad2_pingnumber";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_simrad2_struct *store;
-	struct mbsys_simrad2_ping_struct *ping;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_simrad2_struct *) mb_io_ptr->store_data;
-
-	/* extract data from structure */
-	ping = (struct mbsys_simrad2_ping_struct *) store->ping;
-	*pingnumber = ping->png_count;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       pingnumber: %d\n",*pingnumber);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_simrad2_extract(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int time_i[7], double *time_d,
-		double *navlon, double *navlat,
-		double *speed, double *heading,
-		int *nbath, int *namp, int *nss,
-		char *beamflag, double *bath, double *amp,
-		double *bathacrosstrack, double *bathalongtrack,
-		double *ss, double *ssacrosstrack, double *ssalongtrack,
-		char *comment, int *error)
-{
-	char	*function_name = "mbsys_simrad2_extract";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_simrad2_struct *store;
-	struct mbsys_simrad2_ping_struct *ping;
-	double	depthscale, depthoffset;
-	double	dacrscale, daloscale, reflscale;
-	double	pixel_size;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_simrad2_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get survey data structure */
-		ping = (struct mbsys_simrad2_ping_struct *) store->ping;
-
-		/* get time */
-		time_i[0] = ping->png_date / 10000;
-		time_i[1] = (ping->png_date % 10000) / 100;
-		time_i[2] = ping->png_date % 100;
-		time_i[3] = ping->png_msec / 3600000;
-		time_i[4] = (ping->png_msec % 3600000) / 60000;
-		time_i[5] = (ping->png_msec % 60000) / 1000;
-		time_i[6] = (ping->png_msec % 1000) * 1000;
-		mb_get_time(verbose,time_i,time_d);
-
-		/* get navigation */
-		if (ping->png_longitude != EM2_INVALID_INT)
-		    *navlon = 0.0000001 * ping->png_longitude;
-		else
-		    *navlon = 0.0;
-		if (ping->png_latitude != EM2_INVALID_INT)
-		    *navlat = 0.00000005 * ping->png_latitude;
-		else
-		    *navlat = 0.0;
-
-		/* get heading */
-		*heading = 0.01 * ping->png_heading;
-
-		/* get speed  */
-		if (ping->png_speed != EM2_INVALID_SHORT)
-			*speed = 0.036 * ping->png_speed;
-		else
-			*speed = 0.0;
-
-		/* set beamwidths in mb_io structure */
-		if (store->run_tran_beam > 0 && store->run_tran_beam < 30)
-		    mb_io_ptr->beamwidth_ltrack
-			= 0.1 * store->run_tran_beam;
-		else if (ping->png_tx > 0)
-		    {
-		    mb_io_ptr->beamwidth_ltrack
-			= 0.1 * ping->png_tx;
-		    }
-		else if (store->sonar == MBSYS_SIMRAD2_EM120)
-		    mb_io_ptr->beamwidth_ltrack = 2.0;
-		else if (store->sonar == MBSYS_SIMRAD2_EM300)
-		    mb_io_ptr->beamwidth_ltrack = 2.0;
-		else if (store->sonar == MBSYS_SIMRAD2_EM1002)
-		    mb_io_ptr->beamwidth_ltrack = 2.0;
-		else if (store->sonar == MBSYS_SIMRAD2_EM2000)
-		    mb_io_ptr->beamwidth_ltrack = 1.5;
-		else if (store->sonar == MBSYS_SIMRAD2_EM3000
-			|| store->sonar == MBSYS_SIMRAD2_EM3000D_1
-			|| store->sonar == MBSYS_SIMRAD2_EM3000D_2
-			|| store->sonar == MBSYS_SIMRAD2_EM3000D_3
-			|| store->sonar == MBSYS_SIMRAD2_EM3000D_4
-			|| store->sonar == MBSYS_SIMRAD2_EM3000D_5
-			|| store->sonar == MBSYS_SIMRAD2_EM3000D_6
-			|| store->sonar == MBSYS_SIMRAD2_EM3000D_7
-			|| store->sonar == MBSYS_SIMRAD2_EM3000D_8
-			|| store->sonar == MBSYS_SIMRAD2_EM3002)
-		    mb_io_ptr->beamwidth_ltrack = 1.5;
-		else if (store->sonar == MBSYS_SIMRAD2_EM1000)
-		    mb_io_ptr->beamwidth_ltrack = 3.3;
-		else if (store->sonar == MBSYS_SIMRAD2_EM12S
-			|| store->sonar == MBSYS_SIMRAD2_EM12D)
-		    mb_io_ptr->beamwidth_ltrack = 1.7;
-		else if (store->sonar == MBSYS_SIMRAD2_EM121)
-		    {
-		    mb_io_ptr->beamwidth_ltrack = 1.0;
-		    }
-		if (store->run_rec_beam > 0 && store->run_rec_beam < 30)
-		    {
-		    mb_io_ptr->beamwidth_xtrack
-			= 0.1 * store->run_rec_beam;
-		    }
-		else if (store->sonar == MBSYS_SIMRAD2_EM120)
-		    mb_io_ptr->beamwidth_xtrack = 2.0;
-		else if (store->sonar == MBSYS_SIMRAD2_EM300)
-		    mb_io_ptr->beamwidth_xtrack = 2.0;
-		else if (store->sonar == MBSYS_SIMRAD2_EM1002)
-		    mb_io_ptr->beamwidth_xtrack = 2.0;
-		else if (store->sonar == MBSYS_SIMRAD2_EM2000)
-		    mb_io_ptr->beamwidth_xtrack = 1.5;
-		else if (store->sonar == MBSYS_SIMRAD2_EM3000
-			|| store->sonar == MBSYS_SIMRAD2_EM3000D_1
-			|| store->sonar == MBSYS_SIMRAD2_EM3000D_2
-			|| store->sonar == MBSYS_SIMRAD2_EM3000D_3
-			|| store->sonar == MBSYS_SIMRAD2_EM3000D_4
-			|| store->sonar == MBSYS_SIMRAD2_EM3000D_5
-			|| store->sonar == MBSYS_SIMRAD2_EM3000D_6
-			|| store->sonar == MBSYS_SIMRAD2_EM3000D_7
-			|| store->sonar == MBSYS_SIMRAD2_EM3000D_8
-			|| store->sonar == MBSYS_SIMRAD2_EM3002)
-		    mb_io_ptr->beamwidth_xtrack = 1.5;
-		else if (store->sonar == MBSYS_SIMRAD2_EM1000)
-		    mb_io_ptr->beamwidth_xtrack = 3.3;
-		else if (store->sonar == MBSYS_SIMRAD2_EM12S
-			|| store->sonar == MBSYS_SIMRAD2_EM12D)
-		    mb_io_ptr->beamwidth_xtrack = 3.5;
-		else if (store->sonar == MBSYS_SIMRAD2_EM121)
-		    mb_io_ptr->beamwidth_xtrack = mb_io_ptr->beamwidth_ltrack;
-
-		/* read distance and depth values into storage arrays */
-		depthscale = 0.01 * ping->png_depth_res;
-		depthoffset = 0.01 * ping->png_xducer_depth
-				+ 655.36 * ping->png_offset_multiplier;
-
-		dacrscale  = 0.01 * ping->png_distance_res;
-		daloscale  = 0.01 * ping->png_distance_res;
-		reflscale  = 0.5;
-		*nbath = 0;
-		for (j=0;j<MBSYS_SIMRAD2_MAXBEAMS;j++)
-			{
-			bath[j] = 0.0;
-			beamflag[j] = MB_FLAG_NULL;
-			amp[j] = 0.0;
-			bathacrosstrack[j] = 0.0;
-			bathalongtrack[j] = 0.0;
-			}
-		for (i=0;i<ping->png_nbeams;i++)
-			{
-			j = ping->png_beam_num[i] - 1;
-			bath[j] = depthscale * ping->png_depth[i]
-				    + depthoffset;
-			beamflag[j] = ping->png_beamflag[i];
-			bathacrosstrack[j]
-				= dacrscale * ping->png_acrosstrack[i];
-			bathalongtrack[j]
-				= daloscale * ping->png_alongtrack[i];
-			amp[j] = reflscale * ping->png_amp[i];
-			}
-		*nbath = ping->png_nbeams_max;
-		*namp = *nbath;
-		*nss = MBSYS_SIMRAD2_MAXPIXELS;
-		pixel_size = 0.01 * ping->png_pixel_size;
-		for (i=0;i<MBSYS_SIMRAD2_MAXPIXELS;i++)
-			{
-			if (ping->png_ss[i] != EM2_INVALID_AMP)
-				{
-				ss[i] = 0.01 * ping->png_ss[i];
-				ssacrosstrack[i] = pixel_size
-						* (i - MBSYS_SIMRAD2_MAXPIXELS / 2);
-				ssalongtrack[i] = daloscale * ping->png_ssalongtrack[i];
-				}
-			else
-				{
-				ss[i] = MB_SIDESCAN_NULL;
-				ssacrosstrack[i] = pixel_size
-						* (i - MBSYS_SIMRAD2_MAXPIXELS / 2);
-				ssalongtrack[i] = 0.0;
-				}
-			}
-
-		/* deal with second head in case of EM3002 */
-		if (store->sonar == MBSYS_SIMRAD2_EM3002
-			&& store->numberheads == 2
-			&& store->ping2 != NULL
-			&& store->ping2->png_count == ping->png_count)
-			{
-			/* get survey data structure */
-			ping = (struct mbsys_simrad2_ping_struct *) store->ping2;
-
-			/* read distance and depth values into storage arrays */
-			depthscale = 0.01 * ping->png_depth_res;
-			depthoffset = 0.01 * ping->png_xducer_depth
-					+ 655.36 * ping->png_offset_multiplier;
-
-			dacrscale  = 0.01 * ping->png_distance_res;
-			daloscale  = 0.01 * ping->png_distance_res;
-			reflscale  = 0.5;
-			for (j=*nbath;j<2*MBSYS_SIMRAD2_MAXBEAMS;j++)
-				{
-				bath[j] = 0.0;
-				beamflag[j] = MB_FLAG_NULL;
-				amp[j] = 0.0;
-				bathacrosstrack[j] = 0.0;
-				bathalongtrack[j] = 0.0;
-				}
-			for (i=0;i<ping->png_nbeams;i++)
-				{
-				j = *nbath + ping->png_beam_num[i] - 1;
-				bath[j] = depthscale * ping->png_depth[i]
-					    + depthoffset;
-				beamflag[j] = ping->png_beamflag[i];
-				bathacrosstrack[j]
-					= dacrscale * ping->png_acrosstrack[i];
-				bathalongtrack[j]
-					= daloscale * ping->png_alongtrack[i];
-				amp[j] = reflscale * ping->png_amp[i];
-				}
-			*nbath += ping->png_nbeams_max;
-			*namp = *nbath;
-			pixel_size = 0.01 * ping->png_pixel_size;
-			for (i=0;i<MBSYS_SIMRAD2_MAXPIXELS;i++)
-				{
-				j = *nss + i;
-				if (ping->png_ss[i] != EM2_INVALID_AMP)
-					{
-					ss[j] = 0.01 * ping->png_ss[i];
-					ssacrosstrack[j] = pixel_size
-							* (i - MBSYS_SIMRAD2_MAXPIXELS / 2);
-					ssalongtrack[j] = daloscale * ping->png_ssalongtrack[i];
-					}
-				else
-					{
-					ss[j] = MB_SIDESCAN_NULL;
-					ssacrosstrack[j] = pixel_size
-							* (i - MBSYS_SIMRAD2_MAXPIXELS / 2);
-					ssalongtrack[j] = 0.0;
-					}
-				}
-			*nss += MBSYS_SIMRAD2_MAXPIXELS;
-			}
-
-		/* print debug statements */
-		if (verbose >= 5)
-			{
-			fprintf(stderr,"\ndbg4  Data extracted by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  Extracted values:\n");
-			fprintf(stderr,"dbg4       kind:       %d\n",
-				*kind);
-			fprintf(stderr,"dbg4       error:      %d\n",
-				*error);
-			fprintf(stderr,"dbg4       time_i[0]:  %d\n",
-				time_i[0]);
-			fprintf(stderr,"dbg4       time_i[1]:  %d\n",
-				time_i[1]);
-			fprintf(stderr,"dbg4       time_i[2]:  %d\n",
-				time_i[2]);
-			fprintf(stderr,"dbg4       time_i[3]:  %d\n",
-				time_i[3]);
-			fprintf(stderr,"dbg4       time_i[4]:  %d\n",
-				time_i[4]);
-			fprintf(stderr,"dbg4       time_i[5]:  %d\n",
-				time_i[5]);
-			fprintf(stderr,"dbg4       time_i[6]:  %d\n",
-				time_i[6]);
-			fprintf(stderr,"dbg4       time_d:     %f\n",
-				*time_d);
-			fprintf(stderr,"dbg4       longitude:  %f\n",
-				*navlon);
-			fprintf(stderr,"dbg4       latitude:   %f\n",
-				*navlat);
-			fprintf(stderr,"dbg4       speed:      %f\n",
-				*speed);
-			fprintf(stderr,"dbg4       heading:    %f\n",
-				*heading);
-			fprintf(stderr,"dbg4       nbath:      %d\n",
-				*nbath);
-			for (i=0;i<*nbath;i++)
-			  fprintf(stderr,"dbg4       beam:%d  flag:%3d  bath:%f  acrosstrack:%f  alongtrack:%f\n",
-				i,beamflag[i],bath[i],
-				bathacrosstrack[i],bathalongtrack[i]);
-			fprintf(stderr,"dbg4        namp:     %d\n",
-				*namp);
-			for (i=0;i<*namp;i++)
-			  fprintf(stderr,"dbg4        beam:%d   amp:%f  acrosstrack:%f  alongtrack:%f\n",
-				i,amp[i],bathacrosstrack[i],bathalongtrack[i]);
-			fprintf(stderr,"dbg4        nss:      %d\n",
-				*nss);
-			for (i=0;i<*nss;i++)
-			  fprintf(stderr,"dbg4        pixel:%d   ss:%f  acrosstrack:%f  alongtrack:%f\n",
-				i,ss[i],ssacrosstrack[i],ssalongtrack[i]);
-			}
-
-		/* done translating values */
-
-		}
-
-	/* extract data from structure */
-	else if (*kind == MB_DATA_NAV
-		|| *kind == MB_DATA_NAV1
-		|| *kind == MB_DATA_NAV2
-		|| *kind == MB_DATA_NAV3)
-		{
-		/* get time */
-		time_i[0] = store->pos_date / 10000;
-		time_i[1] = (store->pos_date % 10000) / 100;
-		time_i[2] = store->pos_date % 100;
-		time_i[3] = store->pos_msec / 3600000;
-		time_i[4] = (store->pos_msec % 3600000) / 60000;
-		time_i[5] = (store->pos_msec % 60000) / 1000;
-		time_i[6] = (store->pos_msec % 1000) * 1000;
-		mb_get_time(verbose,time_i,time_d);
-
-		/* get navigation */
-		if (store->pos_longitude != EM2_INVALID_INT)
-		    *navlon = 0.0000001 * store->pos_longitude;
-		else
-		    *navlon = 0.0;
-		if (store->pos_latitude != EM2_INVALID_INT)
-		    *navlat = 0.00000005 * store->pos_latitude;
-		else
-		    *navlat = 0.0;
-
-		/* get heading */
-		*heading = 0.01 * store->pos_heading;
-
-		/* get speed  */
-		if (store->pos_speed != EM2_INVALID_SHORT)
-			*speed = 0.036 * store->pos_speed;
-		else
-			*speed = 0.0;
-
-		*nbath = 0;
-		*namp = 0;
-		*nss = 0;
-
-		/* print debug statements */
-		if (verbose >= 5)
-			{
-			fprintf(stderr,"\ndbg4  Data extracted by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  Extracted values:\n");
-			fprintf(stderr,"dbg4       kind:       %d\n",
-				*kind);
-			fprintf(stderr,"dbg4       error:      %d\n",
-				*error);
-			fprintf(stderr,"dbg4       time_i[0]:  %d\n",
-				time_i[0]);
-			fprintf(stderr,"dbg4       time_i[1]:  %d\n",
-				time_i[1]);
-			fprintf(stderr,"dbg4       time_i[2]:  %d\n",
-				time_i[2]);
-			fprintf(stderr,"dbg4       time_i[3]:  %d\n",
-				time_i[3]);
-			fprintf(stderr,"dbg4       time_i[4]:  %d\n",
-				time_i[4]);
-			fprintf(stderr,"dbg4       time_i[5]:  %d\n",
-				time_i[5]);
-			fprintf(stderr,"dbg4       time_i[6]:  %d\n",
-				time_i[6]);
-			fprintf(stderr,"dbg4       time_d:     %f\n",
-				*time_d);
-			fprintf(stderr,"dbg4       longitude:  %f\n",
-				*navlon);
-			fprintf(stderr,"dbg4       latitude:   %f\n",
-				*navlat);
-			fprintf(stderr,"dbg4       speed:      %f\n",
-				*speed);
-			fprintf(stderr,"dbg4       heading:    %f\n",
-				*heading);
-			}
-
-		/* done translating values */
-
-		}
-
-	/* extract comment from structure */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* copy comment */
-		strncpy(comment,store->par_com,
-			MBSYS_SIMRAD2_COMMENT_LENGTH);
-
-		/* print debug statements */
-		if (verbose >= 4)
-			{
-			fprintf(stderr,"\ndbg4  New ping read by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  New ping values:\n");
-			fprintf(stderr,"dbg4       error:      %d\n",
-				*error);
-			fprintf(stderr,"dbg4       comment:    %s\n",
-				comment);
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind == MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"dbg2       comment:     \ndbg2       %s\n",
-			comment);
-		}
-	else if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind != MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"dbg2       time_i[0]:     %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:     %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:     %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:     %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:     %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:     %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:     %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:        %f\n",*time_d);
-		fprintf(stderr,"dbg2       longitude:     %f\n",*navlon);
-		fprintf(stderr,"dbg2       latitude:      %f\n",*navlat);
-		fprintf(stderr,"dbg2       speed:         %f\n",*speed);
-		fprintf(stderr,"dbg2       heading:       %f\n",*heading);
-		}
-	if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind == MB_DATA_DATA)
-		{
-		fprintf(stderr,"dbg2       nbath:      %d\n",
-			*nbath);
-		for (i=0;i<*nbath;i++)
-		  fprintf(stderr,"dbg2       beam:%d  flag:%3d  bath:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,beamflag[i],bath[i],
-			bathacrosstrack[i],bathalongtrack[i]);
-		fprintf(stderr,"dbg2        namp:     %d\n",
-			*namp);
-		for (i=0;i<*namp;i++)
-		  fprintf(stderr,"dbg2       beam:%d   amp:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,amp[i],bathacrosstrack[i],bathalongtrack[i]);
-		fprintf(stderr,"dbg2        nss:      %d\n",
-			*nss);
-		for (i=0;i<*nss;i++)
-		  fprintf(stderr,"dbg2        pixel:%d   ss:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,ss[i],ssacrosstrack[i],ssalongtrack[i]);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_simrad2_insert(int verbose, void *mbio_ptr, void *store_ptr,
-		int kind, int time_i[7], double time_d,
-		double navlon, double navlat,
-		double speed, double heading,
-		int nbath, int namp, int nss,
-		char *beamflag, double *bath, double *amp,
-		double *bathacrosstrack, double *bathalongtrack,
-		double *ss, double *ssacrosstrack, double *ssalongtrack,
-		char *comment, int *error)
-{
-	char	*function_name = "mbsys_simrad2_insert";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_simrad2_struct *store;
-	struct mbsys_simrad2_ping_struct *ping;
-	struct mbsys_simrad2_ping_struct *ping2;
-	double	depthscale, dacrscale,daloscale,reflscale;
-	double	depthoffset;
-	double	depthmax, distancemax;
-	int	png_depth_res, png_distance_res;
-	int	i0, i1;
-	double	x0, x1;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       kind:       %d\n",kind);
-		}
-	if (verbose >= 2 && (kind == MB_DATA_DATA || kind == MB_DATA_NAV))
-		{
-		fprintf(stderr,"dbg2       time_i[0]:  %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:  %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:  %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:  %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:  %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:  %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:  %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:     %f\n",time_d);
-		fprintf(stderr,"dbg2       navlon:     %f\n",navlon);
-		fprintf(stderr,"dbg2       navlat:     %f\n",navlat);
-		fprintf(stderr,"dbg2       speed:      %f\n",speed);
-		fprintf(stderr,"dbg2       heading:    %f\n",heading);
-		}
-	if (verbose >= 2 && kind == MB_DATA_DATA)
-		{
-		fprintf(stderr,"dbg2       nbath:      %d\n",nbath);
-		if (verbose >= 3)
-		 for (i=0;i<nbath;i++)
-		  fprintf(stderr,"dbg3       beam:%d  flag:%3d  bath:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,beamflag[i],bath[i],
-			bathacrosstrack[i],bathalongtrack[i]);
-		fprintf(stderr,"dbg2       namp:       %d\n",namp);
-		if (verbose >= 3)
-		 for (i=0;i<namp;i++)
-		  fprintf(stderr,"dbg3        beam:%d   amp:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,amp[i],bathacrosstrack[i],bathalongtrack[i]);
-		fprintf(stderr,"dbg2        nss:       %d\n",nss);
-		if (verbose >= 3)
-		 for (i=0;i<nss;i++)
-		  fprintf(stderr,"dbg3        beam:%d   ss:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,ss[i],ssacrosstrack[i],ssalongtrack[i]);
-		}
-	if (verbose >= 2 && kind == MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"dbg2       comment:     \ndbg2       %s\n",
-			comment);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_simrad2_struct *) store_ptr;
-
-	/* set data kind */
-	store->kind = kind;
-
-	/* insert data in structure */
-	if (store->kind == MB_DATA_DATA)
-		{
-		/* get guess at sonar if needed  */
-		if (store->sonar == MBSYS_SIMRAD2_UNKNOWN)
-			{
-			if (nbath <= 87)
-				{
-				store->sonar = MBSYS_SIMRAD2_EM2000;
-				}
-			else if (nbath <= 111)
-				{
-				store->sonar = MBSYS_SIMRAD2_EM1002;
-				}
-			else if (nbath <= 127)
-				{
-				store->sonar = MBSYS_SIMRAD2_EM3000;
-				}
-			else if (nbath <= 135)
-				{
-				store->sonar = MBSYS_SIMRAD2_EM300;
-				}
-			else if (nbath <= 191)
-				{
-				store->sonar = MBSYS_SIMRAD2_EM120;
-				}
-			else if (nbath <= 254)
-				{
-				store->sonar = MBSYS_SIMRAD2_EM3000D_2;
-				}
-			else if (nbath <= 508)
-				{
-				store->sonar = MBSYS_SIMRAD2_EM3002;
-				}
-			}
-
-		/* allocate secondary data structure for
-			survey data if needed */
-		if (store->ping == NULL)
-			{
-			status = mbsys_simrad2_survey_alloc(
-					verbose,mbio_ptr,
-					store_ptr,error);
-			}
-
-		/* get survey data structure */
-		ping = (struct mbsys_simrad2_ping_struct *) store->ping;
-
-		/* get time */
-		ping->png_date = 10000 * time_i[0]
-				    + 100 * time_i[1]
-				    + time_i[2];
-		ping->png_msec = 3600000 * time_i[3]
-				    + 60000 * time_i[4]
-				    + 1000 * time_i[5]
-				    + 0.001 * time_i[6];
-		store->date = ping->png_date;
-		store->msec = ping->png_msec;
-
-		/* get navigation */
-		if (navlon < -180.0)
-			navlon += 360.0;
-		else if (navlon > 180.0)
-			navlon -= 360.0;
-		ping->png_longitude = 10000000 * navlon;
-		ping->png_latitude = 20000000 * navlat;
-
-		/* get heading */
-		ping->png_heading = (int) rint(heading * 100);
-
-		/* get speed  */
-		ping->png_speed = (int) rint(speed / 0.036);
-
-		/* get resolutions if needed  */
-		if (ping->png_depth_res == 0 || ping->png_distance_res == 0)
-			{
-			if (store->sonar == MBSYS_SIMRAD2_EM300 || store->sonar == MBSYS_SIMRAD2_EM120)
-				{
-				ping->png_depth_res = 10; /* kluge */
-				ping->png_distance_res = 10; /* kluge */
-				}
-			else
-				{
-				ping->png_depth_res = 1; /* kluge */
-				ping->png_distance_res = 1; /* kluge */
-				}
-			}
-
-		/* set initial values for resolutions */
-		depthscale = 0.01 * ping->png_depth_res;
-		depthoffset = 0.01 * ping->png_xducer_depth
-				+ 655.36 * ping->png_offset_multiplier;
-		dacrscale  = 0.01 * ping->png_distance_res;
-		daloscale  = 0.01 * ping->png_distance_res;
-		reflscale  = 0.5;
-
-		/* Figure out depth and distance scaling on
-		 * the fly. Using the existing scaling got us
-		 * into trouble with Revelle data in August-September 2001.
-		 * Use calculated values only if needed to fit
-		 * new depths into short int's.
-		 */
-		if (status == MB_SUCCESS)
-			{
-			/* get max depth and distance values */
-			depthmax = 0.0;
-			distancemax = 0.0;
-			for (i=0;i<nbath;i++)
-			    {
-			    if (beamflag[i] != MB_FLAG_NULL)
-				{
-				depthmax = MAX(depthmax, fabs(bath[i] - depthoffset));
-				distancemax = MAX(distancemax, fabs(bathacrosstrack[i]));
-				}
-			    }
-
-			/* figure out best scaling */
-			if (store->sonar == MBSYS_SIMRAD2_EM120
-				|| store->sonar == MBSYS_SIMRAD2_EM300)
-				png_depth_res = (int)(depthmax / 655.36) + 1;
-			else
-				png_depth_res = (int)(depthmax / 327.68) + 1;
-			png_distance_res = (int)(distancemax / 327.68) + 1;
-
-			/* Change scaling if needed */
-			if (png_depth_res > ping->png_depth_res)
-				{
-				ping->png_depth_res = png_depth_res;
-				depthscale = 0.01 * ping->png_depth_res;
-				}
-			if (png_distance_res > ping->png_distance_res)
-				{
-				ping->png_distance_res = png_distance_res;
-				dacrscale  = 0.01 * ping->png_distance_res;
-				daloscale  = 0.01 * ping->png_distance_res;
-				}
-			}
-
-		/* deal with data from the dual head EM3002 */
-		if (status == MB_SUCCESS && store->sonar == MBSYS_SIMRAD2_EM3002)
-			{
-			ping2 = (struct mbsys_simrad2_ping_struct *) store->ping2;
-
-			ping2->png_date = ping->png_date;
-			ping2->png_msec = ping->png_msec;
-			ping2->png_longitude = ping->png_longitude;
-			ping2->png_latitude = ping->png_latitude;
-			ping2->png_heading = ping->png_heading;
-			ping2->png_speed = ping->png_speed;
-			ping2->png_depth_res = ping->png_depth_res;
-			ping2->png_distance_res = ping->png_distance_res;
-
-			if (ping->png_nbeams == 0)
-				{
-				for (i=0;i<nbath/2;i++)
-				    {
-				    if (beamflag[i] != MB_FLAG_NULL)
-					{
-					j = ping->png_nbeams;
-					ping->png_beam_num[j] = i + 1;
-					ping->png_depth[j] = (int) rint((bath[i] - depthoffset)
-								/ depthscale);
-					ping->png_beamflag[j] = beamflag[i];
-					ping->png_acrosstrack[j]
-				        	= (int) rint(bathacrosstrack[i] / dacrscale);
-					ping->png_alongtrack[j]
-						= (int) rint(bathalongtrack[i] / daloscale);
-					ping->png_amp[j] = (int) rint(amp[i] / reflscale);
-					ping->png_nbeams++;
-					}
-				    }
-				ping->png_nbeams_max = nbath;
-				ping2->png_nbeams = 0;
-				for (i=nbath/2;i<nbath;i++)
-				    {
-				    if (beamflag[i] != MB_FLAG_NULL)
-					{
-					j = ping2->png_nbeams;
-					ping2->png_beam_num[j] = i + 1;
-					ping2->png_depth[j] = (int) rint((bath[i] - depthoffset)
-								/ depthscale);
-					ping2->png_beamflag[j] = beamflag[i];
-					ping2->png_acrosstrack[j]
-				        	= (int) rint(bathacrosstrack[i] / dacrscale);
-					ping2->png_alongtrack[j]
-						= (int) rint(bathalongtrack[i] / daloscale);
-					ping2->png_amp[j] = (int) rint(amp[i] / reflscale);
-					ping2->png_nbeams++;
-					}
-				    }
-				ping2->png_nbeams_max = nbath;
-				}
-			else
-				{
-				for (j=0;j<ping->png_nbeams;j++)
-					{
-					i = ping->png_beam_num[j] - 1;
-					ping->png_depth[j] = (int) rint((bath[i] - depthoffset)
-								/ depthscale);
-					ping->png_beamflag[j] = beamflag[i];
-					ping->png_acrosstrack[j]
-						= (int) rint(bathacrosstrack[i] / dacrscale);
-					ping->png_alongtrack[j]
-						= (int) rint(bathalongtrack[i] / daloscale);
-					ping->png_amp[j] = (int) rint(amp[i] / reflscale);
-					}
-				for (j=0;j<ping2->png_nbeams;j++)
-					{
-					i = ping->png_beam_num[ping->png_nbeams-1]
-						+ ping2->png_beam_num[j] - 1;
-					ping2->png_depth[j] = (int) rint((bath[i] - depthoffset)
-								/ depthscale);
-					ping2->png_beamflag[j] = beamflag[i];
-					ping2->png_acrosstrack[j]
-						= (int) rint(bathacrosstrack[i] / dacrscale);
-					ping2->png_alongtrack[j]
-						= (int) rint(bathalongtrack[i] / daloscale);
-					ping2->png_amp[j] = (int) rint(amp[i] / reflscale);
-					}
-				}
-
-			/* handle sidescan */
-			if (ping->png_pixels_ss	+ ping2->png_pixels_ss != nss)
-				{
-				ping->png_pixels_ss = nss/2;
-				ping2->png_pixels_ss = nss/2;
-				}
-			if (ping->png_pixel_size == 0)
-				{
-				i0 = nss;
-				i1 = 0;
-				for (i=0;i<nss/2;i++)
-					{
-					if (ss[i] > MB_SIDESCAN_NULL)
-						{
-						if (i < i0)
-							{
-							i0 = i;
-							x0 = ssacrosstrack[i];
-							}
-						i1 = i;
-						x1 = ssacrosstrack[i];
-						}
-					}
-				if (i1 - i0 > 1)
-					{
-					ping->png_pixel_size = (int)(100.0 * (x1 - x0) / (i1 - 10 - 1));
-					}
-				}
-			if (ping2->png_pixel_size == 0)
-				{
-				i0 = nss;
-				i1 = 0;
-				for (i=nss/2;i<nss;i++)
-					{
-					if (ss[i] > MB_SIDESCAN_NULL)
-						{
-						if (i < i0)
-							{
-							i0 = i;
-							x0 = ssacrosstrack[i];
-							}
-						i1 = i;
-						x1 = ssacrosstrack[i];
-						}
-					}
-				if (i1 - i0 > 1)
-					{
-					ping2->png_pixel_size = (int)(100.0 * (x1 - x0) / (i1 - 10 - 1));
-					}
-				}
-			for (j=0;j<nss/2;j++)
-				{
-				if (ss[j] > MB_SIDESCAN_NULL)
-					{
-					ping->png_ss[j] = (int) rint(100 * ss[j]);
-					ping->png_ssalongtrack[j] = (int) rint(ssalongtrack[j] / daloscale);
-					}
-				else
-					{
-					ping->png_ss[j] = EM2_INVALID_AMP;
-					ping->png_ssalongtrack[j] = EM2_INVALID_AMP;
-					}
-				}
-			for (j=0;j<nss/2;j++)
-				{
-				i = nss/2 + j;
-				if (ss[i] > MB_SIDESCAN_NULL)
-					{
-					ping2->png_ss[j] = (int) rint(100 * ss[i]);
-					ping2->png_ssalongtrack[j] = (int) rint(ssalongtrack[i] / daloscale);
-					}
-				else
-					{
-					ping2->png_ss[j] = EM2_INVALID_AMP;
-					ping2->png_ssalongtrack[j] = EM2_INVALID_AMP;
-					}
-				}
-			}
-
-		/* else deal with data from all the single head sonars */
-		else if (status == MB_SUCCESS)
-			{
-			if (ping->png_nbeams == 0)
-				{
-				for (i=0;i<nbath;i++)
-				    if (beamflag[i] != MB_FLAG_NULL)
-					{
-					j = ping->png_nbeams;
-					ping->png_beam_num[j] = i + 1;
-					ping->png_depth[j] = (int) rint((bath[i] - depthoffset)
-								/ depthscale);
-					ping->png_beamflag[j] = beamflag[i];
-					ping->png_acrosstrack[j]
-				        	= (int) rint(bathacrosstrack[i] / dacrscale);
-					ping->png_alongtrack[j]
-						= (int) rint(bathalongtrack[i] / daloscale);
-					ping->png_amp[j] = (int) rint(amp[i] / reflscale);
-					ping->png_nbeams++;
-					}
-				ping->png_nbeams_max = nbath;
-				}
-			else
-				{
-				for (j=0;j<ping->png_nbeams;j++)
-					{
-					i = ping->png_beam_num[j] - 1;
-					ping->png_depth[j] = (int) rint((bath[i] - depthoffset)
-								/ depthscale);
-					ping->png_beamflag[j] = beamflag[i];
-					ping->png_acrosstrack[j]
-						= (int) rint(bathacrosstrack[i] / dacrscale);
-					ping->png_alongtrack[j]
-						= (int) rint(bathalongtrack[i] / daloscale);
-					ping->png_amp[j] = (int) rint(amp[i] / reflscale);
-					}
-				}
-			for (i=0;i<nss;i++)
-				{
-				if (ss[i] > MB_SIDESCAN_NULL)
-					{
-					ping->png_ss[i] = (int) rint(100 * ss[i]);
-					ping->png_ssalongtrack[i] = (int) rint(ssalongtrack[i] / daloscale);
-					}
-				else
-					{
-					ping->png_ss[i] = EM2_INVALID_AMP;
-					ping->png_ssalongtrack[i] = EM2_INVALID_AMP;
-					}
-				}
-			}
-		}
-
-	/* insert data in nav structure */
-	else if (store->kind == MB_DATA_NAV
-		|| store->kind == MB_DATA_NAV1
-		|| store->kind == MB_DATA_NAV2
-		|| store->kind == MB_DATA_NAV3)
-		{
-
-		/* get time */
-		store->pos_date = 10000 * time_i[0]
-				    + 100 * time_i[1]
-				    + time_i[2];
-		store->pos_msec = 3600000 * time_i[3]
-				    + 60000 * time_i[4]
-				    + 1000 * time_i[5]
-				    + 0.001 * time_i[6];
-		store->msec = store->pos_msec;
-		store->date = store->pos_date;
-
-		/* get navigation */
-		if (navlon < -180.0)
-			navlon += 360.0;
-		else if (navlon > 180.0)
-			navlon -= 360.0;
-		store->pos_longitude = 10000000 * navlon;
-		store->pos_latitude = 20000000 * navlat;
-
-		/* get heading */
-		store->pos_heading = (int) rint(heading * 100);
-
-		/* get speed  */
-		store->pos_speed = (int) rint(speed / 0.036);
-
-		/* get roll pitch and heave */
-
-		/* set "active" flag if needed */
-		if (store->kind == MB_DATA_NAV)
-		    {
-		    store->pos_system = store->pos_system | 128;
-		    }
-
-		/* set secondary nav flag if needed */
-		else if (store->kind == MB_DATA_NAV1)
-		    {
-		    store->pos_system = store->pos_system | 1;
-		    }
-		else if (store->kind == MB_DATA_NAV2)
-		    {
-		    store->pos_system = store->pos_system | 2;
-		    }
-		else if (store->kind == MB_DATA_NAV3)
-		    {
-		    store->pos_system = store->pos_system | 3;
-		    }
-		}
-
-	/* insert comment in structure */
-	else if (store->kind == MB_DATA_COMMENT)
-		{
-		strncpy(store->par_com,comment,
-			MBSYS_SIMRAD2_COMMENT_LENGTH);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_simrad2_ttimes(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, int *nbeams,
-	double *ttimes, double *angles,
-	double *angles_forward, double *angles_null,
-	double *heave, double *alongtrack_offset,
-	double *draft, double *ssv, int *error)
-{
-	char	*function_name = "mbsys_simrad2_ttimes";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_simrad2_struct *store;
-	struct mbsys_simrad2_ping_struct *ping;
-	struct mbsys_simrad2_ping_struct *ping2;
-	double	ttscale;
-	double	heave_use;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       ttimes:     %p\n",(void *)ttimes);
-		fprintf(stderr,"dbg2       angles_xtrk:%p\n",(void *)angles);
-		fprintf(stderr,"dbg2       angles_ltrk:%p\n",(void *)angles_forward);
-		fprintf(stderr,"dbg2       angles_null:%p\n",(void *)angles_null);
-		fprintf(stderr,"dbg2       heave:      %p\n",(void *)heave);
-		fprintf(stderr,"dbg2       ltrk_off:   %p\n",(void *)alongtrack_offset);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_simrad2_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get survey data structure */
-		ping = (struct mbsys_simrad2_ping_struct *) store->ping;
-
-		/* get depth offset (heave + heave offset) */
-		heave_use =  0.0;
-		*ssv = 0.1 * ping->png_ssv;
-		*draft = 0.01 * ping->png_xducer_depth
-				+ 655.36 * ping->png_offset_multiplier;
-
-		/* get travel times, angles */
-		if (store->sonar == MBSYS_SIMRAD2_EM120
-		    || store->sonar == MBSYS_SIMRAD2_EM300
-		    || store->sonar == MBSYS_SIMRAD2_EM1002
-		    || store->sonar == MBSYS_SIMRAD2_EM2000
-		    || store->sonar == MBSYS_SIMRAD2_EM3000
-		    || store->sonar == MBSYS_SIMRAD2_EM710)
-		    ttscale = 0.5 / ping->png_sample_rate;
-		else if (store->sonar == MBSYS_SIMRAD2_EM3000D_1
-		    || store->sonar == MBSYS_SIMRAD2_EM3000D_2
-		    || store->sonar == MBSYS_SIMRAD2_EM3000D_3
-		    || store->sonar == MBSYS_SIMRAD2_EM3000D_4
-		    || store->sonar == MBSYS_SIMRAD2_EM3000D_5
-		    || store->sonar == MBSYS_SIMRAD2_EM3000D_6
-		    || store->sonar == MBSYS_SIMRAD2_EM3000D_7
-		    || store->sonar == MBSYS_SIMRAD2_EM3000D_8
-		    || store->sonar == MBSYS_SIMRAD2_EM3002)
-		    ttscale = 0.5 / 14000;
-		else if (store->sonar == MBSYS_SIMRAD2_EM12S
-		    || store->sonar == MBSYS_SIMRAD2_EM12D
-		    || store->sonar == MBSYS_SIMRAD2_EM121
-		    || store->sonar == MBSYS_SIMRAD2_EM1000)
-		    {
-		    ttscale = 1.0 / ping->png_sample_rate;
-		    }
-
-		/* deal with data from the dual head EM3002 */
-		if (status == MB_SUCCESS && store->sonar == MBSYS_SIMRAD2_EM3002)
-			{
-			ping2 = (struct mbsys_simrad2_ping_struct *) store->ping2;
-
-			*nbeams = ping->png_nbeams_max + ping2->png_nbeams_max;
-			for (j=0;j<*nbeams;j++)
-				{
-				ttimes[j] = 0.0;
-				angles[j] = 0.0;
-				angles_forward[j] = 0.0;
-				angles_null[j] = 0.0;
-				heave[j] = 0.0;
-				alongtrack_offset[j] = 0.0;
-				}
-			for (i=0;i<ping->png_nbeams;i++)
-				{
-				j = ping->png_beam_num[i] - 1;
-				ttimes[j] = ttscale * ping->png_range[i];
-				angles[j] = 90.0 - 0.01 * ping->png_depression[i];
-				angles_forward[j] = 90 - 0.01 * ping->png_azimuth[i];
-				if (angles_forward[j] < 0.0) angles_forward[j] += 360.0;
-				angles_null[i] = 0.0;
-				heave[j] = heave_use;
-				alongtrack_offset[j] = 0.0;
-				}
-			for (i=0;i<ping2->png_nbeams;i++)
-				{
-				j = ping->png_beam_num[ping->png_nbeams-1] + ping2->png_beam_num[i] - 1;
-				ttimes[j] = ttscale * ping2->png_range[i];
-				angles[j] = 90.0 - 0.01 * ping2->png_depression[i];
-				angles_forward[j] = 90 - 0.01 * ping2->png_azimuth[i];
-				if (angles_forward[j] < 0.0) angles_forward[j] += 360.0;
-				angles_null[i] = 0.0;
-				heave[j] = heave_use;
-				alongtrack_offset[j] = 0.0;
-				}
-			}
-
-		/* else deal with data from single head sonars */
-		else if (status == MB_SUCCESS)
-			{
-			*nbeams = ping->png_nbeams_max;
-			for (j=0;j<ping->png_nbeams_max;j++)
-				{
-				ttimes[j] = 0.0;
-				angles[j] = 0.0;
-				angles_forward[j] = 0.0;
-				angles_null[j] = 0.0;
-				heave[j] = 0.0;
-				alongtrack_offset[j] = 0.0;
-				}
-			for (i=0;i<ping->png_nbeams;i++)
-				{
-				j = ping->png_beam_num[i] - 1;
-				ttimes[j] = ttscale * ping->png_range[i];
-				angles[j] = 90.0 - 0.01 * ping->png_depression[i];
-				angles_forward[j] = 90 - 0.01 * ping->png_azimuth[i];
-				if (angles_forward[j] < 0.0) angles_forward[j] += 360.0;
-				if (store->sonar == MBSYS_SIMRAD2_EM120
-					|| store->sonar == MBSYS_SIMRAD2_EM300
-					|| store->sonar == MBSYS_SIMRAD2_EM2000
-					|| store->sonar == MBSYS_SIMRAD2_EM3000
-					|| store->sonar == MBSYS_SIMRAD2_EM3000D_1
-					|| store->sonar == MBSYS_SIMRAD2_EM3000D_2
-					|| store->sonar == MBSYS_SIMRAD2_EM3000D_3
-					|| store->sonar == MBSYS_SIMRAD2_EM3000D_4
-					|| store->sonar == MBSYS_SIMRAD2_EM3000D_5
-					|| store->sonar == MBSYS_SIMRAD2_EM3000D_6
-					|| store->sonar == MBSYS_SIMRAD2_EM3000D_7
-					|| store->sonar == MBSYS_SIMRAD2_EM3000D_8
-					|| store->sonar == MBSYS_SIMRAD2_EM3002
-					|| store->sonar == MBSYS_SIMRAD2_EM710)
-				    angles_null[i] = 0.0;
-				else if (store->sonar == MBSYS_SIMRAD2_EM1000
-					|| store->sonar == MBSYS_SIMRAD2_EM1002)
-				    angles_null[i] = angles[i];
-				else if (store->sonar == MBSYS_SIMRAD2_EM12S
-					|| store->sonar == MBSYS_SIMRAD2_EM12D
-					|| store->sonar == MBSYS_SIMRAD2_EM121)
-				    angles_null[i] = 0.0;
-				heave[j] = heave_use;
-				alongtrack_offset[j] = 0.0;
-				}
-
-			/* reset null angles for EM1000 outer beams */
-			if (store->sonar == MBSYS_SIMRAD2_EM1000
-			    && *nbeams == 60)
-				{
-				for (i=0;i<6;i++)
-				    angles_null[i] = angles_null[6];
-				for (i=55;i<=60;i++)
-				    angles_null[i] = angles_null[54];
-				}
-			}
-
-		/* set status */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error == MB_ERROR_NO_ERROR)
-		{
-		fprintf(stderr,"dbg2       draft:      %f\n",*draft);
-		fprintf(stderr,"dbg2       ssv:        %f\n",*ssv);
-		fprintf(stderr,"dbg2       nbeams:     %d\n",*nbeams);
-		for (i=0;i<*nbeams;i++)
-			fprintf(stderr,"dbg2       beam %d: tt:%f  angle_xtrk:%f  angle_ltrk:%f  angle_null:%f  depth_off:%f  ltrk_off:%f\n",
-				i,ttimes[i],angles[i],
-				angles_forward[i],angles_null[i],
-				heave[i],alongtrack_offset[i]);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_simrad2_detects(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, int *nbeams, int *detects, int *error)
-{
-	char	*function_name = "mbsys_simrad2_detects";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_simrad2_struct *store;
-	struct mbsys_simrad2_ping_struct *ping;
-	struct mbsys_simrad2_ping_struct *ping2;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       detects:    %p\n",(void *)detects);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_simrad2_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get survey data structure */
-		ping = (struct mbsys_simrad2_ping_struct *) store->ping;
-
-		/* deal with data from the dual head EM3002 */
-		if (store->sonar == MBSYS_SIMRAD2_EM3002)
-			{
-			ping2 = (struct mbsys_simrad2_ping_struct *) store->ping2;
-
-			*nbeams = ping->png_nbeams_max + ping2->png_nbeams_max;
-			for (j=0;j<*nbeams;j++)
-				{
-				detects[j] = MB_DETECT_UNKNOWN;
-				}
-			for (i=0;i<ping->png_nbeams;i++)
-				{
-				j = ping->png_beam_num[i] - 1;
-				if (ping->png_quality[i] & 128)
-					detects[j] = MB_DETECT_PHASE;
-				else
-					detects[j] = MB_DETECT_AMPLITUDE;
-				}
-			for (i=0;i<ping2->png_nbeams;i++)
-				{
-				j = ping2->png_beam_num[ping->png_nbeams-1] + ping2->png_beam_num[i] - 1;
-				if (ping2->png_quality[i] & 128)
-					detects[j] = MB_DETECT_PHASE;
-				else
-					detects[j] = MB_DETECT_AMPLITUDE;
-				}
-			}
-
-		/* else deal with data from single head sonars */
-		else
-			{
-			*nbeams = ping->png_nbeams_max;
-			for (j=0;j<ping->png_nbeams_max;j++)
-				{
-				detects[j] = MB_DETECT_UNKNOWN;
-				}
-			for (i=0;i<ping->png_nbeams;i++)
-				{
-				j = ping->png_beam_num[i] - 1;
-				if (ping->png_quality[i] & 128)
-					detects[j] = MB_DETECT_PHASE;
-				else
-					detects[j] = MB_DETECT_AMPLITUDE;
-				}
-			}
-
-		/* set status */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error == MB_ERROR_NO_ERROR)
-		{
-		fprintf(stderr,"dbg2       nbeams:     %d\n",*nbeams);
-		for (i=0;i<*nbeams;i++)
-			fprintf(stderr,"dbg2       beam %d: detects:%d\n",
-				i,detects[i]);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_simrad2_pulses(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, int *nbeams, int *pulses, int *error)
-{
-	char	*function_name = "mbsys_simrad2_pulses";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_simrad2_struct *store;
-	struct mbsys_simrad2_ping_struct *ping;
-	struct mbsys_simrad2_ping_struct *ping2;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       pulses:    %p\n",(void *)pulses);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_simrad2_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get survey data structure */
-		ping = (struct mbsys_simrad2_ping_struct *) store->ping;
-
-		/* deal with data from the dual head EM3002 */
-		if (store->sonar == MBSYS_SIMRAD2_EM3002)
-			{
-			ping2 = (struct mbsys_simrad2_ping_struct *) store->ping2;
-
-			*nbeams = ping->png_nbeams_max + ping2->png_nbeams_max;
-			for (j=0;j<*nbeams;j++)
-				{
-				pulses[j] = MB_PULSE_UNKNOWN;
-				}
-			for (i=0;i<ping->png_nbeams;i++)
-				{
-				j = ping->png_beam_num[i] - 1;
-				pulses[j] = MB_PULSE_CW;
-				}
-			for (i=0;i<ping2->png_nbeams;i++)
-				{
-				j = ping2->png_beam_num[ping->png_nbeams-1] + ping2->png_beam_num[i] - 1;
-				pulses[j] = MB_PULSE_CW;
-				}
-			}
-
-		/* else deal with data from single head sonars */
-		else
-			{
-			*nbeams = ping->png_nbeams_max;
-			for (j=0;j<ping->png_nbeams_max;j++)
-				{
-				pulses[j] = MB_PULSE_UNKNOWN;
-				}
-			for (i=0;i<ping->png_nbeams;i++)
-				{
-				j = ping->png_beam_num[i] - 1;
-				pulses[j] = MB_PULSE_CW;
-				}
-			}
-
-		/* set status */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error == MB_ERROR_NO_ERROR)
-		{
-		fprintf(stderr,"dbg2       nbeams:     %d\n",*nbeams);
-		for (i=0;i<*nbeams;i++)
-			fprintf(stderr,"dbg2       beam %d: pulses:%d\n",
-				i,pulses[i]);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_simrad2_gains(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, double *transmit_gain, double *pulse_length,
-			double *receive_gain, int *error)
-{
-	char	*function_name = "mbsys_simrad2_gains";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_simrad2_struct *store;
-	struct mbsys_simrad2_survey_struct *ping;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_simrad2_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get survey data structure */
-		ping = (struct mbsys_simrad2_survey_struct *) store->ping;
-
-		/* get transmit_gain (dB) */
-		*transmit_gain = (double)store->run_tran_pow;
-
-		/* get pulse_length (sec) */
-		*pulse_length = 0.000001 * (double)store->run_tran_pulse;
-
-		/* get receive_gain (dB) */
-		*receive_gain = (double)store->run_rec_gain;
-
-		/* set status */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error == MB_ERROR_NO_ERROR)
-		{
-		fprintf(stderr,"dbg2       transmit_gain: %f\n",*transmit_gain);
-		fprintf(stderr,"dbg2       pulse_length:  %f\n",*pulse_length);
-		fprintf(stderr,"dbg2       receive_gain:  %f\n",*receive_gain);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_simrad2_extract_altitude(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, double *transducer_depth, double *altitude,
-	int *error)
-{
-	char	*function_name = "mbsys_simrad2_extract_altitude";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_simrad2_struct *store;
-	struct mbsys_simrad2_ping_struct *ping;
-	double	depthscale, dacrscale;
-	double	altitude_best;
-	double	xtrack_min;
-	int	found;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_simrad2_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get survey data structure */
-		ping = (struct mbsys_simrad2_ping_struct *) store->ping;
-
-		/* get transducer depth and altitude */
-		*transducer_depth = 0.01 * ping->png_xducer_depth
-				+ 655.36 * ping->png_offset_multiplier;
-		depthscale = 0.01 * ping->png_depth_res;
-		dacrscale  = 0.01 * ping->png_distance_res;
-		found = MB_NO;
-		altitude_best = 0.0;
-		xtrack_min = 99999999.9;
-		for (i=0;i<ping->png_nbeams;i++)
-		    {
-		    if (mb_beam_ok(ping->png_beamflag[i])
-			&& fabs(dacrscale * ping->png_acrosstrack[i]) < xtrack_min)
-			{
-			xtrack_min = fabs(dacrscale * ping->png_acrosstrack[i]);
-			altitude_best = depthscale * ping->png_depth[i];
-			found = MB_YES;
-			}
-		    }
-		if (found == MB_NO)
-		    {
-		    xtrack_min = 99999999.9;
-		    for (i=0;i<ping->png_nbeams;i++)
-			{
-			if (ping->png_quality[i] > 0
-			    && fabs(dacrscale * ping->png_acrosstrack[i]) < xtrack_min)
-			    {
-			    xtrack_min = fabs(dacrscale * ping->png_acrosstrack[i]);
-			    altitude_best = depthscale * ping->png_depth[i];
-			    found = MB_YES;
-			    }
-			}
-		    }
-		if (found == MB_YES)
-		    {
-		    *altitude = altitude_best;
-		    }
-		else
-		    *altitude = 0.0;
-
-		/* set status */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:              %d\n",*kind);
-		fprintf(stderr,"dbg2       transducer_depth:  %f\n",*transducer_depth);
-		fprintf(stderr,"dbg2       altitude:          %f\n",*altitude);
-		fprintf(stderr,"dbg2       error:             %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:            %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_simrad2_extract_nnav(int verbose, void *mbio_ptr, void *store_ptr,
-			int nmax, int *kind, int *n,
-			int *time_i, double *time_d,
-			double *navlon, double *navlat,
-			double *speed, double *heading, double *draft,
-			double *roll, double *pitch, double *heave,
-			int *error)
-{
-	char	*function_name = "mbsys_simrad2_extract_nnav";
-	int	status = MB_SUCCESS;
-	int	interp_error = MB_ERROR_NO_ERROR;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_simrad2_struct *store;
-	struct mbsys_simrad2_ping_struct *ping;
-	struct mbsys_simrad2_attitude_struct *attitude;
-	double	atime_d;
-	int	atime_i[7];
-	int	i, inav;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       nmax:       %d\n",nmax);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_simrad2_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from ping structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get survey data structure */
-		ping = (struct mbsys_simrad2_ping_struct *) store->ping;
-
-		/* just one navigation value */
-		*n = 1;
-
-		/* get time */
-		time_i[0] = ping->png_date / 10000;
-		time_i[1] = (ping->png_date % 10000) / 100;
-		time_i[2] = ping->png_date % 100;
-		time_i[3] = ping->png_msec / 3600000;
-		time_i[4] = (ping->png_msec % 3600000) / 60000;
-		time_i[5] = (ping->png_msec % 60000) / 1000;
-		time_i[6] = (ping->png_msec % 1000) * 1000;
-		mb_get_time(verbose,time_i,time_d);
-
-		/* get navigation */
-		if (ping->png_longitude != EM2_INVALID_INT)
-		    *navlon = 0.0000001 * ping->png_longitude;
-		else
-		    *navlon = 0.0;
-		if (ping->png_latitude != EM2_INVALID_INT)
-		    *navlat = 0.00000005 * ping->png_latitude;
-		else
-		    *navlat = 0.0;
-
-		/* get heading */
-		*heading = 0.01 * ping->png_heading;
-
-		/* get speed  */
-		if (ping->png_speed != EM2_INVALID_SHORT)
-			*speed = 0.036 * ping->png_speed;
-		else
-			*speed = 0.0;
-
-		/* get draft  */
-		*draft = 0.01 * ping->png_xducer_depth
-				+ 655.36 * ping->png_offset_multiplier;
-
-		/* get roll pitch and heave */
-		*roll = 0.01 * ping->png_roll;
-		*pitch = 0.01 * ping->png_pitch;
-		*heave = 0.01 * ping->png_heave;
-
-		/* done translating values */
-
-		}
-
-	/* extract data from nav structure */
-	else if (*kind == MB_DATA_NAV
-		|| *kind == MB_DATA_NAV1
-		|| *kind == MB_DATA_NAV2
-		|| *kind == MB_DATA_NAV3)
-		{
-                /* get survey data structure */
-		if (store->ping != NULL)
-                	ping = (struct mbsys_simrad2_ping_struct *) store->ping;
-
-		/* just one navigation value */
-		*n = 1;
-
-		/* get time */
-		time_i[0] = store->pos_date / 10000;
-		time_i[1] = (store->pos_date % 10000) / 100;
-		time_i[2] = store->pos_date % 100;
-		time_i[3] = store->pos_msec / 3600000;
-		time_i[4] = (store->pos_msec % 3600000) / 60000;
-		time_i[5] = (store->pos_msec % 60000) / 1000;
-		time_i[6] = (store->pos_msec % 1000) * 1000;
-		mb_get_time(verbose,time_i,time_d);
-
-		/* get navigation */
-		if (store->pos_longitude != EM2_INVALID_INT)
-		    *navlon = 0.0000001 * store->pos_longitude;
-		else
-		    *navlon = 0.0;
-		if (store->pos_latitude != EM2_INVALID_INT)
-		    *navlat = 0.00000005 * store->pos_latitude;
-		else
-		    *navlat = 0.0;
-
-		/* get heading */
-		if (store->pos_heading != EM2_INVALID_SHORT)
-			*heading = 0.01 * store->pos_heading;
-		else
-			*heading = 0.0;
-
-		/* get speed  */
-		if (store->pos_speed != EM2_INVALID_SHORT)
-			*speed = 0.036 * store->pos_speed;
-		else
-			*speed = 0.0;
-
-		/* get draft  */
-		if (store->ping != NULL)
-			*draft = 0.01 * ping->png_xducer_depth
-				+ 655.36 * ping->png_offset_multiplier;
-		else
-			*draft = 0.0;
-
-		/* get roll pitch and heave */
-		*roll = 0.01 * store->pos_roll;
-		*pitch = 0.01 * store->pos_pitch;
-		*heave = 0.01 * store->pos_heave;
-
-		/* done translating values */
-
-		}
-
-	/* extract data from attitude structure */
-	else if (store->type == EM2_ATTITUDE
-		&& store->attitude != NULL)
-		{
-                /* get attitude data structure */
-		attitude = (struct mbsys_simrad2_attitude_struct *) store->attitude;
-
-		/* get n */
-		*n = MIN(attitude->att_ndata, MB_ASYNCH_SAVE_MAX);
-
-		/* get attitude time */
-		atime_i[0] = attitude->att_date / 10000;
-		atime_i[1] = (attitude->att_date % 10000) / 100;
-		atime_i[2] = attitude->att_date % 100;
-		atime_i[3] = attitude->att_msec / 3600000;
-		atime_i[4] = (attitude->att_msec % 3600000) / 60000;
-		atime_i[5] = (attitude->att_msec % 60000) / 1000;
-		atime_i[6] = (attitude->att_msec % 1000) * 1000;
-		mb_get_time(verbose, atime_i, &atime_d);
-
-		/* loop over the data */
-		for (i=0;i<*n;i++)
-			{
-			/* get time from the data record */
-			time_d[i] = (double)(atime_d + 0.001 * attitude->att_time[i]);
-			mb_get_date(verbose,time_d[i],&(time_i[7*i]));
-
-			/* get attitude from the data record */
-			heave[i] = (double)(0.01 * attitude->att_heave[i]);
-			roll[i] = (double)(0.01 * attitude->att_roll[i]);
-			pitch[i] = (double)(0.01 * attitude->att_pitch[i]);
-
-			/* interpolate the heading */
-			mb_hedint_interp(verbose, mbio_ptr, time_d[i],
-				    		&heading[i], &interp_error);
-
-			/* interpolate the navigation */
-			mb_navint_interp(verbose, mbio_ptr, time_d[i], heading[i], 0.0,
-						&navlon[i], &navlat[i], &speed[i], &interp_error);
-
-			/* interpolate the sonar depth */
-			mb_depint_interp(verbose, mbio_ptr, time_d[i], &draft[i], &interp_error);
-			}
-
-		/* done translating values */
-
-		}
-
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		fprintf(stderr,"dbg2       n:          %d\n",*n);
-		for (inav=0;inav<*n;inav++)
-			{
-			for (i=0;i<7;i++)
-				fprintf(stderr,"dbg2       %d time_i[%d]:     %d\n",inav,i,time_i[inav * 7 + i]);
-			fprintf(stderr,"dbg2       %d time_d:        %f\n",inav,time_d[inav]);
-			fprintf(stderr,"dbg2       %d longitude:     %f\n",inav,navlon[inav]);
-			fprintf(stderr,"dbg2       %d latitude:      %f\n",inav,navlat[inav]);
-			fprintf(stderr,"dbg2       %d speed:         %f\n",inav,speed[inav]);
-			fprintf(stderr,"dbg2       %d heading:       %f\n",inav,heading[inav]);
-			fprintf(stderr,"dbg2       %d draft:         %f\n",inav,draft[inav]);
-			fprintf(stderr,"dbg2       %d roll:          %f\n",inav,roll[inav]);
-			fprintf(stderr,"dbg2       %d pitch:         %f\n",inav,pitch[inav]);
-			fprintf(stderr,"dbg2       %d heave:         %f\n",inav,heave[inav]);
-			}
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_simrad2_extract_nav(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int time_i[7], double *time_d,
-		double *navlon, double *navlat,
-		double *speed, double *heading, double *draft,
-		double *roll, double *pitch, double *heave,
-		int *error)
-{
-	char	*function_name = "mbsys_simrad2_extract_nav";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_simrad2_struct *store;
-	struct mbsys_simrad2_ping_struct *ping;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_simrad2_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from ping structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get survey data structure */
-		ping = (struct mbsys_simrad2_ping_struct *) store->ping;
-
-		/* get time */
-		time_i[0] = ping->png_date / 10000;
-		time_i[1] = (ping->png_date % 10000) / 100;
-		time_i[2] = ping->png_date % 100;
-		time_i[3] = ping->png_msec / 3600000;
-		time_i[4] = (ping->png_msec % 3600000) / 60000;
-		time_i[5] = (ping->png_msec % 60000) / 1000;
-		time_i[6] = (ping->png_msec % 1000) * 1000;
-		mb_get_time(verbose,time_i,time_d);
-
-		/* get navigation */
-		if (ping->png_longitude != EM2_INVALID_INT)
-		    *navlon = 0.0000001 * ping->png_longitude;
-		else
-		    *navlon = 0.0;
-		if (ping->png_latitude != EM2_INVALID_INT)
-		    *navlat = 0.00000005 * ping->png_latitude;
-		else
-		    *navlat = 0.0;
-
-		/* get heading */
-		*heading = 0.01 * ping->png_heading;
-
-		/* get speed  */
-		if (ping->png_speed != EM2_INVALID_SHORT)
-			*speed = 0.036 * ping->png_speed;
-		else
-			*speed = 0.0;
-
-		/* get draft  */
-		*draft = 0.01 * ping->png_xducer_depth
-				+ 655.36 * ping->png_offset_multiplier;
-
-		/* get roll pitch and heave */
-		*roll = 0.01 * ping->png_roll;
-		*pitch = 0.01 * ping->png_pitch;
-		*heave = 0.01 * ping->png_heave;
-
-		/* print debug statements */
-		if (verbose >= 5)
-			{
-			fprintf(stderr,"\ndbg4  Data extracted by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  Extracted values:\n");
-			fprintf(stderr,"dbg4       kind:       %d\n",
-				*kind);
-			fprintf(stderr,"dbg4       error:      %d\n",
-				*error);
-			fprintf(stderr,"dbg4       time_i[0]:  %d\n",
-				time_i[0]);
-			fprintf(stderr,"dbg4       time_i[1]:  %d\n",
-				time_i[1]);
-			fprintf(stderr,"dbg4       time_i[2]:  %d\n",
-				time_i[2]);
-			fprintf(stderr,"dbg4       time_i[3]:  %d\n",
-				time_i[3]);
-			fprintf(stderr,"dbg4       time_i[4]:  %d\n",
-				time_i[4]);
-			fprintf(stderr,"dbg4       time_i[5]:  %d\n",
-				time_i[5]);
-			fprintf(stderr,"dbg4       time_i[6]:  %d\n",
-				time_i[6]);
-			fprintf(stderr,"dbg4       time_d:     %f\n",
-				*time_d);
-			fprintf(stderr,"dbg4       longitude:  %f\n",
-				*navlon);
-			fprintf(stderr,"dbg4       latitude:   %f\n",
-				*navlat);
-			fprintf(stderr,"dbg4       speed:      %f\n",
-				*speed);
-			fprintf(stderr,"dbg4       heading:    %f\n",
-				*heading);
-			fprintf(stderr,"dbg4       draft:      %f\n",
-				*draft);
-			fprintf(stderr,"dbg4       roll:       %f\n",
-				*roll);
-			fprintf(stderr,"dbg4       pitch:      %f\n",
-				*pitch);
-			fprintf(stderr,"dbg4       heave:      %f\n",
-				*heave);
-			}
-
-		/* done translating values */
-
-		}
-
-	/* extract data from nav structure */
-	else if (*kind == MB_DATA_NAV
-		|| *kind == MB_DATA_NAV1
-		|| *kind == MB_DATA_NAV2
-		|| *kind == MB_DATA_NAV3)
-		{
-                /* get survey data structure */
-		if (store->ping != NULL)
-                	ping = (struct mbsys_simrad2_ping_struct *) store->ping;
-
-		/* get time */
-		time_i[0] = store->pos_date / 10000;
-		time_i[1] = (store->pos_date % 10000) / 100;
-		time_i[2] = store->pos_date % 100;
-		time_i[3] = store->pos_msec / 3600000;
-		time_i[4] = (store->pos_msec % 3600000) / 60000;
-		time_i[5] = (store->pos_msec % 60000) / 1000;
-		time_i[6] = (store->pos_msec % 1000) * 1000;
-		mb_get_time(verbose,time_i,time_d);
-
-		/* get navigation */
-		if (store->pos_longitude != EM2_INVALID_INT)
-		    *navlon = 0.0000001 * store->pos_longitude;
-		else
-		    *navlon = 0.0;
-		if (store->pos_latitude != EM2_INVALID_INT)
-		    *navlat = 0.00000005 * store->pos_latitude;
-		else
-		    *navlat = 0.0;
-
-		/* get heading */
-		if (store->pos_heading != EM2_INVALID_SHORT)
-			*heading = 0.01 * store->pos_heading;
-		else
-			*heading = 0.0;
-
-		/* get speed  */
-		if (store->pos_speed != EM2_INVALID_SHORT)
-			*speed = 0.036 * store->pos_speed;
-		else
-			*speed = 0.0;
-
-		/* get draft  */
-		if (store->ping != NULL)
-			*draft = 0.01 * ping->png_xducer_depth
-				+ 655.36 * ping->png_offset_multiplier;
-		else
-			*draft = 0.0;
-
-		/* get roll pitch and heave */
-		*roll = 0.01 * store->pos_roll;
-		*pitch = 0.01 * store->pos_pitch;
-		*heave = 0.01 * store->pos_heave;
-
-		/* print debug statements */
-		if (verbose >= 5)
-			{
-			fprintf(stderr,"\ndbg4  Data extracted by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  Extracted values:\n");
-			fprintf(stderr,"dbg4       kind:       %d\n",
-				*kind);
-			fprintf(stderr,"dbg4       error:      %d\n",
-				*error);
-			fprintf(stderr,"dbg4       time_i[0]:  %d\n",
-				time_i[0]);
-			fprintf(stderr,"dbg4       time_i[1]:  %d\n",
-				time_i[1]);
-			fprintf(stderr,"dbg4       time_i[2]:  %d\n",
-				time_i[2]);
-			fprintf(stderr,"dbg4       time_i[3]:  %d\n",
-				time_i[3]);
-			fprintf(stderr,"dbg4       time_i[4]:  %d\n",
-				time_i[4]);
-			fprintf(stderr,"dbg4       time_i[5]:  %d\n",
-				time_i[5]);
-			fprintf(stderr,"dbg4       time_i[6]:  %d\n",
-				time_i[6]);
-			fprintf(stderr,"dbg4       time_d:     %f\n",
-				*time_d);
-			fprintf(stderr,"dbg4       longitude:  %f\n",
-				*navlon);
-			fprintf(stderr,"dbg4       latitude:   %f\n",
-				*navlat);
-			fprintf(stderr,"dbg4       speed:      %f\n",
-				*speed);
-			fprintf(stderr,"dbg4       heading:    %f\n",
-				*heading);
-			fprintf(stderr,"dbg4       draft:      %f\n",
-				*draft);
-			fprintf(stderr,"dbg4       roll:       %f\n",
-				*roll);
-			fprintf(stderr,"dbg4       pitch:      %f\n",
-				*pitch);
-			fprintf(stderr,"dbg4       heave:      %f\n",
-				*heave);
-			}
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind == MB_DATA_DATA)
-		{
-		fprintf(stderr,"dbg2       time_i[0]:     %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:     %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:     %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:     %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:     %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:     %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:     %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:        %f\n",*time_d);
-		fprintf(stderr,"dbg2       longitude:     %f\n",*navlon);
-		fprintf(stderr,"dbg2       latitude:      %f\n",*navlat);
-		fprintf(stderr,"dbg2       speed:         %f\n",*speed);
-		fprintf(stderr,"dbg2       heading:       %f\n",*heading);
-		fprintf(stderr,"dbg2       draft:         %f\n",*draft);
-		fprintf(stderr,"dbg2       roll:          %f\n",*roll);
-		fprintf(stderr,"dbg2       pitch:         %f\n",*pitch);
-		fprintf(stderr,"dbg2       heave:         %f\n",*heave);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_simrad2_insert_nav(int verbose, void *mbio_ptr, void *store_ptr,
-		int time_i[7], double time_d,
-		double navlon, double navlat,
-		double speed, double heading, double draft,
-		double roll, double pitch, double heave,
-		int *error)
-{
-	char	*function_name = "mbsys_simrad2_insert_nav";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_simrad2_struct *store;
-	struct mbsys_simrad2_ping_struct *ping;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       time_i[0]:  %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:  %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:  %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:  %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:  %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:  %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:  %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:     %f\n",time_d);
-		fprintf(stderr,"dbg2       navlon:     %f\n",navlon);
-		fprintf(stderr,"dbg2       navlat:     %f\n",navlat);
-		fprintf(stderr,"dbg2       speed:      %f\n",speed);
-		fprintf(stderr,"dbg2       heading:    %f\n",heading);
-		fprintf(stderr,"dbg2       draft:      %f\n",draft);
-		fprintf(stderr,"dbg2       roll:       %f\n",roll);
-		fprintf(stderr,"dbg2       pitch:      %f\n",pitch);
-		fprintf(stderr,"dbg2       heave:      %f\n",heave);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_simrad2_struct *) store_ptr;
-
-	/* insert data in ping structure */
-	if (store->kind == MB_DATA_DATA)
-		{
-		/* allocate secondary data structure for
-			survey data if needed */
-		if (store->ping == NULL)
-			{
-			status = mbsys_simrad2_survey_alloc(
-					verbose,mbio_ptr,
-					store_ptr,error);
-			}
-
-		/* get survey data structure */
-		ping = (struct mbsys_simrad2_ping_struct *) store->ping;
-
-		/* get time */
-		ping->png_date = 10000 * time_i[0]
-				    + 100 * time_i[1]
-				    + time_i[2];
-		ping->png_msec = 3600000 * time_i[3]
-				    + 60000 * time_i[4]
-				    + 1000 * time_i[5]
-				    + 0.001 * time_i[6];
-		store->msec = ping->png_msec;
-		store->date = ping->png_date;
-
-		/* get navigation */
-		if (navlon < -180.0)
-			navlon += 360.0;
-		else if (navlon > 180.0)
-			navlon -= 360.0;
-		ping->png_longitude = 10000000 * navlon;
-		ping->png_latitude = 20000000 * navlat;
-
-		/* get heading */
-		ping->png_heading = (int) rint(heading * 100);
-
-		/* get speed  */
-		ping->png_speed = (int) rint(speed / 0.036);
-
-		/* get draft  */
-		ping->png_offset_multiplier = (int)floor(draft / 655.36);
-		ping->png_xducer_depth
-			= 100 * (draft - 655.36 * ping->png_offset_multiplier);
-
-		/* get roll pitch and heave */
-		ping->png_roll = (int) rint(roll / 0.01);
-		ping->png_pitch = (int) rint(pitch / 0.01);
-		ping->png_heave = (int) rint(heave / 0.01);
-		}
-
-	/* insert data in nav structure */
-	else if (store->kind == MB_DATA_NAV
-		|| store->kind == MB_DATA_NAV1
-		|| store->kind == MB_DATA_NAV2
-		|| store->kind == MB_DATA_NAV3)
-		{
-
-		/* get time */
-		store->pos_date = 10000 * time_i[0]
-				    + 100 * time_i[1]
-				    + time_i[2];
-		store->pos_msec = 3600000 * time_i[3]
-				    + 60000 * time_i[4]
-				    + 1000 * time_i[5]
-				    + 0.001 * time_i[6];
-		store->msec = store->pos_msec;
-		store->date = store->pos_date;
-
-		/* get navigation */
-		if (navlon < -180.0)
-			navlon += 360.0;
-		else if (navlon > 180.0)
-			navlon -= 360.0;
-		store->pos_longitude = 10000000 * navlon;
-		store->pos_latitude = 20000000 * navlat;
-
-		/* get heading */
-		store->pos_heading = (int) rint(heading * 100);
-
-		/* get speed  */
-		store->pos_speed = (int) rint(speed / 0.036);
-
-		/* get roll pitch and heave */
-		store->pos_roll = (int) rint(roll / 0.01);
-		store->pos_pitch = (int) rint(pitch / 0.01);
-		store->pos_heave = (int) rint(heave / 0.01);
-
-		/* set "active" flag if needed */
-		if (store->kind == MB_DATA_NAV)
-		    {
-		    store->pos_system = store->pos_system | 128;
-		    }
-
-		/* set secondary nav flag if needed */
-		else if (store->kind == MB_DATA_NAV1)
-		    {
-		    store->pos_system = store->pos_system | 1;
-		    }
-		else if (store->kind == MB_DATA_NAV2)
-		    {
-		    store->pos_system = store->pos_system | 2;
-		    }
-		else if (store->kind == MB_DATA_NAV3)
-		    {
-		    store->pos_system = store->pos_system | 3;
-		    }
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_simrad2_extract_svp(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int *nsvp,
-		double *depth, double *velocity,
-		int *error)
-{
-	char	*function_name = "mbsys_simrad2_extract_svp";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_simrad2_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_simrad2_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_VELOCITY_PROFILE)
-		{
-		/* get number of depth-velocity pairs */
-		*nsvp = store->svp_num;
-
-		/* get profile */
-		for (i=0;i<*nsvp;i++)
-			{
-			depth[i] = 0.01 * store->svp_depth_res * store->svp_depth[i];
-			velocity[i] = 0.1 * store->svp_vel[i];
-			}
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:              %d\n",*kind);
-		fprintf(stderr,"dbg2       nsvp:              %d\n",*nsvp);
-		for (i=0;i<*nsvp;i++)
-		    fprintf(stderr,"dbg2       depth[%d]: %f   velocity[%d]: %f\n",i, depth[i], i, velocity[i]);
-		fprintf(stderr,"dbg2       error:             %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:            %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_simrad2_insert_svp(int verbose, void *mbio_ptr, void *store_ptr,
-		int nsvp,
-		double *depth, double *velocity,
-		int *error)
-{
-	char	*function_name = "mbsys_simrad2_insert_svp";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_simrad2_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       nsvp:       %d\n",nsvp);
-		for (i=0;i<nsvp;i++)
-		    fprintf(stderr,"dbg2       depth[%d]: %f   velocity[%d]: %f\n",i, depth[i], i, velocity[i]);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_simrad2_struct *) store_ptr;
-
-	/* insert data in structure */
-	if (store->kind == MB_DATA_VELOCITY_PROFILE)
-		{
-		/* get number of depth-velocity pairs */
-		store->svp_num = MIN(nsvp, MBSYS_SIMRAD2_MAXSVP);
-		store->svp_depth_res = 1;
-
-		/* get profile */
-		for (i=0;i<store->svp_num;i++)
-			{
-			store->svp_depth[i] = (int) (100 * depth[i] / store->svp_depth_res);
-			store->svp_vel[i] = (int) (10 * velocity[i]);
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_simrad2_copy(int verbose, void *mbio_ptr,
-			void *store_ptr, void *copy_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_simrad2_copy";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_simrad2_struct *store;
-	struct mbsys_simrad2_struct *copy;
-	struct mbsys_simrad2_ping_struct *ping_store;
-	struct mbsys_simrad2_ping_struct *ping_copy;
-	char	*ping_save;
-	struct mbsys_simrad2_attitude_struct *attitude_store;
-	struct mbsys_simrad2_attitude_struct *attitude_copy;
-	char	*attitude_save;
-	struct mbsys_simrad2_heading_struct *heading_store;
-	struct mbsys_simrad2_heading_struct *heading_copy;
-	char	*heading_save;
-	struct mbsys_simrad2_ssv_struct *ssv_store;
-	struct mbsys_simrad2_ssv_struct *ssv_copy;
-	char	*ssv_save;
-	struct mbsys_simrad2_tilt_struct *tilt_store;
-	struct mbsys_simrad2_tilt_struct *tilt_copy;
-	char	*tilt_save;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       copy_ptr:   %p\n",(void *)copy_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointers */
-	store = (struct mbsys_simrad2_struct *) store_ptr;
-	copy = (struct mbsys_simrad2_struct *) copy_ptr;
-
-	/* check if survey data needs to be copied */
-	if (store->kind == MB_DATA_DATA
-		&& store->ping != NULL)
-		{
-		/* make sure a survey data structure exists to
-			be copied into */
-		if (copy->ping == NULL)
-			{
-			status = mbsys_simrad2_survey_alloc(
-					verbose,mbio_ptr,
-					copy_ptr,error);
-			}
-
-		/* save pointer value */
-		ping_save = (char *)copy->ping;
-		}
-	else
-		ping_save = NULL;
-
-	/* check if attitude data needs to be copied */
-	if (store->attitude != NULL)
-		{
-		/* make sure a attitude data structure exists to
-			be copied into */
-		if (copy->attitude == NULL)
-			{
-			status = mbsys_simrad2_attitude_alloc(
-					verbose,mbio_ptr,
-					copy_ptr,error);
-			}
-
-		/* save pointer value */
-		attitude_save = (char *)copy->attitude;
-		}
-
-	/* check if heading data needs to be copied */
-	if (store->heading != NULL)
-		{
-		/* make sure a heading data structure exists to
-			be copied into */
-		if (copy->heading == NULL)
-			{
-			status = mbsys_simrad2_heading_alloc(
-					verbose,mbio_ptr,
-					copy_ptr,error);
-			}
-
-		/* save pointer value */
-		heading_save = (char *)copy->heading;
-		}
-
-	/* check if ssv data needs to be copied */
-	if (store->ssv != NULL)
-		{
-		/* make sure a ssv data structure exists to
-			be copied into */
-		if (copy->ssv == NULL)
-			{
-			status = mbsys_simrad2_ssv_alloc(
-					verbose,mbio_ptr,
-					copy_ptr,error);
-			}
-
-		/* save pointer value */
-		ssv_save = (char *)copy->ssv;
-		}
-
-	/* check if tilt data needs to be copied */
-	if (store->tilt != NULL)
-		{
-		/* make sure a tilt data structure exists to
-			be copied into */
-		if (copy->tilt == NULL)
-			{
-			status = mbsys_simrad2_tilt_alloc(
-					verbose,mbio_ptr,
-					copy_ptr,error);
-			}
-
-		/* save pointer value */
-		tilt_save = (char *)copy->tilt;
-		}
-
-	/* copy the main structure */
-	*copy = *store;
-
-	/* if needed copy the survey data structure */
-	if (store->kind == MB_DATA_DATA
-		&& store->ping != NULL
-		&& status == MB_SUCCESS)
-		{
-		copy->ping = (struct mbsys_simrad2_ping_struct *) ping_save;
-		ping_store = (struct mbsys_simrad2_ping_struct *) store->ping;
-		ping_copy = (struct mbsys_simrad2_ping_struct *) copy->ping;
-		*ping_copy = *ping_store;
-		}
-	else
-		copy->ping = NULL;
-
-	/* if needed copy the attitude data structure */
-	if (store->attitude != NULL && status == MB_SUCCESS)
-		{
-		copy->attitude = (struct mbsys_simrad2_attitude_struct *) attitude_save;
-		attitude_store = (struct mbsys_simrad2_attitude_struct *) store->attitude;
-		attitude_copy = (struct mbsys_simrad2_attitude_struct *) copy->attitude;
-		*attitude_copy = *attitude_store;
-		}
-
-	/* if needed copy the heading data structure */
-	if (store->heading != NULL && status == MB_SUCCESS)
-		{
-		copy->heading = (struct mbsys_simrad2_heading_struct *) heading_save;
-		heading_store = (struct mbsys_simrad2_heading_struct *) store->heading;
-		heading_copy = (struct mbsys_simrad2_heading_struct *) copy->heading;
-		*heading_copy = *heading_store;
-		}
-
-	/* if needed copy the ssv data structure */
-	if (store->ssv != NULL && status == MB_SUCCESS)
-		{
-		copy->ssv = (struct mbsys_simrad2_ssv_struct *) ssv_save;
-		ssv_store = (struct mbsys_simrad2_ssv_struct *) store->ssv;
-		ssv_copy = (struct mbsys_simrad2_ssv_struct *) copy->ssv;
-		*ssv_copy = *ssv_store;
-		}
-
-	/* if needed copy the tilt data structure */
-	if (store->tilt != NULL && status == MB_SUCCESS)
-		{
-		copy->tilt = (struct mbsys_simrad2_tilt_struct *) tilt_save;
-		tilt_store = (struct mbsys_simrad2_tilt_struct *) store->tilt;
-		tilt_copy = (struct mbsys_simrad2_tilt_struct *) copy->tilt;
-		*tilt_copy = *tilt_store;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_simrad2_makess(int verbose, void *mbio_ptr, void *store_ptr,
-		int pixel_size_set, double *pixel_size,
-		int swath_width_set, double *swath_width,
-		int pixel_int,
-		int *error)
-{
-	char	*function_name = "mbsys_simrad2_makess";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_simrad2_struct *store;
-	struct mbsys_simrad2_ping_struct *ping;
-	double	ss[MBSYS_SIMRAD2_MAXPIXELS];
-	int	ss_cnt[MBSYS_SIMRAD2_MAXPIXELS];
-	double	ssacrosstrack[MBSYS_SIMRAD2_MAXPIXELS];
-	double	ssalongtrack[MBSYS_SIMRAD2_MAXPIXELS];
-	mb_s_char *beam_ss;
-	int	nbathsort;
-	double	bathsort[MBSYS_SIMRAD2_MAXBEAMS];
-	double	depthscale, depthoffset;
-	double	dacrscale, daloscale;
-	double	reflscale;
-	double	ssoffset;
-	double  pixel_size_calc;
-	double	ss_spacing, ss_spacing_use;
-	int	pixel_int_use;
-	double	angle, depth, xtrack, xtrackss;
-	double	range, beam_foot, beamwidth, sint;
-	int	time_i[7];
-	double	bath_time_d, ss_time_d;
-	int	ss_ok;
-	int	first, last, k1, k2;
-	int	i, k, kk;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:         %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:        %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:       %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       pixel_size_set:  %d\n",pixel_size_set);
-		fprintf(stderr,"dbg2       pixel_size:      %f\n",*pixel_size);
-		fprintf(stderr,"dbg2       swath_width_set: %d\n",swath_width_set);
-		fprintf(stderr,"dbg2       swath_width:     %f\n",*swath_width);
-		fprintf(stderr,"dbg2       pixel_int:       %d\n",pixel_int);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_simrad2_struct *) store_ptr;
-
-	/* construct sidescan data for first sonar head (all data) */
-	if (store->kind == MB_DATA_DATA)
-		{
-		/* get pointer to raw data structure */
-		ping = (struct mbsys_simrad2_ping_struct *) store->ping;
-
-		/* zero the sidescan */
-		for (i=0;i<MBSYS_SIMRAD2_MAXPIXELS;i++)
-			{
-			ss[i] = 0.0;
-			ssacrosstrack[i] = 0.0;
-			ssalongtrack[i] = 0.0;
-			ss_cnt[i] = 0;
-			}
-
-		/* set scaling parameters */
-		depthscale = 0.01 * ping->png_depth_res;
-		depthoffset = 0.01 * ping->png_xducer_depth
-				+ 655.36 * ping->png_offset_multiplier;
-		dacrscale  = 0.01 * ping->png_distance_res;
-		daloscale  = 0.01 * ping->png_distance_res;
-		reflscale  = 0.5;
-		ssoffset = 64.0;
-		if (store->sonar == MBSYS_SIMRAD2_EM300
-		    && store->run_mode == 4)
-		    {
-		    if (depthscale * ping->png_depth[ping->png_nbeams/2] > 3500.0
-			&& ping->png_max_range > 19000
-			&& ping->png_bsn + ping->png_bso < -60)
-			{
-			ssoffset = 64.0 - 0.6 * (ping->png_bsn + ping->png_bso + 60);
-			}
-		    }
-
-		/* get raw pixel size */
-		if (store->sonar == MBSYS_SIMRAD2_EM120
-		    || store->sonar == MBSYS_SIMRAD2_EM300
-		    || store->sonar == MBSYS_SIMRAD2_EM1002
-		    || store->sonar == MBSYS_SIMRAD2_EM2000
-		    || store->sonar == MBSYS_SIMRAD2_EM3000
-		    || store->sonar == MBSYS_SIMRAD2_EM710)
-		    ss_spacing = 750.0 / ping->png_sample_rate;
-		else if (store->sonar == MBSYS_SIMRAD2_EM3000D_1
-		    || store->sonar == MBSYS_SIMRAD2_EM3000D_2
-		    || store->sonar == MBSYS_SIMRAD2_EM3000D_3
-		    || store->sonar == MBSYS_SIMRAD2_EM3000D_4
-		    || store->sonar == MBSYS_SIMRAD2_EM3000D_5
-		    || store->sonar == MBSYS_SIMRAD2_EM3000D_6
-		    || store->sonar == MBSYS_SIMRAD2_EM3000D_7
-		    || store->sonar == MBSYS_SIMRAD2_EM3000D_8
-		    || store->sonar == MBSYS_SIMRAD2_EM3002)
-		    ss_spacing = 750.0 / 14000;
-		else if (store->sonar == MBSYS_SIMRAD2_EM12S
-		    || store->sonar == MBSYS_SIMRAD2_EM12D
-		    || store->sonar == MBSYS_SIMRAD2_EM121
-		    || store->sonar == MBSYS_SIMRAD2_EM1000)
-		    {
-		    ss_spacing = 0.01 * ping->png_max_range;
-		    }
-
-		/* get beam angle size */
-		if (store->sonar == MBSYS_SIMRAD2_EM1000)
-		    {
-		    beamwidth = 2.5;
-		    }
-		else
-		    {
-		    beamwidth = 0.1 * ((double) ping->png_tx);
-		    }
-
-		/* get median depth */
-		nbathsort = 0;
-		for (i=0;i<ping->png_nbeams;i++)
-		    {
-		    if (mb_beam_ok(ping->png_beamflag[i]))
-			{
-			bathsort[nbathsort] = depthscale
-				* ping->png_depth[i]
-				    + depthoffset;
-			nbathsort++;
-			}
-		    }
-
-		/* get sidescan pixel size */
-		if (swath_width_set == MB_NO
-		    && nbathsort > 0)
-		    {
-		    (*swath_width) = 2.5 + MAX(90.0 - 0.01 * ping->png_depression[0],
-				    90.0 - 0.01 * ping->png_depression[ping->png_nbeams-1]);
-		    (*swath_width) = MAX((*swath_width), 60.0);
-		    }
-		if (pixel_size_set == MB_NO
-		    && nbathsort > 0)
-		    {
-		    qsort((char *)bathsort, nbathsort, sizeof(double),(void *)mb_double_compare);
-		    pixel_size_calc = 2 * tan(DTR * (*swath_width)) * bathsort[nbathsort/2]
-					/ MBSYS_SIMRAD2_MAXPIXELS;
-		    pixel_size_calc = MAX(pixel_size_calc, bathsort[nbathsort/2] * sin(DTR * 0.1));
-		    if ((*pixel_size) <= 0.0)
-			(*pixel_size) = pixel_size_calc;
-		    else if (0.95 * (*pixel_size) > pixel_size_calc)
-			(*pixel_size) = 0.95 * (*pixel_size);
-		    else if (1.05 * (*pixel_size) < pixel_size_calc)
-			(*pixel_size) = 1.05 * (*pixel_size);
-		    else
-			(*pixel_size) = pixel_size_calc;
-		    }
-
-		/* get pixel interpolation */
-		pixel_int_use = pixel_int + 1;
-
-		/* check that sidescan can be used */
-		/* get times of bath and sidescan records */
-		time_i[0] = ping->png_date / 10000;
-		time_i[1] = (ping->png_date % 10000) / 100;
-		time_i[2] = ping->png_date % 100;
-		time_i[3] = ping->png_msec / 3600000;
-		time_i[4] = (ping->png_msec % 3600000) / 60000;
-		time_i[5] = (ping->png_msec % 60000) / 1000;
-		time_i[6] = (ping->png_msec % 1000) * 1000;
-		mb_get_time(verbose, time_i, &bath_time_d);
-		time_i[0] = ping->png_ss_date / 10000;
-		time_i[1] = (ping->png_ss_date % 10000) / 100;
-		time_i[2] = ping->png_ss_date % 100;
-		time_i[3] = ping->png_ss_msec / 3600000;
-		time_i[4] = (ping->png_ss_msec % 3600000) / 60000;
-		time_i[5] = (ping->png_ss_msec % 60000) / 1000;
-		time_i[6] = (ping->png_ss_msec % 1000) * 1000;
-		mb_get_time(verbose, time_i, &ss_time_d);
-		ss_ok = MB_YES;
-		if (ping->png_nbeams < ping->png_nbeams_ss
-		    || ping->png_nbeams > ping->png_nbeams_ss + 1)
-		    {
-		    ss_ok = MB_NO;
-		    if (verbose > 0)
-			    fprintf(stderr,"%s: %4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d Sidescan ignored: num bath beams != num ss beams: %d %d\n",
-				    function_name, time_i[0], time_i[1], time_i[2],
-				    time_i[3], time_i[4], time_i[5], time_i[6],
-				    ping->png_nbeams, ping->png_nbeams_ss);
-		    }
-		else if (ping->png_nbeams == ping->png_nbeams_ss)
-		    {
-		    for (i=0;i<ping->png_nbeams;i++)
-			{
-			if (ping->png_beam_num[i] !=
-				ping->png_beam_index[i] + 1
-			    && ping->png_beam_num[i] !=
-				ping->png_beam_index[i] - 1)
-			    {
-		    	    ss_ok = MB_NO;
-			    if (verbose > 0)
-				    fprintf(stderr,"%s: %4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d Sidescan ignored: bath and ss beam indexes don't match: : %d %d %d\n",
-					    function_name, time_i[0], time_i[1], time_i[2],
-					    time_i[3], time_i[4], time_i[5], time_i[6],
-					    i, ping->png_beam_num[i], ping->png_beam_index[i]);
-			    }
-			}
-		    }
-
-
-		/* loop over raw sidescan, putting each raw pixel into
-			the binning arrays */
-		if (ss_ok == MB_YES)
-		for (i=0;i<ping->png_nbeams_ss;i++)
-			{
-			beam_ss = &ping->png_ssraw[ping->png_start_sample[i]];
-			if (mb_beam_ok(ping->png_beamflag[i]))
-			    {
-			    if (ping->png_beam_samples[i] > 0)
-				{
-				depth = depthscale * ping->png_depth[i];
-				xtrack = dacrscale * ping->png_acrosstrack[i];
-				range = sqrt(depth * depth + xtrack * xtrack);
-				angle = 90.0 - 0.01 * ping->png_depression[i];
-				beam_foot = range * sin(DTR * beamwidth)
-							/ cos(DTR * angle);
-				sint = fabs(sin(DTR * angle));
-				if (sint < ping->png_beam_samples[i] * ss_spacing / beam_foot)
-				    ss_spacing_use = beam_foot / ping->png_beam_samples[i];
-				else
-				    ss_spacing_use = ss_spacing / sint;
-/*fprintf(stderr, "spacing: %f %f n:%d sint:%f angle:%f range:%f foot:%f factor:%f\n",
-ss_spacing, ss_spacing_use,
-ping->png_beam_samples[i], sint, angle, range, beam_foot,
-ping->png_beam_samples[i] * ss_spacing / beam_foot);*/
-				}
-			    for (k=0;k<ping->png_beam_samples[i];k++)
-				{
-				if (beam_ss[k] != EM2_INVALID_AMP)
-					{
-					/* locate based on range */
-					if (k == ping->png_center_sample[i])
-					    {
-					    xtrackss = xtrack;
-					    }
-					else if (i == ping->png_nbeams_ss - 1
-					    || (k <= ping->png_center_sample[i]
-						&& i != 0))
-					    {
-					    if (ping->png_range[i] != ping->png_range[i-1])
-						{
-						xtrackss = dacrscale * ping->png_acrosstrack[i]
-						    + (dacrscale * ping->png_acrosstrack[i]
-							- dacrscale * ping->png_acrosstrack[i-1])
-						    * 2 *((double)(k - ping->png_center_sample[i]))
-						    / fabs((double)(ping->png_range[i] - ping->png_range[i-1]));
-						}
-					    else
-						{
-						xtrackss = xtrack
-						    + ss_spacing_use * (k - ping->png_center_sample[i]);
-						}
-					    }
-					else
-					    {
-					    if (ping->png_range[i] != ping->png_range[i+1])
-						{
-						xtrackss = dacrscale * ping->png_acrosstrack[i]
-						    + (dacrscale * ping->png_acrosstrack[i+1]
-							- dacrscale * ping->png_acrosstrack[i])
-						    * 2 *((double)(k - ping->png_center_sample[i]))
-						    / fabs((double)(ping->png_range[i+1] - ping->png_range[i]));
-						}
-					    else
-						{
-						xtrackss = xtrack
-						    + ss_spacing_use * (k - ping->png_center_sample[i]);
-						}
-					    }
-					xtrackss = xtrack
-						    + ss_spacing_use * (k - ping->png_center_sample[i]);
-					kk = MBSYS_SIMRAD2_MAXPIXELS / 2
-					    + (int)(xtrackss / (*pixel_size));
-					if (kk > 0 && kk < MBSYS_SIMRAD2_MAXPIXELS)
-					    {
-					    ss[kk]  += reflscale*((double)beam_ss[k]);
-					    ssalongtrack[kk]
-						    += daloscale * ping->png_alongtrack[i];
-					    ss_cnt[kk]++;
-					    }
-					}
-				}
-			    }
-			}
-
-		/* average the sidescan */
-		first = MBSYS_SIMRAD2_MAXPIXELS;
-		last = -1;
-		for (k=0;k<MBSYS_SIMRAD2_MAXPIXELS;k++)
-			{
-			if (ss_cnt[k] > 0)
-				{
-				ss[k] /= ss_cnt[k];
-				ssalongtrack[k] /= ss_cnt[k];
-				ssacrosstrack[k]
-					= (k - MBSYS_SIMRAD2_MAXPIXELS / 2)
-						* (*pixel_size);
-				first = MIN(first, k);
-				last = k;
-				}
-			else
-				ss[k] = MB_SIDESCAN_NULL;
-			}
-
-		/* interpolate the sidescan */
-		k1 = first;
-		k2 = first;
-		for (k=first+1;k<last;k++)
-		    {
-		    if (ss_cnt[k] <= 0)
-			{
-			if (k2 <= k)
-			    {
-			    k2 = k+1;
-			    while (ss_cnt[k2] <= 0 && k2 < last)
-				k2++;
-			    }
-			if (k2 - k1 <= pixel_int_use)
-			    {
-			    ss[k] = ss[k1]
-				+ (ss[k2] - ss[k1])
-				    * ((double)(k - k1)) / ((double)(k2 - k1));
-			    ssacrosstrack[k]
-				    = (k - MBSYS_SIMRAD2_MAXPIXELS / 2)
-					    * (*pixel_size);
-			    ssalongtrack[k] = ssalongtrack[k1]
-				+ (ssalongtrack[k2] - ssalongtrack[k1])
-				    * ((double)(k - k1)) / ((double)(k2 - k1));
-			    }
-			}
-		    else
-			{
-			k1 = k;
-			}
-		    }
-
-		/* insert the new sidescan into store */
-		ping->png_pixel_size = (int) (100 * (*pixel_size));
-		if (last > first)
-		    ping->png_pixels_ss = MBSYS_SIMRAD2_MAXPIXELS;
-		else
-		    ping->png_pixels_ss = 0;
-		for (i=0;i<MBSYS_SIMRAD2_MAXPIXELS;i++)
-		    {
-		    if (ss[i] > MB_SIDESCAN_NULL)
-		    	{
-		    	ping->png_ss[i] = (short)(100 * ss[i]);
-		    	ping->png_ssalongtrack[i]
-			    	= (short)(ssalongtrack[i] / daloscale);
-			}
-		    else
-		    	{
-		    	ping->png_ss[i] = EM2_INVALID_AMP;
-		    	ping->png_ssalongtrack[i] = EM2_INVALID_AMP;
-			}
-		    }
-
-		/* print debug statements */
-		if (verbose >= 2)
-			{
-			fprintf(stderr,"\ndbg2  Sidescan regenerated in <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg2       png_nbeams_ss: %d\n",
-				ping->png_nbeams_ss);
-			for (i=0;i<ping->png_nbeams_ss;i++)
-			  fprintf(stderr,"dbg2       beam:%d  flag:%3d  bath:%d  amp:%d  acrosstrack:%d  alongtrack:%d\n",
-				ping->png_beam_num[i],
-				ping->png_beamflag[i],
-				ping->png_depth[i],
-				ping->png_amp[i],
-				ping->png_acrosstrack[i],
-				ping->png_alongtrack[i]);
-			fprintf(stderr,"dbg2       pixels_ss:  %d\n",
-				MBSYS_SIMRAD2_MAXPIXELS);
-			for (i=0;i<MBSYS_SIMRAD2_MAXPIXELS;i++)
-			  fprintf(stderr,"dbg2       pixel:%4d  cnt:%3d  ss:%10f  xtrack:%10f  ltrack:%10f\n",
-				i,ss_cnt[i],ss[i],
-				ssacrosstrack[i],
-				ssalongtrack[i]);
-			fprintf(stderr,"dbg2       pixels_ss:  %d\n",
-				ping->png_pixels_ss);
-			for (i=0;i<MBSYS_SIMRAD2_MAXPIXELS;i++)
-			  fprintf(stderr,"dbg2       pixel:%4d  ss:%8d  ltrack:%8d\n",
-				i,ping->png_ss[i],ping->png_ssalongtrack[i]);
-			}
-		}
-
-	/* construct sidescan data for second sonar head (EM3002 data) */
-	if (store->kind == MB_DATA_DATA && store->sonar == MBSYS_SIMRAD2_EM3002)
-		{
-		/* get pointer to raw data structure */
-		ping = (struct mbsys_simrad2_ping_struct *) store->ping2;
-
-		/* zero the sidescan */
-		for (i=0;i<MBSYS_SIMRAD2_MAXPIXELS;i++)
-			{
-			ss[i] = 0.0;
-			ssacrosstrack[i] = 0.0;
-			ssalongtrack[i] = 0.0;
-			ss_cnt[i] = 0;
-			}
-
-		/* set scaling parameters */
-		depthscale = 0.01 * ping->png_depth_res;
-		depthoffset = 0.01 * ping->png_xducer_depth
-				+ 655.36 * ping->png_offset_multiplier;
-		dacrscale  = 0.01 * ping->png_distance_res;
-		daloscale  = 0.01 * ping->png_distance_res;
-		reflscale  = 0.5;
-		ssoffset = 64.0;
-		if (store->sonar == MBSYS_SIMRAD2_EM300
-		    && store->run_mode == 4)
-		    {
-		    if (depthscale * ping->png_depth[ping->png_nbeams/2] > 3500.0
-			&& ping->png_max_range > 19000
-			&& ping->png_bsn + ping->png_bso < -60)
-			{
-			ssoffset = 64.0 - 0.6 * (ping->png_bsn + ping->png_bso + 60);
-			}
-		    }
-
-		/* get raw pixel size */
-		if (store->sonar == MBSYS_SIMRAD2_EM120
-		    || store->sonar == MBSYS_SIMRAD2_EM300
-		    || store->sonar == MBSYS_SIMRAD2_EM1002
-		    || store->sonar == MBSYS_SIMRAD2_EM2000
-		    || store->sonar == MBSYS_SIMRAD2_EM3000
-		    || store->sonar == MBSYS_SIMRAD2_EM710)
-		    ss_spacing = 750.0 / ping->png_sample_rate;
-		else if (store->sonar == MBSYS_SIMRAD2_EM3000D_1
-		    || store->sonar == MBSYS_SIMRAD2_EM3000D_2
-		    || store->sonar == MBSYS_SIMRAD2_EM3000D_3
-		    || store->sonar == MBSYS_SIMRAD2_EM3000D_4
-		    || store->sonar == MBSYS_SIMRAD2_EM3000D_5
-		    || store->sonar == MBSYS_SIMRAD2_EM3000D_6
-		    || store->sonar == MBSYS_SIMRAD2_EM3000D_7
-		    || store->sonar == MBSYS_SIMRAD2_EM3000D_8
-		    || store->sonar == MBSYS_SIMRAD2_EM3002)
-		    ss_spacing = 750.0 / 14000;
-		else if (store->sonar == MBSYS_SIMRAD2_EM12S
-		    || store->sonar == MBSYS_SIMRAD2_EM12D
-		    || store->sonar == MBSYS_SIMRAD2_EM121
-		    || store->sonar == MBSYS_SIMRAD2_EM1000)
-		    {
-		    ss_spacing = 0.01 * ping->png_max_range;
-		    }
-
-		/* get beam angle size */
-		if (store->sonar == MBSYS_SIMRAD2_EM1000)
-		    {
-		    beamwidth = 2.5;
-		    }
-		else
-		    {
-		    beamwidth = 0.1 * ((double) ping->png_tx);
-		    }
-
-		/* get median depth */
-		nbathsort = 0;
-		for (i=0;i<ping->png_nbeams;i++)
-		    {
-		    if (mb_beam_ok(ping->png_beamflag[i]))
-			{
-			bathsort[nbathsort] = depthscale
-				* ping->png_depth[i]
-				    + depthoffset;
-			nbathsort++;
-			}
-		    }
-
-		/* get sidescan pixel size */
-		if (swath_width_set == MB_NO
-		    && nbathsort > 0)
-		    {
-		    (*swath_width) = 2.5 + MAX(90.0 - 0.01 * ping->png_depression[0],
-				    90.0 - 0.01 * ping->png_depression[ping->png_nbeams-1]);
-		    (*swath_width) = MAX((*swath_width), 60.0);
-		    }
-		if (pixel_size_set == MB_NO
-		    && nbathsort > 0)
-		    {
-		    qsort((char *)bathsort, nbathsort, sizeof(double),(void *)mb_double_compare);
-		    pixel_size_calc = 2 * tan(DTR * (*swath_width)) * bathsort[nbathsort/2]
-					/ MBSYS_SIMRAD2_MAXPIXELS;
-		    pixel_size_calc = MAX(pixel_size_calc, bathsort[nbathsort/2] * sin(DTR * 0.1));
-		    if ((*pixel_size) <= 0.0)
-			(*pixel_size) = pixel_size_calc;
-		    else if (0.95 * (*pixel_size) > pixel_size_calc)
-			(*pixel_size) = 0.95 * (*pixel_size);
-		    else if (1.05 * (*pixel_size) < pixel_size_calc)
-			(*pixel_size) = 1.05 * (*pixel_size);
-		    else
-			(*pixel_size) = pixel_size_calc;
-		    }
-
-		/* get pixel interpolation */
-		pixel_int_use = pixel_int + 1;
-
-		/* check that sidescan can be used */
-		/* get times of bath and sidescan records */
-		time_i[0] = ping->png_date / 10000;
-		time_i[1] = (ping->png_date % 10000) / 100;
-		time_i[2] = ping->png_date % 100;
-		time_i[3] = ping->png_msec / 3600000;
-		time_i[4] = (ping->png_msec % 3600000) / 60000;
-		time_i[5] = (ping->png_msec % 60000) / 1000;
-		time_i[6] = (ping->png_msec % 1000) * 1000;
-		mb_get_time(verbose, time_i, &bath_time_d);
-		time_i[0] = ping->png_ss_date / 10000;
-		time_i[1] = (ping->png_ss_date % 10000) / 100;
-		time_i[2] = ping->png_ss_date % 100;
-		time_i[3] = ping->png_ss_msec / 3600000;
-		time_i[4] = (ping->png_ss_msec % 3600000) / 60000;
-		time_i[5] = (ping->png_ss_msec % 60000) / 1000;
-		time_i[6] = (ping->png_ss_msec % 1000) * 1000;
-		mb_get_time(verbose, time_i, &ss_time_d);
-		ss_ok = MB_YES;
-		if (ping->png_nbeams < ping->png_nbeams_ss
-		    || ping->png_nbeams > ping->png_nbeams_ss + 1)
-		    {
-		    ss_ok = MB_NO;
-		    if (verbose > 0)
-			    fprintf(stderr,"%s: %4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d Sidescan ignored: num bath beams != num ss beams: %d %d\n",
-				    function_name, time_i[0], time_i[1], time_i[2],
-				    time_i[3], time_i[4], time_i[5], time_i[6],
-				    ping->png_nbeams, ping->png_nbeams_ss);
-		    }
-		else if (ping->png_nbeams == ping->png_nbeams_ss)
-		    {
-		    for (i=0;i<ping->png_nbeams;i++)
-			{
-			if (ping->png_beam_num[i] !=
-				ping->png_beam_index[i] + 1
-			    && ping->png_beam_num[i] !=
-				ping->png_beam_index[i] - 1)
-			    {
-		    	    ss_ok = MB_NO;
-			    if (verbose > 0)
-				    fprintf(stderr,"%s: %4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d Sidescan ignored: bath and ss beam indexes don't match: : %d %d %d\n",
-					    function_name, time_i[0], time_i[1], time_i[2],
-					    time_i[3], time_i[4], time_i[5], time_i[6],
-					    i, ping->png_beam_num[i], ping->png_beam_index[i]);
-			    }
-			}
-		    }
-
-
-		/* loop over raw sidescan, putting each raw pixel into
-			the binning arrays */
-		if (ss_ok == MB_YES)
-		for (i=0;i<ping->png_nbeams_ss;i++)
-			{
-			beam_ss = &ping->png_ssraw[ping->png_start_sample[i]];
-			if (mb_beam_ok(ping->png_beamflag[i]))
-			    {
-			    if (ping->png_beam_samples[i] > 0)
-				{
-				depth = depthscale * ping->png_depth[i];
-				xtrack = dacrscale * ping->png_acrosstrack[i];
-				range = sqrt(depth * depth + xtrack * xtrack);
-				angle = 90.0 - 0.01 * ping->png_depression[i];
-				beam_foot = range * sin(DTR * beamwidth)
-							/ cos(DTR * angle);
-				sint = fabs(sin(DTR * angle));
-				if (sint < ping->png_beam_samples[i] * ss_spacing / beam_foot)
-				    ss_spacing_use = beam_foot / ping->png_beam_samples[i];
-				else
-				    ss_spacing_use = ss_spacing / sint;
-/*fprintf(stderr, "spacing: %f %f n:%d sint:%f angle:%f range:%f foot:%f factor:%f\n",
-ss_spacing, ss_spacing_use,
-ping->png_beam_samples[i], sint, angle, range, beam_foot,
-ping->png_beam_samples[i] * ss_spacing / beam_foot);*/
-				}
-			    for (k=0;k<ping->png_beam_samples[i];k++)
-				{
-				if (beam_ss[k] != EM2_INVALID_AMP)
-					{
-					/* locate based on range */
-					if (k == ping->png_center_sample[i])
-					    {
-					    xtrackss = xtrack;
-					    }
-					else if (i == ping->png_nbeams_ss - 1
-					    || (k <= ping->png_center_sample[i]
-						&& i != 0))
-					    {
-					    if (ping->png_range[i] != ping->png_range[i-1])
-						{
-						xtrackss = dacrscale * ping->png_acrosstrack[i]
-						    + (dacrscale * ping->png_acrosstrack[i]
-							- dacrscale * ping->png_acrosstrack[i-1])
-						    * 2 *((double)(k - ping->png_center_sample[i]))
-						    / fabs((double)(ping->png_range[i] - ping->png_range[i-1]));
-						}
-					    else
-						{
-						xtrackss = xtrack
-						    + ss_spacing_use * (k - ping->png_center_sample[i]);
-						}
-					    }
-					else
-					    {
-					    if (ping->png_range[i] != ping->png_range[i+1])
-						{
-						xtrackss = dacrscale * ping->png_acrosstrack[i]
-						    + (dacrscale * ping->png_acrosstrack[i+1]
-							- dacrscale * ping->png_acrosstrack[i])
-						    * 2 *((double)(k - ping->png_center_sample[i]))
-						    / fabs((double)(ping->png_range[i+1] - ping->png_range[i]));
-						}
-					    else
-						{
-						xtrackss = xtrack
-						    + ss_spacing_use * (k - ping->png_center_sample[i]);
-						}
-					    }
-					xtrackss = xtrack
-						    + ss_spacing_use * (k - ping->png_center_sample[i]);
-					kk = MBSYS_SIMRAD2_MAXPIXELS / 2
-					    + (int)(xtrackss / (*pixel_size));
-					if (kk > 0 && kk < MBSYS_SIMRAD2_MAXPIXELS)
-					    {
-					    ss[kk]  += reflscale*((double)beam_ss[k]);
-					    ssalongtrack[kk]
-						    += daloscale * ping->png_alongtrack[i];
-					    ss_cnt[kk]++;
-					    }
-					}
-				}
-			    }
-			}
-
-		/* average the sidescan */
-		first = MBSYS_SIMRAD2_MAXPIXELS;
-		last = -1;
-		for (k=0;k<MBSYS_SIMRAD2_MAXPIXELS;k++)
-			{
-			if (ss_cnt[k] > 0)
-				{
-				ss[k] /= ss_cnt[k];
-				ssalongtrack[k] /= ss_cnt[k];
-				ssacrosstrack[k]
-					= (k - MBSYS_SIMRAD2_MAXPIXELS / 2)
-						* (*pixel_size);
-				first = MIN(first, k);
-				last = k;
-				}
-			else
-				ss[k] = MB_SIDESCAN_NULL;
-			}
-
-		/* interpolate the sidescan */
-		k1 = first;
-		k2 = first;
-		for (k=first+1;k<last;k++)
-		    {
-		    if (ss_cnt[k] <= 0)
-			{
-			if (k2 <= k)
-			    {
-			    k2 = k+1;
-			    while (ss_cnt[k2] <= 0 && k2 < last)
-				k2++;
-			    }
-			if (k2 - k1 <= pixel_int_use)
-			    {
-			    ss[k] = ss[k1]
-				+ (ss[k2] - ss[k1])
-				    * ((double)(k - k1)) / ((double)(k2 - k1));
-			    ssacrosstrack[k]
-				    = (k - MBSYS_SIMRAD2_MAXPIXELS / 2)
-					    * (*pixel_size);
-			    ssalongtrack[k] = ssalongtrack[k1]
-				+ (ssalongtrack[k2] - ssalongtrack[k1])
-				    * ((double)(k - k1)) / ((double)(k2 - k1));
-			    }
-			}
-		    else
-			{
-			k1 = k;
-			}
-		    }
-
-		/* insert the new sidescan into store */
-		ping->png_pixel_size = (int) (100 * (*pixel_size));
-		if (last > first)
-		    ping->png_pixels_ss = MBSYS_SIMRAD2_MAXPIXELS;
-		else
-		    ping->png_pixels_ss = 0;
-		for (i=0;i<MBSYS_SIMRAD2_MAXPIXELS;i++)
-		    {
-		    if (ss[i] > MB_SIDESCAN_NULL)
-		    	{
-		    	ping->png_ss[i] = (short)(100 * ss[i]);
-		    	ping->png_ssalongtrack[i]
-			    	= (short)(ssalongtrack[i] / daloscale);
-			}
-		    else
-		    	{
-		    	ping->png_ss[i] = EM2_INVALID_AMP;
-		    	ping->png_ssalongtrack[i] = EM2_INVALID_AMP;
-			}
-		    }
-
-		/* print debug statements */
-		if (verbose >= 2)
-			{
-			fprintf(stderr,"\ndbg2  Sidescan regenerated in <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg2       png_nbeams_ss: %d\n",
-				ping->png_nbeams_ss);
-			for (i=0;i<ping->png_nbeams_ss;i++)
-			  fprintf(stderr,"dbg2       beam:%d  flag:%3d  bath:%d  amp:%d  acrosstrack:%d  alongtrack:%d\n",
-				ping->png_beam_num[i],
-				ping->png_beamflag[i],
-				ping->png_depth[i],
-				ping->png_amp[i],
-				ping->png_acrosstrack[i],
-				ping->png_alongtrack[i]);
-			fprintf(stderr,"dbg2       pixels_ss:  %d\n",
-				MBSYS_SIMRAD2_MAXPIXELS);
-			for (i=0;i<MBSYS_SIMRAD2_MAXPIXELS;i++)
-			  fprintf(stderr,"dbg2       pixel:%4d  cnt:%3d  ss:%10f  xtrack:%10f  ltrack:%10f\n",
-				i,ss_cnt[i],ss[i],
-				ssacrosstrack[i],
-				ssalongtrack[i]);
-			fprintf(stderr,"dbg2       pixels_ss:  %d\n",
-				ping->png_pixels_ss);
-			for (i=0;i<MBSYS_SIMRAD2_MAXPIXELS;i++)
-			  fprintf(stderr,"dbg2       pixel:%4d  ss:%8d  ltrack:%8d\n",
-				i,ping->png_ss[i],ping->png_ssalongtrack[i]);
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       pixel_size:      %f\n",*pixel_size);
-		fprintf(stderr,"dbg2       swath_width:     %f\n",*swath_width);
-		fprintf(stderr,"dbg2       error:           %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:          %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mbsys_simrad2.h b/src/mbio/mbsys_simrad2.h
deleted file mode 100644
index 659a17c..0000000
--- a/src/mbio/mbsys_simrad2.h
+++ /dev/null
@@ -1,1136 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbsys_simrad2.h		10/9/98
- *	$Id: mbsys_simrad2.h 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1998-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbsys_simrad2.h defines the MBIO data structures for handling data from
- * new (post-2006) Simrad multibeam sonars (e.g. EM710).
- * The data formats associated with Simrad multibeams
- * (both old and new) include:
- *    MBSYS_SIMRAD formats (code in mbsys_simrad.c and mbsys_simrad.h):
- *      MBF_EMOLDRAW : MBIO ID 51 - Vendor EM1000, EM12S, EM12D, EM121
- *                   : MBIO ID 52 - aliased to 51
- *      MBF_EM12IFRM : MBIO ID 53 - IFREMER EM12S and EM12D
- *      MBF_EM12DARW : MBIO ID 54 - NERC EM12S
- *                   : MBIO ID 55 - aliased to 51
- *    MBSYS_SIMRAD2 formats (code in mbsys_simrad2.c and mbsys_simrad2.h):
- *      MBF_EM300RAW : MBIO ID 56 - Vendor EM3000, EM300, EM120
- *      MBF_EM300MBA : MBIO ID 57 - MBARI EM3000, EM300, EM120 for processing
- *    MBSYS_SIMRAD2 formats (code in mbsys_simrad2.c and mbsys_simrad2.h):
- *      MBF_EM710RAW : MBIO ID 58 - Vendor EM710
- *      MBF_EM710MBA : MBIO ID 59 - MBARI EM710 for processing
- *
- *
- * Author:	D. W. Caress
- * Date:	October 9, 1998
- *
- * $Log: mbsys_simrad2.h,v $
- * Revision 5.22  2009/03/02 18:51:52  caress
- * Fixed problems with formats 58 and 59, and also updated copyright dates in several source files.
- *
- * Revision 5.21  2008/03/01 09:14:03  caress
- * Some housekeeping changes.
- *
- *
- */
-/*
- * Notes on the MBSYS_SIMRAD2 data structure:
- *   1. Simrad multibeam systems output datagrams which are
- *      a combination of ascii and binary. This code has been written
- *      using data format specifications found in an April 28, 1998
- *      technical note from Simrad.
- *   2. Simrad multibeam sonars output both bathymetry
- *      and amplitude information for beams and sidescan information
- *      with a higher resolution than the bathymetry and amplitude.
- *   3. There are three systems of interest:
- *         EM-3000:  Single array 300 kHz shallow water system with up to 127
- *                   beams of bathymetry and a variable number of sidescan
- *                   samples per bathymetry beam.
- *         EM-3000D: Double array 300 kHz shallow water system with up to 254
- *                   beams of bathymetry and a variable number of sidescan
- *                   samples per bathymetry beam.
- *         EM-2000:  Single array 200 kHz shallow water system with up to 87
- *                   beams of bathymetry and a variable number of sidescan
- *                   samples per bathymetry beam.
- *         EM-1002:  Single array 95 kHz shallow water system with up to 111
- *                   beams of bathymetry and a variable number of sidescan
- *                   samples per bathymetry beam.
- *         EM-300:   Single array 30 kHz mid water system with up to 135
- *                   beams of bathymetry and a variable number of sidescan
- *                   samples per bathymetry beam. This system applies
- *                   pitch and yaw compensation to achieve
- *                   more uniform coverage of the seafloor.
- *         EM-120:   Single array 12 kHz full ocean system with up to 191
- *                   beams of bathymetry and a variable number of sidescan
- *                   samples per bathymetry beam. This system applies
- *                   pitch and yaw compensation to achieve
- *                   more uniform coverage of the seafloor.
- *   4. Each telegram is preceded by a two byte start code 0x02 and
- *      followed by a three byte end code consisting of 0x03
- *      followed by two bytes representing the checksum for
- *      the data bytes.  MB-System does not check the checksums
- *      on input, but does calculate the checksums for output.
- *   5. The Kongsberg Simrad datagram format manual lists a large number
- *      of datagram types. The complete list of telegram start codes,
- *      types, and sizes is given below. Datagram listings preceded
- *      by an "*" are recognized by MB-System. Unrecognized datagrams
- *      will be skipped on input and not included in output files.
- *        *0x0231: Parameter - Data out off               variable size
- *        *0x0232: Parameter - Data out on                variable size
- *        *0x0230: Parameter - Stop                       variable size
- *        *0x0241: Attitude Output                        1222 bytes
- *        *0x0243: Clock Output                           28 bytes
- *        *0x0244: Bathymetry                             48-4092 bytes
- *         0x0245: Single beam echosounder depth          32 bytes
- *        *0x0246: Raw range and beam angle               24-2056 bytes
- *        *0x0247: Surface sound speed                    variable size
- *        *0x0248: Heading Output                         422 bytes
- *        *0x0249: Parameter - Start                      variable size
- *        *0x024A: Mechanical transducer tilt             variable size
- *         0x024B: Central beams echogram                 variable size
- *        *0x0250: Position                               100-134 bytes
- *        *0x0252: Runtime Parameter                      52 bytes
- *        *0x0253: Sidescan                               48->5K bytes
- *        *0x0254: Tide Output                            30 bytes
- *        *0x0255: Sound velocity profile (new)           variable size
- *        *0x0256: Sound velocity profile (old)           variable size
- *         0x0257: SSP input                              variable size
- *        *0x0265: Raw range and beam angle               112-1658 bytes
- *        *0x0266: Raw range and beam angle               44-1658 bytes
- *        *0x0268: Height Output                          24 bytes
- *        *0x0269: Parameter - Stop                       variable size
- *        *0x026B: Water column                           variable size
- *         0x0270: Parameter - Remote                     variable size
- *         0x0273: Surface sound speed                    variable size
- *        *0x02E1: Bathymetry (MBARI format 57)           48-4092 bytes
- *        *0x02E2: Sidescan (MBARI format 57)             48->5K bytes
- *   6. Simrad systems record navigation fixes using the position
- *      datagram; no navigation is included in the per ping data.  Thus,
- *      it is necessary to extrapolate the navigation for each ping
- *      at read time from the last navigation fix.  The frequency of
- *      GPS fixes generally assures that this is not a problem, but
- *      we offer no guarentees that this will always be the case.
- *      In this format the navigation fix datagrams include copies of
- *      the ASCII data records (typically NMEA 0183) input into the
- *      sonar by the navigation system.
- *   7. The beam depths are give relative to the transmit transducer
- *      or sonar head depth and the horizontal location of the active
- *      positioning system's antenna (or reference point). Heave,
- *      roll, pitch, sound speed at the transducer depth and ray
- *      bending have been applied. In the EM3000 the beam depths must
- *      be regarded as signed values to take into account beams
- *      which may be going upwards. On the EM300 the beam depths are
- *      always positive and the values are therefore unsigned.
- *      To obtain depths relative to the water line, the
- *      raw depths must be added to the transmit transducer depth plus
- *      the depth offset multiplier times 65536 cm. The depth offset
- *      multiplier will be zero except when
- *        1) the EM3000 sonar head is on an underwater vehicle
- *           at a depth greater than 650 m, or
- *        2) when the heave is large enough to bring the transmit
- *           transducer above the water line (the depth offset
- *           multiplier is -1 in this case).
- *   8. The new Simrad sonars record the heading and attitude sensor
- *      data streams input into the sonar, usually at a sampling
- *      frequency of 100 Hz.
- *   9. Although this new format started out as a fairly clean conception,
- *      later revisions adding new information have been implemented in
- *      an unnecessarily complicated fashion. For example,
- *      if the sonar is an EM300 or EM3000, then the sample rate
- *      value contains the sample rate in Hz as an unsigned short.
- *      The range resolution in time is half the inverse of the
- *      sampling rate, or approximately 2.5 cm for an EM3000.
- *      HOWEVER, if the sonar is an EM3000D, then the sample rate value
- *      contains the depth difference between the two sonar heads
- *      (the units are not specified in the spec, but are presumably in
- *      cm like the transmit transducer depth). In this case, the transmit
- *      transducer depth for the second sonar head is the transmit
- *      transducer depth plus the depth difference. The sample rate for the
- *      EM3000D is derived from the sonar model,  as follows:
- *        Sonar Model     Head 1 Sample Rate     Head 2 Sample Rate
- *        -----------     ------------------     ------------------
- *           3002              13956 Hz               14621 Hz
- *           3003              13956 Hz               14621 Hz
- *           3004              14293 Hz               14621 Hz
- *           3005              13956 Hz               14293 Hz
- *           3006              14621 Hz               14293 Hz
- *           3007              14293 Hz               13956 Hz
- *           3008              14621 Hz               13956 Hz
- *      In the case of sonar model 3002, the depth difference should be
- *      taken as zero, regardless of the value found in the data.
- *  10. An additional complication involves the beam angles and travel
- *      times reported in the data stream. In the original format
- *      specification, the beam range is given as a one way travel time,
- *      the beam depression angle is positive downwards (90 deg at vertical)
- *      and the beam azimuth angle gives the orientation of the sounding
- *      relative to the heading of the vessel. These values include the
- *      effects of the vessels motion during the ping cycle (heave, pitch,
- *      roll, and yaw), and are sufficient for recalculating bathymetry
- *      by raytracing (an improvement over older Simrad data formats).
- *      HOWEVER, the sonar operator can specify a data recording mode in
- *      which the raw times and angles are recorded without correction
- *      for the vessel motion. In this case, the raw two-way travel times
- *      are recorded instead of one-way travel times. Also, the beam
- *      depression angles are replaced by beam pointing angles, which are
- *      the angles relative to the sonar heads before correction for roll
- *      and roll bias. The beam azimuth angle is replaced by a combination
- *      of a flag signaling the raw data mode (angle values greater than 35999
- *      indicates storage of uncorrected range and angle data) and the
- *      transmitter tilt angle (angle value minus 54000 in 0.01 deg). The
- *      purpose of the uncorrected data mode is to allow users to
- *      fully recalculate the data following revision of the heading and
- *      attitude data streams.
- *      NOTE: As of May 2002, Simrad seems to have implemented a different
- *      scheme for the EM300 and EM120 sonars. There is a new raw range and
- *      angle datagram (0x0265) that is output in addition to the depth and
- *      seafloor image datagrams. This would seem to make obsolete the notion
- *      of placing uncorrected ranges and angles in the depth datagram.
- *  11. The sidescan is structured in terms of a certain number of samples
- *      per beam. The range sampling rate for the sidescan is the same as
- *      that specified in the depth datagram and the ranges in the sidescan
- *      datagram (seabed image datagram) are all two way travel times.
- *  12. The attitude data is output asynchronously with respect to the
- *      ping output datagrams. Typical motion sensors give data at a 100 Hz
- *      rate. The attitude datagrams are given when the number of measurements
- *      is 100, or usually at 1 second intervals. The attitude data timing
- *      is corrected for the sensor time delay entered by the operator. If
- *      roll is input with respect to the horizontal, then the sonar
- *      recalculates the roll so that the output values are in the plane
- *      defined by the heading and pitch axis. The entered sensor offsets
- *      (roll bias, pitch bias, heading bias). Extra heave at the transducer
- *      due to roll and pitch when the sensor does not give its data at the
- *      transducer position is also included and heave is positive downwards.
- *      The sensor status is copied from the input datagram's two sync bytes
- *      with the second byte always set to 0x90. The first byte is either
- *      zero or in the 0x90-0xAF range. If the latter is true, then 0x90
- *      indicates valid data with full accuracy, 0x91-0x99 indicates valid
- *      data with gradually reduced accuracy, 0x9A-0x9F indicates invalid data
- *      from an operating sensor,  and 0xA0-0xAF indicates invalid data
- *      from a faulty sensor. This interpretation may be dependent on the
- *      attitude sensor type.
- *  13. The heading data is output asynchronously with respect to the
- *      ping output datagrams. Typical heading sensors give data at a 10 Hz
- *      rate. The attitude datagrams are given when the number of measurements
- *      is 100, or usually at 10 second intervals. The heading data is
- *      corrected for the heading offset entered by the operator.
- *  14. The raw vendor format (format 56) does not support flagging of bathymetry
- *      values nor does it store navigation in the bathymetry data records.
- *      MB-System also supports a processing format (57) which includes
- *      beamflags and navigation in the bathymetry records. This format
- *      is identical to the vendor format except for the use of a
- *      slightly different bathymetry record.
- *
- */
-
-/* include mb_define.h */
-#ifndef MB_DEFINE_DEF
-#include "mb_define.h"
-#endif
-
-/* sonar models */
-#define	MBSYS_SIMRAD2_UNKNOWN	0
-#define	MBSYS_SIMRAD2_EM120	120
-#define	MBSYS_SIMRAD2_EM300	300
-#define	MBSYS_SIMRAD2_EM1002	1002
-#define	MBSYS_SIMRAD2_EM2000	2000
-#define	MBSYS_SIMRAD2_EM3000	3000
-#define	MBSYS_SIMRAD2_EM3000D_1	3001
-#define	MBSYS_SIMRAD2_EM3000D_2	3002
-#define	MBSYS_SIMRAD2_EM3000D_3	3003
-#define	MBSYS_SIMRAD2_EM3000D_4	3004
-#define	MBSYS_SIMRAD2_EM3000D_5	3005
-#define	MBSYS_SIMRAD2_EM3000D_6	3006
-#define	MBSYS_SIMRAD2_EM3000D_7	3007
-#define	MBSYS_SIMRAD2_EM3000D_8	3008
-#define	MBSYS_SIMRAD2_EM3002	3020
-#define	MBSYS_SIMRAD2_EM710	 710
-
-#define	MBSYS_SIMRAD2_EM12S	9901
-#define	MBSYS_SIMRAD2_EM12D	9902
-#define	MBSYS_SIMRAD2_EM121	9903
-#define	MBSYS_SIMRAD2_EM100	9904
-#define	MBSYS_SIMRAD2_EM1000	9905
-
-/* maximum number of beams and pixels */
-#define	MBSYS_SIMRAD2_MAXBEAMS		254
-#define	MBSYS_SIMRAD2_MAXPIXELS		1024
-#define	MBSYS_SIMRAD2_MAXRAWPIXELS	65535
-#define MBSYS_SIMRAD2_MAXTX		19
-#define	MBSYS_SIMRAD2_MAXSVP		1024
-#define	MBSYS_SIMRAD2_MAXATTITUDE	256
-#define	MBSYS_SIMRAD2_MAXHEADING	256
-#define	MBSYS_SIMRAD2_MAXSSV		256
-#define	MBSYS_SIMRAD2_MAXTILT		256
-#define	MBSYS_SIMRAD2_COMMENT_LENGTH	256
-#define	MBSYS_SIMRAD2_BUFFER_SIZE	2048
-
-/* datagram start and end byte */
-#define	EM2_START_BYTE		0x02
-#define	EM2_END_BYTE		0x03
-#define	EM2_END			0x03
-
-/* datagram types including start byte */
-#define	EM2_NONE		0
-#define	EM2_STOP2		0x0230
-#define	EM2_STATUS		0x0231
-#define	EM2_OFF			0x0231
-#define	EM2_ON			0x0232
-#define	EM2_ATTITUDE		0x0241
-#define	EM2_CLOCK		0x0243
-#define	EM2_BATH		0x0244
-#define	EM2_SBDEPTH		0x0245
-#define	EM2_RAWBEAM		0x0246
-#define	EM2_SSV			0x0247
-#define	EM2_HEADING		0x0248
-#define	EM2_START		0x0249
-#define	EM2_TILT		0x024A
-#define	EM2_CBECHO		0x024B
-#define	EM2_POS			0x0250
-#define	EM2_RUN_PARAMETER	0x0252
-#define	EM2_SS			0x0253
-#define	EM2_TIDE		0x0254
-#define	EM2_SVP2		0x0255
-#define	EM2_SVP			0x0256
-#define	EM2_SSPINPUT		0x0257
-#define	EM2_RAWBEAM2		0x0265
-#define	EM2_RAWBEAM3		0x0266
-#define	EM2_HEIGHT		0x0268
-#define	EM2_STOP		0x0269
-#define	EM2_WATERCOLUMN		0x026B
-#define	EM2_REMOTE		0x0270
-#define	EM2_SSP			0x0273
-#define	EM2_BATH_MBA		0x02E1
-#define	EM2_SS_MBA		0x02E2
-
-/* datagram types */
-#define	EM2_ID_STOP2		0x30
-#define	EM2_ID_STATUS		0x31
-#define	EM2_ID_OFF		0x31
-#define	EM2_ID_ON		0x32
-#define	EM2_ID_ATTITUDE		0x41
-#define	EM2_ID_CLOCK		0x43
-#define	EM2_ID_BATH		0x44
-#define	EM2_ID_SBDEPTH		0x45
-#define	EM2_ID_RAWBEAM		0x46
-#define	EM2_ID_SSV		0x47
-#define	EM2_ID_HEADING		0x48
-#define	EM2_ID_START		0x49
-#define	EM2_ID_TILT		0x4A
-#define	EM2_ID_CBECHO		0x4B
-#define	EM2_ID_POS		0x50
-#define	EM2_ID_RUN_PARAMETER	0x52
-#define	EM2_ID_SS		0x53
-#define	EM2_ID_TIDE		0x54
-#define	EM2_ID_SVP2		0x55
-#define	EM2_ID_SVP		0x56
-#define	EM2_ID_SSPINPUT		0x57
-#define	EM2_ID_RAWBEAM2		0x65
-#define	EM2_ID_RAWBEAM3		0x66
-#define	EM2_ID_HEIGHT		0x68
-#define	EM2_ID_STOP		0x69
-#define	EM2_ID_WATERCOLUMN	0x6B
-#define	EM2_ID_REMOTE		0x70
-#define	EM2_ID_SSP		0x73
-#define	EM2_ID_BATH_MBA		0xE1
-#define	EM2_ID_SS_MBA		0xE2
-
-/* datagram sizes where constant */
-#define	EM2_RUN_PARAMETER_SIZE		52
-#define	EM2_CLOCK_SIZE			28
-#define	EM2_TIDE_SIZE			30
-#define	EM2_HEIGHT_SIZE			24
-#define	EM2_START_HEADER_SIZE		14
-#define	EM2_HEADING_HEADER_SIZE		14
-#define	EM2_HEADING_SLICE_SIZE		4
-#define	EM2_SSV_HEADER_SIZE		14
-#define	EM2_SSV_SLICE_SIZE		4
-#define	EM2_TILT_HEADER_SIZE		14
-#define	EM2_TILT_SLICE_SIZE		4
-#define	EM2_ATTITUDE_HEADER_SIZE	14
-#define	EM2_ATTITUDE_SLICE_SIZE		12
-#define	EM2_POS_HEADER_SIZE		30
-#define	EM2_SVP_HEADER_SIZE		24
-#define	EM2_SVP_SLICE_SIZE		4
-#define	EM2_SVP2_HEADER_SIZE		24
-#define	EM2_SVP2_SLICE_SIZE		8
-#define	EM2_BATH_HEADER_SIZE		24
-#define	EM2_BATH_BEAM_SIZE		16
-#define	EM2_BATH_MBA_HEADER_SIZE	34
-#define	EM2_BATH_MBA_BEAM_SIZE		18
-#define	EM2_RAWBEAM_HEADER_SIZE		16
-#define	EM2_RAWBEAM_BEAM_SIZE		8
-#define	EM2_RAWBEAM2_HEADER_SIZE	42
-#define	EM2_RAWBEAM2_BEAM_SIZE		16
-#define	EM2_RAWBEAM2_TX_SIZE		12
-#define	EM2_RAWBEAM3_HEADER_SIZE	32
-#define	EM2_RAWBEAM3_BEAM_SIZE		12
-#define	EM2_RAWBEAM3_TX_SIZE		20
-#define	EM2_SS_HEADER_SIZE		28
-#define	EM2_SS_BEAM_SIZE		6
-#define	EM2_SS_MBA_HEADER_SIZE		32
-#define	EM2_SS_MBA_BEAM_SIZE		6
-#define	EM2_WC_HEADER_SIZE		36
-#define	EM2_WC_TX_SIZE			6
-#define	EM2_WC_BEAM_SIZE		10
-
-/* invalid value flags */
-#define	EM2_INVALID_AMP			0x7F
-#define	EM2_INVALID_CHAR		0xFF
-#define	EM2_INVALID_SHORT		0xFFFF
-#define EM2_INVALID_U_INT		0xFFFFFFFF
-#define EM2_INVALID_INT			0x7FFFFFFF
-
-/* internal data structure for survey data */
-struct mbsys_simrad2_ping_struct
-	{
-	int	png_date;	/* date = year*10000 + month*100 + day
-				    Feb 26, 1995 = 19950226 */
-	int	png_msec;	/* time since midnight in msec
-				    08:12:51.234 = 29570234 */
-	int	png_count;	/* sequential counter or input identifier */
-	int	png_serial;	/* system 1 or system 2 serial number */
-	int	png_latitude;	/* latitude in decimal degrees * 20000000
-				    (negative in southern hemisphere)
-				    if valid, invalid = 0x7FFFFFFF */
-	int	png_longitude;	/* longitude in decimal degrees * 10000000
-				    (negative in western hemisphere)
-				    if valid, invalid = 0x7FFFFFFF */
-	int	png_speed;	/* speed over ground (cm/sec) if valid,
-				    invalid = 0xFFFF */
-	int	png_heading;	/* heading (0.01 deg) */
-	int	png_heave;	/* heave from interpolation (0.01 m) */
-	int	png_roll;	/* roll from interpolation (0.01 deg) */
-	int	png_pitch;	/* pitch from interpolation (0.01 deg) */
-	int	png_ssv;	/* sound speed at transducer (0.1 m/sec) */
-	int	png_xducer_depth;
-				/* transmit transducer depth (0.01 m)
-				    - The transmit transducer depth plus the
-					depth offset multiplier times 65536 cm
-					should be added to the beam depths to
-					derive the depths re the water line.
-					The depth offset multiplier will usually
-					be zero, except when the EM3000 sonar
-					head is on an underwater vehicle at a
-					depth greater than about 650 m. Note that
-					the offset multiplier will be negative
-					(-1) if the actual heave is large enough
-					to bring the transmit transducer above
-					the water line. This may represent a valid
-					situation,  but may also be due to an
-					erroneously set installation depth of
-					the either transducer or the water line. */
-	int	png_offset_multiplier;
-				/* transmit transducer depth offset multiplier
-				   - see note 7 above */
-	int	png_nbeams_max;	/* maximum number of beams possible */
-	int	png_nbeams;	/* number of valid beams */
-	int	png_depth_res;	/* depth resolution (0.01 m) */
-	int	png_distance_res;
-				/* x and y resolution (0.01 m) */
-	int	png_sample_rate;
-				/* sampling rate (Hz) OR depth difference between
-				    sonar heads in EM3000D - see note 9 above */
-	int	png_depth[MBSYS_SIMRAD2_MAXBEAMS];
-				/* depths in depth resolution units */
-	int	png_acrosstrack[MBSYS_SIMRAD2_MAXBEAMS];
-				/* acrosstrack distances in distance resolution units */
-	int	png_alongtrack[MBSYS_SIMRAD2_MAXBEAMS];
-				/* alongtrack distances in distance resolution units */
-	int	png_depression[MBSYS_SIMRAD2_MAXBEAMS];
-				/* Primary beam angles in one of two formats (see note 10 above)
-				   1) Corrected format - gives beam depression angles
-				        in 0.01 degree. These are the takeoff angles used
-					in raytracing calculations.
-				   2) Uncorrected format - gives beam pointing angles
-				        in 0.01 degree. These values are relative to
-					the transducer array and have not been corrected
-					for vessel motion. */
-	int	png_azimuth[MBSYS_SIMRAD2_MAXBEAMS];
-				/* Secondary beam angles in one of two formats (see note 10 above)
-				   1) Corrected format - gives beam azimuth angles
-				        in 0.01 degree. These values used to rotate sounding
-					position relative to the sonar after raytracing.
-				   2) Uncorrected format - combines a flag indicating that
-				        the angles are in the uncorrected format with
-					beam tilt angles. Values greater than
-					35999 indicate the uncorrected format is in use. The
-					beam tilt angles are given as (value - 54000) in
-					0.01 degree; the tilt angles give the tilt of the
-					transmitted ping due to compensation for vessel
-					motion. */
-	int	png_range[MBSYS_SIMRAD2_MAXBEAMS];
-				/* Ranges in one of two formats (see note 10 above):
-				   1) Corrected format - the ranges are one way
-				        travel times in time units defined as half
-					the inverse sampling rate.
-				   2) Uncorrected format - the ranges are raw two
-				        way travel times in time units defined as
-					half the inverse sampling rate. These values
-					have not been corrected for changes in the
-					heave during the ping cycle. */
-	int	png_quality[MBSYS_SIMRAD2_MAXBEAMS];
-				/* 0-254 */
-	int	png_window[MBSYS_SIMRAD2_MAXBEAMS];
-				/* samples/4 */
-	int	png_amp[MBSYS_SIMRAD2_MAXBEAMS];
-				/* 0.5 dB */
-	int	png_beam_num[MBSYS_SIMRAD2_MAXBEAMS];
-				/* beam 128 is first beam on
-				    second head of EM3000D */
-	char	png_beamflag[MBSYS_SIMRAD2_MAXBEAMS];
-				/* uses standard MB-System beamflags */
-
-	/* raw travel time and angle data */
-	int	png_raw1_read;	/* flag indicating actual reading of old rawbeam record */
-	int	png_raw2_read;	/* flag indicating actual reading of new rawbeam record */
-	int	png_raw_date;	/* date = year*10000 + month*100 + day
-				    Feb 26, 1995 = 19950226 */
-	int	png_raw_msec;	/* time since midnight in msec
-				    08:12:51.234 = 29570234 */
-	int	png_raw_count;	/* sequential counter or input identifier */
-	int	png_raw_serial;	/* system 1 or system 2 serial number */
-	int	png_raw_heading;	/* heading (0.01 deg) */
-	int	png_raw_ssv;		/* sound speed at transducer (0.1 m/sec) */
-	int	png_raw_xducer_depth;	/* transmit transducer depth (0.01 m) */
-	int	png_raw_nbeams_max;	/* maximum number of beams possible */
-	int	png_raw_nbeams;		/* number of raw travel times and angles
-					    - nonzero only if raw beam record read */
-	int	png_raw_depth_res;	/* depth resolution (0.01 m) */
-	int	png_raw_distance_res;	/* x and y resolution (0.01 m) */
-	int	png_raw_sample_rate;	/* sampling rate (Hz or 0.01 Hz) */
-	int	png_raw_status;		/* status from PU/TRU */
-	int	png_raw_rangenormal;	/* normal incidence range (meters) */
-	int	png_raw_normalbackscatter; /* normal incidence backscatter (dB) (-60 to +9) */
-	int	png_raw_obliquebackscatter; /* oblique incidence backscatter (dB) (-60 to +9) */
-	int	png_raw_fixedgain;	/* fixed gain (dB) (0 to 30) */
-	int	png_raw_txpower;	/* transmit power (dB) (0, -10, or -20) */
-	int	png_raw_mode;		/* sonar mode:
-						0 : very shallow
-						1 : shallow
-						2 : medium
-						3 : deep
-						4 : very deep
-						5 : extra deep */
-	int	png_raw_coverage;	/* swath width (degrees) (10 to 150 degrees) */
-	int	png_raw_yawstabheading; /* yaw stabilization heading (0.01 degrees) */
-	int	png_raw_ntx;		/* number of TX pulses (1 to 9) */
-	int	png_raw_txlastbeam[MBSYS_SIMRAD2_MAXTX];/* last beam number in this TX pulse */
-	int	png_raw_txtiltangle[MBSYS_SIMRAD2_MAXTX];/* tilt angle (0.01 deg) */
-	int	png_raw_txheading[MBSYS_SIMRAD2_MAXTX];	/* heading (0.01 deg) */
-	int	png_raw_txroll[MBSYS_SIMRAD2_MAXTX];	/* roll (0.01 deg) */
-	int	png_raw_txpitch[MBSYS_SIMRAD2_MAXTX];	/* pitch angle (0.01 deg) */
-	int	png_raw_txheave[MBSYS_SIMRAD2_MAXTX];	/* heave (0.01 m) */
-	int	png_raw_rxrange[MBSYS_SIMRAD2_MAXBEAMS];
-				/* Ranges as raw two way travel times in time
-					units defined as one-fourth the inverse
-					sampling rate. These values have not
-					been corrected for changes in the
-					heave during the ping cycle. */
-	int	png_raw_rxquality[MBSYS_SIMRAD2_MAXBEAMS];	/* beam quality flag */
-	int	png_raw_rxwindow[MBSYS_SIMRAD2_MAXBEAMS];	/* length of detection window */
-	int	png_raw_rxamp[MBSYS_SIMRAD2_MAXBEAMS];		/* 0.5 dB */
-	int	png_raw_rxbeam_num[MBSYS_SIMRAD2_MAXBEAMS];
-				/* beam 128 is first beam on
-				    second head of EM3000D */
-	int	png_raw_rxpointangle[MBSYS_SIMRAD2_MAXBEAMS];
-				/* Raw beam pointing angles in 0.01 degree,
-					positive to port.
-					These values are relative to the transducer
-					array and have not been corrected
-					for vessel motion. */
-	int	png_raw_rxtiltangle[MBSYS_SIMRAD2_MAXBEAMS];
-				/* Raw transmit tilt angles in 0.01 degree,
-					positive forward.
-					These values are relative to the transducer
-					array and have not been corrected
-					for vessel motion. */
-	int	png_raw_rxheading[MBSYS_SIMRAD2_MAXBEAMS];	/* heading (0.01 deg) */
-	int	png_raw_rxroll[MBSYS_SIMRAD2_MAXBEAMS];	/* roll (0.01 deg) */
-	int	png_raw_rxpitch[MBSYS_SIMRAD2_MAXBEAMS];	/* pitch angle (0.01 deg) */
-	int	png_raw_rxheave[MBSYS_SIMRAD2_MAXBEAMS];	/* heave (0.01 m) */
-
-	/* raw travel time and angle data version 3 */
-	int	png_raw3_read;	/* flag indicating actual reading of newer rawbeam record */
-	int	png_raw3_date;	/* date = year*10000 + month*100 + day
-				    Feb 26, 1995 = 19950226 */
-	int	png_raw3_msec;	/* time since midnight in msec
-				    08:12:51.234 = 29570234 */
-	int	png_raw3_count;	/* sequential counter or input identifier */
-	int	png_raw3_serial;	/* system 1 or system 2 serial number */
-	int	png_raw3_ntx;		/* number of TX pulses (1 to 9) */
-	int	png_raw3_nbeams;		/* number of raw travel times and angles
-					    - nonzero only if raw beam record read */
-	int	png_raw3_sample_rate;	/* sampling rate (Hz or 0.01 Hz) */
-	int	png_raw3_xducer_depth;	/* transmit transducer depth (0.01 m) */
-	int	png_raw3_ssv;		/* sound speed at transducer (0.1 m/sec) */
-	int	png_raw3_nbeams_max;	/* maximum number of beams possible */
-	int	png_raw3_txtiltangle[MBSYS_SIMRAD2_MAXTX];/* tilt angle (0.01 deg) */
-	int	png_raw3_txfocus[MBSYS_SIMRAD2_MAXTX];   /* focus range (0.1 m)
-								0 = no focus */
-	int	png_raw3_txsignallength[MBSYS_SIMRAD2_MAXTX];	/* signal length (usec) */
-	int	png_raw3_txoffset[MBSYS_SIMRAD2_MAXTX];	/* transmit time offset (usec) */
-	int	png_raw3_txcenter[MBSYS_SIMRAD2_MAXTX];	/* center frequency (Hz) */
-	int	png_raw3_txbandwidth[MBSYS_SIMRAD2_MAXTX];	/* bandwidth (10 Hz) */
-	int	png_raw3_txwaveform[MBSYS_SIMRAD2_MAXTX];	/* signal waveform identifier
-									0 = CW, 1 = FM */
-	int	png_raw3_txsector[MBSYS_SIMRAD2_MAXTX];	/* transmit sector number (0-19) */
-	int	png_raw3_rxpointangle[MBSYS_SIMRAD2_MAXBEAMS];
-				/* Raw beam pointing angles in 0.01 degree,
-					positive to port.
-					These values are relative to the transducer
-					array and have not been corrected
-					for vessel motion. */
-	int	png_raw3_rxrange[MBSYS_SIMRAD2_MAXBEAMS];	/* Ranges (0.25 samples) */
-	int	png_raw3_rxsector[MBSYS_SIMRAD2_MAXBEAMS];	/* transmit sector identifier */
-	int	png_raw3_rxamp[MBSYS_SIMRAD2_MAXBEAMS];		/* 0.5 dB */
-	int	png_raw3_rxquality[MBSYS_SIMRAD2_MAXBEAMS];	/* beam quality flag */
-	int	png_raw3_rxwindow[MBSYS_SIMRAD2_MAXBEAMS];	/* length of detection window */
-	int	png_raw3_rxbeam_num[MBSYS_SIMRAD2_MAXBEAMS];
-				/* beam 128 is first beam on
-				    second head of EM3000D */
-	int	png_raw3_rxspare[MBSYS_SIMRAD2_MAXBEAMS];	/* spare */
-
-	/* sidescan */
-	int	png_ss_read;	/* flag indicating actual reading of sidescan record */
-	int	png_ss_date;	/* date = year*10000 + month*100 + day
-				    Feb 26, 1995 = 19950226 */
-	int	png_ss_msec;	/* time since midnight in msec
-				    08:12:51.234 = 29570234 */
-	int	png_ss_count;	/* sequential counter or input identifier */
-	int	png_ss_serial;	/* system 1 or system 2 serial number */
-	int	png_max_range;	/* old: max range of ping in number of samples */
-				/* current: mean absorption coefficient in 0.01 db/km */
-				/* also: used to store sidescan pixel size in range (m)
-				    for old Simrad multibeams (e.g. EM12, EM1000) */
-	int	png_r_zero;	/* old: range to normal incidence used in TVG
-				    (R0 predicted) in samples */
-				/* current: pulse length in usec */
-	int	png_r_zero_corr;/* range to normal incidence used to correct
-				    sample amplitudes in number of samples */
-	int	png_tvg_start;	/* start sample of TVG ramp if not enough
-				    dynamic range (0 otherwise) */
-	int	png_tvg_stop;	/* stop sample of TVG ramp if not enough
-				    dynamic range (0 otherwise) */
-	int	png_bsn;	/* normal incidence backscatter (BSN) in dB */
-	int	png_bso;	/* oblique incidence backscatter (BSO) in dB */
-	int	png_tx;		/* Tx beamwidth in 0.1 degree */
-	int	png_tvg_crossover;
-				/* TVG law crossover angle in degrees */
-	int	png_nbeams_ss;	/* number of beams with sidescan */
-	int	png_npixels;	/* number of pixels of sidescan */
-	int	png_beam_index[MBSYS_SIMRAD2_MAXBEAMS];
-				/* beam index number */
-	int	png_sort_direction[MBSYS_SIMRAD2_MAXBEAMS];
-				/* sorting direction - first sample in beam has lowest
-				    range if 1, highest if -1. */
-	int	png_beam_samples[MBSYS_SIMRAD2_MAXBEAMS];
-				/* number of sidescan samples derived from
-					each beam */
-	int	png_start_sample[MBSYS_SIMRAD2_MAXBEAMS];
-				/* start sample number */
-	int	png_center_sample[MBSYS_SIMRAD2_MAXBEAMS];
-				/* center sample number */
-	mb_s_char png_ssraw[MBSYS_SIMRAD2_MAXRAWPIXELS];
-				/* the raw sidescan ordered port to starboard */
-	int	png_pixel_size;	/* processed sidescan pixel size in cm */
-	int	png_pixels_ss;	/* number of processed sidescan pixels stored */
-	short	png_ss[MBSYS_SIMRAD2_MAXPIXELS];
-				/* the processed sidescan ordered port to starboard */
-	short	png_ssalongtrack[MBSYS_SIMRAD2_MAXPIXELS];
-				/* the processed sidescan alongtrack distances
-					in distance resolution units */
-	};
-
-/* internal data structure for attitude data */
-struct mbsys_simrad2_wcbeam_struct
-	{
-	int	wtc_rxpointangle;	/* Beam pointing angles in 0.01 degree,
-						positive to port. These values are roll stabilized. */
-	int	wtc_start_sample;	/* start sample number */
-	int	wtc_beam_samples;	/* number of water column samples derived from
-						each beam */
-	int	wtc_beam_spare;		/* unknown */
-	int	wtc_sector;		/* transmit sector identifier */
-	int	wtc_beam;  		/* beam 128 is first beam on
-				  	  	second head of EM3000D */
-	mb_s_char wtc_amp[MBSYS_SIMRAD2_MAXRAWPIXELS]; /* water column amplitude (dB) */
-	};
-
-/* internal data structure for attitude data */
-struct mbsys_simrad2_watercolumn_struct
-	{
-	int	wtc_date;	/* date = year*10000 + month*100 + day
-				    Feb 26, 1995 = 19950226 */
-	int	wtc_msec;	/* time since midnight in msec
-				    08:12:51.234 = 29570234 */
-	int	wtc_count;	/* sequential counter or input identifier */
-	int	wtc_serial;	/* system 1 or system 2 serial number */
-	int	wtc_ndatagrams;	/* number of datagrams used to represent
-						the water column for this ping */
-	int	wtc_datagram;	/* number this datagram */
-	int	wtc_ntx;	/* number of transmit sectors */
-	int	wtc_nrx;	/* number of receive beams */
-	int	wtc_nbeam;	/* number of beams in this datagram */
-	int	wtc_ssv;	/* sound speed at transducer (0.1 m/sec) */
-	int	wtc_sfreq;	/* sampling frequency (0.01 Hz) */
-	int	wtc_heave;	/* tx time heave at transducer (0.01 m) */
-	int	wtc_spare1;	/* spare */
-	int	wtc_spare2;	/* spare */
-	int	wtc_spare3;	/* spare */
-	int	wtc_txtiltangle[MBSYS_SIMRAD2_MAXTX];	/* tilt angle (0.01 deg) */
-	int	wtc_txcenter[MBSYS_SIMRAD2_MAXTX];	/* center frequency (Hz) */
-	int	wtc_txsector[MBSYS_SIMRAD2_MAXTX];	/* transmit sector number (0-19) */
-	struct mbsys_simrad2_wcbeam_struct beam[MBSYS_SIMRAD2_MAXBEAMS];
-	};
-
-/* internal data structure for attitude data */
-struct mbsys_simrad2_attitude_struct
-	{
-	int	att_date;	/* date = year*10000 + month*100 + day
-				    Feb 26, 1995 = 19950226 */
-	int	att_msec;	/* time since midnight in msec
-				    08:12:51.234 = 29570234 */
-	int	att_count;	/* sequential counter or input identifier */
-	int	att_serial;	/* system 1 or system 2 serial number */
-	int	att_ndata;	/* number of attitude data */
-	int	att_time[MBSYS_SIMRAD2_MAXATTITUDE];
-				/* time since record start (msec) */
-	int	att_sensor_status[MBSYS_SIMRAD2_MAXATTITUDE];
-				/* see note 12 above */
-	int	att_roll[MBSYS_SIMRAD2_MAXATTITUDE];
-				/* roll (0.01 degree) */
-	int	att_pitch[MBSYS_SIMRAD2_MAXATTITUDE];
-				/* pitch (0.01 degree) */
-	int	att_heave[MBSYS_SIMRAD2_MAXATTITUDE];
-				/* heave (cm) */
-	int	att_heading[MBSYS_SIMRAD2_MAXATTITUDE];
-				/* heading (0.01 degree) */
-	int	att_heading_status;
-				/* heading status (0=inactive) */
-	};
-
-/* internal data structure for heading data */
-struct mbsys_simrad2_heading_struct
-	{
-	int	hed_date;	/* date = year*10000 + month*100 + day
-				    Feb 26, 1995 = 19950226 */
-	int	hed_msec;	/* time since midnight in msec
-				    08:12:51.234 = 29570234 */
-	int	hed_count;	/* sequential counter or input identifier */
-	int	hed_serial;	/* system 1 or system 2 serial number */
-	int	hed_ndata;	/* number of heading data */
-	int	hed_time[MBSYS_SIMRAD2_MAXHEADING];
-				/* time since record start (msec) */
-	int	hed_heading[MBSYS_SIMRAD2_MAXHEADING];
-				/* heading (0.01 degree) */
-	int	hed_heading_status;
-				/* heading status (0=inactive) */
-	};
-
-/* internal data structure for ssv data */
-struct mbsys_simrad2_ssv_struct
-	{
-	int	ssv_date;	/* date = year*10000 + month*100 + day
-				    Feb 26, 1995 = 19950226 */
-	int	ssv_msec;	/* time since midnight in msec
-				    08:12:51.234 = 29570234 */
-	int	ssv_count;	/* sequential counter or input identifier */
-	int	ssv_serial;	/* system 1 or system 2 serial number */
-	int	ssv_ndata;	/* number of ssv data */
-	int	ssv_time[MBSYS_SIMRAD2_MAXSSV];
-				/* time since record start (msec) */
-	int	ssv_ssv[MBSYS_SIMRAD2_MAXSSV];
-				/* ssv (0.1 m/s) */
-	};
-
-/* internal data structure for tilt data */
-struct mbsys_simrad2_tilt_struct
-	{
-	int	tlt_date;	/* date = year*10000 + month*100 + day
-				    Feb 26, 1995 = 19950226 */
-	int	tlt_msec;	/* time since midnight in msec
-				    08:12:51.234 = 29570234 */
-	int	tlt_count;	/* sequential counter or input identifier */
-	int	tlt_serial;	/* system 1 or system 2 serial number */
-	int	tlt_ndata;	/* number of tilt data */
-	int	tlt_time[MBSYS_SIMRAD2_MAXTILT];
-				/* time since record start (msec) */
-	int	tlt_tilt[MBSYS_SIMRAD2_MAXTILT];
-				/* tilt + forward (0.01 degree) */
-	};
-
-/* internal data structure */
-struct mbsys_simrad2_struct
-	{
-	/* type of data record */
-	int	kind;		/* MB-System record ID */
-	int	type;		/* Simrad datagram ID */
-
-	/* type of sonar */
-	int	sonar;		/* Type of Simrad sonar */
-	int	numberheads;	/* Number of sonar heads (1 or 2) */
-
-	/* time stamp */
-	int	date;		/* date = year*10000 + month*100 + day
-				    Feb 26, 1995 = 19950226 */
-	int	msec;		/* time since midnight in msec
-				    08:12:51.234 = 29570234 */
-
-	/* installation parameter values */
-	int	par_date;	/* installation parameter date = year*10000 + month*100 + day
-				    Feb 26, 1995 = 19950226 */
-	int	par_msec;	/* installation parameter time since midnight in msec
-				    08:12:51.234 = 29570234 */
-	int	par_line_num;	/* survey line number */
-	int	par_serial_1;	/* system 1 serial number */
-	int	par_serial_2;	/* system 2 serial number */
-	double	par_wlz;	/* water line vertical location (m) */
-	int	par_smh;	/* system main head serial number */
-	double	par_s1z;	/* transducer 1 vertical location (m) */
-	double	par_s1x;	/* transducer 1 along location (m) */
-	double	par_s1y;	/* transducer 1 athwart location (m) */
-	double	par_s1h;	/* transducer 1 heading (deg) */
-	double	par_s1r;	/* transducer 1 roll (m) */
-	double	par_s1p;	/* transducer 1 pitch (m) */
-	int	par_s1n;	/* transducer 1 number of modules */
-	double	par_s2z;	/* transducer 2 vertical location (m) */
-	double	par_s2x;	/* transducer 2 along location (m) */
-	double	par_s2y;	/* transducer 2 athwart location (m) */
-	double	par_s2h;	/* transducer 2 heading (deg) */
-	double	par_s2r;	/* transducer 2 roll (m) */
-	double	par_s2p;	/* transducer 2 pitch (m) */
-	int	par_s2n;	/* transducer 2 number of modules */
-	double	par_go1;	/* system (sonar head 1) gain offset */
-	double	par_go2;	/* sonar head 2 gain offset */
-	char	par_tsv[16];	/* transmitter (sonar head 1) software version */
-	char	par_rsv[16];	/* receiver (sonar head 2) software version */
-	char	par_bsv[16];	/* beamformer software version */
-	char	par_psv[16];	/* processing unit software version */
-	char	par_osv[16];	/* operator station software version */
-	double	par_dsd;	/* depth sensor time delay (msec) */
-	double	par_dso;	/* depth sensor offset */
-	double	par_dsf;	/* depth sensor scale factor */
-	char	par_dsh[2];	/* depth sensor heave (IN or NI) */
-	int	par_aps;	/* active position system number */
-	int	par_p1m;	/* position system 1 motion compensation (boolean) */
-	int	par_p1t;	/* position system 1 time stamp used
-				    (0=system time, 1=position input time) */
-	double	par_p1z;	/* position system 1 vertical location (m) */
-	double	par_p1x;	/* position system 1 along location (m) */
-	double	par_p1y;	/* position system 1 athwart location (m) */
-	double	par_p1d;	/* position system 1 time delay (sec) */
-	char	par_p1g[16];	/* position system 1 geodetic datum */
-	int	par_p2m;	/* position system 2 motion compensation (boolean) */
-	int	par_p2t;	/* position system 2 time stamp used
-				    (0=system time, 1=position input time) */
-	double	par_p2z;	/* position system 2 vertical location (m) */
-	double	par_p2x;	/* position system 2 along location (m) */
-	double	par_p2y;	/* position system 2 athwart location (m) */
-	double	par_p2d;	/* position system 2 time delay (sec) */
-	char	par_p2g[16];	/* position system 2 geodetic datum */
-	int	par_p3m;	/* position system 3 motion compensation (boolean) */
-	int	par_p3t;	/* position system 3 time stamp used
-				    (0=system time, 1=position input time) */
-	double	par_p3z;	/* position system 3 vertical location (m) */
-	double	par_p3x;	/* position system 3 along location (m) */
-	double	par_p3y;	/* position system 3 athwart location (m) */
-	double	par_p3d;	/* position system 3 time delay (sec) */
-	char	par_p3g[16];	/* position system 3 geodetic datum */
-	double	par_msz;	/* motion sensor vertical location (m) */
-	double	par_msx;	/* motion sensor along location (m) */
-	double	par_msy;	/* motion sensor athwart location (m) */
-	char	par_mrp[2];	/* motion sensor roll reference plane (HO or RP) */
-	double	par_msd;	/* motion sensor time delay (sec) */
-	double	par_msr;	/* motion sensor roll offset (deg) */
-	double	par_msp;	/* motion sensor pitch offset (deg) */
-	double	par_msg;	/* motion sensor heading offset (deg) */
-	double	par_gcg;	/* gyro compass heading offset (deg) */
-	char	par_cpr[4];	/* cartographic projection */
-	char	par_rop[MBSYS_SIMRAD2_COMMENT_LENGTH];
-				/* responsible operator */
-	char	par_sid[MBSYS_SIMRAD2_COMMENT_LENGTH];
-				/* survey identifier */
-	char	par_pll[MBSYS_SIMRAD2_COMMENT_LENGTH];
-				/* survey line identifier (planned line number) */
-	char	par_com[MBSYS_SIMRAD2_COMMENT_LENGTH];
-				/* comment */
-
-	/* runtime parameter values */
-	int	run_date;	/* runtime parameter date = year*10000 + month*100 + day
-				    Feb 26, 1995 = 19950226 */
-	int	run_msec;	/* runtime parameter time since midnight in msec
-				    08:12:51.234 = 29570234 */
-	int	run_ping_count;	/* ping counter */
-	int	run_serial;	/* system 1 or 2 serial number */
-	int	run_status;	/* system status */
-	int	run_mode;	/* system mode:
-				    0 : nearfield (EM3000) or very shallow (EM300)
-				    1 :	normal (EM3000) or shallow (EM300)
-				    2 : medium (EM300)
-				    3 : deep (EM300)
-				    4 : very deep (EM300) */
-	int	run_filter_id;	/* filter identifier - the two lowest bits
-				    indicate spike filter strength:
-					00 : off
-					01 : weak
-					10 : medium
-					11 : strong
-				    bit 2 is set if the slope filter is on
-				    bit 3 is set if the sidelobe filter is on
-				    bit 4 is set if the range windows are expanded
-				    bit 5 is set if the smoothing filter is on
-				    bit	6 is set if the interference filter is on */
-	int	run_min_depth;	/* minimum depth (m) */
-	int	run_max_depth;	/* maximum depth (m) */
-	int	run_absorption;	/* absorption coefficient (0.01 dB/km) */
-
-	int	run_tran_pulse;	/* transmit pulse length (usec) */
-	int	run_tran_beam;	/* transmit beamwidth (0.1 deg) */
-	int	run_tran_pow;	/* transmit power reduction (dB) */
-	int	run_rec_beam;	/* receiver beamwidth (0.1 deg) */
-	int	run_rec_band;	/* receiver bandwidth (50 hz) */
-	int	run_rec_gain;	/* receiver fixed gain (dB) */
-	int	run_tvg_cross;	/* TVG law crossover angle (deg) */
-	int	run_ssv_source;	/* source of sound speed at transducer:
-				    0 : from sensor
-				    1 : manual
-				    2 : from profile */
-	int	run_max_swath;	/* maximum swath width (m) */
-	int	run_beam_space;	/* beam spacing:
-				    0 : determined by beamwidth (EM3000)
-				    1 : equidistant
-				    2 : equiangle */
-	int	run_swath_angle;/* coverage sector of swath (deg) */
-	int	run_stab_mode;	/* yaw and pitch stabilization mode:
-				    The upper bit (bit 7) is set if pitch
-				    stabilization is on.
-				    The two lower bits are used to show yaw
-				    stabilization mode as follows:
-					00 : none
-					01 : to survey line heading
-					10 : to mean vessel heading
-					11 : to manually entered heading */
-	char	run_spare[6];
-
-	/* sound velocity profile */
-	int	svp_use_date;	/* date at start of use
-				    date = year*10000 + month*100 + day
-				    Feb 26, 1995 = 19950226 */
-	int	svp_use_msec;	/* time at start of use since midnight in msec
-				    08:12:51.234 = 29570234 */
-	int	svp_count;	/* sequential counter or input identifier */
-	int	svp_serial;	/* system 1 serial number */
-	int	svp_origin_date;/* date at svp origin
-				    date = year*10000 + month*100 + day
-				    Feb 26, 1995 = 19950226 */
-	int	svp_origin_msec;/* time at svp origin since midnight in msec
-				    08:12:51.234 = 29570234 */
-	int	svp_num;	/* number of svp entries */
-	int	svp_depth_res;	/* depth resolution (cm) */
-	int	svp_depth[MBSYS_SIMRAD2_MAXSVP];
-				/* depth of svp entries (according to svp_depth_res) */
-	int	svp_vel[MBSYS_SIMRAD2_MAXSVP];
-				/* sound speed of svp entries (0.1 m/sec) */
-
-	/* position */
-	int	pos_date;	/* position date = year*10000 + month*100 + day
-				    Feb 26, 1995 = 19950226 */
-	int	pos_msec;	/* position time since midnight in msec
-				    08:12:51.234 = 29570234 */
-	int	pos_count;	/* sequential counter */
-	int	pos_serial;	/* system 1 serial number */
-	int	pos_latitude;	/* latitude in decimal degrees * 20000000
-				    (negative in southern hemisphere)
-				    if valid, invalid = 0x7FFFFFFF */
-	int	pos_longitude;	/* longitude in decimal degrees * 10000000
-				    (negative in western hemisphere)
-				    if valid, invalid = 0x7FFFFFFF */
-	int	pos_quality;	/* measure of position fix quality (cm) */
-	int	pos_speed;	/* speed over ground (cm/sec) if valid,
-				    invalid = 0xFFFF */
-	int	pos_course;	/* course over ground (0.01 deg) if valid,
-				    invalid = 0xFFFF */
-	int	pos_heading;	/* heading (0.01 deg) if valid,
-				    invalid = 0xFFFF */
-	int	pos_heave;	/* heave from interpolation (0.01 m) */
-	int	pos_roll;	/* roll from interpolation (0.01 deg) */
-	int	pos_pitch;	/* pitch from interpolation (0.01 deg) */
-	int	pos_system;	/* position system number, type, and realtime use
-				    - position system number given by two lowest bits
-				    - fifth bit set means position must be derived
-					from input Simrad 90 datagram
-				    - sixth bit set means valid time is that of
-					input datagram */
-	int	pos_input_size;	/* number of bytes in input position datagram */
-	char	pos_input[256];	/* position input datagram as received, minus
-				    header and tail (such as NMEA 0183 $ and CRLF) */
-
-	/* height */
-	int	hgt_date;	/* height date = year*10000 + month*100 + day
-				    Feb 26, 1995 = 19950226 */
-	int	hgt_msec;	/* height time since midnight in msec
-				    08:12:51.234 = 29570234 */
-	int	hgt_count;	/* sequential counter */
-	int	hgt_serial;	/* system 1 serial number */
-	int	hgt_height;	/* height (0.01 m) */
-	int	hgt_type;	/* height type as given in input datagram or if
-				    zero the height is derived from the GGK datagram
-				    and is the height of the water level re the
-				    vertical datum */
-
-	/* tide */
-	int	tid_date;	/* tide date = year*10000 + month*100 + day
-				    Feb 26, 1995 = 19950226 */
-	int	tid_msec;	/* tide time since midnight in msec
-				    08:12:51.234 = 29570234 */
-	int	tid_count;	/* sequential counter */
-	int	tid_serial;	/* system 1 serial number */
-	int	tid_origin_date;/* tide input date = year*10000 + month*100 + day
-				    Feb 26, 1995 = 19950226 */
-	int	tid_origin_msec;/* tide input time since midnight in msec
-				    08:12:51.234 = 29570234 */
-	int	tid_tide;	/* tide offset (0.01 m) */
-
-	/* clock */
-	int	clk_date;	/* system date = year*10000 + month*100 + day
-				    Feb 26, 1995 = 19950226 */
-	int	clk_msec;	/* system time since midnight in msec
-				    08:12:51.234 = 29570234 */
-	int	clk_count;	/* sequential counter */
-	int	clk_serial;	/* system 1 serial number */
-	int	clk_origin_date;/* external clock date = year*10000 + month*100 + day
-				    Feb 26, 1995 = 19950226 */
-	int	clk_origin_msec;/* external clock time since midnight in msec
-				    08:12:51.234 = 29570234 */
-	int	clk_1_pps_use;	/* if 1 then the internal clock is synchronized
-				    to an external 1 PPS signal, if 0 then not */
-
-	/* pointer to attitude data structure */
-	struct mbsys_simrad2_attitude_struct *attitude;
-
-	/* pointer to heading data structure */
-	struct mbsys_simrad2_heading_struct *heading;
-
-	/* pointer to ssv data structure */
-	struct mbsys_simrad2_ssv_struct *ssv;
-
-	/* pointer to tilt data structure */
-	struct mbsys_simrad2_tilt_struct *tilt;
-
-	/* pointer to survey data structures */
-	struct mbsys_simrad2_ping_struct *ping;
-	struct mbsys_simrad2_ping_struct *ping2;
-
-	/* pointer to water column data structure */
-	struct mbsys_simrad2_watercolumn_struct *wc;
-	};
-
-
-/* system specific function prototypes */
-int mbsys_simrad2_alloc(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error);
-int mbsys_simrad2_survey_alloc(int verbose,
-			void *mbio_ptr, void *store_ptr,
-			int *error);
-int mbsys_simrad2_wc_alloc(int verbose,
-			void *mbio_ptr, void *store_ptr,
-			int *error);
-int mbsys_simrad2_attitude_alloc(int verbose,
-			void *mbio_ptr, void *store_ptr,
-			int *error);
-int mbsys_simrad2_heading_alloc(int verbose,
-			void *mbio_ptr, void *store_ptr,
-			int *error);
-int mbsys_simrad2_ssv_alloc(int verbose,
-			void *mbio_ptr, void *store_ptr,
-			int *error);
-int mbsys_simrad2_tilt_alloc(int verbose,
-			void *mbio_ptr, void *store_ptr,
-			int *error);
-int mbsys_simrad2_deall(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error);
-int mbsys_simrad2_zero_ss(int verbose, void *store_ptr, int *error);
-int mbsys_simrad2_dimensions(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int *nbath, int *namp, int *nss, int *error);
-int mbsys_simrad2_pingnumber(int verbose, void *mbio_ptr,
-			int *pingnumber, int *error);
-int mbsys_simrad2_extract(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int time_i[7], double *time_d,
-			double *navlon, double *navlat,
-			double *speed, double *heading,
-			int *nbath, int *namp, int *nss,
-			char *beamflag, double *bath, double *amp,
-			double *bathacrosstrack, double *bathalongtrack,
-			double *ss, double *ssacrosstrack, double *ssalongtrack,
-			char *comment, int *error);
-int mbsys_simrad2_insert(int verbose, void *mbio_ptr, void *store_ptr,
-			int kind, int time_i[7], double time_d,
-			double navlon, double navlat,
-			double speed, double heading,
-			int nbath, int namp, int nss,
-			char *beamflag, double *bath, double *amp,
-			double *bathacrosstrack, double *bathalongtrack,
-			double *ss, double *ssacrosstrack, double *ssalongtrack,
-			char *comment, int *error);
-int mbsys_simrad2_ttimes(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int *nbeams,
-			double *ttimes, double *angles,
-			double *angles_forward, double *angles_null,
-			double *heave, double *alongtrack_offset,
-			double *draft, double *ssv, int *error);
-int mbsys_simrad2_detects(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int *nbeams, int *detects, int *error);
-int mbsys_simrad2_pulses(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int *nbeams, int *pulses, int *error);
-int mbsys_simrad2_gains(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, double *transmit_gain, double *pulse_length,
-			double *receive_gain, int *error);
-int mbsys_simrad2_extract_altitude(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, double *transducer_depth, double *altitude,
-			int *error);
-int mbsys_simrad2_extract_nnav(int verbose, void *mbio_ptr, void *store_ptr,
-			int nmax, int *kind, int *n,
-			int *time_i, double *time_d,
-			double *navlon, double *navlat,
-			double *speed, double *heading, double *draft,
-			double *roll, double *pitch, double *heave,
-			int *error);
-int mbsys_simrad2_extract_nav(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int time_i[7], double *time_d,
-			double *navlon, double *navlat,
-			double *speed, double *heading, double *draft,
-			double *roll, double *pitch, double *heave,
-			int *error);
-int mbsys_simrad2_insert_nav(int verbose, void *mbio_ptr, void *store_ptr,
-			int time_i[7], double time_d,
-			double navlon, double navlat,
-			double speed, double heading, double draft,
-			double roll, double pitch, double heave,
-			int *error);
-int mbsys_simrad2_extract_svp(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind,
-			int *nsvp,
-			double *depth, double *velocity,
-			int *error);
-int mbsys_simrad2_insert_svp(int verbose, void *mbio_ptr, void *store_ptr,
-			int nsvp,
-			double *depth, double *velocity,
-			int *error);
-int mbsys_simrad2_copy(int verbose, void *mbio_ptr,
-			void *store_ptr, void *copy_ptr,
-			int *error);
-int mbsys_simrad2_makess(int verbose, void *mbio_ptr, void *store_ptr,
-		int pixel_size_set, double *pixel_size,
-		int swath_width_set, double *swath_width,
-		int pixel_int,
-		int *error);
diff --git a/src/mbio/mbsys_simrad3.c b/src/mbio/mbsys_simrad3.c
deleted file mode 100644
index 53a850e..0000000
--- a/src/mbio/mbsys_simrad3.c
+++ /dev/null
@@ -1,3465 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbsys_simrad3.c	3.00	2/22/2008
- *	$Id: mbsys_simrad3.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 2008-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbsys_simrad3.c contains the MBIO functions for handling data from
- * new (post-2006) Simrad multibeam sonars (e.g. EM710, EM3002, EM302, EM122).
- * The data formats associated with Simrad multibeams
- * (both old and new) include:
- *    MBSYS_SIMRAD formats (code in mbsys_simrad.c and mbsys_simrad.h):
- *      MBF_EMOLDRAW : MBIO ID 51 - Vendor EM1000, EM12S, EM12D, EM121
- *                   : MBIO ID 52 - aliased to 51
- *      MBF_EM12IFRM : MBIO ID 53 - IFREMER EM12S and EM12D
- *      MBF_EM12DARW : MBIO ID 54 - NERC EM12S
- *                   : MBIO ID 55 - aliased to 51
- *    MBSYS_SIMRAD3 formats (code in mbsys_simrad2.c and mbsys_simrad2.h):
- *      MBF_EM300RAW : MBIO ID 56 - Vendor EM3000, EM300, EM120
- *      MBF_EM300MBA : MBIO ID 57 - MBARI EM3000, EM300, EM120 for processing
- *    MBSYS_SIMRAD3 formats (code in mbsys_simrad3.c and mbsys_simrad3.h):
- *      MBF_EM710RAW : MBIO ID 58 - Vendor EM710
- *      MBF_EM710MBA : MBIO ID 59 - MBARI EM710 for processing
- *
- * Author:	D. W. Caress
- * Date:	February 22, 2008
- *
- * $Log: mbsys_simrad3.c,v $
- * Revision 5.4  2009/03/02 18:51:52  caress
- * Fixed problems with formats 58 and 59, and also updated copyright dates in several source files.
- *
- * Revision 5.3  2009/02/06 19:12:43  caress
- * Fixed description in mb_angle.c and angle extraction in mb_simrad3.c
- *
- * Revision 5.2  2008/11/16 21:51:18  caress
- * Updating all recent changes, including time lag analysis using mbeditviz and improvements to the mbgrid footprint gridding algorithm.
- *
- * Revision 5.1  2008/07/10 06:40:34  caress
- * Fixed support for EM122
- *
- * Revision 5.0  2008/03/01 09:11:35  caress
- * Added support for Simrad EM710 multibeam in new formats 58 and 59.
- *
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mb_define.h"
-#include "mbsys_simrad3.h"
-
-static char rcs_id[]="$Id: mbsys_simrad3.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mbsys_simrad3_alloc(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_simrad3_alloc";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* allocate memory for data structure */
-	status = mb_mallocd(verbose, __FILE__, __LINE__, sizeof(struct mbsys_simrad3_struct),
-				(void **)store_ptr,error);
-
-	/* initialize everything to zero */
-	if (status == MB_SUCCESS)
-			memset(*store_ptr, 0, sizeof(struct mbsys_simrad3_struct));
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)*store_ptr);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbsys_simrad3_survey_alloc(int verbose,
-			void *mbio_ptr, void *store_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_simrad3_survey_alloc";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_simrad3_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_simrad3_struct *) store_ptr;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbsys_simrad3_extraparameters_alloc(int verbose,
-			void *mbio_ptr, void *store_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_simrad3_extraparameters_alloc";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_simrad3_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_simrad3_struct *) store_ptr;
-
-	/* allocate memory for data structure if needed */
-	if (store->extraparameters == NULL)
-		{
-		status = mb_mallocd(verbose,__FILE__, __LINE__,
-			sizeof(struct mbsys_simrad3_extraparameters_struct),
-			(void **)&(store->extraparameters),error);
-		if (status == MB_SUCCESS)
-			memset(store->extraparameters, 0, sizeof(struct mbsys_simrad3_extraparameters_struct));
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-
-/*--------------------------------------------------------------------*/
-int mbsys_simrad3_wc_alloc(int verbose,
-			void *mbio_ptr, void *store_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_simrad3_wc_alloc";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_simrad3_struct *store;
-	struct mbsys_simrad3_watercolumn_struct *wc;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_simrad3_struct *) store_ptr;
-
-	/* allocate memory for data structure if needed */
-	if (store->wc == NULL)
-		status = mb_mallocd(verbose,__FILE__, __LINE__,
-			sizeof(struct mbsys_simrad3_watercolumn_struct),
-			(void **)&(store->wc),error);
-
-	if (status == MB_SUCCESS)
-		{
-
-		/* get data structure pointer */
-		wc = (struct mbsys_simrad3_watercolumn_struct *) store->wc;
-
-		/* initialize everything */
-		wc->wtc_date = 0;	/* date = year*10000 + month*100 + day
-				    Feb 26, 1995 = 19950226 */
-		wc->wtc_msec = 0;	/* time since midnight in msec
-				    08:12:51.234 = 29570234 */
-		wc->wtc_count = 0;	/* sequential counter or input identifier */
-		wc->wtc_serial = 0;	/* system 1 or system 2 serial number */
-		wc->wtc_ndatagrams = 0;	/* number of datagrams used to represent
-						the water column for this ping */
-		wc->wtc_datagram = 0;	/* number this datagram */
-		wc->wtc_ntx = 0;	/* number of transmit sectors */
-		wc->wtc_nrx = 0;	/* number of receive beams */
-		wc->wtc_nbeam = 0;	/* number of beams in this datagram */
-		wc->wtc_ssv = 0;	/* sound speed at transducer (0.1 m/sec) */
-		wc->wtc_sfreq = 0;	/* sampling frequency (0.01 Hz) */
-		wc->wtc_heave = 0;	/* tx time heave at transducer (0.01 m) */
-		wc->wtc_spare1 = 0;	/* spare */
-		wc->wtc_spare2 = 0;	/* spare */
-		wc->wtc_spare3 = 0;	/* spare */
-		for (i=0;i<MBSYS_SIMRAD3_MAXTX;i++)
-			{
-			wc->wtc_txtiltangle[i] = 0;	/* tilt angle (0.01 deg) */
-			wc->wtc_txcenter[i] = 0;	/* center frequency (Hz) */
-			wc->wtc_txsector[i] = 0;	/* transmit sector number (0-19) */
-			}
-		for (i=0;i<MBSYS_SIMRAD3_MAXBEAMS;i++)
-			{
-			wc->beam[i].wtc_rxpointangle = 0;	/* Beam pointing angles in 0.01 degree,
-									positive to port. These values are roll stabilized. */
-			wc->beam[i].wtc_start_sample = 0;	/* start sample number */
-			wc->beam[i].wtc_beam_samples = 0;	/* number of water column samples derived from
-									each beam */
-			wc->beam[i].wtc_sector = 0;		/* transmit sector identifier */
-			wc->beam[i].wtc_beam = 0;  		/* beam 128 is first beam on
-				  	  				second head of EM3000D */
-			for (j=0;j<MBSYS_SIMRAD3_MAXRAWPIXELS;j++)
-				wc->beam[i].wtc_amp[j] = 0;	/* water column amplitude (dB) */
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbsys_simrad3_attitude_alloc(int verbose,
-			void *mbio_ptr, void *store_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_simrad3_attitude_alloc";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_simrad3_struct *store;
-	struct mbsys_simrad3_attitude_struct *attitude;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_simrad3_struct *) store_ptr;
-
-	/* allocate memory for data structure if needed */
-	if (store->attitude == NULL)
-		status = mb_mallocd(verbose, __FILE__, __LINE__,
-			sizeof(struct mbsys_simrad3_attitude_struct),
-			(void **)&(store->attitude),error);
-
-	if (status == MB_SUCCESS)
-		{
-
-		/* get data structure pointer */
-		attitude = (struct mbsys_simrad3_attitude_struct *) store->attitude;
-
-		/* initialize everything */
-		attitude->att_date = 0;
-				/* date = year*10000 + month*100 + day
-				    Feb 26, 1995 = 19950226 */
-		attitude->att_msec = 0;
-				/* time since midnight in msec
-				    08:12:51.234 = 29570234 */
-		attitude->att_count = 0;
-				/* sequential counter or input identifier */
-		attitude->att_serial = 0;
-				/* system 1 or system 2 serial number */
-		attitude->att_ndata = 0;
-				/* number of attitude data */
-		for (i=0;i<MBSYS_SIMRAD3_MAXATTITUDE;i++)
-		    {
-		    attitude->att_time[i] = 0;
-				/* time since record start (msec) */
-		    attitude->att_sensor_status[i] = 0;
-				/* see note 12 above */
-		    attitude->att_roll[i] = 0;
-				/* roll (0.01 degree) */
-		    attitude->att_pitch[i] = 0;
-				/* pitch (0.01 degree) */
-		    attitude->att_heave[i] = 0;
-				/* heave (cm) */
-		    attitude->att_heading[i] = 0;
-				/* heading (0.01 degree) */
-		    }
-		attitude->att_sensordescriptor = 0;
-				/* heading status (0=inactive) */
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbsys_simrad3_netattitude_alloc(int verbose,
-			void *mbio_ptr, void *store_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_simrad3_netattitude_alloc";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_simrad3_struct *store;
-	struct mbsys_simrad3_netattitude_struct *netattitude;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_simrad3_struct *) store_ptr;
-
-	/* allocate memory for data structure if needed */
-	if (store->netattitude == NULL)
-		status = mb_mallocd(verbose, __FILE__, __LINE__,
-			sizeof(struct mbsys_simrad3_netattitude_struct),
-			(void **)&(store->netattitude),error);
-
-	if (status == MB_SUCCESS)
-		{
-
-		/* get data structure pointer */
-		netattitude = (struct mbsys_simrad3_netattitude_struct *) store->netattitude;
-
-		/* initialize everything */
-		netattitude->nat_date = 0;
-				/* date = year*10000 + month*100 + day
-				    Feb 26, 1995 = 19950226 */
-		netattitude->nat_msec = 0;
-				/* time since midnight in msec
-				    08:12:51.234 = 29570234 */
-		netattitude->nat_count = 0;
-				/* sequential counter or input identifier */
-		netattitude->nat_serial = 0;
-				/* system 1 or system 2 serial number */
-		netattitude->nat_ndata = 0;
-				/* number of attitude data */
-		netattitude->nat_sensordescriptor = 0;	/* sensor system descriptor */
-		for (i=0;i<MBSYS_SIMRAD3_MAXATTITUDE;i++)
-		    {
-		    netattitude->nat_time[i] = 0;
-				/* time since record start (msec) */
-		    netattitude->nat_roll[i] = 0;
-				/* roll (0.01 degree) */
-		    netattitude->nat_pitch[i] = 0;
-				/* pitch (0.01 degree) */
-		    netattitude->nat_heave[i] = 0;
-				/* heave (cm) */
-		    netattitude->nat_heading[i] = 0;
-				/* heading (0.01 degree) */
-		    netattitude->nat_nbyte_raw[i] = 0;	/* number of bytes in input datagram (Nd) */
-		    for (j=0;j<MBSYS_SIMRAD3_BUFFER_SIZE;j++)
-		    	netattitude->nat_raw[i*MBSYS_SIMRAD3_BUFFER_SIZE+j] = 0;	/* network attitude input datagram as received by datalogger */
-		    }
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_simrad3_heading_alloc(int verbose,
-			void *mbio_ptr, void *store_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_simrad3_heading_alloc";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_simrad3_struct *store;
-	struct mbsys_simrad3_heading_struct *heading;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_simrad3_struct *) store_ptr;
-
-	/* allocate memory for data structure if needed */
-	if (store->heading == NULL)
-		status = mb_mallocd(verbose,__FILE__, __LINE__,
-			sizeof(struct mbsys_simrad3_heading_struct),
-			(void **)&(store->heading),error);
-
-	if (status == MB_SUCCESS)
-		{
-
-		/* get data structure pointer */
-		heading = (struct mbsys_simrad3_heading_struct *) store->heading;
-
-		/* initialize everything */
-		heading->hed_date = 0;
-				/* date = year*10000 + month*100 + day
-				    Feb 26, 1995 = 19950226 */
-		heading->hed_msec = 0;
-				/* time since midnight in msec
-				    08:12:51.234 = 29570234 */
-		heading->hed_count = 0;
-				/* sequential counter or input identifier */
-		heading->hed_serial = 0;
-				/* system 1 or system 2 serial number */
-		heading->hed_ndata = 0;
-				/* number of heading data */
-		for (i=0;i<MBSYS_SIMRAD3_MAXHEADING;i++)
-		    {
-		    heading->hed_time[i] = 0;
-				/* time since record start (msec) */
-		    heading->hed_heading[i] = 0;
-				/* heading (0.01 degree) */
-		    }
-		heading->hed_heading_status = 0;
-				/* heading status (0=inactive) */
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_simrad3_ssv_alloc(int verbose,
-			void *mbio_ptr, void *store_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_simrad3_ssv_alloc";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_simrad3_struct *store;
-	struct mbsys_simrad3_ssv_struct *ssv;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_simrad3_struct *) store_ptr;
-
-	/* allocate memory for data structure if needed */
-	if (store->ssv == NULL)
-		status = mb_mallocd(verbose,__FILE__, __LINE__,
-			sizeof(struct mbsys_simrad3_ssv_struct),
-			(void **)&(store->ssv),error);
-
-	if (status == MB_SUCCESS)
-		{
-
-		/* get data structure pointer */
-		ssv = (struct mbsys_simrad3_ssv_struct *) store->ssv;
-
-		/* initialize everything */
-		ssv->ssv_date = 0;
-				/* date = year*10000 + month*100 + day
-				    Feb 26, 1995 = 19950226 */
-		ssv->ssv_msec = 0;
-				/* time since midnight in msec
-				    08:12:51.234 = 29570234 */
-		ssv->ssv_count = 0;
-				/* sequential counter or input identifier */
-		ssv->ssv_serial = 0;
-				/* system 1 or system 2 serial number */
-		ssv->ssv_ndata = 0;
-				/* number of ssv data */
-		for (i=0;i<MBSYS_SIMRAD3_MAXTILT;i++)
-		    {
-		    ssv->ssv_time[i] = 0;
-				/* time since record start (msec) */
-		    ssv->ssv_ssv[i] = 0;
-				/* ssv (0.1 m/s) */
-		    }
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_simrad3_tilt_alloc(int verbose,
-			void *mbio_ptr, void *store_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_simrad3_tilt_alloc";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_simrad3_struct *store;
-	struct mbsys_simrad3_tilt_struct *tilt;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_simrad3_struct *) store_ptr;
-
-	/* allocate memory for data structure if needed */
-	if (store->tilt == NULL)
-		status = mb_mallocd(verbose,__FILE__, __LINE__,
-			sizeof(struct mbsys_simrad3_tilt_struct),
-			(void **)&(store->tilt),error);
-
-	if (status == MB_SUCCESS)
-		{
-
-		/* get data structure pointer */
-		tilt = (struct mbsys_simrad3_tilt_struct *) store->tilt;
-
-		/* initialize everything */
-		tilt->tlt_date = 0;
-				/* date = year*10000 + month*100 + day
-				    Feb 26, 1995 = 19950226 */
-		tilt->tlt_msec = 0;
-				/* time since midnight in msec
-				    08:12:51.234 = 29570234 */
-		tilt->tlt_count = 0;
-				/* sequential counter or input identifier */
-		tilt->tlt_serial = 0;
-				/* system 1 or system 2 serial number */
-		tilt->tlt_ndata = 0;
-				/* number of tilt data */
-		for (i=0;i<MBSYS_SIMRAD3_MAXTILT;i++)
-		    {
-		    tilt->tlt_time[i] = 0;
-				/* time since record start (msec) */
-		    tilt->tlt_tilt[i] = 0;
-				/* tilt + forward (0.01 deg) */
-		    }
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_simrad3_deall(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_simrad3_deall";
-	int	status = MB_SUCCESS;
-	struct mbsys_simrad3_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)*store_ptr);
-		}
-
-	/* get data structure pointer */
-	store = (struct mbsys_simrad3_struct *) *store_ptr;
-
-	/* deallocate memory for extraparameters data structure */
-	if (store->extraparameters != NULL)
-		{
-		if (store->extraparameters->xtr_data != NULL)
-			status = mb_freed(verbose,__FILE__, __LINE__, (void **)&(store->extraparameters->xtr_data),error);
-		status = mb_freed(verbose,__FILE__, __LINE__, (void **)&(store->extraparameters),error);
-		}
-
-	/* deallocate memory for water column data structure */
-	if (store->wc != NULL)
-		status = mb_freed(verbose,__FILE__, __LINE__, (void **)&(store->wc),error);
-
-	/* deallocate memory for attitude data structure */
-	if (store->attitude != NULL)
-		status = mb_freed(verbose,__FILE__, __LINE__, (void **)&(store->attitude),error);
-
-	/* deallocate memory for network attitude data structure */
-	if (store->netattitude != NULL)
-		status = mb_freed(verbose,__FILE__, __LINE__, (void **)&(store->netattitude),error);
-
-	/* deallocate memory for heading data structure */
-	if (store->heading != NULL)
-		status = mb_freed(verbose,__FILE__, __LINE__, (void **)&(store->heading),error);
-
-	/* deallocate memory for ssv data structure */
-	if (store->ssv != NULL)
-		status = mb_freed(verbose,__FILE__, __LINE__, (void **)&(store->ssv),error);
-
-	/* deallocate memory for tilt data structure */
-	if (store->tilt != NULL)
-		status = mb_freed(verbose,__FILE__, __LINE__, (void **)&(store->tilt),error);
-
-	/* deallocate memory for data structure */
-	status = mb_freed(verbose,__FILE__, __LINE__, (void **)store_ptr,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_simrad3_zero_ss(int verbose, void *store_ptr, int *error)
-{
-	char	*function_name = "mbsys_simrad3_zero_ss";
-	int	status = MB_SUCCESS;
-	struct mbsys_simrad3_struct *store;
-	struct mbsys_simrad3_ping_struct *ping;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get pointer to data descriptor */
-	store = (struct mbsys_simrad3_struct *) store_ptr;
-	for (i=0;i<MBSYS_SIMRAD3_NUM_PING_STRUCTURES;i++)
-		{
-		ping = (struct mbsys_simrad3_ping_struct *) &(store->pings[i]);
-
-		ping->png_ss_read = 0;	/* flag indicating actual reading of sidescan record */
-		ping->png_ss_date = 0;	/* date = year*10000 + month*100 + day
-					    Feb 26, 1995 = 19950226 */
-		ping->png_ss_msec = 0;	/* time since midnight in msec
-					    08:12:51.234 = 29570234 */
-		ping->png_ss_count = 0;	/* sequential counter or input identifier */
-		ping->png_ss_serial = 0;	/* system 1 or system 2 serial number */
-		ping->png_ss_sample_rate = 0.0;	/* sampling rate (Hz) */
-		ping->png_r_zero = 0;	/* range to normal incidence used in TVG
-					    (R0 predicted) in samples */
-		ping->png_bsn = 0;	/* normal incidence backscatter (BSN) (0.1 dB) */
-		ping->png_bso = 0;	/* oblique incidence backscatter (BSO) (0.1 dB) */
-		ping->png_tx = 0;		/* Tx beamwidth (0.1 deg) */
-		ping->png_tvg_crossover = 0;
-					/* TVG law crossover angle (0.1 deg) */
-		ping->png_nbeams_ss = 0;	/* number of beams with sidescan */
-		ping->png_npixels = 0;	/* number of pixels of sidescan */
-		for (i=0;i<MBSYS_SIMRAD3_MAXBEAMS;i++)
-			{
-			ping->png_sort_direction[i] = 0;
-					/* sorting direction - The first sample in a beam
-						has lowest range if 1, highest if -- 1. Note
-						that the ranges in the seabed image datagram
-						are all two-- way from time of transmit to
-						time of receive. */
-			ping->png_beam_samples[i] = 0;
-					/* number of sidescan samples derived from
-						each beam */
-			ping->png_start_sample[i] = 0;
-					/* start sample number */
-			ping->png_ssdetection[i] = 0; /* Detection info:
-								   This datagram may contain data for beams with and without a
-								   valid detection. Eight bits (0-7) gives details about the detection:
-									A) If the most significant bit (bit7) is zero, this beam has a valid
-										detection. Bit 0-3 is used to specify how the range for this beam
-										is calculated
-										0: Amplitude detect
-										1: Phase detect
-										2-15: Future use
-									B) If the most significant bit is 1, this beam has an invalid
-										detection. Bit 4-6 is used to specify how the range (and x,y,z
-										parameters) for this beam is calculated
-										0: Normal detection
-										1: Interpolated or extrapolated from neighbour detections
-										2: Estimated
-										3: Rejected candidate
-										4: No detection data is available for this beam (all parameters
-											are set to zero)
-										5-7: Future use
-									The invalid range has been used to fill in amplitude samples in
-									the seabed image datagram.
-										bit 7: 0 = good detection
-										bit 7: 1 = bad detection
-										bit 3: 0 = amplitude detect
-										bit 3: 1 = phase detect
-										bits 4-6: 0 = normal detection
-										bits 4-6: 1 = interpolated from neighbor detections
-										bits 4-6: 2 = estimated
-										bits 4-6: 3 = rejected
-										bits 4-6: 4 = no detection available
-										other bits : future use */
-			ping->png_center_sample[i] = 0;
-					/* center sample number */
-			}
-		for (i=0;i<MBSYS_SIMRAD3_MAXRAWPIXELS;i++)
-			{
-			ping->png_ssraw[i] = 0; /* the raw sidescan ordered port to starboard */
-			}
-		ping->png_pixel_size = 0.0;	/* processed sidescan pixel size (m) */
-		ping->png_pixels_ss = 0;	/* number of processed sidescan pixels stored */
-		for (i=0;i<MBSYS_SIMRAD3_MAXPIXELS;i++)
-			{
-			ping->png_ss[i] = 0; /* the processed sidescan ordered port to starboard */
-			ping->png_ssalongtrack[i] = 0; /* the processed sidescan alongtrack distances (0.01 m) */
-			}
-		}
-
-	/* assume success */
-	status = MB_SUCCESS;
-	*error = MB_ERROR_NO_ERROR;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_simrad3_dimensions(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int *nbath, int *namp, int *nss, int *error)
-{
-	char	*function_name = "mbsys_simrad3_dimensions";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_simrad3_struct *store;
-	struct mbsys_simrad3_ping_struct *ping;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_simrad3_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get beam and pixel numbers */
-		ping = (struct mbsys_simrad3_ping_struct *) &(store->pings[store->ping_index]);
-		*nbath = ping->png_nbeams;
-		*namp = *nbath;
-		*nss = MBSYS_SIMRAD3_MAXPIXELS;
-		}
-	else
-		{
-		/* get beam and pixel numbers */
-		*nbath = 0;
-		*namp = 0;
-		*nss = 0;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		fprintf(stderr,"dbg2       nbath:      %d\n",*nbath);
-		fprintf(stderr,"dbg2       namp:      %d\n",*namp);
-		fprintf(stderr,"dbg2       nss:       %d\n",*nss);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_simrad3_pingnumber(int verbose, void *mbio_ptr,
-		int *pingnumber, int *error)
-{
-	char	*function_name = "mbsys_simrad3_pingnumber";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_simrad3_struct *store;
-	struct mbsys_simrad3_ping_struct *ping;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_simrad3_struct *) mb_io_ptr->store_data;
-
-	/* extract data from structure */
-	ping = (struct mbsys_simrad3_ping_struct *) &(store->pings[store->ping_index]);
-	*pingnumber = ping->png_count;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       pingnumber: %d\n",*pingnumber);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_simrad3_extract(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int time_i[7], double *time_d,
-		double *navlon, double *navlat,
-		double *speed, double *heading,
-		int *nbath, int *namp, int *nss,
-		char *beamflag, double *bath, double *amp,
-		double *bathacrosstrack, double *bathalongtrack,
-		double *ss, double *ssacrosstrack, double *ssalongtrack,
-		char *comment, int *error)
-{
-	char	*function_name = "mbsys_simrad3_extract";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_simrad3_struct *store;
-	struct mbsys_simrad3_ping_struct *ping;
-	double	reflscale;
-	double	pixel_size;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_simrad3_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get survey data structure */
-		ping = (struct mbsys_simrad3_ping_struct *) &(store->pings[store->ping_index]);
-
-		/* get time */
-		time_i[0] = ping->png_date / 10000;
-		time_i[1] = (ping->png_date % 10000) / 100;
-		time_i[2] = ping->png_date % 100;
-		time_i[3] = ping->png_msec / 3600000;
-		time_i[4] = (ping->png_msec % 3600000) / 60000;
-		time_i[5] = (ping->png_msec % 60000) / 1000;
-		time_i[6] = (ping->png_msec % 1000) * 1000;
-		mb_get_time(verbose,time_i,time_d);
-
-		/* get navigation */
-		if (ping->png_longitude != EM3_INVALID_INT)
-		    *navlon = 0.0000001 * ping->png_longitude;
-		else
-		    *navlon = 0.0;
-		if (ping->png_latitude != EM3_INVALID_INT)
-		    *navlat = 0.00000005 * ping->png_latitude;
-		else
-		    *navlat = 0.0;
-
-		/* get heading */
-		*heading = 0.01 * ping->png_heading;
-
-		/* get speed  */
-		if (ping->png_speed != EM3_INVALID_SHORT)
-			*speed = 0.036 * ping->png_speed;
-		else
-			*speed = 0.0;
-
-		/* set beamwidths in mb_io structure */
-		if (store->run_rec_beam > 0)
-		    mb_io_ptr->beamwidth_xtrack
-			= 0.1 * store->run_rec_beam;
-		if (ping->png_tx > 0)
-		    {
-		    mb_io_ptr->beamwidth_ltrack
-			= 0.1 * ping->png_tx;
-		    }
-		else if (store->run_tran_beam > 0)
-		    {
-		    mb_io_ptr->beamwidth_ltrack
-			= 0.1 * store->run_tran_beam;
-		    }
-
-		/* read distance and depth values into storage arrays */
-		reflscale  = 0.1;
-		*nbath = 0;
-		for (i=0;i<ping->png_nbeams;i++)
-			{
-			bath[i] = ping->png_depth[i] + ping->png_xducer_depth;
-			beamflag[i] = ping->png_beamflag[i];
-			bathacrosstrack[i] = ping->png_acrosstrack[i];
-			bathalongtrack[i] = ping->png_alongtrack[i];
-			amp[i] = reflscale * ping->png_amp[i];
-			}
-		*nbath = ping->png_nbeams;
-		*namp = *nbath;
-		*nss = MBSYS_SIMRAD3_MAXPIXELS;
-		pixel_size = ping->png_pixel_size;
-		for (i=0;i<MBSYS_SIMRAD3_MAXPIXELS;i++)
-			{
-			if (ping->png_ss[i] == EM3_INVALID_SS
-				|| (ping->png_ss[i] == EM3_INVALID_AMP && ping->png_ssalongtrack[i] == 0))
-				{
-				ss[i] = MB_SIDESCAN_NULL;
-				ssacrosstrack[i] = pixel_size
-						* (i - MBSYS_SIMRAD3_MAXPIXELS / 2);
-				ssalongtrack[i] = 0.0;
-				}
-			else
-				{
-				ss[i] = 0.01 * ping->png_ss[i];
-				ssacrosstrack[i] = pixel_size
-						* (i - MBSYS_SIMRAD3_MAXPIXELS / 2);
-				ssalongtrack[i] = 0.01 * ping->png_ssalongtrack[i];
-				}
-			}
-
-		/* print debug statements */
-		if (verbose >= 5)
-			{
-			fprintf(stderr,"\ndbg4  Data extracted by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  Extracted values:\n");
-			fprintf(stderr,"dbg4       kind:       %d\n",
-				*kind);
-			fprintf(stderr,"dbg4       error:      %d\n",
-				*error);
-			fprintf(stderr,"dbg4       time_i[0]:  %d\n",
-				time_i[0]);
-			fprintf(stderr,"dbg4       time_i[1]:  %d\n",
-				time_i[1]);
-			fprintf(stderr,"dbg4       time_i[2]:  %d\n",
-				time_i[2]);
-			fprintf(stderr,"dbg4       time_i[3]:  %d\n",
-				time_i[3]);
-			fprintf(stderr,"dbg4       time_i[4]:  %d\n",
-				time_i[4]);
-			fprintf(stderr,"dbg4       time_i[5]:  %d\n",
-				time_i[5]);
-			fprintf(stderr,"dbg4       time_i[6]:  %d\n",
-				time_i[6]);
-			fprintf(stderr,"dbg4       time_d:     %f\n",
-				*time_d);
-			fprintf(stderr,"dbg4       longitude:  %f\n",
-				*navlon);
-			fprintf(stderr,"dbg4       latitude:   %f\n",
-				*navlat);
-			fprintf(stderr,"dbg4       speed:      %f\n",
-				*speed);
-			fprintf(stderr,"dbg4       heading:    %f\n",
-				*heading);
-			fprintf(stderr,"dbg4       nbath:      %d\n",
-				*nbath);
-			for (i=0;i<*nbath;i++)
-			  fprintf(stderr,"dbg4       beam:%d  flag:%3d  bath:%f  acrosstrack:%f  alongtrack:%f\n",
-				i,beamflag[i],bath[i],
-				bathacrosstrack[i],bathalongtrack[i]);
-			fprintf(stderr,"dbg4        namp:     %d\n",
-				*namp);
-			for (i=0;i<*namp;i++)
-			  fprintf(stderr,"dbg4        beam:%d   amp:%f  acrosstrack:%f  alongtrack:%f\n",
-				i,amp[i],bathacrosstrack[i],bathalongtrack[i]);
-			fprintf(stderr,"dbg4        nss:      %d\n",
-				*nss);
-			for (i=0;i<*nss;i++)
-			  fprintf(stderr,"dbg4        pixel:%d   ss:%f  acrosstrack:%f  alongtrack:%f\n",
-				i,ss[i],ssacrosstrack[i],ssalongtrack[i]);
-			}
-
-		/* done translating values */
-
-		}
-
-	/* extract data from structure */
-	else if (*kind == MB_DATA_NAV
-		|| *kind == MB_DATA_NAV1
-		|| *kind == MB_DATA_NAV2
-		|| *kind == MB_DATA_NAV3)
-		{
-		/* get time */
-		time_i[0] = store->pos_date / 10000;
-		time_i[1] = (store->pos_date % 10000) / 100;
-		time_i[2] = store->pos_date % 100;
-		time_i[3] = store->pos_msec / 3600000;
-		time_i[4] = (store->pos_msec % 3600000) / 60000;
-		time_i[5] = (store->pos_msec % 60000) / 1000;
-		time_i[6] = (store->pos_msec % 1000) * 1000;
-		mb_get_time(verbose,time_i,time_d);
-
-		/* get navigation */
-		if (store->pos_longitude != EM3_INVALID_INT)
-		    *navlon = 0.0000001 * store->pos_longitude;
-		else
-		    *navlon = 0.0;
-		if (store->pos_latitude != EM3_INVALID_INT)
-		    *navlat = 0.00000005 * store->pos_latitude;
-		else
-		    *navlat = 0.0;
-
-		/* get heading */
-		*heading = 0.01 * store->pos_heading;
-
-		/* get speed  */
-		if (store->pos_speed != EM3_INVALID_SHORT)
-			*speed = 0.036 * store->pos_speed;
-		else
-			*speed = 0.0;
-
-		*nbath = 0;
-		*namp = 0;
-		*nss = 0;
-
-		/* print debug statements */
-		if (verbose >= 5)
-			{
-			fprintf(stderr,"\ndbg4  Data extracted by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  Extracted values:\n");
-			fprintf(stderr,"dbg4       kind:       %d\n",
-				*kind);
-			fprintf(stderr,"dbg4       error:      %d\n",
-				*error);
-			fprintf(stderr,"dbg4       time_i[0]:  %d\n",
-				time_i[0]);
-			fprintf(stderr,"dbg4       time_i[1]:  %d\n",
-				time_i[1]);
-			fprintf(stderr,"dbg4       time_i[2]:  %d\n",
-				time_i[2]);
-			fprintf(stderr,"dbg4       time_i[3]:  %d\n",
-				time_i[3]);
-			fprintf(stderr,"dbg4       time_i[4]:  %d\n",
-				time_i[4]);
-			fprintf(stderr,"dbg4       time_i[5]:  %d\n",
-				time_i[5]);
-			fprintf(stderr,"dbg4       time_i[6]:  %d\n",
-				time_i[6]);
-			fprintf(stderr,"dbg4       time_d:     %f\n",
-				*time_d);
-			fprintf(stderr,"dbg4       longitude:  %f\n",
-				*navlon);
-			fprintf(stderr,"dbg4       latitude:   %f\n",
-				*navlat);
-			fprintf(stderr,"dbg4       speed:      %f\n",
-				*speed);
-			fprintf(stderr,"dbg4       heading:    %f\n",
-				*heading);
-			}
-
-		/* done translating values */
-
-		}
-
-	/* extract comment from structure */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* copy comment */
-		strncpy(comment,store->par_com,
-			MBSYS_SIMRAD3_COMMENT_LENGTH);
-
-		/* print debug statements */
-		if (verbose >= 4)
-			{
-			fprintf(stderr,"\ndbg4  New ping read by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  New ping values:\n");
-			fprintf(stderr,"dbg4       error:      %d\n",
-				*error);
-			fprintf(stderr,"dbg4       comment:    %s\n",
-				comment);
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind == MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"dbg2       comment:     \ndbg2       %s\n",
-			comment);
-		}
-	else if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind != MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"dbg2       time_i[0]:     %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:     %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:     %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:     %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:     %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:     %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:     %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:        %f\n",*time_d);
-		fprintf(stderr,"dbg2       longitude:     %f\n",*navlon);
-		fprintf(stderr,"dbg2       latitude:      %f\n",*navlat);
-		fprintf(stderr,"dbg2       speed:         %f\n",*speed);
-		fprintf(stderr,"dbg2       heading:       %f\n",*heading);
-		}
-	if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind == MB_DATA_DATA)
-		{
-		fprintf(stderr,"dbg2       nbath:      %d\n",
-			*nbath);
-		for (i=0;i<*nbath;i++)
-		  fprintf(stderr,"dbg2       beam:%d  flag:%3d  bath:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,beamflag[i],bath[i],
-			bathacrosstrack[i],bathalongtrack[i]);
-		fprintf(stderr,"dbg2        namp:     %d\n",
-			*namp);
-		for (i=0;i<*namp;i++)
-		  fprintf(stderr,"dbg2       beam:%d   amp:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,amp[i],bathacrosstrack[i],bathalongtrack[i]);
-		fprintf(stderr,"dbg2        nss:      %d\n",
-			*nss);
-		for (i=0;i<*nss;i++)
-		  fprintf(stderr,"dbg2        pixel:%d   ss:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,ss[i],ssacrosstrack[i],ssalongtrack[i]);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_simrad3_insert(int verbose, void *mbio_ptr, void *store_ptr,
-		int kind, int time_i[7], double time_d,
-		double navlon, double navlat,
-		double speed, double heading,
-		int nbath, int namp, int nss,
-		char *beamflag, double *bath, double *amp,
-		double *bathacrosstrack, double *bathalongtrack,
-		double *ss, double *ssacrosstrack, double *ssalongtrack,
-		char *comment, int *error)
-{
-	char	*function_name = "mbsys_simrad3_insert";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_simrad3_struct *store;
-	struct mbsys_simrad3_ping_struct *ping;
-	double	reflscale;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       kind:       %d\n",kind);
-		}
-	if (verbose >= 2 && (kind == MB_DATA_DATA || kind == MB_DATA_NAV))
-		{
-		fprintf(stderr,"dbg2       time_i[0]:  %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:  %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:  %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:  %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:  %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:  %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:  %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:     %f\n",time_d);
-		fprintf(stderr,"dbg2       navlon:     %f\n",navlon);
-		fprintf(stderr,"dbg2       navlat:     %f\n",navlat);
-		fprintf(stderr,"dbg2       speed:      %f\n",speed);
-		fprintf(stderr,"dbg2       heading:    %f\n",heading);
-		}
-	if (verbose >= 2 && kind == MB_DATA_DATA)
-		{
-		fprintf(stderr,"dbg2       nbath:      %d\n",nbath);
-		if (verbose >= 3)
-		 for (i=0;i<nbath;i++)
-		  fprintf(stderr,"dbg3       beam:%d  flag:%3d  bath:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,beamflag[i],bath[i],
-			bathacrosstrack[i],bathalongtrack[i]);
-		fprintf(stderr,"dbg2       namp:       %d\n",namp);
-		if (verbose >= 3)
-		 for (i=0;i<namp;i++)
-		  fprintf(stderr,"dbg3        beam:%d   amp:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,amp[i],bathacrosstrack[i],bathalongtrack[i]);
-		fprintf(stderr,"dbg2        nss:       %d\n",nss);
-		if (verbose >= 3)
-		 for (i=0;i<nss;i++)
-		  fprintf(stderr,"dbg3        beam:%d   ss:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,ss[i],ssacrosstrack[i],ssalongtrack[i]);
-		}
-	if (verbose >= 2 && kind == MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"dbg2       comment:     \ndbg2       %s\n",
-			comment);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_simrad3_struct *) store_ptr;
-
-	/* set data kind */
-	store->kind = kind;
-
-	/* insert data in structure */
-	if (store->kind == MB_DATA_DATA)
-		{
-		ping = (struct mbsys_simrad3_ping_struct *) &(store->pings[store->ping_index]);
-
-		/* get time */
-		ping->png_date = 10000 * time_i[0]
-				    + 100 * time_i[1]
-				    + time_i[2];
-		ping->png_msec = 3600000 * time_i[3]
-				    + 60000 * time_i[4]
-				    + 1000 * time_i[5]
-				    + 0.001 * time_i[6];
-		store->date = ping->png_date;
-		store->msec = ping->png_msec;
-
-		/* get navigation */
-		if (navlon < -180.0)
-			navlon += 360.0;
-		else if (navlon > 180.0)
-			navlon -= 360.0;
-		ping->png_longitude = 10000000 * navlon;
-		ping->png_latitude = 20000000 * navlat;
-
-		/* get heading */
-		if (heading < 0.0)
-			heading += 360.0;
-		else if (heading >= 360.0)
-			heading -= 360.0;
-		ping->png_heading = (int) rint(heading * 100);
-
-		/* get speed  */
-		ping->png_speed = (int) rint(speed / 0.036);
-
-		/* insert bathymetry and amplitude */
-		reflscale  = 0.1;
-		if (status == MB_SUCCESS && ping->png_nbeams == 0)
-			{
-			ping->png_nbeams_valid = 0;
-			for (i=0;i<nbath;i++)
-			    {
-			    if (beamflag[i] != MB_FLAG_NULL)
-				{
-				ping->png_depth[i] = bath[i] - ping->png_xducer_depth;
-				ping->png_beamflag[i] = beamflag[i];
-				ping->png_acrosstrack[i] = bathacrosstrack[i];
-				ping->png_alongtrack[i] = bathalongtrack[i];
-				ping->png_amp[i] = (int) rint(amp[i] / reflscale);
-				ping->png_nbeams++;
-				ping->png_nbeams_valid++;
-				}
-			    else
-				{
-				ping->png_depth[i] = 0.0;
-				ping->png_beamflag[i] = MB_FLAG_NULL;
-				ping->png_acrosstrack[i] = 0.0;
-				ping->png_alongtrack[i] = 0.0;
-				ping->png_amp[i] = 0;
-				ping->png_nbeams++;
-				}
-			    }
-			ping->png_nbeams = nbath;
-			}
-		else if (status == MB_SUCCESS)
-			{
-			for (i=0;i<ping->png_nbeams;i++)
-				{
-				ping->png_depth[i] = bath[i] - ping->png_xducer_depth;
-				ping->png_beamflag[i] = beamflag[i];
-				ping->png_acrosstrack[i] = bathacrosstrack[i];
-				ping->png_alongtrack[i] = bathalongtrack[i];
-				ping->png_amp[i] = (int) rint(amp[i] / reflscale);
-				}
-			}
-		if (status == MB_SUCCESS)
-			{
-			for (i=0;i<nss;i++)
-				{
-				if (ss[i] > MB_SIDESCAN_NULL)
-					{
-					ping->png_ss[i] = (short) rint(100 * ss[i]);
-					ping->png_ssalongtrack[i] = (short) rint(100 * ssalongtrack[i]);
-					}
-				else
-					{
-					ping->png_ss[i] = EM3_INVALID_SS;
-					ping->png_ssalongtrack[i] = 0;
-					}
-				}
-			}
-		}
-
-	/* insert data in nav structure */
-	else if (store->kind == MB_DATA_NAV
-		|| store->kind == MB_DATA_NAV1
-		|| store->kind == MB_DATA_NAV2
-		|| store->kind == MB_DATA_NAV3)
-		{
-
-		/* get time */
-		store->pos_date = 10000 * time_i[0]
-				    + 100 * time_i[1]
-				    + time_i[2];
-		store->pos_msec = 3600000 * time_i[3]
-				    + 60000 * time_i[4]
-				    + 1000 * time_i[5]
-				    + 0.001 * time_i[6];
-		store->msec = store->pos_msec;
-		store->date = store->pos_date;
-
-		/* get navigation */
-		if (navlon < -180.0)
-			navlon += 360.0;
-		else if (navlon > 180.0)
-			navlon -= 360.0;
-		store->pos_longitude = 10000000 * navlon;
-		store->pos_latitude = 20000000 * navlat;
-
-		/* get heading */
-		store->pos_heading = (int) rint(heading * 100);
-
-		/* get speed  */
-		store->pos_speed = (int) rint(speed / 0.036);
-
-		/* get roll pitch and heave */
-
-		/* set "active" flag if needed */
-		if (store->kind == MB_DATA_NAV)
-		    {
-		    store->pos_system = store->pos_system | 128;
-		    }
-
-		/* set secondary nav flag if needed */
-		else if (store->kind == MB_DATA_NAV1)
-		    {
-		    store->pos_system = store->pos_system | 1;
-		    }
-		else if (store->kind == MB_DATA_NAV2)
-		    {
-		    store->pos_system = store->pos_system | 2;
-		    }
-		else if (store->kind == MB_DATA_NAV3)
-		    {
-		    store->pos_system = store->pos_system | 3;
-		    }
-		}
-
-	/* insert comment in structure */
-	else if (store->kind == MB_DATA_COMMENT)
-		{
-		strncpy(store->par_com,comment,
-			MBSYS_SIMRAD3_COMMENT_LENGTH);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_simrad3_ttimes(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, int *nbeams,
-	double *ttimes, double *angles,
-	double *angles_forward, double *angles_null,
-	double *heave, double *alongtrack_offset,
-	double *draft, double *ssv, int *error)
-{
-	char	*function_name = "mbsys_simrad3_ttimes";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_simrad3_struct *store;
-	struct mbsys_simrad3_ping_struct *ping;
-	int	time_i[7];
-	double	ptime_d;
-	double	soundspeed;
-	double	offset_y;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       ttimes:     %p\n",(void *)ttimes);
-		fprintf(stderr,"dbg2       angles_xtrk:%p\n",(void *)angles);
-		fprintf(stderr,"dbg2       angles_ltrk:%p\n",(void *)angles_forward);
-		fprintf(stderr,"dbg2       angles_null:%p\n",(void *)angles_null);
-		fprintf(stderr,"dbg2       heave:      %p\n",(void *)heave);
-		fprintf(stderr,"dbg2       ltrk_off:   %p\n",(void *)alongtrack_offset);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_simrad3_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get survey data structure */
-		ping = (struct mbsys_simrad3_ping_struct *) &(store->pings[store->ping_index]);
-
-		/* get ping time */
-		time_i[0] = ping->png_date / 10000;
-		time_i[1] = (ping->png_date % 10000) / 100;
-		time_i[2] = ping->png_date % 100;
-		time_i[3] = ping->png_msec / 3600000;
-		time_i[4] = (ping->png_msec % 3600000) / 60000;
-		time_i[5] = (ping->png_msec % 60000) / 1000;
-		time_i[6] = (ping->png_msec % 1000) * 1000;
-		mb_get_time(verbose, time_i, &ptime_d);
-
-		/* obtain lever arm offset for sonar relative to the position sensor */
-		//mb_lever(verbose, store->par_s1y, store->par_s1x, store->par_s1z - store->par_wlz,
-		//		store->par_p1y, store->par_p1x, store->par_p1z,
-		//		store->par_msy, store->par_msx, store->par_msz,
-		//		-0.01 * ping->png_pitch + store->par_msp, -0.01 * ping->png_roll + store->par_msr,
-		//		&lever_x, &lever_y, &lever_z, error);
-
-		/* obtain position offset for beam */
-		//offset_x = store->par_s1y - store->par_p1y + lever_x;
-		//offset_y = store->par_s1x - store->par_p1x + lever_y;
-		//offset_z = lever_z;
-				
-		/* get alongtrack position offset */
-		if (store->par_aps == 0)
-			{
-			offset_y = store->par_p1x;
-			}
-		else if (store->par_aps == 1)
-			{
-			offset_y = store->par_p2x;
-			}
-		else if (store->par_aps == 2)
-			{
-			offset_y = store->par_p3x;
-			}
-		else
-			{
-			offset_y = store->par_p1x;
-			}
-		
-		/* special case when par_aps value is wrong */
-		if (offset_y == 0.0 && store->par_p1x != 0.0)
-			offset_y = store->par_p1x;
-		else if (offset_y == 0.0 && store->par_p2x != 0.0)
-			offset_y = store->par_p2x;
-		else if (offset_y == 0.0 && store->par_p3x != 0.0)
-			offset_y = store->par_p3x;
-				
-		/* get sonar depth */
-		*ssv = 0.1 * ping->png_ssv;
-		*draft = ping->png_xducer_depth;
-
-		/* get travel times, angles */
-		*nbeams = ping->png_nbeams;
-		soundspeed = 0.1 * ((double)ping->png_ssv);
-		for (i=0;i<ping->png_nbeams;i++)
-			{
-			ttimes[i] = ping->png_range[i];
-			angles[i] = ping->png_depression[i];
-			angles_forward[i] = 180.0 - ping->png_azimuth[i];
-			if (angles_forward[i] < 0.0) angles_forward[i] += 360.0;
-			angles_null[i] = 0.0;
-			heave[i] = ping->png_bheave[i];
-			alongtrack_offset[i] = (0.01 * ((double)ping->png_speed))
-						* ((double) ping->png_raw_txoffset[ping->png_raw_rxsector[i]])
-						+ offset_y;
-			}
-
-		/* set status */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error == MB_ERROR_NO_ERROR)
-		{
-		fprintf(stderr,"dbg2       draft:      %f\n",*draft);
-		fprintf(stderr,"dbg2       ssv:        %f\n",*ssv);
-		fprintf(stderr,"dbg2       nbeams:     %d\n",*nbeams);
-		for (i=0;i<*nbeams;i++)
-			fprintf(stderr,"dbg2       beam %d: tt:%f  angle_xtrk:%f  angle_ltrk:%f  angle_null:%f  depth_off:%f  ltrk_off:%f\n",
-				i,ttimes[i],angles[i],
-				angles_forward[i],angles_null[i],
-				heave[i],alongtrack_offset[i]);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_simrad3_detects(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, int *nbeams, int *detects, int *error)
-{
-	char	*function_name = "mbsys_simrad3_detects";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_simrad3_struct *store;
-	struct mbsys_simrad3_ping_struct *ping;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       detects:    %p\n",(void *)detects);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_simrad3_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get survey data structure */
-		ping = (struct mbsys_simrad3_ping_struct *) &(store->pings[store->ping_index]);
-
-		*nbeams = ping->png_nbeams;
-		for (j=0;j<ping->png_nbeams;j++)
-			{
-			detects[j] = MB_DETECT_UNKNOWN;
-			}
-		for (i=0;i<ping->png_nbeams;i++)
-			{
-			if (ping->png_detection[i] & 1)
-				detects[i] = MB_DETECT_PHASE;
-			else
-				detects[i] = MB_DETECT_AMPLITUDE;
-			}
-
-		/* set status */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error == MB_ERROR_NO_ERROR)
-		{
-		fprintf(stderr,"dbg2       nbeams:     %d\n",*nbeams);
-		for (i=0;i<*nbeams;i++)
-			fprintf(stderr,"dbg2       beam %d: detects:%d\n",
-				i,detects[i]);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_simrad3_pulses(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, int *nbeams, int *pulses, int *error)
-{
-	char	*function_name = "mbsys_simrad3_pulses";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_simrad3_struct *store;
-	struct mbsys_simrad3_ping_struct *ping;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       pulses:     %p\n",(void *)pulses);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_simrad3_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get survey data structure */
-		ping = (struct mbsys_simrad3_ping_struct *) &(store->pings[store->ping_index]);
-
-		*nbeams = ping->png_nbeams;
-		for (j=0;j<ping->png_nbeams;j++)
-			{
-			pulses[j] = MB_PULSE_UNKNOWN;
-			}
-		for (i=0;i<ping->png_nbeams;i++)
-			{
-			if (ping->png_raw_txwaveform[ping->png_raw_rxsector[i]] == 0)
-				pulses[i] = MB_PULSE_CW;
-			else if (ping->png_raw_txwaveform[ping->png_raw_rxsector[i]] == 1)
-				pulses[i] = MB_PULSE_UPCHIRP;
-			else if (ping->png_raw_txwaveform[ping->png_raw_rxsector[i]] == 2)
-				pulses[i] = MB_PULSE_DOWNCHIRP;
-			}
-
-		/* set status */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error == MB_ERROR_NO_ERROR)
-		{
-		fprintf(stderr,"dbg2       nbeams:     %d\n",*nbeams);
-		for (i=0;i<*nbeams;i++)
-			fprintf(stderr,"dbg2       beam %d: pulses:%d\n",
-				i,pulses[i]);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_simrad3_gains(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, double *transmit_gain, double *pulse_length,
-			double *receive_gain, int *error)
-{
-	char	*function_name = "mbsys_simrad3_gains";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_simrad3_struct *store;
-	struct mbsys_simrad3_ping_struct *ping;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_simrad3_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get survey data structure */
-		ping = (struct mbsys_simrad3_ping_struct *) &(store->pings[store->ping_index]);
-
-		/* get transmit_gain (dB) */
-		*transmit_gain = (double)store->run_tran_pow;
-
-		/* get pulse_length (sec) */
-		*pulse_length = 0.000001 * (double)store->run_tran_pulse;
-
-		/* get receive_gain (dB) */
-		*receive_gain = (double)store->run_rec_gain;
-
-		/* set status */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error == MB_ERROR_NO_ERROR)
-		{
-		fprintf(stderr,"dbg2       transmit_gain: %f\n",*transmit_gain);
-		fprintf(stderr,"dbg2       pulse_length:  %f\n",*pulse_length);
-		fprintf(stderr,"dbg2       receive_gain:  %f\n",*receive_gain);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_simrad3_extract_altitude(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, double *transducer_depth, double *altitude,
-	int *error)
-{
-	char	*function_name = "mbsys_simrad3_extract_altitude";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_simrad3_struct *store;
-	struct mbsys_simrad3_ping_struct *ping;
-	double	altitude_best;
-	double	xtrack_min;
-	int	found;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_simrad3_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get survey data structure */
-		ping = (struct mbsys_simrad3_ping_struct *) &(store->pings[store->ping_index]);
-
-		/* get transducer depth and altitude */
-		*transducer_depth = ping->png_xducer_depth;
-		found = MB_NO;
-		altitude_best = 0.0;
-		xtrack_min = 99999999.9;
-		for (i=0;i<ping->png_nbeams;i++)
-		    {
-		    if (mb_beam_ok(ping->png_beamflag[i])
-			&& fabs(ping->png_acrosstrack[i]) < xtrack_min)
-			{
-			xtrack_min = fabs(ping->png_acrosstrack[i]);
-			altitude_best = ping->png_depth[i];
-			found = MB_YES;
-			}
-		    }
-		if (found == MB_NO)
-		    {
-		    xtrack_min = 99999999.9;
-		    for (i=0;i<ping->png_nbeams;i++)
-			{
-			if (ping->png_quality[i] > 0
-			    && fabs(ping->png_acrosstrack[i]) < xtrack_min)
-			    {
-			    xtrack_min = fabs(ping->png_acrosstrack[i]);
-			    altitude_best = ping->png_depth[i];
-			    found = MB_YES;
-			    }
-			}
-		    }
-		if (found == MB_YES)
-		    *altitude = altitude_best;
-		else
-		    *altitude = 0.0;
-
-		/* set status */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:              %d\n",*kind);
-		fprintf(stderr,"dbg2       transducer_depth:  %f\n",*transducer_depth);
-		fprintf(stderr,"dbg2       altitude:          %f\n",*altitude);
-		fprintf(stderr,"dbg2       error:             %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:            %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_simrad3_extract_nnav(int verbose, void *mbio_ptr, void *store_ptr,
-			int nmax, int *kind, int *n,
-			int *time_i, double *time_d,
-			double *navlon, double *navlat,
-			double *speed, double *heading, double *draft,
-			double *roll, double *pitch, double *heave,
-			int *error)
-{
-	char	*function_name = "mbsys_simrad3_extract_nnav";
-	int	status = MB_SUCCESS;
-	int	interp_error = MB_ERROR_NO_ERROR;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_simrad3_struct *store;
-	struct mbsys_simrad3_ping_struct *ping;
-	struct mbsys_simrad3_attitude_struct *attitude;
-	struct mbsys_simrad3_netattitude_struct *netattitude;
-	double	atime_d;
-	int	atime_i[7];
-	int	i, inav;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       nmax:       %d\n",nmax);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_simrad3_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from ping structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get survey data structure */
-		ping = (struct mbsys_simrad3_ping_struct *) &(store->pings[store->ping_index]);
-
-		/* just one navigation value */
-		*n = 1;
-
-		/* get time */
-		time_i[0] = ping->png_date / 10000;
-		time_i[1] = (ping->png_date % 10000) / 100;
-		time_i[2] = ping->png_date % 100;
-		time_i[3] = ping->png_msec / 3600000;
-		time_i[4] = (ping->png_msec % 3600000) / 60000;
-		time_i[5] = (ping->png_msec % 60000) / 1000;
-		time_i[6] = (ping->png_msec % 1000) * 1000;
-		mb_get_time(verbose,time_i,time_d);
-
-		/* get navigation */
-		if (ping->png_longitude != EM3_INVALID_INT)
-		    *navlon = 0.0000001 * ping->png_longitude;
-		else
-		    *navlon = 0.0;
-		if (ping->png_latitude != EM3_INVALID_INT)
-		    *navlat = 0.00000005 * ping->png_latitude;
-		else
-		    *navlat = 0.0;
-
-		/* get heading */
-		*heading = 0.01 * ping->png_heading;
-
-		/* get speed  */
-		if (ping->png_speed != EM3_INVALID_SHORT)
-			*speed = 0.036 * ping->png_speed;
-		else
-			*speed = 0.0;
-
-		/* get draft  */
-		*draft = ping->png_xducer_depth;
-
-		/* get roll pitch and heave */
-		*roll = 0.01 * ping->png_roll;
-		*pitch = 0.01 * ping->png_pitch;
-		*heave = 0.01 * ping->png_heave;
-
-		/* done translating values */
-
-		}
-
-	/* extract data from nav structure */
-	else if (*kind == MB_DATA_NAV
-		|| *kind == MB_DATA_NAV1
-		|| *kind == MB_DATA_NAV2
-		|| *kind == MB_DATA_NAV3)
-		{
- 		/* get survey data structure */
-		ping = (struct mbsys_simrad3_ping_struct *) &(store->pings[store->ping_index]);
-
-		/* just one navigation value */
-		*n = 1;
-
-		/* get time */
-		time_i[0] = store->pos_date / 10000;
-		time_i[1] = (store->pos_date % 10000) / 100;
-		time_i[2] = store->pos_date % 100;
-		time_i[3] = store->pos_msec / 3600000;
-		time_i[4] = (store->pos_msec % 3600000) / 60000;
-		time_i[5] = (store->pos_msec % 60000) / 1000;
-		time_i[6] = (store->pos_msec % 1000) * 1000;
-		mb_get_time(verbose,time_i,time_d);
-
-		/* get navigation */
-		if (store->pos_longitude != EM3_INVALID_INT)
-		    *navlon = 0.0000001 * store->pos_longitude;
-		else
-		    *navlon = 0.0;
-		if (store->pos_latitude != EM3_INVALID_INT)
-		    *navlat = 0.00000005 * store->pos_latitude;
-		else
-		    *navlat = 0.0;
-
-		/* get heading */
-		if (store->pos_heading != EM3_INVALID_SHORT)
-			*heading = 0.01 * store->pos_heading;
-		else
-			*heading = 0.0;
-
-		/* get speed  */
-		if (store->pos_speed != EM3_INVALID_SHORT)
-			*speed = 0.036 * store->pos_speed;
-		else
-			*speed = 0.0;
-
-		/* get draft  */
-		if (ping != NULL)
-			*draft = ping->png_xducer_depth;
-		else
-			*draft = 0.0;
-
-		/* get roll pitch and heave */
-		*roll = 0.01 * store->pos_roll;
-		*pitch = 0.01 * store->pos_pitch;
-		*heave = 0.01 * store->pos_heave;
-
-		/* done translating values */
-
-		}
-
-	/* extract data from attitude structure */
-	else if (store->type == EM3_ATTITUDE
-		&& store->attitude != NULL)
-		{
-                /* get attitude data structure */
-		attitude = (struct mbsys_simrad3_attitude_struct *) store->attitude;
-
-		/* get n */
-		*n = MIN(attitude->att_ndata, MB_ASYNCH_SAVE_MAX);
-
-		/* get attitude time */
-		atime_i[0] = attitude->att_date / 10000;
-		atime_i[1] = (attitude->att_date % 10000) / 100;
-		atime_i[2] = attitude->att_date % 100;
-		atime_i[3] = attitude->att_msec / 3600000;
-		atime_i[4] = (attitude->att_msec % 3600000) / 60000;
-		atime_i[5] = (attitude->att_msec % 60000) / 1000;
-		atime_i[6] = (attitude->att_msec % 1000) * 1000;
-		mb_get_time(verbose, atime_i, &atime_d);
-
-		/* loop over the data */
-		for (i=0;i<*n;i++)
-			{
-			/* get time from the data record */
-			time_d[i] = (double)(atime_d + 0.001 * attitude->att_time[i]);
-			mb_get_date(verbose,time_d[i],&(time_i[7*i]));
-
-			/* get attitude from the data record */
-			heave[i] = (double)(0.01 * attitude->att_heave[i]);
-			roll[i] = (double)(0.01 * attitude->att_roll[i]);
-			pitch[i] = (double)(0.01 * attitude->att_pitch[i]);
-
-			/* interpolate the heading */
-			mb_hedint_interp(verbose, mbio_ptr, time_d[i],
-				    		&heading[i], &interp_error);
-
-			/* interpolate the navigation */
-			mb_navint_interp(verbose, mbio_ptr, time_d[i], heading[i], 0.0,
-						&navlon[i], &navlat[i], &speed[i], &interp_error);
-
-			/* interpolate the sonar depth */
-			mb_depint_interp(verbose, mbio_ptr, time_d[i], &draft[i], &interp_error);
-			}
-
-		/* done translating values */
-
-		}
-
-	/* extract data from netattitude structure */
-	else if (store->type == EM3_NETATTITUDE
-		&& store->netattitude != NULL)
-		{
-                /* get attitude data structure */
-		netattitude = (struct mbsys_simrad3_netattitude_struct *) store->netattitude;
-
-		/* get n */
-		*n = MIN(netattitude->nat_ndata, MB_ASYNCH_SAVE_MAX);
-
-		/* get attitude time */
-		atime_i[0] = netattitude->nat_date / 10000;
-		atime_i[1] = (netattitude->nat_date % 10000) / 100;
-		atime_i[2] = netattitude->nat_date % 100;
-		atime_i[3] = netattitude->nat_msec / 3600000;
-		atime_i[4] = (netattitude->nat_msec % 3600000) / 60000;
-		atime_i[5] = (netattitude->nat_msec % 60000) / 1000;
-		atime_i[6] = (netattitude->nat_msec % 1000) * 1000;
-		mb_get_time(verbose, atime_i, &atime_d);
-
-		/* loop over the data */
-		for (i=0;i<*n;i++)
-			{
-			/* get time from the data record */
-			time_d[i] = (double)(atime_d + 0.001 * netattitude->nat_time[i]);
-			mb_get_date(verbose,time_d[i],&(time_i[7*i]));
-
-			/* get attitude from the data record */
-			heave[i] = (double)(0.01 * netattitude->nat_heave[i]);
-			roll[i] = (double)(0.01 * netattitude->nat_roll[i]);
-			pitch[i] = (double)(0.01 * netattitude->nat_pitch[i]);
-
-			/* interpolate the heading */
-			mb_hedint_interp(verbose, mbio_ptr, time_d[i],
-				    		&heading[i], &interp_error);
-
-			/* interpolate the navigation */
-			mb_navint_interp(verbose, mbio_ptr, time_d[i], heading[i], 0.0,
-						&navlon[i], &navlat[i], &speed[i], &interp_error);
-
-			/* interpolate the sonar depth */
-			mb_depint_interp(verbose, mbio_ptr, time_d[i], &draft[i], &interp_error);
-			}
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*n = 0;
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*n = 0;
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		fprintf(stderr,"dbg2       n:          %d\n",*n);
-		for (inav=0;inav<*n;inav++)
-			{
-			for (i=0;i<7;i++)
-				fprintf(stderr,"dbg2       %d time_i[%d]:     %d\n",inav,i,time_i[inav * 7 + i]);
-			fprintf(stderr,"dbg2       %d time_d:        %f\n",inav,time_d[inav]);
-			fprintf(stderr,"dbg2       %d longitude:     %f\n",inav,navlon[inav]);
-			fprintf(stderr,"dbg2       %d latitude:      %f\n",inav,navlat[inav]);
-			fprintf(stderr,"dbg2       %d speed:         %f\n",inav,speed[inav]);
-			fprintf(stderr,"dbg2       %d heading:       %f\n",inav,heading[inav]);
-			fprintf(stderr,"dbg2       %d draft:         %f\n",inav,draft[inav]);
-			fprintf(stderr,"dbg2       %d roll:          %f\n",inav,roll[inav]);
-			fprintf(stderr,"dbg2       %d pitch:         %f\n",inav,pitch[inav]);
-			fprintf(stderr,"dbg2       %d heave:         %f\n",inav,heave[inav]);
-			}
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbsys_simrad3_extract_nav(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int time_i[7], double *time_d,
-		double *navlon, double *navlat,
-		double *speed, double *heading, double *draft,
-		double *roll, double *pitch, double *heave,
-		int *error)
-{
-	char	*function_name = "mbsys_simrad3_extract_nav";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_simrad3_struct *store;
-	struct mbsys_simrad3_ping_struct *ping;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_simrad3_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from ping structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get survey data structure */
-		ping = (struct mbsys_simrad3_ping_struct *) &(store->pings[store->ping_index]);
-
-		/* get time */
-		time_i[0] = ping->png_date / 10000;
-		time_i[1] = (ping->png_date % 10000) / 100;
-		time_i[2] = ping->png_date % 100;
-		time_i[3] = ping->png_msec / 3600000;
-		time_i[4] = (ping->png_msec % 3600000) / 60000;
-		time_i[5] = (ping->png_msec % 60000) / 1000;
-		time_i[6] = (ping->png_msec % 1000) * 1000;
-		mb_get_time(verbose,time_i,time_d);
-
-		/* get navigation */
-		if (ping->png_longitude != EM3_INVALID_INT)
-		    *navlon = 0.0000001 * ping->png_longitude;
-		else
-		    *navlon = 0.0;
-		if (ping->png_latitude != EM3_INVALID_INT)
-		    *navlat = 0.00000005 * ping->png_latitude;
-		else
-		    *navlat = 0.0;
-
-		/* get heading */
-		*heading = 0.01 * ping->png_heading;
-
-		/* get speed  */
-		if (ping->png_speed != EM3_INVALID_SHORT)
-			*speed = 0.036 * ping->png_speed;
-		else
-			*speed = 0.0;
-
-		/* get draft  */
-		*draft = ping->png_xducer_depth;
-
-		/* get roll pitch and heave */
-		*roll = 0.01 * ping->png_roll;
-		*pitch = 0.01 * ping->png_pitch;
-		*heave = 0.01 * ping->png_heave;
-
-		/* done translating values */
-
-		}
-
-	/* extract data from nav structure */
-	else if (*kind == MB_DATA_NAV
-		|| *kind == MB_DATA_NAV1
-		|| *kind == MB_DATA_NAV2
-		|| *kind == MB_DATA_NAV3)
-		{
-                /* get survey data structure */
-		/* get survey data structure */
-		ping = (struct mbsys_simrad3_ping_struct *) &(store->pings[store->ping_index]);
-
-		/* get time */
-		time_i[0] = store->pos_date / 10000;
-		time_i[1] = (store->pos_date % 10000) / 100;
-		time_i[2] = store->pos_date % 100;
-		time_i[3] = store->pos_msec / 3600000;
-		time_i[4] = (store->pos_msec % 3600000) / 60000;
-		time_i[5] = (store->pos_msec % 60000) / 1000;
-		time_i[6] = (store->pos_msec % 1000) * 1000;
-		mb_get_time(verbose,time_i,time_d);
-
-		/* get navigation */
-		if (store->pos_longitude != EM3_INVALID_INT)
-		    *navlon = 0.0000001 * store->pos_longitude;
-		else
-		    *navlon = 0.0;
-		if (store->pos_latitude != EM3_INVALID_INT)
-		    *navlat = 0.00000005 * store->pos_latitude;
-		else
-		    *navlat = 0.0;
-
-		/* get heading */
-		if (store->pos_heading != EM3_INVALID_SHORT)
-			*heading = 0.01 * store->pos_heading;
-		else
-			*heading = 0.0;
-
-		/* get speed  */
-		if (store->pos_speed != EM3_INVALID_SHORT)
-			*speed = 0.036 * store->pos_speed;
-		else
-			*speed = 0.0;
-
-		/* get draft  */
-		if (ping != NULL)
-			*draft = ping->png_xducer_depth;
-		else
-			*draft = 0.0;
-
-		/* get roll pitch and heave */
-		*roll = 0.01 * store->pos_roll;
-		*pitch = 0.01 * store->pos_pitch;
-		*heave = 0.01 * store->pos_heave;
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind == MB_DATA_DATA)
-		{
-		fprintf(stderr,"dbg2       time_i[0]:     %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:     %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:     %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:     %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:     %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:     %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:     %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:        %f\n",*time_d);
-		fprintf(stderr,"dbg2       longitude:     %f\n",*navlon);
-		fprintf(stderr,"dbg2       latitude:      %f\n",*navlat);
-		fprintf(stderr,"dbg2       speed:         %f\n",*speed);
-		fprintf(stderr,"dbg2       heading:       %f\n",*heading);
-		fprintf(stderr,"dbg2       draft:         %f\n",*draft);
-		fprintf(stderr,"dbg2       roll:          %f\n",*roll);
-		fprintf(stderr,"dbg2       pitch:         %f\n",*pitch);
-		fprintf(stderr,"dbg2       heave:         %f\n",*heave);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_simrad3_insert_nav(int verbose, void *mbio_ptr, void *store_ptr,
-		int time_i[7], double time_d,
-		double navlon, double navlat,
-		double speed, double heading, double draft,
-		double roll, double pitch, double heave,
-		int *error)
-{
-	char	*function_name = "mbsys_simrad3_insert_nav";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_simrad3_struct *store;
-	struct mbsys_simrad3_ping_struct *ping;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       time_i[0]:  %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:  %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:  %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:  %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:  %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:  %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:  %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:     %f\n",time_d);
-		fprintf(stderr,"dbg2       navlon:     %f\n",navlon);
-		fprintf(stderr,"dbg2       navlat:     %f\n",navlat);
-		fprintf(stderr,"dbg2       speed:      %f\n",speed);
-		fprintf(stderr,"dbg2       heading:    %f\n",heading);
-		fprintf(stderr,"dbg2       draft:      %f\n",draft);
-		fprintf(stderr,"dbg2       roll:       %f\n",roll);
-		fprintf(stderr,"dbg2       pitch:      %f\n",pitch);
-		fprintf(stderr,"dbg2       heave:      %f\n",heave);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_simrad3_struct *) store_ptr;
-
-	/* insert data in ping structure */
-	if (store->kind == MB_DATA_DATA)
-		{
-		ping = (struct mbsys_simrad3_ping_struct *) &(store->pings[store->ping_index]);
-
-		/* get time */
-		ping->png_date = 10000 * time_i[0]
-				    + 100 * time_i[1]
-				    + time_i[2];
-		ping->png_msec = 3600000 * time_i[3]
-				    + 60000 * time_i[4]
-				    + 1000 * time_i[5]
-				    + 0.001 * time_i[6];
-		store->msec = ping->png_msec;
-		store->date = ping->png_date;
-
-		/* get navigation */
-		if (navlon < -180.0)
-			navlon += 360.0;
-		else if (navlon > 180.0)
-			navlon -= 360.0;
-		ping->png_longitude = 10000000 * navlon;
-		ping->png_latitude = 20000000 * navlat;
-
-		/* get heading */
-		if (heading < 0.0)
-			heading += 360.0;
-		else if (heading >= 360.0)
-			heading -= 360.0;
-		ping->png_heading = (int) rint(heading * 100);
-
-		/* get speed  */
-		ping->png_speed = (int) rint(speed / 0.036);
-
-		/* get draft  */
-		ping->png_xducer_depth = draft;
-
-		/* get roll pitch and heave */
-		ping->png_roll = (int) rint(roll / 0.01);
-		ping->png_pitch = (int) rint(pitch / 0.01);
-		ping->png_heave = (int) rint(heave / 0.01);
-		}
-
-	/* insert data in nav structure */
-	else if (store->kind == MB_DATA_NAV
-		|| store->kind == MB_DATA_NAV1
-		|| store->kind == MB_DATA_NAV2
-		|| store->kind == MB_DATA_NAV3)
-		{
-
-		/* get time */
-		store->pos_date = 10000 * time_i[0]
-				    + 100 * time_i[1]
-				    + time_i[2];
-		store->pos_msec = 3600000 * time_i[3]
-				    + 60000 * time_i[4]
-				    + 1000 * time_i[5]
-				    + 0.001 * time_i[6];
-		store->msec = store->pos_msec;
-		store->date = store->pos_date;
-
-		/* get navigation */
-		if (navlon < -180.0)
-			navlon += 360.0;
-		else if (navlon > 180.0)
-			navlon -= 360.0;
-		store->pos_longitude = 10000000 * navlon;
-		store->pos_latitude = 20000000 * navlat;
-
-		/* get heading */
-		store->pos_heading = (int) rint(heading * 100);
-
-		/* get speed  */
-		store->pos_speed = (int) rint(speed / 0.036);
-
-		/* get roll pitch and heave */
-		store->pos_roll = (int) rint(roll / 0.01);
-		store->pos_pitch = (int) rint(pitch / 0.01);
-		store->pos_heave = (int) rint(heave / 0.01);
-
-		/* set "active" flag if needed */
-		if (store->kind == MB_DATA_NAV)
-		    {
-		    store->pos_system = store->pos_system | 128;
-		    }
-
-		/* set secondary nav flag if needed */
-		else if (store->kind == MB_DATA_NAV1)
-		    {
-		    store->pos_system = store->pos_system | 1;
-		    }
-		else if (store->kind == MB_DATA_NAV2)
-		    {
-		    store->pos_system = store->pos_system | 2;
-		    }
-		else if (store->kind == MB_DATA_NAV3)
-		    {
-		    store->pos_system = store->pos_system | 3;
-		    }
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_simrad3_extract_svp(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int *nsvp,
-		double *depth, double *velocity,
-		int *error)
-{
-	char	*function_name = "mbsys_simrad3_extract_svp";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_simrad3_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_simrad3_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_VELOCITY_PROFILE)
-		{
-		/* get number of depth-velocity pairs */
-		*nsvp = store->svp_num;
-
-		/* get profile */
-		for (i=0;i<*nsvp;i++)
-			{
-			depth[i] = 0.01 * store->svp_depth_res * store->svp_depth[i];
-			velocity[i] = 0.1 * store->svp_vel[i];
-			}
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:              %d\n",*kind);
-		fprintf(stderr,"dbg2       nsvp:              %d\n",*nsvp);
-		for (i=0;i<*nsvp;i++)
-		    fprintf(stderr,"dbg2       depth[%d]: %f   velocity[%d]: %f\n",i, depth[i], i, velocity[i]);
-		fprintf(stderr,"dbg2       error:             %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:            %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_simrad3_insert_svp(int verbose, void *mbio_ptr, void *store_ptr,
-		int nsvp,
-		double *depth, double *velocity,
-		int *error)
-{
-	char	*function_name = "mbsys_simrad3_insert_svp";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_simrad3_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       nsvp:       %d\n",nsvp);
-		for (i=0;i<nsvp;i++)
-		    fprintf(stderr,"dbg2       depth[%d]: %f   velocity[%d]: %f\n",i, depth[i], i, velocity[i]);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_simrad3_struct *) store_ptr;
-
-	/* insert data in structure */
-	if (store->kind == MB_DATA_VELOCITY_PROFILE)
-		{
-		/* get number of depth-velocity pairs */
-		store->svp_num = MIN(nsvp, MBSYS_SIMRAD3_MAXSVP);
-		store->svp_depth_res = 1;
-
-		/* get profile */
-		for (i=0;i<store->svp_num;i++)
-			{
-			store->svp_depth[i] = (int) (100 * depth[i] / store->svp_depth_res);
-			store->svp_vel[i] = (int) (10 * velocity[i]);
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_simrad3_copy(int verbose, void *mbio_ptr,
-			void *store_ptr, void *copy_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_simrad3_copy";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_simrad3_struct *store;
-	struct mbsys_simrad3_struct *copy;
-	struct mbsys_simrad3_attitude_struct *attitude_store;
-	struct mbsys_simrad3_attitude_struct *attitude_copy;
-	char	*attitude_save;
-	struct mbsys_simrad3_netattitude_struct *netattitude_store;
-	struct mbsys_simrad3_netattitude_struct *netattitude_copy;
-	char	*netattitude_save;
-	struct mbsys_simrad3_heading_struct *heading_store;
-	struct mbsys_simrad3_heading_struct *heading_copy;
-	char	*heading_save;
-	struct mbsys_simrad3_ssv_struct *ssv_store;
-	struct mbsys_simrad3_ssv_struct *ssv_copy;
-	char	*ssv_save;
-	struct mbsys_simrad3_tilt_struct *tilt_store;
-	struct mbsys_simrad3_tilt_struct *tilt_copy;
-	char	*tilt_save;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       copy_ptr:   %p\n",(void *)copy_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointers */
-	store = (struct mbsys_simrad3_struct *) store_ptr;
-	copy = (struct mbsys_simrad3_struct *) copy_ptr;
-
-	/* check if attitude data needs to be copied */
-	if (store->attitude != NULL)
-		{
-		/* make sure a attitude data structure exists to
-			be copied into */
-		if (copy->attitude == NULL)
-			{
-			status = mbsys_simrad3_attitude_alloc(
-					verbose,mbio_ptr,
-					copy_ptr,error);
-			}
-
-		/* save pointer value */
-		attitude_save = (char *)copy->attitude;
-		}
-
-	/* check if netattitude data needs to be copied */
-	if (store->netattitude != NULL)
-		{
-		/* make sure a netattitude data structure exists to
-			be copied into */
-		if (copy->netattitude == NULL)
-			{
-			status = mbsys_simrad3_netattitude_alloc(
-					verbose,mbio_ptr,
-					copy_ptr,error);
-			}
-
-		/* save pointer value */
-		netattitude_save = (char *)copy->netattitude;
-		}
-
-	/* check if heading data needs to be copied */
-	if (store->heading != NULL)
-		{
-		/* make sure a heading data structure exists to
-			be copied into */
-		if (copy->heading == NULL)
-			{
-			status = mbsys_simrad3_heading_alloc(
-					verbose,mbio_ptr,
-					copy_ptr,error);
-			}
-
-		/* save pointer value */
-		heading_save = (char *)copy->heading;
-		}
-
-	/* check if ssv data needs to be copied */
-	if (store->ssv != NULL)
-		{
-		/* make sure a ssv data structure exists to
-			be copied into */
-		if (copy->ssv == NULL)
-			{
-			status = mbsys_simrad3_ssv_alloc(
-					verbose,mbio_ptr,
-					copy_ptr,error);
-			}
-
-		/* save pointer value */
-		ssv_save = (char *)copy->ssv;
-		}
-
-	/* check if tilt data needs to be copied */
-	if (store->tilt != NULL)
-		{
-		/* make sure a tilt data structure exists to
-			be copied into */
-		if (copy->tilt == NULL)
-			{
-			status = mbsys_simrad3_tilt_alloc(
-					verbose,mbio_ptr,
-					copy_ptr,error);
-			}
-
-		/* save pointer value */
-		tilt_save = (char *)copy->tilt;
-		}
-
-	/* copy the main structure */
-	*copy = *store;
-
-	/* if needed copy the attitude data structure */
-	if (store->attitude != NULL && status == MB_SUCCESS)
-		{
-		copy->attitude = (struct mbsys_simrad3_attitude_struct *) attitude_save;
-		attitude_store = (struct mbsys_simrad3_attitude_struct *) store->attitude;
-		attitude_copy = (struct mbsys_simrad3_attitude_struct *) copy->attitude;
-		*attitude_copy = *attitude_store;
-		}
-
-	/* if needed copy the netattitude data structure */
-	if (store->netattitude != NULL && status == MB_SUCCESS)
-		{
-		copy->netattitude = (struct mbsys_simrad3_netattitude_struct *) netattitude_save;
-		netattitude_store = (struct mbsys_simrad3_netattitude_struct *) store->netattitude;
-		netattitude_copy = (struct mbsys_simrad3_netattitude_struct *) copy->netattitude;
-		*netattitude_copy = *netattitude_store;
-		}
-
-	/* if needed copy the heading data structure */
-	if (store->heading != NULL && status == MB_SUCCESS)
-		{
-		copy->heading = (struct mbsys_simrad3_heading_struct *) heading_save;
-		heading_store = (struct mbsys_simrad3_heading_struct *) store->heading;
-		heading_copy = (struct mbsys_simrad3_heading_struct *) copy->heading;
-		*heading_copy = *heading_store;
-		}
-
-	/* if needed copy the ssv data structure */
-	if (store->ssv != NULL && status == MB_SUCCESS)
-		{
-		copy->ssv = (struct mbsys_simrad3_ssv_struct *) ssv_save;
-		ssv_store = (struct mbsys_simrad3_ssv_struct *) store->ssv;
-		ssv_copy = (struct mbsys_simrad3_ssv_struct *) copy->ssv;
-		*ssv_copy = *ssv_store;
-		}
-
-	/* if needed copy the tilt data structure */
-	if (store->tilt != NULL && status == MB_SUCCESS)
-		{
-		copy->tilt = (struct mbsys_simrad3_tilt_struct *) tilt_save;
-		tilt_store = (struct mbsys_simrad3_tilt_struct *) store->tilt;
-		tilt_copy = (struct mbsys_simrad3_tilt_struct *) copy->tilt;
-		*tilt_copy = *tilt_store;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_simrad3_makess(int verbose, void *mbio_ptr, void *store_ptr,
-		int pixel_size_set, double *pixel_size,
-		int swath_width_set, double *swath_width,
-		int pixel_int,
-		int *error)
-{
-	char	*function_name = "mbsys_simrad3_makess";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_simrad3_struct *store;
-	struct mbsys_simrad3_ping_struct *ping;
-	double	ss[MBSYS_SIMRAD3_MAXPIXELS];
-	int	ss_cnt[MBSYS_SIMRAD3_MAXPIXELS];
-	double	ssacrosstrack[MBSYS_SIMRAD3_MAXPIXELS];
-	double	ssalongtrack[MBSYS_SIMRAD3_MAXPIXELS];
-	short *beam_ss;
-	int	nbathsort;
-	double	bathsort[MBSYS_SIMRAD3_MAXBEAMS];
-	double	depthoffset;
-	double	reflscale;
-	double  pixel_size_calc;
-	double	pixel_size_max_swath;
-	double	ss_spacing, ss_spacing_use;
-	int	pixel_int_use;
-	double	angle, xtrackss;
-	double	range, beam_foot, beamwidth, sint;
-	int	time_i[7];
-	double	bath_time_d, ss_time_d;
-	int	ss_ok;
-	int	first, last, k1, k2;
-	int	i, k, kk;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:         %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:        %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:       %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       pixel_size_set:  %d\n",pixel_size_set);
-		fprintf(stderr,"dbg2       pixel_size:      %f\n",*pixel_size);
-		fprintf(stderr,"dbg2       swath_width_set: %d\n",swath_width_set);
-		fprintf(stderr,"dbg2       swath_width:     %f\n",*swath_width);
-		fprintf(stderr,"dbg2       pixel_int:       %d\n",pixel_int);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_simrad3_struct *) store_ptr;
-
-	/* insert data in structure */
-	if (store->kind == MB_DATA_DATA)
-		{
-		/* get survey data structure */
-		ping = (struct mbsys_simrad3_ping_struct *) &(store->pings[store->ping_index]);
-
-		/* zero the sidescan */
-		for (i=0;i<MBSYS_SIMRAD3_MAXPIXELS;i++)
-			{
-			ss[i] = 0.0;
-			ssacrosstrack[i] = 0.0;
-			ssalongtrack[i] = 0.0;
-			ss_cnt[i] = 0;
-			}
-
-		/* set scaling parameters */
-		depthoffset = ping->png_xducer_depth;
-		reflscale  = 0.1;
-
-		/* get raw pixel size */
-		ss_spacing = 750.0 / ping->png_sample_rate;
-
-		/* get beam angle size */
-		if (store->sonar == MBSYS_SIMRAD3_EM1000)
-		    {
-		    beamwidth = 2.5;
-		    }
-		else if (ping->png_tx > 0)
-		    {
-		    beamwidth = 0.1 * ping->png_tx;
-		    }
-		else if (store->run_tran_beam > 0)
-		    {
-		    beamwidth = 0.1 * store->run_tran_beam;
-		    }
-
-		/* get median depth */
-		nbathsort = 0;
-		for (i=0;i<ping->png_nbeams;i++)
-		    {
-		    if (mb_beam_ok(ping->png_beamflag[i]))
-			{
-			bathsort[nbathsort] = ping->png_depth[i] + depthoffset;
-			nbathsort++;
-			}
-		    }
-
-		/* get sidescan pixel size */
-		if (swath_width_set == MB_NO)
-		    {
-		    if (store->run_swath_angle > 0)
-			*swath_width = (double)store->run_swath_angle;
-		    else
-			*swath_width = 2.5 + MAX(90.0 - ping->png_depression[0],
-						90.0 - ping->png_depression[ping->png_nbeams-1]);
-		    }
-		if (pixel_size_set == MB_NO
-		    && nbathsort > 0)
-		    {
-		    qsort((char *)bathsort, nbathsort, sizeof(double),(void *)mb_double_compare);
-		    pixel_size_calc = 2 * tan(DTR * (*swath_width)) * bathsort[nbathsort/2]
-					/ MBSYS_SIMRAD3_MAXPIXELS;
-		    if (store->run_max_swath > 0)
-			{
-			pixel_size_max_swath = 2 * ((double) store->run_max_swath) / ((double)MBSYS_SIMRAD3_MAXPIXELS);
-			if (pixel_size_max_swath < pixel_size_calc)
-			    pixel_size_calc = pixel_size_max_swath;
-			}
-		    pixel_size_calc = MAX(pixel_size_calc, bathsort[nbathsort/2] * sin(DTR * 0.1));
-		    if ((*pixel_size) <= 0.0)
-			(*pixel_size) = pixel_size_calc;
-		    else if (0.95 * (*pixel_size) > pixel_size_calc)
-			(*pixel_size) = 0.95 * (*pixel_size);
-		    else if (1.05 * (*pixel_size) < pixel_size_calc)
-			(*pixel_size) = 1.05 * (*pixel_size);
-		    else
-			(*pixel_size) = pixel_size_calc;
-		    }
-		/* get pixel interpolation */
-		pixel_int_use = pixel_int + 1;
-
-		/* check that sidescan can be used */
-		/* get times of bath and sidescan records */
-		time_i[0] = ping->png_date / 10000;
-		time_i[1] = (ping->png_date % 10000) / 100;
-		time_i[2] = ping->png_date % 100;
-		time_i[3] = ping->png_msec / 3600000;
-		time_i[4] = (ping->png_msec % 3600000) / 60000;
-		time_i[5] = (ping->png_msec % 60000) / 1000;
-		time_i[6] = (ping->png_msec % 1000) * 1000;
-		mb_get_time(verbose, time_i, &bath_time_d);
-		time_i[0] = ping->png_ss_date / 10000;
-		time_i[1] = (ping->png_ss_date % 10000) / 100;
-		time_i[2] = ping->png_ss_date % 100;
-		time_i[3] = ping->png_ss_msec / 3600000;
-		time_i[4] = (ping->png_ss_msec % 3600000) / 60000;
-		time_i[5] = (ping->png_ss_msec % 60000) / 1000;
-		time_i[6] = (ping->png_ss_msec % 1000) * 1000;
-		mb_get_time(verbose, time_i, &ss_time_d);
-		ss_ok = MB_YES;
-		if (ping->png_nbeams < ping->png_nbeams_ss
-		    || ping->png_nbeams > ping->png_nbeams_ss + 1)
-		    {
-		    ss_ok = MB_NO;
-		    if (verbose > 0)
-			    fprintf(stderr,"%s: %4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d Sidescan ignored: num bath beams != num ss beams: %d %d\n",
-				    function_name, time_i[0], time_i[1], time_i[2],
-				    time_i[3], time_i[4], time_i[5], time_i[6],
-				    ping->png_nbeams, ping->png_nbeams_ss);
-		    }
-/*fprintf(stderr,"%s: %4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d   bathbeams:%d   ssbeams:%d\n",
-function_name, time_i[0], time_i[1], time_i[2],
-time_i[3], time_i[4], time_i[5], time_i[6],
-ping->png_nbeams, ping->png_nbeams_ss);*/
-
-		/* loop over raw sidescan, putting each raw pixel into
-			the binning arrays */
-		if (ss_ok == MB_YES)
-		for (i=0;i<ping->png_nbeams_ss;i++)
-			{
-			beam_ss = &ping->png_ssraw[ping->png_start_sample[i]];
-			if (mb_beam_ok(ping->png_beamflag[i]))
-			    {
-			    if (ping->png_beam_samples[i] > 0)
-				{
-				range = sqrt(ping->png_depth[i] * ping->png_depth[i]
-						+ ping->png_acrosstrack[i] * ping->png_acrosstrack[i]);
-				angle = 90.0 - ping->png_depression[i];
-				beam_foot = range * sin(DTR * beamwidth)
-							/ cos(DTR * angle);
-				sint = fabs(sin(DTR * angle));
-				if (sint < ping->png_beam_samples[i] * ss_spacing / beam_foot)
-				    ss_spacing_use = beam_foot / ping->png_beam_samples[i];
-				else
-				    ss_spacing_use = ss_spacing / sint;
-/* fprintf(stderr, "spacing: %f %f n:%d sint:%f beamwidth:%f angle:%f range:%f foot:%f factor:%f\n",
-ss_spacing, ss_spacing_use,
-ping->png_beam_samples[i], sint, beamwidth, angle, range, beam_foot,
-ping->png_beam_samples[i] * ss_spacing / beam_foot);*/
-				}
-			    for (k=0;k<ping->png_beam_samples[i];k++)
-				{
-				if (beam_ss[k] != EM3_INVALID_AMP)
-					{
-					xtrackss = ping->png_acrosstrack[i]
-						    + ss_spacing_use * (k - ping->png_center_sample[i]);
-					kk = MBSYS_SIMRAD3_MAXPIXELS / 2 + (int)(xtrackss / (*pixel_size));
-					if (kk > 0 && kk < MBSYS_SIMRAD3_MAXPIXELS)
-					    {
-					    ss[kk]  += reflscale*((double)beam_ss[k]);
-					    ssalongtrack[kk] += ping->png_alongtrack[i];
-					    ss_cnt[kk]++;
-					    }
-					}
-				}
-			    }
-			}
-
-		/* average the sidescan */
-		first = MBSYS_SIMRAD3_MAXPIXELS;
-		last = -1;
-		for (k=0;k<MBSYS_SIMRAD3_MAXPIXELS;k++)
-			{
-			if (ss_cnt[k] > 0)
-				{
-				ss[k] /= ss_cnt[k];
-				ssalongtrack[k] /= ss_cnt[k];
-				ssacrosstrack[k]
-					= (k - MBSYS_SIMRAD3_MAXPIXELS / 2)
-						* (*pixel_size);
-				first = MIN(first, k);
-				last = k;
-				}
-			else
-				ss[k] = MB_SIDESCAN_NULL;
-			}
-
-		/* interpolate the sidescan */
-		k1 = first;
-		k2 = first;
-		for (k=first+1;k<last;k++)
-		    {
-		    if (ss_cnt[k] <= 0)
-			{
-			if (k2 <= k)
-			    {
-			    k2 = k+1;
-			    while (ss_cnt[k2] <= 0 && k2 < last)
-				k2++;
-			    }
-			if (k2 - k1 <= pixel_int_use)
-			    {
-			    ss[k] = ss[k1]
-				+ (ss[k2] - ss[k1])
-				    * ((double)(k - k1)) / ((double)(k2 - k1));
-			    ssacrosstrack[k]
-				    = (k - MBSYS_SIMRAD3_MAXPIXELS / 2)
-					    * (*pixel_size);
-			    ssalongtrack[k] = ssalongtrack[k1]
-				+ (ssalongtrack[k2] - ssalongtrack[k1])
-				    * ((double)(k - k1)) / ((double)(k2 - k1));
-			    }
-			}
-		    else
-			{
-			k1 = k;
-			}
-		    }
-
-		/* insert the new sidescan into store */
-		ping->png_pixel_size = *pixel_size;
-		if (last > first)
-		    ping->png_pixels_ss = MBSYS_SIMRAD3_MAXPIXELS;
-		else
-		    ping->png_pixels_ss = 0;
-		for (i=0;i<MBSYS_SIMRAD3_MAXPIXELS;i++)
-		    {
-		    if (ss[i] > MB_SIDESCAN_NULL)
-		    	{
-		    	ping->png_ss[i] = (short)(100 * ss[i]);
-		    	ping->png_ssalongtrack[i] = (short)(100 * ssalongtrack[i]);
-			}
-		    else
-		    	{
-		    	ping->png_ss[i] = EM3_INVALID_SS;
-		    	ping->png_ssalongtrack[i] = 0;
-			}
-		    }
-
-		/* print debug statements */
-		if (verbose >= 2)
-			{
-			fprintf(stderr,"\ndbg2  Sidescan regenerated in <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg2       png_nbeams_ss: %d\n",
-				ping->png_nbeams_ss);
-			for (i=0;i<ping->png_nbeams_ss;i++)
-			  fprintf(stderr,"dbg2       beam:%d  flag:%3d  bath:%f  amp:%d  acrosstrack:%f  alongtrack:%f\n",
-				i,
-				ping->png_beamflag[i],
-				ping->png_depth[i],
-				ping->png_amp[i],
-				ping->png_acrosstrack[i],
-				ping->png_alongtrack[i]);
-			fprintf(stderr,"dbg2       pixels_ss:  %d\n",
-				MBSYS_SIMRAD3_MAXPIXELS);
-			for (i=0;i<MBSYS_SIMRAD3_MAXPIXELS;i++)
-			  fprintf(stderr,"dbg2       pixel:%4d  cnt:%3d  ss:%10f  xtrack:%10f  ltrack:%10f\n",
-				i,ss_cnt[i],ss[i],
-				ssacrosstrack[i],
-				ssalongtrack[i]);
-			fprintf(stderr,"dbg2       pixels_ss:  %d\n",
-				ping->png_pixels_ss);
-			for (i=0;i<MBSYS_SIMRAD3_MAXPIXELS;i++)
-			  fprintf(stderr,"dbg2       pixel:%4d  ss:%8d  ltrack:%8d\n",
-				i,ping->png_ss[i],ping->png_ssalongtrack[i]);
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       pixel_size:      %f\n",*pixel_size);
-		fprintf(stderr,"dbg2       swath_width:     %f\n",*swath_width);
-		fprintf(stderr,"dbg2       error:           %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:          %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mbsys_simrad3.h b/src/mbio/mbsys_simrad3.h
deleted file mode 100644
index 37b64ac..0000000
--- a/src/mbio/mbsys_simrad3.h
+++ /dev/null
@@ -1,1473 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbsys_simrad3.h	2/22/2008
- *	$Id: mbsys_simrad3.h 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 2008-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbsys_simrad3.h defines the MBIO data structures for handling data from
- * new (post-2006) Kongsberg multibeam sonars (e.g. EM710, EM3002, EM302, EM122).
- * The data formats associated with Kongsberg multibeams
- * (both old and new) include:
- *    MBSYS_SIMRAD formats (code in mbsys_simrad.c and mbsys_simrad.h):
- *      MBF_EMOLDRAW : MBIO ID 51 - Vendor EM1000, EM12S, EM12D, EM121
- *                   : MBIO ID 52 - aliased to 51
- *      MBF_EM12IFRM : MBIO ID 53 - IFREMER EM12S and EM12D
- *      MBF_EM12DARW : MBIO ID 54 - NERC EM12S
- *                   : MBIO ID 55 - aliased to 51
- *    MBSYS_SIMRAD3 formats (code in mbsys_simrad2.c and mbsys_simrad2.h):
- *      MBF_EM300RAW : MBIO ID 56 - Vendor EM3000, EM300, EM120
- *      MBF_EM300MBA : MBIO ID 57 - MBARI EM3000, EM300, EM120 for processing
- *    MBSYS_SIMRAD3 formats (code in mbsys_simrad3.c and mbsys_simrad3.h):
- *      MBF_EM710RAW : MBIO ID 58 - Vendor EM710
- *      MBF_EM710MBA : MBIO ID 59 - MBARI EM710 for processing
- *
- *
- * Author:	D. W. Caress (L-DEO)
- * Date:	February 22, 2008
- *
- * $Log: mbsys_simrad3.h,v $
- * Revision 5.2  2009/03/02 18:51:52  caress
- * Fixed problems with formats 58 and 59, and also updated copyright dates in several source files.
- *
- * Revision 5.1  2008/07/10 06:40:34  caress
- * Fixed support for EM122
- *
- * Revision 5.0  2008/03/01 09:11:35  caress
- * Added support for Simrad EM710 multibeam in new formats 58 and 59.
- *
- *
- */
-/*
- * Notes on the MBSYS_SIMRAD3 data structure:
- *   0. Kongsberg was formerly known as Simrad; the names Kongsberg
- *      and Simrad are interchangeable within MB-System source code
- *      and documentation.
- *   1. Kongsberg multibeam systems output datagrams which are
- *      a combination of ascii and binary. This code has been written
- *      using data format specifications found in Kongsberg document
- *	16092ai EM Series Data Formats (rev I January 20, 2006
- *	through Rev Q February 2013).
- *   2. Kongsberg multibeam sonars output both bathymetry
- *      and amplitude information for beams and sidescan information
- *      with a higher resolution than the bathymetry and amplitude.
- *   3. This code and formats 58 and 59 support data from the
- *         EM-710 multibeam sonar and later models. Data from older
- *         Kongsberg multibeams are supported by formats 51, 56, and 57.
- *   4. Each telegram is preceded by a two byte start code 0x02 and
- *      followed by a three byte end code consisting of 0x03
- *      followed by two bytes representing the checksum for
- *      the data bytes.  MB-System does not check the checksums
- *      on input, but does calculate the checksums for output.
- *   5. The Kongsberg datagram format manual lists a large number
- *      of datagram types. The complete list of telegram start codes,
- *      types, and sizes is given below. Datagram listings preceded
- *      by an "*" are recognized by MB-System. Unrecognized datagrams
- *      will be skipped on input and not included in output files.
- *
- *      Multibeam Datagrams:
- *        *0x0244: Bathymetry                             48-4092 bytes
- *        *0x0258: Bathymetry  (EM710 and later)          variable size
- *         0x024B: Central beams echogram                 variable size
- *        *0x0265: Raw range and beam angle (deprecated)  112-1658 bytes
- *        *0x0246: Raw range and beam angle "F"           24-2056 bytes
- *        *0x0266: Raw range and beam angle "f"           44-1658 bytes
- *        *0x024E: Raw range and beam angle "N" (EM710 and later) variable size
- *        *0x0253: Sidescan                               48->5K bytes
- *        *0x0259: Sidescan (EM710 and later)             variable size
- *        *0x026B: Water column                           variable size
- *        *0x024F: Quality factor                         variable size
- *        *0x02E1: Bathymetry (MBARI format 57)           48-4092 bytes
- *        *0x02E2: Sidescan (MBARI format 57)             48->5K bytes
- *        *0x02E3: Bathymetry (MBARI format 59)           48-4092 bytes
- *        *0x02E4: Sidescan (MBARI format 59)             48->5K bytes
- *        *0x02E5: Bathymetry (MBARI format 59)           48-4092 bytes
- *
- *      External Sensor Datagrams
- *        *0x0241: Attitude Output                        1222 bytes
- *        *0x026E: Network attitude                       variable size
- *        *0x0243: Clock Output                           28 bytes
- *        *0x0268: Height Output                          24 bytes
- *        *0x0248: Heading Output                         422 bytes
- *        *0x0250: Position                               100-134 bytes
- *         0x0245: Single beam echosounder depth          32 bytes
- *        *0x0254: Tide Output                            30 bytes
- *         0x0273: Surface sound speed (deprecated)       variable size
- *        *0x0247: Surface sound speed                    variable size
- *        *0x0256: Sound velocity profile (deprecated)    variable size
- *        *0x0255: Sound velocity profile                 variable size
- *         0x0257: SSP input                              variable size
- *
- *      Multibeam Parameters
- *        *0x0249: Parameter - Start                      variable size
- *        *0x0269: Parameter - Stop                       variable size
- *         0x0270: Parameter - Remote                     variable size
- *        *0x0252: Runtime Parameter                      52 bytes
- *        *0x024A: Mechanical transducer tilt             variable size
- *        *0x0233: Extra Parameter                        variable size
- *        *0x0230: Processing Unit ID                     108 bytes
- *        *0x0231: Processing Unit Status                 85 bytes
- *        *0x0232: Processing Unit BIST                   variable size
- *   
- *   6. Kongsberg systems record navigation fixes using the position
- *      datagram; no navigation is included in the per ping data.  Thus,
- *      it is necessary to extrapolate the navigation for each ping
- *      at read time from the last navigation fix.  The frequency of
- *      GPS fixes generally assures that this is not a problem, but
- *      we offer no guarentees that this will always be the case.
- *      In this format the navigation fix datagrams include copies of
- *      the ASCII data records (typically NMEA 0183) input into the
- *      sonar by the navigation system.
- *   7. The beam depths are give relative to the transmit transducer
- *      or sonar head depth and the horizontal location of the active
- *      positioning system's antenna (or reference point). Heave,
- *      roll, pitch, sound speed at the transducer depth and ray
- *      bending have been applied.
- *   8. The new Kongsberg sonars record the heading and attitude sensor
- *      data streams input into the sonar, usually at a sampling
- *      frequency of 100 Hz.
-\*   9. The beam angles and travel times are reported in the raw range
- *      and angle datagrams. The raw times and angles are recorded
- *      without correction for the vessel motion. The raw ranges are
- *      given as two-way travel times.
- *  10. The sidescan is structured in terms of a certain number of samples
- *      per beam. The range sampling rate for the sidescan is the same as
- *      that specified in the depth datagram and the ranges in the sidescan
- *      datagram (seabed image datagram) are all two way travel times.
- *  11. The attitude data is output asynchronously with respect to the
- *      ping output datagrams. Typical motion sensors give data at a 100 Hz
- *      rate. The attitude datagrams are given when the number of measurements
- *      is 100, or usually at 1 second intervals. The attitude data timing
- *      is corrected for the sensor time delay entered by the operator. If
- *      roll is input with respect to the horizontal, then the sonar
- *      recalculates the roll so that the output values are in the plane
- *      defined by the heading and pitch axis. The entered sensor offsets
- *      (roll bias, pitch bias, heading bias). Extra heave at the transducer
- *      due to roll and pitch when the sensor does not give its data at the
- *      transducer position is also included and heave is positive downwards.
- *      The sensor status is copied from the input datagram's two sync bytes
- *      with the second byte always set to 0x90. The first byte is either
- *      zero or in the 0x90-0xAF range. If the latter is true, then 0x90
- *      indicates valid data with full accuracy, 0x91-0x99 indicates valid
- *      data with gradually reduced accuracy, 0x9A-0x9F indicates invalid data
- *      from an operating sensor,  and 0xA0-0xAF indicates invalid data
- *      from a faulty sensor. This interpretation may be dependent on the
- *      attitude sensor type.
- *  12. The heading data is output asynchronously with respect to the
- *      ping output datagrams. Typical heading sensors give data at a 10 Hz
- *      rate. The attitude datagrams are given when the number of measurements
- *      is 100, or usually at 10 second intervals. The heading data is
- *      corrected for the heading offset entered by the operator.
- *  13. The raw vendor format (format 58) does not support flagging of bathymetry
- *      values nor does it store navigation in the bathymetry data records.
- *      MB-System also supports a processing format (59) which includes
- *      beamflags and navigation in the bathymetry records. This format
- *      is identical to the vendor format except for the use of a
- *      slightly different bathymetry record.
- *  14. The EM2040D outputs two simultaneous sets of datagrams for each
- *      receive head with the same ping number. The data can be distinguished
- *      only by the sonar serial number in each record.
- *
- */
-
-/* include mb_define.h */
-#ifndef MB_DEFINE_DEF
-#include "mb_define.h"
-#endif
-
-/* sonar models */
-#define	MBSYS_SIMRAD3_UNKNOWN	0
-
-#define	MBSYS_SIMRAD3_M3	 30
-
-#define	MBSYS_SIMRAD3_EM2045	 2045
-#define	MBSYS_SIMRAD3_EM2040	 2040
-#define	MBSYS_SIMRAD3_EM710	 710
-#define	MBSYS_SIMRAD3_EM302	 302
-#define	MBSYS_SIMRAD3_EM122	 122
-
-#define	MBSYS_SIMRAD3_EM120	120
-#define	MBSYS_SIMRAD3_EM300	300
-#define	MBSYS_SIMRAD3_EM1002	1002
-#define	MBSYS_SIMRAD3_EM2000	2000
-#define	MBSYS_SIMRAD3_EM3000	3000
-#define	MBSYS_SIMRAD3_EM3000D_1	3001
-#define	MBSYS_SIMRAD3_EM3000D_2	3002
-#define	MBSYS_SIMRAD3_EM3000D_3	3003
-#define	MBSYS_SIMRAD3_EM3000D_4	3004
-#define	MBSYS_SIMRAD3_EM3000D_5	3005
-#define	MBSYS_SIMRAD3_EM3000D_6	3006
-#define	MBSYS_SIMRAD3_EM3000D_7	3007
-#define	MBSYS_SIMRAD3_EM3000D_8	3008
-#define	MBSYS_SIMRAD3_EM3002	3020
-
-#define	MBSYS_SIMRAD3_EM12S	9901
-#define	MBSYS_SIMRAD3_EM12D	9902
-#define	MBSYS_SIMRAD3_EM121	9903
-#define	MBSYS_SIMRAD3_EM100	9904
-#define	MBSYS_SIMRAD3_EM1000	9905
-
-/* number of ping structures available to store data */
-#define	MBSYS_SIMRAD3_NUM_PING_STRUCTURES 4
-
-/* ping structure read status */
-#define	MBSYS_SIMRAD3_PING_NO_DATA      0
-#define	MBSYS_SIMRAD3_PING_PARTIAL      1
-#define	MBSYS_SIMRAD3_PING_COMPLETE     2
-
-/* maximum number of beams and pixels */
-#define	MBSYS_SIMRAD3_MAXBEAMS		512
-#define	MBSYS_SIMRAD3_MAXPIXELS		1024
-#define	MBSYS_SIMRAD3_MAXRAWPIXELS	65535
-#define MBSYS_SIMRAD3_MAXTX		19
-#define MBSYS_SIMRAD3_MAXQUALITYPARAMETERS  3
-#define	MBSYS_SIMRAD3_MAXSVP		1024
-#define	MBSYS_SIMRAD3_MAXATTITUDE	256
-#define	MBSYS_SIMRAD3_MAXHEADING	256
-#define	MBSYS_SIMRAD3_MAXSSV		256
-#define	MBSYS_SIMRAD3_MAXTILT		256
-#define	MBSYS_SIMRAD3_COMMENT_LENGTH	256
-#define	MBSYS_SIMRAD3_BUFFER_SIZE	2048
-#define	MBSYS_SIMRAD3_MAXQUALITYFACTORS 4
-
-/* datagram start and end byte */
-#define	EM3_START_BYTE		0x02
-#define	EM3_END_BYTE		0x03
-#define	EM3_END			0x03
-
-/* datagram types including start byte */
-#define	EM3_NONE		0
-#define	EM3_PU_ID		0x0230
-#define	EM3_PU_STATUS		0x0231
-#define	EM3_PU_BIST		0x0232
-#define	EM3_EXTRAPARAMETERS	0x0233
-#define	EM3_ATTITUDE		0x0241
-#define	EM3_CLOCK		0x0243
-#define	EM3_BATH		0x0244
-#define	EM3_SBDEPTH		0x0245
-#define	EM3_RAWBEAM		0x0246
-#define	EM3_SSV			0x0247
-#define	EM3_HEADING		0x0248
-#define	EM3_START		0x0249
-#define	EM3_TILT		0x024A
-#define	EM3_CBECHO		0x024B
-#define	EM3_RAWBEAM4		0x024E
-#define	EM3_QUALITY		0x024F
-#define	EM3_POS			0x0250
-#define	EM3_RUN_PARAMETER	0x0252
-#define	EM3_SS			0x0253
-#define	EM3_TIDE		0x0254
-#define	EM3_SVP2		0x0255
-#define	EM3_SVP			0x0256
-#define	EM3_SSPINPUT		0x0257
-#define	EM3_BATH2		0x0258
-#define	EM3_SS2			0x0259
-#define	EM3_RAWBEAM2		0x0265
-#define	EM3_RAWBEAM3		0x0266
-#define	EM3_HEIGHT		0x0268
-#define	EM3_STOP		0x0269
-#define	EM3_WATERCOLUMN		0x026B
-#define	EM3_NETATTITUDE		0x026E
-#define	EM3_REMOTE		0x0270
-#define	EM3_SSP			0x0273
-#define	EM3_BATH_MBA		0x02E1
-#define	EM3_SS_MBA		0x02E2
-#define	EM3_BATH2_MBA		0x02E3
-#define	EM3_SS2_MBA		0x02E4
-#define	EM3_BATH3_MBA		0x02E5
-
-/* datagram types */
-#define	EM3_ID_PU_ID		0x30
-#define	EM3_ID_PU_STATUS	0x31
-#define	EM3_ID_PU_BIST		0x32
-#define	EM3_ID_EXTRAPARAMETERS	0x33
-#define	EM3_ID_ATTITUDE		0x41
-#define	EM3_ID_CLOCK		0x43
-#define	EM3_ID_BATH		0x44
-#define	EM3_ID_SBDEPTH		0x45
-#define	EM3_ID_RAWBEAM		0x46
-#define	EM3_ID_SSV		0x47
-#define	EM3_ID_HEADING		0x48
-#define	EM3_ID_START		0x49
-#define	EM3_ID_TILT		0x4A
-#define	EM3_ID_CBECHO		0x4B
-#define	EM3_ID_RAWBEAM4		0x4E
-#define	EM3_ID_QUALITY		0x4F
-#define	EM3_ID_POS		0x50
-#define	EM3_ID_RUN_PARAMETER	0x52
-#define	EM3_ID_SS		0x53
-#define	EM3_ID_TIDE		0x54
-#define	EM3_ID_SVP2		0x55
-#define	EM3_ID_SVP		0x56
-#define	EM3_ID_SSPINPUT		0x57
-#define	EM3_ID_BATH2		0x58
-#define	EM3_ID_SS2		0x59
-#define	EM3_ID_RAWBEAM2		0x65
-#define	EM3_ID_RAWBEAM3		0x66
-#define	EM3_ID_HEIGHT		0x68
-#define	EM3_ID_STOP		0x69
-#define	EM3_ID_WATERCOLUMN	0x6B
-#define	EM3_ID_NETATTITUDE	0x6E
-#define	EM3_ID_REMOTE		0x70
-#define	EM3_ID_SSP		0x73
-#define	EM3_ID_BATH_MBA		0xE1
-#define	EM3_ID_SS_MBA		0xE2
-#define	EM3_ID_BATH2_MBA	0xE3
-#define	EM3_ID_SS2_MBA		0xE4
-#define	EM3_ID_BATH3_MBA	0xE5
-
-/* datagram sizes where constant */
-#define	EM3_PU_STATUS_SIZE		88
-#define	EM3_EXTRAPARAMETERS_HEADER_SIZE	14
-#define	EM3_RUN_PARAMETER_SIZE		52
-#define	EM3_CLOCK_SIZE			28
-#define	EM3_TIDE_SIZE			30
-#define	EM3_HEIGHT_SIZE			24
-#define	EM3_START_HEADER_SIZE		14
-#define	EM3_HEADING_HEADER_SIZE		14
-#define	EM3_HEADING_SLICE_SIZE		4
-#define	EM3_SSV_HEADER_SIZE		14
-#define	EM3_SSV_SLICE_SIZE		4
-#define	EM3_TILT_HEADER_SIZE		14
-#define	EM3_TILT_SLICE_SIZE		4
-#define	EM3_ATTITUDE_HEADER_SIZE	14
-#define	EM3_ATTITUDE_SLICE_SIZE		12
-#define	EM3_POS_HEADER_SIZE		30
-#define	EM3_SVP_HEADER_SIZE		24
-#define	EM3_SVP_SLICE_SIZE		4
-#define	EM3_SVP2_HEADER_SIZE		24
-#define	EM3_SVP2_SLICE_SIZE		8
-#define	EM3_BATH_HEADER_SIZE		24
-#define	EM3_BATH_BEAM_SIZE		16
-#define	EM3_BATH_MBA_HEADER_SIZE	34
-#define	EM3_BATH_MBA_BEAM_SIZE		18
-#define	EM3_BATH2_HEADER_SIZE		32
-#define	EM3_BATH2_BEAM_SIZE		20
-#define	EM3_BATH2_MBA_HEADER_SIZE	48
-#define	EM3_BATH2_MBA_BEAM_SIZE		34
-#define	EM3_RAWBEAM4_HEADER_SIZE	28
-#define	EM3_RAWBEAM4_TX_SIZE		24
-#define	EM3_RAWBEAM4_BEAM_SIZE		16
-#define	EM3_QUALITY_HEADER_SIZE	        16
-#define	EM3_BATH3_MBA_HEADER_SIZE	48
-#define	EM3_BATH3_MBA_BEAM_SIZE		38
-#define	EM3_SS2_HEADER_SIZE		28
-#define	EM3_SS2_BEAM_SIZE		6
-#define	EM3_SS2_MBA_HEADER_SIZE		36
-#define	EM3_SS2_MBA_BEAM_SIZE		6
-#define	EM3_NETATTITUDE_HEADER_SIZE	16
-#define	EM3_NETATTITUDE_SLICE_SIZE	11
-#define	EM3_WC_HEADER_SIZE		36
-#define	EM3_WC_TX_SIZE			6
-#define	EM3_WC_BEAM_SIZE		10
-
-/* invalid value flags */
-#define	EM3_INVALID_AMP			0x7F
-#define	EM3_INVALID_SS			0x7FFF
-#define	EM3_INVALID_CHAR		0xFF
-#define	EM3_INVALID_SHORT		0xFFFF
-#define EM3_INVALID_U_INT		0xFFFFFFFF
-#define EM3_INVALID_INT			0x7FFFFFFF
-
-/* internal data structure for survey data */
-struct mbsys_simrad3_ping_struct
-	{
-        int     read_status;    /* read status for this structure:
-                                    0: no data records read
-                                    1: one or more data records read
-                                    2: ping complete */
-        int     count;          /* ping number of this ping */
-        int     serial;         /* sonar serial number of this ping */
-        
-	int	png_bath_read;	/* flag indicating actual reading of bathymetry record */
-	int	png_date;	/* date = year*10000 + month*100 + day
-				    Feb 26, 1995 = 19950226 */
-	int	png_msec;	/* time since midnight in msec
-				    08:12:51.234 = 29570234 */
-	int	png_count;	/* sequential counter or input identifier */
-	int	png_serial;	/* system 1 or system 2 serial number */
-	int	png_latitude;	/* latitude in decimal degrees * 20000000
-				    (negative in southern hemisphere)
-				    if valid, invalid = 0x7FFFFFFF */
-	int	png_longitude;	/* longitude in decimal degrees * 10000000
-				    (negative in western hemisphere)
-				    if valid, invalid = 0x7FFFFFFF */
-	int	png_heading;	/* heading (0.01 deg) */
-	int	png_heave;	/* heave from interpolation (0.01 m) */
-	int	png_roll;	/* roll from interpolation (0.01 deg) */
-	int	png_pitch;	/* pitch from interpolation (0.01 deg) */
-	int	png_speed;	/* speed over ground (cm/sec) if valid,
-				    invalid = 0xFFFF */
-	int	png_ssv;	/* sound speed at transducer (0.1 m/sec) */
-	float	png_xducer_depth;
-				/* transmit transducer depth (m)
-					The transmit transducer depth should be
-					added to the beam depths to derive the
-					depths re the water line. Note that the
-					transducer depth will be negative if the
-					actual heave is large enough to bring the
-					transmit transducer above the water line.
-					This may represent a valid situation, but
-					may also be due to an erroneously set
-					installation depth of either the transducer
-					or the water line. */
-
-	int	png_nbeams;	        /* maximum number of beams possible */
-	int	png_nbeams_valid;	/* number of valid beams */
-	float	png_sample_rate;        /* sampling rate (Hz) */
-	int	png_spare;              /* spare */
-	float	png_depth[MBSYS_SIMRAD3_MAXBEAMS];
-                                        /* depths relative to sonar (m)
-					The beam data are given re the transmit
-					transducer or sonar head depth and the
-					horizontal location (x,y) of the active
-					positioning system�s reference point.
-					Heave, roll, pitch, sound speed at the
-					transducer depth and ray bending through
-					the water column have been applied. */
-	float	png_acrosstrack[MBSYS_SIMRAD3_MAXBEAMS];
-				/* acrosstrack distances (m) */
-	float	png_alongtrack[MBSYS_SIMRAD3_MAXBEAMS];
-				/* alongtrack distances (m) */
-	int	png_window[MBSYS_SIMRAD3_MAXBEAMS];
-				/* samples */
-	int	png_quality[MBSYS_SIMRAD3_MAXBEAMS];
-				/* 0-254 Scaled standard deviation (sd) of the
-					range detection divided by
-					the detected range (dr):
-					Quality factor = 250*sd/dr. */
-	int	png_iba[MBSYS_SIMRAD3_MAXBEAMS];
-				/* beam incidence angle adjustment (IBA) (0.1 deg)
-					Due to raybending, the beam incidence angle at the bottom hit
-					will usually differ from the beam launch angle at the transducer
-					and also from the angle given by a straight line between the
-					transducer and the bottom hit. The difference from the latter is
-					given by the beam incidence angle adjustment (IBA). The beam
-					incidence angle re the horizontal, corrected for the ray bending,
-					can be calculated as follows:
-						BAC = atan( z / abs(y) ) + IBA.
-					BAC is positive downwards and IBA will be positive when the
-					beam is bending towards the bottom. This parameter can be
-					helpful for correcting seabed imagery data and in seabed
-					classification. */
-	int	png_detection[MBSYS_SIMRAD3_MAXBEAMS];
-				/* Detection info:
-				   This datagram may contain data for beams with and without a
-				   valid detection. Eight bits (0-7) gives details about the detection:
-					A) If the most significant bit (bit7) is zero, this beam has a valid
-						detection. Bit 0-3 is used to specify how the range for this beam
-						is calculated
-						0: Amplitude detect
-						1: Phase detect
-						2-15: Future use
-					B) If the most significant bit is 1, this beam has an invalid
-						detection. Bit 4-6 is used to specify how the range (and x,y,z
-						parameters) for this beam is calculated
-						0: Normal detection
-						1: Interpolated or extrapolated from neighbour detections
-						2: Estimated
-						3: Rejected candidate
-						4: No detection data is available for this beam (all parameters
-							are set to zero)
-						5-7: Future use
-					The invalid range has been used to fill in amplitude samples in
-					the seabed image datagram. */
-	int	png_clean[MBSYS_SIMRAD3_MAXBEAMS];
-				/* realtime cleaning info:
-					For future use. A real time data cleaning module may flag out
-					beams. Bit 7 will be set to 1 if the beam is flagged out. Bit 0-6
-					will contain a code telling why the beam is flagged out. */
-	int	png_amp[MBSYS_SIMRAD3_MAXBEAMS];
-				/* 0.5 dB */
-	char	png_beamflag[MBSYS_SIMRAD3_MAXBEAMS];
-				/* uses standard MB-System beamflags */
-	float	png_depression[MBSYS_SIMRAD3_MAXBEAMS];
-				/* beam depression angles (deg) */
-	float	png_azimuth[MBSYS_SIMRAD3_MAXBEAMS];
-				/* beam azimuth angles (deg) */
-	float	png_range[MBSYS_SIMRAD3_MAXBEAMS];
-				/* Two-way travel times (sec). */
-	float	png_bheave[MBSYS_SIMRAD3_MAXBEAMS];
-				/* Heave correction to the sonar depth for each beam - this is half the difference
-				   between the sonar depth at ping time and the sonar depth at receive time,
-				   as measured by heave  */
-
-	/* raw travel time and angle data version 4 */
-	int	png_raw_read;	/* flag indicating actual reading of raw beam record */
-	int	png_raw_date;	/* date = year*10000 + month*100 + day
-				    Feb 26, 1995 = 19950226 */
-	int	png_raw_msec;	/* time since midnight in msec
-				    08:12:51.234 = 29570234 */
-	int	png_raw_count;	/* sequential counter or input identifier */
-	int	png_raw_serial;	/* system 1 or system 2 serial number */
-	int	png_raw_ssv;		/* sound speed at transducer (0.1 m/sec) */
-	int	png_raw_ntx;		/* number of TX pulses (1 to 9) */
-	int	png_raw_nbeams;		/* number of raw travel times and angles
-					    - nonzero only if raw beam record read */
-	int	png_raw_detections;	/* number of valid detections */
-	float	png_raw_sample_rate;	/* sampling rate (Hz) */
-	int	png_raw_spare;
-	int	png_raw_txtiltangle[MBSYS_SIMRAD3_MAXTX];/* tilt angle (0.01 deg) */
-	int	png_raw_txfocus[MBSYS_SIMRAD3_MAXTX];   /* focus range (0.1 m)
-								0 = no focus */
-	float	png_raw_txsignallength[MBSYS_SIMRAD3_MAXTX];	/* signal length (sec) */
-	float	png_raw_txoffset[MBSYS_SIMRAD3_MAXTX];	/* transmit time offset (sec) */
-	float	png_raw_txcenter[MBSYS_SIMRAD3_MAXTX];	/* center frequency (Hz) */
-	int	png_raw_txabsorption[MBSYS_SIMRAD3_MAXTX];	/* mean absorption coeff. (0.01 dB/km) */
-
-	int	png_raw_txwaveform[MBSYS_SIMRAD3_MAXTX];	/* signal waveform identifier
-									0 = CW, 1 = FM upsweep, 2 = FM downsweep */
-	int	png_raw_txsector[MBSYS_SIMRAD3_MAXTX];	/* transmit sector number (0-19) */
-	float	png_raw_txbandwidth[MBSYS_SIMRAD3_MAXTX];	/* bandwidth (Hz) */
-
-	int	png_raw_rxpointangle[MBSYS_SIMRAD3_MAXBEAMS];
-				/* Raw beam pointing angles in 0.01 degree,
-					positive to port.
-					These values are relative to the transducer
-					array and have not been corrected
-					for vessel motion. */
-	int	png_raw_rxsector[MBSYS_SIMRAD3_MAXBEAMS];	/* transmit sector number (0-19) */
-	int	png_raw_rxdetection[MBSYS_SIMRAD3_MAXBEAMS]; /* Detection info:
-							   This datagram may contain data for beams with and without a
-							   valid detection. Eight bits (0-7) gives details about the detection:
-								A) If the most significant bit (bit7) is zero, this beam has a valid
-									detection. Bit 0-3 is used to specify how the range for this beam
-									is calculated
-									0: Amplitude detect
-									1: Phase detect
-									2-15: Future use
-								B) If the most significant bit is 1, this beam has an invalid
-									detection. Bit 4-6 is used to specify how the range (and x,y,z
-									parameters) for this beam is calculated
-									0: Normal detection
-									1: Interpolated or extrapolated from neighbour detections
-									2: Estimated
-									3: Rejected candidate
-									4: No detection data is available for this beam (all parameters
-										are set to zero)
-									5-7: Future use
-								The invalid range has been used to fill in amplitude samples in
-								the seabed image datagram.
-									bit 7: 0 = good detection
-									bit 7: 1 = bad detection
-									bit 3: 0 = amplitude detect
-									bit 3: 1 = phase detect
-									bits 4-6: 0 = normal detection
-									bits 4-6: 1 = interpolated from neighbor detections
-									bits 4-6: 2 = estimated
-									bits 4-6: 3 = rejected
-									bits 4-6: 4 = no detection available
-									other bits : future use */
-	int	png_raw_rxwindow[MBSYS_SIMRAD3_MAXBEAMS];	/* length of detection window */
-	int	png_raw_rxquality[MBSYS_SIMRAD3_MAXBEAMS];	/* beam quality flag
-							   0-254 Scaled standard deviation (sd) of the
-								range detection divided by
-								the detected range (dr):
-								Quality factor = 250*sd/dr. */
-	int	png_raw_rxspare1[MBSYS_SIMRAD3_MAXBEAMS];	/* spare */
-	float	png_raw_rxrange[MBSYS_SIMRAD3_MAXBEAMS];	/* range as two-way travel time (s) */
-	int	png_raw_rxamp[MBSYS_SIMRAD3_MAXBEAMS];		/* 0.5 dB */
-	int	png_raw_rxcleaning[MBSYS_SIMRAD3_MAXBEAMS];	/* Real time cleaning info */
-				/* realtime cleaning info:
-					For future use. A real time data cleaning module may flag out
-					beams. Bit 7 will be set to 1 if the beam is flagged out. Bit 0-6
-					will contain a code telling why the beam is flagged out. */
-	int	png_raw_rxspare2[MBSYS_SIMRAD3_MAXBEAMS];	/* spare */
-
-
-	/* quality factor */
-	int	png_quality_read;	/* flag indicating actual reading of quality factor record */
-	int	png_quality_date;	/* date = year*10000 + month*100 + day
-				    Feb 26, 1995 = 19950226 */
-	int	png_quality_msec;	/* time since midnight in msec
-				    08:12:51.234 = 29570234 */
-	int	png_quality_count;	        /* sequential counter or input identifier */
-	int	png_quality_serial;	        /* system 1 or system 2 serial number */
-	int	png_quality_nbeams;	        /* number of receive beams */
-	int	png_quality_nparameters;	/* number of quality parameters per beam */
-        int     png_quality_spare;
-	float	png_quality_parameters[MBSYS_SIMRAD3_MAXBEAMS][MBSYS_SIMRAD3_MAXQUALITYPARAMETERS];
-                                                /* The first quality parameter is the IFREMER quality factor
-                                                    defined by Xavier Lurton. Others have not yet been defined */
-
-	/* sidescan */
-	int	png_ss_read;	/* flag indicating actual reading of sidescan record */
-	int	png_ss_date;	/* date = year*10000 + month*100 + day
-				    Feb 26, 1995 = 19950226 */
-	int	png_ss_msec;	/* time since midnight in msec
-				    08:12:51.234 = 29570234 */
-	int	png_ss_count;	/* sequential counter or input identifier */
-	int	png_ss_serial;	/* system 1 or system 2 serial number */
-	float	png_ss_sample_rate;	/* sampling rate (Hz) */
-	int	png_r_zero;	/* range to normal incidence used in TVG
-				    (R0 predicted) in samples */
-	int	png_bsn;	/* normal incidence backscatter (BSN) (0.1 dB) */
-	int	png_bso;	/* oblique incidence backscatter (BSO) (0.1 dB) */
-	int	png_tx;		/* Tx beamwidth (0.1 deg) */
-	int	png_tvg_crossover;
-				/* TVG law crossover angle (0.1 deg) */
-	int	png_nbeams_ss;	/* number of beams with sidescan */
-	int	png_npixels;	/* number of pixels of sidescan */
-	int	png_sort_direction[MBSYS_SIMRAD3_MAXBEAMS];
-				/* sorting direction - The first sample in a beam
-					has lowest range if 1, highest if -- 1. Note
-					that the ranges in the seabed image datagram
-					are all two-- way from time of transmit to
-					time of receive. */
-	int	png_ssdetection[MBSYS_SIMRAD3_MAXBEAMS]; /* Detection info:
-							   This datagram may contain data for beams with and without a
-							   valid detection. Eight bits (0-7) gives details about the detection:
-								A) If the most significant bit (bit7) is zero, this beam has a valid
-									detection. Bit 0-3 is used to specify how the range for this beam
-									is calculated
-									0: Amplitude detect
-									1: Phase detect
-									2-15: Future use
-								B) If the most significant bit is 1, this beam has an invalid
-									detection. Bit 4-6 is used to specify how the range (and x,y,z
-									parameters) for this beam is calculated
-									0: Normal detection
-									1: Interpolated or extrapolated from neighbour detections
-									2: Estimated
-									3: Rejected candidate
-									4: No detection data is available for this beam (all parameters
-										are set to zero)
-									5-7: Future use
-								The invalid range has been used to fill in amplitude samples in
-								the seabed image datagram.
-									bit 7: 0 = good detection
-									bit 7: 1 = bad detection
-									bit 3: 0 = amplitude detect
-									bit 3: 1 = phase detect
-									bits 4-6: 0 = normal detection
-									bits 4-6: 1 = interpolated from neighbor detections
-									bits 4-6: 2 = estimated
-									bits 4-6: 3 = rejected
-									bits 4-6: 4 = no detection available
-									other bits : future use */
-	int	png_beam_samples[MBSYS_SIMRAD3_MAXBEAMS];
-				/* number of sidescan samples derived from
-					each beam */
-	int	png_start_sample[MBSYS_SIMRAD3_MAXBEAMS];
-				/* start sample number */
-	int	png_center_sample[MBSYS_SIMRAD3_MAXBEAMS]; 	/* center sample number */
-	short	png_ssraw[MBSYS_SIMRAD3_MAXRAWPIXELS];		/* the raw sidescan ordered port to starboard */
-	float	png_pixel_size;					/* processed sidescan pixel size (m) */
-	int	png_pixels_ss;					/* number of processed sidescan pixels stored */
-	short	png_ss[MBSYS_SIMRAD3_MAXPIXELS]; 		/* the processed sidescan ordered port to starboard */
-	short	png_ssalongtrack[MBSYS_SIMRAD3_MAXPIXELS]; 	/* the processed sidescan alongtrack distances (0.01 m) */
-	};
-
-/* internal data structure for extra parameters */
-struct mbsys_simrad3_extraparameters_struct
-	{
-        int     xtr_date;	/* extra parameters date = year*10000 + month*100 + day
-				    Feb 26, 1995 = 19950226 */
-	int	xtr_msec;	/* extra parameters time since midnight in msec
-				    08:12:51.234 = 29570234 */
-	int	xtr_count;	/* ping counter */
-	int	xtr_serial;	/* system 1 or 2 serial number */
-	int	xtr_id;	        /* content identifier:
-                                    1:  Calib.txt file for angle offset
-                                    2:  Log all heights (positioning system quality factors)
-                                    3:  Sound velocity at transducer
-                                    4:  Sound velocity profile
-                                    5:  Multicast RX status */
-        int     xtr_data_size;
-        int     xtr_nalloc;
-        char    *xtr_data;          /* variable array following from content identifier and record size */
-
-        /* case xtr_id == 2: Log all heights (positioning system quality factors) */
-        int     xtr_pqf_activepositioning;  /* active positioning system (0-2) */
-        short   xtr_pqf_qfsetting[3];       /* quality factor setting for each positioning system
-                                                    0: External PU decode
-                                                    1: PU decodes Q-factor (default)
-                                                Each positioning system has its own individual setting.
-                                                Value �1� indicates that the PU should decode the quality
-                                                factors in the traditional way. This is the default.
-                                                Value �0� indicates that the PU should skip quality factor
-                                                decoding as this is performed externally. The PU should
-                                                always transmit the height datagram �h�.*/
-        int     xtr_pqf_nqualityfactors[3]; /* number of quality factors for each positioning system
-                                                Each positioning system have an independent set of
-                                                additional quality factors. The number of quality
-                                                factors for each system must be specified.
-                                                Default value is 0.*/
-                                            /* Each quality factor is described by two entries, the
-                                               quality factor itself and a limit, forming a pair.
-                                               This results in a variable number of such pairs,
-                                               depending on how many additional quality factors is set
-                                               by the operator. If no quality factors are defined,
-                                               no pairs are included. The sequence of pairs is important.
-                                               First, all pairs for positioning system 1 is listed,
-                                               if any. Next any pairs for positioning system 2 and at
-                                               the end, any pairs for positioning system 3. */
-        int     xtr_pqf_qfvalues[3][MBSYS_SIMRAD3_MAXQUALITYFACTORS];
-                                            /* A quality factor is a positive number. Currently no
-                                               upper limit is imposed. */
-         int     xtr_pqf_qflimits[3][MBSYS_SIMRAD3_MAXQUALITYFACTORS];
-                                            /* Uncertainty in position fix in cm. This uncertainty
-                                               is associated with the quality factor value.
-                                               Currently not used. */
-
-        };
-
-/* internal data structure for water column time series */
-struct mbsys_simrad3_wcbeam_struct
-	{
-	int	wtc_rxpointangle;	/* Beam pointing angles in 0.01 degree,
-						positive to port. These values are roll stabilized. */
-	int	wtc_start_sample;	/* start sample number */
-	int	wtc_beam_samples;	/* number of water column samples derived from
-						each beam */
-	int	wtc_beam_spare;		/* unknown */
-	int	wtc_sector;		/* transmit sector identifier */
-	int	wtc_beam;  		/* beam 128 is first beam on
-				  	  	second head of EM3000D */
-	mb_s_char wtc_amp[MBSYS_SIMRAD3_MAXRAWPIXELS]; /* water column amplitude (dB) */
-	};
-
-/* internal data structure for water column data */
-struct mbsys_simrad3_watercolumn_struct
-	{
-	int	wtc_date;	/* date = year*10000 + month*100 + day
-				    Feb 26, 1995 = 19950226 */
-	int	wtc_msec;	/* time since midnight in msec
-				    08:12:51.234 = 29570234 */
-	int	wtc_count;	/* sequential counter or input identifier */
-	int	wtc_serial;	/* system 1 or system 2 serial number */
-	int	wtc_ndatagrams;	/* number of datagrams used to represent
-						the water column for this ping */
-	int	wtc_datagram;	/* number this datagram */
-	int	wtc_ntx;	/* number of transmit sectors */
-	int	wtc_nrx;	/* number of receive beams */
-	int	wtc_nbeam;	/* number of beams in this datagram */
-	int	wtc_ssv;	/* sound speed at transducer (0.1 m/sec) */
-	int	wtc_sfreq;	/* sampling frequency (0.01 Hz) */
-	int	wtc_heave;	/* tx time heave at transducer (0.01 m) */
-	int	wtc_spare1;	/* spare */
-	int	wtc_spare2;	/* spare */
-	int	wtc_spare3;	/* spare */
-	int	wtc_txtiltangle[MBSYS_SIMRAD3_MAXTX];	/* tilt angle (0.01 deg) */
-	int	wtc_txcenter[MBSYS_SIMRAD3_MAXTX];	/* center frequency (Hz) */
-	int	wtc_txsector[MBSYS_SIMRAD3_MAXTX];	/* transmit sector number (0-19) */
-	struct mbsys_simrad3_wcbeam_struct beam[MBSYS_SIMRAD3_MAXBEAMS];
-	};
-
-/* internal data structure for attitude data */
-struct mbsys_simrad3_attitude_struct
-	{
-	int	att_date;	/* date = year*10000 + month*100 + day
-				    Feb 26, 1995 = 19950226 */
-	int	att_msec;	/* time since midnight in msec
-				    08:12:51.234 = 29570234 */
-	int	att_count;	/* sequential counter or input identifier */
-	int	att_serial;	/* system 1 or system 2 serial number */
-	int	att_ndata;	/* number of attitude data */
-	int	att_time[MBSYS_SIMRAD3_MAXATTITUDE];
-				/* time since record start (msec) */
-	int	att_sensor_status[MBSYS_SIMRAD3_MAXATTITUDE];
-				/* see note 12 above */
-	int	att_roll[MBSYS_SIMRAD3_MAXATTITUDE];
-				/* roll (0.01 degree) */
-	int	att_pitch[MBSYS_SIMRAD3_MAXATTITUDE];
-				/* pitch (0.01 degree) */
-	int	att_heave[MBSYS_SIMRAD3_MAXATTITUDE];
-				/* heave (cm) */
-	int	att_heading[MBSYS_SIMRAD3_MAXATTITUDE];
-				/* heading (0.01 degree) */
-	int	att_sensordescriptor;
-				/* sensor system descriptor - indicates
-				   which motion sensor is source of these
-				   data, and which values have been
-				   used in realtime processing:
-				   	xx00 xxxx - motion sensor number 1
-				   	xx01 xxxx - motion sensor number 2
-				   	xx10 xxxx - motion sensor number 3 (in netattitude record)
-				   	xxxx xxx1 - heading from this system is active
-				   	xxxx xx0x - roll from this system is active
-				   	xxxx x0xx - pitch from this system is active
-				   	xxxx 0xxx - heading from this system is active */
-	};
-
-/* internal data structure for network attitude data */
-struct mbsys_simrad3_netattitude_struct
-	{
-	int	nat_date;	/* date = year*10000 + month*100 + day
-				    Feb 26, 1995 = 19950226 */
-	int	nat_msec;	/* time since midnight in msec
-				    08:12:51.234 = 29570234 */
-	int	nat_count;	/* sequential counter or input identifier */
-	int	nat_serial;	/* system 1 or system 2 serial number */
-	int	nat_ndata;	/* number of attitude data */
-	int	nat_sensordescriptor;	/* sensor system descriptor */
-	int	nat_time[MBSYS_SIMRAD3_MAXATTITUDE];
-				/* time since record start (msec) */
-	int	nat_roll[MBSYS_SIMRAD3_MAXATTITUDE];
-				/* roll (0.01 degree) */
-	int	nat_pitch[MBSYS_SIMRAD3_MAXATTITUDE];
-				/* pitch (0.01 degree) */
-	int	nat_heave[MBSYS_SIMRAD3_MAXATTITUDE];
-				/* heave (cm) */
-	int	nat_heading[MBSYS_SIMRAD3_MAXATTITUDE];
-				/* heading (0.01 degree) */
-	int	nat_nbyte_raw[MBSYS_SIMRAD3_MAXATTITUDE];	/* number of bytes in input datagram (Nd) */
-	char	nat_raw[MBSYS_SIMRAD3_MAXATTITUDE*MBSYS_SIMRAD3_BUFFER_SIZE];	/* network attitude input datagram as received by datalogger */
-	};
-
-/* internal data structure for heading data */
-struct mbsys_simrad3_heading_struct
-	{
-	int	hed_date;	/* date = year*10000 + month*100 + day
-				    Feb 26, 1995 = 19950226 */
-	int	hed_msec;	/* time since midnight in msec
-				    08:12:51.234 = 29570234 */
-	int	hed_count;	/* sequential counter or input identifier */
-	int	hed_serial;	/* system 1 or system 2 serial number */
-	int	hed_ndata;	/* number of heading data */
-	int	hed_time[MBSYS_SIMRAD3_MAXHEADING];
-				/* time since record start (msec) */
-	int	hed_heading[MBSYS_SIMRAD3_MAXHEADING];
-				/* heading (0.01 degree) */
-	int	hed_heading_status;
-				/* heading status (0=inactive) */
-	};
-
-/* internal data structure for ssv data */
-struct mbsys_simrad3_ssv_struct
-	{
-	int	ssv_date;	/* date = year*10000 + month*100 + day
-				    Feb 26, 1995 = 19950226 */
-	int	ssv_msec;	/* time since midnight in msec
-				    08:12:51.234 = 29570234 */
-	int	ssv_count;	/* sequential counter or input identifier */
-	int	ssv_serial;	/* system 1 or system 2 serial number */
-	int	ssv_ndata;	/* number of ssv data */
-	int	ssv_time[MBSYS_SIMRAD3_MAXSSV];
-				/* time since record start (msec) */
-	int	ssv_ssv[MBSYS_SIMRAD3_MAXSSV];
-				/* ssv (0.1 m/s) */
-	};
-
-/* internal data structure for tilt data */
-struct mbsys_simrad3_tilt_struct
-	{
-	int	tlt_date;	/* date = year*10000 + month*100 + day
-				    Feb 26, 1995 = 19950226 */
-	int	tlt_msec;	/* time since midnight in msec
-				    08:12:51.234 = 29570234 */
-	int	tlt_count;	/* sequential counter or input identifier */
-	int	tlt_serial;	/* system 1 or system 2 serial number */
-	int	tlt_ndata;	/* number of tilt data */
-	int	tlt_time[MBSYS_SIMRAD3_MAXTILT];
-				/* time since record start (msec) */
-	int	tlt_tilt[MBSYS_SIMRAD3_MAXTILT];
-				/* tilt + forward (0.01 degree) */
-	};
-
-/* internal data structure */
-struct mbsys_simrad3_struct
-	{
-	/* type of data record */
-	int	kind;		/* MB-System record ID */
-	int	type;		/* Kongsberg datagram ID */
-
-	/* type of sonar */
-	int	sonar;		/* Type of Kongsberg sonar */
-        int     ping_index;     /* Ping index holding the most recent multibeam
-                                 * output data record */
-
-	/* time stamp */
-	int	date;		        /* Date = year*10000 + month*100 + day
-                                                Feb 26, 1995 = 19950226 */
-	int	msec;		        /* Time since midnight in msec
-                                                08:12:51.234 = 29570234 */
-
-	/* processing unit status parameter values */
-	int	sts_date;	        /* Status date = year*10000 + month*100 + day
-                                                Feb 26, 1995 = 19950226 */
-	int	sts_msec;	        /* Status time since midnight in msec
-                                                08:12:51.234 = 29570234 */
-	int	sts_status_count; 	/* Status datagram counter */
-	int	sts_serial;		/* System 1 or 2 serial number */
-	int	sts_pingrate;		/* Ping rate (0.01 Hz) */
-	int	sts_ping_count;		/* Ping counter - latest ping */
-	int	sts_load;		/* Processing unit load (%) */
-	int	sts_udp_status;		/* Sensor input status, UDP port 2 */
-	int	sts_serial1_status;	/* Sensor input status, serial port 1 */
-	int	sts_serial2_status;	/* Sensor input status, serial port 2 */
-	int	sts_serial3_status;	/* Sensor input status, serial port 3 */
-	int	sts_serial4_status;	/* Sensor input status, serial port 4 */
-	int	sts_pps_status;		/* Sensor input status, pps, >0 ok */
-	int	sts_position_status;	/* Sensor input status, position, >0 ok */
-	int	sts_attitude_status;	/* Sensor input status, attitude, >0 ok */
-	int	sts_clock_status;	/* Sensor input status, clock, >0 ok */
-	int	sts_heading_status;	/* Sensor input status, heading, >0 ok */
-	int	sts_pu_status;		/* Sensor input status, processing unit
-						(0=off, 1-on, 2=simulator) */
-	int	sts_last_heading;	/* last received heading (0.01 deg) */
-	int	sts_last_roll;		/* last received roll (0.01 deg) */
-	int	sts_last_pitch;		/* last received pitch (0.01 deg) */
-	int	sts_last_heave;		/* last received heave (0.01 m) */
-	int	sts_last_ssv;		/* last received sound speed (0.1 m/s) */
-	int	sts_last_depth;		/* last received depth (0.01 m) */
-	int	sts_spare;		/* Spare */
-	int	sts_bso;		/* backscatter at oblique angle (dB) */
-	int	sts_bsn;		/* backscatter at normal incidence (dB) */
-	int	sts_gain;		/* fixed gain (dB) */
-	int	sts_dno;		/* depth to normal incidence (m) */
-	int	sts_rno;		/* range to normal incidence (m) */
-	int	sts_port;		/* port coverage (deg) */
-	int	sts_stbd;		/* Starboard coverage (deg) */
-	int	sts_ssp;		/* Sound speed at transducer from profile (0.1 m/s) */
-	int	sts_yaw;		/* yaw stabilization (0.01 deg) */
-	int	sts_port2;		/* port coverage for second em3002 head (deg) */
-	int	sts_stbd2;		/* Starboard coverage for second em3002 head (deg) */
-	int	sts_spare2;		/* Spare */
-
-	/* installation parameter values */
-	int	par_date;	/* installation parameter date = year*10000 + month*100 + day
-				    Feb 26, 1995 = 19950226 */
-	int	par_msec;	/* installation parameter time since midnight in msec
-				    08:12:51.234 = 29570234 */
-	int	par_line_num;	/* Survey line number */
-	int	par_serial_1;	/* System 1 serial number */
-	int	par_serial_2;	/* System 2 serial number */
-	double	par_wlz;	/* water line vertical location (m) */
-	int	par_smh;	/* System main head serial number */
-        
-        int     par_hun;        /* Hull unit (0 or 1) */
-        double  par_hut;        /* Hull unit tilt offset */
-        int     par_txs;        /* TX serial number */
-        int     par_t2x;        /* TX number 2 serial number */
-        int     par_r1s;        /* RX number 1 serial number */
-        int     par_r2s;        /* RX number 2 serial number */
-        int     par_stc;        /* System transducer configuration
-                                 *      0 = Single TX + single RX
-                                 *              EM122, EM302, EM710, EM2040-Single
-                                 *      1 = Single head
-                                 *              EM3002S, EM2040C-Single, EM2040P
-                                 *      2 = Dual Head
-                                 *              EM3002-Dual, EM2040C-Dual
-                                 *      3 = Single TX + Dual RX
-                                 *              EM2040-Dual-RX
-                                 *      4 = Dual TX + Dual RX
-                                 *              EM2040-Dual-TX
-                                 *  If present, the STC parameter can be used in
-                                 *  decoding of the transducer installation parameters:
-                                 *      STC  S0X/Y/Z/R/P/H  S1X/Y/Z/R/P/H  S2X/Y/Z/R/P/H  S3X/Y/Z/R/P/H
-                                 *      ---  -------------  -------------  -------------  -------------
-                                 *       0        ----            TX             RX           ----
-                                 *       1        ----           Head           ----          ----
-                                 *       2        ----          Head 1         Head 2         ----
-                                 *       3        ----            TX            RX 1          RX 2
-                                 *       4        TX 1           TX 2           RX 1          RX 2     */
-	double	par_s0z;	/* Transducer 0 vertical location (m) */
-	double	par_s0x;	/* Transducer 0 along location (m) */
-	double	par_s0y;	/* Transducer 0 athwart location (m) */
-	double	par_s0h;	/* Transducer 0 heading (deg) */
-	double	par_s0r;	/* Transducer 0 roll (m) */
-	double	par_s0p;	/* Transducer 0 pitch (m) */
-
-	double	par_s1z;	/* Transducer 1 vertical location (m) */
-	double	par_s1x;	/* Transducer 1 along location (m) */
-	double	par_s1y;	/* Transducer 1 athwart location (m) */
-	double	par_s1h;	/* Transducer 1 heading (deg) */
-	double	par_s1r;	/* Transducer 1 roll (m) */
-	double	par_s1p;	/* Transducer 1 pitch (m) */
-	int	par_s1n;	/* Transducer 1 number of modules */
-	double	par_s2z;	/* Transducer 2 vertical location (m) */
-	double	par_s2x;	/* Transducer 2 along location (m) */
-	double	par_s2y;	/* Transducer 2 athwart location (m) */
-	double	par_s2h;	/* Transducer 2 heading (deg) */
-	double	par_s2r;	/* Transducer 2 roll (m) */
-	double	par_s2p;	/* Transducer 2 pitch (m) */
-	int	par_s2n;	/* Transducer 2 number of modules */
-        
-	double	par_s3z;	/* Transducer 3 vertical location (m) */
-	double	par_s3x;	/* Transducer 3 along location (m) */
-	double	par_s3y;	/* Transducer 3 athwart location (m) */
-	double	par_s3h;	/* Transducer 3 heading (deg) */
-	double	par_s3r;	/* Transducer 3 roll (m) */
-	double	par_s3p;	/* Transducer 3 pitch (m) */
-
-        int     par_s1s;        /* TX array size (0=0.5 deg, 1 = 1 deg, 2 = 2 deg) */
-        int     par_s2s;        /* RX array size (1 = 1 deg, 2 = 2 deg) */
-        
-	double	par_go1;	/* System (sonar head 1) gain offset */
-	double	par_go2;	/* Sonar head 2 gain offset */
-        double  par_obo;        /* Outer beam offset */
-        double  par_fgd;        /* High/low frequency gain difference */
-        
-	char	par_tsv[16];	/* Transmitter (sonar head 1) software version */
-	char	par_rsv[16];	/* Receiver (sonar head 2) software version */
-	char	par_bsv[16];	/* Beamformer software version */
-	char	par_psv[16];	/* Processing unit software version */
-	char	par_dds[16];	/* DDS software version */
-	char	par_osv[16];	/* Operator station software version */
-	char	par_dsv[16];	/* Datagram format version */
-	double	par_dsx;	/* Depth sensor along location (m) */
-	double	par_dsy;	/* Depth sensor athwart location (m) */
-	double	par_dsz;	/* Depth sensor vertical location (m) */
-	int	par_dsd;	/* Depth sensor time delay (msec) */
-	double	par_dso;	/* Depth sensor offset */
-	double	par_dsf;	/* Depth sensor scale factor */
-	char	par_dsh[2];	/* Depth sensor heave (IN or NI) */
-	int	par_aps;	/* Active position system number */
-	int	par_p1q;	/* Position system 1 quality (boolean) */
-	int	par_p1m;	/* Position system 1 motion compensation (boolean) */
-	int	par_p1t;	/* Position system 1 time stamp used
-				    (0=system time, 1=position input time) */
-	double	par_p1z;	/* Position system 1 vertical location (m) */
-	double	par_p1x;	/* Position system 1 along location (m) */
-	double	par_p1y;	/* Position system 1 athwart location (m) */
-	double	par_p1d;	/* Position system 1 time delay (sec) */
-	char	par_p1g[16];	/* Position system 1 geodetic datum */
-	int	par_p2q;	/* Position system 2 quality (boolean) */
-	int	par_p2m;	/* Position system 2 motion compensation (boolean) */
-	int	par_p2t;	/* Position system 2 time stamp used
-				    (0=system time, 1=position input time) */
-	double	par_p2z;	/* Position system 2 vertical location (m) */
-	double	par_p2x;	/* Position system 2 along location (m) */
-	double	par_p2y;	/* Position system 2 athwart location (m) */
-	double	par_p2d;	/* Position system 2 time delay (sec) */
-	char	par_p2g[16];	/* Position system 2 geodetic datum */
-	int	par_p3q;	/* Position system 3 quality (boolean) */
-	int	par_p3m;	/* Position system 3 motion compensation (boolean) */
-	int	par_p3t;	/* Position system 3 time stamp used
-				    (0=system time, 1=position input time) */
-	double	par_p3z;	/* Position system 3 vertical location (m) */
-	double	par_p3x;	/* Position system 3 along location (m) */
-	double	par_p3y;	/* Position system 3 athwart location (m) */
-	double	par_p3d;	/* Position system 3 time delay (sec) */
-	char	par_p3g[16];	/* Position system 3 geodetic datum */
-	int	par_p3s;	/* Position system 3 on serial line or ethernet (0=ethernet) */
-        
-	double	par_msz;	/* Motion sensor 1 vertical location (m) */
-	double	par_msx;	/* Motion sensor 1 along location (m) */
-	double	par_msy;	/* Motion sensor 1 athwart location (m) */
-	char	par_mrp[2];	/* Motion sensor 1 roll reference plane (HO or RP) */
-	double	par_msd;	/* Motion sensor 1 time delay (sec) */
-	double	par_msr;	/* Motion sensor 1 roll offset (deg) */
-	double	par_msp;	/* Motion sensor 1 pitch offset (deg) */
-	double	par_msg;	/* Motion sensor 1 heading offset (deg) */
-        
-	double	par_nsz;	/* Motion sensor 2 vertical location (m) */
-	double	par_nsx;	/* Motion sensor 2 along location (m) */
-	double	par_nsy;	/* Motion sensor 2 athwart location (m) */
-	char	par_nrp[2];	/* Motion sensor 2 roll reference plane (HO or RP) */
-	double	par_nsd;	/* Motion sensor 2 time delay (sec) */
-	double	par_nsr;	/* Motion sensor 2 roll offset (deg) */
-	double	par_nsp;	/* Motion sensor 2 pitch offset (deg) */
-	double	par_nsg;	/* Motion sensor 2 heading offset (deg) */
-        
-	double	par_gcg;	/* Gyro compass heading offset (deg) */
-	double	par_mas;        /* Roll scaling factor */
-	int	par_shc;        /* Transducer depth sound speed source
-                                 *   0 = transducer depth sound speed is used as
-                                 *          the initial entry the sound speed profile
-                                 *          used in the raytracing calculations
-                                 *   1 = transducer depth sound speed is not used for
-                                 *          raytracing calculations
-                                 *   Note that the source of the sound speed at the
-                                 *   transducer depth (and this sound speed is always
-                                 *   used to calculate beam pointangles if required)
-                                 *   is logged in the runtime datagram. */
-	int	par_pps;        /* 1 PPS clock synchronization
-                                 *   0 = not in use
-                                 *   1 = falling edge detect
-                                 *   2 = rising edge detect */
-	int	par_cls;        /* Clock source
-                                 *   0 = not set,
-                                 *   1 = ZDA,
-                                 *   2 = active POS,
-                                 *   3 = operator station */
-	int	par_clo;        /* Clock offset (seconds) */
-	int	par_vsn;        /* Active attitude velocity sensor
-                                 *  0 = attitude velocity sensor not used
-                                 *  1 = attitude velocity sensor 1 active
-                                 *  2 = attitude velocity sensor 2 active
-                                 *  If VSN = 0, the other VSx parameters are not
-                                 *  relevant and need not be sent.
-                                 *  It is assumed that attitude velocity sensor 1
-                                 *  and motion sensor 1 is the same physical unit
-                                 *  and share the installation parameters MSx.
-                                 *  It is also assumed that attitude  velocity
-                                 *  sensor 2 and motion sensor 2 is the same
-                                 *  physical unit and share the installation
-                                 *  parameters NSx */
-	int	par_vsu;        /* Attitude velocity sensor 1 UDP port address (UDP5)
-                                 *      Value depends on sensor type. */
-	int	par_vse;        /* Attitude velocity sensor 1 ethernet port
-                                 *      0 = Not in use
-                                 *      1 = Use the existing ethernet port used
-                                 *          for communciation to topside
-                                 *      2 = Use ethernet 2 (if available). Network address
-                                 *          and mask are set up by VSI and VSM */
-	int	par_vtu;        /* Attitude velocity sensor 2 UDP port address (UDP6)
-                                 *      Value depends on sensor type. */
-	int	par_vte;        /* Attitude velocity sensor 2 ethernet port
-                                 *      0 = Not in use
-                                 *      1 = Use the existing ethernet port used
-                                 *          for communciation to topside
-                                 *      2 = Use ethernet 2 (if available). Network address
-                                 *          and mask are set up by VSI and VSM */
-	int	par_aro;        /* Active roll/pitch sensor input port
-                                 *      2 = COM2 (motion sensor 1)
-                                 *      3 = COM3 (motion sensor 2)
-                                 *      8 = UDP5 (attitude velocity sensor 1)
-                                 *      9 = UDP6 (attitude velocity sensor 2) */
-	int	par_ahe;        /* Active heave sensor input port
-                                 *      2 = COM2 (motion sensor 1)
-                                 *      3 = COM3 (motion sensor 2)
-                                 *      8 = UDP5 (attitude velocity sensor 1)
-                                 *      9 = UDP6 (attitude velocity sensor 2) */
-	int	par_ahs;        /* Active heading sensor input port
-                                 *      0 = UDP2 (position system 3)
-                                 *      1 = COM1 (position system 1)
-                                 *      2 = COM2 (motion sensor 1)
-                                 *      3 = COM3 (motion sensor 2 or position system 2)
-                                 *      4 = COM4 (position system 3)
-                                 *      5 = Multicast 1
-                                 *      6 = Multicast 2
-                                 *      7 = Multicast 3
-                                 *      8 = UDP5 (attitude velocity sensor 1)
-                                 *      9 = UDP6 (attitude velocity sensor 2) */
-	char	par_vsi[16];    /* Ethernet 2 address */
-	char	par_vsm[16];    /* Ethernet 2 IP network mask */
-	char	par_mca1[16];   /* Multicast 1 (position sensor 1) IP address (ethernet 2) */
-	int	par_mcu1;       /* Multicast 1 (position sensor 1) UDP port number */
-	char	par_mci1[16];   /* Multicast 1 (position sensor 1) identifier */
-	int	par_mcp1;       /* Multicast 1 (position sensor 1) sensor system number
-                                 *      0 = No position will be received from multicast, default
-                                 *      1 = position system 1
-                                 *      2 = position system 2
-                                 *      3 = position system 3
-                                 *      4 = svp system */
-	char	par_mca2[16];   /* Multicast 2 (position sensor 2) IP address (ethernet 2) */
-	int	par_mcu2;       /* Multicast 2 (position sensor 2) UDP port number */
-	char	par_mci2[16];   /* Multicast 2 (position sensor 2) identifier */
-	int	par_mcp2;       /* Multicast 2 (position sensor 2) sensor system number
-                                 *      0 = No position will be received from multicast, default
-                                 *      1 = position system 1
-                                 *      2 = position system 2
-                                 *      3 = position system 3
-                                 *      4 = svp system */
-	char	par_mca3[16];   /* Multicast 3 (position sensor 3) IP address (ethernet 2) */
-	int	par_mcu3;       /* Multicast 3 (position sensor 3) UDP port number */
-	char	par_mci3[16];   /* Multicast 3 (position sensor 3) identifier */
-	int	par_mcp3;       /* Multicast 3 (position sensor 3) sensor system number
-                                 *      0 = No position will be received from multicast, default
-                                 *      1 = position system 1
-                                 *      2 = position system 2
-                                 *      3 = position system 3
-                                 *      4 = svp system */
-	char	par_mca4[16];   /* Multicast 4 (svp sensor) IP address (ethernet 2) */
-	int	par_mcu4;       /* Multicast 4 (svp sensor) UDP port number */
-	char	par_mci4[16];   /* Multicast 4 (svp sensor) identifier */
-	int	par_mcp4;       /* Multicast 4 (svp sensor) sensor system number
-                                 *      0 = No position will be received from multicast, default
-                                 *      1 = position system 1
-                                 *      2 = position system 2
-                                 *      3 = position system 3
-                                 *      4 = svp system */
-        
-	int	par_snl;        /* Ships noise level
-                                 *      0 = normal
-                                 *      1 = high
-                                 *      2 = very high */
-	char	par_cpr[4];     /* Cartographic projection */
-	char	par_rop[MBSYS_SIMRAD3_COMMENT_LENGTH];  /* Responsible operator */
-	char	par_sid[MBSYS_SIMRAD3_COMMENT_LENGTH];  /* Survey identifier */
-	char	par_rfn[MBSYS_SIMRAD3_COMMENT_LENGTH];  /* Raw file name */
-	char	par_pll[MBSYS_SIMRAD3_COMMENT_LENGTH];  /* Survey line identifier (planned line number) */
-	char	par_com[MBSYS_SIMRAD3_COMMENT_LENGTH];  /* comment */
-
-	/* runtime parameter values */
-	int	run_date;	/* runtime parameter date = year*10000 + month*100 + day
-				    Feb 26, 1995 = 19950226 */
-	int	run_msec;	/* runtime parameter time since midnight in msec
-				    08:12:51.234 = 29570234 */
-	int	run_ping_count;	/* ping counter */
-	int	run_serial;	/* System 1 or 2 serial number */
-	int	run_status;	/* System status */
-	int	run_mode;	/* System mode:
-				    0 : nearfield (EM3000) or very shallow (EM300)
-				    1 :	normal (EM3000) or shallow (EM300)
-				    2 : medium (EM300)
-				    3 : deep (EM300)
-				    4 : very deep (EM300) */
-	int	run_filter_id;	/* filter identifier - the two lowest bits
-				    indicate spike filter strength:
-					00 : off
-					01 : weak
-					10 : medium
-					11 : strong
-				    bit 2 is set if the slope filter is on
-				    bit 3 is set if the sidelobe filter is on
-				    bit 4 is set if the range windows are expanded
-				    bit 5 is set if the smoothing filter is on
-				    bit	6 is set if the interference filter is on */
-	int	run_min_depth;	/* minimum depth (m) */
-	int	run_max_depth;	/* maximum depth (m) */
-	int	run_absorption;	/* absorption coefficient (0.01 dB/km) */
-
-	int	run_tran_pulse;	/* transmit pulse length (usec) */
-	int	run_tran_beam;	/* transmit beamwidth (0.1 deg) */
-	int	run_tran_pow;	/* transmit power reduction (dB) */
-	int	run_rec_beam;	/* receiver beamwidth (0.1 deg) */
-	int	run_rec_band;	/* receiver bandwidth (50 hz) */
-	int	run_rec_gain;	/* receiver fixed gain (dB) */
-	int	run_tvg_cross;	/* TVG law crossover angle (deg) */
-	int	run_ssv_source;	/* Source of sound speed at transducer:
-				    0 : from sensor
-				    1 : manual
-				    2 : from profile */
-	int	run_max_swath;	/* maximum swath width (m) */
-	int	run_beam_space;	/* beam spacing:
-				    0 : determined by beamwidth (EM3000)
-				    1 : equidistant
-				    2 : equiangle */
-	int	run_swath_angle;/* coverage sector of swath (deg) */
-	int	run_stab_mode;	/* yaw and pitch stabilization mode:
-				    The upper bit (bit 7) is set if pitch
-				    stabilization is on.
-				    The two lower bits are used to show yaw
-				    stabilization mode as follows:
-					00 : none
-					01 : to survey line heading
-					10 : to mean vessel heading
-					11 : to manually entered heading */
-	char	run_spare[6];
-
-	/* Sound velocity profile */
-	int	svp_use_date;	/* date at start of use
-				    date = year*10000 + month*100 + day
-				    Feb 26, 1995 = 19950226 */
-	int	svp_use_msec;	/* time at start of use since midnight in msec
-				    08:12:51.234 = 29570234 */
-	int	svp_count;	/* Sequential counter or input identifier */
-	int	svp_serial;	/* system 1 serial number */
-	int	svp_origin_date;/* date at svp origin
-				    date = year*10000 + month*100 + day
-				    Feb 26, 1995 = 19950226 */
-	int	svp_origin_msec;/* time at svp origin since midnight in msec
-				    08:12:51.234 = 29570234 */
-	int	svp_num;	/* number of svp entries */
-	int	svp_depth_res;	/* depth resolution (cm) */
-	int	svp_depth[MBSYS_SIMRAD3_MAXSVP];
-				/* depth of svp entries (according to svp_depth_res) */
-	int	svp_vel[MBSYS_SIMRAD3_MAXSVP];
-				/* sound speed of svp entries (0.1 m/sec) */
-
-	/* position */
-	int	pos_date;	/* position date = year*10000 + month*100 + day
-				    Feb 26, 1995 = 19950226 */
-	int	pos_msec;	/* position time since midnight in msec
-				    08:12:51.234 = 29570234 */
-	int	pos_count;	/* sequential counter */
-	int	pos_serial;	/* system 1 serial number */
-	int	pos_latitude;	/* latitude in decimal degrees * 20000000
-				    (negative in southern hemisphere)
-				    if valid, invalid = 0x7FFFFFFF */
-	int	pos_longitude;	/* longitude in decimal degrees * 10000000
-				    (negative in western hemisphere)
-				    if valid, invalid = 0x7FFFFFFF */
-	int	pos_quality;	/* measure of position fix quality (cm) */
-	int	pos_speed;	/* speed over ground (cm/sec) if valid,
-				    invalid = 0xFFFF */
-	int	pos_course;	/* course over ground (0.01 deg) if valid,
-				    invalid = 0xFFFF */
-	int	pos_heading;	/* heading (0.01 deg) if valid,
-				    invalid = 0xFFFF */
-	int	pos_heave;	/* heave from interpolation (0.01 m) */
-	int	pos_roll;	/* roll from interpolation (0.01 deg) */
-	int	pos_pitch;	/* pitch from interpolation (0.01 deg) */
-	int	pos_system;	/* position system number, type, and realtime use
-				    - position system number given by two lowest bits
-				    - fifth bit set means position must be derived
-					from input Simrad 90 datagram
-				    - sixth bit set means valid time is that of
-					input datagram */
-	int	pos_input_size;	/* number of bytes in input position datagram */
-	char	pos_input[256];	/* position input datagram as received, minus
-				    header and tail (such as NMEA 0183 $ and CRLF) */
-
-	/* height */
-	int	hgt_date;	/* height date = year*10000 + month*100 + day
-				    Feb 26, 1995 = 19950226 */
-	int	hgt_msec;	/* height time since midnight in msec
-				    08:12:51.234 = 29570234 */
-	int	hgt_count;	/* sequential counter */
-	int	hgt_serial;	/* system 1 serial number */
-	int	hgt_height;	/* height (0.01 m) */
-	int	hgt_type;	/* height type as given in input datagram or if
-				    zero the height is derived from the GGK datagram
-				    and is the height of the water level re the
-				    vertical datum */
-
-	/* tide */
-	int	tid_date;	/* tide date = year*10000 + month*100 + day
-				    Feb 26, 1995 = 19950226 */
-	int	tid_msec;	/* tide time since midnight in msec
-				    08:12:51.234 = 29570234 */
-	int	tid_count;	/* sequential counter */
-	int	tid_serial;	/* system 1 serial number */
-	int	tid_origin_date;/* tide input date = year*10000 + month*100 + day
-				    Feb 26, 1995 = 19950226 */
-	int	tid_origin_msec;/* tide input time since midnight in msec
-				    08:12:51.234 = 29570234 */
-	int	tid_tide;	/* tide offset (0.01 m) */
-
-	/* clock */
-	int	clk_date;	/* system date = year*10000 + month*100 + day
-				    Feb 26, 1995 = 19950226 */
-	int	clk_msec;	/* system time since midnight in msec
-				    08:12:51.234 = 29570234 */
-	int	clk_count;	/* sequential counter */
-	int	clk_serial;	/* system 1 serial number */
-	int	clk_origin_date;/* external clock date = year*10000 + month*100 + day
-				    Feb 26, 1995 = 19950226 */
-	int	clk_origin_msec;/* external clock time since midnight in msec
-				    08:12:51.234 = 29570234 */
-	int	clk_1_pps_use;	/* if 1 then the internal clock is synchronized
-				    to an external 1 PPS signal, if 0 then not */
-
-	/* pointer to survey data structure */
-	struct mbsys_simrad3_ping_struct pings[MBSYS_SIMRAD3_NUM_PING_STRUCTURES];
-
-        /* pointer to extra parameters data structure */
-        struct mbsys_simrad3_extraparameters_struct *extraparameters;
-
-	/* pointer to attitude data structure */
-	struct mbsys_simrad3_attitude_struct *attitude;
-
-	/* pointer to network attitude data structure */
-	struct mbsys_simrad3_netattitude_struct *netattitude;
-
-	/* pointer to heading data structure */
-	struct mbsys_simrad3_heading_struct *heading;
-
-	/* pointer to ssv data structure */
-	struct mbsys_simrad3_ssv_struct *ssv;
-
-	/* pointer to tilt data structure */
-	struct mbsys_simrad3_tilt_struct *tilt;
-
-	/* pointer to water column data structure */
-	struct mbsys_simrad3_watercolumn_struct *wc;
-	};
-
-
-/* system specific function prototypes */
-int mbsys_simrad3_alloc(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error);
-int mbsys_simrad3_survey_alloc(int verbose,
-			void *mbio_ptr, void *store_ptr,
-			int *error);
-int mbsys_simrad3_extraparameters_alloc(int verbose,
-			void *mbio_ptr, void *store_ptr,
-			int *error);
-int mbsys_simrad3_wc_alloc(int verbose,
-			void *mbio_ptr, void *store_ptr,
-			int *error);
-int mbsys_simrad3_attitude_alloc(int verbose,
-			void *mbio_ptr, void *store_ptr,
-			int *error);
-int mbsys_simrad3_netattitude_alloc(int verbose,
-			void *mbio_ptr, void *store_ptr,
-			int *error);
-int mbsys_simrad3_heading_alloc(int verbose,
-			void *mbio_ptr, void *store_ptr,
-			int *error);
-int mbsys_simrad3_ssv_alloc(int verbose,
-			void *mbio_ptr, void *store_ptr,
-			int *error);
-int mbsys_simrad3_tilt_alloc(int verbose,
-			void *mbio_ptr, void *store_ptr,
-			int *error);
-int mbsys_simrad3_deall(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error);
-int mbsys_simrad3_zero_ss(int verbose, void *store_ptr, int *error);
-int mbsys_simrad3_dimensions(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int *nbath, int *namp, int *nss, int *error);
-int mbsys_simrad3_pingnumber(int verbose, void *mbio_ptr,
-			int *pingnumber, int *error);
-int mbsys_simrad3_extract(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int time_i[7], double *time_d,
-			double *navlon, double *navlat,
-			double *speed, double *heading,
-			int *nbath, int *namp, int *nss,
-			char *beamflag, double *bath, double *amp,
-			double *bathacrosstrack, double *bathalongtrack,
-			double *ss, double *ssacrosstrack, double *ssalongtrack,
-			char *comment, int *error);
-int mbsys_simrad3_insert(int verbose, void *mbio_ptr, void *store_ptr,
-			int kind, int time_i[7], double time_d,
-			double navlon, double navlat,
-			double speed, double heading,
-			int nbath, int namp, int nss,
-			char *beamflag, double *bath, double *amp,
-			double *bathacrosstrack, double *bathalongtrack,
-			double *ss, double *ssacrosstrack, double *ssalongtrack,
-			char *comment, int *error);
-int mbsys_simrad3_ttimes(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int *nbeams,
-			double *ttimes, double *angles,
-			double *angles_forward, double *angles_null,
-			double *heave, double *alongtrack_offset,
-			double *draft, double *ssv, int *error);
-int mbsys_simrad3_detects(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int *nbeams, int *detects, int *error);
-int mbsys_simrad3_pulses(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int *nbeams, int *pulses, int *error);
-int mbsys_simrad3_gains(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, double *transmit_gain, double *pulse_length,
-			double *receive_gain, int *error);
-int mbsys_simrad3_extract_altitude(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, double *transducer_depth, double *altitude,
-			int *error);
-int mbsys_simrad3_extract_nnav(int verbose, void *mbio_ptr, void *store_ptr,
-			int nmax, int *kind, int *n,
-			int *time_i, double *time_d,
-			double *navlon, double *navlat,
-			double *speed, double *heading, double *draft,
-			double *roll, double *pitch, double *heave,
-			int *error);
-int mbsys_simrad3_extract_nav(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int time_i[7], double *time_d,
-			double *navlon, double *navlat,
-			double *speed, double *heading, double *draft,
-			double *roll, double *pitch, double *heave,
-			int *error);
-int mbsys_simrad3_insert_nav(int verbose, void *mbio_ptr, void *store_ptr,
-			int time_i[7], double time_d,
-			double navlon, double navlat,
-			double speed, double heading, double draft,
-			double roll, double pitch, double heave,
-			int *error);
-int mbsys_simrad3_extract_svp(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind,
-			int *nsvp,
-			double *depth, double *velocity,
-			int *error);
-int mbsys_simrad3_insert_svp(int verbose, void *mbio_ptr, void *store_ptr,
-			int nsvp,
-			double *depth, double *velocity,
-			int *error);
-int mbsys_simrad3_copy(int verbose, void *mbio_ptr,
-			void *store_ptr, void *copy_ptr,
-			int *error);
-int mbsys_simrad3_makess(int verbose, void *mbio_ptr, void *store_ptr,
-		int pixel_size_set, double *pixel_size,
-		int swath_width_set, double *swath_width,
-		int pixel_int,
-		int *error);
diff --git a/src/mbio/mbsys_singlebeam.c b/src/mbio/mbsys_singlebeam.c
deleted file mode 100644
index 95c89b5..0000000
--- a/src/mbio/mbsys_singlebeam.c
+++ /dev/null
@@ -1,1423 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbsys_singlebeam.c	4/13/99
- *	$Id: mbsys_singlebeam.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1999-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbsys_singlebeam.c contains the functions for handling the data structure
- * used by MBIO functions to store single beam echosounder or navigation data.
- * The data formats which are commonly used to store single beam
- * data in files include
- *      MBF_MGD77DAT : MBIO ID 161
- *      MBF_SIOUWMRG : MBIO ID 162
- *      MBF_LDEOUWDT : MBIO ID 163
- *      MBF_MBARINAV : MBIO ID 164
- *      MBF_MBARIROV : MBIO ID 165
- *      MBF_MBPRONAV : MBIO ID 166
- *      MBF_MBARROV2 : MBIO ID 170
- *
- * Author:	D. W. Caress
- * Date:	April 13,  1999
- *
- * $Log: mbsys_singlebeam.c,v $
- * Revision 5.11  2006/11/10 22:36:05  caress
- * Working towards release 5.1.0
- *
- * Revision 5.10  2006/10/05 18:58:29  caress
- * Changes for 5.1.0beta4
- *
- * Revision 5.9  2005/11/05 00:48:04  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.8  2005/03/25 04:29:56  caress
- * Fixed problem in which sonar depth could be calculated from implausible pressure values in some single beam or navigation formats.
- *
- * Revision 5.7  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.6  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.5  2002/02/22 09:03:43  caress
- * Release 5.0.beta13
- *
- * Revision 5.4  2001/08/25 00:54:13  caress
- * Adding beamwidth values to extract functions.
- *
- * Revision 5.3  2001/07/20  00:32:54  caress
- * Release 5.0.beta03
- *
- * Revision 5.2  2001/03/22  20:50:02  caress
- * Trying to make version 5.0.beta0
- *
- * Revision 5.1  2001/01/22  07:43:34  caress
- * Version 5.0.beta01
- *
- * Revision 5.0  2000/12/01  22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.4  2000/10/11  01:03:21  caress
- * Convert to ANSI C
- *
- * Revision 4.3  2000/09/30  06:32:52  caress
- * Snapshot for Dale.
- *
- * Revision 4.2  1999/10/21  22:40:10  caress
- * Added MBPRONAV format.
- *
- * Revision 4.1  1999/07/16  19:24:15  caress
- * Yet another version.
- *
- *
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mb_define.h"
-#include "mbsys_singlebeam.h"
-
-static char rcs_id[]="$Id: mbsys_singlebeam.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mbsys_singlebeam_alloc(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_singlebeam_alloc";
-	int	status = MB_SUCCESS;
-	struct mbsys_singlebeam_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* allocate memory for data structure */
-	status = mb_malloc(verbose,sizeof(struct mbsys_singlebeam_struct),
-				store_ptr,error);
-
-	/* get data structure pointer */
-	store = (struct mbsys_singlebeam_struct *) *store_ptr;
-
-	/* initialize the structure */
-	store->kind = MB_DATA_NONE;
-	for (i=0;i<8;i++)
-	    store->survey_id[i] = 0;
-	store->time_d = 0.0;
-	for (i=0;i<7;i++)
-	    store->time_i[i] = 0;
-	store->timezone = 0;
-	store->longitude = 0.0;
-	store->latitude = 0.0;
-	store->easting = 0.0;
-	store->northing = 0.0;
-	store->heading = 0.0;
-	store->speed = 0.0;
-	store->nav_type = 9;
-	store->nav_quality = 9;
-	store->gps_quality = 0;
-	store->gps_nsat = 0;
-	store->gps_dilution = 0.0;
-	store->gps_height = 0;
-	store->roll = 0.0;
-	store->pitch = 0.0;
-	store->heave = 0.0;
-	store->rov_pressure = 0.0;
-	store->rov_altitude = 0.0;
-	store->flag = MB_FLAG_NULL;
-	store->tt = 0.0;
-	store->bath = 0.0;
-	store->tide = 0.0;
-	store->bath_corr = 99;
-	store->bath_type = 9;
-	store->mag_tot_1 = 0.0;
-	store->mag_tot_2 = 0.0;
-	store->mag_res = 0.0;
-	store->mag_res_sensor = 9;
-	store->mag_diurnal = 0.0;
-	store->mag_altitude = 0.0;
-	store->mag_qualco = 0;
-	store->gravity = 0.0;
-	store->eotvos = 0.0;
-	store->free_air = 0.0;
-	store->gra_qualco = 0;
-	store->seismic_line = 0;
-	store->seismic_shot = 0;
-	store->position_flag = 0;
-	store->pressure_flag = 0;
-	store->heading_flag = 0;
-	store->altitude_flag = 0;
-	store->attitude_flag = 0;
-	store->portlon = 0.0;
-	store->portlat = 0.0;
-	store->stbdlon = 0.0;
-	store->stbdlat = 0.0;
-	for (i=0;i<MB_COMMENT_MAXLINE;i++)
-	    store->comment[i] = 0;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)*store_ptr);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_singlebeam_deall(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_singlebeam_deall";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)*store_ptr);
-		}
-
-	/* deallocate memory for data structure */
-	status = mb_free(verbose,store_ptr,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_singlebeam_dimensions(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int *nbath, int *namp, int *nss, int *error)
-{
-	char	*function_name = "mbsys_singlebeam_dimensions";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_singlebeam_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_singlebeam_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get beam and pixel numbers */
-		*nbath = 1;
-		*namp = 0;
-		*nss = 0;
-		}
-	else
-		{
-		/* get beam and pixel numbers */
-		*nbath = 0;
-		*namp = 0;
-		*nss = 0;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		fprintf(stderr,"dbg2       nbath:         %d\n",*nbath);
-		fprintf(stderr,"dbg2       namp:          %d\n",*namp);
-		fprintf(stderr,"dbg2       nss:           %d\n",*nss);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_singlebeam_pingnumber(int verbose, void *mbio_ptr,
-		int *pingnumber, int *error)
-{
-	char	*function_name = "mbsys_singlebeam_pingnumber";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_singlebeam_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_singlebeam_struct *) mb_io_ptr->store_data;
-
-	/* extract data from structure */
-	*pingnumber = store->seismic_shot;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       pingnumber: %d\n",*pingnumber);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_singlebeam_segynumber(int verbose, void *mbio_ptr,
-		int *line, int *shot, int *cdp, int *error)
-{
-	char	*function_name = "mbsys_singlebeam_segynumber";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_singlebeam_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_singlebeam_struct *) mb_io_ptr->store_data;
-
-	/* extract data from structure */
-	*line = store->seismic_line;
-	*shot = store->seismic_shot;
-	*cdp = store->seismic_cdp;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       line:       %d\n",*line);
-		fprintf(stderr,"dbg2       shot:       %d\n",*shot);
-		fprintf(stderr,"dbg2       cdp:        %d\n",*cdp);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_singlebeam_extract(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int time_i[7], double *time_d,
-		double *navlon, double *navlat,
-		double *speed, double *heading,
-		int *nbath, int *namp, int *nss,
-		char *beamflag, double *bath, double *amp,
-		double *bathacrosstrack, double *bathalongtrack,
-		double *ss, double *ssacrosstrack, double *ssalongtrack,
-		char *comment, int *error)
-{
-	char	*function_name = "mbsys_singlebeam_extract";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_singlebeam_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_singlebeam_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get time */
-		for (i=0;i<7;i++)
-		    time_i[i] = store->time_i[i];
-		*time_d = store->time_d;
-
-		/* get navigation */
-		*navlon = store->longitude;
-		*navlat = store->latitude;
-
-		/* get heading */
-		*heading = store->heading;
-
-		/* get speed */
-		*speed = store->speed;
-
-		/* set beamwidths in mb_io structure */
-		mb_io_ptr->beamwidth_ltrack = 5.0;
-		mb_io_ptr->beamwidth_xtrack = 5.0;
-
-		/* read distance and depth values into storage arrays */
-		*nbath = 1;
-		*namp = 0;
-		*nss = 0;
-		bath[0] = store->bath;
-		beamflag[0] = store->flag;
-		bathacrosstrack[0] = 0.0;
-		bathalongtrack[0] = 0.0;
-
-		/* print debug statements */
-		if (verbose >= 5)
-			{
-			fprintf(stderr,"\ndbg4  Data extracted by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  Extracted values:\n");
-			fprintf(stderr,"dbg4       kind:       %d\n",
-				*kind);
-			fprintf(stderr,"dbg4       error:      %d\n",
-				*error);
-			fprintf(stderr,"dbg4       time_i[0]:  %d\n",
-				time_i[0]);
-			fprintf(stderr,"dbg4       time_i[1]:  %d\n",
-				time_i[1]);
-			fprintf(stderr,"dbg4       time_i[2]:  %d\n",
-				time_i[2]);
-			fprintf(stderr,"dbg4       time_i[3]:  %d\n",
-				time_i[3]);
-			fprintf(stderr,"dbg4       time_i[4]:  %d\n",
-				time_i[4]);
-			fprintf(stderr,"dbg4       time_i[5]:  %d\n",
-				time_i[5]);
-			fprintf(stderr,"dbg4       time_i[6]:  %d\n",
-				time_i[6]);
-			fprintf(stderr,"dbg4       time_d:     %f\n",
-				*time_d);
-			fprintf(stderr,"dbg4       longitude:  %f\n",
-				*navlon);
-			fprintf(stderr,"dbg4       latitude:   %f\n",
-				*navlat);
-			fprintf(stderr,"dbg4       speed:      %f\n",
-				*speed);
-			fprintf(stderr,"dbg4       heading:    %f\n",
-				*heading);
-			fprintf(stderr,"dbg4       nbath:      %d\n",
-				*nbath);
-			for (i=0;i<*nbath;i++)
-			  fprintf(stderr,"dbg4       beam:%2d  flag:%3d  bath:%f  bathdist:%f\n",
-				i,beamflag[i],bath[i],bathacrosstrack[i]);
-			}
-
-		/* done translating values */
-
-		}
-
-	/* extract comment from structure */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* copy comment */
-		strcpy(comment,store->comment);
-
-		/* print debug statements */
-		if (verbose >= 4)
-			{
-			fprintf(stderr,"\ndbg4  New ping read by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  New ping values:\n");
-			fprintf(stderr,"dbg4       error:      %d\n",
-				*error);
-			fprintf(stderr,"dbg4       comment:    %s\n",
-				comment);
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind == MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"dbg2       comment:     \ndbg2       %s\n",
-			comment);
-		}
-	else if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind != MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"dbg2       time_i[0]:     %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:     %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:     %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:     %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:     %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:     %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:     %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:        %f\n",*time_d);
-		fprintf(stderr,"dbg2       longitude:     %f\n",*navlon);
-		fprintf(stderr,"dbg2       latitude:      %f\n",*navlat);
-		fprintf(stderr,"dbg2       speed:         %f\n",*speed);
-		fprintf(stderr,"dbg2       heading:       %f\n",*heading);
-		}
-	if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind == MB_DATA_DATA)
-		{
-		fprintf(stderr,"dbg2       nbath:         %d\n",*nbath);
-		for (i=0;i<*nbath;i++)
-		  fprintf(stderr,"dbg2       beam:%2d  flag:%3d  bath:%f  bathdist:%f\n",
-			i,beamflag[i],bath[i],bathacrosstrack[i]);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_singlebeam_insert(int verbose, void *mbio_ptr, void *store_ptr,
-		int kind, int time_i[7], double time_d,
-		double navlon, double navlat,
-		double speed, double heading,
-		int nbath, int namp, int nss,
-		char *beamflag, double *bath, double *amp,
-		double *bathacrosstrack, double *bathalongtrack,
-		double *ss, double *ssacrosstrack, double *ssalongtrack,
-		char *comment, int *error)
-{
-	char	*function_name = "mbsys_singlebeam_insert";
-	int	status = MB_SUCCESS;
-	struct mbsys_singlebeam_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       kind:       %d\n",kind);
-		}
-	if (verbose >= 2 && kind == MB_DATA_DATA)
-		{
-		fprintf(stderr,"dbg2       time_i[0]:  %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:  %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:  %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:  %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:  %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:  %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:  %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:     %f\n",time_d);
-		fprintf(stderr,"dbg2       navlon:     %f\n",navlon);
-		fprintf(stderr,"dbg2       navlat:     %f\n",navlat);
-		fprintf(stderr,"dbg2       speed:      %f\n",speed);
-		fprintf(stderr,"dbg2       heading:    %f\n",heading);
-		fprintf(stderr,"dbg2       nbath:      %d\n",nbath);
-		if (verbose >= 3)
-		 for (i=0;i<nbath;i++)
-		  fprintf(stderr,"dbg3       flag[%d]: %d  bath[%d]: %f  bathdist[%d]: %f\n",
-			i,beamflag[i],i,bath[i],i,bathacrosstrack[i]);
-		fprintf(stderr,"dbg2       namp:       %d\n",namp);
-		if (verbose >= 3)
-		 for (i=0;i<namp;i++)
-		  fprintf(stderr,"dbg3        amp[%d]: %f\n",
-			i,amp[i]);
-		fprintf(stderr,"dbg2        nss:       %d\n",nss);
-		if (verbose >= 3)
-		 for (i=0;i<nss;i++)
-		  fprintf(stderr,"dbg3        ss[%d]: %f    ssdist[%d]: %f\n",
-			i,ss[i],i,ssacrosstrack[i]);
-		}
-	if (verbose >= 2 && kind == MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"dbg2       comment:     \ndbg2       %s\n",
-			comment);
-		}
-
-	/* get data structure pointer */
-	store = (struct mbsys_singlebeam_struct *) store_ptr;
-
-	/* set data kind */
-	store->kind = kind;
-
-	/* insert data in structure */
-	if (store->kind == MB_DATA_DATA)
-		{
-		/* get time */
-		for (i=0;i<7;i++)
-		    store->time_i[i] = time_i[i];
-		store->time_d = time_d;
-
-		/* get navigation */
-		if (store->longitude != navlon
-		    || store->latitude != navlat)
-		    {
-		    store->easting = 0.0;
-		    store->northing = 0.0;
-		    }
-		store->longitude = navlon;
-		store->latitude = navlat;
-
-		/* get heading */
-		store->heading = heading;
-
-		/* get speed */
-		store->speed = speed;
-
-		/* put distance and depth values */
-		store->bath = bath[0];
-		store->flag = beamflag[0];
-		}
-
-	/* insert comment in structure */
-	else if (store->kind == MB_DATA_COMMENT)
-		{
-		strcpy(store->comment,comment);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_singlebeam_ttimes(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, int *nbeams,
-	double *ttimes, double *angles,
-	double *angles_forward, double *angles_null,
-	double *heave, double *alongtrack_offset,
-	double *draft, double *ssv, int *error)
-{
-	char	*function_name = "mbsys_singlebeam_ttimes";
-	int	status = MB_SUCCESS;
-	struct mbsys_singlebeam_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       ttimes:     %p\n",(void *)ttimes);
-		fprintf(stderr,"dbg2       angles_xtrk:%p\n",(void *)angles);
-		fprintf(stderr,"dbg2       angles_ltrk:%p\n",(void *)angles_forward);
-		fprintf(stderr,"dbg2       angles_null:%p\n",(void *)angles_null);
-		fprintf(stderr,"dbg2       heave:      %p\n",(void *)heave);
-		fprintf(stderr,"dbg2       ltrk_off:   %p\n",(void *)alongtrack_offset);
-		}
-
-	/* get data structure pointer */
-	store = (struct mbsys_singlebeam_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get nbeams */
-		*nbeams = 1;
-
-		/* get travel times, angles */
-		ttimes[0] = store->tt;
-		angles[0] = 0.0;
-		angles_forward[0] = 0.0;
-		angles_null[0] = 0.0;
-		heave[0] = store->heave;
-		alongtrack_offset[0] = 0.0;
-
-		/* get ssv */
-		*ssv = 0.0;
-
-		/* get draft */
-		if (store->sonar_depth <= 0.0
-		    && store->rov_pressure > 0.0)
-		    mbsys_singlebeam_pressuredepth(verbose,
-						    store->rov_pressure,
-						    store->latitude,
-						    &store->sonar_depth,
-						    error);
-		*draft = store->sonar_depth;
-
-		/* set status */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error == MB_ERROR_NO_ERROR)
-		{
-		fprintf(stderr,"dbg2       draft:      %f\n",*draft);
-		fprintf(stderr,"dbg2       ssv:        %f\n",*ssv);
-		fprintf(stderr,"dbg2       nbeams:     %d\n",*nbeams);
-		for (i=0;i<*nbeams;i++)
-			fprintf(stderr,"dbg2       beam %d: tt:%f  angle_xtrk:%f  angle_ltrk:%f  angle_null:%f  heave:%f  ltrk_off:%f\n",
-				i,ttimes[i],angles[i],
-				angles_forward[i],angles_null[i],
-				heave[i],alongtrack_offset[i]);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_singlebeam_detects(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, int *nbeams,
-	int *detects, int *error)
-{
-	char	*function_name = "mbsys_singlebeam_detects";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_singlebeam_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       detects:    %p\n",(void *)detects);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_singlebeam_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get nbeams */
-		*nbeams = 1;
-
-		/* get detects */
-		for (i=0;i<*nbeams;i++)
-			{
-			detects[i] = MB_DETECT_UNKNOWN;
-			}
-
-		/* set status */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error == MB_ERROR_NO_ERROR)
-		{
-		fprintf(stderr,"dbg2       nbeams:     %d\n",*nbeams);
-		for (i=0;i<*nbeams;i++)
-			fprintf(stderr,"dbg2       beam %d: detects:%d\n",
-				i,detects[i]);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_singlebeam_extract_altitude(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, double *transducer_depth, double *altitude,
-	int *error)
-{
-	char	*function_name = "mbsys_singlebeam_extract_altitude";
-	int	status = MB_SUCCESS;
-	struct mbsys_singlebeam_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get data structure pointer */
-	store = (struct mbsys_singlebeam_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		*altitude = 0.0;
-		*transducer_depth = 0.0;
-		if (store->sonar_depth <= 0.0
-		    && store->rov_pressure > 0.0)
-		    mbsys_singlebeam_pressuredepth(verbose,
-						    store->rov_pressure,
-						    store->latitude,
-						    &store->sonar_depth,
-						    error);
-		if (store->rov_altitude > 0.0)
-		    {
-		    *altitude = store->rov_altitude;
-		    if (store->sonar_depth > 0.0)
-			*transducer_depth = store->sonar_depth;
-		    else if (store->bath != 0.0)
-			*transducer_depth = store->bath - store->rov_altitude;
-		    }
-		else if (store->sonar_depth > 0.0)
-		    {
-		    *transducer_depth = store->sonar_depth;
-		    if (store->bath > 0.0)
-			*altitude = store->bath - store->sonar_depth;
-		    }
-		else if (store->bath > 0.0 && store->flag != MB_FLAG_NULL)
-		    {
-		    *altitude = store->bath - store->heave;
-		    *transducer_depth = store->heave;
-		    }
-		else
-		    {
-		    *altitude = 0.0;
-		    *transducer_depth = store->heave;
-		    }
-
-		/* set status */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:              %d\n",*kind);
-		fprintf(stderr,"dbg2       transducer_depth:  %f\n",*transducer_depth);
-		fprintf(stderr,"dbg2       altitude:          %f\n",*altitude);
-		fprintf(stderr,"dbg2       error:             %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:            %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_singlebeam_extract_nav(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int time_i[7], double *time_d,
-		double *navlon, double *navlat,
-		double *speed, double *heading, double *draft,
-		double *roll, double *pitch, double *heave,
-		int *error)
-{
-	char	*function_name = "mbsys_singlebeam_extract_nav";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_singlebeam_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_singlebeam_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get time */
-		for (i=0;i<7;i++)
-		    time_i[i] = store->time_i[i];
-		*time_d = store->time_d;
-
-		/* get navigation */
-		*navlon = store->longitude;
-		*navlat = store->latitude;
-
-		/* get heading */
-		*heading = store->heading;
-
-		/* get speed */
-		*speed = store->speed;
-
-		/* get draft */
-		if (store->sonar_depth <= 0.0
-		    && store->rov_pressure > 0.0)
-		    mbsys_singlebeam_pressuredepth(verbose,
-						    store->rov_pressure,
-						    store->latitude,
-						    &store->sonar_depth,
-						    error);
-		*draft = store->sonar_depth;
-
-		/* get roll pitch and heave */
-		*roll = store->roll;
-		*pitch = store->pitch;
-		*heave = store->heave;
-
-		/* print debug statements */
-		if (verbose >= 5)
-			{
-			fprintf(stderr,"\ndbg4  Data extracted by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  Extracted values:\n");
-			fprintf(stderr,"dbg4       kind:       %d\n",
-				*kind);
-			fprintf(stderr,"dbg4       error:      %d\n",
-				*error);
-			fprintf(stderr,"dbg4       time_i[0]:  %d\n",
-				time_i[0]);
-			fprintf(stderr,"dbg4       time_i[1]:  %d\n",
-				time_i[1]);
-			fprintf(stderr,"dbg4       time_i[2]:  %d\n",
-				time_i[2]);
-			fprintf(stderr,"dbg4       time_i[3]:  %d\n",
-				time_i[3]);
-			fprintf(stderr,"dbg4       time_i[4]:  %d\n",
-				time_i[4]);
-			fprintf(stderr,"dbg4       time_i[5]:  %d\n",
-				time_i[5]);
-			fprintf(stderr,"dbg4       time_i[6]:  %d\n",
-				time_i[6]);
-			fprintf(stderr,"dbg4       time_d:     %f\n",
-				*time_d);
-			fprintf(stderr,"dbg4       longitude:  %f\n",
-				*navlon);
-			fprintf(stderr,"dbg4       latitude:   %f\n",
-				*navlat);
-			fprintf(stderr,"dbg4       speed:      %f\n",
-				*speed);
-			fprintf(stderr,"dbg4       heading:    %f\n",
-				*heading);
-			fprintf(stderr,"dbg4       roll:       %f\n",
-				*roll);
-			fprintf(stderr,"dbg4       pitch:      %f\n",
-				*pitch);
-			fprintf(stderr,"dbg4       heave:      %f\n",
-				*heave);
-			}
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind == MB_DATA_DATA)
-		{
-		fprintf(stderr,"dbg2       time_i[0]:     %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:     %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:     %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:     %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:     %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:     %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:     %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:        %f\n",*time_d);
-		fprintf(stderr,"dbg2       longitude:     %f\n",*navlon);
-		fprintf(stderr,"dbg2       latitude:      %f\n",*navlat);
-		fprintf(stderr,"dbg2       speed:         %f\n",*speed);
-		fprintf(stderr,"dbg2       heading:       %f\n",*heading);
-		fprintf(stderr,"dbg2       draft:         %f\n",*draft);
-		fprintf(stderr,"dbg2       roll:          %f\n",*roll);
-		fprintf(stderr,"dbg2       pitch:         %f\n",*pitch);
-		fprintf(stderr,"dbg2       heave:         %f\n",*heave);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_singlebeam_insert_nav(int verbose, void *mbio_ptr, void *store_ptr,
-		int time_i[7], double time_d,
-		double navlon, double navlat,
-		double speed, double heading, double draft,
-		double roll, double pitch, double heave,
-		int *error)
-{
-	char	*function_name = "mbsys_singlebeam_insert_nav";
-	int	status = MB_SUCCESS;
-	struct mbsys_singlebeam_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       time_i[0]:  %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:  %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:  %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:  %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:  %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:  %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:  %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:     %f\n",time_d);
-		fprintf(stderr,"dbg2       navlon:     %f\n",navlon);
-		fprintf(stderr,"dbg2       navlat:     %f\n",navlat);
-		fprintf(stderr,"dbg2       speed:      %f\n",speed);
-		fprintf(stderr,"dbg2       heading:    %f\n",heading);
-		fprintf(stderr,"dbg2       draft:      %f\n",draft);
-		fprintf(stderr,"dbg2       roll:       %f\n",roll);
-		fprintf(stderr,"dbg2       pitch:      %f\n",pitch);
-		fprintf(stderr,"dbg2       heave:      %f\n",heave);
-		}
-
-	/* get data structure pointer */
-	store = (struct mbsys_singlebeam_struct *) store_ptr;
-
-	/* insert data in structure */
-	if (store->kind == MB_DATA_DATA)
-		{
-		/* get time */
-		for (i=0;i<7;i++)
-		    store->time_i[i] = time_i[i];
-		store->time_d = time_d;
-
-		/* get navigation */
-		if (store->longitude != navlon
-		    || store->latitude != navlat)
-		    {
-		    store->easting = 0.0;
-		    store->northing = 0.0;
-		    }
-		store->longitude = navlon;
-		store->latitude = navlat;
-
-		/* get heading */
-		store->heading = heading;
-
-		/* get speed */
-		store->speed = speed;
-
-		/* get draft */
-		store->sonar_depth = draft;
-
-		/* get roll pitch and heave */
-		store->roll = roll;
-		store->pitch = pitch;
-		store->heave = heave;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_singlebeam_swathbounds(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, double *portlon, double *portlat,
-			double *stbdlon, double *stbdlat,
-			int *error)
-{
-	char	*function_name = "mbsys_singlebeam_swathbounds";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_singlebeam_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_singlebeam_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get swathbounds */
-		*portlon = store->portlon;
-		*portlat = store->portlat;
-		*stbdlon = store->stbdlon;
-		*stbdlat = store->stbdlat;
-		mb_apply_lonflip(verbose, mb_io_ptr->lonflip, portlon);
-		mb_apply_lonflip(verbose, mb_io_ptr->lonflip, stbdlon);
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind == MB_DATA_DATA)
-		{
-		fprintf(stderr,"dbg2       portlon:  %f\n",*portlon);
-		fprintf(stderr,"dbg2       portlat:  %f\n",*portlat);
-		fprintf(stderr,"dbg2       stbdlon:  %f\n",*stbdlon);
-		fprintf(stderr,"dbg2       stbdlat:  %f\n",*stbdlat);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:          %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:         %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_singlebeam_copy(int verbose, void *mbio_ptr,
-			void *store_ptr, void *copy_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_singlebeam_copy";
-	int	status = MB_SUCCESS;
-	struct mbsys_singlebeam_struct *store;
-	struct mbsys_singlebeam_struct *copy;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       copy_ptr:   %p\n",(void *)copy_ptr);
-		}
-
-	/* get data structure pointers */
-	store = (struct mbsys_singlebeam_struct *) store_ptr;
-	copy = (struct mbsys_singlebeam_struct *) copy_ptr;
-
-	/* copy the data */
-	*copy = *store;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_singlebeam_pressuredepth(int verbose,
-			double pressure, double latitude,
-			double *depth,
-			int *error)
-{
-	char	*function_name = "mbsys_singlebeam_pressuredepth";
-	int	status = MB_SUCCESS;
-	double	phi, sinphi, sinphi2, denom, numer;
-#define C0  5.2788e-3;
-#define C1  2.36e-5;
-#define C3  1.092e-6;
-#define C4  -1.82e-15;
-#define C5  2.279e-10;
-#define C6  2.2512e-5;
-#define C7  9.72659;
-
- 	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       pressure:   %f\n",pressure);
-		fprintf(stderr,"dbg2       latitude:   %f\n",latitude);
-		}
-
-	/* calculate depth in m from pressure in dBars */
-	if (pressure > 0.0)
-		{
-		phi = DTR * latitude;
-		sinphi  = sin(phi);
-		sinphi2= sinphi * sinphi;
- 		denom = 9.780318 * (1.0 + (5.2788e-3
-				    + 2.36e-5 * sinphi2) * sinphi2)
-					+ 1.092e-6 * pressure;
-		numer = (((-1.82e-15 * pressure + 2.279e-10) * pressure
-			    - 2.2512e-5) * pressure + 9.72659) * pressure;
-		*depth = denom / numer;
-		}
-	else
-		*depth = 0.0;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       depth:      %f\n",*depth);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mbsys_singlebeam.h b/src/mbio/mbsys_singlebeam.h
deleted file mode 100644
index c8f9dbb..0000000
--- a/src/mbio/mbsys_singlebeam.h
+++ /dev/null
@@ -1,332 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbsys_singlebeam.h	4/13/93
- *	$Id: mbsys_singlebeam.h 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1999-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbsys_singlebeam.h defines the data structures used by MBIO functions
- * to store single beam echosounder or navigation data.
- * The data formats which are commonly used to store single beam
- * data in files include
- *      MBF_MGD77DAT : MBIO ID 161
- *      MBF_SIOUWMRG : MBIO ID 162
- *      MBF_LDEOUWDT : MBIO ID 163
- *      MBF_MBARINAV : MBIO ID 164
- *      MBF_MBARIROV : MBIO ID 165
- *      MBF_MBPRONAV : MBIO ID 166
- *      MBF_MBARROV2 : MBIO ID 170
- *
- * Author:	D. W. Caress
- * Date:	April 13,  1999
- *
- * $Log: mbsys_singlebeam.h,v $
- * Revision 5.8  2006/11/10 22:36:05  caress
- * Working towards release 5.1.0
- *
- * Revision 5.7  2006/10/05 18:58:29  caress
- * Changes for 5.1.0beta4
- *
- * Revision 5.6  2005/11/05 00:48:05  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.5  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.4  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.3  2001/07/20 00:32:54  caress
- * Release 5.0.beta03
- *
- * Revision 5.2  2001/03/22  20:50:02  caress
- * Trying to make version 5.0.beta0
- *
- * Revision 5.1  2001/01/22  07:43:34  caress
- * Version 5.0.beta01
- *
- * Revision 5.0  2000/12/01  22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.3  2000/09/30  06:31:19  caress
- * Snapshot for Dale.
- *
- * Revision 4.2  1999/10/21  22:40:10  caress
- * Added MBPRONAV format.
- *
- * Revision 4.1  1999/07/16  19:24:15  caress
- * Yet another version.
- *
- *
- *
- */
-/*
- * Notes on the MBSYS_SINGLEBEAM data structure:
- *   1. The single beam formats are intended to support
- *      true single beam formats, marine geophysical underway
- *      data formats, and navigation formats. These formats
- *      in some cases support magnetics and gravity data.
- *   2. With MB-System 5.1, the mbf_mbpronav format has been
- *      extended to include min and max acrosstrack distances
- *      of non-null data for both bathymetry beams and
- *      sidescan pixels. This allows these values to be included
- *      in the *.fnv files and supports mbgrdviz and mbproject.
- *      These values are accessed by a special function
- *      mbsys_singlebeam_swathbounds().
- */
-
-struct mbsys_singlebeam_struct
-	{
-	/* type of data record */
-	int	kind;
-
-	/* survey id */
-	char	survey_id[8];
-			    /* Identifier supplied by the contributing
-				 organization, else given by NGDC in
-				 a manner which represents the data. */
-
-	/* time stamp */
-	double	time_d;
-	int	time_i[7];
-	int	timezone;   /* Corrects time (in characters 13-27)
-				 to GMT when added: equals zero when
-				 time is GMT.  Timezone normally falls
-				 between -13 and +12 inclusively. */
-	/* navigation */
-	double	longitude;
-	double	latitude;
-	double	easting;
-	double	northing;
-	double	heading;    /* degrees */
-	double	speed;	    /* km/hr */
-	int	nav_type;   /* Indicates how lat/lon was obtained:
-				1 = Observed fix
-				3 = Interpolated
-				9 = Unspecified	*/
-	int	nav_quality;
-			    /* QUALITY CODE FOR NAVIGATION -
-                             5 - Suspected, by the
-                                 originating institution
-                             6 - Suspected, by the data
-                                 center
-                             9 - No identifiable problem
-                                 found */
-	int	gps_quality;	/* R2Rnav GPS quality using NMEA-0183 definition:
-					The National Marine Electronics Association
-					has defined the following indicator:
-						0 = fix not available or invalid
-						1 = GPS Standard Positioning Service (SPS) mode, fix valid
-						2 = differential GPS, SPS mode, fix valid
-						3 = GPS Precise Positioning Service (PPS) mode, fix valid
-							values for the GPS quality
-						4 = Real Time Kinematic (RTK). Satellite system used in
-							RTK mode with fixed integers
-						5 = Float RTK. Satellite system used in RTK mode with
-							floating integers
-						6 = Estimated (dead reckoning) mode
-						7 = Manual input mode
-						8 = Simulator mode */
-	int	gps_nsat;	/* R2Rnav GPS height (m) */
-	double	gps_dilution;	/* R2Rnav GPS height (m) */
-	int	gps_height;	/* R2Rnav GPS height (m) */
-
-	/* motion sensor data */
-	double	roll;
-	double	pitch;
-	double	heave;		/* heave or rov depth in m */
-
-	/* submersible/ROV data */
-	double	sonar_depth;	/* platform depth in m */
-	double	rov_pressure;	/* platform pressure in decibar */
-	double	rov_altitude;	/* altitude above seafloor in m */
-
-	/* bathymetry */
-	int	flag;	    /* MB-System style beamflag */
-	double	tt;	    /* two way travel time in sec */
-	double	bath;	    /* corrected depth in m */
-	double	tide;	    /* tidal correction in m */
-	int	bath_corr;  /* BATHYMETRIC CORRECTION CODE
-			       This code details the procedure
-			       used for determining the sound
-			       velocity correction to depth:
-				01-55  Matthews' Zones with zone
-				59     Matthews' Zones, no zone
-				60     S. Kuwahara Formula
-				61     Wilson Formula
-				62     Del Grosso Formula
-				63     Carter's Tables
-				88     Other (see Add. Doc.)
-				99     Unspecified */
-	int	bath_type;  /* BATHYMETRIC TYPE CODE
-				 Indicates how the data record's
-				 bathymetric value was obtained:
-				 1 =    Observed
-				 3 =    Interpolated
-				 9 =    Unspecified */
-
-	/* magnetics */
-	double	mag_tot_1;  /* MAGNETICS TOTAL FIELD, 1ST SENSOR
-				In tenths of nanoteslas (gammas).
-				For leading sensor.  Use this field
-				for single sensor. */
-	double	mag_tot_2;  /* MAGNETICS TOTAL FIELD, 2ND SENSOR
-				In tenths of nanoteslas (gammas).
-				For trailing sensor. */
-	double	mag_res;    /* MAGNETICS RESIDUAL FIELD
-				In tenths of nanoteslas (gammas). */
-	int	mag_res_sensor;
-			    /* SENSOR FOR RESIDUAL FIELD
-				1 = 1st or leading sensor
-				2 = 2nd or trailing sensor
-				9 = Unspecified */
-	double	mag_diurnal;
-			    /* MAGNETICS DIURNAL CORRECTION -
-				In tenths of nanoteslas (gammas).
-				(In nanoteslas) if 9-filled
-				(i.e., set to "+9999"), total
-				and residual fields are assumed
-				to be uncorrected; if used,
-				total and residuals are assumed
-				to have been already corrected. */
-	double	mag_altitude;
-			    /* DEPTH OR ALTITUDE OF MAGNETICS SENSOR
-				In meters.
-				+ = Below sealevel
-				- = Above sealevel */
-	int	mag_qualco; /* quality code for magnetics 
- 						1 – good
- 						2 – fair
- 						3 – poor
- 						4 – bad
- 						5 – suspected bad by contributor
- 						6 – suspected bad by data center
- 						nil - unspecified  */
-
-	/* gravity */
-	double	gravity;    /* OBSERVED GRAVITY
-                             In milligals.
-                             Corrected for Eotvos, drift, and
-                             tares */
-	double	eotvos;	    /* EOTVOS CORRECTION
-                             In milligals.
-                             E = 7.5 V cos phi sin alpha +
-                             0.0042 V*V */
-	double	free_air;   /* FREE-AIR ANOMALY
-                             In milligals.
-                             Free-air Anomaly = G(observed) -
-                             G(theoretical) */
- 	int	gra_qualco; /* quality code for gravity 
- 						1 – good
- 						2 – fair
- 						3 – poor
- 						4 – bad
- 						5 – suspected bad by contributor
- 						6 – suspected bad by data center
- 						nil - unspecified  */
-
-	/* seismic */
-	int	seismic_line;
-			    /* SEISMIC LINE NUMBER
-                             Used for cross referencing with
-                             seismic data. */
-	int	seismic_shot;
-			    /* SEISMIC SHOT-POINT NUMBER */
-	int	seismic_cdp;
-			    /* SEISMIC CDP-POINT NUMBER */
-
-	/* ship navigation */
-	double	ship_longitude;	/* degrees */
-	double	ship_latitude;	/* degrees */
-	double	ship_heading;	/* degrees */
-
-	/* flags */
-	int	position_flag;
-	int	pressure_flag;
-	int	heading_flag;
-	int	altitude_flag;
-	int	attitude_flag;
-	int	qc_flag;
-
-	/* swathbounds */
-	double	portlon;
-	double	portlat;
-	double	stbdlon;
-	double	stbdlat;
-
-	/* comment */
-	char	comment[MB_COMMENT_MAXLINE];
-	};
-
-
-/* system specific function prototypes */
-int mbsys_singlebeam_alloc(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error);
-int mbsys_singlebeam_deall(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error);
-int mbsys_singlebeam_dimensions(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int *nbath, int *namp, int *nss, int *error);
-int mbsys_singlebeam_pingnumber(int verbose, void *mbio_ptr,
-			int *pingnumber, int *error);
-int mbsys_singlebeam_segynumber(int verbose, void *mbio_ptr,
-			int *line, int *shot, int *cdp, int *error);
-int mbsys_singlebeam_extract(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int time_i[7], double *time_d,
-			double *navlon, double *navlat,
-			double *speed, double *heading,
-			int *nbath, int *namp, int *nss,
-			char *beamflag, double *bath, double *amp,
-			double *bathacrosstrack, double *bathalongtrack,
-			double *ss, double *ssacrosstrack, double *ssalongtrack,
-			char *comment, int *error);
-int mbsys_singlebeam_insert(int verbose, void *mbio_ptr, void *store_ptr,
-			int kind, int time_i[7], double time_d,
-			double navlon, double navlat,
-			double speed, double heading,
-			int nbath, int namp, int nss,
-			char *beamflag, double *bath, double *amp,
-			double *bathacrosstrack, double *bathalongtrack,
-			double *ss, double *ssacrosstrack, double *ssalongtrack,
-			char *comment, int *error);
-int mbsys_singlebeam_ttimes(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int *nbeams,
-			double *ttimes, double *angles,
-			double *angles_forward, double *angles_null,
-			double *heave, double *alongtrack_offset,
-			double *draft, double *ssv, int *error);
-int mbsys_singlebeam_detects(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int *nbeams, int *detects, int *error);
-int mbsys_singlebeam_extract_altitude(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, double *transducer_depth, double *altitude,
-			int *error);
-int mbsys_singlebeam_extract_nav(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int time_i[7], double *time_d,
-			double *navlon, double *navlat,
-			double *speed, double *heading, double *draft,
-			double *roll, double *pitch, double *heave,
-			int *error);
-int mbsys_singlebeam_insert_nav(int verbose, void *mbio_ptr, void *store_ptr,
-			int time_i[7], double time_d,
-			double navlon, double navlat,
-			double speed, double heading, double draft,
-			double roll, double pitch, double heave,
-			int *error);
-int mbsys_singlebeam_swathbounds(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, double *portlon, double *portlat,
-			double *stbdlon, double *stbdlat,
-			int *error);
-int mbsys_singlebeam_copy(int verbose, void *mbio_ptr,
-			void *store_ptr, void *copy_ptr,
-			int *error);
-int mbsys_singlebeam_pressuredepth(int verbose,
-			double pressure, double latitude,
-			double *depth,
-			int *error);
diff --git a/src/mbio/mbsys_stereopair.c b/src/mbio/mbsys_stereopair.c
deleted file mode 100644
index 6e0eacb..0000000
--- a/src/mbio/mbsys_stereopair.c
+++ /dev/null
@@ -1,1575 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbsys_stereopair.c	3.00	11/22/2014
- *	$Id: mbsys_stereopair.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 2014-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbsys_stereopair.c contains the MBIO functions for handling data from
- * the following data formats:
- *    MBSYS_STEREOPAIR formats (code in mbsys_stereopair.c and mbsys_stereopair.h):
- *      MBF_PHOTGRAM : MBIO ID ??? (code in mbr_photgram.c)
- *
- * Author:	D. W. Caress
- * Date:	November 22, 2014
- *
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mb_define.h"
-#include "mbsys_stereopair.h"
-
-static char version_id[]="$Id: mbsys_stereopair.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mbsys_stereopair_alloc(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_stereopair_alloc";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_stereopair_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",version_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* allocate memory for data structure */
-	status = mb_mallocd(verbose, __FILE__, __LINE__, sizeof(struct mbsys_stereopair_struct),
-				(void **)store_ptr, error);
-
-	/* get data structure pointer */
-	store = (struct mbsys_stereopair_struct *) *store_ptr;
-
-	/* initialize data record */
-	memset(*store_ptr, 0, sizeof(struct mbsys_stereopair_struct));
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)*store_ptr);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_stereopair_deall(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_stereopair_deall";
-	int	status = MB_SUCCESS;
-	struct mbsys_stereopair_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",version_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)*store_ptr);
-		}
-
-	/* get data structure pointer */
-	store = (struct mbsys_stereopair_struct *) *store_ptr;
-	
-	/* deallocate any arrays or structures contained within the store data structure */
-	if (store->num_soundings_alloc > 0 && store->soundings != NULL)
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)(&store->soundings),error);
-
-	/* deallocate memory for data structure */
-	status = mb_freed(verbose,__FILE__,__LINE__,(void **)store_ptr,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbsys_stereopair_dimensions(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int *nbath, int *namp, int *nss, int *error)
-{
-	char	*function_name = "mbsys_stereopair_dimensions";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_stereopair_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",version_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_stereopair_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get beam and pixel numbers */
-		*nbath = store->num_soundings;
-		*namp = 0;
-		*nss = 0;
-		}
-	else
-		{
-		/* get beam and pixel numbers */
-		*nbath = 0;
-		*namp = 0;
-		*nss = 0;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		fprintf(stderr,"dbg2       nbath:      %d\n",*nbath);
-		fprintf(stderr,"dbg2        namp:      %d\n",*namp);
-		fprintf(stderr,"dbg2        nss:       %d\n",*nss);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_stereopair_pingnumber(int verbose, void *mbio_ptr,
-		int *pingnumber, int *error)
-{
-	char	*function_name = "mbsys_stereopair_pingnumber";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_stereopair_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",version_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_stereopair_struct *) mb_io_ptr->store_data;
-
-	/* extract data from structure */
-	*pingnumber = 0;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       pingnumber: %d\n",*pingnumber);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_stereopair_sonartype(int verbose, void *mbio_ptr, void *store_ptr,
-		int *sonartype, int *error)
-{
-	char	*function_name = "mbsys_stereopair_sonartype";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_stereopair_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",version_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_stereopair_struct *) store_ptr;
-
-	/* get sonar type */
-	*sonartype = MB_TOPOGRAPHY_TYPE_CAMERA;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       sonartype:  %d\n",*sonartype);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_stereopair_sidescantype(int verbose, void *mbio_ptr, void *store_ptr,
-		int *ss_type, int *error)
-{
-	char	*function_name = "mbsys_stereopair_sidescantype";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_stereopair_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",version_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_stereopair_struct *) store_ptr;
-
-	/* get sidescan type */
-	*ss_type = MB_SIDESCAN_LINEAR;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       ss_type:    %d\n",*ss_type);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_stereopair_extract(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int time_i[7], double *time_d,
-		double *navlon, double *navlat,
-		double *speed, double *heading,
-		int *nbath, int *namp, int *nss,
-		char *beamflag, double *bath, double *amp,
-		double *bathacrosstrack, double *bathalongtrack,
-		double *ss, double *ssacrosstrack, double *ssalongtrack,
-		char *comment, int *error)
-{
-	char	*function_name = "mbsys_stereopair_extract";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_stereopair_struct *store;
-	struct mbsys_stereopair_sounding_struct *sounding;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",version_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_stereopair_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get time */
-		*time_d = store->time_d;
-		mb_get_date(verbose, *time_d, time_i);
-
-		/* get navigation */
-		*navlon = store->longitude;
-		*navlat = store->latitude;
-
-		/* get speed */
-		*speed = 3.6 * store->speed;
-
-		/* get heading */
-		*heading = store->heading;
-
-		/* set beamwidths in mb_io structure */
-		mb_io_ptr->beamwidth_xtrack = 0.0;
-		mb_io_ptr->beamwidth_ltrack = 0.0;
-
-		/* read distance and depth values into storage arrays */
-		*nbath = store->num_soundings;
-		*namp = 0;
-		for (i=0;i<*nbath;i++)
-			{
-			sounding = (struct mbsys_stereopair_sounding_struct *) &store->soundings[i];
-			bath[i] = sounding->depth + store->sensordepth;
-			beamflag[i] = sounding->beamflag;
-			bathacrosstrack[i] = sounding->acrosstrack;
-			bathalongtrack[i] = sounding->alongtrack;
-			}
-
-		/* extract sidescan */
-		*nss = 0;
-		//for (i=0;i<store->number_pixels;i++)
-		//	{
-		//	}
-
-		/* print debug statements */
-		if (verbose >= 5)
-			{
-			fprintf(stderr,"\ndbg4  Data extracted by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  Extracted values:\n");
-			fprintf(stderr,"dbg4       kind:       %d\n", *kind);
-			fprintf(stderr,"dbg4       error:      %d\n", *error);
-			fprintf(stderr,"dbg4       time_i[0]:  %d\n", time_i[0]);
-			fprintf(stderr,"dbg4       time_i[1]:  %d\n", time_i[1]);
-			fprintf(stderr,"dbg4       time_i[2]:  %d\n", time_i[2]);
-			fprintf(stderr,"dbg4       time_i[3]:  %d\n", time_i[3]);
-			fprintf(stderr,"dbg4       time_i[4]:  %d\n", time_i[4]);
-			fprintf(stderr,"dbg4       time_i[5]:  %d\n", time_i[5]);
-			fprintf(stderr,"dbg4       time_i[6]:  %d\n", time_i[6]);
-			fprintf(stderr,"dbg4       time_d:     %f\n", *time_d);
-			fprintf(stderr,"dbg4       longitude:  %f\n", *navlon);
-			fprintf(stderr,"dbg4       latitude:   %f\n", *navlat);
-			fprintf(stderr,"dbg4       speed:      %f\n", *speed);
-			fprintf(stderr,"dbg4       heading:    %f\n", *heading);
-			fprintf(stderr,"dbg4       nbath:      %d\n", *nbath);
-			for (i=0;i<*nbath;i++)
-			  fprintf(stderr,"dbg4       beam:%d  flag:%3d  bath:%f  acrosstrack:%f  alongtrack:%f\n",
-				i,beamflag[i],bath[i],
-				bathacrosstrack[i],bathalongtrack[i]);
-			fprintf(stderr,"dbg4        namp:     %d\n", *namp);
-			for (i=0;i<*namp;i++)
-			  fprintf(stderr,"dbg4        beam:%d   amp:%f  acrosstrack:%f  alongtrack:%f\n",
-				i,amp[i],bathacrosstrack[i],bathalongtrack[i]);
-			fprintf(stderr,"dbg4        nss:      %d\n", *nss);
-			for (i=0;i<*nss;i++)
-			  fprintf(stderr,"dbg4        pixel:%d   ss:%f  acrosstrack:%f  alongtrack:%f\n",
-				i,ss[i],ssacrosstrack[i],ssalongtrack[i]);
-			}
-
-		/* done translating values */
-
-		}
-
-	/* extract data from structure */
-	else if (*kind == MB_DATA_NAV)
-		{
-		/* get time */
-		*time_d = store->time_d;
-		mb_get_date(verbose, *time_d, time_i);
-
-		/* get navigation */
-		*navlon = store->longitude;
-		*navlat = store->latitude;
-
-		/* get speed */
-		*speed = 3.6 * store->speed;
-
-		/* get heading */
-		*heading = store->heading;
-
-		/* set beam and pixel numbers */
-		*nbath = 0;
-		*namp = 0;
-		*nss = 0;
-
-		/* print debug statements */
-		if (verbose >= 5)
-			{
-			fprintf(stderr,"\ndbg4  Data extracted by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  Extracted values:\n");
-			fprintf(stderr,"dbg4       kind:       %d\n", *kind);
-			fprintf(stderr,"dbg4       error:      %d\n", *error);
-			fprintf(stderr,"dbg4       time_i[0]:  %d\n", time_i[0]);
-			fprintf(stderr,"dbg4       time_i[1]:  %d\n", time_i[1]);
-			fprintf(stderr,"dbg4       time_i[2]:  %d\n", time_i[2]);
-			fprintf(stderr,"dbg4       time_i[3]:  %d\n", time_i[3]);
-			fprintf(stderr,"dbg4       time_i[4]:  %d\n", time_i[4]);
-			fprintf(stderr,"dbg4       time_i[5]:  %d\n", time_i[5]);
-			fprintf(stderr,"dbg4       time_i[6]:  %d\n", time_i[6]);
-			fprintf(stderr,"dbg4       time_d:     %f\n", *time_d);
-			fprintf(stderr,"dbg4       longitude:  %f\n", *navlon);
-			fprintf(stderr,"dbg4       latitude:   %f\n", *navlat);
-			fprintf(stderr,"dbg4       speed:      %f\n", *speed);
-			fprintf(stderr,"dbg4       heading:    %f\n", *heading);
-			}
-
-		/* done translating values */
-
-		}
-
-	/* extract comment from structure */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* get time */
-		*time_d = store->time_d;
-		mb_get_date(verbose, *time_d, time_i);
-
-		/* copy comment */
-		strncpy(comment, store->comment, MIN(store->comment_len, MB_COMMENT_MAXLINE));
-
-		/* print debug statements */
-		if (verbose >= 4)
-			{
-			fprintf(stderr,"\ndbg4  Comment extracted by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  New ping values:\n");
-			fprintf(stderr,"dbg4       kind:       %d\n", *kind);
-			fprintf(stderr,"dbg4       error:      %d\n", *error);
-			fprintf(stderr,"dbg4       time_i[0]:  %d\n", time_i[0]);
-			fprintf(stderr,"dbg4       time_i[1]:  %d\n", time_i[1]);
-			fprintf(stderr,"dbg4       time_i[2]:  %d\n", time_i[2]);
-			fprintf(stderr,"dbg4       time_i[3]:  %d\n", time_i[3]);
-			fprintf(stderr,"dbg4       time_i[4]:  %d\n", time_i[4]);
-			fprintf(stderr,"dbg4       time_i[5]:  %d\n", time_i[5]);
-			fprintf(stderr,"dbg4       time_i[6]:  %d\n", time_i[6]);
-			fprintf(stderr,"dbg4       time_d:     %f\n", *time_d);
-			fprintf(stderr,"dbg4       comment:    %s\n", comment);
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind == MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"dbg2       comment:     \ndbg2       %s\n",
-			comment);
-		}
-	else if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind != MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"dbg2       time_i[0]:     %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:     %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:     %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:     %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:     %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:     %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:     %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:        %f\n",*time_d);
-		}
-	if (verbose >= 2 && (*kind == MB_DATA_DATA || *kind == MB_DATA_NAV))
-		{
-		fprintf(stderr,"dbg2       longitude:     %f\n",*navlon);
-		fprintf(stderr,"dbg2       latitude:      %f\n",*navlat);
-		fprintf(stderr,"dbg2       speed:         %f\n",*speed);
-		fprintf(stderr,"dbg2       heading:       %f\n",*heading);
-		}
-	if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind == MB_DATA_DATA)
-		{
-		fprintf(stderr,"dbg2       nbath:      %d\n",
-			*nbath);
-		for (i=0;i<*nbath;i++)
-		  fprintf(stderr,"dbg2       beam:%d  flag:%3d  bath:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,beamflag[i],bath[i],
-			bathacrosstrack[i],bathalongtrack[i]);
-		fprintf(stderr,"dbg2        namp:     %d\n",
-			*namp);
-		for (i=0;i<*namp;i++)
-		  fprintf(stderr,"dbg2       beam:%d   amp:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,amp[i],bathacrosstrack[i],bathalongtrack[i]);
-		fprintf(stderr,"dbg2        nss:      %d\n",
-			*nss);
-		for (i=0;i<*nss;i++)
-		  fprintf(stderr,"dbg2        pixel:%d   ss:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,ss[i],ssacrosstrack[i],ssalongtrack[i]);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_stereopair_insert(int verbose, void *mbio_ptr, void *store_ptr,
-		int kind, int time_i[7], double time_d,
-		double navlon, double navlat,
-		double speed, double heading,
-		int nbath, int namp, int nss,
-		char *beamflag, double *bath, double *amp,
-		double *bathacrosstrack, double *bathalongtrack,
-		double *ss, double *ssacrosstrack, double *ssalongtrack,
-		char *comment, int *error)
-{
-	char	*function_name = "mbsys_stereopair_insert";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_stereopair_struct *store;
-	struct mbsys_stereopair_sounding_struct *sounding;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",version_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       kind:       %d\n",kind);
-		}
-	if (verbose >= 2 && kind == MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"dbg2       comment:     \ndbg2       %s\n",
-			comment);
-		}
-	if (verbose >= 2 && (kind != MB_DATA_COMMENT))
-		{
-		fprintf(stderr,"dbg2       time_i[0]:  %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:  %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:  %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:  %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:  %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:  %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:  %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:     %f\n",time_d);
-		}
-	if (verbose >= 2 && (kind == MB_DATA_DATA || kind == MB_DATA_NAV))
-		{
-		fprintf(stderr,"dbg2       navlon:     %f\n",navlon);
-		fprintf(stderr,"dbg2       navlat:     %f\n",navlat);
-		fprintf(stderr,"dbg2       speed:      %f\n",speed);
-		fprintf(stderr,"dbg2       heading:    %f\n",heading);
-		}
-	if (verbose >= 2 && kind == MB_DATA_DATA)
-		{
-		fprintf(stderr,"dbg2       nbath:      %d\n",nbath);
-		if (verbose >= 3)
-		 for (i=0;i<nbath;i++)
-		  fprintf(stderr,"dbg3       beam:%d  flag:%3d  bath:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,beamflag[i],bath[i],
-			bathacrosstrack[i],bathalongtrack[i]);
-		fprintf(stderr,"dbg2       namp:       %d\n",namp);
-		if (verbose >= 3)
-		 for (i=0;i<namp;i++)
-		  fprintf(stderr,"dbg3        beam:%d   amp:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,amp[i],bathacrosstrack[i],bathalongtrack[i]);
-		fprintf(stderr,"dbg2        nss:       %d\n",nss);
-		if (verbose >= 3)
-		 for (i=0;i<nss;i++)
-		  fprintf(stderr,"dbg3        beam:%d   ss:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,ss[i],ssacrosstrack[i],ssalongtrack[i]);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_stereopair_struct *) store_ptr;
-
-	/* set data kind */
-	store->kind = kind;
-
-	/* insert data in structure */
-	if (store->kind == MB_DATA_DATA)
-		{
-		/* get time */
-		store->time_d = time_d;
-
-		/* get navigation */
-		store->longitude = navlon;
-		store->latitude = navlat;
-
-		/* get heading */
-		store->heading = heading;
-
-		/* get speed  */
-		store->speed = speed / 3.6;
-		
-		/* allocate space for soundings if required */
-		if (nbath > store->num_soundings_alloc)
-			{
-			/* allocate memory for data structure */
-			status = mb_reallocd(verbose, __FILE__, __LINE__,
-						nbath * sizeof(struct mbsys_stereopair_sounding_struct),
-						(void **)(&store->soundings), error);
-			if (status == MB_SUCCESS)
-				store->num_soundings_alloc = nbath;
-			else
-				store->num_soundings_alloc = 0;
-			}
-
-		/* read distance and depth values into storage arrays */
-		store->num_soundings = nbath;
-		for (i=0;i<store->num_soundings;i++)
-			{
-			sounding = (struct mbsys_stereopair_sounding_struct *) &store->soundings[i];
-			sounding->depth = bath[i] - store->sensordepth;
-			sounding->beamflag = beamflag[i];
-			sounding->acrosstrack = bathacrosstrack[i];
-			sounding->alongtrack = bathalongtrack[i];
-			sounding->red = 0;
-			sounding->green = 0;
-			sounding->blue = 0;
-			}
-
-		/* insert the sidescan */
-		}
-
-	/* insert data in nav structure */
-	else if (store->kind == MB_DATA_NAV)
-		{
-		/* get time */
-		store->time_d = time_d;
-
-		/* get navigation */
-		store->longitude = navlon;
-		store->latitude = navlat;
-
-		/* get heading */
-		store->heading = heading;
-
-		/* get speed  */
-		store->speed = speed / 3.6;
-		}
-
-	/* insert comment in structure */
-	else if (store->kind == MB_DATA_COMMENT)
-		{
-		strncpy(store->comment, comment, MB_COMMENT_MAXLINE);
-		store->comment_len = strlen(store->comment) + 1;
-		store->comment_len += 4 - (store->comment_len % 4);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_stereopair_ttimes(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, int *nbeams,
-	double *ttimes, double *angles,
-	double *angles_forward, double *angles_null,
-	double *heave, double *alongtrack_offset,
-	double *draft, double *ssv, int *error)
-{
-	char	*function_name = "mbsys_stereopair_ttimes";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_stereopair_struct *store;
-	struct mbsys_stereopair_sounding_struct *sounding;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",version_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       ttimes:     %p\n",(void *)ttimes);
-		fprintf(stderr,"dbg2       angles_xtrk:%p\n",(void *)angles);
-		fprintf(stderr,"dbg2       angles_ltrk:%p\n",(void *)angles_forward);
-		fprintf(stderr,"dbg2       angles_null:%p\n",(void *)angles_null);
-		fprintf(stderr,"dbg2       heave:      %p\n",(void *)heave);
-		fprintf(stderr,"dbg2       ltrk_off:   %p\n",(void *)alongtrack_offset);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_stereopair_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get ssv */
-		*ssv = 0.0;
-
-		/* get draft */
-		*draft = store->sensordepth;
-
-		/* get travel times, angles */
-		*nbeams = store->num_soundings;
-		for (i=0;i<store->num_soundings;i++)
-			{
-			sounding = (struct mbsys_stereopair_sounding_struct *) &store->soundings[i];
-			ttimes[i] = 0.0;
-			mb_xyz_to_takeoff(verbose,
-						sounding->acrosstrack,
-						sounding->alongtrack,
-						sounding->depth,
-						&angles[i],
-						&angles_forward[i],
-						error);			
-			angles_null[i] = 0.0;
-			heave[i] = 0.0;
-			alongtrack_offset[i] = 0.0;
-			}
-
-		/* set status */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error == MB_ERROR_NO_ERROR)
-		{
-		fprintf(stderr,"dbg2       draft:      %f\n",*draft);
-		fprintf(stderr,"dbg2       ssv:        %f\n",*ssv);
-		fprintf(stderr,"dbg2       nbeams:     %d\n",*nbeams);
-		for (i=0;i<*nbeams;i++)
-			fprintf(stderr,"dbg2       beam %d: tt:%f  angle_xtrk:%f  angle_ltrk:%f  angle_null:%f  depth_off:%f  ltrk_off:%f\n",
-				i,ttimes[i],angles[i],
-				angles_forward[i],angles_null[i],
-				heave[i],alongtrack_offset[i]);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_stereopair_detects(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, int *nbeams, int *detects, int *error)
-{
-	char	*function_name = "mbsys_stereopair_detects";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_stereopair_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",version_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       detects:    %p\n",(void *)detects);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_stereopair_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get detect type for each sounding - options include:
-			MB_DETECT_UNKNOWN
-			MB_DETECT_AMPLITUDE
-			MB_DETECT_PHASE
-			MB_DETECT_LIDAR
-			MB_DETECT_PHOTOGRAMMETRY */
-		*nbeams = store->num_soundings;
-		for (i=0;i<*nbeams;i++)
-			{
-			detects[i] = MB_DETECT_PHOTOGRAMMETRY;
-			}
-
-		/* set status */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error == MB_ERROR_NO_ERROR)
-		{
-		fprintf(stderr,"dbg2       nbeams:     %d\n",*nbeams);
-		for (i=0;i<*nbeams;i++)
-			fprintf(stderr,"dbg2       beam %d: detects:%d\n",
-				i,detects[i]);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_stereopair_gains(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, double *transmit_gain, double *pulse_length,
-			double *receive_gain, int *error)
-{
-	char	*function_name = "mbsys_stereopair_gains";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_stereopair_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",version_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_stereopair_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get transmit_gain (dB) */
-		*transmit_gain = 0.0;
-
-		/* get pulse_length (usec) */
-		*pulse_length = 0.0;
-
-		/* get receive_gain (dB) */
-		*receive_gain = 0.0;
-
-		/* set status */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error == MB_ERROR_NO_ERROR)
-		{
-		fprintf(stderr,"dbg2       transmit_gain: %f\n",*transmit_gain);
-		fprintf(stderr,"dbg2       pulse_length:  %f\n",*pulse_length);
-		fprintf(stderr,"dbg2       receive_gain:  %f\n",*receive_gain);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_stereopair_extract_altitude(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, double *transducer_depth, double *altitude,
-	int *error)
-{
-	char	*function_name = "mbsys_stereopair_extract_altitude";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_stereopair_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",version_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_stereopair_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get transducer depth and altitude */
-		*transducer_depth = store->sensordepth;
-
-		/* get altitude */
-		*altitude = store->altitude;
-
-		/* set status */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:              %d\n",*kind);
-		fprintf(stderr,"dbg2       transducer_depth:  %f\n",*transducer_depth);
-		fprintf(stderr,"dbg2       altitude:          %f\n",*altitude);
-		fprintf(stderr,"dbg2       error:             %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:            %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_stereopair_extract_nav(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int time_i[7], double *time_d,
-		double *navlon, double *navlat,
-		double *speed, double *heading, double *draft,
-		double *roll, double *pitch, double *heave,
-		int *error)
-{
-	char	*function_name = "mbsys_stereopair_extract_nav";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_stereopair_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",version_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_stereopair_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from survey record */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get time */
-		*time_d = store->time_d;
-		mb_get_date(verbose, *time_d, time_i);
-
-		/* get navigation */
-		*navlon = store->longitude;
-		*navlat = store->latitude;
-
-		/* get speed */
-		*speed = 3.6 * store->speed;
-
-		/* get heading */
-		*heading = store->heading;
-
-		/* get draft  */
-		*draft = store->sensordepth;
-
-		/* get attitude  */
-		*roll = store->roll;
-		*pitch = store->pitch;
-		*heave = 0.0;
-
-		/* done translating values */
-		}
-
-	/* extract data from nav record */
-	else if (*kind == MB_DATA_NAV)
-		{
-		/* get time */
-		*time_d = store->time_d;
-		mb_get_date(verbose, *time_d, time_i);
-
-		/* get navigation */
-		*navlon = store->longitude;
-		*navlat = store->latitude;
-
-		/* get speed */
-		*speed = 3.6 * store->speed;
-
-		/* get heading */
-		*heading = store->heading;
-
-		/* get draft  */
-		*draft = store->sensordepth;
-
-		/* get attitude  */
-		*roll = store->roll;
-		*pitch = store->pitch;
-		*heave = 0.0;
-
-		/* done translating values */
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-
-		/* get time */
-		for (i=0;i<7;i++)
-			time_i[i] = store->time_i[i];
-		*time_d = store->time_d;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-
-		/* get time */
-		*time_d = store->time_d;
-		mb_get_date(verbose, *time_d, time_i);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:          %d\n",*kind);
-		fprintf(stderr,"dbg2       time_i[0]:     %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:     %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:     %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:     %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:     %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:     %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:     %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:        %f\n",*time_d);
-		fprintf(stderr,"dbg2       longitude:     %f\n",*navlon);
-		fprintf(stderr,"dbg2       latitude:      %f\n",*navlat);
-		fprintf(stderr,"dbg2       speed:         %f\n",*speed);
-		fprintf(stderr,"dbg2       heading:       %f\n",*heading);
-		fprintf(stderr,"dbg2       draft:         %f\n",*draft);
-		fprintf(stderr,"dbg2       roll:          %f\n",*roll);
-		fprintf(stderr,"dbg2       pitch:         %f\n",*pitch);
-		fprintf(stderr,"dbg2       heave:         %f\n",*heave);
-		fprintf(stderr,"dbg2       error:         %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:        %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_stereopair_extract_nnav(int verbose, void *mbio_ptr, void *store_ptr,
-			int nmax, int *kind, int *n,
-			int *time_i, double *time_d,
-			double *navlon, double *navlat,
-			double *speed, double *heading, double *draft,
-			double *roll, double *pitch, double *heave,
-			int *error)
-{
-	char	*function_name = "mbsys_stereopair_extract_nnav";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_stereopair_struct *store;
-	int	i, inav;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",version_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       nmax:       %d\n",nmax);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_stereopair_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from survey record */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* just one navigation value */
-		*n = 1;
-
-		/* get time */
-		time_d[0] = store->time_d;
-		mb_get_date(verbose, store->time_d, time_i);
-
-		/* get navigation */
-		navlon[0] = store->longitude;
-		navlat[0] = store->latitude;
-
-		/* get speed */
-		speed[0] = 3.6 * store->speed;
-
-		/* get heading */
-		heading[0] = store->heading;
-
-		/* get draft  */
-		draft[0] = store->sensordepth;
-
-		/* get attitude  */
-		roll[0] = store->roll;
-		pitch[0] = store->pitch;
-		heave[0] = 0.0;
-
-		/* done translating values */
-		}
-
-	/* extract data from nav record */
-	else if (*kind == MB_DATA_NAV)
-		{
-		/* just one navigation value - in some formats there
-			are multiple values in nav records to loop over */
-		*n = 1;
-
-		/* get time */
-		time_d[0] = store->time_d;
-		mb_get_date(verbose, store->time_d, time_i);
-
-		/* get navigation */
-		navlon[0] = store->longitude;
-		navlat[0] = store->latitude;
-
-		/* get speed */
-		speed[0] = 3.6 * store->speed;
-
-		/* get heading */
-		heading[0] = store->heading;
-
-		/* get draft  */
-		draft[0] = store->sensordepth;
-
-		/* get attitude  */
-		roll[0] = store->roll;
-		pitch[0] = store->pitch;
-		heave[0] = 0.0;
-
-		/* done translating values */
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-
-		/* get time */
-		time_d[0] = store->time_d;
-		mb_get_date(verbose, store->time_d, time_i);
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-
-		/* get time */
-		time_d[0] = store->time_d;
-		mb_get_date(verbose, store->time_d, time_i);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		fprintf(stderr,"dbg2       n:          %d\n",*n);
-		for (inav=0;inav<*n;inav++)
-			{
-			for (i=0;i<7;i++)
-				fprintf(stderr,"dbg2       %d time_i[%d]:     %d\n",inav,i,time_i[inav * 7 + i]);
-			fprintf(stderr,"dbg2       %d time_d:        %f\n",inav,time_d[inav]);
-			fprintf(stderr,"dbg2       %d longitude:     %f\n",inav,navlon[inav]);
-			fprintf(stderr,"dbg2       %d latitude:      %f\n",inav,navlat[inav]);
-			fprintf(stderr,"dbg2       %d speed:         %f\n",inav,speed[inav]);
-			fprintf(stderr,"dbg2       %d heading:       %f\n",inav,heading[inav]);
-			fprintf(stderr,"dbg2       %d draft:         %f\n",inav,draft[inav]);
-			fprintf(stderr,"dbg2       %d roll:          %f\n",inav,roll[inav]);
-			fprintf(stderr,"dbg2       %d pitch:         %f\n",inav,pitch[inav]);
-			fprintf(stderr,"dbg2       %d heave:         %f\n",inav,heave[inav]);
-			}
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_stereopair_insert_nav(int verbose, void *mbio_ptr, void *store_ptr,
-		int time_i[7], double time_d,
-		double navlon, double navlat,
-		double speed, double heading, double draft,
-		double roll, double pitch, double heave,
-		int *error)
-{
-	char	*function_name = "mbsys_stereopair_insert_nav";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_stereopair_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",version_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       time_i[0]:  %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:  %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:  %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:  %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:  %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:  %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:  %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:     %f\n",time_d);
-		fprintf(stderr,"dbg2       navlon:     %f\n",navlon);
-		fprintf(stderr,"dbg2       navlat:     %f\n",navlat);
-		fprintf(stderr,"dbg2       speed:      %f\n",speed);
-		fprintf(stderr,"dbg2       heading:    %f\n",heading);
-		fprintf(stderr,"dbg2       draft:      %f\n",draft);
-		fprintf(stderr,"dbg2       roll:       %f\n",roll);
-		fprintf(stderr,"dbg2       pitch:      %f\n",pitch);
-		fprintf(stderr,"dbg2       heave:      %f\n",heave);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_stereopair_struct *) store_ptr;
-
-	/* insert data in ping structure */
-	if (store->kind == MB_DATA_DATA)
-		{
-		/* get time */
-		store->time_d = time_d;
-
-		/* get navigation */
-		store->longitude = navlon;
-		store->latitude = navlat;
-
-		/* get heading */
-		store->heading = heading;
-
-		/* get speed  */
-		store->speed = speed / 3.6;
-
-		/* get draft  */
-		store->sensordepth = draft;
-
-		/* get roll pitch and heave */
-		store->pitch = pitch;
-		store->roll = roll;
-		}
-
-	/* insert data in nav structure */
-	else if (store->kind == MB_DATA_NAV)
-		{
-		/* get time */
-		store->time_d = time_d;
-
-		/* get navigation */
-		store->longitude = navlon;
-		store->latitude = navlat;
-
-		/* get heading */
-		store->heading = heading;
-
-		/* get speed  */
-		store->speed = speed / 3.6;
-
-		/* get draft  */
-		store->sensordepth = draft;
-
-		/* get roll pitch and heave */
-		store->pitch = pitch;
-		store->roll = roll;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_stereopair_copy(int verbose, void *mbio_ptr,
-			void *store_ptr, void *copy_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_stereopair_copy";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_stereopair_struct *store;
-	struct mbsys_stereopair_struct *copy;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",version_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       copy_ptr:   %p\n",(void *)copy_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointers */
-	store = (struct mbsys_stereopair_struct *) store_ptr;
-	copy = (struct mbsys_stereopair_struct *) copy_ptr;
-
-	/* copy the data - for many formats memory must be allocated and
-		sub-structures copied separately */
-	*copy = *store;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mbsys_stereopair.h b/src/mbio/mbsys_stereopair.h
deleted file mode 100644
index 1e04d94..0000000
--- a/src/mbio/mbsys_stereopair.h
+++ /dev/null
@@ -1,316 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbsys_stereopair.h	11/22/2014
- *	$Id: mbsys_stereopair.h 2247 2015-05-29 21:28:28Z caress $
- *
- *    Copyright (c) 2014-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbsys_stereopair.h defines the MBIO data structures for handling data from
- * the following data formats:
- *    MBSYS_STEREOPAIR formats (code in mbsys_stereopair.c and mbsys_stereopair.h):
- *      MBF_PHOTGRAM : MBIO ID 251 (code in mbr_photgram.c)
- *
- * Author:	D. W. Caress
- * Date:	November 22, 2014
- *
- *
- */
-/*
- * Notes on the mbsys_stereopair data structure and associated format:
- *   1. This is an MB-System i/o module to read and write topography
- *      calculated by photogrammetry from stereo pair photographs.
- *   2. The structure in mbsys_stereopair.h defines the internal
- *      representation of photogrammetric topography data.
- *   3. The functions in mbsys_stereopair.c allow for extracting
- *      data from or inserting data into this internal
- *      representation. These functions are called by the
- *      MBIO API functions found in mbio/mb_access.c.
- *   4. The functions in mbr_photgram.c actually read and
- *      write the mbf_photgram format.
- *   5. Prototypes for all of the functions in mbsys_stereopair.c
- *      are provided in mbsys_stereopair.h.
- *   6. This list of functions corresponds to the function pointers
- *      that are included in the structure mb_io_struct that is defined
- *      in the file mbsystem/src/mbio/mb_io.h
- *      Not all of these functions are required - some only make sense to
- *      define if the relevant data type is part of the format. For instance,
- *      do not define mbsys_stereopair_extract_segy() if there are no subbottom
- *      profiler data supported by this data system
- *   7. The data are structured as deriving from a series of stereo pairs.
- *      The position and attitude of the camera rig are included, as is the
- *      position (relative to the camera) of each sounding derived from the
- *      stereo pair.
- *   8. Files in format mbf_photgram begin with the characters:
- *          ##PHOTGRAM##V001
- *      Following the 16-byte file header, the individual data records follow
- *      in any order. The defined record types include survey (MB_DATA_DATA),
- *      comment (MB_DATA_COMMENT), and INS (MB_DATA_NAV) which includes
- *      navigation, sensor depth, heading, and attitude sampled more frequently
- *      than the stereo photography.
- *
- *      Survey data records are binary with the following form:
- *              Number of bytes in record           4U
- *              Data record identifier              4U      (0x44445047 = "DDPG" = 1145327687)
- *              Time stamp (MB-System time_d)       8F      Decimal seconds since 1970/1/1/ 00:00:00
- *              Longitude                           8F      Decimal degrees
- *              Lattitude                           8F      Decimal degrees
- *              Sensor depth                        8F      Meters
- *              Heading                             4F      Decimal degrees
- *              Roll                                4F      Decimal degrees
- *              Pitch                               4F      Decimal degrees
- *              Speed                               4F      Decimal degrees
- *              Altitude                            4F      Decimal degrees
- *              N (Number of soundings)             4U
- *              ------------------------------------------------------------
- *              Repeat N times:
- *              ------------------------------------------------------------
- *              acrosstrack                         8F      meters
- *              alongtrack                          8F      meters
- *              depth                               8F      meters
- *              beamflag                            1U      beamflag
- *              red                                 1U      0-255
- *              green                               1U      0-255
- *              blue                                1U      0-255
- *              ------------------------------------------------------------
- *              End identifier                      4U      (0x454E4421 = "END!" = 1162757153)
- *              Check sum of data record between    2U
- *              and including the data record and
- *              end identifiers
- *
- *      INS data records are binary with the following form:
- *              Number of bytes in record           4U
- *              Data record identifier              4U      (0x4444494E = "DDIN" = 1145325902)
- *              Time stamp (MB-System time_d)       8F      Decimal seconds since 1970/1/1/ 00:00:00
- *              Longitude                           8F      Decimal degrees
- *              Lattitude                           8F      Decimal degrees
- *              Sensor depth                        8F      Meters
- *              Heading                             4F      Decimal degrees
- *              Roll                                4F      Decimal degrees
- *              Pitch                               4F      Decimal degrees
- *              Speed                               4F      Decimal degrees
- *              Altitude                            4F      Decimal degrees
- *              End identifier                      4U      (0x454E4421 = "END!" = 1162757153)
- *              Check sum of data record between    2U
- *              and including the data record and
- *              end identifiers
- *
- *      Comment data records are binary with the following form:
- *              Number of bytes in record           4U
- *              Data record identifier              4U      (0x4444434D = "DDCM" = 1145324365)
- *              Number of characters in comment     4U      Includes at least one terminating
- *                                                          null character, multiple of 4.
- *              Comment                             NC      
- *              End identifier                      4U      (0x454E4421 = "END!" = 1162757153)
- *              Check sum of data record between    2U
- *              and including the data record and
- *              end identifiers
- */
-
-/* include mb_define.h */
-#ifndef MB_DEFINE_DEF
-#include "mb_define.h"
-#endif
-
-/*---------------------------------------------------------------*/
-/* Record ID definitions (if needed for use in data reading and writing) */
-
-/*---------------------------------------------------------------*/
-/* Record size definitions (if needed for use in data reading and writing) */
-
-/*---------------------------------------------------------------*/
-/* Array size definitions (if needed for use in data reading and writing) */
-#define MBSYS_STEREOPAIR_MAX_BEAMS 400
-#define MBSYS_STEREOPAIR_MAX_PIXELS 400
-
-#define MBSYS_STEREOPAIR_SOUNDING_SIZE  28
-#define MBSYS_STEREOPAIR_INS_SIZE       52
-#define MBSYS_STEREOPAIR_HEADER_SIZE    56
-
-/*---------------------------------------------------------------*/
-
-/* Structure size definitions (if needed because there are dynamically allocated substructures) */
-struct mbsys_stereopair_sounding_struct
-        {
-        double          acrosstrack;
-        double          alongtrack;
-        double          depth;
-        mb_u_char       beamflag;
-        mb_u_char       red;
-        mb_u_char       green;
-        mb_u_char       blue;
-        };
-
-/* Internal data structure */
-struct mbsys_stereopair_struct
-	{
-	/* Type of most recently read data record */
-	int		kind;			/* MB-System record ID */
-
-	/* MB-System time stamp of most recently read record */
-	double		time_d;
-	int		time_i[7];
-        
-        /* Navigation */
-        double          longitude;      /* degrees */
-        double          latitude;       /* degrees */
-        double          sensordepth;    /* meters */
-        float           heading;        /* degrees */
-        float           roll;           /* degrees */
-        float           pitch;          /* degrees */
-        float           speed;          /* m/sec */
-        float           altitude;       /* meters */
-        
-        /* Photogrammetric soundings */
-        int             num_soundings;
-        int             num_soundings_alloc;
-        struct mbsys_stereopair_sounding_struct *soundings;
-        
-        /* Comment */
-        int             comment_len;
-        char            comment[MB_COMMENT_MAXLINE];
-	};
-        
-/*---------------------------------------------------------------*/
-
-/* System specific function prototypes */
-/* Note: this list of functions corresponds to the function pointers
- * that are included in the structure mb_io_struct that is defined
- * in the file mbsystem/src/mbio/mb_io.h
- * Not all of these functions are required - some only make sense to
- * define if the relevant data type is part of the format. For instance,
- * do not define mbsys_stereopair_extract_segy() if there are no subbottom
- * profiler data supported by this data system.
- * The function prototypes that are not required for all data systems
- * are commented out below. When using this example as the basis for
- * for coding a new MB-System I/O module, uncomment any non-required
- * functions that will be useful. */
-int mbsys_stereopair_alloc(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error);
-int mbsys_stereopair_deall(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error);
-int mbsys_stereopair_dimensions(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int *nbath, int *namp, int *nss, int *error);
-int mbsys_stereopair_pingnumber(int verbose, void *mbio_ptr,
-			int *pingnumber, int *error);
-int mbsys_stereopair_sonartype(int verbose, void *mbio_ptr, void *store_ptr,
-                        int *sonartype, int *error);
-int mbsys_stereopair_sidescantype(int verbose, void *mbio_ptr, void *store_ptr,
-                        int *ss_type, int *error);
-//int mbsys_stereopair_preprocess(int verbose, void *mbio_ptr, void *store_ptr,
-//                        double time_d, double navlon, double navlat,
-//                        double speed, double heading, double sonardepth,
-//                        double roll, double pitch, double heave,
-//                        int *error);
-int mbsys_stereopair_extract(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int time_i[7], double *time_d,
-			double *navlon, double *navlat,
-			double *speed, double *heading,
-			int *nbath, int *namp, int *nss,
-			char *beamflag, double *bath, double *amp,
-			double *bathacrosstrack, double *bathalongtrack,
-			double *ss, double *ssacrosstrack, double *ssalongtrack,
-			char *comment, int *error);
-int mbsys_stereopair_insert(int verbose, void *mbio_ptr, void *store_ptr,
-			int kind, int time_i[7], double time_d,
-			double navlon, double navlat,
-			double speed, double heading,
-			int nbath, int namp, int nss,
-			char *beamflag, double *bath, double *amp,
-			double *bathacrosstrack, double *bathalongtrack,
-			double *ss, double *ssacrosstrack, double *ssalongtrack,
-			char *comment, int *error);
-int mbsys_stereopair_extract_nav(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int time_i[7], double *time_d,
-			double *navlon, double *navlat,
-			double *speed, double *heading, double *draft,
-			double *roll, double *pitch, double *heave,
-			int *error);
-int mbsys_stereopair_extract_nnav(int verbose, void *mbio_ptr, void *store_ptr,
-			int nmax, int *kind, int *n,
-			int *time_i, double *time_d,
-			double *navlon, double *navlat,
-			double *speed, double *heading, double *draft,
-			double *roll, double *pitch, double *heave,
-			int *error);
-int mbsys_stereopair_insert_nav(int verbose, void *mbio_ptr, void *store_ptr,
-			int time_i[7], double time_d,
-			double navlon, double navlat,
-			double speed, double heading, double draft,
-			double roll, double pitch, double heave,
-			int *error);
-int mbsys_stereopair_extract_altitude(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, double *transducer_depth, double *altitude,
-			int *error);
-//int mbsys_stereopair_insert_altitude(int verbose, void *mbio_ptr, void *store_ptr,
-//                        double transducer_depth, double altitude,
-//                        int *error);
-//int mbsys_stereopair_extract_svp(int verbose, void *mbio_ptr, void *store_ptr,
-//			int *kind,
-//			int *nsvp,
-//			double *depth, double *velocity,
-//			int *error);
-//int mbsys_stereopair_insert_svp(int verbose, void *mbio_ptr, void *store_ptr,
-//			int nsvp,
-//			double *depth, double *velocity,
-//			int *error);
-int mbsys_stereopair_ttimes(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int *nbeams,
-			double *ttimes, double *angles,
-			double *angles_forward, double *angles_null,
-			double *heave, double *alongtrack_offset,
-			double *draft, double *ssv, int *error);
-int mbsys_stereopair_detects(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int *nbeams, int *detects, int *error);
-//int mbsys_stereopair_pulses(int verbose, void *mbio_ptr, void *store_ptr,
-//                        int *kind, int *nbeams, int *pulses, int *error);
-int mbsys_stereopair_gains(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, double *transmit_gain, double *pulse_length,
-			double *receive_gain, int *error);
-//int mbsys_stereopair_extract_rawss(int verbose, void *mbio_ptr, void *store_ptr,
-//			int *kind, int *nrawss,
-//			double *rawss,
-//			double *rawssacrosstrack,
-//			double *rawssalongtrack,
-//			int *error);
-//int mbsys_stereopair_insert_rawss(int verbose, void *mbio_ptr, void *store_ptr,
-//			int nrawss,
-//			double *rawss,
-//			double *rawssacrosstrack,
-//			double *rawssalongtrack,
-//			int *error);
-//int mbsys_stereopair_extract_segytraceheader(int verbose, void *mbio_ptr, void *store_ptr,
-//			int *kind,
-//			void *segytraceheader_ptr,
-//			int *error);
-//int mbsys_stereopair_extract_segy(int verbose, void *mbio_ptr, void *store_ptr,
-//			int *sampleformat,
-//			int *kind,
-//			void *segytraceheader_ptr,
-//			float *segydata,
-//			int *error);
-//int mbsys_stereopair_insert_segy(int verbose, void *mbio_ptr, void *store_ptr,
-//			int kind,
-//			void *segytraceheader_ptr,
-//			float *segydata,
-//			int *error);
-//int mbsys_stereopair_ctd(int verbose, void *mbio_ptr, void *store_ptr,
-//			int *kind, int *nctd, double *time_d,
-//			double *conductivity, double *temperature,
-//			double *depth, double *salinity, double *soundspeed, int *error);
-//int mbsys_stereopair_ancilliarysensor(int verbose, void *mbio_ptr, void *store_ptr,
-//			int *kind, int *nsensor, double *time_d,
-//			double *sensor1, double *sensor2, double *sensor3,
-//			double *sensor4, double *sensor5, double *sensor6,
-//			double *sensor7, double *sensor8, int *error);
-int mbsys_stereopair_copy(int verbose, void *mbio_ptr,
-			void *store_ptr, void *copy_ptr,
-			int *error);
-/*---------------------------------------------------------------*/
diff --git a/src/mbio/mbsys_surf.c b/src/mbio/mbsys_surf.c
deleted file mode 100644
index 8ce9b7b..0000000
--- a/src/mbio/mbsys_surf.c
+++ /dev/null
@@ -1,1578 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbsys_surf.c	3.00	6/25/01
- *	$Id: mbsys_surf.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 2001-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbsys_surf.c contains the MBIO functions for handling data in
- * the SURF format from STN Atlas Marine Electronics.
- * The relevant sonars include all SAM Electronics swath mapping
- * sonars: Hydrosweep DS, Hydrosweep DS2, Hydrosweep MD,
- * Hydrosweep MD2, Fansweep 10, Fansweep 20.
- * The data format associated with SURF data is:
- *    MBSYS_SURF format (code in mbsys_surf.c and mbsys_surf.h):
- *      MBF_SAMESURF : MBIO ID 181 - Vendor processing format
- *
- * Author:	D. W. Caress
- * Author:	D. N. Chayes
- * Date:	June 20, 2002
- *
- * $Log: mbsys_surf.c,v $
- * Revision 5.15  2005/11/05 00:48:04  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.14  2003/12/04 23:10:24  caress
- * Fixed problems with format 54 EM12DARW due to old code assuming how internal structure was packed. Also changed handling of beamflags for formats that don't support beamflags. Now flagged beams will always be nulled in such cases.
- *
- * Revision 5.13  2003/11/24 21:09:09  caress
- * Implement Reinhard Holtkamp's suggested mods for better SURF format support.
- *
- * Revision 5.12  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.11  2003/03/06 00:14:52  caress
- * Put in Reinhard Holtkamp's mod's to support SVP data.
- *
- * Revision 5.10  2003/02/27 04:33:33  caress
- * Fixed handling of SURF format data.
- *
- * Revision 5.9  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.8  2002/07/20 20:42:40  caress
- * Release 5.0.beta20
- *
- *
- *
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mb_define.h"
-#include "../surf/mb_sapi.h"
-#include "mbsys_surf.h"
-
-double mbsys_get_depth(	SurfMultiBeamDepth* 			MultiBeamDepth,
-						SurfTransducerParameterTable	TransducerTable,
-						float	heave,
-						int		n );
-
-static char rcs_id[]="$Id: mbsys_surf.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mbsys_surf_alloc(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_surf_alloc";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_surf_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* allocate memory for data structure */
-	status = mb_malloc(verbose,sizeof(struct mbsys_surf_struct),
-				store_ptr,error);
-	if (status == MB_SUCCESS)
-		{
-		/* initialize everything */
-		memset(*store_ptr, 0, sizeof(struct mbsys_surf_struct));
-
-		/* get data structure pointer */
-		store = (struct mbsys_surf_struct *) *store_ptr;
-
-		/* MBIO data record kind */
-		store->kind = MB_DATA_NONE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)*store_ptr);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_surf_deall(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_surf_deall";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)*store_ptr);
-		}
-
-	/* deallocate memory for data structure */
-	status = mb_free(verbose,store_ptr,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_surf_dimensions(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int *nbath, int *namp, int *nss, int *error)
-{
-	char	*function_name = "mbsys_surf_dimensions";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_surf_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_surf_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get beam and pixel numbers */
-		*nbath = store->NrBeams;
-		*namp = store->NrAmplitudes;
-		*nss = store->NrSidescan;
-		}
-	else
-		{
-		/* get beam and pixel numbers */
-		*nbath = 0;
-		*namp = 0;
-		*nss = 0;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		fprintf(stderr,"dbg2       nbath:         %d\n",*nbath);
-		fprintf(stderr,"dbg2       namp:          %d\n",*namp);
-		fprintf(stderr,"dbg2       nss:           %d\n",*nss);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_surf_extract(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int time_i[7], double *time_d,
-		double *navlon, double *navlat,
-		double *speed, double *heading,
-		int *nbath, int *namp, int *nss,
-		char *beamflag, double *bath, double *amp,
-		double *bathacrosstrack, double *bathalongtrack,
-		double *ss, double *ssacrosstrack, double *ssalongtrack,
-		char *comment, int *error)
-{
-	char	*function_name = "mbsys_surf_extract";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_surf_struct *store;
-	double	v0, tlx, tly, tlz, z0, t0, t2, tn, dt, y;
-	int		i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_surf_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get time */
-		*time_d = store->AbsoluteStartTimeOfProfile
-				+ (double) store->SoundingData.relTime;
-		mb_get_date(verbose, *time_d, time_i);
-
-		/* get navigation */
-		*navlon = RTD * ((double) store->CenterPosition[0].centerPositionX
-					+ store->GlobalData.referenceOfPositionX);
-		*navlat = RTD * ((double) store->CenterPosition[0].centerPositionY
-					+ store->GlobalData.referenceOfPositionY);
-
-		/* get heading */
-		*heading = RTD * store->SoundingData.headingWhileTransmitting;
-
-		/* get speed  */
-		*speed = 3.6 * store->CenterPosition[0].speed;
-
-		/* set beamwidths in mb_io structure */
-		mb_io_ptr->beamwidth_ltrack = 2.3;
-		mb_io_ptr->beamwidth_xtrack = 2.3;
-
-		/* transducer location */
-		tlx = store->ActualTransducerTable.transducerPositionAhead;
-		tly = store->ActualTransducerTable.transducerPositionStar;
-		tlz = store->ActualTransducerTable.transducerDepth
-			- store->SoundingData.heaveWhileTransmitting;
-
-		/* reset storage arrays */
-		for (i=0;i<MBSYS_SURF_MAXBEAMS;i++)
-			{
-			bath[i] = 0.0;
-			beamflag[i] = MB_FLAG_NULL;
-			amp[i] = 0.0;
-			bathacrosstrack[i] = 0.0;
-			bathalongtrack[i] = 0.0;
-			}
-		/* read distance and depth values into storage arrays */
-		*nbath = store->NrBeams;
-		for (i = 0; i < store->NrBeams; i ++)
-			{
-			if ((store->MultiBeamDepth[i].depthFlag & SB_DELETED) != 0)
-				beamflag[i] = MB_FLAG_NULL;
-			else if ((store->MultiBeamDepth[i].depthFlag &
-					 (SB_DEPTH_SUPPRESSED | SB_REDUCED_FAN)) != 0)
-				beamflag[i] = MB_FLAG_FLAG + MB_FLAG_MANUAL;
-			else
-				beamflag[i] = MB_FLAG_NONE;
-			bath[i] = (double) store->MultiBeamDepth[i].depth;
-			if (bath[i] < tlz)
-				beamflag[i] = MB_FLAG_FLAG + MB_FLAG_MANUAL;
-			bathacrosstrack[i] = (double) store->MultiBeamDepth[i].beamPositionStar;
-			bathalongtrack[i] = (double) store->MultiBeamDepth[i].beamPositionAhead;
-			}
-
-		/* get beam amplitudes */
-		*namp = store->NrAmplitudes;
-		for (i=0;i<store->NrAmplitudes;i++)
-			{
-			amp[i] = (double) store->MultibeamBeamAmplitudes[i].beamAmplitude;
-			}
-
-		/* get single beam if not multibeam file */
-		if (store->NrBeams == 0
-			&& store->GlobalData.typeOfSounder == 'V')
-			{
-			if (store->SingleBeamDepth.depthHFreq > 0.0)
-				{
-				*nbath = 1;
-				bath[0] = (double) store->SingleBeamDepth.depthHFreq;
-				beamflag[0] = MB_FLAG_NONE;
-				bathacrosstrack[0] = 0.0;
-				bathalongtrack[0] = 0.0;
-				amp[0] = 0.0;
-				}
-			else if (store->SingleBeamDepth.depthMFreq > 0.0)
-				{
-				*nbath = 1;
-				bath[0] = (double) store->SingleBeamDepth.depthMFreq;
-				beamflag[0] = MB_FLAG_NONE;
-				bathacrosstrack[0] = 0.0;
-				bathalongtrack[0] = 0.0;
-				amp[0] = 0.0;
-				}
-			else if (store->SingleBeamDepth.depthLFreq > 0.0)
-				{
-				*nbath = 1;
-				bath[0] = (double) store->SingleBeamDepth.depthLFreq;
-				beamflag[0] = MB_FLAG_NONE;
-				bathacrosstrack[0] = 0.0;
-				bathalongtrack[0] = 0.0;
-				amp[0] = 0.0;
-				}
-			if (*nbath == 1)
-				{
-				if ((int)(store->SingleBeamDepth.depthFlag & SB_DELETED) != 0)
-					beamflag[0] = MB_FLAG_NULL;
-				else if ((int)(store->SingleBeamDepth.depthFlag
-					& (SB_DEPTH_SUPPRESSED + SB_REDUCED_FAN)) != 0)
-					beamflag[0] = MB_FLAG_FLAG + MB_FLAG_MANUAL;
-				else
-					beamflag[0] = MB_FLAG_NONE;
-				}
-			}
-
-		/* reset sidescan */
-		*nss = 0;
-		for (i = 0; i < store->NrSidescan; i++)
-			{
-			ss[i] = 0.0;
-			ssacrosstrack[i] = 0.0;
-			ssalongtrack[i] = 0.0;
-			}
-
-		/* get sidescan */
-		v0 = (store->SoundingData.cMean > 0.0 ?
-				store->SoundingData.cMean : 1500.0);
-		z0 = mbsys_get_depth(store->MultiBeamDepth,
-							 store->ActualTransducerTable,
-							 store->SoundingData.heaveWhileTransmitting,
-							 store->NrBeams);
-		if ((store->NrSidescan > 0) && (z0 > tlz))
-			{
-			*nss = store->NrSidescan;
-		    z0 -= tlz;
-			t0 = z0/v0;
-			t2 = t0*t0;
-			/* read portside scan */
-			if (store->SidescanData.actualNrOfSsDataPort > 1)
-				{
-				/* initialise */
-				tn = store->SidescanData.minSsTimePort / 2;
-				dt = (store->SidescanData.maxSsTimePort / 2 - tn)
-					/ (store->SidescanData.actualNrOfSsDataPort - 1);
-				/* start reading: */
-				for (i = 0, j = store->SidescanData.actualNrOfSsDataPort; 0 < --j; i++)
-					{
-					y = (tn > t0 ? v0 * sqrt(tn*tn - t2) : 0.0);
-					ssalongtrack[j]	 = tlx;
-					ssacrosstrack[j] = tly - y;
-					ss[j] = store->SidescanData.ssData[i];
-					tn += dt;
-					}
-				}
-			/* read starboard scan */
-			if (store->SidescanData.actualNrOfSsDataStb > 1)
-				{
-				/* initialise */
-				tn = store->SidescanData.minSsTimeStb / 2;
-				dt = (store->SidescanData.maxSsTimeStb / 2 - tn)
-					/ (store->SidescanData.actualNrOfSsDataStb - 1);
-				for (j = store->SidescanData.actualNrOfSsDataPort; j < store->NrSidescan; j++)
-					{
-					y = (tn > t0 ? v0 * sqrt(tn*tn - t2) : 0.0);
-					ssalongtrack[j]	 = tlx;
-					ssacrosstrack[j] = tly + y;
-					ss[j] = store->SidescanData.ssData[j];
-					tn += dt;
-					}
-				}
-			}
-		/* print debug statements */
-		if (verbose >= 5)
-			{
-			fprintf(stderr,"\ndbg4  Data extracted by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  Extracted values:\n");
-			fprintf(stderr,"dbg4       kind:       %d\n",
-				*kind);
-			fprintf(stderr,"dbg4       error:      %d\n",
-				*error);
-			fprintf(stderr,"dbg4       time_i[0]:  %d\n",
-				time_i[0]);
-			fprintf(stderr,"dbg4       time_i[1]:  %d\n",
-				time_i[1]);
-			fprintf(stderr,"dbg4       time_i[2]:  %d\n",
-				time_i[2]);
-			fprintf(stderr,"dbg4       time_i[3]:  %d\n",
-				time_i[3]);
-			fprintf(stderr,"dbg4       time_i[4]:  %d\n",
-				time_i[4]);
-			fprintf(stderr,"dbg4       time_i[5]:  %d\n",
-				time_i[5]);
-			fprintf(stderr,"dbg4        time_i[6]:  %d\n",
-				time_i[6]);
-			fprintf(stderr,"dbg4       time_d:     %f\n",
-				*time_d);
-			fprintf(stderr,"dbg4       longitude:  %f\n",
-				*navlon);
-			fprintf(stderr,"dbg4       latitude:   %f\n",
-				*navlat);
-			fprintf(stderr,"dbg4       speed:      %f\n",
-				*speed);
-			fprintf(stderr,"dbg4       heading:    %f\n",
-				*heading);
-			fprintf(stderr,"dbg4       nbath:      %d\n",
-				*nbath);
-			for (i=0;i<*nbath;i++)
-			  fprintf(stderr,"dbg4       beam:%d  flag:%3d  bath:%f  acrosstrack:%f  alongtrack:%f\n",
-				i,beamflag[i],bath[i],
-				bathacrosstrack[i],bathalongtrack[i]);
-			fprintf(stderr,"dbg4        namp:     %d\n",
-				*namp);
-			for (i=0;i<*namp;i++)
-			  fprintf(stderr,"dbg4        beam:%d   amp:%f  acrosstrack:%f  alongtrack:%f\n",
-				i,amp[i],bathacrosstrack[i],bathalongtrack[i]);
-			fprintf(stderr,"dbg4        nss:      %d\n",
-				*nss);
-			for (i=0;i<*nss;i++)
-			  fprintf(stderr,"dbg4        pixel:%d   ss:%f  acrosstrack:%f  alongtrack:%f\n",
-				i,ss[i],ssacrosstrack[i ],ssalongtrack[i]);
-			}
-
-		/* done translating values */
-
-		}
-
-	/* extract comment from structure */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* copy comment */
-/*		strncpy(comment,store->comment,
-			MBSYS_SURF_COMMENT_LENGTH);*/
-
-		/* print debug statements */
-		if (verbose >= 4)
-			{
-			fprintf(stderr,"\ndbg4  New ping read by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  New ping values:\n");
-			fprintf(stderr,"dbg4       error:      %d\n",
-				*error);
-			fprintf(stderr,"dbg4       comment:    %s\n",
-				comment);
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind == MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"dbg2       comment:     \ndbg2       %s\n",
-			comment);
-		}
-	else if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind != MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"dbg2       time_i[0]:     %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:     %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:     %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:     %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:     %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:     %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:     %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:        %f\n",*time_d);
-		fprintf(stderr,"dbg2       longitude:     %f\n",*navlon);
-		fprintf(stderr,"dbg2       latitude:      %f\n",*navlat);
-		fprintf(stderr,"dbg2       speed:         %f\n",*speed);
-		fprintf(stderr,"dbg2       heading:       %f\n",*heading);
-		}
-	if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind == MB_DATA_DATA)
-		{
-		fprintf(stderr,"dbg2       nbath:      %d\n",
-			*nbath);
-		for (i=0;i<*nbath;i++)
-		  fprintf(stderr,"dbg2       beam:%d  flag:%3d  bath:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,beamflag[i],bath[i],
-			bathacrosstrack[i],bathalongtrack[i]);
-		fprintf(stderr,"dbg2        namp:     %d\n",
-			*namp);
-		for (i=0;i<*namp;i++)
-		  fprintf(stderr,"dbg2       beam:%d   amp:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,amp[i],bathacrosstrack[i],bathalongtrack[i]);
-		fprintf(stderr,"dbg2        nss:      %d\n",
-			*nss);
-		for (i=0;i<*nss;i++)
-		  fprintf(stderr,"dbg2        pixel:%d   ss:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,ss[i],ssacrosstrack[i],ssalongtrack[i]);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_surf_insert(int verbose, void *mbio_ptr, void *store_ptr,
-		int kind, int time_i[7], double time_d,
-		double navlon, double navlat,
-		double speed, double heading,
-		int nbath, int namp, int nss,
-		char *beamflag, double *bath, double *amp,
-		double *bathacrosstrack, double *bathalongtrack,
-		double *ss, double *ssacrosstrack, double *ssalongtrack,
-		char *comment, int *error)
-{
-	char	*function_name = "mbsys_surf_insert";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_surf_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       kind:       %d\n",kind);
-		}
-	if (verbose >= 2 && kind == MB_DATA_DATA)
-		{
-		fprintf(stderr,"dbg2       time_i[0]:  %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:  %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:  %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:  %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:  %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:  %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:  %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:     %f\n",time_d);
-		fprintf(stderr,"dbg2       navlon:     %f\n",navlon);
-		fprintf(stderr,"dbg2       navlat:     %f\n",navlat);
-		fprintf(stderr,"dbg2       speed:      %f\n",speed);
-		fprintf(stderr,"dbg2       heading:    %f\n",heading);
-		fprintf(stderr,"dbg2       nbath:      %d\n",nbath);
-		if (verbose >= 3)
-		 for (i=0;i<nbath;i++)
-		  fprintf(stderr,"dbg3       beam:%d  flag:%3d  bath:%f   acrosstrack:%f  alongtrack:%f\n",
-			i,beamflag[i],bath[i],
-			bathacrosstrack[i],bathalongtrack[i]);
-		fprintf(stderr,"dbg2       namp:       %d\n",namp);
-		if (verbose >= 3)
-		 for (i=0;i<namp;i++)
-		  fprintf(stderr,"dbg3        beam:%d   amp:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,amp[i],bathacrosstrack[i],bathalongtrack[i]);
-		fprintf(stderr,"dbg2        nss:       %d\n",nss);
-		if (verbose >= 3)
-		 for (i=0;i<nss;i++)
-		  fprintf(stderr,"dbg3        beam:%d   ss:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,ss[i],ssacrosstrack[i],ssalongtrack[i]);
-		}
-	if (verbose >= 2 && kind == MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"dbg2       comment:     \ndbg2       %s\n",
-			comment);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_surf_struct *) store_ptr;
-
-	/* set data kind */
-	store->kind = kind;
-
-	/* insert data in structure */
-	if (store->kind == MB_DATA_DATA)
-		{
-		/* set time */
-		store->SoundingData.relTime = (float) (time_d
-		    - store->AbsoluteStartTimeOfProfile);
-
-		/* set navigation */
-		store->CenterPosition[0].centerPositionX = (float)
-			(DTR * navlon - store->GlobalData.referenceOfPositionX);
-		store->CenterPosition[0].centerPositionY = (float)
-			(DTR * navlat - store->GlobalData.referenceOfPositionY);
-
-		/* set heading */
-		store->SoundingData.headingWhileTransmitting = (float) (DTR * heading);
-
-		/* set speed  */
-		store->CenterPosition[0].speed = (float) (speed / 3.6);
-
-		/* write distance and depth values into storage arrays */
-		if (store->GlobalData.typeOfSounder == 'B'
-			|| store->GlobalData.typeOfSounder == 'F')
-			{
-			store->NrBeams = nbath;
-			for (i=0;i<store->NrBeams;i++)
-				{
-				store->MultiBeamDepth[i].depth = bath[i];
-				if (beamflag[i] == MB_FLAG_NULL)
-			    		store->MultiBeamDepth[i].depthFlag
-						= store->MultiBeamDepth[i].depthFlag | SB_DELETED;
-				else if (!mb_beam_check_flag(beamflag[i]))
-			    		store->MultiBeamDepth[i].depthFlag
-						= store->MultiBeamDepth[i].depthFlag
-							& 2046;
-				else
-			    		store->MultiBeamDepth[i].depthFlag
-						= store->MultiBeamDepth[i].depthFlag
-							| SB_DEPTH_SUPPRESSED;
-				store->MultiBeamDepth[i].beamPositionStar = (float) bathacrosstrack[i];
-				store->MultiBeamDepth[i].beamPositionAhead = (float) bathalongtrack[i];
-				}
-			}
-		else if (store->GlobalData.typeOfSounder == 'V')
-			{
-			store->NrBeams = 0;
-  			if (store->SingleBeamDepth.depthHFreq > 0.0)
-  				store->SingleBeamDepth.depthHFreq = bath[0];
-			else if (store->SingleBeamDepth.depthMFreq > 0.0)
-				store->SingleBeamDepth.depthMFreq = bath[0];
-			else if (store->SingleBeamDepth.depthLFreq > 0.0)
-				store->SingleBeamDepth.depthLFreq = bath[0];
-			else
-				store->SingleBeamDepth.depthMFreq = bath[0];
-			if (beamflag[i] == MB_FLAG_NULL)
-			   	store->SingleBeamDepth.depthFlag
-					= store->SingleBeamDepth.depthFlag | SB_DELETED;
-			else if (!mb_beam_check_flag(beamflag[i]))
-			    	store->SingleBeamDepth.depthFlag
-					= store->SingleBeamDepth.depthFlag & 2046;
-			else
-			    	store->SingleBeamDepth.depthFlag
-					= store->SingleBeamDepth.depthFlag | SB_DEPTH_SUPPRESSED;
-			}
-
-		/* set beam amplitudes */
-		store->NrAmplitudes = namp;
-		for (i=0;i<store->NrAmplitudes;i++)
-			{
-			store->MultibeamBeamAmplitudes[i].beamAmplitude = (unsigned short) amp[i];
-			}
-
-		if (nss == store->SidescanData.actualNrOfSsDataPort
-				 + store->SidescanData.actualNrOfSsDataStb)
-			{
-    		for (i=0;i<store->SidescanData.actualNrOfSsDataPort;i++)
-    			{
-    			store->SidescanData.ssData[i] = ss[store->SidescanData.actualNrOfSsDataPort - i - 1];
-    			}
-    		for (i=store->SidescanData.actualNrOfSsDataStb;i<nss;i++)
-    			{
-    			store->SidescanData.ssData[i] = ss[i];
-    			}
-    		}
-		}
-
-	/* insert comment in structure */
-	else if (store->kind == MB_DATA_COMMENT)
-		{
-		/*strncpy(store->comment,comment,
-			MBSYS_SURF_COMMENT_LENGTH);*/
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_surf_ttimes(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, int *nbeams,
-	double *ttimes, double *angles,
-	double *angles_forward, double *angles_null,
-	double *heave, double *alongtrack_offset,
-	double *draft, double *ssv, int *error)
-{
-	char	*function_name = "mbsys_surf_ttimes";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_surf_struct *store;
-	double pitch, angle;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       ttimes:     %p\n",(void *)ttimes);
-		fprintf(stderr,"dbg2       angles_xtrk:%p\n",(void *)angles);
-		fprintf(stderr,"dbg2       angles_ltrk:%p\n",(void *)angles_forward);
-		fprintf(stderr,"dbg2       angles_null:%p\n",(void *)angles_null);
-		fprintf(stderr,"dbg2       heave:      %p\n",(void *)heave);
-		fprintf(stderr,"dbg2       ltrk_off:   %p\n",(void *)alongtrack_offset);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_surf_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-
-		/* get draft */
-		*draft = store->ActualTransducerTable.transducerDepth;
-
-		/* get ssv */
-		*ssv = store->SoundingData.cKeel;
-
-		/* get travel times */
-		if (((store->GlobalData.typeOfSounder == 'B')
-		|| 	 (store->GlobalData.typeOfSounder == 'F'))
-		&&	(store->NrBeams == store->ActualAngleTable.actualNumberOfBeams)
-		&&	(store->NrBeams == store->NrTravelTimes))
-			{
-			*nbeams = store->NrBeams;
-			pitch = - RTD * store->SoundingData.pitchWhileTransmitting;
-			for (i=0;i<store->NrBeams;i++)
-				{
-				ttimes[i] = 0.0;
-				angles[i] = 0.0;
-				angles_forward[i] = 0.0;
-				angles_null[i] = 0.0;
-				heave[i] = 0.0;
-				alongtrack_offset[i] = 0.0;
-				}
-			for (i=0;i<store->NrBeams;i++)
-				{
-				ttimes[i] = 2*store->MultiBeamTraveltime[i].travelTimeOfRay;
-				angle = 90. - RTD * store->ActualAngleTable.beamAngle[i];
-				mb_rollpitch_to_takeoff(verbose,
-					pitch, angle,
-					&angles[i],&angles_forward[i], error);
-				heave[i] =  -0.5 * (store->SoundingData.heaveWhileTransmitting
-					+ store->MultiBeamReceiveParams[i].heaveWhileReceiving);
-				}
-			/* set status */
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		else if (store->GlobalData.typeOfSounder == 'V')
-			{
-			*nbeams = 1;
-			ttimes[0] = 2*store->SingleBeamDepth.travelTimeOfRay;
-			angles_forward[0] = 0.0;
-			angles_null[0] = 0.0;
-			heave[0] = -0.5 * (store->SoundingData.heaveWhileTransmitting
-					+ store->MultiBeamReceiveParams[0].heaveWhileReceiving);
-			alongtrack_offset[0] = 0.0;
-
-			/* set status */
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		else
-			{
-			/* set status */
-			*error = MB_ERROR_OTHER;
-			status = MB_FAILURE;
-			}
-
-		/* done translating values */
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error == MB_ERROR_NO_ERROR)
-		{
-		fprintf(stderr,"dbg2       draft:      %f\n",*draft);
-		fprintf(stderr,"dbg2       ssv:        %f\n",*ssv);
-		fprintf(stderr,"dbg2       nbeams:     %d\n",*nbeams);
-		for (i=0;i<*nbeams;i++)
-			fprintf(stderr,"dbg2       beam %d: tt:%f  angle_xtrk:%f  angle_ltrk:%f  angle_null:%f  depth_off:%f  ltrk_off:%f\n",
-				i,ttimes[i],angles[i],
-				angles_forward[i],angles_null[i],
-				heave[i],alongtrack_offset[i]);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_surf_detects(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, int *nbeams, int *detects, int *error)
-{
-	char	*function_name = "mbsys_surf_detects";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_surf_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       detects:    %p\n",(void *)detects);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_surf_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* amplitude detects from Atlas multibeams */
-		if (store->GlobalData.typeOfSounder == 'B')
-			{
-			*nbeams = store->NrBeams;
-			for (i=0;i<store->NrBeams;i++)
-				{
-				detects[i] = MB_DETECT_AMPLITUDE;
-				}
-			}
-
-		/* phase detects from Atlas fansweeps */
-		else if (store->GlobalData.typeOfSounder == 'F')
-			{
-			*nbeams = store->NrBeams;
-			for (i=0;i<store->NrBeams;i++)
-				{
-				detects[i] = MB_DETECT_PHASE;
-				}
-			}
-		else if (store->GlobalData.typeOfSounder == 'V')
-			{
-			*nbeams = 1;
-			detects[0] = MB_DETECT_AMPLITUDE;
-			}
-
-		/* set status */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error == MB_ERROR_NO_ERROR)
-		{
-		fprintf(stderr,"dbg2       nbeams:     %d\n",*nbeams);
-		for (i=0;i<*nbeams;i++)
-			fprintf(stderr,"dbg2       beam %d: detects:%d\n",
-				i,detects[i]);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-double mbsys_get_depth(	SurfMultiBeamDepth* 			MultiBeamDepth,
-						SurfTransducerParameterTable	TransducerTable,
-						float	heave,
-						int		n )
-{
-	double	x, y, z, a, b, c, d, depth;
-	int		i, N;
-
-	a = b = c = d = 0.0;
-	N = 0;
-	/* include all beams with a lateral distance within ~15 % of the depth
-	   and calculate the depth @ centre assuming a linear slope.
-	 */
-	for (i = 0; i < n; i++)
-		if ((MultiBeamDepth[i].depthFlag &
-			(SB_DELETED | SB_DEPTH_SUPPRESSED | SB_REDUCED_FAN)) == 0)
-			{
-			x = MultiBeamDepth[i].beamPositionAhead	-
-				TransducerTable.transducerPositionAhead;
-			y = MultiBeamDepth[i].beamPositionStar -
-				TransducerTable.transducerPositionStar;
-			z = MultiBeamDepth[i].depth + heave -
-				TransducerTable.transducerDepth;
-			if ((x*x + y*y) <= (z*z/50.))
-				{
-					a += y;
-					b += y*y;
-					c += z;
-					d += z*y;
-					N++;
-				}
-			}
-
-	if (N > 0)
-		depth = (b*c - a*d)/(N*b - a*a)	- heave + TransducerTable.transducerDepth;
-	else
-		depth = 0.0;
-
-	return(depth);
-}
-/*----------------------------------------------------------------------
-roll in MB-System is positive rotating starboard to down, same as in SURF
-pitch in MB-System is positive rotating down to forward, opposite in SURF
-heave in MB-System is positive down, which conforms to the cartesian
-		coordinates convention, but seems rather a contradiction in terms
-													     opposite in SURF
-*/
-int mbsys_surf_extract_altitude(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, double *transducer_depth, double *altitude,
-	int *error)
-{
-	char	*function_name = "mbsys_surf_extract_altitude";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_surf_struct *store;
-	double	bath_best;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_surf_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get transducer depth and altitude */
-		*transducer_depth = store->ActualTransducerTable.transducerDepth
-					- store->SoundingData.heaveWhileTransmitting;
-		bath_best = mbsys_get_depth(store->MultiBeamDepth,
-									store->ActualTransducerTable,
-									store->SoundingData.heaveWhileTransmitting,
-									store->NrBeams);;
-		if (bath_best > *transducer_depth)
-			{
-		    *altitude = bath_best - *transducer_depth;
-			*error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		else
-			{
-		    *altitude = 0.0;
-			*error = MB_ERROR_OTHER;
-			status = MB_FAILURE;
-		    }
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:              %d\n",*kind);
-		fprintf(stderr,"dbg2       transducer_depth:  %f\n",*transducer_depth);
-		fprintf(stderr,"dbg2       altitude:          %f\n",*altitude);
-		fprintf(stderr,"dbg2       error:             %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:            %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_surf_extract_nav(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int time_i[7], double *time_d,
-		double *navlon, double *navlat,
-		double *speed, double *heading, double *draft,
-		double *roll, double *pitch, double *heave,
-		int *error)
-{
-	char	*function_name = "mbsys_surf_extract_nav";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_surf_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_surf_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from ping structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get time */
-		*time_d = store->AbsoluteStartTimeOfProfile
-			    + (double) store->SoundingData.relTime;
-		mb_get_date(verbose, *time_d, time_i);
-
-		/* get navigation */
-		*navlon = RTD * ((double) store->CenterPosition[0].centerPositionX
-					+ store->GlobalData.referenceOfPositionX);
-		*navlat = RTD * ((double) store->CenterPosition[0].centerPositionY
-					+ store->GlobalData.referenceOfPositionY);
-
-		/* get draft */
-		*draft = store->ActualTransducerTable.transducerDepth;
-
-		/* get heading */
-		*heading = RTD * store->SoundingData.headingWhileTransmitting;
-
-		/* get speed  */
-		*speed = 3.6 * store->CenterPosition[0].speed;
-
-		/* get roll pitch and heave */
-		*roll = RTD * store->SoundingData.rollWhileTransmitting;
-		*pitch = -RTD * store->SoundingData.pitchWhileTransmitting;
-		*heave = -store->SoundingData.heaveWhileTransmitting;
-
-		/* print debug statements */
-		if (verbose >= 5)
-			{
-			fprintf(stderr,"\ndbg4  Data extracted by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  Extracted values:\n");
-			fprintf(stderr,"dbg4       kind:       %d\n",
-				*kind);
-			fprintf(stderr,"dbg4       error:      %d\n",
-				*error);
-			fprintf(stderr,"dbg4       time_i[0]:  %d\n",
-				time_i[0]);
-			fprintf(stderr,"dbg4       time_i[1]:  %d\n",
-				time_i[1]);
-			fprintf(stderr,"dbg4       time_i[2]:  %d\n",
-				time_i[2]);
-			fprintf(stderr,"dbg4       time_i[3]:  %d\n",
-				time_i[3]);
-			fprintf(stderr,"dbg4       time_i[4]:  %d\n",
-				time_i[4]);
-			fprintf(stderr,"dbg4       time_i[5]:  %d\n",
-				time_i[5]);
-			fprintf(stderr,"dbg4       time_i[6]:  %d\n",
-				time_i[6]);
-			fprintf(stderr,"dbg4       time_d:     %f\n",
-				*time_d);
-			fprintf(stderr,"dbg4       longitude:  %f\n",
-				*navlon);
-			fprintf(stderr,"dbg4       latitude:   %f\n",
-				*navlat);
-			fprintf(stderr,"dbg4       speed:      %f\n",
-				*speed);
-			fprintf(stderr,"dbg4       heading:    %f\n",
-				*heading);
-			fprintf(stderr,"dbg4       draft:      %f\n",
-				*draft);
-			fprintf(stderr,"dbg4       roll:       %f\n",
-				*roll);
-			fprintf(stderr,"dbg4       pitch:      %f\n",
-				*pitch);
-			fprintf(stderr,"dbg4       heave:      %f\n",
-				*heave);
-			}
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind == MB_DATA_DATA)
-		{
-		fprintf(stderr,"dbg2       time_i[0]:     %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:     %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:     %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:     %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:     %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:     %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:     %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:        %f\n",*time_d);
-		fprintf(stderr,"dbg2       longitude:     %f\n",*navlon);
-		fprintf(stderr,"dbg2       latitude:      %f\n",*navlat);
-		fprintf(stderr,"dbg2       speed:         %f\n",*speed);
-		fprintf(stderr,"dbg2       heading:       %f\n",*heading);
-		fprintf(stderr,"dbg2       draft:         %f\n",*draft);
-		fprintf(stderr,"dbg2       roll:          %f\n",*roll);
-		fprintf(stderr,"dbg2       pitch:         %f\n",*pitch);
-		fprintf(stderr,"dbg2       heave:         %f\n",*heave);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_surf_insert_nav(int verbose, void *mbio_ptr, void *store_ptr,
-		int time_i[7], double time_d,
-		double navlon, double navlat,
-		double speed, double heading, double draft,
-		double roll, double pitch, double heave,
-		int *error)
-{
-	char	*function_name = "mbsys_surf_insert_nav";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_surf_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       time_i[0]:  %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:  %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:  %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:  %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:  %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:  %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:  %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:     %f\n",time_d);
-		fprintf(stderr,"dbg2       navlon:     %f\n",navlon);
-		fprintf(stderr,"dbg2       navlat:     %f\n",navlat);
-		fprintf(stderr,"dbg2       speed:      %f\n",speed);
-		fprintf(stderr,"dbg2       heading:    %f\n",heading);
-		fprintf(stderr,"dbg2       draft:      %f\n",draft);
-		fprintf(stderr,"dbg2       roll:       %f\n",roll);
-		fprintf(stderr,"dbg2       pitch:      %f\n",pitch);
-		fprintf(stderr,"dbg2       heave:      %f\n",heave);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_surf_struct *) store_ptr;
-
-	/* insert data in structure */
-	if (store->kind == MB_DATA_DATA)
-		{
-		/* get time */
-		store->SoundingData.relTime = (float) (time_d
-		    - store->AbsoluteStartTimeOfProfile);
-
-		/* get navigation */
-		store->CenterPosition[0].centerPositionX = (float)
-			(DTR * navlon - store->GlobalData.referenceOfPositionX);
-		store->CenterPosition[0].centerPositionY = (float)
-			(DTR * navlat - store->GlobalData.referenceOfPositionY);
-
-		/* get heading */
-		store->SoundingData.headingWhileTransmitting = (float) (DTR * heading);
-
-		/* get speed  */
-		store->CenterPosition[0].speed = (float) (speed / 3.6);
-
-		/* get draft  */
-		store->ActualTransducerTable.transducerDepth = draft;
-
-		/* get roll pitch and heave */
-		store->SoundingData.rollWhileTransmitting = (float) (DTR * roll);
-		store->SoundingData.pitchWhileTransmitting = (float) (-DTR * pitch);
-		store->SoundingData.heaveWhileTransmitting = (float) (-heave);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_surf_extract_svp(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int *nsvp,
-		double *depth, double *velocity,
-		int *error)
-{
-	char	*function_name = "mbsys_surf_extract_svp";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_surf_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_surf_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA &&
-		store->ActualCProfileTable.numberOfActualValues > 0)
-		{
-		/* get number of depth-velocity pairs */
-		*nsvp = store->ActualCProfileTable.numberOfActualValues;
-
-		/* get profile */
-		for (i=0;i<*nsvp;i++)
-			{
-			depth[i] = store->ActualCProfileTable.values[i].depth;
-			velocity[i] = store->ActualCProfileTable.values[i].cValue;
-			}
-
-		/* done translating values */
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:              %d\n",*kind);
-		fprintf(stderr,"dbg2       nsvp:              %d\n",*nsvp);
-		for (i=0;i<*nsvp;i++)
-		    fprintf(stderr,"dbg2       depth[%d]: %f   velocity[%d]: %f\n",i, depth[i], i, velocity[i]);
-		fprintf(stderr,"dbg2       error:             %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:            %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_surf_insert_svp(int verbose, void *mbio_ptr, void *store_ptr,
-		int nsvp,
-		double *depth, double *velocity,
-		int *error)
-{
-	char	*function_name = "mbsys_surf_insert_svp";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_surf_struct *store;
-	int	kind;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       nsvp:       %d\n",nsvp);
-		for (i=0;i<nsvp;i++)
-		    fprintf(stderr,"dbg2       depth[%d]: %f   velocity[%d]: %f\n",i, depth[i], i, velocity[i]);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_surf_struct *) store_ptr;
-
-	/* get data kind */
-	kind = store->kind;
-
-	/* insert data in structure */
-	if (kind == MB_DATA_DATA && nsvp > 0)
-		{
-		store->NrSoundvelocityProfiles++;
-
-		/* set number of depth-velocity pairs */
-		store->ActualCProfileTable.numberOfActualValues
-			= MIN(nsvp, MBSYS_SURF_MAXCVALUES);
-
-		/* set profile */
-		for (i=0;i<store->ActualCProfileTable.numberOfActualValues;i++)
-			{
-			store->ActualCProfileTable.values[i].depth = depth[i];
-			store->ActualCProfileTable.values[i].cValue = velocity[i];
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_surf_copy(int verbose, void *mbio_ptr,
-			void *store_ptr, void *copy_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_surf_copy";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_surf_struct *store;
-	struct mbsys_surf_struct *copy;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       copy_ptr:   %p\n",(void *)copy_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointers */
-	store = (struct mbsys_surf_struct *) store_ptr;
-	copy = (struct mbsys_surf_struct *) copy_ptr;
-
-	/* copy the main structure */
-	*copy = *store;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mbsys_surf.h b/src/mbio/mbsys_surf.h
deleted file mode 100644
index 7b684a4..0000000
--- a/src/mbio/mbsys_surf.h
+++ /dev/null
@@ -1,212 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbsys_surf.h	6/13/02
- *	$Id: mbsys_surf.h 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 2002-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbsys_surf.h defines the MBIO data structures for handling data from
- * SAM Electronics multibeam sonars in the Atlas processing format SURF.
- * The relevant sonars include Hydrosweep DS2, MD2 and Fansweep sonars.
- * The older  Hydrosweep DS and MD sonars produce data in different
- * formats (e.g. 21-24 and 101-102).
- * The data format associated with the SURF format is:
- *    MBSYS_SURF formats (code in mbsys_surf.c and mbsys_surf.h):
- *      MBF_SAMESURF : MBIO ID 181 - Vendor processing format
- *
- *
- * Author:	D. W. Caress
- * Author:	D. N. Chayes
- * Date:	June 13, 2002
- *
- * $Log: mbsys_surf.h,v $
- * Revision 5.9  2005/11/05 00:48:04  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.8  2003/11/24 21:09:09  caress
- * Implement Reinhard Holtkamp's suggested mods for better SURF format support.
- *
- * Revision 5.7  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.6  2003/03/10 20:04:45  caress
- * Added mr1pr library.
- *
- * Revision 5.5  2003/02/27 04:33:33  caress
- * Fixed handling of SURF format data.
- *
- * Revision 5.4  2002/07/20 20:42:40  caress
- * Release 5.0.beta20
- *
- * Revision 5.3  2001/12/18 04:27:45  caress
- * Release 5.0.beta11.
- *
- * Revision 5.2  2001/08/10 22:41:19  dcaress
- * Release 5.0.beta07
- *
- * Revision 5.1  2001-07-19 17:32:54-07  caress
- * Release 5.0.beta03
- *
- * Revision 5.0  2001/06/29  22:49:07  caress
- * Added support for HSDS2RAW
- *
- *
- */
-/*
- * Notes on the MBSYS_SURF data structure:
- *
- * 1) STN Atlas Marine Electronics (aka SAM) sonars write raw data in real-time
- *    as binary XDR encoded data. Files are stored on disk by the HYDROMAP
- *    Online workstation. The workstation on the Ewing is an HP Vectra
- *    running SuSe Linux (2.2 kernel.)
- *
- * 2) The HYDROMAP Offline software translates the data into a processing
- *    format called SURF
- *
- * 3) Multiple parallel files are created. For example:
- *      The '.six' file contains global data and reference tables
- *      The '.sda' file contains sounding dependent mass data
- *
- * 4) SAM provides an open source library (SAPI) to read and write
- *    SURF data
- */
-
-/* include mb_define.h */
-#ifndef MB_DEFINE_DEF
-#include "mb_define.h"
-#endif
-
-/* include SAPI header file */
-#ifndef _SAPI
-#include "mb_sapi.h"
-#endif
-
-#define	MBSYS_SURF_MAXBEAMS		1440
-#define	MBSYS_SURF_MAXCVALUES		1024
-#define	MBSYS_SURF_MAXCPOS		16
-#define	MBSYS_SURF_MAXRXSETS		1024
-#define	MBSYS_SURF_MAXTXSETS		16
-#define	MBSYS_SURF_MAXPIXELS		4096
-
-/* internal data structure for survey data */
-struct mbsys_surf_struct
-	{
-	/* MBIO data record kind */
-	int		kind;
-
-	/* global info initialization flag */
-	int		initialized;
-
-	/* surf global info */
-	char	NameOfShip[LABEL_SIZE];
-	char	TypeOfSounder[LABEL_SIZE];
-	char	NameOfSounder[LABEL_SIZE];
-	int	NrSoundings;
-	int	NrBeams;
-	int NrSidescan;
-	int	NrDepths;			/*	should be either 0 or NrBeams */
-	int	NrTravelTimes;		/*	should be either 0 or NrBeams */
-	int NrRxSets;			/*	should be either 0 or NrBeams */
-	int NrAmplitudes;		/*	should be either 0 or NrBeams */
-	int NrExtAmplitudes;	/*	should be either 0 or NrBeams */
-	int NrTxSets;			/*  missing in "SurfTxParameter"  */
-	int	SAPI_posPresentationIsRad;
-	int	NrPositionsensors;
-	int	NrSoundvelocityProfiles;
-	int	NrEvents;
-	int	NrPolygonElements;
-	double	AbsoluteStartTimeOfProfile;
-
-	/* SURF structures */
-	SurfGlobalData			GlobalData;
-	SurfStatistics			Statistics;
-	SurfPositionAnySensor		PositionSensor[MBSYS_SURF_MAXCPOS];
-	SurfSoundingData		SoundingData;
-	SurfTransducerParameterTable	ActualTransducerTable;
-	SurfMultiBeamAngleTable		ActualAngleTable;
-	float				reserved1[MBSYS_SURF_MAXBEAMS - 1];
-	SurfCProfileTable		ActualCProfileTable;
-	CProfileValues			reserved2[MBSYS_SURF_MAXCVALUES - 1];
-	SurfCenterPosition		CenterPosition[MBSYS_SURF_MAXCPOS];
-	SurfSingleBeamDepth		SingleBeamDepth;
-	SurfMultiBeamDepth		MultiBeamDepth[MBSYS_SURF_MAXBEAMS];
-	SurfMultiBeamTT			MultiBeamTraveltime[MBSYS_SURF_MAXBEAMS];
-	SurfMultiBeamReceive		MultiBeamReceiveParams[MBSYS_SURF_MAXBEAMS];
-	SurfAmplitudes			MultibeamBeamAmplitudes[MBSYS_SURF_MAXBEAMS];
-	SurfExtendedAmplitudes		MultibeamExtendedBeamAmplitudes[MBSYS_SURF_MAXBEAMS];
-	SurfSignalParameter		MultibeamSignalParameters;
-	TvgRxSets			reserved3[MBSYS_SURF_MAXRXSETS - 1];
-	SurfTxParameter			MultibeamTransmitterParameters;
-	TxSets				reserved4[MBSYS_SURF_MAXTXSETS - 1];
-	SurfSidescanData		SidescanData;
-	u_char				reserved5[MBSYS_SURF_MAXPIXELS - 1];
-	};
-
-/* system specific function prototypes */
-int mbsys_surf_alloc(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error);
-int mbsys_surf_deall(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error);
-int mbsys_surf_dimensions(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int *nbath, int *namp, int *nss, int *error);
-int mbsys_surf_extract(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int time_i[7], double *time_d,
-			double *navlon, double *navlat,
-			double *speed, double *heading,
-			int *nbath, int *namp, int *nss,
-			char *beamflag, double *bath, double *amp,
-			double *bathacrosstrack, double *bathalongtrack,
-			double *ss, double *ssacrosstrack, double *ssalongtrack,
-			char *comment, int *error);
-int mbsys_surf_insert(int verbose, void *mbio_ptr, void *store_ptr,
-			int kind, int time_i[7], double time_d,
-			double navlon, double navlat,
-			double speed, double heading,
-			int nbath, int namp, int nss,
-			char *beamflag, double *bath, double *amp,
-			double *bathacrosstrack, double *bathalongtrack,
-			double *ss, double *ssacrosstrack, double *ssalongtrack,
-			char *comment, int *error);
-int mbsys_surf_ttimes(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int *nbeams,
-			double *ttimes, double *angles,
-			double *angles_forward, double *angles_null,
-			double *heave, double *alongtrack_offset,
-			double *draft, double *ssv, int *error);
-int mbsys_surf_detects(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int *nbeams, int *detects, int *error);
-int mbsys_surf_extract_altitude(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, double *transducer_depth, double *altitude,
-			int *error);
-int mbsys_surf_extract_nav(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int time_i[7], double *time_d,
-			double *navlon, double *navlat,
-			double *speed, double *heading, double *draft,
-			double *roll, double *pitch, double *heave,
-			int *error);
-int mbsys_surf_insert_nav(int verbose, void *mbio_ptr, void *store_ptr,
-			int time_i[7], double time_d,
-			double navlon, double navlat,
-			double speed, double heading, double draft,
-			double roll, double pitch, double heave,
-			int *error);
-int mbsys_surf_extract_svp(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind,
-			int *nsvp,
-			double *depth, double *velocity,
-			int *error);
-int mbsys_surf_insert_svp(int verbose, void *mbio_ptr, void *store_ptr,
-			int nsvp,
-			double *depth, double *velocity,
-			int *error);
-int mbsys_surf_copy(int verbose, void *mbio_ptr,
-			void *store_ptr, void *copy_ptr,
-			int *error);
diff --git a/src/mbio/mbsys_swathplus.c b/src/mbio/mbsys_swathplus.c
deleted file mode 100644
index d69378d..0000000
--- a/src/mbio/mbsys_swathplus.c
+++ /dev/null
@@ -1,7019 +0,0 @@
-/*-------------------------------------------------------------------
- *    The MB-system:	mbsys_swathplus.c	3.00	1/27/2014
- *	$Id: mbsys_swathplus.c 2247 2015-05-29 21:28:28Z caress $
- *
- *    Copyright (c) 2014-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-
-/*
- * mbsys_swathplus.c contains the MBIO functions for handling data from
- * SEA SWATHplus interferometric formats:
- *      MBF_SWPLSSXI : MBIO ID 221 - SWATHplus intermediate format
- *      MBF_SWPLSSXP : MBIO ID 221 - SWATHplus processed format
- *
- * Author:	David Finlayson and D. W. Caress
- * Date:	Aug 29, 2013
- *
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mb_define.h"
-#include "mbsys_swathplus.h"
-
-static int set_identity(int verbose, swpls_matrix *m, int *error);
-static int concat_transform(int verbose, swpls_matrix *a, swpls_matrix *b,
-	int *error);
-static int get_sxp_heave(int verbose, swpls_sxpping *sxp_sxpping, double *heave,
-	int *error);
-static int set_sxp_height(int verbose, double heave, swpls_sxpping *sxp_ping,
-	int *error);
-int swpls_angles_to_quat(int verbose, const swpls_angles *orientation,
-	swpls_quaternion *q, int *error);
-int swpls_quat_to_angles(int verbose, const swpls_quaternion *q,
-	swpls_angles *orientation, int *error);
-int swpls_slerp(int verbose, const swpls_quaternion *q0,
-	const swpls_quaternion *q1, double t, swpls_quaternion *q,
-	int *error);
-static double wrap_pi(double theta);
-
-static char rcs_id[] =
-	"$Id: mbsys_swathplus.c 2247 2015-05-29 21:28:28Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mbsys_swathplus_alloc(int verbose, void *mbio_ptr, void **store_ptr,
-	int *error)
-{
-	char *function_name = "mbsys_swathplus_alloc";
-	int status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_swathplus_struct *store;
-	int i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> called\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n");
-		fprintf(stderr, "dbg2       verbose:    %d\n", verbose);
-		fprintf(stderr, "dbg2       mbio_ptr:   %p\n", (void *)mbio_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *)mbio_ptr;
-
-	/* allocate memory for data structure */
-	status =
-		mb_mallocd(verbose, __FILE__, __LINE__,
-		sizeof(struct mbsys_swathplus_struct), (void **)store_ptr,
-		error);
-
-	/* initialize allocated structure to zero */
-	if (status == MB_SUCCESS)
-		{
-		memset(*store_ptr, 0, sizeof(struct mbsys_swathplus_struct));
-		}
-
-	/* get data structure pointer */
-	store = (struct mbsys_swathplus_struct *)*store_ptr;
-
-	/* initialize everything */
-
-	/* Type of data record kind */
-	store->kind = MB_DATA_NONE;
-	store->type = SWPLS_ID_NONE;
-
-
-	/* initialize MB-System time stamp */
-	store->time_d = 0;
-	for (i = 0; i < 7; i++)
-		{
-		store->time_i[i] = 0;
-		}
-
-	/* initialize projection set */
-	store->projection_set = MB_NO;
-	store->projection.projection_alloc = 0;
-	store->projection.projection_id = NULL;
-	
-	/* initialize comment struct */
-	store->comment.message_alloc = 0;
-	store->comment.message = NULL;
-	
-	/* initialize sxp structs */
-	store->sxp_header_set = MB_NO;
-	store->sxp_ping.points_alloc = 0;
-	store->sxp_ping.points = NULL;
-
-	/* initialize sxi structs */
-	store->sxi_header_set = MB_NO;
-	store->sxi_ping.samps_alloc = 0;
-	store->sxi_ping.sampnum = NULL;
-	store->sxi_ping.angle = NULL;
-	store->sxi_ping.amplitude = NULL;
-	store->sxi_ping.quality = NULL;
-	
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		fprintf(stderr, "dbg2       store_ptr:  %p\n", (void *)*store_ptr);
-		fprintf(stderr, "dbg2       error:      %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2       status:     %d\n", status);
-		}
-
-	/* return status */
-	return (status);
-}	/* mbsys_swathplus_alloc */
-/*--------------------------------------------------------------------*/
-int mbsys_swathplus_deall(int verbose, void *mbio_ptr, void **store_ptr,
-	int *error)
-{
-	char *function_name = "mbsys_swathplus_deall";
-	int status = MB_SUCCESS;
-	struct mbsys_swathplus_struct *store;
-	swpls_sxpping *sxp_ping;
-	swpls_sxiping *sxi_ping;
-	swpls_projection *projection;
-	swpls_comment *comment;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> called\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n");
-		fprintf(stderr, "dbg2       verbose:    %d\n", verbose);
-		fprintf(stderr, "dbg2       mbio_ptr:   %p\n", (void *)mbio_ptr);
-		fprintf(stderr, "dbg2       store_ptr:  %p\n", (void *)*store_ptr);
-		}
-
-	/* get data structure pointer */
-	store = (struct mbsys_swathplus_struct *)*store_ptr;
-	sxp_ping = (swpls_sxpping *)&(store->sxp_ping);
-	sxi_ping = (swpls_sxiping *)&(store->sxi_ping);
-	projection = (swpls_projection *)&(store->projection);
-	comment = (swpls_comment *)&(store->comment);
-
-	/* deallocate any arrays or structures contained within the store data
-	   structure */
-	if (sxp_ping->points != NULL)
-		{
-		mb_freed(verbose, __FILE__, __LINE__, (void **)&(sxp_ping->points),
-			error);
-		sxp_ping->points_alloc = 0;
-		}
-	if (sxi_ping->sampnum != NULL)
-		{
-		mb_freed(verbose, __FILE__, __LINE__, (void **)&(sxi_ping->sampnum),
-			error);
-		mb_freed(verbose, __FILE__, __LINE__, (void **)&(sxi_ping->angle),
-			error);
-		mb_freed(verbose, __FILE__, __LINE__, (void **)&(sxi_ping->amplitude),
-			error);
-		mb_freed(verbose, __FILE__, __LINE__, (void **)&(sxi_ping->quality),
-			error);
-		sxi_ping->samps_alloc = 0;
-		}
-	if (projection->projection_id != NULL)
-		{
-		mb_freed(verbose, __FILE__, __LINE__, (void **)&(projection->projection_id),
-			error);
-		projection->projection_alloc = 0;
-		}
-	if (comment->message != NULL)
-		{
-		mb_freed(verbose, __FILE__, __LINE__, (void **)&(comment->message),
-			error);
-		comment->message_alloc = 0;
-		}
-
-	/* deallocate memory for data structure */
-	status = mb_freed(verbose, __FILE__, __LINE__, (void **)store_ptr, error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		fprintf(stderr, "dbg2       error:      %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2       status:     %d\n", status);
-		}
-
-	/* return status */
-	return (status);
-}	/* mbsys_swathplus_deall */
-/*--------------------------------------------------------------------*/
-int mbsys_swathplus_dimensions(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, int *nbath, int *namp, int *nss,
-	int *error)
-{
-	char *function_name = "mbsys_swathplus_dimensions";
-	int status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_swathplus_struct *store;
-	swpls_sxpping *sxp_ping;
-	swpls_sxiping *sxi_ping;
-	int type;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> called\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n");
-		fprintf(stderr, "dbg2       verbose:    %d\n", verbose);
-		fprintf(stderr, "dbg2       mb_ptr:     %p\n", (void *)mbio_ptr);
-		fprintf(stderr, "dbg2       store_ptr:  %p\n", (void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *)mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_swathplus_struct *)store_ptr;
-	sxp_ping = (swpls_sxpping *)&(store->sxp_ping);
-	sxi_ping = (swpls_sxiping *)&(store->sxi_ping);
-
-	/* get data kind */
-	*kind = store->kind;
-	type = store->type;
-
-	/* extract data from structure */
-	if ((*kind == MB_DATA_DATA) &&
-		((type == SWPLS_ID_PROCESSED_PING) ||
-		(type == SWPLS_ID_PROCESSED_PING2)))
-		{
-		/* SXP Files */
-		*nbath = sxp_ping->nosampsfile;
-		*namp = sxp_ping->nosampsfile;
-		*nss = 0;
-		}
-	else if ((*kind == MB_DATA_DATA) && (type == SWPLS_ID_PARSED_PING))
-		{
-		/* SXI Files */
-		*nbath = sxi_ping->nosamps;
-		*namp = sxi_ping->nosamps;
-		*nss = 0;
-		}
-	else
-		{
-		/* everything else */
-		*nbath = 0;
-		*namp = 0;
-		*nss = 0;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		fprintf(stderr, "dbg2       kind:       %d\n", *kind);
-		fprintf(stderr, "dbg2       nbath:      %d\n", *nbath);
-		fprintf(stderr, "dbg2       namp:       %d\n", *namp);
-		fprintf(stderr, "dbg2       nss:        %d\n", *nss);
-		fprintf(stderr, "dbg2       error:      %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2       status:     %d\n", status);
-		}
-
-	/* return status */
-	return (status);
-}	/* mbsys_swathplus_dimensions */
-/*--------------------------------------------------------------------*/
-int mbsys_swathplus_pingnumber(int verbose, void *mbio_ptr, int *pingnumber,
-	int *error)
-{
-	char *function_name = "mbsys_swathplus_pingnumber";
-	int status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_swathplus_struct *store;
-	swpls_sxpping *sxp_ping;
-	swpls_sxiping *sxi_ping;
-	int kind, type;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> called\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n");
-		fprintf(stderr, "dbg2       verbose:    %d\n", verbose);
-		fprintf(stderr, "dbg2       mb_ptr:     %p\n", (void *)mbio_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *)mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_swathplus_struct *)mb_io_ptr->store_data;
-	sxp_ping = (swpls_sxpping *)&(store->sxp_ping);
-	sxi_ping = (swpls_sxiping *)&(store->sxi_ping);
-
-	/* get data kind */
-	kind = store->kind;
-	type = store->type;
-
-	/* extract data from structure */
-	if ((kind == MB_DATA_DATA) &&
-		((type == SWPLS_ID_PROCESSED_PING) ||
-		(type == SWPLS_ID_PROCESSED_PING2)))
-		{
-		*pingnumber = store->sxp_ping.pingnumber;
-		}
-	else if ((kind == MB_DATA_DATA) && (type == SWPLS_ID_PARSED_PING))
-		{
-		*pingnumber = store->sxi_ping.pingnumber;
-		}
-	else
-		{
-		*pingnumber = -1;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		fprintf(stderr, "dbg2       pingnumber: %d\n", *pingnumber);
-		fprintf(stderr, "dbg2       error:      %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2       status:     %d\n", status);
-		}
-
-	/* return status */
-	return (status);
-}	/* mbsys_swathplus_pingnumber */
-/*--------------------------------------------------------------------*/
-int mbsys_swathplus_sonartype(int verbose, void *mbio_ptr, void *store_ptr,
-	int *sonartype, int *error)
-{
-	char *function_name = "mbsys_swathplus_sonartype";
-	int status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_swathplus_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> called\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n");
-		fprintf(stderr, "dbg2       verbose:    %d\n", verbose);
-		fprintf(stderr, "dbg2       mb_ptr:     %p\n", (void *)mbio_ptr);
-		fprintf(stderr, "dbg2       store_ptr:  %p\n", (void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *)mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_swathplus_struct *)store_ptr;
-
-	/* get sonar type */
-	*sonartype = MB_TOPOGRAPHY_TYPE_INTERFEROMETRIC;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		fprintf(stderr, "dbg2       sonartype:  %d\n", *sonartype);
-		fprintf(stderr, "dbg2       error:      %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2       status:     %d\n", status);
-		}
-
-	/* return status */
-	return (status);
-}	/* mbsys_swathplus_sonartype */
-/*--------------------------------------------------------------------*/
-int mbsys_swathplus_sidescantype(int verbose, void *mbio_ptr, void *store_ptr,
-	int *ss_type, int *error)
-{
-	char *function_name = "mbsys_swathplus_sidescantype";
-	int status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_swathplus_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> called\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n");
-		fprintf(stderr, "dbg2       verbose:    %d\n", verbose);
-		fprintf(stderr, "dbg2       mb_ptr:     %p\n", (void *)mbio_ptr);
-		fprintf(stderr, "dbg2       store_ptr:  %p\n", (void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *)mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_swathplus_struct *)store_ptr;
-
-	/* get sidescan type */
-	*ss_type = MB_SIDESCAN_LOGARITHMIC;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		fprintf(stderr, "dbg2       ss_type:    %d\n", *ss_type);
-		fprintf(stderr, "dbg2       error:      %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2       status:     %d\n", status);
-		}
-
-	/* return status */
-	return (status);
-}	/* mbsys_swathplus_sidescantype */
-/*--------------------------------------------------------------------*/
-int mbsys_swathplus_extract(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, int time_i[7], double *time_d,
-	double *navlon, double *navlat, double *speed,
-	double *heading, int *nbath, int *namp, int *nss,
-	char *beamflag, double *bath, double *amp,
-	double *bathacrosstrack, double *bathalongtrack,
-	double *ss, double *ssacrosstrack,
-	double *ssalongtrack, char *comment, int *error)
-{
-	char *function_name = "mbsys_swathplus_extract";
-	int status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_swathplus_struct *store;
-	swpls_sxpping *sxp_ping;
-	swpls_sxiping *sxi_ping;
-	swpls_point *points;
-	swpls_matrix wtov;
-	int type;
-	int i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> called\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n");
-		fprintf(stderr, "dbg2       verbose:    %d\n", verbose);
-		fprintf(stderr, "dbg2       mb_ptr:     %p\n", (void *)mbio_ptr);
-		fprintf(stderr, "dbg2       store_ptr:  %p\n", (void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *)mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_swathplus_struct *)store_ptr;
-	sxp_ping = (swpls_sxpping *)&(store->sxp_ping);
-	sxi_ping = (swpls_sxiping *)&(store->sxi_ping);
-
-	/* get data kind */
-	*kind = store->kind;
-	type = store->type;
-
-	/* extract data from structure */
-	if ((*kind == MB_DATA_DATA) &&
-		((type == SWPLS_ID_PROCESSED_PING) ||
-		(type == SWPLS_ID_PROCESSED_PING2)))
-		{
-		/* get time */
-		for (i = 0; i < 7; i++)
-			{
-			time_i[i] = store->time_i[i];
-			}
-		*time_d = store->time_d;
-
-		/* get navigation (probably projected coordinates) */
-		*navlon = sxp_ping->txer_e;
-		*navlat = sxp_ping->txer_n;
-
-		/* get speed */
-		*heading = sxp_ping->heading;
-		*speed = 0.0;
-		if (mb_io_ptr->nfix > 0)
-			{
-			mb_navint_prjinterp(verbose, mbio_ptr, store->time_d, *heading, *speed,
-				navlon, navlat, speed, error);
-			}
-
-		/* reset heading */
-		*heading = sxp_ping->heading;
-
-		/* set beamwidths in mb_io structure based on sonar frequency (Hz) */
-		if (sxp_ping->frequency < 200000.0)
-			{
-			mb_io_ptr->beamwidth_xtrack = SWPLS_TYPE_L_BEAM_WIDTH;
-			mb_io_ptr->beamwidth_ltrack = SWPLS_TYPE_L_BEAM_WIDTH;
-			}
-		else if (sxp_ping->frequency < 400000.0)
-			{
-			mb_io_ptr->beamwidth_xtrack = SWPLS_TYPE_M_BEAM_WIDTH;
-			mb_io_ptr->beamwidth_ltrack = SWPLS_TYPE_M_BEAM_WIDTH;
-			}
-		else
-			{
-			mb_io_ptr->beamwidth_xtrack = SWPLS_TYPE_H_BEAM_WIDTH;
-			mb_io_ptr->beamwidth_ltrack = SWPLS_TYPE_H_BEAM_WIDTH;
-			}
-
-		/* read distance and depth values into storage arrays */
-		*nbath = sxp_ping->nosampsfile;
-		*namp = *nbath;
-
-		swpls_init_transform(verbose, &wtov, error);
-		swpls_concat_translate(verbose, &wtov, -(sxp_ping->txer_e), 0.0,
-			-(sxp_ping->txer_n), error);
-		swpls_concat_rotate_y(verbose, &wtov, -(sxp_ping->heading) * DTR,
-			error);
-
-		points = sxp_ping->points;
-		for (i = 0; i < *nbath; i++)
-			{
-			swpls_vector ppos;
-
-			ppos.x = points[i].x;
-			ppos.y = -(points[i].z);
-			ppos.z = points[i].y;
-
-			swpls_transform(verbose, &wtov, &ppos, error);
-
-			if (points[i].status != SWPLS_POINT_REJECTED)
-				{
-				beamflag[i] = MB_FLAG_NONE;
-				}
-			else
-				{
-				beamflag[i] = MB_FLAG_FLAG + MB_FLAG_FILTER;
-				}
-
-			bath[i] = -(ppos.y);
-			bathacrosstrack[i] = ppos.x;
-			bathalongtrack[i] = ppos.z;
-			amp[i] = points[i].procamp;
-			}
-
-		/* extract sidescan */
-		*nss = 0;
-
-		/* print debug statements */
-		if (verbose >= 5)
-			{
-			fprintf(stderr, "\ndbg4  Data extracted by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr, "dbg4  Extracted values:\n");
-			fprintf(stderr, "dbg4       kind:       %d\n", *kind);
-			fprintf(stderr, "dbg4       error:      %d\n", *error);
-			fprintf(stderr, "dbg4       time_i[0]:  %d\n", time_i[0]);
-			fprintf(stderr, "dbg4       time_i[1]:  %d\n", time_i[1]);
-			fprintf(stderr, "dbg4       time_i[2]:  %d\n", time_i[2]);
-			fprintf(stderr, "dbg4       time_i[3]:  %d\n", time_i[3]);
-			fprintf(stderr, "dbg4       time_i[4]:  %d\n", time_i[4]);
-			fprintf(stderr, "dbg4       time_i[5]:  %d\n", time_i[5]);
-			fprintf(stderr, "dbg4       time_i[6]:  %d\n", time_i[6]);
-			fprintf(stderr, "dbg4       time_d:     %f\n", *time_d);
-			fprintf(stderr, "dbg4       longitude:  %f\n", *navlon);
-			fprintf(stderr, "dbg4       latitude:   %f\n", *navlat);
-			fprintf(stderr, "dbg4       speed:      %f\n", *speed);
-			fprintf(stderr, "dbg4       heading:    %f\n", *heading);
-			fprintf(stderr, "dbg4       nbath:      %d\n", *nbath);
-			for (i = 0; i < *nbath; i++)
-				{
-				fprintf(stderr,
-					"dbg4       beam:%d  flag:%3d  bath:%f  acrosstrack:%f  alongtrack:%f\n", i,
-					beamflag[i], bath[i], bathacrosstrack[i],
-					bathalongtrack[i]);
-				}
-			fprintf(stderr, "dbg4        namp:     %d\n", *namp);
-			for (i = 0; i < *namp; i++)
-				{
-				fprintf(stderr,
-					"dbg4        beam:%d   amp:%f  acrosstrack:%f  alongtrack:%f\n", i,
-					amp[i], bathacrosstrack[i], bathalongtrack[i]);
-				}
-			fprintf(stderr, "dbg4        nss:      %d\n", *nss);
-			for (i = 0; i < *nss; i++)
-				{
-				fprintf(stderr,
-					"dbg4        pixel:%d   ss:%f  acrosstrack:%f  alongtrack:%f\n", i,
-					ss[i], ssacrosstrack[i], ssalongtrack[i]);
-				}
-			}
-
-		/* done translating values */
-		}
-	/* extract comment from structure */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* get time */
-		for (i = 0; i < 7; i++)
-			{
-			time_i[i] = store->time_i[i];
-			}
-		*time_d = store->time_d;
-
-		/* copy comment */
-		if (store->comment.nchars > 0)
-			{
-			strncpy(comment, store->comment.message, MB_COMMENT_MAXLINE);
-			}
-		else
-			{
-			comment[0] = '\0';
-			}
-
-		/* print debug statements */
-		if (verbose >= 4)
-			{
-			fprintf(stderr, "\ndbg4  Comment extracted by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr, "dbg4  New ping values:\n");
-			fprintf(stderr, "dbg4       kind:       %d\n", *kind);
-			fprintf(stderr, "dbg4       error:      %d\n", *error);
-			fprintf(stderr, "dbg4       time_i[0]:  %d\n", time_i[0]);
-			fprintf(stderr, "dbg4       time_i[1]:  %d\n", time_i[1]);
-			fprintf(stderr, "dbg4       time_i[2]:  %d\n", time_i[2]);
-			fprintf(stderr, "dbg4       time_i[3]:  %d\n", time_i[3]);
-			fprintf(stderr, "dbg4       time_i[4]:  %d\n", time_i[4]);
-			fprintf(stderr, "dbg4       time_i[5]:  %d\n", time_i[5]);
-			fprintf(stderr, "dbg4       time_i[6]:  %d\n", time_i[6]);
-			fprintf(stderr, "dbg4       time_d:     %f\n", *time_d);
-			fprintf(stderr, "dbg4       comment:    %s\n", comment);
-			}
-		}
-	/* set time for other data records */
-	else
-		{
-		/* get time */
-		for (i = 0; i < 7; i++)
-			{
-			time_i[i] = store->time_i[i];
-			}
-		*time_d = store->time_d;
-
-		/* print debug statements */
-		if (verbose >= 4)
-			{
-			fprintf(stderr, "\ndbg4  Data extracted by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr, "dbg4  Extracted values:\n");
-			fprintf(stderr, "dbg4       kind:       %d\n", *kind);
-			fprintf(stderr, "dbg4       error:      %d\n", *error);
-			fprintf(stderr, "dbg4       time_i[0]:  %d\n", time_i[0]);
-			fprintf(stderr, "dbg4       time_i[1]:  %d\n", time_i[1]);
-			fprintf(stderr, "dbg4       time_i[2]:  %d\n", time_i[2]);
-			fprintf(stderr, "dbg4       time_i[3]:  %d\n", time_i[3]);
-			fprintf(stderr, "dbg4       time_i[4]:  %d\n", time_i[4]);
-			fprintf(stderr, "dbg4       time_i[5]:  %d\n", time_i[5]);
-			fprintf(stderr, "dbg4       time_i[6]:  %d\n", time_i[6]);
-			fprintf(stderr, "dbg4       time_d:     %f\n", *time_d);
-			fprintf(stderr, "dbg4       comment:    %s\n", comment);
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		fprintf(stderr, "dbg2       kind:       %d\n", *kind);
-		}
-	if ((verbose >= 2) && (*error <= MB_ERROR_NO_ERROR) &&
-		(*kind == MB_DATA_COMMENT))
-		{
-		fprintf(stderr, "dbg2       comment:     \ndbg2       %s\n", comment);
-		}
-	else if ((verbose >= 2) && (*error <= MB_ERROR_NO_ERROR) &&
-		(*kind != MB_DATA_COMMENT))
-		{
-		fprintf(stderr, "dbg2       time_i[0]:     %d\n", time_i[0]);
-		fprintf(stderr, "dbg2       time_i[1]:     %d\n", time_i[1]);
-		fprintf(stderr, "dbg2       time_i[2]:     %d\n", time_i[2]);
-		fprintf(stderr, "dbg2       time_i[3]:     %d\n", time_i[3]);
-		fprintf(stderr, "dbg2       time_i[4]:     %d\n", time_i[4]);
-		fprintf(stderr, "dbg2       time_i[5]:     %d\n", time_i[5]);
-		fprintf(stderr, "dbg2       time_i[6]:     %d\n", time_i[6]);
-		fprintf(stderr, "dbg2       time_d:        %f\n", *time_d);
-		}
-	if ((verbose >= 2) && ((*kind == MB_DATA_DATA) || (*kind == MB_DATA_NAV)))
-		{
-		fprintf(stderr, "dbg2       longitude:     %f\n", *navlon);
-		fprintf(stderr, "dbg2       latitude:      %f\n", *navlat);
-		fprintf(stderr, "dbg2       speed:         %f\n", *speed);
-		fprintf(stderr, "dbg2       heading:       %f\n", *heading);
-		}
-	if ((verbose >= 2) && (*error <= MB_ERROR_NO_ERROR) &&
-		(*kind == MB_DATA_DATA))
-		{
-		fprintf(stderr, "dbg2       nbath:      %d\n", *nbath);
-		for (i = 0; i < *nbath; i++)
-			{
-			fprintf(stderr,
-				"dbg2       beam:%d  flag:%3d  bath:%f  acrosstrack:%f  alongtrack:%f\n", i,
-				beamflag[i], bath[i], bathacrosstrack[i], bathalongtrack[i]);
-			}
-		fprintf(stderr, "dbg2        namp:     %d\n", *namp);
-		for (i = 0; i < *namp; i++)
-			{
-			fprintf(stderr,
-				"dbg2       beam:%d   amp:%f  acrosstrack:%f  alongtrack:%f\n",
-				i,
-				amp[i], bathacrosstrack[i], bathalongtrack[i]);
-			}
-		fprintf(stderr, "dbg2        nss:      %d\n", *nss);
-		for (i = 0; i < *nss; i++)
-			{
-			fprintf(stderr,
-				"dbg2        pixel:%d   ss:%f  acrosstrack:%f  alongtrack:%f\n",
-				i,
-				ss[i], ssacrosstrack[i], ssalongtrack[i]);
-			}
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "dbg2       error:      %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2       status:     %d\n", status);
-		}
-
-	/* return status */
-	return (status);
-}	/* mbsys_swathplus_extract */
-/*--------------------------------------------------------------------*/
-int mbsys_swathplus_insert(int verbose, void *mbio_ptr, void *store_ptr,
-	int kind, int time_i[7], double time_d,
-	double navlon, double navlat, double speed,
-	double heading, int nbath, int namp, int nss,
-	char *beamflag, double *bath, double *amp,
-	double *bathacrosstrack, double *bathalongtrack,
-	double *ss, double *ssacrosstrack,
-	double *ssalongtrack, char *comment, int *error)
-{
-	char *function_name = "mbsys_swathplus_insert";
-	int status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_swathplus_struct *store;
-	swpls_header *header;
-	swpls_sxpping *sxp_ping;
-	swpls_point *points;
-	swpls_comment *ocomment;
-	swpls_matrix vtow;
-	char path[MB_PATH_MAXLINE];
-	int i;
-	int nchars;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> called\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n");
-		fprintf(stderr, "dbg2       verbose:    %d\n", verbose);
-		fprintf(stderr, "dbg2       mbio_ptr:   %p\n", (void *)mbio_ptr);
-		fprintf(stderr, "dbg2       store_ptr:  %p\n", (void *)store_ptr);
-		fprintf(stderr, "dbg2       kind:       %d\n", kind);
-		}
-	if ((verbose >= 2) && (kind == MB_DATA_COMMENT))
-		{
-		fprintf(stderr, "dbg2       comment:     \ndbg2       %s\n", comment);
-		}
-	if ((verbose >= 2) && (kind != MB_DATA_COMMENT))
-		{
-		fprintf(stderr, "dbg2       time_i[0]:  %d\n", time_i[0]);
-		fprintf(stderr, "dbg2       time_i[1]:  %d\n", time_i[1]);
-		fprintf(stderr, "dbg2       time_i[2]:  %d\n", time_i[2]);
-		fprintf(stderr, "dbg2       time_i[3]:  %d\n", time_i[3]);
-		fprintf(stderr, "dbg2       time_i[4]:  %d\n", time_i[4]);
-		fprintf(stderr, "dbg2       time_i[5]:  %d\n", time_i[5]);
-		fprintf(stderr, "dbg2       time_i[6]:  %d\n", time_i[6]);
-		fprintf(stderr, "dbg2       time_d:     %f\n", time_d);
-		}
-	if ((verbose >= 2) && ((kind == MB_DATA_DATA) || (kind == MB_DATA_NAV)))
-		{
-		fprintf(stderr, "dbg2       navlon:     %f\n", navlon);
-		fprintf(stderr, "dbg2       navlat:     %f\n", navlat);
-		fprintf(stderr, "dbg2       speed:      %f\n", speed);
-		fprintf(stderr, "dbg2       heading:    %f\n", heading);
-		}
-	if ((verbose >= 2) && (kind == MB_DATA_DATA))
-		{
-		fprintf(stderr, "dbg2       nbath:      %d\n", nbath);
-		if (verbose >= 3)
-			{
-			for (i = 0; i < nbath; i++)
-				{
-				fprintf(stderr,
-					"dbg3       beam:%d  flag:%3d  bath:%f  acrosstrack:%f  alongtrack:%f\n", i,
-					beamflag[i], bath[i], bathacrosstrack[i],
-					bathalongtrack[i]);
-				}
-			}
-		fprintf(stderr, "dbg2       namp:       %d\n", namp);
-		if (verbose >= 3)
-			{
-			for (i = 0; i < namp; i++)
-				{
-				fprintf(stderr,
-					"dbg3        beam:%d   amp:%f  acrosstrack:%f  alongtrack:%f\n", i,
-					amp[i], bathacrosstrack[i], bathalongtrack[i]);
-				}
-			}
-		fprintf(stderr, "dbg2        nss:       %d\n", nss);
-		if (verbose >= 3)
-			{
-			for (i = 0; i < nss; i++)
-				{
-				fprintf(stderr,
-					"dbg3        beam:%d   ss:%f  acrosstrack:%f  alongtrack:%f\n", i,
-					ss[i], ssacrosstrack[i], ssalongtrack[i]);
-				}
-			}
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *)mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_swathplus_struct *)store_ptr;
-	header = (swpls_header *)&(store->sxp_header);
-	sxp_ping = (swpls_sxpping *)&(store->sxp_ping);
-	ocomment = (swpls_comment *)&(store->comment);
-
-	/* set data kind */
-	store->kind = kind;
-
-	/* insert data in structure */
-	if ((store->kind == MB_DATA_DATA) && (mb_io_ptr->format == MBF_SWPLSSXP))
-		{
-		/* get time */
-		for (i = 0; i < 7; i++)
-			{
-			store->time_i[i] = time_i[i];
-			}
-		store->time_d = time_d;
-		sxp_ping->time_d = time_d;
-
-		/* get the file name */
-		strncpy(path, mb_io_ptr->file, MB_PATH_MAXLINE);
-		mb_get_basename(verbose, &path[0], error);
-		strncpy(&(sxp_ping->linename[0]), &path[0], SWPLS_MAX_LINENAME);
-		sxp_ping->linename[SWPLS_MAX_LINENAME - 1] = '\0';
-
-		/* get navigation */
-		sxp_ping->easting = navlon;
-		sxp_ping->txer_e = navlon;
-		sxp_ping->northing = navlat;
-		sxp_ping->txer_n = navlat;
-
-		/* get heading */
-		sxp_ping->heading = heading;
-
-		/* get speed */
-
-		/* read distance and depth values into storage arrays */
-		sxp_ping->nosampsfile = nbath;
-		if (sxp_ping->points_alloc < nbath)
-			{
-			status =
-				mb_reallocd(verbose, __FILE__, __LINE__,
-				nbath * sizeof(swpls_point),
-				(void **)&(sxp_ping->points), error);
-			if (status != MB_SUCCESS)
-				{
-				sxp_ping->points_alloc = 0;
-				}
-			else
-				{
-				sxp_ping->points_alloc = nbath;
-				}
-			}
-
-		if (status == MB_SUCCESS)
-			{
-			swpls_init_transform(verbose, &vtow, error);
-			swpls_concat_rotate_y(verbose, &vtow, sxp_ping->heading * DTR,
-				error);
-			swpls_concat_translate(verbose, &vtow, sxp_ping->txer_e, 0.0,
-				sxp_ping->txer_n, error);
-
-			points = store->sxp_ping.points;
-			for (i = 0; i < nbath; i++)
-				{
-				swpls_vector ppos;
-
-				ppos.x = bathacrosstrack[i];
-				ppos.y = -(bath[i]);
-				ppos.z = bathalongtrack[i];
-
-				swpls_transform(verbose, &vtow, &ppos, error);
-
-				points[i].sampnum = i;
-				points[i].x = ppos.x;
-				points[i].y = ppos.z;
-				points[i].z = -(ppos.y);
-				points[i].procamp = (int)amp[i];
-
-				if (beamflag[i] == MB_FLAG_NONE)
-					{
-					points[i].status = SWPLS_POINT_ACCEPTED;
-					}
-				else
-					{
-					points[i].status = SWPLS_POINT_REJECTED;
-					}
-				}
-			}
-		else
-			{
-			store->kind = MB_DATA_NONE;
-			}
-		}
-	/* insert comment in structure */
-	else if (store->kind == MB_DATA_COMMENT)
-		{
-		/* get time */
-		if (time_d > 0.0)
-			{
-			for (i = 0; i < 7; i++)
-				{
-				store->time_i[i] = time_i[i];
-				}
-			store->time_d = time_d;
-			}
-		else
-			{
-			store->time_d = (double)time(NULL);
-			mb_get_date(verbose, store->time_d, store->time_i);
-			}
-		ocomment->time_d = (int)trunc(store->time_d);
-		ocomment->microsec = 0;
-
-		/* allocate more memory for comment if necessary */
-		nchars = strnlen(comment, MB_COMMENT_MAXLINE) + 1;
-		if (ocomment->message_alloc < nchars)
-			{
-			status = mb_reallocd(verbose, __FILE__, __LINE__, nchars,
-				(void **)&(ocomment->message), error);
-			if (status != MB_SUCCESS)
-				{
-				ocomment->message_alloc = 0;
-				}
-			else
-				{
-				ocomment->message_alloc = nchars;
-				}
-			}
-
-		if (status == MB_SUCCESS)
-			{
-			ocomment->nchars = nchars;
-			strcpy(ocomment->message, comment);
-			}
-		else
-			{
-			kind = MB_DATA_NONE;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr, "dbg2  Return value:\n");
-		fprintf(stderr, "dbg2       error:      %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2       status:  %d\n", status);
-		}
-
-	/* return status */
-	return (status);
-}	/* mbsys_swathplus_insert */
-/*--------------------------------------------------------------------*/
-int mbsys_swathplus_ttimes(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, int *nbeams, double *ttimes,
-	double *angles, double *angles_forward,
-	double *angles_null, double *heave,
-	double *alongtrack_offset, double *draft,
-	double *ssv, int *error)
-{
-	char *function_name = "mbsys_swathplus_ttimes";
-	int status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_swathplus_struct *store;
-	swpls_sxpping *sxp_ping;
-	swpls_point *points;
-	int type;
-	double dist;
-	double alpha, beta, theta, phi;
-	int i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> called\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n");
-		fprintf(stderr, "dbg2       verbose:    %d\n", verbose);
-		fprintf(stderr, "dbg2       mb_ptr:     %p\n", (void *)mbio_ptr);
-		fprintf(stderr, "dbg2       store_ptr:  %p\n", (void *)store_ptr);
-		fprintf(stderr, "dbg2       ttimes:     %p\n", (void *)ttimes);
-		fprintf(stderr, "dbg2       angles_xtrk:%p\n", (void *)angles);
-		fprintf(stderr, "dbg2       angles_ltrk:%p\n", (void *)angles_forward);
-		fprintf(stderr, "dbg2       angles_null:%p\n", (void *)angles_null);
-		fprintf(stderr, "dbg2       heave:      %p\n", (void *)heave);
-		fprintf(stderr, "dbg2       ltrk_off:   %p\n",
-			(void *)alongtrack_offset);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *)mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_swathplus_struct *)store_ptr;
-	sxp_ping = (swpls_sxpping *)&(store->sxp_ping);
-
-	/* get data kind */
-	*kind = store->kind;
-	type = store->type;
-
-	/* extract data from structure */
-	if ((*kind == MB_DATA_DATA) &&
-		((type == SWPLS_ID_PROCESSED_PING) ||
-		(type == SWPLS_ID_PROCESSED_PING2)))
-		{
-		double sxpheave;
-		swpls_matrix wtov;
-
-		/* surface sound velocity */
-		*ssv = sxp_ping->sos;
-
-		/* get draft */
-		*draft = 0.0;
-
-		/* get travel times and angles into storage arrays */
-		get_sxp_heave(verbose, sxp_ping, &sxpheave, error);
-
-		/* transform samples from world to body axis */
-		swpls_init_transform(verbose, &wtov, error);
-		swpls_concat_translate(verbose, &wtov, -sxp_ping->txer_e,
-			-(-(sxp_ping->height - sxp_ping->tide)), -sxp_ping->txer_n, error);
-		swpls_concat_rotate_y(verbose, &wtov, -sxp_ping->heading, error);
-
-		points = sxp_ping->points;
-		for (i = 0; i < sxp_ping->nosampsfile; i++)
-			{
-			swpls_vector ppos;
-
-			/* point position relative to reference point */
-			ppos.x = points[i].x;
-			ppos.y = -(points[i].z);
-			ppos.z = points[i].y;
-
-			swpls_transform(verbose, &wtov, &ppos, error);
-
-			/* estimate ttime from slant range */
-			dist = sqrt(ppos.x * ppos.x + ppos.y * ppos.y + ppos.z * ppos.z);
-			ttimes[i] = 2 * dist / *ssv;
-
-			/* estimate takeoff angles from geometry */
-			alpha = atan2(ppos.z, -ppos.y);
-			beta = atan2(-ppos.y, ppos.x);
-
-			mb_rollpitch_to_takeoff(verbose, alpha * RTD, beta * RTD, &theta,
-				&phi, error);
-
-			angles[i] = theta;
-			angles_forward[i] = phi;
-			angles_null[i] = 0.0;
-			heave[i] = -sxpheave;
-			alongtrack_offset[i] = 0.0;
-			}
-
-		/* set status */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-
-		/* done translating values */
-		}
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		fprintf(stderr, "dbg2       kind:       %d\n", *kind);
-		}
-	if ((verbose >= 2) && (*error == MB_ERROR_NO_ERROR))
-		{
-		fprintf(stderr, "dbg2       draft:      %f\n", *draft);
-		fprintf(stderr, "dbg2       ssv:        %f\n", *ssv);
-		fprintf(stderr, "dbg2       nbeams:     %d\n", *nbeams);
-		for (i = 0; i < *nbeams; i++)
-			{
-			fprintf(stderr,
-				"dbg2       beam %d: tt:%f  angle_xtrk:%f  angle_ltrk:%f  angle_null:%f  depth_off:%f  ltrk_off:%f\n", i,
-				ttimes[i], angles[i], angles_forward[i], angles_null[i], heave[i],
-				alongtrack_offset[i]);
-			}
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "dbg2       error:      %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2       status:     %d\n", status);
-		}
-
-	/* return status */
-	return (status);
-}	/* mbsys_swathplus_ttimes */
-/*--------------------------------------------------------------------*/
-int mbsys_swathplus_detects(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, int *nbeams, int *detects, int *error)
-{
-	char *function_name = "mbsys_swathplus_detects";
-	int status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_swathplus_struct *store;
-	swpls_sxpping *sxp_ping;
-	int i;
-	int type;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> called\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n");
-		fprintf(stderr, "dbg2       verbose:    %d\n", verbose);
-		fprintf(stderr, "dbg2       mb_ptr:     %p\n", (void *)mbio_ptr);
-		fprintf(stderr, "dbg2       store_ptr:  %p\n", (void *)store_ptr);
-		fprintf(stderr, "dbg2       detects:    %p\n", (void *)detects);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *)mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_swathplus_struct *)store_ptr;
-	sxp_ping = (swpls_sxpping *)&(store->sxp_ping);
-
-	/* get data kind */
-	*kind = store->kind;
-	type = store->type;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get detect type for each sounding - options include:
-		    MB_DETECT_UNKNOWN
-		    MB_DETECT_AMPLITUDE
-		    MB_DETECT_PHASE
-		    MB_DETECT_UNKNOWN */
-		*nbeams = sxp_ping->nosampsfile;
-		for (i = 0; i < *nbeams; i++)
-			{
-			detects[i] = MB_DETECT_PHASE;
-			}
-
-		/* set status */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-
-		/* done translating values */
-		}
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		fprintf(stderr, "dbg2       kind:       %d\n", *kind);
-		}
-	if ((verbose >= 2) && (*error == MB_ERROR_NO_ERROR))
-		{
-		fprintf(stderr, "dbg2       nbeams:     %d\n", *nbeams);
-		for (i = 0; i < *nbeams; i++)
-			{
-			fprintf(stderr, "dbg2       beam %d: detects:%d\n", i, detects[i]);
-			}
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "dbg2       error:      %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2       status:     %d\n", status);
-		}
-
-	/* return status */
-	return (status);
-}	/* mbsys_swathplus_detects */
-/*--------------------------------------------------------------------*/
-int mbsys_swathplus_gains(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, double *transmit_gain,
-	double *pulse_length, double *receive_gain,
-	int *error)
-{
-	char *function_name = "mbsys_swathplus_gains";
-	int status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_swathplus_struct *store;
-	swpls_sxpping *sxp_ping;
-	int type;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> called\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n");
-		fprintf(stderr, "dbg2       verbose:    %d\n", verbose);
-		fprintf(stderr, "dbg2       mb_ptr:     %p\n", (void *)mbio_ptr);
-		fprintf(stderr, "dbg2       store_ptr:  %p\n", (void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *)mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_swathplus_struct *)store_ptr;
-	sxp_ping = (swpls_sxpping *)&(store->sxp_ping);
-
-	/* get data kind */
-	*kind = store->kind;
-	type = store->type;
-
-	/* extract data from structure */
-	if ((*kind == MB_DATA_DATA) &&
-		((type == SWPLS_ID_PROCESSED_PING) ||
-		(type == SWPLS_ID_PROCESSED_PING2)))
-		{
-		/* get transmit_gain (dB) */
-		*transmit_gain = (double)sxp_ping->txpower;
-
-		/* get pulse_length (usec) */
-		*pulse_length = (double)sxp_ping->trnstime / sxp_ping->frequency * 1e6;
-
-		/* get receive_gain (dB) */
-		*receive_gain = (double)sxp_ping->analoggain;
-
-		/* set status */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-
-		/* done translating values */
-		}
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		fprintf(stderr, "dbg2       kind:       %d\n", *kind);
-		}
-	if ((verbose >= 2) && (*error == MB_ERROR_NO_ERROR))
-		{
-		fprintf(stderr, "dbg2       transmit_gain: %f\n", *transmit_gain);
-		fprintf(stderr, "dbg2       pulse_length:  %f\n", *pulse_length);
-		fprintf(stderr, "dbg2       receive_gain:  %f\n", *receive_gain);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "dbg2       error:      %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2       status:     %d\n", status);
-		}
-
-	/* return status */
-	return (status);
-}	/* mbsys_swathplus_gains */
-/*--------------------------------------------------------------------*/
-int mbsys_swathplus_extract_altitude(int verbose, void *mbio_ptr,
-	void *store_ptr, int *kind,
-	double *transducer_depth, double *altitude,
-	int *error)
-{
-	char *function_name = "mbsys_swathplus_extract_altitude";
-	int status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_swathplus_struct *store;
-	swpls_sxpping *sxp_ping;
-	int i;
-	int n;
-	double sum, ave;
-	int type;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> called\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n");
-		fprintf(stderr, "dbg2       verbose:    %d\n", verbose);
-		fprintf(stderr, "dbg2       mb_ptr:     %p\n", (void *)mbio_ptr);
-		fprintf(stderr, "dbg2       store_ptr:  %p\n", (void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *)mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_swathplus_struct *)store_ptr;
-	sxp_ping = &(store->sxp_ping);
-
-	/* get data kind */
-	*kind = store->kind;
-	type = store->type;
-
-	/* extract data from structure */
-	if ((*kind == MB_DATA_DATA) &&
-		((type == SWPLS_ID_PROCESSED_PING) ||
-		(type == SWPLS_ID_PROCESSED_PING2)))
-		{
-		/* get transducer depth below the sea surface */
-		*transducer_depth = sxp_ping->txer_waterdepth;	/* static draft */
-
-		/* calculate mean depth of first 25 near-nadir samples */
-		i = n = 0;
-		sum = 0.0;
-		while (i < sxp_ping->nosampsfile && n < 25)
-			{
-			if (sxp_ping->points[i].status != SWPLS_POINT_REJECTED)
-				{
-				sum += sxp_ping->points[i].z;
-				n++;
-				}
-			i++;
-			}
-
-		/* get the transducer altitude above the seafloor */
-		if (n > 0)
-			{
-			ave = sum / n;
-			*altitude = ave - (sxp_ping->height - sxp_ping->tide);
-			}
-		else
-			{
-			*altitude = 0.0;
-			}
-
-		/* set status */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-
-		/* done translating values */
-		}
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		fprintf(stderr, "dbg2       kind:              %d\n", *kind);
-		fprintf(stderr, "dbg2       transducer_depth:  %f\n",
-			*transducer_depth);
-		fprintf(stderr, "dbg2       altitude:          %f\n", *altitude);
-		fprintf(stderr, "dbg2       error:             %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2       status:            %d\n", status);
-		}
-
-	/* return status */
-	return (status);
-}	/* mbsys_swathplus_extract_altitude */
-/*--------------------------------------------------------------------*/
-int mbsys_swathplus_extract_nav(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, int time_i[7], double *time_d,
-	double *navlon, double *navlat, double *speed,
-	double *heading, double *draft, double *roll,
-	double *pitch, double *heave, int *error)
-{
-	char *function_name = "mbsys_swathplus_extract_nav";
-	int status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_swathplus_struct *store;
-	swpls_sxpping *sxp_ping;
-	int i;
-	int type;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> called\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n");
-		fprintf(stderr, "dbg2       verbose:    %d\n", verbose);
-		fprintf(stderr, "dbg2       mb_ptr:     %p\n", (void *)mbio_ptr);
-		fprintf(stderr, "dbg2       store_ptr:  %p\n", (void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *)mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_swathplus_struct *)store_ptr;
-	sxp_ping = (swpls_sxpping *)&(store->sxp_ping);
-
-	/* get data kind */
-	*kind = store->kind;
-	type = store->type;
-
-	/* extract data from survey record */
-	if ((*kind == MB_DATA_DATA) &&
-		((type == SWPLS_ID_PROCESSED_PING) ||
-		(type == SWPLS_ID_PROCESSED_PING2)))
-		{
-		double sxpheave;
-
-		/* get time */
-		for (i = 0; i < 7; i++)
-			{
-			time_i[i] = store->time_i[i];
-			}
-		*time_d = store->time_d;
-
-		/* get navigation */
-		*navlon = sxp_ping->txer_e;
-		*navlat = sxp_ping->txer_n;
-
-		/* get speed */
-		*speed = 0.0;
-		if (mb_io_ptr->nfix > 0)
-			{
-			mb_navint_prjinterp(verbose, mbio_ptr, store->time_d, *heading, *speed,
-				navlon, navlat, speed, error);
-			}
-
-		/* get heading */
-		*heading = sxp_ping->heading;
-
-		/* get draft  */
-		*draft = sxp_ping->txer_waterdepth;
-
-		/* get attitude  */
-		*roll = -(sxp_ping->roll);
-		*pitch = sxp_ping->pitch;
-
-		/* calculate heave */
-		get_sxp_heave(verbose, sxp_ping, &sxpheave, error);
-		*heave = -sxpheave;
-
-		/* done translating values */
-		}
-	/* extract data from nav record */
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-
-		/* get time */
-		for (i = 0; i < 7; i++)
-			{
-			time_i[i] = store->time_i[i];
-			}
-		*time_d = store->time_d;
-		}
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-
-		/* get time */
-		for (i = 0; i < 7; i++)
-			{
-			time_i[i] = store->time_i[i];
-			}
-		*time_d = store->time_d;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		fprintf(stderr, "dbg2       kind:          %d\n", *kind);
-		fprintf(stderr, "dbg2       time_i[0]:     %d\n", time_i[0]);
-		fprintf(stderr, "dbg2       time_i[1]:     %d\n", time_i[1]);
-		fprintf(stderr, "dbg2       time_i[2]:     %d\n", time_i[2]);
-		fprintf(stderr, "dbg2       time_i[3]:     %d\n", time_i[3]);
-		fprintf(stderr, "dbg2       time_i[4]:     %d\n", time_i[4]);
-		fprintf(stderr, "dbg2       time_i[5]:     %d\n", time_i[5]);
-		fprintf(stderr, "dbg2       time_i[6]:     %d\n", time_i[6]);
-		fprintf(stderr, "dbg2       time_d:        %f\n", *time_d);
-		fprintf(stderr, "dbg2       longitude:     %f\n", *navlon);
-		fprintf(stderr, "dbg2       latitude:      %f\n", *navlat);
-		fprintf(stderr, "dbg2       speed:         %f\n", *speed);
-		fprintf(stderr, "dbg2       heading:       %f\n", *heading);
-		fprintf(stderr, "dbg2       draft:         %f\n", *draft);
-		fprintf(stderr, "dbg2       roll:          %f\n", *roll);
-		fprintf(stderr, "dbg2       pitch:         %f\n", *pitch);
-		fprintf(stderr, "dbg2       heave:         %f\n", *heave);
-		fprintf(stderr, "dbg2       error:         %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2       status:        %d\n", status);
-		}
-
-	/* return status */
-	return (status);
-}	/* mbsys_swathplus_extract_nav */
-/*--------------------------------------------------------------------*/
-int mbsys_swathplus_insert_nav(int verbose, void *mbio_ptr, void *store_ptr,
-	int time_i[7], double time_d, double navlon,
-	double navlat, double speed, double heading,
-	double draft, double roll, double pitch,
-	double heave, int *error)
-{
-	char *function_name = "mbsys_swathplus_insert_nav";
-	int status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_swathplus_struct *store;
-	swpls_sxpping *sxp_ping;
-	int i;
-	int kind, type;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> called\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n");
-		fprintf(stderr, "dbg2       verbose:    %d\n", verbose);
-		fprintf(stderr, "dbg2       mbio_ptr:   %p\n", (void *)mbio_ptr);
-		fprintf(stderr, "dbg2       store_ptr:  %p\n", (void *)store_ptr);
-		fprintf(stderr, "dbg2       time_i[0]:  %d\n", time_i[0]);
-		fprintf(stderr, "dbg2       time_i[1]:  %d\n", time_i[1]);
-		fprintf(stderr, "dbg2       time_i[2]:  %d\n", time_i[2]);
-		fprintf(stderr, "dbg2       time_i[3]:  %d\n", time_i[3]);
-		fprintf(stderr, "dbg2       time_i[4]:  %d\n", time_i[4]);
-		fprintf(stderr, "dbg2       time_i[5]:  %d\n", time_i[5]);
-		fprintf(stderr, "dbg2       time_i[6]:  %d\n", time_i[6]);
-		fprintf(stderr, "dbg2       time_d:     %f\n", time_d);
-		fprintf(stderr, "dbg2       navlon:     %f\n", navlon);
-		fprintf(stderr, "dbg2       navlat:     %f\n", navlat);
-		fprintf(stderr, "dbg2       speed:      %f\n", speed);
-		fprintf(stderr, "dbg2       heading:    %f\n", heading);
-		fprintf(stderr, "dbg2       draft:      %f\n", draft);
-		fprintf(stderr, "dbg2       roll:       %f\n", roll);
-		fprintf(stderr, "dbg2       pitch:      %f\n", pitch);
-		fprintf(stderr, "dbg2       heave:      %f\n", heave);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *)mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_swathplus_struct *)store_ptr;
-	sxp_ping = (swpls_sxpping *)&(store->sxp_ping);
-
-	/* get data kind */
-	kind = store->kind;
-	type = store->type;
-
-	/* insert data in ping structure */
-	if ((kind == MB_DATA_DATA) &&
-		((type == SWPLS_ID_PROCESSED_PING) ||
-		(type == SWPLS_ID_PROCESSED_PING2)))
-		{
-		swpls_matrix vtow, m;
-		swpls_vector old_txoffset, new_txoffset;
-		swpls_point *points;
-		double height;
-
-		/* calculate old transducer offsets */
-		old_txoffset.x = sxp_ping->txer_starboard;
-		old_txoffset.y = -sxp_ping->txer_height;
-		old_txoffset.z = sxp_ping->txer_forward;
-		swpls_init_transform(verbose, &vtow, error);
-		swpls_concat_rotate_z(verbose, &vtow, -sxp_ping->roll * DTR, error);
-		swpls_concat_rotate_x(verbose, &vtow, -sxp_ping->pitch * DTR, error);
-		swpls_concat_rotate_y(verbose, &vtow, sxp_ping->heading * DTR, error);
-		swpls_transform(verbose, &vtow, &old_txoffset, error);
-
-		/* calculate new transducer offsets */
-		new_txoffset.x = sxp_ping->txer_starboard;
-		new_txoffset.y = -sxp_ping->txer_height;
-		new_txoffset.z = sxp_ping->txer_forward;
-		swpls_init_transform(verbose, &vtow, error);
-		swpls_concat_rotate_z(verbose, &vtow, -(-roll) * DTR, error);
-		swpls_concat_rotate_x(verbose, &vtow, -pitch * DTR, error);
-		swpls_concat_rotate_y(verbose, &vtow, heading * DTR, error);
-		swpls_transform(verbose, &vtow, &new_txoffset, error);
-		height = -heave - new_txoffset.y;
-
-		/* calculate point transformation */
-
-		/* from old world coordinates to vessel body coordinates*/
-		swpls_init_transform(verbose, &m, error);
-		swpls_concat_translate(verbose, &m, -(sxp_ping->txer_e),
-			-(-(sxp_ping->height - sxp_ping->tide)), -sxp_ping->txer_n, error);
-		swpls_concat_translate(verbose, &m, -old_txoffset.x, -old_txoffset.y,
-			-old_txoffset.z, error);
-		swpls_concat_rotate_y(verbose, &m, -(sxp_ping->heading) * DTR, error);
-		swpls_concat_rotate_x(verbose, &m, -(-sxp_ping->pitch) * DTR, error);
-		swpls_concat_rotate_z(verbose, &m, -(-sxp_ping->roll) * DTR, error);
-
-		/* from vessel body coordinates to new world coordinates */
-		swpls_concat_rotate_z(verbose, &m, +(-roll) * DTR, error);
-		swpls_concat_rotate_x(verbose, &m, +(-pitch) * DTR, error);
-		swpls_concat_rotate_y(verbose, &m, +heading * DTR, error);
-		swpls_concat_translate(verbose, &m, new_txoffset.x, new_txoffset.y,
-			new_txoffset.z, error);
-		swpls_concat_translate(verbose, &m, navlon, (height - sxp_ping->tide), navlat, error);
-
-		/* transform points from old to new coordinates */
-		points = sxp_ping->points;
-		for (i = 0; i < sxp_ping->nosampsfile; i++)
-			{
-			swpls_vector p;
-
-			p.x = points[i].x;
-			p.y = -points[i].z;
-			p.z = points[i].y;
-			swpls_transform(verbose, &m, &p, error);
-			points[i].x = p.x;
-			points[i].y = p.z;
-			points[i].z = -p.y;
-			}
-
-		/* set time */
-		for (i = 0; i < 7; i++)
-			{
-			store->time_i[i] = time_i[i];
-			}
-		store->time_d = time_d;
-
-		/* set navigation */
-		store->sxp_ping.txer_e = navlon;
-		store->sxp_ping.txer_n = navlat;
-		store->sxp_ping.easting = navlon;
-		store->sxp_ping.northing = navlat;
-
-		/* set speed  (no space in structure) */
-
-		/* set draft  (no space in structure) */
-
-		/* set attitude */
-		store->sxp_ping.height = height;
-		store->sxp_ping.pitch = pitch;
-		store->sxp_ping.roll = -roll;
-
-		/* print output debug statements */
-		if (verbose >= 2)
-			{
-			fprintf(stderr, "\ndbg2  MBIO function <%s> completed\n",
-				function_name);
-			fprintf(stderr, "dbg2  Return value:\n");
-			fprintf(stderr, "dbg2       error:      %d\n", *error);
-			fprintf(stderr, "dbg2  Return status:\n");
-			fprintf(stderr, "dbg2       status:  %d\n", status);
-			}
-		}
-
-	return (status);
-}	/* mbsys_swathplus_insert_nav */
-/*--------------------------------------------------------------------*/
-int mbsys_swathplus_copy(int verbose, void *mbio_ptr, void *store_ptr,
-	void *copy_ptr, int *error)
-{
-	char *function_name = "mbsys_swathplus_copy";
-	int status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_swathplus_struct *store;
-	struct mbsys_swathplus_struct *copy;
-	size_t points_alloc_save;
-	swpls_point *points_save;
-	size_t samps_alloc_save;
-	unsigned short *sampnum_save;
-	short int *angle_save;
-	unsigned short *amplitude_save;
-	unsigned char *quality_save;
-	size_t projection_alloc_save;
-	char *projection_id_save;
-	size_t message_alloc_save;
-	char *message_save;
-	size_t copy_len;
-	int i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> called\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n");
-		fprintf(stderr, "dbg2       verbose:    %d\n", verbose);
-		fprintf(stderr, "dbg2       mbio_ptr:   %p\n", (void *)mbio_ptr);
-		fprintf(stderr, "dbg2       store_ptr:  %p\n", (void *)store_ptr);
-		fprintf(stderr, "dbg2       copy_ptr:   %p\n", (void *)copy_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *)mbio_ptr;
-
-	/* get data structure pointers */
-	store = (struct mbsys_swathplus_struct *)store_ptr;
-	copy = (struct mbsys_swathplus_struct *)copy_ptr;
-
-	/* copy the data - for many formats memory must be allocated and
-	    sub-structures copied separately */
-	copy->kind = store->kind;
-	copy->type = store->type;
-
-	/* copy MB-System time stamp of most recently read record */
-	copy->time_d = store->time_d;
-	for (i = 0; i < 7; i++)
-		{
-		copy->time_i[i] = store->time_i[i];
-		}
-
-	/* copy HEADER records */
-	copy->sxp_header_set = store->sxp_header_set;
-	copy->sxp_header = store->sxp_header;
-	copy->sxi_header_set = store->sxi_header_set;
-	copy->sxi_header = store->sxi_header;
-
-	/* copy SXP PING record */
-	points_alloc_save = copy->sxp_ping.points_alloc;
-	points_save = copy->sxp_ping.points;
-	copy->sxp_ping = store->sxp_ping;
-	copy->sxp_ping.points_alloc = points_alloc_save;
-	copy->sxp_ping.points = points_save;
-	copy_len = (size_t)store->sxp_ping.points_alloc * sizeof(swpls_point);
-	if ((status == MB_SUCCESS) &&
-		(copy->sxp_ping.points_alloc < store->sxp_ping.points_alloc))
-		{
-		status =
-			mb_reallocd(verbose, __FILE__, __LINE__, copy_len,
-			(void **)&(copy->sxp_ping.points), error);
-		if (status == MB_SUCCESS)
-			{
-			copy->sxp_ping.points_alloc = store->sxp_ping.points_alloc;
-			}
-		else
-			{
-			copy->sxp_ping.points_alloc = 0;
-			}
-		}
-	if (status == MB_SUCCESS)
-		{
-		memcpy(copy->sxp_ping.points, store->sxp_ping.points, copy_len);
-		}
-
-	/* copy SXI PING record */
-	samps_alloc_save = copy->sxi_ping.samps_alloc;
-	sampnum_save = copy->sxi_ping.sampnum;
-	angle_save = copy->sxi_ping.angle;
-	amplitude_save = copy->sxi_ping.amplitude;
-	quality_save = copy->sxi_ping.quality;
-	copy->sxi_ping = store->sxi_ping;
-	copy->sxi_ping.samps_alloc = samps_alloc_save;
-	copy->sxi_ping.sampnum = sampnum_save;
-	copy->sxi_ping.angle = angle_save;
-	copy->sxi_ping.amplitude = amplitude_save;
-	copy->sxi_ping.quality = quality_save;
-	if ((status == MB_SUCCESS) &&
-		(copy->sxi_ping.samps_alloc < store->sxi_ping.samps_alloc))
-		{
-		status = mb_reallocd(verbose, __FILE__, __LINE__,
-			store->sxi_ping.samps_alloc * sizeof(unsigned short),
-			(void **)&(copy->sxi_ping.sampnum), error);
-		if (status == MB_SUCCESS)
-			{
-			status = mb_reallocd(verbose, __FILE__, __LINE__,
-				store->sxi_ping.samps_alloc * sizeof(short int),
-				(void **)&(copy->sxi_ping.angle), error);
-			}
-		if (status == MB_SUCCESS)
-			{
-			status = mb_reallocd(verbose, __FILE__, __LINE__,
-				store->sxi_ping.samps_alloc *
-				sizeof(unsigned short), (void **)&(copy->sxi_ping.amplitude),
-				error);
-			}
-		if (status == MB_SUCCESS)
-			{
-			status = mb_reallocd(verbose, __FILE__, __LINE__,
-				store->sxi_ping.samps_alloc *
-				sizeof(unsigned char), (void **)&(copy->sxi_ping.quality),
-				error);
-			}
-		if (status == MB_SUCCESS)
-			{
-			copy->sxi_ping.samps_alloc = store->sxi_ping.samps_alloc;
-			}
-		else
-			{
-			copy->sxi_ping.samps_alloc = 0;
-			}
-		}
-	if (status == MB_SUCCESS)
-		{
-		memcpy(copy->sxi_ping.sampnum, store->sxi_ping.sampnum,
-			store->sxi_ping.samps_alloc * sizeof(unsigned short));
-		memcpy(copy->sxi_ping.angle, store->sxi_ping.angle,
-			store->sxi_ping.samps_alloc * sizeof(short int));
-		memcpy(copy->sxi_ping.amplitude, store->sxi_ping.amplitude,
-			store->sxi_ping.samps_alloc * sizeof(unsigned short));
-		memcpy(copy->sxi_ping.quality, store->sxi_ping.quality,
-			store->sxi_ping.samps_alloc * sizeof(unsigned char));
-		}
-
-	/* copy ATTITUDE */
-	copy->attitude = store->attitude;
-
-	/* copy POSLL */
-	copy->posll = store->posll;
-
-	/* copy POSEN */
-	copy->posen = store->posen;
-
-	/* copy SOS */
-	copy->ssv = store->ssv;
-
-	/* copy TIDE */
-	copy->tide = store->tide;
-
-	/* copy ECHOSOUNDER */
-	copy->echosounder = store->echosounder;
-
-	/* copy PROJECTION */
-	copy->projection_set = store->projection_set;
-	projection_alloc_save = copy->projection.projection_alloc;
-	projection_id_save = copy->projection.projection_id;
-	copy->projection = store->projection;
-	copy->projection.projection_alloc = projection_alloc_save;
-	copy->projection.projection_id = projection_id_save;
-	if (copy->projection.projection_alloc < store->projection.projection_alloc)
-		{
-		status = mb_reallocd(verbose, __FILE__, __LINE__,
-			store->projection.projection_alloc,
-			(void **)&(copy->projection.projection_id), error);
-		if (status == MB_SUCCESS)
-			{
-			copy->projection.projection_alloc = store->projection.projection_alloc;
-			}
-		else
-			{
-			copy->projection.projection_alloc = 0;
-			}
-		}
-	if (status == MB_SUCCESS)
-		{
-		strncpy(copy->projection.projection_id, store->projection.projection_id,
-			store->projection.projection_alloc);
-		}
-
-	/* copy COMMENT */
-	message_alloc_save = copy->comment.message_alloc;
-	message_save = copy->comment.message;
-	copy->comment = store->comment;
-	copy->comment.message_alloc = message_alloc_save;
-	copy->comment.message = message_save;
-	if (copy->comment.message_alloc < store->comment.message_alloc)
-		{
-		status = mb_reallocd(verbose, __FILE__, __LINE__,
-			store->comment.message_alloc,
-			(void **)&(copy->comment.message), error);
-		if (status == MB_SUCCESS)
-			{
-			copy->comment.message_alloc = store->comment.message_alloc;
-			}
-		else
-			{
-			copy->comment.message_alloc = 0;
-			}
-		}
-	if (status == MB_SUCCESS)
-		{
-		strncpy(copy->comment.message, store->comment.message,
-			store->comment.message_alloc);
-		}
-
-	/* copy POS OFFSET */
-	copy->pos_offset = store->pos_offset;
-
-	/* copy IMU OFFSET */
-	copy->imu_offset = store->imu_offset;
-
-	/* copy TXER OFFSET */
-	copy->txer_offset = store->txer_offset;
-
-	/* copy WL OFFSET */
-	copy->wl_offset = store->wl_offset;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		fprintf(stderr, "dbg2       error:      %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2       status:     %d\n", status);
-		}
-
-	/* return status */
-	return (status);
-}		/* mbsys_swathplus_copy */
-/*-------------------------------------------------------------------*/
-int swpls_chk_header(int verbose, void *mbio_ptr, char *buffer, int *recordid,
-	int *size, int *error)
-{
-	char *function_name = "swpls_chk_header";
-	int status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	int index;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> called\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n");
-		fprintf(stderr, "dbg2       verbose:       %d\n", verbose);
-		fprintf(stderr, "dbg2       mbio_ptr:      %p\n", (void *)mbio_ptr);
-		fprintf(stderr, "dbg2       buffer:        %p\n", (void *)buffer);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *)mbio_ptr;
-
-	/* get values to check */
-	index = 0;
-	mb_get_binary_int(MB_YES, &buffer[index], recordid); index += 4;
-	mb_get_binary_int(MB_YES, &buffer[index], size); index += 4;
-
-	/* check recordid */
-	if ((*recordid != SWPLS_ID_SXP_HEADER_DATA) &&
-		(*recordid != SWPLS_ID_PROCESSED_PING) &&
-		(*recordid != SWPLS_ID_PROCESSED_PING2) &&
-		(*recordid != SWPLS_ID_COMMENT) &&
-		(*recordid != SWPLS_ID_PROJECTION) &&
-		(*recordid != SWPLS_ID_SXI_HEADER_DATA) &&
-		(*recordid != SWPLS_ID_PARSED_PING) &&
-		(*recordid != SWPLS_ID_PARSED_ATTITUDE) &&
-		(*recordid != SWPLS_ID_PARSED_POSITION_LL) &&
-		(*recordid != SWPLS_ID_PARSED_POSITION_EN) &&
-		(*recordid != SWPLS_ID_PARSED_SSV) &&
-		(*recordid != SWPLS_ID_PARSED_ECHOSOUNDER) &&
-		(*recordid != SWPLS_ID_PARSED_TIDE) &&
-		(*recordid != SWPLS_ID_PARSED_TIDE) &&
-		(*recordid != SWPLS_ID_PARSED_AGDS) &&
-		(*recordid != SWPLS_ID_POS_OFFSET) &&
-		(*recordid != SWPLS_ID_IMU_OFFSET) &&
-		(*recordid != SWPLS_ID_TXER_OFFSET) &&
-		(*recordid != SWPLS_ID_WL_OFFSET))
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_UNINTELLIGIBLE;
-		}
-	else
-		{
-		status = MB_SUCCESS;
-		*error = MB_ERROR_NO_ERROR;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr, "dbg2  Output arguments:\n");
-		fprintf(stderr, "dbg2       recordid:      %d\n", *recordid);
-		fprintf(stderr, "dbg2       size:          %d\n", *size);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2       status:        %d\n", status);
-		}
-
-	/* return status */
-	return (status);
-}		/* swpls_chk_header */
-/* --------------------------------------------------------------------*/
-int swpls_rd_sxpheader(int verbose, char *buffer, void *store_ptr, int *error)
-{
-	char *function_name = "swpls_rd_sxpheader";
-	int status = MB_SUCCESS;
-	struct mbsys_swathplus_struct *store;
-	swpls_header *header;
-	int index;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> called\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n");
-		fprintf(stderr, "dbg2       verbose:    %d\n", verbose);
-		fprintf(stderr, "dbg2       buffer:     %p\n", (void *)buffer);
-		fprintf(stderr, "dbg2       store_ptr:  %p\n", (void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_swathplus_struct *)store_ptr;
-	header = &(store->sxp_header);
-
-	/* extract the data */
-	index = SWPLS_SIZE_BLOCKHEADER;
-	mb_get_binary_int(MB_YES, &buffer[index], &(header->swver)); index += 4;
-	mb_get_binary_int(MB_YES, &buffer[index], &(header->fmtver)); index += 4;
-
-	/* set kind */
-	if (status == MB_SUCCESS)
-		{
-		store->kind = MB_DATA_HEADER;
-		store->type = SWPLS_ID_SXP_HEADER_DATA;
-		store->sxp_header_set = MB_YES;
-		}
-	else
-		{
-		store->kind = MB_DATA_NONE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		fprintf(stderr, "dbg2      header:     %p\n", header);
-		fprintf(stderr, "dbg2       error:     %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2       status:  %d\n", status);
-		}
-
-	return (status);
-}		/* swpls_rd_sxpheader */
-/*--------------------------------------------------------------------*/
-int swpls_rd_sxpping(int verbose, char *buffer, void *store_ptr, int pingtype,
-	int *error)
-{
-	char *function_name = "swpls_rd_sxpping";
-	int status = MB_SUCCESS;
-	struct mbsys_swathplus_struct *store;
-	swpls_sxpping *ping;
-	int index;
-	int int_val;
-	short int short_val;
-	int i;
-	size_t read_len;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> called\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n");
-		fprintf(stderr, "dbg2       verbose:    %d\n", verbose);
-		fprintf(stderr, "dbg2       buffer:     %p\n", (void *)buffer);
-		fprintf(stderr, "dbg2       pingtype:   %d\n", pingtype);
-		fprintf(stderr, "dbg2       store_ptr:  %p\n", (void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_swathplus_struct *)store_ptr;
-	ping = &(store->sxp_ping);
-
-	/* extract the data */
-	index = SWPLS_SIZE_BLOCKHEADER;
-	strncpy(&buffer[index], ping->linename,
-		SWPLS_MAX_LINENAME); index += SWPLS_MAX_LINENAME;
-	ping->linename[SWPLS_MAX_LINENAME - 1] = '\0';
-	mb_get_binary_int(MB_YES, &buffer[index], &int_val); index += 4;
-	ping->pingnumber = (unsigned int)int_val;
-	index += 4;		/* padding bytes */
-	mb_get_binary_double(MB_YES, &buffer[index], &(ping->time_d)); index += 8;
-	mb_get_binary_int(MB_YES, &buffer[index], &(ping->notxers)); index += 4;
-	index += 4;		/* padding bytes */
-	mb_get_binary_double(MB_YES, &buffer[index], &(ping->easting)); index += 8;
-	mb_get_binary_double(MB_YES, &buffer[index], &(ping->northing));
-	index += 8;
-	mb_get_binary_double(MB_YES, &buffer[index], &(ping->roll)); index += 8;
-	mb_get_binary_double(MB_YES, &buffer[index], &(ping->pitch)); index += 8;
-	mb_get_binary_double(MB_YES, &buffer[index], &(ping->heading)); index += 8;
-	mb_get_binary_double(MB_YES, &buffer[index], &(ping->height)); index += 8;
-	mb_get_binary_double(MB_YES, &buffer[index], &(ping->tide)); index += 8;
-	mb_get_binary_double(MB_YES, &buffer[index], &(ping->sos)); index += 8;
-	ping->txno = buffer[index++];
-	ping->txstat = buffer[index++];
-	ping->txpower = buffer[index++];
-	index += 1;		/* padding byte */
-	mb_get_binary_short(MB_YES, &buffer[index], &(ping->analoggain));
-	index += 2;
-	ping->nostaves = buffer[index++];
-	for (i = 0; i < SWPLS_MAX_TX_INFO; i++)
-		{
-		ping->txinfo[i] = buffer[index++];
-		}
-	index += 1;		/* padding bytes */
-	ping->freq = buffer[index++];
-	index += 4;		/* padding bytes */
-	mb_get_binary_double(MB_YES, &buffer[index], &(ping->frequency));
-	index += 8;
-	mb_get_binary_short(MB_YES, &buffer[index], &(ping->trnstime)); index += 2;
-	mb_get_binary_short(MB_YES, &buffer[index], &(ping->recvtime)); index += 2;
-	ping->samprate = buffer[index++];
-	index += 3;		/* padding bytes */
-	mb_get_binary_int(MB_YES, &buffer[index], &(ping->nosampsorig));
-	index += 4;
-	mb_get_binary_int(MB_YES, &buffer[index], &(ping->nosampsfile));
-	index += 4;
-	mb_get_binary_int(MB_YES, &buffer[index], &(ping->nosampslots));
-	index += 4;
-	index += 4;		/* padding bytes */
-	mb_get_binary_double(MB_YES, &buffer[index], &(ping->txer_e)); index += 8;
-	mb_get_binary_double(MB_YES, &buffer[index], &(ping->txer_n)); index += 8;
-	mb_get_binary_double(MB_YES, &buffer[index], &(ping->txer_height));
-	index += 8;
-	mb_get_binary_double(MB_YES, &buffer[index], &(ping->txer_forward));
-	index += 8;
-	mb_get_binary_double(MB_YES, &buffer[index], &(ping->txer_starboard));
-	index += 8;
-	mb_get_binary_double(MB_YES, &buffer[index], &(ping->txer_azimuth));
-	index += 8;
-	mb_get_binary_double(MB_YES, &buffer[index], &(ping->txer_elevation));
-	index += 8;
-	mb_get_binary_double(MB_YES, &buffer[index], &(ping->txer_skew));
-	index += 8;
-	mb_get_binary_double(MB_YES, &buffer[index], &(ping->txer_time));
-	index += 8;
-	mb_get_binary_double(MB_YES, &buffer[index], &(ping->txer_waterdepth));
-	index += 8;
-
-	if (pingtype == SWPLS_ID_PROCESSED_PING)
-		{
-		ping->txer_pitch = 0.0;
-		}
-	else if (pingtype == SWPLS_ID_PROCESSED_PING2)
-		{
-		mb_get_binary_double(MB_YES, &buffer[index], &(ping->txer_pitch));
-		index += 8;
-		}
-
-	/* check that we have enough storage for the points stored in the file
-	 */
-	if (ping->points_alloc < ping->nosampsfile)
-		{
-		read_len = (size_t)(ping->nosampsfile * sizeof(swpls_point));
-		status =
-			mb_reallocd(verbose, __FILE__, __LINE__, read_len,
-			(void **)&(ping->points), error);
-		if (status != MB_SUCCESS)
-			{
-			ping->points_alloc = 0;
-			}
-		else
-			{
-			ping->points_alloc = ping->nosampsfile;
-			}
-		}
-
-	/* extract the point data from the buffer into the ping struct */
-	if (status == MB_SUCCESS)
-		{
-		for (i = 0; i < ping->nosampsfile; i++)
-			{
-			mb_get_binary_int(MB_YES, &buffer[index],
-				&(ping->points[i].sampnum)); index += 4;
-			index += 4;		/* padding bytes */
-			mb_get_binary_double(MB_YES, &buffer[index], &(ping->points[i].y));
-			index += 8;
-			mb_get_binary_double(MB_YES, &buffer[index], &(ping->points[i].x));
-			index += 8;
-			mb_get_binary_float(MB_YES, &buffer[index], &(ping->points[i].z));
-			index += 4;
-			mb_get_binary_short(MB_YES, &buffer[index], &short_val);
-			index += 2;
-			ping->points[i].amp = (unsigned short)short_val;
-			mb_get_binary_short(MB_YES, &buffer[index], &short_val);
-			index += 2;
-			ping->points[i].procamp = (unsigned short)short_val;
-			ping->points[i].status = buffer[index++];
-			index += 7;		/* padding bytes */
-
-			/* old-syle points don't have tpu parameter */
-			if (pingtype == SWPLS_ID_PROCESSED_PING)
-				{
-				ping->points[i].tpu = 0.0;
-				}
-			else if (pingtype == SWPLS_ID_PROCESSED_PING2)
-				{
-				mb_get_binary_double(MB_YES, &buffer[index],
-					&(ping->points[i].tpu)); index += 8;
-				}
-			}
-		}
-
-	if (status == MB_SUCCESS)
-		{
-		/* set the time and date */
-		store->time_d = ping->time_d;
-		mb_get_date(verbose, ping->time_d, &(store->time_i[0]));
-
-		/* set the kind and type */
-		store->kind = MB_DATA_DATA;
-		store->type = pingtype;
-		}
-	else
-		{
-		store->kind = MB_DATA_NONE;
-		}
-
-	if (verbose >= 4)
-		{
-		fprintf(stderr, "\ndbg4 SXP Ping values read from file:\n");
-		swpls_pr_sxpping(verbose, stderr, ping, error);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		fprintf(stderr, "dbg2        ping:      %p\n", ping);
-		fprintf(stderr, "dbg2       error:      %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2       status:  %d\n", status);
-		}
-
-	return (status);
-}		/* swpls_rd_sxpping */
-/*--------------------------------------------------------------------*/
-int swpls_rd_projection(int verbose, char *buffer, void *store_ptr, int *error)
-{
-	char *function_name = "swpls_rd_projection";
-	int status = MB_SUCCESS;
-	struct mbsys_swathplus_struct *store;
-	swpls_projection *projection;
-	int index;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> called\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n");
-		fprintf(stderr, "dbg2       verbose:    %d\n", verbose);
-		fprintf(stderr, "dbg2       buffer:     %p\n", (void *)buffer);
-		fprintf(stderr, "dbg2       store_ptr:  %p\n", (void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_swathplus_struct *)store_ptr;
-
-	/* only read the projection if not previously set */
-	if (store->projection_set == MB_NO)
-		{
-		projection = &(store->projection);
-
-		/* extract the data */
-		index = SWPLS_SIZE_BLOCKHEADER;
-		mb_get_binary_int(MB_YES, &buffer[index], &(projection->time_d));
-		index += 4;
-		mb_get_binary_int(MB_YES, &buffer[index], &(projection->microsec));
-		index += 4;
-		mb_get_binary_int(MB_YES, &buffer[index], &(projection->nchars));
-		index += 4;
-
-		/* allocated memory to hold the message if necessary */
-		if (projection->projection_alloc < projection->nchars)
-			{
-			status = mb_reallocd(verbose, __FILE__, __LINE__,
-				(size_t)projection->nchars,
-				(void **)&(projection->projection_id), error);
-			if (status != MB_SUCCESS)
-				{
-				projection->projection_alloc = 0;
-				}
-			else
-				{
-				projection->projection_alloc = projection->nchars;
-				}
-			}
-
-		if (status == MB_SUCCESS)
-			{
-			strncpy(&(projection->projection_id[0]), &buffer[index],
-				(size_t)projection->nchars); index += projection->nchars;
-			}
-
-		if (status == MB_SUCCESS)
-			{
-			/* set the date and time */
-			store->time_d = (double)projection->time_d +
-				(double)projection->microsec * 1e-6;
-			mb_get_date(verbose, store->time_d, &(store->time_i[0]));
-
-			/* set the kind and type */
-			store->kind = MB_DATA_PARAMETER;
-			store->type = SWPLS_ID_PROJECTION;
-			store->projection_set = MB_YES;
-			}
-		else
-			{
-			store->kind = MB_DATA_NONE;
-			}
-		}
-
-	/* print debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		fprintf(stderr, "dbg2       error:                 %d\n", 
-			*error);
-		fprintf(stderr, "dbg2       store->projection_set: %d\n", 
-			store->projection_set);
-		fprintf(stderr, "dbg2       store->projection_id:  %s\n",
-			projection->projection_id);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2       status:  %d\n", status);
-		}
-
-	return (status);
-}		/* swpls_rd_projection */
-/*--------------------------------------------------------------------*/
-int swpls_rd_comment(int verbose, char *buffer, void *store_ptr, int *error)
-{
-	char *function_name = "swpls_rd_comment";
-	int status = MB_SUCCESS;
-	struct mbsys_swathplus_struct *store;
-	swpls_comment *comment;
-	int index;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> called\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n");
-		fprintf(stderr, "dbg2       verbose:    %d\n", verbose);
-		fprintf(stderr, "dbg2       buffer:     %p\n", (void *)buffer);
-		fprintf(stderr, "dbg2       store_ptr:  %p\n", (void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_swathplus_struct *)store_ptr;
-	comment = &(store->comment);
-
-	/* extract the data */
-	index = SWPLS_SIZE_BLOCKHEADER;
-	mb_get_binary_int(MB_YES, &buffer[index], &(comment->time_d)); index += 4;
-	mb_get_binary_int(MB_YES, &buffer[index], &(comment->microsec));
-	index += 4;
-	mb_get_binary_int(MB_YES, &buffer[index], &(comment->nchars)); index += 4;
-
-	/* allocated memory to hold the message if necessary */
-	if (comment->message_alloc < comment->nchars)
-		{
-		status = mb_reallocd(verbose, __FILE__, __LINE__,
-			(size_t)comment->nchars,
-			(void **)&(comment->message), error);
-		if (status != MB_SUCCESS)
-			{
-			comment->message_alloc = 0;
-			}
-		else
-			{
-			comment->message_alloc = comment->nchars;
-			}
-		}
-
-	if (status == MB_SUCCESS)
-		{
-		strncpy(&(comment->message[0]), &buffer[index],
-			(size_t)comment->nchars); index += comment->nchars;
-		}
-
-	if (status == MB_SUCCESS)
-		{
-		/* set the date and time */
-		store->time_d = (double)comment->time_d + (double)comment->microsec *
-			1e-6;
-		mb_get_date(verbose, store->time_d, &(store->time_i[0]));
-
-		/* set the kind and type */
-		store->kind = MB_DATA_COMMENT;
-		store->type = SWPLS_ID_COMMENT;
-		}
-	else
-		{
-		store->kind = MB_DATA_NONE;
-		}
-
-	/* print debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		fprintf(stderr, "dbg2       error:      %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2       status:  %d\n", status);
-		}
-
-	return (status);
-}		/* swpls_rd_comment */
-/*--------------------------------------------------------------------*/
-int swpls_rd_sxiheader(int verbose, char *buffer, void *store_ptr, int *error)
-{
-	char *function_name = "swpls_rd_sxiheader";
-	int status = MB_SUCCESS;
-	struct mbsys_swathplus_struct *store;
-	swpls_header *header;
-	int index;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> called\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n:");
-		fprintf(stderr, "dbg2     verbose:          %d\n", verbose);
-		fprintf(stderr, "dbg2     buffer:           %p\n", (void *)buffer);
-		fprintf(stderr, "dbg2     store_ptr:        %p\n", (void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_swathplus_struct *)store_ptr;
-	header = &(store->sxi_header);
-
-	/* extract the data */
-	index = SWPLS_SIZE_BLOCKHEADER;
-	mb_get_binary_int(MB_YES, &buffer[index], &(header->swver)); index += 4;
-	mb_get_binary_int(MB_YES, &buffer[index], &(header->fmtver)); index += 4;
-
-	/* set kind */
-	if (status == MB_SUCCESS)
-		{
-		store->kind = MB_DATA_HEADER;
-		store->type = SWPLS_ID_SXI_HEADER_DATA;
-		store->sxi_header_set = MB_YES;
-		}
-	else
-		{
-		store->kind = MB_DATA_NONE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr, "dbg2  Output arguments:\n");
-		fprintf(stderr, "dbg2      header:         %p\n", header);
-		fprintf(stderr, "dbg2      error:          %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2      status:         %d\n", status);
-		}
-
-	/* return status */
-	return (status);
-}		/* swpls_rd_sxiheader */
-/*--------------------------------------------------------------------*/
-int swpls_rd_sxiping(int verbose, char *buffer, void *store_ptr, int *error)
-{
-	char *function_name = "swpls_rd_sxiping";
-	int status = MB_SUCCESS;
-	struct mbsys_swathplus_struct *store;
-	swpls_sxiping *ping;
-	short short_val;
-	int int_val;
-	int index;
-	size_t read_len;
-	int i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> called\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n:");
-		fprintf(stderr, "dbg2     verbose:          %d\n", verbose);
-		fprintf(stderr, "dbg2     buffer:           %p\n", (void *)buffer);
-		fprintf(stderr, "dbg2     store_ptr:        %p\n", (void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_swathplus_struct *)store_ptr;
-	ping = &(store->sxi_ping);
-
-	/* extract the data */
-	index = SWPLS_SIZE_BLOCKHEADER;
-	mb_get_binary_int(MB_YES, &buffer[index], &(ping->time_d)); index += 4;
-	mb_get_binary_int(MB_YES, &buffer[index], &(ping->microsec)); index += 4;
-	ping->channel = buffer[index]; index++;
-	mb_get_binary_int(MB_YES, &buffer[index], &int_val); index += 4;
-	ping->pingnumber = (unsigned long)int_val;
-	mb_get_binary_float(MB_YES, &buffer[index], &(ping->frequency));
-	index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(ping->samp_period));
-	index += 4;
-	mb_get_binary_short(MB_YES, &buffer[index], &short_val); index += 2;
-	ping->nosamps = (unsigned short)short_val;
-	mb_get_binary_float(MB_YES, &buffer[index], &(ping->sos)); index += 4;
-	mb_get_binary_short(MB_YES, &buffer[index], &(ping->txpulse)); index += 2;
-	ping->data_options = buffer[index]; index++;
-	ping->ping_state = (unsigned char)buffer[index]; index++;
-	mb_get_binary_short(MB_YES, &buffer[index], &short_val); index += 2;
-	ping->max_count = (unsigned short)short_val;
-	mb_get_binary_short(MB_YES, &buffer[index], &short_val); index += 2;
-	ping->reserve1 = (unsigned short)short_val;
-
-	/* check that we have enough storage for the samples stored in the file
-	 */
-	if (ping->samps_alloc < ping->nosamps)
-		{
-		read_len = (size_t)(ping->nosamps * sizeof(unsigned short));
-		status =
-			mb_reallocd(verbose, __FILE__, __LINE__, read_len,
-			(void **)&(ping->sampnum), error);
-		if (status == MB_SUCCESS)
-			{
-			read_len = (size_t)(ping->nosamps * sizeof(short int));
-			status = mb_reallocd(verbose, __FILE__, __LINE__, read_len,
-				(void **)&(ping->angle), error);
-			}
-		if (status == MB_SUCCESS)
-			{
-			read_len = (size_t)(ping->nosamps * sizeof(unsigned short));
-			status = mb_reallocd(verbose, __FILE__, __LINE__, read_len,
-				(void **)&(ping->amplitude), error);
-			}
-		if (status == MB_SUCCESS)
-			{
-			read_len = (size_t)(ping->nosamps * sizeof(unsigned char));
-			status = mb_reallocd(verbose, __FILE__, __LINE__, read_len,
-				(void **)&(ping->quality), error);
-			}
-		if (status != MB_SUCCESS)
-			{
-			ping->samps_alloc = 0;
-			}
-		else
-			{
-			ping->samps_alloc = ping->nosamps;
-			}
-		}
-
-	/* extract the sample data from the buffer into the ping struct */
-	if (status == MB_SUCCESS)
-		{
-		for (i = 0; i < ping->nosamps; i++)
-			{
-			mb_get_binary_short(MB_YES, &buffer[index], &short_val);
-			index += 2;
-			ping->sampnum[i] = (unsigned short)short_val;
-			mb_get_binary_short(MB_YES, &buffer[index], &(ping->angle[i]));
-			index += 2;
-			mb_get_binary_short(MB_YES, &buffer[index], &short_val);
-			index += 2;
-			ping->amplitude[i] = (unsigned short)short_val;
-			ping->quality[i] = (unsigned char)buffer[index]; index++;
-			}
-		}
-
-	if (status == MB_SUCCESS)
-		{
-		/* set the date and time */
-		store->time_d = (double)ping->time_d + (double)ping->microsec * 1e6;
-		mb_get_date(verbose, store->time_d, &(store->time_i[0]));
-
-		/* set the kind and type */
-		store->kind = MB_DATA_DATA;
-		store->type = SWPLS_ID_PARSED_PING;
-		}
-	else
-		{
-		store->kind = MB_DATA_NONE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		fprintf(stderr, "dbg2      error:          %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2      status:         %d\n", status);
-		}
-
-	/* return status */
-	return (status);
-}		/* swpls_rd_sxiping */
-/*--------------------------------------------------------------------*/
-int swpls_rd_attitude(int verbose, char *buffer, void *store_ptr, int *error)
-{
-	char *function_name = "swpls_rd_attitude";
-	int status = MB_SUCCESS;
-	struct mbsys_swathplus_struct *store;
-	swpls_attitude *attitude;
-	int index;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> called\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n:");
-		fprintf(stderr, "dbg2     verbose:          %d\n", verbose);
-		fprintf(stderr, "dbg2     buffer:           %p\n", (void *)buffer);
-		fprintf(stderr, "dbg2     store_ptr:        %p\n", (void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_swathplus_struct *)store_ptr;
-	attitude = &(store->attitude);
-
-	/* extract the data */
-	index = SWPLS_SIZE_BLOCKHEADER;
-	mb_get_binary_int(MB_YES, &buffer[index], &(attitude->time_d)); index += 4;
-	mb_get_binary_int(MB_YES, &buffer[index], &(attitude->microsec));
-	index += 4;
-	attitude->channel = buffer[index]; index++;
-	mb_get_binary_float(MB_YES, &buffer[index], &(attitude->roll)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(attitude->pitch));
-	index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(attitude->heading));
-	index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(attitude->height));
-	index += 4;
-
-	if (status == MB_SUCCESS)
-		{
-		/* set the date and time */
-		store->time_d = (double)attitude->time_d + (double)attitude->microsec *
-			1e6;
-		mb_get_date(verbose, store->time_d, &(store->time_i[0]));
-
-		/* set the kind and type */
-		store->kind = MB_DATA_ATTITUDE;
-		store->type = SWPLS_ID_PARSED_ATTITUDE;
-		}
-	else
-		{
-		store->kind = MB_DATA_NONE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		fprintf(stderr, "dbg2      error:          %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2      status:         %d\n", status);
-		}
-
-	/* return status */
-	return (status);
-}		/* swpls_rd_attitude */
-/*--------------------------------------------------------------------*/
-int swpls_rd_posll(int verbose, char *buffer, void *store_ptr, int *error)
-{
-	char *function_name = "swpls_rd_posll";
-	int status = MB_SUCCESS;
-	struct mbsys_swathplus_struct *store;
-	swpls_posll *posll;
-	int index;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> called\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n:");
-		fprintf(stderr, "dbg2     verbose:          %d\n", verbose);
-		fprintf(stderr, "dbg2     buffer:           %p\n", (void *)buffer);
-		fprintf(stderr, "dbg2     store_ptr:        %p\n", (void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_swathplus_struct *)store_ptr;
-	posll = &(store->posll);
-
-	/* extract the data */
-	index = SWPLS_SIZE_BLOCKHEADER;
-	mb_get_binary_int(MB_YES, &buffer[index], &(posll->time_d)); index += 4;
-	mb_get_binary_int(MB_YES, &buffer[index], &(posll->microsec)); index += 4;
-	posll->channel = buffer[index]; index++;
-	mb_get_binary_double(MB_YES, &buffer[index], &(posll->latitude));
-	index += 8;
-	mb_get_binary_double(MB_YES, &buffer[index], &(posll->longitude));
-	index += 8;
-
-	if (status == MB_SUCCESS)
-		{
-		/* set the date and time */
-		store->time_d = (double)posll->time_d + (double)posll->microsec * 1e6;
-		mb_get_date(verbose, store->time_d, &(store->time_i[0]));
-
-		/* set the kind and type */
-		store->kind = MB_DATA_NAV;
-		store->type = SWPLS_ID_PARSED_POSITION_LL;
-		}
-	else
-		{
-		store->kind = MB_DATA_NONE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		fprintf(stderr, "dbg2      error:          %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2      status:         %d\n", status);
-		}
-
-	/* return status */
-	return (status);
-}		/* swpls_rd_posll */
-/*--------------------------------------------------------------------*/
-int swpls_rd_posen(int verbose, char *buffer, void *store_ptr, int *error)
-{
-	char *function_name = "swpls_rd_posen";
-	int status = MB_SUCCESS;
-	struct mbsys_swathplus_struct *store;
-	swpls_posen *posen;
-	int index;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> called\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n:");
-		fprintf(stderr, "dbg2     verbose:          %d\n", verbose);
-		fprintf(stderr, "dbg2     buffer:           %p\n", (void *)buffer);
-		fprintf(stderr, "dbg2     store_ptr:        %p\n", (void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_swathplus_struct *)store_ptr;
-	posen = &(store->posen);
-
-	/* extract the data */
-	index = SWPLS_SIZE_BLOCKHEADER;
-	mb_get_binary_int(MB_YES, &buffer[index], &(posen->time_d)); index += 4;
-	mb_get_binary_int(MB_YES, &buffer[index], &(posen->microsec)); index += 4;
-	posen->channel = buffer[index]; index++;
-	mb_get_binary_double(MB_YES, &buffer[index], &(posen->easting));
-	index += 8;
-	mb_get_binary_double(MB_YES, &buffer[index], &(posen->northing));
-	index += 8;
-
-	if (status == MB_SUCCESS)
-		{
-		/* set the date and time */
-		store->time_d = (double)posen->time_d + (double)posen->microsec * 1e6;
-		mb_get_date(verbose, store->time_d, &(store->time_i[0]));
-
-		/* set the kind and type */
-		store->kind = MB_DATA_NAV1;
-		store->type = SWPLS_ID_PARSED_POSITION_EN;
-		}
-	else
-		{
-		store->kind = MB_DATA_NONE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		fprintf(stderr, "dbg2      error:          %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2      status:         %d\n", status);
-		}
-
-	/* return status */
-	return (status);
-}		/* swpls_rd_posen */
-/*--------------------------------------------------------------------*/
-int swpls_rd_ssv(int verbose, char *buffer, void *store_ptr, int *error)
-{
-	char *function_name = "swpls_rd_ssv";
-	int status = MB_SUCCESS;
-	struct mbsys_swathplus_struct *store;
-	swpls_ssv *ssv;
-	int index;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> called\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n:");
-		fprintf(stderr, "dbg2     verbose:          %d\n", verbose);
-		fprintf(stderr, "dbg2     buffer:           %p\n", (void *)buffer);
-		fprintf(stderr, "dbg2     store_ptr:        %p\n", (void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_swathplus_struct *)store_ptr;
-	ssv = &(store->ssv);
-
-	/* extract the data */
-	index = SWPLS_SIZE_BLOCKHEADER;
-	mb_get_binary_int(MB_YES, &buffer[index], &(ssv->time_d)); index += 4;
-	mb_get_binary_int(MB_YES, &buffer[index], &(ssv->microsec)); index += 4;
-	ssv->channel = buffer[index]; index++;
-	mb_get_binary_float(MB_YES, &buffer[index], &(ssv->ssv)); index += 4;
-
-	if (status == MB_SUCCESS)
-		{
-		/* set the date and time */
-		store->time_d = (double)ssv->time_d + (double)ssv->microsec * 1e6;
-		mb_get_date(verbose, store->time_d, &(store->time_i[0]));
-
-		/* set kind and type */
-		store->kind = MB_DATA_SSV;
-		store->type = SWPLS_ID_PARSED_SSV;
-		}
-	else
-		{
-		store->kind = MB_DATA_NONE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		fprintf(stderr, "dbg2      error:          %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2      status:         %d\n", status);
-		}
-
-	/* return status */
-	return (status);
-}		/* swpls_rd_ssv */
-/*--------------------------------------------------------------------*/
-int swpls_rd_tide(int verbose, char *buffer, void *store_ptr, int *error)
-{
-	char *function_name = "swpls_rd_tide";
-	int status = MB_SUCCESS;
-	struct mbsys_swathplus_struct *store;
-	swpls_tide *tide;
-	int index;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> called\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n:");
-		fprintf(stderr, "dbg2     verbose:          %d\n", verbose);
-		fprintf(stderr, "dbg2     buffer:           %p\n", (void *)buffer);
-		fprintf(stderr, "dbg2     store_ptr:        %p\n", (void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_swathplus_struct *)store_ptr;
-	tide = &(store->tide);
-
-	/* extract the data */
-	index = SWPLS_SIZE_BLOCKHEADER;
-	mb_get_binary_int(MB_YES, &buffer[index], &(tide->time_d)); index += 4;
-	mb_get_binary_int(MB_YES, &buffer[index], &(tide->microsec)); index += 4;
-	tide->channel = buffer[index]; index++;
-	mb_get_binary_float(MB_YES, &buffer[index], &(tide->tide)); index += 4;
-
-	if (status == MB_SUCCESS)
-		{
-		/* set the date and time */
-		store->time_d = (double)tide->time_d + (double)tide->microsec * 1e6;
-		mb_get_date(verbose, store->time_d, &(store->time_i[0]));
-
-		/* set the kind and type */
-		store->kind = MB_DATA_TIDE;
-		store->type = SWPLS_ID_PARSED_TIDE;
-		}
-	else
-		{
-		store->kind = MB_DATA_NONE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		fprintf(stderr, "dbg2      error:          %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2      status:         %d\n", status);
-		}
-
-	/* return status */
-	return (status);
-}		/* swpls_rd_tide */
-/*--------------------------------------------------------------------*/
-int swpls_rd_echosounder(int verbose, char *buffer, void *store_ptr, int *error)
-{
-	char *function_name = "swpls_rd_echosounder";
-	int status = MB_SUCCESS;
-	struct mbsys_swathplus_struct *store;
-	swpls_echosounder *echosounder;
-	int index;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> called\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n:");
-		fprintf(stderr, "dbg2     verbose:          %d\n", verbose);
-		fprintf(stderr, "dbg2     buffer:           %p\n", (void *)buffer);
-		fprintf(stderr, "dbg2     store_ptr:        %p\n", (void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_swathplus_struct *)store_ptr;
-	echosounder = &(store->echosounder);
-
-	/* extract the data */
-	index = SWPLS_SIZE_BLOCKHEADER;
-	mb_get_binary_int(MB_YES, &buffer[index], &(echosounder->time_d));
-	index += 4;
-	mb_get_binary_int(MB_YES, &buffer[index], &(echosounder->microsec));
-	index += 4;
-	echosounder->channel = buffer[index]; index++;
-	mb_get_binary_float(MB_YES, &buffer[index], &(echosounder->altitude));
-	index += 4;
-
-	if (status == MB_SUCCESS)
-		{
-		/* set the date and time */
-		store->time_d = (double)echosounder->time_d +
-			(double)echosounder->microsec * 1e6;
-		mb_get_date(verbose, store->time_d, &(store->time_i[0]));
-
-		/* set the kind and type */
-		store->kind = MB_DATA_ALTITUDE;
-		store->type = SWPLS_ID_PARSED_ECHOSOUNDER;
-		}
-	else
-		{
-		store->kind = MB_DATA_NONE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		fprintf(stderr, "dbg2      error:          %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2      status:         %d\n", status);
-		}
-
-	/* return status */
-	return (status);
-}		/* swpls_rd_echosounder */
-/*--------------------------------------------------------------------*/
-int swpls_rd_agds(int verbose, char *buffer, void *store_ptr, int *error)
-{
-	char *function_name = "swpls_rd_agds";
-	int status = MB_SUCCESS;
-	struct mbsys_swathplus_struct *store;
-	swpls_agds *agds;
-	int index;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> called\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n:");
-		fprintf(stderr, "dbg2     verbose:          %d\n", verbose);
-		fprintf(stderr, "dbg2     buffer:           %p\n", (void *)buffer);
-		fprintf(stderr, "dbg2     store_ptr:        %p\n", (void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_swathplus_struct *)store_ptr;
-	agds = &(store->agds);
-
-	/* extract the data */
-	index = SWPLS_SIZE_BLOCKHEADER;
-	mb_get_binary_int(MB_YES, &buffer[index], &(agds->time_d)); index += 4;
-	mb_get_binary_int(MB_YES, &buffer[index], &(agds->microsec)); index += 4;
-	agds->channel = buffer[index]; index++;
-	mb_get_binary_float(MB_YES, &buffer[index], &(agds->hardness)); index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(agds->roughness));
-	index += 4;
-
-	if (status == MB_SUCCESS)
-		{
-		/* set the date and time */
-		store->time_d = (double)agds->time_d + (double)agds->microsec * 1e6;
-		mb_get_date(verbose, store->time_d, &(store->time_i[0]));
-
-		/* set the kind and type */
-		store->kind = MB_DATA_NONE;
-		store->type = SWPLS_ID_PARSED_AGDS;
-		}
-	else
-		{
-		store->kind = MB_DATA_NONE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		fprintf(stderr, "dbg2      error:          %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2      status:         %d\n", status);
-		}
-
-	/* return status */
-	return (status);
-}		/* swpls_rd_agds */
-/*--------------------------------------------------------------------*/
-int swpls_rd_pos_offset(int verbose, char *buffer, void *store_ptr, int *error)
-{
-	char *function_name = "swpls_rd_pos_offset";
-	int status = MB_SUCCESS;
-	struct mbsys_swathplus_struct *store;
-	swpls_pos_offset *pos_offset;
-	int index;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> called\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n:");
-		fprintf(stderr, "dbg2     verbose:          %d\n", verbose);
-		fprintf(stderr, "dbg2     buffer:           %p\n", (void *)buffer);
-		fprintf(stderr, "dbg2     store_ptr:        %p\n", (void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_swathplus_struct *)store_ptr;
-	pos_offset = &(store->pos_offset);
-
-	/* extract the data */
-	index = SWPLS_SIZE_BLOCKHEADER;
-	mb_get_binary_int(MB_YES, &buffer[index], &(pos_offset->time_d));
-	index += 4;
-	mb_get_binary_int(MB_YES, &buffer[index], &(pos_offset->microsec));
-	index += 4;
-	pos_offset->channel = buffer[index]; index++;
-	mb_get_binary_float(MB_YES, &buffer[index], &(pos_offset->height));
-	index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(pos_offset->forward));
-	index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(pos_offset->starboard));
-	index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(pos_offset->time));
-	index += 4;
-
-	if (status == MB_SUCCESS)
-		{
-		/* set the date and time */
-		store->time_d = (double)pos_offset->time_d +
-			(double)pos_offset->microsec * 1e6;
-		mb_get_date(verbose, store->time_d, &(store->time_i[0]));
-
-		/* set the kind and type */
-		store->kind = MB_DATA_PARAMETER;
-		store->type = SWPLS_ID_POS_OFFSET;
-		}
-	else
-		{
-		store->kind = MB_DATA_NONE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		fprintf(stderr, "dbg2      error:          %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2      status:         %d\n", status);
-		}
-
-	/* return status */
-	return (status);
-}		/* swpls_rd_pos_offset */
-/*--------------------------------------------------------------------*/
-int swpls_rd_imu_offset(int verbose, char *buffer, void *store_ptr, int *error)
-{
-	char *function_name = "swpls_rd_imu_offset";
-	int status = MB_SUCCESS;
-	struct mbsys_swathplus_struct *store;
-	swpls_imu_offset *imu_offset;
-	int index;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> called\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n:");
-		fprintf(stderr, "dbg2     verbose:          %d\n", verbose);
-		fprintf(stderr, "dbg2     buffer:           %p\n", (void *)buffer);
-		fprintf(stderr, "dbg2     store_ptr:        %p\n", (void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_swathplus_struct *)store_ptr;
-	imu_offset = &(store->imu_offset);
-
-	/* extract the data */
-	index = SWPLS_SIZE_BLOCKHEADER;
-	mb_get_binary_int(MB_YES, &buffer[index], &(imu_offset->time_d));
-	index += 4;
-	mb_get_binary_int(MB_YES, &buffer[index], &(imu_offset->microsec));
-	index += 4;
-	imu_offset->channel = buffer[index]; index++;
-	mb_get_binary_float(MB_YES, &buffer[index], &(imu_offset->height));
-	index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(imu_offset->forward));
-	index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(imu_offset->starboard));
-	index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(imu_offset->time));
-	index += 4;
-
-	if (status == MB_SUCCESS)
-		{
-		/* set the date and time */
-		store->time_d = (double)imu_offset->time_d +
-			(double)imu_offset->microsec * 1e6;
-		mb_get_date(verbose, store->time_d, &(store->time_i[0]));
-
-		/* set the kind and type */
-		store->kind = MB_DATA_PARAMETER;
-		store->type = SWPLS_ID_IMU_OFFSET;
-		}
-	else
-		{
-		store->kind = MB_DATA_NONE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		fprintf(stderr, "dbg2      error:          %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2      status:         %d\n", status);
-		}
-
-	/* return status */
-	return (status);
-}		/* swpls_rd_imu_offset */
-/*--------------------------------------------------------------------*/
-int swpls_rd_txer_offset(int verbose, char *buffer, void *store_ptr, int *error)
-{
-	char *function_name = "swpls_rd_txer_offset";
-	int status = MB_SUCCESS;
-	struct mbsys_swathplus_struct *store;
-	swpls_txer_offset *txer_offset;
-	int index;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> called\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n:");
-		fprintf(stderr, "dbg2     verbose:          %d\n", verbose);
-		fprintf(stderr, "dbg2     buffer:           %p\n", (void *)buffer);
-		fprintf(stderr, "dbg2     store_ptr:        %p\n", (void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_swathplus_struct *)store_ptr;
-	txer_offset = &(store->txer_offset);
-
-	/* extract the data */
-	index = SWPLS_SIZE_BLOCKHEADER;
-	mb_get_binary_int(MB_YES, &buffer[index], &(txer_offset->time_d));
-	index += 4;
-	mb_get_binary_int(MB_YES, &buffer[index], &(txer_offset->microsec));
-	index += 4;
-	txer_offset->channel = buffer[index]; index++;
-	mb_get_binary_float(MB_YES, &buffer[index], &(txer_offset->height));
-	index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(txer_offset->forward));
-	index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(txer_offset->starboard));
-	index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(txer_offset->azimuth));
-	index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(txer_offset->elevation));
-	index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(txer_offset->pitch));
-	index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(txer_offset->skew));
-	index += 4;
-	mb_get_binary_float(MB_YES, &buffer[index], &(txer_offset->time));
-	index += 4;
-
-	if (status == MB_SUCCESS)
-		{
-		/* set the date and time */
-		store->time_d = (double)txer_offset->time_d +
-			(double)txer_offset->microsec * 1e6;
-		mb_get_date(verbose, store->time_d, &(store->time_i[0]));
-
-		/* set the kind and type */
-		store->kind = MB_DATA_PARAMETER;
-		store->type = SWPLS_ID_TXER_OFFSET;
-		}
-	else
-		{
-		store->kind = MB_DATA_NONE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		fprintf(stderr, "dbg2      error:          %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2      status:         %d\n", status);
-		}
-
-	/* return status */
-	return (status);
-}		/* swpls_rd_txer_offset */
-/*--------------------------------------------------------------------*/
-int swpls_rd_wl_offset(int verbose, char *buffer, void *store_ptr, int *error)
-{
-	char *function_name = "swpls_rd_wl_offset";
-	int status = MB_SUCCESS;
-	struct mbsys_swathplus_struct *store;
-	swpls_wl_offset *wl_offset;
-	int index;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> called\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n:");
-		fprintf(stderr, "dbg2     verbose:          %d\n", verbose);
-		fprintf(stderr, "dbg2     buffer:           %p\n", (void *)buffer);
-		fprintf(stderr, "dbg2     store_ptr:        %p\n", (void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_swathplus_struct *)store_ptr;
-	wl_offset = &(store->wl_offset);
-
-	/* extract the data */
-	index = SWPLS_SIZE_BLOCKHEADER;
-	mb_get_binary_int(MB_YES, &buffer[index], &(wl_offset->time_d));
-	index += 4;
-	mb_get_binary_int(MB_YES, &buffer[index], &(wl_offset->microsec));
-	index += 4;
-	wl_offset->channel = buffer[index]; index++;
-	mb_get_binary_float(MB_YES, &buffer[index], &(wl_offset->height));
-	index += 4;
-
-	if (status == MB_SUCCESS)
-		{
-		/* set the date and time */
-		store->time_d = (double)wl_offset->time_d +
-			(double)wl_offset->microsec * 1e6;
-		mb_get_date(verbose, store->time_d, &(store->time_i[0]));
-
-		/* set the kind and type */
-		store->kind = MB_DATA_PARAMETER;
-		store->type = SWPLS_ID_WL_OFFSET;
-		}
-	else
-		{
-		store->kind = MB_DATA_NONE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		fprintf(stderr, "dbg2      error:          %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2      status:         %d\n", status);
-		}
-
-	/* return status */
-	return (status);
-}		/* swpls_rd_wl_offset */
-/*--------------------------------------------------------------------*/
-int swpls_wr_data(int verbose, void *mbio_ptr, void *store_ptr, int *error)
-{
-	char *function_name = "swpls_wr_data";
-	int status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_swathplus_struct *store;
-	FILE *mbfp;
-	char **bufferptr;
-	char *buffer;
-	int *bufferalloc;
-	int size;
-	size_t write_len;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2 MBIO function <%s> called\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n");
-		fprintf(stderr, "dbg2       verbose:    %d\n", verbose);
-		fprintf(stderr, "dbg2      mbio_ptr:    %p\n", mbio_ptr);
-		fprintf(stderr, "dbg2     store_ptr:    %p\n", mbio_ptr);
-		}
-
-	/* get pointer to mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *)mbio_ptr;
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_swathplus_struct *)store_ptr;
-	mbfp = mb_io_ptr->mbfp;
-
-	/* get saved values */
-	bufferptr = (char **)&mb_io_ptr->saveptr1;
-	buffer = (char *)*bufferptr;
-	bufferalloc = (int *)&mb_io_ptr->save6;
-
-	/* write the current data record */
-
-	/* write SWPLS_ID_SXP_HEADER_DATA record */
-	if ((store->kind == MB_DATA_HEADER) &&
-		(store->type == SWPLS_ID_SXP_HEADER_DATA))
-		{
-		status = swpls_wr_sxpheader(verbose, bufferalloc, bufferptr, store_ptr,
-			&size, error);
-		buffer = (char *)*bufferptr;
-		write_len = (size_t)size;
-		status = mb_fileio_put(verbose, mbio_ptr, buffer, &write_len, error);
-		}
-	/* write SWPLS_ID_PROJECTION record */
-	else if ((store->kind == MB_DATA_PARAMETER) &&
-		(store->type == SWPLS_ID_PROJECTION))
-		{
-		status = swpls_wr_projection(verbose, bufferalloc, bufferptr, store_ptr,
-			&size, error);
-		buffer = (char *)*bufferptr;
-		write_len = (size_t)size;
-		status = mb_fileio_put(verbose, mbio_ptr, buffer, &write_len, error);
-		}
-	/* write SWPLS_ID_PROCESSED_PING2 record */
-	else if ((store->kind == MB_DATA_DATA) &&
-		((store->type == SWPLS_ID_PROCESSED_PING) ||
-		(store->type == SWPLS_ID_PROCESSED_PING2)))
-		{
-		status = swpls_wr_sxpping(verbose, bufferalloc, bufferptr, store_ptr,
-			&size, error);
-		buffer = (char *)*bufferptr;
-		write_len = (size_t)size;
-		status = mb_fileio_put(verbose, mbio_ptr, buffer, &write_len, error);
-		}
-	/* write SWPLS_ID_COMMENT record */
-	else if (store->kind == MB_DATA_COMMENT)
-		{
-		status = swpls_wr_comment(verbose, bufferalloc, bufferptr, store_ptr,
-			&size, error);
-		buffer = (char *)*bufferptr;
-		write_len = (size_t)size;
-		status = mb_fileio_put(verbose, mbio_ptr, buffer, &write_len, error);
-		}
-	/* write SWPLS_ID_SXI_HEADER_DATA */
-	else if ((store->kind == MB_DATA_HEADER) &&
-		(store->type == SWPLS_ID_SXI_HEADER_DATA))
-		{
-		status = swpls_wr_sxiheader(verbose, bufferalloc, bufferptr, store_ptr,
-			&size, error);
-		buffer = (char *)*bufferptr;
-		write_len = (size_t)size;
-		status = mb_fileio_put(verbose, mbio_ptr, buffer, &write_len, error);
-		}
-	/* write SWPLS_ID_PARSED_PING */
-	else if ((store->kind == MB_DATA_DATA) &&
-		(store->type == SWPLS_ID_PARSED_PING))
-		{
-		status = swpls_wr_sxiping(verbose, bufferalloc, bufferptr, store_ptr,
-			&size, error);
-		buffer = (char *)*bufferptr;
-		write_len = (size_t)size;
-		status = mb_fileio_put(verbose, mbio_ptr, buffer, &write_len, error);
-		}
-	/* write SWPLS_ID_PARSED_ATTITUDE */
-	else if (store->kind == MB_DATA_ATTITUDE)
-		{
-		status = swpls_wr_attitude(verbose, bufferalloc, bufferptr, store_ptr,
-			&size, error);
-		buffer = (char *)*bufferptr;
-		write_len = (size_t)size;
-		status = mb_fileio_put(verbose, mbio_ptr, buffer, &write_len, error);
-		}
-	/* write SWPLS_ID_PARSED_POSITION_LL */
-	else if (store->kind == MB_DATA_NAV)
-		{
-		status = swpls_wr_posll(verbose, bufferalloc, bufferptr, store_ptr,
-			&size, error);
-		buffer = (char *)*bufferptr;
-		write_len = (size_t)size;
-		status = mb_fileio_put(verbose, mbio_ptr, buffer, &write_len, error);
-		}
-	/* write SWPLS_ID_PARSED_POSITION_EN */
-	else if (store->kind == MB_DATA_NAV1)
-		{
-		status = swpls_wr_posen(verbose, bufferalloc, bufferptr, store_ptr,
-			&size, error);
-		buffer = (char *)*bufferptr;
-		write_len = (size_t)size;
-		status = mb_fileio_put(verbose, mbio_ptr, buffer, &write_len, error);
-		}
-	/* write SWPLS_ID_PARSED_SSV */
-	else if (store->kind == MB_DATA_SSV)
-		{
-		status = swpls_wr_ssv(verbose, bufferalloc, bufferptr, store_ptr, &size,
-			error);
-		buffer = (char *)*bufferptr;
-		write_len = (size_t)size;
-		status = mb_fileio_put(verbose, mbio_ptr, buffer, &write_len, error);
-		}
-	/* write SWPLS_ID_PARSED_ECHOSOUNDER */
-	else if (store->kind == MB_DATA_ALTITUDE)
-		{
-		status = swpls_wr_echosounder(verbose, bufferalloc, bufferptr,
-			store_ptr, &size, error);
-		buffer = (char *)*bufferptr;
-		write_len = (size_t)size;
-		status = mb_fileio_put(verbose, mbio_ptr, buffer, &write_len, error);
-		}
-	/* write SWPLS_ID_PARSED_TIDE */
-	else if (store->kind == MB_DATA_TIDE)
-		{
-		status = swpls_wr_tide(verbose, bufferalloc, bufferptr, store_ptr,
-			&size, error);
-		buffer = (char *)*bufferptr;
-		write_len = (size_t)size;
-		status = mb_fileio_put(verbose, mbio_ptr, buffer, &write_len, error);
-		}
-	/* write SWPLS_ID_POS_OFFSET */
-	else if ((store->kind == MB_DATA_PARAMETER) &&
-		(store->type == SWPLS_ID_POS_OFFSET))
-		{
-		status = swpls_wr_pos_offset(verbose, bufferalloc, bufferptr, store_ptr,
-			&size, error);
-		buffer = (char *)*bufferptr;
-		write_len = (size_t)size;
-		status = mb_fileio_put(verbose, mbio_ptr, buffer, &write_len, error);
-		}
-	/* write SWPLS_ID_IMU_OFFSET */
-	else if ((store->kind == MB_DATA_PARAMETER) &&
-		(store->type == SWPLS_ID_IMU_OFFSET))
-		{
-		status = swpls_wr_imu_offset(verbose, bufferalloc, bufferptr, store_ptr,
-			&size, error);
-		buffer = (char *)*bufferptr;
-		write_len = (size_t)size;
-		status = mb_fileio_put(verbose, mbio_ptr, buffer, &write_len, error);
-		}
-	/* write SWPLS_ID_TXER_OFFSET */
-	else if ((store->kind == MB_DATA_PARAMETER) &&
-		(store->type == SWPLS_ID_TXER_OFFSET))
-		{
-		status = swpls_wr_txer_offset(verbose, bufferalloc, bufferptr,
-			store_ptr, &size, error);
-		buffer = (char *)*bufferptr;
-		write_len = (size_t)size;
-		status = mb_fileio_put(verbose, mbio_ptr, buffer, &write_len, error);
-		}
-	/* write SWPLS_ID_WL_OFFSET */
-	else if ((store->kind == MB_DATA_PARAMETER) &&
-		(store->type == SWPLS_ID_WL_OFFSET))
-		{
-		status = swpls_wr_wl_offset(verbose, bufferalloc, bufferptr, store_ptr,
-			&size, error);
-		buffer = (char *)*bufferptr;
-		write_len = (size_t)size;
-		status = mb_fileio_put(verbose, mbio_ptr, buffer, &write_len, error);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		fprintf(stderr, "dbg2       error:      %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2       status:    %d\n", status);
-		}
-
-	/* return status */
-	return (status);
-}		/* swpls_wr_data */
-/*-------------------------------------------------------------------*/
-int swpls_wr_sxpheader(int verbose, int *bufferalloc, char **bufferptr,
-	void *store_ptr, int *size, int *error)
-{
-	char *function_name = "swpls_wr_sxpheader";
-	int status = MB_SUCCESS;
-	struct mbsys_swathplus_struct *store;
-	swpls_header *header;
-	char *buffer;
-	int index;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> called\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n");
-		fprintf(stderr, "dbg2       verbose:      %d\n", verbose);
-		fprintf(stderr, "dbg2       bufferalloc:  %d\n", *bufferalloc);
-		fprintf(stderr, "dbg2       bufferptr:    %p\n", (void *)bufferptr);
-		fprintf(stderr, "dbg2       store_ptr:    %p\n", (void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_swathplus_struct *)store_ptr;
-	header = &(store->sxp_header);
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr, "\ndbg5  Values to be written in MBIO function <%s>\n",
-			function_name);
-		swpls_pr_sxpheader(verbose, stderr, header, error);
-		}
-
-	/* figure out size of output record */
-	*size = SWPLS_SIZE_BLOCKHEADER + SWPLS_SIZE_HEADER;
-
-	/* allocate memory to write record if necessary */
-	if (*bufferalloc < *size)
-		{
-		status = mb_reallocd(verbose, __FILE__, __LINE__, *size,
-			(void **)bufferptr, error);
-		if (status != MB_SUCCESS)
-			{
-			*bufferalloc = 0;
-			}
-		else
-			{
-			*bufferalloc = *size;
-			}
-		}
-
-	/* proceed to write if buffer allocated */
-	if (status == MB_SUCCESS)
-		{
-		/* get buffer for writing */
-		buffer = (char *)*bufferptr;
-
-		/* insert the block header */
-		index = 0;
-		mb_put_binary_int(MB_YES, SWPLS_ID_SXP_HEADER_DATA, &buffer[index]);
-		index += 4;
-		mb_put_binary_int(MB_YES, SWPLS_SIZE_HEADER, &buffer[index]);
-		index += 4;
-
-		/* insert the file header data */
-		mb_put_binary_int(MB_YES, header->swver, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, header->fmtver, &buffer[index]); index += 4;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		fprintf(stderr, "dbg2       error:      %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2       status:  %d\n", status);
-		}
-
-	/* return status */
-	return (status);
-}		/* swpls_wr_sxpheader */
-/*---------------------------------------------------------------------*/
-int swpls_wr_sxpping(int verbose, int *bufferalloc, char **bufferptr,
-	void *store_ptr, int *size, int *error)
-{
-	char *function_name = "swpls_wr_sxpping";
-	int status = MB_SUCCESS;
-	struct mbsys_swathplus_struct *store;
-	swpls_sxpping *ping;
-	char *buffer;
-	int index;
-	int i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> called\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n");
-		fprintf(stderr, "dbg2      verbose:     %d\n", verbose);
-		fprintf(stderr, "dbg2      bufferalloc: %d\n", *bufferalloc);
-		fprintf(stderr, "dbg2      bufferptr:   %p\n", (void *)bufferptr);
-		fprintf(stderr, "dbg2      store_ptr:   %p\n", (void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_swathplus_struct *)store_ptr;
-	ping = &(store->sxp_ping);
-
-	/* print debug statements */
-	if (verbose >= 4)
-		{
-		fprintf(stderr, "\ndbg4  Values to be written in MBIO function <%s>\n",
-			function_name);
-		swpls_pr_sxpping(verbose, stderr, ping, error);
-		}
-
-	/* figure out size of output record */
-	*size = SWPLS_SIZE_BLOCKHEADER + SWPLS_SIZE_PROCESSED_PING2 +
-		(ping->nosampsfile * SWPLS_SIZE_POINT2);
-
-	/* allocate memory to write record if necessary */
-	if (*bufferalloc < *size)
-		{
-		status = mb_reallocd(verbose, __FILE__, __LINE__, *size,
-			(void **)bufferptr, error);
-		if (status != MB_SUCCESS)
-			{
-			*bufferalloc = 0;
-			}
-		else
-			{
-			*bufferalloc = *size;
-			}
-		}
-
-	/* proceed to write if buffer allocated */
-	if (status == MB_SUCCESS)
-		{
-		/* get buffer for writing */
-		buffer = (char *)*bufferptr;
-
-		/* insert the data */
-		index = 0;
-		mb_put_binary_int(MB_YES, SWPLS_ID_PROCESSED_PING2, &buffer[index]);
-		index += 4;
-		mb_put_binary_int(MB_YES, (*size - SWPLS_SIZE_BLOCKHEADER),
-			&buffer[index]); index += 4;
-		strncpy(&buffer[index], &(ping->linename[0]), SWPLS_MAX_LINENAME);
-		index += SWPLS_MAX_LINENAME;
-		mb_put_binary_int(MB_YES, ping->pingnumber, &buffer[index]);
-		index += 4;
-		index += 4;		/* padding bytes */
-		mb_put_binary_double(MB_YES, ping->time_d, &buffer[index]); index += 8;
-		mb_put_binary_int(MB_YES, ping->notxers, &buffer[index]); index += 4;
-		index += 4;		/* padding bytes */
-		mb_put_binary_double(MB_YES, ping->easting, &buffer[index]);
-		index += 8;
-		mb_put_binary_double(MB_YES, ping->northing, &buffer[index]);
-		index += 8;
-		mb_put_binary_double(MB_YES, ping->roll, &buffer[index]); index += 8;
-		mb_put_binary_double(MB_YES, ping->pitch, &buffer[index]); index += 8;
-		mb_put_binary_double(MB_YES, ping->heading, &buffer[index]);
-		index += 8;
-		mb_put_binary_double(MB_YES, ping->height, &buffer[index]); index += 8;
-		mb_put_binary_double(MB_YES, ping->tide, &buffer[index]); index += 8;
-		mb_put_binary_double(MB_YES, ping->sos, &buffer[index]); index += 8;
-		buffer[index] = ping->txno; index += 1;
-		buffer[index] = ping->txstat; index += 1;
-		buffer[index] = ping->txpower; index += 1;
-		index += 1;		/* padding byte */
-		mb_put_binary_short(MB_YES, ping->analoggain, &buffer[index]);
-		index += 2;
-		buffer[index] = ping->nostaves; index += 1;
-		for (i = 0; i < SWPLS_MAX_TX_INFO; i++)
-			{
-			buffer[index] = ping->txinfo[i]; index += 1;
-			}
-		index += 1;		/* padding bytes */
-		buffer[index] = ping->freq; index += 1;
-		index += 4;		/* padding bytes */
-		mb_put_binary_double(MB_YES, ping->frequency, &buffer[index]);
-		index += 8;
-		mb_put_binary_short(MB_YES, ping->trnstime, &buffer[index]);
-		index += 2;
-		mb_put_binary_short(MB_YES, ping->recvtime, &buffer[index]);
-		index += 2;
-		buffer[index] = ping->samprate; index += 1;
-		index += 3;		/* padding bytes */
-		mb_put_binary_int(MB_YES, ping->nosampsorig, &buffer[index]);
-		index += 4;
-		mb_put_binary_int(MB_YES, ping->nosampsfile, &buffer[index]);
-		index += 4;
-		mb_put_binary_int(MB_YES, ping->nosampslots, &buffer[index]);
-		index += 4;
-		index += 4;		/* padding bytes */
-		mb_put_binary_double(MB_YES, ping->txer_e, &buffer[index]); index += 8;
-		mb_put_binary_double(MB_YES, ping->txer_n, &buffer[index]); index += 8;
-		mb_put_binary_double(MB_YES, ping->txer_height, &buffer[index]);
-		index += 8;
-		mb_put_binary_double(MB_YES, ping->txer_forward, &buffer[index]);
-		index += 8;
-		mb_put_binary_double(MB_YES, ping->txer_starboard, &buffer[index]);
-		index += 8;
-		mb_put_binary_double(MB_YES, ping->txer_azimuth, &buffer[index]);
-		index += 8;
-		mb_put_binary_double(MB_YES, ping->txer_elevation, &buffer[index]);
-		index += 8;
-		mb_put_binary_double(MB_YES, ping->txer_skew, &buffer[index]);
-		index += 8;
-		mb_put_binary_double(MB_YES, ping->txer_time, &buffer[index]);
-		index += 8;
-		mb_put_binary_double(MB_YES, ping->txer_waterdepth, &buffer[index]);
-		index += 8;
-		mb_put_binary_double(MB_YES, ping->txer_pitch, &buffer[index]);
-		index += 8;
-
-		/* insert the xyza point data */
-		for (i = 0; i != ping->nosampsfile; ++i)
-			{
-			mb_put_binary_int(MB_YES, ping->points[i].sampnum, &buffer[index]);
-			index += 4;
-			index += 4;		/* padding bytes */
-			mb_put_binary_double(MB_YES, ping->points[i].y, &buffer[index]);
-			index += 8;
-			mb_put_binary_double(MB_YES, ping->points[i].x, &buffer[index]);
-			index += 8;
-			mb_put_binary_float(MB_YES, ping->points[i].z, &buffer[index]);
-			index += 4;
-			mb_put_binary_short(MB_YES, ping->points[i].amp, &buffer[index]);
-			index += 2;
-			mb_put_binary_short(MB_YES, ping->points[i].procamp,
-				&buffer[index]); index += 2;
-			buffer[index] = ping->points[i].status; index += 1;
-			index += 7;		/* padding bytes */
-			mb_put_binary_double(MB_YES, ping->points[i].tpu, &buffer[index]);
-			index += 8;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		fprintf(stderr, "dbg2       error:      %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2       status:  %d\n", status);
-		}
-
-	/* return status */
-	return (status);
-}		/* swpls_wr_sxpping */
-/*------------------------------------------------------------*/
-int swpls_wr_projection(int verbose, int *bufferalloc, char **bufferptr,
-	void *store_ptr, int *size, int *error)
-{
-	char *function_name = "swpls_wr_projection";
-	int status = MB_SUCCESS;
-	struct mbsys_swathplus_struct *store;
-	swpls_projection *projection;
-	char *buffer;
-	int index;
-	size_t padding;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> called\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n");
-		fprintf(stderr, "dbg2       verbose:    %d\n", verbose);
-		fprintf(stderr, "dbg2      bufferalloc: %d\n", *bufferalloc);
-		fprintf(stderr, "dbg2      bufferptr:   %p\n", (void *)bufferptr);
-		fprintf(stderr, "dbg2      store_ptr:   %p\n", (void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_swathplus_struct *)store_ptr;
-	projection = &(store->projection);
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr, "\ndbg5  Values to be written in MBIO function <%s>\n",
-			function_name);
-		swpls_pr_projection(verbose, stderr, projection, error);
-		}
-
-	/* figure out the size of output record */
-	*size = SWPLS_SIZE_BLOCKHEADER + SWPLS_SIZE_PROJECTION + projection->nchars;
-
-	/* pad string to byte align on int32 boundary (not necessary, just
-	   easier to read in hexfiend */
-	padding = 4 - (*size % 4);
-	*size = *size + padding;
-	projection->nchars = projection->nchars + padding;
-
-	/* allocate memory to write record if necessary */
-	if (*bufferalloc < *size)
-		{
-		status = mb_reallocd(verbose, __FILE__, __LINE__, *size,
-			(void **)bufferptr, error);
-		if (status != MB_SUCCESS)
-			{
-			*bufferalloc = 0;
-			}
-		else
-			{
-			*bufferalloc = *size;
-			}
-		}
-
-	/* proceed to write if buffer allocated */
-	if (status == MB_SUCCESS)
-		{
-		/* get buffer for writing */
-		buffer = (char *)*bufferptr;
-
-		/* insert the data */
-		index = 0;
-		mb_put_binary_int(MB_YES, SWPLS_ID_PROJECTION, &buffer[index]);
-		index += 4;
-		mb_put_binary_int(MB_YES, *size - SWPLS_SIZE_BLOCKHEADER,
-			&buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, projection->time_d, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, projection->microsec, &buffer[index]);
-		index += 4;
-		mb_put_binary_int(MB_YES, projection->nchars, &buffer[index]); index += 4;
-		strncpy(&buffer[index], projection->projection_id,
-			projection->nchars); index += projection->nchars;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		fprintf(stderr, "dbg2       error:      %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2       status:  %d\n", status);
-		}
-
-	/* return status */
-	return (status);
-}		/* swpls_wr_projection */
-/*------------------------------------------------------------*/
-int swpls_wr_comment(int verbose, int *bufferalloc, char **bufferptr,
-	void *store_ptr, int *size, int *error)
-{
-	char *function_name = "swpls_wr_comment";
-	int status = MB_SUCCESS;
-	struct mbsys_swathplus_struct *store;
-	swpls_comment *comment;
-	char *buffer;
-	int index;
-	size_t padding;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> called\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n");
-		fprintf(stderr, "dbg2       verbose:    %d\n", verbose);
-		fprintf(stderr, "dbg2      bufferalloc: %d\n", *bufferalloc);
-		fprintf(stderr, "dbg2      bufferptr:   %p\n", (void *)bufferptr);
-		fprintf(stderr, "dbg2      store_ptr:   %p\n", (void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_swathplus_struct *)store_ptr;
-	comment = &(store->comment);
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr, "\ndbg5  Values to be written in MBIO function <%s>\n",
-			function_name);
-		swpls_pr_comment(verbose, stderr, comment, error);
-		}
-
-	/* figure out the size of output record */
-	*size = SWPLS_SIZE_BLOCKHEADER + SWPLS_SIZE_COMMENT + comment->nchars;
-
-	/* pad string to byte align on int32 boundary (not necessary, just
-	   easier to read in hexfiend */
-	padding = 4 - (*size % 4);
-	*size = *size + padding;
-	comment->nchars = comment->nchars + padding;
-
-	/* allocate memory to write record if necessary */
-	if (*bufferalloc < *size)
-		{
-		status = mb_reallocd(verbose, __FILE__, __LINE__, *size,
-			(void **)bufferptr, error);
-		if (status != MB_SUCCESS)
-			{
-			*bufferalloc = 0;
-			}
-		else
-			{
-			*bufferalloc = *size;
-			}
-		}
-
-	/* proceed to write if buffer allocated */
-	if (status == MB_SUCCESS)
-		{
-		/* get buffer for writing */
-		buffer = (char *)*bufferptr;
-
-		/* insert the data */
-		index = 0;
-		mb_put_binary_int(MB_YES, SWPLS_ID_COMMENT, &buffer[index]);
-		index += 4;
-		mb_put_binary_int(MB_YES, *size - SWPLS_SIZE_BLOCKHEADER,
-			&buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, comment->time_d, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, comment->microsec, &buffer[index]);
-		index += 4;
-		mb_put_binary_int(MB_YES, comment->nchars, &buffer[index]); index += 4;
-		strncpy(&buffer[index], comment->message,
-			comment->nchars); index += comment->nchars;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		fprintf(stderr, "dbg2       error:      %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2       status:  %d\n", status);
-		}
-
-	/* return status */
-	return (status);
-}		/* swpls_wr_comment */
-/*-------------------------------------------------------------------*/
-int swpls_wr_sxiheader(int verbose, int *bufferalloc, char **bufferptr,
-	void *store_ptr, int *size, int *error)
-{
-	char *function_name = "swpls_wr_sxiheader";
-	int status = MB_SUCCESS;
-	struct mbsys_swathplus_struct *store;
-	swpls_header *header;
-	char *buffer;
-	int index;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> called\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n");
-		fprintf(stderr, "dbg2       verbose:      %d\n", verbose);
-		fprintf(stderr, "dbg2       bufferalloc:  %d\n", *bufferalloc);
-		fprintf(stderr, "dbg2       bufferptr:    %p\n", (void *)bufferptr);
-		fprintf(stderr, "dbg2       store_ptr:    %p\n", (void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_swathplus_struct *)store_ptr;
-	header = &(store->sxi_header);
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr, "\ndbg5  Values to be written in MBIO function <%s>\n",
-			function_name);
-		swpls_pr_sxiheader(verbose, stderr, header, error);
-		}
-
-	/* figure out size of output record */
-	*size = SWPLS_SIZE_BLOCKHEADER + SWPLS_SIZE_HEADER;
-
-	/* allocate memory to write record if necessary */
-	if (*bufferalloc < *size)
-		{
-		status = mb_reallocd(verbose, __FILE__, __LINE__, *size,
-			(void **)bufferptr, error);
-		if (status != MB_SUCCESS)
-			{
-			*bufferalloc = 0;
-			}
-		else
-			{
-			*bufferalloc = *size;
-			}
-		}
-
-	/* proceed to write if buffer allocated */
-	if (status == MB_SUCCESS)
-		{
-		/* get buffer for writing */
-		buffer = (char *)*bufferptr;
-
-		/* insert the block header */
-		index = 0;
-		mb_put_binary_int(MB_YES, SWPLS_ID_SXI_HEADER_DATA, &buffer[index]);
-		index += 4;
-		mb_put_binary_int(MB_YES, SWPLS_SIZE_HEADER, &buffer[index]);
-		index += 4;
-
-		/* insert the file header data */
-		mb_put_binary_int(MB_YES, header->swver, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, header->fmtver, &buffer[index]); index += 4;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		fprintf(stderr, "dbg2       error:      %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2       status:  %d\n", status);
-		}
-
-	/* return status */
-	return (status);
-}		/* swpls_wr_sxiheader */
-/*-------------------------------------------------------------------*/
-int swpls_wr_sxiping(int verbose, int *bufferalloc, char **bufferptr,
-	void *store_ptr, int *size, int *error)
-{
-	char *function_name = "swpls_wr_sxiping";
-	int status = MB_SUCCESS;
-	struct mbsys_swathplus_struct *store;
-	swpls_sxiping *ping;
-	char *buffer;
-	int index;
-	int i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> called\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n");
-		fprintf(stderr, "dbg2       verbose:      %d\n", verbose);
-		fprintf(stderr, "dbg2       bufferalloc:  %d\n", *bufferalloc);
-		fprintf(stderr, "dbg2       bufferptr:    %p\n", (void *)bufferptr);
-		fprintf(stderr, "dbg2       store_ptr:    %p\n", (void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_swathplus_struct *)store_ptr;
-	ping = &(store->sxi_ping);
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr, "\ndbg5  Values to be written in MBIO function <%s>\n",
-			function_name);
-		swpls_pr_sxiping(verbose, stderr, ping, error);
-		}
-
-	/* figure out size of output record */
-	*size = SWPLS_SIZE_BLOCKHEADER + SWPLS_SIZE_PARSED_PING +
-		(ping->nosamps * SWPLS_SIZE_PARSED_POINT);
-
-	/* allocate memory to write record if necessary */
-	if (*bufferalloc < *size)
-		{
-		status = mb_reallocd(verbose, __FILE__, __LINE__, *size,
-			(void **)bufferptr, error);
-		if (status != MB_SUCCESS)
-			{
-			*bufferalloc = 0;
-			}
-		else
-			{
-			*bufferalloc = *size;
-			}
-		}
-
-	/* proceed to write if buffer allocated */
-	if (status == MB_SUCCESS)
-		{
-		/* get buffer for writing */
-		buffer = (char *)*bufferptr;
-
-		/* insert the block header */
-		index = 0;
-		mb_put_binary_int(MB_YES, SWPLS_ID_PARSED_PING, &buffer[index]);
-		index += 4;
-		mb_put_binary_int(MB_YES, (*size - SWPLS_SIZE_BLOCKHEADER),
-			&buffer[index]); index += 4;
-
-		/* insert the data */
-		mb_put_binary_int(MB_YES, ping->time_d, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, ping->microsec, &buffer[index]); index += 4;
-		buffer[index] = ping->channel; index++;
-		mb_put_binary_int(MB_YES, ping->pingnumber, &buffer[index]);
-		index += 4;
-		mb_put_binary_float(MB_YES, ping->frequency, &buffer[index]);
-		index += 4;
-		mb_put_binary_float(MB_YES, ping->samp_period, &buffer[index]);
-		index += 4;
-		mb_put_binary_short(MB_YES, ping->nosamps, &buffer[index]); index += 2;
-		mb_put_binary_float(MB_YES, ping->sos, &buffer[index]); index += 4;
-		mb_put_binary_short(MB_YES, ping->txpulse, &buffer[index]); index += 2;
-		buffer[index] = ping->data_options; index++;
-		buffer[index] = ping->ping_state; index++;
-		mb_put_binary_short(MB_YES, ping->max_count, &buffer[index]);
-		index += 2;
-		mb_put_binary_short(MB_YES, ping->reserve1, &buffer[index]);
-		index += 2;
-		for (i = 0; i < ping->nosamps; i++)
-			{
-			mb_put_binary_short(MB_YES, ping->sampnum[i], &buffer[index]);
-			index += 2;
-			mb_put_binary_short(MB_YES, ping->angle[i], &buffer[index]);
-			index += 2;
-			mb_put_binary_short(MB_YES, ping->amplitude[i], &buffer[index]);
-			index += 2;
-			buffer[index] = ping->quality[i]; index++;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		fprintf(stderr, "dbg2       error:      %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2       status:  %d\n", status);
-		}
-
-	/* return status */
-	return (status);
-}		/* swpls_wr_sxiping */
-/*-------------------------------------------------------------------*/
-int swpls_wr_attitude(int verbose, int *bufferalloc, char **bufferptr,
-	void *store_ptr, int *size, int *error)
-{
-	char *function_name = "swpls_wr_attitude";
-	int status = MB_SUCCESS;
-	struct mbsys_swathplus_struct *store;
-	swpls_attitude *attitude;
-	char *buffer;
-	int index;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> called\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n");
-		fprintf(stderr, "dbg2       verbose:      %d\n", verbose);
-		fprintf(stderr, "dbg2       bufferalloc:  %d\n", *bufferalloc);
-		fprintf(stderr, "dbg2       bufferptr:    %p\n", (void *)bufferptr);
-		fprintf(stderr, "dbg2       store_ptr:    %p\n", (void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_swathplus_struct *)store_ptr;
-	attitude = &(store->attitude);
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr, "\ndbg5  Values to be written in MBIO function <%s>\n",
-			function_name);
-		swpls_pr_attitude(verbose, stderr, attitude, error);
-		}
-
-	/* figure out size of output record */
-	*size = SWPLS_SIZE_BLOCKHEADER + SWPLS_SIZE_ATTITUDE;
-
-	/* allocate memory to write record if necessary */
-	if (*bufferalloc < *size)
-		{
-		status = mb_reallocd(verbose, __FILE__, __LINE__, *size,
-			(void **)bufferptr, error);
-		if (status != MB_SUCCESS)
-			{
-			*bufferalloc = 0;
-			}
-		else
-			{
-			*bufferalloc = *size;
-			}
-		}
-
-	/* proceed to write if buffer allocated */
-	if (status == MB_SUCCESS)
-		{
-		/* get buffer for writing */
-		buffer = (char *)*bufferptr;
-
-		/* insert the block header */
-		index = 0;
-		mb_put_binary_int(MB_YES, SWPLS_ID_PARSED_ATTITUDE, &buffer[index]);
-		index += 4;
-		mb_put_binary_int(MB_YES, (*size - SWPLS_SIZE_BLOCKHEADER),
-			&buffer[index]); index += 4;
-
-		/* insert the data */
-		mb_put_binary_int(MB_YES, attitude->time_d, &buffer[index]);
-		index += 4;
-		mb_put_binary_int(MB_YES, attitude->microsec, &buffer[index]);
-		index += 4;
-		buffer[index] = attitude->channel; index++;
-		mb_put_binary_float(MB_YES, attitude->roll, &buffer[index]);
-		index += 4;
-		mb_put_binary_float(MB_YES, attitude->pitch, &buffer[index]);
-		index += 4;
-		mb_put_binary_float(MB_YES, attitude->heading, &buffer[index]);
-		index += 4;
-		mb_put_binary_float(MB_YES, attitude->height, &buffer[index]);
-		index += 2;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		fprintf(stderr, "dbg2       error:      %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2       status:  %d\n", status);
-		}
-
-	/* return status */
-	return (status);
-}		/* swpls_wr_attitude */
-/*-------------------------------------------------------------------*/
-int swpls_wr_posll(int verbose, int *bufferalloc, char **bufferptr,
-	void *store_ptr, int *size, int *error)
-{
-	char *function_name = "swpls_wr_posll";
-	int status = MB_SUCCESS;
-	struct mbsys_swathplus_struct *store;
-	swpls_posll *posll;
-	char *buffer;
-	int index;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> called\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n");
-		fprintf(stderr, "dbg2       verbose:      %d\n", verbose);
-		fprintf(stderr, "dbg2       bufferalloc:  %d\n", *bufferalloc);
-		fprintf(stderr, "dbg2       bufferptr:    %p\n", (void *)bufferptr);
-		fprintf(stderr, "dbg2       store_ptr:    %p\n", (void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_swathplus_struct *)store_ptr;
-	posll = &(store->posll);
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr, "\ndbg5  Values to be written in MBIO function <%s>\n",
-			function_name);
-		swpls_pr_posll(verbose, stderr, posll, error);
-		}
-
-	/* figure out size of output record */
-	*size = SWPLS_SIZE_BLOCKHEADER + SWPLS_SIZE_POSITION_LL;
-
-	/* allocate memory to write record if necessary */
-	if (*bufferalloc < *size)
-		{
-		status = mb_reallocd(verbose, __FILE__, __LINE__, *size,
-			(void **)bufferptr, error);
-		if (status != MB_SUCCESS)
-			{
-			*bufferalloc = 0;
-			}
-		else
-			{
-			*bufferalloc = *size;
-			}
-		}
-
-	/* proceed to write if buffer allocated */
-	if (status == MB_SUCCESS)
-		{
-		/* get buffer for writing */
-		buffer = (char *)*bufferptr;
-
-		/* insert the block header */
-		index = 0;
-		mb_put_binary_int(MB_YES, SWPLS_ID_PARSED_POSITION_LL, &buffer[index]);
-		index += 4;
-		mb_put_binary_int(MB_YES, (*size - SWPLS_SIZE_BLOCKHEADER),
-			&buffer[index]); index += 4;
-
-		/* insert the data */
-		mb_put_binary_int(MB_YES, posll->time_d, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, posll->microsec, &buffer[index]); index += 4;
-		buffer[index] = posll->channel; index++;
-		mb_put_binary_double(MB_YES, posll->latitude, &buffer[index]);
-		index += 8;
-		mb_put_binary_double(MB_YES, posll->longitude, &buffer[index]);
-		index += 8;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		fprintf(stderr, "dbg2       error:      %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2       status:  %d\n", status);
-		}
-
-	/* return status */
-	return (status);
-}		/* swpls_wr_posll */
-/*-------------------------------------------------------------------*/
-int swpls_wr_posen(int verbose, int *bufferalloc, char **bufferptr,
-	void *store_ptr, int *size, int *error)
-{
-	char *function_name = "swpls_wr_posen";
-	int status = MB_SUCCESS;
-	struct mbsys_swathplus_struct *store;
-	swpls_posen *posen;
-	char *buffer;
-	int index;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> called\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n");
-		fprintf(stderr, "dbg2       verbose:      %d\n", verbose);
-		fprintf(stderr, "dbg2       bufferalloc:  %d\n", *bufferalloc);
-		fprintf(stderr, "dbg2       bufferptr:    %p\n", (void *)bufferptr);
-		fprintf(stderr, "dbg2       store_ptr:    %p\n", (void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_swathplus_struct *)store_ptr;
-	posen = &(store->posen);
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr, "\ndbg5  Values to be written in MBIO function <%s>\n",
-			function_name);
-		swpls_pr_posen(verbose, stderr, posen, error);
-		}
-
-	/* figure out size of output record */
-	*size = SWPLS_SIZE_BLOCKHEADER + SWPLS_SIZE_POSITION_EN;
-
-	/* allocate memory to write record if necessary */
-	if (*bufferalloc < *size)
-		{
-		status = mb_reallocd(verbose, __FILE__, __LINE__, *size,
-			(void **)bufferptr, error);
-		if (status != MB_SUCCESS)
-			{
-			*bufferalloc = 0;
-			}
-		else
-			{
-			*bufferalloc = *size;
-			}
-		}
-
-	/* proceed to write if buffer allocated */
-	if (status == MB_SUCCESS)
-		{
-		/* get buffer for writing */
-		buffer = (char *)*bufferptr;
-
-		/* insert the block header */
-		index = 0;
-		mb_put_binary_int(MB_YES, SWPLS_ID_PARSED_POSITION_EN, &buffer[index]);
-		index += 4;
-		mb_put_binary_int(MB_YES, (*size - SWPLS_SIZE_BLOCKHEADER),
-			&buffer[index]); index += 4;
-
-		/* insert the data */
-		mb_put_binary_int(MB_YES, posen->time_d, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, posen->microsec, &buffer[index]); index += 4;
-		buffer[index] = posen->channel; index++;
-		mb_put_binary_double(MB_YES, posen->easting, &buffer[index]);
-		index += 8;
-		mb_put_binary_double(MB_YES, posen->northing, &buffer[index]);
-		index += 8;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		fprintf(stderr, "dbg2       error:      %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2       status:  %d\n", status);
-		}
-
-	/* return status */
-	return (status);
-}		/* swpls_wr_posen */
-/*-------------------------------------------------------------------*/
-int swpls_wr_ssv(int verbose, int *bufferalloc, char **bufferptr,
-	void *store_ptr, int *size, int *error)
-{
-	char *function_name = "swpls_wr_ssv";
-	int status = MB_SUCCESS;
-	struct mbsys_swathplus_struct *store;
-	swpls_ssv *ssv;
-	char *buffer;
-	int index;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> called\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n");
-		fprintf(stderr, "dbg2       verbose:      %d\n", verbose);
-		fprintf(stderr, "dbg2       bufferalloc:  %d\n", *bufferalloc);
-		fprintf(stderr, "dbg2       bufferptr:    %p\n", (void *)bufferptr);
-		fprintf(stderr, "dbg2       store_ptr:    %p\n", (void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_swathplus_struct *)store_ptr;
-	ssv = &(store->ssv);
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr, "\ndbg5  Values to be written in MBIO function <%s>\n",
-			function_name);
-		swpls_pr_ssv(verbose, stderr, ssv, error);
-		}
-
-	/* figure out size of output record */
-	*size = SWPLS_SIZE_BLOCKHEADER + SWPLS_SIZE_SSV;
-
-	/* allocate memory to write record if necessary */
-	if (*bufferalloc < *size)
-		{
-		status = mb_reallocd(verbose, __FILE__, __LINE__, *size,
-			(void **)bufferptr, error);
-		if (status != MB_SUCCESS)
-			{
-			*bufferalloc = 0;
-			}
-		else
-			{
-			*bufferalloc = *size;
-			}
-		}
-
-	/* proceed to write if buffer allocated */
-	if (status == MB_SUCCESS)
-		{
-		/* get buffer for writing */
-		buffer = (char *)*bufferptr;
-
-		/* insert the block header */
-		index = 0;
-		mb_put_binary_int(MB_YES, SWPLS_ID_PARSED_SSV, &buffer[index]);
-		index += 4;
-		mb_put_binary_int(MB_YES, (*size - SWPLS_SIZE_BLOCKHEADER),
-			&buffer[index]); index += 4;
-
-		/* insert the data */
-		mb_put_binary_int(MB_YES, ssv->time_d, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, ssv->microsec, &buffer[index]); index += 4;
-		buffer[index] = ssv->channel; index++;
-		mb_put_binary_float(MB_YES, ssv->ssv, &buffer[index]); index += 4;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		fprintf(stderr, "dbg2       error:      %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2       status:  %d\n", status);
-		}
-
-	/* return status */
-	return (status);
-}		/* swpls_wr_ssv */
-/*-------------------------------------------------------------------*/
-int swpls_wr_tide(int verbose, int *bufferalloc, char **bufferptr,
-	void *store_ptr, int *size, int *error)
-{
-	char *function_name = "swpls_wr_tide";
-	int status = MB_SUCCESS;
-	struct mbsys_swathplus_struct *store;
-	swpls_tide *tide;
-	char *buffer;
-	int index;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> called\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n");
-		fprintf(stderr, "dbg2       verbose:      %d\n", verbose);
-		fprintf(stderr, "dbg2       bufferalloc:  %d\n", *bufferalloc);
-		fprintf(stderr, "dbg2       bufferptr:    %p\n", (void *)bufferptr);
-		fprintf(stderr, "dbg2       store_ptr:    %p\n", (void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_swathplus_struct *)store_ptr;
-	tide = &(store->tide);
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr, "\ndbg5  Values to be written in MBIO function <%s>\n",
-			function_name);
-		swpls_pr_tide(verbose, stderr, tide, error);
-		}
-
-	/* figure out size of output record */
-	*size = SWPLS_SIZE_BLOCKHEADER + SWPLS_SIZE_TIDE;
-
-	/* allocate memory to write record if necessary */
-	if (*bufferalloc < *size)
-		{
-		status = mb_reallocd(verbose, __FILE__, __LINE__, *size,
-			(void **)bufferptr, error);
-		if (status != MB_SUCCESS)
-			{
-			*bufferalloc = 0;
-			}
-		else
-			{
-			*bufferalloc = *size;
-			}
-		}
-
-	/* proceed to write if buffer allocated */
-	if (status == MB_SUCCESS)
-		{
-		/* get buffer for writing */
-		buffer = (char *)*bufferptr;
-
-		/* insert the block header */
-		index = 0;
-		mb_put_binary_int(MB_YES, SWPLS_ID_PARSED_TIDE, &buffer[index]);
-		index += 4;
-		mb_put_binary_int(MB_YES, (*size - SWPLS_SIZE_BLOCKHEADER),
-			&buffer[index]); index += 4;
-
-		/* insert the data */
-		mb_put_binary_int(MB_YES, tide->time_d, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, tide->microsec, &buffer[index]); index += 4;
-		buffer[index] = tide->channel; index++;
-		mb_put_binary_float(MB_YES, tide->tide, &buffer[index]); index += 4;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		fprintf(stderr, "dbg2       error:      %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2       status:  %d\n", status);
-		}
-
-	/* return status */
-	return (status);
-}		/* swpls_wr_tide */
-/*-------------------------------------------------------------------*/
-int swpls_wr_echosounder(int verbose, int *bufferalloc, char **bufferptr,
-	void *store_ptr, int *size, int *error)
-{
-	char *function_name = "swpls_wr_echosounder";
-	int status = MB_SUCCESS;
-	struct mbsys_swathplus_struct *store;
-	swpls_echosounder *echosounder;
-	char *buffer;
-	int index;
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_swathplus_struct *)store_ptr;
-	echosounder = &(store->echosounder);
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> called\n", function_name);
-		swpls_pr_echosounder(verbose, stderr, echosounder, error);
-		}
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr, "\ndbg5  Values to be written in MBIO function <%s>\n",
-			function_name);
-		fprintf(stderr, "dbg5        echosounder->time_d:      %d\n",
-			echosounder->time_d);
-		fprintf(stderr, "dbg5        echosounder->microsec:    %d\n",
-			echosounder->microsec);
-		fprintf(stderr, "dbg5        echosounder->channel:     %u\n",
-			echosounder->channel);
-		fprintf(stderr, "dbg5        echosounder->altitude:         %f\n",
-			echosounder->altitude);
-		}
-
-	/* figure out size of output record */
-	*size = SWPLS_SIZE_BLOCKHEADER + SWPLS_SIZE_ECHOSOUNDER;
-
-	/* allocate memory to write record if necessary */
-	if (*bufferalloc < *size)
-		{
-		status = mb_reallocd(verbose, __FILE__, __LINE__, *size,
-			(void **)bufferptr, error);
-		if (status != MB_SUCCESS)
-			{
-			*bufferalloc = 0;
-			}
-		else
-			{
-			*bufferalloc = *size;
-			}
-		}
-
-	/* proceed to write if buffer allocated */
-	if (status == MB_SUCCESS)
-		{
-		/* get buffer for writing */
-		buffer = (char *)*bufferptr;
-
-		/* insert the block header */
-		index = 0;
-		mb_put_binary_int(MB_YES, SWPLS_ID_PARSED_ECHOSOUNDER, &buffer[index]);
-		index += 4;
-		mb_put_binary_int(MB_YES, (*size - SWPLS_SIZE_BLOCKHEADER),
-			&buffer[index]); index += 4;
-
-		/* insert the data */
-		mb_put_binary_int(MB_YES, echosounder->time_d, &buffer[index]);
-		index += 4;
-		mb_put_binary_int(MB_YES, echosounder->microsec, &buffer[index]);
-		index += 4;
-		buffer[index] = echosounder->channel; index++;
-		mb_put_binary_float(MB_YES, echosounder->altitude, &buffer[index]);
-		index += 4;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		fprintf(stderr, "dbg2       error:      %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2       status:  %d\n", status);
-		}
-
-	/* return status */
-	return (status);
-}		/* swpls_wr_echosounder */
-/*-------------------------------------------------------------------*/
-int swpls_wr_agds(int verbose, int *bufferalloc, char **bufferptr,
-	void *store_ptr, int *size, int *error)
-{
-	char *function_name = "swpls_wr_agds";
-	int status = MB_SUCCESS;
-	struct mbsys_swathplus_struct *store;
-	swpls_agds *agds;
-	char *buffer;
-	int index;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> called\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n");
-		fprintf(stderr, "dbg2       verbose:      %d\n", verbose);
-		fprintf(stderr, "dbg2       bufferalloc:  %d\n", *bufferalloc);
-		fprintf(stderr, "dbg2       bufferptr:    %p\n", (void *)bufferptr);
-		fprintf(stderr, "dbg2       store_ptr:    %p\n", (void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_swathplus_struct *)store_ptr;
-	agds = &(store->agds);
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr, "\ndbg5  Values to be written in MBIO function <%s>\n",
-			function_name);
-		swpls_pr_agds(verbose, stderr, agds, error);
-		}
-
-	/* figure out size of output record */
-	*size = SWPLS_SIZE_BLOCKHEADER + SWPLS_SIZE_AGDS;
-
-	/* allocate memory to write record if necessary */
-	if (*bufferalloc < *size)
-		{
-		status = mb_reallocd(verbose, __FILE__, __LINE__, *size,
-			(void **)bufferptr, error);
-		if (status != MB_SUCCESS)
-			{
-			*bufferalloc = 0;
-			}
-		else
-			{
-			*bufferalloc = *size;
-			}
-		}
-
-	/* proceed to write if buffer allocated */
-	if (status == MB_SUCCESS)
-		{
-		/* get buffer for writing */
-		buffer = (char *)*bufferptr;
-
-		/* insert the block header */
-		index = 0;
-		mb_put_binary_int(MB_YES, SWPLS_ID_PARSED_AGDS, &buffer[index]);
-		index += 4;
-		mb_put_binary_int(MB_YES, (*size - SWPLS_SIZE_BLOCKHEADER),
-			&buffer[index]); index += 4;
-
-		/* insert the data */
-		mb_put_binary_int(MB_YES, agds->time_d, &buffer[index]); index += 4;
-		mb_put_binary_int(MB_YES, agds->microsec, &buffer[index]); index += 4;
-		buffer[index] = agds->channel; index++;
-		mb_put_binary_float(MB_YES, agds->hardness, &buffer[index]);
-		index += 4;
-		mb_put_binary_float(MB_YES, agds->roughness, &buffer[index]);
-		index += 4;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		fprintf(stderr, "dbg2       error:      %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2       status:  %d\n", status);
-		}
-
-	/* return status */
-	return (status);
-}		/* swpls_wr_agds */
-/*-------------------------------------------------------------------*/
-int swpls_wr_pos_offset(int verbose, int *bufferalloc, char **bufferptr,
-	void *store_ptr, int *size, int *error)
-{
-	char *function_name = "swpls_wr_pos_offset";
-	int status = MB_SUCCESS;
-	struct mbsys_swathplus_struct *store;
-	swpls_pos_offset *pos_offset;
-	char *buffer;
-	int index;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> called\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n");
-		fprintf(stderr, "dbg2       verbose:      %d\n", verbose);
-		fprintf(stderr, "dbg2       bufferalloc:  %d\n", *bufferalloc);
-		fprintf(stderr, "dbg2       bufferptr:    %p\n", (void *)bufferptr);
-		fprintf(stderr, "dbg2       store_ptr:    %p\n", (void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_swathplus_struct *)store_ptr;
-	pos_offset = &(store->pos_offset);
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr, "\ndbg5  Values to be written in MBIO function <%s>\n",
-			function_name);
-		swpls_pr_pos_offset(verbose, stderr, pos_offset, error);
-		}
-
-	/* figure out size of output record */
-	*size = SWPLS_SIZE_BLOCKHEADER + SWPLS_SIZE_POS_OFFSET;
-
-	/* allocate memory to write record if necessary */
-	if (*bufferalloc < *size)
-		{
-		status = mb_reallocd(verbose, __FILE__, __LINE__, *size,
-			(void **)bufferptr, error);
-		if (status != MB_SUCCESS)
-			{
-			*bufferalloc = 0;
-			}
-		else
-			{
-			*bufferalloc = *size;
-			}
-		}
-
-	/* proceed to write if buffer allocated */
-	if (status == MB_SUCCESS)
-		{
-		/* get buffer for writing */
-		buffer = (char *)*bufferptr;
-
-		/* insert the block header */
-		index = 0;
-		mb_put_binary_int(MB_YES, SWPLS_ID_POS_OFFSET, &buffer[index]);
-		index += 4;
-		mb_put_binary_int(MB_YES, (*size - SWPLS_SIZE_BLOCKHEADER),
-			&buffer[index]); index += 4;
-
-		/* insert the data */
-		mb_put_binary_int(MB_YES, pos_offset->time_d, &buffer[index]);
-		index += 4;
-		mb_put_binary_int(MB_YES, pos_offset->microsec, &buffer[index]);
-		index += 4;
-		buffer[index] = pos_offset->channel; index++;
-		mb_put_binary_float(MB_YES, pos_offset->height, &buffer[index]);
-		index += 4;
-		mb_put_binary_float(MB_YES, pos_offset->forward, &buffer[index]);
-		index += 4;
-		mb_put_binary_float(MB_YES, pos_offset->starboard, &buffer[index]);
-		index += 4;
-		mb_put_binary_float(MB_YES, pos_offset->time, &buffer[index]);
-		index += 4;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		fprintf(stderr, "dbg2       error:      %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2       status:  %d\n", status);
-		}
-
-	/* return status */
-	return (status);
-}		/* swpls_wr_pos_offset */
-/*-------------------------------------------------------------------*/
-int swpls_wr_imu_offset(int verbose, int *bufferalloc, char **bufferptr,
-	void *store_ptr, int *size, int *error)
-{
-	char *function_name = "swpls_wr_imu_offset";
-	int status = MB_SUCCESS;
-	struct mbsys_swathplus_struct *store;
-	swpls_imu_offset *imu_offset;
-	char *buffer;
-	int index;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> called\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n");
-		fprintf(stderr, "dbg2       verbose:      %d\n", verbose);
-		fprintf(stderr, "dbg2       bufferalloc:  %d\n", *bufferalloc);
-		fprintf(stderr, "dbg2       bufferptr:    %p\n", (void *)bufferptr);
-		fprintf(stderr, "dbg2       store_ptr:    %p\n", (void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_swathplus_struct *)store_ptr;
-	imu_offset = &(store->imu_offset);
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr, "\ndbg5  Values to be written in MBIO function <%s>\n",
-			function_name);
-		swpls_pr_imu_offset(verbose, stderr, imu_offset, error);
-		}
-
-	/* figure out size of output record */
-	*size = SWPLS_SIZE_BLOCKHEADER + SWPLS_SIZE_IMU_OFFSET;
-
-	/* allocate memory to write record if necessary */
-	if (*bufferalloc < *size)
-		{
-		status = mb_reallocd(verbose, __FILE__, __LINE__, *size,
-			(void **)bufferptr, error);
-		if (status != MB_SUCCESS)
-			{
-			*bufferalloc = 0;
-			}
-		else
-			{
-			*bufferalloc = *size;
-			}
-		}
-
-	/* proceed to write if buffer allocated */
-	if (status == MB_SUCCESS)
-		{
-		/* get buffer for writing */
-		buffer = (char *)*bufferptr;
-
-		/* insert the block header */
-		index = 0;
-		mb_put_binary_int(MB_YES, SWPLS_ID_IMU_OFFSET, &buffer[index]);
-		index += 4;
-		mb_put_binary_int(MB_YES, (*size - SWPLS_SIZE_BLOCKHEADER),
-			&buffer[index]); index += 4;
-
-		/* insert the data */
-		mb_put_binary_int(MB_YES, imu_offset->time_d, &buffer[index]);
-		index += 4;
-		mb_put_binary_int(MB_YES, imu_offset->microsec, &buffer[index]);
-		index += 4;
-		buffer[index] = imu_offset->channel; index++;
-		mb_put_binary_float(MB_YES, imu_offset->height, &buffer[index]);
-		index += 4;
-		mb_put_binary_float(MB_YES, imu_offset->forward, &buffer[index]);
-		index += 4;
-		mb_put_binary_float(MB_YES, imu_offset->starboard, &buffer[index]);
-		index += 4;
-		mb_put_binary_float(MB_YES, imu_offset->time, &buffer[index]);
-		index += 4;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		fprintf(stderr, "dbg2       error:      %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2       status:  %d\n", status);
-		}
-
-	/* return status */
-	return (status);
-}		/* swpls_wr_imu_offset */
-/*-------------------------------------------------------------------*/
-int swpls_wr_txer_offset(int verbose, int *bufferalloc, char **bufferptr,
-	void *store_ptr, int *size, int *error)
-{
-	char *function_name = "swpls_wr_txer_offset";
-	int status = MB_SUCCESS;
-	struct mbsys_swathplus_struct *store;
-	swpls_txer_offset *txer_offset;
-	char *buffer;
-	int index;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> called\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n");
-		fprintf(stderr, "dbg2       verbose:      %d\n", verbose);
-		fprintf(stderr, "dbg2       bufferalloc:  %d\n", *bufferalloc);
-		fprintf(stderr, "dbg2       bufferptr:    %p\n", (void *)bufferptr);
-		fprintf(stderr, "dbg2       store_ptr:    %p\n", (void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_swathplus_struct *)store_ptr;
-	txer_offset = &(store->txer_offset);
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr, "\ndbg5  Values to be written in MBIO function <%s>\n",
-			function_name);
-		swpls_pr_txer_offset(verbose, stderr, txer_offset, error);
-		}
-
-	/* figure out size of output record */
-	*size = SWPLS_SIZE_BLOCKHEADER + SWPLS_SIZE_TXER_OFFSET;
-
-	/* allocate memory to write record if necessary */
-	if (*bufferalloc < *size)
-		{
-		status = mb_reallocd(verbose, __FILE__, __LINE__, *size,
-			(void **)bufferptr, error);
-		if (status != MB_SUCCESS)
-			{
-			*bufferalloc = 0;
-			}
-		else
-			{
-			*bufferalloc = *size;
-			}
-		}
-
-	/* proceed to write if buffer allocated */
-	if (status == MB_SUCCESS)
-		{
-		/* get buffer for writing */
-		buffer = (char *)*bufferptr;
-
-		/* insert the block header */
-		index = 0;
-		mb_put_binary_int(MB_YES, SWPLS_ID_TXER_OFFSET, &buffer[index]);
-		index += 4;
-		mb_put_binary_int(MB_YES, (*size - SWPLS_SIZE_BLOCKHEADER),
-			&buffer[index]); index += 4;
-
-		/* insert the data */
-		mb_put_binary_int(MB_YES, txer_offset->time_d, &buffer[index]);
-		index += 4;
-		mb_put_binary_int(MB_YES, txer_offset->microsec, &buffer[index]);
-		index += 4;
-		buffer[index] = txer_offset->channel; index++;
-		mb_put_binary_float(MB_YES, txer_offset->height, &buffer[index]);
-		index += 4;
-		mb_put_binary_float(MB_YES, txer_offset->forward, &buffer[index]);
-		index += 4;
-		mb_put_binary_float(MB_YES, txer_offset->starboard, &buffer[index]);
-		index += 4;
-		mb_put_binary_float(MB_YES, txer_offset->azimuth, &buffer[index]);
-		index += 4;
-		mb_put_binary_float(MB_YES, txer_offset->elevation, &buffer[index]);
-		index += 4;
-		mb_put_binary_float(MB_YES, txer_offset->pitch, &buffer[index]);
-		index += 4;
-		mb_put_binary_float(MB_YES, txer_offset->skew, &buffer[index]);
-		index += 4;
-		mb_put_binary_float(MB_YES, txer_offset->time, &buffer[index]);
-		index += 4;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		fprintf(stderr, "dbg2       error:      %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2       status:  %d\n", status);
-		}
-
-	/* return status */
-	return (status);
-}		/* swpls_wr_txer_offset */
-/*-------------------------------------------------------------------*/
-int swpls_wr_wl_offset(int verbose, int *bufferalloc, char **bufferptr,
-	void *store_ptr, int *size, int *error)
-{
-	char *function_name = "swpls_wr_wl_offset";
-	int status = MB_SUCCESS;
-	struct mbsys_swathplus_struct *store;
-	swpls_wl_offset *wl_offset;
-	char *buffer;
-	int index;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> called\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n");
-		fprintf(stderr, "dbg2       verbose:      %d\n", verbose);
-		fprintf(stderr, "dbg2       bufferalloc:  %d\n", *bufferalloc);
-		fprintf(stderr, "dbg2       bufferptr:    %p\n", (void *)bufferptr);
-		fprintf(stderr, "dbg2       store_ptr:    %p\n", (void *)store_ptr);
-		}
-
-	/* get pointer to raw data structure */
-	store = (struct mbsys_swathplus_struct *)store_ptr;
-	wl_offset = &(store->wl_offset);
-
-	/* print debug statements */
-	if (verbose >= 5)
-		{
-		fprintf(stderr, "\ndbg5  Values to be written in MBIO function <%s>\n",
-			function_name);
-		swpls_pr_wl_offset(verbose, stderr, wl_offset, error);
-		}
-
-	/* figure out size of output record */
-	*size = SWPLS_SIZE_BLOCKHEADER + SWPLS_SIZE_WL_OFFSET;
-
-	/* allocate memory to write record if necessary */
-	if (*bufferalloc < *size)
-		{
-		status = mb_reallocd(verbose, __FILE__, __LINE__, *size,
-			(void **)bufferptr, error);
-		if (status != MB_SUCCESS)
-			{
-			*bufferalloc = 0;
-			}
-		else
-			{
-			*bufferalloc = *size;
-			}
-		}
-
-	/* proceed to write if buffer allocated */
-	if (status == MB_SUCCESS)
-		{
-		/* get buffer for writing */
-		buffer = (char *)*bufferptr;
-
-		/* insert the block header */
-		index = 0;
-		mb_put_binary_int(MB_YES, SWPLS_ID_WL_OFFSET, &buffer[index]);
-		index += 4;
-		mb_put_binary_int(MB_YES, (*size - SWPLS_SIZE_BLOCKHEADER),
-			&buffer[index]); index += 4;
-
-		/* insert the data */
-		mb_put_binary_int(MB_YES, wl_offset->time_d, &buffer[index]);
-		index += 4;
-		mb_put_binary_int(MB_YES, wl_offset->microsec, &buffer[index]);
-		index += 4;
-		buffer[index] = wl_offset->channel; index++;
-		mb_put_binary_float(MB_YES, wl_offset->height, &buffer[index]);
-		index += 4;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		fprintf(stderr, "dbg2       error:      %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2       status:  %d\n", status);
-		}
-
-	/* return status */
-	return (status);
-}		/* swpls_wr_wl_offset */
-/*----------------------------------------------------------------------*/
-int swpls_pr_sxpheader(int verbose, FILE *fout, swpls_header *header,
-	int *error)
-{
-	char *function_name = "swpls_pr_sxpheader";
-	int status = MB_SUCCESS;
-	char starter[5];
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> called.\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n");
-		fprintf(stderr, "dbg2       verbose:      %d\n", verbose);
-		fprintf(stderr, "dbg2       header:       %p\n", (void *)header);
-		}
-
-	if (verbose > 0)
-		{
-		sprintf(starter, "dbg%d", MIN(verbose, 9));
-		}
-	else
-		{
-		strcpy(starter, "    ");
-		}
-
-	fprintf(fout, "\n%s  SWPLS_ID_SXP_HEADER_DATA [ID: 0x%X] %d bytes\n",
-		starter, SWPLS_ID_SXP_HEADER_DATA, SWPLS_SIZE_HEADER);
-	fprintf(fout, "%s        swver:  %d\n", starter, header->swver);
-	fprintf(fout, "%s        fmtver: %d\n", starter, header->fmtver);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		fprintf(stderr, "dbg2       error:      %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2       status:     %d\n", status);
-		}
-
-	/* return status */
-	return (status);
-}		/* swpls_pr_sxpheader */
-/*----------------------------------------------------------------------*/
-int swpls_pr_sxpping(int verbose, FILE *fout, swpls_sxpping *ping, int *error)
-{
-	char *function_name = "swpls_pr_sxpping";
-	int status = MB_SUCCESS;
-	swpls_point *points;
-	char starter[5];
-	int size;
-	time_t tm;
-	int i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> called.\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n");
-		fprintf(stderr, "dbg2       verbose:      %d\n", verbose);
-		fprintf(stderr, "dbg2       ping:         %p\n", (void *)ping);
-		}
-
-	if (verbose > 0)
-		{
-		sprintf(starter, "dbg%d", MIN(verbose, 9));
-		}
-	else
-		{
-		strcpy(starter, "    ");
-		}
-
-	size = SWPLS_SIZE_PROCESSED_PING2 + (ping->nosampsfile * SWPLS_SIZE_POINT2);
-	tm = (time_t)trunc(ping->time_d);
-
-	fprintf(fout, "\n%s  SWPLS_ID_PROCESSED_PING2 [ID: 0x%X] %d bytes\n",
-		starter, SWPLS_ID_PROCESSED_PING2, size);
-	fprintf(fout, "%s        linename:             %s\n", starter,
-		ping->linename);
-	fprintf(fout, "%s        pingnumber:           %d\n", starter,
-		ping->pingnumber);
-	fprintf(fout, "%s        time_d:               %lf :: %s", starter,
-		ping->time_d, asctime(gmtime(&tm)));
-	fprintf(fout, "%s        notxers:              %d\n", starter,
-		ping->notxers);
-	fprintf(fout, "%s        easting:              %lf\n", starter,
-		ping->easting);
-	fprintf(fout, "%s        northing:             %lf\n", starter,
-		ping->northing);
-	fprintf(fout, "%s        roll:                 %lf\n", starter, ping->roll);
-	fprintf(fout, "%s        pitch:                %lf\n", starter,
-		ping->pitch);
-	fprintf(fout, "%s        heading:              %lf\n", starter,
-		ping->heading);
-	fprintf(fout, "%s        height:               %lf\n", starter,
-		ping->height);
-	fprintf(fout, "%s        tide:                 %lf\n", starter, ping->tide);
-	fprintf(fout, "%s        sos:                  %lf\n", starter, ping->sos);
-	fprintf(fout, "%s        txno:                 %u\n", starter, ping->txno);
-	fprintf(fout, "%s        txstat:               %u\n", starter,
-		ping->txstat);
-	fprintf(fout, "%s        txpower:              %u\n", starter,
-		ping->txpower);
-	fprintf(fout, "%s        analoggain:           %u\n", starter,
-		ping->analoggain);
-	fprintf(fout, "%s        nostaves:             %u\n", starter,
-		ping->nostaves);
-	for (i = 0; i < SWPLS_MAX_TX_INFO; i++)
-		{
-		fprintf(fout, "%s        txinfo[%d]:            %u\n", starter, i,
-			ping->txinfo[i]);
-		}
-	fprintf(fout, "%s        freq:                 %u\n", starter, ping->freq);
-	fprintf(fout, "%s        frequency:            %lf\n", starter,
-		ping->frequency);
-	fprintf(fout, "%s        trnstime:             %d\n", starter,
-		ping->trnstime);
-	fprintf(fout, "%s        recvtime:             %d\n", starter,
-		ping->recvtime);
-	fprintf(fout, "%s        samprate:             %u\n", starter,
-		ping->samprate);
-	fprintf(fout, "%s        nosampsorig:          %d\n", starter,
-		ping->nosampsorig);
-	fprintf(fout, "%s        nosampsfile:          %d\n", starter,
-		ping->nosampsfile);
-	fprintf(fout, "%s        nosampslots:          %d\n", starter,
-		ping->nosampslots);
-	fprintf(fout, "%s        txer_e:               %lf\n", starter,
-		ping->txer_e);
-	fprintf(fout, "%s        txer_n:               %lf\n", starter,
-		ping->txer_n);
-	fprintf(fout, "%s        txer_height:          %lf\n", starter,
-		ping->txer_height);
-	fprintf(fout, "%s        txer_forward:         %lf\n", starter,
-		ping->txer_forward);
-	fprintf(fout, "%s        txer_starboard:       %lf\n", starter,
-		ping->txer_starboard);
-	fprintf(fout, "%s        txer_azimuth:         %lf\n", starter,
-		ping->txer_azimuth);
-	fprintf(fout, "%s        txer_elevation:       %lf\n", starter,
-		ping->txer_elevation);
-	fprintf(fout, "%s        txer_skew:            %lf\n", starter,
-		ping->txer_skew);
-	fprintf(fout, "%s        txer_time:            %lf\n", starter,
-		ping->txer_time);
-	fprintf(fout, "%s        txer_waterdepth:      %lf\n", starter,
-		ping->txer_waterdepth);
-	fprintf(fout, "%s        txer_pitch:           %lf\n", starter,
-		ping->txer_pitch);
-
-	points = ping->points;
-	for (i = 0; i < ping->nosampsfile; i++)
-		{
-		fprintf(fout, "%s        %4d %11.2lf %10.2lf %7.2f %5u %5u %u %5.2lf\n",
-			starter, points[i].sampnum, points[i].y, points[i].x,
-			points[i].z, points[i].amp, points[i].procamp, points[i].status,
-			points[i].tpu);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		fprintf(stderr, "dbg2       error:      %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2       status:     %d\n", status);
-		}
-
-	/* return status */
-	return (status);
-}		/* swpls_pr_sxpping */
-/*----------------------------------------------------------------------*/
-int swpls_pr_projection(int verbose, FILE *fout, swpls_projection *projection,
-	int *error)
-{
-	char *function_name = "swpls_pr_projection";
-	int status = MB_SUCCESS;
-	char starter[5];
-	time_t tm;
-	int size;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> called.\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n");
-		fprintf(stderr, "dbg2       verbose:      %d\n", verbose);
-		fprintf(stderr, "dbg2       projection:      %p\n", (void *)projection);
-		}
-
-	if (verbose > 0)
-		{
-		sprintf(starter, "dbg%d", MIN(verbose, 9));
-		}
-	else
-		{
-		strcpy(starter, "    ");
-		}
-
-	size = SWPLS_SIZE_PROJECTION + projection->nchars;
-	tm = (time_t)trunc(projection->time_d);
-	fprintf(fout, "\n%s  SWPLS_ID_PROJECTION [ID: 0x%X] %d bytes\n", starter,
-		SWPLS_ID_PROJECTION, size);
-	fprintf(fout, "%s        time_d:               %d :: %s", starter,
-		projection->time_d, asctime(gmtime(&tm)));
-	fprintf(fout, "%s        microsec:             %d\n", starter,
-		projection->microsec);
-	fprintf(fout, "%s        nchars:               %d\n", starter,
-		projection->nchars);
-	fprintf(fout, "%s        projection_id:        %s\n", starter,
-		projection->projection_id);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		fprintf(stderr, "dbg2       error:      %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2       status:     %d\n", status);
-		}
-
-	/* return status */
-	return (status);
-}		/* swpls_pr_projection */
-/*----------------------------------------------------------------------*/
-int swpls_pr_comment(int verbose, FILE *fout, swpls_comment *comment,
-	int *error)
-{
-	char *function_name = "swpls_pr_comment";
-	int status = MB_SUCCESS;
-	char starter[5];
-	time_t tm;
-	int size;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> called.\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n");
-		fprintf(stderr, "dbg2       verbose:      %d\n", verbose);
-		fprintf(stderr, "dbg2       comment:      %p\n", (void *)comment);
-		}
-
-	if (verbose > 0)
-		{
-		sprintf(starter, "dbg%d", MIN(verbose, 9));
-		}
-	else
-		{
-		strcpy(starter, "    ");
-		}
-
-	size = SWPLS_SIZE_COMMENT + comment->nchars;
-	tm = (time_t)trunc(comment->time_d);
-
-	fprintf(fout, "\n%s  SWPLS_ID_COMMENT [ID: 0x%X] %d bytes\n", starter,
-		SWPLS_ID_COMMENT, size);
-	fprintf(fout, "%s        time_d:               %d :: %s", starter,
-		comment->time_d, asctime(gmtime(&tm)));
-	fprintf(fout, "%s        microsec:             %d\n", starter,
-		comment->microsec);
-	fprintf(fout, "%s        nchars:               %d\n", starter,
-		comment->nchars);
-	fprintf(fout, "%s        message:              %s\n", starter,
-		comment->message);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		fprintf(stderr, "dbg2       error:      %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2       status:     %d\n", status);
-		}
-
-	/* return status */
-	return (status);
-}		/* swpls_pr_comment */
-/*----------------------------------------------------------------------*/
-int swpls_pr_sxiheader(int verbose, FILE *fout, swpls_header *header,
-	int *error)
-{
-	char *function_name = "swpls_pr_sxiheader";
-	int status = MB_SUCCESS;
-	char starter[5];
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> called.\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n");
-		fprintf(stderr, "dbg2       verbose:      %d\n", verbose);
-		fprintf(stderr, "dbg2       header:       %p\n", (void *)header);
-		}
-
-	if (verbose > 0)
-		{
-		sprintf(starter, "dbg%d", MIN(verbose, 9));
-		}
-	else
-		{
-		strcpy(starter, "    ");
-		}
-
-	fprintf(fout, "\n%s  SWPLS_ID_SXI_HEADER_DATA [ID: 0x%X] %d bytes\n",
-		starter, SWPLS_ID_SXI_HEADER_DATA, SWPLS_SIZE_HEADER);
-	fprintf(fout, "%s        swver:        %d\n", starter, header->swver);
-	fprintf(fout, "%s        fmtver:       %d\n", starter, header->fmtver);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		fprintf(stderr, "dbg2       error:      %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2       status:     %d\n", status);
-		}
-
-	/* return status */
-	return (status);
-}		/* swpls_pr_sxiheader */
-/*----------------------------------------------------------------------*/
-int swpls_pr_sxiping(int verbose, FILE *fout, swpls_sxiping *ping, int *error)
-{
-	char *function_name = "swpls_pr_sxiping";
-	int status = MB_SUCCESS;
-	char starter[5];
-	int size;
-	time_t tm;
-	int i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> called.\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n");
-		fprintf(stderr, "dbg2       verbose:      %d\n", verbose);
-		fprintf(stderr, "dbg2       ping:       %p\n", (void *)ping);
-		}
-
-	if (verbose > 0)
-		{
-		sprintf(starter, "dbg%d", MIN(verbose, 9));
-		}
-	else
-		{
-		strcpy(starter, "    ");
-		}
-
-	/* figure out size of output record */
-	size = SWPLS_SIZE_PARSED_PING + (ping->nosamps * SWPLS_SIZE_PARSED_POINT);
-	tm = (time_t)trunc(ping->time_d);
-
-	fprintf(fout, "\n%s  SWPLS_ID_SXI_PARSED_PING [ID: 0x%X] %d bytes\n",
-		starter, SWPLS_ID_PARSED_PING, size);
-	fprintf(fout, "%s        time_d:       %d :: %s", starter, ping->time_d, asctime(gmtime(&tm)));
-	fprintf(fout, "%s        microsec:     %d\n", starter, ping->microsec);
-	fprintf(fout, "%s        channel:      %u\n", starter, ping->channel);
-	fprintf(fout, "%s        pingnumber:   %lu\n", starter, ping->pingnumber);
-	fprintf(fout, "%s        frequency:    %f\n", starter, ping->frequency);
-	fprintf(fout, "%s        samp_period:  %f\n", starter, ping->samp_period);
-	fprintf(fout, "%s        nosamps:      %u\n", starter, ping->nosamps);
-	fprintf(fout, "%s        sos:          %f\n", starter, ping->sos);
-	fprintf(fout, "%s        txpulse:      %d\n", starter, ping->txpulse);
-	fprintf(fout, "%s        data_options: %d\n", starter, ping->data_options);
-	fprintf(fout, "%s        ping_state:   %u\n", starter, ping->ping_state);
-	fprintf(fout, "%s        max_count:    %u\n", starter, ping->max_count);
-	fprintf(fout, "%s        reserve1:     %u\n", starter, ping->reserve1);
-	for (i = 0; i < ping->nosamps; i++)
-		{
-		fprintf(fout,
-			"%s        sampnum: %4u angle: %6d amplitude: %5u quality: %u\n",
-			starter,
-			ping->sampnum[i], ping->angle[i], ping->amplitude[i],
-			ping->quality[i]);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		fprintf(stderr, "dbg2       error:      %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2       status:     %d\n", status);
-		}
-
-	/* return status */
-	return (status);
-}		/* swpls_pr_sxiping */
-/*----------------------------------------------------------------------*/
-int swpls_pr_attitude(int verbose, FILE *fout, swpls_attitude *attitude,
-	int *error)
-{
-	char *function_name = "swpls_pr_attitude";
-	int status = MB_SUCCESS;
-	char starter[5];
-	time_t tm;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> called.\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n");
-		fprintf(stderr, "dbg2       verbose:      %d\n", verbose);
-		fprintf(stderr, "dbg2       attitude:     %p\n", (void *)attitude);
-		}
-
-	if (verbose > 0)
-		{
-		sprintf(starter, "dbg%d", MIN(verbose, 9));
-		}
-	else
-		{
-		strcpy(starter, "    ");
-		}
-	tm = (time_t)trunc(attitude->time_d);
-
-	fprintf(fout, "\n%s  SWPLS_ID_PARSED_ATTITUDE [ID: 0x%X] %d bytes\n",
-		starter, SWPLS_ID_PARSED_ATTITUDE, SWPLS_SIZE_ATTITUDE);
-	fprintf(fout, "%s        time_d:       %d :: %s", starter, attitude->time_d, asctime(gmtime(&tm)));
-	fprintf(fout, "%s        microsec:     %d\n", starter, attitude->microsec);
-	fprintf(fout, "%s        channel:      %u\n", starter, attitude->channel);
-	fprintf(fout, "%s        roll:         %f\n", starter, attitude->roll);
-	fprintf(fout, "%s        pitch:        %f\n", starter, attitude->pitch);
-	fprintf(fout, "%s        heading:      %f\n", starter, attitude->heading);
-	fprintf(fout, "%s        height:       %f\n", starter, attitude->height);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		fprintf(stderr, "dbg2       error:      %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2       status:     %d\n", status);
-		}
-
-	/* return status */
-	return (status);
-}		/* swpls_pr_attitude */
-/*----------------------------------------------------------------------*/
-int swpls_pr_posll(int verbose, FILE *fout, swpls_posll *posll, int *error)
-{
-	char *function_name = "swpls_pr_posll";
-	int status = MB_SUCCESS;
-	char starter[5];
-	time_t tm;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> called.\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n");
-		fprintf(stderr, "dbg2       verbose:      %d\n", verbose);
-		fprintf(stderr, "dbg2       posll:        %p\n", (void *)posll);
-		}
-
-	if (verbose > 0)
-		{
-		sprintf(starter, "dbg%d", MIN(verbose, 9));
-		}
-	else
-		{
-		strcpy(starter, "    ");
-		}
-	tm = (time_t)trunc(posll->time_d);
-
-	fprintf(fout, "\n%s  SWPLS_ID_PARSED_POSITION_LL [ID: 0x%X] %d bytes\n",
-		starter, SWPLS_ID_PARSED_POSITION_LL, SWPLS_SIZE_POSITION_LL);
-	fprintf(fout, "%s        time_d:       %d :: %s", starter, posll->time_d, asctime(gmtime(&tm)));
-	fprintf(fout, "%s        microsec:     %d\n", starter, posll->microsec);
-	fprintf(fout, "%s        channel:      %u\n", starter, posll->channel);
-	fprintf(fout, "%s        latitude:     %lf\n", starter, posll->latitude);
-	fprintf(fout, "%s        longitude:    %lf\n", starter, posll->longitude);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		fprintf(stderr, "dbg2       error:      %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2       status:     %d\n", status);
-		}
-
-	/* return status */
-	return (status);
-}		/* swpls_pr_posll */
-/*----------------------------------------------------------------------*/
-int swpls_pr_posen(int verbose, FILE *fout, swpls_posen *posen, int *error)
-{
-	char *function_name = "swpls_pr_posen";
-	int status = MB_SUCCESS;
-	char starter[5];
-	time_t tm;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> called.\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n");
-		fprintf(stderr, "dbg2       verbose:      %d\n", verbose);
-		fprintf(stderr, "dbg2       posen:        %p\n", (void *)posen);
-		}
-
-	if (verbose > 0)
-		{
-		sprintf(starter, "dbg%d", MIN(verbose, 9));
-		}
-	else
-		{
-		strcpy(starter, "    ");
-		}
-
-	tm = (time_t)trunc(posen->time_d);
-
-	fprintf(fout, "\n%s  SWPLS_ID_PARSED_POSITION_EN [ID: 0x%X] %d bytes\n",
-		starter, SWPLS_ID_PARSED_POSITION_EN, SWPLS_SIZE_POSITION_EN);
-	fprintf(fout, "%s        time_d:       %d :: %s", starter, posen->time_d, asctime(gmtime(&tm)));
-	fprintf(fout, "%s        microsec:     %d\n", starter, posen->microsec);
-	fprintf(fout, "%s        channel:      %u\n", starter, posen->channel);
-	fprintf(fout, "%s        easting:      %lf\n", starter, posen->easting);
-	fprintf(fout, "%s        northing:     %lf\n", starter, posen->northing);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		fprintf(stderr, "dbg2       error:      %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2       status:     %d\n", status);
-		}
-
-	/* return status */
-	return (status);
-}		/* swpls_pr_posen */
-/*----------------------------------------------------------------------*/
-int swpls_pr_ssv(int verbose, FILE *fout, swpls_ssv *ssv, int *error)
-{
-	char *function_name = "swpls_pr_ssv";
-	int status = MB_SUCCESS;
-	char starter[5];
-	time_t tm;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> called.\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n");
-		fprintf(stderr, "dbg2       verbose:      %d\n", verbose);
-		fprintf(stderr, "dbg2       ssv:          %p\n", (void *)ssv);
-		}
-
-	if (verbose > 0)
-		{
-		sprintf(starter, "dbg%d", MIN(verbose, 9));
-		}
-	else
-		{
-		strcpy(starter, "    ");
-		}
-
-	tm = (time_t)trunc(ssv->time_d);
-
-	fprintf(fout, "\n%s  SWPLS_ID_PARSED_SSV [ID: 0x%X] %d bytes\n", starter,
-		SWPLS_ID_PARSED_SSV, SWPLS_SIZE_SSV);
-	fprintf(fout, "%s        time_d:       %d :: %s", starter, ssv->time_d, asctime(gmtime(&tm)));
-	fprintf(fout, "%s        microsec:     %d\n", starter, ssv->microsec);
-	fprintf(fout, "%s        channel:      %u\n", starter, ssv->channel);
-	fprintf(fout, "%s        ssv:          %f\n", starter, ssv->ssv);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		fprintf(stderr, "dbg2       error:      %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2       status:     %d\n", status);
-		}
-
-	/* return status */
-	return (status);
-}		/* swpls_pr_ssv */
-/*----------------------------------------------------------------------*/
-int swpls_pr_tide(int verbose, FILE *fout, swpls_tide *tide, int *error)
-{
-	char *function_name = "swpls_pr_tide";
-	int status = MB_SUCCESS;
-	char starter[5];
-	time_t tm;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> called.\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n");
-		fprintf(stderr, "dbg2       verbose:      %d\n", verbose);
-		fprintf(stderr, "dbg2       tide:         %p\n", (void *)tide);
-		}
-
-	if (verbose > 0)
-		{
-		sprintf(starter, "dbg%d", MIN(verbose, 9));
-		}
-	else
-		{
-		strcpy(starter, "    ");
-		}
-
-	tm = (time_t)trunc(tide->time_d);
-
-	fprintf(fout, "\n%s  SWPLS_ID_SXI_PARSED_TIDE [ID: 0x%X] %d bytes\n",
-		starter, SWPLS_ID_PARSED_TIDE, SWPLS_SIZE_TIDE);
-	fprintf(fout, "%s        time_d:       %d :: %s", starter, tide->time_d, asctime(gmtime(&tm)));
-	fprintf(fout, "%s        microsec:     %d\n", starter, tide->microsec);
-	fprintf(fout, "%s        channel:      %u\n", starter, tide->channel);
-	fprintf(fout, "%s        tide:         %f\n", starter, tide->tide);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		fprintf(stderr, "dbg2       error:      %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2       status:     %d\n", status);
-		}
-
-	/* return status */
-	return (status);
-}		/* swpls_pr_tide */
-/*----------------------------------------------------------------------*/
-int swpls_pr_echosounder(int verbose, FILE *fout,
-	swpls_echosounder *echosounder, int *error)
-{
-	char *function_name = "swpls_pr_echosounder";
-	int status = MB_SUCCESS;
-	char starter[5];
-	time_t tm;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> called.\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n");
-		fprintf(stderr, "dbg2       verbose:      %d\n", verbose);
-		fprintf(stderr, "dbg2       echosounder:  %p\n", (void *)echosounder);
-		}
-
-	if (verbose > 0)
-		{
-		sprintf(starter, "dbg%d", MIN(verbose, 9));
-		}
-	else
-		{
-		strcpy(starter, "    ");
-		}
-
-	tm = (time_t)trunc(echosounder->time_d);
-
-	fprintf(fout, "\n%s  SWPLS_ID_PARSED_ECHOSOUNDER [ID: 0x%X] %d bytes\n",
-		starter, SWPLS_ID_PARSED_ECHOSOUNDER, SWPLS_SIZE_ECHOSOUNDER);
-	fprintf(fout, "%s        time_d:       %d :: %s", starter, echosounder->time_d, asctime(gmtime(&tm)));
-	fprintf(fout, "%s        microsec:     %d\n", starter,
-		echosounder->microsec);
-	fprintf(fout, "%s        channel:      %u\n", starter,
-		echosounder->channel);
-	fprintf(fout, "%s        altitude:     %f\n", starter,
-		echosounder->altitude);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		fprintf(stderr, "dbg2       error:      %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2       status:     %d\n", status);
-		}
-
-	/* return status */
-	return (status);
-}		/* swpls_pr_echosounder */
-/*----------------------------------------------------------------------*/
-int swpls_pr_agds(int verbose, FILE *fout, swpls_agds *agds, int *error)
-{
-	char *function_name = "swpls_pr_agds";
-	int status = MB_SUCCESS;
-	char starter[5];
-	time_t tm;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> called.\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n");
-		fprintf(stderr, "dbg2       verbose:      %d\n", verbose);
-		fprintf(stderr, "dbg2       agds:  %p\n", (void *)agds);
-		}
-
-	if (verbose > 0)
-		{
-		sprintf(starter, "dbg%d", MIN(verbose, 9));
-		}
-	else
-		{
-		strcpy(starter, "    ");
-		}
-
-	tm = (time_t)trunc(agds->time_d);
-
-	fprintf(fout, "\n%s  SWPLS_ID_PARSED_AGDS [ID: 0x%X] %d bytes\n", starter,
-		SWPLS_ID_PARSED_AGDS, SWPLS_SIZE_AGDS);
-	fprintf(fout, "%s        time_d:       %d :: %s", starter, agds->time_d, asctime(gmtime(&tm)));
-	fprintf(fout, "%s        microsec:     %d\n", starter, agds->microsec);
-	fprintf(fout, "%s        channel:      %u\n", starter, agds->channel);
-	fprintf(fout, "%s        hardness:     %f\n", starter, agds->hardness);
-	fprintf(fout, "%s        roughness:    %f\n", starter, agds->roughness);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		fprintf(stderr, "dbg2       error:      %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2       status:     %d\n", status);
-		}
-
-	/* return status */
-	return (status);
-}		/* swpls_pr_agds */
-/*----------------------------------------------------------------------*/
-int swpls_pr_pos_offset(int verbose, FILE *fout, swpls_pos_offset *pos_offset,
-	int *error)
-{
-	char *function_name = "swpls_pr_pos_offset";
-	int status = MB_SUCCESS;
-	char starter[5];
-	time_t tm;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> called.\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n");
-		fprintf(stderr, "dbg2       verbose:      %d\n", verbose);
-		fprintf(stderr, "dbg2       pos_offset:  %p\n", (void *)pos_offset);
-		}
-
-	if (verbose > 0)
-		{
-		sprintf(starter, "dbg%d", MIN(verbose, 9));
-		}
-	else
-		{
-		strcpy(starter, "    ");
-		}
-
-	tm = (time_t)trunc(pos_offset->time_d);
-
-	fprintf(fout, "\n%s  SWPLS_ID_POS_OFFSET [ID: 0x%X] %d bytes\n", starter,
-		SWPLS_ID_POS_OFFSET, SWPLS_SIZE_POS_OFFSET);
-	fprintf(fout, "%s        time_d:       %d :: %s", starter, pos_offset->time_d, asctime(gmtime(&tm)));
-	fprintf(fout, "%s        microsec:     %d\n", starter,
-		pos_offset->microsec);
-	fprintf(fout, "%s        channel:      %u\n", starter, pos_offset->channel);
-	fprintf(fout, "%s        height:       %f\n", starter, pos_offset->height);
-	fprintf(fout, "%s        forward:      %f\n", starter, pos_offset->forward);
-	fprintf(fout, "%s        starboard:    %f\n", starter,
-		pos_offset->starboard);
-	fprintf(fout, "%s        time:         %f\n", starter, pos_offset->time);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		fprintf(stderr, "dbg2       error:      %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2       status:     %d\n", status);
-		}
-
-	/* return status */
-	return (status);
-}		/* swpls_pr_pos_offset */
-/*----------------------------------------------------------------------*/
-int swpls_pr_imu_offset(int verbose, FILE *fout, swpls_imu_offset *imu_offset,
-	int *error)
-{
-	char *function_name = "swpls_pr_imu_offset";
-	int status = MB_SUCCESS;
-	char starter[5];
-	time_t tm;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> called.\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n");
-		fprintf(stderr, "dbg2       verbose:      %d\n", verbose);
-		fprintf(stderr, "dbg2       imu_offset:  %p\n", (void *)imu_offset);
-		}
-
-	if (verbose > 0)
-		{
-		sprintf(starter, "dbg%d", MIN(verbose, 9));
-		}
-	else
-		{
-		strcpy(starter, "    ");
-		}
-
-	tm = (time_t)trunc(imu_offset->time_d);
-
-	fprintf(fout, "\n%s  SWPLS_ID_IMU_OFFSET [ID: 0x%X] %d bytes\n", starter,
-		SWPLS_ID_IMU_OFFSET, SWPLS_SIZE_IMU_OFFSET);
-	fprintf(fout, "%s        time_d:       %d :: %s", starter, imu_offset->time_d, asctime(gmtime(&tm)));
-	fprintf(fout, "%s        microsec:     %d\n", starter,
-		imu_offset->microsec);
-	fprintf(fout, "%s        channel:      %u\n", starter, imu_offset->channel);
-	fprintf(fout, "%s        height:       %f\n", starter, imu_offset->height);
-	fprintf(fout, "%s        forward:      %f\n", starter, imu_offset->forward);
-	fprintf(fout, "%s        starboard:    %f\n", starter,
-		imu_offset->starboard);
-	fprintf(fout, "%s        time:         %f\n", starter, imu_offset->time);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		fprintf(stderr, "dbg2       error:      %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2       status:     %d\n", status);
-		}
-
-	/* return status */
-	return (status);
-}		/* swpls_pr_imu_offset */
-/*----------------------------------------------------------------------*/
-int swpls_pr_txer_offset(int verbose, FILE *fout,
-	swpls_txer_offset *txer_offset, int *error)
-{
-	char *function_name = "swpls_pr_txer_offset";
-	int status = MB_SUCCESS;
-	char starter[5];
-	time_t tm;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> called.\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n");
-		fprintf(stderr, "dbg2       verbose:      %d\n", verbose);
-		fprintf(stderr, "dbg2       txer_offset:  %p\n", (void *)txer_offset);
-		}
-
-	if (verbose > 0)
-		{
-		sprintf(starter, "dbg%d", MIN(verbose, 9));
-		}
-	else
-		{
-		strcpy(starter, "    ");
-		}
-
-	tm = (time_t)trunc(txer_offset->time_d);
-
-	fprintf(fout, "\n%s  SWPLS_ID_TXER_OFFSET [ID: 0x%X] %d bytes\n", starter,
-		SWPLS_ID_TXER_OFFSET, SWPLS_SIZE_TXER_OFFSET);
-	fprintf(fout, "%s        time_d:       %d :: %s", starter, txer_offset->time_d, asctime(gmtime(&tm)));
-	fprintf(fout, "%s        microsec:     %d\n", starter,
-		txer_offset->microsec);
-	fprintf(fout, "%s        channel:      %u\n", starter,
-		txer_offset->channel);
-	fprintf(fout, "%s        height:       %f\n", starter, txer_offset->height);
-	fprintf(fout, "%s        forward:      %f\n", starter,
-		txer_offset->forward);
-	fprintf(fout, "%s        starboard:    %f\n", starter,
-		txer_offset->starboard);
-	fprintf(fout, "%s        azimuth:      %f\n", starter,
-		txer_offset->azimuth);
-	fprintf(fout, "%s        elevation:    %f\n", starter,
-		txer_offset->elevation);
-	fprintf(fout, "%s        pitch:        %f\n", starter, txer_offset->pitch);
-	fprintf(fout, "%s        skew:         %f\n", starter, txer_offset->skew);
-	fprintf(fout, "%s        time:         %f\n", starter, txer_offset->time);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		fprintf(stderr, "dbg2       error:      %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2       status:     %d\n", status);
-		}
-
-	/* return status */
-	return (status);
-}		/* swpls_pr_txer_offset */
-/*----------------------------------------------------------------------*/
-int swpls_pr_wl_offset(int verbose, FILE *fout, swpls_wl_offset *wl_offset,
-	int *error)
-{
-	char *function_name = "swpls_pr_wl_offset";
-	int status = MB_SUCCESS;
-	char starter[5];
-	time_t tm;
-
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> called.\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n");
-		fprintf(stderr, "dbg2       verbose:      %d\n", verbose);
-		fprintf(stderr, "dbg2       wl_offset:  %p\n", (void *)wl_offset);
-		}
-
-	if (verbose > 0)
-		{
-		sprintf(starter, "dbg%d", MIN(verbose, 9));
-		}
-	else
-		{
-		strcpy(starter, "    ");
-		}
-
-	tm = (time_t)trunc(wl_offset->time_d);
-
-	fprintf(fout, "\n%s  SWPLS_ID_WL_OFFSET [ID: 0x%X] %d bytes\n", starter,
-		SWPLS_ID_WL_OFFSET, SWPLS_SIZE_WL_OFFSET);
-	fprintf(fout, "%s        time_d:       %d :: %s", starter, wl_offset->time_d, asctime(gmtime(&tm)));
-	fprintf(fout, "%s        microsec:     %d\n", starter, wl_offset->microsec);
-	fprintf(fout, "%s        channel:      %u\n", starter, wl_offset->channel);
-	fprintf(fout, "%s        height:       %f\n", starter, wl_offset->height);
-
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		fprintf(stderr, "dbg2       error:      %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2       status:     %d\n", status);
-		}
-
-	return (status);
-}		/* swpls_pr_wl_offset */
-/* Get heave value from SXP Processed ping
- *
- * sxp_ping - SWATHplus processed ping
- * heave - heave component of ping
- */
-static int get_sxp_heave(int verbose, swpls_sxpping *sxp_ping, double *heave,
-	int *error)
-{
-	char *function_name = "get_sxp_heave";
-	int status = MB_SUCCESS;
-	swpls_vector txoffset;
-	swpls_matrix vtow;
-
-	*error = MB_ERROR_NO_ERROR;
-
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> called.\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n");
-		fprintf(stderr, "dbg2       verbose:      %d\n", verbose);
-		fprintf(stderr, "dbg2       sxp_ping:    %p\n", (void *)sxp_ping);
-		}
-
-	/* crp to txer lever arms (body coordinate system) */
-	txoffset.x = sxp_ping->txer_starboard;
-	txoffset.y = -sxp_ping->txer_height;
-	txoffset.z = sxp_ping->txer_forward;
-
-	/* transform transducer lever arms from body to inertial system */
-	swpls_init_transform(verbose, &vtow, error);
-	swpls_concat_rotate_z(verbose, &vtow, +(-sxp_ping->roll) * DTR, error);
-	swpls_concat_rotate_x(verbose, &vtow, +(-sxp_ping->pitch) * DTR, error);
-	swpls_concat_rotate_y(verbose, &vtow, +sxp_ping->heading * DTR, error);
-	swpls_transform(verbose, &vtow, &txoffset, error);
-
-	*heave = sxp_ping->height - (-txoffset.y);
-
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		fprintf(stderr, "dbg2       height:     %f\n", sxp_ping->height);
-		fprintf(stderr, "dbg2       error:      %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2       status:     %d\n", status);
-		}
-
-	return (status);
-} /* get_sxp_heave */
-/* Set SXP Processed ping height value from heave
- *
- * heave - heave calculated by MB System
- * sxp_ping - SWATHplus processed ping
- */
-static int set_sxp_height(int verbose, double heave, swpls_sxpping *sxp_ping,
-	int *error)
-{
-	char *function_name = "set_sxp_height";
-	int status = MB_SUCCESS;
-	swpls_vector txoffset;
-	swpls_matrix vtow;
-
-	*error = MB_ERROR_NO_ERROR;
-
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> called.\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n");
-		fprintf(stderr, "dbg2       verbose:      %d\n", verbose);
-		fprintf(stderr, "dbg2       heave:        %f\n", heave);
-		}
-
-	/* crp to txer lever arms (body coordinate system) */
-	txoffset.x = sxp_ping->txer_starboard;
-	txoffset.y = -sxp_ping->txer_height;
-	txoffset.z = sxp_ping->txer_forward;
-
-	/* transform transducer lever arms from body to inertial system */
-	swpls_init_transform(verbose, &vtow, error);
-	swpls_concat_rotate_z(verbose, &vtow, +(-sxp_ping->roll) * DTR, error);
-	swpls_concat_rotate_x(verbose, &vtow, +(-sxp_ping->pitch) * DTR, error);
-	swpls_concat_rotate_y(verbose, &vtow, +sxp_ping->heading * DTR, error);
-	swpls_transform(verbose, &vtow, &txoffset, error);
-
-	sxp_ping->height = heave + (-txoffset.y);
-
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		fprintf(stderr, "dbg2       sxp_ping->height: %f\n", sxp_ping->height);
-		fprintf(stderr, "dbg2       error:            %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2       status:     %d\n", status);
-		}
-
-	return (status);
-} /* set_sxp_height */
-/*********************************************************************
-
-   Following 3D Math algorithms are based on the books:
-
-   Dunn, F. and Parberry, I. (2002) 3D Math Primer for Graphics and
-   Game Development. Wordware, Sudbury, MA. 428 pp.
-
-   Mak, Ronald (2003) The Java Programmer's Guide to Numerical Computing.
-   Prentice Hall PTR, Upper Saddle River, NJ
-
-   Axis are different from MB System defaults as follows:
-
-   x - positive to starboard
-   y - positive up
-   z - positive forward
-
-   rotation about x axis is positive nose down (pitch)
-   rotation about y axis is positive nose right (heading)
-   rotation about z axis is positive starboard (up)
-
-   All angles in radians, all distances use common units (meters)
-
-   The entire library is stack allocated. No need to free memory.
-
-   Usage:
-
-   1. Start a transformation by calling swpls_init_transform on an swpls_matrix
-   2. Appy translations and rotations to the transformation matrix in the order
-     you want
-   3. Create a point or set of points you want to transform as swpls_vectors
-   4. Finally, use swpls_transform to do the coordinate transformation
-
-*********************************************************************/
-
-/* Initialize a 4x3 transformation matrix
- *
- * m - transformation matrix to (re)initialize
- */
-int swpls_init_transform(int verbose, swpls_matrix *m, int *error)
-{
-	char *function_name = "swpls_init_transform";
-	int status = MB_SUCCESS;
-
-	*error = MB_ERROR_NO_ERROR;
-
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> called.\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n");
-		fprintf(stderr, "dbg2       verbose:      %d\n", verbose);
-		fprintf(stderr, "dbg2       m:            %p\n", (void *)m);
-		}
-
-	status = set_identity(verbose, m, error);
-
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		fprintf(stderr, "dbg2       error:      %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2       status:     %d\n", status);
-		}
-
-	return (status);
-}		/* swpls_init_transform */
-/* Apply a translation action to the transformation matrix
- *
- * dx - translate along x-axis (positive to right)
- * dy - translate along y-axis (positive up)
- * dz - translate along z-axis (positive forward)
- */
-int swpls_concat_translate(int verbose, swpls_matrix *m, double dx, double dy,
-	double dz, int *error)
-{
-	char *function_name = "swpls_concat_translation";
-	int status = MB_SUCCESS;
-	swpls_matrix translate;
-
-	*error = MB_ERROR_NO_ERROR;
-
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> called.\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n");
-		fprintf(stderr, "dbg2       verbose:      %d\n", verbose);
-		fprintf(stderr, "dbg2       m:            %p\n", (void *)m);
-		fprintf(stderr, "dbg2       dx:           %f.3\n", dx);
-		fprintf(stderr, "dbg2       dy:           %f.3\n", dy);
-		fprintf(stderr, "dbg2       dz:           %f.3\n", dz);
-		}
-
-	status = set_identity(verbose, &translate, error);
-	if (status == MB_SUCCESS)
-		{
-		translate.tx = dx;
-		translate.ty = dy;
-		translate.tz = dz;
-		}
-
-	if (status == MB_SUCCESS)
-		{
-		status = concat_transform(verbose, m, &translate, error);
-		}
-
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		fprintf(stderr, "dbg2       error:      %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2       status:     %d\n", status);
-		}
-
-	return (status);
-}		/* swpls_concat_translation */
-/* Apply a rotation about the x-axis to the transformation matrix
- *
- * pitch - angle of declination in radians (positive nose down)
- */
-int swpls_concat_rotate_x(int verbose, swpls_matrix *m, double pitch,
-	int *error)
-{
-	char *function_name = "swpls_concat_rotate_x";
-	int status = MB_SUCCESS;
-	double sinp, cosp;
-	swpls_matrix rotate;
-
-	*error = MB_ERROR_NO_ERROR;
-
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> called.\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n");
-		fprintf(stderr, "dbg2       verbose:      %d\n", verbose);
-		fprintf(stderr, "dbg2       m:            %p\n", (void *)m);
-		fprintf(stderr, "ddb2       pitch:        %f\n", pitch);
-		}
-
-	sinp = sin(pitch);
-	cosp = cos(pitch);
-
-	status = set_identity(verbose, &rotate, error);
-	if (status == MB_SUCCESS)
-		{
-		rotate.m22 = cosp;
-		rotate.m23 = sinp;
-		rotate.m32 = -sinp;
-		rotate.m33 = cosp;
-		concat_transform(verbose, m, &rotate, error);
-		}
-
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		fprintf(stderr, "dbg2       error:      %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2       status:     %d\n", status);
-		}
-
-	return (status);
-}		/* swpls_concat_rotate_x */
-/* Apply a roation about the y-axis to the transformation matrix
- *
- * heading - angle of heading in radians (positive to right)
- */
-int swpls_concat_rotate_y(int verbose, swpls_matrix *m, double heading,
-	int *error)
-{
-	char *function_name = "swpls_concat_rotate_y";
-	int status = MB_SUCCESS;
-	double sint, cost;
-	swpls_matrix rotate;
-
-	*error = MB_ERROR_NO_ERROR;
-
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> called.\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n");
-		fprintf(stderr, "dbg2       verbose:      %d\n", verbose);
-		fprintf(stderr, "dbg2       m:            %p\n", (void *)m);
-		fprintf(stderr, "dbg2       heading:      %f\n", heading);
-		}
-
-	sint = sin(heading);
-	cost = cos(heading);
-
-	status = set_identity(verbose, &rotate, error);
-	if (status == MB_SUCCESS)
-		{
-		rotate.m11 = cost;
-		rotate.m13 = -sint;
-		rotate.m31 = sint;
-		rotate.m33 = cost;
-		status = concat_transform(verbose, m, &rotate, error);
-		}
-
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		fprintf(stderr, "dbg2       error:      %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2       status:     %d\n", status);
-		}
-
-	return (status);
-}		/* swpls_concat_rotate_y */
-/* Apply rotation about the z-axis to the transformtion matrix
- *
- * bank - angle of bank in radians (positive starboard up)
- */
-int swpls_concat_rotate_z(int verbose, swpls_matrix *m, double bank, int *error)
-{
-	char *function_name = "swpls_concat_rotate_z";
-	int status = MB_SUCCESS;
-	double sint, cost;
-	swpls_matrix rotate;
-
-	*error = MB_ERROR_NO_ERROR;
-
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> called.\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n");
-		fprintf(stderr, "dbg2       verbose:      %d\n", verbose);
-		fprintf(stderr, "dbg2       m:            %p\n", (void *)m);
-		fprintf(stderr, "dbg2       bank:         %f\n", bank);
-		}
-
-	sint = sin(bank);
-	cost = cos(bank);
-
-	status = set_identity(verbose, &rotate, error);
-	if (status == MB_SUCCESS)
-		{
-		rotate.m11 = cost;
-		rotate.m12 = sint;
-		rotate.m21 = -sint;
-		rotate.m22 = cost;
-		status = concat_transform(verbose, m, &rotate, error);
-		}
-
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		fprintf(stderr, "dbg2       error:      %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2       status:     %d\n", status);
-		}
-
-	return (status);
-}		/* swpls_concat_rotate_z */
-/* Apply the transformations defined in m to vector p
- *
- * m - transformation matrix
- * p - vector to modify
- */
-int swpls_transform(int verbose, const swpls_matrix *m, swpls_vector *p,
-	int *error)
-{
-	char *function_name = "swpls_transform";
-	int status = MB_SUCCESS;
-	double x, y, z;
-
-	*error = MB_ERROR_NO_ERROR;
-
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> called.\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n");
-		fprintf(stderr, "dbg2       verbose:      %d\n", verbose);
-		fprintf(stderr, "dbg2       m:            %p\n", (void *)m);
-		fprintf(stderr, "dbg2       p:            %p\n", (void *)p);
-		fprintf(stderr, "dbg2       p->x:         %f\n", p->x);
-		fprintf(stderr, "dbg2       p->y:         %f\n", p->y);
-		fprintf(stderr, "dbg2       p->z:         %f\n", p->z);
-		}
-
-	x = p->x * m->m11 + p->y * m->m21 + p->z * m->m31 + m->tx;
-	y = p->x * m->m12 + p->y * m->m22 + p->z * m->m32 + m->ty;
-	z = p->x * m->m13 + p->y * m->m23 + p->z * m->m33 + m->tz;
-
-	p->x = x;
-	p->y = y;
-	p->z = z;
-
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		fprintf(stderr, "dbg2       error:      %d\n", *error);
-		fprintf(stderr, "dbg2       p->x:       %f\n", p->x);
-		fprintf(stderr, "dbg2       p->y:       %f\n", p->y);
-		fprintf(stderr, "dbg2       p->z:       %f\n", p->z);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2       status:     %d\n", status);
-		}
-
-	return (status);
-}		/* swpls_transform */
-/* Setup a quaternion to perform an object->inertial rotation
- *
- * orientation - the orientation in Euler angle format
- * q - output quaternion
- */
-int swpls_angles_to_quat(int verbose, const swpls_angles *orientation,
-	swpls_quaternion *q, int *error)
-{
-	char *function_name = "swpls_angles_to_quat";
-	int status = MB_SUCCESS;
-	double sp, sb, sh;
-	double cp, cb, ch;
-
-	*error = MB_ERROR_NO_ERROR;
-
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> called.\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n");
-		fprintf(stderr, "dbg2       verbose:      %d\n", verbose);
-		fprintf(stderr, "dbg2       orientation:  %p\n", (void *)orientation);
-		fprintf(stderr, "dbg2       q:            %p\n", (void *)q);
-		}
-
-	sp = sin(0.5 * orientation->pitch);
-	cp = cos(0.5 * orientation->pitch);
-	sb = sin(0.5 * orientation->bank);
-	cb = cos(0.5 * orientation->bank);
-	sh = sin(0.5 * orientation->heading);
-	ch = cos(0.5 * orientation->heading);
-
-	q->w = ch * cp * cb + sh * sp * sb;
-	q->x = ch * sp * cb + sh * cp * sb;
-	q->y = -ch * sp * sb + sh * cp * cb;
-	q->z = -sh * sp * cb + ch * cp * sb;
-
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		fprintf(stderr, "dbg2       error:      %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2       status:     %d\n", status);
-		}
-
-	return (status);
-}		/* swpls_angles_to_quat */
-/* Setup the Euler angles, given an object -> inertial rotation
- * quaternion
- *
- * q - object->inertial quaternion
- * orientation - output orienation in Euler angle format
- */
-int swpls_quat_to_angles(int verbose, const swpls_quaternion *q,
-	swpls_angles *orientation, int *error)
-{
-	char *function_name = "swpls_quat_to_angles";
-	int status = MB_SUCCESS;
-	double sp;
-
-	*error = MB_ERROR_NO_ERROR;
-
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> called.\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n");
-		fprintf(stderr, "dbg2       verbose:      %d\n", verbose);
-		fprintf(stderr, "dbg2       q:            %p\n", (void *)q);
-		fprintf(stderr, "dbg2       orientation:  %p\n", (void *)orientation);
-		}
-
-	sp = -2.0 * (q->y * q->z - q->w * q->x);
-
-	if (fabs(sp) > 0.9999)
-		{
-		orientation->pitch = kPiOver2 * sp;
-		orientation->heading = atan2(-q->x * q->z + q->w * q->y,
-			0.5 - q->y * q->y - q->z * q->z);
-		orientation->bank = 0.0;
-		}
-	else
-		{
-		orientation->pitch = asin(sp);
-		orientation->heading = atan2(q->x * q->z + q->w * q->y,
-			0.5 - q->x * q->x - q->y * q->y);
-		orientation->bank = atan2(q->x * q->y + q->w * q->z,
-			0.5 - q->x * q->x - q->z * q->z);
-		}
-
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		fprintf(stderr, "dbg2       error:      %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2       status:     %d\n", status);
-		}
-
-	return (status);
-}		/* swpls_quat_to_angles */
-/* Spherical linear interpolation
- *
- * q0 - starting orientation as an object->inertial quaternion
- * q1 - ending orientation as an object->inertial quaternion
- * t - interpolation fraction ranging from 0 to 1 (corresponging to q0 and
- * q1, respectively)
- * q - iterpolated orientation quaternion coresponding to t
- */
-int swpls_slerp(int verbose, const swpls_quaternion *q0,
-	const swpls_quaternion *q1, double t, swpls_quaternion *q,
-	int *error)
-{
-	char *function_name = "swpls_slerp";
-	int status = MB_SUCCESS;
-	double q1w, q1x, q1y, q1z;
-	double k0, k1;
-	double omega, cosOmega, sinOmega, oneOverSinOmega;
-
-	*error = MB_ERROR_NO_ERROR;
-
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> called.\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n");
-		fprintf(stderr, "dbg2       verbose:      %d\n", verbose);
-		fprintf(stderr, "dbg2       q0:           %p\n", (void *)q0);
-		fprintf(stderr, "dbg2       q1:           %p\n", (void *)q1);
-		fprintf(stderr, "dbg2       t:            %f\n", t);
-		fprintf(stderr, "dbg2       q:            %p\n", (void *)q);
-		}
-
-	/* Check for out of range parameter and return edge points if so */
-	if (t <= 0.0)
-		{
-		*q = *q0;
-		}
-	else if (t >= 1.0)
-		{
-		*q = *q1;
-		}
-	else
-		{
-		/* Compute "cosine of angle between quaternions" using dot product
-		 */
-		cosOmega = q0->w * q1->w + q0->x * q1->x + q0->y * q1->y + q0->z *
-			q1->z;
-
-		/* Chose q or -q to rotate using the acute angle */
-		q1w = q1->w;
-		q1x = q1->x;
-		q1y = q1->y;
-		q1z = q1->z;
-		if (cosOmega < 0.0)
-			{
-			q1w = -q1w;
-			q1x = -q1x;
-			q1y = -q1y;
-			q1z = -q1z;
-			cosOmega = -cosOmega;
-			}
-
-		/* We should have two unit quaternions, so dot should be <= 1.0
-		   assert(cosOmega < 1.1); */
-
-		/* Compute interpolation fraction */
-		if (cosOmega > 0.9999)
-			{
-			/* very close - just use linear interpolation */
-			k0 = 1.0 - t;
-			k1 = t;
-			}
-		else
-			{
-			sinOmega = sqrt(1.0 - cosOmega * cosOmega);
-			omega = atan2(sinOmega, cosOmega);
-			oneOverSinOmega = 1.0 / sinOmega;
-			k0 = sin((1.0 - t) * omega) * oneOverSinOmega;
-			k1 = sin(t * omega) * oneOverSinOmega;
-			}
-
-		/* Interpolate */
-		q->x = k0 * q0->x + k1 * q1x;
-		q->y = k0 * q0->y + k1 * q1y;
-		q->z = k0 * q0->z + k1 * q1z;
-		q->w = k0 * q0->w + k1 * q1w;
-		}
-
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		fprintf(stderr, "dbg2       error:      %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2       status:     %d\n", status);
-		}
-
-	return (status);
-}		/* swpls_slerp */
-/* wrap an angle in range -pi ... pi by adding the correct multiple of
- * 2pi
- *
- * theta angle to wrap (radians)
- */
-static double wrap_pi(double theta)
-{
-	theta += kPi;
-	theta -= floor(theta * k1Over2Pi) * k2Pi;
-	theta -= kPi;
-
-	return (theta);
-}
-/* set/reset an swpls_matrix back to the identity matrix
- *
- * m - transformation matrix to reset
- */
-static int set_identity(int verbose, swpls_matrix *m, int *error)
-{
-	char *function_name = "set_identity";
-	int status = MB_SUCCESS;
-
-	*error = MB_ERROR_NO_ERROR;
-
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> called.\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n");
-		fprintf(stderr, "dbg2       verbose:      %d\n", verbose);
-		fprintf(stderr, "dbg2       m:            %p\n", (void *)m);
-		}
-
-	/* rotation matrix */
-	m->m11 = 1.0; m->m12 = 0.0; m->m13 = 0.0;
-	m->m21 = 0.0; m->m22 = 1.0; m->m23 = 0.0;
-	m->m31 = 0.0; m->m32 = 0.0; m->m33 = 1.0;
-
-	/* translation vector */
-	m->tx = 0.0; m->ty = 0.0; m->tz = 0.0;
-
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		fprintf(stderr, "dbg2       error:      %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2       status:     %d\n", status);
-		}
-
-	return (status);
-}		/* set_identity */
-/* concatinates a transformation matrix b onto an existing transformation
- * matrix a
- *
- * a - transformation matrix a
- * b - transformation matrix b
- */
-static int concat_transform(int verbose, swpls_matrix *a, swpls_matrix *b,
-	int *error)
-{
-	char *function_name = "concat_transform";
-	int status = MB_SUCCESS;
-	swpls_matrix r;
-
-	*error = MB_ERROR_NO_ERROR;
-
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> called.\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n");
-		fprintf(stderr, "dbg2       verbose:      %d\n", verbose);
-		fprintf(stderr, "dbg2       a:            %p\n", (void *)a);
-		fprintf(stderr, "dbg2       b:            %p\n", (void *)b);
-		}
-
-	/* rotation matrix */
-	r.m11 = a->m11 * b->m11 + a->m12 * b->m21 + a->m13 * b->m31;
-	r.m12 = a->m11 * b->m12 + a->m12 * b->m22 + a->m13 * b->m32;
-	r.m13 = a->m11 * b->m13 + a->m12 * b->m23 + a->m13 * b->m33;
-
-	r.m21 = a->m21 * b->m11 + a->m22 * b->m21 + a->m23 * b->m31;
-	r.m22 = a->m21 * b->m12 + a->m22 * b->m22 + a->m23 * b->m32;
-	r.m23 = a->m21 * b->m13 + a->m22 * b->m23 + a->m23 * b->m33;
-
-	r.m31 = a->m31 * b->m11 + a->m32 * b->m21 + a->m33 * b->m31;
-	r.m32 = a->m31 * b->m12 + a->m32 * b->m22 + a->m33 * b->m32;
-	r.m33 = a->m31 * b->m13 + a->m32 * b->m23 + a->m33 * b->m33;
-
-	/* translation vector */
-	r.tx = a->tx * b->m11 + a->ty * b->m21 + a->tz * b->m31 + b->tx;
-	r.ty = a->tx * b->m12 + a->ty * b->m22 + a->tz * b->m32 + b->ty;
-	r.tz = a->tx * b->m13 + a->ty * b->m23 + a->tz * b->m33 + b->tz;
-
-	/* copy the results back into first matrix */
-	a->m11 = r.m11; a->m12 = r.m12; a->m13 = r.m13;
-	a->m21 = r.m21; a->m22 = r.m22; a->m23 = r.m23;
-	a->m31 = r.m31; a->m32 = r.m32; a->m33 = r.m33;
-	a->tx = r.tx; a->ty = r.ty; a->tz = r.tz;
-
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		fprintf(stderr, "dbg2       error:      %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2       status:     %d\n", status);
-		}
-
-	return (status);
-}		/* concat_transform */
-
diff --git a/src/mbio/mbsys_swathplus.h b/src/mbio/mbsys_swathplus.h
deleted file mode 100644
index 5b4f676..0000000
--- a/src/mbio/mbsys_swathplus.h
+++ /dev/null
@@ -1,745 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbsys_swathplus.h	1/28/2014
- *	$Id: mbsys_swathplus.h 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 2014-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-
-/*
- * mbsys_swathplus.h defines the MBIO data structures for handling data from
- * the following data formats:
- *      MBF_TEMPFORM : MBIO ID 221 - SWATHplus intermediate format
- *      MBF_SWPLSSXP : MBIO ID 222 - SWATHplus processed format
- *
- * Author:	David Finlayson
- * Date:	February 19, 2014
- *
- * HISTORY
- *
- * 2014-04-11 - David Finlayson
- * 	- Reformated comments.
- *	- Added record to hold MB System projection id
- */
-
-/*
- * Notes on the mbsys_swathplus data structure and associated format:
- *
- * In early 2013 SEA sold the SWATHplus system to BathySwath where
- * the system will be rebranded the BathySwath.
- *
- *   1. BathySwath defines three data formats associated with the SWATHplus
- *      interferometric sonar: raw, intermediate, and processed.
- *      MB-System supports the intermediate format as MBIO
- *      format 221 (MBF_SWPLSSXI) and the processed format as MBIO
- *      format 222 (MBF_SWPLSSXP). Only the SXP format is fully tested at this time.
- *
- *   2. Bathyswath is a swath bathymetry sonar system.  It is derived from
- *      the SWATHplus sonar system, and uses the same file formats.  In
- *      turn, SWATHplus was derived from the Submetrix sonars, built by
- *      Submetrix Ltd.
- *
- *   3. The data files are written using a Microsoft Windows operating system
- *      and therefore follow the conventions of that system in terms of file
- *      naming and low-level disk format.  In particular, data structures
- *      often contain padding bytes that must be preserved to maintain
- *      compatibility with the format.
- *
- *   4. All Bathyswath and SWATHplus data is little-endian, i.e. in the
- *      natural 80x86 format with the least significant byte at the lower
- *      address.
- *
- *   5. MBF_SWPLSSXP - Processed data derived from the real-time software.
- *      These files have all corrections applied, including: attitude,
- *      position, tide, speed of sound, includes down-sampled position,
- *      attitude and tide information.  Processed files use a projected
- *      coordinate system (PCS), typically UTM.  The user must supply PRJ
- *      files for each input sxp file identifying the correct PCS.
- *
- *   6. MBF_SWPLSSXI - Raw data, but parsed into a format that is easier for
- *      third-party code to interpret. These files have none of the above
- *      corrections applied.
- *
- *   7. All of the bathyswath files use the same block-oriented data format.
- *      They can be read using the same software code, and the blocks that
- *      they contain may be included in any of the files.  The difference
- *      between the file types is therefore simply the types of data block
- *      that they tend to contain.  Each file contains a file header block,
- *      followed by a series of data blocks.  Every block contains a header
- *      that identifies the block, followed by the length of the block.
- *      Therefore, the reading software can identify the blocks that it
- *      wishes to read and ignore and skip over any block types that it
- *      encounters.  In this way, new blocks can be added to a file without
- *      necessarily having to update the reading software.
- *
- */
-
-/* include mb_define.h */
-#ifndef MB_DEFINE_DEF
-#include "mb_define.h"
-#endif
-
-/*---------------------------------------------------------------
-   Record ID definitions (if needed for use in data reading and writing) */
-
-/* Processed (SXP) datagrams */
-#define SWPLS_ID_NONE				0x0		/* 0 means no record at all */
-#define SWPLS_ID_UNKNOWN				0x1
-#define SWPLS_ID_SXP_HEADER_DATA		0x01df01df	/* Processed file header */
-#define SWPLS_ID_PROCESSED_PING		0x28		/* processed ping data (prior to
-											  January 2010) */
-#define SWPLS_ID_PROCESSED_PING2		0x52		/* processed ping data (after
-											  January 2010) */
-#define SWPLS_ID_SBP_PROJECTION		0x0		/* PLACEHOLDER */
-
-/* Parsed (SXI) datagrams */
-#define SWPLS_ID_SXI_HEADER_DATA		0x521d52d1	/* parsed data file header */
-#define SWPLS_ID_PARSED_PING			0x29	/* sonar data in parsed data */
-#define SWPLS_ID_PARSED_ATTITUDE		0x2b	/* attitude data in parsed data */
-#define SWPLS_ID_PARSED_POSITION_LL	0x2c	/* lat-long position idata in parsed data */
-#define SWPLS_ID_PARSED_POSITION_EN	0x2d	/* easting-northing data in parsed data */
-#define SWPLS_ID_PARSED_SSV			0x2e	/* speed of sound data in parsed data */
-#define SWPLS_ID_PARSED_ECHOSOUNDER	0x2f	/* echosounder data in parsed data */
-#define SWPLS_ID_PARSED_TIDE			0x30	/* tide data in parsed data */
-#define SWPLS_ID_PARSED_AGDS			0x31	/* AGDS data in parsed data */
-
-/* MB-System Custom datagrams (BathySwath user-reserved blocks) */
-#define SWPLS_ID_COMMENT				0x100	/* MB System comment */
-#define SWPLS_ID_POS_OFFSET			0x101	/* MB System position offset lever arms */
-#define SWPLS_ID_IMU_OFFSET			0x102	/* MB System IMU offset lever arms*/
-#define SWPLS_ID_TXER_OFFSET			0x103	/* MB System Transducer offset lever arms */
-#define SWPLS_ID_WL_OFFSET			0x104	/* MB System Water Line offset lever arm */
-#define SWPLS_ID_PROJECTION			0x105	/* MB System Projection ID */
-
-/*---------------------------------------------------------------
-   Record size definitions (if needed for use in data reading and writing) */
-
-#define SWPLS_SIZE_NONE				0	/* 0 means no record at all  */
-#define SWPLS_SIZE_BLOCKHEADER		8	/* Block Header (blockid, blocksize) */
-#define SWPLS_SIZE_HEADER				8	/* File version block */
-#define SWPLS_SIZE_PROCESSED_PING		256	/* Old-style pings (prior to Jan 2010) */
-#define SWPLS_SIZE_PROCESSED_PING2	264	/* New-style pings (after Jan 2010) */
-#define SWPLS_SIZE_POINT				40	/* Old-style points (prior to Jan 2010)*/
-#define SWPLS_SIZE_POINT2				48	/* New-style points (after Jan 2010) */
-#define SWPLS_SIZE_PARSED_PING		35
-#define SWPLS_SIZE_PARSED_POINT		7
-#define SWPLS_SIZE_ATTITUDE			25
-#define SWPLS_SIZE_POSITION_LL			25
-#define SWPLS_SIZE_POSITION_EN		25
-#define SWPLS_SIZE_SSV				13
-#define SWPLS_SIZE_ECHOSOUNDER		13	/* assumed value until known */
-#define SWPLS_SIZE_TIDE				13	/* assumed value until known */
-#define SWPLS_SIZE_AGDS				17	/* assumed value until known */
-
-#define SWPLS_SIZE_PROJECTION			12	/* MB SYSTEM ONLY */
-#define SWPLS_SIZE_COMMENT			12	/* MB SYSTEM ONLY */
-#define SWPLS_SIZE_POS_OFFSET			25	/* MB SYSTEM ONLY */
-#define SWPLS_SIZE_IMU_OFFSET			25	/* MB SYSTEM ONLY */
-#define SWPLS_SIZE_TXER_OFFSET		41	/* MB SYSTEM ONLY */
-#define SWPLS_SIZE_WL_OFFSET			13	/* MB SYSTEM ONLY */
-
-/*---------------------------------------------------------------
-   Array size definitions (if needed for use in data reading and writing) */
-
-#define SWPLS_MAX_BEAMS			2048
-#define SWPLS_MAX_PIXELS			2048
-#define SWPLS_MAX_TXERS			3
-#define SWPLS_MAX_LINENAME		40
-#define SWPLS_MAX_TX_INFO			3
-#define SWPLS_BUFFER_STARTSIZE	32768
-
-/*---------------------------------------------------------------
-   SWATHplus constant definitions */
-
-/* Sonar ping mode settings (sxp_ping->txstat & SWPLS_SONAR_SEL_MASK) */
-#define SWPLS_SONAR_SEL_MASK		3
-#define SWPLS_SONAR_SEL_OFF		0
-#define SWPLS_SONAR_SEL_SINGLE	1
-#define SWPLS_SONAR_SEL_ALT		2
-#define SWPLS_SONAR_SEL_SIM		3
-
-/* Sample flag definitions */
-#define SWPLS_POINT_REJECTED	0
-#define SWPLS_POINT_ACCEPTED	1
-
-/* Transducer azimuth beam widths (degrees) */
-#define SWPLS_TYPE_L_BEAM_WIDTH	0.85
-#define SWPLS_TYPE_M_BEAM_WIDTH	0.55
-#define SWPLS_TYPE_H_BEAM_WIDTH	0.55
-
-/* Variations of Pi precomputed */
-#define kPi (M_PI)
-#define k2Pi (kPi * 2.0)
-#define kPiOver2 (kPi / 2.0)
-#define k1OverPi (1.0 / kPi)
-#define k1Over2Pi (1.0 / k2Pi)
-
-/* Structs needed for doing coordinate transformations
-   left-handed coordinate system */
-
-typedef struct swathplus_vector_struct
-	{
-	double x;			/* positive to right */
-	double y;			/* positive up */
-	double z;			/* positive forward */
-	} swpls_vector;
-
-typedef struct swathplus_euler_angles_struct
-	{
-	double heading;	/*clockwise rotation of y, +starboard */
-	double pitch;		/*clockwise rotation of x, +nose down */
-	double bank;		/*clockwise rotation of z, +starboard up */
-	} swpls_angles;
-
-typedef struct swathplus_quaternion_struct
-	{
-	double w;
-	double x;
-	double y;
-	double z;
-	} swpls_quaternion;
-
-typedef struct swathplus_matrix_struct
-	{
-	double m11, m12, m13;
-	double m21, m22, m23;
-	double m31, m32, m33;
-	double tx, ty, tz;
-	} swpls_matrix;
-
-/* SWATHplus file header structure (SXI, SXP) */
-typedef struct swpls_file_header_struct
-	{
-	int swver;		/* 3065601 means: Major version 3, Minor version 06, Release 56, Build 01 */
-	int fmtver;	/* Obsolete */
-	} swpls_header;
-
-/* SWATHplus processed point data. (SXP) */
-typedef struct swpls_point_struct
-	{
-	int sampnum;				/* sample number, rejected may not be present */
-	double y;					/* north coordinate (m) */
-	double x;					/* east coordinate (m) */
-	float z;					/* depth positive down (m) */
-	unsigned short int amp;		/* raw amplitude (16-bit) */
-	unsigned short int procamp;	/* processed amplitude (16-bit) */
-	unsigned char status;		/* 0 (bad) or 1 (good) */
-	double tpu;				/* total propagated uncertainty (m) [Version 2]*/
-	} swpls_point;
-
-/* SWATHplus processed ping data (SXP)*/
-typedef struct swpls_sxpping_struct
-	{
-	char linename[SWPLS_MAX_LINENAME];	/* apparently not used by SEA software
-										  */
-	unsigned int pingnumber;	/* ping number */
-	double time_d;				/* UNIX time of start of ping */
-	int notxers;				/* number of transducers in this record, always 1 */
-	double easting;				/* easting coordinate of transducer (m) */
-	double northing;			/* northing coordinate of transducer (m) */
-	double roll;				/* roll at start of ping (deg) +starboard down*/
-	double pitch;				/* pitch at start of ping (deg)  +nose up */
-	double heading;			/* heading at start of ping (deg), +clockwise */
-	double height;				/* height of crp in survey datum (m) +down */
-	double tide;				/* tide at start of ping (m) */
-	double sos;				/* speed of sound (mean value) */
-	unsigned char txno;			/* transducer identifier */
-	unsigned char txstat;		/* transducer status */
-	unsigned char txpower;		/* power setting */
-	short int analoggain;			/* analog gain setting */
-	unsigned char nostaves;		/* number of staves on transducer */
-	unsigned char txinfo[SWPLS_MAX_TX_INFO];	/* board type/revision/serial num. */
-	unsigned char freq;			/* frequency code */
-	double frequency;			/* frequency in hertz */
-	short int trnstime;			/* transmit time/number of cycles */
-	short int recvtime;			/* receive time/number of samples */
-	unsigned char samprate;		/* receive rate micro-sec/sample */
-	int nosampsorig;			/* num. samp. read in real time */
-	int nosampsfile;			/* num. samp. in the processed file */
-	int nosampslots;			/* number of sample slots */
-	double txer_e;				/* easting coordinate of transducer (m) */
-	double txer_n;				/* northing coordinate of transducer (m) */
-	double txer_height;			/* positive down (m) */
-	double txer_forward;		/* positive forward (m) */
-	double txer_starboard;		/* positive starboard (m) */
-	double txer_azimuth;		/* positive clockwise looking down (deg) */
-	double txer_elevation;		/* angle of txer plate, positive angles above horizon (deg) */
-	double txer_skew;			/* positive clockwise from rear (deg) */
-	double txer_time;			/* time offset (sec) */
-	double txer_waterdepth;		/* transducer draft (m) */
-	double txer_pitch;			/* positive bow up (deg) [Version 2 pings only] */
-	size_t points_alloc;			/* MBSYSTEM-ONLY number of allocated points (don't write out) */
-	swpls_point *points;			/* array of swpls_points */
-	} swpls_sxpping;
-
-/* SWATHplus parsed ping data (SXI) */
-typedef struct swpls_sxiping_struct
-	{
-	int time_d;				/* start of ping, seconds since 1970 */
-	int microsec;				/* microseconds since time_d */
-	unsigned char channel;		/* identifies the transducer */
-	unsigned long pingnumber;	/* simultaneous pings are numbered separately */
-	float frequency;				/* frequency of the transducer in Hz */
-	float samp_period;			/* time period between sonar data samples, in
-								  seconds */
-	unsigned short nosamps;		/* number of samples following */
-	float sos;					/* speed of sound used to calculate angles, m/s */
-	short int txpulse;			/* transmit pulse length, in sonar cycles */
-	char data_options;			/* allows options in data encoding */
-	unsigned char ping_state;	/* records the status of pinging
-								  single/alternating/simultaneous */
-	unsigned short max_count;	/* maximum data count before filtering */
-	unsigned short reserve1;		/* reserved for other ping information */
-	size_t samps_alloc;			/* MB SYSTEM ONLY number of allocated samples
-								  for following arrays */
-	unsigned short *sampnum;	/* sample numbers */
-	short int *angle;			/* Angle coded +15 bits = 180 deg up, -15 bits =
-								  180 deg down, relative to the txer pointing
-								  angle */
-	unsigned short *amplitude;	/* Amplitude scaled so that 16 bits is the full
-								  scale of the ADC */
-	unsigned char *quality;		/* as set by "data options */
-	} swpls_sxiping;
-
-/* SWATHplus parsed attitude data (SXI) */
-typedef struct swpls_attitude_struct
-	{
-	int time_d;				/* start of ping time code. */
-	int microsec;				/* microseconds since time_d */
-	unsigned char channel;		/* identifies the data source */
-	float roll;					/* positive for starboard down */
-	float pitch;				/* positive for nose up */
-	float heading;				/* positive clockwise looking down */
-	float height;				/* positive for down */
-	} swpls_attitude;
-
-/* SWATHplus parsed position geographic coordinates (SXI) */
-typedef struct swpls_position_ll_struct
-	{
-	int time_d;				/* start of ping time code. */
-	int microsec;				/* microseconds since time_d */
-	unsigned char channel;		/* identifies the data source */
-	double latitude;			/* degrees (of survey center?) */
-	double longitude;			/* degrees (of survey center?) */
-	} swpls_posll;
-
-/* SWATHplus parsed position projected coordinates (SXI) */
-typedef struct swpls_position_en_struct
-	{
-	int time_d;				/* start of ping time code. */
-	int microsec;				/* microseconds since time_d*/
-	unsigned char channel;		/* identifies the data source */
-	double easting;				/* easting coordinate (m) */
-	double northing;			/* northing coordinate (m) */
-	} swpls_posen;
-
-/* SWATHplus parsed speed of sound (SXI) */
-typedef struct swpls_ssv_struct
-	{
-	int time_d;				/* start of ping time code. */
-	int microsec;				/* microseconds since time_d */
-	unsigned char channel;		/* identifies the data source */
-	float ssv;					/* speed of sound (m/s) */
-	} swpls_ssv;
-
-/* SWATHplus parsed tide data (SXI) */
-typedef struct swpls_tide_struct
-	{
-	int time_d;				/* start of ping time code. */
-	int microsec;				/* microseconds since time_d*/
-	unsigned char channel;		/* identifies the data source */
-	float tide;					/* speed of sound (m/s) */
-	} swpls_tide;
-
-/* SWATHplus parsed echosounder data (SXI) */
-typedef struct swpls_echosounder_struct
-	{
-	int time_d;				/* start of ping time code. */
-	int microsec;				/* microseconds since time_d*/
-	unsigned char channel;		/* identifies the data source */
-	float altitude;				/* height above seabed (m) */
-	} swpls_echosounder;
-
-/* SWATHplus parsed Acoustic Ground Discrimination System (SXI) */
-typedef struct swpls_agds_struct
-	{
-	int time_d;				/* start of ping time code. */
-	int microsec;				/* microseconds since time_d*/
-	unsigned char channel;		/* identifies the data source */
-	float hardness;
-	float roughness;
-	} swpls_agds;
-
-/* MB System comment structure (BathySwath User Reserved Block) */
-typedef struct swpls_comment_struct
-	{
-	int time_d;				/* start of ping time code */
-	int microsec;				/* microseconds since time_d*/
-	int nchars;				/* number of characters */
-	size_t message_alloc;		/* number of characters allocated in storage */
-	char *message;			/* characters in the message */
-	} swpls_comment;
-
-/* MB System projection definition structure (BathySwath User Reserved Block) */
-typedef struct swpls_projection_struct
-	{
-	int time_d;				/* start of ping time code */
-	int microsec;				/* microseconds since time_d*/
-	int nchars;				/* number of characters */
-	size_t projection_alloc;		/* number of characters allocated in storage */
-	char *projection_id;			/* characters in the projection id */
-	} swpls_projection;
-
-
-/* MB System common reference point to position lever arm (BathySwath User
-  Reserve Block) */
-typedef struct swpls_pos_offset_struct
-	{
-	int time_d;				/* start of ping time code */
-	int microsec;				/* microseconds since time_d*/
-	unsigned char channel;		/* identifies the data source */
-	float height;				/* +up, meters */
-	float forward;				/* +forward, meters */
-	float starboard;				/* +starboard, meters */
-	float time;					/* +time, seconds */
-	} swpls_pos_offset;
-
-/* MB System common reference point to imu position lever arm (BathySwath User
-  Reserve Block) */
-typedef struct swpls_imu_offset_struct
-	{
-	int time_d;				/* start of ping time code */
-	int microsec;				/* microseconds since time_d */
-	unsigned char channel;		/* identifies the data source */
-	float height;				/* +up, meters */
-	float forward;				/* +forward, meters */
-	float starboard;				/* +starboard, meters */
-	float time;					/* +time, secodns */
-	} swpls_imu_offset;
-
-/* MB System common reference point to transducer position lever arm (BathySwath
-  User Reserve Block) */
-typedef struct swpls_txer_offset_struct
-	{
-	int time_d;				/* start of ping time code */
-	int microsec;				/* microseconds since time_d */
-	unsigned char channel;		/* identifies the transducer */
-	float height;				/* +up, meters */
-	float forward;				/* +forward, meters */
-	float starboard;				/* +starboard, meters */
-	float azimuth;				/* +clockwise, degrees */
-	float elevation;				/* +above horizon, degrees */
-	float pitch;				/* +nose up, degrees */
-	float skew;				/* +clockwise, degrees */
-	float time;					/* +time, seconds */
-	} swpls_txer_offset;
-
-/* MB System common reference point to water line lever arm (BathySwath User
-  Reserve Block) */
-typedef struct swpls_wl_offset_struct
-	{
-	int time_d;				/* start of ping time code */
-	int microsec;				/* microseconds since time_d*/
-	unsigned char channel;		/* identifies the data source */
-	float height;				/* +up, meters */
-	} swpls_wl_offset;
-
-/* MB System data structure */
-struct mbsys_swathplus_struct
-	{
-	/* Type of most recently read data record */
-	int kind;					/* MB-System record ID */
-	int type;					/* SWATHplus datagram ID */
-
-	/* MB-System time stamp of most recently read record */
-	double time_d;
-	int time_i[7];
-
-	/* Projection information */
-	int projection_set;
-	swpls_projection projection;
-
-	/* Processed (SXP) Records */
-	int sxp_header_set;
-	swpls_header sxp_header;
-	swpls_sxpping sxp_ping;
-
-	/* Parsed (SXI) Records */
-	int sxi_header_set;
-	swpls_header sxi_header;
-	swpls_sxiping sxi_ping;
-	swpls_attitude attitude;
-	swpls_posll posll;
-	swpls_posen posen;
-	swpls_ssv ssv;
-	swpls_tide tide;
-	swpls_echosounder echosounder;
-	swpls_agds agds;
-
-	/* MB-System Records */
-	swpls_comment comment;
-	swpls_pos_offset pos_offset;
-	swpls_imu_offset imu_offset;
-	swpls_txer_offset txer_offset;
-	swpls_wl_offset wl_offset;
-	};
-
-/*---------------------------------------------------------------*/
-
-/* System specific function prototypes */
-
-/* Note: this list of functions corresponds to the function pointers
- * that are included in the structure mb_io_struct that is defined
- * in the file mbsystem/src/mbio/mb_io.h
- * Not all of these functions are required - some only make sense to
- * define if the relevant data type is part of the format. For instance,
- * do not define mbsys_swathplus_extract_segy() if there are no subbottom
- * profiler data supported by this data system.
- * The function prototypes that are not required for all data systems
- * are commented out below. When using this example as the basis for
- * for coding a new MB-System I/O module, uncomment any non-required
- * functions that will be useful. */
-int mbsys_swathplus_alloc(int verbose, void *mbio_ptr, void **store_ptr,
-	int *error);
-int mbsys_swathplus_deall(int verbose, void *mbio_ptr, void **store_ptr,
-	int *error);
-int mbsys_swathplus_dimensions(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, int *nbath, int *namp, int *nss,
-	int *error);
-int mbsys_swathplus_pingnumber(int verbose, void *mbio_ptr, int *pingnumber,
-	int *error);
-int mbsys_swathplus_sonartype(int verbose, void *mbio_ptr, void *store_ptr,
-	int *sonartype, int *error);
-int mbsys_swathplus_sidescantype(int verbose, void *mbio_ptr, void *store_ptr,
-	int *ss_type, int *error);
-
-/* int mbsys_swathplus_preprocess(int verbose, void *mbio_ptr, void *store_ptr, */
-/*                        double time_d, double navlon, double navlat, */
-/*                        double speed, double heading, double sonardepth, */
-/*                        double roll, double pitch, double heave, */
-/*                        int *error); */
-int mbsys_swathplus_extract(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, int time_i[7], double *time_d,
-	double *navlon, double *navlat, double *speed,
-	double *heading, int *nbath, int *namp, int *nss,
-	char *beamflag, double *bath, double *amp,
-	double *bathacrosstrack, double *bathalongtrack,
-	double *ss, double *ssacrosstrack,
-	double *ssalongtrack, char *comment, int *error);
-int mbsys_swathplus_insert(int verbose, void *mbio_ptr, void *store_ptr,
-	int kind, int time_i[7], double time_d,
-	double navlon, double navlat, double speed,
-	double heading, int nbath, int namp, int nss,
-	char *beamflag, double *bath, double *amp,
-	double *bathacrosstrack, double *bathalongtrack,
-	double *ss, double *ssacrosstrack,
-	double *ssalongtrack, char *comment, int *error);
-int mbsys_swathplus_extract_nav(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, int time_i[7], double *time_d,
-	double *navlon, double *navlat, double *speed,
-	double *heading, double *draft, double *roll,
-	double *pitch, double *heave, int *error);
-
-/* int mbsys_swathplus_extract_nnav(int verbose, void *mbio_ptr, void
-   *store_ptr, */
-/*			int nmax, int *kind, int *n, */
-/*			int *time_i, double *time_d, */
-/*			double *navlon, double *navlat, */
-/*			double *speed, double *heading, double *draft, */
-/*			double *roll, double *pitch, double *heave, */
-/*			int *error); */
-int mbsys_swathplus_insert_nav(int verbose, void *mbio_ptr, void *store_ptr,
-	int time_i[7], double time_d, double navlon,
-	double navlat, double speed, double heading,
-	double draft, double roll, double pitch,
-	double heave, int *error);
-int mbsys_swathplus_extract_altitude(int verbose, void *mbio_ptr,
-	void *store_ptr, int *kind,
-	double *transducer_depth, double *altitude,
-	int *error);
-
-/* int mbsys_swathplus_insert_altitude(int verbose, void *mbio_ptr, void
-   *store_ptr, */
-/*                        double transducer_depth, double altitude, */
-/*                        int *error); */
-int mbsys_swathplus_extract_svp(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, int *nsvp, double *depth,
-	double *velocity, int *error);
-int mbsys_swathplus_insert_svp(int verbose, void *mbio_ptr, void *store_ptr,
-	int nsvp, double *depth, double *velocity,
-	int *error);
-int mbsys_swathplus_ttimes(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, int *nbeams, double *ttimes,
-	double *angles, double *angles_forward,
-	double *angles_null, double *heave,
-	double *alongtrack_offset, double *draft,
-	double *ssv, int *error);
-int mbsys_swathplus_detects(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, int *nbeams, int *detects, int *error);
-
-/* int mbsys_swathplus_pulses(int verbose, void *mbio_ptr, void *store_ptr, */
-/*                        int *kind, int *nbeams, int *pulses, int *error); */
-int mbsys_swathplus_gains(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, double *transmit_gain,
-	double *pulse_length, double *receive_gain,
-	int *error);
-
-/* int mbsys_swathplus_extract_rawss(int verbose, void *mbio_ptr, void
-   *store_ptr, */
-/*			int *kind, int *nrawss, */
-/*			double *rawss, */
-/*			double *rawssacrosstrack, */
-/*			double *rawssalongtrack, */
-/*			int *error); */
-/* int mbsys_swathplus_insert_rawss(int verbose, void *mbio_ptr, void
-   *store_ptr, */
-/*			int nrawss, */
-/*			double *rawss, */
-/*			double *rawssacrosstrack, */
-/*			double *rawssalongtrack, */
-/*			int *error); */
-/* int mbsys_swathplus_extract_segytraceheader(int verbose, void *mbio_ptr, void
-   *store_ptr, */
-/*			int *kind, */
-/*			void *segytraceheader_ptr, */
-/*			int *error); */
-/* int mbsys_swathplus_extract_segy(int verbose, void *mbio_ptr, void
-   *store_ptr, */
-/*			int *sampleformat, */
-/*			int *kind, */
-/*			void *segytraceheader_ptr, */
-/*			float *segydata, */
-/*			int *error); */
-/* int mbsys_swathplus_insert_segy(int verbose, void *mbio_ptr, void *store_ptr, */
-/*			int kind, */
-/*			void *segytraceheader_ptr, */
-/*			float *segydata, */
-/*			int *error); */
-/* int mbsys_swathplus_ctd(int verbose, void *mbio_ptr, void *store_ptr, */
-/*			int *kind, int *nctd, double *time_d, */
-/*			double *conductivity, double *temperature, */
-/*			double *depth, double *salinity, double *soundspeed, int *error); */
-/* int mbsys_swathplus_ancilliarysensor(int verbose, void *mbio_ptr, void
-   *store_ptr, */
-/*			int *kind, int *nsensor, double *time_d, */
-/*			double *sensor1, double *sensor2, double *sensor3, */
-/*			double *sensor4, double *sensor5, double *sensor6, */
-/*			double *sensor7, double *sensor8, int *error); */
-int mbsys_swathplus_copy(int verbose, void *mbio_ptr, void *store_ptr,
-	void *copy_ptr, int *error);
-
-/* Custom swathplus functions */
-int mbsys_swathplus_print_store(int verbose,
-	struct mbsys_swathplus_struct *store,
-	int *error);
-int mbsys_swathplus_blockheader_read(int verbose, void *mb_io_ptr,
-	int *recordid, int *size, int *error);
-
-int swpls_init_transform(int verbose, swpls_matrix *m, int *error);
-int swpls_concat_translate(int verbose, swpls_matrix *m, double dx, double dy,
-	double dz, int *error);
-int swpls_concat_rotate_x(int verbose, swpls_matrix *m, double pitch,
-	int *error);
-int swpls_concat_rotate_y(int verbose, swpls_matrix *m, double heading,
-	int *error);
-int swpls_concat_rotate_z(int verbose, swpls_matrix *m, double bank,
-	int *error);
-int swpls_transform(int verbose, const swpls_matrix *m, swpls_vector *p,
-	int *error);
-
-/*---------------------------------------------------------------*/
-int swpls_chk_header(int verbose, void *mbio_ptr, char *buffer, int *recordid,
-	int *size, int *error);
-int swpls_wr_data(int verbose, void *mbio_ptr, void *store_ptr, int *error);
-
-int swpls_rd_sxpheader(int verbose, char *buffer, void *store_ptr, int *error);
-int swpls_rd_sxpping(int verbose, char *buffer, void *store_ptr, int pingtype,
-	int *error);
-int swpls_wr_sxpheader(int verbose, int *bufferalloc, char **bufferptr,
-	void *store_ptr, int *size, int *error);
-int swpls_wr_sxpping(int verbose, int *bufferalloc, char **bufferptr,
-	void *store_ptr, int *size, int *error);
-int swpls_pr_sxpheader(int verbose, FILE *fout, swpls_header *header,
-	int *error);
-int swpls_pr_sxpping(int verbose, FILE *fout, swpls_sxpping *ping, int *error);
-
-int swpls_rd_sxiheader(int verbose, char *buffer, void *store_ptr, int *error);
-int swpls_rd_sxiping(int verbose, char *buffer, void *store_ptr, int *error);
-int swpls_rd_attitude(int verbose, char *buffer, void *store_ptr, int *error);
-int swpls_rd_posll(int verbose, char *buffer, void *store_ptr, int *error);
-int swpls_rd_posen(int verbose, char *buffer, void *store_ptr, int *error);
-int swpls_rd_ssv(int verbose, char *buffer, void *store_ptr, int *error);
-int swpls_rd_echosounder(int verbose, char *buffer, void *store_ptr,
-	int *error);
-int swpls_rd_tide(int verbose, char *buffer, void *store_ptr, int *error);
-int swpls_rd_agds(int verbose, char *buffer, void *store_ptr, int *error);
-int swpls_wr_sxiheader(int verbose, int *bufferalloc, char **bufferptr,
-	void *store_ptr, int *size, int *error);
-int swpls_wr_sxiping(int verbose, int *bufferalloc, char **bufferptr,
-	void *store_ptr, int *size, int *error);
-int swpls_wr_attitude(int verbose, int *bufferalloc, char **bufferptr,
-	void *store_ptr, int *size, int *error);
-int swpls_wr_posll(int verbose, int *bufferalloc, char **bufferptr,
-	void *store_ptr, int *size, int *error);
-int swpls_wr_posen(int verbose, int *bufferalloc, char **bufferptr,
-	void *store_ptr, int *size, int *error);
-int swpls_wr_ssv(int verbose, int *bufferalloc, char **bufferptr,
-	void *store_ptr, int *size, int *error);
-int swpls_wr_echosounder(int verbose, int *bufferalloc, char **bufferptr,
-	void *store_ptr, int *size, int *error);
-int swpls_wr_tide(int verbose, int *bufferalloc, char **bufferptr,
-	void *store_ptr, int *size, int *error);
-int swpls_wr_agds(int verbose, int *bufferalloc, char **bufferptr,
-	void *store_ptr, int *size, int *error);
-int swpls_pr_sxiheader(int verbose, FILE *fout, swpls_header *header,
-	int *error);
-int swpls_pr_sxiping(int verbose, FILE *fout, swpls_sxiping *ping, int *error);
-int swpls_pr_attitude(int verbose, FILE *fout, swpls_attitude *attitude,
-	int *error);
-int swpls_pr_posll(int verbose, FILE *fout, swpls_posll *posll, int *error);
-int swpls_pr_posen(int verbose, FILE *fout, swpls_posen *posen, int *error);
-int swpls_pr_ssv(int verbose, FILE *fout, swpls_ssv *ssv, int *error);
-int swpls_pr_echosounder(int verbose, FILE *fout, swpls_echosounder *sounder,
-	int *error);
-int swpls_pr_tide(int verbose, FILE *fout, swpls_tide *tide, int *error);
-int swpls_pr_agds(int verbose, FILE *fout, swpls_agds *agds, int *error);
-
-int swpls_rd_projection(int verbose, char *buffer, void *store_ptr, int *error);
-int swpls_rd_comment(int verbose, char *buffer, void *store_ptr, int *error);
-int swpls_rd_pos_offset(int verbose, char *buffer, void *store_ptr, int *error);
-int swpls_rd_imu_offset(int verbose, char *buffer, void *store_ptr, int *error);
-int swpls_rd_txer_offset(int verbose, char *buffer, void *store_ptr,
-	int *error);
-int swpls_rd_wl_offset(int verbose, char *buffer, void *store_ptr, int *error);
-int swpls_wr_projection(int verbose, int *bufferalloc, char **bufferptr,
-	void *store_ptr, int *size, int *error);
-int swpls_wr_comment(int verbose, int *bufferalloc, char **bufferptr,
-	void *store_ptr, int *size, int *error);
-int swpls_wr_pos_offset(int verbose, int *bufferalloc, char **bufferptr,
-	void *store_ptr, int *size, int *error);
-int swpls_wr_imu_offset(int verbose, int *bufferalloc, char **bufferptr,
-	void *store_ptr, int *size, int *error);
-int swpls_wr_txer_offset(int verbose, int *bufferalloc, char **bufferptr,
-	void *store_ptr, int *size, int *error);
-int swpls_wr_wl_offset(int verbose, int *bufferalloc, char **bufferptr,
-	void *store_ptr, int *size, int *error);
-int swpls_pr_projection(int verbose, FILE *fout, swpls_projection *projection,
-	int *error);
-int swpls_pr_comment(int verbose, FILE *fout, swpls_comment *comment,
-	int *error);
-int swpls_pr_pos_offset(int verbose, FILE *fout, swpls_pos_offset *pos_offset,
-	int *error);
-int swpls_pr_imu_offset(int verbose, FILE *fout, swpls_imu_offset *imu_offset,
-	int *error);
-int swpls_pr_txer_offset(int verbose, FILE *fout,
-	swpls_txer_offset *txer_offset, int *error);
-int swpls_pr_wl_offset(int verbose, FILE *fout, swpls_wl_offset *wl_offset,
-	int *error);
-
diff --git a/src/mbio/mbsys_templatesystem.c b/src/mbio/mbsys_templatesystem.c
deleted file mode 100644
index 39ba797..0000000
--- a/src/mbio/mbsys_templatesystem.c
+++ /dev/null
@@ -1,1766 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbsys_templatesystem.c	3.00	1/27/2014
- *	$Id: mbsys_templatesystem.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 2014-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbsys_templatesystem.c contains the MBIO functions for handling data from
- * the following data formats:
- *    MBSYS_TEMPLATESYSTEM formats (code in mbsys_templatesystem.c and mbsys_templatesystem.h):
- *      MBF_TEMPFORM : MBIO ID ??? (code in mbr_tempform.c)
- *
- * Author:	D. W. Caress
- * Date:	January 27, 2014
- *
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mb_define.h"
-#include "mbsys_templatesystem.h"
-
-static char version_id[]="$Id: mbsys_templatesystem.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mbsys_templatesystem_alloc(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_templatesystem_alloc";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_templatesystem_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",version_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* allocate memory for data structure */
-	status = mb_mallocd(verbose, __FILE__, __LINE__, sizeof(struct mbsys_templatesystem_struct),
-				(void **)store_ptr, error);
-
-	/* get data structure pointer */
-	store = (struct mbsys_templatesystem_struct *) *store_ptr;
-
-	/* initialize data record kind */
-	store->kind = MB_DATA_NONE;
-
-	/* initialize MB-System time stamp */
-	store->time_d = 0;
-	for (i=0;i<7;i++)
-		store->time_i[i] = 0;
-		
-	/* initialize everything else */
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)*store_ptr);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_templatesystem_deall(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_templatesystem_deall";
-	int	status = MB_SUCCESS;
-	struct mbsys_templatesystem_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",version_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)*store_ptr);
-		}
-
-	/* get data structure pointer */
-	store = (struct mbsys_templatesystem_struct *) *store_ptr;
-	
-	/* deallocate any arrays or structures contained within the store data structure */
-
-	/* deallocate memory for data structure */
-	status = mb_freed(verbose,__FILE__,__LINE__,(void **)store_ptr,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbsys_templatesystem_dimensions(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int *nbath, int *namp, int *nss, int *error)
-{
-	char	*function_name = "mbsys_templatesystem_dimensions";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_templatesystem_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",version_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_templatesystem_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get beam and pixel numbers */
-		*nbath = MBSYS_TEMPLATESYSTEM_MAX_BEAMS;
-		*namp = MBSYS_TEMPLATESYSTEM_MAX_BEAMS;
-		*nss = MBSYS_TEMPLATESYSTEM_MAX_PIXELS;
-		}
-	else
-		{
-		/* get beam and pixel numbers */
-		*nbath = 0;
-		*namp = 0;
-		*nss = 0;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		fprintf(stderr,"dbg2       nbath:      %d\n",*nbath);
-		fprintf(stderr,"dbg2        namp:      %d\n",*namp);
-		fprintf(stderr,"dbg2        nss:       %d\n",*nss);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_templatesystem_pingnumber(int verbose, void *mbio_ptr,
-		int *pingnumber, int *error)
-{
-	char	*function_name = "mbsys_templatesystem_pingnumber";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_templatesystem_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",version_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_templatesystem_struct *) mb_io_ptr->store_data;
-
-	/* extract data from structure */
-	*pingnumber = store->ping_number;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       pingnumber: %d\n",*pingnumber);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_templatesystem_sonartype(int verbose, void *mbio_ptr, void *store_ptr,
-		int *sonartype, int *error)
-{
-	char	*function_name = "mbsys_templatesystem_sonartype";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_templatesystem_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",version_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_templatesystem_struct *) store_ptr;
-
-	/* get sonar type */
-	*sonartype = MB_SONARTYPE_MULTIBEAM;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       sonartype:  %d\n",*sonartype);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_templatesystem_sidescantype(int verbose, void *mbio_ptr, void *store_ptr,
-		int *ss_type, int *error)
-{
-	char	*function_name = "mbsys_templatesystem_sidescantype";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_templatesystem_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",version_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_templatesystem_struct *) store_ptr;
-
-	/* get sidescan type */
-	*ss_type = MB_SIDESCAN_LINEAR;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       ss_type:    %d\n",*ss_type);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_templatesystem_extract(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int time_i[7], double *time_d,
-		double *navlon, double *navlat,
-		double *speed, double *heading,
-		int *nbath, int *namp, int *nss,
-		char *beamflag, double *bath, double *amp,
-		double *bathacrosstrack, double *bathalongtrack,
-		double *ss, double *ssacrosstrack, double *ssalongtrack,
-		char *comment, int *error)
-{
-	char	*function_name = "mbsys_templatesystem_extract";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_templatesystem_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",version_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_templatesystem_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get time */
-		for (i=0;i<7;i++)
-			time_i[i] = store->time_i[i];
-		*time_d = store->time_d;
-
-		/* get navigation */
-		*navlon = store->longitude;
-		*navlat = store->latitude;
-
-		/* get speed */
-		*speed = store->speed;
-
-		/* get heading */
-		*heading = store->heading;
-
-		/* set beamwidths in mb_io structure */
-		mb_io_ptr->beamwidth_xtrack = store->beam_width_xtrack_degrees;
-		mb_io_ptr->beamwidth_ltrack = store->beam_width_ltrack_degrees;
-
-		/* read distance and depth values into storage arrays */
-		*nbath = store->number_beams;
-		*namp = *nbath;
-		for (i=0;i<*nbath;i++)
-			{
-			bath[i] = store->bath[i];
-			beamflag[i] = store->beamflag[i];
-			bathacrosstrack[i] = store->bathacrosstrack[i];
-			bathalongtrack[i] = store->bathalongtrack[i];
-			amp[i] = store->amp[i];
-			}
-
-		/* extract sidescan */
-		*nss = store->number_pixels;
-		for (i=0;i<store->number_pixels;i++)
-			{
-			ss[i] = store->sidescan[i];
-			ssacrosstrack[i] = store->ssacrosstrack[i];
-			ssalongtrack[i] = store->ssalongtrack[i];
-			}
-
-		/* print debug statements */
-		if (verbose >= 5)
-			{
-			fprintf(stderr,"\ndbg4  Data extracted by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  Extracted values:\n");
-			fprintf(stderr,"dbg4       kind:       %d\n" *kind);
-			fprintf(stderr,"dbg4       error:      %d\n", *error);
-			fprintf(stderr,"dbg4       time_i[0]:  %d\n", time_i[0]);
-			fprintf(stderr,"dbg4       time_i[1]:  %d\n", time_i[1]);
-			fprintf(stderr,"dbg4       time_i[2]:  %d\n", time_i[2]);
-			fprintf(stderr,"dbg4       time_i[3]:  %d\n", time_i[3]);
-			fprintf(stderr,"dbg4       time_i[4]:  %d\n", time_i[4]);
-			fprintf(stderr,"dbg4       time_i[5]:  %d\n", time_i[5]);
-			fprintf(stderr,"dbg4       time_i[6]:  %d\n", time_i[6]);
-			fprintf(stderr,"dbg4       time_d:     %f\n", *time_d);
-			fprintf(stderr,"dbg4       longitude:  %f\n", *navlon);
-			fprintf(stderr,"dbg4       latitude:   %f\n", *navlat);
-			fprintf(stderr,"dbg4       speed:      %f\n", *speed);
-			fprintf(stderr,"dbg4       heading:    %f\n", *heading);
-			fprintf(stderr,"dbg4       nbath:      %d\n", *nbath);
-			for (i=0;i<*nbath;i++)
-			  fprintf(stderr,"dbg4       beam:%d  flag:%3d  bath:%f  acrosstrack:%f  alongtrack:%f\n",
-				i,beamflag[i],bath[i],
-				bathacrosstrack[i],bathalongtrack[i]);
-			fprintf(stderr,"dbg4        namp:     %d\n", *namp);
-			for (i=0;i<*namp;i++)
-			  fprintf(stderr,"dbg4        beam:%d   amp:%f  acrosstrack:%f  alongtrack:%f\n",
-				i,amp[i],bathacrosstrack[i],bathalongtrack[i]);
-			fprintf(stderr,"dbg4        nss:      %d\n", *nss);
-			for (i=0;i<*nss;i++)
-			  fprintf(stderr,"dbg4        pixel:%d   ss:%f  acrosstrack:%f  alongtrack:%f\n",
-				i,ss[i],ssacrosstrack[i],ssalongtrack[i]);
-			}
-
-		/* done translating values */
-
-		}
-
-	/* extract data from structure */
-	else if (*kind == MB_DATA_NAV)
-		{
-		/* get time */
-		for (i=0;i<7;i++)
-			time_i[i] = store->time_i[i];
-		*time_d = store->time_d;
-
-		/* get navigation */
-		*navlon = store->longitude;
-		*navlat = store->latitude;
-
-		/* get speed */
-		*speed = store->speed;
-
-		/* get heading */
-		*heading = store->heading;
-
-		/* set beam and pixel numbers */
-		*nbath = 0;
-		*namp = 0;
-		*nss = 0;
-
-		/* print debug statements */
-		if (verbose >= 5)
-			{
-			fprintf(stderr,"\ndbg4  Data extracted by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  Extracted values:\n");
-			fprintf(stderr,"dbg4       kind:       %d\n", *kind);
-			fprintf(stderr,"dbg4       error:      %d\n", *error);
-			fprintf(stderr,"dbg4       time_i[0]:  %d\n", time_i[0]);
-			fprintf(stderr,"dbg4       time_i[1]:  %d\n", time_i[1]);
-			fprintf(stderr,"dbg4       time_i[2]:  %d\n", time_i[2]);
-			fprintf(stderr,"dbg4       time_i[3]:  %d\n", time_i[3]);
-			fprintf(stderr,"dbg4       time_i[4]:  %d\n", time_i[4]);
-			fprintf(stderr,"dbg4       time_i[5]:  %d\n", time_i[5]);
-			fprintf(stderr,"dbg4       time_i[6]:  %d\n", time_i[6]);
-			fprintf(stderr,"dbg4       time_d:     %f\n", *time_d);
-			fprintf(stderr,"dbg4       longitude:  %f\n", *navlon);
-			fprintf(stderr,"dbg4       latitude:   %f\n", *navlat);
-			fprintf(stderr,"dbg4       speed:      %f\n", *speed);
-			fprintf(stderr,"dbg4       heading:    %f\n", *heading);
-			}
-
-		/* done translating values */
-
-		}
-
-	/* extract comment from structure */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* get time */
-		for (i=0;i<7;i++)
-			time_i[i] = store->time_i[i];
-		*time_d = store->time_d;
-
-		/* copy comment */
-		if (store->comment > 0)
-			strncpy(comment, store->comment, MB_COMMENT_MAXLINE);
-		else
-			comment[0] = '\0';
-
-		/* print debug statements */
-		if (verbose >= 4)
-			{
-			fprintf(stderr,"\ndbg4  Comment extracted by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  New ping values:\n");
-			fprintf(stderr,"dbg4       kind:       %d\n", *kind);
-			fprintf(stderr,"dbg4       error:      %d\n", *error);
-			fprintf(stderr,"dbg4       time_i[0]:  %d\n", time_i[0]);
-			fprintf(stderr,"dbg4       time_i[1]:  %d\n", time_i[1]);
-			fprintf(stderr,"dbg4       time_i[2]:  %d\n", time_i[2]);
-			fprintf(stderr,"dbg4       time_i[3]:  %d\n", time_i[3]);
-			fprintf(stderr,"dbg4       time_i[4]:  %d\n", time_i[4]);
-			fprintf(stderr,"dbg4       time_i[5]:  %d\n", time_i[5]);
-			fprintf(stderr,"dbg4       time_i[6]:  %d\n", time_i[6]);
-			fprintf(stderr,"dbg4       time_d:     %f\n", *time_d);
-			fprintf(stderr,"dbg4       comment:    %s\n", comment);
-			}
-		}
-
-	/* set time for other data records */
-	else
-		{
-		/* get time */
-		for (i=0;i<7;i++)
-			time_i[i] = store->time_i[i];
-		*time_d = store->time_d;
-
-		/* print debug statements */
-		if (verbose >= 4)
-			{
-			fprintf(stderr,"\ndbg4  Data extracted by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  Extracted values:\n");
-			fprintf(stderr,"dbg4       kind:       %d\n",*kind);
-			fprintf(stderr,"dbg4       error:      %d\n",*error);
-			fprintf(stderr,"dbg4       time_i[0]:  %d\n",time_i[0]);
-			fprintf(stderr,"dbg4       time_i[1]:  %d\n",time_i[1]);
-			fprintf(stderr,"dbg4       time_i[2]:  %d\n",time_i[2]);
-			fprintf(stderr,"dbg4       time_i[3]:  %d\n",time_i[3]);
-			fprintf(stderr,"dbg4       time_i[4]:  %d\n",time_i[4]);
-			fprintf(stderr,"dbg4       time_i[5]:  %d\n",time_i[5]);
-			fprintf(stderr,"dbg4       time_i[6]:  %d\n",time_i[6]);
-			fprintf(stderr,"dbg4       time_d:     %f\n",*time_d);
-			fprintf(stderr,"dbg4       comment:    %s\n",comment);
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind == MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"dbg2       comment:     \ndbg2       %s\n",
-			comment);
-		}
-	else if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind != MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"dbg2       time_i[0]:     %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:     %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:     %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:     %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:     %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:     %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:     %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:        %f\n",*time_d);
-		}
-	if (verbose >= 2 && (*kind == MB_DATA_DATA || *kind == MB_DATA_NAV))
-		{
-		fprintf(stderr,"dbg2       longitude:     %f\n",*navlon);
-		fprintf(stderr,"dbg2       latitude:      %f\n",*navlat);
-		fprintf(stderr,"dbg2       speed:         %f\n",*speed);
-		fprintf(stderr,"dbg2       heading:       %f\n",*heading);
-		}
-	if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind == MB_DATA_DATA)
-		{
-		fprintf(stderr,"dbg2       nbath:      %d\n",
-			*nbath);
-		for (i=0;i<*nbath;i++)
-		  fprintf(stderr,"dbg2       beam:%d  flag:%3d  bath:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,beamflag[i],bath[i],
-			bathacrosstrack[i],bathalongtrack[i]);
-		fprintf(stderr,"dbg2        namp:     %d\n",
-			*namp);
-		for (i=0;i<*namp;i++)
-		  fprintf(stderr,"dbg2       beam:%d   amp:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,amp[i],bathacrosstrack[i],bathalongtrack[i]);
-		fprintf(stderr,"dbg2        nss:      %d\n",
-			*nss);
-		for (i=0;i<*nss;i++)
-		  fprintf(stderr,"dbg2        pixel:%d   ss:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,ss[i],ssacrosstrack[i],ssalongtrack[i]);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_templatesystem_insert(int verbose, void *mbio_ptr, void *store_ptr,
-		int kind, int time_i[7], double time_d,
-		double navlon, double navlat,
-		double speed, double heading,
-		int nbath, int namp, int nss,
-		char *beamflag, double *bath, double *amp,
-		double *bathacrosstrack, double *bathalongtrack,
-		double *ss, double *ssacrosstrack, double *ssalongtrack,
-		char *comment, int *error)
-{
-	char	*function_name = "mbsys_templatesystem_insert";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_templatesystem_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",version_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       kind:       %d\n",kind);
-		}
-	if (verbose >= 2 && kind == MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"dbg2       comment:     \ndbg2       %s\n",
-			comment);
-		}
-	if (verbose >= 2 && (kind != MB_DATA_COMMENT))
-		{
-		fprintf(stderr,"dbg2       time_i[0]:  %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:  %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:  %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:  %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:  %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:  %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:  %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:     %f\n",time_d);
-		}
-	if (verbose >= 2 && (kind == MB_DATA_DATA || kind == MB_DATA_NAV))
-		{
-		fprintf(stderr,"dbg2       navlon:     %f\n",navlon);
-		fprintf(stderr,"dbg2       navlat:     %f\n",navlat);
-		fprintf(stderr,"dbg2       speed:      %f\n",speed);
-		fprintf(stderr,"dbg2       heading:    %f\n",heading);
-		}
-	if (verbose >= 2 && kind == MB_DATA_DATA)
-		{
-		fprintf(stderr,"dbg2       nbath:      %d\n",nbath);
-		if (verbose >= 3)
-		 for (i=0;i<nbath;i++)
-		  fprintf(stderr,"dbg3       beam:%d  flag:%3d  bath:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,beamflag[i],bath[i],
-			bathacrosstrack[i],bathalongtrack[i]);
-		fprintf(stderr,"dbg2       namp:       %d\n",namp);
-		if (verbose >= 3)
-		 for (i=0;i<namp;i++)
-		  fprintf(stderr,"dbg3        beam:%d   amp:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,amp[i],bathacrosstrack[i],bathalongtrack[i]);
-		fprintf(stderr,"dbg2        nss:       %d\n",nss);
-		if (verbose >= 3)
-		 for (i=0;i<nss;i++)
-		  fprintf(stderr,"dbg3        beam:%d   ss:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,ss[i],ssacrosstrack[i],ssalongtrack[i]);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_templatesystem_struct *) store_ptr;
-
-	/* set data kind */
-	store->kind = kind;
-
-	/* insert data in structure */
-	if (store->kind == MB_DATA_DATA)
-		{
-		/* get time */
-		for (i=0;i<7;i++)
-			store->time_i[i] = time_i[i];
-		store->time_d = time_d;
-
-		/* get navigation */
-		store->longitude = navlon;
-		store->latitude = navlat;
-
-		/* get heading */
-		store->heading = heading;
-
-		/* get speed  */
-		store->speed = speed;
-
-		/* read distance and depth values into storage arrays */
-		store->number_beams = nbath;
-		for (i=0;i<bathymetry->number_beams;i++)
-			{
-			store->depth[i] = bath[i];
-			store->beamflag[i] = beamflag[i];
-			store->acrosstrack[i] = bathacrosstrack[i];
-			store->alongtrack[i] = bathalongtrack[i];
-			store->amplitude[i] = amp[i];
-			}
-
-		/* insert the sidescan */
-		store->number_pixels = nss;
-		for (i=0;i<store->number_pixels;i++)
-			{
-			store->sidescan[i] = ss[i];
-			store->acrosstrack[i] = store->acrosstrack[i];
-			store->alongtrack[i] = store->alongtrack[i];
-			}
-		}
-
-	/* insert data in nav structure */
-	else if (store->kind == MB_DATA_NAV)
-		{
-		/* get time */
-		for (i=0;i<7;i++)
-			store->time_i[i] = time_i[i];
-		store->time_d = time_d;
-
-
-		/* get navigation */
-		store->longitude = navlon;
-		store->latitude = navlat;
-
-		/* get heading */
-		store->heading = heading;
-
-		/* get speed  */
-		store->speed = speed;
-		}
-
-	/* insert comment in structure */
-	else if (store->kind == MB_DATA_COMMENT)
-		{
-		strncpy(store->comment, comment, MB_COMMENT_MAXLINE);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_templatesystem_ttimes(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, int *nbeams,
-	double *ttimes, double *angles,
-	double *angles_forward, double *angles_null,
-	double *heave, double *alongtrack_offset,
-	double *draft, double *ssv, int *error)
-{
-	char	*function_name = "mbsys_templatesystem_ttimes";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_templatesystem_struct *store;
-	double	heave_use, roll, pitch;
-	double	alpha, beta, theta, phi;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",version_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       ttimes:     %p\n",(void *)ttimes);
-		fprintf(stderr,"dbg2       angles_xtrk:%p\n",(void *)angles);
-		fprintf(stderr,"dbg2       angles_ltrk:%p\n",(void *)angles_forward);
-		fprintf(stderr,"dbg2       angles_null:%p\n",(void *)angles_null);
-		fprintf(stderr,"dbg2       heave:      %p\n",(void *)heave);
-		fprintf(stderr,"dbg2       ltrk_off:   %p\n",(void *)alongtrack_offset);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_templatesystem_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get depth offset (heave + sonar depth) */
-		*ssv = store->ssv;
-
-		/* get draft */
-		*draft = store->static_draft + store->dynamic_draft;
-
-		/* get travel times, angles */
-		*nbeams = bathymetry->number_beams;
-		for (i=0;i<bathymetry->number_beams;i++)
-			{
-			ttimes[i] = store->ttimes[i];
-			angles[i] = store->vertical_angle[i];
-			angles_forward[i] = store->azimuthal_angle[i];
-			angles_null[i] = store->angles_null[i];
-			heave[i] = store->heave_beam[i];
-			alongtrack_offset[i] = store->alongtrack_offset;
-			}
-
-		/* set status */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error == MB_ERROR_NO_ERROR)
-		{
-		fprintf(stderr,"dbg2       draft:      %f\n",*draft);
-		fprintf(stderr,"dbg2       ssv:        %f\n",*ssv);
-		fprintf(stderr,"dbg2       nbeams:     %d\n",*nbeams);
-		for (i=0;i<*nbeams;i++)
-			fprintf(stderr,"dbg2       beam %d: tt:%f  angle_xtrk:%f  angle_ltrk:%f  angle_null:%f  depth_off:%f  ltrk_off:%f\n",
-				i,ttimes[i],angles[i],
-				angles_forward[i],angles_null[i],
-				heave[i],alongtrack_offset[i]);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_templatesystem_detects(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, int *nbeams, int *detects, int *error)
-{
-	char	*function_name = "mbsys_templatesystem_detects";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_templatesystem_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",version_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       detects:    %p\n",(void *)detects);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_templatesystem_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get detect type for each sounding - options include:
-			MB_DETECT_UNKNOWN
-			MB_DETECT_AMPLITUDE
-			MB_DETECT_PHASE
-			MB_DETECT_UNKNOWN */
-		*nbeams = bathymetry->number_beams;
-		for (i=0;i<*nbeams;i++)
-			{
-			detects[i] = MB_DETECT_UNKNOWN;
-			}
-
-		/* set status */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error == MB_ERROR_NO_ERROR)
-		{
-		fprintf(stderr,"dbg2       nbeams:     %d\n",*nbeams);
-		for (i=0;i<*nbeams;i++)
-			fprintf(stderr,"dbg2       beam %d: detects:%d\n",
-				i,detects[i]);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_templatesystem_gains(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, double *transmit_gain, double *pulse_length,
-			double *receive_gain, int *error)
-{
-	char	*function_name = "mbsys_templatesystem_gains";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_templatesystem_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",version_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_templatesystem_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get transmit_gain (dB) */
-		*transmit_gain = store->transmit_gain;
-
-		/* get pulse_length (usec) */
-		*pulse_length = store->pulse_width;
-
-		/* get receive_gain (dB) */
-		*receive_gain = store->receive_gain;
-
-		/* set status */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error == MB_ERROR_NO_ERROR)
-		{
-		fprintf(stderr,"dbg2       transmit_gain: %f\n",*transmit_gain);
-		fprintf(stderr,"dbg2       pulse_length:  %f\n",*pulse_length);
-		fprintf(stderr,"dbg2       receive_gain:  %f\n",*receive_gain);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_templatesystem_extract_altitude(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, double *transducer_depth, double *altitudev,
-	int *error)
-{
-	char	*function_name = "mbsys_templatesystem_extract_altitude";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_templatesystem_struct *store;
-	double	heave, roll, pitch;
-	double	xtrackmin;
-	int	altitude_found;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",version_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_templatesystem_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get transducer depth and altitude */
-		*transducer_depth = store->static_draft + store->dynamic_draft + store->heave;
-
-		/* get altitude */
-		*altitude = store->altitude;
-
-		/* set status */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:              %d\n",*kind);
-		fprintf(stderr,"dbg2       transducer_depth:  %f\n",*transducer_depth);
-		fprintf(stderr,"dbg2       altitude:          %f\n",*altitudev);
-		fprintf(stderr,"dbg2       error:             %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:            %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_templatesystem_extract_nav(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int time_i[7], double *time_d,
-		double *navlon, double *navlat,
-		double *speed, double *heading, double *draft,
-		double *roll, double *pitch, double *heave,
-		int *error)
-{
-	char	*function_name = "mbsys_templatesystem_extract_nav";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_templatesystem_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",version_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_templatesystem_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from survey record */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get time */
-		for (i=0;i<7;i++)
-			time_i[i] = store->time_i[i];
-		*time_d = store->time_d;
-
-		/* get navigation */
-		*navlon = store->longitude;
-		*navlat = store->latitude;
-
-		/* get speed */
-		*speed = store->speed;
-
-		/* get heading */
-		*heading = store->heading;
-
-		/* get draft  */
-		*draft = store->static_draft + store->dynamic_draft;;
-
-		/* get attitude  */
-		*roll = store->roll;
-		*pitch = store->pitch;
-		*heave = store->heave;
-
-		/* done translating values */
-		}
-
-	/* extract data from nav record */
-	else if (*kind == MB_DATA_NAV)
-		{
-		/* get time */
-		for (i=0;i<7;i++)
-			time_i[i] = store->time_i[i];
-		*time_d = store->time_d;
-
-		/* get navigation */
-		*navlon = store->longitude;
-		*navlat = store->latitude;
-
-		/* get speed */
-		*speed = store->speed;
-
-		/* get heading */
-		*heading = store->heading;
-
-		/* get draft  */
-		*draft = store->static_draft + store->dynamic_draft;;
-
-		/* get attitude  */
-		*roll = store->roll;
-		*pitch = store->pitch;
-		*heave = store->heave;
-
-		/* done translating values */
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-
-		/* get time */
-		for (i=0;i<7;i++)
-			time_i[i] = store->time_i[i];
-		*time_d = store->time_d;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-
-		/* get time */
-		for (i=0;i<7;i++)
-			time_i[i] = store->time_i[i];
-		*time_d = store->time_d;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:          %d\n",*kind);
-		fprintf(stderr,"dbg2       time_i[0]:     %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:     %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:     %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:     %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:     %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:     %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:     %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:        %f\n",*time_d);
-		fprintf(stderr,"dbg2       longitude:     %f\n",*navlon);
-		fprintf(stderr,"dbg2       latitude:      %f\n",*navlat);
-		fprintf(stderr,"dbg2       speed:         %f\n",*speed);
-		fprintf(stderr,"dbg2       heading:       %f\n",*heading);
-		fprintf(stderr,"dbg2       draft:         %f\n",*draft);
-		fprintf(stderr,"dbg2       roll:          %f\n",*roll);
-		fprintf(stderr,"dbg2       pitch:         %f\n",*pitch);
-		fprintf(stderr,"dbg2       heave:         %f\n",*heave);
-		fprintf(stderr,"dbg2       error:         %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:        %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_templatesystem_extract_nnav(int verbose, void *mbio_ptr, void *store_ptr,
-			int nmax, int *kind, int *n,
-			int *time_i, double *time_d,
-			double *navlon, double *navlat,
-			double *speed, double *heading, double *draft,
-			double *roll, double *pitch, double *heave,
-			int *error)
-{
-	char	*function_name = "mbsys_templatesystem_extract_nnav";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_templatesystem_struct *store;
-	int	i, inav;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",version_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       nmax:       %d\n",nmax);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_templatesystem_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from survey record */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* just one navigation value */
-		*n = 1;
-
-		/* get time */
-		for (i=0;i<7;i++)
-			time_i[i] = store->time_i[i];
-		time_d[0] = store->time_d;
-
-		/* get navigation */
-		navlon[0] = store->longitude;
-		navlat = store->latitude;
-
-		/* get speed */
-		speed[0] = store->speed;
-
-		/* get heading */
-		heading[0] = store->heading;
-
-		/* get draft  */
-		draft[0] = store->static_draft + store->dynamic_draft;;
-
-		/* get attitude  */
-		roll[0] = store->roll;
-		pitch[0] = store->pitch;
-		heave[0] = store->heave;
-
-		/* done translating values */
-		}
-
-	/* extract data from nav record */
-	else if (*kind == MB_DATA_NAV)
-		{
-		/* just one navigation value - in some formats there
-			are multiple values in nav records to loop over */
-		*n = 1;
-
-		/* get time */
-		for (i=0;i<7;i++)
-			time_i[i] = store->time_i[i];
-		time_d[0] = store->time_d;
-
-		/* get navigation */
-		navlon[0] = store->longitude;
-		navlat[0] = store->latitude;
-
-		/* get speed */
-		speed[0] = store->speed;
-
-		/* get heading */
-		heading[0] = store->heading;
-
-		/* get draft  */
-		draft[0] = store->static_draft + store->dynamic_draft;;
-
-		/* get attitude  */
-		roll[0] = store->roll;
-		pitch[0] = store->pitch;
-		heave[0] = store->heave;
-
-		/* done translating values */
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-
-		/* get time */
-		for (i=0;i<7;i++)
-			time_i[i] = store->time_i[i];
-		time_d[0] = store->time_d;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-
-		/* get time */
-		for (i=0;i<7;i++)
-			time_i[i] = store->time_i[i];
-		time_d[0] = store->time_d;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		fprintf(stderr,"dbg2       n:          %d\n",*n);
-		for (inav=0;inav<*n;inav++)
-			{
-			for (i=0;i<7;i++)
-				fprintf(stderr,"dbg2       %d time_i[%d]:     %d\n",inav,i,time_i[inav * 7 + i]);
-			fprintf(stderr,"dbg2       %d time_d:        %f\n",inav,time_d[inav]);
-			fprintf(stderr,"dbg2       %d longitude:     %f\n",inav,navlon[inav]);
-			fprintf(stderr,"dbg2       %d latitude:      %f\n",inav,navlat[inav]);
-			fprintf(stderr,"dbg2       %d speed:         %f\n",inav,speed[inav]);
-			fprintf(stderr,"dbg2       %d heading:       %f\n",inav,heading[inav]);
-			fprintf(stderr,"dbg2       %d draft:         %f\n",inav,draft[inav]);
-			fprintf(stderr,"dbg2       %d roll:          %f\n",inav,roll[inav]);
-			fprintf(stderr,"dbg2       %d pitch:         %f\n",inav,pitch[inav]);
-			fprintf(stderr,"dbg2       %d heave:         %f\n",inav,heave[inav]);
-			}
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_templatesystem_insert_nav(int verbose, void *mbio_ptr, void *store_ptr,
-		int time_i[7], double time_d,
-		double navlon, double navlat,
-		double speed, double heading, double draft,
-		double roll, double pitch, double heave,
-		int *error)
-{
-	char	*function_name = "mbsys_templatesystem_insert_nav";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_templatesystem_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",version_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       time_i[0]:  %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:  %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:  %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:  %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:  %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:  %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:  %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:     %f\n",time_d);
-		fprintf(stderr,"dbg2       navlon:     %f\n",navlon);
-		fprintf(stderr,"dbg2       navlat:     %f\n",navlat);
-		fprintf(stderr,"dbg2       speed:      %f\n",speed);
-		fprintf(stderr,"dbg2       heading:    %f\n",heading);
-		fprintf(stderr,"dbg2       draft:      %f\n",draft);
-		fprintf(stderr,"dbg2       roll:       %f\n",roll);
-		fprintf(stderr,"dbg2       pitch:      %f\n",pitch);
-		fprintf(stderr,"dbg2       heave:      %f\n",heave);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_templatesystem_struct *) store_ptr;
-
-	/* insert data in ping structure */
-	if (store->kind == MB_DATA_DATA)
-		{
-		/* get time */
-		for (i=0;i<7;i++)
-			store->time_i[i] = time_i[i];
-		store->time_d = time_d;
-
-		/* get navigation */
-		store->longitude = navlon;
-		store->latitude = navlat;
-
-		/* get speed  */
-		store->speed = speed;
-
-		/* get heading */
-		store->heading = heading;
-
-		/* get draft  */
-		*draft = store->static_draft + store->dynamic_draft;;
-		store->dynamic_draft = *draft - store->static_draft;
-
-		/* get roll pitch and heave */
-		store->heave = heave;
-		store->pitch = pitch;
-		store->roll = roll;
-		}
-
-	/* insert data in nav structure */
-	else if (store->kind == MB_DATA_NAV)
-		{
-		/* get time */
-		for (i=0;i<7;i++)
-			store->time_i[i] = time_i[i];
-		store->time_d = time_d;
-
-		/* get navigation */
-		store->longitude = navlon;
-		store->latitude = navlat;
-
-		/* get speed  */
-		store->speed = speed;
-
-		/* get heading */
-		store->heading = heading;
-
-		/* get draft  */
-		*draft = store->static_draft + store->dynamic_draft;;
-		store->dynamic_draft = *draft - store->static_draft;
-
-		/* get roll pitch and heave */
-		store->heave = heave;
-		store->pitch = pitch;
-		store->roll = roll;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_templatesystem_extract_svp(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int *nsvp,
-		double *depth, double *velocity,
-		int *error)
-{
-	char	*function_name = "mbsys_templatesystem_extract_svp";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_templatesystem_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",version_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_templatesystem_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_VELOCITY_PROFILE)
-		{
-		/* get number of depth-velocity pairs */
-		*nsvp = store->number_svp;
-
-		/* get profile */
-		for (i=0;i<*nsvp;i++)
-			{
-			depth[i] = store->svp_depth[i];
-			velocity[i] =store->svp_sv[i];
-			}
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:              %d\n",*kind);
-		fprintf(stderr,"dbg2       nsvp:              %d\n",*nsvp);
-		for (i=0;i<*nsvp;i++)
-		    fprintf(stderr,"dbg2       depth[%d]: %f   velocity[%d]: %f\n",i, depth[i], i, velocity[i]);
-		fprintf(stderr,"dbg2       error:             %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:            %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_templatesystem_insert_svp(int verbose, void *mbio_ptr, void *store_ptr,
-		int nsvp,
-		double *depth, double *velocity,
-		int *error)
-{
-	char	*function_name = "mbsys_templatesystem_insert_svp";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_templatesystem_struct *store;
-	s7kr_svp *svp;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",version_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       nsvp:       %d\n",nsvp);
-		for (i=0;i<nsvp;i++)
-		    fprintf(stderr,"dbg2       depth[%d]: %f   velocity[%d]: %f\n",i, depth[i], i, velocity[i]);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_templatesystem_struct *) store_ptr;
-
-	/* insert data in structure */
-	if (store->kind == MB_DATA_VELOCITY_PROFILE)
-		{
-		/* get profile */
-		if (status == MB_SUCCESS)
-			{
-			store->number_svp = MIN(nsvp, MBSYS_TEMPLATESYSTEM_NUMBER_SVP_MAX);
-			for (i=0;i<store->number_svp;i++)
-				{
-				store->svp_depth[i] = depth[i];
-				store->svp_sv[i] = velocity[i];
-				}
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_templatesystem_copy(int verbose, void *mbio_ptr,
-			void *store_ptr, void *copy_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_templatesystem_copy";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_templatesystem_struct *store;
-	struct mbsys_templatesystem_struct *copy;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",version_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       copy_ptr:   %p\n",(void *)copy_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointers */
-	store = (struct mbsys_templatesystem_struct *) store_ptr;
-	copy = (struct mbsys_templatesystem_struct *) copy_ptr;
-
-	/* copy the data - for many formats memory must be allocated and
-		sub-structures copied separately */
-	*copy = *store;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mbsys_templatesystem.h b/src/mbio/mbsys_templatesystem.h
deleted file mode 100644
index 8916ac0..0000000
--- a/src/mbio/mbsys_templatesystem.h
+++ /dev/null
@@ -1,236 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbsys_templatesystem.h	1/28/2014
- *	$Id: mbsys_templatesystem.h 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 2014-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbsys_templatesystem.h defines the MBIO data structures for handling data from
- * the following data formats:
- *    MBSYS_TEMPLATESYSTEM formats (code in mbsys_templatesystem.c and mbsys_templatesystem.h):
- *      MBF_TEMPFORM : MBIO ID ??? (code in mbr_tempform.c)
- *
- * Author:	D. W. Caress
- * Date:	January 28, 2014
- *
- *
- */
-/*
- * Notes on the mbsys_templatesystem data structure and associated format:
- *   1. This is example source to demonstrate how to code an
- *      MB-System i/o module.
- *   2. The structure in mbsys_templatesystem.h defines the internal
- *      representation of a class of data. This may be data
- *      associated with a single format, or data associated
- *      with multiple similar or related formats.
- *   3. The functions in mbsys_templatesystem.c allow for extracting
- *      data from or inserting data into this internal
- *      representation. These functions are called by the
- *      MBIO API functions found in mbio/mb_access.c.
- *   4. The functions in mbr_tempform.c actually read and
- *      write the mbf_template format.
- *   5. Prototypes for all of the functions in mbsys_templatesystem.c
- *      are provided in mbsys_templatesystem.h.
- *   6. This list of functions corresponds to the function pointers
- *      that are included in the structure mb_io_struct that is defined
- *      in the file mbsystem/src/mbio/mb_io.h
- *      Not all of these functions are required - some only make sense to
- *      define if the relevant data type is part of the format. For instance,
- *      do not define mbsys_templatesystem_extract_segy() if there are no subbottom
- *      profiler data supported by this data system */
-*/
-
-/* include mb_define.h */
-#ifndef MB_DEFINE_DEF
-#include "mb_define.h"
-#endif
-
-/*---------------------------------------------------------------*/
-/* Record ID definitions (if needed for use in data reading and writing) */
-
-/*---------------------------------------------------------------*/
-/* Record size definitions (if needed for use in data reading and writing) */
-
-/*---------------------------------------------------------------*/
-/* Array size definitions (if needed for use in data reading and writing) */
-#define MBSYS_TEMPLATESYSTEM_MAX_BEAMS 400
-#define MBSYS_TEMPLATESYSTEM_MAX_PIXELS 400
-
-/*---------------------------------------------------------------*/
-
-/* Structure size definitions (if needed because there are dynamically allocated substructures) */
-
-/* Internal data structure */
-struct mbsys_templatesystem_struct
-	{
-	/* Type of most recently read data record */
-	int		kind;			/* MB-System record ID */
-
-	/* MB-System time stamp of most recently read record */
-	double		time_d;
-	int		time_i[7];
-        
-        /* Survey data
-        
-        /* Navigation and attitude associated with survey data */
-        
-        /* Bathymetry and amplitude data */
-        
-        /* Raw backscatter data */
-        
-        /* Sidescan derived from raw backscatter */
-        
-        /* Navigation data */
-        
-        /* Sensordepth */
-        
-        /* Attitude data */
-        
-        /* Comment */
-
-	};
-        
-/*---------------------------------------------------------------*/
-
-/* System specific function prototypes */
-/* Note: this list of functions corresponds to the function pointers
- * that are included in the structure mb_io_struct that is defined
- * in the file mbsystem/src/mbio/mb_io.h
- * Not all of these functions are required - some only make sense to
- * define if the relevant data type is part of the format. For instance,
- * do not define mbsys_templatesystem_extract_segy() if there are no subbottom
- * profiler data supported by this data system.
- * The function prototypes that are not required for all data systems
- * are commented out below. When using this example as the basis for
- * for coding a new MB-System I/O module, uncomment any non-required
- * functions that will be useful. */
-int mbsys_templatesystem_alloc(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error);
-int mbsys_templatesystem_deall(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error);
-int mbsys_templatesystem_dimensions(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int *nbath, int *namp, int *nss, int *error);
-//int mbsys_templatesystem_pingnumber(int verbose, void *mbio_ptr,
-//			int *pingnumber, int *error);
-//int mbsys_templatesystem_sonartype(int verbose, void *mbio_ptr, void *store_ptr,
-//                        int *sonartype, int *error);
-//int mbsys_templatesystem_sidescantype(int verbose, void *mbio_ptr, void *store_ptr,
-//                        int *ss_type, int *error);
-//int mbsys_templatesystem_preprocess(int verbose, void *mbio_ptr, void *store_ptr,
-//                        double time_d, double navlon, double navlat,
-//                        double speed, double heading, double sonardepth,
-//                        double roll, double pitch, double heave,
-//                        int *error);
-int mbsys_templatesystem_extract(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int time_i[7], double *time_d,
-			double *navlon, double *navlat,
-			double *speed, double *heading,
-			int *nbath, int *namp, int *nss,
-			char *beamflag, double *bath, double *amp,
-			double *bathacrosstrack, double *bathalongtrack,
-			double *ss, double *ssacrosstrack, double *ssalongtrack,
-			char *comment, int *error);
-int mbsys_templatesystem_insert(int verbose, void *mbio_ptr, void *store_ptr,
-			int kind, int time_i[7], double time_d,
-			double navlon, double navlat,
-			double speed, double heading,
-			int nbath, int namp, int nss,
-			char *beamflag, double *bath, double *amp,
-			double *bathacrosstrack, double *bathalongtrack,
-			double *ss, double *ssacrosstrack, double *ssalongtrack,
-			char *comment, int *error);
-int mbsys_templatesystem_extract_nav(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int time_i[7], double *time_d,
-			double *navlon, double *navlat,
-			double *speed, double *heading, double *draft,
-			double *roll, double *pitch, double *heave,
-			int *error);
-//int mbsys_templatesystem_extract_nnav(int verbose, void *mbio_ptr, void *store_ptr,
-//			int nmax, int *kind, int *n,
-//			int *time_i, double *time_d,
-//			double *navlon, double *navlat,
-//			double *speed, double *heading, double *draft,
-//			double *roll, double *pitch, double *heave,
-//			int *error);
-int mbsys_templatesystem_insert_nav(int verbose, void *mbio_ptr, void *store_ptr,
-			int time_i[7], double time_d,
-			double navlon, double navlat,
-			double speed, double heading, double draft,
-			double roll, double pitch, double heave,
-			int *error);
-int mbsys_templatesystem_extract_altitude(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, double *transducer_depth, double *altitude,
-			int *error);
-//int mbsys_templatesystem_insert_altitude(int verbose, void *mbio_ptr, void *store_ptr,
-//                        double transducer_depth, double altitude,
-//                        int *error);
-int mbsys_templatesystem_extract_svp(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind,
-			int *nsvp,
-			double *depth, double *velocity,
-			int *error);
-int mbsys_templatesystem_insert_svp(int verbose, void *mbio_ptr, void *store_ptr,
-			int nsvp,
-			double *depth, double *velocity,
-			int *error);
-int mbsys_templatesystem_ttimes(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int *nbeams,
-			double *ttimes, double *angles,
-			double *angles_forward, double *angles_null,
-			double *heave, double *alongtrack_offset,
-			double *draft, double *ssv, int *error);
-//int mbsys_templatesystem_detects(int verbose, void *mbio_ptr, void *store_ptr,
-//			int *kind, int *nbeams, int *detects, int *error);
-//int mbsys_templatesystem_pulses(int verbose, void *mbio_ptr, void *store_ptr,
-//                        int *kind, int *nbeams, int *pulses, int *error);
-//int mbsys_templatesystem_gains(int verbose, void *mbio_ptr, void *store_ptr,
-//			int *kind, double *transmit_gain, double *pulse_length,
-//			double *receive_gain, int *error);
-//int mbsys_templatesystem_extract_rawss(int verbose, void *mbio_ptr, void *store_ptr,
-//			int *kind, int *nrawss,
-//			double *rawss,
-//			double *rawssacrosstrack,
-//			double *rawssalongtrack,
-//			int *error);
-//int mbsys_templatesystem_insert_rawss(int verbose, void *mbio_ptr, void *store_ptr,
-//			int nrawss,
-//			double *rawss,
-//			double *rawssacrosstrack,
-//			double *rawssalongtrack,
-//			int *error);
-//int mbsys_templatesystem_extract_segytraceheader(int verbose, void *mbio_ptr, void *store_ptr,
-//			int *kind,
-//			void *segytraceheader_ptr,
-//			int *error);
-//int mbsys_templatesystem_extract_segy(int verbose, void *mbio_ptr, void *store_ptr,
-//			int *sampleformat,
-//			int *kind,
-//			void *segytraceheader_ptr,
-//			float *segydata,
-//			int *error);
-//int mbsys_templatesystem_insert_segy(int verbose, void *mbio_ptr, void *store_ptr,
-//			int kind,
-//			void *segytraceheader_ptr,
-//			float *segydata,
-//			int *error);
-//int mbsys_templatesystem_ctd(int verbose, void *mbio_ptr, void *store_ptr,
-//			int *kind, int *nctd, double *time_d,
-//			double *conductivity, double *temperature,
-//			double *depth, double *salinity, double *soundspeed, int *error);
-//int mbsys_templatesystem_ancilliarysensor(int verbose, void *mbio_ptr, void *store_ptr,
-//			int *kind, int *nsensor, double *time_d,
-//			double *sensor1, double *sensor2, double *sensor3,
-//			double *sensor4, double *sensor5, double *sensor6,
-//			double *sensor7, double *sensor8, int *error);
-int mbsys_templatesystem_copy(int verbose, void *mbio_ptr,
-			void *store_ptr, void *copy_ptr,
-			int *error);
-/*---------------------------------------------------------------*/
diff --git a/src/mbio/mbsys_wassp.c b/src/mbio/mbsys_wassp.c
deleted file mode 100644
index ba08ee5..0000000
--- a/src/mbio/mbsys_wassp.c
+++ /dev/null
@@ -1,1814 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbsys_wassp.c	3.00	1/27/2014
- *	$Id: mbsys_wassp.c 2239 2015-05-07 00:51:42Z caress $
- *
- *    Copyright (c) 2014-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbsys_wassp.c contains the MBIO functions for handling data from
- * the following data formats:
- *    MBSYS_WASSP formats (code in mbsys_wassp.c and mbsys_wassp.h):
- *      MBF_WASSPENL : MBIO ID 241 (code in mbr_wasspenl.c)
- *
- * Author:	D. W. Caress
- * Date:	January 27, 2014
- *
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mb_define.h"
-#include "mbsys_wassp.h"
-
-static char version_id[]="$Id: mbsys_wassp.c 2239 2015-05-07 00:51:42Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mbsys_wassp_alloc(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error)
-{
-	const char	*function_name = "mbsys_wassp_alloc";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_wassp_struct *store;
-        struct mbsys_wassp_genbathy_struct *genbathy;
-        struct mbsys_wassp_corbathy_struct *corbathy;
-        struct mbsys_wassp_rawsonar_struct *rawsonar;
-        struct mbsys_wassp_gen_sens_struct *gen_sens;
-        struct mbsys_wassp_nvupdate_struct *nvupdate;
-        struct mbsys_wassp_wcd_navi_struct *wcd_navi;
-        struct mbsys_wassp_sensprop_struct *sensprop;
-        struct mbsys_wassp_sys_prop_struct *sys_prop;
-	struct mbsys_wassp_sys_cfg1_struct *sys_cfg1;
-	struct mbsys_wassp_mcomment_struct *mcomment;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",version_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* allocate memory for data structure */
-	status = mb_mallocd(verbose, __FILE__, __LINE__, sizeof(struct mbsys_wassp_struct),
-				(void **)store_ptr, error);
-
-	/* initialize allocated structure to zero */
-	if (status == MB_SUCCESS)
-		{
-		memset(*store_ptr, 0 , sizeof(struct mbsys_wassp_struct));
-		}
-		
-	/* get data structure pointer */
-	store = (struct mbsys_wassp_struct *) *store_ptr;
-        genbathy = (struct mbsys_wassp_genbathy_struct *) &(store->genbathy);
-        corbathy = (struct mbsys_wassp_corbathy_struct *) &(store->corbathy);
-        rawsonar = (struct mbsys_wassp_rawsonar_struct *) &(store->rawsonar);
-        gen_sens = (struct mbsys_wassp_gen_sens_struct *) &(store->gen_sens);
-        nvupdate = (struct mbsys_wassp_nvupdate_struct *) &(store->nvupdate);
-        wcd_navi = (struct mbsys_wassp_wcd_navi_struct *) &(store->wcd_navi);
-        sensprop = (struct mbsys_wassp_sensprop_struct *) &(store->sensprop);
-        sys_prop = (struct mbsys_wassp_sys_prop_struct *) &(store->sys_prop);
-        sys_cfg1 = (struct mbsys_wassp_sys_cfg1_struct *) &(store->sys_cfg1);
-        mcomment = (struct mbsys_wassp_mcomment_struct *) &(store->mcomment);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)*store_ptr);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_wassp_deall(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_wassp_deall";
-	int	status = MB_SUCCESS;
-	struct mbsys_wassp_struct *store;
-        struct mbsys_wassp_genbathy_struct *genbathy;
-        struct mbsys_wassp_corbathy_struct *corbathy;
-        struct mbsys_wassp_rawsonar_struct *rawsonar;
-        struct mbsys_wassp_gen_sens_struct *gen_sens;
-        struct mbsys_wassp_nvupdate_struct *nvupdate;
-        struct mbsys_wassp_wcd_navi_struct *wcd_navi;
-        struct mbsys_wassp_sensprop_struct *sensprop;
-        struct mbsys_wassp_sys_prop_struct *sys_prop;
-	struct mbsys_wassp_sys_cfg1_struct *sys_cfg1;
-	struct mbsys_wassp_mcomment_struct *mcomment;
-        
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",version_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)*store_ptr);
-		}
-
-	/* get data structure pointer */
-	store = (struct mbsys_wassp_struct *) *store_ptr;
-        genbathy = (struct mbsys_wassp_genbathy_struct *) &(store->genbathy);
-        corbathy = (struct mbsys_wassp_corbathy_struct *) &(store->corbathy);
-        rawsonar = (struct mbsys_wassp_rawsonar_struct *) &(store->rawsonar);
-        gen_sens = (struct mbsys_wassp_gen_sens_struct *) &(store->gen_sens);
-        nvupdate = (struct mbsys_wassp_nvupdate_struct *) &(store->nvupdate);
-        wcd_navi = (struct mbsys_wassp_wcd_navi_struct *) &(store->wcd_navi);
-        sensprop = (struct mbsys_wassp_sensprop_struct *) &(store->sensprop);
-        sys_prop = (struct mbsys_wassp_sys_prop_struct *) &(store->sys_prop);
-        sys_cfg1 = (struct mbsys_wassp_sys_cfg1_struct *) &(store->sys_cfg1);
-        mcomment = (struct mbsys_wassp_mcomment_struct *) &(store->mcomment);
-	
-	/* deallocate any arrays or structures contained within the store data structure */
-	if (rawsonar->rawdata_alloc > 0)
-		{
-		status = mb_freed(verbose, __FILE__, __LINE__, (void **)&(rawsonar->rawdata), error);
-		rawsonar->rawdata_alloc = 0;
-		}
-	if (wcd_navi->wcdata_alloc > 0)
-		{
-		status = mb_freed(verbose, __FILE__, __LINE__, (void **)&(wcd_navi->wcdata_x), error);
-		status = mb_freed(verbose, __FILE__, __LINE__, (void **)&(wcd_navi->wcdata_y), error);
-		status = mb_freed(verbose, __FILE__, __LINE__, (void **)&(wcd_navi->wcdata_mag), error);
-		wcd_navi->wcdata_alloc = 0;
-		}
-	if (sensprop->n_alloc > 0)
-		{
-		status = mb_freed(verbose, __FILE__, __LINE__, (void **)&(sensprop->sensors), error);
-		sensprop->n_alloc = 0;
-		}
-	if (sys_cfg1->sys_cfg1_data_alloc > 0)
-		{
-		status = mb_freed(verbose, __FILE__, __LINE__, (void **)&(sys_cfg1->sys_cfg1_data), error);
-		sys_cfg1->sys_cfg1_data_alloc = 0;
-		}
-
-	/* deallocate memory for data structure */
-	status = mb_freed(verbose, __FILE__, __LINE__, (void **)store_ptr, error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbsys_wassp_dimensions(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int *nbath, int *namp, int *nss, int *error)
-{
-	char	*function_name = "mbsys_wassp_dimensions";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_wassp_struct *store;
-        struct mbsys_wassp_genbathy_struct *genbathy;
-        struct mbsys_wassp_corbathy_struct *corbathy;
-        struct mbsys_wassp_rawsonar_struct *rawsonar;
-        struct mbsys_wassp_gen_sens_struct *gen_sens;
-        struct mbsys_wassp_nvupdate_struct *nvupdate;
-        struct mbsys_wassp_wcd_navi_struct *wcd_navi;
-        struct mbsys_wassp_sensprop_struct *sensprop;
-        struct mbsys_wassp_sys_prop_struct *sys_prop;
-	struct mbsys_wassp_sys_cfg1_struct *sys_cfg1;
-	struct mbsys_wassp_mcomment_struct *mcomment;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",version_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_wassp_struct *) store_ptr;
-        genbathy = (struct mbsys_wassp_genbathy_struct *) &(store->genbathy);
-        corbathy = (struct mbsys_wassp_corbathy_struct *) &(store->corbathy);
-        rawsonar = (struct mbsys_wassp_rawsonar_struct *) &(store->rawsonar);
-        gen_sens = (struct mbsys_wassp_gen_sens_struct *) &(store->gen_sens);
-        nvupdate = (struct mbsys_wassp_nvupdate_struct *) &(store->nvupdate);
-        wcd_navi = (struct mbsys_wassp_wcd_navi_struct *) &(store->wcd_navi);
-        sensprop = (struct mbsys_wassp_sensprop_struct *) &(store->sensprop);
-        sys_prop = (struct mbsys_wassp_sys_prop_struct *) &(store->sys_prop);
-        sys_cfg1 = (struct mbsys_wassp_sys_cfg1_struct *) &(store->sys_cfg1);
-        mcomment = (struct mbsys_wassp_mcomment_struct *) &(store->mcomment);
-	
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get beam and pixel numbers */
-		*nbath = corbathy->num_beams;
-		*namp = corbathy->num_beams;
-		*nss = 0;
-		}
-	else
-		{
-		/* get beam and pixel numbers */
-		*nbath = 0;
-		*namp = 0;
-		*nss = 0;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		fprintf(stderr,"dbg2       nbath:      %d\n",*nbath);
-		fprintf(stderr,"dbg2        namp:      %d\n",*namp);
-		fprintf(stderr,"dbg2        nss:       %d\n",*nss);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_wassp_pingnumber(int verbose, void *mbio_ptr,
-		int *pingnumber, int *error)
-{
-	char	*function_name = "mbsys_wassp_pingnumber";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_wassp_struct *store;
-        struct mbsys_wassp_genbathy_struct *genbathy;
-        struct mbsys_wassp_corbathy_struct *corbathy;
-        struct mbsys_wassp_rawsonar_struct *rawsonar;
-        struct mbsys_wassp_gen_sens_struct *gen_sens;
-        struct mbsys_wassp_nvupdate_struct *nvupdate;
-        struct mbsys_wassp_wcd_navi_struct *wcd_navi;
-        struct mbsys_wassp_sensprop_struct *sensprop;
-        struct mbsys_wassp_sys_prop_struct *sys_prop;
-	struct mbsys_wassp_sys_cfg1_struct *sys_cfg1;
-	struct mbsys_wassp_mcomment_struct *mcomment;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",version_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_wassp_struct *) mb_io_ptr->store_data;
-        genbathy = (struct mbsys_wassp_genbathy_struct *) &(store->genbathy);
-        corbathy = (struct mbsys_wassp_corbathy_struct *) &(store->corbathy);
-        rawsonar = (struct mbsys_wassp_rawsonar_struct *) &(store->rawsonar);
-        gen_sens = (struct mbsys_wassp_gen_sens_struct *) &(store->gen_sens);
-        nvupdate = (struct mbsys_wassp_nvupdate_struct *) &(store->nvupdate);
-        wcd_navi = (struct mbsys_wassp_wcd_navi_struct *) &(store->wcd_navi);
-        sensprop = (struct mbsys_wassp_sensprop_struct *) &(store->sensprop);
-        sys_prop = (struct mbsys_wassp_sys_prop_struct *) &(store->sys_prop);
-        sys_cfg1 = (struct mbsys_wassp_sys_cfg1_struct *) &(store->sys_cfg1);
-        mcomment = (struct mbsys_wassp_mcomment_struct *) &(store->mcomment);
-
-	/* extract data from structure */
-	*pingnumber = corbathy->ping_number;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       pingnumber: %d\n",*pingnumber);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_wassp_sonartype(int verbose, void *mbio_ptr, void *store_ptr,
-		int *sonartype, int *error)
-{
-	char	*function_name = "mbsys_wassp_sonartype";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_wassp_struct *store;
-        struct mbsys_wassp_genbathy_struct *genbathy;
-        struct mbsys_wassp_corbathy_struct *corbathy;
-        struct mbsys_wassp_rawsonar_struct *rawsonar;
-        struct mbsys_wassp_gen_sens_struct *gen_sens;
-        struct mbsys_wassp_nvupdate_struct *nvupdate;
-        struct mbsys_wassp_wcd_navi_struct *wcd_navi;
-        struct mbsys_wassp_sensprop_struct *sensprop;
-        struct mbsys_wassp_sys_prop_struct *sys_prop;
-	struct mbsys_wassp_sys_cfg1_struct *sys_cfg1;
-	struct mbsys_wassp_mcomment_struct *mcomment;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",version_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_wassp_struct *) store_ptr;
-        genbathy = (struct mbsys_wassp_genbathy_struct *) &(store->genbathy);
-        corbathy = (struct mbsys_wassp_corbathy_struct *) &(store->corbathy);
-        rawsonar = (struct mbsys_wassp_rawsonar_struct *) &(store->rawsonar);
-        gen_sens = (struct mbsys_wassp_gen_sens_struct *) &(store->gen_sens);
-        nvupdate = (struct mbsys_wassp_nvupdate_struct *) &(store->nvupdate);
-        wcd_navi = (struct mbsys_wassp_wcd_navi_struct *) &(store->wcd_navi);
-        sensprop = (struct mbsys_wassp_sensprop_struct *) &(store->sensprop);
-        sys_prop = (struct mbsys_wassp_sys_prop_struct *) &(store->sys_prop);
-        sys_cfg1 = (struct mbsys_wassp_sys_cfg1_struct *) &(store->sys_cfg1);
-        mcomment = (struct mbsys_wassp_mcomment_struct *) &(store->mcomment);
-
-	/* get sonar type */
-	*sonartype = MB_TOPOGRAPHY_TYPE_MULTIBEAM;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       sonartype:  %d\n",*sonartype);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_wassp_extract(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int time_i[7], double *time_d,
-		double *navlon, double *navlat,
-		double *speed, double *heading,
-		int *nbath, int *namp, int *nss,
-		char *beamflag, double *bath, double *amp,
-		double *bathacrosstrack, double *bathalongtrack,
-		double *ss, double *ssacrosstrack, double *ssalongtrack,
-		char *comment, int *error)
-{
-	char	*function_name = "mbsys_wassp_extract";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_wassp_struct *store;
-        struct mbsys_wassp_genbathy_struct *genbathy;
-        struct mbsys_wassp_corbathy_struct *corbathy;
-        struct mbsys_wassp_rawsonar_struct *rawsonar;
-        struct mbsys_wassp_gen_sens_struct *gen_sens;
-        struct mbsys_wassp_nvupdate_struct *nvupdate;
-        struct mbsys_wassp_wcd_navi_struct *wcd_navi;
-        struct mbsys_wassp_sensprop_struct *sensprop;
-        struct mbsys_wassp_sys_prop_struct *sys_prop;
-	struct mbsys_wassp_sys_cfg1_struct *sys_cfg1;
-	struct mbsys_wassp_mcomment_struct *mcomment;
-	double	headingx, headingy;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",version_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_wassp_struct *) store_ptr;
-        genbathy = (struct mbsys_wassp_genbathy_struct *) &(store->genbathy);
-        corbathy = (struct mbsys_wassp_corbathy_struct *) &(store->corbathy);
-        rawsonar = (struct mbsys_wassp_rawsonar_struct *) &(store->rawsonar);
-        gen_sens = (struct mbsys_wassp_gen_sens_struct *) &(store->gen_sens);
-        nvupdate = (struct mbsys_wassp_nvupdate_struct *) &(store->nvupdate);
-        wcd_navi = (struct mbsys_wassp_wcd_navi_struct *) &(store->wcd_navi);
-        sensprop = (struct mbsys_wassp_sensprop_struct *) &(store->sensprop);
-        sys_prop = (struct mbsys_wassp_sys_prop_struct *) &(store->sys_prop);
-        sys_cfg1 = (struct mbsys_wassp_sys_cfg1_struct *) &(store->sys_cfg1);
-        mcomment = (struct mbsys_wassp_mcomment_struct *) &(store->mcomment);
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get time */
-		for (i=0;i<7;i++)
-			time_i[i] = store->time_i[i];
-		*time_d = store->time_d;
-
-		/* get navigation */
-		*navlon = corbathy->longitude;
-		*navlat = corbathy->latitude;
-
-		/* get speed */
-		*speed = 1.8520 * nvupdate->sog;
-
-		/* get heading */
-		*heading = corbathy->bearing;
-
-		/* set beamwidths in mb_io structure */
-		mb_io_ptr->beamwidth_xtrack = 4.0;
-		mb_io_ptr->beamwidth_ltrack = 4.0;
-
-		/* get coordinate scaling */
-		headingx = sin(-(*heading)*DTR);
-		headingy = cos(-(*heading)*DTR);
-		
-		/* read distance and depth values into storage arrays */
-		*nbath = corbathy->num_beams;
-		*namp = *nbath;
-		for (i=0;i<genbathy->number_beams;i++)
-			{
-			bath[i] = 0.0;
-			beamflag[i] = MB_FLAG_NULL;
-			bathacrosstrack[i] = 0.0;
-			bathalongtrack[i] = 0.0;
-			amp[i] = 0.0;
-			}
-		for (i=0;i<*nbath;i++)
-			{
-			j = corbathy->beam_index[i];
-			bath[j] = -corbathy->z[i];
-			beamflag[j] = corbathy->empty[i];
-			bathacrosstrack[j] = headingy * corbathy->x[i] + headingx * (-corbathy->y[i]);
-			bathalongtrack[j] = -headingx * corbathy->x[i] + headingy * (-corbathy->y[i]);
-			amp[j] = corbathy->backscatter[i];
-			}
-
-		/* extract sidescan */
-		*nss = 0;
-
-		/* print debug statements */
-		if (verbose >= 5)
-			{
-			fprintf(stderr,"\ndbg4  Data extracted by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  Extracted values:\n");
-			fprintf(stderr,"dbg4       kind:       %d\n", *kind);
-			fprintf(stderr,"dbg4       error:      %d\n", *error);
-			fprintf(stderr,"dbg4       time_i[0]:  %d\n", time_i[0]);
-			fprintf(stderr,"dbg4       time_i[1]:  %d\n", time_i[1]);
-			fprintf(stderr,"dbg4       time_i[2]:  %d\n", time_i[2]);
-			fprintf(stderr,"dbg4       time_i[3]:  %d\n", time_i[3]);
-			fprintf(stderr,"dbg4       time_i[4]:  %d\n", time_i[4]);
-			fprintf(stderr,"dbg4       time_i[5]:  %d\n", time_i[5]);
-			fprintf(stderr,"dbg4       time_i[6]:  %d\n", time_i[6]);
-			fprintf(stderr,"dbg4       time_d:     %f\n", *time_d);
-			fprintf(stderr,"dbg4       longitude:  %f\n", *navlon);
-			fprintf(stderr,"dbg4       latitude:   %f\n", *navlat);
-			fprintf(stderr,"dbg4       speed:      %f\n", *speed);
-			fprintf(stderr,"dbg4       heading:    %f\n", *heading);
-			fprintf(stderr,"dbg4       nbath:      %d\n", *nbath);
-			for (i=0;i<*nbath;i++)
-			  fprintf(stderr,"dbg4       beam:%d  flag:%3d  bath:%f  acrosstrack:%f  alongtrack:%f\n",
-				i,beamflag[i],bath[i],
-				bathacrosstrack[i],bathalongtrack[i]);
-			fprintf(stderr,"dbg4        namp:     %d\n", *namp);
-			for (i=0;i<*namp;i++)
-			  fprintf(stderr,"dbg4        beam:%d   amp:%f  acrosstrack:%f  alongtrack:%f\n",
-				i,amp[i],bathacrosstrack[i],bathalongtrack[i]);
-			fprintf(stderr,"dbg4        nss:      %d\n", *nss);
-			for (i=0;i<*nss;i++)
-			  fprintf(stderr,"dbg4        pixel:%d   ss:%f  acrosstrack:%f  alongtrack:%f\n",
-				i,ss[i],ssacrosstrack[i],ssalongtrack[i]);
-			}
-
-		/* done translating values */
-
-		}
-
-	/* extract data from structure */
-	else if (*kind == MB_DATA_NAV)
-		{
-		/* get time */
-		for (i=0;i<7;i++)
-			time_i[i] = store->time_i[i];
-		*time_d = store->time_d;
-
-		/* get navigation */
-		*navlon = nvupdate->longitude;
-		*navlat = nvupdate->latitude;
-
-		/* get speed */
-		*speed = 1.8520 * nvupdate->sog;
-
-		/* get heading */
-		*heading = nvupdate->heading;
-
-		/* set beam and pixel numbers */
-		*nbath = 0;
-		*namp = 0;
-		*nss = 0;
-
-		/* print debug statements */
-		if (verbose >= 5)
-			{
-			fprintf(stderr,"\ndbg4  Data extracted by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  Extracted values:\n");
-			fprintf(stderr,"dbg4       kind:       %d\n", *kind);
-			fprintf(stderr,"dbg4       error:      %d\n", *error);
-			fprintf(stderr,"dbg4       time_i[0]:  %d\n", time_i[0]);
-			fprintf(stderr,"dbg4       time_i[1]:  %d\n", time_i[1]);
-			fprintf(stderr,"dbg4       time_i[2]:  %d\n", time_i[2]);
-			fprintf(stderr,"dbg4       time_i[3]:  %d\n", time_i[3]);
-			fprintf(stderr,"dbg4       time_i[4]:  %d\n", time_i[4]);
-			fprintf(stderr,"dbg4       time_i[5]:  %d\n", time_i[5]);
-			fprintf(stderr,"dbg4       time_i[6]:  %d\n", time_i[6]);
-			fprintf(stderr,"dbg4       time_d:     %f\n", *time_d);
-			fprintf(stderr,"dbg4       longitude:  %f\n", *navlon);
-			fprintf(stderr,"dbg4       latitude:   %f\n", *navlat);
-			fprintf(stderr,"dbg4       speed:      %f\n", *speed);
-			fprintf(stderr,"dbg4       heading:    %f\n", *heading);
-			}
-
-		/* done translating values */
-
-		}
-
-	/* extract comment from structure */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* get time */
-		for (i=0;i<7;i++)
-			time_i[i] = store->time_i[i];
-		*time_d = store->time_d;
-
-		/* copy comment */
-		if (mcomment->comment_length > 0)
-			strncpy(comment, mcomment->comment_message, MIN(mcomment->comment_length, MB_COMMENT_MAXLINE));
-		else
-			comment[0] = '\0';
-
-		/* print debug statements */
-		if (verbose >= 4)
-			{
-			fprintf(stderr,"\ndbg4  Comment extracted by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  New ping values:\n");
-			fprintf(stderr,"dbg4       kind:       %d\n", *kind);
-			fprintf(stderr,"dbg4       error:      %d\n", *error);
-			fprintf(stderr,"dbg4       time_i[0]:  %d\n", time_i[0]);
-			fprintf(stderr,"dbg4       time_i[1]:  %d\n", time_i[1]);
-			fprintf(stderr,"dbg4       time_i[2]:  %d\n", time_i[2]);
-			fprintf(stderr,"dbg4       time_i[3]:  %d\n", time_i[3]);
-			fprintf(stderr,"dbg4       time_i[4]:  %d\n", time_i[4]);
-			fprintf(stderr,"dbg4       time_i[5]:  %d\n", time_i[5]);
-			fprintf(stderr,"dbg4       time_i[6]:  %d\n", time_i[6]);
-			fprintf(stderr,"dbg4       time_d:     %f\n", *time_d);
-			fprintf(stderr,"dbg4       comment:    %s\n", comment);
-			}
-		}
-
-	/* set time for other data records */
-	else
-		{
-		/* get time */
-		for (i=0;i<7;i++)
-			time_i[i] = store->time_i[i];
-		*time_d = store->time_d;
-
-		/* print debug statements */
-		if (verbose >= 4)
-			{
-			fprintf(stderr,"\ndbg4  Data extracted by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  Extracted values:\n");
-			fprintf(stderr,"dbg4       kind:       %d\n",*kind);
-			fprintf(stderr,"dbg4       error:      %d\n",*error);
-			fprintf(stderr,"dbg4       time_i[0]:  %d\n",time_i[0]);
-			fprintf(stderr,"dbg4       time_i[1]:  %d\n",time_i[1]);
-			fprintf(stderr,"dbg4       time_i[2]:  %d\n",time_i[2]);
-			fprintf(stderr,"dbg4       time_i[3]:  %d\n",time_i[3]);
-			fprintf(stderr,"dbg4       time_i[4]:  %d\n",time_i[4]);
-			fprintf(stderr,"dbg4       time_i[5]:  %d\n",time_i[5]);
-			fprintf(stderr,"dbg4       time_i[6]:  %d\n",time_i[6]);
-			fprintf(stderr,"dbg4       time_d:     %f\n",*time_d);
-			fprintf(stderr,"dbg4       comment:    %s\n",comment);
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind == MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"dbg2       comment:     \ndbg2       %s\n",
-			comment);
-		}
-	else if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind != MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"dbg2       time_i[0]:     %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:     %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:     %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:     %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:     %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:     %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:     %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:        %f\n",*time_d);
-		}
-	if (verbose >= 2 && (*kind == MB_DATA_DATA || *kind == MB_DATA_NAV))
-		{
-		fprintf(stderr,"dbg2       longitude:     %f\n",*navlon);
-		fprintf(stderr,"dbg2       latitude:      %f\n",*navlat);
-		fprintf(stderr,"dbg2       speed:         %f\n",*speed);
-		fprintf(stderr,"dbg2       heading:       %f\n",*heading);
-		}
-	if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind == MB_DATA_DATA)
-		{
-		fprintf(stderr,"dbg2       nbath:      %d\n",
-			*nbath);
-		for (i=0;i<*nbath;i++)
-		  fprintf(stderr,"dbg2       beam:%d  flag:%3d  bath:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,beamflag[i],bath[i],
-			bathacrosstrack[i],bathalongtrack[i]);
-		fprintf(stderr,"dbg2        namp:     %d\n",
-			*namp);
-		for (i=0;i<*namp;i++)
-		  fprintf(stderr,"dbg2       beam:%d   amp:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,amp[i],bathacrosstrack[i],bathalongtrack[i]);
-		fprintf(stderr,"dbg2        nss:      %d\n",
-			*nss);
-		for (i=0;i<*nss;i++)
-		  fprintf(stderr,"dbg2        pixel:%d   ss:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,ss[i],ssacrosstrack[i],ssalongtrack[i]);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_wassp_insert(int verbose, void *mbio_ptr, void *store_ptr,
-		int kind, int time_i[7], double time_d,
-		double navlon, double navlat,
-		double speed, double heading,
-		int nbath, int namp, int nss,
-		char *beamflag, double *bath, double *amp,
-		double *bathacrosstrack, double *bathalongtrack,
-		double *ss, double *ssacrosstrack, double *ssalongtrack,
-		char *comment, int *error)
-{
-	char	*function_name = "mbsys_wassp_insert";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_wassp_struct *store;
-        struct mbsys_wassp_genbathy_struct *genbathy;
-        struct mbsys_wassp_corbathy_struct *corbathy;
-        struct mbsys_wassp_rawsonar_struct *rawsonar;
-        struct mbsys_wassp_gen_sens_struct *gen_sens;
-        struct mbsys_wassp_nvupdate_struct *nvupdate;
-        struct mbsys_wassp_wcd_navi_struct *wcd_navi;
-        struct mbsys_wassp_sensprop_struct *sensprop;
-        struct mbsys_wassp_sys_prop_struct *sys_prop;
-	struct mbsys_wassp_sys_cfg1_struct *sys_cfg1;
-	struct mbsys_wassp_mcomment_struct *mcomment;
-	double	headingx, headingy;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",version_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       kind:       %d\n",kind);
-		}
-	if (verbose >= 2 && kind == MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"dbg2       comment:     \ndbg2       %s\n",
-			comment);
-		}
-	if (verbose >= 2 && (kind != MB_DATA_COMMENT))
-		{
-		fprintf(stderr,"dbg2       time_i[0]:  %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:  %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:  %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:  %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:  %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:  %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:  %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:     %f\n",time_d);
-		}
-	if (verbose >= 2 && (kind == MB_DATA_DATA || kind == MB_DATA_NAV))
-		{
-		fprintf(stderr,"dbg2       navlon:     %f\n",navlon);
-		fprintf(stderr,"dbg2       navlat:     %f\n",navlat);
-		fprintf(stderr,"dbg2       speed:      %f\n",speed);
-		fprintf(stderr,"dbg2       heading:    %f\n",heading);
-		}
-	if (verbose >= 2 && kind == MB_DATA_DATA)
-		{
-		fprintf(stderr,"dbg2       nbath:      %d\n",nbath);
-		if (verbose >= 3)
-		 for (i=0;i<nbath;i++)
-		  fprintf(stderr,"dbg3       beam:%d  flag:%3d  bath:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,beamflag[i],bath[i],
-			bathacrosstrack[i],bathalongtrack[i]);
-		fprintf(stderr,"dbg2       namp:       %d\n",namp);
-		if (verbose >= 3)
-		 for (i=0;i<namp;i++)
-		  fprintf(stderr,"dbg3        beam:%d   amp:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,amp[i],bathacrosstrack[i],bathalongtrack[i]);
-		fprintf(stderr,"dbg2        nss:       %d\n",nss);
-		if (verbose >= 3)
-		 for (i=0;i<nss;i++)
-		  fprintf(stderr,"dbg3        beam:%d   ss:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,ss[i],ssacrosstrack[i],ssalongtrack[i]);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_wassp_struct *) store_ptr;
-        genbathy = (struct mbsys_wassp_genbathy_struct *) &(store->genbathy);
-        corbathy = (struct mbsys_wassp_corbathy_struct *) &(store->corbathy);
-        rawsonar = (struct mbsys_wassp_rawsonar_struct *) &(store->rawsonar);
-        gen_sens = (struct mbsys_wassp_gen_sens_struct *) &(store->gen_sens);
-        nvupdate = (struct mbsys_wassp_nvupdate_struct *) &(store->nvupdate);
-        wcd_navi = (struct mbsys_wassp_wcd_navi_struct *) &(store->wcd_navi);
-        sensprop = (struct mbsys_wassp_sensprop_struct *) &(store->sensprop);
-        sys_prop = (struct mbsys_wassp_sys_prop_struct *) &(store->sys_prop);
-        sys_cfg1 = (struct mbsys_wassp_sys_cfg1_struct *) &(store->sys_cfg1);
-        mcomment = (struct mbsys_wassp_mcomment_struct *) &(store->mcomment);
-
-	/* set data kind */
-	store->kind = kind;
-
-	/* insert data in structure */
-	if (store->kind == MB_DATA_DATA)
-		{
-		/* get time */
-		for (i=0;i<7;i++)
-			store->time_i[i] = time_i[i];
-		store->time_d = time_d;
-
-		/* get navigation */
-		corbathy->longitude = navlon;
-		corbathy->latitude = navlat;
-
-		/* get heading */
-		corbathy->bearing = heading;
-
-		/* get speed  */
-
-		/* get coordinate scaling */
-		headingx = sin(heading*DTR);
-		headingy = cos(heading*DTR);
-
-		/* read distance and depth values into storage arrays */
-		for (i=0;i<corbathy->num_beams;i++)
-			{
-			j = corbathy->beam_index[i];
-			corbathy->z[i] = -bath[j];
-			corbathy->empty[i] = beamflag[j];
-			corbathy->x[i] = headingy * bathacrosstrack[j] + headingx * bathalongtrack[j];
-			corbathy->y[i] = -(-headingx * bathacrosstrack[j] + headingy * bathalongtrack[j]);
-			corbathy->backscatter[i] = amp[j];
-			}
-
-		/* insert the sidescan */
-		}
-
-	/* insert data in nav structure */
-	else if (store->kind == MB_DATA_NAV)
-		{
-		/* get time */
-		for (i=0;i<7;i++)
-			store->time_i[i] = time_i[i];
-		store->time_d = time_d;
-
-
-		/* get navigation */
-		nvupdate->longitude = navlon;
-		nvupdate->latitude = navlat;
-
-		/* get heading */
-		nvupdate->heading = heading;
-
-		/* get speed  */
-		nvupdate->sog = speed / 1.8520;
-		}
-
-	/* insert comment in structure */
-	else if (store->kind == MB_DATA_COMMENT)
-		{
-		strncpy(mcomment->comment_message, comment, MB_COMMENT_MAXLINE);
-		mcomment->comment_length = strlen(comment);
-		if (mcomment->comment_length % 2 == 1)
-			{
-			mcomment->comment_length++;
-			mcomment->comment_message[mcomment->comment_length] = '\0';
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_wassp_ttimes(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, int *nbeams,
-	double *ttimes, double *angles,
-	double *angles_forward, double *angles_null,
-	double *heave, double *alongtrack_offset,
-	double *draft, double *ssv, int *error)
-{
-	char	*function_name = "mbsys_wassp_ttimes";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_wassp_struct *store;
-        struct mbsys_wassp_genbathy_struct *genbathy;
-        struct mbsys_wassp_corbathy_struct *corbathy;
-        struct mbsys_wassp_rawsonar_struct *rawsonar;
-        struct mbsys_wassp_gen_sens_struct *gen_sens;
-        struct mbsys_wassp_nvupdate_struct *nvupdate;
-        struct mbsys_wassp_wcd_navi_struct *wcd_navi;
-        struct mbsys_wassp_sensprop_struct *sensprop;
-        struct mbsys_wassp_sys_prop_struct *sys_prop;
-	struct mbsys_wassp_sys_cfg1_struct *sys_cfg1;
-	struct mbsys_wassp_mcomment_struct *mcomment;
-	double	alpha, beta, theta, phi;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",version_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       ttimes:     %p\n",(void *)ttimes);
-		fprintf(stderr,"dbg2       angles_xtrk:%p\n",(void *)angles);
-		fprintf(stderr,"dbg2       angles_ltrk:%p\n",(void *)angles_forward);
-		fprintf(stderr,"dbg2       angles_null:%p\n",(void *)angles_null);
-		fprintf(stderr,"dbg2       heave:      %p\n",(void *)heave);
-		fprintf(stderr,"dbg2       ltrk_off:   %p\n",(void *)alongtrack_offset);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_wassp_struct *) store_ptr;
-        genbathy = (struct mbsys_wassp_genbathy_struct *) &(store->genbathy);
-        corbathy = (struct mbsys_wassp_corbathy_struct *) &(store->corbathy);
-        rawsonar = (struct mbsys_wassp_rawsonar_struct *) &(store->rawsonar);
-        gen_sens = (struct mbsys_wassp_gen_sens_struct *) &(store->gen_sens);
-        nvupdate = (struct mbsys_wassp_nvupdate_struct *) &(store->nvupdate);
-        wcd_navi = (struct mbsys_wassp_wcd_navi_struct *) &(store->wcd_navi);
-        sensprop = (struct mbsys_wassp_sensprop_struct *) &(store->sensprop);
-        sys_prop = (struct mbsys_wassp_sys_prop_struct *) &(store->sys_prop);
-        sys_cfg1 = (struct mbsys_wassp_sys_cfg1_struct *) &(store->sys_cfg1);
-        mcomment = (struct mbsys_wassp_mcomment_struct *) &(store->mcomment);
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get depth offset (heave + sonar depth) */
-		*ssv = genbathy->sound_velocity;
-
-		/* get draft */
-		*draft = 0.0;
-
-		/* get travel times, angles */
-		*nbeams = genbathy->number_beams;
-		for (i=0;i<*nbeams;i++)
-			{
-			ttimes[i] = genbathy->detection_point[i]
-					/ genbathy->sampling_frequency;
-
-			alpha = nvupdate->pitch;
-			beta = 90.0 + genbathy->rx_angle[i] - nvupdate->roll;
-
-			mb_rollpitch_to_takeoff(verbose, alpha, beta,
-						&theta, &phi, error);
-			angles[i] = theta;
-			angles_forward[i] = phi;
-			angles_null[i] = 0.0;
-			heave[i] = nvupdate->heave;
-			alongtrack_offset[i] = 0.0;
-			}
-
-		/* set status */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error == MB_ERROR_NO_ERROR)
-		{
-		fprintf(stderr,"dbg2       draft:      %f\n",*draft);
-		fprintf(stderr,"dbg2       ssv:        %f\n",*ssv);
-		fprintf(stderr,"dbg2       nbeams:     %d\n",*nbeams);
-		for (i=0;i<*nbeams;i++)
-			fprintf(stderr,"dbg2       beam %d: tt:%f  angle_xtrk:%f  angle_ltrk:%f  angle_null:%f  depth_off:%f  ltrk_off:%f\n",
-				i,ttimes[i],angles[i],
-				angles_forward[i],angles_null[i],
-				heave[i],alongtrack_offset[i]);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_wassp_detects(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, int *nbeams, int *detects, int *error)
-{
-	char	*function_name = "mbsys_wassp_detects";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_wassp_struct *store;
-        struct mbsys_wassp_genbathy_struct *genbathy;
-        struct mbsys_wassp_corbathy_struct *corbathy;
-        struct mbsys_wassp_rawsonar_struct *rawsonar;
-        struct mbsys_wassp_gen_sens_struct *gen_sens;
-        struct mbsys_wassp_nvupdate_struct *nvupdate;
-        struct mbsys_wassp_wcd_navi_struct *wcd_navi;
-        struct mbsys_wassp_sensprop_struct *sensprop;
-        struct mbsys_wassp_sys_prop_struct *sys_prop;
-	struct mbsys_wassp_sys_cfg1_struct *sys_cfg1;
-	struct mbsys_wassp_mcomment_struct *mcomment;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",version_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       detects:    %p\n",(void *)detects);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_wassp_struct *) store_ptr;
-        genbathy = (struct mbsys_wassp_genbathy_struct *) &(store->genbathy);
-        corbathy = (struct mbsys_wassp_corbathy_struct *) &(store->corbathy);
-        rawsonar = (struct mbsys_wassp_rawsonar_struct *) &(store->rawsonar);
-        gen_sens = (struct mbsys_wassp_gen_sens_struct *) &(store->gen_sens);
-        nvupdate = (struct mbsys_wassp_nvupdate_struct *) &(store->nvupdate);
-        wcd_navi = (struct mbsys_wassp_wcd_navi_struct *) &(store->wcd_navi);
-        sensprop = (struct mbsys_wassp_sensprop_struct *) &(store->sensprop);
-        sys_prop = (struct mbsys_wassp_sys_prop_struct *) &(store->sys_prop);
-        sys_cfg1 = (struct mbsys_wassp_sys_cfg1_struct *) &(store->sys_cfg1);
-        mcomment = (struct mbsys_wassp_mcomment_struct *) &(store->mcomment);
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get detect type for each sounding - options include:
-			MB_DETECT_UNKNOWN
-			MB_DETECT_AMPLITUDE
-			MB_DETECT_PHASE
-			MB_DETECT_LIDAR */
-		*nbeams = genbathy->number_beams;
-		for (i=0;i<*nbeams;i++)
-			{
-			if ((genbathy->flags[i] & 0xF) == 0x7)
-				detects[i] = MB_DETECT_AMPLITUDE;
-			else if ((genbathy->flags[i] & 0xF) == 0xB)
-				detects[i] = MB_DETECT_PHASE;
-			else
-				detects[i] = MB_DETECT_UNKNOWN;
-			}
-
-		/* set status */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error == MB_ERROR_NO_ERROR)
-		{
-		fprintf(stderr,"dbg2       nbeams:     %d\n",*nbeams);
-		for (i=0;i<*nbeams;i++)
-			fprintf(stderr,"dbg2       beam %d: detects:%d\n",
-				i,detects[i]);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_wassp_gains(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, double *transmit_gain, double *pulse_length,
-			double *receive_gain, int *error)
-{
-	char	*function_name = "mbsys_wassp_gains";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_wassp_struct *store;
-        struct mbsys_wassp_genbathy_struct *genbathy;
-        struct mbsys_wassp_corbathy_struct *corbathy;
-        struct mbsys_wassp_rawsonar_struct *rawsonar;
-        struct mbsys_wassp_gen_sens_struct *gen_sens;
-        struct mbsys_wassp_nvupdate_struct *nvupdate;
-        struct mbsys_wassp_wcd_navi_struct *wcd_navi;
-        struct mbsys_wassp_sensprop_struct *sensprop;
-        struct mbsys_wassp_sys_prop_struct *sys_prop;
-	struct mbsys_wassp_sys_cfg1_struct *sys_cfg1;
-	struct mbsys_wassp_mcomment_struct *mcomment;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",version_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_wassp_struct *) store_ptr;
-        genbathy = (struct mbsys_wassp_genbathy_struct *) &(store->genbathy);
-        corbathy = (struct mbsys_wassp_corbathy_struct *) &(store->corbathy);
-        rawsonar = (struct mbsys_wassp_rawsonar_struct *) &(store->rawsonar);
-        gen_sens = (struct mbsys_wassp_gen_sens_struct *) &(store->gen_sens);
-        nvupdate = (struct mbsys_wassp_nvupdate_struct *) &(store->nvupdate);
-        wcd_navi = (struct mbsys_wassp_wcd_navi_struct *) &(store->wcd_navi);
-        sensprop = (struct mbsys_wassp_sensprop_struct *) &(store->sensprop);
-        sys_prop = (struct mbsys_wassp_sys_prop_struct *) &(store->sys_prop);
-        sys_cfg1 = (struct mbsys_wassp_sys_cfg1_struct *) &(store->sys_cfg1);
-        mcomment = (struct mbsys_wassp_mcomment_struct *) &(store->mcomment);
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get transmit_gain (dB) */
-		*transmit_gain = genbathy->tx_power;
-
-		/* get pulse_length (usec) */
-		*pulse_length = genbathy->pulse_width;
-
-		/* get receive_gain (dB) */
-		*receive_gain = 0.0;
-
-		/* set status */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error == MB_ERROR_NO_ERROR)
-		{
-		fprintf(stderr,"dbg2       transmit_gain: %f\n",*transmit_gain);
-		fprintf(stderr,"dbg2       pulse_length:  %f\n",*pulse_length);
-		fprintf(stderr,"dbg2       receive_gain:  %f\n",*receive_gain);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_wassp_extract_altitude(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, double *transducer_depth, double *altitude,
-	int *error)
-{
-	char	*function_name = "mbsys_wassp_extract_altitude";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_wassp_struct *store;
-        struct mbsys_wassp_genbathy_struct *genbathy;
-        struct mbsys_wassp_corbathy_struct *corbathy;
-        struct mbsys_wassp_rawsonar_struct *rawsonar;
-        struct mbsys_wassp_gen_sens_struct *gen_sens;
-        struct mbsys_wassp_nvupdate_struct *nvupdate;
-        struct mbsys_wassp_wcd_navi_struct *wcd_navi;
-        struct mbsys_wassp_sensprop_struct *sensprop;
-        struct mbsys_wassp_sys_prop_struct *sys_prop;
-	struct mbsys_wassp_sys_cfg1_struct *sys_cfg1;
-	struct mbsys_wassp_mcomment_struct *mcomment;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",version_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_wassp_struct *) store_ptr;
-        genbathy = (struct mbsys_wassp_genbathy_struct *) &(store->genbathy);
-        corbathy = (struct mbsys_wassp_corbathy_struct *) &(store->corbathy);
-        rawsonar = (struct mbsys_wassp_rawsonar_struct *) &(store->rawsonar);
-        gen_sens = (struct mbsys_wassp_gen_sens_struct *) &(store->gen_sens);
-        nvupdate = (struct mbsys_wassp_nvupdate_struct *) &(store->nvupdate);
-        wcd_navi = (struct mbsys_wassp_wcd_navi_struct *) &(store->wcd_navi);
-        sensprop = (struct mbsys_wassp_sensprop_struct *) &(store->sensprop);
-        sys_prop = (struct mbsys_wassp_sys_prop_struct *) &(store->sys_prop);
-        sys_cfg1 = (struct mbsys_wassp_sys_cfg1_struct *) &(store->sys_cfg1);
-        mcomment = (struct mbsys_wassp_mcomment_struct *) &(store->mcomment);
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get transducer depth and altitude */
-		*transducer_depth = -nvupdate->heave;
-
-		/* get altitude */
-		*altitude = nvupdate->nadir_depth + nvupdate->heave;
-
-		/* set status */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:              %d\n",*kind);
-		fprintf(stderr,"dbg2       transducer_depth:  %f\n",*transducer_depth);
-		fprintf(stderr,"dbg2       altitude:          %f\n",*altitude);
-		fprintf(stderr,"dbg2       error:             %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:            %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_wassp_extract_nav(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int time_i[7], double *time_d,
-		double *navlon, double *navlat,
-		double *speed, double *heading, double *draft,
-		double *roll, double *pitch, double *heave,
-		int *error)
-{
-	char	*function_name = "mbsys_wassp_extract_nav";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_wassp_struct *store;
-        struct mbsys_wassp_genbathy_struct *genbathy;
-        struct mbsys_wassp_corbathy_struct *corbathy;
-        struct mbsys_wassp_rawsonar_struct *rawsonar;
-        struct mbsys_wassp_gen_sens_struct *gen_sens;
-        struct mbsys_wassp_nvupdate_struct *nvupdate;
-        struct mbsys_wassp_wcd_navi_struct *wcd_navi;
-        struct mbsys_wassp_sensprop_struct *sensprop;
-        struct mbsys_wassp_sys_prop_struct *sys_prop;
-	struct mbsys_wassp_sys_cfg1_struct *sys_cfg1;
-	struct mbsys_wassp_mcomment_struct *mcomment;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",version_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_wassp_struct *) store_ptr;
-        genbathy = (struct mbsys_wassp_genbathy_struct *) &(store->genbathy);
-        corbathy = (struct mbsys_wassp_corbathy_struct *) &(store->corbathy);
-        rawsonar = (struct mbsys_wassp_rawsonar_struct *) &(store->rawsonar);
-        gen_sens = (struct mbsys_wassp_gen_sens_struct *) &(store->gen_sens);
-        nvupdate = (struct mbsys_wassp_nvupdate_struct *) &(store->nvupdate);
-        wcd_navi = (struct mbsys_wassp_wcd_navi_struct *) &(store->wcd_navi);
-        sensprop = (struct mbsys_wassp_sensprop_struct *) &(store->sensprop);
-        sys_prop = (struct mbsys_wassp_sys_prop_struct *) &(store->sys_prop);
-        sys_cfg1 = (struct mbsys_wassp_sys_cfg1_struct *) &(store->sys_cfg1);
-        mcomment = (struct mbsys_wassp_mcomment_struct *) &(store->mcomment);
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from survey record */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get time */
-		for (i=0;i<7;i++)
-			time_i[i] = store->time_i[i];
-		*time_d = store->time_d;
-
-		/* get navigation */
-		*navlon = corbathy->longitude;
-		*navlat = corbathy->latitude;
-
-		/* get speed */
-		*speed = 1.8520 * nvupdate->sog;
-
-		/* get heading */
-		*heading = corbathy->bearing;
-
-		/* get draft  */
-		*draft = 0.0;
-
-		/* get attitude  */
-		*roll = corbathy->roll;
-		*pitch = corbathy->pitch;
-		*heave = corbathy->heave;
-
-		/* done translating values */
-		}
-
-	/* extract data from nav record */
-	else if (*kind == MB_DATA_NAV)
-		{
-		/* get time */
-		for (i=0;i<7;i++)
-			time_i[i] = store->time_i[i];
-		*time_d = store->time_d;
-
-		/* get navigation */
-		*navlon = nvupdate->longitude;
-		*navlat = nvupdate->latitude;
-
-		/* get speed */
-		*speed = 1.8520 * nvupdate->sog;
-
-		/* get heading */
-		*heading = nvupdate->heading;
-
-		/* get draft  */
-		*draft = 0.0;
-
-		/* get attitude  */
-		*roll = nvupdate->roll;
-		*pitch = nvupdate->pitch;
-		*heave = nvupdate->heave;
-
-		/* done translating values */
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-
-		/* get time */
-		for (i=0;i<7;i++)
-			time_i[i] = store->time_i[i];
-		*time_d = store->time_d;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-
-		/* get time */
-		for (i=0;i<7;i++)
-			time_i[i] = store->time_i[i];
-		*time_d = store->time_d;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:          %d\n",*kind);
-		fprintf(stderr,"dbg2       time_i[0]:     %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:     %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:     %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:     %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:     %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:     %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:     %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:        %f\n",*time_d);
-		fprintf(stderr,"dbg2       longitude:     %f\n",*navlon);
-		fprintf(stderr,"dbg2       latitude:      %f\n",*navlat);
-		fprintf(stderr,"dbg2       speed:         %f\n",*speed);
-		fprintf(stderr,"dbg2       heading:       %f\n",*heading);
-		fprintf(stderr,"dbg2       draft:         %f\n",*draft);
-		fprintf(stderr,"dbg2       roll:          %f\n",*roll);
-		fprintf(stderr,"dbg2       pitch:         %f\n",*pitch);
-		fprintf(stderr,"dbg2       heave:         %f\n",*heave);
-		fprintf(stderr,"dbg2       error:         %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:        %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_wassp_insert_nav(int verbose, void *mbio_ptr, void *store_ptr,
-		int time_i[7], double time_d,
-		double navlon, double navlat,
-		double speed, double heading, double draft,
-		double roll, double pitch, double heave,
-		int *error)
-{
-	char	*function_name = "mbsys_wassp_insert_nav";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_wassp_struct *store;
-        struct mbsys_wassp_genbathy_struct *genbathy;
-        struct mbsys_wassp_corbathy_struct *corbathy;
-        struct mbsys_wassp_rawsonar_struct *rawsonar;
-        struct mbsys_wassp_gen_sens_struct *gen_sens;
-        struct mbsys_wassp_nvupdate_struct *nvupdate;
-        struct mbsys_wassp_wcd_navi_struct *wcd_navi;
-        struct mbsys_wassp_sensprop_struct *sensprop;
-        struct mbsys_wassp_sys_prop_struct *sys_prop;
-	struct mbsys_wassp_sys_cfg1_struct *sys_cfg1;
-	struct mbsys_wassp_mcomment_struct *mcomment;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",version_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       time_i[0]:  %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:  %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:  %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:  %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:  %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:  %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:  %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:     %f\n",time_d);
-		fprintf(stderr,"dbg2       navlon:     %f\n",navlon);
-		fprintf(stderr,"dbg2       navlat:     %f\n",navlat);
-		fprintf(stderr,"dbg2       speed:      %f\n",speed);
-		fprintf(stderr,"dbg2       heading:    %f\n",heading);
-		fprintf(stderr,"dbg2       draft:      %f\n",draft);
-		fprintf(stderr,"dbg2       roll:       %f\n",roll);
-		fprintf(stderr,"dbg2       pitch:      %f\n",pitch);
-		fprintf(stderr,"dbg2       heave:      %f\n",heave);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_wassp_struct *) store_ptr;
-        genbathy = (struct mbsys_wassp_genbathy_struct *) &(store->genbathy);
-        corbathy = (struct mbsys_wassp_corbathy_struct *) &(store->corbathy);
-        rawsonar = (struct mbsys_wassp_rawsonar_struct *) &(store->rawsonar);
-        gen_sens = (struct mbsys_wassp_gen_sens_struct *) &(store->gen_sens);
-        nvupdate = (struct mbsys_wassp_nvupdate_struct *) &(store->nvupdate);
-        wcd_navi = (struct mbsys_wassp_wcd_navi_struct *) &(store->wcd_navi);
-        sensprop = (struct mbsys_wassp_sensprop_struct *) &(store->sensprop);
-        sys_prop = (struct mbsys_wassp_sys_prop_struct *) &(store->sys_prop);
-        sys_cfg1 = (struct mbsys_wassp_sys_cfg1_struct *) &(store->sys_cfg1);
-        mcomment = (struct mbsys_wassp_mcomment_struct *) &(store->mcomment);
-
-	/* insert data in ping structure */
-	if (store->kind == MB_DATA_DATA)
-		{
-		/* get time */
-		for (i=0;i<7;i++)
-			store->time_i[i] = time_i[i];
-		store->time_d = time_d;
-
-		/* get navigation */
-		corbathy->longitude = navlon;
-		corbathy->latitude = navlat;
-
-		/* get heading */
-		corbathy->bearing = heading;
-
-		/* get draft  */
-
-		/* get roll pitch and heave */
-		corbathy->heave = heave;
-		corbathy->pitch = pitch;
-		corbathy->roll = roll;
-		}
-
-	/* insert data in nav structure */
-	else if (store->kind == MB_DATA_NAV)
-		{
-		/* get time */
-		for (i=0;i<7;i++)
-			store->time_i[i] = time_i[i];
-		store->time_d = time_d;
-
-		/* get navigation */
-		nvupdate->longitude = navlon;
-		nvupdate->latitude = navlat;
-
-		/* get speed  */
-		nvupdate->sog = speed / 1.8520;
-
-		/* get heading */
-		nvupdate->heading = heading;
-
-		/* get draft  */
-
-		/* get roll pitch and heave */
-		nvupdate->heave = heave;
-		nvupdate->pitch = pitch;
-		nvupdate->roll = roll;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_wassp_copy(int verbose, void *mbio_ptr,
-			void *store_ptr, void *copy_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_wassp_copy";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_wassp_struct *store;
-	struct mbsys_wassp_struct *copy;
-        size_t	rawdata_alloc_save;
-        short	*rawdata_save;
-        size_t	wcdata_alloc_save;
-        float	*wcdata_x_save;
-        float	*wcdata_y_save;
-        float	*wcdata_mag_save;
-        size_t	sys_cfg1_data_alloc_save;
-        char	*sys_cfg1_data_save;
-	size_t	copy_len;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",version_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       copy_ptr:   %p\n",(void *)copy_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointers */
-	store = (struct mbsys_wassp_struct *) store_ptr;
-	copy = (struct mbsys_wassp_struct *) copy_ptr;
-	
-	/* copy the data - for many formats memory must be allocated and
-		sub-structures copied separately */
-	/* Type of most recently read data record */
-	copy->kind = store->kind;
-
-	/* MB-System time stamp of most recently read record */
-	copy->time_d = store->time_d;
-	for (i=0;i<7;i++)
-		copy->time_i[i] = store->time_i[i];
-
-        /* GENBATHY record */
-	copy->genbathy = store->genbathy;
-
-        /* CORBATHY record */
-	copy->corbathy = store->corbathy;
-
-        /* RAWSONAR record */
-	rawdata_alloc_save = copy->rawsonar.rawdata_alloc;
-	rawdata_save = copy->rawsonar.rawdata;
-	copy->rawsonar = store->rawsonar;
-	copy->rawsonar.rawdata_alloc = rawdata_alloc_save;
-	copy->rawsonar.rawdata = rawdata_save;
-	if (status == MB_SUCCESS
-		&& copy->rawsonar.rawdata_alloc < store->rawsonar.rawdata_alloc)
-		{
-		status = mb_reallocd(verbose, __FILE__, __LINE__, store->rawsonar.rawdata_alloc,
-					(void **)&(copy->rawsonar.rawdata), error);
-		if (status == MB_SUCCESS)
-			{
-			copy->rawsonar.rawdata_alloc = store->rawsonar.rawdata_alloc;
-			copy_len = (size_t)(copy->rawsonar.n * copy->rawsonar.m);
-			memcpy(copy->rawsonar.rawdata, store->rawsonar.rawdata, copy_len);
-			}
-		}
-
-        /* GEN_SENS record */
-	copy->kind = store->kind;
-
-        /* NVUPDATE record */
-	copy->nvupdate = store->nvupdate;
-
-        /* WCD_NAVI record */
-        wcdata_alloc_save = copy->wcd_navi.wcdata_alloc;
-        wcdata_x_save = copy->wcd_navi.wcdata_x;
-        wcdata_y_save = copy->wcd_navi.wcdata_y;
-        wcdata_mag_save = copy->wcd_navi.wcdata_mag;
-	copy->wcd_navi = store->wcd_navi;
-        copy->wcd_navi.wcdata_alloc = wcdata_alloc_save;
-        copy->wcd_navi.wcdata_x = wcdata_x_save;
-        copy->wcd_navi.wcdata_y = wcdata_y_save;
-        copy->wcd_navi.wcdata_mag = wcdata_mag_save;
-	if (status == MB_SUCCESS
-		&& copy->wcd_navi.wcdata_alloc < store->wcd_navi.wcdata_alloc)
-		{
-		status = mb_reallocd(verbose, __FILE__, __LINE__, store->wcd_navi.wcdata_alloc,
-					(void **)&(copy->wcd_navi.wcdata_x), error);
-		if (status == MB_SUCCESS)
-		status = mb_reallocd(verbose, __FILE__, __LINE__, store->wcd_navi.wcdata_alloc,
-					(void **)&(copy->wcd_navi.wcdata_y), error);
-		if (status == MB_SUCCESS)
-		status = mb_reallocd(verbose, __FILE__, __LINE__, store->wcd_navi.wcdata_alloc,
-					(void **)&(copy->wcd_navi.wcdata_mag), error);
-		if (status == MB_SUCCESS)
-			{
-			copy->wcd_navi.wcdata_alloc = store->wcd_navi.wcdata_alloc;
-			copy_len = (size_t)(sizeof(float) * copy->wcd_navi.num_points);
-			memcpy(copy->wcd_navi.wcdata_x, store->wcd_navi.wcdata_x, copy_len);
-			memcpy(copy->wcd_navi.wcdata_y, store->wcd_navi.wcdata_y, copy_len);
-			memcpy(copy->wcd_navi.wcdata_mag, store->wcd_navi.wcdata_mag, copy_len);
-			}
-		}
-
-        /* SYS_CFG1 record */
-	sys_cfg1_data_alloc_save = copy->sys_cfg1.sys_cfg1_data_alloc;
-	sys_cfg1_data_save = copy->sys_cfg1.sys_cfg1_data;
-	copy->sys_cfg1 = store->sys_cfg1;
-	copy->sys_cfg1.sys_cfg1_data_alloc = sys_cfg1_data_alloc_save;
-	copy->sys_cfg1.sys_cfg1_data = sys_cfg1_data_save;
-	if (status == MB_SUCCESS
-		&& copy->sys_cfg1.sys_cfg1_data_alloc < store->sys_cfg1.sys_cfg1_data_alloc)
-		{
-		status = mb_reallocd(verbose, __FILE__, __LINE__, store->sys_cfg1.sys_cfg1_data_alloc,
-					(void **)&(copy->sys_cfg1.sys_cfg1_data), error);
-		if (status == MB_SUCCESS)
-			{
-			copy->sys_cfg1.sys_cfg1_data_alloc = store->sys_cfg1.sys_cfg1_data_alloc;
-			copy_len = (size_t)(copy->sys_cfg1.sys_cfg1_len);
-			memcpy(copy->sys_cfg1.sys_cfg1_data, store->sys_cfg1.sys_cfg1_data, copy_len);
-			}
-		}
-       
-        /* COMMENT_ Record */
-	copy->mcomment.comment_length = store->mcomment.comment_length;
-	strncpy(copy->mcomment.comment_message, store->mcomment.comment_message, MB_COMMENT_MAXLINE);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mbsys_wassp.h b/src/mbio/mbsys_wassp.h
deleted file mode 100644
index 06d8892..0000000
--- a/src/mbio/mbsys_wassp.h
+++ /dev/null
@@ -1,774 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbsys_wassp.h	1/28/2014
- *	$Id: mbsys_wassp.h 2239 2015-05-07 00:51:42Z caress $
- *
- *    Copyright (c) 2014-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbsys_wassp.h defines the MBIO data structures for handling data from
- * the following data formats:
- *    MBSYS_WASSP formats (code in mbsys_wassp.c and mbsys_wassp.h):
- *      MBF_WASSPENL : MBIO ID 241 (code in mbr_wasspenl.c)
- *
- * Author:	D. W. Caress
- * Date:	January 28, 2014
- *
- *
- */
-/*
- * Notes on the mbsys_wassp data structure and associated format:
- *   1. This MBIO format supports the generic interface message output
- *      by the ENL WASSP multibeam sonars.
- *   2. Reference: WASSP Generic ICD 2.2, 15 October 2013.
- *   2.            WASSP Generic ICD 2.4, 17 February 2015.
- *   3. The WASSP data stream consists of several different data
- *      records that can vary among models and installations.
- *   4. The WASSP multibeam models as of January 2014 incude:
- *        WMB-3230, 160 kHz, 112 beams, 120 degree swath
- *        WMB-5230, 80 kHz, 112 beams, 120 degree swath
- *        WMB-3250, 160 kHz, 224 beams, 120 degree swath
- *   5. The alongtrack beamwidths are 4 degrees, the acrosstrack
- *      beamwidths are estimated to be 2 degrees since the transducer
- *      arrays are about two times wider than long.
- *   6. Each data record begins with a 16 byte sequence:
- *        unsigned int sync;        \\ 0x77F9345A
- *        unsigned int size;        \\ Size in bytes of this record from start
- *                                  \\     of sync pattern to end of checksum
- *        char         header[8];   \\ Data record name
- *   7. All data are in little-endian form.
- *   8. The data record names include:
- *        GENBATHY - Uncorrected Bathymetry
- *        GEN_SENS - External Sensor Data
- *        RAWSONAR - Raw water column data (roll stabilized sonar)
- *        CORBATHY - Corrected Bathymetry
- *        NVUPDATE - Nav Data Message
- *        WCD_NAVI - Water Column Information
- *        SYS_CFG1 - Unknown record at start of file
- *                     (3224 bytes including sync and checksum)
- *   9. Some but not all sample files logged by the ENL datalogger have an 804 byte UTF-8
- *      header that looks like:
- *      ********************************************************************************
- *      **************************************** PM Version: 2.4.1.288****************
- *      **************************************** GUI Version: 2.4.1.125****************
- *      **************************************** Mity Verion: 20060****************
- *      ********************************************************************************
- *      ********************************************************************************
- *      **************************************** PM Version: 2.4.1.288****************
- *      **************************************** GUI Version: 2.4.1.125****************
- *      **************************************** Mity Verion: 20060****************
- *      ********************************************************************************
- *      The reading code will search for valid sync values and so should ignore similar
- *      headers when encountered.
- *      A sample file logged by Jonathon Beaudoin of the University of New Hampshire
- *      Center for Coastal and Ocean Mapping does not contain this header, so it is a
- *      feature of the ENL datalogger and not part of the data stream output by the
- *      WASSP sonars.
- *  10. The CORBATHY records do not have a full time stamp, and thus do not stand alone
- *      as survey data. Both a GENBATHY and a CORBATHY record are required to form a useful
- *      survey record.
- *  11. A survey record may or may not include a RAWSONAR record and a WCD_NAVI record.
- *  12. The UNH/CCOM data samples contain adjacent GENBATHY and CORBATHY records for each ping.
- *      The ENL-logged data have separate groups of GENBATHY records and CORBATHY records,
- *      with each CORBATHY record occuring 10 to 30 records after the corresponding
- *      GENBATHY record. Consequently, parsing these data would require buffering the GENBATHY
- *      records to match them with the right CORBATHY record. The current I/O module is
- *      not implemented with GENBATHY buffering, and will not work with the ENL data sample.
- *  13. The contents of the GEN_SENS records are not specified and are presently unknown.
- *  14. The NVUPDATE record does not include a time stamp and thus does not usefully serve
- *      as asynchronous navigation and attitude.
- *  15. The maximum number of beams is known, and can be statically dimensioned for the 
- *      GENBATHY and CORBATHY records. However, the maximum numbers of samples in the RAWSONAR 
- *      and WCD_NAVI records are not defined, and so these structures must allow for 
- *      dynamic allocation of memory.
- *     
- */
-
-/* include mb_define.h */
-#ifndef MB_DEFINE_DEF
-#include "mb_define.h"
-#endif
-
-/*---------------------------------------------------------------*/
-/* Record ID definitions (if needed for use in data reading and writing) */
-#define MBSYS_WASSP_SYNC                0x77F9345A
-#define MBSYS_WASSP_RECORD_GENBATHY     1   // Uncorrected Bathymetry
-#define MBSYS_WASSP_RECORD_GEN_SENS     2   // External Sensor Data
-#define MBSYS_WASSP_RECORD_RAWSONAR     3   // Raw water column data (roll stabilized sonar)
-#define MBSYS_WASSP_RECORD_CORBATHY     4   // Corrected Bathymetry
-#define MBSYS_WASSP_RECORD_NVUPDATE     4   // Nav Data Message
-#define MBSYS_WASSP_RECORD_WCD_NAVI     5   // Water Column Information
-#define MBSYS_WASSP_RECORD_SENSPROP     6   // Sensor Properties
-#define MBSYS_WASSP_RECORD_SYS_PROP     7   // System Properties
-#define MBSYS_WASSP_RECORD_MCOMMENT     8   // Comment (MB-System only)
-#define MBSYS_WASSP_RECORD_SYS_CFG1     9   // Unknown record at start of some files
-
-/*---------------------------------------------------------------*/
-/* Record size definitions (if needed for use in data reading and writing) */
-
-/*---------------------------------------------------------------*/
-/* Array size definitions (if needed for use in data reading and writing) */
-#define MBSYS_WASSP_MAX_BEAMS           512
-#define MBSYS_WASSP_MAX_PIXELS          0
-#define MBSYS_WASSP_MAX_MESSAGE         128
-#define MBSYS_WASSP_BUFFER_STARTSIZE    32768
-/*---------------------------------------------------------------*/
-
-/* Structure size definitions (if needed because there are dynamically allocated substructures) */
-
-/* Individual data record structures */
-struct mbsys_wassp_genbathy_struct
-	{
-        /* GENBATHY Record */
-        /* Supported Products: - WMB-3250 */
-        /* Uncorrected Bathymetry
-         * All the bottom detection points will be supplied as range and angle values.
-         * The length of the output message is variable, dependant on the number of beam data.
-         * In addition to the Flags the sample number will be set to zero when detection is invalid. */
-        /* unsigned int sync; */               /* 0x77F9345A */
-        /* unsigned int size; */               /* Size in bytes of this record from start of sync pattern to end of checksum */
-        /* char         header[8]; */          /* "GENBATHY" */
-        unsigned int    version;               /* 3 */
-        double          msec;                  /* A millisecond time stamp of rising edge
-                                                * of Transmit pulse in UTC time (UTC time
-                                                * is calculated from the timestamp of the
-                                                * ZDA sentence and or a PPS signal when
-                                                * available) No local time zone correction
-                                                * is applied.
-                                                * On systems not supporting UTC time, this
-                                                * will be system referenced time. */
-        mb_u_char       day;                   /* UTC time from NMEA ZDA time message, if available */
-        mb_u_char       month;                 /* UTC time from NMEA ZDA time message, if available */
-        unsigned short  year;                  /* UTC time from NMEA ZDA time message, if available */
-        unsigned int    ping_number;           /* Sequential number. */
-        unsigned int    sonar_model;           /* unused in ICD 2.4 */
-        unsigned long   transducer_serial_number;
-        unsigned int    number_beams;
-        unsigned int    modeflags;             /* Bit field:
-                                                *   Bit 0: Roll information is valid (not implemented)
-                                                *   Bit 1: Backscatter information is valid in beam data
-                                                *   Bits 2-31: Reserved for future use */
-        float           sampling_frequency;    /* Sonar sampling frequency (Hz) */
-        float           acoustic_frequency;    /* Sonar nominal acoustic frequency (Hz) */
-        float           tx_power;              /* Voltage (volts) rms applied to
-                                                * transmitter in dB. If "Sample Type" field is set
-                                                * to "un-calibrated" this will be the nominal
-                                                * power level */
-        float           pulse_width;           /* Pulse length in milliseconds */
-        float           absorption_loss;       /* Configurable value applied by WASSP. */
-        float           spreading_loss;        /* 0, 30 or 40 as selected by WASSP GUI,
-                                                         * units dB (as function of target range
-                                                         * in metres) */
-        unsigned int    sample_type;           /* Set to 0 if un-calibrated. Set to 1 if calibrated.
-                                                * All dB values will be relative rather than absolute
-                                                * if ‘Sample Type’ is ‘un-calibrated’ */
-        float           sound_velocity;        /* Sound velocity at the sonar head in m/s
-                                                         * (that was used in beam forming) */
-        float           detection_point[MBSYS_WASSP_MAX_BEAMS];
-                                                /* Non-corrected fractional sample number
-                                                 * with the reference to the receiver’s
-                                                 * acoustic centre with the zero sample at
-                                                 * the transmit time. */
-        float           rx_angle[MBSYS_WASSP_MAX_BEAMS];
-                                                /* Beam steering angle with reference to
-                                                 * receiver’s acoustic centre in the sonar
-                                                 * reference frame, at the detection point;
-                                                 * in degrees. */
-        unsigned int    flags[MBSYS_WASSP_MAX_BEAMS];
-                                                /* Bit fields:
-                                                    Bit 0: Detection Success
-                                                    Bit 1: Detection Valid
-                                                    Bit 2: WMT Detection
-                                                    Bit 3: SAC Detection
-                                                    Bits 4-31: Reserved for future use */
-        float           backscatter[MBSYS_WASSP_MAX_BEAMS];
-                                                /* Target strength (dB) at seafloor 
-                                                 * detection point on this beam. */
-        unsigned int    checksum;              /* 0x8806CBA5 (not really a checksum, actually a sync value) */
-        };
-
-struct mbsys_wassp_gen_sens_struct
-	{
-        /* GEN_SENS Record */
-        /* Supported Products: - WMB-3250 */
-        /* External Sensor Data
-         * The External Sensor Data would be a WASSP time-stamped replica of the External Sensor Data
-         * (e.g. Attitude, NMEA data) received by the WASSP. This data may be required to provide a
-         * facility to undo the sensor stabilization performed by WASSP.
-         */
-        unsigned int    version;               /* 2 */
-        double          msec;                  /* A millisecond time stamp of rising edge
-                                                         * of Transmit pulse in UTC time (UTC time
-                                                         * is calculated from the timestamp of the
-                                                         * ZDA sentence and or a PPS signal when
-                                                         * available) No local time zone correction
-                                                         * is applied. */
-        unsigned int    port_number;           /* Serial port stream number (1-10) */
-        mb_u_char       message_length;        /* length of message in characters */
-        char            message[MBSYS_WASSP_MAX_MESSAGE];
-                                                        /* Copy of Sensor Data
-                                                         * Length of this field = Size – 33 (followed by
-                                                         * line feed and or carriage return characters)
-                                                         * e.g. $HEHDT,45.2,,*67 */
-        unsigned int    checksum;              /* 0x8806CBA5 (not really a checksum, actually a sync value) */
-        };
-
-struct mbsys_wassp_rawsonar_struct
-	{
-        /* RAWSONAR Record */
-        /* Supported Products: - WMB-3250 */
-        /* Raw water column data (roll stabilized sonar)
-         * This packet is only roll stabilized if the WASSP system has valid roll information available.
-         * The data contained in this packet is to be dB signal levels received by time and angle. Some
-         * filtering of the data may be applied to remove side lobes and noise. This data is likely to be
-         * a subset of the full sampling resolution of the system – less beams and less samples. The first
-         * sample of raw data is the first sampling period starting from the rising edge of the transmit
-         * pulse and ending at the end of the sampling period determined by the Sample Rate.
-         * The Spreading Loss value applied to this data can be found in the preceding GENBATHY packet.
-         */
-        unsigned int    version;                /* 2 */
-        double          msec;                   /* A millisecond time stamp of rising edge
-                                                 * of Transmit pulse in UTC time (UTC time
-                                                 * is calculated from the timestamp of the
-                                                 * ZDA sentence and or a PPS signal when
-                                                 * available) No local time zone correction
-                                                 * is applied. 
-                                                 * On systems not supporting UTC time, this
-                                                 * will be system referenced time. */
-        unsigned int    ping_number;            /* Sequential number. */
-        float           sample_rate;            /* Frequency (Hz) of raw data in this packet */
-        unsigned int    n;                      /* Number of beams of raw data in this packet */
-        unsigned int    m;                      /* Number of samples (per beam) of raw data in this packet */
-        float           tx_power;               /* Voltage (volts) rms applied to
-                                                         * transmitter in dB.*/
-        float           pulse_width;            /* Pulse length in milliseconds */
-        unsigned int    sample_type;            /* Set to 0 if un-calibrated.
-                                                         * Set to 1 if calibrated. */
-        unsigned short  spare[MBSYS_WASSP_MAX_BEAMS];
-                                                /* Unused */
-        unsigned short  beam_index[MBSYS_WASSP_MAX_BEAMS];
-                                                /* Equivalent beam Index into uncorrected bathy
-                                                 * (GENBATHY) record of each beam. */
-        unsigned int    detection_point[MBSYS_WASSP_MAX_BEAMS];
-                                                /* Index of sample which most closely matches
-                                                 * seafloor detection. 0 = not valid. */
-        float           beam_angle[MBSYS_WASSP_MAX_BEAMS];
-                                                /* Beam angle for this beam in degrees (negative
-                                                 * port side of nadir) */
-        size_t          rawdata_alloc;          /* Number of shorts allocated for rawdata array */
-        short           *rawdata;               /* If Sample Type = 0 then Signal Levels at
-                                                 * sample/beam in dB*100 (divide by 100 to get
-                                                 * actual signal level dB). The order is
-                                                 *   sample 1 x [0, 1, 2, 3, ... N] 
-                                                 *   sample 2 x [0, 1, 2, 3, ... N] 
-                                                 *   .....
-                                                 *   sample M x [0, 1, 2, 3, ... N] 
-                                                 * If Sample Type = 1 then calibrated db*100. */
-        unsigned int    checksum;               /* 0x8806CBA5 (not really a checksum, actually a sync value) */
-        };
-
-
-struct mbsys_wassp_corbathy_struct
-	{
-        /* CORBATHY Record */
-        /* Supported Products:
-         *   WMB-3250
-         *   WMB-3230
-         *   WMB-5230 */
-        /* Corrected Bathymetry
-         * Use this data for use as fully corrected bathymetry data. The ships sensors
-         * integrated into the WASSP correct this information for leaver arm, pitch, roll, yaw,
-         * heave, tide etc. Each total message contains the detections data for a single ping.
-         * NOTES:
-         *      1) Sign of Latitude (N = +ve)
-         *      2) Sign of Longitude (E = +ve)
-         *      3) All points are sent for every beam even if they contain no detection data.
-         *         So you can check if it is valid by checking the Y value, if this is 0 then the
-         *         detection is not valid and should not be used.
-         *      4) The X,Y,Z positions are relative to the position in Table 5 Corrected Bathy.
-         *         This is based on the fully corrected output using lever arm,
-         *         sensor data and sound speed information available. This means if the X, Y, Z
-         *         offsets in the WASSP application are correct, there is no need to account for
-         *         the distance between GPS antenna and transducer or any pitch/roll/heave inclination.
-         *      5) Sign of Longitude is normal (East = positive)
-         *      6) Depths are tide corrected unless tides are disabled in the WASSP system.
-         */
-        /* unsigned int sync; */               /* 0x77F9345A */
-        /* unsigned int size; */               /* Size in bytes of this record from start of sync pattern to end of checksum */
-        /* char         header[8]; */          /* "CORBATHY" */
-        unsigned int    version;               /* 3 for ICD 2.2, 4 for ICD 2.4 */
-        double          msec;                  /* Version 4: unused
-                                                * Version 3:
-                                                * A millisecond time stamp of rising edge
-                                                * of Transmit pulse in UTC time (UTC time
-                                                * is calculated from the timestamp of the
-                                                * ZDA sentence and or a PPS signal when
-                                                * available) No local time zone correction
-                                                * is applied.
-                                                * On systems not supporting UTC time, this
-                                                * will be system referenced time. */
-        unsigned int    num_beams;             /* Fixed by software. Invalid points have depth set to 0.0. */
-        unsigned int    ping_number;           /* Ping sequence number */
-        double          latitude;              /* Latitude at transducer in degrees*/
-        double          longitude;             /* Longitude at transducer in degrees */
-        float           bearing;               /* Bearing/Heading of vessel on transmit in degrees */
-        float           roll;                  /* Roll of vessel on transmit in degrees */
-        float           pitch;                 /* Pitch of vessel on transmit in degrees */
-        float           heave;                 /* Heave of vessel on transmit at transducer in meters */
-        unsigned int    sample_type;           /* Set to 0 if un-calibrated. Set to 1 if calibrated. */
-        float           tide;                  /* Tide adjustment applied in meters */
-        unsigned int    spare[5];
-        unsigned int    beam_index[MBSYS_WASSP_MAX_BEAMS];
-                                                /* Beam index number */
-        float           x[MBSYS_WASSP_MAX_BEAMS];
-                                                /* Distance to detection point in metres laterally along
-                                                 * west/east axis. East of position is positive. */
-        float           y[MBSYS_WASSP_MAX_BEAMS];
-                                                /* Distance to detection point in metres laterally along
-                                                 * north/south axis. South of position is positive. */
-        float           z[MBSYS_WASSP_MAX_BEAMS];
-                                                /* Depth in meters for the detection point. –ve = down.
-                                                 * 0 = not valid */
-        float           beam_angle[MBSYS_WASSP_MAX_BEAMS];
-                                                /* Angle of the beam this detection appears on in radians
-                                                 * positive for starboard side of vessel. */
-        float           backscatter[MBSYS_WASSP_MAX_BEAMS];
-                                                /* Post-processed target strength (dB) at seafloor on this beam. */
-        mb_u_char       quality[MBSYS_WASSP_MAX_BEAMS];
-                                                /* Detection information - (0=none, 1=WMT, 2=SAC) */
-        mb_u_char       fish[MBSYS_WASSP_MAX_BEAMS];
-                                                /* Fish intensity value for all fish targets vertically above
-                                                 * detection point. */
-        mb_u_char       roughness[MBSYS_WASSP_MAX_BEAMS]; /* Unused */
-        mb_u_char       empty[MBSYS_WASSP_MAX_BEAMS];   /* Unused */
-        unsigned int    pad[MBSYS_WASSP_MAX_BEAMS];     /* Unused */
-        unsigned int    checksum;              /* 0x8806CBA5 (not really a checksum, actually a sync value) */
-        };
-
-struct mbsys_wassp_nvupdate_struct
-	{
-        /* NVUPDATE Record */
-        /* Supported Products:
-         *   WMB-3250
-         *   WMB-3230
-         *   WMB-5230 */
-        /* Nav Data Message
-         * This message is used to update the external application with the most current navigation data.
-         * This is output at approximately 100ms intervals. This data DOES NOT relate to the detection data or
-         * water column data and is just the most recent navigation data the WASSP system is processing.
-         * Data shown will be that configured to be used by the WASSP system. All serial data is also
-         * sent via the raw data format.
-         * Please Note: MAG value has no units at this time. The value is the intensity of the returned
-         * echo at the detection point, this value is affected by transmission losses and power levels.
-         * NOTES:
-         *      1) Sign of Longitude is E positive, W negative
-         *      2) Sign of Latitude is N positive, S negative
-         */
-        /* unsigned int sync; */               /* 0x77F9345A */
-        /* unsigned int size; */               /* Size in bytes of this record from start of sync pattern to end of checksum */
-        /* char         header[8]; */          /* "NVUPDATE" */
-        unsigned int    version;               /* 4 */
-        double          latitude;              /* Latitude from GPS sensor in decimal degrees.
-                                                * Set to “-999” if no valid latitude is received. */
-        double          longitude;             /* Longitude from GPS sensor in decimal degrees.
-                                                * Set to “-999” if no valid longitude is received. */
-        float           sog;                   /* Speed over ground in knots.
-                                                * Set to “-999” if no valid speed is received. */
-        float           cog;                   /* Course over ground in degrees.
-                                                * Set to “-999” if no valid course is received. */
-        float           heading;               /* Vessel heading in degrees.
-                                                * Set to “-999” if no valid heading is received. */
-        float           roll;                  /* Vessel roll in degrees.
-                                                * Set to “-999” if no valid roll is received. */
-        float           pitch;                 /* Vessel pitch in degrees.
-                                                * Set to “-999” if no valid pitch is received. */
-        float           heave;                 /* Vessel heave in meters.
-                                                * Set to “-999” if no valid heave is received. */
-        float           nadir_depth;           /* Roll corrected depth below transducer in meters.
-                                                * Set to “-999” if no valid depth is received. */
-        unsigned int    checksum;              /* 0x8806CBA5 (not really a checksum, actually a sync value) */
-        };
-
-struct mbsys_wassp_wcd_navi_struct
-	{
-        /* WCD_NAVI Record */
-        /* Supported Products:
-         *   WMB-3250
-         *   WMB-3230
-         *   WMB-5230 */
-        /* Water Column Information
-         * This message is sent over the network after each detection message is sent, thus the water
-         * column data is valid for the previous ping that has just been received.
-         * Notes:
-         *      1. The X positions are relative to the vessel position 
-         *      2. The Y depths are tide corrected unless tides are disabled in the WASSP system
-         *      3. MAG value has no units at this time. The value is the intensity of the returned
-         *      echo at the detection point, this value is affected by transmission losses and
-         *      power levels. */
-        /* unsigned int sync; */               /* 0x77F9345A */
-        /* unsigned int size; */               /* Size in bytes of this record from start of sync pattern to end of checksum */
-        /* char         header[8]; */          /* "WCD_NAVI" */
-        unsigned int    version;               /* 3 for ICD 2.2, 4 for ICD 2.4 */
-        double          latitude;              /* Latitude from GPS sensor in decimal degrees */
-        double          longitude;             /* Longitude from GPS sensor in decimal degrees */
-        unsigned int    num_points;            /* Number of water column points to follow */
-        float           bearing;               /* Bearing of vessel for fish targets, degrees */
-        double          msec;                  /* Version 4: unused
-                                                * Version 3:
-                                                * A millisecond time stamp of rising edge
-                                                * of Transmit pulse in UTC time (UTC time
-                                                * is calculated from the timestamp of the
-                                                * ZDA sentence and or a PPS signal when
-                                                * available) No local time zone correction
-                                                * is applied.
-                                                * On systems not supporting UTC time, this
-                                                * will be system referenced time. */
-        unsigned int    ping_number;           /* Ping sequence number */
-        float           sample_rate;           /* Sampling frequency in Hz for the Water Column Information */
-        size_t          wcdata_alloc;          /* Number of points allocated for wcdata arrays */
-        float           *wcdata_x;             /* Distance in meters to water column point port/stbd
-                                                         * from vessels heading. Negative value is port. */
-        float           *wcdata_y;             /* Depth in meters for the water column point. */
-        float           *wcdata_mag;           /* Intensity value for water column point, not referenced */
-        unsigned int    checksum;              /* 0x8806CBA5 (not really a checksum, actually a sync value) */
-        };
-
-struct mbsys_wassp_sensprop_struct
-	{
-        /* SENSPROP Record */
-        /* Supported Products:
-         *   WMB-3250
-         *   WMB-3230
-         *   WMB-5230 */
-        /* Sensor Properties
-         * These data packets contain WASSP properties.
-         * Packets are sent on connection and if any properties are changed.
-         * All positions are relative to the vessel’s reference point
-         * - see WASSP installation manual. */
-        /* unsigned int sync; */                /* 0x77F9345A */
-        /* unsigned int size; */                /* Size in bytes of this record from start of sync pattern to end of checksum */
-        /* char         header[8]; */           /* "SENSPROP" */
-        unsigned int    version;                /* 1 */
-        unsigned int    flags;                  /* Bit field:
-                                                 *      Bit 0: Pitch Compensation
-                                                 *      Bit 1: Heave Compensation
-                                                 *      Bit 2: Roll Correction
-                                                 *      Bit 3: Swap Roll
-                                                 *      Bit 4: Swap Array
-                                                 *      Bit 5: Invert Roll
-                                                 *      Bit 6: Induced Heave
-                                                 *      Bit 7: PPS applied
-                                                 *      Bit 8: Auto Power by signal
-                                                 *      Bits 9-31: Reserved for future use */
-        float           sea_level_reference;    /* Sea Level Reference
-                                                 *  Meters from ship’s reference to sea level,
-                                                 *  down is positive */
-        float           element_spacing;        /* Element spacing in millimeters */
-        unsigned int    spare[8];               /* Spare */
-        unsigned int    n;                      /* Number of sensors */
-        size_t          n_alloc;                /* Number of sensors allocated */
-        struct mbsys_wassp_sensor_struct *sensors; /* Array of sensor details */
-        unsigned int    checksum;              /* 0x8806CBA5 (not really a checksum, actually a sync value) */
-        };
-
-struct mbsys_wassp_sensor_struct
-	{
-        unsigned int    sensor_type;            /* Sensor type:
-                                                 *      1: Roll
-                                                 *      2: Pitch
-                                                 *      4: Heave
-                                                 *      8: Heading
-                                                 *      16: Transducer
-                                                 *      32: Position */
-        unsigned int    flags;                  /* Bit field:
-                                                 *      Bit 0: Device active
-                                                 *      Bit 1: Offsets set
-                                                 *      Bit 2: Roll Bias set
-                                                 *      Bit 3: Pitch Bias set
-                                                 *      Bit 4: Yaw Bias set
-                                                 *      Bits 5-31: Reserved for future use */
-        mb_u_char       port_number;            /* Port number */
-        mb_u_char       device;                 /* Device Type which the port number applies to:
-                                                 *      0: Unknown
-                                                 *      1: WASSP Serial Transfer Task */
-        mb_u_char       sentence;               /* Sentence used:
-                                                 *      0: n/a
-                                                 *      10: GGA
-                                                 *      11: GGL
-                                                 *      12: GNS
-                                                 *      13: RMC
-                                                 *      14: GGK (Trimble)
-                                                 *      15: ZDA
-                                                 *      20: HDM
-                                                 *      21: HDT
-                                                 *      22: HDG
-                                                 *      23: VTG
-                                                 *      31: PSXN (Kongsberg)
-                                                 *      32: PASHR (Applanix)
-                                                 *      33: PFEC,ATT (Furuno)
-                                                 *      34: PFEC,HVE (Furuno)
-                                                 *      35: RCD (JRC)
-                                                 *      100: TSS1
-                                                 *      101: Minisense */
-        mb_u_char       sensor_model;           /* Sensor model:
-                                                 *      0: Unknown
-                                                 *      10: WASSP 160
-                                                 *      11: WASSP 80
-                                                 *      12: WASSP 160 Vs
-                                                 *      13: WASSP 160 Vl
-                                                 *      40: Applanix POS MV V4
-                                                 *      41: Furuno SC30
-                                                 *      42: Furuno SC50
-                                                 *      43: JRC JLR20
-                                                 *      44: CDL Minisense
-                                                 *      45: Kongsberg MRU
-                                                 *      46: Teledyne TSS
-                                                 *      47: Maretron SSC200
-                                                 *      48: SMC IMU-108 */
-        float           latency;                /* Latency in seconds */
-        float           roll_bias;              /* Roll offset, degrees, positive stbd down */
-        float           pitch_bias;             /* Pitch offset, degrees, positive bow up */
-        float           yaw_bias;               /* Heading offset, degrees, positive stbd */
-        float           offset_x;               /* Meters from ship’s reference, fwd is positive */
-        float           offset_y;               /* Meters from ship’s reference, stbd is positive */
-        float           offset_z;               /* Meters from ship’s reference, down is positive */
-        };
-
-struct mbsys_wassp_sys_prop_struct
-	{
-        /* SYS_PROP Record */
-        /* Supported Products:
-         *   WMB-3250
-         *   WMB-3230
-         *   WMB-5230 */
-        /* System Properties
-         * These data packets contain WASSP properties.
-         * Packets are sent on connection and if any properties are changed.
-         * All positions are relative to the vessel’s reference point
-         * - see WASSP installation manual. */
-        /* unsigned int sync; */                /* 0x77F9345A */
-        /* unsigned int size; */                /* Size in bytes of this record from start of sync pattern to end of checksum */
-        /* char         header[8]; */           /* "SYS_PROP" */
-        unsigned int    version;                /* 1 */
-        unsigned int    product_type;           /* Product type:
-                                                 *      1: WMB-3230
-                                                 *      2: WMB-5230
-                                                 *      3: WMB-3250 */
-        unsigned int    protocol_version;       /* Protocol version x100, currently 240 */
-        unsigned int    sw_version[4];          /* Software version:
-                                                 * Product Version, Major Version, Minor Version, Build */
-        unsigned int    fw_version;             /* Firmware version */
-        unsigned int    hw_version;             /* Hardware version */
-        unsigned int    transducer_sn;          /* Transducer serial number in ASCII */
-        unsigned int    transceiver_sn;         /* Transceiver serial number in ASCII */
-        unsigned int    spare[8];               /* Spare */
-        unsigned int    checksum;               /* 0x8806CBA5 (not really a checksum, actually a sync value) */
-        };
-
-struct mbsys_wassp_sys_cfg1_struct
-	{
-        /* SYS_CFG1 Record */
-        /* Undocumented record, probably installation parameters
-         * Raw bytes stored and passed on for now */
-        size_t          sys_cfg1_data_alloc;    /* Number of bytes allocated to hold the sys_cfg1 record */
-        size_t          sys_cfg1_len;           /* Number of bytes stored from the sys_cfg1 record */
-        char            *sys_cfg1_data;         /* SYS_CFG1 record stored as raw bytes */
-        unsigned int    checksum;              /* 0x8806CBA5 (not really a checksum, actually a sync value) */
-        };
-
-struct mbsys_wassp_mcomment_struct
-	{
-        /* MCOMMENT Record */
-        /* Comment message
-         * This record is defined only for MB-System */
-        unsigned int    comment_length;         /* Comment length in bytes */
-        char            comment_message[MB_COMMENT_MAXLINE];
-        unsigned int    checksum;              /* 0x8806CBA5 (not really a checksum, actually a sync value) */
-       };
-
-struct mbsys_wassp_unknown1_struct
-	{
-        /* Unknown record
-         * Raw bytes stored and passed on for now */
-        size_t          unknown1_data_alloc;    /* Number of bytes allocated to hold the unknown1 record */
-        size_t          unknown1_len;           /* Number of bytes stored from the unknown1 record */
-        char            *unknown1_data;         /* unknown1 record stored as raw bytes */
-        unsigned int    checksum;              /* 0x8806CBA5 (not really a checksum, actually a sync value) */
-       };
-
-/* Data system structure */
-struct mbsys_wassp_struct
-	{
-	/* Type of most recently read data record */
-	int		kind;			/* MB-System record ID */
-
-	/* MB-System time stamp of most recently read record */
-	double		time_d;
-	int		time_i[7];
-
-        /* GENBATHY record */
-        struct mbsys_wassp_genbathy_struct genbathy;
-
-        /* RAWSONAR record */
-        struct mbsys_wassp_rawsonar_struct rawsonar;
-
-        /* GEN_SENS record */
-        struct mbsys_wassp_gen_sens_struct gen_sens;
-
-        /* CORBATHY record */
-        struct mbsys_wassp_corbathy_struct corbathy;
-
-        /* NVUPDATE record */
-        struct mbsys_wassp_nvupdate_struct nvupdate;
-
-        /* WCD_NAVI record */
-        struct mbsys_wassp_wcd_navi_struct wcd_navi;
-
-        /* SENSPROP record */
-        struct mbsys_wassp_sensprop_struct sensprop;
-
-        /* SYS_PROP record */
-        struct mbsys_wassp_sys_prop_struct sys_prop;
-
-        /* SYS_CFG1 record */
-        struct mbsys_wassp_sys_cfg1_struct sys_cfg1;
-        
-        /* MCOMMENT Record */
-        struct mbsys_wassp_mcomment_struct mcomment;
-
-        /* unknown record */
-        struct mbsys_wassp_unknown1_struct unknown1;
- 	};
-        
-/*---------------------------------------------------------------*/
-
-/* System specific function prototypes */
-int mbsys_wassp_alloc(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error);
-int mbsys_wassp_deall(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error);
-int mbsys_wassp_dimensions(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int *nbath, int *namp, int *nss, int *error);
-int mbsys_wassp_pingnumber(int verbose, void *mbio_ptr,
-			int *pingnumber, int *error);
-int mbsys_wassp_sonartype(int verbose, void *mbio_ptr, void *store_ptr,
-                        int *sonartype, int *error);
-//int mbsys_wassp_sidescantype(int verbose, void *mbio_ptr, void *store_ptr,
-//                        int *ss_type, int *error);
-//int mbsys_wassp_preprocess(int verbose, void *mbio_ptr, void *store_ptr,
-//                        double time_d, double navlon, double navlat,
-//                        double speed, double heading, double sonardepth,
-//                        double roll, double pitch, double heave,
-//                        int *error);
-int mbsys_wassp_extract(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int time_i[7], double *time_d,
-			double *navlon, double *navlat,
-			double *speed, double *heading,
-			int *nbath, int *namp, int *nss,
-			char *beamflag, double *bath, double *amp,
-			double *bathacrosstrack, double *bathalongtrack,
-			double *ss, double *ssacrosstrack, double *ssalongtrack,
-			char *comment, int *error);
-int mbsys_wassp_insert(int verbose, void *mbio_ptr, void *store_ptr,
-			int kind, int time_i[7], double time_d,
-			double navlon, double navlat,
-			double speed, double heading,
-			int nbath, int namp, int nss,
-			char *beamflag, double *bath, double *amp,
-			double *bathacrosstrack, double *bathalongtrack,
-			double *ss, double *ssacrosstrack, double *ssalongtrack,
-			char *comment, int *error);
-int mbsys_wassp_extract_nav(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int time_i[7], double *time_d,
-			double *navlon, double *navlat,
-			double *speed, double *heading, double *draft,
-			double *roll, double *pitch, double *heave,
-			int *error);
-//int mbsys_wassp_extract_nnav(int verbose, void *mbio_ptr, void *store_ptr,
-//			int nmax, int *kind, int *n,
-//			int *time_i, double *time_d,
-//			double *navlon, double *navlat,
-//			double *speed, double *heading, double *draft,
-//			double *roll, double *pitch, double *heave,
-//			int *error);
-int mbsys_wassp_insert_nav(int verbose, void *mbio_ptr, void *store_ptr,
-			int time_i[7], double time_d,
-			double navlon, double navlat,
-			double speed, double heading, double draft,
-			double roll, double pitch, double heave,
-			int *error);
-int mbsys_wassp_extract_altitude(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, double *transducer_depth, double *altitude,
-			int *error);
-//int mbsys_wassp_insert_altitude(int verbose, void *mbio_ptr, void *store_ptr,
-//                        double transducer_depth, double altitude,
-//                        int *error);
-int mbsys_wassp_extract_svp(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind,
-			int *nsvp,
-			double *depth, double *velocity,
-			int *error);
-int mbsys_wassp_insert_svp(int verbose, void *mbio_ptr, void *store_ptr,
-			int nsvp,
-			double *depth, double *velocity,
-			int *error);
-int mbsys_wassp_ttimes(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int *nbeams,
-			double *ttimes, double *angles,
-			double *angles_forward, double *angles_null,
-			double *heave, double *alongtrack_offset,
-			double *draft, double *ssv, int *error);
-int mbsys_wassp_detects(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int *nbeams, int *detects, int *error);
-//int mbsys_wassp_pulses(int verbose, void *mbio_ptr, void *store_ptr,
-//                        int *kind, int *nbeams, int *pulses, int *error);
-int mbsys_wassp_gains(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, double *transmit_gain, double *pulse_length,
-			double *receive_gain, int *error);
-//int mbsys_wassp_extract_rawss(int verbose, void *mbio_ptr, void *store_ptr,
-//			int *kind, int *nrawss,
-//			double *rawss,
-//			double *rawssacrosstrack,
-//			double *rawssalongtrack,
-//			int *error);
-//int mbsys_wassp_insert_rawss(int verbose, void *mbio_ptr, void *store_ptr,
-//			int nrawss,
-//			double *rawss,
-//			double *rawssacrosstrack,
-//			double *rawssalongtrack,
-//			int *error);
-//int mbsys_wassp_extract_segytraceheader(int verbose, void *mbio_ptr, void *store_ptr,
-//			int *kind,
-//			void *segytraceheader_ptr,
-//			int *error);
-//int mbsys_wassp_extract_segy(int verbose, void *mbio_ptr, void *store_ptr,
-//			int *sampleformat,
-//			int *kind,
-//			void *segytraceheader_ptr,
-//			float *segydata,
-//			int *error);
-//int mbsys_wassp_insert_segy(int verbose, void *mbio_ptr, void *store_ptr,
-//			int kind,
-//			void *segytraceheader_ptr,
-//			float *segydata,
-//			int *error);
-//int mbsys_wassp_ctd(int verbose, void *mbio_ptr, void *store_ptr,
-//			int *kind, int *nctd, double *time_d,
-//			double *conductivity, double *temperature,
-//			double *depth, double *salinity, double *soundspeed, int *error);
-//int mbsys_wassp_ancilliarysensor(int verbose, void *mbio_ptr, void *store_ptr,
-//			int *kind, int *nsensor, double *time_d,
-//			double *sensor1, double *sensor2, double *sensor3,
-//			double *sensor4, double *sensor5, double *sensor6,
-//			double *sensor7, double *sensor8, int *error);
-int mbsys_wassp_copy(int verbose, void *mbio_ptr,
-			void *store_ptr, void *copy_ptr,
-			int *error);
-/*---------------------------------------------------------------*/
diff --git a/src/mbio/mbsys_xse.c b/src/mbio/mbsys_xse.c
deleted file mode 100644
index d21831d..0000000
--- a/src/mbio/mbsys_xse.c
+++ /dev/null
@@ -1,2122 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbsys_xse.c	3/27/2000
- *	$Id: mbsys_xse.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 2000-2015 by
- *    D. W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and D. N. Chayes (dale at lamont.ldgo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY  10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbsys_xse.h contains the functions for handling
- * the data structure used by MBIO functions
- * to store swath sonar data in the XSE Data Exchange Format
- * developed by L-3 Communications ELAC Nautik.
- * This format is used for data from ELAC Bottomchart multibeam sonars
- * and SeaBeam 2100 multibeam sonars (made by L-3 Communications
- * SeaBeam Instruments).
- * The data format associated with XSE is:
- *      MBF_L3XSERAW : MBIO ID 94
- *
- * Author:	D. W. Caress
- * Date:	August 1,  1999
- * Additional Authors:	P. A. Cohen and S. Dzurenko
- *
- * $Log: mbsys_xse.c,v $
- * Revision 5.19  2007/07/03 17:28:08  caress
- * Fixes to XSE format.
- *
- * Revision 5.18  2007/06/18 01:19:48  caress
- * Changes as of 17 June 2007.
- *
- * Revision 5.17  2005/11/05 00:48:03  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.16  2003/12/24 06:51:21  caress
- * Fixed problem where sonar depth got added to bathymetry when data files where written.
- *
- * Revision 5.15  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.14  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.13  2002/04/02 00:33:50  caress
- * Fixed sidescan flipping (when bathymetry recalculated).
- *
- * Revision 5.12  2002/02/22 09:03:43  caress
- * Release 5.0.beta13
- *
- * Revision 5.11  2001/12/30 20:32:12  caress
- * Fixed array overflows in handling XSE data.
- *
- * Revision 5.10  2001/12/20 20:48:51  caress
- * Release 5.0.beta11
- *
- * Revision 5.9  2001/08/25  00:54:13  caress
- * Adding beamwidth values to extract functions.
- *
- * Revision 5.8  2001/08/23  20:50:24  caress
- * Fixed problems with SB2120 data.
- *
- * Revision 5.7  2001/07/27  19:07:16  caress
- * Fixed handling 1180 data.
- *
- * Revision 5.6  2001/07/22 21:17:01  caress
- * Fixed bug initialized too much in ttimes function.
- *
- * Revision 5.5  2001/07/20 00:32:54  caress
- * Release 5.0.beta03
- *
- * Revision 5.4  2001/06/08  21:44:01  caress
- * Version 5.0.beta01
- *
- * Revision 5.3  2001/04/06  22:05:59  caress
- * Consolidated xse formats into one format.
- *
- * Revision 5.2  2001/01/22  07:43:34  caress
- * Version 5.0.beta01
- *
- * Revision 5.1  2000/12/10  20:26:50  caress
- * Version 5.0.alpha02
- *
- * Revision 5.0  2000/12/01  22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.2  2000/10/11  01:03:21  caress
- * Convert to ANSI C
- *
- * Revision 4.1  2000/09/30  06:32:52  caress
- * Snapshot for Dale.
- *
- * Revision 4.0  1999/08/08  04:14:35  caress
- * Initial revision.
- *
- *
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mb_define.h"
-#include "mbsys_xse.h"
-
-static char rcs_id[]="$Id: mbsys_xse.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-int mbsys_xse_alloc(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_xse_alloc";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_xse_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* allocate memory for data structure */
-	status = mb_malloc(verbose,sizeof(struct mbsys_xse_struct),
-				store_ptr,error);
-
-	/* get data structure pointer */
-	store = (struct mbsys_xse_struct *) *store_ptr;
-
-	/* initialize everything */
-	/* type of data record */
-	store->kind = MB_DATA_NONE;  /* Survey, nav, Comment */
-
-	/* parameter (ship frames) */
-	store->par_parameter = MB_NO;	/* boolean flag for parameter group */
-	store->par_source = 0;		/* sensor id */
-	store->par_sec = 0;		/* sec since 1/1/1901 00:00 */
-	store->par_usec = 0;		/* microseconds */
-	store->par_roll_bias = 0.0;		/* radians */
-	store->par_pitch_bias = 0.0;		/* radians */
-	store->par_heading_bias = 0.0;	/* radians */
-	store->par_time_delay = 0.0;		/* nav time lag, seconds */
-	store->par_trans_x_port = 0.0;	/* port transducer x position, meters */
-	store->par_trans_y_port = 0.0;	/* port transducer y position, meters */
-	store->par_trans_z_port = 0.0;	/* port transducer z position, meters */
-	store->par_trans_x_stbd = 0.0;	/* starboard transducer x position, meters */
-	store->par_trans_y_stbd = 0.0;	/* starboard transducer y position, meters */
-	store->par_trans_z_stbd = 0.0;	/* starboard transducer z position, meters */
-	store->par_trans_err_port = 0.0;	/* port transducer rotation in roll direction, radians */
-	store->par_trans_err_stbd = 0.0;	/* starboard transducer rotation in roll direction, radians */
-	store->par_nav_x = 0.0;		/* navigation antenna x position, meters */
-	store->par_nav_y = 0.0;		/* navigation antenna y position, meters */
-	store->par_nav_z = 0.0;		/* navigation antenna z position, meters */
-	store->par_hrp_x = 0.0;		/* motion sensor x position, meters */
-	store->par_hrp_y = 0.0;		/* motion sensor y position, meters */
-	store->par_hrp_z = 0.0;		/* motion sensor z position, meters */
-
-	/* navigation and motion (ship frames) */
-	store->par_navigationandmotion = MB_NO; /* boolean flag for navigationandmotion group */
-	store->par_nam_roll_bias = 0.0;		/* roll bias, radians */
-	store->par_nam_pitch_bias = 0.0;	/* pitch bias, radians */
-	store->par_nam_heave_bias = 0.0;	/* heave bias, meters */
-	store->par_nam_heading_bias = 0.0;	/* heading/gyro bias, radians */
-	store->par_nam_time_delay = 0.0;	/* nav time lag, seconds */
-	store->par_nam_nav_x = 0.0;		/* navigation antenna x position, meters */
-	store->par_nam_nav_y = 0.0;		/* navigation antenna y position, meters */
-	store->par_nam_nav_z = 0.0;		/* navigation antenna z position, meters */
-	store->par_nam_hrp_x = 0.0;		/* motion sensor x position, meters */
-	store->par_nam_hrp_y = 0.0;		/* motion sensor y position, meters */
-	store->par_nam_hrp_z = 0.0;		/* motion sensor z position, meters */
-
-	store->par_xdr_num_transducer = 0; /* number of transducers */
-	for (i=0;i<MBSYS_XSE_MAX_TRANSDUCERS;i++)
-		{
-		store->par_xdr_sensorid[i] = 0; 		/* sensor ids */
-		store->par_xdr_transducer[i] = 0; 		/* transducer type:
-										0: hydrophone
-										1: projector
-										2: transducer */
-		store->par_xdr_frequency[i] = 0; 	/* frequency (Hz) */
-		store->par_xdr_side[i] = 0; 		/* transducer side:
-										0: undefined
-										1: port
-										2: starboard
-										3: midship
-										4: system defined */
-		store->par_xdr_mountingroll[i] = 0.0;	/* array mounting angle roll (radians) */
-		store->par_xdr_mountingpitch[i] = 0.0;	/* array mounting angle roll (radians) */
-		store->par_xdr_mountingazimuth[i] = 0.0;	/* array mounting angle roll (radians) */
-		store->par_xdr_mountingdistance[i] = 0.0;	/* horizontal distance between
-										innermost elements of the
-										transducer arrays to the
-										ship center line in a
-										V-shaped configuration (m) */
-		store->par_xdr_x[i] = 0.0;	/* transducer center across track offset (m) */
-		store->par_xdr_y[i] = 0.0;	/* transducer center along track offset (m) */
-		store->par_xdr_z[i] = 0.0;	/* transducer center vertical offset (m) */
-		store->par_xdr_roll[i] = 0.0;	/* beamforming roll bias (radians - port up positive) */
-		store->par_xdr_pitch[i] = 0.0;	/* beamforming pitch bias (radians - bow up positive) */
-		store->par_xdr_azimuth[i] = 0.0;	/* beamforming azimuth bias (radians
-									- projector axis clockwise with
-									respect to compass positive) */
-		}
-	store->par_xdx_num_transducer = 0; 			/* number of transducers */
-	for (i=0;i<MBSYS_XSE_MAX_TRANSDUCERS;i++)
-		{
-		store->par_xdx_roll[i] = 0.0; 	/* mounting mode roll (0: auto, 1: manual) */
-		store->par_xdx_pitch[i] = 0.0; 	/* mounting mode pitch (0: auto, 1: manual) */
-		store->par_xdx_azimuth[i] = 0.0; 	/* mounting mode azimuth (0: auto, 1: manual) */
-		}
-
-	/* svp (sound velocity frames) */
-	store->svp_source = 0;		/* sensor id */
-	store->svp_sec = 0;		/* sec since 1/1/1901 00:00 */
-	store->svp_usec = 0;		/* microseconds */
-	store->svp_nsvp = 0;		/* number of depth values */
-	store->svp_nctd = 0;		/* number of ctd values */
-	store->svp_ssv = 0.0;		/* m/s */
-	for (i=0;i<MBSYS_XSE_MAXSVP;i++)
-	    {
-	    store->svp_depth[i] = 0.0;		/* m */
-	    store->svp_velocity[i] = 0.0;	/* m/s */
-	    store->svp_conductivity[i] = 0.0;	/* mmho/cm */
-	    store->svp_salinity[i] = 0.0;	/* o/oo */
-	    store->svp_temperature[i] = 0.0;	/* degree celcius */
-	    store->svp_pressure[i] = 0.0;	/* bar */
-	    }
- 	store->svp_ssv_depth = 0.0;	/* m */
- 	store->svp_ssv_depthflag = 0;	/* 0 = invalid depth, otherwise depth valid */
-
-	/* position (navigation frames) */
-	store->nav_group_general = MB_NO;	/* boolean flag */
-	store->nav_group_position = MB_NO;	/* boolean flag */
-	store->nav_group_accuracy = MB_NO;	/* boolean flag */
-	store->nav_group_motiongt = MB_NO;	/* boolean flag */
-	store->nav_group_motiontw = MB_NO;	/* boolean flag */
-	store->nav_group_track = MB_NO;		/* boolean flag */
-	store->nav_group_hrp = MB_NO;		/* boolean flag */
-	store->nav_group_heave = MB_NO;		/* boolean flag */
-	store->nav_group_roll = MB_NO;		/* boolean flag */
-	store->nav_group_pitch = MB_NO;		/* boolean flag */
-	store->nav_group_heading = MB_NO;	/* boolean flag */
-	store->nav_group_log = MB_NO;		/* boolean flag */
-	store->nav_group_gps = MB_NO;		/* boolean flag */
-	store->nav_source = 0;			/* sensor id */
-	store->nav_sec = 0;			/* sec since 1/1/1901 00:00 */
-	store->nav_usec = 0;			/* microseconds */
-	store->nav_quality = 0;
-	store->nav_status = 0;
-	store->nav_description_len = 0;
-	for (i=0;i<MBSYS_XSE_DESCRIPTION_LENGTH;i++)
-	    store->nav_description[i] = 0;
-	store->nav_x = 0.0;			/* eastings (m) or
-					    longitude (radians) */
-	store->nav_y = 0.0;			/* northings (m) or
-					    latitude (radians) */
-	store->nav_z = 0.0;			/* height (m) or
-					    ellipsoidal height (m) */
-	store->nav_acc_quality = 0;	/* GPS quality:
-						0: invalid
-						1: SPS
-						2: SPS differential
-						3: PPS
-						4. RTK
-						5: Float RTK
-						6: Estimated
-						7: Manual
-						8: Simulator */
-	store->nav_acc_numsatellites = 0;	/* number of satellites */
-	store->nav_acc_horizdilution = 0.0;	/* horizontal dilution of precision */
-	store->nav_acc_diffage = 0.0;		/* age of differential data (sec since last update) */
-	store->nav_acc_diffref = 0;		/* differential reference station */
-	store->nav_speed_ground = 0.0;		/* m/s */
-	store->nav_course_ground = 0.0;		/* radians */
-	store->nav_speed_water = 0.0;		/* m/s */
-	store->nav_course_water = 0.0;		/* radians */
-	store->nav_trk_offset_track = 0.0;	/* offset track (m) */
-	store->nav_trk_offset_sol = 0.0;	/* offset SOL (m) */
-	store->nav_trk_offset_eol = 0.0;	/* offset EOL (m) */
-	store->nav_trk_distance_sol = 0.0;	/* distance SOL (m) */
-	store->nav_trk_azimuth_sol = 0.0;	/* azimuth SOL (radians) */
-	store->nav_trk_distance_eol = 0.0;	/* distance EOL (m) */
-	store->nav_trk_azimuth_eol = 0.0;	/* azimuth EOL (radians) */
-	store->nav_hrp_heave = 0.0;		/* heave (m) */
-	store->nav_hrp_roll = 0.0;		/* roll (radians) */
-	store->nav_hrp_pitch = 0.0;		/* pitch (radians) */
-	store->nav_hea_heave = 0.0;		/* heave (m) */
-	store->nav_rol_roll = 0.0;		/* roll (radians) */
-	store->nav_pit_pitch = 0.0;		/* pitch (radians) */
-	store->nav_hdg_heading = 0.0;		/* heading (radians) */
-	store->nav_log_speed = 0.0;		/* speed (m/s) */
-	store->nav_gps_altitude = 0.0;		/* altitude with respect to geoid */
-	store->nav_gps_geoidalseparation = 0.0;	/* difference between WGS84 ellipsoid and geoid (m)
-							(positive means sea level geoid is above
-							ellipsoid) */
-
-	/* survey depth (multibeam frames) */
-	store->mul_frame = MB_NO;	/* boolean flag - multibeam frame read */
-	store->mul_group_beam = MB_NO;	/* boolean flag - beam group read */
-	store->mul_group_tt = MB_NO;	/* boolean flag - tt group read */
-	store->mul_group_quality = MB_NO;/* boolean flag - quality group read */
-	store->mul_group_amp = MB_NO;	/* boolean flag - amp group read */
-	store->mul_group_delay = MB_NO;	/* boolean flag - delay group read */
-	store->mul_group_lateral = MB_NO;/* boolean flag - lateral group read */
-	store->mul_group_along = MB_NO;	/* boolean flag - along group read */
-	store->mul_group_depth = MB_NO;	/* boolean flag - depth group read */
-	store->mul_group_angle = MB_NO;	/* boolean flag - angle group read */
-	store->mul_group_heave = MB_NO;	/* boolean flag - heave group read */
-	store->mul_group_roll = MB_NO;	/* boolean flag - roll group read */
-	store->mul_group_pitch = MB_NO;	/* boolean flag - pitch group read */
-	store->mul_group_gates = MB_NO;	/* boolean flag - gates group read */
-	store->mul_group_noise = MB_NO;	/* boolean flag - noise group read */
-	store->mul_group_length = MB_NO;/* boolean flag - length group read */
-	store->mul_group_hits = MB_NO;	/* boolean flag - hits group read */
-	store->mul_group_heavereceive = MB_NO;	/* boolean flag - heavereceive group read */
-	store->mul_group_azimuth = MB_NO;	/* boolean flag - azimuth group read */
-	store->mul_group_properties = MB_NO;	/* boolean flag - properties group read */
-	store->mul_group_normamp = MB_NO;	/* boolean flag - normalized amplitude group read */
-	store->mul_group_mbsystemnav = MB_NO;	/* boolean flag - mbsystemnav group read */
-	store->mul_source = 0;		/* sensor id */
-	store->mul_sec = 0;		/* sec since 1/1/1901 00:00 */
-	store->mul_usec = 0;		/* microseconds */
-	store->mul_lon = 0.0;		/* interpolated longitude in radians */
-	store->mul_lat = 0.0;		/* interpolated latitude in radians */
-	store->mul_heading = 0.0;	/* interpolated heading in radians */
-	store->mul_speed = 0.0;		/* interpolated speed in m/s */
-	store->mul_ping = 0;		/* ping number */
-	store->mul_frequency = 0.0;	/* transducer frequency (Hz) */
-	store->mul_pulse = 0.0;		/* transmit pulse length (sec) */
-	store->mul_power = 0.0;		/* transmit power (dB) */
-	store->mul_bandwidth = 0.0;	/* receive bandwidth (Hz) */
-	store->mul_sample = 0.0;		/* receive sample interval (sec) */
-	store->mul_swath = 0.0;		/* swath width (radians) */
-	store->mul_num_beams = 0;	/* number of beams */
-	for (i=0;i<MBSYS_XSE_MAXBEAMS;i++)
-	    {
-	    store->beams[i].tt = 0.0;
-	    store->beams[i].delay = 0.0;
-	    store->beams[i].lateral = 0.0;
-	    store->beams[i].along = 0.0;
-	    store->beams[i].depth = 0.0;
-	    store->beams[i].angle = 0.0;
-	    store->beams[i].heave = 0.0;
-	    store->beams[i].roll = 0.0;
-	    store->beams[i].pitch = 0.0;
-	    store->beams[i].beam = i + 1;
-	    store->beams[i].quality = 0;
-	    store->beams[i].amplitude = 0;
-	    store->beams[i].gate_angle = 0.0;
-	    store->beams[i].gate_start = 0.0;
-	    store->beams[i].gate_stop = 0.0;
-	    store->beams[i].noise = 0.0;
-	    store->beams[i].length = 0.0;
-	    store->beams[i].hits = 0;
-	    store->beams[i].heavereceive = 0.0;
-	    store->beams[i].azimuth = 0.0;
-	    }
-	store->mul_num_properties = 0;     /* number of properties */
- 	for (i=0;i<MBSYS_XSE_MAXPROPERTIES;i++)
-	    {
-	    store->mul_properties_type[i] = 0;
-            store->mul_properties_value[i] = 0.0;
-	    }
-	for (i=0;i<MBSYS_XSE_MAXPROPERTIES;i++)
-	    {
-	    store->mul_properties_reserved[i] = 0;
-	    }
-
-	/* survey sidescan (sidescan frames) */
-	store->sid_frame = MB_NO;		/* boolean flag - sidescan frame read */
-	store->sid_group_avt = MB_NO;		/* boolean flag - amp vs time group read */
-	store->sid_group_pvt = MB_NO;		/* boolean flag - phase vs time group read */
-	store->sid_group_avl = MB_NO;		/* boolean flag - amp vs lateral group read */
-	store->sid_group_pvl = MB_NO;		/* boolean flag - phase vs lateral group read */
-	store->sid_group_signal = MB_NO;	/* boolean flag - phase vs lateral group read */
-	store->sid_group_ping = MB_NO;		/* boolean flag - phase vs lateral group read */
-	store->sid_group_complex = MB_NO;	/* boolean flag - phase vs lateral group read */
-	store->sid_group_weighting = MB_NO;	/* boolean flag - phase vs lateral group read */
-	store->sid_source = 0;		/* sensor id */
-	store->sid_sec = 0;	/* sec since 1/1/1901 00:00 */
-	store->sid_usec = 0;	/* microseconds */
-	store->sid_ping = 0;		/* ping number */
-	store->sid_frequency = 0.0;		/* transducer frequency (Hz) */
-	store->sid_pulse = 0.0;		/* transmit pulse length (sec) */
-	store->sid_power = 0.0;		/* transmit power (dB) */
-	store->sid_bandwidth = 0.0;		/* receive bandwidth (Hz) */
-	store->sid_sample = 0.0;		/* receive sample interval (sec) */
-	store->sid_avt_sampleus = 0;	/* sample interval (usec) */
-	store->sid_avt_offset = 0;		/* time offset (usec) */
-	store->sid_avt_num_samples = 0;	/* number of samples */
-	for (i=0;i<MBSYS_XSE_MAXPIXELS;i++)
-		store->sid_avt_amp[i] = 0; /* sidescan amplitude (dB) */
-	store->sid_pvt_sampleus = 0;	/* sample interval (usec) */
-	store->sid_pvt_offset = 0;		/* time offset (usec) */
-	store->sid_pvt_num_samples = 0;	/* number of samples */
-	for (i=0;i<MBSYS_XSE_MAXPIXELS;i++)
-		store->sid_pvt_phase[i] = 0; /* sidescan phase (radians) */
-	store->sid_avl_binsize = 0;	/* bin size (mm) */
-	store->sid_avl_offset = 0;		/* lateral offset (mm) */
-	store->sid_avl_num_samples = 0;	/* number of samples */
-	for (i=0;i<MBSYS_XSE_MAXPIXELS;i++)
-		store->sid_avl_amp[i] = 0; /* sidescan amplitude (dB) */
-	store->sid_pvl_binsize = 0;	/* bin size (mm) */
-	store->sid_pvl_offset = 0;		/* lateral offset (mm) */
-	store->sid_pvl_num_samples = 0;	/* number of samples */
-	for (i=0;i<MBSYS_XSE_MAXPIXELS;i++)
-		store->sid_pvl_phase[i] = 0; /* sidescan phase (radians) */
-	store->sid_sig_ping = 0;		/* ping number */
-	store->sid_sig_channel = 0;	/* channel number */
-	store->sid_sig_offset = 0.0;		/* start offset */
-	store->sid_sig_sample = 0.0;		/* bin size / sample interval */
-	store->sid_sig_num_samples = 0;	/* number of samples */
-	for (i=0;i<MBSYS_XSE_MAXPIXELS;i++)
-		store->sid_sig_phase[i] = 0; /* sidescan phase in radians */
-	store->sid_png_pulse = 0;	/* pulse type (0=constant, 1=linear sweep) */
-	store->sid_png_startfrequency = 0.0;	/* start frequency (Hz) */
-	store->sid_png_endfrequency = 0.0;	/* end frequency (Hz) */
-	store->sid_png_duration = 0.0;	/* pulse duration (msec) */
-	store->sid_png_mancode = 0;	/* manufacturer code (1=Edgetech, 2=Elac) */
-	store->sid_png_pulseid = 0;/* pulse identifier */
-	for (i=0;i<MBSYS_XSE_DESCRIPTION_LENGTH;i++)
-		store->sid_png_pulsename[i] = 0;	/* pulse name */
-	store->sid_cmp_ping = 0;		/* ping number */
-	store->sid_cmp_channel = 0;	/* channel number */
-	store->sid_cmp_offset = 0.0;		/* start offset (usec) */
-	store->sid_cmp_sample = 0.0;		/* bin size / sample interval (usec) */
-	store->sid_cmp_num_samples = 0;	/* number of samples */
-	for (i=0;i<MBSYS_XSE_MAXPIXELS;i++)
-		store->sid_cmp_real[i] = 0; /* real sidescan signal */
-	for (i=0;i<MBSYS_XSE_MAXPIXELS;i++)
-		store->sid_cmp_imaginary[i] = 0; /* imaginary sidescan signal */
-	store->sid_wgt_factorleft = 0;		/* weighting factor for block floating
-						point expansion  --
-						defined as 2^(-N) volts for lsb */
-	store->sid_wgt_samplesleft = 0;	/* number of left samples */
-	store->sid_wgt_factorright = 0;		/* weighting factor for block floating
-						point expansion  --
-						defined as 2^(-N) volts for lsb */
-	store->sid_wgt_samplesright = 0;	/* number of right samples */
-
-	/* seabeam (seabeam frames) */
-	store->sbm_properties = MB_NO;		/* boolean flag - sbm properties group read */
-	store->sbm_hrp = MB_NO;			/* boolean flag - sbm hrp group read */
-	store->sbm_signal = MB_NO;		/* boolean flag - sbm signal group read */
-	store->sbm_sweepsegments = MB_NO;	/* boolean flag - sbm sweep segments group read */
-	store->sbm_spacingmode = MB_NO;		/* boolean flag - sbm spacing mode group read */
-	store->sbm_message = MB_NO;		/* boolean flag - sbm message group read */
-	store->sbm_source = 0;			/* sensor id */
-	store->sbm_sec = 0;			/* sec since 1/1/1901 00:00 */
-	store->sbm_usec = 0;			/* microseconds */
-	store->sbm_ping = 0;			/* ping number */
-	store->sbm_ping_gain = 0.0;		/* ping gain (dB) */
-	store->sbm_pulse_width = 0.0;		/* pulse width (s) */
-	store->sbm_transmit_power = 0.0;	/* transmit power (dB) */
-	store->sbm_pixel_width = 0.0;		/* pixel width (m) */
-	store->sbm_swath_width = 0.0;		/* swath width (radians) */
-	store->sbm_time_slice = 0.0;		/* time slice (s) */
-	store->sbm_depth_mode = 0;		/* depth mode (1=shallow, 2=deep) */
-	store->sbm_beam_mode = 0;		/* focused beam mode (0=off, 1=on) */
-	store->sbm_ssv = 0.0;			/* surface sound velocity (m/s) */
-	store->sbm_frequency = 0.0;		/* sonar frequency (kHz) */
-	store->sbm_bandwidth = 0.0;		/* receiver bandwidth (kHz) */
-	store->sbm_heave = 0.0;			/* heave (m) */
-	store->sbm_roll = 0.0;			/* roll (radians) */
-	store->sbm_pitch = 0.0;			/* pitch (radians) */
-	store->sbm_signal_beam = 0;		/* beam number for signal */
-	store->sbm_signal_count = 0;		/* number of samples in signal */
-	for (i=0;i<MBSYS_XSE_MAXSAMPLES;i++)
-	    store->sbm_signal_amp[i] = 0.0;	/* signal values */
-	store->sbm_message_id = 0;			/* seabeam message id */
-	store->sbm_message_len = 0;			/* seabeam message length */
-	for (i=0;i<MBSYS_XSE_COMMENT_LENGTH;i++)
-	    store->sbm_message_txt[i] = 0; 	/* seabeam message */
-        store->sbm_sweep_direction = 0;    	/* sweep direction 0=static, 1=port, 2=starboard */
-        store->sbm_sweep_azimuth = 0.0;      	/* effective azimuth (radians) */
-        store->sbm_sweep_segments = 0; 		/* number of segments */
-        store->sbm_sweep_seconds = 0;  		/* seconds since start of ping and end of sweep segment */
-        store->sbm_sweep_micro = 0;    		/* microseconds of seconds */
-        store->sbm_sweep_extrapolateazimuth = 0.0;   	/* extrapolated azimuth at center of sweep segment (radians) */
-        store->sbm_sweep_interpolatedazimuth = 0.0;  	/* interpolated azimuth at center of sweep segment (radians) */
-        store->sbm_sweep_extrapolatepitch = 0.0;   	/* extrapolated pitch at center of sweep segment (radians) */
-        store->sbm_sweep_interpolatedpitch = 0.0;  	/* interpolated pitch at center of sweep segment (radians) */
-        store->sbm_sweep_extrapolateroll = 0.0;   	/* extrapolated roll at center of sweep segment (radians) */
-        store->sbm_sweep_interpolatedroll = 0.0;  	/* interpolated roll at center of sweep segment (radians) */
-        store->sbm_sweep_stabilizedangle = 0.0;   	/* sweep segment stabilized angle (radians) */
-
-	/* comment */
-	for (i=0;i<MBSYS_XSE_COMMENT_LENGTH;i++)
-	    store->comment[i] = 0;
-
-	/* unsupported frame */
-	store->rawsize = 0;
-	for (i=0;i<MBSYS_XSE_COMMENT_LENGTH;i++)
-	    store->raw[i] = 0;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)*store_ptr);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_xse_deall(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_xse_deall";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)*store_ptr);
-		}
-
-	/* deallocate memory for data structure */
-	status = mb_free(verbose,store_ptr,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_xse_dimensions(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int *nbath, int *namp, int *nss, int *error)
-{
-	char	*function_name = "mbsys_xse_dimensions";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_xse_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_xse_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get beam and pixel numbers */
-		*nbath = 0;
-		*namp = 0;
-		*nss = 0;
-		if (store->mul_frame == MB_YES)
-		    {
-		    *nbath = store->mul_num_beams;
-		    if (store->mul_group_amp == MB_YES)
-			    *namp = store->mul_num_beams;
-		    }
-
-		if (store->sid_frame == MB_YES)
-		    {
-		    if (store->sid_group_avl == MB_YES)
-		    	*nss = store->sid_avl_num_samples;
-		    }
-		}
-
-	/* extract data from structure */
-	else
-		{
-		/* get beam and pixel numbers */
-		*nbath = 0;
-		*namp = 0;
-		*nss = 0;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		fprintf(stderr,"dbg2       nbath:      %d\n",*nbath);
-		fprintf(stderr,"dbg2        namp:      %d\n",*namp);
-		fprintf(stderr,"dbg2        nss:       %d\n",*nss);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_xse_extract(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int time_i[7], double *time_d,
-		double *navlon, double *navlat,
-		double *speed, double *heading,
-		int *nbath, int *namp, int *nss,
-		char *beamflag, double *bath, double *amp,
-		double *bathacrosstrack, double *bathalongtrack,
-		double *ss, double *ssacrosstrack, double *ssalongtrack,
-		char *comment, int *error)
-{
-	char	*function_name = "mbsys_xse_extract";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_xse_struct *store;
-	double	xtrackmin, xtrackmax;
-	int	ixtrackmin, ixtrackmax;
-	double	dsign;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_xse_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get time */
-		*time_d = store->mul_sec
-			    - MBSYS_XSE_TIME_OFFSET
-			    + 0.000001 * store->mul_usec;
-		mb_get_date(verbose,*time_d,time_i);
-
-		/* get navigation */
-		*navlon = RTD * store->mul_lon;
-		*navlat = RTD * store->mul_lat;
-
-		/* get heading and speed */
-		*heading = RTD * store->mul_heading;
-
-		/* get speed  */
-		*speed  = 3.6 * store->mul_speed;
-
-		/* set beamwidths in mb_io structure */
-		if (store->mul_frequency >= 50.0
-		    || store->mul_frequency <= 0.0)
-		    {
-		    mb_io_ptr->beamwidth_ltrack
-			= 2.8;
-		    mb_io_ptr->beamwidth_xtrack
-			= 1.5;
-		    }
-		else
-		    {
-		    mb_io_ptr->beamwidth_ltrack
-			= 1.0;
-		    mb_io_ptr->beamwidth_xtrack
-			= 1.0;
-		    }
-
-		/* get distance and depth values */
-		*nbath = 0;
-		*namp = 0;
-		*nss = 0;
-		if (store->mul_frame == MB_YES)
-		    {
-		    /* set number of beams */
-		    *nbath = store->mul_num_beams;
-		    if (store->mul_group_amp == MB_YES)
-			    *namp = store->mul_num_beams;
-
-		    /* determine whether beams are ordered
-			port to starboard or starboard to port */
-		    xtrackmin = 0.0;
-		    xtrackmax = 0.0;
-		    ixtrackmin = 0;
-		    ixtrackmax = 0;
-		    for (i=0;i<store->mul_num_beams;i++)
-			{
-			if (store->beams[i].lateral < xtrackmin)
-			    {
-			    xtrackmin = store->beams[i].lateral;
-			    ixtrackmin = i;
-			    }
-			if (store->beams[i].lateral > xtrackmax)
-			    {
-			    xtrackmax = store->beams[i].lateral;
-			    ixtrackmax = i;
-			    }
-			}
-		    if (ixtrackmax > ixtrackmin)
-			dsign = -1.0;
-		    else
-			dsign = 1.0;
-
-/*
-fprintf(stderr, "itrack: %d %d   freq:%f\n",
-ixtrackmin, ixtrackmax, store->mul_frequency);
-*/
-
-		    /* now extract the bathymetry */
-		    for (i=0;i<store->mul_num_beams;i++)
-			{
-			j = store->mul_num_beams - store->beams[i].beam;
-			if (store->beams[i].quality == 1)
-			    beamflag[j] = MB_FLAG_NONE;
-			else if (store->beams[i].quality < 8)
-			    beamflag[j] = MB_FLAG_SONAR + MB_FLAG_FLAG;
-			else if (store->beams[i].quality == 8)
-			    beamflag[j] = MB_FLAG_NULL;
-			else if (store->beams[i].quality == 10)
-			    beamflag[j] = MB_FLAG_MANUAL + MB_FLAG_FLAG;
-			else if (store->beams[i].quality == 20)
-			    beamflag[j] = MB_FLAG_FILTER + MB_FLAG_FLAG;
-			else
-			    beamflag[j] = MB_FLAG_NULL;
-
-			/* bathymetry from SeaBeam 2100 multibeams is already heave and draft compensated
-				- bathymetry from Bottomchart multibeams need to have
-				heave and draft applied */
-			bath[j] = store->beams[i].depth;
-			if (store->par_ship_nsensor > 0
-				&& (store->par_ship_sensor_type[0] < 2000
-					|| store->par_ship_sensor_type[0] > 3000))
-				{
-				bath[j] += store->beams[i].heave;
-				if (store->beams[i].lateral < 0.0)
-				    bath[j] += store->par_trans_z_port;
-				else
-				    bath[j] += store->par_trans_z_stbd;
-				}
-			bathacrosstrack[j]
-				= dsign * store->beams[i].lateral;
-			bathalongtrack[j]
-				= store->beams[i].along;
-			amp[j] = store->beams[i].amplitude;
-			}
-		    }
-
-		/* get sidescan */
-		if (store->sid_frame == MB_YES)
-		    {
-		    if (store->sid_group_avl == MB_YES)
-		    	{
-		    	*nss = store->sid_avl_num_samples;
-			for (i=0;i<*nss;i++)
-			    {
-			    j = *nss - i - 1;
-			    ss[j] = store->sid_avl_amp[i];
-			    ssacrosstrack[j]
-				= dsign * 0.001 * store->sid_avl_binsize
-				    * (i - *nss / 2);
-			    if (store->mul_frame == MB_YES)
-				ssalongtrack[j]
-				    = 0.5 * store->nav_speed_ground
-					* (store->sid_sec + 0.000001 * store->sid_usec
-					    - (store->mul_sec + 0.000001 * store->mul_usec));
-			    else
-				ssalongtrack[j] = 0.0;
-			    }
-			}
-		    }
-
-		/* done translating values */
-
-		}
-
-	/* extract data from structure */
-	else if (*kind == MB_DATA_NAV)
-		{
-		/* get time */
-		*time_d = store->nav_sec
-			    - MBSYS_XSE_TIME_OFFSET
-			    + 0.000001 * store->nav_usec;
-		mb_get_date(verbose,*time_d,time_i);
-
-		/* get navigation */
-		*navlon = RTD * store->nav_x;
-		*navlat = RTD * store->nav_y;
-
-		/* get heading */
-		if (store->nav_group_heading == MB_YES)
-			*heading = RTD * store->nav_hdg_heading;
-		else if (store->nav_group_motiongt == MB_YES)
-			*heading = RTD * store->nav_course_ground;
-		else if (store->nav_group_motiontw == MB_YES)
-			*heading = RTD * store->nav_course_water;
-		else
-			mb_hedint_interp(verbose, mbio_ptr, *time_d,
-				 heading, error);
-
-		/* get speed  */
-		if (store->nav_group_log == MB_YES)
-			*speed = 3.6 * store->nav_log_speed;
-		else if (store->nav_group_motiongt == MB_YES)
-			*speed = 3.6 * store->nav_speed_ground;
-		else if (store->nav_group_motiontw == MB_YES)
-			*speed = 3.6 * store->nav_speed_water;
-
-		/* get distance and depth values */
-		*nbath = 0;
-		*namp = 0;
-		*nss = 0;
-
-		/* done translating values */
-
-		}
-
-	/* extract comment from structure */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* copy comment */
-		strcpy(comment,store->comment);
-
-		/* print debug statements */
-		if (verbose >= 4)
-			{
-			fprintf(stderr,"\ndbg4  New ping read by MBIO function <%s>\n",
-				function_name);
-			fprintf(stderr,"dbg4  New ping values:\n");
-			fprintf(stderr,"dbg4       error:      %d\n",
-				*error);
-			fprintf(stderr,"dbg4       comment:    %s\n",
-				comment);
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind == MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"dbg2       comment:     \ndbg2       %s\n",
-			comment);
-		}
-	else if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind != MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"dbg2       time_i[0]:     %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:     %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:     %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:     %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:     %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:     %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:     %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:        %f\n",*time_d);
-		fprintf(stderr,"dbg2       longitude:     %f\n",*navlon);
-		fprintf(stderr,"dbg2       latitude:      %f\n",*navlat);
-		fprintf(stderr,"dbg2       speed:         %f\n",*speed);
-		fprintf(stderr,"dbg2       heading:       %f\n",*heading);
-		}
-	if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind == MB_DATA_DATA)
-		{
-		fprintf(stderr,"dbg2       nbath:      %d\n",
-			*nbath);
-		for (i=0;i<*nbath;i++)
-		  fprintf(stderr,"dbg2       beam:%d  flag:%3d  bath:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,beamflag[i],bath[i],
-			bathacrosstrack[i],bathalongtrack[i]);
-		fprintf(stderr,"dbg2        namp:     %d\n",
-			*namp);
-		for (i=0;i<*namp;i++)
-		  fprintf(stderr,"dbg2       beam:%d   amp:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,amp[i],bathacrosstrack[i],bathalongtrack[i]);
-		fprintf(stderr,"dbg2        nss:      %d\n",
-			*nss);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_xse_insert(int verbose, void *mbio_ptr, void *store_ptr,
-		int kind, int time_i[7], double time_d,
-		double navlon, double navlat,
-		double speed, double heading,
-		int nbath, int namp, int nss,
-		char *beamflag, double *bath, double *amp,
-		double *bathacrosstrack, double *bathalongtrack,
-		double *ss, double *ssacrosstrack, double *ssalongtrack,
-		char *comment, int *error)
-{
-	char	*function_name = "mbsys_xse_insert";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_xse_struct *store;
-	double	maxoffset, xtrackmin, xtrackmax;
-	int	imaxoffset, ixtrackmin, ixtrackmax;
-	double	dsign;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       kind:       %d\n",kind);
-		}
-	if (verbose >= 2 && (kind == MB_DATA_DATA || kind == MB_DATA_NAV))
-		{
-		fprintf(stderr,"dbg2       time_i[0]:  %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:  %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:  %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:  %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:  %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:  %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:  %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:     %f\n",time_d);
-		fprintf(stderr,"dbg2       navlon:     %f\n",navlon);
-		fprintf(stderr,"dbg2       navlat:     %f\n",navlat);
-		fprintf(stderr,"dbg2       speed:      %f\n",speed);
-		fprintf(stderr,"dbg2       heading:    %f\n",heading);
-		}
-	if (verbose >= 2 && kind == MB_DATA_DATA)
-		{
-		fprintf(stderr,"dbg2       nbath:      %d\n",nbath);
-		if (verbose >= 3)
-		 for (i=0;i<nbath;i++)
-		  fprintf(stderr,"dbg3       beam:%d  flag:%3d  bath:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,beamflag[i],bath[i],
-			bathacrosstrack[i],bathalongtrack[i]);
-		fprintf(stderr,"dbg2       namp:       %d\n",namp);
-		if (verbose >= 3)
-		 for (i=0;i<namp;i++)
-		  fprintf(stderr,"dbg3        beam:%d   amp:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,amp[i],bathacrosstrack[i],bathalongtrack[i]);
-			fprintf(stderr,"dbg4       nss:        %d\n",
-				nss);
-			for (i=0;i<nss;i++)
-			  fprintf(stderr,"dbg4        pixel:%d   ss:%f  acrosstrack:%f  alongtrack:%f\n",
-				i,ss[i],ssacrosstrack[i],ssalongtrack[i]);
-		}
-	if (verbose >= 2 && kind == MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"dbg2       comment:     \ndbg2       %s\n",
-			comment);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_xse_struct *) store_ptr;
-
-	/* set data kind */
-	store->kind = kind;
-
-	/* insert data in structure */
-	if (store->kind == MB_DATA_DATA)
-		{
-		/* get time */
-		store->mul_sec = (unsigned int) (time_d + MBSYS_XSE_TIME_OFFSET);
-		store->mul_usec = (time_d
-				    - ((int) time_d)) * 1000000;
-		store->sid_sec = store->mul_sec;
-		store->sid_usec = store->mul_usec;
-
-		/*get navigation */
-		store->mul_lon = DTR * navlon;
-		store->mul_lat = DTR * navlat;
-
-		/* get heading */
-		store->mul_heading = DTR * heading;
-
-		/* get speed */
-		store->mul_speed = speed / 3.6;
-
-		/* insert distance and depth values into storage arrays */
-		xtrackmin = 0.0;
-		xtrackmax = 0.0;
-		ixtrackmin = 0;
-		ixtrackmax = 0;
-		if (store->mul_frame == MB_YES)
-		    {
-		    /* determine whether beams are ordered
-			port to starboard or starboard to port */
-		    for (i=0;i<store->mul_num_beams;i++)
-			{
-			if (store->beams[i].lateral < xtrackmin)
-			    {
-			    xtrackmin = store->beams[i].lateral;
-			    ixtrackmin = i;
-			    }
-			if (store->beams[i].lateral > xtrackmax)
-			    {
-			    xtrackmax = store->beams[i].lateral;
-			    ixtrackmax = i;
-			    }
-			}
-		    if (ixtrackmax > ixtrackmin)
-			dsign = -1.0;
-		    else
-			dsign = 1.0;
-
-		    /* now insert the bathymetry */
-		    for (i=0;i<store->mul_num_beams;i++)
-			{
-			j = store->mul_num_beams - store->beams[i].beam;
-			if (j < nbath)
-			    {
-			    if (mb_beam_check_flag(beamflag[j]))
-				{
-				if (mb_beam_check_flag_null(beamflag[j]))
-				    store->beams[i].quality = 8;
-				else if (mb_beam_check_flag_manual(beamflag[j]))
-				    store->beams[i].quality = 10;
-				else if (mb_beam_check_flag_filter(beamflag[j]))
-				    store->beams[i].quality = 20;
-				else if (store->beams[i].quality == 1)
-				    store->beams[i].quality = 7;
-				}
-			    else
-				store->beams[i].quality = 1;
-			    store->beams[i].lateral = dsign * bathacrosstrack[j];
-			    store->beams[i].along = bathalongtrack[j];
-			    store->beams[i].amplitude = (int) (amp[j]);
-
-			    /* bathymetry from SeaBeam 2100 multibeams stored heave and draft compensated
-				    - bathymetry from Bottomchart multibeams need to have
-				    heave and draft removed before storage */
-			    store->beams[i].depth = bath[j];
-			    if (store->par_ship_nsensor > 0
-				    && (store->par_ship_sensor_type[0] < 2000
-					    || store->par_ship_sensor_type[0] > 3000))
-				    {
-				    if (store->beams[i].lateral < 0.0)
-					store->beams[i].depth
-					    -= (store->beams[i].heave
-				    		+ store->par_trans_z_port);
-				    else
-					store->beams[i].depth
-					    -= (store->beams[i].heave
-				    		+ store->par_trans_z_stbd);
-				    }
-			    }
-			}
-		    }
-
-		/* now insert the sidescan */
-		if (store->sid_frame == MB_YES)
-		    {
-		    store->sid_group_avl = MB_YES;
-		    if (nss != store->sid_avl_num_samples)
-			{
-			store->sid_avl_num_samples = nss;
-			maxoffset = 0.0;
-			imaxoffset = -1;
-			for (i=0;i<nss;i++)
-			    {
-			    if (fabs(ssacrosstrack[i]) > maxoffset)
-				{
-				maxoffset = fabs(ssacrosstrack[i]);
-				imaxoffset = i - (nss / 2);
-				}
-			    }
-			if (maxoffset > 0.0 && imaxoffset != 0)
-			    store->sid_avl_binsize = (int)(1000 * maxoffset / imaxoffset);
-			}
-		    for (i=0;i<store->sid_avl_num_samples;i++)
-			{
-			j = store->sid_avl_num_samples - i - 1;
-			if (j < nss)
-			    {
-			    store->sid_avl_amp[i]= ss[j];
-			    }
-			}
-		    }
-		}
-	else if (store->kind == MB_DATA_NAV)
-		{
-		/* get time */
-		store->nav_sec = (unsigned int) (time_d + MBSYS_XSE_TIME_OFFSET);
-		store->nav_usec = (time_d
-				    - ((int) time_d)) * 1000000;
-
-		/*get navigation */
-		store->nav_group_position = MB_YES;
-		store->nav_x = DTR * navlon;
-		store->nav_y = DTR * navlat;
-
-		/* get heading */
-		store->nav_group_heading = MB_YES;
-		store->nav_hdg_heading = DTR * heading;
-
-		/* get speed */
-		store->nav_group_log = MB_YES;
-		store->nav_log_speed = speed / 3.6;
-		}
-
-	/* insert comment in structure */
-	else if (store->kind == MB_DATA_COMMENT)
-		{
-		strncpy(store->comment,comment,199);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_xse_ttimes(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, int *nbeams,
-	double *ttimes, double *angles,
-	double *angles_forward, double *angles_null,
-	double *heave, double *alongtrack_offset,
-	double *draft, double *ssv, int *error)
-{
-	char	*function_name = "mbsys_xse_ttimes";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_xse_struct *store;
-	double	xtrackmin, xtrackmax;
-	int	ixtrackmin, ixtrackmax;
-	double	dsign;
-	double	alpha, beta;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       ttimes:     %p\n",(void *)ttimes);
-		fprintf(stderr,"dbg2       angles_xtrk:%p\n",(void *)angles);
-		fprintf(stderr,"dbg2       angles_ltrk:%p\n",(void *)angles_forward);
-		fprintf(stderr,"dbg2       angles_null:%p\n",(void *)angles_null);
-		fprintf(stderr,"dbg2       heave:      %p\n",(void *)heave);
-		fprintf(stderr,"dbg2       ltrk_off:   %p\n",(void *)alongtrack_offset);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_xse_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get draft */
-		if (store->par_parameter == MB_YES)
-			*draft = 0.5 * (store->par_trans_z_port
-				    + store->par_trans_z_stbd);
-		else
-			*draft = store->par_ship_draft;
-
-		/* get ssv */
-		if (store->sbm_ssv > 0.0)
-		    *ssv = store->sbm_ssv;
-		else
-		    *ssv = store->svp_ssv;
-
-		/* get travel times, angles */
-		*nbeams = 0;
-		if (store->mul_frame == MB_YES)
-		    {
-		    /* determine whether beams are ordered
-			port to starboard or starboard to port */
-		    xtrackmin = 0.0;
-		    xtrackmax = 0.0;
-		    ixtrackmin = 0;
-		    ixtrackmax = 0;
-		    for (i=0;i<store->mul_num_beams;i++)
-			{
-			if (store->beams[i].lateral < xtrackmin)
-			    {
-			    xtrackmin = store->beams[i].lateral;
-			    ixtrackmin = i;
-			    }
-			if (store->beams[i].lateral > xtrackmax)
-			    {
-			    xtrackmax = store->beams[i].lateral;
-			    ixtrackmax = i;
-			    }
-			}
-		    if (ixtrackmax > ixtrackmin)
-			dsign = -1.0;
-		    else
-			dsign = 1.0;
-
-		    /* loop over beams */
-		    for (i=0;i<store->mul_num_beams;i++)
-			{
-			j = store->mul_num_beams - store->beams[i].beam;
-			*nbeams = MAX(store->beams[i].beam, *nbeams);
-			ttimes[j] = store->beams[i].tt;
-			beta = 90.0 - dsign * RTD * store->beams[i].angle;
-			alpha = RTD * store->beams[i].pitch;
-			mb_rollpitch_to_takeoff(verbose,
-			    alpha, beta, &angles[j],
-			    &angles_forward[j], error);
-			if (store->mul_frequency >= 50000.0
-				|| store->mul_frequency <= 0.0)
-			    {
-			    if (store->beams[j].angle < 0.0)
-				{
-				angles_null[j] = 37.5
-					+ RTD
-					* store->par_trans_err_port;
-				}
-			    else
-				{
-				angles_null[j] = 37.5
-					+ RTD
-					* store->par_trans_err_stbd;
-				}
-			    }
-			else
-			    {
-			    angles_null[j] = 0.0;
-			    }
-			heave[j] = store->beams[i].heave;
-			alongtrack_offset[j]
-			    = 0.5 * store->nav_speed_ground
-				    * store->beams[i].delay;
-			}
-		    }
-
-		/* set status */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error == MB_ERROR_NO_ERROR)
-		{
-		fprintf(stderr,"dbg2       draft:      %f\n",*draft);
-		fprintf(stderr,"dbg2       ssv:        %f\n",*ssv);
-		fprintf(stderr,"dbg2       nbeams:     %d\n",*nbeams);
-		for (i=0;i<*nbeams;i++)
-			fprintf(stderr,"dbg2       beam %d: tt:%f  angle_xtrk:%f  angle_ltrk:%f  angle_null:%f  heave:%f  ltrk_off:%f\n",
-				i,ttimes[i],angles[i],
-				angles_forward[i],angles_null[i],
-				heave[i],alongtrack_offset[i]);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_xse_detects(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, int *nbeams,
-	int *detects, int *error)
-{
-	char	*function_name = "mbsys_xse_detects";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_xse_struct *store;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       detects:    %p\n",(void *)detects);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_xse_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get nbeams */
-		*nbeams = mb_io_ptr->beams_bath_max;
-
-		/* get detects */
-		for (i=0;i<*nbeams;i++)
-			{
-			detects[i] = MB_DETECT_AMPLITUDE;
-			}
-
-		/* get nbeams and detects */
-		*nbeams = 0;
-		if (store->mul_frame == MB_YES)
-		    {
-		    /* loop over beams to get nbeams */
-		    for (i=0;i<store->mul_num_beams;i++)
-			{
-			j = store->mul_num_beams - store->beams[i].beam;
-			*nbeams = MAX(store->beams[i].beam, *nbeams);
-			}
-
-		    /* loop over beams to set detects */
-		    for (i=0;i<*nbeams;i++)
-			{
-			detects[i] = MB_DETECT_UNKNOWN;
-			}
-		    }
-
-		/* set status */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error == MB_ERROR_NO_ERROR)
-		{
-		fprintf(stderr,"dbg2       nbeams:     %d\n",*nbeams);
-		for (i=0;i<*nbeams;i++)
-			fprintf(stderr,"dbg2       beam %d: detects:%d\n",
-				i,detects[i]);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_xse_extract_altitude(int verbose, void *mbio_ptr, void *store_ptr,
-	int *kind, double *transducer_depth, double *altitude,
-	int *error)
-{
-	char	*function_name = "mbsys_xse_extract_altitude";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_xse_struct *store;
-	double	bath_best;
-	double	xtrack_min;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_xse_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get draft */
-		if (store->par_parameter == MB_YES)
-			*transducer_depth = 0.5 * (store->par_trans_z_port
-				    + store->par_trans_z_stbd);
-		else
-			*transducer_depth = store->par_ship_draft;
-
-		bath_best = 0.0;
-		if (store->mul_num_beams > 0)
-		    {
-		    *transducer_depth -= store->beams[store->mul_num_beams/2].heave;
-		    if (store->beams[store->mul_num_beams/2].quality == 1)
-			bath_best = store->beams[store->mul_num_beams/2].depth;
-		    else
-			{
-			xtrack_min = 99999999.9;
-			for (i=0;i<store->mul_num_beams;i++)
-			    {
-			    if (store->beams[i].quality == 1
-				&& fabs(store->beams[i].lateral)
-				    < xtrack_min)
-				{
-				xtrack_min = fabs(store->beams[i].lateral);
-				bath_best = store->beams[i].depth;
-				}
-			    }
-			}
-		    if (bath_best <= 0.0)
-			{
-			xtrack_min = 99999999.9;
-			for (i=0;i<store->mul_num_beams;i++)
-			    {
-			    if (store->beams[i].quality < 8
-				&& fabs(store->beams[i].lateral)
-				    < xtrack_min)
-				{
-				xtrack_min = fabs(store->beams[i].lateral);
-				bath_best = store->beams[i].depth;
-				}
-			    }
-			}
-		    }
-		*altitude = bath_best - *transducer_depth;
-
-		/* set status */
-		*error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:              %d\n",*kind);
-		fprintf(stderr,"dbg2       transducer_depth:  %f\n",*transducer_depth);
-		fprintf(stderr,"dbg2       altitude:          %f\n",*altitude);
-		fprintf(stderr,"dbg2       error:             %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:            %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_xse_extract_nav(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int time_i[7], double *time_d,
-		double *navlon, double *navlat,
-		double *speed, double *heading, double *draft,
-		double *roll, double *pitch, double *heave,
-		int *error)
-{
-	char	*function_name = "mbsys_xse_extract_nav";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_xse_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_xse_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_DATA)
-		{
-		/* get time */
-		*time_d = store->mul_sec
-			    - MBSYS_XSE_TIME_OFFSET
-			    + 0.000001 * store->mul_usec;
-		mb_get_date(verbose,*time_d,time_i);
-
-		/* get navigation */
-		*navlon = RTD * store->mul_lon;
-		*navlat = RTD * store->mul_lat;
-
-		/* get heading */
-		*heading = RTD * store->mul_heading;
-
-		/* get speed  */
-		*speed  = 3.6 * store->mul_speed;
-
-		/* get draft */
-		if (store->par_parameter == MB_YES)
-			*draft = 0.5 * (store->par_trans_z_port
-				    + store->par_trans_z_stbd);
-		else
-			*draft = store->par_ship_draft;
-
-		/* get roll pitch and heave */
-		if (store->mul_num_beams > 0)
-			{
-			*roll = RTD * store->beams[store->mul_num_beams/2].roll;
-			*pitch = RTD * store->beams[store->mul_num_beams/2].pitch;
-			*heave = store->beams[store->mul_num_beams/2].heave;
-			}
-		else if (store->nav_group_hrp == MB_YES)
-			{
-			*roll = RTD * store->nav_hrp_roll;
-			*pitch = RTD * store->nav_hrp_pitch;
-			*heave = store->nav_hrp_heave;
-			}
-		else if (store->nav_group_heave == MB_YES
-			&& store->nav_group_roll == MB_YES
-			&& store->nav_group_pitch == MB_YES)
-			{
-			*roll = RTD * store->nav_rol_roll;
-			*pitch = RTD * store->nav_pit_pitch;
-			*heave = store->nav_hea_heave;
-			}
-		else
-			{
-			*roll = 0.0;
-			*pitch = 0.0;
-			*heave = 0.0;
-			}
-
-		/* done translating values */
-
-		}
-
-	/* extract data from structure */
-	else if (*kind == MB_DATA_NAV)
-		{
-		/* get time */
-		*time_d = store->nav_sec
-			    - MBSYS_XSE_TIME_OFFSET
-			    + 0.000001 * store->nav_usec;
-		mb_get_date(verbose,*time_d,time_i);
-
-		/* get heading */
-		if (store->nav_group_heading == MB_YES)
-			*heading = RTD * store->nav_hdg_heading;
-		else if (store->nav_group_motiongt == MB_YES)
-			*heading = RTD * store->nav_course_ground;
-		else if (store->nav_group_motiontw == MB_YES)
-			*heading = RTD * store->nav_course_water;
-		else
-			mb_hedint_interp(verbose, mbio_ptr, *time_d,
-				 heading, error);
-
-		/* get speed if possible */
-		if (store->nav_group_log == MB_YES)
-			*speed = 3.6 * store->nav_log_speed;
-		else if (store->nav_group_motiongt == MB_YES)
-			*speed = 3.6 * store->nav_speed_ground;
-		else if (store->nav_group_motiontw == MB_YES)
-			*speed = 3.6 * store->nav_speed_water;
-		else
-			*speed = 0.0;
-
-		/* get navigation */
-		if (store->nav_group_position == MB_YES)
-			{
-			*navlon = RTD * store->nav_x;
-			*navlat = RTD * store->nav_y;
-			}
-		else
-			mb_navint_interp(verbose, mbio_ptr, *time_d, *heading, *speed,
-				    navlon, navlat, speed, error);
-
-		/* get draft */
-		if (store->par_parameter == MB_YES)
-			*draft = 0.5 * (store->par_trans_z_port
-				    + store->par_trans_z_stbd);
-		else
-			*draft = store->par_ship_draft;
-
-		/* get roll pitch and heave */
-		if (store->nav_group_hrp == MB_YES)
-			{
-			*roll = RTD * store->nav_hrp_roll;
-			*pitch = RTD * store->nav_hrp_pitch;
-			*heave = store->nav_hrp_heave;
-			}
-		else if (store->nav_group_heave == MB_YES
-			&& store->nav_group_roll == MB_YES
-			&& store->nav_group_pitch == MB_YES)
-			{
-			*roll = RTD * store->nav_rol_roll;
-			*pitch = RTD * store->nav_pit_pitch;
-			*heave = store->nav_hea_heave;
-			}
-		else if (store->mul_num_beams > 0)
-			{
-			*roll = RTD * store->beams[store->mul_num_beams/2].roll;
-			*pitch = RTD * store->beams[store->mul_num_beams/2].pitch;
-			*heave = store->beams[store->mul_num_beams/2].heave;
-			}
-		else
-			{
-			*roll = 0.0;
-			*pitch = 0.0;
-			*heave = 0.0;
-			}
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:       %d\n",*kind);
-		}
-	if (verbose >= 2 && *error <= MB_ERROR_NO_ERROR
-		&& *kind == MB_DATA_DATA)
-		{
-		fprintf(stderr,"dbg2       time_i[0]:     %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:     %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:     %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:     %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:     %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:     %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:     %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:        %f\n",*time_d);
-		fprintf(stderr,"dbg2       longitude:     %f\n",*navlon);
-		fprintf(stderr,"dbg2       latitude:      %f\n",*navlat);
-		fprintf(stderr,"dbg2       speed:         %f\n",*speed);
-		fprintf(stderr,"dbg2       heading:       %f\n",*heading);
-		fprintf(stderr,"dbg2       roll:          %f\n",*roll);
-		fprintf(stderr,"dbg2       pitch:         %f\n",*pitch);
-		fprintf(stderr,"dbg2       heave:         %f\n",*heave);
-		}
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_xse_insert_nav(int verbose, void *mbio_ptr, void *store_ptr,
-		int time_i[7], double time_d,
-		double navlon, double navlat,
-		double speed, double heading, double draft,
-		double roll, double pitch, double heave,
-		int *error)
-{
-	char	*function_name = "mbsys_xse_insert_nav";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_xse_struct *store;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       time_i[0]:  %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:  %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:  %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:  %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:  %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:  %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:  %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:     %f\n",time_d);
-		fprintf(stderr,"dbg2       navlon:     %f\n",navlon);
-		fprintf(stderr,"dbg2       navlat:     %f\n",navlat);
-		fprintf(stderr,"dbg2       speed:      %f\n",speed);
-		fprintf(stderr,"dbg2       heading:    %f\n",heading);
-		fprintf(stderr,"dbg2       roll:       %f\n",roll);
-		fprintf(stderr,"dbg2       pitch:      %f\n",pitch);
-		fprintf(stderr,"dbg2       heave:      %f\n",heave);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_xse_struct *) store_ptr;
-
-	/* insert data in structure */
-	if (store->kind == MB_DATA_DATA)
-		{
-		/* get time */
-		store->mul_sec = (unsigned int) (time_d + MBSYS_XSE_TIME_OFFSET);
-		store->mul_usec = (time_d
-				    - ((int) time_d)) * 1000000;
-		store->sid_sec = store->mul_sec;
-		store->sid_usec = store->mul_usec;
-
-		/*get navigation */
-		store->mul_lon = DTR * navlon;
-		store->mul_lat = DTR * navlat;
-
-		/* get heading */
-		store->mul_heading = DTR * heading;
-
-		/* get speed */
-		store->mul_speed = speed / 3.6;
-
-		/* get draft */
-		if (store->par_parameter == MB_YES)
-			{
-			store->par_trans_z_port = draft;
-			store->par_trans_z_stbd = draft;
-			}
-		else
-			{
-			store->par_ship_draft = draft;
-			}
-
-		/* get roll pitch and heave */
-		}
-
-	/* insert data in structure */
-	else if (store->kind == MB_DATA_NAV)
-		{
-		/* get time */
-		store->nav_sec = (unsigned int) (time_d + MBSYS_XSE_TIME_OFFSET);
-		store->nav_usec = (time_d
-				    - ((int) time_d)) * 1000000;
-
-		/*get navigation */
-		store->nav_group_position = MB_YES;
-		store->nav_x = DTR * navlon;
-		store->nav_y = DTR * navlat;
-
-		/* get heading */
-		store->nav_group_heading = MB_YES;
-		store->nav_hdg_heading = DTR * heading;
-
-		/* get speed */
-		store->nav_group_log = MB_YES;
-		store->nav_log_speed = speed / 3.6;
-
-		/* get draft */
-		if (store->par_parameter == MB_YES)
-			{
-			store->par_trans_z_port = draft;
-			store->par_trans_z_stbd = draft;
-			}
-		else
-			{
-			store->par_ship_draft = draft;
-			}
-
-		/* get roll pitch and heave */
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_xse_extract_svp(int verbose, void *mbio_ptr, void *store_ptr,
-		int *kind, int *nsvp,
-		double *depth, double *velocity,
-		int *error)
-{
-	char	*function_name = "mbsys_xse_extract_svp";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_xse_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mb_ptr:     %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_xse_struct *) store_ptr;
-
-	/* get data kind */
-	*kind = store->kind;
-
-	/* extract data from structure */
-	if (*kind == MB_DATA_VELOCITY_PROFILE)
-		{
-		/* get number of depth-velocity pairs */
-		*nsvp = store->svp_nsvp;
-
-		/* get profile */
-		for (i=0;i<*nsvp;i++)
-			{
-			depth[i] = store->svp_depth[i];
-			velocity[i] = store->svp_velocity[i];
-			}
-
-		/* done translating values */
-
-		}
-
-	/* deal with comment */
-	else if (*kind == MB_DATA_COMMENT)
-		{
-		/* set status */
-		*error = MB_ERROR_COMMENT;
-		status = MB_FAILURE;
-		}
-
-	/* deal with other record type */
-	else
-		{
-		/* set status */
-		*error = MB_ERROR_OTHER;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       kind:              %d\n",*kind);
-		fprintf(stderr,"dbg2       nsvp:              %d\n",*nsvp);
-		for (i=0;i<*nsvp;i++)
-		    fprintf(stderr,"dbg2       depth[%d]: %f   velocity[%d]: %f\n",i, depth[i], i, velocity[i]);
-		fprintf(stderr,"dbg2       error:             %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:            %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_xse_insert_svp(int verbose, void *mbio_ptr, void *store_ptr,
-		int nsvp,
-		double *depth, double *velocity,
-		int *error)
-{
-	char	*function_name = "mbsys_xse_insert_svp";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_xse_struct *store;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       nsvp:       %d\n",nsvp);
-		for (i=0;i<nsvp;i++)
-		    fprintf(stderr,"dbg2       depth[%d]: %f   velocity[%d]: %f\n",i, depth[i], i, velocity[i]);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_xse_struct *) store_ptr;
-
-	/* insert data in structure */
-	if (store->kind == MB_DATA_VELOCITY_PROFILE)
-		{
-		/* get number of depth-velocity pairs */
-		store->svp_nsvp = MIN(nsvp, MBSYS_XSE_MAXSVP);
-
-		/* get profile */
-		for (i=0;i<store->svp_nsvp;i++)
-			{
-			store->svp_depth[i] = depth[i];
-			store->svp_velocity[i] = velocity[i];
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbsys_xse_copy(int verbose, void *mbio_ptr,
-			void *store_ptr, void *copy_ptr,
-			int *error)
-{
-	char	*function_name = "mbsys_xse_copy";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_xse_struct *store;
-	struct mbsys_xse_struct *copy;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Revision id: %s\n",rcs_id);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:   %p\n",(void *)mbio_ptr);
-		fprintf(stderr,"dbg2       store_ptr:  %p\n",(void *)store_ptr);
-		fprintf(stderr,"dbg2       copy_ptr:   %p\n",(void *)copy_ptr);
-		}
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointers */
-	store = (struct mbsys_xse_struct *) store_ptr;
-	copy = (struct mbsys_xse_struct *) copy_ptr;
-
-	/* copy the data */
-	*copy = *store;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbio/mbsys_xse.h b/src/mbio/mbsys_xse.h
deleted file mode 100644
index 93627ff..0000000
--- a/src/mbio/mbsys_xse.h
+++ /dev/null
@@ -1,803 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbsys_xse.h	3/27/2000
- *	$Id: mbsys_xse.h 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 2000-2015 by
- *    D. W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and D. N. Chayes (dale at lamont.ldgo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY  10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbsys_xse.h defines the data structures used by MBIO functions
- * to store swath sonar data in the XSE Data Exchange Format
- * developed by L-3 Communications ELAC Nautik.
- * This format is used for data from ELAC Bottomchart multibeam sonars
- * and SeaBeam 2100 multibeam sonars (made by L-3 Communications
- * SeaBeam Instruments).
- * The data format associated with XSE is:
- *      MBF_L3XSERAW : MBIO ID 94
- *
- *
- * Author:	D. W. Caress
- * Date:	August 1,  1999
- * Additional Authors:	P. A. Cohen and S. Dzurenko
- *
- * $Log: mbsys_xse.h,v $
- * Revision 5.12  2007/07/03 17:28:08  caress
- * Fixes to XSE format.
- *
- * Revision 5.11  2007/06/18 01:19:48  caress
- * Changes as of 17 June 2007.
- *
- * Revision 5.10  2006/09/11 18:55:53  caress
- * Changes during Western Flyer and Thomas Thompson cruises, August-September
- * 2006.
- *
- * Revision 5.9  2005/11/05 00:48:03  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.8  2003/04/17 21:05:23  caress
- * Release 5.0.beta30
- *
- * Revision 5.7  2002/09/18 23:32:59  caress
- * Release 5.0.beta23
- *
- * Revision 5.6  2001/12/30 20:36:13  caress
- * Fixed array overflows in handling XSE data.
- *
- * Revision 5.5  2001/12/20 20:48:51  caress
- * Release 5.0.beta11
- *
- * Revision 5.4  2001/07/22  21:19:23  caress
- * Removed redundant define.
- *
- * Revision 5.3  2001/07/20 00:32:54  caress
- * Release 5.0.beta03
- *
- * Revision 5.2  2001/04/06  22:05:59  caress
- * Consolidated xse formats into one format.
- *
- * Revision 5.1  2001/01/22  07:43:34  caress
- * Version 5.0.beta01
- *
- * Revision 5.0  2000/12/01  22:48:41  caress
- * First cut at Version 5.0.
- *
- * Revision 4.1  2000/09/30  06:31:19  caress
- * Snapshot for Dale.
- *
- * Revision 4.0  1999/08/08  04:14:35  caress
- * Initial revision.
- *
- *
- */
-/*
- * Notes on the MBSYS_XSE (XSE) data format:
- *   1. L3 Communications introduced a new format called XSE in 1999.
- *      SeaBeam Instruments (maker of SeaBeam multibeam sonars)
- *      and Elac Nautik (make of Bottomchart multibeam sonars)
- *      are both divisions of L3 Communications.
- *      This "Data Exchange Format" is associated with the new
- *      version of "Hydrostar ONLINE" and represents the intended
- *      data format for both ELAC Bottomchart Compact MK II sonars
- *      (50 kHz and/or 180 kHz) and SeaBeam 2100 series sonars
- *      (12 kHz, 20 kHz, 36 kHz). This follows the purchase of
- *      SeaBeam Instruments by L3 Communications, the parent
- *      company of ELAC Nautik.
- *   2. The XSE format implements a well defined binary format
- *      structure in which each data record is represented as
- *      a "frame" with the following structure:
- *          -------------------------------------------------------
- *          Item     Bytes   Format   Value   Units   Description
- *          -------------------------------------------------------
- *          Start      4     ulong    $HSF            Frame start
- *          Byte Count 4     ulong            bytes   Between byte count
- *                                                      and frame end
- *          Id         4     ulong                    Frame id - see below
- *          Source     4     ulong                    Sensor id
- *          Seconds    4     ulong            seconds Seconds since
- *                                                      1/1/1901 00:00:00
- *          Microsec   4     ulong            usec    Microseconds
- *          ...        ...   ...      ...     ...     Frame specific groups
- *          End        4     ulong    #HSF            Frame end
- *          -------------------------------------------------------
- *      Within each frame are "groups", each with the following structure:
- *          -------------------------------------------------------
- *          Item     Bytes   Format   Value   Units   Description
- *          -------------------------------------------------------
- *          Start      4     ulong    $HSG            Group start
- *          Byte Count 4     ulong            bytes   Between byte count
- *                                                      and group end
- *          Id         4     ulong                    Group id - see below
- *          ...        ...   ...      ...     ...     Group specific data
- *          End        4     ulong    #HSG            Group end
- *          -------------------------------------------------------
- *   2. The valid frames include:
- *        Frame Name    Id   Groups w/ group id's in ()
- *        ---------------------------------------------------------
- *        Navigation      1  General(1), Position(2), Accuracy(3),
- *                           MotionGroundTruth(4), MotionThroughWater(5),
- *                           CurrentTrack(6), HeaveRollPitch(7), Heave(8),
- *			     Roll(9), Pitch(10), Heading(11), Log(12),
- *                           GPS(13)
- *        Sound Velocity  2  General(1),
- *                           Depth(2), Velocity(3),
- *                           Conductivity(4), Salinity (5), Temperature(6),
- *                           Pressure(7), SSV(8), Position(9)
- *        Tide            3  General(1), Position(2),
- *                           Time(3), Tide(4)
- *        Ship            4  General(1), Attitude(2),
- *                           Position(3), Dynamics(4), Motion(5),
- *                           Geometry(6), Description(7),
- *                           Parameter(8), NavigationAndMotion(9),
- *                           Transducer(10), TransducerExtended(11)
- *        Sidescan        5  General(1), AmplitudeVsTravelTime(2),
- *                           PhaseVsTravelTime(3),
- *                           Amplitude(4), Phase(5), Signal(6), PingType(7)
- *                           ComplexSignal(8), Weighting(9)
- *        Multibeam       6  General(1), Beam(2),
- *                           Traveltime(3), Quality(4),
- *                           Amplitude(5), Delay(6), Lateral(7),
- *                           Along(8), Depth(9), Angle(10),
- *                           Heave(11), Roll(12), Pitch(13),
- *                           Gates(14), Noise(15), EchoLength(16),
- *                           Hits(17), HeaveReceive(18), Azimuth(19),
- *                           MBsystemNavigation(99)
- *        Single Beam     7  General(1)
- *        Control         8  Request(1), Insert(2), Change(3),
- *                           Add(4), Delete(5), Action(6), Reply(7)
- *        Bathymetry      9  General(1), Position(2), Depth(3)
- *        Project        10  General(1), Server(2), Status(3), Sources(4)
- *        Native         11  General(1), RWCollectable(2), UNB(3),
- *                           Raw(4), ELAC(5)
- *        Geodetic       12  General(1), Ellipsoid(2), Datum(3),
- *                           Projection(4), System(5), Alias(6)
- *        SeaBeam        13  Properties(1), HeaveRollPitch(2), Setup(3),
- *                           MotionReferenceUnit(4), Settings(5),
- *                           Beams(6), Gates(7), Raw(8), Center(9),
- *                           Sidescan, Shutdown(), Ping(), Calibrate(),
- *                           Collect(), Surface(), Hydrophone(),
- *                           Projector(17), Calibration(18), Acknowledge(19),
- *                           Warning(20), Message(21), Error(22)
- *        Comment        99  General(1) **MB-System ONLY!!!!**
- *   3. Not all of these frames are directly supported by this MB-System
- *      i/o module. Unsupported frames are read and passed
- *      through MB-System as MB_DATA_OTHER type data records.
- *   4. SeaBeam Instruments 2120 12 kHz and 20 KHz multibeam sonar
- *      systems output both bathymetry and amplitude
- *      information for up to 151 beams per multibeam frame.
- *      Each ping produces a variable number of beams.
- *   5. Elac Bottomchart MkII  50 KHz and 180 kHz sonar systems
- *      output both bathymetry and amplitude information
- *      for up to 126 beams per multibeam frame.
- *      Each ping produces a variable number of beams.
- *   6. The raw XSE format provides asynchronous navigation only; navigation
- *      is not included in the multibeam or sidescan pings.
- *      MB-System adds MBsystemNavigation(99) groups to the multibeam
- *      frames so that processed navigation can be directly associated
- *      with each survey ping..
- *   7. The comment records are supported by MB-System only and are
- *      not part of the L3 Communications XSE format specification.
- *      The comment frame encloses a single general comment group (id=1).
- *          -------------------------------------------------------
- *          Item     Bytes   Format   Value   Units   Description
- *          -------------------------------------------------------
- *          Start      4     ulong    $HSF            Frame start
- *          Byte Count 4     ulong            bytes   Between byte count
- *                                                      and frame end
- *          Id         4     ulong    99              Frame id - see below
- *          Source     4     ulong    0               Sensor id
- *          Seconds    4     ulong            seconds Seconds since
- *                                                      1/1/1901 00:00:00
- *          Microsec   4     ulong            usec    Microseconds
- *          ...        ...   ...      ...     ...     Frame specific groups
- *          End        4     ulong    #HSF            Frame end
- *          -------------------------------------------------------
- *      The only comment group is 1:
- *          -------------------------------------------------------
- *          Item     Bytes   Format   Value   Units   Description
- *          -------------------------------------------------------
- *          Start      4     ulong    $HSG            Group start
- *          Byte Count 4     ulong            bytes   Between byte count
- *                                                      and group end
- *          Id         4     ulong    1               Group id - see below
- *          N          4     long             bytes   Length of null terminated
- *                                                      comment string, padded
- *                                                      to a multiple of 4
- *          Comment    N     char             chars   Comment string
- *          End        4     ulong    #HSG            Group end
- *          -------------------------------------------------------
- *
- */
-
-/* maximum number of beams and pixels */
-#define	MBSYS_XSE_MAXBEAMS		630
-#define	MBSYS_XSE_MAXPIXELS		32768
-#define	MBSYS_XSE_MAXSAMPLES		32768
-#define	MBSYS_XSE_MAXSVP		8192
-#define MBSYS_XSE_MAXDRAFT		200
-#define MBSYS_XSE_MAXPROPERTIES		6
-#define	MBSYS_XSE_COMMENT_LENGTH	200
-#define	MBSYS_XSE_DESCRIPTION_LENGTH	64
-#define	MBSYS_XSE_TIME_OFFSET		2177452800.0
-#define	MBSYS_XSE_BUFFER_SIZE		131072
-#define	MBSYS_XSE_MAX_SIZE		200
-#define	MBSYS_XSE_MAX_SENSORS		16
-#define	MBSYS_XSE_MAX_TRANSDUCERS	512
-
-/* frame and group id's */
-#define MBSYS_XSE_NONE_FRAME			0
-
-#define MBSYS_XSE_NAV_FRAME			1
-#define MBSYS_XSE_NAV_GROUP_GEN			1
-#define MBSYS_XSE_NAV_GROUP_POS			2
-#define MBSYS_XSE_NAV_GROUP_ACCURACY		3
-#define MBSYS_XSE_NAV_GROUP_MOTIONGT		4
-#define MBSYS_XSE_NAV_GROUP_MOTIONTW		5
-#define MBSYS_XSE_NAV_GROUP_TRACK		6
-#define MBSYS_XSE_NAV_GROUP_HRP			7
-#define MBSYS_XSE_NAV_GROUP_HEAVE		8
-#define MBSYS_XSE_NAV_GROUP_ROLL		9
-#define MBSYS_XSE_NAV_GROUP_PITCH		10
-#define MBSYS_XSE_NAV_GROUP_HEADING		11
-#define MBSYS_XSE_NAV_GROUP_LOG			12
-#define MBSYS_XSE_NAV_GROUP_GPS			13
-
-#define MBSYS_XSE_SVP_FRAME			2
-#define MBSYS_XSE_SVP_GROUP_GEN			1
-#define MBSYS_XSE_SVP_GROUP_DEPTH		2
-#define MBSYS_XSE_SVP_GROUP_VELOCITY		3
-#define MBSYS_XSE_SVP_GROUP_CONDUCTIVITY	4
-#define MBSYS_XSE_SVP_GROUP_SALINITY		5
-#define MBSYS_XSE_SVP_GROUP_TEMP		6
-#define MBSYS_XSE_SVP_GROUP_PRESSURE		7
-#define MBSYS_XSE_SVP_GROUP_SSV			8
-#define MBSYS_XSE_SVP_GROUP_POS			9
-
-#define MBSYS_XSE_TID_FRAME			3
-#define MBSYS_XSE_TID_GROUP_GEN			1
-#define MBSYS_XSE_TID_GROUP_POS			2
-#define MBSYS_XSE_TID_GROUP_TIME		3
-#define MBSYS_XSE_TID_GROUP_TIDE		4
-
-#define MBSYS_XSE_SHP_FRAME			4
-#define MBSYS_XSE_SHP_GROUP_GEN			1
-#define MBSYS_XSE_SHP_GROUP_TIME		2
-#define MBSYS_XSE_SHP_GROUP_DRAFT		3
-#define MBSYS_XSE_SHP_GROUP_SENSORS		4
-#define MBSYS_XSE_SHP_GROUP_MOTION		5
-#define MBSYS_XSE_SHP_GROUP_GEOMETRY		6
-#define MBSYS_XSE_SHP_GROUP_DESCRIPTION		7
-#define MBSYS_XSE_SHP_GROUP_PARAMETER		8
-#define MBSYS_XSE_SHP_GROUP_NAVIGATIONANDMOTION	9
-#define MBSYS_XSE_SHP_GROUP_TRANSDUCER		10
-#define MBSYS_XSE_SHP_GROUP_TRANSDUCEREXTENDED	11
-
-#define MBSYS_XSE_SSN_FRAME			5
-#define MBSYS_XSE_SSN_GROUP_GEN			1
-#define MBSYS_XSE_SSN_GROUP_AMPVSTT		2
-#define MBSYS_XSE_SSN_GROUP_PHASEVSTT		3
-#define MBSYS_XSE_SSN_GROUP_AMPVSLAT		4
-#define MBSYS_XSE_SSN_GROUP_PHASEVSLAT		5
-#define MBSYS_XSE_SSN_GROUP_SIGNAL		6
-#define MBSYS_XSE_SSN_GROUP_PINGTYPE		7
-#define MBSYS_XSE_SSN_GROUP_COMPLEXSIGNAL	8
-#define MBSYS_XSE_SSN_GROUP_WEIGHTING		9
-
-#define MBSYS_XSE_MBM_FRAME			6
-#define MBSYS_XSE_MBM_GROUP_GEN			1
-#define MBSYS_XSE_MBM_GROUP_BEAM		2
-#define MBSYS_XSE_MBM_GROUP_TT			3
-#define MBSYS_XSE_MBM_GROUP_QUALITY		4
-#define MBSYS_XSE_MBM_GROUP_AMP			5
-#define MBSYS_XSE_MBM_GROUP_DELAY		6
-#define MBSYS_XSE_MBM_GROUP_LATERAL		7
-#define MBSYS_XSE_MBM_GROUP_ALONG		8
-#define MBSYS_XSE_MBM_GROUP_DEPTH		9
-#define MBSYS_XSE_MBM_GROUP_ANGLE		10
-#define MBSYS_XSE_MBM_GROUP_HEAVE		11
-#define MBSYS_XSE_MBM_GROUP_ROLL		12
-#define MBSYS_XSE_MBM_GROUP_PITCH		13
-#define MBSYS_XSE_MBM_GROUP_GATES		14
-#define MBSYS_XSE_MBM_GROUP_NOISE		15
-#define MBSYS_XSE_MBM_GROUP_LENGTH		16
-#define MBSYS_XSE_MBM_GROUP_HITS		17
-#define MBSYS_XSE_MBM_GROUP_HEAVERECEIVE	18
-#define MBSYS_XSE_MBM_GROUP_AZIMUTH		19
-#define MBSYS_XSE_MBM_GROUP_PROPERTIES		20
-#define MBSYS_XSE_MBM_GROUP_NORMAMP		21
-#define MBSYS_XSE_MBM_GROUP_MBSYSTEMNAV		99
-
-#define MBSYS_XSE_SNG_FRAME			7
-#define MBSYS_XSE_CNT_FRAME			8
-#define MBSYS_XSE_BTH_FRAME			9
-#define MBSYS_XSE_PRD_FRAME			10
-#define MBSYS_XSE_NTV_FRAME			11
-#define MBSYS_XSE_GEO_FRAME			12
-
-#define MBSYS_XSE_SBM_FRAME			13
-#define MBSYS_XSE_SBM_GROUP_PROPERTIES		1
-#define MBSYS_XSE_SBM_GROUP_HRP			2
-#define MBSYS_XSE_SBM_GROUP_SETUP		3
-#define MBSYS_XSE_SBM_GROUP_MRU			4
-#define MBSYS_XSE_SBM_GROUP_SETTINGS		5
-#define MBSYS_XSE_SBM_GROUP_BEAMS		6
-#define MBSYS_XSE_SBM_GROUP_GATES		7
-#define MBSYS_XSE_SBM_GROUP_SLICE		8
-#define MBSYS_XSE_SBM_GROUP_SIGNAL		9
-#define MBSYS_XSE_SBM_GROUP_SIDESCAN		10
-#define MBSYS_XSE_SBM_GROUP_SHUTDOWN		11
-#define MBSYS_XSE_SBM_GROUP_PING		12
-#define MBSYS_XSE_SBM_GROUP_CALIBRATE		13
-#define MBSYS_XSE_SBM_GROUP_COLLECT		14
-#define MBSYS_XSE_SBM_GROUP_SURFACE		15
-#define MBSYS_XSE_SBM_GROUP_HYDROPHONE		16
-#define MBSYS_XSE_SBM_GROUP_PROJECTOR		17
-#define MBSYS_XSE_SBM_GROUP_BIAS		18
-#define MBSYS_XSE_SBM_GROUP_ACKNOWLEDGE		19
-#define MBSYS_XSE_SBM_GROUP_WARNING		20
-#define MBSYS_XSE_SBM_GROUP_MESSAGE		21
-#define MBSYS_XSE_SBM_GROUP_SWEEPSEGMENTS	40
-#define MBSYS_XSE_SBM_GROUP_SPACINGMODE		50
-
-#define MBSYS_XSE_MSG_FRAME			14
-#define MBSYS_XSE_ATT_FRAME			15
-
-#define MBSYS_XSE_COM_FRAME			99
-#define MBSYS_XSE_COM_GROUP_GEN			1
-
-struct mbsys_xse_beam_struct
-	{
-	double	    tt;
-	double	    delay;
-	double	    lateral;
-	double	    along;
-	double	    depth;
-	double	    angle;
-	double	    heave;
-	double	    roll;
-	double	    pitch;
-	short	    beam;
-	char	    quality;
-	short	    amplitude;
-	double	    gate_angle;
-	double	    gate_start;
-	double	    gate_stop;
-	float	    noise;
-	float	    length;
-	unsigned int hits;
-	double      heavereceive;
-	double      azimuth;
-        short       normamp;
-        float       frequency;
-	};
-
-struct mbsys_xse_struct
-	{
-	/* type of data record */
-	int	kind;			/* Survey, nav, Comment */
-
-	/* parameter (ship frames) */
-	int	par_source;		/* sensor id */
-	unsigned int	par_sec;	/* sec since 1/1/1901 00:00 */
-	unsigned int	par_usec;	/* microseconds */
-	unsigned int    par_ship_name_length;	/* length of ship name, chars */
-	char    par_ship_name[MBSYS_XSE_DESCRIPTION_LENGTH]; /* Name of Vessel */
-	double  par_ship_length;	/* vessel total length, meters */
-	double  par_ship_beam;		/* vessel total width, meters */
-	double  par_ship_draft;		/* vessel maximum draft, meters */
-	double  par_ship_height;	/* vessel maximum height, meters */
-	double  par_ship_displacement;	/* vessel maximum displacement, cubic meters */
-	double  par_ship_weight;	/* vessel maximum weight, kg */
-
-	int	par_ship_nsensor;					/* number of sensors */
-	int	par_ship_sensor_id[MBSYS_XSE_MAX_SENSORS];		/* sensor id array */
-	int	par_ship_sensor_type[MBSYS_XSE_MAX_SENSORS];		/* sensor type array
-										1000 : SeaBeam 1000
-										2000 : SeaBeam 2100
-										2001 : SeaBeam 2100 V-shaped
-										3000 : SeaBeam 3000
-										4000 : single beam
-										8000 : Edgetech sidescan
-										9000 :
-										9001 : SSV */
-	int	par_ship_sensor_frequency[MBSYS_XSE_MAX_SENSORS];	/* sensor frequency array (kHz) */
-
-	int	par_parameter;		/* boolean flag for parameter group */
-	float	par_roll_bias;		/* radians */
-	float	par_pitch_bias;		/* radians */
-	float	par_heading_bias;	/* radians */
-	float	par_time_delay;		/* nav time lag, seconds */
-	float	par_trans_x_port;	/* port transducer x position, meters */
-	float	par_trans_y_port;	/* port transducer y position, meters */
-	float	par_trans_z_port;	/* port transducer z position, meters */
-	float	par_trans_x_stbd;	/* starboard transducer x position, meters */
-	float	par_trans_y_stbd;	/* starboard transducer y position, meters */
-	float	par_trans_z_stbd;	/* starboard transducer z position, meters */
-	float	par_trans_err_port;	/* port transducer rotation in roll direction, radians */
-	float	par_trans_err_stbd;	/* starboard transducer rotation in roll direction, radians */
-	float	par_nav_x;		/* navigation antenna x position, meters */
-	float	par_nav_y;		/* navigation antenna y position, meters */
-	float	par_nav_z;		/* navigation antenna z position, meters */
-	float	par_hrp_x;		/* motion sensor x position, meters */
-	float	par_hrp_y;		/* motion sensor y position, meters */
-	float	par_hrp_z;		/* motion sensor z position, meters */
-
-	int	par_navigationandmotion;/* boolean flag for navigationandmotion group */
-	double	par_nam_roll_bias;	/* roll bias, radians */
-	double	par_nam_pitch_bias;	/* pitch bias, radians */
-	double	par_nam_heave_bias;	/* heave bias, meters */
-	double	par_nam_heading_bias;	/* heading/gyro bias, radians */
-	double	par_nam_time_delay;	/* nav time lag, seconds */
-	double	par_nam_nav_x;		/* navigation antenna x position, meters */
-	double	par_nam_nav_y;		/* navigation antenna y position, meters */
-	double	par_nam_nav_z;		/* navigation antenna z position, meters */
-	double	par_nam_hrp_x;		/* motion sensor x position, meters */
-	double	par_nam_hrp_y;		/* motion sensor y position, meters */
-	double	par_nam_hrp_z;		/* motion sensor z position, meters */
-
-	int	par_xdr_num_transducer; /* number of transducers */
-	int	par_xdr_sensorid[MBSYS_XSE_MAX_TRANSDUCERS]; 		/* sensor ids */
-	char 	par_xdr_transducer[MBSYS_XSE_MAX_TRANSDUCERS]; 		/* transducer type:
-										0: hydrophone
-										1: projector
-										2: transducer */
-	unsigned int par_xdr_frequency[MBSYS_XSE_MAX_TRANSDUCERS]; 	/* frequency (Hz) */
-	char 	par_xdr_side[MBSYS_XSE_MAX_TRANSDUCERS]; 		/* transducer side:
-										0: undefined
-										1: port
-										2: starboard
-										3: midship
-										4: system defined */
-	double	par_xdr_mountingroll[MBSYS_XSE_MAX_TRANSDUCERS];	/* array mounting angle roll (radians) */
-	double	par_xdr_mountingpitch[MBSYS_XSE_MAX_TRANSDUCERS];	/* array mounting angle roll (radians) */
-	double	par_xdr_mountingazimuth[MBSYS_XSE_MAX_TRANSDUCERS];	/* array mounting angle roll (radians) */
-	double	par_xdr_mountingdistance[MBSYS_XSE_MAX_TRANSDUCERS];	/* horizontal distance between
-										innermost elements of the
-										transducer arrays to the
-										ship center line in a
-										V-shaped configuration (m) */
-	double	par_xdr_x[MBSYS_XSE_MAX_TRANSDUCERS];	/* transducer center across track offset (m) */
-	double	par_xdr_y[MBSYS_XSE_MAX_TRANSDUCERS];	/* transducer center along track offset (m) */
-	double	par_xdr_z[MBSYS_XSE_MAX_TRANSDUCERS];	/* transducer center vertical offset (m) */
-	double	par_xdr_roll[MBSYS_XSE_MAX_TRANSDUCERS];	/* beamforming roll bias (radians - port up positive) */
-	double	par_xdr_pitch[MBSYS_XSE_MAX_TRANSDUCERS];	/* beamforming pitch bias (radians - bow up positive) */
-	double	par_xdr_azimuth[MBSYS_XSE_MAX_TRANSDUCERS];	/* beamforming azimuth bias (radians
-									- projector axis clockwise with
-									respect to compass positive) */
-	int	par_xdx_num_transducer; 			/* number of transducers */
-	char 	par_xdx_roll[MBSYS_XSE_MAX_TRANSDUCERS]; 	/* mounting mode roll (0: auto, 1: manual) */
-	char	par_xdx_pitch[MBSYS_XSE_MAX_TRANSDUCERS]; 	/* mounting mode pitch (0: auto, 1: manual) */
-	char	par_xdx_azimuth[MBSYS_XSE_MAX_TRANSDUCERS]; 	/* mounting mode azimuth (0: auto, 1: manual) */
-
-	/* svp (sound velocity frames) */
-	int	svp_source;		/* sensor id */
-	unsigned int	svp_sec;	/* sec since 1/1/1901 00:00 */
-	unsigned int	svp_usec;	/* microseconds */
-	int	svp_nsvp;		/* number of depth values */
-	int	svp_nctd;		/* number of ctd values */
-	double	svp_depth[MBSYS_XSE_MAXSVP];		/* m */
-	double	svp_velocity[MBSYS_XSE_MAXSVP];	/* m/s */
-	double	svp_conductivity[MBSYS_XSE_MAXSVP];	/* mmho/cm */
-	double	svp_salinity[MBSYS_XSE_MAXSVP];	/* o/oo */
-	double	svp_temperature[MBSYS_XSE_MAXSVP];	/* degree celcius */
-	double	svp_pressure[MBSYS_XSE_MAXSVP];	/* bar */
-	double	svp_ssv;		/* m/s */
-        double  svp_ssv_depth;          /* m */
-        char    svp_ssv_depthflag;      /* 0 = invalid depth, otherwise depth valid */
-
-	/* position (navigation frames) */
-	int	nav_group_general;	/* boolean flag */
-	int	nav_group_position;	/* boolean flag */
-	int	nav_group_accuracy;	/* boolean flag */
-	int	nav_group_motiongt;	/* boolean flag */
-	int	nav_group_motiontw;	/* boolean flag */
-	int	nav_group_track;	/* boolean flag */
-	int	nav_group_hrp;		/* boolean flag */
-	int	nav_group_heave;	/* boolean flag */
-	int	nav_group_roll;		/* boolean flag */
-	int	nav_group_pitch;	/* boolean flag */
-	int	nav_group_heading;	/* boolean flag */
-	int	nav_group_log;		/* boolean flag */
-	int	nav_group_gps;		/* boolean flag */
-	int	nav_source;		/* sensor id */
-	unsigned int	nav_sec;	/* sec since 1/1/1901 00:00 */
-	unsigned int	nav_usec;	/* microseconds */
-	int	nav_quality;
-	int	nav_status;
-	int	nav_description_len;
-	char	nav_description[MBSYS_XSE_DESCRIPTION_LENGTH];
-	double	nav_x;			/* eastings (m) or
-					    longitude (radians) */
-	double	nav_y;			/* northings (m) or
-					    latitude (radians) */
-	double	nav_z;			/* height (m) or
-					    ellipsoidal height (m) */
-	short	nav_acc_quality;	/* GPS quality:
-						0: invalid
-						1: SPS
-						2: SPS differential
-						3: PPS
-						4. RTK
-						5: Float RTK
-						6: Estimated
-						7: Manual
-						8: Simulator */
-	char	nav_acc_numsatellites;	/* number of satellites */
-	float	nav_acc_horizdilution;	/* horizontal dilution of precision */
-	float	nav_acc_diffage;	/* age of differential data (sec since last update) */
-	unsigned int nav_acc_diffref;	/* differential reference station */
-	double	nav_speed_ground;	/* m/s */
-	double	nav_course_ground;	/* radians */
-	double	nav_speed_water;	/* m/s */
-	double	nav_course_water;	/* radians */
-	double	nav_trk_offset_track;	/* offset track (m) */
-	double	nav_trk_offset_sol;	/* offset SOL (m) */
-	double	nav_trk_offset_eol;	/* offset EOL (m) */
-	double	nav_trk_distance_sol;	/* distance SOL (m) */
-	double	nav_trk_azimuth_sol;	/* azimuth SOL (radians) */
-	double	nav_trk_distance_eol;	/* distance EOL (m) */
-	double	nav_trk_azimuth_eol;	/* azimuth EOL (radians) */
-	double	nav_hrp_heave;		/* heave (m) */
-	double	nav_hrp_roll;		/* roll (radians) */
-	double	nav_hrp_pitch;		/* pitch (radians) */
-	double	nav_hea_heave;		/* heave (m) */
-	double	nav_rol_roll;		/* roll (radians) */
-	double	nav_pit_pitch;		/* pitch (radians) */
-	double	nav_hdg_heading;	/* heading (radians) */
-	double	nav_log_speed;		/* speed (m/s) */
-	float	nav_gps_altitude;	/* altitude with respect to geoid */
-	float	nav_gps_geoidalseparation;	/* difference between WGS84 ellipsoid and geoid (m)
-							(positive means sea level geoid is above
-							ellipsoid) */
-
-	/* survey depth (multibeam frames) */
-	int	mul_frame;		/* boolean flag - multibeam frame read */
-	int	mul_group_beam;		/* boolean flag - beam group read */
-	int	mul_group_tt;		/* boolean flag - tt group read */
-	int	mul_group_quality;	/* boolean flag - quality group read */
-	int	mul_group_amp;		/* boolean flag - amp group read */
-	int	mul_group_delay;	/* boolean flag - delay group read */
-	int	mul_group_lateral;	/* boolean flag - lateral group read */
-	int	mul_group_along;	/* boolean flag - along group read */
-	int	mul_group_depth;	/* boolean flag - depth group read */
-	int	mul_group_angle;	/* boolean flag - angle group read */
-	int	mul_group_heave;	/* boolean flag - heave group read */
-	int	mul_group_roll;		/* boolean flag - roll group read */
-	int	mul_group_pitch;	/* boolean flag - pitch group read */
-	int	mul_group_gates;	/* boolean flag - gates group read */
-	int	mul_group_noise;	/* boolean flag - noise group read */
-	int	mul_group_length;	/* boolean flag - length group read */
-	int	mul_group_hits;		/* boolean flag - hits group read */
-	int	mul_group_heavereceive;	/* boolean flag - heavereceive group read */
-	int	mul_group_azimuth;	/* boolean flag - azimuth group read */
-	int	mul_group_properties;	/* boolean flag - properties group read */
-	int	mul_group_normamp;	/* boolean flag - normalized amplitude group read */
-	int	mul_group_mbsystemnav;	/* boolean flag - mbsystemnav group read */
-	int	mul_source;		/* sensor id */
-	unsigned int	mul_sec;	/* sec since 1/1/1901 00:00 */
-	unsigned int	mul_usec;	/* microseconds */
-	int	mul_ping;		/* ping number */
-	float	mul_frequency;		/* transducer frequency (Hz) */
-	float	mul_pulse;		/* transmit pulse length (sec) */
-	float	mul_power;		/* transmit power (dB) */
-	float	mul_bandwidth;		/* receive bandwidth (Hz) */
-	float	mul_sample;		/* receive sample interval (sec) */
-	float	mul_swath;		/* swath width (radians) */
-	int	mul_num_beams;		/* number of beams */
-	double	mul_lon;		/* longitude (radians) */
-	double	mul_lat;		/* latitude (radians) */
-	double	mul_heading;		/* heading (radians) */
-	double	mul_speed;		/* speed (m/s) */
-	struct mbsys_xse_beam_struct beams[MBSYS_XSE_MAXBEAMS];
-        int     mul_num_properties;     /* number of properties */
-        unsigned short mul_properties_type[MBSYS_XSE_MAXPROPERTIES];
-        double  mul_properties_value[MBSYS_XSE_MAXPROPERTIES];
-        char    mul_properties_reserved[40];
-        int     mul_normamp_num_beams;  /* number of beams */
-        int     mul_normamp_flags;      /* multi-frequency flag:
-                                            0=one frequency is written,
-                                            1=one frequency is written for each beam */
-        float   mul_normamp_along_beamwidth;    /* along track beam width for center beam (radians) */
-        float   mul_normamp_across_beamwidth;   /* across track beam width for center beam (radians) */
-        short   mul_normamp_amp[MBSYS_XSE_MAXBEAMS];
-                                        /* Normalized Amplitude of Bottom Echo per Beam.
-                                            All System Gain Values (Receiver Gain, Source
-                                            Level, etc.) have been removed from this value.
-                                            System independent losses are not part of
-                                            the normalization! (Beam Order is the same as
-                                            in the Angle Group (Id 10) ) */
-        float   mul_normamp_frequency[MBSYS_XSE_MAXBEAMS];
-                                        /* System Frequency (Number of Values depends on
-                                            Multi-Frequency- Flag, see above) */
-
-	/* survey sidescan (sidescan frames) */
-	int	sid_frame;		/* boolean flag - sidescan frame read */
-	int	sid_group_avt;		/* boolean flag - amp vs time group read */
-	int	sid_group_pvt;		/* boolean flag - phase vs time group read */
-	int	sid_group_avl;		/* boolean flag - amp vs lateral group read */
-	int	sid_group_pvl;		/* boolean flag - phase vs lateral group read */
-	int	sid_group_signal;	/* boolean flag - signal group read */
-	int	sid_group_ping;		/* boolean flag - ping group read */
-	int	sid_group_complex;	/* boolean flag - complex group read */
-	int	sid_group_weighting;	/* boolean flag - weighting group read */
-	int	sid_source;		/* sensor id */
-	unsigned int	sid_sec;	/* sec since 1/1/1901 00:00 */
-	unsigned int	sid_usec;	/* microseconds */
-	int	sid_ping;		/* ping number */
-	float	sid_frequency;		/* transducer frequency (Hz) */
-	float	sid_pulse;		/* transmit pulse length (sec) */
-	float	sid_power;		/* transmit power (dB) */
-	float	sid_bandwidth;		/* receive bandwidth (Hz) */
-	float	sid_sample;		/* receive sample interval (sec) */
-	int	sid_avt_sampleus;	/* sample interval (usec) */
-	int	sid_avt_offset;		/* time offset (usec) */
-	int	sid_avt_num_samples;	/* number of samples */
-	short	sid_avt_amp[MBSYS_XSE_MAXPIXELS]; /* sidescan amplitude (dB) */
-	int	sid_pvt_sampleus;	/* sample interval (usec) */
-	int	sid_pvt_offset;		/* time offset (usec) */
-	int	sid_pvt_num_samples;	/* number of samples */
-	short	sid_pvt_phase[MBSYS_XSE_MAXPIXELS]; /* sidescan phase (radians) */
-	int	sid_avl_binsize;	/* bin size (mm) */
-	int	sid_avl_offset;		/* lateral offset (mm) */
-	int	sid_avl_num_samples;	/* number of samples */
-	short	sid_avl_amp[MBSYS_XSE_MAXPIXELS]; /* sidescan amplitude (dB) */
-	int	sid_pvl_binsize;	/* bin size (mm) */
-	int	sid_pvl_offset;		/* lateral offset (mm) */
-	int	sid_pvl_num_samples;	/* number of samples */
-	short	sid_pvl_phase[MBSYS_XSE_MAXPIXELS]; /* sidescan phase (radians) */
-	int	sid_sig_ping;		/* ping number */
-	int	sid_sig_channel;	/* channel number */
-	double	sid_sig_offset;		/* start offset */
-	double	sid_sig_sample;		/* bin size / sample interval */
-	int	sid_sig_num_samples;	/* number of samples */
-	short	sid_sig_phase[MBSYS_XSE_MAXPIXELS]; /* sidescan phase in radians */
-	unsigned int	sid_png_pulse;	/* pulse type (0=constant, 1=linear sweep) */
-	double	sid_png_startfrequency;	/* start frequency (Hz) */
-	double	sid_png_endfrequency;	/* end frequency (Hz) */
-	double	sid_png_duration;	/* pulse duration (msec) */
-	int	sid_png_mancode;	/* manufacturer code (1=Edgetech, 2=Elac) */
-	unsigned int	sid_png_pulseid;/* pulse identifier */
-	char	sid_png_pulsename[MBSYS_XSE_DESCRIPTION_LENGTH];	/* pulse name */
-	int	sid_cmp_ping;		/* ping number */
-	int	sid_cmp_channel;	/* channel number */
-	double	sid_cmp_offset;		/* start offset (usec) */
-	double	sid_cmp_sample;		/* bin size / sample interval (usec) */
-	int	sid_cmp_num_samples;	/* number of samples */
-	short	sid_cmp_real[MBSYS_XSE_MAXPIXELS]; /* real sidescan signal */
-	short	sid_cmp_imaginary[MBSYS_XSE_MAXPIXELS]; /* imaginary sidescan signal */
-	short	sid_wgt_factorleft;		/* weighting factor for block floating
-						point expansion  --
-						defined as 2^(-N) volts for lsb */
-	unsigned int sid_wgt_samplesleft;	/* number of left samples */
-	short	sid_wgt_factorright;		/* weighting factor for block floating
-						point expansion  --
-						defined as 2^(-N) volts for lsb */
-	unsigned int sid_wgt_samplesright;	/* number of right samples */
-
-
-	/* seabeam (seabeam frames) */
-	int	sbm_properties;		/* boolean flag - sbm properties group read */
-	int	sbm_hrp;		/* boolean flag - sbm hrp group read */
-	int	sbm_signal;		/* boolean flag - sbm signal group read */
-	int	sbm_sweepsegments;	/* boolean flag - sbm sweep segments group read */
-	int	sbm_spacingmode;	/* boolean flag - sbm spacing mode group read */
-	int	sbm_source;		/* sensor id */
-	int	sbm_message;		/* sensor id */
-	unsigned int	sbm_sec;	/* sec since 1/1/1901 00:00 */
-	unsigned int	sbm_usec;	/* microseconds */
-	int	sbm_ping;		/* ping number */
-	float	sbm_ping_gain;		/* ping gain (dB) */
-	float	sbm_pulse_width;	/* pulse width (s) */
-	float	sbm_transmit_power;	/* transmit power (dB) */
-	float	sbm_pixel_width;	/* pixel width (m) */
-	float	sbm_swath_width;	/* swath width (radians) */
-	float	sbm_time_slice;		/* time slice (s) */
-	int	sbm_depth_mode;		/* depth mode (1=shallow, 2=deep) */
-	int	sbm_beam_mode;		/* focused beam mode (0=off, 1=on) */
-	float	sbm_ssv;		/* surface sound velocity (m/s) */
-	float	sbm_frequency;		/* sonar frequency (kHz) */
-	float	sbm_bandwidth;		/* receiver bandwidth (kHz) */
-	double	sbm_heave;		/* heave (m) */
-	double	sbm_roll;		/* roll (radians) */
-	double	sbm_pitch;		/* pitch (radians) */
-	int	sbm_signal_beam;	/* beam number for signal */
-	int	sbm_signal_count;	/* number of samples in signal */
-	float	sbm_signal_amp[MBSYS_XSE_MAXSAMPLES];	/* signal values */
-	int	sbm_message_id;		/* seabeam message id */
-	int	sbm_message_len;	/* seabeam message length */
-	char	sbm_message_txt[MBSYS_XSE_COMMENT_LENGTH]; /* seabeam message */
-        char    sbm_sweep_direction;    /* sweep direction 0=static, 1=port, 2=starboard */
-        float   sbm_sweep_azimuth;      /* effective azimuth (radians) */
-        unsigned int    sbm_sweep_segments;     /* number of segments */
-        unsigned int    sbm_sweep_seconds;      /* seconds since start of ping and end of sweep segment */
-        unsigned int    sbm_sweep_micro;        /* microseconds of seconds */
-        float   sbm_sweep_extrapolateazimuth;   /* extrapolated azimuth at center of sweep segment (radians) */
-        float   sbm_sweep_interpolatedazimuth;  /* interpolated azimuth at center of sweep segment (radians) */
-        float   sbm_sweep_extrapolatepitch;     /* extrapolated pitch at center of sweep segment (radians) */
-        float   sbm_sweep_interpolatedpitch;    /* interpolated pitch at center of sweep segment (radians) */
-        float   sbm_sweep_extrapolateroll;      /* extrapolated roll at center of sweep segment (radians) */
-        float   sbm_sweep_interpolatedroll;     /* interpolated roll at center of sweep segment (radians) */
-        float   sbm_sweep_stabilizedangle;      /* sweep segment stabilized angle (radians) */
-        char    sbm_spacing_mode;               /* spacing mode: 0=equiangle, 1=equidistant */
-        float   sbm_spacing_equidistance;       /* equidistance (percentage of center depth) */
-        float   sbm_spacing_equidistance_min;   /* equidistance minimum value (percentage of center depth) */
-        float   sbm_spacing_equidistance_max;   /* equidistance maximum value (percentage of center depth) */
-
-	/* comment */
-	int	com_source;		/* sensor id */
-	unsigned int	com_sec;	/* sec since 1/1/1901 00:00 */
-	unsigned int	com_usec;	/* microseconds */
-	char	comment[MBSYS_XSE_COMMENT_LENGTH];
-
-	/* unsupported frames */
-	int	rawsize;		/* size of unknown frame in bytes */
-	char	raw[MBSYS_XSE_BUFFER_SIZE];
-	};
-
-
-/* system specific function prototypes */
-int mbsys_xse_alloc(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error);
-int mbsys_xse_deall(int verbose, void *mbio_ptr, void **store_ptr,
-			int *error);
-int mbsys_xse_dimensions(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int *nbath, int *namp, int *nss, int *error);
-int mbsys_xse_extract(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int time_i[7], double *time_d,
-			double *navlon, double *navlat,
-			double *speed, double *heading,
-			int *nbath, int *namp, int *nss,
-			char *beamflag, double *bath, double *amp,
-			double *bathacrosstrack, double *bathalongtrack,
-			double *ss, double *ssacrosstrack, double *ssalongtrack,
-			char *comment, int *error);
-int mbsys_xse_insert(int verbose, void *mbio_ptr, void *store_ptr,
-			int kind, int time_i[7], double time_d,
-			double navlon, double navlat,
-			double speed, double heading,
-			int nbath, int namp, int nss,
-			char *beamflag, double *bath, double *amp,
-			double *bathacrosstrack, double *bathalongtrack,
-			double *ss, double *ssacrosstrack, double *ssalongtrack,
-			char *comment, int *error);
-int mbsys_xse_ttimes(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int *nbeams,
-			double *ttimes, double *angles,
-			double *angles_forward, double *angles_null,
-			double *heave, double *alongtrack_offset,
-			double *draft, double *ssv, int *error);
-int mbsys_xse_detects(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int *nbeams, int *detects, int *error);
-int mbsys_xse_extract_altitude(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, double *transducer_depth, double *altitude,
-			int *error);
-int mbsys_xse_extract_nav(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind, int time_i[7], double *time_d,
-			double *navlon, double *navlat,
-			double *speed, double *heading, double *draft,
-			double *roll, double *pitch, double *heave,
-			int *error);
-int mbsys_xse_insert_nav(int verbose, void *mbio_ptr, void *store_ptr,
-			int time_i[7], double time_d,
-			double navlon, double navlat,
-			double speed, double heading, double draft,
-			double roll, double pitch, double heave,
-			int *error);
-int mbsys_xse_extract_svp(int verbose, void *mbio_ptr, void *store_ptr,
-			int *kind,
-			int *nsvp,
-			double *depth, double *velocity,
-			int *error);
-int mbsys_xse_insert_svp(int verbose, void *mbio_ptr, void *store_ptr,
-			int nsvp,
-			double *depth, double *velocity,
-			int *error);
-int mbsys_xse_copy(int verbose, void *mbio_ptr,
-			void *store_ptr, void *copy_ptr,
-			int *error);
diff --git a/src/mbio/stamp-h1 b/src/mbio/stamp-h1
deleted file mode 100644
index 589f022..0000000
--- a/src/mbio/stamp-h1
+++ /dev/null
@@ -1 +0,0 @@
-timestamp for src/mbio/mb_config.h
diff --git a/src/mbnavadjust/Makefile.am b/src/mbnavadjust/Makefile.am
deleted file mode 100644
index 37406ef..0000000
--- a/src/mbnavadjust/Makefile.am
+++ /dev/null
@@ -1,23 +0,0 @@
-bin_PROGRAMS = mbnavadjust mbnavadjustmerge
-
-AM_CFLAGS =  ${libgmt_CFLAGS} ${libnetcdf_CFLAGS}
-
-AM_CPPFLAGS = -I${top_srcdir}/src/mbio \
-	      -I${top_srcdir}/src/mbaux \
-	      -I${top_srcdir}/src/gsf \
-	      ${libmotif_CPPFLAGS} 
-
-AM_LDFLAGS = 
-
-LIBS = ${top_builddir}/src/mbio/libmbio.la \
-	${top_builddir}/src/mbaux/libmbaux.la \
-	${top_builddir}/src/mbaux/libmbxgr.la \
-       	${libgmt_LIBS} ${libnetcdf_LIBS} ${libproj_LIBS} \
-	${libmotif_LIBS} \
-	$(LIBM)
-
-mbnavadjust_SOURCES = mbnavadjust.c mbnavadjust_callbacks.c mbnavadjust_creation.c \
-	mbnavadjust_prog.c mbnavadjust_util.c mbnavadjust_creation.h \
-	mbnavadjust_extrawidgets.h mbnavadjust.h
-
-mbnavadjustmerge_SOURCES = mbnavadjustmerge.c mbnavadjust_io.c mbnavadjust_io.h
diff --git a/src/mbnavadjust/Makefile.in b/src/mbnavadjust/Makefile.in
deleted file mode 100644
index 423d1a3..0000000
--- a/src/mbnavadjust/Makefile.in
+++ /dev/null
@@ -1,684 +0,0 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
-
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-
-VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
-am__make_running_with_option = \
-  case $${target_option-} in \
-      ?) ;; \
-      *) echo "am__make_running_with_option: internal error: invalid" \
-              "target option '$${target_option-}' specified" >&2; \
-         exit 1;; \
-  esac; \
-  has_opt=no; \
-  sane_makeflags=$$MAKEFLAGS; \
-  if $(am__is_gnu_make); then \
-    sane_makeflags=$$MFLAGS; \
-  else \
-    case $$MAKEFLAGS in \
-      *\\[\ \	]*) \
-        bs=\\; \
-        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
-          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
-    esac; \
-  fi; \
-  skip_next=no; \
-  strip_trailopt () \
-  { \
-    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
-  }; \
-  for flg in $$sane_makeflags; do \
-    test $$skip_next = yes && { skip_next=no; continue; }; \
-    case $$flg in \
-      *=*|--*) continue;; \
-        -*I) strip_trailopt 'I'; skip_next=yes;; \
-      -*I?*) strip_trailopt 'I';; \
-        -*O) strip_trailopt 'O'; skip_next=yes;; \
-      -*O?*) strip_trailopt 'O';; \
-        -*l) strip_trailopt 'l'; skip_next=yes;; \
-      -*l?*) strip_trailopt 'l';; \
-      -[dEDm]) skip_next=yes;; \
-      -[JT]) skip_next=yes;; \
-    esac; \
-    case $$flg in \
-      *$$target_option*) has_opt=yes; break;; \
-    esac; \
-  done; \
-  test $$has_opt = yes
-am__make_dryrun = (target_option=n; $(am__make_running_with_option))
-am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-bin_PROGRAMS = mbnavadjust$(EXEEXT) mbnavadjustmerge$(EXEEXT)
-subdir = src/mbnavadjust
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/depcomp
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
-	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
-	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
-	$(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-	$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/src/mbio/mb_config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-am__installdirs = "$(DESTDIR)$(bindir)"
-PROGRAMS = $(bin_PROGRAMS)
-am_mbnavadjust_OBJECTS = mbnavadjust.$(OBJEXT) \
-	mbnavadjust_callbacks.$(OBJEXT) mbnavadjust_creation.$(OBJEXT) \
-	mbnavadjust_prog.$(OBJEXT) mbnavadjust_util.$(OBJEXT)
-mbnavadjust_OBJECTS = $(am_mbnavadjust_OBJECTS)
-mbnavadjust_LDADD = $(LDADD)
-AM_V_lt = $(am__v_lt_ at AM_V@)
-am__v_lt_ = $(am__v_lt_ at AM_DEFAULT_V@)
-am__v_lt_0 = --silent
-am__v_lt_1 = 
-am_mbnavadjustmerge_OBJECTS = mbnavadjustmerge.$(OBJEXT) \
-	mbnavadjust_io.$(OBJEXT)
-mbnavadjustmerge_OBJECTS = $(am_mbnavadjustmerge_OBJECTS)
-mbnavadjustmerge_LDADD = $(LDADD)
-AM_V_P = $(am__v_P_ at AM_V@)
-am__v_P_ = $(am__v_P_ at AM_DEFAULT_V@)
-am__v_P_0 = false
-am__v_P_1 = :
-AM_V_GEN = $(am__v_GEN_ at AM_V@)
-am__v_GEN_ = $(am__v_GEN_ at AM_DEFAULT_V@)
-am__v_GEN_0 = @echo "  GEN     " $@;
-am__v_GEN_1 = 
-AM_V_at = $(am__v_at_ at AM_V@)
-am__v_at_ = $(am__v_at_ at AM_DEFAULT_V@)
-am__v_at_0 = @
-am__v_at_1 = 
-DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)/src/mbio
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
-am__mv = mv -f
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
-	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
-	$(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
-	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
-	$(AM_CFLAGS) $(CFLAGS)
-AM_V_CC = $(am__v_CC_ at AM_V@)
-am__v_CC_ = $(am__v_CC_ at AM_DEFAULT_V@)
-am__v_CC_0 = @echo "  CC      " $@;
-am__v_CC_1 = 
-CCLD = $(CC)
-LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
-	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
-	$(AM_LDFLAGS) $(LDFLAGS) -o $@
-AM_V_CCLD = $(am__v_CCLD_ at AM_V@)
-am__v_CCLD_ = $(am__v_CCLD_ at AM_DEFAULT_V@)
-am__v_CCLD_0 = @echo "  CCLD    " $@;
-am__v_CCLD_1 = 
-SOURCES = $(mbnavadjust_SOURCES) $(mbnavadjustmerge_SOURCES)
-DIST_SOURCES = $(mbnavadjust_SOURCES) $(mbnavadjustmerge_SOURCES)
-am__can_run_installinfo = \
-  case $$AM_UPDATE_INFO_DIR in \
-    n|no|NO) false;; \
-    *) (install-info --version) >/dev/null 2>&1;; \
-  esac
-am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
-# Read a list of newline-separated strings from the standard input,
-# and print each of them once, without duplicates.  Input order is
-# *not* preserved.
-am__uniquify_input = $(AWK) '\
-  BEGIN { nonempty = 0; } \
-  { items[$$0] = 1; nonempty = 1; } \
-  END { if (nonempty) { for (i in items) print i; }; } \
-'
-# Make sure the list of sources is unique.  This is necessary because,
-# e.g., the same source file might be shared among _SOURCES variables
-# for different programs/libraries.
-am__define_uniq_tagged_files = \
-  list='$(am__tagged_files)'; \
-  unique=`for i in $$list; do \
-    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-  done | $(am__uniquify_input)`
-ETAGS = etags
-CTAGS = ctags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-CC = @CC@
-CCAS = @CCAS@
-CCASDEPMODE = @CCASDEPMODE@
-CCASFLAGS = @CCASFLAGS@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DLLTOOL = @DLLTOOL@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GREP = @GREP@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBM = @LIBM@
-LIBOBJS = @LIBOBJS@
-LIBS = ${top_builddir}/src/mbio/libmbio.la \
-	${top_builddir}/src/mbaux/libmbaux.la \
-	${top_builddir}/src/mbaux/libmbxgr.la \
-       	${libgmt_LIBS} ${libnetcdf_LIBS} ${libproj_LIBS} \
-	${libmotif_LIBS} \
-	$(LIBM)
-
-LIBTOOL = @LIBTOOL@
-LIBTOOL_DEPS = @LIBTOOL_DEPS@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LTLIBOBJS = @LTLIBOBJS@
-LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
-MAINT = @MAINT@
-MAKEINFO = @MAKEINFO@
-MANIFEST_TOOL = @MANIFEST_TOOL@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-OTPS_DIR = @OTPS_DIR@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_URL = @PACKAGE_URL@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PKG_CONFIG = @PKG_CONFIG@
-PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
-PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-VERSION = @VERSION@
-XDR_LIB = @XDR_LIB@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_AR = @ac_ct_AR@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-fftw_app = @fftw_app@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libGLU_CFLAGS = @libGLU_CFLAGS@
-libGLU_LIBS = @libGLU_LIBS@
-libXm_CFLAGS = @libXm_CFLAGS@
-libXm_LIBS = @libXm_LIBS@
-libdir = @libdir@
-libexecdir = @libexecdir@
-libfftw3_CFLAGS = @libfftw3_CFLAGS@
-libfftw3_LIBS = @libfftw3_LIBS@
-libfftw_CPPFLAGS = @libfftw_CPPFLAGS@
-libfftw_LIBS = @libfftw_LIBS@
-libgmt_CFLAGS = @libgmt_CFLAGS@
-libgmt_CPPFLAGS = @libgmt_CPPFLAGS@
-libgmt_LIBS = @libgmt_LIBS@
-libmotif_CPPFLAGS = @libmotif_CPPFLAGS@
-libmotif_LIBS = @libmotif_LIBS@
-libnetcdf_CFLAGS = @libnetcdf_CFLAGS@
-libnetcdf_CPPFLAGS = @libnetcdf_CPPFLAGS@
-libnetcdf_LIBS = @libnetcdf_LIBS@
-libopengl_CPPFLAGS = @libopengl_CPPFLAGS@
-libopengl_LIBS = @libopengl_LIBS@
-libproj_CFLAGS = @libproj_CFLAGS@
-libproj_CPPFLAGS = @libproj_CPPFLAGS@
-libproj_LIBS = @libproj_LIBS@
-libpsl_CFLAGS = @libpsl_CFLAGS@
-libpsl_LIBS = @libpsl_LIBS@
-localedir = @localedir@
-localstatedir = @localstatedir@
-mandir = @mandir@
-mbsystemdatadir = @mbsystemdatadir@
-mbsystemhtmldir = @mbsystemhtmldir@
-mbsystempsdir = @mbsystempsdir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-AM_CFLAGS = ${libgmt_CFLAGS} ${libnetcdf_CFLAGS}
-AM_CPPFLAGS = -I${top_srcdir}/src/mbio \
-	      -I${top_srcdir}/src/mbaux \
-	      -I${top_srcdir}/src/gsf \
-	      ${libmotif_CPPFLAGS} 
-
-AM_LDFLAGS = 
-mbnavadjust_SOURCES = mbnavadjust.c mbnavadjust_callbacks.c mbnavadjust_creation.c \
-	mbnavadjust_prog.c mbnavadjust_util.c mbnavadjust_creation.h \
-	mbnavadjust_extrawidgets.h mbnavadjust.h
-
-mbnavadjustmerge_SOURCES = mbnavadjustmerge.c mbnavadjust_io.c mbnavadjust_io.h
-all: all-am
-
-.SUFFIXES:
-.SUFFIXES: .c .lo .o .obj
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
-	@for dep in $?; do \
-	  case '$(am__configure_deps)' in \
-	    *$$dep*) \
-	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-	        && { if test -f $@; then exit 0; else break; fi; }; \
-	      exit 1;; \
-	  esac; \
-	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/mbnavadjust/Makefile'; \
-	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --gnu src/mbnavadjust/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	@case '$?' in \
-	  *config.status*) \
-	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-	esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-install-binPROGRAMS: $(bin_PROGRAMS)
-	@$(NORMAL_INSTALL)
-	@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
-	if test -n "$$list"; then \
-	  echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
-	  $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
-	fi; \
-	for p in $$list; do echo "$$p $$p"; done | \
-	sed 's/$(EXEEXT)$$//' | \
-	while read p p1; do if test -f $$p \
-	 || test -f $$p1 \
-	  ; then echo "$$p"; echo "$$p"; else :; fi; \
-	done | \
-	sed -e 'p;s,.*/,,;n;h' \
-	    -e 's|.*|.|' \
-	    -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
-	sed 'N;N;N;s,\n, ,g' | \
-	$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
-	  { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
-	    if ($$2 == $$4) files[d] = files[d] " " $$1; \
-	    else { print "f", $$3 "/" $$4, $$1; } } \
-	  END { for (d in files) print "f", d, files[d] }' | \
-	while read type dir files; do \
-	    if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
-	    test -z "$$files" || { \
-	    echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
-	    $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
-	    } \
-	; done
-
-uninstall-binPROGRAMS:
-	@$(NORMAL_UNINSTALL)
-	@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
-	files=`for p in $$list; do echo "$$p"; done | \
-	  sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
-	      -e 's/$$/$(EXEEXT)/' \
-	`; \
-	test -n "$$list" || exit 0; \
-	echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
-	cd "$(DESTDIR)$(bindir)" && rm -f $$files
-
-clean-binPROGRAMS:
-	@list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \
-	echo " rm -f" $$list; \
-	rm -f $$list || exit $$?; \
-	test -n "$(EXEEXT)" || exit 0; \
-	list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
-	echo " rm -f" $$list; \
-	rm -f $$list
-
-mbnavadjust$(EXEEXT): $(mbnavadjust_OBJECTS) $(mbnavadjust_DEPENDENCIES) $(EXTRA_mbnavadjust_DEPENDENCIES) 
-	@rm -f mbnavadjust$(EXEEXT)
-	$(AM_V_CCLD)$(LINK) $(mbnavadjust_OBJECTS) $(mbnavadjust_LDADD) $(LIBS)
-
-mbnavadjustmerge$(EXEEXT): $(mbnavadjustmerge_OBJECTS) $(mbnavadjustmerge_DEPENDENCIES) $(EXTRA_mbnavadjustmerge_DEPENDENCIES) 
-	@rm -f mbnavadjustmerge$(EXEEXT)
-	$(AM_V_CCLD)$(LINK) $(mbnavadjustmerge_OBJECTS) $(mbnavadjustmerge_LDADD) $(LIBS)
-
-mostlyclean-compile:
-	-rm -f *.$(OBJEXT)
-
-distclean-compile:
-	-rm -f *.tab.c
-
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbnavadjust.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbnavadjust_callbacks.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbnavadjust_creation.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbnavadjust_io.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbnavadjust_prog.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbnavadjust_util.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbnavadjustmerge.Po at am__quote@
-
-.c.o:
- at am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(COMPILE) -c -o $@ $<
-
-.c.obj:
- at am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
- at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-
-.c.lo:
- at am__fastdepCC_TRUE@	$(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(LTCOMPILE) -c -o $@ $<
-
-mostlyclean-libtool:
-	-rm -f *.lo
-
-clean-libtool:
-	-rm -rf .libs _libs
-
-ID: $(am__tagged_files)
-	$(am__define_uniq_tagged_files); mkid -fID $$unique
-tags: tags-am
-TAGS: tags
-
-tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
-	set x; \
-	here=`pwd`; \
-	$(am__define_uniq_tagged_files); \
-	shift; \
-	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
-	  test -n "$$unique" || unique=$$empty_fix; \
-	  if test $$# -gt 0; then \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      "$$@" $$unique; \
-	  else \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      $$unique; \
-	  fi; \
-	fi
-ctags: ctags-am
-
-CTAGS: ctags
-ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
-	$(am__define_uniq_tagged_files); \
-	test -z "$(CTAGS_ARGS)$$unique" \
-	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$unique
-
-GTAGS:
-	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && $(am__cd) $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) "$$here"
-cscopelist: cscopelist-am
-
-cscopelist-am: $(am__tagged_files)
-	list='$(am__tagged_files)'; \
-	case "$(srcdir)" in \
-	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
-	  *) sdir=$(subdir)/$(srcdir) ;; \
-	esac; \
-	for i in $$list; do \
-	  if test -f "$$i"; then \
-	    echo "$(subdir)/$$i"; \
-	  else \
-	    echo "$$sdir/$$i"; \
-	  fi; \
-	done >> $(top_builddir)/cscope.files
-
-distclean-tags:
-	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	list='$(DISTFILES)'; \
-	  dist_files=`for file in $$list; do echo $$file; done | \
-	  sed -e "s|^$$srcdirstrip/||;t" \
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
-	case $$dist_files in \
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
-			   sort -u` ;; \
-	esac; \
-	for file in $$dist_files; do \
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  if test -d $$d/$$file; then \
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
-	    if test -d "$(distdir)/$$file"; then \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
-	  else \
-	    test -f "$(distdir)/$$file" \
-	    || cp -p $$d/$$file "$(distdir)/$$file" \
-	    || exit 1; \
-	  fi; \
-	done
-check-am: all-am
-check: check-am
-all-am: Makefile $(PROGRAMS)
-installdirs:
-	for dir in "$(DESTDIR)$(bindir)"; do \
-	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
-	done
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
-	if test -z '$(STRIP)'; then \
-	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	      install; \
-	else \
-	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
-	fi
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
-	@echo "This command is intended for maintainers to use"
-	@echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am
-
-distclean: distclean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
-	distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am: install-binPROGRAMS
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic \
-	mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am: uninstall-binPROGRAMS
-
-.MAKE: install-am install-strip
-
-.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \
-	clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \
-	ctags ctags-am distclean distclean-compile distclean-generic \
-	distclean-libtool distclean-tags distdir dvi dvi-am html \
-	html-am info info-am install install-am install-binPROGRAMS \
-	install-data install-data-am install-dvi install-dvi-am \
-	install-exec install-exec-am install-html install-html-am \
-	install-info install-info-am install-man install-pdf \
-	install-pdf-am install-ps install-ps-am install-strip \
-	installcheck installcheck-am installdirs maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-compile \
-	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-	tags tags-am uninstall uninstall-am uninstall-binPROGRAMS
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/mbnavadjust/Makefile.org b/src/mbnavadjust/Makefile.org
deleted file mode 100755
index 7a3ad4d..0000000
--- a/src/mbnavadjust/Makefile.org
+++ /dev/null
@@ -1,59 +0,0 @@
-
-# Begin user code block <abstract>
-# End user code block <abstract>
-
-#
-# README: Portions of this file are merged at file generation
-# time. Edits can be made *only* in between specified code blocks, look
-# for keywords <Begin user code> and <End user code>.
-#
-#
-# Created by BuilderXcessory Version 6.1.3
-# Generated by Code Generator Xcessory 6.1.3 (08/19/04) CGX Scripts 6.1 Motif 2.1 
-#
-#
-
-# Begin user code block <make_user_files>
-      USER_SRCS =
-      USER_OBJS =
-    USER_CFLAGS =
- USER_LIBRARIES =
-
-# End user code block <make_user_files>
-
-             RM = rm -f
-             CC = cc
-         CFLAGS = $(USER_CFLAGS) 
-           LIBS = $(USER_LIBRARIES) -L /usr/X11/lib -lXm -lXt -lX11 -lm
-
-OFILES = $(USER_OBJS) \
-         mbnavadjust.o \
-         mbnavadjust_creation.o \
-         mbnavadjust_callbacks.o \
-         mbnavadjust_util.o
-
-FILES = $(USER_SRCS) \
-        mbnavadjust.c \
-        mbnavadjust_creation.c \
-        mbnavadjust_callbacks.c \
-        mbnavadjust_util.c
-
-# User-specified options:
-
-
-all: mbnavadjust
-
-mbnavadjust: $(OFILES)
-	$(CC) $(CFLAGS) $(OFILES) $(LIBS) -o $@
-
-ocodecenter:: 
-	#load $(CFLAGS) $(OFILES) $(LIBS)
-
-codecenter:: 
-	#load $(CFLAGS) $(FILES) $(LIBS)
-
-clean::
-	$(RM) $(OFILES) mbnavadjust
-
-# Begin user code block <end_makefile>
-# End user code block <end_makefile>
diff --git a/src/mbnavadjust/mbnavadjust.c b/src/mbnavadjust/mbnavadjust.c
deleted file mode 100644
index 7812697..0000000
--- a/src/mbnavadjust/mbnavadjust.c
+++ /dev/null
@@ -1,176 +0,0 @@
-
-/* Begin user code block <abstract> */
-/* End user code block <abstract> */
-
-/**
- * README: Portions of this file are merged at file generation
- * time. Edits can be made *only* in between specified code blocks, look
- * for keywords <Begin user code> and <End user code>.
- */
-/*
- * Generated by the ICS Builder Xcessory (BX).
- *
- * BuilderXcessory Version 6.1.3
- * Code Generator Xcessory 6.1.3 (08/19/04) CGX Scripts 6.1 Motif 2.1
- *
- */
-
-
-/* Begin user code block <file_comments> */
-#include <stdio.h>
-#include <stdlib.h>
-/* End user code block <file_comments> */
-
-/*
- * Motif required Headers
- */
-#include <X11/StringDefs.h>
-#include <Xm/Xm.h>
-#include <Xm/DialogS.h>
-#include <Xm/RepType.h>
-#include <Xm/MwmUtil.h>
-
-/**
- * Globally included information.
- */
-
-
-/*
- * Headers for classes used in this program
- */
-
-/**
- * Common constant and pixmap declarations.
- */
-#include "mbnavadjust_creation.h"
-
-/**
- * Convenience functions from utilities file.
- */
-extern void RegisterBxConverters(XtAppContext);
-extern XtPointer BX_CONVERT(Widget, char *, char *, int, Boolean *);
-extern XtPointer BX_DOUBLE(double);
-extern XtPointer BX_SINGLE(float);
-extern void BX_MENU_POST(Widget, XtPointer, XEvent *, Boolean *);
-extern Pixmap XPM_PIXMAP(Widget, char **);
-extern void BX_SET_BACKGROUND_COLOR(Widget, ArgList, Cardinal *, Pixel);
-
-/**
- * Declarations for shell callbacks.
- */
-extern void BxExitCB(Widget, XtPointer, XtPointer);
-
-/* Avoid conflict due to BOOL redefinitions (Xm vs Win headers) */
-#ifdef WIN32
-#	undef BOOL
-#endif
-
-/* Begin user code block <globals> */
-
-#include "mb_define.h"
-#include "mb_status.h"
-#include "mb_aux.h"
-#include "mbnavadjust.h"
-
-Widget CreatemainWindow(Widget parent);
-
-/* End user code block <globals> */
-
-/**
- * Change this line via the Output Application Names Dialog.
- */
-#define BX_APP_CLASS "mbnavadjust"
-
-int main( int argc, char **argv)
-{
-    Widget       parent;
-    XtAppContext app;
-    Arg          args[256];
-    Cardinal     ac;
-    Widget   topLevelShell;
-    Widget   mainWindow;
-
-    /* Begin user code block <declarations> */
-
-    /* make sure that the argc that goes to XtVaAppInitialize
-       is 1 so that no options are removed by its option parsing */
-    int		 argc_save;
-    argc_save = argc;
-    argc = 1;
-
-    /* End user code block <declarations> */
-
-    /*
-     * Initialize Xt.
-     */
-
-    // XtSetLanguageProc(NULL, (XtLanguageProc) NULL, NULL);
-
-    /*
-     * The applicationShell is created as an unrealized
-     * parent for multiple topLevelShells.  The topLevelShells
-     * are created as popup children of the applicationShell.
-     * This is a recommendation of Paul Asente & Ralph Swick in
-     * _X_Window_System_Toolkit_ p. 677.
-     */
-
-    parent = XtVaOpenApplication ( &app,
-                                   BX_APP_CLASS,
-                                   NULL,
-                                   0,
-                                   &argc,
-                                   argv,
-                                   NULL,
-                                   sessionShellWidgetClass,
-                                   NULL );
-
-    RegisterBxConverters(app);
-    XmRepTypeInstallTearOffModelConverter();
-
-    /* Begin user code block <create_shells> */
-    /* End user code block <create_shells> */
-
-    /*
-     * Create classes and widgets used in this program.
-     */
-
-    /* Begin user code block <create_topLevelShell> */
-    /* End user code block <create_topLevelShell> */
-
-    ac = 0;
-    XtSetArg(args[ac], XmNtitle, "MBnavadjust"); ac++;
-    XtSetArg(args[ac], XmNiconName, "MBnavadjust"); ac++;
-    XtSetArg(args[ac], XmNx, 82); ac++;
-    XtSetArg(args[ac], XmNy, 396); ac++;
-    XtSetArg(args[ac], XmNwidth, 962); ac++;
-    XtSetArg(args[ac], XmNheight, 400); ac++;
-    topLevelShell = XtCreatePopupShell((char *)"topLevelShell",
-        topLevelShellWidgetClass,
-        parent,
-        args,
-        ac);
-    XtAddCallback(topLevelShell, XmNdestroyCallback, BxExitCB, (XtPointer)0);
-    mainWindow = (Widget)CreatemainWindow(topLevelShell);
-    XtManageChild(mainWindow);
-    XtPopup(XtParent(mainWindow), XtGrabNone);
-
-    /* Begin user code block <app_procedures> */
-
-    /* initialize app value and wait until view realized */
-    do_wait_until_viewed(app);
-
-    /* initialize everything */
-    do_mbnavadjust_init(argc_save,argv);
-
-    /* End user code block <app_procedures> */
-
-    /* Begin user code block <main_loop> */
-    /* End user code block <main_loop> */
-
-    XtAppMainLoop(app);
-
-    /*
-     * A return value regardless of whether or not the main loop ends.
-     */
-     return(0);
-}
diff --git a/src/mbnavadjust/mbnavadjust.h b/src/mbnavadjust/mbnavadjust.h
deleted file mode 100644
index 8340ca6..0000000
--- a/src/mbnavadjust/mbnavadjust.h
+++ /dev/null
@@ -1,637 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbnavadjust.h	6/24/95
- *    $Id: mbnavadjust.h 2247 2015-05-29 21:28:28Z caress $
- *
- *    Copyright (c) 2000-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbnavadjust is an interactive navigation adjustment package
- * for swath sonar data.
- * It can work with any data format supported by the MBIO library.
- * This include file contains global control parameters shared with
- * the Motif interface code.
- *
- * Author:	D. W. Caress
- * Date:	March 22, 2000
- *
- *
- */
-
-/*--------------------------------------------------------------------*/
-
-#ifndef MB_DEFINE_DEF
-#include "mb_define.h"
-#endif
-
-#ifndef MB_YES
-#include "mb_status.h"
-#endif
-
-#ifdef MBNAVADJUST_DECLARE_GLOBALS
-#define MBNAVADJUST_EXTERNAL
-#else
-#define MBNAVADJUST_EXTERNAL extern
-#endif
-
-/* mbnavadjust global defines */
-#define STRING_MAX 			MB_PATH_MAXLINE
-#define BUFFER_MAX 			1024
-#define ALLOC_NUM			10
-#define MBNA_SNAV_NUM			11
-#define	MBNA_STATUS_GUI			0
-#define	MBNA_STATUS_AUTOPICK		1
-#define	MBNA_STATUS_NAVERR		2
-#define	MBNA_STATUS_NAVSOLVE		3
-#define	MBNA_INVERSION_NONE		0
-#define	MBNA_INVERSION_OLD		1
-#define	MBNA_INVERSION_CURRENT		2
-#define MBNA_INVERT_ZFULL		0
-#define MBNA_INVERT_ZISOLATED		1
-#define	MBNA_FILE_POORNAV		1
-#define	MBNA_FILE_GOODNAV		2
-#define	MBNA_FILE_FIXEDNAV		3
-#define	MBNA_FILE_FIXEDXYNAV		4
-#define	MBNA_FILE_FIXEDZNAV		5
-#define	MBNA_TIE_NONE			0
-#define	MBNA_TIE_XYZ			1
-#define	MBNA_TIE_XY			2
-#define	MBNA_TIE_Z			3
-#define	MBNA_CROSSING_STATUS_NONE	0
-#define	MBNA_CROSSING_STATUS_SET	1
-#define	MBNA_CROSSING_STATUS_SKIP	2
-#define MBNA_TIME_GAP_MAX		120.0
-#define MBNA_TIME_DIFF_THRESHOLD	2.0
-#define MBNA_VIEW_LIST_SURVEYS		0
-#define MBNA_VIEW_LIST_FILES		1
-#define MBNA_VIEW_LIST_FILESECTIONS	2
-#define MBNA_VIEW_LIST_CROSSINGS	3
-#define MBNA_VIEW_LIST_MEDIOCRECROSSINGS	4
-#define MBNA_VIEW_LIST_GOODCROSSINGS	5
-#define MBNA_VIEW_LIST_BETTERCROSSINGS	6
-#define MBNA_VIEW_LIST_TRUECROSSINGS	7
-#define MBNA_VIEW_LIST_TIES		8
-#define MBNA_VIEW_MODE_ALL		0
-#define MBNA_VIEW_MODE_SURVEY		1
-#define MBNA_VIEW_MODE_WITHSURVEY	2
-#define MBNA_VIEW_MODE_FILE		3
-#define MBNA_VIEW_MODE_WITHFILE		4
-#define MBNA_VIEW_MODE_WITHSECTION	5
-#define MBNA_SELECT_NONE		-1
-#define MBNA_VECTOR_ALLOC_INC		1000
-#define MBNA_PEN_UP			3
-#define MBNA_PEN_DOWN			2
-#define MBNA_PEN_ORIGIN			-3
-#define MBNA_PEN_COLOR			0
-#define MBNA_PLOT_MODE_FIRST 		0
-#define MBNA_PLOT_MODE_MOVE 		1
-#define MBNA_PLOT_MODE_ZOOMFIRST 	2
-#define MBNA_PLOT_MODE_ZOOM 		3
-#define MBNA_MASK_DIM			25
-#define MBNA_MISFIT_ZEROCENTER		0
-#define MBNA_MISFIT_AUTOCENTER		1
-#define MBNA_MISFIT_DIMXY		61
-#define MBNA_MISFIT_NTHRESHOLD		(MBNA_MISFIT_DIMXY * MBNA_MISFIT_DIMXY / 36)
-#define MBNA_MISFIT_DIMZ		51
-#define MBNA_BIAS_SAME			0
-#define MBNA_BIAS_DIFFERENT		1
-#define MBNA_MEDIOCREOVERLAP_THRESHOLD		10
-#define MBNA_GOODOVERLAP_THRESHOLD		25
-#define MBNA_BETTEROVERLAP_THRESHOLD		50
-
-#define	MBNA_MODELPLOT_TIMESERIES	0
-#define	MBNA_MODELPLOT_PERTURBATION	1
-#define	MBNA_MODELPLOT_TIEOFFSETS	2
-#define	MBNA_MODELPLOT_LEFT_WIDTH	25
-#define	MBNA_MODELPLOT_LEFT_HEIGHT	65
-#define	MBNA_MODELPLOT_X_SPACE		10
-#define	MBNA_MODELPLOT_Y_SPACE		30
-
-#define	MBNA_INTERP_NONE		0
-#define	MBNA_INTERP_CONSTANT		1
-#define	MBNA_INTERP_INTERP		2
-
-#define MBNA_SMOOTHING_DEFAULT		2
-
-#define MBNA_INTERATION_MAX		10000
-#define MBNA_CONVERGENCE		0.000001
-#define MBNA_SMALL			0.0001
-
-/* minimum initial sigma_crossing (meters) */
-#define	SIGMA_MINIMUM	0.1
-
-/* ping type defines */
-#define	SIDE_PORT	0
-#define	SIDE_STBD	1
-#define	SIDE_FULLSWATH	2
-
-/* route version define */
-#define ROUTE_VERSION "1.00"
-
-/* mbnavadjust project and file structures */
-struct mbna_section {
-	int	num_pings;
-	int	num_beams;
-	int	global_start_ping;
-	int	global_start_snav;
-	int	continuity;
-	double	distance;
-	double	btime_d;
-	double 	etime_d;
-	double	lonmin;
-	double	lonmax;
- 	double	latmin;
-	double	latmax;
-	double	depthmin;
-	double	depthmax;
-	int	coverage[MBNA_MASK_DIM * MBNA_MASK_DIM];
-	int	num_snav;
-	int	snav_id[MBNA_SNAV_NUM];
-	int	snav_num_ties[MBNA_SNAV_NUM];
-	int	snav_invert_id[MBNA_SNAV_NUM];
-	int	snav_invert_constraint[MBNA_SNAV_NUM];
-	double	snav_distance[MBNA_SNAV_NUM];
-	double	snav_time_d[MBNA_SNAV_NUM];
-	double	snav_lon[MBNA_SNAV_NUM];
-	double	snav_lat[MBNA_SNAV_NUM];
-	double	snav_lon_offset[MBNA_SNAV_NUM];
-	double	snav_lat_offset[MBNA_SNAV_NUM];
-	double	snav_z_offset[MBNA_SNAV_NUM];
-	double	snav_lon_offset_int[MBNA_SNAV_NUM];
-	double	snav_lat_offset_int[MBNA_SNAV_NUM];
-	double	snav_z_offset_int[MBNA_SNAV_NUM];
-	int	show_in_modelplot;
-	int	modelplot_start_count;
-	int	contoursuptodate;
-	int	global_tie_status;
-	int	global_tie_snav;
-	double	global_tie_offset_x;
-	double	global_tie_offset_y;
-	double	global_tie_offset_x_m;
-	double	global_tie_offset_y_m;
-	double	global_tie_offset_z_m;
-	double	global_tie_xsigma;
-	double	global_tie_ysigma;
-	double	global_tie_zsigma;
-};
-struct mbna_file {
-	int	status;
-	int	id;
-	int	output_id;
-	char 	file[STRING_MAX];
-	char 	path[STRING_MAX];
-	int	format;
-	double	heading_bias_import;
-	double	roll_bias_import;
-	double	heading_bias;
-	double	roll_bias;
-	int	block;
-	double	block_offset_x;
-	double	block_offset_y;
-	double	block_offset_z;
-	int	show_in_modelplot;
-	int	num_snavs;
-	int	num_pings;
-	int	num_beams;
-	int	num_sections;
-	int	num_sections_alloc;
-	struct mbna_section *sections;
-};
-struct mbna_tie {
-	int	status;
-	int	snav_1;
-	double	snav_1_time_d;
-	int	snav_2;
-	double	snav_2_time_d;
-	double	offset_x;
-	double	offset_y;
-	double	offset_x_m;
-	double	offset_y_m;
-	double	offset_z_m;
-	double	sigmar1;
-	double	sigmax1[3];
-	double	sigmar2;
-	double	sigmax2[3];
-	double	sigmar3;
-	double	sigmax3[3];
-	int	inversion_status;
-	double	inversion_offset_x;
-	double	inversion_offset_y;
-	double	inversion_offset_x_m;
-	double	inversion_offset_y_m;
-	double	inversion_offset_z_m;
-	int	block_1;
-	int	block_2;
-	int	isurveyplotindex;
-};
-struct mbna_crossing {
-	int	status;
-	int	truecrossing;
-	int	overlap;
-	int	file_id_1;
-	int	section_1;
-	int	file_id_2;
-	int	section_2;
-	int	num_ties;
-	struct mbna_tie ties[MBNA_SNAV_NUM];
-};
-struct mbna_project {
-	int	open;
-	char	name[STRING_MAX];
-	char	path[STRING_MAX];
-	char	home[STRING_MAX];
-	char	datadir[STRING_MAX];
-	char	logfile[STRING_MAX];
-	int	num_files;
-	int	num_files_alloc;
-	struct mbna_file *files;
-	int	num_blocks;
-	int	num_snavs;
-	int	num_pings;
-	int	num_beams;
-	int	num_crossings;
-	int	num_crossings_alloc;
-	int	num_crossings_analyzed;
-	int	num_goodcrossings;
-	int	num_truecrossings;
-	int	num_truecrossings_analyzed;
-	struct mbna_crossing *crossings;
-	int	num_ties;
-	double	section_length;
-	int	section_soundings;
-	double	cont_int;
-	double	col_int;
-	double	tick_int;
-	double	label_int;
-	int	decimation;
-	double	precision;
-	double	smoothing;
-	double	zoffsetwidth;
-	int	inversion;
-	int	modelplot;
-	int	modelplot_style;
-	FILE	*logfp;
-};
-struct mbna_plot_vector
-    {
-    int	    command;
-    int	    color;
-    double  x;
-    double  y;
-    };
-struct mbna_contour_vector
-    {
-    int	    nvector;
-    int	    nvector_alloc;
-    struct mbna_plot_vector *vector;
-    };
-
-/* mbnavadjust global control parameters */
-MBNAVADJUST_EXTERNAL int	mbna_verbose;
-MBNAVADJUST_EXTERNAL int	mbna_status;
-MBNAVADJUST_EXTERNAL int	mbna_view_list;
-MBNAVADJUST_EXTERNAL int	mbna_view_mode;
-MBNAVADJUST_EXTERNAL int	mbna_invert_mode;
-MBNAVADJUST_EXTERNAL int	mbna_color_foreground;
-MBNAVADJUST_EXTERNAL int	mbna_color_background;
-MBNAVADJUST_EXTERNAL int	mbna_survey_select;
-MBNAVADJUST_EXTERNAL int	mbna_file_select;
-MBNAVADJUST_EXTERNAL int	mbna_section_select;
-MBNAVADJUST_EXTERNAL int	mbna_crossing_select;
-MBNAVADJUST_EXTERNAL int	mbna_tie_select;
-MBNAVADJUST_EXTERNAL int	mbna_current_crossing;
-MBNAVADJUST_EXTERNAL int	mbna_current_tie;
-MBNAVADJUST_EXTERNAL int	mbna_naverr_load;
-MBNAVADJUST_EXTERNAL int	mbna_file_id_1;
-MBNAVADJUST_EXTERNAL int	mbna_section_1;
-MBNAVADJUST_EXTERNAL int	mbna_file_id_2;
-MBNAVADJUST_EXTERNAL int	mbna_section_2;
-MBNAVADJUST_EXTERNAL int	mbna_snav_1;
-MBNAVADJUST_EXTERNAL double	mbna_snav_1_time_d;
-MBNAVADJUST_EXTERNAL double	mbna_snav_1_lon;
-MBNAVADJUST_EXTERNAL double	mbna_snav_1_lat;
-MBNAVADJUST_EXTERNAL int	mbna_snav_2;
-MBNAVADJUST_EXTERNAL double	mbna_snav_2_time_d;
-MBNAVADJUST_EXTERNAL double	mbna_snav_2_lon;
-MBNAVADJUST_EXTERNAL double	mbna_snav_2_lat;
-MBNAVADJUST_EXTERNAL double	mbna_offset_x;
-MBNAVADJUST_EXTERNAL double	mbna_offset_y;
-MBNAVADJUST_EXTERNAL double	mbna_offset_z;
-MBNAVADJUST_EXTERNAL double	mbna_invert_offset_x;
-MBNAVADJUST_EXTERNAL double	mbna_invert_offset_y;
-MBNAVADJUST_EXTERNAL double	mbna_invert_offset_z;
-MBNAVADJUST_EXTERNAL double	mbna_offset_x_old;
-MBNAVADJUST_EXTERNAL double	mbna_offset_y_old;
-MBNAVADJUST_EXTERNAL double	mbna_offset_z_old;
-MBNAVADJUST_EXTERNAL double	mbna_lon_min;
-MBNAVADJUST_EXTERNAL double	mbna_lon_max;
-MBNAVADJUST_EXTERNAL double	mbna_lat_min;
-MBNAVADJUST_EXTERNAL double	mbna_lat_max;
-MBNAVADJUST_EXTERNAL double	mbna_mtodeglon;
-MBNAVADJUST_EXTERNAL double	mbna_mtodeglat;
-MBNAVADJUST_EXTERNAL int	mbna_contour_algorithm;
-MBNAVADJUST_EXTERNAL int	mbna_ncolor;
-MBNAVADJUST_EXTERNAL double	mbna_ox;
-MBNAVADJUST_EXTERNAL double	mbna_oy;
-MBNAVADJUST_EXTERNAL int    mbna_bin_beams_bath;
-MBNAVADJUST_EXTERNAL double mbna_bin_swathwidth;
-MBNAVADJUST_EXTERNAL double mbna_bin_pseudobeamwidth;
-MBNAVADJUST_EXTERNAL double	mbna_plot_lon_min;
-MBNAVADJUST_EXTERNAL double	mbna_plot_lon_max;
-MBNAVADJUST_EXTERNAL double	mbna_plot_lat_min;
-MBNAVADJUST_EXTERNAL double	mbna_plot_lat_max;
-MBNAVADJUST_EXTERNAL double	mbna_overlap_lon_min;
-MBNAVADJUST_EXTERNAL double	mbna_overlap_lon_max;
-MBNAVADJUST_EXTERNAL double	mbna_overlap_lat_min;
-MBNAVADJUST_EXTERNAL double	mbna_overlap_lat_max;
-MBNAVADJUST_EXTERNAL double	mbna_plotx_scale;
-MBNAVADJUST_EXTERNAL double	mbna_ploty_scale;
-MBNAVADJUST_EXTERNAL int	mbna_misfit_center;
-MBNAVADJUST_EXTERNAL double	mbna_misfit_xscale;
-MBNAVADJUST_EXTERNAL double	mbna_misfit_yscale;
-MBNAVADJUST_EXTERNAL double mbna_misfit_offset_x;
-MBNAVADJUST_EXTERNAL double mbna_misfit_offset_y;
-MBNAVADJUST_EXTERNAL double mbna_misfit_offset_z;
-MBNAVADJUST_EXTERNAL int	mbna_minmisfit_nthreshold;
-MBNAVADJUST_EXTERNAL double	mbna_minmisfit;
-MBNAVADJUST_EXTERNAL int	mbna_minmisfit_n;
-MBNAVADJUST_EXTERNAL double mbna_minmisfit_x;
-MBNAVADJUST_EXTERNAL double mbna_minmisfit_y;
-MBNAVADJUST_EXTERNAL double mbna_minmisfit_z;
-MBNAVADJUST_EXTERNAL double mbna_minmisfit_xh;
-MBNAVADJUST_EXTERNAL double mbna_minmisfit_yh;
-MBNAVADJUST_EXTERNAL double mbna_minmisfit_zh;
-MBNAVADJUST_EXTERNAL double mbna_minmisfit_sr1;
-MBNAVADJUST_EXTERNAL double mbna_minmisfit_sx1[4];
-MBNAVADJUST_EXTERNAL double mbna_minmisfit_sr2;
-MBNAVADJUST_EXTERNAL double mbna_minmisfit_sx2[4];
-MBNAVADJUST_EXTERNAL double mbna_minmisfit_sr3;
-MBNAVADJUST_EXTERNAL double mbna_minmisfit_sx3[4];
-MBNAVADJUST_EXTERNAL double	mbna_zoff_scale_x;
-MBNAVADJUST_EXTERNAL double	mbna_zoff_scale_y;
-
-MBNAVADJUST_EXTERNAL int	mbna_zoom_x1;
-MBNAVADJUST_EXTERNAL int	mbna_zoom_y1;
-MBNAVADJUST_EXTERNAL int	mbna_zoom_x2;
-MBNAVADJUST_EXTERNAL int	mbna_zoom_y2;
-MBNAVADJUST_EXTERNAL double mbna_smoothweight;
-MBNAVADJUST_EXTERNAL double mbna_offsetweight;
-MBNAVADJUST_EXTERNAL double mbna_zweightfactor;
-MBNAVADJUST_EXTERNAL int	mbna_bias_mode;
-MBNAVADJUST_EXTERNAL int	mbna_allow_set_tie;
-
-/* plot vector data */
-MBNAVADJUST_EXTERNAL struct mbna_contour_vector *mbna_contour;
-MBNAVADJUST_EXTERNAL struct mbna_contour_vector mbna_contour1;
-MBNAVADJUST_EXTERNAL struct mbna_contour_vector mbna_contour2;
-
-/* model plot parameters */
-MBNAVADJUST_EXTERNAL int	mbna_modelplot_width;
-MBNAVADJUST_EXTERNAL int	mbna_modelplot_height;
-MBNAVADJUST_EXTERNAL int	mbna_modelplot;
-MBNAVADJUST_EXTERNAL int	mbna_modelplot_count;
-MBNAVADJUST_EXTERNAL int	mbna_modelplot_start;
-MBNAVADJUST_EXTERNAL int	mbna_modelplot_end;
-MBNAVADJUST_EXTERNAL int	mbna_modelplot_xo;
-MBNAVADJUST_EXTERNAL int	mbna_modelplot_yo_lon;
-MBNAVADJUST_EXTERNAL int	mbna_modelplot_yo_lat;
-MBNAVADJUST_EXTERNAL int	mbna_modelplot_yo_z;
-MBNAVADJUST_EXTERNAL double	mbna_modelplot_xscale;
-MBNAVADJUST_EXTERNAL double	mbna_modelplot_yscale;
-MBNAVADJUST_EXTERNAL double	mbna_modelplot_yzscale;
-MBNAVADJUST_EXTERNAL int	mbna_modelplot_zoom_x1;
-MBNAVADJUST_EXTERNAL int	mbna_modelplot_zoom_x2;
-MBNAVADJUST_EXTERNAL int	mbna_modelplot_zoom;
-MBNAVADJUST_EXTERNAL int	mbna_modelplot_startzoom;
-MBNAVADJUST_EXTERNAL int	mbna_modelplot_endzoom;
-MBNAVADJUST_EXTERNAL int	mbna_num_ties_plot;
-MBNAVADJUST_EXTERNAL int	mbna_modelplot_tiestart;
-MBNAVADJUST_EXTERNAL int	mbna_modelplot_tieend;
-MBNAVADJUST_EXTERNAL int	mbna_modelplot_tiezoom;
-MBNAVADJUST_EXTERNAL int	mbna_modelplot_tiestartzoom;
-MBNAVADJUST_EXTERNAL int	mbna_modelplot_tieendzoom;
-MBNAVADJUST_EXTERNAL int	mbna_modelplot_pickfile;
-MBNAVADJUST_EXTERNAL int	mbna_modelplot_picksection;
-MBNAVADJUST_EXTERNAL int	mbna_modelplot_picksnav;
-MBNAVADJUST_EXTERNAL int	mbna_modelplot_blocksurvey1;
-MBNAVADJUST_EXTERNAL int	mbna_modelplot_blocksurvey2;
-
-/* mbnavadjust global project parameters */
-MBNAVADJUST_EXTERNAL struct	mbna_project project;
-
-/* flag to reset all crossings to unanalyzed when a project is opened */
-MBNAVADJUST_EXTERNAL int	mbna_reset_crossings;
-
-/* function prototype definitions */
-void	do_mbnavadjust_init(int argc, char **argv);
-void	do_set_controls(void);
-void	do_update_status(void);
-void	do_update_modelplot_status(void);
-void	do_naverr_init(void);
-void	do_update_naverr(void);
-void	do_naverr_offsetlabel(void);
-void	do_naverr_test_graphics(void);
-void	do_naverr_plot(int plotmode);
-int	do_message_on(char *message);
-int	do_message_update(char *message);
-int	do_message_off(void);
-int	do_error_dialog(char *s1, char *s2, char *s3);
-void	do_bell(int length);
-int	mbnavadjust_init_globals(void);
-int	mbnavadjust_init(int argc,char **argv);
-int	mbnavadjust_set_colors(int ncol, int *pixels);
-int	mbnavadjust_set_borders(int *cn_brdr, int *cr_brdr, int *zc_brdr);
-int	mbnavadjust_set_graphics(void *cn_xgid, void *cr_xgid, void *zc_xgid);
-int	mbnavadjust_file_new(char *projectname);
-int	mbnavadjust_file_open(char *projectname);
-int	mbnavadjust_close_project(void);
-int	mbnavadjust_write_project(void);
-int	mbnavadjust_read_project(void);
-int	mbnavadjust_import_data(char *path, int format);
-int	mbnavadjust_import_file(char *path, int format, int firstfile);
-int 	mbnavadjust_bin_bathymetry(double altitude, int beams_bath, char *beamflag, double *bath,
-				double *bathacrosstrack, double *bathalongtrack,
-				int mbna_bin_beams_bath, double mbna_bin_pseudobeamwidth,
-				double mbna_bin_swathwidth, char *bin_beamflag,
-				double *bin_bath, double *bin_bathacrosstrack, double *bin_bathalongtrack,
-				int *error);
-int	mbnavadjust_findcrossings(void);
-int	mbnavadjust_findcrossingsfile(int ifile);
-int	mbnavadjust_poornav_file(void);
-int	mbnavadjust_goodnav_file(void);
-int	mbnavadjust_fixednav_file(void);
-int	mbnavadjust_fixedxynav_file(void);
-int	mbnavadjust_fixedznav_file(void);
-int	mbnavadjust_set_tie_xy(void);
-int	mbnavadjust_set_tie_z(void);
-int	mbnavadjust_set_tie_xyz(void);
-int	mbnavadjust_naverr_save(void);
-int	mbnavadjust_naverr_specific(int new_crossing, int new_tie);
-int	mbnavadjust_naverr_next(void);
-int	mbnavadjust_naverr_previous(void);
-int	mbnavadjust_naverr_nextunset(void);
-int	mbnavadjust_naverr_selecttie(void);
-int	mbnavadjust_naverr_addtie(void);
-int	mbnavadjust_naverr_deletetie(void);
-int	mbnavadjust_deletetie(int icrossing, int jtie, int deletestatus);
-int	mbnavadjust_naverr_settie(void);
-int	mbnavadjust_naverr_resettie(void);
-int	mbnavadjust_naverr_checkoksettie(void);
-int	mbnavadjust_naverr_skip(void);
-int	mbnavadjust_naverr_unset(void);
-int	mbnavadjust_crossing_load(void);
-int	mbnavadjust_crossing_unload(void);
-int	mbnavadjust_crossing_replot(void);
-int	mbnavadjust_section_load(int file_id, int section_id, void **swathraw_ptr, void **swath_ptr, int num_pings);
-int	mbnavadjust_section_translate(int file_id, void *swathraw_ptr, void *swath_ptr, double zoffset);
-int	mbnavadjust_section_contour(int fileid, int sectionid,
-				struct swath *swath,
-				struct mbna_contour_vector *contour);
-int	mbnavadjust_naverr_snavpoints(int ix, int iy);
-int	mbnavadjust_sections_intersect(int crossing_id);
-int	mbnavadjust_crossing_overlap(int crossing_id);
-int	mbnavadjust_crossing_overlapbounds(int crossing_id,
-				double offset_x, double offset_y,
-				double *lonmin, double *lonmax,
-				double *latmin, double *latmax);
-int	mbnavadjust_get_misfit(void);
-int	mbnavadjust_get_misfitxy(void);
-void 	plot(double x,double y,int ipen);
-void 	newpen(int ipen);
-void 	justify_string(double height,char *string, double *s);
-void 	plot_string(double x, double y, double hgt, double angle, char *label);
-void	mbnavadjust_naverr_scale(void);
-void	mbnavadjust_naverr_plot(int plotmode);
-int	mbnavadjust_autopick(int do_vertical);
-int	mbnavadjust_autosetsvsvertical(void);
-int	mbnavadjust_zerozoffsets(void);
-int	mbnavadjust_invertnav(void);
-int	mbnavadjust_applynav(void);
-int	mbnavadjust_interpolatesolution(void);
-int	mbnavadjust_modelplot_plot(void);
-int	mbnavadjust_set_modelplot_graphics(void *modp_xgid, int *modp_borders);
-int	mbnavadjust_modelplot_plot_timeseries(void);
-int	mbnavadjust_modelplot_plot_perturbation(void);
-int	mbnavadjust_modelplot_plot_tieoffsets(void);
-int	mbnavadjust_modelplot_pick(int x, int y);
-int	mbnavadjust_modelplot_pick_timeseries(int x, int y);
-int	mbnavadjust_modelplot_pick_perturbation(int x, int y);
-int	mbnavadjust_modelplot_pick_tieoffsets(int x, int y);
-int	mbnavadjust_modelplot_middlepick(int x, int y);
-int	mbnavadjust_modelplot_setzoom(void);
-int	mbnavadjust_modelplot_clearblock(void);
-int	mbnavadjust_crossing_compare(const void *a, const void *b);
-
-void	do_list_data_select( Widget w, XtPointer client_data, XtPointer call_data);
-void	do_naverr_cont_expose( Widget w, XtPointer client_data, XtPointer call_data);
-void	do_naverr_corr_expose( Widget w, XtPointer client_data, XtPointer call_data);
-void	do_naverr_cont_input( Widget w, XtPointer client_data, XtPointer call_data);
-void	do_naverr_corr_input( Widget w, XtPointer client_data, XtPointer call_data);
-void	do_naverr_zcorr_input( Widget w, XtPointer client_data, XtPointer call_data);
-void	do_naverr_previous( Widget w, XtPointer client_data, XtPointer call_data);
-void	do_naverr_next( Widget w, XtPointer client_data, XtPointer call_data);
-void	do_naverr_nextunset( Widget w, XtPointer client_data, XtPointer call_data);
-void	do_naverr_addtie( Widget w, XtPointer client_data, XtPointer call_data);
-void	do_naverr_deletetie( Widget w, XtPointer client_data, XtPointer call_data);
-void	do_naverr_selecttie( Widget w, XtPointer client_data, XtPointer call_data);
-void	do_naverr_settie( Widget w, XtPointer client_data, XtPointer call_data);
-void	do_naverr_resettie( Widget w, XtPointer client_data, XtPointer call_data);
-void	do_naverr_unset( Widget w, XtPointer client_data, XtPointer call_data);
-void	do_naverr_setnone( Widget w, XtPointer client_data, XtPointer call_data);
-void	do_naverr_zerooffset( Widget w, XtPointer client_data, XtPointer call_data);
-void	do_naverr_zerozoffset( Widget w, XtPointer client_data, XtPointer call_data);
-void	do_dismiss_naverr( Widget w, XtPointer client_data, XtPointer call_data);
-void	do_naverr_minmisfit( Widget w, XtPointer client_data, XtPointer call_data);
-void	do_naverr_minxymisfit( Widget w, XtPointer client_data, XtPointer call_data);
-void	do_naverr_misfitcenter( Widget w, XtPointer client_data, XtPointer call_data);
-void	do_file_new( Widget w, XtPointer client_data, XtPointer call_data);
-void	do_file_open( Widget w, XtPointer client_data, XtPointer call_data);
-void	do_file_close( Widget w, XtPointer client_data, XtPointer call_data);
-void	do_file_importdata( Widget w, XtPointer client_data, XtPointer call_data);
-void	do_quit( Widget w, XtPointer client_data, XtPointer call_data);
-void	do_fileselection_mode( Widget w, XtPointer client_data, XtPointer call_data);
-void	do_fileselection_ok( Widget w, XtPointer client_data, XtPointer call_data);
-void	do_fileselection_cancel( Widget w, XtPointer client_data, XtPointer call_data);
-void	do_view_showsurveys( Widget w, XtPointer client_data, XtPointer call_data);
-void	do_view_showdata( Widget w, XtPointer client_data, XtPointer call_data);
-void	do_view_showcrossings( Widget w, XtPointer client_data, XtPointer call_data);
-void	do_view_showmediocrecrossings( Widget w, XtPointer client_data, XtPointer call_data);
-void	do_view_showgoodcrossings( Widget w, XtPointer client_data, XtPointer call_data);
-void	do_view_showtruecrossings( Widget w, XtPointer client_data, XtPointer call_data);
-void	do_view_showties( Widget w, XtPointer client_data, XtPointer call_data);
-void	do_view_showallsurveys( Widget w, XtPointer client_data, XtPointer call_data);
-void	do_view_showselectedsurveys( Widget w, XtPointer client_data, XtPointer call_data);
-void	do_view_showselectedfile( Widget w, XtPointer client_data, XtPointer call_data);
-void	do_view_showselectedsection( Widget w, XtPointer client_data, XtPointer call_data);
-void	do_action_autopick( Widget w, XtPointer client_data, XtPointer call_data);
-void	do_action_autopickhorizontal( Widget w, XtPointer client_data, XtPointer call_data);
-void	do_action_autosetsvsvertical( Widget w, XtPointer client_data, XtPointer call_data);
-void	do_action_analyzecrossings( Widget w, XtPointer client_data, XtPointer call_data);
-void	do_action_checknewcrossings( Widget w, XtPointer client_data, XtPointer call_data);
-void	do_action_invertnav( Widget w, XtPointer client_data, XtPointer call_data);
-void	do_fileselection_list(Widget w, XtPointer client, XtPointer call);
-int	do_wait_until_viewed(XtAppContext app);
-void	set_label_string(Widget w, String str);
-void	set_label_multiline_string(Widget w, String str);
-void	get_text_string(Widget w, String str);
-int	do_info_add(char *info, int timetag);
-void	do_modelplot_resize( Widget w, XtPointer client_data, XEvent *event, Boolean *unused);
-
-void	do_naverr_setoffset( Widget w, XtPointer client_data, XtPointer call_data);
-void	do_naverr_fullsize( Widget w, XtPointer client_data, XtPointer call_data);
-void	do_naverr_applyzoffset( Widget w, XtPointer client_data, XtPointer call_data);
-void	do_biases_apply( Widget w, XtPointer client_data, XtPointer call_data);
-void	do_biases_applyall( Widget w, XtPointer client_data, XtPointer call_data);
-void	do_biases_init( Widget w, XtPointer client_data, XtPointer call_data);
-void	do_biases_toggle( Widget w, XtPointer client_data, XtPointer call_data);
-void	do_biases_heading( Widget w, XtPointer client_data, XtPointer call_data);
-void	do_biases_roll( Widget w, XtPointer client_data, XtPointer call_data);
-void	do_controls_apply( Widget w, XtPointer client_data, XtPointer call_data);
-void	do_scale_controls_sectionlength( Widget w, XtPointer client_data, XtPointer call_data);
-void	do_scale_controls_sectionsoundings( Widget w, XtPointer client_data, XtPointer call_data);
-void	do_scale_controls_decimation( Widget w, XtPointer client_data, XtPointer call_data);
-void	do_scale_contourinterval( Widget w, XtPointer client_data, XtPointer call_data);
-void	do_scale_controls_tickinterval( Widget w, XtPointer client_data, XtPointer call_data);
-void	do_controls_scale_colorinterval( Widget w, XtPointer client_data, XtPointer call_data);
-void	do_scale_controls_smoothing( Widget w, XtPointer client_data, XtPointer call_data);
-void	do_scale_controls_zoffset( Widget w, XtPointer client_data, XtPointer call_data);
-void	do_view_showwithselectedsurveys( Widget w, XtPointer client_data, XtPointer call_data);
-void	do_view_showwithselectedfile( Widget w, XtPointer client_data, XtPointer call_data);
-void	do_view_showsections( Widget w, XtPointer client_data, XtPointer call_data);
-void	do_view_showbettercrossings( Widget w, XtPointer client_data, XtPointer call_data);
-void	do_action_poornav( Widget w, XtPointer client_data, XtPointer call_data);
-void	do_action_goodnav( Widget w, XtPointer client_data, XtPointer call_data);
-void	do_action_fixednav( Widget w, XtPointer client_data, XtPointer call_data);
-void	do_action_fixedxynav( Widget w, XtPointer client_data, XtPointer call_data);
-void	do_action_fixedznav( Widget w, XtPointer client_data, XtPointer call_data);
-void	do_action_tie_xy( Widget w, XtPointer client_data, XtPointer call_data);
-void	do_action_z( Widget w, XtPointer client_data, XtPointer call_data);
-void	do_action_tie_xyz( Widget w, XtPointer client_data, XtPointer call_data);
-void	do_zerozoffsets( Widget w, XtPointer client_data, XtPointer call_data);
-void	do_apply_nav( Widget w, XtPointer client_data, XtPointer call_data);
-void	do_modelplot_show( Widget w, XtPointer client_data, XtPointer call_data);
-void	do_modelplot_dismiss( Widget w, XtPointer client_data, XtPointer call_data);
-void	do_modelplot_fullsize( Widget w, XtPointer client_data, XtPointer call_data);
-void	do_modelplot_input( Widget w, XtPointer client_data, XtPointer call_data);
-void	do_modelplot_expose( Widget w, XtPointer client_data, XtPointer call_data);
-void	do_modelplot_tieoffsets( Widget w, XtPointer client_data, XtPointer call_data);
-void	do_modelplot_perturbation( Widget w, XtPointer client_data, XtPointer call_data);
-void	do_modelplot_timeseries( Widget w, XtPointer client_data, XtPointer call_data);
-void	do_modelplot_clearblock( Widget w, XtPointer client_data, XtPointer call_data);
-void	do_make_grid( Widget w, XtPointer client_data, XtPointer call_data);
-
-void 	BxUnmanageCB(Widget w, XtPointer client, XtPointer call);
-void 	BxManageCB(Widget w, XtPointer client, XtPointer call);
-void 	BxPopupCB(Widget w, XtPointer client, XtPointer call);
-XtPointer BX_CONVERT(Widget w, char *from_string, char *to_type, int to_size, Boolean *success);
-void 	BxExitCB(Widget w, XtPointer client, XtPointer call);
-void 	BxSetValuesCB(Widget w, XtPointer client, XtPointer call);
-
-/*--------------------------------------------------------------------*/
diff --git a/src/mbnavadjust/mbnavadjust.uil b/src/mbnavadjust/mbnavadjust.uil
deleted file mode 100644
index 76519ba..0000000
--- a/src/mbnavadjust/mbnavadjust.uil
+++ /dev/null
@@ -1,4136 +0,0 @@
-/*
- * Generated by the ICS builderXcessory (BX).
- *
- *
- * BuilderXcessory Version 6.1.3.
- *
- * Identification:
- */
-module main_uil
-version = 'V2.1'
-names = case_sensitive
-!(BX) bx_info("c_options", "")
-!(BX) bx_info("c_libs", "-L /usr/X11/lib -lXm -lXt -lX11 -lm")
-!(BX) bx_info("c_cflags", "")
-!(BX) bx_info("c_cc", "cc")
-!(BX) bx_info("c_excludeungenerated", "false")
-!(BX) bx_info("c_target", "mbnavadjust")
-!(BX) bx_info("c_information", "")
-!(BX) bx_info("c_user_main_loop", "", false)
-!(BX) bx_info("c_ignore_shell_geometry", "false")
-!(BX) bx_info("c_visible_windows_only", "false")
-!(BX) bx_info("c_rm_exp_callbacks", "false")
-!(BX) bx_info("c_reverse_dialogs", "true")
-!(BX) bx_info("c_dialogs_in_routine", "true")
-!(BX) bx_info("c_unmanage_dialogs", "true")
-!(BX) bx_info("c_use_locales", "false")
-!(BX) bx_info("c_ansi", "true")
-!(BX) bx_info("c_name", "mbnavadjust")
-!(BX) bx_info("c_class", "mbnavadjust")
-!(BX) bx_info("c_app_defaults", "mbnavadjust_appdefaults", true)
-!(BX) bx_info("c_utilities", "mbnavadjust_util.c", true)
-!(BX) bx_info("c_constants", "mbnavadjust_creation.h", true)
-!(BX) bx_info("c_callbacks", "mbnavadjust_callbacks.c", true)
-!(BX) bx_info("c_creation", "mbnavadjust_creation.c", true)
-!(BX) bx_info("c_main", "mbnavadjust.c", true)
-!(BX) bx_info("c_acinclude_m4", "acinclude.m4", false)
-!(BX) bx_info("c_configure_in", "configure.in", false)
-!(BX) bx_info("c_makefile_am", "Makefile.am", false)
-!(BX) bx_info("c_cvsmake", "CVSMake", false)
-!(BX) bx_info("c_makefile", "Makefile.org", true)
-!(BX) bx_info("c_imakefile", "Imakefile", false)
-!(BX) bx_info("c_dirpath", "")
-!(BX) bx_info("include_path", ".", false)
-!(BX) bx_info("xrunner_command", "$(M_ROOT)/arch/X11.5/Xm1.2/mic_xm.o", false)
-!(BX) bx_info("system_directory", "/opt/bx-6.1")
-!(BX) bx_info("builder_version", "BuilderXcessory Version 6.1.3")
-!(BX) bx_info("build_lang", "C")
-!(BX) bx_info("default_cpp_args", "")
-!(BX) bx_info("new_mrm_style", "true")
-!(BX) bx_info("c_wrap_lines", "false")
-!(BX) bx_info("uil_wrap_lines", "true")
-!(BX) bx_info("integrate_purify", "false")
-!(BX) bx_info("purify_command", "purify")
-!(BX) bx_info("integrate_xrunner", "false")
-
-value
-    MBNA_FILESELECTION_IMPORT :  3;
-    MBNA_FILESELECTION_NEW :  1;
-    MBNA_FILESELECTION_NONE :  0;
-    MBNA_FILESELECTION_OPEN :  2;
-procedure BxGlobalWidgetId;
-identifier BXG_text_messages;
-identifier BXG_scrolledWindow_messages;
-identifier BXG_label_status;
-identifier BXG_label_listdata;
-identifier BXG_list_data;
-identifier BXG_scrolledWindow_datalist;
-identifier BXG_form_mbnavadjust;
-identifier BXG_pushButton_applynav;
-identifier BXG_pushButton_invertnav;
-identifier BXG_pushButton_zerozoffsets;
-identifier BXG_pushButton_analyzecrossings;
-identifier BXG_pushButton_newcrossings;
-identifier BXG_pushButton_autosetsvsvertical;
-identifier BXG_pushButton_autopickhorizontal;
-identifier BXG_pushButton_autopick;
-identifier BXG_pushButton_tie_xyz;
-identifier BXG_pushButton_tie_z;
-identifier BXG_pushButton_tie_xy;
-identifier BXG_pushButton_fixedznav;
-identifier BXG_pushButton_fixedxynav;
-identifier BXG_pushButton_fixednav;
-identifier BXG_pushButton_goodnav;
-identifier BXG_pushButton_poornav;
-identifier BXG_pushButton_showmodelplot;
-identifier BXG_pushButton_makegrid;
-identifier BXG_toggleButton_showselectedsection;
-identifier BXG_toggleButton_showwithselectedfile;
-identifier BXG_toggleButton_showwithselectedsurvey;
-identifier BXG_toggleButton_showselectedfile;
-identifier BXG_toggleButton_showselectedsurvey;
-identifier BXG_toggleButton_showallsurveys;
-identifier BXG_pushButton_showties;
-identifier BXG_pushButton_showtruecrossings;
-identifier BXG_pushButton_showbettercrossings;
-identifier BXG_pushButton_showgoodcrossings;
-identifier BXG_pushButton_showmediocrecrossings;
-identifier BXG_pushButton_showcrossings;
-identifier BXG_pushButton_showsections;
-identifier BXG_pushButton_showdata;
-identifier BXG_pushButton_showsurveys;
-identifier BXG_pushButton_quit;
-identifier BXG_pushButton_importdata;
-identifier BXG_pushButton_close;
-identifier BXG_pushButton_open;
-identifier BXG_pushButton_new;
-identifier BXG_label_message;
-identifier BXG_bulletinBoard_message;
-identifier BXG_label_error_two;
-identifier BXG_label_error_one;
-identifier BXG_label_error_three;
-identifier BXG_bulletinBoard_error;
-identifier BXG_textField_format;
-identifier BXG_label_format;
-identifier BXG_fileSelectionBox;
-identifier BXG_bulletinBoard_fileselection;
-identifier BXG_xmDialogShell_fileselection;
-identifier BXG_pushButton_naverr_unset;
-identifier BXG_pushButton_naverr_minxymisfit;
-identifier BXG_drawingArea_naverr_zcorr;
-identifier BXG_pushButton_naverr_zerozoffset;
-identifier BXG_pushButton_naverr_settie;
-identifier BXG_toggleButton_misfitcenter_auto;
-identifier BXG_toggleButton_misfitcenter_zero;
-identifier BXG_pushButton_naverr_resettie;
-identifier BXG_pushButton_naverr_addtie;
-identifier BXG_pushButton_naverr_deletetie;
-identifier BXG_pushButton_naverr_fullsize;
-identifier BXG_pushButton_naverr_zerooffset;
-identifier BXG_label_naverr_offsets;
-identifier BXG_pushButton_naverr_nextunset;
-identifier BXG_label_naverr_status;
-identifier BXG_drawingArea_naverr_cont;
-identifier BXG_drawingArea_naverr_corr;
-identifier BXG_pushButton_naverr_dismiss;
-identifier BXG_pushButton_naverr_selecttie;
-identifier BXG_pushButton_naverr_minimum;
-identifier BXG_pushButton_naverr_next;
-identifier BXG_pushButton_naverr_previous;
-identifier BXG_pushButton_naverr_setnone;
-identifier BXG_bulletinBoard_naverr;
-identifier BXG_pushButton_biases_applyall;
-identifier BXG_scale_biases_heading2;
-identifier BXG_scale_biases_roll2;
-identifier BXG_scale_biases_roll1;
-identifier BXG_scale_biases_heading1;
-identifier BXG_label_biases_files;
-identifier BXG_toggleButton_biases_separate;
-identifier BXG_toggleButton_biases_together;
-identifier BXG_label_about_version;
-identifier BXG_scale_controls_zoffset;
-identifier BXG_scale_controls_smoothing;
-identifier BXG_scale_controls_sectionlength;
-identifier BXG_scale_controls_tickinterval;
-identifier BXG_scale_controls_colorinterval;
-identifier BXG_scale_controls_contourinterval;
-identifier BXG_scale_controls_decimation;
-identifier BXG_scale_controls_sectionsoundings;
-identifier BXG_pushButton_modelplot_clearblock;
-identifier BXG_toggleButton_modelplot_block;
-identifier BXG_toggleButton_modelplot_sequential;
-identifier BXG_radioBox;
-identifier BXG_label_modelplot_status;
-identifier BXG_drawingArea_modelplot;
-identifier BXG_bulletinBoard_modelplot;
-procedure BxExitCB(integer);
-procedure BxManageCB(string);
-procedure BxSetValuesCB(string);
-procedure BxUnmanageCB(string);
-procedure do_action_analyzecrossings();
-procedure do_action_autopick();
-procedure do_action_autopickhorizontal();
-procedure do_action_autosetsvsvertical();
-procedure do_action_checknewcrossings();
-procedure do_action_fixednav();
-procedure do_action_fixedxynav();
-procedure do_action_fixedznav();
-procedure do_action_goodnav();
-procedure do_action_invertnav();
-procedure do_action_poornav();
-procedure do_action_tie_xy();
-procedure do_action_tie_xyz();
-procedure do_action_z();
-procedure do_apply_nav();
-procedure do_biases_apply();
-procedure do_biases_applyall();
-procedure do_biases_heading();
-procedure do_biases_init();
-procedure do_biases_roll();
-procedure do_biases_toggle();
-procedure do_controls_apply();
-procedure do_controls_scale_colorinterval();
-procedure do_dismiss_naverr();
-procedure do_file_close();
-procedure do_fileselection_mode(integer);
-procedure do_fileselection_ok();
-procedure do_list_data_select();
-procedure do_make_grid();
-procedure do_modelplot_block();
-procedure do_modelplot_clearblock();
-procedure do_modelplot_dismiss();
-procedure do_modelplot_expose();
-procedure do_modelplot_fullsize();
-procedure do_modelplot_input();
-procedure do_modelplot_sequential();
-procedure do_modelplot_show();
-procedure do_naverr_addtie();
-procedure do_naverr_cont_expose();
-procedure do_naverr_cont_input();
-procedure do_naverr_corr_expose();
-procedure do_naverr_corr_input();
-procedure do_naverr_deletetie();
-procedure do_naverr_fullsize();
-procedure do_naverr_init();
-procedure do_naverr_minmisfit();
-procedure do_naverr_minxymisfit();
-procedure do_naverr_misfitcenter();
-procedure do_naverr_next();
-procedure do_naverr_nextunset();
-procedure do_naverr_previous();
-procedure do_naverr_resettie();
-procedure do_naverr_selecttie();
-procedure do_naverr_setnone();
-procedure do_naverr_setoffset();
-procedure do_naverr_unset();
-procedure do_naverr_zcorr_input();
-procedure do_naverr_zerooffset();
-procedure do_naverr_zerozoffset();
-procedure do_quit();
-procedure do_scale_contourinterval();
-procedure do_scale_controls_decimation();
-procedure do_scale_controls_sectionlength();
-procedure do_scale_controls_sectionsoundings();
-procedure do_scale_controls_smoothing();
-procedure do_scale_controls_tickinterval();
-procedure do_scale_controls_zoffset();
-procedure do_view_showallsurveys();
-procedure do_view_showbettercrossings();
-procedure do_view_showcrossings();
-procedure do_view_showdata();
-procedure do_view_showmediocrecrossings();
-procedure do_view_showgoodcrossings();
-procedure do_view_showsections();
-procedure do_view_showselectedfile();
-procedure do_view_showselectedsection();
-procedure do_view_showselectedsurveys();
-procedure do_view_showsurveys();
-procedure do_view_showties();
-procedure do_view_showtruecrossings();
-procedure do_view_showwithselectedfile();
-procedure do_view_showwithselectedsurveys();
-procedure do_zerozoffsets();
-
-list BaseStyle : arguments {
-};
-
-list BaseStyleReasons : callbacks {
-};
-
-!(BX)list BaseStyleHandlers : handlers {
-!(BX)};
-
-list Style_use : arguments {
-        arguments BaseStyle;
-        XmNfontList = font_table(
-		font('-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1'));
-};
-
-list Style_useReasons : callbacks {
-        callbacks BaseStyleReasons;
-};
-
-!(BX)list Style_useHandlers : handlers {
-!(BX)    handlers BaseStyleHandlers;
-!(BX)};
-
-list Style_use2 : arguments {
-        arguments BaseStyle;
-        XmNfontList = font_table(
-		font('-*-helvetica-bold-r-*-*-*-120-75-75-*-*-iso8859-1'));
-};
-
-list Style_use2Reasons : callbacks {
-        callbacks BaseStyleReasons;
-};
-
-!(BX)list Style_use2Handlers : handlers {
-!(BX)    handlers BaseStyleHandlers;
-!(BX)};
-
-
-object pushButton_modelplot_dismiss : XmPushButton widget {
-    arguments {
-        arguments Style_use2;
-        XmNlabelString = compound_string("Dismiss");
-        XmNx = 10;
-        XmNy = 10;
-        XmNwidth = 60;
-        XmNheight = 32;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-       XmNactivateCallback = procedures {
-                 BxUnmanageCB("bulletinBoard_modelplot");
-                 do_modelplot_dismiss();
-        };
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object drawingArea_modelplot : XmDrawingArea widget {
-    arguments {
-        arguments Style_use2;
-        XmNborderWidth = 1;
-        XmNbackground = color('white');
-        XmNx = 10;
-        XmNy = 50;
-        XmNwidth = 990;
-        XmNheight = 420;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_drawingArea_modelplot);
-        XmNinputCallback = procedure do_modelplot_input();
-        XmNexposeCallback = procedure do_modelplot_expose();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object label_modelplot_status : XmLabel widget {
-    arguments {
-        arguments Style_use2;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNlabelString = compound_string("Mouse: <left> select  tie; <midd" &
- "le> select untied crossing; <right> drag zoom extent", separate=true) &
- compound_string("Selection: No selection");
-        XmNrecomputeSize = false;
-        XmNx = 450;
-        XmNy = 10;
-        XmNwidth = 550;
-        XmNheight = 40;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_label_modelplot_status);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object pushButton_modelplot_fullsize : XmPushButton widget {
-    arguments {
-        arguments Style_use2;
-        XmNlabelString = compound_string("Full Size");
-        XmNx = 270;
-        XmNy = 10;
-        XmNwidth = 80;
-        XmNheight = 32;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-        XmNactivateCallback = procedure do_modelplot_fullsize();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object toggleButton_modelplot_sequential : XmToggleButton widget {
-    arguments {
-        arguments Style_use2;
-        XmNlabelString = compound_string("Sequential");
-        XmNwidth = 88;
-        XmNheight = 26;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_toggleButton_modelplot_sequential);
-        XmNvalueChangedCallback = procedure do_modelplot_sequential();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object toggleButton_modelplot_block : XmToggleButton widget {
-    arguments {
-        arguments Style_use2;
-        XmNlabelString = compound_string("Block");
-        XmNwidth = 88;
-        XmNheight = 26;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_toggleButton_modelplot_block);
-        XmNvalueChangedCallback = procedure do_modelplot_block();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object radioBox : XmRadioBox widget {
-    arguments {
-        arguments Style_use2;
-        XmNorientation = XmHORIZONTAL;
-        XmNx = 80;
-        XmNy = 10;
-        XmNwidth = 185;
-        XmNheight = 32;
-    };
-    controls {
-         managed XmToggleButton toggleButton_modelplot_sequential;
-         managed XmToggleButton toggleButton_modelplot_block;
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_radioBox);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object pushButton_modelplot_clearblock : XmPushButton widget {
-    arguments {
-        arguments Style_use2;
-        XmNlabelString = compound_string("Clear Block");
-        XmNx = 360;
-        XmNy = 10;
-        XmNwidth = 80;
-        XmNheight = 32;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_pushButton_modelplot_clearblock);
-        XmNactivateCallback = procedure do_modelplot_clearblock();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object bulletinBoard_modelplot : XmBulletinBoardDialog widget {
-    arguments {
-        arguments Style_use2;
-        XmNautoUnmanage = false;
-        XmNresizePolicy = XmRESIZE_GROW;
-        XmNx = 757;
-        XmNy = 995;
-        XmNwidth = 1021;
-        XmNheight = 483;
-    };
-    controls {
-         managed XmPushButton pushButton_modelplot_clearblock;
-         managed XmRadioBox radioBox;
-         managed XmPushButton pushButton_modelplot_fullsize;
-         managed XmLabel label_modelplot_status;
-         managed XmDrawingArea drawingArea_modelplot;
-         managed XmPushButton pushButton_modelplot_dismiss;
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_bulletinBoard_modelplot);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-!(BX)object dialogShell_modelplot : XmDialogShell widget {
-!(BX)    arguments {
-!(BX)        arguments Style_use2;
-!(BX)        XmNtitle = "Navigation Adjustment Model Plot" &
-!(BX) "";
-!(BX)        XmNallowShellResize = true;
-!(BX)        XmNwidth = 1021;
-!(BX)        XmNheight = 483;
-!(BX)    };
-!(BX)    controls {
-!(BX)         managed XmBulletinBoardDialog bulletinBoard_modelplot;
-!(BX)    };
-!(BX)    callbacks {
-!(BX)        callbacks Style_use2Reasons;
-!(BX)    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-!(BX)};
-
-object pushButton_controls_dismiss : XmPushButton widget {
-    arguments {
-        arguments Style_use2;
-        XmNlabelString = compound_string("Dismiss");
-        XmNtopAttachment = XmATTACH_NONE;
-        XmNrightAttachment = XmATTACH_FORM;
-        XmNleftAttachment = XmATTACH_WIDGET;
-        XmNbottomAttachment = XmATTACH_FORM;
-        XmNbottomOffset = 19;
-        XmNleftOffset = 30;
-        XmNrightOffset = 227;
-        XmNleftWidget = XmPushButton pushButton_controls_apply;
-        XmNx = 300;
-        XmNy = 389;
-        XmNwidth = 108;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-        XmNactivateCallback = procedure BxUnmanageCB("form_controls");
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object scale_controls_sectionsoundings : XmScale widget {
-    arguments {
-        arguments Style_use2;
-        XmNminimum = 1000;
-        XmNdecimalPoints = 0;
-        XmNvalue = 10000;
-        XmNmaximum = 100000;
-        XmNshowArrows = TRUE;
-        XmNscaleMultiple = 499;
-        XmNshowValue = TRUE;
-        XmNorientation = XmHORIZONTAL;
-        XmNtopAttachment = XmATTACH_WIDGET;
-        XmNrightAttachment = XmATTACH_FORM;
-        XmNleftAttachment = XmATTACH_WIDGET;
-        XmNbottomAttachment = XmATTACH_POSITION;
-        XmNbottomPosition = 19;
-        XmNleftOffset = 0;
-        XmNrightOffset = 6;
-        XmNtopOffset = 4;
-        XmNleftWidget = XmLabel label_controls_sectionsoundings;
-        XmNtopWidget = XmScale scale_controls_sectionlength;
-        XmNx = 190;
-        XmNy = 40;
-        XmNwidth = 439;
-        XmNheight = 43;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_scale_controls_sectionsoundings);
-        XmNvalueChangedCallback = procedure do_scale_controls_sectionsoundings();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object label_controls_sectionsoundings : XmLabel widget {
-    arguments {
-        arguments Style_use2;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNlabelString = compound_string("Max # Soundings in Section:");
-        XmNleftAttachment = XmATTACH_FORM;
-        XmNleftOffset = 10;
-        XmNtopOffset = 60;
-        XmNx = 10;
-        XmNy = 60;
-        XmNwidth = 180;
-        XmNheight = 20;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object label_controls_decimation : XmLabel widget {
-    arguments {
-        arguments Style_use2;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNlabelString = compound_string("Decimation:");
-        XmNleftAttachment = XmATTACH_FORM;
-        XmNleftOffset = 10;
-        XmNtopOffset = 120;
-        XmNx = 10;
-        XmNy = 120;
-        XmNwidth = 120;
-        XmNheight = 20;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object scale_controls_decimation : XmScale widget {
-    arguments {
-        arguments Style_use2;
-        XmNminimum = 1;
-        XmNvalue = 1;
-        XmNmaximum = 10;
-        XmNshowArrows = TRUE;
-        XmNshowValue = TRUE;
-        XmNorientation = XmHORIZONTAL;
-        XmNtopAttachment = XmATTACH_WIDGET;
-        XmNrightAttachment = XmATTACH_FORM;
-        XmNleftAttachment = XmATTACH_FORM;
-        XmNbottomAttachment = XmATTACH_NONE;
-        XmNbottomOffset = 0;
-        XmNleftOffset = 140;
-        XmNrightOffset = 6;
-        XmNtopOffset = -4;
-        XmNtopWidget = XmSeparator separator4;
-        XmNx = 140;
-        XmNy = 104;
-        XmNwidth = 489;
-        XmNheight = 36;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_scale_controls_decimation);
-        XmNvalueChangedCallback = procedure do_scale_controls_decimation();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object separator5 : XmSeparator widget {
-    arguments {
-        XmNtopAttachment = XmATTACH_WIDGET;
-        XmNrightAttachment = XmATTACH_FORM;
-        XmNleftAttachment = XmATTACH_FORM;
-        XmNbottomAttachment = XmATTACH_NONE;
-        XmNbottomOffset = 0;
-        XmNleftOffset = 10;
-        XmNrightOffset = 7;
-        XmNtopOffset = 4;
-        XmNtopWidget = XmScale scale_controls_tickinterval;
-        XmNx = 10;
-        XmNy = 264;
-        XmNwidth = 618;
-        XmNheight = 20;
-    };
-    controls {
-    };
-    callbacks {
-    };
-};
-
-object separator4 : XmSeparator widget {
-    arguments {
-        XmNtopAttachment = XmATTACH_WIDGET;
-        XmNrightAttachment = XmATTACH_FORM;
-        XmNleftAttachment = XmATTACH_POSITION;
-        XmNbottomAttachment = XmATTACH_NONE;
-        XmNleftPosition = 2;
-        XmNrightOffset = 6;
-        XmNtopOffset = 5;
-        XmNtopWidget = XmScale scale_controls_sectionsoundings;
-        XmNx = 13;
-        XmNy = 88;
-        XmNwidth = 616;
-        XmNheight = 20;
-    };
-    controls {
-    };
-    callbacks {
-    };
-};
-
-object pushButton_controls_apply : XmPushButton widget {
-    arguments {
-        arguments Style_use2;
-        XmNlabelString = compound_string("Apply");
-        XmNtopAttachment = XmATTACH_NONE;
-        XmNleftAttachment = XmATTACH_FORM;
-        XmNbottomAttachment = XmATTACH_FORM;
-        XmNbottomOffset = 19;
-        XmNleftOffset = 200;
-        XmNx = 200;
-        XmNy = 389;
-        XmNwidth = 70;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-        XmNactivateCallback = procedure do_controls_apply();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object label_controls_tickinterval : XmLabel widget {
-    arguments {
-        arguments Style_use2;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNlabelString = compound_string("Tick Interval (m):");
-        XmNleftAttachment = XmATTACH_FORM;
-        XmNleftOffset = 10;
-        XmNtopOffset = 240;
-        XmNx = 10;
-        XmNy = 240;
-        XmNwidth = 120;
-        XmNheight = 20;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object label_controls_colorinterval : XmLabel widget {
-    arguments {
-        arguments Style_use2;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNlabelString = compound_string("Color Interval (m):");
-        XmNleftAttachment = XmATTACH_FORM;
-        XmNleftOffset = 10;
-        XmNtopOffset = 200;
-        XmNx = 10;
-        XmNy = 200;
-        XmNwidth = 130;
-        XmNheight = 20;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object label_controls_contourinterval : XmLabel widget {
-    arguments {
-        arguments Style_use2;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNlabelString = compound_string("Contour Interval (m):");
-        XmNleftAttachment = XmATTACH_FORM;
-        XmNleftOffset = 10;
-        XmNtopOffset = 160;
-        XmNx = 10;
-        XmNy = 160;
-        XmNwidth = 140;
-        XmNheight = 20;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object scale_controls_contourinterval : XmScale widget {
-    arguments {
-        arguments Style_use2;
-        XmNminimum = 1;
-        XmNdecimalPoints = 2;
-        XmNvalue = 2500;
-        XmNmaximum = 40000;
-        XmNshowArrows = TRUE;
-        XmNshowValue = TRUE;
-        XmNorientation = XmHORIZONTAL;
-        XmNtopAttachment = XmATTACH_WIDGET;
-        XmNrightAttachment = XmATTACH_FORM;
-        XmNleftAttachment = XmATTACH_FORM;
-        XmNbottomAttachment = XmATTACH_NONE;
-        XmNbottomOffset = 0;
-        XmNleftOffset = 140;
-        XmNrightOffset = 6;
-        XmNtopOffset = 4;
-        XmNtopWidget = XmScale scale_controls_decimation;
-        XmNx = 140;
-        XmNy = 144;
-        XmNwidth = 489;
-        XmNheight = 36;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_scale_controls_contourinterval);
-        XmNvalueChangedCallback = procedure do_scale_contourinterval();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object scale_controls_colorinterval : XmScale widget {
-    arguments {
-        arguments Style_use2;
-        XmNminimum = 1;
-        XmNdecimalPoints = 2;
-        XmNvalue = 10000;
-        XmNmaximum = 40000;
-        XmNshowArrows = TRUE;
-        XmNshowValue = TRUE;
-        XmNorientation = XmHORIZONTAL;
-        XmNtopAttachment = XmATTACH_WIDGET;
-        XmNrightAttachment = XmATTACH_FORM;
-        XmNleftAttachment = XmATTACH_FORM;
-        XmNbottomAttachment = XmATTACH_NONE;
-        XmNbottomOffset = 0;
-        XmNleftOffset = 140;
-        XmNrightOffset = 6;
-        XmNtopOffset = 4;
-        XmNtopWidget = XmScale scale_controls_contourinterval;
-        XmNx = 140;
-        XmNy = 184;
-        XmNwidth = 489;
-        XmNheight = 36;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_scale_controls_colorinterval);
-        XmNvalueChangedCallback = procedure do_controls_scale_colorinterval();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object scale_controls_tickinterval : XmScale widget {
-    arguments {
-        arguments Style_use2;
-        XmNminimum = 1;
-        XmNdecimalPoints = 2;
-        XmNvalue = 10000;
-        XmNmaximum = 40000;
-        XmNshowArrows = TRUE;
-        XmNshowValue = TRUE;
-        XmNorientation = XmHORIZONTAL;
-        XmNtopAttachment = XmATTACH_WIDGET;
-        XmNrightAttachment = XmATTACH_FORM;
-        XmNleftAttachment = XmATTACH_FORM;
-        XmNbottomAttachment = XmATTACH_NONE;
-        XmNbottomOffset = 0;
-        XmNleftOffset = 140;
-        XmNrightOffset = 6;
-        XmNtopOffset = 4;
-        XmNtopWidget = XmScale scale_controls_colorinterval;
-        XmNx = 140;
-        XmNy = 224;
-        XmNwidth = 489;
-        XmNheight = 36;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_scale_controls_tickinterval);
-        XmNvalueChangedCallback = procedure do_scale_controls_tickinterval();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object scale_controls_sectionlength : XmScale widget {
-    arguments {
-        arguments Style_use2;
-        XmNminimum = 1;
-        XmNdecimalPoints = 2;
-        XmNvalue = 2000;
-        XmNmaximum = 5000;
-        XmNshowArrows = TRUE;
-        XmNshowValue = TRUE;
-        XmNorientation = XmHORIZONTAL;
-        XmNrightAttachment = XmATTACH_FORM;
-        XmNleftAttachment = XmATTACH_WIDGET;
-        XmNleftOffset = 20;
-        XmNrightOffset = 7;
-        XmNtopOffset = 0;
-        XmNleftWidget = XmLabel label_controls_sectionlength;
-        XmNx = 190;
-        XmNy = 0;
-        XmNwidth = 438;
-        XmNheight = 36;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_scale_controls_sectionlength);
-        XmNvalueChangedCallback = procedure do_scale_controls_sectionlength();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object label_controls_sectionlength : XmLabel widget {
-    arguments {
-        arguments Style_use2;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNlabelString = compound_string("Max Section Length (km):");
-        XmNtopAttachment = XmATTACH_FORM;
-        XmNleftAttachment = XmATTACH_FORM;
-        XmNbottomAttachment = XmATTACH_NONE;
-        XmNleftOffset = 10;
-        XmNtopOffset = 20;
-        XmNx = 10;
-        XmNy = 20;
-        XmNwidth = 160;
-        XmNheight = 20;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object separator12 : XmSeparator widget {
-    arguments {
-        XmNrightAttachment = XmATTACH_FORM;
-        XmNleftAttachment = XmATTACH_FORM;
-        XmNleftOffset = 10;
-        XmNrightOffset = 12;
-        XmNtopOffset = 310;
-        XmNx = 10;
-        XmNy = 310;
-        XmNwidth = 613;
-        XmNheight = 20;
-    };
-    controls {
-    };
-    callbacks {
-    };
-};
-
-object scale_controls_smoothing : XmScale widget {
-    arguments {
-        arguments Style_use2;
-        XmNminimum = 1;
-        XmNdecimalPoints = 2;
-        XmNvalue = 10;
-        XmNmaximum = 5000;
-        XmNshowArrows = TRUE;
-        XmNshowValue = TRUE;
-        XmNorientation = XmHORIZONTAL;
-        XmNrightAttachment = XmATTACH_FORM;
-        XmNleftAttachment = XmATTACH_FORM;
-        XmNleftOffset = 140;
-        XmNrightOffset = 7;
-        XmNtopOffset = 270;
-        XmNx = 140;
-        XmNy = 270;
-        XmNwidth = 488;
-        XmNheight = 36;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_scale_controls_smoothing);
-        XmNvalueChangedCallback = procedure do_scale_controls_smoothing();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object label_controls_smoothing : XmLabel widget {
-    arguments {
-        arguments Style_use2;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNlabelString = compound_string("Inversion", separate=true) &
- compound_string("Smoothing (m):");
-        XmNleftAttachment = XmATTACH_FORM;
-        XmNleftOffset = 10;
-        XmNtopOffset = 270;
-        XmNx = 10;
-        XmNy = 270;
-        XmNwidth = 120;
-        XmNheight = 40;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object label_controls_zoffset : XmLabel widget {
-    arguments {
-        arguments Style_use2;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNlabelString = compound_string("Z Offset Width (m):");
-        XmNleftAttachment = XmATTACH_FORM;
-        XmNleftOffset = 10;
-        XmNtopOffset = 340;
-        XmNx = 10;
-        XmNy = 340;
-        XmNwidth = 120;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object scale_controls_zoffset : XmScale widget {
-    arguments {
-        arguments Style_use2;
-        XmNminimum = 1;
-        XmNdecimalPoints = 0;
-        XmNvalue = 10;
-        XmNmaximum = 20;
-        XmNshowArrows = TRUE;
-        XmNshowValue = TRUE;
-        XmNorientation = XmHORIZONTAL;
-        XmNleftAttachment = XmATTACH_FORM;
-        XmNleftOffset = 140;
-        XmNtopOffset = 330;
-        XmNx = 140;
-        XmNy = 330;
-        XmNwidth = 480;
-        XmNheight = 36;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_scale_controls_zoffset);
-        XmNvalueChangedCallback = procedure do_scale_controls_zoffset();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object separator14 : XmSeparator widget {
-    arguments {
-        XmNleftAttachment = XmATTACH_FORM;
-        XmNleftOffset = 10;
-        XmNtopOffset = 370;
-        XmNx = 10;
-        XmNy = 370;
-        XmNwidth = 613;
-        XmNheight = 20;
-    };
-    controls {
-    };
-    callbacks {
-    };
-};
-
-object form_controls : XmFormDialog widget {
-    arguments {
-        arguments Style_use2;
-        XmNresizePolicy = XmRESIZE_GROW;
-        XmNx = 0;
-        XmNy = 1118;
-        XmNwidth = 635;
-        XmNheight = 438;
-    };
-    controls {
-         managed XmSeparator separator14;
-         managed XmScale scale_controls_zoffset;
-         managed XmLabel label_controls_zoffset;
-         managed XmLabel label_controls_smoothing;
-         managed XmScale scale_controls_smoothing;
-         managed XmSeparator separator12;
-         managed XmLabel label_controls_sectionlength;
-         managed XmScale scale_controls_sectionlength;
-         managed XmScale scale_controls_tickinterval;
-         managed XmScale scale_controls_colorinterval;
-         managed XmScale scale_controls_contourinterval;
-         managed XmLabel label_controls_contourinterval;
-         managed XmLabel label_controls_colorinterval;
-         managed XmLabel label_controls_tickinterval;
-         managed XmPushButton pushButton_controls_apply;
-         managed XmSeparator separator4;
-         managed XmSeparator separator5;
-         managed XmScale scale_controls_decimation;
-         managed XmLabel label_controls_decimation;
-         managed XmLabel label_controls_sectionsoundings;
-         managed XmScale scale_controls_sectionsoundings;
-         managed XmPushButton pushButton_controls_dismiss;
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-!(BX)object dialogShell_controls : XmDialogShell widget {
-!(BX)    arguments {
-!(BX)        arguments Style_use2;
-!(BX)        XmNtitle = "Controls";
-!(BX)        XmNwidth = 635;
-!(BX)        XmNheight = 438;
-!(BX)    };
-!(BX)    controls {
-!(BX)         managed XmFormDialog form_controls;
-!(BX)    };
-!(BX)    callbacks {
-!(BX)        callbacks Style_use2Reasons;
-!(BX)    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-!(BX)};
-
-object label_about_mbedit : XmLabel widget {
-    arguments {
-        XmNfontList = font_table(
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1'));
-        XmNlabelString = compound_string("MBnavadjust");
-        XmNrightAttachment = XmATTACH_FORM;
-        XmNleftAttachment = XmATTACH_FORM;
-        XmNleftOffset = 0;
-        XmNrightOffset = 9;
-        XmNtopOffset = 0;
-        XmNx = 0;
-        XmNy = 0;
-        XmNwidth = 479;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-    };
-};
-
-object label_about_function : XmLabel widget {
-    arguments {
-        XmNfontList = font_table(
-		font('-*-times-bold-r-*-*-*-180-*-*-*-*-iso8859-1'));
-        XmNlabelString = compound_string("Interactive Navigation Adjustmen" &
- "t of Swath Bathymetry");
-        XmNrightAttachment = XmATTACH_FORM;
-        XmNleftAttachment = XmATTACH_FORM;
-        XmNleftOffset = 0;
-        XmNrightOffset = 9;
-        XmNtopOffset = 30;
-        XmNx = 0;
-        XmNy = 30;
-        XmNwidth = 479;
-        XmNheight = 20;
-    };
-    controls {
-    };
-    callbacks {
-    };
-};
-
-object label_about_version : XmLabel widget {
-    arguments {
-        XmNfontList = font_table(
-		font('-*-times-medium-r-*-*-*-140-*-*-*-*-iso8859-1'));
-        XmNlabelString = compound_string("MB-System Release 4.6", separate=true) &
- compound_string("April 14, 1999");
-        XmNrecomputeSize = false;
-        XmNrightAttachment = XmATTACH_FORM;
-        XmNleftAttachment = XmATTACH_FORM;
-        XmNleftOffset = 0;
-        XmNrightOffset = 9;
-        XmNx = 0;
-        XmNy = 350;
-        XmNwidth = 479;
-        XmNheight = 60;
-    };
-    controls {
-    };
-    callbacks {
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_label_about_version);
-    };
-};
-
-object separator : XmSeparator widget {
-    arguments {
-        XmNrightAttachment = XmATTACH_FORM;
-        XmNleftAttachment = XmATTACH_FORM;
-        XmNleftOffset = 10;
-        XmNrightOffset = 8;
-        XmNtopOffset = 60;
-        XmNx = 10;
-        XmNy = 60;
-        XmNwidth = 470;
-        XmNheight = 20;
-    };
-    controls {
-    };
-    callbacks {
-    };
-};
-
-object label_about_for : XmLabel widget {
-    arguments {
-        XmNfontList = font_table(
-		font('-*-times-bold-r-*-*-*-140-*-*-*-*-iso8859-1'));
-        XmNlabelString = compound_string("for Processing and Display of Sw" &
- "ath Sonar Data");
-        XmNrightAttachment = XmATTACH_FORM;
-        XmNleftAttachment = XmATTACH_FORM;
-        XmNleftOffset = 0;
-        XmNrightOffset = 9;
-        XmNx = 0;
-        XmNy = 180;
-        XmNwidth = 479;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-    };
-};
-
-object label_about_component : XmLabel widget {
-    arguments {
-        XmNfontList = font_table(
-		font('-*-times-bold-r-*-*-*-140-*-*-*-*-iso8859-1'));
-        XmNlabelString = compound_string("One Component of the");
-        XmNrightAttachment = XmATTACH_FORM;
-        XmNleftAttachment = XmATTACH_FORM;
-        XmNleftOffset = 0;
-        XmNrightOffset = 9;
-        XmNx = 0;
-        XmNy = 80;
-        XmNwidth = 479;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-    };
-};
-
-object label_about_mbpub : XmLabel widget {
-    arguments {
-        XmNfontList = font_table(
-		font('-*-times-bold-r-*-*-*-140-*-*-*-*-iso8859-1'));
-        XmNlabelString = compound_string("An Open Source Software Package");
-        XmNrightAttachment = XmATTACH_FORM;
-        XmNleftAttachment = XmATTACH_FORM;
-        XmNleftOffset = 0;
-        XmNrightOffset = 9;
-        XmNx = 0;
-        XmNy = 150;
-        XmNwidth = 479;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-    };
-};
-
-object label_about_mbsystem : XmLabel widget {
-    arguments {
-        XmNfontList = font_table(
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1'));
-        XmNlabelString = compound_string("MB-System");
-        XmNrightAttachment = XmATTACH_FORM;
-        XmNleftAttachment = XmATTACH_FORM;
-        XmNleftOffset = 0;
-        XmNrightOffset = 9;
-        XmNx = 0;
-        XmNy = 110;
-        XmNwidth = 479;
-        XmNheight = 38;
-    };
-    controls {
-    };
-    callbacks {
-    };
-};
-
-object label_about_columbia : XmLabel widget {
-    arguments {
-        XmNfontList = font_table(
-		font('-*-times-bold-r-*-*-*-120-*-*-*-*-iso8859-1'));
-        XmNlabelString = compound_string("Monterey Bay", separate=true) &
- compound_string("Aquarium", separate=true) &
- compound_string("Research Institute");
-        XmNrightAttachment = XmATTACH_FORM;
-        XmNleftAttachment = XmATTACH_FORM;
-        XmNleftOffset = 110;
-        XmNrightOffset = 268;
-        XmNtopOffset = 280;
-        XmNx = 110;
-        XmNy = 280;
-        XmNwidth = 110;
-        XmNheight = 70;
-    };
-    controls {
-    };
-    callbacks {
-    };
-};
-
-object label_about_lamont : XmLabel widget {
-    arguments {
-        XmNfontList = font_table(
-		font('-*-times-bold-r-*-*-*-120-*-*-*-*-iso8859-1'));
-        XmNlabelString = compound_string("Lamont-Doherty ", separate=true) &
- compound_string("Earth Observatory", separate=true) &
- compound_string("of Columbia University");
-        XmNrightAttachment = XmATTACH_FORM;
-        XmNleftAttachment = XmATTACH_FORM;
-        XmNleftOffset = 270;
-        XmNrightOffset = 118;
-        XmNtopOffset = 280;
-        XmNx = 270;
-        XmNy = 280;
-        XmNwidth = 100;
-        XmNheight = 70;
-    };
-    controls {
-    };
-    callbacks {
-    };
-};
-
-object label_about_create : XmLabel widget {
-    arguments {
-        XmNfontList = font_table(
-		font('-*-times-bold-r-*-*-*-140-*-*-*-*-iso8859-1'));
-        XmNlabelString = compound_string("Created by:");
-        XmNrightAttachment = XmATTACH_FORM;
-        XmNleftAttachment = XmATTACH_FORM;
-        XmNleftOffset = 0;
-        XmNrightOffset = 9;
-        XmNx = 0;
-        XmNy = 230;
-        XmNwidth = 479;
-        XmNheight = 20;
-    };
-    controls {
-    };
-    callbacks {
-    };
-};
-
-object pushButton_about_dismiss : XmPushButton widget {
-    arguments {
-        XmNfontList = font_table(
-		font('-*-times-bold-r-*-*-*-140-*-*-*-*-iso8859-1'));
-        XmNlabelString = compound_string("Dismiss");
-        XmNtopAttachment = XmATTACH_FORM;
-        XmNrightAttachment = XmATTACH_FORM;
-        XmNleftAttachment = XmATTACH_FORM;
-        XmNbottomAttachment = XmATTACH_NONE;
-        XmNleftOffset = 170;
-        XmNrightOffset = 178;
-        XmNtopOffset = 410;
-        XmNx = 170;
-        XmNy = 410;
-        XmNwidth = 140;
-        XmNheight = 35;
-    };
-    controls {
-    };
-    callbacks {
-        XmNactivateCallback = procedure BxUnmanageCB("form_about");
-    };
-};
-
-object separator1 : XmSeparator widget {
-    arguments {
-        XmNrightAttachment = XmATTACH_FORM;
-        XmNleftAttachment = XmATTACH_POSITION;
-        XmNleftPosition = 2;
-        XmNrightOffset = 8;
-        XmNtopOffset = 210;
-        XmNx = 10;
-        XmNy = 210;
-        XmNwidth = 470;
-        XmNheight = 20;
-    };
-    controls {
-    };
-    callbacks {
-    };
-};
-
-object label_about_create1 : XmLabel widget {
-    arguments {
-        XmNfontList = font_table(
-		font('-*-times-bold-r-*-*-*-140-*-*-*-*-iso8859-1'));
-        XmNlabelString = compound_string("David W. Caress    and    Dale N" &
- ". Chayes");
-        XmNrightAttachment = XmATTACH_FORM;
-        XmNleftAttachment = XmATTACH_FORM;
-        XmNleftOffset = 0;
-        XmNrightOffset = 9;
-        XmNx = 0;
-        XmNy = 250;
-        XmNwidth = 479;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-    };
-};
-
-object form_about : XmFormDialog widget {
-    arguments {
-        arguments Style_use2;
-        XmNresizePolicy = XmRESIZE_GROW;
-        XmNx = 0;
-        XmNy = 1095;
-        XmNwidth = 488;
-        XmNheight = 484;
-    };
-    controls {
-         managed XmLabel label_about_create1;
-         managed XmSeparator separator1;
-         managed XmPushButton pushButton_about_dismiss;
-         managed XmLabel label_about_create;
-         managed XmLabel label_about_lamont;
-         managed XmLabel label_about_columbia;
-         managed XmLabel label_about_mbsystem;
-         managed XmLabel label_about_mbpub;
-         managed XmLabel label_about_component;
-         managed XmLabel label_about_for;
-         managed XmSeparator separator;
-         managed XmLabel label_about_version;
-         managed XmLabel label_about_function;
-         managed XmLabel label_about_mbedit;
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-!(BX)object dialogShell_about : XmDialogShell widget {
-!(BX)    arguments {
-!(BX)        arguments Style_use2;
-!(BX)        XmNtitle = "About MBnavadjust";
-!(BX)        XmNwidth = 488;
-!(BX)        XmNheight = 484;
-!(BX)    };
-!(BX)    controls {
-!(BX)         managed XmFormDialog form_about;
-!(BX)    };
-!(BX)    callbacks {
-!(BX)        callbacks Style_use2Reasons;
-!(BX)    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-!(BX)};
-
-object pushButton_biases_dismiss : XmPushButton widget {
-    arguments {
-        arguments Style_use2;
-        XmNlabelString = compound_string("Dismiss");
-        XmNx = 140;
-        XmNy = 400;
-        XmNwidth = 70;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-        XmNactivateCallback = procedure BxUnmanageCB("bulletinBoard_biases");
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object pushButton_biases_apply : XmPushButton widget {
-    arguments {
-        arguments Style_use2;
-        XmNlabelString = compound_string("Apply");
-        XmNx = 70;
-        XmNy = 400;
-        XmNwidth = 70;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-        XmNactivateCallback = procedure do_biases_apply();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object toggleButton_biases_together : XmToggleButton widget {
-    arguments {
-        arguments Style_use2;
-        XmNlabelString = compound_string("Same biases");
-        XmNwidth = 121;
-        XmNheight = 26;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_toggleButton_biases_together);
-        XmNvalueChangedCallback = procedure do_biases_toggle();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object toggleButton_biases_separate : XmToggleButton widget {
-    arguments {
-        arguments Style_use2;
-        XmNlabelString = compound_string("Different biases");
-        XmNwidth = 121;
-        XmNheight = 26;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_toggleButton_biases_separate);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object radioBox_biases_together : XmRadioBox widget {
-    arguments {
-        arguments Style_use2;
-        XmNx = 150;
-        XmNy = 10;
-        XmNwidth = 127;
-        XmNheight = 61;
-    };
-    controls {
-         managed XmToggleButton toggleButton_biases_together;
-         managed XmToggleButton toggleButton_biases_separate;
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object label_biases_files : XmLabel widget {
-    arguments {
-        arguments Style_use2;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNlabelString = compound_string("Section ID\'s:", separate=true) &
- compound_string("  Section 1: XXX:XXX", separate=true) &
- compound_string("  Section 2: XXX:XXX");
-        XmNx = 10;
-        XmNy = 10;
-        XmNwidth = 140;
-        XmNheight = 50;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_label_biases_files);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object scale_biases_heading1 : XmScale widget {
-    arguments {
-        arguments Style_use2;
-        XmNminimum = -99;
-        XmNdecimalPoints = 1;
-        XmNvalue = 0;
-        XmNsliderVisual = XmSHADOWED_BACKGROUND;
-        XmNtitleString = compound_string("Section 1 Heading (deg)");
-        XmNmaximum = 99;
-        XmNslidingMode = XmSLIDER;
-        XmNshowArrows = TRUE;
-        XmNshowValue = TRUE;
-        XmNorientation = XmHORIZONTAL;
-        XmNx = 10;
-        XmNy = 80;
-        XmNwidth = 260;
-        XmNheight = 58;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_scale_biases_heading1);
-        XmNvalueChangedCallback = procedure do_biases_heading();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object scale_biases_roll1 : XmScale widget {
-    arguments {
-        arguments Style_use2;
-        XmNminimum = -99;
-        XmNdecimalPoints = 1;
-        XmNvalue = 0;
-        XmNtitleString = compound_string("Section 1 Roll (deg)");
-        XmNmaximum = 99;
-        XmNshowArrows = TRUE;
-        XmNshowValue = TRUE;
-        XmNorientation = XmHORIZONTAL;
-        XmNx = 10;
-        XmNy = 140;
-        XmNwidth = 260;
-        XmNheight = 58;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_scale_biases_roll1);
-        XmNvalueChangedCallback = procedure do_biases_roll();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object scale_biases_roll2 : XmScale widget {
-    arguments {
-        arguments Style_use2;
-        XmNminimum = -99;
-        XmNdecimalPoints = 1;
-        XmNvalue = 0;
-        XmNtitleString = compound_string("Section 2 Roll (deg)");
-        XmNmaximum = 99;
-        XmNshowArrows = TRUE;
-        XmNshowValue = TRUE;
-        XmNorientation = XmHORIZONTAL;
-        XmNx = 10;
-        XmNy = 280;
-        XmNwidth = 260;
-        XmNheight = 58;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_scale_biases_roll2);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object scale_biases_heading2 : XmScale widget {
-    arguments {
-        arguments Style_use2;
-        XmNminimum = -99;
-        XmNdecimalPoints = 1;
-        XmNvalue = 0;
-        XmNtitleString = compound_string("Section 2 Heading (deg)");
-        XmNmaximum = 99;
-        XmNshowArrows = TRUE;
-        XmNshowValue = TRUE;
-        XmNorientation = XmHORIZONTAL;
-        XmNx = 10;
-        XmNy = 220;
-        XmNwidth = 260;
-        XmNheight = 58;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_scale_biases_heading2);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object separator6 : XmSeparator widget {
-    arguments {
-        XmNx = 10;
-        XmNy = 200;
-        XmNwidth = 260;
-        XmNheight = 20;
-    };
-    controls {
-    };
-    callbacks {
-    };
-};
-
-object separator8 : XmSeparator widget {
-    arguments {
-        XmNx = 10;
-        XmNy = 60;
-        XmNwidth = 260;
-        XmNheight = 20;
-    };
-    controls {
-    };
-    callbacks {
-    };
-};
-
-object pushButton_biases_applyall : XmPushButton widget {
-    arguments {
-        arguments Style_use2;
-        XmNlabelString = compound_string("Apply to All Files");
-        XmNx = 70;
-        XmNy = 360;
-        XmNwidth = 140;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_pushButton_biases_applyall);
-        XmNactivateCallback = procedure do_biases_applyall();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object separator9 : XmSeparator widget {
-    arguments {
-        XmNx = 10;
-        XmNy = 340;
-        XmNwidth = 260;
-        XmNheight = 20;
-    };
-    controls {
-    };
-    callbacks {
-    };
-};
-
-object bulletinBoard_biases : XmBulletinBoardDialog widget {
-    arguments {
-        arguments Style_use2;
-        XmNdialogTitle = compound_string("Heading & Roll Bias");
-        XmNautoUnmanage = false;
-        XmNresizePolicy = XmRESIZE_GROW;
-        XmNx = 0;
-        XmNy = 1114;
-        XmNwidth = 284;
-        XmNheight = 446;
-    };
-    controls {
-         managed XmSeparator separator9;
-         managed XmPushButton pushButton_biases_applyall;
-         managed XmSeparator separator8;
-         managed XmSeparator separator6;
-         managed XmScale scale_biases_heading2;
-         managed XmScale scale_biases_roll2;
-         managed XmScale scale_biases_roll1;
-         managed XmScale scale_biases_heading1;
-         managed XmLabel label_biases_files;
-         managed XmRadioBox radioBox_biases_together;
-         managed XmPushButton pushButton_biases_apply;
-         managed XmPushButton pushButton_biases_dismiss;
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-!(BX)object dialogShell_biases : XmDialogShell widget {
-!(BX)    arguments {
-!(BX)        arguments Style_use2;
-!(BX)        XmNtitle = "Attitude Biases";
-!(BX)        XmNwidth = 284;
-!(BX)        XmNheight = 446;
-!(BX)    };
-!(BX)    controls {
-!(BX)         managed XmBulletinBoardDialog bulletinBoard_biases;
-!(BX)    };
-!(BX)    callbacks {
-!(BX)        callbacks Style_use2Reasons;
-!(BX)    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-!(BX)};
-
-object pushButton_naverr_setnone : XmPushButton widget {
-    arguments {
-        arguments Style_use2;
-        XmNlabelString = compound_string("Skip Crossing");
-        XmNrecomputeSize = false;
-        XmNx = 350;
-        XmNy = 10;
-        XmNwidth = 100;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_pushButton_naverr_setnone);
-        XmNactivateCallback = procedure do_naverr_setnone();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object pushButton_naverr_previous : XmPushButton widget {
-    arguments {
-        arguments Style_use2;
-        XmNlabelString = compound_string("Previous");
-        XmNrecomputeSize = false;
-        XmNx = 90;
-        XmNy = 10;
-        XmNwidth = 80;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_pushButton_naverr_previous);
-        XmNactivateCallback = procedure do_naverr_previous();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object pushButton_naverr_next : XmPushButton widget {
-    arguments {
-        arguments Style_use2;
-        XmNlabelString = compound_string("Next");
-        XmNrecomputeSize = false;
-        XmNx = 170;
-        XmNy = 10;
-        XmNwidth = 80;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_pushButton_naverr_next);
-        XmNactivateCallback = procedure do_naverr_next();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object pushButton_naverr_minmisfit : XmPushButton widget {
-    arguments {
-        arguments Style_use2;
-        XmNlabelString = compound_string("Minimum Misfit");
-        XmNrecomputeSize = false;
-        XmNx = 10;
-        XmNy = 620;
-        XmNwidth = 120;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_pushButton_naverr_minimum);
-        XmNactivateCallback = procedure do_naverr_minmisfit();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object pushButton_naverr_selecttie : XmPushButton widget {
-    arguments {
-        arguments Style_use2;
-        XmNlabelString = compound_string("Select Tie");
-        XmNrecomputeSize = false;
-        XmNx = 750;
-        XmNy = 10;
-        XmNwidth = 100;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_pushButton_naverr_selecttie);
-        XmNactivateCallback = procedure do_naverr_selecttie();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object pushButton_naverr_dismiss : XmPushButton widget {
-    arguments {
-        arguments Style_use2;
-        XmNlabelString = compound_string("Dismiss");
-        XmNrecomputeSize = false;
-        XmNx = 850;
-        XmNy = 10;
-        XmNwidth = 70;
-        XmNheight = 60;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_pushButton_naverr_dismiss);
-       XmNactivateCallback = procedures {
-                 do_dismiss_naverr();
-                 BxUnmanageCB("bulletinBoard_biases");
-                 BxUnmanageCB("bulletinBoard_naverr");
-        };
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object drawingArea_naverr_corr : XmDrawingArea widget {
-    arguments {
-        arguments Style_use2;
-        XmNborderWidth = 1;
-        XmNbackground = color('white');
-        XmNresizePolicy = XmRESIZE_NONE;
-        XmNx = 10;
-        XmNy = 240;
-        XmNwidth = 301;
-        XmNheight = 301;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_drawingArea_naverr_corr);
-        XmNinputCallback = procedure do_naverr_corr_input();
-        XmNexposeCallback = procedure do_naverr_corr_expose();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object drawingArea_naverr_cont : XmDrawingArea widget {
-    arguments {
-        arguments Style_use2;
-        XmNborderWidth = 1;
-        XmNbackground = color('white');
-        XmNresizePolicy = XmRESIZE_NONE;
-        XmNx = 320;
-        XmNy = 70;
-        XmNwidth = 600;
-        XmNheight = 600;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_drawingArea_naverr_cont);
-        XmNinputCallback = procedure do_naverr_cont_input();
-        XmNexposeCallback = procedure do_naverr_cont_expose();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object label_naverr_status : XmLabel widget {
-    arguments {
-        arguments Style_use2;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNlabelString = compound_string("No Data Imported");
-        XmNrecomputeSize = false;
-        XmNx = 10;
-        XmNy = 50;
-        XmNwidth = 300;
-        XmNheight = 150;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_label_naverr_status);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object pushButton_naverr_nextunset : XmPushButton widget {
-    arguments {
-        arguments Style_use2;
-        XmNlabelString = compound_string("Next Unset");
-        XmNrecomputeSize = false;
-        XmNx = 250;
-        XmNy = 10;
-        XmNwidth = 90;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_pushButton_naverr_nextunset);
-        XmNactivateCallback = procedure do_naverr_nextunset();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object label_naverr_offsets : XmLabel widget {
-    arguments {
-        arguments Style_use2;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNlabelString = compound_string("No Data Imported");
-        XmNrecomputeSize = false;
-        XmNx = 10;
-        XmNy = 200;
-        XmNwidth = 300;
-        XmNheight = 40;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_label_naverr_offsets);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object pushButton_naverr_zerooffset : XmPushButton widget {
-    arguments {
-        arguments Style_use2;
-        XmNlabelString = compound_string("Zero Offset");
-        XmNx = 650;
-        XmNy = 40;
-        XmNwidth = 100;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_pushButton_naverr_zerooffset);
-        XmNactivateCallback = procedure do_naverr_zerooffset();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object pushButton_naverr_fullsize : XmPushButton widget {
-    arguments {
-        arguments Style_use2;
-        XmNlabelString = compound_string("Full Size");
-        XmNx = 350;
-        XmNy = 40;
-        XmNwidth = 100;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_pushButton_naverr_fullsize);
-        XmNactivateCallback = procedure do_naverr_fullsize();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object pushButton_naverr_deletetie : XmPushButton widget {
-    arguments {
-        arguments Style_use2;
-        XmNlabelString = compound_string("Delete Tie");
-        XmNrecomputeSize = false;
-        XmNx = 750;
-        XmNy = 40;
-        XmNwidth = 100;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_pushButton_naverr_deletetie);
-        XmNactivateCallback = procedure do_naverr_deletetie();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object pushButton_naverr_addtie : XmPushButton widget {
-    arguments {
-        arguments Style_use2;
-        XmNlabelString = compound_string("Add Tie");
-        XmNrecomputeSize = false;
-        XmNx = 650;
-        XmNy = 10;
-        XmNwidth = 100;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_pushButton_naverr_addtie);
-        XmNactivateCallback = procedure do_naverr_addtie();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object pushButton_naverr_resettie : XmPushButton widget {
-    arguments {
-        arguments Style_use2;
-        XmNlabelString = compound_string("Reset Offset");
-        XmNrecomputeSize = false;
-        XmNx = 450;
-        XmNy = 40;
-        XmNwidth = 100;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_pushButton_naverr_resettie);
-        XmNactivateCallback = procedure do_naverr_resettie();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object toggleButton_misfitcenter_zero : XmToggleButton widget {
-    arguments {
-        arguments Style_use2;
-        XmNindicatorOn = XmINDICATOR_CHECK_BOX;
-        XmNlabelString = compound_string("Center on Zero Offset");
-        XmNwidth = 174;
-        XmNheight = 26;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_toggleButton_misfitcenter_zero);
-        XmNvalueChangedCallback = procedure do_naverr_misfitcenter();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object toggleButton_misfitcenter_auto : XmToggleButton widget {
-    arguments {
-        arguments Style_use2;
-        XmNindicatorOn = XmINDICATOR_CHECK_BOX;
-        XmNlabelString = compound_string("Center on Current Offset");
-        XmNwidth = 174;
-        XmNheight = 26;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_toggleButton_misfitcenter_auto);
-        XmNvalueChangedCallback = procedure do_naverr_misfitcenter();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object radioBox_misfitcenter : XmRadioBox widget {
-    arguments {
-        arguments Style_use2;
-        XmNx = 130;
-        XmNy = 620;
-        XmNwidth = 180;
-        XmNheight = 61;
-    };
-    controls {
-         managed XmToggleButton toggleButton_misfitcenter_zero;
-         managed XmToggleButton toggleButton_misfitcenter_auto;
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object pushButton_naverr_settie : XmPushButton widget {
-    arguments {
-        arguments Style_use2;
-        XmNlabelString = compound_string("Set Offset");
-        XmNx = 550;
-        XmNy = 10;
-        XmNwidth = 100;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_pushButton_naverr_settie);
-        XmNactivateCallback = procedure do_naverr_setoffset();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object pushButton_naverr_biases : XmPushButton widget {
-    arguments {
-        arguments Style_use2;
-        XmNlabelString = compound_string("Biases");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-       XmNactivateCallback = procedures {
-                 BxManageCB("bulletinBoard_biases");
-                 do_biases_init();
-        };
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object pushButton_naverr_controls : XmPushButton widget {
-    arguments {
-        arguments Style_use2;
-        XmNlabelString = compound_string("Contours");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-        XmNactivateCallback = procedure BxManageCB("form_controls");
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object pulldownMenu_settings : XmPulldownMenu widget {
-    arguments {
-        arguments Style_use2;
-        XmNx = 0;
-        XmNy = 0;
-        XmNwidth = 65;
-        XmNheight = 48;
-    };
-    controls {
-         managed XmPushButton pushButton_naverr_biases;
-         managed XmPushButton pushButton_naverr_controls;
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object cascadeButton_settings : XmCascadeButton widget {
-    arguments {
-        arguments Style_use2;
-        XmNlabelString = compound_string("Settings");
-        XmNx = 5;
-        XmNy = 5;
-        XmNwidth = 66;
-        XmNheight = 22;
-    };
-    controls {
-         unmanaged XmPulldownMenu pulldownMenu_settings;
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object menuBar_settings : XmMenuBar widget {
-    arguments {
-        arguments Style_use2;
-        XmNx = 10;
-        XmNy = 10;
-        XmNwidth = 76;
-        XmNheight = 32;
-    };
-    controls {
-         managed XmCascadeButton cascadeButton_settings;
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object pushButton_naverr_zerozoffset : XmPushButton widget {
-    arguments {
-        arguments Style_use2;
-        XmNlabelString = compound_string("Zero Z Offset");
-        XmNx = 550;
-        XmNy = 40;
-        XmNwidth = 100;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_pushButton_naverr_zerozoffset);
-        XmNactivateCallback = procedure do_naverr_zerozoffset();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object drawingArea_naverr_zcorr : XmDrawingArea widget {
-    arguments {
-        arguments Style_use2;
-        XmNborderWidth = 1;
-        XmNbackground = color('white');
-        XmNresizePolicy = XmRESIZE_NONE;
-        XmNx = 10;
-        XmNy = 550;
-        XmNwidth = 300;
-        XmNheight = 60;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_drawingArea_naverr_zcorr);
-        XmNinputCallback = procedure do_naverr_zcorr_input();
-        XmNexposeCallback = procedure do_naverr_corr_expose();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object pushButton_naverr_minxymisfit : XmPushButton widget {
-    arguments {
-        arguments Style_use2;
-        XmNlabelString = compound_string("Minimum XY Misfit");
-        XmNx = 10;
-        XmNy = 650;
-        XmNwidth = 120;
-        XmNheight = 32;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_pushButton_naverr_minxymisfit);
-        XmNactivateCallback = procedure do_naverr_minxymisfit();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object pushButton_naverr_unset : XmPushButton widget {
-    arguments {
-        arguments Style_use2;
-        XmNlabelString = compound_string("Unset Crossing");
-        XmNrecomputeSize = false;
-        XmNx = 450;
-        XmNy = 10;
-        XmNwidth = 100;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_pushButton_naverr_unset);
-        XmNactivateCallback = procedure do_naverr_unset();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object bulletinBoard_naverr : XmBulletinBoardDialog widget {
-    arguments {
-        arguments Style_use2;
-        XmNdialogTitle = compound_string("Navadjust: Nav Error at Crossing" &
- "s");
-        XmNdefaultPosition = true;
-        XmNautoUnmanage = false;
-        XmNnoResize = true;
-        XmNresizePolicy = XmRESIZE_NONE;
-        XmNx = 258;
-        XmNy = 456;
-        XmNwidth = 935;
-        XmNheight = 685;
-    };
-    controls {
-         managed XmPushButton pushButton_naverr_unset;
-         managed XmPushButton pushButton_naverr_minxymisfit;
-         managed XmDrawingArea drawingArea_naverr_zcorr;
-         managed XmPushButton pushButton_naverr_zerozoffset;
-         managed XmMenuBar menuBar_settings;
-         managed XmPushButton pushButton_naverr_settie;
-         managed XmRadioBox radioBox_misfitcenter;
-         managed XmPushButton pushButton_naverr_resettie;
-         managed XmPushButton pushButton_naverr_addtie;
-         managed XmPushButton pushButton_naverr_deletetie;
-         managed XmPushButton pushButton_naverr_fullsize;
-         managed XmPushButton pushButton_naverr_zerooffset;
-         managed XmLabel label_naverr_offsets;
-         managed XmPushButton pushButton_naverr_nextunset;
-         managed XmLabel label_naverr_status;
-         managed XmDrawingArea drawingArea_naverr_cont;
-         managed XmDrawingArea drawingArea_naverr_corr;
-         managed XmPushButton pushButton_naverr_dismiss;
-         managed XmPushButton pushButton_naverr_selecttie;
-         managed XmPushButton pushButton_naverr_minmisfit;
-         managed XmPushButton pushButton_naverr_next;
-         managed XmPushButton pushButton_naverr_previous;
-         managed XmPushButton pushButton_naverr_setnone;
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_bulletinBoard_naverr);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-!(BX)object dialogShell_naverr : XmDialogShell widget {
-!(BX)    arguments {
-!(BX)        arguments Style_use2;
-!(BX)        XmNwidth = 935;
-!(BX)        XmNheight = 685;
-!(BX)    };
-!(BX)    controls {
-!(BX)         managed XmBulletinBoardDialog bulletinBoard_naverr;
-!(BX)    };
-!(BX)    callbacks {
-!(BX)        callbacks Style_use2Reasons;
-!(BX)    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-!(BX)};
-
-object fileSelectionBox : XmFileSelectionBox widget {
-    arguments {
-        XmNdialogStyle = XmDIALOG_MODELESS;
-        XmNdialogTitle = compound_string("File Selection");
-        XmNlistVisibleItemCount = 13;
-        XmNtextFontList = font_table(
-		font('-adobe-helvetica-bold-r-normal--14-140-75-75-p-82-iso8859-1'));
-        XmNlabelFontList = font_table(
-		font('-adobe-helvetica-bold-r-normal--14-140-75-75-p-82-iso8859-1'));
-        XmNbuttonFontList = font_table(
-		font('-adobe-helvetica-bold-r-normal--14-140-75-75-p-82-iso8859-1'));
-        XmNautoUnmanage = false;
-        XmNnoResize = true;
-        XmNresizePolicy = XmRESIZE_NONE;
-        XmNx = 10;
-        XmNy = 10;
-        XmNwidth = 590;
-        XmNheight = 470;
-    };
-    controls {
-    };
-    callbacks {
-       MrmNcreateCallback = procedures {
-                 BxUnmanageCB("fileSelectionBox.Help");
-                 do_fileselection_mode(MBNA_FILESELECTION_NONE);
-                 BxGlobalWidgetId(BXG_fileSelectionBox);
-        };
-       XmNokCallback = procedures {
-                 do_fileselection_ok();
-                 BxUnmanageCB("bulletinBoard_fileselection");
-        };
-       XmNcancelCallback = procedures {
-                 BxUnmanageCB("bulletinBoard_fileselection");
-                 do_fileselection_mode(MBNA_FILESELECTION_NONE);
-        };
-    };
-};
-
-object label_format : XmLabel widget {
-    arguments {
-        XmNfontList = font_table(
-		font('-adobe-helvetica-bold-r-normal--14-140-75-75-p-82-iso8859-1'));
-        XmNlabelString = compound_string("MBIO Format ID:");
-        XmNrecomputeSize = false;
-        XmNx = 10;
-        XmNy = 480;
-        XmNwidth = 150;
-        XmNheight = 40;
-    };
-    controls {
-    };
-    callbacks {
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_label_format);
-    };
-};
-
-object textField_format : XmTextField widget {
-    arguments {
-        XmNfontList = font_table(
-		font('-adobe-helvetica-bold-r-normal--14-140-75-75-p-82-iso8859-1'));
-        XmNx = 160;
-        XmNy = 480;
-        XmNwidth = 100;
-        XmNheight = 35;
-    };
-    controls {
-    };
-    callbacks {
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_textField_format);
-    };
-};
-
-object bulletinBoard_fileselection : XmBulletinBoardDialog widget {
-    arguments {
-        XmNdialogStyle = XmDIALOG_FULL_APPLICATION_MODAL;
-        XmNresizePolicy = XmRESIZE_NONE;
-        XmNx = 0;
-        XmNy = 1072;
-        XmNwidth = 611;
-        XmNheight = 530;
-    };
-    controls {
-         managed XmTextField textField_format;
-         managed XmLabel label_format;
-         managed XmFileSelectionBox fileSelectionBox;
-    };
-    callbacks {
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_bulletinBoard_fileselection);
-    };
-};
-
-!(BX)object xmDialogShell_fileselection : XmDialogShell widget {
-!(BX)    arguments {
-!(BX)        XmNtitle = "Select Input Data File";
-!(BX)        XmNallowShellResize = false;
-!(BX)        XmNwidth = 611;
-!(BX)        XmNheight = 530;
-!(BX)    };
-!(BX)    controls {
-!(BX)         managed XmBulletinBoardDialog bulletinBoard_fileselection;
-!(BX)    };
-!(BX)    callbacks {
-!(BX)        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_xmDialogShell_fileselection);
-!(BX)    };
-!(BX)};
-
-object pushButton_error : XmPushButton widget {
-    arguments {
-        arguments Style_use2;
-        XmNlabelString = compound_string("OK");
-        XmNx = 110;
-        XmNy = 110;
-        XmNwidth = 90;
-        XmNheight = 40;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object label_error_three : XmLabel widget {
-    arguments {
-        arguments Style_use2;
-        XmNlabelString = compound_string("permission in this directory!");
-        XmNrecomputeSize = false;
-        XmNx = 10;
-        XmNy = 70;
-        XmNwidth = 290;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_label_error_three);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object label_error_one : XmLabel widget {
-    arguments {
-        arguments Style_use2;
-        XmNlabelString = compound_string("Unable to open output file.");
-        XmNrecomputeSize = false;
-        XmNx = 10;
-        XmNy = 10;
-        XmNwidth = 290;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_label_error_one);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object label_error_two : XmLabel widget {
-    arguments {
-        arguments Style_use2;
-        XmNlabelString = compound_string("You probably do not have write");
-        XmNrecomputeSize = false;
-        XmNx = 10;
-        XmNy = 40;
-        XmNwidth = 290;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_label_error_two);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object bulletinBoard_error : XmBulletinBoardDialog widget {
-    arguments {
-        arguments Style_use2;
-        XmNdialogStyle = XmDIALOG_APPLICATION_MODAL;
-        XmNresizePolicy = XmRESIZE_GROW;
-        XmNx = 0;
-        XmNy = 1257;
-        XmNwidth = 311;
-        XmNheight = 160;
-    };
-    controls {
-         managed XmLabel label_error_two;
-         managed XmLabel label_error_one;
-         managed XmLabel label_error_three;
-         managed XmPushButton pushButton_error;
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_bulletinBoard_error);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-!(BX)object xmDialogShell_error : XmDialogShell widget {
-!(BX)    arguments {
-!(BX)        XmNtitle = "Error";
-!(BX)        XmNwidth = 311;
-!(BX)        XmNheight = 160;
-!(BX)    };
-!(BX)    controls {
-!(BX)         managed XmBulletinBoardDialog bulletinBoard_error;
-!(BX)    };
-!(BX)    callbacks {
-!(BX)    };
-!(BX)};
-
-object label_message : XmLabel widget {
-    arguments {
-        arguments Style_use2;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNlabelString = compound_string("MBnavadjust is loading data...");
-        XmNx = 10;
-        XmNy = 10;
-        XmNwidth = 510;
-        XmNheight = 20;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_label_message);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object label_pleasewait : XmLabel widget {
-    arguments {
-        arguments Style_use2;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNlabelString = compound_string("Thank you for your patience.");
-        XmNrecomputeSize = false;
-        XmNx = 10;
-        XmNy = 40;
-        XmNwidth = 510;
-        XmNheight = 20;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object bulletinBoard_message : XmBulletinBoardDialog widget {
-    arguments {
-        arguments Style_use2;
-        XmNdialogStyle = XmDIALOG_FULL_APPLICATION_MODAL;
-        XmNresizePolicy = XmRESIZE_ANY;
-        XmNx = 0;
-        XmNy = 1294;
-        XmNwidth = 542;
-        XmNheight = 86;
-    };
-    controls {
-         managed XmLabel label_pleasewait;
-         managed XmLabel label_message;
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_bulletinBoard_message);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-!(BX)object xmDialogShell_message : XmDialogShell widget {
-!(BX)    arguments {
-!(BX)        arguments Style_use2;
-!(BX)        XmNtitle = "Please Wait...";
-!(BX)        XmNallowShellResize = true;
-!(BX)        XmNmwmInputMode = MWM_INPUT_MODELESS;
-!(BX)        XmNdeleteResponse = XmUNMAP;
-!(BX)        XmNwidth = 542;
-!(BX)        XmNheight = 86;
-!(BX)    };
-!(BX)    controls {
-!(BX)         managed XmBulletinBoardDialog bulletinBoard_message;
-!(BX)    };
-!(BX)    callbacks {
-!(BX)        callbacks Style_use2Reasons;
-!(BX)    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-!(BX)};
-
-object pushButton_new : XmPushButton widget {
-    arguments {
-        arguments Style_use2;
-        XmNlabelString = compound_string("New");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_pushButton_new);
-       XmNactivateCallback = procedures {
-                 BxManageCB("bulletinBoard_fileselection");
-                 BxSetValuesCB("xmDialogShell_fileselection.tit" &
- "le=Specify New Project");
-                 BxUnmanageCB("label_format");
-                 BxUnmanageCB("textField_format");
-                 do_fileselection_mode(MBNA_FILESELECTION_NEW);
-        };
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object pushButton_open : XmPushButton widget {
-    arguments {
-        arguments Style_use2;
-        XmNlabelString = compound_string("Open");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_pushButton_open);
-       XmNactivateCallback = procedures {
-                 BxManageCB("bulletinBoard_fileselection");
-                 BxUnmanageCB("label_format");
-                 BxUnmanageCB("textField_format");
-                 BxSetValuesCB("xmDialogShell_fileselection.tit" &
- "le=Open Project");
-                 do_fileselection_mode(MBNA_FILESELECTION_OPEN);
-        };
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object pushButton_close : XmPushButton widget {
-    arguments {
-        arguments Style_use2;
-        XmNlabelString = compound_string("Close");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_pushButton_close);
-        XmNactivateCallback = procedure do_file_close();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object separator2 : XmSeparator widget {
-    arguments {
-        arguments Style_use2;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object pushButton_importdata : XmPushButton widget {
-    arguments {
-        arguments Style_use2;
-        XmNlabelString = compound_string("Import Swath Data");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_pushButton_importdata);
-       XmNactivateCallback = procedures {
-                 BxSetValuesCB("xmDialogShell_fileselection.tit" &
- "le=Import Swath Data File or Datalist");
-                 BxSetValuesCB("label_format.labelString=MBIO F" &
- "ormat ID:");
-                 BxManageCB("label_format");
-                 BxManageCB("textField_format");
-                 BxManageCB("bulletinBoard_fileselection");
-                 do_fileselection_mode(MBNA_FILESELECTION_IMPORT);
-        };
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object separator3 : XmSeparator widget {
-    arguments {
-        arguments Style_use2;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object pushButton_quit : XmPushButton widget {
-    arguments {
-        arguments Style_use2;
-        XmNlabelString = compound_string("Quit");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_pushButton_quit);
-       XmNactivateCallback = procedures {
-                 do_quit();
-                 BxExitCB(0);
-        };
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object pulldownMenu_file : XmPulldownMenu widget {
-    arguments {
-        arguments Style_use2;
-        XmNx = 0;
-        XmNy = 0;
-        XmNwidth = 126;
-        XmNheight = 118;
-    };
-    controls {
-         managed XmPushButton pushButton_new;
-         managed XmPushButton pushButton_open;
-         managed XmPushButton pushButton_close;
-         managed XmSeparator separator2;
-         managed XmPushButton pushButton_importdata;
-         managed XmSeparator separator3;
-         managed XmPushButton pushButton_quit;
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object cascadeButton_file : XmCascadeButton widget {
-    arguments {
-        arguments Style_use2;
-        XmNlabelString = compound_string("File");
-        XmNx = 5;
-        XmNy = 5;
-        XmNwidth = 36;
-        XmNheight = 22;
-    };
-    controls {
-         unmanaged XmPulldownMenu pulldownMenu_file;
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object pushButton_controls : XmPushButton widget {
-    arguments {
-        arguments Style_use2;
-        XmNlabelString = compound_string("Controls");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-        XmNactivateCallback = procedure BxManageCB("form_controls");
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object pulldownMenu_option : XmPulldownMenu widget {
-    arguments {
-        arguments Style_use2;
-        XmNx = 0;
-        XmNy = 0;
-        XmNwidth = 61;
-        XmNheight = 26;
-    };
-    controls {
-         managed XmPushButton pushButton_controls;
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object cascadeButton_option : XmCascadeButton widget {
-    arguments {
-        arguments Style_use2;
-        XmNlabelString = compound_string("Option");
-        XmNx = 41;
-        XmNy = 5;
-        XmNwidth = 55;
-        XmNheight = 22;
-    };
-    controls {
-         unmanaged XmPulldownMenu pulldownMenu_option;
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object pushButton_showsurveys : XmPushButton widget {
-    arguments {
-        arguments Style_use2;
-        XmNlabelString = compound_string("Show Surveys");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_pushButton_showsurveys);
-        XmNactivateCallback = procedure do_view_showsurveys();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object pushButton_showdata : XmPushButton widget {
-    arguments {
-        arguments Style_use2;
-        XmNlabelString = compound_string("Show Data Files");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_pushButton_showdata);
-        XmNactivateCallback = procedure do_view_showdata();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object pushButton_showsections : XmPushButton widget {
-    arguments {
-        arguments Style_use2;
-        XmNlabelString = compound_string("Show Data File Sections");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_pushButton_showsections);
-        XmNactivateCallback = procedure do_view_showsections();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object pushButton_showcrossings : XmPushButton widget {
-    arguments {
-        arguments Style_use2;
-        XmNlabelString = compound_string("Show All Crossings");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_pushButton_showcrossings);
-        XmNactivateCallback = procedure do_view_showcrossings();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object pushButton_showmediocrecrossings : XmPushButton widget {
-    arguments {
-        arguments Style_use2;
-        XmNlabelString = compound_string("Show >10% Overlap Crossings");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_pushButton_showmediocrecrossings);
-        XmNactivateCallback = procedure do_view_showmediocrecrossings();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object pushButton_showgoodcrossings : XmPushButton widget {
-    arguments {
-        arguments Style_use2;
-        XmNlabelString = compound_string("Show >25% Overlap Crossings");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_pushButton_showgoodcrossings);
-        XmNactivateCallback = procedure do_view_showgoodcrossings();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object pushButton_showbettercrossings : XmPushButton widget {
-    arguments {
-        arguments Style_use2;
-        XmNlabelString = compound_string("Show >50% Overlap Crossings");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_pushButton_showbettercrossings);
-        XmNactivateCallback = procedure do_view_showbettercrossings();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object pushButton_showtruecrossings : XmPushButton widget {
-    arguments {
-        arguments Style_use2;
-        XmNlabelString = compound_string("Show True Crossings");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_pushButton_showtruecrossings);
-        XmNactivateCallback = procedure do_view_showtruecrossings();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object pushButton_showties : XmPushButton widget {
-    arguments {
-        arguments Style_use2;
-        XmNlabelString = compound_string("Show Ties");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_pushButton_showties);
-        XmNactivateCallback = procedure do_view_showties();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object separator13 : XmSeparator widget {
-    arguments {
-    };
-    controls {
-    };
-    callbacks {
-    };
-};
-
-object toggleButton_showallsurveys : XmToggleButton widget {
-    arguments {
-        arguments Style_use2;
-        XmNlabelString = compound_string("Show All Surveys");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_toggleButton_showallsurveys);
-        XmNvalueChangedCallback = procedure do_view_showallsurveys();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object toggleButton_showselectedsurvey : XmToggleButton widget {
-    arguments {
-        arguments Style_use2;
-        XmNlabelString = compound_string("Show Only Selected Survey");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_toggleButton_showselectedsurvey);
-        XmNvalueChangedCallback = procedure do_view_showselectedsurveys();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object toggleButton_showselectedfile : XmToggleButton widget {
-    arguments {
-        arguments Style_use2;
-        XmNlabelString = compound_string("Show Only Selected File");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_toggleButton_showselectedfile);
-        XmNvalueChangedCallback = procedure do_view_showselectedfile();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object toggleButton_showwithselectedsurvey : XmToggleButton widget {
-    arguments {
-        arguments Style_use2;
-        XmNlabelString = compound_string("Show Only With Selected Survey");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_toggleButton_showwithselectedsurvey);
-        XmNvalueChangedCallback = procedure do_view_showwithselectedsurveys();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object toggleButton_showwithselectedfile : XmToggleButton widget {
-    arguments {
-        arguments Style_use2;
-        XmNlabelString = compound_string("Show Only With Selected File");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_toggleButton_showwithselectedfile);
-        XmNvalueChangedCallback = procedure do_view_showwithselectedfile();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object toggleButton_showselectedsection : XmToggleButton widget {
-    arguments {
-        arguments Style_use2;
-        XmNlabelString = compound_string("Show Only With Selected Section");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_toggleButton_showselectedsection);
-        XmNvalueChangedCallback = procedure do_view_showselectedsection();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object separator15 : XmSeparator widget {
-    arguments {
-    };
-    controls {
-    };
-    callbacks {
-    };
-};
-
-object pushButton_makegrid : XmPushButton widget {
-    arguments {
-        arguments Style_use2;
-        XmNlabelString = compound_string("Visualize Survey");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_pushButton_makegrid);
-        XmNactivateCallback = procedure do_make_grid();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object pushButton_showmodelplot : XmPushButton widget {
-    arguments {
-        arguments Style_use2;
-        XmNlabelString = compound_string("Show Modelplot");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_pushButton_showmodelplot);
-       XmNactivateCallback = procedures {
-                 BxManageCB("bulletinBoard_modelplot");
-                 do_modelplot_show();
-        };
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object pulldownMenu_view : XmPulldownMenu widget {
-    arguments {
-        arguments Style_use2;
-        XmNx = 0;
-        XmNy = 0;
-        XmNwidth = 225;
-        XmNheight = 360;
-    };
-    controls {
-         managed XmPushButton pushButton_showsurveys;
-         managed XmPushButton pushButton_showdata;
-         managed XmPushButton pushButton_showsections;
-         managed XmPushButton pushButton_showcrossings;
-         managed XmPushButton pushButton_showmediocrecrossings;
-         managed XmPushButton pushButton_showgoodcrossings;
-         managed XmPushButton pushButton_showbettercrossings;
-         managed XmPushButton pushButton_showtruecrossings;
-         managed XmPushButton pushButton_showties;
-         managed XmSeparator separator13;
-         managed XmToggleButton toggleButton_showallsurveys;
-         managed XmToggleButton toggleButton_showselectedsurvey;
-         managed XmToggleButton toggleButton_showselectedfile;
-         managed XmToggleButton toggleButton_showwithselectedsurvey;
-         managed XmToggleButton toggleButton_showwithselectedfile;
-         managed XmToggleButton toggleButton_showselectedsection;
-         managed XmSeparator separator15;
-         managed XmPushButton pushButton_makegrid;
-         managed XmPushButton pushButton_showmodelplot;
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object cascadeButton_view : XmCascadeButton widget {
-    arguments {
-        arguments Style_use2;
-        XmNlabelString = compound_string("View");
-        XmNx = 96;
-        XmNy = 5;
-        XmNwidth = 45;
-        XmNheight = 22;
-    };
-    controls {
-         unmanaged XmPulldownMenu pulldownMenu_view;
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object pushButton_poornav : XmPushButton widget {
-    arguments {
-        arguments Style_use2;
-        XmNlabelString = compound_string("Set File Poor Navigation");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_pushButton_poornav);
-        XmNactivateCallback = procedure do_action_poornav();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object pushButton_goodnav : XmPushButton widget {
-    arguments {
-        arguments Style_use2;
-        XmNlabelString = compound_string("Set File Good Navigation");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_pushButton_goodnav);
-        XmNactivateCallback = procedure do_action_goodnav();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object pushButton_fixednav : XmPushButton widget {
-    arguments {
-        arguments Style_use2;
-        XmNlabelString = compound_string("Set File Fixed Navigation");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_pushButton_fixednav);
-        XmNactivateCallback = procedure do_action_fixednav();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object pushButton_fixedxynav : XmPushButton widget {
-    arguments {
-        arguments Style_use2;
-        XmNlabelString = compound_string("Set File Fixed XY Navigation");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_pushButton_fixedxynav);
-        XmNactivateCallback = procedure do_action_fixedxynav();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object pushButton_fixedznav : XmPushButton widget {
-    arguments {
-        arguments Style_use2;
-        XmNlabelString = compound_string("Set File Fixed Z Navigation");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_pushButton_fixedznav);
-        XmNactivateCallback = procedure do_action_fixedznav();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object pushButton_tie_xy : XmPushButton widget {
-    arguments {
-        arguments Style_use2;
-        XmNlabelString = compound_string("Set tie to XY only");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_pushButton_tie_xy);
-        XmNactivateCallback = procedure do_action_tie_xy();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object pushButton_tie_z : XmPushButton widget {
-    arguments {
-        arguments Style_use2;
-        XmNlabelString = compound_string("Set tie to Z only");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_pushButton_tie_z);
-        XmNactivateCallback = procedure do_action_z();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object pushButton_tie_xyz : XmPushButton widget {
-    arguments {
-        arguments Style_use2;
-        XmNlabelString = compound_string("Set tie to full XYZ");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_pushButton_tie_xyz);
-        XmNactivateCallback = procedure do_action_tie_xyz();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object separator7 : XmSeparator widget {
-    arguments {
-    };
-    controls {
-    };
-    callbacks {
-    };
-};
-
-object pushButton_autopick : XmPushButton widget {
-    arguments {
-        arguments Style_use2;
-        XmNlabelString = compound_string("Auto-Pick Offsets");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_pushButton_autopick);
-        XmNactivateCallback = procedure do_action_autopick();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object pushButton_autopickhorizontal : XmPushButton widget {
-    arguments {
-        arguments Style_use2;
-        XmNlabelString = compound_string("Auto-Pick Horizontal Offsets");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_pushButton_autopickhorizontal);
-        XmNactivateCallback = procedure do_action_autopickhorizontal();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object pushButton_autosetsvsvertical : XmPushButton widget {
-    arguments {
-        arguments Style_use2;
-        XmNlabelString = compound_string("Auto-Set Survey-vs-Survey Vertical Offsets");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_pushButton_autosetsvsvertical);
-        XmNactivateCallback = procedure do_action_autosetsvsvertical();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object separator10 : XmSeparator widget {
-    arguments {
-    };
-    controls {
-    };
-    callbacks {
-    };
-};
-
-object pushButton_newcrossings : XmPushButton widget {
-    arguments {
-        arguments Style_use2;
-        XmNlabelString = compound_string("Check For New Crossings");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_pushButton_newcrossings);
-        XmNactivateCallback = procedure do_action_checknewcrossings();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object separator17 : XmSeparator widget {
-    arguments {
-    };
-    controls {
-    };
-    callbacks {
-    };
-};
-
-object pushButton_analyzecrossings : XmPushButton widget {
-    arguments {
-        arguments Style_use2;
-        XmNlabelString = compound_string("Analyze Crossings");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_pushButton_analyzecrossings);
-       XmNactivateCallback = procedures {
-                 BxManageCB("bulletinBoard_naverr");
-                 do_naverr_init();
-                 do_action_analyzecrossings();
-        };
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object separator11 : XmSeparator widget {
-    arguments {
-    };
-    controls {
-    };
-    callbacks {
-    };
-};
-
-object pushButton_zerozoffsets : XmPushButton widget {
-    arguments {
-        arguments Style_use2;
-        XmNlabelString = compound_string("Zero All Z Offsets");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_pushButton_zerozoffsets);
-        XmNactivateCallback = procedure do_zerozoffsets();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object separator16 : XmSeparator widget {
-    arguments {
-    };
-    controls {
-    };
-    callbacks {
-    };
-};
-
-object pushButton_invertnav : XmPushButton widget {
-    arguments {
-        arguments Style_use2;
-        XmNlabelString = compound_string("Invert Navigation");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_pushButton_invertnav);
-        XmNactivateCallback = procedure do_action_invertnav();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object pushButton_applynav : XmPushButtonGadget widget {
-    arguments {
-        arguments Style_use2;
-        XmNlabelString = compound_string("Apply Adjusted Navigation");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_pushButton_applynav);
-        XmNactivateCallback = procedure do_apply_nav();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object pulldownMenu_action : XmPulldownMenu widget {
-    arguments {
-        arguments Style_use2;
-        XmNx = 0;
-        XmNy = 0;
-        XmNwidth = 182;
-        XmNheight = 344;
-    };
-    controls {
-         managed XmPushButton pushButton_poornav;
-         managed XmPushButton pushButton_goodnav;
-         managed XmPushButton pushButton_fixednav;
-         managed XmPushButton pushButton_fixedxynav;
-         managed XmPushButton pushButton_fixedznav;
-         managed XmPushButton pushButton_tie_xy;
-         managed XmPushButton pushButton_tie_z;
-         managed XmPushButton pushButton_tie_xyz;
-         managed XmSeparator separator7;
-         managed XmPushButton pushButton_autopick;
-         managed XmPushButton pushButton_autopickhorizontal;
-         managed XmPushButton pushButton_autosetsvsvertical;
-         managed XmSeparator separator10;
-         managed XmPushButton pushButton_newcrossings;
-         managed XmSeparator separator17;
-         managed XmPushButton pushButton_analyzecrossings;
-         managed XmSeparator separator11;
-         managed XmPushButton pushButton_zerozoffsets;
-         managed XmSeparator separator16;
-         managed XmPushButton pushButton_invertnav;
-         managed XmPushButtonGadget pushButton_applynav;
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object cascadeButton_action : XmCascadeButton widget {
-    arguments {
-        arguments Style_use2;
-        XmNlabelString = compound_string("Action");
-        XmNx = 141;
-        XmNy = 5;
-        XmNwidth = 53;
-        XmNheight = 22;
-    };
-    controls {
-         unmanaged XmPulldownMenu pulldownMenu_action;
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object pushButton_about : XmPushButton widget {
-    arguments {
-        arguments Style_use2;
-        XmNlabelString = compound_string("About");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-        XmNactivateCallback = procedure BxManageCB("form_about");
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object pulldownMenu_about : XmPulldownMenu widget {
-    arguments {
-        arguments Style_use2;
-        XmNx = 0;
-        XmNy = 0;
-        XmNwidth = 46;
-        XmNheight = 26;
-    };
-    controls {
-         managed XmPushButton pushButton_about;
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object cascadeButton_about : XmCascadeButton widget {
-    arguments {
-        arguments Style_use2;
-        XmNlabelString = compound_string("About");
-        XmNx = 907;
-        XmNy = 5;
-        XmNwidth = 50;
-        XmNheight = 22;
-    };
-    controls {
-         unmanaged XmPulldownMenu pulldownMenu_about;
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object menuBar_mbnavadjust : XmMenuBar widget {
-    arguments {
-        arguments Style_use2;
-        XmNmenuHelpWidget = XmCascadeButton cascadeButton_about;
-        XmNwidth = 962;
-        XmNheight = 32;
-    };
-    controls {
-         managed XmCascadeButton cascadeButton_file;
-         managed XmCascadeButton cascadeButton_option;
-         managed XmCascadeButton cascadeButton_view;
-         managed XmCascadeButton cascadeButton_action;
-         managed XmCascadeButton cascadeButton_about;
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object list_data : XmList widget {
-    arguments {
-        arguments Style_use2;
-        XmNitemCount = 1;
-        XmNitems = string_table(
-	compound_string(" "));
-        XmNfontList = font_table(
-		font('-*-fixed-medium-r-*-*-*-120-*-*-*-*-iso8859-1'));
-        XmNselectionPolicy = XmSINGLE_SELECT;
-        XmNlistSizePolicy = XmCONSTANT;
-        XmNwidth = 490;
-        XmNheight = 330;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_list_data);
-        XmNsingleSelectionCallback = procedure do_list_data_select();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object scrolledWindow_datalist : XmScrolledWindow widget {
-    arguments {
-        arguments Style_use2;
-        XmNscrollingPolicy = XmAPPLICATION_DEFINED;
-        XmNtopAttachment = XmATTACH_FORM;
-        XmNrightAttachment = XmATTACH_FORM;
-        XmNleftAttachment = XmATTACH_WIDGET;
-        XmNbottomAttachment = XmATTACH_FORM;
-        XmNbottomOffset = 8;
-        XmNleftOffset = 10;
-        XmNrightOffset = 22;
-        XmNtopOffset = 30;
-        XmNleftWidget = XmScrolledWindow scrolledWindow_messages;
-        XmNtopWidget = XmLabel label_listdata;
-        XmNx = 450;
-        XmNy = 30;
-        XmNwidth = 490;
-        XmNheight = 330;
-    };
-    controls {
-         managed XmList list_data;
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_scrolledWindow_datalist);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object label_listdata : XmLabel widget {
-    arguments {
-        arguments Style_use2;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNlabelString = compound_string("Data Files:");
-        XmNrightAttachment = XmATTACH_NONE;
-        XmNleftAttachment = XmATTACH_FORM;
-        XmNleftOffset = 450;
-        XmNx = 450;
-        XmNy = 0;
-        XmNwidth = 120;
-        XmNheight = 20;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_label_listdata);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object label_status : XmLabel widget {
-    arguments {
-        arguments Style_use2;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNlabelString = compound_string("No Data Imported");
-        XmNtopAttachment = XmATTACH_FORM;
-        XmNrightAttachment = XmATTACH_NONE;
-        XmNleftAttachment = XmATTACH_FORM;
-        XmNbottomWidget = XmScrolledWindow scrolledWindow_messages;
-        XmNleftOffset = 0;
-        XmNtopOffset = 0;
-        XmNx = 0;
-        XmNy = 0;
-        XmNwidth = 440;
-        XmNheight = 140;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_label_status);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object text_messages : XmText widget {
-    arguments {
-        arguments Style_use2;
-        XmNeditMode = XmMULTI_LINE_EDIT;
-        XmNfontList = font_table(
-		font('-*-fixed-medium-r-*-*-*-120-*-*-*-*-iso8859-1'));
-        XmNcolumns = 120;
-        XmNwordWrap = false;
-        XmNautoShowCursorPosition = false;
-        XmNrows = 1;
-        XmNeditable = false;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_text_messages);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object scrolledWindow_messages : XmScrolledWindow widget {
-    arguments {
-        arguments Style_use2;
-        XmNscrollingPolicy = XmAUTOMATIC;
-        XmNscrollBarDisplayPolicy = XmAS_NEEDED;
-        XmNtopAttachment = XmATTACH_WIDGET;
-        XmNleftAttachment = XmATTACH_FORM;
-        XmNbottomAttachment = XmATTACH_FORM;
-        XmNbottomOffset = -2;
-        XmNleftOffset = 0;
-        XmNtopOffset = 10;
-        XmNtopWidget = XmLabel label_status;
-        XmNx = 0;
-        XmNy = 150;
-        XmNwidth = 440;
-        XmNheight = 220;
-    };
-    controls {
-         managed XmText text_messages;
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_scrolledWindow_messages);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object form_mbnavadjust : XmForm widget {
-    arguments {
-        arguments Style_use2;
-        XmNresizePolicy = XmRESIZE_GROW;
-        XmNwidth = 962;
-        XmNheight = 368;
-    };
-    controls {
-         managed XmScrolledWindow scrolledWindow_messages;
-         managed XmLabel label_status;
-         managed XmLabel label_listdata;
-         managed XmScrolledWindow scrolledWindow_datalist;
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_form_mbnavadjust);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-object mainWindow : XmMainWindow widget {
-    arguments {
-        arguments Style_use2;
-        XmNx = 82;
-        XmNy = 396;
-        XmNwidth = 962;
-        XmNheight = 400;
-    };
-    controls {
-!(BX)         unmanaged XmDialogShell dialogShell_modelplot;
-!(BX)         unmanaged XmDialogShell dialogShell_controls;
-!(BX)         unmanaged XmDialogShell dialogShell_about;
-!(BX)         unmanaged XmDialogShell dialogShell_biases;
-!(BX)         unmanaged XmDialogShell dialogShell_naverr;
-!(BX)         unmanaged XmDialogShell xmDialogShell_fileselection;
-!(BX)         unmanaged XmDialogShell xmDialogShell_error;
-!(BX)         unmanaged XmDialogShell xmDialogShell_message;
-         managed XmMenuBar menuBar_mbnavadjust;
-         managed XmForm form_mbnavadjust;
-    };
-    callbacks {
-        callbacks Style_use2Reasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_use2Handlers;
-!(BX)    };
-};
-
-!(BX)object topLevelShell : TopLevelShell widget {
-!(BX)    arguments {
-!(BX)        XmNtitle = "MBnavadjust";
-!(BX)        XmNiconName = "MBnavadjust";
-!(BX)        XmNx = 82;
-!(BX)        XmNy = 396;
-!(BX)        XmNwidth = 962;
-!(BX)        XmNheight = 400;
-!(BX)    };
-!(BX)    controls {
-!(BX)         managed XmMainWindow mainWindow;
-!(BX)    };
-!(BX)    callbacks {
-!(BX)        XmNdestroyCallback = procedure BxExitCB(0);
-!(BX)    };
-!(BX)};
-end module;
diff --git a/src/mbnavadjust/mbnavadjust_callbacks.c b/src/mbnavadjust/mbnavadjust_callbacks.c
deleted file mode 100644
index f14ee3a..0000000
--- a/src/mbnavadjust/mbnavadjust_callbacks.c
+++ /dev/null
@@ -1,6222 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbnavadjust_callbacks.c	2/22/2000
- *    $Id: mbnavadjust_callbacks.c 2252 2015-07-01 19:35:37Z caress $
- *
- *    Copyright (c) 2000-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbnavadjust is an interactive navigation adjustment package
- * for swath sonar data.
- * It can work with any data format supported by the MBIO library.
- * This file contains the callback functions from the MOTIF interface.
- *
- * Author:	D. W. Caress
- * Date:	March 22, 2000
- *
- *
- */
-/*--------------------------------------------------------------------*/
-
-/* include files */
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <time.h>
-#include <math.h>
-
-/* X11 includes */
-#include <X11/cursorfont.h>
-#include <X11/Xlib.h>
-#include <X11/Xutil.h>
-#include <X11/Intrinsic.h>
-#include <X11/keysym.h>
-#include <X11/keysymdef.h>
-#include <Xm/FileSB.h>
-#include <Xm/Text.h>
-#include <Xm/TextF.h>
-#include <Xm/ToggleB.h>
-#include <Xm/Xm.h>
-#include <Xm/List.h>
-
-#define MBNAVADJUST_DECLARE_GLOBALS
-#include "mbnavadjust_extrawidgets.h"
-#include "mb_define.h"
-#include "mb_status.h"
-#include "mb_aux.h"
-#include "mbnavadjust.h"
-#include "mb_xgraphics.h"
-
-#include "mbnavadjust_creation.h"
-
-/*--------------------------------------------------------------------*/
-
-/*
- * Standard includes for builtins.
- */
-#include <stdio.h>
-#include <string.h>
-#include <ctype.h>
-
-/*
- * Macros to make code look nicer between ANSI and K&R.
- */
-#ifndef ARGLIST
-#if (NeedFunctionPrototypes == 0)
-#define PROTOTYPE(p)	()
-#define ARGLIST(p)	p
-#define ARG(a, b)	a b;
-#define GRA(a, b)	a b;
-#define UARG(a, b)      a b;
-#define GRAU(a, b)      a b;
-#else
-#define PROTOTYPE(p)	p
-#define ARGLIST(p)	(
-#define ARG(a, b)	a b,
-#define GRA(a, b)	a b)
-#ifdef __cplusplus
-#define UARG(a, b)      a,
-#define GRAU(a, b)      a)
-#else
-#define UARG(a, b)      a b,
-#define GRAU(a, b)      a b)
-#endif
-#endif
-#endif
-
-#ifndef FIXED
-#define FIXED "fixed"
-#endif
-
-Widget		BxFindTopShell PROTOTYPE((Widget));
-WidgetList	BxWidgetIdsFromNames PROTOTYPE((Widget, char*, char*));
-
-/*--------------------------------------------------------------------*/
-
-/* id variables */
-static char svn_id[] = "$Id: mbnavadjust_callbacks.c 2252 2015-07-01 19:35:37Z caress $";
-static char program_name[] = "MBnavadjust";
-
-/* XG variable declarations */
-#define xgfont "-*-"FIXED"-bold-r-normal-*-13-*-75-75-c-70-iso8859-1"
-#define EV_MASK (ButtonPressMask | ButtonReleaseMask | ButtonMotionMask | KeyPressMask | KeyReleaseMask | ExposureMask)
-XtAppContext	app_context;
-Display		*display;
-Window		cont_xid, corr_xid, zoff_xid;
-Colormap	colormap;
-GC		cont_gc, corr_gc, modp_gc;
-XGCValues	xgcv;
-XFontStruct	*fontStruct;
-#define	XG_SOLIDLINE	0
-#define	XG_DASHLINE	1
-void	*cont_xgid = NULL;		/* XG graphics id */
-void	*corr_xgid = NULL;		/* XG graphics id */
-void	*zoff_xgid = NULL;		/* XG graphics id */
-void	*modp_xgid = NULL;		/* XG graphics id */
-Cursor myCursor;
-
-/* Set the colors used for this program here. */
-#define NCOLORS 256
-XColor colors[NCOLORS];
-unsigned int mpixel_values[NCOLORS];
-XColor db_color;
-
-/* Set these to the dimensions of your canvas drawing */
-/* areas, minus 1, located in the uil file             */
-static int cont_borders[4] = { 0, 600, 0, 600 };
-static int corr_borders[4] = { 0, 301, 0, 301 };
-static int zoff_borders[4] = { 0, 300, 0, 60 };
-static int modp_borders[4];
-
-/* file opening parameters */
-#define FILE_MODE_NONE 		0
-#define FILE_MODE_NEW 		1
-#define FILE_MODE_OPEN 		2
-#define FILE_MODE_IMPORT 	3
-size_t	file_mode = FILE_MODE_NONE;
-int	format = 0;
-int	expose_plot_ok = True;
-int selected = 0; /* indicates an input file is selected */
-
-/* button parameters */
-static int button1down = MB_NO;
-static int button2down = MB_NO;
-static int button3down = MB_NO;
-static int loc_x, loc_y;
-
-int	status;
-char	string[STRING_MAX];
-
-Cardinal  ac = 0;
-Arg       args[256];
-Boolean       argok;
-XmString  tmp0;
-
-/*--------------------------------------------------------------------*/
-/*      Function Name: 	BxManageCB
- *
- *      Description:   	Given a string of the form:
- *		       	"(WL)[widgetName, widgetName, ...]"
- *			BxManageCB attempts to convert the name to a Widget
- *			ID and manage the widget.
- *
- *      Arguments:     	Widget	    w:      the widget activating the callback.
- *		       	XtPointer   client: the list of widget names to attempt
- *					    to find and manage.
- *		       	XtPointer   call:   the call data (unused).
- *
- *      Notes:        *	This function expects that there is an application
- *		       	shell from which all other widgets are descended.
- */
-
-/* ARGSUSED */
-void
-BxManageCB ARGLIST((w, client, call))
-ARG( Widget, w)
-ARG( XtPointer, client)
-GRAU( XtPointer, call)
-{
-    WidgetList		widgets;
-    int			i;
-
-    /*
-     * This function returns a NULL terminated WidgetList.  The memory for
-     * the list needs to be freed when it is no longer needed.
-     */
-    widgets = BxWidgetIdsFromNames(w, "BxManageCB", (String)client);
-
-    i = 0;
-    while( widgets && widgets[i] != NULL )
-    {
-	XtManageChild(widgets[i]);
-	i++;
-    }
-    XtFree((char *)widgets);
-}
-
-/*--------------------------------------------------------------------*/
-/*      Function Name:	BxSetValuesCB
- *
- *      Description:   	This function accepts a string of the form:
- *			"widgetName.resourceName = value\n..."
- *			It then attempts to convert the widget name to a widget
- *			ID and the value to a valid resource value.  It then
- *			sets the value on the given widget.
- *
- *      Arguments:      Widget		w:	the activating widget.
- *			XtPointer	client:	the set values string.
- *			XtPointer	call:	the call data (unused).
- *
- *      Notes:        * This function expects that there is an application
- *                      shell from which all other widgets are descended.
- */
-#include <X11/StringDefs.h>
-
-/* ARGSUSED */
-void
-BxSetValuesCB ARGLIST((w, client, call))
-ARG( Widget, w)
-ARG( XtPointer, client)
-GRAU( XtPointer, call)
-{
-#define CHUNK	512
-
-    Boolean 	first = True;
-    String 	rscs = XtNewString((String)client);
-    String 	*valueList = (String *)XtCalloc(CHUNK, sizeof(String));
-    char 	*start;
-    char 	*ptr, *cptr;
-    String 	name;
-    String 	rsc;
-    int 	i, count = 0;
-    Widget 	*current;
-
-    for ( start = rscs; rscs && *rscs; rscs = strtok(NULL, "\n"))
-    {
-        if ( first )
-        {
-            rscs = strtok(rscs, "\n");
-            first = False;
-        }
-        valueList[count] = XtNewString(rscs);
-        count++;
-        if ( count == CHUNK )
-        {
-            valueList =
-		(String *)XtRealloc((char *)valueList,
-				    (count + CHUNK) * sizeof(String));
-        }
-    }
-    XtFree((char *)start);
-
-    for ( i = 0; i < count; i++ )
-    {
-	/*
-	 * First, extract the widget name and generate a string to
-	 * pass to BxWidgetIdsFromNames().
-	 */
-	cptr = strrchr(valueList[i], '.');
-	if ( cptr != NULL )
-	{
-	    *cptr = '\000';
-	}
-	else
-	{
-	    printf("Callback Error (BxSetValuesCB):\n\t\
-Syntax Error - specify BxSetValuesCB data as\n\t\
-    <Widget Name>.<Resource> = <Value>\n");
-	    XtFree((char *)(valueList[i]));
-	    continue;
-	}
-	name = valueList[i];
-	while( (name && *name) && isspace(*name) )
-	{
-	    name++;
-	}
-	ptr = name + strlen(name) - 1;
-	while( ptr && *ptr )
-	{
-            if ( isspace(*ptr) )
-            {
-                ptr--;
-            }
-            else
-            {
-                ptr++;
-                break;
-            }
-        }
-        if ( ptr && *ptr )
-        {
-            *ptr = '\0';
-        }
-	if ( ptr == NULL )
-	{
-	    printf("Callback Error (BxSetValuesCB):\n\t\
-Syntax Error - specify BxSetValuesCB data as\n\t\
-    <Widget Name>.<Resource> = <Value>\n");
-	    XtFree((char *)(valueList[i]));
-	    return;
-	}
-
-	/*
-	 * Next, get the resource name to set.
-	 */
-	rsc = ++cptr;
-	cptr = strchr(rsc, '=');
-	if ( cptr != NULL )
-	{
-	    *cptr = '\000';
-	}
-	else
-	{
-	    printf("Callback Error (BxSetValuesCB):\n\t\
-Syntax Error - specify BxSetValuesCB data as\n\t\
-    <Widget Name>.<Resource> = <Value>\n");
-	    XtFree((char *)(valueList[i]));
-	    continue;
-	}
-        while( (rsc && *rsc) && isspace(*rsc) )
-        {
-            rsc++;
-        }
-
-        ptr = rsc + strlen(rsc) - 1;
-        while( ptr && *ptr )
-        {
-            if ( isspace(*ptr) )
-            {
-                ptr--;
-            }
-            else
-            {
-                ptr++;
-                break;
-            }
-        }
-        if ( ptr && *ptr )
-        {
-            *ptr = '\0';
-        }
-
-	/*
-	 * Lastly, get the string value to which to set the resource.
-	 */
-	start = ++cptr;
-        while( (start && *start) && isspace(*start) )
-        {
-            start++;
-        }
-
-	if ( start == NULL )
-	{
-	    printf("Callback Error (BxSetValuesCB):\n\t\
-Syntax Error - specify BxSetValuesCB data as\n\t\
-    <Widget Name>.<Resource> = <Value>\n");
-	    XtFree((char *)(valueList[i]));
-	    return;
-	}
-
-        ptr = start + strlen(start) - 1;
-        while( ptr && *ptr )
-        {
-            if ( isspace(*ptr) )
-            {
-                ptr--;
-            }
-            else
-            {
-                ptr++;
-                break;
-            }
-        }
-        if ( ptr && *ptr )
-        {
-            *ptr = '\0';
-        }
-
-	/*
-	 * Now convert the widget name to a Widget ID
-	 */
-	current = BxWidgetIdsFromNames(w, "BxSetValuesCB", name);
-        if ( current[0] == NULL )
-        {
-	    XtFree((char *)(valueList[i]));
-	    continue;
-        }
-
-	/*
-	 * If the widget name conversion succeeded, we now need to get the
-	 * resource list for the widget so that we can do a resource conversion
-	 * of the value.
-	 */
-	XtVaSetValues(*current, XtVaTypedArg, rsc, XtRString, start,
-		      strlen(start)+1, NULL);
-        XtFree((char *)(valueList[i]));
-    }
-    XtFree((char *)valueList);
-
-#undef CHUNK
-}
-
-/*--------------------------------------------------------------------*/
-/*      Function Name: 	BxUnmanageCB
- *
- *      Description:   	Given a string of the form:
- *		       	"(WL)[widgetName, widgetName, ...]"
- *			BxUnmanageCB attempts to convert the name to a Widget
- *			ID and unmanage the widget.
- *
- *      Arguments:     	Widget	    w:      the widget activating the callback.
- *		       	XtPointer   client: the list of widget names to attempt
- *					    to find and unmanage.
- *		       	XtPointer   call:   the call data (unused).
- *
- *      Notes:        *	This function expects that there is an application
- *		       	shell from which all other widgets are descended.
- */
-
-/* ARGSUSED */
-void
-BxUnmanageCB ARGLIST((w, client, call))
-ARG( Widget, w)
-ARG( XtPointer, client)
-GRAU( XtPointer, call)
-{
-    WidgetList		widgets;
-    int			i;
-
-    /*
-     * This function returns a NULL terminated WidgetList.  The memory for
-     * the list needs to be freed when it is no longer needed.
-     */
-    widgets = BxWidgetIdsFromNames(w, "BxUnmanageCB", (String)client);
-
-    i = 0;
-    while( widgets && widgets[i] != NULL )
-    {
-	XtUnmanageChild(widgets[i]);
-	i++;
-    }
-    XtFree((char *)widgets);
-}
-
-/*--------------------------------------------------------------------*/
-/*      Function Name:	BxExitCB
- *
- *      Description:   	This functions expects an integer to be passed in
- *		       	client data.  It calls the exit() system call with
- *			the integer value as the argument to the function.
- *
- *      Arguments:      Widget		w: 	the activating widget.
- *			XtPointer	client:	the integer exit value.
- *			XtPointer	call:	the call data (unused).
- */
-
-#ifdef VMS
-#include <stdlib.h>
-#endif
-
-/* ARGSUSED */
-void
-BxExitCB ARGLIST((w, client, call))
-UARG( Widget, w)
-ARG( XtPointer, client)
-GRAU( XtPointer, call)
-{
-    long	exitValue = EXIT_FAILURE;
-    exit(exitValue);
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_mbnavadjust_init(int argc, char **argv)
-{
-    int	    i,j;
-    String translations =
-	    "<Btn1Down>:	DrawingAreaInput() ManagerGadgetArm() \n\
-	     <Btn1Up>:		DrawingAreaInput() ManagerGadgetActivate() \n\
-	     <Btn1Motion>:	DrawingAreaInput() ManagerGadgetButtonMotion() \n\
-	     <Btn2Down>:	DrawingAreaInput() ManagerGadgetArm() \n\
-	     <Btn2Up>:		DrawingAreaInput() ManagerGadgetActivate() \n\
-	     <Btn2Motion>:	DrawingAreaInput() ManagerGadgetButtonMotion() \n\
-	     <Btn3Down>:	DrawingAreaInput() ManagerGadgetArm() \n\
-	     <Btn3Up>:		DrawingAreaInput() ManagerGadgetActivate() \n\
-	     <Btn3Motion>:	DrawingAreaInput() ManagerGadgetButtonMotion() \n\
-	     <KeyDown>:		DrawingAreaInput() \n\
-	     <KeyUp>:		DrawingAreaInput() ManagerGadgetKeyInput()";
-
-    /* get additional widgets */
-    fileSelectionBox_list = (Widget)
-	XmFileSelectionBoxGetChild(fileSelectionBox,
-				    XmDIALOG_LIST);
-    fileSelectionBox_text = (Widget)
-	XmFileSelectionBoxGetChild(fileSelectionBox,
-				    XmDIALOG_TEXT);
-    XtAddCallback(fileSelectionBox_list,
-	    XmNbrowseSelectionCallback,
-	    do_fileselection_list, NULL);
-
-    XtUnmanageChild(
-	    (Widget) XmFileSelectionBoxGetChild(
-				    fileSelectionBox,
-				    XmDIALOG_HELP_BUTTON));
-    ac = 0;
-    tmp0 = (XmString) BX_CONVERT(fileSelectionBox, "*.nvh",
-                                          XmRXmString, 0, &argok);
-    XtSetArg(args[ac], XmNpattern, tmp0); ac++;
-    XtSetValues(fileSelectionBox, args, ac);
-    XmStringFree((XmString)tmp0);
-
-    /* reset translation table for drawingArea widgets */
-    XtVaSetValues(drawingArea_naverr_cont,
-			XmNtranslations, XtParseTranslationTable(translations),
-			NULL);
-    XtVaSetValues(drawingArea_naverr_corr,
-			XmNtranslations, XtParseTranslationTable(translations),
-			NULL);
-    XtVaSetValues(drawingArea_naverr_zcorr,
-			XmNtranslations, XtParseTranslationTable(translations),
-			NULL);
-    XtVaSetValues(drawingArea_modelplot,
-			XmNtranslations, XtParseTranslationTable(translations),
-			NULL);
-
-    /* add resize event handler to modelplot */
-    XtAddEventHandler(bulletinBoard_modelplot,
-			StructureNotifyMask,
-			False,
-			do_modelplot_resize,
-			(XtPointer)0);
-
-    /* Setup the entire screen. */
-    display = XtDisplay(form_mbnavadjust);
-    colormap = DefaultColormap(display,XDefaultScreen(display));
-
-    /* Load the colors that will be used in this program. */
-    status = XLookupColor(display,colormap, "white",&db_color,&colors[0]);
-    if ((status = XAllocColor(display,colormap,&colors[0])) == 0)
-	    fprintf(stderr,"Failure to allocate color: white\n");
-    status = XLookupColor(display,colormap, "black",&db_color,&colors[1]);
-    if ((status = XAllocColor(display,colormap,&colors[1])) == 0)
-	    fprintf(stderr,"Failure to allocate color: black\n");
-    status = XLookupColor(display,colormap, "red",&db_color,&colors[2]);
-    if ((status = XAllocColor(display,colormap,&colors[2])) == 0)
-	    fprintf(stderr,"Failure to allocate color: red\n");
-    status = XLookupColor(display,colormap, "green",&db_color,&colors[3]);
-    if ((status = XAllocColor(display,colormap,&colors[3])) == 0)
-	    fprintf(stderr,"Failure to allocate color: green\n");
-    status = XLookupColor(display,colormap, "blue",&db_color,&colors[4]);
-    if ((status = XAllocColor(display,colormap,&colors[4])) == 0)
-	    fprintf(stderr,"Failure to allocate color: blue\n");
-    status = XLookupColor(display,colormap, "coral",&db_color,&colors[5]);
-    if ((status = XAllocColor(display,colormap,&colors[5])) == 0)
-	    fprintf(stderr,"Failure to allocate color: coral\n");
-    status = XLookupColor(display,colormap, "yellow",&db_color,&colors[6]);
-    if ((status = XAllocColor(display,colormap,&colors[6])) == 0)
-	    fprintf(stderr,"Failure to allocate color: yellow\n");
-    j = 7;
-    for (i=0;i<16;i++)
-    	    {
-    	    colors[j+i].red = 65535;
-    	    /* colors[j+i].green = i * 4096; */
-    	    colors[j+i].green = i * 2048;
-    	    colors[j+i].blue = 0;
-	    status = XAllocColor(display,colormap,&colors[j+i]);
-            if (status == 0)
-	    	{
-	    	fprintf(stderr,"Failure to allocate color[%d]: %d %d %d\n",
-	    		j+i,colors[j+i].red,
-	    		colors[j+i].green,
-	    		colors[j+i].blue);
-	    	}
-    	    }
-    j += 16;
-    for (i=0;i<16;i++)
-    	    {
-    	    colors[j+i].red = 65535 - i * 4096;
-    	    /* colors[j+i].green = 65535; */
-    	    colors[j+i].green = 32767 + i * 2048;
-    	    colors[j+i].blue = 0;
-	    status = XAllocColor(display,colormap,&colors[j+i]);
-            if (status == 0)
-	    	{
-	    	fprintf(stderr,"Failure to allocate color[%d]: %d %d %d\n",
-	    		j+i,colors[j+i].red,
-	    		colors[j+i].green,
-	    		colors[j+i].blue);
-	    	}
-    	    }
-    j += 16;
-    for (i=0;i<16;i++)
-    	    {
-    	    colors[j+i].red = 0;
-    	    colors[j+i].green = 65535;
-    	    colors[j+i].blue = i * 4096;
-	    status = XAllocColor(display,colormap,&colors[j+i]);
-            if (status == 0)
-	    	{
-	    	fprintf(stderr,"Failure to allocate color[%d]: %d %d %d\n",
-	    		j+i,colors[j+i].red,
-	    		colors[j+i].green,
-	    		colors[j+i].blue);
-	    	}
-    	    }
-    j += 16;
-    for (i=0;i<16;i++)
-    	    {
-    	    colors[j+i].red = 0;
-    	    colors[j+i].green = 65535 - i * 4096;
-    	    colors[j+i].blue = 65535;
-	    status = XAllocColor(display,colormap,&colors[j+i]);
-            if (status == 0)
-	    	{
-	    	fprintf(stderr,"Failure to allocate color[%d]: %d %d %d\n",
-	    		j+i,colors[j+i].red,
-	    		colors[j+i].green,
-	    		colors[j+i].blue);
-	    	}
-    	    }
-    j += 16;
-    for (i=0;i<16;i++)
-    	    {
-    	    colors[j+i].red = i * 4096;
-    	    colors[j+i].green = 0;
-    	    colors[j+i].blue = 65535;
-	    status = XAllocColor(display,colormap,&colors[j+i]);
-            if (status == 0)
-	    	{
-	    	fprintf(stderr,"Failure to allocate color[%d]: %d %d %d\n",
-	    		j+i,colors[j+i].red,
-	    		colors[j+i].green,
-	    		colors[j+i].blue);
-	    	}
-    	    }
-    j += 16;
-    colors[j].red = 65535;
-    colors[j].green = 0;
-    colors[j].blue = 65535;
-    status = XAllocColor(display,colormap,&colors[j]);
-    if (status == 0)
-	{
-	fprintf(stderr,"Failure to allocate color[%d]: %d %d %d\n",
-	    		j,colors[j].red,
-	    		colors[j].green,
-	    		colors[j].blue);
-	}
-    for (i=0;i<NCOLORS;i++)
-	    {
-	    mpixel_values[i] = colors[i].pixel;
-	    }
-    status = mbnavadjust_set_colors(NCOLORS, (int *) mpixel_values);
-    status = mbnavadjust_set_borders(cont_borders, corr_borders, zoff_borders);
-
-    /* set verbose */
-    mbna_verbose = 0;
-
-    /* put up info text */
-    sprintf(string, "Program MBnavadjust initialized.\nMB-System Release %s %s\n",
-		MB_VERSION, MB_BUILD_DATE);
-    do_info_add(string, MB_YES);
-
-    /* initialize mbnavadjust proper */
-    status = mbnavadjust_init_globals();
-    status = mbnavadjust_init(argc,argv);
-    do_set_controls();
-    do_update_status();
-}
-
-/*--------------------------------------------------------------------*/
-
-void do_set_controls()
-{
-	char	value_text[128];
-
-	/* set about version label */
-	sprintf(value_text, ":::t\"MB-System Release %s\":t\"%s\"",
-		MB_VERSION, MB_BUILD_DATE);
-	set_label_multiline_string(label_about_version, value_text);
-
-	/* set value of format text item */
-	sprintf(string,"%2.2d",format);
-	XmTextFieldSetString(textField_format, string);
-
-	/* set model view style togglebuttons */
-	if (project.modelplot_style == MBNA_MODELPLOT_TIMESERIES)
-	    {
-	    XmToggleButtonSetState(toggleButton_modelplot_timeseries,
-			TRUE, TRUE);
-	    }
-	else if (project.modelplot_style == MBNA_MODELPLOT_PERTURBATION)
-	    {
-	    XmToggleButtonSetState(toggleButton_modelplot_perturbation,
-			TRUE, TRUE);
-	    }
-	else
-	    {
-	    XmToggleButtonSetState(toggleButton_modelplot_tieoffsets,
-			TRUE, TRUE);
-	    }
-
-}
-/*--------------------------------------------------------------------*/
-
-void do_update_status()
-{
-    	XmString *xstr;
-    	struct mbna_file *file;
-    	struct mbna_file *file2;
-	struct mbna_section *section;
-    	struct mbna_crossing *crossing;
-    	struct mbna_tie *tie;
-    	char	status_char;
-    	char	truecrossing;
-	int	iselect, ivalue, imax;
-	int	num_surveys, num_files, num_crossings, num_ties;
-	double	btime_d, etime_d;
-	int	btime_i[7], etime_i[7];
-	int	num_sections;
-	double	dr1, dr2, dr3;
-	double	dx, dy, dz;
-	char	*tiestatus;
-	char	*tiestatus_xyz = "XYZ";
-	char	*tiestatus_xy  = "XY ";
-	char	*tiestatus_z   = "  Z";
-	char	*filestatus;
-	char	*filestatus_poor    = " poor  ";
-	char	*filestatus_good    = " good  ";
-	char	*filestatus_fixed   = " fixed ";
-	char	*filestatus_fixedxy = "fixedxy";
-	char	*filestatus_fixedz  = "fixedz ";
-	char	*filestatus_unknown = "unknown";
-    	int	i, ii, j, k;
-
-	/* set status label */
-        sprintf(string,":::t\"Project: %s\":t\"Number of Files:                             %4d     Selected Survey:%4d\":t\"Number of Crossings Found:           %4d     Selected File:    %4d\":t\"Number of Crossings Analyzed:       %4d     Selected Section:%4d\":t\"Number of True Crossings:              %4d     Selected Crossing:%4d\":t\"Number of True Crossings Analyzed:%4d     Selected Tie:   %4d\":t\"Number of Ties Set:                         %d\"",
-                project.name,project.num_files,mbna_survey_select,
-		project.num_crossings,mbna_file_select,project.num_crossings_analyzed,mbna_section_select,
-		project.num_truecrossings,mbna_crossing_select,project.num_truecrossings_analyzed,mbna_tie_select,
-		project.num_ties);
-        if (project.inversion == MBNA_INVERSION_CURRENT)
-        	strcat(string,":t\"Inversion Performed:                       Current\"");
-        else if (project.inversion == MBNA_INVERSION_OLD)
-        	strcat(string,":t\"Inversion Performed:                       Out of Date\"");
-        else
-        	strcat(string,":t\"Inversion Performed:                       No\"");
-	set_label_multiline_string(label_status, string);
-	if (mbna_verbose > 0)
-		{
-        	sprintf(string,"Project:                                       %s\nNumber of Files:                           %d\nNumber of Crossings Found:         %d\nNumber of Crossings Analyzed:     %d\nNumber of True Crossings:        %d\nNumber of True Crossings Analyzed:%d\nNumber of Ties Set:                     %d\n",
-                	project.name,project.num_files,
-			project.num_crossings,project.num_crossings_analyzed,
-			project.num_truecrossings,project.num_truecrossings_analyzed,
-			project.num_ties);
-        	if (project.inversion == MBNA_INVERSION_CURRENT)
-        		strcat(string,"Inversion Performed:                    Current\n");
-        	else if (project.inversion == MBNA_INVERSION_OLD)
-        		strcat(string,"Inversion Performed:                    Out of Date\n");
-        	else
-        		strcat(string,"Inversion Performed:                    No\n");
-		fprintf(stderr,"%s", string);
-		}
-
-	/* set list_data */
-	iselect = MBNA_SELECT_NONE;
-	XmListDeleteAllItems(list_data);
-	if (mbna_view_list == MBNA_VIEW_LIST_SURVEYS)
-		{
-		sprintf(string, "Surveys:");
-		set_label_string(label_listdata,string);
-		if (mbna_verbose > 0)
-			fprintf(stderr,"%s\n",string);
-		if (project.num_files > 0)
-			{
-			/* count the number of surveys */
-			num_surveys = 0;
-			num_files = 0;
-			for (i=0;i<project.num_files;i++)
-				{
-				file = &(project.files[i]);
-				if (file->block == num_surveys)
-					{
-					num_surveys++;
-					num_files = 1;
-					}
-				else
-					num_files++;
-				}
-			xstr = (XmString *) malloc(num_surveys * sizeof(XmString));
-
-			/* generate list */
-			num_surveys = 0;
-			num_files = 0;
-			for (i=0;i<project.num_files;i++)
-				{
-				file = &(project.files[i]);
-
-				if (i == 0)
-					{
-					btime_d = file->sections[0].btime_d;
-					}
-				if (file->block == num_surveys)
-					{
-					/* find end time for this block */
-					num_files = 0;
-					btime_d = file->sections[0].etime_d;
-					for (ii=i;ii<project.num_files;ii++)
-						{
-						file2 = &(project.files[ii]);
-						if (file2->block == file->block)
-							{
-							etime_d = file2->sections[file2->num_sections-1].etime_d;
-							num_files++;
-							}
-						}
-
-					/* make survey list item */
-					if (file->status == MBNA_FILE_POORNAV)
-					    filestatus = filestatus_poor;
-					else if (file->status == MBNA_FILE_GOODNAV)
-					    filestatus = filestatus_good;
-					else if (file->status == MBNA_FILE_FIXEDNAV)
-					    filestatus = filestatus_fixed;
-					else if (file->status == MBNA_FILE_FIXEDXYNAV)
-					    filestatus = filestatus_fixedxy;
-					else if (file->status == MBNA_FILE_FIXEDZNAV)
-					    filestatus = filestatus_fixedz;
-					else
-					    filestatus = filestatus_unknown;
-					mb_get_date(mbna_verbose,btime_d,btime_i);
-					mb_get_date(mbna_verbose,etime_d,etime_i);
-				    	sprintf(string,"%2.2d %2.2d %4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d %4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d %s",
-					    num_surveys,num_files,
-					    btime_i[0],btime_i[1],btime_i[2],btime_i[3],btime_i[4],btime_i[5],btime_i[6],
-					    etime_i[0],etime_i[1],etime_i[2],etime_i[3],etime_i[4],etime_i[5],etime_i[6],
-					    filestatus);
-    					xstr[num_surveys] = XmStringCreateLocalized(string);
-					if (mbna_verbose > 0)
-						fprintf(stderr,"%s\n",string);
-
-					/* increment counter */
-					num_surveys++;
-					}
-				}
- 			XmListAddItems(list_data,xstr,num_surveys,0);
-			for (i=0;i<num_surveys;i++)
-				{
-    				XmStringFree(xstr[i]);
-    				}
-    			free(xstr);
-			}
-		if (mbna_survey_select != MBNA_SELECT_NONE)
-			{
-			XmListSelectPos(list_data,mbna_survey_select+1,0);
-			XmListSetPos(list_data,
-				MAX(mbna_survey_select+1-5, 1));
-			}
-		}
-	else if (mbna_view_list == MBNA_VIEW_LIST_FILES)
-		{
-		if (mbna_view_mode == MBNA_VIEW_MODE_ALL)
-			sprintf(string,"Data Files:");
-		else if (mbna_view_mode == MBNA_VIEW_MODE_SURVEY)
-			sprintf(string,"Data Files of Survey %d:",mbna_survey_select);
-		else if (mbna_view_mode == MBNA_VIEW_MODE_FILE)
-			sprintf(string,"Data File %d:%d:",mbna_survey_select,mbna_file_select);
-		else if (mbna_view_mode == MBNA_VIEW_MODE_WITHSURVEY)
-			sprintf(string,"Data Files of Survey %d:",mbna_survey_select);
-		else if (mbna_view_mode == MBNA_VIEW_MODE_WITHFILE)
-			sprintf(string,"Data File %d:%d:",mbna_survey_select,mbna_file_select);
-		else if (mbna_view_mode == MBNA_VIEW_MODE_WITHSECTION)
-			sprintf(string,"Data File of Selected Section %d:%d:%d:",mbna_survey_select,mbna_file_select,mbna_section_select);
-		else
-			sprintf(string,"Data Files:");
-		set_label_string(label_listdata,string);
-		if (mbna_verbose > 0)
-			fprintf(stderr,"%s\n",string);
-		if (project.num_files > 0)
-			{
-			/* count files */
-			num_files = 0;
-			for (i=0;i<project.num_files;i++)
-				{
-				file = &(project.files[i]);
-				if ((mbna_view_mode == MBNA_VIEW_MODE_ALL)
-					|| (mbna_view_mode == MBNA_VIEW_MODE_SURVEY && mbna_survey_select == file->block)
-					|| (mbna_view_mode == MBNA_VIEW_MODE_FILE && mbna_file_select == i)
-					|| (mbna_view_mode == MBNA_VIEW_MODE_WITHSURVEY && mbna_survey_select == file->block)
-					|| (mbna_view_mode == MBNA_VIEW_MODE_WITHFILE && mbna_file_select == i)
-					|| (mbna_view_mode == MBNA_VIEW_MODE_WITHSECTION && mbna_file_select == i))
-					num_files++;
-				}
-			xstr = (XmString *) malloc(project.num_files * sizeof(XmString));
-
-			/* generate list */
-			num_files = 0;
-			iselect = MBNA_SELECT_NONE;
-			for (i=0;i<project.num_files;i++)
-				{
-				file = &(project.files[i]);
-				if ((mbna_view_mode == MBNA_VIEW_MODE_ALL)
-					|| (mbna_view_mode == MBNA_VIEW_MODE_SURVEY && mbna_survey_select == file->block)
-					|| (mbna_view_mode == MBNA_VIEW_MODE_FILE && mbna_file_select == i)
-					|| (mbna_view_mode == MBNA_VIEW_MODE_WITHSURVEY && mbna_survey_select == file->block)
-					|| (mbna_view_mode == MBNA_VIEW_MODE_WITHFILE && mbna_file_select == i)
-					|| (mbna_view_mode == MBNA_VIEW_MODE_WITHSECTION && mbna_file_select == i))
-					{
-					if (file->status == MBNA_FILE_POORNAV)
-					    filestatus = filestatus_poor;
-					else if (file->status == MBNA_FILE_GOODNAV)
-					    filestatus = filestatus_good;
-					else if (file->status == MBNA_FILE_FIXEDNAV)
-					    filestatus = filestatus_fixed;
-					else if (file->status == MBNA_FILE_FIXEDXYNAV)
-					    filestatus = filestatus_fixedxy;
-					else if (file->status == MBNA_FILE_FIXEDZNAV)
-					    filestatus = filestatus_fixedz;
-					else
-					    filestatus = filestatus_unknown;
-					sprintf(string,"%4.4d:%2.2d %s %4d %4.1f %4.1f %s",
-						file->id,file->block,filestatus,file->num_sections,
-						file->heading_bias,file->roll_bias,
-						file->file);
-    					xstr[num_files] = XmStringCreateLocalized(string);
-					if (mbna_verbose > 0)
-						fprintf(stderr,"%s\n",string);
-					if (i == mbna_file_select)
-						iselect = num_files;
-					num_files++;
-					}
- 				}
-    			XmListAddItems(list_data,xstr,num_files,0);
-			for (i=0;i<num_files;i++)
-				{
-    				XmStringFree(xstr[i]);
-    				}
-    			free(xstr);
-			}
-		if (iselect != MBNA_SELECT_NONE)
-			{
-			XmListSelectPos(list_data,iselect+1,0);
-			XmListSetPos(list_data,
-				MAX(iselect+1-5, 1));
-			}
-		}
-	else if (mbna_view_list == MBNA_VIEW_LIST_FILESECTIONS)
-		{
-		if (mbna_view_mode == MBNA_VIEW_MODE_ALL)
-			sprintf(string,"Data File Sections:");
-		else if (mbna_view_mode == MBNA_VIEW_MODE_SURVEY)
-			sprintf(string,"Data File Sections of Survey %d:",mbna_survey_select);
-		else if (mbna_view_mode == MBNA_VIEW_MODE_FILE)
-			sprintf(string,"Data File Sections of File %d:%d:",mbna_survey_select,mbna_file_select);
-		else if (mbna_view_mode == MBNA_VIEW_MODE_WITHSURVEY)
-			sprintf(string,"Data File Sections of Survey %d:",mbna_survey_select);
-		else if (mbna_view_mode == MBNA_VIEW_MODE_WITHFILE)
-			sprintf(string,"Data File Sections of File %d:%d:",mbna_survey_select,mbna_file_select);
-		else if (mbna_view_mode == MBNA_VIEW_MODE_WITHSECTION)
-			sprintf(string,"Data File Sections of File %d:%d:",mbna_survey_select,mbna_file_select);
-		else
-			sprintf(string,"Data Files Sections:");
-		set_label_string(label_listdata,string);
-		if (mbna_verbose > 0)
-			fprintf(stderr,"%s\n",string);
-		if (project.num_files > 0)
-			{
-			/* count sections */
-			num_sections = 0;
-			for (i=0;i<project.num_files;i++)
-				{
-				file = &(project.files[i]);
-				for (j=0;j<file->num_sections;j++)
-					{
-					section = &(file->sections[j]);
-					if ((mbna_view_mode == MBNA_VIEW_MODE_ALL)
-						|| (mbna_view_mode == MBNA_VIEW_MODE_SURVEY && mbna_survey_select == file->block)
-						|| (mbna_view_mode == MBNA_VIEW_MODE_FILE && mbna_file_select == i)
-						|| (mbna_view_mode == MBNA_VIEW_MODE_WITHSURVEY && mbna_survey_select == file->block)
-						|| (mbna_view_mode == MBNA_VIEW_MODE_WITHFILE && mbna_file_select == i)
-						|| (mbna_view_mode == MBNA_VIEW_MODE_WITHSECTION && mbna_file_select == i))
-						{
-						num_sections++;
-						}
-					}
-				}
-			xstr = (XmString *) malloc(num_sections * sizeof(XmString));
-
-			/* generate list */
-			num_sections = 0;
-			iselect = MBNA_SELECT_NONE;
-			for (i=0;i<project.num_files;i++)
-			    	{
-			    	file = &(project.files[i]);
-				for (j=0;j<file->num_sections;j++)
-					{
-					section = &(file->sections[j]);
-					if ((mbna_view_mode == MBNA_VIEW_MODE_ALL)
-						|| (mbna_view_mode == MBNA_VIEW_MODE_SURVEY && mbna_survey_select == file->block)
-						|| (mbna_view_mode == MBNA_VIEW_MODE_FILE && mbna_file_select == i)
-						|| (mbna_view_mode == MBNA_VIEW_MODE_WITHSURVEY && mbna_survey_select == file->block)
-						|| (mbna_view_mode == MBNA_VIEW_MODE_WITHFILE && mbna_file_select == i)
-						|| (mbna_view_mode == MBNA_VIEW_MODE_WITHSECTION && mbna_file_select == i))
-						{
-						mb_get_date(mbna_verbose,section->btime_d,btime_i);
-						mb_get_date(mbna_verbose,section->etime_d,etime_i);
-						sprintf(string,"%2.2d:%4.4d:%2.2d %4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d %4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d",
-							    file->block,file->id,j,
-							    btime_i[0],btime_i[1],btime_i[2],btime_i[3],btime_i[4],btime_i[5],btime_i[6],
-							    etime_i[0],etime_i[1],etime_i[2],etime_i[3],etime_i[4],etime_i[5],etime_i[6]);
-						xstr[num_sections] = XmStringCreateLocalized(string);
-						if (mbna_verbose > 0)
-							fprintf(stderr,"%s\n",string);
-						if (i == mbna_file_select && j == mbna_section_select)
-							iselect = num_sections;
-						num_sections++;
-						}
-					}
-				}
-    			XmListAddItems(list_data,xstr,num_sections,0);
-			for (i=0;i<num_sections;i++)
-				{
-    				XmStringFree(xstr[i]);
-    				}
-    			free(xstr);
-			}
-		if (iselect != MBNA_SELECT_NONE)
-			{
-			XmListSelectPos(list_data,iselect+1,0);
-			XmListSetPos(list_data,
-				MAX(iselect+1-5, 1));
-			}
-		}
- 	else if (mbna_view_list == MBNA_VIEW_LIST_CROSSINGS)
-		{
-		if (mbna_view_mode == MBNA_VIEW_MODE_ALL)
-			sprintf(string,"Crossings:");
-		else if (mbna_view_mode == MBNA_VIEW_MODE_SURVEY)
-			sprintf(string,"Crossings of Survey %d:",mbna_survey_select);
-		else if (mbna_view_mode == MBNA_VIEW_MODE_FILE)
-			sprintf(string,"Crossings of File %d:%d:",mbna_survey_select,mbna_file_select);
-		else if (mbna_view_mode == MBNA_VIEW_MODE_WITHSURVEY)
-			sprintf(string,"Crossings with Survey %d:",mbna_survey_select);
-		else if (mbna_view_mode == MBNA_VIEW_MODE_WITHFILE)
-			sprintf(string,"Crossings with File %d:%d:",mbna_survey_select,mbna_file_select);
-		else if (mbna_view_mode == MBNA_VIEW_MODE_WITHSECTION)
-			sprintf(string,"Crossings with Section %d:%d:%d:",mbna_survey_select,mbna_file_select,mbna_section_select);
-		else
-			sprintf(string,"Crossings:");
-		set_label_string(label_listdata,string);
-		if (mbna_verbose > 0)
-			fprintf(stderr,"%s\n",string);
-		if (project.num_files > 0)
-			{
-			/* count crossings */
-			num_crossings = 0;
-			for (i=0;i<project.num_crossings;i++)
-				{
-				crossing = &(project.crossings[i]);
-				if ((mbna_view_mode == MBNA_VIEW_MODE_ALL)
-					|| (mbna_view_mode == MBNA_VIEW_MODE_SURVEY
-						&& mbna_survey_select == project.files[crossing->file_id_1].block
-						&& mbna_survey_select == project.files[crossing->file_id_2].block)
-					|| (mbna_view_mode == MBNA_VIEW_MODE_FILE
-						&& mbna_file_select == crossing->file_id_1
-						&& mbna_file_select == crossing->file_id_2)
-					|| (mbna_view_mode == MBNA_VIEW_MODE_WITHSURVEY
-						&& (mbna_survey_select == project.files[crossing->file_id_1].block
-							|| mbna_survey_select == project.files[crossing->file_id_2].block))
-					|| (mbna_view_mode == MBNA_VIEW_MODE_WITHFILE
-						&& (mbna_file_select == crossing->file_id_1
-							|| mbna_file_select == crossing->file_id_2))
-					|| (mbna_view_mode == MBNA_VIEW_MODE_WITHSECTION
-						&& mbna_file_select == crossing->file_id_1
-						&& mbna_section_select == crossing->section_1)
-					|| (mbna_view_mode == MBNA_VIEW_MODE_WITHSECTION
-						&& mbna_file_select == crossing->file_id_2
-						&& mbna_section_select == crossing->section_2))
-					num_crossings++;
-				}
-			xstr = (XmString *) malloc(num_crossings * sizeof(XmString));
-
-			/* generate list */
-			num_crossings = 0;
-			iselect = MBNA_SELECT_NONE;
-			for (i=0;i<project.num_crossings;i++)
-				{
-				crossing = &(project.crossings[i]);
-				if ((mbna_view_mode == MBNA_VIEW_MODE_ALL)
-					|| (mbna_view_mode == MBNA_VIEW_MODE_SURVEY
-						&& mbna_survey_select == project.files[crossing->file_id_1].block
-						&& mbna_survey_select == project.files[crossing->file_id_2].block)
-					|| (mbna_view_mode == MBNA_VIEW_MODE_FILE
-						&& mbna_file_select == crossing->file_id_1
-						&& mbna_file_select == crossing->file_id_2)
-					|| (mbna_view_mode == MBNA_VIEW_MODE_WITHSURVEY
-						&& (mbna_survey_select == project.files[crossing->file_id_1].block
-							|| mbna_survey_select == project.files[crossing->file_id_2].block))
-					|| (mbna_view_mode == MBNA_VIEW_MODE_WITHFILE
-						&& (mbna_file_select == crossing->file_id_1
-							|| mbna_file_select == crossing->file_id_2))
-					|| (mbna_view_mode == MBNA_VIEW_MODE_WITHSECTION
-						&& mbna_file_select == crossing->file_id_1
-						&& mbna_section_select == crossing->section_1)
-					|| (mbna_view_mode == MBNA_VIEW_MODE_WITHSECTION
-						&& mbna_file_select == crossing->file_id_2
-						&& mbna_section_select == crossing->section_2))
-					{
-					if (crossing->status == MBNA_CROSSING_STATUS_NONE)
-						status_char = 'U';
-					else if (crossing->status == MBNA_CROSSING_STATUS_SET)
-						status_char = '*';
-					else
-						status_char = '-';
-					if (crossing->truecrossing == MB_NO)
-						truecrossing = ' ';
-					else
-						truecrossing = 'X';
-					sprintf(string,"%c%c %4d %2.2d:%3.3d:%3.3d %2.2d:%3.3d:%3.3d %3d %2d",
-						status_char, truecrossing, i,
-						project.files[crossing->file_id_1].block,
-						crossing->file_id_1,
-						crossing->section_1,
-						project.files[crossing->file_id_2].block,
-						crossing->file_id_2,
-						crossing->section_2,
-						crossing->overlap,
-						crossing->num_ties);
-    					xstr[num_crossings] = XmStringCreateLocalized(string);
-					if (mbna_verbose > 0)
-						fprintf(stderr,"%s\n",string);
-					if (i == mbna_crossing_select)
-						iselect = num_crossings;
-					num_crossings++;
-					}
-				}
-    			XmListAddItems(list_data,xstr,num_crossings,0);
-			for (i=0;i<num_crossings;i++)
-				{
-    				XmStringFree(xstr[i]);
-    				}
-    			free(xstr);
-			}
-		if (iselect != MBNA_SELECT_NONE)
-			{
-			XmListSelectPos(list_data,iselect+1,0);
-			XmListSetPos(list_data,
-				MAX(iselect+1-5, 1));
-			}
-		}
- 	else if (mbna_view_list == MBNA_VIEW_LIST_MEDIOCRECROSSINGS)
-		{
-		if (mbna_view_mode == MBNA_VIEW_MODE_ALL)
-			sprintf(string,">10%% Overlap Crossings:");
-		else if (mbna_view_mode == MBNA_VIEW_MODE_SURVEY)
-			sprintf(string,">10%% Overlap Crossings of Survey %d:",mbna_survey_select);
-		else if (mbna_view_mode == MBNA_VIEW_MODE_FILE)
-			sprintf(string,">10%% Overlap Crossings of File %d:%d:",mbna_survey_select,mbna_file_select);
-		else if (mbna_view_mode == MBNA_VIEW_MODE_WITHSURVEY)
-			sprintf(string,">10%% Overlap Crossings with Survey %d:",mbna_survey_select);
-		else if (mbna_view_mode == MBNA_VIEW_MODE_WITHFILE)
-			sprintf(string,">10%% Overlap Crossings with File %d:%d:",mbna_survey_select,mbna_file_select);
-		else if (mbna_view_mode == MBNA_VIEW_MODE_WITHSECTION)
-			sprintf(string,">10%% Overlap Crossings with Section %d:%d:%d:",mbna_survey_select,mbna_file_select,mbna_section_select);
-		else
-			sprintf(string,">10%% Overlap Crossings:");
-		set_label_string(label_listdata,string);
-		if (mbna_verbose > 0)
-			fprintf(stderr,"%s\n",string);
-		if (project.num_files > 0)
-			{
-			/* count crossings */
-			num_crossings = 0;
-			for (i=0;i<project.num_crossings;i++)
-				{
-				crossing = &(project.crossings[i]);
-				if (crossing->overlap >= MBNA_MEDIOCREOVERLAP_THRESHOLD
-					&& ((mbna_view_mode == MBNA_VIEW_MODE_ALL)
-						|| (mbna_view_mode == MBNA_VIEW_MODE_SURVEY
-							&& mbna_survey_select == project.files[crossing->file_id_1].block
-							&& mbna_survey_select == project.files[crossing->file_id_2].block)
-						|| (mbna_view_mode == MBNA_VIEW_MODE_FILE
-							&& mbna_file_select == crossing->file_id_1
-							&& mbna_file_select == crossing->file_id_2)
-						|| (mbna_view_mode == MBNA_VIEW_MODE_WITHSURVEY
-							&& (mbna_survey_select == project.files[crossing->file_id_1].block
-								|| mbna_survey_select == project.files[crossing->file_id_2].block))
-						|| (mbna_view_mode == MBNA_VIEW_MODE_WITHFILE
-							&& (mbna_file_select == crossing->file_id_1
-								|| mbna_file_select == crossing->file_id_2))
-						|| (mbna_view_mode == MBNA_VIEW_MODE_WITHSECTION
-							&& mbna_file_select == crossing->file_id_1
-							&& mbna_section_select == crossing->section_1)
-						|| (mbna_view_mode == MBNA_VIEW_MODE_WITHSECTION
-							&& mbna_file_select == crossing->file_id_2
-							&& mbna_section_select == crossing->section_2)))
-					num_crossings++;
-				}
-			xstr = (XmString *) malloc(num_crossings * sizeof(XmString));
-
-			/* generate list */
-			num_crossings = 0;
-			iselect = MBNA_SELECT_NONE;
-			for (i=0;i<project.num_crossings;i++)
-				{
-				crossing = &(project.crossings[i]);
-				if (crossing->overlap >= MBNA_MEDIOCREOVERLAP_THRESHOLD
-					&& ((mbna_view_mode == MBNA_VIEW_MODE_ALL)
-						|| (mbna_view_mode == MBNA_VIEW_MODE_SURVEY
-							&& mbna_survey_select == project.files[crossing->file_id_1].block
-							&& mbna_survey_select == project.files[crossing->file_id_2].block)
-						|| (mbna_view_mode == MBNA_VIEW_MODE_FILE
-							&& mbna_file_select == crossing->file_id_1
-							&& mbna_file_select == crossing->file_id_2)
-						|| (mbna_view_mode == MBNA_VIEW_MODE_WITHSURVEY
-							&& (mbna_survey_select == project.files[crossing->file_id_1].block
-								|| mbna_survey_select == project.files[crossing->file_id_2].block))
-						|| (mbna_view_mode == MBNA_VIEW_MODE_WITHFILE
-							&& (mbna_file_select == crossing->file_id_1
-								|| mbna_file_select == crossing->file_id_2))
-						|| (mbna_view_mode == MBNA_VIEW_MODE_WITHSECTION
-							&& mbna_file_select == crossing->file_id_1
-							&& mbna_section_select == crossing->section_1)
-						|| (mbna_view_mode == MBNA_VIEW_MODE_WITHSECTION
-							&& mbna_file_select == crossing->file_id_2
-							&& mbna_section_select == crossing->section_2)))
-					{
-					if (crossing->status == MBNA_CROSSING_STATUS_NONE)
-						status_char = 'U';
-					else if (crossing->status == MBNA_CROSSING_STATUS_SET)
-						status_char = '*';
-					else
-						status_char = '-';
-					if (crossing->truecrossing == MB_NO)
-						truecrossing = ' ';
-					else
-						truecrossing = 'X';
-					sprintf(string,"%c%c %4d %2.2d:%3.3d:%3.3d %2.2d:%3.3d:%3.3d %3d %2d",
-						status_char, truecrossing, i,
-						project.files[crossing->file_id_1].block,
-						crossing->file_id_1,
-						crossing->section_1,
-						project.files[crossing->file_id_2].block,
-						crossing->file_id_2,
-						crossing->section_2,
-						crossing->overlap,
-						crossing->num_ties);
-    					xstr[num_crossings] = XmStringCreateLocalized(string);
-					if (mbna_verbose > 0)
-						fprintf(stderr,"%s\n",string);
-					if (i == mbna_crossing_select)
-						iselect = num_crossings;
-					num_crossings++;
-					}
-				}
-    			XmListAddItems(list_data,xstr,num_crossings,0);
-			for (i=0;i<num_crossings;i++)
-				{
-    				XmStringFree(xstr[i]);
-    				}
-    			free(xstr);
-			}
-		if (iselect != MBNA_SELECT_NONE)
-			{
-			XmListSelectPos(list_data,iselect+1,0);
-			XmListSetPos(list_data,
-				MAX(iselect+1-5, 1));
-			}
-		}
- 	else if (mbna_view_list == MBNA_VIEW_LIST_GOODCROSSINGS)
-		{
-		if (mbna_view_mode == MBNA_VIEW_MODE_ALL)
-			sprintf(string,">25%% Overlap Crossings:");
-		else if (mbna_view_mode == MBNA_VIEW_MODE_SURVEY)
-			sprintf(string,">25%% Overlap Crossings of Survey %d:",mbna_survey_select);
-		else if (mbna_view_mode == MBNA_VIEW_MODE_FILE)
-			sprintf(string,">25%% Overlap Crossings of File %d:%d:",mbna_survey_select,mbna_file_select);
-		else if (mbna_view_mode == MBNA_VIEW_MODE_WITHSURVEY)
-			sprintf(string,">25%% Overlap Crossings with Survey %d:",mbna_survey_select);
-		else if (mbna_view_mode == MBNA_VIEW_MODE_WITHFILE)
-			sprintf(string,">25%% Overlap Crossings with File %d:%d:",mbna_survey_select,mbna_file_select);
-		else if (mbna_view_mode == MBNA_VIEW_MODE_WITHSECTION)
-			sprintf(string,">25%% Overlap Crossings with Section %d:%d:%d:",mbna_survey_select,mbna_file_select,mbna_section_select);
-		else
-			sprintf(string,">25%% Overlap Crossings:");
-		set_label_string(label_listdata,string);
-		if (mbna_verbose > 0)
-			fprintf(stderr,"%s\n",string);
-		if (project.num_files > 0)
-			{
-			/* count crossings */
-			num_crossings = 0;
-			for (i=0;i<project.num_crossings;i++)
-				{
-				crossing = &(project.crossings[i]);
-				if (crossing->overlap >= MBNA_GOODOVERLAP_THRESHOLD
-					&& ((mbna_view_mode == MBNA_VIEW_MODE_ALL)
-						|| (mbna_view_mode == MBNA_VIEW_MODE_SURVEY
-							&& mbna_survey_select == project.files[crossing->file_id_1].block
-							&& mbna_survey_select == project.files[crossing->file_id_2].block)
-						|| (mbna_view_mode == MBNA_VIEW_MODE_FILE
-							&& mbna_file_select == crossing->file_id_1
-							&& mbna_file_select == crossing->file_id_2)
-						|| (mbna_view_mode == MBNA_VIEW_MODE_WITHSURVEY
-							&& (mbna_survey_select == project.files[crossing->file_id_1].block
-								|| mbna_survey_select == project.files[crossing->file_id_2].block))
-						|| (mbna_view_mode == MBNA_VIEW_MODE_WITHFILE
-							&& (mbna_file_select == crossing->file_id_1
-								|| mbna_file_select == crossing->file_id_2))
-						|| (mbna_view_mode == MBNA_VIEW_MODE_WITHSECTION
-							&& mbna_file_select == crossing->file_id_1
-							&& mbna_section_select == crossing->section_1)
-						|| (mbna_view_mode == MBNA_VIEW_MODE_WITHSECTION
-							&& mbna_file_select == crossing->file_id_2
-							&& mbna_section_select == crossing->section_2)))
-					num_crossings++;
-				}
-			xstr = (XmString *) malloc(num_crossings * sizeof(XmString));
-
-			/* generate list */
-			num_crossings = 0;
-			iselect = MBNA_SELECT_NONE;
-			for (i=0;i<project.num_crossings;i++)
-				{
-				crossing = &(project.crossings[i]);
-				if (crossing->overlap >= MBNA_GOODOVERLAP_THRESHOLD
-					&& ((mbna_view_mode == MBNA_VIEW_MODE_ALL)
-						|| (mbna_view_mode == MBNA_VIEW_MODE_SURVEY
-							&& mbna_survey_select == project.files[crossing->file_id_1].block
-							&& mbna_survey_select == project.files[crossing->file_id_2].block)
-						|| (mbna_view_mode == MBNA_VIEW_MODE_FILE
-							&& mbna_file_select == crossing->file_id_1
-							&& mbna_file_select == crossing->file_id_2)
-						|| (mbna_view_mode == MBNA_VIEW_MODE_WITHSURVEY
-							&& (mbna_survey_select == project.files[crossing->file_id_1].block
-								|| mbna_survey_select == project.files[crossing->file_id_2].block))
-						|| (mbna_view_mode == MBNA_VIEW_MODE_WITHFILE
-							&& (mbna_file_select == crossing->file_id_1
-								|| mbna_file_select == crossing->file_id_2))
-						|| (mbna_view_mode == MBNA_VIEW_MODE_WITHSECTION
-							&& mbna_file_select == crossing->file_id_1
-							&& mbna_section_select == crossing->section_1)
-						|| (mbna_view_mode == MBNA_VIEW_MODE_WITHSECTION
-							&& mbna_file_select == crossing->file_id_2
-							&& mbna_section_select == crossing->section_2)))
-					{
-					if (crossing->status == MBNA_CROSSING_STATUS_NONE)
-						status_char = 'U';
-					else if (crossing->status == MBNA_CROSSING_STATUS_SET)
-						status_char = '*';
-					else
-						status_char = '-';
-					if (crossing->truecrossing == MB_NO)
-						truecrossing = ' ';
-					else
-						truecrossing = 'X';
-					sprintf(string,"%c%c %4d %2.2d:%3.3d:%3.3d %2.2d:%3.3d:%3.3d %3d %2d",
-						status_char, truecrossing, i,
-						project.files[crossing->file_id_1].block,
-						crossing->file_id_1,
-						crossing->section_1,
-						project.files[crossing->file_id_2].block,
-						crossing->file_id_2,
-						crossing->section_2,
-						crossing->overlap,
-						crossing->num_ties);
-    					xstr[num_crossings] = XmStringCreateLocalized(string);
-					if (mbna_verbose > 0)
-						fprintf(stderr,"%s\n",string);
-					if (i == mbna_crossing_select)
-						iselect = num_crossings;
-					num_crossings++;
-					}
-				}
-    			XmListAddItems(list_data,xstr,num_crossings,0);
-			for (i=0;i<num_crossings;i++)
-				{
-    				XmStringFree(xstr[i]);
-    				}
-    			free(xstr);
-			}
-		if (iselect != MBNA_SELECT_NONE)
-			{
-			XmListSelectPos(list_data,iselect+1,0);
-			XmListSetPos(list_data,
-				MAX(iselect+1-5, 1));
-			}
-		}
- 	else if (mbna_view_list == MBNA_VIEW_LIST_BETTERCROSSINGS)
-		{
-		if (mbna_view_mode == MBNA_VIEW_MODE_ALL)
-			sprintf(string,">50%% Crossings:");
-		else if (mbna_view_mode == MBNA_VIEW_MODE_SURVEY)
-			sprintf(string,">50%% Crossings of Survey %d:",mbna_survey_select);
-		else if (mbna_view_mode == MBNA_VIEW_MODE_FILE)
-			sprintf(string,">50%% Crossings of File %d:%d:",mbna_survey_select,mbna_file_select);
-		else if (mbna_view_mode == MBNA_VIEW_MODE_WITHSURVEY)
-			sprintf(string,">50%% Overlap Crossings with Survey %d:",mbna_survey_select);
-		else if (mbna_view_mode == MBNA_VIEW_MODE_WITHFILE)
-			sprintf(string,">50%% Overlap Crossings with File %d:%d:",mbna_survey_select,mbna_file_select);
-		else if (mbna_view_mode == MBNA_VIEW_MODE_WITHSECTION)
-			sprintf(string,">50%% Overlap Crossings with Section %d:%d:%d:",mbna_survey_select,mbna_file_select,mbna_section_select);
-		else
-			sprintf(string,">50%% Crossings:");
-		set_label_string(label_listdata,string);
-		if (mbna_verbose > 0)
-			fprintf(stderr,"%s\n",string);
-		if (project.num_files > 0)
-			{
-			/* count crossings */
-			num_crossings = 0;
-			for (i=0;i<project.num_crossings;i++)
-				{
-				crossing = &(project.crossings[i]);
-				if (crossing->overlap >= MBNA_BETTEROVERLAP_THRESHOLD
-					&& ((mbna_view_mode == MBNA_VIEW_MODE_ALL)
-						|| (mbna_view_mode == MBNA_VIEW_MODE_SURVEY
-							&& mbna_survey_select == project.files[crossing->file_id_1].block
-							&& mbna_survey_select == project.files[crossing->file_id_2].block)
-						|| (mbna_view_mode == MBNA_VIEW_MODE_FILE
-							&& mbna_file_select == crossing->file_id_1
-							&& mbna_file_select == crossing->file_id_2)
-						|| (mbna_view_mode == MBNA_VIEW_MODE_WITHSURVEY
-							&& (mbna_survey_select == project.files[crossing->file_id_1].block
-								|| mbna_survey_select == project.files[crossing->file_id_2].block))
-						|| (mbna_view_mode == MBNA_VIEW_MODE_WITHFILE
-							&& (mbna_file_select == crossing->file_id_1
-								|| mbna_file_select == crossing->file_id_2))
-						|| (mbna_view_mode == MBNA_VIEW_MODE_WITHSECTION
-							&& mbna_file_select == crossing->file_id_1
-							&& mbna_section_select == crossing->section_1)
-						|| (mbna_view_mode == MBNA_VIEW_MODE_WITHSECTION
-							&& mbna_file_select == crossing->file_id_2
-							&& mbna_section_select == crossing->section_2)))
-					num_crossings++;
-				}
-			xstr = (XmString *) malloc(num_crossings * sizeof(XmString));
-
-			/* generate list */
-			num_crossings = 0;
-			iselect = MBNA_SELECT_NONE;
-			for (i=0;i<project.num_crossings;i++)
-				{
-				crossing = &(project.crossings[i]);
-				if (crossing->overlap >= MBNA_BETTEROVERLAP_THRESHOLD
-					&& ((mbna_view_mode == MBNA_VIEW_MODE_ALL)
-						|| (mbna_view_mode == MBNA_VIEW_MODE_SURVEY
-							&& mbna_survey_select == project.files[crossing->file_id_1].block
-							&& mbna_survey_select == project.files[crossing->file_id_2].block)
-						|| (mbna_view_mode == MBNA_VIEW_MODE_FILE
-							&& mbna_file_select == crossing->file_id_1
-							&& mbna_file_select == crossing->file_id_2)
-						|| (mbna_view_mode == MBNA_VIEW_MODE_WITHSURVEY
-							&& (mbna_survey_select == project.files[crossing->file_id_1].block
-								|| mbna_survey_select == project.files[crossing->file_id_2].block))
-						|| (mbna_view_mode == MBNA_VIEW_MODE_WITHFILE
-							&& (mbna_file_select == crossing->file_id_1
-								|| mbna_file_select == crossing->file_id_2))
-						|| (mbna_view_mode == MBNA_VIEW_MODE_WITHSECTION
-							&& mbna_file_select == crossing->file_id_1
-							&& mbna_section_select == crossing->section_1)
-						|| (mbna_view_mode == MBNA_VIEW_MODE_WITHSECTION
-							&& mbna_file_select == crossing->file_id_2
-							&& mbna_section_select == crossing->section_2)))
-					{
-					if (crossing->status == MBNA_CROSSING_STATUS_NONE)
-						status_char = 'U';
-					else if (crossing->status == MBNA_CROSSING_STATUS_SET)
-						status_char = '*';
-					else
-						status_char = '-';
-					if (crossing->truecrossing == MB_NO)
-						truecrossing = ' ';
-					else
-						truecrossing = 'X';
-					sprintf(string,"%c%c %4d %2.2d:%3.3d:%3.3d %2.2d:%3.3d:%3.3d %3d %2d",
-						status_char, truecrossing, i,
-						project.files[crossing->file_id_1].block,
-						crossing->file_id_1,
-						crossing->section_1,
-						project.files[crossing->file_id_2].block,
-						crossing->file_id_2,
-						crossing->section_2,
-						crossing->overlap,
-						crossing->num_ties);
-    					xstr[num_crossings] = XmStringCreateLocalized(string);
-					if (mbna_verbose > 0)
-						fprintf(stderr,"%s\n",string);
-					if (i == mbna_crossing_select)
-						iselect = num_crossings;
-					num_crossings++;
-					}
-				}
-    			XmListAddItems(list_data,xstr,num_crossings,0);
-			for (i=0;i<num_crossings;i++)
-				{
-    				XmStringFree(xstr[i]);
-    				}
-    			free(xstr);
-			}
-		if (iselect != MBNA_SELECT_NONE)
-			{
-			XmListSelectPos(list_data,iselect+1,0);
-			XmListSetPos(list_data,
-				MAX(iselect+1-5, 1));
-			}
-		}
- 	else if (mbna_view_list == MBNA_VIEW_LIST_TRUECROSSINGS)
-		{
-		if (mbna_view_mode == MBNA_VIEW_MODE_ALL)
-			sprintf(string,"True Crossings:");
-		else if (mbna_view_mode == MBNA_VIEW_MODE_SURVEY)
-			sprintf(string,"True Crossings of Survey %d:",mbna_survey_select);
-		else if (mbna_view_mode == MBNA_VIEW_MODE_FILE)
-			sprintf(string,"True Crossings of File %d:%d:",mbna_survey_select,mbna_file_select);
-		else if (mbna_view_mode == MBNA_VIEW_MODE_WITHSURVEY)
-			sprintf(string,"True Crossings with Survey %d:",mbna_survey_select);
-		else if (mbna_view_mode == MBNA_VIEW_MODE_WITHFILE)
-			sprintf(string,"True Crossings with File %d:%d:",mbna_survey_select,mbna_file_select);
-		else if (mbna_view_mode == MBNA_VIEW_MODE_WITHSECTION)
-			sprintf(string,"True Crossings with Section %d:%d:%d:",mbna_survey_select,mbna_file_select,mbna_section_select);
-		else
-			sprintf(string,"True Crossings:");
-		set_label_string(label_listdata,string);
-		if (mbna_verbose > 0)
-			fprintf(stderr,"%s\n",string);
-		if (project.num_files > 0)
-			{
-			/* count crossings */
-			num_crossings = 0;
-			for (i=0;i<project.num_crossings;i++)
-				{
-				crossing = &(project.crossings[i]);
-				if (crossing->truecrossing == MB_YES
-					&& ((mbna_view_mode == MBNA_VIEW_MODE_ALL)
-						|| (mbna_view_mode == MBNA_VIEW_MODE_SURVEY
-							&& mbna_survey_select == project.files[crossing->file_id_1].block
-							&& mbna_survey_select == project.files[crossing->file_id_2].block)
-						|| (mbna_view_mode == MBNA_VIEW_MODE_FILE
-							&& mbna_file_select == crossing->file_id_1
-							&& mbna_file_select == crossing->file_id_2)
-						|| (mbna_view_mode == MBNA_VIEW_MODE_WITHSURVEY
-							&& (mbna_survey_select == project.files[crossing->file_id_1].block
-								|| mbna_survey_select == project.files[crossing->file_id_2].block))
-						|| (mbna_view_mode == MBNA_VIEW_MODE_WITHFILE
-							&& (mbna_file_select == crossing->file_id_1
-								|| mbna_file_select == crossing->file_id_2))
-						|| (mbna_view_mode == MBNA_VIEW_MODE_WITHSECTION
-							&& mbna_file_select == crossing->file_id_1
-							&& mbna_section_select == crossing->section_1)
-						|| (mbna_view_mode == MBNA_VIEW_MODE_WITHSECTION
-							&& mbna_file_select == crossing->file_id_2
-							&& mbna_section_select == crossing->section_2)))
-					num_crossings++;
-				}
-			xstr = (XmString *) malloc(num_crossings * sizeof(XmString));
-
-			/* generate list */
-			num_crossings = 0;
-			iselect = MBNA_SELECT_NONE;
-			for (i=0;i<project.num_crossings;i++)
-				{
-				crossing = &(project.crossings[i]);
-				if (crossing->truecrossing == MB_YES
-					&& ((mbna_view_mode == MBNA_VIEW_MODE_ALL)
-						|| (mbna_view_mode == MBNA_VIEW_MODE_SURVEY
-							&& mbna_survey_select == project.files[crossing->file_id_1].block
-							&& mbna_survey_select == project.files[crossing->file_id_2].block)
-						|| (mbna_view_mode == MBNA_VIEW_MODE_FILE
-							&& mbna_file_select == crossing->file_id_1
-							&& mbna_file_select == crossing->file_id_2)
-						|| (mbna_view_mode == MBNA_VIEW_MODE_WITHSURVEY
-							&& (mbna_survey_select == project.files[crossing->file_id_1].block
-								|| mbna_survey_select == project.files[crossing->file_id_2].block))
-						|| (mbna_view_mode == MBNA_VIEW_MODE_WITHFILE
-							&& (mbna_file_select == crossing->file_id_1
-								|| mbna_file_select == crossing->file_id_2))
-						|| (mbna_view_mode == MBNA_VIEW_MODE_WITHSECTION
-							&& mbna_file_select == crossing->file_id_1
-							&& mbna_section_select == crossing->section_1)
-						|| (mbna_view_mode == MBNA_VIEW_MODE_WITHSECTION
-							&& mbna_file_select == crossing->file_id_2
-							&& mbna_section_select == crossing->section_2)))
-					{
-					if (crossing->status == MBNA_CROSSING_STATUS_NONE)
-						status_char = 'U';
-					else if (crossing->status == MBNA_CROSSING_STATUS_SET)
-						status_char = '*';
-					else
-						status_char = '-';
-					truecrossing = 'X';
-					sprintf(string,"%c%c %4d %2.2d:%3.3d:%3.3d %2.2d:%3.3d:%3.3d %3d %2d",
-						status_char, truecrossing, i,
-						project.files[crossing->file_id_1].block,
-						crossing->file_id_1,
-						crossing->section_1,
-						project.files[crossing->file_id_2].block,
-						crossing->file_id_2,
-						crossing->section_2,
-						crossing->overlap,
-						crossing->num_ties);
-    					xstr[num_crossings] = XmStringCreateLocalized(string);
-					if (mbna_verbose > 0)
-						fprintf(stderr,"%s\n",string);
-					if (i == mbna_crossing_select)
-						iselect = num_crossings;
-					num_crossings++;
-					}
-				}
-    			XmListAddItems(list_data,xstr,num_crossings,0);
-			for (i=0;i<num_crossings;i++)
-				{
-    				XmStringFree(xstr[i]);
-    				}
-    			free(xstr);
-			}
-		if (iselect != MBNA_SELECT_NONE)
-			{
-			XmListSelectPos(list_data,iselect+1,0);
-			XmListSetPos(list_data,
-				MAX(iselect+1-5, 1));
-			}
-		}
- 	else if (mbna_view_list == MBNA_VIEW_LIST_TIES)
-		{
-		if (mbna_view_mode == MBNA_VIEW_MODE_ALL)
-			sprintf(string,"Ties:");
-		else if (mbna_view_mode == MBNA_VIEW_MODE_SURVEY)
-			sprintf(string,"Ties of Survey %d:",mbna_survey_select);
-		else if (mbna_view_mode == MBNA_VIEW_MODE_FILE)
-			sprintf(string,"Ties of File %d:%d:",mbna_survey_select,mbna_file_select);
-		else if (mbna_view_mode == MBNA_VIEW_MODE_WITHSURVEY)
-			sprintf(string,"Ties with Survey %d:",mbna_survey_select);
-		else if (mbna_view_mode == MBNA_VIEW_MODE_WITHFILE)
-			sprintf(string,"Ties with File %d:%d:",mbna_survey_select,mbna_file_select);
-		else if (mbna_view_mode == MBNA_VIEW_MODE_WITHSECTION)
-			sprintf(string,"Ties with Section %d:%d:%d:",mbna_survey_select,mbna_file_select,mbna_section_select);
-		else
-			sprintf(string,"Ties:");
-		set_label_string(label_listdata,string);
-        /*sprintf(string,":::t\"Ties:\":t\" Xing  Tie Fil:Sec:Nv  Fil:Sec:Nv      OffLon      OffLat     dOffLon     dOffLat\"");
-	set_label_multiline_string(label_listdata, string);*/
-		if (mbna_verbose > 0)
-        		fprintf(stderr,"%s\n Xing  Tie Fil:Sec:Nv  Fil:Sec:Nv      OffLon      OffLat     dOffLon     dOffLat\n",string);
-		if (project.num_files > 0)
-			{
-			/* count crossing ties and global ties */
-			num_ties = 0;
-			
-			/* count crossing ties */
-			for (i=0;i<project.num_crossings;i++)
-				{
-				crossing = &(project.crossings[i]);
-				if ((mbna_view_mode == MBNA_VIEW_MODE_ALL)
-					|| (mbna_view_mode == MBNA_VIEW_MODE_SURVEY
-						&& mbna_survey_select == project.files[crossing->file_id_1].block
-						&& mbna_survey_select == project.files[crossing->file_id_2].block)
-					|| (mbna_view_mode == MBNA_VIEW_MODE_FILE
-						&& mbna_file_select == crossing->file_id_1
-						&& mbna_file_select == crossing->file_id_2)
-					|| (mbna_view_mode == MBNA_VIEW_MODE_WITHSURVEY
-						&& (mbna_survey_select == project.files[crossing->file_id_1].block
-							|| mbna_survey_select == project.files[crossing->file_id_2].block))
-					|| (mbna_view_mode == MBNA_VIEW_MODE_WITHFILE
-						&& (mbna_file_select == crossing->file_id_1
-							|| mbna_file_select == crossing->file_id_2))
-					|| (mbna_view_mode == MBNA_VIEW_MODE_WITHSECTION
-						&& (mbna_file_select == crossing->file_id_1
-						&& mbna_section_select == crossing->section_1))
-					|| (mbna_view_mode == MBNA_VIEW_MODE_WITHSECTION
-						&& mbna_file_select == crossing->file_id_2
-						&& mbna_section_select == crossing->section_2))
-					{
-					num_ties += crossing->num_ties;
-					}
-				}
-			
-			/* count global ties */
-			for (i=0;i<project.num_files;i++)
-				{
-				file = &(project.files[i]);
-				for (j=0;j<file->num_sections;j++)
-					{
-					section = &(file->sections[j]);
-					if (section->global_tie_status != MBNA_TIE_NONE)
-						num_ties++;
-					}
-				}
-			    
-			/* allocate strings for list */
-			xstr = (XmString *) malloc(num_ties * sizeof(XmString));
-
-			/* generate list */
-			num_crossings = 0;
-			num_ties = 0;
-			iselect = MBNA_SELECT_NONE;
-			
-			/* start with crossing ties */
-			for (i=0;i<project.num_crossings;i++)
-				{
-				crossing = &(project.crossings[i]);
-				if ((mbna_view_mode == MBNA_VIEW_MODE_ALL)
-					|| (mbna_view_mode == MBNA_VIEW_MODE_SURVEY
-						&& mbna_survey_select == project.files[crossing->file_id_1].block
-						&& mbna_survey_select == project.files[crossing->file_id_2].block)
-					|| (mbna_view_mode == MBNA_VIEW_MODE_FILE
-						&& mbna_file_select == crossing->file_id_1
-						&& mbna_file_select == crossing->file_id_2)
-					|| (mbna_view_mode == MBNA_VIEW_MODE_WITHSURVEY
-						&& (mbna_survey_select == project.files[crossing->file_id_1].block
-							|| mbna_survey_select == project.files[crossing->file_id_2].block))
-					|| (mbna_view_mode == MBNA_VIEW_MODE_WITHFILE
-						&& (mbna_file_select == crossing->file_id_1
-							|| mbna_file_select == crossing->file_id_2))
-					|| (mbna_view_mode == MBNA_VIEW_MODE_WITHSECTION
-						&& mbna_file_select == crossing->file_id_1
-						&& mbna_section_select == crossing->section_1)
-					|| (mbna_view_mode == MBNA_VIEW_MODE_WITHSECTION
-						&& mbna_file_select == crossing->file_id_2
-						&& mbna_section_select == crossing->section_2))
-					{
-					for (j=0;j<crossing->num_ties;j++)
-					    {
-					    tie = (struct mbna_tie *) &crossing->ties[j];
-					    if (tie->inversion_status == MBNA_INVERSION_CURRENT
-						    || tie->inversion_status == MBNA_INVERSION_OLD)
-						    {
-						    dx = tie->offset_x_m - tie->inversion_offset_x_m;
-						    dy = tie->offset_y_m - tie->inversion_offset_y_m;
-						    dz = tie->offset_z_m - tie->inversion_offset_z_m;
-						    dr1 = fabs((tie->inversion_offset_x_m - tie->offset_x_m) * tie->sigmax1[0]
-							    + (tie->inversion_offset_y_m - tie->offset_y_m) * tie->sigmax1[1]
-							    + (tie->inversion_offset_z_m - tie->offset_z_m) * tie->sigmax1[2]) / tie->sigmar1;
-						    dr2 = fabs((tie->inversion_offset_x_m - tie->offset_x_m) * tie->sigmax2[0]
-							    + (tie->inversion_offset_y_m - tie->offset_y_m) * tie->sigmax2[1]
-							    + (tie->inversion_offset_z_m - tie->offset_z_m) * tie->sigmax2[2]) / tie->sigmar2;
-						    dr3 = fabs((tie->inversion_offset_x_m - tie->offset_x_m) * tie->sigmax3[0]
-							    + (tie->inversion_offset_y_m - tie->offset_y_m) * tie->sigmax3[1]
-							    + (tie->inversion_offset_z_m - tie->offset_z_m) * tie->sigmax3[2]) / tie->sigmar3;
-						    }
-					    if (tie->status == MBNA_TIE_XYZ)
-					    	tiestatus = tiestatus_xyz;
-					    else if (tie->status == MBNA_TIE_XY)
-					    	tiestatus = tiestatus_xy;
-					    else if (tie->status == MBNA_TIE_Z)
-					    	tiestatus = tiestatus_z;
-					    if (tie->inversion_status == MBNA_INVERSION_CURRENT)
-						sprintf(string,"%4d %2d %s %2.2d:%3.3d:%3.3d:%2.2d %2.2d:%3.3d:%3.3d:%2.2d %8.2f %8.2f %8.2f | %8.2f %8.2f %8.2f | %8.2f %8.2f %8.2f | %4.3f %4.3f %4.3f",
-						    i, j,
-						    tiestatus,
-						    project.files[crossing->file_id_1].block,
-						    crossing->file_id_1,
-						    crossing->section_1,
-						    tie->snav_1,
-						    project.files[crossing->file_id_2].block,
-						    crossing->file_id_2,
-						    crossing->section_2,
-						    tie->snav_2,
-						    tie->offset_x_m,
-						    tie->offset_y_m,
-						    tie->offset_z_m,
-						    tie->sigmar1,
-						    tie->sigmar2,
-						    tie->sigmar3,
-						    dx, dy, dz,
-						    dr1, dr2, dr3);
-					    else if (tie->inversion_status == MBNA_INVERSION_OLD)
-						sprintf(string,"%4d %2d %s %2.2d:%3.3d:%3.3d:%2.2d %2.2d:%3.3d:%3.3d:%2.2d %8.2f %8.2f %8.2f | %8.2f %8.2f %8.2f | %8.2f %8.2f %8.2f | %4.3f %4.3f %4.3f ***",
-						    i, j,
-						    tiestatus,
-						    project.files[crossing->file_id_1].block,
-						    crossing->file_id_1,
-						    crossing->section_1,
-						    tie->snav_1,
-						    project.files[crossing->file_id_2].block,
-						    crossing->file_id_2,
-						    crossing->section_2,
-						    tie->snav_2,
-						    tie->offset_x_m,
-						    tie->offset_y_m,
-						    tie->offset_z_m,
-						    tie->sigmar1,
-						    tie->sigmar2,
-						    tie->sigmar3,
-						    dx, dy, dz,
-						    dr1, dr2, dr3);
-					    else
-						sprintf(string,"%4d %2d %s %2.2d:%3.3d:%3.3d:%2.2d %2.2d:%3.3d:%3.3d:%2.2d %8.2f %8.2f %8.2f | %8.2f %8.2f %8.2f",
-						    i, j,
-						    tiestatus,
-						    project.files[crossing->file_id_1].block,
-						    crossing->file_id_1,
-						    crossing->section_1,
-						    tie->snav_1,
-						    project.files[crossing->file_id_2].block,
-						    crossing->file_id_2,
-						    crossing->section_2,
-						    tie->snav_2,
-						    tie->offset_x_m,
-						    tie->offset_y_m,
-						    tie->offset_z_m,
-						    tie->sigmar1,
-						    tie->sigmar2,
-						    tie->sigmar3);
-    					    xstr[num_ties] = XmStringCreateLocalized(string);
-					    if (mbna_verbose > 0)
-						    fprintf(stderr,"%s\n",string);
-					    if (i == mbna_crossing_select
-						&& j == mbna_tie_select)
-						iselect = num_ties;
-					    num_ties++;
-					    }
-					}
-    				}
-			
-			/* now list global ties */
-			for (i=0;i<project.num_files;i++)
-				{
-				file = &(project.files[i]);
-				for (j=0;j<file->num_sections;j++)
-					{
-					section = &(file->sections[j]);
-					if (section->global_tie_status != MBNA_TIE_NONE
-					 	&& ((mbna_view_mode == MBNA_VIEW_MODE_ALL)
-							|| (mbna_view_mode == MBNA_VIEW_MODE_SURVEY
-								&& mbna_survey_select == file->block)
-							|| (mbna_view_mode == MBNA_VIEW_MODE_FILE
-								&& mbna_file_select == i)
-							|| (mbna_view_mode == MBNA_VIEW_MODE_WITHSURVEY
-								&& mbna_survey_select == file->block)
-							|| (mbna_view_mode == MBNA_VIEW_MODE_WITHFILE
-								&& mbna_file_select == i)
-							|| (mbna_view_mode == MBNA_VIEW_MODE_WITHSECTION
-								&& mbna_file_select == i
-								&& mbna_section_select == j)))
-						{
-						dx = section->global_tie_offset_x_m - section->snav_lon_offset[section->global_tie_snav] / mbna_mtodeglon;
-						dy = section->global_tie_offset_y_m - section->snav_lat_offset[section->global_tie_snav] / mbna_mtodeglat;
-						dz = section->global_tie_offset_z_m - section->snav_z_offset[section->global_tie_snav];
-						dr1 = fabs(dx / section->global_tie_xsigma);
-						dr2 = fabs(dy / section->global_tie_ysigma);
-						dr3 = fabs(dz / section->global_tie_zsigma);
-
-						if (section->global_tie_status == MBNA_TIE_XYZ)
-							tiestatus = tiestatus_xyz;
-						else if (section->global_tie_status == MBNA_TIE_XY)
-							tiestatus = tiestatus_xy;
-						else if (section->global_tie_status == MBNA_TIE_Z)
-							tiestatus = tiestatus_z;
-						sprintf(string,"%2.2d:%3.3d:%3.3d:%2.2d %s %8.2f %8.2f %8.2f | %8.2f %8.2f %8.2f | %8.2f %8.2f %8.2f | %4.3f %4.3f %4.3f",
-							    project.files[i].block, i,  j, section->global_tie_snav,
-							    tiestatus,
-							    section->global_tie_offset_x_m,
-							    section->global_tie_offset_y_m,
-							    section->global_tie_offset_z_m,
-							    section->global_tie_xsigma,
-							    section->global_tie_ysigma,
-							    section->global_tie_zsigma,
-							    dx, dy, dz,
-							    dr1, dr2, dr3);
-						xstr[num_ties] = XmStringCreateLocalized(string);
-						if (mbna_verbose > 0)
-							fprintf(stderr,"%s\n",string);
-						num_ties++;
-						}
-					}
-				}
-
-
-			XmListAddItems(list_data,xstr,num_ties,0);
-			for (k=0;k<num_ties;k++)
-				{
-				XmStringFree(xstr[k]);
-				}
-			free(xstr);
-			}
-		if (iselect != MBNA_SELECT_NONE)
-			{
-			XmListSelectPos(list_data,iselect+1,0);
-			XmListSetPos(list_data,
-				MAX(iselect+1-5, 1));
-			}
-		}
-
-	XtVaSetValues(toggleButton_showallsurveys,
-		XmNsensitive, True,
-		NULL);
-	XtVaSetValues(toggleButton_showselectedsurvey,
-		XmNsensitive, True,
-		NULL);
-	XtVaSetValues(toggleButton_showselectedfile,
-		XmNsensitive, True,
-		NULL);
-	XtVaSetValues(toggleButton_showwithselectedsurvey,
-		XmNsensitive, True,
-		NULL);
-	XtVaSetValues(toggleButton_showwithselectedfile,
-		XmNsensitive, True,
-		NULL);
-	XtVaSetValues(toggleButton_showselectedsection,
-		XmNsensitive, True,
-		NULL);
-	XmToggleButtonSetState(toggleButton_showallsurveys,
-		FALSE, FALSE);
-	XmToggleButtonSetState(toggleButton_showselectedsurvey,
-		FALSE, FALSE);
-	XmToggleButtonSetState(toggleButton_showselectedfile,
-		FALSE, FALSE);
-	XmToggleButtonSetState(toggleButton_showwithselectedsurvey,
-		FALSE, FALSE);
-	XmToggleButtonSetState(toggleButton_showwithselectedfile,
-		FALSE, FALSE);
-	XmToggleButtonSetState(toggleButton_showselectedsection,
-		FALSE, FALSE);
-	if (mbna_view_mode == MBNA_VIEW_MODE_ALL)
-		XmToggleButtonSetState(toggleButton_showallsurveys,
-			TRUE, FALSE);
-	else if (mbna_view_mode == MBNA_VIEW_MODE_SURVEY)
-		XmToggleButtonSetState(toggleButton_showselectedsurvey,
-			TRUE, FALSE);
-	else if (mbna_view_mode == MBNA_VIEW_MODE_FILE)
-		XmToggleButtonSetState(toggleButton_showselectedfile,
-			TRUE, FALSE);
-	else if (mbna_view_mode == MBNA_VIEW_MODE_WITHSURVEY)
-		XmToggleButtonSetState(toggleButton_showwithselectedsurvey,
-			TRUE, FALSE);
-	else if (mbna_view_mode == MBNA_VIEW_MODE_WITHFILE)
-		XmToggleButtonSetState(toggleButton_showwithselectedfile,
-			TRUE, FALSE);
-	else if (mbna_view_mode == MBNA_VIEW_MODE_WITHSECTION)
-		XmToggleButtonSetState(toggleButton_showselectedsection,
-			TRUE, FALSE);
-
-	if (mbna_view_list == MBNA_VIEW_LIST_SURVEYS
-		&& project.num_files > 0
-		&& mbna_survey_select != MBNA_SELECT_NONE)
-		{
-		XtVaSetValues(pushButton_poornav,
-			XmNsensitive, True,
-			NULL);
-		XtVaSetValues(pushButton_goodnav,
-			XmNsensitive, True,
-			NULL);
-		XtVaSetValues(pushButton_fixednav,
-			XmNsensitive, True,
-			NULL);
-		XtVaSetValues(pushButton_fixedxynav,
-			XmNsensitive, True,
-			NULL);
-		XtVaSetValues(pushButton_fixedznav,
-			XmNsensitive, True,
-			NULL);
-		if (project.files[mbna_file_select].status == MBNA_FILE_POORNAV)
-			{
-			XtVaSetValues(pushButton_poornav,
-				XmNsensitive, False,
-				NULL);
-			}
-		else if (project.files[mbna_file_select].status == MBNA_FILE_GOODNAV)
-			{
-			XtVaSetValues(pushButton_goodnav,
-				XmNsensitive, False,
-				NULL);
-			}
-		else if (project.files[mbna_file_select].status == MBNA_FILE_FIXEDNAV)
-			{
-			XtVaSetValues(pushButton_fixednav,
-				XmNsensitive, False,
-				NULL);
-			}
-		else if (project.files[mbna_file_select].status == MBNA_FILE_FIXEDXYNAV)
-			{
-			XtVaSetValues(pushButton_fixedxynav,
-				XmNsensitive, False,
-				NULL);
-			}
-		else if (project.files[mbna_file_select].status == MBNA_FILE_FIXEDZNAV)
-			{
-			XtVaSetValues(pushButton_fixedznav,
-				XmNsensitive, False,
-				NULL);
-			}
-		}
-	else if (mbna_view_list == MBNA_VIEW_LIST_FILES
-		&& project.num_files > 0
-		&& mbna_file_select != MBNA_SELECT_NONE)
-		{
-		XtVaSetValues(pushButton_poornav,
-			XmNsensitive, True,
-			NULL);
-		XtVaSetValues(pushButton_goodnav,
-			XmNsensitive, True,
-			NULL);
-		XtVaSetValues(pushButton_fixednav,
-			XmNsensitive, True,
-			NULL);
-		XtVaSetValues(pushButton_fixedxynav,
-			XmNsensitive, True,
-			NULL);
-		XtVaSetValues(pushButton_fixedznav,
-			XmNsensitive, True,
-			NULL);
-		if (project.files[mbna_file_select].status == MBNA_FILE_POORNAV)
-			{
-			XtVaSetValues(pushButton_poornav,
-				XmNsensitive, False,
-				NULL);
-			}
-		else if (project.files[mbna_file_select].status == MBNA_FILE_GOODNAV)
-			{
-			XtVaSetValues(pushButton_goodnav,
-				XmNsensitive, False,
-				NULL);
-			}
-		else if (project.files[mbna_file_select].status == MBNA_FILE_FIXEDNAV)
-			{
-			XtVaSetValues(pushButton_fixednav,
-				XmNsensitive, False,
-				NULL);
-			}
-		else if (project.files[mbna_file_select].status == MBNA_FILE_FIXEDXYNAV)
-			{
-			XtVaSetValues(pushButton_fixedxynav,
-				XmNsensitive, False,
-				NULL);
-			}
-		else if (project.files[mbna_file_select].status == MBNA_FILE_FIXEDZNAV)
-			{
-			XtVaSetValues(pushButton_fixedznav,
-				XmNsensitive, False,
-				NULL);
-			}
-		}
-	else
-		{
-		XtVaSetValues(pushButton_poornav,
-			XmNsensitive, False,
-			NULL);
-		XtVaSetValues(pushButton_goodnav,
-			XmNsensitive, False,
-			NULL);
-		XtVaSetValues(pushButton_fixednav,
-			XmNsensitive, False,
-			NULL);
-		XtVaSetValues(pushButton_fixedxynav,
-			XmNsensitive, False,
-			NULL);
-		XtVaSetValues(pushButton_fixedznav,
-			XmNsensitive, False,
-			NULL);
-		}
-
-	if (mbna_view_list == MBNA_VIEW_LIST_TIES
-		&& project.num_files > 0
-		&& mbna_tie_select != MBNA_SELECT_NONE
-		&& project.crossings[mbna_crossing_select].ties[mbna_tie_select].status == MBNA_TIE_XY)
-		{
-		XtVaSetValues(pushButton_tie_xyz,
-			XmNsensitive, True,
-			NULL);
-		XtVaSetValues(pushButton_tie_xy,
-			XmNsensitive, False,
-			NULL);
-		XtVaSetValues(pushButton_tie_z,
-			XmNsensitive, True,
-			NULL);
-		}
-	else if (mbna_view_list == MBNA_VIEW_LIST_TIES
-		&& project.num_files > 0
-		&& mbna_tie_select != MBNA_SELECT_NONE
-		&& project.crossings[mbna_crossing_select].ties[mbna_tie_select].status == MBNA_TIE_Z)
-		{
-		XtVaSetValues(pushButton_tie_xyz,
-			XmNsensitive, True,
-			NULL);
-		XtVaSetValues(pushButton_tie_xy,
-			XmNsensitive, True,
-			NULL);
-		XtVaSetValues(pushButton_tie_z,
-			XmNsensitive, False,
-			NULL);
-		}
-	else if (mbna_view_list == MBNA_VIEW_LIST_TIES
-		&& project.num_files > 0
-		&& mbna_tie_select != MBNA_SELECT_NONE
-		&& project.crossings[mbna_crossing_select].ties[mbna_tie_select].status == MBNA_TIE_XYZ)
-		{
-		XtVaSetValues(pushButton_tie_xyz,
-			XmNsensitive, False,
-			NULL);
-		XtVaSetValues(pushButton_tie_xy,
-			XmNsensitive, True,
-			NULL);
-		XtVaSetValues(pushButton_tie_z,
-			XmNsensitive, True,
-			NULL);
-		}
-	else
-		{
-		XtVaSetValues(pushButton_tie_xyz,
-			XmNsensitive, False,
-			NULL);
-		XtVaSetValues(pushButton_tie_xy,
-			XmNsensitive, False,
-			NULL);
-		XtVaSetValues(pushButton_tie_z,
-			XmNsensitive, False,
-			NULL);
-		}
-
-	if (mbna_status != MBNA_STATUS_GUI)
-		{
-		XtVaSetValues(pushButton_new,
-			XmNsensitive, False,
-			NULL);
-		XtVaSetValues(pushButton_open,
-			XmNsensitive, False,
-			NULL);
-		XtVaSetValues(pushButton_close,
-			XmNsensitive, False,
-			NULL);
-		}
-	else if (project.open == MB_YES)
-		{
-		XtVaSetValues(pushButton_new,
-			XmNsensitive, False,
-			NULL);
-		XtVaSetValues(pushButton_open,
-			XmNsensitive, False,
-			NULL);
-		XtVaSetValues(pushButton_close,
-			XmNsensitive, True,
-			NULL);
-		}
-	else
-		{
-		XtVaSetValues(pushButton_new,
-			XmNsensitive, True,
-			NULL);
-		XtVaSetValues(pushButton_open,
-			XmNsensitive, True,
-			NULL);
-		XtVaSetValues(pushButton_close,
-			XmNsensitive, False,
-			NULL);
-		}
-	if (mbna_status == MBNA_STATUS_GUI
-		&& project.open == MB_YES
-		&& project.num_files >= 0)
-		{
-		XtVaSetValues(pushButton_importdata,
-			XmNsensitive, True,
-			NULL);
-		}
-	else
-		{
-		XtVaSetValues(pushButton_importdata,
-			XmNsensitive, False,
-			NULL);
-		}
-	if (project.open == MB_YES && project.num_files > 0)
-		{
-		if (mbna_view_list == MBNA_VIEW_LIST_SURVEYS)
-			{
-			XtVaSetValues(pushButton_showsurveys,
-				XmNsensitive, False,
-				NULL);
-			XtVaSetValues(pushButton_showdata,
-				XmNsensitive, True,
-				NULL);
-			XtVaSetValues(pushButton_showsections,
-				XmNsensitive, True,
-				NULL);
-			XtVaSetValues(pushButton_showcrossings,
-				XmNsensitive, True,
-				NULL);
-			XtVaSetValues(pushButton_showmediocrecrossings,
-				XmNsensitive, True,
-				NULL);
-			XtVaSetValues(pushButton_showgoodcrossings,
-				XmNsensitive, True,
-				NULL);
-			XtVaSetValues(pushButton_showbettercrossings,
-				XmNsensitive, True,
-				NULL);
-			XtVaSetValues(pushButton_showtruecrossings,
-				XmNsensitive, True,
-				NULL);
-			XtVaSetValues(pushButton_showties,
-				XmNsensitive, True,
-				NULL);
-			XtVaSetValues(pushButton_naverr_previous,
-				XmNsensitive, False,
-				NULL);
-			XtVaSetValues(pushButton_naverr_next,
-				XmNsensitive, False,
-				NULL);
-			XtVaSetValues(pushButton_naverr_nextunset,
-				XmNsensitive, False,
-				NULL);
-			}
-		else if (mbna_view_list == MBNA_VIEW_LIST_FILES)
-			{
-			XtVaSetValues(pushButton_showsurveys,
-				XmNsensitive, True,
-				NULL);
-			XtVaSetValues(pushButton_showdata,
-				XmNsensitive, False,
-				NULL);
-			XtVaSetValues(pushButton_showsections,
-				XmNsensitive, True,
-				NULL);
-			XtVaSetValues(pushButton_showcrossings,
-				XmNsensitive, True,
-				NULL);
-			XtVaSetValues(pushButton_showmediocrecrossings,
-				XmNsensitive, True,
-				NULL);
-			XtVaSetValues(pushButton_showgoodcrossings,
-				XmNsensitive, True,
-				NULL);
-			XtVaSetValues(pushButton_showbettercrossings,
-				XmNsensitive, True,
-				NULL);
-			XtVaSetValues(pushButton_showtruecrossings,
-				XmNsensitive, True,
-				NULL);
-			XtVaSetValues(pushButton_showties,
-				XmNsensitive, True,
-				NULL);
-			XtVaSetValues(pushButton_naverr_previous,
-				XmNsensitive, False,
-				NULL);
-			XtVaSetValues(pushButton_naverr_next,
-				XmNsensitive, False,
-				NULL);
-			XtVaSetValues(pushButton_naverr_nextunset,
-				XmNsensitive, False,
-				NULL);
-			}
-		else if (mbna_view_list == MBNA_VIEW_LIST_FILESECTIONS)
-			{
-			XtVaSetValues(pushButton_showsurveys,
-				XmNsensitive, True,
-				NULL);
-			XtVaSetValues(pushButton_showdata,
-				XmNsensitive, True,
-				NULL);
-			XtVaSetValues(pushButton_showsections,
-				XmNsensitive, False,
-				NULL);
-			XtVaSetValues(pushButton_showcrossings,
-				XmNsensitive, True,
-				NULL);
-			XtVaSetValues(pushButton_showmediocrecrossings,
-				XmNsensitive, True,
-				NULL);
-			XtVaSetValues(pushButton_showgoodcrossings,
-				XmNsensitive, True,
-				NULL);
-			XtVaSetValues(pushButton_showbettercrossings,
-				XmNsensitive, True,
-				NULL);
-			XtVaSetValues(pushButton_showtruecrossings,
-				XmNsensitive, True,
-				NULL);
-			XtVaSetValues(pushButton_showties,
-				XmNsensitive, True,
-				NULL);
-			XtVaSetValues(pushButton_naverr_previous,
-				XmNsensitive, False,
-				NULL);
-			XtVaSetValues(pushButton_naverr_next,
-				XmNsensitive, False,
-				NULL);
-			XtVaSetValues(pushButton_naverr_nextunset,
-				XmNsensitive, False,
-				NULL);
-			}
-		else if (mbna_view_list == MBNA_VIEW_LIST_CROSSINGS)
-			{
-			XtVaSetValues(pushButton_showsurveys,
-				XmNsensitive, True,
-				NULL);
-			XtVaSetValues(pushButton_showdata,
-				XmNsensitive, True,
-				NULL);
-			XtVaSetValues(pushButton_showsections,
-				XmNsensitive, True,
-				NULL);
-			XtVaSetValues(pushButton_showcrossings,
-				XmNsensitive, False,
-				NULL);
-			XtVaSetValues(pushButton_showmediocrecrossings,
-				XmNsensitive, True,
-				NULL);
-			XtVaSetValues(pushButton_showgoodcrossings,
-				XmNsensitive, True,
-				NULL);
-			XtVaSetValues(pushButton_showbettercrossings,
-				XmNsensitive, True,
-				NULL);
-			XtVaSetValues(pushButton_showtruecrossings,
-				XmNsensitive, True,
-				NULL);
-			XtVaSetValues(pushButton_showties,
-				XmNsensitive, True,
-				NULL);
-			XtVaSetValues(pushButton_naverr_previous,
-				XmNsensitive, True,
-				NULL);
-			XtVaSetValues(pushButton_naverr_next,
-				XmNsensitive, True,
-				NULL);
-			if (project.num_crossings == project.num_crossings_analyzed)
-				XtVaSetValues(pushButton_naverr_nextunset,
-					XmNsensitive, False,
-					NULL);
-			else
-				XtVaSetValues(pushButton_naverr_nextunset,
-					XmNsensitive, True,
-					NULL);
-			}
-		else if (mbna_view_list == MBNA_VIEW_LIST_MEDIOCRECROSSINGS)
-			{
-			XtVaSetValues(pushButton_showsurveys,
-				XmNsensitive, True,
-				NULL);
-			XtVaSetValues(pushButton_showdata,
-				XmNsensitive, True,
-				NULL);
-			XtVaSetValues(pushButton_showsections,
-				XmNsensitive, True,
-				NULL);
-			XtVaSetValues(pushButton_showcrossings,
-				XmNsensitive, True,
-				NULL);
-			XtVaSetValues(pushButton_showmediocrecrossings,
-				XmNsensitive, False,
-				NULL);
-			XtVaSetValues(pushButton_showgoodcrossings,
-				XmNsensitive, True,
-				NULL);
-			XtVaSetValues(pushButton_showbettercrossings,
-				XmNsensitive, True,
-				NULL);
-			XtVaSetValues(pushButton_showtruecrossings,
-				XmNsensitive, True,
-				NULL);
-			XtVaSetValues(pushButton_showties,
-				XmNsensitive, True,
-				NULL);
-			XtVaSetValues(pushButton_naverr_previous,
-				XmNsensitive, True,
-				NULL);
-			XtVaSetValues(pushButton_naverr_next,
-				XmNsensitive, True,
-				NULL);
-			if (project.num_crossings == project.num_crossings_analyzed)
-				XtVaSetValues(pushButton_naverr_nextunset,
-					XmNsensitive, False,
-					NULL);
-			else
-				XtVaSetValues(pushButton_naverr_nextunset,
-					XmNsensitive, True,
-					NULL);
-			}
-		else if (mbna_view_list == MBNA_VIEW_LIST_GOODCROSSINGS)
-			{
-			XtVaSetValues(pushButton_showsurveys,
-				XmNsensitive, True,
-				NULL);
-			XtVaSetValues(pushButton_showdata,
-				XmNsensitive, True,
-				NULL);
-			XtVaSetValues(pushButton_showsections,
-				XmNsensitive, True,
-				NULL);
-			XtVaSetValues(pushButton_showcrossings,
-				XmNsensitive, True,
-				NULL);
-			XtVaSetValues(pushButton_showmediocrecrossings,
-				XmNsensitive, True,
-				NULL);
-			XtVaSetValues(pushButton_showgoodcrossings,
-				XmNsensitive, False,
-				NULL);
-			XtVaSetValues(pushButton_showbettercrossings,
-				XmNsensitive, True,
-				NULL);
-			XtVaSetValues(pushButton_showtruecrossings,
-				XmNsensitive, True,
-				NULL);
-			XtVaSetValues(pushButton_showties,
-				XmNsensitive, True,
-				NULL);
-			XtVaSetValues(pushButton_naverr_previous,
-				XmNsensitive, True,
-				NULL);
-			XtVaSetValues(pushButton_naverr_next,
-				XmNsensitive, True,
-				NULL);
-			if (project.num_crossings == project.num_crossings_analyzed)
-				XtVaSetValues(pushButton_naverr_nextunset,
-					XmNsensitive, False,
-					NULL);
-			else
-				XtVaSetValues(pushButton_naverr_nextunset,
-					XmNsensitive, True,
-					NULL);
-			}
-		else if (mbna_view_list == MBNA_VIEW_LIST_BETTERCROSSINGS)
-			{
-			XtVaSetValues(pushButton_showsurveys,
-				XmNsensitive, True,
-				NULL);
-			XtVaSetValues(pushButton_showdata,
-				XmNsensitive, True,
-				NULL);
-			XtVaSetValues(pushButton_showsections,
-				XmNsensitive, True,
-				NULL);
-			XtVaSetValues(pushButton_showcrossings,
-				XmNsensitive, True,
-				NULL);
-			XtVaSetValues(pushButton_showmediocrecrossings,
-				XmNsensitive, True,
-				NULL);
-			XtVaSetValues(pushButton_showgoodcrossings,
-				XmNsensitive, True,
-				NULL);
-			XtVaSetValues(pushButton_showbettercrossings,
-				XmNsensitive, False,
-				NULL);
-			XtVaSetValues(pushButton_showtruecrossings,
-				XmNsensitive, True,
-				NULL);
-			XtVaSetValues(pushButton_showties,
-				XmNsensitive, True,
-				NULL);
-			XtVaSetValues(pushButton_naverr_previous,
-				XmNsensitive, True,
-				NULL);
-			XtVaSetValues(pushButton_naverr_next,
-				XmNsensitive, True,
-				NULL);
-			if (project.num_crossings == project.num_crossings_analyzed)
-				XtVaSetValues(pushButton_naverr_nextunset,
-					XmNsensitive, False,
-					NULL);
-			else
-				XtVaSetValues(pushButton_naverr_nextunset,
-					XmNsensitive, True,
-					NULL);
-			}
-		else if (mbna_view_list == MBNA_VIEW_LIST_TRUECROSSINGS)
-			{
-			XtVaSetValues(pushButton_showsurveys,
-				XmNsensitive, True,
-				NULL);
-			XtVaSetValues(pushButton_showdata,
-				XmNsensitive, True,
-				NULL);
-			XtVaSetValues(pushButton_showsections,
-				XmNsensitive, True,
-				NULL);
-			XtVaSetValues(pushButton_showcrossings,
-				XmNsensitive, True,
-				NULL);
-			XtVaSetValues(pushButton_showmediocrecrossings,
-				XmNsensitive, True,
-				NULL);
-			XtVaSetValues(pushButton_showgoodcrossings,
-				XmNsensitive, True,
-				NULL);
-			XtVaSetValues(pushButton_showbettercrossings,
-				XmNsensitive, True,
-				NULL);
-			XtVaSetValues(pushButton_showtruecrossings,
-				XmNsensitive, False,
-				NULL);
-			XtVaSetValues(pushButton_showties,
-				XmNsensitive, True,
-				NULL);
-			XtVaSetValues(pushButton_naverr_previous,
-				XmNsensitive, True,
-				NULL);
-			XtVaSetValues(pushButton_naverr_next,
-				XmNsensitive, True,
-				NULL);
-			if (project.num_truecrossings == project.num_truecrossings_analyzed)
-				XtVaSetValues(pushButton_naverr_nextunset,
-					XmNsensitive, False,
-					NULL);
-			else
-				XtVaSetValues(pushButton_naverr_nextunset,
-					XmNsensitive, True,
-					NULL);
-			}
-		else if (mbna_view_list == MBNA_VIEW_LIST_TIES)
-			{
-			XtVaSetValues(pushButton_showsurveys,
-				XmNsensitive, True,
-				NULL);
-			XtVaSetValues(pushButton_showdata,
-				XmNsensitive, True,
-				NULL);
-			XtVaSetValues(pushButton_showsections,
-				XmNsensitive, True,
-				NULL);
-			XtVaSetValues(pushButton_showcrossings,
-				XmNsensitive, True,
-				NULL);
-			XtVaSetValues(pushButton_showmediocrecrossings,
-				XmNsensitive, True,
-				NULL);
-			XtVaSetValues(pushButton_showgoodcrossings,
-				XmNsensitive, True,
-				NULL);
-			XtVaSetValues(pushButton_showbettercrossings,
-				XmNsensitive, True,
-				NULL);
-			XtVaSetValues(pushButton_showtruecrossings,
-				XmNsensitive, True,
-				NULL);
-			XtVaSetValues(pushButton_showties,
-				XmNsensitive, False,
-				NULL);
-			XtVaSetValues(pushButton_naverr_previous,
-				XmNsensitive, True,
-				NULL);
-			XtVaSetValues(pushButton_naverr_next,
-				XmNsensitive, True,
-				NULL);
-			XtVaSetValues(pushButton_naverr_nextunset,
-				XmNsensitive, False,
-				NULL);
-			}
-		}
-	else
-		{
-		XtVaSetValues(pushButton_showsurveys,
-			XmNsensitive, False,
-			NULL);
-		XtVaSetValues(pushButton_showdata,
-			XmNsensitive, False,
-			NULL);
-		XtVaSetValues(pushButton_showsections,
-			XmNsensitive, False,
-			NULL);
-		XtVaSetValues(pushButton_showcrossings,
-			XmNsensitive, False,
-			NULL);
-		XtVaSetValues(pushButton_showmediocrecrossings,
-			XmNsensitive, False,
-			NULL);
-		XtVaSetValues(pushButton_showgoodcrossings,
-			XmNsensitive, False,
-			NULL);
-		XtVaSetValues(pushButton_showbettercrossings,
-			XmNsensitive, False,
-			NULL);
-		XtVaSetValues(pushButton_showtruecrossings,
-			XmNsensitive, False,
-			NULL);
-		XtVaSetValues(pushButton_showties,
-			XmNsensitive, False,
-			NULL);
-		XtVaSetValues(pushButton_naverr_previous,
-			XmNsensitive, False,
-			NULL);
-		XtVaSetValues(pushButton_naverr_next,
-			XmNsensitive, False,
-			NULL);
-		XtVaSetValues(pushButton_naverr_nextunset,
-			XmNsensitive, False,
-			NULL);
-		XtVaSetValues(toggleButton_showallsurveys,
-			XmNsensitive, False,
-			NULL);
-		XtVaSetValues(toggleButton_showselectedsurvey,
-			XmNsensitive, False,
-			NULL);
-		XtVaSetValues(toggleButton_showselectedfile,
-			XmNsensitive, False,
-			NULL);
-		XtVaSetValues(toggleButton_showselectedsection,
-			XmNsensitive, False,
-			NULL);
-		}
-
-	if (mbna_status == MBNA_STATUS_GUI
-		&& project.open == MB_YES
-		&& project.num_files > 0)
-		{
-		XtVaSetValues(pushButton_autopick,
-			XmNsensitive, True,
-			NULL);
-		XtVaSetValues(pushButton_autopickhorizontal,
-			XmNsensitive, True,
-			NULL);
-		XtVaSetValues(pushButton_autosetsvsvertical,
-			XmNsensitive, True,
-			NULL);
-        	if (project.inversion == MBNA_INVERSION_CURRENT)
-			XtVaSetValues(pushButton_newcrossings,
-				XmNsensitive, True,
-				NULL);
-        	else
-			XtVaSetValues(pushButton_newcrossings,
-				XmNsensitive, False,
-				NULL);
-		XtVaSetValues(pushButton_makegrid,
-			XmNsensitive, False,
-			NULL);
-		XtVaSetValues(pushButton_analyzecrossings,
-			XmNsensitive, True,
-			NULL);
-		XtVaSetValues(pushButton_zerozoffsets,
-			XmNsensitive, True,
-			NULL);
-		if (project.num_truecrossings == project.num_truecrossings_analyzed
-			|| project.num_crossings_analyzed >= 10)
-			XtVaSetValues(pushButton_invertnav,
-				XmNsensitive, True,
-				NULL);
-		else
-			XtVaSetValues(pushButton_invertnav,
-				XmNsensitive, False,
-				NULL);
-		if (project.inversion != MBNA_INVERSION_NONE)
-			XtVaSetValues(pushButton_showmodelplot,
-				XmNsensitive, True,
-				NULL);
-		else
-			XtVaSetValues(pushButton_showmodelplot,
-				XmNsensitive, False,
-				NULL);
-        	if (project.inversion == MBNA_INVERSION_CURRENT)
-			XtVaSetValues(pushButton_applynav,
-				XmNsensitive, True,
-				NULL);
-        	else
-			XtVaSetValues(pushButton_applynav,
-				XmNsensitive, False,
-				NULL);
-		}
-	else
-		{
-		XtVaSetValues(pushButton_autopick,
-			XmNsensitive, False,
-			NULL);
-		XtVaSetValues(pushButton_autopickhorizontal,
-			XmNsensitive, False,
-			NULL);
-		XtVaSetValues(pushButton_autosetsvsvertical,
-			XmNsensitive, False,
-			NULL);
-		XtVaSetValues(pushButton_newcrossings,
-			XmNsensitive, False,
-			NULL);
-		XtVaSetValues(pushButton_makegrid,
-			XmNsensitive, False,
-			NULL);
-		XtVaSetValues(pushButton_analyzecrossings,
-			XmNsensitive, False,
-			NULL);
-		XtVaSetValues(pushButton_zerozoffsets,
-			XmNsensitive, False,
-			NULL);
-		XtVaSetValues(pushButton_invertnav,
-			XmNsensitive, False,
-			NULL);
-		XtVaSetValues(pushButton_applynav,
-			XmNsensitive, False,
-			NULL);
-		if (project.inversion != MBNA_INVERSION_NONE)
-			XtVaSetValues(pushButton_showmodelplot,
-				XmNsensitive, True,
-				NULL);
-		else
-			XtVaSetValues(pushButton_showmodelplot,
-				XmNsensitive, False,
-				NULL);
-		}
-
-	/* set values of decimation slider */
-	XtVaSetValues(scale_controls_decimation,
-			XmNvalue, project.decimation,
-			NULL);
-
-	/* set values of section length slider */
-	ivalue = (int) (100 * project.section_length);
-	imax = (int) (100 * 50.0);
-	XtVaSetValues(scale_controls_sectionlength,
-			XmNminimum, 1,
-			XmNmaximum, imax,
-			XmNdecimalPoints, 2,
-			XmNvalue, ivalue,
-			NULL);
-
-	/* set values of section soundings slider */
-	ivalue = project.section_soundings;
-	XtVaSetValues(scale_controls_sectionsoundings,
-			XmNvalue, ivalue,
-			NULL);
-
-	/* set values of contour interval slider */
-	ivalue = (int) (100 * project.cont_int);
-	if (project.cont_int >= 10.0)
-	    imax = (int) (100 * 400.0);
-	else
-	    imax = (int) (100 * 50.0);
-	XtVaSetValues(scale_controls_contourinterval,
-			XmNminimum, 1,
-			XmNmaximum, imax,
-			XmNdecimalPoints, 2,
-			XmNvalue, ivalue,
-			NULL);
-
-	/* set values of color interval slider */
-	ivalue = (int) (100 * project.col_int);
-	if (project.col_int >= 10.0)
-	    imax = (int) (100 * 400.0);
-	else
-	    imax = (int) (100 * 50.0);
-	XtVaSetValues(scale_controls_colorinterval,
-			XmNminimum, 1,
-			XmNmaximum, imax,
-			XmNdecimalPoints, 2,
-			XmNvalue, ivalue,
-			NULL);
-
-	/* set values of tick interval slider */
-	ivalue = (int) (100 * project.tick_int);
-	if (project.tick_int >= 10.0)
-	    imax = (int) (100 * 400.0);
-	else
-	    imax = (int) (100 * 50.0);
-	XtVaSetValues(scale_controls_tickinterval,
-			XmNminimum, 1,
-			XmNmaximum, imax,
-			XmNdecimalPoints, 2,
-			XmNvalue, ivalue,
-			NULL);
-
-	/* set values of inversion smoothing weight slider */
-	ivalue = (int) (100 * project.smoothing);
-	imax = (int) (100 * 10.0);
-	XtVaSetValues(scale_controls_smoothing,
-			XmNminimum, 1,
-			XmNmaximum, imax,
-			XmNdecimalPoints, 2,
-			XmNvalue, ivalue,
-			NULL);
-
-	/* set values of z offset width slider */
-	ivalue = (int) (project.zoffsetwidth);
-	XtVaSetValues(scale_controls_zoffset,
-			XmNvalue, ivalue,
-			NULL);
-
-	/* set misfit offset center toggles */
-	if (mbna_misfit_center == MBNA_MISFIT_ZEROCENTER)
-	    {
-	    XmToggleButtonSetState(toggleButton_misfitcenter_zero,
-			TRUE, TRUE);
-	    }
-	else
-	    {
-	    XmToggleButtonSetState(toggleButton_misfitcenter_auto,
-			TRUE, TRUE);
-	    }
-}
-/*--------------------------------------------------------------------*/
-
-void do_update_modelplot_status()
-{
-    	struct mbna_crossing *crossing;
-
-	/* deal with modelplot */
-	if (project.modelplot == MB_YES)
-	    {
-	    /* set model view clear block button sensitivity */
-	    if (mbna_crossing_select == MBNA_SELECT_NONE)
-		    {
-		    XtVaSetValues(pushButton_modelplot_clearblock,
-			    XmNsensitive, False,
-			    NULL);
-		    }
-	    else
-		    {
-		    XtVaSetValues(pushButton_modelplot_clearblock,
-			    XmNsensitive, True,
-			    NULL);
-		    }
-
-	    /* set model view status label */
-	    if (project.modelplot_style == MBNA_MODELPLOT_TIMESERIES)
-		{
-		if (mbna_crossing_select == MBNA_SELECT_NONE)
-			{
-			sprintf(string,":::t\"Mouse: <left> select  tie; <middle> select untied crossing; <right> drag zoom extent\":t\"No Selection\"");
-			}
-		else
-			{
-			crossing = &(project.crossings[mbna_crossing_select]);
-			sprintf(string,":::t\"Mouse: <left> select  tie; <middle> select untied crossing; <right> drag zoom extent\":t\"Selected Crossing: %4d %2.2d:%3.3d:%3.3d %2.2d:%3.3d:%3.3d\"",
-				    mbna_crossing_select,
-				    project.files[crossing->file_id_1].block,
-				    crossing->file_id_1,
-				    crossing->section_1,
-				    project.files[crossing->file_id_2].block,
-				    crossing->file_id_2,
-				    crossing->section_2);
-			}
-		}
-	    else if (project.modelplot_style == MBNA_MODELPLOT_PERTURBATION)
-		{
-		if (mbna_crossing_select == MBNA_SELECT_NONE)
-			{
-			sprintf(string,":::t\"Mouse: <left> select  tie; <middle> select untied crossing; <right> drag zoom extent\":t\"No Selection\"");
-			}
-		else
-			{
-			crossing = &(project.crossings[mbna_crossing_select]);
-			sprintf(string,":::t\"Mouse: <left> select  tie; <middle> select untied crossing; <right> drag zoom extent\":t\"Selected Crossing: %4d %2.2d:%3.3d:%3.3d %2.2d:%3.3d:%3.3d\"",
-				    mbna_crossing_select,
-				    project.files[crossing->file_id_1].block,
-				    crossing->file_id_1,
-				    crossing->section_1,
-				    project.files[crossing->file_id_2].block,
-				    crossing->file_id_2,
-				    crossing->section_2);
-			}
-		}
-	    else
-		{
-		if (mbna_crossing_select == MBNA_SELECT_NONE)
-			{
-			sprintf(string,":::t\"Mouse: <left> select  tie; <middle> select block to view; <right> drag zoom extent\":t\"No Selection\"");
-			}
-		else
-			{
-			crossing = &(project.crossings[mbna_crossing_select]);
-			sprintf(string,":::t\"Mouse: <left> select  tie; <middle> select block to view; <right> drag zoom extent\":t\"Selected Crossing: %4d %2.2d:%3.3d:%3.3d %2.2d:%3.3d:%3.3d\"",
-				    mbna_crossing_select,
-				    project.files[crossing->file_id_1].block,
-				    crossing->file_id_1,
-				    crossing->section_1,
-				    project.files[crossing->file_id_2].block,
-				    crossing->file_id_2,
-				    crossing->section_2);
-			}
-		}
-
-	    set_label_multiline_string(label_modelplot_status, string);
-	    }
-}
-/*--------------------------------------------------------------------*/
-
-void
-do_naverr_init()
-{
-    /* manage naverr */
-    XtManageChild(bulletinBoard_naverr);
-
-    /* Setup just the "canvas" part of the screen. */
-    cont_xid = XtWindow(drawingArea_naverr_cont);
-    corr_xid = XtWindow(drawingArea_naverr_corr);
-    zoff_xid = XtWindow(drawingArea_naverr_zcorr);
-
-    /* Setup the "graphics Context" for just the "canvas" */
-    xgcv.background = WhitePixelOfScreen(DefaultScreenOfDisplay(display));
-    xgcv.foreground = BlackPixelOfScreen(DefaultScreenOfDisplay(display));
-    xgcv.line_width = 2;
-    cont_gc = XCreateGC(display,cont_xid,GCBackground | GCForeground
-	     | GCLineWidth, &xgcv);
-    corr_gc = XCreateGC(display,corr_xid,GCBackground | GCForeground
-	     | GCLineWidth, &xgcv);
-
-    /* Setup the font for just the "canvas" screen. */
-    fontStruct = XLoadQueryFont(display, xgfont);
-    if (fontStruct == NULL)
-        {
-	fprintf(stderr,"\nFailure to load font using XLoadQueryFont: %s\n", xgfont);
-        fprintf(stderr,"\tSource file: %s\n\tSource line: %d\n\tSource version: %s", __FILE__, __LINE__, svn_id);
-	fprintf(stderr,"\nProgram <%s> Terminated\n", program_name);
-	exit(-1);
-        }
-    XSetFont(display,cont_gc,fontStruct->fid);
-    XSetFont(display,corr_gc,fontStruct->fid);
-
-    XSelectInput(display, cont_xid, EV_MASK );
-    XSelectInput(display, corr_xid, EV_MASK );
-
-    /* Setup cursors. */
-    myCursor = XCreateFontCursor(display, XC_target);
-    XRecolorCursor(display,myCursor,&colors[2],&colors[5]);
-    XDefineCursor(display,cont_xid,myCursor);
-    XDefineCursor(display,corr_xid,myCursor);
-
-    /* initialize graphics */
-    xg_init(display, cont_xid, cont_borders, xgfont, &cont_xgid);
-    xg_init(display, corr_xid, corr_borders, xgfont, &corr_xgid);
-    xg_init(display, zoff_xid, zoff_borders, xgfont, &zoff_xgid);
-    status = mbnavadjust_set_graphics(cont_xgid, corr_xgid, zoff_xgid);
-
-    /* set status flag */
-    mbna_status = MBNA_STATUS_NAVERR;
-
-    /* get current crossing */
-     if (mbna_crossing_select == MBNA_SELECT_NONE)
-    	mbnavadjust_naverr_nextunset();
-    else
-    	mbnavadjust_naverr_specific(mbna_crossing_select, mbna_tie_select);
-
-    /* update naverr labels */
-    mbnavadjust_naverr_plot(MBNA_PLOT_MODE_FIRST);
-    do_update_naverr();
-    do_update_status();
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_update_naverr()
-{
-    struct mbna_crossing *crossing;
-    struct mbna_tie *tie;
-    double	plot_width, misfit_width;
-    double	zoom_factor;
-    double	timediff;
-
-    if (mbna_current_crossing >= 0)
-    	{
-    	/* get zoom factor */
-    	if ((mbna_plot_lon_max - mbna_plot_lon_min) > 0.0)
-    		zoom_factor = 100.0 *
-    			MAX((mbna_lon_max - mbna_lon_min)
-    				/ (mbna_plot_lon_max - mbna_plot_lon_min),
-    			    (mbna_lat_max - mbna_lat_min)
-    				/ (mbna_plot_lat_max - mbna_plot_lat_min));
-    	else
-    		zoom_factor = 0.0;
-    	plot_width = (mbna_plot_lon_max - mbna_plot_lon_min)
-    			/ mbna_mtodeglon;
-    	misfit_width = (mbna_plot_lon_max - mbna_plot_lon_min)
-    			/ mbna_mtodeglon;
-
-	/* get time difference */
-    	timediff = (project.files[mbna_file_id_2].sections[mbna_section_2].btime_d
-		- project.files[mbna_file_id_1].sections[mbna_section_1].btime_d) / 86400.0;
-
-    	/* set main naverr status label */
-	crossing = &project.crossings[mbna_current_crossing];
-	tie = &crossing->ties[mbna_current_tie];
-	if (crossing->status == MBNA_CROSSING_STATUS_NONE)
-		{
-        	sprintf(string,":::t\"Crossing: %d of %d\"\
-:t\"Sections: %2.2d:%3.3d:%3.3d and %2.2d:%3.3d:%3.3d\"\
-:t\"Time Difference: %f days \"\
-:t\"Status: Unset \"\
-:t\"Plot Widths (m): Contour: %.2f Misfit: %.2f Z: %.2f\"\
-:t\"Zoom Factor: %.2f \"\
-:t\"Relative Offsets:   None None None\"",
-               	 	mbna_current_crossing, project.num_crossings,
-                	project.files[crossing->file_id_1].block,crossing->file_id_1,crossing->section_1,
-                	project.files[crossing->file_id_2].block,crossing->file_id_2,crossing->section_2,
-			timediff,
-               	 	plot_width, misfit_width, project.zoffsetwidth, zoom_factor);
-                }
-	else if (crossing->status == MBNA_CROSSING_STATUS_SET)
-		{
-        	sprintf(string,":::t\"Crossing: %d of %d\"\
-:t\"Sections: %2.2d:%3.3d:%3.3d and %2.2d:%3.3d:%3.3d\"\
-:t\"Time Difference: %f days \"\
-:t\"Current Tie Point: %2d of %2d  Nav Points: %4d %4d\"\
-:t\"Plot Widths (m): Contour: %.2f Misfit: %.2f Z: %.2f\"\
-:t\"Zoom Factor: %.2f \"\
-:t\"Relative Offsets (m):   %.3f %.3f %.3f\"\
-:t\"Sigma (m):   %.3f %.3f %.3f\"",
-               	 	mbna_current_crossing, project.num_crossings,
-                	project.files[crossing->file_id_1].block,crossing->file_id_1,crossing->section_1,
-                	project.files[crossing->file_id_2].block,crossing->file_id_2,crossing->section_2,
-			timediff,
-                	mbna_current_tie, crossing->num_ties,
-                	tie->snav_1,
-			tie->snav_2,
-               	 	plot_width, misfit_width, project.zoffsetwidth, zoom_factor,
-                	tie->offset_x_m,
-			tie->offset_y_m,
-			tie->offset_z_m,
-			tie->sigmar1,
-			tie->sigmar2,
-			tie->sigmar3);
-                }
-	else
-		{
-        	sprintf(string,":::t\"Crossing: %d of %d\"\
-:t\"Sections: %2.2d:%3.3d:%3.3d and %2.2d:%3.3d:%3.3d\"\
-:t\"Time Difference: %f days \"\
-:t\"Status: Skipped \"\
-:t\"Plot Widths (m): Contour: %.2f Misfit: %.2f Z: %.2f\"\
-:t\"Zoom Factor: %.2f \"\
-:t\"Relative Offsets:   Skipped Skipped Skipped\"",
-               	 	mbna_current_crossing, project.num_crossings,
-                 	project.files[crossing->file_id_1].block,crossing->file_id_1,crossing->section_1,
-                	project.files[crossing->file_id_2].block,crossing->file_id_2,crossing->section_2,
-			timediff,
-              	 	plot_width, misfit_width, project.zoffsetwidth, zoom_factor);
-                }
-	set_label_multiline_string(label_naverr_status, string);
-
-	/* set some button sensitivities */
-	XtVaSetValues(pushButton_naverr_deletetie,
-		XmNsensitive, (mbna_current_tie >= 0),
-		NULL);
-	XtVaSetValues(pushButton_naverr_selecttie,
-		XmNsensitive, (crossing->num_ties > 0),
-		NULL);
-	XtVaSetValues(pushButton_naverr_fullsize,
-		XmNsensitive, (mbna_plot_lon_min != mbna_lon_min
-				|| mbna_plot_lon_max != mbna_lon_max
-				|| mbna_plot_lat_min != mbna_lat_min
-				|| mbna_plot_lat_max != mbna_lat_max),
-		NULL);
-	if (mbna_view_list == MBNA_VIEW_LIST_SURVEYS)
-		{
-		XtVaSetValues(pushButton_naverr_previous,
-			XmNsensitive, False,
-			NULL);
-		XtVaSetValues(pushButton_naverr_next,
-			XmNsensitive, False,
-			NULL);
-		XtVaSetValues(pushButton_naverr_nextunset,
-			XmNsensitive, False,
-			NULL);
-		}
-	else if (mbna_view_list == MBNA_VIEW_LIST_FILES)
-		{
-		XtVaSetValues(pushButton_naverr_previous,
-			XmNsensitive, False,
-			NULL);
-		XtVaSetValues(pushButton_naverr_next,
-			XmNsensitive, False,
-			NULL);
-		XtVaSetValues(pushButton_naverr_nextunset,
-			XmNsensitive, False,
-			NULL);
-		}
-	else if (mbna_view_list == MBNA_VIEW_LIST_CROSSINGS)
-		{
-		XtVaSetValues(pushButton_naverr_previous,
-			XmNsensitive, True,
-			NULL);
-		XtVaSetValues(pushButton_naverr_next,
-			XmNsensitive, True,
-			NULL);
-		if (project.num_crossings == project.num_crossings_analyzed)
-			XtVaSetValues(pushButton_naverr_nextunset,
-				XmNsensitive, False,
-				NULL);
-		else
-			XtVaSetValues(pushButton_naverr_nextunset,
-				XmNsensitive, True,
-				NULL);
-		}
-	else if (mbna_view_list == MBNA_VIEW_LIST_GOODCROSSINGS)
-		{
-		XtVaSetValues(pushButton_naverr_previous,
-			XmNsensitive, True,
-			NULL);
-		XtVaSetValues(pushButton_naverr_next,
-			XmNsensitive, True,
-			NULL);
-		if (project.num_crossings == project.num_crossings_analyzed)
-			XtVaSetValues(pushButton_naverr_nextunset,
-				XmNsensitive, False,
-				NULL);
-		else
-			XtVaSetValues(pushButton_naverr_nextunset,
-				XmNsensitive, True,
-				NULL);
-		}
-	else if (mbna_view_list == MBNA_VIEW_LIST_TRUECROSSINGS)
-		{
-		XtVaSetValues(pushButton_naverr_previous,
-			XmNsensitive, True,
-			NULL);
-		XtVaSetValues(pushButton_naverr_next,
-			XmNsensitive, True,
-			NULL);
-		if (project.num_truecrossings == project.num_truecrossings_analyzed)
-			XtVaSetValues(pushButton_naverr_nextunset,
-				XmNsensitive, False,
-				NULL);
-		else
-			XtVaSetValues(pushButton_naverr_nextunset,
-				XmNsensitive, True,
-				NULL);
-		}
-	else if (mbna_view_list == MBNA_VIEW_LIST_TIES)
-		{
-		XtVaSetValues(pushButton_naverr_previous,
-			XmNsensitive, True,
-			NULL);
-		XtVaSetValues(pushButton_naverr_next,
-			XmNsensitive, True,
-			NULL);
-		XtVaSetValues(pushButton_naverr_nextunset,
-			XmNsensitive, True,
-			NULL);
-		}
-
-    	do_naverr_offsetlabel();
-    	}
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_naverr_offsetlabel()
-{
-    /* look at current crossing */
-    if (mbna_current_crossing >= 0)
-    	{
-    	/* set main naverr status label */
-        sprintf(string,":::t\"Working Offsets (m): %.3f %.3f %.3f %d:%d\":t\"Sigma (m): %.3f %.3f %.3f\"",
-        		mbna_offset_x / mbna_mtodeglon,
-			mbna_offset_y / mbna_mtodeglat,
-			mbna_offset_z,
-			mbna_snav_1, mbna_snav_2,
-			mbna_minmisfit_sr1,mbna_minmisfit_sr2,mbna_minmisfit_sr3);
-    	}
-
-    else
-    	{
-    	/* set main naverr status label */
-        sprintf(string,":::t\"Working Offsets (m): %.3f %.3f %.3f\":t\"Working Tie Points: %d:%d\"",
-        		0.0, 0.0, 0.0, 0, 0);
-    	}
-    set_label_multiline_string(label_naverr_offsets, string);
-
-    /* set button sensitivity for setting or resetting offsets */
-    XtVaSetValues(pushButton_naverr_settie,
-	    XmNsensitive, mbna_allow_set_tie,
-	    NULL);
-    XtVaSetValues(pushButton_naverr_resettie,
-	    XmNsensitive, mbna_allow_set_tie,
-	    NULL);
-
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_naverr_test_graphics()
-{
-    int	    	i, j, k;
-    int		ox, oy, dx, dy;
-    double	rx, ry, rr, r;
-
-    /* now test graphics */
-    ox = 0;
-    oy = 0;
-    dx = (cont_borders[1] - cont_borders[0]) / 16;
-    dy = (cont_borders[3] - cont_borders[2]) / 16;
-    rx = cont_borders[1] - ox;
-    ry = cont_borders[3] - oy;
-    rr = sqrt(rx * rx + ry * ry);
-    for (i=0;i<16;i++)
-    	for (j=0;j<16;j++)
-    	    {
-    	    k = 16 * j + i;
-    	    ox = i * dx;
-    	    oy = j * dy;
-     	    xg_fillrectangle(cont_xgid,ox,oy,dx,dy,mpixel_values[k],0);
-    	    xg_fillrectangle(cont_xgid,ox+dx/4,oy+dy/4,dx/2,dy/2,k,0);
-    	    }
-    ox = (corr_borders[1] - corr_borders[0]) / 2;
-    oy = (corr_borders[3] - corr_borders[2]) / 2;
-    rx = corr_borders[1] - ox;
-    ry = corr_borders[3] - oy;
-    rr = sqrt(rx * rx + ry * ry);
-    for (i=corr_borders[0];i<corr_borders[1];i++)
-    	for (j=corr_borders[2];j<corr_borders[3];j++)
-    	    {
-    	    rx = i - ox;
-    	    ry = j - oy;
-    	    r = sqrt(rx * rx + ry * ry);
-    	    k = 6 + (int) (80 * r / rr);
-    	    xg_fillrectangle(corr_xgid,i,j,1,1,mpixel_values[k],0);
-    	    }
-}
-/*--------------------------------------------------------------------*/
-
-void
-do_list_data_select( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-    struct mbna_file *file;
-    struct mbna_crossing *crossing;
-    int	*position_list = NULL;
-    int position_count = 0;
-    int	num_files, num_sections, num_crossings, num_ties;
-    int	found;
-    int	i, j;
-
-    if (XmListGetSelectedPos(list_data,&position_list,&position_count))
-    	{
-	if (mbna_view_list == MBNA_VIEW_LIST_SURVEYS)
-		{
-		mbna_section_select = 0;
-		mbna_file_select = 0;
-		mbna_survey_select = position_list[0] - 1;
-
-		/* get selected file from list */
-		for (i=0;i<project.num_files;i++)
-			{
-			file = &(project.files[i]);
-			if (mbna_file_select == 0 && mbna_survey_select == file->block)
-				{
-				mbna_file_select = i;
-				}
- 			}
-		}
-	else if (mbna_view_list == MBNA_VIEW_LIST_FILES)
-		{
-		num_files = 0;
-
-		/* get selected file from list */
-		for (i=0;i<project.num_files;i++)
-			{
-			file = &(project.files[i]);
-			if ((mbna_view_mode == MBNA_VIEW_MODE_ALL)
-				|| (mbna_view_mode == MBNA_VIEW_MODE_SURVEY && mbna_survey_select == file->block)
-				|| (mbna_view_mode == MBNA_VIEW_MODE_FILE && mbna_file_select == i)
-				|| (mbna_view_mode == MBNA_VIEW_MODE_WITHSURVEY && mbna_survey_select == file->block)
-				|| (mbna_view_mode == MBNA_VIEW_MODE_WITHFILE && mbna_file_select == i)
-				|| (mbna_view_mode == MBNA_VIEW_MODE_WITHSECTION && mbna_file_select == i))
-				{
-				if (num_files == position_list[0] - 1)
-					{
-					mbna_section_select = 0;
-					mbna_file_select = i;
-					mbna_survey_select = file->block;
-					}
-				num_files++;
-				}
- 			}
-		}
-	else if (mbna_view_list == MBNA_VIEW_LIST_FILESECTIONS)
-		{
-		/* get selected section from list */
-		num_sections = 0;
-		for (i=0;i<project.num_files;i++)
-			{
-			file = &(project.files[i]);
-			for (j=0;j<file->num_sections;j++)
-				{
-				if ((mbna_view_mode == MBNA_VIEW_MODE_ALL)
-					|| (mbna_view_mode == MBNA_VIEW_MODE_SURVEY && mbna_survey_select == file->block)
-					|| (mbna_view_mode == MBNA_VIEW_MODE_FILE && mbna_file_select == i)
-					|| (mbna_view_mode == MBNA_VIEW_MODE_WITHSURVEY && mbna_survey_select == file->block)
-					|| (mbna_view_mode == MBNA_VIEW_MODE_WITHFILE && mbna_file_select == i)
-					|| (mbna_view_mode == MBNA_VIEW_MODE_WITHSECTION && mbna_file_select == i))
-					{
-					if (num_sections == position_list[0] - 1)
-						{
-						mbna_section_select = j;
-						mbna_file_select = i;
-						mbna_survey_select = file->block;
-						}
-					num_sections++;
-					}
-				}
-			}
-		}
-	else if (mbna_view_list == MBNA_VIEW_LIST_CROSSINGS)
-		{
-		/* get selected crossing from list */
-		num_crossings = 0;
-		for (i=0;i<project.num_crossings;i++)
-			{
-			crossing = &(project.crossings[i]);
-			if ((mbna_view_mode == MBNA_VIEW_MODE_ALL)
-				|| (mbna_view_mode == MBNA_VIEW_MODE_SURVEY
-					&& mbna_survey_select == project.files[crossing->file_id_1].block
-					&& mbna_survey_select == project.files[crossing->file_id_2].block)
-				|| (mbna_view_mode == MBNA_VIEW_MODE_FILE
-					&& mbna_file_select == crossing->file_id_1
-					&& mbna_file_select == crossing->file_id_2)
-				|| (mbna_view_mode == MBNA_VIEW_MODE_WITHSURVEY
-					&& (mbna_survey_select == project.files[crossing->file_id_1].block
-						|| mbna_survey_select == project.files[crossing->file_id_2].block))
-				|| (mbna_view_mode == MBNA_VIEW_MODE_WITHFILE
-					&& (mbna_file_select == crossing->file_id_1
-						|| mbna_file_select == crossing->file_id_2))
-				|| (mbna_view_mode == MBNA_VIEW_MODE_WITHSECTION
-					&& mbna_file_select == crossing->file_id_1
-					&& mbna_section_select == crossing->section_1)
-				|| (mbna_view_mode == MBNA_VIEW_MODE_WITHSECTION
-					&& mbna_file_select == crossing->file_id_2
-					&& mbna_section_select == crossing->section_2))
-				{
-				if (num_crossings == position_list[0] - 1)
-					{
-					mbna_crossing_select = i;
-					mbna_tie_select = 0;
-					}
-				num_crossings++;
-				}
-			}
-
-		/* bring up naverr window if required */
-		if (mbna_naverr_load == MB_NO)
-		    {
-		    do_naverr_init();
-		    }
-
-		/* else if naverr window is up, load selected crossing */
-		else
-		    {
-		    mbnavadjust_naverr_specific(mbna_crossing_select, mbna_tie_select);
-		    mbnavadjust_naverr_plot(MBNA_PLOT_MODE_FIRST);
-		    do_update_naverr();
-		    }
-		}
-	else if (mbna_view_list == MBNA_VIEW_LIST_MEDIOCRECROSSINGS)
-		{
-		/* get selected crossing from list */
-		num_crossings = 0;
-		for (i=0;i<project.num_crossings;i++)
-			{
-			crossing = &(project.crossings[i]);
-			if (crossing->overlap >= MBNA_MEDIOCREOVERLAP_THRESHOLD
-				&& ((mbna_view_mode == MBNA_VIEW_MODE_ALL)
-					|| (mbna_view_mode == MBNA_VIEW_MODE_SURVEY
-						&& mbna_survey_select == project.files[crossing->file_id_1].block
-						&& mbna_survey_select == project.files[crossing->file_id_2].block)
-					|| (mbna_view_mode == MBNA_VIEW_MODE_FILE
-						&& mbna_file_select == crossing->file_id_1
-						&& mbna_file_select == crossing->file_id_2)
-					|| (mbna_view_mode == MBNA_VIEW_MODE_WITHSURVEY
-						&& (mbna_survey_select == project.files[crossing->file_id_1].block
-							|| mbna_survey_select == project.files[crossing->file_id_2].block))
-					|| (mbna_view_mode == MBNA_VIEW_MODE_WITHFILE
-						&& (mbna_file_select == crossing->file_id_1
-							|| mbna_file_select == crossing->file_id_2))
-					|| (mbna_view_mode == MBNA_VIEW_MODE_WITHSECTION
-						&& mbna_file_select == crossing->file_id_1
-						&& mbna_section_select == crossing->section_1)
-					|| (mbna_view_mode == MBNA_VIEW_MODE_WITHSECTION
-						&& mbna_file_select == crossing->file_id_2
-						&& mbna_section_select == crossing->section_2)))
-				{
-				if (num_crossings == position_list[0] - 1)
-					{
-					mbna_crossing_select = i;
-					mbna_tie_select = 0;
-					}
-				num_crossings++;
-				}
-			}
-
-		/* bring up naverr window if required */
-		if (mbna_naverr_load == MB_NO)
-		    {
-		    do_naverr_init();
-		    }
-
-		/* else if naverr window is up, load selected crossing */
-		else
-		    {
-		    mbnavadjust_naverr_specific(mbna_crossing_select, mbna_tie_select);
-		    mbnavadjust_naverr_plot(MBNA_PLOT_MODE_FIRST);
-		    do_update_naverr();
-		    }
-		}
-	else if (mbna_view_list == MBNA_VIEW_LIST_GOODCROSSINGS)
-		{
-		/* get selected crossing from list */
-		num_crossings = 0;
-		for (i=0;i<project.num_crossings;i++)
-			{
-			crossing = &(project.crossings[i]);
-			if (crossing->overlap >= MBNA_GOODOVERLAP_THRESHOLD
-				&& ((mbna_view_mode == MBNA_VIEW_MODE_ALL)
-					|| (mbna_view_mode == MBNA_VIEW_MODE_SURVEY
-						&& mbna_survey_select == project.files[crossing->file_id_1].block
-						&& mbna_survey_select == project.files[crossing->file_id_2].block)
-					|| (mbna_view_mode == MBNA_VIEW_MODE_FILE
-						&& mbna_file_select == crossing->file_id_1
-						&& mbna_file_select == crossing->file_id_2)
-					|| (mbna_view_mode == MBNA_VIEW_MODE_WITHSURVEY
-						&& (mbna_survey_select == project.files[crossing->file_id_1].block
-							|| mbna_survey_select == project.files[crossing->file_id_2].block))
-					|| (mbna_view_mode == MBNA_VIEW_MODE_WITHFILE
-						&& (mbna_file_select == crossing->file_id_1
-							|| mbna_file_select == crossing->file_id_2))
-					|| (mbna_view_mode == MBNA_VIEW_MODE_WITHSECTION
-						&& mbna_file_select == crossing->file_id_1
-						&& mbna_section_select == crossing->section_1)
-					|| (mbna_view_mode == MBNA_VIEW_MODE_WITHSECTION
-						&& mbna_file_select == crossing->file_id_2
-						&& mbna_section_select == crossing->section_2)))
-				{
-				if (num_crossings == position_list[0] - 1)
-					{
-					mbna_crossing_select = i;
-					mbna_tie_select = 0;
-					}
-				num_crossings++;
-				}
-			}
-
-		/* bring up naverr window if required */
-		if (mbna_naverr_load == MB_NO)
-		    {
-		    do_naverr_init();
-		    }
-
-		/* else if naverr window is up, load selected crossing */
-		else
-		    {
-		    mbnavadjust_naverr_specific(mbna_crossing_select, mbna_tie_select);
-		    mbnavadjust_naverr_plot(MBNA_PLOT_MODE_FIRST);
-		    do_update_naverr();
-		    }
-		}
-	else if (mbna_view_list == MBNA_VIEW_LIST_BETTERCROSSINGS)
-		{
-		/* get selected crossing from list */
-		num_crossings = 0;
-		for (i=0;i<project.num_crossings;i++)
-			{
-			crossing = &(project.crossings[i]);
-			if (crossing->overlap >= MBNA_BETTEROVERLAP_THRESHOLD
-				&& ((mbna_view_mode == MBNA_VIEW_MODE_ALL)
-					|| (mbna_view_mode == MBNA_VIEW_MODE_SURVEY
-						&& mbna_survey_select == project.files[crossing->file_id_1].block
-						&& mbna_survey_select == project.files[crossing->file_id_2].block)
-					|| (mbna_view_mode == MBNA_VIEW_MODE_FILE
-						&& mbna_file_select == crossing->file_id_1
-						&& mbna_file_select == crossing->file_id_2)
-					|| (mbna_view_mode == MBNA_VIEW_MODE_WITHSURVEY
-						&& (mbna_survey_select == project.files[crossing->file_id_1].block
-							|| mbna_survey_select == project.files[crossing->file_id_2].block))
-					|| (mbna_view_mode == MBNA_VIEW_MODE_WITHFILE
-						&& (mbna_file_select == crossing->file_id_1
-							|| mbna_file_select == crossing->file_id_2))
-					|| (mbna_view_mode == MBNA_VIEW_MODE_WITHSECTION
-						&& mbna_file_select == crossing->file_id_1
-						&& mbna_section_select == crossing->section_1)
-					|| (mbna_view_mode == MBNA_VIEW_MODE_WITHSECTION
-						&& mbna_file_select == crossing->file_id_2
-						&& mbna_section_select == crossing->section_2)))
-				{
-				if (num_crossings == position_list[0] - 1)
-					{
-					mbna_crossing_select = i;
-					mbna_tie_select = 0;
-					}
-				num_crossings++;
-				}
-			}
-
-		/* bring up naverr window if required */
-		if (mbna_naverr_load == MB_NO)
-		    {
-		    do_naverr_init();
-		    }
-
-		/* else if naverr window is up, load selected crossing */
-		else
-		    {
-		    mbnavadjust_naverr_specific(mbna_crossing_select, mbna_tie_select);
-		    mbnavadjust_naverr_plot(MBNA_PLOT_MODE_FIRST);
-		    do_update_naverr();
-		    }
-		}
-	else if (mbna_view_list == MBNA_VIEW_LIST_TRUECROSSINGS)
-		{
-		/* get selected crossing from list */
-		num_crossings = 0;
-		for (i=0;i<project.num_crossings;i++)
-			{
-			crossing = &(project.crossings[i]);
-			if (crossing->truecrossing == MB_YES
-				&& ((mbna_view_mode == MBNA_VIEW_MODE_ALL)
-					|| (mbna_view_mode == MBNA_VIEW_MODE_SURVEY
-						&& mbna_survey_select == project.files[crossing->file_id_1].block
-						&& mbna_survey_select == project.files[crossing->file_id_2].block)
-					|| (mbna_view_mode == MBNA_VIEW_MODE_FILE
-						&& mbna_file_select == crossing->file_id_1
-						&& mbna_file_select == crossing->file_id_2)
-					|| (mbna_view_mode == MBNA_VIEW_MODE_WITHSURVEY
-						&& (mbna_survey_select == project.files[crossing->file_id_1].block
-							|| mbna_survey_select == project.files[crossing->file_id_2].block))
-					|| (mbna_view_mode == MBNA_VIEW_MODE_WITHFILE
-						&& (mbna_file_select == crossing->file_id_1
-							|| mbna_file_select == crossing->file_id_2))
-					|| (mbna_view_mode == MBNA_VIEW_MODE_WITHSECTION
-						&& mbna_file_select == crossing->file_id_1
-						&& mbna_section_select == crossing->section_1)
-					|| (mbna_view_mode == MBNA_VIEW_MODE_WITHSECTION
-						&& mbna_file_select == crossing->file_id_2
-						&& mbna_section_select == crossing->section_2)))
-				{
-				if (num_crossings == position_list[0] - 1)
-					{
-					mbna_crossing_select = i;
-					mbna_tie_select = 0;
-					}
-				num_crossings++;
-				}
-			}
-
-		/* bring up naverr window if required */
-		if (mbna_naverr_load == MB_NO)
-		    {
-		    do_naverr_init();
-		    }
-
-		/* else if naverr window is up, load selected crossing */
-		else
-		    {
-		    mbnavadjust_naverr_specific(mbna_crossing_select, mbna_tie_select);
-		    mbnavadjust_naverr_plot(MBNA_PLOT_MODE_FIRST);
-		    do_update_naverr();
-		    }
-		}
-	else if (mbna_view_list == MBNA_VIEW_LIST_TIES)
-		{
-		/* get crossing and tie from list */
-		num_crossings = 0;
-		num_ties = 0;
-		found = MB_NO;
-		for (i=0;i<project.num_crossings;i++)
-			{
-			crossing = &(project.crossings[i]);
-			if ((mbna_view_mode == MBNA_VIEW_MODE_ALL)
-				|| (mbna_view_mode == MBNA_VIEW_MODE_SURVEY
-					&& mbna_survey_select == project.files[crossing->file_id_1].block
-					&& mbna_survey_select == project.files[crossing->file_id_2].block)
-				|| (mbna_view_mode == MBNA_VIEW_MODE_FILE
-					&& mbna_file_select == crossing->file_id_1
-					&& mbna_file_select == crossing->file_id_2)
-				|| (mbna_view_mode == MBNA_VIEW_MODE_WITHSURVEY
-					&& (mbna_survey_select == project.files[crossing->file_id_1].block
-						|| mbna_survey_select == project.files[crossing->file_id_2].block))
-				|| (mbna_view_mode == MBNA_VIEW_MODE_WITHFILE
-					&& (mbna_file_select == crossing->file_id_1
-						|| mbna_file_select == crossing->file_id_2))
-				|| (mbna_view_mode == MBNA_VIEW_MODE_WITHSECTION
-					&& mbna_file_select == crossing->file_id_1
-					&& mbna_section_select == crossing->section_1)
-				|| (mbna_view_mode == MBNA_VIEW_MODE_WITHSECTION
-					&& mbna_file_select == crossing->file_id_2
-					&& mbna_section_select == crossing->section_2))
-				{
-				for (j=0;j<project.crossings[i].num_ties;j++)
-					{
-					if (num_ties == position_list[0] - 1)
-						{
-						mbna_crossing_select = i;
-						mbna_tie_select = j;
-						found = MB_YES;
-						}
-					num_ties++;
-					}
-				}
-			}
-
-		/* load selected crossing tie into naverr window, global ties ignored */
-		if (found == MB_YES)
-			{
-			/* bring up naverr window if required */
-			if (mbna_naverr_load == MB_NO)
-				{
-				do_naverr_init();
-				}
-	
-			/* else if naverr window is up, load selected crossing */
-			else
-				{
-				mbnavadjust_naverr_specific(mbna_crossing_select, mbna_tie_select);
-				mbnavadjust_naverr_plot(MBNA_PLOT_MODE_FIRST);
-				do_update_naverr();
-				}
-			}
-		}
-     	free(position_list);
-      	}
-
-    /* else user selected same list item, deselecting it  - don't change anything
-    	- bring up naverr if needed - and let do_update_status redraw list with
-	previous item selected */
-    else
-    	{
-	if (mbna_view_list == MBNA_VIEW_LIST_SURVEYS)
-		{
-		}
-	else if (mbna_view_list == MBNA_VIEW_LIST_FILES)
-		{
-		}
-	else if (mbna_view_list == MBNA_VIEW_LIST_FILESECTIONS)
-		{
-		}
-	else if (mbna_view_list == MBNA_VIEW_LIST_CROSSINGS)
-		{
-		/* bring up naverr window if required */
-		if (mbna_naverr_load == MB_NO)
-		    {
-		    do_naverr_init();
-		    }
-		}
-	else if (mbna_view_list == MBNA_VIEW_LIST_GOODCROSSINGS)
-		{
-		/* bring up naverr window if required */
-		if (mbna_naverr_load == MB_NO)
-		    {
-		    do_naverr_init();
-		    }
-		}
-	else if (mbna_view_list == MBNA_VIEW_LIST_BETTERCROSSINGS)
-		{
-		/* bring up naverr window if required */
-		if (mbna_naverr_load == MB_NO)
-		    {
-		    do_naverr_init();
-		    }
-		}
-	else if (mbna_view_list == MBNA_VIEW_LIST_TRUECROSSINGS)
-		{
-		/* bring up naverr window if required */
-		if (mbna_naverr_load == MB_NO)
-		    {
-		    do_naverr_init();
-		    }
-		}
-	else if (mbna_view_list == MBNA_VIEW_LIST_TIES)
-		{
-		/* bring up naverr window if required */
-		if (mbna_naverr_load == MB_NO)
-		    {
-		    do_naverr_init();
-		    }
-		}
-    	}
-
-    do_update_status();
-    if (project.modelplot == MB_YES)
-	{
-	do_update_modelplot_status();
-	mbnavadjust_modelplot_plot();
-	}
-
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_naverr_cont_expose( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-
-    mbnavadjust_naverr_plot(MBNA_PLOT_MODE_FIRST);
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_naverr_corr_expose( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-
-    mbnavadjust_naverr_plot(MBNA_PLOT_MODE_FIRST);
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_naverr_cont_input( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-    XEvent  *event = acs->event;
-    double	x1, x2, y1, y2;
-
-    /* If there is input in the drawing area */
-    if (acs->reason == XmCR_INPUT)
-    {
-      /* Check for mouse pressed. */
-      if (event->xany.type == ButtonPress)
-      {
-	  /* If left mouse button is pushed then save position. */
-	  if (event->xbutton.button == 1)
-		    {
-		    button1down = MB_YES;
-		    loc_x = event->xbutton.x;
-		    loc_y = event->xbutton.y;
-		    mbna_offset_x_old = mbna_offset_x;
-		    mbna_offset_y_old = mbna_offset_y;
-		    mbna_offset_z_old = mbna_offset_z;
-
-		    /* reset offset label */
-		    mbnavadjust_naverr_checkoksettie();
-		    do_naverr_offsetlabel();
-
-		    } /* end of left button events */
-
-	    /* If middle mouse button is pushed */
-	    if (event->xbutton.button == 2)
-		    {
-		    button2down = MB_YES;
-		    mbna_zoom_x1 = event->xbutton.x;
-		    mbna_zoom_y1 = event->xbutton.y;
-		    mbna_zoom_x2 = event->xbutton.x;
-		    mbna_zoom_y2 = event->xbutton.y;
-
-		    /* replot contours */
-		    mbnavadjust_naverr_plot(MBNA_PLOT_MODE_ZOOMFIRST);
-		    } /* end of middle button events */
-
-	    /* If right mouse button is pushed */
-	    if (event->xbutton.button == 3)
-		    {
-		    button3down = MB_YES;
-
-		    /* get new snav points */
-		    mbnavadjust_naverr_snavpoints(event->xbutton.x, event->xbutton.y);
-
-		    /* replot contours */
-		    mbnavadjust_naverr_plot(MBNA_PLOT_MODE_FIRST);
-   		    do_update_naverr();
- 		    } /* end of right button events */
-      } /* end of button press events */
-
-      /* Check for mouse released. */
-      if (event->xany.type == ButtonRelease)
-      {
-	  if (event->xbutton.button == 1)
-	    	{
-	    	button1down = MB_NO;
-	    	}
-	  if (event->xbutton.button == 2)
-	    	{
-	    	button2down = MB_NO;
-	    	mbna_zoom_x2 = event->xbutton.x;
-	    	mbna_zoom_y2 = event->xbutton.y;
-
-	    	x1 = mbna_zoom_x1 / mbna_plotx_scale +  mbna_plot_lon_min;
-	    	y1 = (cont_borders[3] - mbna_zoom_y1) / mbna_ploty_scale +  mbna_plot_lat_min;
-	    	x2 = mbna_zoom_x2 / mbna_plotx_scale +  mbna_plot_lon_min;
-	    	y2 = (cont_borders[3] - mbna_zoom_y2) / mbna_ploty_scale +  mbna_plot_lat_min;
-
-	    	/* get new plot bounds */
-	    	mbna_plot_lon_min = MIN(x1,x2);
-	    	mbna_plot_lon_max = MAX(x1,x2);
-	    	mbna_plot_lat_min = MIN(y1,y2);
-	    	mbna_plot_lat_max = MAX(y1,y2);
-
-		/* replot contours and misfit */
-		mbnavadjust_get_misfit();
-		mbnavadjust_naverr_plot(MBNA_PLOT_MODE_FIRST);
-		do_update_naverr();
-		}
-	  if (event->xbutton.button == 3)
-	    	{
-	    	button3down = MB_NO;
-	    	}
-
-      } /* end of button release events */
-
-      /* Check for mouse motion while pressed. */
-      if (event->xany.type == MotionNotify)
-      {
-	  if (button1down == MB_YES)
-		{
-		/* move offset */
-		mbna_offset_x = mbna_offset_x_old
-		    + (event->xmotion.x - loc_x) / mbna_plotx_scale;
-		mbna_offset_y = mbna_offset_y_old
-		    - (event->xmotion.y - loc_y) / mbna_ploty_scale;
-
-		/* replot contours */
-		mbnavadjust_naverr_plot(MBNA_PLOT_MODE_MOVE);
-		do_naverr_offsetlabel();
-
-		/* reset old position */
-		loc_x = event->xmotion.x;
-		loc_y = event->xmotion.y;
-		mbna_offset_x_old = mbna_offset_x;
-		mbna_offset_y_old = mbna_offset_y;
-		}
-	  else if (button2down == MB_YES)
-		{
-	    	mbna_zoom_x2 = event->xmotion.x;
-		mbna_zoom_y2 = event->xmotion.y;
-
-		/* replot contours */
-		mbnavadjust_naverr_plot(MBNA_PLOT_MODE_ZOOM);
-	    	}
-      }
-    } /* end of inputs from window */
-
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_naverr_corr_input( Widget w, XtPointer client_data, XtPointer call_data)
-{
-	XEvent *event;
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-	event = acs->event;
-
-    /* If there is input in the drawing area */
-    if (acs->reason == XmCR_INPUT)
-    {
-      /* Check for mouse pressed. */
-      if (event->xany.type == ButtonPress)
-      {
-	  /* If left mouse button is pushed then save position. */
-	  if (event->xbutton.button == 1)
-		    {
-		    button1down = MB_YES;
-		    mbna_offset_x_old = mbna_offset_x;
-		    mbna_offset_y_old = mbna_offset_y;
-		    mbna_offset_z_old = mbna_offset_z;
-		    mbna_offset_x = mbna_misfit_offset_x
-				    + (event->xbutton.x
-		    			- (corr_borders[0] + corr_borders[1]) / 2)
-		    			/ mbna_misfit_xscale;
-		    mbna_offset_y = mbna_misfit_offset_y
-				    - (event->xbutton.y
-		    			- (corr_borders[3] + corr_borders[2]) / 2)
-		    			/ mbna_misfit_yscale;
-
-		    /* replot contours */
-		    mbnavadjust_naverr_plot(MBNA_PLOT_MODE_MOVE);
-   		    do_update_naverr();
-		    do_naverr_offsetlabel();
-
-		    } /* end of left button events */
-      } /* end of button press events */
-
-      /* Check for mouse released. */
-      if (event->xany.type == ButtonRelease)
-      {
-	  if (event->xbutton.button == 1)
-	    	{
-	    	button1down = MB_NO;
-	    	}
-      } /* end of button release events */
-
-      /* Check for mouse motion while pressed. */
-      if (event->xany.type == MotionNotify)
-      {
-	  if (button1down == MB_YES)
-		{
-		/* move offset */
-		mbna_offset_x = mbna_misfit_offset_x
-				+ (event->xmotion.x
-		    			- (corr_borders[0] + corr_borders[1]) / 2)
-		    			/ mbna_misfit_xscale;
-		mbna_offset_y = mbna_misfit_offset_y
-				- (event->xmotion.y
-		    			- (corr_borders[3] + corr_borders[2]) / 2)
-		    			/ mbna_misfit_yscale;
-
-		/* replot contours */
-		mbnavadjust_naverr_plot(MBNA_PLOT_MODE_MOVE);
-   		do_update_naverr();
-		do_naverr_offsetlabel();
-
-		/* reset old position */
-		mbna_offset_x_old = mbna_offset_x;
-		mbna_offset_y_old = mbna_offset_y;
-		mbna_offset_z_old = mbna_offset_z;
-		}
-      }
-    } /* end of inputs from window */
-}
-/*--------------------------------------------------------------------*/
-
-void
-do_naverr_zcorr_input( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XEvent *event;
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-    event = acs->event;
-
-    /* If there is input in the drawing area */
-    if (acs->reason == XmCR_INPUT)
-    {
-      /* Check for mouse pressed. */
-      if (event->xany.type == ButtonPress)
-      {
-	  /* If left mouse button is pushed then save position. */
-	  if (event->xbutton.button == 1)
-		{
-		button1down = MB_YES;
-		mbna_offset_x_old = mbna_offset_x;
-		mbna_offset_y_old = mbna_offset_y;
-		mbna_offset_z_old = mbna_offset_z;
-		mbna_offset_z = ((event->xbutton.x - zoff_borders[0])
-		    			/ mbna_zoff_scale_x)
-					+ mbna_misfit_offset_z - 0.5 * project.zoffsetwidth;
-/* fprintf(stderr,"%s %d: mbna_offset_z:%f\n",__FILE__,__LINE__,mbna_offset_z); */
-
-		/* recalculate minimum misfit at current z offset */
-		mbnavadjust_get_misfitxy();
-
-		/* replot contours */
-		mbnavadjust_naverr_plot(MBNA_PLOT_MODE_MOVE);
-   		do_update_naverr();
-		do_naverr_offsetlabel();
-		} /* end of left button events */
-      } /* end of button press events */
-
-      /* Check for mouse released. */
-      if (event->xany.type == ButtonRelease)
-      {
-	  if (event->xbutton.button == 1)
-	    	{
-		button1down = MB_NO;
-		mbnavadjust_crossing_replot();
-		mbnavadjust_naverr_plot(MBNA_PLOT_MODE_FIRST);
-   		do_update_naverr();
-		do_naverr_offsetlabel();
-	    	}
-      } /* end of button release events */
-
-      /* Check for mouse motion while pressed. */
-      if (event->xany.type == MotionNotify)
-      {
-	  if (button1down == MB_YES)
-		{
-		/* move offset */
-		mbna_offset_z = ((event->xbutton.x - zoff_borders[0])
-		    			/ mbna_zoff_scale_x)
-					+ mbna_misfit_offset_z - 0.5 * project.zoffsetwidth;
-/* fprintf(stderr,"buttonx:%d %f  mbna_misfit_offset_z:%f project.zoffsetwidth:%f  mbna_offset_z:%f\n",
-event->xbutton.x,((event->xbutton.x - zoff_borders[0])/mbna_zoff_scale_x), mbna_misfit_offset_z,
-project.zoffsetwidth, mbna_offset_z);
-fprintf(stderr,"%s %d: mbna_offset_z:%f\n",__FILE__,__LINE__,mbna_offset_z); */
-
-		/* recalculate minimum misfit at current z offset */
-		mbnavadjust_get_misfitxy();
-
-		/* replot contours */
-		mbnavadjust_naverr_plot(MBNA_PLOT_MODE_MOVE);
-   		do_update_naverr();
-		do_naverr_offsetlabel();
-
-		/* reset old position */
-		mbna_offset_x_old = mbna_offset_x;
-		mbna_offset_y_old = mbna_offset_y;
-		mbna_offset_z_old = mbna_offset_z;
-		}
-      }
-    } /* end of inputs from window */
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_naverr_previous( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-
-    mbnavadjust_naverr_previous();
-    mbnavadjust_naverr_plot(MBNA_PLOT_MODE_FIRST);
-    do_update_naverr();
-    do_update_status();
-    if (project.modelplot == MB_YES)
-	{
-	do_update_modelplot_status();
-	mbnavadjust_modelplot_plot();
-	}
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_naverr_next( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-
-    mbnavadjust_naverr_next();
-    mbnavadjust_naverr_plot(MBNA_PLOT_MODE_FIRST);
-    do_update_naverr();
-    do_update_status();
-    if (project.modelplot == MB_YES)
-	{
-	do_update_modelplot_status();
-	mbnavadjust_modelplot_plot();
-	}
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_naverr_nextunset( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-
-    mbnavadjust_naverr_nextunset();
-    mbnavadjust_naverr_plot(MBNA_PLOT_MODE_FIRST);
-    do_update_naverr();
-    do_update_status();
-    if (project.modelplot == MB_YES)
-	{
-	do_update_modelplot_status();
-	mbnavadjust_modelplot_plot();
-	}
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_naverr_addtie( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-
-    mbnavadjust_naverr_addtie();
-    mbnavadjust_naverr_plot(MBNA_PLOT_MODE_FIRST);
-    do_update_naverr();
-    do_update_status();
-    if (project.modelplot == MB_YES)
-	{
-	do_update_modelplot_status();
-	mbnavadjust_modelplot_plot();
-	}
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_naverr_deletetie( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-
-    mbnavadjust_naverr_deletetie();
-    mbnavadjust_naverr_plot(MBNA_PLOT_MODE_FIRST);
-    do_update_naverr();
-    do_update_status();
-    if (project.modelplot == MB_YES)
-	{
-	do_update_modelplot_status();
-	mbnavadjust_modelplot_plot();
-	}
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_naverr_selecttie( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-
-    mbnavadjust_naverr_selecttie();
-    mbnavadjust_naverr_plot(MBNA_PLOT_MODE_FIRST);
-    do_update_naverr();
-   do_update_status();
-    if (project.modelplot == MB_YES)
-	{
-	do_update_modelplot_status();
-	mbnavadjust_modelplot_plot();
-	}
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_naverr_unset( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-
-    mbnavadjust_naverr_unset();
-    mbnavadjust_naverr_nextunset();
-    mbnavadjust_naverr_plot(MBNA_PLOT_MODE_FIRST);
-    do_update_naverr();
-    do_update_status();
-    if (project.modelplot == MB_YES)
-	{
-	do_update_modelplot_status();
-	mbnavadjust_modelplot_plot();
-	}
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_naverr_setnone( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-
-    mbnavadjust_naverr_skip();
-    mbnavadjust_naverr_nextunset();
-    mbnavadjust_naverr_plot(MBNA_PLOT_MODE_FIRST);
-    do_update_naverr();
-    do_update_status();
-    if (project.modelplot == MB_YES)
-	{
-	do_update_modelplot_status();
-	mbnavadjust_modelplot_plot();
-	}
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_naverr_setoffset( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-
-    mbnavadjust_naverr_save();
-    mbnavadjust_naverr_plot(MBNA_PLOT_MODE_FIRST);
-    do_update_naverr();
-    do_update_status();
-    if (project.modelplot == MB_YES)
-	{
-	do_update_modelplot_status();
-	mbnavadjust_modelplot_plot();
-	}
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_naverr_resettie( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-
-    mbnavadjust_naverr_resettie();
-    mbnavadjust_naverr_plot(MBNA_PLOT_MODE_FIRST);
-    do_update_naverr();
-    do_update_status();
-    if (project.modelplot == MB_YES)
-	{
-	do_update_modelplot_status();
-	mbnavadjust_modelplot_plot();
-	}
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_dismiss_naverr( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-
-    /* unload loaded crossing */
-    if (mbna_naverr_load == MB_YES)
-	    {
-	    status = mbnavadjust_crossing_unload();
-	    }
-
-    /* deallocate graphics */
-    mbna_status = MBNA_STATUS_GUI;
-    XFreeGC(display,cont_gc);
-    XFreeGC(display,corr_gc);
-    xg_free(cont_xgid);
-    xg_free(corr_xgid);
-    mbnavadjust_naverr_checkoksettie();
-    do_update_naverr();
-    do_update_status();
-    if (project.modelplot == MB_YES)
-	{
-	do_update_modelplot_status();
-	mbnavadjust_modelplot_plot();
-	}
-}
-
-/*--------------------------------------------------------------------*/
-void
-do_naverr_fullsize( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-
-    /* reset the plot bounds */
-    mbna_plot_lon_min = mbna_lon_min;
-    mbna_plot_lon_max = mbna_lon_max;
-    mbna_plot_lat_min = mbna_lat_min;
-    mbna_plot_lat_max = mbna_lat_max;
-    mbnavadjust_get_misfit();
-    mbnavadjust_naverr_plot(MBNA_PLOT_MODE_FIRST);
-    do_update_naverr();
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_naverr_zerooffset( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-
-	/* move offset */
-	mbna_offset_x = 0.0;
-	mbna_offset_y = 0.0;
-	mbna_offset_z = 0.0;
-/* fprintf(stderr,"%s %d: mbna_offset_z:%f\n",__FILE__,__LINE__,mbna_offset_z); */
-
-	/* recalculate minimum misfit at current z offset */
-	mbnavadjust_get_misfitxy();
-
-	/* replot contours */
-	mbnavadjust_crossing_replot();
-	mbnavadjust_naverr_plot(MBNA_PLOT_MODE_FIRST);
-	do_naverr_offsetlabel();
-}
-/*--------------------------------------------------------------------*/
-
-void
-do_naverr_zerozoffset( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-
-	/* move offset */
-	mbna_offset_z = 0.0;
-/* fprintf(stderr,"%s %d: mbna_offset_z:%f\n",__FILE__,__LINE__,mbna_offset_z); */
-
-	/* recalculate minimum misfit at current z offset */
-	mbnavadjust_get_misfitxy();
-
-	/* replot contours */
-	mbnavadjust_crossing_replot();
-	mbnavadjust_naverr_plot(MBNA_PLOT_MODE_FIRST);
-	do_naverr_offsetlabel();
-}
-/*--------------------------------------------------------------------*/
-
-void
-do_naverr_applyzoffset( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-
-	/* recalculate minimum misfit at current z offset */
-	mbnavadjust_get_misfitxy();
-
-	/* replot contours */
-	mbnavadjust_naverr_plot(MBNA_PLOT_MODE_FIRST);
-	do_naverr_offsetlabel();
-	do_update_status();
-    if (project.modelplot == MB_YES)
-	{
-	do_update_modelplot_status();
-	mbnavadjust_modelplot_plot();
-	}
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_naverr_minmisfit( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-
-	/* move offset */
-	mbna_offset_x = mbna_minmisfit_x;
-	mbna_offset_y = mbna_minmisfit_y;
-	mbna_offset_z = mbna_minmisfit_z;
-/* fprintf(stderr,"%s %d: mbna_offset_z:%f\n",__FILE__,__LINE__,mbna_offset_z); */
-
-	/* recalculate minimum misfit at current z offset */
-	mbnavadjust_get_misfitxy();
-
-	/* replot contours */
-	mbnavadjust_crossing_replot();
-   	mbnavadjust_naverr_plot(MBNA_PLOT_MODE_FIRST);
-    	do_update_naverr();
-	do_update_status();
-    if (project.modelplot == MB_YES)
-	{
-	do_update_modelplot_status();
-	mbnavadjust_modelplot_plot();
-	}
-
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_naverr_minxymisfit( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-
-	/* move offset */
-	mbna_offset_x = mbna_minmisfit_xh;
-	mbna_offset_y = mbna_minmisfit_yh;
-	mbna_offset_z = mbna_minmisfit_zh;
-/* fprintf(stderr,"%s %d: mbna_offset_z:%f\n",__FILE__,__LINE__,mbna_offset_z); */
-
-	/* replot contours */
-	mbnavadjust_crossing_replot();
-   	mbnavadjust_naverr_plot(MBNA_PLOT_MODE_FIRST);
-    	do_update_naverr();
-	do_update_status();
-    if (project.modelplot == MB_YES)
-	{
-	do_update_modelplot_status();
-	mbnavadjust_modelplot_plot();
-	}
-}
-/*--------------------------------------------------------------------*/
-
-void
-do_naverr_misfitcenter( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-
-	if (XmToggleButtonGetState(toggleButton_misfitcenter_zero))
-	    mbna_misfit_center = MBNA_MISFIT_ZEROCENTER;
-	else
-	    mbna_misfit_center = MBNA_MISFIT_AUTOCENTER;
-
-	/* replot contours and misfit */
-	mbnavadjust_get_misfit();
-	mbnavadjust_naverr_plot(MBNA_PLOT_MODE_FIRST);
-	do_update_naverr();
-	do_update_status();
-    if (project.modelplot == MB_YES)
-	{
-	do_update_modelplot_status();
-	mbnavadjust_modelplot_plot();
-	}
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_biases_apply( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-    	struct mbna_file *file1;
-    	struct mbna_file *file2;
-	int	ivalue;
-	int	isection;
-
-	/* get file structures */
-	file1 = &(project.files[mbna_file_id_1]);
-	file2 = &(project.files[mbna_file_id_2]);
-
-	XtVaGetValues(scale_biases_heading1,
-			XmNvalue, &ivalue,
-			NULL);
-	file1->heading_bias = 0.1 * ivalue;
-
-	XtVaGetValues(scale_biases_roll1,
-			XmNvalue, &ivalue,
-			NULL);
-	file1->roll_bias = 0.1 * ivalue;
-
-	XtVaGetValues(scale_biases_heading2,
-			XmNvalue, &ivalue,
-			NULL);
-	file2->heading_bias = 0.1 * ivalue;
-
-	XtVaGetValues(scale_biases_roll2,
-			XmNvalue, &ivalue,
-			NULL);
-	file2->roll_bias = 0.1 * ivalue;
-
-	/* set contours out of date */
-	for (isection=0;isection<file1->num_sections;isection++)
-		{
-		file1->sections[isection].contoursuptodate = MB_NO;
-		}
-	for (isection=0;isection<file2->num_sections;isection++)
-		{
-		file2->sections[isection].contoursuptodate = MB_NO;
-		}
-
-	mbnavadjust_crossing_replot();
-	mbnavadjust_get_misfit();
-	mbnavadjust_naverr_plot(MBNA_PLOT_MODE_FIRST);
-	do_update_status();
-    if (project.modelplot == MB_YES)
-	{
-	do_update_modelplot_status();
-	mbnavadjust_modelplot_plot();
-	}
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_biases_applyall( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-	double	heading_bias;
-	double	roll_bias;
-    	struct mbna_file *file;
-	int	ivalue;
-	int	ifile, isection;
-
-	/* get bias values */
-	XtVaGetValues(scale_biases_heading1,
-			XmNvalue, &ivalue,
-			NULL);
-	heading_bias = 0.1 * ivalue;
-	XtVaGetValues(scale_biases_roll1,
-			XmNvalue, &ivalue,
-			NULL);
-	roll_bias = 0.1 * ivalue;
-
-	/* loop over files */
-	for (ifile=0;ifile<project.num_files;ifile++)
-		{
-		file = &(project.files[ifile]);
-		file->heading_bias = heading_bias;
-		file->roll_bias = roll_bias;
-
-		/* set contours out of date */
-		for (isection=0;isection<file->num_sections;isection++)
-			{
-			file->sections[isection].contoursuptodate = MB_NO;
-			}
-		}
-
-	mbnavadjust_crossing_replot();
-	mbnavadjust_get_misfit();
-	mbnavadjust_naverr_plot(MBNA_PLOT_MODE_FIRST);
-	do_update_status();
-    if (project.modelplot == MB_YES)
-	{
-	do_update_modelplot_status();
-	mbnavadjust_modelplot_plot();
-	}
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_biases_init( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-    	struct mbna_file *file1;
-    	struct mbna_file *file2;
-	char	value_text[128];
-
-	/* get file structures */
-	file1 = &(project.files[mbna_file_id_1]);
-	file2 = &(project.files[mbna_file_id_2]);
-
-	/* set biases label */
-	sprintf(value_text, ":::t\"Section ID\'s (file:section):\":t\"  Section 1: %4.4d:%4.4d\"\"  Section 2: %4.4d:%4.4d\"",
-		mbna_file_id_1, mbna_section_1,
-		mbna_file_id_2, mbna_section_2);
-	set_label_multiline_string(label_biases_files, value_text);
-
-	/* set biases radiobox */
-	if (file1->heading_bias == file2->heading_bias
-	    && file1->roll_bias == file2->roll_bias)
-	    {
-	    mbna_bias_mode = MBNA_BIAS_SAME;
-	    XmToggleButtonSetState(toggleButton_biases_together,
-			TRUE, TRUE);
-	    }
-	else
-	    {
-	    mbna_bias_mode = MBNA_BIAS_DIFFERENT;
-	    XmToggleButtonSetState(toggleButton_biases_separate,
-			TRUE, TRUE);
-	    }
-
-	/* set values of bias sliders */
-	XtVaSetValues(scale_biases_heading1,
-			XmNvalue, (int) (10 * file1->heading_bias),
-			NULL);
-	XtVaSetValues(scale_biases_roll1,
-			XmNvalue, (int) (10 * file1->roll_bias),
-			NULL);
-	if (mbna_bias_mode == MBNA_BIAS_DIFFERENT)
-		{
-		XtVaSetValues(scale_biases_heading2,
-			XmNvalue, (int) (10 * file2->heading_bias),
-			XmNsensitive, True,
-			NULL);
-		XtVaSetValues(scale_biases_roll2,
-			XmNvalue, (int) (10 * file2->roll_bias),
-			XmNsensitive, True,
-			NULL);
-		XtVaSetValues(pushButton_biases_applyall,
-			XmNsensitive, False,
-			NULL);
-		}
-	else
-		{
-		XtVaSetValues(scale_biases_heading2,
-			XmNvalue, (int) (10 * file2->heading_bias),
-			XmNsensitive, False,
-			NULL);
-		XtVaSetValues(scale_biases_roll2,
-			XmNvalue, (int) (10 * file2->roll_bias),
-			XmNsensitive, False,
-			NULL);
-		XtVaSetValues(pushButton_biases_applyall,
-			XmNsensitive, True,
-			NULL);
-		}
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_biases_toggle( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-	int	ivalue;
-
-	if (XmToggleButtonGetState(toggleButton_biases_together))
-	    {
-	    if (mbna_bias_mode == MBNA_BIAS_DIFFERENT)
-		{
-		mbna_bias_mode = MBNA_BIAS_SAME;
-		XtVaGetValues(scale_biases_heading1,
-				XmNvalue, &ivalue,
-				NULL);
-		XtVaSetValues(scale_biases_heading2,
-				XmNvalue, ivalue,
-				XmNsensitive, False,
-				NULL);
-		XtVaGetValues(scale_biases_roll1,
-				XmNvalue, &ivalue,
-				NULL);
-		XtVaSetValues(scale_biases_roll2,
-				XmNvalue, ivalue,
-				XmNsensitive, False,
-				NULL);
-		XtVaSetValues(pushButton_biases_applyall,
-				XmNsensitive, True,
-				NULL);
-		}
-	    }
-	else
-	    {
-	    if (mbna_bias_mode == MBNA_BIAS_SAME)
-		{
-		mbna_bias_mode = MBNA_BIAS_DIFFERENT;
-		XtVaSetValues(scale_biases_heading2,
-				XmNsensitive, True,
-				NULL);
-		XtVaSetValues(scale_biases_roll2,
-				XmNsensitive, True,
-				NULL);
-		XtVaSetValues(pushButton_biases_applyall,
-				XmNsensitive, False,
-				NULL);
-		}
-	    }
-
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_biases_heading( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-	int	ivalue;
-
-	if (mbna_bias_mode == MBNA_BIAS_SAME)
-	    {
-	    XtVaGetValues(scale_biases_heading1,
-			    XmNvalue, &ivalue,
-			    NULL);
-	    XtVaSetValues(scale_biases_heading2,
-			    XmNvalue, ivalue,
-			    XmNsensitive, False,
-			    NULL);
-	    }
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_biases_roll( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-	int	ivalue;
-
-	if (mbna_bias_mode == MBNA_BIAS_SAME)
-	    {
-	    XtVaGetValues(scale_biases_roll1,
-			    XmNvalue, &ivalue,
-			    NULL);
-	    XtVaSetValues(scale_biases_roll2,
-			    XmNvalue, ivalue,
-			    XmNsensitive, False,
-			    NULL);
-	    }
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_controls_apply( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-    int	ivalue;
-
-    /* get value of decimation slider */
-    XtVaGetValues(scale_controls_decimation,
-		XmNvalue, &project.decimation,
-		NULL);
-
-    /* get values of section length slider */
-    XtVaGetValues(scale_controls_sectionlength,
-		XmNvalue, &ivalue,
-		NULL);
-    project.section_length = ((double) ivalue) / 100.0;
-
-    /* get values of section soundings slider */
-    XtVaGetValues(scale_controls_sectionsoundings,
-		XmNvalue, &ivalue,
-		NULL);
-    project.section_soundings = ivalue;
-
-    /* get values of contour interval slider */
-    XtVaGetValues(scale_controls_contourinterval,
-		XmNvalue, &ivalue,
-		NULL);
-    project.cont_int = ((double) ivalue) / 100.0;
-
-    /* get values of color interval slider */
-    XtVaGetValues(scale_controls_colorinterval,
-		XmNvalue, &ivalue,
-		NULL);
-    project.col_int = ((double) ivalue) / 100.0;
-
-    /* get values of tick interval slider */
-    XtVaGetValues(scale_controls_tickinterval,
-		XmNvalue, &ivalue,
-		NULL);
-    project.tick_int = ((double) ivalue) / 100.0;
-
-    /* get values of inversion smoothing slider */
-    XtVaGetValues(scale_controls_smoothing,
-		XmNvalue, &ivalue,
-		NULL);
-    project.smoothing = ((double) ivalue) / 100.0;
-
-    /* get values of z offset width slider */
-    XtVaGetValues(scale_controls_zoffset,
-		XmNvalue, &ivalue,
-		NULL);
-    project.zoffsetwidth = ((double) ivalue);
-
-    if (mbna_file_id_1 >= 0 && mbna_section_1 >= 0)
-   	 project.files[mbna_file_id_1].sections[mbna_section_1].contoursuptodate = MB_NO;
-    if (mbna_file_id_2 >= 0 && mbna_section_2 >= 0)
-   	 project.files[mbna_file_id_2].sections[mbna_section_2].contoursuptodate = MB_NO;
-
-    mbnavadjust_crossing_replot();
-    mbnavadjust_write_project();
-    mbnavadjust_get_misfit();
-    mbnavadjust_naverr_plot(MBNA_PLOT_MODE_FIRST);
-    do_update_naverr();
-    do_update_status();
-    if (project.modelplot == MB_YES)
-	{
-	do_update_modelplot_status();
-	mbnavadjust_modelplot_plot();
-	}
-}
-
-
-/*--------------------------------------------------------------------*/
-void
-do_scale_controls_sectionlength( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
- }
-
-/*--------------------------------------------------------------------*/
-void
-do_scale_controls_sectionsoundings( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-    int	    ivalue;
-    int	    imin, imax;
-
-	/* get values of section soundings slider */
-	XtVaGetValues(scale_controls_sectionsoundings,
-		    XmNvalue, &ivalue,
-		    XmNminimum, &imin,
-		    XmNmaximum, &imax,
-		    NULL);
-
-	/* recalculate max value if needed */
-	if (ivalue == imin)
-	    {
-	    imax = MAX(imax / 2, 2 * imin);
-	    }
-	if (ivalue == imax)
-	    {
-	    imax = 2 * imax;
-	    }
-
-	/* reset values of section soundings slider */
-	XtVaSetValues(scale_controls_sectionsoundings,
-			XmNmaximum, imax,
-			XmNvalue, ivalue,
-			NULL);
-}
-
-/*--------------------------------------------------------------------*/
-void
-do_scale_controls_decimation( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-}
-
-/*--------------------------------------------------------------------*/
-void
-do_scale_contourinterval( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-    int	    ivalue;
-    int	    imax;
-
-	/* get values of contour interval slider */
-	XtVaGetValues(scale_controls_contourinterval,
-		    XmNvalue, &ivalue,
-		    XmNmaximum, &imax,
-		    NULL);
-
-	/* reset values of contour interval slider to round numbers */
-	if (ivalue > 2500)
-	    ivalue = ((ivalue + 500) / 1000) * 1000;
-	else if (ivalue > 500)
-	    ivalue = ((ivalue + 250) / 500) * 500;
-	else if (ivalue > 100)
-	    ivalue = ((ivalue + 50) / 100) * 100;
-	else if (ivalue > 50)
-	    ivalue = ((ivalue + 25) / 50) * 50;
-	else if (ivalue > 10)
-	    ivalue = ((ivalue + 5) / 10) * 10;
-	else if (ivalue > 5)
-	    ivalue = ((ivalue + 2) / 5) * 5;
-	if (ivalue == 1 && imax >= 40000)
-	    imax = 500;
-	if (ivalue == imax && imax <= 500)
-	    imax = 40000;
-	XtVaSetValues(scale_controls_contourinterval,
-			XmNminimum, 1,
-			XmNmaximum, imax,
-			XmNdecimalPoints, 2,
-			XmNvalue, ivalue,
-			NULL);
-
-}
-
-/*--------------------------------------------------------------------*/
-void
-do_scale_controls_tickinterval( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-    int	    ivalue;
-    int	    imax;
-
-	/* get values of tick interval slider */
-	XtVaGetValues(scale_controls_tickinterval,
-		    XmNvalue, &ivalue,
-		    XmNmaximum, &imax,
-		    NULL);
-
-	/* reset values of tick interval slider to round numbers */
-	if (ivalue > 2500)
-	    ivalue = ((ivalue + 500) / 1000) * 1000;
-	else if (ivalue > 500)
-	    ivalue = ((ivalue + 250) / 500) * 500;
-	else if (ivalue > 100)
-	    ivalue = ((ivalue + 50) / 100) * 100;
-	else if (ivalue > 50)
-	    ivalue = ((ivalue + 25) / 50) * 50;
-	else if (ivalue > 10)
-	    ivalue = ((ivalue + 5) / 10) * 10;
-	else if (ivalue > 5)
-	    ivalue = ((ivalue + 2) / 5) * 5;
-	if (ivalue == 1 && imax >= 40000)
-	    imax = 500;
-	if (ivalue == imax && imax <= 500)
-	    imax = 40000;
-	XtVaSetValues(scale_controls_tickinterval,
-			XmNminimum, 1,
-			XmNmaximum, imax,
-			XmNdecimalPoints, 2,
-			XmNvalue, ivalue,
-			NULL);
-}
-
-/*--------------------------------------------------------------------*/
-void
-do_controls_scale_colorinterval( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-    int	    ivalue;
-    int	    imax;
-
-	/* get values of color interval slider */
-	XtVaGetValues(scale_controls_colorinterval,
-		    XmNvalue, &ivalue,
-		    XmNmaximum, &imax,
-		    NULL);
-
-	/* reset values of color interval slider to round numbers */
-	if (ivalue > 2500)
-	    ivalue = ((ivalue + 500) / 1000) * 1000;
-	else if (ivalue > 500)
-	    ivalue = ((ivalue + 250) / 500) * 500;
-	else if (ivalue > 100)
-	    ivalue = ((ivalue + 50) / 100) * 100;
-	else if (ivalue > 50)
-	    ivalue = ((ivalue + 25) / 50) * 50;
-	else if (ivalue > 10)
-	    ivalue = ((ivalue + 5) / 10) * 10;
-	else if (ivalue > 5)
-	    ivalue = ((ivalue + 2) / 5) * 5;
-	if (ivalue == 1 && imax >= 40000)
-	    imax = 500;
-	if (ivalue == imax && imax <= 500)
-	    imax = 40000;
-	XtVaSetValues(scale_controls_colorinterval,
-			XmNminimum, 1,
-			XmNmaximum, imax,
-			XmNdecimalPoints, 2,
-			XmNvalue, ivalue,
-			NULL);
-}
-/*--------------------------------------------------------------------*/
-
-void
-do_scale_controls_smoothing( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-}
-/*--------------------------------------------------------------------*/
-
-void
-do_scale_controls_zoffset( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-}
-
-/*--------------------------------------------------------------------*/
-void
-do_file_new( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-fprintf(stderr,"do_file_new\n");
-}
-
-/*--------------------------------------------------------------------*/
-void
-do_file_open( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-fprintf(stderr,"do_file_open\n");
-}
-
-/*--------------------------------------------------------------------*/
-void
-do_file_importdata( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-fprintf(stderr,"do_file_importdata\n");
-}
-
-/*--------------------------------------------------------------------*/
-void
-do_file_close( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-
-    mbnavadjust_close_project();
-    do_update_status();
-    if (project.modelplot == MB_YES)
-	{
-	do_update_modelplot_status();
-	mbnavadjust_modelplot_plot();
-	}
-}
-
-/*--------------------------------------------------------------------*/
-void
-do_quit( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-
-    /* unload loaded crossing */
-    if (mbna_naverr_load == MB_YES)
-	    {
-	    status = mbnavadjust_crossing_unload();
-
-	    /* deallocate graphics */
-	    mbna_status = MBNA_STATUS_GUI;
-	    XFreeGC(display,cont_gc);
-	    XFreeGC(display,corr_gc);
-	    xg_free(cont_xgid);
-	    xg_free(corr_xgid);
-	    mbnavadjust_naverr_checkoksettie();
-	    do_update_naverr();
-	    do_update_status();
-	    }
-}
-
-/*--------------------------------------------------------------------*/
-void
-do_fileselection_mode( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-
-    file_mode = (size_t) client_data;
-
-    /* desl with selection */
-    if (file_mode == FILE_MODE_NEW)
-    	{
-	tmp0 = (XmString) BX_CONVERT(fileSelectionBox, "*.nvh",
-                                          XmRXmString, 0, &argok);
-    	}
-    else if (file_mode == FILE_MODE_OPEN)
-    	{
-	tmp0 = (XmString) BX_CONVERT(fileSelectionBox, "*.nvh",
-                                          XmRXmString, 0, &argok);
-    	}
-    else if (file_mode == FILE_MODE_IMPORT)
-    	{
-	tmp0 = (XmString) BX_CONVERT(fileSelectionBox, "*.mb-1",
-                                          XmRXmString, 0, &argok);
-    	}
-    else
-    	{
-	tmp0 = (XmString) BX_CONVERT(fileSelectionBox, "*.nvh",
-                                          XmRXmString, 0, &argok);
-    	}
-
-    ac = 0;
-    XtSetArg(args[ac], XmNpattern, tmp0); ac++;
-    XtSetValues(fileSelectionBox, args, ac);
-    XmStringFree((XmString)tmp0);
-
-}
-
-/*--------------------------------------------------------------------*/
-void
-do_fileselection_ok( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    char ifile[STRING_MAX];
-    char format_text[40];
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-
-    /* get input filename */
-    get_text_string(fileSelectionBox_text, ifile);
-
-    /* desl with selection */
-    if (file_mode == FILE_MODE_NEW)
-    	{
-        status = mbnavadjust_file_new(ifile);
-    	}
-    else if (file_mode == FILE_MODE_OPEN)
-    	{
-        status = mbnavadjust_file_open(ifile);
-    	}
-    else if (file_mode == FILE_MODE_IMPORT)
-    	{
-	get_text_string(textField_format, format_text);
-	sscanf(format_text,"%d",&format);
-    	status = mbnavadjust_import_data(ifile,format);
-    	}
-    do_update_status();
-}
-
-/*--------------------------------------------------------------------*/
-void
-do_fileselection_cancel( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-
-    file_mode = FILE_MODE_NONE;
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_view_showallsurveys( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-
-    mbna_view_mode = MBNA_VIEW_MODE_ALL;
-    do_update_status();
-    if (project.modelplot == MB_YES)
-	{
-	do_update_modelplot_status();
-	mbnavadjust_modelplot_plot();
-	}
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_view_showselectedsurveys( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-
-    mbna_view_mode = MBNA_VIEW_MODE_SURVEY;
-    do_update_status();
-    if (project.modelplot == MB_YES)
-	{
-	do_update_modelplot_status();
-	mbnavadjust_modelplot_plot();
-	}
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_view_showselectedfile( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-
-    mbna_view_mode = MBNA_VIEW_MODE_FILE;
-    do_update_status();
-    if (project.modelplot == MB_YES)
-	{
-	do_update_modelplot_status();
-	mbnavadjust_modelplot_plot();
-	}
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_view_showwithselectedsurveys( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-
-    mbna_view_mode = MBNA_VIEW_MODE_WITHSURVEY;
-    do_update_status();
-    if (project.modelplot == MB_YES)
-	{
-	do_update_modelplot_status();
-	mbnavadjust_modelplot_plot();
-	}
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_view_showwithselectedfile( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-
-    mbna_view_mode = MBNA_VIEW_MODE_WITHFILE;
-    do_update_status();
-    if (project.modelplot == MB_YES)
-	{
-	do_update_modelplot_status();
-	mbnavadjust_modelplot_plot();
-	}
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_view_showselectedsection( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-
-    mbna_view_mode = MBNA_VIEW_MODE_WITHSECTION;
-    do_update_status();
-    if (project.modelplot == MB_YES)
-	{
-	do_update_modelplot_status();
-	mbnavadjust_modelplot_plot();
-	}
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_view_showsurveys( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-
-    mbna_view_list = MBNA_VIEW_LIST_SURVEYS;
-    do_update_status();
-    if (project.modelplot == MB_YES)
-	{
-	do_update_modelplot_status();
-	mbnavadjust_modelplot_plot();
-	}
-}
-
-/*--------------------------------------------------------------------*/
-void
-do_view_showdata( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-
-    mbna_view_list = MBNA_VIEW_LIST_FILES;
-    do_update_status();
-    if (project.modelplot == MB_YES)
-	{
-	do_update_modelplot_status();
-	mbnavadjust_modelplot_plot();
-	}
-}
-/*--------------------------------------------------------------------*/
-
-void
-do_view_showsections( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-
-    mbna_view_list = MBNA_VIEW_LIST_FILESECTIONS;
-    do_update_status();
-    if (project.modelplot == MB_YES)
-	{
-	do_update_modelplot_status();
-	mbnavadjust_modelplot_plot();
-	}
-}
-
-/*--------------------------------------------------------------------*/
-void
-do_view_showcrossings( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-
-    mbna_view_list = MBNA_VIEW_LIST_CROSSINGS;
-    do_update_status();
-    if (project.modelplot == MB_YES)
-	{
-	do_update_modelplot_status();
-	mbnavadjust_modelplot_plot();
-	}
-}
-/*--------------------------------------------------------------------*/
-
-void
-do_view_showmediocrecrossings( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-
-    mbna_view_list = MBNA_VIEW_LIST_MEDIOCRECROSSINGS;
-    do_update_status();
-    if (project.modelplot == MB_YES)
-	{
-	do_update_modelplot_status();
-	mbnavadjust_modelplot_plot();
-	}
-}
-/*--------------------------------------------------------------------*/
-
-void
-do_view_showgoodcrossings( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-
-    mbna_view_list = MBNA_VIEW_LIST_GOODCROSSINGS;
-    do_update_status();
-    if (project.modelplot == MB_YES)
-	{
-	do_update_modelplot_status();
-	mbnavadjust_modelplot_plot();
-	}
-}
-/*--------------------------------------------------------------------*/
-
-void
-do_view_showbettercrossings( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-
-    mbna_view_list = MBNA_VIEW_LIST_BETTERCROSSINGS;
-    do_update_status();
-    if (project.modelplot == MB_YES)
-	{
-	do_update_modelplot_status();
-	mbnavadjust_modelplot_plot();
-	}
-}
-
-/*--------------------------------------------------------------------*/
-void
-do_view_showtruecrossings( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-
-    mbna_view_list = MBNA_VIEW_LIST_TRUECROSSINGS;
-    do_update_status();
-    if (project.modelplot == MB_YES)
-	{
-	do_update_modelplot_status();
-	mbnavadjust_modelplot_plot();
-	}
-}
-
-/*--------------------------------------------------------------------*/
-void
-do_view_showties( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-
-    mbna_view_list = MBNA_VIEW_LIST_TIES;
-    do_update_status();do_update_status();
-    if (project.modelplot == MB_YES)
-	{
-	do_update_modelplot_status();
-	mbnavadjust_modelplot_plot();
-	}
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_action_poornav( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-
-    mbnavadjust_poornav_file();
-    do_update_status();
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_action_goodnav( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-
-    mbnavadjust_goodnav_file();
-    do_update_status();
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_action_fixednav( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-
-    mbnavadjust_fixednav_file();
-    do_update_status();
-}
-/*--------------------------------------------------------------------*/
-
-void
-do_action_fixedxynav( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-
-    mbnavadjust_fixedxynav_file();
-    do_update_status();
-}
-/*--------------------------------------------------------------------*/
-
-void
-do_action_fixedznav( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-
-    mbnavadjust_fixedznav_file();
-    do_update_status();
-}
-/*--------------------------------------------------------------------*/
-
-void
-do_action_tie_xy( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs = (XmAnyCallbackStruct*)call_data;
-    acs = (XmAnyCallbackStruct*)call_data;
-
-    mbnavadjust_set_tie_xy();
-    do_update_status();
-    if (project.modelplot == MB_YES)
-	{
-	do_update_modelplot_status();
-	mbnavadjust_modelplot_plot();
-	}
-}
-/*--------------------------------------------------------------------*/
-
-void
-do_action_z( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs = (XmAnyCallbackStruct*)call_data;
-    acs = (XmAnyCallbackStruct*)call_data;
-
-    mbnavadjust_set_tie_z();
-    do_update_status();
-    if (project.modelplot == MB_YES)
-	{
-	do_update_modelplot_status();
-	mbnavadjust_modelplot_plot();
-	}
-}
-/*--------------------------------------------------------------------*/
-
-void
-do_action_tie_xyz( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs = (XmAnyCallbackStruct*)call_data;
-    acs = (XmAnyCallbackStruct*)call_data;
-
-    mbnavadjust_set_tie_xyz();
-    do_update_status();
-    if (project.modelplot == MB_YES)
-	{
-	do_update_modelplot_status();
-	mbnavadjust_modelplot_plot();
-	}
-}
-/*--------------------------------------------------------------------*/
-
-void
-do_action_autopick( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-
-    mbna_status = MBNA_STATUS_AUTOPICK;
-    mbnavadjust_autopick(MB_YES);
-    mbna_status = MBNA_STATUS_GUI;
-    do_update_status();
-    if (project.modelplot == MB_YES)
-	{
-	do_update_modelplot_status();
-	mbnavadjust_modelplot_plot();
-	}
-
-}
-/*--------------------------------------------------------------------*/
-
-void
-do_action_autopickhorizontal( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-
-    mbna_status = MBNA_STATUS_AUTOPICK;
-    mbnavadjust_autopick(MB_NO);
-    mbna_status = MBNA_STATUS_GUI;
-    do_update_status();
-    if (project.modelplot == MB_YES)
-	{
-	do_update_modelplot_status();
-	mbnavadjust_modelplot_plot();
-	}
-
-}
-/*--------------------------------------------------------------------*/
-
-void
-do_action_autosetsvsvertical( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-
-    mbna_status = MBNA_STATUS_AUTOPICK;
-    mbnavadjust_autosetsvsvertical();
-    mbna_status = MBNA_STATUS_GUI;
-    do_update_status();
-    if (project.modelplot == MB_YES)
-	{
-	do_update_modelplot_status();
-	mbnavadjust_modelplot_plot();
-	}
-
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_action_analyzecrossings( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_action_checknewcrossings( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-
-    mbnavadjust_findcrossings();
-    do_update_status();
-    if (project.modelplot == MB_YES)
-	{
-	do_update_modelplot_status();
-	mbnavadjust_modelplot_plot();
-	}
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_zerozoffsets( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-
-    mbnavadjust_zerozoffsets();
-    do_update_status();
-    if (project.modelplot == MB_YES)
-	{
-	do_update_modelplot_status();
-	mbnavadjust_modelplot_plot();
-	}
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_action_invertnav( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-
-    mbna_status = MBNA_STATUS_NAVSOLVE;
-    mbnavadjust_invertnav();
-    mbna_status = MBNA_STATUS_GUI;
-    do_update_status();
-    if (project.modelplot == MB_YES)
-	{
-	do_update_modelplot_status();
-	mbnavadjust_modelplot_plot();
-	}
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_apply_nav( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-    mbnavadjust_applynav();
-    do_update_status();
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_modelplot_show( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-    Window	modp_xid;
-    Dimension	width, height;
-
-    /* get drawingArea size */
-    XtVaGetValues(drawingArea_modelplot,
-	XmNwidth, &width,
-	XmNheight, &height,
-	NULL);
-    mbna_modelplot_width = width;
-    mbna_modelplot_height = height;
-    modp_borders[0] = 0;
-    modp_borders[1] = mbna_modelplot_width - 1;
-    modp_borders[2] = 0;
-    modp_borders[3] = mbna_modelplot_height - 1;
-
-    /* Setup just the "canvas" part of the screen. */
-    modp_xid = XtWindow(drawingArea_modelplot);
-
-    /* Setup the "graphics Context" for just the "canvas" */
-    xgcv.background = WhitePixelOfScreen(DefaultScreenOfDisplay(display));
-    xgcv.foreground = BlackPixelOfScreen(DefaultScreenOfDisplay(display));
-    xgcv.line_width = 2;
-    modp_gc = XCreateGC(display, modp_xid, GCBackground | GCForeground
-	     | GCLineWidth, &xgcv);
-
-    /* Setup the font for just the "canvas" screen. */
-    fontStruct = XLoadQueryFont(display, xgfont);
-    if (fontStruct == NULL)
-        {
-	fprintf(stderr,"\nFailure to load font using XLoadQueryFont: %s\n", xgfont);
-        fprintf(stderr,"\tSource file: %s\n\tSource line: %d\n\tSource version: %s", __FILE__, __LINE__, svn_id);
-	fprintf(stderr,"\nProgram <%s> Terminated\n", program_name);
-	exit(-1);
-        }
-    XSetFont(display,modp_gc,fontStruct->fid);
-    XSelectInput(display, modp_xid, EV_MASK );
-
-    /* Setup cursors. */
-    myCursor = XCreateFontCursor(display, XC_target);
-    XRecolorCursor(display,myCursor,&colors[2],&colors[5]);
-    XDefineCursor(display,modp_xid,myCursor);
-
-    /* initialize graphics */
-    xg_init(display, modp_xid, modp_borders, xgfont, &modp_xgid);
-    status = mbnavadjust_set_modelplot_graphics(modp_xgid, modp_borders);
-
-    /* set status flag */
-    project.modelplot = MB_YES;
-    mbna_modelplot_zoom = MB_NO;
-    mbna_modelplot_zoom_x1 = 0;
-    mbna_modelplot_zoom_x2 = 0;
-    mbna_modelplot_start = 0;
-    mbna_modelplot_end = 0;
-    mbna_modelplot_pickfile = MBNA_SELECT_NONE;
-    mbna_modelplot_picksection = MBNA_SELECT_NONE;
-    mbna_modelplot_picksnav = MBNA_SELECT_NONE;
-    mbna_modelplot_blocksurvey1 = MBNA_SELECT_NONE;
-    mbna_modelplot_blocksurvey2 = MBNA_SELECT_NONE;
-
-    /* update status */
-    do_update_status();
-    if (project.modelplot == MB_YES)
-	{
-	do_update_modelplot_status();
-	mbnavadjust_modelplot_plot();
-	}
-}
-/*--------------------------------------------------------------------*/
-
-void
-do_modelplot_dismiss( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-
-    /* deallocate graphics */
-    project.modelplot = MB_NO;
-    XFreeGC(display,modp_gc);
-    xg_free(modp_xgid);
-}
-
-/*------------------------------------------------------------------------------*/
-void
-do_modelplot_resize( Widget w, XtPointer client_data, XEvent *event, Boolean *unused)
-{
-    Window	modp_xid;
-	XConfigureEvent *cevent = (XConfigureEvent *) event;
-	Dimension	width, height;
-
-	/* do this only if a resize event happens */
-	if (cevent->type == ConfigureNotify)
-	    {
-	    /* get new shell size */
-	    XtVaGetValues(bulletinBoard_modelplot,
-	    	XmNwidth, &width,
-	    	XmNheight, &height,
-	   	NULL);
-
-	    /* do this only if the shell was REALLY resized and not just moved */
-	    if (mbna_modelplot_width != width - MBNA_MODELPLOT_LEFT_WIDTH
-	    	|| mbna_modelplot_height != height - MBNA_MODELPLOT_LEFT_HEIGHT)
-	    	{
-		/* set drawing area size */
-		mbna_modelplot_width = width - MBNA_MODELPLOT_LEFT_WIDTH;
-		mbna_modelplot_height = height - MBNA_MODELPLOT_LEFT_HEIGHT;
-		ac = 0;
-		XtSetArg(args[ac], XmNwidth, (Dimension) mbna_modelplot_width); ac++;
-		XtSetArg(args[ac], XmNheight,(Dimension) mbna_modelplot_height); ac++;
-		XtSetValues(drawingArea_modelplot, args, ac);
-
-		/* deallocate graphics */
-		XFreeGC(display,modp_gc);
-		xg_free(modp_xgid);
-
-		/* get drawingArea size */
-		modp_borders[0] = 0;
-		modp_borders[1] = mbna_modelplot_width - 1;
-		modp_borders[2] = 0;
-		modp_borders[3] = mbna_modelplot_height - 1;
-
-		/* Setup just the "canvas" part of the screen. */
-		modp_xid = XtWindow(drawingArea_modelplot);
-
-		/* Setup the "graphics Context" for just the "canvas" */
-		xgcv.background = WhitePixelOfScreen(DefaultScreenOfDisplay(display));
-		xgcv.foreground = BlackPixelOfScreen(DefaultScreenOfDisplay(display));
-		xgcv.line_width = 2;
-		modp_gc = XCreateGC(display,modp_xid,GCBackground | GCForeground
-			 | GCLineWidth, &xgcv);
-
-		/* Setup the font for just the "canvas" screen. */
-		fontStruct = XLoadQueryFont(display, xgfont);
-		if (fontStruct == NULL)
-		    {
-		    fprintf(stderr,"\nFailure to load font using XLoadQueryFont: %s\n", xgfont);
-		    fprintf(stderr,"\tSource file: %s\n\tSource line: %d\n\tSource version: %s", __FILE__, __LINE__, svn_id);
-		    fprintf(stderr,"\nProgram <%s> Terminated\n", program_name);
-		    exit(-1);
-		    }
-		XSetFont(display,modp_gc,fontStruct->fid);
-		XSelectInput(display, modp_xid, EV_MASK );
-
-		/* Setup cursors. */
-		myCursor = XCreateFontCursor(display, XC_target);
-		XRecolorCursor(display,myCursor,&colors[2],&colors[5]);
-		XDefineCursor(display,modp_xid,myCursor);
-
-		/* initialize graphics */
-		xg_init(display, modp_xid, modp_borders, xgfont, &modp_xgid);
-		status = mbnavadjust_set_modelplot_graphics(modp_xgid, modp_borders);
-
-		/* update model status */
-		do_update_modelplot_status();
-
-		/* plot the model */
-		mbnavadjust_modelplot_plot();
-	    	}
-	    }
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_modelplot_fullsize( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-
-	/* replot model */
-	mbna_modelplot_zoom_x1 = 0;
-	mbna_modelplot_zoom_x2 = 0;
-	if (project.modelplot_style == MBNA_MODELPLOT_TIMESERIES)
-	    {
-	    mbna_modelplot_zoom = MB_NO;
-	    mbna_modelplot_start = 0;
-	    mbna_modelplot_end = 0;
-	    }
-	else if (project.modelplot_style == MBNA_MODELPLOT_PERTURBATION)
-	    {
-	    mbna_modelplot_zoom = MB_NO;
-	    mbna_modelplot_start = 0;
-	    mbna_modelplot_end = 0;
-	    }
-	else
-	    {
-	    mbna_modelplot_tiezoom = MB_NO;
-	    mbna_modelplot_tiestartzoom = 0;
-	    mbna_modelplot_tieendzoom = 0;
-	    mbna_modelplot_blocksurvey1 = MBNA_SELECT_NONE;
-	    mbna_modelplot_blocksurvey2 = MBNA_SELECT_NONE;
-	    }
-
-	mbnavadjust_modelplot_setzoom();
-	mbnavadjust_modelplot_plot();
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_modelplot_input( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-    XEvent  *event = acs->event;
-
-    /* If there is input in the drawing area */
-    if (acs->reason == XmCR_INPUT)
-    {
-      /* Check for mouse pressed. */
-      if (event->xany.type == ButtonPress)
-      {
-	  /* If left mouse button is pushed */
-	  if (event->xbutton.button == 1)
-		    {
-		    button1down = MB_YES;
-
-		    } /* end of left button events */
-
-	    /* If middle mouse button is pushed */
-	    if (event->xbutton.button == 2)
-		    {
-		    button2down = MB_YES;
-		    } /* end of middle button events */
-
-	    /* If right mouse button is pushed */
-	    if (event->xbutton.button == 3)
-		    {
-		    button3down = MB_YES;
-		    mbna_modelplot_zoom_x1 = event->xbutton.x;
-		    mbna_modelplot_zoom_x2 = event->xbutton.x;
-
-		    /* replot model */
-		    mbnavadjust_modelplot_plot();
-		    } /* end of right button events */
-      } /* end of button press events */
-
-      /* Check for mouse released. */
-      if (event->xany.type == ButtonRelease)
-      {
-	  /* If left mouse button is released */
-	    if (event->xbutton.button == 1)
-	    	  {
-	    	  button1down = MB_NO;
-
-		  /* pick nearest tie point */
-		  mbnavadjust_modelplot_pick(event->xbutton.x, event->xbutton.y);
-
-		  /* update model status */
-		  do_update_modelplot_status();
-
-		  /* replot model */
-		  mbnavadjust_modelplot_plot();
-	    	  }
-
-	    /* If middle mouse button is released */
-	    if (event->xbutton.button == 2)
-	    	  {
-	    	  button2down = MB_NO;
-
-		  /* pick nearest tie point */
-		  mbnavadjust_modelplot_middlepick(event->xbutton.x, event->xbutton.y);
-
-		  /* update model status */
-		  do_update_modelplot_status();
-
-		  /* replot model */
-		  mbnavadjust_modelplot_plot();
-		  }
-
-	    /* If right mouse button is released */
-	    if (event->xbutton.button == 3)
-	    	  {
-	    	  button3down = MB_NO;
-	    	  mbna_modelplot_zoom_x2 = event->xbutton.x;
-
-		  /* update model status */
-		  do_update_modelplot_status();
-
-		  /* replot model */
-		  mbnavadjust_modelplot_setzoom();
-		  mbnavadjust_modelplot_plot();
-		  mbna_modelplot_zoom_x1 = 0;
-		  mbna_modelplot_zoom_x2 = 0;
-	    	  }
-
-      } /* end of button release events */
-
-      /* Check for mouse motion while pressed. */
-      if (event->xany.type == MotionNotify)
-      {
-	    /* If right mouse button is held during motion */
-	    if (button3down == MB_YES)
-		{
-	    	 mbna_modelplot_zoom_x2 = event->xbutton.x;
-
-		 /* replot model */
-		 mbnavadjust_modelplot_plot();
-	    	}
-      }
-    } /* end of inputs from window */
-
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_modelplot_expose( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-
-    /* update model status */
-    do_update_modelplot_status();
-
-    /* replot the model */
-    mbnavadjust_modelplot_plot();
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_modelplot_tieoffsets( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-//fprintf(stderr,"Called do_modelplot_tieoffsets %d\n",XmToggleButtonGetState(toggleButton_modelplot_tieoffsets));
-
-	if (XmToggleButtonGetState(toggleButton_modelplot_tieoffsets))
-	    {
-	    project.modelplot_style = MBNA_MODELPLOT_TIEOFFSETS;
-
-	    /* update model status */
-	    do_update_modelplot_status();
-
-	    /* replot the model */
-	     mbnavadjust_modelplot_plot();
-	    }
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_modelplot_perturbation( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-//fprintf(stderr,"Called do_modelplot_perturbation %d\n",XmToggleButtonGetState(toggleButton_modelplot_perturbation));
-
-	if (XmToggleButtonGetState(toggleButton_modelplot_perturbation))
-	    {
-	    project.modelplot_style = MBNA_MODELPLOT_PERTURBATION;
-
-	    /* update model status */
-	    do_update_modelplot_status();
-
-	    /* replot the model */
-	    mbnavadjust_modelplot_plot();
-	    }
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_modelplot_timeseries( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-//fprintf(stderr,"Called do_modelplot_timeseries %d\n",XmToggleButtonGetState(toggleButton_modelplot_timeseries));
-
-	if (XmToggleButtonGetState(toggleButton_modelplot_timeseries))
-	    {
-	    project.modelplot_style = MBNA_MODELPLOT_TIMESERIES;
-
-	    /* update model status */
-	    do_update_modelplot_status();
-
-	    /* replot the model */
-	    mbnavadjust_modelplot_plot();
-	    }
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_modelplot_clearblock( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-/* fprintf(stderr,"Called do_modelplot_clearblock\n"); */
-
-	mbnavadjust_modelplot_clearblock();
-
-        if (mbna_naverr_load == MB_YES)
-	    {
-	    mbnavadjust_naverr_plot(MBNA_PLOT_MODE_FIRST);
-	    do_update_naverr();
-	    }
-
-	/* update status */
- 	do_update_status();
-
-	/* update model status */
-	do_update_modelplot_status();
-
-	/* replot the model */
- 	mbnavadjust_modelplot_plot();
-
-}
-
-/*--------------------------------------------------------------------*/
-/* ARGSUSED */
-void
-do_fileselection_list(Widget w, XtPointer client, XtPointer call)
-{
-	int	error;
-	char	fileroot[MB_PATH_MAXLINE];
-	int	form;
-	char	value_text[128];
-
-	XmAnyCallbackStruct *acs;
-	acs=(XmAnyCallbackStruct*)call;
-
-	/* get selected text */
-	get_text_string(fileSelectionBox_text, string);
-
-	/* get output file */
-	if((int)strlen(string) > 0)
-		{
-		status = mb_get_format(mbna_verbose, string, fileroot,
-					    &form, &error);
-		if (status == MB_SUCCESS)
-			{
-			format = form;
-			sprintf(value_text,"%d",format);
-			XmTextFieldSetString(
-			    textField_format,
-			    value_text);
-			}
-		}
-}
-
-/*--------------------------------------------------------------------*/
-
-int
-do_wait_until_viewed(XtAppContext app)
-{
-    Widget  topshell;
-    Window  topwindow;
-    XWindowAttributes	xwa;
-    XEvent  event;
-
-    /* set app_context */
-    app_context = app;
-
-    /* find the top level shell */
-    for (topshell = scrolledWindow_datalist;
-	    !XtIsTopLevelShell(topshell);
-	    topshell = XtParent(topshell))
-	;
-
-    /* keep processing events until it is viewed */
-    if (XtIsRealized(topshell))
-	{
-	topwindow = XtWindow(topshell);
-
-	/* wait for the window to be mapped */
-	while (XGetWindowAttributes(
-			XtDisplay(form_mbnavadjust),
-			topwindow, &xwa)
-		&& xwa.map_state != IsViewable)
-	    {
-	    XtAppNextEvent(app_context, &event);
-	    XtDispatchEvent(&event);
-	    }
-	}
-
-    XmUpdateDisplay(topshell);
-
-    return(MB_SUCCESS);
-}
-
-/*--------------------------------------------------------------------*/
-
-int
-do_message_on(char *message)
-{
-    Widget  diashell, topshell;
-    Window  diawindow, topwindow;
-    XWindowAttributes	xwa;
-    XEvent  event;
-
-    if (mbna_verbose >= 1)
-    	fprintf(stderr,"%s\n",message);
-
-    set_label_string(label_message, message);
-    XtManageChild(bulletinBoard_message);
-
-    /* force the label to be visible */
-    for (diashell = label_message;
-	    !XtIsShell(diashell);
-	    diashell = XtParent(diashell))
-	;
-    for (topshell = diashell;
-	    !XtIsTopLevelShell(topshell);
-	    topshell = XtParent(topshell))
-	;
-    if (XtIsRealized(diashell) && XtIsRealized(topshell))
-	{
-	diawindow = XtWindow(diashell);
-	topwindow = XtWindow(topshell);
-
-	/* wait for the dialog to be mapped */
-	while (XGetWindowAttributes(XtDisplay(bulletinBoard_message), diawindow, &xwa)
-		&& xwa.map_state != IsViewable)
-	    {
-	    if (XGetWindowAttributes(XtDisplay(bulletinBoard_message), topwindow, &xwa)
-		    && xwa.map_state != IsViewable)
-		break;
-
-	    XtAppNextEvent(app_context, &event);
-	    XtDispatchEvent(&event);
-	    }
-	}
-
-    XmUpdateDisplay(topshell);
-
-    return(MB_SUCCESS);
-}
-/*--------------------------------------------------------------------*/
-
-int
-do_message_update(char *message)
-{
-    if (mbna_verbose >= 1)
-    	fprintf(stderr,"%s\n",message);
-
-    set_label_string(label_message, message);
-    XSync(XtDisplay(bulletinBoard_message), 0);
-    XmUpdateDisplay(bulletinBoard_message);
-
-    return(MB_SUCCESS);
-}
-
-/*--------------------------------------------------------------------*/
-
-int
-do_message_off()
-{
-    XtUnmanageChild(bulletinBoard_message);
-    XSync(XtDisplay(bulletinBoard_message), 0);
-    XmUpdateDisplay(bulletinBoard_message);
-
-    return(MB_SUCCESS);
-}
-
-/*--------------------------------------------------------------------*/
-
-int
-do_info_add(char *info, int timetag)
-{
-    int		pos;
-    char	tag[STRING_MAX];
-    time_t	right_now;
-    char	date[32], user[128], *user_ptr, host[128];
-    char	*ctime();
-    char	*getenv();
-
-    /* reposition to end of text */
-    pos = XmTextGetLastPosition(text_messages);
-    XmTextSetInsertionPosition(text_messages, pos);
-
-    /* add text */
-    if (timetag == MB_YES)
-        XmTextInsert(text_messages, pos, info);
-    if (project.logfp != NULL)
-	fputs(info, project.logfp);
-    if (mbna_verbose > 0)
-	fputs(info, stderr);
-
-    /* put time tag in if requested */
-    if (timetag == MB_YES)
-	{
-	right_now = time((time_t *)0);
-	strcpy(date,ctime(&right_now));
-        date[strlen(date)-1] = '\0';
-	if ((user_ptr = getenv("USER")) == NULL)
-		user_ptr = getenv("LOGNAME");
-	if (user_ptr != NULL)
-		strcpy(user,user_ptr);
-	else
-		strcpy(user, "unknown");
-	gethostname(host,128);
-	sprintf(tag," > User <%s> on cpu <%s> at <%s>\n",
-		user,host,date);
-	pos = XmTextGetLastPosition(text_messages);
-	XmTextSetInsertionPosition(text_messages, pos);
-	XmTextInsert(text_messages, pos, tag);
-	if (project.logfp != NULL)
-	    fputs(tag, project.logfp);
-	if (mbna_verbose > 0)
-	    fputs(tag, stderr);
-	}
-
-    /* reposition to end of text */
-    if (timetag == MB_YES)
-        {
-	pos = XmTextGetLastPosition(text_messages);
-        XmTextShowPosition(text_messages, pos);
-        XmTextSetInsertionPosition(text_messages, pos);
-	}
-
-    return(MB_SUCCESS);
-}
-
-/*--------------------------------------------------------------------*/
-
-int
-do_error_dialog(char *s1, char *s2, char *s3)
-{
-    set_label_string(label_error_one, s1);
-    set_label_string(label_error_two, s2);
-    set_label_string(label_error_three, s3);
-    XtManageChild(bulletinBoard_error);
-    XBell(XtDisplay(form_mbnavadjust),100);
-
-    return(MB_SUCCESS);
-}
-
-/*--------------------------------------------------------------------*/
-void
-do_bell(int length)
-{
-	XBell(display,length);
-}
-
-/*--------------------------------------------------------------------*/
-/* Change label string cleanly, no memory leak */
-/*--------------------------------------------------------------------*/
-
-void set_label_string(Widget w, String str)
-{
-    XmString xstr;
-
-    xstr = XmStringCreateLocalized( str );
-    if ( xstr != NULL )
-	XtVaSetValues(w,
-	    XmNlabelString, xstr,
-	    NULL);
-    else
-	XtWarning("Failed to update labelString");
-
-    XmStringFree( xstr );
-}
-/*--------------------------------------------------------------------*/
-/* Change multiline label string cleanly, no memory leak */
-/*--------------------------------------------------------------------*/
-
-void set_label_multiline_string(Widget w, String str)
-{
-    XmString xstr;
-    Boolean      argok;
-
-    xstr = (XtPointer)BX_CONVERT(w, str, XmRXmString, 0, &argok);
-    if ( xstr != NULL && argok)
-        XtVaSetValues(w,
-            XmNlabelString, xstr,
-            NULL);
-    else
-        XtWarning("Failed to update labelString");
-
-    XmStringFree( xstr );
-}
-/*--------------------------------------------------------------------*/
-/* Get text item string cleanly, no memory leak */
-/*--------------------------------------------------------------------*/
-
-void get_text_string(Widget w, String str)
-{
-    char	*str_tmp;
-
-    str_tmp = (char *) XmTextGetString(w);
-    strcpy(str, str_tmp);
-    XtFree(str_tmp);
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_make_grid( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-}
diff --git a/src/mbnavadjust/mbnavadjust_creation.c b/src/mbnavadjust/mbnavadjust_creation.c
deleted file mode 100644
index 27fde0c..0000000
--- a/src/mbnavadjust/mbnavadjust_creation.c
+++ /dev/null
@@ -1,4671 +0,0 @@
-
-/* Begin user code block <abstract> */
-/* End user code block <abstract> */
-
-/**
- * README: Portions of this file are merged at file generation
- * time. Edits can be made *only* in between specified code blocks, look
- * for keywords <Begin user code> and <End user code>.
- */
-/*
- * Generated by the ICS Builder Xcessory (BX).
- *
- * BuilderXcessory Version 6.1.3
- * Code Generator Xcessory 6.1.3 (08/19/04) CGX Scripts 6.1 Motif 2.1
- *
- */
-
-
-/* Begin user code block <file_comments> */
-
-#ifndef SANS
-#define SANS "helvetica"
-#endif
-#ifndef SERIF
-#define SERIF "times"
-#endif
-#ifndef MONO
-#define MONO "courier"
-#endif
-
-/* End user code block <file_comments> */
-
-#include <Xm/Xm.h>
-#include <Xm/MainW.h>
-#include <Xm/DialogS.h>
-#include <Xm/MwmUtil.h>
-#include <Xm/BulletinB.h>
-#include <Xm/PushB.h>
-#include <Xm/RowColumn.h>
-#include <Xm/ToggleB.h>
-#include <Xm/Label.h>
-#include <Xm/DrawingA.h>
-#include <Xm/Form.h>
-#include <Xm/Separator.h>
-#include <Xm/Scale.h>
-#include <Xm/CascadeB.h>
-#include <Xm/TextF.h>
-#include <Xm/FileSB.h>
-#include <Xm/PushBG.h>
-#include <Xm/ScrolledW.h>
-#include <Xm/Text.h>
-#include <Xm/List.h>
-#include <Xm/MainW.h>
-#include <Xm/DialogS.h>
-#include <Xm/MwmUtil.h>
-#include <Xm/BulletinB.h>
-#include <Xm/PushB.h>
-#include <Xm/RowColumn.h>
-#include <Xm/ToggleB.h>
-#include <Xm/Label.h>
-#include <Xm/DrawingA.h>
-#include <Xm/Form.h>
-#include <Xm/Separator.h>
-#include <Xm/Scale.h>
-#include <Xm/CascadeB.h>
-#include <Xm/TextF.h>
-#include <Xm/FileSB.h>
-#include <Xm/PushBG.h>
-#include <Xm/ScrolledW.h>
-#include <Xm/Text.h>
-#include <Xm/List.h>
-
-/*
- * Global declarations are now stored in the header file.
- *
- * If DECLARE_BX_GLOBALS is defined then this header file
- * declares the globals, otherwise it just externs them.
- */
-#define DECLARE_BX_GLOBALS
-
-/**
- * Globally included information.
- */
-
-
-/**
- * Common constant and pixmap declarations.
- */
-#include "mbnavadjust_creation.h"
-
-/**
- * Convenience functions from utilities file.
- */
-extern void RegisterBxConverters(XtAppContext);
-extern XtPointer BX_CONVERT(Widget, char *, char *, int, Boolean *);
-extern XtPointer BX_DOUBLE(double);
-extern XtPointer BX_SINGLE(float);
-extern void BX_MENU_POST(Widget, XtPointer, XEvent *, Boolean *);
-extern Pixmap XPM_PIXMAP(Widget, char **);
-extern void BX_SET_BACKGROUND_COLOR(Widget, ArgList, Cardinal *, Pixel);
-
-/**
- * Declarations for callbacks and handlers.
- */
-extern void BxExitCB(Widget, XtPointer, XtPointer);
-extern void do_modelplot_clearblock(Widget, XtPointer, XtPointer);
-extern void do_modelplot_fullsize(Widget, XtPointer, XtPointer);
-extern void do_modelplot_input(Widget, XtPointer, XtPointer);
-extern void do_modelplot_expose(Widget, XtPointer, XtPointer);
-extern void BxUnmanageCB(Widget, XtPointer, XtPointer);
-extern void do_modelplot_dismiss(Widget, XtPointer, XtPointer);
-extern void do_modelplot_timeseries(Widget, XtPointer, XtPointer);
-extern void do_modelplot_perturbation(Widget, XtPointer, XtPointer);
-extern void do_modelplot_tieoffsets(Widget, XtPointer, XtPointer);
-extern void do_scale_controls_zoffset(Widget, XtPointer, XtPointer);
-extern void do_scale_controls_smoothing(Widget, XtPointer, XtPointer);
-extern void do_scale_controls_sectionlength(Widget, XtPointer, XtPointer);
-extern void do_scale_controls_tickinterval(Widget, XtPointer, XtPointer);
-extern void do_controls_scale_colorinterval(Widget, XtPointer, XtPointer);
-extern void do_scale_contourinterval(Widget, XtPointer, XtPointer);
-extern void do_controls_apply(Widget, XtPointer, XtPointer);
-extern void do_scale_controls_decimation(Widget, XtPointer, XtPointer);
-extern void do_scale_controls_sectionsoundings(Widget, XtPointer, XtPointer);
-extern void do_biases_applyall(Widget, XtPointer, XtPointer);
-extern void do_biases_roll(Widget, XtPointer, XtPointer);
-extern void do_biases_heading(Widget, XtPointer, XtPointer);
-extern void do_biases_apply(Widget, XtPointer, XtPointer);
-extern void do_biases_toggle(Widget, XtPointer, XtPointer);
-extern void do_naverr_unset(Widget, XtPointer, XtPointer);
-extern void do_naverr_minxymisfit(Widget, XtPointer, XtPointer);
-extern void do_naverr_zcorr_input(Widget, XtPointer, XtPointer);
-extern void do_naverr_corr_expose(Widget, XtPointer, XtPointer);
-extern void do_naverr_zerozoffset(Widget, XtPointer, XtPointer);
-extern void do_naverr_setoffset(Widget, XtPointer, XtPointer);
-extern void do_naverr_resettie(Widget, XtPointer, XtPointer);
-extern void do_naverr_addtie(Widget, XtPointer, XtPointer);
-extern void do_naverr_deletetie(Widget, XtPointer, XtPointer);
-extern void do_naverr_fullsize(Widget, XtPointer, XtPointer);
-extern void do_naverr_zerooffset(Widget, XtPointer, XtPointer);
-extern void do_naverr_nextunset(Widget, XtPointer, XtPointer);
-extern void do_naverr_cont_input(Widget, XtPointer, XtPointer);
-extern void do_naverr_cont_expose(Widget, XtPointer, XtPointer);
-extern void do_naverr_corr_input(Widget, XtPointer, XtPointer);
-extern void do_dismiss_naverr(Widget, XtPointer, XtPointer);
-extern void do_naverr_selecttie(Widget, XtPointer, XtPointer);
-extern void do_naverr_minmisfit(Widget, XtPointer, XtPointer);
-extern void do_naverr_next(Widget, XtPointer, XtPointer);
-extern void do_naverr_previous(Widget, XtPointer, XtPointer);
-extern void do_naverr_setnone(Widget, XtPointer, XtPointer);
-extern void BxManageCB(Widget, XtPointer, XtPointer);
-extern void do_biases_init(Widget, XtPointer, XtPointer);
-extern void do_naverr_misfitcenter(Widget, XtPointer, XtPointer);
-extern void do_fileselection_mode(Widget, XtPointer, XtPointer);
-extern void do_fileselection_ok(Widget, XtPointer, XtPointer);
-extern void BxSetValuesCB(Widget, XtPointer, XtPointer);
-extern void do_file_close(Widget, XtPointer, XtPointer);
-extern void do_quit(Widget, XtPointer, XtPointer);
-extern void do_view_showsurveys(Widget, XtPointer, XtPointer);
-extern void do_view_showdata(Widget, XtPointer, XtPointer);
-extern void do_view_showsections(Widget, XtPointer, XtPointer);
-extern void do_view_showcrossings(Widget, XtPointer, XtPointer);
-extern void do_view_showmediocrecrossings(Widget, XtPointer, XtPointer);
-extern void do_view_showgoodcrossings(Widget, XtPointer, XtPointer);
-extern void do_view_showbettercrossings(Widget, XtPointer, XtPointer);
-extern void do_view_showtruecrossings(Widget, XtPointer, XtPointer);
-extern void do_view_showties(Widget, XtPointer, XtPointer);
-extern void do_view_showallsurveys(Widget, XtPointer, XtPointer);
-extern void do_view_showselectedsurveys(Widget, XtPointer, XtPointer);
-extern void do_view_showselectedfile(Widget, XtPointer, XtPointer);
-extern void do_view_showwithselectedsurveys(Widget, XtPointer, XtPointer);
-extern void do_view_showwithselectedfile(Widget, XtPointer, XtPointer);
-extern void do_view_showselectedsection(Widget, XtPointer, XtPointer);
-extern void do_make_grid(Widget, XtPointer, XtPointer);
-extern void do_modelplot_show(Widget, XtPointer, XtPointer);
-extern void do_action_poornav(Widget, XtPointer, XtPointer);
-extern void do_action_goodnav(Widget, XtPointer, XtPointer);
-extern void do_action_fixednav(Widget, XtPointer, XtPointer);
-extern void do_action_fixedxynav(Widget, XtPointer, XtPointer);
-extern void do_action_fixedznav(Widget, XtPointer, XtPointer);
-extern void do_action_tie_xy(Widget, XtPointer, XtPointer);
-extern void do_action_z(Widget, XtPointer, XtPointer);
-extern void do_action_tie_xyz(Widget, XtPointer, XtPointer);
-extern void do_action_autopick(Widget, XtPointer, XtPointer);
-extern void do_action_autopickhorizontal(Widget, XtPointer, XtPointer);
-extern void do_action_autosetsvsvertical(Widget, XtPointer, XtPointer);
-extern void do_action_checknewcrossings(Widget, XtPointer, XtPointer);
-extern void do_naverr_init(Widget, XtPointer, XtPointer);
-extern void do_action_analyzecrossings(Widget, XtPointer, XtPointer);
-extern void do_zerozoffsets(Widget, XtPointer, XtPointer);
-extern void do_action_invertnav(Widget, XtPointer, XtPointer);
-extern void do_apply_nav(Widget, XtPointer, XtPointer);
-extern void do_list_data_select(Widget, XtPointer, XtPointer);
-
-/**
- * Create the mainWindow hierarchy of widgets.
- */
-Widget
-CreatemainWindow(Widget parent)
-{
-    Cardinal ac = 0;
-    Arg      args[256];
-    Boolean  argok = False;
-    Widget   mainWindow;
-    Widget   dialogShell_modelplot;
-    Widget   pushButton_modelplot_fullsize;
-    Widget   pushButton_modelplot_dismiss;
-    Widget   dialogShell_controls;
-    Widget   form_controls;
-    Widget   separator14;
-    Widget   label_controls_zoffset;
-    Widget   label_controls_smoothing;
-    Widget   separator12;
-    Widget   label_controls_sectionlength;
-    Widget   label_controls_contourinterval;
-    Widget   label_controls_colorinterval;
-    Widget   label_controls_tickinterval;
-    Widget   pushButton_controls_apply;
-    Widget   separator4;
-    Widget   separator5;
-    Widget   label_controls_decimation;
-    Widget   label_controls_sectionsoundings;
-    Widget   pushButton_controls_dismiss;
-    Widget   dialogShell_about;
-    Widget   form_about;
-    Widget   label_about_create1;
-    Widget   separator1;
-    Widget   pushButton_about_dismiss;
-    Widget   label_about_create;
-    Widget   label_about_lamont;
-    Widget   label_about_columbia;
-    Widget   label_about_mbsystem;
-    Widget   label_about_mbpub;
-    Widget   label_about_component;
-    Widget   label_about_for;
-    Widget   separator;
-    Widget   label_about_function;
-    Widget   label_about_mbedit;
-    Widget   dialogShell_biases;
-    Widget   bulletinBoard_biases;
-    Widget   separator9;
-    Widget   separator8;
-    Widget   separator6;
-    Widget   radioBox_biases_together;
-    Widget   pushButton_biases_apply;
-    Widget   pushButton_biases_dismiss;
-    Widget   dialogShell_naverr;
-    Widget   menuBar_settings;
-    Widget   cascadeButton_settings;
-    Widget   pulldownMenu_settings;
-    Widget   pushButton_naverr_biases;
-    Widget   pushButton_naverr_controls;
-    Widget   radioBox_misfitcenter;
-    Widget   xmDialogShell_error;
-    Widget   pushButton_error;
-    Widget   xmDialogShell_message;
-    Widget   label_pleasewait;
-    Widget   menuBar_mbnavadjust;
-    Widget   cascadeButton_file;
-    Widget   pulldownMenu_file;
-    Widget   separator2;
-    Widget   separator3;
-    Widget   cascadeButton_option;
-    Widget   pulldownMenu_option;
-    Widget   pushButton_controls;
-    Widget   cascadeButton_view;
-    Widget   pulldownMenu_view;
-    Widget   separator13;
-    Widget   separator15;
-    Widget   cascadeButton_action;
-    Widget   pulldownMenu_action;
-    Widget   separator7;
-    Widget   separator10;
-    Widget   separator17;
-    Widget   separator11;
-    Widget   separator16;
-    Widget   cascadeButton_about;
-    Widget   pulldownMenu_about;
-    Widget   pushButton_about;
-
-    /**
-     * Register the converters for the widgets.
-     */
-    RegisterBxConverters(XtWidgetToApplicationContext(parent));
-    XtInitializeWidgetClass((WidgetClass)xmMainWindowWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmDialogShellWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmBulletinBoardWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmPushButtonWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmRowColumnWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmToggleButtonWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmLabelWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmDrawingAreaWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmFormWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmSeparatorWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmScaleWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmRowColumnWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmCascadeButtonWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmRowColumnWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmTextFieldWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmFileSelectionBoxWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmPushButtonGadgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmFormWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmScrolledWindowWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmTextWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmListWidgetClass);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 82); ac++;
-    XtSetArg(args[ac], XmNy, 396); ac++;
-    XtSetArg(args[ac], XmNwidth, 962); ac++;
-    XtSetArg(args[ac], XmNheight, 400); ac++;
-    mainWindow = XmCreateMainWindow(parent,
-        (char *)"mainWindow",
-        args,
-        ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNwidth, 962); ac++;
-    XtSetArg(args[ac], XmNheight, 32); ac++;
-    menuBar_mbnavadjust = XmCreateMenuBar(mainWindow,
-        (char *)"menuBar_mbnavadjust",
-        args,
-        ac);
-    XtManageChild(menuBar_mbnavadjust);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(menuBar_mbnavadjust, (char *)"File",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 5); ac++;
-        XtSetArg(args[ac], XmNy, 5); ac++;
-        XtSetArg(args[ac], XmNwidth, 36); ac++;
-        XtSetArg(args[ac], XmNheight, 22); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(menuBar_mbnavadjust, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        cascadeButton_file = XmCreateCascadeButton(menuBar_mbnavadjust,
-            (char *)"cascadeButton_file",
-            args,
-            ac);
-        XtManageChild(cascadeButton_file);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 0); ac++;
-    XtSetArg(args[ac], XmNy, 0); ac++;
-    XtSetArg(args[ac], XmNwidth, 126); ac++;
-    XtSetArg(args[ac], XmNheight, 118); ac++;
-    pulldownMenu_file = XmCreatePulldownMenu(XtParent(cascadeButton_file),
-        (char *)"pulldownMenu_file",
-        args,
-        ac);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(pulldownMenu_file, (char *)"New",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_file, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_new = XmCreatePushButton(pulldownMenu_file,
-            (char *)"pushButton_new",
-            args,
-            ac);
-        XtManageChild(pushButton_new);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_new, XmNactivateCallback, BxManageCB, (XtPointer)"bulletinBoard_fileselection");
-    XtAddCallback(pushButton_new, XmNactivateCallback, BxSetValuesCB, (XtPointer)"xmDialogShell_fileselection.title=Specify New Project");
-    XtAddCallback(pushButton_new, XmNactivateCallback, BxUnmanageCB, (XtPointer)"label_format");
-    XtAddCallback(pushButton_new, XmNactivateCallback, BxUnmanageCB, (XtPointer)"textField_format");
-    XtAddCallback(pushButton_new, XmNactivateCallback, do_fileselection_mode, (XtPointer)MBNA_FILESELECTION_NEW);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(pulldownMenu_file, (char *)"Open",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_file, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_open = XmCreatePushButton(pulldownMenu_file,
-            (char *)"pushButton_open",
-            args,
-            ac);
-        XtManageChild(pushButton_open);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_open, XmNactivateCallback, BxManageCB, (XtPointer)"bulletinBoard_fileselection");
-    XtAddCallback(pushButton_open, XmNactivateCallback, BxUnmanageCB, (XtPointer)"label_format");
-    XtAddCallback(pushButton_open, XmNactivateCallback, BxUnmanageCB, (XtPointer)"textField_format");
-    XtAddCallback(pushButton_open, XmNactivateCallback, BxSetValuesCB, (XtPointer)"xmDialogShell_fileselection.title=Open Project");
-    XtAddCallback(pushButton_open, XmNactivateCallback, do_fileselection_mode, (XtPointer)MBNA_FILESELECTION_OPEN);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(pulldownMenu_file, (char *)"Close",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_file, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_close = XmCreatePushButton(pulldownMenu_file,
-            (char *)"pushButton_close",
-            args,
-            ac);
-        XtManageChild(pushButton_close);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_close, XmNactivateCallback, do_file_close, (XtPointer)0);
-
-    ac = 0;
-    separator2 = XmCreateSeparator(pulldownMenu_file,
-        (char *)"separator2",
-        args,
-        ac);
-    XtManageChild(separator2);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(pulldownMenu_file, (char *)"Import Swath Data",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_file, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_importdata = XmCreatePushButton(pulldownMenu_file,
-            (char *)"pushButton_importdata",
-            args,
-            ac);
-        XtManageChild(pushButton_importdata);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_importdata, XmNactivateCallback, BxSetValuesCB, (XtPointer)"xmDialogShell_fileselection.title=Import Swath Data File or Datalist");
-    XtAddCallback(pushButton_importdata, XmNactivateCallback, BxSetValuesCB, (XtPointer)"label_format.labelString=MBIO Format ID:");
-    XtAddCallback(pushButton_importdata, XmNactivateCallback, BxManageCB, (XtPointer)"label_format");
-    XtAddCallback(pushButton_importdata, XmNactivateCallback, BxManageCB, (XtPointer)"textField_format");
-    XtAddCallback(pushButton_importdata, XmNactivateCallback, BxManageCB, (XtPointer)"bulletinBoard_fileselection");
-    XtAddCallback(pushButton_importdata, XmNactivateCallback, do_fileselection_mode, (XtPointer)MBNA_FILESELECTION_IMPORT);
-
-    ac = 0;
-    separator3 = XmCreateSeparator(pulldownMenu_file,
-        (char *)"separator3",
-        args,
-        ac);
-    XtManageChild(separator3);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(pulldownMenu_file, (char *)"Quit",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_file, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_quit = XmCreatePushButton(pulldownMenu_file,
-            (char *)"pushButton_quit",
-            args,
-            ac);
-        XtManageChild(pushButton_quit);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_quit, XmNactivateCallback, do_quit, (XtPointer)0);
-    XtAddCallback(pushButton_quit, XmNactivateCallback, BxExitCB, (XtPointer)0);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNsubMenuId, pulldownMenu_file); ac++;
-    XtSetValues(cascadeButton_file, args, ac);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(menuBar_mbnavadjust, (char *)"Option",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 41); ac++;
-        XtSetArg(args[ac], XmNy, 5); ac++;
-        XtSetArg(args[ac], XmNwidth, 55); ac++;
-        XtSetArg(args[ac], XmNheight, 22); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(menuBar_mbnavadjust, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        cascadeButton_option = XmCreateCascadeButton(menuBar_mbnavadjust,
-            (char *)"cascadeButton_option",
-            args,
-            ac);
-        XtManageChild(cascadeButton_option);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 0); ac++;
-    XtSetArg(args[ac], XmNy, 0); ac++;
-    XtSetArg(args[ac], XmNwidth, 61); ac++;
-    XtSetArg(args[ac], XmNheight, 26); ac++;
-    pulldownMenu_option = XmCreatePulldownMenu(XtParent(cascadeButton_option),
-        (char *)"pulldownMenu_option",
-        args,
-        ac);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(pulldownMenu_option, (char *)"Controls",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_option, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_controls = XmCreatePushButton(pulldownMenu_option,
-            (char *)"pushButton_controls",
-            args,
-            ac);
-        XtManageChild(pushButton_controls);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_controls, XmNactivateCallback, BxManageCB, (XtPointer)"form_controls");
-
-    ac = 0;
-    XtSetArg(args[ac], XmNsubMenuId, pulldownMenu_option); ac++;
-    XtSetValues(cascadeButton_option, args, ac);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(menuBar_mbnavadjust, (char *)"View",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 96); ac++;
-        XtSetArg(args[ac], XmNy, 5); ac++;
-        XtSetArg(args[ac], XmNwidth, 45); ac++;
-        XtSetArg(args[ac], XmNheight, 22); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(menuBar_mbnavadjust, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        cascadeButton_view = XmCreateCascadeButton(menuBar_mbnavadjust,
-            (char *)"cascadeButton_view",
-            args,
-            ac);
-        XtManageChild(cascadeButton_view);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 0); ac++;
-    XtSetArg(args[ac], XmNy, 0); ac++;
-    XtSetArg(args[ac], XmNwidth, 225); ac++;
-    XtSetArg(args[ac], XmNheight, 360); ac++;
-    pulldownMenu_view = XmCreatePulldownMenu(XtParent(cascadeButton_view),
-        (char *)"pulldownMenu_view",
-        args,
-        ac);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(pulldownMenu_view, (char *)"Show Surveys",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_showsurveys = XmCreatePushButton(pulldownMenu_view,
-            (char *)"pushButton_showsurveys",
-            args,
-            ac);
-        XtManageChild(pushButton_showsurveys);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_showsurveys, XmNactivateCallback, do_view_showsurveys, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(pulldownMenu_view, (char *)"Show Data Files",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_showdata = XmCreatePushButton(pulldownMenu_view,
-            (char *)"pushButton_showdata",
-            args,
-            ac);
-        XtManageChild(pushButton_showdata);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_showdata, XmNactivateCallback, do_view_showdata, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(pulldownMenu_view, (char *)"Show Data File Sections",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_showsections = XmCreatePushButton(pulldownMenu_view,
-            (char *)"pushButton_showsections",
-            args,
-            ac);
-        XtManageChild(pushButton_showsections);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_showsections, XmNactivateCallback, do_view_showsections, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(pulldownMenu_view, (char *)"Show All Crossings",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_showcrossings = XmCreatePushButton(pulldownMenu_view,
-            (char *)"pushButton_showcrossings",
-            args,
-            ac);
-        XtManageChild(pushButton_showcrossings);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_showcrossings, XmNactivateCallback, do_view_showcrossings, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(pulldownMenu_view, (char *)"Show >10% Overlap Crossings",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_showmediocrecrossings = XmCreatePushButton(pulldownMenu_view,
-            (char *)"pushButton_showmediocrecrossings",
-            args,
-            ac);
-        XtManageChild(pushButton_showmediocrecrossings);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_showmediocrecrossings, XmNactivateCallback, do_view_showmediocrecrossings, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(pulldownMenu_view, (char *)"Show >25% Overlap Crossings",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_showgoodcrossings = XmCreatePushButton(pulldownMenu_view,
-            (char *)"pushButton_showgoodcrossings",
-            args,
-            ac);
-        XtManageChild(pushButton_showgoodcrossings);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_showgoodcrossings, XmNactivateCallback, do_view_showgoodcrossings, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(pulldownMenu_view, (char *)"Show >50% Overlap Crossings",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_showbettercrossings = XmCreatePushButton(pulldownMenu_view,
-            (char *)"pushButton_showbettercrossings",
-            args,
-            ac);
-        XtManageChild(pushButton_showbettercrossings);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_showbettercrossings, XmNactivateCallback, do_view_showbettercrossings, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(pulldownMenu_view, (char *)"Show True Crossings",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_showtruecrossings = XmCreatePushButton(pulldownMenu_view,
-            (char *)"pushButton_showtruecrossings",
-            args,
-            ac);
-        XtManageChild(pushButton_showtruecrossings);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_showtruecrossings, XmNactivateCallback, do_view_showtruecrossings, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(pulldownMenu_view, (char *)"Show Ties",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_showties = XmCreatePushButton(pulldownMenu_view,
-            (char *)"pushButton_showties",
-            args,
-            ac);
-        XtManageChild(pushButton_showties);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_showties, XmNactivateCallback, do_view_showties, (XtPointer)0);
-
-    ac = 0;
-    separator13 = XmCreateSeparator(pulldownMenu_view,
-        (char *)"separator13",
-        args,
-        ac);
-    XtManageChild(separator13);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(pulldownMenu_view, (char *)"Show All Surveys",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        toggleButton_showallsurveys = XmCreateToggleButton(pulldownMenu_view,
-            (char *)"toggleButton_showallsurveys",
-            args,
-            ac);
-        XtManageChild(toggleButton_showallsurveys);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(toggleButton_showallsurveys, XmNvalueChangedCallback, do_view_showallsurveys, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(pulldownMenu_view, (char *)"Show Only Selected Survey",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        toggleButton_showselectedsurvey = XmCreateToggleButton(pulldownMenu_view,
-            (char *)"toggleButton_showselectedsurvey",
-            args,
-            ac);
-        XtManageChild(toggleButton_showselectedsurvey);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(toggleButton_showselectedsurvey, XmNvalueChangedCallback, do_view_showselectedsurveys, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(pulldownMenu_view, (char *)"Show Only Selected File",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        toggleButton_showselectedfile = XmCreateToggleButton(pulldownMenu_view,
-            (char *)"toggleButton_showselectedfile",
-            args,
-            ac);
-        XtManageChild(toggleButton_showselectedfile);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(toggleButton_showselectedfile, XmNvalueChangedCallback, do_view_showselectedfile, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(pulldownMenu_view, (char *)"Show Only With Selected Survey",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        toggleButton_showwithselectedsurvey = XmCreateToggleButton(pulldownMenu_view,
-            (char *)"toggleButton_showwithselectedsurvey",
-            args,
-            ac);
-        XtManageChild(toggleButton_showwithselectedsurvey);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(toggleButton_showwithselectedsurvey, XmNvalueChangedCallback, do_view_showwithselectedsurveys, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(pulldownMenu_view, (char *)"Show Only With Selected File",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        toggleButton_showwithselectedfile = XmCreateToggleButton(pulldownMenu_view,
-            (char *)"toggleButton_showwithselectedfile",
-            args,
-            ac);
-        XtManageChild(toggleButton_showwithselectedfile);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(toggleButton_showwithselectedfile, XmNvalueChangedCallback, do_view_showwithselectedfile, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(pulldownMenu_view, (char *)"Show Only With Selected Section",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        toggleButton_showselectedsection = XmCreateToggleButton(pulldownMenu_view,
-            (char *)"toggleButton_showselectedsection",
-            args,
-            ac);
-        XtManageChild(toggleButton_showselectedsection);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(toggleButton_showselectedsection, XmNvalueChangedCallback, do_view_showselectedsection, (XtPointer)0);
-
-    ac = 0;
-    separator15 = XmCreateSeparator(pulldownMenu_view,
-        (char *)"separator15",
-        args,
-        ac);
-    XtManageChild(separator15);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(pulldownMenu_view, (char *)"Visualize Survey",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_makegrid = XmCreatePushButton(pulldownMenu_view,
-            (char *)"pushButton_makegrid",
-            args,
-            ac);
-        XtManageChild(pushButton_makegrid);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_makegrid, XmNactivateCallback, do_make_grid, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(pulldownMenu_view, (char *)"Show Modelplot",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_showmodelplot = XmCreatePushButton(pulldownMenu_view,
-            (char *)"pushButton_showmodelplot",
-            args,
-            ac);
-        XtManageChild(pushButton_showmodelplot);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_showmodelplot, XmNactivateCallback, BxManageCB, (XtPointer)"bulletinBoard_modelplot");
-    XtAddCallback(pushButton_showmodelplot, XmNactivateCallback, do_modelplot_show, (XtPointer)0);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNsubMenuId, pulldownMenu_view); ac++;
-    XtSetValues(cascadeButton_view, args, ac);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(menuBar_mbnavadjust, (char *)"Action",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 141); ac++;
-        XtSetArg(args[ac], XmNy, 5); ac++;
-        XtSetArg(args[ac], XmNwidth, 53); ac++;
-        XtSetArg(args[ac], XmNheight, 22); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(menuBar_mbnavadjust, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        cascadeButton_action = XmCreateCascadeButton(menuBar_mbnavadjust,
-            (char *)"cascadeButton_action",
-            args,
-            ac);
-        XtManageChild(cascadeButton_action);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 0); ac++;
-    XtSetArg(args[ac], XmNy, 0); ac++;
-    XtSetArg(args[ac], XmNwidth, 182); ac++;
-    XtSetArg(args[ac], XmNheight, 344); ac++;
-    pulldownMenu_action = XmCreatePulldownMenu(XtParent(cascadeButton_action),
-        (char *)"pulldownMenu_action",
-        args,
-        ac);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(pulldownMenu_action, (char *)"Set File Poor Navigation",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_action, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_poornav = XmCreatePushButton(pulldownMenu_action,
-            (char *)"pushButton_poornav",
-            args,
-            ac);
-        XtManageChild(pushButton_poornav);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_poornav, XmNactivateCallback, do_action_poornav, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(pulldownMenu_action, (char *)"Set File Good Navigation",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_action, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_goodnav = XmCreatePushButton(pulldownMenu_action,
-            (char *)"pushButton_goodnav",
-            args,
-            ac);
-        XtManageChild(pushButton_goodnav);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_goodnav, XmNactivateCallback, do_action_goodnav, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(pulldownMenu_action, (char *)"Set File Fixed Navigation",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_action, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_fixednav = XmCreatePushButton(pulldownMenu_action,
-            (char *)"pushButton_fixednav",
-            args,
-            ac);
-        XtManageChild(pushButton_fixednav);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_fixednav, XmNactivateCallback, do_action_fixednav, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(pulldownMenu_action, (char *)"Set File Fixed XY Navigation",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_action, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_fixedxynav = XmCreatePushButton(pulldownMenu_action,
-            (char *)"pushButton_fixedxynav",
-            args,
-            ac);
-        XtManageChild(pushButton_fixedxynav);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_fixedxynav, XmNactivateCallback, do_action_fixedxynav, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(pulldownMenu_action, (char *)"Set File Fixed Z Navigation",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_action, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_fixedznav = XmCreatePushButton(pulldownMenu_action,
-            (char *)"pushButton_fixedznav",
-            args,
-            ac);
-        XtManageChild(pushButton_fixedznav);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_fixedznav, XmNactivateCallback, do_action_fixedznav, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(pulldownMenu_action, (char *)"Set tie to XY only",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_action, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_tie_xy = XmCreatePushButton(pulldownMenu_action,
-            (char *)"pushButton_tie_xy",
-            args,
-            ac);
-        XtManageChild(pushButton_tie_xy);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_tie_xy, XmNactivateCallback, do_action_tie_xy, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(pulldownMenu_action, (char *)"Set tie to Z only",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_action, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_tie_z = XmCreatePushButton(pulldownMenu_action,
-            (char *)"pushButton_tie_z",
-            args,
-            ac);
-        XtManageChild(pushButton_tie_z);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_tie_z, XmNactivateCallback, do_action_z, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(pulldownMenu_action, (char *)"Set tie to full XYZ",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_action, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_tie_xyz = XmCreatePushButton(pulldownMenu_action,
-            (char *)"pushButton_tie_xyz",
-            args,
-            ac);
-        XtManageChild(pushButton_tie_xyz);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_tie_xyz, XmNactivateCallback, do_action_tie_xyz, (XtPointer)0);
-
-    ac = 0;
-    separator7 = XmCreateSeparator(pulldownMenu_action,
-        (char *)"separator7",
-        args,
-        ac);
-    XtManageChild(separator7);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(pulldownMenu_action, (char *)"Auto-Pick Offsets",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_action, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_autopick = XmCreatePushButton(pulldownMenu_action,
-            (char *)"pushButton_autopick",
-            args,
-            ac);
-        XtManageChild(pushButton_autopick);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_autopick, XmNactivateCallback, do_action_autopick, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(pulldownMenu_action, (char *)"Auto-Pick Horizontal Offsets",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_action, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_autopickhorizontal = XmCreatePushButton(pulldownMenu_action,
-            (char *)"pushButton_autopickhorizontal",
-            args,
-            ac);
-        XtManageChild(pushButton_autopickhorizontal);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_autopickhorizontal, XmNactivateCallback, do_action_autopickhorizontal, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(pulldownMenu_action, (char *)"Auto-Set Survey-vs-Survey Vertical Offsets",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_action, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_autosetsvsvertical = XmCreatePushButton(pulldownMenu_action,
-            (char *)"pushButton_autosetsvsvertical",
-            args,
-            ac);
-        XtManageChild(pushButton_autosetsvsvertical);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_autosetsvsvertical, XmNactivateCallback, do_action_autosetsvsvertical, (XtPointer)0);
-
-    ac = 0;
-    separator10 = XmCreateSeparator(pulldownMenu_action,
-        (char *)"separator10",
-        args,
-        ac);
-    XtManageChild(separator10);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(pulldownMenu_action, (char *)"Check For New Crossings",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_action, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_newcrossings = XmCreatePushButton(pulldownMenu_action,
-            (char *)"pushButton_newcrossings",
-            args,
-            ac);
-        XtManageChild(pushButton_newcrossings);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_newcrossings, XmNactivateCallback, do_action_checknewcrossings, (XtPointer)0);
-
-    ac = 0;
-    separator17 = XmCreateSeparator(pulldownMenu_action,
-        (char *)"separator17",
-        args,
-        ac);
-    XtManageChild(separator17);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(pulldownMenu_action, (char *)"Analyze Crossings",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_action, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_analyzecrossings = XmCreatePushButton(pulldownMenu_action,
-            (char *)"pushButton_analyzecrossings",
-            args,
-            ac);
-        XtManageChild(pushButton_analyzecrossings);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_analyzecrossings, XmNactivateCallback, BxManageCB, (XtPointer)"bulletinBoard_naverr");
-    XtAddCallback(pushButton_analyzecrossings, XmNactivateCallback, do_naverr_init, (XtPointer)0);
-    XtAddCallback(pushButton_analyzecrossings, XmNactivateCallback, do_action_analyzecrossings, (XtPointer)0);
-
-    ac = 0;
-    separator11 = XmCreateSeparator(pulldownMenu_action,
-        (char *)"separator11",
-        args,
-        ac);
-    XtManageChild(separator11);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(pulldownMenu_action, (char *)"Zero All Z Offsets",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_action, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_zerozoffsets = XmCreatePushButton(pulldownMenu_action,
-            (char *)"pushButton_zerozoffsets",
-            args,
-            ac);
-        XtManageChild(pushButton_zerozoffsets);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_zerozoffsets, XmNactivateCallback, do_zerozoffsets, (XtPointer)0);
-
-    ac = 0;
-    separator16 = XmCreateSeparator(pulldownMenu_action,
-        (char *)"separator16",
-        args,
-        ac);
-    XtManageChild(separator16);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(pulldownMenu_action, (char *)"Invert Navigation",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_action, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_invertnav = XmCreatePushButton(pulldownMenu_action,
-            (char *)"pushButton_invertnav",
-            args,
-            ac);
-        XtManageChild(pushButton_invertnav);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_invertnav, XmNactivateCallback, do_action_invertnav, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(pulldownMenu_action, (char *)"Apply Adjusted Navigation",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_action, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_applynav = XmCreatePushButtonGadget(pulldownMenu_action,
-            (char *)"pushButton_applynav",
-            args,
-            ac);
-        XtManageChild(pushButton_applynav);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_applynav, XmNactivateCallback, do_apply_nav, (XtPointer)0);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNsubMenuId, pulldownMenu_action); ac++;
-    XtSetValues(cascadeButton_action, args, ac);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(menuBar_mbnavadjust, (char *)"About",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 907); ac++;
-        XtSetArg(args[ac], XmNy, 5); ac++;
-        XtSetArg(args[ac], XmNwidth, 50); ac++;
-        XtSetArg(args[ac], XmNheight, 22); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(menuBar_mbnavadjust, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        cascadeButton_about = XmCreateCascadeButton(menuBar_mbnavadjust,
-            (char *)"cascadeButton_about",
-            args,
-            ac);
-        XtManageChild(cascadeButton_about);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 0); ac++;
-    XtSetArg(args[ac], XmNy, 0); ac++;
-    XtSetArg(args[ac], XmNwidth, 46); ac++;
-    XtSetArg(args[ac], XmNheight, 26); ac++;
-    pulldownMenu_about = XmCreatePulldownMenu(XtParent(cascadeButton_about),
-        (char *)"pulldownMenu_about",
-        args,
-        ac);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(pulldownMenu_about, (char *)"About",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_about, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_about = XmCreatePushButton(pulldownMenu_about,
-            (char *)"pushButton_about",
-            args,
-            ac);
-        XtManageChild(pushButton_about);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_about, XmNactivateCallback, BxManageCB, (XtPointer)"form_about");
-
-    ac = 0;
-    XtSetArg(args[ac], XmNsubMenuId, pulldownMenu_about); ac++;
-    XtSetValues(cascadeButton_about, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNresizePolicy, XmRESIZE_GROW); ac++;
-    XtSetArg(args[ac], XmNwidth, 962); ac++;
-    XtSetArg(args[ac], XmNheight, 368); ac++;
-    form_mbnavadjust = XmCreateForm(mainWindow,
-        (char *)"form_mbnavadjust",
-        args,
-        ac);
-    XtManageChild(form_mbnavadjust);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNscrollingPolicy, XmAUTOMATIC); ac++;
-    XtSetArg(args[ac], XmNscrollBarDisplayPolicy, XmAS_NEEDED); ac++;
-    XtSetArg(args[ac], XmNx, 0); ac++;
-    XtSetArg(args[ac], XmNy, 150); ac++;
-    XtSetArg(args[ac], XmNwidth, 440); ac++;
-    XtSetArg(args[ac], XmNheight, 220); ac++;
-    scrolledWindow_messages = XmCreateScrolledWindow(form_mbnavadjust,
-        (char *)"scrolledWindow_messages",
-        args,
-        ac);
-    XtManageChild(scrolledWindow_messages);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNeditMode, XmMULTI_LINE_EDIT); ac++;
-    XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(scrolledWindow_messages, (char *)"-*-fixed-medium-r-*-*-*-120-*-*-*-*-iso8859-1",
-        XmRFontList, 0, &argok)); if (argok) ac++;
-    XtSetArg(args[ac], XmNcolumns, 120); ac++;
-    XtSetArg(args[ac], XmNwordWrap, False); ac++;
-    XtSetArg(args[ac], XmNautoShowCursorPosition, False); ac++;
-    XtSetArg(args[ac], XmNrows, 1); ac++;
-    XtSetArg(args[ac], XmNeditable, False); ac++;
-    text_messages = XmCreateText(scrolledWindow_messages,
-        (char *)"text_messages",
-        args,
-        ac);
-    XtManageChild(text_messages);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(form_mbnavadjust, (char *)"No Data Imported",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNx, 0); ac++;
-        XtSetArg(args[ac], XmNy, 0); ac++;
-        XtSetArg(args[ac], XmNwidth, 440); ac++;
-        XtSetArg(args[ac], XmNheight, 140); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(form_mbnavadjust, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        label_status = XmCreateLabel(form_mbnavadjust,
-            (char *)"label_status",
-            args,
-            ac);
-        XtManageChild(label_status);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(form_mbnavadjust, (char *)"Data Files:",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNx, 450); ac++;
-        XtSetArg(args[ac], XmNy, 0); ac++;
-        XtSetArg(args[ac], XmNwidth, 120); ac++;
-        XtSetArg(args[ac], XmNheight, 20); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(form_mbnavadjust, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        label_listdata = XmCreateLabel(form_mbnavadjust,
-            (char *)"label_listdata",
-            args,
-            ac);
-        XtManageChild(label_listdata);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNscrollingPolicy, XmAPPLICATION_DEFINED); ac++;
-    XtSetArg(args[ac], XmNx, 450); ac++;
-    XtSetArg(args[ac], XmNy, 30); ac++;
-    XtSetArg(args[ac], XmNwidth, 490); ac++;
-    XtSetArg(args[ac], XmNheight, 330); ac++;
-    scrolledWindow_datalist = XmCreateScrolledWindow(form_mbnavadjust,
-        (char *)"scrolledWindow_datalist",
-        args,
-        ac);
-    XtManageChild(scrolledWindow_datalist);
-
-    ac = 0;
-    {
-        Cardinal    ndx;
-        XmStringTable    tmp0;
-
-        tmp0 = (XmStringTable) BX_CONVERT(scrolledWindow_datalist, (char *)" ",
-                XmRXmStringTable, 0, &argok);
-        XtSetArg(args[ac], XmNitems, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNitemCount, 1); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(scrolledWindow_datalist, (char *)"-*-fixed-medium-r-*-*-*-120-*-*-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNselectionPolicy, XmSINGLE_SELECT); ac++;
-        XtSetArg(args[ac], XmNlistSizePolicy, XmCONSTANT); ac++;
-        XtSetArg(args[ac], XmNwidth, 490); ac++;
-        XtSetArg(args[ac], XmNheight, 330); ac++;
-        list_data = XmCreateList(scrolledWindow_datalist,
-            (char *)"list_data",
-            args,
-            ac);
-        XtManageChild(list_data);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        for ( ndx = 0; ndx < 1; ndx++ )
-        {
-            XmStringFree(((XmStringTable)tmp0)[ndx]);
-        }
-    }
-
-    XtAddCallback(list_data, XmNsingleSelectionCallback, do_list_data_select, (XtPointer)0);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNtitle, "Please Wait..."); ac++;
-    XtSetArg(args[ac], XmNallowShellResize, True); ac++;
-    XtSetArg(args[ac], XmNmwmInputMode, MWM_INPUT_MODELESS); ac++;
-    XtSetArg(args[ac], XmNdeleteResponse, XmUNMAP); ac++;
-    XtSetArg(args[ac], XmNwidth, 542); ac++;
-    XtSetArg(args[ac], XmNheight, 86); ac++;
-    xmDialogShell_message = XmCreateDialogShell(mainWindow,
-        (char *)"xmDialogShell_message",
-        args,
-        ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNdialogStyle, XmDIALOG_FULL_APPLICATION_MODAL); ac++;
-    XtSetArg(args[ac], XmNresizePolicy, XmRESIZE_ANY); ac++;
-    XtSetArg(args[ac], XmNx, 0); ac++;
-    XtSetArg(args[ac], XmNy, 1294); ac++;
-    XtSetArg(args[ac], XmNwidth, 542); ac++;
-    XtSetArg(args[ac], XmNheight, 86); ac++;
-    bulletinBoard_message = XtCreateWidget((char *)"bulletinBoard_message",
-        xmBulletinBoardWidgetClass,
-        xmDialogShell_message,
-        args,
-        ac);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_message, (char *)"Thank you for your patience.",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 40); ac++;
-        XtSetArg(args[ac], XmNwidth, 510); ac++;
-        XtSetArg(args[ac], XmNheight, 20); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_message, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        label_pleasewait = XmCreateLabel(bulletinBoard_message,
-            (char *)"label_pleasewait",
-            args,
-            ac);
-        XtManageChild(label_pleasewait);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_message, (char *)"MBnavadjust is loading data...",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 10); ac++;
-        XtSetArg(args[ac], XmNwidth, 510); ac++;
-        XtSetArg(args[ac], XmNheight, 20); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_message, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        label_message = XmCreateLabel(bulletinBoard_message,
-            (char *)"label_message",
-            args,
-            ac);
-        XtManageChild(label_message);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNtitle, "Error"); ac++;
-    XtSetArg(args[ac], XmNwidth, 311); ac++;
-    XtSetArg(args[ac], XmNheight, 160); ac++;
-    xmDialogShell_error = XmCreateDialogShell(mainWindow,
-        (char *)"xmDialogShell_error",
-        args,
-        ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNdialogStyle, XmDIALOG_APPLICATION_MODAL); ac++;
-    XtSetArg(args[ac], XmNresizePolicy, XmRESIZE_GROW); ac++;
-    XtSetArg(args[ac], XmNx, 0); ac++;
-    XtSetArg(args[ac], XmNy, 1257); ac++;
-    XtSetArg(args[ac], XmNwidth, 311); ac++;
-    XtSetArg(args[ac], XmNheight, 160); ac++;
-    bulletinBoard_error = XtCreateWidget((char *)"bulletinBoard_error",
-        xmBulletinBoardWidgetClass,
-        xmDialogShell_error,
-        args,
-        ac);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_error, (char *)"You probably do not have write",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 40); ac++;
-        XtSetArg(args[ac], XmNwidth, 290); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_error, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        label_error_two = XmCreateLabel(bulletinBoard_error,
-            (char *)"label_error_two",
-            args,
-            ac);
-        XtManageChild(label_error_two);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_error, (char *)"Unable to open output file.",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 10); ac++;
-        XtSetArg(args[ac], XmNwidth, 290); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_error, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        label_error_one = XmCreateLabel(bulletinBoard_error,
-            (char *)"label_error_one",
-            args,
-            ac);
-        XtManageChild(label_error_one);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_error, (char *)"permission in this directory!",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 70); ac++;
-        XtSetArg(args[ac], XmNwidth, 290); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_error, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        label_error_three = XmCreateLabel(bulletinBoard_error,
-            (char *)"label_error_three",
-            args,
-            ac);
-        XtManageChild(label_error_three);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_error, (char *)"OK",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 110); ac++;
-        XtSetArg(args[ac], XmNy, 110); ac++;
-        XtSetArg(args[ac], XmNwidth, 90); ac++;
-        XtSetArg(args[ac], XmNheight, 40); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_error, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_error = XmCreatePushButton(bulletinBoard_error,
-            (char *)"pushButton_error",
-            args,
-            ac);
-        XtManageChild(pushButton_error);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNtitle, "Select Input Data File"); ac++;
-    XtSetArg(args[ac], XmNallowShellResize, False); ac++;
-    XtSetArg(args[ac], XmNwidth, 611); ac++;
-    XtSetArg(args[ac], XmNheight, 530); ac++;
-    xmDialogShell_fileselection = XmCreateDialogShell(mainWindow,
-        (char *)"xmDialogShell_fileselection",
-        args,
-        ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNdialogStyle, XmDIALOG_FULL_APPLICATION_MODAL); ac++;
-    XtSetArg(args[ac], XmNresizePolicy, XmRESIZE_NONE); ac++;
-    XtSetArg(args[ac], XmNx, 0); ac++;
-    XtSetArg(args[ac], XmNy, 1072); ac++;
-    XtSetArg(args[ac], XmNwidth, 611); ac++;
-    XtSetArg(args[ac], XmNheight, 530); ac++;
-    bulletinBoard_fileselection = XtCreateWidget((char *)"bulletinBoard_fileselection",
-        xmBulletinBoardWidgetClass,
-        xmDialogShell_fileselection,
-        args,
-        ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(bulletinBoard_fileselection, (char *)"-*-"SANS"-bold-r-normal--14-140-75-75-p-82-iso8859-1",
-        XmRFontList, 0, &argok)); if (argok) ac++;
-    XtSetArg(args[ac], XmNx, 160); ac++;
-    XtSetArg(args[ac], XmNy, 480); ac++;
-    XtSetArg(args[ac], XmNwidth, 100); ac++;
-    XtSetArg(args[ac], XmNheight, 35); ac++;
-    textField_format = XmCreateTextField(bulletinBoard_fileselection,
-        (char *)"textField_format",
-        args,
-        ac);
-    XtManageChild(textField_format);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_fileselection, (char *)"MBIO Format ID:",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_fileselection, (char *)"-*-"SANS"-bold-r-normal--14-140-75-75-p-82-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 480); ac++;
-        XtSetArg(args[ac], XmNwidth, 150); ac++;
-        XtSetArg(args[ac], XmNheight, 40); ac++;
-        label_format = XmCreateLabel(bulletinBoard_fileselection,
-            (char *)"label_format",
-            args,
-            ac);
-        XtManageChild(label_format);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_fileselection, (char *)"File Selection",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNdialogTitle, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNdialogStyle, XmDIALOG_MODELESS); ac++;
-        XtSetArg(args[ac], XmNlistVisibleItemCount, 13); ac++;
-        XtSetArg(args[ac], XmNtextFontList,
-            BX_CONVERT(bulletinBoard_fileselection, (char *)"-*-"SANS"-bold-r-normal--14-140-75-75-p-82-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNlabelFontList,
-            BX_CONVERT(bulletinBoard_fileselection, (char *)"-*-"SANS"-bold-r-normal--14-140-75-75-p-82-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNbuttonFontList,
-            BX_CONVERT(bulletinBoard_fileselection, (char *)"-*-"SANS"-bold-r-normal--14-140-75-75-p-82-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNautoUnmanage, False); ac++;
-        XtSetArg(args[ac], XmNnoResize, True); ac++;
-        XtSetArg(args[ac], XmNresizePolicy, XmRESIZE_NONE); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 10); ac++;
-        XtSetArg(args[ac], XmNwidth, 590); ac++;
-        XtSetArg(args[ac], XmNheight, 470); ac++;
-        fileSelectionBox = XmCreateFileSelectionBox(bulletinBoard_fileselection,
-            (char *)"fileSelectionBox",
-            args,
-            ac);
-        XtManageChild(fileSelectionBox);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    BxUnmanageCB(fileSelectionBox, (XtPointer)"fileSelectionBox.Help", (XtPointer)0);
-    do_fileselection_mode(fileSelectionBox, (XtPointer)MBNA_FILESELECTION_NONE, (XtPointer)0);
-    XtAddCallback(fileSelectionBox, XmNokCallback, do_fileselection_ok, (XtPointer)0);
-    XtAddCallback(fileSelectionBox, XmNokCallback, BxUnmanageCB, (XtPointer)"bulletinBoard_fileselection");
-    XtAddCallback(fileSelectionBox, XmNcancelCallback, BxUnmanageCB, (XtPointer)"bulletinBoard_fileselection");
-    XtAddCallback(fileSelectionBox, XmNcancelCallback, do_fileselection_mode, (XtPointer)MBNA_FILESELECTION_NONE);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNwidth, 935); ac++;
-    XtSetArg(args[ac], XmNheight, 685); ac++;
-    dialogShell_naverr = XmCreateDialogShell(mainWindow,
-        (char *)"dialogShell_naverr",
-        args,
-        ac);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(dialogShell_naverr, (char *)"Navadjust: Nav Error at Crossings",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNdialogTitle, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNdefaultPosition, True); ac++;
-        XtSetArg(args[ac], XmNautoUnmanage, False); ac++;
-        XtSetArg(args[ac], XmNnoResize, True); ac++;
-        XtSetArg(args[ac], XmNresizePolicy, XmRESIZE_NONE); ac++;
-        XtSetArg(args[ac], XmNx, 258); ac++;
-        XtSetArg(args[ac], XmNy, 456); ac++;
-        XtSetArg(args[ac], XmNwidth, 935); ac++;
-        XtSetArg(args[ac], XmNheight, 685); ac++;
-        bulletinBoard_naverr = XtCreateWidget((char *)"bulletinBoard_naverr",
-            xmBulletinBoardWidgetClass,
-            dialogShell_naverr,
-            args,
-            ac);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_naverr, (char *)"Unset Crossing",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
-        XtSetArg(args[ac], XmNx, 450); ac++;
-        XtSetArg(args[ac], XmNy, 10); ac++;
-        XtSetArg(args[ac], XmNwidth, 100); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_naverr, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_naverr_unset = XmCreatePushButton(bulletinBoard_naverr,
-            (char *)"pushButton_naverr_unset",
-            args,
-            ac);
-        XtManageChild(pushButton_naverr_unset);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_naverr_unset, XmNactivateCallback, do_naverr_unset, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_naverr, (char *)"Minimum XY Misfit",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 650); ac++;
-        XtSetArg(args[ac], XmNwidth, 120); ac++;
-        XtSetArg(args[ac], XmNheight, 32); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_naverr, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_naverr_minxymisfit = XmCreatePushButton(bulletinBoard_naverr,
-            (char *)"pushButton_naverr_minxymisfit",
-            args,
-            ac);
-        XtManageChild(pushButton_naverr_minxymisfit);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_naverr_minxymisfit, XmNactivateCallback, do_naverr_minxymisfit, (XtPointer)0);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNborderWidth, 1); ac++;
-    XtSetArg(args[ac], XmNbackground,
-        BX_CONVERT(bulletinBoard_naverr, (char *)"white",
-        XmRPixel, 0, &argok)); if (argok) ac++;
-    XtSetArg(args[ac], XmNresizePolicy, XmRESIZE_NONE); ac++;
-    XtSetArg(args[ac], XmNx, 10); ac++;
-    XtSetArg(args[ac], XmNy, 550); ac++;
-    XtSetArg(args[ac], XmNwidth, 300); ac++;
-    XtSetArg(args[ac], XmNheight, 60); ac++;
-    drawingArea_naverr_zcorr = XmCreateDrawingArea(bulletinBoard_naverr,
-        (char *)"drawingArea_naverr_zcorr",
-        args,
-        ac);
-    XtManageChild(drawingArea_naverr_zcorr);
-    XtAddCallback(drawingArea_naverr_zcorr, XmNinputCallback, do_naverr_zcorr_input, (XtPointer)0);
-    XtAddCallback(drawingArea_naverr_zcorr, XmNexposeCallback, do_naverr_corr_expose, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_naverr, (char *)"Zero Z Offset",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 550); ac++;
-        XtSetArg(args[ac], XmNy, 40); ac++;
-        XtSetArg(args[ac], XmNwidth, 100); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_naverr, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_naverr_zerozoffset = XmCreatePushButton(bulletinBoard_naverr,
-            (char *)"pushButton_naverr_zerozoffset",
-            args,
-            ac);
-        XtManageChild(pushButton_naverr_zerozoffset);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_naverr_zerozoffset, XmNactivateCallback, do_naverr_zerozoffset, (XtPointer)0);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 10); ac++;
-    XtSetArg(args[ac], XmNy, 10); ac++;
-    XtSetArg(args[ac], XmNwidth, 76); ac++;
-    XtSetArg(args[ac], XmNheight, 32); ac++;
-    menuBar_settings = XmCreateMenuBar(bulletinBoard_naverr,
-        (char *)"menuBar_settings",
-        args,
-        ac);
-    XtManageChild(menuBar_settings);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(menuBar_settings, (char *)"Settings",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 5); ac++;
-        XtSetArg(args[ac], XmNy, 5); ac++;
-        XtSetArg(args[ac], XmNwidth, 66); ac++;
-        XtSetArg(args[ac], XmNheight, 22); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(menuBar_settings, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        cascadeButton_settings = XmCreateCascadeButton(menuBar_settings,
-            (char *)"cascadeButton_settings",
-            args,
-            ac);
-        XtManageChild(cascadeButton_settings);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 0); ac++;
-    XtSetArg(args[ac], XmNy, 0); ac++;
-    XtSetArg(args[ac], XmNwidth, 65); ac++;
-    XtSetArg(args[ac], XmNheight, 48); ac++;
-    pulldownMenu_settings = XmCreatePulldownMenu(XtParent(cascadeButton_settings),
-        (char *)"pulldownMenu_settings",
-        args,
-        ac);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(pulldownMenu_settings, (char *)"Biases",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_settings, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_naverr_biases = XmCreatePushButton(pulldownMenu_settings,
-            (char *)"pushButton_naverr_biases",
-            args,
-            ac);
-        XtManageChild(pushButton_naverr_biases);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_naverr_biases, XmNactivateCallback, BxManageCB, (XtPointer)"bulletinBoard_biases");
-    XtAddCallback(pushButton_naverr_biases, XmNactivateCallback, do_biases_init, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(pulldownMenu_settings, (char *)"Contours",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_settings, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_naverr_controls = XmCreatePushButton(pulldownMenu_settings,
-            (char *)"pushButton_naverr_controls",
-            args,
-            ac);
-        XtManageChild(pushButton_naverr_controls);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_naverr_controls, XmNactivateCallback, BxManageCB, (XtPointer)"form_controls");
-
-    ac = 0;
-    XtSetArg(args[ac], XmNsubMenuId, pulldownMenu_settings); ac++;
-    XtSetValues(cascadeButton_settings, args, ac);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_naverr, (char *)"Set Offset",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 550); ac++;
-        XtSetArg(args[ac], XmNy, 10); ac++;
-        XtSetArg(args[ac], XmNwidth, 100); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_naverr, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_naverr_settie = XmCreatePushButton(bulletinBoard_naverr,
-            (char *)"pushButton_naverr_settie",
-            args,
-            ac);
-        XtManageChild(pushButton_naverr_settie);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_naverr_settie, XmNactivateCallback, do_naverr_setoffset, (XtPointer)0);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 130); ac++;
-    XtSetArg(args[ac], XmNy, 620); ac++;
-    XtSetArg(args[ac], XmNwidth, 180); ac++;
-    XtSetArg(args[ac], XmNheight, 61); ac++;
-    XtSetArg(args[ac], XmNisHomogeneous, False); ac++;
-    radioBox_misfitcenter = XmCreateRadioBox(bulletinBoard_naverr,
-        (char *)"radioBox_misfitcenter",
-        args,
-        ac);
-    XtManageChild(radioBox_misfitcenter);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(radioBox_misfitcenter, (char *)"Center on Zero Offset",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNindicatorOn, XmINDICATOR_CHECK_BOX); ac++;
-        XtSetArg(args[ac], XmNwidth, 174); ac++;
-        XtSetArg(args[ac], XmNheight, 26); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(radioBox_misfitcenter, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        toggleButton_misfitcenter_zero = XmCreateToggleButton(radioBox_misfitcenter,
-            (char *)"toggleButton_misfitcenter_zero",
-            args,
-            ac);
-        XtManageChild(toggleButton_misfitcenter_zero);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(toggleButton_misfitcenter_zero, XmNvalueChangedCallback, do_naverr_misfitcenter, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(radioBox_misfitcenter, (char *)"Center on Current Offset",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNindicatorOn, XmINDICATOR_CHECK_BOX); ac++;
-        XtSetArg(args[ac], XmNwidth, 174); ac++;
-        XtSetArg(args[ac], XmNheight, 26); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(radioBox_misfitcenter, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        toggleButton_misfitcenter_auto = XmCreateToggleButton(radioBox_misfitcenter,
-            (char *)"toggleButton_misfitcenter_auto",
-            args,
-            ac);
-        XtManageChild(toggleButton_misfitcenter_auto);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(toggleButton_misfitcenter_auto, XmNvalueChangedCallback, do_naverr_misfitcenter, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_naverr, (char *)"Reset Offset",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
-        XtSetArg(args[ac], XmNx, 450); ac++;
-        XtSetArg(args[ac], XmNy, 40); ac++;
-        XtSetArg(args[ac], XmNwidth, 100); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_naverr, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_naverr_resettie = XmCreatePushButton(bulletinBoard_naverr,
-            (char *)"pushButton_naverr_resettie",
-            args,
-            ac);
-        XtManageChild(pushButton_naverr_resettie);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_naverr_resettie, XmNactivateCallback, do_naverr_resettie, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_naverr, (char *)"Add Tie",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
-        XtSetArg(args[ac], XmNx, 650); ac++;
-        XtSetArg(args[ac], XmNy, 10); ac++;
-        XtSetArg(args[ac], XmNwidth, 100); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_naverr, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_naverr_addtie = XmCreatePushButton(bulletinBoard_naverr,
-            (char *)"pushButton_naverr_addtie",
-            args,
-            ac);
-        XtManageChild(pushButton_naverr_addtie);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_naverr_addtie, XmNactivateCallback, do_naverr_addtie, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_naverr, (char *)"Delete Tie",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
-        XtSetArg(args[ac], XmNx, 750); ac++;
-        XtSetArg(args[ac], XmNy, 40); ac++;
-        XtSetArg(args[ac], XmNwidth, 100); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_naverr, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_naverr_deletetie = XmCreatePushButton(bulletinBoard_naverr,
-            (char *)"pushButton_naverr_deletetie",
-            args,
-            ac);
-        XtManageChild(pushButton_naverr_deletetie);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_naverr_deletetie, XmNactivateCallback, do_naverr_deletetie, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_naverr, (char *)"Full Size",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 350); ac++;
-        XtSetArg(args[ac], XmNy, 40); ac++;
-        XtSetArg(args[ac], XmNwidth, 100); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_naverr, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_naverr_fullsize = XmCreatePushButton(bulletinBoard_naverr,
-            (char *)"pushButton_naverr_fullsize",
-            args,
-            ac);
-        XtManageChild(pushButton_naverr_fullsize);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_naverr_fullsize, XmNactivateCallback, do_naverr_fullsize, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_naverr, (char *)"Zero Offset",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 650); ac++;
-        XtSetArg(args[ac], XmNy, 40); ac++;
-        XtSetArg(args[ac], XmNwidth, 100); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_naverr, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_naverr_zerooffset = XmCreatePushButton(bulletinBoard_naverr,
-            (char *)"pushButton_naverr_zerooffset",
-            args,
-            ac);
-        XtManageChild(pushButton_naverr_zerooffset);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_naverr_zerooffset, XmNactivateCallback, do_naverr_zerooffset, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_naverr, (char *)"No Data Imported",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 200); ac++;
-        XtSetArg(args[ac], XmNwidth, 300); ac++;
-        XtSetArg(args[ac], XmNheight, 40); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_naverr, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        label_naverr_offsets = XmCreateLabel(bulletinBoard_naverr,
-            (char *)"label_naverr_offsets",
-            args,
-            ac);
-        XtManageChild(label_naverr_offsets);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_naverr, (char *)"Next Unset",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
-        XtSetArg(args[ac], XmNx, 250); ac++;
-        XtSetArg(args[ac], XmNy, 10); ac++;
-        XtSetArg(args[ac], XmNwidth, 90); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_naverr, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_naverr_nextunset = XmCreatePushButton(bulletinBoard_naverr,
-            (char *)"pushButton_naverr_nextunset",
-            args,
-            ac);
-        XtManageChild(pushButton_naverr_nextunset);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_naverr_nextunset, XmNactivateCallback, do_naverr_nextunset, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_naverr, (char *)"No Data Imported",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 50); ac++;
-        XtSetArg(args[ac], XmNwidth, 300); ac++;
-        XtSetArg(args[ac], XmNheight, 150); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_naverr, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        label_naverr_status = XmCreateLabel(bulletinBoard_naverr,
-            (char *)"label_naverr_status",
-            args,
-            ac);
-        XtManageChild(label_naverr_status);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNborderWidth, 1); ac++;
-    XtSetArg(args[ac], XmNbackground,
-        BX_CONVERT(bulletinBoard_naverr, (char *)"white",
-        XmRPixel, 0, &argok)); if (argok) ac++;
-    XtSetArg(args[ac], XmNresizePolicy, XmRESIZE_NONE); ac++;
-    XtSetArg(args[ac], XmNx, 320); ac++;
-    XtSetArg(args[ac], XmNy, 70); ac++;
-    XtSetArg(args[ac], XmNwidth, 600); ac++;
-    XtSetArg(args[ac], XmNheight, 600); ac++;
-    drawingArea_naverr_cont = XmCreateDrawingArea(bulletinBoard_naverr,
-        (char *)"drawingArea_naverr_cont",
-        args,
-        ac);
-    XtManageChild(drawingArea_naverr_cont);
-    XtAddCallback(drawingArea_naverr_cont, XmNinputCallback, do_naverr_cont_input, (XtPointer)0);
-    XtAddCallback(drawingArea_naverr_cont, XmNexposeCallback, do_naverr_cont_expose, (XtPointer)0);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNborderWidth, 1); ac++;
-    XtSetArg(args[ac], XmNbackground,
-        BX_CONVERT(bulletinBoard_naverr, (char *)"white",
-        XmRPixel, 0, &argok)); if (argok) ac++;
-    XtSetArg(args[ac], XmNresizePolicy, XmRESIZE_NONE); ac++;
-    XtSetArg(args[ac], XmNx, 10); ac++;
-    XtSetArg(args[ac], XmNy, 240); ac++;
-    XtSetArg(args[ac], XmNwidth, 301); ac++;
-    XtSetArg(args[ac], XmNheight, 301); ac++;
-    drawingArea_naverr_corr = XmCreateDrawingArea(bulletinBoard_naverr,
-        (char *)"drawingArea_naverr_corr",
-        args,
-        ac);
-    XtManageChild(drawingArea_naverr_corr);
-    XtAddCallback(drawingArea_naverr_corr, XmNinputCallback, do_naverr_corr_input, (XtPointer)0);
-    XtAddCallback(drawingArea_naverr_corr, XmNexposeCallback, do_naverr_corr_expose, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_naverr, (char *)"Dismiss",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
-        XtSetArg(args[ac], XmNx, 850); ac++;
-        XtSetArg(args[ac], XmNy, 10); ac++;
-        XtSetArg(args[ac], XmNwidth, 70); ac++;
-        XtSetArg(args[ac], XmNheight, 60); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_naverr, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_naverr_dismiss = XmCreatePushButton(bulletinBoard_naverr,
-            (char *)"pushButton_naverr_dismiss",
-            args,
-            ac);
-        XtManageChild(pushButton_naverr_dismiss);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_naverr_dismiss, XmNactivateCallback, do_dismiss_naverr, (XtPointer)0);
-    XtAddCallback(pushButton_naverr_dismiss, XmNactivateCallback, BxUnmanageCB, (XtPointer)"bulletinBoard_biases");
-    XtAddCallback(pushButton_naverr_dismiss, XmNactivateCallback, BxUnmanageCB, (XtPointer)"bulletinBoard_naverr");
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_naverr, (char *)"Select Tie",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
-        XtSetArg(args[ac], XmNx, 750); ac++;
-        XtSetArg(args[ac], XmNy, 10); ac++;
-        XtSetArg(args[ac], XmNwidth, 100); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_naverr, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_naverr_selecttie = XmCreatePushButton(bulletinBoard_naverr,
-            (char *)"pushButton_naverr_selecttie",
-            args,
-            ac);
-        XtManageChild(pushButton_naverr_selecttie);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_naverr_selecttie, XmNactivateCallback, do_naverr_selecttie, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_naverr, (char *)"Minimum Misfit",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 620); ac++;
-        XtSetArg(args[ac], XmNwidth, 120); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_naverr, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_naverr_minimum = XmCreatePushButton(bulletinBoard_naverr,
-            (char *)"pushButton_naverr_minmisfit",
-            args,
-            ac);
-        XtManageChild(pushButton_naverr_minimum);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_naverr_minimum, XmNactivateCallback, do_naverr_minmisfit, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_naverr, (char *)"Next",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
-        XtSetArg(args[ac], XmNx, 170); ac++;
-        XtSetArg(args[ac], XmNy, 10); ac++;
-        XtSetArg(args[ac], XmNwidth, 80); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_naverr, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_naverr_next = XmCreatePushButton(bulletinBoard_naverr,
-            (char *)"pushButton_naverr_next",
-            args,
-            ac);
-        XtManageChild(pushButton_naverr_next);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_naverr_next, XmNactivateCallback, do_naverr_next, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_naverr, (char *)"Previous",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
-        XtSetArg(args[ac], XmNx, 90); ac++;
-        XtSetArg(args[ac], XmNy, 10); ac++;
-        XtSetArg(args[ac], XmNwidth, 80); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_naverr, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_naverr_previous = XmCreatePushButton(bulletinBoard_naverr,
-            (char *)"pushButton_naverr_previous",
-            args,
-            ac);
-        XtManageChild(pushButton_naverr_previous);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_naverr_previous, XmNactivateCallback, do_naverr_previous, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_naverr, (char *)"Skip Crossing",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
-        XtSetArg(args[ac], XmNx, 350); ac++;
-        XtSetArg(args[ac], XmNy, 10); ac++;
-        XtSetArg(args[ac], XmNwidth, 100); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_naverr, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_naverr_setnone = XmCreatePushButton(bulletinBoard_naverr,
-            (char *)"pushButton_naverr_setnone",
-            args,
-            ac);
-        XtManageChild(pushButton_naverr_setnone);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_naverr_setnone, XmNactivateCallback, do_naverr_setnone, (XtPointer)0);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNtitle, "Attitude Biases"); ac++;
-    XtSetArg(args[ac], XmNwidth, 284); ac++;
-    XtSetArg(args[ac], XmNheight, 446); ac++;
-    dialogShell_biases = XmCreateDialogShell(mainWindow,
-        (char *)"dialogShell_biases",
-        args,
-        ac);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(dialogShell_biases, (char *)"Heading & Roll Bias",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNdialogTitle, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNautoUnmanage, False); ac++;
-        XtSetArg(args[ac], XmNresizePolicy, XmRESIZE_GROW); ac++;
-        XtSetArg(args[ac], XmNx, 0); ac++;
-        XtSetArg(args[ac], XmNy, 1114); ac++;
-        XtSetArg(args[ac], XmNwidth, 284); ac++;
-        XtSetArg(args[ac], XmNheight, 446); ac++;
-        bulletinBoard_biases = XtCreateWidget((char *)"bulletinBoard_biases",
-            xmBulletinBoardWidgetClass,
-            dialogShell_biases,
-            args,
-            ac);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 10); ac++;
-    XtSetArg(args[ac], XmNy, 340); ac++;
-    XtSetArg(args[ac], XmNwidth, 260); ac++;
-    XtSetArg(args[ac], XmNheight, 20); ac++;
-    separator9 = XmCreateSeparator(bulletinBoard_biases,
-        (char *)"separator9",
-        args,
-        ac);
-    XtManageChild(separator9);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_biases, (char *)"Apply to All Files",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 70); ac++;
-        XtSetArg(args[ac], XmNy, 360); ac++;
-        XtSetArg(args[ac], XmNwidth, 140); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_biases, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_biases_applyall = XmCreatePushButton(bulletinBoard_biases,
-            (char *)"pushButton_biases_applyall",
-            args,
-            ac);
-        XtManageChild(pushButton_biases_applyall);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_biases_applyall, XmNactivateCallback, do_biases_applyall, (XtPointer)0);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 10); ac++;
-    XtSetArg(args[ac], XmNy, 60); ac++;
-    XtSetArg(args[ac], XmNwidth, 260); ac++;
-    XtSetArg(args[ac], XmNheight, 20); ac++;
-    separator8 = XmCreateSeparator(bulletinBoard_biases,
-        (char *)"separator8",
-        args,
-        ac);
-    XtManageChild(separator8);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 10); ac++;
-    XtSetArg(args[ac], XmNy, 200); ac++;
-    XtSetArg(args[ac], XmNwidth, 260); ac++;
-    XtSetArg(args[ac], XmNheight, 20); ac++;
-    separator6 = XmCreateSeparator(bulletinBoard_biases,
-        (char *)"separator6",
-        args,
-        ac);
-    XtManageChild(separator6);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_biases, (char *)"Section 2 Heading (deg)",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNtitleString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNminimum, -99); ac++;
-        XtSetArg(args[ac], XmNdecimalPoints, 1); ac++;
-        XtSetArg(args[ac], XmNvalue, 0); ac++;
-        XtSetArg(args[ac], XmNmaximum, 99); ac++;
-        XtSetArg(args[ac], XmNshowArrows, TRUE); ac++;
-        XtSetArg(args[ac], XmNshowValue, TRUE); ac++;
-        XtSetArg(args[ac], XmNorientation, XmHORIZONTAL); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 220); ac++;
-        XtSetArg(args[ac], XmNwidth, 260); ac++;
-        XtSetArg(args[ac], XmNheight, 58); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_biases, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        scale_biases_heading2 = XmCreateScale(bulletinBoard_biases,
-            (char *)"scale_biases_heading2",
-            args,
-            ac);
-        XtManageChild(scale_biases_heading2);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_biases, (char *)"Section 2 Roll (deg)",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNtitleString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNminimum, -99); ac++;
-        XtSetArg(args[ac], XmNdecimalPoints, 1); ac++;
-        XtSetArg(args[ac], XmNvalue, 0); ac++;
-        XtSetArg(args[ac], XmNmaximum, 99); ac++;
-        XtSetArg(args[ac], XmNshowArrows, TRUE); ac++;
-        XtSetArg(args[ac], XmNshowValue, TRUE); ac++;
-        XtSetArg(args[ac], XmNorientation, XmHORIZONTAL); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 280); ac++;
-        XtSetArg(args[ac], XmNwidth, 260); ac++;
-        XtSetArg(args[ac], XmNheight, 58); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_biases, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        scale_biases_roll2 = XmCreateScale(bulletinBoard_biases,
-            (char *)"scale_biases_roll2",
-            args,
-            ac);
-        XtManageChild(scale_biases_roll2);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_biases, (char *)"Section 1 Roll (deg)",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNtitleString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNminimum, -99); ac++;
-        XtSetArg(args[ac], XmNdecimalPoints, 1); ac++;
-        XtSetArg(args[ac], XmNvalue, 0); ac++;
-        XtSetArg(args[ac], XmNmaximum, 99); ac++;
-        XtSetArg(args[ac], XmNshowArrows, TRUE); ac++;
-        XtSetArg(args[ac], XmNshowValue, TRUE); ac++;
-        XtSetArg(args[ac], XmNorientation, XmHORIZONTAL); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 140); ac++;
-        XtSetArg(args[ac], XmNwidth, 260); ac++;
-        XtSetArg(args[ac], XmNheight, 58); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_biases, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        scale_biases_roll1 = XmCreateScale(bulletinBoard_biases,
-            (char *)"scale_biases_roll1",
-            args,
-            ac);
-        XtManageChild(scale_biases_roll1);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(scale_biases_roll1, XmNvalueChangedCallback, do_biases_roll, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_biases, (char *)"Section 1 Heading (deg)",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNtitleString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNminimum, -99); ac++;
-        XtSetArg(args[ac], XmNdecimalPoints, 1); ac++;
-        XtSetArg(args[ac], XmNvalue, 0); ac++;
-        XtSetArg(args[ac], XmNsliderVisual, XmSHADOWED_BACKGROUND); ac++;
-        XtSetArg(args[ac], XmNmaximum, 99); ac++;
-        XtSetArg(args[ac], XmNslidingMode, XmSLIDER); ac++;
-        XtSetArg(args[ac], XmNshowArrows, TRUE); ac++;
-        XtSetArg(args[ac], XmNshowValue, TRUE); ac++;
-        XtSetArg(args[ac], XmNorientation, XmHORIZONTAL); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 80); ac++;
-        XtSetArg(args[ac], XmNwidth, 260); ac++;
-        XtSetArg(args[ac], XmNheight, 58); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_biases, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        scale_biases_heading1 = XmCreateScale(bulletinBoard_biases,
-            (char *)"scale_biases_heading1",
-            args,
-            ac);
-        XtManageChild(scale_biases_heading1);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(scale_biases_heading1, XmNvalueChangedCallback, do_biases_heading, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_biases, (char *)":::t\"Section ID\'s:\":t\"  Section 1: XXX:XXX\"\"  Section 2: XXX:XXX\"",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 10); ac++;
-        XtSetArg(args[ac], XmNwidth, 140); ac++;
-        XtSetArg(args[ac], XmNheight, 50); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_biases, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        label_biases_files = XmCreateLabel(bulletinBoard_biases,
-            (char *)"label_biases_files",
-            args,
-            ac);
-        XtManageChild(label_biases_files);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 150); ac++;
-    XtSetArg(args[ac], XmNy, 10); ac++;
-    XtSetArg(args[ac], XmNwidth, 127); ac++;
-    XtSetArg(args[ac], XmNheight, 61); ac++;
-    XtSetArg(args[ac], XmNisHomogeneous, False); ac++;
-    radioBox_biases_together = XmCreateRadioBox(bulletinBoard_biases,
-        (char *)"radioBox_biases_together",
-        args,
-        ac);
-    XtManageChild(radioBox_biases_together);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(radioBox_biases_together, (char *)"Same biases",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNwidth, 121); ac++;
-        XtSetArg(args[ac], XmNheight, 26); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(radioBox_biases_together, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        toggleButton_biases_together = XmCreateToggleButton(radioBox_biases_together,
-            (char *)"toggleButton_biases_together",
-            args,
-            ac);
-        XtManageChild(toggleButton_biases_together);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(toggleButton_biases_together, XmNvalueChangedCallback, do_biases_toggle, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(radioBox_biases_together, (char *)"Different biases",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNwidth, 121); ac++;
-        XtSetArg(args[ac], XmNheight, 26); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(radioBox_biases_together, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        toggleButton_biases_separate = XmCreateToggleButton(radioBox_biases_together,
-            (char *)"toggleButton_biases_separate",
-            args,
-            ac);
-        XtManageChild(toggleButton_biases_separate);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_biases, (char *)"Apply",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 70); ac++;
-        XtSetArg(args[ac], XmNy, 400); ac++;
-        XtSetArg(args[ac], XmNwidth, 70); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_biases, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_biases_apply = XmCreatePushButton(bulletinBoard_biases,
-            (char *)"pushButton_biases_apply",
-            args,
-            ac);
-        XtManageChild(pushButton_biases_apply);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_biases_apply, XmNactivateCallback, do_biases_apply, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_biases, (char *)"Dismiss",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 140); ac++;
-        XtSetArg(args[ac], XmNy, 400); ac++;
-        XtSetArg(args[ac], XmNwidth, 70); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_biases, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_biases_dismiss = XmCreatePushButton(bulletinBoard_biases,
-            (char *)"pushButton_biases_dismiss",
-            args,
-            ac);
-        XtManageChild(pushButton_biases_dismiss);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_biases_dismiss, XmNactivateCallback, BxUnmanageCB, (XtPointer)"bulletinBoard_biases");
-
-    ac = 0;
-    XtSetArg(args[ac], XmNtitle, "About MBnavadjust"); ac++;
-    XtSetArg(args[ac], XmNwidth, 488); ac++;
-    XtSetArg(args[ac], XmNheight, 484); ac++;
-    dialogShell_about = XmCreateDialogShell(mainWindow,
-        (char *)"dialogShell_about",
-        args,
-        ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNresizePolicy, XmRESIZE_GROW); ac++;
-    XtSetArg(args[ac], XmNx, 0); ac++;
-    XtSetArg(args[ac], XmNy, 1095); ac++;
-    XtSetArg(args[ac], XmNwidth, 488); ac++;
-    XtSetArg(args[ac], XmNheight, 484); ac++;
-    form_about = XtCreateWidget((char *)"form_about",
-        xmFormWidgetClass,
-        dialogShell_about,
-        args,
-        ac);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(form_about, (char *)"David W. Caress    and    Dale N. Chayes",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(form_about, (char *)"-*-"SERIF"-bold-r-*-*-*-140-*-*-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 0); ac++;
-        XtSetArg(args[ac], XmNy, 250); ac++;
-        XtSetArg(args[ac], XmNwidth, 479); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        label_about_create1 = XmCreateLabel(form_about,
-            (char *)"label_about_create1",
-            args,
-            ac);
-        XtManageChild(label_about_create1);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 10); ac++;
-    XtSetArg(args[ac], XmNy, 210); ac++;
-    XtSetArg(args[ac], XmNwidth, 470); ac++;
-    XtSetArg(args[ac], XmNheight, 20); ac++;
-    separator1 = XmCreateSeparator(form_about,
-        (char *)"separator1",
-        args,
-        ac);
-    XtManageChild(separator1);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(form_about, (char *)"Dismiss",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(form_about, (char *)"-*-"SERIF"-bold-r-*-*-*-140-*-*-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 170); ac++;
-        XtSetArg(args[ac], XmNy, 410); ac++;
-        XtSetArg(args[ac], XmNwidth, 140); ac++;
-        XtSetArg(args[ac], XmNheight, 35); ac++;
-        pushButton_about_dismiss = XmCreatePushButton(form_about,
-            (char *)"pushButton_about_dismiss",
-            args,
-            ac);
-        XtManageChild(pushButton_about_dismiss);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_about_dismiss, XmNactivateCallback, BxUnmanageCB, (XtPointer)"form_about");
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(form_about, (char *)"Created by:",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(form_about, (char *)"-*-"SERIF"-bold-r-*-*-*-140-*-*-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 0); ac++;
-        XtSetArg(args[ac], XmNy, 230); ac++;
-        XtSetArg(args[ac], XmNwidth, 479); ac++;
-        XtSetArg(args[ac], XmNheight, 20); ac++;
-        label_about_create = XmCreateLabel(form_about,
-            (char *)"label_about_create",
-            args,
-            ac);
-        XtManageChild(label_about_create);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(form_about, (char *)":::t\"Lamont-Doherty \":t\"Earth Observatory\"\"of Columbia University\"",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(form_about, (char *)"-*-"SERIF"-bold-r-*-*-*-120-*-*-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 270); ac++;
-        XtSetArg(args[ac], XmNy, 280); ac++;
-        XtSetArg(args[ac], XmNwidth, 100); ac++;
-        XtSetArg(args[ac], XmNheight, 70); ac++;
-        label_about_lamont = XmCreateLabel(form_about,
-            (char *)"label_about_lamont",
-            args,
-            ac);
-        XtManageChild(label_about_lamont);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(form_about, (char *)":::t\"Monterey Bay\":t\"Aquarium\"\"Research Institute\"",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(form_about, (char *)"-*-"SERIF"-bold-r-*-*-*-120-*-*-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 110); ac++;
-        XtSetArg(args[ac], XmNy, 280); ac++;
-        XtSetArg(args[ac], XmNwidth, 110); ac++;
-        XtSetArg(args[ac], XmNheight, 70); ac++;
-        label_about_columbia = XmCreateLabel(form_about,
-            (char *)"label_about_columbia",
-            args,
-            ac);
-        XtManageChild(label_about_columbia);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(form_about, (char *)"MB-System",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(form_about, (char *)"-*-"SERIF"-bold-r-*-*-*-240-*-*-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 0); ac++;
-        XtSetArg(args[ac], XmNy, 110); ac++;
-        XtSetArg(args[ac], XmNwidth, 479); ac++;
-        XtSetArg(args[ac], XmNheight, 38); ac++;
-        label_about_mbsystem = XmCreateLabel(form_about,
-            (char *)"label_about_mbsystem",
-            args,
-            ac);
-        XtManageChild(label_about_mbsystem);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(form_about, (char *)"An Open Source Software Package",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(form_about, (char *)"-*-"SERIF"-bold-r-*-*-*-140-*-*-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 0); ac++;
-        XtSetArg(args[ac], XmNy, 150); ac++;
-        XtSetArg(args[ac], XmNwidth, 479); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        label_about_mbpub = XmCreateLabel(form_about,
-            (char *)"label_about_mbpub",
-            args,
-            ac);
-        XtManageChild(label_about_mbpub);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(form_about, (char *)"One Component of the",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(form_about, (char *)"-*-"SERIF"-bold-r-*-*-*-140-*-*-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 0); ac++;
-        XtSetArg(args[ac], XmNy, 80); ac++;
-        XtSetArg(args[ac], XmNwidth, 479); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        label_about_component = XmCreateLabel(form_about,
-            (char *)"label_about_component",
-            args,
-            ac);
-        XtManageChild(label_about_component);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(form_about, (char *)"for Processing and Display of Swath Sonar Data",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(form_about, (char *)"-*-"SERIF"-bold-r-*-*-*-140-*-*-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 0); ac++;
-        XtSetArg(args[ac], XmNy, 180); ac++;
-        XtSetArg(args[ac], XmNwidth, 479); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        label_about_for = XmCreateLabel(form_about,
-            (char *)"label_about_for",
-            args,
-            ac);
-        XtManageChild(label_about_for);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 10); ac++;
-    XtSetArg(args[ac], XmNy, 60); ac++;
-    XtSetArg(args[ac], XmNwidth, 470); ac++;
-    XtSetArg(args[ac], XmNheight, 20); ac++;
-    separator = XmCreateSeparator(form_about,
-        (char *)"separator",
-        args,
-        ac);
-    XtManageChild(separator);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(form_about, (char *)":::t\"MB-System Release 4.6\"\"April 14, 1999\"",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(form_about, (char *)"-*-"SERIF"-medium-r-*-*-*-140-*-*-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
-        XtSetArg(args[ac], XmNx, 0); ac++;
-        XtSetArg(args[ac], XmNy, 350); ac++;
-        XtSetArg(args[ac], XmNwidth, 479); ac++;
-        XtSetArg(args[ac], XmNheight, 60); ac++;
-        label_about_version = XmCreateLabel(form_about,
-            (char *)"label_about_version",
-            args,
-            ac);
-        XtManageChild(label_about_version);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(form_about, (char *)"Interactive Navigation Adjustment of Swath Bathymetry",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(form_about, (char *)"-*-"SERIF"-bold-r-*-*-*-180-*-*-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 0); ac++;
-        XtSetArg(args[ac], XmNy, 30); ac++;
-        XtSetArg(args[ac], XmNwidth, 479); ac++;
-        XtSetArg(args[ac], XmNheight, 20); ac++;
-        label_about_function = XmCreateLabel(form_about,
-            (char *)"label_about_function",
-            args,
-            ac);
-        XtManageChild(label_about_function);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(form_about, (char *)"MBnavadjust",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(form_about, (char *)"-*-"SERIF"-bold-r-*-*-*-240-*-*-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 0); ac++;
-        XtSetArg(args[ac], XmNy, 0); ac++;
-        XtSetArg(args[ac], XmNwidth, 479); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        label_about_mbedit = XmCreateLabel(form_about,
-            (char *)"label_about_mbedit",
-            args,
-            ac);
-        XtManageChild(label_about_mbedit);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNtitle, "Controls"); ac++;
-    XtSetArg(args[ac], XmNwidth, 635); ac++;
-    XtSetArg(args[ac], XmNheight, 438); ac++;
-    dialogShell_controls = XmCreateDialogShell(mainWindow,
-        (char *)"dialogShell_controls",
-        args,
-        ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNresizePolicy, XmRESIZE_GROW); ac++;
-    XtSetArg(args[ac], XmNx, 0); ac++;
-    XtSetArg(args[ac], XmNy, 1118); ac++;
-    XtSetArg(args[ac], XmNwidth, 635); ac++;
-    XtSetArg(args[ac], XmNheight, 438); ac++;
-    form_controls = XtCreateWidget((char *)"form_controls",
-        xmFormWidgetClass,
-        dialogShell_controls,
-        args,
-        ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 10); ac++;
-    XtSetArg(args[ac], XmNy, 370); ac++;
-    XtSetArg(args[ac], XmNwidth, 613); ac++;
-    XtSetArg(args[ac], XmNheight, 20); ac++;
-    separator14 = XmCreateSeparator(form_controls,
-        (char *)"separator14",
-        args,
-        ac);
-    XtManageChild(separator14);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNminimum, 1); ac++;
-    XtSetArg(args[ac], XmNdecimalPoints, 0); ac++;
-    XtSetArg(args[ac], XmNvalue, 10); ac++;
-    XtSetArg(args[ac], XmNmaximum, 20); ac++;
-    XtSetArg(args[ac], XmNshowArrows, TRUE); ac++;
-    XtSetArg(args[ac], XmNshowValue, TRUE); ac++;
-    XtSetArg(args[ac], XmNorientation, XmHORIZONTAL); ac++;
-    XtSetArg(args[ac], XmNx, 140); ac++;
-    XtSetArg(args[ac], XmNy, 330); ac++;
-    XtSetArg(args[ac], XmNwidth, 480); ac++;
-    XtSetArg(args[ac], XmNheight, 36); ac++;
-    XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(form_controls, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
-        XmRFontList, 0, &argok)); if (argok) ac++;
-    scale_controls_zoffset = XmCreateScale(form_controls,
-        (char *)"scale_controls_zoffset",
-        args,
-        ac);
-    XtManageChild(scale_controls_zoffset);
-    XtAddCallback(scale_controls_zoffset, XmNvalueChangedCallback, do_scale_controls_zoffset, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(form_controls, (char *)"Z Offset Width (m):",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 340); ac++;
-        XtSetArg(args[ac], XmNwidth, 120); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(form_controls, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        label_controls_zoffset = XmCreateLabel(form_controls,
-            (char *)"label_controls_zoffset",
-            args,
-            ac);
-        XtManageChild(label_controls_zoffset);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(form_controls, (char *)":::t\"Inversion\"\"Smoothing (m):\"",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 270); ac++;
-        XtSetArg(args[ac], XmNwidth, 120); ac++;
-        XtSetArg(args[ac], XmNheight, 40); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(form_controls, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        label_controls_smoothing = XmCreateLabel(form_controls,
-            (char *)"label_controls_smoothing",
-            args,
-            ac);
-        XtManageChild(label_controls_smoothing);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNminimum, 1); ac++;
-    XtSetArg(args[ac], XmNdecimalPoints, 2); ac++;
-    XtSetArg(args[ac], XmNvalue, 10); ac++;
-    XtSetArg(args[ac], XmNmaximum, 5000); ac++;
-    XtSetArg(args[ac], XmNshowArrows, TRUE); ac++;
-    XtSetArg(args[ac], XmNshowValue, TRUE); ac++;
-    XtSetArg(args[ac], XmNorientation, XmHORIZONTAL); ac++;
-    XtSetArg(args[ac], XmNx, 140); ac++;
-    XtSetArg(args[ac], XmNy, 270); ac++;
-    XtSetArg(args[ac], XmNwidth, 488); ac++;
-    XtSetArg(args[ac], XmNheight, 36); ac++;
-    XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(form_controls, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
-        XmRFontList, 0, &argok)); if (argok) ac++;
-    scale_controls_smoothing = XmCreateScale(form_controls,
-        (char *)"scale_controls_smoothing",
-        args,
-        ac);
-    XtManageChild(scale_controls_smoothing);
-    XtAddCallback(scale_controls_smoothing, XmNvalueChangedCallback, do_scale_controls_smoothing, (XtPointer)0);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 10); ac++;
-    XtSetArg(args[ac], XmNy, 310); ac++;
-    XtSetArg(args[ac], XmNwidth, 613); ac++;
-    XtSetArg(args[ac], XmNheight, 20); ac++;
-    separator12 = XmCreateSeparator(form_controls,
-        (char *)"separator12",
-        args,
-        ac);
-    XtManageChild(separator12);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(form_controls, (char *)"Max Section Length (km):",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 20); ac++;
-        XtSetArg(args[ac], XmNwidth, 160); ac++;
-        XtSetArg(args[ac], XmNheight, 20); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(form_controls, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        label_controls_sectionlength = XmCreateLabel(form_controls,
-            (char *)"label_controls_sectionlength",
-            args,
-            ac);
-        XtManageChild(label_controls_sectionlength);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNminimum, 1); ac++;
-    XtSetArg(args[ac], XmNdecimalPoints, 2); ac++;
-    XtSetArg(args[ac], XmNvalue, 2000); ac++;
-    XtSetArg(args[ac], XmNmaximum, 5000); ac++;
-    XtSetArg(args[ac], XmNshowArrows, TRUE); ac++;
-    XtSetArg(args[ac], XmNshowValue, TRUE); ac++;
-    XtSetArg(args[ac], XmNorientation, XmHORIZONTAL); ac++;
-    XtSetArg(args[ac], XmNx, 190); ac++;
-    XtSetArg(args[ac], XmNy, 0); ac++;
-    XtSetArg(args[ac], XmNwidth, 438); ac++;
-    XtSetArg(args[ac], XmNheight, 36); ac++;
-    XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(form_controls, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
-        XmRFontList, 0, &argok)); if (argok) ac++;
-    scale_controls_sectionlength = XmCreateScale(form_controls,
-        (char *)"scale_controls_sectionlength",
-        args,
-        ac);
-    XtManageChild(scale_controls_sectionlength);
-    XtAddCallback(scale_controls_sectionlength, XmNvalueChangedCallback, do_scale_controls_sectionlength, (XtPointer)0);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNminimum, 1); ac++;
-    XtSetArg(args[ac], XmNdecimalPoints, 2); ac++;
-    XtSetArg(args[ac], XmNvalue, 10000); ac++;
-    XtSetArg(args[ac], XmNmaximum, 40000); ac++;
-    XtSetArg(args[ac], XmNshowArrows, TRUE); ac++;
-    XtSetArg(args[ac], XmNshowValue, TRUE); ac++;
-    XtSetArg(args[ac], XmNorientation, XmHORIZONTAL); ac++;
-    XtSetArg(args[ac], XmNx, 140); ac++;
-    XtSetArg(args[ac], XmNy, 224); ac++;
-    XtSetArg(args[ac], XmNwidth, 489); ac++;
-    XtSetArg(args[ac], XmNheight, 36); ac++;
-    XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(form_controls, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
-        XmRFontList, 0, &argok)); if (argok) ac++;
-    scale_controls_tickinterval = XmCreateScale(form_controls,
-        (char *)"scale_controls_tickinterval",
-        args,
-        ac);
-    XtManageChild(scale_controls_tickinterval);
-    XtAddCallback(scale_controls_tickinterval, XmNvalueChangedCallback, do_scale_controls_tickinterval, (XtPointer)0);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNminimum, 1); ac++;
-    XtSetArg(args[ac], XmNdecimalPoints, 2); ac++;
-    XtSetArg(args[ac], XmNvalue, 10000); ac++;
-    XtSetArg(args[ac], XmNmaximum, 40000); ac++;
-    XtSetArg(args[ac], XmNshowArrows, TRUE); ac++;
-    XtSetArg(args[ac], XmNshowValue, TRUE); ac++;
-    XtSetArg(args[ac], XmNorientation, XmHORIZONTAL); ac++;
-    XtSetArg(args[ac], XmNx, 140); ac++;
-    XtSetArg(args[ac], XmNy, 184); ac++;
-    XtSetArg(args[ac], XmNwidth, 489); ac++;
-    XtSetArg(args[ac], XmNheight, 36); ac++;
-    XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(form_controls, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
-        XmRFontList, 0, &argok)); if (argok) ac++;
-    scale_controls_colorinterval = XmCreateScale(form_controls,
-        (char *)"scale_controls_colorinterval",
-        args,
-        ac);
-    XtManageChild(scale_controls_colorinterval);
-    XtAddCallback(scale_controls_colorinterval, XmNvalueChangedCallback, do_controls_scale_colorinterval, (XtPointer)0);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNminimum, 1); ac++;
-    XtSetArg(args[ac], XmNdecimalPoints, 2); ac++;
-    XtSetArg(args[ac], XmNvalue, 2500); ac++;
-    XtSetArg(args[ac], XmNmaximum, 40000); ac++;
-    XtSetArg(args[ac], XmNshowArrows, TRUE); ac++;
-    XtSetArg(args[ac], XmNshowValue, TRUE); ac++;
-    XtSetArg(args[ac], XmNorientation, XmHORIZONTAL); ac++;
-    XtSetArg(args[ac], XmNx, 140); ac++;
-    XtSetArg(args[ac], XmNy, 144); ac++;
-    XtSetArg(args[ac], XmNwidth, 489); ac++;
-    XtSetArg(args[ac], XmNheight, 36); ac++;
-    XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(form_controls, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
-        XmRFontList, 0, &argok)); if (argok) ac++;
-    scale_controls_contourinterval = XmCreateScale(form_controls,
-        (char *)"scale_controls_contourinterval",
-        args,
-        ac);
-    XtManageChild(scale_controls_contourinterval);
-    XtAddCallback(scale_controls_contourinterval, XmNvalueChangedCallback, do_scale_contourinterval, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(form_controls, (char *)"Contour Interval (m):",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 160); ac++;
-        XtSetArg(args[ac], XmNwidth, 140); ac++;
-        XtSetArg(args[ac], XmNheight, 20); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(form_controls, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        label_controls_contourinterval = XmCreateLabel(form_controls,
-            (char *)"label_controls_contourinterval",
-            args,
-            ac);
-        XtManageChild(label_controls_contourinterval);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(form_controls, (char *)"Color Interval (m):",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 200); ac++;
-        XtSetArg(args[ac], XmNwidth, 130); ac++;
-        XtSetArg(args[ac], XmNheight, 20); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(form_controls, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        label_controls_colorinterval = XmCreateLabel(form_controls,
-            (char *)"label_controls_colorinterval",
-            args,
-            ac);
-        XtManageChild(label_controls_colorinterval);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(form_controls, (char *)"Tick Interval (m):",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 240); ac++;
-        XtSetArg(args[ac], XmNwidth, 120); ac++;
-        XtSetArg(args[ac], XmNheight, 20); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(form_controls, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        label_controls_tickinterval = XmCreateLabel(form_controls,
-            (char *)"label_controls_tickinterval",
-            args,
-            ac);
-        XtManageChild(label_controls_tickinterval);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(form_controls, (char *)"Apply",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 200); ac++;
-        XtSetArg(args[ac], XmNy, 389); ac++;
-        XtSetArg(args[ac], XmNwidth, 70); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(form_controls, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_controls_apply = XmCreatePushButton(form_controls,
-            (char *)"pushButton_controls_apply",
-            args,
-            ac);
-        XtManageChild(pushButton_controls_apply);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_controls_apply, XmNactivateCallback, do_controls_apply, (XtPointer)0);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 13); ac++;
-    XtSetArg(args[ac], XmNy, 88); ac++;
-    XtSetArg(args[ac], XmNwidth, 616); ac++;
-    XtSetArg(args[ac], XmNheight, 20); ac++;
-    separator4 = XmCreateSeparator(form_controls,
-        (char *)"separator4",
-        args,
-        ac);
-    XtManageChild(separator4);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 10); ac++;
-    XtSetArg(args[ac], XmNy, 264); ac++;
-    XtSetArg(args[ac], XmNwidth, 618); ac++;
-    XtSetArg(args[ac], XmNheight, 20); ac++;
-    separator5 = XmCreateSeparator(form_controls,
-        (char *)"separator5",
-        args,
-        ac);
-    XtManageChild(separator5);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNminimum, 1); ac++;
-    XtSetArg(args[ac], XmNvalue, 1); ac++;
-    XtSetArg(args[ac], XmNmaximum, 10); ac++;
-    XtSetArg(args[ac], XmNshowArrows, TRUE); ac++;
-    XtSetArg(args[ac], XmNshowValue, TRUE); ac++;
-    XtSetArg(args[ac], XmNorientation, XmHORIZONTAL); ac++;
-    XtSetArg(args[ac], XmNx, 140); ac++;
-    XtSetArg(args[ac], XmNy, 104); ac++;
-    XtSetArg(args[ac], XmNwidth, 489); ac++;
-    XtSetArg(args[ac], XmNheight, 36); ac++;
-    XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(form_controls, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
-        XmRFontList, 0, &argok)); if (argok) ac++;
-    scale_controls_decimation = XmCreateScale(form_controls,
-        (char *)"scale_controls_decimation",
-        args,
-        ac);
-    XtManageChild(scale_controls_decimation);
-    XtAddCallback(scale_controls_decimation, XmNvalueChangedCallback, do_scale_controls_decimation, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(form_controls, (char *)"Decimation:",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 120); ac++;
-        XtSetArg(args[ac], XmNwidth, 120); ac++;
-        XtSetArg(args[ac], XmNheight, 20); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(form_controls, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        label_controls_decimation = XmCreateLabel(form_controls,
-            (char *)"label_controls_decimation",
-            args,
-            ac);
-        XtManageChild(label_controls_decimation);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(form_controls, (char *)"Max # Soundings in Section:",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 60); ac++;
-        XtSetArg(args[ac], XmNwidth, 180); ac++;
-        XtSetArg(args[ac], XmNheight, 20); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(form_controls, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        label_controls_sectionsoundings = XmCreateLabel(form_controls,
-            (char *)"label_controls_sectionsoundings",
-            args,
-            ac);
-        XtManageChild(label_controls_sectionsoundings);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNminimum, 1000); ac++;
-    XtSetArg(args[ac], XmNdecimalPoints, 0); ac++;
-    XtSetArg(args[ac], XmNvalue, 10000); ac++;
-    XtSetArg(args[ac], XmNmaximum, 100000); ac++;
-    XtSetArg(args[ac], XmNshowArrows, TRUE); ac++;
-    XtSetArg(args[ac], XmNscaleMultiple, 499); ac++;
-    XtSetArg(args[ac], XmNshowValue, TRUE); ac++;
-    XtSetArg(args[ac], XmNorientation, XmHORIZONTAL); ac++;
-    XtSetArg(args[ac], XmNx, 190); ac++;
-    XtSetArg(args[ac], XmNy, 40); ac++;
-    XtSetArg(args[ac], XmNwidth, 439); ac++;
-    XtSetArg(args[ac], XmNheight, 43); ac++;
-    XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(form_controls, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
-        XmRFontList, 0, &argok)); if (argok) ac++;
-    scale_controls_sectionsoundings = XmCreateScale(form_controls,
-        (char *)"scale_controls_sectionsoundings",
-        args,
-        ac);
-    XtManageChild(scale_controls_sectionsoundings);
-    XtAddCallback(scale_controls_sectionsoundings, XmNvalueChangedCallback, do_scale_controls_sectionsoundings, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(form_controls, (char *)"Dismiss",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 300); ac++;
-        XtSetArg(args[ac], XmNy, 389); ac++;
-        XtSetArg(args[ac], XmNwidth, 108); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(form_controls, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_controls_dismiss = XmCreatePushButton(form_controls,
-            (char *)"pushButton_controls_dismiss",
-            args,
-            ac);
-        XtManageChild(pushButton_controls_dismiss);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_controls_dismiss, XmNactivateCallback, BxUnmanageCB, (XtPointer)"form_controls");
-
-    ac = 0;
-    XtSetArg(args[ac], XmNtitle, "Navigation Adjustment Model Plot"); ac++;
-    XtSetArg(args[ac], XmNallowShellResize, True); ac++;
-    XtSetArg(args[ac], XmNwidth, 1021); ac++;
-    XtSetArg(args[ac], XmNheight, 483); ac++;
-    dialogShell_modelplot = XmCreateDialogShell(mainWindow,
-        (char *)"dialogShell_modelplot",
-        args,
-        ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNautoUnmanage, False); ac++;
-    XtSetArg(args[ac], XmNresizePolicy, XmRESIZE_GROW); ac++;
-    XtSetArg(args[ac], XmNx, 757); ac++;
-    XtSetArg(args[ac], XmNy, 995); ac++;
-    XtSetArg(args[ac], XmNwidth, 1021); ac++;
-    XtSetArg(args[ac], XmNheight, 483); ac++;
-    bulletinBoard_modelplot = XtCreateWidget((char *)"bulletinBoard_modelplot",
-        xmBulletinBoardWidgetClass,
-        dialogShell_modelplot,
-        args,
-        ac);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_modelplot, (char *)"Clear Block",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 480); ac++;
-        XtSetArg(args[ac], XmNy, 10); ac++;
-        XtSetArg(args[ac], XmNwidth, 80); ac++;
-        XtSetArg(args[ac], XmNheight, 32); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_modelplot, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_modelplot_clearblock = XmCreatePushButton(bulletinBoard_modelplot,
-            (char *)"pushButton_modelplot_clearblock",
-            args,
-            ac);
-        XtManageChild(pushButton_modelplot_clearblock);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_modelplot_clearblock, XmNactivateCallback, do_modelplot_clearblock, (XtPointer)0);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNorientation, XmHORIZONTAL); ac++;
-    XtSetArg(args[ac], XmNx, 80); ac++;
-    XtSetArg(args[ac], XmNy, 10); ac++;
-    XtSetArg(args[ac], XmNwidth, 270); ac++;
-    XtSetArg(args[ac], XmNheight, 32); ac++;
-    XtSetArg(args[ac], XmNisHomogeneous, False); ac++;
-    radioBox = XmCreateRadioBox(bulletinBoard_modelplot,
-        (char *)"radioBox",
-        args,
-        ac);
-    XtManageChild(radioBox);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(radioBox, (char *)"Time Series",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNwidth, 88); ac++;
-        XtSetArg(args[ac], XmNheight, 26); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(radioBox, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        toggleButton_modelplot_timeseries = XmCreateToggleButton(radioBox,
-            (char *)"toggleButton_modelplot_timeseries",
-            args,
-            ac);
-        XtManageChild(toggleButton_modelplot_timeseries);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(toggleButton_modelplot_timeseries, XmNvalueChangedCallback, do_modelplot_timeseries, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(radioBox, (char *)"Perturbation",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNwidth, 88); ac++;
-        XtSetArg(args[ac], XmNheight, 26); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(radioBox, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        toggleButton_modelplot_perturbation = XmCreateToggleButton(radioBox,
-            (char *)"toggleButton_modelplot_perturbation",
-            args,
-            ac);
-        XtManageChild(toggleButton_modelplot_perturbation);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(toggleButton_modelplot_perturbation, XmNvalueChangedCallback, do_modelplot_perturbation, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(radioBox, (char *)"Tie Offsets",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNwidth, 88); ac++;
-        XtSetArg(args[ac], XmNheight, 26); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(radioBox, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        toggleButton_modelplot_tieoffsets = XmCreateToggleButton(radioBox,
-            (char *)"toggleButton_modelplot_tieoffsets",
-            args,
-            ac);
-        XtManageChild(toggleButton_modelplot_tieoffsets);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(toggleButton_modelplot_tieoffsets, XmNvalueChangedCallback, do_modelplot_tieoffsets, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_modelplot, (char *)"Full Size",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 390); ac++;
-        XtSetArg(args[ac], XmNy, 10); ac++;
-        XtSetArg(args[ac], XmNwidth, 80); ac++;
-        XtSetArg(args[ac], XmNheight, 32); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_modelplot, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_modelplot_fullsize = XmCreatePushButton(bulletinBoard_modelplot,
-            (char *)"pushButton_modelplot_fullsize",
-            args,
-            ac);
-        XtManageChild(pushButton_modelplot_fullsize);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_modelplot_fullsize, XmNactivateCallback, do_modelplot_fullsize, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_modelplot, (char *)":::t\"Mouse: <left> select  tie; <middle> select untied crossing; <right> drag zoom extent\"\"Selection: No selection\"",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
-        XtSetArg(args[ac], XmNx, 570); ac++;
-        XtSetArg(args[ac], XmNy, 10); ac++;
-        XtSetArg(args[ac], XmNwidth, 550); ac++;
-        XtSetArg(args[ac], XmNheight, 40); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_modelplot, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        label_modelplot_status = XmCreateLabel(bulletinBoard_modelplot,
-            (char *)"label_modelplot_status",
-            args,
-            ac);
-        XtManageChild(label_modelplot_status);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNborderWidth, 1); ac++;
-    XtSetArg(args[ac], XmNbackground,
-        BX_CONVERT(bulletinBoard_modelplot, (char *)"white",
-        XmRPixel, 0, &argok)); if (argok) ac++;
-    XtSetArg(args[ac], XmNx, 10); ac++;
-    XtSetArg(args[ac], XmNy, 50); ac++;
-    XtSetArg(args[ac], XmNwidth, 990); ac++;
-    XtSetArg(args[ac], XmNheight, 420); ac++;
-    drawingArea_modelplot = XmCreateDrawingArea(bulletinBoard_modelplot,
-        (char *)"drawingArea_modelplot",
-        args,
-        ac);
-    XtManageChild(drawingArea_modelplot);
-    XtAddCallback(drawingArea_modelplot, XmNinputCallback, do_modelplot_input, (XtPointer)0);
-    XtAddCallback(drawingArea_modelplot, XmNexposeCallback, do_modelplot_expose, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_modelplot, (char *)"Dismiss",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 10); ac++;
-        XtSetArg(args[ac], XmNwidth, 60); ac++;
-        XtSetArg(args[ac], XmNheight, 32); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_modelplot, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_modelplot_dismiss = XmCreatePushButton(bulletinBoard_modelplot,
-            (char *)"pushButton_modelplot_dismiss",
-            args,
-            ac);
-        XtManageChild(pushButton_modelplot_dismiss);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_modelplot_dismiss, XmNactivateCallback, BxUnmanageCB, (XtPointer)"bulletinBoard_modelplot");
-    XtAddCallback(pushButton_modelplot_dismiss, XmNactivateCallback, do_modelplot_dismiss, (XtPointer)0);
-    ac = 0;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 10); ac++;
-    XtSetArg(args[ac], XmNtopOffset, 370); ac++;
-    XtSetValues(separator14, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 140); ac++;
-    XtSetArg(args[ac], XmNtopOffset, 330); ac++;
-    XtSetValues(scale_controls_zoffset, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 10); ac++;
-    XtSetArg(args[ac], XmNtopOffset, 340); ac++;
-    XtSetValues(label_controls_zoffset, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 10); ac++;
-    XtSetArg(args[ac], XmNtopOffset, 270); ac++;
-    XtSetValues(label_controls_smoothing, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 140); ac++;
-    XtSetArg(args[ac], XmNrightOffset, 7); ac++;
-    XtSetArg(args[ac], XmNtopOffset, 270); ac++;
-    XtSetValues(scale_controls_smoothing, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 10); ac++;
-    XtSetArg(args[ac], XmNrightOffset, 12); ac++;
-    XtSetArg(args[ac], XmNtopOffset, 310); ac++;
-    XtSetValues(separator12, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNtopAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNbottomAttachment, XmATTACH_NONE); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 10); ac++;
-    XtSetArg(args[ac], XmNtopOffset, 20); ac++;
-    XtSetValues(label_controls_sectionlength, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_WIDGET); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 20); ac++;
-    XtSetArg(args[ac], XmNrightOffset, 7); ac++;
-    XtSetArg(args[ac], XmNtopOffset, 0); ac++;
-    XtSetArg(args[ac], XmNleftWidget, label_controls_sectionlength); ac++;
-    XtSetValues(scale_controls_sectionlength, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNtopAttachment, XmATTACH_WIDGET); ac++;
-    XtSetArg(args[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNbottomAttachment, XmATTACH_NONE); ac++;
-    XtSetArg(args[ac], XmNbottomOffset, 0); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 140); ac++;
-    XtSetArg(args[ac], XmNrightOffset, 6); ac++;
-    XtSetArg(args[ac], XmNtopOffset, 4); ac++;
-    XtSetArg(args[ac], XmNtopWidget, scale_controls_colorinterval); ac++;
-    XtSetValues(scale_controls_tickinterval, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNtopAttachment, XmATTACH_WIDGET); ac++;
-    XtSetArg(args[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNbottomAttachment, XmATTACH_NONE); ac++;
-    XtSetArg(args[ac], XmNbottomOffset, 0); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 140); ac++;
-    XtSetArg(args[ac], XmNrightOffset, 6); ac++;
-    XtSetArg(args[ac], XmNtopOffset, 4); ac++;
-    XtSetArg(args[ac], XmNtopWidget, scale_controls_contourinterval); ac++;
-    XtSetValues(scale_controls_colorinterval, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNtopAttachment, XmATTACH_WIDGET); ac++;
-    XtSetArg(args[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNbottomAttachment, XmATTACH_NONE); ac++;
-    XtSetArg(args[ac], XmNbottomOffset, 0); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 140); ac++;
-    XtSetArg(args[ac], XmNrightOffset, 6); ac++;
-    XtSetArg(args[ac], XmNtopOffset, 4); ac++;
-    XtSetArg(args[ac], XmNtopWidget, scale_controls_decimation); ac++;
-    XtSetValues(scale_controls_contourinterval, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 10); ac++;
-    XtSetArg(args[ac], XmNtopOffset, 160); ac++;
-    XtSetValues(label_controls_contourinterval, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 10); ac++;
-    XtSetArg(args[ac], XmNtopOffset, 200); ac++;
-    XtSetValues(label_controls_colorinterval, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 10); ac++;
-    XtSetArg(args[ac], XmNtopOffset, 240); ac++;
-    XtSetValues(label_controls_tickinterval, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNtopAttachment, XmATTACH_NONE); ac++;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNbottomAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNbottomOffset, 19); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 200); ac++;
-    XtSetValues(pushButton_controls_apply, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNtopAttachment, XmATTACH_WIDGET); ac++;
-    XtSetArg(args[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_POSITION); ac++;
-    XtSetArg(args[ac], XmNbottomAttachment, XmATTACH_NONE); ac++;
-    XtSetArg(args[ac], XmNleftPosition, 2); ac++;
-    XtSetArg(args[ac], XmNrightOffset, 6); ac++;
-    XtSetArg(args[ac], XmNtopOffset, 5); ac++;
-    XtSetArg(args[ac], XmNtopWidget, scale_controls_sectionsoundings); ac++;
-    XtSetValues(separator4, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNtopAttachment, XmATTACH_WIDGET); ac++;
-    XtSetArg(args[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNbottomAttachment, XmATTACH_NONE); ac++;
-    XtSetArg(args[ac], XmNbottomOffset, 0); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 10); ac++;
-    XtSetArg(args[ac], XmNrightOffset, 7); ac++;
-    XtSetArg(args[ac], XmNtopOffset, 4); ac++;
-    XtSetArg(args[ac], XmNtopWidget, scale_controls_tickinterval); ac++;
-    XtSetValues(separator5, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNtopAttachment, XmATTACH_WIDGET); ac++;
-    XtSetArg(args[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNbottomAttachment, XmATTACH_NONE); ac++;
-    XtSetArg(args[ac], XmNbottomOffset, 0); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 140); ac++;
-    XtSetArg(args[ac], XmNrightOffset, 6); ac++;
-    XtSetArg(args[ac], XmNtopOffset, -4); ac++;
-    XtSetArg(args[ac], XmNtopWidget, separator4); ac++;
-    XtSetValues(scale_controls_decimation, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 10); ac++;
-    XtSetArg(args[ac], XmNtopOffset, 120); ac++;
-    XtSetValues(label_controls_decimation, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 10); ac++;
-    XtSetArg(args[ac], XmNtopOffset, 60); ac++;
-    XtSetValues(label_controls_sectionsoundings, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNtopAttachment, XmATTACH_WIDGET); ac++;
-    XtSetArg(args[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_WIDGET); ac++;
-    XtSetArg(args[ac], XmNbottomAttachment, XmATTACH_POSITION); ac++;
-    XtSetArg(args[ac], XmNbottomPosition, 19); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 0); ac++;
-    XtSetArg(args[ac], XmNrightOffset, 6); ac++;
-    XtSetArg(args[ac], XmNtopOffset, 4); ac++;
-    XtSetArg(args[ac], XmNleftWidget, label_controls_sectionsoundings); ac++;
-    XtSetArg(args[ac], XmNtopWidget, scale_controls_sectionlength); ac++;
-    XtSetValues(scale_controls_sectionsoundings, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNtopAttachment, XmATTACH_NONE); ac++;
-    XtSetArg(args[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_WIDGET); ac++;
-    XtSetArg(args[ac], XmNbottomAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNbottomOffset, 19); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 30); ac++;
-    XtSetArg(args[ac], XmNrightOffset, 227); ac++;
-    XtSetArg(args[ac], XmNleftWidget, pushButton_controls_apply); ac++;
-    XtSetValues(pushButton_controls_dismiss, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 0); ac++;
-    XtSetArg(args[ac], XmNrightOffset, 9); ac++;
-    XtSetValues(label_about_create1, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_POSITION); ac++;
-    XtSetArg(args[ac], XmNleftPosition, 2); ac++;
-    XtSetArg(args[ac], XmNrightOffset, 8); ac++;
-    XtSetArg(args[ac], XmNtopOffset, 210); ac++;
-    XtSetValues(separator1, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNtopAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNbottomAttachment, XmATTACH_NONE); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 170); ac++;
-    XtSetArg(args[ac], XmNrightOffset, 178); ac++;
-    XtSetArg(args[ac], XmNtopOffset, 410); ac++;
-    XtSetValues(pushButton_about_dismiss, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 0); ac++;
-    XtSetArg(args[ac], XmNrightOffset, 9); ac++;
-    XtSetValues(label_about_create, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 270); ac++;
-    XtSetArg(args[ac], XmNrightOffset, 118); ac++;
-    XtSetArg(args[ac], XmNtopOffset, 280); ac++;
-    XtSetValues(label_about_lamont, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 110); ac++;
-    XtSetArg(args[ac], XmNrightOffset, 268); ac++;
-    XtSetArg(args[ac], XmNtopOffset, 280); ac++;
-    XtSetValues(label_about_columbia, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 0); ac++;
-    XtSetArg(args[ac], XmNrightOffset, 9); ac++;
-    XtSetValues(label_about_mbsystem, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 0); ac++;
-    XtSetArg(args[ac], XmNrightOffset, 9); ac++;
-    XtSetValues(label_about_mbpub, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 0); ac++;
-    XtSetArg(args[ac], XmNrightOffset, 9); ac++;
-    XtSetValues(label_about_component, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 0); ac++;
-    XtSetArg(args[ac], XmNrightOffset, 9); ac++;
-    XtSetValues(label_about_for, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 10); ac++;
-    XtSetArg(args[ac], XmNrightOffset, 8); ac++;
-    XtSetArg(args[ac], XmNtopOffset, 60); ac++;
-    XtSetValues(separator, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 0); ac++;
-    XtSetArg(args[ac], XmNrightOffset, 9); ac++;
-    XtSetValues(label_about_version, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 0); ac++;
-    XtSetArg(args[ac], XmNrightOffset, 9); ac++;
-    XtSetArg(args[ac], XmNtopOffset, 30); ac++;
-    XtSetValues(label_about_function, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 0); ac++;
-    XtSetArg(args[ac], XmNrightOffset, 9); ac++;
-    XtSetArg(args[ac], XmNtopOffset, 0); ac++;
-    XtSetValues(label_about_mbedit, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNmenuHelpWidget, cascadeButton_about); ac++;
-    XtSetValues(menuBar_mbnavadjust, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNtopAttachment, XmATTACH_WIDGET); ac++;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNbottomAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNbottomOffset, -2); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 0); ac++;
-    XtSetArg(args[ac], XmNtopOffset, 10); ac++;
-    XtSetArg(args[ac], XmNtopWidget, label_status); ac++;
-    XtSetValues(scrolledWindow_messages, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNtopAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNrightAttachment, XmATTACH_NONE); ac++;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNbottomWidget, scrolledWindow_messages); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 0); ac++;
-    XtSetArg(args[ac], XmNtopOffset, 0); ac++;
-    XtSetValues(label_status, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNrightAttachment, XmATTACH_NONE); ac++;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 450); ac++;
-    XtSetValues(label_listdata, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNtopAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_WIDGET); ac++;
-    XtSetArg(args[ac], XmNbottomAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNbottomOffset, 8); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 10); ac++;
-    XtSetArg(args[ac], XmNrightOffset, 22); ac++;
-    XtSetArg(args[ac], XmNtopOffset, 30); ac++;
-    XtSetArg(args[ac], XmNleftWidget, scrolledWindow_messages); ac++;
-    XtSetArg(args[ac], XmNtopWidget, label_listdata); ac++;
-    XtSetValues(scrolledWindow_datalist, args, ac);
-
-
-
-    /* Begin user code block <end_CreatemainWindow> */
-    /* End user code block <end_CreatemainWindow> */
-    return( mainWindow );
-}
diff --git a/src/mbnavadjust/mbnavadjust_creation.h b/src/mbnavadjust/mbnavadjust_creation.h
deleted file mode 100644
index deed97d..0000000
--- a/src/mbnavadjust/mbnavadjust_creation.h
+++ /dev/null
@@ -1,145 +0,0 @@
-
-/* Begin user code block <abstract> */
-/* End user code block <abstract> */
-
-/**
- * WARNING: This file is overwritten at code generation time.
- * Any changes to this file will be lost.
- */
-/*
- *
- * Created by BuilderXcessory Version 6.1.3
- * Generated by Code Generator Xcessory 6.1.3 (08/19/04) CGX Scripts 6.1 Motif 2.1
- *
- */
-#ifndef mbnavadjust_creation_H
-#define mbnavadjust_creation_H
-#define MBNA_FILESELECTION_NONE 0
-#define MBNA_FILESELECTION_NEW 1
-#define MBNA_FILESELECTION_OPEN 2
-#define MBNA_FILESELECTION_IMPORT 3
-
-/*
- * Global widget declarations.
- *        - EXTERNAL is set to extern if the
- *          defs file is not included from the
- *          main file.
- */
-#ifdef DECLARE_BX_GLOBALS
-#define EXTERNAL
-#else
-#define EXTERNAL extern
-#endif
-
-/**
- * Start Global Widget Declarations.
- */
-EXTERNAL Widget   bulletinBoard_modelplot;
-EXTERNAL Widget   pushButton_modelplot_clearblock;
-EXTERNAL Widget   radioBox;
-EXTERNAL Widget   toggleButton_modelplot_timeseries;
-EXTERNAL Widget   toggleButton_modelplot_perturbation;
-EXTERNAL Widget   toggleButton_modelplot_tieoffsets;
-EXTERNAL Widget   label_modelplot_status;
-EXTERNAL Widget   drawingArea_modelplot;
-EXTERNAL Widget   scale_controls_zoffset;
-EXTERNAL Widget   scale_controls_smoothing;
-EXTERNAL Widget   scale_controls_sectionlength;
-EXTERNAL Widget   scale_controls_tickinterval;
-EXTERNAL Widget   scale_controls_colorinterval;
-EXTERNAL Widget   scale_controls_contourinterval;
-EXTERNAL Widget   scale_controls_decimation;
-EXTERNAL Widget   scale_controls_sectionsoundings;
-EXTERNAL Widget   label_about_version;
-EXTERNAL Widget   pushButton_biases_applyall;
-EXTERNAL Widget   scale_biases_heading2;
-EXTERNAL Widget   scale_biases_roll2;
-EXTERNAL Widget   scale_biases_roll1;
-EXTERNAL Widget   scale_biases_heading1;
-EXTERNAL Widget   label_biases_files;
-EXTERNAL Widget   toggleButton_biases_together;
-EXTERNAL Widget   toggleButton_biases_separate;
-EXTERNAL Widget   bulletinBoard_naverr;
-EXTERNAL Widget   pushButton_naverr_unset;
-EXTERNAL Widget   pushButton_naverr_minxymisfit;
-EXTERNAL Widget   drawingArea_naverr_zcorr;
-EXTERNAL Widget   pushButton_naverr_zerozoffset;
-EXTERNAL Widget   pushButton_naverr_settie;
-EXTERNAL Widget   toggleButton_misfitcenter_zero;
-EXTERNAL Widget   toggleButton_misfitcenter_auto;
-EXTERNAL Widget   pushButton_naverr_resettie;
-EXTERNAL Widget   pushButton_naverr_addtie;
-EXTERNAL Widget   pushButton_naverr_deletetie;
-EXTERNAL Widget   pushButton_naverr_fullsize;
-EXTERNAL Widget   pushButton_naverr_zerooffset;
-EXTERNAL Widget   label_naverr_offsets;
-EXTERNAL Widget   pushButton_naverr_nextunset;
-EXTERNAL Widget   label_naverr_status;
-EXTERNAL Widget   drawingArea_naverr_cont;
-EXTERNAL Widget   drawingArea_naverr_corr;
-EXTERNAL Widget   pushButton_naverr_dismiss;
-EXTERNAL Widget   pushButton_naverr_selecttie;
-EXTERNAL Widget   pushButton_naverr_minimum;
-EXTERNAL Widget   pushButton_naverr_next;
-EXTERNAL Widget   pushButton_naverr_previous;
-EXTERNAL Widget   pushButton_naverr_setnone;
-EXTERNAL Widget   xmDialogShell_fileselection;
-EXTERNAL Widget   bulletinBoard_fileselection;
-EXTERNAL Widget   textField_format;
-EXTERNAL Widget   label_format;
-EXTERNAL Widget   fileSelectionBox;
-EXTERNAL Widget   bulletinBoard_error;
-EXTERNAL Widget   label_error_two;
-EXTERNAL Widget   label_error_one;
-EXTERNAL Widget   label_error_three;
-EXTERNAL Widget   bulletinBoard_message;
-EXTERNAL Widget   label_message;
-EXTERNAL Widget   pushButton_new;
-EXTERNAL Widget   pushButton_open;
-EXTERNAL Widget   pushButton_close;
-EXTERNAL Widget   pushButton_importdata;
-EXTERNAL Widget   pushButton_quit;
-EXTERNAL Widget   pushButton_showsurveys;
-EXTERNAL Widget   pushButton_showdata;
-EXTERNAL Widget   pushButton_showsections;
-EXTERNAL Widget   pushButton_showcrossings;
-EXTERNAL Widget   pushButton_showmediocrecrossings;
-EXTERNAL Widget   pushButton_showgoodcrossings;
-EXTERNAL Widget   pushButton_showbettercrossings;
-EXTERNAL Widget   pushButton_showtruecrossings;
-EXTERNAL Widget   pushButton_showties;
-EXTERNAL Widget   toggleButton_showallsurveys;
-EXTERNAL Widget   toggleButton_showselectedsurvey;
-EXTERNAL Widget   toggleButton_showselectedfile;
-EXTERNAL Widget   toggleButton_showwithselectedsurvey;
-EXTERNAL Widget   toggleButton_showwithselectedfile;
-EXTERNAL Widget   toggleButton_showselectedsection;
-EXTERNAL Widget   pushButton_makegrid;
-EXTERNAL Widget   pushButton_showmodelplot;
-EXTERNAL Widget   pushButton_poornav;
-EXTERNAL Widget   pushButton_goodnav;
-EXTERNAL Widget   pushButton_fixednav;
-EXTERNAL Widget   pushButton_fixedxynav;
-EXTERNAL Widget   pushButton_fixedznav;
-EXTERNAL Widget   pushButton_tie_xy;
-EXTERNAL Widget   pushButton_tie_z;
-EXTERNAL Widget   pushButton_tie_xyz;
-EXTERNAL Widget   pushButton_autopick;
-EXTERNAL Widget   pushButton_autopickhorizontal;
-EXTERNAL Widget   pushButton_autosetsvsvertical;
-EXTERNAL Widget   pushButton_newcrossings;
-EXTERNAL Widget   pushButton_analyzecrossings;
-EXTERNAL Widget   pushButton_zerozoffsets;
-EXTERNAL Widget   pushButton_invertnav;
-EXTERNAL Widget   pushButton_applynav;
-EXTERNAL Widget   form_mbnavadjust;
-EXTERNAL Widget   scrolledWindow_messages;
-EXTERNAL Widget   text_messages;
-EXTERNAL Widget   label_status;
-EXTERNAL Widget   label_listdata;
-EXTERNAL Widget   scrolledWindow_datalist;
-EXTERNAL Widget   list_data;
-/**
- * End Global Widget Declarations.
- */
-#endif
diff --git a/src/mbnavadjust/mbnavadjust_extrawidgets.h b/src/mbnavadjust/mbnavadjust_extrawidgets.h
deleted file mode 100644
index b2c2918..0000000
--- a/src/mbnavadjust/mbnavadjust_extrawidgets.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbnavedit_extrawidgets.h	8/7/95
- *    $Id: mbnavadjust_extrawidgets.h 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 2000-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbnavadjust is an interactive navigation adjustment package
- * for swath sonar data.
- * It can work with any data format supported by the MBIO library.
- * This include file contains global widget parameters shared with
- * the Motif interface code.
- *
- * Author:	D. W. Caress
- * Date:	March 22, 2000
- *
- * $Log: mbnavadjust_extrawidgets.h,v $
- * Revision 5.1  2008/05/16 22:42:32  caress
- * Release 5.1.1beta18 - working towards use of 3D uncertainty.
- *
- * Revision 5.0  2000/12/01 22:55:48  caress
- * First cut at Version 5.0.
- *
- * Revision 4.0  2000/09/30  07:00:06  caress
- * Snapshot for Dale.
- *
- *
- *
- */
-
-/*--------------------------------------------------------------------*/
-
-#ifndef MB_YES
-#include "mb_status.h"
-#endif
-
-#ifdef MBNAVADJUST_DECLARE_GLOBALS
-#define MBNAVADJUST_EXTERNAL
-#else
-#define MBNAVADJUST_EXTERNAL extern
-#endif
-
-/* Global Widget Declarations Added By Hand */
-
-MBNAVADJUST_EXTERNAL Widget       fileSelectionBox_list;
-MBNAVADJUST_EXTERNAL Widget       fileSelectionBox_text;
-
-/*--------------------------------------------------------------------*/
diff --git a/src/mbnavadjust/mbnavadjust_io.c b/src/mbnavadjust/mbnavadjust_io.c
deleted file mode 100644
index ff30846..0000000
--- a/src/mbnavadjust/mbnavadjust_io.c
+++ /dev/null
@@ -1,2293 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbnavadjust_io.c	3/23/00
- *    $Id: mbnavadjust_io.c 2238 2015-04-15 06:00:52Z caress $
- *
- *    Copyright (c) 2014-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbnavadjust is an interactive navigation adjustment package
- * for swath sonar data.
- * It can work with any data format supported by the MBIO library.
- * This file contains the code that does not directly depend on the
- * MOTIF interface.
- *
- * Author:	D. W. Caress
- * Date:	April 14, 2014
- *
- * $Log: mbnavadjust_io.c,v $
- *
- */
-
-/*--------------------------------------------------------------------*/
-
-/* standard include files */
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <string.h>
-#include <time.h>
-#include <sys/stat.h>
-
-/* MBIO include files */
-#include "mb_status.h"
-#include "mb_define.h"
-
-/* define mbnavadjust io structures */
-#include "mbnavadjust_io.h"
-
-static char version_id[] = "$Id: mbnavadjust_io.c 2238 2015-04-15 06:00:52Z caress $";
-static char program_name[] = "mbnavadjust i/o functions";
-
-/*--------------------------------------------------------------------*/
-int mbnavadjust_new_project(int verbose, char *projectpath,
-                            double section_length,
-                            int	section_soundings,
-                            double cont_int,
-                            double col_int,
-                            double tick_int,
-                            double label_int,
-                            int	decimation,
-                            double smoothing,
-                            double zoffsetwidth,
-                            struct mbna_project *project, int *error)
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_new_project";
-	int	status = MB_SUCCESS;
-	char	*slashptr, *nameptr;
-	struct stat statbuf;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:            %d\n",verbose);
-		fprintf(stderr,"dbg2       projectpath:        %s\n",projectpath);
-		fprintf(stderr,"dbg2       section_length:     %f\n",section_length);
-		fprintf(stderr,"dbg2       section_soundings:  %d\n",section_soundings);
-		fprintf(stderr,"dbg2       cont_int:           %f\n",cont_int);
-		fprintf(stderr,"dbg2       col_int:            %f\n",col_int);
-		fprintf(stderr,"dbg2       tick_int:           %f\n",tick_int);
-		fprintf(stderr,"dbg2       label_int:          %f\n",label_int);
-		fprintf(stderr,"dbg2       decimation:         %d\n",decimation);
-		fprintf(stderr,"dbg2       smoothing:          %f\n",smoothing);
-		fprintf(stderr,"dbg2       zoffsetwidth:       %f\n",zoffsetwidth);
-		fprintf(stderr,"dbg2       project:            %p\n",project);
-		}
-                
-        /* if project structure holds an open project close it first */
-        if (project->open == MB_YES)
-                status = mbnavadjust_close_project(verbose, project, error);
-
-	/* check path to see if new project can be created */
-        nameptr = (char *) NULL;
-        slashptr = strrchr(projectpath,'/');
-        if (slashptr != (char *) NULL)
-                nameptr = slashptr + 1;
-        else
-                nameptr = projectpath;
-        if (strlen(nameptr) > 4
-                && strcmp(&nameptr[strlen(nameptr)-4],".nvh") == 0)
-                nameptr[strlen(nameptr)-4] = '\0';
-        if (strlen(nameptr) == 0)
-                {
-                fprintf(stderr,"Unable to create new project!\nInvalid project path: %s\n", projectpath);
-                *error = MB_ERROR_INIT_FAIL;
-                status = MB_FAILURE;
-                }
-        
-        /* try to create new project */
-        if (status == MB_SUCCESS)
-                {
-                strcpy(project->name,nameptr);
-		if (strlen(projectpath) == strlen(nameptr))
-			{
-			getcwd(project->path, MB_PATH_MAXLINE);
-			strcat(project->path, "/");
-			}
-                else
-			{
-			strncpy(project->path, projectpath, strlen(projectpath)-strlen(nameptr));
-			}
-                strcpy(project->home,project->path);
-                strcat(project->home,project->name);
-                strcat(project->home,".nvh");
-                strcpy(project->datadir,project->path);
-                strcat(project->datadir,project->name);
-                strcat(project->datadir,".dir");
-                strcpy(project->logfile,project->datadir);
-                strcat(project->logfile,"/log.txt");
-
-                /* no new project if file or directory already exist */
-                if (stat(project->home,&statbuf) == 0)
-                        {
-                        fprintf(stderr,"Unable to create new project!\nHome file %s already exists\n", project->home);
-                        *error = MB_ERROR_INIT_FAIL;
-                        status = MB_FAILURE;
-                        }
-                if (stat(project->datadir,&statbuf) == 0)
-                        {
-                        fprintf(stderr,"Unable to create new project!\nData directory %s already exists\n", project->datadir);
-                        *error = MB_ERROR_INIT_FAIL;
-                        status = MB_FAILURE;
-                        }
-
-                /* initialize new project */
-                if (status == MB_SUCCESS)
-                        {
-                        /* set values */
-                        project->open = MB_YES;
-                        project->num_files = 0;
-                        project->num_files_alloc = 0;
-                        project->files = NULL;
-                        project->num_snavs = 0;
-                        project->num_pings = 0;
-                        project->num_beams = 0;
-                        project->num_crossings = 0;
-                        project->num_crossings_alloc = 0;
-                        project->num_crossings_analyzed = 0;
-                        project->num_goodcrossings = 0;
-                        project->num_truecrossings = 0;
-                        project->num_truecrossings_analyzed = 0;
-                        project->crossings = NULL;
-                        project->num_ties = 0;
-                        project->section_length = section_length;
-                        project->section_soundings = section_soundings;
-                        project->cont_int = cont_int;
-                        project->col_int = col_int;
-                        project->tick_int = tick_int;
-                        project->label_int = label_int;
-                        project->decimation = decimation;
-                        project->precision = SIGMA_MINIMUM;
-                        project->smoothing = smoothing;
-                        project->zoffsetwidth = zoffsetwidth;
-                        project->inversion = MBNA_INVERSION_NONE;
-                        project->modelplot = MB_NO;
-                        project->modelplot_style = MBNA_MODELPLOT_TIMESERIES;
-                        project->logfp = NULL;
-                        
-                        project->inversion = MBNA_INVERSION_NONE;
-                        project->precision = SIGMA_MINIMUM;
-                        project->smoothing = MBNA_SMOOTHING_DEFAULT;
-                        project->zoffsetwidth = 5.0;
-
-                        /* create data directory */
-                        if (mkdir(project->datadir,00775) != 0)
-                                {
-                                fprintf(stderr,"Error creating data directory %s\n", project->datadir);
-                                *error = MB_ERROR_INIT_FAIL;
-                                status = MB_FAILURE;
-                                }
-
-                        /* write home file and other files */
-                        else if ((status = mbnavadjust_write_project(verbose, project, error)) == MB_FAILURE)
-                                {
-                                fprintf(stderr,"Failure to write project file %s\n", project->home);
-                                *error = MB_ERROR_INIT_FAIL;
-                                status = MB_FAILURE;
-                                }
-
-                        /* initialize log file */
-                        else if ((project->logfp = fopen(project->logfile, "w")) == NULL)
-                                {
-                                fprintf(stderr,"Failure to create log file %s\n", project->logfile);
-                                *error = MB_ERROR_INIT_FAIL;
-                                status = MB_FAILURE;
-                                }
-                        
-                        /* first message in log file */
-                        else
-                                {
-                                fprintf(project->logfp,"New project initialized: %s\n > Project home: %s\n",
-                                                        project->name, project->home);
-                               }
-                        }
-                }
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbnavadjust_read_project(int verbose, char *projectpath,
-                                struct mbna_project *project, int *error)
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_read_project";
-	int	status = MB_SUCCESS;
-	char	*slashptr, *nameptr;
-	struct stat statbuf;
-	FILE	*hfp;
-	struct mbna_file *file;
-	struct mbna_section *section, *section1, *section2;
-	struct mbna_crossing *crossing;
-	struct mbna_tie *tie;
-	char	label[STRING_MAX];
-	char	buffer[BUFFER_MAX];
-	char	obuffer[BUFFER_MAX];
-	char	command[MB_PATH_MAXLINE];
-	char	*result;
-	int	versionmajor, versionminor, version_id;
-	double	dummy;
-	int	nscan, idummy, jdummy;
-	int	s1id, s2id;
-	int	shellstatus;
-	int	i, j, k, l;
-	double	mtodeglon;
-	double	mtodeglat;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:            %d\n",verbose);
-		fprintf(stderr,"dbg2       projectname:        %s\n",projectpath);
-		fprintf(stderr,"dbg2       project:            %p\n",project);
-		}
-                
-        /* if project structure holds an open project close it first */
-        if (project->open == MB_YES)
-                status = mbnavadjust_close_project(verbose, project, error);
-
-	/* check path to see if project exists */
-        nameptr = (char *) NULL;
-        slashptr = strrchr(projectpath,'/');
-        if (slashptr != (char *) NULL)
-                nameptr = slashptr + 1;
-        else
-                nameptr = projectpath;
-        if (strlen(nameptr) > 4
-                && strcmp(&nameptr[strlen(nameptr)-4],".nvh") == 0)
-                nameptr[strlen(nameptr)-4] = '\0';
-        if (strlen(nameptr) == 0)
-                {
-                fprintf(stderr,"Unable to read project!\nInvalid project path: %s\n", projectpath);
-                *error = MB_ERROR_INIT_FAIL;
-                status = MB_FAILURE;
-                }
-        
-        /* try to read project */
-        if (status == MB_SUCCESS)
-                {
-                strcpy(project->name,nameptr);
-		if (strlen(projectpath) == strlen(nameptr))
-			{
-			getcwd(project->path, MB_PATH_MAXLINE);
-			strcat(project->path, "/");
-			}
-                else
-			{
-			strcpy(project->path, projectpath);
-			project->path[strlen(projectpath)-strlen(nameptr)] = '\0';
-			}
-                strcpy(project->home,project->path);
-                strcat(project->home,project->name);
-                strcat(project->home,".nvh");
-                strcpy(project->datadir,project->path);
-                strcat(project->datadir,project->name);
-                strcat(project->datadir,".dir");
-                strcpy(project->logfile,project->datadir);
-                strcat(project->logfile,"/log.txt");
-
-                /* check if project exists */
-                if (stat(project->home,&statbuf) != 0)
-                        {
-                        fprintf(stderr,"Project home file %s does not exist\n", project->home);
-                        *error = MB_ERROR_INIT_FAIL;
-                        status = MB_FAILURE;
-                        }
-                if (stat(project->datadir,&statbuf) != 0)
-                        {
-                        fprintf(stderr,"Data directory %s does not exist\n", project->datadir);
-                        *error = MB_ERROR_INIT_FAIL;
-                        status = MB_FAILURE;
-                        }
-
-                /* read the project */
-                if (status == MB_SUCCESS)
-                        {
-                        /* first save copy of the project file */
-                        sprintf(command,"cp %s %s.save", project->home, project->home);
-                        shellstatus = system(command);
-                
-                        /* open and read home file */
-                        status = MB_SUCCESS;
-                        if ((hfp = fopen(project->home,"r")) != NULL)
-                                {
-                                /* check for proper header */
-                                if ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
-                                        || strncmp(buffer,"##MBNAVADJUST PROJECT",21) != 0)
-                                        status = MB_FAILURE;
-                if (status == MB_FAILURE){fprintf(stderr,"Die at line:%d file:%s buffer:%s\n",__LINE__,__FILE__,buffer);exit(0);}
-                
-                                /* read basic names and stats */
-                                if (status == MB_SUCCESS
-                                        && ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
-                                                || (nscan = sscanf(buffer,"%s %s",label,obuffer)) != 2
-                                                || strcmp(label,"MB-SYSTEM_VERSION") != 0))
-                                        status = MB_FAILURE;
-                if (status == MB_FAILURE){fprintf(stderr,"Die at line:%d file:%s buffer:%s\n",__LINE__,__FILE__,buffer);exit(0);}
-                
-                                if (status == MB_SUCCESS
-                                        && ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
-                                                || (nscan = sscanf(buffer,"%s %s",label,obuffer)) != 2
-                                                || strcmp(label,"PROGRAM_VERSION") != 0))
-                                        status = MB_FAILURE;
-                if (status == MB_FAILURE){fprintf(stderr,"Die at line:%d file:%s buffer:%s\n",__LINE__,__FILE__,buffer);exit(0);}
-                
-                                if (status == MB_SUCCESS
-                                        && ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
-                                                || (nscan = sscanf(buffer,"%s %d.%d",label,&versionmajor,&versionminor)) != 3
-                                                || strcmp(label,"FILE_VERSION") != 0))
-                                        status = MB_FAILURE;
-                if (status == MB_FAILURE){fprintf(stderr,"Die at line:%d file:%s buffer:%s\n",__LINE__,__FILE__,buffer);exit(0);}
-				version_id = 100 * versionmajor + versionminor;
-                
-                                if (version_id >= 302)
-                                        {
-                                        if (status == MB_SUCCESS
-                                                && ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
-                                                        || (nscan = sscanf(buffer,"%s %s",label,obuffer)) != 2
-                                                        || strcmp(label,"ORIGIN") != 0))
-                                                status = MB_FAILURE;
-                                        }
-                if (status == MB_FAILURE){fprintf(stderr,"Die at line:%d file:%s buffer:%s\n",__LINE__,__FILE__,buffer);exit(0);}
-                
-                                if (status == MB_SUCCESS
-                                        && ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
-                                                || (nscan = sscanf(buffer,"%s %s",label,obuffer)) != 2
-                                                || strcmp(label,"NAME") != 0))
-                                        status = MB_FAILURE;
-                if (status == MB_FAILURE){fprintf(stderr,"Die at line:%d file:%s buffer:%s\n",__LINE__,__FILE__,buffer);exit(0);}
-                
-                                if (status == MB_SUCCESS
-                                        && ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
-                                                || (nscan = sscanf(buffer,"%s %s",label,obuffer)) != 2
-                                                || strcmp(label,"PATH") != 0))
-                                        status = MB_FAILURE;
-                if (status == MB_FAILURE){fprintf(stderr,"Die at line:%d file:%s buffer:%s\n",__LINE__,__FILE__,buffer);exit(0);}
-                
-                                if (status == MB_SUCCESS
-                                        && ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
-                                                || (nscan = sscanf(buffer,"%s %s",label,obuffer)) != 2
-                                                || strcmp(label,"HOME") != 0))
-                                        status = MB_FAILURE;
-                if (status == MB_FAILURE){fprintf(stderr,"Die at line:%d file:%s buffer:%s\n",__LINE__,__FILE__,buffer);exit(0);}
-                
-                                if (status == MB_SUCCESS
-                                        && ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
-                                                || (nscan = sscanf(buffer,"%s %s",label,obuffer)) != 2
-                                                || strcmp(label,"DATADIR") != 0))
-                                        status = MB_FAILURE;
-                if (status == MB_FAILURE){fprintf(stderr,"Die at line:%d file:%s buffer:%s\n",__LINE__,__FILE__,buffer);exit(0);}
-                
-                                if (status == MB_SUCCESS
-                                        && ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
-                                                || (nscan = sscanf(buffer,"%s %d",label,&project->num_files)) != 2
-                                                || strcmp(label,"NUMFILES") != 0))
-                                        status = MB_FAILURE;
-                if (status == MB_FAILURE){fprintf(stderr,"Die at line:%d file:%s buffer:%s\n",__LINE__,__FILE__,buffer);exit(0);}
-                
-				if (version_id >= 306)
-					{
-					if (status == MB_SUCCESS
-						&& ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
-							|| (nscan = sscanf(buffer,"%s %d",label,&project->num_blocks)) != 2
-							|| strcmp(label,"NUMBLOCKS") != 0))
-						status = MB_FAILURE;
-					}
-				else
-					{
-					project->num_blocks = 0;
-					}
-		if (status == MB_FAILURE){fprintf(stderr,"Die at line:%d file:%s buffer:%s\n",__LINE__,__FILE__,buffer);exit(0);}
-
-                                if (status == MB_SUCCESS
-                                        && ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
-                                                || (nscan = sscanf(buffer,"%s %d",label,&project->num_crossings)) != 2
-                                                || strcmp(label,"NUMCROSSINGS") != 0))
-                                        status = MB_FAILURE;
-                if (status == MB_FAILURE){fprintf(stderr,"Die at line:%d file:%s buffer:%s\n",__LINE__,__FILE__,buffer);exit(0);}
-                
-                                if (status == MB_SUCCESS
-                                        && ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
-                                                || (nscan = sscanf(buffer,"%s %lf",label,&project->section_length)) != 2
-                                                || strcmp(label,"SECTIONLENGTH") != 0))
-                                        status = MB_FAILURE;
-                if (status == MB_FAILURE){fprintf(stderr,"Die at line:%d file:%s buffer:%s\n",__LINE__,__FILE__,buffer);exit(0);}
-                
-                                if (status == MB_SUCCESS
-                                        && version_id >= 101
-                                        && ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
-                                                || (nscan = sscanf(buffer,"%s %d",label,&project->section_soundings)) != 2
-                                                || strcmp(label,"SECTIONSOUNDINGS") != 0))
-                                        status = MB_FAILURE;
-                if (status == MB_FAILURE){fprintf(stderr,"Die at line:%d file:%s buffer:%s\n",__LINE__,__FILE__,buffer);exit(0);}
-                
-                                if (status == MB_SUCCESS
-                                        && ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
-                                                || (nscan = sscanf(buffer,"%s %d",label,&project->decimation)) != 2
-                                                || strcmp(label,"DECIMATION") != 0))
-                                        status = MB_FAILURE;
-                if (status == MB_FAILURE){fprintf(stderr,"Die at line:%d file:%s buffer:%s\n",__LINE__,__FILE__,buffer);exit(0);}
-                
-                                if (status == MB_SUCCESS
-                                        && ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
-                                                || (nscan = sscanf(buffer,"%s %lf",label,&project->cont_int)) != 2
-                                                || strcmp(label,"CONTOURINTERVAL") != 0))
-                                        status = MB_FAILURE;
-                if (status == MB_FAILURE){fprintf(stderr,"Die at line:%d file:%s buffer:%s\n",__LINE__,__FILE__,buffer);exit(0);}
-                
-                                if (status == MB_SUCCESS
-                                        && ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
-                                                || (nscan = sscanf(buffer,"%s %lf",label,&project->col_int)) != 2
-                                                || strcmp(label,"COLORINTERVAL") != 0))
-                                        status = MB_FAILURE;
-                if (status == MB_FAILURE){fprintf(stderr,"Die at line:%d file:%s buffer:%s\n",__LINE__,__FILE__,buffer);exit(0);}
-                
-                                if (status == MB_SUCCESS
-                                        && ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
-                                                || (nscan = sscanf(buffer,"%s %lf",label,&project->tick_int)) != 2
-                                                || strcmp(label,"TICKINTERVAL") != 0))
-                                        status = MB_FAILURE;
-                if (status == MB_FAILURE){fprintf(stderr,"Die at line:%d file:%s buffer:%s\n",__LINE__,__FILE__,buffer);exit(0);}
-                
-                                if (status == MB_SUCCESS
-                                        && ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
-                                                || (nscan = sscanf(buffer,"%s %d",label,&project->inversion)) != 2
-                                                || strcmp(label,"INVERSION") != 0))
-                                        status = MB_FAILURE;
-                if (status == MB_FAILURE){fprintf(stderr,"Die at line:%d file:%s buffer:%s\n",__LINE__,__FILE__,buffer);exit(0);}
-                
-                                if (status == MB_SUCCESS)
-                                        {
-                                        if (version_id >= 301)
-                                                {
-                                                if ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
-                                                        || (nscan = sscanf(buffer,"%s %lf",label,&project->smoothing)) != 2
-                                                        || strcmp(label,"SMOOTHING") != 0)
-                                                        status = MB_FAILURE;
-                                                project->precision = SIGMA_MINIMUM;
-                                                }
-                                        else if (version_id >= 103)
-                                                {
-                                                if ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
-                                                        || (nscan = sscanf(buffer,"%s %lf",label,&project->precision)) != 2
-                                                        || strcmp(label,"PRECISION") != 0)
-                                                        status = MB_FAILURE;
-                                                project->smoothing = MBNA_SMOOTHING_DEFAULT;
-                                                }
-                                        else
-                                                {
-                                                project->precision = SIGMA_MINIMUM;
-                                                project->smoothing = MBNA_SMOOTHING_DEFAULT;
-                                                }
-                                        }
-                if (status == MB_FAILURE){fprintf(stderr,"Die at line:%d file:%s\n",__LINE__,__FILE__);exit(0);}
-                
-                                if (status == MB_SUCCESS)
-                                        {
-                                        if (version_id >= 105
-                                                && ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
-                                                        || (nscan = sscanf(buffer,"%s %lf",label,&project->zoffsetwidth)) != 2
-                                                        || strcmp(label,"ZOFFSETWIDTH") != 0))
-                                                status = MB_FAILURE;
-                                        else
-                                                project->zoffsetwidth = 5.0;
-                                        }
-                
-                                /* allocate memory for files array */
-                if (status == MB_FAILURE){fprintf(stderr,"Die at line:%d file:%s\n",__LINE__,__FILE__);exit(0);}
-                
-                                if (project->num_files > 0)
-                                        {
-                                        project->files = (struct mbna_file *)
-                                                malloc(sizeof(struct mbna_file) * (project->num_files));
-                                        if (project->files != NULL)
-                                                {
-                                                project->num_files_alloc = project->num_files;
-                                                memset(project->files,0,project->num_files_alloc * sizeof(struct mbna_file));
-                                                }
-                                        else
-                                                {
-                                                project->num_files_alloc = 0;
-                                                status = MB_FAILURE;
-                                                *error = MB_ERROR_MEMORY_FAIL;
-                                                }
-                                        }
-                if (status == MB_FAILURE){fprintf(stderr,"Die at line:%d file:%s\n",__LINE__,__FILE__);exit(0);}
-                
-                                if (project->num_crossings > 0)
-                                        {
-                                        project->crossings = (struct mbna_crossing *)
-                                                malloc(sizeof(struct mbna_crossing) * (project->num_crossings));
-                                        if (project->crossings != NULL)
-                                                {
-                                                project->num_crossings_alloc = project->num_crossings;
-                                                memset(project->crossings,0,sizeof(struct mbna_crossing) * project->num_crossings_alloc);
-                                                }
-                                        else
-                                                {
-                                                project->num_crossings_alloc = 0;
-                                                status = MB_FAILURE;
-                                                *error = MB_ERROR_MEMORY_FAIL;
-                                                }
-                                        }
-                if (status == MB_FAILURE){fprintf(stderr,"Die at line:%d file:%s\n",__LINE__,__FILE__);exit(0);}
-                
-                                for (i=0;i<project->num_files;i++)
-                                        {
-                                        file = &project->files[i];
-                                        file->num_sections_alloc = 0;
-                                        file->sections = NULL;
-                                        file->num_snavs = 0;
-                                        file->num_pings = 0;
-                                        file->num_beams = 0;
-					if (version_id >= 306)
-						{
-						if (status == MB_SUCCESS
-							&& ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
-								|| (nscan = sscanf(buffer,"FILE %d %d %d %d %d %lf %lf %lf %lf %lf %lf %lf %d %d %s",
-								&idummy,
-								&(file->status),
-								&(file->id),
-								&(file->format),
-								&(file->block),
-								&(file->block_offset_x),
-								&(file->block_offset_y),
-								&(file->block_offset_z),
-								&(file->heading_bias_import),
-								&(file->roll_bias_import),
-								&(file->heading_bias),
-								&(file->roll_bias),
-								&(file->num_sections),
-								&(file->output_id),
-								file->file)) != 15))
-							status = MB_FAILURE;
-						}
-					else
-						{
-						if (status == MB_SUCCESS
-							&& ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
-								|| (nscan = sscanf(buffer,"FILE %d %d %d %d %lf %lf %lf %lf %d %d %s",
-								&idummy,
-								&(file->status),
-								&(file->id),
-								&(file->format),
-								&(file->heading_bias_import),
-								&(file->roll_bias_import),
-								&(file->heading_bias),
-								&(file->roll_bias),
-								&(file->num_sections),
-								&(file->output_id),
-								file->file)) != 11))
-							status = MB_FAILURE;
-						file->block = 0;
-						file->block_offset_x = 0.0;
-						file->block_offset_y = 0.0;
-						file->block_offset_z = 0.0;
-						}
-                
-                                        /* set file->path as absolute path
-                                            - file->file may be a relative path */
-                                        if (status == MB_SUCCESS)
-                                                {
-                                                if (file->file[0] == '/')
-                                                    strcpy(file->path, file->file);
-                                                else
-                                                    {
-                                                    strcpy(file->path, project->path);
-                                                    strcat(file->path, file->file);
-                                                    }
-                                                }
-                
-                                        /* read section info */
-                                        if (file->num_sections > 0)
-                                                {
-                                                file->sections = (struct mbna_section *)
-                                                        malloc(sizeof(struct mbna_section) * (file->num_sections));
-                                                if (file->sections != NULL)
-                                                        {
-                                                        file->num_sections_alloc = file->num_sections;
-                                                        memset(file->sections,0,sizeof(struct mbna_section) * file->num_sections_alloc);
-                                                        }
-                                                else
-                                                        {
-                                                        file->num_sections_alloc = 0;
-                                                        status = MB_FAILURE;
-                                                        *error = MB_ERROR_MEMORY_FAIL;
-                                                        }
-                                                }
-                                        for (j=0;j<file->num_sections;j++)
-                                                {
-                                                section = &file->sections[j];
-                                                if (status == MB_SUCCESS)
-                                                        result = fgets(buffer,BUFFER_MAX,hfp);
-                                                if (status == MB_SUCCESS && result == buffer)
-                                                        nscan = sscanf(buffer,"SECTION %d %d %d %d %d %lf %lf %lf %lf %lf %lf %lf %lf %lf %d",
-                                                                &idummy,
-                                                                &section->num_pings,
-                                                                &section->num_beams,
-                                                                &section->num_snav,
-                                                                &section->continuity,
-                                                                &section->distance,
-                                                                &section->btime_d,
-                                                                &section->etime_d,
-                                                                &section->lonmin,
-                                                                &section->lonmax,
-                                                                &section->latmin,
-                                                                &section->latmax,
-                                                                &section->depthmin,
-                                                                &section->depthmax,
-                                                                &section->contoursuptodate);
-                                                if (result != buffer || nscan < 14)
-                                                        {
-                                                        status = MB_FAILURE;
-fprintf(stderr, "read failed on section: %s\n", buffer);
-                                                        }
-                                                if (nscan < 15)
-                                                        section->contoursuptodate = MB_NO;
-                                                for (k=MBNA_MASK_DIM-1;k>=0;k--)
-                                                    {
-                                                    if (status == MB_SUCCESS)
-                                                        result = fgets(buffer,BUFFER_MAX,hfp);
-                                                    for (l=0;l<MBNA_MASK_DIM;l++)
-                                                        {
-                                                        sscanf(&buffer[l], "%1d", &section->coverage[l+k*MBNA_MASK_DIM]);
-                                                        }
-                                                    }
-if (status == MB_FAILURE){fprintf(stderr,"Die at line:%d file:%s\n",__LINE__,__FILE__);exit(0);}
-/*fprintf(stderr,"%s/nvs_%4.4d_%4.4d.mb71\n",
-project->datadir,file->id,j);
-for (k=MBNA_MASK_DIM-1;k>=0;k--)
-{
-for (l=0;l<MBNA_MASK_DIM;l++)
-{
-fprintf(stderr, "%1d", section->coverage[l + k * MBNA_MASK_DIM]);
-}
-fprintf(stderr, "\n");
-}*/
-                                                for (k=0;k<section->num_snav;k++)
-                                                    {
-                                                    if (status == MB_SUCCESS)
-                                                        result = fgets(buffer,BUFFER_MAX,hfp);
-                                                    if (status == MB_SUCCESS && result == buffer)
-                                                        nscan = sscanf(buffer,"SNAV %d %d %lf %lf %lf %lf %lf %lf %lf",
-                                                                &idummy,
-                                                                &section->snav_id[k],
-                                                                &section->snav_distance[k],
-                                                                &section->snav_time_d[k],
-                                                                &section->snav_lon[k],
-                                                                &section->snav_lat[k],
-                                                                &section->snav_lon_offset[k],
-                                                                &section->snav_lat_offset[k],
-                                                                &section->snav_z_offset[k]);
-                                                    section->snav_num_ties[k] = 0;
-                                                    section->snav_lon_offset_int[k] = 0.0;
-                                                    section->snav_lat_offset_int[k] = 0.0;
-                                                    section->snav_z_offset_int[k] = 0.0;
-                                                    if (result == buffer && nscan == 6)
-                                                        {
-                                                        section->snav_lon_offset[k] = 0.0;
-                                                        section->snav_lat_offset[k] = 0.0;
-                                                        section->snav_z_offset[k] = 0.0;
-                                                        }
-                                                    else if (result == buffer && nscan == 8)
-                                                        {
-                                                        section->snav_z_offset[k] = 0.0;
-                                                        }
-                                                    else if (result != buffer || nscan != 9)
-                                                        {
-                                                        status = MB_FAILURE;
-fprintf(stderr, "read failed on snav: %s\n", buffer);
-                                                        }
-                
-                                                    /* reverse offset values if older values */
-                                                    if (version_id < 300)
-                                                        {
-                                                        section->snav_lon_offset[k] *= -1.0;
-                                                        section->snav_lat_offset[k] *= -1.0;
-                                                        section->snav_z_offset[k] *= -1.0;
-                                                        }
-                                                    }
-						
-						/* global fixed frame tie, whether defined or not */
-						if (version_id >= 305)
-							{
-							if (status == MB_SUCCESS)
-								result = fgets(buffer,BUFFER_MAX,hfp);
-							if (status == MB_SUCCESS && result == buffer)
-								nscan = sscanf(buffer,"GLOBALTIE %d %d %lf %lf %lf %lf %lf %lf",
-									&section->global_tie_status,
-									&section->global_tie_snav,
-									&section->global_tie_offset_x,
-									&section->global_tie_offset_y,
-									&section->global_tie_offset_z_m,
-									&section->global_tie_xsigma,
-									&section->global_tie_ysigma,
-									&section->global_tie_zsigma);
-							mb_coor_scale(verbose,0.5 * (section->latmin + section->latmax),
-									&mtodeglon,&mtodeglat);
-							section->global_tie_offset_x_m = section->global_tie_offset_x / mtodeglon;
-							section->global_tie_offset_y_m = section->global_tie_offset_y / mtodeglat;
-							}
-						else if (version_id == 304)
-							{
-							if (status == MB_SUCCESS)
-								result = fgets(buffer,BUFFER_MAX,hfp);
-							if (status == MB_SUCCESS && result == buffer)
-								nscan = sscanf(buffer,"GLOBALTIE %d %lf %lf %lf %lf %lf %lf",
-									&section->global_tie_snav,
-									&section->global_tie_offset_x,
-									&section->global_tie_offset_y,
-									&section->global_tie_offset_z_m,
-									&section->global_tie_xsigma,
-									&section->global_tie_ysigma,
-									&section->global_tie_zsigma);
-							if (section->global_tie_snav != MBNA_SELECT_NONE)
-								section->global_tie_status = MBNA_TIE_XYZ;
-							else
-								section->global_tie_status = MBNA_TIE_NONE;
-							mb_coor_scale(verbose,0.5 * (section->latmin + section->latmax),
-									&mtodeglon,&mtodeglat);
-							section->global_tie_offset_x_m = section->global_tie_offset_x / mtodeglon;
-							section->global_tie_offset_y_m = section->global_tie_offset_y / mtodeglat;
-							}
-						else
-							{
-							section->global_tie_status = MBNA_TIE_NONE;
-							section->global_tie_snav = MBNA_SELECT_NONE;
-							section->global_tie_offset_x = 0.0;
-							section->global_tie_offset_y = 0.0;
-							section->global_tie_offset_x_m = 0.0;
-							section->global_tie_offset_y_m = 0.0;
-							section->global_tie_offset_z_m = 0.0;
-							section->global_tie_xsigma = 0.0;
-							section->global_tie_ysigma = 0.0;
-							section->global_tie_zsigma = 0.0;
-							}
-						}
-					}
-                
-				/* count the number of blocks */
-				if (version_id < 306)
-					{
-					project->num_blocks = 0;
-					for (i=0;i<project->num_files;i++)
-						{
-						file = &project->files[i];
-						if (i==0 || file->sections[0].continuity == MB_NO)
-							{
-							project->num_blocks++;
-							}
-						file->block = project->num_blocks - 1;
-						file->block_offset_x = 0.0;
-						file->block_offset_y = 0.0;
-						file->block_offset_z = 0.0;
-						}
-					}
-		    
-                                /* read crossings */
-                                project->num_crossings_analyzed = 0;
-                                project->num_goodcrossings = 0;
-                                project->num_truecrossings = 0;
-                                project->num_truecrossings_analyzed = 0;
-                                project->num_ties = 0;
-                                for (i=0;i<project->num_crossings;i++)
-                                        {
-                                        /* read each crossing */
-                                        crossing = &project->crossings[i];
-                                        if (status == MB_SUCCESS
-                                                && version_id >= 106)
-                                                {
-                                                if (status == MB_SUCCESS
-                                                        && ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
-                                                                || (nscan = sscanf(buffer,"CROSSING %d %d %d %d %d %d %d %d %d",
-                                                                &idummy,
-                                                                &crossing->status,
-                                                                &crossing->truecrossing,
-                                                                &crossing->overlap,
-                                                                &crossing->file_id_1,
-                                                                &crossing->section_1,
-                                                                &crossing->file_id_2,
-                                                                &crossing->section_2,
-                                                                &crossing->num_ties)) != 9))
-                                                                {
-                                                                status = MB_FAILURE;
-fprintf(stderr, "read failed on crossing: %s\n", buffer);
-                                                                }
-                                                }
-                                        else if (status == MB_SUCCESS
-                                                && version_id >= 102)
-                                                {
-                                                crossing->overlap = 0;
-                                                if (status == MB_SUCCESS
-                                                        && ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
-                                                                || (nscan = sscanf(buffer,"CROSSING %d %d %d %d %d %d %d %d",
-                                                                &idummy,
-                                                                &crossing->status,
-                                                                &crossing->truecrossing,
-                                                                &crossing->file_id_1,
-                                                                &crossing->section_1,
-                                                                &crossing->file_id_2,
-                                                                &crossing->section_2,
-                                                                &crossing->num_ties)) != 8))
-                                                                {
-                                                                status = MB_FAILURE;
-fprintf(stderr, "read failed on crossing: %s\n", buffer);
-                                                                }
-                                                }
-                                        else if (status == MB_SUCCESS)
-                                                {
-                                                crossing->truecrossing = MB_NO;
-                                                crossing->overlap = 0;
-                                                if (status == MB_SUCCESS
-                                                        && ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
-                                                                || (nscan = sscanf(buffer,"CROSSING %d %d %d %d %d %d %d",
-                                                                &idummy,
-                                                                &crossing->status,
-                                                                &crossing->file_id_1,
-                                                                &crossing->section_1,
-                                                                &crossing->file_id_2,
-                                                                &crossing->section_2,
-                                                                &crossing->num_ties)) != 7))
-                                                                {
-                                                                status = MB_FAILURE;
-fprintf(stderr, "read failed on old format crossing: %s\n", buffer);
-                                                                }
-                                                }
-                                        if (status == MB_SUCCESS
-                                            && crossing->status != MBNA_CROSSING_STATUS_NONE)
-                                                project->num_crossings_analyzed++;
-                                        if (status == MB_SUCCESS
-                                            && crossing->truecrossing == MB_YES)
-                                                {
-                                                project->num_truecrossings++;
-                                                if (crossing->status != MBNA_CROSSING_STATUS_NONE)
-                                                project->num_truecrossings_analyzed++;
-                                                }
-                
-                                        /* reorder crossing to be early file first older file second if
-                                                file version prior to 3.00 */
-                                        if (version_id < 300)
-                                                {
-                                                idummy = crossing->file_id_1;
-                                                jdummy = crossing->section_1;
-                                                crossing->file_id_1 = crossing->file_id_2;
-                                                crossing->section_1 = crossing->section_2;
-                                                crossing->file_id_2 = idummy;
-                                                crossing->section_2 = jdummy;
-                                                }
-                
-                                        /* read ties */
-                                        if (status == MB_SUCCESS)
-                                        for (j=0;j<crossing->num_ties;j++)
-                                                {
-                                                /* read each tie */
-                                                tie = &crossing->ties[j];
-                                                if (status == MB_SUCCESS && version_id >= 302)
-                                                        {
-                                                        if ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
-                                                                || (nscan = sscanf(buffer,"TIE %d %d %d %lf %d %lf %lf %lf %lf %d %lf %lf %lf",
-                                                                        &idummy,
-                                                                        &tie->status,
-                                                                        &tie->snav_1,
-                                                                        &tie->snav_1_time_d,
-                                                                        &tie->snav_2,
-                                                                        &tie->snav_2_time_d,
-                                                                        &tie->offset_x,
-                                                                        &tie->offset_y,
-                                                                        &tie->offset_z_m,
-                                                                        &tie->inversion_status,
-                                                                        &tie->inversion_offset_x,
-                                                                        &tie->inversion_offset_y,
-                                                                        &tie->inversion_offset_z_m)) != 13)
-                                                                {
-                                                                status = MB_FAILURE;
-fprintf(stderr, "read failed on tie: %s\n", buffer);
-                                                                }
-                                                        }
-                                                else if (status == MB_SUCCESS && version_id >= 104)
-                                                        {
-                                                        if ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
-                                                                || (nscan = sscanf(buffer,"TIE %d %d %lf %d %lf %lf %lf %lf %d %lf %lf %lf",
-                                                                        &idummy,
-                                                                        &tie->snav_1,
-                                                                        &tie->snav_1_time_d,
-                                                                        &tie->snav_2,
-                                                                        &tie->snav_2_time_d,
-                                                                        &tie->offset_x,
-                                                                        &tie->offset_y,
-                                                                        &tie->offset_z_m,
-                                                                        &tie->inversion_status,
-                                                                        &tie->inversion_offset_x,
-                                                                        &tie->inversion_offset_y,
-                                                                        &tie->inversion_offset_z_m)) != 12)
-                                                                {
-                                                                status = MB_FAILURE;
-fprintf(stderr, "read failed on tie: %s\n", buffer);
-                                                                }
-                                                        tie->status = MBNA_TIE_XYZ;
-                                                        }
-                                                else if (status == MB_SUCCESS)
-                                                        {
-                                                        if ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
-                                                                || (nscan = sscanf(buffer,"TIE %d %d %lf %d %lf %lf %lf %d %lf %lf",
-                                                                        &idummy,
-                                                                        &tie->snav_1,
-                                                                        &tie->snav_1_time_d,
-                                                                        &tie->snav_2,
-                                                                        &tie->snav_2_time_d,
-                                                                        &tie->offset_x,
-                                                                        &tie->offset_y,
-                                                                        &tie->inversion_status,
-                                                                        &tie->inversion_offset_x,
-                                                                        &tie->inversion_offset_y)) != 10)
-                                                                {
-                                                                status = MB_FAILURE;
-fprintf(stderr, "read failed on tie: %s\n", buffer);
-                                                                }
-                                                        tie->status = MBNA_TIE_XYZ;
-                                                        tie->offset_z_m = 0.0;
-                                                        tie->inversion_offset_z_m = 0.0;
-                                                        }
-                
-                                                /* reorder crossing to be early file first older file second if
-                                                        file version prior to 3.00 */
-                                                if (version_id < 300)
-                                                        {
-                                                        idummy = tie->snav_1;
-                                                        dummy = tie->snav_1_time_d;
-                                                        tie->snav_1 = tie->snav_2;
-                                                        tie->snav_1_time_d = tie->snav_2_time_d;
-                                                        tie->snav_2 = idummy;
-                                                        tie->snav_2_time_d = dummy;
-/*					                tie->offset_x *= -1.0;
-                                                        tie->offset_y *= -1.0;
-                                                        tie->offset_z_m *= -1.0;
-                                                        tie->inversion_offset_x *= -1.0;
-                                                        tie->inversion_offset_y *= -1.0;
-                                                        tie->inversion_offset_z_m *= -1.0;*/
-                                                        }
-                
-                                                /* for version 2.0 or later read covariance */
-                                                if (status == MB_SUCCESS && version_id >= 200)
-                                                        {
-                                                        if ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
-                                                                || (nscan = sscanf(buffer,"COV %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf",
-                                                                        &tie->sigmar1,
-                                                                        &(tie->sigmax1[0]),
-                                                                        &(tie->sigmax1[1]),
-                                                                        &(tie->sigmax1[2]),
-                                                                        &tie->sigmar2,
-                                                                        &(tie->sigmax2[0]),
-                                                                        &(tie->sigmax2[1]),
-                                                                        &(tie->sigmax2[2]),
-                                                                        &tie->sigmar3,
-                                                                        &(tie->sigmax3[0]),
-                                                                        &(tie->sigmax3[1]),
-                                                                        &(tie->sigmax3[2]))) != 12)
-                                                                {
-                                                                status = MB_FAILURE;
-fprintf(stderr, "read failed on tie covariance: %s\n", buffer);
-                                                                }
-                                                        if (tie->sigmar1 <= 0.0)
-                                                                {
-                                                                tie->sigmax1[0] = 1.0;
-                                                                tie->sigmax1[1] = 0.0;
-                                                                tie->sigmax1[2] = 0.0;
-                                                                }
-                                                        if (tie->sigmar2 <= 0.0)
-                                                                {
-                                                                tie->sigmax2[0] = 0.0;
-                                                                tie->sigmax2[1] = 1.0;
-                                                                tie->sigmax2[2] = 0.0;
-                                                                }
-                                                        if (tie->sigmar3 <= 0.0)
-                                                                {
-                                                                tie->sigmax3[0] = 0.0;
-                                                                tie->sigmax3[1] = 0.0;
-                                                                tie->sigmax3[2] = 1.0;
-                                                                }
-                                                        }
-                                                else if (status == MB_SUCCESS)
-                                                        {
-                                                        tie->sigmar1 = 100.0;
-                                                        tie->sigmax1[0] = 1.0;
-                                                        tie->sigmax1[1] = 0.0;
-                                                        tie->sigmax1[2] = 0.0;
-                                                        tie->sigmar2 = 100.0;
-                                                        tie->sigmax2[0] = 0.0;
-                                                        tie->sigmax2[1] = 1.0;
-                                                        tie->sigmax2[2] = 0.0;
-                                                        tie->sigmar3 = 100.0;
-                                                        tie->sigmax3[0] = 0.0;
-                                                        tie->sigmax3[1] = 0.0;
-                                                        tie->sigmax3[2] = 1.0;
-                                                        }
-                
-                                                /* update number of ties */
-                                                if (status == MB_SUCCESS)
-                                                    {
-                                                    project->num_ties++;
-                                                    }
-                
-                                                /* check for reasonable snav id's */
-                                                if (status == MB_SUCCESS)
-                                                    {
-                                                    file = &project->files[crossing->file_id_1];
-                                                    section = &file->sections[crossing->section_1];
-                                                    if (tie->snav_1 >= section->num_snav)
-                                                        {
-                                                        tie->snav_1 = ((double)tie->snav_1
-                                                                                / (double)section->num_pings)
-                                                                                * (MBNA_SNAV_NUM - 1);
-                                                        tie->snav_1_time_d = section->snav_time_d[tie->snav_1];
-fprintf(stderr,"Reset tie snav_1 on read:%d\n",tie->snav_1);
-                                                        }
-                                                    file = &project->files[crossing->file_id_2];
-                                                    section = &file->sections[crossing->section_2];
-                                                    if (tie->snav_2 >= section->num_snav)
-                                                        {
-                                                        tie->snav_2 = ((double)tie->snav_2
-                                                                                / (double)section->num_pings)
-                                                                                * (MBNA_SNAV_NUM - 1);
-                                                        tie->snav_2_time_d = section->snav_time_d[tie->snav_2];
-fprintf(stderr,"Reset tie snav_2 on read:%d\n",tie->snav_2);
-                                                        }
-                                                    }
-                
-                                                /* update number of ties for snavs */
-                                                if (status == MB_SUCCESS)
-                                                    {
-                                                    file = &project->files[crossing->file_id_1];
-                                                    section = &file->sections[crossing->section_1];
-                                                    section->snav_num_ties[tie->snav_1]++;
-                                                    file = &project->files[crossing->file_id_2];
-                                                    section = &file->sections[crossing->section_2];
-                                                    section->snav_num_ties[tie->snav_2]++;
-                                                    }
-                
-                                                /* calculate offsets in local meters */
-                                                if (status == MB_SUCCESS)
-                                                    {
-                                                    section1 = &(project->files[crossing->file_id_1].sections[crossing->section_1]);
-                                                    section2 = &(project->files[crossing->file_id_2].sections[crossing->section_2]);
-                                                    mb_coor_scale(verbose,0.5 * (MIN(section1->latmin,section2->latmin)
-										 + MAX(section1->latmax,section2->latmax)),
-                                                                    &mtodeglon,&mtodeglat);
-                                                    tie->offset_x_m = tie->offset_x / mtodeglon;
-                                                    tie->offset_y_m = tie->offset_y / mtodeglat;
-                                                    tie->inversion_offset_x_m = tie->inversion_offset_x / mtodeglon;
-                                                    tie->inversion_offset_y_m = tie->inversion_offset_y / mtodeglat;
-                                                    }
-                                                }
-                
-                                        /* finally make sure crossing has later section second, switch if needed */
-                                        s1id = crossing->file_id_1 * 1000 + crossing->section_1;
-                                        s2id = crossing->file_id_2 * 1000 + crossing->section_2;
-                                        if (s2id < s1id)
-                                                {
-                                                idummy = crossing->file_id_1;
-                                                jdummy = crossing->section_1;
-                                                crossing->file_id_1 = crossing->file_id_2;
-                                                crossing->section_1 = crossing->section_2;
-                                                crossing->file_id_2 = idummy;
-                                                crossing->section_2 = jdummy;
-                                                for (j=0;j<crossing->num_ties;j++)
-                                                        {
-                                                        tie = &crossing->ties[j];
-                                                        idummy = tie->snav_1;
-                                                        dummy = tie->snav_1_time_d;
-                                                        tie->snav_1 = tie->snav_2;
-                                                        tie->snav_1_time_d = tie->snav_2_time_d;
-                                                        tie->snav_2 = idummy;
-                                                        tie->snav_2_time_d = dummy;
-                                                        tie->offset_x *= -1.0;
-                                                        tie->offset_y *= -1.0;
-                                                        tie->offset_x_m *= -1.0;
-                                                        tie->offset_y_m *= -1.0;
-                                                        tie->offset_z_m *= -1.0;
-                                                        tie->inversion_offset_x *= -1.0;
-                                                        tie->inversion_offset_y *= -1.0;
-                                                        tie->inversion_offset_x_m *= -1.0;
-                                                        tie->inversion_offset_y_m *= -1.0;
-                                                        tie->inversion_offset_z_m *= -1.0;
-                                                        }
-                                                }
-                                        }
-                
-                                /* close home file */
-                                fclose(hfp);
-                
-                                /* set project status flag */
-                                if (status == MB_SUCCESS)
-                                        project->open = MB_YES;
-                                else
-                                        {
-                                        for (i=0;i<project->num_files;i++)
-                                                {
-                                                file = &project->files[i];
-                                                if (file->sections != NULL)
-                                                         free( file->sections);
-                                                }
-                                        if (project->files != NULL)
-                                                free(project->files);
-                                        if (project->crossings != NULL)
-                                                free(project->crossings);
-                                        project->open = MB_NO;
-                                        memset(project->name,0,STRING_MAX);
-                                        strcpy(project->name,"None");
-                                        memset(project->path,0,STRING_MAX);
-                                        memset(project->datadir,0,STRING_MAX);
-                                        project->num_files = 0;
-                                        project->num_files_alloc = 0;
-                                        project->num_snavs = 0;
-                                        project->num_pings = 0;
-                                        project->num_beams = 0;
-                                        project->num_crossings = 0;
-                                        project->num_crossings_alloc = 0;
-                                        project->num_crossings_analyzed = 0;
-                                        project->num_goodcrossings = 0;
-                                        project->num_truecrossings = 0;
-                                        project->num_truecrossings_analyzed = 0;
-                                        project->num_ties = 0;
-                                        }
-                                }
-                
-                        /* else set error */
-                        else
-                                {
-                                status = MB_FAILURE;
-                                }
-                        }
-
-                /* open log file */
-                if ((project->logfp = fopen(project->logfile, "a")) != NULL)
-                        {
-                        fprintf(project->logfp,"Project opened: %s\n > Project home: %s\n > Number of Files: %d\n > Number of Crossings Found: %d\n > Number of Crossings Analyzed: %d\n > Number of Navigation Ties: %d\n",
-                                                project->name, project->home, project->num_files, project->num_crossings,
-                                                project->num_crossings_analyzed, project->num_ties);
-                        }
-                else
-                        {
-                        fprintf(stderr,"Failure to open log file %s\n", project->logfile);
-                        *error = MB_ERROR_INIT_FAIL;
-                        status = MB_FAILURE;
-                        }
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbnavadjust_close_project(int verbose, struct mbna_project *project,
-                                int *error)
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_close_project";
-	int	status = MB_SUCCESS;
-	struct mbna_file *file;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2       verbose:            %d\n",verbose);
-		fprintf(stderr,"dbg2       project:            %p\n",project);
-		}
-
-        /* add info text */
-	fprintf(project->logfp,"Project closed: %s\n", project->name);
-	fprintf(project->logfp,"Log file %s/log.txt closed\n", project->datadir);
-
-	/* deallocate memory and reset values */
-	for (i=0;i<project->num_files;i++)
-		{
-		file = &project->files[i];
-		if (file->sections != NULL)
-			mb_freed(verbose,__FILE__,__LINE__,(void **)&file->sections,error);
-		}
-	if (project->files != NULL)
-		{
-		free(project->files);
-		project->files = NULL;
-		project->num_files_alloc = 0;
-		}
-	if (project->crossings != NULL)
-		{
-		free(project->crossings);
-		project->crossings = NULL;
-		project->num_crossings_alloc = 0;
-		}
-	if (project->logfp != NULL)
-		{
-		fclose(project->logfp);
-		project->logfp = NULL;
-		}
-
-	/* reset values */
-	project->open = MB_NO;
-	memset(project->name,0,STRING_MAX);
-	strcpy(project->name,"None");
- 	memset(project->path,0,STRING_MAX);
-	memset(project->datadir,0,STRING_MAX);
-	memset(project->logfile,0,STRING_MAX);
-	project->num_files = 0;
-	project->num_snavs = 0;
-	project->num_pings = 0;
-	project->num_beams = 0;
-	project->num_crossings = 0;
- 	project->num_crossings_analyzed = 0;
-	project->num_goodcrossings = 0;
-	project->num_truecrossings = 0;
- 	project->num_truecrossings_analyzed = 0;
-	project->num_ties = 0;
- 	project->inversion = MBNA_INVERSION_NONE;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbnavadjust_write_project(int verbose, struct mbna_project *project,
-                                int *error)
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_write_project";
-	int	status = MB_SUCCESS;
-	FILE	*hfp, *xfp, *yfp;
-	struct mbna_file *file, *file_1, *file_2;
-	struct mbna_section *section, *section_1, *section_2;
-	struct mbna_crossing *crossing;
-	struct mbna_tie *tie;
-	char	datalist[STRING_MAX];
-	char	routefile[STRING_MAX];
-	char	routename[STRING_MAX];
-	char	xoffsetfile[STRING_MAX];
-	char	yoffsetfile[STRING_MAX];
-	double	navlon1, navlon2, navlat1, navlat2;
-	int	nroute;
-	int	snav_1, snav_2;
-	int	ncrossings_true = 0;
-	int	ncrossings_gt50 = 0;
-	int	ncrossings_gt25 = 0;
-	int	ncrossings_lt25 = 0;
-	int	ncrossings_fixed = 0;
-	int	nties_unfixed = 0;
-	int	nties_fixed = 0;
-	char	status_char, truecrossing_char;
-	int	routecolor = 1;
-	char	*unknown = "Unknown";
-	double	mtodeglon, mtodeglat;
-
-	/* time, user, host variables */
-	time_t	right_now;
-	char	date[32], user[MB_PATH_MAXLINE], *user_ptr, host[MB_PATH_MAXLINE];
-
-	int	i, j, k, l;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2       verbose:            %d\n",verbose);
-		fprintf(stderr,"dbg2       project:            %p\n",project);
-		}
-
-	/* open and write home file */
-	if ((hfp = fopen(project->home,"w")) != NULL)
-		{
-fprintf(stderr,"Writing project %s\n", project->name);
-		right_now = time((time_t *)0);
-		strcpy(date,ctime(&right_now));
-                date[strlen(date)-1] = '\0';
-		if ((user_ptr = getenv("USER")) == NULL)
-			user_ptr = getenv("LOGNAME");
-		if (user_ptr != NULL)
-			strcpy(user,user_ptr);
-		else
-			strcpy(user, "unknown");
-		gethostname(host,MB_PATH_MAXLINE);
-		fprintf(hfp,"##MBNAVADJUST PROJECT\n");
-		fprintf(hfp,"MB-SYSTEM_VERSION\t%s\n",MB_VERSION);
-		fprintf(hfp,"PROGRAM_VERSION\t%s\n",version_id);
-		fprintf(hfp,"FILE_VERSION\t3.06\n");
-		fprintf(hfp,"ORIGIN\tGenerated by user <%s> on cpu <%s> at <%s>\n", user,host,date);
-		fprintf(hfp,"NAME\t%s\n",project->name);
-		fprintf(hfp,"PATH\t%s\n",project->path);
-		fprintf(hfp,"HOME\t%s\n",project->home);
-		fprintf(hfp,"DATADIR\t%s\n",project->datadir);
-		fprintf(hfp,"NUMFILES\t%d\n",project->num_files);
-		fprintf(hfp,"NUMBLOCKS\t%d\n",project->num_blocks);
-		fprintf(hfp,"NUMCROSSINGS\t%d\n",project->num_crossings);
-		fprintf(hfp,"SECTIONLENGTH\t%f\n",project->section_length);
-		fprintf(hfp,"SECTIONSOUNDINGS\t%d\n",project->section_soundings);
-		fprintf(hfp,"DECIMATION\t%d\n",project->decimation);
-		fprintf(hfp,"CONTOURINTERVAL\t%f\n",project->cont_int);
-		fprintf(hfp,"COLORINTERVAL\t%f\n",project->col_int);
-		fprintf(hfp,"TICKINTERVAL\t%f\n",project->tick_int);
-		fprintf(hfp,"INVERSION\t%d\n",project->inversion);
-		fprintf(hfp,"SMOOTHING\t%f\n",project->smoothing);
-		fprintf(hfp,"ZOFFSETWIDTH\t%f\n",project->zoffsetwidth);
-		for (i=0;i<project->num_files;i++)
-			{
-			/* write out basic file info */
-			file = &project->files[i];
-			fprintf(hfp,"FILE %4d %4d %4d %4d %4d %13.8f %13.8f %13.8f %4.1f %4.1f %4.1f %4.1f %4d %4d %s\n",
-				i,
-				file->status,
-				file->id,
-				file->format,
-				file->block,
-				file->block_offset_x,
-				file->block_offset_y,
-				file->block_offset_z,
-				file->heading_bias_import,
-				file->roll_bias_import,
-				file->heading_bias,
-				file->roll_bias,
-				file->num_sections,
-				file->output_id,
-				file->file);
-
-			/* write out section info */
-			for (j=0;j<file->num_sections;j++)
-				{
-				section = &file->sections[j];
-				fprintf(hfp,"SECTION %4d %5d %5d %d %d %10.6f %16.6f %16.6f %13.8f %13.8f %13.8f %13.8f %9.3f %9.3f %d\n",
-					j,
-					section->num_pings,
-					section->num_beams,
-					section->num_snav,
-					section->continuity,
-					section->distance,
-					section->btime_d,
-					section->etime_d,
-					section->lonmin,
-					section->lonmax,
-					section->latmin,
-					section->latmax,
-					section->depthmin,
-					section->depthmax,
-					section->contoursuptodate);
-				for (k=MBNA_MASK_DIM-1;k>=0;k--)
-				    {
-				    for (l=0;l<MBNA_MASK_DIM;l++)
-					{
-					fprintf(hfp, "%1d", section->coverage[l+k*MBNA_MASK_DIM]);
-					}
-				    fprintf(hfp, "\n");
-				    }
-				for (k=0;k<section->num_snav;k++)
-				    {
-				    fprintf(hfp,"SNAV %4d %5d %10.6f %16.6f %13.8f %13.8f %13.8f %13.8f %13.8f\n",
-					    k,
-					    section->snav_id[k],
-					    section->snav_distance[k],
-					    section->snav_time_d[k],
-					    section->snav_lon[k],
-					    section->snav_lat[k],
-					    section->snav_lon_offset[k],
-					    section->snav_lat_offset[k],
-					    section->snav_z_offset[k]);
-				    }
-				fprintf(hfp,"GLOBALTIE %2d %4d %13.8f %13.8f %13.8f %13.8f %13.8f %13.8f\n",
-						section->global_tie_status,
-						section->global_tie_snav,
-						section->global_tie_offset_x,
-						section->global_tie_offset_y,
-						section->global_tie_offset_z_m,
-						section->global_tie_xsigma,
-						section->global_tie_ysigma,
-						section->global_tie_zsigma);
-				}
-			}
-
-		/* write out crossing info */
-		for (i=0;i<project->num_crossings;i++)
-			{
-			/* write out basic crossing info */
-			crossing = &project->crossings[i];
-			fprintf(hfp,"CROSSING %5d %d %d %3d %5d %3d %5d %3d %2d\n",
-				i,
-				crossing->status,
-				crossing->truecrossing,
-				crossing->overlap,
-				crossing->file_id_1,
-				crossing->section_1,
-				crossing->file_id_2,
-				crossing->section_2,
-				crossing->num_ties);
-
-			/* write out tie info */
-			for (j=0;j<crossing->num_ties;j++)
-				{
-				/* write out basic tie info */
-				tie = &crossing->ties[j];
-				fprintf(hfp,"TIE %5d %1d %5d %16.6f %5d %16.6f %13.8f %13.8f %13.8f %1.1d %13.8f %13.8f %13.8f\n",
-					j,
-					tie->status,
-					tie->snav_1,
-					tie->snav_1_time_d,
-					tie->snav_2,
-					tie->snav_2_time_d,
-					tie->offset_x,
-					tie->offset_y,
-					tie->offset_z_m,
-					tie->inversion_status,
-					tie->inversion_offset_x,
-					tie->inversion_offset_y,
-					tie->inversion_offset_z_m);
-				fprintf(hfp,"COV %13.8f %13.8f %13.8f %13.8f %13.8f %13.8f %13.8f %13.8f %13.8f %13.8f %13.8f %13.8f\n",
-					tie->sigmar1,
-					tie->sigmax1[0],
-					tie->sigmax1[1],
-					tie->sigmax1[2],
-					tie->sigmar2,
-					tie->sigmax2[0],
-					tie->sigmax2[1],
-					tie->sigmax2[2],
-					tie->sigmar3,
-					tie->sigmax3[0],
-					tie->sigmax3[1],
-					tie->sigmax3[2]);
-				}
-			}
-
-		/* close home file */
-		fclose(hfp);
-		status = MB_SUCCESS;
-		}
-
-	/* else set error */
-	else
-		{
-		status = MB_FAILURE;
-                *error = MB_ERROR_WRITE_FAIL;
-		fprintf(stderr,"Unable to update project %s\n > Home file: %s\n",
-			project->name, project->home);
-		}
-
-	/* open and write datalist file */
-	sprintf(datalist,"%s%s.mb-1",project->path,project->name);
-	if ((hfp = fopen(datalist,"w")) != NULL)
-		{
-		for (i=0;i<project->num_files;i++)
-			{
-			/* write file entry */
-			file = &project->files[i];
-			fprintf(hfp,"%s %d\n", file->file, file->format);
-			}
-		fclose(hfp);
-		}
-
-	/* else set error */
-	else
-		{
-		status = MB_FAILURE;
-                *error = MB_ERROR_OPEN_FAIL;
-		fprintf(stderr,"Unable to update project %s\n > Datalist file: %s\n",
-			project->name, datalist);
-		}
-
-	/* write mbgrdviz route files in which each tie point or crossing is a two point route
-		consisting of the connected snav points
-		- output several different route files
-		- route files of ties (fixed and unfixed separate) represent each tie as a
-			two point route consisting of the connected snav points
-		- route files of crossings (<25%, >= 25% && < 50%, >= 50%, true crossings)
-			represent each crossing as a two point route consisting of the central
-			snav points for each of the two sections.
-		- first count different types of crossings and ties to output as routes
-		- then output each time of route file */
-	ncrossings_true = 0;
-	ncrossings_gt50 = 0;
-	ncrossings_gt25 = 0;
-	ncrossings_lt25 = 0;
-	ncrossings_fixed = 0;
-	nties_unfixed = 0;
-	nties_fixed = 0;
-	for (i=0;i<project->num_crossings;i++)
-		{
-		crossing = &project->crossings[i];
-		
-		/* check all crossings */
-		if (project->files[crossing->file_id_1].status == MBNA_FILE_FIXEDNAV
-			    || project->files[crossing->file_id_2].status == MBNA_FILE_FIXEDNAV)
-			ncrossings_fixed++;
-		else
-			{
-			if (crossing->truecrossing == MB_YES)
-				ncrossings_true++;
-			else if (crossing->overlap >= 50)
-				ncrossings_gt50++;
-			else if (crossing->overlap >= 25)
-				ncrossings_gt25++;
-			else
-				ncrossings_lt25++;
-			}
-    
-		/* check ties */
-		if (crossing->status == MBNA_CROSSING_STATUS_SET)
-			{
-			if (project->files[crossing->file_id_1].status == MBNA_FILE_FIXEDNAV
-				|| project->files[crossing->file_id_2].status == MBNA_FILE_FIXEDNAV)
-				nties_fixed += crossing->num_ties;
-			else
-				nties_unfixed += crossing->num_ties;
-			}
-		}		
-
-	/* write mbgrdviz route file for all unfixed true crossings */
-	sprintf(routefile,"%s%s_truecrossing.rte",project->path,project->name);
-	if ((hfp = fopen(routefile,"w")) == NULL)
-		{
-		fclose(hfp);
-		status = MB_FAILURE;
-		*error = MB_ERROR_OPEN_FAIL;
-		fprintf(stderr, " > Unable to open output tie route file %s\n", routefile);
-		}
-	else
-		{
-		/* write the route file header */
-		fprintf(hfp, "## Route File Version %s\n", ROUTE_VERSION);
-		fprintf(hfp, "## Output by Program %s\n",program_name);
-		fprintf(hfp, "## Program Version %s\n",version_id);
-		fprintf(hfp, "## MB-System Version %s\n",MB_VERSION);
-		strncpy(date,"\0",25);
-		right_now = time((time_t *)0);
-		strcpy(date,ctime(&right_now));
-                date[strlen(date)-1] = '\0';
-		if ((user_ptr = getenv("USER")) == NULL)
-			if ((user_ptr = getenv("LOGNAME")) == NULL)
-				user_ptr = unknown;
-		gethostname(host,MB_PATH_MAXLINE);
-		fprintf(hfp, "## Run by user <%s> on cpu <%s> at <%s>\n",
-			user_ptr,host,date);
-		fprintf(hfp, "## Number of routes: %d\n",ncrossings_true);
-		fprintf(hfp, "## Route point format:\n");
-		fprintf(hfp, "##   <longitude (deg)> <latitude (deg)> <topography (m)> <waypoint (boolean)>\n");
-
-		/* loop over all crossings */
-		nroute = 0;
-		for (i=0;i<project->num_crossings;i++)
-			{
-			crossing = &project->crossings[i];
-    
-			/* output only unfixed true crossings */
-			if (crossing->truecrossing == MB_YES
-			    && !(project->files[crossing->file_id_1].status == MBNA_FILE_FIXEDNAV
-				    || project->files[crossing->file_id_2].status == MBNA_FILE_FIXEDNAV))
-				{
-				file_1 = (struct mbna_file *) &project->files[crossing->file_id_1];
-				file_2 = (struct mbna_file *) &project->files[crossing->file_id_2];
-				section_1 = (struct mbna_section *) &file_1->sections[crossing->section_1];
-				section_2 = (struct mbna_section *) &file_2->sections[crossing->section_2];
-				snav_1 = section_1->num_snav/2;
-				snav_2 = section_2->num_snav/2;
-				navlon1 = section_1->snav_lon[snav_1] + section_1->snav_lon_offset[snav_1];
-				navlat1 = section_1->snav_lat[snav_1] + section_1->snav_lat_offset[snav_1];
-				navlon2 = section_2->snav_lon[snav_2] + section_2->snav_lon_offset[snav_2];
-				navlat2 = section_2->snav_lat[snav_2] + section_2->snav_lat_offset[snav_2];
-				if (crossing->status == MBNA_CROSSING_STATUS_NONE)
-					{
-					status_char = 'U';
-					routecolor = ROUTE_COLOR_YELLOW;
-					}
-				else if (crossing->status == MBNA_CROSSING_STATUS_SET)
-					{
-					status_char = '*';
-					routecolor = ROUTE_COLOR_GREEN;
-					}
-				else
-					{
-					status_char = '-';
-					routecolor = ROUTE_COLOR_RED;
-					}
-				if (crossing->truecrossing == MB_NO)
-					truecrossing_char = ' ';
-				else
-					truecrossing_char = 'X';
-				sprintf(routename,"%c%c %4d %2.2d:%3.3d:%3.3d %2.2d:%3.3d:%3.3d %3d %2d",
-					status_char, truecrossing_char, i,
-					file_1->block,
-					crossing->file_id_1,
-					crossing->section_1,
-					file_2->block,
-					crossing->file_id_2,
-					crossing->section_2,
-					crossing->overlap,
-					crossing->num_ties);
-				fprintf(hfp,"## ROUTENAME %s\n", routename);
-				fprintf(hfp,"## ROUTESIZE %d\n", 1);
-				fprintf(hfp,"## ROUTECOLOR %d\n", routecolor);
-				fprintf(hfp,"## ROUTEPOINTS %d\n", 2);
-				fprintf(hfp,"## ROUTEEDITMODE %d\n", MB_NO);
-				fprintf(hfp,"> ## STARTROUTE\n");
-				fprintf(hfp,"%.10f %.10f 0.00 1\n%.10f %.10f 0.00 1\n>\n",
-					navlon1,navlat1,navlon2,navlat2);
-				nroute++;
-				}
-			}
-		fclose(hfp);
-fprintf(stderr,"Output %d (expected %d) true crossing locations to %s\n", nroute, ncrossings_true, routefile);
-		}
-
-	/* write mbgrdviz route file for all unfixed >=50% crossings */
-	sprintf(routefile,"%s%s_gt50crossing.rte",project->path,project->name);
-	if ((hfp = fopen(routefile,"w")) == NULL)
-		{
-		fclose(hfp);
-		status = MB_FAILURE;
-		*error = MB_ERROR_OPEN_FAIL;
-		fprintf(stderr, " > Unable to open output tie route file %s\n", routefile);
-		}
-	else
-		{
-		/* write the route file header */
-		fprintf(hfp, "## Route File Version %s\n", ROUTE_VERSION);
-		fprintf(hfp, "## Output by Program %s\n",program_name);
-		fprintf(hfp, "## Program Version %s\n",version_id);
-		fprintf(hfp, "## MB-System Version %s\n",MB_VERSION);
-		strncpy(date,"\0",25);
-		right_now = time((time_t *)0);
-		strcpy(date,ctime(&right_now));
-                date[strlen(date)-1] = '\0';
-		if ((user_ptr = getenv("USER")) == NULL)
-			if ((user_ptr = getenv("LOGNAME")) == NULL)
-				user_ptr = unknown;
-		gethostname(host,MB_PATH_MAXLINE);
-		fprintf(hfp, "## Run by user <%s> on cpu <%s> at <%s>\n",
-			user_ptr,host,date);
-		fprintf(hfp, "## Number of routes: %d\n",ncrossings_gt50);
-		fprintf(hfp, "## Route point format:\n");
-		fprintf(hfp, "##   <longitude (deg)> <latitude (deg)> <topography (m)> <waypoint (boolean)>\n");
-
-		/* loop over all crossings */
-		nroute = 0;
-		for (i=0;i<project->num_crossings;i++)
-			{
-			crossing = &project->crossings[i];
-   
-			/* output only unfixed >=50% crossings */
-			if (crossing->overlap >= 50
-			    && !(project->files[crossing->file_id_1].status == MBNA_FILE_FIXEDNAV
-				    || project->files[crossing->file_id_2].status == MBNA_FILE_FIXEDNAV))
-				{
-				file_1 = (struct mbna_file *) &project->files[crossing->file_id_1];
-				file_2 = (struct mbna_file *) &project->files[crossing->file_id_2];
-				section_1 = (struct mbna_section *) &file_1->sections[crossing->section_1];
-				section_2 = (struct mbna_section *) &file_2->sections[crossing->section_2];
-				snav_1 = section_1->num_snav/2;
-				snav_2 = section_2->num_snav/2;
-				navlon1 = section_1->snav_lon[snav_1] + section_1->snav_lon_offset[snav_1];
-				navlat1 = section_1->snav_lat[snav_1] + section_1->snav_lat_offset[snav_1];
-				navlon2 = section_2->snav_lon[snav_2] + section_2->snav_lon_offset[snav_2];
-				navlat2 = section_2->snav_lat[snav_2] + section_2->snav_lat_offset[snav_2];
-				if (crossing->status == MBNA_CROSSING_STATUS_NONE)
-					{
-					status_char = 'U';
-					routecolor = ROUTE_COLOR_YELLOW;
-					}
-				else if (crossing->status == MBNA_CROSSING_STATUS_SET)
-					{
-					status_char = '*';
-					routecolor = ROUTE_COLOR_GREEN;
-					}
-				else
-					{
-					status_char = '-';
-					routecolor = ROUTE_COLOR_RED;
-					}
-				if (crossing->truecrossing == MB_NO)
-					truecrossing_char = ' ';
-				else
-					truecrossing_char = 'X';
-				sprintf(routename,"%c%c %4d %2.2d:%3.3d:%3.3d %2.2d:%3.3d:%3.3d %3d %2d",
-					status_char, truecrossing_char, i,
-					file_1->block,
-					crossing->file_id_1,
-					crossing->section_1,
-					file_2->block,
-					crossing->file_id_2,
-					crossing->section_2,
-					crossing->overlap,
-					crossing->num_ties);
-				fprintf(hfp,"## ROUTENAME %s\n", routename);
-				fprintf(hfp,"## ROUTESIZE %d\n", 1);
-				fprintf(hfp,"## ROUTECOLOR %d\n", routecolor);
-				fprintf(hfp,"## ROUTEPOINTS %d\n", 2);
-				fprintf(hfp,"## ROUTEEDITMODE %d\n", MB_NO);
-				fprintf(hfp,"> ## STARTROUTE\n");
-				fprintf(hfp,"%.10f %.10f 0.00 1\n%.10f %.10f 0.00 1\n>\n",
-					navlon1,navlat1,navlon2,navlat2);
-				nroute++;
-				}
-			}
-		fclose(hfp);
-fprintf(stderr,"Output %d (expected %d) >=50%% overlap crossing locations to %s\n", nroute, ncrossings_gt50, routefile);
-		}
-
-	/* write mbgrdviz route file for all unfixed >=25% but less than 50% crossings */
-	sprintf(routefile,"%s%s_gt25crossing.rte",project->path,project->name);
-	if ((hfp = fopen(routefile,"w")) == NULL)
-		{
-		fclose(hfp);
-		status = MB_FAILURE;
-		*error = MB_ERROR_OPEN_FAIL;
-		fprintf(stderr, " > Unable to open output tie route file %s\n", routefile);
-		}
-	else
-		{
-		/* write the route file header */
-		fprintf(hfp, "## Route File Version %s\n", ROUTE_VERSION);
-		fprintf(hfp, "## Output by Program %s\n",program_name);
-		fprintf(hfp, "## Program Version %s\n",version_id);
-		fprintf(hfp, "## MB-System Version %s\n",MB_VERSION);
-		strncpy(date,"\0",25);
-		right_now = time((time_t *)0);
-		strcpy(date,ctime(&right_now));
-                date[strlen(date)-1] = '\0';
-		if ((user_ptr = getenv("USER")) == NULL)
-			if ((user_ptr = getenv("LOGNAME")) == NULL)
-				user_ptr = unknown;
-		gethostname(host,MB_PATH_MAXLINE);
-		fprintf(hfp, "## Run by user <%s> on cpu <%s> at <%s>\n",
-			user_ptr,host,date);
-		fprintf(hfp, "## Number of routes: %d\n",ncrossings_gt25);
-		fprintf(hfp, "## Route point format:\n");
-		fprintf(hfp, "##   <longitude (deg)> <latitude (deg)> <topography (m)> <waypoint (boolean)>\n");
-
-		/* loop over all crossings */
-		nroute = 0;
-		for (i=0;i<project->num_crossings;i++)
-			{
-			crossing = &project->crossings[i];
-    
-			/* output only unfixed >=25% but less than 50% crossings crossings */
-			if (crossing->overlap >= 25
-			    && !(project->files[crossing->file_id_1].status == MBNA_FILE_FIXEDNAV
-				    || project->files[crossing->file_id_2].status == MBNA_FILE_FIXEDNAV))
-				{
-				file_1 = (struct mbna_file *) &project->files[crossing->file_id_1];
-				file_2 = (struct mbna_file *) &project->files[crossing->file_id_2];
-				section_1 = (struct mbna_section *) &file_1->sections[crossing->section_1];
-				section_2 = (struct mbna_section *) &file_2->sections[crossing->section_2];
-				snav_1 = section_1->num_snav/2;
-				snav_2 = section_2->num_snav/2;
-				navlon1 = section_1->snav_lon[snav_1] + section_1->snav_lon_offset[snav_1];
-				navlat1 = section_1->snav_lat[snav_1] + section_1->snav_lat_offset[snav_1];
-				navlon2 = section_2->snav_lon[snav_2] + section_2->snav_lon_offset[snav_2];
-				navlat2 = section_2->snav_lat[snav_2] + section_2->snav_lat_offset[snav_2];
-				if (crossing->status == MBNA_CROSSING_STATUS_NONE)
-					{
-					status_char = 'U';
-					routecolor = ROUTE_COLOR_YELLOW;
-					}
-				else if (crossing->status == MBNA_CROSSING_STATUS_SET)
-					{
-					status_char = '*';
-					routecolor = ROUTE_COLOR_GREEN;
-					}
-				else
-					{
-					status_char = '-';
-					routecolor = ROUTE_COLOR_RED;
-					}
-				if (crossing->truecrossing == MB_NO)
-					truecrossing_char = ' ';
-				else
-					truecrossing_char = 'X';
-				sprintf(routename,"%c%c %4d %2.2d:%3.3d:%3.3d %2.2d:%3.3d:%3.3d %3d %2d",
-					status_char, truecrossing_char, i,
-					file_1->block,
-					crossing->file_id_1,
-					crossing->section_1,
-					file_2->block,
-					crossing->file_id_2,
-					crossing->section_2,
-					crossing->overlap,
-					crossing->num_ties);
-				fprintf(hfp,"## ROUTENAME %s\n", routename);
-				fprintf(hfp,"## ROUTESIZE %d\n", 1);
-				fprintf(hfp,"## ROUTECOLOR %d\n", routecolor);
-				fprintf(hfp,"## ROUTEPOINTS %d\n", 2);
-				fprintf(hfp,"## ROUTEEDITMODE %d\n", MB_NO);
-				fprintf(hfp,"> ## STARTROUTE\n");
-				fprintf(hfp,"%.10f %.10f 0.00 1\n%.10f %.10f 0.00 1\n>\n",
-					navlon1,navlat1,navlon2,navlat2);
-				nroute++;
-				}
-			}
-		fclose(hfp);
-fprintf(stderr,"Output %d (expected %d) >=25%% && < 50%% overlap crossing locations to %s\n", nroute, ncrossings_gt25, routefile);
-		}
-
-	/* write mbgrdviz route file for all unfixed <25% crossings */
-	sprintf(routefile,"%s%s_lt25crossing.rte",project->path,project->name);
-	if ((hfp = fopen(routefile,"w")) == NULL)
-		{
-		fclose(hfp);
-		status = MB_FAILURE;
-		*error = MB_ERROR_OPEN_FAIL;
-		fprintf(stderr, " > Unable to open output tie route file %s\n", routefile);
-		}
-	else
-		{
-		/* write the route file header */
-		fprintf(hfp, "## Route File Version %s\n", ROUTE_VERSION);
-		fprintf(hfp, "## Output by Program %s\n",program_name);
-		fprintf(hfp, "## Program Version %s\n",version_id);
-		fprintf(hfp, "## MB-System Version %s\n",MB_VERSION);
-		strncpy(date,"\0",25);
-		right_now = time((time_t *)0);
-		strcpy(date,ctime(&right_now));
-                date[strlen(date)-1] = '\0';
-		if ((user_ptr = getenv("USER")) == NULL)
-			if ((user_ptr = getenv("LOGNAME")) == NULL)
-				user_ptr = unknown;
-		gethostname(host,MB_PATH_MAXLINE);
-		fprintf(hfp, "## Run by user <%s> on cpu <%s> at <%s>\n",
-			user_ptr,host,date);
-		fprintf(hfp, "## Number of routes: %d\n",ncrossings_lt25);
-		fprintf(hfp, "## Route point format:\n");
-		fprintf(hfp, "##   <longitude (deg)> <latitude (deg)> <topography (m)> <waypoint (boolean)>\n");
-
-		/* loop over all crossings */
-		nroute = 0;
-		for (i=0;i<project->num_crossings;i++)
-			{
-			crossing = &project->crossings[i];
-    
-			/* output only unfixed <25% crossings crossings */
-			if (crossing->overlap < 25
-			    && !(project->files[crossing->file_id_1].status == MBNA_FILE_FIXEDNAV
-				    || project->files[crossing->file_id_2].status == MBNA_FILE_FIXEDNAV))
-				{
-				file_1 = (struct mbna_file *) &project->files[crossing->file_id_1];
-				file_2 = (struct mbna_file *) &project->files[crossing->file_id_2];
-				section_1 = (struct mbna_section *) &file_1->sections[crossing->section_1];
-				section_2 = (struct mbna_section *) &file_2->sections[crossing->section_2];
-				snav_1 = section_1->num_snav/2;
-				snav_2 = section_2->num_snav/2;
-				navlon1 = section_1->snav_lon[snav_1] + section_1->snav_lon_offset[snav_1];
-				navlat1 = section_1->snav_lat[snav_1] + section_1->snav_lat_offset[snav_1];
-				navlon2 = section_2->snav_lon[snav_2] + section_2->snav_lon_offset[snav_2];
-				navlat2 = section_2->snav_lat[snav_2] + section_2->snav_lat_offset[snav_2];
-				if (crossing->status == MBNA_CROSSING_STATUS_NONE)
-					{
-					status_char = 'U';
-					routecolor = ROUTE_COLOR_YELLOW;
-					}
-				else if (crossing->status == MBNA_CROSSING_STATUS_SET)
-					{
-					status_char = '*';
-					routecolor = ROUTE_COLOR_GREEN;
-					}
-				else
-					{
-					status_char = '-';
-					routecolor = ROUTE_COLOR_RED;
-					}
-				if (crossing->truecrossing == MB_NO)
-					truecrossing_char = ' ';
-				else
-					truecrossing_char = 'X';
-				sprintf(routename,"%c%c %4d %2.2d:%3.3d:%3.3d %2.2d:%3.3d:%3.3d %3d %2d",
-					status_char, truecrossing_char, i,
-					file_1->block,
-					crossing->file_id_1,
-					crossing->section_1,
-					file_2->block,
-					crossing->file_id_2,
-					crossing->section_2,
-					crossing->overlap,
-					crossing->num_ties);
-				fprintf(hfp,"## ROUTENAME %s\n", routename);
-				fprintf(hfp,"## ROUTESIZE %d\n", 1);
-				fprintf(hfp,"## ROUTECOLOR %d\n", routecolor);
-				fprintf(hfp,"## ROUTEPOINTS %d\n", 2);
-				fprintf(hfp,"## ROUTEEDITMODE %d\n", MB_NO);
-				fprintf(hfp,"> ## STARTROUTE\n");
-				fprintf(hfp,"%.10f %.10f 0.00 1\n%.10f %.10f 0.00 1\n>\n",
-					navlon1,navlat1,navlon2,navlat2);
-				nroute++;
-				}
-			}
-		fclose(hfp);
-fprintf(stderr,"Output %d (expected %d) <25%% overlap crossing locations to %s\n", nroute, ncrossings_lt25, routefile);
-		}
-
-	/* write mbgrdviz route file for all fixed crossings */
-	sprintf(routefile,"%s%s_fixedcrossing.rte",project->path,project->name);
-	if ((hfp = fopen(routefile,"w")) == NULL)
-		{
-		fclose(hfp);
-		status = MB_FAILURE;
-		*error = MB_ERROR_OPEN_FAIL;
-		fprintf(stderr, " > Unable to open output fixed crossings route file %s\n", routefile);
-		}
-	else
-		{
-		/* write the route file header */
-		fprintf(hfp, "## Route File Version %s\n", ROUTE_VERSION);
-		fprintf(hfp, "## Output by Program %s\n",program_name);
-		fprintf(hfp, "## Program Version %s\n",version_id);
-		fprintf(hfp, "## MB-System Version %s\n",MB_VERSION);
-		strncpy(date,"\0",25);
-		right_now = time((time_t *)0);
-		strcpy(date,ctime(&right_now));
-                date[strlen(date)-1] = '\0';
-		if ((user_ptr = getenv("USER")) == NULL)
-			if ((user_ptr = getenv("LOGNAME")) == NULL)
-				user_ptr = unknown;
-		gethostname(host,MB_PATH_MAXLINE);
-		fprintf(hfp, "## Run by user <%s> on cpu <%s> at <%s>\n",
-			user_ptr,host,date);
-		fprintf(hfp, "## Number of routes: %d\n",ncrossings_fixed);
-		fprintf(hfp, "## Route point format:\n");
-		fprintf(hfp, "##   <longitude (deg)> <latitude (deg)> <topography (m)> <waypoint (boolean)>\n");
-
-		/* loop over all crossings */
-		nroute = 0;
-		for (i=0;i<project->num_crossings;i++)
-			{
-			crossing = &project->crossings[i];
-  
-			/* output only fixed crossings */
-			if (project->files[crossing->file_id_1].status == MBNA_FILE_FIXEDNAV
-				    || project->files[crossing->file_id_2].status == MBNA_FILE_FIXEDNAV)
-				{
-				file_1 = (struct mbna_file *) &project->files[crossing->file_id_1];
-				file_2 = (struct mbna_file *) &project->files[crossing->file_id_2];
-				section_1 = (struct mbna_section *) &file_1->sections[crossing->section_1];
-				section_2 = (struct mbna_section *) &file_2->sections[crossing->section_2];
-				snav_1 = section_1->num_snav/2;
-				snav_2 = section_2->num_snav/2;
-				navlon1 = section_1->snav_lon[snav_1] + section_1->snav_lon_offset[snav_1];
-				navlat1 = section_1->snav_lat[snav_1] + section_1->snav_lat_offset[snav_1];
-				navlon2 = section_2->snav_lon[snav_2] + section_2->snav_lon_offset[snav_2];
-				navlat2 = section_2->snav_lat[snav_2] + section_2->snav_lat_offset[snav_2];
-				if (crossing->status == MBNA_CROSSING_STATUS_NONE)
-					{
-					status_char = 'U';
-					routecolor = ROUTE_COLOR_YELLOW;
-					}
-				else if (crossing->status == MBNA_CROSSING_STATUS_SET)
-					{
-					status_char = '*';
-					routecolor = ROUTE_COLOR_GREEN;
-					}
-				else
-					{
-					status_char = '-';
-					routecolor = ROUTE_COLOR_RED;
-					}
-				if (crossing->truecrossing == MB_NO)
-					truecrossing_char = ' ';
-				else
-					truecrossing_char = 'X';
-				sprintf(routename,"%c%c %4d %2.2d:%3.3d:%3.3d %2.2d:%3.3d:%3.3d %3d %2d",
-					status_char, truecrossing_char, i,
-					file_1->block,
-					crossing->file_id_1,
-					crossing->section_1,
-					file_2->block,
-					crossing->file_id_2,
-					crossing->section_2,
-					crossing->overlap,
-					crossing->num_ties);
-				fprintf(hfp,"## ROUTENAME %s\n", routename);
-				fprintf(hfp,"## ROUTESIZE %d\n", 1);
-				fprintf(hfp,"## ROUTECOLOR %d\n", routecolor);
-				fprintf(hfp,"## ROUTEPOINTS %d\n", 2);
-				fprintf(hfp,"## ROUTEEDITMODE %d\n", MB_NO);
-				fprintf(hfp,"> ## STARTROUTE\n");
-				fprintf(hfp,"%.10f %.10f 0.00 1\n%.10f %.10f 0.00 1\n>\n",
-					navlon1,navlat1,navlon2,navlat2);
-				nroute++;
-				}
-			}
-		fclose(hfp);
-fprintf(stderr,"Output %d (expected %d) fixed crossing locations to %s\n", nroute, ncrossings_fixed, routefile);
-		}
-
-	/* write mbgrdviz route file for all unfixed ties */
-	sprintf(routefile,"%s%s_unfixedties.rte",project->path,project->name);
-	if ((hfp = fopen(routefile,"w")) == NULL)
-		{
-		fclose(hfp);
-		status = MB_FAILURE;
-		*error = MB_ERROR_OPEN_FAIL;
-		fprintf(stderr, " > Unable to open output unfixed ties route file %s\n", routefile);
-		}
-	else
-		{
-		/* write the route file header */
-		fprintf(hfp, "## Route File Version %s\n", ROUTE_VERSION);
-		fprintf(hfp, "## Output by Program %s\n",program_name);
-		fprintf(hfp, "## Program Version %s\n",version_id);
-		fprintf(hfp, "## MB-System Version %s\n",MB_VERSION);
-		strncpy(date,"\0",25);
-		right_now = time((time_t *)0);
-		strcpy(date,ctime(&right_now));
-                date[strlen(date)-1] = '\0';
-		if ((user_ptr = getenv("USER")) == NULL)
-			if ((user_ptr = getenv("LOGNAME")) == NULL)
-				user_ptr = unknown;
-		gethostname(host,MB_PATH_MAXLINE);
-		fprintf(hfp, "## Run by user <%s> on cpu <%s> at <%s>\n",
-			user_ptr,host,date);
-		fprintf(hfp, "## Number of routes: %d\n",nties_unfixed);
-		fprintf(hfp, "## Route point format:\n");
-		fprintf(hfp, "##   <longitude (deg)> <latitude (deg)> <topography (m)> <waypoint (boolean)>\n");
-		routecolor = ROUTE_COLOR_BLUEGREEN;
-
-		/* loop over all crossings */
-		nroute = 0;
-		for (i=0;i<project->num_crossings;i++)
-			{
-			crossing = &project->crossings[i];
-   
-			/* output only unfixed ties */
-			if (crossing->status == MBNA_CROSSING_STATUS_SET
-				&& !(project->files[crossing->file_id_1].status == MBNA_FILE_FIXEDNAV
-					|| project->files[crossing->file_id_2].status == MBNA_FILE_FIXEDNAV))
-				{
-				for (j=0;j<crossing->num_ties;j++)
-					{
-					file_1 = (struct mbna_file *) &project->files[crossing->file_id_1];
-					file_2 = (struct mbna_file *) &project->files[crossing->file_id_2];
-					section_1 = (struct mbna_section *) &file_1->sections[crossing->section_1];
-					section_2 = (struct mbna_section *) &file_2->sections[crossing->section_2];
-					tie = (struct mbna_tie *) &crossing->ties[j];
-					snav_1 = tie->snav_1;
-					snav_2 = tie->snav_2;
-					navlon1 = section_1->snav_lon[snav_1] + section_1->snav_lon_offset[snav_1];
-					navlat1 = section_1->snav_lat[snav_1] + section_1->snav_lat_offset[snav_1];
-					navlon2 = section_2->snav_lon[snav_2] + section_2->snav_lon_offset[snav_2];
-					navlat2 = section_2->snav_lat[snav_2] + section_2->snav_lat_offset[snav_2];
-					if (crossing->status == MBNA_CROSSING_STATUS_NONE)
-						status_char = 'U';
-					else if (crossing->status == MBNA_CROSSING_STATUS_SET)
-						status_char = '*';
-					else
-						status_char = '-';
-					if (crossing->truecrossing == MB_NO)
-						truecrossing_char = ' ';
-					else
-						truecrossing_char = 'X';
-					sprintf(routename,"Tie: %c%c %4d %2.2d:%3.3d:%3.3d %2.2d:%3.3d:%3.3d %3d %2d of %2d",
-						status_char, truecrossing_char, i,
-						file_1->block,
-						crossing->file_id_1,
-						crossing->section_1,
-						file_2->block,
-						crossing->file_id_2,
-						crossing->section_2,
-						crossing->overlap,
-						j, crossing->num_ties);
-					fprintf(hfp,"## ROUTENAME %s\n", routename);
-					fprintf(hfp,"## ROUTESIZE %d\n", 1);
-					fprintf(hfp,"## ROUTECOLOR %d\n", routecolor);
-					fprintf(hfp,"## ROUTEPOINTS %d\n", 2);
-					fprintf(hfp,"## ROUTEEDITMODE %d\n", MB_NO);
-					fprintf(hfp,"> ## STARTROUTE\n");
-					fprintf(hfp,"%.10f %.10f 0.00 1\n%.10f %.10f 0.00 1\n>\n",
-						navlon1,navlat1,navlon2,navlat2);
-					nroute++;
-					}
-				}
-			}
-		fclose(hfp);
-fprintf(stderr,"Output %d (expected %d) unfixed tie locations to %s\n", nroute, nties_unfixed, routefile);
-		}
-
-	/* write mbgrdviz route file for all fixed ties */
-	sprintf(routefile,"%s%s_fixedties.rte",project->path,project->name);
-	if ((hfp = fopen(routefile,"w")) == NULL)
-		{
-		fclose(hfp);
-		status = MB_FAILURE;
-		*error = MB_ERROR_OPEN_FAIL;
-		fprintf(stderr, " > Unable to open output fixed ties route file %s\n", routefile);
-		}
-	else
-		{
-		/* write the route file header */
-		fprintf(hfp, "## Route File Version %s\n", ROUTE_VERSION);
-		fprintf(hfp, "## Output by Program %s\n",program_name);
-		fprintf(hfp, "## Program Version %s\n",version_id);
-		fprintf(hfp, "## MB-System Version %s\n",MB_VERSION);
-		strncpy(date,"\0",25);
-		right_now = time((time_t *)0);
-		strcpy(date,ctime(&right_now));
-                date[strlen(date)-1] = '\0';
-		if ((user_ptr = getenv("USER")) == NULL)
-			if ((user_ptr = getenv("LOGNAME")) == NULL)
-				user_ptr = unknown;
-		gethostname(host,MB_PATH_MAXLINE);
-		fprintf(hfp, "## Run by user <%s> on cpu <%s> at <%s>\n",
-			user_ptr,host,date);
-		fprintf(hfp, "## Number of routes: %d\n",nties_fixed);
-		fprintf(hfp, "## Route point format:\n");
-		fprintf(hfp, "##   <longitude (deg)> <latitude (deg)> <topography (m)> <waypoint (boolean)>\n");
-		routecolor = ROUTE_COLOR_RED;
-
-		/* loop over all crossings */
-		nroute = 0;
-		for (i=0;i<project->num_crossings;i++)
-			{
-			crossing = &project->crossings[i];
-   
-			/* output only fixed ties */
-			if (crossing->status == MBNA_CROSSING_STATUS_SET
-				&& (project->files[crossing->file_id_1].status == MBNA_FILE_FIXEDNAV
-					|| project->files[crossing->file_id_2].status == MBNA_FILE_FIXEDNAV))
-				{
-				for (j=0;j<crossing->num_ties;j++)
-					{
-					file_1 = (struct mbna_file *) &project->files[crossing->file_id_1];
-					file_2 = (struct mbna_file *) &project->files[crossing->file_id_2];
-					section_1 = (struct mbna_section *) &file_1->sections[crossing->section_1];
-					section_2 = (struct mbna_section *) &file_2->sections[crossing->section_2];
-					tie = (struct mbna_tie *) &crossing->ties[j];
-					snav_1 = tie->snav_1;
-					snav_2 = tie->snav_2;
-					navlon1 = section_1->snav_lon[snav_1] + section_1->snav_lon_offset[snav_1];
-					navlat1 = section_1->snav_lat[snav_1] + section_1->snav_lat_offset[snav_1];
-					navlon2 = section_2->snav_lon[snav_2] + section_2->snav_lon_offset[snav_2];
-					navlat2 = section_2->snav_lat[snav_2] + section_2->snav_lat_offset[snav_2];
-					if (crossing->status == MBNA_CROSSING_STATUS_NONE)
-						status_char = 'U';
-					else if (crossing->status == MBNA_CROSSING_STATUS_SET)
-						status_char = '*';
-					else
-						status_char = '-';
-					if (crossing->truecrossing == MB_NO)
-						truecrossing_char = ' ';
-					else
-						truecrossing_char = 'X';
-					sprintf(routename,"Tie: %c%c %4d %2.2d:%3.3d:%3.3d %2.2d:%3.3d:%3.3d %3d %2d of %2d",
-						status_char, truecrossing_char, i,
-						file_1->block,
-						crossing->file_id_1,
-						crossing->section_1,
-						file_2->block,
-						crossing->file_id_2,
-						crossing->section_2,
-						crossing->overlap,
-						j, crossing->num_ties);
-					fprintf(hfp,"## ROUTENAME %s\n", routename);
-					fprintf(hfp,"## ROUTESIZE %d\n", 1);
-					fprintf(hfp,"## ROUTECOLOR %d\n", routecolor);
-					fprintf(hfp,"## ROUTEPOINTS %d\n", 2);
-					fprintf(hfp,"## ROUTEEDITMODE %d\n", MB_NO);
-					fprintf(hfp,"> ## STARTROUTE\n");
-					fprintf(hfp,"%.10f %.10f 0.00 1\n%.10f %.10f 0.00 1\n>\n",
-						navlon1,navlat1,navlon2,navlat2);
-					nroute++;
-					}
-				}
-			}
-		fclose(hfp);
-fprintf(stderr,"Output %d (expected %d) fixed tie locations to %s\n", nroute, nties_fixed, routefile);
-		}
-
-	/* output offset vectors */
-	if (project->inversion == MBNA_INVERSION_CURRENT)
-		{
-		sprintf(xoffsetfile,"%s%s_dx.txt",project->path,project->name);
-		sprintf(yoffsetfile,"%s%s_dy.txt",project->path,project->name);
-		if ((xfp = fopen(xoffsetfile,"w")) != NULL
-		    && (yfp = fopen(yoffsetfile,"w")) != NULL)
-			{
-			for (i=0;i<project->num_files;i++)
-			    {
-			    file = &project->files[i];
-			    for (j=0;j<file->num_sections;j++)
-				{
-				section = &file->sections[j];
-                                mb_coor_scale(verbose,0.5 * (section->latmin + section->latmax),
-                                                                    &mtodeglon,&mtodeglat);
-				for (k=0;k<section->num_snav;k++)
-				    {
-				    fprintf(xfp, "%.10f %.10f %.10f\n", section->snav_lon[k], section->snav_lat[k],
-								section->snav_lon_offset[k]/mtodeglon);
-				    fprintf(yfp, "%.10f %.10f %.10f\n", section->snav_lon[k], section->snav_lat[k],
-								section->snav_lat_offset[k]/mtodeglat);
-				    }
-				}
-			    }
-			fclose(xfp);
-			fclose(yfp);
-			}
-
-		/* else set error */
-		else
-			{
-			status = MB_FAILURE;
-                        *error = MB_ERROR_OPEN_FAIL;
-			fprintf(stderr,"Unable to update project %s\n > Offset vector files: %s %s\n",
-				project->name, xoffsetfile, yoffsetfile);
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbnavadjust/mbnavadjust_io.h b/src/mbnavadjust/mbnavadjust_io.h
deleted file mode 100644
index 86ed69e..0000000
--- a/src/mbnavadjust/mbnavadjust_io.h
+++ /dev/null
@@ -1,316 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbnavadjust_io.h	4/18/2014
- *    $Id: mbnavadjust_io.h 2238 2015-04-15 06:00:52Z caress $
- 
- *    Copyright (c) 2014-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * Mbnavadjustmerge merges two existing mbnavadjust projects. The result
- * can be to add one project to another or to create a new, third project
- * combining the two source projects.
- *
- * Author:	D. W. Caress
- * Date:	April 18, 2014
- *
- *
- */
-
-/*--------------------------------------------------------------------*/
-
-#ifndef MB_DEFINE_DEF
-#include "mb_define.h"
-#endif
-
-#ifndef MB_YES
-#include "mb_status.h"
-#endif
-
-/* mbnavadjust global defines */
-#define STRING_MAX 			MB_PATH_MAXLINE
-#define BUFFER_MAX 			1024
-#define ALLOC_NUM			10
-#define MBNA_SNAV_NUM			11
-#define	MBNA_STATUS_GUI			0
-#define	MBNA_STATUS_AUTOPICK		1
-#define	MBNA_STATUS_NAVERR		2
-#define	MBNA_STATUS_NAVSOLVE		3
-#define	MBNA_INVERSION_NONE		0
-#define	MBNA_INVERSION_OLD		1
-#define	MBNA_INVERSION_CURRENT		2
-#define	MBNA_FILE_POORNAV		1
-#define	MBNA_FILE_GOODNAV		2
-#define	MBNA_FILE_FIXEDNAV		3
-#define	MBNA_FILE_FIXEDXYNAV		4
-#define	MBNA_FILE_FIXEDZNAV		5
-#define	MBNA_TIE_NONE			0
-#define	MBNA_TIE_XYZ			1
-#define	MBNA_TIE_XY			2
-#define	MBNA_TIE_Z			3
-#define	MBNA_CROSSING_STATUS_NONE	0
-#define	MBNA_CROSSING_STATUS_SET	1
-#define	MBNA_CROSSING_STATUS_SKIP	2
-#define MBNA_TIME_GAP_MAX		120.0
-#define MBNA_TIME_DIFF_THRESHOLD	2.0
-#define MBNA_VIEW_LIST_SURVEYS		0
-#define MBNA_VIEW_LIST_FILES		1
-#define MBNA_VIEW_LIST_FILESECTIONS	2
-#define MBNA_VIEW_LIST_CROSSINGS	3
-#define MBNA_VIEW_LIST_MEDIOCRECROSSINGS	4
-#define MBNA_VIEW_LIST_GOODCROSSINGS	5
-#define MBNA_VIEW_LIST_BETTERCROSSINGS	6
-#define MBNA_VIEW_LIST_TRUECROSSINGS	7
-#define MBNA_VIEW_LIST_TIES		8
-#define MBNA_VIEW_MODE_ALL		0
-#define MBNA_VIEW_MODE_SURVEY		1
-#define MBNA_VIEW_MODE_WITHSURVEY	2
-#define MBNA_VIEW_MODE_FILE		3
-#define MBNA_VIEW_MODE_WITHFILE		4
-#define MBNA_VIEW_MODE_WITHSECTION	5
-#define MBNA_SELECT_NONE		-1
-#define MBNA_VECTOR_ALLOC_INC		1000
-#define MBNA_PEN_UP			3
-#define MBNA_PEN_DOWN			2
-#define MBNA_PEN_ORIGIN			-3
-#define MBNA_PEN_COLOR			0
-#define MBNA_PLOT_MODE_FIRST 		0
-#define MBNA_PLOT_MODE_MOVE 		1
-#define MBNA_PLOT_MODE_ZOOMFIRST 	2
-#define MBNA_PLOT_MODE_ZOOM 		3
-#define MBNA_MASK_DIM			25
-#define MBNA_MISFIT_ZEROCENTER		0
-#define MBNA_MISFIT_AUTOCENTER		1
-#define MBNA_MISFIT_DIMXY		61
-#define MBNA_MISFIT_NTHRESHOLD		(MBNA_MISFIT_DIMXY * MBNA_MISFIT_DIMXY / 36)
-#define MBNA_MISFIT_DIMZ		51
-#define MBNA_BIAS_SAME			0
-#define MBNA_BIAS_DIFFERENT		1
-#define MBNA_OVERLAP_THRESHOLD		25
-
-#define	MBNA_MODELPLOT_TIMESERIES	0
-#define	MBNA_MODELPLOT_PERTURBATION	1
-#define	MBNA_MODELPLOT_TIEOFFSETS	2
-#define	MBNA_MODELPLOT_LEFT_WIDTH	25
-#define	MBNA_MODELPLOT_LEFT_HEIGHT	65
-#define	MBNA_MODELPLOT_X_SPACE		10
-#define	MBNA_MODELPLOT_Y_SPACE		30
-
-#define	MBNA_INTERP_NONE		0
-#define	MBNA_INTERP_CONSTANT		1
-#define	MBNA_INTERP_INTERP		2
-
-#define MBNA_SMOOTHING_DEFAULT		2
-
-#define MBNA_INTERATION_MAX		10000
-#define MBNA_CONVERGENCE		0.000001
-#define MBNA_SMALL			0.0001
-
-/* minimum initial sigma_crossing (meters) */
-#define	SIGMA_MINIMUM	0.1
-
-/* ping type defines */
-#define	SIDE_PORT	0
-#define	SIDE_STBD	1
-#define	SIDE_FULLSWATH	2
-
-/* route version define */
-#define ROUTE_VERSION "1.00"
-
-/* route color defines (colors different in MBgrdviz than in MBnavadjust) */
-#define	ROUTE_COLOR_BLACK			0
-#define	ROUTE_COLOR_WHITE			1
-#define	ROUTE_COLOR_RED			2
-#define	ROUTE_COLOR_YELLOW		3
-#define	ROUTE_COLOR_GREEN			4
-#define	ROUTE_COLOR_BLUEGREEN		5
-#define	ROUTE_COLOR_BLUE			6
-#define	ROUTE_COLOR_PURPLE		7
-
-/* mbnavadjust project and file structures */
-struct mbna_section {
-	int	num_pings;
-	int	num_beams;
-	int	global_start_ping;
-	int	global_start_snav;
-	int	continuity;
-	double	distance;
-	double	btime_d;
-	double 	etime_d;
-	double	lonmin;
-	double	lonmax;
- 	double	latmin;
-	double	latmax;
-	double	depthmin;
-	double	depthmax;
-	int	coverage[MBNA_MASK_DIM * MBNA_MASK_DIM];
-	int	num_snav;
-	int	snav_id[MBNA_SNAV_NUM];
-	int	snav_num_ties[MBNA_SNAV_NUM];
-	int	snav_invert_id[MBNA_SNAV_NUM];
-	int	snav_invert_constraint[MBNA_SNAV_NUM];
-	double	snav_distance[MBNA_SNAV_NUM];
-	double	snav_time_d[MBNA_SNAV_NUM];
-	double	snav_lon[MBNA_SNAV_NUM];
-	double	snav_lat[MBNA_SNAV_NUM];
-	double	snav_lon_offset[MBNA_SNAV_NUM];
-	double	snav_lat_offset[MBNA_SNAV_NUM];
-	double	snav_z_offset[MBNA_SNAV_NUM];
-	double	snav_lon_offset_int[MBNA_SNAV_NUM];
-	double	snav_lat_offset_int[MBNA_SNAV_NUM];
-	double	snav_z_offset_int[MBNA_SNAV_NUM];
-	int	show_in_modelplot;
-	int	modelplot_start_count;
-	int	contoursuptodate;
-	int	global_tie_status;
-	int	global_tie_snav;
-	double	global_tie_offset_x;
-	double	global_tie_offset_y;
-	double	global_tie_offset_x_m;
-	double	global_tie_offset_y_m;
-	double	global_tie_offset_z_m;
-	double	global_tie_xsigma;
-	double	global_tie_ysigma;
-	double	global_tie_zsigma;
-};
-struct mbna_file {
-	int	status;
-	int	id;
-	int	output_id;
-	char 	file[STRING_MAX];
-	char 	path[STRING_MAX];
-	int	format;
-	double	heading_bias_import;
-	double	roll_bias_import;
-	double	heading_bias;
-	double	roll_bias;
-	int	block;
-	double	block_offset_x;
-	double	block_offset_y;
-	double	block_offset_z;
-	int	show_in_modelplot;
-	int	num_snavs;
-	int	num_pings;
-	int	num_beams;
-	int	num_sections;
-	int	num_sections_alloc;
-	struct mbna_section *sections;
-};
-struct mbna_tie {
-	int	status;
-	int	snav_1;
-	double	snav_1_time_d;
-	int	snav_2;
-	double	snav_2_time_d;
-	double	offset_x;
-	double	offset_y;
-	double	offset_x_m;
-	double	offset_y_m;
-	double	offset_z_m;
-	double	sigmar1;
-	double	sigmax1[3];
-	double	sigmar2;
-	double	sigmax2[3];
-	double	sigmar3;
-	double	sigmax3[3];
-	int	inversion_status;
-	double	inversion_offset_x;
-	double	inversion_offset_y;
-	double	inversion_offset_x_m;
-	double	inversion_offset_y_m;
-	double	inversion_offset_z_m;
-	int	block_1;
-	int	block_2;
-	int	isurveyplotindex;
-};
-struct mbna_crossing {
-	int	status;
-	int	truecrossing;
-	int	overlap;
-	int	file_id_1;
-	int	section_1;
-	int	file_id_2;
-	int	section_2;
-	int	num_ties;
-	struct mbna_tie ties[MBNA_SNAV_NUM];
-};
-struct mbna_project {
-	int	open;
-	char	name[STRING_MAX];
-	char	path[STRING_MAX];
-	char	home[STRING_MAX];
-	char	datadir[STRING_MAX];
-	char	logfile[STRING_MAX];
-	int	num_files;
-	int	num_files_alloc;
-	struct mbna_file *files;
-	int	num_blocks;
-	int	num_snavs;
-	int	num_pings;
-	int	num_beams;
-	int	num_crossings;
-	int	num_crossings_alloc;
-	int	num_crossings_analyzed;
-	int	num_goodcrossings;
-	int	num_truecrossings;
-	int	num_truecrossings_analyzed;
-	struct mbna_crossing *crossings;
-	int	num_ties;
-	double	section_length;
-	int	section_soundings;
-	double	cont_int;
-	double	col_int;
-	double	tick_int;
-	double	label_int;
-	int	decimation;
-	double	precision;
-	double	smoothing;
-	double	zoffsetwidth;
-	int	inversion;
-	int	modelplot;
-	int	modelplot_style;
-	FILE	*logfp;
-};
-struct mbna_plot_vector
-    {
-    int	    command;
-    int	    color;
-    double  x;
-    double  y;
-    };
-struct mbna_contour_vector
-    {
-    int	    nvector;
-    int	    nvector_alloc;
-    struct mbna_plot_vector *vector;
-    };
-    
-int mbnavadjust_new_project(int verbose, char *projectpath,
-                            double section_length,
-                            int	section_soundings,
-                            double cont_int,
-                            double col_int,
-                            double tick_int,
-                            double label_int,
-                            int	decimation,
-                            double smoothing,
-                            double zoffsetwidth,
-                            struct mbna_project *project, int *error);
-int mbnavadjust_read_project(int verbose, char *projectpath,
-                                struct mbna_project *project, int *error);
-int mbnavadjust_write_project(int verbose, struct mbna_project *project,
-                                int *error);
-int mbnavadjust_close_project(int verbose, struct mbna_project *project,
-                                int *error);
-
-
-
-
-
-/*--------------------------------------------------------------------*/
diff --git a/src/mbnavadjust/mbnavadjust_prog.c b/src/mbnavadjust/mbnavadjust_prog.c
deleted file mode 100644
index 2c09bbb..0000000
--- a/src/mbnavadjust/mbnavadjust_prog.c
+++ /dev/null
@@ -1,17754 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbnavadjust_prog.c	3/23/00
- *    $Id: mbnavadjust_prog.c 2239 2015-05-07 00:51:42Z caress $
- *
- *    Copyright (c) 2000-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbnavadjust is an interactive navigation adjustment package
- * for swath sonar data.
- * It can work with any data format supported by the MBIO library.
- * This file contains the code that does not directly depend on the
- * MOTIF interface.
- *
- * Author:	D. W. Caress
- * Date:	March 23, 2000
- *
- *
- */
-
-/*--------------------------------------------------------------------*/
-
-/* standard include files */
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <math.h>
-#include <string.h>
-#include <time.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <X11/Intrinsic.h>
-
-/* MBIO include files */
-#include "mb_format.h"
-#include "mb_status.h"
-#include "mb_define.h"
-#include "mb_io.h"
-#include "mb_process.h"
-#include "mb_aux.h"
-#include "mbsys_ldeoih.h"
-#include "mb_xgraphics.h"
-
-/* define global control parameters */
-#include "mbnavadjust.h"
-
-/* swath bathymetry raw data structures */
-struct	pingraw
-	{
-	int	time_i[7];
-	double	time_d;
-	double	navlon;
-	double	navlat;
-	double	heading;
-	double	draft;
-	double	beams_bath;
-	char	*beamflag;
-	double	*bath;
-	double	*bathacrosstrack;
-	double	*bathalongtrack;
-	};
-struct swathraw
-	{
-	/* raw swath data */
-	int	file_id;
-	int	npings;
-	int	npings_max;
-	int	beams_bath;
-	struct pingraw *pingraws;
-	};
-
-/* id variables */
-static char rcs_id[] = "$Id: mbnavadjust_prog.c 2239 2015-05-07 00:51:42Z caress $";
-static char program_name[] = "mbnavadjust";
-static char help_message[] =  "mbnavadjust is an interactive navigation adjustment package for swath sonar data.\n";
-static char usage_message[] = "mbnavadjust [-Iproject -V -H]";
-
-/* status variables */
-int	error = MB_ERROR_NO_ERROR;
-char	*error_message;
-char	message[STRING_MAX];
-char	error1[STRING_MAX];
-char	error2[STRING_MAX];
-char	error3[STRING_MAX];
-
-/* data file parameters */
-void	*datalist;
-
-/* MBIO control parameters */
-int	pings;
-int	lonflip;
-double	bounds[4];
-int	btime_i[7];
-int	etime_i[7];
-double	btime_d;
-double	etime_d;
-double	speedmin;
-double	timegap;
-
-/* route color defines (colors different in MBgrdviz than in MBnavadjust) */
-#define	ROUTE_COLOR_BLACK			0
-#define	ROUTE_COLOR_WHITE			1
-#define	ROUTE_COLOR_RED			2
-#define	ROUTE_COLOR_YELLOW		3
-#define	ROUTE_COLOR_GREEN			4
-#define	ROUTE_COLOR_BLUEGREEN		5
-#define	ROUTE_COLOR_BLUE			6
-#define	ROUTE_COLOR_PURPLE		7
-
-/* color control values */
-#define	WHITE	0
-#define	BLACK	1
-#define RED	2
-#define GREEN	3
-#define BLUE	4
-#define CORAL	5
-#define YELLOW	6
-#define ORANGE	23
-#define PURPLE	255
-
-#define	XG_SOLIDLINE	0
-#define	XG_DASHLINE	1
-void	*pcont_xgid;
-void	*pcorr_xgid;
-void	*pzoff_xgid;
-void	*pmodp_xgid;
-int	ncolors;
-int	pixel_values[256];
-
-/* Set these to the dimensions of your canvas drawing */
-/* areas, minus 1, located in the uil file             */
-static int corr_borders[4];
-static int cont_borders[4];
-static int zoff_borders[4];
-static int modp_borders[4];
-
-/* mb_contour parameters */
-struct swathraw *swathraw1 = NULL;
-struct swathraw *swathraw2 = NULL;
-struct swath *swath1 = NULL;
-struct swath *swath2 = NULL;
-struct ping *ping = NULL;
-
-/* misfit grid parameters */
-int	grid_nx = 0;
-int	grid_ny = 0;
-int	grid_nxy = 0;
-int	grid_nxyzeq = 0;
-double	grid_dx = 0.0;
-double	grid_dy = 0.0;
-double	grid_olon = 0.0;
-double	grid_olat = 0.0;
-double	misfit_min, misfit_max;
-int	gridm_nx = 0;
-int	gridm_ny = 0;
-int	gridm_nxyz = 0;
-double	*grid1 = NULL;
-double	*grid2 = NULL;
-double	*gridm = NULL;
-double	*gridmeq = NULL;
-int	*gridn1 = NULL;
-int	*gridn2 = NULL;
-int	*gridnm = NULL;
-#define NINTERVALS_MISFIT 80
-int	nmisfit_intervals = NINTERVALS_MISFIT;
-double	misfit_intervals[NINTERVALS_MISFIT];
-int	nzmisfitcalc;
-double	zoff_dz;
-double	zmin, zmax;
-double	zmisfitmin;
-double	zmisfitmax;
-
-/* time, user, host variables */
-time_t	right_now;
-char	date[32], user[MBP_FILENAMESIZE], *user_ptr, host[MBP_FILENAMESIZE];
-
-/* local prototypes */
-int mbnavadjust_crossing_compare(const void *a, const void *b);
-void mbnavadjust_plot(double xx,double yy,int ipen);
-void mbnavadjust_newpen(int icolor);
-void mbnavadjust_setline(int linewidth);
-void mbnavadjust_justify_string(double height,char *string, double *s);
-void mbnavadjust_plot_string(double x, double y, double hgt, double angle, char *label);
-
-/*--------------------------------------------------------------------*/
-int mbnavadjust_init_globals()
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_init_globals";
-	int	iformat;
-	int	status = MB_SUCCESS;
-
-	/* set default global control parameters */
-	project.open = MB_NO;
-	memset(project.name,0,STRING_MAX);
-	strcpy(project.name,"None");
- 	memset(project.path,0,STRING_MAX);
-	memset(project.datadir,0,STRING_MAX);
-	project.num_files = 0;
-	project.num_files_alloc = 0;
-	project.files = NULL;
-	project.num_blocks = 0;
-	project.num_snavs = 0;
-	project.num_pings = 0;
-	project.num_beams = 0;
-	project.num_crossings = 0;
-	project.num_crossings_alloc = 0;
- 	project.num_crossings_analyzed = 0;
-	project.num_goodcrossings = 0;
-	project.num_truecrossings = 0;
- 	project.num_truecrossings_analyzed = 0;
- 	project.crossings = NULL;
-	project.num_ties = 0;
-	project.inversion = MBNA_INVERSION_NONE;
-	project.modelplot = MB_NO;
-	project.modelplot_style = MBNA_MODELPLOT_TIMESERIES;
-	project.logfp = NULL;
- 	mbna_status = MBNA_STATUS_GUI;
- 	mbna_view_list = MBNA_VIEW_LIST_FILES;
- 	mbna_view_mode = MBNA_VIEW_MODE_ALL;
-	mbna_invert_mode = MBNA_INVERT_ZISOLATED;
-	mbna_color_foreground = BLACK;
-	mbna_color_background = WHITE;
- 	project.section_length = 0.14;
- 	project.section_soundings = 100000;
- 	project.decimation = 1;
-	project.precision = SIGMA_MINIMUM;
-	project.smoothing = MBNA_SMOOTHING_DEFAULT;
-	project.zoffsetwidth = 5.0;
-	mbna_file_id_1 = MBNA_SELECT_NONE;
-	mbna_section_1 = MBNA_SELECT_NONE;
-	mbna_file_id_2 = MBNA_SELECT_NONE;
-	mbna_section_2 = MBNA_SELECT_NONE;
- 	mbna_current_crossing = MBNA_SELECT_NONE;
- 	mbna_current_tie = MBNA_SELECT_NONE;
-	mbna_naverr_load = MB_NO;
- 	mbna_file_select = MBNA_SELECT_NONE;
- 	mbna_survey_select = MBNA_SELECT_NONE;
- 	mbna_section_select = MBNA_SELECT_NONE;
-	mbna_crossing_select = MBNA_SELECT_NONE;
-	mbna_tie_select = MBNA_SELECT_NONE;
-	project.cont_int = 1.;
-	project.col_int = 5.;
-	project.tick_int = 5.;
-	project.label_int = 100000.;
-	mbna_contour_algorithm = MB_CONTOUR_OLD;
-	/*mbna_contour_algorithm = MB_CONTOUR_TRIANGLES;*/
-	mbna_ncolor = 10;
-	mbna_contour = NULL;
-	mbna_contour1.nvector = 0;
-	mbna_contour1.nvector_alloc = 0;
-	mbna_contour1.vector = NULL;
-	mbna_contour2.nvector = 0;
-	mbna_contour2.nvector_alloc = 0;
-	mbna_contour2.vector = NULL;
-	mbna_smoothweight = 100.0;
-	mbna_offsetweight = 0.01;
-	mbna_zweightfactor = 1.0;
-	mbna_misfit_center = MBNA_MISFIT_AUTOCENTER;
-	mbna_minmisfit_nthreshold = MBNA_MISFIT_NTHRESHOLD;
-	mbna_minmisfit = 0.0;
-	mbna_bias_mode = MBNA_BIAS_SAME;
-	mbna_allow_set_tie = MB_NO;
-	mbna_modelplot_zoom = MB_NO;
-	mbna_modelplot_zoom_x1 = 0;
-	mbna_modelplot_zoom_x2 = 0;
-	mbna_modelplot_tiezoom = MB_NO;
-	mbna_modelplot_tiestart = 0;
-	mbna_modelplot_tieend = 0;
-	mbna_modelplot_tiestartzoom = 0;
-	mbna_modelplot_tieendzoom = 0;
-	mbna_modelplot_pickfile = MBNA_SELECT_NONE;
-	mbna_modelplot_picksection = MBNA_SELECT_NONE;
-	mbna_modelplot_picksnav = MBNA_SELECT_NONE;
-	mbna_modelplot_blocksurvey1 = MBNA_SELECT_NONE;
-	mbna_modelplot_blocksurvey2 = MBNA_SELECT_NONE;
-	mbna_reset_crossings = MB_NO;
-	mbna_bin_swathwidth = 160.0;
-	mbna_bin_pseudobeamwidth = 1.0;
-	mbna_bin_beams_bath = mbna_bin_swathwidth / mbna_bin_pseudobeamwidth + 1;
-
-	/* set mbio default values */
-	status = mb_defaults(mbna_verbose,&iformat,&pings,&lonflip,bounds,
-		btime_i,etime_i,&speedmin,&timegap);
-	pings = 1;
-	lonflip = 0;
-	bounds[0] = -360.;
-	bounds[1] = 360.;
-	bounds[2] = -90.;
-	bounds[3] = 90.;
-	btime_i[0] = 1962;
-	btime_i[1] = 2;
-	btime_i[2] = 21;
-	btime_i[3] = 10;
-	btime_i[4] = 30;
-	btime_i[5] = 0;
-	btime_i[6] = 0;
-	etime_i[0] = 2062;
-	etime_i[1] = 2;
-	etime_i[2] = 21;
-	etime_i[3] = 10;
-	etime_i[4] = 30;
-	etime_i[5] = 0;
-	etime_i[6] = 0;
-	speedmin = 0.0;
-	timegap = 1000000000.0;
-
-	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-
-
-/*--------------------------------------------------------------------*/
-int mbnavadjust_init(int argc,char **argv)
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_init";
-	int	status = MB_SUCCESS;
-	int	fileflag = 0;
-	char	ifile[STRING_MAX];
-	int	i;
-
-	/* parsing variables */
-	extern char *optarg;
-	int	errflg = 0;
-	int	c;
-	int	help = 0;
-	int	flag = 0;
-
-	/* process argument list */
-	while ((c = getopt(argc, argv, "VvHhDdI:i:Rr")) != -1)
-	  switch (c)
-		{
-		case 'H':
-		case 'h':
-			help++;
-			break;
-		case 'V':
-		case 'v':
-			mbna_verbose++;
-			break;
-		case 'D':
-		case 'd':
-			mbna_color_foreground = WHITE;
-			mbna_color_background = BLACK;
-			break;
-		case 'I':
-		case 'i':
-			sscanf (optarg,"%s", ifile);
-			flag++;
-			fileflag++;
-			break;
-		case 'R':
-		case 'r':
-			mbna_reset_crossings = MB_YES;
-			break;
-		case '?':
-			errflg++;
-		}
-
-	/* if error flagged then print it and exit */
-	if (errflg)
-		{
-		fprintf(stderr,"usage: %s\n", usage_message);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		error = MB_ERROR_BAD_USAGE;
-		exit(error);
-		}
-
-	/* print starting message */
-	if (mbna_verbose == 1 || help)
-		{
-		fprintf(stderr,"\nProgram %s\n",program_name);
-		fprintf(stderr,"Version %s\n",rcs_id);
-		fprintf(stderr,"MB-system Version %s\n",MB_VERSION);
-		}
-
-	/* print starting debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  Program <%s>\n",program_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Control Parameters:\n");
-		fprintf(stderr,"dbg2       mbna_verbose:         %d\n",mbna_verbose);
-		fprintf(stderr,"dbg2       help:            %d\n",help);
-		fprintf(stderr,"dbg2       input file:      %s\n",ifile);
-		}
-
-	/* if help desired then print it and exit */
-	if (help)
-		{
-		fprintf(stderr,"\n%s\n",help_message);
-		fprintf(stderr,"\nusage: %s\n", usage_message);
-		exit(error);
-		}
-
-	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       argc:      %d\n",argc);
-		for (i=0;i<argc;i++)
-			fprintf(stderr,"dbg2       argv[%d]:    %s\n",
-				i,argv[i]);
-		}
-
-	/* if file specified then use it */
-	if (fileflag > 0)
-		{
-	        status = mbnavadjust_file_open(ifile);
-    		do_update_status();
-		}
-
-	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbnavadjust_set_colors(int ncol, int *pixels)
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_set_colors";
-	int	status = MB_SUCCESS;
-	int	i;
-
-	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       ncolors:      %d\n",ncol);
-		for (i=0;i<ncol;i++)
-			fprintf(stderr,"dbg2       pixel[%d]:     %d\n",
-				i, pixels[i]);
-		}
-
-	/* set colors */
-	ncolors = ncol;
-	for (i=0;i<ncolors;i++)
-		pixel_values[i] = pixels[i];
-
-	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbnavadjust_set_borders(int *cn_brdr, int *cr_brdr, int *zc_brdr)
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_set_borders";
-	int	status = MB_SUCCESS;
-	int	i;
-
-	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       cn_brdr:      %d %d %d %d\n",
-			cn_brdr[0], cn_brdr[1], cn_brdr[2], cn_brdr[3]);
-		fprintf(stderr,"dbg2       cr_brdr:      %d %d %d %d\n",
-			cr_brdr[0], cr_brdr[1], cr_brdr[2], cr_brdr[3]);
-		fprintf(stderr,"dbg2       zc_brdr:      %d %d %d %d\n",
-			zc_brdr[0], zc_brdr[1], zc_brdr[2], zc_brdr[3]);
-		}
-
-	/* set borders */
-	for (i=0;i<4;i++)
-		{
-		cont_borders[i] = cn_brdr[i];
-		corr_borders[i] = cr_brdr[i];
-		zoff_borders[i] = zc_brdr[i];
-		}
-
-	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbnavadjust_set_graphics(void *cn_xgid, void *cr_xgid, void *zc_xgid)
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_set_graphics";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       cn_xgid:      %p\n",cn_xgid);
-		fprintf(stderr,"dbg2       cr_xgid:      %p\n",cr_xgid);
-		fprintf(stderr,"dbg2       zc_xgid:      %p\n",zc_xgid);
-		}
-
-	/* set graphics id */
-	pcont_xgid = cn_xgid;
-	pcorr_xgid = cr_xgid;
-	pzoff_xgid = zc_xgid;
-
-	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbnavadjust_file_new(char *projectname)
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_file_new";
-	int	status = MB_SUCCESS;
-	char	*slashptr, *nameptr;
-	struct stat statbuf;
-
-	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       projectname:  %s\n",projectname);
-		}
-
-	/* no new project if one already open */
-	status = MB_SUCCESS;
-	if (project.open == MB_YES)
-		{
-		strcpy(error1,"Unable to create new project!");
-		sprintf(error2,"Project %s",project.name);
-		strcpy(error3,"is already open.");
-		status = MB_FAILURE;
-		}
-
-	/* get filenames and see if they can be generated */
-	else
-		{
-		nameptr = (char *) NULL;
-		slashptr = strrchr(projectname,'/');
-		if (slashptr != (char *) NULL)
-			nameptr = slashptr + 1;
-		else
-			nameptr = projectname;
-		if (strlen(nameptr) > 4
-			&& strcmp(&nameptr[strlen(nameptr)-4],".nvh") == 0)
-			nameptr[strlen(nameptr)-4] = '\0';
-		if (strlen(nameptr) > 0)
-			{
-			strcpy(project.name,nameptr);
-			strncpy(project.path,projectname,
-				strlen(projectname)-strlen(nameptr));
-			strcpy(project.home,project.path);
-			strcat(project.home,project.name);
-			strcat(project.home,".nvh");
-			strcpy(project.datadir,project.path);
-			strcat(project.datadir,project.name);
-			strcat(project.datadir,".dir");
-
-			/* no new project if file or directory already exist */
-			if (stat(project.home,&statbuf) == 0)
-				{
-				strcpy(error1,"Unable to create new project!");
-				strcpy(error2,"Home file already exists.");
-				strcpy(error3," ");
-				if (stat(project.datadir,&statbuf) == 0)
-				sprintf(error3,"Data directory already exists.");
-				status = MB_FAILURE;
-				}
-			else if (stat(project.datadir,&statbuf) == 0)
-				{
-				strcpy(error1,"Unable to create new project!");
-				strcpy(error2,"Data directory already exists.");
-				strcpy(error3," ");
-				status = MB_FAILURE;
-				}
-
-			/* initialize new project */
-			else
-				{
-				/* set values */
-				project.open = MB_YES;
-				project.num_files = 0;
-				project.num_files_alloc = 0;
-				project.files = NULL;
-				project.num_snavs = 0;
-				project.num_pings = 0;
-				project.num_beams = 0;
-				project.num_crossings = 0;
-				project.num_crossings_alloc = 0;
-				project.num_crossings_analyzed = 0;
-				project.num_goodcrossings = 0;
-				project.num_truecrossings = 0;
-				project.num_truecrossings_analyzed = 0;
-				project.crossings = NULL;
-				project.num_ties = 0;
-				project.inversion = MBNA_INVERSION_NONE;
-				project.precision = SIGMA_MINIMUM;
-				project.smoothing = MBNA_SMOOTHING_DEFAULT;
-				project.zoffsetwidth = 5.0;
-
-				/* create data directory */
-#ifdef WIN32
-				if (_mkdir(project.datadir) != 0)
-#else
-				if (mkdir(project.datadir,00775) != 0)
-#endif
-					{
-					strcpy(error1,"Unable to create new project!");
-					strcpy(error2,"Error creating data directory.");
-					strcpy(error3," ");
-					status = MB_FAILURE;
-					}
-
-				/* write home file and other files */
-				else if ((status = mbnavadjust_write_project()) == MB_FAILURE)
-					{
-					strcpy(error1,"Unable to create new project!");
-					strcpy(error2,"Error writing data.");
-					strcpy(error3," ");
-					status = MB_FAILURE;
-					}
-				}
-			}
-		else
- 		  	{
-			strcpy(error1,"Unable to create new project!");
-			strcpy(error2,"No project name was provided.");
-			strcpy(error3," ");
-			status = MB_FAILURE;
-			}
-		}
-
-        /* display error message if needed */
-	if (status == MB_FAILURE)
-		{
-		do_error_dialog(error1, error2, error3);
-		sprintf(message, "%s\n > %s\n", error1, error2);
-		do_info_add(message, MB_YES);
-		}
-	else
-		{
-		/* open log file */
-		sprintf(message, "%s/log.txt", project.datadir);
-		project.logfp = fopen(message, "w");
-
-		/* add info text */
-		sprintf(message,"New project initialized: %s\n > Project home: %s\n",
-			project.name, project.home);
-		do_info_add(message, MB_YES);
-		if (project.logfp != NULL)
-		    {
-		    sprintf(message,"Log file %s/log.txt opened\n",
-			project.datadir);
-		    do_info_add(message, MB_YES);
-		    }
-		else
-		    {
-		    sprintf(message,"Unable to open log file %s/log.txt\n",
-			project.datadir);
-		    do_info_add(message, MB_YES);
-		    }
-		}
-
-	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbnavadjust_file_open(char *projectname)
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_file_open";
-	int	status = MB_SUCCESS;
-	char	*slashptr, *nameptr, *bufptr;
-	struct stat statbuf;
-
-	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       projectname:  %s\n",projectname);
-		}
-
-	/* no new project if one already open */
-	status = MB_SUCCESS;
-	if (project.open == MB_YES)
-		{
-		strcpy(error1,"Unable to open project!");
-		sprintf(error2,"Project %s",project.name);
-		strcpy(error3,"is already open.");
-		status = MB_FAILURE;
-		}
-
-	/* get filenames and see if they can be generated */
-	else
-		{
-		nameptr = (char *) NULL;
-		slashptr = strrchr(projectname,'/');
-		if (slashptr != (char *) NULL)
-			nameptr = slashptr + 1;
-		else
-			nameptr = projectname;
-		if (strlen(nameptr) > 4
-			&& strcmp(&nameptr[strlen(nameptr)-4],".nvh") == 0)
-			nameptr[strlen(nameptr)-4] = '\0';
-fprintf(stderr,"projectname:%s nameptr:%s strlen:%ld\n",projectname,nameptr,strlen(nameptr));
-		if (strlen(nameptr) > 0)
-			{
-			strcpy(project.name,nameptr);
-			if (slashptr != (char *) NULL)
-				{
-				strncpy(project.path,projectname,
-					strlen(projectname)-strlen(nameptr));
-				}
-			else
-				{
-				bufptr = getcwd(project.path, MB_PATH_MAXLINE);
-				strcat(project.path,"/");
-				}
-			strcpy(project.home,project.path);
-			strcat(project.home,project.name);
-			strcat(project.home,".nvh");
-			strcpy(project.datadir,project.path);
-			strcat(project.datadir,project.name);
-			strcat(project.datadir,".dir");
-fprintf(stderr,"In mbnavadjust_file_open: name:%s\npath:%s\nhome:%s\ndatadir:%s\n",
-project.name,project.path,project.home,project.datadir);
-
-			/* cant open unless file or directory already exist */
-			if (stat(project.home,&statbuf) != 0)
-				{
-				strcpy(error1,"Unable to open project!");
-				strcpy(error2,"Home file does not exist.");
-				strcpy(error3," ");
-				if (stat(project.datadir,&statbuf) != 0)
-				sprintf(error3,"Data directory does not exist.");
-				status = MB_FAILURE;
-				}
-			else if (stat(project.datadir,&statbuf) != 0)
-				{
-				strcpy(error1,"Unable to open project!");
-				strcpy(error2,"Data directory does not exist.");
-				strcpy(error3," ");
-				status = MB_FAILURE;
-				}
-
-			/* open project */
-			else
-				{
-				/* set values */
-				project.num_files = 0;
-				project.num_files_alloc = 0;
-				project.files = NULL;
-				project.num_snavs = 0;
-				project.num_pings = 0;
-				project.num_beams = 0;
-				project.num_crossings = 0;
-				project.num_crossings_alloc = 0;
-				project.crossings = NULL;
-				project.num_ties = 0;
-
-				/* read home file and other files */
-				if ((status = mbnavadjust_read_project()) == MB_FAILURE)
-					{
-					strcpy(error1,"Unable to open project!");
-					strcpy(error2,"Error reading data.");
-					strcpy(error3," ");
-					status = MB_FAILURE;
-					}
-				}
-			}
-		else
- 		  	{
-			strcpy(error1,"Unable to open project!");
-			strcpy(error2,"No project name was provided.");
-			strcpy(error3," ");
-			status = MB_FAILURE;
-			}
-		}
-
-        /* display error message if needed */
-	if (status == MB_FAILURE)
-		{
-		do_error_dialog(error1, error2, error3);
-		sprintf(message, "%s\n > %s\n", error1, error2);
-		do_info_add(message, MB_YES);
-		}
-	else
-		{
-		/* open log file */
-		sprintf(message, "%s/log.txt", project.datadir);
-		project.logfp = fopen(message, "a");
-
-		/* add info text */
-		sprintf(message,"Project opened: %s\n > Project home: %s\n > Number of Files: %d\n > Number of Crossings Found: %d\n > Number of Crossings Analyzed: %d\n > Number of Navigation Ties: %d\n",
-			project.name, project.home, project.num_files, project.num_crossings,
-			project.num_crossings_analyzed, project.num_ties);
-		do_info_add(message, MB_YES);
-		if (project.logfp != NULL)
-		    {
-		    sprintf(message,"Log file %s/log.txt opened\n",
-			project.datadir);
-		    do_info_add(message, MB_YES);
-		    }
-		else
-		    {
-		    sprintf(message,"Unable to open log file %s/log.txt\n",
-			project.datadir);
-		    do_info_add(message, MB_YES);
-		    }
-		}
-
-	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbnavadjust_close_project()
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_close_project";
-	int	status = MB_SUCCESS;
-	struct mbna_file *file;
-	int	i;
-
-	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
-
-        /* add info text */
-	sprintf(message,"Project closed: %s\n", project.name);
-	do_info_add(message, MB_YES);
-	if (project.logfp != NULL)
-	    {
-	    sprintf(message,"Log file %s/log.txt closed\n",
-		project.datadir);
-	    do_info_add(message, MB_YES);
-	    }
-
-	/* deallocate memory and reset values */
-	for (i=0;i<project.num_files;i++)
-		{
-		file = &project.files[i];
-		if (file->sections != NULL)
-			mb_freed(mbna_verbose,__FILE__,__LINE__,(void **)&file->sections,&error);
-		}
-	if (project.files != NULL)
-		{
-		free(project.files);
-		project.files = NULL;
-		project.num_files_alloc = 0;
-		}
-	if (project.crossings != NULL)
-		{
-		free(project.crossings);
-		project.crossings = NULL;
-		project.num_crossings_alloc = 0;
-		}
-	if (project.logfp != NULL)
-		{
-		fclose(project.logfp);
-		project.logfp = NULL;
-		}
-
-	/* reset values */
-	project.open = MB_NO;
-	memset(project.name,0,STRING_MAX);
-	strcpy(project.name,"None");
- 	memset(project.path,0,STRING_MAX);
-	memset(project.datadir,0,STRING_MAX);
-	project.num_files = 0;
-	project.num_snavs = 0;
-	project.num_pings = 0;
-	project.num_beams = 0;
-	project.num_crossings = 0;
- 	project.num_crossings_analyzed = 0;
-	project.num_goodcrossings = 0;
-	project.num_truecrossings = 0;
- 	project.num_truecrossings_analyzed = 0;
-	project.num_ties = 0;
- 	project.inversion = MBNA_INVERSION_NONE;
-
-	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbnavadjust_write_project()
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_write_project";
-	int	status = MB_SUCCESS;
-	FILE	*hfp, *xfp, *yfp;
-	struct mbna_file *file, *file_1, *file_2;
-	struct mbna_section *section, *section_1, *section_2;
-	struct mbna_crossing *crossing;
-	struct mbna_tie *tie;
-	char	datalist[STRING_MAX];
-	char	routefile[STRING_MAX];
-	char	routename[STRING_MAX];
-	char	xoffsetfile[STRING_MAX];
-	char	yoffsetfile[STRING_MAX];
-	double	navlon1, navlon2, navlat1, navlat2;
-	int	nroute;
-	int	snav_1, snav_2;
-	int	ncrossings_true = 0;
-	int	ncrossings_gt50 = 0;
-	int	ncrossings_gt25 = 0;
-	int	ncrossings_lt25 = 0;
-	int	ncrossings_fixed = 0;
-	int	nties_unfixed = 0;
-	int	nties_fixed = 0;
-	char	status_char, truecrossing_char;
-	int	routecolor = 1;
-	char	*unknown = "Unknown";
-
-	int	i, j, k, l;
-
-	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
-
-	/* open and write home file */
-	if ((hfp = fopen(project.home,"w")) != NULL)
-		{
-fprintf(stderr,"Writing project %s\n", project.name);
-		right_now = time((time_t *)0);
-		strcpy(date,ctime(&right_now));
-                date[strlen(date)-1] = '\0';
-		if ((user_ptr = getenv("USER")) == NULL)
-			user_ptr = getenv("LOGNAME");
-		if (user_ptr != NULL)
-			strcpy(user,user_ptr);
-		else
-			strcpy(user, "unknown");
-		gethostname(host,MBP_FILENAMESIZE);
-		fprintf(hfp,"##MBNAVADJUST PROJECT\n");
-		fprintf(hfp,"MB-SYSTEM_VERSION\t%s\n",MB_VERSION);
-		fprintf(hfp,"PROGRAM_VERSION\t%s\n",rcs_id);
-		fprintf(hfp,"FILE_VERSION\t3.06\n");
-		fprintf(hfp,"ORIGIN\tGenerated by user <%s> on cpu <%s> at <%s>\n", user,host,date);
-		fprintf(hfp,"NAME\t%s\n",project.name);
-		fprintf(hfp,"PATH\t%s\n",project.path);
-		fprintf(hfp,"HOME\t%s\n",project.home);
-		fprintf(hfp,"DATADIR\t%s\n",project.datadir);
-		fprintf(hfp,"NUMFILES\t%d\n",project.num_files);
-		fprintf(hfp,"NUMBLOCKS\t%d\n",project.num_blocks);
-		fprintf(hfp,"NUMCROSSINGS\t%d\n",project.num_crossings);
-		fprintf(hfp,"SECTIONLENGTH\t%f\n",project.section_length);
-		fprintf(hfp,"SECTIONSOUNDINGS\t%d\n",project.section_soundings);
-		fprintf(hfp,"DECIMATION\t%d\n",project.decimation);
-		fprintf(hfp,"CONTOURINTERVAL\t%f\n",project.cont_int);
-		fprintf(hfp,"COLORINTERVAL\t%f\n",project.col_int);
-		fprintf(hfp,"TICKINTERVAL\t%f\n",project.tick_int);
-		fprintf(hfp,"INVERSION\t%d\n",project.inversion);
-		fprintf(hfp,"SMOOTHING\t%f\n",project.smoothing);
-		fprintf(hfp,"ZOFFSETWIDTH\t%f\n",project.zoffsetwidth);
-		for (i=0;i<project.num_files;i++)
-			{
-			/* write out basic file info */
-			file = &project.files[i];
-			fprintf(hfp,"FILE %4d %4d %4d %4d %4d %13.8f %13.8f %13.8f %4.1f %4.1f %4.1f %4.1f %4d %4d %s\n",
-					i,
-					file->status,
-					file->id,
-					file->format,
-					file->block,
-					file->block_offset_x,
-					file->block_offset_y,
-					file->block_offset_z,
-					file->heading_bias_import,
-					file->roll_bias_import,
-					file->heading_bias,
-					file->roll_bias,
-					file->num_sections,
-					file->output_id,
-					file->file);
-
-			/* write out section info */
-			for (j=0;j<file->num_sections;j++)
-				{
-				section = &file->sections[j];
-				fprintf(hfp,"SECTION %4d %5d %5d %d %d %10.6f %16.6f %16.6f %13.8f %13.8f %13.8f %13.8f %9.3f %9.3f %d\n",
-						j,
-						section->num_pings,
-						section->num_beams,
-						section->num_snav,
-						section->continuity,
-						section->distance,
-						section->btime_d,
-						section->etime_d,
-						section->lonmin,
-						section->lonmax,
-						section->latmin,
-						section->latmax,
-						section->depthmin,
-						section->depthmax,
-						section->contoursuptodate);
-				for (k=MBNA_MASK_DIM-1;k>=0;k--)
-				    {
-				    for (l=0;l<MBNA_MASK_DIM;l++)
-					{
-					fprintf(hfp, "%1d", section->coverage[l+k*MBNA_MASK_DIM]);
-					}
-				    fprintf(hfp, "\n");
-				    }
-				for (k=0;k<section->num_snav;k++)
-				    {
-				    fprintf(hfp,"SNAV %4d %5d %10.6f %16.6f %13.8f %13.8f %13.8f %13.8f %13.8f\n",
-						k,
-						section->snav_id[k],
-						section->snav_distance[k],
-						section->snav_time_d[k],
-						section->snav_lon[k],
-						section->snav_lat[k],
-						section->snav_lon_offset[k],
-						section->snav_lat_offset[k],
-						section->snav_z_offset[k]);
-				    }
-				fprintf(hfp,"GLOBALTIE %2d %4d %13.8f %13.8f %13.8f %13.8f %13.8f %13.8f\n",
-						section->global_tie_status,
-						section->global_tie_snav,
-						section->global_tie_offset_x,
-						section->global_tie_offset_y,
-						section->global_tie_offset_z_m,
-						section->global_tie_xsigma,
-						section->global_tie_ysigma,
-						section->global_tie_zsigma);
-				}
-			}
-
-		/* write out crossing info */
-		for (i=0;i<project.num_crossings;i++)
-			{
-			/* write out basic crossing info */
-			crossing = &project.crossings[i];
-			fprintf(hfp,"CROSSING %5d %d %d %3d %5d %3d %5d %3d %2d\n",
-				i,
-				crossing->status,
-				crossing->truecrossing,
-				crossing->overlap,
-				crossing->file_id_1,
-				crossing->section_1,
-				crossing->file_id_2,
-				crossing->section_2,
-				crossing->num_ties);
-
-			/* write out tie info */
-			for (j=0;j<crossing->num_ties;j++)
-				{
-				/* write out basic tie info */
-				tie = &crossing->ties[j];
-				fprintf(hfp,"TIE %5d %1d %5d %16.6f %5d %16.6f %13.8f %13.8f %13.8f %1.1d %13.8f %13.8f %13.8f\n",
-					j,
-					tie->status,
-					tie->snav_1,
-					tie->snav_1_time_d,
-					tie->snav_2,
-					tie->snav_2_time_d,
-					tie->offset_x,
-					tie->offset_y,
-					tie->offset_z_m,
-					tie->inversion_status,
-					tie->inversion_offset_x,
-					tie->inversion_offset_y,
-					tie->inversion_offset_z_m);
-				fprintf(hfp,"COV %13.8f %13.8f %13.8f %13.8f %13.8f %13.8f %13.8f %13.8f %13.8f %13.8f %13.8f %13.8f\n",
-					tie->sigmar1,
-					tie->sigmax1[0],
-					tie->sigmax1[1],
-					tie->sigmax1[2],
-					tie->sigmar2,
-					tie->sigmax2[0],
-					tie->sigmax2[1],
-					tie->sigmax2[2],
-					tie->sigmar3,
-					tie->sigmax3[0],
-					tie->sigmax3[1],
-					tie->sigmax3[2]);
-				}
-			}
-
-		/* close home file */
-		fclose(hfp);
-		status = MB_SUCCESS;
-		}
-
-	/* else set error */
-	else
-		{
-		status = MB_FAILURE;
-		sprintf(message,"Unable to update project %s\n > Home file: %s\n",
-			project.name, project.home);
-		do_info_add(message, MB_YES);
-		}
-
-	/* open and write datalist files */
-	sprintf(datalist,"%s%s.mb-1",project.path,project.name);
-	if ((hfp = fopen(datalist,"w")) != NULL)
-		{
-		for (i=0;i<project.num_files;i++)
-			{
-			/* write file entry */
-			file = &project.files[i];
-			fprintf(hfp,"%s %d\n", file->file, file->format);
-			}
-		fclose(hfp);
-		}
-	sprintf(datalist,"%s/%s.dir/datalist_unfixed.mb-1",project.path,project.name);
-	if ((hfp = fopen(datalist,"w")) != NULL)
-		{
-		for (i=0;i<project.num_files;i++)
-			{
-			/* write file entry for each unfixed file */
-			if (project.files[i].status != MBNA_FILE_FIXEDNAV)
-				{
-				file = &project.files[i];
-				fprintf(hfp,"../%s %d\n", file->file, file->format);
-				}
-			}
-		fclose(hfp);
-		}
-	sprintf(datalist,"%s/%s.dir/datalist_fixed.mb-1",project.path,project.name);
-	if ((hfp = fopen(datalist,"w")) != NULL)
-		{
-		for (i=0;i<project.num_files;i++)
-			{
-			/* write file entry for each unfixed file */
-			if (project.files[i].status == MBNA_FILE_FIXEDNAV)
-				{
-				file = &project.files[i];
-				fprintf(hfp,"../%s %d\n", file->file, file->format);
-				}
-			}
-		fclose(hfp);
-		}
-
-	/* write mbgrdviz route files in which each tie point or crossing is a two point route
-		consisting of the connected snav points
-		- output several different route files
-		- route files of ties (fixed and unfixed separate) represent each tie as a
-			two point route consisting of the connected snav points
-		- route files of crossings (<25%, >= 25% && < 50%, >= 50%, true crossings)
-			represent each crossing as a two point route consisting of the central
-			snav points for each of the two sections.
-		- first count different types of crossings and ties to output as routes
-		- then output each time of route file */
-	ncrossings_true = 0;
-	ncrossings_gt50 = 0;
-	ncrossings_gt25 = 0;
-	ncrossings_lt25 = 0;
-	ncrossings_fixed = 0;
-	nties_unfixed = 0;
-	nties_fixed = 0;
-	for (i=0;i<project.num_crossings;i++)
-		{
-		crossing = &project.crossings[i];
-		
-		/* check all crossings */
-		if (project.files[crossing->file_id_1].status == MBNA_FILE_FIXEDNAV
-			    || project.files[crossing->file_id_2].status == MBNA_FILE_FIXEDNAV)
-			ncrossings_fixed++;
-		else
-			{
-			if (crossing->truecrossing == MB_YES)
-				ncrossings_true++;
-			else if (crossing->overlap >= 50)
-				ncrossings_gt50++;
-			else if (crossing->overlap >= 25)
-				ncrossings_gt25++;
-			else
-				ncrossings_lt25++;
-			}
-    
-		/* check ties */
-		if (crossing->status == MBNA_CROSSING_STATUS_SET)
-			{
-			if (project.files[crossing->file_id_1].status == MBNA_FILE_FIXEDNAV
-				|| project.files[crossing->file_id_2].status == MBNA_FILE_FIXEDNAV)
-				nties_fixed += crossing->num_ties;
-			else
-				nties_unfixed += crossing->num_ties;
-			}
-		}		
-
-	/* write mbgrdviz route file for all unfixed true crossings */
-	sprintf(routefile,"%s%s_truecrossing.rte",project.path,project.name);
-	if ((hfp = fopen(routefile,"w")) == NULL)
-		{
-		fclose(hfp);
-		status = MB_FAILURE;
-		error = MB_ERROR_OPEN_FAIL;
-		sprintf(message, " > Unable to open output tie route file %s\n", routefile);
-		do_info_add(message, MB_NO);
-		if (mbna_verbose == 0)
-			fprintf(stderr,"%s",message);
-		}
-	else
-		{
-		/* write the route file header */
-		fprintf(hfp, "## Route File Version %s\n", ROUTE_VERSION);
-		fprintf(hfp, "## Output by Program %s\n",program_name);
-		fprintf(hfp, "## Program Version %s\n",rcs_id);
-		fprintf(hfp, "## MB-System Version %s\n",MB_VERSION);
-		strncpy(date,"\0",25);
-		right_now = time((time_t *)0);
-		strcpy(date,ctime(&right_now));
-                date[strlen(date)-1] = '\0';
-		if ((user_ptr = getenv("USER")) == NULL)
-			if ((user_ptr = getenv("LOGNAME")) == NULL)
-				user_ptr = unknown;
-		gethostname(host,MB_PATH_MAXLINE);
-		fprintf(hfp, "## Run by user <%s> on cpu <%s> at <%s>\n",
-			user_ptr,host,date);
-		fprintf(hfp, "## Number of routes: %d\n",ncrossings_true);
-		fprintf(hfp, "## Route point format:\n");
-		fprintf(hfp, "##   <longitude (deg)> <latitude (deg)> <topography (m)> <waypoint (boolean)>\n");
-
-		/* loop over all crossings */
-		nroute = 0;
-		for (i=0;i<project.num_crossings;i++)
-			{
-			crossing = &project.crossings[i];
-    
-			/* output only unfixed true crossings */
-			if (crossing->truecrossing == MB_YES
-			    && !(project.files[crossing->file_id_1].status == MBNA_FILE_FIXEDNAV
-				    || project.files[crossing->file_id_2].status == MBNA_FILE_FIXEDNAV))
-				{
-				file_1 = (struct mbna_file *) &project.files[crossing->file_id_1];
-				file_2 = (struct mbna_file *) &project.files[crossing->file_id_2];
-				section_1 = (struct mbna_section *) &file_1->sections[crossing->section_1];
-				section_2 = (struct mbna_section *) &file_2->sections[crossing->section_2];
-				snav_1 = section_1->num_snav/2;
-				snav_2 = section_2->num_snav/2;
-				navlon1 = section_1->snav_lon[snav_1] + section_1->snav_lon_offset[snav_1];
-				navlat1 = section_1->snav_lat[snav_1] + section_1->snav_lat_offset[snav_1];
-				navlon2 = section_2->snav_lon[snav_2] + section_2->snav_lon_offset[snav_2];
-				navlat2 = section_2->snav_lat[snav_2] + section_2->snav_lat_offset[snav_2];
-				if (crossing->status == MBNA_CROSSING_STATUS_NONE)
-					{
-					status_char = 'U';
-					routecolor = ROUTE_COLOR_YELLOW;
-					}
-				else if (crossing->status == MBNA_CROSSING_STATUS_SET)
-					{
-					status_char = '*';
-					routecolor = ROUTE_COLOR_GREEN;
-					}
-				else
-					{
-					status_char = '-';
-					routecolor = ROUTE_COLOR_RED;
-					}
-				if (crossing->truecrossing == MB_NO)
-					truecrossing_char = ' ';
-				else
-					truecrossing_char = 'X';
-				sprintf(routename,"%c%c %4d %2.2d:%3.3d:%3.3d %2.2d:%3.3d:%3.3d %3d %2d",
-					status_char, truecrossing_char, i,
-					file_1->block,
-					crossing->file_id_1,
-					crossing->section_1,
-					file_2->block,
-					crossing->file_id_2,
-					crossing->section_2,
-					crossing->overlap,
-					crossing->num_ties);
-				fprintf(hfp,"## ROUTENAME %s\n", routename);
-				fprintf(hfp,"## ROUTESIZE %d\n", 1);
-				fprintf(hfp,"## ROUTECOLOR %d\n", routecolor);
-				fprintf(hfp,"## ROUTEPOINTS %d\n", 2);
-				fprintf(hfp,"## ROUTEEDITMODE %d\n", MB_NO);
-				fprintf(hfp,"> ## STARTROUTE\n");
-				fprintf(hfp,"%.10f %.10f 0.00 1\n%.10f %.10f 0.00 1\n>\n",
-					navlon1,navlat1,navlon2,navlat2);
-				nroute++;
-				}
-			}
-		fclose(hfp);
-fprintf(stderr,"Output %d (expected %d) true crossing locations to %s\n", nroute, ncrossings_true, routefile);
-		}
-
-	/* write mbgrdviz route file for all unfixed >=50% crossings */
-	sprintf(routefile,"%s%s_gt50crossing.rte",project.path,project.name);
-	if ((hfp = fopen(routefile,"w")) == NULL)
-		{
-		fclose(hfp);
-		status = MB_FAILURE;
-		error = MB_ERROR_OPEN_FAIL;
-		sprintf(message, " > Unable to open output tie route file %s\n", routefile);
-		do_info_add(message, MB_NO);
-		if (mbna_verbose == 0)
-			fprintf(stderr,"%s",message);
-		}
-	else
-		{
-		/* write the route file header */
-		fprintf(hfp, "## Route File Version %s\n", ROUTE_VERSION);
-		fprintf(hfp, "## Output by Program %s\n",program_name);
-		fprintf(hfp, "## Program Version %s\n",rcs_id);
-		fprintf(hfp, "## MB-System Version %s\n",MB_VERSION);
-		strncpy(date,"\0",25);
-		right_now = time((time_t *)0);
-		strcpy(date,ctime(&right_now));
-                date[strlen(date)-1] = '\0';
-		if ((user_ptr = getenv("USER")) == NULL)
-			if ((user_ptr = getenv("LOGNAME")) == NULL)
-				user_ptr = unknown;
-		gethostname(host,MB_PATH_MAXLINE);
-		fprintf(hfp, "## Run by user <%s> on cpu <%s> at <%s>\n",
-			user_ptr,host,date);
-		fprintf(hfp, "## Number of routes: %d\n",ncrossings_gt50);
-		fprintf(hfp, "## Route point format:\n");
-		fprintf(hfp, "##   <longitude (deg)> <latitude (deg)> <topography (m)> <waypoint (boolean)>\n");
-
-		/* loop over all crossings */
-		nroute = 0;
-		for (i=0;i<project.num_crossings;i++)
-			{
-			crossing = &project.crossings[i];
-   
-			/* output only unfixed >=50% crossings */
-			if (crossing->overlap >= 50
-			    && !(project.files[crossing->file_id_1].status == MBNA_FILE_FIXEDNAV
-				    || project.files[crossing->file_id_2].status == MBNA_FILE_FIXEDNAV))
-				{
-				file_1 = (struct mbna_file *) &project.files[crossing->file_id_1];
-				file_2 = (struct mbna_file *) &project.files[crossing->file_id_2];
-				section_1 = (struct mbna_section *) &file_1->sections[crossing->section_1];
-				section_2 = (struct mbna_section *) &file_2->sections[crossing->section_2];
-				snav_1 = section_1->num_snav/2;
-				snav_2 = section_2->num_snav/2;
-				navlon1 = section_1->snav_lon[snav_1] + section_1->snav_lon_offset[snav_1];
-				navlat1 = section_1->snav_lat[snav_1] + section_1->snav_lat_offset[snav_1];
-				navlon2 = section_2->snav_lon[snav_2] + section_2->snav_lon_offset[snav_2];
-				navlat2 = section_2->snav_lat[snav_2] + section_2->snav_lat_offset[snav_2];
-				if (crossing->status == MBNA_CROSSING_STATUS_NONE)
-					{
-					status_char = 'U';
-					routecolor = ROUTE_COLOR_YELLOW;
-					}
-				else if (crossing->status == MBNA_CROSSING_STATUS_SET)
-					{
-					status_char = '*';
-					routecolor = ROUTE_COLOR_GREEN;
-					}
-				else
-					{
-					status_char = '-';
-					routecolor = ROUTE_COLOR_RED;
-					}
-				if (crossing->truecrossing == MB_NO)
-					truecrossing_char = ' ';
-				else
-					truecrossing_char = 'X';
-				sprintf(routename,"%c%c %4d %2.2d:%3.3d:%3.3d %2.2d:%3.3d:%3.3d %3d %2d",
-					status_char, truecrossing_char, i,
-					file_1->block,
-					crossing->file_id_1,
-					crossing->section_1,
-					file_2->block,
-					crossing->file_id_2,
-					crossing->section_2,
-					crossing->overlap,
-					crossing->num_ties);
-				fprintf(hfp,"## ROUTENAME %s\n", routename);
-				fprintf(hfp,"## ROUTESIZE %d\n", 1);
-				fprintf(hfp,"## ROUTECOLOR %d\n", routecolor);
-				fprintf(hfp,"## ROUTEPOINTS %d\n", 2);
-				fprintf(hfp,"## ROUTEEDITMODE %d\n", MB_NO);
-				fprintf(hfp,"> ## STARTROUTE\n");
-				fprintf(hfp,"%.10f %.10f 0.00 1\n%.10f %.10f 0.00 1\n>\n",
-					navlon1,navlat1,navlon2,navlat2);
-				nroute++;
-				}
-			}
-		fclose(hfp);
-fprintf(stderr,"Output %d (expected %d) >=50%% overlap crossing locations to %s\n", nroute, ncrossings_gt50, routefile);
-		}
-
-	/* write mbgrdviz route file for all unfixed >=25% but less than 50% crossings */
-	sprintf(routefile,"%s%s_gt25crossing.rte",project.path,project.name);
-	if ((hfp = fopen(routefile,"w")) == NULL)
-		{
-		fclose(hfp);
-		status = MB_FAILURE;
-		error = MB_ERROR_OPEN_FAIL;
-		sprintf(message, " > Unable to open output tie route file %s\n", routefile);
-		do_info_add(message, MB_NO);
-		if (mbna_verbose == 0)
-			fprintf(stderr,"%s",message);
-		}
-	else
-		{
-		/* write the route file header */
-		fprintf(hfp, "## Route File Version %s\n", ROUTE_VERSION);
-		fprintf(hfp, "## Output by Program %s\n",program_name);
-		fprintf(hfp, "## Program Version %s\n",rcs_id);
-		fprintf(hfp, "## MB-System Version %s\n",MB_VERSION);
-		strncpy(date,"\0",25);
-		right_now = time((time_t *)0);
-		strcpy(date,ctime(&right_now));
-                date[strlen(date)-1] = '\0';
-		if ((user_ptr = getenv("USER")) == NULL)
-			if ((user_ptr = getenv("LOGNAME")) == NULL)
-				user_ptr = unknown;
-		gethostname(host,MB_PATH_MAXLINE);
-		fprintf(hfp, "## Run by user <%s> on cpu <%s> at <%s>\n",
-			user_ptr,host,date);
-		fprintf(hfp, "## Number of routes: %d\n",ncrossings_gt25);
-		fprintf(hfp, "## Route point format:\n");
-		fprintf(hfp, "##   <longitude (deg)> <latitude (deg)> <topography (m)> <waypoint (boolean)>\n");
-
-		/* loop over all crossings */
-		nroute = 0;
-		for (i=0;i<project.num_crossings;i++)
-			{
-			crossing = &project.crossings[i];
-    
-			/* output only unfixed >=25% but less than 50% crossings crossings */
-			if (crossing->overlap >= 25
-			    && !(project.files[crossing->file_id_1].status == MBNA_FILE_FIXEDNAV
-				    || project.files[crossing->file_id_2].status == MBNA_FILE_FIXEDNAV))
-				{
-				file_1 = (struct mbna_file *) &project.files[crossing->file_id_1];
-				file_2 = (struct mbna_file *) &project.files[crossing->file_id_2];
-				section_1 = (struct mbna_section *) &file_1->sections[crossing->section_1];
-				section_2 = (struct mbna_section *) &file_2->sections[crossing->section_2];
-				snav_1 = section_1->num_snav/2;
-				snav_2 = section_2->num_snav/2;
-				navlon1 = section_1->snav_lon[snav_1] + section_1->snav_lon_offset[snav_1];
-				navlat1 = section_1->snav_lat[snav_1] + section_1->snav_lat_offset[snav_1];
-				navlon2 = section_2->snav_lon[snav_2] + section_2->snav_lon_offset[snav_2];
-				navlat2 = section_2->snav_lat[snav_2] + section_2->snav_lat_offset[snav_2];
-				if (crossing->status == MBNA_CROSSING_STATUS_NONE)
-					{
-					status_char = 'U';
-					routecolor = ROUTE_COLOR_YELLOW;
-					}
-				else if (crossing->status == MBNA_CROSSING_STATUS_SET)
-					{
-					status_char = '*';
-					routecolor = ROUTE_COLOR_GREEN;
-					}
-				else
-					{
-					status_char = '-';
-					routecolor = ROUTE_COLOR_RED;
-					}
-				if (crossing->truecrossing == MB_NO)
-					truecrossing_char = ' ';
-				else
-					truecrossing_char = 'X';
-				sprintf(routename,"%c%c %4d %2.2d:%3.3d:%3.3d %2.2d:%3.3d:%3.3d %3d %2d",
-					status_char, truecrossing_char, i,
-					file_1->block,
-					crossing->file_id_1,
-					crossing->section_1,
-					file_2->block,
-					crossing->file_id_2,
-					crossing->section_2,
-					crossing->overlap,
-					crossing->num_ties);
-				fprintf(hfp,"## ROUTENAME %s\n", routename);
-				fprintf(hfp,"## ROUTESIZE %d\n", 1);
-				fprintf(hfp,"## ROUTECOLOR %d\n", routecolor);
-				fprintf(hfp,"## ROUTEPOINTS %d\n", 2);
-				fprintf(hfp,"## ROUTEEDITMODE %d\n", MB_NO);
-				fprintf(hfp,"> ## STARTROUTE\n");
-				fprintf(hfp,"%.10f %.10f 0.00 1\n%.10f %.10f 0.00 1\n>\n",
-					navlon1,navlat1,navlon2,navlat2);
-				nroute++;
-				}
-			}
-		fclose(hfp);
-fprintf(stderr,"Output %d (expected %d) >=25%% && < 50%% overlap crossing locations to %s\n", nroute, ncrossings_gt25, routefile);
-		}
-
-	/* write mbgrdviz route file for all unfixed <25% crossings */
-	sprintf(routefile,"%s%s_lt25crossing.rte",project.path,project.name);
-	if ((hfp = fopen(routefile,"w")) == NULL)
-		{
-		fclose(hfp);
-		status = MB_FAILURE;
-		error = MB_ERROR_OPEN_FAIL;
-		sprintf(message, " > Unable to open output tie route file %s\n", routefile);
-		do_info_add(message, MB_NO);
-		if (mbna_verbose == 0)
-			fprintf(stderr,"%s",message);
-		}
-	else
-		{
-		/* write the route file header */
-		fprintf(hfp, "## Route File Version %s\n", ROUTE_VERSION);
-		fprintf(hfp, "## Output by Program %s\n",program_name);
-		fprintf(hfp, "## Program Version %s\n",rcs_id);
-		fprintf(hfp, "## MB-System Version %s\n",MB_VERSION);
-		strncpy(date,"\0",25);
-		right_now = time((time_t *)0);
-		strcpy(date,ctime(&right_now));
-                date[strlen(date)-1] = '\0';
-		if ((user_ptr = getenv("USER")) == NULL)
-			if ((user_ptr = getenv("LOGNAME")) == NULL)
-				user_ptr = unknown;
-		gethostname(host,MB_PATH_MAXLINE);
-		fprintf(hfp, "## Run by user <%s> on cpu <%s> at <%s>\n",
-			user_ptr,host,date);
-		fprintf(hfp, "## Number of routes: %d\n",ncrossings_lt25);
-		fprintf(hfp, "## Route point format:\n");
-		fprintf(hfp, "##   <longitude (deg)> <latitude (deg)> <topography (m)> <waypoint (boolean)>\n");
-
-		/* loop over all crossings */
-		nroute = 0;
-		for (i=0;i<project.num_crossings;i++)
-			{
-			crossing = &project.crossings[i];
-    
-			/* output only unfixed <25% crossings crossings */
-			if (crossing->overlap < 25
-			    && !(project.files[crossing->file_id_1].status == MBNA_FILE_FIXEDNAV
-				    || project.files[crossing->file_id_2].status == MBNA_FILE_FIXEDNAV))
-				{
-				file_1 = (struct mbna_file *) &project.files[crossing->file_id_1];
-				file_2 = (struct mbna_file *) &project.files[crossing->file_id_2];
-				section_1 = (struct mbna_section *) &file_1->sections[crossing->section_1];
-				section_2 = (struct mbna_section *) &file_2->sections[crossing->section_2];
-				snav_1 = section_1->num_snav/2;
-				snav_2 = section_2->num_snav/2;
-				navlon1 = section_1->snav_lon[snav_1] + section_1->snav_lon_offset[snav_1];
-				navlat1 = section_1->snav_lat[snav_1] + section_1->snav_lat_offset[snav_1];
-				navlon2 = section_2->snav_lon[snav_2] + section_2->snav_lon_offset[snav_2];
-				navlat2 = section_2->snav_lat[snav_2] + section_2->snav_lat_offset[snav_2];
-				if (crossing->status == MBNA_CROSSING_STATUS_NONE)
-					{
-					status_char = 'U';
-					routecolor = ROUTE_COLOR_YELLOW;
-					}
-				else if (crossing->status == MBNA_CROSSING_STATUS_SET)
-					{
-					status_char = '*';
-					routecolor = ROUTE_COLOR_GREEN;
-					}
-				else
-					{
-					status_char = '-';
-					routecolor = ROUTE_COLOR_RED;
-					}
-				if (crossing->truecrossing == MB_NO)
-					truecrossing_char = ' ';
-				else
-					truecrossing_char = 'X';
-				sprintf(routename,"%c%c %4d %2.2d:%3.3d:%3.3d %2.2d:%3.3d:%3.3d %3d %2d",
-					status_char, truecrossing_char, i,
-					file_1->block,
-					crossing->file_id_1,
-					crossing->section_1,
-					file_2->block,
-					crossing->file_id_2,
-					crossing->section_2,
-					crossing->overlap,
-					crossing->num_ties);
-				fprintf(hfp,"## ROUTENAME %s\n", routename);
-				fprintf(hfp,"## ROUTESIZE %d\n", 1);
-				fprintf(hfp,"## ROUTECOLOR %d\n", routecolor);
-				fprintf(hfp,"## ROUTEPOINTS %d\n", 2);
-				fprintf(hfp,"## ROUTEEDITMODE %d\n", MB_NO);
-				fprintf(hfp,"> ## STARTROUTE\n");
-				fprintf(hfp,"%.10f %.10f 0.00 1\n%.10f %.10f 0.00 1\n>\n",
-					navlon1,navlat1,navlon2,navlat2);
-				nroute++;
-				}
-			}
-		fclose(hfp);
-fprintf(stderr,"Output %d (expected %d) <25%% overlap crossing locations to %s\n", nroute, ncrossings_lt25, routefile);
-		}
-
-	/* write mbgrdviz route file for all fixed crossings */
-	sprintf(routefile,"%s%s_fixedcrossing.rte",project.path,project.name);
-	if ((hfp = fopen(routefile,"w")) == NULL)
-		{
-		fclose(hfp);
-		status = MB_FAILURE;
-		error = MB_ERROR_OPEN_FAIL;
-		sprintf(message, " > Unable to open output fixed crossings route file %s\n", routefile);
-		do_info_add(message, MB_NO);
-		if (mbna_verbose == 0)
-			fprintf(stderr,"%s",message);
-		}
-	else
-		{
-		/* write the route file header */
-		fprintf(hfp, "## Route File Version %s\n", ROUTE_VERSION);
-		fprintf(hfp, "## Output by Program %s\n",program_name);
-		fprintf(hfp, "## Program Version %s\n",rcs_id);
-		fprintf(hfp, "## MB-System Version %s\n",MB_VERSION);
-		strncpy(date,"\0",25);
-		right_now = time((time_t *)0);
-		strcpy(date,ctime(&right_now));
-                date[strlen(date)-1] = '\0';
-		if ((user_ptr = getenv("USER")) == NULL)
-			if ((user_ptr = getenv("LOGNAME")) == NULL)
-				user_ptr = unknown;
-		gethostname(host,MB_PATH_MAXLINE);
-		fprintf(hfp, "## Run by user <%s> on cpu <%s> at <%s>\n",
-			user_ptr,host,date);
-		fprintf(hfp, "## Number of routes: %d\n",ncrossings_fixed);
-		fprintf(hfp, "## Route point format:\n");
-		fprintf(hfp, "##   <longitude (deg)> <latitude (deg)> <topography (m)> <waypoint (boolean)>\n");
-
-		/* loop over all crossings */
-		nroute = 0;
-		for (i=0;i<project.num_crossings;i++)
-			{
-			crossing = &project.crossings[i];
-  
-			/* output only fixed crossings */
-			if (project.files[crossing->file_id_1].status == MBNA_FILE_FIXEDNAV
-				    || project.files[crossing->file_id_2].status == MBNA_FILE_FIXEDNAV)
-				{
-				file_1 = (struct mbna_file *) &project.files[crossing->file_id_1];
-				file_2 = (struct mbna_file *) &project.files[crossing->file_id_2];
-				section_1 = (struct mbna_section *) &file_1->sections[crossing->section_1];
-				section_2 = (struct mbna_section *) &file_2->sections[crossing->section_2];
-				snav_1 = section_1->num_snav/2;
-				snav_2 = section_2->num_snav/2;
-				navlon1 = section_1->snav_lon[snav_1] + section_1->snav_lon_offset[snav_1];
-				navlat1 = section_1->snav_lat[snav_1] + section_1->snav_lat_offset[snav_1];
-				navlon2 = section_2->snav_lon[snav_2] + section_2->snav_lon_offset[snav_2];
-				navlat2 = section_2->snav_lat[snav_2] + section_2->snav_lat_offset[snav_2];
-				if (crossing->status == MBNA_CROSSING_STATUS_NONE)
-					{
-					status_char = 'U';
-					routecolor = ROUTE_COLOR_YELLOW;
-					}
-				else if (crossing->status == MBNA_CROSSING_STATUS_SET)
-					{
-					status_char = '*';
-					routecolor = ROUTE_COLOR_GREEN;
-					}
-				else
-					{
-					status_char = '-';
-					routecolor = ROUTE_COLOR_RED;
-					}
-				if (crossing->truecrossing == MB_NO)
-					truecrossing_char = ' ';
-				else
-					truecrossing_char = 'X';
-				sprintf(routename,"%c%c %4d %2.2d:%3.3d:%3.3d %2.2d:%3.3d:%3.3d %3d %2d",
-					status_char, truecrossing_char, i,
-					file_1->block,
-					crossing->file_id_1,
-					crossing->section_1,
-					file_2->block,
-					crossing->file_id_2,
-					crossing->section_2,
-					crossing->overlap,
-					crossing->num_ties);
-				fprintf(hfp,"## ROUTENAME %s\n", routename);
-				fprintf(hfp,"## ROUTESIZE %d\n", 1);
-				fprintf(hfp,"## ROUTECOLOR %d\n", routecolor);
-				fprintf(hfp,"## ROUTEPOINTS %d\n", 2);
-				fprintf(hfp,"## ROUTEEDITMODE %d\n", MB_NO);
-				fprintf(hfp,"> ## STARTROUTE\n");
-				fprintf(hfp,"%.10f %.10f 0.00 1\n%.10f %.10f 0.00 1\n>\n",
-					navlon1,navlat1,navlon2,navlat2);
-				nroute++;
-				}
-			}
-		fclose(hfp);
-fprintf(stderr,"Output %d (expected %d) fixed crossing locations to %s\n", nroute, ncrossings_fixed, routefile);
-		}
-
-	/* write mbgrdviz route file for all unfixed ties */
-	sprintf(routefile,"%s%s_unfixedties.rte",project.path,project.name);
-	if ((hfp = fopen(routefile,"w")) == NULL)
-		{
-		fclose(hfp);
-		status = MB_FAILURE;
-		error = MB_ERROR_OPEN_FAIL;
-		sprintf(message, " > Unable to open output unfixed ties route file %s\n", routefile);
-		do_info_add(message, MB_NO);
-		if (mbna_verbose == 0)
-			fprintf(stderr,"%s",message);
-		}
-	else
-		{
-		/* write the route file header */
-		fprintf(hfp, "## Route File Version %s\n", ROUTE_VERSION);
-		fprintf(hfp, "## Output by Program %s\n",program_name);
-		fprintf(hfp, "## Program Version %s\n",rcs_id);
-		fprintf(hfp, "## MB-System Version %s\n",MB_VERSION);
-		strncpy(date,"\0",25);
-		right_now = time((time_t *)0);
-		strcpy(date,ctime(&right_now));
-                date[strlen(date)-1] = '\0';
-		if ((user_ptr = getenv("USER")) == NULL)
-			if ((user_ptr = getenv("LOGNAME")) == NULL)
-				user_ptr = unknown;
-		gethostname(host,MB_PATH_MAXLINE);
-		fprintf(hfp, "## Run by user <%s> on cpu <%s> at <%s>\n",
-			user_ptr,host,date);
-		fprintf(hfp, "## Number of routes: %d\n",nties_unfixed);
-		fprintf(hfp, "## Route point format:\n");
-		fprintf(hfp, "##   <longitude (deg)> <latitude (deg)> <topography (m)> <waypoint (boolean)>\n");
-		routecolor = ROUTE_COLOR_BLUEGREEN;
-
-		/* loop over all crossings */
-		nroute = 0;
-		for (i=0;i<project.num_crossings;i++)
-			{
-			crossing = &project.crossings[i];
-   
-			/* output only unfixed ties */
-			if (crossing->status == MBNA_CROSSING_STATUS_SET
-				&& !(project.files[crossing->file_id_1].status == MBNA_FILE_FIXEDNAV
-					|| project.files[crossing->file_id_2].status == MBNA_FILE_FIXEDNAV))
-				{
-				for (j=0;j<crossing->num_ties;j++)
-					{
-					file_1 = (struct mbna_file *) &project.files[crossing->file_id_1];
-					file_2 = (struct mbna_file *) &project.files[crossing->file_id_2];
-					section_1 = (struct mbna_section *) &file_1->sections[crossing->section_1];
-					section_2 = (struct mbna_section *) &file_2->sections[crossing->section_2];
-					tie = (struct mbna_tie *) &crossing->ties[j];
-					snav_1 = tie->snav_1;
-					snav_2 = tie->snav_2;
-					navlon1 = section_1->snav_lon[snav_1] + section_1->snav_lon_offset[snav_1];
-					navlat1 = section_1->snav_lat[snav_1] + section_1->snav_lat_offset[snav_1];
-					navlon2 = section_2->snav_lon[snav_2] + section_2->snav_lon_offset[snav_2];
-					navlat2 = section_2->snav_lat[snav_2] + section_2->snav_lat_offset[snav_2];
-					if (crossing->status == MBNA_CROSSING_STATUS_NONE)
-						status_char = 'U';
-					else if (crossing->status == MBNA_CROSSING_STATUS_SET)
-						status_char = '*';
-					else
-						status_char = '-';
-					if (crossing->truecrossing == MB_NO)
-						truecrossing_char = ' ';
-					else
-						truecrossing_char = 'X';
-					sprintf(routename,"Tie: %c%c %4d %2.2d:%3.3d:%3.3d %2.2d:%3.3d:%3.3d %3d %2d of %2d",
-						status_char, truecrossing_char, i,
-						file_1->block,
-						crossing->file_id_1,
-						crossing->section_1,
-						file_2->block,
-						crossing->file_id_2,
-						crossing->section_2,
-						crossing->overlap,
-						j, crossing->num_ties);
-					fprintf(hfp,"## ROUTENAME %s\n", routename);
-					fprintf(hfp,"## ROUTESIZE %d\n", 1);
-					fprintf(hfp,"## ROUTECOLOR %d\n", routecolor);
-					fprintf(hfp,"## ROUTEPOINTS %d\n", 2);
-					fprintf(hfp,"## ROUTEEDITMODE %d\n", MB_NO);
-					fprintf(hfp,"> ## STARTROUTE\n");
-					fprintf(hfp,"%.10f %.10f 0.00 1\n%.10f %.10f 0.00 1\n>\n",
-						navlon1,navlat1,navlon2,navlat2);
-					nroute++;
-					}
-				}
-			}
-		fclose(hfp);
-fprintf(stderr,"Output %d (expected %d) unfixed tie locations to %s\n", nroute, nties_unfixed, routefile);
-		}
-
-	/* write mbgrdviz route file for all fixed ties */
-	sprintf(routefile,"%s%s_fixedties.rte",project.path,project.name);
-	if ((hfp = fopen(routefile,"w")) == NULL)
-		{
-		fclose(hfp);
-		status = MB_FAILURE;
-		error = MB_ERROR_OPEN_FAIL;
-		sprintf(message, " > Unable to open output fixed ties route file %s\n", routefile);
-		do_info_add(message, MB_NO);
-		if (mbna_verbose == 0)
-			fprintf(stderr,"%s",message);
-		}
-	else
-		{
-		/* write the route file header */
-		fprintf(hfp, "## Route File Version %s\n", ROUTE_VERSION);
-		fprintf(hfp, "## Output by Program %s\n",program_name);
-		fprintf(hfp, "## Program Version %s\n",rcs_id);
-		fprintf(hfp, "## MB-System Version %s\n",MB_VERSION);
-		strncpy(date,"\0",25);
-		right_now = time((time_t *)0);
-		strcpy(date,ctime(&right_now));
-                date[strlen(date)-1] = '\0';
-		if ((user_ptr = getenv("USER")) == NULL)
-			if ((user_ptr = getenv("LOGNAME")) == NULL)
-				user_ptr = unknown;
-		gethostname(host,MB_PATH_MAXLINE);
-		fprintf(hfp, "## Run by user <%s> on cpu <%s> at <%s>\n",
-			user_ptr,host,date);
-		fprintf(hfp, "## Number of routes: %d\n",nties_fixed);
-		fprintf(hfp, "## Route point format:\n");
-		fprintf(hfp, "##   <longitude (deg)> <latitude (deg)> <topography (m)> <waypoint (boolean)>\n");
-		routecolor = ROUTE_COLOR_RED;
-
-		/* loop over all crossings */
-		nroute = 0;
-		for (i=0;i<project.num_crossings;i++)
-			{
-			crossing = &project.crossings[i];
-   
-			/* output only fixed ties */
-			if (crossing->status == MBNA_CROSSING_STATUS_SET
-				&& (project.files[crossing->file_id_1].status == MBNA_FILE_FIXEDNAV
-					|| project.files[crossing->file_id_2].status == MBNA_FILE_FIXEDNAV))
-				{
-				for (j=0;j<crossing->num_ties;j++)
-					{
-					file_1 = (struct mbna_file *) &project.files[crossing->file_id_1];
-					file_2 = (struct mbna_file *) &project.files[crossing->file_id_2];
-					section_1 = (struct mbna_section *) &file_1->sections[crossing->section_1];
-					section_2 = (struct mbna_section *) &file_2->sections[crossing->section_2];
-					tie = (struct mbna_tie *) &crossing->ties[j];
-					snav_1 = tie->snav_1;
-					snav_2 = tie->snav_2;
-					navlon1 = section_1->snav_lon[snav_1] + section_1->snav_lon_offset[snav_1];
-					navlat1 = section_1->snav_lat[snav_1] + section_1->snav_lat_offset[snav_1];
-					navlon2 = section_2->snav_lon[snav_2] + section_2->snav_lon_offset[snav_2];
-					navlat2 = section_2->snav_lat[snav_2] + section_2->snav_lat_offset[snav_2];
-					if (crossing->status == MBNA_CROSSING_STATUS_NONE)
-						status_char = 'U';
-					else if (crossing->status == MBNA_CROSSING_STATUS_SET)
-						status_char = '*';
-					else
-						status_char = '-';
-					if (crossing->truecrossing == MB_NO)
-						truecrossing_char = ' ';
-					else
-						truecrossing_char = 'X';
-					sprintf(routename,"Tie: %c%c %4d %2.2d:%3.3d:%3.3d %2.2d:%3.3d:%3.3d %3d %2d of %2d",
-						status_char, truecrossing_char, i,
-						file_1->block,
-						crossing->file_id_1,
-						crossing->section_1,
-						file_2->block,
-						crossing->file_id_2,
-						crossing->section_2,
-						crossing->overlap,
-						j, crossing->num_ties);
-					fprintf(hfp,"## ROUTENAME %s\n", routename);
-					fprintf(hfp,"## ROUTESIZE %d\n", 1);
-					fprintf(hfp,"## ROUTECOLOR %d\n", routecolor);
-					fprintf(hfp,"## ROUTEPOINTS %d\n", 2);
-					fprintf(hfp,"## ROUTEEDITMODE %d\n", MB_NO);
-					fprintf(hfp,"> ## STARTROUTE\n");
-					fprintf(hfp,"%.10f %.10f 0.00 1\n%.10f %.10f 0.00 1\n>\n",
-						navlon1,navlat1,navlon2,navlat2);
-					nroute++;
-					}
-				}
-			}
-		fclose(hfp);
-fprintf(stderr,"Output %d (expected %d) fixed tie locations to %s\n", nroute, nties_fixed, routefile);
-		}
-
-	/* output offset vectors */
-	if (project.inversion == MBNA_INVERSION_CURRENT)
-		{
-		sprintf(xoffsetfile,"%s%s_dx.txt",project.path,project.name);
-		sprintf(yoffsetfile,"%s%s_dy.txt",project.path,project.name);
-		if ((xfp = fopen(xoffsetfile,"w")) != NULL
-		    && (yfp = fopen(yoffsetfile,"w")) != NULL)
-			{
-			for (i=0;i<project.num_files;i++)
-			    {
-			    file = &project.files[i];
-			    for (j=0;j<file->num_sections;j++)
-				{
-				section = &file->sections[j];
-				for (k=0;k<section->num_snav;k++)
-				    {
-				    fprintf(xfp, "%.10f %.10f %.10f\n", section->snav_lon[k], section->snav_lat[k],
-								section->snav_lon_offset[k]/mbna_mtodeglon);
-				    fprintf(yfp, "%.10f %.10f %.10f\n", section->snav_lon[k], section->snav_lat[k],
-								section->snav_lat_offset[k]/mbna_mtodeglat);
-				    }
-				}
-			    }
-			fclose(xfp);
-			fclose(yfp);
-			}
-
-		/* else set error */
-		else
-			{
-			status = MB_FAILURE;
-			sprintf(message,"Unable to update project %s\n > Offset vector files: %s %s\n",
-				project.name, xoffsetfile, yoffsetfile);
-			do_info_add(message, MB_YES);
-			}
-		}
-
-	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbnavadjust_read_project()
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_read_project";
-	int	status = MB_SUCCESS;
-	FILE	*hfp;
-	struct mbna_file *file;
-	struct mbna_section *section, *section1, *section2;
-	struct mbna_crossing *crossing;
-	struct mbna_tie *tie;
-	char	label[STRING_MAX];
-	char	buffer[BUFFER_MAX];
-	char	obuffer[BUFFER_MAX];
-	char	command[MB_PATH_MAXLINE];
-	char	*result;
-	int	versionmajor, versionminor, version_id;
-	double	dummy;
-	double	mtodeglon, mtodeglat;
-	int	nscan, idummy, jdummy;
-	int	s1id, s2id;
-	int	shellstatus;
-	int	i, j, k, l;
-
-	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
-
-	/* first save copy of the project file */
-	sprintf(command,"cp %s %s.save", project.home, project.home);
-	shellstatus = system(command);
-
-	/* open and read home file */
-	status = MB_SUCCESS;
-	if ((hfp = fopen(project.home,"r")) != NULL)
-		{
-		/* check for proper header */
-		if ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
-			|| strncmp(buffer,"##MBNAVADJUST PROJECT",21) != 0)
-			status = MB_FAILURE;
-if (status == MB_FAILURE){fprintf(stderr,"Die at line:%d file:%s buffer:%s\n",__LINE__,__FILE__,buffer);exit(0);}
-
-		/* read basic names and stats */
-		if (status == MB_SUCCESS
-			&& ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
-				|| (nscan = sscanf(buffer,"%s %s",label,obuffer)) != 2
-			    	|| strcmp(label,"MB-SYSTEM_VERSION") != 0))
-			status = MB_FAILURE;
-if (status == MB_FAILURE){fprintf(stderr,"Die at line:%d file:%s buffer:%s\n",__LINE__,__FILE__,buffer);exit(0);}
-
-		if (status == MB_SUCCESS
-			&& ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
-				|| (nscan = sscanf(buffer,"%s %s",label,obuffer)) != 2
-				|| strcmp(label,"PROGRAM_VERSION") != 0))
-			status = MB_FAILURE;
-if (status == MB_FAILURE){fprintf(stderr,"Die at line:%d file:%s buffer:%s\n",__LINE__,__FILE__,buffer);exit(0);}
-
-		if (status == MB_SUCCESS
-			&& ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
-				|| (nscan = sscanf(buffer,"%s %d.%d",label,&versionmajor,&versionminor)) != 3
-				|| strcmp(label,"FILE_VERSION") != 0))
-			status = MB_FAILURE;
-if (status == MB_FAILURE){fprintf(stderr,"Die at line:%d file:%s buffer:%s\n",__LINE__,__FILE__,buffer);exit(0);}
-		version_id = 100 * versionmajor + versionminor;
-
-		if (version_id >= 302)
-			{
-			if (status == MB_SUCCESS
-				&& ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
-					|| (nscan = sscanf(buffer,"%s %s",label,obuffer)) != 2
-					|| strcmp(label,"ORIGIN") != 0))
-				status = MB_FAILURE;
-			}
-if (status == MB_FAILURE){fprintf(stderr,"Die at line:%d file:%s buffer:%s\n",__LINE__,__FILE__,buffer);exit(0);}
-
-		if (status == MB_SUCCESS
-			&& ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
-				|| (nscan = sscanf(buffer,"%s %s",label,obuffer)) != 2
-				|| strcmp(label,"NAME") != 0))
-			status = MB_FAILURE;
-if (status == MB_FAILURE){fprintf(stderr,"Die at line:%d file:%s buffer:%s\n",__LINE__,__FILE__,buffer);exit(0);}
-
-		if (status == MB_SUCCESS
-			&& ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
-				|| (nscan = sscanf(buffer,"%s %s",label,obuffer)) != 2
-				|| strcmp(label,"PATH") != 0))
-			status = MB_FAILURE;
-if (status == MB_FAILURE){fprintf(stderr,"Die at line:%d file:%s buffer:%s\n",__LINE__,__FILE__,buffer);exit(0);}
-
-		if (status == MB_SUCCESS
-			&& ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
-				|| (nscan = sscanf(buffer,"%s %s",label,obuffer)) != 2
-				|| strcmp(label,"HOME") != 0))
-			status = MB_FAILURE;
-if (status == MB_FAILURE){fprintf(stderr,"Die at line:%d file:%s buffer:%s\n",__LINE__,__FILE__,buffer);exit(0);}
-
-		if (status == MB_SUCCESS
-			&& ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
-				|| (nscan = sscanf(buffer,"%s %s",label,obuffer)) != 2
-				|| strcmp(label,"DATADIR") != 0))
-			status = MB_FAILURE;
-if (status == MB_FAILURE){fprintf(stderr,"Die at line:%d file:%s buffer:%s\n",__LINE__,__FILE__,buffer);exit(0);}
-
-		if (status == MB_SUCCESS
-			&& ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
-				|| (nscan = sscanf(buffer,"%s %d",label,&project.num_files)) != 2
-				|| strcmp(label,"NUMFILES") != 0))
-			status = MB_FAILURE;
-if (status == MB_FAILURE){fprintf(stderr,"Die at line:%d file:%s buffer:%s\n",__LINE__,__FILE__,buffer);exit(0);}
-
-		if (version_id >= 306)
-			{
-			if (status == MB_SUCCESS
-				&& ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
-					|| (nscan = sscanf(buffer,"%s %d",label,&project.num_blocks)) != 2
-					|| strcmp(label,"NUMBLOCKS") != 0))
-				status = MB_FAILURE;
-			}
-		else
-			{
-			project.num_blocks = 0;
-			}
-if (status == MB_FAILURE){fprintf(stderr,"Die at line:%d file:%s buffer:%s\n",__LINE__,__FILE__,buffer);exit(0);}
-
-		if (status == MB_SUCCESS
-			&& ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
-				|| (nscan = sscanf(buffer,"%s %d",label,&project.num_crossings)) != 2
-				|| strcmp(label,"NUMCROSSINGS") != 0))
-			status = MB_FAILURE;
-if (status == MB_FAILURE){fprintf(stderr,"Die at line:%d file:%s buffer:%s\n",__LINE__,__FILE__,buffer);exit(0);}
-
-		if (status == MB_SUCCESS
-			&& ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
-				|| (nscan = sscanf(buffer,"%s %lf",label,&project.section_length)) != 2
-				|| strcmp(label,"SECTIONLENGTH") != 0))
-			status = MB_FAILURE;
-if (status == MB_FAILURE){fprintf(stderr,"Die at line:%d file:%s buffer:%s\n",__LINE__,__FILE__,buffer);exit(0);}
-
-		if (status == MB_SUCCESS
-			&& version_id >= 101
-			&& ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
-				|| (nscan = sscanf(buffer,"%s %d",label,&project.section_soundings)) != 2
-				|| strcmp(label,"SECTIONSOUNDINGS") != 0))
-			status = MB_FAILURE;
-if (status == MB_FAILURE){fprintf(stderr,"Die at line:%d file:%s buffer:%s\n",__LINE__,__FILE__,buffer);exit(0);}
-
-		if (status == MB_SUCCESS
-			&& ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
-				|| (nscan = sscanf(buffer,"%s %d",label,&project.decimation)) != 2
-				|| strcmp(label,"DECIMATION") != 0))
-			status = MB_FAILURE;
-if (status == MB_FAILURE){fprintf(stderr,"Die at line:%d file:%s buffer:%s\n",__LINE__,__FILE__,buffer);exit(0);}
-
-		if (status == MB_SUCCESS
-			&& ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
-				|| (nscan = sscanf(buffer,"%s %lf",label,&project.cont_int)) != 2
-				|| strcmp(label,"CONTOURINTERVAL") != 0))
-			status = MB_FAILURE;
-if (status == MB_FAILURE){fprintf(stderr,"Die at line:%d file:%s buffer:%s\n",__LINE__,__FILE__,buffer);exit(0);}
-
-		if (status == MB_SUCCESS
-			&& ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
-				|| (nscan = sscanf(buffer,"%s %lf",label,&project.col_int)) != 2
-				|| strcmp(label,"COLORINTERVAL") != 0))
-			status = MB_FAILURE;
-if (status == MB_FAILURE){fprintf(stderr,"Die at line:%d file:%s buffer:%s\n",__LINE__,__FILE__,buffer);exit(0);}
-
-		if (status == MB_SUCCESS
-			&& ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
-				|| (nscan = sscanf(buffer,"%s %lf",label,&project.tick_int)) != 2
-				|| strcmp(label,"TICKINTERVAL") != 0))
-			status = MB_FAILURE;
-if (status == MB_FAILURE){fprintf(stderr,"Die at line:%d file:%s buffer:%s\n",__LINE__,__FILE__,buffer);exit(0);}
-
-		if (status == MB_SUCCESS
-			&& ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
-				|| (nscan = sscanf(buffer,"%s %d",label,&project.inversion)) != 2
-				|| strcmp(label,"INVERSION") != 0))
-			status = MB_FAILURE;
-if (status == MB_FAILURE){fprintf(stderr,"Die at line:%d file:%s buffer:%s\n",__LINE__,__FILE__,buffer);exit(0);}
-
-		if (status == MB_SUCCESS)
-			{
-			if (version_id >= 301)
-				{
-				if ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
-					|| (nscan = sscanf(buffer,"%s %lf",label,&project.smoothing)) != 2
-					|| strcmp(label,"SMOOTHING") != 0)
-					status = MB_FAILURE;
-				project.precision = SIGMA_MINIMUM;
-				}
-			else if (version_id >= 103)
-				{
-				if ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
-					|| (nscan = sscanf(buffer,"%s %lf",label,&project.precision)) != 2
-					|| strcmp(label,"PRECISION") != 0)
-					status = MB_FAILURE;
-				project.smoothing = MBNA_SMOOTHING_DEFAULT;
-				}
-			else
-				{
-				project.precision = SIGMA_MINIMUM;
-				project.smoothing = MBNA_SMOOTHING_DEFAULT;
-				}
-			}
-if (status == MB_FAILURE){fprintf(stderr,"Die at line:%d file:%s\n",__LINE__,__FILE__);exit(0);}
-
-		if (status == MB_SUCCESS)
-			{
-			if (version_id >= 105
-				&& ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
-					|| (nscan = sscanf(buffer,"%s %lf",label,&project.zoffsetwidth)) != 2
-					|| strcmp(label,"ZOFFSETWIDTH") != 0))
-				status = MB_FAILURE;
-			}
-
-		/* allocate memory for files array */
-if (status == MB_FAILURE){fprintf(stderr,"Die at line:%d file:%s\n",__LINE__,__FILE__);exit(0);}
-
-		if (project.num_files > 0)
-			{
-			project.files = (struct mbna_file *)
-				malloc(sizeof(struct mbna_file) * (project.num_files));
-			if (project.files != NULL)
-				{
-				project.num_files_alloc = project.num_files;
-				memset(project.files,0,project.num_files_alloc * sizeof(struct mbna_file));
-				}
-			else
-				{
-				project.num_files_alloc = 0;
-				status = MB_FAILURE;
-				error = MB_ERROR_MEMORY_FAIL;
-				}
-			}
-if (status == MB_FAILURE){fprintf(stderr,"Die at line:%d file:%s\n",__LINE__,__FILE__);exit(0);}
-
-		if (project.num_crossings > 0)
-			{
-			project.crossings = (struct mbna_crossing *)
-				malloc(sizeof(struct mbna_crossing) * (project.num_crossings));
-			if (project.crossings != NULL)
-				{
-				project.num_crossings_alloc = project.num_crossings;
-				memset(project.crossings,0,sizeof(struct mbna_crossing) * project.num_crossings_alloc);
-				}
-			else
-				{
-				project.num_crossings_alloc = 0;
-				status = MB_FAILURE;
-				error = MB_ERROR_MEMORY_FAIL;
-				}
-			}
-if (status == MB_FAILURE){fprintf(stderr,"Die at line:%d file:%s\n",__LINE__,__FILE__);exit(0);}
-
-		for (i=0;i<project.num_files;i++)
-			{
-			file = &project.files[i];
-			file->num_sections_alloc = 0;
-			file->sections = NULL;
-			file->num_snavs = 0;
-			file->num_pings = 0;
-			file->num_beams = 0;
-			if (version_id >= 306)
-				{
-				if (status == MB_SUCCESS
-					&& ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
-						|| (nscan = sscanf(buffer,"FILE %d %d %d %d %d %lf %lf %lf %lf %lf %lf %lf %d %d %s",
-						&idummy,
-						&(file->status),
-						&(file->id),
-						&(file->format),
-						&(file->block),
-						&(file->block_offset_x),
-						&(file->block_offset_y),
-						&(file->block_offset_z),
-						&(file->heading_bias_import),
-						&(file->roll_bias_import),
-						&(file->heading_bias),
-						&(file->roll_bias),
-						&(file->num_sections),
-						&(file->output_id),
-						file->file)) != 15))
-					status = MB_FAILURE;
-				}
-			else
-				{
-				if (status == MB_SUCCESS
-					&& ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
-						|| (nscan = sscanf(buffer,"FILE %d %d %d %d %lf %lf %lf %lf %d %d %s",
-						&idummy,
-						&(file->status),
-						&(file->id),
-						&(file->format),
-						&(file->heading_bias_import),
-						&(file->roll_bias_import),
-						&(file->heading_bias),
-						&(file->roll_bias),
-						&(file->num_sections),
-						&(file->output_id),
-						file->file)) != 11))
-					status = MB_FAILURE;
-				file->block = 0;
-				file->block_offset_x = 0.0;
-				file->block_offset_y = 0.0;
-				file->block_offset_z = 0.0;
-				}
-
-			/* set file->path as absolute path
-			    - file->file may be a relative path */
-			if (status == MB_SUCCESS)
-				{
-				if (file->file[0] == '/')
-				    strcpy(file->path, file->file);
-				else
-				    {
-				    strcpy(file->path, project.path);
-				    strcat(file->path, file->file);
-				    }
-				}
-
-			/* read section info */
-			if (file->num_sections > 0)
-				{
-				file->sections = (struct mbna_section *)
-					malloc(sizeof(struct mbna_section) * (file->num_sections));
-				if (file->sections != NULL)
-					{
-					file->num_sections_alloc = file->num_sections;
-					memset(file->sections,0,sizeof(struct mbna_section) * file->num_sections_alloc);
-				        }
-				else
-					{
-					file->num_sections_alloc = 0;
-					status = MB_FAILURE;
-					error = MB_ERROR_MEMORY_FAIL;
-					}
-				}
-			for (j=0;j<file->num_sections;j++)
-				{
-				section = &file->sections[j];
-				if (status == MB_SUCCESS)
-					result = fgets(buffer,BUFFER_MAX,hfp);
-				if (status == MB_SUCCESS && result == buffer)
-					nscan = sscanf(buffer,"SECTION %d %d %d %d %d %lf %lf %lf %lf %lf %lf %lf %lf %lf %d",
-						&idummy,
-						&section->num_pings,
-						&section->num_beams,
-						&section->num_snav,
-						&section->continuity,
-						&section->distance,
-						&section->btime_d,
-						&section->etime_d,
-						&section->lonmin,
-						&section->lonmax,
-						&section->latmin,
-						&section->latmax,
-						&section->depthmin,
-						&section->depthmax,
-						&section->contoursuptodate);
-				if (result != buffer || nscan < 14)
-					{
-					status = MB_FAILURE;
-fprintf(stderr, "read failed on section: %s\n", buffer);
-					}
-				if (nscan < 15)
-					section->contoursuptodate = MB_NO;
-				for (k=MBNA_MASK_DIM-1;k>=0;k--)
-					{
-					if (status == MB_SUCCESS)
-					    result = fgets(buffer,BUFFER_MAX,hfp);
-					for (l=0;l<MBNA_MASK_DIM;l++)
-						{
-						sscanf(&buffer[l], "%1d", &section->coverage[l+k*MBNA_MASK_DIM]);
-						}
-					}
-if (status == MB_FAILURE){fprintf(stderr,"Die at line:%d file:%s\n",__LINE__,__FILE__);exit(0);}
-/*fprintf(stderr,"%s/nvs_%4.4d_%4.4d.mb71\n",
-project.datadir,file->id,j);
-for (k=MBNA_MASK_DIM-1;k>=0;k--)
-{
-for (l=0;l<MBNA_MASK_DIM;l++)
-{
-fprintf(stderr, "%1d", section->coverage[l + k * MBNA_MASK_DIM]);
-}
-fprintf(stderr, "\n");
-}*/
-				for (k=0;k<section->num_snav;k++)
-				    {
-				    if (status == MB_SUCCESS)
-					result = fgets(buffer,BUFFER_MAX,hfp);
-				    if (status == MB_SUCCESS && result == buffer)
-					nscan = sscanf(buffer,"SNAV %d %d %lf %lf %lf %lf %lf %lf %lf",
-						&idummy,
-						&section->snav_id[k],
-						&section->snav_distance[k],
-						&section->snav_time_d[k],
-						&section->snav_lon[k],
-						&section->snav_lat[k],
-						&section->snav_lon_offset[k],
-						&section->snav_lat_offset[k],
-						&section->snav_z_offset[k]);
-				    section->snav_num_ties[k] = 0;
-				    section->snav_lon_offset_int[k] = 0.0;
-				    section->snav_lat_offset_int[k] = 0.0;
-				    section->snav_z_offset_int[k] = 0.0;
-				    if (result == buffer && nscan == 6)
-				    	{
-				    	section->snav_lon_offset[k] = 0.0;
-				    	section->snav_lat_offset[k] = 0.0;
-				    	section->snav_z_offset[k] = 0.0;
-				    	}
-				    else if (result == buffer && nscan == 8)
-				    	{
-				    	section->snav_z_offset[k] = 0.0;
-				    	}
-				    else if (result != buffer || nscan != 9)
-					{
-					status = MB_FAILURE;
-fprintf(stderr, "read failed on snav: %s\n", buffer);
-					}
-
-				    /* reverse offset values if older values */
-				    if (version_id < 300)
-					{
-				    	section->snav_lon_offset[k] *= -1.0;
-				    	section->snav_lat_offset[k] *= -1.0;
-				    	section->snav_z_offset[k] *= -1.0;
-					}
-				    }
-				    
-				/* global fixed frame tie, whether defined or not */
-				if (version_id >= 305)
-					{
-					if (status == MB_SUCCESS)
-						result = fgets(buffer,BUFFER_MAX,hfp);
-					if (status == MB_SUCCESS && result == buffer)
-						nscan = sscanf(buffer,"GLOBALTIE %d %d %lf %lf %lf %lf %lf %lf",
-							&section->global_tie_status,
-							&section->global_tie_snav,
-							&section->global_tie_offset_x,
-							&section->global_tie_offset_y,
-							&section->global_tie_offset_z_m,
-							&section->global_tie_xsigma,
-							&section->global_tie_ysigma,
-							&section->global_tie_zsigma);
-					mb_coor_scale(mbna_verbose,0.5 * (section->latmin + section->latmax),
-							&mtodeglon,&mtodeglat);
-					section->global_tie_offset_x_m = section->global_tie_offset_x / mtodeglon;
-					section->global_tie_offset_y_m = section->global_tie_offset_y / mtodeglat;
-/* if (section->global_tie_status != MBNA_TIE_NONE)
-fprintf(stderr,"READ GLOBALTIE: %d %d %lf %lf %lf %lf %lf %lf\n",
-section->global_tie_status,
-section->global_tie_snav,
-section->global_tie_offset_x,
-section->global_tie_offset_y,
-section->global_tie_offset_z_m,
-section->global_tie_xsigma,
-section->global_tie_ysigma,
-section->global_tie_zsigma); */
-					}
-				else if (version_id == 304)
-					{
-					if (status == MB_SUCCESS)
-						result = fgets(buffer,BUFFER_MAX,hfp);
-					if (status == MB_SUCCESS && result == buffer)
-						nscan = sscanf(buffer,"GLOBALTIE %d %lf %lf %lf %lf %lf %lf",
-							&section->global_tie_snav,
-							&section->global_tie_offset_x,
-							&section->global_tie_offset_y,
-							&section->global_tie_offset_z_m,
-							&section->global_tie_xsigma,
-							&section->global_tie_ysigma,
-							&section->global_tie_zsigma);
-					mb_coor_scale(mbna_verbose,0.5 * (section->latmin + section->latmax),
-							&mtodeglon,&mtodeglat);
-					section->global_tie_offset_x_m = section->global_tie_offset_x / mtodeglon;
-					section->global_tie_offset_y_m = section->global_tie_offset_y / mtodeglat;
-					if (section->global_tie_snav != MBNA_SELECT_NONE)
-						section->global_tie_status = MBNA_TIE_XYZ;
-					else
-						section->global_tie_status = MBNA_TIE_NONE;
-/* if (section->global_tie_snav != MBNA_SELECT_NONE)
-fprintf(stderr,"READ GLOBALTIE: %d %lf %lf %lf %lf %lf %lf\n",
-section->global_tie_snav,
-section->global_tie_offset_x,
-section->global_tie_offset_y,
-section->global_tie_offset_z_m,
-section->global_tie_xsigma,
-section->global_tie_ysigma,
-section->global_tie_zsigma); */
-					}
-				else
-					{
-					section->global_tie_snav = MBNA_TIE_NONE;
-					section->global_tie_snav = MBNA_SELECT_NONE;
-					section->global_tie_offset_x = 0.0;
-					section->global_tie_offset_y = 0.0;
-					section->global_tie_offset_z_m = 0.0;
-					section->global_tie_xsigma = 0.0;
-					section->global_tie_ysigma = 0.0;
-					section->global_tie_zsigma = 0.0;
-					}
-
-				section->global_start_ping = project.num_pings;
-				section->global_start_snav = project.num_snavs - section->continuity;
-				file->num_snavs += section->num_pings;
-				file->num_pings += section->num_pings;
-				file->num_beams += section->num_beams;
-				project.num_snavs += (section->num_snav - section->continuity);
-				project.num_pings += section->num_pings;
-				project.num_beams += section->num_beams;
-				}
-			}
-
-		/* count the number of blocks */
-		if (version_id < 306)
-			{
-			project.num_blocks = 0;
-			for (i=0;i<project.num_files;i++)
-				{
-				file = &project.files[i];
-				if (i==0 || file->sections[0].continuity == MB_NO)
-					{
-					project.num_blocks++;
-					}
-				file->block = project.num_blocks - 1;
-				file->block_offset_x = 0.0;
-				file->block_offset_y = 0.0;
-				file->block_offset_z = 0.0;
-				}
-			}
-
-		/* read crossings */
- 		project.num_crossings_analyzed = 0;
-		project.num_goodcrossings = 0;
-		project.num_truecrossings = 0;
-		project.num_truecrossings_analyzed = 0;
- 		project.num_ties = 0;
-		for (i=0;i<project.num_crossings;i++)
-			{
-			/* read each crossing */
-			crossing = &project.crossings[i];
-			if (status == MB_SUCCESS
-				&& version_id >= 106)
-				{
-				if (status == MB_SUCCESS
-					&& ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
-						|| (nscan = sscanf(buffer,"CROSSING %d %d %d %d %d %d %d %d %d",
- 						&idummy,
-						&crossing->status,
-						&crossing->truecrossing,
-						&crossing->overlap,
-						&crossing->file_id_1,
-						&crossing->section_1,
-						&crossing->file_id_2,
-						&crossing->section_2,
-						&crossing->num_ties)) != 9))
-						{
-						status = MB_FAILURE;
-fprintf(stderr, "read failed on crossing: %s\n", buffer);
-						}
-				}
-			else if (status == MB_SUCCESS
-				&& version_id >= 102)
-				{
-				crossing->overlap = 0;
-				if (status == MB_SUCCESS
-					&& ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
-						|| (nscan = sscanf(buffer,"CROSSING %d %d %d %d %d %d %d %d",
- 						&idummy,
-						&crossing->status,
-						&crossing->truecrossing,
-						&crossing->file_id_1,
-						&crossing->section_1,
-						&crossing->file_id_2,
-						&crossing->section_2,
-						&crossing->num_ties)) != 8))
-						{
-						status = MB_FAILURE;
-fprintf(stderr, "read failed on crossing: %s\n", buffer);
-						}
-				}
-			else if (status == MB_SUCCESS)
-				{
-				crossing->truecrossing = MB_NO;
-				crossing->overlap = 0;
-				if (status == MB_SUCCESS
-					&& ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
-						|| (nscan = sscanf(buffer,"CROSSING %d %d %d %d %d %d %d",
- 						&idummy,
-						&crossing->status,
-						&crossing->file_id_1,
-						&crossing->section_1,
-						&crossing->file_id_2,
-						&crossing->section_2,
-						&crossing->num_ties)) != 7))
-						{
-						status = MB_FAILURE;
-fprintf(stderr, "read failed on old format crossing: %s\n", buffer);
-						}
-				}
-			if (status == MB_SUCCESS
-			    && crossing->status != MBNA_CROSSING_STATUS_NONE)
-				project.num_crossings_analyzed++;
-			if (status == MB_SUCCESS
-			    && crossing->truecrossing == MB_YES)
-				{
-				project.num_truecrossings++;
-				if (crossing->status != MBNA_CROSSING_STATUS_NONE)
-				project.num_truecrossings_analyzed++;
-				}
-
-			/* reorder crossing to be early file first older file second if
-				file version prior to 3.00 */
-			if (version_id < 300)
-				{
-				idummy = crossing->file_id_1;
-				jdummy = crossing->section_1;
-				crossing->file_id_1 = crossing->file_id_2;
-				crossing->section_1 = crossing->section_2;
-				crossing->file_id_2 = idummy;
-				crossing->section_2 = jdummy;
-				}
-
-			/* read ties */
-			if (status == MB_SUCCESS)
-			for (j=0;j<crossing->num_ties;j++)
-				{
-				/* read each tie */
-				tie = &crossing->ties[j];
-				if (status == MB_SUCCESS && version_id >= 302)
-					{
-					if ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
-						|| (nscan = sscanf(buffer,"TIE %d %d %d %lf %d %lf %lf %lf %lf %d %lf %lf %lf",
-							&idummy,
-							&tie->status,
-							&tie->snav_1,
-							&tie->snav_1_time_d,
-							&tie->snav_2,
-							&tie->snav_2_time_d,
-							&tie->offset_x,
-							&tie->offset_y,
-							&tie->offset_z_m,
-							&tie->inversion_status,
-							&tie->inversion_offset_x,
-							&tie->inversion_offset_y,
-							&tie->inversion_offset_z_m)) != 13)
-						{
-						status = MB_FAILURE;
-fprintf(stderr, "read failed on tie: %s\n", buffer);
-						}
-					}
-				else if (status == MB_SUCCESS && version_id >= 104)
-					{
-					if ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
-						|| (nscan = sscanf(buffer,"TIE %d %d %lf %d %lf %lf %lf %lf %d %lf %lf %lf",
-							&idummy,
-							&tie->snav_1,
-							&tie->snav_1_time_d,
-							&tie->snav_2,
-							&tie->snav_2_time_d,
-							&tie->offset_x,
-							&tie->offset_y,
-							&tie->offset_z_m,
-							&tie->inversion_status,
-							&tie->inversion_offset_x,
-							&tie->inversion_offset_y,
-							&tie->inversion_offset_z_m)) != 12)
-						{
-						status = MB_FAILURE;
-fprintf(stderr, "read failed on tie: %s\n", buffer);
-						}
-					tie->status = MBNA_TIE_XYZ;
-					}
-				else if (status == MB_SUCCESS)
-					{
-					if ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
-						|| (nscan = sscanf(buffer,"TIE %d %d %lf %d %lf %lf %lf %d %lf %lf",
-							&idummy,
-							&tie->snav_1,
-							&tie->snav_1_time_d,
-							&tie->snav_2,
-							&tie->snav_2_time_d,
-							&tie->offset_x,
-							&tie->offset_y,
-							&tie->inversion_status,
-							&tie->inversion_offset_x,
-							&tie->inversion_offset_y)) != 10)
-						{
-						status = MB_FAILURE;
-fprintf(stderr, "read failed on tie: %s\n", buffer);
-						}
-					tie->status = MBNA_TIE_XYZ;
-					tie->offset_z_m = 0.0;
-					tie->inversion_offset_z_m = 0.0;
-					}
-
-				/* reorder crossing to be early file first older file second if
-					file version prior to 3.00 */
-				if (version_id < 300)
-					{
-					idummy = tie->snav_1;
-					dummy = tie->snav_1_time_d;
-					tie->snav_1 = tie->snav_2;
-					tie->snav_1_time_d = tie->snav_2_time_d;
-					tie->snav_2 = idummy;
-					tie->snav_2_time_d = dummy;
-/*					tie->offset_x *= -1.0;
-					tie->offset_y *= -1.0;
-					tie->offset_z_m *= -1.0;
-					tie->inversion_offset_x *= -1.0;
-					tie->inversion_offset_y *= -1.0;
-					tie->inversion_offset_z_m *= -1.0;*/
-					}
-
-				/* for version 2.0 or later read covariance */
-				if (status == MB_SUCCESS && version_id >= 200)
-					{
-					if ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
-						|| (nscan = sscanf(buffer,"COV %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf",
-							&tie->sigmar1,
-							&(tie->sigmax1[0]),
-							&(tie->sigmax1[1]),
-							&(tie->sigmax1[2]),
-							&tie->sigmar2,
-							&(tie->sigmax2[0]),
-							&(tie->sigmax2[1]),
-							&(tie->sigmax2[2]),
-							&tie->sigmar3,
-							&(tie->sigmax3[0]),
-							&(tie->sigmax3[1]),
-							&(tie->sigmax3[2]))) != 12)
-						{
-						status = MB_FAILURE;
-fprintf(stderr, "read failed on tie covariance: %s\n", buffer);
-						}
-					if (tie->sigmar1 <= 0.0)
-						{
-						tie->sigmax1[0] = 1.0;
-						tie->sigmax1[1] = 0.0;
-						tie->sigmax1[2] = 0.0;
-						mbna_minmisfit_sr1 = 1.0;
-						}
-					if (tie->sigmar2 <= 0.0)
-						{
-						tie->sigmax2[0] = 0.0;
-						tie->sigmax2[1] = 1.0;
-						tie->sigmax2[2] = 0.0;
-						mbna_minmisfit_sr2 = 1.0;
-						}
-					if (tie->sigmar3 <= 0.0)
-						{
-						tie->sigmax3[0] = 0.0;
-						tie->sigmax3[1] = 0.0;
-						tie->sigmax3[2] = 1.0;
-						mbna_minmisfit_sr3 = 1.0;
-						}
-					}
-				else if (status == MB_SUCCESS)
-					{
-					tie->sigmar1 = 100.0;
-					tie->sigmax1[0] = 1.0;
-					tie->sigmax1[1] = 0.0;
-					tie->sigmax1[2] = 0.0;
-					tie->sigmar2 = 100.0;
-					tie->sigmax2[0] = 0.0;
-					tie->sigmax2[1] = 1.0;
-					tie->sigmax2[2] = 0.0;
-					tie->sigmar3 = 100.0;
-					tie->sigmax3[0] = 0.0;
-					tie->sigmax3[1] = 0.0;
-					tie->sigmax3[2] = 1.0;
-					}
-
-				/* update number of ties */
-				if (status == MB_SUCCESS)
-				    {
-				    project.num_ties++;
-				    }
-
-				/* check for reasonable snav id's */
-				if (status == MB_SUCCESS)
-				    {
-				    file = &project.files[crossing->file_id_1];
-				    section = &file->sections[crossing->section_1];
-				    if (tie->snav_1 >= section->num_snav)
-					{
-					tie->snav_1 = ((double)tie->snav_1
-								/ (double)section->num_pings)
-								* (MBNA_SNAV_NUM - 1);
-					tie->snav_1_time_d = section->snav_time_d[tie->snav_1];
-fprintf(stderr,"Reset tie snav_1 on read:%d\n",tie->snav_1);
-					}
-				    file = &project.files[crossing->file_id_2];
-				    section = &file->sections[crossing->section_2];
-				    if (tie->snav_2 >= section->num_snav)
-					{
-					tie->snav_2 = ((double)tie->snav_2
-								/ (double)section->num_pings)
-								* (MBNA_SNAV_NUM - 1);
-					tie->snav_2_time_d = section->snav_time_d[tie->snav_2];
-fprintf(stderr,"Reset tie snav_2 on read:%d\n",tie->snav_2);
-					}
-				    }
-
-				/* update number of ties for snavs */
-				if (status == MB_SUCCESS)
-				    {
-				    file = &project.files[crossing->file_id_1];
-				    section = &file->sections[crossing->section_1];
-				    section->snav_num_ties[tie->snav_1]++;
-				    file = &project.files[crossing->file_id_2];
-				    section = &file->sections[crossing->section_2];
-				    section->snav_num_ties[tie->snav_2]++;
-				    }
-
-				/* calculate offsets in local meters */
-				if (status == MB_SUCCESS)
-				    {
-				    section1 = &(project.files[crossing->file_id_1].sections[crossing->section_1]);
-				    section2 = &(project.files[crossing->file_id_2].sections[crossing->section_2]);
-				    mbna_lon_min = MIN(section1->lonmin,section2->lonmin);
-				    mbna_lon_max = MAX(section1->lonmax,section2->lonmax);
-				    mbna_lat_min = MIN(section1->latmin,section2->latmin);
-				    mbna_lat_max = MAX(section1->latmax,section2->latmax);
-				    mb_coor_scale(mbna_verbose,0.5 * (mbna_lat_min + mbna_lat_max),
-						    &mbna_mtodeglon,&mbna_mtodeglat);
-				    tie->offset_x_m = tie->offset_x / mbna_mtodeglon;
-				    tie->offset_y_m = tie->offset_y / mbna_mtodeglat;
-				    tie->inversion_offset_x_m = tie->inversion_offset_x / mbna_mtodeglon;
-				    tie->inversion_offset_y_m = tie->inversion_offset_y / mbna_mtodeglat;
-				    }
-
-				}
-
-			/* finally make sure crossing has later section second, switch if needed */
-			s1id = crossing->file_id_1 * 1000 + crossing->section_1;
-			s2id = crossing->file_id_2 * 1000 + crossing->section_2;
-			if (s2id < s1id)
-				{
-				idummy = crossing->file_id_1;
-				jdummy = crossing->section_1;
-				crossing->file_id_1 = crossing->file_id_2;
-				crossing->section_1 = crossing->section_2;
-				crossing->file_id_2 = idummy;
-				crossing->section_2 = jdummy;
-				for (j=0;j<crossing->num_ties;j++)
-					{
-					tie = &crossing->ties[j];
-					idummy = tie->snav_1;
-					dummy = tie->snav_1_time_d;
-					tie->snav_1 = tie->snav_2;
-					tie->snav_1_time_d = tie->snav_2_time_d;
-					tie->snav_2 = idummy;
-					tie->snav_2_time_d = dummy;
-					tie->offset_x *= -1.0;
-					tie->offset_y *= -1.0;
-					tie->offset_x_m *= -1.0;
-					tie->offset_y_m *= -1.0;
-					tie->offset_z_m *= -1.0;
-					tie->inversion_offset_x *= -1.0;
-					tie->inversion_offset_y *= -1.0;
-					tie->inversion_offset_x_m *= -1.0;
-					tie->inversion_offset_y_m *= -1.0;
-					tie->inversion_offset_z_m *= -1.0;
-					}
-				}
-			}
-
-		/* close home file */
-		fclose(hfp);
-
-		/* set project status flag */
-		if (status == MB_SUCCESS)
-			project.open = MB_YES;
-		else
-			{
-			for (i=0;i<project.num_files;i++)
-				{
-				file = &project.files[i];
-				if (file->sections != NULL)
-					 free( file->sections);
-				}
-			if (project.files != NULL)
-				free(project.files);
-			if (project.crossings != NULL)
-				free(project.crossings);
-			project.open = MB_NO;
-			memset(project.name,0,STRING_MAX);
-			strcpy(project.name,"None");
- 			memset(project.path,0,STRING_MAX);
-			memset(project.datadir,0,STRING_MAX);
-			project.num_files = 0;
-			project.num_files_alloc = 0;
-			project.num_snavs = 0;
-			project.num_pings = 0;
-			project.num_beams = 0;
-			project.num_crossings = 0;
-			project.num_crossings_alloc = 0;
- 			project.num_crossings_analyzed = 0;
-			project.num_goodcrossings = 0;
-			project.num_truecrossings = 0;
-			project.num_truecrossings_analyzed = 0;
-			project.num_ties = 0;
- 			}
-
-		/* recalculate crossing overlap values if not already set */
-		if (project.open == MB_YES)
-			{
-			for (i=0;i<project.num_crossings;i++)
-				{
-				crossing = &(project.crossings[i]);
-				if (crossing->overlap <= 0)
-					{
-					mbnavadjust_crossing_overlap(i);
-					}
-				if (crossing->overlap >= 25)
-					project.num_goodcrossings++;
-				}
-			}
-
-		/* reset crossings to unanalyzed if flag is set */
-		if (mbna_reset_crossings == MB_YES)
-			{
-			for (i=0;i<project.num_crossings;i++)
-				{
-				/* read each crossing */
-				crossing = &project.crossings[i];
-
-				/* reset status */
-				crossing->status = MBNA_CROSSING_STATUS_NONE;
-				crossing->num_ties = 0;
-				project.num_crossings_analyzed = 0;
-				project.num_truecrossings_analyzed = 0;
-				project.num_ties = 0;
-				project.inversion = MBNA_INVERSION_NONE;
-				}
-			for (i=0;i<project.num_files;i++)
-				{
-				file = &project.files[i];
-				for (j=0;j<file->num_sections;j++)
-					{
-					section = &file->sections[j];
-					for (k=0;k<section->num_snav;k++)
-						{
-						section->snav_lon_offset[section->num_snav] = 0.0;
-						section->snav_lat_offset[section->num_snav] = 0.0;
-						section->snav_z_offset[section->num_snav] = 0.0;
-						section->snav_lon_offset_int[section->num_snav] = 0.0;
-						section->snav_lat_offset_int[section->num_snav] = 0.0;
-						section->snav_z_offset_int[section->num_snav] = 0.0;
-						}
-					}
-				}
-			}
-
-		/* interpolate inversion solution if it exists */
-		if (project.inversion != MBNA_INVERSION_NONE)
-			mbnavadjust_interpolatesolution();
-		}
-
-	/* else set error */
-	else
-		{
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbnavadjust_import_data(char *path, int iformat)
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_import_data";
-	int	status = MB_SUCCESS;
-	struct mbna_file *file;
-	int	done;
-	char	filename[STRING_MAX];
-	double	weight;
-	int	form;
-	int	firstfile;
-	int	i;
-
- 	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2               path:     %s\n",path);
-		fprintf(stderr,"dbg2               format:   %d\n",iformat);
-		}
-
-	/* loop until all files read */
-	done = MB_NO;
-	firstfile = MB_YES;
-	while (done == MB_NO)
-		{
-		if (iformat > 0)
-			{
-			status = mbnavadjust_import_file(path,iformat,firstfile);
-			done = MB_YES;
-			firstfile = MB_NO;
-			}
-		else if (iformat == -1)
-			{
-			if ((status = mb_datalist_open(mbna_verbose,&datalist,
-							path,MB_DATALIST_LOOK_NO,&error)) == MB_SUCCESS)
-				{
-				while (done == MB_NO)
-					{
-					if ((status = mb_datalist_read(mbna_verbose,datalist,
-							filename,&form,&weight,&error))
-							== MB_SUCCESS)
-						{
-						status = mbnavadjust_import_file(filename,form,firstfile);
-						firstfile = MB_NO;
-						}
-					else
-						{
-						mb_datalist_close(mbna_verbose,&datalist,&error);
-						done = MB_YES;
-						}
-					}
-				}
-			}
-		}
-
-	/* look for new crossings */
-	status = mbnavadjust_findcrossings();
-
-	/* count the number of blocks */
-	project.num_blocks = 0;
-	for (i=0;i<project.num_files;i++)
-	    {
-	    file = &project.files[i];
-	    if (i==0 || file->sections[0].continuity == MB_NO)
-		{
-		project.num_blocks++;
-		}
-	    file->block = project.num_blocks - 1;
-	    file->block_offset_x = 0.0;
-	    file->block_offset_y = 0.0;
-	    file->block_offset_z = 0.0;
-	    }
-
-	/* write updated project */
-	mbnavadjust_write_project();
-
- 	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbnavadjust_import_file(char *path, int iformat, int firstfile)
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_import_file";
-	int	status = MB_SUCCESS;
-	struct stat file_status;
-	int	fstat;
-	char	ipath[STRING_MAX];
-	char	mb_suffix[STRING_MAX];
-	char	npath[STRING_MAX];
-	char	opath[STRING_MAX];
-	char	*root;
-
-	/* mbio read and write values */
-	void	*imbio_ptr = NULL;
-	void	*ombio_ptr = NULL;
-	void	*istore_ptr = NULL;
-	void	*ostore_ptr = NULL;
-	int	kind;
-	int	time_i[7];
-	double	time_d;
-	double	navlon;
-	double	navlat;
-	double	speed;
-	double	heading;
-	double	distance;
-	double	altitude;
-	double	sonardepth;
-	double	draft;
-	double	roll;
-	double	pitch;
-	double	heave;
-	int	beams_bath;
-	int	beams_amp;
-	int	pixels_ss;
-	char	*beamflag = NULL;
-	double	*bath = NULL;
-	double	*bathacrosstrack = NULL;
-	double	*bathalongtrack = NULL;
-	double	*amp = NULL;
-	double	*ss = NULL;
-	double	*ssacrosstrack = NULL;
-	double	*ssalongtrack = NULL;
-	char	comment[MB_COMMENT_MAXLINE];
-
-	int	sonartype = MB_TOPOGRAPHY_TYPE_UNKNOWN;
-	int	*bin_nbath = NULL;
-	double	*bin_bath = NULL;
-	double	*bin_bathacrosstrack = NULL;
-	double	*bin_bathalongtrack = NULL;
-	int	side;
-	double	port_time_d, stbd_time_d;
-	double	angle, dt, alongtrackdistance, xtrackavg, xtrackmax;
-	int	nxtrack;
-
-	int	output_id, found;
-	int	obeams_bath,obeams_amp,opixels_ss;
-	int	iform;
-	int	nread, first;
-	int	output_open = MB_NO;
-	int	good_beams;
-	int	new_segment;
-	double	headingx, headingy, mtodeglon, mtodeglat;
-	double	lon, lat;
-	double	navlon_old, navlat_old;
-	FILE	*nfp;
-	struct mbna_file *file, *cfile;
-	struct mbna_section *section, *csection;
-	struct mbsys_ldeoih_struct *ostore;
-	struct mb_io_struct *omb_io_ptr;
-	int	new_pings, new_crossings;
-	double	dx1, dy1;
-	int	mbp_heading_mode;
-	double	mbp_headingbias;
-	int	mbp_rollbias_mode;
-	double	mbp_rollbias;
-	double	mbp_rollbias_port;
-	double	mbp_rollbias_stbd;
-	double	depthmax, distmax, depthscale, distscale;
- 	int	i, j, k;
-	int	ii1, jj1;
-
- 	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2               path:     %s\n",path);
-		fprintf(stderr,"dbg2               format:   %d\n",iformat);
-		}
-
-	/* get potential processed file name */
-	if ((status = mb_get_format(mbna_verbose, path, ipath,
-				    &iform, &error))
-				    == MB_SUCCESS
-	    && iform == iformat)
-	    {
-	    strcat(ipath,"p");
-	    sprintf(mb_suffix, ".mb%d", iformat);
-	    strcat(ipath,mb_suffix);
-	    }
-
-	/* else just add p.mbXXX to file name */
-	else
-		{
-		strcat(ipath,"p");
-		sprintf(mb_suffix, ".mb%d", iformat);
-		strcat(ipath,mb_suffix);
-		status = MB_SUCCESS;
-		error = MB_ERROR_NO_ERROR;
-		}
-
-	/* look for processed file and use if available */
-	fstat = stat(ipath, &file_status);
-	if (fstat != 0
-	    || (file_status.st_mode & S_IFMT) == S_IFDIR)
-	    {
-	    strcpy(ipath, path);
-	    }
-
-	/* now look for existing mbnavadjust output files
-	 * - increment output id so this mbnavadjust project outputs
-	 *   a unique nav file for this input file */
-	output_id = 0;
-	found = MB_NO;
-	while (found == MB_NO)
-	    {
-	    sprintf(opath, "%s.na%d", path, output_id);
-	    fstat = stat(opath, &file_status);
-	    if (fstat != 0)
-		{
-		found = MB_YES;
-		}
-	    else
-		{
-		output_id++;
-		}
-	    }
-
-	/* turn on message */
-	root = (char *) strrchr(ipath, '/');
-	if (root == NULL)
-		root = ipath;
-	sprintf(message,"Importing format %d data from %s",iformat,root);
-	do_message_on(message);
-	fprintf(stderr,"%s\n",message);
-	output_open = MB_NO;
-	project.inversion = MBNA_INVERSION_NONE;
-	new_pings = 0;
-	new_crossings = 0;
-	good_beams = 0;
-
-	/* allocate mbna_file array if needed */
-	if (project.num_files_alloc <= project.num_files)
-		{
-		project.files = (struct mbna_file *) realloc(project.files,
-			sizeof(struct mbna_file) * (project.num_files_alloc + ALLOC_NUM));
-		if (project.files != NULL)
-			project.num_files_alloc += ALLOC_NUM;
-		else
-			{
-			status = MB_FAILURE;
-			error = MB_ERROR_MEMORY_FAIL;
-			}
-		}
-
-	if (status == MB_SUCCESS)
-		{
-		/* initialize reading the swath file */
-		if ((status = mb_read_init(
-			mbna_verbose,ipath,iformat,pings,lonflip,bounds,
-			btime_i,etime_i,speedmin,timegap,
-			&imbio_ptr,&btime_d,&etime_d,
-			&beams_bath,&beams_amp,&pixels_ss,&error)) != MB_SUCCESS)
-			{
-			mb_error(mbna_verbose,error,&error_message);
-			fprintf(stderr,"\nMBIO Error returned from function <mb_read_init>:\n%s\n",error_message);
-			fprintf(stderr,"\nSwath sonar File <%s> not initialized for reading\n",path);
-			}
-		}
-
-	/* allocate memory for data arrays */
-	if (status == MB_SUCCESS)
-		{
-		beamflag = NULL;
-		bath = NULL;
-		amp = NULL;
-		bathacrosstrack = NULL;
-		bathalongtrack = NULL;
-		ss = NULL;
-		ssacrosstrack = NULL;
-		ssalongtrack = NULL;
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(mbna_verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							sizeof(char), (void **)&beamflag, &error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(mbna_verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							sizeof(double), (void **)&bath, &error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(mbna_verbose, imbio_ptr, MB_MEM_TYPE_AMPLITUDE,
-							sizeof(double), (void **)&amp, &error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(mbna_verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							sizeof(double), (void **)&bathacrosstrack, &error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(mbna_verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							sizeof(double), (void **)&bathalongtrack, &error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(mbna_verbose, imbio_ptr, MB_MEM_TYPE_SIDESCAN,
-							sizeof(double), (void **)&ss, &error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(mbna_verbose, imbio_ptr, MB_MEM_TYPE_SIDESCAN,
-							sizeof(double), (void **)&ssacrosstrack, &error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(mbna_verbose, imbio_ptr, MB_MEM_TYPE_SIDESCAN,
-							sizeof(double), (void **)&ssalongtrack, &error);
-
-		/* if error initializing memory then don't read the file */
-		if (error != MB_ERROR_NO_ERROR)
-			{
-			mb_error(mbna_verbose,error,&error_message);
-			fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",
-				error_message);
-			}
- 		}
-
-	/* open nav file */
-	if (status == MB_SUCCESS)
-		{
-		sprintf(npath,"%s/nvs_%4.4d.mb166", project.datadir,project.num_files);
-		if ((nfp = fopen(npath,"w")) == NULL)
-			{
-			status = MB_FAILURE;
-			error = MB_ERROR_OPEN_FAIL;
-			}
-		}
-
-	/* read data */
-	if (status == MB_SUCCESS)
-		{
-		nread = 0;
-		new_segment = MB_NO;
-		first = MB_YES;
-		while (error <= MB_ERROR_NO_ERROR)
-			{
-			/* read a ping of data */
-			status = mb_get_all(mbna_verbose,imbio_ptr,&istore_ptr,&kind,
-				time_i,&time_d,&navlon,&navlat,&speed,
-				&heading,&distance,&altitude,&sonardepth,
-				&beams_bath,&beams_amp,&pixels_ss,
-				beamflag,bath,amp,bathacrosstrack,bathalongtrack,
-				ss,ssacrosstrack,ssalongtrack,
-				comment,&error);
-
-			/* extract all nav values */
-			if (error == MB_ERROR_NO_ERROR
-			    && (kind == MB_DATA_NAV
-				|| kind == MB_DATA_DATA))
-				{
-				status = mb_extract_nav(mbna_verbose,imbio_ptr,
-					istore_ptr,&kind,
-					time_i,&time_d,&navlon,&navlat,&speed,
-					&heading,&draft,&roll,&pitch,&heave,
-					&error);
-				}
-
-			/* ignore minor errors */
-			if (kind == MB_DATA_DATA
-				&& (error == MB_ERROR_TIME_GAP
-					|| error == MB_ERROR_OUT_BOUNDS
-					|| error == MB_ERROR_OUT_TIME
-					|| error == MB_ERROR_SPEED_TOO_SMALL))
-				{
-				status = MB_SUCCESS;
-				error = MB_ERROR_NO_ERROR;
-				}
-
-			/* if sonar is interferometric, bin the bathymetry */
-			if (kind == MB_DATA_DATA)
-				{
-				if (sonartype == MB_TOPOGRAPHY_TYPE_UNKNOWN)
-					status = mb_sonartype(mbna_verbose, imbio_ptr, istore_ptr, &sonartype, &error);
-
-				if (sonartype == MB_TOPOGRAPHY_TYPE_INTERFEROMETRIC)
-					{
-					/* allocate bin arrays if needed */
-					if (bin_nbath == NULL)
-						{
-						status = mb_mallocd(mbna_verbose, __FILE__, __LINE__,
-								    mbna_bin_beams_bath*sizeof(int),
-									(void **)&bin_nbath,&error);
-						status = mb_mallocd(mbna_verbose, __FILE__, __LINE__,
-								    mbna_bin_beams_bath*sizeof(double),
-									(void **)&bin_bath,&error);
-						status = mb_mallocd(mbna_verbose, __FILE__, __LINE__,
-								    mbna_bin_beams_bath*sizeof(double),
-									(void **)&bin_bathacrosstrack,&error);
-						status = mb_mallocd(mbna_verbose, __FILE__, __LINE__,
-								    mbna_bin_beams_bath*sizeof(double),
-									(void **)&bin_bathalongtrack,&error);
-						for (i=0;i<mbna_bin_beams_bath;i++)
-							{
-							bin_nbath[i] = 0;
-							bin_bath[i] = 0.0;
-							bin_bathacrosstrack[i] = 0.0;
-							bin_bathalongtrack[i] = 0.0;
-							}
-						}
-
-					/* figure out if this is a ping to one side or across the while swath */
-					xtrackavg = 0.0;
-					xtrackmax = 0.0;
-					nxtrack = 0;
-					for (i=0;i<beams_bath;i++)
-						{
-						if (mb_beam_ok(beamflag[i]))
-							{
-							xtrackavg += bathacrosstrack[i];
-							xtrackmax = MAX(xtrackmax, fabs(bathacrosstrack[i]));
-							nxtrack++;
-							}
-						}
-					if (nxtrack > 0)
-						{
-						xtrackavg /= nxtrack;
-						}
-					if (xtrackavg > 0.25 * xtrackmax)
-						{
-						side = SIDE_STBD;
-						port_time_d = time_d;
-						}
-					else if (xtrackavg < -0.25 * xtrackmax)
-						{
-						side = SIDE_PORT;
-						stbd_time_d = time_d;
-						}
-					else
-						{
-						side = SIDE_FULLSWATH;
-						stbd_time_d = time_d;
-						}
-
-					/* if side = PORT or FULLSWATH then initialize bin arrays */
-					if (side == SIDE_PORT || side == SIDE_FULLSWATH)
-						{
-						for (i=0;i<mbna_bin_beams_bath;i++)
-							{
-							bin_nbath[i] = 0;
-							bin_bath[i] = 0.0;
-							bin_bathacrosstrack[i] = 0.0;
-							bin_bathalongtrack[i] = 0.0;
-							}
-						}
-
-					/* bin the bathymetry */
-					for (i=0;i<beams_bath;i++)
-						{
-						if (mb_beam_ok(beamflag[i]))
-							{
-							/* get apparent acrosstrack beam angle and bin accordingly */
-							angle = RTD * atan(bathacrosstrack[i] / (bath[i] - sonardepth));
-							j = (int)floor((angle + 0.5 * mbna_bin_swathwidth
-									+ 0.5 * mbna_bin_pseudobeamwidth)
-								       / mbna_bin_pseudobeamwidth);
-/* fprintf(stderr,"i:%d bath:%f %f %f sonardepth:%f angle:%f j:%d\n",
-i,bath[i],bathacrosstrack[i],bathalongtrack[i],sonardepth,angle,j); */
-							if (j >= 0 && j < mbna_bin_beams_bath)
-								{
-								bin_bath[j] += bath[i];
-								bin_bathacrosstrack[j] += bathacrosstrack[i];
-								bin_bathalongtrack[j] += bathalongtrack[i];
-								bin_nbath[j]++;
-								}
-							}
-						}
-
-					/* if side = STBD or FULLSWATH calculate output bathymetry
-						- add alongtrack offset to port data from previous ping */
-					if (side == SIDE_STBD || side == SIDE_FULLSWATH)
-						{
-						dt = port_time_d - stbd_time_d;
-						if (dt > 0.0 && dt < 0.5)
-							alongtrackdistance = -(port_time_d - stbd_time_d) * speed / 3.6;
-						else
-							alongtrackdistance = 0.0;
-						beams_bath = mbna_bin_beams_bath;
-						for (j=0;j<mbna_bin_beams_bath;j++)
-							{
-/* fprintf(stderr,"j:%d angle:%f n:%d bath:%f %f %f\n",
-j,j*mbna_bin_pseudobeamwidth - 0.5 * mbna_bin_swathwidth,bin_nbath[j],bin_bath[j],bin_bathacrosstrack[j],bin_bathalongtrack[j]); */
-							if (bin_nbath[j] > 0)
-								{
-								bath[j] = bin_bath[j] / bin_nbath[j];
-								bathacrosstrack[j] = bin_bathacrosstrack[j] / bin_nbath[j];
-								bathalongtrack[j] = bin_bathalongtrack[j] / bin_nbath[j];
-								beamflag[j] = MB_FLAG_NONE;
-								if (bin_bathacrosstrack[j] < 0.0)
-									bathalongtrack[j] += alongtrackdistance;
-								}
-							else
-								{
-								beamflag[j] = MB_FLAG_NULL;
-								bath[j] = 0.0;
-								bathacrosstrack[j] = 0.0;
-								bathalongtrack[j] = 0.0;
-								}
-							}
-						}
-
-					/* if side = PORT set nonfatal error so that bathymetry isn't output until
-						the STBD data are read too */
-					else if (side == SIDE_PORT)
-						{
-						error = MB_ERROR_IGNORE;
-						}
-					}
-				}
-
-			/* deal with new file */
-			if (kind == MB_DATA_DATA
-				&& error == MB_ERROR_NO_ERROR
-				&& first == MB_YES)
-				{
-				file = &project.files[project.num_files];
-				file->status = MBNA_FILE_GOODNAV;
-				file->id = project.num_files;
-				file->output_id = output_id;
-				strcpy(file->path,path);
-				strcpy(file->file,path);
-				mb_get_relative_path(mbna_verbose,
-							file->file,
-							project.path,
-							&error);
-				file->format = iformat;
-				file->heading_bias = 0.0;
-				file->roll_bias = 0.0;
-				file->num_snavs = 0;
-				file->num_pings = 0;
-				file->num_beams = 0;
-				file->num_sections = 0;
-				file->num_sections_alloc = 0;
-				file->sections = NULL;
-				project.num_files++;
-				new_segment = MB_YES;
-				first = MB_NO;
-
-				/* get bias values */
-				mb_pr_get_heading(mbna_verbose, file->path,
-						    &mbp_heading_mode,
-						    &mbp_headingbias,
-						    &error);
-				mb_pr_get_rollbias(mbna_verbose, file->path,
-						    &mbp_rollbias_mode,
-						    &mbp_rollbias,
-						    &mbp_rollbias_port,
-						    &mbp_rollbias_stbd,
-						    &error);
-				if (mbp_heading_mode == MBP_HEADING_OFFSET
-				    || mbp_heading_mode == MBP_HEADING_CALCOFFSET)
-				    {
-				    file->heading_bias_import = mbp_headingbias;
-				    }
-				else
-				    {
-				    file->heading_bias_import = 0.0;
-				    }
-				if (mbp_rollbias_mode == MBP_ROLLBIAS_SINGLE)
-				    {
-				    file->roll_bias_import = mbp_rollbias;
-				    }
-				else if (mbp_rollbias_mode == MBP_ROLLBIAS_DOUBLE)
-				    {
-				    file->roll_bias_import = 0.5 * (mbp_rollbias_port
-								    + mbp_rollbias_stbd);
-				    }
-				else
-				    {
-				    file->roll_bias_import = 0.0;
-				    }
-				}
-
-			/* check if new segment needed */
-			else if (kind == MB_DATA_DATA
-				&& error == MB_ERROR_NO_ERROR
-				&& (section->distance + distance
-					>= project.section_length
-					|| section->num_beams >= project.section_soundings))
-				{
-				new_segment = MB_YES;
-/*fprintf(stderr, "NEW SEGMENT: section->distance:%f distance:%f project.section_length:%f\n",
-section->distance, distance, project.section_length);*/
-				}
-
-			/* if end of segment or end of file resolve position
-			    of last snav point in last segment */
-			if ((error > MB_ERROR_NO_ERROR || new_segment == MB_YES)
-				&& project.num_files > 0
-				&& (file->num_sections > 0 && section->num_pings > 0))
-				{
-				/* resolve position of last snav point in last segment */
-				if (section->num_snav == 1
-				    || (section->distance >=
-					(section->num_snav - 0.5)
-					    * project.section_length / (MBNA_SNAV_NUM - 1)))
-					{
-					section->snav_id[section->num_snav]
-						= section->num_pings - 1;
-					section->snav_num_ties[section->num_snav]
-						= 0;
-					section->snav_distance[section->num_snav]
-						= section->distance;
-					section->snav_time_d[section->num_snav]
-						= section->etime_d;
-					section->snav_lon[section->num_snav]
-						= navlon_old;
-					section->snav_lat[section->num_snav]
-						= navlat_old;
-					section->snav_lon_offset[section->num_snav]
-						= 0.0;
-					section->snav_lat_offset[section->num_snav]
-						= 0.0;
-					section->snav_z_offset[section->num_snav]
-						= 0.0;
-					section->snav_lon_offset_int[section->num_snav]
-						= 0.0;
-					section->snav_lat_offset_int[section->num_snav]
-						= 0.0;
-					section->snav_z_offset_int[section->num_snav]
-						= 0.0;
-					section->num_snav++;
-					file->num_snavs++;
-					project.num_snavs++;
-					}
-				else if (section->num_snav > 1)
-					{
-					section->snav_id[section->num_snav-1]
-						= section->num_pings - 1;
-					section->snav_num_ties[section->num_snav]
-						= 0;
-					section->snav_distance[section->num_snav-1]
-						= section->distance;
-					section->snav_time_d[section->num_snav-1]
-						= section->etime_d;
-					section->snav_lon[section->num_snav-1]
-						= navlon_old;
-					section->snav_lat[section->num_snav-1]
-						= navlat_old;
-					section->snav_lon_offset[section->num_snav-1]
-						= 0.0;
-					section->snav_lat_offset[section->num_snav-1]
-						= 0.0;
-					section->snav_z_offset[section->num_snav-1]
-						= 0.0;
-					section->snav_lon_offset_int[section->num_snav-1]
-						= 0.0;
-					section->snav_lat_offset_int[section->num_snav-1]
-						= 0.0;
-					section->snav_z_offset_int[section->num_snav-1]
-						= 0.0;
-					}
-				}
-
-			/* deal with new segment */
-			if (kind == MB_DATA_DATA
-				&& error == MB_ERROR_NO_ERROR
-				&& new_segment == MB_YES)
-				{
-				/* end old segment */
-				if (output_open == MB_YES)
-					{
-					/* close the swath file */
-					status = mb_close(mbna_verbose,&ombio_ptr,&error);
-					output_open = MB_NO;
-					}
-
-				/* allocate mbna_section array if needed */
-				if (file->num_sections_alloc <= file->num_sections)
-					{
-					file->sections = (struct mbna_section *) realloc(file->sections,
-						sizeof(struct mbna_section) * (file->num_sections_alloc + ALLOC_NUM));
-					if (file->sections != NULL)
-						file->num_sections_alloc += ALLOC_NUM;
-					else
-						{
-						status = MB_FAILURE;
-						error = MB_ERROR_MEMORY_FAIL;
-						}
-					}
-
-				/* initialize new section */
-				file->num_sections++;
-				section = &file->sections[file->num_sections-1];
-				section->num_pings = 0;
-				section->num_beams = 0;
-				section->continuity = MB_NO;
-				section->global_start_ping = project.num_pings;
-				section->global_start_snav = project.num_snavs;
-				for (i=0;i<MBNA_MASK_DIM*MBNA_MASK_DIM;i++)
-				    section->coverage[i] = 0;
-				section->num_snav = 0;
-				if (file->num_sections > 1)
-					{
-					csection = &file->sections[file->num_sections-2];
-					if (fabs(time_d - csection->etime_d) < MBNA_TIME_GAP_MAX)
-						{
-						section->continuity = MB_YES;
-						section->global_start_snav--;
-						file->num_snavs--;
-						project.num_snavs--;
-						}
-					}
-				else if (project.num_files > 1 && firstfile == MB_NO)
-					{
-					cfile = &project.files[project.num_files-2];
-					csection = &cfile->sections[cfile->num_sections-1];
-					if (fabs(time_d - csection->etime_d) < MBNA_TIME_GAP_MAX)
-						{
-						section->continuity = MB_YES;
-						section->global_start_snav--;
-						file->num_snavs--;
-						project.num_snavs--;
-						}
-					}
-				section->distance = 0.0;
-				section->btime_d = time_d;
-				section->etime_d = time_d;
-				section->lonmin = navlon;
-				section->lonmax = navlon;
-				section->latmin = navlat;
-				section->latmax = navlat;
-				section->depthmin = 0.0;
-				section->depthmax = 0.0;
-				section->contoursuptodate = MB_NO;
-				section->global_tie_status = MBNA_TIE_NONE;
-				section->global_tie_snav = MBNA_SELECT_NONE;
-				section->global_tie_offset_x = 0.0;
-				section->global_tie_offset_y = 0.0;
-				section->global_tie_offset_x_m = 0.0;
-				section->global_tie_offset_y_m = 0.0;
-				section->global_tie_offset_z_m = 0.0;
-				section->global_tie_xsigma = 0.0;
-				section->global_tie_ysigma = 0.0;
-				section->global_tie_zsigma = 0.0;
-				new_segment = MB_NO;
-
-				/* open output section file */
-				sprintf(opath,"%s/nvs_%4.4d_%4.4d.mb71",
-					project.datadir,file->id,file->num_sections-1);
-				if ((status = mb_write_init(
-					mbna_verbose,opath,71,&ombio_ptr,
-					&obeams_bath,&obeams_amp,&opixels_ss,&error)) != MB_SUCCESS)
-					{
-					mb_error(mbna_verbose,error,&error_message);
-					fprintf(stderr,"\nMBIO Error returned from function <mb_write_init>:\n%s\n",error_message);
-					fprintf(stderr,"\nSwath sonar File <%s> not initialized for writing\n",path);
-					}
-				else
-					{
-					omb_io_ptr = (struct mb_io_struct *) ombio_ptr;
-					ostore_ptr = omb_io_ptr->store_data;
-					ostore = (struct mbsys_ldeoih_struct *) ostore_ptr;
-					ostore->kind = MB_DATA_DATA;
-					ostore->beams_bath = obeams_bath;
-					ostore->beams_amp = 0;
-					ostore->pixels_ss = 0;
-					ostore->kind = MB_DATA_DATA;
-					output_open = MB_YES;
-					status = mb_mallocd(mbna_verbose, __FILE__, __LINE__,obeams_bath*sizeof(char),
-							(void **)&ostore->beamflag,&error);
-					status = mb_mallocd(mbna_verbose, __FILE__, __LINE__,obeams_bath*sizeof(double),
-							(void **)&ostore->bath,&error);
-					status = mb_mallocd(mbna_verbose, __FILE__, __LINE__,obeams_bath*sizeof(double),
-							(void **)&ostore->bath_acrosstrack,&error);
-					status = mb_mallocd(mbna_verbose, __FILE__, __LINE__,obeams_bath*sizeof(double),
-							(void **)&ostore->bath_alongtrack,&error);
-
-					/* if error initializing memory then don't write the file */
-					if (error != MB_ERROR_NO_ERROR)
-						{
-						mb_error(mbna_verbose,error,&error_message);
-						fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",
-							error_message);
-						status = mb_freed(mbna_verbose,__FILE__,__LINE__,(void **)&ostore->beamflag,&error);
-						status = mb_freed(mbna_verbose,__FILE__,__LINE__,(void **)&ostore->bath,&error);
-						status = mb_freed(mbna_verbose,__FILE__,__LINE__,(void **)&ostore->bath_acrosstrack,&error);
-						status = mb_freed(mbna_verbose,__FILE__,__LINE__,(void **)&ostore->bath_alongtrack,&error);
-						status = mb_close(mbna_verbose,&ombio_ptr,&error);
-						output_open = MB_NO;
-						}
-					}
-				}
-
-			/* update section distance for each data ping */
-			if (kind == MB_DATA_DATA
-				&& error == MB_ERROR_NO_ERROR
-				&& section->num_pings > 1)
-				section->distance += distance;
-
-			/* handle good bathymetry */
-			if (kind == MB_DATA_DATA
-				&& error == MB_ERROR_NO_ERROR)
-				{
-				/* get statistics */
-				mb_coor_scale(mbna_verbose,navlat,&mtodeglon,&mtodeglat);
-				headingx = sin(DTR*heading);
-				headingy = cos(DTR*heading);
-				navlon_old = navlon;
-				navlat_old = navlat;
-				section->etime_d = time_d;
-				section->num_pings++;
-				file->num_pings++;
-				project.num_pings++;
-				new_pings++;
-				if (section->distance >=
-				    section->num_snav * project.section_length / (MBNA_SNAV_NUM - 1))
-					{
-					section->snav_id[section->num_snav]
-						= section->num_pings - 1;
-					section->snav_num_ties[section->num_snav]
-						= 0;
-					section->snav_distance[section->num_snav]
-						= section->distance;
-					section->snav_time_d[section->num_snav]
-						= time_d;
-					section->snav_lon[section->num_snav]
-						= navlon;
-					section->snav_lat[section->num_snav]
-						= navlat;
-					section->snav_lon_offset[section->num_snav]
-						= 0.0;
-					section->snav_lat_offset[section->num_snav]
-						= 0.0;
-					section->snav_z_offset[section->num_snav]
-						= 0.0;
-					section->snav_lon_offset_int[section->num_snav]
-						= 0.0;
-					section->snav_lat_offset_int[section->num_snav]
-						= 0.0;
-					section->snav_z_offset_int[section->num_snav]
-						= 0.0;
-					section->num_snav++;
-					file->num_snavs++;
-					project.num_snavs++;
-					}
-				for (i=0;i<beams_bath;i++)
-					{
-					if (mb_beam_ok(beamflag[i]) && bath[i] != 0.0)
-						{
-						good_beams++;
-						project.num_beams++;
-						file->num_beams++;
-						section->num_beams++;
-						lon = navlon
-							+ headingy*mtodeglon
-								* bathacrosstrack[i]
-							+ headingx*mtodeglon
-								* bathalongtrack[i];
-						lat = navlat
-							- headingx*mtodeglat
-								* bathacrosstrack[i]
-							+ headingy*mtodeglat
-								* bathalongtrack[i];
-						if (lon != 0.0) section->lonmin = MIN(section->lonmin,lon);
-						if (lon != 0.0) section->lonmax = MAX(section->lonmax,lon);
-						if (lat != 0.0) section->latmin = MIN(section->latmin,lat);
-						if (lat != 0.0) section->latmax = MAX(section->latmax,lat);
-						if (section->depthmin == 0.0)
-							section->depthmin = bath[i];
-						else
-							section->depthmin = MIN(section->depthmin,bath[i]);
-						if (section->depthmin == 0.0)
-							section->depthmax = bath[i];
-						else
-							section->depthmax = MAX(section->depthmax,bath[i]);
-						}
-					else
-						{
-						beamflag[i] = MB_FLAG_NULL;
-						bath[i] = 0.0;
-						bathacrosstrack[i] = 0.0;
-						bathalongtrack[i] = 0.0;
-						}
-					}
-
-				/* write out bath data only to format 71 file */
-				if (output_open == MB_YES)
-					{
-/*if (error <= MB_ERROR_NO_ERROR && kind == MB_DATA_DATA)
-fprintf(stderr,"%3d %4d/%2d/%2d %2.2d:%2.2d:%2.2d.%6.6d %10f %10f %5.2f %6.2f %7.3f %7.3f %4d %4d %4d\n",
-file->num_sections,
-time_i[0],time_i[1],time_i[2],time_i[3],time_i[4],time_i[5],time_i[6],
-navlon,navlat,speed,heading,distance,section->distance,
-beams_bath,beams_amp,pixels_ss);*/
-
-					/* get depth and distance scaling */
-					depthmax = 0.0;
-					distmax = 0.0;
-					for (i=0;i<beams_bath;i++)
-					    {
-					    depthmax = MAX(depthmax,
-							fabs(bath[i]));
-					    distmax = MAX(distmax,
-							fabs(bathacrosstrack[i]));
-					    distmax = MAX(distmax,
-							fabs(bathalongtrack[i]));
-					    }
-					depthscale = MAX(0.001, depthmax / 32000);
-					distscale = MAX(0.001, distmax / 32000);
-					ostore->depth_scale = depthscale;
-					ostore->distance_scale = distscale;
-					ostore->sonardepth = draft - heave;
-					ostore->roll = roll;
-					ostore->pitch = pitch;
-					ostore->heave = heave;
-
-					/* write out data */
-					status = mb_put_all(mbna_verbose,ombio_ptr,ostore_ptr,
-							MB_YES,MB_DATA_DATA,
-							time_i,time_d,
-							navlon,navlat,speed,heading,
-							beams_bath,0,0,
-							beamflag,bath,amp,bathacrosstrack,bathalongtrack,
-							ss,ssacrosstrack,ssalongtrack,
-							comment,&error);
-					}
-				}
-
-			/* write out all nav data to format 166 file */
-			if ((kind == MB_DATA_DATA || kind == MB_DATA_NAV)
-				&& time_d > 0.0 && time_i[0] > 0
-				&& nfp != NULL)
-				{
-				/*fprintf(stderr, "%4.4d %2.2d %2.2d %2.2d %2.2d %2.2d.%6.6d %16.6f %.10f %.10f %.2f %.2f\r\n",
-					time_i[0], time_i[1], time_i[2], time_i[3],
-					time_i[4], time_i[5], time_i[6], time_d,
-					navlon, navlat, heading, speed);
-				fprintf(nfp, "%4.4d %2.2d %2.2d %2.2d %2.2d %2.2d.%6.6d %16.6f %.10f %.10f %.2f %.2f\r\n",
-					time_i[0], time_i[1], time_i[2], time_i[3],
-					time_i[4], time_i[5], time_i[6], time_d,
-					navlon, navlat, heading, speed);*/
-				/*fprintf(stderr, "%4.4d %2.2d %2.2d %2.2d %2.2d %2.2d.%6.6d %16.6f %.10f %.10f %.2f %.2f %.2f %.2f %.2f %.2f\r\n",
-						time_i[0], time_i[1], time_i[2], time_i[3],
-						time_i[4], time_i[5], time_i[6], time_d,
-						navlon, navlat, heading, speed,
-						draft, roll, pitch, heave);*/
-				fprintf(nfp, "%4.4d %2.2d %2.2d %2.2d %2.2d %2.2d.%6.6d %16.6f %.10f %.10f %.2f %.2f %.2f %.2f %.2f %.2f\r\n",
-						time_i[0], time_i[1], time_i[2], time_i[3],
-						time_i[4], time_i[5], time_i[6], time_d,
-						navlon, navlat, heading, speed,
-						draft, roll, pitch, heave);
-				}
-
-			/* increment counters */
-			if (error == MB_ERROR_NO_ERROR)
-				nread++;
-
-			/* print debug statements */
-			if (mbna_verbose >= 2)
-				{
-				fprintf(stderr,"\ndbg2  Ping read in program <%s>\n",
-					program_name);
-				fprintf(stderr,"dbg2       kind:           %d\n",kind);
-				fprintf(stderr,"dbg2       error:          %d\n",error);
-				fprintf(stderr,"dbg2       status:         %d\n",status);
-				}
-			if (mbna_verbose >= 2 && kind == MB_DATA_COMMENT)
-				{
-				fprintf(stderr,"dbg2       comment:        %s\n",comment);
-				}
-			if (mbna_verbose >= 2 && error <= 0 && kind == MB_DATA_DATA)
-				{
-				fprintf(stderr,"dbg2       time_i:         %4d/%2d/%2d %2.2d:%2.2d:%2.2d.%6.6d\n",
-							time_i[0],time_i[1],
-							time_i[2],time_i[3],
-							time_i[4],time_i[5],time_i[6]);
-				fprintf(stderr,"dbg2       time_d:         %f\n",time_d);
-				fprintf(stderr,"dbg2       navlon:         %.10f\n",navlon);
-				fprintf(stderr,"dbg2       navlat:         %.10f\n",navlat);
-				fprintf(stderr,"dbg2       speed:          %f\n",speed);
-				fprintf(stderr,"dbg2       heading:        %f\n",heading);
-				fprintf(stderr,"dbg2       distance:       %f\n",distance);
-				fprintf(stderr,"dbg2       beams_bath:     %d\n",beams_bath);
-				fprintf(stderr,"dbg2       beams_amp:      %d\n",beams_amp);
-				fprintf(stderr,"dbg2       pixels_ss:      %d\n",pixels_ss);
-				}
-			}
-
-		/* close the swath file */
-		status = mb_close(mbna_verbose,&imbio_ptr,&error);
-		if (nfp != NULL)
-			fclose(nfp);
-		if (output_open == MB_YES)
-			{
-			status = mb_freed(mbna_verbose,__FILE__,__LINE__,(void **)&ostore->beamflag,&error);
-			status = mb_freed(mbna_verbose,__FILE__,__LINE__,(void **)&ostore->bath,&error);
-			status = mb_freed(mbna_verbose,__FILE__,__LINE__,(void **)&ostore->bath_acrosstrack,&error);
-			status = mb_freed(mbna_verbose,__FILE__,__LINE__,(void **)&ostore->bath_alongtrack,&error);
-			status = mb_close(mbna_verbose,&ombio_ptr,&error);
-			}
-
-		/* deallocate bin arrays if needed */
-		if (bin_nbath != NULL)
-			{
-			status = mb_freed(mbna_verbose, __FILE__, __LINE__,(void **)&bin_nbath,&error);
-			status = mb_freed(mbna_verbose, __FILE__, __LINE__,(void **)&bin_bath,&error);
-			status = mb_freed(mbna_verbose, __FILE__, __LINE__,(void **)&bin_bathacrosstrack,&error);
-			status = mb_freed(mbna_verbose, __FILE__, __LINE__,(void **)&bin_bathalongtrack,&error);
-			}
-
-		/* get coverage masks for each section */
-		if (file != NULL && first != MB_YES)
-			{
-			/* loop over all sections */
-			for (k=0;k<file->num_sections;k++)
-				{
-				/* set section data to be read */
-				section = (struct mbna_section *) &file->sections[k];
-				sprintf(opath,"%s/nvs_%4.4d_%4.4d.mb71",
-					project.datadir,file->id,k);
-
-				/* initialize reading the swath file */
-				if ((status = mb_read_init(
-				    mbna_verbose,opath,71,1,lonflip,bounds,
-				    btime_i,etime_i,speedmin,timegap,
-				    &ombio_ptr,&btime_d,&etime_d,
-				    &beams_bath,&beams_amp,&pixels_ss,&error)) != MB_SUCCESS)
-				    {
-				    mb_error(mbna_verbose,error,&error_message);
-				    fprintf(stderr,"\nMBIO Error returned from function <mb_read_init>:\n%s\n",error_message);
-				    fprintf(stderr,"\nSwath sonar File <%s> not initialized for reading\n",path);
-				    }
-
-				/* allocate memory for data arrays */
-				if (status == MB_SUCCESS)
-				    {
-				    beamflag = NULL;
-				    bath = NULL;
-				    amp = NULL;
-				    bathacrosstrack = NULL;
-				    bathalongtrack = NULL;
-				    ss = NULL;
-				    ssacrosstrack = NULL;
-				    ssalongtrack = NULL;
-				    if (error == MB_ERROR_NO_ERROR)
-					    status = mb_register_array(mbna_verbose, ombio_ptr, MB_MEM_TYPE_BATHYMETRY,
-									    sizeof(char), (void **)&beamflag, &error);
-				    if (error == MB_ERROR_NO_ERROR)
-					    status = mb_register_array(mbna_verbose, ombio_ptr, MB_MEM_TYPE_BATHYMETRY,
-									    sizeof(double), (void **)&bath, &error);
-				    if (error == MB_ERROR_NO_ERROR)
-					    status = mb_register_array(mbna_verbose, ombio_ptr, MB_MEM_TYPE_AMPLITUDE,
-									    sizeof(double), (void **)&amp, &error);
-				    if (error == MB_ERROR_NO_ERROR)
-					    status = mb_register_array(mbna_verbose, ombio_ptr, MB_MEM_TYPE_BATHYMETRY,
-									    sizeof(double), (void **)&bathacrosstrack, &error);
-				    if (error == MB_ERROR_NO_ERROR)
-					    status = mb_register_array(mbna_verbose, ombio_ptr, MB_MEM_TYPE_BATHYMETRY,
-									    sizeof(double), (void **)&bathalongtrack, &error);
-				    if (error == MB_ERROR_NO_ERROR)
-					    status = mb_register_array(mbna_verbose, ombio_ptr, MB_MEM_TYPE_SIDESCAN,
-									    sizeof(double), (void **)&ss, &error);
-				    if (error == MB_ERROR_NO_ERROR)
-					    status = mb_register_array(mbna_verbose, ombio_ptr, MB_MEM_TYPE_SIDESCAN,
-									    sizeof(double), (void **)&ssacrosstrack, &error);
-				    if (error == MB_ERROR_NO_ERROR)
-					    status = mb_register_array(mbna_verbose, ombio_ptr, MB_MEM_TYPE_SIDESCAN,
-									    sizeof(double), (void **)&ssalongtrack, &error);
-
-				    /* if error initializing memory then don't read the file */
-				    if (error != MB_ERROR_NO_ERROR)
-					{
-					mb_error(mbna_verbose,error,&error_message);
-					fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",
-						error_message);
-					}
-				    }
-
-				/* loop over reading data */
-				dx1 = (section->lonmax - section->lonmin) / MBNA_MASK_DIM;
-				dy1 = (section->latmax - section->latmin) / MBNA_MASK_DIM;
-				while (error <= MB_ERROR_NO_ERROR)
-				    {
-				    /* read a ping of data */
-				    status = mb_get_all(mbna_verbose,ombio_ptr,&ostore_ptr,&kind,
-					    time_i,&time_d,&navlon,&navlat,&speed,
-					    &heading,&distance,&altitude,&sonardepth,
-					    &beams_bath,&beams_amp,&pixels_ss,
-					    beamflag,bath,amp,bathacrosstrack,bathalongtrack,
-					    ss,ssacrosstrack,ssalongtrack,
-					    comment,&error);
-
-				    /* ignore minor errors */
-				    if (kind == MB_DATA_DATA
-					    && (error == MB_ERROR_TIME_GAP
-						    || error == MB_ERROR_OUT_BOUNDS
-						    || error == MB_ERROR_OUT_TIME
-						    || error == MB_ERROR_SPEED_TOO_SMALL))
-					{
-					status = MB_SUCCESS;
-					error = MB_ERROR_NO_ERROR;
-					}
-
-				    /* check for good bathymetry */
-				    if (kind == MB_DATA_DATA
-					    && error == MB_ERROR_NO_ERROR)
-					{
-					mb_coor_scale(mbna_verbose,navlat,&mtodeglon,&mtodeglat);
-					headingx = sin(DTR*heading);
-					headingy = cos(DTR*heading);
-					for (i=0;i<beams_bath;i++)
-					    {
-					    if (mb_beam_ok(beamflag[i]) && bath[i] != 0.0)
-						{
-						lon = navlon
-							+ headingy*mtodeglon
-								* bathacrosstrack[i]
-							+ headingx*mtodeglon
-								* bathalongtrack[i];
-						lat = navlat
-							- headingx*mtodeglat
-								* bathacrosstrack[i]
-							+ headingy*mtodeglat
-								* bathalongtrack[i];
-						ii1 = (lon - section->lonmin) / dx1;
-						jj1 = (lat - section->latmin) / dy1;
-						if (ii1 >= 0 && ii1 < MBNA_MASK_DIM
-						    && jj1 >= 0 && jj1 < MBNA_MASK_DIM)
-						    {
-						    section->coverage[ii1 + jj1 * MBNA_MASK_DIM] = 1;
-						    }
-						}
-					    }
-					}
-				    }
-/*fprintf(stderr,"%s/nvs_%4.4d_%4.4d.mb71\n",
-project.datadir,file->id,k);
-for (jj1=MBNA_MASK_DIM-1;jj1>=0;jj1--)
-{
-for (ii1=0;ii1<MBNA_MASK_DIM;ii1++)
-{
-kk1 = ii1 + jj1 * MBNA_MASK_DIM;
-fprintf(stderr, "%1d", section->coverage[kk1]);
-}
-fprintf(stderr, "\n");
-}*/
-
-				/* deallocate memory used for data arrays */
-				status = mb_close(mbna_verbose,&ombio_ptr,&error);
-				}
-			}
-		}
-
-	/* add info text */
-	if (status == MB_SUCCESS && new_pings > 0)
-		{
-		sprintf(message, "Imported format %d file: %s\n > Read %d pings\n > Added %d sections %d crossings\n",
-			iformat, path, new_pings, file->num_sections, new_crossings);
-		do_info_add(message, MB_YES);
-		}
-	else
-		{
-		sprintf(message, "Unable to import format %d file: %s\n",
-			iformat, path);
-		do_info_add(message, MB_YES);
-		}
-
-	/* turn off message */
-	do_message_off();
-
- 	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbnavadjust_bin_bathymetry(double altitude, int beams_bath, char *beamflag, double *bath,
-				double *bathacrosstrack, double *bathalongtrack,
-				int mbna_bin_beams_bath, double mbna_bin_pseudobeamwidth,
-				double mbna_bin_swathwidth, char *bin_beamflag,
-				double *bin_bath, double *bin_bathacrosstrack, double *bin_bathalongtrack,
-				int *error)
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_bin_bathymetry";
-	int	status = MB_SUCCESS;
-	int	i;
-
- 	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2                       mbna_verbose: %d\n",mbna_verbose);
-		fprintf(stderr,"dbg2                       altitude:     %f\n",altitude);
-		fprintf(stderr,"dbg2                       beams_bath:   %d\n",beams_bath);
-		for (i=0;i<beams_bath;i++)
-			fprintf(stderr,"dbg2                       beam[%d]: %f %f %f %d\n",
-				i,bath[i],bathacrosstrack[i],bathalongtrack[i],beamflag[i]);
-		fprintf(stderr,"dbg2                       mbna_bin_beams_bath:      %d\n",mbna_bin_beams_bath);
-		fprintf(stderr,"dbg2                       mbna_bin_pseudobeamwidth: %f\n",mbna_bin_pseudobeamwidth);
-		fprintf(stderr,"dbg2                       mbna_bin_swathwidth:      %f\n",mbna_bin_swathwidth);
-		}
-
- 	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		for (i=0;i<mbna_bin_beams_bath;i++)
-			fprintf(stderr,"dbg2                       beam[%d]: %f %f %f %d\n",
-				i,bin_bath[i],bin_bathacrosstrack[i],bin_bathalongtrack[i],bin_beamflag[i]);
-		fprintf(stderr,"dbg2       error:       %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbnavadjust_findcrossings()
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_findcrossings";
-	int	status = MB_SUCCESS;
-	struct mbna_crossing *crossing;
-	int	ifile, icrossing;
-
- 	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
-
-	/* turn on message */
-	sprintf(message,"Checking for crossings...");
-	do_message_on(message);
-
-     	/* loop over files looking for new crossings */
-    	if (project.open == MB_YES
-    		&& project.num_files > 0)
-		{
-		/* look for new crossings through all files */
-		for (ifile=0;ifile<project.num_files;ifile++)
-			{
-			sprintf(message,"Checking for crossings with file %d of %d...",ifile,project.num_files);
-			do_message_update(message);
-
-			status = mbnavadjust_findcrossingsfile(ifile);
-			}
-
-		/* resort crossings */
-		sprintf(message,"Sorting crossings....");
-		do_message_update(message);
-		if (project.num_crossings > 1)
-		mb_mergesort((void *)project.crossings, (size_t)project.num_crossings, sizeof(struct mbna_crossing), mbnavadjust_crossing_compare);
-
-		/* recalculate overlap fractions, true crossings, good crossing statistics */
-		sprintf(message,"Calculating crossing overlaps...");
-		do_message_update(message);
-
-		project.num_crossings_analyzed = 0;
-		project.num_goodcrossings = 0;
-		project.num_truecrossings = 0;
-		project.num_truecrossings_analyzed = 0;
-		for (icrossing=0;icrossing<project.num_crossings;icrossing++)
-			{
-			crossing = &(project.crossings[icrossing]);
-
-			/* recalculate crossing overlap */
-			mbnavadjust_crossing_overlap(icrossing);
-			if (crossing->overlap >= 25)
-				project.num_goodcrossings++;
-
-			/* check if this is a true crossing */
-			if (mbnavadjust_sections_intersect(icrossing) == MB_YES)
-				{
-				crossing->truecrossing = MB_YES;
-				project.num_truecrossings++;
-				if (crossing->status != MBNA_CROSSING_STATUS_NONE)
-					project.num_truecrossings_analyzed++;
-				}
-			else
-				crossing->truecrossing = MB_NO;
-			if (crossing->status != MBNA_CROSSING_STATUS_NONE)
-				project.num_crossings_analyzed++;
-			}
-		}
-
-	/* turn off message */
-	do_message_off();
-
- 	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbnavadjust_crossing_compare(const void *a, const void *b)
-{
-	struct mbna_crossing	*aa, *bb;
-	int a1id, a2id, b1id, b2id;
-	int aid, bid;
-
-	aa = (struct mbna_crossing *) a;
-	bb = (struct mbna_crossing *) b;
-
-	a1id = aa->file_id_1 * 1000 + aa->section_1;
-	a2id = aa->file_id_2 * 1000 + aa->section_2;
-	if (a1id > a2id)
-		aid = a1id;
-	else
-		aid = a2id;
-
-	b1id = bb->file_id_1 * 1000 + bb->section_1;
-	b2id = bb->file_id_2 * 1000 + bb->section_2;
-	if (b1id > b2id)
-		bid = b1id;
-	else
-		bid = b2id;
-
-	if (aid > bid)
-		return(1);
-	else if (aid < bid)
-		return(-1);
-	else if (a1id > b1id)
-		return(1);
-	else if (a1id < b1id)
-		return(-1);
-	else if (a2id > b2id)
-		return(1);
-	else if (a2id < b2id)
-		return(-1);
-	else
-		return(0);
-}
-
-/*--------------------------------------------------------------------*/
-int mbnavadjust_findcrossingsfile(int ifile)
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_findcrossingsfile";
-	int	status = MB_SUCCESS;
-	struct mbna_file *file1, *file2;
-	struct mbna_section *section1, *section2;
-	struct mbna_crossing *crossing;
-	int	found, overlap, disqualify;
-	int	isection, jfile, jsection, jsectionmax, icrossing;
-	double	lonoffset1, latoffset1, lonoffset2, latoffset2;
-	double	lonmin1, lonmax1, latmin1, latmax1;
-	double	lonmin2, lonmax2, latmin2, latmax2;
-	double	cell1lonmin, cell1lonmax, cell1latmin, cell1latmax;
-	double	cell2lonmin, cell2lonmax, cell2latmin, cell2latmax;
-	double	dx1, dy1, dx2, dy2;
-	int	ii1, jj1, kk1, ii2, jj2, kk2;
-
- 	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2                       ifile: %d\n",ifile);
-		}
-
-     	/* loop over files and sections, comparing sections from project.files[ifile] with all previous sections */
-    	if (project.open == MB_YES
-    		&& project.num_files > 0)
-		{
-		file2 = &(project.files[ifile]);
-
-		/* loop over all sections */
-		for (isection=0;isection<file2->num_sections;isection++)
-			{
-			section2 = &(file2->sections[isection]);
-			lonoffset2 = section2->snav_lon_offset[section2->num_snav/2];
-			latoffset2 = section2->snav_lat_offset[section2->num_snav/2];
-
-			/* get coverage mask adjusted for most recent inversion solution */
-			lonmin2 = section2->lonmin + lonoffset2;
-			lonmax2 = section2->lonmax + lonoffset2;
-			latmin2 = section2->latmin + latoffset2;
-			latmax2 = section2->latmax + latoffset2;
-			dx2 = (section2->lonmax - section2->lonmin) / (MBNA_MASK_DIM - 1);
-			dy2 = (section2->latmax - section2->latmin) / (MBNA_MASK_DIM - 1);
-
-			/* now loop over all previous sections looking for crossings */
-			for (jfile=0;jfile<=ifile;jfile++)
-				{
-				file1 = &(project.files[jfile]);
-				if (jfile < ifile)
-					jsectionmax = file1->num_sections;
-				else
-					jsectionmax = isection;
-				for (jsection=0;jsection<jsectionmax;jsection++)
-					{
-					section1 = &(file1->sections[jsection]);
-					lonoffset1 = section1->snav_lon_offset[section1->num_snav/2];
-					latoffset1 = section1->snav_lat_offset[section1->num_snav/2];
-
-					/* get coverage mask adjusted for most recent inversion solution */
-					lonmin1 = section1->lonmin + lonoffset1;
-					lonmax1 = section1->lonmax + lonoffset1;
-					latmin1 = section1->latmin + latoffset1;
-					latmax1 = section1->latmax + latoffset1;
-					dx1 = (section1->lonmax - section1->lonmin) / (MBNA_MASK_DIM - 1);
-					dy1 = (section1->latmax - section1->latmin) / (MBNA_MASK_DIM - 1);
-
-					/* check if there is overlap given the current navigation model */
-					overlap = 0;
-					disqualify = MB_NO;
-					if (jfile == ifile && jsection == isection - 1 && section2->continuity == MB_YES)
-						disqualify = MB_YES;
-					else if (jfile == ifile - 1 && jsection == file1->num_sections - 1 && isection == 0
-						&& section2->continuity == MB_YES)
-						disqualify = MB_YES;
-					else if (!(lonmin2 < lonmax1 && lonmax2 > lonmin1
-							&& latmin2 < latmax1 && latmax2 > latmin1))
-						{
-						disqualify = MB_YES;
-						}
-					else
-						{
-						/* loop over the coverage mask cells looking for overlap */
-						for (ii2=0;ii2<MBNA_MASK_DIM && overlap == 0;ii2++)
-						for (jj2=0;jj2<MBNA_MASK_DIM && overlap == 0;jj2++)
-							{
-							kk2 = ii2 + jj2 * MBNA_MASK_DIM;
-							if (section2->coverage[kk2] == 1)
-								{
-								cell2lonmin = lonmin2 + ii2 * dx2;
-								cell2lonmax = lonmin2 + (ii2 + 1) * dx2;
-								cell2latmin = latmin2 + jj2 * dy2;
-								cell2latmax = latmin2 + (jj2 + 1) * dy2;
-
-								for (ii1=0;ii1<MBNA_MASK_DIM && overlap == 0;ii1++)
-								for (jj1=0;jj1<MBNA_MASK_DIM && overlap == 0;jj1++)
-									{
-									kk1 = ii1 + jj1 * MBNA_MASK_DIM;
-									if (section1->coverage[kk1] == 1)
-										{
-										cell1lonmin = lonmin1 + ii1 * dx1;
-										cell1lonmax = lonmin1 + (ii1 + 1) * dx1;
-										cell1latmin = latmin1 + jj1 * dy2;
-										cell1latmax = latmin1 + (jj1 + 1) * dy1;
-
-										/* check if these two cells overlap */
-										if (cell2lonmin < cell1lonmax && cell2lonmax > cell1lonmin
-											&& cell2latmin < cell1latmax && cell2latmax > cell1latmin)
-											{
-											overlap++;
-											}
-										}
-									}
-								}
-							}
-						}
-
-					/* if not disqualified and overlap found, then this is a crossing */
-					/* check to see if the crossing exists, if not add it */
-					if (disqualify == MB_NO && overlap > 0)
-						{
-						found = MB_NO;
-						for (icrossing=0;icrossing<project.num_crossings && found == MB_NO;icrossing++)
-							{
-							crossing = &(project.crossings[icrossing]);
-							if (crossing->file_id_2 == ifile && crossing->file_id_1 == jfile
-								&& crossing->section_2 == isection && crossing->section_1 == jsection)
-								{
-								found = MB_YES;
-								}
-							else if (crossing->file_id_1 == ifile && crossing->file_id_2 == jfile
-								&& crossing->section_1 == isection && crossing->section_2 == jsection)
-								{
-								found = MB_YES;
-								}
-							}
-						if (found == MB_NO)
-							{
-							/* allocate mbna_crossing array if needed */
-							if (project.num_crossings_alloc <= project.num_crossings)
-							    {
-							    project.crossings = (struct mbna_crossing *) realloc(project.crossings,
-									    sizeof(struct mbna_crossing) * (project.num_crossings_alloc + ALLOC_NUM));
-							    if (project.crossings != NULL)
-								    project.num_crossings_alloc += ALLOC_NUM;
-							    else
-								{
-								status = MB_FAILURE;
-								error = MB_ERROR_MEMORY_FAIL;
-								}
-							    }
-
-							/* add crossing to list */
-							crossing = (struct mbna_crossing *) &project.crossings[project.num_crossings];
-							crossing->status = MBNA_CROSSING_STATUS_NONE;
-							crossing->truecrossing = MB_NO;
-							crossing->overlap = 0;
-							crossing->file_id_1 = file1->id;
-							crossing->section_1 = jsection;
-							crossing->file_id_2 = file2->id;
-							crossing->section_2 = isection;
-							crossing->num_ties = 0;
-							project.num_crossings++;
-
-fprintf(stderr,"added crossing: %d  %4d %4d   %4d %4d\n",
-project.num_crossings-1,
-crossing->file_id_1,crossing->section_1,
-crossing->file_id_2,crossing->section_2);
-							}
-/*else
-fprintf(stderr,"no new crossing:    %4d %4d   %4d %4d   duplicate\n",
-file2->id,isection,
-file1->id,jsection);*/
-						}
-/*else
-fprintf(stderr,"disqualified:       %4d %4d   %4d %4d   disqualify:%d overlaptxt list:%d\n",
-file2->id,isection,
-file1->id,jsection, disqualify, overlap);*/
-
-					}
-				}
-			}
-		}
-
- 	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbnavadjust_poornav_file()
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_poornav_file";
-	int	status = MB_SUCCESS;
-	int	block;
- 	int	i;
-
- 	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
-
-     	/* set selected file's block to poor nav */
-    	if (project.open == MB_YES
-    		&& project.num_files > 0
-		&& mbna_file_select >= 0
-		&& mbna_file_select < project.num_files)
-		{
-		/* get affected survey block */
-		if (mbna_view_list == MBNA_VIEW_LIST_SURVEYS)
-			{
-			block = mbna_survey_select;
-			}
-		else if (mbna_view_list == MBNA_VIEW_LIST_FILES)
-			{
-			block = project.files[mbna_file_select].block;
-			}
-
-		/* set all files in block of selected file to poor nav */
-		for (i=0;i<project.num_files;i++)
-			{
-			if (project.files[i].block == block)
-				{
-				project.files[i].status = MBNA_FILE_POORNAV;
-				}
-			}
-
-		/* write out updated project */
-		mbnavadjust_write_project();
-
-		/* add info text */
-		sprintf(message, "Set file %d to have poor nav: %s\n",
-			    mbna_file_select,project.files[mbna_file_select].file);
-		do_info_add(message, MB_YES);
-   		}
-
- 	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbnavadjust_goodnav_file()
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_goodnav_file";
-	int	status = MB_SUCCESS;
- 	int	block;
-	int	i;
-
- 	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
-
-     	/* set selected file's block to good nav */
-    	if (project.open == MB_YES
-    		&& project.num_files > 0
-		&& mbna_file_select >= 0
-		&& mbna_file_select < project.num_files)
-		{
-		/* get affected survey block */
-		if (mbna_view_list == MBNA_VIEW_LIST_SURVEYS)
-			{
-			block = mbna_survey_select;
-			}
-		else if (mbna_view_list == MBNA_VIEW_LIST_FILES)
-			{
-			block = project.files[mbna_file_select].block;
-			}
-
-		/* set all files in block of selected file to good nav */
-		for (i=0;i<project.num_files;i++)
-			{
-			if (project.files[i].block == block)
-				{
-				project.files[i].status = MBNA_FILE_GOODNAV;
-				}
-			}
-		if (project.inversion == MBNA_INVERSION_CURRENT)
-			project.inversion = MBNA_INVERSION_OLD;
-
-		/* write out updated project */
-		mbnavadjust_write_project();
-
-		/* add info text */
-		sprintf(message, "Set file %d to have good nav: %s\n",
-			    mbna_file_select,project.files[mbna_file_select].file);
-		do_info_add(message, MB_YES);
-   		}
-
- 	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbnavadjust_fixednav_file()
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_fixednav_file";
-	int	status = MB_SUCCESS;
- 	int	block;
-	int	i;
-
- 	/* print input debug statements */
-	if (mbna_verbose >= 0)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
-
-     	/* set selected file's block to good nav */
-    	if (project.open == MB_YES
-    		&& project.num_files > 0
-		&& mbna_file_select >= 0
-		&& mbna_file_select < project.num_files)
-		{
-		/* get affected survey block */
-		if (mbna_view_list == MBNA_VIEW_LIST_SURVEYS)
-			{
-			block = mbna_survey_select;
-			}
-		else if (mbna_view_list == MBNA_VIEW_LIST_FILES)
-			{
-			block = project.files[mbna_file_select].block;
-			}
-
-		/* set all files in block of selected file to fixed nav */
-		for (i=0;i<project.num_files;i++)
-			{
-			if (project.files[i].block == block)
-				{
-				project.files[i].status = MBNA_FILE_FIXEDNAV;
-				fprintf(stderr,"Set file to have fixed nav: %d %s\n",i,project.files[i].file);
-				}
-			}
-		if (project.inversion == MBNA_INVERSION_CURRENT)
-			project.inversion = MBNA_INVERSION_OLD;
-
-		/* write out updated project */
-		mbnavadjust_write_project();
-
-		/* add info text */
-		sprintf(message, "Set file %d to have fixed nav: %s\n",
-			    mbna_file_select,project.files[mbna_file_select].file);
-		do_info_add(message, MB_YES);
-   		}
-
- 	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbnavadjust_fixedxynav_file()
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_fixedxynav_file";
-	int	status = MB_SUCCESS;
- 	int	block;
-	int	i;
-
- 	/* print input debug statements */
-	if (mbna_verbose >= 0)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
-
-     	/* set selected file's block to good nav */
-    	if (project.open == MB_YES
-    		&& project.num_files > 0
-		&& mbna_file_select >= 0
-		&& mbna_file_select < project.num_files)
-		{
-		/* get affected survey block */
-		if (mbna_view_list == MBNA_VIEW_LIST_SURVEYS)
-			{
-			block = mbna_survey_select;
-			}
-		else if (mbna_view_list == MBNA_VIEW_LIST_FILES)
-			{
-			block = project.files[mbna_file_select].block;
-			}
-
-		/* set all files in block of selected file to fixed nav */
-		for (i=0;i<project.num_files;i++)
-			{
-			if (project.files[i].block == block)
-				{
-				project.files[i].status = MBNA_FILE_FIXEDXYNAV;
-				fprintf(stderr,"Set file to have fixed xy nav: %d %s\n",i,project.files[i].file);
-				}
-			}
-		if (project.inversion == MBNA_INVERSION_CURRENT)
-			project.inversion = MBNA_INVERSION_OLD;
-
-		/* write out updated project */
-		mbnavadjust_write_project();
-
-		/* add info text */
-		sprintf(message, "Set file %d to have fixed xy nav: %s\n",
-			    mbna_file_select,project.files[mbna_file_select].file);
-		do_info_add(message, MB_YES);
-   		}
-
- 	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbnavadjust_fixedznav_file()
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_fixedznav_file";
-	int	status = MB_SUCCESS;
- 	int	block;
-	int	i;
-
- 	/* print input debug statements */
-	if (mbna_verbose >= 0)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
-
-     	/* set selected file's block to good nav */
-    	if (project.open == MB_YES
-    		&& project.num_files > 0
-		&& mbna_file_select >= 0
-		&& mbna_file_select < project.num_files)
-		{
-		/* get affected survey block */
-		if (mbna_view_list == MBNA_VIEW_LIST_SURVEYS)
-			{
-			block = mbna_survey_select;
-			}
-		else if (mbna_view_list == MBNA_VIEW_LIST_FILES)
-			{
-			block = project.files[mbna_file_select].block;
-			}
-
-		/* set all files in block of selected file to fixed nav */
-		for (i=0;i<project.num_files;i++)
-			{
-			if (project.files[i].block == block)
-				{
-				project.files[i].status = MBNA_FILE_FIXEDZNAV;
-				fprintf(stderr,"Set file to have fixed z nav: %d %s\n",i,project.files[i].file);
-				}
-			}
-		if (project.inversion == MBNA_INVERSION_CURRENT)
-			project.inversion = MBNA_INVERSION_OLD;
-
-		/* write out updated project */
-		mbnavadjust_write_project();
-
-		/* add info text */
-		sprintf(message, "Set file %d to have fixed z nav: %s\n",
-			    mbna_file_select,project.files[mbna_file_select].file);
-		do_info_add(message, MB_YES);
-   		}
-
- 	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbnavadjust_set_tie_xyz()
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_set_tie_xyz";
-	int	status = MB_SUCCESS;
-    	struct mbna_crossing *crossing;
-    	struct mbna_tie *tie;
-
- 	/* print input debug statements */
-	if (mbna_verbose >= 0)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
-
-     	/* set selected file's block to good nav */
-    	if (project.open == MB_YES
-    		&& project.num_files > 0
-		&& mbna_crossing_select >= 0
-		&& mbna_tie_select >= 0)
-		{
-		/* set tie to fix xyz */
-		crossing = &(project.crossings[mbna_crossing_select]);
-		tie = (struct mbna_tie *) &crossing->ties[mbna_tie_select];
-		tie->status = MBNA_TIE_XYZ;
-		fprintf(stderr,"Set crossing %d tie %d to fix XYZ\n",mbna_crossing_select,mbna_tie_select);
-		if (project.inversion == MBNA_INVERSION_CURRENT)
-			project.inversion = MBNA_INVERSION_OLD;
-
-		/* write out updated project */
-		mbnavadjust_write_project();
-
-		/* add info text */
-		sprintf(message, "Set crossing %d tie %d to fix XYZ\n",
-			    mbna_crossing_select,mbna_tie_select);
-		do_info_add(message, MB_YES);
-   		}
-
- 	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbnavadjust_set_tie_xy()
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_set_tie_xy";
-	int	status = MB_SUCCESS;
-    	struct mbna_crossing *crossing;
-    	struct mbna_tie *tie;
-
- 	/* print input debug statements */
-	if (mbna_verbose >= 0)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
-
-     	/* set selected file's block to good nav */
-    	if (project.open == MB_YES
-    		&& project.num_files > 0
-		&& mbna_crossing_select >= 0
-		&& mbna_tie_select >= 0)
-		{
-		/* set tie to fix xy */
-		crossing = &(project.crossings[mbna_crossing_select]);
-		tie = (struct mbna_tie *) &crossing->ties[mbna_tie_select];
-		tie->status = MBNA_TIE_XY;
-		fprintf(stderr,"Set crossing %d tie %d to fix XY\n",mbna_crossing_select,mbna_tie_select);
-		if (project.inversion == MBNA_INVERSION_CURRENT)
-			project.inversion = MBNA_INVERSION_OLD;
-
-		/* write out updated project */
-		mbnavadjust_write_project();
-
-		/* add info text */
-		sprintf(message, "Set crossing %d tie %d to fix XY\n",
-			    mbna_crossing_select,mbna_tie_select);
-		do_info_add(message, MB_YES);
-   		}
-
- 	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbnavadjust_set_tie_z()
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_set_tie_z";
-	int	status = MB_SUCCESS;
-    	struct mbna_crossing *crossing;
-    	struct mbna_tie *tie;
-
- 	/* print input debug statements */
-	if (mbna_verbose >= 0)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
-
-     	/* set selected file's block to good nav */
-    	if (project.open == MB_YES
-    		&& project.num_files > 0
-		&& mbna_crossing_select >= 0
-		&& mbna_tie_select >= 0)
-		{
-		/* set tie to fix z */
-		crossing = &(project.crossings[mbna_crossing_select]);
-		tie = (struct mbna_tie *) &crossing->ties[mbna_tie_select];
-		tie->status = MBNA_TIE_Z;
-		fprintf(stderr,"Set crossing %d tie %d to fix Z\n",mbna_crossing_select,mbna_tie_select);
-		if (project.inversion == MBNA_INVERSION_CURRENT)
-			project.inversion = MBNA_INVERSION_OLD;
-
-		/* write out updated project */
-		mbnavadjust_write_project();
-
-		/* add info text */
-		sprintf(message, "Set crossing %d tie %d to fix Z\n",
-			    mbna_crossing_select,mbna_tie_select);
-		do_info_add(message, MB_YES);
-   		}
-
- 	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbnavadjust_naverr_save()
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_naverr_save";
-	int	status = MB_SUCCESS;
-	struct mbna_file *file;
-	struct mbna_section *section;
-	struct mbna_crossing *crossing;
-	struct mbna_tie *tie;
-	int	i;
-
- 	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
-
-	/* save offsets if crossing loaded and ties set */
-    	if (project.open == MB_YES
-    		&& project.num_crossings > 0
-		&& mbna_naverr_load == MB_YES
-		&& mbna_current_crossing >= 0
-		&& mbna_current_tie >= 0)
-    		{
-		/* save offsets if ties set */
-		crossing = &project.crossings[mbna_current_crossing];
-		if (crossing->num_ties > 0
-		    && mbna_current_tie >= 0)
-		    {
-		    /* get relevant tie */
-		    tie = &crossing->ties[mbna_current_tie];
-
-		    /* reset tie counts for snavs */
-		    file = &project.files[crossing->file_id_1];
-		    section = &file->sections[crossing->section_1];
-		    section->snav_num_ties[tie->snav_1]--;
-		    file = &project.files[crossing->file_id_2];
-		    section = &file->sections[crossing->section_2];
-		    section->snav_num_ties[tie->snav_2]--;
-
-		    /* get new tie values */
-/* fprintf(stderr, "tie %d of crossing %d saved...\n", mbna_current_tie, mbna_current_crossing); */
-		    /* tie->status = tie->status; */
-		    tie->snav_1 = mbna_snav_1;
-		    tie->snav_1_time_d = mbna_snav_1_time_d;
-		    tie->snav_2 = mbna_snav_2;
-		    tie->snav_2_time_d = mbna_snav_2_time_d;
-		    if (tie->inversion_status == MBNA_INVERSION_CURRENT
-			&& (tie->offset_x != mbna_offset_x
-			    || tie->offset_y != mbna_offset_y
-			    || tie->offset_z_m != mbna_offset_z))
-			{
-			tie->inversion_status = MBNA_INVERSION_OLD;
-			}
-		    tie->offset_x = mbna_offset_x;
-		    tie->offset_y = mbna_offset_y;
-		    tie->offset_x_m = mbna_offset_x / mbna_mtodeglon;
-		    tie->offset_y_m = mbna_offset_y / mbna_mtodeglat;
-		    tie->offset_z_m = mbna_offset_z;
-		    tie->sigmar1 = mbna_minmisfit_sr1;
-		    tie->sigmar2 = mbna_minmisfit_sr2;
-		    tie->sigmar3 = mbna_minmisfit_sr3;
-		    for (i=0;i<3;i++)
-			    {
-			    tie->sigmax1[i] = mbna_minmisfit_sx1[i];
-			    tie->sigmax2[i] = mbna_minmisfit_sx2[i];
-			    tie->sigmax3[i] = mbna_minmisfit_sx3[i];
-			    }
-		    if (project.inversion == MBNA_INVERSION_CURRENT)
-			    project.inversion = MBNA_INVERSION_OLD;
-
-		    /* reset tie counts for snavs */
-		    file = &project.files[crossing->file_id_1];
-		    section = &file->sections[crossing->section_1];
-		    section->snav_num_ties[tie->snav_1]++;
-		    file = &project.files[crossing->file_id_2];
-		    section = &file->sections[crossing->section_2];
-		    section->snav_num_ties[tie->snav_2]++;
-
-		    /* write updated project */
-		    mbnavadjust_write_project();
-
-		    /* add info text */
-		    sprintf(message,"Save Tie Point %d of Crossing %d\n > Nav points: %d:%d:%d %d:%d:%d\n > Offsets: %f %f %f m\n",
-			    mbna_current_tie, mbna_current_crossing,
-			    crossing->file_id_1, crossing->section_1, tie->snav_1,
-			    crossing->file_id_2, crossing->section_2, tie->snav_2,
-			    tie->offset_x_m, tie->offset_y_m, tie->offset_z_m);
-		    if (mbna_verbose == 0)
-			    fprintf(stderr,"%s",message);
-		    do_info_add(message, MB_YES);
-		    }
-		}
-
- 	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbnavadjust_naverr_specific(int new_crossing, int new_tie)
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_naverr_specific";
-	int	status = MB_SUCCESS;
-	struct mbna_crossing *crossing;
-	struct mbna_tie *tie;
-
- 	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2               new_crossing: %d\n",new_crossing);
-		fprintf(stderr,"dbg2               new_tie:      %d\n",new_tie);
-		}
-
-     	/* get current crossing */
-    	if (project.open == MB_YES
-    		&& project.num_crossings > 0)
-    		{
-    		/* get next crossing */
-		if (new_crossing >= 0
-		    && new_crossing < project.num_crossings)
-			{
-    			mbna_current_crossing = new_crossing;
-			if (new_tie >= 0
-			    && new_tie < project.crossings[mbna_current_crossing].num_ties)
-			    mbna_current_tie = new_tie;
-			else
-			    mbna_current_tie = -1;
-			}
-		else
-			{
-    			mbna_current_crossing = 0;
-			mbna_current_tie = -1;
-			}
-
-    		/* retrieve crossing parameters */
-    		if (mbna_current_crossing >= 0)
-    			{
-    			crossing = &project.crossings[mbna_current_crossing];
-    			mbna_file_id_1 = crossing->file_id_1;
-    			mbna_section_1 = crossing->section_1;
-     			mbna_file_id_2 = crossing->file_id_2;
-    			mbna_section_2 = crossing->section_2;
-			if (crossing->num_ties > 0)
-			    {
-			    if (mbna_current_tie < 0)
-				mbna_current_tie = 0;
-			    tie = &crossing->ties[mbna_current_tie];
-			    mbna_snav_1 = tie->snav_1;
-			    mbna_snav_1_time_d = tie->snav_1_time_d;
-			    mbna_snav_2 = tie->snav_2;
-			    mbna_snav_2_time_d = tie->snav_2_time_d;
-			    mbna_offset_x = tie->offset_x;
-			    mbna_offset_y = tie->offset_y;
-			    mbna_offset_z = tie->offset_z_m;
-/* fprintf(stderr,"%s %d: mbna_offset_z:%f\n",__FILE__,__LINE__,mbna_offset_z); */
-			    }
-			else
-			    {
-			    mbna_current_tie = -1;
-			    }
-
-			/* reset survey file and section selections */
-			if (mbna_view_mode == MBNA_VIEW_MODE_SURVEY
-			    || mbna_view_mode == MBNA_VIEW_MODE_WITHSURVEY)
-				{
-				if (mbna_survey_select == project.files[crossing->file_id_1].block)
-					{
-					mbna_file_select = crossing->file_id_1;
-					mbna_section_select = crossing->section_1;
-					}
-				else if (mbna_survey_select == project.files[crossing->file_id_2].block)
-					{
-					mbna_file_select = crossing->file_id_2;
-					mbna_section_select = crossing->section_2;
-					}
-				else
-					{
-					mbna_file_select = crossing->file_id_1;
-					mbna_section_select = crossing->section_1;
-					}
-				}
-			else if (mbna_view_mode == MBNA_VIEW_MODE_FILE
-			    || mbna_view_mode == MBNA_VIEW_MODE_WITHFILE)
-				{
-				if (mbna_file_select == crossing->file_id_1)
-					{
-					mbna_survey_select = project.files[crossing->file_id_1].block;
-					mbna_section_select = crossing->section_1;
-					}
-				else if (mbna_file_select == crossing->file_id_2)
-					{
-					mbna_survey_select = project.files[crossing->file_id_2].block;
-					mbna_section_select = crossing->section_2;
-					}
-				else
-					{
-					mbna_survey_select = project.files[crossing->file_id_1].block;
-					mbna_section_select = crossing->section_1;
-					}
-				}
-			else if (mbna_view_mode == MBNA_VIEW_MODE_WITHSECTION)
-				{
-				if (mbna_file_select == crossing->file_id_1
-				    && mbna_section_select == crossing->section_1)
-					{
-					mbna_survey_select = project.files[crossing->file_id_1].block;
-					mbna_file_select = crossing->file_id_1;
-					}
-				else if (mbna_file_select == crossing->file_id_2
-				    && mbna_section_select == crossing->section_2)
-					{
-					mbna_survey_select = project.files[crossing->file_id_2].block;
-					mbna_file_select = crossing->file_id_2;
-					}
-				else
-					{
-					mbna_survey_select = project.files[crossing->file_id_1].block;
-					mbna_file_select = crossing->file_id_1;
-					}
-				}
- 			}
-
-  		/* load the crossing */
-  		if (mbna_current_crossing >= 0)
-  			{
-			/* put up message */
-			sprintf(message,"Loading crossing %d...",mbna_current_crossing);
-			do_message_on(message);
-
-  			mbnavadjust_crossing_load();
-
-			/* turn off message */
-			do_message_off();
-  			}
-   		}
-
- 	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbnavadjust_naverr_next()
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_naverr_next";
-	int	status = MB_SUCCESS;
-	struct mbna_crossing *crossing;
-	struct mbna_tie *tie;
-	int	crossing_ok;
-	int	i, j, k;
-
- 	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
-
-     	/* find next current crossing */
-    	if (project.open == MB_YES
-    		&& project.num_crossings > 0)
-    		{
-    		/* get next good crossing */
-		j = -1;
-		k = -1;
-		for (i=0;i<project.num_crossings;i++)
-			{
-			crossing = &(project.crossings[i]);
-			crossing_ok = MB_NO;
-			if (mbna_view_list == MBNA_VIEW_LIST_CROSSINGS)
-				crossing_ok = MB_YES;
-			else if (mbna_view_list == MBNA_VIEW_LIST_MEDIOCRECROSSINGS
-				&& crossing->overlap >= MBNA_MEDIOCREOVERLAP_THRESHOLD)
-				crossing_ok = MB_YES;
-			else if (mbna_view_list == MBNA_VIEW_LIST_GOODCROSSINGS
-				&& crossing->overlap >= MBNA_GOODOVERLAP_THRESHOLD)
-				crossing_ok = MB_YES;
-			else if (mbna_view_list == MBNA_VIEW_LIST_BETTERCROSSINGS
-				&& crossing->overlap >= MBNA_BETTEROVERLAP_THRESHOLD)
-				crossing_ok = MB_YES;
-			else if (mbna_view_list == MBNA_VIEW_LIST_TRUECROSSINGS
-				&& crossing->truecrossing == MB_YES)
-				crossing_ok = MB_YES;
-			else if (mbna_view_list == MBNA_VIEW_LIST_TIES
-				&& crossing->num_ties > 0)
-				crossing_ok = MB_YES;
-			if ((mbna_view_mode == MBNA_VIEW_MODE_SURVEY
-					&& (mbna_survey_select != project.files[crossing->file_id_1].block
-						|| mbna_survey_select != project.files[crossing->file_id_2].block))
-				|| (mbna_view_mode == MBNA_VIEW_MODE_FILE
-					&& (mbna_file_select != crossing->file_id_1
-						|| mbna_file_select != crossing->file_id_2))
-				|| (mbna_view_mode == MBNA_VIEW_MODE_WITHSURVEY
-					&& mbna_survey_select != project.files[crossing->file_id_1].block
-					&& mbna_survey_select != project.files[crossing->file_id_2].block)
-				|| (mbna_view_mode == MBNA_VIEW_MODE_WITHFILE
-					&& mbna_file_select != crossing->file_id_1
-					&& mbna_file_select != crossing->file_id_2)
-				|| (mbna_view_mode == MBNA_VIEW_MODE_WITHSECTION
-					&& (mbna_file_select != crossing->file_id_1
-						|| mbna_section_select != crossing->section_1)
-					&& (mbna_file_select != crossing->file_id_2
-						|| mbna_section_select != crossing->section_2)))
-				crossing_ok = MB_NO;
-
-			if (crossing_ok == MB_YES)
-				{
-				if (j < 0)
-					j = i;
-				if (k < 0 && i > mbna_current_crossing)
-					k = i;
-				}
-			}
-		if (k >= 0)
-			mbna_current_crossing = k;
-		else if (j >= 0)
-			mbna_current_crossing = j;
-		else
-			mbna_current_crossing = -1;
-		mbna_current_tie = -1;
-   		}
-
-    	/* retrieve crossing parameters */
-    	if (mbna_current_crossing >= 0)
-    		{
-    		crossing = &project.crossings[mbna_current_crossing];
-    		mbna_file_id_1 = crossing->file_id_1;
-    		mbna_section_1 = crossing->section_1;
-     		mbna_file_id_2 = crossing->file_id_2;
-    		mbna_section_2 = crossing->section_2;
-		if (crossing->num_ties > 0)
-		    {
-		    if (mbna_current_tie == -1)
-		    	mbna_current_tie = 0;
-		    tie = &crossing->ties[0];
-		    mbna_snav_1 = tie->snav_1;
-		    mbna_snav_1_time_d = tie->snav_1_time_d;
-		    mbna_snav_2 = tie->snav_2;
-		    mbna_snav_2_time_d = tie->snav_2_time_d;
-		    mbna_offset_x = tie->offset_x;
-		    mbna_offset_y = tie->offset_y;
-		    mbna_offset_z = tie->offset_z_m;
-/* fprintf(stderr,"%s %d: mbna_offset_z:%f\n",__FILE__,__LINE__,mbna_offset_z); */
-
-		    /* reset survey file and section selections */
-		    if (mbna_file_select == crossing->file_id_1)
-			{
-			mbna_section_select = crossing->section_1;
-			}
-		    else if (mbna_file_select == crossing->file_id_2)
-			{
-			mbna_section_select = crossing->section_2;
-			}
-		    else
-			{
-			mbna_file_select = crossing->file_id_1;
-			mbna_survey_select = project.files[crossing->file_id_1].block;
-			mbna_section_select = crossing->section_1;
-			}
-		    }
-		else
-		    {
-		    mbna_current_tie = -1;
-		    }
-  		}
-
-  	/* load the crossing */
-  	if (mbna_current_crossing >= 0)
-  		{
-		/* put up message */
-		sprintf(message,"Loading crossing %d...",mbna_current_crossing);
-		do_message_on(message);
-
-  		mbnavadjust_crossing_load();
-
-		/* turn off message */
-		do_message_off();
-  		}
-
- 	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-
-
-/*--------------------------------------------------------------------*/
-int mbnavadjust_naverr_previous()
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_naverr_previous";
-	int	status = MB_SUCCESS;
-	struct mbna_crossing *crossing;
-	struct mbna_tie *tie;
-	int	crossing_ok;
-	int	i, j, k;
-
- 	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
-
-     	/* find previous current crossing */
-    	if (project.open == MB_YES
-    		&& project.num_crossings > 0)
-    		{
-    		/* get next good crossing */
-		j = -1;
-		k = -1;
-		for (i=0;i<project.num_crossings;i++)
-			{
-			crossing = &(project.crossings[i]);
-			crossing_ok = MB_NO;
-			if (mbna_view_list == MBNA_VIEW_LIST_CROSSINGS)
-				crossing_ok = MB_YES;
-			else if (mbna_view_list == MBNA_VIEW_LIST_MEDIOCRECROSSINGS
-				&& crossing->overlap >= MBNA_MEDIOCREOVERLAP_THRESHOLD)
-				crossing_ok = MB_YES;
-			else if (mbna_view_list == MBNA_VIEW_LIST_GOODCROSSINGS
-				&& crossing->overlap >= MBNA_GOODOVERLAP_THRESHOLD)
-				crossing_ok = MB_YES;
-			else if (mbna_view_list == MBNA_VIEW_LIST_BETTERCROSSINGS
-				&& crossing->overlap >= MBNA_BETTEROVERLAP_THRESHOLD)
-				crossing_ok = MB_YES;
-			else if (mbna_view_list == MBNA_VIEW_LIST_TRUECROSSINGS
-				&& crossing->truecrossing == MB_YES)
-				crossing_ok = MB_YES;
-			else if (mbna_view_list == MBNA_VIEW_LIST_TIES
-				&& crossing->num_ties > 0)
-				crossing_ok = MB_YES;
-			if ((mbna_view_mode == MBNA_VIEW_MODE_SURVEY
-					&& (mbna_survey_select != project.files[crossing->file_id_1].block
-						|| mbna_survey_select != project.files[crossing->file_id_2].block))
-				|| (mbna_view_mode == MBNA_VIEW_MODE_FILE
-					&& (mbna_file_select != crossing->file_id_1
-						|| mbna_file_select != crossing->file_id_2))
-				|| (mbna_view_mode == MBNA_VIEW_MODE_WITHSURVEY
-					&& mbna_survey_select != project.files[crossing->file_id_1].block
-					&& mbna_survey_select != project.files[crossing->file_id_2].block)
-				|| (mbna_view_mode == MBNA_VIEW_MODE_WITHFILE
-					&& mbna_file_select != crossing->file_id_1
-					&& mbna_file_select != crossing->file_id_2)
-				|| (mbna_view_mode == MBNA_VIEW_MODE_WITHSECTION
-					&& (mbna_file_select != crossing->file_id_1
-						|| mbna_section_select != crossing->section_1)
-					&& (mbna_file_select != crossing->file_id_2
-						|| mbna_section_select != crossing->section_2)))
-				crossing_ok = MB_NO;
-
-			if (crossing_ok == MB_YES)
-				{
-				if (i < mbna_current_crossing)
-					j = i;
-				k = i;
-				}
-
-			}
-		if (j >= 0)
-			mbna_current_crossing = j;
-		else if (k >= 0)
-			mbna_current_crossing = k;
-		else
-			mbna_current_crossing = -1;
-		mbna_current_tie = -1;
-   		}
-
-
-    	/* retrieve crossing parameters */
-    	if (mbna_current_crossing >= 0)
-    		{
-    		crossing = &project.crossings[mbna_current_crossing];
-    		mbna_file_id_1 = crossing->file_id_1;
-    		mbna_section_1 = crossing->section_1;
-     		mbna_file_id_2 = crossing->file_id_2;
-    		mbna_section_2 = crossing->section_2;
-		if (crossing->num_ties > 0)
-		    {
-		    if (mbna_current_tie == -1)
-		    	mbna_current_tie = 0;
-		    tie = &crossing->ties[0];
-		    mbna_snav_1 = tie->snav_1;
-		    mbna_snav_1_time_d = tie->snav_1_time_d;
-		    mbna_snav_2 = tie->snav_2;
-		    mbna_snav_2_time_d = tie->snav_2_time_d;
-		    mbna_offset_x = tie->offset_x;
-		    mbna_offset_y = tie->offset_y;
-		    mbna_offset_z = tie->offset_z_m;
-/* fprintf(stderr,"%s %d: mbna_offset_z:%f\n",__FILE__,__LINE__,mbna_offset_z); */
-
-		    /* reset survey file and section selections */
-		    if (mbna_file_select == crossing->file_id_1)
-			{
-			mbna_section_select = crossing->section_1;
-			}
-		    else if (mbna_file_select == crossing->file_id_2)
-			{
-			mbna_section_select = crossing->section_2;
-			}
-		    else
-			{
-			mbna_file_select = crossing->file_id_1;
-			mbna_survey_select = project.files[crossing->file_id_1].block;
-			mbna_section_select = crossing->section_1;
-			}
-		    }
-		else
-		    {
-		    mbna_current_tie = -1;
-		    }
-  		}
-
-  	/* load the crossing */
-  	if (mbna_current_crossing >= 0)
-  		{
-		/* put up message */
-		sprintf(message,"Loading crossing %d...",mbna_current_crossing);
-		do_message_on(message);
-
-  		mbnavadjust_crossing_load();
-
-		/* turn off message */
-		do_message_off();
-  		}
-
- 	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbnavadjust_naverr_nextunset()
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_naverr_nextunset";
-	int	status = MB_SUCCESS;
-	struct mbna_crossing *crossing;
-	struct mbna_tie *tie;
-	int	crossing_ok;
-  	int	i, j, k;
-
- 	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
-
-     	/* find next current unset crossing */
-    	if (project.open == MB_YES
-    		&& project.num_crossings > 0)
-    		{
-    		/* get next good crossing */
-		j = -1;
-		k = -1;
-		for (i=0;i<project.num_crossings;i++)
-			{
-			crossing = &(project.crossings[i]);
-			crossing_ok = MB_NO;
-			if (mbna_view_list == MBNA_VIEW_LIST_CROSSINGS)
-				crossing_ok = MB_YES;
-			else if (mbna_view_list == MBNA_VIEW_LIST_MEDIOCRECROSSINGS
-				&& crossing->overlap >= MBNA_MEDIOCREOVERLAP_THRESHOLD)
-				crossing_ok = MB_YES;
-			else if (mbna_view_list == MBNA_VIEW_LIST_GOODCROSSINGS
-				&& crossing->overlap >= MBNA_GOODOVERLAP_THRESHOLD)
-				crossing_ok = MB_YES;
-			else if (mbna_view_list == MBNA_VIEW_LIST_BETTERCROSSINGS
-				&& crossing->overlap >= MBNA_BETTEROVERLAP_THRESHOLD)
-				crossing_ok = MB_YES;
-			else if (mbna_view_list == MBNA_VIEW_LIST_TRUECROSSINGS
-				&& crossing->truecrossing == MB_YES)
-				crossing_ok = MB_YES;
-			else if (mbna_view_list == MBNA_VIEW_LIST_TIES
-				&& crossing->num_ties > 0)
-				crossing_ok = MB_YES;
-			if ((mbna_view_mode == MBNA_VIEW_MODE_SURVEY
-					&& (mbna_survey_select != project.files[crossing->file_id_1].block
-						|| mbna_survey_select != project.files[crossing->file_id_2].block))
-				|| (mbna_view_mode == MBNA_VIEW_MODE_FILE
-					&& (mbna_file_select != crossing->file_id_1
-						|| mbna_file_select != crossing->file_id_2))
-				|| (mbna_view_mode == MBNA_VIEW_MODE_WITHSURVEY
-					&& mbna_survey_select != project.files[crossing->file_id_1].block
-					&& mbna_survey_select != project.files[crossing->file_id_2].block)
-				|| (mbna_view_mode == MBNA_VIEW_MODE_WITHFILE
-					&& mbna_file_select != crossing->file_id_1
-					&& mbna_file_select != crossing->file_id_2)
-				|| (mbna_view_mode == MBNA_VIEW_MODE_WITHSECTION
-					&& (mbna_file_select != crossing->file_id_1
-						|| mbna_section_select != crossing->section_1)
-					&& (mbna_file_select != crossing->file_id_2
-						|| mbna_section_select != crossing->section_2)))
-				crossing_ok = MB_NO;
-			if (crossing->status != MBNA_CROSSING_STATUS_NONE)
-				crossing_ok = MB_NO;
-
-			if (crossing_ok == MB_YES)
-				{
-				if (j < 0)
-					j = i;
-				if (k < 0 && i > mbna_current_crossing)
-					k = i;
-				}
-			}
-		if (k >= 0)
-			mbna_current_crossing = k;
-		else if (j >= 0)
-			mbna_current_crossing = j;
-		else
-			mbna_current_crossing = -1;
-		mbna_current_tie = -1;
-   		}
-
-    	/* retrieve crossing parameters */
-    	if (mbna_current_crossing >= 0)
-    		{
-    		crossing = &project.crossings[mbna_current_crossing];
-    		mbna_file_id_1 = crossing->file_id_1;
-    		mbna_section_1 = crossing->section_1;
-     		mbna_file_id_2 = crossing->file_id_2;
-    		mbna_section_2 = crossing->section_2;
-		if (crossing->num_ties > 0)
-		    {
-		    mbna_current_tie = 0;
-		    tie = &crossing->ties[0];
-		    mbna_snav_1 = tie->snav_1;
-		    mbna_snav_1_time_d = tie->snav_1_time_d;
-		    mbna_snav_2 = tie->snav_2;
-		    mbna_snav_2_time_d = tie->snav_2_time_d;
-		    mbna_offset_x = tie->offset_x;
-		    mbna_offset_y = tie->offset_y;
-		    mbna_offset_z = tie->offset_z_m;
-/* fprintf(stderr,"%s %d: mbna_offset_z:%f\n",__FILE__,__LINE__,mbna_offset_z); */
-
-		    /* reset survey file and section selections */
-		    if (mbna_file_select == crossing->file_id_1)
-			{
-			mbna_section_select = crossing->section_1;
-			}
-		    else if (mbna_file_select == crossing->file_id_2)
-			{
-			mbna_section_select = crossing->section_2;
-			}
-		    else
-			{
-			mbna_file_select = crossing->file_id_1;
-			mbna_survey_select = project.files[crossing->file_id_1].block;
-			mbna_section_select = crossing->section_1;
-			}
-		    }
-		else
-		    {
-		    mbna_current_tie = -1;
-		    }
-  		}
-
-  	/* load the crossing */
-  	if (mbna_current_crossing >= 0)
-  		{
-		/* put up message */
-		sprintf(message,"Loading crossing %d...",mbna_current_crossing);
-		do_message_on(message);
-
-  		mbnavadjust_crossing_load();
-
-		/* turn off message */
-		do_message_off();
-  		}
-
-	/* else unload previously loaded crossing */
-	else if (mbna_naverr_load == MB_YES)
-		{
-		status = mbnavadjust_crossing_unload();
-		}
-
- 	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbnavadjust_naverr_selecttie()
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_naverr_selecttie";
-	int	status = MB_SUCCESS;
-	struct mbna_crossing *crossing;
-	struct mbna_tie *tie;
-	struct mbna_section *section1, *section2;
-	struct mbna_file *file1, *file2;
-
- 	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
-
-     	/* get current crossing */
-    	if (project.open == MB_YES
-    		&& project.num_crossings > 0)
-    		{
-     		/* retrieve crossing parameters */
-    		if (mbna_current_crossing >= 0
-		    && project.crossings[mbna_current_crossing].num_ties > 0)
-    			{
-			/* select next tie */
-			crossing = &project.crossings[mbna_current_crossing];
-			mbna_current_tie++;
-			if (mbna_current_tie > crossing->num_ties - 1)
-			    mbna_current_tie = 0;
-			tie = &crossing->ties[mbna_current_tie];
-     			mbna_snav_1 = tie->snav_1;
-     			mbna_snav_2 = tie->snav_2;
-     			mbna_snav_1_time_d = tie->snav_1_time_d;
-     			mbna_snav_2_time_d = tie->snav_2_time_d;
-    			mbna_offset_x = tie->offset_x;
-    			mbna_offset_y = tie->offset_y;
-			mbna_offset_z = tie->offset_z_m;
-    			tie->offset_x_m = mbna_offset_x / mbna_mtodeglon;
-    			tie->offset_y_m = mbna_offset_y / mbna_mtodeglat;
- 			file1 = (struct mbna_file *) &project.files[mbna_file_id_1];
-			file2 = (struct mbna_file *) &project.files[mbna_file_id_2];
-			section1 = (struct mbna_section *) &file1->sections[mbna_section_1];
-			section2 = (struct mbna_section *) &file2->sections[mbna_section_2];
-			mbna_invert_offset_x = section2->snav_lon_offset[mbna_snav_2]
-						- section1->snav_lon_offset[mbna_snav_1];
-			mbna_invert_offset_y = section2->snav_lat_offset[mbna_snav_2]
-						- section1->snav_lat_offset[mbna_snav_1];
-			mbna_invert_offset_z = section2->snav_z_offset[mbna_snav_2]
-						- section1->snav_z_offset[mbna_snav_1];
-  			}
-   		}
-
-   	/* set mbna_crossing_select */
-    	if (project.open == MB_YES
-    		&& project.num_crossings > 0
-    		&& mbna_current_crossing >= 0)
-		{
-    		mbna_crossing_select = mbna_current_crossing;
-    		if (mbna_current_tie >= 0)
-		    mbna_tie_select = mbna_current_tie;
-		else
-    		    mbna_tie_select = MBNA_SELECT_NONE;
-		}
-    	else
-		{
-    		mbna_crossing_select = MBNA_SELECT_NONE;
-    		mbna_tie_select = MBNA_SELECT_NONE;
-		}
-
- 	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbnavadjust_naverr_addtie()
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_naverr_addtie";
-	int	status = MB_SUCCESS;
-	struct mbna_crossing *crossing;
-	struct mbna_tie *tie;
-	struct mbna_section *section1, *section2;
-	struct mbna_file *file1, *file2;
-	int	found;
-	int	ix, iy;
-   	int	i;
-
- 	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
-
-     	/* get current crossing */
-    	if (project.open == MB_YES
-    		&& project.num_crossings > 0)
-    		{
-     		/* retrieve crossing parameters */
-    		if (mbna_current_crossing >= 0
-		    && project.crossings[mbna_current_crossing].num_ties < MBNA_SNAV_NUM)
-    			{
-			/* add tie and set number */
-    			crossing = &project.crossings[mbna_current_crossing];
-			file1 = (struct mbna_file *) &project.files[mbna_file_id_1];
-			file2 = (struct mbna_file *) &project.files[mbna_file_id_2];
-			section1 = (struct mbna_section *) &file1->sections[mbna_section_1];
-			section2 = (struct mbna_section *) &file2->sections[mbna_section_2];
-			mbna_current_tie = crossing->num_ties;
-			crossing->num_ties++;
-			project.num_ties++;
-    			tie = &crossing->ties[mbna_current_tie];
-
-			if (crossing->status == MBNA_CROSSING_STATUS_NONE)
-				{
-				project.num_crossings_analyzed++;
-				if (crossing->truecrossing == MB_YES)
- 					project.num_truecrossings_analyzed++;
-				}
-    			crossing->status = MBNA_CROSSING_STATUS_SET;
-
-			/* look for unused pair of nav points */
-     			tie->snav_1 = -1;
-			found = MB_NO;
-			while (found == MB_NO)
-			    {
-			    found = MB_YES;
-			    tie->snav_1++;
-			    for (i=0;i<crossing->num_ties-1;i++)
-				{
-				if (crossing->ties[i].snav_1 == tie->snav_1)
-				    found = MB_NO;
-				}
-			    }
-     			tie->snav_2 = -1;
-			found = MB_NO;
-			while (found == MB_NO)
-			    {
-			    found = MB_YES;
-			    tie->snav_2++;
-			    for (i=0;i<crossing->num_ties-1;i++)
-				{
-				if (crossing->ties[i].snav_2 == tie->snav_2)
-				    found = MB_NO;
-				}
-			    }
-
-			/* get rest of tie parameters */
-			tie->status = MBNA_TIE_XYZ;
-			tie->snav_1_time_d = section1->snav_time_d[tie->snav_1];
-			tie->snav_2_time_d = section2->snav_time_d[tie->snav_2];
-     			mbna_snav_1 = tie->snav_1;
-     			mbna_snav_2 = tie->snav_2;
-     			mbna_snav_1_time_d = tie->snav_1_time_d;
-     			mbna_snav_2_time_d = tie->snav_2_time_d;
-    			tie->offset_x = mbna_offset_x;
-    			tie->offset_y = mbna_offset_y;
-    			tie->offset_x_m = mbna_offset_x / mbna_mtodeglon;
-    			tie->offset_y_m = mbna_offset_y / mbna_mtodeglat;
-    			tie->offset_z_m = mbna_offset_z;
-			tie->sigmar1 = mbna_minmisfit_sr1;
-			tie->sigmar2 = mbna_minmisfit_sr2;
-			tie->sigmar3 = mbna_minmisfit_sr3;
-			for (i=0;i<3;i++)
-				{
-				tie->sigmax1[i] = mbna_minmisfit_sx1[i];
-				tie->sigmax2[i] = mbna_minmisfit_sx2[i];
-				tie->sigmax3[i] = mbna_minmisfit_sx3[i];
-				}
-			if (tie->sigmar1 < MBNA_SMALL)
-				{
-				tie->sigmar1 = 100.0;
-				tie->sigmax1[0] = 1.0;
-				tie->sigmax1[1] = 0.0;
-				tie->sigmax1[2] = 0.0;
-				}
-			if (tie->sigmar2 < MBNA_SMALL)
-				{
-				tie->sigmar2 = 100.0;
-				tie->sigmax2[0] = 0.0;
-				tie->sigmax2[1] = 1.0;
-				tie->sigmax2[2] = 0.0;
-				}
-			if (tie->sigmar3 < MBNA_SMALL)
-				{
-				tie->sigmar3 = 100.0;
-				tie->sigmax3[0] = 0.0;
-				tie->sigmax3[1] = 0.0;
-				tie->sigmax3[2] = 1.0;
-				}
-
-			file1 = (struct mbna_file *) &project.files[mbna_file_id_1];
-			file2 = (struct mbna_file *) &project.files[mbna_file_id_2];
-			section1 = (struct mbna_section *) &file1->sections[mbna_section_1];
-			section2 = (struct mbna_section *) &file2->sections[mbna_section_2];
-			mbna_invert_offset_x = section2->snav_lon_offset[mbna_snav_2]
-						- section1->snav_lon_offset[mbna_snav_1];
-			mbna_invert_offset_y = section2->snav_lat_offset[mbna_snav_2]
-						- section1->snav_lat_offset[mbna_snav_1];
-			mbna_invert_offset_z = section2->snav_z_offset[mbna_snav_2]
-						- section1->snav_z_offset[mbna_snav_1];
-			tie->inversion_status = MBNA_INVERSION_NONE;
-    			tie->inversion_offset_x = mbna_invert_offset_x;
-    			tie->inversion_offset_y = mbna_invert_offset_y;
-    			tie->inversion_offset_x_m = mbna_invert_offset_x / mbna_mtodeglon;
-    			tie->inversion_offset_y_m = mbna_invert_offset_y / mbna_mtodeglat;
-    			tie->inversion_offset_z_m = mbna_invert_offset_z;
-   			if (project.inversion == MBNA_INVERSION_CURRENT)
-    				project.inversion = MBNA_INVERSION_OLD;
-
-			/* now put tie in center of plot */
-			ix = (int)(0.5 * (mbna_plot_lon_max - mbna_plot_lon_min)
-					* mbna_plotx_scale);
-			iy = (int)(cont_borders[3]
-					- (0.5 * (mbna_plot_lat_max - mbna_plot_lat_min)
-						* mbna_ploty_scale));
-			mbnavadjust_naverr_snavpoints(ix, iy);
-     			tie->snav_1 = mbna_snav_1;
-     			tie->snav_2 = mbna_snav_2;
-     			tie->snav_1_time_d = mbna_snav_1_time_d;
-     			tie->snav_2_time_d = mbna_snav_2_time_d;
-
-			/* reset tie counts for snavs */
-			section1->snav_num_ties[tie->snav_1]++;
-			section2->snav_num_ties[tie->snav_2]++;
-
-			/* write updated project */
-			mbnavadjust_write_project();
-
-			/* add info text */
-			sprintf(message,"Add Tie Point %d of Crossing %d\n > Nav points: %d:%d:%d %d:%d:%d\n > Offsets: %f %f %f m\n",
-				mbna_current_tie, mbna_current_crossing,
-				crossing->file_id_1, crossing->section_1, tie->snav_1,
-				crossing->file_id_2, crossing->section_2, tie->snav_2,
-				tie->offset_x_m, tie->offset_y_m, tie->offset_z_m);
-			if (mbna_verbose == 0)
-				fprintf(stderr,"%s",message);
-			do_info_add(message, MB_YES);
-
- 			/* print output debug statements */
-			if (mbna_verbose >= 2)
-				{
-				fprintf(stderr,"\ndbg2  snav point selected in MBnavadjust function <%s>\n",
-					function_name);
-				fprintf(stderr,"dbg2  snav values:\n");
-				fprintf(stderr,"dbg2       mbna_snav_1:        %d\n",mbna_snav_1);
-				fprintf(stderr,"dbg2       mbna_snav_1_time_d: %f\n",mbna_snav_1_time_d);
-				fprintf(stderr,"dbg2       mbna_snav_1_lon:    %f\n",mbna_snav_1_lon);
-				fprintf(stderr,"dbg2       mbna_snav_1_lat:    %f\n",mbna_snav_1_lat);
-				fprintf(stderr,"dbg2       section1->num_snav:  %d\n",section1->num_snav);
-				for (i=0;i<section1->num_snav;i++)
-					{
-					fprintf(stderr,"dbg2       section1->snav_time_d[%d]: %f\n",i,section1->snav_time_d[i]);
-					fprintf(stderr,"dbg2       section1->snav_lon[%d]:    %.10f\n",i,section1->snav_lon[i]);
-					fprintf(stderr,"dbg2       section1->snav_lat[%d]:    %.10f\n",i,section1->snav_lat[i]);
-					}
-				fprintf(stderr,"dbg2       mbna_snav_2:        %d\n",mbna_snav_2);
-				fprintf(stderr,"dbg2       mbna_snav_2_time_d: %f\n",mbna_snav_2_time_d);
-				fprintf(stderr,"dbg2       mbna_snav_2_lon:    %.10f\n",mbna_snav_2_lon);
-				fprintf(stderr,"dbg2       mbna_snav_2_lat:    %.10f\n",mbna_snav_2_lat);
-				fprintf(stderr,"dbg2       section2->num_snav:  %d\n",section2->num_snav);
-				for (i=0;i<section2->num_snav;i++)
-					{
-					fprintf(stderr,"dbg2       section2->snav_time_d[%d]: %f\n",i,section2->snav_time_d[i]);
-					fprintf(stderr,"dbg2       section2->snav_lon[%d]:    %.10f\n",i,section2->snav_lon[i]);
-					fprintf(stderr,"dbg2       section2->snav_lat[%d]:    %.10f\n",i,section2->snav_lat[i]);
-					}
-				}
-  			}
-   		}
-
-   	/* set mbna_crossing_select */
-    	if (project.open == MB_YES
-    		&& project.num_crossings > 0
-    		&& mbna_current_crossing >= 0)
-		{
-    		mbna_crossing_select = mbna_current_crossing;
-    		if (mbna_current_tie >= 0)
-		    mbna_tie_select = mbna_current_tie;
-		else
-    		    mbna_tie_select = MBNA_SELECT_NONE;
-		}
-    	else
-		{
-    		mbna_crossing_select = MBNA_SELECT_NONE;
-    		mbna_tie_select = MBNA_SELECT_NONE;
-		}
-
- 	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbnavadjust_naverr_deletetie()
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_naverr_deletetie";
-	int	status = MB_SUCCESS;
-
- 	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
-
-     	/* get current crossing */
-    	if (project.open == MB_YES
-    		&& project.num_crossings > 0)
-    		{
-     		/* retrieve crossing parameters */
-    		if (mbna_current_crossing >= 0
-		    && mbna_current_tie >= 0)
-    			{
-			/* delete the tie */
-			mbnavadjust_deletetie(mbna_current_crossing, mbna_current_tie, MBNA_CROSSING_STATUS_SKIP);
-
-			/* write updated project */
-			mbnavadjust_write_project();
-  			}
-   		}
-
-   	/* set mbna_crossing_select */
-    	if (project.open == MB_YES
-    		&& project.num_crossings > 0
-    		&& mbna_current_crossing >= 0)
-		{
-    		mbna_crossing_select = mbna_current_crossing;
-    		if (mbna_current_tie >= 0)
-		    mbna_tie_select = mbna_current_tie;
-		else
-    		    mbna_tie_select = MBNA_SELECT_NONE;
-		}
-    	else
-		{
-    		mbna_crossing_select = MBNA_SELECT_NONE;
-    		mbna_tie_select = MBNA_SELECT_NONE;
-		}
-
- 	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbnavadjust_deletetie(int icrossing, int jtie, int delete_status)
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_deletetie";
-	int	status = MB_SUCCESS;
-	struct mbna_crossing *crossing;
-	struct mbna_tie *tie;
-	struct mbna_section *section1, *section2;
-	struct mbna_file *file1, *file2;
-   	int	i;
-
- 	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2       icrossing:     %d\n",icrossing);
-		fprintf(stderr,"dbg2       jtie:          %d\n",jtie);
-		fprintf(stderr,"dbg2       delete_status: %d\n",delete_status);
-		}
-
-     	/* get current crossing */
-    	if (project.open == MB_YES
-		&& icrossing >= 0
-		&& jtie >= 0)
-    		{
-     		/* retrieve crossing parameters */
-    		if (project.num_crossings > icrossing
-			&& project.crossings[icrossing].num_ties > jtie)
-    			{
-			/* add info text */
-    			crossing = &project.crossings[icrossing];
-    			tie = &crossing->ties[jtie];
-			if (delete_status == MBNA_CROSSING_STATUS_SKIP)
-			    sprintf(message,"Delete Tie Point %d of Crossing %d\n > Nav points: %d:%d:%d %d:%d:%d\n > Offsets: %f %f %f m\n",
-				jtie, icrossing,
-				crossing->file_id_1, crossing->section_1, tie->snav_1,
-				crossing->file_id_2, crossing->section_2, tie->snav_2,
-				tie->offset_x_m, tie->offset_y_m, tie->offset_z_m);
-			else
-			    sprintf(message,"Clear Tie Point %d of Crossing %d\n > Nav points: %d:%d:%d %d:%d:%d\n > Offsets: %f %f %f m\n",
-				jtie, icrossing,
-				crossing->file_id_1, crossing->section_1, tie->snav_1,
-				crossing->file_id_2, crossing->section_2, tie->snav_2,
-				tie->offset_x_m, tie->offset_y_m, tie->offset_z_m);
-			if (mbna_verbose == 0)
-				fprintf(stderr,"%s",message);
-			do_info_add(message, MB_YES);
-
-			/* reset tie counts for snavs */
-			file1 = &project.files[crossing->file_id_1];
-			section1 = &file1->sections[crossing->section_1];
-			section1->snav_num_ties[tie->snav_1]--;
-			file2 = &project.files[crossing->file_id_2];
-			section2 = &file2->sections[crossing->section_2];
-			section2->snav_num_ties[tie->snav_2]--;
-
-			/* delete tie and set number */
-			for (i=mbna_current_tie;i<crossing->num_ties-1;i++)
-			    {
-			    crossing->ties[i].snav_1 = crossing->ties[i+1].snav_1;
-			    crossing->ties[i].snav_1_time_d = crossing->ties[i+1].snav_1_time_d;
-			    crossing->ties[i].snav_2 = crossing->ties[i+1].snav_2;
-			    crossing->ties[i].snav_2_time_d = crossing->ties[i+1].snav_2_time_d;
-			    crossing->ties[i].offset_x = crossing->ties[i+1].offset_x;
-			    crossing->ties[i].offset_y = crossing->ties[i+1].offset_y;
-			    crossing->ties[i].offset_x_m = crossing->ties[i+1].offset_x_m;
-			    crossing->ties[i].offset_y_m = crossing->ties[i+1].offset_y_m;
-			    crossing->ties[i].offset_z_m = crossing->ties[i+1].offset_z_m;
-			    }
-			crossing->num_ties--;
-			project.num_ties--;
-			if (mbna_current_tie > crossing->num_ties -1)
-			     mbna_current_tie--;
-
-			/* set tie parameters */
-			if (crossing->num_ties <= 0)
-			    {
-			    crossing->num_ties = 0;
-    			    crossing->status = delete_status;
-			    }
-			else if (mbna_current_tie >= 0)
-			    {
-    			    tie = &crossing->ties[mbna_current_tie];
-     			    mbna_snav_1 = tie->snav_1;
-     			    mbna_snav_1_time_d = tie->snav_1_time_d;
-			    mbna_snav_2 = tie->snav_2;
-     			    mbna_snav_2_time_d = tie->snav_2_time_d;
-			    mbna_offset_x = tie->offset_x;
-			    mbna_offset_y = tie->offset_y;
-			    mbna_offset_z = tie->offset_z_m;
-/* fprintf(stderr,"%s %d: mbna_offset_z:%f\n",__FILE__,__LINE__,mbna_offset_z); */
-			    file1 = (struct mbna_file *) &project.files[mbna_file_id_1];
-			    file2 = (struct mbna_file *) &project.files[mbna_file_id_2];
-			    section1 = (struct mbna_section *) &file1->sections[mbna_section_1];
-			    section2 = (struct mbna_section *) &file2->sections[mbna_section_2];
-			    mbna_invert_offset_x = section2->snav_lon_offset[mbna_snav_2]
-						    - section1->snav_lon_offset[mbna_snav_1];
-			    mbna_invert_offset_y = section2->snav_lat_offset[mbna_snav_2]
-						    - section1->snav_lat_offset[mbna_snav_1];
-			    mbna_invert_offset_z = section2->snav_z_offset[mbna_snav_2]
-						    - section1->snav_z_offset[mbna_snav_1];
-			    }
-   			if (project.inversion == MBNA_INVERSION_CURRENT)
-    				project.inversion = MBNA_INVERSION_OLD;
-  			}
-   		}
-
- 	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbnavadjust_naverr_resettie()
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_naverr_resettie";
-	int	status = MB_SUCCESS;
-	struct mbna_file *file1, *file2;
-	struct mbna_section *section1, *section2;
-	struct mbna_crossing *crossing;
-	struct mbna_tie *tie;
-	int	i;
-
- 	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
-
-     	/* get current crossing */
-    	if (project.open == MB_YES
-    		&& project.num_crossings > 0)
-    		{
-     		/* retrieve crossing parameters */
-    		if (mbna_current_crossing >= 0
-		    && mbna_current_tie >= 0)
-    			{
-			/* reset tie */
-			file1 = (struct mbna_file *) &project.files[mbna_file_id_1];
-			file2 = (struct mbna_file *) &project.files[mbna_file_id_2];
-			section1 = (struct mbna_section *) &file1->sections[mbna_section_1];
-			section2 = (struct mbna_section *) &file2->sections[mbna_section_2];
-    			crossing = &project.crossings[mbna_current_crossing];
-    			tie = &crossing->ties[mbna_current_tie];
-			mbna_snav_1 = tie->snav_1;
-			mbna_snav_1_time_d = tie->snav_1_time_d;
-			mbna_snav_1_lon = section1->snav_lon[mbna_snav_1];
-			mbna_snav_1_lat = section1->snav_lat[mbna_snav_1];
-			mbna_snav_2 = tie->snav_2;
-			mbna_snav_2_time_d = tie->snav_2_time_d;
-			mbna_snav_2_lon = section2->snav_lon[mbna_snav_2];
-			mbna_snav_2_lat = section2->snav_lat[mbna_snav_2];
-			mbna_offset_x = tie->offset_x;
-			mbna_offset_y = tie->offset_y;
-			mbna_offset_z = tie->offset_z_m;
-/* fprintf(stderr,"%s %d: mbna_offset_z:%f\n",__FILE__,__LINE__,mbna_offset_z); */
-			mbna_minmisfit_sr1 = tie->sigmar1;
-			mbna_minmisfit_sr2 = tie->sigmar2;
-			mbna_minmisfit_sr3 = tie->sigmar3;
-			for (i=0;i<3;i++)
-				{
-				mbna_minmisfit_sx1[i] = tie->sigmax1[i];
-				mbna_minmisfit_sx2[i] = tie->sigmax2[i];
-				mbna_minmisfit_sx3[i] = tie->sigmax3[i];
-				}
-  			}
-   		}
-
-   	/* set mbna_crossing_select */
-    	if (project.open == MB_YES
-    		&& project.num_crossings > 0
-    		&& mbna_current_crossing >= 0)
-		{
-    		mbna_crossing_select = mbna_current_crossing;
-    		if (mbna_current_tie >= 0)
-		    mbna_tie_select = mbna_current_tie;
-		else
-    		    mbna_tie_select = MBNA_SELECT_NONE;
-		}
-    	else
-		{
-    		mbna_crossing_select = MBNA_SELECT_NONE;
-    		mbna_tie_select = MBNA_SELECT_NONE;
-		}
-
- 	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbnavadjust_naverr_checkoksettie()
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_naverr_checkoksettie";
-	int	status = MB_SUCCESS;
-	struct mbna_crossing *crossing;
-	struct mbna_tie *tie;
-
- 	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
-
-	/* check for changed offsets */
-    	mbna_allow_set_tie = MB_NO;
-    	if (mbna_current_crossing >= 0
-		&& mbna_current_tie >= 0)
-	    {
-    	    crossing = &project.crossings[mbna_current_crossing];
-	    tie = &crossing->ties[mbna_current_tie];
-	    if (tie->snav_1 != mbna_snav_1
-		|| tie->snav_2 != mbna_snav_2
-		|| tie->offset_x != mbna_offset_x
-		|| tie->offset_y != mbna_offset_y
-		|| tie->offset_z_m != mbna_offset_z)
-		{
-		mbna_allow_set_tie = MB_YES;
-		}
-
-	    /* also check for unset sigma values */
-	    if (tie->sigmar1 == 100.0
-	    	&& tie->sigmar2 == 100.0
-	    	&& tie->sigmar3 == 100.0)
-		{
-		mbna_allow_set_tie = MB_YES;
-		}
-	    }
-
- 	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbnavadjust_naverr_skip()
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_naverr_skip";
-	int	status = MB_SUCCESS;
-	struct mbna_crossing *crossing;
-
- 	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
-
-     	/* get current crossing */
-    	if (project.open == MB_YES
-    		&& project.num_crossings > 0)
-    		{
-     		/* retrieve crossing parameters */
-    		if (mbna_current_crossing >= 0)
-    			{
-    			crossing = &project.crossings[mbna_current_crossing];
-			project.num_ties -= crossing->num_ties;
-			crossing->num_ties = 0;
-			if (crossing->status == MBNA_CROSSING_STATUS_NONE)
-				{
-				project.num_crossings_analyzed++;
-				if (crossing->truecrossing == MB_YES)
- 					project.num_truecrossings_analyzed++;
-				}
-    			crossing->status = MBNA_CROSSING_STATUS_SKIP;
-   			if (project.inversion == MBNA_INVERSION_CURRENT)
-    				project.inversion = MBNA_INVERSION_OLD;
-
-			/* write updated project */
-			mbnavadjust_write_project();
-
-			/* add info text */
-			sprintf(message,"Set crossing %d to be ignored\n",
-				mbna_current_crossing);
-			if (mbna_verbose == 0)
-				fprintf(stderr,"%s",message);
-			do_info_add(message, MB_YES);
-  			}
-   		}
-
-   	/* set mbna_crossing_select */
-    	if (project.open == MB_YES
-    		&& project.num_crossings > 0
-    		&& mbna_current_crossing >= 0)
-		{
-    		mbna_crossing_select = mbna_current_crossing;
-    		if (mbna_current_tie >= 0)
-		    mbna_tie_select = mbna_current_tie;
-		else
-    		    mbna_tie_select = MBNA_SELECT_NONE;
-		}
-    	else
-		{
-    		mbna_crossing_select = MBNA_SELECT_NONE;
-    		mbna_tie_select = MBNA_SELECT_NONE;
-		}
-
- 	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbnavadjust_naverr_unset()
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_naverr_skip";
-	int	status = MB_SUCCESS;
-	struct mbna_crossing *crossing;
-
- 	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
-
-     	/* get current crossing */
-    	if (project.open == MB_YES
-    		&& project.num_crossings > 0)
-    		{
-     		/* retrieve crossing parameters */
-    		if (mbna_current_crossing >= 0)
-    			{
-    			crossing = &project.crossings[mbna_current_crossing];
-			project.num_ties -= crossing->num_ties;
-			crossing->num_ties = 0;
-			if (crossing->status != MBNA_CROSSING_STATUS_NONE)
-				{
-				project.num_crossings_analyzed--;
-				if (crossing->truecrossing == MB_YES)
- 					project.num_truecrossings_analyzed--;
-				}
-    			crossing->status = MBNA_CROSSING_STATUS_NONE;
-   			if (project.inversion == MBNA_INVERSION_CURRENT)
-    				project.inversion = MBNA_INVERSION_OLD;
-
-			/* write updated project */
-			mbnavadjust_write_project();
-
-			/* add info text */
-			sprintf(message,"Unset crossing %d\n",
-				mbna_current_crossing);
-			if (mbna_verbose == 0)
-				fprintf(stderr,"%s",message);
-			do_info_add(message, MB_YES);
-  			}
-   		}
-
-   	/* set mbna_crossing_select */
-    	if (project.open == MB_YES
-    		&& project.num_crossings > 0
-    		&& mbna_current_crossing >= 0)
-		{
-    		mbna_crossing_select = mbna_current_crossing;
-    		if (mbna_current_tie >= 0)
-		    mbna_tie_select = mbna_current_tie;
-		else
-    		    mbna_tie_select = MBNA_SELECT_NONE;
-		}
-    	else
-		{
-    		mbna_crossing_select = MBNA_SELECT_NONE;
-    		mbna_tie_select = MBNA_SELECT_NONE;
-		}
-
- 	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbnavadjust_crossing_load()
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_crossing_load";
-	int	status = MB_SUCCESS;
-	struct mbna_crossing *crossing;
-	struct mbna_tie *tie;
-	struct mbna_file *file1, *file2;
-	struct mbna_section *section1, *section2;
-
- 	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
-
-	/* unload loaded crossing */
-	if (mbna_naverr_load == MB_YES)
-		{
-		status = mbnavadjust_crossing_unload();
-		}
-
-     	/* load current crossing */
-    	if ((mbna_status == MBNA_STATUS_NAVERR || mbna_status == MBNA_STATUS_AUTOPICK)
-		&& project.open == MB_YES
-    		&& project.num_crossings > 0
-    		&& mbna_current_crossing >= 0)
-    		{
-		/* put up message */
-		sprintf(message,"Loading crossing %d...",mbna_current_crossing);
-		do_message_update(message);
-
-    		/* retrieve crossing parameters */
-		crossing = &project.crossings[mbna_current_crossing];
-		mbna_file_id_1 = crossing->file_id_1;
-		mbna_section_1 = crossing->section_1;
-		mbna_file_id_2 = crossing->file_id_2;
-		mbna_section_2 = crossing->section_2;
-		file1 = (struct mbna_file *) &project.files[mbna_file_id_1];
-		file2 = (struct mbna_file *) &project.files[mbna_file_id_2];
-		section1 = (struct mbna_section *) &file1->sections[mbna_section_1];
-		section2 = (struct mbna_section *) &file2->sections[mbna_section_2];
-		if (crossing->num_ties > 0 && mbna_current_tie >= 0)
-		    {
-		    /* get basic crossing parameters */
-		    tie = &crossing->ties[mbna_current_tie];
-		    mbna_snav_1 = tie->snav_1;
-		    mbna_snav_1_time_d = tie->snav_1_time_d;
-		    mbna_snav_1_lon = section1->snav_lon[mbna_snav_1];
-		    mbna_snav_1_lat = section1->snav_lat[mbna_snav_1];
-		    mbna_snav_2 = tie->snav_2;
-		    mbna_snav_2_time_d = tie->snav_2_time_d;
-		    mbna_snav_2_lon = section2->snav_lon[mbna_snav_2];
-		    mbna_snav_2_lat = section2->snav_lat[mbna_snav_2];
-		    mbna_offset_x = tie->offset_x;
-		    mbna_offset_y = tie->offset_y;
-		    mbna_offset_z = tie->offset_z_m;
-/* fprintf(stderr,"%s %d: mbna_offset_z:%f\n",__FILE__,__LINE__,mbna_offset_z); */
-		    file1 = (struct mbna_file *) &project.files[mbna_file_id_1];
-		    file2 = (struct mbna_file *) &project.files[mbna_file_id_2];
-		    section1 = (struct mbna_section *) &file1->sections[mbna_section_1];
-		    section2 = (struct mbna_section *) &file2->sections[mbna_section_2];
-		    mbna_invert_offset_x = section2->snav_lon_offset[mbna_snav_2]
-					    - section1->snav_lon_offset[mbna_snav_1];
-		    mbna_invert_offset_y = section2->snav_lat_offset[mbna_snav_2]
-					    - section1->snav_lat_offset[mbna_snav_1];
-		    mbna_invert_offset_z = section2->snav_z_offset[mbna_snav_2]
-					    - section1->snav_z_offset[mbna_snav_1];
-		    }
-		else if (project.inversion != MBNA_INVERSION_NONE)
-	    	    {
-		    mbna_invert_offset_x = section2->snav_lon_offset[mbna_snav_2]
-					    - section1->snav_lon_offset[mbna_snav_1];
-		    mbna_invert_offset_y = section2->snav_lat_offset[mbna_snav_2]
-					    - section1->snav_lat_offset[mbna_snav_1];
-		    mbna_invert_offset_z = section2->snav_z_offset[mbna_snav_2]
-					    - section1->snav_z_offset[mbna_snav_1];
-		    mbna_offset_x = mbna_invert_offset_x;
-		    mbna_offset_y = mbna_invert_offset_y;
-		    mbna_offset_z = mbna_invert_offset_z;
-/* fprintf(stderr,"%s %d: mbna_offset_z:%f\n",__FILE__,__LINE__,mbna_offset_z); */
-		    }
-		else
-		    {
-		    mbna_offset_x = 0.0;
-		    mbna_offset_y = 0.0;
-		    mbna_offset_z = 0.0;
-/* fprintf(stderr,"%s %d: mbna_offset_z:%f\n",__FILE__,__LINE__,mbna_offset_z); */
-		    }
-		mbna_lon_min = MIN(section1->lonmin,section2->lonmin + mbna_offset_x);
-		mbna_lon_max = MAX(section1->lonmax,section2->lonmax + mbna_offset_x);
-		mbna_lat_min = MIN(section1->latmin,section2->latmin + mbna_offset_y);
-		mbna_lat_max = MAX(section1->latmax,section2->latmax + mbna_offset_y);
-		mbna_plot_lon_min = mbna_lon_min;
-		mbna_plot_lon_max = mbna_lon_max;
-		mbna_plot_lat_min = mbna_lat_min;
-		mbna_plot_lat_max = mbna_lat_max;
-		mb_coor_scale(mbna_verbose,0.5 * (mbna_lat_min + mbna_lat_max),
-				&mbna_mtodeglon,&mbna_mtodeglat);
-
-		/* load sections */
-		sprintf(message,"Loading section 1 of crossing %d...",mbna_current_crossing);
-		do_message_update(message);
-		status = mbnavadjust_section_load(mbna_file_id_1, mbna_section_1, (void **) &swathraw1, (void **) &swath1, section1->num_pings);
-		sprintf(message,"Loading section 2 of crossing %d...",mbna_current_crossing);
-		do_message_update(message);
-		status = mbnavadjust_section_load(mbna_file_id_2, mbna_section_2, (void **) &swathraw2, (void **) &swath2, section2->num_pings);
-
-		/* get lon lat positions for soundings */
-		sprintf(message,"Transforming section 1 of crossing %d...",mbna_current_crossing);
-		do_message_update(message);
-		status = mbnavadjust_section_translate(mbna_file_id_1, swathraw1, swath1, 0.0);
-		sprintf(message,"Transforming section 2 of crossing %d...",mbna_current_crossing);
-		do_message_update(message);
-		status = mbnavadjust_section_translate(mbna_file_id_2, swathraw2, swath2, mbna_offset_z);
-
-		/* generate contour data */
-		if (mbna_status != MBNA_STATUS_AUTOPICK)
-			{
-			sprintf(message,"Contouring section 1 of crossing %d...",mbna_current_crossing);
-			do_message_update(message);
-			status = mbnavadjust_section_contour(mbna_file_id_1,mbna_section_1,swath1,&mbna_contour1);
-			sprintf(message,"Contouring section 2 of crossing %d...",mbna_current_crossing);
-			do_message_update(message);
-			status = mbnavadjust_section_contour(mbna_file_id_2,mbna_section_2,swath2,&mbna_contour2);
-			}
-
-		/* set loaded flag */
-		mbna_naverr_load = MB_YES;
-
-		/* generate misfit grids */
-		sprintf(message,"Getting misfit for crossing %d...",mbna_current_crossing);
-		do_message_update(message);
-		status = mbnavadjust_get_misfit();
-
-		/* get overlap region */
-		mbnavadjust_crossing_overlap(mbna_current_crossing);
-  		}
-
-   	/* set mbna_crossing_select */
-    	if (project.open == MB_YES
-    		&& project.num_crossings > 0
-    		&& mbna_current_crossing >= 0)
-		{
-    		mbna_crossing_select = mbna_current_crossing;
-    		if (mbna_current_tie >= 0)
-		    mbna_tie_select = mbna_current_tie;
-		else
-    		    mbna_tie_select = MBNA_SELECT_NONE;
-		}
-    	else
-		{
-    		mbna_crossing_select = MBNA_SELECT_NONE;
-    		mbna_tie_select = MBNA_SELECT_NONE;
-		}
-
- 	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbnavadjust_crossing_unload()
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_crossing_unload";
-	int	status = MB_SUCCESS;
-	struct pingraw *pingraw;
-   	int	i;
-
- 	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
-
-	/* unload loaded crossing */
-	if (mbna_naverr_load == MB_YES)
-		{
-		/* free raw swath data */
-		if (swathraw1 != NULL && swathraw1->pingraws != NULL)
-		    {
-		    for (i=0;i<swathraw1->npings_max;i++)
-			{
-			pingraw = &swathraw1->pingraws[i];
-			status = mb_freed(mbna_verbose,__FILE__,__LINE__,(void **)&pingraw->beamflag, &error);
-			status = mb_freed(mbna_verbose,__FILE__,__LINE__,(void **)&pingraw->bath, &error);
-			status = mb_freed(mbna_verbose,__FILE__,__LINE__,(void **)&pingraw->bathacrosstrack, &error);
-			status = mb_freed(mbna_verbose,__FILE__,__LINE__,(void **)&pingraw->bathalongtrack, &error);
-			}
-		    status = mb_freed(mbna_verbose,__FILE__,__LINE__,(void **)&swathraw1->pingraws, &error);
-		    }
-		if (swathraw2 != NULL && swathraw2->pingraws != NULL)
-		    {
-		    for (i=0;i<swathraw2->npings_max;i++)
-			{
-			pingraw = &swathraw2->pingraws[i];
-			status = mb_freed(mbna_verbose,__FILE__,__LINE__,(void **)&pingraw->beamflag, &error);
-			status = mb_freed(mbna_verbose,__FILE__,__LINE__,(void **)&pingraw->bath, &error);
-			status = mb_freed(mbna_verbose,__FILE__,__LINE__,(void **)&pingraw->bathacrosstrack, &error);
-			status = mb_freed(mbna_verbose,__FILE__,__LINE__,(void **)&pingraw->bathalongtrack, &error);
-			}
-		    status = mb_freed(mbna_verbose,__FILE__,__LINE__,(void **)&swathraw2->pingraws, &error);
-		    }
-		if (swathraw1 != NULL)
-		    status = mb_freed(mbna_verbose,__FILE__,__LINE__,(void **)&swathraw1, &error);
-		if (swathraw2 != NULL)
-		    status = mb_freed(mbna_verbose,__FILE__,__LINE__,(void **)&swathraw2, &error);
-
-		/* free contours */
-		status = mb_contour_deall(mbna_verbose,swath1,&error);
-		status = mb_contour_deall(mbna_verbose,swath2,&error);
-		if (mbna_contour1.vector != NULL
-			&& mbna_contour1.nvector_alloc > 0)
-		    {
-		    free(mbna_contour1.vector);
-		    }
-		if (mbna_contour2.vector != NULL
-			&& mbna_contour2.nvector_alloc > 0)
-		    {
-		    free(mbna_contour2.vector);
-		    }
-		mbna_contour1.vector = NULL;
-		mbna_contour1.nvector = 0;
-		mbna_contour1.nvector_alloc = 0;
-		mbna_contour2.vector = NULL;
-		mbna_contour2.nvector = 0;
-		mbna_contour2.nvector_alloc = 0;
-		mbna_naverr_load = MB_NO;
-		grid_nx = 0;
-		grid_ny = 0;
-		grid_nxy = 0;
-		grid_nxyzeq = 0;
-		gridm_nx = 0;
-		gridm_ny = 0;
-		gridm_nxyz = 0;
-		if (grid1 != NULL)
-		    {
-		    free(grid1);
-		    }
-		if (grid2 != NULL)
-		    {
-		    free(grid2);
-		    }
-		if (gridm != NULL)
-		    {
-		    free(gridm);
-		    }
-		if (gridmeq != NULL)
-		    {
-		    free(gridmeq);
-		    }
-		if (gridn1 != NULL)
-		    {
-		    free(gridn1);
-		    }
-		if (gridn2 != NULL)
-		    {
-		    free(gridn2);
-		    }
-		if (gridnm != NULL)
-		    {
-		    free(gridnm);
-		    }
-		grid1 = NULL;
-		grid2 = NULL;
-		gridm = NULL;
-		gridmeq = NULL;
-		gridn1 = NULL;
-		gridn2 = NULL;
-		gridnm = NULL;
-		}
-
- 	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbnavadjust_crossing_replot()
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_crossing_replot";
-	int	status = MB_SUCCESS;
-
- 	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
-
-	/* replot loaded crossing */
-	if ((mbna_status == MBNA_STATUS_NAVERR  || mbna_status == MBNA_STATUS_AUTOPICK)
-		&& mbna_naverr_load == MB_YES)
-		{
-		/* get lon lat positions for soundings */
-		status = mbnavadjust_section_translate(mbna_file_id_1, swathraw1, swath1, 0.0);
-		status = mbnavadjust_section_translate(mbna_file_id_2, swathraw2, swath2, mbna_offset_z);
-
-		/* generate contour data */
-		status = mbnavadjust_section_contour(mbna_file_id_1,mbna_section_1,swath1,&mbna_contour1);
-		status = mbnavadjust_section_contour(mbna_file_id_2,mbna_section_2,swath2,&mbna_contour2);
-   		}
-
- 	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbnavadjust_section_load(int file_id, int section_id, void **swathraw_ptr, void **swath_ptr, int num_pings)
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_section_load";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *imb_io_ptr;
-	struct swathraw *swathraw;
-	struct pingraw *pingraw;
-	struct swath *swath;
-	struct mbna_file *file;
-	struct mbna_section *section;
-
-	/* mbio read and write values */
-	void	*imbio_ptr = NULL;
-	void	*istore_ptr = NULL;
-	int	kind;
-	int	time_i[7];
-	double	time_d;
-	double	navlon;
-	double	navlat;
-	double	speed;
-	double	heading;
-	double	distance;
-	double	altitude;
-	double	sonardepth;
-	double	roll;
-	double	pitch;
-	double	heave;
-	int	beams_bath;
-	int	beams_amp;
-	int	pixels_ss;
-	char	*beamflag = NULL;
-	double	*bath = NULL;
-	double	*bathacrosstrack = NULL;
-	double	*bathalongtrack = NULL;
-	double	*amp = NULL;
-	double	*ss = NULL;
-	double	*ssacrosstrack = NULL;
-	double	*ssalongtrack = NULL;
-	char	comment[MB_COMMENT_MAXLINE];
-
-	char	path[STRING_MAX];
-	int	iformat;
-	double	tick_len_map, label_hgt_map;
-	int	done;
-   	int	i;
-
- 	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       file_id:      %d\n",file_id);
-		fprintf(stderr,"dbg2       section_id:   %d\n",section_id);
-		fprintf(stderr,"dbg2       swath_ptr:    %p  %p\n",swath_ptr, *swath_ptr);
-		fprintf(stderr,"dbg2       num_pings:    %d\n",num_pings);
-		}
-
-     	/* load specified section */
-    	if (project.open == MB_YES
-    		&& project.num_crossings > 0)
-    		{
-		/* set section format and path */
-		sprintf(path,"%s/nvs_%4.4d_%4.4d.mb71",
-			project.datadir,file_id,section_id);
-		iformat = 71;
-		file = &(project.files[file_id]);
-		section = &(file->sections[section_id]);
-
-		/* initialize section for reading */
-		if ((status = mb_read_init(
-			mbna_verbose,path,iformat,pings,lonflip,bounds,
-			btime_i,etime_i,speedmin,timegap,
-			&imbio_ptr,&btime_d,&etime_d,
-			&beams_bath,&beams_amp,&pixels_ss,&error)) != MB_SUCCESS)
-			{
-			mb_error(mbna_verbose,error,&error_message);
-			fprintf(stderr,"\nMBIO Error returned from function <mb_read_init>:\n%s\n",error_message);
-			fprintf(stderr,"\nSwath sonar File <%s> not initialized for reading\n",path);
-			exit(0);
-			}
-
-		/* allocate memory for data arrays */
-		if (status == MB_SUCCESS)
-			{
-			if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(mbna_verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							    sizeof(char), (void **)&beamflag, &error);
-			if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(mbna_verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							    sizeof(double), (void **)&bath, &error);
-			if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(mbna_verbose, imbio_ptr, MB_MEM_TYPE_AMPLITUDE,
-							    sizeof(double), (void **)&amp, &error);
-			if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(mbna_verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							    sizeof(double), (void **)&bathacrosstrack, &error);
-			if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(mbna_verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							    sizeof(double), (void **)&bathalongtrack, &error);
-			if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(mbna_verbose, imbio_ptr, MB_MEM_TYPE_SIDESCAN,
-							    sizeof(double), (void **)&ss, &error);
-			if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(mbna_verbose, imbio_ptr, MB_MEM_TYPE_SIDESCAN,
-							    sizeof(double), (void **)&ssacrosstrack, &error);
-			if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(mbna_verbose, imbio_ptr, MB_MEM_TYPE_SIDESCAN,
-							    sizeof(double), (void **)&ssalongtrack, &error);
-
-			/* if error initializing memory then don't read the file */
-			if (error != MB_ERROR_NO_ERROR)
-				{
-				mb_error(mbna_verbose,error,&error_message);
-				fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",
-					error_message);
-				}
-			}
-
-		/* allocate memory for data arrays */
-		if (status == MB_SUCCESS)
-			{
-			/* get mb_io_ptr */
-			imb_io_ptr = (struct mb_io_struct *) imbio_ptr;
-
-			/* initialize data storage */
-			status = mb_mallocd(mbna_verbose, __FILE__, __LINE__, sizeof(struct swathraw),
-						(void **)swathraw_ptr, &error);
-			swathraw = (struct swathraw *) *swathraw_ptr;
-			swathraw->beams_bath = beams_bath;
-			swathraw->npings_max = num_pings;
-			swathraw->npings = 0;
-			status = mb_mallocd(mbna_verbose, __FILE__, __LINE__, num_pings * sizeof(struct pingraw),
-						(void **)&swathraw->pingraws, &error);
-			for (i=0;i<swathraw->npings_max;i++)
-				{
-				pingraw = &swathraw->pingraws[i];
-				pingraw->beams_bath = 0;
-				pingraw->beamflag = NULL;
-				pingraw->bath = NULL;
-				pingraw->bathacrosstrack = NULL;
-				pingraw->bathalongtrack = NULL;
-				}
-
-			/* initialize contour controls */
-			tick_len_map = MAX(section->lonmax - section->lonmin,
-						section->latmax - section->latmin) / 500;
-			label_hgt_map = MAX(section->lonmax - section->lonmin,
-						section->latmax - section->latmin) / 100;
- 			status = mb_contour_init(mbna_verbose, (struct swath **)swath_ptr,
-					    num_pings,
-					    beams_bath,
-					    mbna_contour_algorithm,
-					    MB_YES,MB_NO,MB_NO,MB_NO,MB_NO,
-					    project.cont_int, project.col_int,
-					    project.tick_int, project.label_int,
-					    tick_len_map, label_hgt_map, 0.0,
-					    mbna_ncolor, 0, NULL, NULL, NULL,
-					    0.0, 0.0, 0.0, 0.0,
-					    0, 0, 0.0, 0.0,
-					    &mbnavadjust_plot,
-					    &mbnavadjust_newpen,
-					    &mbnavadjust_setline,
-					    &mbnavadjust_justify_string,
-					    &mbnavadjust_plot_string,					    
-					    &error);
-			swath = (struct swath *) *swath_ptr;
-			swath->beams_bath = beams_bath;
-			swath->npings = 0;
-
-			/* if error initializing memory then quit */
-			if (error != MB_ERROR_NO_ERROR)
-				{
-				mb_error(mbna_verbose,error,&error_message);
-				fprintf(stderr,"\nMBIO Error allocating contour control structure:\n%s\n",error_message);
-				fprintf(stderr,"\nProgram <%s> Terminated\n",
-					program_name);
-				exit(error);
-				}
-			}
-
-		/* now read the data */
-		if (status == MB_SUCCESS)
-			{
-			done = MB_NO;
-			while (done == MB_NO)
-			    {
-			    /* read the next ping */
-			    status = mb_get_all(mbna_verbose,imbio_ptr,
-				    &istore_ptr, &kind, time_i, &time_d,
-				    &navlon, &navlat, &speed,
-				    &heading, &distance, &altitude, &sonardepth,
-				    &beams_bath, &beams_amp, &pixels_ss,
-				    beamflag, bath, amp, bathacrosstrack, bathalongtrack,
-				    ss, ssacrosstrack, ssalongtrack,
-				    comment, &error);
-
-			    /* handle successful read */
-			    if (status == MB_SUCCESS
-				&& kind == MB_DATA_DATA)
-			    	{
-				/* allocate memory for the raw arrays */
-				pingraw = &swathraw->pingraws[swathraw->npings];
-				status = mb_mallocd(mbna_verbose, __FILE__, __LINE__, beams_bath * sizeof(char),
-							(void **)&pingraw->beamflag, &error);
-				status = mb_mallocd(mbna_verbose, __FILE__, __LINE__, beams_bath * sizeof(double),
-							(void **)&pingraw->bath, &error);
-				status = mb_mallocd(mbna_verbose, __FILE__, __LINE__, beams_bath * sizeof(double),
-							(void **)&pingraw->bathacrosstrack, &error);
-				status = mb_mallocd(mbna_verbose, __FILE__, __LINE__, beams_bath * sizeof(double),
-							(void **)&pingraw->bathalongtrack, &error);
-
-				/* make sure enough memory is allocated for contouring arrays */
-		        	ping = &swath->pings[swathraw->npings];
-				if (ping->beams_bath_alloc < beams_bath)
-					{
-					status = mb_reallocd(mbna_verbose,__FILE__,__LINE__,beams_bath*sizeof(char),
-							(void **)&(ping->beamflag),&error);
-					status = mb_reallocd(mbna_verbose,__FILE__,__LINE__,beams_bath*sizeof(double),
-							(void **)&(ping->bath),&error);
-					status = mb_reallocd(mbna_verbose,__FILE__,__LINE__,beams_bath*sizeof(double),
-							(void **)&(ping->bathlon),&error);
-					status = mb_reallocd(mbna_verbose,__FILE__,__LINE__,beams_bath*sizeof(double),
-							(void **)&(ping->bathlat),&error);
-                                        if (mbna_contour_algorithm == MB_CONTOUR_OLD)
-                                            {
-                                            status = mb_reallocd(mbna_verbose,__FILE__,__LINE__,beams_bath*sizeof(int),
-                                                            (void **)&(ping->bflag[0]),&error);
-                                            status = mb_reallocd(mbna_verbose,__FILE__,__LINE__,beams_bath*sizeof(int),
-                                                            (void **)&(ping->bflag[1]),&error);
-                                            }
-					ping->beams_bath_alloc = beams_bath;
-					}
-
-			    	/* copy arrays and update bookkeeping */
-			    	if (error == MB_ERROR_NO_ERROR)
-				    {
-				    swathraw->npings++;
-				    if (swathraw->npings >= swathraw->npings_max)
-				    	done = MB_YES;
-
-				    for (i=0;i<7;i++)
-				    	pingraw->time_i[i] = time_i[i];
-				    pingraw->time_d = time_d;
-				    pingraw->navlon = navlon;
-				    pingraw->navlat = navlat;
-				    pingraw->heading = heading;
-				    pingraw->draft = sonardepth;
-				    pingraw->beams_bath = beams_bath;
-/* fprintf(stderr,"\nPING %d : %4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d\n",
-swathraw->npings,time_i[0],time_i[1],time_i[2],time_i[3],time_i[4],time_i[5],time_i[6]); */
-				    for (i=0;i<beams_bath;i++)
-				    	{
-					pingraw->beamflag[i] = beamflag[i];
-					if (mb_beam_ok(beamflag[i]))
-				    		{
-						pingraw->beamflag[i] = beamflag[i];
-						pingraw->bath[i] = bath[i];
-				    		pingraw->bathacrosstrack[i] = bathacrosstrack[i];
-				    		pingraw->bathalongtrack[i] = bathalongtrack[i];
-						}
-					else
-				    		{
-						pingraw->beamflag[i] = MB_FLAG_NULL;
-						pingraw->bath[i] = 0.0;
-				    		pingraw->bathacrosstrack[i] = 0.0;
-				    		pingraw->bathalongtrack[i] = 0.0;
-						}
-/* fprintf(stderr,"BEAM: %d:%d  Flag:%d    %f %f %f\n",
-swathraw->npings,i,pingraw->beamflag[i],pingraw->bath[i],pingraw->bathacrosstrack[i],pingraw->bathalongtrack[i]); */
-					}
-				    }
-
-				/* extract all nav values */
-				status = mb_extract_nav(mbna_verbose,imbio_ptr,
-					istore_ptr,&kind,
-					pingraw->time_i, &pingraw->time_d,
-					&pingraw->navlon, &pingraw->navlat, &speed,
-					&pingraw->heading, &pingraw->draft,
-					&roll, &pitch, &heave,
-					&error);
-
-/*fprintf(stderr, "%d  %4d/%2d/%2d %2d:%2d:%2d.%6.6d  %15.10f %15.10f %d:%d\n",
-status,
-ping->time_i[0],ping->time_i[1],ping->time_i[2],
-ping->time_i[3],ping->time_i[4],ping->time_i[5],ping->time_i[6],
-ping->navlon, ping->navlat, beams_bath, swath->beams_bath);*/
-
-
-			    	/* print debug statements */
-			    	if (mbna_verbose >= 2)
-				    {
-				    fprintf(stderr,"\ndbg2  Ping read in program <%s>\n",
-					    program_name);
-				    fprintf(stderr,"dbg2       kind:           %d\n",
-					    kind);
-				    fprintf(stderr,"dbg2       npings:         %d\n",
-					    swathraw->npings);
-				    fprintf(stderr,"dbg2       time:           %4d %2d %2d %2d %2d %2d %6.6d\n",
-					    pingraw->time_i[0],pingraw->time_i[1],pingraw->time_i[2],
-					    pingraw->time_i[3],pingraw->time_i[4],pingraw->time_i[5],pingraw->time_i[6]);
-				    fprintf(stderr,"dbg2       navigation:     %f  %f\n",
-					    pingraw->navlon, pingraw->navlat);
-				    fprintf(stderr,"dbg2       beams_bath:     %d\n",
-					    beams_bath);
-				    fprintf(stderr,"dbg2       beams_amp:      %d\n",
-					    beams_amp);
-				    fprintf(stderr,"dbg2       pixels_ss:      %d\n",
-					    pixels_ss);
-				    fprintf(stderr,"dbg2       done:           %d\n",
-					    done);
-				    fprintf(stderr,"dbg2       error:          %d\n",
-					    error);
-				    fprintf(stderr,"dbg2       status:         %d\n",
-					    status);
-				    }
-				}
-			    else if (error > MB_ERROR_NO_ERROR)
-			    	{
-			    	status = MB_SUCCESS;
-			    	error = MB_ERROR_NO_ERROR;
-			    	done = MB_YES;
-			    	}
-			    }
-
-			/* close the input data file */
-			status = mb_close(mbna_verbose,&imbio_ptr,&error);
-			}
-   		}
-
- 	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbnavadjust_section_translate(int file_id, void *swathraw_ptr, void *swath_ptr, double zoffset)
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_section_translate";
-	int	status = MB_SUCCESS;
-	struct swathraw *swathraw;
-	struct pingraw *pingraw;
-	struct swath *swath;
-	double	mtodeglon, mtodeglat, headingx, headingy;
-	double	depth, depthacrosstrack, depthalongtrack;
-	double	alpha, beta, range;
-   	int	i, iping;
-
- 	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       file_id:      %d\n",file_id);
-		fprintf(stderr,"dbg2       swathraw_ptr: %p\n",swathraw_ptr);
-		fprintf(stderr,"dbg2       swath_ptr:    %p\n",swath_ptr);
-		fprintf(stderr,"dbg2       zoffset:      %f\n",zoffset);
-		}
-
-     	/* translate sounding positions for loaded section */
-    	if (project.open == MB_YES
-    		&& project.num_crossings > 0
-    		&& mbna_current_crossing >= 0)
-    		{
-		swathraw = (struct swathraw *) swathraw_ptr;
-		swath = (struct swath *) swath_ptr;
-
-		/* relocate soundings based on heading bias */
-		swath->npings = 0;
-		for (iping=0;iping<swathraw->npings;iping++)
-		    {
-		    swath->npings++;
-		    pingraw = &swathraw->pingraws[iping];
-		    ping = &swath->pings[swath->npings - 1];
-		    for (i=0;i<7;i++)
-			ping->time_i[i] = pingraw->time_i[i];
-		    ping->time_d = pingraw->time_d;
-		    ping->navlon = pingraw->navlon;
-		    ping->navlat = pingraw->navlat;
-		    ping->heading = pingraw->heading
-				    + project.files[file_id].heading_bias;
-		    mb_coor_scale(mbna_verbose, pingraw->navlat,
-				    &mtodeglon, &mtodeglat);
-		    headingx = sin(ping->heading * DTR);
-		    headingy = cos(ping->heading * DTR);
-		    ping->beams_bath = pingraw->beams_bath;
-		    for (i=0;i<ping->beams_bath;i++)
-			{
-			ping->beamflag[i] = pingraw->beamflag[i];
-			if (mb_beam_ok(pingraw->beamflag[i]))
-			    {
-			    /* strip off transducer depth */
-			    depth = pingraw->bath[i] - pingraw->draft;
-
-			    /* get range and angles in
-				roll-pitch frame */
-			    range = sqrt(depth * depth
-					+ pingraw->bathacrosstrack[i]
-					    * pingraw->bathacrosstrack[i]
-					+ pingraw->bathalongtrack[i]
-					    * pingraw->bathalongtrack[i]);
-			    alpha = asin(pingraw->bathalongtrack[i]
-				    / range);
-			    beta = acos(pingraw->bathacrosstrack[i]
-				    / range / cos(alpha));
-
-			    /* apply roll correction */
-			    beta +=  DTR * project.files[file_id].roll_bias;
-
-			    /* recalculate bathymetry */
-			    depth = range * cos(alpha) * sin(beta);
-			    depthalongtrack = range * sin(alpha);
-			    depthacrosstrack = range * cos(alpha) * cos(beta);
-
-			    /* add heave and draft back in */
-			    depth += pingraw->draft;
-
-			    /* add zoffset */
-			    depth += zoffset;
-
-			    /* get bathymetry in lon lat */
-			    ping->beamflag[i] = pingraw->beamflag[i];
-			    ping->bath[i] = depth;
-			    ping->bathlon[i] = pingraw->navlon
-					    + headingy*mtodeglon
-						*depthacrosstrack
-					    + headingx*mtodeglon
-						*depthalongtrack;
-			    ping->bathlat[i] = pingraw->navlat
-					    - headingx*mtodeglat
-						*depthacrosstrack
-					    + headingy*mtodeglat
-						*depthalongtrack;
-			    }
-			}
-		    }
-		}
-
- 	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbnavadjust_section_contour(int fileid, int sectionid,
-				struct swath *swath,
-				struct mbna_contour_vector *contour)
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_section_contour";
-	int	status = MB_SUCCESS;
-
- 	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       fileid:       %d\n",fileid);
-		fprintf(stderr,"dbg2       sectionid:    %d\n",sectionid);
-		fprintf(stderr,"dbg2       swath:        %p\n",swath);
-		fprintf(stderr,"dbg2       contour:      %p\n",contour);
-		fprintf(stderr,"dbg2       nvector:      %d\n",contour->nvector);
-		fprintf(stderr,"dbg2       nvector_alloc:%d\n",contour->nvector_alloc);
-		}
-
-	if (swath != NULL)
-		{
-		/* set vectors */
-		mbna_contour = contour;
-		contour->nvector = 0;
-
-    		/* reset contouring parameters */
-		swath->contour_int = project.cont_int;
-		swath->color_int = project.col_int;
-		swath->tick_int = project.tick_int;
-
-		/* generate contours */
-		status = mb_contour(mbna_verbose,swath,&error);
-
-		/* set contours up to date flag */
-		project.files[fileid].sections[sectionid].contoursuptodate = MB_YES;
-		}
-
- 	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbnavadjust_naverr_snavpoints(int ix, int iy)
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_naverr_snavpoints";
-	int	status = MB_SUCCESS;
-	double	x, y, dx, dy, d;
-	struct mbna_crossing *crossing;
-	struct mbna_section *section;
-	double	distance;
-	int	i;
-
- 	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       ix:           %d\n",ix);
-		fprintf(stderr,"dbg2       iy:           %d\n",iy);
-		}
-
-     	if (mbna_naverr_load == MB_YES)
-    		{
-    		/* get position in lon and lat */
-	    	x = ix / mbna_plotx_scale +  mbna_plot_lon_min;
-	    	y = (cont_borders[3] - iy) / mbna_ploty_scale +  mbna_plot_lat_min;
-		crossing = &project.crossings[mbna_current_crossing];
-
-	    	/* get closest snav point in swath 1 */
-		section = &project.files[crossing->file_id_1].sections[crossing->section_1];
-	    	distance = 999999.999;
-		for (i=0;i<section->num_snav;i++)
-			{
-	    		dx = (section->snav_lon[i] - x) / mbna_mtodeglon;
-	    		dy = (section->snav_lat[i] - y) / mbna_mtodeglat;
-	    		d = sqrt(dx * dx + dy * dy);
-	    		if (d < distance)
-	    			{
-	    			distance = d;
- 			    	mbna_snav_1 = i;
-			    	mbna_snav_1_time_d = section->snav_time_d[i];
-			    	mbna_snav_1_lon = section->snav_lon[i];
-			    	mbna_snav_1_lat = section->snav_lat[i];
-	    			}
-			}
-
-	    	/* get closest snav point in swath 2 */
-		section = &project.files[crossing->file_id_2].sections[crossing->section_2];
-	    	distance = 999999.999;
-		for (i=0;i<section->num_snav;i++)
-			{
-	    		dx = (section->snav_lon[i] + mbna_offset_x - x) / mbna_mtodeglon;
-	    		dy = (section->snav_lat[i] + mbna_offset_y - y) / mbna_mtodeglat;
-	    		d = sqrt(dx * dx + dy * dy);
-	    		if (d < distance)
-	    			{
-	    			distance = d;
- 			    	mbna_snav_2 = i;
-			    	mbna_snav_2_time_d = section->snav_time_d[i];
-			    	mbna_snav_2_lon = section->snav_lon[i];
-			    	mbna_snav_2_lat = section->snav_lat[i];
-	    			}
-			}
-
-		}
-
- 	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  snav point selected in MBnavadjust function <%s>\n",
-			function_name);
-		fprintf(stderr,"dbg2  snav values:\n");
-		section = &project.files[crossing->file_id_1].sections[crossing->section_1];
-		fprintf(stderr,"dbg2       mbna_snav_1:        %d\n",mbna_snav_1);
-		fprintf(stderr,"dbg2       mbna_snav_1_time_d: %f\n",mbna_snav_1_time_d);
-		fprintf(stderr,"dbg2       mbna_snav_1_lon:    %.10f\n",mbna_snav_1_lon);
-		fprintf(stderr,"dbg2       mbna_snav_1_lat:    %.10f\n",mbna_snav_1_lat);
-		fprintf(stderr,"dbg2       section->num_snav:  %d\n",section->num_snav);
-		for (i=0;i<section->num_snav;i++)
-			{
-			fprintf(stderr,"dbg2       section1->snav_time_d[%d]: %f\n",i,section->snav_time_d[i]);
-			fprintf(stderr,"dbg2       section1->snav_lon[%d]:    %.10f\n",i,section->snav_lon[i]);
-			fprintf(stderr,"dbg2       section1->snav_lat[%d]:    %.10f\n",i,section->snav_lat[i]);
-			}
-		section = &project.files[crossing->file_id_2].sections[crossing->section_2];
-		fprintf(stderr,"dbg2       mbna_snav_2:        %d\n",mbna_snav_2);
-		fprintf(stderr,"dbg2       mbna_snav_2_time_d: %f\n",mbna_snav_2_time_d);
-		fprintf(stderr,"dbg2       mbna_snav_2_lon:    %.10f\n",mbna_snav_2_lon);
-		fprintf(stderr,"dbg2       mbna_snav_2_lat:    %.10f\n",mbna_snav_2_lat);
-		fprintf(stderr,"dbg2       section->num_snav:  %d\n",section->num_snav);
-		for (i=0;i<section->num_snav;i++)
-			{
-			fprintf(stderr,"dbg2       section2->snav_time_d[%d]: %f\n",i,section->snav_time_d[i]);
-			fprintf(stderr,"dbg2       section2->snav_lon[%d]:    %.10f\n",i,section->snav_lon[i]);
-			fprintf(stderr,"dbg2       section2->snav_lat[%d]:    %.10f\n",i,section->snav_lat[i]);
-			}
-		}
-
- 	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbnavadjust_sections_intersect(int crossing_id)
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_sections_intersect";
-	struct mbna_file *file;
-	struct mbna_crossing *crossing;
-	struct mbna_section *section;
-	int	answer = MB_NO;
-	double	xa1, ya1, xa2, ya2;
-	double	xb1, yb1, xb2, yb2;
-	double	dxa, dya, dxb, dyb;
-	double	s, t;
-
- 	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       crossing_id:  %d\n",crossing_id);
-		}
-
-	/* get crossing */
-	crossing = (struct mbna_crossing *) &project.crossings[crossing_id];
-
-	/* get section endpoints */
-	file = &project.files[crossing->file_id_1];
-	section = &file->sections[crossing->section_1];
-	xa1 = section->snav_lon[0] + section->snav_lon_offset[0];
-	ya1 = section->snav_lat[0] + section->snav_lat_offset[0];
-	xa2 = section->snav_lon[section->num_snav - 1] + section->snav_lon_offset[section->num_snav - 1];
-	ya2 = section->snav_lat[section->num_snav - 1] + section->snav_lat_offset[section->num_snav - 1];
-	file = &project.files[crossing->file_id_2];
-	section = &file->sections[crossing->section_2];
-	xb1 = section->snav_lon[0] + section->snav_lon_offset[0];
-	yb1 = section->snav_lat[0] + section->snav_lat_offset[0];
-	xb2 = section->snav_lon[section->num_snav - 1] + section->snav_lon_offset[section->num_snav - 1];
-	yb2 = section->snav_lat[section->num_snav - 1] + section->snav_lat_offset[section->num_snav - 1];
-
-	/* check for parallel sections */
-	dxa = xa2 - xa1;
-	dya = ya2 - ya1;
-	dxb = xb2 - xb1;
-	dyb = yb2 - yb1;
-	if ((dxb * dya - dyb * dxa) == 0.0)
-		{
-		answer = MB_NO;
-		}
-	else
-		{
-		/* check for crossing sections */
-		s = (dxa * (yb1 - ya1) + dya * (xa1 - xb1)) / (dxb * dya - dyb * dxa);
-		t = (dxb * (ya1 - yb1) + dyb * (xb1 - xa1)) / (dyb * dxa - dxb * dya);
-		if (s >= 0.0 && s <= 1.0 && t >= 0.0 && t <= 1.0)
-			answer = MB_YES;
-		else
-			answer = MB_NO;
-		}
-
- 	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       answer:      %d\n",answer);
-		}
-
-	return(answer);
-}
-/*--------------------------------------------------------------------*/
-int mbnavadjust_crossing_overlap(int crossing_id)
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_crossing_overlap";
-	int	status = MB_SUCCESS;
-	struct mbna_file *file;
-	struct mbna_crossing *crossing;
-	struct mbna_section *section1;
-	struct mbna_section *section2;
-	int	overlap1[MBNA_MASK_DIM * MBNA_MASK_DIM];
-	int	overlap2[MBNA_MASK_DIM * MBNA_MASK_DIM];
-	double	lonoffset, latoffset;
-	double	lon1min, lon1max;
-	double	lat1min, lat1max;
-	double	lon2min, lon2max;
-	double	lat2min, lat2max;
-	double	dx1, dy1, dx2, dy2;
-	double	overlapfraction;
-	int	ncoverage1, ncoverage2;
-	int	noverlap1, noverlap2;
-	int	first;
-	int	i, ii1, jj1, kk1, ii2, jj2, kk2;
-
- 	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       crossing_id:          %d\n",crossing_id);
-		}
-
-	/* get crossing */
-	crossing = (struct mbna_crossing *) &project.crossings[crossing_id];
-
-	/* get section endpoints */
-	file = &project.files[crossing->file_id_1];
-	section1 = &file->sections[crossing->section_1];
-	file = &project.files[crossing->file_id_2];
-	section2 = &file->sections[crossing->section_2];
-	lonoffset = section2->snav_lon_offset[section2->num_snav/2] - section1->snav_lon_offset[section1->num_snav/2];
-	latoffset = section2->snav_lat_offset[section2->num_snav/2] - section1->snav_lat_offset[section1->num_snav/2];
-
-	/* initialize overlap arrays */
-	for (i=0;i<MBNA_MASK_DIM*MBNA_MASK_DIM;i++)
-		{
-		overlap1[i] = 0;
-		overlap2[i] = 0;
-		}
-
-	/* check coverage masks for overlap */
-	first = MB_YES;
-	dx1 = (section1->lonmax - section1->lonmin) / MBNA_MASK_DIM;
-	dy1 = (section1->latmax - section1->latmin) / MBNA_MASK_DIM;
-	dx2 = (section2->lonmax - section2->lonmin) / MBNA_MASK_DIM;
-	dy2 = (section2->latmax - section2->latmin) / MBNA_MASK_DIM;
-	for (ii1=0;ii1<MBNA_MASK_DIM;ii1++)
-	    for (jj1=0;jj1<MBNA_MASK_DIM;jj1++)
-		{
-		kk1 = ii1 + jj1 * MBNA_MASK_DIM;
-		if (section1->coverage[kk1] == 1)
-		    {
-		    lon1min = section1->lonmin + dx1 * ii1;
-		    lon1max = section1->lonmin + dx1 * (ii1 + 1);
-		    lat1min = section1->latmin + dy1 * jj1;
-		    lat1max = section1->latmin + dy1 * (jj1 + 1);
-		    for (ii2=0;ii2<MBNA_MASK_DIM;ii2++)
-			for (jj2=0;jj2<MBNA_MASK_DIM;jj2++)
-			    {
-			    kk2 = ii2 + jj2 * MBNA_MASK_DIM;
-			    if (section2->coverage[kk2] == 1)
-				{
-				lon2min = section2->lonmin + dx2 * ii2 + lonoffset;
-				lon2max = section2->lonmin + dx2 * (ii2 + 1) + lonoffset;
-				lat2min = section2->latmin + dy2 * jj2 + latoffset;
-				lat2max = section2->latmin + dy2 * (jj2 + 1) + latoffset;
-				if ((lon1min < lon2max)
-				    && (lon1max > lon2min)
-				    && (lat1min < lat2max)
-				    && (lat1max > lat2min))
-				    {
-				    overlap1[kk1] = 1;
-				    overlap2[kk2] = 1;
-				    }
-				}
-			    }
-		    }
-		}
-
-	/* count fractions covered */
-	ncoverage1 = 0;
-	ncoverage2 = 0;
-	noverlap1 = 0;
-	noverlap2 = 0;
-	for (i=0;i<MBNA_MASK_DIM*MBNA_MASK_DIM;i++)
-		{
-		if (section1->coverage[i] == 1)
-			ncoverage1++;
-		if (section2->coverage[i] == 1)
-			ncoverage2++;
-		if (overlap1[i] == 1)
-			noverlap1++;
-		if (overlap2[i] == 1)
-			noverlap2++;
-		}
-	overlapfraction = (dx1 * dy1) / (dx1 * dy1 + dx2 * dy2)
-				* ((double)noverlap1) / ((double)ncoverage1)
-			+ (dx2 * dy2) / (dx1 * dy1 + dx2 * dy2)
-				* ((double)noverlap2) / ((double)ncoverage2);
-	crossing->overlap = (int) (100.0 * overlapfraction);
-	if (crossing->overlap < 1)
-		crossing->overlap = 1;
-
- 	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       crossing->overlap: %d\n",crossing->overlap);
-		fprintf(stderr,"dbg2       status:            %d\n",status);
-		}
-
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbnavadjust_crossing_overlapbounds(int crossing_id,
-				double offset_x, double offset_y,
-				double *lonmin, double *lonmax,
-				double *latmin, double *latmax)
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_crossing_overlapbounds";
-	int	status = MB_SUCCESS;
-	struct mbna_file *file;
-	struct mbna_crossing *crossing;
-	struct mbna_section *section1;
-	struct mbna_section *section2;
-	int	overlap1[MBNA_MASK_DIM * MBNA_MASK_DIM];
-	int	overlap2[MBNA_MASK_DIM * MBNA_MASK_DIM];
-	double	lon1min, lon1max;
-	double	lat1min, lat1max;
-	double	lon2min, lon2max;
-	double	lat2min, lat2max;
-	double	dx1, dy1, dx2, dy2;
-	int	first;
-	int	i, ii1, jj1, kk1, ii2, jj2, kk2;
-
- 	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       crossing_id:          %d\n",crossing_id);
-		fprintf(stderr,"dbg2       offset_x:             %f\n",offset_x);
-		fprintf(stderr,"dbg2       offset_y:             %f\n",offset_y);
-		}
-
-	/* get crossing */
-	crossing = (struct mbna_crossing *) &project.crossings[crossing_id];
-
-	/* get section endpoints */
-	file = &project.files[crossing->file_id_1];
-	section1 = &file->sections[crossing->section_1];
-	file = &project.files[crossing->file_id_2];
-	section2 = &file->sections[crossing->section_2];
-
-	/* initialize overlap arrays */
-	for (i=0;i<MBNA_MASK_DIM*MBNA_MASK_DIM;i++)
-		{
-		overlap1[i] = 0;
-		overlap2[i] = 0;
-		}
-
-	/* check coverage masks for overlap */
-	first = MB_YES;
-	*lonmin = 0.0;
-	*lonmax = 0.0;
-	*latmin = 0.0;
-	*latmax = 0.0;
-	dx1 = (section1->lonmax - section1->lonmin) / MBNA_MASK_DIM;
-	dy1 = (section1->latmax - section1->latmin) / MBNA_MASK_DIM;
-	dx2 = (section2->lonmax - section2->lonmin) / MBNA_MASK_DIM;
-	dy2 = (section2->latmax - section2->latmin) / MBNA_MASK_DIM;
-	for (ii1=0;ii1<MBNA_MASK_DIM;ii1++)
-	    for (jj1=0;jj1<MBNA_MASK_DIM;jj1++)
-		{
-		kk1 = ii1 + jj1 * MBNA_MASK_DIM;
-		if (section1->coverage[kk1] == 1)
-		    {
-		    lon1min = section1->lonmin + dx1 * ii1;
-		    lon1max = section1->lonmin + dx1 * (ii1 + 1);
-		    lat1min = section1->latmin + dy1 * jj1;
-		    lat1max = section1->latmin + dy1 * (jj1 + 1);
-		    for (ii2=0;ii2<MBNA_MASK_DIM;ii2++)
-			for (jj2=0;jj2<MBNA_MASK_DIM;jj2++)
-			    {
-			    kk2 = ii2 + jj2 * MBNA_MASK_DIM;
-			    if (section2->coverage[kk2] == 1)
-				{
-				lon2min = section2->lonmin + dx2 * ii2 + offset_x;
-				lon2max = section2->lonmin + dx2 * (ii2 + 1) + offset_x;
-				lat2min = section2->latmin + dy2 * jj2 + offset_y;
-				lat2max = section2->latmin + dy2 * (jj2 + 1) + offset_y;
-				if ((lon1min < lon2max)
-				    && (lon1max > lon2min)
-				    && (lat1min < lat2max)
-				    && (lat1max > lat2min))
-				    {
-				    overlap1[kk1] = 1;
-				    overlap2[kk2] = 1;
-				    if (first == MB_NO)
-					{
-					*lonmin = MIN(*lonmin, MAX(lon1min, lon2min));
-					*lonmax = MAX(*lonmax, MIN(lon1max, lon2max));
-					*latmin = MIN(*latmin, MAX(lat1min, lat2min));
-					*latmax = MAX(*latmax, MIN(lat1max, lat2max));
-					}
-				    else
-					{
-					first = MB_NO;
-					*lonmin = MAX(lon1min, lon2min);
-					*lonmax = MIN(lon1max, lon2max);
-					*latmin = MAX(lat1min, lat2min);
-					*latmax = MIN(lat1max, lat2max);
-					}
-				    }
-				}
-			    }
-		    }
-		}
-
- 	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       lonmin:      %.10f\n",*lonmin);
-		fprintf(stderr,"dbg2       lonmax:      %.10f\n",*lonmax);
-		fprintf(stderr,"dbg2       latmin:      %.10f\n",*latmin);
-		fprintf(stderr,"dbg2       latmax:      %.10f\n",*latmax);
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbnavadjust_get_misfit()
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_get_misfit";
-	int	status = MB_SUCCESS;
-	double	dinterval;
-	double	zoff;
-	double	minmisfitthreshold, dotproduct;
-	double	x, y, z, r;
-	double	dotproductsave2;
-	double	rsave2;
-	double	dotproductsave3;
-	double	rsave3;
-	int	found;
-	int	igx, igy;
-	int	ic, jc, kc, lc;
-	int	ioff, joff, istart, iend, jstart, jend;
-	int	i1, i2, j1, j2, k1, k2;
-	int	imin, jmin, kmin;
-	int	i, j, k, l, ll;
-
- 	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
-
-    	if (project.open == MB_YES
-    		&& project.num_crossings > 0
-    		&& mbna_current_crossing >= 0
-		&& mbna_naverr_load == MB_YES)
-    		{
-/* fprintf(stderr,"\nDEBUG %s %d: mbnavadjust_get_misfit: mbna_plot minmax: %f %f %f %f\n",
-__FILE__,__LINE__,
-mbna_plot_lon_min,mbna_plot_lon_max,mbna_plot_lat_min,mbna_plot_lat_max); */
-
-    		/* set message on */
-    		if (mbna_verbose > 1)
-			fprintf(stderr,"Making misfit grid for crossing %d\n",mbna_current_crossing);
-		sprintf(message,"Making misfit grid for crossing %d\n",mbna_current_crossing);
-		do_message_update(message);
-
-		/* reset sounding density threshold for misfit calculation
-			- will be tuned down if necessary */
-		mbna_minmisfit_nthreshold = MBNA_MISFIT_NTHRESHOLD;
-
-		/* figure out lateral extent of grids */
-		grid_nx = MBNA_MISFIT_DIMXY;
-		grid_ny = MBNA_MISFIT_DIMXY;
-		if ((mbna_plot_lon_max - mbna_plot_lon_min) / mbna_mtodeglon
-		    > (mbna_plot_lat_max - mbna_plot_lat_min) / mbna_mtodeglat)
-		    {
-		    grid_dx = (mbna_plot_lon_max - mbna_plot_lon_min) / (grid_nx - 1);
-		    grid_dy = grid_dx * mbna_mtodeglat / mbna_mtodeglon;
-/* fprintf(stderr,"DEBUG %s %d: grid scale: grid_dx:%f grid_dy:%f\n",
-__FILE__,__LINE__,
-grid_dx,grid_dy); */
-		    }
-		else
-		    {
-		    grid_dy = (mbna_plot_lat_max - mbna_plot_lat_min) / (grid_ny - 1);
-		    grid_dx = grid_dy * mbna_mtodeglon / mbna_mtodeglat;
-/* fprintf(stderr,"DEBUG %s %d: grid scale: grid_dx:%f grid_dy:%f\n",
-__FILE__,__LINE__,
-grid_dx,grid_dy); */
-		    }
-		grid_nxy = grid_nx * grid_ny;
-		grid_olon = 0.5 * (mbna_plot_lon_min + mbna_plot_lon_max)
-				    - (grid_nx / 2 + 0.5) * grid_dx;
-		grid_olat = 0.5 * (mbna_plot_lat_min + mbna_plot_lat_max)
-				    - (grid_ny / 2 + 0.5) * grid_dy;
-/* fprintf(stderr,"DEBUG %s %d: grid_olon:%.10f grid_olat:%.10f\n",
-__FILE__,__LINE__,
-grid_olon,grid_olat); */
-
-		/* get 3d misfit grid */
-		nzmisfitcalc = MBNA_MISFIT_DIMZ;
-		gridm_nx = grid_nx / 2 + 1;
-		gridm_ny = gridm_nx;
-		gridm_nxyz = gridm_nx * gridm_ny * nzmisfitcalc;
-		if (mbna_misfit_center == MBNA_MISFIT_ZEROCENTER)
-		    {
-		    mbna_misfit_offset_x = 0.0;
-		    mbna_misfit_offset_y = 0.0;
-		    mbna_misfit_offset_z = 0.0;
-		    }
-		else
-		    {
-		    mbna_misfit_offset_x = mbna_offset_x;
-		    mbna_misfit_offset_y = mbna_offset_y;
-		    mbna_misfit_offset_z = mbna_offset_z;
-		    }
-/* fprintf(stderr,"DEBUG %s %d: GRID parameters: dx:%.10f dy:%.10f nx:%d ny:%d  bounds:  grid: %.10f %.10f %.10f %.10f  plot: %.10f %.10f %.10f %.10f\n",
-__FILE__,__LINE__,
-grid_dx, grid_dy, grid_nx, grid_ny,
-grid_olon, grid_olon + grid_nx * grid_dx,
-grid_olat, grid_olat + grid_ny * grid_dy,
-mbna_lon_min, mbna_lon_max, mbna_lat_min, mbna_lat_max); */
-
-		/* figure out range of z offsets */
-		zmin = mbna_misfit_offset_z - 0.5 * project.zoffsetwidth;
-		zmax = mbna_misfit_offset_z + 0.5 * project.zoffsetwidth;
-		zoff_dz = project.zoffsetwidth / (nzmisfitcalc - 1);
-/* fprintf(stderr,"DEBUG %s %d: mbna_misfit_offset_z:%f project.zoffsetwidth:%f nzmisfitcalc:%d zmin:%f zmax:%f zoff_dz:%f\n",
-__FILE__,__LINE__,
-mbna_misfit_offset_z,project.zoffsetwidth,nzmisfitcalc,zmin,zmax,zoff_dz); */
-
-		/* allocate and initialize grids and arrays */
-		grid1 = (double *) realloc(grid1, sizeof(double) * (grid_nxy));
-		grid2 = (double *) realloc(grid2, sizeof(double) * (grid_nxy));
-		gridm = (double *) realloc(gridm, sizeof(double) * (gridm_nxyz));
-		gridmeq = (double *) realloc(gridmeq, sizeof(double) * (gridm_nxyz));
-		gridn1 = (int *) realloc(gridn1, sizeof(int) * (grid_nxy));
-		gridn2 = (int *) realloc(gridn2, sizeof(int) * (grid_nxy));
-		gridnm = (int *) realloc(gridnm, sizeof(int) * (gridm_nxyz));
-		memset(grid1, 0, sizeof(double) * (grid_nxy));
-		memset(grid2, 0, sizeof(double) * (grid_nxy));
-		memset(gridm, 0, sizeof(double) * (gridm_nxyz));
-		memset(gridmeq, 0, sizeof(double) * (gridm_nxyz));
-		memset(gridn1, 0, sizeof(int) * (grid_nxy));
-		memset(gridn2, 0, sizeof(int) * (grid_nxy));
-		memset(gridnm, 0, sizeof(int) * (gridm_nxyz));
-
-	    	/* loop over all beams */
-	    	for (i=0;i<swath1->npings;i++)
-	    		{
-	    		for (j=0;j<swath1->pings[i].beams_bath;j++)
-	    			{
-	    			if (mb_beam_ok(swath1->pings[i].beamflag[j]))
-	    				{
-	    				x = (swath1->pings[i].bathlon[j] - grid_olon);
-	    				y = (swath1->pings[i].bathlat[j] - grid_olat);
-					igx = (int) (x / grid_dx);
-					igy = (int) (y / grid_dy);
-					k = igx + igy * grid_nx;
-					if (igx >= 0 && igx < grid_nx
-					    && igy >= 0 && igy < grid_ny)
-					    {
-					    grid1[k] += swath1->pings[i].bath[j];
-					    gridn1[k] ++;
-					    }
-/* else
-fprintf(stderr,"DEBUG %s %d: BAD swath1: %d %d  %.10f %.10f  %f %f  %d %d\n",
-__FILE__,__LINE__,
-i, j, swath1->pings[i].bathlon[j], swath1->pings[i].bathlat[j], x, y, igx, igy); */
-	    				}
-	    			}
-	    		}
-
-	    	/* loop over all beams */
-	    	for (i=0;i<swath2->npings;i++)
-	    		{
-	    		for (j=0;j<swath2->pings[i].beams_bath;j++)
-	    			{
-	    			if (mb_beam_ok(swath2->pings[i].beamflag[j]))
-	    				{
-	    				x = (swath2->pings[i].bathlon[j] + mbna_misfit_offset_x - grid_olon);
-	    				y = (swath2->pings[i].bathlat[j] + mbna_misfit_offset_y - grid_olat);
-					igx = (int) (x / grid_dx);
-					igy = (int) (y / grid_dy);
-					k = igx + igy * grid_nx;
-					if (igx >= 0 && igx < grid_nx
-					    && igy >= 0 && igy < grid_ny)
-					    {
-					    grid2[k] += swath2->pings[i].bath[j];
-					    gridn2[k] ++;
-					    }
-/* else
-fprintf(stderr,"DEBUG %s %d: BAD swath2: %d %d  %.10f %.10f  %f %f  %d %d\n",
-__FILE__,__LINE__,
-i, j, swath2->pings[i].bathlon[j], swath2->pings[i].bathlat[j], x, y, igx, igy); */
-	    				}
-	    			}
-	    		}
-
-		/* calculate gridded bath */
-		for (k=0;k<grid_nxy;k++)
-		    {
-		    if (gridn1[k] > 0)
-			{
-			grid1[k] = (grid1[k] / gridn1[k]);
-			}
-		    if (gridn2[k] > 0)
-			{
-			grid2[k] = (grid2[k] / gridn2[k]);
-			}
-/* fprintf(stderr,"GRIDDED BATH: k:%d 1:%d %f   2:%d %f\n",
-k,gridn1[k],grid1[k],gridn2[k],grid2[k]); */
-		    }
-
-		/* calculate gridded misfit over lateral and z offsets */
-		for (ic=0;ic<gridm_nx;ic++)
-		    for (jc=0;jc<gridm_ny;jc++)
-			for (kc=0;kc<nzmisfitcalc;kc++)
-			    {
-			    lc = kc + nzmisfitcalc * (ic + jc * gridm_nx);
-			    gridm[lc] = 0.0;
-			    gridnm[lc] = 0;
-
-			    ioff = (gridm_nx / 2) - ic;
-			    joff = (gridm_ny / 2) - jc;
-			    zoff = zmin + zoff_dz * kc;
-
-			    istart = MAX(-ioff, 0);
-			    iend = grid_nx - MAX(0, ioff);
-			    jstart = MAX(-joff, 0);
-			    jend = grid_ny - MAX(0, joff);
-			    for (i1=istart;i1<iend;i1++)
-				for (j1=jstart;j1<jend;j1++)
-				    {
-				    i2 = i1 + ioff;
-				    j2 = j1 + joff;
-				    k1 = i1 + j1 * grid_nx;
-				    k2 = i2 + j2 * grid_nx;
-				    if (gridn1[k1] > 0 && gridn2[k2] > 0)
-					{
-					gridm[lc] += (grid2[k2] - grid1[k1] + zoff - mbna_offset_z)
-							* (grid2[k2] - grid1[k1] + zoff - mbna_offset_z);
-					gridnm[lc]++;
-					}
-				    }
-			    }
-		misfit_min = 0.0;
-		misfit_max = 0.0;
-		mbna_minmisfit = 0.0;
-		mbna_minmisfit_n = 0;
-		mbna_minmisfit_x = 0.0;
-		mbna_minmisfit_y = 0.0;
-		mbna_minmisfit_z = 0.0;
-		found = MB_NO;
-		for (ic=0;ic<gridm_nx;ic++)
-		    for (jc=0;jc<gridm_ny;jc++)
-			for (kc=0;kc<nzmisfitcalc;kc++)
-			    {
-			    lc = kc + nzmisfitcalc * (ic + jc * gridm_nx);
-			    if (gridnm[lc] > 0)
-				{
- 				gridm[lc] = sqrt(gridm[lc]) / gridnm[lc];
-				if (misfit_max == 0.0)
-			    	    {
-				    misfit_min = gridm[lc];
-				    }
-				misfit_min = MIN(misfit_min, gridm[lc]);
-				misfit_max = MAX(misfit_max, gridm[lc]);
-				if (gridnm[lc] > mbna_minmisfit_nthreshold
-				    && (mbna_minmisfit_n == 0 || gridm[lc] < mbna_minmisfit))
-				    {
-				    mbna_minmisfit = gridm[lc];
-				    mbna_minmisfit_n = gridnm[lc];
-				    mbna_minmisfit_x = (ic - gridm_nx / 2) * grid_dx + mbna_misfit_offset_x;
-				    mbna_minmisfit_y = (jc - gridm_ny / 2) * grid_dy + mbna_misfit_offset_y;
-				    mbna_minmisfit_z = zmin + zoff_dz * kc;
-				    imin = ic;
-				    jmin = jc,
-				    kmin = kc;
-				    found = MB_YES;
-/* zoff = zmin + zoff_dz * kc;
-fprintf(stderr,"DEBUG %s %d: ic:%d jc:%d kc:%d misfit:%f %f %d  pos:%f %f %f zoff:%f mbna_ofset_z:%f\n",
-__FILE__,__LINE__,
-ic,jc,kc,misfit_min,mbna_minmisfit,mbna_minmisfit_n,mbna_minmisfit_x,mbna_minmisfit_y,mbna_minmisfit_z,
-zoff,mbna_offset_z); */
- 			    	    }
-				}
-/* if (ic == jc && kc == 0)
-fprintf(stderr,"DEBUG %s %d: ic:%d jc:%d misfit:%d %f\n",
-__FILE__,__LINE__,
-ic,jc,gridnm[lc],gridm[lc]);*/
-			    }
-		if (found == MB_NO)
-		    {
-		    mbna_minmisfit_nthreshold /= 10.0;
-		    for (ic=0;ic<gridm_nx;ic++)
-			for (jc=0;jc<gridm_ny;jc++)
-			    for (kc=0;kc<nzmisfitcalc;kc++)
-				{
-				lc = kc + nzmisfitcalc * (ic + jc * gridm_nx);
-				if (gridnm[lc] > mbna_minmisfit_nthreshold/10 && (mbna_minmisfit_n == 0 || gridm[lc] < mbna_minmisfit))
-				    {
-				    mbna_minmisfit = gridm[lc];
-				    mbna_minmisfit_n = gridnm[lc];
-				    mbna_minmisfit_x = (ic - gridm_nx / 2) * grid_dx + mbna_misfit_offset_x;
-				    mbna_minmisfit_y = (jc - gridm_ny / 2) * grid_dy + mbna_misfit_offset_y;
-				    mbna_minmisfit_z = zmin + zoff_dz * kc;
-				    imin = ic;
-				    jmin = jc,
-				    kmin = kc;
-				    found = MB_YES;
-				    }
-/* fprintf(stderr,"DEBUG %s %d: ijk:%d %d %d gridm:%d %f  misfit:%f %f %d  pos:%f %f %f\n",
-__FILE__,__LINE__,
-ic,jc,kc,gridnm[lc],gridm[lc],misfit_min,mbna_minmisfit,mbna_minmisfit_n,mbna_minmisfit_x,mbna_minmisfit_y,mbna_minmisfit_z); */
-				}
-		    }
-		misfit_min = 0.99 * misfit_min;
-		misfit_max = 1.01 * misfit_max;
-/* if (found == MB_YES)
-{
-lc = kmin + nzmisfitcalc * (imin + jmin * gridm_nx);
-fprintf(stderr,"DEBUG %s %d: min misfit: i:%d j:%d k:%d    n:%d m:%f   offsets: %f %f %f\n",
-__FILE__,__LINE__,
-imin, jmin, kmin, gridnm[lc], gridm[lc],
-mbna_minmisfit_x / mbna_mtodeglon,
-mbna_minmisfit_y / mbna_mtodeglat,
-mbna_minmisfit_z);
-} */
-
-/* fprintf(stderr,"DEBUG %s %d: Misfit bounds: nmin:%d best:%f min:%f max:%f min loc: %f %f %f\n",
-__FILE__,__LINE__,
-mbna_minmisfit_n,mbna_minmisfit,misfit_min,misfit_max,
-mbna_minmisfit_x/mbna_mtodeglon,mbna_minmisfit_y/mbna_mtodeglat,mbna_minmisfit_z); */
-
-    		/* set message on */
-    		if (mbna_verbose > 1)
-			fprintf(stderr,"Histogram equalizing misfit grid for crossing %d\n",mbna_current_crossing);
-		sprintf(message,"Histogram equalizing misfit grid for crossing %d\n",mbna_current_crossing);
-		do_message_update(message);
-
-		/* sort the misfit to get histogram equalization */
-		grid_nxyzeq = 0;
-		for (l=0;l<gridm_nxyz;l++)
-		    {
-		    if (gridm[l] > 0.0)
-			{
-			gridmeq[grid_nxyzeq] = gridm[l];
-			grid_nxyzeq++;
-			}
-		    }
-
-		if (grid_nxyzeq > 0)
-		    {
-			qsort((char *)gridmeq,grid_nxyzeq,sizeof(double),mb_double_compare);
-			dinterval = ((double) grid_nxyzeq) / ((double)(nmisfit_intervals-1));
-			if (dinterval < 1.0)
-			    {
-			    for (l=0;l<grid_nxyzeq;l++)
-				    misfit_intervals[l] = gridmeq[l];
-			    for (l=grid_nxyzeq;l<nmisfit_intervals;l++)
-				    misfit_intervals[l] = gridmeq[grid_nxyzeq-1];
-			    }
-			else
-			    {
-			    misfit_intervals[0] = misfit_min;
-			    misfit_intervals[nmisfit_intervals-1] = misfit_max;
-			    for (l=1;l<nmisfit_intervals-1;l++)
-				    {
-				    ll = (int)(l * dinterval);
-				    misfit_intervals[l] = gridmeq[ll];
-				    }
-		    }
-
-		    /* get minimum misfit in 2D plane at current z offset */
-		    mbnavadjust_get_misfitxy();
-
-   		    /* set message on */
-    		    if (mbna_verbose > 1)
-			fprintf(stderr,"Estimating 3D uncertainty for crossing %d\n",mbna_current_crossing);
-		    sprintf(message,"Estimating 3D uncertainty for crossing %d\n",mbna_current_crossing);
-		    do_message_update(message);
-
-		    /* estimating 3 component uncertainty vector at minimum misfit point */
-		    /* first get the longest vector to a misfit value <= 2 times minimum misfit */
-		    minmisfitthreshold = mbna_minmisfit * 3.0;
-		    mbna_minmisfit_sr1 = 0.0;
-		    for (ic=0;ic<gridm_nx;ic++)
-			for (jc=0;jc<gridm_ny;jc++)
-			    for (kc=0;kc<nzmisfitcalc;kc++)
-				{
-				lc = kc + nzmisfitcalc * (ic + jc * gridm_nx);
-				if (gridnm[lc] > mbna_minmisfit_nthreshold && gridm[lc] <= minmisfitthreshold)
-				    {
- 				    x = ((ic - gridm_nx / 2) * grid_dx + mbna_misfit_offset_x - mbna_minmisfit_x) / mbna_mtodeglon;
-				    y = ((jc - gridm_ny / 2) * grid_dy + mbna_misfit_offset_y - mbna_minmisfit_y) / mbna_mtodeglat;
-				    z = zmin + zoff_dz * kc - mbna_minmisfit_z;
-				    r = sqrt(x * x + y * y + z * z);
-/* fprintf(stderr,"DEBUG %s %d: %d %d %d gridm[%d]:%f minmisfitthreshold:%f x: %f %f %f  r:%f\n",
-__FILE__,__LINE__,
-ic,jc,kc,lc,gridm[lc],minmisfitthreshold,x,y,z,r); */
-				    if (r > mbna_minmisfit_sr1)
-					{
-					mbna_minmisfit_sx1[0] = x;
-					mbna_minmisfit_sx1[1] = y;
-					mbna_minmisfit_sx1[2] = z;
-					mbna_minmisfit_sr1 = r;
-					}
-				    }
-				}
-		    mbna_minmisfit_sx1[0] /= mbna_minmisfit_sr1;
-		    mbna_minmisfit_sx1[1] /= mbna_minmisfit_sr1;
-		    mbna_minmisfit_sx1[2] /= mbna_minmisfit_sr1;
-/* fprintf(stderr,"DEBUG %s %d: Longest vector in misfit space. %f %f %f  r:%f\n",
-__FILE__,__LINE__,
-mbna_minmisfit_sx1[0],mbna_minmisfit_sx1[1],mbna_minmisfit_sx1[2],mbna_minmisfit_sr1); */
-
-		    /* now get a horizontal unit vector perpendicular to the the longest vector
-			    and then find the largest r associated with that vector */
-		    mbna_minmisfit_sr2 = sqrt(mbna_minmisfit_sx1[0] * mbna_minmisfit_sx1[0] + mbna_minmisfit_sx1[1] * mbna_minmisfit_sx1[1]);
-		    if (mbna_minmisfit_sr2 < MBNA_SMALL)
-			    {
-			    mbna_minmisfit_sx2[0] = 0.0;
-			    mbna_minmisfit_sx2[1] = 1.0;
-			    mbna_minmisfit_sx2[2] = 0.0;
-			    mbna_minmisfit_sr2 = 1.0;
-			    }
-		    else
-			    {
-			    mbna_minmisfit_sx2[0] = mbna_minmisfit_sx1[1] / mbna_minmisfit_sr2;
-			    mbna_minmisfit_sx2[1] = -mbna_minmisfit_sx1[0] / mbna_minmisfit_sr2;
-			    mbna_minmisfit_sx2[2] = 0.0;
-			    mbna_minmisfit_sr2 = sqrt(mbna_minmisfit_sx2[0] * mbna_minmisfit_sx2[0] + mbna_minmisfit_sx2[1] * mbna_minmisfit_sx2[1] + mbna_minmisfit_sx2[2] * mbna_minmisfit_sx2[2]);
-			    }
-/* dotproduct = (mbna_minmisfit_sx1[0] * mbna_minmisfit_sx2[0] + mbna_minmisfit_sx1[1] * mbna_minmisfit_sx2[1] + mbna_minmisfit_sx1[2] * mbna_minmisfit_sx2[2]);
-fprintf(stderr,"DEBUG %s %d: Horizontal perpendicular vector in misfit space. %f %f %f  r:%f dotproduct:%f\n",
-__FILE__,__LINE__,
-mbna_minmisfit_sx2[0],mbna_minmisfit_sx2[1],mbna_minmisfit_sx2[2],mbna_minmisfit_sr2,dotproduct); */
-
-		    /* now get a near-vertical unit vector perpendicular to the the longest vector
-			    and then find the largest r associated with that vector */
-		    mbna_minmisfit_sr3 = sqrt(mbna_minmisfit_sx1[0] * mbna_minmisfit_sx1[0] + mbna_minmisfit_sx1[1] * mbna_minmisfit_sx1[1]);
-		    if (mbna_minmisfit_sr3 < MBNA_SMALL)
-			{
-			mbna_minmisfit_sx3[0] = 0.0;
-			mbna_minmisfit_sx3[1] = 0.0;
-			mbna_minmisfit_sx3[2] = 1.0;
-			mbna_minmisfit_sr3 = 1.0;
-			}
-		    else
-			{
-			if (mbna_minmisfit_sx1[2] >= 0.0)
-			    {
-			    mbna_minmisfit_sx3[0] = -mbna_minmisfit_sx1[0] * sqrt(1.0 - mbna_minmisfit_sr3 * mbna_minmisfit_sr3) / mbna_minmisfit_sr3;
-			    mbna_minmisfit_sx3[1] = -mbna_minmisfit_sx1[1] * sqrt(1.0 - mbna_minmisfit_sr3 * mbna_minmisfit_sr3) / mbna_minmisfit_sr3;
-			    }
-			else
-			    {
-			    mbna_minmisfit_sx3[0] = mbna_minmisfit_sx1[0] * sqrt(1.0 - mbna_minmisfit_sr3 * mbna_minmisfit_sr3) / mbna_minmisfit_sr3;
-			    mbna_minmisfit_sx3[1] = mbna_minmisfit_sx1[1] * sqrt(1.0 - mbna_minmisfit_sr3 * mbna_minmisfit_sr3) / mbna_minmisfit_sr3;
-			    }
-			mbna_minmisfit_sx3[2] = mbna_minmisfit_sr3;
-			mbna_minmisfit_sr3 = sqrt(mbna_minmisfit_sx3[0] * mbna_minmisfit_sx3[0] + mbna_minmisfit_sx3[1] * mbna_minmisfit_sx3[1] + mbna_minmisfit_sx3[2] * mbna_minmisfit_sx3[2]);
-			}
-/* dotproduct = (mbna_minmisfit_sx1[0] * mbna_minmisfit_sx3[0] + mbna_minmisfit_sx1[1] * mbna_minmisfit_sx3[1] + mbna_minmisfit_sx1[2] * mbna_minmisfit_sx3[2]);
-fprintf(stderr,"DEBUG %s %d: Perpendicular near-vertical vector in misfit space. %f %f %f  r:%f dotproduct:%f\n",
-__FILE__,__LINE__,
-mbna_minmisfit_sx3[0],mbna_minmisfit_sx3[1],mbna_minmisfit_sx3[2],mbna_minmisfit_sr2,dotproduct); */
-
-		    /* now get the longest r values to a misfit value <= 2 times minimum misfit
-			    for both secondary vectors */
-		    mbna_minmisfit_sr2 = 0.0;
-		    mbna_minmisfit_sr3 = 0.0;
-		    dotproductsave2 = 0.0;
-		    rsave2 = 0.0;
-		    dotproductsave3 = 0.0;
-		    rsave3 = 0.0;
-		    for (ic=0;ic<gridm_nx;ic++)
-			for (jc=0;jc<gridm_ny;jc++)
-			    for (kc=0;kc<nzmisfitcalc;kc++)
-				{
-				lc = kc + nzmisfitcalc * (ic + jc * gridm_nx);
-				if (gridnm[lc] > mbna_minmisfit_nthreshold && gridm[lc] <= minmisfitthreshold)
-				    {
- 				    x = ((ic - gridm_nx / 2) * grid_dx + mbna_misfit_offset_x - mbna_minmisfit_x) / mbna_mtodeglon;
-				    y = ((jc - gridm_ny / 2) * grid_dy + mbna_misfit_offset_y - mbna_minmisfit_y) / mbna_mtodeglat;
-				    z = zmin + zoff_dz * kc - mbna_minmisfit_z;
-				    r = sqrt(x * x + y * y + z * z);
-				    if (r > mbna_minmisfit_sr2)
-					{
-					dotproduct = (x * mbna_minmisfit_sx2[0] + y * mbna_minmisfit_sx2[1] + z * mbna_minmisfit_sx2[2]) / r ;
-					if (fabs(dotproduct) > 0.8)
-					    {
-/* fprintf(stderr,"DEBUG %s %d: Vector2: %d %d %d gridm[%d]:%f minmisfitthreshold:%f dotproduct:%f x: %f %f %f  r:%f\n",
-__FILE__,__LINE__,
-ic,jc,kc,lc,gridm[lc],minmisfitthreshold,dotproduct,x,y,z,r); */
-					    mbna_minmisfit_sr2 = r;
-					    }
-					if (fabs(dotproduct) > dotproductsave2)
-					    {
-					    dotproductsave2 = fabs(dotproduct);
-					    rsave2 = r;
-					    }
-					}
-				    if (r > mbna_minmisfit_sr3)
-					{
-					dotproduct = (x * mbna_minmisfit_sx3[0] + y * mbna_minmisfit_sx3[1] + z * mbna_minmisfit_sx3[2]) / r ;
-					if (fabs(dotproduct) > 0.8)
-					    {
-/* fprintf(stderr,"DEBUG %s %d: Vector3: %d %d %d gridm[%d]:%f minmisfitthreshold:%f dotproduct:%f x: %f %f %f  r:%f\n",
-__FILE__,__LINE__,
-ic,jc,kc,lc,gridm[lc],minmisfitthreshold,dotproduct,x,y,z,r); */
-					    mbna_minmisfit_sr3 = r;
-					    }
-					if (fabs(dotproduct) > dotproductsave3)
-					    {
-					    dotproductsave3 = fabs(dotproduct);
-					    rsave3 = r;
-					    }
-					}
-				    }
-				}
-		    if (mbna_minmisfit_sr2 < MBNA_SMALL)
-		    	mbna_minmisfit_sr2 = rsave2;
-		    if (mbna_minmisfit_sr3 < MBNA_SMALL)
-		    	mbna_minmisfit_sr3 = rsave3;
-		    }
-		else
-		    {
-		    mbna_minmisfit_sx1[0] = 1.0;
-		    mbna_minmisfit_sx1[1] = 0.0;
-		    mbna_minmisfit_sx1[2] = 0.0;
-		    mbna_minmisfit_sr1 = 100.0;
-		    mbna_minmisfit_sx2[0] = 0.0;
-		    mbna_minmisfit_sx2[1] = 1.0;
-		    mbna_minmisfit_sx2[2] = 0.0;
-		    mbna_minmisfit_sr2 = 100.0;
-		    mbna_minmisfit_sx3[0] = 0.0;
-		    mbna_minmisfit_sx3[1] = 0.0;
-		    mbna_minmisfit_sx3[2] = 1.0;
-		    mbna_minmisfit_sr3 = 100.0;
-		    }
-/* fprintf(stderr,"DEBUG %s %d: \nVector1: %f %f %f  mbna_minmisfit_sr1:%f\n",
-__FILE__,__LINE__,
-mbna_minmisfit_sx1[0],mbna_minmisfit_sx1[1],mbna_minmisfit_sx1[2],mbna_minmisfit_sr1);
-fprintf(stderr,"Vector2: %f %f %f  mbna_minmisfit_sr2:%f\n",
-mbna_minmisfit_sx2[0],mbna_minmisfit_sx2[1],mbna_minmisfit_sx2[2],mbna_minmisfit_sr2);
-fprintf(stderr,"Vector3: %f %f %f  mbna_minmisfit_sr3:%f\n",
-mbna_minmisfit_sx3[0],mbna_minmisfit_sx3[1],mbna_minmisfit_sx3[2],mbna_minmisfit_sr3);
-dotproduct = (mbna_minmisfit_sx1[0] * mbna_minmisfit_sx2[0]
-		+ mbna_minmisfit_sx1[1] * mbna_minmisfit_sx2[1]
-		+ mbna_minmisfit_sx1[2] * mbna_minmisfit_sx2[2]);
-fprintf(stderr,"Dot products: 1v2:%f ",dotproduct);
-dotproduct = (mbna_minmisfit_sx2[0] * mbna_minmisfit_sx3[0]
-		+ mbna_minmisfit_sx2[1] * mbna_minmisfit_sx3[1]
-		+ mbna_minmisfit_sx2[2] * mbna_minmisfit_sx3[2]);
-fprintf(stderr,"2v3:%f ",dotproduct);
-dotproduct = (mbna_minmisfit_sx1[0] * mbna_minmisfit_sx3[0]
-		+ mbna_minmisfit_sx1[1] * mbna_minmisfit_sx3[1]
-		+ mbna_minmisfit_sx1[2] * mbna_minmisfit_sx3[2]);
-fprintf(stderr,"3v2:%f\n",dotproduct); */
-		}
-
- 	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbnavadjust_get_misfitxy()
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_get_misfitxy";
-	int	status = MB_SUCCESS;
-	int	ic, jc, kc, lc;
-
- 	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
-
-    	if (project.open == MB_YES
-    		&& project.num_crossings > 0
-    		&& mbna_current_crossing >= 0
-		&& mbna_naverr_load == MB_YES)
-    		{
-		/* get minimum misfit in plane at current z offset */
-		if (grid_nxyzeq > 0)
-		    {
-		    /* get closest to current zoffset in existing 3d grid */
-		    misfit_max = 0.0;
-		    misfit_min = 0.0;
-		    kc = (int)((mbna_offset_z - zmin) / zoff_dz);
-		    for (ic=0;ic<gridm_nx;ic++)
-			for (jc=0;jc<gridm_ny;jc++)
-			    {
-			    lc = kc + nzmisfitcalc * (ic + jc * gridm_nx);
-			    if (gridnm[lc] > mbna_minmisfit_nthreshold)
-				{
-				if (misfit_max == 0.0)
-			    	    {
-				    misfit_min = gridm[lc];
-				    misfit_max = gridm[lc];
-				    }
-				else if (gridm[lc] < misfit_min)
-				    {
-				    misfit_min = gridm[lc];
-				    mbna_minmisfit_xh = (ic - gridm_nx / 2) * grid_dx + mbna_misfit_offset_x;
-				    mbna_minmisfit_yh = (jc - gridm_ny / 2) * grid_dy + mbna_misfit_offset_y;
-				    mbna_minmisfit_zh = zmin + zoff_dz * kc;
-				    }
-				else if (gridm[lc] > misfit_max)
-				    {
-				    misfit_max = gridm[lc];
-				    }
-				}
-			    }
-/* fprintf(stderr,"mbnavadjust_get_misfitxy a mbna_minmisfit_xh:%f mbna_minmisfit_yh:%f mbna_minmisfit_zh:%f\n",
-mbna_minmisfit_xh,mbna_minmisfit_yh,mbna_minmisfit_zh); */
-		    }
-/* fprintf(stderr,"mbnavadjust_get_misfitxy b mbna_minmisfit_xh:%f mbna_minmisfit_yh:%f mbna_minmisfit_zh:%f\n",
-mbna_minmisfit_xh,mbna_minmisfit_yh,mbna_minmisfit_zh); */
-		}
-/* fprintf(stderr,"mbnavadjust_get_misfitxy c mbna_minmisfit_xh:%f mbna_minmisfit_yh:%f mbna_minmisfit_zh:%f\n",
-mbna_minmisfit_xh,mbna_minmisfit_yh,mbna_minmisfit_zh); */
-
- 	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-void mbnavadjust_plot(double xx,double yy,int ipen)
-{
-	struct mbna_plot_vector *v;
-	double	x, y;
-
-	if (mbna_contour->nvector >= mbna_contour->nvector_alloc)
-	    {
-	    mbna_contour->nvector_alloc += MBNA_VECTOR_ALLOC_INC;
-	    mbna_contour->vector = (struct mbna_plot_vector *)
-	    		realloc(mbna_contour->vector,
-			sizeof(struct mbna_plot_vector)
-			    * (mbna_contour->nvector_alloc));
-	    if (mbna_contour->vector == NULL)
-		mbna_contour->nvector_alloc = 0;
-	    }
-
-	if (mbna_contour->nvector_alloc > mbna_contour->nvector)
-	    {
-	    /* add current origin */
-	    x = xx + mbna_ox;
-	    y = yy + mbna_oy;
-
-	    /* move pen */
-	    if (ipen == MBNA_PEN_UP)
-		    {
-		    /* save move in vector array */
-		    v = &mbna_contour->vector[mbna_contour->nvector];
-		    v->command = ipen;
-		    v->x = xx;
-		    v->y = yy;
-		    mbna_contour->nvector++;
-		    }
-
-	    /* plot */
-	    else if (ipen == MBNA_PEN_DOWN)
-		    {
-		    /* save move in vector array */
-		    v = &mbna_contour->vector[mbna_contour->nvector];
-		    v->command = ipen;
-		    v->x = xx;
-		    v->y = yy;
-		    mbna_contour->nvector++;
-		    }
-
-	    /* change origin */
-	    else if (ipen == MBNA_PEN_ORIGIN)
-		    {
-		    mbna_ox = x;
-		    mbna_oy = y;
-		    }
-
-	    }
-	/*fprintf(stderr,"plot: %f %f %d\n",x,y,ipen);*/
-	return;
-}
-/*--------------------------------------------------------------------*/
-void mbnavadjust_newpen(int icolor)
-{
-	struct mbna_plot_vector *v;
-
-	if (mbna_contour->nvector >= mbna_contour->nvector_alloc)
-	    {
-	    mbna_contour->nvector_alloc += MBNA_VECTOR_ALLOC_INC;
-	    mbna_contour->vector = (struct mbna_plot_vector *) realloc(mbna_contour->vector,
-			sizeof(struct mbna_plot_vector)
-			    * (mbna_contour->nvector_alloc + MBNA_VECTOR_ALLOC_INC));
-	    if (mbna_contour->vector == NULL)
-		mbna_contour->nvector_alloc = 0;
-	    }
-
-	if (mbna_contour->nvector_alloc > mbna_contour->nvector)
-	    {
-	    /* save pen change in vector array */
-	    v = &mbna_contour->vector[mbna_contour->nvector];
- 	    v->command = MBNA_PEN_COLOR;
-	    v->color = pixel_values[icolor * 8 + 7];
-	    mbna_contour->nvector++;
-	    }
-
-	/*fprintf(stderr,"newpen: %d\n",icolor);*/
-	return;
-}
-/*--------------------------------------------------------------------*/
-void mbnavadjust_setline(int linewidth)
-{
-	return;
-}
-/*--------------------------------------------------------------------*/
-void mbnavadjust_justify_string(double height,char *string, double *s)
-{
-	int	len;
-
-	len = strlen(string);
-	s[0] = 0.0;
-	s[1] = 0.185*height*len;
-	s[2] = 0.37*len*height;
-	s[3] = 0.37*len*height;
-
-	return;
-}
-/*--------------------------------------------------------------------*/
-void mbnavadjust_plot_string(double x, double y, double hgt, double angle, char *label)
-{
-
-	return;
-}
-/*--------------------------------------------------------------------*/
-
-void
-mbnavadjust_naverr_scale()
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_naverr_scale";
-	int	status = MB_SUCCESS;
-	double	xscale, yscale;
-
- 	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
-
-	if (mbna_naverr_load == MB_YES)
-	    {
-	    /* set scaling for contour window */
-	    xscale = (cont_borders[1] - cont_borders[0])
-		    / ((mbna_plot_lon_max - mbna_plot_lon_min) / mbna_mtodeglon);
-	    yscale = (cont_borders[3] - cont_borders[2])
-		    / ((mbna_plot_lat_max - mbna_plot_lat_min) / mbna_mtodeglat);
-	    if (xscale < yscale)
-		{
-		mbna_plotx_scale = xscale / mbna_mtodeglon;
-		mbna_ploty_scale = xscale / mbna_mtodeglat;
-		mbna_plot_lat_min =  0.5 * (mbna_plot_lat_min + mbna_plot_lat_max)
-					- 0.5 * (cont_borders[3] - cont_borders[2]) / mbna_ploty_scale;
-		mbna_plot_lat_max =  mbna_plot_lat_min
-					+ (cont_borders[3] - cont_borders[2]) / mbna_ploty_scale;
-		}
-	    else
-		{
-		mbna_plotx_scale = yscale / mbna_mtodeglon;
-		mbna_ploty_scale = yscale / mbna_mtodeglat;
-		mbna_plot_lon_min =  0.5 * (mbna_plot_lon_min + mbna_plot_lon_max)
-					- 0.5 * (cont_borders[1] - cont_borders[0]) / mbna_plotx_scale;
-		mbna_plot_lon_max =  mbna_plot_lon_min
-					+ (cont_borders[1] - cont_borders[0]) / mbna_plotx_scale;
-		}
-
-	    /* set scaling for misfit window */
-	    mbna_misfit_xscale = (corr_borders[1] - corr_borders[0])
-		    / (grid_dx * (gridm_nx - 1));
-	    mbna_misfit_yscale = (corr_borders[3] - corr_borders[2])
-		    / (grid_dy * (gridm_ny - 1));
-	    }
-
- 	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-}
-/*--------------------------------------------------------------------*/
-
-void
-mbnavadjust_naverr_plot(int plotmode)
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_naverr_plot";
-	int	status = MB_SUCCESS;
-	struct mbna_plot_vector *v;
-	struct mbna_crossing *crossing;
-	struct mbna_file *file1, *file2;
-	struct mbna_section *section1, *section2;
-	struct mbna_tie *tie;
-	int 	ix, iy, ix1, ix2, iy1, iy2, idx, idy;
-	int	boxoff, boxwid;
-	static int 	ixo, iyo;
-	static int 	izx1, izy1, izx2, izy2;
-	static int 	pixel, ipixel;
-	int	snav_1, snav_2;
-	double	dmisfit;
-	int	fill, found;
-	int	i, j, k, kk, l;
-
- 	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
-
-	if (mbna_naverr_load == MB_YES)
-	    {
-	    /* get structures */
-	    crossing = (struct mbna_crossing *) &project.crossings[mbna_current_crossing];
-	    file1 = (struct mbna_file *) &project.files[crossing->file_id_1];
-	    file2 = (struct mbna_file *) &project.files[crossing->file_id_2];
-	    section1 = (struct mbna_section *) &file1->sections[crossing->section_1];
-	    section2 = (struct mbna_section *) &file2->sections[crossing->section_2];
-
-	    /* get naverr plot scaling */
-	    mbnavadjust_naverr_scale();
-
-	    /* clear screens for first plot */
-	    if (plotmode == MBNA_PLOT_MODE_FIRST)
-		{
-		xg_fillrectangle(pcont_xgid, 0, 0,
-			    cont_borders[1], cont_borders[3],
-			    pixel_values[mbna_color_background], XG_SOLIDLINE);
-		xg_fillrectangle(pcorr_xgid, 0, 0,
-			    corr_borders[1], corr_borders[3],
-			    pixel_values[mbna_color_background], XG_SOLIDLINE);
-		}
-	    xg_fillrectangle(pzoff_xgid, 0, 0,
-			    zoff_borders[1], zoff_borders[3],
-			    pixel_values[mbna_color_background], XG_SOLIDLINE);
-
-	    /* replot section 2 and tie points in background if moving that section */
-	    if (plotmode == MBNA_PLOT_MODE_MOVE)
-	    {
-	    for (i=0;i<mbna_contour2.nvector;i++)
-		{
-		v = &mbna_contour2.vector[i];
-
-		if (v->command == MBNA_PEN_UP)
-		    {
-		    ixo = (int)(mbna_plotx_scale * (v->x + mbna_offset_x_old - mbna_plot_lon_min));
-		    iyo = (int)(cont_borders[3] - mbna_ploty_scale * (v->y + mbna_offset_y_old - mbna_plot_lat_min));
-		    }
-		else if (v->command == MBNA_PEN_DOWN)
-		    {
-		    ix = (int)(mbna_plotx_scale * (v->x + mbna_offset_x_old - mbna_plot_lon_min));
-		    iy = (int)(cont_borders[3] - mbna_ploty_scale * (v->y + mbna_offset_y_old - mbna_plot_lat_min));
-		    xg_drawline(pcont_xgid, ixo, iyo, ix, iy, pixel_values[mbna_color_background], XG_SOLIDLINE);
-		    ixo = ix;
-		    iyo = iy;
-		    }
-		}
-	    ixo = (int)(mbna_plotx_scale * (swathraw2->pingraws[0].navlon + mbna_offset_x_old - mbna_plot_lon_min));
-	    iyo = (int)(cont_borders[3] - mbna_ploty_scale * (swathraw2->pingraws[0].navlat + mbna_offset_y_old - mbna_plot_lat_min));
-	    for (i=1;i<swathraw2->npings;i++)
-		{
-		ix = (int)(mbna_plotx_scale * (swathraw2->pingraws[i].navlon + mbna_offset_x_old - mbna_plot_lon_min));
-		iy = (int)(cont_borders[3] - mbna_ploty_scale * (swathraw2->pingraws[i].navlat + mbna_offset_y_old - mbna_plot_lat_min));
-		xg_drawline(pcont_xgid, ixo, iyo, ix, iy, pixel_values[mbna_color_background], XG_SOLIDLINE);
-		ixo = ix;
-		iyo = iy;
-		}
-
-	    /* replot tie points */
-	    if (crossing->num_ties > 0)
-		{
-		for (i=0;i<crossing->num_ties;i++)
-		    {
-		    tie = &crossing->ties[i];
-		    if (i == mbna_current_tie)
-			{
-			boxoff = 6;
-			boxwid = 13;
-			snav_1 = mbna_snav_1;
-			snav_2 = mbna_snav_2;
-			}
-		    else
-			{
-			boxoff = 3;
-			boxwid = 7;
-			snav_1 = tie->snav_1;
-			snav_2 = tie->snav_2;
-			}
-		    ix = (int)(mbna_plotx_scale * (section1->snav_lon[snav_1] - mbna_plot_lon_min));
-		    iy = (int)(cont_borders[3] - mbna_ploty_scale * (section1->snav_lat[snav_1] - mbna_plot_lat_min));
-		    xg_fillrectangle(pcont_xgid, ix-boxoff, iy-boxoff, boxwid, boxwid, pixel_values[mbna_color_background], XG_SOLIDLINE);
-		    xg_drawrectangle(pcont_xgid, ix-boxoff, iy-boxoff, boxwid, boxwid, pixel_values[mbna_color_background], XG_SOLIDLINE);
-		    ixo = ix;
-		    iyo = iy;
-		    ix = (int)(mbna_plotx_scale * (section2->snav_lon[snav_2] + mbna_offset_x_old - mbna_plot_lon_min));
-		    iy = (int)(cont_borders[3] - mbna_ploty_scale * (section2->snav_lat[snav_2] + mbna_offset_y_old - mbna_plot_lat_min));
-		    xg_fillrectangle(pcont_xgid, ix-boxoff, iy-boxoff, boxwid, boxwid, pixel_values[mbna_color_background], XG_SOLIDLINE);
-		    xg_drawrectangle(pcont_xgid, ix-boxoff, iy-boxoff, boxwid, boxwid, pixel_values[mbna_color_background], XG_SOLIDLINE);
-		    xg_drawline(pcont_xgid, ixo, iyo, ix, iy, pixel_values[mbna_color_background], XG_SOLIDLINE);
-		    }
-		}
-	    }
-
-	    /* replot zoom box in background if moving that box */
-	    if (plotmode == MBNA_PLOT_MODE_ZOOM)
-		{
-		xg_drawrectangle(pcont_xgid,
-				    MIN(izx1, izx2),
-				    MIN(izy1, izy2),
-				    MAX(izx1, izx2) - MIN(izx1, izx2),
-				    MAX(izy1, izy2) - MIN(izy1, izy2),
-				    pixel_values[mbna_color_background], XG_SOLIDLINE);
-		}
-
-	    /* replot overlap box in background */
-	    if (mbna_overlap_lon_max > mbna_overlap_lon_min && mbna_overlap_lat_max > mbna_overlap_lat_min)
-		{
-		ix1 = (int)(mbna_plotx_scale * (mbna_overlap_lon_min - mbna_plot_lon_min));
-		iy1 = (int)(cont_borders[3] - mbna_ploty_scale * (mbna_overlap_lat_min - mbna_plot_lat_min));
-		ix2 = (int)(mbna_plotx_scale * (mbna_overlap_lon_max - mbna_plot_lon_min));
-		iy2 = (int)(cont_borders[3] - mbna_ploty_scale * (mbna_overlap_lat_max - mbna_plot_lat_min));
-		ix = MIN(ix1,ix2);
-		iy = MIN(iy1,iy2);
-		idx = MAX(ix1,ix2) - ix;
-		idy = MAX(iy1,iy2) - iy;
-		xg_drawrectangle(pcont_xgid,
-	    			    ix, iy, idx, idy,
-				    pixel_values[mbna_color_background], XG_DASHLINE);
-		}
-
-	    /* plot section 1 */
-	    for (i=0;i<mbna_contour1.nvector;i++)
-		{
-		v = &mbna_contour1.vector[i];
-
-		if (v->command == MBNA_PEN_COLOR)
-		    {
-		    pixel = v->color;
-		    }
-		else if (v->command == MBNA_PEN_UP)
-		    {
-		    ixo = (int)(mbna_plotx_scale * (v->x - mbna_plot_lon_min));
-		    iyo = (int)(cont_borders[3] - mbna_ploty_scale * (v->y - mbna_plot_lat_min));
-		    }
-		else if (v->command == MBNA_PEN_DOWN)
-		    {
-		    ix = (int)(mbna_plotx_scale * (v->x - mbna_plot_lon_min));
-		    iy = (int)(cont_borders[3] - mbna_ploty_scale * (v->y - mbna_plot_lat_min));
-		    xg_drawline(pcont_xgid, ixo, iyo, ix, iy, pixel, XG_SOLIDLINE);
-		    ixo = ix;
-		    iyo = iy;
-		    }
-		}
-	    ixo = (int)(mbna_plotx_scale * (swathraw1->pingraws[0].navlon - mbna_plot_lon_min));
-	    iyo = (int)(cont_borders[3] - mbna_ploty_scale * (swathraw1->pingraws[0].navlat - mbna_plot_lat_min));
-	    for (i=1;i<swathraw1->npings;i++)
-		{
-		ix = (int)(mbna_plotx_scale * (swathraw1->pingraws[i].navlon - mbna_plot_lon_min));
-		iy = (int)(cont_borders[3] - mbna_ploty_scale * (swathraw1->pingraws[i].navlat - mbna_plot_lat_min));
-		xg_drawline(pcont_xgid, ixo, iyo, ix, iy, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-		ixo = ix;
-		iyo = iy;
-		}
-
-	    /* plot section 2 */
-	    for (i=0;i<mbna_contour2.nvector;i++)
-		{
-		v = &mbna_contour2.vector[i];
-
-		if (v->command == MBNA_PEN_COLOR)
-		    {
-		    pixel = v->color;
-		    }
-		else if (v->command == MBNA_PEN_UP)
-		    {
-		    ixo = (int)(mbna_plotx_scale * (v->x + mbna_offset_x - mbna_plot_lon_min));
-		    iyo = (int)(cont_borders[3] - mbna_ploty_scale * (v->y + mbna_offset_y - mbna_plot_lat_min));
-		    }
-		else if (v->command == MBNA_PEN_DOWN)
-		    {
-		    ix = (int)(mbna_plotx_scale * (v->x + mbna_offset_x - mbna_plot_lon_min));
-		    iy = (int)(cont_borders[3] - mbna_ploty_scale * (v->y + mbna_offset_y - mbna_plot_lat_min));
-		    xg_drawline(pcont_xgid, ixo, iyo, ix, iy, pixel, XG_SOLIDLINE);
-		    ixo = ix;
-		    iyo = iy;
-		    }
-		}
-	    ixo = (int)(mbna_plotx_scale * (swathraw2->pingraws[0].navlon + mbna_offset_x - mbna_plot_lon_min));
-	    iyo = (int)(cont_borders[3] - mbna_ploty_scale * (swathraw2->pingraws[0].navlat + mbna_offset_y - mbna_plot_lat_min));
-	    for (i=1;i<swathraw2->npings;i++)
-		{
-		ix = (int)(mbna_plotx_scale * (swathraw2->pingraws[i].navlon + mbna_offset_x - mbna_plot_lon_min));
-		iy = (int)(cont_borders[3] - mbna_ploty_scale * (swathraw2->pingraws[i].navlat + mbna_offset_y - mbna_plot_lat_min));
-		xg_drawline(pcont_xgid, ixo, iyo, ix, iy, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-		ixo = ix;
-		iyo = iy;
-		}
-
-	    /* plot tie points */
-	    mbnavadjust_naverr_checkoksettie();
-	    crossing = &project.crossings[mbna_current_crossing];
-	    if (crossing->num_ties > 0)
-		{
-		for (i=0;i<crossing->num_ties;i++)
-		    {
-		    tie = &crossing->ties[i];
-		    if (i == mbna_current_tie)
-			{
-			boxoff = 6;
-			boxwid = 13;
-			snav_1 = mbna_snav_1;
-			snav_2 = mbna_snav_2;
-			if (mbna_allow_set_tie == MB_YES)
-				fill = pixel_values[RED];
-		    	else
-				fill = pixel_values[6];
-			}
-		    else
-			{
-			boxoff = 3;
-			boxwid = 7;
-			snav_1 = tie->snav_1;
-			snav_2 = tie->snav_2;
-		    	fill = pixel_values[6];
-			}
-		    ix = (int)(mbna_plotx_scale * (section1->snav_lon[snav_1] - mbna_plot_lon_min));
-		    iy = (int)(cont_borders[3] - mbna_ploty_scale * (section1->snav_lat[snav_1] - mbna_plot_lat_min));
-		    xg_fillrectangle(pcont_xgid, ix-boxoff, iy-boxoff, boxwid, boxwid, fill, XG_SOLIDLINE);
-		    xg_drawrectangle(pcont_xgid, ix-boxoff, iy-boxoff, boxwid, boxwid, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-		    ixo = ix;
-		    iyo = iy;
-		    ix = (int)(mbna_plotx_scale * (section2->snav_lon[snav_2] + mbna_offset_x - mbna_plot_lon_min));
-		    iy = (int)(cont_borders[3] - mbna_ploty_scale * (section2->snav_lat[snav_2] + mbna_offset_y - mbna_plot_lat_min));
-		    xg_fillrectangle(pcont_xgid, ix-boxoff, iy-boxoff, boxwid, boxwid, fill, XG_SOLIDLINE);
-		    xg_drawrectangle(pcont_xgid, ix-boxoff, iy-boxoff, boxwid, boxwid, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-		    xg_drawline(pcont_xgid, ixo, iyo, ix, iy, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-		    }
-		}
-
-	    /* plot overlap box */
-	    mbnavadjust_crossing_overlapbounds(mbna_current_crossing, mbna_offset_x, mbna_offset_y,
-	    					&mbna_overlap_lon_min, &mbna_overlap_lon_max,
-						&mbna_overlap_lat_min, &mbna_overlap_lat_max);
-	    ix1 = (int)(mbna_plotx_scale * (mbna_overlap_lon_min - mbna_plot_lon_min));
-	    iy1 = (int)(cont_borders[3] - mbna_ploty_scale * (mbna_overlap_lat_min - mbna_plot_lat_min));
-	    ix2 = (int)(mbna_plotx_scale * (mbna_overlap_lon_max - mbna_plot_lon_min));
-	    iy2 = (int)(cont_borders[3] - mbna_ploty_scale * (mbna_overlap_lat_max - mbna_plot_lat_min));
-	    ix = MIN(ix1,ix2);
-	    iy = MIN(iy1,iy2);
-	    idx = MAX(ix1,ix2) - ix;
-	    idy = MAX(iy1,iy2) - iy;
-	    xg_drawrectangle(pcont_xgid,
-	    			ix, iy, idx, idy,
-				pixel_values[mbna_color_foreground], XG_DASHLINE);
-
-	    /* plot zoom box if in zoom mode */
-	    if (plotmode == MBNA_PLOT_MODE_ZOOMFIRST || plotmode == MBNA_PLOT_MODE_ZOOM)
-		{
-		xg_drawrectangle(pcont_xgid,
-				    MIN(mbna_zoom_x1, mbna_zoom_x2),
-				    MIN(mbna_zoom_y1, mbna_zoom_y2),
-				    MAX(mbna_zoom_x1, mbna_zoom_x2) - MIN(mbna_zoom_x1, mbna_zoom_x2),
-				    MAX(mbna_zoom_y1, mbna_zoom_y2) - MIN(mbna_zoom_y1, mbna_zoom_y2),
-				    pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-		izx1 = mbna_zoom_x1;
-		izy1 = mbna_zoom_y1;
-		izx2 = mbna_zoom_x2;
-		izy2 = mbna_zoom_y2;
-		}
-
-	    /* plot misfit */
-	    ixo = corr_borders[0] + (corr_borders[1] - corr_borders[0]) / 2;
-	    iyo = corr_borders[2] + (corr_borders[3] - corr_borders[2]) / 2;
-	    dmisfit = log10(misfit_max - misfit_min)/79.99;
-	    k = (int)((mbna_offset_z - zmin) / zoff_dz);
-	    for (i=0;i<gridm_nx;i++)
-		for(j=0;j<gridm_ny;j++)
-		    {
-		    l = k + nzmisfitcalc * (i + j * gridm_nx);
-		    if (gridnm[l] > 0)
-			{
-			ix = ixo + (int)(mbna_misfit_xscale * grid_dx
-					    * (i - gridm_nx / 2 - 0.5));
-			iy = iyo - (int)(mbna_misfit_yscale * grid_dy
-					    * (j - gridm_ny / 2 + 0.5));
-			idx = ixo + (int)(mbna_misfit_xscale * grid_dx
-					    * (i - gridm_nx / 2 + 0.5))
-				    - ix;
-			idy = iyo - (int)(mbna_misfit_yscale * grid_dy
-					    * (j - gridm_ny / 2 - 0.5))
-				    - iy;
-
-    			/* histogram equalized coloring */
-			if (gridm[l] <= misfit_intervals[0])
-				ipixel = 7;
-			else if (gridm[l] >= misfit_intervals[nmisfit_intervals-1])
-				ipixel = 7 + nmisfit_intervals - 1;
-			else
-				{
-				found = MB_NO;
-				for (kk=0;kk<nmisfit_intervals && found == MB_NO;kk++)
-					{
-					if (gridm[l] > misfit_intervals[kk]
-						&& gridm[l] <= misfit_intervals[kk+1])
-						{
-						ipixel = 7 + kk;
-						found = MB_YES;
-						}
-					}
-				}
-/*fprintf(stderr, "%d %d %f %f %f   %f %d\n",
-    i, j, misfit_min, misfit_max, dmisfit, gridm[l], ipixel);*/
-
-			xg_fillrectangle(pcorr_xgid,
-				    ix, iy, idx, idy,
-				    pixel_values[ipixel], XG_SOLIDLINE);
-			}
-		    }
-
-	    /* draw dashed crosshair across origin */
-	    xg_drawline(pcorr_xgid,
-			    ixo - (int)(mbna_misfit_xscale * mbna_misfit_offset_x),
-			    corr_borders[2],
-			    ixo - (int)(mbna_misfit_xscale * mbna_misfit_offset_x),
-			    corr_borders[3],
-			    pixel_values[mbna_color_foreground], XG_DASHLINE);
-	    xg_drawline(pcorr_xgid,
-			    corr_borders[0],
-			    iyo + (int)(mbna_misfit_yscale * mbna_misfit_offset_y),
-			    corr_borders[1],
-			    iyo + (int)(mbna_misfit_yscale * mbna_misfit_offset_y),
-			    pixel_values[mbna_color_foreground], XG_DASHLINE);
-
-	    /* draw working offset */
-	    ix = ixo + (int)(mbna_misfit_xscale * (mbna_offset_x - mbna_misfit_offset_x));
-	    iy = iyo - (int)(mbna_misfit_yscale * (mbna_offset_y - mbna_misfit_offset_y));
-	    xg_fillrectangle(pcorr_xgid, ix-3, iy-3, 7, 7, pixel_values[RED], XG_SOLIDLINE);
-	    xg_drawrectangle(pcorr_xgid, ix-3, iy-3, 7, 7, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-
-	    /* draw uncertainty estimate */
-	    if (mbna_minmisfit_n > 0)
-	    	{
-		ix = ixo + (int)(mbna_misfit_xscale * (mbna_minmisfit_x - mbna_misfit_offset_x));
-		iy = iyo - (int)(mbna_misfit_yscale * (mbna_minmisfit_y - mbna_misfit_offset_y));
-		idx = (int)(mbna_misfit_xscale * (mbna_mtodeglon * mbna_minmisfit_sr1 * mbna_minmisfit_sx1[0]));
-		idy = -(int)(mbna_misfit_yscale * (mbna_mtodeglat * mbna_minmisfit_sr1 * mbna_minmisfit_sx1[1]));
-		xg_drawline(pcorr_xgid,
-				ix - idx, iy - idy,
-				ix + idx, iy + idy,
-				pixel_values[mbna_color_background], XG_SOLIDLINE);
-
-		ix = ixo + (int)(mbna_misfit_xscale * (mbna_minmisfit_x - mbna_misfit_offset_x));
-		iy = iyo - (int)(mbna_misfit_yscale * (mbna_minmisfit_y - mbna_misfit_offset_y));
-		idx = (int)(mbna_misfit_xscale * (mbna_mtodeglon * mbna_minmisfit_sr2 * mbna_minmisfit_sx2[0]));
-		idy = -(int)(mbna_misfit_yscale * (mbna_mtodeglat * mbna_minmisfit_sr2 * mbna_minmisfit_sx2[1]));
-		xg_drawline(pcorr_xgid,
-				ix - idx, iy - idy,
-				ix + idx, iy + idy,
-				pixel_values[mbna_color_background], XG_SOLIDLINE);
-		}
-
-	    /* draw x at minimum misfit */
-	    if (mbna_minmisfit_n > 0)
-	    	{
-		ix = ixo + (int)(mbna_misfit_xscale * (mbna_minmisfit_x - mbna_misfit_offset_x));
-		iy = iyo - (int)(mbna_misfit_yscale * (mbna_minmisfit_y - mbna_misfit_offset_y));
-		xg_drawline(pcorr_xgid,
-				ix - 10, iy + 10,
-				ix + 10, iy - 10,
-				pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-		xg_drawline(pcorr_xgid,
-				ix + 10, iy + 10,
-				ix - 10, iy - 10,
-				pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-		}
-
-	    /* draw small x at minimum misfit for current z offset */
-	    if (mbna_minmisfit_n > 0)
-	    	{
-		ix = ixo + (int)(mbna_misfit_xscale * (mbna_minmisfit_xh - mbna_misfit_offset_x));
-		iy = iyo - (int)(mbna_misfit_yscale * (mbna_minmisfit_yh - mbna_misfit_offset_y));
-		xg_drawline(pcorr_xgid,
-				ix - 5, iy + 5,
-				ix + 5, iy - 5,
-				pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-		xg_drawline(pcorr_xgid,
-				ix + 5, iy + 5,
-				ix - 5, iy - 5,
-				pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-		}
-
-	    /* draw + at inversion solution */
-	    if (project.inversion != MBNA_INVERSION_NONE)
-	    	{
-	    	ix = ixo + (int)(mbna_misfit_xscale * (mbna_invert_offset_x - mbna_misfit_offset_x));
-	    	iy = iyo - (int)(mbna_misfit_yscale * (mbna_invert_offset_y - mbna_misfit_offset_y));
-	    	xg_drawline(pcorr_xgid,
-			    ix - 10, iy,
-			    ix + 10, iy,
-			    pixel_values[GREEN], XG_SOLIDLINE);
-	    	xg_drawline(pcorr_xgid,
-			    ix, iy + 10,
-			    ix, iy - 10,
-			    pixel_values[GREEN], XG_SOLIDLINE);
-	    	xg_drawline(pcorr_xgid,
-			    ix - 10, iy,
-			    ix + 10, iy,
-			    pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-	    	xg_drawline(pcorr_xgid,
-			    ix, iy + 10,
-			    ix, iy - 10,
-			    pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-		}
-
-	    /* plot zoff */
-	    ixo = zoff_borders[0];
-	    iyo = zoff_borders[3];
-	    i = (int)((mbna_offset_x - mbna_misfit_offset_x) / grid_dx) + (int)(gridm_nx / 2);
-	    i = MAX(0, MIN(gridm_nx-1, i));
-	    j = (int)((mbna_offset_y - mbna_misfit_offset_y) / grid_dy) + (int)(gridm_ny / 2);
-	    j = MAX(0, MIN(gridm_ny-1, j));
-	    found = MB_NO;
-	    zmisfitmin = 10000000.0;
-	    zmisfitmax = 0.0;
-	    for (k=0;k<nzmisfitcalc;k++)
-		{
-		l = k + nzmisfitcalc * (i + j * gridm_nx);
-		if (gridnm[l] > 0)
-		    {
-		    if (found == MB_NO)
-			{
-			zmisfitmin = gridm[l];
-			zmisfitmax = gridm[l];
-			found = MB_YES;
-			}
-		    else
-			{
-			zmisfitmin = MIN(zmisfitmin, gridm[l]);
-			zmisfitmax = MAX(zmisfitmax, gridm[l]);
-			}
-		    }
-		}
-/*fprintf(stderr,"Current offset: %f %f %f\n",
-mbna_offset_x / mbna_mtodeglon, mbna_offset_y / mbna_mtodeglat, mbna_offset_z);
-fprintf(stderr,"Current misfit grid offset: %f %f %f\n",
-mbna_misfit_offset_x / mbna_mtodeglon, mbna_misfit_offset_y / mbna_mtodeglat, mbna_misfit_offset_z);
-fprintf(stderr,"Current min misfit position: %f %f %f\n",
-mbna_minmisfit_x / mbna_mtodeglon, mbna_minmisfit_y / mbna_mtodeglat, mbna_minmisfit_z);
-fprintf(stderr,"misfitmin:%f misfitmax:%f  zmisfitmin:%f zmisfitmax:%f\n\n",
-misfit_min,misfit_max,zmisfitmin,zmisfitmax);*/
-	    zmisfitmin = zmisfitmin - 0.05 * (zmisfitmax - zmisfitmin);
-	    zmisfitmax = zmisfitmax + 0.04 * (zmisfitmax - zmisfitmin);
-	    mbna_zoff_scale_x = (zoff_borders[1] - zoff_borders[0])
-		    / (project.zoffsetwidth);
-	    mbna_zoff_scale_y = (zoff_borders[3] - zoff_borders[2])
-		    / (zmisfitmax - zmisfitmin);
-	    for (k=0;k<nzmisfitcalc;k++)
-		{
-		l = k + nzmisfitcalc * (i + j * gridm_nx);
-		if (gridnm[l] > 0)
-		    {
-   		    /* histogram equalized coloring */
-		    if (gridm[l] <= misfit_intervals[0])
-			    ipixel = 7;
-		    else if (gridm[l] >= misfit_intervals[nmisfit_intervals-1])
-			    ipixel = 7 + nmisfit_intervals - 1;
-		    else
-			{
-			found = MB_NO;
-			for (kk=0;kk<nmisfit_intervals && found == MB_NO;kk++)
-			    {
-			    if (gridm[l] > misfit_intervals[kk]
-				    && gridm[l] <= misfit_intervals[kk+1])
-				{
-				ipixel = 7 + kk;
-				found = MB_YES;
-				}
-			    }
-			}
-		    ix = ixo + (int)(mbna_zoff_scale_x * zoff_dz * (k - 0.5));
-		    iy = (int)(mbna_zoff_scale_y * (gridm[l] - zmisfitmin));
-		    idx = (int)(mbna_zoff_scale_x * zoff_dz);
-		    idx = MAX(idx, 1);
-		    idy = iyo - iy;
-/* fprintf(stderr,"Fill Zoff: %d %d %d %d  pixel:%d\n",
-ix, iy, idx, idy, pixel_values[ipixel]);*/
-		    xg_fillrectangle(pzoff_xgid,
-				ix, iy, idx, idy,
-				pixel_values[ipixel], XG_SOLIDLINE);
-		    }
-		}
-
-	    /* plot zero zoff */
-	    ix = ixo - (int)(mbna_zoff_scale_x * zmin);
-	    xg_drawline(pzoff_xgid,
-			    ix, zoff_borders[2],
-			    ix, zoff_borders[3],
-			    pixel_values[mbna_color_foreground], XG_DASHLINE);
-
-	    /* draw working offset */
-	    ix = ixo + (int)(mbna_zoff_scale_x * (mbna_offset_z - zmin));
-	    xg_drawline(pzoff_xgid,
-			    ix, zoff_borders[2],
-			    ix, zoff_borders[3],
-			    pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-
-	    /* draw x at minimum misfit */
-	    if (mbna_minmisfit_n > 0)
-	    	{
-		ix = ixo + (int)(mbna_zoff_scale_x * (mbna_minmisfit_z - zmin));
-		iy = zoff_borders[3] / 2;
-		xg_drawline(pzoff_xgid,
-				ix - 10, iy + 10,
-				ix + 10, iy - 10,
-				pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-		xg_drawline(pzoff_xgid,
-				ix + 10, iy + 10,
-				ix - 10, iy - 10,
-				pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-		}
-
-	    /* draw + at inversion solution */
-	    if (project.inversion != MBNA_INVERSION_NONE)
-	    	{
-	    	ix = ixo + (int)(mbna_zoff_scale_x * (mbna_invert_offset_z - zmin));
-	    	iy = zoff_borders[3] / 2;
-	    	xg_drawline(pzoff_xgid,
-			    ix - 10, iy,
-			    ix + 10, iy,
-			    pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-	    	xg_drawline(pzoff_xgid,
-			    ix, iy + 10,
-			    ix, iy - 10,
-			    pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-		}
-
-	    }
-
- 	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-}
-/*--------------------------------------------------------------------*/
-
-int
-mbnavadjust_autopick(int do_vertical)
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_autopick";
-	int	status = MB_SUCCESS;
-	struct 	mbna_crossing *crossing;
-	struct 	mbna_tie *tie;
-	double	firstsonardepth1, firsttime_d1, secondsonardepth1, secondtime_d1, dsonardepth1;
-	double	firstsonardepth2, firsttime_d2, secondsonardepth2, secondtime_d2, dsonardepth2;
-	double	overlap_scale;
-	int	found, process;
-	int	nprocess;
-	int	i, j, k;
-
- 	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2       do_vertical: %d\n",do_vertical);
-		}
-
-	/* make sure that all sections referenced in crossings have up-to-date contours made */
-    	if (project.open == MB_YES
-    		&& project.num_crossings > 0)
-    		{
-		/* set message dialog on */
-		sprintf(message,"Autopicking offsets...");
-		do_message_on(message);
-		sprintf(message,"Autopicking offsets...\n");
-		if (mbna_verbose == 0)
-		    fprintf(stderr,"%s\n",message);
-		do_info_add(message,MB_YES);
-
-		/* loop over all crossings */
-		nprocess = 0;
-		for (i=0;i<project.num_crossings;i++)
-			{
-			/* get structure */
-			crossing = &(project.crossings[i]);
-
-			/* check if processing should proceed */
-			process = MB_NO;
-			if (crossing->status == MBNA_CROSSING_STATUS_NONE
-				&& crossing->overlap >=  MBNA_MEDIOCREOVERLAP_THRESHOLD)
-				{
-				if (mbna_view_list == MBNA_VIEW_LIST_CROSSINGS)
-					{
-					if ((mbna_view_mode == MBNA_VIEW_MODE_ALL)
-						|| (mbna_view_mode == MBNA_VIEW_MODE_SURVEY
-							&& mbna_survey_select == project.files[crossing->file_id_1].block
-							&& mbna_survey_select == project.files[crossing->file_id_2].block)
-						|| (mbna_view_mode == MBNA_VIEW_MODE_FILE
-							&& mbna_file_select == crossing->file_id_1
-							&& mbna_file_select == crossing->file_id_2)
-						|| (mbna_view_mode == MBNA_VIEW_MODE_WITHSURVEY
-							&& (mbna_survey_select == project.files[crossing->file_id_1].block
-								|| mbna_survey_select == project.files[crossing->file_id_2].block))
-						|| (mbna_view_mode == MBNA_VIEW_MODE_WITHFILE
-							&& (mbna_file_select == crossing->file_id_1
-								|| mbna_file_select == crossing->file_id_2))
-						|| (mbna_view_mode == MBNA_VIEW_MODE_WITHSECTION
-							&& mbna_file_select == crossing->file_id_1
-							&& mbna_section_select == crossing->section_1)
-						|| (mbna_view_mode == MBNA_VIEW_MODE_WITHSECTION
-							&& mbna_file_select == crossing->file_id_2
-							&& mbna_section_select == crossing->section_2))
-						process = MB_YES;
-					}
-				else if (mbna_view_list == MBNA_VIEW_LIST_MEDIOCRECROSSINGS)
-					{
-					if (crossing->overlap >= MBNA_MEDIOCREOVERLAP_THRESHOLD)
-						{
-						if ((mbna_view_mode == MBNA_VIEW_MODE_ALL)
-							|| (mbna_view_mode == MBNA_VIEW_MODE_SURVEY
-								&& mbna_survey_select == project.files[crossing->file_id_1].block
-								&& mbna_survey_select == project.files[crossing->file_id_2].block)
-							|| (mbna_view_mode == MBNA_VIEW_MODE_FILE
-								&& mbna_file_select == crossing->file_id_1
-								&& mbna_file_select == crossing->file_id_2)
-							|| (mbna_view_mode == MBNA_VIEW_MODE_WITHSURVEY
-								&& (mbna_survey_select == project.files[crossing->file_id_1].block
-									|| mbna_survey_select == project.files[crossing->file_id_2].block))
-							|| (mbna_view_mode == MBNA_VIEW_MODE_WITHFILE
-								&& (mbna_file_select == crossing->file_id_1
-									|| mbna_file_select == crossing->file_id_2))
-							|| (mbna_view_mode == MBNA_VIEW_MODE_WITHSECTION
-								&& mbna_file_select == crossing->file_id_1
-								&& mbna_section_select == crossing->section_1)
-							|| (mbna_view_mode == MBNA_VIEW_MODE_WITHSECTION
-								&& mbna_file_select == crossing->file_id_2
-								&& mbna_section_select == crossing->section_2))
-						process = MB_YES;
-						}
-					}
-				else if (mbna_view_list == MBNA_VIEW_LIST_GOODCROSSINGS)
-					{
-					if (crossing->overlap >= MBNA_GOODOVERLAP_THRESHOLD)
-						{
-						if ((mbna_view_mode == MBNA_VIEW_MODE_ALL)
-							|| (mbna_view_mode == MBNA_VIEW_MODE_SURVEY
-								&& mbna_survey_select == project.files[crossing->file_id_1].block
-								&& mbna_survey_select == project.files[crossing->file_id_2].block)
-							|| (mbna_view_mode == MBNA_VIEW_MODE_FILE
-								&& mbna_file_select == crossing->file_id_1
-								&& mbna_file_select == crossing->file_id_2)
-							|| (mbna_view_mode == MBNA_VIEW_MODE_WITHSURVEY
-								&& (mbna_survey_select == project.files[crossing->file_id_1].block
-									|| mbna_survey_select == project.files[crossing->file_id_2].block))
-							|| (mbna_view_mode == MBNA_VIEW_MODE_WITHFILE
-								&& (mbna_file_select == crossing->file_id_1
-									|| mbna_file_select == crossing->file_id_2))
-							|| (mbna_view_mode == MBNA_VIEW_MODE_WITHSECTION
-								&& mbna_file_select == crossing->file_id_1
-								&& mbna_section_select == crossing->section_1)
-							|| (mbna_view_mode == MBNA_VIEW_MODE_WITHSECTION
-								&& mbna_file_select == crossing->file_id_2
-								&& mbna_section_select == crossing->section_2))
-						process = MB_YES;
-						}
-					}
-				else if (mbna_view_list == MBNA_VIEW_LIST_BETTERCROSSINGS)
-					{
-					if (crossing->overlap >= MBNA_BETTEROVERLAP_THRESHOLD)
-						{
-						if ((mbna_view_mode == MBNA_VIEW_MODE_ALL)
-							|| (mbna_view_mode == MBNA_VIEW_MODE_SURVEY
-								&& mbna_survey_select == project.files[crossing->file_id_1].block
-								&& mbna_survey_select == project.files[crossing->file_id_2].block)
-							|| (mbna_view_mode == MBNA_VIEW_MODE_FILE
-								&& mbna_file_select == crossing->file_id_1
-								&& mbna_file_select == crossing->file_id_2)
-							|| (mbna_view_mode == MBNA_VIEW_MODE_WITHSURVEY
-								&& (mbna_survey_select == project.files[crossing->file_id_1].block
-									|| mbna_survey_select == project.files[crossing->file_id_2].block))
-							|| (mbna_view_mode == MBNA_VIEW_MODE_WITHFILE
-								&& (mbna_file_select == crossing->file_id_1
-									|| mbna_file_select == crossing->file_id_2))
-							|| (mbna_view_mode == MBNA_VIEW_MODE_WITHSECTION
-								&& mbna_file_select == crossing->file_id_1
-								&& mbna_section_select == crossing->section_1)
-							|| (mbna_view_mode == MBNA_VIEW_MODE_WITHSECTION
-								&& mbna_file_select == crossing->file_id_2
-								&& mbna_section_select == crossing->section_2))
-						process = MB_YES;
-						}
-					}
-				else if (mbna_view_list == MBNA_VIEW_LIST_TRUECROSSINGS)
-					{
-					if (crossing->truecrossing == MB_YES)
-						{
-						if ((mbna_view_mode == MBNA_VIEW_MODE_ALL)
-							|| (mbna_view_mode == MBNA_VIEW_MODE_SURVEY
-								&& mbna_survey_select == project.files[crossing->file_id_1].block
-								&& mbna_survey_select == project.files[crossing->file_id_2].block)
-							|| (mbna_view_mode == MBNA_VIEW_MODE_FILE
-								&& mbna_file_select == crossing->file_id_1
-								&& mbna_file_select == crossing->file_id_2)
-							|| (mbna_view_mode == MBNA_VIEW_MODE_WITHSURVEY
-								&& (mbna_survey_select == project.files[crossing->file_id_1].block
-									|| mbna_survey_select == project.files[crossing->file_id_2].block))
-							|| (mbna_view_mode == MBNA_VIEW_MODE_WITHFILE
-								&& (mbna_file_select == crossing->file_id_1
-									|| mbna_file_select == crossing->file_id_2))
-							|| (mbna_view_mode == MBNA_VIEW_MODE_WITHSECTION
-								&& mbna_file_select == crossing->file_id_1
-								&& mbna_section_select == crossing->section_1)
-							|| (mbna_view_mode == MBNA_VIEW_MODE_WITHSECTION
-								&& mbna_file_select == crossing->file_id_2
-								&& mbna_section_select == crossing->section_2))
-						process = MB_YES;
-						}
-					}
-				else
-					process = MB_YES;
-				}
-/* fprintf(stderr,"AUTOPICK crossing:%d do_vertical:%d process:%d\n",i,do_vertical,process); */
-
-			/* load the crossing */
-			if (process == MB_YES)
-				{
-				mbna_current_crossing = i;
-    				mbna_file_id_1 = crossing->file_id_1;
-    				mbna_section_1 = crossing->section_1;
-     				mbna_file_id_2 = crossing->file_id_2;
-    				mbna_section_2 = crossing->section_2;
-				mbna_current_tie = -1;
-
-				/* reset survey file and section selections */
-                                if (mbna_view_mode == MBNA_VIEW_MODE_SURVEY
-                                    || mbna_view_mode == MBNA_VIEW_MODE_WITHSURVEY)
-                                        {
-                                        if (mbna_survey_select == project.files[crossing->file_id_1].block)
-                                                {
-                                                mbna_file_select = crossing->file_id_1;
-                                                mbna_section_select = crossing->section_1;
-                                                }
-                                        else if (mbna_survey_select == project.files[crossing->file_id_2].block)
-                                                {
-                                                mbna_file_select = crossing->file_id_2;
-                                                mbna_section_select = crossing->section_2;
-                                                }
-                                        else
-                                                {
-                                                mbna_file_select = crossing->file_id_1;
-                                                mbna_section_select = crossing->section_1;
-                                                }
-                                        }
-                                else if (mbna_view_mode == MBNA_VIEW_MODE_FILE
-                                    || mbna_view_mode == MBNA_VIEW_MODE_WITHFILE)
-                                        {
-                                        if (mbna_file_select == crossing->file_id_1)
-                                                {
-                                                mbna_survey_select = project.files[crossing->file_id_1].block;
-                                                mbna_section_select = crossing->section_1;
-                                                }
-                                        else if (mbna_file_select == crossing->file_id_2)
-                                                {
-                                                mbna_survey_select = project.files[crossing->file_id_2].block;
-                                                mbna_section_select = crossing->section_2;
-                                                }
-                                        else
-                                                {
-                                                mbna_survey_select = project.files[crossing->file_id_1].block;
-                                                mbna_section_select = crossing->section_1;
-                                                }
-                                        }
-                                else if (mbna_view_mode == MBNA_VIEW_MODE_WITHSECTION)
-                                        {
-                                        if (mbna_file_select == crossing->file_id_1
-                                            && mbna_section_select == crossing->section_1)
-                                                {
-                                                mbna_survey_select = project.files[crossing->file_id_1].block;
-                                                mbna_file_select = crossing->file_id_1;
-                                                }
-                                        else if (mbna_file_select == crossing->file_id_2
-                                            && mbna_section_select == crossing->section_2)
-                                                {
-                                                mbna_survey_select = project.files[crossing->file_id_2].block;
-                                                mbna_file_select = crossing->file_id_2;
-                                                }
-                                        else
-                                                {
-                                                mbna_survey_select = project.files[crossing->file_id_1].block;
-                                                mbna_file_select = crossing->file_id_1;
-                                                }
-                                        }
-				else if (mbna_file_select == crossing->file_id_1)
-					{
-					mbna_survey_select = project.files[crossing->file_id_1].block;
-					mbna_file_select = crossing->file_id_1;
-					mbna_section_select = crossing->section_1;
-					}
-				else if (mbna_file_select == crossing->file_id_2)
-					{
-					mbna_survey_select = project.files[crossing->file_id_2].block;
-					mbna_file_select = crossing->file_id_2;
-					mbna_section_select = crossing->section_2;
-					}
-				else
-					{
-					mbna_survey_select = project.files[crossing->file_id_1].block;
-					mbna_file_select = crossing->file_id_1;
-					mbna_section_select = crossing->section_1;
-					}
-
-				/* set message dialog on */
-				sprintf(message,"Loading crossing %d...", mbna_current_crossing);
-				fprintf(stderr,"\n%s: %s\n",function_name,message);
-				do_message_update(message);
-
-    				/* load crossing */
-  				mbnavadjust_crossing_load();
-/* fprintf(stderr,"mbnavadjust_autopick AA crossing:%d overlap:%d overlap_scale:%f current offsets:%f %f %f  minmisfit3D:%f %f %f  minmisfit2D:%f %f %f\n",
-mbna_current_crossing,crossing->overlap,overlap_scale,
-mbna_offset_x/mbna_mtodeglon,mbna_offset_y/mbna_mtodeglat,mbna_offset_z,
-mbna_minmisfit_x/mbna_mtodeglon,mbna_minmisfit_y/mbna_mtodeglat,mbna_minmisfit_z,
-mbna_minmisfit_xh/mbna_mtodeglon,mbna_minmisfit_yh/mbna_mtodeglat,mbna_minmisfit_zh); */
-				nprocess++;
-
-				/* update status */
-				do_update_status();
-/* fprintf(stderr,"mbnavadjust_autopick A crossing:%d overlap:%d overlap_scale:%f current offsets:%f %f %f  minmisfit3D:%f %f %f  minmisfit2D:%f %f %f\n",
-mbna_current_crossing,crossing->overlap,overlap_scale,
-mbna_offset_x/mbna_mtodeglon,mbna_offset_y/mbna_mtodeglat,mbna_offset_z,
-mbna_minmisfit_x/mbna_mtodeglon,mbna_minmisfit_y/mbna_mtodeglat,mbna_minmisfit_z,
-mbna_minmisfit_xh/mbna_mtodeglon,mbna_minmisfit_yh/mbna_mtodeglat,mbna_minmisfit_zh); */
-
-				/* if this is a >50% overlap crossing then first set offsets to
-					minimum misfit and then recalculate misfit */
-				if (crossing->overlap > 50)
-					{
-					/* set offsets to minimum misfit */
-					if (do_vertical == MB_YES)
-						{
-						mbna_offset_x = mbna_minmisfit_x;
-						mbna_offset_y = mbna_minmisfit_y;
-						mbna_offset_z = mbna_minmisfit_z;
-						}
-					else
-						{
-						mbna_offset_x = mbna_minmisfit_xh;
-						mbna_offset_y = mbna_minmisfit_yh;
-						mbna_offset_z = mbna_minmisfit_zh;
-						}
-					mbna_misfit_offset_x = mbna_offset_x;
-					mbna_misfit_offset_y = mbna_offset_y;
-					mbna_misfit_offset_z = mbna_offset_z;
-					mbnavadjust_crossing_replot();
-
-					/* get misfit */
-					mbnavadjust_get_misfit();
-/* fprintf(stderr,"mbnavadjust_autopick B crossing:%d overlap:%d overlap_scale:%f current offsets:%f %f %f  minmisfit3D:%f %f %f  minmisfit2D:%f %f %f\n",
-mbna_current_crossing,crossing->overlap,overlap_scale,
-mbna_offset_x/mbna_mtodeglon,mbna_offset_y/mbna_mtodeglat,mbna_offset_z,
-mbna_minmisfit_x/mbna_mtodeglon,mbna_minmisfit_y/mbna_mtodeglat,mbna_minmisfit_z,
-mbna_minmisfit_xh/mbna_mtodeglon,mbna_minmisfit_yh/mbna_mtodeglat,mbna_minmisfit_zh); */
-					}
-
-				/* set plot bounds to overlap region */
-				mbnavadjust_crossing_overlapbounds(mbna_current_crossing,
-							mbna_offset_x, mbna_offset_y,
-	    						&mbna_overlap_lon_min, &mbna_overlap_lon_max,
-							&mbna_overlap_lat_min, &mbna_overlap_lat_max);
-				mbna_plot_lon_min = mbna_overlap_lon_min;
-				mbna_plot_lon_max = mbna_overlap_lon_max;
-				mbna_plot_lat_min = mbna_overlap_lat_min;
-				mbna_plot_lat_max = mbna_overlap_lat_max;
-				overlap_scale = MIN((mbna_overlap_lon_max - mbna_overlap_lon_min) / mbna_mtodeglon,
-							(mbna_overlap_lat_max - mbna_overlap_lat_min) / mbna_mtodeglat);
-
-				/* get naverr plot scaling */
-				mbnavadjust_naverr_scale();
-
-				/* get misfit */
-				mbnavadjust_get_misfit();
-
-				/* check uncertainty estimate for a good pick */
-/* fprintf(stderr,"mbnavadjust_autopick C crossing:%d overlap:%d overlap_scale:%f current offsets:%f %f %f  minmisfit3D:%f %f %f  minmisfit2D:%f %f %f\n",
-mbna_current_crossing,crossing->overlap,overlap_scale,
-mbna_offset_x/mbna_mtodeglon,mbna_offset_y/mbna_mtodeglat,mbna_offset_z,
-mbna_minmisfit_x/mbna_mtodeglon,mbna_minmisfit_y/mbna_mtodeglat,mbna_minmisfit_z,
-mbna_minmisfit_xh/mbna_mtodeglon,mbna_minmisfit_yh/mbna_mtodeglat,mbna_minmisfit_zh);
-fprintf(stderr,"crossing:%d overlap:%d overlap_scale:%f uncertainty axes: %f %f %f",
-mbna_current_crossing,crossing->overlap,overlap_scale,mbna_minmisfit_sr1,mbna_minmisfit_sr2,mbna_minmisfit_sr3);
-if (MAX(mbna_minmisfit_sr1,mbna_minmisfit_sr2) < 0.5 * overlap_scale
-&& MIN(mbna_minmisfit_sr1,mbna_minmisfit_sr2) > 0.0)
-fprintf(stderr," USE PICK");
-fprintf(stderr,"\n"); */
-
-fprintf(stderr,"Long misfit axis:%.3f Threshold:%.3f",
-MAX(mbna_minmisfit_sr1,mbna_minmisfit_sr2),0.5 * overlap_scale);
-
-				if (MAX(mbna_minmisfit_sr1,mbna_minmisfit_sr2) < 0.5 * overlap_scale
-					&& MIN(mbna_minmisfit_sr1,mbna_minmisfit_sr2) > 0.0)
-					{
-					fprintf(stderr," AUTOPICK SUCCEEDED\n");
-
-					/* set offsets to minimum misfit */
-					if (do_vertical == MB_YES)
-						{
-						mbna_offset_x = mbna_minmisfit_x;
-						mbna_offset_y = mbna_minmisfit_y;
-						mbna_offset_z = mbna_minmisfit_z;
-						}
-					else
-						{
-						mbna_offset_x = mbna_minmisfit_xh;
-						mbna_offset_y = mbna_minmisfit_yh;
-						mbna_offset_z = mbna_minmisfit_zh;
-						}
-
-					/* add tie */
-    					mbnavadjust_naverr_addtie();
-
-					/* deal with each tie */
-					for (j=0;j<crossing->num_ties;j++)
-						{
-						tie = &(crossing->ties[j]);
-
-						/* calculate sonardepth change rate for swath1 */
-						found = MB_NO;
-						for (k=0;k<swathraw1->npings;k++)
-						    {
-						    if (swathraw1->pingraws[k].time_d > tie->snav_1_time_d - 2.0
-					    		&& found == MB_NO)
-							{
-							firstsonardepth1 = swathraw1->pingraws[k].draft;
-							firsttime_d1 = swathraw1->pingraws[k].time_d;
-							found = MB_YES;
-							}
-						    if (swathraw1->pingraws[k].time_d < tie->snav_1_time_d + 2.0)
-							{
-							secondsonardepth1 = swathraw1->pingraws[k].draft;
-							secondtime_d1 = swathraw1->pingraws[k].time_d;
-							}
-						    }
-						dsonardepth1 = (secondsonardepth1 - firstsonardepth1)
-							/ (secondtime_d1 - firsttime_d1);
-
-						/* calculate sonardepth change rate for swath2 */
-						found = MB_NO;
-						for (k=0;k<swathraw2->npings;k++)
-						    {
-						    if (swathraw2->pingraws[k].time_d > tie->snav_2_time_d - 2.0
-					    		&& found == MB_NO)
-							{
-							firstsonardepth2 = swathraw2->pingraws[k].draft;
-							firsttime_d2 = swathraw2->pingraws[k].time_d;
-							found = MB_YES;
-							}
-						    if (swathraw2->pingraws[k].time_d < tie->snav_2_time_d + 2.0)
-							{
-							secondsonardepth2 = swathraw2->pingraws[k].draft;
-							secondtime_d2 = swathraw2->pingraws[k].time_d;
-							}
-						    }
-						dsonardepth2 = (secondsonardepth2 - firstsonardepth2)
-							/ (secondtime_d2 - firsttime_d2);
-/* fprintf(stderr,"mbnavadjust_autopick D crossing:%d tie:%d zoffset:%f   sdrate1:%f %f %f  sdrate2:%f %f %f   inferred time lag:%f\n",
-i,j,tie->offset_z_m,
-(secondsonardepth1 - firstsonardepth1), (secondtime_d1 - firsttime_d1), dsonardepth1,
-(secondsonardepth2 - firstsonardepth2), (secondtime_d2 - firsttime_d2), dsonardepth2,
-tie->offset_z_m / (dsonardepth2 - dsonardepth1)); */
-						}
-					}
-				else
-					{
-					fprintf(stderr," AUTOPICK FAILED\n");
-					}
-
-    				/* unload crossing */
-  				mbnavadjust_crossing_unload();
-
-fprintf(stderr,"mbna_file_select:%d mbna_survey_select:%d mbna_section_select:%d\n",
-mbna_file_select,mbna_survey_select,mbna_section_select);
-
-		    		/* update status periodically */
-		    		if (nprocess % 10 == 0)
-		    			{
-					do_update_status();
-
-					/* update model plot */
-					if (project.modelplot == MB_YES)
-						{
-						/* update model status */
-						do_update_modelplot_status();
-
-						/* replot the model */
-						mbnavadjust_modelplot_plot();
-						}
-					}
-				}
-			}
-
-		/* write updated project */
-		mbnavadjust_write_project();
-
-		/* turn off message dialog */
-		do_message_off();
-		}
-
- 	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int
-mbnavadjust_autosetsvsvertical()
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_autosetsvsvertical";
-	int	status = MB_SUCCESS;
-	struct mbna_file *file;
-	struct 	mbna_crossing *crossing;
-	struct 	mbna_file *file1, *file2;
-	struct 	mbna_tie *tie;
-	double	overlap_scale;
-	int	nprocess;
-	int	ntie, nfixed, ncols;
-	double	misfit_initial, perturbationsize, perturbationsizeold;
-	double	perturbationchange, convergencecriterea;
-	double	offset_z_m, block_offset_avg_z;
-	double	*x, *xx;
-	int	done, iter, nc1, nc2, navg, use, reset_tie;
-	int	i, j;
-
- 	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
-
-	/* set up and solve overdetermined least squares problem for a z-offset model with
-	 * constant z-offsets within each survey using
-	 * the current z-offset ties. Then, loop over all ties to auto-repick the crossings using
-	 * the z-offset in the new model (that is, pick the best lateral offset that can be found
-	 * using the z-offset in the new model). This should replace the initial ties with ties that
-	 * have self-consistent z-offsets between surveys. Using this option only makes sense if the
-	 * bathymetry was correctly tide-corrected before import into mbnavadjust.
-	 */
-   	if (project.open == MB_YES
-    		&& project.inversion != MBNA_INVERSION_NONE
-		&& project.modelplot == MB_YES)
-    		{
-		/* calculate the initial misfit */
-		ntie = 0;
-		misfit_initial = 0.0;
-		for (i=0;i<project.num_crossings;i++)
-		    {
-		    crossing = &project.crossings[i];
-		    if (crossing->status == MBNA_CROSSING_STATUS_SET)
-		    	{
-			ntie += crossing->num_ties;
-			for (j=0;j<crossing->num_ties;j++)
-				{
-				tie = (struct mbna_tie *) &crossing->ties[j];
-				misfit_initial += tie->offset_z_m * tie->offset_z_m;
-				}
-			}
-		    }
-		misfit_initial = sqrt(misfit_initial) / ntie;
-		perturbationsizeold = misfit_initial;
-
-		/* count the number of blocks */
-		project.num_blocks = 0;
-		for (i=0;i<project.num_files;i++)
-		    {
-		    file = &project.files[i];
-		    if (i==0 || file->sections[0].continuity == MB_NO)
-		    	{
-			project.num_blocks++;
-			}
-		    file->block = project.num_blocks - 1;
-		    }
-
-		/* count the number of fixed files */
-		nfixed = 0;
-		for (i=0;i<project.num_files;i++)
-		    {
-		    file = &project.files[i];
-		    if (file->status == MBNA_FILE_FIXEDNAV)
-		    	nfixed++;
-		    }
-
-		/* if only one block just set average offsets to zero */
-		if (project.num_blocks <= 1)
-		    {
-		    block_offset_avg_z = 0.0;
-		    for (i=0;i<project.num_files;i++)
-			{
-			file = &project.files[i];
-			file->block_offset_z = 0.0;
-			}
-		    }
-
-		/* else if more than one block first invert for block offsets  */
-		else if (project.num_blocks > 1)
-		    {
-		    /* allocate space for the inverse problem */
-		    ncols = project.num_blocks;
-		    status = mb_mallocd(mbna_verbose, __FILE__, __LINE__, ncols * sizeof(double), (void **)&x,&error);
-		    status = mb_mallocd(mbna_verbose, __FILE__, __LINE__, ncols * sizeof(double), (void **)&xx,&error);
-
-		    /* initialize x array */
-		    for (i=0;i<project.num_blocks;i++)
-			{
-			x[i] = 0.0;
-			}
-
-		    /* construct the inverse problem */
-		    sprintf(message,"Solving for survey z offsets...");
-		    do_message_update(message);
-
-		    done = MB_NO;
-		    iter = 0;
-		    while (done == MB_NO)
-		    	{
-			/* initialize xx array */
-			for (i=0;i<project.num_blocks;i++)
-			    {
-			    xx[i] = 0.0;
-			    }
-
-			/* loop over crossings getting set ties */
-			ntie = 0;
-			for (i=0;i<project.num_crossings;i++)
-			    {
-			    crossing = &project.crossings[i];
-
-			     /* get block id for first snav point */
-			     file1 = &project.files[crossing->file_id_1];
-			     nc1 = file1->block;
-
-			     /* get block id for second snav point */
-			     file2 = &project.files[crossing->file_id_2];
-			     nc2 = file2->block;
-
-			    /* use only set crossings */
-			    if (crossing->status == MBNA_CROSSING_STATUS_SET)
-			    for (j=0;j<crossing->num_ties;j++)
-				{
-				/* get tie */
-				tie = (struct mbna_tie *) &crossing->ties[j];
-				ntie++;
-
-				/* get current offset vector including reduction of block solution */
-				if (tie->status != MBNA_TIE_XY)
-				    {
-				    offset_z_m = tie->offset_z_m - (x[nc2] + xx[nc2] - x[nc1] - xx[nc1]);
-				    }
-				else
-				    {
-				    offset_z_m = 0.0;
-				    }
-/* fprintf(stderr,"icrossing:%d jtie:%d blocks:%d %d offsets: %f %f %f\n",
-i,j,nc1,nc2,offsetx,offsety,offset_z_m); */
-
-				/* deal with fixed or unfixed status of sections */
-				if ((file1->status == MBNA_FILE_GOODNAV && file2->status == MBNA_FILE_GOODNAV)
-					|| (file1->status == MBNA_FILE_POORNAV && file2->status == MBNA_FILE_POORNAV))
-				    {
-				    xx[nc1] += -mbna_offsetweight * 0.5 * offset_z_m;
-				    xx[nc2] +=  mbna_offsetweight * 0.5 * offset_z_m;
-				    }
-				else if (file1->status == MBNA_FILE_GOODNAV && file2->status == MBNA_FILE_POORNAV)
-				    {
-				    xx[nc1] += -mbna_offsetweight * 0.005 * offset_z_m;
-				    xx[nc2] +=  mbna_offsetweight * 0.995 * offset_z_m;
-				    }
-				else if (file1->status == MBNA_FILE_POORNAV && file2->status == MBNA_FILE_GOODNAV)
-				    {
-				    xx[nc1] += -mbna_offsetweight * 0.995 * offset_z_m;
-				    xx[nc2] +=  mbna_offsetweight * 0.005 * offset_z_m;
-				    }
-				else if (file1->status == MBNA_FILE_FIXEDNAV && file2->status == MBNA_FILE_FIXEDNAV)
-				    {
-				    /*
-				    xx[nc1] +=  0.0;
-				    xx[nc2] +=  0.0;
-				    */
-				    }
-				else if (file1->status == MBNA_FILE_FIXEDNAV)
-				    {
-				    if (file2->status == MBNA_FILE_FIXEDXYNAV)
-				    	{
-				    	/*
-					xx[nc1] +=  0.0;
-					xx[nc2] +=  0.0;
-				    	*/
-					xx[3*nc2+2] +=  offset_z_m;
-					}
-				    else if (file2->status == MBNA_FILE_FIXEDZNAV)
-				    	{
-				    	/*
-					xx[nc1] +=  0.0;
-					xx[nc2] +=  0.0;
-					*/
-					}
-				    else
-				    	{
-				    	/*
-					xx[nc1] +=  0.0;
-				    	*/
-					xx[nc2] +=  mbna_offsetweight * offset_z_m;
-					}
-				    }
-				else if (file2->status == MBNA_FILE_FIXEDNAV)
-				    {
-				    if (file1->status == MBNA_FILE_FIXEDXYNAV)
-				    	{
-					xx[nc1] +=  -mbna_offsetweight * offset_z_m;
-				    	/*
-					xx[nc2] +=  0.0;
-				    	*/
-					}
-				    else if (file1->status == MBNA_FILE_FIXEDZNAV)
-				    	{
-				    	/*
-					xx[nc1] +=  0.0;
-					xx[nc2] +=  0.0;
-				    	*/
-					}
-				    else
-				    	{
-					xx[nc1] +=  -mbna_offsetweight * offset_z_m;
-				    	/*
-					xx[nc2] +=  0.0;
-				    	*/
-					}
-				    }
-				}
-			    }
-
-			/* calculate 2-norm of perturbation */
-			perturbationsize = 0.0;
-			for (i=0;i<ncols;i++)
-			    {
-			    perturbationsize += xx[i] * xx[i];
-			    }
-			perturbationsize = sqrt(perturbationsize) / ncols;
-
-			/* apply perturbation */
-			for (i=0;i<ncols;i++)
-			    {
-			    x[i] += xx[i];
-			    }
-
-			 /* check for convergence */
-			 perturbationchange = perturbationsize - perturbationsizeold;
-			 convergencecriterea = fabs(perturbationchange) / misfit_initial;
-			 if (convergencecriterea < MBNA_CONVERGENCE || iter > MBNA_INTERATION_MAX)
-		    	     done = MB_YES;
-fprintf(stderr,"BLOCK INVERT: iter:%d ntie:%d misfit_initial:%f perturbationsize:%g perturbationchange:%g convergencecriterea:%g done:%d\n",
-iter,ntie,misfit_initial,perturbationsize,perturbationchange,convergencecriterea,done);
-
-			 if (done == MB_NO)
-		             {
-			     perturbationsizeold = perturbationsize;
-			     iter++;
-			     }
-			 }
-
-		    /* if there are no fixed blocks contributing to ties,
-		    	then get average z-offsets of blocks not flagged as bad
-			to provide a static offset to move final model to be more consistent
-			with the good blocks than the poorly navigated blocks */
-		    block_offset_avg_z = 0.0;
-		    navg = 0;
-		    if (nfixed == 0)
-		    	{
-			for (i=0;i<project.num_blocks;i++)
-			    {
-			    use = MB_YES;
-			    for (j=0;j<project.num_files;j++)
-				    {
-				    file = &project.files[j];
-				    if (file->block == i && file->status == MBNA_FILE_POORNAV)
-					    use = MB_NO;
-				    }
-			    if (use == MB_YES)
-				    {
-				    block_offset_avg_z += x[i];
-				    navg++;
-				    }
-			    }
-			if (navg > 0)
-		    	    {
-			    block_offset_avg_z /= navg;
-			    }
-			}
-
-		    /* output solution */
-		    fprintf(stderr,"\nAverage z-offsets: %f\n",block_offset_avg_z);
-		    for (i=0;i<project.num_blocks;i++)
-			{
-			fprintf(stderr, "Survey block:%d  z-offset: %f  block z-offset:%f\n", i, x[i], x[i] - block_offset_avg_z);
-			}
-
-		    /* set block offsets for each file */
-		    for (i=0;i<project.num_files;i++)
-			{
-			file = &project.files[i];
-			file->block_offset_z = x[file->block] - block_offset_avg_z;
-/* fprintf(stderr,"file:%d block: %d block offsets: %f %f %f\n",
-i,file->block,file->block_offset_x,file->block_offset_y,file->block_offset_z);*/
-			}
-
-		    /* deallocate arrays */
-		    status = mb_freed(mbna_verbose, __FILE__, __LINE__, (void **)&x,&error);
-		    status = mb_freed(mbna_verbose, __FILE__, __LINE__, (void **)&xx,&error);
-		    }
-
-		/* loop over over all crossings - reset existing ties using block z-offsets */
-		nprocess = 0;
-		for (i=0;i<project.num_crossings;i++)
-			{
-			/* set the crossing */
-			crossing = &project.crossings[i];
-			file1 = &project.files[crossing->file_id_1];
-			file2 = &project.files[crossing->file_id_2];
-			offset_z_m = file2->block_offset_z - file1->block_offset_z;
-
-			/* check if any ties exist and are inconsistent with the new survey z-offset model */
-			reset_tie = MB_NO;
-			for (j=0;j<crossing->num_ties;j++)
-				{
-				tie = &(crossing->ties[j]);
-				if (tie->offset_z_m != offset_z_m)
-					reset_tie = MB_YES;
-				}
-
-			/* if one or more ties exist and at , load crossing and reset the ties using the new z-offset */
-			if (reset_tie == MB_YES)
-				{
-				mbna_current_crossing = i;
-				mbna_file_id_1 = crossing->file_id_1;
-				mbna_section_1 = crossing->section_1;
-				mbna_file_id_2 = crossing->file_id_2;
-				mbna_section_2 = crossing->section_2;
-				mbna_current_tie = 0;
-				file1 = &project.files[mbna_file_id_1];
-				file2 = &project.files[mbna_file_id_2];
-
-				/* set message dialog on */
-				sprintf(message,"Loading crossing %d...", mbna_current_crossing);
-				fprintf(stderr,"%s: %s\n",function_name,message);
-				do_message_update(message);
-
-				/* load crossing */
-				mbnavadjust_crossing_load();
-				nprocess++;
-
-				/* update status and model plot */
-				do_update_status();
-				if (project.modelplot == MB_YES)
-					{
-					do_update_modelplot_status();
-					mbnavadjust_modelplot_plot();
-					}
-
-				/* delete each tie */
-				for (j=0;j<crossing->num_ties;j++)
-					{
-					mbnavadjust_deletetie(mbna_current_crossing, j, MBNA_CROSSING_STATUS_NONE);
-					}
-
-				/* update status and model plot */
-				do_update_status();
-				if (project.modelplot == MB_YES)
-					{
-					do_update_modelplot_status();
-					mbnavadjust_modelplot_plot();
-					}
-
-				/* reset z offset */
-				mbna_offset_z = file2->block_offset_z - file1->block_offset_z;
-
-				/* get misfit */
-				mbnavadjust_get_misfit();
-
-				/* set offsets to minimum horizontal misfit */
-				mbna_offset_x = mbna_minmisfit_xh;
-				mbna_offset_y = mbna_minmisfit_yh;
-				mbna_offset_z = mbna_minmisfit_zh;
-				mbna_misfit_offset_x = mbna_offset_x;
-				mbna_misfit_offset_y = mbna_offset_y;
-				mbna_misfit_offset_z = mbna_offset_z;
-				mbnavadjust_crossing_replot();
-
-				/* get misfit */
-				mbnavadjust_get_misfit();
-
-				/* set plot bounds to overlap region */
-				mbnavadjust_crossing_overlapbounds(mbna_current_crossing,
-							mbna_offset_x, mbna_offset_y,
-							&mbna_overlap_lon_min, &mbna_overlap_lon_max,
-							&mbna_overlap_lat_min, &mbna_overlap_lat_max);
-				mbna_plot_lon_min = mbna_overlap_lon_min;
-				mbna_plot_lon_max = mbna_overlap_lon_max;
-				mbna_plot_lat_min = mbna_overlap_lat_min;
-				mbna_plot_lat_max = mbna_overlap_lat_max;
-				overlap_scale = MIN((mbna_overlap_lon_max - mbna_overlap_lon_min) / mbna_mtodeglon,
-							(mbna_overlap_lat_max - mbna_overlap_lat_min) / mbna_mtodeglat);
-
-				/* get naverr plot scaling */
-				mbnavadjust_naverr_scale();
-
-				/* get misfit */
-				mbnavadjust_get_misfit();
-
-				/* check uncertainty estimate for a good pick */
-				if (MAX(mbna_minmisfit_sr1,mbna_minmisfit_sr2) < 0.5 * overlap_scale
-					&& MIN(mbna_minmisfit_sr1,mbna_minmisfit_sr2) > 0.0)
-					{
-
-					/* set offsets to minimum horizontal misfit */
-					mbna_offset_x = mbna_minmisfit_xh;
-					mbna_offset_y = mbna_minmisfit_yh;
-					mbna_offset_z = mbna_minmisfit_zh;
-
-					/* add tie */
-					mbnavadjust_naverr_addtie();
-					}
-				else
-					{
-					sprintf(message,"Failed to reset Tie Point %d of Crossing %d\n",
-							0, mbna_current_crossing);
-					if (mbna_verbose == 0)
-						fprintf(stderr,"%s",message);
-					do_info_add(message, MB_YES);
-					}
-
-				/* unload crossing */
-				mbnavadjust_crossing_unload();
-
-/*fprintf(stderr,"mbna_file_select:%d mbna_survey_select:%d mbna_section_select:%d\n",
-mbna_file_select,mbna_survey_select,mbna_section_select);*/
-
-				/* update status periodically */
-				if (nprocess % 10 == 0)
-					{
-					do_update_status();
-
-					/* update model plot */
-					if (project.modelplot == MB_YES)
-						{
-						/* update model status */
-						do_update_modelplot_status();
-
-						/* replot the model */
-						mbnavadjust_modelplot_plot();
-						}
-					}
-				}
-			}
-
-		/* update status */
-		do_update_status();
-
-		/* update model plot */
-		if (project.modelplot == MB_YES)
-			{
-			/* update model status */
-			do_update_modelplot_status();
-
-			/* replot the model */
-			mbnavadjust_modelplot_plot();
-			}
-		}
-
- 	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int
-mbnavadjust_zerozoffsets()
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_zerozoffsets";
-	int	status = MB_SUCCESS;
-	struct 	mbna_crossing *crossing;
-	struct 	mbna_tie *tie;
-	int	i, j;
-
- 	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
-
-	/* loop over all crossings */
-    	if (project.open == MB_YES
-    		&& project.num_crossings > 0)
-    		{
-		/* set message dialog on */
-		sprintf(message,"Zeroing all z offsets...");
-		do_message_on(message);
-		sprintf(message,"Zeroing all z offsets.\n");
-		if (mbna_verbose == 0)
-		    fprintf(stderr,"%s",message);
-		do_info_add(message,MB_YES);
-
-		/* loop over all crossings */
-		for (i=0;i<project.num_crossings;i++)
-			{
-			/* get structure */
-			crossing = &(project.crossings[i]);
-
-			/* deal with each tie */
-			for (j=0;j<crossing->num_ties;j++)
-				{
-				tie = &(crossing->ties[j]);
-
-				/* zero the z offset */
-				tie->offset_z_m = 0.0;
-
-				/* set inversion out of date */
-				if (project.inversion == MBNA_INVERSION_CURRENT)
-					project.inversion = MBNA_INVERSION_OLD;
-				}
-			}
-		/* write updated project */
-		mbnavadjust_write_project();
-
-		/* turn off message dialog */
-		do_message_off();
-		}
-
- 	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-
-int
-mbnavadjust_invertnav()
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_invertnav";
-	int	status = MB_SUCCESS;
-	struct mbna_file *file;
-	struct mbna_file *file1;
-	struct mbna_file *file2;
-	struct mbna_section *section;
-	struct mbna_section *section1;
-	struct mbna_section *section2;
-	struct mbna_crossing *crossing;
-	struct mbna_tie *tie;
-	int	nnav;
-	int	nsnav;
-	int	ndf = 3;
-	int	ncols = 0;
-	int	ntie = 0;
-	int	nfixed = 0;
-	int	nglobal = 0;
-	int	nmisfit = 0;
-	double	*x = NULL;
-	double	*xx = NULL;
-	double	*xa = NULL;
-	int	*nxs = NULL;
-	double	*xs = NULL;
-	double	*xw = NULL;
-	double	misfit, misfit_initial, misfit_ties_initial, misfit_norm_initial, misfit_ties, misfit_norm;
-	double	offsetx, offsety, offsetz, offsetr;
-	double	projected_offset;
-	double	xyweight, zweight;
-	double	dtime_d;
-	int	done, iter;
-	int	nseq, nseqlast;
-	int	nchange;
-	int	ndx, ndx2;
-	int	icrossing, jtie;
-	int	ifile, isection, isnav, inav;
-	int	nc1, nc2, nc3;
-	int	i, j, k;
-
-	double	perturbationsize;
-	double	perturbationsizeold;
-	double	perturbationchange;
-	double	convergencecriterea;
-	double	offset_x;
-	double	offset_y;
-	double	offset_z;
-	double	time_d1, time_d2, time_d3;
-	double	block_offset_avg_x;
-	double	block_offset_avg_y;
-	double	block_offset_avg_z;
-	int	navg;
-	int	use;
-	int	ok_to_invert;
-
- 	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
-
-	/* check if it is ok to invert
-		- if there is a project
-		- enough crossings have been analyzed
-		- no problems with offsets and offset uncertainties */
-    	if (project.open == MB_YES
-    		&& project.num_crossings > 0
-		&& (project.num_crossings_analyzed >= 10
-			|| project.num_truecrossings_analyzed == project.num_truecrossings))
-
-    		{
-		/* check that all uncertainty magnitudes are nonzero */
-		ok_to_invert = MB_YES;
-		for (icrossing=0;icrossing<project.num_crossings;icrossing++)
-		    {
-		    crossing = &project.crossings[icrossing];
-		    if (crossing->status == MBNA_CROSSING_STATUS_SET)
-		    	{
-			for (j=0;j<crossing->num_ties;j++)
-				{
-				tie = (struct mbna_tie *) &crossing->ties[j];
-				if (tie->sigmar1 <= 0.0
-					|| tie->sigmar2 <= 0.0
-					|| tie->sigmar3 <= 0.0)
-					{
-					ok_to_invert = MB_NO;
-					fprintf(stderr,"PROBLEM WITH TIE: %4d %2d %2.2d:%3.3d:%3.3d:%2.2d %2.2d:%3.3d:%3.3d:%2.2d %8.2f %8.2f %8.2f | %8.2f %8.2f %8.2f\n",
-						    icrossing, j,
-						    project.files[crossing->file_id_1].block,
-						    crossing->file_id_1,
-						    crossing->section_1,
-						    tie->snav_1,
-						    project.files[crossing->file_id_2].block,
-						    crossing->file_id_2,
-						    crossing->section_2,
-						    tie->snav_2,
-						    tie->offset_x_m,
-						    tie->offset_y_m,
-						    tie->offset_z_m,
-						    tie->sigmar1,
-						    tie->sigmar2,
-						    tie->sigmar3);
-					}
-				}
-			}
-		    }
-
-		/* print out warning */
-		if (ok_to_invert == MB_NO)
-			{
-			fprintf(stderr,"\nThe inversion was not performed because there are one or more zero offset uncertainty values.\n");
-			fprintf(stderr,"Please fix the ties with problems noted above before trying again.\n\n");
-			}
-		}
-
-
-	/* invert if there is a project and enough crossings have been analyzed */
-    	if (project.open == MB_YES
-    		&& project.num_crossings > 0
-		&& (project.num_crossings_analyzed >= 10
-			|| project.num_truecrossings_analyzed == project.num_truecrossings)
-		&& ok_to_invert == MB_YES)
-
-    		{
-		fprintf(stderr,"\nInverting for navigation adjustment model...\n");
-
-		/* set message dialog on */
-		sprintf(message,"Setting up navigation inversion...");
-		do_message_on(message);
-
-		/*----------------------------------------------------------------*/
-		/* Step 1 - get block (survey) average offsets                    */
-		/*----------------------------------------------------------------*/
-
-		/* figure out the average offsets between connected sets of files
-			- invert for x y z offsets for the blocks */
-
-		/* calculate the initial misfit, count number of crossing ties and global ties */
-		ntie = 0;
-		nglobal = 0;
-		misfit_initial = 0.0;
-		nmisfit = 0;
-		for (icrossing=0;icrossing<project.num_crossings;icrossing++)
-		    {
-		    crossing = &project.crossings[icrossing];
-		    if (crossing->status == MBNA_CROSSING_STATUS_SET)
-		    	{
-			ntie += crossing->num_ties;
-			for (j=0;j<crossing->num_ties;j++)
-				{
-				tie = (struct mbna_tie *) &crossing->ties[j];
-				if (tie->status != MBNA_TIE_Z)
-					{
-					misfit_initial += tie->offset_x_m * tie->offset_x_m;
-					misfit_initial += tie->offset_y_m * tie->offset_y_m;
-					nmisfit += 2;
-					}
-				if (tie->status != MBNA_TIE_XY)
-					{
-					misfit_initial += tie->offset_z_m * tie->offset_z_m;
-					nmisfit++;
-					}
-				}
-			}
-		    }
-		for (i=0;i<project.num_files;i++)
-		    {
-		    file = &project.files[i];
-		    for (isection=0;isection<file->num_sections;isection++)
-			{
-			section = &file->sections[isection];
-			if (section->global_tie_status != MBNA_TIE_NONE)
-				{
-				nglobal++;
-				if (section->global_tie_status != MBNA_TIE_Z)
-					{
-					misfit_initial += section->global_tie_offset_x_m * section->global_tie_offset_x_m;
-					misfit_initial += section->global_tie_offset_y_m * section->global_tie_offset_y_m;
-					nmisfit += 2;
-					}
-				if (section->global_tie_status != MBNA_TIE_XY)
-					{
-					misfit_initial += section->global_tie_offset_z_m * section->global_tie_offset_z_m;
-					nmisfit++;
-					}
-				}
-			}
-		    }
-		misfit_initial = sqrt(misfit_initial) / nmisfit;
-		perturbationsizeold = misfit_initial;
-
-		/* count the number of fixed files */
-		nfixed = 0;
-		for (i=0;i<project.num_files;i++)
-		    {
-		    file = &project.files[i];
-		    if (file->status == MBNA_FILE_FIXEDNAV)
-		    	nfixed++;
-		    }
-
-		/* if only one block just set average offsets to zero */
-		if (project.num_blocks <= 1)
-		    {
-		    block_offset_avg_x = 0.0;
-		    block_offset_avg_y = 0.0;
-		    block_offset_avg_z = 0.0;
-		    for (i=0;i<project.num_files;i++)
-			{
-			file = &project.files[i];
-			file->block_offset_x = 0.0;
-			file->block_offset_y = 0.0;
-			file->block_offset_z = 0.0;
-			}
-		    }
-
-		/* else if more than one block first invert for block offsets  */
-		else if (project.num_blocks > 1)
-		    {
-		    /* allocate space for the inverse problem */
-		    ncols = ndf * project.num_blocks;
-		    status = mb_mallocd(mbna_verbose, __FILE__, __LINE__, ncols * sizeof(double), (void **)&x,&error);
-		    status = mb_mallocd(mbna_verbose, __FILE__, __LINE__, ncols * sizeof(double), (void **)&xx,&error);
-
-		    /* initialize x array */
-		    for (i=0;i<ndf*project.num_blocks;i++)
-			{
-			x[i] = 0.0;
-			}
-
-		    /* construct the inverse problem */
-		    sprintf(message,"Solving for block offsets...");
-		    do_message_update(message);
-
-		    done = MB_NO;
-		    iter = 0;
-		    while (done == MB_NO)
-		    	{
-			/* initialize xx array */
-			for (i=0;i<ndf*project.num_blocks;i++)
-			    {
-			    xx[i] = 0.0;
-			    }
-
-			/* loop over crossings getting set ties */
-			for (icrossing=0;icrossing<project.num_crossings;icrossing++)
-			    {
-			    crossing = &project.crossings[icrossing];
-
-			     /* get block id for first snav point */
-			     file1 = &project.files[crossing->file_id_1];
-			     nc1 = file1->block;
-
-			     /* get block id for second snav point */
-			     file2 = &project.files[crossing->file_id_2];
-			     nc2 = file2->block;
-
-			    /* use only set crossings */
-			    if (crossing->status == MBNA_CROSSING_STATUS_SET)
-			    for (j=0;j<crossing->num_ties;j++)
-				{
-				/* get tie */
-				tie = (struct mbna_tie *) &crossing->ties[j];
-
-				/* get current offset vector including reduction of block solution */
-				if (tie->status != MBNA_TIE_Z)
-				    {
-				    offsetx = tie->offset_x_m - (x[3*nc2]   + xx[3*nc2]   - x[3*nc1]   - xx[3*nc1]);
-				    offsety = tie->offset_y_m - (x[3*nc2+1] + xx[3*nc2+1] - x[3*nc1+1] - xx[3*nc1+1]);
-				    }
-				else
-				    {
-				    offsetx = 0.0;
-				    offsety = 0.0;
-				    }
-				if (tie->status != MBNA_TIE_XY)
-				    {
-				    offsetz = tie->offset_z_m - (x[3*nc2+2] + xx[3*nc2+2] - x[3*nc1+2] - xx[3*nc1+2]);
-				    }
-				else
-				    {
-				    offsetz = 0.0;
-				    }
-/* fprintf(stderr,"icrossing:%d jtie:%d blocks:%d %d offsets: %f %f %f\n",
-icrossing,j,nc1,nc2,offsetx,offsety,offsetz); */
-
-				/* deal with fixed or unfixed status of sections */
-				if ((file1->status == MBNA_FILE_GOODNAV && file2->status == MBNA_FILE_GOODNAV)
-					|| (file1->status == MBNA_FILE_POORNAV && file2->status == MBNA_FILE_POORNAV))
-				    {
-				    xx[3*nc1]   += -0.5 * offsetx;
-				    xx[3*nc1+1] += -0.5 * offsety;
-				    xx[3*nc1+2] += -0.5 * offsetz;
-				    xx[3*nc2]   +=  0.5 * offsetx;
-				    xx[3*nc2+1] +=  0.5 * offsety;
-				    xx[3*nc2+2] +=  0.5 * offsetz;
-				    }
-				else if (file1->status == MBNA_FILE_GOODNAV && file2->status == MBNA_FILE_POORNAV)
-				    {
-				    xx[3*nc1]   += -0.005 * offsetx;
-				    xx[3*nc1+1] += -0.005 * offsety;
-				    xx[3*nc1+2] += -0.005 * offsetz;
-				    xx[3*nc2]   +=  0.995 * offsetx;
-				    xx[3*nc2+1] +=  0.995 * offsety;
-				    xx[3*nc2+2] +=  0.995 * offsetz;
-				    }
-				else if (file1->status == MBNA_FILE_POORNAV && file2->status == MBNA_FILE_GOODNAV)
-				    {
-				    xx[3*nc1]   += -0.995 * offsetx;
-				    xx[3*nc1+1] += -0.995 * offsety;
-				    xx[3*nc1+2] += -0.995 * offsetz;
-				    xx[3*nc2]   +=  0.005 * offsetx;
-				    xx[3*nc2+1] +=  0.005 * offsety;
-				    xx[3*nc2+2] +=  0.005 * offsetz;
-				    }
-				else if (file1->status == MBNA_FILE_FIXEDNAV && file2->status == MBNA_FILE_FIXEDNAV)
-				    {
-				    /*
-				    xx[3*nc1]   +=  0.0;
-				    xx[3*nc1+1] +=  0.0;
-				    xx[3*nc1+2] +=  0.0;
-				    xx[3*nc2]   +=  0.0;
-				    xx[3*nc2+1] +=  0.0;
-				    xx[3*nc2+2] +=  0.0;
-				    */
-				    }
-				else if (file1->status == MBNA_FILE_FIXEDNAV)
-				    {
-				    if (file2->status == MBNA_FILE_FIXEDXYNAV)
-				    	{
-				    	/*
-					xx[3*nc1]   +=  0.0;
-					xx[3*nc1+1] +=  0.0;
-					xx[3*nc1+2] +=  0.0;
-					xx[3*nc2]   +=  0.0;
-					xx[3*nc2+1] +=  0.0;
-				    	*/
-					xx[3*nc2+2] +=  offsetz;
-					}
-				    else if (file2->status == MBNA_FILE_FIXEDZNAV)
-				    	{
-				    	/*
-					xx[3*nc1]   +=  0.0;
-					xx[3*nc1+1] +=  0.0;
-					xx[3*nc1+2] +=  0.0;
-				    	*/
-					xx[3*nc2]   +=  offsetx;
-					xx[3*nc2+1] +=  offsety;
-				    	/*
-					xx[3*nc2+2] +=  0.0;
-					*/
-					}
-				    else
-				    	{
-				    	/*
-					xx[3*nc1]   +=  0.0;
-					xx[3*nc1+1] +=  0.0;
-					xx[3*nc1+2] +=  0.0;
-				    	*/
-					xx[3*nc2]   +=  offsetx;
-					xx[3*nc2+1] +=  offsety;
-					xx[3*nc2+2] +=  offsetz;
-					}
-				    }
-				else if (file2->status == MBNA_FILE_FIXEDNAV)
-				    {
-				    if (file1->status == MBNA_FILE_FIXEDXYNAV)
-				    	{
-				    	/*
-					xx[3*nc1]   +=  0.0;
-					xx[3*nc1+1] +=  0.0;
-				    	*/
-					xx[3*nc1+2] +=  -offsetz;
-				    	/*
-					xx[3*nc2]   +=  0.0;
-					xx[3*nc2+1] +=  0.0;
-					xx[3*nc2+2] +=  0.0;
-				    	*/
-					}
-				    else if (file1->status == MBNA_FILE_FIXEDZNAV)
-				    	{
-					xx[3*nc1]   +=  -offsetx;
-					xx[3*nc1+1] +=  -offsety;
-				    	/*
-					xx[3*nc1+2] +=  0.0;
-					xx[3*nc2]   +=  0.0;
-					xx[3*nc2+1] +=  0.0;
-					xx[3*nc2+2] +=  0.0;
-				    	*/
-					}
-				    else
-				    	{
-					xx[3*nc1]   +=  -offsetx;
-					xx[3*nc1+1] +=  -offsety;
-					xx[3*nc1+2] +=  -offsetz;
-				    	/*
-					xx[3*nc2]   +=  0.0;
-					xx[3*nc2+1] +=  0.0;
-					xx[3*nc2+2] +=  0.0;
-				    	*/
-					}
-				    }
-				}
-			    }
-			    
-			/* loop over all global ties */
-			for (ifile=0;ifile<project.num_files;ifile++)
-			    {
-			    file = &project.files[ifile];
-			    for (isection=0;isection<file->num_sections;isection++)
-				{
-				section = &file->sections[isection];
-				if (section->global_tie_status != MBNA_TIE_NONE)
-				    {
-				    /* get block id for snav point */
-				    nc1 = file->block;
-    
-				    /* get current offset vector including reduction of block solution */
-				    if (section->global_tie_status != MBNA_TIE_Z)
-					{
-					offsetx = section->global_tie_offset_x_m - (x[3*nc1]   + xx[3*nc1]);
-					offsety = section->global_tie_offset_y_m - (x[3*nc1+1] + xx[3*nc1+1]);
-					
-					xx[3*nc1]   += 0.5 * offsetx;
-					xx[3*nc1+1] += 0.5 * offsety;
-					}
-				    if (section->global_tie_status != MBNA_TIE_XY)
-					{
-					offsetz = section->global_tie_offset_z_m - (x[3*nc1+2] + xx[3*nc1+2]);
-					xx[3*nc1+2] += 0.5 * offsetz;
-					}
-
-//fprintf(stderr,"STAGE 1 - GLOBAL TIE: %1d %2.2d:%2.2d:%2.2d  x: %f %f %f     xx: %f %f %f     offset: %f %f %f\n",
-//section->global_tie_status,ifile,isection,section->global_tie_snav,
-//x[3*nc1],x[3*nc1+1],x[3*nc1+2],xx[3*nc1],xx[3*nc1+1],xx[3*nc1+2],
-//offsetx,offsety,offsetz);
-				    }
-				}
-			    }
-
-			/* calculate 2-norm of perturbation */
-			perturbationsize = 0.0;
-			for (i=0;i<ncols;i++)
-			    {
-			    perturbationsize += xx[i] * xx[i];
-			    }
-			perturbationsize = sqrt(perturbationsize) / ncols;
-
-			/* apply perturbation */
-			for (i=0;i<ncols;i++)
-			    {
-			    x[i] += xx[i];
-			    }
-
-			/* check for convergence */
-			perturbationchange = perturbationsize - perturbationsizeold;
-			convergencecriterea = fabs(perturbationchange) / misfit_initial;
-			if (convergencecriterea < MBNA_CONVERGENCE || iter > MBNA_INTERATION_MAX)
-		    	     done = MB_YES;
-/* fprintf(stderr,"BLOCK INVERT: iter:%d ntie:%d misfit_initial:%f misfit_ties:%f perturbationsize:%g perturbationchange:%g convergencecriterea:%g done:%d\n",
-iter,ntie,misfit_initial,misfit_ties,perturbationsize,perturbationchange,convergencecriterea,done);*/
-
-			if (done == MB_NO)
-		             {
-			     perturbationsizeold = perturbationsize;
-			     iter++;
-			     }
-			}
-
-		    /* if there are no fixed blocks contributing to ties or global ties,
-		    	then get average offsets of blocks not flagged as bad
-			to provide a static offset to move final model to be more consistent
-			with the good blocks than the poorly navigated blocks */
-		    block_offset_avg_x = 0.0;
-		    block_offset_avg_y = 0.0;
-		    block_offset_avg_z = 0.0;
-		    navg = 0;
-		    if (nfixed == 0 && nglobal == 0)
-		    	{
-			for (i=0;i<project.num_blocks;i++)
-			    {
-			    use = MB_YES;
-			    for (j=0;j<project.num_files;j++)
-				    {
-				    file = &project.files[j];
-				    if (file->block == i && file->status == MBNA_FILE_POORNAV)
-					    use = MB_NO;
-				    }
-			    if (use == MB_YES)
-				    {
-				    block_offset_avg_x += x[3 * i];
-				    block_offset_avg_y += x[3 * i + 1];
-				    block_offset_avg_z += x[3 * i + 2];
-				    navg++;
-				    }
-			    }
-			if (navg > 0)
-		    	    {
-			    block_offset_avg_x /= navg;
-			    block_offset_avg_y /= navg;
-			    block_offset_avg_z /= navg;
-			    }
-			}
-/* fprintf(stderr,"Average block offsets: x:%f y:%f z:%f  Used %d of %d blocks\n",
-block_offset_avg_x,block_offset_avg_y,block_offset_avg_z,navg,project.num_blocks); */
-
-/* output solution */
-/* fprintf(stderr,"\nAverage offsets: %f %f %f\n",block_offset_avg_x,block_offset_avg_y,block_offset_avg_z);
-for (i=0;i<ncols/3;i++)
-{
-fprintf(stderr, "Survey block:%d  offsets: %f %f %f\n",
-	    i, x[3*i], x[3*i+1], x[3*i+2]);
-} */
-
-		    /* extract results */
-		    for (i=0;i<project.num_files;i++)
-			{
-			file = &project.files[i];
-			file->block_offset_x = x[3 * file->block] - block_offset_avg_x;
-			file->block_offset_y = x[3 * file->block + 1] - block_offset_avg_y;
-			file->block_offset_z = x[3 * file->block + 2] - block_offset_avg_z;
-/* fprintf(stderr,"file:%d block: %d block offsets: %f %f %f\n",
-i,file->block,file->block_offset_x,file->block_offset_y,file->block_offset_z); */
-			}
-
-		    /* deallocate arrays */
-		    status = mb_freed(mbna_verbose, __FILE__, __LINE__, (void **)&x,&error);
-		    status = mb_freed(mbna_verbose, __FILE__, __LINE__, (void **)&xx,&error);
-		    }
-
-		/*----------------------------------------------------------------*/
-		/* Initialize arrays, solution, perturbation                      */
-		/*----------------------------------------------------------------*/
-
-		/* count dimension of solution guess vector */
-		nnav = 0;
-		nsnav = 0;
-		for (i=0;i<project.num_files;i++)
-		    {
-		    file = &project.files[i];
-		    for (j=0;j<file->num_sections;j++)
-			{
-			section = &file->sections[j];
-			nsnav += section->num_snav - section->continuity;
-			for (isnav=0;isnav<section->num_snav;isnav++)
-			    {
-			    if (section->snav_num_ties[isnav] > 0
-				|| section->global_tie_snav == isnav)
-				{
-				section->snav_invert_id[isnav] = nnav;
-				nnav++;
-				}
-			    }
-			}
-		    }
-
-		/* allocate solution vector x, perturbation vector xx, and average solution vector xa */
-		ncols = ndf * nnav;
-		status = mb_mallocd(mbna_verbose, __FILE__, __LINE__, ncols * sizeof(double), (void **)&x,&error);
-		status = mb_mallocd(mbna_verbose, __FILE__, __LINE__, ncols * sizeof(double), (void **)&xx,&error);
-		status = mb_mallocd(mbna_verbose, __FILE__, __LINE__, ncols * sizeof(double), (void **)&xa,&error);
-		status = mb_mallocd(mbna_verbose, __FILE__, __LINE__, ncols * sizeof(double), (void **)&xs,&error);
-		status = mb_mallocd(mbna_verbose, __FILE__, __LINE__, ncols * sizeof(double), (void **)&xw,&error);
-		inav = 0;
-		for (i=0;i<project.num_files;i++)
-		    {
-		    file = &project.files[i];
-		    for (j=0;j<file->num_sections;j++)
-			{
-			section = &file->sections[j];
-			for (isnav=0;isnav<section->num_snav;isnav++)
-			    {
-			    if (section->snav_num_ties[isnav] > 0
-				|| section->global_tie_snav == isnav)
-				{
-				x[ndf * inav] = 0.0;
-				x[ndf * inav + 1] = 0.0;
-				x[ndf * inav + 2] = 0.0;
-				xx[ndf * inav] = 0.0;
-				xx[ndf * inav + 1] = 0.0;
-				xx[ndf * inav + 2] = 0.0;
-				xa[ndf * inav] = file->block_offset_x - block_offset_avg_x;
-				xa[ndf * inav + 1] = file->block_offset_y - block_offset_avg_y;
-				xa[ndf * inav + 2] = file->block_offset_z - block_offset_avg_z;
-				inav++;
-				}
-			    }
-			}
-		    }
-
-		/* calculate initial normalized misfit */
-		misfit_ties_initial = 0.0;
-		misfit_norm_initial = 0.0;
-		nmisfit = 0;
-		for (icrossing=0;icrossing<project.num_crossings;icrossing++)
-		    {
-		    crossing = &project.crossings[icrossing];
-
-		    /* use only set crossings */
-		    if (crossing->status == MBNA_CROSSING_STATUS_SET)
-		    for (j=0;j<crossing->num_ties;j++)
-			{
-			/* get tie */
-			tie = (struct mbna_tie *) &crossing->ties[j];
-
-			/* get absolute id for first snav point */
-			file1 = &project.files[crossing->file_id_1];
-			section1 = &file1->sections[crossing->section_1];
-			nc1 = section1->snav_invert_id[tie->snav_1];
-
-			/* get absolute id for second snav point */
-			file2 = &project.files[crossing->file_id_2];
-			section2 = &file2->sections[crossing->section_2];
-			nc2 = section2->snav_invert_id[tie->snav_2];
-if (nc1 > nsnav - 1 || nc2 > nsnav -1
-|| nc1 < 0 || nc2 < 0)
-fprintf(stderr, "BAD TIE snav ID: %d %d %d\n", nc1, nc2, nsnav);
-
-			/* get offset after removal of block solution */
-			offsetx = tie->offset_x_m - (file2->block_offset_x - file1->block_offset_x);
-			offsety = tie->offset_y_m - (file2->block_offset_y - file1->block_offset_y);
-			offsetz = tie->offset_z_m - (file2->block_offset_z - file1->block_offset_z);
-
-			if (tie->status != MBNA_TIE_Z)
-			    {
-			    /* get long axis misfit */
-			    misfit = (offsetx * tie->sigmax1[0]
-					    + offsety * tie->sigmax1[1]
-					    + offsetz * tie->sigmax1[2]);
-			    misfit_ties_initial += misfit * misfit;
-			    misfit_norm_initial += misfit * misfit / tie->sigmar1 / tie->sigmar1;
-			    nmisfit++;
-
-			    /* get horizontal axis misfit */
-			    misfit = (offsetx * tie->sigmax2[0]
-					    + offsety * tie->sigmax2[1]
-					    + offsetz * tie->sigmax2[2]);
-			    misfit_ties_initial += misfit * misfit;
-			    misfit_norm_initial += misfit * misfit / tie->sigmar2 / tie->sigmar2;
-			    nmisfit++;
-			    }
-
-			if (tie->status != MBNA_TIE_XY)
-			    {
-			    /* get semi-vertical axis misfit */
-			    misfit = (offsetx * tie->sigmax3[0]
-					    + offsety * tie->sigmax3[1]
-					    + offsetz * tie->sigmax3[2]);
-			    misfit_ties_initial += misfit * misfit;
-			    misfit_norm_initial += misfit * misfit / tie->sigmar3 / tie->sigmar3;
-			    nmisfit++;
-			    }
-			}
-		    }
-		for (ifile=0;ifile<project.num_files;ifile++)
-		    {
-		    /* get file */
-		    file = &project.files[ifile];
-		    for (isection=0;isection<file->num_sections;isection++)
-			{
-			/* get section */
-			section = &file->sections[isection];
-			if (section->global_tie_status != MBNA_TIE_NONE)
-			    {
-			    /* get absolute id for snav point */
-			    nc1 = section->snav_invert_id[section->global_tie_snav];
-if (nc1 > nsnav - 1 || nc1 < 0)
-fprintf(stderr, "BAD GLOBAL TIE snav ID: %d %d\n", nc1, nsnav);
-
-			    /* get offset after removal of block solution */
-			    offsetx = section->global_tie_offset_x_m - file->block_offset_x;
-			    offsety = section->global_tie_offset_y_m - file->block_offset_y;
-			    offsetz = section->global_tie_offset_z_m - file->block_offset_z;
-	    
-			    if (section->global_tie_status != MBNA_TIE_Z)
-				{
-				/* get x axis misfit */
-				misfit = offsetx;
-				misfit_ties_initial += misfit * misfit;
-				misfit_norm_initial += misfit * misfit / section->global_tie_xsigma / section->global_tie_xsigma;
-				nmisfit++;
-
-				/* get y axis misfit */
-				misfit = offsety;
-				misfit_ties_initial += misfit * misfit;
-				misfit_norm_initial += misfit * misfit / section->global_tie_ysigma / section->global_tie_ysigma;
-				nmisfit++;
-				}
-
-			    if (section->global_tie_status != MBNA_TIE_XY)
-				{
-				/* get z axis misfit */
-				misfit = offsetz;
-				misfit_ties_initial += misfit * misfit;
-				misfit_norm_initial += misfit * misfit / section->global_tie_zsigma / section->global_tie_zsigma;
-				nmisfit++;
-				}
-			    }
-			}
-		    }
-		misfit_ties_initial = sqrt(misfit_ties_initial) / nmisfit;
-		misfit_norm_initial = sqrt(misfit_norm_initial) / nmisfit;
-
-		/*----------------------------------------------------------------*/
-		/* Step 2 - construct "average" model satisfying ties with        */
-		/*     fixed data (if needed) - this gets pulled out of the       */
-		/*     data along with the average block offsets.                 */
-		/*----------------------------------------------------------------*/
-		if (nfixed > 0 || nglobal > 0)
-		    {
-		    /* set message dialog on */
-		    sprintf(message,"Getting average offsets relative to fixed data...");
-		    do_message_update(message);
-
-		    /* allocate some extra arrays */
-		    status = mb_mallocd(mbna_verbose, __FILE__, __LINE__, nnav * sizeof(int), (void **)&nxs,&error);
-		    for (inav=0;inav<nnav;inav++)
-		    	{
-			nxs[inav] = 0;
-			xs[ndf * inav] = 0.0;
-			xs[ndf * inav + 1] = 0.0;
-			xs[ndf * inav + 2] = 0.0;
-			xw[ndf * inav] = 0.0;
-			xw[ndf * inav + 1] = 0.0;
-			xw[ndf * inav + 2] = 0.0;
-			}
-
-		    /* loop over all ties, working only with ties including fixed sections */
-		    for (icrossing=0;icrossing<project.num_crossings;icrossing++)
-			{
-			crossing = &project.crossings[icrossing];
-
-			/* use only set crossings */
-			if (crossing->status == MBNA_CROSSING_STATUS_SET)
-			for (jtie=0;jtie<crossing->num_ties;jtie++)
-			    {
-			    /* get tie */
-			    tie = (struct mbna_tie *) &crossing->ties[jtie];
-
-			    /* get absolute id for first snav point */
-			    file1 = &project.files[crossing->file_id_1];
-			    section = &file1->sections[crossing->section_1];
-			    nc1 = section->snav_invert_id[tie->snav_1];
-
-			    /* get absolute id for second snav point */
-			    file2 = &project.files[crossing->file_id_2];
-			    section = &file2->sections[crossing->section_2];
-			    nc2 = section->snav_invert_id[tie->snav_2];
-
-			    /* only work with ties in which one section is fixed */
-			    if ((file1->status == MBNA_FILE_FIXEDNAV && file2->status != MBNA_FILE_FIXEDNAV)
-			    	|| (file1->status != MBNA_FILE_FIXEDNAV && file2->status == MBNA_FILE_FIXEDNAV))
-				{
-			        /* get current offset vector including reduction of block solution */
-				if (tie->status != MBNA_TIE_Z)
-				    {
-				    offsetx = tie->offset_x_m - (xa[3*nc2] - xa[3*nc1]);
-				    offsety = tie->offset_y_m - (xa[3*nc2+1] - xa[3*nc1+1]);
-				    }
-				else
-				    {
-				    offsetx = 0.0;
-				    offsety = 0.0;
-				    }
-				if (tie->status != MBNA_TIE_XY)
-				    {
-				    offsetz = tie->offset_z_m - (xa[3*nc2+2] - xa[3*nc1+2]);
-				    }
-				else
-				    {
-				    offsetz = 0.0;
-				    }
-/* fprintf(stderr,"STAGE 2 START: icrossing:%d jtie:%d nc1:%d %d nc2:%d %d offsets: %f %f %f\n",
-icrossing,jtie,nc1,file1->status,nc2,file2->status,offsetx,offsety,offsetz);*/
-
-				/* figure out how far each tied nav point is from the unfixed point in the current tie */
-		    		for (inav=0;inav<nnav;inav++)
-				    nxs[inav] = 0;
-
-				/* first set the unfixed affect nav point */
-				if (file1->status == MBNA_FILE_FIXEDNAV)
-				    {
-				    nxs[nc2] = 1;
-				    }
-				else if (file2->status == MBNA_FILE_FIXEDNAV)
-				    {
-				    nxs[nc1] = 1;
-				    offsetx *= -1.0;
-				    offsety *= -1.0;
-				    offsetz *= -1.0;
-				    }
-
-				/* now loop over all nav points repeatedly */
-				done = MB_NO;
-				while (done == MB_NO)
-				    {
-				    nchange = 0;
-
-				    /* run forward through the data */
-				    inav = 0;
-				    nseq = 0;
-			    	    nseqlast = 0;
-				    for (i=0;i<project.num_files;i++)
-					{
-					file = &project.files[i];
-					for (j=0;j<file->num_sections;j++)
-					    {
-					    section = &file->sections[j];
-					    if (section->continuity == MB_NO)
-			    	    		nseq = 0;
-					    for (isnav=0;isnav<section->num_snav;isnav++)
-						{
-						if (section->snav_num_ties[isnav] > 0)
-						    {
-/* fprintf(stderr,"i:%d j:%d isnav:%d inav:%d nseqqqlast:%d nseq:%d file->status:%d nxs:%d %d",
-i,j,isnav,inav,nseqlast,nseq,file->status,nxs[inav-1],nxs[inav]); */
-						    if (inav > 0 && nseq > 0 && file->status != MBNA_FILE_FIXEDNAV
-						    	&& nxs[inav-1] > 0 && (nxs[inav-1] < nxs[inav] - 1 || nxs[inav] == 0))
-						    	{
-							nxs[inav] = nxs[inav-1] + 1;
-							nchange++;
-/* fprintf(stderr," CHANGE nxs:%d %d",nxs[inav-1],nxs[inav]); */
-							}
-/* fprintf(stderr,"\n"); */
-
-						    /* increment sequence counters */
-						    nseqlast = nseq;
-						    nseq++;
-						    inav++;
-						    }
-						}
-					    }
-					}
-
-/* fprintf(stderr,"\n"); */
-				    /* run backward through the data */
-			    	    nseq = 0;
-			    	    nseqlast = 0;
-				    for (i=project.num_files-1;i>=0;i--)
-					{
-					file = &project.files[i];
-					for (j=file->num_sections-1;j>=0;j--)
-					    {
-					    section = &file->sections[j];
-					    for (isnav=section->num_snav-1;isnav>=0;isnav--)
-						{
-						if (section->snav_num_ties[isnav] > 0)
-						    {
-						    inav--;
-/* fprintf(stderr,"i:%d j:%d isnav:%d inav:%d nseqqqlast:%d nseq:%d file->status:%d nxs:%d %d",
-i,j,isnav,inav,nseqlast,nseq,file->status,nxs[inav],nxs[inav+1]); */
-						    if (inav >= 0 && nseqlast > 0 && file->status != MBNA_FILE_FIXEDNAV
-						    	&& nxs[inav+1] > 0 && (nxs[inav+1] < nxs[inav] - 1 || nxs[inav] == 0))
-						    	{
-							nxs[inav] = nxs[inav+1] + 1;
-							nchange++;
-/* fprintf(stderr," CHANGE nxs:%d %d",nxs[inav],nxs[inav+1]); */
-							}
-/* fprintf(stderr,"\n"); */
-
-						    /* increment sequence counters */
-						    nseqlast = nseq;
-						    nseq++;
-						    }
-						}
-					    if (section->continuity == MB_NO)
-			    	    		nseq = 0;
-					    }
-					}
-
-				    /* run through ties */
-				    for (i=0;i<project.num_crossings;i++)
-					{
-					/* use only set crossings */
-					if (project.crossings[i].status == MBNA_CROSSING_STATUS_SET)
-					for (j=0;j<project.crossings[i].num_ties;j++)
-					    {
-					    /* get tie */
-					    tie = (struct mbna_tie *) &project.crossings[i].ties[j];
-
-					    /* get absolute id for first snav point */
-					    file1 = &project.files[project.crossings[i].file_id_1];
-					    section = &file1->sections[project.crossings[i].section_1];
-					    nc1 = section->snav_invert_id[tie->snav_1];
-
-					    /* get absolute id for second snav point */
-					    file2 = &project.files[project.crossings[i].file_id_2];
-					    section = &file2->sections[project.crossings[i].section_2];
-					    nc2 = section->snav_invert_id[tie->snav_2];
-
-					    /* check for nav points needing closeness setting */
-					    if (nxs[nc1] > 0 && nxs[nc2] == 0)
-					    	{
-						if (file2->status != MBNA_FILE_FIXEDNAV)
-						    {
-						    nxs[nc2] = nxs[nc1] + 1;
-						    nchange++;
-						    }
-						}
-					    else if (nxs[nc1] > 0 && nxs[nc2] > nxs[nc1] + 1)
-					    	{
-						if (file2->status != MBNA_FILE_FIXEDNAV)
-						    {
-						    nxs[nc2] = nxs[nc1] + 1;
-						    nchange++;
-						    }
-						}
-					    else if (nxs[nc2] > 0 && nxs[nc1] == 0)
-					    	{
-						if (file1->status != MBNA_FILE_FIXEDNAV)
-						    {
-						    nxs[nc1] = nxs[nc2] + 1;
-						    nchange++;
-						    }
-						}
-					    else if (nxs[nc2] > 0 && nxs[nc1] > nxs[nc2] + 1)
-					    	{
-						if (file1->status != MBNA_FILE_FIXEDNAV)
-						    {
-						    nxs[nc1] = nxs[nc2] + 1;
-						    nchange++;
-						    }
-						}
-					    }
-					}
-
-				    /* check for done */
-			    	    if (nchange == 0)
-				    	done = MB_YES;
-/* fprintf(stderr,"icrossing:%d nchange:%d done:%d\n",icrossing,nchange,done); */
-				    }
-/* fprintf(stderr,"\n");*/
-
-				/* now loop over the data adding the offset with weighting inversely set by the
-					"distance" from each nav point to the offset point */
-				for (inav=0;inav<nnav;inav++)
-				    {
-/* fprintf(stderr,"inav:%d nxs:%d\n",inav,nxs[inav]); */
-				    if (nxs[inav] > 0)
-				    	{
-					xs[ndf * inav]     += offsetx / (nxs[inav] * nxs[inav]);
-					xs[ndf * inav + 1] += offsety / (nxs[inav] * nxs[inav]);
-					xs[ndf * inav + 2] += offsetz / (nxs[inav] * nxs[inav]);
-					xw[ndf * inav]     += 1.0 / (nxs[inav] * nxs[inav]);
-					xw[ndf * inav + 1] += 1.0 / (nxs[inav] * nxs[inav]);
-					xw[ndf * inav + 2] += 1.0 / (nxs[inav] * nxs[inav]);
-					}
-				    }
-				}
-			    }
-			}
-			
-		    /* loop over all global ties */
-		    for (ifile=0;ifile<project.num_files;ifile++)
-			{
-			file = &project.files[ifile];
-			for (isection=0;isection<file->num_sections;isection++)
-			    {
-			    section = &file->sections[isection];
-			    if (section->global_tie_status != MBNA_TIE_NONE)
-				{
-				/* get absolute id for snav point */
-				nc1 = section->snav_invert_id[section->global_tie_snav];
-
-			        /* get current offset vector including reduction of block solution */
-				offsetx = section->global_tie_offset_x_m - xa[3*nc1];
-				offsety = section->global_tie_offset_y_m - xa[3*nc1+1];
-				offsetz = section->global_tie_offset_z_m - xa[3*nc1+2];
-/*fprintf(stderr,"STAGE 2 - GLOBAL TIE: %1d %2.2d:%2.2d:%2.2d  tie: %f %f %f  model offset: %f %f %f\n",
-section->global_tie_status,ifile,isection,section->global_tie_snav,
-section->global_tie_offset_x_m,section->global_tie_offset_y_m,section->global_tie_offset_z_m,
-offsetx,offsety,offsetz); */
-
-				/* figure out how far each tied nav point is from the global tie point */
-		    		for (inav=0;inav<nnav;inav++)
-				    nxs[inav] = 0;
-
-				/* first set the global tied nav point */
-				nxs[nc1] = 1;
-
-				/* now loop over all nav points repeatedly */
-				done = MB_NO;
-				while (done == MB_NO)
-				    {
-				    nchange = 0;
-
-				    /* run forward through the data */
-				    inav = 0;
-				    nseq = 0;
-			    	    nseqlast = 0;
-				    for (i=0;i<project.num_files;i++)
-					{
-					file1 = &project.files[i];
-					for (j=0;j<file1->num_sections;j++)
-					    {
-					    section1 = &file1->sections[j];
-					    if (section1->continuity == MB_NO)
-			    	    		nseq = 0;
-					    for (isnav=0;isnav<section1->num_snav;isnav++)
-						{
-						if (section1->snav_num_ties[isnav] > 0)
-						    {
-						    if (inav > 0 && nseq > 0 && file1->status != MBNA_FILE_FIXEDNAV
-						    	&& nxs[inav-1] > 0 && (nxs[inav-1] < nxs[inav] - 1 || nxs[inav] == 0))
-						    	{
-							nxs[inav] = nxs[inav-1] + 1;
-							nchange++;
-							}
-
-						    /* increment sequence counters */
-						    nseqlast = nseq;
-						    nseq++;
-						    inav++;
-						    }
-						}
-					    }
-					}
-
-				    /* run backward through the data */
-			    	    nseq = 0;
-			    	    nseqlast = 0;
-				    for (i=project.num_files-1;i>=0;i--)
-					{
-					file1 = &project.files[i];
-					for (j=file1->num_sections-1;j>=0;j--)
-					    {
-					    section1 = &file1->sections[j];
-					    for (isnav=section1->num_snav-1;isnav>=0;isnav--)
-						{
-						if (section1->snav_num_ties[isnav] > 0)
-						    {
-						    inav--;
-						    if (inav >= 0 && nseqlast > 0 && file1->status != MBNA_FILE_FIXEDNAV
-						    	&& nxs[inav+1] > 0 && (nxs[inav+1] < nxs[inav] - 1 || nxs[inav] == 0))
-						    	{
-							nxs[inav] = nxs[inav+1] + 1;
-							nchange++;
-							}
-
-						    /* increment sequence counters */
-						    nseqlast = nseq;
-						    nseq++;
-						    }
-						}
-					    if (section1->continuity == MB_NO)
-			    	    		nseq = 0;
-					    }
-					}
-
-				    /* run through ties */
-				    for (i=0;i<project.num_crossings;i++)
-					{
-					/* use only set crossings */
-					if (project.crossings[i].status == MBNA_CROSSING_STATUS_SET)
-					for (j=0;j<project.crossings[i].num_ties;j++)
-					    {
-					    /* get tie */
-					    tie = (struct mbna_tie *) &project.crossings[i].ties[j];
-
-					    /* get absolute id for first snav point */
-					    file1 = &project.files[project.crossings[i].file_id_1];
-					    section1 = &file1->sections[project.crossings[i].section_1];
-					    nc1 = section1->snav_invert_id[tie->snav_1];
-
-					    /* get absolute id for second snav point */
-					    file2 = &project.files[project.crossings[i].file_id_2];
-					    section2 = &file2->sections[project.crossings[i].section_2];
-					    nc2 = section2->snav_invert_id[tie->snav_2];
-
-					    /* check for nav points needing closeness setting */
-					    if (nxs[nc1] > 0 && nxs[nc2] == 0)
-					    	{
-						if (file2->status != MBNA_FILE_FIXEDNAV)
-						    {
-						    nxs[nc2] = nxs[nc1] + 1;
-						    nchange++;
-						    }
-						}
-					    else if (nxs[nc1] > 0 && nxs[nc2] > nxs[nc1] + 1)
-					    	{
-						if (file2->status != MBNA_FILE_FIXEDNAV)
-						    {
-						    nxs[nc2] = nxs[nc1] + 1;
-						    nchange++;
-						    }
-						}
-					    else if (nxs[nc2] > 0 && nxs[nc1] == 0)
-					    	{
-						if (file1->status != MBNA_FILE_FIXEDNAV)
-						    {
-						    nxs[nc1] = nxs[nc2] + 1;
-						    nchange++;
-						    }
-						}
-					    else if (nxs[nc2] > 0 && nxs[nc1] > nxs[nc2] + 1)
-					    	{
-						if (file1->status != MBNA_FILE_FIXEDNAV)
-						    {
-						    nxs[nc1] = nxs[nc2] + 1;
-						    nchange++;
-						    }
-						}
-					    }
-					}
-
-				    /* check for done */
-			    	    if (nchange == 0)
-				    	done = MB_YES;
-				    }
-
-				/* now loop over the data adding the offset with weighting inversely set by the
-					"distance" from each nav point to the offset point */
-				for (inav=0;inav<nnav;inav++)
-				    {
-				    if (nxs[inav] > 0)
-				    	{
-					if (section->global_tie_status != MBNA_TIE_Z)
-					    {
-					    xs[ndf * inav]     += offsetx / (nxs[inav] * nxs[inav]);
-					    xs[ndf * inav + 1] += offsety / (nxs[inav] * nxs[inav]);
-					    xw[ndf * inav]     += 1.0 / (nxs[inav] * nxs[inav]);
-					    xw[ndf * inav + 1] += 1.0 / (nxs[inav] * nxs[inav]);
-					    }
-					if (section->global_tie_status != MBNA_TIE_XY)
-					    {
-					    xs[ndf * inav + 2] += offsetz / (nxs[inav] * nxs[inav]);
-					    xw[ndf * inav + 2] += 1.0 / (nxs[inav] * nxs[inav]);
-					    }
-					}
-				    }
-				}
-			    }
-			}
-
-		    /* construct average offset model */
-		    for (inav=0;inav<nnav;inav++)
-			{
-			if (xw[ndf * inav] > 0.0)
-			    xa[ndf * inav] += xs[ndf * inav] / xw[ndf * inav];
-			if (xw[ndf * inav + 1] > 0.0)
-			    xa[ndf * inav + 1] += xs[ndf * inav + 1] / xw[ndf * inav + 1];
-			if (xw[ndf * inav + 2] > 0.0)
-			    xa[ndf * inav + 2] += xs[ndf * inav + 2] / xw[ndf * inav + 2];
-//fprintf(stderr,"XA CALC:  xs: %f %f %f  xw: %f %f %f  xa: %f %f %f\n",
-//xs[ndf*inav],xs[ndf*inav+1],xs[ndf*inav+2],xw[ndf*inav],xw[ndf*inav+1],xw[ndf*inav+2],xa[ndf*inav],xa[ndf*inav+1],xa[ndf*inav+2]);
-			}
-
-		    /* save solution */
-		    k = 0;
-		    for (i=0;i<project.num_files;i++)
-			{
-			file = &project.files[i];
-			for (j=0;j<file->num_sections;j++)
-			    {
-			    section = &file->sections[j];
-			    for (isnav=0;isnav<section->num_snav;isnav++)
-				{
-				if (section->snav_num_ties[isnav] > 0
-				    || section->global_tie_snav == isnav)
-				    {
-				    k = section->snav_invert_id[isnav];
-				    section->snav_lon_offset[isnav] = (x[3*k] + xa[3*k]) * mbna_mtodeglon;
-/* fprintf(stderr,"i:%d j:%d isnav:%d k:%d x[3*k]:%f xa[3*k]:%f mbna_mtodeglon:%f section->snav_lon_offset[isnav]:%f\n",
-i,j,isnav,k,x[3*k],xa[3*k],mbna_mtodeglon,section->snav_lon_offset[isnav]); */
-				    section->snav_lat_offset[isnav] = (x[3*k+1] + xa[3*k+1]) * mbna_mtodeglat;
-/* fprintf(stderr,"i:%d j:%d isnav:%d k:%d x[3*k+1]:%f xa[3*k+1]:%f mbna_mtodeglat:%f section->snav_lat_offset[isnav]:%f\n",
-i,j,isnav,k,x[3*k+1],xa[3*k+1],mbna_mtodeglat,section->snav_lat_offset[isnav]); */
-				    section->snav_z_offset[isnav] = (x[3*k+2] + xa[3*k+2]);
-/* fprintf(stderr,"i:%d j:%d isnav:%d k:%d x[3*k+2]:%f xa[3*k+2]:%f section->snav_z_offset[isnav]:%f\n\n",
-i,j,isnav,k,x[3*k+2],xa[3*k+2],section->snav_z_offset[isnav]); */
-				    }
-				}
-			    }
-			}
-
-		    /* interpolate the solution */
-		    mbnavadjust_interpolatesolution();
-
-		    /* save interpolated solution */
-		    k = 0;
-		    for (i=0;i<project.num_files;i++)
-			{
-			file = &project.files[i];
-			for (j=0;j<file->num_sections;j++)
-			    {
-			    section = &file->sections[j];
-			    for (isnav=0;isnav<section->num_snav;isnav++)
-				{
-				section->snav_lon_offset[isnav] = section->snav_lon_offset_int[isnav];
-				section->snav_lat_offset[isnav] = section->snav_lat_offset_int[isnav];
-				section->snav_z_offset[isnav] = section->snav_z_offset_int[isnav];
-				}
-			    }
-			}
-
-		    /* update model plot */
-		    if (project.modelplot == MB_YES && iter % 25 == 0)
-		    	mbnavadjust_modelplot_plot();
-
-		    /* output goodness of fit for ties including fixed sections */
-		    for (icrossing=0;icrossing<project.num_crossings;icrossing++)
-			{
-			crossing = &project.crossings[icrossing];
-
-			/* use only set crossings */
-			if (crossing->status == MBNA_CROSSING_STATUS_SET)
-			for (jtie=0;jtie<crossing->num_ties;jtie++)
-			    {
-			    /* get tie */
-			    tie = (struct mbna_tie *) &crossing->ties[jtie];
-
-			    /* get absolute id for first snav point */
-			    file1 = &project.files[crossing->file_id_1];
-			    section = &file1->sections[crossing->section_1];
-			    nc1 = section->snav_invert_id[tie->snav_1];
-
-			    /* get absolute id for second snav point */
-			    file2 = &project.files[crossing->file_id_2];
-			    section = &file2->sections[crossing->section_2];
-			    nc2 = section->snav_invert_id[tie->snav_2];
-
-			    /* only work with ties in which one section is fixed */
-			    if ((file1->status == MBNA_FILE_FIXEDNAV && file2->status != MBNA_FILE_FIXEDNAV)
-			    	|| (file1->status != MBNA_FILE_FIXEDNAV && file2->status == MBNA_FILE_FIXEDNAV))
-				{
-			        /* get current offset vector including reduction of block solution */
-				offsetx = tie->offset_x_m - (xa[3*nc2] - xa[3*nc1]);
-				offsety = tie->offset_y_m - (xa[3*nc2+1] - xa[3*nc1+1]);
-				offsetz = tie->offset_z_m - (xa[3*nc2+2] - xa[3*nc1+2]);
-//fprintf(stderr,"STAGE 2 RESULT - CROSSING TIE: icrossing:%d jtie:%d nc1:%d %d nc2:%d %d offsets: %f %f %f\n",
-//icrossing,jtie,nc1,file1->status,nc2,file2->status,offsetx,offsety,offsetz);
-				}
-			    }
-			}
-
-		    /* output goodness of fit for global ties */
-		    for (ifile=0;ifile<project.num_files;ifile++)
-			{
-			file = &project.files[ifile];
-			for (isection=0;isection<file->num_sections;isection++)
-			    {
-			    /* get section */
-			    section = (struct mbna_section *) &file->sections[isection];
-			    
-			    /* only work with set global ties */
-			    if (section->global_tie_status != MBNA_TIE_NONE)
-				{
-				/* get absolute id for first snav point */
-				nc1 = section->snav_invert_id[section->global_tie_snav];
-
-//fprintf(stderr,"STAGE 2 RESULT - GLOBAL TIE: %2.2d:%2.2d:%2.2d  tie: \n",
-//ifile,isection,section->global_tie_snav);
-//if (section->global_tie_status != MBNA_TIE_Z)
-//fprintf(stderr,"x: %f y:%f ",section->global_tie_offset_x_m,section->global_tie_offset_y_m);
-//if (section->global_tie_status != MBNA_TIE_XY)
-//fprintf(stderr,"z:%f ",section->global_tie_offset_z_m);
-//fprintf(stderr,"  model offset: ");
-
-			        /* get current offset vector including reduction of block solution */
-				if (section->global_tie_status != MBNA_TIE_Z)
-				    {
-				    offsetx = section->global_tie_offset_x_m - xa[3*nc1];
-				    offsety = section->global_tie_offset_y_m - xa[3*nc1+1];
-//fprintf(stderr,"x: %f y:%f ",offsetx,offsety);
-				    }
-				if (section->global_tie_status != MBNA_TIE_XY)
-				    {
-				    offsetz = section->global_tie_offset_z_m - xa[3*nc1+2];
-//fprintf(stderr,"z:%f ",offsetz);	
-				    }
-				}
-			    }
-			}
-
-		    /* deallocate arrays */
-		    status = mb_freed(mbna_verbose, __FILE__, __LINE__, (void **)&nxs,&error);
-		    }
-
-
-		/*----------------------------------------------------------------*/
-		/* Step 3 - invert for model satisfying all nav ties              */
-		/*----------------------------------------------------------------*/
-
-		/* loop until convergence */
-		done = MB_NO;
-		iter = 0;
-		perturbationsizeold = misfit_ties_initial;
-		mbna_smoothweight = pow(10.0, project.smoothing) * mbna_offsetweight;
-		while (done == MB_NO)
-		    {
-		    /* zero smoothed adjustment vector solution */
-		    for (i=0;i<ncols;i++)
-			{
-			xx[i] = 0.0;
-			xs[i] = 0.0;
-			xw[i] = 0.0;
-			}
-
-		    /* loop over each crossing, applying offsets evenly to both points */
-		    for (icrossing=0;icrossing<project.num_crossings;icrossing++)
-			{
-			crossing = &project.crossings[icrossing];
-
-			/* use only set crossings */
-			if (crossing->status == MBNA_CROSSING_STATUS_SET)
-			for (j=0;j<crossing->num_ties;j++)
-			    {
-			    /* get tie */
-			    tie = (struct mbna_tie *) &crossing->ties[j];
-
-			    /* get absolute id for first snav point */
-			    file1 = &project.files[crossing->file_id_1];
-			    section1 = &file1->sections[crossing->section_1];
-			    nc1 = section1->snav_invert_id[tie->snav_1];
-
-			    /* get absolute id for second snav point */
-			    file2 = &project.files[crossing->file_id_2];
-			    section2 = &file2->sections[crossing->section_2];
-			    nc2 = section2->snav_invert_id[tie->snav_2];
-if (file1->sections[crossing->section_1].snav_time_d[tie->snav_1] == file2->sections[crossing->section_2].snav_time_d[tie->snav_2])
-fprintf(stderr,"ZERO TIME BETWEEN TIED POINTS!!  file:section:snav - %d:%d:%d   %d:%d:%d  DIFF:%f\n",
-	crossing->file_id_1,crossing->section_1,tie->snav_1,
-	crossing->file_id_2,crossing->section_2,tie->snav_2,
-	(file1->sections[crossing->section_1].snav_time_d[tie->snav_1]
-	 - file2->sections[crossing->section_2].snav_time_d[tie->snav_2]));
-
-			    /* get current offset vector including reduction of block solution */
-			    if (tie->status != MBNA_TIE_Z)
-			        {
-				offsetx = tie->offset_x_m - (xa[3*nc2] - xa[3*nc1]) - (x[3*nc2] - x[3*nc1]);
-				offsety = tie->offset_y_m - (xa[3*nc2+1] - xa[3*nc1+1]) - (x[3*nc2+1] - x[3*nc1+1]);
-				}
-			    else
-			        {
-				offsetx = 0.0;
-				offsety = 0.0;
-				}
-			    if (tie->status != MBNA_TIE_XY)
-			        {
-				offsetz = tie->offset_z_m - (xa[3*nc2+2] - xa[3*nc1+2]) - (x[3*nc2+2] - x[3*nc1+2]);
-				}
-			    else
-			        {
-				offsetz = 0.0;
-				}
-			    offsetr = sqrt(offsetx * offsetx + offsety * offsety + offsetz * offsetz);
-
-			    /* deal with each component of the error ellipse
-			    	- project offset vector onto each component by dot-product
-				- weight inversely by size of error for that component */
-
-			    /* deal with long axis */
-			    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-				projected_offset = offsetx * tie->sigmax1[0]
-						+ offsety * tie->sigmax1[1]
-						+ offsetz * tie->sigmax1[2];
-			    else
-				projected_offset = offsetx * tie->sigmax1[0]
-						+ offsety * tie->sigmax1[1];
-			    if (fabs(tie->sigmar1) > 0.0)
-			    	{
-				xyweight = sqrt(mbna_offsetweight / tie->sigmar1);
-				zweight = sqrt(mbna_offsetweight / mbna_zweightfactor / tie->sigmar1);
-				}
-			    else
-			    	{
-				xyweight = 0.0;
-			    	zweight = 0.0;
-				}
-//zweight = 0.0;
-
-			    /* deal with fixed, good, or poor status of sections */
-			    if (file1->status == file2->status)
-			    	{
-				if (file1->status == MBNA_FILE_GOODNAV || file1->status == MBNA_FILE_POORNAV)
-				    {
-				    xs[3*nc1]   += -0.5 * xyweight * projected_offset * tie->sigmax1[0];
-				    xs[3*nc1+1] += -0.5 * xyweight * projected_offset * tie->sigmax1[1];
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc1+2] += -0.5 * zweight * projected_offset * tie->sigmax1[2];
-				    xs[3*nc2]   +=  0.5 * xyweight * projected_offset * tie->sigmax1[0];
-				    xs[3*nc2+1] +=  0.5 * xyweight * projected_offset * tie->sigmax1[1];
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc2+2] +=  0.5 * zweight * projected_offset * tie->sigmax1[2];				    
-				    }
-				else if (file1->status == MBNA_FILE_FIXEDXYNAV)
-				    {
-				    /*
-				    xs[3*nc1]   +=  0.0;
-				    xs[3*nc1+1] +=  0.0;
-				    */
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc1+2] += -0.5 * zweight * projected_offset * tie->sigmax1[2];
-				    /*
-				    xs[3*nc2]   +=  0.0;
-				    xs[3*nc2+1] +=  0.0;
-				    */
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc2+2] +=  0.5 * zweight * projected_offset * tie->sigmax1[2];
-				    }
-				else if (file1->status == MBNA_FILE_FIXEDZNAV)
-				    {
-				    xs[3*nc1]   += -0.5 * xyweight * projected_offset * tie->sigmax1[0];
-				    xs[3*nc1+1] += -0.5 * xyweight * projected_offset * tie->sigmax1[1];
-				    /*
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc1+2] +=  0.0;
-				    */
-				    xs[3*nc2]   +=  0.5 * xyweight * projected_offset * tie->sigmax1[0];
-				    xs[3*nc2+1] +=  0.5 * xyweight * projected_offset * tie->sigmax1[1];
-				    /*
-				    xs[3*nc2+2] +=  0.0;
-				    */
-				    }
-				}
-			    else if (file1->status == MBNA_FILE_GOODNAV)
-			    	{
-				if (file2->status == MBNA_FILE_POORNAV)
-				    {
-				    xs[3*nc1]   += -0.005 * xyweight * projected_offset * tie->sigmax1[0];
-				    xs[3*nc1+1] += -0.005 * xyweight * projected_offset * tie->sigmax1[1];
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc1+2] += -0.005 * zweight * projected_offset * tie->sigmax1[2];
-				    xs[3*nc2]   +=  0.995 * xyweight * projected_offset * tie->sigmax1[0];
-				    xs[3*nc2+1] +=  0.995 * xyweight * projected_offset * tie->sigmax1[1];
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc2+2] +=  0.995 * zweight * projected_offset * tie->sigmax1[2];
-				    }
-				else if (file2->status == MBNA_FILE_FIXEDNAV)
-				    {
-				    xs[3*nc1]   += -xyweight * projected_offset * tie->sigmax1[0];
-				    xs[3*nc1+1] += -xyweight * projected_offset * tie->sigmax1[1];
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc1+2] += -zweight * projected_offset * tie->sigmax1[2];
-				    /*
-				    xs[3*nc2]   +=  0.0;
-				    xs[3*nc2+1] +=  0.0;
-				    xs[3*nc2+2] +=  0.0;
-				    */
-				    }
-				else if (file2->status == MBNA_FILE_FIXEDXYNAV)
-				    {
-				    xs[3*nc1]   += -xyweight * projected_offset * tie->sigmax1[0];
-				    xs[3*nc1+1] += -xyweight * projected_offset * tie->sigmax1[1];
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc1+2] += -0.5 * zweight * projected_offset * tie->sigmax1[2];
-				    /*
-				    xs[3*nc2]   +=  0.0;
-				    xs[3*nc2+1] +=  0.0;
-				    */
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc2+2] +=  0.5 * zweight * projected_offset * tie->sigmax1[2];
-				    }
-				else if (file2->status == MBNA_FILE_FIXEDZNAV)
-				    {
-				    xs[3*nc1]   += -0.5 * xyweight * projected_offset * tie->sigmax1[0];
-				    xs[3*nc1+1] += -0.5 * xyweight * projected_offset * tie->sigmax1[1];
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc1+2] += -zweight * projected_offset * tie->sigmax1[2];
-				    xs[3*nc2]   +=  0.5 * xyweight * projected_offset * tie->sigmax1[0];
-				    xs[3*nc2+1] +=  0.5 * xyweight * projected_offset * tie->sigmax1[1];
-				    /*
-				    xs[3*nc2+2] +=  0.0;
-				    */
-				    }
-				}
-			    else if (file1->status == MBNA_FILE_POORNAV)
-			    	{
-				if (file2->status == MBNA_FILE_GOODNAV)
-				    {
-				    xs[3*nc1]   += -0.995 * xyweight * projected_offset * tie->sigmax1[0];
-				    xs[3*nc1+1] += -0.995 * xyweight * projected_offset * tie->sigmax1[1];
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc1+2] += -0.995 * zweight * projected_offset * tie->sigmax1[2];
-				    xs[3*nc2]   +=  0.005 * xyweight * projected_offset * tie->sigmax1[0];
-				    xs[3*nc2+1] +=  0.005 * xyweight * projected_offset * tie->sigmax1[1];
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc2+2] +=  0.005 * zweight * projected_offset * tie->sigmax1[2];
-				    }
-				else if (file2->status == MBNA_FILE_FIXEDNAV)
-				    {
-				    xs[3*nc1]   += -xyweight * projected_offset * tie->sigmax1[0];
-				    xs[3*nc1+1] += -xyweight * projected_offset * tie->sigmax1[1];
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc1+2] += -zweight * projected_offset * tie->sigmax1[2];
-				    /*
-				    xs[3*nc2]   +=  0.0;
-				    xs[3*nc2+1] +=  0.0;
-				    xs[3*nc2+2] +=  0.0;
-				    */
-				    }
-				else if (file2->status == MBNA_FILE_FIXEDXYNAV)
-				    {
-				    xs[3*nc1]   += -xyweight * projected_offset * tie->sigmax1[0];
-				    xs[3*nc1+1] += -xyweight * projected_offset * tie->sigmax1[1];
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc1+2] += -0.995 * zweight * projected_offset * tie->sigmax1[2];
-				    /*
-				    xs[3*nc2]   +=  0.0;
-				    xs[3*nc2+1] +=  0.0;
-				    */
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc2+2] +=  0.005 * zweight * projected_offset * tie->sigmax1[2];
-				    }
-				else if (file2->status == MBNA_FILE_FIXEDZNAV)
-				    {
-				    xs[3*nc1]   += -0.995 * xyweight * projected_offset * tie->sigmax1[0];
-				    xs[3*nc1+1] += -0.995 * xyweight * projected_offset * tie->sigmax1[1];
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc1+2] += -zweight * projected_offset * tie->sigmax1[2];
-				    xs[3*nc2]   +=  0.005 * xyweight * projected_offset * tie->sigmax1[0];
-				    xs[3*nc2+1] +=  0.005 * xyweight * projected_offset * tie->sigmax1[1];
-				    /*
-				    xs[3*nc2+2] +=  0.0;
-				    */
-				    }
-				}
-			    else if (file1->status == MBNA_FILE_FIXEDNAV)
-			    	{
-				if (file2->status == MBNA_FILE_GOODNAV || file2->status == MBNA_FILE_POORNAV)
-				    {
-				    /*
-				    xs[3*nc1]   +=  0.0;
-				    xs[3*nc1+1] +=  0.0;
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc1+2] +=  0.0;
-				    */
-				    xs[3*nc2]   +=  xyweight * projected_offset * tie->sigmax1[0];
-				    xs[3*nc2+1] +=  xyweight * projected_offset * tie->sigmax1[1];
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc2+2] +=  zweight * projected_offset * tie->sigmax1[2];
-				    }
-				else if (file2->status == MBNA_FILE_FIXEDXYNAV)
-				    {
-				    /*
-				    xs[3*nc1]   +=  0.0;
-				    xs[3*nc1+1] +=  0.0;
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc1+2] +=  0.0;
-				    xs[3*nc2]   +=  0.0;
-				    xs[3*nc2+1] +=  0.0;
-				    */
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc2+2] +=  zweight * projected_offset * tie->sigmax1[2];
-				    }
-				else if (file2->status == MBNA_FILE_FIXEDZNAV)
-				    {
-				    /*
-				    xs[3*nc1]   +=  0.0;
-				    xs[3*nc1+1] +=  0.0;
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc1+2] +=  0.0;
-				    */
-				    xs[3*nc2]   +=  xyweight * projected_offset * tie->sigmax1[0];
-				    xs[3*nc2+1] +=  xyweight * projected_offset * tie->sigmax1[1];
-				    /*
-				    xs[3*nc2+2] +=  0.0;
-				    */
-				    }
-				}
-			    else if (file1->status == MBNA_FILE_FIXEDXYNAV)
-			    	{
-				if (file2->status == MBNA_FILE_GOODNAV)
-				    {
-				    /*
-				    xs[3*nc1]   +=  0.0;
-				    xs[3*nc1+1] +=  0.0;
-				    */
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc1+2] += -0.5 * zweight * projected_offset * tie->sigmax1[2];
-				    xs[3*nc2]   +=  xyweight * projected_offset * tie->sigmax1[0];
-				    xs[3*nc2+1] +=  xyweight * projected_offset * tie->sigmax1[1];
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc2+2] +=  0.5 * zweight * projected_offset * tie->sigmax1[2];
-				    }
-				else if (file2->status == MBNA_FILE_POORNAV)
-				    {
-				    /*
-				    xs[3*nc1]   +=  0.0;
-				    xs[3*nc1+1] +=  0.0;
-				    */
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc1+2] += -0.005 * zweight * projected_offset * tie->sigmax1[2];
-				    xs[3*nc2]   +=  xyweight * projected_offset * tie->sigmax1[0];
-				    xs[3*nc2+1] +=  xyweight * projected_offset * tie->sigmax1[1];
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc2+2] +=  0.995 * zweight * projected_offset * tie->sigmax1[2];
-				    }
-				else if (file2->status == MBNA_FILE_FIXEDNAV)
-				    {
-				    /*
-				    xs[3*nc1]   +=  0.0;
-				    xs[3*nc1+1] +=  0.0;
-				    */
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc1+2] += -zweight * projected_offset * tie->sigmax1[2];
-				    /*
-				    xs[3*nc2]   +=  0.0;
-				    xs[3*nc2+1] +=  0.0;
-				    xs[3*nc2+2] +=  0.0;
-				    */
-				    }
-				else if (file2->status == MBNA_FILE_FIXEDZNAV)
-				    {
-				    /*
-				    xs[3*nc1]   +=  0.0;
-				    xs[3*nc1+1] +=  0.0;
-				    */
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc1+2] += -zweight * projected_offset * tie->sigmax1[2];
-				    xs[3*nc2]   +=  xyweight * projected_offset * tie->sigmax1[0];
-				    xs[3*nc2+1] +=  xyweight * projected_offset * tie->sigmax1[1];
-				    /*
-				    xs[3*nc2+2] +=  0.0;
-				    */
-				    }
-				}
-			    else if (file1->status == MBNA_FILE_FIXEDZNAV)
-			    	{
-				if (file2->status == MBNA_FILE_GOODNAV)
-				    {
-				    xs[3*nc1]   += -0.5 * xyweight * projected_offset * tie->sigmax1[0];
-				    xs[3*nc1+1] += -0.5 * xyweight * projected_offset * tie->sigmax1[1];
-				    /*
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc1+2] +=  0.0;
-				    */
-				    xs[3*nc2]   +=  0.5 * xyweight * projected_offset * tie->sigmax1[0];
-				    xs[3*nc2+1] +=  0.5 * xyweight * projected_offset * tie->sigmax1[1];
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc2+2] +=  zweight * projected_offset * tie->sigmax1[2];
-				    }
-				else if (file2->status == MBNA_FILE_POORNAV)
-				    {
-				    xs[3*nc1]   += -0.005 * xyweight * projected_offset * tie->sigmax1[0];
-				    xs[3*nc1+1] += -0.005 * xyweight * projected_offset * tie->sigmax1[1];
-				    /*
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc1+2] +=  0.0;
-				    */
-				    xs[3*nc2]   +=  0.995 * xyweight * projected_offset * tie->sigmax1[0];
-				    xs[3*nc2+1] +=  0.995 * xyweight * projected_offset * tie->sigmax1[1];
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc2+2] +=  zweight * projected_offset * tie->sigmax1[2];
-				    }
-				else if (file2->status == MBNA_FILE_FIXEDNAV)
-				    {
-				    xs[3*nc1]   += -xyweight * projected_offset * tie->sigmax1[0];
-				    xs[3*nc1+1] += -xyweight * projected_offset * tie->sigmax1[1];
-				    /*
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc1+2] +=  0.0;
-				    xs[3*nc2]   +=  0.0;
-				    xs[3*nc2+1] +=  0.0;
-				    xs[3*nc2+2] +=  0.0;
-				    */
-				    }
-				else if (file2->status == MBNA_FILE_FIXEDXYNAV)
-				    {
-				    xs[3*nc1]   += -xyweight * projected_offset * tie->sigmax1[0];
-				    xs[3*nc1+1] += -xyweight * projected_offset * tie->sigmax1[1];
-				    /*
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc1+2] +=  0.0;
-				    xs[3*nc2]   +=  0.0;
-				    xs[3*nc2+1] +=  0.0;
-				    */
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc2+2] +=  zweight * projected_offset * tie->sigmax1[2];
-				    }
-				}
-			    xw[3*nc1]   += xyweight;
-			    xw[3*nc1+1] += xyweight;
-			    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-				xw[3*nc1+2] += zweight;
-			    xw[3*nc2]   += xyweight;
-			    xw[3*nc2+1] += xyweight;
-			    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-				xw[3*nc2+2] += zweight;
-/* fprintf(stderr,"long axis:  nc1:%d xx:%f %f %f  nc2:%d xx:%f %f %f\n",
-nc1,xs[3*nc1],xs[3*nc1+1],xs[3*nc1+2],
-nc2,xs[3*nc2],xs[3*nc2+1],xs[3*nc2+2]);*/
-
-			    /* deal with horizontal axis */
-			    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-				projected_offset = offsetx * tie->sigmax2[0]
-						+ offsety * tie->sigmax2[1]
-						+ offsetz * tie->sigmax2[2];
-			    else
-				projected_offset = offsetx * tie->sigmax2[0]
-						+ offsety * tie->sigmax2[1];
-			    if (fabs(tie->sigmar2) > 0.0)
-			    	{
-				xyweight = sqrt(mbna_offsetweight / tie->sigmar2);
-			    	zweight = sqrt(mbna_offsetweight / mbna_zweightfactor / tie->sigmar2);
-				}
-			    else
-			    	{
-				xyweight = 0.0;
-			    	zweight = 0.0;
-				}
-//zweight = 0.0;
-
-			    /* deal with fixed, good, or poor status of sections */
-			    if (file1->status == file2->status)
-			    	{
-				if (file1->status == MBNA_FILE_GOODNAV || file1->status == MBNA_FILE_POORNAV)
-				    {
-				    xs[3*nc1]   += -0.5 * xyweight * projected_offset * tie->sigmax2[0];
-				    xs[3*nc1+1] += -0.5 * xyweight * projected_offset * tie->sigmax2[1];
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc1+2] += -0.5 * zweight * projected_offset * tie->sigmax2[2];
-				    xs[3*nc2]   +=  0.5 * xyweight * projected_offset * tie->sigmax2[0];
-				    xs[3*nc2+1] +=  0.5 * xyweight * projected_offset * tie->sigmax2[1];
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc2+2] +=  0.5 * zweight * projected_offset * tie->sigmax2[2];
-				    }
-				else if (file1->status == MBNA_FILE_FIXEDXYNAV)
-				    {
-				    /*
-				    xs[3*nc1]   +=  0.0;
-				    xs[3*nc1+1] +=  0.0;
-				    */
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc1+2] += -0.5 * zweight * projected_offset * tie->sigmax2[2];
-				    /*
-				    xs[3*nc2]   +=  0.0;
-				    xs[3*nc2+1] +=  0.0;
-				    */
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc2+2] +=  0.5 * zweight * projected_offset * tie->sigmax2[2];
-				    }
-				else if (file1->status == MBNA_FILE_FIXEDZNAV)
-				    {
-				    xs[3*nc1]   += -0.5 * xyweight * projected_offset * tie->sigmax2[0];
-				    xs[3*nc1+1] += -0.5 * xyweight * projected_offset * tie->sigmax2[1];
-				    /*
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc1+2] +=  0.0;
-				    */
-				    xs[3*nc2]   +=  0.5 * xyweight * projected_offset * tie->sigmax2[0];
-				    xs[3*nc2+1] +=  0.5 * xyweight * projected_offset * tie->sigmax2[1];
-				    /*
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc2+2] +=  0.0;
-				    */
-				    }
-				}
-			    else if (file1->status == MBNA_FILE_GOODNAV)
-			    	{
-				if (file2->status == MBNA_FILE_POORNAV)
-				    {
-				    xs[3*nc1]   += -0.005 * xyweight * projected_offset * tie->sigmax2[0];
-				    xs[3*nc1+1] += -0.005 * xyweight * projected_offset * tie->sigmax2[1];
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc1+2] += -0.005 * zweight * projected_offset * tie->sigmax2[2];
-				    xs[3*nc2]   +=  0.995 * xyweight * projected_offset * tie->sigmax2[0];
-				    xs[3*nc2+1] +=  0.995 * xyweight * projected_offset * tie->sigmax2[1];
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc2+2] +=  0.995 * zweight * projected_offset * tie->sigmax2[2];
-				    }
-				else if (file2->status == MBNA_FILE_FIXEDNAV)
-				    {
-				    xs[3*nc1]   += -xyweight * projected_offset * tie->sigmax2[0];
-				    xs[3*nc1+1] += -xyweight * projected_offset * tie->sigmax2[1];
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc1+2] += -zweight * projected_offset * tie->sigmax2[2];
-				    /*
-				    xs[3*nc2]   +=  0.0;
-				    xs[3*nc2+1] +=  0.0;
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc2+2] +=  0.0;
-				    */
-				    }
-				else if (file2->status == MBNA_FILE_FIXEDXYNAV)
-				    {
-				    xs[3*nc1]   += -xyweight * projected_offset * tie->sigmax2[0];
-				    xs[3*nc1+1] += -xyweight * projected_offset * tie->sigmax2[1];
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc1+2] += -0.5 * zweight * projected_offset * tie->sigmax2[2];
-				    /*
-				    xs[3*nc2]   +=  0.0;
-				    xs[3*nc2+1] +=  0.0;
-				    */
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc2+2] +=  0.5 * zweight * projected_offset * tie->sigmax2[2];
-				    }
-				else if (file2->status == MBNA_FILE_FIXEDZNAV)
-				    {
-				    xs[3*nc1]   += -0.5 * xyweight * projected_offset * tie->sigmax2[0];
-				    xs[3*nc1+1] += -0.5 * xyweight * projected_offset * tie->sigmax2[1];
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc1+2] += -zweight * projected_offset * tie->sigmax2[2];
-				    xs[3*nc2]   +=  0.5 * xyweight * projected_offset * tie->sigmax2[0];
-				    xs[3*nc2+1] +=  0.5 * xyweight * projected_offset * tie->sigmax2[1];
-				    /*
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc2+2] +=  0.0;
-				    */
-				    }
-				}
-			    else if (file1->status == MBNA_FILE_POORNAV)
-			    	{
-				if (file2->status == MBNA_FILE_GOODNAV)
-				    {
-				    xs[3*nc1]   += -0.995 * xyweight * projected_offset * tie->sigmax2[0];
-				    xs[3*nc1+1] += -0.995 * xyweight * projected_offset * tie->sigmax2[1];
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc1+2] += -0.995 * zweight * projected_offset * tie->sigmax2[2];
-				    xs[3*nc2]   +=  0.005 * xyweight * projected_offset * tie->sigmax2[0];
-				    xs[3*nc2+1] +=  0.005 * xyweight * projected_offset * tie->sigmax2[1];
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc2+2] +=  0.005 * zweight * projected_offset * tie->sigmax2[2];
-				    }
-				else if (file2->status == MBNA_FILE_FIXEDNAV)
-				    {
-				    xs[3*nc1]   += -xyweight * projected_offset * tie->sigmax2[0];
-				    xs[3*nc1+1] += -xyweight * projected_offset * tie->sigmax2[1];
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc1+2] += -zweight * projected_offset * tie->sigmax2[2];
-				    /*
-				    xs[3*nc2]   +=  0.0;
-				    xs[3*nc2+1] +=  0.0;
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc2+2] +=  0.0;
-				    */
-				    }
-				else if (file2->status == MBNA_FILE_FIXEDXYNAV)
-				    {
-				    xs[3*nc1]   += -xyweight * projected_offset * tie->sigmax2[0];
-				    xs[3*nc1+1] += -xyweight * projected_offset * tie->sigmax2[1];
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc1+2] += -0.995 * zweight * projected_offset * tie->sigmax2[2];
-				    /*
-				    xs[3*nc2]   +=  0.0;
-				    xs[3*nc2+1] +=  0.0;
-				    */
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc2+2] +=  0.005 * zweight * projected_offset * tie->sigmax2[2];
-				    }
-				else if (file2->status == MBNA_FILE_FIXEDZNAV)
-				    {
-				    xs[3*nc1]   += -0.995 * xyweight * projected_offset * tie->sigmax2[0];
-				    xs[3*nc1+1] += -0.995 * xyweight * projected_offset * tie->sigmax2[1];
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc1+2] += -zweight * projected_offset * tie->sigmax2[2];
-				    xs[3*nc2]   +=  0.005 * xyweight * projected_offset * tie->sigmax2[0];
-				    xs[3*nc2+1] +=  0.005 * xyweight * projected_offset * tie->sigmax2[1];
-				    /*
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc2+2] +=  0.0;
-				    */
-				    }
-				}
-			    else if (file1->status == MBNA_FILE_FIXEDNAV)
-			    	{
-				if (file2->status == MBNA_FILE_GOODNAV || file2->status == MBNA_FILE_POORNAV)
-				    {
-				    /*
-				    xs[3*nc1]   +=  0.0;
-				    xs[3*nc1+1] +=  0.0;
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc1+2] +=  0.0;
-				    */
-				    xs[3*nc2]   +=  xyweight * projected_offset * tie->sigmax2[0];
-				    xs[3*nc2+1] +=  xyweight * projected_offset * tie->sigmax2[1];
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc2+2] +=  zweight * projected_offset * tie->sigmax2[2];
-				    }
-				else if (file2->status == MBNA_FILE_FIXEDXYNAV)
-				    {
-				    /*
-				    xs[3*nc1]   +=  0.0;
-				    xs[3*nc1+1] +=  0.0;
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc1+2] +=  0.0;
-				    xs[3*nc2]   +=  0.0;
-				    xs[3*nc2+1] +=  0.0;
-				    */
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc2+2] +=  zweight * projected_offset * tie->sigmax2[2];
-				    }
-				else if (file2->status == MBNA_FILE_FIXEDZNAV)
-				    {
-				    /*
-				    xs[3*nc1]   +=  0.0;
-				    xs[3*nc1+1] +=  0.0;
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc1+2] +=  0.0;
-				    */
-				    xs[3*nc2]   +=  xyweight * projected_offset * tie->sigmax2[0];
-				    xs[3*nc2+1] +=  xyweight * projected_offset * tie->sigmax2[1];
-				    /*
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc2+2] +=  0.0;
-				    */
-				    }
-				}
-			    else if (file1->status == MBNA_FILE_FIXEDXYNAV)
-			    	{
-				if (file2->status == MBNA_FILE_GOODNAV)
-				    {
-				    /*
-				    xs[3*nc1]   +=  0.0;
-				    xs[3*nc1+1] +=  0.0;
-				    */
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc1+2] += -0.5 * zweight * projected_offset * tie->sigmax2[2];
-				    xs[3*nc2]   +=  xyweight * projected_offset * tie->sigmax2[0];
-				    xs[3*nc2+1] +=  xyweight * projected_offset * tie->sigmax2[1];
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc2+2] +=  0.5 * zweight * projected_offset * tie->sigmax2[2];
-				    }
-				else if (file2->status == MBNA_FILE_POORNAV)
-				    {
-				    /*
-				    xs[3*nc1]   +=  0.0;
-				    xs[3*nc1+1] +=  0.0;
-				    */
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc1+2] += -0.005 * zweight * projected_offset * tie->sigmax2[2];
-				    xs[3*nc2]   +=  xyweight * projected_offset * tie->sigmax2[0];
-				    xs[3*nc2+1] +=  xyweight * projected_offset * tie->sigmax2[1];
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc2+2] +=  0.995 * zweight * projected_offset * tie->sigmax2[2];
-				    }
-				else if (file2->status == MBNA_FILE_FIXEDNAV)
-				    {
-				    /*
-				    xs[3*nc1]   +=  0.0;
-				    xs[3*nc1+1] +=  0.0;
-				    */
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc1+2] += -zweight * projected_offset * tie->sigmax2[2];
-				    /*
-				    xs[3*nc2]   +=  0.0;
-				    xs[3*nc2+1] +=  0.0;
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc2+2] +=  0.0;
-				    */
-				    }
-				else if (file2->status == MBNA_FILE_FIXEDZNAV)
-				    {
-				    /*
-				    xs[3*nc1]   +=  0.0;
-				    xs[3*nc1+1] +=  0.0;
-				    */
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc1+2] += -zweight * projected_offset * tie->sigmax2[2];
-				    xs[3*nc2]   +=  xyweight * projected_offset * tie->sigmax2[0];
-				    xs[3*nc2+1] +=  xyweight * projected_offset * tie->sigmax2[1];
-				    /*
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc2+2] +=  0.0;
-				    */
-				    }
-				}
-			    else if (file1->status == MBNA_FILE_FIXEDZNAV)
-			    	{
-				if (file2->status == MBNA_FILE_GOODNAV)
-				    {
-				    xs[3*nc1]   += -0.5 * xyweight * projected_offset * tie->sigmax2[0];
-				    xs[3*nc1+1] += -0.5 * xyweight * projected_offset * tie->sigmax2[1];
-				    /*
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc1+2] +=  0.0;
-				    */
-				    xs[3*nc2]   +=  0.5 * xyweight * projected_offset * tie->sigmax2[0];
-				    xs[3*nc2+1] +=  0.5 * xyweight * projected_offset * tie->sigmax2[1];
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc2+2] +=  zweight * projected_offset * tie->sigmax2[2];
-				    }
-				else if (file2->status == MBNA_FILE_POORNAV)
-				    {
-				    xs[3*nc1]   += -0.005 * xyweight * projected_offset * tie->sigmax2[0];
-				    xs[3*nc1+1] += -0.005 * xyweight * projected_offset * tie->sigmax2[1];
-				    /*
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc1+2] +=  0.0;
-				    */
-				    xs[3*nc2]   +=  0.995 * xyweight * projected_offset * tie->sigmax2[0];
-				    xs[3*nc2+1] +=  0.995 * xyweight * projected_offset * tie->sigmax2[1];
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc2+2] +=  zweight * projected_offset * tie->sigmax2[2];
-				    }
-				else if (file2->status == MBNA_FILE_FIXEDNAV)
-				    {
-				    xs[3*nc1]   += -xyweight * projected_offset * tie->sigmax2[0];
-				    xs[3*nc1+1] += -xyweight * projected_offset * tie->sigmax2[1];
-				    /*
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc1+2] +=  0.0;
-				    xs[3*nc2]   +=  0.0;
-				    xs[3*nc2+1] +=  0.0;
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc2+2] +=  0.0;
-				    */
-				    }
-				else if (file2->status == MBNA_FILE_FIXEDXYNAV)
-				    {
-				    xs[3*nc1]   += -xyweight * projected_offset * tie->sigmax2[0];
-				    xs[3*nc1+1] += -xyweight * projected_offset * tie->sigmax2[1];
-				    /*
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc1+2] +=  0.0;
-				    xs[3*nc2]   +=  0.0;
-				    xs[3*nc2+1] +=  0.0;
-				    */
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc2+2] +=  zweight * projected_offset * tie->sigmax2[2];
-				    }
-				}
-			    xw[3*nc1]   += xyweight;
-			    xw[3*nc1+1] += xyweight;
-			    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-				xw[3*nc1+2] += zweight;
-			    xw[3*nc2]   += xyweight;
-			    xw[3*nc2+1] += xyweight;
-			    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-				xw[3*nc2+2] += zweight;
-/* fprintf(stderr,"horizontal:  nc1:%d xx:%f %f %f  nc2:%d xx:%f %f %f\n",
-nc1,xs[3*nc1],xs[3*nc1+1],xs[3*nc1+2],
-nc2,xs[3*nc2],xs[3*nc2+1],xs[3*nc2+2]);*/
-
-			    /* deal with semi-vertical axis */
-			    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-				projected_offset = offsetx * tie->sigmax3[0]
-						+ offsety * tie->sigmax3[1]
-						+ offsetz * tie->sigmax3[2];
-			    else
-				projected_offset = offsetz * tie->sigmax3[2];
-			    if (fabs(tie->sigmar3) > 0.0)
-			    	{
-				xyweight = sqrt(mbna_offsetweight / tie->sigmar3);
-			    	zweight = sqrt(mbna_zweightfactor * mbna_offsetweight / tie->sigmar3);
-				}
-			    else
-			    	{
-				xyweight = 0.0;
-			    	zweight = 0.0;
-				}
-//xyweight = 0.0;
-//zweight = 1.0;
-
-			    /* deal with fixed, good, or poor status of sections */
-			    if (file1->status == file2->status)
-			    	{
-				if (file1->status == MBNA_FILE_GOODNAV || file1->status == MBNA_FILE_POORNAV)
-				    {
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					{
-					xs[3*nc1]   += -0.5 * xyweight * projected_offset * tie->sigmax3[0];
-					xs[3*nc1+1] += -0.5 * xyweight * projected_offset * tie->sigmax3[1];
-					}
-				    xs[3*nc1+2] += -0.5 * zweight * projected_offset * tie->sigmax3[2];
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					{
-					xs[3*nc2]   +=  0.5 * xyweight * projected_offset * tie->sigmax3[0];
-				        xs[3*nc2+1] +=  0.5 * xyweight * projected_offset * tie->sigmax3[1];
-					}
-				    xs[3*nc2+2] +=  0.5 * zweight * projected_offset * tie->sigmax3[2];
-				    }
-				else if (file1->status == MBNA_FILE_FIXEDXYNAV)
-				    {
-				    /*
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					{
-				        xs[3*nc1]   +=  0.0;
-				        xs[3*nc1+1] +=  0.0;
-				        }
-				    */
-				    xs[3*nc1+2] += -0.5 * zweight * projected_offset * tie->sigmax3[2];
-				    /*
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					{
-				        xs[3*nc2]   +=  0.0;
-				        xs[3*nc2+1] +=  0.0;
-				        }
-				    */
-				    xs[3*nc2+2] +=  0.5 * zweight * projected_offset * tie->sigmax3[2];
-				    }
-				else if (file1->status == MBNA_FILE_FIXEDZNAV)
-				    {
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					{
-					xs[3*nc1]   += -0.5 * xyweight * projected_offset * tie->sigmax3[0];
-					xs[3*nc1+1] += -0.5 * xyweight * projected_offset * tie->sigmax3[1];
-					}
-				    /*
-				    xs[3*nc1+2] +=  0.0;
-				    */
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					{
-					xs[3*nc2]   +=  0.5 * xyweight * projected_offset * tie->sigmax3[0];
-				        xs[3*nc2+1] +=  0.5 * xyweight * projected_offset * tie->sigmax3[1];
-					}
-				    /*
-				    xs[3*nc2+2] +=  0.0;
-				    */
-				    }
-				}
-			    else if (file1->status == MBNA_FILE_GOODNAV)
-			    	{
-				if (file2->status == MBNA_FILE_POORNAV)
-				    {
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					{
-					xs[3*nc1]   += -0.5 * xyweight * projected_offset * tie->sigmax3[0];
-					xs[3*nc1+1] += -0.5 * xyweight * projected_offset * tie->sigmax3[1];
-					}
-				    xs[3*nc1+2] += -0.005 * zweight * projected_offset * tie->sigmax3[2];
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					{
-					xs[3*nc2]   +=  0.5 * xyweight * projected_offset * tie->sigmax3[0];
-				        xs[3*nc2+1] +=  0.5 * xyweight * projected_offset * tie->sigmax3[1];
-					}
-				    xs[3*nc2+2] +=  0.995 * zweight * projected_offset * tie->sigmax3[2];
-				    }
-				else if (file2->status == MBNA_FILE_FIXEDNAV)
-				    {
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					{
-					xs[3*nc1]   += -0.5 * xyweight * projected_offset * tie->sigmax3[0];
-					xs[3*nc1+1] += -0.5 * xyweight * projected_offset * tie->sigmax3[1];
-					}
-				    xs[3*nc1+2] += -zweight * projected_offset * tie->sigmax3[2];
-				    /*
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					{
-				        xs[3*nc2]   +=  0.0;
-				        xs[3*nc2+1] +=  0.0;
-				        }
-				    xs[3*nc2+2] +=  0.0;
-				    */
-				    }
-				else if (file2->status == MBNA_FILE_FIXEDXYNAV)
-				    {
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					{
-					xs[3*nc1]   += -0.5 * xyweight * projected_offset * tie->sigmax3[0];
-					xs[3*nc1+1] += -0.5 * xyweight * projected_offset * tie->sigmax3[1];
-					}
-				    xs[3*nc1+2] += -0.5 * zweight * projected_offset * tie->sigmax3[2];
-				    /*
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					{
-				        xs[3*nc2]   +=  0.0;
-				        xs[3*nc2+1] +=  0.0;
-				        }
-				    */
-				    xs[3*nc2+2] +=  0.5 * zweight * projected_offset * tie->sigmax3[2];
-				    }
-				else if (file2->status == MBNA_FILE_FIXEDZNAV)
-				    {
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					{
-					xs[3*nc1]   += -0.5 * xyweight * projected_offset * tie->sigmax3[0];
-					xs[3*nc1+1] += -0.5 * xyweight * projected_offset * tie->sigmax3[1];
-					}
-				    xs[3*nc1+2] += -zweight * projected_offset * tie->sigmax3[2];
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					{
-					xs[3*nc2]   +=  0.5 * xyweight * projected_offset * tie->sigmax3[0];
-				        xs[3*nc2+1] +=  0.5 * xyweight * projected_offset * tie->sigmax3[1];
-					}
-				    /*
-				    xs[3*nc2+2] +=  0.0;
-				    */
-				    }
-				}
-			    else if (file1->status == MBNA_FILE_POORNAV)
-			    	{
-				if (file2->status == MBNA_FILE_GOODNAV)
-				    {
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					{
-					xs[3*nc1]   += -0.5 * xyweight * projected_offset * tie->sigmax3[0];
-					xs[3*nc1+1] += -0.5 * xyweight * projected_offset * tie->sigmax3[1];
-					}
-				    xs[3*nc1+2] += -0.995 * zweight * projected_offset * tie->sigmax3[2];
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					{
-					xs[3*nc2]   +=  0.5 * xyweight * projected_offset * tie->sigmax3[0];
-				        xs[3*nc2+1] +=  0.5 * xyweight * projected_offset * tie->sigmax3[1];
-					}
-				    xs[3*nc2+2] +=  0.005 * zweight * projected_offset * tie->sigmax3[2];
-				    }
-				else if (file2->status == MBNA_FILE_FIXEDNAV)
-				    {
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					{
-					xs[3*nc1]   += -0.5 * xyweight * projected_offset * tie->sigmax3[0];
-					xs[3*nc1+1] += -0.5 * xyweight * projected_offset * tie->sigmax3[1];
-					}
-				    xs[3*nc1+2] += -zweight * projected_offset * tie->sigmax3[2];
-				    /*
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					{
-				        xs[3*nc2]   +=  0.0;
-				        xs[3*nc2+1] +=  0.0;
-				        }
-				    xs[3*nc2+2] +=  0.0;
-				    */
-				    }
-				else if (file2->status == MBNA_FILE_FIXEDXYNAV)
-				    {
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					{
-					xs[3*nc1]   += -0.5 * xyweight * projected_offset * tie->sigmax3[0];
-					xs[3*nc1+1] += -0.5 * xyweight * projected_offset * tie->sigmax3[1];
-					}
-				    xs[3*nc1+2] += -0.995 * zweight * projected_offset * tie->sigmax3[2];
-				    /*
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					{
-				        xs[3*nc2]   +=  0.0;
-				        xs[3*nc2+1] +=  0.0;
-				        }
-				    */
-				    xs[3*nc2+2] +=  0.005 * zweight * projected_offset * tie->sigmax3[2];
-				    }
-				else if (file2->status == MBNA_FILE_FIXEDZNAV)
-				    {
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					{
-					xs[3*nc1]   += -0.5 * xyweight * projected_offset * tie->sigmax3[0];
-					xs[3*nc1+1] += -0.5 * xyweight * projected_offset * tie->sigmax3[1];
-					}
-				    xs[3*nc1+2] += -zweight * projected_offset * tie->sigmax3[2];
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					{
-					xs[3*nc2]   +=  0.5 * xyweight * projected_offset * tie->sigmax3[0];
-				        xs[3*nc2+1] +=  0.5 * xyweight * projected_offset * tie->sigmax3[1];
-					}
-				    /*
-				    xs[3*nc2+2] +=  0.0;
-				    */
-				    }
-				}
-			    else if (file1->status == MBNA_FILE_FIXEDNAV)
-			    	{
-				if (file2->status == MBNA_FILE_GOODNAV || file2->status == MBNA_FILE_POORNAV)
-				    {
-				    /*
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					{
-				        xs[3*nc1]   +=  0.0;
-				        xs[3*nc1+1] +=  0.0;
-				        }
-				    xs[3*nc1+2] +=  0.0;
-				    */
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					{
-					xs[3*nc2]   +=  0.5 * xyweight * projected_offset * tie->sigmax3[0];
-				        xs[3*nc2+1] +=  0.5 * xyweight * projected_offset * tie->sigmax3[1];
-					}
-				    xs[3*nc2+2] +=  zweight * projected_offset * tie->sigmax3[2];
-				    }
-				else if (file2->status == MBNA_FILE_FIXEDXYNAV)
-				    {
-				    /*
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					{
-				        xs[3*nc1]   +=  0.0;
-				        xs[3*nc1+1] +=  0.0;
-				        }
-				    xs[3*nc1+2] +=  0.0;
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					{
-				        xs[3*nc2]   +=  0.0;
-				        xs[3*nc2+1] +=  0.0;
-				        }
-				    */
-				    xs[3*nc2+2] +=  zweight * projected_offset * tie->sigmax3[2];
-				    }
-				else if (file2->status == MBNA_FILE_FIXEDZNAV)
-				    {
-				    /*
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					{
-				        xs[3*nc1]   +=  0.0;
-				        xs[3*nc1+1] +=  0.0;
-				        }
-				    xs[3*nc1+2] +=  0.0;
-				    */
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					{
-					xs[3*nc2]   +=  0.5 * xyweight * projected_offset * tie->sigmax3[0];
-				        xs[3*nc2+1] +=  0.5 * xyweight * projected_offset * tie->sigmax3[1];
-					}
-				    /*
-				    xs[3*nc2+2] +=  0.0;
-				    */
-				    }
-				}
-			    else if (file1->status == MBNA_FILE_FIXEDXYNAV)
-			    	{
-				if (file2->status == MBNA_FILE_GOODNAV)
-				    {
-				    /*
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					{
-				        xs[3*nc1]   +=  0.0;
-				        xs[3*nc1+1] +=  0.0;
-				        }
-				    */
-				    xs[3*nc1+2] += -0.5 * zweight * projected_offset * tie->sigmax3[2];
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					{
-					xs[3*nc2]   +=  0.5 * xyweight * projected_offset * tie->sigmax3[0];
-				        xs[3*nc2+1] +=  0.5 * xyweight * projected_offset * tie->sigmax3[1];
-					}
-				    xs[3*nc2+2] +=  0.5 * zweight * projected_offset * tie->sigmax3[2];
-				    }
-				else if (file2->status == MBNA_FILE_POORNAV)
-				    {
-				    /*
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					{
-				        xs[3*nc1]   +=  0.0;
-				        xs[3*nc1+1] +=  0.0;
-				        }
-				    */
-				    xs[3*nc1+2] += -0.005 * zweight * projected_offset * tie->sigmax3[2];
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					{
-					xs[3*nc2]   +=  0.5 * xyweight * projected_offset * tie->sigmax3[0];
-				        xs[3*nc2+1] +=  0.5 * xyweight * projected_offset * tie->sigmax3[1];
-					}
-				    xs[3*nc2+2] +=  0.995 * zweight * projected_offset * tie->sigmax3[2];
-				    }
-				else if (file2->status == MBNA_FILE_FIXEDNAV)
-				    {
-				    /*
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					{
-				        xs[3*nc1]   +=  0.0;
-				        xs[3*nc1+1] +=  0.0;
-				        }
-				    */
-				    xs[3*nc1+2] += -zweight * projected_offset * tie->sigmax3[2];
-				    /*
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					{
-				        xs[3*nc2]   +=  0.0;
-				        xs[3*nc2+1] +=  0.0;
-				        }
-				    xs[3*nc2+2] +=  0.0;
-				    */
-				    }
-				else if (file2->status == MBNA_FILE_FIXEDZNAV)
-				    {
-				    /*
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					{
-				        xs[3*nc1]   +=  0.0;
-				        xs[3*nc1+1] +=  0.0;
-				        }
-				    */
-				    xs[3*nc1+2] += -zweight * projected_offset * tie->sigmax3[2];
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					{
-					xs[3*nc2]   +=  0.5 * xyweight * projected_offset * tie->sigmax3[0];
-				        xs[3*nc2+1] +=  0.5 * xyweight * projected_offset * tie->sigmax3[1];
-					}
-				    /*
-				    xs[3*nc2+2] +=  0.0;
-				    */
-				    }
-				}
-			    else if (file1->status == MBNA_FILE_FIXEDZNAV)
-			    	{
-				if (file2->status == MBNA_FILE_GOODNAV)
-				    {
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					{
-					xs[3*nc1]   += -0.5 * xyweight * projected_offset * tie->sigmax3[0];
-					xs[3*nc1+1] += -0.5 * xyweight * projected_offset * tie->sigmax3[1];
-					}
-				    /*
-				    xs[3*nc1+2] +=  0.0;
-				    */
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					{
-					xs[3*nc2]   +=  0.5 * xyweight * projected_offset * tie->sigmax3[0];
-				        xs[3*nc2+1] +=  0.5 * xyweight * projected_offset * tie->sigmax3[1];
-					}
-				    xs[3*nc2+2] +=  zweight * projected_offset * tie->sigmax3[2];
-				    }
-				else if (file2->status == MBNA_FILE_POORNAV)
-				    {
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					{
-					xs[3*nc1]   += -0.5 * xyweight * projected_offset * tie->sigmax3[0];
-					xs[3*nc1+1] += -0.5 * xyweight * projected_offset * tie->sigmax3[1];
-					}
-				    /*
-				    xs[3*nc1+2] +=  0.0;
-				    */
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					{
-					xs[3*nc2]   +=  0.5 * xyweight * projected_offset * tie->sigmax3[0];
-				        xs[3*nc2+1] +=  0.5 * xyweight * projected_offset * tie->sigmax3[1];
-					}
-				    xs[3*nc2+2] +=  zweight * projected_offset * tie->sigmax3[2];
-				    }
-				else if (file2->status == MBNA_FILE_FIXEDNAV)
-				    {
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					{
-					xs[3*nc1]   += -0.5 * xyweight * projected_offset * tie->sigmax3[0];
-					xs[3*nc1+1] += -0.5 * xyweight * projected_offset * tie->sigmax3[1];
-					}
-				    /*
-				    xs[3*nc1+2] +=  0.0;
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					{
-				        xs[3*nc2]   +=  0.0;
-				        xs[3*nc2+1] +=  0.0;
-				        }
-				    xs[3*nc2+2] +=  0.0;
-				    */
-				    }
-				else if (file2->status == MBNA_FILE_FIXEDXYNAV)
-				    {
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					{
-					xs[3*nc1]   += -0.5 * xyweight * projected_offset * tie->sigmax3[0];
-					xs[3*nc1+1] += -0.5 * xyweight * projected_offset * tie->sigmax3[1];
-					}
-				    /*
-				    xs[3*nc1+2] +=  0.0;
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					{
-				        xs[3*nc2]   +=  0.0;
-				        xs[3*nc2+1] +=  0.0;
-				        }
-				    */
-				    xs[3*nc2+2] +=  zweight * projected_offset * tie->sigmax3[2];
-				    }
-				}
-			    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-				{
-				xw[3*nc1]   += xyweight;
-				xw[3*nc1+1] += xyweight;
-				}
-			    xw[3*nc1+2] += zweight;
-			    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-				{
-				xw[3*nc2]   += xyweight;
-				xw[3*nc2+1] += xyweight;
-				}
-			    xw[3*nc2+2] += zweight;
-/* fprintf(stderr,"semi-vertical:  nc1:%d xx:%f %f %f  nc2:%d xx:%f %f %f\n",
-nc1,xs[3*nc1],xs[3*nc1+1],xs[3*nc1+2],
-nc2,xs[3*nc2],xs[3*nc2+1],xs[3*nc2+2]);*/
-
-			    }
-			}
-
-		    /* loop over all global ties applying offsets to the affected points */
-		    for (ifile=0;ifile<project.num_files;ifile++)
-			{
-			file = &project.files[ifile];
-
-			for (isection=0;isection<file->num_sections;isection++)
-			    {
-			    /* use only set global ties */
-			    section = &file->sections[isection];
-			    if (section->global_tie_status != MBNA_TIE_NONE)
-				{
-				/* get absolute id for first snav point */
-				nc1 = section->snav_invert_id[section->global_tie_snav];
-				
-				/* get current offset vector including reduction of block solution */
-				offsetx = 0.0;
-				offsety = 0.0;
-				offsetz = 0.0;
-				if (section->global_tie_status != MBNA_TIE_Z)
-				    {
-				    offsetx = section->global_tie_offset_x_m - xa[3*nc1] - x[3*nc1];
-				    offsety = section->global_tie_offset_y_m - xa[3*nc1+1] - x[3*nc1+1];
-				    }
-				if (section->global_tie_status != MBNA_TIE_XY)
-				    {
-				    offsetz = section->global_tie_offset_z_m - xa[3*nc1+2] - x[3*nc1+2];
-				    }
-				offsetr = sqrt(offsetx * offsetx + offsety * offsety + offsetz * offsetz);
-				
-				/* global ties have a simple error ellipse oriented on the axes */
-				
-				if (section->global_tie_status != MBNA_TIE_Z)
-				    {
-				    /* deal with x-axis */
-				    projected_offset = offsetx;
-				    if (fabs(section->global_tie_xsigma) > 0.0)
-					xyweight = sqrt(mbna_offsetweight / section->global_tie_xsigma);
-				    else
-					xyweight = 0.0;
-//fprintf(stderr,"GLOBAL X: xyweight:%f mbna_offsetweight:%f xsigma:%f\n",xyweight,mbna_offsetweight,section->global_tie_xsigma);
-				    xs[3*nc1]   += xyweight * projected_offset;
-				    xw[3*nc1]   += xyweight;
-					
-				    /* deal with y-axis */
-				    projected_offset = offsety;
-				    if (fabs(section->global_tie_ysigma) > 0.0)
-					xyweight = sqrt(mbna_offsetweight / section->global_tie_ysigma);
-				    else
-					xyweight = 0.0;
-//fprintf(stderr,"GLOBAL Y: xyweight:%f mbna_offsetweight:%f zsigma:%f\n",xyweight,mbna_offsetweight,section->global_tie_ysigma);
-				    xs[3*nc1+1] += xyweight * projected_offset;
-				    xw[3*nc1+1] += xyweight;
-				    }
-				    
-				if (section->global_tie_status != MBNA_TIE_XY)
-				    {
-				    /* deal with z-axis */
-				    projected_offset = offsetz;
-				    if (fabs(section->global_tie_zsigma) > 0.0)
-					zweight = sqrt(mbna_zweightfactor * mbna_offsetweight / section->global_tie_zsigma);
-				    else
-					zweight = 0.0;
-//fprintf(stderr,"GLOBAL Z: zweight:%f mbna_offsetweight:%f sigma:%f\n",zweight,mbna_offsetweight,section->global_tie_zsigma);
-				    xs[3*nc1+2] += zweight * projected_offset;
-				    xw[3*nc1+2] += zweight;
-				    }
-/* fprintf(stderr,"STAGE 3 GLOBAL TIE: %2d:%2d:%2d  status:%d  nc1:%d  tie: ",ifile,isection,section->global_tie_snav,section->global_tie_status,nc1);
-if (section->global_tie_status != MBNA_TIE_Z) fprintf(stderr,"x:%f y:%f ",section->global_tie_offset_x_m,section->global_tie_offset_y_m);
-if (section->global_tie_status != MBNA_TIE_XY) fprintf(stderr,"z:%f ",section->global_tie_offset_z_m);
-fprintf(stderr," xa: ");
-if (section->global_tie_status != MBNA_TIE_Z) fprintf(stderr,"x:%f y:%f ",xa[3*nc1],xa[3*nc1+1]);
-if (section->global_tie_status != MBNA_TIE_XY) fprintf(stderr,"z:%f ",xa[3*nc1+2]);
-fprintf(stderr," x: ");
-if (section->global_tie_status != MBNA_TIE_Z) fprintf(stderr,"x:%f y:%f ",x[3*nc1],x[3*nc1+1]);
-if (section->global_tie_status != MBNA_TIE_XY) fprintf(stderr,"z:%f ",x[3*nc1+2]);
-fprintf(stderr," xx: ");
-if (section->global_tie_status != MBNA_TIE_Z) fprintf(stderr,"x:%f y:%f ",xs[3*nc1],xs[3*nc1+1]);
-if (section->global_tie_status != MBNA_TIE_XY) fprintf(stderr,"z:%f ",xs[3*nc1+2]);
-fprintf(stderr," (off-xa-x-xx): ");
-if (section->global_tie_status != MBNA_TIE_Z) fprintf(stderr,"x:%f y:%f ",offsetx,offsety);
-if (section->global_tie_status != MBNA_TIE_XY) fprintf(stderr,"z:%f ",offsetz);
-fprintf(stderr,"\n");*/
-				}
-			    }
-			}
-
-
-		    /* now loop over all points applying smoothing to the xx[] vector */
-		    nseq = 0;
-		    ndx = 0;
-		    ndx2 = 0;
-		    for (ifile=0;ifile<project.num_files;ifile++)
-			{
-			file = &project.files[ifile];
-			if (file->status != MBNA_FILE_FIXEDNAV)
-			for (isection=0;isection<file->num_sections;isection++)
-			    {
-			    section = &file->sections[isection];
-			    if (section->continuity == MB_NO)
-			    	nseq = 0;
-			    for (isnav=0;isnav<section->num_snav;isnav++)
-				{
-				/* work only with points that are tied */
-				if (section->snav_num_ties[isnav] > 0
-				    || (section->global_tie_status != MBNA_TIE_NONE && section->global_tie_snav == isnav))
-				    {
-				    /* get ids for tied nav points */
-				    if (nseq > 1)
-				    	{
-					nc1 = nc2;
-					time_d1 = time_d2;
-					}
-				    if (nseq > 0)
-				    	{
-					nc2 = nc3;
-					time_d2 = time_d3;
-					}
-				    nc3 = section->snav_invert_id[isnav];
-				    time_d3 = section->snav_time_d[isnav];
-
-				    /* add first derivative constraint if nseq > 1 AND dtime_d > 0.0 */
-				    dtime_d = time_d3 - time_d2;
-				    if (nseq > 0 && dtime_d > 0.0)
-					{
-			    		/* get current offset vector */
-					offsetx = (x[3*nc3]   - x[3*nc2]);
-					offsety = (x[3*nc3+1] - x[3*nc2+1]);
-					offsetz = (x[3*nc3+2] - x[3*nc2+2]);
-
-					/* add remaining offsets to both points */
-					xyweight = mbna_smoothweight / dtime_d;
-					zweight = mbna_smoothweight / dtime_d;
-					xs[3*nc2]   +=  0.5 * xyweight * offsetx;
-					xs[3*nc2+1] +=  0.5 * xyweight * offsety;
-					xs[3*nc2+2] +=  0.5 * zweight * offsetz;
-					xs[3*nc3]   += -0.5 * xyweight * offsetx;
-					xs[3*nc3+1] += -0.5 * xyweight * offsety;
-					xs[3*nc3+2] += -0.5 * zweight * offsetz;
-					xw[3*nc2]   += xyweight;
-					xw[3*nc2+1] += xyweight;
-					xw[3*nc2+2] += zweight;
-					xw[3*nc3]   += xyweight;
-					xw[3*nc3+1] += xyweight;
-					xw[3*nc3+2] += zweight;
-
-					ndx++;
-					}
-
-				    /* add second derivative constraint if nseq > 2  AND dtime_d > 0.0 */
-				    dtime_d = time_d3 - time_d1;
-				    if (nseq > 1 && dtime_d > 0.0)
-					{
-			    		/* get current offset vector */
-					offsetx = x[3*nc1]   - 2.0 * x[3*nc2]   + x[3*nc3];
-					offsety = x[3*nc1+1] - 2.0 * x[3*nc2+1] + x[3*nc3+1];
-					offsetz = x[3*nc1+2] - 2.0 * x[3*nc2+2] + x[3*nc3+2];
-
-					/* add remaining offsets to both points, or just one if one is fixed (weight 2nd derivative 1/4th of first derivative)*/
-					xyweight = mbna_smoothweight / dtime_d / dtime_d;
-					zweight = mbna_smoothweight / dtime_d / dtime_d;
-					xs[3*nc1]   += -xyweight * offsetx;
-					xs[3*nc1+1] += -xyweight * offsety;
-					xs[3*nc1+2] += -zweight * offsetz;
-					xs[3*nc2]   +=  2.0 * xyweight * offsetx;
-					xs[3*nc2+1] +=  2.0 * xyweight * offsety;
-					xs[3*nc2+2] +=  2.0 * zweight * offsetz;
-					xs[3*nc3]   += -xyweight * offsetx;
-					xs[3*nc3+1] += -xyweight * offsety;
-					xs[3*nc3+2] += -zweight * offsetz;
-					xw[3*nc1]   += xyweight;
-					xw[3*nc1+1] += xyweight;
-					xw[3*nc1+2] += zweight;
-					xw[3*nc2]   += xyweight;
-					xw[3*nc2+1] += xyweight;
-					xw[3*nc2+2] += zweight;
-					xw[3*nc3]   += xyweight;
-					xw[3*nc3+1] += xyweight;
-					xw[3*nc3+2] += zweight;
-
-					ndx2++;
-					}
-
-				    /* increment sequence counter */
-				    nseq++;
-				    }
-				}
-			    }
-			}
-
-		    /* calculate perturbation and 2-norm of perturbation */
-		    perturbationsize = 0.0;
-		    for (i=0;i<ncols;i++)
-			{
-			if (xw[i] > 0.0)
-				xx[i] = xs[i] / xw[i];
-			else
-				xx[i] = 0.0;
-			perturbationsize += xx[i] * xx[i];
-			}
-		    perturbationsize = sqrt(perturbationsize) / ncols;
-
-		    /* apply perturbation */
-		    for (i=0;i<ncols;i++)
-			{
-/* fprintf(stderr,"i:%d x:%f xx:%f ",i,x[i],xx[i]);*/
-			x[i] += xx[i];
-			xx[i] = 0.0;
-/* fprintf(stderr,"x:%f\n",x[i]);*/
-			}
-
-		    /* calculate misfit */
-		    misfit_ties = 0.0;
-		    misfit_norm = 0.0;
-		    nmisfit = 0;
-		    for (icrossing=0;icrossing<project.num_crossings;icrossing++)
-			{
-			crossing = &project.crossings[icrossing];
-
-			/* use only set crossings */
-			if (crossing->status == MBNA_CROSSING_STATUS_SET)
-			for (j=0;j<crossing->num_ties;j++)
-			    {
-			    /* get tie */
-			    tie = (struct mbna_tie *) &crossing->ties[j];
-
-			    /* get absolute id for first snav point */
-			    file1 = &project.files[crossing->file_id_1];
-			    section1 = &file1->sections[crossing->section_1];
-			    nc1 = section1->snav_invert_id[tie->snav_1];
-
-			    /* get absolute id for second snav point */
-			    file2 = &project.files[crossing->file_id_2];
-			    section2 = &file2->sections[crossing->section_2];
-			    nc2 = section2->snav_invert_id[tie->snav_2];
-if (nc1 > nsnav - 1 || nc2 > nsnav -1
-|| nc1 < 0 || nc2 < 0)
-fprintf(stderr, "BAD TIE snav ID: %d %d %d\n", nc1, nc2, nsnav);
-
-			    /* get observed offset vector including removal of block solution */
-			    offsetx = (x[3*nc2] + xa[3*nc2] - x[3*nc1] - xa[3*nc1]) - tie->offset_x_m;
-			    offsety = (x[3*nc2+1] + xa[3*nc2+1] - x[3*nc1+1] - xa[3*nc1+1]) - tie->offset_y_m;
-			    offsetz = (x[3*nc2+2] + xa[3*nc2+2] - x[3*nc1+2] - xa[3*nc1+2]) - tie->offset_z_m;
-
-			    if (tie->status != MBNA_TIE_Z)
-				{
-				/* get long axis misfit */
-				misfit = (offsetx * tie->sigmax1[0]
-						+ offsety * tie->sigmax1[1]
-						+ offsetz * tie->sigmax1[2]);
-				misfit_ties += misfit * misfit;
-				misfit_norm += misfit * misfit / tie->sigmar1 / tie->sigmar1;
-				nmisfit++;
-    
-				/* get horizontal axis misfit */
-				misfit = (offsetx * tie->sigmax2[0]
-						+ offsety * tie->sigmax2[1]
-						+ offsetz * tie->sigmax2[2]);
-				misfit_ties += misfit * misfit;
-				misfit_norm += misfit * misfit / tie->sigmar2 / tie->sigmar2;
-				nmisfit++;
-				}
-
-			    if (tie->status != MBNA_TIE_XY)
-				{
-				/* get semi-vertical axis misfit */
-				misfit = (offsetx * tie->sigmax3[0]
-						+ offsety * tie->sigmax3[1]
-						+ offsetz * tie->sigmax3[2]);
-				misfit_ties += misfit * misfit;
-				misfit_norm += misfit * misfit / tie->sigmar3 / tie->sigmar3;
-				nmisfit++;
-				}
-			    }
-			}
-		    for (ifile=0;ifile<project.num_files;ifile++)
-			{
-			/* get file */
-			file = &project.files[ifile];
-			for (isection=0;isection<file->num_sections;isection++)
-			    {
-			    /* get section */
-			    section = &file->sections[isection];
-			    if (section->global_tie_status != MBNA_TIE_NONE)
-				{
-				/* get absolute id for snav point */
-				nc1 = section->snav_invert_id[section->global_tie_snav];
-if (nc1 > nsnav - 1 || nc1 < 0)
-fprintf(stderr, "BAD GLOBAL TIE snav ID: %d %d\n", nc1, nsnav);
-
-				/* get observed offset vector including removal of block solution */
-				offsetx = (x[3*nc1] + xa[3*nc1]) - section->global_tie_offset_x_m;
-				offsety = (x[3*nc1+1] + xa[3*nc1+1]) - section->global_tie_offset_y_m;
-				offsetz = (x[3*nc1+2] + xa[3*nc1+2]) - section->global_tie_offset_z_m;
-		
-				if (section->global_tie_status != MBNA_TIE_Z)
-				    {
-				    /* get x axis misfit */
-				    misfit = offsetx;
-				    misfit_ties += misfit * misfit;
-				    misfit_norm += misfit * misfit / section->global_tie_xsigma / section->global_tie_xsigma;
-				    nmisfit++;
-    
-				    /* get y axis misfit */
-				    misfit = offsety;
-				    misfit_ties += misfit * misfit;
-				    misfit_norm += misfit * misfit / section->global_tie_ysigma / section->global_tie_ysigma;
-				    nmisfit++;
-				    }
-    
-				if (section->global_tie_status != MBNA_TIE_XY)
-				    {
-				    /* get z axis misfit */
-				    misfit = offsetz;
-				    misfit_ties += misfit * misfit;
-				    misfit_norm += misfit * misfit / section->global_tie_zsigma / section->global_tie_zsigma;
-				    nmisfit++;
-				    }
-				}
-			    }
-			}
-		    misfit_ties = sqrt(misfit_ties) / nmisfit;
-		    misfit_norm = sqrt(misfit_norm) / nmisfit;
-
-		    /* check for convergence */
-		    perturbationchange = perturbationsize - perturbationsizeold;
-		    convergencecriterea = fabs(perturbationchange) / misfit_ties_initial;
-		    if (convergencecriterea < MBNA_CONVERGENCE || convergencecriterea > 10000.0 || iter > MBNA_INTERATION_MAX)
-		    	done = MB_YES;
-
-fprintf(stderr,"MODEL INVERT: iter:%d nmisfit:%d misfit_initial:%f misfit_ties_initial:%f misfit_ties:%f misfit_norm_initial:%f misfit_norm:%f perturbationsize:%g perturbationchange:%g convergencecriterea:%g done:%d\n",
-iter,nmisfit,misfit_initial,misfit_ties_initial,misfit_ties,misfit_norm_initial,misfit_norm,perturbationsize,perturbationchange,convergencecriterea,done);
-
-		    if (done == MB_NO)
-		        {
-			perturbationsizeold = perturbationsize;
-		        iter++;
-		    	}
-
-		    /* save solution */
-		    k = 0;
-		    for (i=0;i<project.num_files;i++)
-			{
-			file = &project.files[i];
-			for (j=0;j<file->num_sections;j++)
-			    {
-			    section = &file->sections[j];
-			    for (isnav=0;isnav<section->num_snav;isnav++)
-				{
-				if (section->snav_num_ties[isnav] > 0
-				    || section->global_tie_snav == isnav)
-				    {
-				    k = section->snav_invert_id[isnav];
-				    section->snav_lon_offset[isnav] = (x[3*k] + xa[3*k]) * mbna_mtodeglon;
-/* fprintf(stderr,"isnav:%d k:%d x[3*k]:%f xa[3*k]:%f mbna_mtodeglon:%f section->snav_lon_offset[isnav]:%f\n",
-isnav,k,x[3*k],xa[3*k],mbna_mtodeglon,section->snav_lon_offset[isnav]);*/
-				    section->snav_lat_offset[isnav] = (x[3*k+1] + xa[3*k+1]) * mbna_mtodeglat;
-/* fprintf(stderr,"isnav:%d k:%d x[3*k+1]:%f xa[3*k+1]:%f mbna_mtodeglat:%f section->snav_lat_offset[isnav]:%f\n",
-isnav,k,x[3*k+1],xa[3*k+1],mbna_mtodeglat,section->snav_lat_offset[isnav]);*/
-				    section->snav_z_offset[isnav] = (x[3*k+2] + xa[3*k+2]);
-/* fprintf(stderr,"isnav:%d k:%d x[3*k+2]:%f xa[3*k+2]:%f section->snav_lat_offset[isnav]:%f\n\n",
-isnav,k,x[3*k+2],xa[3*k+2],section->snav_lat_offset[isnav]); */
-				    }
-				}
-			    }
-			}
-
-		    /* interpolate the solution */
-		    mbnavadjust_interpolatesolution();
-
-		    /* save interpolated solution */
-		    k = 0;
-		    for (i=0;i<project.num_files;i++)
-			{
-			file = &project.files[i];
-			for (j=0;j<file->num_sections;j++)
-			    {
-			    section = &file->sections[j];
-			    for (isnav=0;isnav<section->num_snav;isnav++)
-				{
-				section->snav_lon_offset[isnav] = section->snav_lon_offset_int[isnav];
-				section->snav_lat_offset[isnav] = section->snav_lat_offset_int[isnav];
-				section->snav_z_offset[isnav] = section->snav_z_offset_int[isnav];
-				}
-			    }
-			}
-
-		    /* set message dialog on */
-		    if (iter % 100 == 0)
-		    	{
-		    	sprintf(message,"Completed inversion iteration %d Convergence:%.2f", iter, convergencecriterea / MBNA_CONVERGENCE);
-		    	do_message_update(message);
-		    	}
-
-
-		    /* update model plot */
-		    if (project.modelplot == MB_YES && iter % 25 == 0)
-		    	mbnavadjust_modelplot_plot();
-		    }
-		}
-
-	/* output results from navigation solution */
-    	if (project.open == MB_YES
-    		&& project.num_crossings > 0
-		&& (project.num_crossings_analyzed >= 10
-			|| project.num_truecrossings_analyzed == project.num_truecrossings)
-		&& ok_to_invert == MB_YES
-		&& error == MB_ERROR_NO_ERROR)
-    		{
-		/* now output inverse solution */
-		sprintf(message,"Outputting navigation solution...");
-		do_message_update(message);
-
-		sprintf(message, " > Final misfit:%12g\n > Initial misfit:%12g\n",
-			misfit_ties, misfit_initial);
-		do_info_add(message, MB_NO);
-
-		/* get crossing offset results */
-		sprintf(message, " > Nav Tie Offsets (m):  id  observed  solution  error\n");
-		do_info_add(message, MB_NO);
-		for (icrossing=0;icrossing<project.num_crossings;icrossing++)
-		    {
-		    crossing = &project.crossings[icrossing];
-
-		    /* check only set ties */
-		    if (crossing->status == MBNA_CROSSING_STATUS_SET)
-		    for (j=0;j<crossing->num_ties;j++)
-			{
-			tie = (struct mbna_tie *) &crossing->ties[j];
-			offset_x =  project.files[crossing->file_id_2].sections[crossing->section_2].snav_lon_offset[tie->snav_2]
-				- project.files[crossing->file_id_1].sections[crossing->section_1].snav_lon_offset[tie->snav_1];
-			offset_y =  project.files[crossing->file_id_2].sections[crossing->section_2].snav_lat_offset[tie->snav_2]
-				- project.files[crossing->file_id_1].sections[crossing->section_1].snav_lat_offset[tie->snav_1];
-			offset_z =  project.files[crossing->file_id_2].sections[crossing->section_2].snav_z_offset[tie->snav_2]
-				- project.files[crossing->file_id_1].sections[crossing->section_1].snav_z_offset[tie->snav_1];
-			tie->inversion_status = MBNA_INVERSION_CURRENT;
-    			tie->inversion_offset_x = offset_x;
-    			tie->inversion_offset_y = offset_y;
-   			tie->inversion_offset_x_m = offset_x / mbna_mtodeglon;
-    			tie->inversion_offset_y_m = offset_y / mbna_mtodeglat;
-    			tie->inversion_offset_z_m = offset_z;
-/* fprintf(stderr,"mbna_mtodeglon:%f mbna_mtodeglat:%f\n",mbna_mtodeglon,mbna_mtodeglat);
-fprintf(stderr,"offsets:%f %f %f   offsets_m:%f %f %f\n",
-offset_x,offset_y,offset_z,tie->inversion_offset_x_m,tie->inversion_offset_y_m,tie->inversion_offset_z_m);*/
-
-			sprintf(message, " >     %4d   %10.3f %10.3f %10.3f   %10.3f %10.3f %10.3f   %10.3f %10.3f %10.3f\n",
-				icrossing,
-				tie->offset_x_m,
-				tie->offset_y_m,
-				tie->offset_z_m,
-				tie->inversion_offset_x_m,
-				tie->inversion_offset_y_m,
-				tie->inversion_offset_z_m,
-				(tie->inversion_offset_x_m - tie->offset_x_m),
-				(tie->inversion_offset_y_m - tie->offset_y_m),
-				(tie->inversion_offset_z_m - tie->offset_z_m));
-			do_info_add(message, MB_NO);
-			}
-		    }
-
-		/* get global tie results */
-		sprintf(message, " > Global Tie Offsets (m):  id  observed  solution  error\n");
-		do_info_add(message, MB_NO);
-		for (ifile=0;ifile<project.num_files;ifile++)
-		    {
-		    file = &project.files[ifile];
-		    for (isection=0;isection<file->num_sections;isection++)
-			{
-			section = &file->sections[isection];
-			if (section->global_tie_status != MBNA_TIE_NONE)
-			    {
-			    offset_x =  section->snav_lon_offset[section->global_tie_snav];
-			    offset_y =  section->snav_lat_offset[section->global_tie_snav];
-			    offset_z =  section->snav_z_offset[section->global_tie_snav];
-			    
-			    sprintf(message, " >     %2.2d:%2.2d:%2.2d %d   %10.3f %10.3f %10.3f   %10.3f %10.3f %10.3f   %10.3f %10.3f %10.3f\n",
-				ifile,isection,section->global_tie_snav,section->global_tie_status,
-				section->global_tie_offset_x_m,
-				section->global_tie_offset_y_m,
-				section->global_tie_offset_z_m,
-				offset_x / mbna_mtodeglon,
-				offset_y / mbna_mtodeglat,
-				offset_z,
-				(offset_x / mbna_mtodeglon - section->global_tie_offset_x_m),
-				(offset_y / mbna_mtodeglat - section->global_tie_offset_y_m),
-				(offset_z - section->global_tie_offset_z_m));
-			    do_info_add(message, MB_NO);
-			    }
-			}
-		    }
-
-		/* write updated project */
-		project.inversion = MBNA_INVERSION_CURRENT;
-		mbnavadjust_write_project();
-
-		/* deallocate arrays */
-		status = mb_freed(mbna_verbose, __FILE__, __LINE__, (void **)&x,&error);
-		status = mb_freed(mbna_verbose, __FILE__, __LINE__, (void **)&xx,&error);
-		status = mb_freed(mbna_verbose, __FILE__, __LINE__, (void **)&xa,&error);
-		status = mb_freed(mbna_verbose, __FILE__, __LINE__, (void **)&xs,&error);
-		status = mb_freed(mbna_verbose, __FILE__, __LINE__, (void **)&xw,&error);
-
-		/* turn off message dialog */
-		do_message_off();
-		}
-
- 	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-
-int
-mbnavadjust_applynav()
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_applynav";
-	int	status = MB_SUCCESS;
-	struct mbna_file *file;
-	struct mbna_section *section;
-	char	npath[STRING_MAX];
-	char	apath[STRING_MAX];
-	char	opath[STRING_MAX];
-	FILE	*nfp, *afp, *ofp;
-	char	*result;
-	char	buffer[BUFFER_MAX];
-	int	nscan;
-	int	time_i[7];
-	double	time_d;
-	double	navlon;
-	double	navlat;
-	double	heading;
-	double	speed;
-	double	draft;
-	double	roll;
-	double	pitch;
-	double	heave;
-	double	factor;
-	double	zoffset;
-	char	ostring[STRING_MAX];
-	int	mbp_heading_mode;
-	double	mbp_headingbias;
-	int	mbp_rollbias_mode;
-	double	mbp_rollbias;
-	double	mbp_rollbias_port;
-	double	mbp_rollbias_stbd;
-	int	done;
-	int	isection, isnav;
-	double	seconds;
-	int	i;
-
- 	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
-
-	/* output results from navigation solution */
-    	if (project.open == MB_YES
-    		&& project.num_crossings > 0
-		&& (project.num_crossings_analyzed >= 10
-			|| project.num_truecrossings_analyzed == project.num_truecrossings)
-		&& error == MB_ERROR_NO_ERROR)
-    		{
-
-		/* now output inverse solution */
-		sprintf(message,"Applying navigation solution...");
-		do_message_on(message);
-
-		/* generate new nav files */
-		for (i=0;i<project.num_files;i++)
-		    {
-		    file = &project.files[i];
-		    sprintf(npath,"%s/nvs_%4.4d.mb166",
-			project.datadir,i);
-		    sprintf(apath,"%s/nvs_%4.4d.na%d",
-			project.datadir,i,file->output_id);
-		    sprintf(opath,"%s.na%d", file->path, file->output_id);
-		    if (file->status == MBNA_FILE_FIXEDNAV)
-			{
-			sprintf(message, " > Not outputting updated nav to fixed file %s\n", opath);
-			do_info_add(message, MB_NO);
-			if (mbna_verbose == 0)
-				fprintf(stderr,"%s",message);
-			}
-		    else if ((nfp = fopen(npath,"r")) == NULL)
-			{
-			status = MB_FAILURE;
-			error = MB_ERROR_OPEN_FAIL;
-			sprintf(message, " > Unable to read initial nav file %s\n", npath);
-			do_info_add(message, MB_NO);
-			if (mbna_verbose == 0)
-				fprintf(stderr,"%s",message);
-			}
-		    else if ((afp = fopen(apath,"w")) == NULL)
-			{
-		        fclose(nfp);
-			status = MB_FAILURE;
-			error = MB_ERROR_OPEN_FAIL;
-			sprintf(message, " > Unable to open output nav file %s\n", apath);
-			do_info_add(message, MB_NO);
-			if (mbna_verbose == 0)
-				fprintf(stderr,"%s",message);
-			}
-		    else if ((ofp = fopen(opath,"w")) == NULL)
-			{
-		        fclose(nfp);
-		        fclose(afp);
-			status = MB_FAILURE;
-			error = MB_ERROR_OPEN_FAIL;
-			sprintf(message, " > Unable to open output nav file %s\n", opath);
-			do_info_add(message, MB_NO);
-			if (mbna_verbose == 0)
-				fprintf(stderr,"%s",message);
-			}
-		    else
-			{
-			sprintf(message, " > Output updated nav to %s\n", opath);
-			do_info_add(message, MB_NO);
-			if (mbna_verbose == 0)
-				fprintf(stderr,"%s",message);
-
-			/* write file header */
-			right_now = time((time_t *)0);
-			strcpy(date,ctime(&right_now));
-                        date[strlen(date)-1] = '\0';
-			if ((user_ptr = getenv("USER")) == NULL)
-				user_ptr = getenv("LOGNAME");
-			if (user_ptr != NULL)
-				strcpy(user,user_ptr);
-			else
-				strcpy(user, "unknown");
-			gethostname(host,MBP_FILENAMESIZE);
-			sprintf(ostring, "# Adjusted navigation generated using MBnavadjust\n");
-				fprintf(ofp, "%s", ostring);
-				fprintf(afp, "%s", ostring);
-			sprintf(ostring, "# MB-System version:        %s\n",MB_VERSION);
-				fprintf(ofp, "%s", ostring);
-				fprintf(afp, "%s", ostring);
-			sprintf(ostring, "# MB-System build data:     %s\n",MB_BUILD_DATE);
-				fprintf(ofp, "%s", ostring);
-				fprintf(afp, "%s", ostring);
-			sprintf(ostring, "# MBnavadjust version:      %s\n",rcs_id);
-				fprintf(ofp, "%s", ostring);
-				fprintf(afp, "%s", ostring);
-			sprintf(ostring, "# MBnavadjust project name: %s\n",project.name);
-				fprintf(ofp, "%s", ostring);
-				fprintf(afp, "%s", ostring);
-			sprintf(ostring, "# MBnavadjust project path: %s\n",project.path);
-				fprintf(ofp, "%s", ostring);
-				fprintf(afp, "%s", ostring);
-			sprintf(ostring, "# MBnavadjust project home: %s\n",project.home);
-				fprintf(ofp, "%s", ostring);
-				fprintf(afp, "%s", ostring);
-			sprintf(ostring, "# Generated by user <%s> on cpu <%s> at <%s>\n", user,host,date);
-				fprintf(ofp, "%s", ostring);
-				fprintf(afp, "%s", ostring);
-
-			/* read the input nav */
-			isection = 0;
-			section = &file->sections[isection];
-			isnav = 0;
-			done = MB_NO;
-			while (done == MB_NO)
-			    {
-			    if ((result = fgets(buffer,BUFFER_MAX,nfp)) != buffer)
-				{
-				done = MB_YES;
-				}
-			    else if ((nscan = sscanf(buffer, "%d %d %d %d %d %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf",
-						    &time_i[0], &time_i[1], &time_i[2], &time_i[3],
-						    &time_i[4], &seconds, &time_d,
-						    &navlon, &navlat, &heading, &speed,
-						    &draft, &roll, &pitch, &heave)) >= 11)
-				{
-				/* get integer seconds and microseconds */
-				time_i[5] = (int) floor(seconds);
-				time_i[6] = (int) ((seconds - (double)time_i[5]) * 1000000);
-				
-				/* fix nav from early version */
-				if (nscan < 15)
-				    {
-				    draft = 0.0;
-				    roll = 0.0;
-				    pitch = 0.0;
-				    heave = 0.0;
-				    }
-
-				/* get next snav interval if needed */
-				while (time_d > section->snav_time_d[isnav+1]
-				    && !(isection == file->num_sections - 1
-					&& isnav == section->num_snav - 2))
-				    {
-				    if (isnav < section->num_snav - 2)
-					{
-					isnav++;
-					}
-				    else if (isection < file->num_sections)
-					{
-					isection++;
-					section = &file->sections[isection];
-					isnav = 0;
-					}
-				    }
-
-				/* update the nav if possible (and it should be...) */
-				if (time_d < section->snav_time_d[isnav])
-				    {
-				    factor = 0.0;
-				    }
-				else if (time_d > section->snav_time_d[isnav+1])
-				    {
-				    factor = 1.0;
-				    }
-				else
-				    {
-				    if (section->snav_time_d[isnav+1] > section->snav_time_d[isnav])
-					{
-					factor = (time_d - section->snav_time_d[isnav])
-						    / (section->snav_time_d[isnav+1] - section->snav_time_d[isnav]);
-/*if (fabs(time_d - section->snav_time_d[isnav]) < 1.0)
-fprintf(stderr,"%f %f\n",pitch,section->snav_z_offset[isnav]);
-else if (fabs(time_d - section->snav_time_d[isnav+1]) < 1.0)
-fprintf(stderr,"%f %f\n",pitch,section->snav_z_offset[isnav+1]);*/
-					}
-				    else
-					factor = 0.0;
-				    }
-
-				/* update and output only nonzero navigation */
-				if (fabs(navlon) > 0.0000001 && fabs(navlat) > 0.0000001)
-				    {
-				    navlon += section->snav_lon_offset[isnav]
-						    + factor * (section->snav_lon_offset[isnav+1]
-							    - section->snav_lon_offset[isnav]);
-				    navlat += section->snav_lat_offset[isnav]
-						    + factor * (section->snav_lat_offset[isnav+1]
-							    - section->snav_lat_offset[isnav]);
-				    zoffset = section->snav_z_offset[isnav]
-						    + factor * (section->snav_z_offset[isnav+1]
-							    - section->snav_z_offset[isnav]);
-
-				    /* write the updated nav out */
-				    /* printing this string twice because in some situations the first
-					    print has the time_d value come out as "nan" - this is the worst sort
-					    of kluge for a real but mysterious bug - apologies to all who find this
-					    - DWC 18 Aug 2007 R/V Atlantis Cobb Segment JDF Ridge */
-				    sprintf(ostring, "%4.4d %2.2d %2.2d %2.2d %2.2d %2.2d.%6.6d %16.6f %.10f %.10f %.2f %.2f %.3f %.2f %.2f %.2f %.3f\r\n",
-						time_i[0], time_i[1], time_i[2], time_i[3],
-						time_i[4], time_i[5], time_i[6], time_d,
-						navlon, navlat, heading, speed,
-						draft, roll, pitch, heave, zoffset);
-				    sprintf(ostring, "%4.4d %2.2d %2.2d %2.2d %2.2d %2.2d.%6.6d %16.6f %.10f %.10f %.2f %.2f %.3f %.2f %.2f %.2f %.3f\r\n",
-						time_i[0], time_i[1], time_i[2], time_i[3],
-						time_i[4], time_i[5], time_i[6], time_d,
-						navlon, navlat, heading, speed,
-						draft, roll, pitch, heave, zoffset);
-				    fprintf(ofp, "%s", ostring);
-				    fprintf(afp, "%s", ostring);
-/* fprintf(stderr, "NAV OUT: %3.3d:%3.3d:%2.2d factor:%f | %s", i,isection,isnav,factor,ostring); */
-				    }
-				}
-			    }
-		        fclose(nfp);
-		        fclose(afp);
-		        fclose(ofp);
-
-			/* get bias values */
-			mb_pr_get_heading(mbna_verbose, file->path,
-					    &mbp_heading_mode,
-					    &mbp_headingbias,
-					    &error);
-			mb_pr_get_rollbias(mbna_verbose, file->path,
-					    &mbp_rollbias_mode,
-					    &mbp_rollbias,
-					    &mbp_rollbias_port,
-					    &mbp_rollbias_stbd,
-					    &error);
-
-			/* update output file in mbprocess parameter file */
-			status = mb_pr_update_format(mbna_verbose, file->path,
-				    MB_YES, file->format,
-				    &error);
-			status = mb_pr_update_navadj(mbna_verbose, file->path,
-				    MBP_NAVADJ_LLZ, opath,
-				    MBP_NAV_LINEAR,
-				    &error);
-
-			/* update heading bias in mbprocess parameter file */
-			mbp_headingbias = file->heading_bias + file->heading_bias_import;
-			if (mbp_headingbias == 0.0)
-			    {
-			    if (mbp_heading_mode == MBP_HEADING_OFF
-				|| mbp_heading_mode == MBP_HEADING_OFFSET)
-				mbp_heading_mode = MBP_HEADING_OFF;
-			    else if (mbp_heading_mode == MBP_HEADING_CALC
-				|| mbp_heading_mode == MBP_HEADING_CALCOFFSET)
-				mbp_heading_mode = MBP_HEADING_CALC;
-			    }
-			else
-			    {
-			    if (mbp_heading_mode == MBP_HEADING_OFF
-				|| mbp_heading_mode == MBP_HEADING_OFFSET)
-				mbp_heading_mode = MBP_HEADING_OFFSET;
-			    else if (mbp_heading_mode == MBP_HEADING_CALC
-				|| mbp_heading_mode == MBP_HEADING_CALCOFFSET)
-				mbp_heading_mode = MBP_HEADING_CALCOFFSET;
-			    }
-			status = mb_pr_update_heading(mbna_verbose, file->path,
-				    mbp_heading_mode, mbp_headingbias,
-				    &error);
-
-			/* update roll bias in mbprocess parameter file */
-			mbp_rollbias = file->roll_bias + file->roll_bias_import;
-			if (mbp_rollbias == 0.0)
-			    {
-			    if (mbp_rollbias_mode == MBP_ROLLBIAS_DOUBLE)
-				{
-				mbp_rollbias_port = mbp_rollbias
-					+ mbp_rollbias_port - file->roll_bias_import;
-				mbp_rollbias_stbd = mbp_rollbias
-					+ mbp_rollbias_stbd - file->roll_bias_import;
-				}
-			    else
-				mbp_rollbias_mode = MBP_ROLLBIAS_OFF;
-			    }
-			else
-			    {
-			    if (mbp_rollbias_mode == MBP_ROLLBIAS_DOUBLE)
-				{
-				mbp_rollbias_port = mbp_rollbias
-					+ mbp_rollbias_port - file->roll_bias_import;
-				mbp_rollbias_stbd = mbp_rollbias
-					+ mbp_rollbias_stbd - file->roll_bias_import;
-				}
-			    else
-				{
-				mbp_rollbias_mode = MBP_ROLLBIAS_SINGLE;
-				}
-			    }
-			status = mb_pr_update_rollbias(mbna_verbose, file->path,
-				    mbp_rollbias_mode, mbp_rollbias,
-				    mbp_rollbias_port, mbp_rollbias_stbd,
-				    &error);
-			}
-		    }
-
-		/* turn off message dialog */
-		do_message_off();
-		}
-
- 	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-
-
-/*--------------------------------------------------------------------*/
-
-int
-mbnavadjust_interpolatesolution()
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_interpolatesolution";
-	int	status = MB_SUCCESS;
-	struct mbna_file *file;
-	struct mbna_file *pfile;
-	struct mbna_section *section;
-	struct mbna_section *psection;
-	int	previoustie;
-	int	ifilestart;
-	int	isectionstart;
-	int	isnavstart;
-	double	plonoffset;
-	double	platoffset;
-	double	pzoffset;
-	double	ptime_d;
-	double	factor;
-	int	ok;
-	int	ii, jj, iisnav;
-	int	i, j, isnav;
-
- 	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
-
-	/* linearly interpolate solution between tied snavs */
-	previoustie = MB_NO;
-	ifilestart = 0;
-	isectionstart = 0;
-	isnavstart = 0;
-	for (i=0;i<project.num_files;i++)
-	    {
-	    file = &project.files[i];
-	    for (j=0;j<file->num_sections;j++)
-		{
-		section = &file->sections[j];
-		for (isnav=0;isnav<section->num_snav;isnav++)
-		    {
-		    /* deal with constrained snav points */
-		    if (section->snav_num_ties[isnav] > 0
-			|| section->global_tie_snav == isnav)
-			{
-			/* if no previous tie set apply current offset to intervening snav points */
-			if (previoustie == MB_NO)
-			    {
-			    for (ii=ifilestart;ii<=i;ii++)
-			    	{
-				pfile = &project.files[ii];
-				for (jj=0;jj<pfile->num_sections;jj++)
-				    {
-				    psection = &pfile->sections[jj];
-				    for (iisnav=0;iisnav<psection->num_snav;iisnav++)
-					{
-					ok = MB_YES;
-					if (ii == ifilestart && jj < isectionstart)
-						ok = MB_NO;
-					if (ii == ifilestart && jj == isectionstart && iisnav < isnavstart)
-						ok = MB_NO;
-					if (ii == i && jj > j)
-						ok = MB_NO;
-					if (ii == i && jj == j && iisnav > isnav)
-						ok = MB_NO;
-					if (ok == MB_YES)
-						{
-						psection->snav_lon_offset_int[iisnav] = section->snav_lon_offset[isnav];
-						psection->snav_lat_offset_int[iisnav] = section->snav_lat_offset[isnav];
-						psection->snav_z_offset_int[iisnav] = section->snav_z_offset[isnav];
-/*fprintf(stderr,"SET1: %d %d %d   %f %f %f\n",
-ii,jj,iisnav,
-psection->snav_lon_offset_int[iisnav],
-psection->snav_lat_offset_int[iisnav],
-psection->snav_z_offset_int[iisnav]);*/
-						}
-					}
-				    }
-				}
-			    }
-
-			/* if previous tie set interpolate intervening snav points */
-			if (previoustie == MB_YES)
-			    {
-			    pfile = &project.files[ifilestart];
-			    psection = &pfile->sections[isectionstart];
-			    plonoffset = psection->snav_lon_offset[isnavstart];
-			    platoffset = psection->snav_lat_offset[isnavstart];
-			    pzoffset = psection->snav_z_offset[isnavstart];
-			    ptime_d = psection->snav_time_d[isnavstart];
-			    for (ii=ifilestart;ii<=i;ii++)
-			    	{
-				pfile = &project.files[ii];
-				for (jj=0;jj<pfile->num_sections;jj++)
-				    {
-				    psection = &pfile->sections[jj];
-				    for (iisnav=0;iisnav<psection->num_snav;iisnav++)
-					{
-					ok = MB_YES;
-					if (ii == ifilestart && jj < isectionstart)
-						ok = MB_NO;
-					if (ii == ifilestart && jj == isectionstart && iisnav <= isnavstart)
-						ok = MB_NO;
-					if (ii == i && jj > j)
-						ok = MB_NO;
-					if (ii == i && jj == j && iisnav > isnav)
-						ok = MB_NO;
-					if (ok == MB_YES)
-						{
-						if ((section->snav_time_d[isnav] - ptime_d) > 0.0)
-							{
-							factor = (psection->snav_time_d[iisnav] - ptime_d)
-								/ (section->snav_time_d[isnav] - ptime_d);
-							}
-						else
-							{
-							factor = 0.0;
-							}
-						psection->snav_lon_offset_int[iisnav] = plonoffset
-							+ factor * (section->snav_lon_offset[isnav] - plonoffset);
-						psection->snav_lat_offset_int[iisnav] = platoffset
-							+ factor * (section->snav_lat_offset[isnav] - platoffset);
-						psection->snav_z_offset_int[iisnav] = pzoffset
-							+ factor * (section->snav_z_offset[isnav] - pzoffset);
-/*fprintf(stderr,"SET2: %d %d %d   %f %f %f   times: %f %f %f\n",
-ii,jj,iisnav,
-psection->snav_lon_offset_int[iisnav],
-psection->snav_lat_offset_int[iisnav],
-psection->snav_z_offset_int[iisnav],
-section->snav_time_d[isnav],psection->snav_time_d[iisnav],ptime_d);*/
-						}
-					}
-				    }
-				}
-			    }
-
-			/* reset tracking */
-			previoustie = MB_YES;
-			ifilestart = i;
-			isectionstart = j;
-			isnavstart = isnav;
-			}
-
-		    /* deal with a break in continuity */
-		    else if (isnav == 0 && section->continuity == MB_NO)
-		    	{
-			/* if previous tie set apply that offset to intervening snav points */
-			if (previoustie == MB_YES)
-			    {
-			    pfile = &project.files[ifilestart];
-			    psection = &pfile->sections[isectionstart];
-			    plonoffset = psection->snav_lon_offset[isnavstart];
-			    platoffset = psection->snav_lat_offset[isnavstart];
-			    pzoffset = psection->snav_z_offset[isnavstart];
-			    for (ii=ifilestart;ii<=i;ii++)
-			    	{
-				pfile = &project.files[ii];
-				for (jj=0;jj<pfile->num_sections;jj++)
-				    {
-				    psection = &pfile->sections[jj];
-				    for (iisnav=0;iisnav<psection->num_snav;iisnav++)
-					{
-					ok = MB_YES;
-					if (ii == ifilestart && jj < isectionstart)
-						ok = MB_NO;
-					if (ii == ifilestart && jj == isectionstart && iisnav <= isnavstart)
-						ok = MB_NO;
-					if (ii == i && jj > j)
-						ok = MB_NO;
-					if (ii == i && jj == j && iisnav >= isnav)
-						ok = MB_NO;
-					if (ok == MB_YES)
-						{
-						psection->snav_lon_offset_int[iisnav] = plonoffset;
-						psection->snav_lat_offset_int[iisnav] = platoffset;
-						psection->snav_z_offset_int[iisnav] = pzoffset;
-/*fprintf(stderr,"SET3: %d %d %d   %f %f %f\n",
-ii,jj,iisnav,
-psection->snav_lon_offset_int[iisnav],
-psection->snav_lat_offset_int[iisnav],
-psection->snav_z_offset_int[iisnav]);*/
-						}
-
-					}
-				    }
-				}
-			    }
-
-			/* reset tracking */
-			previoustie = MB_NO;
-			ifilestart = i;
-			isectionstart = j;
-			isnavstart = isnav;
-			}
-
-		    /* deal with end of data */
-		    else if (i == project.num_files - 1
-		    	&& j == file->num_sections - 1
-			&& isnav == section->num_snav - 1)
-		    	{
-			/* if previous tie set apply that offset to intervening snav points */
-			if (previoustie == MB_YES)
-			    {
-			    pfile = &project.files[ifilestart];
-			    psection = &pfile->sections[isectionstart];
-			    plonoffset = psection->snav_lon_offset[isnavstart];
-			    platoffset = psection->snav_lat_offset[isnavstart];
-			    pzoffset = psection->snav_z_offset[isnavstart];
-			    for (ii=ifilestart;ii<=i;ii++)
-			    	{
-				pfile = &project.files[ii];
-				for (jj=0;jj<pfile->num_sections;jj++)
-				    {
-				    psection = &pfile->sections[jj];
-				    for (iisnav=0;iisnav<psection->num_snav;iisnav++)
-					{
-					ok = MB_YES;
-					if (ii == ifilestart && jj < isectionstart)
-						ok = MB_NO;
-					if (ii == ifilestart && jj == isectionstart && iisnav <= isnavstart)
-						ok = MB_NO;
-					if (ii == i && jj > j)
-						ok = MB_NO;
-					if (ii == i && jj == j && iisnav > isnav)
-						ok = MB_NO;
-					if (ok == MB_YES)
-						{
-						psection->snav_lon_offset_int[iisnav] = plonoffset;
-						psection->snav_lat_offset_int[iisnav] = platoffset;
-						psection->snav_z_offset_int[iisnav] = pzoffset;
-/*fprintf(stderr,"SET4: %d %d %d   %f %f %f\n",
-ii,jj,iisnav,
-psection->snav_lon_offset_int[iisnav],
-psection->snav_lat_offset_int[iisnav],
-psection->snav_z_offset_int[iisnav]);*/
-						}
-
-					}
-				    }
-				}
-			    }
-
-			/* reset tracking */
-			previoustie = MB_NO;
-			ifilestart = i;
-			isectionstart = j;
-			isnavstart = isnav;
-			}
-
-		    /* zero unconstrained snav points - these will be interpolated later if possible */
-		    else
-		        {
-		    	section->snav_lon_offset_int[isnav] = 0.0;
-		    	section->snav_lat_offset_int[isnav] = 0.0;
-		    	section->snav_z_offset_int[isnav] = 0.0;
-/*fprintf(stderr,"SET5: %d %d %d   %f %f %f\n",
-i,j,isnav,
-section->snav_lon_offset_int[isnav],
-section->snav_lat_offset_int[isnav],
-section->snav_z_offset_int[isnav]);*/
-		        }
-		    }
-		}
-	    }
-/*for (i=0;i<project.num_files;i++)
-{
-file = &project.files[i];
-for (j=0;j<file->num_sections;j++)
-{
-section = &file->sections[j];
-for (isnav=0;isnav<section->num_snav;isnav++)
-{
-fprintf(stderr,"INTERPOLATION: %2d %2d %2d   %f %f %f\n",
-i,j,isnav,
-section->snav_lon_offset_int[isnav],
-section->snav_lat_offset_int[isnav],
-section->snav_z_offset_int[isnav]);
-}
-}
-}*/
-
- 	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbnavadjust_set_modelplot_graphics(void *mp_xgid, int *mp_brdr)
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_set_modelplot_graphics";
-	int	status = MB_SUCCESS;
-	int	i;
-
-	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       mp_xgid:      %p\n",mp_xgid);
-		fprintf(stderr,"dbg2       mp_brdr:      %d %d %d %d\n",
-			mp_brdr[0], mp_brdr[1], mp_brdr[2], mp_brdr[3]);
-		}
-
-	/* set graphics id */
-	pmodp_xgid = mp_xgid;
-
-	/* set borders */
-	for (i=0;i<4;i++)
-		{
-		modp_borders[i] = mp_brdr[i];
-		}
-
-	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-
-int
-mbnavadjust_modelplot_setzoom()
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_modelplot_setzoom";
-	int	status = MB_SUCCESS;
-	int	xo;
-	int	plot_width;
-	double	xscale;
-	int	ipingstart, ipingend;
-	int	itiestart, itieend;
-
- 	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
-
-	/* plot zoom if active */
-	if ((mbna_modelplot_zoom_x1 >= 0 || mbna_modelplot_zoom_x2 >= 0)
-	    && mbna_modelplot_zoom_x1 != mbna_modelplot_zoom_x2)
-		{
-		if (project.modelplot_style == MBNA_MODELPLOT_TIMESERIES)
-			{
-			plot_width = mbna_modelplot_width - 8 * MBNA_MODELPLOT_X_SPACE;
-			xo = 5 * MBNA_MODELPLOT_X_SPACE;
-			xscale = ((double)plot_width) / (mbna_modelplot_end - mbna_modelplot_start + 1);
-
-			ipingstart = (MIN(mbna_modelplot_zoom_x1, mbna_modelplot_zoom_x2) - xo) / xscale
-					+ mbna_modelplot_start;
-			ipingstart = MIN(MAX(ipingstart, 0), project.num_pings - 1);
-			ipingend = (MAX(mbna_modelplot_zoom_x1, mbna_modelplot_zoom_x2) - xo) / xscale
-					+ mbna_modelplot_start;
-			ipingend = MIN(MAX(ipingend, 0), project.num_pings - 1);
-
-			if (ipingend > ipingstart)
-				{
-				mbna_modelplot_zoom = MB_YES;
-				mbna_modelplot_startzoom = ipingstart;
-				mbna_modelplot_endzoom = ipingend;
-				}
-			else
-				mbna_modelplot_zoom = MB_NO;
-			}
-
-		else if (project.modelplot_style == MBNA_MODELPLOT_PERTURBATION)
-			{
-			plot_width = mbna_modelplot_width - 8 * MBNA_MODELPLOT_X_SPACE;
-			xo = 5 * MBNA_MODELPLOT_X_SPACE;
-			xscale = ((double)plot_width) / (mbna_modelplot_end - mbna_modelplot_start + 1);
-
-			ipingstart = (MIN(mbna_modelplot_zoom_x1, mbna_modelplot_zoom_x2) - xo) / xscale
-					+ mbna_modelplot_start;
-			ipingstart = MIN(MAX(ipingstart, 0), project.num_pings - 1);
-			ipingend = (MAX(mbna_modelplot_zoom_x1, mbna_modelplot_zoom_x2) - xo) / xscale
-					+ mbna_modelplot_start;
-			ipingend = MIN(MAX(ipingend, 0), project.num_pings - 1);
-
-			if (ipingend > ipingstart)
-				{
-				mbna_modelplot_zoom = MB_YES;
-				mbna_modelplot_startzoom = ipingstart;
-				mbna_modelplot_endzoom = ipingend;
-				}
-			else
-				mbna_modelplot_zoom = MB_NO;
-			}
-
-		else
-			{
-			itiestart = (MIN(mbna_modelplot_zoom_x1, mbna_modelplot_zoom_x2) - mbna_modelplot_xo)
-					/ mbna_modelplot_xscale;
-			itieend = (MAX(mbna_modelplot_zoom_x1, mbna_modelplot_zoom_x2) - mbna_modelplot_xo)
-					/ mbna_modelplot_xscale;
-			itiestart = MAX(0,itiestart);
-			itieend = MIN(mbna_num_ties_plot-1, itieend);
-			if (itieend > itiestart)
-				{
-				mbna_modelplot_tiezoom = MB_YES;
-				mbna_modelplot_tiestartzoom = itiestart;
-				mbna_modelplot_tieendzoom = itieend;
-				}
-			else
-				mbna_modelplot_tiezoom = MB_NO;
-			}
-
-		mbna_modelplot_zoom_x1 = 0;
-		mbna_modelplot_zoom_x2 = 0;
-		}
-
-	/* reset zoom to off otherwise */
-	else
-		{
-		if (project.modelplot_style == MBNA_MODELPLOT_TIMESERIES)
-			{
-			mbna_modelplot_zoom = MB_NO;
-			mbna_modelplot_start = 0;
-			mbna_modelplot_end = project.num_pings - 1;
-			}
-		else if (project.modelplot_style == MBNA_MODELPLOT_PERTURBATION)
-			{
-			mbna_modelplot_zoom = MB_NO;
-			mbna_modelplot_start = 0;
-			mbna_modelplot_end = project.num_pings - 1;
-			}
-		else
-			{
-			mbna_modelplot_tiezoom = MB_NO;
-			mbna_modelplot_tiestart = 0;
-			mbna_modelplot_tieend = mbna_num_ties_plot - 1;
-			}
-		}
-
-	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-
-int
-mbnavadjust_modelplot_pick(int x, int y)
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_modelplot_pick";
-	int	status = MB_SUCCESS;
-
- 	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2       x:           %d\n",x);
-		fprintf(stderr,"dbg2       y:           %d\n",y);
-		}
-
-	/* find nearest snav pt with tie */
-    	if (project.open == MB_YES
-    		&& project.inversion != MBNA_INVERSION_NONE
-		&& project.modelplot == MB_YES)
-    		{
-		if (project.modelplot_style == MBNA_MODELPLOT_TIMESERIES)
-			{
-			mbnavadjust_modelplot_pick_timeseries(x, y);
-			}
-		else if (project.modelplot_style == MBNA_MODELPLOT_PERTURBATION)
-			{
-			mbnavadjust_modelplot_pick_perturbation(x, y);
-			}
-		else
-			{
-			mbnavadjust_modelplot_pick_tieoffsets(x, y);
-			}
-		}
-
-	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-
-int
-mbnavadjust_modelplot_pick_timeseries(int x, int y)
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_modelplot_pick_timeseries";
-	int	status = MB_SUCCESS;
-	struct mbna_file *file;
-	struct mbna_section *section;
-	struct mbna_crossing *crossing;
-	struct mbna_tie *tie;
-	int	range;
-	int	rangemin;
-	int	pick_crossing;
-	int	pick_tie;
-	int	pick_file;
-	int	pick_section;
-	int	pick_snav;
-	int	ntieselect;
-	int	i, j, ix, iy, iping;
-
- 	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2       x:           %d\n",x);
-		fprintf(stderr,"dbg2       y:           %d\n",y);
-		}
-
-	/* find nearest snav pt with tie */
-    	if (project.open == MB_YES
-    		&& project.inversion != MBNA_INVERSION_NONE
-		&& project.modelplot == MB_YES)
-    		{
-		rangemin = 10000000;
-fprintf(stderr,"mbnavadjust_modelplot_pick_timeseries: %d %d\n",x,y);
-		/* search by looping over crossings */
-		for (i=0;i<project.num_crossings;i++)
-		    {
-		    crossing = &(project.crossings[i]);
-
-		    /* loop over all ties for this crossing */
-		    for (j=0;j<crossing->num_ties;j++)
-		    	{
-			tie = &(crossing->ties[j]);
-
-			/* handle first snav point */
-			file = &project.files[crossing->file_id_1];
-			section = &file->sections[crossing->section_1];
-
-			if (section->show_in_modelplot == MB_YES)
-				{
-				iping = section->modelplot_start_count + section->snav_id[tie->snav_1];
-				ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
-
-				iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * section->snav_lon_offset[tie->snav_1] / mbna_mtodeglon);
-				range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
-				if (range < rangemin)
-					{
-					rangemin = range;
-					pick_crossing = i;
-					pick_tie = j;
-					pick_file = crossing->file_id_1;
-					pick_section = crossing->section_1;
-					pick_snav = tie->snav_1;
-					}
-
-				iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * section->snav_lat_offset[tie->snav_1] / mbna_mtodeglat);
-				range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
-				if (range < rangemin)
-					{
-					rangemin = range;
-					pick_crossing = i;
-					pick_tie = j;
-					pick_file = crossing->file_id_1;
-					pick_section = crossing->section_1;
-					pick_snav = tie->snav_1;
-					}
-
-				iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * section->snav_z_offset[tie->snav_1]);
-				range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
-				if (range < rangemin)
-					{
-					rangemin = range;
-					pick_crossing = i;
-					pick_tie = j;
-					pick_file = crossing->file_id_1;
-					pick_section = crossing->section_1;
-					pick_snav = tie->snav_1;
-					}
-				}
-
-			/* handle second snav point */
-			file = &project.files[crossing->file_id_2];
-			section = &file->sections[crossing->section_2];
-
-			if (section->show_in_modelplot == MB_YES)
-				{
-			iping = section->modelplot_start_count + section->snav_id[tie->snav_2];
-			ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
-
-				iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * section->snav_lon_offset[tie->snav_2] / mbna_mtodeglon);
-				range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
-				if (range < rangemin)
-					{
-					rangemin = range;
-					pick_crossing = i;
-					pick_tie = j;
-					pick_file = crossing->file_id_2;
-					pick_section = crossing->section_2;
-					pick_snav = tie->snav_2;
-					}
-
-				iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * section->snav_lat_offset[tie->snav_2] / mbna_mtodeglat);
-				range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
-				if (range < rangemin)
-					{
-					rangemin = range;
-					pick_crossing = i;
-					pick_tie = j;
-					pick_file = crossing->file_id_2;
-					pick_section = crossing->section_2;
-					pick_snav = tie->snav_2;
-					}
-
-				iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * section->snav_z_offset[tie->snav_2]);
-				range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
-				if (range < rangemin)
-					{
-					rangemin = range;
-					pick_crossing = i;
-					pick_tie = j;
-					pick_file = crossing->file_id_2;
-					pick_section = crossing->section_2;
-					pick_snav = tie->snav_2;
-					}
-				}
-			}
-		    }
-
-		/* deal with successful pick */
-		if (rangemin < 10000000)
-			{
-			/* count the number of ties associated with the selected snav point */
-			ntieselect = 0;
-			for (i=0;i<project.num_crossings;i++)
-			    {
-			    crossing = &(project.crossings[i]);
-
-			    /* loop over all ties for this crossing */
-			    for (j=0;j<crossing->num_ties;j++)
-		    		{
-				tie = &(crossing->ties[j]);
-
-				/* handle first snav point */
-				file = &project.files[crossing->file_id_1];
-				section = &file->sections[crossing->section_1];
-				if (pick_file == crossing->file_id_1
-					&& pick_section == crossing->section_1
-					&& pick_snav == tie->snav_1)
-					ntieselect++;
-
-				/* handle second snav point */
-				file = &project.files[crossing->file_id_2];
-				section = &file->sections[crossing->section_2];
-				if (pick_file == crossing->file_id_2
-					&& pick_section == crossing->section_2
-					&& pick_snav == tie->snav_2)
-					ntieselect++;
-				}
-			    }
-
-			/* if only one tie go ahead and select it and open it in naverr */
-			if (ntieselect == 1)
-				{
-			    	mbna_crossing_select = pick_crossing;
-			    	mbna_tie_select = pick_tie;
-				mbna_modelplot_pickfile = MBNA_SELECT_NONE;
-				mbna_modelplot_picksection = MBNA_SELECT_NONE;
-				mbna_modelplot_picksnav = MBNA_SELECT_NONE;
-
-				/* bring up naverr window if required */
-				if (mbna_naverr_load == MB_NO)
-				    {
-				    do_naverr_init();
-				    }
-
-				/* else if naverr window is up, load selected crossing */
-				else
-				    {
-				    mbnavadjust_naverr_specific(mbna_crossing_select, mbna_tie_select);
-				    mbnavadjust_naverr_plot(MBNA_PLOT_MODE_FIRST);
-				    do_update_naverr();
-				    do_update_status();
-				    }
-				}
-
-			/* else if multiple ties */
-			else if (ntieselect > 1)
-				{
-				mbna_modelplot_pickfile = pick_file;
-				mbna_modelplot_picksection = pick_section;
-				mbna_modelplot_picksnav = pick_snav;
-
-				}
-			}
-		}
-
-	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-
-int
-mbnavadjust_modelplot_pick_perturbation(int x, int y)
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_modelplot_pick_perturbation";
-	int	status = MB_SUCCESS;
-	struct mbna_file *file;
-	struct mbna_section *section;
-	struct mbna_crossing *crossing;
-	struct mbna_tie *tie;
-	int	range;
-	int	rangemin;
-	int	pick_crossing;
-	int	pick_tie;
-	int	pick_file;
-	int	pick_section;
-	int	pick_snav;
-	int	ntieselect;
-	int	i, j, ix, iy, iping;
-
- 	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2       x:           %d\n",x);
-		fprintf(stderr,"dbg2       y:           %d\n",y);
-		}
-
-	/* find nearest snav pt with tie */
-    	if (project.open == MB_YES
-    		&& project.inversion != MBNA_INVERSION_NONE
-		&& project.modelplot == MB_YES)
-    		{
-		rangemin = 10000000;
-fprintf(stderr,"mbnavadjust_modelplot_pick_perturbation: %d %d\n",x,y);
-		/* search by looping over crossings */
-		for (i=0;i<project.num_crossings;i++)
-		    {
-		    crossing = &(project.crossings[i]);
-
-		    /* loop over all ties for this crossing */
-		    for (j=0;j<crossing->num_ties;j++)
-		    	{
-			tie = &(crossing->ties[j]);
-
-			/* handle first snav point */
-			file = &project.files[crossing->file_id_1];
-			section = &file->sections[crossing->section_1];
-
-			if (section->show_in_modelplot == MB_YES)
-				{
-				iping = section->modelplot_start_count + section->snav_id[tie->snav_1];
-				ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
-
-				iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * (section->snav_lon_offset[tie->snav_1] / mbna_mtodeglon - file->block_offset_x));
-				range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
-				if (range < rangemin)
-					{
-					rangemin = range;
-					pick_crossing = i;
-					pick_tie = j;
-					pick_file = crossing->file_id_1;
-					pick_section = crossing->section_1;
-					pick_snav = tie->snav_1;
-					}
-
-				iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * (section->snav_lat_offset[tie->snav_1] / mbna_mtodeglat - file->block_offset_y));
-				range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
-				if (range < rangemin)
-					{
-					rangemin = range;
-					pick_crossing = i;
-					pick_tie = j;
-					pick_file = crossing->file_id_1;
-					pick_section = crossing->section_1;
-					pick_snav = tie->snav_1;
-					}
-
-				iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * (section->snav_z_offset[tie->snav_1] - file->block_offset_z));
-				range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
-				if (range < rangemin)
-					{
-					rangemin = range;
-					pick_crossing = i;
-					pick_tie = j;
-					pick_file = crossing->file_id_1;
-					pick_section = crossing->section_1;
-					pick_snav = tie->snav_1;
-					}
-				}
-
-			/* handle second snav point */
-			file = &project.files[crossing->file_id_2];
-			section = &file->sections[crossing->section_2];
-
-			if (section->show_in_modelplot == MB_YES)
-				{
-			iping = section->modelplot_start_count + section->snav_id[tie->snav_2];
-			ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
-
-				iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * (section->snav_lon_offset[tie->snav_2] / mbna_mtodeglon - file->block_offset_x));
-				range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
-				if (range < rangemin)
-					{
-					rangemin = range;
-					pick_crossing = i;
-					pick_tie = j;
-					pick_file = crossing->file_id_2;
-					pick_section = crossing->section_2;
-					pick_snav = tie->snav_2;
-					}
-
-				iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * (section->snav_lat_offset[tie->snav_2] / mbna_mtodeglat - file->block_offset_y));
-				range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
-				if (range < rangemin)
-					{
-					rangemin = range;
-					pick_crossing = i;
-					pick_tie = j;
-					pick_file = crossing->file_id_2;
-					pick_section = crossing->section_2;
-					pick_snav = tie->snav_2;
-					}
-
-				iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * (section->snav_z_offset[tie->snav_2] - file->block_offset_z));
-				range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
-				if (range < rangemin)
-					{
-					rangemin = range;
-					pick_crossing = i;
-					pick_tie = j;
-					pick_file = crossing->file_id_2;
-					pick_section = crossing->section_2;
-					pick_snav = tie->snav_2;
-					}
-				}
-			}
-		    }
-
-		/* deal with successful pick */
-		if (rangemin < 10000000)
-			{
-			/* count the number of ties associated with the selected snav point */
-			ntieselect = 0;
-			for (i=0;i<project.num_crossings;i++)
-			    {
-			    crossing = &(project.crossings[i]);
-
-			    /* loop over all ties for this crossing */
-			    for (j=0;j<crossing->num_ties;j++)
-		    		{
-				tie = &(crossing->ties[j]);
-
-				/* handle first snav point */
-				file = &project.files[crossing->file_id_1];
-				section = &file->sections[crossing->section_1];
-				if (pick_file == crossing->file_id_1
-					&& pick_section == crossing->section_1
-					&& pick_snav == tie->snav_1)
-					ntieselect++;
-
-				/* handle second snav point */
-				file = &project.files[crossing->file_id_2];
-				section = &file->sections[crossing->section_2];
-				if (pick_file == crossing->file_id_2
-					&& pick_section == crossing->section_2
-					&& pick_snav == tie->snav_2)
-					ntieselect++;
-				}
-			    }
-
-			/* if only one tie go ahead and select it and open it in naverr */
-			if (ntieselect == 1)
-				{
-			    	mbna_crossing_select = pick_crossing;
-			    	mbna_tie_select = pick_tie;
-				mbna_modelplot_pickfile = MBNA_SELECT_NONE;
-				mbna_modelplot_picksection = MBNA_SELECT_NONE;
-				mbna_modelplot_picksnav = MBNA_SELECT_NONE;
-
-				/* bring up naverr window if required */
-				if (mbna_naverr_load == MB_NO)
-				    {
-				    do_naverr_init();
-				    }
-
-				/* else if naverr window is up, load selected crossing */
-				else
-				    {
-				    mbnavadjust_naverr_specific(mbna_crossing_select, mbna_tie_select);
-				    mbnavadjust_naverr_plot(MBNA_PLOT_MODE_FIRST);
-				    do_update_naverr();
-				    do_update_status();
-				    }
-				}
-
-			/* else if multiple ties */
-			else if (ntieselect > 1)
-				{
-				mbna_modelplot_pickfile = pick_file;
-				mbna_modelplot_picksection = pick_section;
-				mbna_modelplot_picksnav = pick_snav;
-
-				}
-			}
-		}
-
-	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-
-int
-mbnavadjust_modelplot_pick_tieoffsets(int x, int y)
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_modelplot_pick_tieoffsets";
-	int	status = MB_SUCCESS;
-	struct mbna_file *file;
-	struct mbna_section *section;
-	struct mbna_crossing *crossing;
-	struct mbna_tie *tie;
-	int	range;
-	int	rangemin;
-	int	pick_crossing;
-	int	pick_tie;
-	int	pick_file;
-	int	pick_section;
-	int	pick_snav;
-	int	i, j, ix, iy;
-
- 	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2       x:           %d\n",x);
-		fprintf(stderr,"dbg2       y:           %d\n",y);
-		}
-
-	/* find nearest snav pt with tie */
-    	if (project.open == MB_YES
-    		&& project.inversion != MBNA_INVERSION_NONE
-		&& project.modelplot == MB_YES)
-    		{
-		rangemin = 10000000;
-
-		/* search by looping over crossings */
-		for (i=0;i<project.num_crossings;i++)
-		    {
-		    crossing = &(project.crossings[i]);
-
-		    /* loop over all ties for this crossing */
-		    for (j=0;j<crossing->num_ties;j++)
-		    	{
-			tie = &(crossing->ties[j]);
-
-			/* handle first snav point */
-			file = &project.files[crossing->file_id_1];
-			section = &file->sections[crossing->section_1];
-
-			ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (tie->isurveyplotindex - mbna_modelplot_tiestart));
-
-			iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * tie->offset_x_m);
-			range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
-			if (range < rangemin)
-				{
-				rangemin = range;
-				pick_crossing = i;
-				pick_tie = j;
-				pick_file = crossing->file_id_1;
-				pick_section = crossing->section_1;
-				pick_snav = tie->snav_1;
-				}
-
-			iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale  * tie->offset_y_m);
-			range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
-			if (range < rangemin)
-				{
-				rangemin = range;
-				pick_crossing = i;
-				pick_tie = j;
-				pick_file = crossing->file_id_1;
-				pick_section = crossing->section_1;
-				pick_snav = tie->snav_1;
-				}
-
-			iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale  * tie->offset_z_m);
-			range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
-			if (range < rangemin)
-				{
-				rangemin = range;
-				pick_crossing = i;
-				pick_tie = j;
-				pick_file = crossing->file_id_1;
-				pick_section = crossing->section_1;
-				pick_snav = tie->snav_1;
-				}
-			}
-		    }
-
-		/* deal with successful pick */
-		if (rangemin < 10000000)
-			{
-			mbna_crossing_select = pick_crossing;
-			mbna_tie_select = pick_tie;
-			/* mbna_modelplot_pickfile = MBNA_SELECT_NONE; */
-			mbna_modelplot_picksection = MBNA_SELECT_NONE;
-			mbna_modelplot_picksnav = MBNA_SELECT_NONE;
-
-			/* bring up naverr window if required */
-			if (mbna_naverr_load == MB_NO)
-			    {
-			    do_naverr_init();
-			    }
-
-			/* else if naverr window is up, load selected crossing */
-			else
-			    {
-			    mbnavadjust_naverr_specific(mbna_crossing_select, mbna_tie_select);
-			    mbnavadjust_naverr_plot(MBNA_PLOT_MODE_FIRST);
-			    do_update_naverr();
-			    do_update_status();
-			    }
-			}
-		}
-
-
-	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-
-int
-mbnavadjust_modelplot_middlepick(int x, int y)
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_modelplot_middlepick";
-	int	status = MB_SUCCESS;
-	struct mbna_file *file;
-	struct mbna_section *section;
-	struct mbna_crossing *crossing;
-	struct mbna_tie *tie;
-	int	range;
-	int	rangemin;
-	int	pick_crossing;
-	int	pick_tie;
-	int	pick_file;
-	int	pick_section;
-	int	pick_snav;
-	int	i, j, ix, iy, iping;
-
- 	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2       x:           %d\n",x);
-		fprintf(stderr,"dbg2       y:           %d\n",y);
-		}
-
-	/* handle middle button pick */
-    	if (project.open == MB_YES
-    		&& project.inversion != MBNA_INVERSION_NONE
-		&& project.modelplot == MB_YES)
-		{
-		/* middle pick for timeseries plot is either choosing one of multiple available
-			ties from a tied crossing (left button) pick, or if that is not the
-			situation, picking the nearest untied crossing */
-		if (project.modelplot_style == MBNA_MODELPLOT_TIMESERIES)
-			{
-			/* first snav pick had multiple ties - now pick which one to use */
-			if (mbna_modelplot_pickfile != MBNA_SELECT_NONE)
-			    {
-			    rangemin = 10000000;
-
-			    for (i=0;i<project.num_crossings;i++)
-				{
-				/* check if this crossing includes the picked snav */
-				crossing = &(project.crossings[i]);
-
-				/* check first snav */
-				if (crossing->file_id_1 == mbna_modelplot_pickfile
-					&& crossing->section_1 == mbna_modelplot_picksection)
-				    {
-				    /* loop over the ties */
-				    for (j=0;j<crossing->num_ties;j++)
-					{
-					tie = &(crossing->ties[j]);
-					if (tie->snav_1 == mbna_modelplot_picksnav)
-					    {
-					    file = &project.files[crossing->file_id_2];
-					    section = &file->sections[crossing->section_2];
-					    iping = section->modelplot_start_count + section->snav_id[tie->snav_2];
-					    ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
-
-					    iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * section->snav_lon_offset[tie->snav_2] / mbna_mtodeglon);
-					    range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
-					    if (range < rangemin)
-						    {
-						    rangemin = range;
-						    pick_crossing = i;
-						    pick_tie = j;
-						    pick_file = crossing->file_id_2;
-						    pick_section = crossing->section_2;
-						    pick_snav = tie->snav_2;
-						    }
-	/*fprintf(stderr,"range:%d rangemin:%d\n",range,rangemin);*/
-
-					    iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * section->snav_lat_offset[tie->snav_2] / mbna_mtodeglat);
-					    range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
-					    if (range < rangemin)
-						    {
-						    rangemin = range;
-						    pick_crossing = i;
-						    pick_tie = j;
-						    pick_file = crossing->file_id_2;
-						    pick_section = crossing->section_2;
-						    pick_snav = tie->snav_2;
-						    }
-	    /*fprintf(stderr,"range:%d rangemin:%d\n",range,rangemin);*/
-
-					    iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * section->snav_z_offset[tie->snav_2]);
-					    range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
-					    if (range < rangemin)
-						    {
-						    rangemin = range;
-						    pick_crossing = i;
-						    pick_tie = j;
-						    pick_file = crossing->file_id_2;
-						    pick_section = crossing->section_2;
-						    pick_snav = tie->snav_2;
-						    }
-	    /*fprintf(stderr,"range:%d rangemin:%d\n",range,rangemin);*/
-					    }
-					}
-				    }
-
-				/* check second snav */
-				if (crossing->file_id_2 == mbna_modelplot_pickfile
-					&& crossing->section_2 == mbna_modelplot_picksection)
-				    {
-				    /* loop over the ties */
-				    for (j=0;j<crossing->num_ties;j++)
-					{
-					tie = &(crossing->ties[j]);
-					if (tie->snav_2 == mbna_modelplot_picksnav)
-					    {
-					    file = &project.files[crossing->file_id_1];
-					    section = &file->sections[crossing->section_1];
-					    iping = section->modelplot_start_count + section->snav_id[tie->snav_1];
-					    ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
-
-					    iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * section->snav_lon_offset[tie->snav_1] / mbna_mtodeglon);
-					    range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
-					    if (range < rangemin)
-						    {
-						    rangemin = range;
-						    pick_crossing = i;
-						    pick_tie = j;
-						    pick_file = crossing->file_id_1;
-						    pick_section = crossing->section_1;
-						    pick_snav = tie->snav_1;
-						    }
-	    /*fprintf(stderr,"range:%d rangemin:%d\n",range,rangemin);*/
-
-					    iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * section->snav_lat_offset[tie->snav_1] / mbna_mtodeglat);
-					    range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
-					    if (range < rangemin)
-						    {
-						    rangemin = range;
-						    pick_crossing = i;
-						    pick_tie = j;
-						    pick_file = crossing->file_id_1;
-						    pick_section = crossing->section_1;
-						    pick_snav = tie->snav_1;
-						    }
-	    /*fprintf(stderr,"range:%d rangemin:%d\n",range,rangemin);*/
-
-					    iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * section->snav_z_offset[tie->snav_1]);
-					    range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
-					    if (range < rangemin)
-						    {
-						    rangemin = range;
-						    pick_crossing = i;
-						    pick_tie = j;
-						    pick_file = crossing->file_id_1;
-						    pick_section = crossing->section_1;
-						    pick_snav = tie->snav_1;
-						    }
-	/*fprintf(stderr,"range:%d rangemin:%d\n",range,rangemin);*/
-					    }
-					}
-				    }
-				}
-
-			    /* deal with successful pick */
-			    if (rangemin < 10000000)
-				{
-				/* select tie and open it in naverr */
-				mbna_crossing_select = pick_crossing;
-				mbna_tie_select = pick_tie;
-				mbna_modelplot_pickfile = MBNA_SELECT_NONE;
-				mbna_modelplot_picksection = MBNA_SELECT_NONE;
-				mbna_modelplot_picksnav = MBNA_SELECT_NONE;
-
-				/* bring up naverr window if required */
-				if (mbna_naverr_load == MB_NO)
-				    {
-				    do_naverr_init();
-				    }
-
-				/* else if naverr window is up, load selected crossing */
-				else
-				    {
-				    mbnavadjust_naverr_specific(mbna_crossing_select, mbna_tie_select);
-				    mbnavadjust_naverr_plot(MBNA_PLOT_MODE_FIRST);
-				    do_update_naverr();
-				    do_update_status();
-				    }
-				}
-			    }
-
-			/* else pick closest untied crossing */
-			else
-			    {
-			    rangemin = 10000000;
-
-			    /* search by looping over crossings */
-			    for (i=0;i<project.num_crossings;i++)
-				{
-				crossing = &(project.crossings[i]);
-
-				/* check only untied crossings */
-				if (crossing->num_ties == 0)
-				    {
-				    file = &project.files[crossing->file_id_1];
-				    section = &file->sections[crossing->section_1];
-
-				    iping = section->modelplot_start_count + section->snav_id[section->num_snav/2];
-				    ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
-
-				    iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * section->snav_lon_offset[section->num_snav/2] / mbna_mtodeglon);
-				    range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
-				    if (range < rangemin)
-					    {
-					    rangemin = range;
-					    pick_crossing = i;
-					    pick_tie = MBNA_SELECT_NONE;
-					    pick_file = crossing->file_id_1;
-					    pick_section = crossing->section_1;
-					    pick_snav = section->num_snav/2;
-					    }
-
-				    iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * section->snav_lat_offset[section->num_snav/2] / mbna_mtodeglat);
-				    range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
-				    if (range < rangemin)
-					    {
-					    rangemin = range;
-					    pick_crossing = i;
-					    pick_tie = MBNA_SELECT_NONE;
-					    pick_file = crossing->file_id_1;
-					    pick_section = crossing->section_1;
-					    pick_snav = section->num_snav/2;
-					    }
-
-				    iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * section->snav_z_offset[section->num_snav/2]);
-				    range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
-				    if (range < rangemin)
-					    {
-					    rangemin = range;
-					    pick_crossing = i;
-					    pick_tie = MBNA_SELECT_NONE;
-					    pick_file = crossing->file_id_1;
-					    pick_section = crossing->section_1;
-					    pick_snav = section->num_snav/2;
-					    }
-
-				    /* handle second snav point */
-				    file = &project.files[crossing->file_id_2];
-				    section = &file->sections[crossing->section_2];
-
-				    iping = section->modelplot_start_count + section->snav_id[section->num_snav/2];
-				    ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
-
-				    iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * section->snav_lon_offset[section->num_snav/2] / mbna_mtodeglon);
-				    range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
-				    if (range < rangemin)
-					    {
-					    rangemin = range;
-					    pick_crossing = i;
-					    pick_tie = MBNA_SELECT_NONE;
-					    pick_file = crossing->file_id_2;
-					    pick_section = crossing->section_2;
-					    pick_snav = section->num_snav/2;
-					    }
-
-				    iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * section->snav_lat_offset[section->num_snav/2] / mbna_mtodeglat);
-				    range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
-				    if (range < rangemin)
-					    {
-					    rangemin = range;
-					    pick_crossing = i;
-					    pick_tie = MBNA_SELECT_NONE;
-					    pick_file = crossing->file_id_2;
-					    pick_section = crossing->section_2;
-					    pick_snav = section->num_snav/2;
-					    }
-
-				    iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * section->snav_z_offset[section->num_snav/2]);
-				    range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
-				    if (range < rangemin)
-					    {
-					    rangemin = range;
-					    pick_crossing = i;
-					    pick_tie = MBNA_SELECT_NONE;
-					    pick_file = crossing->file_id_2;
-					    pick_section = crossing->section_2;
-					    pick_snav = section->num_snav/2;
-					    }
-				    }
-				}
-
-			    /* deal with successful pick */
-			    if (rangemin < 10000000)
-				{
-				mbna_crossing_select = pick_crossing;
-				mbna_tie_select = MBNA_SELECT_NONE;
-				mbna_modelplot_pickfile = MBNA_SELECT_NONE;
-				mbna_modelplot_picksection = MBNA_SELECT_NONE;
-				mbna_modelplot_picksnav = MBNA_SELECT_NONE;
-
-				/* bring up naverr window if required */
-				if (mbna_naverr_load == MB_NO)
-				    {
-				    do_naverr_init();
-				    }
-
-				/* else if naverr window is up, load selected crossing */
-				else
-				    {
-				    mbnavadjust_naverr_specific(mbna_crossing_select, mbna_tie_select);
-				    mbnavadjust_naverr_plot(MBNA_PLOT_MODE_FIRST);
-				    do_update_naverr();
-				    do_update_status();
-				    }
-				}
-			    }
-			}
-
-		/* middle pick for perturbation plot is either choosing one of multiple available
-			ties from a tied crossing (left button) pick, or if that is not the
-			situation, picking the nearest untied crossing */
-		else if (project.modelplot_style == MBNA_MODELPLOT_PERTURBATION)
-			{
-			/* first snav pick had multiple ties - now pick which one to use */
-			if (mbna_modelplot_pickfile != MBNA_SELECT_NONE)
-			    {
-			    rangemin = 10000000;
-
-			    for (i=0;i<project.num_crossings;i++)
-				{
-				/* check if this crossing includes the picked snav */
-				crossing = &(project.crossings[i]);
-
-				/* check first snav */
-				if (crossing->file_id_1 == mbna_modelplot_pickfile
-					&& crossing->section_1 == mbna_modelplot_picksection)
-				    {
-				    /* loop over the ties */
-				    for (j=0;j<crossing->num_ties;j++)
-					{
-					tie = &(crossing->ties[j]);
-					if (tie->snav_1 == mbna_modelplot_picksnav)
-					    {
-					    file = &project.files[crossing->file_id_2];
-					    section = &file->sections[crossing->section_2];
-					    iping = section->modelplot_start_count + section->snav_id[tie->snav_2];
-					    ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
-
-					    iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * (section->snav_lon_offset[tie->snav_2] / mbna_mtodeglon - file->block_offset_x));
-					    range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
-					    if (range < rangemin)
-						    {
-						    rangemin = range;
-						    pick_crossing = i;
-						    pick_tie = j;
-						    pick_file = crossing->file_id_2;
-						    pick_section = crossing->section_2;
-						    pick_snav = tie->snav_2;
-						    }
-	/*fprintf(stderr,"range:%d rangemin:%d\n",range,rangemin);*/
-
-					    iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * (section->snav_lat_offset[tie->snav_2] / mbna_mtodeglat - file->block_offset_y));
-					    range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
-					    if (range < rangemin)
-						    {
-						    rangemin = range;
-						    pick_crossing = i;
-						    pick_tie = j;
-						    pick_file = crossing->file_id_2;
-						    pick_section = crossing->section_2;
-						    pick_snav = tie->snav_2;
-						    }
-	    /*fprintf(stderr,"range:%d rangemin:%d\n",range,rangemin);*/
-
-					    iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * (section->snav_z_offset[tie->snav_2] - file->block_offset_z));
-					    range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
-					    if (range < rangemin)
-						    {
-						    rangemin = range;
-						    pick_crossing = i;
-						    pick_tie = j;
-						    pick_file = crossing->file_id_2;
-						    pick_section = crossing->section_2;
-						    pick_snav = tie->snav_2;
-						    }
-	    /*fprintf(stderr,"range:%d rangemin:%d\n",range,rangemin);*/
-					    }
-					}
-				    }
-
-				/* check second snav */
-				if (crossing->file_id_2 == mbna_modelplot_pickfile
-					&& crossing->section_2 == mbna_modelplot_picksection)
-				    {
-				    /* loop over the ties */
-				    for (j=0;j<crossing->num_ties;j++)
-					{
-					tie = &(crossing->ties[j]);
-					if (tie->snav_2 == mbna_modelplot_picksnav)
-					    {
-					    file = &project.files[crossing->file_id_1];
-					    section = &file->sections[crossing->section_1];
-					    iping = section->modelplot_start_count + section->snav_id[tie->snav_1];
-					    ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
-
-					    iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * (section->snav_lon_offset[tie->snav_1] / mbna_mtodeglon - file->block_offset_x));
-					    range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
-					    if (range < rangemin)
-						    {
-						    rangemin = range;
-						    pick_crossing = i;
-						    pick_tie = j;
-						    pick_file = crossing->file_id_1;
-						    pick_section = crossing->section_1;
-						    pick_snav = tie->snav_1;
-						    }
-	    /*fprintf(stderr,"range:%d rangemin:%d\n",range,rangemin);*/
-
-					    iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * (section->snav_lat_offset[tie->snav_1] / mbna_mtodeglat - file->block_offset_y));
-					    range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
-					    if (range < rangemin)
-						    {
-						    rangemin = range;
-						    pick_crossing = i;
-						    pick_tie = j;
-						    pick_file = crossing->file_id_1;
-						    pick_section = crossing->section_1;
-						    pick_snav = tie->snav_1;
-						    }
-	    /*fprintf(stderr,"range:%d rangemin:%d\n",range,rangemin);*/
-
-					    iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * (section->snav_z_offset[tie->snav_1] - file->block_offset_z));
-					    range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
-					    if (range < rangemin)
-						    {
-						    rangemin = range;
-						    pick_crossing = i;
-						    pick_tie = j;
-						    pick_file = crossing->file_id_1;
-						    pick_section = crossing->section_1;
-						    pick_snav = tie->snav_1;
-						    }
-	/*fprintf(stderr,"range:%d rangemin:%d\n",range,rangemin);*/
-					    }
-					}
-				    }
-				}
-
-			    /* deal with successful pick */
-			    if (rangemin < 10000000)
-				{
-				/* select tie and open it in naverr */
-				mbna_crossing_select = pick_crossing;
-				mbna_tie_select = pick_tie;
-				mbna_modelplot_pickfile = MBNA_SELECT_NONE;
-				mbna_modelplot_picksection = MBNA_SELECT_NONE;
-				mbna_modelplot_picksnav = MBNA_SELECT_NONE;
-
-				/* bring up naverr window if required */
-				if (mbna_naverr_load == MB_NO)
-				    {
-				    do_naverr_init();
-				    }
-
-				/* else if naverr window is up, load selected crossing */
-				else
-				    {
-				    mbnavadjust_naverr_specific(mbna_crossing_select, mbna_tie_select);
-				    mbnavadjust_naverr_plot(MBNA_PLOT_MODE_FIRST);
-				    do_update_naverr();
-				    do_update_status();
-				    }
-				}
-			    }
-
-			/* else pick closest untied crossing */
-			else
-			    {
-			    rangemin = 10000000;
-
-			    /* search by looping over crossings */
-			    for (i=0;i<project.num_crossings;i++)
-				{
-				crossing = &(project.crossings[i]);
-
-				/* check only untied crossings */
-				if (crossing->num_ties == 0)
-				    {
-				    file = &project.files[crossing->file_id_1];
-				    section = &file->sections[crossing->section_1];
-
-				    iping = section->modelplot_start_count + section->snav_id[section->num_snav/2];
-				    ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
-
-				    iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * (section->snav_lon_offset[section->num_snav/2] / mbna_mtodeglon - file->block_offset_x));
-				    range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
-				    if (range < rangemin)
-					    {
-					    rangemin = range;
-					    pick_crossing = i;
-					    pick_tie = MBNA_SELECT_NONE;
-					    pick_file = crossing->file_id_1;
-					    pick_section = crossing->section_1;
-					    pick_snav = section->num_snav/2;
-					    }
-
-				    iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * (section->snav_lat_offset[section->num_snav/2] / mbna_mtodeglat - file->block_offset_y));
-				    range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
-				    if (range < rangemin)
-					    {
-					    rangemin = range;
-					    pick_crossing = i;
-					    pick_tie = MBNA_SELECT_NONE;
-					    pick_file = crossing->file_id_1;
-					    pick_section = crossing->section_1;
-					    pick_snav = section->num_snav/2;
-					    }
-
-				    iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * (section->snav_z_offset[section->num_snav/2] - file->block_offset_z));
-				    range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
-				    if (range < rangemin)
-					    {
-					    rangemin = range;
-					    pick_crossing = i;
-					    pick_tie = MBNA_SELECT_NONE;
-					    pick_file = crossing->file_id_1;
-					    pick_section = crossing->section_1;
-					    pick_snav = section->num_snav/2;
-					    }
-
-				    /* handle second snav point */
-				    file = &project.files[crossing->file_id_2];
-				    section = &file->sections[crossing->section_2];
-
-				    iping = section->modelplot_start_count + section->snav_id[section->num_snav/2];
-				    ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
-
-				    iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * (section->snav_lon_offset[section->num_snav/2] / mbna_mtodeglon - file->block_offset_x));
-				    range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
-				    if (range < rangemin)
-					    {
-					    rangemin = range;
-					    pick_crossing = i;
-					    pick_tie = MBNA_SELECT_NONE;
-					    pick_file = crossing->file_id_2;
-					    pick_section = crossing->section_2;
-					    pick_snav = section->num_snav/2;
-					    }
-
-				    iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * (section->snav_lat_offset[section->num_snav/2] / mbna_mtodeglat - file->block_offset_y));
-				    range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
-				    if (range < rangemin)
-					    {
-					    rangemin = range;
-					    pick_crossing = i;
-					    pick_tie = MBNA_SELECT_NONE;
-					    pick_file = crossing->file_id_2;
-					    pick_section = crossing->section_2;
-					    pick_snav = section->num_snav/2;
-					    }
-
-				    iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * (section->snav_z_offset[section->num_snav/2] - file->block_offset_z));
-				    range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
-				    if (range < rangemin)
-					    {
-					    rangemin = range;
-					    pick_crossing = i;
-					    pick_tie = MBNA_SELECT_NONE;
-					    pick_file = crossing->file_id_2;
-					    pick_section = crossing->section_2;
-					    pick_snav = section->num_snav/2;
-					    }
-				    }
-				}
-
-			    /* deal with successful pick */
-			    if (rangemin < 10000000)
-				{
-				mbna_crossing_select = pick_crossing;
-				mbna_tie_select = MBNA_SELECT_NONE;
-				mbna_modelplot_pickfile = MBNA_SELECT_NONE;
-				mbna_modelplot_picksection = MBNA_SELECT_NONE;
-				mbna_modelplot_picksnav = MBNA_SELECT_NONE;
-
-				/* bring up naverr window if required */
-				if (mbna_naverr_load == MB_NO)
-				    {
-				    do_naverr_init();
-				    }
-
-				/* else if naverr window is up, load selected crossing */
-				else
-				    {
-				    mbnavadjust_naverr_specific(mbna_crossing_select, mbna_tie_select);
-				    mbnavadjust_naverr_plot(MBNA_PLOT_MODE_FIRST);
-				    do_update_naverr();
-				    do_update_status();
-				    }
-				}
-			    }
-			}
-
-		/* middle pick for tie offsets plot is choosing which survey vs survey group (block)
-			to plot by itself */
-		else
-			{
-			rangemin = 10000000;
-
-			/* search by looping over crossings */
-			for (i=0;i<project.num_crossings;i++)
-			    {
-			    crossing = &(project.crossings[i]);
-
-			    /* loop over all ties for this crossing */
-			    for (j=0;j<crossing->num_ties;j++)
-				{
-				tie = &(crossing->ties[j]);
-
-				/* handle first snav point */
-				file = &project.files[crossing->file_id_1];
-				section = &file->sections[crossing->section_1];
-
-				ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (tie->isurveyplotindex - mbna_modelplot_tiestart));
-
-				iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * tie->offset_x_m);
-				range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
-				if (range < rangemin)
-					{
-					rangemin = range;
-					pick_crossing = i;
-					pick_tie = j;
-					pick_file = crossing->file_id_1;
-					pick_section = crossing->section_1;
-					pick_snav = tie->snav_1;
-					}
-
-				iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale  * tie->offset_y_m);
-				range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
-				if (range < rangemin)
-					{
-					rangemin = range;
-					pick_crossing = i;
-					pick_tie = j;
-					pick_file = crossing->file_id_1;
-					pick_section = crossing->section_1;
-					pick_snav = tie->snav_1;
-					}
-
-				iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale  * tie->offset_z_m);
-				range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
-				if (range < rangemin)
-					{
-					rangemin = range;
-					pick_crossing = i;
-					pick_tie = j;
-					pick_file = crossing->file_id_1;
-					pick_section = crossing->section_1;
-					pick_snav = tie->snav_1;
-					}
-				}
-			    }
-
-			/* deal with successful pick */
-			if (rangemin < 10000000)
-				{
-				crossing = &(project.crossings[pick_crossing]);
-				mbna_crossing_select = pick_crossing;
-				mbna_tie_select = pick_tie;
-				mbna_modelplot_pickfile = MBNA_SELECT_NONE;
-				mbna_modelplot_picksection = MBNA_SELECT_NONE;
-				mbna_modelplot_picksnav = MBNA_SELECT_NONE;
-				mbna_modelplot_blocksurvey1 = project.files[crossing->file_id_1].block;
-				mbna_modelplot_blocksurvey2 = project.files[crossing->file_id_2].block;
-				mbna_modelplot_tiezoom = MB_NO;
-
-				/* bring up naverr window if required */
-				if (mbna_naverr_load == MB_NO)
-				    {
-				    do_naverr_init();
-				    }
-
-				/* else if naverr window is up, load selected crossing */
-				else
-				    {
-				    mbnavadjust_naverr_specific(mbna_crossing_select, mbna_tie_select);
-				    mbnavadjust_naverr_plot(MBNA_PLOT_MODE_FIRST);
-				    do_update_naverr();
-				    do_update_status();
-				    }
-				}
-			}
-		}
-
-	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-
-int
-mbnavadjust_modelplot_clearblock()
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_modelplot_clearblock";
-	int	status = MB_SUCCESS;
-	struct mbna_crossing *crossing;
-	int	block1, block2;
-	int	i, j;
-/*fprintf(stderr,"Called %s\n",function_name);*/
-
- 	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
-
-	/* only proceed if model plot is active and a crossing is selected */
-    	if (project.open == MB_YES
-		&& project.modelplot == MB_YES
-		&& mbna_current_crossing != MBNA_SELECT_NONE)
-    		{
-		/* delete all ties associated with the same pair of surveys as the currently selected crossing */
-		crossing = &(project.crossings[mbna_current_crossing]);
-		block1 = project.files[crossing->file_id_1].block;
-		block2 = project.files[crossing->file_id_2].block;
-		for (i=0;i<project.num_crossings;i++)
-		    {
-		    crossing = &(project.crossings[i]);
-		    if (crossing->num_ties > 0
-		    	&& ((project.files[crossing->file_id_1].block == block1
-		    		&& project.files[crossing->file_id_2].block == block2)
-			    || (project.files[crossing->file_id_1].block == block2
-		    		&& project.files[crossing->file_id_2].block == block1)))
-			{
-			for (j=crossing->num_ties-1;j>=0;j--)
-			    {
-			    mbnavadjust_deletetie(i, j, MBNA_CROSSING_STATUS_NONE);
-			    }
-			}
-		    }
-		}
-
- 	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-
-int
-mbnavadjust_modelplot_plot()
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_modelplot_plot";
-	int	status = MB_SUCCESS;
-/*fprintf(stderr,"Called %s\n",function_name);*/
-
- 	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
-
-	/* plot model if an inversion has been performed */
-    	if (project.open == MB_YES
-    		&& project.inversion != MBNA_INVERSION_NONE
-		&& project.modelplot == MB_YES)
-    		{
-		if (project.modelplot_style == MBNA_MODELPLOT_TIMESERIES)
-			{
-			mbnavadjust_modelplot_plot_timeseries();
-			}
-		else if (project.modelplot_style == MBNA_MODELPLOT_PERTURBATION)
-			{
-			mbnavadjust_modelplot_plot_perturbation();
-			}
-		else
-			{
-			mbnavadjust_modelplot_plot_tieoffsets();
-			}
-		}
-
- 	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-
-int
-mbnavadjust_modelplot_plot_timeseries()
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_modelplot_plot_timeseries";
-	int	status = MB_SUCCESS;
-	struct mbna_file *file;
-	struct mbna_section *section;
-	struct mbna_crossing *crossing;
-	struct mbna_tie *tie;
-	double	lon_offset_min;
-	double	lon_offset_max;
-	double	lat_offset_min;
-	double	lat_offset_max;
-	double	z_offset_min;
-	double	z_offset_max;
-	double	xymax, yzmax;
-	int	plot_width;
-	int	plot_height;
-	int	first, iping;
-	char	label[STRING_MAX];
-	int	stringwidth, stringascent, stringdescent;
-	int	pixel;
-	int	ixo, iyo, ix, iy;
-	int	i, j, isnav;
-	int	imodelplot_start, imodelplot_end;
-//fprintf(stderr,"Called %s\n",function_name);
-
- 	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
-
-	/* plot model if an inversion has been performed */
-    	if (project.open == MB_YES
-    		&& project.inversion != MBNA_INVERSION_NONE
-		&& project.modelplot == MB_YES)
-    		{
-		/* first loop over files setting all plot flags off for both files and sections */
-		first = MB_YES;
-		mbna_modelplot_count = 0;
- 		for (i=0;i<project.num_files;i++)
-			{
-			file = &project.files[i];
-			file->show_in_modelplot = MB_NO;
-			for (j=0;j<file->num_sections;j++)
-				{
-				section = &file->sections[j];
-				section->show_in_modelplot = MB_NO;
-				}
-			}
-
-		/* now loop over files setting file or section plot flags on as necessary */
- 		for (i=0;i<project.num_files;i++)
-			{
-			file = &project.files[i];
-
-			/* check if this file will be plotted */
-			if (mbna_view_mode == MBNA_VIEW_MODE_SURVEY || mbna_view_mode == MBNA_VIEW_MODE_WITHSURVEY)
-				{
-				if (file->block == mbna_survey_select)
-					{
-					file->show_in_modelplot = MB_YES;
-					}
-				}
-
-			/* check if this file will be plotted */
-			else if (mbna_view_mode == MBNA_VIEW_MODE_FILE || mbna_view_mode == MBNA_VIEW_MODE_WITHFILE)
-				{
-				if (i == mbna_file_select)
-					{
-					file->show_in_modelplot = MB_YES;
-					}
-				}
-
-			/* check if each section in this file will be plotted */
-			else if (mbna_view_mode == MBNA_VIEW_MODE_WITHSECTION)
-				{
-				for (j=0;j<file->num_sections;j++)
-					{
-					section = &file->sections[j];
-					if (i == mbna_file_select && j == mbna_section_select)
-						{
-						section->show_in_modelplot = MB_YES;
-						}
-					}
-				}
-
-			/* else every file will be plotted */
-			else if (mbna_view_mode == MBNA_VIEW_MODE_ALL)
-				{
-				file->show_in_modelplot = MB_YES;
-				}
-			}
-
-		/* if view mode is with survey loop over all crossings */
-		if (mbna_view_mode == MBNA_VIEW_MODE_WITHSURVEY)
-			{
-			for (i=0;i<project.num_crossings;i++)
-				{
-				crossing = &(project.crossings[i]);
-
-				/* if either file is part of the selected survey
-					then set plot flags on for both files */
-				if (project.files[crossing->file_id_1].block == mbna_survey_select
-				    || project.files[crossing->file_id_2].block == mbna_survey_select)
-					{
-					project.files[crossing->file_id_1].show_in_modelplot = MB_YES;
-					project.files[crossing->file_id_2].show_in_modelplot = MB_YES;
-					}
-				}
-			}
-
-		/* else if view mode is with file loop over all crossings */
-		else if (mbna_view_mode == MBNA_VIEW_MODE_WITHFILE)
-			{
-			for (i=0;i<project.num_crossings;i++)
-				{
-				crossing = &(project.crossings[i]);
-
-				/* if either file is selected
-					then set plot flags on for both files */
-				if (crossing->file_id_1 == mbna_file_select || crossing->file_id_2 == mbna_file_select)
-					{
-					project.files[crossing->file_id_1].show_in_modelplot = MB_YES;
-					project.files[crossing->file_id_2].show_in_modelplot = MB_YES;
-					}
-				}
-			}
-
-		/* else if view mode is with section loop over all crossings */
-		else if (mbna_view_mode == MBNA_VIEW_MODE_WITHSECTION)
-			{
-			for (i=0;i<project.num_crossings;i++)
-				{
-				crossing = &(project.crossings[i]);
-
-				/* if either section is selected
-					then set plot flags on for both files */
-				if ((crossing->file_id_1 == mbna_file_select && crossing->section_1 == mbna_section_select)
-				    || (crossing->file_id_2 == mbna_file_select && crossing->section_2 == mbna_section_select))
-					{
-					project.files[crossing->file_id_1].show_in_modelplot = MB_YES;
-					project.files[crossing->file_id_2].show_in_modelplot = MB_YES;
-					}
-				}
-			}
-
-		/* finally loop over files again setting all section plot flags on for files with plot flags on */
- 		for (i=0;i<project.num_files;i++)
-			{
-			file = &project.files[i];
-			if (file->show_in_modelplot == MB_YES)
-				{
-				for (j=0;j<file->num_sections;j++)
-					{
-					section = &file->sections[j];
-					section->show_in_modelplot = MB_YES;
-					}
-				}
-			}
-
-
-		/* get min maxes by looping over files and sections checking for sections to be plotted */
-		first = MB_YES;
-		mbna_modelplot_count = 0;
- 		for (i=0;i<project.num_files;i++)
-			{
-			file = &project.files[i];
-			for (j=0;j<file->num_sections;j++)
-				{
-				section = &file->sections[j];
-
-				/* if this section will be plotted use the snav values */
-				if (section->show_in_modelplot == MB_YES)
-					{
-					section->modelplot_start_count = mbna_modelplot_count;
-					for (isnav=0;isnav<section->num_snav;isnav++)
-						{
-						if (mbna_modelplot_zoom == MB_NO
-						    || (mbna_modelplot_count >= mbna_modelplot_startzoom && mbna_modelplot_count <= mbna_modelplot_endzoom))
-						    {
-							if (first == MB_YES)
-								{
-								lon_offset_min = section->snav_lon_offset[isnav] / mbna_mtodeglon;
-								lon_offset_max = section->snav_lon_offset[isnav] / mbna_mtodeglon;
-								lat_offset_min = section->snav_lat_offset[isnav] / mbna_mtodeglat;
-								lat_offset_max = section->snav_lat_offset[isnav] / mbna_mtodeglat;
-								z_offset_min = section->snav_z_offset[isnav];
-								z_offset_max = section->snav_z_offset[isnav];
-								first = MB_NO;
-								}
-							else
-								{
-								lon_offset_min = MIN(lon_offset_min, section->snav_lon_offset[isnav] / mbna_mtodeglon);
-								lon_offset_max = MAX(lon_offset_max, section->snav_lon_offset[isnav] / mbna_mtodeglon);
-								lat_offset_min = MIN(lat_offset_min, section->snav_lat_offset[isnav] / mbna_mtodeglat);
-								lat_offset_max = MAX(lat_offset_max, section->snav_lat_offset[isnav] / mbna_mtodeglat);
-								z_offset_min = MIN(z_offset_min, section->snav_z_offset[isnav]);
-								z_offset_max = MAX(z_offset_max, section->snav_z_offset[isnav]);
-								}
-							}
-						}
-					mbna_modelplot_count += section->snav_id[section->num_snav-1];
-					}
-				}
-			}
-
-		/* set plot bounds */
-		if (mbna_modelplot_zoom == MB_YES)
-			{
-			mbna_modelplot_start = mbna_modelplot_startzoom;
-			mbna_modelplot_end = mbna_modelplot_endzoom;
-			}
-		else
-			{
-			mbna_modelplot_start = 0;
-			mbna_modelplot_end = mbna_modelplot_count - 1;
-			}
-
-		/* get scaling */
-		plot_width = mbna_modelplot_width - 8 * MBNA_MODELPLOT_X_SPACE;
-		plot_height = (mbna_modelplot_height - 4 * MBNA_MODELPLOT_Y_SPACE) / 3;
-		mbna_modelplot_xo = 5 * MBNA_MODELPLOT_X_SPACE;
-		mbna_modelplot_yo_lon = MBNA_MODELPLOT_Y_SPACE + plot_height / 2;
-		mbna_modelplot_yo_lat = 2 * MBNA_MODELPLOT_Y_SPACE + 3 * plot_height / 2;
-		mbna_modelplot_yo_z = 3 * MBNA_MODELPLOT_Y_SPACE + 5 * plot_height / 2;
-		xymax = MAX(fabs(lon_offset_min),fabs(lon_offset_max));
-		xymax = MAX(fabs(lat_offset_min),xymax);
-		xymax = MAX(fabs(lat_offset_max),xymax);
-		mbna_modelplot_xscale = ((double)plot_width) / (mbna_modelplot_end - mbna_modelplot_start + 1);
-		mbna_modelplot_yscale = ((double)plot_height) / (2.2 * xymax);
-		yzmax = MAX(fabs(z_offset_min),fabs(z_offset_max));
-		yzmax = MAX(yzmax,0.5);
-		mbna_modelplot_yzscale = ((double)plot_height) / (2.2 * yzmax);
-
-		/* clear screens for first plot */
-		xg_fillrectangle(pmodp_xgid, 0, 0,
-				modp_borders[1], modp_borders[3],
-				pixel_values[mbna_color_background], XG_SOLIDLINE);
-
-		/* plot the bounds */
-		xg_drawrectangle(pmodp_xgid, mbna_modelplot_xo, mbna_modelplot_yo_lon - plot_height / 2, plot_width, plot_height, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-		xg_drawline(pmodp_xgid, mbna_modelplot_xo, mbna_modelplot_yo_lon, mbna_modelplot_xo + plot_width, mbna_modelplot_yo_lon, pixel_values[mbna_color_foreground], XG_DASHLINE);
-		xg_drawrectangle(pmodp_xgid, mbna_modelplot_xo, mbna_modelplot_yo_lat - plot_height / 2, plot_width, plot_height, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-		xg_drawline(pmodp_xgid, mbna_modelplot_xo, mbna_modelplot_yo_lat, mbna_modelplot_xo + plot_width, mbna_modelplot_yo_lat, pixel_values[mbna_color_foreground], XG_DASHLINE);
-		xg_drawrectangle(pmodp_xgid, mbna_modelplot_xo, mbna_modelplot_yo_z - plot_height / 2, plot_width, plot_height, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-		xg_drawline(pmodp_xgid, mbna_modelplot_xo, mbna_modelplot_yo_z, mbna_modelplot_xo + plot_width, mbna_modelplot_yo_z, pixel_values[mbna_color_foreground], XG_DASHLINE);
-
-		/* plot title */
-		if (mbna_view_mode == MBNA_VIEW_MODE_SURVEY)
-			{
-			sprintf(label, "Display Only Selected Survey - Selected Survey:%d", mbna_survey_select);
-			}
-		else if (mbna_view_mode == MBNA_VIEW_MODE_FILE)
-			{
-			sprintf(label, "Display Only Selected File - Selected Survey/File:%d/%d", mbna_survey_select, mbna_file_select);
-			}
-		else if (mbna_view_mode == MBNA_VIEW_MODE_WITHSURVEY)
-			{
-			sprintf(label, "Display With Selected Survey - Selected Survey:%d", mbna_survey_select);
-			}
-		else if (mbna_view_mode == MBNA_VIEW_MODE_WITHFILE)
-			{
-			sprintf(label, "Display With Selected File - Selected Survey/File:%d/%d", mbna_survey_select, mbna_file_select);
-			}
-		else if (mbna_view_mode == MBNA_VIEW_MODE_WITHSECTION)
-			{
-			sprintf(label, "Display With Selected Section: Selected Survey/File/Section:%d/%d/%d",
-				mbna_survey_select, mbna_file_select, mbna_section_select);
-			}
-		else if (mbna_view_mode == MBNA_VIEW_MODE_ALL)
-			{
-			sprintf(label, "Display All Data");
-			}
-
-		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
-		ix = mbna_modelplot_xo + (plot_width - stringwidth) / 2;
-		iy = MBNA_MODELPLOT_Y_SPACE - 2 * stringascent;
-		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-
-		/* plot labels */
-		sprintf(label, "East-West Offset (meters) vs. Ping Count");
-		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
-		ix = mbna_modelplot_xo + (plot_width - stringwidth) / 2;
-		iy = mbna_modelplot_yo_lon - plot_height / 2 - stringascent / 4;
-		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-
-		sprintf(label,"%d", mbna_modelplot_start);
-		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
-		ix = mbna_modelplot_xo - stringwidth / 2;
-		iy = mbna_modelplot_yo_lon + plot_height / 2 + 3 *stringascent / 2;
-		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-
-		sprintf(label,"%d", mbna_modelplot_end);
-		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
-		ix = mbna_modelplot_xo + plot_width - stringwidth / 2;
-		iy = mbna_modelplot_yo_lon + plot_height / 2 + 3 *stringascent / 2;
-		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-
-		sprintf(label,"%.2f", 1.1 * xymax);
-		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
-		ix = mbna_modelplot_xo - stringwidth - stringascent / 4;
-		iy = mbna_modelplot_yo_lon - plot_height / 2 + stringascent / 2;
-		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-
-		sprintf(label,"%.2f", 0.0);
-		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
-		ix = mbna_modelplot_xo - stringwidth - stringascent / 4;
-		iy = mbna_modelplot_yo_lon + stringascent / 2;
-		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-
-		sprintf(label,"%.2f", -1.1 * xymax);
-		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
-		ix = mbna_modelplot_xo - stringwidth - stringascent / 4;
-		iy = mbna_modelplot_yo_lon + plot_height / 2 + stringascent / 2;
-		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-
-
-		sprintf(label, "North-South Offset (meters) vs. Ping Count");
-		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
-		ix = mbna_modelplot_xo + (plot_width - stringwidth) / 2;
-		iy = mbna_modelplot_yo_lat - plot_height / 2 - stringascent / 4;
-		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-
-		sprintf(label,"%d", mbna_modelplot_start);
-		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
-		ix = mbna_modelplot_xo - stringwidth / 2;
-		iy = mbna_modelplot_yo_lat + plot_height / 2 + 3 *stringascent / 2;
-		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-
-		sprintf(label,"%d", mbna_modelplot_end);
-		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
-		ix = mbna_modelplot_xo + plot_width - stringwidth / 2;
-		iy = mbna_modelplot_yo_lat + plot_height / 2 + 3 *stringascent / 2;
-		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-
-		sprintf(label,"%.2f", 1.1 * xymax);
-		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
-		ix = mbna_modelplot_xo - stringwidth - stringascent / 4;
-		iy = mbna_modelplot_yo_lat - plot_height / 2 + stringascent / 2;
-		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-
-		sprintf(label,"%.2f", 0.0);
-		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
-		ix = mbna_modelplot_xo - stringwidth - stringascent / 4;
-		iy = mbna_modelplot_yo_lat + stringascent / 2;
-		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-
-		sprintf(label,"%.2f", -1.1 * xymax);
-		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
-		ix = mbna_modelplot_xo - stringwidth - stringascent / 4;
-		iy = mbna_modelplot_yo_lat + plot_height / 2 + stringascent / 2;
-		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-
-
-		sprintf(label, "Vertical Offset (meters) vs. Ping Count");
-		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
-		ix = mbna_modelplot_xo + (plot_width - stringwidth) / 2;
-		iy = mbna_modelplot_yo_z - plot_height / 2 - stringascent / 4;
-		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-
-		sprintf(label,"%d", mbna_modelplot_start);
-		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
-		ix = mbna_modelplot_xo - stringwidth / 2;
-		iy = mbna_modelplot_yo_z + plot_height / 2 + 3 *stringascent / 2;
-		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-
-		sprintf(label,"%d", mbna_modelplot_end);
-		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
-		ix = mbna_modelplot_xo + plot_width - stringwidth / 2;
-		iy = mbna_modelplot_yo_z + plot_height / 2 + 3 *stringascent / 2;
-		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-
-		sprintf(label,"%.2f", 1.1 * yzmax);
-		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
-		ix = mbna_modelplot_xo - stringwidth - stringascent / 4;
-		iy = mbna_modelplot_yo_z - plot_height / 2 + stringascent / 2;
-		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-
-		sprintf(label,"%.2f", 0.0);
-		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
-		ix = mbna_modelplot_xo - stringwidth - stringascent / 4;
-		iy = mbna_modelplot_yo_z + stringascent / 2;
-		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-
-		sprintf(label,"%.2f", -1.1 * yzmax);
-		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
-		ix = mbna_modelplot_xo - stringwidth - stringascent / 4;
-		iy = mbna_modelplot_yo_z + plot_height / 2 + stringascent / 2;
-		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-
-		/* set clipping */
-		xg_setclip(pmodp_xgid, mbna_modelplot_xo, 0, plot_width, mbna_modelplot_height);
-
-		/* loop over all crossings and plot and plot those without ties in green */
-		for (i=0;i<project.num_crossings;i++)
-		    {
-		    crossing = &(project.crossings[i]);
-		    if (crossing->num_ties== 0)
-		    	{
-			file = &project.files[crossing->file_id_1];
-			section = &file->sections[crossing->section_1];
-			iping = section->modelplot_start_count + section->snav_id[section->num_snav/2];
-
-			if (section->show_in_modelplot == MB_YES
-			    && (mbna_modelplot_zoom == MB_NO
-				|| (iping >= mbna_modelplot_startzoom && iping <= mbna_modelplot_endzoom)))
-				{
-				ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
-				iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * section->snav_lon_offset[section->num_snav/2] / mbna_mtodeglon);
-				xg_drawrectangle(pmodp_xgid, ix-3, iy-1, 3, 3, pixel_values[GREEN], XG_SOLIDLINE);
-				iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * section->snav_lat_offset[section->num_snav/2] / mbna_mtodeglat);
-				xg_drawrectangle(pmodp_xgid, ix-3, iy-1, 3, 3, pixel_values[GREEN], XG_SOLIDLINE);
-				iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * section->snav_z_offset[section->num_snav/2]);
-				xg_drawrectangle(pmodp_xgid, ix-3, iy-1, 3, 3, pixel_values[GREEN], XG_SOLIDLINE);
-				}
-
-			file = &project.files[crossing->file_id_2];
-			section = &file->sections[crossing->section_2];
-			iping = section->modelplot_start_count + section->snav_id[section->num_snav/2];
-
-			if (section->show_in_modelplot == MB_YES
-			    && (mbna_modelplot_zoom == MB_NO
-				|| (iping >= mbna_modelplot_startzoom && iping <= mbna_modelplot_endzoom)))
-				{
-				ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
-				iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * section->snav_lon_offset[section->num_snav/2] / mbna_mtodeglon);
-				xg_drawrectangle(pmodp_xgid, ix-3, iy-1, 3, 3, pixel_values[GREEN], XG_SOLIDLINE);
-				iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * section->snav_lat_offset[section->num_snav/2] / mbna_mtodeglat);
-				xg_drawrectangle(pmodp_xgid, ix-3, iy-1, 3, 3, pixel_values[GREEN], XG_SOLIDLINE);
-				iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * section->snav_z_offset[section->num_snav/2]);
-				xg_drawrectangle(pmodp_xgid, ix-3, iy-1, 3, 3, pixel_values[GREEN], XG_SOLIDLINE);
-				}
-			}
-		    }
-
-		/* Now plot the east-west offsets */
-		ixo = 0;
-		iyo = 0;
- 		for (i=0;i<project.num_files;i++)
-		    {
-		    file = &project.files[i];
-		    for (j=0;j<file->num_sections;j++)
-			{
-			section = &file->sections[j];
-			if (section->show_in_modelplot == MB_YES)
-				{
-				for (isnav=0;isnav<section->num_snav;isnav++)
-				    {
-				    iping = section->modelplot_start_count + section->snav_id[isnav];
-				    ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
-				    iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * section->snav_lon_offset[isnav] / mbna_mtodeglon);
-				    if ((i > 0 || j > 0) && section->continuity == MB_NO && isnav == 0)
-					xg_drawline(pmodp_xgid, ix, mbna_modelplot_yo_lon - plot_height / 2, ix, mbna_modelplot_yo_lon + plot_height / 2, pixel_values[GREEN], XG_SOLIDLINE);
-				    else if (i > 0 || j > 0)
-					{
-					/* if (j == 0 && isnav == 0 && section->continuity == MB_YES)
-						xg_drawline(pmodp_xgid, ix, mbna_modelplot_yo_lon - plot_height / 2, ix, mbna_modelplot_yo_lon + plot_height / 2, pixel_values[CORAL], XG_DASHLINE); */
-					xg_drawline(pmodp_xgid, ixo, iyo, ix, iy, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-					}
-				    ixo = ix;
-				    iyo = iy;
-				    }
-				}
-			}
-		    }
-
-		/* Now plot the north-south offsets */
-		ixo = 0;
-		iyo = 0;
- 		for (i=0;i<project.num_files;i++)
-		    {
-		    file = &project.files[i];
-		    for (j=0;j<file->num_sections;j++)
-			{
-			section = &file->sections[j];
-			if (section->show_in_modelplot == MB_YES)
-				{
-				for (isnav=0;isnav<section->num_snav;isnav++)
-				    {
-				    iping = section->modelplot_start_count + section->snav_id[isnav];
-				    ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
-				    iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * section->snav_lat_offset[isnav] / mbna_mtodeglat);
-				    if ((i > 0 || j > 0) && section->continuity == MB_NO && isnav == 0)
-					xg_drawline(pmodp_xgid, ix, mbna_modelplot_yo_lat - plot_height / 2, ix, mbna_modelplot_yo_lat + plot_height / 2, pixel_values[GREEN], XG_SOLIDLINE);
-				    else if (i > 0 || j > 0)
-					{
-					/* if (j == 0 && isnav == 0 && section->continuity == MB_YES)
-						xg_drawline(pmodp_xgid, ix, mbna_modelplot_yo_lat - plot_height / 2, ix, mbna_modelplot_yo_lat + plot_height / 2, pixel_values[CORAL], XG_DASHLINE); */
-					xg_drawline(pmodp_xgid, ixo, iyo, ix, iy, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-					}
-				    ixo = ix;
-				    iyo = iy;
-				    }
-				}
-			}
-		    }
-
-		/* Now plot the vertical offsets */
-		ixo = 0;
-		iyo = 0;
- 		for (i=0;i<project.num_files;i++)
-		    {
-		    file = &project.files[i];
-		    for (j=0;j<file->num_sections;j++)
-			{
-			section = &file->sections[j];
-			if (section->show_in_modelplot == MB_YES)
-				{
-				for (isnav=0;isnav<section->num_snav;isnav++)
-				    {
-				    iping = section->modelplot_start_count + section->snav_id[isnav];
-				    ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
-				    iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * section->snav_z_offset[isnav]);
-				    if ((i > 0 || j > 0) && section->continuity == MB_NO && isnav == 0)
-					xg_drawline(pmodp_xgid, ix, mbna_modelplot_yo_z - plot_height / 2, ix, mbna_modelplot_yo_z + plot_height / 2, pixel_values[GREEN], XG_SOLIDLINE);
-				    else if (i > 0 || j > 0)
-					{
-					/* if (j == 0 && isnav == 0 && section->continuity == MB_YES)
-						xg_drawline(pmodp_xgid, ix, mbna_modelplot_yo_z - plot_height / 2, ix, mbna_modelplot_yo_z + plot_height / 2, pixel_values[CORAL], XG_DASHLINE); */
-					xg_drawline(pmodp_xgid, ixo, iyo, ix, iy, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-					}
-				    ixo = ix;
-				    iyo = iy;
-				    }
-				}
-			}
-		    }
-
-		/* loop over all crossings and plot ties */
-		for (i=0;i<project.num_crossings;i++)
-		    {
-		    crossing = &(project.crossings[i]);
-		    for (j=0;j<crossing->num_ties;j++)
-		    	{
-			tie = &(crossing->ties[j]);
-
-			if (tie->inversion_status == MBNA_INVERSION_CURRENT)
-				pixel = pixel_values[mbna_color_foreground];
-			else
-				pixel = pixel_values[BLUE];
-
-			file = &project.files[crossing->file_id_1];
-			section = &file->sections[crossing->section_1];
-			iping = section->modelplot_start_count + section->snav_id[tie->snav_1];
-
-			if (section->show_in_modelplot == MB_YES
-			    && (mbna_modelplot_zoom == MB_NO
-				|| (iping >= mbna_modelplot_startzoom && iping <= mbna_modelplot_endzoom)))
-				{
-				ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
-				iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * section->snav_lon_offset[tie->snav_1] / mbna_mtodeglon);
-				xg_drawrectangle(pmodp_xgid, ix-2, iy-2, 5, 5, pixel, XG_SOLIDLINE);
-				iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * section->snav_lat_offset[tie->snav_1] / mbna_mtodeglat);
-				xg_drawrectangle(pmodp_xgid, ix-2, iy-2, 5, 5, pixel, XG_SOLIDLINE);
-				iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * section->snav_z_offset[tie->snav_1]);
-				xg_drawrectangle(pmodp_xgid, ix-2, iy-2, 5, 5, pixel, XG_SOLIDLINE);
-				}
-
-			file = &project.files[crossing->file_id_2];
-			section = &file->sections[crossing->section_2];
-			iping = section->modelplot_start_count + section->snav_id[tie->snav_2];
-
-			if (section->show_in_modelplot == MB_YES
-			    && (mbna_modelplot_zoom == MB_NO
-				|| (iping >= mbna_modelplot_startzoom && iping <= mbna_modelplot_endzoom)))
-				{
-				ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
-				iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * section->snav_lon_offset[tie->snav_2] / mbna_mtodeglon);
-				xg_drawrectangle(pmodp_xgid, ix-2, iy-2, 5, 5, pixel, XG_SOLIDLINE);
-				iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * section->snav_lat_offset[tie->snav_2] / mbna_mtodeglat);
-				xg_drawrectangle(pmodp_xgid, ix-2, iy-2, 5, 5, pixel, XG_SOLIDLINE);
-				iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * section->snav_z_offset[tie->snav_2]);
-				xg_drawrectangle(pmodp_xgid, ix-2, iy-2, 5, 5, pixel, XG_SOLIDLINE);
-				}
-			}
-		    }
-
-		/* Loop over all files plotting global ties */
- 		for (i=0;i<project.num_files;i++)
-		    {
-		    file = &project.files[i];
-		    for (j=0;j<file->num_sections;j++)
-			{
-			section = &file->sections[j];
-			if (section->show_in_modelplot == MB_YES && section->global_tie_status != MBNA_TIE_NONE)
-				{
-				for (isnav=0;isnav<section->num_snav;isnav++)
-				    {
-				    iping = section->modelplot_start_count + section->snav_id[section->global_tie_snav];
-				    ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
-				    
-				    if (section->global_tie_status != MBNA_TIE_Z)
-					{
-					/* east-west offsets */
-					iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * section->snav_lon_offset[section->global_tie_snav] / mbna_mtodeglon);
-					xg_drawline(pmodp_xgid, ix, mbna_modelplot_yo_lon, ix, iy, pixel_values[ORANGE], XG_SOLIDLINE);
-					xg_fillrectangle(pmodp_xgid, ix-2, iy-2, 5, 5, pixel_values[ORANGE], XG_SOLIDLINE);
-					xg_drawrectangle(pmodp_xgid, ix-2, iy-2, 5, 5, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-					
-					/* north-south offsets */
-					iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * section->snav_lat_offset[section->global_tie_snav] / mbna_mtodeglat);
-					xg_drawline(pmodp_xgid, ix, mbna_modelplot_yo_lat, ix, iy, pixel_values[ORANGE], XG_SOLIDLINE);
-					xg_fillrectangle(pmodp_xgid, ix-2, iy-2, 5, 5, pixel_values[ORANGE], XG_SOLIDLINE);
-					xg_drawrectangle(pmodp_xgid, ix-2, iy-2, 5, 5, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-					}
-				    
-				    if (section->global_tie_status != MBNA_TIE_XY)
-					{
-					/* vertical offsets */
-					iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * section->snav_z_offset[section->global_tie_snav]);
-					xg_drawline(pmodp_xgid, ix, mbna_modelplot_yo_z, ix, iy, pixel_values[ORANGE], XG_SOLIDLINE);
-					xg_fillrectangle(pmodp_xgid, ix-2, iy-2, 5, 5, pixel_values[ORANGE], XG_SOLIDLINE);
-					xg_drawrectangle(pmodp_xgid, ix-2, iy-2, 5, 5, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-					}
-				    }
-				}
-			}
-		    }
-
-		/* plot current tie in red */
-		if (mbna_current_crossing != MBNA_SELECT_NONE && mbna_current_tie != MBNA_SELECT_NONE)
-			{
-			crossing = &(project.crossings[mbna_current_crossing]);
-			tie = &(crossing->ties[mbna_current_tie]);
-
-			file = &project.files[crossing->file_id_1];
-			section = &file->sections[crossing->section_1];
-			iping = section->modelplot_start_count + section->snav_id[tie->snav_1];
-
-			if (section->show_in_modelplot == MB_YES
-			    && (mbna_modelplot_zoom == MB_NO
-				|| (iping >= mbna_modelplot_startzoom && iping <= mbna_modelplot_endzoom)))
-				{
-				ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
-				iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * section->snav_lon_offset[tie->snav_1] / mbna_mtodeglon);
-				xg_fillrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[RED], XG_SOLIDLINE);
-				xg_drawrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-				iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * section->snav_lat_offset[tie->snav_1] / mbna_mtodeglat);
-				xg_fillrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[RED], XG_SOLIDLINE);
-				xg_drawrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-				iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * section->snav_z_offset[tie->snav_1]);
-				xg_fillrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[RED], XG_SOLIDLINE);
-				xg_drawrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-				}
-
-			file = &project.files[crossing->file_id_2];
-			section = &file->sections[crossing->section_2];
-			iping = section->modelplot_start_count + section->snav_id[tie->snav_2];
-
-			if (section->show_in_modelplot == MB_YES
-			    && (mbna_modelplot_zoom == MB_NO
-				|| (iping >= mbna_modelplot_startzoom && iping <= mbna_modelplot_endzoom)))
-				{
-				ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
-				iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * section->snav_lon_offset[tie->snav_2] / mbna_mtodeglon);
-				xg_fillrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[RED], XG_SOLIDLINE);
-				xg_drawrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-				iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * section->snav_lat_offset[tie->snav_2] / mbna_mtodeglat);
-				xg_fillrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[RED], XG_SOLIDLINE);
-				xg_drawrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-				iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * section->snav_z_offset[tie->snav_2]);
-				xg_fillrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[RED], XG_SOLIDLINE);
-				xg_drawrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-				}
-			}
-
-		/* or if tie not selected then plot current crossing in red */
-		else if (mbna_current_crossing != MBNA_SELECT_NONE)
-			{
-			crossing = &(project.crossings[mbna_current_crossing]);
-
-			file = &project.files[crossing->file_id_1];
-			section = &file->sections[crossing->section_1];
-			iping = section->modelplot_start_count + section->snav_id[section->num_snav/2];
-
-			if (section->show_in_modelplot == MB_YES
-			    && (mbna_modelplot_zoom == MB_NO
-				|| (iping >= mbna_modelplot_startzoom && iping <= mbna_modelplot_endzoom)))
-				{
-				ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
-				iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * section->snav_lon_offset[section->num_snav/2] / mbna_mtodeglon);
-				xg_fillrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[RED], XG_SOLIDLINE);
-				xg_drawrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-				iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * section->snav_lat_offset[section->num_snav/2] / mbna_mtodeglat);
-				xg_fillrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[RED], XG_SOLIDLINE);
-				xg_drawrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-				iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * section->snav_z_offset[section->num_snav/2]);
-				xg_fillrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[RED], XG_SOLIDLINE);
-				xg_drawrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-				}
-
-			file = &project.files[crossing->file_id_2];
-			section = &file->sections[crossing->section_2];
-			iping = section->modelplot_start_count + section->snav_id[section->num_snav/2];
-
-			if (section->show_in_modelplot == MB_YES
-			    && (mbna_modelplot_zoom == MB_NO
-				|| (iping >= mbna_modelplot_startzoom && iping <= mbna_modelplot_endzoom)))
-				{
-				ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
-				iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * section->snav_lon_offset[section->num_snav/2] / mbna_mtodeglon);
-				xg_fillrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[RED], XG_SOLIDLINE);
-				xg_drawrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-				iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * section->snav_lat_offset[section->num_snav/2] / mbna_mtodeglat);
-				xg_fillrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[RED], XG_SOLIDLINE);
-				xg_drawrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-				iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * section->snav_z_offset[section->num_snav/2]);
-				xg_fillrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[RED], XG_SOLIDLINE);
-				xg_drawrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-				}
-			}
-
-		/* if a modelplot pick did not resolve a single tie, plot the options for a second pick */
-		if (mbna_modelplot_pickfile != MBNA_SELECT_NONE)
-			{
-			for (i=0;i<project.num_crossings;i++)
-				{
-				/* check if this crossing includes the picked snav */
-				crossing = &(project.crossings[i]);
-
-				/* check first snav */
-				if (crossing->file_id_1 == mbna_modelplot_pickfile
-					&& crossing->section_1 == mbna_modelplot_picksection)
-					{
-					/* loop over the ties */
-					for (j=0;j<crossing->num_ties;j++)
-						{
-						tie = &(crossing->ties[j]);
-						if (crossing->file_id_1 == mbna_modelplot_pickfile
-						    && crossing->section_1 == mbna_modelplot_picksection
-						    && tie->snav_1 == mbna_modelplot_picksnav)
-							{
-							file = &project.files[crossing->file_id_1];
-							section = &file->sections[crossing->section_1];
-							iping = section->modelplot_start_count + section->snav_id[tie->snav_1];
-
-							if (section->show_in_modelplot == MB_YES
-							    && (mbna_modelplot_zoom == MB_NO
-								|| (iping >= mbna_modelplot_startzoom && iping <= mbna_modelplot_endzoom)))
-								{
-								ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
-								iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * section->snav_lon_offset[tie->snav_1] / mbna_mtodeglon);
-								xg_fillrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[RED], XG_SOLIDLINE);
-								xg_drawrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-								iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * section->snav_lat_offset[tie->snav_1] / mbna_mtodeglat);
-								xg_fillrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[RED], XG_SOLIDLINE);
-								xg_drawrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-								iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * section->snav_z_offset[tie->snav_1]);
-								xg_fillrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[RED], XG_SOLIDLINE);
-								xg_drawrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-								}
-
-							file = &project.files[crossing->file_id_2];
-							section = &file->sections[crossing->section_2];
-							iping = section->modelplot_start_count + section->snav_id[tie->snav_2];
-
-							if (section->show_in_modelplot == MB_YES
-							    && (mbna_modelplot_zoom == MB_NO
-								|| (iping >= mbna_modelplot_startzoom && iping <= mbna_modelplot_endzoom)))
-								{
-								ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
-								iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * section->snav_lon_offset[tie->snav_2] / mbna_mtodeglon);
-								xg_fillrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[6], XG_SOLIDLINE);
-								xg_drawrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-								iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * section->snav_lat_offset[tie->snav_2] / mbna_mtodeglat);
-								xg_fillrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[6], XG_SOLIDLINE);
-								xg_drawrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-								iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * section->snav_z_offset[tie->snav_2]);
-								xg_fillrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[6], XG_SOLIDLINE);
-								xg_drawrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-								}
-							}
-						}
-					}
-
-				/* check second snav */
-				if (crossing->file_id_2 == mbna_modelplot_pickfile
-					&& crossing->section_2 == mbna_modelplot_picksection)
-					{
-					/* loop over the ties */
-					for (j=0;j<crossing->num_ties;j++)
-						{
-						tie = &(crossing->ties[j]);
-						if (crossing->file_id_2 == mbna_modelplot_pickfile
-						    && crossing->section_2 == mbna_modelplot_picksection
-						    && tie->snav_2 == mbna_modelplot_picksnav)
-							{
-							file = &project.files[crossing->file_id_2];
-							section = &file->sections[crossing->section_2];
-							iping = section->modelplot_start_count + section->snav_id[tie->snav_2];
-
-							if (section->show_in_modelplot == MB_YES
-							    && (mbna_modelplot_zoom == MB_NO
-								|| (iping >= mbna_modelplot_startzoom && iping <= mbna_modelplot_endzoom)))
-								{
-								ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
-								iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * section->snav_lon_offset[tie->snav_2] / mbna_mtodeglon);
-								xg_fillrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[RED], XG_SOLIDLINE);
-								xg_drawrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-								iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * section->snav_lat_offset[tie->snav_2] / mbna_mtodeglat);
-								xg_fillrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[RED], XG_SOLIDLINE);
-								xg_drawrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-								iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * section->snav_z_offset[tie->snav_2]);
-								xg_fillrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[RED], XG_SOLIDLINE);
-								xg_drawrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-								}
-
-							file = &project.files[crossing->file_id_1];
-							section = &file->sections[crossing->section_1];
-							iping = section->modelplot_start_count + section->snav_id[tie->snav_1];
-
-							if (section->show_in_modelplot == MB_YES
-							    && (mbna_modelplot_zoom == MB_NO
-								|| (iping >= mbna_modelplot_startzoom && iping <= mbna_modelplot_endzoom)))
-								{
-								ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
-								iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * section->snav_lon_offset[tie->snav_1] / mbna_mtodeglon);
-								xg_fillrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[6], XG_SOLIDLINE);
-								xg_drawrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-								iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * section->snav_lat_offset[tie->snav_1] / mbna_mtodeglat);
-								xg_fillrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[6], XG_SOLIDLINE);
-								xg_drawrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-								iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * section->snav_z_offset[tie->snav_1]);
-								xg_fillrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[6], XG_SOLIDLINE);
-								xg_drawrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-								}
-							}
-						}
-					}
-				}
-			}
-
-		/* plot zoom if active */
-		if (mbna_modelplot_zoom_x1 != 0 || mbna_modelplot_zoom_x2 != 0)
-			{
-			imodelplot_start = (MIN(mbna_modelplot_zoom_x1, mbna_modelplot_zoom_x2) - mbna_modelplot_xo) / mbna_modelplot_xscale + mbna_modelplot_start;
-			imodelplot_start = MIN(MAX(imodelplot_start, 0), project.num_pings - 1);
-			imodelplot_end = (MAX(mbna_modelplot_zoom_x1, mbna_modelplot_zoom_x2) - mbna_modelplot_xo) / mbna_modelplot_xscale + mbna_modelplot_start;
-			imodelplot_end = MIN(MAX(imodelplot_end, 0), project.num_pings - 1);
-
-			ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (imodelplot_start - mbna_modelplot_start));
-		   	xg_drawline(pmodp_xgid, ix, mbna_modelplot_yo_lon - plot_height / 2, ix, mbna_modelplot_yo_lon + plot_height / 2, pixel_values[mbna_color_foreground], XG_DASHLINE);
-		   	xg_drawline(pmodp_xgid, ix, mbna_modelplot_yo_lat - plot_height / 2, ix, mbna_modelplot_yo_lat + plot_height / 2, pixel_values[mbna_color_foreground], XG_DASHLINE);
-		   	xg_drawline(pmodp_xgid, ix, mbna_modelplot_yo_z - plot_height / 2, ix, mbna_modelplot_yo_z + plot_height / 2, pixel_values[mbna_color_foreground], XG_DASHLINE);
-
-			ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (imodelplot_end - mbna_modelplot_start));
-		   	xg_drawline(pmodp_xgid, ix, mbna_modelplot_yo_lon - plot_height / 2, ix, mbna_modelplot_yo_lon + plot_height / 2, pixel_values[mbna_color_foreground], XG_DASHLINE);
-		   	xg_drawline(pmodp_xgid, ix, mbna_modelplot_yo_lat - plot_height / 2, ix, mbna_modelplot_yo_lat + plot_height / 2, pixel_values[mbna_color_foreground], XG_DASHLINE);
-		   	xg_drawline(pmodp_xgid, ix, mbna_modelplot_yo_z - plot_height / 2, ix, mbna_modelplot_yo_z + plot_height / 2, pixel_values[mbna_color_foreground], XG_DASHLINE);
-			}
-
-		/* reset clipping */
-		xg_setclip(pmodp_xgid, 0, 0, mbna_modelplot_width, mbna_modelplot_height);
-
-		}
-
- 	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-
-int
-mbnavadjust_modelplot_plot_perturbation()
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_modelplot_plot_perturbation";
-	int	status = MB_SUCCESS;
-	struct mbna_file *file;
-	struct mbna_section *section;
-	struct mbna_crossing *crossing;
-	struct mbna_tie *tie;
-	double	lon_offset_min;
-	double	lon_offset_max;
-	double	lat_offset_min;
-	double	lat_offset_max;
-	double	z_offset_min;
-	double	z_offset_max;
-	double	xymax, yzmax;
-	int	plot_width;
-	int	plot_height;
-	int	first, iping;
-	char	label[STRING_MAX];
-	int	stringwidth, stringascent, stringdescent;
-	int	pixel;
-	int	ixo, iyo, ix, iy;
-	int	i, j, isnav;
-	int	imodelplot_start, imodelplot_end;
-//fprintf(stderr,"Called %s\n",function_name);
-
- 	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
-
-	/* plot model if an inversion has been performed */
-    	if (project.open == MB_YES
-    		&& project.inversion != MBNA_INVERSION_NONE
-		&& project.modelplot == MB_YES)
-    		{
-		/* first loop over files setting all plot flags off for both files and sections */
-		first = MB_YES;
-		mbna_modelplot_count = 0;
- 		for (i=0;i<project.num_files;i++)
-			{
-			file = &project.files[i];
-			file->show_in_modelplot = MB_NO;
-			for (j=0;j<file->num_sections;j++)
-				{
-				section = &file->sections[j];
-				section->show_in_modelplot = MB_NO;
-				}
-			}
-
-		/* now loop over files setting file or section plot flags on as necessary */
- 		for (i=0;i<project.num_files;i++)
-			{
-			file = &project.files[i];
-
-			/* check if this file will be plotted */
-			if (mbna_view_mode == MBNA_VIEW_MODE_SURVEY || mbna_view_mode == MBNA_VIEW_MODE_WITHSURVEY)
-				{
-				if (file->block == mbna_survey_select)
-					{
-					file->show_in_modelplot = MB_YES;
-					}
-				}
-
-			/* check if this file will be plotted */
-			else if (mbna_view_mode == MBNA_VIEW_MODE_FILE || mbna_view_mode == MBNA_VIEW_MODE_WITHFILE)
-				{
-				if (i == mbna_file_select)
-					{
-					file->show_in_modelplot = MB_YES;
-					}
-				}
-
-			/* check if each section in this file will be plotted */
-			else if (mbna_view_mode == MBNA_VIEW_MODE_WITHSECTION)
-				{
-				for (j=0;j<file->num_sections;j++)
-					{
-					section = &file->sections[j];
-					if (i == mbna_file_select && j == mbna_section_select)
-						{
-						section->show_in_modelplot = MB_YES;
-						}
-					}
-				}
-
-			/* else every file will be plotted */
-			else if (mbna_view_mode == MBNA_VIEW_MODE_ALL)
-				{
-				file->show_in_modelplot = MB_YES;
-				}
-			}
-
-		/* if view mode is with survey loop over all crossings */
-		if (mbna_view_mode == MBNA_VIEW_MODE_WITHSURVEY)
-			{
-			for (i=0;i<project.num_crossings;i++)
-				{
-				crossing = &(project.crossings[i]);
-
-				/* if either file is part of the selected survey
-					then set plot flags on for both files */
-				if (project.files[crossing->file_id_1].block == mbna_survey_select
-				    || project.files[crossing->file_id_2].block == mbna_survey_select)
-					{
-					project.files[crossing->file_id_1].show_in_modelplot = MB_YES;
-					project.files[crossing->file_id_2].show_in_modelplot = MB_YES;
-					}
-				}
-			}
-
-		/* else if view mode is with file loop over all crossings */
-		else if (mbna_view_mode == MBNA_VIEW_MODE_WITHFILE)
-			{
-			for (i=0;i<project.num_crossings;i++)
-				{
-				crossing = &(project.crossings[i]);
-
-				/* if either file is selected
-					then set plot flags on for both files */
-				if (crossing->file_id_1 == mbna_file_select || crossing->file_id_2 == mbna_file_select)
-					{
-					project.files[crossing->file_id_1].show_in_modelplot = MB_YES;
-					project.files[crossing->file_id_2].show_in_modelplot = MB_YES;
-					}
-				}
-			}
-
-		/* else if view mode is with section loop over all crossings */
-		else if (mbna_view_mode == MBNA_VIEW_MODE_WITHSECTION)
-			{
-			for (i=0;i<project.num_crossings;i++)
-				{
-				crossing = &(project.crossings[i]);
-
-				/* if either section is selected
-					then set plot flags on for both files */
-				if ((crossing->file_id_1 == mbna_file_select && crossing->section_1 == mbna_section_select)
-				    || (crossing->file_id_2 == mbna_file_select && crossing->section_2 == mbna_section_select))
-					{
-					project.files[crossing->file_id_1].show_in_modelplot = MB_YES;
-					project.files[crossing->file_id_2].show_in_modelplot = MB_YES;
-					}
-				}
-			}
-
-		/* finally loop over files again setting all section plot flags on for files with plot flags on */
- 		for (i=0;i<project.num_files;i++)
-			{
-			file = &project.files[i];
-			if (file->show_in_modelplot == MB_YES)
-				{
-				for (j=0;j<file->num_sections;j++)
-					{
-					section = &file->sections[j];
-					section->show_in_modelplot = MB_YES;
-					}
-				}
-			}
-
-
-		/* get min maxes by looping over files and sections checking for sections to be plotted */
-		first = MB_YES;
-		mbna_modelplot_count = 0;
- 		for (i=0;i<project.num_files;i++)
-			{
-			file = &project.files[i];
-			for (j=0;j<file->num_sections;j++)
-				{
-				section = &file->sections[j];
-
-				/* if this section will be plotted use the snav values */
-				if (section->show_in_modelplot == MB_YES)
-					{
-					section->modelplot_start_count = mbna_modelplot_count;
-					for (isnav=0;isnav<section->num_snav;isnav++)
-						{
-						if (mbna_modelplot_zoom == MB_NO
-						    || (mbna_modelplot_count >= mbna_modelplot_startzoom && mbna_modelplot_count <= mbna_modelplot_endzoom))
-						    {
-							if (first == MB_YES)
-								{
-								lon_offset_min = section->snav_lon_offset[isnav] / mbna_mtodeglon - file->block_offset_x;
-								lon_offset_max = section->snav_lon_offset[isnav] / mbna_mtodeglon - file->block_offset_x;
-								lat_offset_min = section->snav_lat_offset[isnav] / mbna_mtodeglat - file->block_offset_y;
-								lat_offset_max = section->snav_lat_offset[isnav] / mbna_mtodeglat - file->block_offset_y;
-								z_offset_min = section->snav_z_offset[isnav] - file->block_offset_z;
-								z_offset_max = section->snav_z_offset[isnav] - file->block_offset_z;
-								first = MB_NO;
-								}
-							else
-								{
-								lon_offset_min = MIN(lon_offset_min, section->snav_lon_offset[isnav] / mbna_mtodeglon - file->block_offset_x);
-								lon_offset_max = MAX(lon_offset_max, section->snav_lon_offset[isnav] / mbna_mtodeglon - file->block_offset_x);
-								lat_offset_min = MIN(lat_offset_min, section->snav_lat_offset[isnav] / mbna_mtodeglat - file->block_offset_y);
-								lat_offset_max = MAX(lat_offset_max, section->snav_lat_offset[isnav] / mbna_mtodeglat - file->block_offset_y);
-								z_offset_min = MIN(z_offset_min, section->snav_z_offset[isnav] - file->block_offset_z);
-								z_offset_max = MAX(z_offset_max, section->snav_z_offset[isnav] - file->block_offset_z);
-								}
-							}
-						}
-					mbna_modelplot_count += section->snav_id[section->num_snav-1];
-					}
-				}
-			}
-
-		/* set plot bounds */
-		if (mbna_modelplot_zoom == MB_YES)
-			{
-			mbna_modelplot_start = mbna_modelplot_startzoom;
-			mbna_modelplot_end = mbna_modelplot_endzoom;
-			}
-		else
-			{
-			mbna_modelplot_start = 0;
-			mbna_modelplot_end = mbna_modelplot_count - 1;
-			}
-
-		/* get scaling */
-		plot_width = mbna_modelplot_width - 8 * MBNA_MODELPLOT_X_SPACE;
-		plot_height = (mbna_modelplot_height - 4 * MBNA_MODELPLOT_Y_SPACE) / 3;
-		mbna_modelplot_xo = 5 * MBNA_MODELPLOT_X_SPACE;
-		mbna_modelplot_yo_lon = MBNA_MODELPLOT_Y_SPACE + plot_height / 2;
-		mbna_modelplot_yo_lat = 2 * MBNA_MODELPLOT_Y_SPACE + 3 * plot_height / 2;
-		mbna_modelplot_yo_z = 3 * MBNA_MODELPLOT_Y_SPACE + 5 * plot_height / 2;
-		xymax = MAX(fabs(lon_offset_min),fabs(lon_offset_max));
-		xymax = MAX(fabs(lat_offset_min),xymax);
-		xymax = MAX(fabs(lat_offset_max),xymax);
-		mbna_modelplot_xscale = ((double)plot_width) / (mbna_modelplot_end - mbna_modelplot_start + 1);
-		mbna_modelplot_yscale = ((double)plot_height) / (2.2 * xymax);
-		yzmax = MAX(fabs(z_offset_min),fabs(z_offset_max));
-		yzmax = MAX(yzmax,0.5);
-		mbna_modelplot_yzscale = ((double)plot_height) / (2.2 * yzmax);
-
-		/* clear screens for first plot */
-		xg_fillrectangle(pmodp_xgid, 0, 0,
-				modp_borders[1], modp_borders[3],
-				pixel_values[mbna_color_background], XG_SOLIDLINE);
-
-		/* plot the bounds */
-		xg_drawrectangle(pmodp_xgid, mbna_modelplot_xo, mbna_modelplot_yo_lon - plot_height / 2, plot_width, plot_height, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-		xg_drawline(pmodp_xgid, mbna_modelplot_xo, mbna_modelplot_yo_lon, mbna_modelplot_xo + plot_width, mbna_modelplot_yo_lon, pixel_values[mbna_color_foreground], XG_DASHLINE);
-		xg_drawrectangle(pmodp_xgid, mbna_modelplot_xo, mbna_modelplot_yo_lat - plot_height / 2, plot_width, plot_height, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-		xg_drawline(pmodp_xgid, mbna_modelplot_xo, mbna_modelplot_yo_lat, mbna_modelplot_xo + plot_width, mbna_modelplot_yo_lat, pixel_values[mbna_color_foreground], XG_DASHLINE);
-		xg_drawrectangle(pmodp_xgid, mbna_modelplot_xo, mbna_modelplot_yo_z - plot_height / 2, plot_width, plot_height, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-		xg_drawline(pmodp_xgid, mbna_modelplot_xo, mbna_modelplot_yo_z, mbna_modelplot_xo + plot_width, mbna_modelplot_yo_z, pixel_values[mbna_color_foreground], XG_DASHLINE);
-
-		/* plot title */
-		if (mbna_view_mode == MBNA_VIEW_MODE_SURVEY)
-			{
-			sprintf(label, "Display Only Selected Survey - Selected Survey:%d", mbna_survey_select);
-			}
-		else if (mbna_view_mode == MBNA_VIEW_MODE_FILE)
-			{
-			sprintf(label, "Display Only Selected File - Selected Survey/File:%d/%d", mbna_survey_select, mbna_file_select);
-			}
-		else if (mbna_view_mode == MBNA_VIEW_MODE_WITHSURVEY)
-			{
-			sprintf(label, "Display With Selected Survey - Selected Survey:%d", mbna_survey_select);
-			}
-		else if (mbna_view_mode == MBNA_VIEW_MODE_WITHFILE)
-			{
-			sprintf(label, "Display With Selected File - Selected Survey/File:%d/%d", mbna_survey_select, mbna_file_select);
-			}
-		else if (mbna_view_mode == MBNA_VIEW_MODE_WITHSECTION)
-			{
-			sprintf(label, "Display With Selected Section: Selected Survey/File/Section:%d/%d/%d",
-				mbna_survey_select, mbna_file_select, mbna_section_select);
-			}
-		else if (mbna_view_mode == MBNA_VIEW_MODE_ALL)
-			{
-			sprintf(label, "Display All Data");
-			}
-
-		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
-		ix = mbna_modelplot_xo + (plot_width - stringwidth) / 2;
-		iy = MBNA_MODELPLOT_Y_SPACE - 2 * stringascent;
-		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-
-		/* plot labels */
-		sprintf(label, "East-West Offset (meters) vs. Ping Count");
-		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
-		ix = mbna_modelplot_xo + (plot_width - stringwidth) / 2;
-		iy = mbna_modelplot_yo_lon - plot_height / 2 - stringascent / 4;
-		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-
-		sprintf(label,"%d", mbna_modelplot_start);
-		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
-		ix = mbna_modelplot_xo - stringwidth / 2;
-		iy = mbna_modelplot_yo_lon + plot_height / 2 + 3 *stringascent / 2;
-		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-
-		sprintf(label,"%d", mbna_modelplot_end);
-		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
-		ix = mbna_modelplot_xo + plot_width - stringwidth / 2;
-		iy = mbna_modelplot_yo_lon + plot_height / 2 + 3 *stringascent / 2;
-		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-
-		sprintf(label,"%.2f", 1.1 * xymax);
-		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
-		ix = mbna_modelplot_xo - stringwidth - stringascent / 4;
-		iy = mbna_modelplot_yo_lon - plot_height / 2 + stringascent / 2;
-		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-
-		sprintf(label,"%.2f", 0.0);
-		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
-		ix = mbna_modelplot_xo - stringwidth - stringascent / 4;
-		iy = mbna_modelplot_yo_lon + stringascent / 2;
-		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-
-		sprintf(label,"%.2f", -1.1 * xymax);
-		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
-		ix = mbna_modelplot_xo - stringwidth - stringascent / 4;
-		iy = mbna_modelplot_yo_lon + plot_height / 2 + stringascent / 2;
-		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-
-
-		sprintf(label, "North-South Offset (meters) vs. Ping Count");
-		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
-		ix = mbna_modelplot_xo + (plot_width - stringwidth) / 2;
-		iy = mbna_modelplot_yo_lat - plot_height / 2 - stringascent / 4;
-		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-
-		sprintf(label,"%d", mbna_modelplot_start);
-		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
-		ix = mbna_modelplot_xo - stringwidth / 2;
-		iy = mbna_modelplot_yo_lat + plot_height / 2 + 3 *stringascent / 2;
-		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-
-		sprintf(label,"%d", mbna_modelplot_end);
-		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
-		ix = mbna_modelplot_xo + plot_width - stringwidth / 2;
-		iy = mbna_modelplot_yo_lat + plot_height / 2 + 3 *stringascent / 2;
-		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-
-		sprintf(label,"%.2f", 1.1 * xymax);
-		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
-		ix = mbna_modelplot_xo - stringwidth - stringascent / 4;
-		iy = mbna_modelplot_yo_lat - plot_height / 2 + stringascent / 2;
-		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-
-		sprintf(label,"%.2f", 0.0);
-		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
-		ix = mbna_modelplot_xo - stringwidth - stringascent / 4;
-		iy = mbna_modelplot_yo_lat + stringascent / 2;
-		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-
-		sprintf(label,"%.2f", -1.1 * xymax);
-		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
-		ix = mbna_modelplot_xo - stringwidth - stringascent / 4;
-		iy = mbna_modelplot_yo_lat + plot_height / 2 + stringascent / 2;
-		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-
-
-		sprintf(label, "Vertical Offset (meters) vs. Ping Count");
-		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
-		ix = mbna_modelplot_xo + (plot_width - stringwidth) / 2;
-		iy = mbna_modelplot_yo_z - plot_height / 2 - stringascent / 4;
-		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-
-		sprintf(label,"%d", mbna_modelplot_start);
-		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
-		ix = mbna_modelplot_xo - stringwidth / 2;
-		iy = mbna_modelplot_yo_z + plot_height / 2 + 3 *stringascent / 2;
-		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-
-		sprintf(label,"%d", mbna_modelplot_end);
-		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
-		ix = mbna_modelplot_xo + plot_width - stringwidth / 2;
-		iy = mbna_modelplot_yo_z + plot_height / 2 + 3 *stringascent / 2;
-		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-
-		sprintf(label,"%.2f", 1.1 * yzmax);
-		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
-		ix = mbna_modelplot_xo - stringwidth - stringascent / 4;
-		iy = mbna_modelplot_yo_z - plot_height / 2 + stringascent / 2;
-		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-
-		sprintf(label,"%.2f", 0.0);
-		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
-		ix = mbna_modelplot_xo - stringwidth - stringascent / 4;
-		iy = mbna_modelplot_yo_z + stringascent / 2;
-		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-
-		sprintf(label,"%.2f", -1.1 * yzmax);
-		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
-		ix = mbna_modelplot_xo - stringwidth - stringascent / 4;
-		iy = mbna_modelplot_yo_z + plot_height / 2 + stringascent / 2;
-		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-
-		/* set clipping */
-		xg_setclip(pmodp_xgid, mbna_modelplot_xo, 0, plot_width, mbna_modelplot_height);
-
-		/* loop over all crossings and plot and plot those without ties in green */
-		for (i=0;i<project.num_crossings;i++)
-		    {
-		    crossing = &(project.crossings[i]);
-		    if (crossing->num_ties== 0)
-		    	{
-			file = &project.files[crossing->file_id_1];
-			section = &file->sections[crossing->section_1];
-			iping = section->modelplot_start_count + section->snav_id[section->num_snav/2];
-
-			if (section->show_in_modelplot == MB_YES
-			    && (mbna_modelplot_zoom == MB_NO
-				|| (iping >= mbna_modelplot_startzoom && iping <= mbna_modelplot_endzoom)))
-				{
-				ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
-				iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * (section->snav_lon_offset[section->num_snav/2] / mbna_mtodeglon - file->block_offset_x));
-				xg_drawrectangle(pmodp_xgid, ix-3, iy-1, 3, 3, pixel_values[GREEN], XG_SOLIDLINE);
-				iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * (section->snav_lat_offset[section->num_snav/2] / mbna_mtodeglat - file->block_offset_y));
-				xg_drawrectangle(pmodp_xgid, ix-3, iy-1, 3, 3, pixel_values[GREEN], XG_SOLIDLINE);
-				iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * (section->snav_z_offset[section->num_snav/2] - file->block_offset_z));
-				xg_drawrectangle(pmodp_xgid, ix-3, iy-1, 3, 3, pixel_values[GREEN], XG_SOLIDLINE);
-				}
-
-			file = &project.files[crossing->file_id_2];
-			section = &file->sections[crossing->section_2];
-			iping = section->modelplot_start_count + section->snav_id[section->num_snav/2];
-
-			if (section->show_in_modelplot == MB_YES
-			    && (mbna_modelplot_zoom == MB_NO
-				|| (iping >= mbna_modelplot_startzoom && iping <= mbna_modelplot_endzoom)))
-				{
-				ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
-				iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * (section->snav_lon_offset[section->num_snav/2] / mbna_mtodeglon - file->block_offset_x));
-				xg_drawrectangle(pmodp_xgid, ix-3, iy-1, 3, 3, pixel_values[GREEN], XG_SOLIDLINE);
-				iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * (section->snav_lat_offset[section->num_snav/2] / mbna_mtodeglat - file->block_offset_y));
-				xg_drawrectangle(pmodp_xgid, ix-3, iy-1, 3, 3, pixel_values[GREEN], XG_SOLIDLINE);
-				iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * (section->snav_z_offset[section->num_snav/2] - file->block_offset_z));
-				xg_drawrectangle(pmodp_xgid, ix-3, iy-1, 3, 3, pixel_values[GREEN], XG_SOLIDLINE);
-				}
-			}
-		    }
-
-		/* Now plot the east-west offsets */
-		ixo = 0;
-		iyo = 0;
- 		for (i=0;i<project.num_files;i++)
-		    {
-		    file = &project.files[i];
-		    for (j=0;j<file->num_sections;j++)
-			{
-			section = &file->sections[j];
-			if (section->show_in_modelplot == MB_YES)
-				{
-				for (isnav=0;isnav<section->num_snav;isnav++)
-				    {
-				    iping = section->modelplot_start_count + section->snav_id[isnav];
-				    ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
-				    iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * (section->snav_lon_offset[isnav] / mbna_mtodeglon - file->block_offset_x));
-				    if ((i > 0 || j > 0) && section->continuity == MB_NO && isnav == 0)
-					xg_drawline(pmodp_xgid, ix, mbna_modelplot_yo_lon - plot_height / 2, ix, mbna_modelplot_yo_lon + plot_height / 2, pixel_values[GREEN], XG_SOLIDLINE);
-				    else if (i > 0 || j > 0)
-					{
-					/* if (j == 0 && isnav == 0 && section->continuity == MB_YES)
-						xg_drawline(pmodp_xgid, ix, mbna_modelplot_yo_lon - plot_height / 2, ix, mbna_modelplot_yo_lon + plot_height / 2, pixel_values[CORAL], XG_DASHLINE); */
-					xg_drawline(pmodp_xgid, ixo, iyo, ix, iy, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-					}
-				    ixo = ix;
-				    iyo = iy;
-				    }
-				}
-			}
-		    }
-
-		/* Now plot the north-south offsets */
-		ixo = 0;
-		iyo = 0;
- 		for (i=0;i<project.num_files;i++)
-		    {
-		    file = &project.files[i];
-		    for (j=0;j<file->num_sections;j++)
-			{
-			section = &file->sections[j];
-			if (section->show_in_modelplot == MB_YES)
-				{
-				for (isnav=0;isnav<section->num_snav;isnav++)
-				    {
-				    iping = section->modelplot_start_count + section->snav_id[isnav];
-				    ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
-				    iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * (section->snav_lat_offset[isnav] / mbna_mtodeglat - file->block_offset_y));
-				    if ((i > 0 || j > 0) && section->continuity == MB_NO && isnav == 0)
-					xg_drawline(pmodp_xgid, ix, mbna_modelplot_yo_lat - plot_height / 2, ix, mbna_modelplot_yo_lat + plot_height / 2, pixel_values[GREEN], XG_SOLIDLINE);
-				    else if (i > 0 || j > 0)
-					{
-					/* if (j == 0 && isnav == 0 && section->continuity == MB_YES)
-						xg_drawline(pmodp_xgid, ix, mbna_modelplot_yo_lat - plot_height / 2, ix, mbna_modelplot_yo_lat + plot_height / 2, pixel_values[CORAL], XG_DASHLINE); */
-					xg_drawline(pmodp_xgid, ixo, iyo, ix, iy, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-					}
-				    ixo = ix;
-				    iyo = iy;
-				    }
-				}
-			}
-		    }
-
-		/* Now plot the vertical offsets */
-		ixo = 0;
-		iyo = 0;
- 		for (i=0;i<project.num_files;i++)
-		    {
-		    file = &project.files[i];
-		    for (j=0;j<file->num_sections;j++)
-			{
-			section = &file->sections[j];
-			if (section->show_in_modelplot == MB_YES)
-				{
-				for (isnav=0;isnav<section->num_snav;isnav++)
-				    {
-				    iping = section->modelplot_start_count + section->snav_id[isnav];
-				    ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
-				    iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * (section->snav_z_offset[isnav] - file->block_offset_z));
-				    if ((i > 0 || j > 0) && section->continuity == MB_NO && isnav == 0)
-					xg_drawline(pmodp_xgid, ix, mbna_modelplot_yo_z - plot_height / 2, ix, mbna_modelplot_yo_z + plot_height / 2, pixel_values[GREEN], XG_SOLIDLINE);
-				    else if (i > 0 || j > 0)
-					{
-					/* if (j == 0 && isnav == 0 && section->continuity == MB_YES)
-						xg_drawline(pmodp_xgid, ix, mbna_modelplot_yo_z - plot_height / 2, ix, mbna_modelplot_yo_z + plot_height / 2, pixel_values[CORAL], XG_DASHLINE); */
-					xg_drawline(pmodp_xgid, ixo, iyo, ix, iy, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-					}
-				    ixo = ix;
-				    iyo = iy;
-				    }
-				}
-			}
-		    }
-
-		/* loop over all crossings and plot ties */
-		for (i=0;i<project.num_crossings;i++)
-		    {
-		    crossing = &(project.crossings[i]);
-		    for (j=0;j<crossing->num_ties;j++)
-		    	{
-			tie = &(crossing->ties[j]);
-
-			if (tie->inversion_status == MBNA_INVERSION_CURRENT)
-				pixel = pixel_values[mbna_color_foreground];
-			else
-				pixel = pixel_values[BLUE];
-
-			file = &project.files[crossing->file_id_1];
-			section = &file->sections[crossing->section_1];
-			iping = section->modelplot_start_count + section->snav_id[tie->snav_1];
-
-			if (section->show_in_modelplot == MB_YES
-			    && (mbna_modelplot_zoom == MB_NO
-				|| (iping >= mbna_modelplot_startzoom && iping <= mbna_modelplot_endzoom)))
-				{
-				ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
-				iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * (section->snav_lon_offset[tie->snav_1] / mbna_mtodeglon - file->block_offset_x));
-				xg_drawrectangle(pmodp_xgid, ix-2, iy-2, 5, 5, pixel, XG_SOLIDLINE);
-				iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * (section->snav_lat_offset[tie->snav_1] / mbna_mtodeglat - file->block_offset_y));
-				xg_drawrectangle(pmodp_xgid, ix-2, iy-2, 5, 5, pixel, XG_SOLIDLINE);
-				iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * (section->snav_z_offset[tie->snav_1] - file->block_offset_z));
-				xg_drawrectangle(pmodp_xgid, ix-2, iy-2, 5, 5, pixel, XG_SOLIDLINE);
-				}
-
-			file = &project.files[crossing->file_id_2];
-			section = &file->sections[crossing->section_2];
-			iping = section->modelplot_start_count + section->snav_id[tie->snav_2];
-
-			if (section->show_in_modelplot == MB_YES
-			    && (mbna_modelplot_zoom == MB_NO
-				|| (iping >= mbna_modelplot_startzoom && iping <= mbna_modelplot_endzoom)))
-				{
-				ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
-				iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * (section->snav_lon_offset[tie->snav_2] / mbna_mtodeglon - file->block_offset_x));
-				xg_drawrectangle(pmodp_xgid, ix-2, iy-2, 5, 5, pixel, XG_SOLIDLINE);
-				iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * (section->snav_lat_offset[tie->snav_2] / mbna_mtodeglat - file->block_offset_y));
-				xg_drawrectangle(pmodp_xgid, ix-2, iy-2, 5, 5, pixel, XG_SOLIDLINE);
-				iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * (section->snav_z_offset[tie->snav_2] - file->block_offset_z));
-				xg_drawrectangle(pmodp_xgid, ix-2, iy-2, 5, 5, pixel, XG_SOLIDLINE);
-				}
-			}
-		    }
-
-		/* Loop over all files plotting global ties */
- 		for (i=0;i<project.num_files;i++)
-		    {
-		    file = &project.files[i];
-		    for (j=0;j<file->num_sections;j++)
-			{
-			section = &file->sections[j];
-			if (section->show_in_modelplot == MB_YES && section->global_tie_status != MBNA_TIE_NONE)
-				{
-				for (isnav=0;isnav<section->num_snav;isnav++)
-				    {
-				    iping = section->modelplot_start_count + section->snav_id[section->global_tie_snav];
-				    ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
-				    
-				    if (section->global_tie_status != MBNA_TIE_Z)
-					{
-					/* east-west offsets */
-					iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * (section->snav_lon_offset[section->global_tie_snav] / mbna_mtodeglon - file->block_offset_x));
-					xg_drawline(pmodp_xgid, ix, mbna_modelplot_yo_lon, ix, iy, pixel_values[ORANGE], XG_SOLIDLINE);
-					xg_fillrectangle(pmodp_xgid, ix-2, iy-2, 5, 5, pixel_values[ORANGE], XG_SOLIDLINE);
-					xg_drawrectangle(pmodp_xgid, ix-2, iy-2, 5, 5, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-					
-					/* north-south offsets */
-					iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * (section->snav_lat_offset[section->global_tie_snav] / mbna_mtodeglat - file->block_offset_y));
-					xg_drawline(pmodp_xgid, ix, mbna_modelplot_yo_lat, ix, iy, pixel_values[ORANGE], XG_SOLIDLINE);
-					xg_fillrectangle(pmodp_xgid, ix-2, iy-2, 5, 5, pixel_values[ORANGE], XG_SOLIDLINE);
-					xg_drawrectangle(pmodp_xgid, ix-2, iy-2, 5, 5, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-					}
-				    
-				    if (section->global_tie_status != MBNA_TIE_XY)
-					{
-					/* vertical offsets */
-					iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * (section->snav_z_offset[section->global_tie_snav] - file->block_offset_z));
-					xg_drawline(pmodp_xgid, ix, mbna_modelplot_yo_z, ix, iy, pixel_values[ORANGE], XG_SOLIDLINE);
-					xg_fillrectangle(pmodp_xgid, ix-2, iy-2, 5, 5, pixel_values[ORANGE], XG_SOLIDLINE);
-					xg_drawrectangle(pmodp_xgid, ix-2, iy-2, 5, 5, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-					}
-				    }
-				}
-			}
-		    }
-
-		/* plot current tie in red */
-		if (mbna_current_crossing != MBNA_SELECT_NONE && mbna_current_tie != MBNA_SELECT_NONE)
-			{
-			crossing = &(project.crossings[mbna_current_crossing]);
-			tie = &(crossing->ties[mbna_current_tie]);
-
-			file = &project.files[crossing->file_id_1];
-			section = &file->sections[crossing->section_1];
-			iping = section->modelplot_start_count + section->snav_id[tie->snav_1];
-
-			if (section->show_in_modelplot == MB_YES
-			    && (mbna_modelplot_zoom == MB_NO
-				|| (iping >= mbna_modelplot_startzoom && iping <= mbna_modelplot_endzoom)))
-				{
-				ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
-				iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * (section->snav_lon_offset[tie->snav_1] / mbna_mtodeglon - file->block_offset_x));
-				xg_fillrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[RED], XG_SOLIDLINE);
-				xg_drawrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-				iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * (section->snav_lat_offset[tie->snav_1] / mbna_mtodeglat - file->block_offset_y));
-				xg_fillrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[RED], XG_SOLIDLINE);
-				xg_drawrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-				iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * (section->snav_z_offset[tie->snav_1] - file->block_offset_z));
-				xg_fillrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[RED], XG_SOLIDLINE);
-				xg_drawrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-				}
-
-			file = &project.files[crossing->file_id_2];
-			section = &file->sections[crossing->section_2];
-			iping = section->modelplot_start_count + section->snav_id[tie->snav_2];
-
-			if (section->show_in_modelplot == MB_YES
-			    && (mbna_modelplot_zoom == MB_NO
-				|| (iping >= mbna_modelplot_startzoom && iping <= mbna_modelplot_endzoom)))
-				{
-				ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
-				iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * (section->snav_lon_offset[tie->snav_2] / mbna_mtodeglon - file->block_offset_x));
-				xg_fillrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[RED], XG_SOLIDLINE);
-				xg_drawrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-				iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * (section->snav_lat_offset[tie->snav_2] / mbna_mtodeglat - file->block_offset_y));
-				xg_fillrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[RED], XG_SOLIDLINE);
-				xg_drawrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-				iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * (section->snav_z_offset[tie->snav_2] - file->block_offset_z));
-				xg_fillrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[RED], XG_SOLIDLINE);
-				xg_drawrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-				}
-			}
-
-		/* or if tie not selected then plot current crossing in red */
-		else if (mbna_current_crossing != MBNA_SELECT_NONE)
-			{
-			crossing = &(project.crossings[mbna_current_crossing]);
-
-			file = &project.files[crossing->file_id_1];
-			section = &file->sections[crossing->section_1];
-			iping = section->modelplot_start_count + section->snav_id[section->num_snav/2];
-
-			if (section->show_in_modelplot == MB_YES
-			    && (mbna_modelplot_zoom == MB_NO
-				|| (iping >= mbna_modelplot_startzoom && iping <= mbna_modelplot_endzoom)))
-				{
-				ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
-				iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * (section->snav_lon_offset[section->num_snav/2] / mbna_mtodeglon - file->block_offset_x));
-				xg_fillrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[RED], XG_SOLIDLINE);
-				xg_drawrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-				iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * (section->snav_lat_offset[section->num_snav/2] / mbna_mtodeglat - file->block_offset_y));
-				xg_fillrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[RED], XG_SOLIDLINE);
-				xg_drawrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-				iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * (section->snav_z_offset[section->num_snav/2] - file->block_offset_z));
-				xg_fillrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[RED], XG_SOLIDLINE);
-				xg_drawrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-				}
-
-			file = &project.files[crossing->file_id_2];
-			section = &file->sections[crossing->section_2];
-			iping = section->modelplot_start_count + section->snav_id[section->num_snav/2];
-
-			if (section->show_in_modelplot == MB_YES
-			    && (mbna_modelplot_zoom == MB_NO
-				|| (iping >= mbna_modelplot_startzoom && iping <= mbna_modelplot_endzoom)))
-				{
-				ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
-				iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * (section->snav_lon_offset[section->num_snav/2] / mbna_mtodeglon - file->block_offset_x));
-				xg_fillrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[RED], XG_SOLIDLINE);
-				xg_drawrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-				iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * (section->snav_lat_offset[section->num_snav/2] / mbna_mtodeglat - file->block_offset_y));
-				xg_fillrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[RED], XG_SOLIDLINE);
-				xg_drawrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-				iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * (section->snav_z_offset[section->num_snav/2] - file->block_offset_z));
-				xg_fillrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[RED], XG_SOLIDLINE);
-				xg_drawrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-				}
-			}
-
-		/* if a modelplot pick did not resolve a single tie, plot the options for a second pick */
-		if (mbna_modelplot_pickfile != MBNA_SELECT_NONE)
-			{
-			for (i=0;i<project.num_crossings;i++)
-				{
-				/* check if this crossing includes the picked snav */
-				crossing = &(project.crossings[i]);
-
-				/* check first snav */
-				if (crossing->file_id_1 == mbna_modelplot_pickfile
-					&& crossing->section_1 == mbna_modelplot_picksection)
-					{
-					/* loop over the ties */
-					for (j=0;j<crossing->num_ties;j++)
-						{
-						tie = &(crossing->ties[j]);
-						if (crossing->file_id_1 == mbna_modelplot_pickfile
-						    && crossing->section_1 == mbna_modelplot_picksection
-						    && tie->snav_1 == mbna_modelplot_picksnav)
-							{
-							file = &project.files[crossing->file_id_1];
-							section = &file->sections[crossing->section_1];
-							iping = section->modelplot_start_count + section->snav_id[tie->snav_1];
-
-							if (section->show_in_modelplot == MB_YES
-							    && (mbna_modelplot_zoom == MB_NO
-								|| (iping >= mbna_modelplot_startzoom && iping <= mbna_modelplot_endzoom)))
-								{
-								ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
-								iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * (section->snav_lon_offset[tie->snav_1] / mbna_mtodeglon - file->block_offset_x));
-								xg_fillrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[RED], XG_SOLIDLINE);
-								xg_drawrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-								iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * (section->snav_lat_offset[tie->snav_1] / mbna_mtodeglat - file->block_offset_y));
-								xg_fillrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[RED], XG_SOLIDLINE);
-								xg_drawrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-								iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * (section->snav_z_offset[tie->snav_1] - file->block_offset_z));
-								xg_fillrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[RED], XG_SOLIDLINE);
-								xg_drawrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-								}
-
-							file = &project.files[crossing->file_id_2];
-							section = &file->sections[crossing->section_2];
-							iping = section->modelplot_start_count + section->snav_id[tie->snav_2];
-
-							if (section->show_in_modelplot == MB_YES
-							    && (mbna_modelplot_zoom == MB_NO
-								|| (iping >= mbna_modelplot_startzoom && iping <= mbna_modelplot_endzoom)))
-								{
-								ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
-								iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * (section->snav_lon_offset[tie->snav_2] / mbna_mtodeglon - file->block_offset_x));
-								xg_fillrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[6], XG_SOLIDLINE);
-								xg_drawrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-								iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * (section->snav_lat_offset[tie->snav_2] / mbna_mtodeglat - file->block_offset_y));
-								xg_fillrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[6], XG_SOLIDLINE);
-								xg_drawrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-								iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * (section->snav_z_offset[tie->snav_2] - file->block_offset_z));
-								xg_fillrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[6], XG_SOLIDLINE);
-								xg_drawrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-								}
-							}
-						}
-					}
-
-				/* check second snav */
-				if (crossing->file_id_2 == mbna_modelplot_pickfile
-					&& crossing->section_2 == mbna_modelplot_picksection)
-					{
-					/* loop over the ties */
-					for (j=0;j<crossing->num_ties;j++)
-						{
-						tie = &(crossing->ties[j]);
-						if (crossing->file_id_2 == mbna_modelplot_pickfile
-						    && crossing->section_2 == mbna_modelplot_picksection
-						    && tie->snav_2 == mbna_modelplot_picksnav)
-							{
-							file = &project.files[crossing->file_id_2];
-							section = &file->sections[crossing->section_2];
-							iping = section->modelplot_start_count + section->snav_id[tie->snav_2];
-
-							if (section->show_in_modelplot == MB_YES
-							    && (mbna_modelplot_zoom == MB_NO
-								|| (iping >= mbna_modelplot_startzoom && iping <= mbna_modelplot_endzoom)))
-								{
-								ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
-								iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * (section->snav_lon_offset[tie->snav_2] / mbna_mtodeglon - file->block_offset_x));
-								xg_fillrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[RED], XG_SOLIDLINE);
-								xg_drawrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-								iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * (section->snav_lat_offset[tie->snav_2] / mbna_mtodeglat - file->block_offset_y));
-								xg_fillrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[RED], XG_SOLIDLINE);
-								xg_drawrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-								iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * (section->snav_z_offset[tie->snav_2] - file->block_offset_z));
-								xg_fillrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[RED], XG_SOLIDLINE);
-								xg_drawrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-								}
-
-							file = &project.files[crossing->file_id_1];
-							section = &file->sections[crossing->section_1];
-							iping = section->modelplot_start_count + section->snav_id[tie->snav_1];
-
-							if (section->show_in_modelplot == MB_YES
-							    && (mbna_modelplot_zoom == MB_NO
-								|| (iping >= mbna_modelplot_startzoom && iping <= mbna_modelplot_endzoom)))
-								{
-								ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
-								iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * (section->snav_lon_offset[tie->snav_1] / mbna_mtodeglon - file->block_offset_x));
-								xg_fillrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[6], XG_SOLIDLINE);
-								xg_drawrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-								iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * (section->snav_lat_offset[tie->snav_1] / mbna_mtodeglat - file->block_offset_y));
-								xg_fillrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[6], XG_SOLIDLINE);
-								xg_drawrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-								iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * (section->snav_z_offset[tie->snav_1] - file->block_offset_z));
-								xg_fillrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[6], XG_SOLIDLINE);
-								xg_drawrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-								}
-							}
-						}
-					}
-				}
-			}
-
-		/* plot zoom if active */
-		if (mbna_modelplot_zoom_x1 != 0 || mbna_modelplot_zoom_x2 != 0)
-			{
-			imodelplot_start = (MIN(mbna_modelplot_zoom_x1, mbna_modelplot_zoom_x2) - mbna_modelplot_xo) / mbna_modelplot_xscale + mbna_modelplot_start;
-			imodelplot_start = MIN(MAX(imodelplot_start, 0), project.num_pings - 1);
-			imodelplot_end = (MAX(mbna_modelplot_zoom_x1, mbna_modelplot_zoom_x2) - mbna_modelplot_xo) / mbna_modelplot_xscale + mbna_modelplot_start;
-			imodelplot_end = MIN(MAX(imodelplot_end, 0), project.num_pings - 1);
-
-			ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (imodelplot_start - mbna_modelplot_start));
-		   	xg_drawline(pmodp_xgid, ix, mbna_modelplot_yo_lon - plot_height / 2, ix, mbna_modelplot_yo_lon + plot_height / 2, pixel_values[mbna_color_foreground], XG_DASHLINE);
-		   	xg_drawline(pmodp_xgid, ix, mbna_modelplot_yo_lat - plot_height / 2, ix, mbna_modelplot_yo_lat + plot_height / 2, pixel_values[mbna_color_foreground], XG_DASHLINE);
-		   	xg_drawline(pmodp_xgid, ix, mbna_modelplot_yo_z - plot_height / 2, ix, mbna_modelplot_yo_z + plot_height / 2, pixel_values[mbna_color_foreground], XG_DASHLINE);
-
-			ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (imodelplot_end - mbna_modelplot_start));
-		   	xg_drawline(pmodp_xgid, ix, mbna_modelplot_yo_lon - plot_height / 2, ix, mbna_modelplot_yo_lon + plot_height / 2, pixel_values[mbna_color_foreground], XG_DASHLINE);
-		   	xg_drawline(pmodp_xgid, ix, mbna_modelplot_yo_lat - plot_height / 2, ix, mbna_modelplot_yo_lat + plot_height / 2, pixel_values[mbna_color_foreground], XG_DASHLINE);
-		   	xg_drawline(pmodp_xgid, ix, mbna_modelplot_yo_z - plot_height / 2, ix, mbna_modelplot_yo_z + plot_height / 2, pixel_values[mbna_color_foreground], XG_DASHLINE);
-			}
-
-		/* reset clipping */
-		xg_setclip(pmodp_xgid, 0, 0, mbna_modelplot_width, mbna_modelplot_height);
-
-		}
-
- 	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-
-int
-mbnavadjust_modelplot_plot_tieoffsets()
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_modelplot_plot_tieoffsets";
-	int	status = MB_SUCCESS;
-	struct mbna_file *file;
-	struct mbna_section *section;
-	struct mbna_crossing *crossing;
-	struct mbna_tie *tie;
-	int	num_ties;
-	int	num_surveys;
-	double	lon_offset_min;
-	double	lon_offset_max;
-	double	lat_offset_min;
-	double	lat_offset_max;
-	double	z_offset_min;
-	double	z_offset_max;
-	double	xymax, yzmax;
-	int	plot_width;
-	int	plot_height;
-	int	first;
-	char	label[STRING_MAX];
-	int	stringwidth, stringascent, stringdescent;
-	int	pixel;
-	int	itiestart, itieend;
-	int	ix, iy;
-	int	num_ties_block;
-	int	num_blocks;
-	int	plot_index;
-	int	isurvey1, isurvey2;
-	int	i, j;
-//fprintf(stderr,"Called %s\n",function_name);
-
- 	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
-
-	/* plot model if an inversion has been performed */
-    	if (project.open == MB_YES
-    		&& project.inversion != MBNA_INVERSION_NONE
-		&& project.modelplot == MB_YES)
-    		{
-		/* get number of ties and surveys */
-		num_ties = project.num_ties;
-		mbna_num_ties_plot = 0;
-		num_surveys = 0;
-
-		/* count surveys and plot blocks by looping over files */
-		num_surveys = 1;
- 		for (i=0;i<project.num_files;i++)
-			{
-			file = &project.files[i];
-			file->show_in_modelplot = -1;
-			for (j=0;j<file->num_sections;j++)
-				{
-				section = &file->sections[j];
-				if ((i > 0 || j > 0) && section->continuity == MB_NO)
-					num_surveys++;
-				}
-			}
-		num_blocks = 0;
-		for (i=0;i<num_surveys;i++)
-			num_blocks += i + 1;
-
-		/* Figure out which ties might be plotted */
- 		for (i=0;i<project.num_crossings;i++)
-			{
-			crossing = &project.crossings[i];
-			for (j=0;j<crossing->num_ties;j++)
-				{
-				tie = &crossing->ties[j];
-				tie->block_1 = project.files[crossing->file_id_1].block;
-				tie->block_2 = project.files[crossing->file_id_2].block;
-				tie->isurveyplotindex = -1;
-
-				/* check to see if this tie should be plotted */
-				if (mbna_modelplot_blocksurvey1 != MBNA_SELECT_NONE && mbna_modelplot_blocksurvey2 != MBNA_SELECT_NONE)
-					{
-					if (tie->block_1 == mbna_modelplot_blocksurvey1
-						&& tie->block_2 == mbna_modelplot_blocksurvey2)
-						{
-						tie->isurveyplotindex = 1;
-						mbna_num_ties_plot++;
-						}
-					}
-				else if (mbna_view_mode == MBNA_VIEW_MODE_SURVEY)
-					{
-					if (tie->block_1 == mbna_survey_select
-					    && tie->block_2 == mbna_survey_select)
-						{
-						tie->isurveyplotindex = 1;
-						mbna_num_ties_plot++;
-						}
-					}
-				else if (mbna_view_mode == MBNA_VIEW_MODE_WITHSURVEY)
-					{
-					if (tie->block_1 == mbna_survey_select
-					    || tie->block_2 == mbna_survey_select)
-						{
-						tie->isurveyplotindex = 1;
-						mbna_num_ties_plot++;
-						}
-					}
-				else if (mbna_view_mode == MBNA_VIEW_MODE_FILE)
-					{
-					if (crossing->file_id_1 == mbna_file_select
-					    && crossing->file_id_2 == mbna_file_select)
-						{
-						tie->isurveyplotindex = 1;
-						mbna_num_ties_plot++;
-						}
-					}
-				else if (mbna_view_mode == MBNA_VIEW_MODE_WITHFILE)
-					{
-					if (crossing->file_id_1 == mbna_file_select
-					    || crossing->file_id_2 == mbna_file_select)
-						{
-						tie->isurveyplotindex = 1;
-						mbna_num_ties_plot++;
-						}
-					}
-				else if (mbna_view_mode == MBNA_VIEW_MODE_WITHSECTION)
-					{
-					if ((crossing->file_id_1 == mbna_file_select && crossing->section_1 == mbna_section_select)
-					    || (crossing->file_id_2 == mbna_file_select && crossing->section_2 == mbna_section_select))
-						{
-						tie->isurveyplotindex = 1;
-						mbna_num_ties_plot++;
-						}
-					}
-				else if (mbna_view_mode == MBNA_VIEW_MODE_ALL)
-					{
-					tie->isurveyplotindex = 1;
-					mbna_num_ties_plot++;
-					}
-				}
-			}
-
-		/* Get min maxes by looping over surveys to locate each tie in plot */
-		plot_index = 0;
-		first = MB_YES;
-		if (mbna_modelplot_tiezoom == MB_YES)
-			{
-			mbna_modelplot_tiestart = mbna_modelplot_tiestartzoom;
-			mbna_modelplot_tieend = mbna_modelplot_tieendzoom;
-			}
-		else
-			{
-			mbna_modelplot_tiestart = 0;
-			mbna_modelplot_tieend = mbna_num_ties_plot - 1;
-			}
-		for (isurvey2=0;isurvey2<num_surveys;isurvey2++)
-			{
-			for (isurvey1=0;isurvey1<=isurvey2;isurvey1++)
-				{
-				/* loop over all ties looking for ones in current plot block
-					- current plot block is for ties between
-					surveys isurvey1 and isurvey2 */
-				for (i=0;i<project.num_crossings;i++)
-					{
-					crossing = &project.crossings[i];
-					for (j=0;j<crossing->num_ties;j++)
-						{
-						tie = &crossing->ties[j];
-
-						/* check if this tie is between the desired surveys */
-						if (tie->isurveyplotindex >= 0
-						    && ((tie->block_1 == isurvey1 && tie->block_2 == isurvey2)
-							|| (tie->block_2 == isurvey1 && tie->block_1 == isurvey2)))
-							{
-							/* set plot index for tie */
-							tie->isurveyplotindex = plot_index;
-
-							/* increment plot_index */
-							plot_index++;
-
-							/* if tie will be plotted (check for zoom) use it for min max */
-							if (tie->isurveyplotindex >= 0
-							    && (tie->isurveyplotindex >= mbna_modelplot_tiestart
-								    && tie->isurveyplotindex <= mbna_modelplot_tieend))
-								{
-								if (first == MB_YES)
-									{
-									lon_offset_min = tie->offset_x_m;
-									lon_offset_max = tie->offset_x_m;
-									lat_offset_min = tie->offset_y_m;
-									lat_offset_max = tie->offset_y_m;
-									z_offset_min = tie->offset_z_m;
-									z_offset_max = tie->offset_z_m;
-									first = MB_NO;
-									}
-								else
-									{
-									lon_offset_min = MIN(lon_offset_min, tie->offset_x_m);
-									lon_offset_max = MAX(lon_offset_max, tie->offset_x_m);
-									lat_offset_min = MIN(lat_offset_min, tie->offset_y_m);
-									lat_offset_max = MAX(lat_offset_max, tie->offset_y_m);
-									z_offset_min = MIN(z_offset_min, tie->offset_z_m);
-									z_offset_max = MAX(z_offset_max, tie->offset_z_m);
-									}
-								}
-							}
-						}
-					}
-				}
-			}
-
-		/* get scaling */
-		plot_width = mbna_modelplot_width - 8 * MBNA_MODELPLOT_X_SPACE;
-		plot_height = (mbna_modelplot_height - 4 * MBNA_MODELPLOT_Y_SPACE) / 3;
-		mbna_modelplot_xo = 5 * MBNA_MODELPLOT_X_SPACE;
-		mbna_modelplot_yo_lon = MBNA_MODELPLOT_Y_SPACE + plot_height / 2;
-		mbna_modelplot_yo_lat = 2 * MBNA_MODELPLOT_Y_SPACE + 3 * plot_height / 2;
-		mbna_modelplot_yo_z = 3 * MBNA_MODELPLOT_Y_SPACE + 5 * plot_height / 2;
-		xymax = MAX(fabs(lon_offset_min),fabs(lon_offset_max));
-		xymax = MAX(fabs(lat_offset_min),xymax);
-		xymax = MAX(fabs(lat_offset_max),xymax);
-		mbna_modelplot_xscale = ((double)plot_width) / (mbna_modelplot_tieend - mbna_modelplot_tiestart + 1);
-		mbna_modelplot_yscale = ((double)plot_height) / (2.2 * xymax);
-		yzmax = MAX(fabs(z_offset_min),fabs(z_offset_max));
-		yzmax = MAX(yzmax,0.5);
-		mbna_modelplot_yzscale = ((double)plot_height) / (2.2 * yzmax);
-
-		/* clear screens for first plot */
-		xg_fillrectangle(pmodp_xgid, 0, 0,
-				modp_borders[1], modp_borders[3],
-				pixel_values[mbna_color_background], XG_SOLIDLINE);
-
-		/* plot the bounds */
-		xg_drawrectangle(pmodp_xgid, mbna_modelplot_xo, mbna_modelplot_yo_lon - plot_height / 2, plot_width, plot_height, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-		xg_drawline(pmodp_xgid, mbna_modelplot_xo, mbna_modelplot_yo_lon, mbna_modelplot_xo + plot_width, mbna_modelplot_yo_lon, pixel_values[mbna_color_foreground], XG_DASHLINE);
-		xg_drawrectangle(pmodp_xgid, mbna_modelplot_xo, mbna_modelplot_yo_lat - plot_height / 2, plot_width, plot_height, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-		xg_drawline(pmodp_xgid, mbna_modelplot_xo, mbna_modelplot_yo_lat, mbna_modelplot_xo + plot_width, mbna_modelplot_yo_lat, pixel_values[mbna_color_foreground], XG_DASHLINE);
-		xg_drawrectangle(pmodp_xgid, mbna_modelplot_xo, mbna_modelplot_yo_z - plot_height / 2, plot_width, plot_height, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-		xg_drawline(pmodp_xgid, mbna_modelplot_xo, mbna_modelplot_yo_z, mbna_modelplot_xo + plot_width, mbna_modelplot_yo_z, pixel_values[mbna_color_foreground], XG_DASHLINE);
-
-		/* plot title */
-		if (mbna_view_mode == MBNA_VIEW_MODE_SURVEY)
-			{
-			sprintf(label, "Display Only Selected Survey - Selected Survey:%d", mbna_survey_select);
-			}
-		else if (mbna_view_mode == MBNA_VIEW_MODE_FILE)
-			{
-			sprintf(label, "Display Only Selected File - Selected Survey/File:%d/%d", mbna_survey_select, mbna_file_select);
-			}
-		else if (mbna_view_mode == MBNA_VIEW_MODE_WITHSURVEY)
-			{
-			sprintf(label, "Display With Selected Survey - Selected Survey:%d", mbna_survey_select);
-			}
-		else if (mbna_view_mode == MBNA_VIEW_MODE_WITHFILE)
-			{
-			sprintf(label, "Display With Selected File - Selected Survey/File:%d/%d", mbna_survey_select, mbna_file_select);
-			}
-		else if (mbna_view_mode == MBNA_VIEW_MODE_WITHSECTION)
-			{
-			sprintf(label, "Display With Selected Section: Selected Survey/File/Section:%d/%d/%d",
-				mbna_survey_select, mbna_file_select, mbna_section_select);
-			}
-		else if (mbna_view_mode == MBNA_VIEW_MODE_ALL)
-			{
-			sprintf(label, "Display All Data");
-			}
-
-		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
-		ix = mbna_modelplot_xo + (plot_width - stringwidth) / 2;
-		iy = MBNA_MODELPLOT_Y_SPACE - 2 * stringascent;
-		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-
-		/* plot labels */
-		sprintf(label, "Tie East-West Offset (meters) Grouped by Surveys");
-		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
-		ix = mbna_modelplot_xo + (plot_width - stringwidth) / 2;
-		iy = mbna_modelplot_yo_lon - plot_height / 2 - stringascent / 4;
-		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-
-		sprintf(label,"%d", mbna_modelplot_tiestart);
-		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
-		ix = mbna_modelplot_xo - stringwidth / 2;
-		iy = mbna_modelplot_yo_lon + plot_height / 2 + 3 *stringascent / 2;
-		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-
-		sprintf(label,"%d", mbna_modelplot_tieend);
-		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
-		ix = mbna_modelplot_xo + plot_width - stringwidth / 2;
-		iy = mbna_modelplot_yo_lon + plot_height / 2 + 3 *stringascent / 2;
-		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-
-		sprintf(label,"%.2f", 1.1 * xymax);
-		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
-		ix = mbna_modelplot_xo - stringwidth - stringascent / 4;
-		iy = mbna_modelplot_yo_lon - plot_height / 2 + stringascent / 2;
-		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-
-		sprintf(label,"%.2f", 0.0);
-		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
-		ix = mbna_modelplot_xo - stringwidth - stringascent / 4;
-		iy = mbna_modelplot_yo_lon + stringascent / 2;
-		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-
-		sprintf(label,"%.2f", -1.1 * xymax);
-		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
-		ix = mbna_modelplot_xo - stringwidth - stringascent / 4;
-		iy = mbna_modelplot_yo_lon + plot_height / 2 + stringascent / 2;
-		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-
-
-		sprintf(label, "Tie North-South Offset (meters) Grouped by Surveys");
-		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
-		ix = mbna_modelplot_xo + (plot_width - stringwidth) / 2;
-		iy = mbna_modelplot_yo_lat - plot_height / 2 - stringascent / 4;
-		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-
-		sprintf(label,"%d", mbna_modelplot_tiestart);
-		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
-		ix = mbna_modelplot_xo - stringwidth / 2;
-		iy = mbna_modelplot_yo_lat + plot_height / 2 + 3 *stringascent / 2;
-		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-
-		sprintf(label,"%d", mbna_modelplot_tieend);
-		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
-		ix = mbna_modelplot_xo + plot_width - stringwidth / 2;
-		iy = mbna_modelplot_yo_lat + plot_height / 2 + 3 *stringascent / 2;
-		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-
-		sprintf(label,"%.2f", 1.1 * xymax);
-		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
-		ix = mbna_modelplot_xo - stringwidth - stringascent / 4;
-		iy = mbna_modelplot_yo_lat - plot_height / 2 + stringascent / 2;
-		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-
-		sprintf(label,"%.2f", 0.0);
-		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
-		ix = mbna_modelplot_xo - stringwidth - stringascent / 4;
-		iy = mbna_modelplot_yo_lat + stringascent / 2;
-		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-
-		sprintf(label,"%.2f", -1.1 * xymax);
-		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
-		ix = mbna_modelplot_xo - stringwidth - stringascent / 4;
-		iy = mbna_modelplot_yo_lat + plot_height / 2 + stringascent / 2;
-		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-
-
-		sprintf(label, "Tie Vertical Offset (meters) Grouped by Surveys");
-		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
-		ix = mbna_modelplot_xo + (plot_width - stringwidth) / 2;
-		iy = mbna_modelplot_yo_z - plot_height / 2 - stringascent / 4;
-		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-
-		sprintf(label,"%d", mbna_modelplot_tiestart);
-		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
-		ix = mbna_modelplot_xo - stringwidth / 2;
-		iy = mbna_modelplot_yo_z + plot_height / 2 + 3 *stringascent / 2;
-		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-
-		sprintf(label,"%d", mbna_modelplot_tieend);
-		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
-		ix = mbna_modelplot_xo + plot_width - stringwidth / 2;
-		iy = mbna_modelplot_yo_z + plot_height / 2 + 3 *stringascent / 2;
-		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-
-		sprintf(label,"%.2f", 1.1 * yzmax);
-		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
-		ix = mbna_modelplot_xo - stringwidth - stringascent / 4;
-		iy = mbna_modelplot_yo_z - plot_height / 2 + stringascent / 2;
-		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-
-		sprintf(label,"%.2f", 0.0);
-		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
-		ix = mbna_modelplot_xo - stringwidth - stringascent / 4;
-		iy = mbna_modelplot_yo_z + stringascent / 2;
-		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-
-		sprintf(label,"%.2f", -1.1 * yzmax);
-		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
-		ix = mbna_modelplot_xo - stringwidth - stringascent / 4;
-		iy = mbna_modelplot_yo_z + plot_height / 2 + stringascent / 2;
-		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-
-		/* set clipping */
-		xg_setclip(pmodp_xgid, mbna_modelplot_xo, 0, plot_width, mbna_modelplot_height);
-
-		/* loop over surveys to locate each tie in plot */
-		plot_index = 0;
-		for (isurvey2=0;isurvey2<num_surveys;isurvey2++)
-			{
-			for (isurvey1=0;isurvey1<=isurvey2;isurvey1++)
-				{
-				num_ties_block = 0;
-
-				/* loop over all ties looking for ones in current plot block
-					- current plot block is for ties between
-					surveys isurvey1 and isurvey2 */
-				for (i=0;i<project.num_crossings;i++)
-					{
-					crossing = &project.crossings[i];
-					for (j=0;j<crossing->num_ties;j++)
-						{
-						tie = &crossing->ties[j];
-
-						/* check if this tie is between the desired surveys */
-						if (tie->isurveyplotindex >= 0
-						    && ((tie->block_1 == isurvey1 && tie->block_2 == isurvey2)
-							|| (tie->block_2 == isurvey1 && tie->block_1 == isurvey2)))
-							{
-							if (tie->isurveyplotindex >= mbna_modelplot_tiestart
-								    && tie->isurveyplotindex <= mbna_modelplot_tieend)
-								{
-								/* plot tie */
-								if (tie->inversion_status == MBNA_INVERSION_CURRENT)
-									pixel = pixel_values[mbna_color_foreground];
-								else
-									pixel = pixel_values[BLUE];
-
-								ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (tie->isurveyplotindex - mbna_modelplot_tiestart));
-
-								iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * tie->offset_x_m);
-								if (i == mbna_current_crossing && j == mbna_current_tie)
-									{
-									xg_fillrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[RED], XG_SOLIDLINE);
-									xg_drawrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-									}
-								else
-									xg_drawrectangle(pmodp_xgid, ix-2, iy-2, 5, 5, pixel, XG_SOLIDLINE);
-
-								iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * tie->offset_y_m);
-								if (i == mbna_current_crossing && j == mbna_current_tie)
-									{
-									xg_fillrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[RED], XG_SOLIDLINE);
-									xg_drawrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-									}
-								else
-									xg_drawrectangle(pmodp_xgid, ix-2, iy-2, 5, 5, pixel, XG_SOLIDLINE);
-
-								iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * tie->offset_z_m);
-								if (i == mbna_current_crossing && j == mbna_current_tie)
-									{
-									xg_fillrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[RED], XG_SOLIDLINE);
-									xg_drawrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-									}
-								else
-									xg_drawrectangle(pmodp_xgid, ix-2, iy-2, 5, 5, pixel, XG_SOLIDLINE);
-								}
-
-							/* increment plot_index */
-							plot_index++;
-
-							/* increment num_ties_block */
-							num_ties_block++;
-							}
-						}
-					}
-
-				/* plot line for boundary between plot blocks */
-				if (num_ties_block > 0)
-					{
-					/* plot line for boundary between plot blocks */
-					ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (plot_index - mbna_modelplot_tiestart - 0.5));
-					xg_drawline(pmodp_xgid, ix, mbna_modelplot_yo_lon - plot_height / 2,
-								ix, mbna_modelplot_yo_lon + plot_height / 2,
-								pixel_values[GREEN], XG_DASHLINE);
-					xg_drawline(pmodp_xgid, ix, mbna_modelplot_yo_lat - plot_height / 2,
-								ix, mbna_modelplot_yo_lat + plot_height / 2,
-								pixel_values[GREEN], XG_DASHLINE);
-					xg_drawline(pmodp_xgid, ix, mbna_modelplot_yo_z - plot_height / 2,
-								ix, mbna_modelplot_yo_z + plot_height / 2,
-								pixel_values[GREEN], XG_DASHLINE);
-					}
-				}
-			}
-
-		/* plot zoom if active */
-		if (mbna_modelplot_zoom_x1 != 0 || mbna_modelplot_zoom_x2 != 0)
-			{
-			itiestart = (MIN(mbna_modelplot_zoom_x1, mbna_modelplot_zoom_x2) - mbna_modelplot_xo) / mbna_modelplot_xscale + mbna_modelplot_tiestart;
-			itiestart = MIN(MAX(itiestart, 0), mbna_num_ties_plot - 1);
-			itieend = (MAX(mbna_modelplot_zoom_x1, mbna_modelplot_zoom_x2) - mbna_modelplot_xo) / mbna_modelplot_xscale + mbna_modelplot_tiestart;
-			itieend = MIN(MAX(itieend, 0), mbna_num_ties_plot - 1);
-
-			ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (itiestart - mbna_modelplot_tiestart));
-		   	xg_drawline(pmodp_xgid, ix, mbna_modelplot_yo_lon - plot_height / 2, ix, mbna_modelplot_yo_lon + plot_height / 2, pixel_values[mbna_color_foreground], XG_DASHLINE);
-		   	xg_drawline(pmodp_xgid, ix, mbna_modelplot_yo_lat - plot_height / 2, ix, mbna_modelplot_yo_lat + plot_height / 2, pixel_values[mbna_color_foreground], XG_DASHLINE);
-		   	xg_drawline(pmodp_xgid, ix, mbna_modelplot_yo_z - plot_height / 2, ix, mbna_modelplot_yo_z + plot_height / 2, pixel_values[mbna_color_foreground], XG_DASHLINE);
-
-			ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (itieend - mbna_modelplot_tiestart));
-		   	xg_drawline(pmodp_xgid, ix, mbna_modelplot_yo_lon - plot_height / 2, ix, mbna_modelplot_yo_lon + plot_height / 2, pixel_values[mbna_color_foreground], XG_DASHLINE);
-		   	xg_drawline(pmodp_xgid, ix, mbna_modelplot_yo_lat - plot_height / 2, ix, mbna_modelplot_yo_lat + plot_height / 2, pixel_values[mbna_color_foreground], XG_DASHLINE);
-		   	xg_drawline(pmodp_xgid, ix, mbna_modelplot_yo_z - plot_height / 2, ix, mbna_modelplot_yo_z + plot_height / 2, pixel_values[mbna_color_foreground], XG_DASHLINE);
-			}
-
-		/* reset clipping */
-		xg_setclip(pmodp_xgid, 0, 0, mbna_modelplot_width, mbna_modelplot_height);
-		}
-
- 	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
diff --git a/src/mbnavadjust/mbnavadjust_prog.c.orig b/src/mbnavadjust/mbnavadjust_prog.c.orig
deleted file mode 100644
index e62ee74..0000000
--- a/src/mbnavadjust/mbnavadjust_prog.c.orig
+++ /dev/null
@@ -1,17750 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbnavadjust_prog.c	3/23/00
- *    $Id: mbnavadjust_prog.c 2238 2015-04-15 06:00:52Z caress $
- *
- *    Copyright (c) 2000-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbnavadjust is an interactive navigation adjustment package
- * for swath sonar data.
- * It can work with any data format supported by the MBIO library.
- * This file contains the code that does not directly depend on the
- * MOTIF interface.
- *
- * Author:	D. W. Caress
- * Date:	March 23, 2000
- *
- *
- */
-
-/*--------------------------------------------------------------------*/
-
-/* standard include files */
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <math.h>
-#include <string.h>
-#include <time.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <X11/Intrinsic.h>
-
-/* MBIO include files */
-#include "mb_format.h"
-#include "mb_status.h"
-#include "mb_define.h"
-#include "mb_io.h"
-#include "mb_process.h"
-#include "mb_aux.h"
-#include "mbsys_ldeoih.h"
-#include "mb_xgraphics.h"
-
-/* define global control parameters */
-#include "mbnavadjust.h"
-
-/* swath bathymetry raw data structures */
-struct	pingraw
-	{
-	int	time_i[7];
-	double	time_d;
-	double	navlon;
-	double	navlat;
-	double	heading;
-	double	draft;
-	double	beams_bath;
-	char	*beamflag;
-	double	*bath;
-	double	*bathacrosstrack;
-	double	*bathalongtrack;
-	};
-struct swathraw
-	{
-	/* raw swath data */
-	int	file_id;
-	int	npings;
-	int	npings_max;
-	int	beams_bath;
-	struct pingraw *pingraws;
-	};
-
-/* id variables */
-static char rcs_id[] = "$Id: mbnavadjust_prog.c 2238 2015-04-15 06:00:52Z caress $";
-static char program_name[] = "mbnavadjust";
-static char help_message[] =  "mbnavadjust is an interactive navigation adjustment package for swath sonar data.\n";
-static char usage_message[] = "mbnavadjust [-Iproject -V -H]";
-
-/* status variables */
-int	error = MB_ERROR_NO_ERROR;
-char	*error_message;
-char	message[STRING_MAX];
-char	error1[STRING_MAX];
-char	error2[STRING_MAX];
-char	error3[STRING_MAX];
-
-/* data file parameters */
-void	*datalist;
-
-/* MBIO control parameters */
-int	pings;
-int	lonflip;
-double	bounds[4];
-int	btime_i[7];
-int	etime_i[7];
-double	btime_d;
-double	etime_d;
-double	speedmin;
-double	timegap;
-
-/* route color defines (colors different in MBgrdviz than in MBnavadjust) */
-#define	ROUTE_COLOR_BLACK			0
-#define	ROUTE_COLOR_WHITE			1
-#define	ROUTE_COLOR_RED			2
-#define	ROUTE_COLOR_YELLOW		3
-#define	ROUTE_COLOR_GREEN			4
-#define	ROUTE_COLOR_BLUEGREEN		5
-#define	ROUTE_COLOR_BLUE			6
-#define	ROUTE_COLOR_PURPLE		7
-
-/* color control values */
-#define	WHITE	0
-#define	BLACK	1
-#define RED	2
-#define GREEN	3
-#define BLUE	4
-#define CORAL	5
-#define YELLOW	6
-#define ORANGE	23
-#define PURPLE	255
-
-#define	XG_SOLIDLINE	0
-#define	XG_DASHLINE	1
-void	*pcont_xgid;
-void	*pcorr_xgid;
-void	*pzoff_xgid;
-void	*pmodp_xgid;
-int	ncolors;
-int	pixel_values[256];
-
-/* Set these to the dimensions of your canvas drawing */
-/* areas, minus 1, located in the uil file             */
-static int corr_borders[4];
-static int cont_borders[4];
-static int zoff_borders[4];
-static int modp_borders[4];
-
-/* mb_contour parameters */
-struct swathraw *swathraw1 = NULL;
-struct swathraw *swathraw2 = NULL;
-struct swath *swath1 = NULL;
-struct swath *swath2 = NULL;
-struct ping *ping = NULL;
-
-/* misfit grid parameters */
-int	grid_nx = 0;
-int	grid_ny = 0;
-int	grid_nxy = 0;
-int	grid_nxyzeq = 0;
-double	grid_dx = 0.0;
-double	grid_dy = 0.0;
-double	grid_olon = 0.0;
-double	grid_olat = 0.0;
-double	misfit_min, misfit_max;
-int	gridm_nx = 0;
-int	gridm_ny = 0;
-int	gridm_nxyz = 0;
-double	*grid1 = NULL;
-double	*grid2 = NULL;
-double	*gridm = NULL;
-double	*gridmeq = NULL;
-int	*gridn1 = NULL;
-int	*gridn2 = NULL;
-int	*gridnm = NULL;
-#define NINTERVALS_MISFIT 80
-int	nmisfit_intervals = NINTERVALS_MISFIT;
-double	misfit_intervals[NINTERVALS_MISFIT];
-int	nzmisfitcalc;
-double	zoff_dz;
-double	zmin, zmax;
-double	zmisfitmin;
-double	zmisfitmax;
-
-/* time, user, host variables */
-time_t	right_now;
-char	date[32], user[MBP_FILENAMESIZE], *user_ptr, host[MBP_FILENAMESIZE];
-
-/* local prototypes */
-int mbnavadjust_crossing_compare(const void *a, const void *b);
-void mbnavadjust_plot(double xx,double yy,int ipen);
-void mbnavadjust_newpen(int icolor);
-void mbnavadjust_setline(int linewidth);
-void mbnavadjust_justify_string(double height,char *string, double *s);
-void mbnavadjust_plot_string(double x, double y, double hgt, double angle, char *label);
-
-/*--------------------------------------------------------------------*/
-int mbnavadjust_init_globals()
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_init_globals";
-	int	iformat;
-	int	status = MB_SUCCESS;
-
-	/* set default global control parameters */
-	project.open = MB_NO;
-	memset(project.name,0,STRING_MAX);
-	strcpy(project.name,"None");
- 	memset(project.path,0,STRING_MAX);
-	memset(project.datadir,0,STRING_MAX);
-	project.num_files = 0;
-	project.num_files_alloc = 0;
-	project.files = NULL;
-	project.num_blocks = 0;
-	project.num_snavs = 0;
-	project.num_pings = 0;
-	project.num_beams = 0;
-	project.num_crossings = 0;
-	project.num_crossings_alloc = 0;
- 	project.num_crossings_analyzed = 0;
-	project.num_goodcrossings = 0;
-	project.num_truecrossings = 0;
- 	project.num_truecrossings_analyzed = 0;
- 	project.crossings = NULL;
-	project.num_ties = 0;
-	project.inversion = MBNA_INVERSION_NONE;
-	project.modelplot = MB_NO;
-	project.modelplot_style = MBNA_MODELPLOT_TIMESERIES;
-	project.logfp = NULL;
- 	mbna_status = MBNA_STATUS_GUI;
- 	mbna_view_list = MBNA_VIEW_LIST_FILES;
- 	mbna_view_mode = MBNA_VIEW_MODE_ALL;
-	mbna_invert_mode = MBNA_INVERT_ZISOLATED;
-	mbna_color_foreground = BLACK;
-	mbna_color_background = WHITE;
- 	project.section_length = 0.14;
- 	project.section_soundings = 100000;
- 	project.decimation = 1;
-	project.precision = SIGMA_MINIMUM;
-	project.smoothing = MBNA_SMOOTHING_DEFAULT;
-	project.zoffsetwidth = 5.0;
-	mbna_file_id_1 = MBNA_SELECT_NONE;
-	mbna_section_1 = MBNA_SELECT_NONE;
-	mbna_file_id_2 = MBNA_SELECT_NONE;
-	mbna_section_2 = MBNA_SELECT_NONE;
- 	mbna_current_crossing = MBNA_SELECT_NONE;
- 	mbna_current_tie = MBNA_SELECT_NONE;
-	mbna_naverr_load = MB_NO;
- 	mbna_file_select = MBNA_SELECT_NONE;
- 	mbna_survey_select = MBNA_SELECT_NONE;
- 	mbna_section_select = MBNA_SELECT_NONE;
-	mbna_crossing_select = MBNA_SELECT_NONE;
-	mbna_tie_select = MBNA_SELECT_NONE;
-	project.cont_int = 1.;
-	project.col_int = 5.;
-	project.tick_int = 5.;
-	project.label_int = 100000.;
-	mbna_contour_algorithm = MB_CONTOUR_OLD;
-	/*mbna_contour_algorithm = MB_CONTOUR_TRIANGLES;*/
-	mbna_ncolor = 10;
-	mbna_contour = NULL;
-	mbna_contour1.nvector = 0;
-	mbna_contour1.nvector_alloc = 0;
-	mbna_contour1.vector = NULL;
-	mbna_contour2.nvector = 0;
-	mbna_contour2.nvector_alloc = 0;
-	mbna_contour2.vector = NULL;
-	mbna_smoothweight = 100.0;
-	mbna_offsetweight = 0.01;
-	mbna_zweightfactor = 1.0;
-	mbna_misfit_center = MBNA_MISFIT_AUTOCENTER;
-	mbna_minmisfit_nthreshold = MBNA_MISFIT_NTHRESHOLD;
-	mbna_minmisfit = 0.0;
-	mbna_bias_mode = MBNA_BIAS_SAME;
-	mbna_allow_set_tie = MB_NO;
-	mbna_modelplot_zoom = MB_NO;
-	mbna_modelplot_zoom_x1 = 0;
-	mbna_modelplot_zoom_x2 = 0;
-	mbna_modelplot_tiezoom = MB_NO;
-	mbna_modelplot_tiestart = 0;
-	mbna_modelplot_tieend = 0;
-	mbna_modelplot_tiestartzoom = 0;
-	mbna_modelplot_tieendzoom = 0;
-	mbna_modelplot_pickfile = MBNA_SELECT_NONE;
-	mbna_modelplot_picksection = MBNA_SELECT_NONE;
-	mbna_modelplot_picksnav = MBNA_SELECT_NONE;
-	mbna_modelplot_blocksurvey1 = MBNA_SELECT_NONE;
-	mbna_modelplot_blocksurvey2 = MBNA_SELECT_NONE;
-	mbna_reset_crossings = MB_NO;
-	mbna_bin_swathwidth = 160.0;
-	mbna_bin_pseudobeamwidth = 1.0;
-	mbna_bin_beams_bath = mbna_bin_swathwidth / mbna_bin_pseudobeamwidth + 1;
-
-	/* set mbio default values */
-	status = mb_defaults(mbna_verbose,&iformat,&pings,&lonflip,bounds,
-		btime_i,etime_i,&speedmin,&timegap);
-	pings = 1;
-	lonflip = 0;
-	bounds[0] = -360.;
-	bounds[1] = 360.;
-	bounds[2] = -90.;
-	bounds[3] = 90.;
-	btime_i[0] = 1962;
-	btime_i[1] = 2;
-	btime_i[2] = 21;
-	btime_i[3] = 10;
-	btime_i[4] = 30;
-	btime_i[5] = 0;
-	btime_i[6] = 0;
-	etime_i[0] = 2062;
-	etime_i[1] = 2;
-	etime_i[2] = 21;
-	etime_i[3] = 10;
-	etime_i[4] = 30;
-	etime_i[5] = 0;
-	etime_i[6] = 0;
-	speedmin = 0.0;
-	timegap = 1000000000.0;
-
-	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-
-
-/*--------------------------------------------------------------------*/
-int mbnavadjust_init(int argc,char **argv)
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_init";
-	int	status = MB_SUCCESS;
-	int	fileflag = 0;
-	char	ifile[STRING_MAX];
-	int	i;
-
-	/* parsing variables */
-	extern char *optarg;
-	int	errflg = 0;
-	int	c;
-	int	help = 0;
-	int	flag = 0;
-
-	/* process argument list */
-	while ((c = getopt(argc, argv, "VvHhDdI:i:Rr")) != -1)
-	  switch (c)
-		{
-		case 'H':
-		case 'h':
-			help++;
-			break;
-		case 'V':
-		case 'v':
-			mbna_verbose++;
-			break;
-		case 'D':
-		case 'd':
-			mbna_color_foreground = WHITE;
-			mbna_color_background = BLACK;
-			break;
-		case 'I':
-		case 'i':
-			sscanf (optarg,"%s", ifile);
-			flag++;
-			fileflag++;
-			break;
-		case 'R':
-		case 'r':
-			mbna_reset_crossings = MB_YES;
-			break;
-		case '?':
-			errflg++;
-		}
-
-	/* if error flagged then print it and exit */
-	if (errflg)
-		{
-		fprintf(stderr,"usage: %s\n", usage_message);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		error = MB_ERROR_BAD_USAGE;
-		exit(error);
-		}
-
-	/* print starting message */
-	if (mbna_verbose == 1 || help)
-		{
-		fprintf(stderr,"\nProgram %s\n",program_name);
-		fprintf(stderr,"Version %s\n",rcs_id);
-		fprintf(stderr,"MB-system Version %s\n",MB_VERSION);
-		}
-
-	/* print starting debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  Program <%s>\n",program_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Control Parameters:\n");
-		fprintf(stderr,"dbg2       mbna_verbose:         %d\n",mbna_verbose);
-		fprintf(stderr,"dbg2       help:            %d\n",help);
-		fprintf(stderr,"dbg2       input file:      %s\n",ifile);
-		}
-
-	/* if help desired then print it and exit */
-	if (help)
-		{
-		fprintf(stderr,"\n%s\n",help_message);
-		fprintf(stderr,"\nusage: %s\n", usage_message);
-		exit(error);
-		}
-
-	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       argc:      %d\n",argc);
-		for (i=0;i<argc;i++)
-			fprintf(stderr,"dbg2       argv[%d]:    %s\n",
-				i,argv[i]);
-		}
-
-	/* if file specified then use it */
-	if (fileflag > 0)
-		{
-	        status = mbnavadjust_file_open(ifile);
-    		do_update_status();
-		}
-
-	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbnavadjust_set_colors(int ncol, int *pixels)
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_set_colors";
-	int	status = MB_SUCCESS;
-	int	i;
-
-	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       ncolors:      %d\n",ncol);
-		for (i=0;i<ncol;i++)
-			fprintf(stderr,"dbg2       pixel[%d]:     %d\n",
-				i, pixels[i]);
-		}
-
-	/* set colors */
-	ncolors = ncol;
-	for (i=0;i<ncolors;i++)
-		pixel_values[i] = pixels[i];
-
-	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbnavadjust_set_borders(int *cn_brdr, int *cr_brdr, int *zc_brdr)
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_set_borders";
-	int	status = MB_SUCCESS;
-	int	i;
-
-	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       cn_brdr:      %d %d %d %d\n",
-			cn_brdr[0], cn_brdr[1], cn_brdr[2], cn_brdr[3]);
-		fprintf(stderr,"dbg2       cr_brdr:      %d %d %d %d\n",
-			cr_brdr[0], cr_brdr[1], cr_brdr[2], cr_brdr[3]);
-		fprintf(stderr,"dbg2       zc_brdr:      %d %d %d %d\n",
-			zc_brdr[0], zc_brdr[1], zc_brdr[2], zc_brdr[3]);
-		}
-
-	/* set borders */
-	for (i=0;i<4;i++)
-		{
-		cont_borders[i] = cn_brdr[i];
-		corr_borders[i] = cr_brdr[i];
-		zoff_borders[i] = zc_brdr[i];
-		}
-
-	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbnavadjust_set_graphics(void *cn_xgid, void *cr_xgid, void *zc_xgid)
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_set_graphics";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       cn_xgid:      %p\n",cn_xgid);
-		fprintf(stderr,"dbg2       cr_xgid:      %p\n",cr_xgid);
-		fprintf(stderr,"dbg2       zc_xgid:      %p\n",zc_xgid);
-		}
-
-	/* set graphics id */
-	pcont_xgid = cn_xgid;
-	pcorr_xgid = cr_xgid;
-	pzoff_xgid = zc_xgid;
-
-	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbnavadjust_file_new(char *projectname)
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_file_new";
-	int	status = MB_SUCCESS;
-	char	*slashptr, *nameptr;
-	struct stat statbuf;
-
-	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       projectname:  %s\n",projectname);
-		}
-
-	/* no new project if one already open */
-	status = MB_SUCCESS;
-	if (project.open == MB_YES)
-		{
-		strcpy(error1,"Unable to create new project!");
-		sprintf(error2,"Project %s",project.name);
-		strcpy(error3,"is already open.");
-		status = MB_FAILURE;
-		}
-
-	/* get filenames and see if they can be generated */
-	else
-		{
-		nameptr = (char *) NULL;
-		slashptr = strrchr(projectname,'/');
-		if (slashptr != (char *) NULL)
-			nameptr = slashptr + 1;
-		else
-			nameptr = projectname;
-		if (strlen(nameptr) > 4
-			&& strcmp(&nameptr[strlen(nameptr)-4],".nvh") == 0)
-			nameptr[strlen(nameptr)-4] = '\0';
-		if (strlen(nameptr) > 0)
-			{
-			strcpy(project.name,nameptr);
-			strncpy(project.path,projectname,
-				strlen(projectname)-strlen(nameptr));
-			strcpy(project.home,project.path);
-			strcat(project.home,project.name);
-			strcat(project.home,".nvh");
-			strcpy(project.datadir,project.path);
-			strcat(project.datadir,project.name);
-			strcat(project.datadir,".dir");
-
-			/* no new project if file or directory already exist */
-			if (stat(project.home,&statbuf) == 0)
-				{
-				strcpy(error1,"Unable to create new project!");
-				strcpy(error2,"Home file already exists.");
-				strcpy(error3," ");
-				if (stat(project.datadir,&statbuf) == 0)
-				sprintf(error3,"Data directory already exists.");
-				status = MB_FAILURE;
-				}
-			else if (stat(project.datadir,&statbuf) == 0)
-				{
-				strcpy(error1,"Unable to create new project!");
-				strcpy(error2,"Data directory already exists.");
-				strcpy(error3," ");
-				status = MB_FAILURE;
-				}
-
-			/* initialize new project */
-			else
-				{
-				/* set values */
-				project.open = MB_YES;
-				project.num_files = 0;
-				project.num_files_alloc = 0;
-				project.files = NULL;
-				project.num_snavs = 0;
-				project.num_pings = 0;
-				project.num_beams = 0;
-				project.num_crossings = 0;
-				project.num_crossings_alloc = 0;
-				project.num_crossings_analyzed = 0;
-				project.num_goodcrossings = 0;
-				project.num_truecrossings = 0;
-				project.num_truecrossings_analyzed = 0;
-				project.crossings = NULL;
-				project.num_ties = 0;
-				project.inversion = MBNA_INVERSION_NONE;
-				project.precision = SIGMA_MINIMUM;
-				project.smoothing = MBNA_SMOOTHING_DEFAULT;
-				project.zoffsetwidth = 5.0;
-
-				/* create data directory */
-				if (mkdir(project.datadir,00775) != 0)
-					{
-					strcpy(error1,"Unable to create new project!");
-					strcpy(error2,"Error creating data directory.");
-					strcpy(error3," ");
-					status = MB_FAILURE;
-					}
-
-				/* write home file and other files */
-				else if ((status = mbnavadjust_write_project()) == MB_FAILURE)
-					{
-					strcpy(error1,"Unable to create new project!");
-					strcpy(error2,"Error writing data.");
-					strcpy(error3," ");
-					status = MB_FAILURE;
-					}
-				}
-			}
-		else
- 		  	{
-			strcpy(error1,"Unable to create new project!");
-			strcpy(error2,"No project name was provided.");
-			strcpy(error3," ");
-			status = MB_FAILURE;
-			}
-		}
-
-        /* display error message if needed */
-	if (status == MB_FAILURE)
-		{
-		do_error_dialog(error1, error2, error3);
-		sprintf(message, "%s\n > %s\n", error1, error2);
-		do_info_add(message, MB_YES);
-		}
-	else
-		{
-		/* open log file */
-		sprintf(message, "%s/log.txt", project.datadir);
-		project.logfp = fopen(message, "w");
-
-		/* add info text */
-		sprintf(message,"New project initialized: %s\n > Project home: %s\n",
-			project.name, project.home);
-		do_info_add(message, MB_YES);
-		if (project.logfp != NULL)
-		    {
-		    sprintf(message,"Log file %s/log.txt opened\n",
-			project.datadir);
-		    do_info_add(message, MB_YES);
-		    }
-		else
-		    {
-		    sprintf(message,"Unable to open log file %s/log.txt\n",
-			project.datadir);
-		    do_info_add(message, MB_YES);
-		    }
-		}
-
-	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbnavadjust_file_open(char *projectname)
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_file_open";
-	int	status = MB_SUCCESS;
-	char	*slashptr, *nameptr, *bufptr;
-	struct stat statbuf;
-
-	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       projectname:  %s\n",projectname);
-		}
-
-	/* no new project if one already open */
-	status = MB_SUCCESS;
-	if (project.open == MB_YES)
-		{
-		strcpy(error1,"Unable to open project!");
-		sprintf(error2,"Project %s",project.name);
-		strcpy(error3,"is already open.");
-		status = MB_FAILURE;
-		}
-
-	/* get filenames and see if they can be generated */
-	else
-		{
-		nameptr = (char *) NULL;
-		slashptr = strrchr(projectname,'/');
-		if (slashptr != (char *) NULL)
-			nameptr = slashptr + 1;
-		else
-			nameptr = projectname;
-		if (strlen(nameptr) > 4
-			&& strcmp(&nameptr[strlen(nameptr)-4],".nvh") == 0)
-			nameptr[strlen(nameptr)-4] = '\0';
-fprintf(stderr,"projectname:%s nameptr:%s strlen:%ld\n",projectname,nameptr,strlen(nameptr));
-		if (strlen(nameptr) > 0)
-			{
-			strcpy(project.name,nameptr);
-			if (slashptr != (char *) NULL)
-				{
-				strncpy(project.path,projectname,
-					strlen(projectname)-strlen(nameptr));
-				}
-			else
-				{
-				bufptr = getcwd(project.path, MB_PATH_MAXLINE);
-				strcat(project.path,"/");
-				}
-			strcpy(project.home,project.path);
-			strcat(project.home,project.name);
-			strcat(project.home,".nvh");
-			strcpy(project.datadir,project.path);
-			strcat(project.datadir,project.name);
-			strcat(project.datadir,".dir");
-fprintf(stderr,"In mbnavadjust_file_open: name:%s\npath:%s\nhome:%s\ndatadir:%s\n",
-project.name,project.path,project.home,project.datadir);
-
-			/* cant open unless file or directory already exist */
-			if (stat(project.home,&statbuf) != 0)
-				{
-				strcpy(error1,"Unable to open project!");
-				strcpy(error2,"Home file does not exist.");
-				strcpy(error3," ");
-				if (stat(project.datadir,&statbuf) != 0)
-				sprintf(error3,"Data directory does not exist.");
-				status = MB_FAILURE;
-				}
-			else if (stat(project.datadir,&statbuf) != 0)
-				{
-				strcpy(error1,"Unable to open project!");
-				strcpy(error2,"Data directory does not exist.");
-				strcpy(error3," ");
-				status = MB_FAILURE;
-				}
-
-			/* open project */
-			else
-				{
-				/* set values */
-				project.num_files = 0;
-				project.num_files_alloc = 0;
-				project.files = NULL;
-				project.num_snavs = 0;
-				project.num_pings = 0;
-				project.num_beams = 0;
-				project.num_crossings = 0;
-				project.num_crossings_alloc = 0;
-				project.crossings = NULL;
-				project.num_ties = 0;
-
-				/* read home file and other files */
-				if ((status = mbnavadjust_read_project()) == MB_FAILURE)
-					{
-					strcpy(error1,"Unable to open project!");
-					strcpy(error2,"Error reading data.");
-					strcpy(error3," ");
-					status = MB_FAILURE;
-					}
-				}
-			}
-		else
- 		  	{
-			strcpy(error1,"Unable to open project!");
-			strcpy(error2,"No project name was provided.");
-			strcpy(error3," ");
-			status = MB_FAILURE;
-			}
-		}
-
-        /* display error message if needed */
-	if (status == MB_FAILURE)
-		{
-		do_error_dialog(error1, error2, error3);
-		sprintf(message, "%s\n > %s\n", error1, error2);
-		do_info_add(message, MB_YES);
-		}
-	else
-		{
-		/* open log file */
-		sprintf(message, "%s/log.txt", project.datadir);
-		project.logfp = fopen(message, "a");
-
-		/* add info text */
-		sprintf(message,"Project opened: %s\n > Project home: %s\n > Number of Files: %d\n > Number of Crossings Found: %d\n > Number of Crossings Analyzed: %d\n > Number of Navigation Ties: %d\n",
-			project.name, project.home, project.num_files, project.num_crossings,
-			project.num_crossings_analyzed, project.num_ties);
-		do_info_add(message, MB_YES);
-		if (project.logfp != NULL)
-		    {
-		    sprintf(message,"Log file %s/log.txt opened\n",
-			project.datadir);
-		    do_info_add(message, MB_YES);
-		    }
-		else
-		    {
-		    sprintf(message,"Unable to open log file %s/log.txt\n",
-			project.datadir);
-		    do_info_add(message, MB_YES);
-		    }
-		}
-
-	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbnavadjust_close_project()
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_close_project";
-	int	status = MB_SUCCESS;
-	struct mbna_file *file;
-	int	i;
-
-	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
-
-        /* add info text */
-	sprintf(message,"Project closed: %s\n", project.name);
-	do_info_add(message, MB_YES);
-	if (project.logfp != NULL)
-	    {
-	    sprintf(message,"Log file %s/log.txt closed\n",
-		project.datadir);
-	    do_info_add(message, MB_YES);
-	    }
-
-	/* deallocate memory and reset values */
-	for (i=0;i<project.num_files;i++)
-		{
-		file = &project.files[i];
-		if (file->sections != NULL)
-			mb_freed(mbna_verbose,__FILE__,__LINE__,(void **)&file->sections,&error);
-		}
-	if (project.files != NULL)
-		{
-		free(project.files);
-		project.files = NULL;
-		project.num_files_alloc = 0;
-		}
-	if (project.crossings != NULL)
-		{
-		free(project.crossings);
-		project.crossings = NULL;
-		project.num_crossings_alloc = 0;
-		}
-	if (project.logfp != NULL)
-		{
-		fclose(project.logfp);
-		project.logfp = NULL;
-		}
-
-	/* reset values */
-	project.open = MB_NO;
-	memset(project.name,0,STRING_MAX);
-	strcpy(project.name,"None");
- 	memset(project.path,0,STRING_MAX);
-	memset(project.datadir,0,STRING_MAX);
-	project.num_files = 0;
-	project.num_snavs = 0;
-	project.num_pings = 0;
-	project.num_beams = 0;
-	project.num_crossings = 0;
- 	project.num_crossings_analyzed = 0;
-	project.num_goodcrossings = 0;
-	project.num_truecrossings = 0;
- 	project.num_truecrossings_analyzed = 0;
-	project.num_ties = 0;
- 	project.inversion = MBNA_INVERSION_NONE;
-
-	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbnavadjust_write_project()
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_write_project";
-	int	status = MB_SUCCESS;
-	FILE	*hfp, *xfp, *yfp;
-	struct mbna_file *file, *file_1, *file_2;
-	struct mbna_section *section, *section_1, *section_2;
-	struct mbna_crossing *crossing;
-	struct mbna_tie *tie;
-	char	datalist[STRING_MAX];
-	char	routefile[STRING_MAX];
-	char	routename[STRING_MAX];
-	char	xoffsetfile[STRING_MAX];
-	char	yoffsetfile[STRING_MAX];
-	double	navlon1, navlon2, navlat1, navlat2;
-	int	nroute;
-	int	snav_1, snav_2;
-	int	ncrossings_true = 0;
-	int	ncrossings_gt50 = 0;
-	int	ncrossings_gt25 = 0;
-	int	ncrossings_lt25 = 0;
-	int	ncrossings_fixed = 0;
-	int	nties_unfixed = 0;
-	int	nties_fixed = 0;
-	char	status_char, truecrossing_char;
-	int	routecolor = 1;
-	char	*unknown = "Unknown";
-
-	int	i, j, k, l;
-
-	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
-
-	/* open and write home file */
-	if ((hfp = fopen(project.home,"w")) != NULL)
-		{
-fprintf(stderr,"Writing project %s\n", project.name);
-		right_now = time((time_t *)0);
-		strcpy(date,ctime(&right_now));
-                date[strlen(date)-1] = '\0';
-		if ((user_ptr = getenv("USER")) == NULL)
-			user_ptr = getenv("LOGNAME");
-		if (user_ptr != NULL)
-			strcpy(user,user_ptr);
-		else
-			strcpy(user, "unknown");
-		gethostname(host,MBP_FILENAMESIZE);
-		fprintf(hfp,"##MBNAVADJUST PROJECT\n");
-		fprintf(hfp,"MB-SYSTEM_VERSION\t%s\n",MB_VERSION);
-		fprintf(hfp,"PROGRAM_VERSION\t%s\n",rcs_id);
-		fprintf(hfp,"FILE_VERSION\t3.06\n");
-		fprintf(hfp,"ORIGIN\tGenerated by user <%s> on cpu <%s> at <%s>\n", user,host,date);
-		fprintf(hfp,"NAME\t%s\n",project.name);
-		fprintf(hfp,"PATH\t%s\n",project.path);
-		fprintf(hfp,"HOME\t%s\n",project.home);
-		fprintf(hfp,"DATADIR\t%s\n",project.datadir);
-		fprintf(hfp,"NUMFILES\t%d\n",project.num_files);
-		fprintf(hfp,"NUMBLOCKS\t%d\n",project.num_blocks);
-		fprintf(hfp,"NUMCROSSINGS\t%d\n",project.num_crossings);
-		fprintf(hfp,"SECTIONLENGTH\t%f\n",project.section_length);
-		fprintf(hfp,"SECTIONSOUNDINGS\t%d\n",project.section_soundings);
-		fprintf(hfp,"DECIMATION\t%d\n",project.decimation);
-		fprintf(hfp,"CONTOURINTERVAL\t%f\n",project.cont_int);
-		fprintf(hfp,"COLORINTERVAL\t%f\n",project.col_int);
-		fprintf(hfp,"TICKINTERVAL\t%f\n",project.tick_int);
-		fprintf(hfp,"INVERSION\t%d\n",project.inversion);
-		fprintf(hfp,"SMOOTHING\t%f\n",project.smoothing);
-		fprintf(hfp,"ZOFFSETWIDTH\t%f\n",project.zoffsetwidth);
-		for (i=0;i<project.num_files;i++)
-			{
-			/* write out basic file info */
-			file = &project.files[i];
-			fprintf(hfp,"FILE %4d %4d %4d %4d %4d %13.8f %13.8f %13.8f %4.1f %4.1f %4.1f %4.1f %4d %4d %s\n",
-					i,
-					file->status,
-					file->id,
-					file->format,
-					file->block,
-					file->block_offset_x,
-					file->block_offset_y,
-					file->block_offset_z,
-					file->heading_bias_import,
-					file->roll_bias_import,
-					file->heading_bias,
-					file->roll_bias,
-					file->num_sections,
-					file->output_id,
-					file->file);
-
-			/* write out section info */
-			for (j=0;j<file->num_sections;j++)
-				{
-				section = &file->sections[j];
-				fprintf(hfp,"SECTION %4d %5d %5d %d %d %10.6f %16.6f %16.6f %13.8f %13.8f %13.8f %13.8f %9.3f %9.3f %d\n",
-						j,
-						section->num_pings,
-						section->num_beams,
-						section->num_snav,
-						section->continuity,
-						section->distance,
-						section->btime_d,
-						section->etime_d,
-						section->lonmin,
-						section->lonmax,
-						section->latmin,
-						section->latmax,
-						section->depthmin,
-						section->depthmax,
-						section->contoursuptodate);
-				for (k=MBNA_MASK_DIM-1;k>=0;k--)
-				    {
-				    for (l=0;l<MBNA_MASK_DIM;l++)
-					{
-					fprintf(hfp, "%1d", section->coverage[l+k*MBNA_MASK_DIM]);
-					}
-				    fprintf(hfp, "\n");
-				    }
-				for (k=0;k<section->num_snav;k++)
-				    {
-				    fprintf(hfp,"SNAV %4d %5d %10.6f %16.6f %13.8f %13.8f %13.8f %13.8f %13.8f\n",
-						k,
-						section->snav_id[k],
-						section->snav_distance[k],
-						section->snav_time_d[k],
-						section->snav_lon[k],
-						section->snav_lat[k],
-						section->snav_lon_offset[k],
-						section->snav_lat_offset[k],
-						section->snav_z_offset[k]);
-				    }
-				fprintf(hfp,"GLOBALTIE %2d %4d %13.8f %13.8f %13.8f %13.8f %13.8f %13.8f\n",
-						section->global_tie_status,
-						section->global_tie_snav,
-						section->global_tie_offset_x,
-						section->global_tie_offset_y,
-						section->global_tie_offset_z_m,
-						section->global_tie_xsigma,
-						section->global_tie_ysigma,
-						section->global_tie_zsigma);
-				}
-			}
-
-		/* write out crossing info */
-		for (i=0;i<project.num_crossings;i++)
-			{
-			/* write out basic crossing info */
-			crossing = &project.crossings[i];
-			fprintf(hfp,"CROSSING %5d %d %d %3d %5d %3d %5d %3d %2d\n",
-				i,
-				crossing->status,
-				crossing->truecrossing,
-				crossing->overlap,
-				crossing->file_id_1,
-				crossing->section_1,
-				crossing->file_id_2,
-				crossing->section_2,
-				crossing->num_ties);
-
-			/* write out tie info */
-			for (j=0;j<crossing->num_ties;j++)
-				{
-				/* write out basic tie info */
-				tie = &crossing->ties[j];
-				fprintf(hfp,"TIE %5d %1d %5d %16.6f %5d %16.6f %13.8f %13.8f %13.8f %1.1d %13.8f %13.8f %13.8f\n",
-					j,
-					tie->status,
-					tie->snav_1,
-					tie->snav_1_time_d,
-					tie->snav_2,
-					tie->snav_2_time_d,
-					tie->offset_x,
-					tie->offset_y,
-					tie->offset_z_m,
-					tie->inversion_status,
-					tie->inversion_offset_x,
-					tie->inversion_offset_y,
-					tie->inversion_offset_z_m);
-				fprintf(hfp,"COV %13.8f %13.8f %13.8f %13.8f %13.8f %13.8f %13.8f %13.8f %13.8f %13.8f %13.8f %13.8f\n",
-					tie->sigmar1,
-					tie->sigmax1[0],
-					tie->sigmax1[1],
-					tie->sigmax1[2],
-					tie->sigmar2,
-					tie->sigmax2[0],
-					tie->sigmax2[1],
-					tie->sigmax2[2],
-					tie->sigmar3,
-					tie->sigmax3[0],
-					tie->sigmax3[1],
-					tie->sigmax3[2]);
-				}
-			}
-
-		/* close home file */
-		fclose(hfp);
-		status = MB_SUCCESS;
-		}
-
-	/* else set error */
-	else
-		{
-		status = MB_FAILURE;
-		sprintf(message,"Unable to update project %s\n > Home file: %s\n",
-			project.name, project.home);
-		do_info_add(message, MB_YES);
-		}
-
-	/* open and write datalist files */
-	sprintf(datalist,"%s%s.mb-1",project.path,project.name);
-	if ((hfp = fopen(datalist,"w")) != NULL)
-		{
-		for (i=0;i<project.num_files;i++)
-			{
-			/* write file entry */
-			file = &project.files[i];
-			fprintf(hfp,"%s %d\n", file->file, file->format);
-			}
-		fclose(hfp);
-		}
-	sprintf(datalist,"%s/%s.dir/datalist_unfixed.mb-1",project.path,project.name);
-	if ((hfp = fopen(datalist,"w")) != NULL)
-		{
-		for (i=0;i<project.num_files;i++)
-			{
-			/* write file entry for each unfixed file */
-			if (project.files[i].status != MBNA_FILE_FIXEDNAV)
-				{
-				file = &project.files[i];
-				fprintf(hfp,"../%s %d\n", file->file, file->format);
-				}
-			}
-		fclose(hfp);
-		}
-	sprintf(datalist,"%s/%s.dir/datalist_fixed.mb-1",project.path,project.name);
-	if ((hfp = fopen(datalist,"w")) != NULL)
-		{
-		for (i=0;i<project.num_files;i++)
-			{
-			/* write file entry for each unfixed file */
-			if (project.files[i].status == MBNA_FILE_FIXEDNAV)
-				{
-				file = &project.files[i];
-				fprintf(hfp,"../%s %d\n", file->file, file->format);
-				}
-			}
-		fclose(hfp);
-		}
-
-	/* write mbgrdviz route files in which each tie point or crossing is a two point route
-		consisting of the connected snav points
-		- output several different route files
-		- route files of ties (fixed and unfixed separate) represent each tie as a
-			two point route consisting of the connected snav points
-		- route files of crossings (<25%, >= 25% && < 50%, >= 50%, true crossings)
-			represent each crossing as a two point route consisting of the central
-			snav points for each of the two sections.
-		- first count different types of crossings and ties to output as routes
-		- then output each time of route file */
-	ncrossings_true = 0;
-	ncrossings_gt50 = 0;
-	ncrossings_gt25 = 0;
-	ncrossings_lt25 = 0;
-	ncrossings_fixed = 0;
-	nties_unfixed = 0;
-	nties_fixed = 0;
-	for (i=0;i<project.num_crossings;i++)
-		{
-		crossing = &project.crossings[i];
-		
-		/* check all crossings */
-		if (project.files[crossing->file_id_1].status == MBNA_FILE_FIXEDNAV
-			    || project.files[crossing->file_id_2].status == MBNA_FILE_FIXEDNAV)
-			ncrossings_fixed++;
-		else
-			{
-			if (crossing->truecrossing == MB_YES)
-				ncrossings_true++;
-			else if (crossing->overlap >= 50)
-				ncrossings_gt50++;
-			else if (crossing->overlap >= 25)
-				ncrossings_gt25++;
-			else
-				ncrossings_lt25++;
-			}
-    
-		/* check ties */
-		if (crossing->status == MBNA_CROSSING_STATUS_SET)
-			{
-			if (project.files[crossing->file_id_1].status == MBNA_FILE_FIXEDNAV
-				|| project.files[crossing->file_id_2].status == MBNA_FILE_FIXEDNAV)
-				nties_fixed += crossing->num_ties;
-			else
-				nties_unfixed += crossing->num_ties;
-			}
-		}		
-
-	/* write mbgrdviz route file for all unfixed true crossings */
-	sprintf(routefile,"%s%s_truecrossing.rte",project.path,project.name);
-	if ((hfp = fopen(routefile,"w")) == NULL)
-		{
-		fclose(hfp);
-		status = MB_FAILURE;
-		error = MB_ERROR_OPEN_FAIL;
-		sprintf(message, " > Unable to open output tie route file %s\n", routefile);
-		do_info_add(message, MB_NO);
-		if (mbna_verbose == 0)
-			fprintf(stderr,"%s",message);
-		}
-	else
-		{
-		/* write the route file header */
-		fprintf(hfp, "## Route File Version %s\n", ROUTE_VERSION);
-		fprintf(hfp, "## Output by Program %s\n",program_name);
-		fprintf(hfp, "## Program Version %s\n",rcs_id);
-		fprintf(hfp, "## MB-System Version %s\n",MB_VERSION);
-		strncpy(date,"\0",25);
-		right_now = time((time_t *)0);
-		strcpy(date,ctime(&right_now));
-                date[strlen(date)-1] = '\0';
-		if ((user_ptr = getenv("USER")) == NULL)
-			if ((user_ptr = getenv("LOGNAME")) == NULL)
-				user_ptr = unknown;
-		gethostname(host,MB_PATH_MAXLINE);
-		fprintf(hfp, "## Run by user <%s> on cpu <%s> at <%s>\n",
-			user_ptr,host,date);
-		fprintf(hfp, "## Number of routes: %d\n",ncrossings_true);
-		fprintf(hfp, "## Route point format:\n");
-		fprintf(hfp, "##   <longitude (deg)> <latitude (deg)> <topography (m)> <waypoint (boolean)>\n");
-
-		/* loop over all crossings */
-		nroute = 0;
-		for (i=0;i<project.num_crossings;i++)
-			{
-			crossing = &project.crossings[i];
-    
-			/* output only unfixed true crossings */
-			if (crossing->truecrossing == MB_YES
-			    && !(project.files[crossing->file_id_1].status == MBNA_FILE_FIXEDNAV
-				    || project.files[crossing->file_id_2].status == MBNA_FILE_FIXEDNAV))
-				{
-				file_1 = (struct mbna_file *) &project.files[crossing->file_id_1];
-				file_2 = (struct mbna_file *) &project.files[crossing->file_id_2];
-				section_1 = (struct mbna_section *) &file_1->sections[crossing->section_1];
-				section_2 = (struct mbna_section *) &file_2->sections[crossing->section_2];
-				snav_1 = section_1->num_snav/2;
-				snav_2 = section_2->num_snav/2;
-				navlon1 = section_1->snav_lon[snav_1] + section_1->snav_lon_offset[snav_1];
-				navlat1 = section_1->snav_lat[snav_1] + section_1->snav_lat_offset[snav_1];
-				navlon2 = section_2->snav_lon[snav_2] + section_2->snav_lon_offset[snav_2];
-				navlat2 = section_2->snav_lat[snav_2] + section_2->snav_lat_offset[snav_2];
-				if (crossing->status == MBNA_CROSSING_STATUS_NONE)
-					{
-					status_char = 'U';
-					routecolor = ROUTE_COLOR_YELLOW;
-					}
-				else if (crossing->status == MBNA_CROSSING_STATUS_SET)
-					{
-					status_char = '*';
-					routecolor = ROUTE_COLOR_GREEN;
-					}
-				else
-					{
-					status_char = '-';
-					routecolor = ROUTE_COLOR_RED;
-					}
-				if (crossing->truecrossing == MB_NO)
-					truecrossing_char = ' ';
-				else
-					truecrossing_char = 'X';
-				sprintf(routename,"%c%c %4d %2.2d:%3.3d:%3.3d %2.2d:%3.3d:%3.3d %3d %2d",
-					status_char, truecrossing_char, i,
-					file_1->block,
-					crossing->file_id_1,
-					crossing->section_1,
-					file_2->block,
-					crossing->file_id_2,
-					crossing->section_2,
-					crossing->overlap,
-					crossing->num_ties);
-				fprintf(hfp,"## ROUTENAME %s\n", routename);
-				fprintf(hfp,"## ROUTESIZE %d\n", 1);
-				fprintf(hfp,"## ROUTECOLOR %d\n", routecolor);
-				fprintf(hfp,"## ROUTEPOINTS %d\n", 2);
-				fprintf(hfp,"## ROUTEEDITMODE %d\n", MB_NO);
-				fprintf(hfp,"> ## STARTROUTE\n");
-				fprintf(hfp,"%.10f %.10f 0.00 1\n%.10f %.10f 0.00 1\n>\n",
-					navlon1,navlat1,navlon2,navlat2);
-				nroute++;
-				}
-			}
-		fclose(hfp);
-fprintf(stderr,"Output %d (expected %d) true crossing locations to %s\n", nroute, ncrossings_true, routefile);
-		}
-
-	/* write mbgrdviz route file for all unfixed >=50% crossings */
-	sprintf(routefile,"%s%s_gt50crossing.rte",project.path,project.name);
-	if ((hfp = fopen(routefile,"w")) == NULL)
-		{
-		fclose(hfp);
-		status = MB_FAILURE;
-		error = MB_ERROR_OPEN_FAIL;
-		sprintf(message, " > Unable to open output tie route file %s\n", routefile);
-		do_info_add(message, MB_NO);
-		if (mbna_verbose == 0)
-			fprintf(stderr,"%s",message);
-		}
-	else
-		{
-		/* write the route file header */
-		fprintf(hfp, "## Route File Version %s\n", ROUTE_VERSION);
-		fprintf(hfp, "## Output by Program %s\n",program_name);
-		fprintf(hfp, "## Program Version %s\n",rcs_id);
-		fprintf(hfp, "## MB-System Version %s\n",MB_VERSION);
-		strncpy(date,"\0",25);
-		right_now = time((time_t *)0);
-		strcpy(date,ctime(&right_now));
-                date[strlen(date)-1] = '\0';
-		if ((user_ptr = getenv("USER")) == NULL)
-			if ((user_ptr = getenv("LOGNAME")) == NULL)
-				user_ptr = unknown;
-		gethostname(host,MB_PATH_MAXLINE);
-		fprintf(hfp, "## Run by user <%s> on cpu <%s> at <%s>\n",
-			user_ptr,host,date);
-		fprintf(hfp, "## Number of routes: %d\n",ncrossings_gt50);
-		fprintf(hfp, "## Route point format:\n");
-		fprintf(hfp, "##   <longitude (deg)> <latitude (deg)> <topography (m)> <waypoint (boolean)>\n");
-
-		/* loop over all crossings */
-		nroute = 0;
-		for (i=0;i<project.num_crossings;i++)
-			{
-			crossing = &project.crossings[i];
-   
-			/* output only unfixed >=50% crossings */
-			if (crossing->overlap >= 50
-			    && !(project.files[crossing->file_id_1].status == MBNA_FILE_FIXEDNAV
-				    || project.files[crossing->file_id_2].status == MBNA_FILE_FIXEDNAV))
-				{
-				file_1 = (struct mbna_file *) &project.files[crossing->file_id_1];
-				file_2 = (struct mbna_file *) &project.files[crossing->file_id_2];
-				section_1 = (struct mbna_section *) &file_1->sections[crossing->section_1];
-				section_2 = (struct mbna_section *) &file_2->sections[crossing->section_2];
-				snav_1 = section_1->num_snav/2;
-				snav_2 = section_2->num_snav/2;
-				navlon1 = section_1->snav_lon[snav_1] + section_1->snav_lon_offset[snav_1];
-				navlat1 = section_1->snav_lat[snav_1] + section_1->snav_lat_offset[snav_1];
-				navlon2 = section_2->snav_lon[snav_2] + section_2->snav_lon_offset[snav_2];
-				navlat2 = section_2->snav_lat[snav_2] + section_2->snav_lat_offset[snav_2];
-				if (crossing->status == MBNA_CROSSING_STATUS_NONE)
-					{
-					status_char = 'U';
-					routecolor = ROUTE_COLOR_YELLOW;
-					}
-				else if (crossing->status == MBNA_CROSSING_STATUS_SET)
-					{
-					status_char = '*';
-					routecolor = ROUTE_COLOR_GREEN;
-					}
-				else
-					{
-					status_char = '-';
-					routecolor = ROUTE_COLOR_RED;
-					}
-				if (crossing->truecrossing == MB_NO)
-					truecrossing_char = ' ';
-				else
-					truecrossing_char = 'X';
-				sprintf(routename,"%c%c %4d %2.2d:%3.3d:%3.3d %2.2d:%3.3d:%3.3d %3d %2d",
-					status_char, truecrossing_char, i,
-					file_1->block,
-					crossing->file_id_1,
-					crossing->section_1,
-					file_2->block,
-					crossing->file_id_2,
-					crossing->section_2,
-					crossing->overlap,
-					crossing->num_ties);
-				fprintf(hfp,"## ROUTENAME %s\n", routename);
-				fprintf(hfp,"## ROUTESIZE %d\n", 1);
-				fprintf(hfp,"## ROUTECOLOR %d\n", routecolor);
-				fprintf(hfp,"## ROUTEPOINTS %d\n", 2);
-				fprintf(hfp,"## ROUTEEDITMODE %d\n", MB_NO);
-				fprintf(hfp,"> ## STARTROUTE\n");
-				fprintf(hfp,"%.10f %.10f 0.00 1\n%.10f %.10f 0.00 1\n>\n",
-					navlon1,navlat1,navlon2,navlat2);
-				nroute++;
-				}
-			}
-		fclose(hfp);
-fprintf(stderr,"Output %d (expected %d) >=50%% overlap crossing locations to %s\n", nroute, ncrossings_gt50, routefile);
-		}
-
-	/* write mbgrdviz route file for all unfixed >=25% but less than 50% crossings */
-	sprintf(routefile,"%s%s_gt25crossing.rte",project.path,project.name);
-	if ((hfp = fopen(routefile,"w")) == NULL)
-		{
-		fclose(hfp);
-		status = MB_FAILURE;
-		error = MB_ERROR_OPEN_FAIL;
-		sprintf(message, " > Unable to open output tie route file %s\n", routefile);
-		do_info_add(message, MB_NO);
-		if (mbna_verbose == 0)
-			fprintf(stderr,"%s",message);
-		}
-	else
-		{
-		/* write the route file header */
-		fprintf(hfp, "## Route File Version %s\n", ROUTE_VERSION);
-		fprintf(hfp, "## Output by Program %s\n",program_name);
-		fprintf(hfp, "## Program Version %s\n",rcs_id);
-		fprintf(hfp, "## MB-System Version %s\n",MB_VERSION);
-		strncpy(date,"\0",25);
-		right_now = time((time_t *)0);
-		strcpy(date,ctime(&right_now));
-                date[strlen(date)-1] = '\0';
-		if ((user_ptr = getenv("USER")) == NULL)
-			if ((user_ptr = getenv("LOGNAME")) == NULL)
-				user_ptr = unknown;
-		gethostname(host,MB_PATH_MAXLINE);
-		fprintf(hfp, "## Run by user <%s> on cpu <%s> at <%s>\n",
-			user_ptr,host,date);
-		fprintf(hfp, "## Number of routes: %d\n",ncrossings_gt25);
-		fprintf(hfp, "## Route point format:\n");
-		fprintf(hfp, "##   <longitude (deg)> <latitude (deg)> <topography (m)> <waypoint (boolean)>\n");
-
-		/* loop over all crossings */
-		nroute = 0;
-		for (i=0;i<project.num_crossings;i++)
-			{
-			crossing = &project.crossings[i];
-    
-			/* output only unfixed >=25% but less than 50% crossings crossings */
-			if (crossing->overlap >= 25
-			    && !(project.files[crossing->file_id_1].status == MBNA_FILE_FIXEDNAV
-				    || project.files[crossing->file_id_2].status == MBNA_FILE_FIXEDNAV))
-				{
-				file_1 = (struct mbna_file *) &project.files[crossing->file_id_1];
-				file_2 = (struct mbna_file *) &project.files[crossing->file_id_2];
-				section_1 = (struct mbna_section *) &file_1->sections[crossing->section_1];
-				section_2 = (struct mbna_section *) &file_2->sections[crossing->section_2];
-				snav_1 = section_1->num_snav/2;
-				snav_2 = section_2->num_snav/2;
-				navlon1 = section_1->snav_lon[snav_1] + section_1->snav_lon_offset[snav_1];
-				navlat1 = section_1->snav_lat[snav_1] + section_1->snav_lat_offset[snav_1];
-				navlon2 = section_2->snav_lon[snav_2] + section_2->snav_lon_offset[snav_2];
-				navlat2 = section_2->snav_lat[snav_2] + section_2->snav_lat_offset[snav_2];
-				if (crossing->status == MBNA_CROSSING_STATUS_NONE)
-					{
-					status_char = 'U';
-					routecolor = ROUTE_COLOR_YELLOW;
-					}
-				else if (crossing->status == MBNA_CROSSING_STATUS_SET)
-					{
-					status_char = '*';
-					routecolor = ROUTE_COLOR_GREEN;
-					}
-				else
-					{
-					status_char = '-';
-					routecolor = ROUTE_COLOR_RED;
-					}
-				if (crossing->truecrossing == MB_NO)
-					truecrossing_char = ' ';
-				else
-					truecrossing_char = 'X';
-				sprintf(routename,"%c%c %4d %2.2d:%3.3d:%3.3d %2.2d:%3.3d:%3.3d %3d %2d",
-					status_char, truecrossing_char, i,
-					file_1->block,
-					crossing->file_id_1,
-					crossing->section_1,
-					file_2->block,
-					crossing->file_id_2,
-					crossing->section_2,
-					crossing->overlap,
-					crossing->num_ties);
-				fprintf(hfp,"## ROUTENAME %s\n", routename);
-				fprintf(hfp,"## ROUTESIZE %d\n", 1);
-				fprintf(hfp,"## ROUTECOLOR %d\n", routecolor);
-				fprintf(hfp,"## ROUTEPOINTS %d\n", 2);
-				fprintf(hfp,"## ROUTEEDITMODE %d\n", MB_NO);
-				fprintf(hfp,"> ## STARTROUTE\n");
-				fprintf(hfp,"%.10f %.10f 0.00 1\n%.10f %.10f 0.00 1\n>\n",
-					navlon1,navlat1,navlon2,navlat2);
-				nroute++;
-				}
-			}
-		fclose(hfp);
-fprintf(stderr,"Output %d (expected %d) >=25%% && < 50%% overlap crossing locations to %s\n", nroute, ncrossings_gt25, routefile);
-		}
-
-	/* write mbgrdviz route file for all unfixed <25% crossings */
-	sprintf(routefile,"%s%s_lt25crossing.rte",project.path,project.name);
-	if ((hfp = fopen(routefile,"w")) == NULL)
-		{
-		fclose(hfp);
-		status = MB_FAILURE;
-		error = MB_ERROR_OPEN_FAIL;
-		sprintf(message, " > Unable to open output tie route file %s\n", routefile);
-		do_info_add(message, MB_NO);
-		if (mbna_verbose == 0)
-			fprintf(stderr,"%s",message);
-		}
-	else
-		{
-		/* write the route file header */
-		fprintf(hfp, "## Route File Version %s\n", ROUTE_VERSION);
-		fprintf(hfp, "## Output by Program %s\n",program_name);
-		fprintf(hfp, "## Program Version %s\n",rcs_id);
-		fprintf(hfp, "## MB-System Version %s\n",MB_VERSION);
-		strncpy(date,"\0",25);
-		right_now = time((time_t *)0);
-		strcpy(date,ctime(&right_now));
-                date[strlen(date)-1] = '\0';
-		if ((user_ptr = getenv("USER")) == NULL)
-			if ((user_ptr = getenv("LOGNAME")) == NULL)
-				user_ptr = unknown;
-		gethostname(host,MB_PATH_MAXLINE);
-		fprintf(hfp, "## Run by user <%s> on cpu <%s> at <%s>\n",
-			user_ptr,host,date);
-		fprintf(hfp, "## Number of routes: %d\n",ncrossings_lt25);
-		fprintf(hfp, "## Route point format:\n");
-		fprintf(hfp, "##   <longitude (deg)> <latitude (deg)> <topography (m)> <waypoint (boolean)>\n");
-
-		/* loop over all crossings */
-		nroute = 0;
-		for (i=0;i<project.num_crossings;i++)
-			{
-			crossing = &project.crossings[i];
-    
-			/* output only unfixed <25% crossings crossings */
-			if (crossing->overlap < 25
-			    && !(project.files[crossing->file_id_1].status == MBNA_FILE_FIXEDNAV
-				    || project.files[crossing->file_id_2].status == MBNA_FILE_FIXEDNAV))
-				{
-				file_1 = (struct mbna_file *) &project.files[crossing->file_id_1];
-				file_2 = (struct mbna_file *) &project.files[crossing->file_id_2];
-				section_1 = (struct mbna_section *) &file_1->sections[crossing->section_1];
-				section_2 = (struct mbna_section *) &file_2->sections[crossing->section_2];
-				snav_1 = section_1->num_snav/2;
-				snav_2 = section_2->num_snav/2;
-				navlon1 = section_1->snav_lon[snav_1] + section_1->snav_lon_offset[snav_1];
-				navlat1 = section_1->snav_lat[snav_1] + section_1->snav_lat_offset[snav_1];
-				navlon2 = section_2->snav_lon[snav_2] + section_2->snav_lon_offset[snav_2];
-				navlat2 = section_2->snav_lat[snav_2] + section_2->snav_lat_offset[snav_2];
-				if (crossing->status == MBNA_CROSSING_STATUS_NONE)
-					{
-					status_char = 'U';
-					routecolor = ROUTE_COLOR_YELLOW;
-					}
-				else if (crossing->status == MBNA_CROSSING_STATUS_SET)
-					{
-					status_char = '*';
-					routecolor = ROUTE_COLOR_GREEN;
-					}
-				else
-					{
-					status_char = '-';
-					routecolor = ROUTE_COLOR_RED;
-					}
-				if (crossing->truecrossing == MB_NO)
-					truecrossing_char = ' ';
-				else
-					truecrossing_char = 'X';
-				sprintf(routename,"%c%c %4d %2.2d:%3.3d:%3.3d %2.2d:%3.3d:%3.3d %3d %2d",
-					status_char, truecrossing_char, i,
-					file_1->block,
-					crossing->file_id_1,
-					crossing->section_1,
-					file_2->block,
-					crossing->file_id_2,
-					crossing->section_2,
-					crossing->overlap,
-					crossing->num_ties);
-				fprintf(hfp,"## ROUTENAME %s\n", routename);
-				fprintf(hfp,"## ROUTESIZE %d\n", 1);
-				fprintf(hfp,"## ROUTECOLOR %d\n", routecolor);
-				fprintf(hfp,"## ROUTEPOINTS %d\n", 2);
-				fprintf(hfp,"## ROUTEEDITMODE %d\n", MB_NO);
-				fprintf(hfp,"> ## STARTROUTE\n");
-				fprintf(hfp,"%.10f %.10f 0.00 1\n%.10f %.10f 0.00 1\n>\n",
-					navlon1,navlat1,navlon2,navlat2);
-				nroute++;
-				}
-			}
-		fclose(hfp);
-fprintf(stderr,"Output %d (expected %d) <25%% overlap crossing locations to %s\n", nroute, ncrossings_lt25, routefile);
-		}
-
-	/* write mbgrdviz route file for all fixed crossings */
-	sprintf(routefile,"%s%s_fixedcrossing.rte",project.path,project.name);
-	if ((hfp = fopen(routefile,"w")) == NULL)
-		{
-		fclose(hfp);
-		status = MB_FAILURE;
-		error = MB_ERROR_OPEN_FAIL;
-		sprintf(message, " > Unable to open output fixed crossings route file %s\n", routefile);
-		do_info_add(message, MB_NO);
-		if (mbna_verbose == 0)
-			fprintf(stderr,"%s",message);
-		}
-	else
-		{
-		/* write the route file header */
-		fprintf(hfp, "## Route File Version %s\n", ROUTE_VERSION);
-		fprintf(hfp, "## Output by Program %s\n",program_name);
-		fprintf(hfp, "## Program Version %s\n",rcs_id);
-		fprintf(hfp, "## MB-System Version %s\n",MB_VERSION);
-		strncpy(date,"\0",25);
-		right_now = time((time_t *)0);
-		strcpy(date,ctime(&right_now));
-                date[strlen(date)-1] = '\0';
-		if ((user_ptr = getenv("USER")) == NULL)
-			if ((user_ptr = getenv("LOGNAME")) == NULL)
-				user_ptr = unknown;
-		gethostname(host,MB_PATH_MAXLINE);
-		fprintf(hfp, "## Run by user <%s> on cpu <%s> at <%s>\n",
-			user_ptr,host,date);
-		fprintf(hfp, "## Number of routes: %d\n",ncrossings_fixed);
-		fprintf(hfp, "## Route point format:\n");
-		fprintf(hfp, "##   <longitude (deg)> <latitude (deg)> <topography (m)> <waypoint (boolean)>\n");
-
-		/* loop over all crossings */
-		nroute = 0;
-		for (i=0;i<project.num_crossings;i++)
-			{
-			crossing = &project.crossings[i];
-  
-			/* output only fixed crossings */
-			if (project.files[crossing->file_id_1].status == MBNA_FILE_FIXEDNAV
-				    || project.files[crossing->file_id_2].status == MBNA_FILE_FIXEDNAV)
-				{
-				file_1 = (struct mbna_file *) &project.files[crossing->file_id_1];
-				file_2 = (struct mbna_file *) &project.files[crossing->file_id_2];
-				section_1 = (struct mbna_section *) &file_1->sections[crossing->section_1];
-				section_2 = (struct mbna_section *) &file_2->sections[crossing->section_2];
-				snav_1 = section_1->num_snav/2;
-				snav_2 = section_2->num_snav/2;
-				navlon1 = section_1->snav_lon[snav_1] + section_1->snav_lon_offset[snav_1];
-				navlat1 = section_1->snav_lat[snav_1] + section_1->snav_lat_offset[snav_1];
-				navlon2 = section_2->snav_lon[snav_2] + section_2->snav_lon_offset[snav_2];
-				navlat2 = section_2->snav_lat[snav_2] + section_2->snav_lat_offset[snav_2];
-				if (crossing->status == MBNA_CROSSING_STATUS_NONE)
-					{
-					status_char = 'U';
-					routecolor = ROUTE_COLOR_YELLOW;
-					}
-				else if (crossing->status == MBNA_CROSSING_STATUS_SET)
-					{
-					status_char = '*';
-					routecolor = ROUTE_COLOR_GREEN;
-					}
-				else
-					{
-					status_char = '-';
-					routecolor = ROUTE_COLOR_RED;
-					}
-				if (crossing->truecrossing == MB_NO)
-					truecrossing_char = ' ';
-				else
-					truecrossing_char = 'X';
-				sprintf(routename,"%c%c %4d %2.2d:%3.3d:%3.3d %2.2d:%3.3d:%3.3d %3d %2d",
-					status_char, truecrossing_char, i,
-					file_1->block,
-					crossing->file_id_1,
-					crossing->section_1,
-					file_2->block,
-					crossing->file_id_2,
-					crossing->section_2,
-					crossing->overlap,
-					crossing->num_ties);
-				fprintf(hfp,"## ROUTENAME %s\n", routename);
-				fprintf(hfp,"## ROUTESIZE %d\n", 1);
-				fprintf(hfp,"## ROUTECOLOR %d\n", routecolor);
-				fprintf(hfp,"## ROUTEPOINTS %d\n", 2);
-				fprintf(hfp,"## ROUTEEDITMODE %d\n", MB_NO);
-				fprintf(hfp,"> ## STARTROUTE\n");
-				fprintf(hfp,"%.10f %.10f 0.00 1\n%.10f %.10f 0.00 1\n>\n",
-					navlon1,navlat1,navlon2,navlat2);
-				nroute++;
-				}
-			}
-		fclose(hfp);
-fprintf(stderr,"Output %d (expected %d) fixed crossing locations to %s\n", nroute, ncrossings_fixed, routefile);
-		}
-
-	/* write mbgrdviz route file for all unfixed ties */
-	sprintf(routefile,"%s%s_unfixedties.rte",project.path,project.name);
-	if ((hfp = fopen(routefile,"w")) == NULL)
-		{
-		fclose(hfp);
-		status = MB_FAILURE;
-		error = MB_ERROR_OPEN_FAIL;
-		sprintf(message, " > Unable to open output unfixed ties route file %s\n", routefile);
-		do_info_add(message, MB_NO);
-		if (mbna_verbose == 0)
-			fprintf(stderr,"%s",message);
-		}
-	else
-		{
-		/* write the route file header */
-		fprintf(hfp, "## Route File Version %s\n", ROUTE_VERSION);
-		fprintf(hfp, "## Output by Program %s\n",program_name);
-		fprintf(hfp, "## Program Version %s\n",rcs_id);
-		fprintf(hfp, "## MB-System Version %s\n",MB_VERSION);
-		strncpy(date,"\0",25);
-		right_now = time((time_t *)0);
-		strcpy(date,ctime(&right_now));
-                date[strlen(date)-1] = '\0';
-		if ((user_ptr = getenv("USER")) == NULL)
-			if ((user_ptr = getenv("LOGNAME")) == NULL)
-				user_ptr = unknown;
-		gethostname(host,MB_PATH_MAXLINE);
-		fprintf(hfp, "## Run by user <%s> on cpu <%s> at <%s>\n",
-			user_ptr,host,date);
-		fprintf(hfp, "## Number of routes: %d\n",nties_unfixed);
-		fprintf(hfp, "## Route point format:\n");
-		fprintf(hfp, "##   <longitude (deg)> <latitude (deg)> <topography (m)> <waypoint (boolean)>\n");
-		routecolor = ROUTE_COLOR_BLUEGREEN;
-
-		/* loop over all crossings */
-		nroute = 0;
-		for (i=0;i<project.num_crossings;i++)
-			{
-			crossing = &project.crossings[i];
-   
-			/* output only unfixed ties */
-			if (crossing->status == MBNA_CROSSING_STATUS_SET
-				&& !(project.files[crossing->file_id_1].status == MBNA_FILE_FIXEDNAV
-					|| project.files[crossing->file_id_2].status == MBNA_FILE_FIXEDNAV))
-				{
-				for (j=0;j<crossing->num_ties;j++)
-					{
-					file_1 = (struct mbna_file *) &project.files[crossing->file_id_1];
-					file_2 = (struct mbna_file *) &project.files[crossing->file_id_2];
-					section_1 = (struct mbna_section *) &file_1->sections[crossing->section_1];
-					section_2 = (struct mbna_section *) &file_2->sections[crossing->section_2];
-					tie = (struct mbna_tie *) &crossing->ties[j];
-					snav_1 = tie->snav_1;
-					snav_2 = tie->snav_2;
-					navlon1 = section_1->snav_lon[snav_1] + section_1->snav_lon_offset[snav_1];
-					navlat1 = section_1->snav_lat[snav_1] + section_1->snav_lat_offset[snav_1];
-					navlon2 = section_2->snav_lon[snav_2] + section_2->snav_lon_offset[snav_2];
-					navlat2 = section_2->snav_lat[snav_2] + section_2->snav_lat_offset[snav_2];
-					if (crossing->status == MBNA_CROSSING_STATUS_NONE)
-						status_char = 'U';
-					else if (crossing->status == MBNA_CROSSING_STATUS_SET)
-						status_char = '*';
-					else
-						status_char = '-';
-					if (crossing->truecrossing == MB_NO)
-						truecrossing_char = ' ';
-					else
-						truecrossing_char = 'X';
-					sprintf(routename,"Tie: %c%c %4d %2.2d:%3.3d:%3.3d %2.2d:%3.3d:%3.3d %3d %2d of %2d",
-						status_char, truecrossing_char, i,
-						file_1->block,
-						crossing->file_id_1,
-						crossing->section_1,
-						file_2->block,
-						crossing->file_id_2,
-						crossing->section_2,
-						crossing->overlap,
-						j, crossing->num_ties);
-					fprintf(hfp,"## ROUTENAME %s\n", routename);
-					fprintf(hfp,"## ROUTESIZE %d\n", 1);
-					fprintf(hfp,"## ROUTECOLOR %d\n", routecolor);
-					fprintf(hfp,"## ROUTEPOINTS %d\n", 2);
-					fprintf(hfp,"## ROUTEEDITMODE %d\n", MB_NO);
-					fprintf(hfp,"> ## STARTROUTE\n");
-					fprintf(hfp,"%.10f %.10f 0.00 1\n%.10f %.10f 0.00 1\n>\n",
-						navlon1,navlat1,navlon2,navlat2);
-					nroute++;
-					}
-				}
-			}
-		fclose(hfp);
-fprintf(stderr,"Output %d (expected %d) unfixed tie locations to %s\n", nroute, nties_unfixed, routefile);
-		}
-
-	/* write mbgrdviz route file for all fixed ties */
-	sprintf(routefile,"%s%s_fixedties.rte",project.path,project.name);
-	if ((hfp = fopen(routefile,"w")) == NULL)
-		{
-		fclose(hfp);
-		status = MB_FAILURE;
-		error = MB_ERROR_OPEN_FAIL;
-		sprintf(message, " > Unable to open output fixed ties route file %s\n", routefile);
-		do_info_add(message, MB_NO);
-		if (mbna_verbose == 0)
-			fprintf(stderr,"%s",message);
-		}
-	else
-		{
-		/* write the route file header */
-		fprintf(hfp, "## Route File Version %s\n", ROUTE_VERSION);
-		fprintf(hfp, "## Output by Program %s\n",program_name);
-		fprintf(hfp, "## Program Version %s\n",rcs_id);
-		fprintf(hfp, "## MB-System Version %s\n",MB_VERSION);
-		strncpy(date,"\0",25);
-		right_now = time((time_t *)0);
-		strcpy(date,ctime(&right_now));
-                date[strlen(date)-1] = '\0';
-		if ((user_ptr = getenv("USER")) == NULL)
-			if ((user_ptr = getenv("LOGNAME")) == NULL)
-				user_ptr = unknown;
-		gethostname(host,MB_PATH_MAXLINE);
-		fprintf(hfp, "## Run by user <%s> on cpu <%s> at <%s>\n",
-			user_ptr,host,date);
-		fprintf(hfp, "## Number of routes: %d\n",nties_fixed);
-		fprintf(hfp, "## Route point format:\n");
-		fprintf(hfp, "##   <longitude (deg)> <latitude (deg)> <topography (m)> <waypoint (boolean)>\n");
-		routecolor = ROUTE_COLOR_RED;
-
-		/* loop over all crossings */
-		nroute = 0;
-		for (i=0;i<project.num_crossings;i++)
-			{
-			crossing = &project.crossings[i];
-   
-			/* output only fixed ties */
-			if (crossing->status == MBNA_CROSSING_STATUS_SET
-				&& (project.files[crossing->file_id_1].status == MBNA_FILE_FIXEDNAV
-					|| project.files[crossing->file_id_2].status == MBNA_FILE_FIXEDNAV))
-				{
-				for (j=0;j<crossing->num_ties;j++)
-					{
-					file_1 = (struct mbna_file *) &project.files[crossing->file_id_1];
-					file_2 = (struct mbna_file *) &project.files[crossing->file_id_2];
-					section_1 = (struct mbna_section *) &file_1->sections[crossing->section_1];
-					section_2 = (struct mbna_section *) &file_2->sections[crossing->section_2];
-					tie = (struct mbna_tie *) &crossing->ties[j];
-					snav_1 = tie->snav_1;
-					snav_2 = tie->snav_2;
-					navlon1 = section_1->snav_lon[snav_1] + section_1->snav_lon_offset[snav_1];
-					navlat1 = section_1->snav_lat[snav_1] + section_1->snav_lat_offset[snav_1];
-					navlon2 = section_2->snav_lon[snav_2] + section_2->snav_lon_offset[snav_2];
-					navlat2 = section_2->snav_lat[snav_2] + section_2->snav_lat_offset[snav_2];
-					if (crossing->status == MBNA_CROSSING_STATUS_NONE)
-						status_char = 'U';
-					else if (crossing->status == MBNA_CROSSING_STATUS_SET)
-						status_char = '*';
-					else
-						status_char = '-';
-					if (crossing->truecrossing == MB_NO)
-						truecrossing_char = ' ';
-					else
-						truecrossing_char = 'X';
-					sprintf(routename,"Tie: %c%c %4d %2.2d:%3.3d:%3.3d %2.2d:%3.3d:%3.3d %3d %2d of %2d",
-						status_char, truecrossing_char, i,
-						file_1->block,
-						crossing->file_id_1,
-						crossing->section_1,
-						file_2->block,
-						crossing->file_id_2,
-						crossing->section_2,
-						crossing->overlap,
-						j, crossing->num_ties);
-					fprintf(hfp,"## ROUTENAME %s\n", routename);
-					fprintf(hfp,"## ROUTESIZE %d\n", 1);
-					fprintf(hfp,"## ROUTECOLOR %d\n", routecolor);
-					fprintf(hfp,"## ROUTEPOINTS %d\n", 2);
-					fprintf(hfp,"## ROUTEEDITMODE %d\n", MB_NO);
-					fprintf(hfp,"> ## STARTROUTE\n");
-					fprintf(hfp,"%.10f %.10f 0.00 1\n%.10f %.10f 0.00 1\n>\n",
-						navlon1,navlat1,navlon2,navlat2);
-					nroute++;
-					}
-				}
-			}
-		fclose(hfp);
-fprintf(stderr,"Output %d (expected %d) fixed tie locations to %s\n", nroute, nties_fixed, routefile);
-		}
-
-	/* output offset vectors */
-	if (project.inversion == MBNA_INVERSION_CURRENT)
-		{
-		sprintf(xoffsetfile,"%s%s_dx.txt",project.path,project.name);
-		sprintf(yoffsetfile,"%s%s_dy.txt",project.path,project.name);
-		if ((xfp = fopen(xoffsetfile,"w")) != NULL
-		    && (yfp = fopen(yoffsetfile,"w")) != NULL)
-			{
-			for (i=0;i<project.num_files;i++)
-			    {
-			    file = &project.files[i];
-			    for (j=0;j<file->num_sections;j++)
-				{
-				section = &file->sections[j];
-				for (k=0;k<section->num_snav;k++)
-				    {
-				    fprintf(xfp, "%.10f %.10f %.10f\n", section->snav_lon[k], section->snav_lat[k],
-								section->snav_lon_offset[k]/mbna_mtodeglon);
-				    fprintf(yfp, "%.10f %.10f %.10f\n", section->snav_lon[k], section->snav_lat[k],
-								section->snav_lat_offset[k]/mbna_mtodeglat);
-				    }
-				}
-			    }
-			fclose(xfp);
-			fclose(yfp);
-			}
-
-		/* else set error */
-		else
-			{
-			status = MB_FAILURE;
-			sprintf(message,"Unable to update project %s\n > Offset vector files: %s %s\n",
-				project.name, xoffsetfile, yoffsetfile);
-			do_info_add(message, MB_YES);
-			}
-		}
-
-	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbnavadjust_read_project()
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_read_project";
-	int	status = MB_SUCCESS;
-	FILE	*hfp;
-	struct mbna_file *file;
-	struct mbna_section *section, *section1, *section2;
-	struct mbna_crossing *crossing;
-	struct mbna_tie *tie;
-	char	label[STRING_MAX];
-	char	buffer[BUFFER_MAX];
-	char	obuffer[BUFFER_MAX];
-	char	command[MB_PATH_MAXLINE];
-	char	*result;
-	int	versionmajor, versionminor, version_id;
-	double	dummy;
-	double	mtodeglon, mtodeglat;
-	int	nscan, idummy, jdummy;
-	int	s1id, s2id;
-	int	shellstatus;
-	int	i, j, k, l;
-
-	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
-
-	/* first save copy of the project file */
-	sprintf(command,"cp %s %s.save", project.home, project.home);
-	shellstatus = system(command);
-
-	/* open and read home file */
-	status = MB_SUCCESS;
-	if ((hfp = fopen(project.home,"r")) != NULL)
-		{
-		/* check for proper header */
-		if ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
-			|| strncmp(buffer,"##MBNAVADJUST PROJECT",21) != 0)
-			status = MB_FAILURE;
-if (status == MB_FAILURE){fprintf(stderr,"Die at line:%d file:%s buffer:%s\n",__LINE__,__FILE__,buffer);exit(0);}
-
-		/* read basic names and stats */
-		if (status == MB_SUCCESS
-			&& ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
-				|| (nscan = sscanf(buffer,"%s %s",label,obuffer)) != 2
-			    	|| strcmp(label,"MB-SYSTEM_VERSION") != 0))
-			status = MB_FAILURE;
-if (status == MB_FAILURE){fprintf(stderr,"Die at line:%d file:%s buffer:%s\n",__LINE__,__FILE__,buffer);exit(0);}
-
-		if (status == MB_SUCCESS
-			&& ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
-				|| (nscan = sscanf(buffer,"%s %s",label,obuffer)) != 2
-				|| strcmp(label,"PROGRAM_VERSION") != 0))
-			status = MB_FAILURE;
-if (status == MB_FAILURE){fprintf(stderr,"Die at line:%d file:%s buffer:%s\n",__LINE__,__FILE__,buffer);exit(0);}
-
-		if (status == MB_SUCCESS
-			&& ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
-				|| (nscan = sscanf(buffer,"%s %d.%d",label,&versionmajor,&versionminor)) != 3
-				|| strcmp(label,"FILE_VERSION") != 0))
-			status = MB_FAILURE;
-if (status == MB_FAILURE){fprintf(stderr,"Die at line:%d file:%s buffer:%s\n",__LINE__,__FILE__,buffer);exit(0);}
-		version_id = 100 * versionmajor + versionminor;
-
-		if (version_id >= 302)
-			{
-			if (status == MB_SUCCESS
-				&& ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
-					|| (nscan = sscanf(buffer,"%s %s",label,obuffer)) != 2
-					|| strcmp(label,"ORIGIN") != 0))
-				status = MB_FAILURE;
-			}
-if (status == MB_FAILURE){fprintf(stderr,"Die at line:%d file:%s buffer:%s\n",__LINE__,__FILE__,buffer);exit(0);}
-
-		if (status == MB_SUCCESS
-			&& ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
-				|| (nscan = sscanf(buffer,"%s %s",label,obuffer)) != 2
-				|| strcmp(label,"NAME") != 0))
-			status = MB_FAILURE;
-if (status == MB_FAILURE){fprintf(stderr,"Die at line:%d file:%s buffer:%s\n",__LINE__,__FILE__,buffer);exit(0);}
-
-		if (status == MB_SUCCESS
-			&& ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
-				|| (nscan = sscanf(buffer,"%s %s",label,obuffer)) != 2
-				|| strcmp(label,"PATH") != 0))
-			status = MB_FAILURE;
-if (status == MB_FAILURE){fprintf(stderr,"Die at line:%d file:%s buffer:%s\n",__LINE__,__FILE__,buffer);exit(0);}
-
-		if (status == MB_SUCCESS
-			&& ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
-				|| (nscan = sscanf(buffer,"%s %s",label,obuffer)) != 2
-				|| strcmp(label,"HOME") != 0))
-			status = MB_FAILURE;
-if (status == MB_FAILURE){fprintf(stderr,"Die at line:%d file:%s buffer:%s\n",__LINE__,__FILE__,buffer);exit(0);}
-
-		if (status == MB_SUCCESS
-			&& ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
-				|| (nscan = sscanf(buffer,"%s %s",label,obuffer)) != 2
-				|| strcmp(label,"DATADIR") != 0))
-			status = MB_FAILURE;
-if (status == MB_FAILURE){fprintf(stderr,"Die at line:%d file:%s buffer:%s\n",__LINE__,__FILE__,buffer);exit(0);}
-
-		if (status == MB_SUCCESS
-			&& ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
-				|| (nscan = sscanf(buffer,"%s %d",label,&project.num_files)) != 2
-				|| strcmp(label,"NUMFILES") != 0))
-			status = MB_FAILURE;
-if (status == MB_FAILURE){fprintf(stderr,"Die at line:%d file:%s buffer:%s\n",__LINE__,__FILE__,buffer);exit(0);}
-
-		if (version_id >= 306)
-			{
-			if (status == MB_SUCCESS
-				&& ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
-					|| (nscan = sscanf(buffer,"%s %d",label,&project.num_blocks)) != 2
-					|| strcmp(label,"NUMBLOCKS") != 0))
-				status = MB_FAILURE;
-			}
-		else
-			{
-			project.num_blocks = 0;
-			}
-if (status == MB_FAILURE){fprintf(stderr,"Die at line:%d file:%s buffer:%s\n",__LINE__,__FILE__,buffer);exit(0);}
-
-		if (status == MB_SUCCESS
-			&& ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
-				|| (nscan = sscanf(buffer,"%s %d",label,&project.num_crossings)) != 2
-				|| strcmp(label,"NUMCROSSINGS") != 0))
-			status = MB_FAILURE;
-if (status == MB_FAILURE){fprintf(stderr,"Die at line:%d file:%s buffer:%s\n",__LINE__,__FILE__,buffer);exit(0);}
-
-		if (status == MB_SUCCESS
-			&& ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
-				|| (nscan = sscanf(buffer,"%s %lf",label,&project.section_length)) != 2
-				|| strcmp(label,"SECTIONLENGTH") != 0))
-			status = MB_FAILURE;
-if (status == MB_FAILURE){fprintf(stderr,"Die at line:%d file:%s buffer:%s\n",__LINE__,__FILE__,buffer);exit(0);}
-
-		if (status == MB_SUCCESS
-			&& version_id >= 101
-			&& ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
-				|| (nscan = sscanf(buffer,"%s %d",label,&project.section_soundings)) != 2
-				|| strcmp(label,"SECTIONSOUNDINGS") != 0))
-			status = MB_FAILURE;
-if (status == MB_FAILURE){fprintf(stderr,"Die at line:%d file:%s buffer:%s\n",__LINE__,__FILE__,buffer);exit(0);}
-
-		if (status == MB_SUCCESS
-			&& ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
-				|| (nscan = sscanf(buffer,"%s %d",label,&project.decimation)) != 2
-				|| strcmp(label,"DECIMATION") != 0))
-			status = MB_FAILURE;
-if (status == MB_FAILURE){fprintf(stderr,"Die at line:%d file:%s buffer:%s\n",__LINE__,__FILE__,buffer);exit(0);}
-
-		if (status == MB_SUCCESS
-			&& ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
-				|| (nscan = sscanf(buffer,"%s %lf",label,&project.cont_int)) != 2
-				|| strcmp(label,"CONTOURINTERVAL") != 0))
-			status = MB_FAILURE;
-if (status == MB_FAILURE){fprintf(stderr,"Die at line:%d file:%s buffer:%s\n",__LINE__,__FILE__,buffer);exit(0);}
-
-		if (status == MB_SUCCESS
-			&& ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
-				|| (nscan = sscanf(buffer,"%s %lf",label,&project.col_int)) != 2
-				|| strcmp(label,"COLORINTERVAL") != 0))
-			status = MB_FAILURE;
-if (status == MB_FAILURE){fprintf(stderr,"Die at line:%d file:%s buffer:%s\n",__LINE__,__FILE__,buffer);exit(0);}
-
-		if (status == MB_SUCCESS
-			&& ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
-				|| (nscan = sscanf(buffer,"%s %lf",label,&project.tick_int)) != 2
-				|| strcmp(label,"TICKINTERVAL") != 0))
-			status = MB_FAILURE;
-if (status == MB_FAILURE){fprintf(stderr,"Die at line:%d file:%s buffer:%s\n",__LINE__,__FILE__,buffer);exit(0);}
-
-		if (status == MB_SUCCESS
-			&& ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
-				|| (nscan = sscanf(buffer,"%s %d",label,&project.inversion)) != 2
-				|| strcmp(label,"INVERSION") != 0))
-			status = MB_FAILURE;
-if (status == MB_FAILURE){fprintf(stderr,"Die at line:%d file:%s buffer:%s\n",__LINE__,__FILE__,buffer);exit(0);}
-
-		if (status == MB_SUCCESS)
-			{
-			if (version_id >= 301)
-				{
-				if ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
-					|| (nscan = sscanf(buffer,"%s %lf",label,&project.smoothing)) != 2
-					|| strcmp(label,"SMOOTHING") != 0)
-					status = MB_FAILURE;
-				project.precision = SIGMA_MINIMUM;
-				}
-			else if (version_id >= 103)
-				{
-				if ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
-					|| (nscan = sscanf(buffer,"%s %lf",label,&project.precision)) != 2
-					|| strcmp(label,"PRECISION") != 0)
-					status = MB_FAILURE;
-				project.smoothing = MBNA_SMOOTHING_DEFAULT;
-				}
-			else
-				{
-				project.precision = SIGMA_MINIMUM;
-				project.smoothing = MBNA_SMOOTHING_DEFAULT;
-				}
-			}
-if (status == MB_FAILURE){fprintf(stderr,"Die at line:%d file:%s\n",__LINE__,__FILE__);exit(0);}
-
-		if (status == MB_SUCCESS)
-			{
-			if (version_id >= 105
-				&& ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
-					|| (nscan = sscanf(buffer,"%s %lf",label,&project.zoffsetwidth)) != 2
-					|| strcmp(label,"ZOFFSETWIDTH") != 0))
-				status = MB_FAILURE;
-			}
-
-		/* allocate memory for files array */
-if (status == MB_FAILURE){fprintf(stderr,"Die at line:%d file:%s\n",__LINE__,__FILE__);exit(0);}
-
-		if (project.num_files > 0)
-			{
-			project.files = (struct mbna_file *)
-				malloc(sizeof(struct mbna_file) * (project.num_files));
-			if (project.files != NULL)
-				{
-				project.num_files_alloc = project.num_files;
-				memset(project.files,0,project.num_files_alloc * sizeof(struct mbna_file));
-				}
-			else
-				{
-				project.num_files_alloc = 0;
-				status = MB_FAILURE;
-				error = MB_ERROR_MEMORY_FAIL;
-				}
-			}
-if (status == MB_FAILURE){fprintf(stderr,"Die at line:%d file:%s\n",__LINE__,__FILE__);exit(0);}
-
-		if (project.num_crossings > 0)
-			{
-			project.crossings = (struct mbna_crossing *)
-				malloc(sizeof(struct mbna_crossing) * (project.num_crossings));
-			if (project.crossings != NULL)
-				{
-				project.num_crossings_alloc = project.num_crossings;
-				memset(project.crossings,0,sizeof(struct mbna_crossing) * project.num_crossings_alloc);
-				}
-			else
-				{
-				project.num_crossings_alloc = 0;
-				status = MB_FAILURE;
-				error = MB_ERROR_MEMORY_FAIL;
-				}
-			}
-if (status == MB_FAILURE){fprintf(stderr,"Die at line:%d file:%s\n",__LINE__,__FILE__);exit(0);}
-
-		for (i=0;i<project.num_files;i++)
-			{
-			file = &project.files[i];
-			file->num_sections_alloc = 0;
-			file->sections = NULL;
-			file->num_snavs = 0;
-			file->num_pings = 0;
-			file->num_beams = 0;
-			if (version_id >= 306)
-				{
-				if (status == MB_SUCCESS
-					&& ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
-						|| (nscan = sscanf(buffer,"FILE %d %d %d %d %d %lf %lf %lf %lf %lf %lf %lf %d %d %s",
-						&idummy,
-						&(file->status),
-						&(file->id),
-						&(file->format),
-						&(file->block),
-						&(file->block_offset_x),
-						&(file->block_offset_y),
-						&(file->block_offset_z),
-						&(file->heading_bias_import),
-						&(file->roll_bias_import),
-						&(file->heading_bias),
-						&(file->roll_bias),
-						&(file->num_sections),
-						&(file->output_id),
-						file->file)) != 15))
-					status = MB_FAILURE;
-				}
-			else
-				{
-				if (status == MB_SUCCESS
-					&& ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
-						|| (nscan = sscanf(buffer,"FILE %d %d %d %d %lf %lf %lf %lf %d %d %s",
-						&idummy,
-						&(file->status),
-						&(file->id),
-						&(file->format),
-						&(file->heading_bias_import),
-						&(file->roll_bias_import),
-						&(file->heading_bias),
-						&(file->roll_bias),
-						&(file->num_sections),
-						&(file->output_id),
-						file->file)) != 11))
-					status = MB_FAILURE;
-				file->block = 0;
-				file->block_offset_x = 0.0;
-				file->block_offset_y = 0.0;
-				file->block_offset_z = 0.0;
-				}
-
-			/* set file->path as absolute path
-			    - file->file may be a relative path */
-			if (status == MB_SUCCESS)
-				{
-				if (file->file[0] == '/')
-				    strcpy(file->path, file->file);
-				else
-				    {
-				    strcpy(file->path, project.path);
-				    strcat(file->path, file->file);
-				    }
-				}
-
-			/* read section info */
-			if (file->num_sections > 0)
-				{
-				file->sections = (struct mbna_section *)
-					malloc(sizeof(struct mbna_section) * (file->num_sections));
-				if (file->sections != NULL)
-					{
-					file->num_sections_alloc = file->num_sections;
-					memset(file->sections,0,sizeof(struct mbna_section) * file->num_sections_alloc);
-				        }
-				else
-					{
-					file->num_sections_alloc = 0;
-					status = MB_FAILURE;
-					error = MB_ERROR_MEMORY_FAIL;
-					}
-				}
-			for (j=0;j<file->num_sections;j++)
-				{
-				section = &file->sections[j];
-				if (status == MB_SUCCESS)
-					result = fgets(buffer,BUFFER_MAX,hfp);
-				if (status == MB_SUCCESS && result == buffer)
-					nscan = sscanf(buffer,"SECTION %d %d %d %d %d %lf %lf %lf %lf %lf %lf %lf %lf %lf %d",
-						&idummy,
-						&section->num_pings,
-						&section->num_beams,
-						&section->num_snav,
-						&section->continuity,
-						&section->distance,
-						&section->btime_d,
-						&section->etime_d,
-						&section->lonmin,
-						&section->lonmax,
-						&section->latmin,
-						&section->latmax,
-						&section->depthmin,
-						&section->depthmax,
-						&section->contoursuptodate);
-				if (result != buffer || nscan < 14)
-					{
-					status = MB_FAILURE;
-fprintf(stderr, "read failed on section: %s\n", buffer);
-					}
-				if (nscan < 15)
-					section->contoursuptodate = MB_NO;
-				for (k=MBNA_MASK_DIM-1;k>=0;k--)
-					{
-					if (status == MB_SUCCESS)
-					    result = fgets(buffer,BUFFER_MAX,hfp);
-					for (l=0;l<MBNA_MASK_DIM;l++)
-						{
-						sscanf(&buffer[l], "%1d", &section->coverage[l+k*MBNA_MASK_DIM]);
-						}
-					}
-if (status == MB_FAILURE){fprintf(stderr,"Die at line:%d file:%s\n",__LINE__,__FILE__);exit(0);}
-/*fprintf(stderr,"%s/nvs_%4.4d_%4.4d.mb71\n",
-project.datadir,file->id,j);
-for (k=MBNA_MASK_DIM-1;k>=0;k--)
-{
-for (l=0;l<MBNA_MASK_DIM;l++)
-{
-fprintf(stderr, "%1d", section->coverage[l + k * MBNA_MASK_DIM]);
-}
-fprintf(stderr, "\n");
-}*/
-				for (k=0;k<section->num_snav;k++)
-				    {
-				    if (status == MB_SUCCESS)
-					result = fgets(buffer,BUFFER_MAX,hfp);
-				    if (status == MB_SUCCESS && result == buffer)
-					nscan = sscanf(buffer,"SNAV %d %d %lf %lf %lf %lf %lf %lf %lf",
-						&idummy,
-						&section->snav_id[k],
-						&section->snav_distance[k],
-						&section->snav_time_d[k],
-						&section->snav_lon[k],
-						&section->snav_lat[k],
-						&section->snav_lon_offset[k],
-						&section->snav_lat_offset[k],
-						&section->snav_z_offset[k]);
-				    section->snav_num_ties[k] = 0;
-				    section->snav_lon_offset_int[k] = 0.0;
-				    section->snav_lat_offset_int[k] = 0.0;
-				    section->snav_z_offset_int[k] = 0.0;
-				    if (result == buffer && nscan == 6)
-				    	{
-				    	section->snav_lon_offset[k] = 0.0;
-				    	section->snav_lat_offset[k] = 0.0;
-				    	section->snav_z_offset[k] = 0.0;
-				    	}
-				    else if (result == buffer && nscan == 8)
-				    	{
-				    	section->snav_z_offset[k] = 0.0;
-				    	}
-				    else if (result != buffer || nscan != 9)
-					{
-					status = MB_FAILURE;
-fprintf(stderr, "read failed on snav: %s\n", buffer);
-					}
-
-				    /* reverse offset values if older values */
-				    if (version_id < 300)
-					{
-				    	section->snav_lon_offset[k] *= -1.0;
-				    	section->snav_lat_offset[k] *= -1.0;
-				    	section->snav_z_offset[k] *= -1.0;
-					}
-				    }
-				    
-				/* global fixed frame tie, whether defined or not */
-				if (version_id >= 305)
-					{
-					if (status == MB_SUCCESS)
-						result = fgets(buffer,BUFFER_MAX,hfp);
-					if (status == MB_SUCCESS && result == buffer)
-						nscan = sscanf(buffer,"GLOBALTIE %d %d %lf %lf %lf %lf %lf %lf",
-							&section->global_tie_status,
-							&section->global_tie_snav,
-							&section->global_tie_offset_x,
-							&section->global_tie_offset_y,
-							&section->global_tie_offset_z_m,
-							&section->global_tie_xsigma,
-							&section->global_tie_ysigma,
-							&section->global_tie_zsigma);
-					mb_coor_scale(mbna_verbose,0.5 * (section->latmin + section->latmax),
-							&mtodeglon,&mtodeglat);
-					section->global_tie_offset_x_m = section->global_tie_offset_x / mtodeglon;
-					section->global_tie_offset_y_m = section->global_tie_offset_y / mtodeglat;
-/* if (section->global_tie_status != MBNA_TIE_NONE)
-fprintf(stderr,"READ GLOBALTIE: %d %d %lf %lf %lf %lf %lf %lf\n",
-section->global_tie_status,
-section->global_tie_snav,
-section->global_tie_offset_x,
-section->global_tie_offset_y,
-section->global_tie_offset_z_m,
-section->global_tie_xsigma,
-section->global_tie_ysigma,
-section->global_tie_zsigma); */
-					}
-				else if (version_id == 304)
-					{
-					if (status == MB_SUCCESS)
-						result = fgets(buffer,BUFFER_MAX,hfp);
-					if (status == MB_SUCCESS && result == buffer)
-						nscan = sscanf(buffer,"GLOBALTIE %d %lf %lf %lf %lf %lf %lf",
-							&section->global_tie_snav,
-							&section->global_tie_offset_x,
-							&section->global_tie_offset_y,
-							&section->global_tie_offset_z_m,
-							&section->global_tie_xsigma,
-							&section->global_tie_ysigma,
-							&section->global_tie_zsigma);
-					mb_coor_scale(mbna_verbose,0.5 * (section->latmin + section->latmax),
-							&mtodeglon,&mtodeglat);
-					section->global_tie_offset_x_m = section->global_tie_offset_x / mtodeglon;
-					section->global_tie_offset_y_m = section->global_tie_offset_y / mtodeglat;
-					if (section->global_tie_snav != MBNA_SELECT_NONE)
-						section->global_tie_status = MBNA_TIE_XYZ;
-					else
-						section->global_tie_status = MBNA_TIE_NONE;
-/* if (section->global_tie_snav != MBNA_SELECT_NONE)
-fprintf(stderr,"READ GLOBALTIE: %d %lf %lf %lf %lf %lf %lf\n",
-section->global_tie_snav,
-section->global_tie_offset_x,
-section->global_tie_offset_y,
-section->global_tie_offset_z_m,
-section->global_tie_xsigma,
-section->global_tie_ysigma,
-section->global_tie_zsigma); */
-					}
-				else
-					{
-					section->global_tie_snav = MBNA_TIE_NONE;
-					section->global_tie_snav = MBNA_SELECT_NONE;
-					section->global_tie_offset_x = 0.0;
-					section->global_tie_offset_y = 0.0;
-					section->global_tie_offset_z_m = 0.0;
-					section->global_tie_xsigma = 0.0;
-					section->global_tie_ysigma = 0.0;
-					section->global_tie_zsigma = 0.0;
-					}
-
-				section->global_start_ping = project.num_pings;
-				section->global_start_snav = project.num_snavs - section->continuity;
-				file->num_snavs += section->num_pings;
-				file->num_pings += section->num_pings;
-				file->num_beams += section->num_beams;
-				project.num_snavs += (section->num_snav - section->continuity);
-				project.num_pings += section->num_pings;
-				project.num_beams += section->num_beams;
-				}
-			}
-
-		/* count the number of blocks */
-		if (version_id < 306)
-			{
-			project.num_blocks = 0;
-			for (i=0;i<project.num_files;i++)
-				{
-				file = &project.files[i];
-				if (i==0 || file->sections[0].continuity == MB_NO)
-					{
-					project.num_blocks++;
-					}
-				file->block = project.num_blocks - 1;
-				file->block_offset_x = 0.0;
-				file->block_offset_y = 0.0;
-				file->block_offset_z = 0.0;
-				}
-			}
-
-		/* read crossings */
- 		project.num_crossings_analyzed = 0;
-		project.num_goodcrossings = 0;
-		project.num_truecrossings = 0;
-		project.num_truecrossings_analyzed = 0;
- 		project.num_ties = 0;
-		for (i=0;i<project.num_crossings;i++)
-			{
-			/* read each crossing */
-			crossing = &project.crossings[i];
-			if (status == MB_SUCCESS
-				&& version_id >= 106)
-				{
-				if (status == MB_SUCCESS
-					&& ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
-						|| (nscan = sscanf(buffer,"CROSSING %d %d %d %d %d %d %d %d %d",
- 						&idummy,
-						&crossing->status,
-						&crossing->truecrossing,
-						&crossing->overlap,
-						&crossing->file_id_1,
-						&crossing->section_1,
-						&crossing->file_id_2,
-						&crossing->section_2,
-						&crossing->num_ties)) != 9))
-						{
-						status = MB_FAILURE;
-fprintf(stderr, "read failed on crossing: %s\n", buffer);
-						}
-				}
-			else if (status == MB_SUCCESS
-				&& version_id >= 102)
-				{
-				crossing->overlap = 0;
-				if (status == MB_SUCCESS
-					&& ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
-						|| (nscan = sscanf(buffer,"CROSSING %d %d %d %d %d %d %d %d",
- 						&idummy,
-						&crossing->status,
-						&crossing->truecrossing,
-						&crossing->file_id_1,
-						&crossing->section_1,
-						&crossing->file_id_2,
-						&crossing->section_2,
-						&crossing->num_ties)) != 8))
-						{
-						status = MB_FAILURE;
-fprintf(stderr, "read failed on crossing: %s\n", buffer);
-						}
-				}
-			else if (status == MB_SUCCESS)
-				{
-				crossing->truecrossing = MB_NO;
-				crossing->overlap = 0;
-				if (status == MB_SUCCESS
-					&& ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
-						|| (nscan = sscanf(buffer,"CROSSING %d %d %d %d %d %d %d",
- 						&idummy,
-						&crossing->status,
-						&crossing->file_id_1,
-						&crossing->section_1,
-						&crossing->file_id_2,
-						&crossing->section_2,
-						&crossing->num_ties)) != 7))
-						{
-						status = MB_FAILURE;
-fprintf(stderr, "read failed on old format crossing: %s\n", buffer);
-						}
-				}
-			if (status == MB_SUCCESS
-			    && crossing->status != MBNA_CROSSING_STATUS_NONE)
-				project.num_crossings_analyzed++;
-			if (status == MB_SUCCESS
-			    && crossing->truecrossing == MB_YES)
-				{
-				project.num_truecrossings++;
-				if (crossing->status != MBNA_CROSSING_STATUS_NONE)
-				project.num_truecrossings_analyzed++;
-				}
-
-			/* reorder crossing to be early file first older file second if
-				file version prior to 3.00 */
-			if (version_id < 300)
-				{
-				idummy = crossing->file_id_1;
-				jdummy = crossing->section_1;
-				crossing->file_id_1 = crossing->file_id_2;
-				crossing->section_1 = crossing->section_2;
-				crossing->file_id_2 = idummy;
-				crossing->section_2 = jdummy;
-				}
-
-			/* read ties */
-			if (status == MB_SUCCESS)
-			for (j=0;j<crossing->num_ties;j++)
-				{
-				/* read each tie */
-				tie = &crossing->ties[j];
-				if (status == MB_SUCCESS && version_id >= 302)
-					{
-					if ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
-						|| (nscan = sscanf(buffer,"TIE %d %d %d %lf %d %lf %lf %lf %lf %d %lf %lf %lf",
-							&idummy,
-							&tie->status,
-							&tie->snav_1,
-							&tie->snav_1_time_d,
-							&tie->snav_2,
-							&tie->snav_2_time_d,
-							&tie->offset_x,
-							&tie->offset_y,
-							&tie->offset_z_m,
-							&tie->inversion_status,
-							&tie->inversion_offset_x,
-							&tie->inversion_offset_y,
-							&tie->inversion_offset_z_m)) != 13)
-						{
-						status = MB_FAILURE;
-fprintf(stderr, "read failed on tie: %s\n", buffer);
-						}
-					}
-				else if (status == MB_SUCCESS && version_id >= 104)
-					{
-					if ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
-						|| (nscan = sscanf(buffer,"TIE %d %d %lf %d %lf %lf %lf %lf %d %lf %lf %lf",
-							&idummy,
-							&tie->snav_1,
-							&tie->snav_1_time_d,
-							&tie->snav_2,
-							&tie->snav_2_time_d,
-							&tie->offset_x,
-							&tie->offset_y,
-							&tie->offset_z_m,
-							&tie->inversion_status,
-							&tie->inversion_offset_x,
-							&tie->inversion_offset_y,
-							&tie->inversion_offset_z_m)) != 12)
-						{
-						status = MB_FAILURE;
-fprintf(stderr, "read failed on tie: %s\n", buffer);
-						}
-					tie->status = MBNA_TIE_XYZ;
-					}
-				else if (status == MB_SUCCESS)
-					{
-					if ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
-						|| (nscan = sscanf(buffer,"TIE %d %d %lf %d %lf %lf %lf %d %lf %lf",
-							&idummy,
-							&tie->snav_1,
-							&tie->snav_1_time_d,
-							&tie->snav_2,
-							&tie->snav_2_time_d,
-							&tie->offset_x,
-							&tie->offset_y,
-							&tie->inversion_status,
-							&tie->inversion_offset_x,
-							&tie->inversion_offset_y)) != 10)
-						{
-						status = MB_FAILURE;
-fprintf(stderr, "read failed on tie: %s\n", buffer);
-						}
-					tie->status = MBNA_TIE_XYZ;
-					tie->offset_z_m = 0.0;
-					tie->inversion_offset_z_m = 0.0;
-					}
-
-				/* reorder crossing to be early file first older file second if
-					file version prior to 3.00 */
-				if (version_id < 300)
-					{
-					idummy = tie->snav_1;
-					dummy = tie->snav_1_time_d;
-					tie->snav_1 = tie->snav_2;
-					tie->snav_1_time_d = tie->snav_2_time_d;
-					tie->snav_2 = idummy;
-					tie->snav_2_time_d = dummy;
-/*					tie->offset_x *= -1.0;
-					tie->offset_y *= -1.0;
-					tie->offset_z_m *= -1.0;
-					tie->inversion_offset_x *= -1.0;
-					tie->inversion_offset_y *= -1.0;
-					tie->inversion_offset_z_m *= -1.0;*/
-					}
-
-				/* for version 2.0 or later read covariance */
-				if (status == MB_SUCCESS && version_id >= 200)
-					{
-					if ((result = fgets(buffer,BUFFER_MAX,hfp)) != buffer
-						|| (nscan = sscanf(buffer,"COV %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf",
-							&tie->sigmar1,
-							&(tie->sigmax1[0]),
-							&(tie->sigmax1[1]),
-							&(tie->sigmax1[2]),
-							&tie->sigmar2,
-							&(tie->sigmax2[0]),
-							&(tie->sigmax2[1]),
-							&(tie->sigmax2[2]),
-							&tie->sigmar3,
-							&(tie->sigmax3[0]),
-							&(tie->sigmax3[1]),
-							&(tie->sigmax3[2]))) != 12)
-						{
-						status = MB_FAILURE;
-fprintf(stderr, "read failed on tie covariance: %s\n", buffer);
-						}
-					if (tie->sigmar1 <= 0.0)
-						{
-						tie->sigmax1[0] = 1.0;
-						tie->sigmax1[1] = 0.0;
-						tie->sigmax1[2] = 0.0;
-						mbna_minmisfit_sr1 = 1.0;
-						}
-					if (tie->sigmar2 <= 0.0)
-						{
-						tie->sigmax2[0] = 0.0;
-						tie->sigmax2[1] = 1.0;
-						tie->sigmax2[2] = 0.0;
-						mbna_minmisfit_sr2 = 1.0;
-						}
-					if (tie->sigmar3 <= 0.0)
-						{
-						tie->sigmax3[0] = 0.0;
-						tie->sigmax3[1] = 0.0;
-						tie->sigmax3[2] = 1.0;
-						mbna_minmisfit_sr3 = 1.0;
-						}
-					}
-				else if (status == MB_SUCCESS)
-					{
-					tie->sigmar1 = 100.0;
-					tie->sigmax1[0] = 1.0;
-					tie->sigmax1[1] = 0.0;
-					tie->sigmax1[2] = 0.0;
-					tie->sigmar2 = 100.0;
-					tie->sigmax2[0] = 0.0;
-					tie->sigmax2[1] = 1.0;
-					tie->sigmax2[2] = 0.0;
-					tie->sigmar3 = 100.0;
-					tie->sigmax3[0] = 0.0;
-					tie->sigmax3[1] = 0.0;
-					tie->sigmax3[2] = 1.0;
-					}
-
-				/* update number of ties */
-				if (status == MB_SUCCESS)
-				    {
-				    project.num_ties++;
-				    }
-
-				/* check for reasonable snav id's */
-				if (status == MB_SUCCESS)
-				    {
-				    file = &project.files[crossing->file_id_1];
-				    section = &file->sections[crossing->section_1];
-				    if (tie->snav_1 >= section->num_snav)
-					{
-					tie->snav_1 = ((double)tie->snav_1
-								/ (double)section->num_pings)
-								* (MBNA_SNAV_NUM - 1);
-					tie->snav_1_time_d = section->snav_time_d[tie->snav_1];
-fprintf(stderr,"Reset tie snav_1 on read:%d\n",tie->snav_1);
-					}
-				    file = &project.files[crossing->file_id_2];
-				    section = &file->sections[crossing->section_2];
-				    if (tie->snav_2 >= section->num_snav)
-					{
-					tie->snav_2 = ((double)tie->snav_2
-								/ (double)section->num_pings)
-								* (MBNA_SNAV_NUM - 1);
-					tie->snav_2_time_d = section->snav_time_d[tie->snav_2];
-fprintf(stderr,"Reset tie snav_2 on read:%d\n",tie->snav_2);
-					}
-				    }
-
-				/* update number of ties for snavs */
-				if (status == MB_SUCCESS)
-				    {
-				    file = &project.files[crossing->file_id_1];
-				    section = &file->sections[crossing->section_1];
-				    section->snav_num_ties[tie->snav_1]++;
-				    file = &project.files[crossing->file_id_2];
-				    section = &file->sections[crossing->section_2];
-				    section->snav_num_ties[tie->snav_2]++;
-				    }
-
-				/* calculate offsets in local meters */
-				if (status == MB_SUCCESS)
-				    {
-				    section1 = &(project.files[crossing->file_id_1].sections[crossing->section_1]);
-				    section2 = &(project.files[crossing->file_id_2].sections[crossing->section_2]);
-				    mbna_lon_min = MIN(section1->lonmin,section2->lonmin);
-				    mbna_lon_max = MAX(section1->lonmax,section2->lonmax);
-				    mbna_lat_min = MIN(section1->latmin,section2->latmin);
-				    mbna_lat_max = MAX(section1->latmax,section2->latmax);
-				    mb_coor_scale(mbna_verbose,0.5 * (mbna_lat_min + mbna_lat_max),
-						    &mbna_mtodeglon,&mbna_mtodeglat);
-				    tie->offset_x_m = tie->offset_x / mbna_mtodeglon;
-				    tie->offset_y_m = tie->offset_y / mbna_mtodeglat;
-				    tie->inversion_offset_x_m = tie->inversion_offset_x / mbna_mtodeglon;
-				    tie->inversion_offset_y_m = tie->inversion_offset_y / mbna_mtodeglat;
-				    }
-
-				}
-
-			/* finally make sure crossing has later section second, switch if needed */
-			s1id = crossing->file_id_1 * 1000 + crossing->section_1;
-			s2id = crossing->file_id_2 * 1000 + crossing->section_2;
-			if (s2id < s1id)
-				{
-				idummy = crossing->file_id_1;
-				jdummy = crossing->section_1;
-				crossing->file_id_1 = crossing->file_id_2;
-				crossing->section_1 = crossing->section_2;
-				crossing->file_id_2 = idummy;
-				crossing->section_2 = jdummy;
-				for (j=0;j<crossing->num_ties;j++)
-					{
-					tie = &crossing->ties[j];
-					idummy = tie->snav_1;
-					dummy = tie->snav_1_time_d;
-					tie->snav_1 = tie->snav_2;
-					tie->snav_1_time_d = tie->snav_2_time_d;
-					tie->snav_2 = idummy;
-					tie->snav_2_time_d = dummy;
-					tie->offset_x *= -1.0;
-					tie->offset_y *= -1.0;
-					tie->offset_x_m *= -1.0;
-					tie->offset_y_m *= -1.0;
-					tie->offset_z_m *= -1.0;
-					tie->inversion_offset_x *= -1.0;
-					tie->inversion_offset_y *= -1.0;
-					tie->inversion_offset_x_m *= -1.0;
-					tie->inversion_offset_y_m *= -1.0;
-					tie->inversion_offset_z_m *= -1.0;
-					}
-				}
-			}
-
-		/* close home file */
-		fclose(hfp);
-
-		/* set project status flag */
-		if (status == MB_SUCCESS)
-			project.open = MB_YES;
-		else
-			{
-			for (i=0;i<project.num_files;i++)
-				{
-				file = &project.files[i];
-				if (file->sections != NULL)
-					 free( file->sections);
-				}
-			if (project.files != NULL)
-				free(project.files);
-			if (project.crossings != NULL)
-				free(project.crossings);
-			project.open = MB_NO;
-			memset(project.name,0,STRING_MAX);
-			strcpy(project.name,"None");
- 			memset(project.path,0,STRING_MAX);
-			memset(project.datadir,0,STRING_MAX);
-			project.num_files = 0;
-			project.num_files_alloc = 0;
-			project.num_snavs = 0;
-			project.num_pings = 0;
-			project.num_beams = 0;
-			project.num_crossings = 0;
-			project.num_crossings_alloc = 0;
- 			project.num_crossings_analyzed = 0;
-			project.num_goodcrossings = 0;
-			project.num_truecrossings = 0;
-			project.num_truecrossings_analyzed = 0;
-			project.num_ties = 0;
- 			}
-
-		/* recalculate crossing overlap values if not already set */
-		if (project.open == MB_YES)
-			{
-			for (i=0;i<project.num_crossings;i++)
-				{
-				crossing = &(project.crossings[i]);
-				if (crossing->overlap <= 0)
-					{
-					mbnavadjust_crossing_overlap(i);
-					}
-				if (crossing->overlap >= 25)
-					project.num_goodcrossings++;
-				}
-			}
-
-		/* reset crossings to unanalyzed if flag is set */
-		if (mbna_reset_crossings == MB_YES)
-			{
-			for (i=0;i<project.num_crossings;i++)
-				{
-				/* read each crossing */
-				crossing = &project.crossings[i];
-
-				/* reset status */
-				crossing->status = MBNA_CROSSING_STATUS_NONE;
-				crossing->num_ties = 0;
-				project.num_crossings_analyzed = 0;
-				project.num_truecrossings_analyzed = 0;
-				project.num_ties = 0;
-				project.inversion = MBNA_INVERSION_NONE;
-				}
-			for (i=0;i<project.num_files;i++)
-				{
-				file = &project.files[i];
-				for (j=0;j<file->num_sections;j++)
-					{
-					section = &file->sections[j];
-					for (k=0;k<section->num_snav;k++)
-						{
-						section->snav_lon_offset[section->num_snav] = 0.0;
-						section->snav_lat_offset[section->num_snav] = 0.0;
-						section->snav_z_offset[section->num_snav] = 0.0;
-						section->snav_lon_offset_int[section->num_snav] = 0.0;
-						section->snav_lat_offset_int[section->num_snav] = 0.0;
-						section->snav_z_offset_int[section->num_snav] = 0.0;
-						}
-					}
-				}
-			}
-
-		/* interpolate inversion solution if it exists */
-		if (project.inversion != MBNA_INVERSION_NONE)
-			mbnavadjust_interpolatesolution();
-		}
-
-	/* else set error */
-	else
-		{
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbnavadjust_import_data(char *path, int iformat)
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_import_data";
-	int	status = MB_SUCCESS;
-	struct mbna_file *file;
-	int	done;
-	char	filename[STRING_MAX];
-	double	weight;
-	int	form;
-	int	firstfile;
-	int	i;
-
- 	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2               path:     %s\n",path);
-		fprintf(stderr,"dbg2               format:   %d\n",iformat);
-		}
-
-	/* loop until all files read */
-	done = MB_NO;
-	firstfile = MB_YES;
-	while (done == MB_NO)
-		{
-		if (iformat > 0)
-			{
-			status = mbnavadjust_import_file(path,iformat,firstfile);
-			done = MB_YES;
-			firstfile = MB_NO;
-			}
-		else if (iformat == -1)
-			{
-			if ((status = mb_datalist_open(mbna_verbose,&datalist,
-							path,MB_DATALIST_LOOK_NO,&error)) == MB_SUCCESS)
-				{
-				while (done == MB_NO)
-					{
-					if ((status = mb_datalist_read(mbna_verbose,datalist,
-							filename,&form,&weight,&error))
-							== MB_SUCCESS)
-						{
-						status = mbnavadjust_import_file(filename,form,firstfile);
-						firstfile = MB_NO;
-						}
-					else
-						{
-						mb_datalist_close(mbna_verbose,&datalist,&error);
-						done = MB_YES;
-						}
-					}
-				}
-			}
-		}
-
-	/* look for new crossings */
-	status = mbnavadjust_findcrossings();
-
-	/* count the number of blocks */
-	project.num_blocks = 0;
-	for (i=0;i<project.num_files;i++)
-	    {
-	    file = &project.files[i];
-	    if (i==0 || file->sections[0].continuity == MB_NO)
-		{
-		project.num_blocks++;
-		}
-	    file->block = project.num_blocks - 1;
-	    file->block_offset_x = 0.0;
-	    file->block_offset_y = 0.0;
-	    file->block_offset_z = 0.0;
-	    }
-
-	/* write updated project */
-	mbnavadjust_write_project();
-
- 	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbnavadjust_import_file(char *path, int iformat, int firstfile)
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_import_file";
-	int	status = MB_SUCCESS;
-	struct stat file_status;
-	int	fstat;
-	char	ipath[STRING_MAX];
-	char	mb_suffix[STRING_MAX];
-	char	npath[STRING_MAX];
-	char	opath[STRING_MAX];
-	char	*root;
-
-	/* mbio read and write values */
-	void	*imbio_ptr = NULL;
-	void	*ombio_ptr = NULL;
-	void	*istore_ptr = NULL;
-	void	*ostore_ptr = NULL;
-	int	kind;
-	int	time_i[7];
-	double	time_d;
-	double	navlon;
-	double	navlat;
-	double	speed;
-	double	heading;
-	double	distance;
-	double	altitude;
-	double	sonardepth;
-	double	draft;
-	double	roll;
-	double	pitch;
-	double	heave;
-	int	beams_bath;
-	int	beams_amp;
-	int	pixels_ss;
-	char	*beamflag = NULL;
-	double	*bath = NULL;
-	double	*bathacrosstrack = NULL;
-	double	*bathalongtrack = NULL;
-	double	*amp = NULL;
-	double	*ss = NULL;
-	double	*ssacrosstrack = NULL;
-	double	*ssalongtrack = NULL;
-	char	comment[MB_COMMENT_MAXLINE];
-
-	int	sonartype = MB_TOPOGRAPHY_TYPE_UNKNOWN;
-	int	*bin_nbath = NULL;
-	double	*bin_bath = NULL;
-	double	*bin_bathacrosstrack = NULL;
-	double	*bin_bathalongtrack = NULL;
-	int	side;
-	double	port_time_d, stbd_time_d;
-	double	angle, dt, alongtrackdistance, xtrackavg, xtrackmax;
-	int	nxtrack;
-
-	int	output_id, found;
-	int	obeams_bath,obeams_amp,opixels_ss;
-	int	iform;
-	int	nread, first;
-	int	output_open = MB_NO;
-	int	good_beams;
-	int	new_segment;
-	double	headingx, headingy, mtodeglon, mtodeglat;
-	double	lon, lat;
-	double	navlon_old, navlat_old;
-	FILE	*nfp;
-	struct mbna_file *file, *cfile;
-	struct mbna_section *section, *csection;
-	struct mbsys_ldeoih_struct *ostore;
-	struct mb_io_struct *omb_io_ptr;
-	int	new_pings, new_crossings;
-	double	dx1, dy1;
-	int	mbp_heading_mode;
-	double	mbp_headingbias;
-	int	mbp_rollbias_mode;
-	double	mbp_rollbias;
-	double	mbp_rollbias_port;
-	double	mbp_rollbias_stbd;
-	double	depthmax, distmax, depthscale, distscale;
- 	int	i, j, k;
-	int	ii1, jj1;
-
- 	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2               path:     %s\n",path);
-		fprintf(stderr,"dbg2               format:   %d\n",iformat);
-		}
-
-	/* get potential processed file name */
-	if ((status = mb_get_format(mbna_verbose, path, ipath,
-				    &iform, &error))
-				    == MB_SUCCESS
-	    && iform == iformat)
-	    {
-	    strcat(ipath,"p");
-	    sprintf(mb_suffix, ".mb%d", iformat);
-	    strcat(ipath,mb_suffix);
-	    }
-
-	/* else just add p.mbXXX to file name */
-	else
-		{
-		strcat(ipath,"p");
-		sprintf(mb_suffix, ".mb%d", iformat);
-		strcat(ipath,mb_suffix);
-		status = MB_SUCCESS;
-		error = MB_ERROR_NO_ERROR;
-		}
-
-	/* look for processed file and use if available */
-	fstat = stat(ipath, &file_status);
-	if (fstat != 0
-	    || (file_status.st_mode & S_IFMT) == S_IFDIR)
-	    {
-	    strcpy(ipath, path);
-	    }
-
-	/* now look for existing mbnavadjust output files
-	 * - increment output id so this mbnavadjust project outputs
-	 *   a unique nav file for this input file */
-	output_id = 0;
-	found = MB_NO;
-	while (found == MB_NO)
-	    {
-	    sprintf(opath, "%s.na%d", path, output_id);
-	    fstat = stat(opath, &file_status);
-	    if (fstat != 0)
-		{
-		found = MB_YES;
-		}
-	    else
-		{
-		output_id++;
-		}
-	    }
-
-	/* turn on message */
-	root = (char *) strrchr(ipath, '/');
-	if (root == NULL)
-		root = ipath;
-	sprintf(message,"Importing format %d data from %s",iformat,root);
-	do_message_on(message);
-	fprintf(stderr,"%s\n",message);
-	output_open = MB_NO;
-	project.inversion = MBNA_INVERSION_NONE;
-	new_pings = 0;
-	new_crossings = 0;
-	good_beams = 0;
-
-	/* allocate mbna_file array if needed */
-	if (project.num_files_alloc <= project.num_files)
-		{
-		project.files = (struct mbna_file *) realloc(project.files,
-			sizeof(struct mbna_file) * (project.num_files_alloc + ALLOC_NUM));
-		if (project.files != NULL)
-			project.num_files_alloc += ALLOC_NUM;
-		else
-			{
-			status = MB_FAILURE;
-			error = MB_ERROR_MEMORY_FAIL;
-			}
-		}
-
-	if (status == MB_SUCCESS)
-		{
-		/* initialize reading the swath file */
-		if ((status = mb_read_init(
-			mbna_verbose,ipath,iformat,pings,lonflip,bounds,
-			btime_i,etime_i,speedmin,timegap,
-			&imbio_ptr,&btime_d,&etime_d,
-			&beams_bath,&beams_amp,&pixels_ss,&error)) != MB_SUCCESS)
-			{
-			mb_error(mbna_verbose,error,&error_message);
-			fprintf(stderr,"\nMBIO Error returned from function <mb_read_init>:\n%s\n",error_message);
-			fprintf(stderr,"\nSwath sonar File <%s> not initialized for reading\n",path);
-			}
-		}
-
-	/* allocate memory for data arrays */
-	if (status == MB_SUCCESS)
-		{
-		beamflag = NULL;
-		bath = NULL;
-		amp = NULL;
-		bathacrosstrack = NULL;
-		bathalongtrack = NULL;
-		ss = NULL;
-		ssacrosstrack = NULL;
-		ssalongtrack = NULL;
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(mbna_verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							sizeof(char), (void **)&beamflag, &error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(mbna_verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							sizeof(double), (void **)&bath, &error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(mbna_verbose, imbio_ptr, MB_MEM_TYPE_AMPLITUDE,
-							sizeof(double), (void **)&amp, &error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(mbna_verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							sizeof(double), (void **)&bathacrosstrack, &error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(mbna_verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							sizeof(double), (void **)&bathalongtrack, &error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(mbna_verbose, imbio_ptr, MB_MEM_TYPE_SIDESCAN,
-							sizeof(double), (void **)&ss, &error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(mbna_verbose, imbio_ptr, MB_MEM_TYPE_SIDESCAN,
-							sizeof(double), (void **)&ssacrosstrack, &error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(mbna_verbose, imbio_ptr, MB_MEM_TYPE_SIDESCAN,
-							sizeof(double), (void **)&ssalongtrack, &error);
-
-		/* if error initializing memory then don't read the file */
-		if (error != MB_ERROR_NO_ERROR)
-			{
-			mb_error(mbna_verbose,error,&error_message);
-			fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",
-				error_message);
-			}
- 		}
-
-	/* open nav file */
-	if (status == MB_SUCCESS)
-		{
-		sprintf(npath,"%s/nvs_%4.4d.mb166", project.datadir,project.num_files);
-		if ((nfp = fopen(npath,"w")) == NULL)
-			{
-			status = MB_FAILURE;
-			error = MB_ERROR_OPEN_FAIL;
-			}
-		}
-
-	/* read data */
-	if (status == MB_SUCCESS)
-		{
-		nread = 0;
-		new_segment = MB_NO;
-		first = MB_YES;
-		while (error <= MB_ERROR_NO_ERROR)
-			{
-			/* read a ping of data */
-			status = mb_get_all(mbna_verbose,imbio_ptr,&istore_ptr,&kind,
-				time_i,&time_d,&navlon,&navlat,&speed,
-				&heading,&distance,&altitude,&sonardepth,
-				&beams_bath,&beams_amp,&pixels_ss,
-				beamflag,bath,amp,bathacrosstrack,bathalongtrack,
-				ss,ssacrosstrack,ssalongtrack,
-				comment,&error);
-
-			/* extract all nav values */
-			if (error == MB_ERROR_NO_ERROR
-			    && (kind == MB_DATA_NAV
-				|| kind == MB_DATA_DATA))
-				{
-				status = mb_extract_nav(mbna_verbose,imbio_ptr,
-					istore_ptr,&kind,
-					time_i,&time_d,&navlon,&navlat,&speed,
-					&heading,&draft,&roll,&pitch,&heave,
-					&error);
-				}
-
-			/* ignore minor errors */
-			if (kind == MB_DATA_DATA
-				&& (error == MB_ERROR_TIME_GAP
-					|| error == MB_ERROR_OUT_BOUNDS
-					|| error == MB_ERROR_OUT_TIME
-					|| error == MB_ERROR_SPEED_TOO_SMALL))
-				{
-				status = MB_SUCCESS;
-				error = MB_ERROR_NO_ERROR;
-				}
-
-			/* if sonar is interferometric, bin the bathymetry */
-			if (kind == MB_DATA_DATA)
-				{
-				if (sonartype == MB_TOPOGRAPHY_TYPE_UNKNOWN)
-					status = mb_sonartype(mbna_verbose, imbio_ptr, istore_ptr, &sonartype, &error);
-
-				if (sonartype == MB_TOPOGRAPHY_TYPE_INTERFEROMETRIC)
-					{
-					/* allocate bin arrays if needed */
-					if (bin_nbath == NULL)
-						{
-						status = mb_mallocd(mbna_verbose, __FILE__, __LINE__,
-								    mbna_bin_beams_bath*sizeof(int),
-									(void **)&bin_nbath,&error);
-						status = mb_mallocd(mbna_verbose, __FILE__, __LINE__,
-								    mbna_bin_beams_bath*sizeof(double),
-									(void **)&bin_bath,&error);
-						status = mb_mallocd(mbna_verbose, __FILE__, __LINE__,
-								    mbna_bin_beams_bath*sizeof(double),
-									(void **)&bin_bathacrosstrack,&error);
-						status = mb_mallocd(mbna_verbose, __FILE__, __LINE__,
-								    mbna_bin_beams_bath*sizeof(double),
-									(void **)&bin_bathalongtrack,&error);
-						for (i=0;i<mbna_bin_beams_bath;i++)
-							{
-							bin_nbath[i] = 0;
-							bin_bath[i] = 0.0;
-							bin_bathacrosstrack[i] = 0.0;
-							bin_bathalongtrack[i] = 0.0;
-							}
-						}
-
-					/* figure out if this is a ping to one side or across the while swath */
-					xtrackavg = 0.0;
-					xtrackmax = 0.0;
-					nxtrack = 0;
-					for (i=0;i<beams_bath;i++)
-						{
-						if (mb_beam_ok(beamflag[i]))
-							{
-							xtrackavg += bathacrosstrack[i];
-							xtrackmax = MAX(xtrackmax, fabs(bathacrosstrack[i]));
-							nxtrack++;
-							}
-						}
-					if (nxtrack > 0)
-						{
-						xtrackavg /= nxtrack;
-						}
-					if (xtrackavg > 0.25 * xtrackmax)
-						{
-						side = SIDE_STBD;
-						port_time_d = time_d;
-						}
-					else if (xtrackavg < -0.25 * xtrackmax)
-						{
-						side = SIDE_PORT;
-						stbd_time_d = time_d;
-						}
-					else
-						{
-						side = SIDE_FULLSWATH;
-						stbd_time_d = time_d;
-						}
-
-					/* if side = PORT or FULLSWATH then initialize bin arrays */
-					if (side == SIDE_PORT || side == SIDE_FULLSWATH)
-						{
-						for (i=0;i<mbna_bin_beams_bath;i++)
-							{
-							bin_nbath[i] = 0;
-							bin_bath[i] = 0.0;
-							bin_bathacrosstrack[i] = 0.0;
-							bin_bathalongtrack[i] = 0.0;
-							}
-						}
-
-					/* bin the bathymetry */
-					for (i=0;i<beams_bath;i++)
-						{
-						if (mb_beam_ok(beamflag[i]))
-							{
-							/* get apparent acrosstrack beam angle and bin accordingly */
-							angle = RTD * atan(bathacrosstrack[i] / (bath[i] - sonardepth));
-							j = (int)floor((angle + 0.5 * mbna_bin_swathwidth
-									+ 0.5 * mbna_bin_pseudobeamwidth)
-								       / mbna_bin_pseudobeamwidth);
-/* fprintf(stderr,"i:%d bath:%f %f %f sonardepth:%f angle:%f j:%d\n",
-i,bath[i],bathacrosstrack[i],bathalongtrack[i],sonardepth,angle,j); */
-							if (j >= 0 && j < mbna_bin_beams_bath)
-								{
-								bin_bath[j] += bath[i];
-								bin_bathacrosstrack[j] += bathacrosstrack[i];
-								bin_bathalongtrack[j] += bathalongtrack[i];
-								bin_nbath[j]++;
-								}
-							}
-						}
-
-					/* if side = STBD or FULLSWATH calculate output bathymetry
-						- add alongtrack offset to port data from previous ping */
-					if (side == SIDE_STBD || side == SIDE_FULLSWATH)
-						{
-						dt = port_time_d - stbd_time_d;
-						if (dt > 0.0 && dt < 0.5)
-							alongtrackdistance = -(port_time_d - stbd_time_d) * speed / 3.6;
-						else
-							alongtrackdistance = 0.0;
-						beams_bath = mbna_bin_beams_bath;
-						for (j=0;j<mbna_bin_beams_bath;j++)
-							{
-/* fprintf(stderr,"j:%d angle:%f n:%d bath:%f %f %f\n",
-j,j*mbna_bin_pseudobeamwidth - 0.5 * mbna_bin_swathwidth,bin_nbath[j],bin_bath[j],bin_bathacrosstrack[j],bin_bathalongtrack[j]); */
-							if (bin_nbath[j] > 0)
-								{
-								bath[j] = bin_bath[j] / bin_nbath[j];
-								bathacrosstrack[j] = bin_bathacrosstrack[j] / bin_nbath[j];
-								bathalongtrack[j] = bin_bathalongtrack[j] / bin_nbath[j];
-								beamflag[j] = MB_FLAG_NONE;
-								if (bin_bathacrosstrack[j] < 0.0)
-									bathalongtrack[j] += alongtrackdistance;
-								}
-							else
-								{
-								beamflag[j] = MB_FLAG_NULL;
-								bath[j] = 0.0;
-								bathacrosstrack[j] = 0.0;
-								bathalongtrack[j] = 0.0;
-								}
-							}
-						}
-
-					/* if side = PORT set nonfatal error so that bathymetry isn't output until
-						the STBD data are read too */
-					else if (side == SIDE_PORT)
-						{
-						error = MB_ERROR_IGNORE;
-						}
-					}
-				}
-
-			/* deal with new file */
-			if (kind == MB_DATA_DATA
-				&& error == MB_ERROR_NO_ERROR
-				&& first == MB_YES)
-				{
-				file = &project.files[project.num_files];
-				file->status = MBNA_FILE_GOODNAV;
-				file->id = project.num_files;
-				file->output_id = output_id;
-				strcpy(file->path,path);
-				strcpy(file->file,path);
-				mb_get_relative_path(mbna_verbose,
-							file->file,
-							project.path,
-							&error);
-				file->format = iformat;
-				file->heading_bias = 0.0;
-				file->roll_bias = 0.0;
-				file->num_snavs = 0;
-				file->num_pings = 0;
-				file->num_beams = 0;
-				file->num_sections = 0;
-				file->num_sections_alloc = 0;
-				file->sections = NULL;
-				project.num_files++;
-				new_segment = MB_YES;
-				first = MB_NO;
-
-				/* get bias values */
-				mb_pr_get_heading(mbna_verbose, file->path,
-						    &mbp_heading_mode,
-						    &mbp_headingbias,
-						    &error);
-				mb_pr_get_rollbias(mbna_verbose, file->path,
-						    &mbp_rollbias_mode,
-						    &mbp_rollbias,
-						    &mbp_rollbias_port,
-						    &mbp_rollbias_stbd,
-						    &error);
-				if (mbp_heading_mode == MBP_HEADING_OFFSET
-				    || mbp_heading_mode == MBP_HEADING_CALCOFFSET)
-				    {
-				    file->heading_bias_import = mbp_headingbias;
-				    }
-				else
-				    {
-				    file->heading_bias_import = 0.0;
-				    }
-				if (mbp_rollbias_mode == MBP_ROLLBIAS_SINGLE)
-				    {
-				    file->roll_bias_import = mbp_rollbias;
-				    }
-				else if (mbp_rollbias_mode == MBP_ROLLBIAS_DOUBLE)
-				    {
-				    file->roll_bias_import = 0.5 * (mbp_rollbias_port
-								    + mbp_rollbias_stbd);
-				    }
-				else
-				    {
-				    file->roll_bias_import = 0.0;
-				    }
-				}
-
-			/* check if new segment needed */
-			else if (kind == MB_DATA_DATA
-				&& error == MB_ERROR_NO_ERROR
-				&& (section->distance + distance
-					>= project.section_length
-					|| section->num_beams >= project.section_soundings))
-				{
-				new_segment = MB_YES;
-/*fprintf(stderr, "NEW SEGMENT: section->distance:%f distance:%f project.section_length:%f\n",
-section->distance, distance, project.section_length);*/
-				}
-
-			/* if end of segment or end of file resolve position
-			    of last snav point in last segment */
-			if ((error > MB_ERROR_NO_ERROR || new_segment == MB_YES)
-				&& project.num_files > 0
-				&& (file->num_sections > 0 && section->num_pings > 0))
-				{
-				/* resolve position of last snav point in last segment */
-				if (section->num_snav == 1
-				    || (section->distance >=
-					(section->num_snav - 0.5)
-					    * project.section_length / (MBNA_SNAV_NUM - 1)))
-					{
-					section->snav_id[section->num_snav]
-						= section->num_pings - 1;
-					section->snav_num_ties[section->num_snav]
-						= 0;
-					section->snav_distance[section->num_snav]
-						= section->distance;
-					section->snav_time_d[section->num_snav]
-						= section->etime_d;
-					section->snav_lon[section->num_snav]
-						= navlon_old;
-					section->snav_lat[section->num_snav]
-						= navlat_old;
-					section->snav_lon_offset[section->num_snav]
-						= 0.0;
-					section->snav_lat_offset[section->num_snav]
-						= 0.0;
-					section->snav_z_offset[section->num_snav]
-						= 0.0;
-					section->snav_lon_offset_int[section->num_snav]
-						= 0.0;
-					section->snav_lat_offset_int[section->num_snav]
-						= 0.0;
-					section->snav_z_offset_int[section->num_snav]
-						= 0.0;
-					section->num_snav++;
-					file->num_snavs++;
-					project.num_snavs++;
-					}
-				else if (section->num_snav > 1)
-					{
-					section->snav_id[section->num_snav-1]
-						= section->num_pings - 1;
-					section->snav_num_ties[section->num_snav]
-						= 0;
-					section->snav_distance[section->num_snav-1]
-						= section->distance;
-					section->snav_time_d[section->num_snav-1]
-						= section->etime_d;
-					section->snav_lon[section->num_snav-1]
-						= navlon_old;
-					section->snav_lat[section->num_snav-1]
-						= navlat_old;
-					section->snav_lon_offset[section->num_snav-1]
-						= 0.0;
-					section->snav_lat_offset[section->num_snav-1]
-						= 0.0;
-					section->snav_z_offset[section->num_snav-1]
-						= 0.0;
-					section->snav_lon_offset_int[section->num_snav-1]
-						= 0.0;
-					section->snav_lat_offset_int[section->num_snav-1]
-						= 0.0;
-					section->snav_z_offset_int[section->num_snav-1]
-						= 0.0;
-					}
-				}
-
-			/* deal with new segment */
-			if (kind == MB_DATA_DATA
-				&& error == MB_ERROR_NO_ERROR
-				&& new_segment == MB_YES)
-				{
-				/* end old segment */
-				if (output_open == MB_YES)
-					{
-					/* close the swath file */
-					status = mb_close(mbna_verbose,&ombio_ptr,&error);
-					output_open = MB_NO;
-					}
-
-				/* allocate mbna_section array if needed */
-				if (file->num_sections_alloc <= file->num_sections)
-					{
-					file->sections = (struct mbna_section *) realloc(file->sections,
-						sizeof(struct mbna_section) * (file->num_sections_alloc + ALLOC_NUM));
-					if (file->sections != NULL)
-						file->num_sections_alloc += ALLOC_NUM;
-					else
-						{
-						status = MB_FAILURE;
-						error = MB_ERROR_MEMORY_FAIL;
-						}
-					}
-
-				/* initialize new section */
-				file->num_sections++;
-				section = &file->sections[file->num_sections-1];
-				section->num_pings = 0;
-				section->num_beams = 0;
-				section->continuity = MB_NO;
-				section->global_start_ping = project.num_pings;
-				section->global_start_snav = project.num_snavs;
-				for (i=0;i<MBNA_MASK_DIM*MBNA_MASK_DIM;i++)
-				    section->coverage[i] = 0;
-				section->num_snav = 0;
-				if (file->num_sections > 1)
-					{
-					csection = &file->sections[file->num_sections-2];
-					if (fabs(time_d - csection->etime_d) < MBNA_TIME_GAP_MAX)
-						{
-						section->continuity = MB_YES;
-						section->global_start_snav--;
-						file->num_snavs--;
-						project.num_snavs--;
-						}
-					}
-				else if (project.num_files > 1 && firstfile == MB_NO)
-					{
-					cfile = &project.files[project.num_files-2];
-					csection = &cfile->sections[cfile->num_sections-1];
-					if (fabs(time_d - csection->etime_d) < MBNA_TIME_GAP_MAX)
-						{
-						section->continuity = MB_YES;
-						section->global_start_snav--;
-						file->num_snavs--;
-						project.num_snavs--;
-						}
-					}
-				section->distance = 0.0;
-				section->btime_d = time_d;
-				section->etime_d = time_d;
-				section->lonmin = navlon;
-				section->lonmax = navlon;
-				section->latmin = navlat;
-				section->latmax = navlat;
-				section->depthmin = 0.0;
-				section->depthmax = 0.0;
-				section->contoursuptodate = MB_NO;
-				section->global_tie_status = MBNA_TIE_NONE;
-				section->global_tie_snav = MBNA_SELECT_NONE;
-				section->global_tie_offset_x = 0.0;
-				section->global_tie_offset_y = 0.0;
-				section->global_tie_offset_x_m = 0.0;
-				section->global_tie_offset_y_m = 0.0;
-				section->global_tie_offset_z_m = 0.0;
-				section->global_tie_xsigma = 0.0;
-				section->global_tie_ysigma = 0.0;
-				section->global_tie_zsigma = 0.0;
-				new_segment = MB_NO;
-
-				/* open output section file */
-				sprintf(opath,"%s/nvs_%4.4d_%4.4d.mb71",
-					project.datadir,file->id,file->num_sections-1);
-				if ((status = mb_write_init(
-					mbna_verbose,opath,71,&ombio_ptr,
-					&obeams_bath,&obeams_amp,&opixels_ss,&error)) != MB_SUCCESS)
-					{
-					mb_error(mbna_verbose,error,&error_message);
-					fprintf(stderr,"\nMBIO Error returned from function <mb_write_init>:\n%s\n",error_message);
-					fprintf(stderr,"\nSwath sonar File <%s> not initialized for writing\n",path);
-					}
-				else
-					{
-					omb_io_ptr = (struct mb_io_struct *) ombio_ptr;
-					ostore_ptr = omb_io_ptr->store_data;
-					ostore = (struct mbsys_ldeoih_struct *) ostore_ptr;
-					ostore->kind = MB_DATA_DATA;
-					ostore->beams_bath = obeams_bath;
-					ostore->beams_amp = 0;
-					ostore->pixels_ss = 0;
-					ostore->kind = MB_DATA_DATA;
-					output_open = MB_YES;
-					status = mb_mallocd(mbna_verbose, __FILE__, __LINE__,obeams_bath*sizeof(char),
-							(void **)&ostore->beamflag,&error);
-					status = mb_mallocd(mbna_verbose, __FILE__, __LINE__,obeams_bath*sizeof(double),
-							(void **)&ostore->bath,&error);
-					status = mb_mallocd(mbna_verbose, __FILE__, __LINE__,obeams_bath*sizeof(double),
-							(void **)&ostore->bath_acrosstrack,&error);
-					status = mb_mallocd(mbna_verbose, __FILE__, __LINE__,obeams_bath*sizeof(double),
-							(void **)&ostore->bath_alongtrack,&error);
-
-					/* if error initializing memory then don't write the file */
-					if (error != MB_ERROR_NO_ERROR)
-						{
-						mb_error(mbna_verbose,error,&error_message);
-						fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",
-							error_message);
-						status = mb_freed(mbna_verbose,__FILE__,__LINE__,(void **)&ostore->beamflag,&error);
-						status = mb_freed(mbna_verbose,__FILE__,__LINE__,(void **)&ostore->bath,&error);
-						status = mb_freed(mbna_verbose,__FILE__,__LINE__,(void **)&ostore->bath_acrosstrack,&error);
-						status = mb_freed(mbna_verbose,__FILE__,__LINE__,(void **)&ostore->bath_alongtrack,&error);
-						status = mb_close(mbna_verbose,&ombio_ptr,&error);
-						output_open = MB_NO;
-						}
-					}
-				}
-
-			/* update section distance for each data ping */
-			if (kind == MB_DATA_DATA
-				&& error == MB_ERROR_NO_ERROR
-				&& section->num_pings > 1)
-				section->distance += distance;
-
-			/* handle good bathymetry */
-			if (kind == MB_DATA_DATA
-				&& error == MB_ERROR_NO_ERROR)
-				{
-				/* get statistics */
-				mb_coor_scale(mbna_verbose,navlat,&mtodeglon,&mtodeglat);
-				headingx = sin(DTR*heading);
-				headingy = cos(DTR*heading);
-				navlon_old = navlon;
-				navlat_old = navlat;
-				section->etime_d = time_d;
-				section->num_pings++;
-				file->num_pings++;
-				project.num_pings++;
-				new_pings++;
-				if (section->distance >=
-				    section->num_snav * project.section_length / (MBNA_SNAV_NUM - 1))
-					{
-					section->snav_id[section->num_snav]
-						= section->num_pings - 1;
-					section->snav_num_ties[section->num_snav]
-						= 0;
-					section->snav_distance[section->num_snav]
-						= section->distance;
-					section->snav_time_d[section->num_snav]
-						= time_d;
-					section->snav_lon[section->num_snav]
-						= navlon;
-					section->snav_lat[section->num_snav]
-						= navlat;
-					section->snav_lon_offset[section->num_snav]
-						= 0.0;
-					section->snav_lat_offset[section->num_snav]
-						= 0.0;
-					section->snav_z_offset[section->num_snav]
-						= 0.0;
-					section->snav_lon_offset_int[section->num_snav]
-						= 0.0;
-					section->snav_lat_offset_int[section->num_snav]
-						= 0.0;
-					section->snav_z_offset_int[section->num_snav]
-						= 0.0;
-					section->num_snav++;
-					file->num_snavs++;
-					project.num_snavs++;
-					}
-				for (i=0;i<beams_bath;i++)
-					{
-					if (mb_beam_ok(beamflag[i]) && bath[i] != 0.0)
-						{
-						good_beams++;
-						project.num_beams++;
-						file->num_beams++;
-						section->num_beams++;
-						lon = navlon
-							+ headingy*mtodeglon
-								* bathacrosstrack[i]
-							+ headingx*mtodeglon
-								* bathalongtrack[i];
-						lat = navlat
-							- headingx*mtodeglat
-								* bathacrosstrack[i]
-							+ headingy*mtodeglat
-								* bathalongtrack[i];
-						if (lon != 0.0) section->lonmin = MIN(section->lonmin,lon);
-						if (lon != 0.0) section->lonmax = MAX(section->lonmax,lon);
-						if (lat != 0.0) section->latmin = MIN(section->latmin,lat);
-						if (lat != 0.0) section->latmax = MAX(section->latmax,lat);
-						if (section->depthmin == 0.0)
-							section->depthmin = bath[i];
-						else
-							section->depthmin = MIN(section->depthmin,bath[i]);
-						if (section->depthmin == 0.0)
-							section->depthmax = bath[i];
-						else
-							section->depthmax = MAX(section->depthmax,bath[i]);
-						}
-					else
-						{
-						beamflag[i] = MB_FLAG_NULL;
-						bath[i] = 0.0;
-						bathacrosstrack[i] = 0.0;
-						bathalongtrack[i] = 0.0;
-						}
-					}
-
-				/* write out bath data only to format 71 file */
-				if (output_open == MB_YES)
-					{
-/*if (error <= MB_ERROR_NO_ERROR && kind == MB_DATA_DATA)
-fprintf(stderr,"%3d %4d/%2d/%2d %2.2d:%2.2d:%2.2d.%6.6d %10f %10f %5.2f %6.2f %7.3f %7.3f %4d %4d %4d\n",
-file->num_sections,
-time_i[0],time_i[1],time_i[2],time_i[3],time_i[4],time_i[5],time_i[6],
-navlon,navlat,speed,heading,distance,section->distance,
-beams_bath,beams_amp,pixels_ss);*/
-
-					/* get depth and distance scaling */
-					depthmax = 0.0;
-					distmax = 0.0;
-					for (i=0;i<beams_bath;i++)
-					    {
-					    depthmax = MAX(depthmax,
-							fabs(bath[i]));
-					    distmax = MAX(distmax,
-							fabs(bathacrosstrack[i]));
-					    distmax = MAX(distmax,
-							fabs(bathalongtrack[i]));
-					    }
-					depthscale = MAX(0.001, depthmax / 32000);
-					distscale = MAX(0.001, distmax / 32000);
-					ostore->depth_scale = depthscale;
-					ostore->distance_scale = distscale;
-					ostore->sonardepth = draft - heave;
-					ostore->roll = roll;
-					ostore->pitch = pitch;
-					ostore->heave = heave;
-
-					/* write out data */
-					status = mb_put_all(mbna_verbose,ombio_ptr,ostore_ptr,
-							MB_YES,MB_DATA_DATA,
-							time_i,time_d,
-							navlon,navlat,speed,heading,
-							beams_bath,0,0,
-							beamflag,bath,amp,bathacrosstrack,bathalongtrack,
-							ss,ssacrosstrack,ssalongtrack,
-							comment,&error);
-					}
-				}
-
-			/* write out all nav data to format 166 file */
-			if ((kind == MB_DATA_DATA || kind == MB_DATA_NAV)
-				&& time_d > 0.0 && time_i[0] > 0
-				&& nfp != NULL)
-				{
-				/*fprintf(stderr, "%4.4d %2.2d %2.2d %2.2d %2.2d %2.2d.%6.6d %16.6f %.10f %.10f %.2f %.2f\r\n",
-					time_i[0], time_i[1], time_i[2], time_i[3],
-					time_i[4], time_i[5], time_i[6], time_d,
-					navlon, navlat, heading, speed);
-				fprintf(nfp, "%4.4d %2.2d %2.2d %2.2d %2.2d %2.2d.%6.6d %16.6f %.10f %.10f %.2f %.2f\r\n",
-					time_i[0], time_i[1], time_i[2], time_i[3],
-					time_i[4], time_i[5], time_i[6], time_d,
-					navlon, navlat, heading, speed);*/
-				/*fprintf(stderr, "%4.4d %2.2d %2.2d %2.2d %2.2d %2.2d.%6.6d %16.6f %.10f %.10f %.2f %.2f %.2f %.2f %.2f %.2f\r\n",
-						time_i[0], time_i[1], time_i[2], time_i[3],
-						time_i[4], time_i[5], time_i[6], time_d,
-						navlon, navlat, heading, speed,
-						draft, roll, pitch, heave);*/
-				fprintf(nfp, "%4.4d %2.2d %2.2d %2.2d %2.2d %2.2d.%6.6d %16.6f %.10f %.10f %.2f %.2f %.2f %.2f %.2f %.2f\r\n",
-						time_i[0], time_i[1], time_i[2], time_i[3],
-						time_i[4], time_i[5], time_i[6], time_d,
-						navlon, navlat, heading, speed,
-						draft, roll, pitch, heave);
-				}
-
-			/* increment counters */
-			if (error == MB_ERROR_NO_ERROR)
-				nread++;
-
-			/* print debug statements */
-			if (mbna_verbose >= 2)
-				{
-				fprintf(stderr,"\ndbg2  Ping read in program <%s>\n",
-					program_name);
-				fprintf(stderr,"dbg2       kind:           %d\n",kind);
-				fprintf(stderr,"dbg2       error:          %d\n",error);
-				fprintf(stderr,"dbg2       status:         %d\n",status);
-				}
-			if (mbna_verbose >= 2 && kind == MB_DATA_COMMENT)
-				{
-				fprintf(stderr,"dbg2       comment:        %s\n",comment);
-				}
-			if (mbna_verbose >= 2 && error <= 0 && kind == MB_DATA_DATA)
-				{
-				fprintf(stderr,"dbg2       time_i:         %4d/%2d/%2d %2.2d:%2.2d:%2.2d.%6.6d\n",
-							time_i[0],time_i[1],
-							time_i[2],time_i[3],
-							time_i[4],time_i[5],time_i[6]);
-				fprintf(stderr,"dbg2       time_d:         %f\n",time_d);
-				fprintf(stderr,"dbg2       navlon:         %.10f\n",navlon);
-				fprintf(stderr,"dbg2       navlat:         %.10f\n",navlat);
-				fprintf(stderr,"dbg2       speed:          %f\n",speed);
-				fprintf(stderr,"dbg2       heading:        %f\n",heading);
-				fprintf(stderr,"dbg2       distance:       %f\n",distance);
-				fprintf(stderr,"dbg2       beams_bath:     %d\n",beams_bath);
-				fprintf(stderr,"dbg2       beams_amp:      %d\n",beams_amp);
-				fprintf(stderr,"dbg2       pixels_ss:      %d\n",pixels_ss);
-				}
-			}
-
-		/* close the swath file */
-		status = mb_close(mbna_verbose,&imbio_ptr,&error);
-		if (nfp != NULL)
-			fclose(nfp);
-		if (output_open == MB_YES)
-			{
-			status = mb_freed(mbna_verbose,__FILE__,__LINE__,(void **)&ostore->beamflag,&error);
-			status = mb_freed(mbna_verbose,__FILE__,__LINE__,(void **)&ostore->bath,&error);
-			status = mb_freed(mbna_verbose,__FILE__,__LINE__,(void **)&ostore->bath_acrosstrack,&error);
-			status = mb_freed(mbna_verbose,__FILE__,__LINE__,(void **)&ostore->bath_alongtrack,&error);
-			status = mb_close(mbna_verbose,&ombio_ptr,&error);
-			}
-
-		/* deallocate bin arrays if needed */
-		if (bin_nbath != NULL)
-			{
-			status = mb_freed(mbna_verbose, __FILE__, __LINE__,(void **)&bin_nbath,&error);
-			status = mb_freed(mbna_verbose, __FILE__, __LINE__,(void **)&bin_bath,&error);
-			status = mb_freed(mbna_verbose, __FILE__, __LINE__,(void **)&bin_bathacrosstrack,&error);
-			status = mb_freed(mbna_verbose, __FILE__, __LINE__,(void **)&bin_bathalongtrack,&error);
-			}
-
-		/* get coverage masks for each section */
-		if (file != NULL && first != MB_YES)
-			{
-			/* loop over all sections */
-			for (k=0;k<file->num_sections;k++)
-				{
-				/* set section data to be read */
-				section = (struct mbna_section *) &file->sections[k];
-				sprintf(opath,"%s/nvs_%4.4d_%4.4d.mb71",
-					project.datadir,file->id,k);
-
-				/* initialize reading the swath file */
-				if ((status = mb_read_init(
-				    mbna_verbose,opath,71,1,lonflip,bounds,
-				    btime_i,etime_i,speedmin,timegap,
-				    &ombio_ptr,&btime_d,&etime_d,
-				    &beams_bath,&beams_amp,&pixels_ss,&error)) != MB_SUCCESS)
-				    {
-				    mb_error(mbna_verbose,error,&error_message);
-				    fprintf(stderr,"\nMBIO Error returned from function <mb_read_init>:\n%s\n",error_message);
-				    fprintf(stderr,"\nSwath sonar File <%s> not initialized for reading\n",path);
-				    }
-
-				/* allocate memory for data arrays */
-				if (status == MB_SUCCESS)
-				    {
-				    beamflag = NULL;
-				    bath = NULL;
-				    amp = NULL;
-				    bathacrosstrack = NULL;
-				    bathalongtrack = NULL;
-				    ss = NULL;
-				    ssacrosstrack = NULL;
-				    ssalongtrack = NULL;
-				    if (error == MB_ERROR_NO_ERROR)
-					    status = mb_register_array(mbna_verbose, ombio_ptr, MB_MEM_TYPE_BATHYMETRY,
-									    sizeof(char), (void **)&beamflag, &error);
-				    if (error == MB_ERROR_NO_ERROR)
-					    status = mb_register_array(mbna_verbose, ombio_ptr, MB_MEM_TYPE_BATHYMETRY,
-									    sizeof(double), (void **)&bath, &error);
-				    if (error == MB_ERROR_NO_ERROR)
-					    status = mb_register_array(mbna_verbose, ombio_ptr, MB_MEM_TYPE_AMPLITUDE,
-									    sizeof(double), (void **)&amp, &error);
-				    if (error == MB_ERROR_NO_ERROR)
-					    status = mb_register_array(mbna_verbose, ombio_ptr, MB_MEM_TYPE_BATHYMETRY,
-									    sizeof(double), (void **)&bathacrosstrack, &error);
-				    if (error == MB_ERROR_NO_ERROR)
-					    status = mb_register_array(mbna_verbose, ombio_ptr, MB_MEM_TYPE_BATHYMETRY,
-									    sizeof(double), (void **)&bathalongtrack, &error);
-				    if (error == MB_ERROR_NO_ERROR)
-					    status = mb_register_array(mbna_verbose, ombio_ptr, MB_MEM_TYPE_SIDESCAN,
-									    sizeof(double), (void **)&ss, &error);
-				    if (error == MB_ERROR_NO_ERROR)
-					    status = mb_register_array(mbna_verbose, ombio_ptr, MB_MEM_TYPE_SIDESCAN,
-									    sizeof(double), (void **)&ssacrosstrack, &error);
-				    if (error == MB_ERROR_NO_ERROR)
-					    status = mb_register_array(mbna_verbose, ombio_ptr, MB_MEM_TYPE_SIDESCAN,
-									    sizeof(double), (void **)&ssalongtrack, &error);
-
-				    /* if error initializing memory then don't read the file */
-				    if (error != MB_ERROR_NO_ERROR)
-					{
-					mb_error(mbna_verbose,error,&error_message);
-					fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",
-						error_message);
-					}
-				    }
-
-				/* loop over reading data */
-				dx1 = (section->lonmax - section->lonmin) / MBNA_MASK_DIM;
-				dy1 = (section->latmax - section->latmin) / MBNA_MASK_DIM;
-				while (error <= MB_ERROR_NO_ERROR)
-				    {
-				    /* read a ping of data */
-				    status = mb_get_all(mbna_verbose,ombio_ptr,&ostore_ptr,&kind,
-					    time_i,&time_d,&navlon,&navlat,&speed,
-					    &heading,&distance,&altitude,&sonardepth,
-					    &beams_bath,&beams_amp,&pixels_ss,
-					    beamflag,bath,amp,bathacrosstrack,bathalongtrack,
-					    ss,ssacrosstrack,ssalongtrack,
-					    comment,&error);
-
-				    /* ignore minor errors */
-				    if (kind == MB_DATA_DATA
-					    && (error == MB_ERROR_TIME_GAP
-						    || error == MB_ERROR_OUT_BOUNDS
-						    || error == MB_ERROR_OUT_TIME
-						    || error == MB_ERROR_SPEED_TOO_SMALL))
-					{
-					status = MB_SUCCESS;
-					error = MB_ERROR_NO_ERROR;
-					}
-
-				    /* check for good bathymetry */
-				    if (kind == MB_DATA_DATA
-					    && error == MB_ERROR_NO_ERROR)
-					{
-					mb_coor_scale(mbna_verbose,navlat,&mtodeglon,&mtodeglat);
-					headingx = sin(DTR*heading);
-					headingy = cos(DTR*heading);
-					for (i=0;i<beams_bath;i++)
-					    {
-					    if (mb_beam_ok(beamflag[i]) && bath[i] != 0.0)
-						{
-						lon = navlon
-							+ headingy*mtodeglon
-								* bathacrosstrack[i]
-							+ headingx*mtodeglon
-								* bathalongtrack[i];
-						lat = navlat
-							- headingx*mtodeglat
-								* bathacrosstrack[i]
-							+ headingy*mtodeglat
-								* bathalongtrack[i];
-						ii1 = (lon - section->lonmin) / dx1;
-						jj1 = (lat - section->latmin) / dy1;
-						if (ii1 >= 0 && ii1 < MBNA_MASK_DIM
-						    && jj1 >= 0 && jj1 < MBNA_MASK_DIM)
-						    {
-						    section->coverage[ii1 + jj1 * MBNA_MASK_DIM] = 1;
-						    }
-						}
-					    }
-					}
-				    }
-/*fprintf(stderr,"%s/nvs_%4.4d_%4.4d.mb71\n",
-project.datadir,file->id,k);
-for (jj1=MBNA_MASK_DIM-1;jj1>=0;jj1--)
-{
-for (ii1=0;ii1<MBNA_MASK_DIM;ii1++)
-{
-kk1 = ii1 + jj1 * MBNA_MASK_DIM;
-fprintf(stderr, "%1d", section->coverage[kk1]);
-}
-fprintf(stderr, "\n");
-}*/
-
-				/* deallocate memory used for data arrays */
-				status = mb_close(mbna_verbose,&ombio_ptr,&error);
-				}
-			}
-		}
-
-	/* add info text */
-	if (status == MB_SUCCESS && new_pings > 0)
-		{
-		sprintf(message, "Imported format %d file: %s\n > Read %d pings\n > Added %d sections %d crossings\n",
-			iformat, path, new_pings, file->num_sections, new_crossings);
-		do_info_add(message, MB_YES);
-		}
-	else
-		{
-		sprintf(message, "Unable to import format %d file: %s\n",
-			iformat, path);
-		do_info_add(message, MB_YES);
-		}
-
-	/* turn off message */
-	do_message_off();
-
- 	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbnavadjust_bin_bathymetry(double altitude, int beams_bath, char *beamflag, double *bath,
-				double *bathacrosstrack, double *bathalongtrack,
-				int mbna_bin_beams_bath, double mbna_bin_pseudobeamwidth,
-				double mbna_bin_swathwidth, char *bin_beamflag,
-				double *bin_bath, double *bin_bathacrosstrack, double *bin_bathalongtrack,
-				int *error)
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_bin_bathymetry";
-	int	status = MB_SUCCESS;
-	int	i;
-
- 	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2                       mbna_verbose: %d\n",mbna_verbose);
-		fprintf(stderr,"dbg2                       altitude:     %f\n",altitude);
-		fprintf(stderr,"dbg2                       beams_bath:   %d\n",beams_bath);
-		for (i=0;i<beams_bath;i++)
-			fprintf(stderr,"dbg2                       beam[%d]: %f %f %f %d\n",
-				i,bath[i],bathacrosstrack[i],bathalongtrack[i],beamflag[i]);
-		fprintf(stderr,"dbg2                       mbna_bin_beams_bath:      %d\n",mbna_bin_beams_bath);
-		fprintf(stderr,"dbg2                       mbna_bin_pseudobeamwidth: %f\n",mbna_bin_pseudobeamwidth);
-		fprintf(stderr,"dbg2                       mbna_bin_swathwidth:      %f\n",mbna_bin_swathwidth);
-		}
-
- 	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		for (i=0;i<mbna_bin_beams_bath;i++)
-			fprintf(stderr,"dbg2                       beam[%d]: %f %f %f %d\n",
-				i,bin_bath[i],bin_bathacrosstrack[i],bin_bathalongtrack[i],bin_beamflag[i]);
-		fprintf(stderr,"dbg2       error:       %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbnavadjust_findcrossings()
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_findcrossings";
-	int	status = MB_SUCCESS;
-	struct mbna_crossing *crossing;
-	int	ifile, icrossing;
-
- 	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
-
-	/* turn on message */
-	sprintf(message,"Checking for crossings...");
-	do_message_on(message);
-
-     	/* loop over files looking for new crossings */
-    	if (project.open == MB_YES
-    		&& project.num_files > 0)
-		{
-		/* look for new crossings through all files */
-		for (ifile=0;ifile<project.num_files;ifile++)
-			{
-			sprintf(message,"Checking for crossings with file %d of %d...",ifile,project.num_files);
-			do_message_update(message);
-
-			status = mbnavadjust_findcrossingsfile(ifile);
-			}
-
-		/* resort crossings */
-		sprintf(message,"Sorting crossings....");
-		do_message_update(message);
-		if (project.num_crossings > 1)
-		mb_mergesort((void *)project.crossings, (size_t)project.num_crossings, sizeof(struct mbna_crossing), mbnavadjust_crossing_compare);
-
-		/* recalculate overlap fractions, true crossings, good crossing statistics */
-		sprintf(message,"Calculating crossing overlaps...");
-		do_message_update(message);
-
-		project.num_crossings_analyzed = 0;
-		project.num_goodcrossings = 0;
-		project.num_truecrossings = 0;
-		project.num_truecrossings_analyzed = 0;
-		for (icrossing=0;icrossing<project.num_crossings;icrossing++)
-			{
-			crossing = &(project.crossings[icrossing]);
-
-			/* recalculate crossing overlap */
-			mbnavadjust_crossing_overlap(icrossing);
-			if (crossing->overlap >= 25)
-				project.num_goodcrossings++;
-
-			/* check if this is a true crossing */
-			if (mbnavadjust_sections_intersect(icrossing) == MB_YES)
-				{
-				crossing->truecrossing = MB_YES;
-				project.num_truecrossings++;
-				if (crossing->status != MBNA_CROSSING_STATUS_NONE)
-					project.num_truecrossings_analyzed++;
-				}
-			else
-				crossing->truecrossing = MB_NO;
-			if (crossing->status != MBNA_CROSSING_STATUS_NONE)
-				project.num_crossings_analyzed++;
-			}
-		}
-
-	/* turn off message */
-	do_message_off();
-
- 	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbnavadjust_crossing_compare(const void *a, const void *b)
-{
-	struct mbna_crossing	*aa, *bb;
-	int a1id, a2id, b1id, b2id;
-	int aid, bid;
-
-	aa = (struct mbna_crossing *) a;
-	bb = (struct mbna_crossing *) b;
-
-	a1id = aa->file_id_1 * 1000 + aa->section_1;
-	a2id = aa->file_id_2 * 1000 + aa->section_2;
-	if (a1id > a2id)
-		aid = a1id;
-	else
-		aid = a2id;
-
-	b1id = bb->file_id_1 * 1000 + bb->section_1;
-	b2id = bb->file_id_2 * 1000 + bb->section_2;
-	if (b1id > b2id)
-		bid = b1id;
-	else
-		bid = b2id;
-
-	if (aid > bid)
-		return(1);
-	else if (aid < bid)
-		return(-1);
-	else if (a1id > b1id)
-		return(1);
-	else if (a1id < b1id)
-		return(-1);
-	else if (a2id > b2id)
-		return(1);
-	else if (a2id < b2id)
-		return(-1);
-	else
-		return(0);
-}
-
-/*--------------------------------------------------------------------*/
-int mbnavadjust_findcrossingsfile(int ifile)
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_findcrossingsfile";
-	int	status = MB_SUCCESS;
-	struct mbna_file *file1, *file2;
-	struct mbna_section *section1, *section2;
-	struct mbna_crossing *crossing;
-	int	found, overlap, disqualify;
-	int	isection, jfile, jsection, jsectionmax, icrossing;
-	double	lonoffset1, latoffset1, lonoffset2, latoffset2;
-	double	lonmin1, lonmax1, latmin1, latmax1;
-	double	lonmin2, lonmax2, latmin2, latmax2;
-	double	cell1lonmin, cell1lonmax, cell1latmin, cell1latmax;
-	double	cell2lonmin, cell2lonmax, cell2latmin, cell2latmax;
-	double	dx1, dy1, dx2, dy2;
-	int	ii1, jj1, kk1, ii2, jj2, kk2;
-
- 	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2                       ifile: %d\n",ifile);
-		}
-
-     	/* loop over files and sections, comparing sections from project.files[ifile] with all previous sections */
-    	if (project.open == MB_YES
-    		&& project.num_files > 0)
-		{
-		file2 = &(project.files[ifile]);
-
-		/* loop over all sections */
-		for (isection=0;isection<file2->num_sections;isection++)
-			{
-			section2 = &(file2->sections[isection]);
-			lonoffset2 = section2->snav_lon_offset[section2->num_snav/2];
-			latoffset2 = section2->snav_lat_offset[section2->num_snav/2];
-
-			/* get coverage mask adjusted for most recent inversion solution */
-			lonmin2 = section2->lonmin + lonoffset2;
-			lonmax2 = section2->lonmax + lonoffset2;
-			latmin2 = section2->latmin + latoffset2;
-			latmax2 = section2->latmax + latoffset2;
-			dx2 = (section2->lonmax - section2->lonmin) / (MBNA_MASK_DIM - 1);
-			dy2 = (section2->latmax - section2->latmin) / (MBNA_MASK_DIM - 1);
-
-			/* now loop over all previous sections looking for crossings */
-			for (jfile=0;jfile<=ifile;jfile++)
-				{
-				file1 = &(project.files[jfile]);
-				if (jfile < ifile)
-					jsectionmax = file1->num_sections;
-				else
-					jsectionmax = isection;
-				for (jsection=0;jsection<jsectionmax;jsection++)
-					{
-					section1 = &(file1->sections[jsection]);
-					lonoffset1 = section1->snav_lon_offset[section1->num_snav/2];
-					latoffset1 = section1->snav_lat_offset[section1->num_snav/2];
-
-					/* get coverage mask adjusted for most recent inversion solution */
-					lonmin1 = section1->lonmin + lonoffset1;
-					lonmax1 = section1->lonmax + lonoffset1;
-					latmin1 = section1->latmin + latoffset1;
-					latmax1 = section1->latmax + latoffset1;
-					dx1 = (section1->lonmax - section1->lonmin) / (MBNA_MASK_DIM - 1);
-					dy1 = (section1->latmax - section1->latmin) / (MBNA_MASK_DIM - 1);
-
-					/* check if there is overlap given the current navigation model */
-					overlap = 0;
-					disqualify = MB_NO;
-					if (jfile == ifile && jsection == isection - 1 && section2->continuity == MB_YES)
-						disqualify = MB_YES;
-					else if (jfile == ifile - 1 && jsection == file1->num_sections - 1 && isection == 0
-						&& section2->continuity == MB_YES)
-						disqualify = MB_YES;
-					else if (!(lonmin2 < lonmax1 && lonmax2 > lonmin1
-							&& latmin2 < latmax1 && latmax2 > latmin1))
-						{
-						disqualify = MB_YES;
-						}
-					else
-						{
-						/* loop over the coverage mask cells looking for overlap */
-						for (ii2=0;ii2<MBNA_MASK_DIM && overlap == 0;ii2++)
-						for (jj2=0;jj2<MBNA_MASK_DIM && overlap == 0;jj2++)
-							{
-							kk2 = ii2 + jj2 * MBNA_MASK_DIM;
-							if (section2->coverage[kk2] == 1)
-								{
-								cell2lonmin = lonmin2 + ii2 * dx2;
-								cell2lonmax = lonmin2 + (ii2 + 1) * dx2;
-								cell2latmin = latmin2 + jj2 * dy2;
-								cell2latmax = latmin2 + (jj2 + 1) * dy2;
-
-								for (ii1=0;ii1<MBNA_MASK_DIM && overlap == 0;ii1++)
-								for (jj1=0;jj1<MBNA_MASK_DIM && overlap == 0;jj1++)
-									{
-									kk1 = ii1 + jj1 * MBNA_MASK_DIM;
-									if (section1->coverage[kk1] == 1)
-										{
-										cell1lonmin = lonmin1 + ii1 * dx1;
-										cell1lonmax = lonmin1 + (ii1 + 1) * dx1;
-										cell1latmin = latmin1 + jj1 * dy2;
-										cell1latmax = latmin1 + (jj1 + 1) * dy1;
-
-										/* check if these two cells overlap */
-										if (cell2lonmin < cell1lonmax && cell2lonmax > cell1lonmin
-											&& cell2latmin < cell1latmax && cell2latmax > cell1latmin)
-											{
-											overlap++;
-											}
-										}
-									}
-								}
-							}
-						}
-
-					/* if not disqualified and overlap found, then this is a crossing */
-					/* check to see if the crossing exists, if not add it */
-					if (disqualify == MB_NO && overlap > 0)
-						{
-						found = MB_NO;
-						for (icrossing=0;icrossing<project.num_crossings && found == MB_NO;icrossing++)
-							{
-							crossing = &(project.crossings[icrossing]);
-							if (crossing->file_id_2 == ifile && crossing->file_id_1 == jfile
-								&& crossing->section_2 == isection && crossing->section_1 == jsection)
-								{
-								found = MB_YES;
-								}
-							else if (crossing->file_id_1 == ifile && crossing->file_id_2 == jfile
-								&& crossing->section_1 == isection && crossing->section_2 == jsection)
-								{
-								found = MB_YES;
-								}
-							}
-						if (found == MB_NO)
-							{
-							/* allocate mbna_crossing array if needed */
-							if (project.num_crossings_alloc <= project.num_crossings)
-							    {
-							    project.crossings = (struct mbna_crossing *) realloc(project.crossings,
-									    sizeof(struct mbna_crossing) * (project.num_crossings_alloc + ALLOC_NUM));
-							    if (project.crossings != NULL)
-								    project.num_crossings_alloc += ALLOC_NUM;
-							    else
-								{
-								status = MB_FAILURE;
-								error = MB_ERROR_MEMORY_FAIL;
-								}
-							    }
-
-							/* add crossing to list */
-							crossing = (struct mbna_crossing *) &project.crossings[project.num_crossings];
-							crossing->status = MBNA_CROSSING_STATUS_NONE;
-							crossing->truecrossing = MB_NO;
-							crossing->overlap = 0;
-							crossing->file_id_1 = file1->id;
-							crossing->section_1 = jsection;
-							crossing->file_id_2 = file2->id;
-							crossing->section_2 = isection;
-							crossing->num_ties = 0;
-							project.num_crossings++;
-
-fprintf(stderr,"added crossing: %d  %4d %4d   %4d %4d\n",
-project.num_crossings-1,
-crossing->file_id_1,crossing->section_1,
-crossing->file_id_2,crossing->section_2);
-							}
-/*else
-fprintf(stderr,"no new crossing:    %4d %4d   %4d %4d   duplicate\n",
-file2->id,isection,
-file1->id,jsection);*/
-						}
-/*else
-fprintf(stderr,"disqualified:       %4d %4d   %4d %4d   disqualify:%d overlaptxt list:%d\n",
-file2->id,isection,
-file1->id,jsection, disqualify, overlap);*/
-
-					}
-				}
-			}
-		}
-
- 	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbnavadjust_poornav_file()
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_poornav_file";
-	int	status = MB_SUCCESS;
-	int	block;
- 	int	i;
-
- 	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
-
-     	/* set selected file's block to poor nav */
-    	if (project.open == MB_YES
-    		&& project.num_files > 0
-		&& mbna_file_select >= 0
-		&& mbna_file_select < project.num_files)
-		{
-		/* get affected survey block */
-		if (mbna_view_list == MBNA_VIEW_LIST_SURVEYS)
-			{
-			block = mbna_survey_select;
-			}
-		else if (mbna_view_list == MBNA_VIEW_LIST_FILES)
-			{
-			block = project.files[mbna_file_select].block;
-			}
-
-		/* set all files in block of selected file to poor nav */
-		for (i=0;i<project.num_files;i++)
-			{
-			if (project.files[i].block == block)
-				{
-				project.files[i].status = MBNA_FILE_POORNAV;
-				}
-			}
-
-		/* write out updated project */
-		mbnavadjust_write_project();
-
-		/* add info text */
-		sprintf(message, "Set file %d to have poor nav: %s\n",
-			    mbna_file_select,project.files[mbna_file_select].file);
-		do_info_add(message, MB_YES);
-   		}
-
- 	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbnavadjust_goodnav_file()
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_goodnav_file";
-	int	status = MB_SUCCESS;
- 	int	block;
-	int	i;
-
- 	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
-
-     	/* set selected file's block to good nav */
-    	if (project.open == MB_YES
-    		&& project.num_files > 0
-		&& mbna_file_select >= 0
-		&& mbna_file_select < project.num_files)
-		{
-		/* get affected survey block */
-		if (mbna_view_list == MBNA_VIEW_LIST_SURVEYS)
-			{
-			block = mbna_survey_select;
-			}
-		else if (mbna_view_list == MBNA_VIEW_LIST_FILES)
-			{
-			block = project.files[mbna_file_select].block;
-			}
-
-		/* set all files in block of selected file to good nav */
-		for (i=0;i<project.num_files;i++)
-			{
-			if (project.files[i].block == block)
-				{
-				project.files[i].status = MBNA_FILE_GOODNAV;
-				}
-			}
-		if (project.inversion == MBNA_INVERSION_CURRENT)
-			project.inversion = MBNA_INVERSION_OLD;
-
-		/* write out updated project */
-		mbnavadjust_write_project();
-
-		/* add info text */
-		sprintf(message, "Set file %d to have good nav: %s\n",
-			    mbna_file_select,project.files[mbna_file_select].file);
-		do_info_add(message, MB_YES);
-   		}
-
- 	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbnavadjust_fixednav_file()
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_fixednav_file";
-	int	status = MB_SUCCESS;
- 	int	block;
-	int	i;
-
- 	/* print input debug statements */
-	if (mbna_verbose >= 0)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
-
-     	/* set selected file's block to good nav */
-    	if (project.open == MB_YES
-    		&& project.num_files > 0
-		&& mbna_file_select >= 0
-		&& mbna_file_select < project.num_files)
-		{
-		/* get affected survey block */
-		if (mbna_view_list == MBNA_VIEW_LIST_SURVEYS)
-			{
-			block = mbna_survey_select;
-			}
-		else if (mbna_view_list == MBNA_VIEW_LIST_FILES)
-			{
-			block = project.files[mbna_file_select].block;
-			}
-
-		/* set all files in block of selected file to fixed nav */
-		for (i=0;i<project.num_files;i++)
-			{
-			if (project.files[i].block == block)
-				{
-				project.files[i].status = MBNA_FILE_FIXEDNAV;
-				fprintf(stderr,"Set file to have fixed nav: %d %s\n",i,project.files[i].file);
-				}
-			}
-		if (project.inversion == MBNA_INVERSION_CURRENT)
-			project.inversion = MBNA_INVERSION_OLD;
-
-		/* write out updated project */
-		mbnavadjust_write_project();
-
-		/* add info text */
-		sprintf(message, "Set file %d to have fixed nav: %s\n",
-			    mbna_file_select,project.files[mbna_file_select].file);
-		do_info_add(message, MB_YES);
-   		}
-
- 	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbnavadjust_fixedxynav_file()
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_fixedxynav_file";
-	int	status = MB_SUCCESS;
- 	int	block;
-	int	i;
-
- 	/* print input debug statements */
-	if (mbna_verbose >= 0)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
-
-     	/* set selected file's block to good nav */
-    	if (project.open == MB_YES
-    		&& project.num_files > 0
-		&& mbna_file_select >= 0
-		&& mbna_file_select < project.num_files)
-		{
-		/* get affected survey block */
-		if (mbna_view_list == MBNA_VIEW_LIST_SURVEYS)
-			{
-			block = mbna_survey_select;
-			}
-		else if (mbna_view_list == MBNA_VIEW_LIST_FILES)
-			{
-			block = project.files[mbna_file_select].block;
-			}
-
-		/* set all files in block of selected file to fixed nav */
-		for (i=0;i<project.num_files;i++)
-			{
-			if (project.files[i].block == block)
-				{
-				project.files[i].status = MBNA_FILE_FIXEDXYNAV;
-				fprintf(stderr,"Set file to have fixed xy nav: %d %s\n",i,project.files[i].file);
-				}
-			}
-		if (project.inversion == MBNA_INVERSION_CURRENT)
-			project.inversion = MBNA_INVERSION_OLD;
-
-		/* write out updated project */
-		mbnavadjust_write_project();
-
-		/* add info text */
-		sprintf(message, "Set file %d to have fixed xy nav: %s\n",
-			    mbna_file_select,project.files[mbna_file_select].file);
-		do_info_add(message, MB_YES);
-   		}
-
- 	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbnavadjust_fixedznav_file()
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_fixedznav_file";
-	int	status = MB_SUCCESS;
- 	int	block;
-	int	i;
-
- 	/* print input debug statements */
-	if (mbna_verbose >= 0)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
-
-     	/* set selected file's block to good nav */
-    	if (project.open == MB_YES
-    		&& project.num_files > 0
-		&& mbna_file_select >= 0
-		&& mbna_file_select < project.num_files)
-		{
-		/* get affected survey block */
-		if (mbna_view_list == MBNA_VIEW_LIST_SURVEYS)
-			{
-			block = mbna_survey_select;
-			}
-		else if (mbna_view_list == MBNA_VIEW_LIST_FILES)
-			{
-			block = project.files[mbna_file_select].block;
-			}
-
-		/* set all files in block of selected file to fixed nav */
-		for (i=0;i<project.num_files;i++)
-			{
-			if (project.files[i].block == block)
-				{
-				project.files[i].status = MBNA_FILE_FIXEDZNAV;
-				fprintf(stderr,"Set file to have fixed z nav: %d %s\n",i,project.files[i].file);
-				}
-			}
-		if (project.inversion == MBNA_INVERSION_CURRENT)
-			project.inversion = MBNA_INVERSION_OLD;
-
-		/* write out updated project */
-		mbnavadjust_write_project();
-
-		/* add info text */
-		sprintf(message, "Set file %d to have fixed z nav: %s\n",
-			    mbna_file_select,project.files[mbna_file_select].file);
-		do_info_add(message, MB_YES);
-   		}
-
- 	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbnavadjust_set_tie_xyz()
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_set_tie_xyz";
-	int	status = MB_SUCCESS;
-    	struct mbna_crossing *crossing;
-    	struct mbna_tie *tie;
-
- 	/* print input debug statements */
-	if (mbna_verbose >= 0)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
-
-     	/* set selected file's block to good nav */
-    	if (project.open == MB_YES
-    		&& project.num_files > 0
-		&& mbna_crossing_select >= 0
-		&& mbna_tie_select >= 0)
-		{
-		/* set tie to fix xyz */
-		crossing = &(project.crossings[mbna_crossing_select]);
-		tie = (struct mbna_tie *) &crossing->ties[mbna_tie_select];
-		tie->status = MBNA_TIE_XYZ;
-		fprintf(stderr,"Set crossing %d tie %d to fix XYZ\n",mbna_crossing_select,mbna_tie_select);
-		if (project.inversion == MBNA_INVERSION_CURRENT)
-			project.inversion = MBNA_INVERSION_OLD;
-
-		/* write out updated project */
-		mbnavadjust_write_project();
-
-		/* add info text */
-		sprintf(message, "Set crossing %d tie %d to fix XYZ\n",
-			    mbna_crossing_select,mbna_tie_select);
-		do_info_add(message, MB_YES);
-   		}
-
- 	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbnavadjust_set_tie_xy()
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_set_tie_xy";
-	int	status = MB_SUCCESS;
-    	struct mbna_crossing *crossing;
-    	struct mbna_tie *tie;
-
- 	/* print input debug statements */
-	if (mbna_verbose >= 0)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
-
-     	/* set selected file's block to good nav */
-    	if (project.open == MB_YES
-    		&& project.num_files > 0
-		&& mbna_crossing_select >= 0
-		&& mbna_tie_select >= 0)
-		{
-		/* set tie to fix xy */
-		crossing = &(project.crossings[mbna_crossing_select]);
-		tie = (struct mbna_tie *) &crossing->ties[mbna_tie_select];
-		tie->status = MBNA_TIE_XY;
-		fprintf(stderr,"Set crossing %d tie %d to fix XY\n",mbna_crossing_select,mbna_tie_select);
-		if (project.inversion == MBNA_INVERSION_CURRENT)
-			project.inversion = MBNA_INVERSION_OLD;
-
-		/* write out updated project */
-		mbnavadjust_write_project();
-
-		/* add info text */
-		sprintf(message, "Set crossing %d tie %d to fix XY\n",
-			    mbna_crossing_select,mbna_tie_select);
-		do_info_add(message, MB_YES);
-   		}
-
- 	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbnavadjust_set_tie_z()
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_set_tie_z";
-	int	status = MB_SUCCESS;
-    	struct mbna_crossing *crossing;
-    	struct mbna_tie *tie;
-
- 	/* print input debug statements */
-	if (mbna_verbose >= 0)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
-
-     	/* set selected file's block to good nav */
-    	if (project.open == MB_YES
-    		&& project.num_files > 0
-		&& mbna_crossing_select >= 0
-		&& mbna_tie_select >= 0)
-		{
-		/* set tie to fix z */
-		crossing = &(project.crossings[mbna_crossing_select]);
-		tie = (struct mbna_tie *) &crossing->ties[mbna_tie_select];
-		tie->status = MBNA_TIE_Z;
-		fprintf(stderr,"Set crossing %d tie %d to fix Z\n",mbna_crossing_select,mbna_tie_select);
-		if (project.inversion == MBNA_INVERSION_CURRENT)
-			project.inversion = MBNA_INVERSION_OLD;
-
-		/* write out updated project */
-		mbnavadjust_write_project();
-
-		/* add info text */
-		sprintf(message, "Set crossing %d tie %d to fix Z\n",
-			    mbna_crossing_select,mbna_tie_select);
-		do_info_add(message, MB_YES);
-   		}
-
- 	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbnavadjust_naverr_save()
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_naverr_save";
-	int	status = MB_SUCCESS;
-	struct mbna_file *file;
-	struct mbna_section *section;
-	struct mbna_crossing *crossing;
-	struct mbna_tie *tie;
-	int	i;
-
- 	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
-
-	/* save offsets if crossing loaded and ties set */
-    	if (project.open == MB_YES
-    		&& project.num_crossings > 0
-		&& mbna_naverr_load == MB_YES
-		&& mbna_current_crossing >= 0
-		&& mbna_current_tie >= 0)
-    		{
-		/* save offsets if ties set */
-		crossing = &project.crossings[mbna_current_crossing];
-		if (crossing->num_ties > 0
-		    && mbna_current_tie >= 0)
-		    {
-		    /* get relevant tie */
-		    tie = &crossing->ties[mbna_current_tie];
-
-		    /* reset tie counts for snavs */
-		    file = &project.files[crossing->file_id_1];
-		    section = &file->sections[crossing->section_1];
-		    section->snav_num_ties[tie->snav_1]--;
-		    file = &project.files[crossing->file_id_2];
-		    section = &file->sections[crossing->section_2];
-		    section->snav_num_ties[tie->snav_2]--;
-
-		    /* get new tie values */
-/* fprintf(stderr, "tie %d of crossing %d saved...\n", mbna_current_tie, mbna_current_crossing); */
-		    /* tie->status = tie->status; */
-		    tie->snav_1 = mbna_snav_1;
-		    tie->snav_1_time_d = mbna_snav_1_time_d;
-		    tie->snav_2 = mbna_snav_2;
-		    tie->snav_2_time_d = mbna_snav_2_time_d;
-		    if (tie->inversion_status == MBNA_INVERSION_CURRENT
-			&& (tie->offset_x != mbna_offset_x
-			    || tie->offset_y != mbna_offset_y
-			    || tie->offset_z_m != mbna_offset_z))
-			{
-			tie->inversion_status = MBNA_INVERSION_OLD;
-			}
-		    tie->offset_x = mbna_offset_x;
-		    tie->offset_y = mbna_offset_y;
-		    tie->offset_x_m = mbna_offset_x / mbna_mtodeglon;
-		    tie->offset_y_m = mbna_offset_y / mbna_mtodeglat;
-		    tie->offset_z_m = mbna_offset_z;
-		    tie->sigmar1 = mbna_minmisfit_sr1;
-		    tie->sigmar2 = mbna_minmisfit_sr2;
-		    tie->sigmar3 = mbna_minmisfit_sr3;
-		    for (i=0;i<3;i++)
-			    {
-			    tie->sigmax1[i] = mbna_minmisfit_sx1[i];
-			    tie->sigmax2[i] = mbna_minmisfit_sx2[i];
-			    tie->sigmax3[i] = mbna_minmisfit_sx3[i];
-			    }
-		    if (project.inversion == MBNA_INVERSION_CURRENT)
-			    project.inversion = MBNA_INVERSION_OLD;
-
-		    /* reset tie counts for snavs */
-		    file = &project.files[crossing->file_id_1];
-		    section = &file->sections[crossing->section_1];
-		    section->snav_num_ties[tie->snav_1]++;
-		    file = &project.files[crossing->file_id_2];
-		    section = &file->sections[crossing->section_2];
-		    section->snav_num_ties[tie->snav_2]++;
-
-		    /* write updated project */
-		    mbnavadjust_write_project();
-
-		    /* add info text */
-		    sprintf(message,"Save Tie Point %d of Crossing %d\n > Nav points: %d:%d:%d %d:%d:%d\n > Offsets: %f %f %f m\n",
-			    mbna_current_tie, mbna_current_crossing,
-			    crossing->file_id_1, crossing->section_1, tie->snav_1,
-			    crossing->file_id_2, crossing->section_2, tie->snav_2,
-			    tie->offset_x_m, tie->offset_y_m, tie->offset_z_m);
-		    if (mbna_verbose == 0)
-			    fprintf(stderr,"%s",message);
-		    do_info_add(message, MB_YES);
-		    }
-		}
-
- 	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbnavadjust_naverr_specific(int new_crossing, int new_tie)
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_naverr_specific";
-	int	status = MB_SUCCESS;
-	struct mbna_crossing *crossing;
-	struct mbna_tie *tie;
-
- 	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2               new_crossing: %d\n",new_crossing);
-		fprintf(stderr,"dbg2               new_tie:      %d\n",new_tie);
-		}
-
-     	/* get current crossing */
-    	if (project.open == MB_YES
-    		&& project.num_crossings > 0)
-    		{
-    		/* get next crossing */
-		if (new_crossing >= 0
-		    && new_crossing < project.num_crossings)
-			{
-    			mbna_current_crossing = new_crossing;
-			if (new_tie >= 0
-			    && new_tie < project.crossings[mbna_current_crossing].num_ties)
-			    mbna_current_tie = new_tie;
-			else
-			    mbna_current_tie = -1;
-			}
-		else
-			{
-    			mbna_current_crossing = 0;
-			mbna_current_tie = -1;
-			}
-
-    		/* retrieve crossing parameters */
-    		if (mbna_current_crossing >= 0)
-    			{
-    			crossing = &project.crossings[mbna_current_crossing];
-    			mbna_file_id_1 = crossing->file_id_1;
-    			mbna_section_1 = crossing->section_1;
-     			mbna_file_id_2 = crossing->file_id_2;
-    			mbna_section_2 = crossing->section_2;
-			if (crossing->num_ties > 0)
-			    {
-			    if (mbna_current_tie < 0)
-				mbna_current_tie = 0;
-			    tie = &crossing->ties[mbna_current_tie];
-			    mbna_snav_1 = tie->snav_1;
-			    mbna_snav_1_time_d = tie->snav_1_time_d;
-			    mbna_snav_2 = tie->snav_2;
-			    mbna_snav_2_time_d = tie->snav_2_time_d;
-			    mbna_offset_x = tie->offset_x;
-			    mbna_offset_y = tie->offset_y;
-			    mbna_offset_z = tie->offset_z_m;
-/* fprintf(stderr,"%s %d: mbna_offset_z:%f\n",__FILE__,__LINE__,mbna_offset_z); */
-			    }
-			else
-			    {
-			    mbna_current_tie = -1;
-			    }
-
-			/* reset survey file and section selections */
-			if (mbna_view_mode == MBNA_VIEW_MODE_SURVEY
-			    || mbna_view_mode == MBNA_VIEW_MODE_WITHSURVEY)
-				{
-				if (mbna_survey_select == project.files[crossing->file_id_1].block)
-					{
-					mbna_file_select = crossing->file_id_1;
-					mbna_section_select = crossing->section_1;
-					}
-				else if (mbna_survey_select == project.files[crossing->file_id_2].block)
-					{
-					mbna_file_select = crossing->file_id_2;
-					mbna_section_select = crossing->section_2;
-					}
-				else
-					{
-					mbna_file_select = crossing->file_id_1;
-					mbna_section_select = crossing->section_1;
-					}
-				}
-			else if (mbna_view_mode == MBNA_VIEW_MODE_FILE
-			    || mbna_view_mode == MBNA_VIEW_MODE_WITHFILE)
-				{
-				if (mbna_file_select == crossing->file_id_1)
-					{
-					mbna_survey_select = project.files[crossing->file_id_1].block;
-					mbna_section_select = crossing->section_1;
-					}
-				else if (mbna_file_select == crossing->file_id_2)
-					{
-					mbna_survey_select = project.files[crossing->file_id_2].block;
-					mbna_section_select = crossing->section_2;
-					}
-				else
-					{
-					mbna_survey_select = project.files[crossing->file_id_1].block;
-					mbna_section_select = crossing->section_1;
-					}
-				}
-			else if (mbna_view_mode == MBNA_VIEW_MODE_WITHSECTION)
-				{
-				if (mbna_file_select == crossing->file_id_1
-				    && mbna_section_select == crossing->section_1)
-					{
-					mbna_survey_select = project.files[crossing->file_id_1].block;
-					mbna_file_select = crossing->file_id_1;
-					}
-				else if (mbna_file_select == crossing->file_id_2
-				    && mbna_section_select == crossing->section_2)
-					{
-					mbna_survey_select = project.files[crossing->file_id_2].block;
-					mbna_file_select = crossing->file_id_2;
-					}
-				else
-					{
-					mbna_survey_select = project.files[crossing->file_id_1].block;
-					mbna_file_select = crossing->file_id_1;
-					}
-				}
- 			}
-
-  		/* load the crossing */
-  		if (mbna_current_crossing >= 0)
-  			{
-			/* put up message */
-			sprintf(message,"Loading crossing %d...",mbna_current_crossing);
-			do_message_on(message);
-
-  			mbnavadjust_crossing_load();
-
-			/* turn off message */
-			do_message_off();
-  			}
-   		}
-
- 	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbnavadjust_naverr_next()
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_naverr_next";
-	int	status = MB_SUCCESS;
-	struct mbna_crossing *crossing;
-	struct mbna_tie *tie;
-	int	crossing_ok;
-	int	i, j, k;
-
- 	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
-
-     	/* find next current crossing */
-    	if (project.open == MB_YES
-    		&& project.num_crossings > 0)
-    		{
-    		/* get next good crossing */
-		j = -1;
-		k = -1;
-		for (i=0;i<project.num_crossings;i++)
-			{
-			crossing = &(project.crossings[i]);
-			crossing_ok = MB_NO;
-			if (mbna_view_list == MBNA_VIEW_LIST_CROSSINGS)
-				crossing_ok = MB_YES;
-			else if (mbna_view_list == MBNA_VIEW_LIST_MEDIOCRECROSSINGS
-				&& crossing->overlap >= MBNA_MEDIOCREOVERLAP_THRESHOLD)
-				crossing_ok = MB_YES;
-			else if (mbna_view_list == MBNA_VIEW_LIST_GOODCROSSINGS
-				&& crossing->overlap >= MBNA_GOODOVERLAP_THRESHOLD)
-				crossing_ok = MB_YES;
-			else if (mbna_view_list == MBNA_VIEW_LIST_BETTERCROSSINGS
-				&& crossing->overlap >= MBNA_BETTEROVERLAP_THRESHOLD)
-				crossing_ok = MB_YES;
-			else if (mbna_view_list == MBNA_VIEW_LIST_TRUECROSSINGS
-				&& crossing->truecrossing == MB_YES)
-				crossing_ok = MB_YES;
-			else if (mbna_view_list == MBNA_VIEW_LIST_TIES
-				&& crossing->num_ties > 0)
-				crossing_ok = MB_YES;
-			if ((mbna_view_mode == MBNA_VIEW_MODE_SURVEY
-					&& (mbna_survey_select != project.files[crossing->file_id_1].block
-						|| mbna_survey_select != project.files[crossing->file_id_2].block))
-				|| (mbna_view_mode == MBNA_VIEW_MODE_FILE
-					&& (mbna_file_select != crossing->file_id_1
-						|| mbna_file_select != crossing->file_id_2))
-				|| (mbna_view_mode == MBNA_VIEW_MODE_WITHSURVEY
-					&& mbna_survey_select != project.files[crossing->file_id_1].block
-					&& mbna_survey_select != project.files[crossing->file_id_2].block)
-				|| (mbna_view_mode == MBNA_VIEW_MODE_WITHFILE
-					&& mbna_file_select != crossing->file_id_1
-					&& mbna_file_select != crossing->file_id_2)
-				|| (mbna_view_mode == MBNA_VIEW_MODE_WITHSECTION
-					&& (mbna_file_select != crossing->file_id_1
-						|| mbna_section_select != crossing->section_1)
-					&& (mbna_file_select != crossing->file_id_2
-						|| mbna_section_select != crossing->section_2)))
-				crossing_ok = MB_NO;
-
-			if (crossing_ok == MB_YES)
-				{
-				if (j < 0)
-					j = i;
-				if (k < 0 && i > mbna_current_crossing)
-					k = i;
-				}
-			}
-		if (k >= 0)
-			mbna_current_crossing = k;
-		else if (j >= 0)
-			mbna_current_crossing = j;
-		else
-			mbna_current_crossing = -1;
-		mbna_current_tie = -1;
-   		}
-
-    	/* retrieve crossing parameters */
-    	if (mbna_current_crossing >= 0)
-    		{
-    		crossing = &project.crossings[mbna_current_crossing];
-    		mbna_file_id_1 = crossing->file_id_1;
-    		mbna_section_1 = crossing->section_1;
-     		mbna_file_id_2 = crossing->file_id_2;
-    		mbna_section_2 = crossing->section_2;
-		if (crossing->num_ties > 0)
-		    {
-		    if (mbna_current_tie == -1)
-		    	mbna_current_tie = 0;
-		    tie = &crossing->ties[0];
-		    mbna_snav_1 = tie->snav_1;
-		    mbna_snav_1_time_d = tie->snav_1_time_d;
-		    mbna_snav_2 = tie->snav_2;
-		    mbna_snav_2_time_d = tie->snav_2_time_d;
-		    mbna_offset_x = tie->offset_x;
-		    mbna_offset_y = tie->offset_y;
-		    mbna_offset_z = tie->offset_z_m;
-/* fprintf(stderr,"%s %d: mbna_offset_z:%f\n",__FILE__,__LINE__,mbna_offset_z); */
-
-		    /* reset survey file and section selections */
-		    if (mbna_file_select == crossing->file_id_1)
-			{
-			mbna_section_select = crossing->section_1;
-			}
-		    else if (mbna_file_select == crossing->file_id_2)
-			{
-			mbna_section_select = crossing->section_2;
-			}
-		    else
-			{
-			mbna_file_select = crossing->file_id_1;
-			mbna_survey_select = project.files[crossing->file_id_1].block;
-			mbna_section_select = crossing->section_1;
-			}
-		    }
-		else
-		    {
-		    mbna_current_tie = -1;
-		    }
-  		}
-
-  	/* load the crossing */
-  	if (mbna_current_crossing >= 0)
-  		{
-		/* put up message */
-		sprintf(message,"Loading crossing %d...",mbna_current_crossing);
-		do_message_on(message);
-
-  		mbnavadjust_crossing_load();
-
-		/* turn off message */
-		do_message_off();
-  		}
-
- 	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-
-
-/*--------------------------------------------------------------------*/
-int mbnavadjust_naverr_previous()
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_naverr_previous";
-	int	status = MB_SUCCESS;
-	struct mbna_crossing *crossing;
-	struct mbna_tie *tie;
-	int	crossing_ok;
-	int	i, j, k;
-
- 	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
-
-     	/* find previous current crossing */
-    	if (project.open == MB_YES
-    		&& project.num_crossings > 0)
-    		{
-    		/* get next good crossing */
-		j = -1;
-		k = -1;
-		for (i=0;i<project.num_crossings;i++)
-			{
-			crossing = &(project.crossings[i]);
-			crossing_ok = MB_NO;
-			if (mbna_view_list == MBNA_VIEW_LIST_CROSSINGS)
-				crossing_ok = MB_YES;
-			else if (mbna_view_list == MBNA_VIEW_LIST_MEDIOCRECROSSINGS
-				&& crossing->overlap >= MBNA_MEDIOCREOVERLAP_THRESHOLD)
-				crossing_ok = MB_YES;
-			else if (mbna_view_list == MBNA_VIEW_LIST_GOODCROSSINGS
-				&& crossing->overlap >= MBNA_GOODOVERLAP_THRESHOLD)
-				crossing_ok = MB_YES;
-			else if (mbna_view_list == MBNA_VIEW_LIST_BETTERCROSSINGS
-				&& crossing->overlap >= MBNA_BETTEROVERLAP_THRESHOLD)
-				crossing_ok = MB_YES;
-			else if (mbna_view_list == MBNA_VIEW_LIST_TRUECROSSINGS
-				&& crossing->truecrossing == MB_YES)
-				crossing_ok = MB_YES;
-			else if (mbna_view_list == MBNA_VIEW_LIST_TIES
-				&& crossing->num_ties > 0)
-				crossing_ok = MB_YES;
-			if ((mbna_view_mode == MBNA_VIEW_MODE_SURVEY
-					&& (mbna_survey_select != project.files[crossing->file_id_1].block
-						|| mbna_survey_select != project.files[crossing->file_id_2].block))
-				|| (mbna_view_mode == MBNA_VIEW_MODE_FILE
-					&& (mbna_file_select != crossing->file_id_1
-						|| mbna_file_select != crossing->file_id_2))
-				|| (mbna_view_mode == MBNA_VIEW_MODE_WITHSURVEY
-					&& mbna_survey_select != project.files[crossing->file_id_1].block
-					&& mbna_survey_select != project.files[crossing->file_id_2].block)
-				|| (mbna_view_mode == MBNA_VIEW_MODE_WITHFILE
-					&& mbna_file_select != crossing->file_id_1
-					&& mbna_file_select != crossing->file_id_2)
-				|| (mbna_view_mode == MBNA_VIEW_MODE_WITHSECTION
-					&& (mbna_file_select != crossing->file_id_1
-						|| mbna_section_select != crossing->section_1)
-					&& (mbna_file_select != crossing->file_id_2
-						|| mbna_section_select != crossing->section_2)))
-				crossing_ok = MB_NO;
-
-			if (crossing_ok == MB_YES)
-				{
-				if (i < mbna_current_crossing)
-					j = i;
-				k = i;
-				}
-
-			}
-		if (j >= 0)
-			mbna_current_crossing = j;
-		else if (k >= 0)
-			mbna_current_crossing = k;
-		else
-			mbna_current_crossing = -1;
-		mbna_current_tie = -1;
-   		}
-
-
-    	/* retrieve crossing parameters */
-    	if (mbna_current_crossing >= 0)
-    		{
-    		crossing = &project.crossings[mbna_current_crossing];
-    		mbna_file_id_1 = crossing->file_id_1;
-    		mbna_section_1 = crossing->section_1;
-     		mbna_file_id_2 = crossing->file_id_2;
-    		mbna_section_2 = crossing->section_2;
-		if (crossing->num_ties > 0)
-		    {
-		    if (mbna_current_tie == -1)
-		    	mbna_current_tie = 0;
-		    tie = &crossing->ties[0];
-		    mbna_snav_1 = tie->snav_1;
-		    mbna_snav_1_time_d = tie->snav_1_time_d;
-		    mbna_snav_2 = tie->snav_2;
-		    mbna_snav_2_time_d = tie->snav_2_time_d;
-		    mbna_offset_x = tie->offset_x;
-		    mbna_offset_y = tie->offset_y;
-		    mbna_offset_z = tie->offset_z_m;
-/* fprintf(stderr,"%s %d: mbna_offset_z:%f\n",__FILE__,__LINE__,mbna_offset_z); */
-
-		    /* reset survey file and section selections */
-		    if (mbna_file_select == crossing->file_id_1)
-			{
-			mbna_section_select = crossing->section_1;
-			}
-		    else if (mbna_file_select == crossing->file_id_2)
-			{
-			mbna_section_select = crossing->section_2;
-			}
-		    else
-			{
-			mbna_file_select = crossing->file_id_1;
-			mbna_survey_select = project.files[crossing->file_id_1].block;
-			mbna_section_select = crossing->section_1;
-			}
-		    }
-		else
-		    {
-		    mbna_current_tie = -1;
-		    }
-  		}
-
-  	/* load the crossing */
-  	if (mbna_current_crossing >= 0)
-  		{
-		/* put up message */
-		sprintf(message,"Loading crossing %d...",mbna_current_crossing);
-		do_message_on(message);
-
-  		mbnavadjust_crossing_load();
-
-		/* turn off message */
-		do_message_off();
-  		}
-
- 	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbnavadjust_naverr_nextunset()
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_naverr_nextunset";
-	int	status = MB_SUCCESS;
-	struct mbna_crossing *crossing;
-	struct mbna_tie *tie;
-	int	crossing_ok;
-  	int	i, j, k;
-
- 	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
-
-     	/* find next current unset crossing */
-    	if (project.open == MB_YES
-    		&& project.num_crossings > 0)
-    		{
-    		/* get next good crossing */
-		j = -1;
-		k = -1;
-		for (i=0;i<project.num_crossings;i++)
-			{
-			crossing = &(project.crossings[i]);
-			crossing_ok = MB_NO;
-			if (mbna_view_list == MBNA_VIEW_LIST_CROSSINGS)
-				crossing_ok = MB_YES;
-			else if (mbna_view_list == MBNA_VIEW_LIST_MEDIOCRECROSSINGS
-				&& crossing->overlap >= MBNA_MEDIOCREOVERLAP_THRESHOLD)
-				crossing_ok = MB_YES;
-			else if (mbna_view_list == MBNA_VIEW_LIST_GOODCROSSINGS
-				&& crossing->overlap >= MBNA_GOODOVERLAP_THRESHOLD)
-				crossing_ok = MB_YES;
-			else if (mbna_view_list == MBNA_VIEW_LIST_BETTERCROSSINGS
-				&& crossing->overlap >= MBNA_BETTEROVERLAP_THRESHOLD)
-				crossing_ok = MB_YES;
-			else if (mbna_view_list == MBNA_VIEW_LIST_TRUECROSSINGS
-				&& crossing->truecrossing == MB_YES)
-				crossing_ok = MB_YES;
-			else if (mbna_view_list == MBNA_VIEW_LIST_TIES
-				&& crossing->num_ties > 0)
-				crossing_ok = MB_YES;
-			if ((mbna_view_mode == MBNA_VIEW_MODE_SURVEY
-					&& (mbna_survey_select != project.files[crossing->file_id_1].block
-						|| mbna_survey_select != project.files[crossing->file_id_2].block))
-				|| (mbna_view_mode == MBNA_VIEW_MODE_FILE
-					&& (mbna_file_select != crossing->file_id_1
-						|| mbna_file_select != crossing->file_id_2))
-				|| (mbna_view_mode == MBNA_VIEW_MODE_WITHSURVEY
-					&& mbna_survey_select != project.files[crossing->file_id_1].block
-					&& mbna_survey_select != project.files[crossing->file_id_2].block)
-				|| (mbna_view_mode == MBNA_VIEW_MODE_WITHFILE
-					&& mbna_file_select != crossing->file_id_1
-					&& mbna_file_select != crossing->file_id_2)
-				|| (mbna_view_mode == MBNA_VIEW_MODE_WITHSECTION
-					&& (mbna_file_select != crossing->file_id_1
-						|| mbna_section_select != crossing->section_1)
-					&& (mbna_file_select != crossing->file_id_2
-						|| mbna_section_select != crossing->section_2)))
-				crossing_ok = MB_NO;
-			if (crossing->status != MBNA_CROSSING_STATUS_NONE)
-				crossing_ok = MB_NO;
-
-			if (crossing_ok == MB_YES)
-				{
-				if (j < 0)
-					j = i;
-				if (k < 0 && i > mbna_current_crossing)
-					k = i;
-				}
-			}
-		if (k >= 0)
-			mbna_current_crossing = k;
-		else if (j >= 0)
-			mbna_current_crossing = j;
-		else
-			mbna_current_crossing = -1;
-		mbna_current_tie = -1;
-   		}
-
-    	/* retrieve crossing parameters */
-    	if (mbna_current_crossing >= 0)
-    		{
-    		crossing = &project.crossings[mbna_current_crossing];
-    		mbna_file_id_1 = crossing->file_id_1;
-    		mbna_section_1 = crossing->section_1;
-     		mbna_file_id_2 = crossing->file_id_2;
-    		mbna_section_2 = crossing->section_2;
-		if (crossing->num_ties > 0)
-		    {
-		    mbna_current_tie = 0;
-		    tie = &crossing->ties[0];
-		    mbna_snav_1 = tie->snav_1;
-		    mbna_snav_1_time_d = tie->snav_1_time_d;
-		    mbna_snav_2 = tie->snav_2;
-		    mbna_snav_2_time_d = tie->snav_2_time_d;
-		    mbna_offset_x = tie->offset_x;
-		    mbna_offset_y = tie->offset_y;
-		    mbna_offset_z = tie->offset_z_m;
-/* fprintf(stderr,"%s %d: mbna_offset_z:%f\n",__FILE__,__LINE__,mbna_offset_z); */
-
-		    /* reset survey file and section selections */
-		    if (mbna_file_select == crossing->file_id_1)
-			{
-			mbna_section_select = crossing->section_1;
-			}
-		    else if (mbna_file_select == crossing->file_id_2)
-			{
-			mbna_section_select = crossing->section_2;
-			}
-		    else
-			{
-			mbna_file_select = crossing->file_id_1;
-			mbna_survey_select = project.files[crossing->file_id_1].block;
-			mbna_section_select = crossing->section_1;
-			}
-		    }
-		else
-		    {
-		    mbna_current_tie = -1;
-		    }
-  		}
-
-  	/* load the crossing */
-  	if (mbna_current_crossing >= 0)
-  		{
-		/* put up message */
-		sprintf(message,"Loading crossing %d...",mbna_current_crossing);
-		do_message_on(message);
-
-  		mbnavadjust_crossing_load();
-
-		/* turn off message */
-		do_message_off();
-  		}
-
-	/* else unload previously loaded crossing */
-	else if (mbna_naverr_load == MB_YES)
-		{
-		status = mbnavadjust_crossing_unload();
-		}
-
- 	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbnavadjust_naverr_selecttie()
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_naverr_selecttie";
-	int	status = MB_SUCCESS;
-	struct mbna_crossing *crossing;
-	struct mbna_tie *tie;
-	struct mbna_section *section1, *section2;
-	struct mbna_file *file1, *file2;
-
- 	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
-
-     	/* get current crossing */
-    	if (project.open == MB_YES
-    		&& project.num_crossings > 0)
-    		{
-     		/* retrieve crossing parameters */
-    		if (mbna_current_crossing >= 0
-		    && project.crossings[mbna_current_crossing].num_ties > 0)
-    			{
-			/* select next tie */
-			crossing = &project.crossings[mbna_current_crossing];
-			mbna_current_tie++;
-			if (mbna_current_tie > crossing->num_ties - 1)
-			    mbna_current_tie = 0;
-			tie = &crossing->ties[mbna_current_tie];
-     			mbna_snav_1 = tie->snav_1;
-     			mbna_snav_2 = tie->snav_2;
-     			mbna_snav_1_time_d = tie->snav_1_time_d;
-     			mbna_snav_2_time_d = tie->snav_2_time_d;
-    			mbna_offset_x = tie->offset_x;
-    			mbna_offset_y = tie->offset_y;
-			mbna_offset_z = tie->offset_z_m;
-    			tie->offset_x_m = mbna_offset_x / mbna_mtodeglon;
-    			tie->offset_y_m = mbna_offset_y / mbna_mtodeglat;
- 			file1 = (struct mbna_file *) &project.files[mbna_file_id_1];
-			file2 = (struct mbna_file *) &project.files[mbna_file_id_2];
-			section1 = (struct mbna_section *) &file1->sections[mbna_section_1];
-			section2 = (struct mbna_section *) &file2->sections[mbna_section_2];
-			mbna_invert_offset_x = section2->snav_lon_offset[mbna_snav_2]
-						- section1->snav_lon_offset[mbna_snav_1];
-			mbna_invert_offset_y = section2->snav_lat_offset[mbna_snav_2]
-						- section1->snav_lat_offset[mbna_snav_1];
-			mbna_invert_offset_z = section2->snav_z_offset[mbna_snav_2]
-						- section1->snav_z_offset[mbna_snav_1];
-  			}
-   		}
-
-   	/* set mbna_crossing_select */
-    	if (project.open == MB_YES
-    		&& project.num_crossings > 0
-    		&& mbna_current_crossing >= 0)
-		{
-    		mbna_crossing_select = mbna_current_crossing;
-    		if (mbna_current_tie >= 0)
-		    mbna_tie_select = mbna_current_tie;
-		else
-    		    mbna_tie_select = MBNA_SELECT_NONE;
-		}
-    	else
-		{
-    		mbna_crossing_select = MBNA_SELECT_NONE;
-    		mbna_tie_select = MBNA_SELECT_NONE;
-		}
-
- 	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbnavadjust_naverr_addtie()
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_naverr_addtie";
-	int	status = MB_SUCCESS;
-	struct mbna_crossing *crossing;
-	struct mbna_tie *tie;
-	struct mbna_section *section1, *section2;
-	struct mbna_file *file1, *file2;
-	int	found;
-	int	ix, iy;
-   	int	i;
-
- 	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
-
-     	/* get current crossing */
-    	if (project.open == MB_YES
-    		&& project.num_crossings > 0)
-    		{
-     		/* retrieve crossing parameters */
-    		if (mbna_current_crossing >= 0
-		    && project.crossings[mbna_current_crossing].num_ties < MBNA_SNAV_NUM)
-    			{
-			/* add tie and set number */
-    			crossing = &project.crossings[mbna_current_crossing];
-			file1 = (struct mbna_file *) &project.files[mbna_file_id_1];
-			file2 = (struct mbna_file *) &project.files[mbna_file_id_2];
-			section1 = (struct mbna_section *) &file1->sections[mbna_section_1];
-			section2 = (struct mbna_section *) &file2->sections[mbna_section_2];
-			mbna_current_tie = crossing->num_ties;
-			crossing->num_ties++;
-			project.num_ties++;
-    			tie = &crossing->ties[mbna_current_tie];
-
-			if (crossing->status == MBNA_CROSSING_STATUS_NONE)
-				{
-				project.num_crossings_analyzed++;
-				if (crossing->truecrossing == MB_YES)
- 					project.num_truecrossings_analyzed++;
-				}
-    			crossing->status = MBNA_CROSSING_STATUS_SET;
-
-			/* look for unused pair of nav points */
-     			tie->snav_1 = -1;
-			found = MB_NO;
-			while (found == MB_NO)
-			    {
-			    found = MB_YES;
-			    tie->snav_1++;
-			    for (i=0;i<crossing->num_ties-1;i++)
-				{
-				if (crossing->ties[i].snav_1 == tie->snav_1)
-				    found = MB_NO;
-				}
-			    }
-     			tie->snav_2 = -1;
-			found = MB_NO;
-			while (found == MB_NO)
-			    {
-			    found = MB_YES;
-			    tie->snav_2++;
-			    for (i=0;i<crossing->num_ties-1;i++)
-				{
-				if (crossing->ties[i].snav_2 == tie->snav_2)
-				    found = MB_NO;
-				}
-			    }
-
-			/* get rest of tie parameters */
-			tie->status = MBNA_TIE_XYZ;
-			tie->snav_1_time_d = section1->snav_time_d[tie->snav_1];
-			tie->snav_2_time_d = section2->snav_time_d[tie->snav_2];
-     			mbna_snav_1 = tie->snav_1;
-     			mbna_snav_2 = tie->snav_2;
-     			mbna_snav_1_time_d = tie->snav_1_time_d;
-     			mbna_snav_2_time_d = tie->snav_2_time_d;
-    			tie->offset_x = mbna_offset_x;
-    			tie->offset_y = mbna_offset_y;
-    			tie->offset_x_m = mbna_offset_x / mbna_mtodeglon;
-    			tie->offset_y_m = mbna_offset_y / mbna_mtodeglat;
-    			tie->offset_z_m = mbna_offset_z;
-			tie->sigmar1 = mbna_minmisfit_sr1;
-			tie->sigmar2 = mbna_minmisfit_sr2;
-			tie->sigmar3 = mbna_minmisfit_sr3;
-			for (i=0;i<3;i++)
-				{
-				tie->sigmax1[i] = mbna_minmisfit_sx1[i];
-				tie->sigmax2[i] = mbna_minmisfit_sx2[i];
-				tie->sigmax3[i] = mbna_minmisfit_sx3[i];
-				}
-			if (tie->sigmar1 < MBNA_SMALL)
-				{
-				tie->sigmar1 = 100.0;
-				tie->sigmax1[0] = 1.0;
-				tie->sigmax1[1] = 0.0;
-				tie->sigmax1[2] = 0.0;
-				}
-			if (tie->sigmar2 < MBNA_SMALL)
-				{
-				tie->sigmar2 = 100.0;
-				tie->sigmax2[0] = 0.0;
-				tie->sigmax2[1] = 1.0;
-				tie->sigmax2[2] = 0.0;
-				}
-			if (tie->sigmar3 < MBNA_SMALL)
-				{
-				tie->sigmar3 = 100.0;
-				tie->sigmax3[0] = 0.0;
-				tie->sigmax3[1] = 0.0;
-				tie->sigmax3[2] = 1.0;
-				}
-
-			file1 = (struct mbna_file *) &project.files[mbna_file_id_1];
-			file2 = (struct mbna_file *) &project.files[mbna_file_id_2];
-			section1 = (struct mbna_section *) &file1->sections[mbna_section_1];
-			section2 = (struct mbna_section *) &file2->sections[mbna_section_2];
-			mbna_invert_offset_x = section2->snav_lon_offset[mbna_snav_2]
-						- section1->snav_lon_offset[mbna_snav_1];
-			mbna_invert_offset_y = section2->snav_lat_offset[mbna_snav_2]
-						- section1->snav_lat_offset[mbna_snav_1];
-			mbna_invert_offset_z = section2->snav_z_offset[mbna_snav_2]
-						- section1->snav_z_offset[mbna_snav_1];
-			tie->inversion_status = MBNA_INVERSION_NONE;
-    			tie->inversion_offset_x = mbna_invert_offset_x;
-    			tie->inversion_offset_y = mbna_invert_offset_y;
-    			tie->inversion_offset_x_m = mbna_invert_offset_x / mbna_mtodeglon;
-    			tie->inversion_offset_y_m = mbna_invert_offset_y / mbna_mtodeglat;
-    			tie->inversion_offset_z_m = mbna_invert_offset_z;
-   			if (project.inversion == MBNA_INVERSION_CURRENT)
-    				project.inversion = MBNA_INVERSION_OLD;
-
-			/* now put tie in center of plot */
-			ix = (int)(0.5 * (mbna_plot_lon_max - mbna_plot_lon_min)
-					* mbna_plotx_scale);
-			iy = (int)(cont_borders[3]
-					- (0.5 * (mbna_plot_lat_max - mbna_plot_lat_min)
-						* mbna_ploty_scale));
-			mbnavadjust_naverr_snavpoints(ix, iy);
-     			tie->snav_1 = mbna_snav_1;
-     			tie->snav_2 = mbna_snav_2;
-     			tie->snav_1_time_d = mbna_snav_1_time_d;
-     			tie->snav_2_time_d = mbna_snav_2_time_d;
-
-			/* reset tie counts for snavs */
-			section1->snav_num_ties[tie->snav_1]++;
-			section2->snav_num_ties[tie->snav_2]++;
-
-			/* write updated project */
-			mbnavadjust_write_project();
-
-			/* add info text */
-			sprintf(message,"Add Tie Point %d of Crossing %d\n > Nav points: %d:%d:%d %d:%d:%d\n > Offsets: %f %f %f m\n",
-				mbna_current_tie, mbna_current_crossing,
-				crossing->file_id_1, crossing->section_1, tie->snav_1,
-				crossing->file_id_2, crossing->section_2, tie->snav_2,
-				tie->offset_x_m, tie->offset_y_m, tie->offset_z_m);
-			if (mbna_verbose == 0)
-				fprintf(stderr,"%s",message);
-			do_info_add(message, MB_YES);
-
- 			/* print output debug statements */
-			if (mbna_verbose >= 2)
-				{
-				fprintf(stderr,"\ndbg2  snav point selected in MBnavadjust function <%s>\n",
-					function_name);
-				fprintf(stderr,"dbg2  snav values:\n");
-				fprintf(stderr,"dbg2       mbna_snav_1:        %d\n",mbna_snav_1);
-				fprintf(stderr,"dbg2       mbna_snav_1_time_d: %f\n",mbna_snav_1_time_d);
-				fprintf(stderr,"dbg2       mbna_snav_1_lon:    %f\n",mbna_snav_1_lon);
-				fprintf(stderr,"dbg2       mbna_snav_1_lat:    %f\n",mbna_snav_1_lat);
-				fprintf(stderr,"dbg2       section1->num_snav:  %d\n",section1->num_snav);
-				for (i=0;i<section1->num_snav;i++)
-					{
-					fprintf(stderr,"dbg2       section1->snav_time_d[%d]: %f\n",i,section1->snav_time_d[i]);
-					fprintf(stderr,"dbg2       section1->snav_lon[%d]:    %.10f\n",i,section1->snav_lon[i]);
-					fprintf(stderr,"dbg2       section1->snav_lat[%d]:    %.10f\n",i,section1->snav_lat[i]);
-					}
-				fprintf(stderr,"dbg2       mbna_snav_2:        %d\n",mbna_snav_2);
-				fprintf(stderr,"dbg2       mbna_snav_2_time_d: %f\n",mbna_snav_2_time_d);
-				fprintf(stderr,"dbg2       mbna_snav_2_lon:    %.10f\n",mbna_snav_2_lon);
-				fprintf(stderr,"dbg2       mbna_snav_2_lat:    %.10f\n",mbna_snav_2_lat);
-				fprintf(stderr,"dbg2       section2->num_snav:  %d\n",section2->num_snav);
-				for (i=0;i<section2->num_snav;i++)
-					{
-					fprintf(stderr,"dbg2       section2->snav_time_d[%d]: %f\n",i,section2->snav_time_d[i]);
-					fprintf(stderr,"dbg2       section2->snav_lon[%d]:    %.10f\n",i,section2->snav_lon[i]);
-					fprintf(stderr,"dbg2       section2->snav_lat[%d]:    %.10f\n",i,section2->snav_lat[i]);
-					}
-				}
-  			}
-   		}
-
-   	/* set mbna_crossing_select */
-    	if (project.open == MB_YES
-    		&& project.num_crossings > 0
-    		&& mbna_current_crossing >= 0)
-		{
-    		mbna_crossing_select = mbna_current_crossing;
-    		if (mbna_current_tie >= 0)
-		    mbna_tie_select = mbna_current_tie;
-		else
-    		    mbna_tie_select = MBNA_SELECT_NONE;
-		}
-    	else
-		{
-    		mbna_crossing_select = MBNA_SELECT_NONE;
-    		mbna_tie_select = MBNA_SELECT_NONE;
-		}
-
- 	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbnavadjust_naverr_deletetie()
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_naverr_deletetie";
-	int	status = MB_SUCCESS;
-
- 	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
-
-     	/* get current crossing */
-    	if (project.open == MB_YES
-    		&& project.num_crossings > 0)
-    		{
-     		/* retrieve crossing parameters */
-    		if (mbna_current_crossing >= 0
-		    && mbna_current_tie >= 0)
-    			{
-			/* delete the tie */
-			mbnavadjust_deletetie(mbna_current_crossing, mbna_current_tie, MBNA_CROSSING_STATUS_SKIP);
-
-			/* write updated project */
-			mbnavadjust_write_project();
-  			}
-   		}
-
-   	/* set mbna_crossing_select */
-    	if (project.open == MB_YES
-    		&& project.num_crossings > 0
-    		&& mbna_current_crossing >= 0)
-		{
-    		mbna_crossing_select = mbna_current_crossing;
-    		if (mbna_current_tie >= 0)
-		    mbna_tie_select = mbna_current_tie;
-		else
-    		    mbna_tie_select = MBNA_SELECT_NONE;
-		}
-    	else
-		{
-    		mbna_crossing_select = MBNA_SELECT_NONE;
-    		mbna_tie_select = MBNA_SELECT_NONE;
-		}
-
- 	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbnavadjust_deletetie(int icrossing, int jtie, int delete_status)
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_deletetie";
-	int	status = MB_SUCCESS;
-	struct mbna_crossing *crossing;
-	struct mbna_tie *tie;
-	struct mbna_section *section1, *section2;
-	struct mbna_file *file1, *file2;
-   	int	i;
-
- 	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2       icrossing:     %d\n",icrossing);
-		fprintf(stderr,"dbg2       jtie:          %d\n",jtie);
-		fprintf(stderr,"dbg2       delete_status: %d\n",delete_status);
-		}
-
-     	/* get current crossing */
-    	if (project.open == MB_YES
-		&& icrossing >= 0
-		&& jtie >= 0)
-    		{
-     		/* retrieve crossing parameters */
-    		if (project.num_crossings > icrossing
-			&& project.crossings[icrossing].num_ties > jtie)
-    			{
-			/* add info text */
-    			crossing = &project.crossings[icrossing];
-    			tie = &crossing->ties[jtie];
-			if (delete_status == MBNA_CROSSING_STATUS_SKIP)
-			    sprintf(message,"Delete Tie Point %d of Crossing %d\n > Nav points: %d:%d:%d %d:%d:%d\n > Offsets: %f %f %f m\n",
-				jtie, icrossing,
-				crossing->file_id_1, crossing->section_1, tie->snav_1,
-				crossing->file_id_2, crossing->section_2, tie->snav_2,
-				tie->offset_x_m, tie->offset_y_m, tie->offset_z_m);
-			else
-			    sprintf(message,"Clear Tie Point %d of Crossing %d\n > Nav points: %d:%d:%d %d:%d:%d\n > Offsets: %f %f %f m\n",
-				jtie, icrossing,
-				crossing->file_id_1, crossing->section_1, tie->snav_1,
-				crossing->file_id_2, crossing->section_2, tie->snav_2,
-				tie->offset_x_m, tie->offset_y_m, tie->offset_z_m);
-			if (mbna_verbose == 0)
-				fprintf(stderr,"%s",message);
-			do_info_add(message, MB_YES);
-
-			/* reset tie counts for snavs */
-			file1 = &project.files[crossing->file_id_1];
-			section1 = &file1->sections[crossing->section_1];
-			section1->snav_num_ties[tie->snav_1]--;
-			file2 = &project.files[crossing->file_id_2];
-			section2 = &file2->sections[crossing->section_2];
-			section2->snav_num_ties[tie->snav_2]--;
-
-			/* delete tie and set number */
-			for (i=mbna_current_tie;i<crossing->num_ties-1;i++)
-			    {
-			    crossing->ties[i].snav_1 = crossing->ties[i+1].snav_1;
-			    crossing->ties[i].snav_1_time_d = crossing->ties[i+1].snav_1_time_d;
-			    crossing->ties[i].snav_2 = crossing->ties[i+1].snav_2;
-			    crossing->ties[i].snav_2_time_d = crossing->ties[i+1].snav_2_time_d;
-			    crossing->ties[i].offset_x = crossing->ties[i+1].offset_x;
-			    crossing->ties[i].offset_y = crossing->ties[i+1].offset_y;
-			    crossing->ties[i].offset_x_m = crossing->ties[i+1].offset_x_m;
-			    crossing->ties[i].offset_y_m = crossing->ties[i+1].offset_y_m;
-			    crossing->ties[i].offset_z_m = crossing->ties[i+1].offset_z_m;
-			    }
-			crossing->num_ties--;
-			project.num_ties--;
-			if (mbna_current_tie > crossing->num_ties -1)
-			     mbna_current_tie--;
-
-			/* set tie parameters */
-			if (crossing->num_ties <= 0)
-			    {
-			    crossing->num_ties = 0;
-    			    crossing->status = delete_status;
-			    }
-			else if (mbna_current_tie >= 0)
-			    {
-    			    tie = &crossing->ties[mbna_current_tie];
-     			    mbna_snav_1 = tie->snav_1;
-     			    mbna_snav_1_time_d = tie->snav_1_time_d;
-			    mbna_snav_2 = tie->snav_2;
-     			    mbna_snav_2_time_d = tie->snav_2_time_d;
-			    mbna_offset_x = tie->offset_x;
-			    mbna_offset_y = tie->offset_y;
-			    mbna_offset_z = tie->offset_z_m;
-/* fprintf(stderr,"%s %d: mbna_offset_z:%f\n",__FILE__,__LINE__,mbna_offset_z); */
-			    file1 = (struct mbna_file *) &project.files[mbna_file_id_1];
-			    file2 = (struct mbna_file *) &project.files[mbna_file_id_2];
-			    section1 = (struct mbna_section *) &file1->sections[mbna_section_1];
-			    section2 = (struct mbna_section *) &file2->sections[mbna_section_2];
-			    mbna_invert_offset_x = section2->snav_lon_offset[mbna_snav_2]
-						    - section1->snav_lon_offset[mbna_snav_1];
-			    mbna_invert_offset_y = section2->snav_lat_offset[mbna_snav_2]
-						    - section1->snav_lat_offset[mbna_snav_1];
-			    mbna_invert_offset_z = section2->snav_z_offset[mbna_snav_2]
-						    - section1->snav_z_offset[mbna_snav_1];
-			    }
-   			if (project.inversion == MBNA_INVERSION_CURRENT)
-    				project.inversion = MBNA_INVERSION_OLD;
-  			}
-   		}
-
- 	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbnavadjust_naverr_resettie()
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_naverr_resettie";
-	int	status = MB_SUCCESS;
-	struct mbna_file *file1, *file2;
-	struct mbna_section *section1, *section2;
-	struct mbna_crossing *crossing;
-	struct mbna_tie *tie;
-	int	i;
-
- 	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
-
-     	/* get current crossing */
-    	if (project.open == MB_YES
-    		&& project.num_crossings > 0)
-    		{
-     		/* retrieve crossing parameters */
-    		if (mbna_current_crossing >= 0
-		    && mbna_current_tie >= 0)
-    			{
-			/* reset tie */
-			file1 = (struct mbna_file *) &project.files[mbna_file_id_1];
-			file2 = (struct mbna_file *) &project.files[mbna_file_id_2];
-			section1 = (struct mbna_section *) &file1->sections[mbna_section_1];
-			section2 = (struct mbna_section *) &file2->sections[mbna_section_2];
-    			crossing = &project.crossings[mbna_current_crossing];
-    			tie = &crossing->ties[mbna_current_tie];
-			mbna_snav_1 = tie->snav_1;
-			mbna_snav_1_time_d = tie->snav_1_time_d;
-			mbna_snav_1_lon = section1->snav_lon[mbna_snav_1];
-			mbna_snav_1_lat = section1->snav_lat[mbna_snav_1];
-			mbna_snav_2 = tie->snav_2;
-			mbna_snav_2_time_d = tie->snav_2_time_d;
-			mbna_snav_2_lon = section2->snav_lon[mbna_snav_2];
-			mbna_snav_2_lat = section2->snav_lat[mbna_snav_2];
-			mbna_offset_x = tie->offset_x;
-			mbna_offset_y = tie->offset_y;
-			mbna_offset_z = tie->offset_z_m;
-/* fprintf(stderr,"%s %d: mbna_offset_z:%f\n",__FILE__,__LINE__,mbna_offset_z); */
-			mbna_minmisfit_sr1 = tie->sigmar1;
-			mbna_minmisfit_sr2 = tie->sigmar2;
-			mbna_minmisfit_sr3 = tie->sigmar3;
-			for (i=0;i<3;i++)
-				{
-				mbna_minmisfit_sx1[i] = tie->sigmax1[i];
-				mbna_minmisfit_sx2[i] = tie->sigmax2[i];
-				mbna_minmisfit_sx3[i] = tie->sigmax3[i];
-				}
-  			}
-   		}
-
-   	/* set mbna_crossing_select */
-    	if (project.open == MB_YES
-    		&& project.num_crossings > 0
-    		&& mbna_current_crossing >= 0)
-		{
-    		mbna_crossing_select = mbna_current_crossing;
-    		if (mbna_current_tie >= 0)
-		    mbna_tie_select = mbna_current_tie;
-		else
-    		    mbna_tie_select = MBNA_SELECT_NONE;
-		}
-    	else
-		{
-    		mbna_crossing_select = MBNA_SELECT_NONE;
-    		mbna_tie_select = MBNA_SELECT_NONE;
-		}
-
- 	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbnavadjust_naverr_checkoksettie()
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_naverr_checkoksettie";
-	int	status = MB_SUCCESS;
-	struct mbna_crossing *crossing;
-	struct mbna_tie *tie;
-
- 	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
-
-	/* check for changed offsets */
-    	mbna_allow_set_tie = MB_NO;
-    	if (mbna_current_crossing >= 0
-		&& mbna_current_tie >= 0)
-	    {
-    	    crossing = &project.crossings[mbna_current_crossing];
-	    tie = &crossing->ties[mbna_current_tie];
-	    if (tie->snav_1 != mbna_snav_1
-		|| tie->snav_2 != mbna_snav_2
-		|| tie->offset_x != mbna_offset_x
-		|| tie->offset_y != mbna_offset_y
-		|| tie->offset_z_m != mbna_offset_z)
-		{
-		mbna_allow_set_tie = MB_YES;
-		}
-
-	    /* also check for unset sigma values */
-	    if (tie->sigmar1 == 100.0
-	    	&& tie->sigmar2 == 100.0
-	    	&& tie->sigmar3 == 100.0)
-		{
-		mbna_allow_set_tie = MB_YES;
-		}
-	    }
-
- 	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbnavadjust_naverr_skip()
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_naverr_skip";
-	int	status = MB_SUCCESS;
-	struct mbna_crossing *crossing;
-
- 	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
-
-     	/* get current crossing */
-    	if (project.open == MB_YES
-    		&& project.num_crossings > 0)
-    		{
-     		/* retrieve crossing parameters */
-    		if (mbna_current_crossing >= 0)
-    			{
-    			crossing = &project.crossings[mbna_current_crossing];
-			project.num_ties -= crossing->num_ties;
-			crossing->num_ties = 0;
-			if (crossing->status == MBNA_CROSSING_STATUS_NONE)
-				{
-				project.num_crossings_analyzed++;
-				if (crossing->truecrossing == MB_YES)
- 					project.num_truecrossings_analyzed++;
-				}
-    			crossing->status = MBNA_CROSSING_STATUS_SKIP;
-   			if (project.inversion == MBNA_INVERSION_CURRENT)
-    				project.inversion = MBNA_INVERSION_OLD;
-
-			/* write updated project */
-			mbnavadjust_write_project();
-
-			/* add info text */
-			sprintf(message,"Set crossing %d to be ignored\n",
-				mbna_current_crossing);
-			if (mbna_verbose == 0)
-				fprintf(stderr,"%s",message);
-			do_info_add(message, MB_YES);
-  			}
-   		}
-
-   	/* set mbna_crossing_select */
-    	if (project.open == MB_YES
-    		&& project.num_crossings > 0
-    		&& mbna_current_crossing >= 0)
-		{
-    		mbna_crossing_select = mbna_current_crossing;
-    		if (mbna_current_tie >= 0)
-		    mbna_tie_select = mbna_current_tie;
-		else
-    		    mbna_tie_select = MBNA_SELECT_NONE;
-		}
-    	else
-		{
-    		mbna_crossing_select = MBNA_SELECT_NONE;
-    		mbna_tie_select = MBNA_SELECT_NONE;
-		}
-
- 	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbnavadjust_naverr_unset()
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_naverr_skip";
-	int	status = MB_SUCCESS;
-	struct mbna_crossing *crossing;
-
- 	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
-
-     	/* get current crossing */
-    	if (project.open == MB_YES
-    		&& project.num_crossings > 0)
-    		{
-     		/* retrieve crossing parameters */
-    		if (mbna_current_crossing >= 0)
-    			{
-    			crossing = &project.crossings[mbna_current_crossing];
-			project.num_ties -= crossing->num_ties;
-			crossing->num_ties = 0;
-			if (crossing->status != MBNA_CROSSING_STATUS_NONE)
-				{
-				project.num_crossings_analyzed--;
-				if (crossing->truecrossing == MB_YES)
- 					project.num_truecrossings_analyzed--;
-				}
-    			crossing->status = MBNA_CROSSING_STATUS_NONE;
-   			if (project.inversion == MBNA_INVERSION_CURRENT)
-    				project.inversion = MBNA_INVERSION_OLD;
-
-			/* write updated project */
-			mbnavadjust_write_project();
-
-			/* add info text */
-			sprintf(message,"Unset crossing %d\n",
-				mbna_current_crossing);
-			if (mbna_verbose == 0)
-				fprintf(stderr,"%s",message);
-			do_info_add(message, MB_YES);
-  			}
-   		}
-
-   	/* set mbna_crossing_select */
-    	if (project.open == MB_YES
-    		&& project.num_crossings > 0
-    		&& mbna_current_crossing >= 0)
-		{
-    		mbna_crossing_select = mbna_current_crossing;
-    		if (mbna_current_tie >= 0)
-		    mbna_tie_select = mbna_current_tie;
-		else
-    		    mbna_tie_select = MBNA_SELECT_NONE;
-		}
-    	else
-		{
-    		mbna_crossing_select = MBNA_SELECT_NONE;
-    		mbna_tie_select = MBNA_SELECT_NONE;
-		}
-
- 	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbnavadjust_crossing_load()
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_crossing_load";
-	int	status = MB_SUCCESS;
-	struct mbna_crossing *crossing;
-	struct mbna_tie *tie;
-	struct mbna_file *file1, *file2;
-	struct mbna_section *section1, *section2;
-
- 	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
-
-	/* unload loaded crossing */
-	if (mbna_naverr_load == MB_YES)
-		{
-		status = mbnavadjust_crossing_unload();
-		}
-
-     	/* load current crossing */
-    	if ((mbna_status == MBNA_STATUS_NAVERR || mbna_status == MBNA_STATUS_AUTOPICK)
-		&& project.open == MB_YES
-    		&& project.num_crossings > 0
-    		&& mbna_current_crossing >= 0)
-    		{
-		/* put up message */
-		sprintf(message,"Loading crossing %d...",mbna_current_crossing);
-		do_message_update(message);
-
-    		/* retrieve crossing parameters */
-		crossing = &project.crossings[mbna_current_crossing];
-		mbna_file_id_1 = crossing->file_id_1;
-		mbna_section_1 = crossing->section_1;
-		mbna_file_id_2 = crossing->file_id_2;
-		mbna_section_2 = crossing->section_2;
-		file1 = (struct mbna_file *) &project.files[mbna_file_id_1];
-		file2 = (struct mbna_file *) &project.files[mbna_file_id_2];
-		section1 = (struct mbna_section *) &file1->sections[mbna_section_1];
-		section2 = (struct mbna_section *) &file2->sections[mbna_section_2];
-		if (crossing->num_ties > 0 && mbna_current_tie >= 0)
-		    {
-		    /* get basic crossing parameters */
-		    tie = &crossing->ties[mbna_current_tie];
-		    mbna_snav_1 = tie->snav_1;
-		    mbna_snav_1_time_d = tie->snav_1_time_d;
-		    mbna_snav_1_lon = section1->snav_lon[mbna_snav_1];
-		    mbna_snav_1_lat = section1->snav_lat[mbna_snav_1];
-		    mbna_snav_2 = tie->snav_2;
-		    mbna_snav_2_time_d = tie->snav_2_time_d;
-		    mbna_snav_2_lon = section2->snav_lon[mbna_snav_2];
-		    mbna_snav_2_lat = section2->snav_lat[mbna_snav_2];
-		    mbna_offset_x = tie->offset_x;
-		    mbna_offset_y = tie->offset_y;
-		    mbna_offset_z = tie->offset_z_m;
-/* fprintf(stderr,"%s %d: mbna_offset_z:%f\n",__FILE__,__LINE__,mbna_offset_z); */
-		    file1 = (struct mbna_file *) &project.files[mbna_file_id_1];
-		    file2 = (struct mbna_file *) &project.files[mbna_file_id_2];
-		    section1 = (struct mbna_section *) &file1->sections[mbna_section_1];
-		    section2 = (struct mbna_section *) &file2->sections[mbna_section_2];
-		    mbna_invert_offset_x = section2->snav_lon_offset[mbna_snav_2]
-					    - section1->snav_lon_offset[mbna_snav_1];
-		    mbna_invert_offset_y = section2->snav_lat_offset[mbna_snav_2]
-					    - section1->snav_lat_offset[mbna_snav_1];
-		    mbna_invert_offset_z = section2->snav_z_offset[mbna_snav_2]
-					    - section1->snav_z_offset[mbna_snav_1];
-		    }
-		else if (project.inversion != MBNA_INVERSION_NONE)
-	    	    {
-		    mbna_invert_offset_x = section2->snav_lon_offset[mbna_snav_2]
-					    - section1->snav_lon_offset[mbna_snav_1];
-		    mbna_invert_offset_y = section2->snav_lat_offset[mbna_snav_2]
-					    - section1->snav_lat_offset[mbna_snav_1];
-		    mbna_invert_offset_z = section2->snav_z_offset[mbna_snav_2]
-					    - section1->snav_z_offset[mbna_snav_1];
-		    mbna_offset_x = mbna_invert_offset_x;
-		    mbna_offset_y = mbna_invert_offset_y;
-		    mbna_offset_z = mbna_invert_offset_z;
-/* fprintf(stderr,"%s %d: mbna_offset_z:%f\n",__FILE__,__LINE__,mbna_offset_z); */
-		    }
-		else
-		    {
-		    mbna_offset_x = 0.0;
-		    mbna_offset_y = 0.0;
-		    mbna_offset_z = 0.0;
-/* fprintf(stderr,"%s %d: mbna_offset_z:%f\n",__FILE__,__LINE__,mbna_offset_z); */
-		    }
-		mbna_lon_min = MIN(section1->lonmin,section2->lonmin + mbna_offset_x);
-		mbna_lon_max = MAX(section1->lonmax,section2->lonmax + mbna_offset_x);
-		mbna_lat_min = MIN(section1->latmin,section2->latmin + mbna_offset_y);
-		mbna_lat_max = MAX(section1->latmax,section2->latmax + mbna_offset_y);
-		mbna_plot_lon_min = mbna_lon_min;
-		mbna_plot_lon_max = mbna_lon_max;
-		mbna_plot_lat_min = mbna_lat_min;
-		mbna_plot_lat_max = mbna_lat_max;
-		mb_coor_scale(mbna_verbose,0.5 * (mbna_lat_min + mbna_lat_max),
-				&mbna_mtodeglon,&mbna_mtodeglat);
-
-		/* load sections */
-		sprintf(message,"Loading section 1 of crossing %d...",mbna_current_crossing);
-		do_message_update(message);
-		status = mbnavadjust_section_load(mbna_file_id_1, mbna_section_1, (void **) &swathraw1, (void **) &swath1, section1->num_pings);
-		sprintf(message,"Loading section 2 of crossing %d...",mbna_current_crossing);
-		do_message_update(message);
-		status = mbnavadjust_section_load(mbna_file_id_2, mbna_section_2, (void **) &swathraw2, (void **) &swath2, section2->num_pings);
-
-		/* get lon lat positions for soundings */
-		sprintf(message,"Transforming section 1 of crossing %d...",mbna_current_crossing);
-		do_message_update(message);
-		status = mbnavadjust_section_translate(mbna_file_id_1, swathraw1, swath1, 0.0);
-		sprintf(message,"Transforming section 2 of crossing %d...",mbna_current_crossing);
-		do_message_update(message);
-		status = mbnavadjust_section_translate(mbna_file_id_2, swathraw2, swath2, mbna_offset_z);
-
-		/* generate contour data */
-		if (mbna_status != MBNA_STATUS_AUTOPICK)
-			{
-			sprintf(message,"Contouring section 1 of crossing %d...",mbna_current_crossing);
-			do_message_update(message);
-			status = mbnavadjust_section_contour(mbna_file_id_1,mbna_section_1,swath1,&mbna_contour1);
-			sprintf(message,"Contouring section 2 of crossing %d...",mbna_current_crossing);
-			do_message_update(message);
-			status = mbnavadjust_section_contour(mbna_file_id_2,mbna_section_2,swath2,&mbna_contour2);
-			}
-
-		/* set loaded flag */
-		mbna_naverr_load = MB_YES;
-
-		/* generate misfit grids */
-		sprintf(message,"Getting misfit for crossing %d...",mbna_current_crossing);
-		do_message_update(message);
-		status = mbnavadjust_get_misfit();
-
-		/* get overlap region */
-		mbnavadjust_crossing_overlap(mbna_current_crossing);
-  		}
-
-   	/* set mbna_crossing_select */
-    	if (project.open == MB_YES
-    		&& project.num_crossings > 0
-    		&& mbna_current_crossing >= 0)
-		{
-    		mbna_crossing_select = mbna_current_crossing;
-    		if (mbna_current_tie >= 0)
-		    mbna_tie_select = mbna_current_tie;
-		else
-    		    mbna_tie_select = MBNA_SELECT_NONE;
-		}
-    	else
-		{
-    		mbna_crossing_select = MBNA_SELECT_NONE;
-    		mbna_tie_select = MBNA_SELECT_NONE;
-		}
-
- 	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbnavadjust_crossing_unload()
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_crossing_unload";
-	int	status = MB_SUCCESS;
-	struct pingraw *pingraw;
-   	int	i;
-
- 	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
-
-	/* unload loaded crossing */
-	if (mbna_naverr_load == MB_YES)
-		{
-		/* free raw swath data */
-		if (swathraw1 != NULL && swathraw1->pingraws != NULL)
-		    {
-		    for (i=0;i<swathraw1->npings_max;i++)
-			{
-			pingraw = &swathraw1->pingraws[i];
-			status = mb_freed(mbna_verbose,__FILE__,__LINE__,(void **)&pingraw->beamflag, &error);
-			status = mb_freed(mbna_verbose,__FILE__,__LINE__,(void **)&pingraw->bath, &error);
-			status = mb_freed(mbna_verbose,__FILE__,__LINE__,(void **)&pingraw->bathacrosstrack, &error);
-			status = mb_freed(mbna_verbose,__FILE__,__LINE__,(void **)&pingraw->bathalongtrack, &error);
-			}
-		    status = mb_freed(mbna_verbose,__FILE__,__LINE__,(void **)&swathraw1->pingraws, &error);
-		    }
-		if (swathraw2 != NULL && swathraw2->pingraws != NULL)
-		    {
-		    for (i=0;i<swathraw2->npings_max;i++)
-			{
-			pingraw = &swathraw2->pingraws[i];
-			status = mb_freed(mbna_verbose,__FILE__,__LINE__,(void **)&pingraw->beamflag, &error);
-			status = mb_freed(mbna_verbose,__FILE__,__LINE__,(void **)&pingraw->bath, &error);
-			status = mb_freed(mbna_verbose,__FILE__,__LINE__,(void **)&pingraw->bathacrosstrack, &error);
-			status = mb_freed(mbna_verbose,__FILE__,__LINE__,(void **)&pingraw->bathalongtrack, &error);
-			}
-		    status = mb_freed(mbna_verbose,__FILE__,__LINE__,(void **)&swathraw2->pingraws, &error);
-		    }
-		if (swathraw1 != NULL)
-		    status = mb_freed(mbna_verbose,__FILE__,__LINE__,(void **)&swathraw1, &error);
-		if (swathraw2 != NULL)
-		    status = mb_freed(mbna_verbose,__FILE__,__LINE__,(void **)&swathraw2, &error);
-
-		/* free contours */
-		status = mb_contour_deall(mbna_verbose,swath1,&error);
-		status = mb_contour_deall(mbna_verbose,swath2,&error);
-		if (mbna_contour1.vector != NULL
-			&& mbna_contour1.nvector_alloc > 0)
-		    {
-		    free(mbna_contour1.vector);
-		    }
-		if (mbna_contour2.vector != NULL
-			&& mbna_contour2.nvector_alloc > 0)
-		    {
-		    free(mbna_contour2.vector);
-		    }
-		mbna_contour1.vector = NULL;
-		mbna_contour1.nvector = 0;
-		mbna_contour1.nvector_alloc = 0;
-		mbna_contour2.vector = NULL;
-		mbna_contour2.nvector = 0;
-		mbna_contour2.nvector_alloc = 0;
-		mbna_naverr_load = MB_NO;
-		grid_nx = 0;
-		grid_ny = 0;
-		grid_nxy = 0;
-		grid_nxyzeq = 0;
-		gridm_nx = 0;
-		gridm_ny = 0;
-		gridm_nxyz = 0;
-		if (grid1 != NULL)
-		    {
-		    free(grid1);
-		    }
-		if (grid2 != NULL)
-		    {
-		    free(grid2);
-		    }
-		if (gridm != NULL)
-		    {
-		    free(gridm);
-		    }
-		if (gridmeq != NULL)
-		    {
-		    free(gridmeq);
-		    }
-		if (gridn1 != NULL)
-		    {
-		    free(gridn1);
-		    }
-		if (gridn2 != NULL)
-		    {
-		    free(gridn2);
-		    }
-		if (gridnm != NULL)
-		    {
-		    free(gridnm);
-		    }
-		grid1 = NULL;
-		grid2 = NULL;
-		gridm = NULL;
-		gridmeq = NULL;
-		gridn1 = NULL;
-		gridn2 = NULL;
-		gridnm = NULL;
-		}
-
- 	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbnavadjust_crossing_replot()
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_crossing_replot";
-	int	status = MB_SUCCESS;
-
- 	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
-
-	/* replot loaded crossing */
-	if ((mbna_status == MBNA_STATUS_NAVERR  || mbna_status == MBNA_STATUS_AUTOPICK)
-		&& mbna_naverr_load == MB_YES)
-		{
-		/* get lon lat positions for soundings */
-		status = mbnavadjust_section_translate(mbna_file_id_1, swathraw1, swath1, 0.0);
-		status = mbnavadjust_section_translate(mbna_file_id_2, swathraw2, swath2, mbna_offset_z);
-
-		/* generate contour data */
-		status = mbnavadjust_section_contour(mbna_file_id_1,mbna_section_1,swath1,&mbna_contour1);
-		status = mbnavadjust_section_contour(mbna_file_id_2,mbna_section_2,swath2,&mbna_contour2);
-   		}
-
- 	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbnavadjust_section_load(int file_id, int section_id, void **swathraw_ptr, void **swath_ptr, int num_pings)
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_section_load";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *imb_io_ptr;
-	struct swathraw *swathraw;
-	struct pingraw *pingraw;
-	struct swath *swath;
-	struct mbna_file *file;
-	struct mbna_section *section;
-
-	/* mbio read and write values */
-	void	*imbio_ptr = NULL;
-	void	*istore_ptr = NULL;
-	int	kind;
-	int	time_i[7];
-	double	time_d;
-	double	navlon;
-	double	navlat;
-	double	speed;
-	double	heading;
-	double	distance;
-	double	altitude;
-	double	sonardepth;
-	double	roll;
-	double	pitch;
-	double	heave;
-	int	beams_bath;
-	int	beams_amp;
-	int	pixels_ss;
-	char	*beamflag = NULL;
-	double	*bath = NULL;
-	double	*bathacrosstrack = NULL;
-	double	*bathalongtrack = NULL;
-	double	*amp = NULL;
-	double	*ss = NULL;
-	double	*ssacrosstrack = NULL;
-	double	*ssalongtrack = NULL;
-	char	comment[MB_COMMENT_MAXLINE];
-
-	char	path[STRING_MAX];
-	int	iformat;
-	double	tick_len_map, label_hgt_map;
-	int	done;
-   	int	i;
-
- 	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       file_id:      %d\n",file_id);
-		fprintf(stderr,"dbg2       section_id:   %d\n",section_id);
-		fprintf(stderr,"dbg2       swath_ptr:    %p  %p\n",swath_ptr, *swath_ptr);
-		fprintf(stderr,"dbg2       num_pings:    %d\n",num_pings);
-		}
-
-     	/* load specified section */
-    	if (project.open == MB_YES
-    		&& project.num_crossings > 0)
-    		{
-		/* set section format and path */
-		sprintf(path,"%s/nvs_%4.4d_%4.4d.mb71",
-			project.datadir,file_id,section_id);
-		iformat = 71;
-		file = &(project.files[file_id]);
-		section = &(file->sections[section_id]);
-
-		/* initialize section for reading */
-		if ((status = mb_read_init(
-			mbna_verbose,path,iformat,pings,lonflip,bounds,
-			btime_i,etime_i,speedmin,timegap,
-			&imbio_ptr,&btime_d,&etime_d,
-			&beams_bath,&beams_amp,&pixels_ss,&error)) != MB_SUCCESS)
-			{
-			mb_error(mbna_verbose,error,&error_message);
-			fprintf(stderr,"\nMBIO Error returned from function <mb_read_init>:\n%s\n",error_message);
-			fprintf(stderr,"\nSwath sonar File <%s> not initialized for reading\n",path);
-			exit(0);
-			}
-
-		/* allocate memory for data arrays */
-		if (status == MB_SUCCESS)
-			{
-			if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(mbna_verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							    sizeof(char), (void **)&beamflag, &error);
-			if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(mbna_verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							    sizeof(double), (void **)&bath, &error);
-			if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(mbna_verbose, imbio_ptr, MB_MEM_TYPE_AMPLITUDE,
-							    sizeof(double), (void **)&amp, &error);
-			if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(mbna_verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							    sizeof(double), (void **)&bathacrosstrack, &error);
-			if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(mbna_verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							    sizeof(double), (void **)&bathalongtrack, &error);
-			if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(mbna_verbose, imbio_ptr, MB_MEM_TYPE_SIDESCAN,
-							    sizeof(double), (void **)&ss, &error);
-			if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(mbna_verbose, imbio_ptr, MB_MEM_TYPE_SIDESCAN,
-							    sizeof(double), (void **)&ssacrosstrack, &error);
-			if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(mbna_verbose, imbio_ptr, MB_MEM_TYPE_SIDESCAN,
-							    sizeof(double), (void **)&ssalongtrack, &error);
-
-			/* if error initializing memory then don't read the file */
-			if (error != MB_ERROR_NO_ERROR)
-				{
-				mb_error(mbna_verbose,error,&error_message);
-				fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",
-					error_message);
-				}
-			}
-
-		/* allocate memory for data arrays */
-		if (status == MB_SUCCESS)
-			{
-			/* get mb_io_ptr */
-			imb_io_ptr = (struct mb_io_struct *) imbio_ptr;
-
-			/* initialize data storage */
-			status = mb_mallocd(mbna_verbose, __FILE__, __LINE__, sizeof(struct swathraw),
-						(void **)swathraw_ptr, &error);
-			swathraw = (struct swathraw *) *swathraw_ptr;
-			swathraw->beams_bath = beams_bath;
-			swathraw->npings_max = num_pings;
-			swathraw->npings = 0;
-			status = mb_mallocd(mbna_verbose, __FILE__, __LINE__, num_pings * sizeof(struct pingraw),
-						(void **)&swathraw->pingraws, &error);
-			for (i=0;i<swathraw->npings_max;i++)
-				{
-				pingraw = &swathraw->pingraws[i];
-				pingraw->beams_bath = 0;
-				pingraw->beamflag = NULL;
-				pingraw->bath = NULL;
-				pingraw->bathacrosstrack = NULL;
-				pingraw->bathalongtrack = NULL;
-				}
-
-			/* initialize contour controls */
-			tick_len_map = MAX(section->lonmax - section->lonmin,
-						section->latmax - section->latmin) / 500;
-			label_hgt_map = MAX(section->lonmax - section->lonmin,
-						section->latmax - section->latmin) / 100;
- 			status = mb_contour_init(mbna_verbose, (struct swath **)swath_ptr,
-					    num_pings,
-					    beams_bath,
-					    mbna_contour_algorithm,
-					    MB_YES,MB_NO,MB_NO,MB_NO,MB_NO,
-					    project.cont_int, project.col_int,
-					    project.tick_int, project.label_int,
-					    tick_len_map, label_hgt_map, 0.0,
-					    mbna_ncolor, 0, NULL, NULL, NULL,
-					    0.0, 0.0, 0.0, 0.0,
-					    0, 0, 0.0, 0.0,
-					    &mbnavadjust_plot,
-					    &mbnavadjust_newpen,
-					    &mbnavadjust_setline,
-					    &mbnavadjust_justify_string,
-					    &mbnavadjust_plot_string,					    
-					    &error);
-			swath = (struct swath *) *swath_ptr;
-			swath->beams_bath = beams_bath;
-			swath->npings = 0;
-
-			/* if error initializing memory then quit */
-			if (error != MB_ERROR_NO_ERROR)
-				{
-				mb_error(mbna_verbose,error,&error_message);
-				fprintf(stderr,"\nMBIO Error allocating contour control structure:\n%s\n",error_message);
-				fprintf(stderr,"\nProgram <%s> Terminated\n",
-					program_name);
-				exit(error);
-				}
-			}
-
-		/* now read the data */
-		if (status == MB_SUCCESS)
-			{
-			done = MB_NO;
-			while (done == MB_NO)
-			    {
-			    /* read the next ping */
-			    status = mb_get_all(mbna_verbose,imbio_ptr,
-				    &istore_ptr, &kind, time_i, &time_d,
-				    &navlon, &navlat, &speed,
-				    &heading, &distance, &altitude, &sonardepth,
-				    &beams_bath, &beams_amp, &pixels_ss,
-				    beamflag, bath, amp, bathacrosstrack, bathalongtrack,
-				    ss, ssacrosstrack, ssalongtrack,
-				    comment, &error);
-
-			    /* handle successful read */
-			    if (status == MB_SUCCESS
-				&& kind == MB_DATA_DATA)
-			    	{
-				/* allocate memory for the raw arrays */
-				pingraw = &swathraw->pingraws[swathraw->npings];
-				status = mb_mallocd(mbna_verbose, __FILE__, __LINE__, beams_bath * sizeof(char),
-							(void **)&pingraw->beamflag, &error);
-				status = mb_mallocd(mbna_verbose, __FILE__, __LINE__, beams_bath * sizeof(double),
-							(void **)&pingraw->bath, &error);
-				status = mb_mallocd(mbna_verbose, __FILE__, __LINE__, beams_bath * sizeof(double),
-							(void **)&pingraw->bathacrosstrack, &error);
-				status = mb_mallocd(mbna_verbose, __FILE__, __LINE__, beams_bath * sizeof(double),
-							(void **)&pingraw->bathalongtrack, &error);
-
-				/* make sure enough memory is allocated for contouring arrays */
-		        	ping = &swath->pings[swathraw->npings];
-				if (ping->beams_bath_alloc < beams_bath)
-					{
-					status = mb_reallocd(mbna_verbose,__FILE__,__LINE__,beams_bath*sizeof(char),
-							(void **)&(ping->beamflag),&error);
-					status = mb_reallocd(mbna_verbose,__FILE__,__LINE__,beams_bath*sizeof(double),
-							(void **)&(ping->bath),&error);
-					status = mb_reallocd(mbna_verbose,__FILE__,__LINE__,beams_bath*sizeof(double),
-							(void **)&(ping->bathlon),&error);
-					status = mb_reallocd(mbna_verbose,__FILE__,__LINE__,beams_bath*sizeof(double),
-							(void **)&(ping->bathlat),&error);
-                                        if (mbna_contour_algorithm == MB_CONTOUR_OLD)
-                                            {
-                                            status = mb_reallocd(mbna_verbose,__FILE__,__LINE__,beams_bath*sizeof(int),
-                                                            (void **)&(ping->bflag[0]),&error);
-                                            status = mb_reallocd(mbna_verbose,__FILE__,__LINE__,beams_bath*sizeof(int),
-                                                            (void **)&(ping->bflag[1]),&error);
-                                            }
-					ping->beams_bath_alloc = beams_bath;
-					}
-
-			    	/* copy arrays and update bookkeeping */
-			    	if (error == MB_ERROR_NO_ERROR)
-				    {
-				    swathraw->npings++;
-				    if (swathraw->npings >= swathraw->npings_max)
-				    	done = MB_YES;
-
-				    for (i=0;i<7;i++)
-				    	pingraw->time_i[i] = time_i[i];
-				    pingraw->time_d = time_d;
-				    pingraw->navlon = navlon;
-				    pingraw->navlat = navlat;
-				    pingraw->heading = heading;
-				    pingraw->draft = sonardepth;
-				    pingraw->beams_bath = beams_bath;
-/* fprintf(stderr,"\nPING %d : %4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d\n",
-swathraw->npings,time_i[0],time_i[1],time_i[2],time_i[3],time_i[4],time_i[5],time_i[6]); */
-				    for (i=0;i<beams_bath;i++)
-				    	{
-					pingraw->beamflag[i] = beamflag[i];
-					if (mb_beam_ok(beamflag[i]))
-				    		{
-						pingraw->beamflag[i] = beamflag[i];
-						pingraw->bath[i] = bath[i];
-				    		pingraw->bathacrosstrack[i] = bathacrosstrack[i];
-				    		pingraw->bathalongtrack[i] = bathalongtrack[i];
-						}
-					else
-				    		{
-						pingraw->beamflag[i] = MB_FLAG_NULL;
-						pingraw->bath[i] = 0.0;
-				    		pingraw->bathacrosstrack[i] = 0.0;
-				    		pingraw->bathalongtrack[i] = 0.0;
-						}
-/* fprintf(stderr,"BEAM: %d:%d  Flag:%d    %f %f %f\n",
-swathraw->npings,i,pingraw->beamflag[i],pingraw->bath[i],pingraw->bathacrosstrack[i],pingraw->bathalongtrack[i]); */
-					}
-				    }
-
-				/* extract all nav values */
-				status = mb_extract_nav(mbna_verbose,imbio_ptr,
-					istore_ptr,&kind,
-					pingraw->time_i, &pingraw->time_d,
-					&pingraw->navlon, &pingraw->navlat, &speed,
-					&pingraw->heading, &pingraw->draft,
-					&roll, &pitch, &heave,
-					&error);
-
-/*fprintf(stderr, "%d  %4d/%2d/%2d %2d:%2d:%2d.%6.6d  %15.10f %15.10f %d:%d\n",
-status,
-ping->time_i[0],ping->time_i[1],ping->time_i[2],
-ping->time_i[3],ping->time_i[4],ping->time_i[5],ping->time_i[6],
-ping->navlon, ping->navlat, beams_bath, swath->beams_bath);*/
-
-
-			    	/* print debug statements */
-			    	if (mbna_verbose >= 2)
-				    {
-				    fprintf(stderr,"\ndbg2  Ping read in program <%s>\n",
-					    program_name);
-				    fprintf(stderr,"dbg2       kind:           %d\n",
-					    kind);
-				    fprintf(stderr,"dbg2       npings:         %d\n",
-					    swathraw->npings);
-				    fprintf(stderr,"dbg2       time:           %4d %2d %2d %2d %2d %2d %6.6d\n",
-					    pingraw->time_i[0],pingraw->time_i[1],pingraw->time_i[2],
-					    pingraw->time_i[3],pingraw->time_i[4],pingraw->time_i[5],pingraw->time_i[6]);
-				    fprintf(stderr,"dbg2       navigation:     %f  %f\n",
-					    pingraw->navlon, pingraw->navlat);
-				    fprintf(stderr,"dbg2       beams_bath:     %d\n",
-					    beams_bath);
-				    fprintf(stderr,"dbg2       beams_amp:      %d\n",
-					    beams_amp);
-				    fprintf(stderr,"dbg2       pixels_ss:      %d\n",
-					    pixels_ss);
-				    fprintf(stderr,"dbg2       done:           %d\n",
-					    done);
-				    fprintf(stderr,"dbg2       error:          %d\n",
-					    error);
-				    fprintf(stderr,"dbg2       status:         %d\n",
-					    status);
-				    }
-				}
-			    else if (error > MB_ERROR_NO_ERROR)
-			    	{
-			    	status = MB_SUCCESS;
-			    	error = MB_ERROR_NO_ERROR;
-			    	done = MB_YES;
-			    	}
-			    }
-
-			/* close the input data file */
-			status = mb_close(mbna_verbose,&imbio_ptr,&error);
-			}
-   		}
-
- 	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbnavadjust_section_translate(int file_id, void *swathraw_ptr, void *swath_ptr, double zoffset)
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_section_translate";
-	int	status = MB_SUCCESS;
-	struct swathraw *swathraw;
-	struct pingraw *pingraw;
-	struct swath *swath;
-	double	mtodeglon, mtodeglat, headingx, headingy;
-	double	depth, depthacrosstrack, depthalongtrack;
-	double	alpha, beta, range;
-   	int	i, iping;
-
- 	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       file_id:      %d\n",file_id);
-		fprintf(stderr,"dbg2       swathraw_ptr: %p\n",swathraw_ptr);
-		fprintf(stderr,"dbg2       swath_ptr:    %p\n",swath_ptr);
-		fprintf(stderr,"dbg2       zoffset:      %f\n",zoffset);
-		}
-
-     	/* translate sounding positions for loaded section */
-    	if (project.open == MB_YES
-    		&& project.num_crossings > 0
-    		&& mbna_current_crossing >= 0)
-    		{
-		swathraw = (struct swathraw *) swathraw_ptr;
-		swath = (struct swath *) swath_ptr;
-
-		/* relocate soundings based on heading bias */
-		swath->npings = 0;
-		for (iping=0;iping<swathraw->npings;iping++)
-		    {
-		    swath->npings++;
-		    pingraw = &swathraw->pingraws[iping];
-		    ping = &swath->pings[swath->npings - 1];
-		    for (i=0;i<7;i++)
-			ping->time_i[i] = pingraw->time_i[i];
-		    ping->time_d = pingraw->time_d;
-		    ping->navlon = pingraw->navlon;
-		    ping->navlat = pingraw->navlat;
-		    ping->heading = pingraw->heading
-				    + project.files[file_id].heading_bias;
-		    mb_coor_scale(mbna_verbose, pingraw->navlat,
-				    &mtodeglon, &mtodeglat);
-		    headingx = sin(ping->heading * DTR);
-		    headingy = cos(ping->heading * DTR);
-		    ping->beams_bath = pingraw->beams_bath;
-		    for (i=0;i<ping->beams_bath;i++)
-			{
-			ping->beamflag[i] = pingraw->beamflag[i];
-			if (mb_beam_ok(pingraw->beamflag[i]))
-			    {
-			    /* strip off transducer depth */
-			    depth = pingraw->bath[i] - pingraw->draft;
-
-			    /* get range and angles in
-				roll-pitch frame */
-			    range = sqrt(depth * depth
-					+ pingraw->bathacrosstrack[i]
-					    * pingraw->bathacrosstrack[i]
-					+ pingraw->bathalongtrack[i]
-					    * pingraw->bathalongtrack[i]);
-			    alpha = asin(pingraw->bathalongtrack[i]
-				    / range);
-			    beta = acos(pingraw->bathacrosstrack[i]
-				    / range / cos(alpha));
-
-			    /* apply roll correction */
-			    beta +=  DTR * project.files[file_id].roll_bias;
-
-			    /* recalculate bathymetry */
-			    depth = range * cos(alpha) * sin(beta);
-			    depthalongtrack = range * sin(alpha);
-			    depthacrosstrack = range * cos(alpha) * cos(beta);
-
-			    /* add heave and draft back in */
-			    depth += pingraw->draft;
-
-			    /* add zoffset */
-			    depth += zoffset;
-
-			    /* get bathymetry in lon lat */
-			    ping->beamflag[i] = pingraw->beamflag[i];
-			    ping->bath[i] = depth;
-			    ping->bathlon[i] = pingraw->navlon
-					    + headingy*mtodeglon
-						*depthacrosstrack
-					    + headingx*mtodeglon
-						*depthalongtrack;
-			    ping->bathlat[i] = pingraw->navlat
-					    - headingx*mtodeglat
-						*depthacrosstrack
-					    + headingy*mtodeglat
-						*depthalongtrack;
-			    }
-			}
-		    }
-		}
-
- 	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbnavadjust_section_contour(int fileid, int sectionid,
-				struct swath *swath,
-				struct mbna_contour_vector *contour)
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_section_contour";
-	int	status = MB_SUCCESS;
-
- 	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       fileid:       %d\n",fileid);
-		fprintf(stderr,"dbg2       sectionid:    %d\n",sectionid);
-		fprintf(stderr,"dbg2       swath:        %p\n",swath);
-		fprintf(stderr,"dbg2       contour:      %p\n",contour);
-		fprintf(stderr,"dbg2       nvector:      %d\n",contour->nvector);
-		fprintf(stderr,"dbg2       nvector_alloc:%d\n",contour->nvector_alloc);
-		}
-
-	if (swath != NULL)
-		{
-		/* set vectors */
-		mbna_contour = contour;
-		contour->nvector = 0;
-
-    		/* reset contouring parameters */
-		swath->contour_int = project.cont_int;
-		swath->color_int = project.col_int;
-		swath->tick_int = project.tick_int;
-
-		/* generate contours */
-		status = mb_contour(mbna_verbose,swath,&error);
-
-		/* set contours up to date flag */
-		project.files[fileid].sections[sectionid].contoursuptodate = MB_YES;
-		}
-
- 	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbnavadjust_naverr_snavpoints(int ix, int iy)
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_naverr_snavpoints";
-	int	status = MB_SUCCESS;
-	double	x, y, dx, dy, d;
-	struct mbna_crossing *crossing;
-	struct mbna_section *section;
-	double	distance;
-	int	i;
-
- 	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       ix:           %d\n",ix);
-		fprintf(stderr,"dbg2       iy:           %d\n",iy);
-		}
-
-     	if (mbna_naverr_load == MB_YES)
-    		{
-    		/* get position in lon and lat */
-	    	x = ix / mbna_plotx_scale +  mbna_plot_lon_min;
-	    	y = (cont_borders[3] - iy) / mbna_ploty_scale +  mbna_plot_lat_min;
-		crossing = &project.crossings[mbna_current_crossing];
-
-	    	/* get closest snav point in swath 1 */
-		section = &project.files[crossing->file_id_1].sections[crossing->section_1];
-	    	distance = 999999.999;
-		for (i=0;i<section->num_snav;i++)
-			{
-	    		dx = (section->snav_lon[i] - x) / mbna_mtodeglon;
-	    		dy = (section->snav_lat[i] - y) / mbna_mtodeglat;
-	    		d = sqrt(dx * dx + dy * dy);
-	    		if (d < distance)
-	    			{
-	    			distance = d;
- 			    	mbna_snav_1 = i;
-			    	mbna_snav_1_time_d = section->snav_time_d[i];
-			    	mbna_snav_1_lon = section->snav_lon[i];
-			    	mbna_snav_1_lat = section->snav_lat[i];
-	    			}
-			}
-
-	    	/* get closest snav point in swath 2 */
-		section = &project.files[crossing->file_id_2].sections[crossing->section_2];
-	    	distance = 999999.999;
-		for (i=0;i<section->num_snav;i++)
-			{
-	    		dx = (section->snav_lon[i] + mbna_offset_x - x) / mbna_mtodeglon;
-	    		dy = (section->snav_lat[i] + mbna_offset_y - y) / mbna_mtodeglat;
-	    		d = sqrt(dx * dx + dy * dy);
-	    		if (d < distance)
-	    			{
-	    			distance = d;
- 			    	mbna_snav_2 = i;
-			    	mbna_snav_2_time_d = section->snav_time_d[i];
-			    	mbna_snav_2_lon = section->snav_lon[i];
-			    	mbna_snav_2_lat = section->snav_lat[i];
-	    			}
-			}
-
-		}
-
- 	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  snav point selected in MBnavadjust function <%s>\n",
-			function_name);
-		fprintf(stderr,"dbg2  snav values:\n");
-		section = &project.files[crossing->file_id_1].sections[crossing->section_1];
-		fprintf(stderr,"dbg2       mbna_snav_1:        %d\n",mbna_snav_1);
-		fprintf(stderr,"dbg2       mbna_snav_1_time_d: %f\n",mbna_snav_1_time_d);
-		fprintf(stderr,"dbg2       mbna_snav_1_lon:    %.10f\n",mbna_snav_1_lon);
-		fprintf(stderr,"dbg2       mbna_snav_1_lat:    %.10f\n",mbna_snav_1_lat);
-		fprintf(stderr,"dbg2       section->num_snav:  %d\n",section->num_snav);
-		for (i=0;i<section->num_snav;i++)
-			{
-			fprintf(stderr,"dbg2       section1->snav_time_d[%d]: %f\n",i,section->snav_time_d[i]);
-			fprintf(stderr,"dbg2       section1->snav_lon[%d]:    %.10f\n",i,section->snav_lon[i]);
-			fprintf(stderr,"dbg2       section1->snav_lat[%d]:    %.10f\n",i,section->snav_lat[i]);
-			}
-		section = &project.files[crossing->file_id_2].sections[crossing->section_2];
-		fprintf(stderr,"dbg2       mbna_snav_2:        %d\n",mbna_snav_2);
-		fprintf(stderr,"dbg2       mbna_snav_2_time_d: %f\n",mbna_snav_2_time_d);
-		fprintf(stderr,"dbg2       mbna_snav_2_lon:    %.10f\n",mbna_snav_2_lon);
-		fprintf(stderr,"dbg2       mbna_snav_2_lat:    %.10f\n",mbna_snav_2_lat);
-		fprintf(stderr,"dbg2       section->num_snav:  %d\n",section->num_snav);
-		for (i=0;i<section->num_snav;i++)
-			{
-			fprintf(stderr,"dbg2       section2->snav_time_d[%d]: %f\n",i,section->snav_time_d[i]);
-			fprintf(stderr,"dbg2       section2->snav_lon[%d]:    %.10f\n",i,section->snav_lon[i]);
-			fprintf(stderr,"dbg2       section2->snav_lat[%d]:    %.10f\n",i,section->snav_lat[i]);
-			}
-		}
-
- 	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbnavadjust_sections_intersect(int crossing_id)
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_sections_intersect";
-	struct mbna_file *file;
-	struct mbna_crossing *crossing;
-	struct mbna_section *section;
-	int	answer = MB_NO;
-	double	xa1, ya1, xa2, ya2;
-	double	xb1, yb1, xb2, yb2;
-	double	dxa, dya, dxb, dyb;
-	double	s, t;
-
- 	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       crossing_id:  %d\n",crossing_id);
-		}
-
-	/* get crossing */
-	crossing = (struct mbna_crossing *) &project.crossings[crossing_id];
-
-	/* get section endpoints */
-	file = &project.files[crossing->file_id_1];
-	section = &file->sections[crossing->section_1];
-	xa1 = section->snav_lon[0] + section->snav_lon_offset[0];
-	ya1 = section->snav_lat[0] + section->snav_lat_offset[0];
-	xa2 = section->snav_lon[section->num_snav - 1] + section->snav_lon_offset[section->num_snav - 1];
-	ya2 = section->snav_lat[section->num_snav - 1] + section->snav_lat_offset[section->num_snav - 1];
-	file = &project.files[crossing->file_id_2];
-	section = &file->sections[crossing->section_2];
-	xb1 = section->snav_lon[0] + section->snav_lon_offset[0];
-	yb1 = section->snav_lat[0] + section->snav_lat_offset[0];
-	xb2 = section->snav_lon[section->num_snav - 1] + section->snav_lon_offset[section->num_snav - 1];
-	yb2 = section->snav_lat[section->num_snav - 1] + section->snav_lat_offset[section->num_snav - 1];
-
-	/* check for parallel sections */
-	dxa = xa2 - xa1;
-	dya = ya2 - ya1;
-	dxb = xb2 - xb1;
-	dyb = yb2 - yb1;
-	if ((dxb * dya - dyb * dxa) == 0.0)
-		{
-		answer = MB_NO;
-		}
-	else
-		{
-		/* check for crossing sections */
-		s = (dxa * (yb1 - ya1) + dya * (xa1 - xb1)) / (dxb * dya - dyb * dxa);
-		t = (dxb * (ya1 - yb1) + dyb * (xb1 - xa1)) / (dyb * dxa - dxb * dya);
-		if (s >= 0.0 && s <= 1.0 && t >= 0.0 && t <= 1.0)
-			answer = MB_YES;
-		else
-			answer = MB_NO;
-		}
-
- 	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       answer:      %d\n",answer);
-		}
-
-	return(answer);
-}
-/*--------------------------------------------------------------------*/
-int mbnavadjust_crossing_overlap(int crossing_id)
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_crossing_overlap";
-	int	status = MB_SUCCESS;
-	struct mbna_file *file;
-	struct mbna_crossing *crossing;
-	struct mbna_section *section1;
-	struct mbna_section *section2;
-	int	overlap1[MBNA_MASK_DIM * MBNA_MASK_DIM];
-	int	overlap2[MBNA_MASK_DIM * MBNA_MASK_DIM];
-	double	lonoffset, latoffset;
-	double	lon1min, lon1max;
-	double	lat1min, lat1max;
-	double	lon2min, lon2max;
-	double	lat2min, lat2max;
-	double	dx1, dy1, dx2, dy2;
-	double	overlapfraction;
-	int	ncoverage1, ncoverage2;
-	int	noverlap1, noverlap2;
-	int	first;
-	int	i, ii1, jj1, kk1, ii2, jj2, kk2;
-
- 	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       crossing_id:          %d\n",crossing_id);
-		}
-
-	/* get crossing */
-	crossing = (struct mbna_crossing *) &project.crossings[crossing_id];
-
-	/* get section endpoints */
-	file = &project.files[crossing->file_id_1];
-	section1 = &file->sections[crossing->section_1];
-	file = &project.files[crossing->file_id_2];
-	section2 = &file->sections[crossing->section_2];
-	lonoffset = section2->snav_lon_offset[section2->num_snav/2] - section1->snav_lon_offset[section1->num_snav/2];
-	latoffset = section2->snav_lat_offset[section2->num_snav/2] - section1->snav_lat_offset[section1->num_snav/2];
-
-	/* initialize overlap arrays */
-	for (i=0;i<MBNA_MASK_DIM*MBNA_MASK_DIM;i++)
-		{
-		overlap1[i] = 0;
-		overlap2[i] = 0;
-		}
-
-	/* check coverage masks for overlap */
-	first = MB_YES;
-	dx1 = (section1->lonmax - section1->lonmin) / MBNA_MASK_DIM;
-	dy1 = (section1->latmax - section1->latmin) / MBNA_MASK_DIM;
-	dx2 = (section2->lonmax - section2->lonmin) / MBNA_MASK_DIM;
-	dy2 = (section2->latmax - section2->latmin) / MBNA_MASK_DIM;
-	for (ii1=0;ii1<MBNA_MASK_DIM;ii1++)
-	    for (jj1=0;jj1<MBNA_MASK_DIM;jj1++)
-		{
-		kk1 = ii1 + jj1 * MBNA_MASK_DIM;
-		if (section1->coverage[kk1] == 1)
-		    {
-		    lon1min = section1->lonmin + dx1 * ii1;
-		    lon1max = section1->lonmin + dx1 * (ii1 + 1);
-		    lat1min = section1->latmin + dy1 * jj1;
-		    lat1max = section1->latmin + dy1 * (jj1 + 1);
-		    for (ii2=0;ii2<MBNA_MASK_DIM;ii2++)
-			for (jj2=0;jj2<MBNA_MASK_DIM;jj2++)
-			    {
-			    kk2 = ii2 + jj2 * MBNA_MASK_DIM;
-			    if (section2->coverage[kk2] == 1)
-				{
-				lon2min = section2->lonmin + dx2 * ii2 + lonoffset;
-				lon2max = section2->lonmin + dx2 * (ii2 + 1) + lonoffset;
-				lat2min = section2->latmin + dy2 * jj2 + latoffset;
-				lat2max = section2->latmin + dy2 * (jj2 + 1) + latoffset;
-				if ((lon1min < lon2max)
-				    && (lon1max > lon2min)
-				    && (lat1min < lat2max)
-				    && (lat1max > lat2min))
-				    {
-				    overlap1[kk1] = 1;
-				    overlap2[kk2] = 1;
-				    }
-				}
-			    }
-		    }
-		}
-
-	/* count fractions covered */
-	ncoverage1 = 0;
-	ncoverage2 = 0;
-	noverlap1 = 0;
-	noverlap2 = 0;
-	for (i=0;i<MBNA_MASK_DIM*MBNA_MASK_DIM;i++)
-		{
-		if (section1->coverage[i] == 1)
-			ncoverage1++;
-		if (section2->coverage[i] == 1)
-			ncoverage2++;
-		if (overlap1[i] == 1)
-			noverlap1++;
-		if (overlap2[i] == 1)
-			noverlap2++;
-		}
-	overlapfraction = (dx1 * dy1) / (dx1 * dy1 + dx2 * dy2)
-				* ((double)noverlap1) / ((double)ncoverage1)
-			+ (dx2 * dy2) / (dx1 * dy1 + dx2 * dy2)
-				* ((double)noverlap2) / ((double)ncoverage2);
-	crossing->overlap = (int) (100.0 * overlapfraction);
-	if (crossing->overlap < 1)
-		crossing->overlap = 1;
-
- 	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       crossing->overlap: %d\n",crossing->overlap);
-		fprintf(stderr,"dbg2       status:            %d\n",status);
-		}
-
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbnavadjust_crossing_overlapbounds(int crossing_id,
-				double offset_x, double offset_y,
-				double *lonmin, double *lonmax,
-				double *latmin, double *latmax)
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_crossing_overlapbounds";
-	int	status = MB_SUCCESS;
-	struct mbna_file *file;
-	struct mbna_crossing *crossing;
-	struct mbna_section *section1;
-	struct mbna_section *section2;
-	int	overlap1[MBNA_MASK_DIM * MBNA_MASK_DIM];
-	int	overlap2[MBNA_MASK_DIM * MBNA_MASK_DIM];
-	double	lon1min, lon1max;
-	double	lat1min, lat1max;
-	double	lon2min, lon2max;
-	double	lat2min, lat2max;
-	double	dx1, dy1, dx2, dy2;
-	int	first;
-	int	i, ii1, jj1, kk1, ii2, jj2, kk2;
-
- 	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       crossing_id:          %d\n",crossing_id);
-		fprintf(stderr,"dbg2       offset_x:             %f\n",offset_x);
-		fprintf(stderr,"dbg2       offset_y:             %f\n",offset_y);
-		}
-
-	/* get crossing */
-	crossing = (struct mbna_crossing *) &project.crossings[crossing_id];
-
-	/* get section endpoints */
-	file = &project.files[crossing->file_id_1];
-	section1 = &file->sections[crossing->section_1];
-	file = &project.files[crossing->file_id_2];
-	section2 = &file->sections[crossing->section_2];
-
-	/* initialize overlap arrays */
-	for (i=0;i<MBNA_MASK_DIM*MBNA_MASK_DIM;i++)
-		{
-		overlap1[i] = 0;
-		overlap2[i] = 0;
-		}
-
-	/* check coverage masks for overlap */
-	first = MB_YES;
-	*lonmin = 0.0;
-	*lonmax = 0.0;
-	*latmin = 0.0;
-	*latmax = 0.0;
-	dx1 = (section1->lonmax - section1->lonmin) / MBNA_MASK_DIM;
-	dy1 = (section1->latmax - section1->latmin) / MBNA_MASK_DIM;
-	dx2 = (section2->lonmax - section2->lonmin) / MBNA_MASK_DIM;
-	dy2 = (section2->latmax - section2->latmin) / MBNA_MASK_DIM;
-	for (ii1=0;ii1<MBNA_MASK_DIM;ii1++)
-	    for (jj1=0;jj1<MBNA_MASK_DIM;jj1++)
-		{
-		kk1 = ii1 + jj1 * MBNA_MASK_DIM;
-		if (section1->coverage[kk1] == 1)
-		    {
-		    lon1min = section1->lonmin + dx1 * ii1;
-		    lon1max = section1->lonmin + dx1 * (ii1 + 1);
-		    lat1min = section1->latmin + dy1 * jj1;
-		    lat1max = section1->latmin + dy1 * (jj1 + 1);
-		    for (ii2=0;ii2<MBNA_MASK_DIM;ii2++)
-			for (jj2=0;jj2<MBNA_MASK_DIM;jj2++)
-			    {
-			    kk2 = ii2 + jj2 * MBNA_MASK_DIM;
-			    if (section2->coverage[kk2] == 1)
-				{
-				lon2min = section2->lonmin + dx2 * ii2 + offset_x;
-				lon2max = section2->lonmin + dx2 * (ii2 + 1) + offset_x;
-				lat2min = section2->latmin + dy2 * jj2 + offset_y;
-				lat2max = section2->latmin + dy2 * (jj2 + 1) + offset_y;
-				if ((lon1min < lon2max)
-				    && (lon1max > lon2min)
-				    && (lat1min < lat2max)
-				    && (lat1max > lat2min))
-				    {
-				    overlap1[kk1] = 1;
-				    overlap2[kk2] = 1;
-				    if (first == MB_NO)
-					{
-					*lonmin = MIN(*lonmin, MAX(lon1min, lon2min));
-					*lonmax = MAX(*lonmax, MIN(lon1max, lon2max));
-					*latmin = MIN(*latmin, MAX(lat1min, lat2min));
-					*latmax = MAX(*latmax, MIN(lat1max, lat2max));
-					}
-				    else
-					{
-					first = MB_NO;
-					*lonmin = MAX(lon1min, lon2min);
-					*lonmax = MIN(lon1max, lon2max);
-					*latmin = MAX(lat1min, lat2min);
-					*latmax = MIN(lat1max, lat2max);
-					}
-				    }
-				}
-			    }
-		    }
-		}
-
- 	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       lonmin:      %.10f\n",*lonmin);
-		fprintf(stderr,"dbg2       lonmax:      %.10f\n",*lonmax);
-		fprintf(stderr,"dbg2       latmin:      %.10f\n",*latmin);
-		fprintf(stderr,"dbg2       latmax:      %.10f\n",*latmax);
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbnavadjust_get_misfit()
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_get_misfit";
-	int	status = MB_SUCCESS;
-	double	dinterval;
-	double	zoff;
-	double	minmisfitthreshold, dotproduct;
-	double	x, y, z, r;
-	double	dotproductsave2;
-	double	rsave2;
-	double	dotproductsave3;
-	double	rsave3;
-	int	found;
-	int	igx, igy;
-	int	ic, jc, kc, lc;
-	int	ioff, joff, istart, iend, jstart, jend;
-	int	i1, i2, j1, j2, k1, k2;
-	int	imin, jmin, kmin;
-	int	i, j, k, l, ll;
-
- 	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
-
-    	if (project.open == MB_YES
-    		&& project.num_crossings > 0
-    		&& mbna_current_crossing >= 0
-		&& mbna_naverr_load == MB_YES)
-    		{
-/* fprintf(stderr,"\nDEBUG %s %d: mbnavadjust_get_misfit: mbna_plot minmax: %f %f %f %f\n",
-__FILE__,__LINE__,
-mbna_plot_lon_min,mbna_plot_lon_max,mbna_plot_lat_min,mbna_plot_lat_max); */
-
-    		/* set message on */
-    		if (mbna_verbose > 1)
-			fprintf(stderr,"Making misfit grid for crossing %d\n",mbna_current_crossing);
-		sprintf(message,"Making misfit grid for crossing %d\n",mbna_current_crossing);
-		do_message_update(message);
-
-		/* reset sounding density threshold for misfit calculation
-			- will be tuned down if necessary */
-		mbna_minmisfit_nthreshold = MBNA_MISFIT_NTHRESHOLD;
-
-		/* figure out lateral extent of grids */
-		grid_nx = MBNA_MISFIT_DIMXY;
-		grid_ny = MBNA_MISFIT_DIMXY;
-		if ((mbna_plot_lon_max - mbna_plot_lon_min) / mbna_mtodeglon
-		    > (mbna_plot_lat_max - mbna_plot_lat_min) / mbna_mtodeglat)
-		    {
-		    grid_dx = (mbna_plot_lon_max - mbna_plot_lon_min) / (grid_nx - 1);
-		    grid_dy = grid_dx * mbna_mtodeglat / mbna_mtodeglon;
-/* fprintf(stderr,"DEBUG %s %d: grid scale: grid_dx:%f grid_dy:%f\n",
-__FILE__,__LINE__,
-grid_dx,grid_dy); */
-		    }
-		else
-		    {
-		    grid_dy = (mbna_plot_lat_max - mbna_plot_lat_min) / (grid_ny - 1);
-		    grid_dx = grid_dy * mbna_mtodeglon / mbna_mtodeglat;
-/* fprintf(stderr,"DEBUG %s %d: grid scale: grid_dx:%f grid_dy:%f\n",
-__FILE__,__LINE__,
-grid_dx,grid_dy); */
-		    }
-		grid_nxy = grid_nx * grid_ny;
-		grid_olon = 0.5 * (mbna_plot_lon_min + mbna_plot_lon_max)
-				    - (grid_nx / 2 + 0.5) * grid_dx;
-		grid_olat = 0.5 * (mbna_plot_lat_min + mbna_plot_lat_max)
-				    - (grid_ny / 2 + 0.5) * grid_dy;
-/* fprintf(stderr,"DEBUG %s %d: grid_olon:%.10f grid_olat:%.10f\n",
-__FILE__,__LINE__,
-grid_olon,grid_olat); */
-
-		/* get 3d misfit grid */
-		nzmisfitcalc = MBNA_MISFIT_DIMZ;
-		gridm_nx = grid_nx / 2 + 1;
-		gridm_ny = gridm_nx;
-		gridm_nxyz = gridm_nx * gridm_ny * nzmisfitcalc;
-		if (mbna_misfit_center == MBNA_MISFIT_ZEROCENTER)
-		    {
-		    mbna_misfit_offset_x = 0.0;
-		    mbna_misfit_offset_y = 0.0;
-		    mbna_misfit_offset_z = 0.0;
-		    }
-		else
-		    {
-		    mbna_misfit_offset_x = mbna_offset_x;
-		    mbna_misfit_offset_y = mbna_offset_y;
-		    mbna_misfit_offset_z = mbna_offset_z;
-		    }
-/* fprintf(stderr,"DEBUG %s %d: GRID parameters: dx:%.10f dy:%.10f nx:%d ny:%d  bounds:  grid: %.10f %.10f %.10f %.10f  plot: %.10f %.10f %.10f %.10f\n",
-__FILE__,__LINE__,
-grid_dx, grid_dy, grid_nx, grid_ny,
-grid_olon, grid_olon + grid_nx * grid_dx,
-grid_olat, grid_olat + grid_ny * grid_dy,
-mbna_lon_min, mbna_lon_max, mbna_lat_min, mbna_lat_max); */
-
-		/* figure out range of z offsets */
-		zmin = mbna_misfit_offset_z - 0.5 * project.zoffsetwidth;
-		zmax = mbna_misfit_offset_z + 0.5 * project.zoffsetwidth;
-		zoff_dz = project.zoffsetwidth / (nzmisfitcalc - 1);
-/* fprintf(stderr,"DEBUG %s %d: mbna_misfit_offset_z:%f project.zoffsetwidth:%f nzmisfitcalc:%d zmin:%f zmax:%f zoff_dz:%f\n",
-__FILE__,__LINE__,
-mbna_misfit_offset_z,project.zoffsetwidth,nzmisfitcalc,zmin,zmax,zoff_dz); */
-
-		/* allocate and initialize grids and arrays */
-		grid1 = (double *) realloc(grid1, sizeof(double) * (grid_nxy));
-		grid2 = (double *) realloc(grid2, sizeof(double) * (grid_nxy));
-		gridm = (double *) realloc(gridm, sizeof(double) * (gridm_nxyz));
-		gridmeq = (double *) realloc(gridmeq, sizeof(double) * (gridm_nxyz));
-		gridn1 = (int *) realloc(gridn1, sizeof(int) * (grid_nxy));
-		gridn2 = (int *) realloc(gridn2, sizeof(int) * (grid_nxy));
-		gridnm = (int *) realloc(gridnm, sizeof(int) * (gridm_nxyz));
-		memset(grid1, 0, sizeof(double) * (grid_nxy));
-		memset(grid2, 0, sizeof(double) * (grid_nxy));
-		memset(gridm, 0, sizeof(double) * (gridm_nxyz));
-		memset(gridmeq, 0, sizeof(double) * (gridm_nxyz));
-		memset(gridn1, 0, sizeof(int) * (grid_nxy));
-		memset(gridn2, 0, sizeof(int) * (grid_nxy));
-		memset(gridnm, 0, sizeof(int) * (gridm_nxyz));
-
-	    	/* loop over all beams */
-	    	for (i=0;i<swath1->npings;i++)
-	    		{
-	    		for (j=0;j<swath1->pings[i].beams_bath;j++)
-	    			{
-	    			if (mb_beam_ok(swath1->pings[i].beamflag[j]))
-	    				{
-	    				x = (swath1->pings[i].bathlon[j] - grid_olon);
-	    				y = (swath1->pings[i].bathlat[j] - grid_olat);
-					igx = (int) (x / grid_dx);
-					igy = (int) (y / grid_dy);
-					k = igx + igy * grid_nx;
-					if (igx >= 0 && igx < grid_nx
-					    && igy >= 0 && igy < grid_ny)
-					    {
-					    grid1[k] += swath1->pings[i].bath[j];
-					    gridn1[k] ++;
-					    }
-/* else
-fprintf(stderr,"DEBUG %s %d: BAD swath1: %d %d  %.10f %.10f  %f %f  %d %d\n",
-__FILE__,__LINE__,
-i, j, swath1->pings[i].bathlon[j], swath1->pings[i].bathlat[j], x, y, igx, igy); */
-	    				}
-	    			}
-	    		}
-
-	    	/* loop over all beams */
-	    	for (i=0;i<swath2->npings;i++)
-	    		{
-	    		for (j=0;j<swath2->pings[i].beams_bath;j++)
-	    			{
-	    			if (mb_beam_ok(swath2->pings[i].beamflag[j]))
-	    				{
-	    				x = (swath2->pings[i].bathlon[j] + mbna_misfit_offset_x - grid_olon);
-	    				y = (swath2->pings[i].bathlat[j] + mbna_misfit_offset_y - grid_olat);
-					igx = (int) (x / grid_dx);
-					igy = (int) (y / grid_dy);
-					k = igx + igy * grid_nx;
-					if (igx >= 0 && igx < grid_nx
-					    && igy >= 0 && igy < grid_ny)
-					    {
-					    grid2[k] += swath2->pings[i].bath[j];
-					    gridn2[k] ++;
-					    }
-/* else
-fprintf(stderr,"DEBUG %s %d: BAD swath2: %d %d  %.10f %.10f  %f %f  %d %d\n",
-__FILE__,__LINE__,
-i, j, swath2->pings[i].bathlon[j], swath2->pings[i].bathlat[j], x, y, igx, igy); */
-	    				}
-	    			}
-	    		}
-
-		/* calculate gridded bath */
-		for (k=0;k<grid_nxy;k++)
-		    {
-		    if (gridn1[k] > 0)
-			{
-			grid1[k] = (grid1[k] / gridn1[k]);
-			}
-		    if (gridn2[k] > 0)
-			{
-			grid2[k] = (grid2[k] / gridn2[k]);
-			}
-/* fprintf(stderr,"GRIDDED BATH: k:%d 1:%d %f   2:%d %f\n",
-k,gridn1[k],grid1[k],gridn2[k],grid2[k]); */
-		    }
-
-		/* calculate gridded misfit over lateral and z offsets */
-		for (ic=0;ic<gridm_nx;ic++)
-		    for (jc=0;jc<gridm_ny;jc++)
-			for (kc=0;kc<nzmisfitcalc;kc++)
-			    {
-			    lc = kc + nzmisfitcalc * (ic + jc * gridm_nx);
-			    gridm[lc] = 0.0;
-			    gridnm[lc] = 0;
-
-			    ioff = (gridm_nx / 2) - ic;
-			    joff = (gridm_ny / 2) - jc;
-			    zoff = zmin + zoff_dz * kc;
-
-			    istart = MAX(-ioff, 0);
-			    iend = grid_nx - MAX(0, ioff);
-			    jstart = MAX(-joff, 0);
-			    jend = grid_ny - MAX(0, joff);
-			    for (i1=istart;i1<iend;i1++)
-				for (j1=jstart;j1<jend;j1++)
-				    {
-				    i2 = i1 + ioff;
-				    j2 = j1 + joff;
-				    k1 = i1 + j1 * grid_nx;
-				    k2 = i2 + j2 * grid_nx;
-				    if (gridn1[k1] > 0 && gridn2[k2] > 0)
-					{
-					gridm[lc] += (grid2[k2] - grid1[k1] + zoff - mbna_offset_z)
-							* (grid2[k2] - grid1[k1] + zoff - mbna_offset_z);
-					gridnm[lc]++;
-					}
-				    }
-			    }
-		misfit_min = 0.0;
-		misfit_max = 0.0;
-		mbna_minmisfit = 0.0;
-		mbna_minmisfit_n = 0;
-		mbna_minmisfit_x = 0.0;
-		mbna_minmisfit_y = 0.0;
-		mbna_minmisfit_z = 0.0;
-		found = MB_NO;
-		for (ic=0;ic<gridm_nx;ic++)
-		    for (jc=0;jc<gridm_ny;jc++)
-			for (kc=0;kc<nzmisfitcalc;kc++)
-			    {
-			    lc = kc + nzmisfitcalc * (ic + jc * gridm_nx);
-			    if (gridnm[lc] > 0)
-				{
- 				gridm[lc] = sqrt(gridm[lc]) / gridnm[lc];
-				if (misfit_max == 0.0)
-			    	    {
-				    misfit_min = gridm[lc];
-				    }
-				misfit_min = MIN(misfit_min, gridm[lc]);
-				misfit_max = MAX(misfit_max, gridm[lc]);
-				if (gridnm[lc] > mbna_minmisfit_nthreshold
-				    && (mbna_minmisfit_n == 0 || gridm[lc] < mbna_minmisfit))
-				    {
-				    mbna_minmisfit = gridm[lc];
-				    mbna_minmisfit_n = gridnm[lc];
-				    mbna_minmisfit_x = (ic - gridm_nx / 2) * grid_dx + mbna_misfit_offset_x;
-				    mbna_minmisfit_y = (jc - gridm_ny / 2) * grid_dy + mbna_misfit_offset_y;
-				    mbna_minmisfit_z = zmin + zoff_dz * kc;
-				    imin = ic;
-				    jmin = jc,
-				    kmin = kc;
-				    found = MB_YES;
-/* zoff = zmin + zoff_dz * kc;
-fprintf(stderr,"DEBUG %s %d: ic:%d jc:%d kc:%d misfit:%f %f %d  pos:%f %f %f zoff:%f mbna_ofset_z:%f\n",
-__FILE__,__LINE__,
-ic,jc,kc,misfit_min,mbna_minmisfit,mbna_minmisfit_n,mbna_minmisfit_x,mbna_minmisfit_y,mbna_minmisfit_z,
-zoff,mbna_offset_z); */
- 			    	    }
-				}
-/* if (ic == jc && kc == 0)
-fprintf(stderr,"DEBUG %s %d: ic:%d jc:%d misfit:%d %f\n",
-__FILE__,__LINE__,
-ic,jc,gridnm[lc],gridm[lc]);*/
-			    }
-		if (found == MB_NO)
-		    {
-		    mbna_minmisfit_nthreshold /= 10.0;
-		    for (ic=0;ic<gridm_nx;ic++)
-			for (jc=0;jc<gridm_ny;jc++)
-			    for (kc=0;kc<nzmisfitcalc;kc++)
-				{
-				lc = kc + nzmisfitcalc * (ic + jc * gridm_nx);
-				if (gridnm[lc] > mbna_minmisfit_nthreshold/10 && (mbna_minmisfit_n == 0 || gridm[lc] < mbna_minmisfit))
-				    {
-				    mbna_minmisfit = gridm[lc];
-				    mbna_minmisfit_n = gridnm[lc];
-				    mbna_minmisfit_x = (ic - gridm_nx / 2) * grid_dx + mbna_misfit_offset_x;
-				    mbna_minmisfit_y = (jc - gridm_ny / 2) * grid_dy + mbna_misfit_offset_y;
-				    mbna_minmisfit_z = zmin + zoff_dz * kc;
-				    imin = ic;
-				    jmin = jc,
-				    kmin = kc;
-				    found = MB_YES;
-				    }
-/* fprintf(stderr,"DEBUG %s %d: ijk:%d %d %d gridm:%d %f  misfit:%f %f %d  pos:%f %f %f\n",
-__FILE__,__LINE__,
-ic,jc,kc,gridnm[lc],gridm[lc],misfit_min,mbna_minmisfit,mbna_minmisfit_n,mbna_minmisfit_x,mbna_minmisfit_y,mbna_minmisfit_z); */
-				}
-		    }
-		misfit_min = 0.99 * misfit_min;
-		misfit_max = 1.01 * misfit_max;
-/* if (found == MB_YES)
-{
-lc = kmin + nzmisfitcalc * (imin + jmin * gridm_nx);
-fprintf(stderr,"DEBUG %s %d: min misfit: i:%d j:%d k:%d    n:%d m:%f   offsets: %f %f %f\n",
-__FILE__,__LINE__,
-imin, jmin, kmin, gridnm[lc], gridm[lc],
-mbna_minmisfit_x / mbna_mtodeglon,
-mbna_minmisfit_y / mbna_mtodeglat,
-mbna_minmisfit_z);
-} */
-
-/* fprintf(stderr,"DEBUG %s %d: Misfit bounds: nmin:%d best:%f min:%f max:%f min loc: %f %f %f\n",
-__FILE__,__LINE__,
-mbna_minmisfit_n,mbna_minmisfit,misfit_min,misfit_max,
-mbna_minmisfit_x/mbna_mtodeglon,mbna_minmisfit_y/mbna_mtodeglat,mbna_minmisfit_z); */
-
-    		/* set message on */
-    		if (mbna_verbose > 1)
-			fprintf(stderr,"Histogram equalizing misfit grid for crossing %d\n",mbna_current_crossing);
-		sprintf(message,"Histogram equalizing misfit grid for crossing %d\n",mbna_current_crossing);
-		do_message_update(message);
-
-		/* sort the misfit to get histogram equalization */
-		grid_nxyzeq = 0;
-		for (l=0;l<gridm_nxyz;l++)
-		    {
-		    if (gridm[l] > 0.0)
-			{
-			gridmeq[grid_nxyzeq] = gridm[l];
-			grid_nxyzeq++;
-			}
-		    }
-
-		if (grid_nxyzeq > 0)
-		    {
-			qsort((char *)gridmeq,grid_nxyzeq,sizeof(double),mb_double_compare);
-			dinterval = ((double) grid_nxyzeq) / ((double)(nmisfit_intervals-1));
-			if (dinterval < 1.0)
-			    {
-			    for (l=0;l<grid_nxyzeq;l++)
-				    misfit_intervals[l] = gridmeq[l];
-			    for (l=grid_nxyzeq;l<nmisfit_intervals;l++)
-				    misfit_intervals[l] = gridmeq[grid_nxyzeq-1];
-			    }
-			else
-			    {
-			    misfit_intervals[0] = misfit_min;
-			    misfit_intervals[nmisfit_intervals-1] = misfit_max;
-			    for (l=1;l<nmisfit_intervals-1;l++)
-				    {
-				    ll = (int)(l * dinterval);
-				    misfit_intervals[l] = gridmeq[ll];
-				    }
-		    }
-
-		    /* get minimum misfit in 2D plane at current z offset */
-		    mbnavadjust_get_misfitxy();
-
-   		    /* set message on */
-    		    if (mbna_verbose > 1)
-			fprintf(stderr,"Estimating 3D uncertainty for crossing %d\n",mbna_current_crossing);
-		    sprintf(message,"Estimating 3D uncertainty for crossing %d\n",mbna_current_crossing);
-		    do_message_update(message);
-
-		    /* estimating 3 component uncertainty vector at minimum misfit point */
-		    /* first get the longest vector to a misfit value <= 2 times minimum misfit */
-		    minmisfitthreshold = mbna_minmisfit * 3.0;
-		    mbna_minmisfit_sr1 = 0.0;
-		    for (ic=0;ic<gridm_nx;ic++)
-			for (jc=0;jc<gridm_ny;jc++)
-			    for (kc=0;kc<nzmisfitcalc;kc++)
-				{
-				lc = kc + nzmisfitcalc * (ic + jc * gridm_nx);
-				if (gridnm[lc] > mbna_minmisfit_nthreshold && gridm[lc] <= minmisfitthreshold)
-				    {
- 				    x = ((ic - gridm_nx / 2) * grid_dx + mbna_misfit_offset_x - mbna_minmisfit_x) / mbna_mtodeglon;
-				    y = ((jc - gridm_ny / 2) * grid_dy + mbna_misfit_offset_y - mbna_minmisfit_y) / mbna_mtodeglat;
-				    z = zmin + zoff_dz * kc - mbna_minmisfit_z;
-				    r = sqrt(x * x + y * y + z * z);
-/* fprintf(stderr,"DEBUG %s %d: %d %d %d gridm[%d]:%f minmisfitthreshold:%f x: %f %f %f  r:%f\n",
-__FILE__,__LINE__,
-ic,jc,kc,lc,gridm[lc],minmisfitthreshold,x,y,z,r); */
-				    if (r > mbna_minmisfit_sr1)
-					{
-					mbna_minmisfit_sx1[0] = x;
-					mbna_minmisfit_sx1[1] = y;
-					mbna_minmisfit_sx1[2] = z;
-					mbna_minmisfit_sr1 = r;
-					}
-				    }
-				}
-		    mbna_minmisfit_sx1[0] /= mbna_minmisfit_sr1;
-		    mbna_minmisfit_sx1[1] /= mbna_minmisfit_sr1;
-		    mbna_minmisfit_sx1[2] /= mbna_minmisfit_sr1;
-/* fprintf(stderr,"DEBUG %s %d: Longest vector in misfit space. %f %f %f  r:%f\n",
-__FILE__,__LINE__,
-mbna_minmisfit_sx1[0],mbna_minmisfit_sx1[1],mbna_minmisfit_sx1[2],mbna_minmisfit_sr1); */
-
-		    /* now get a horizontal unit vector perpendicular to the the longest vector
-			    and then find the largest r associated with that vector */
-		    mbna_minmisfit_sr2 = sqrt(mbna_minmisfit_sx1[0] * mbna_minmisfit_sx1[0] + mbna_minmisfit_sx1[1] * mbna_minmisfit_sx1[1]);
-		    if (mbna_minmisfit_sr2 < MBNA_SMALL)
-			    {
-			    mbna_minmisfit_sx2[0] = 0.0;
-			    mbna_minmisfit_sx2[1] = 1.0;
-			    mbna_minmisfit_sx2[2] = 0.0;
-			    mbna_minmisfit_sr2 = 1.0;
-			    }
-		    else
-			    {
-			    mbna_minmisfit_sx2[0] = mbna_minmisfit_sx1[1] / mbna_minmisfit_sr2;
-			    mbna_minmisfit_sx2[1] = -mbna_minmisfit_sx1[0] / mbna_minmisfit_sr2;
-			    mbna_minmisfit_sx2[2] = 0.0;
-			    mbna_minmisfit_sr2 = sqrt(mbna_minmisfit_sx2[0] * mbna_minmisfit_sx2[0] + mbna_minmisfit_sx2[1] * mbna_minmisfit_sx2[1] + mbna_minmisfit_sx2[2] * mbna_minmisfit_sx2[2]);
-			    }
-/* dotproduct = (mbna_minmisfit_sx1[0] * mbna_minmisfit_sx2[0] + mbna_minmisfit_sx1[1] * mbna_minmisfit_sx2[1] + mbna_minmisfit_sx1[2] * mbna_minmisfit_sx2[2]);
-fprintf(stderr,"DEBUG %s %d: Horizontal perpendicular vector in misfit space. %f %f %f  r:%f dotproduct:%f\n",
-__FILE__,__LINE__,
-mbna_minmisfit_sx2[0],mbna_minmisfit_sx2[1],mbna_minmisfit_sx2[2],mbna_minmisfit_sr2,dotproduct); */
-
-		    /* now get a near-vertical unit vector perpendicular to the the longest vector
-			    and then find the largest r associated with that vector */
-		    mbna_minmisfit_sr3 = sqrt(mbna_minmisfit_sx1[0] * mbna_minmisfit_sx1[0] + mbna_minmisfit_sx1[1] * mbna_minmisfit_sx1[1]);
-		    if (mbna_minmisfit_sr3 < MBNA_SMALL)
-			{
-			mbna_minmisfit_sx3[0] = 0.0;
-			mbna_minmisfit_sx3[1] = 0.0;
-			mbna_minmisfit_sx3[2] = 1.0;
-			mbna_minmisfit_sr3 = 1.0;
-			}
-		    else
-			{
-			if (mbna_minmisfit_sx1[2] >= 0.0)
-			    {
-			    mbna_minmisfit_sx3[0] = -mbna_minmisfit_sx1[0] * sqrt(1.0 - mbna_minmisfit_sr3 * mbna_minmisfit_sr3) / mbna_minmisfit_sr3;
-			    mbna_minmisfit_sx3[1] = -mbna_minmisfit_sx1[1] * sqrt(1.0 - mbna_minmisfit_sr3 * mbna_minmisfit_sr3) / mbna_minmisfit_sr3;
-			    }
-			else
-			    {
-			    mbna_minmisfit_sx3[0] = mbna_minmisfit_sx1[0] * sqrt(1.0 - mbna_minmisfit_sr3 * mbna_minmisfit_sr3) / mbna_minmisfit_sr3;
-			    mbna_minmisfit_sx3[1] = mbna_minmisfit_sx1[1] * sqrt(1.0 - mbna_minmisfit_sr3 * mbna_minmisfit_sr3) / mbna_minmisfit_sr3;
-			    }
-			mbna_minmisfit_sx3[2] = mbna_minmisfit_sr3;
-			mbna_minmisfit_sr3 = sqrt(mbna_minmisfit_sx3[0] * mbna_minmisfit_sx3[0] + mbna_minmisfit_sx3[1] * mbna_minmisfit_sx3[1] + mbna_minmisfit_sx3[2] * mbna_minmisfit_sx3[2]);
-			}
-/* dotproduct = (mbna_minmisfit_sx1[0] * mbna_minmisfit_sx3[0] + mbna_minmisfit_sx1[1] * mbna_minmisfit_sx3[1] + mbna_minmisfit_sx1[2] * mbna_minmisfit_sx3[2]);
-fprintf(stderr,"DEBUG %s %d: Perpendicular near-vertical vector in misfit space. %f %f %f  r:%f dotproduct:%f\n",
-__FILE__,__LINE__,
-mbna_minmisfit_sx3[0],mbna_minmisfit_sx3[1],mbna_minmisfit_sx3[2],mbna_minmisfit_sr2,dotproduct); */
-
-		    /* now get the longest r values to a misfit value <= 2 times minimum misfit
-			    for both secondary vectors */
-		    mbna_minmisfit_sr2 = 0.0;
-		    mbna_minmisfit_sr3 = 0.0;
-		    dotproductsave2 = 0.0;
-		    rsave2 = 0.0;
-		    dotproductsave3 = 0.0;
-		    rsave3 = 0.0;
-		    for (ic=0;ic<gridm_nx;ic++)
-			for (jc=0;jc<gridm_ny;jc++)
-			    for (kc=0;kc<nzmisfitcalc;kc++)
-				{
-				lc = kc + nzmisfitcalc * (ic + jc * gridm_nx);
-				if (gridnm[lc] > mbna_minmisfit_nthreshold && gridm[lc] <= minmisfitthreshold)
-				    {
- 				    x = ((ic - gridm_nx / 2) * grid_dx + mbna_misfit_offset_x - mbna_minmisfit_x) / mbna_mtodeglon;
-				    y = ((jc - gridm_ny / 2) * grid_dy + mbna_misfit_offset_y - mbna_minmisfit_y) / mbna_mtodeglat;
-				    z = zmin + zoff_dz * kc - mbna_minmisfit_z;
-				    r = sqrt(x * x + y * y + z * z);
-				    if (r > mbna_minmisfit_sr2)
-					{
-					dotproduct = (x * mbna_minmisfit_sx2[0] + y * mbna_minmisfit_sx2[1] + z * mbna_minmisfit_sx2[2]) / r ;
-					if (fabs(dotproduct) > 0.8)
-					    {
-/* fprintf(stderr,"DEBUG %s %d: Vector2: %d %d %d gridm[%d]:%f minmisfitthreshold:%f dotproduct:%f x: %f %f %f  r:%f\n",
-__FILE__,__LINE__,
-ic,jc,kc,lc,gridm[lc],minmisfitthreshold,dotproduct,x,y,z,r); */
-					    mbna_minmisfit_sr2 = r;
-					    }
-					if (fabs(dotproduct) > dotproductsave2)
-					    {
-					    dotproductsave2 = fabs(dotproduct);
-					    rsave2 = r;
-					    }
-					}
-				    if (r > mbna_minmisfit_sr3)
-					{
-					dotproduct = (x * mbna_minmisfit_sx3[0] + y * mbna_minmisfit_sx3[1] + z * mbna_minmisfit_sx3[2]) / r ;
-					if (fabs(dotproduct) > 0.8)
-					    {
-/* fprintf(stderr,"DEBUG %s %d: Vector3: %d %d %d gridm[%d]:%f minmisfitthreshold:%f dotproduct:%f x: %f %f %f  r:%f\n",
-__FILE__,__LINE__,
-ic,jc,kc,lc,gridm[lc],minmisfitthreshold,dotproduct,x,y,z,r); */
-					    mbna_minmisfit_sr3 = r;
-					    }
-					if (fabs(dotproduct) > dotproductsave3)
-					    {
-					    dotproductsave3 = fabs(dotproduct);
-					    rsave3 = r;
-					    }
-					}
-				    }
-				}
-		    if (mbna_minmisfit_sr2 < MBNA_SMALL)
-		    	mbna_minmisfit_sr2 = rsave2;
-		    if (mbna_minmisfit_sr3 < MBNA_SMALL)
-		    	mbna_minmisfit_sr3 = rsave3;
-		    }
-		else
-		    {
-		    mbna_minmisfit_sx1[0] = 1.0;
-		    mbna_minmisfit_sx1[1] = 0.0;
-		    mbna_minmisfit_sx1[2] = 0.0;
-		    mbna_minmisfit_sr1 = 100.0;
-		    mbna_minmisfit_sx2[0] = 0.0;
-		    mbna_minmisfit_sx2[1] = 1.0;
-		    mbna_minmisfit_sx2[2] = 0.0;
-		    mbna_minmisfit_sr2 = 100.0;
-		    mbna_minmisfit_sx3[0] = 0.0;
-		    mbna_minmisfit_sx3[1] = 0.0;
-		    mbna_minmisfit_sx3[2] = 1.0;
-		    mbna_minmisfit_sr3 = 100.0;
-		    }
-/* fprintf(stderr,"DEBUG %s %d: \nVector1: %f %f %f  mbna_minmisfit_sr1:%f\n",
-__FILE__,__LINE__,
-mbna_minmisfit_sx1[0],mbna_minmisfit_sx1[1],mbna_minmisfit_sx1[2],mbna_minmisfit_sr1);
-fprintf(stderr,"Vector2: %f %f %f  mbna_minmisfit_sr2:%f\n",
-mbna_minmisfit_sx2[0],mbna_minmisfit_sx2[1],mbna_minmisfit_sx2[2],mbna_minmisfit_sr2);
-fprintf(stderr,"Vector3: %f %f %f  mbna_minmisfit_sr3:%f\n",
-mbna_minmisfit_sx3[0],mbna_minmisfit_sx3[1],mbna_minmisfit_sx3[2],mbna_minmisfit_sr3);
-dotproduct = (mbna_minmisfit_sx1[0] * mbna_minmisfit_sx2[0]
-		+ mbna_minmisfit_sx1[1] * mbna_minmisfit_sx2[1]
-		+ mbna_minmisfit_sx1[2] * mbna_minmisfit_sx2[2]);
-fprintf(stderr,"Dot products: 1v2:%f ",dotproduct);
-dotproduct = (mbna_minmisfit_sx2[0] * mbna_minmisfit_sx3[0]
-		+ mbna_minmisfit_sx2[1] * mbna_minmisfit_sx3[1]
-		+ mbna_minmisfit_sx2[2] * mbna_minmisfit_sx3[2]);
-fprintf(stderr,"2v3:%f ",dotproduct);
-dotproduct = (mbna_minmisfit_sx1[0] * mbna_minmisfit_sx3[0]
-		+ mbna_minmisfit_sx1[1] * mbna_minmisfit_sx3[1]
-		+ mbna_minmisfit_sx1[2] * mbna_minmisfit_sx3[2]);
-fprintf(stderr,"3v2:%f\n",dotproduct); */
-		}
-
- 	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbnavadjust_get_misfitxy()
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_get_misfitxy";
-	int	status = MB_SUCCESS;
-	int	ic, jc, kc, lc;
-
- 	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
-
-    	if (project.open == MB_YES
-    		&& project.num_crossings > 0
-    		&& mbna_current_crossing >= 0
-		&& mbna_naverr_load == MB_YES)
-    		{
-		/* get minimum misfit in plane at current z offset */
-		if (grid_nxyzeq > 0)
-		    {
-		    /* get closest to current zoffset in existing 3d grid */
-		    misfit_max = 0.0;
-		    misfit_min = 0.0;
-		    kc = (int)((mbna_offset_z - zmin) / zoff_dz);
-		    for (ic=0;ic<gridm_nx;ic++)
-			for (jc=0;jc<gridm_ny;jc++)
-			    {
-			    lc = kc + nzmisfitcalc * (ic + jc * gridm_nx);
-			    if (gridnm[lc] > mbna_minmisfit_nthreshold)
-				{
-				if (misfit_max == 0.0)
-			    	    {
-				    misfit_min = gridm[lc];
-				    misfit_max = gridm[lc];
-				    }
-				else if (gridm[lc] < misfit_min)
-				    {
-				    misfit_min = gridm[lc];
-				    mbna_minmisfit_xh = (ic - gridm_nx / 2) * grid_dx + mbna_misfit_offset_x;
-				    mbna_minmisfit_yh = (jc - gridm_ny / 2) * grid_dy + mbna_misfit_offset_y;
-				    mbna_minmisfit_zh = zmin + zoff_dz * kc;
-				    }
-				else if (gridm[lc] > misfit_max)
-				    {
-				    misfit_max = gridm[lc];
-				    }
-				}
-			    }
-/* fprintf(stderr,"mbnavadjust_get_misfitxy a mbna_minmisfit_xh:%f mbna_minmisfit_yh:%f mbna_minmisfit_zh:%f\n",
-mbna_minmisfit_xh,mbna_minmisfit_yh,mbna_minmisfit_zh); */
-		    }
-/* fprintf(stderr,"mbnavadjust_get_misfitxy b mbna_minmisfit_xh:%f mbna_minmisfit_yh:%f mbna_minmisfit_zh:%f\n",
-mbna_minmisfit_xh,mbna_minmisfit_yh,mbna_minmisfit_zh); */
-		}
-/* fprintf(stderr,"mbnavadjust_get_misfitxy c mbna_minmisfit_xh:%f mbna_minmisfit_yh:%f mbna_minmisfit_zh:%f\n",
-mbna_minmisfit_xh,mbna_minmisfit_yh,mbna_minmisfit_zh); */
-
- 	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-void mbnavadjust_plot(double xx,double yy,int ipen)
-{
-	struct mbna_plot_vector *v;
-	double	x, y;
-
-	if (mbna_contour->nvector >= mbna_contour->nvector_alloc)
-	    {
-	    mbna_contour->nvector_alloc += MBNA_VECTOR_ALLOC_INC;
-	    mbna_contour->vector = (struct mbna_plot_vector *)
-	    		realloc(mbna_contour->vector,
-			sizeof(struct mbna_plot_vector)
-			    * (mbna_contour->nvector_alloc));
-	    if (mbna_contour->vector == NULL)
-		mbna_contour->nvector_alloc = 0;
-	    }
-
-	if (mbna_contour->nvector_alloc > mbna_contour->nvector)
-	    {
-	    /* add current origin */
-	    x = xx + mbna_ox;
-	    y = yy + mbna_oy;
-
-	    /* move pen */
-	    if (ipen == MBNA_PEN_UP)
-		    {
-		    /* save move in vector array */
-		    v = &mbna_contour->vector[mbna_contour->nvector];
-		    v->command = ipen;
-		    v->x = xx;
-		    v->y = yy;
-		    mbna_contour->nvector++;
-		    }
-
-	    /* plot */
-	    else if (ipen == MBNA_PEN_DOWN)
-		    {
-		    /* save move in vector array */
-		    v = &mbna_contour->vector[mbna_contour->nvector];
-		    v->command = ipen;
-		    v->x = xx;
-		    v->y = yy;
-		    mbna_contour->nvector++;
-		    }
-
-	    /* change origin */
-	    else if (ipen == MBNA_PEN_ORIGIN)
-		    {
-		    mbna_ox = x;
-		    mbna_oy = y;
-		    }
-
-	    }
-	/*fprintf(stderr,"plot: %f %f %d\n",x,y,ipen);*/
-	return;
-}
-/*--------------------------------------------------------------------*/
-void mbnavadjust_newpen(int icolor)
-{
-	struct mbna_plot_vector *v;
-
-	if (mbna_contour->nvector >= mbna_contour->nvector_alloc)
-	    {
-	    mbna_contour->nvector_alloc += MBNA_VECTOR_ALLOC_INC;
-	    mbna_contour->vector = (struct mbna_plot_vector *) realloc(mbna_contour->vector,
-			sizeof(struct mbna_plot_vector)
-			    * (mbna_contour->nvector_alloc + MBNA_VECTOR_ALLOC_INC));
-	    if (mbna_contour->vector == NULL)
-		mbna_contour->nvector_alloc = 0;
-	    }
-
-	if (mbna_contour->nvector_alloc > mbna_contour->nvector)
-	    {
-	    /* save pen change in vector array */
-	    v = &mbna_contour->vector[mbna_contour->nvector];
- 	    v->command = MBNA_PEN_COLOR;
-	    v->color = pixel_values[icolor * 8 + 7];
-	    mbna_contour->nvector++;
-	    }
-
-	/*fprintf(stderr,"newpen: %d\n",icolor);*/
-	return;
-}
-/*--------------------------------------------------------------------*/
-void mbnavadjust_setline(int linewidth)
-{
-	return;
-}
-/*--------------------------------------------------------------------*/
-void mbnavadjust_justify_string(double height,char *string, double *s)
-{
-	int	len;
-
-	len = strlen(string);
-	s[0] = 0.0;
-	s[1] = 0.185*height*len;
-	s[2] = 0.37*len*height;
-	s[3] = 0.37*len*height;
-
-	return;
-}
-/*--------------------------------------------------------------------*/
-void mbnavadjust_plot_string(double x, double y, double hgt, double angle, char *label)
-{
-
-	return;
-}
-/*--------------------------------------------------------------------*/
-
-void
-mbnavadjust_naverr_scale()
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_naverr_scale";
-	int	status = MB_SUCCESS;
-	double	xscale, yscale;
-
- 	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
-
-	if (mbna_naverr_load == MB_YES)
-	    {
-	    /* set scaling for contour window */
-	    xscale = (cont_borders[1] - cont_borders[0])
-		    / ((mbna_plot_lon_max - mbna_plot_lon_min) / mbna_mtodeglon);
-	    yscale = (cont_borders[3] - cont_borders[2])
-		    / ((mbna_plot_lat_max - mbna_plot_lat_min) / mbna_mtodeglat);
-	    if (xscale < yscale)
-		{
-		mbna_plotx_scale = xscale / mbna_mtodeglon;
-		mbna_ploty_scale = xscale / mbna_mtodeglat;
-		mbna_plot_lat_min =  0.5 * (mbna_plot_lat_min + mbna_plot_lat_max)
-					- 0.5 * (cont_borders[3] - cont_borders[2]) / mbna_ploty_scale;
-		mbna_plot_lat_max =  mbna_plot_lat_min
-					+ (cont_borders[3] - cont_borders[2]) / mbna_ploty_scale;
-		}
-	    else
-		{
-		mbna_plotx_scale = yscale / mbna_mtodeglon;
-		mbna_ploty_scale = yscale / mbna_mtodeglat;
-		mbna_plot_lon_min =  0.5 * (mbna_plot_lon_min + mbna_plot_lon_max)
-					- 0.5 * (cont_borders[1] - cont_borders[0]) / mbna_plotx_scale;
-		mbna_plot_lon_max =  mbna_plot_lon_min
-					+ (cont_borders[1] - cont_borders[0]) / mbna_plotx_scale;
-		}
-
-	    /* set scaling for misfit window */
-	    mbna_misfit_xscale = (corr_borders[1] - corr_borders[0])
-		    / (grid_dx * (gridm_nx - 1));
-	    mbna_misfit_yscale = (corr_borders[3] - corr_borders[2])
-		    / (grid_dy * (gridm_ny - 1));
-	    }
-
- 	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-}
-/*--------------------------------------------------------------------*/
-
-void
-mbnavadjust_naverr_plot(int plotmode)
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_naverr_plot";
-	int	status = MB_SUCCESS;
-	struct mbna_plot_vector *v;
-	struct mbna_crossing *crossing;
-	struct mbna_file *file1, *file2;
-	struct mbna_section *section1, *section2;
-	struct mbna_tie *tie;
-	int 	ix, iy, ix1, ix2, iy1, iy2, idx, idy;
-	int	boxoff, boxwid;
-	static int 	ixo, iyo;
-	static int 	izx1, izy1, izx2, izy2;
-	static int 	pixel, ipixel;
-	int	snav_1, snav_2;
-	double	dmisfit;
-	int	fill, found;
-	int	i, j, k, kk, l;
-
- 	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
-
-	if (mbna_naverr_load == MB_YES)
-	    {
-	    /* get structures */
-	    crossing = (struct mbna_crossing *) &project.crossings[mbna_current_crossing];
-	    file1 = (struct mbna_file *) &project.files[crossing->file_id_1];
-	    file2 = (struct mbna_file *) &project.files[crossing->file_id_2];
-	    section1 = (struct mbna_section *) &file1->sections[crossing->section_1];
-	    section2 = (struct mbna_section *) &file2->sections[crossing->section_2];
-
-	    /* get naverr plot scaling */
-	    mbnavadjust_naverr_scale();
-
-	    /* clear screens for first plot */
-	    if (plotmode == MBNA_PLOT_MODE_FIRST)
-		{
-		xg_fillrectangle(pcont_xgid, 0, 0,
-			    cont_borders[1], cont_borders[3],
-			    pixel_values[mbna_color_background], XG_SOLIDLINE);
-		xg_fillrectangle(pcorr_xgid, 0, 0,
-			    corr_borders[1], corr_borders[3],
-			    pixel_values[mbna_color_background], XG_SOLIDLINE);
-		}
-	    xg_fillrectangle(pzoff_xgid, 0, 0,
-			    zoff_borders[1], zoff_borders[3],
-			    pixel_values[mbna_color_background], XG_SOLIDLINE);
-
-	    /* replot section 2 and tie points in background if moving that section */
-	    if (plotmode == MBNA_PLOT_MODE_MOVE)
-	    {
-	    for (i=0;i<mbna_contour2.nvector;i++)
-		{
-		v = &mbna_contour2.vector[i];
-
-		if (v->command == MBNA_PEN_UP)
-		    {
-		    ixo = (int)(mbna_plotx_scale * (v->x + mbna_offset_x_old - mbna_plot_lon_min));
-		    iyo = (int)(cont_borders[3] - mbna_ploty_scale * (v->y + mbna_offset_y_old - mbna_plot_lat_min));
-		    }
-		else if (v->command == MBNA_PEN_DOWN)
-		    {
-		    ix = (int)(mbna_plotx_scale * (v->x + mbna_offset_x_old - mbna_plot_lon_min));
-		    iy = (int)(cont_borders[3] - mbna_ploty_scale * (v->y + mbna_offset_y_old - mbna_plot_lat_min));
-		    xg_drawline(pcont_xgid, ixo, iyo, ix, iy, pixel_values[mbna_color_background], XG_SOLIDLINE);
-		    ixo = ix;
-		    iyo = iy;
-		    }
-		}
-	    ixo = (int)(mbna_plotx_scale * (swathraw2->pingraws[0].navlon + mbna_offset_x_old - mbna_plot_lon_min));
-	    iyo = (int)(cont_borders[3] - mbna_ploty_scale * (swathraw2->pingraws[0].navlat + mbna_offset_y_old - mbna_plot_lat_min));
-	    for (i=1;i<swathraw2->npings;i++)
-		{
-		ix = (int)(mbna_plotx_scale * (swathraw2->pingraws[i].navlon + mbna_offset_x_old - mbna_plot_lon_min));
-		iy = (int)(cont_borders[3] - mbna_ploty_scale * (swathraw2->pingraws[i].navlat + mbna_offset_y_old - mbna_plot_lat_min));
-		xg_drawline(pcont_xgid, ixo, iyo, ix, iy, pixel_values[mbna_color_background], XG_SOLIDLINE);
-		ixo = ix;
-		iyo = iy;
-		}
-
-	    /* replot tie points */
-	    if (crossing->num_ties > 0)
-		{
-		for (i=0;i<crossing->num_ties;i++)
-		    {
-		    tie = &crossing->ties[i];
-		    if (i == mbna_current_tie)
-			{
-			boxoff = 6;
-			boxwid = 13;
-			snav_1 = mbna_snav_1;
-			snav_2 = mbna_snav_2;
-			}
-		    else
-			{
-			boxoff = 3;
-			boxwid = 7;
-			snav_1 = tie->snav_1;
-			snav_2 = tie->snav_2;
-			}
-		    ix = (int)(mbna_plotx_scale * (section1->snav_lon[snav_1] - mbna_plot_lon_min));
-		    iy = (int)(cont_borders[3] - mbna_ploty_scale * (section1->snav_lat[snav_1] - mbna_plot_lat_min));
-		    xg_fillrectangle(pcont_xgid, ix-boxoff, iy-boxoff, boxwid, boxwid, pixel_values[mbna_color_background], XG_SOLIDLINE);
-		    xg_drawrectangle(pcont_xgid, ix-boxoff, iy-boxoff, boxwid, boxwid, pixel_values[mbna_color_background], XG_SOLIDLINE);
-		    ixo = ix;
-		    iyo = iy;
-		    ix = (int)(mbna_plotx_scale * (section2->snav_lon[snav_2] + mbna_offset_x_old - mbna_plot_lon_min));
-		    iy = (int)(cont_borders[3] - mbna_ploty_scale * (section2->snav_lat[snav_2] + mbna_offset_y_old - mbna_plot_lat_min));
-		    xg_fillrectangle(pcont_xgid, ix-boxoff, iy-boxoff, boxwid, boxwid, pixel_values[mbna_color_background], XG_SOLIDLINE);
-		    xg_drawrectangle(pcont_xgid, ix-boxoff, iy-boxoff, boxwid, boxwid, pixel_values[mbna_color_background], XG_SOLIDLINE);
-		    xg_drawline(pcont_xgid, ixo, iyo, ix, iy, pixel_values[mbna_color_background], XG_SOLIDLINE);
-		    }
-		}
-	    }
-
-	    /* replot zoom box in background if moving that box */
-	    if (plotmode == MBNA_PLOT_MODE_ZOOM)
-		{
-		xg_drawrectangle(pcont_xgid,
-				    MIN(izx1, izx2),
-				    MIN(izy1, izy2),
-				    MAX(izx1, izx2) - MIN(izx1, izx2),
-				    MAX(izy1, izy2) - MIN(izy1, izy2),
-				    pixel_values[mbna_color_background], XG_SOLIDLINE);
-		}
-
-	    /* replot overlap box in background */
-	    if (mbna_overlap_lon_max > mbna_overlap_lon_min && mbna_overlap_lat_max > mbna_overlap_lat_min)
-		{
-		ix1 = (int)(mbna_plotx_scale * (mbna_overlap_lon_min - mbna_plot_lon_min));
-		iy1 = (int)(cont_borders[3] - mbna_ploty_scale * (mbna_overlap_lat_min - mbna_plot_lat_min));
-		ix2 = (int)(mbna_plotx_scale * (mbna_overlap_lon_max - mbna_plot_lon_min));
-		iy2 = (int)(cont_borders[3] - mbna_ploty_scale * (mbna_overlap_lat_max - mbna_plot_lat_min));
-		ix = MIN(ix1,ix2);
-		iy = MIN(iy1,iy2);
-		idx = MAX(ix1,ix2) - ix;
-		idy = MAX(iy1,iy2) - iy;
-		xg_drawrectangle(pcont_xgid,
-	    			    ix, iy, idx, idy,
-				    pixel_values[mbna_color_background], XG_DASHLINE);
-		}
-
-	    /* plot section 1 */
-	    for (i=0;i<mbna_contour1.nvector;i++)
-		{
-		v = &mbna_contour1.vector[i];
-
-		if (v->command == MBNA_PEN_COLOR)
-		    {
-		    pixel = v->color;
-		    }
-		else if (v->command == MBNA_PEN_UP)
-		    {
-		    ixo = (int)(mbna_plotx_scale * (v->x - mbna_plot_lon_min));
-		    iyo = (int)(cont_borders[3] - mbna_ploty_scale * (v->y - mbna_plot_lat_min));
-		    }
-		else if (v->command == MBNA_PEN_DOWN)
-		    {
-		    ix = (int)(mbna_plotx_scale * (v->x - mbna_plot_lon_min));
-		    iy = (int)(cont_borders[3] - mbna_ploty_scale * (v->y - mbna_plot_lat_min));
-		    xg_drawline(pcont_xgid, ixo, iyo, ix, iy, pixel, XG_SOLIDLINE);
-		    ixo = ix;
-		    iyo = iy;
-		    }
-		}
-	    ixo = (int)(mbna_plotx_scale * (swathraw1->pingraws[0].navlon - mbna_plot_lon_min));
-	    iyo = (int)(cont_borders[3] - mbna_ploty_scale * (swathraw1->pingraws[0].navlat - mbna_plot_lat_min));
-	    for (i=1;i<swathraw1->npings;i++)
-		{
-		ix = (int)(mbna_plotx_scale * (swathraw1->pingraws[i].navlon - mbna_plot_lon_min));
-		iy = (int)(cont_borders[3] - mbna_ploty_scale * (swathraw1->pingraws[i].navlat - mbna_plot_lat_min));
-		xg_drawline(pcont_xgid, ixo, iyo, ix, iy, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-		ixo = ix;
-		iyo = iy;
-		}
-
-	    /* plot section 2 */
-	    for (i=0;i<mbna_contour2.nvector;i++)
-		{
-		v = &mbna_contour2.vector[i];
-
-		if (v->command == MBNA_PEN_COLOR)
-		    {
-		    pixel = v->color;
-		    }
-		else if (v->command == MBNA_PEN_UP)
-		    {
-		    ixo = (int)(mbna_plotx_scale * (v->x + mbna_offset_x - mbna_plot_lon_min));
-		    iyo = (int)(cont_borders[3] - mbna_ploty_scale * (v->y + mbna_offset_y - mbna_plot_lat_min));
-		    }
-		else if (v->command == MBNA_PEN_DOWN)
-		    {
-		    ix = (int)(mbna_plotx_scale * (v->x + mbna_offset_x - mbna_plot_lon_min));
-		    iy = (int)(cont_borders[3] - mbna_ploty_scale * (v->y + mbna_offset_y - mbna_plot_lat_min));
-		    xg_drawline(pcont_xgid, ixo, iyo, ix, iy, pixel, XG_SOLIDLINE);
-		    ixo = ix;
-		    iyo = iy;
-		    }
-		}
-	    ixo = (int)(mbna_plotx_scale * (swathraw2->pingraws[0].navlon + mbna_offset_x - mbna_plot_lon_min));
-	    iyo = (int)(cont_borders[3] - mbna_ploty_scale * (swathraw2->pingraws[0].navlat + mbna_offset_y - mbna_plot_lat_min));
-	    for (i=1;i<swathraw2->npings;i++)
-		{
-		ix = (int)(mbna_plotx_scale * (swathraw2->pingraws[i].navlon + mbna_offset_x - mbna_plot_lon_min));
-		iy = (int)(cont_borders[3] - mbna_ploty_scale * (swathraw2->pingraws[i].navlat + mbna_offset_y - mbna_plot_lat_min));
-		xg_drawline(pcont_xgid, ixo, iyo, ix, iy, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-		ixo = ix;
-		iyo = iy;
-		}
-
-	    /* plot tie points */
-	    mbnavadjust_naverr_checkoksettie();
-	    crossing = &project.crossings[mbna_current_crossing];
-	    if (crossing->num_ties > 0)
-		{
-		for (i=0;i<crossing->num_ties;i++)
-		    {
-		    tie = &crossing->ties[i];
-		    if (i == mbna_current_tie)
-			{
-			boxoff = 6;
-			boxwid = 13;
-			snav_1 = mbna_snav_1;
-			snav_2 = mbna_snav_2;
-			if (mbna_allow_set_tie == MB_YES)
-				fill = pixel_values[RED];
-		    	else
-				fill = pixel_values[6];
-			}
-		    else
-			{
-			boxoff = 3;
-			boxwid = 7;
-			snav_1 = tie->snav_1;
-			snav_2 = tie->snav_2;
-		    	fill = pixel_values[6];
-			}
-		    ix = (int)(mbna_plotx_scale * (section1->snav_lon[snav_1] - mbna_plot_lon_min));
-		    iy = (int)(cont_borders[3] - mbna_ploty_scale * (section1->snav_lat[snav_1] - mbna_plot_lat_min));
-		    xg_fillrectangle(pcont_xgid, ix-boxoff, iy-boxoff, boxwid, boxwid, fill, XG_SOLIDLINE);
-		    xg_drawrectangle(pcont_xgid, ix-boxoff, iy-boxoff, boxwid, boxwid, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-		    ixo = ix;
-		    iyo = iy;
-		    ix = (int)(mbna_plotx_scale * (section2->snav_lon[snav_2] + mbna_offset_x - mbna_plot_lon_min));
-		    iy = (int)(cont_borders[3] - mbna_ploty_scale * (section2->snav_lat[snav_2] + mbna_offset_y - mbna_plot_lat_min));
-		    xg_fillrectangle(pcont_xgid, ix-boxoff, iy-boxoff, boxwid, boxwid, fill, XG_SOLIDLINE);
-		    xg_drawrectangle(pcont_xgid, ix-boxoff, iy-boxoff, boxwid, boxwid, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-		    xg_drawline(pcont_xgid, ixo, iyo, ix, iy, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-		    }
-		}
-
-	    /* plot overlap box */
-	    mbnavadjust_crossing_overlapbounds(mbna_current_crossing, mbna_offset_x, mbna_offset_y,
-	    					&mbna_overlap_lon_min, &mbna_overlap_lon_max,
-						&mbna_overlap_lat_min, &mbna_overlap_lat_max);
-	    ix1 = (int)(mbna_plotx_scale * (mbna_overlap_lon_min - mbna_plot_lon_min));
-	    iy1 = (int)(cont_borders[3] - mbna_ploty_scale * (mbna_overlap_lat_min - mbna_plot_lat_min));
-	    ix2 = (int)(mbna_plotx_scale * (mbna_overlap_lon_max - mbna_plot_lon_min));
-	    iy2 = (int)(cont_borders[3] - mbna_ploty_scale * (mbna_overlap_lat_max - mbna_plot_lat_min));
-	    ix = MIN(ix1,ix2);
-	    iy = MIN(iy1,iy2);
-	    idx = MAX(ix1,ix2) - ix;
-	    idy = MAX(iy1,iy2) - iy;
-	    xg_drawrectangle(pcont_xgid,
-	    			ix, iy, idx, idy,
-				pixel_values[mbna_color_foreground], XG_DASHLINE);
-
-	    /* plot zoom box if in zoom mode */
-	    if (plotmode == MBNA_PLOT_MODE_ZOOMFIRST || plotmode == MBNA_PLOT_MODE_ZOOM)
-		{
-		xg_drawrectangle(pcont_xgid,
-				    MIN(mbna_zoom_x1, mbna_zoom_x2),
-				    MIN(mbna_zoom_y1, mbna_zoom_y2),
-				    MAX(mbna_zoom_x1, mbna_zoom_x2) - MIN(mbna_zoom_x1, mbna_zoom_x2),
-				    MAX(mbna_zoom_y1, mbna_zoom_y2) - MIN(mbna_zoom_y1, mbna_zoom_y2),
-				    pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-		izx1 = mbna_zoom_x1;
-		izy1 = mbna_zoom_y1;
-		izx2 = mbna_zoom_x2;
-		izy2 = mbna_zoom_y2;
-		}
-
-	    /* plot misfit */
-	    ixo = corr_borders[0] + (corr_borders[1] - corr_borders[0]) / 2;
-	    iyo = corr_borders[2] + (corr_borders[3] - corr_borders[2]) / 2;
-	    dmisfit = log10(misfit_max - misfit_min)/79.99;
-	    k = (int)((mbna_offset_z - zmin) / zoff_dz);
-	    for (i=0;i<gridm_nx;i++)
-		for(j=0;j<gridm_ny;j++)
-		    {
-		    l = k + nzmisfitcalc * (i + j * gridm_nx);
-		    if (gridnm[l] > 0)
-			{
-			ix = ixo + (int)(mbna_misfit_xscale * grid_dx
-					    * (i - gridm_nx / 2 - 0.5));
-			iy = iyo - (int)(mbna_misfit_yscale * grid_dy
-					    * (j - gridm_ny / 2 + 0.5));
-			idx = ixo + (int)(mbna_misfit_xscale * grid_dx
-					    * (i - gridm_nx / 2 + 0.5))
-				    - ix;
-			idy = iyo - (int)(mbna_misfit_yscale * grid_dy
-					    * (j - gridm_ny / 2 - 0.5))
-				    - iy;
-
-    			/* histogram equalized coloring */
-			if (gridm[l] <= misfit_intervals[0])
-				ipixel = 7;
-			else if (gridm[l] >= misfit_intervals[nmisfit_intervals-1])
-				ipixel = 7 + nmisfit_intervals - 1;
-			else
-				{
-				found = MB_NO;
-				for (kk=0;kk<nmisfit_intervals && found == MB_NO;kk++)
-					{
-					if (gridm[l] > misfit_intervals[kk]
-						&& gridm[l] <= misfit_intervals[kk+1])
-						{
-						ipixel = 7 + kk;
-						found = MB_YES;
-						}
-					}
-				}
-/*fprintf(stderr, "%d %d %f %f %f   %f %d\n",
-    i, j, misfit_min, misfit_max, dmisfit, gridm[l], ipixel);*/
-
-			xg_fillrectangle(pcorr_xgid,
-				    ix, iy, idx, idy,
-				    pixel_values[ipixel], XG_SOLIDLINE);
-			}
-		    }
-
-	    /* draw dashed crosshair across origin */
-	    xg_drawline(pcorr_xgid,
-			    ixo - (int)(mbna_misfit_xscale * mbna_misfit_offset_x),
-			    corr_borders[2],
-			    ixo - (int)(mbna_misfit_xscale * mbna_misfit_offset_x),
-			    corr_borders[3],
-			    pixel_values[mbna_color_foreground], XG_DASHLINE);
-	    xg_drawline(pcorr_xgid,
-			    corr_borders[0],
-			    iyo + (int)(mbna_misfit_yscale * mbna_misfit_offset_y),
-			    corr_borders[1],
-			    iyo + (int)(mbna_misfit_yscale * mbna_misfit_offset_y),
-			    pixel_values[mbna_color_foreground], XG_DASHLINE);
-
-	    /* draw working offset */
-	    ix = ixo + (int)(mbna_misfit_xscale * (mbna_offset_x - mbna_misfit_offset_x));
-	    iy = iyo - (int)(mbna_misfit_yscale * (mbna_offset_y - mbna_misfit_offset_y));
-	    xg_fillrectangle(pcorr_xgid, ix-3, iy-3, 7, 7, pixel_values[RED], XG_SOLIDLINE);
-	    xg_drawrectangle(pcorr_xgid, ix-3, iy-3, 7, 7, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-
-	    /* draw uncertainty estimate */
-	    if (mbna_minmisfit_n > 0)
-	    	{
-		ix = ixo + (int)(mbna_misfit_xscale * (mbna_minmisfit_x - mbna_misfit_offset_x));
-		iy = iyo - (int)(mbna_misfit_yscale * (mbna_minmisfit_y - mbna_misfit_offset_y));
-		idx = (int)(mbna_misfit_xscale * (mbna_mtodeglon * mbna_minmisfit_sr1 * mbna_minmisfit_sx1[0]));
-		idy = -(int)(mbna_misfit_yscale * (mbna_mtodeglat * mbna_minmisfit_sr1 * mbna_minmisfit_sx1[1]));
-		xg_drawline(pcorr_xgid,
-				ix - idx, iy - idy,
-				ix + idx, iy + idy,
-				pixel_values[mbna_color_background], XG_SOLIDLINE);
-
-		ix = ixo + (int)(mbna_misfit_xscale * (mbna_minmisfit_x - mbna_misfit_offset_x));
-		iy = iyo - (int)(mbna_misfit_yscale * (mbna_minmisfit_y - mbna_misfit_offset_y));
-		idx = (int)(mbna_misfit_xscale * (mbna_mtodeglon * mbna_minmisfit_sr2 * mbna_minmisfit_sx2[0]));
-		idy = -(int)(mbna_misfit_yscale * (mbna_mtodeglat * mbna_minmisfit_sr2 * mbna_minmisfit_sx2[1]));
-		xg_drawline(pcorr_xgid,
-				ix - idx, iy - idy,
-				ix + idx, iy + idy,
-				pixel_values[mbna_color_background], XG_SOLIDLINE);
-		}
-
-	    /* draw x at minimum misfit */
-	    if (mbna_minmisfit_n > 0)
-	    	{
-		ix = ixo + (int)(mbna_misfit_xscale * (mbna_minmisfit_x - mbna_misfit_offset_x));
-		iy = iyo - (int)(mbna_misfit_yscale * (mbna_minmisfit_y - mbna_misfit_offset_y));
-		xg_drawline(pcorr_xgid,
-				ix - 10, iy + 10,
-				ix + 10, iy - 10,
-				pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-		xg_drawline(pcorr_xgid,
-				ix + 10, iy + 10,
-				ix - 10, iy - 10,
-				pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-		}
-
-	    /* draw small x at minimum misfit for current z offset */
-	    if (mbna_minmisfit_n > 0)
-	    	{
-		ix = ixo + (int)(mbna_misfit_xscale * (mbna_minmisfit_xh - mbna_misfit_offset_x));
-		iy = iyo - (int)(mbna_misfit_yscale * (mbna_minmisfit_yh - mbna_misfit_offset_y));
-		xg_drawline(pcorr_xgid,
-				ix - 5, iy + 5,
-				ix + 5, iy - 5,
-				pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-		xg_drawline(pcorr_xgid,
-				ix + 5, iy + 5,
-				ix - 5, iy - 5,
-				pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-		}
-
-	    /* draw + at inversion solution */
-	    if (project.inversion != MBNA_INVERSION_NONE)
-	    	{
-	    	ix = ixo + (int)(mbna_misfit_xscale * (mbna_invert_offset_x - mbna_misfit_offset_x));
-	    	iy = iyo - (int)(mbna_misfit_yscale * (mbna_invert_offset_y - mbna_misfit_offset_y));
-	    	xg_drawline(pcorr_xgid,
-			    ix - 10, iy,
-			    ix + 10, iy,
-			    pixel_values[GREEN], XG_SOLIDLINE);
-	    	xg_drawline(pcorr_xgid,
-			    ix, iy + 10,
-			    ix, iy - 10,
-			    pixel_values[GREEN], XG_SOLIDLINE);
-	    	xg_drawline(pcorr_xgid,
-			    ix - 10, iy,
-			    ix + 10, iy,
-			    pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-	    	xg_drawline(pcorr_xgid,
-			    ix, iy + 10,
-			    ix, iy - 10,
-			    pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-		}
-
-	    /* plot zoff */
-	    ixo = zoff_borders[0];
-	    iyo = zoff_borders[3];
-	    i = (int)((mbna_offset_x - mbna_misfit_offset_x) / grid_dx) + (int)(gridm_nx / 2);
-	    i = MAX(0, MIN(gridm_nx-1, i));
-	    j = (int)((mbna_offset_y - mbna_misfit_offset_y) / grid_dy) + (int)(gridm_ny / 2);
-	    j = MAX(0, MIN(gridm_ny-1, j));
-	    found = MB_NO;
-	    zmisfitmin = 10000000.0;
-	    zmisfitmax = 0.0;
-	    for (k=0;k<nzmisfitcalc;k++)
-		{
-		l = k + nzmisfitcalc * (i + j * gridm_nx);
-		if (gridnm[l] > 0)
-		    {
-		    if (found == MB_NO)
-			{
-			zmisfitmin = gridm[l];
-			zmisfitmax = gridm[l];
-			found = MB_YES;
-			}
-		    else
-			{
-			zmisfitmin = MIN(zmisfitmin, gridm[l]);
-			zmisfitmax = MAX(zmisfitmax, gridm[l]);
-			}
-		    }
-		}
-/*fprintf(stderr,"Current offset: %f %f %f\n",
-mbna_offset_x / mbna_mtodeglon, mbna_offset_y / mbna_mtodeglat, mbna_offset_z);
-fprintf(stderr,"Current misfit grid offset: %f %f %f\n",
-mbna_misfit_offset_x / mbna_mtodeglon, mbna_misfit_offset_y / mbna_mtodeglat, mbna_misfit_offset_z);
-fprintf(stderr,"Current min misfit position: %f %f %f\n",
-mbna_minmisfit_x / mbna_mtodeglon, mbna_minmisfit_y / mbna_mtodeglat, mbna_minmisfit_z);
-fprintf(stderr,"misfitmin:%f misfitmax:%f  zmisfitmin:%f zmisfitmax:%f\n\n",
-misfit_min,misfit_max,zmisfitmin,zmisfitmax);*/
-	    zmisfitmin = zmisfitmin - 0.05 * (zmisfitmax - zmisfitmin);
-	    zmisfitmax = zmisfitmax + 0.04 * (zmisfitmax - zmisfitmin);
-	    mbna_zoff_scale_x = (zoff_borders[1] - zoff_borders[0])
-		    / (project.zoffsetwidth);
-	    mbna_zoff_scale_y = (zoff_borders[3] - zoff_borders[2])
-		    / (zmisfitmax - zmisfitmin);
-	    for (k=0;k<nzmisfitcalc;k++)
-		{
-		l = k + nzmisfitcalc * (i + j * gridm_nx);
-		if (gridnm[l] > 0)
-		    {
-   		    /* histogram equalized coloring */
-		    if (gridm[l] <= misfit_intervals[0])
-			    ipixel = 7;
-		    else if (gridm[l] >= misfit_intervals[nmisfit_intervals-1])
-			    ipixel = 7 + nmisfit_intervals - 1;
-		    else
-			{
-			found = MB_NO;
-			for (kk=0;kk<nmisfit_intervals && found == MB_NO;kk++)
-			    {
-			    if (gridm[l] > misfit_intervals[kk]
-				    && gridm[l] <= misfit_intervals[kk+1])
-				{
-				ipixel = 7 + kk;
-				found = MB_YES;
-				}
-			    }
-			}
-		    ix = ixo + (int)(mbna_zoff_scale_x * zoff_dz * (k - 0.5));
-		    iy = (int)(mbna_zoff_scale_y * (gridm[l] - zmisfitmin));
-		    idx = (int)(mbna_zoff_scale_x * zoff_dz);
-		    idx = MAX(idx, 1);
-		    idy = iyo - iy;
-/* fprintf(stderr,"Fill Zoff: %d %d %d %d  pixel:%d\n",
-ix, iy, idx, idy, pixel_values[ipixel]);*/
-		    xg_fillrectangle(pzoff_xgid,
-				ix, iy, idx, idy,
-				pixel_values[ipixel], XG_SOLIDLINE);
-		    }
-		}
-
-	    /* plot zero zoff */
-	    ix = ixo - (int)(mbna_zoff_scale_x * zmin);
-	    xg_drawline(pzoff_xgid,
-			    ix, zoff_borders[2],
-			    ix, zoff_borders[3],
-			    pixel_values[mbna_color_foreground], XG_DASHLINE);
-
-	    /* draw working offset */
-	    ix = ixo + (int)(mbna_zoff_scale_x * (mbna_offset_z - zmin));
-	    xg_drawline(pzoff_xgid,
-			    ix, zoff_borders[2],
-			    ix, zoff_borders[3],
-			    pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-
-	    /* draw x at minimum misfit */
-	    if (mbna_minmisfit_n > 0)
-	    	{
-		ix = ixo + (int)(mbna_zoff_scale_x * (mbna_minmisfit_z - zmin));
-		iy = zoff_borders[3] / 2;
-		xg_drawline(pzoff_xgid,
-				ix - 10, iy + 10,
-				ix + 10, iy - 10,
-				pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-		xg_drawline(pzoff_xgid,
-				ix + 10, iy + 10,
-				ix - 10, iy - 10,
-				pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-		}
-
-	    /* draw + at inversion solution */
-	    if (project.inversion != MBNA_INVERSION_NONE)
-	    	{
-	    	ix = ixo + (int)(mbna_zoff_scale_x * (mbna_invert_offset_z - zmin));
-	    	iy = zoff_borders[3] / 2;
-	    	xg_drawline(pzoff_xgid,
-			    ix - 10, iy,
-			    ix + 10, iy,
-			    pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-	    	xg_drawline(pzoff_xgid,
-			    ix, iy + 10,
-			    ix, iy - 10,
-			    pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-		}
-
-	    }
-
- 	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-}
-/*--------------------------------------------------------------------*/
-
-int
-mbnavadjust_autopick(int do_vertical)
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_autopick";
-	int	status = MB_SUCCESS;
-	struct 	mbna_crossing *crossing;
-	struct 	mbna_tie *tie;
-	double	firstsonardepth1, firsttime_d1, secondsonardepth1, secondtime_d1, dsonardepth1;
-	double	firstsonardepth2, firsttime_d2, secondsonardepth2, secondtime_d2, dsonardepth2;
-	double	overlap_scale;
-	int	found, process;
-	int	nprocess;
-	int	i, j, k;
-
- 	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2       do_vertical: %d\n",do_vertical);
-		}
-
-	/* make sure that all sections referenced in crossings have up-to-date contours made */
-    	if (project.open == MB_YES
-    		&& project.num_crossings > 0)
-    		{
-		/* set message dialog on */
-		sprintf(message,"Autopicking offsets...");
-		do_message_on(message);
-		sprintf(message,"Autopicking offsets...\n");
-		if (mbna_verbose == 0)
-		    fprintf(stderr,"%s\n",message);
-		do_info_add(message,MB_YES);
-
-		/* loop over all crossings */
-		nprocess = 0;
-		for (i=0;i<project.num_crossings;i++)
-			{
-			/* get structure */
-			crossing = &(project.crossings[i]);
-
-			/* check if processing should proceed */
-			process = MB_NO;
-			if (crossing->status == MBNA_CROSSING_STATUS_NONE
-				&& crossing->overlap >=  MBNA_MEDIOCREOVERLAP_THRESHOLD)
-				{
-				if (mbna_view_list == MBNA_VIEW_LIST_CROSSINGS)
-					{
-					if ((mbna_view_mode == MBNA_VIEW_MODE_ALL)
-						|| (mbna_view_mode == MBNA_VIEW_MODE_SURVEY
-							&& mbna_survey_select == project.files[crossing->file_id_1].block
-							&& mbna_survey_select == project.files[crossing->file_id_2].block)
-						|| (mbna_view_mode == MBNA_VIEW_MODE_FILE
-							&& mbna_file_select == crossing->file_id_1
-							&& mbna_file_select == crossing->file_id_2)
-						|| (mbna_view_mode == MBNA_VIEW_MODE_WITHSURVEY
-							&& (mbna_survey_select == project.files[crossing->file_id_1].block
-								|| mbna_survey_select == project.files[crossing->file_id_2].block))
-						|| (mbna_view_mode == MBNA_VIEW_MODE_WITHFILE
-							&& (mbna_file_select == crossing->file_id_1
-								|| mbna_file_select == crossing->file_id_2))
-						|| (mbna_view_mode == MBNA_VIEW_MODE_WITHSECTION
-							&& mbna_file_select == crossing->file_id_1
-							&& mbna_section_select == crossing->section_1)
-						|| (mbna_view_mode == MBNA_VIEW_MODE_WITHSECTION
-							&& mbna_file_select == crossing->file_id_2
-							&& mbna_section_select == crossing->section_2))
-						process = MB_YES;
-					}
-				else if (mbna_view_list == MBNA_VIEW_LIST_MEDIOCRECROSSINGS)
-					{
-					if (crossing->overlap >= MBNA_MEDIOCREOVERLAP_THRESHOLD)
-						{
-						if ((mbna_view_mode == MBNA_VIEW_MODE_ALL)
-							|| (mbna_view_mode == MBNA_VIEW_MODE_SURVEY
-								&& mbna_survey_select == project.files[crossing->file_id_1].block
-								&& mbna_survey_select == project.files[crossing->file_id_2].block)
-							|| (mbna_view_mode == MBNA_VIEW_MODE_FILE
-								&& mbna_file_select == crossing->file_id_1
-								&& mbna_file_select == crossing->file_id_2)
-							|| (mbna_view_mode == MBNA_VIEW_MODE_WITHSURVEY
-								&& (mbna_survey_select == project.files[crossing->file_id_1].block
-									|| mbna_survey_select == project.files[crossing->file_id_2].block))
-							|| (mbna_view_mode == MBNA_VIEW_MODE_WITHFILE
-								&& (mbna_file_select == crossing->file_id_1
-									|| mbna_file_select == crossing->file_id_2))
-							|| (mbna_view_mode == MBNA_VIEW_MODE_WITHSECTION
-								&& mbna_file_select == crossing->file_id_1
-								&& mbna_section_select == crossing->section_1)
-							|| (mbna_view_mode == MBNA_VIEW_MODE_WITHSECTION
-								&& mbna_file_select == crossing->file_id_2
-								&& mbna_section_select == crossing->section_2))
-						process = MB_YES;
-						}
-					}
-				else if (mbna_view_list == MBNA_VIEW_LIST_GOODCROSSINGS)
-					{
-					if (crossing->overlap >= MBNA_GOODOVERLAP_THRESHOLD)
-						{
-						if ((mbna_view_mode == MBNA_VIEW_MODE_ALL)
-							|| (mbna_view_mode == MBNA_VIEW_MODE_SURVEY
-								&& mbna_survey_select == project.files[crossing->file_id_1].block
-								&& mbna_survey_select == project.files[crossing->file_id_2].block)
-							|| (mbna_view_mode == MBNA_VIEW_MODE_FILE
-								&& mbna_file_select == crossing->file_id_1
-								&& mbna_file_select == crossing->file_id_2)
-							|| (mbna_view_mode == MBNA_VIEW_MODE_WITHSURVEY
-								&& (mbna_survey_select == project.files[crossing->file_id_1].block
-									|| mbna_survey_select == project.files[crossing->file_id_2].block))
-							|| (mbna_view_mode == MBNA_VIEW_MODE_WITHFILE
-								&& (mbna_file_select == crossing->file_id_1
-									|| mbna_file_select == crossing->file_id_2))
-							|| (mbna_view_mode == MBNA_VIEW_MODE_WITHSECTION
-								&& mbna_file_select == crossing->file_id_1
-								&& mbna_section_select == crossing->section_1)
-							|| (mbna_view_mode == MBNA_VIEW_MODE_WITHSECTION
-								&& mbna_file_select == crossing->file_id_2
-								&& mbna_section_select == crossing->section_2))
-						process = MB_YES;
-						}
-					}
-				else if (mbna_view_list == MBNA_VIEW_LIST_BETTERCROSSINGS)
-					{
-					if (crossing->overlap >= MBNA_BETTEROVERLAP_THRESHOLD)
-						{
-						if ((mbna_view_mode == MBNA_VIEW_MODE_ALL)
-							|| (mbna_view_mode == MBNA_VIEW_MODE_SURVEY
-								&& mbna_survey_select == project.files[crossing->file_id_1].block
-								&& mbna_survey_select == project.files[crossing->file_id_2].block)
-							|| (mbna_view_mode == MBNA_VIEW_MODE_FILE
-								&& mbna_file_select == crossing->file_id_1
-								&& mbna_file_select == crossing->file_id_2)
-							|| (mbna_view_mode == MBNA_VIEW_MODE_WITHSURVEY
-								&& (mbna_survey_select == project.files[crossing->file_id_1].block
-									|| mbna_survey_select == project.files[crossing->file_id_2].block))
-							|| (mbna_view_mode == MBNA_VIEW_MODE_WITHFILE
-								&& (mbna_file_select == crossing->file_id_1
-									|| mbna_file_select == crossing->file_id_2))
-							|| (mbna_view_mode == MBNA_VIEW_MODE_WITHSECTION
-								&& mbna_file_select == crossing->file_id_1
-								&& mbna_section_select == crossing->section_1)
-							|| (mbna_view_mode == MBNA_VIEW_MODE_WITHSECTION
-								&& mbna_file_select == crossing->file_id_2
-								&& mbna_section_select == crossing->section_2))
-						process = MB_YES;
-						}
-					}
-				else if (mbna_view_list == MBNA_VIEW_LIST_TRUECROSSINGS)
-					{
-					if (crossing->truecrossing == MB_YES)
-						{
-						if ((mbna_view_mode == MBNA_VIEW_MODE_ALL)
-							|| (mbna_view_mode == MBNA_VIEW_MODE_SURVEY
-								&& mbna_survey_select == project.files[crossing->file_id_1].block
-								&& mbna_survey_select == project.files[crossing->file_id_2].block)
-							|| (mbna_view_mode == MBNA_VIEW_MODE_FILE
-								&& mbna_file_select == crossing->file_id_1
-								&& mbna_file_select == crossing->file_id_2)
-							|| (mbna_view_mode == MBNA_VIEW_MODE_WITHSURVEY
-								&& (mbna_survey_select == project.files[crossing->file_id_1].block
-									|| mbna_survey_select == project.files[crossing->file_id_2].block))
-							|| (mbna_view_mode == MBNA_VIEW_MODE_WITHFILE
-								&& (mbna_file_select == crossing->file_id_1
-									|| mbna_file_select == crossing->file_id_2))
-							|| (mbna_view_mode == MBNA_VIEW_MODE_WITHSECTION
-								&& mbna_file_select == crossing->file_id_1
-								&& mbna_section_select == crossing->section_1)
-							|| (mbna_view_mode == MBNA_VIEW_MODE_WITHSECTION
-								&& mbna_file_select == crossing->file_id_2
-								&& mbna_section_select == crossing->section_2))
-						process = MB_YES;
-						}
-					}
-				else
-					process = MB_YES;
-				}
-/* fprintf(stderr,"AUTOPICK crossing:%d do_vertical:%d process:%d\n",i,do_vertical,process); */
-
-			/* load the crossing */
-			if (process == MB_YES)
-				{
-				mbna_current_crossing = i;
-    				mbna_file_id_1 = crossing->file_id_1;
-    				mbna_section_1 = crossing->section_1;
-     				mbna_file_id_2 = crossing->file_id_2;
-    				mbna_section_2 = crossing->section_2;
-				mbna_current_tie = -1;
-
-				/* reset survey file and section selections */
-                                if (mbna_view_mode == MBNA_VIEW_MODE_SURVEY
-                                    || mbna_view_mode == MBNA_VIEW_MODE_WITHSURVEY)
-                                        {
-                                        if (mbna_survey_select == project.files[crossing->file_id_1].block)
-                                                {
-                                                mbna_file_select = crossing->file_id_1;
-                                                mbna_section_select = crossing->section_1;
-                                                }
-                                        else if (mbna_survey_select == project.files[crossing->file_id_2].block)
-                                                {
-                                                mbna_file_select = crossing->file_id_2;
-                                                mbna_section_select = crossing->section_2;
-                                                }
-                                        else
-                                                {
-                                                mbna_file_select = crossing->file_id_1;
-                                                mbna_section_select = crossing->section_1;
-                                                }
-                                        }
-                                else if (mbna_view_mode == MBNA_VIEW_MODE_FILE
-                                    || mbna_view_mode == MBNA_VIEW_MODE_WITHFILE)
-                                        {
-                                        if (mbna_file_select == crossing->file_id_1)
-                                                {
-                                                mbna_survey_select = project.files[crossing->file_id_1].block;
-                                                mbna_section_select = crossing->section_1;
-                                                }
-                                        else if (mbna_file_select == crossing->file_id_2)
-                                                {
-                                                mbna_survey_select = project.files[crossing->file_id_2].block;
-                                                mbna_section_select = crossing->section_2;
-                                                }
-                                        else
-                                                {
-                                                mbna_survey_select = project.files[crossing->file_id_1].block;
-                                                mbna_section_select = crossing->section_1;
-                                                }
-                                        }
-                                else if (mbna_view_mode == MBNA_VIEW_MODE_WITHSECTION)
-                                        {
-                                        if (mbna_file_select == crossing->file_id_1
-                                            && mbna_section_select == crossing->section_1)
-                                                {
-                                                mbna_survey_select = project.files[crossing->file_id_1].block;
-                                                mbna_file_select = crossing->file_id_1;
-                                                }
-                                        else if (mbna_file_select == crossing->file_id_2
-                                            && mbna_section_select == crossing->section_2)
-                                                {
-                                                mbna_survey_select = project.files[crossing->file_id_2].block;
-                                                mbna_file_select = crossing->file_id_2;
-                                                }
-                                        else
-                                                {
-                                                mbna_survey_select = project.files[crossing->file_id_1].block;
-                                                mbna_file_select = crossing->file_id_1;
-                                                }
-                                        }
-				else if (mbna_file_select == crossing->file_id_1)
-					{
-					mbna_survey_select = project.files[crossing->file_id_1].block;
-					mbna_file_select = crossing->file_id_1;
-					mbna_section_select = crossing->section_1;
-					}
-				else if (mbna_file_select == crossing->file_id_2)
-					{
-					mbna_survey_select = project.files[crossing->file_id_2].block;
-					mbna_file_select = crossing->file_id_2;
-					mbna_section_select = crossing->section_2;
-					}
-				else
-					{
-					mbna_survey_select = project.files[crossing->file_id_1].block;
-					mbna_file_select = crossing->file_id_1;
-					mbna_section_select = crossing->section_1;
-					}
-
-				/* set message dialog on */
-				sprintf(message,"Loading crossing %d...", mbna_current_crossing);
-				fprintf(stderr,"\n%s: %s\n",function_name,message);
-				do_message_update(message);
-
-    				/* load crossing */
-  				mbnavadjust_crossing_load();
-/* fprintf(stderr,"mbnavadjust_autopick AA crossing:%d overlap:%d overlap_scale:%f current offsets:%f %f %f  minmisfit3D:%f %f %f  minmisfit2D:%f %f %f\n",
-mbna_current_crossing,crossing->overlap,overlap_scale,
-mbna_offset_x/mbna_mtodeglon,mbna_offset_y/mbna_mtodeglat,mbna_offset_z,
-mbna_minmisfit_x/mbna_mtodeglon,mbna_minmisfit_y/mbna_mtodeglat,mbna_minmisfit_z,
-mbna_minmisfit_xh/mbna_mtodeglon,mbna_minmisfit_yh/mbna_mtodeglat,mbna_minmisfit_zh); */
-				nprocess++;
-
-				/* update status */
-				do_update_status();
-/* fprintf(stderr,"mbnavadjust_autopick A crossing:%d overlap:%d overlap_scale:%f current offsets:%f %f %f  minmisfit3D:%f %f %f  minmisfit2D:%f %f %f\n",
-mbna_current_crossing,crossing->overlap,overlap_scale,
-mbna_offset_x/mbna_mtodeglon,mbna_offset_y/mbna_mtodeglat,mbna_offset_z,
-mbna_minmisfit_x/mbna_mtodeglon,mbna_minmisfit_y/mbna_mtodeglat,mbna_minmisfit_z,
-mbna_minmisfit_xh/mbna_mtodeglon,mbna_minmisfit_yh/mbna_mtodeglat,mbna_minmisfit_zh); */
-
-				/* if this is a >50% overlap crossing then first set offsets to
-					minimum misfit and then recalculate misfit */
-				if (crossing->overlap > 50)
-					{
-					/* set offsets to minimum misfit */
-					if (do_vertical == MB_YES)
-						{
-						mbna_offset_x = mbna_minmisfit_x;
-						mbna_offset_y = mbna_minmisfit_y;
-						mbna_offset_z = mbna_minmisfit_z;
-						}
-					else
-						{
-						mbna_offset_x = mbna_minmisfit_xh;
-						mbna_offset_y = mbna_minmisfit_yh;
-						mbna_offset_z = mbna_minmisfit_zh;
-						}
-					mbna_misfit_offset_x = mbna_offset_x;
-					mbna_misfit_offset_y = mbna_offset_y;
-					mbna_misfit_offset_z = mbna_offset_z;
-					mbnavadjust_crossing_replot();
-
-					/* get misfit */
-					mbnavadjust_get_misfit();
-/* fprintf(stderr,"mbnavadjust_autopick B crossing:%d overlap:%d overlap_scale:%f current offsets:%f %f %f  minmisfit3D:%f %f %f  minmisfit2D:%f %f %f\n",
-mbna_current_crossing,crossing->overlap,overlap_scale,
-mbna_offset_x/mbna_mtodeglon,mbna_offset_y/mbna_mtodeglat,mbna_offset_z,
-mbna_minmisfit_x/mbna_mtodeglon,mbna_minmisfit_y/mbna_mtodeglat,mbna_minmisfit_z,
-mbna_minmisfit_xh/mbna_mtodeglon,mbna_minmisfit_yh/mbna_mtodeglat,mbna_minmisfit_zh); */
-					}
-
-				/* set plot bounds to overlap region */
-				mbnavadjust_crossing_overlapbounds(mbna_current_crossing,
-							mbna_offset_x, mbna_offset_y,
-	    						&mbna_overlap_lon_min, &mbna_overlap_lon_max,
-							&mbna_overlap_lat_min, &mbna_overlap_lat_max);
-				mbna_plot_lon_min = mbna_overlap_lon_min;
-				mbna_plot_lon_max = mbna_overlap_lon_max;
-				mbna_plot_lat_min = mbna_overlap_lat_min;
-				mbna_plot_lat_max = mbna_overlap_lat_max;
-				overlap_scale = MIN((mbna_overlap_lon_max - mbna_overlap_lon_min) / mbna_mtodeglon,
-							(mbna_overlap_lat_max - mbna_overlap_lat_min) / mbna_mtodeglat);
-
-				/* get naverr plot scaling */
-				mbnavadjust_naverr_scale();
-
-				/* get misfit */
-				mbnavadjust_get_misfit();
-
-				/* check uncertainty estimate for a good pick */
-/* fprintf(stderr,"mbnavadjust_autopick C crossing:%d overlap:%d overlap_scale:%f current offsets:%f %f %f  minmisfit3D:%f %f %f  minmisfit2D:%f %f %f\n",
-mbna_current_crossing,crossing->overlap,overlap_scale,
-mbna_offset_x/mbna_mtodeglon,mbna_offset_y/mbna_mtodeglat,mbna_offset_z,
-mbna_minmisfit_x/mbna_mtodeglon,mbna_minmisfit_y/mbna_mtodeglat,mbna_minmisfit_z,
-mbna_minmisfit_xh/mbna_mtodeglon,mbna_minmisfit_yh/mbna_mtodeglat,mbna_minmisfit_zh);
-fprintf(stderr,"crossing:%d overlap:%d overlap_scale:%f uncertainty axes: %f %f %f",
-mbna_current_crossing,crossing->overlap,overlap_scale,mbna_minmisfit_sr1,mbna_minmisfit_sr2,mbna_minmisfit_sr3);
-if (MAX(mbna_minmisfit_sr1,mbna_minmisfit_sr2) < 0.5 * overlap_scale
-&& MIN(mbna_minmisfit_sr1,mbna_minmisfit_sr2) > 0.0)
-fprintf(stderr," USE PICK");
-fprintf(stderr,"\n"); */
-
-fprintf(stderr,"Long misfit axis:%.3f Threshold:%.3f",
-MAX(mbna_minmisfit_sr1,mbna_minmisfit_sr2),0.5 * overlap_scale);
-
-				if (MAX(mbna_minmisfit_sr1,mbna_minmisfit_sr2) < 0.5 * overlap_scale
-					&& MIN(mbna_minmisfit_sr1,mbna_minmisfit_sr2) > 0.0)
-					{
-					fprintf(stderr," AUTOPICK SUCCEEDED\n");
-
-					/* set offsets to minimum misfit */
-					if (do_vertical == MB_YES)
-						{
-						mbna_offset_x = mbna_minmisfit_x;
-						mbna_offset_y = mbna_minmisfit_y;
-						mbna_offset_z = mbna_minmisfit_z;
-						}
-					else
-						{
-						mbna_offset_x = mbna_minmisfit_xh;
-						mbna_offset_y = mbna_minmisfit_yh;
-						mbna_offset_z = mbna_minmisfit_zh;
-						}
-
-					/* add tie */
-    					mbnavadjust_naverr_addtie();
-
-					/* deal with each tie */
-					for (j=0;j<crossing->num_ties;j++)
-						{
-						tie = &(crossing->ties[j]);
-
-						/* calculate sonardepth change rate for swath1 */
-						found = MB_NO;
-						for (k=0;k<swathraw1->npings;k++)
-						    {
-						    if (swathraw1->pingraws[k].time_d > tie->snav_1_time_d - 2.0
-					    		&& found == MB_NO)
-							{
-							firstsonardepth1 = swathraw1->pingraws[k].draft;
-							firsttime_d1 = swathraw1->pingraws[k].time_d;
-							found = MB_YES;
-							}
-						    if (swathraw1->pingraws[k].time_d < tie->snav_1_time_d + 2.0)
-							{
-							secondsonardepth1 = swathraw1->pingraws[k].draft;
-							secondtime_d1 = swathraw1->pingraws[k].time_d;
-							}
-						    }
-						dsonardepth1 = (secondsonardepth1 - firstsonardepth1)
-							/ (secondtime_d1 - firsttime_d1);
-
-						/* calculate sonardepth change rate for swath2 */
-						found = MB_NO;
-						for (k=0;k<swathraw2->npings;k++)
-						    {
-						    if (swathraw2->pingraws[k].time_d > tie->snav_2_time_d - 2.0
-					    		&& found == MB_NO)
-							{
-							firstsonardepth2 = swathraw2->pingraws[k].draft;
-							firsttime_d2 = swathraw2->pingraws[k].time_d;
-							found = MB_YES;
-							}
-						    if (swathraw2->pingraws[k].time_d < tie->snav_2_time_d + 2.0)
-							{
-							secondsonardepth2 = swathraw2->pingraws[k].draft;
-							secondtime_d2 = swathraw2->pingraws[k].time_d;
-							}
-						    }
-						dsonardepth2 = (secondsonardepth2 - firstsonardepth2)
-							/ (secondtime_d2 - firsttime_d2);
-/* fprintf(stderr,"mbnavadjust_autopick D crossing:%d tie:%d zoffset:%f   sdrate1:%f %f %f  sdrate2:%f %f %f   inferred time lag:%f\n",
-i,j,tie->offset_z_m,
-(secondsonardepth1 - firstsonardepth1), (secondtime_d1 - firsttime_d1), dsonardepth1,
-(secondsonardepth2 - firstsonardepth2), (secondtime_d2 - firsttime_d2), dsonardepth2,
-tie->offset_z_m / (dsonardepth2 - dsonardepth1)); */
-						}
-					}
-				else
-					{
-					fprintf(stderr," AUTOPICK FAILED\n");
-					}
-
-    				/* unload crossing */
-  				mbnavadjust_crossing_unload();
-
-fprintf(stderr,"mbna_file_select:%d mbna_survey_select:%d mbna_section_select:%d\n",
-mbna_file_select,mbna_survey_select,mbna_section_select);
-
-		    		/* update status periodically */
-		    		if (nprocess % 10 == 0)
-		    			{
-					do_update_status();
-
-					/* update model plot */
-					if (project.modelplot == MB_YES)
-						{
-						/* update model status */
-						do_update_modelplot_status();
-
-						/* replot the model */
-						mbnavadjust_modelplot_plot();
-						}
-					}
-				}
-			}
-
-		/* write updated project */
-		mbnavadjust_write_project();
-
-		/* turn off message dialog */
-		do_message_off();
-		}
-
- 	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int
-mbnavadjust_autosetsvsvertical()
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_autosetsvsvertical";
-	int	status = MB_SUCCESS;
-	struct mbna_file *file;
-	struct 	mbna_crossing *crossing;
-	struct 	mbna_file *file1, *file2;
-	struct 	mbna_tie *tie;
-	double	overlap_scale;
-	int	nprocess;
-	int	ntie, nfixed, ncols;
-	double	misfit_initial, perturbationsize, perturbationsizeold;
-	double	perturbationchange, convergencecriterea;
-	double	offset_z_m, block_offset_avg_z;
-	double	*x, *xx;
-	int	done, iter, nc1, nc2, navg, use, reset_tie;
-	int	i, j;
-
- 	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
-
-	/* set up and solve overdetermined least squares problem for a z-offset model with
-	 * constant z-offsets within each survey using
-	 * the current z-offset ties. Then, loop over all ties to auto-repick the crossings using
-	 * the z-offset in the new model (that is, pick the best lateral offset that can be found
-	 * using the z-offset in the new model). This should replace the initial ties with ties that
-	 * have self-consistent z-offsets between surveys. Using this option only makes sense if the
-	 * bathymetry was correctly tide-corrected before import into mbnavadjust.
-	 */
-   	if (project.open == MB_YES
-    		&& project.inversion != MBNA_INVERSION_NONE
-		&& project.modelplot == MB_YES)
-    		{
-		/* calculate the initial misfit */
-		ntie = 0;
-		misfit_initial = 0.0;
-		for (i=0;i<project.num_crossings;i++)
-		    {
-		    crossing = &project.crossings[i];
-		    if (crossing->status == MBNA_CROSSING_STATUS_SET)
-		    	{
-			ntie += crossing->num_ties;
-			for (j=0;j<crossing->num_ties;j++)
-				{
-				tie = (struct mbna_tie *) &crossing->ties[j];
-				misfit_initial += tie->offset_z_m * tie->offset_z_m;
-				}
-			}
-		    }
-		misfit_initial = sqrt(misfit_initial) / ntie;
-		perturbationsizeold = misfit_initial;
-
-		/* count the number of blocks */
-		project.num_blocks = 0;
-		for (i=0;i<project.num_files;i++)
-		    {
-		    file = &project.files[i];
-		    if (i==0 || file->sections[0].continuity == MB_NO)
-		    	{
-			project.num_blocks++;
-			}
-		    file->block = project.num_blocks - 1;
-		    }
-
-		/* count the number of fixed files */
-		nfixed = 0;
-		for (i=0;i<project.num_files;i++)
-		    {
-		    file = &project.files[i];
-		    if (file->status == MBNA_FILE_FIXEDNAV)
-		    	nfixed++;
-		    }
-
-		/* if only one block just set average offsets to zero */
-		if (project.num_blocks <= 1)
-		    {
-		    block_offset_avg_z = 0.0;
-		    for (i=0;i<project.num_files;i++)
-			{
-			file = &project.files[i];
-			file->block_offset_z = 0.0;
-			}
-		    }
-
-		/* else if more than one block first invert for block offsets  */
-		else if (project.num_blocks > 1)
-		    {
-		    /* allocate space for the inverse problem */
-		    ncols = project.num_blocks;
-		    status = mb_mallocd(mbna_verbose, __FILE__, __LINE__, ncols * sizeof(double), (void **)&x,&error);
-		    status = mb_mallocd(mbna_verbose, __FILE__, __LINE__, ncols * sizeof(double), (void **)&xx,&error);
-
-		    /* initialize x array */
-		    for (i=0;i<project.num_blocks;i++)
-			{
-			x[i] = 0.0;
-			}
-
-		    /* construct the inverse problem */
-		    sprintf(message,"Solving for survey z offsets...");
-		    do_message_update(message);
-
-		    done = MB_NO;
-		    iter = 0;
-		    while (done == MB_NO)
-		    	{
-			/* initialize xx array */
-			for (i=0;i<project.num_blocks;i++)
-			    {
-			    xx[i] = 0.0;
-			    }
-
-			/* loop over crossings getting set ties */
-			ntie = 0;
-			for (i=0;i<project.num_crossings;i++)
-			    {
-			    crossing = &project.crossings[i];
-
-			     /* get block id for first snav point */
-			     file1 = &project.files[crossing->file_id_1];
-			     nc1 = file1->block;
-
-			     /* get block id for second snav point */
-			     file2 = &project.files[crossing->file_id_2];
-			     nc2 = file2->block;
-
-			    /* use only set crossings */
-			    if (crossing->status == MBNA_CROSSING_STATUS_SET)
-			    for (j=0;j<crossing->num_ties;j++)
-				{
-				/* get tie */
-				tie = (struct mbna_tie *) &crossing->ties[j];
-				ntie++;
-
-				/* get current offset vector including reduction of block solution */
-				if (tie->status != MBNA_TIE_XY)
-				    {
-				    offset_z_m = tie->offset_z_m - (x[nc2] + xx[nc2] - x[nc1] - xx[nc1]);
-				    }
-				else
-				    {
-				    offset_z_m = 0.0;
-				    }
-/* fprintf(stderr,"icrossing:%d jtie:%d blocks:%d %d offsets: %f %f %f\n",
-i,j,nc1,nc2,offsetx,offsety,offset_z_m); */
-
-				/* deal with fixed or unfixed status of sections */
-				if ((file1->status == MBNA_FILE_GOODNAV && file2->status == MBNA_FILE_GOODNAV)
-					|| (file1->status == MBNA_FILE_POORNAV && file2->status == MBNA_FILE_POORNAV))
-				    {
-				    xx[nc1] += -mbna_offsetweight * 0.5 * offset_z_m;
-				    xx[nc2] +=  mbna_offsetweight * 0.5 * offset_z_m;
-				    }
-				else if (file1->status == MBNA_FILE_GOODNAV && file2->status == MBNA_FILE_POORNAV)
-				    {
-				    xx[nc1] += -mbna_offsetweight * 0.005 * offset_z_m;
-				    xx[nc2] +=  mbna_offsetweight * 0.995 * offset_z_m;
-				    }
-				else if (file1->status == MBNA_FILE_POORNAV && file2->status == MBNA_FILE_GOODNAV)
-				    {
-				    xx[nc1] += -mbna_offsetweight * 0.995 * offset_z_m;
-				    xx[nc2] +=  mbna_offsetweight * 0.005 * offset_z_m;
-				    }
-				else if (file1->status == MBNA_FILE_FIXEDNAV && file2->status == MBNA_FILE_FIXEDNAV)
-				    {
-				    /*
-				    xx[nc1] +=  0.0;
-				    xx[nc2] +=  0.0;
-				    */
-				    }
-				else if (file1->status == MBNA_FILE_FIXEDNAV)
-				    {
-				    if (file2->status == MBNA_FILE_FIXEDXYNAV)
-				    	{
-				    	/*
-					xx[nc1] +=  0.0;
-					xx[nc2] +=  0.0;
-				    	*/
-					xx[3*nc2+2] +=  offset_z_m;
-					}
-				    else if (file2->status == MBNA_FILE_FIXEDZNAV)
-				    	{
-				    	/*
-					xx[nc1] +=  0.0;
-					xx[nc2] +=  0.0;
-					*/
-					}
-				    else
-				    	{
-				    	/*
-					xx[nc1] +=  0.0;
-				    	*/
-					xx[nc2] +=  mbna_offsetweight * offset_z_m;
-					}
-				    }
-				else if (file2->status == MBNA_FILE_FIXEDNAV)
-				    {
-				    if (file1->status == MBNA_FILE_FIXEDXYNAV)
-				    	{
-					xx[nc1] +=  -mbna_offsetweight * offset_z_m;
-				    	/*
-					xx[nc2] +=  0.0;
-				    	*/
-					}
-				    else if (file1->status == MBNA_FILE_FIXEDZNAV)
-				    	{
-				    	/*
-					xx[nc1] +=  0.0;
-					xx[nc2] +=  0.0;
-				    	*/
-					}
-				    else
-				    	{
-					xx[nc1] +=  -mbna_offsetweight * offset_z_m;
-				    	/*
-					xx[nc2] +=  0.0;
-				    	*/
-					}
-				    }
-				}
-			    }
-
-			/* calculate 2-norm of perturbation */
-			perturbationsize = 0.0;
-			for (i=0;i<ncols;i++)
-			    {
-			    perturbationsize += xx[i] * xx[i];
-			    }
-			perturbationsize = sqrt(perturbationsize) / ncols;
-
-			/* apply perturbation */
-			for (i=0;i<ncols;i++)
-			    {
-			    x[i] += xx[i];
-			    }
-
-			 /* check for convergence */
-			 perturbationchange = perturbationsize - perturbationsizeold;
-			 convergencecriterea = fabs(perturbationchange) / misfit_initial;
-			 if (convergencecriterea < MBNA_CONVERGENCE || iter > MBNA_INTERATION_MAX)
-		    	     done = MB_YES;
-fprintf(stderr,"BLOCK INVERT: iter:%d ntie:%d misfit_initial:%f perturbationsize:%g perturbationchange:%g convergencecriterea:%g done:%d\n",
-iter,ntie,misfit_initial,perturbationsize,perturbationchange,convergencecriterea,done);
-
-			 if (done == MB_NO)
-		             {
-			     perturbationsizeold = perturbationsize;
-			     iter++;
-			     }
-			 }
-
-		    /* if there are no fixed blocks contributing to ties,
-		    	then get average z-offsets of blocks not flagged as bad
-			to provide a static offset to move final model to be more consistent
-			with the good blocks than the poorly navigated blocks */
-		    block_offset_avg_z = 0.0;
-		    navg = 0;
-		    if (nfixed == 0)
-		    	{
-			for (i=0;i<project.num_blocks;i++)
-			    {
-			    use = MB_YES;
-			    for (j=0;j<project.num_files;j++)
-				    {
-				    file = &project.files[j];
-				    if (file->block == i && file->status == MBNA_FILE_POORNAV)
-					    use = MB_NO;
-				    }
-			    if (use == MB_YES)
-				    {
-				    block_offset_avg_z += x[i];
-				    navg++;
-				    }
-			    }
-			if (navg > 0)
-		    	    {
-			    block_offset_avg_z /= navg;
-			    }
-			}
-
-		    /* output solution */
-		    fprintf(stderr,"\nAverage z-offsets: %f\n",block_offset_avg_z);
-		    for (i=0;i<project.num_blocks;i++)
-			{
-			fprintf(stderr, "Survey block:%d  z-offset: %f  block z-offset:%f\n", i, x[i], x[i] - block_offset_avg_z);
-			}
-
-		    /* set block offsets for each file */
-		    for (i=0;i<project.num_files;i++)
-			{
-			file = &project.files[i];
-			file->block_offset_z = x[file->block] - block_offset_avg_z;
-/* fprintf(stderr,"file:%d block: %d block offsets: %f %f %f\n",
-i,file->block,file->block_offset_x,file->block_offset_y,file->block_offset_z);*/
-			}
-
-		    /* deallocate arrays */
-		    status = mb_freed(mbna_verbose, __FILE__, __LINE__, (void **)&x,&error);
-		    status = mb_freed(mbna_verbose, __FILE__, __LINE__, (void **)&xx,&error);
-		    }
-
-		/* loop over over all crossings - reset existing ties using block z-offsets */
-		nprocess = 0;
-		for (i=0;i<project.num_crossings;i++)
-			{
-			/* set the crossing */
-			crossing = &project.crossings[i];
-			file1 = &project.files[crossing->file_id_1];
-			file2 = &project.files[crossing->file_id_2];
-			offset_z_m = file2->block_offset_z - file1->block_offset_z;
-
-			/* check if any ties exist and are inconsistent with the new survey z-offset model */
-			reset_tie = MB_NO;
-			for (j=0;j<crossing->num_ties;j++)
-				{
-				tie = &(crossing->ties[j]);
-				if (tie->offset_z_m != offset_z_m)
-					reset_tie = MB_YES;
-				}
-
-			/* if one or more ties exist and at , load crossing and reset the ties using the new z-offset */
-			if (reset_tie == MB_YES)
-				{
-				mbna_current_crossing = i;
-				mbna_file_id_1 = crossing->file_id_1;
-				mbna_section_1 = crossing->section_1;
-				mbna_file_id_2 = crossing->file_id_2;
-				mbna_section_2 = crossing->section_2;
-				mbna_current_tie = 0;
-				file1 = &project.files[mbna_file_id_1];
-				file2 = &project.files[mbna_file_id_2];
-
-				/* set message dialog on */
-				sprintf(message,"Loading crossing %d...", mbna_current_crossing);
-				fprintf(stderr,"%s: %s\n",function_name,message);
-				do_message_update(message);
-
-				/* load crossing */
-				mbnavadjust_crossing_load();
-				nprocess++;
-
-				/* update status and model plot */
-				do_update_status();
-				if (project.modelplot == MB_YES)
-					{
-					do_update_modelplot_status();
-					mbnavadjust_modelplot_plot();
-					}
-
-				/* delete each tie */
-				for (j=0;j<crossing->num_ties;j++)
-					{
-					mbnavadjust_deletetie(mbna_current_crossing, j, MBNA_CROSSING_STATUS_NONE);
-					}
-
-				/* update status and model plot */
-				do_update_status();
-				if (project.modelplot == MB_YES)
-					{
-					do_update_modelplot_status();
-					mbnavadjust_modelplot_plot();
-					}
-
-				/* reset z offset */
-				mbna_offset_z = file2->block_offset_z - file1->block_offset_z;
-
-				/* get misfit */
-				mbnavadjust_get_misfit();
-
-				/* set offsets to minimum horizontal misfit */
-				mbna_offset_x = mbna_minmisfit_xh;
-				mbna_offset_y = mbna_minmisfit_yh;
-				mbna_offset_z = mbna_minmisfit_zh;
-				mbna_misfit_offset_x = mbna_offset_x;
-				mbna_misfit_offset_y = mbna_offset_y;
-				mbna_misfit_offset_z = mbna_offset_z;
-				mbnavadjust_crossing_replot();
-
-				/* get misfit */
-				mbnavadjust_get_misfit();
-
-				/* set plot bounds to overlap region */
-				mbnavadjust_crossing_overlapbounds(mbna_current_crossing,
-							mbna_offset_x, mbna_offset_y,
-							&mbna_overlap_lon_min, &mbna_overlap_lon_max,
-							&mbna_overlap_lat_min, &mbna_overlap_lat_max);
-				mbna_plot_lon_min = mbna_overlap_lon_min;
-				mbna_plot_lon_max = mbna_overlap_lon_max;
-				mbna_plot_lat_min = mbna_overlap_lat_min;
-				mbna_plot_lat_max = mbna_overlap_lat_max;
-				overlap_scale = MIN((mbna_overlap_lon_max - mbna_overlap_lon_min) / mbna_mtodeglon,
-							(mbna_overlap_lat_max - mbna_overlap_lat_min) / mbna_mtodeglat);
-
-				/* get naverr plot scaling */
-				mbnavadjust_naverr_scale();
-
-				/* get misfit */
-				mbnavadjust_get_misfit();
-
-				/* check uncertainty estimate for a good pick */
-				if (MAX(mbna_minmisfit_sr1,mbna_minmisfit_sr2) < 0.5 * overlap_scale
-					&& MIN(mbna_minmisfit_sr1,mbna_minmisfit_sr2) > 0.0)
-					{
-
-					/* set offsets to minimum horizontal misfit */
-					mbna_offset_x = mbna_minmisfit_xh;
-					mbna_offset_y = mbna_minmisfit_yh;
-					mbna_offset_z = mbna_minmisfit_zh;
-
-					/* add tie */
-					mbnavadjust_naverr_addtie();
-					}
-				else
-					{
-					sprintf(message,"Failed to reset Tie Point %d of Crossing %d\n",
-							0, mbna_current_crossing);
-					if (mbna_verbose == 0)
-						fprintf(stderr,"%s",message);
-					do_info_add(message, MB_YES);
-					}
-
-				/* unload crossing */
-				mbnavadjust_crossing_unload();
-
-/*fprintf(stderr,"mbna_file_select:%d mbna_survey_select:%d mbna_section_select:%d\n",
-mbna_file_select,mbna_survey_select,mbna_section_select);*/
-
-				/* update status periodically */
-				if (nprocess % 10 == 0)
-					{
-					do_update_status();
-
-					/* update model plot */
-					if (project.modelplot == MB_YES)
-						{
-						/* update model status */
-						do_update_modelplot_status();
-
-						/* replot the model */
-						mbnavadjust_modelplot_plot();
-						}
-					}
-				}
-			}
-
-		/* update status */
-		do_update_status();
-
-		/* update model plot */
-		if (project.modelplot == MB_YES)
-			{
-			/* update model status */
-			do_update_modelplot_status();
-
-			/* replot the model */
-			mbnavadjust_modelplot_plot();
-			}
-		}
-
- 	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int
-mbnavadjust_zerozoffsets()
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_zerozoffsets";
-	int	status = MB_SUCCESS;
-	struct 	mbna_crossing *crossing;
-	struct 	mbna_tie *tie;
-	int	i, j;
-
- 	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
-
-	/* loop over all crossings */
-    	if (project.open == MB_YES
-    		&& project.num_crossings > 0)
-    		{
-		/* set message dialog on */
-		sprintf(message,"Zeroing all z offsets...");
-		do_message_on(message);
-		sprintf(message,"Zeroing all z offsets.\n");
-		if (mbna_verbose == 0)
-		    fprintf(stderr,"%s",message);
-		do_info_add(message,MB_YES);
-
-		/* loop over all crossings */
-		for (i=0;i<project.num_crossings;i++)
-			{
-			/* get structure */
-			crossing = &(project.crossings[i]);
-
-			/* deal with each tie */
-			for (j=0;j<crossing->num_ties;j++)
-				{
-				tie = &(crossing->ties[j]);
-
-				/* zero the z offset */
-				tie->offset_z_m = 0.0;
-
-				/* set inversion out of date */
-				if (project.inversion == MBNA_INVERSION_CURRENT)
-					project.inversion = MBNA_INVERSION_OLD;
-				}
-			}
-		/* write updated project */
-		mbnavadjust_write_project();
-
-		/* turn off message dialog */
-		do_message_off();
-		}
-
- 	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-
-int
-mbnavadjust_invertnav()
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_invertnav";
-	int	status = MB_SUCCESS;
-	struct mbna_file *file;
-	struct mbna_file *file1;
-	struct mbna_file *file2;
-	struct mbna_section *section;
-	struct mbna_section *section1;
-	struct mbna_section *section2;
-	struct mbna_crossing *crossing;
-	struct mbna_tie *tie;
-	int	nnav;
-	int	nsnav;
-	int	ndf = 3;
-	int	ncols = 0;
-	int	ntie = 0;
-	int	nfixed = 0;
-	int	nglobal = 0;
-	int	nmisfit = 0;
-	double	*x = NULL;
-	double	*xx = NULL;
-	double	*xa = NULL;
-	int	*nxs = NULL;
-	double	*xs = NULL;
-	double	*xw = NULL;
-	double	misfit, misfit_initial, misfit_ties_initial, misfit_norm_initial, misfit_ties, misfit_norm;
-	double	offsetx, offsety, offsetz, offsetr;
-	double	projected_offset;
-	double	xyweight, zweight;
-	double	dtime_d;
-	int	done, iter;
-	int	nseq, nseqlast;
-	int	nchange;
-	int	ndx, ndx2;
-	int	icrossing, jtie;
-	int	ifile, isection, isnav, inav;
-	int	nc1, nc2, nc3;
-	int	i, j, k;
-
-	double	perturbationsize;
-	double	perturbationsizeold;
-	double	perturbationchange;
-	double	convergencecriterea;
-	double	offset_x;
-	double	offset_y;
-	double	offset_z;
-	double	time_d1, time_d2, time_d3;
-	double	block_offset_avg_x;
-	double	block_offset_avg_y;
-	double	block_offset_avg_z;
-	int	navg;
-	int	use;
-	int	ok_to_invert;
-
- 	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
-
-	/* check if it is ok to invert
-		- if there is a project
-		- enough crossings have been analyzed
-		- no problems with offsets and offset uncertainties */
-    	if (project.open == MB_YES
-    		&& project.num_crossings > 0
-		&& (project.num_crossings_analyzed >= 10
-			|| project.num_truecrossings_analyzed == project.num_truecrossings))
-
-    		{
-		/* check that all uncertainty magnitudes are nonzero */
-		ok_to_invert = MB_YES;
-		for (icrossing=0;icrossing<project.num_crossings;icrossing++)
-		    {
-		    crossing = &project.crossings[icrossing];
-		    if (crossing->status == MBNA_CROSSING_STATUS_SET)
-		    	{
-			for (j=0;j<crossing->num_ties;j++)
-				{
-				tie = (struct mbna_tie *) &crossing->ties[j];
-				if (tie->sigmar1 <= 0.0
-					|| tie->sigmar2 <= 0.0
-					|| tie->sigmar3 <= 0.0)
-					{
-					ok_to_invert = MB_NO;
-					fprintf(stderr,"PROBLEM WITH TIE: %4d %2d %2.2d:%3.3d:%3.3d:%2.2d %2.2d:%3.3d:%3.3d:%2.2d %8.2f %8.2f %8.2f | %8.2f %8.2f %8.2f\n",
-						    icrossing, j,
-						    project.files[crossing->file_id_1].block,
-						    crossing->file_id_1,
-						    crossing->section_1,
-						    tie->snav_1,
-						    project.files[crossing->file_id_2].block,
-						    crossing->file_id_2,
-						    crossing->section_2,
-						    tie->snav_2,
-						    tie->offset_x_m,
-						    tie->offset_y_m,
-						    tie->offset_z_m,
-						    tie->sigmar1,
-						    tie->sigmar2,
-						    tie->sigmar3);
-					}
-				}
-			}
-		    }
-
-		/* print out warning */
-		if (ok_to_invert == MB_NO)
-			{
-			fprintf(stderr,"\nThe inversion was not performed because there are one or more zero offset uncertainty values.\n");
-			fprintf(stderr,"Please fix the ties with problems noted above before trying again.\n\n");
-			}
-		}
-
-
-	/* invert if there is a project and enough crossings have been analyzed */
-    	if (project.open == MB_YES
-    		&& project.num_crossings > 0
-		&& (project.num_crossings_analyzed >= 10
-			|| project.num_truecrossings_analyzed == project.num_truecrossings)
-		&& ok_to_invert == MB_YES)
-
-    		{
-		fprintf(stderr,"\nInverting for navigation adjustment model...\n");
-
-		/* set message dialog on */
-		sprintf(message,"Setting up navigation inversion...");
-		do_message_on(message);
-
-		/*----------------------------------------------------------------*/
-		/* Step 1 - get block (survey) average offsets                    */
-		/*----------------------------------------------------------------*/
-
-		/* figure out the average offsets between connected sets of files
-			- invert for x y z offsets for the blocks */
-
-		/* calculate the initial misfit, count number of crossing ties and global ties */
-		ntie = 0;
-		nglobal = 0;
-		misfit_initial = 0.0;
-		nmisfit = 0;
-		for (icrossing=0;icrossing<project.num_crossings;icrossing++)
-		    {
-		    crossing = &project.crossings[icrossing];
-		    if (crossing->status == MBNA_CROSSING_STATUS_SET)
-		    	{
-			ntie += crossing->num_ties;
-			for (j=0;j<crossing->num_ties;j++)
-				{
-				tie = (struct mbna_tie *) &crossing->ties[j];
-				if (tie->status != MBNA_TIE_Z)
-					{
-					misfit_initial += tie->offset_x_m * tie->offset_x_m;
-					misfit_initial += tie->offset_y_m * tie->offset_y_m;
-					nmisfit += 2;
-					}
-				if (tie->status != MBNA_TIE_XY)
-					{
-					misfit_initial += tie->offset_z_m * tie->offset_z_m;
-					nmisfit++;
-					}
-				}
-			}
-		    }
-		for (i=0;i<project.num_files;i++)
-		    {
-		    file = &project.files[i];
-		    for (isection=0;isection<file->num_sections;isection++)
-			{
-			section = &file->sections[isection];
-			if (section->global_tie_status != MBNA_TIE_NONE)
-				{
-				nglobal++;
-				if (section->global_tie_status != MBNA_TIE_Z)
-					{
-					misfit_initial += section->global_tie_offset_x_m * section->global_tie_offset_x_m;
-					misfit_initial += section->global_tie_offset_y_m * section->global_tie_offset_y_m;
-					nmisfit += 2;
-					}
-				if (section->global_tie_status != MBNA_TIE_XY)
-					{
-					misfit_initial += section->global_tie_offset_z_m * section->global_tie_offset_z_m;
-					nmisfit++;
-					}
-				}
-			}
-		    }
-		misfit_initial = sqrt(misfit_initial) / nmisfit;
-		perturbationsizeold = misfit_initial;
-
-		/* count the number of fixed files */
-		nfixed = 0;
-		for (i=0;i<project.num_files;i++)
-		    {
-		    file = &project.files[i];
-		    if (file->status == MBNA_FILE_FIXEDNAV)
-		    	nfixed++;
-		    }
-
-		/* if only one block just set average offsets to zero */
-		if (project.num_blocks <= 1)
-		    {
-		    block_offset_avg_x = 0.0;
-		    block_offset_avg_y = 0.0;
-		    block_offset_avg_z = 0.0;
-		    for (i=0;i<project.num_files;i++)
-			{
-			file = &project.files[i];
-			file->block_offset_x = 0.0;
-			file->block_offset_y = 0.0;
-			file->block_offset_z = 0.0;
-			}
-		    }
-
-		/* else if more than one block first invert for block offsets  */
-		else if (project.num_blocks > 1)
-		    {
-		    /* allocate space for the inverse problem */
-		    ncols = ndf * project.num_blocks;
-		    status = mb_mallocd(mbna_verbose, __FILE__, __LINE__, ncols * sizeof(double), (void **)&x,&error);
-		    status = mb_mallocd(mbna_verbose, __FILE__, __LINE__, ncols * sizeof(double), (void **)&xx,&error);
-
-		    /* initialize x array */
-		    for (i=0;i<ndf*project.num_blocks;i++)
-			{
-			x[i] = 0.0;
-			}
-
-		    /* construct the inverse problem */
-		    sprintf(message,"Solving for block offsets...");
-		    do_message_update(message);
-
-		    done = MB_NO;
-		    iter = 0;
-		    while (done == MB_NO)
-		    	{
-			/* initialize xx array */
-			for (i=0;i<ndf*project.num_blocks;i++)
-			    {
-			    xx[i] = 0.0;
-			    }
-
-			/* loop over crossings getting set ties */
-			for (icrossing=0;icrossing<project.num_crossings;icrossing++)
-			    {
-			    crossing = &project.crossings[icrossing];
-
-			     /* get block id for first snav point */
-			     file1 = &project.files[crossing->file_id_1];
-			     nc1 = file1->block;
-
-			     /* get block id for second snav point */
-			     file2 = &project.files[crossing->file_id_2];
-			     nc2 = file2->block;
-
-			    /* use only set crossings */
-			    if (crossing->status == MBNA_CROSSING_STATUS_SET)
-			    for (j=0;j<crossing->num_ties;j++)
-				{
-				/* get tie */
-				tie = (struct mbna_tie *) &crossing->ties[j];
-
-				/* get current offset vector including reduction of block solution */
-				if (tie->status != MBNA_TIE_Z)
-				    {
-				    offsetx = tie->offset_x_m - (x[3*nc2]   + xx[3*nc2]   - x[3*nc1]   - xx[3*nc1]);
-				    offsety = tie->offset_y_m - (x[3*nc2+1] + xx[3*nc2+1] - x[3*nc1+1] - xx[3*nc1+1]);
-				    }
-				else
-				    {
-				    offsetx = 0.0;
-				    offsety = 0.0;
-				    }
-				if (tie->status != MBNA_TIE_XY)
-				    {
-				    offsetz = tie->offset_z_m - (x[3*nc2+2] + xx[3*nc2+2] - x[3*nc1+2] - xx[3*nc1+2]);
-				    }
-				else
-				    {
-				    offsetz = 0.0;
-				    }
-/* fprintf(stderr,"icrossing:%d jtie:%d blocks:%d %d offsets: %f %f %f\n",
-icrossing,j,nc1,nc2,offsetx,offsety,offsetz); */
-
-				/* deal with fixed or unfixed status of sections */
-				if ((file1->status == MBNA_FILE_GOODNAV && file2->status == MBNA_FILE_GOODNAV)
-					|| (file1->status == MBNA_FILE_POORNAV && file2->status == MBNA_FILE_POORNAV))
-				    {
-				    xx[3*nc1]   += -0.5 * offsetx;
-				    xx[3*nc1+1] += -0.5 * offsety;
-				    xx[3*nc1+2] += -0.5 * offsetz;
-				    xx[3*nc2]   +=  0.5 * offsetx;
-				    xx[3*nc2+1] +=  0.5 * offsety;
-				    xx[3*nc2+2] +=  0.5 * offsetz;
-				    }
-				else if (file1->status == MBNA_FILE_GOODNAV && file2->status == MBNA_FILE_POORNAV)
-				    {
-				    xx[3*nc1]   += -0.005 * offsetx;
-				    xx[3*nc1+1] += -0.005 * offsety;
-				    xx[3*nc1+2] += -0.005 * offsetz;
-				    xx[3*nc2]   +=  0.995 * offsetx;
-				    xx[3*nc2+1] +=  0.995 * offsety;
-				    xx[3*nc2+2] +=  0.995 * offsetz;
-				    }
-				else if (file1->status == MBNA_FILE_POORNAV && file2->status == MBNA_FILE_GOODNAV)
-				    {
-				    xx[3*nc1]   += -0.995 * offsetx;
-				    xx[3*nc1+1] += -0.995 * offsety;
-				    xx[3*nc1+2] += -0.995 * offsetz;
-				    xx[3*nc2]   +=  0.005 * offsetx;
-				    xx[3*nc2+1] +=  0.005 * offsety;
-				    xx[3*nc2+2] +=  0.005 * offsetz;
-				    }
-				else if (file1->status == MBNA_FILE_FIXEDNAV && file2->status == MBNA_FILE_FIXEDNAV)
-				    {
-				    /*
-				    xx[3*nc1]   +=  0.0;
-				    xx[3*nc1+1] +=  0.0;
-				    xx[3*nc1+2] +=  0.0;
-				    xx[3*nc2]   +=  0.0;
-				    xx[3*nc2+1] +=  0.0;
-				    xx[3*nc2+2] +=  0.0;
-				    */
-				    }
-				else if (file1->status == MBNA_FILE_FIXEDNAV)
-				    {
-				    if (file2->status == MBNA_FILE_FIXEDXYNAV)
-				    	{
-				    	/*
-					xx[3*nc1]   +=  0.0;
-					xx[3*nc1+1] +=  0.0;
-					xx[3*nc1+2] +=  0.0;
-					xx[3*nc2]   +=  0.0;
-					xx[3*nc2+1] +=  0.0;
-				    	*/
-					xx[3*nc2+2] +=  offsetz;
-					}
-				    else if (file2->status == MBNA_FILE_FIXEDZNAV)
-				    	{
-				    	/*
-					xx[3*nc1]   +=  0.0;
-					xx[3*nc1+1] +=  0.0;
-					xx[3*nc1+2] +=  0.0;
-				    	*/
-					xx[3*nc2]   +=  offsetx;
-					xx[3*nc2+1] +=  offsety;
-				    	/*
-					xx[3*nc2+2] +=  0.0;
-					*/
-					}
-				    else
-				    	{
-				    	/*
-					xx[3*nc1]   +=  0.0;
-					xx[3*nc1+1] +=  0.0;
-					xx[3*nc1+2] +=  0.0;
-				    	*/
-					xx[3*nc2]   +=  offsetx;
-					xx[3*nc2+1] +=  offsety;
-					xx[3*nc2+2] +=  offsetz;
-					}
-				    }
-				else if (file2->status == MBNA_FILE_FIXEDNAV)
-				    {
-				    if (file1->status == MBNA_FILE_FIXEDXYNAV)
-				    	{
-				    	/*
-					xx[3*nc1]   +=  0.0;
-					xx[3*nc1+1] +=  0.0;
-				    	*/
-					xx[3*nc1+2] +=  -offsetz;
-				    	/*
-					xx[3*nc2]   +=  0.0;
-					xx[3*nc2+1] +=  0.0;
-					xx[3*nc2+2] +=  0.0;
-				    	*/
-					}
-				    else if (file1->status == MBNA_FILE_FIXEDZNAV)
-				    	{
-					xx[3*nc1]   +=  -offsetx;
-					xx[3*nc1+1] +=  -offsety;
-				    	/*
-					xx[3*nc1+2] +=  0.0;
-					xx[3*nc2]   +=  0.0;
-					xx[3*nc2+1] +=  0.0;
-					xx[3*nc2+2] +=  0.0;
-				    	*/
-					}
-				    else
-				    	{
-					xx[3*nc1]   +=  -offsetx;
-					xx[3*nc1+1] +=  -offsety;
-					xx[3*nc1+2] +=  -offsetz;
-				    	/*
-					xx[3*nc2]   +=  0.0;
-					xx[3*nc2+1] +=  0.0;
-					xx[3*nc2+2] +=  0.0;
-				    	*/
-					}
-				    }
-				}
-			    }
-			    
-			/* loop over all global ties */
-			for (ifile=0;ifile<project.num_files;ifile++)
-			    {
-			    file = &project.files[ifile];
-			    for (isection=0;isection<file->num_sections;isection++)
-				{
-				section = &file->sections[isection];
-				if (section->global_tie_status != MBNA_TIE_NONE)
-				    {
-				    /* get block id for snav point */
-				    nc1 = file->block;
-    
-				    /* get current offset vector including reduction of block solution */
-				    if (section->global_tie_status != MBNA_TIE_Z)
-					{
-					offsetx = section->global_tie_offset_x_m - (x[3*nc1]   + xx[3*nc1]);
-					offsety = section->global_tie_offset_y_m - (x[3*nc1+1] + xx[3*nc1+1]);
-					
-					xx[3*nc1]   += 0.5 * offsetx;
-					xx[3*nc1+1] += 0.5 * offsety;
-					}
-				    if (section->global_tie_status != MBNA_TIE_XY)
-					{
-					offsetz = section->global_tie_offset_z_m - (x[3*nc1+2] + xx[3*nc1+2]);
-					xx[3*nc1+2] += 0.5 * offsetz;
-					}
-
-//fprintf(stderr,"STAGE 1 - GLOBAL TIE: %1d %2.2d:%2.2d:%2.2d  x: %f %f %f     xx: %f %f %f     offset: %f %f %f\n",
-//section->global_tie_status,ifile,isection,section->global_tie_snav,
-//x[3*nc1],x[3*nc1+1],x[3*nc1+2],xx[3*nc1],xx[3*nc1+1],xx[3*nc1+2],
-//offsetx,offsety,offsetz);
-				    }
-				}
-			    }
-
-			/* calculate 2-norm of perturbation */
-			perturbationsize = 0.0;
-			for (i=0;i<ncols;i++)
-			    {
-			    perturbationsize += xx[i] * xx[i];
-			    }
-			perturbationsize = sqrt(perturbationsize) / ncols;
-
-			/* apply perturbation */
-			for (i=0;i<ncols;i++)
-			    {
-			    x[i] += xx[i];
-			    }
-
-			/* check for convergence */
-			perturbationchange = perturbationsize - perturbationsizeold;
-			convergencecriterea = fabs(perturbationchange) / misfit_initial;
-			if (convergencecriterea < MBNA_CONVERGENCE || iter > MBNA_INTERATION_MAX)
-		    	     done = MB_YES;
-/* fprintf(stderr,"BLOCK INVERT: iter:%d ntie:%d misfit_initial:%f misfit_ties:%f perturbationsize:%g perturbationchange:%g convergencecriterea:%g done:%d\n",
-iter,ntie,misfit_initial,misfit_ties,perturbationsize,perturbationchange,convergencecriterea,done);*/
-
-			if (done == MB_NO)
-		             {
-			     perturbationsizeold = perturbationsize;
-			     iter++;
-			     }
-			}
-
-		    /* if there are no fixed blocks contributing to ties or global ties,
-		    	then get average offsets of blocks not flagged as bad
-			to provide a static offset to move final model to be more consistent
-			with the good blocks than the poorly navigated blocks */
-		    block_offset_avg_x = 0.0;
-		    block_offset_avg_y = 0.0;
-		    block_offset_avg_z = 0.0;
-		    navg = 0;
-		    if (nfixed == 0 && nglobal == 0)
-		    	{
-			for (i=0;i<project.num_blocks;i++)
-			    {
-			    use = MB_YES;
-			    for (j=0;j<project.num_files;j++)
-				    {
-				    file = &project.files[j];
-				    if (file->block == i && file->status == MBNA_FILE_POORNAV)
-					    use = MB_NO;
-				    }
-			    if (use == MB_YES)
-				    {
-				    block_offset_avg_x += x[3 * i];
-				    block_offset_avg_y += x[3 * i + 1];
-				    block_offset_avg_z += x[3 * i + 2];
-				    navg++;
-				    }
-			    }
-			if (navg > 0)
-		    	    {
-			    block_offset_avg_x /= navg;
-			    block_offset_avg_y /= navg;
-			    block_offset_avg_z /= navg;
-			    }
-			}
-/* fprintf(stderr,"Average block offsets: x:%f y:%f z:%f  Used %d of %d blocks\n",
-block_offset_avg_x,block_offset_avg_y,block_offset_avg_z,navg,project.num_blocks); */
-
-/* output solution */
-/* fprintf(stderr,"\nAverage offsets: %f %f %f\n",block_offset_avg_x,block_offset_avg_y,block_offset_avg_z);
-for (i=0;i<ncols/3;i++)
-{
-fprintf(stderr, "Survey block:%d  offsets: %f %f %f\n",
-	    i, x[3*i], x[3*i+1], x[3*i+2]);
-} */
-
-		    /* extract results */
-		    for (i=0;i<project.num_files;i++)
-			{
-			file = &project.files[i];
-			file->block_offset_x = x[3 * file->block] - block_offset_avg_x;
-			file->block_offset_y = x[3 * file->block + 1] - block_offset_avg_y;
-			file->block_offset_z = x[3 * file->block + 2] - block_offset_avg_z;
-/* fprintf(stderr,"file:%d block: %d block offsets: %f %f %f\n",
-i,file->block,file->block_offset_x,file->block_offset_y,file->block_offset_z); */
-			}
-
-		    /* deallocate arrays */
-		    status = mb_freed(mbna_verbose, __FILE__, __LINE__, (void **)&x,&error);
-		    status = mb_freed(mbna_verbose, __FILE__, __LINE__, (void **)&xx,&error);
-		    }
-
-		/*----------------------------------------------------------------*/
-		/* Initialize arrays, solution, perturbation                      */
-		/*----------------------------------------------------------------*/
-
-		/* count dimension of solution guess vector */
-		nnav = 0;
-		nsnav = 0;
-		for (i=0;i<project.num_files;i++)
-		    {
-		    file = &project.files[i];
-		    for (j=0;j<file->num_sections;j++)
-			{
-			section = &file->sections[j];
-			nsnav += section->num_snav - section->continuity;
-			for (isnav=0;isnav<section->num_snav;isnav++)
-			    {
-			    if (section->snav_num_ties[isnav] > 0
-				|| section->global_tie_snav == isnav)
-				{
-				section->snav_invert_id[isnav] = nnav;
-				nnav++;
-				}
-			    }
-			}
-		    }
-
-		/* allocate solution vector x, perturbation vector xx, and average solution vector xa */
-		ncols = ndf * nnav;
-		status = mb_mallocd(mbna_verbose, __FILE__, __LINE__, ncols * sizeof(double), (void **)&x,&error);
-		status = mb_mallocd(mbna_verbose, __FILE__, __LINE__, ncols * sizeof(double), (void **)&xx,&error);
-		status = mb_mallocd(mbna_verbose, __FILE__, __LINE__, ncols * sizeof(double), (void **)&xa,&error);
-		status = mb_mallocd(mbna_verbose, __FILE__, __LINE__, ncols * sizeof(double), (void **)&xs,&error);
-		status = mb_mallocd(mbna_verbose, __FILE__, __LINE__, ncols * sizeof(double), (void **)&xw,&error);
-		inav = 0;
-		for (i=0;i<project.num_files;i++)
-		    {
-		    file = &project.files[i];
-		    for (j=0;j<file->num_sections;j++)
-			{
-			section = &file->sections[j];
-			for (isnav=0;isnav<section->num_snav;isnav++)
-			    {
-			    if (section->snav_num_ties[isnav] > 0
-				|| section->global_tie_snav == isnav)
-				{
-				x[ndf * inav] = 0.0;
-				x[ndf * inav + 1] = 0.0;
-				x[ndf * inav + 2] = 0.0;
-				xx[ndf * inav] = 0.0;
-				xx[ndf * inav + 1] = 0.0;
-				xx[ndf * inav + 2] = 0.0;
-				xa[ndf * inav] = file->block_offset_x - block_offset_avg_x;
-				xa[ndf * inav + 1] = file->block_offset_y - block_offset_avg_y;
-				xa[ndf * inav + 2] = file->block_offset_z - block_offset_avg_z;
-				inav++;
-				}
-			    }
-			}
-		    }
-
-		/* calculate initial normalized misfit */
-		misfit_ties_initial = 0.0;
-		misfit_norm_initial = 0.0;
-		nmisfit = 0;
-		for (icrossing=0;icrossing<project.num_crossings;icrossing++)
-		    {
-		    crossing = &project.crossings[icrossing];
-
-		    /* use only set crossings */
-		    if (crossing->status == MBNA_CROSSING_STATUS_SET)
-		    for (j=0;j<crossing->num_ties;j++)
-			{
-			/* get tie */
-			tie = (struct mbna_tie *) &crossing->ties[j];
-
-			/* get absolute id for first snav point */
-			file1 = &project.files[crossing->file_id_1];
-			section1 = &file1->sections[crossing->section_1];
-			nc1 = section1->snav_invert_id[tie->snav_1];
-
-			/* get absolute id for second snav point */
-			file2 = &project.files[crossing->file_id_2];
-			section2 = &file2->sections[crossing->section_2];
-			nc2 = section2->snav_invert_id[tie->snav_2];
-if (nc1 > nsnav - 1 || nc2 > nsnav -1
-|| nc1 < 0 || nc2 < 0)
-fprintf(stderr, "BAD TIE snav ID: %d %d %d\n", nc1, nc2, nsnav);
-
-			/* get offset after removal of block solution */
-			offsetx = tie->offset_x_m - (file2->block_offset_x - file1->block_offset_x);
-			offsety = tie->offset_y_m - (file2->block_offset_y - file1->block_offset_y);
-			offsetz = tie->offset_z_m - (file2->block_offset_z - file1->block_offset_z);
-
-			if (tie->status != MBNA_TIE_Z)
-			    {
-			    /* get long axis misfit */
-			    misfit = (offsetx * tie->sigmax1[0]
-					    + offsety * tie->sigmax1[1]
-					    + offsetz * tie->sigmax1[2]);
-			    misfit_ties_initial += misfit * misfit;
-			    misfit_norm_initial += misfit * misfit / tie->sigmar1 / tie->sigmar1;
-			    nmisfit++;
-
-			    /* get horizontal axis misfit */
-			    misfit = (offsetx * tie->sigmax2[0]
-					    + offsety * tie->sigmax2[1]
-					    + offsetz * tie->sigmax2[2]);
-			    misfit_ties_initial += misfit * misfit;
-			    misfit_norm_initial += misfit * misfit / tie->sigmar2 / tie->sigmar2;
-			    nmisfit++;
-			    }
-
-			if (tie->status != MBNA_TIE_XY)
-			    {
-			    /* get semi-vertical axis misfit */
-			    misfit = (offsetx * tie->sigmax3[0]
-					    + offsety * tie->sigmax3[1]
-					    + offsetz * tie->sigmax3[2]);
-			    misfit_ties_initial += misfit * misfit;
-			    misfit_norm_initial += misfit * misfit / tie->sigmar3 / tie->sigmar3;
-			    nmisfit++;
-			    }
-			}
-		    }
-		for (ifile=0;ifile<project.num_files;ifile++)
-		    {
-		    /* get file */
-		    file = &project.files[ifile];
-		    for (isection=0;isection<file->num_sections;isection++)
-			{
-			/* get section */
-			section = &file->sections[isection];
-			if (section->global_tie_status != MBNA_TIE_NONE)
-			    {
-			    /* get absolute id for snav point */
-			    nc1 = section->snav_invert_id[section->global_tie_snav];
-if (nc1 > nsnav - 1 || nc1 < 0)
-fprintf(stderr, "BAD GLOBAL TIE snav ID: %d %d\n", nc1, nsnav);
-
-			    /* get offset after removal of block solution */
-			    offsetx = section->global_tie_offset_x_m - file->block_offset_x;
-			    offsety = section->global_tie_offset_y_m - file->block_offset_y;
-			    offsetz = section->global_tie_offset_z_m - file->block_offset_z;
-	    
-			    if (section->global_tie_status != MBNA_TIE_Z)
-				{
-				/* get x axis misfit */
-				misfit = offsetx;
-				misfit_ties_initial += misfit * misfit;
-				misfit_norm_initial += misfit * misfit / section->global_tie_xsigma / section->global_tie_xsigma;
-				nmisfit++;
-
-				/* get y axis misfit */
-				misfit = offsety;
-				misfit_ties_initial += misfit * misfit;
-				misfit_norm_initial += misfit * misfit / section->global_tie_ysigma / section->global_tie_ysigma;
-				nmisfit++;
-				}
-
-			    if (section->global_tie_status != MBNA_TIE_XY)
-				{
-				/* get z axis misfit */
-				misfit = offsetz;
-				misfit_ties_initial += misfit * misfit;
-				misfit_norm_initial += misfit * misfit / section->global_tie_zsigma / section->global_tie_zsigma;
-				nmisfit++;
-				}
-			    }
-			}
-		    }
-		misfit_ties_initial = sqrt(misfit_ties_initial) / nmisfit;
-		misfit_norm_initial = sqrt(misfit_norm_initial) / nmisfit;
-
-		/*----------------------------------------------------------------*/
-		/* Step 2 - construct "average" model satisfying ties with        */
-		/*     fixed data (if needed) - this gets pulled out of the       */
-		/*     data along with the average block offsets.                 */
-		/*----------------------------------------------------------------*/
-		if (nfixed > 0 || nglobal > 0)
-		    {
-		    /* set message dialog on */
-		    sprintf(message,"Getting average offsets relative to fixed data...");
-		    do_message_update(message);
-
-		    /* allocate some extra arrays */
-		    status = mb_mallocd(mbna_verbose, __FILE__, __LINE__, nnav * sizeof(int), (void **)&nxs,&error);
-		    for (inav=0;inav<nnav;inav++)
-		    	{
-			nxs[inav] = 0;
-			xs[ndf * inav] = 0.0;
-			xs[ndf * inav + 1] = 0.0;
-			xs[ndf * inav + 2] = 0.0;
-			xw[ndf * inav] = 0.0;
-			xw[ndf * inav + 1] = 0.0;
-			xw[ndf * inav + 2] = 0.0;
-			}
-
-		    /* loop over all ties, working only with ties including fixed sections */
-		    for (icrossing=0;icrossing<project.num_crossings;icrossing++)
-			{
-			crossing = &project.crossings[icrossing];
-
-			/* use only set crossings */
-			if (crossing->status == MBNA_CROSSING_STATUS_SET)
-			for (jtie=0;jtie<crossing->num_ties;jtie++)
-			    {
-			    /* get tie */
-			    tie = (struct mbna_tie *) &crossing->ties[jtie];
-
-			    /* get absolute id for first snav point */
-			    file1 = &project.files[crossing->file_id_1];
-			    section = &file1->sections[crossing->section_1];
-			    nc1 = section->snav_invert_id[tie->snav_1];
-
-			    /* get absolute id for second snav point */
-			    file2 = &project.files[crossing->file_id_2];
-			    section = &file2->sections[crossing->section_2];
-			    nc2 = section->snav_invert_id[tie->snav_2];
-
-			    /* only work with ties in which one section is fixed */
-			    if ((file1->status == MBNA_FILE_FIXEDNAV && file2->status != MBNA_FILE_FIXEDNAV)
-			    	|| (file1->status != MBNA_FILE_FIXEDNAV && file2->status == MBNA_FILE_FIXEDNAV))
-				{
-			        /* get current offset vector including reduction of block solution */
-				if (tie->status != MBNA_TIE_Z)
-				    {
-				    offsetx = tie->offset_x_m - (xa[3*nc2] - xa[3*nc1]);
-				    offsety = tie->offset_y_m - (xa[3*nc2+1] - xa[3*nc1+1]);
-				    }
-				else
-				    {
-				    offsetx = 0.0;
-				    offsety = 0.0;
-				    }
-				if (tie->status != MBNA_TIE_XY)
-				    {
-				    offsetz = tie->offset_z_m - (xa[3*nc2+2] - xa[3*nc1+2]);
-				    }
-				else
-				    {
-				    offsetz = 0.0;
-				    }
-/* fprintf(stderr,"STAGE 2 START: icrossing:%d jtie:%d nc1:%d %d nc2:%d %d offsets: %f %f %f\n",
-icrossing,jtie,nc1,file1->status,nc2,file2->status,offsetx,offsety,offsetz);*/
-
-				/* figure out how far each tied nav point is from the unfixed point in the current tie */
-		    		for (inav=0;inav<nnav;inav++)
-				    nxs[inav] = 0;
-
-				/* first set the unfixed affect nav point */
-				if (file1->status == MBNA_FILE_FIXEDNAV)
-				    {
-				    nxs[nc2] = 1;
-				    }
-				else if (file2->status == MBNA_FILE_FIXEDNAV)
-				    {
-				    nxs[nc1] = 1;
-				    offsetx *= -1.0;
-				    offsety *= -1.0;
-				    offsetz *= -1.0;
-				    }
-
-				/* now loop over all nav points repeatedly */
-				done = MB_NO;
-				while (done == MB_NO)
-				    {
-				    nchange = 0;
-
-				    /* run forward through the data */
-				    inav = 0;
-				    nseq = 0;
-			    	    nseqlast = 0;
-				    for (i=0;i<project.num_files;i++)
-					{
-					file = &project.files[i];
-					for (j=0;j<file->num_sections;j++)
-					    {
-					    section = &file->sections[j];
-					    if (section->continuity == MB_NO)
-			    	    		nseq = 0;
-					    for (isnav=0;isnav<section->num_snav;isnav++)
-						{
-						if (section->snav_num_ties[isnav] > 0)
-						    {
-/* fprintf(stderr,"i:%d j:%d isnav:%d inav:%d nseqqqlast:%d nseq:%d file->status:%d nxs:%d %d",
-i,j,isnav,inav,nseqlast,nseq,file->status,nxs[inav-1],nxs[inav]); */
-						    if (inav > 0 && nseq > 0 && file->status != MBNA_FILE_FIXEDNAV
-						    	&& nxs[inav-1] > 0 && (nxs[inav-1] < nxs[inav] - 1 || nxs[inav] == 0))
-						    	{
-							nxs[inav] = nxs[inav-1] + 1;
-							nchange++;
-/* fprintf(stderr," CHANGE nxs:%d %d",nxs[inav-1],nxs[inav]); */
-							}
-/* fprintf(stderr,"\n"); */
-
-						    /* increment sequence counters */
-						    nseqlast = nseq;
-						    nseq++;
-						    inav++;
-						    }
-						}
-					    }
-					}
-
-/* fprintf(stderr,"\n"); */
-				    /* run backward through the data */
-			    	    nseq = 0;
-			    	    nseqlast = 0;
-				    for (i=project.num_files-1;i>=0;i--)
-					{
-					file = &project.files[i];
-					for (j=file->num_sections-1;j>=0;j--)
-					    {
-					    section = &file->sections[j];
-					    for (isnav=section->num_snav-1;isnav>=0;isnav--)
-						{
-						if (section->snav_num_ties[isnav] > 0)
-						    {
-						    inav--;
-/* fprintf(stderr,"i:%d j:%d isnav:%d inav:%d nseqqqlast:%d nseq:%d file->status:%d nxs:%d %d",
-i,j,isnav,inav,nseqlast,nseq,file->status,nxs[inav],nxs[inav+1]); */
-						    if (inav >= 0 && nseqlast > 0 && file->status != MBNA_FILE_FIXEDNAV
-						    	&& nxs[inav+1] > 0 && (nxs[inav+1] < nxs[inav] - 1 || nxs[inav] == 0))
-						    	{
-							nxs[inav] = nxs[inav+1] + 1;
-							nchange++;
-/* fprintf(stderr," CHANGE nxs:%d %d",nxs[inav],nxs[inav+1]); */
-							}
-/* fprintf(stderr,"\n"); */
-
-						    /* increment sequence counters */
-						    nseqlast = nseq;
-						    nseq++;
-						    }
-						}
-					    if (section->continuity == MB_NO)
-			    	    		nseq = 0;
-					    }
-					}
-
-				    /* run through ties */
-				    for (i=0;i<project.num_crossings;i++)
-					{
-					/* use only set crossings */
-					if (project.crossings[i].status == MBNA_CROSSING_STATUS_SET)
-					for (j=0;j<project.crossings[i].num_ties;j++)
-					    {
-					    /* get tie */
-					    tie = (struct mbna_tie *) &project.crossings[i].ties[j];
-
-					    /* get absolute id for first snav point */
-					    file1 = &project.files[project.crossings[i].file_id_1];
-					    section = &file1->sections[project.crossings[i].section_1];
-					    nc1 = section->snav_invert_id[tie->snav_1];
-
-					    /* get absolute id for second snav point */
-					    file2 = &project.files[project.crossings[i].file_id_2];
-					    section = &file2->sections[project.crossings[i].section_2];
-					    nc2 = section->snav_invert_id[tie->snav_2];
-
-					    /* check for nav points needing closeness setting */
-					    if (nxs[nc1] > 0 && nxs[nc2] == 0)
-					    	{
-						if (file2->status != MBNA_FILE_FIXEDNAV)
-						    {
-						    nxs[nc2] = nxs[nc1] + 1;
-						    nchange++;
-						    }
-						}
-					    else if (nxs[nc1] > 0 && nxs[nc2] > nxs[nc1] + 1)
-					    	{
-						if (file2->status != MBNA_FILE_FIXEDNAV)
-						    {
-						    nxs[nc2] = nxs[nc1] + 1;
-						    nchange++;
-						    }
-						}
-					    else if (nxs[nc2] > 0 && nxs[nc1] == 0)
-					    	{
-						if (file1->status != MBNA_FILE_FIXEDNAV)
-						    {
-						    nxs[nc1] = nxs[nc2] + 1;
-						    nchange++;
-						    }
-						}
-					    else if (nxs[nc2] > 0 && nxs[nc1] > nxs[nc2] + 1)
-					    	{
-						if (file1->status != MBNA_FILE_FIXEDNAV)
-						    {
-						    nxs[nc1] = nxs[nc2] + 1;
-						    nchange++;
-						    }
-						}
-					    }
-					}
-
-				    /* check for done */
-			    	    if (nchange == 0)
-				    	done = MB_YES;
-/* fprintf(stderr,"icrossing:%d nchange:%d done:%d\n",icrossing,nchange,done); */
-				    }
-/* fprintf(stderr,"\n");*/
-
-				/* now loop over the data adding the offset with weighting inversely set by the
-					"distance" from each nav point to the offset point */
-				for (inav=0;inav<nnav;inav++)
-				    {
-/* fprintf(stderr,"inav:%d nxs:%d\n",inav,nxs[inav]); */
-				    if (nxs[inav] > 0)
-				    	{
-					xs[ndf * inav]     += offsetx / (nxs[inav] * nxs[inav]);
-					xs[ndf * inav + 1] += offsety / (nxs[inav] * nxs[inav]);
-					xs[ndf * inav + 2] += offsetz / (nxs[inav] * nxs[inav]);
-					xw[ndf * inav]     += 1.0 / (nxs[inav] * nxs[inav]);
-					xw[ndf * inav + 1] += 1.0 / (nxs[inav] * nxs[inav]);
-					xw[ndf * inav + 2] += 1.0 / (nxs[inav] * nxs[inav]);
-					}
-				    }
-				}
-			    }
-			}
-			
-		    /* loop over all global ties */
-		    for (ifile=0;ifile<project.num_files;ifile++)
-			{
-			file = &project.files[ifile];
-			for (isection=0;isection<file->num_sections;isection++)
-			    {
-			    section = &file->sections[isection];
-			    if (section->global_tie_status != MBNA_TIE_NONE)
-				{
-				/* get absolute id for snav point */
-				nc1 = section->snav_invert_id[section->global_tie_snav];
-
-			        /* get current offset vector including reduction of block solution */
-				offsetx = section->global_tie_offset_x_m - xa[3*nc1];
-				offsety = section->global_tie_offset_y_m - xa[3*nc1+1];
-				offsetz = section->global_tie_offset_z_m - xa[3*nc1+2];
-/*fprintf(stderr,"STAGE 2 - GLOBAL TIE: %1d %2.2d:%2.2d:%2.2d  tie: %f %f %f  model offset: %f %f %f\n",
-section->global_tie_status,ifile,isection,section->global_tie_snav,
-section->global_tie_offset_x_m,section->global_tie_offset_y_m,section->global_tie_offset_z_m,
-offsetx,offsety,offsetz); */
-
-				/* figure out how far each tied nav point is from the global tie point */
-		    		for (inav=0;inav<nnav;inav++)
-				    nxs[inav] = 0;
-
-				/* first set the global tied nav point */
-				nxs[nc1] = 1;
-
-				/* now loop over all nav points repeatedly */
-				done = MB_NO;
-				while (done == MB_NO)
-				    {
-				    nchange = 0;
-
-				    /* run forward through the data */
-				    inav = 0;
-				    nseq = 0;
-			    	    nseqlast = 0;
-				    for (i=0;i<project.num_files;i++)
-					{
-					file1 = &project.files[i];
-					for (j=0;j<file1->num_sections;j++)
-					    {
-					    section1 = &file1->sections[j];
-					    if (section1->continuity == MB_NO)
-			    	    		nseq = 0;
-					    for (isnav=0;isnav<section1->num_snav;isnav++)
-						{
-						if (section1->snav_num_ties[isnav] > 0)
-						    {
-						    if (inav > 0 && nseq > 0 && file1->status != MBNA_FILE_FIXEDNAV
-						    	&& nxs[inav-1] > 0 && (nxs[inav-1] < nxs[inav] - 1 || nxs[inav] == 0))
-						    	{
-							nxs[inav] = nxs[inav-1] + 1;
-							nchange++;
-							}
-
-						    /* increment sequence counters */
-						    nseqlast = nseq;
-						    nseq++;
-						    inav++;
-						    }
-						}
-					    }
-					}
-
-				    /* run backward through the data */
-			    	    nseq = 0;
-			    	    nseqlast = 0;
-				    for (i=project.num_files-1;i>=0;i--)
-					{
-					file1 = &project.files[i];
-					for (j=file1->num_sections-1;j>=0;j--)
-					    {
-					    section1 = &file1->sections[j];
-					    for (isnav=section1->num_snav-1;isnav>=0;isnav--)
-						{
-						if (section1->snav_num_ties[isnav] > 0)
-						    {
-						    inav--;
-						    if (inav >= 0 && nseqlast > 0 && file1->status != MBNA_FILE_FIXEDNAV
-						    	&& nxs[inav+1] > 0 && (nxs[inav+1] < nxs[inav] - 1 || nxs[inav] == 0))
-						    	{
-							nxs[inav] = nxs[inav+1] + 1;
-							nchange++;
-							}
-
-						    /* increment sequence counters */
-						    nseqlast = nseq;
-						    nseq++;
-						    }
-						}
-					    if (section1->continuity == MB_NO)
-			    	    		nseq = 0;
-					    }
-					}
-
-				    /* run through ties */
-				    for (i=0;i<project.num_crossings;i++)
-					{
-					/* use only set crossings */
-					if (project.crossings[i].status == MBNA_CROSSING_STATUS_SET)
-					for (j=0;j<project.crossings[i].num_ties;j++)
-					    {
-					    /* get tie */
-					    tie = (struct mbna_tie *) &project.crossings[i].ties[j];
-
-					    /* get absolute id for first snav point */
-					    file1 = &project.files[project.crossings[i].file_id_1];
-					    section1 = &file1->sections[project.crossings[i].section_1];
-					    nc1 = section1->snav_invert_id[tie->snav_1];
-
-					    /* get absolute id for second snav point */
-					    file2 = &project.files[project.crossings[i].file_id_2];
-					    section2 = &file2->sections[project.crossings[i].section_2];
-					    nc2 = section2->snav_invert_id[tie->snav_2];
-
-					    /* check for nav points needing closeness setting */
-					    if (nxs[nc1] > 0 && nxs[nc2] == 0)
-					    	{
-						if (file2->status != MBNA_FILE_FIXEDNAV)
-						    {
-						    nxs[nc2] = nxs[nc1] + 1;
-						    nchange++;
-						    }
-						}
-					    else if (nxs[nc1] > 0 && nxs[nc2] > nxs[nc1] + 1)
-					    	{
-						if (file2->status != MBNA_FILE_FIXEDNAV)
-						    {
-						    nxs[nc2] = nxs[nc1] + 1;
-						    nchange++;
-						    }
-						}
-					    else if (nxs[nc2] > 0 && nxs[nc1] == 0)
-					    	{
-						if (file1->status != MBNA_FILE_FIXEDNAV)
-						    {
-						    nxs[nc1] = nxs[nc2] + 1;
-						    nchange++;
-						    }
-						}
-					    else if (nxs[nc2] > 0 && nxs[nc1] > nxs[nc2] + 1)
-					    	{
-						if (file1->status != MBNA_FILE_FIXEDNAV)
-						    {
-						    nxs[nc1] = nxs[nc2] + 1;
-						    nchange++;
-						    }
-						}
-					    }
-					}
-
-				    /* check for done */
-			    	    if (nchange == 0)
-				    	done = MB_YES;
-				    }
-
-				/* now loop over the data adding the offset with weighting inversely set by the
-					"distance" from each nav point to the offset point */
-				for (inav=0;inav<nnav;inav++)
-				    {
-				    if (nxs[inav] > 0)
-				    	{
-					if (section->global_tie_status != MBNA_TIE_Z)
-					    {
-					    xs[ndf * inav]     += offsetx / (nxs[inav] * nxs[inav]);
-					    xs[ndf * inav + 1] += offsety / (nxs[inav] * nxs[inav]);
-					    xw[ndf * inav]     += 1.0 / (nxs[inav] * nxs[inav]);
-					    xw[ndf * inav + 1] += 1.0 / (nxs[inav] * nxs[inav]);
-					    }
-					if (section->global_tie_status != MBNA_TIE_XY)
-					    {
-					    xs[ndf * inav + 2] += offsetz / (nxs[inav] * nxs[inav]);
-					    xw[ndf * inav + 2] += 1.0 / (nxs[inav] * nxs[inav]);
-					    }
-					}
-				    }
-				}
-			    }
-			}
-
-		    /* construct average offset model */
-		    for (inav=0;inav<nnav;inav++)
-			{
-			if (xw[ndf * inav] > 0.0)
-			    xa[ndf * inav] += xs[ndf * inav] / xw[ndf * inav];
-			if (xw[ndf * inav + 1] > 0.0)
-			    xa[ndf * inav + 1] += xs[ndf * inav + 1] / xw[ndf * inav + 1];
-			if (xw[ndf * inav + 2] > 0.0)
-			    xa[ndf * inav + 2] += xs[ndf * inav + 2] / xw[ndf * inav + 2];
-//fprintf(stderr,"XA CALC:  xs: %f %f %f  xw: %f %f %f  xa: %f %f %f\n",
-//xs[ndf*inav],xs[ndf*inav+1],xs[ndf*inav+2],xw[ndf*inav],xw[ndf*inav+1],xw[ndf*inav+2],xa[ndf*inav],xa[ndf*inav+1],xa[ndf*inav+2]);
-			}
-
-		    /* save solution */
-		    k = 0;
-		    for (i=0;i<project.num_files;i++)
-			{
-			file = &project.files[i];
-			for (j=0;j<file->num_sections;j++)
-			    {
-			    section = &file->sections[j];
-			    for (isnav=0;isnav<section->num_snav;isnav++)
-				{
-				if (section->snav_num_ties[isnav] > 0
-				    || section->global_tie_snav == isnav)
-				    {
-				    k = section->snav_invert_id[isnav];
-				    section->snav_lon_offset[isnav] = (x[3*k] + xa[3*k]) * mbna_mtodeglon;
-/* fprintf(stderr,"i:%d j:%d isnav:%d k:%d x[3*k]:%f xa[3*k]:%f mbna_mtodeglon:%f section->snav_lon_offset[isnav]:%f\n",
-i,j,isnav,k,x[3*k],xa[3*k],mbna_mtodeglon,section->snav_lon_offset[isnav]); */
-				    section->snav_lat_offset[isnav] = (x[3*k+1] + xa[3*k+1]) * mbna_mtodeglat;
-/* fprintf(stderr,"i:%d j:%d isnav:%d k:%d x[3*k+1]:%f xa[3*k+1]:%f mbna_mtodeglat:%f section->snav_lat_offset[isnav]:%f\n",
-i,j,isnav,k,x[3*k+1],xa[3*k+1],mbna_mtodeglat,section->snav_lat_offset[isnav]); */
-				    section->snav_z_offset[isnav] = (x[3*k+2] + xa[3*k+2]);
-/* fprintf(stderr,"i:%d j:%d isnav:%d k:%d x[3*k+2]:%f xa[3*k+2]:%f section->snav_z_offset[isnav]:%f\n\n",
-i,j,isnav,k,x[3*k+2],xa[3*k+2],section->snav_z_offset[isnav]); */
-				    }
-				}
-			    }
-			}
-
-		    /* interpolate the solution */
-		    mbnavadjust_interpolatesolution();
-
-		    /* save interpolated solution */
-		    k = 0;
-		    for (i=0;i<project.num_files;i++)
-			{
-			file = &project.files[i];
-			for (j=0;j<file->num_sections;j++)
-			    {
-			    section = &file->sections[j];
-			    for (isnav=0;isnav<section->num_snav;isnav++)
-				{
-				section->snav_lon_offset[isnav] = section->snav_lon_offset_int[isnav];
-				section->snav_lat_offset[isnav] = section->snav_lat_offset_int[isnav];
-				section->snav_z_offset[isnav] = section->snav_z_offset_int[isnav];
-				}
-			    }
-			}
-
-		    /* update model plot */
-		    if (project.modelplot == MB_YES && iter % 25 == 0)
-		    	mbnavadjust_modelplot_plot();
-
-		    /* output goodness of fit for ties including fixed sections */
-		    for (icrossing=0;icrossing<project.num_crossings;icrossing++)
-			{
-			crossing = &project.crossings[icrossing];
-
-			/* use only set crossings */
-			if (crossing->status == MBNA_CROSSING_STATUS_SET)
-			for (jtie=0;jtie<crossing->num_ties;jtie++)
-			    {
-			    /* get tie */
-			    tie = (struct mbna_tie *) &crossing->ties[jtie];
-
-			    /* get absolute id for first snav point */
-			    file1 = &project.files[crossing->file_id_1];
-			    section = &file1->sections[crossing->section_1];
-			    nc1 = section->snav_invert_id[tie->snav_1];
-
-			    /* get absolute id for second snav point */
-			    file2 = &project.files[crossing->file_id_2];
-			    section = &file2->sections[crossing->section_2];
-			    nc2 = section->snav_invert_id[tie->snav_2];
-
-			    /* only work with ties in which one section is fixed */
-			    if ((file1->status == MBNA_FILE_FIXEDNAV && file2->status != MBNA_FILE_FIXEDNAV)
-			    	|| (file1->status != MBNA_FILE_FIXEDNAV && file2->status == MBNA_FILE_FIXEDNAV))
-				{
-			        /* get current offset vector including reduction of block solution */
-				offsetx = tie->offset_x_m - (xa[3*nc2] - xa[3*nc1]);
-				offsety = tie->offset_y_m - (xa[3*nc2+1] - xa[3*nc1+1]);
-				offsetz = tie->offset_z_m - (xa[3*nc2+2] - xa[3*nc1+2]);
-//fprintf(stderr,"STAGE 2 RESULT - CROSSING TIE: icrossing:%d jtie:%d nc1:%d %d nc2:%d %d offsets: %f %f %f\n",
-//icrossing,jtie,nc1,file1->status,nc2,file2->status,offsetx,offsety,offsetz);
-				}
-			    }
-			}
-
-		    /* output goodness of fit for global ties */
-		    for (ifile=0;ifile<project.num_files;ifile++)
-			{
-			file = &project.files[ifile];
-			for (isection=0;isection<file->num_sections;isection++)
-			    {
-			    /* get section */
-			    section = (struct mbna_section *) &file->sections[isection];
-			    
-			    /* only work with set global ties */
-			    if (section->global_tie_status != MBNA_TIE_NONE)
-				{
-				/* get absolute id for first snav point */
-				nc1 = section->snav_invert_id[section->global_tie_snav];
-
-//fprintf(stderr,"STAGE 2 RESULT - GLOBAL TIE: %2.2d:%2.2d:%2.2d  tie: \n",
-//ifile,isection,section->global_tie_snav);
-//if (section->global_tie_status != MBNA_TIE_Z)
-//fprintf(stderr,"x: %f y:%f ",section->global_tie_offset_x_m,section->global_tie_offset_y_m);
-//if (section->global_tie_status != MBNA_TIE_XY)
-//fprintf(stderr,"z:%f ",section->global_tie_offset_z_m);
-//fprintf(stderr,"  model offset: ");
-
-			        /* get current offset vector including reduction of block solution */
-				if (section->global_tie_status != MBNA_TIE_Z)
-				    {
-				    offsetx = section->global_tie_offset_x_m - xa[3*nc1];
-				    offsety = section->global_tie_offset_y_m - xa[3*nc1+1];
-//fprintf(stderr,"x: %f y:%f ",offsetx,offsety);
-				    }
-				if (section->global_tie_status != MBNA_TIE_XY)
-				    {
-				    offsetz = section->global_tie_offset_z_m - xa[3*nc1+2];
-//fprintf(stderr,"z:%f ",offsetz);	
-				    }
-				}
-			    }
-			}
-
-		    /* deallocate arrays */
-		    status = mb_freed(mbna_verbose, __FILE__, __LINE__, (void **)&nxs,&error);
-		    }
-
-
-		/*----------------------------------------------------------------*/
-		/* Step 3 - invert for model satisfying all nav ties              */
-		/*----------------------------------------------------------------*/
-
-		/* loop until convergence */
-		done = MB_NO;
-		iter = 0;
-		perturbationsizeold = misfit_ties_initial;
-		mbna_smoothweight = pow(10.0, project.smoothing) * mbna_offsetweight;
-		while (done == MB_NO)
-		    {
-		    /* zero smoothed adjustment vector solution */
-		    for (i=0;i<ncols;i++)
-			{
-			xx[i] = 0.0;
-			xs[i] = 0.0;
-			xw[i] = 0.0;
-			}
-
-		    /* loop over each crossing, applying offsets evenly to both points */
-		    for (icrossing=0;icrossing<project.num_crossings;icrossing++)
-			{
-			crossing = &project.crossings[icrossing];
-
-			/* use only set crossings */
-			if (crossing->status == MBNA_CROSSING_STATUS_SET)
-			for (j=0;j<crossing->num_ties;j++)
-			    {
-			    /* get tie */
-			    tie = (struct mbna_tie *) &crossing->ties[j];
-
-			    /* get absolute id for first snav point */
-			    file1 = &project.files[crossing->file_id_1];
-			    section1 = &file1->sections[crossing->section_1];
-			    nc1 = section1->snav_invert_id[tie->snav_1];
-
-			    /* get absolute id for second snav point */
-			    file2 = &project.files[crossing->file_id_2];
-			    section2 = &file2->sections[crossing->section_2];
-			    nc2 = section2->snav_invert_id[tie->snav_2];
-if (file1->sections[crossing->section_1].snav_time_d[tie->snav_1] == file2->sections[crossing->section_2].snav_time_d[tie->snav_2])
-fprintf(stderr,"ZERO TIME BETWEEN TIED POINTS!!  file:section:snav - %d:%d:%d   %d:%d:%d  DIFF:%f\n",
-	crossing->file_id_1,crossing->section_1,tie->snav_1,
-	crossing->file_id_2,crossing->section_2,tie->snav_2,
-	(file1->sections[crossing->section_1].snav_time_d[tie->snav_1]
-	 - file2->sections[crossing->section_2].snav_time_d[tie->snav_2]));
-
-			    /* get current offset vector including reduction of block solution */
-			    if (tie->status != MBNA_TIE_Z)
-			        {
-				offsetx = tie->offset_x_m - (xa[3*nc2] - xa[3*nc1]) - (x[3*nc2] - x[3*nc1]);
-				offsety = tie->offset_y_m - (xa[3*nc2+1] - xa[3*nc1+1]) - (x[3*nc2+1] - x[3*nc1+1]);
-				}
-			    else
-			        {
-				offsetx = 0.0;
-				offsety = 0.0;
-				}
-			    if (tie->status != MBNA_TIE_XY)
-			        {
-				offsetz = tie->offset_z_m - (xa[3*nc2+2] - xa[3*nc1+2]) - (x[3*nc2+2] - x[3*nc1+2]);
-				}
-			    else
-			        {
-				offsetz = 0.0;
-				}
-			    offsetr = sqrt(offsetx * offsetx + offsety * offsety + offsetz * offsetz);
-
-			    /* deal with each component of the error ellipse
-			    	- project offset vector onto each component by dot-product
-				- weight inversely by size of error for that component */
-
-			    /* deal with long axis */
-			    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-				projected_offset = offsetx * tie->sigmax1[0]
-						+ offsety * tie->sigmax1[1]
-						+ offsetz * tie->sigmax1[2];
-			    else
-				projected_offset = offsetx * tie->sigmax1[0]
-						+ offsety * tie->sigmax1[1];
-			    if (fabs(tie->sigmar1) > 0.0)
-			    	{
-				xyweight = sqrt(mbna_offsetweight / tie->sigmar1);
-				zweight = sqrt(mbna_offsetweight / mbna_zweightfactor / tie->sigmar1);
-				}
-			    else
-			    	{
-				xyweight = 0.0;
-			    	zweight = 0.0;
-				}
-//zweight = 0.0;
-
-			    /* deal with fixed, good, or poor status of sections */
-			    if (file1->status == file2->status)
-			    	{
-				if (file1->status == MBNA_FILE_GOODNAV || file1->status == MBNA_FILE_POORNAV)
-				    {
-				    xs[3*nc1]   += -0.5 * xyweight * projected_offset * tie->sigmax1[0];
-				    xs[3*nc1+1] += -0.5 * xyweight * projected_offset * tie->sigmax1[1];
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc1+2] += -0.5 * zweight * projected_offset * tie->sigmax1[2];
-				    xs[3*nc2]   +=  0.5 * xyweight * projected_offset * tie->sigmax1[0];
-				    xs[3*nc2+1] +=  0.5 * xyweight * projected_offset * tie->sigmax1[1];
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc2+2] +=  0.5 * zweight * projected_offset * tie->sigmax1[2];				    
-				    }
-				else if (file1->status == MBNA_FILE_FIXEDXYNAV)
-				    {
-				    /*
-				    xs[3*nc1]   +=  0.0;
-				    xs[3*nc1+1] +=  0.0;
-				    */
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc1+2] += -0.5 * zweight * projected_offset * tie->sigmax1[2];
-				    /*
-				    xs[3*nc2]   +=  0.0;
-				    xs[3*nc2+1] +=  0.0;
-				    */
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc2+2] +=  0.5 * zweight * projected_offset * tie->sigmax1[2];
-				    }
-				else if (file1->status == MBNA_FILE_FIXEDZNAV)
-				    {
-				    xs[3*nc1]   += -0.5 * xyweight * projected_offset * tie->sigmax1[0];
-				    xs[3*nc1+1] += -0.5 * xyweight * projected_offset * tie->sigmax1[1];
-				    /*
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc1+2] +=  0.0;
-				    */
-				    xs[3*nc2]   +=  0.5 * xyweight * projected_offset * tie->sigmax1[0];
-				    xs[3*nc2+1] +=  0.5 * xyweight * projected_offset * tie->sigmax1[1];
-				    /*
-				    xs[3*nc2+2] +=  0.0;
-				    */
-				    }
-				}
-			    else if (file1->status == MBNA_FILE_GOODNAV)
-			    	{
-				if (file2->status == MBNA_FILE_POORNAV)
-				    {
-				    xs[3*nc1]   += -0.005 * xyweight * projected_offset * tie->sigmax1[0];
-				    xs[3*nc1+1] += -0.005 * xyweight * projected_offset * tie->sigmax1[1];
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc1+2] += -0.005 * zweight * projected_offset * tie->sigmax1[2];
-				    xs[3*nc2]   +=  0.995 * xyweight * projected_offset * tie->sigmax1[0];
-				    xs[3*nc2+1] +=  0.995 * xyweight * projected_offset * tie->sigmax1[1];
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc2+2] +=  0.995 * zweight * projected_offset * tie->sigmax1[2];
-				    }
-				else if (file2->status == MBNA_FILE_FIXEDNAV)
-				    {
-				    xs[3*nc1]   += -xyweight * projected_offset * tie->sigmax1[0];
-				    xs[3*nc1+1] += -xyweight * projected_offset * tie->sigmax1[1];
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc1+2] += -zweight * projected_offset * tie->sigmax1[2];
-				    /*
-				    xs[3*nc2]   +=  0.0;
-				    xs[3*nc2+1] +=  0.0;
-				    xs[3*nc2+2] +=  0.0;
-				    */
-				    }
-				else if (file2->status == MBNA_FILE_FIXEDXYNAV)
-				    {
-				    xs[3*nc1]   += -xyweight * projected_offset * tie->sigmax1[0];
-				    xs[3*nc1+1] += -xyweight * projected_offset * tie->sigmax1[1];
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc1+2] += -0.5 * zweight * projected_offset * tie->sigmax1[2];
-				    /*
-				    xs[3*nc2]   +=  0.0;
-				    xs[3*nc2+1] +=  0.0;
-				    */
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc2+2] +=  0.5 * zweight * projected_offset * tie->sigmax1[2];
-				    }
-				else if (file2->status == MBNA_FILE_FIXEDZNAV)
-				    {
-				    xs[3*nc1]   += -0.5 * xyweight * projected_offset * tie->sigmax1[0];
-				    xs[3*nc1+1] += -0.5 * xyweight * projected_offset * tie->sigmax1[1];
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc1+2] += -zweight * projected_offset * tie->sigmax1[2];
-				    xs[3*nc2]   +=  0.5 * xyweight * projected_offset * tie->sigmax1[0];
-				    xs[3*nc2+1] +=  0.5 * xyweight * projected_offset * tie->sigmax1[1];
-				    /*
-				    xs[3*nc2+2] +=  0.0;
-				    */
-				    }
-				}
-			    else if (file1->status == MBNA_FILE_POORNAV)
-			    	{
-				if (file2->status == MBNA_FILE_GOODNAV)
-				    {
-				    xs[3*nc1]   += -0.995 * xyweight * projected_offset * tie->sigmax1[0];
-				    xs[3*nc1+1] += -0.995 * xyweight * projected_offset * tie->sigmax1[1];
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc1+2] += -0.995 * zweight * projected_offset * tie->sigmax1[2];
-				    xs[3*nc2]   +=  0.005 * xyweight * projected_offset * tie->sigmax1[0];
-				    xs[3*nc2+1] +=  0.005 * xyweight * projected_offset * tie->sigmax1[1];
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc2+2] +=  0.005 * zweight * projected_offset * tie->sigmax1[2];
-				    }
-				else if (file2->status == MBNA_FILE_FIXEDNAV)
-				    {
-				    xs[3*nc1]   += -xyweight * projected_offset * tie->sigmax1[0];
-				    xs[3*nc1+1] += -xyweight * projected_offset * tie->sigmax1[1];
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc1+2] += -zweight * projected_offset * tie->sigmax1[2];
-				    /*
-				    xs[3*nc2]   +=  0.0;
-				    xs[3*nc2+1] +=  0.0;
-				    xs[3*nc2+2] +=  0.0;
-				    */
-				    }
-				else if (file2->status == MBNA_FILE_FIXEDXYNAV)
-				    {
-				    xs[3*nc1]   += -xyweight * projected_offset * tie->sigmax1[0];
-				    xs[3*nc1+1] += -xyweight * projected_offset * tie->sigmax1[1];
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc1+2] += -0.995 * zweight * projected_offset * tie->sigmax1[2];
-				    /*
-				    xs[3*nc2]   +=  0.0;
-				    xs[3*nc2+1] +=  0.0;
-				    */
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc2+2] +=  0.005 * zweight * projected_offset * tie->sigmax1[2];
-				    }
-				else if (file2->status == MBNA_FILE_FIXEDZNAV)
-				    {
-				    xs[3*nc1]   += -0.995 * xyweight * projected_offset * tie->sigmax1[0];
-				    xs[3*nc1+1] += -0.995 * xyweight * projected_offset * tie->sigmax1[1];
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc1+2] += -zweight * projected_offset * tie->sigmax1[2];
-				    xs[3*nc2]   +=  0.005 * xyweight * projected_offset * tie->sigmax1[0];
-				    xs[3*nc2+1] +=  0.005 * xyweight * projected_offset * tie->sigmax1[1];
-				    /*
-				    xs[3*nc2+2] +=  0.0;
-				    */
-				    }
-				}
-			    else if (file1->status == MBNA_FILE_FIXEDNAV)
-			    	{
-				if (file2->status == MBNA_FILE_GOODNAV || file2->status == MBNA_FILE_POORNAV)
-				    {
-				    /*
-				    xs[3*nc1]   +=  0.0;
-				    xs[3*nc1+1] +=  0.0;
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc1+2] +=  0.0;
-				    */
-				    xs[3*nc2]   +=  xyweight * projected_offset * tie->sigmax1[0];
-				    xs[3*nc2+1] +=  xyweight * projected_offset * tie->sigmax1[1];
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc2+2] +=  zweight * projected_offset * tie->sigmax1[2];
-				    }
-				else if (file2->status == MBNA_FILE_FIXEDXYNAV)
-				    {
-				    /*
-				    xs[3*nc1]   +=  0.0;
-				    xs[3*nc1+1] +=  0.0;
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc1+2] +=  0.0;
-				    xs[3*nc2]   +=  0.0;
-				    xs[3*nc2+1] +=  0.0;
-				    */
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc2+2] +=  zweight * projected_offset * tie->sigmax1[2];
-				    }
-				else if (file2->status == MBNA_FILE_FIXEDZNAV)
-				    {
-				    /*
-				    xs[3*nc1]   +=  0.0;
-				    xs[3*nc1+1] +=  0.0;
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc1+2] +=  0.0;
-				    */
-				    xs[3*nc2]   +=  xyweight * projected_offset * tie->sigmax1[0];
-				    xs[3*nc2+1] +=  xyweight * projected_offset * tie->sigmax1[1];
-				    /*
-				    xs[3*nc2+2] +=  0.0;
-				    */
-				    }
-				}
-			    else if (file1->status == MBNA_FILE_FIXEDXYNAV)
-			    	{
-				if (file2->status == MBNA_FILE_GOODNAV)
-				    {
-				    /*
-				    xs[3*nc1]   +=  0.0;
-				    xs[3*nc1+1] +=  0.0;
-				    */
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc1+2] += -0.5 * zweight * projected_offset * tie->sigmax1[2];
-				    xs[3*nc2]   +=  xyweight * projected_offset * tie->sigmax1[0];
-				    xs[3*nc2+1] +=  xyweight * projected_offset * tie->sigmax1[1];
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc2+2] +=  0.5 * zweight * projected_offset * tie->sigmax1[2];
-				    }
-				else if (file2->status == MBNA_FILE_POORNAV)
-				    {
-				    /*
-				    xs[3*nc1]   +=  0.0;
-				    xs[3*nc1+1] +=  0.0;
-				    */
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc1+2] += -0.005 * zweight * projected_offset * tie->sigmax1[2];
-				    xs[3*nc2]   +=  xyweight * projected_offset * tie->sigmax1[0];
-				    xs[3*nc2+1] +=  xyweight * projected_offset * tie->sigmax1[1];
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc2+2] +=  0.995 * zweight * projected_offset * tie->sigmax1[2];
-				    }
-				else if (file2->status == MBNA_FILE_FIXEDNAV)
-				    {
-				    /*
-				    xs[3*nc1]   +=  0.0;
-				    xs[3*nc1+1] +=  0.0;
-				    */
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc1+2] += -zweight * projected_offset * tie->sigmax1[2];
-				    /*
-				    xs[3*nc2]   +=  0.0;
-				    xs[3*nc2+1] +=  0.0;
-				    xs[3*nc2+2] +=  0.0;
-				    */
-				    }
-				else if (file2->status == MBNA_FILE_FIXEDZNAV)
-				    {
-				    /*
-				    xs[3*nc1]   +=  0.0;
-				    xs[3*nc1+1] +=  0.0;
-				    */
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc1+2] += -zweight * projected_offset * tie->sigmax1[2];
-				    xs[3*nc2]   +=  xyweight * projected_offset * tie->sigmax1[0];
-				    xs[3*nc2+1] +=  xyweight * projected_offset * tie->sigmax1[1];
-				    /*
-				    xs[3*nc2+2] +=  0.0;
-				    */
-				    }
-				}
-			    else if (file1->status == MBNA_FILE_FIXEDZNAV)
-			    	{
-				if (file2->status == MBNA_FILE_GOODNAV)
-				    {
-				    xs[3*nc1]   += -0.5 * xyweight * projected_offset * tie->sigmax1[0];
-				    xs[3*nc1+1] += -0.5 * xyweight * projected_offset * tie->sigmax1[1];
-				    /*
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc1+2] +=  0.0;
-				    */
-				    xs[3*nc2]   +=  0.5 * xyweight * projected_offset * tie->sigmax1[0];
-				    xs[3*nc2+1] +=  0.5 * xyweight * projected_offset * tie->sigmax1[1];
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc2+2] +=  zweight * projected_offset * tie->sigmax1[2];
-				    }
-				else if (file2->status == MBNA_FILE_POORNAV)
-				    {
-				    xs[3*nc1]   += -0.005 * xyweight * projected_offset * tie->sigmax1[0];
-				    xs[3*nc1+1] += -0.005 * xyweight * projected_offset * tie->sigmax1[1];
-				    /*
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc1+2] +=  0.0;
-				    */
-				    xs[3*nc2]   +=  0.995 * xyweight * projected_offset * tie->sigmax1[0];
-				    xs[3*nc2+1] +=  0.995 * xyweight * projected_offset * tie->sigmax1[1];
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc2+2] +=  zweight * projected_offset * tie->sigmax1[2];
-				    }
-				else if (file2->status == MBNA_FILE_FIXEDNAV)
-				    {
-				    xs[3*nc1]   += -xyweight * projected_offset * tie->sigmax1[0];
-				    xs[3*nc1+1] += -xyweight * projected_offset * tie->sigmax1[1];
-				    /*
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc1+2] +=  0.0;
-				    xs[3*nc2]   +=  0.0;
-				    xs[3*nc2+1] +=  0.0;
-				    xs[3*nc2+2] +=  0.0;
-				    */
-				    }
-				else if (file2->status == MBNA_FILE_FIXEDXYNAV)
-				    {
-				    xs[3*nc1]   += -xyweight * projected_offset * tie->sigmax1[0];
-				    xs[3*nc1+1] += -xyweight * projected_offset * tie->sigmax1[1];
-				    /*
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc1+2] +=  0.0;
-				    xs[3*nc2]   +=  0.0;
-				    xs[3*nc2+1] +=  0.0;
-				    */
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc2+2] +=  zweight * projected_offset * tie->sigmax1[2];
-				    }
-				}
-			    xw[3*nc1]   += xyweight;
-			    xw[3*nc1+1] += xyweight;
-			    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-				xw[3*nc1+2] += zweight;
-			    xw[3*nc2]   += xyweight;
-			    xw[3*nc2+1] += xyweight;
-			    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-				xw[3*nc2+2] += zweight;
-/* fprintf(stderr,"long axis:  nc1:%d xx:%f %f %f  nc2:%d xx:%f %f %f\n",
-nc1,xs[3*nc1],xs[3*nc1+1],xs[3*nc1+2],
-nc2,xs[3*nc2],xs[3*nc2+1],xs[3*nc2+2]);*/
-
-			    /* deal with horizontal axis */
-			    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-				projected_offset = offsetx * tie->sigmax2[0]
-						+ offsety * tie->sigmax2[1]
-						+ offsetz * tie->sigmax2[2];
-			    else
-				projected_offset = offsetx * tie->sigmax2[0]
-						+ offsety * tie->sigmax2[1];
-			    if (fabs(tie->sigmar2) > 0.0)
-			    	{
-				xyweight = sqrt(mbna_offsetweight / tie->sigmar2);
-			    	zweight = sqrt(mbna_offsetweight / mbna_zweightfactor / tie->sigmar2);
-				}
-			    else
-			    	{
-				xyweight = 0.0;
-			    	zweight = 0.0;
-				}
-//zweight = 0.0;
-
-			    /* deal with fixed, good, or poor status of sections */
-			    if (file1->status == file2->status)
-			    	{
-				if (file1->status == MBNA_FILE_GOODNAV || file1->status == MBNA_FILE_POORNAV)
-				    {
-				    xs[3*nc1]   += -0.5 * xyweight * projected_offset * tie->sigmax2[0];
-				    xs[3*nc1+1] += -0.5 * xyweight * projected_offset * tie->sigmax2[1];
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc1+2] += -0.5 * zweight * projected_offset * tie->sigmax2[2];
-				    xs[3*nc2]   +=  0.5 * xyweight * projected_offset * tie->sigmax2[0];
-				    xs[3*nc2+1] +=  0.5 * xyweight * projected_offset * tie->sigmax2[1];
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc2+2] +=  0.5 * zweight * projected_offset * tie->sigmax2[2];
-				    }
-				else if (file1->status == MBNA_FILE_FIXEDXYNAV)
-				    {
-				    /*
-				    xs[3*nc1]   +=  0.0;
-				    xs[3*nc1+1] +=  0.0;
-				    */
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc1+2] += -0.5 * zweight * projected_offset * tie->sigmax2[2];
-				    /*
-				    xs[3*nc2]   +=  0.0;
-				    xs[3*nc2+1] +=  0.0;
-				    */
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc2+2] +=  0.5 * zweight * projected_offset * tie->sigmax2[2];
-				    }
-				else if (file1->status == MBNA_FILE_FIXEDZNAV)
-				    {
-				    xs[3*nc1]   += -0.5 * xyweight * projected_offset * tie->sigmax2[0];
-				    xs[3*nc1+1] += -0.5 * xyweight * projected_offset * tie->sigmax2[1];
-				    /*
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc1+2] +=  0.0;
-				    */
-				    xs[3*nc2]   +=  0.5 * xyweight * projected_offset * tie->sigmax2[0];
-				    xs[3*nc2+1] +=  0.5 * xyweight * projected_offset * tie->sigmax2[1];
-				    /*
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc2+2] +=  0.0;
-				    */
-				    }
-				}
-			    else if (file1->status == MBNA_FILE_GOODNAV)
-			    	{
-				if (file2->status == MBNA_FILE_POORNAV)
-				    {
-				    xs[3*nc1]   += -0.005 * xyweight * projected_offset * tie->sigmax2[0];
-				    xs[3*nc1+1] += -0.005 * xyweight * projected_offset * tie->sigmax2[1];
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc1+2] += -0.005 * zweight * projected_offset * tie->sigmax2[2];
-				    xs[3*nc2]   +=  0.995 * xyweight * projected_offset * tie->sigmax2[0];
-				    xs[3*nc2+1] +=  0.995 * xyweight * projected_offset * tie->sigmax2[1];
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc2+2] +=  0.995 * zweight * projected_offset * tie->sigmax2[2];
-				    }
-				else if (file2->status == MBNA_FILE_FIXEDNAV)
-				    {
-				    xs[3*nc1]   += -xyweight * projected_offset * tie->sigmax2[0];
-				    xs[3*nc1+1] += -xyweight * projected_offset * tie->sigmax2[1];
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc1+2] += -zweight * projected_offset * tie->sigmax2[2];
-				    /*
-				    xs[3*nc2]   +=  0.0;
-				    xs[3*nc2+1] +=  0.0;
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc2+2] +=  0.0;
-				    */
-				    }
-				else if (file2->status == MBNA_FILE_FIXEDXYNAV)
-				    {
-				    xs[3*nc1]   += -xyweight * projected_offset * tie->sigmax2[0];
-				    xs[3*nc1+1] += -xyweight * projected_offset * tie->sigmax2[1];
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc1+2] += -0.5 * zweight * projected_offset * tie->sigmax2[2];
-				    /*
-				    xs[3*nc2]   +=  0.0;
-				    xs[3*nc2+1] +=  0.0;
-				    */
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc2+2] +=  0.5 * zweight * projected_offset * tie->sigmax2[2];
-				    }
-				else if (file2->status == MBNA_FILE_FIXEDZNAV)
-				    {
-				    xs[3*nc1]   += -0.5 * xyweight * projected_offset * tie->sigmax2[0];
-				    xs[3*nc1+1] += -0.5 * xyweight * projected_offset * tie->sigmax2[1];
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc1+2] += -zweight * projected_offset * tie->sigmax2[2];
-				    xs[3*nc2]   +=  0.5 * xyweight * projected_offset * tie->sigmax2[0];
-				    xs[3*nc2+1] +=  0.5 * xyweight * projected_offset * tie->sigmax2[1];
-				    /*
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc2+2] +=  0.0;
-				    */
-				    }
-				}
-			    else if (file1->status == MBNA_FILE_POORNAV)
-			    	{
-				if (file2->status == MBNA_FILE_GOODNAV)
-				    {
-				    xs[3*nc1]   += -0.995 * xyweight * projected_offset * tie->sigmax2[0];
-				    xs[3*nc1+1] += -0.995 * xyweight * projected_offset * tie->sigmax2[1];
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc1+2] += -0.995 * zweight * projected_offset * tie->sigmax2[2];
-				    xs[3*nc2]   +=  0.005 * xyweight * projected_offset * tie->sigmax2[0];
-				    xs[3*nc2+1] +=  0.005 * xyweight * projected_offset * tie->sigmax2[1];
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc2+2] +=  0.005 * zweight * projected_offset * tie->sigmax2[2];
-				    }
-				else if (file2->status == MBNA_FILE_FIXEDNAV)
-				    {
-				    xs[3*nc1]   += -xyweight * projected_offset * tie->sigmax2[0];
-				    xs[3*nc1+1] += -xyweight * projected_offset * tie->sigmax2[1];
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc1+2] += -zweight * projected_offset * tie->sigmax2[2];
-				    /*
-				    xs[3*nc2]   +=  0.0;
-				    xs[3*nc2+1] +=  0.0;
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc2+2] +=  0.0;
-				    */
-				    }
-				else if (file2->status == MBNA_FILE_FIXEDXYNAV)
-				    {
-				    xs[3*nc1]   += -xyweight * projected_offset * tie->sigmax2[0];
-				    xs[3*nc1+1] += -xyweight * projected_offset * tie->sigmax2[1];
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc1+2] += -0.995 * zweight * projected_offset * tie->sigmax2[2];
-				    /*
-				    xs[3*nc2]   +=  0.0;
-				    xs[3*nc2+1] +=  0.0;
-				    */
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc2+2] +=  0.005 * zweight * projected_offset * tie->sigmax2[2];
-				    }
-				else if (file2->status == MBNA_FILE_FIXEDZNAV)
-				    {
-				    xs[3*nc1]   += -0.995 * xyweight * projected_offset * tie->sigmax2[0];
-				    xs[3*nc1+1] += -0.995 * xyweight * projected_offset * tie->sigmax2[1];
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc1+2] += -zweight * projected_offset * tie->sigmax2[2];
-				    xs[3*nc2]   +=  0.005 * xyweight * projected_offset * tie->sigmax2[0];
-				    xs[3*nc2+1] +=  0.005 * xyweight * projected_offset * tie->sigmax2[1];
-				    /*
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc2+2] +=  0.0;
-				    */
-				    }
-				}
-			    else if (file1->status == MBNA_FILE_FIXEDNAV)
-			    	{
-				if (file2->status == MBNA_FILE_GOODNAV || file2->status == MBNA_FILE_POORNAV)
-				    {
-				    /*
-				    xs[3*nc1]   +=  0.0;
-				    xs[3*nc1+1] +=  0.0;
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc1+2] +=  0.0;
-				    */
-				    xs[3*nc2]   +=  xyweight * projected_offset * tie->sigmax2[0];
-				    xs[3*nc2+1] +=  xyweight * projected_offset * tie->sigmax2[1];
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc2+2] +=  zweight * projected_offset * tie->sigmax2[2];
-				    }
-				else if (file2->status == MBNA_FILE_FIXEDXYNAV)
-				    {
-				    /*
-				    xs[3*nc1]   +=  0.0;
-				    xs[3*nc1+1] +=  0.0;
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc1+2] +=  0.0;
-				    xs[3*nc2]   +=  0.0;
-				    xs[3*nc2+1] +=  0.0;
-				    */
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc2+2] +=  zweight * projected_offset * tie->sigmax2[2];
-				    }
-				else if (file2->status == MBNA_FILE_FIXEDZNAV)
-				    {
-				    /*
-				    xs[3*nc1]   +=  0.0;
-				    xs[3*nc1+1] +=  0.0;
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc1+2] +=  0.0;
-				    */
-				    xs[3*nc2]   +=  xyweight * projected_offset * tie->sigmax2[0];
-				    xs[3*nc2+1] +=  xyweight * projected_offset * tie->sigmax2[1];
-				    /*
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc2+2] +=  0.0;
-				    */
-				    }
-				}
-			    else if (file1->status == MBNA_FILE_FIXEDXYNAV)
-			    	{
-				if (file2->status == MBNA_FILE_GOODNAV)
-				    {
-				    /*
-				    xs[3*nc1]   +=  0.0;
-				    xs[3*nc1+1] +=  0.0;
-				    */
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc1+2] += -0.5 * zweight * projected_offset * tie->sigmax2[2];
-				    xs[3*nc2]   +=  xyweight * projected_offset * tie->sigmax2[0];
-				    xs[3*nc2+1] +=  xyweight * projected_offset * tie->sigmax2[1];
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc2+2] +=  0.5 * zweight * projected_offset * tie->sigmax2[2];
-				    }
-				else if (file2->status == MBNA_FILE_POORNAV)
-				    {
-				    /*
-				    xs[3*nc1]   +=  0.0;
-				    xs[3*nc1+1] +=  0.0;
-				    */
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc1+2] += -0.005 * zweight * projected_offset * tie->sigmax2[2];
-				    xs[3*nc2]   +=  xyweight * projected_offset * tie->sigmax2[0];
-				    xs[3*nc2+1] +=  xyweight * projected_offset * tie->sigmax2[1];
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc2+2] +=  0.995 * zweight * projected_offset * tie->sigmax2[2];
-				    }
-				else if (file2->status == MBNA_FILE_FIXEDNAV)
-				    {
-				    /*
-				    xs[3*nc1]   +=  0.0;
-				    xs[3*nc1+1] +=  0.0;
-				    */
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc1+2] += -zweight * projected_offset * tie->sigmax2[2];
-				    /*
-				    xs[3*nc2]   +=  0.0;
-				    xs[3*nc2+1] +=  0.0;
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc2+2] +=  0.0;
-				    */
-				    }
-				else if (file2->status == MBNA_FILE_FIXEDZNAV)
-				    {
-				    /*
-				    xs[3*nc1]   +=  0.0;
-				    xs[3*nc1+1] +=  0.0;
-				    */
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc1+2] += -zweight * projected_offset * tie->sigmax2[2];
-				    xs[3*nc2]   +=  xyweight * projected_offset * tie->sigmax2[0];
-				    xs[3*nc2+1] +=  xyweight * projected_offset * tie->sigmax2[1];
-				    /*
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc2+2] +=  0.0;
-				    */
-				    }
-				}
-			    else if (file1->status == MBNA_FILE_FIXEDZNAV)
-			    	{
-				if (file2->status == MBNA_FILE_GOODNAV)
-				    {
-				    xs[3*nc1]   += -0.5 * xyweight * projected_offset * tie->sigmax2[0];
-				    xs[3*nc1+1] += -0.5 * xyweight * projected_offset * tie->sigmax2[1];
-				    /*
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc1+2] +=  0.0;
-				    */
-				    xs[3*nc2]   +=  0.5 * xyweight * projected_offset * tie->sigmax2[0];
-				    xs[3*nc2+1] +=  0.5 * xyweight * projected_offset * tie->sigmax2[1];
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc2+2] +=  zweight * projected_offset * tie->sigmax2[2];
-				    }
-				else if (file2->status == MBNA_FILE_POORNAV)
-				    {
-				    xs[3*nc1]   += -0.005 * xyweight * projected_offset * tie->sigmax2[0];
-				    xs[3*nc1+1] += -0.005 * xyweight * projected_offset * tie->sigmax2[1];
-				    /*
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc1+2] +=  0.0;
-				    */
-				    xs[3*nc2]   +=  0.995 * xyweight * projected_offset * tie->sigmax2[0];
-				    xs[3*nc2+1] +=  0.995 * xyweight * projected_offset * tie->sigmax2[1];
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc2+2] +=  zweight * projected_offset * tie->sigmax2[2];
-				    }
-				else if (file2->status == MBNA_FILE_FIXEDNAV)
-				    {
-				    xs[3*nc1]   += -xyweight * projected_offset * tie->sigmax2[0];
-				    xs[3*nc1+1] += -xyweight * projected_offset * tie->sigmax2[1];
-				    /*
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc1+2] +=  0.0;
-				    xs[3*nc2]   +=  0.0;
-				    xs[3*nc2+1] +=  0.0;
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc2+2] +=  0.0;
-				    */
-				    }
-				else if (file2->status == MBNA_FILE_FIXEDXYNAV)
-				    {
-				    xs[3*nc1]   += -xyweight * projected_offset * tie->sigmax2[0];
-				    xs[3*nc1+1] += -xyweight * projected_offset * tie->sigmax2[1];
-				    /*
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc1+2] +=  0.0;
-				    xs[3*nc2]   +=  0.0;
-				    xs[3*nc2+1] +=  0.0;
-				    */
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					xs[3*nc2+2] +=  zweight * projected_offset * tie->sigmax2[2];
-				    }
-				}
-			    xw[3*nc1]   += xyweight;
-			    xw[3*nc1+1] += xyweight;
-			    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-				xw[3*nc1+2] += zweight;
-			    xw[3*nc2]   += xyweight;
-			    xw[3*nc2+1] += xyweight;
-			    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-				xw[3*nc2+2] += zweight;
-/* fprintf(stderr,"horizontal:  nc1:%d xx:%f %f %f  nc2:%d xx:%f %f %f\n",
-nc1,xs[3*nc1],xs[3*nc1+1],xs[3*nc1+2],
-nc2,xs[3*nc2],xs[3*nc2+1],xs[3*nc2+2]);*/
-
-			    /* deal with semi-vertical axis */
-			    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-				projected_offset = offsetx * tie->sigmax3[0]
-						+ offsety * tie->sigmax3[1]
-						+ offsetz * tie->sigmax3[2];
-			    else
-				projected_offset = offsetz * tie->sigmax3[2];
-			    if (fabs(tie->sigmar3) > 0.0)
-			    	{
-				xyweight = sqrt(mbna_offsetweight / tie->sigmar3);
-			    	zweight = sqrt(mbna_zweightfactor * mbna_offsetweight / tie->sigmar3);
-				}
-			    else
-			    	{
-				xyweight = 0.0;
-			    	zweight = 0.0;
-				}
-//xyweight = 0.0;
-//zweight = 1.0;
-
-			    /* deal with fixed, good, or poor status of sections */
-			    if (file1->status == file2->status)
-			    	{
-				if (file1->status == MBNA_FILE_GOODNAV || file1->status == MBNA_FILE_POORNAV)
-				    {
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					{
-					xs[3*nc1]   += -0.5 * xyweight * projected_offset * tie->sigmax3[0];
-					xs[3*nc1+1] += -0.5 * xyweight * projected_offset * tie->sigmax3[1];
-					}
-				    xs[3*nc1+2] += -0.5 * zweight * projected_offset * tie->sigmax3[2];
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					{
-					xs[3*nc2]   +=  0.5 * xyweight * projected_offset * tie->sigmax3[0];
-				        xs[3*nc2+1] +=  0.5 * xyweight * projected_offset * tie->sigmax3[1];
-					}
-				    xs[3*nc2+2] +=  0.5 * zweight * projected_offset * tie->sigmax3[2];
-				    }
-				else if (file1->status == MBNA_FILE_FIXEDXYNAV)
-				    {
-				    /*
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					{
-				        xs[3*nc1]   +=  0.0;
-				        xs[3*nc1+1] +=  0.0;
-				        }
-				    */
-				    xs[3*nc1+2] += -0.5 * zweight * projected_offset * tie->sigmax3[2];
-				    /*
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					{
-				        xs[3*nc2]   +=  0.0;
-				        xs[3*nc2+1] +=  0.0;
-				        }
-				    */
-				    xs[3*nc2+2] +=  0.5 * zweight * projected_offset * tie->sigmax3[2];
-				    }
-				else if (file1->status == MBNA_FILE_FIXEDZNAV)
-				    {
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					{
-					xs[3*nc1]   += -0.5 * xyweight * projected_offset * tie->sigmax3[0];
-					xs[3*nc1+1] += -0.5 * xyweight * projected_offset * tie->sigmax3[1];
-					}
-				    /*
-				    xs[3*nc1+2] +=  0.0;
-				    */
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					{
-					xs[3*nc2]   +=  0.5 * xyweight * projected_offset * tie->sigmax3[0];
-				        xs[3*nc2+1] +=  0.5 * xyweight * projected_offset * tie->sigmax3[1];
-					}
-				    /*
-				    xs[3*nc2+2] +=  0.0;
-				    */
-				    }
-				}
-			    else if (file1->status == MBNA_FILE_GOODNAV)
-			    	{
-				if (file2->status == MBNA_FILE_POORNAV)
-				    {
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					{
-					xs[3*nc1]   += -0.5 * xyweight * projected_offset * tie->sigmax3[0];
-					xs[3*nc1+1] += -0.5 * xyweight * projected_offset * tie->sigmax3[1];
-					}
-				    xs[3*nc1+2] += -0.005 * zweight * projected_offset * tie->sigmax3[2];
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					{
-					xs[3*nc2]   +=  0.5 * xyweight * projected_offset * tie->sigmax3[0];
-				        xs[3*nc2+1] +=  0.5 * xyweight * projected_offset * tie->sigmax3[1];
-					}
-				    xs[3*nc2+2] +=  0.995 * zweight * projected_offset * tie->sigmax3[2];
-				    }
-				else if (file2->status == MBNA_FILE_FIXEDNAV)
-				    {
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					{
-					xs[3*nc1]   += -0.5 * xyweight * projected_offset * tie->sigmax3[0];
-					xs[3*nc1+1] += -0.5 * xyweight * projected_offset * tie->sigmax3[1];
-					}
-				    xs[3*nc1+2] += -zweight * projected_offset * tie->sigmax3[2];
-				    /*
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					{
-				        xs[3*nc2]   +=  0.0;
-				        xs[3*nc2+1] +=  0.0;
-				        }
-				    xs[3*nc2+2] +=  0.0;
-				    */
-				    }
-				else if (file2->status == MBNA_FILE_FIXEDXYNAV)
-				    {
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					{
-					xs[3*nc1]   += -0.5 * xyweight * projected_offset * tie->sigmax3[0];
-					xs[3*nc1+1] += -0.5 * xyweight * projected_offset * tie->sigmax3[1];
-					}
-				    xs[3*nc1+2] += -0.5 * zweight * projected_offset * tie->sigmax3[2];
-				    /*
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					{
-				        xs[3*nc2]   +=  0.0;
-				        xs[3*nc2+1] +=  0.0;
-				        }
-				    */
-				    xs[3*nc2+2] +=  0.5 * zweight * projected_offset * tie->sigmax3[2];
-				    }
-				else if (file2->status == MBNA_FILE_FIXEDZNAV)
-				    {
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					{
-					xs[3*nc1]   += -0.5 * xyweight * projected_offset * tie->sigmax3[0];
-					xs[3*nc1+1] += -0.5 * xyweight * projected_offset * tie->sigmax3[1];
-					}
-				    xs[3*nc1+2] += -zweight * projected_offset * tie->sigmax3[2];
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					{
-					xs[3*nc2]   +=  0.5 * xyweight * projected_offset * tie->sigmax3[0];
-				        xs[3*nc2+1] +=  0.5 * xyweight * projected_offset * tie->sigmax3[1];
-					}
-				    /*
-				    xs[3*nc2+2] +=  0.0;
-				    */
-				    }
-				}
-			    else if (file1->status == MBNA_FILE_POORNAV)
-			    	{
-				if (file2->status == MBNA_FILE_GOODNAV)
-				    {
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					{
-					xs[3*nc1]   += -0.5 * xyweight * projected_offset * tie->sigmax3[0];
-					xs[3*nc1+1] += -0.5 * xyweight * projected_offset * tie->sigmax3[1];
-					}
-				    xs[3*nc1+2] += -0.995 * zweight * projected_offset * tie->sigmax3[2];
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					{
-					xs[3*nc2]   +=  0.5 * xyweight * projected_offset * tie->sigmax3[0];
-				        xs[3*nc2+1] +=  0.5 * xyweight * projected_offset * tie->sigmax3[1];
-					}
-				    xs[3*nc2+2] +=  0.005 * zweight * projected_offset * tie->sigmax3[2];
-				    }
-				else if (file2->status == MBNA_FILE_FIXEDNAV)
-				    {
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					{
-					xs[3*nc1]   += -0.5 * xyweight * projected_offset * tie->sigmax3[0];
-					xs[3*nc1+1] += -0.5 * xyweight * projected_offset * tie->sigmax3[1];
-					}
-				    xs[3*nc1+2] += -zweight * projected_offset * tie->sigmax3[2];
-				    /*
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					{
-				        xs[3*nc2]   +=  0.0;
-				        xs[3*nc2+1] +=  0.0;
-				        }
-				    xs[3*nc2+2] +=  0.0;
-				    */
-				    }
-				else if (file2->status == MBNA_FILE_FIXEDXYNAV)
-				    {
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					{
-					xs[3*nc1]   += -0.5 * xyweight * projected_offset * tie->sigmax3[0];
-					xs[3*nc1+1] += -0.5 * xyweight * projected_offset * tie->sigmax3[1];
-					}
-				    xs[3*nc1+2] += -0.995 * zweight * projected_offset * tie->sigmax3[2];
-				    /*
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					{
-				        xs[3*nc2]   +=  0.0;
-				        xs[3*nc2+1] +=  0.0;
-				        }
-				    */
-				    xs[3*nc2+2] +=  0.005 * zweight * projected_offset * tie->sigmax3[2];
-				    }
-				else if (file2->status == MBNA_FILE_FIXEDZNAV)
-				    {
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					{
-					xs[3*nc1]   += -0.5 * xyweight * projected_offset * tie->sigmax3[0];
-					xs[3*nc1+1] += -0.5 * xyweight * projected_offset * tie->sigmax3[1];
-					}
-				    xs[3*nc1+2] += -zweight * projected_offset * tie->sigmax3[2];
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					{
-					xs[3*nc2]   +=  0.5 * xyweight * projected_offset * tie->sigmax3[0];
-				        xs[3*nc2+1] +=  0.5 * xyweight * projected_offset * tie->sigmax3[1];
-					}
-				    /*
-				    xs[3*nc2+2] +=  0.0;
-				    */
-				    }
-				}
-			    else if (file1->status == MBNA_FILE_FIXEDNAV)
-			    	{
-				if (file2->status == MBNA_FILE_GOODNAV || file2->status == MBNA_FILE_POORNAV)
-				    {
-				    /*
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					{
-				        xs[3*nc1]   +=  0.0;
-				        xs[3*nc1+1] +=  0.0;
-				        }
-				    xs[3*nc1+2] +=  0.0;
-				    */
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					{
-					xs[3*nc2]   +=  0.5 * xyweight * projected_offset * tie->sigmax3[0];
-				        xs[3*nc2+1] +=  0.5 * xyweight * projected_offset * tie->sigmax3[1];
-					}
-				    xs[3*nc2+2] +=  zweight * projected_offset * tie->sigmax3[2];
-				    }
-				else if (file2->status == MBNA_FILE_FIXEDXYNAV)
-				    {
-				    /*
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					{
-				        xs[3*nc1]   +=  0.0;
-				        xs[3*nc1+1] +=  0.0;
-				        }
-				    xs[3*nc1+2] +=  0.0;
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					{
-				        xs[3*nc2]   +=  0.0;
-				        xs[3*nc2+1] +=  0.0;
-				        }
-				    */
-				    xs[3*nc2+2] +=  zweight * projected_offset * tie->sigmax3[2];
-				    }
-				else if (file2->status == MBNA_FILE_FIXEDZNAV)
-				    {
-				    /*
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					{
-				        xs[3*nc1]   +=  0.0;
-				        xs[3*nc1+1] +=  0.0;
-				        }
-				    xs[3*nc1+2] +=  0.0;
-				    */
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					{
-					xs[3*nc2]   +=  0.5 * xyweight * projected_offset * tie->sigmax3[0];
-				        xs[3*nc2+1] +=  0.5 * xyweight * projected_offset * tie->sigmax3[1];
-					}
-				    /*
-				    xs[3*nc2+2] +=  0.0;
-				    */
-				    }
-				}
-			    else if (file1->status == MBNA_FILE_FIXEDXYNAV)
-			    	{
-				if (file2->status == MBNA_FILE_GOODNAV)
-				    {
-				    /*
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					{
-				        xs[3*nc1]   +=  0.0;
-				        xs[3*nc1+1] +=  0.0;
-				        }
-				    */
-				    xs[3*nc1+2] += -0.5 * zweight * projected_offset * tie->sigmax3[2];
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					{
-					xs[3*nc2]   +=  0.5 * xyweight * projected_offset * tie->sigmax3[0];
-				        xs[3*nc2+1] +=  0.5 * xyweight * projected_offset * tie->sigmax3[1];
-					}
-				    xs[3*nc2+2] +=  0.5 * zweight * projected_offset * tie->sigmax3[2];
-				    }
-				else if (file2->status == MBNA_FILE_POORNAV)
-				    {
-				    /*
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					{
-				        xs[3*nc1]   +=  0.0;
-				        xs[3*nc1+1] +=  0.0;
-				        }
-				    */
-				    xs[3*nc1+2] += -0.005 * zweight * projected_offset * tie->sigmax3[2];
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					{
-					xs[3*nc2]   +=  0.5 * xyweight * projected_offset * tie->sigmax3[0];
-				        xs[3*nc2+1] +=  0.5 * xyweight * projected_offset * tie->sigmax3[1];
-					}
-				    xs[3*nc2+2] +=  0.995 * zweight * projected_offset * tie->sigmax3[2];
-				    }
-				else if (file2->status == MBNA_FILE_FIXEDNAV)
-				    {
-				    /*
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					{
-				        xs[3*nc1]   +=  0.0;
-				        xs[3*nc1+1] +=  0.0;
-				        }
-				    */
-				    xs[3*nc1+2] += -zweight * projected_offset * tie->sigmax3[2];
-				    /*
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					{
-				        xs[3*nc2]   +=  0.0;
-				        xs[3*nc2+1] +=  0.0;
-				        }
-				    xs[3*nc2+2] +=  0.0;
-				    */
-				    }
-				else if (file2->status == MBNA_FILE_FIXEDZNAV)
-				    {
-				    /*
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					{
-				        xs[3*nc1]   +=  0.0;
-				        xs[3*nc1+1] +=  0.0;
-				        }
-				    */
-				    xs[3*nc1+2] += -zweight * projected_offset * tie->sigmax3[2];
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					{
-					xs[3*nc2]   +=  0.5 * xyweight * projected_offset * tie->sigmax3[0];
-				        xs[3*nc2+1] +=  0.5 * xyweight * projected_offset * tie->sigmax3[1];
-					}
-				    /*
-				    xs[3*nc2+2] +=  0.0;
-				    */
-				    }
-				}
-			    else if (file1->status == MBNA_FILE_FIXEDZNAV)
-			    	{
-				if (file2->status == MBNA_FILE_GOODNAV)
-				    {
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					{
-					xs[3*nc1]   += -0.5 * xyweight * projected_offset * tie->sigmax3[0];
-					xs[3*nc1+1] += -0.5 * xyweight * projected_offset * tie->sigmax3[1];
-					}
-				    /*
-				    xs[3*nc1+2] +=  0.0;
-				    */
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					{
-					xs[3*nc2]   +=  0.5 * xyweight * projected_offset * tie->sigmax3[0];
-				        xs[3*nc2+1] +=  0.5 * xyweight * projected_offset * tie->sigmax3[1];
-					}
-				    xs[3*nc2+2] +=  zweight * projected_offset * tie->sigmax3[2];
-				    }
-				else if (file2->status == MBNA_FILE_POORNAV)
-				    {
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					{
-					xs[3*nc1]   += -0.5 * xyweight * projected_offset * tie->sigmax3[0];
-					xs[3*nc1+1] += -0.5 * xyweight * projected_offset * tie->sigmax3[1];
-					}
-				    /*
-				    xs[3*nc1+2] +=  0.0;
-				    */
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					{
-					xs[3*nc2]   +=  0.5 * xyweight * projected_offset * tie->sigmax3[0];
-				        xs[3*nc2+1] +=  0.5 * xyweight * projected_offset * tie->sigmax3[1];
-					}
-				    xs[3*nc2+2] +=  zweight * projected_offset * tie->sigmax3[2];
-				    }
-				else if (file2->status == MBNA_FILE_FIXEDNAV)
-				    {
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					{
-					xs[3*nc1]   += -0.5 * xyweight * projected_offset * tie->sigmax3[0];
-					xs[3*nc1+1] += -0.5 * xyweight * projected_offset * tie->sigmax3[1];
-					}
-				    /*
-				    xs[3*nc1+2] +=  0.0;
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					{
-				        xs[3*nc2]   +=  0.0;
-				        xs[3*nc2+1] +=  0.0;
-				        }
-				    xs[3*nc2+2] +=  0.0;
-				    */
-				    }
-				else if (file2->status == MBNA_FILE_FIXEDXYNAV)
-				    {
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					{
-					xs[3*nc1]   += -0.5 * xyweight * projected_offset * tie->sigmax3[0];
-					xs[3*nc1+1] += -0.5 * xyweight * projected_offset * tie->sigmax3[1];
-					}
-				    /*
-				    xs[3*nc1+2] +=  0.0;
-				    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-					{
-				        xs[3*nc2]   +=  0.0;
-				        xs[3*nc2+1] +=  0.0;
-				        }
-				    */
-				    xs[3*nc2+2] +=  zweight * projected_offset * tie->sigmax3[2];
-				    }
-				}
-			    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-				{
-				xw[3*nc1]   += xyweight;
-				xw[3*nc1+1] += xyweight;
-				}
-			    xw[3*nc1+2] += zweight;
-			    if (mbna_invert_mode == MBNA_INVERT_ZFULL)
-				{
-				xw[3*nc2]   += xyweight;
-				xw[3*nc2+1] += xyweight;
-				}
-			    xw[3*nc2+2] += zweight;
-/* fprintf(stderr,"semi-vertical:  nc1:%d xx:%f %f %f  nc2:%d xx:%f %f %f\n",
-nc1,xs[3*nc1],xs[3*nc1+1],xs[3*nc1+2],
-nc2,xs[3*nc2],xs[3*nc2+1],xs[3*nc2+2]);*/
-
-			    }
-			}
-
-		    /* loop over all global ties applying offsets to the affected points */
-		    for (ifile=0;ifile<project.num_files;ifile++)
-			{
-			file = &project.files[ifile];
-
-			for (isection=0;isection<file->num_sections;isection++)
-			    {
-			    /* use only set global ties */
-			    section = &file->sections[isection];
-			    if (section->global_tie_status != MBNA_TIE_NONE)
-				{
-				/* get absolute id for first snav point */
-				nc1 = section->snav_invert_id[section->global_tie_snav];
-				
-				/* get current offset vector including reduction of block solution */
-				offsetx = 0.0;
-				offsety = 0.0;
-				offsetz = 0.0;
-				if (section->global_tie_status != MBNA_TIE_Z)
-				    {
-				    offsetx = section->global_tie_offset_x_m - xa[3*nc1] - x[3*nc1];
-				    offsety = section->global_tie_offset_y_m - xa[3*nc1+1] - x[3*nc1+1];
-				    }
-				if (section->global_tie_status != MBNA_TIE_XY)
-				    {
-				    offsetz = section->global_tie_offset_z_m - xa[3*nc1+2] - x[3*nc1+2];
-				    }
-				offsetr = sqrt(offsetx * offsetx + offsety * offsety + offsetz * offsetz);
-				
-				/* global ties have a simple error ellipse oriented on the axes */
-				
-				if (section->global_tie_status != MBNA_TIE_Z)
-				    {
-				    /* deal with x-axis */
-				    projected_offset = offsetx;
-				    if (fabs(section->global_tie_xsigma) > 0.0)
-					xyweight = sqrt(mbna_offsetweight / section->global_tie_xsigma);
-				    else
-					xyweight = 0.0;
-//fprintf(stderr,"GLOBAL X: xyweight:%f mbna_offsetweight:%f xsigma:%f\n",xyweight,mbna_offsetweight,section->global_tie_xsigma);
-				    xs[3*nc1]   += xyweight * projected_offset;
-				    xw[3*nc1]   += xyweight;
-					
-				    /* deal with y-axis */
-				    projected_offset = offsety;
-				    if (fabs(section->global_tie_ysigma) > 0.0)
-					xyweight = sqrt(mbna_offsetweight / section->global_tie_ysigma);
-				    else
-					xyweight = 0.0;
-//fprintf(stderr,"GLOBAL Y: xyweight:%f mbna_offsetweight:%f zsigma:%f\n",xyweight,mbna_offsetweight,section->global_tie_ysigma);
-				    xs[3*nc1+1] += xyweight * projected_offset;
-				    xw[3*nc1+1] += xyweight;
-				    }
-				    
-				if (section->global_tie_status != MBNA_TIE_XY)
-				    {
-				    /* deal with z-axis */
-				    projected_offset = offsetz;
-				    if (fabs(section->global_tie_zsigma) > 0.0)
-					zweight = sqrt(mbna_zweightfactor * mbna_offsetweight / section->global_tie_zsigma);
-				    else
-					zweight = 0.0;
-//fprintf(stderr,"GLOBAL Z: zweight:%f mbna_offsetweight:%f sigma:%f\n",zweight,mbna_offsetweight,section->global_tie_zsigma);
-				    xs[3*nc1+2] += zweight * projected_offset;
-				    xw[3*nc1+2] += zweight;
-				    }
-/* fprintf(stderr,"STAGE 3 GLOBAL TIE: %2d:%2d:%2d  status:%d  nc1:%d  tie: ",ifile,isection,section->global_tie_snav,section->global_tie_status,nc1);
-if (section->global_tie_status != MBNA_TIE_Z) fprintf(stderr,"x:%f y:%f ",section->global_tie_offset_x_m,section->global_tie_offset_y_m);
-if (section->global_tie_status != MBNA_TIE_XY) fprintf(stderr,"z:%f ",section->global_tie_offset_z_m);
-fprintf(stderr," xa: ");
-if (section->global_tie_status != MBNA_TIE_Z) fprintf(stderr,"x:%f y:%f ",xa[3*nc1],xa[3*nc1+1]);
-if (section->global_tie_status != MBNA_TIE_XY) fprintf(stderr,"z:%f ",xa[3*nc1+2]);
-fprintf(stderr," x: ");
-if (section->global_tie_status != MBNA_TIE_Z) fprintf(stderr,"x:%f y:%f ",x[3*nc1],x[3*nc1+1]);
-if (section->global_tie_status != MBNA_TIE_XY) fprintf(stderr,"z:%f ",x[3*nc1+2]);
-fprintf(stderr," xx: ");
-if (section->global_tie_status != MBNA_TIE_Z) fprintf(stderr,"x:%f y:%f ",xs[3*nc1],xs[3*nc1+1]);
-if (section->global_tie_status != MBNA_TIE_XY) fprintf(stderr,"z:%f ",xs[3*nc1+2]);
-fprintf(stderr," (off-xa-x-xx): ");
-if (section->global_tie_status != MBNA_TIE_Z) fprintf(stderr,"x:%f y:%f ",offsetx,offsety);
-if (section->global_tie_status != MBNA_TIE_XY) fprintf(stderr,"z:%f ",offsetz);
-fprintf(stderr,"\n");*/
-				}
-			    }
-			}
-
-
-		    /* now loop over all points applying smoothing to the xx[] vector */
-		    nseq = 0;
-		    ndx = 0;
-		    ndx2 = 0;
-		    for (ifile=0;ifile<project.num_files;ifile++)
-			{
-			file = &project.files[ifile];
-			if (file->status != MBNA_FILE_FIXEDNAV)
-			for (isection=0;isection<file->num_sections;isection++)
-			    {
-			    section = &file->sections[isection];
-			    if (section->continuity == MB_NO)
-			    	nseq = 0;
-			    for (isnav=0;isnav<section->num_snav;isnav++)
-				{
-				/* work only with points that are tied */
-				if (section->snav_num_ties[isnav] > 0
-				    || (section->global_tie_status != MBNA_TIE_NONE && section->global_tie_snav == isnav))
-				    {
-				    /* get ids for tied nav points */
-				    if (nseq > 1)
-				    	{
-					nc1 = nc2;
-					time_d1 = time_d2;
-					}
-				    if (nseq > 0)
-				    	{
-					nc2 = nc3;
-					time_d2 = time_d3;
-					}
-				    nc3 = section->snav_invert_id[isnav];
-				    time_d3 = section->snav_time_d[isnav];
-
-				    /* add first derivative constraint if nseq > 1 AND dtime_d > 0.0 */
-				    dtime_d = time_d3 - time_d2;
-				    if (nseq > 0 && dtime_d > 0.0)
-					{
-			    		/* get current offset vector */
-					offsetx = (x[3*nc3]   - x[3*nc2]);
-					offsety = (x[3*nc3+1] - x[3*nc2+1]);
-					offsetz = (x[3*nc3+2] - x[3*nc2+2]);
-
-					/* add remaining offsets to both points */
-					xyweight = mbna_smoothweight / dtime_d;
-					zweight = mbna_smoothweight / dtime_d;
-					xs[3*nc2]   +=  0.5 * xyweight * offsetx;
-					xs[3*nc2+1] +=  0.5 * xyweight * offsety;
-					xs[3*nc2+2] +=  0.5 * zweight * offsetz;
-					xs[3*nc3]   += -0.5 * xyweight * offsetx;
-					xs[3*nc3+1] += -0.5 * xyweight * offsety;
-					xs[3*nc3+2] += -0.5 * zweight * offsetz;
-					xw[3*nc2]   += xyweight;
-					xw[3*nc2+1] += xyweight;
-					xw[3*nc2+2] += zweight;
-					xw[3*nc3]   += xyweight;
-					xw[3*nc3+1] += xyweight;
-					xw[3*nc3+2] += zweight;
-
-					ndx++;
-					}
-
-				    /* add second derivative constraint if nseq > 2  AND dtime_d > 0.0 */
-				    dtime_d = time_d3 - time_d1;
-				    if (nseq > 1 && dtime_d > 0.0)
-					{
-			    		/* get current offset vector */
-					offsetx = x[3*nc1]   - 2.0 * x[3*nc2]   + x[3*nc3];
-					offsety = x[3*nc1+1] - 2.0 * x[3*nc2+1] + x[3*nc3+1];
-					offsetz = x[3*nc1+2] - 2.0 * x[3*nc2+2] + x[3*nc3+2];
-
-					/* add remaining offsets to both points, or just one if one is fixed (weight 2nd derivative 1/4th of first derivative)*/
-					xyweight = mbna_smoothweight / dtime_d / dtime_d;
-					zweight = mbna_smoothweight / dtime_d / dtime_d;
-					xs[3*nc1]   += -xyweight * offsetx;
-					xs[3*nc1+1] += -xyweight * offsety;
-					xs[3*nc1+2] += -zweight * offsetz;
-					xs[3*nc2]   +=  2.0 * xyweight * offsetx;
-					xs[3*nc2+1] +=  2.0 * xyweight * offsety;
-					xs[3*nc2+2] +=  2.0 * zweight * offsetz;
-					xs[3*nc3]   += -xyweight * offsetx;
-					xs[3*nc3+1] += -xyweight * offsety;
-					xs[3*nc3+2] += -zweight * offsetz;
-					xw[3*nc1]   += xyweight;
-					xw[3*nc1+1] += xyweight;
-					xw[3*nc1+2] += zweight;
-					xw[3*nc2]   += xyweight;
-					xw[3*nc2+1] += xyweight;
-					xw[3*nc2+2] += zweight;
-					xw[3*nc3]   += xyweight;
-					xw[3*nc3+1] += xyweight;
-					xw[3*nc3+2] += zweight;
-
-					ndx2++;
-					}
-
-				    /* increment sequence counter */
-				    nseq++;
-				    }
-				}
-			    }
-			}
-
-		    /* calculate perturbation and 2-norm of perturbation */
-		    perturbationsize = 0.0;
-		    for (i=0;i<ncols;i++)
-			{
-			if (xw[i] > 0.0)
-				xx[i] = xs[i] / xw[i];
-			else
-				xx[i] = 0.0;
-			perturbationsize += xx[i] * xx[i];
-			}
-		    perturbationsize = sqrt(perturbationsize) / ncols;
-
-		    /* apply perturbation */
-		    for (i=0;i<ncols;i++)
-			{
-/* fprintf(stderr,"i:%d x:%f xx:%f ",i,x[i],xx[i]);*/
-			x[i] += xx[i];
-			xx[i] = 0.0;
-/* fprintf(stderr,"x:%f\n",x[i]);*/
-			}
-
-		    /* calculate misfit */
-		    misfit_ties = 0.0;
-		    misfit_norm = 0.0;
-		    nmisfit = 0;
-		    for (icrossing=0;icrossing<project.num_crossings;icrossing++)
-			{
-			crossing = &project.crossings[icrossing];
-
-			/* use only set crossings */
-			if (crossing->status == MBNA_CROSSING_STATUS_SET)
-			for (j=0;j<crossing->num_ties;j++)
-			    {
-			    /* get tie */
-			    tie = (struct mbna_tie *) &crossing->ties[j];
-
-			    /* get absolute id for first snav point */
-			    file1 = &project.files[crossing->file_id_1];
-			    section1 = &file1->sections[crossing->section_1];
-			    nc1 = section1->snav_invert_id[tie->snav_1];
-
-			    /* get absolute id for second snav point */
-			    file2 = &project.files[crossing->file_id_2];
-			    section2 = &file2->sections[crossing->section_2];
-			    nc2 = section2->snav_invert_id[tie->snav_2];
-if (nc1 > nsnav - 1 || nc2 > nsnav -1
-|| nc1 < 0 || nc2 < 0)
-fprintf(stderr, "BAD TIE snav ID: %d %d %d\n", nc1, nc2, nsnav);
-
-			    /* get observed offset vector including removal of block solution */
-			    offsetx = (x[3*nc2] + xa[3*nc2] - x[3*nc1] - xa[3*nc1]) - tie->offset_x_m;
-			    offsety = (x[3*nc2+1] + xa[3*nc2+1] - x[3*nc1+1] - xa[3*nc1+1]) - tie->offset_y_m;
-			    offsetz = (x[3*nc2+2] + xa[3*nc2+2] - x[3*nc1+2] - xa[3*nc1+2]) - tie->offset_z_m;
-
-			    if (tie->status != MBNA_TIE_Z)
-				{
-				/* get long axis misfit */
-				misfit = (offsetx * tie->sigmax1[0]
-						+ offsety * tie->sigmax1[1]
-						+ offsetz * tie->sigmax1[2]);
-				misfit_ties += misfit * misfit;
-				misfit_norm += misfit * misfit / tie->sigmar1 / tie->sigmar1;
-				nmisfit++;
-    
-				/* get horizontal axis misfit */
-				misfit = (offsetx * tie->sigmax2[0]
-						+ offsety * tie->sigmax2[1]
-						+ offsetz * tie->sigmax2[2]);
-				misfit_ties += misfit * misfit;
-				misfit_norm += misfit * misfit / tie->sigmar2 / tie->sigmar2;
-				nmisfit++;
-				}
-
-			    if (tie->status != MBNA_TIE_XY)
-				{
-				/* get semi-vertical axis misfit */
-				misfit = (offsetx * tie->sigmax3[0]
-						+ offsety * tie->sigmax3[1]
-						+ offsetz * tie->sigmax3[2]);
-				misfit_ties += misfit * misfit;
-				misfit_norm += misfit * misfit / tie->sigmar3 / tie->sigmar3;
-				nmisfit++;
-				}
-			    }
-			}
-		    for (ifile=0;ifile<project.num_files;ifile++)
-			{
-			/* get file */
-			file = &project.files[ifile];
-			for (isection=0;isection<file->num_sections;isection++)
-			    {
-			    /* get section */
-			    section = &file->sections[isection];
-			    if (section->global_tie_status != MBNA_TIE_NONE)
-				{
-				/* get absolute id for snav point */
-				nc1 = section->snav_invert_id[section->global_tie_snav];
-if (nc1 > nsnav - 1 || nc1 < 0)
-fprintf(stderr, "BAD GLOBAL TIE snav ID: %d %d\n", nc1, nsnav);
-
-				/* get observed offset vector including removal of block solution */
-				offsetx = (x[3*nc1] + xa[3*nc1]) - section->global_tie_offset_x_m;
-				offsety = (x[3*nc1+1] + xa[3*nc1+1]) - section->global_tie_offset_y_m;
-				offsetz = (x[3*nc1+2] + xa[3*nc1+2]) - section->global_tie_offset_z_m;
-		
-				if (section->global_tie_status != MBNA_TIE_Z)
-				    {
-				    /* get x axis misfit */
-				    misfit = offsetx;
-				    misfit_ties += misfit * misfit;
-				    misfit_norm += misfit * misfit / section->global_tie_xsigma / section->global_tie_xsigma;
-				    nmisfit++;
-    
-				    /* get y axis misfit */
-				    misfit = offsety;
-				    misfit_ties += misfit * misfit;
-				    misfit_norm += misfit * misfit / section->global_tie_ysigma / section->global_tie_ysigma;
-				    nmisfit++;
-				    }
-    
-				if (section->global_tie_status != MBNA_TIE_XY)
-				    {
-				    /* get z axis misfit */
-				    misfit = offsetz;
-				    misfit_ties += misfit * misfit;
-				    misfit_norm += misfit * misfit / section->global_tie_zsigma / section->global_tie_zsigma;
-				    nmisfit++;
-				    }
-				}
-			    }
-			}
-		    misfit_ties = sqrt(misfit_ties) / nmisfit;
-		    misfit_norm = sqrt(misfit_norm) / nmisfit;
-
-		    /* check for convergence */
-		    perturbationchange = perturbationsize - perturbationsizeold;
-		    convergencecriterea = fabs(perturbationchange) / misfit_ties_initial;
-		    if (convergencecriterea < MBNA_CONVERGENCE || convergencecriterea > 10000.0 || iter > MBNA_INTERATION_MAX)
-		    	done = MB_YES;
-
-fprintf(stderr,"MODEL INVERT: iter:%d nmisfit:%d misfit_initial:%f misfit_ties_initial:%f misfit_ties:%f misfit_norm_initial:%f misfit_norm:%f perturbationsize:%g perturbationchange:%g convergencecriterea:%g done:%d\n",
-iter,nmisfit,misfit_initial,misfit_ties_initial,misfit_ties,misfit_norm_initial,misfit_norm,perturbationsize,perturbationchange,convergencecriterea,done);
-
-		    if (done == MB_NO)
-		        {
-			perturbationsizeold = perturbationsize;
-		        iter++;
-		    	}
-
-		    /* save solution */
-		    k = 0;
-		    for (i=0;i<project.num_files;i++)
-			{
-			file = &project.files[i];
-			for (j=0;j<file->num_sections;j++)
-			    {
-			    section = &file->sections[j];
-			    for (isnav=0;isnav<section->num_snav;isnav++)
-				{
-				if (section->snav_num_ties[isnav] > 0
-				    || section->global_tie_snav == isnav)
-				    {
-				    k = section->snav_invert_id[isnav];
-				    section->snav_lon_offset[isnav] = (x[3*k] + xa[3*k]) * mbna_mtodeglon;
-/* fprintf(stderr,"isnav:%d k:%d x[3*k]:%f xa[3*k]:%f mbna_mtodeglon:%f section->snav_lon_offset[isnav]:%f\n",
-isnav,k,x[3*k],xa[3*k],mbna_mtodeglon,section->snav_lon_offset[isnav]);*/
-				    section->snav_lat_offset[isnav] = (x[3*k+1] + xa[3*k+1]) * mbna_mtodeglat;
-/* fprintf(stderr,"isnav:%d k:%d x[3*k+1]:%f xa[3*k+1]:%f mbna_mtodeglat:%f section->snav_lat_offset[isnav]:%f\n",
-isnav,k,x[3*k+1],xa[3*k+1],mbna_mtodeglat,section->snav_lat_offset[isnav]);*/
-				    section->snav_z_offset[isnav] = (x[3*k+2] + xa[3*k+2]);
-/* fprintf(stderr,"isnav:%d k:%d x[3*k+2]:%f xa[3*k+2]:%f section->snav_lat_offset[isnav]:%f\n\n",
-isnav,k,x[3*k+2],xa[3*k+2],section->snav_lat_offset[isnav]); */
-				    }
-				}
-			    }
-			}
-
-		    /* interpolate the solution */
-		    mbnavadjust_interpolatesolution();
-
-		    /* save interpolated solution */
-		    k = 0;
-		    for (i=0;i<project.num_files;i++)
-			{
-			file = &project.files[i];
-			for (j=0;j<file->num_sections;j++)
-			    {
-			    section = &file->sections[j];
-			    for (isnav=0;isnav<section->num_snav;isnav++)
-				{
-				section->snav_lon_offset[isnav] = section->snav_lon_offset_int[isnav];
-				section->snav_lat_offset[isnav] = section->snav_lat_offset_int[isnav];
-				section->snav_z_offset[isnav] = section->snav_z_offset_int[isnav];
-				}
-			    }
-			}
-
-		    /* set message dialog on */
-		    if (iter % 100 == 0)
-		    	{
-		    	sprintf(message,"Completed inversion iteration %d Convergence:%.2f", iter, convergencecriterea / MBNA_CONVERGENCE);
-		    	do_message_update(message);
-		    	}
-
-
-		    /* update model plot */
-		    if (project.modelplot == MB_YES && iter % 25 == 0)
-		    	mbnavadjust_modelplot_plot();
-		    }
-		}
-
-	/* output results from navigation solution */
-    	if (project.open == MB_YES
-    		&& project.num_crossings > 0
-		&& (project.num_crossings_analyzed >= 10
-			|| project.num_truecrossings_analyzed == project.num_truecrossings)
-		&& ok_to_invert == MB_YES
-		&& error == MB_ERROR_NO_ERROR)
-    		{
-		/* now output inverse solution */
-		sprintf(message,"Outputting navigation solution...");
-		do_message_update(message);
-
-		sprintf(message, " > Final misfit:%12g\n > Initial misfit:%12g\n",
-			misfit_ties, misfit_initial);
-		do_info_add(message, MB_NO);
-
-		/* get crossing offset results */
-		sprintf(message, " > Nav Tie Offsets (m):  id  observed  solution  error\n");
-		do_info_add(message, MB_NO);
-		for (icrossing=0;icrossing<project.num_crossings;icrossing++)
-		    {
-		    crossing = &project.crossings[icrossing];
-
-		    /* check only set ties */
-		    if (crossing->status == MBNA_CROSSING_STATUS_SET)
-		    for (j=0;j<crossing->num_ties;j++)
-			{
-			tie = (struct mbna_tie *) &crossing->ties[j];
-			offset_x =  project.files[crossing->file_id_2].sections[crossing->section_2].snav_lon_offset[tie->snav_2]
-				- project.files[crossing->file_id_1].sections[crossing->section_1].snav_lon_offset[tie->snav_1];
-			offset_y =  project.files[crossing->file_id_2].sections[crossing->section_2].snav_lat_offset[tie->snav_2]
-				- project.files[crossing->file_id_1].sections[crossing->section_1].snav_lat_offset[tie->snav_1];
-			offset_z =  project.files[crossing->file_id_2].sections[crossing->section_2].snav_z_offset[tie->snav_2]
-				- project.files[crossing->file_id_1].sections[crossing->section_1].snav_z_offset[tie->snav_1];
-			tie->inversion_status = MBNA_INVERSION_CURRENT;
-    			tie->inversion_offset_x = offset_x;
-    			tie->inversion_offset_y = offset_y;
-   			tie->inversion_offset_x_m = offset_x / mbna_mtodeglon;
-    			tie->inversion_offset_y_m = offset_y / mbna_mtodeglat;
-    			tie->inversion_offset_z_m = offset_z;
-/* fprintf(stderr,"mbna_mtodeglon:%f mbna_mtodeglat:%f\n",mbna_mtodeglon,mbna_mtodeglat);
-fprintf(stderr,"offsets:%f %f %f   offsets_m:%f %f %f\n",
-offset_x,offset_y,offset_z,tie->inversion_offset_x_m,tie->inversion_offset_y_m,tie->inversion_offset_z_m);*/
-
-			sprintf(message, " >     %4d   %10.3f %10.3f %10.3f   %10.3f %10.3f %10.3f   %10.3f %10.3f %10.3f\n",
-				icrossing,
-				tie->offset_x_m,
-				tie->offset_y_m,
-				tie->offset_z_m,
-				tie->inversion_offset_x_m,
-				tie->inversion_offset_y_m,
-				tie->inversion_offset_z_m,
-				(tie->inversion_offset_x_m - tie->offset_x_m),
-				(tie->inversion_offset_y_m - tie->offset_y_m),
-				(tie->inversion_offset_z_m - tie->offset_z_m));
-			do_info_add(message, MB_NO);
-			}
-		    }
-
-		/* get global tie results */
-		sprintf(message, " > Global Tie Offsets (m):  id  observed  solution  error\n");
-		do_info_add(message, MB_NO);
-		for (ifile=0;ifile<project.num_files;ifile++)
-		    {
-		    file = &project.files[ifile];
-		    for (isection=0;isection<file->num_sections;isection++)
-			{
-			section = &file->sections[isection];
-			if (section->global_tie_status != MBNA_TIE_NONE)
-			    {
-			    offset_x =  section->snav_lon_offset[section->global_tie_snav];
-			    offset_y =  section->snav_lat_offset[section->global_tie_snav];
-			    offset_z =  section->snav_z_offset[section->global_tie_snav];
-			    
-			    sprintf(message, " >     %2.2d:%2.2d:%2.2d %d   %10.3f %10.3f %10.3f   %10.3f %10.3f %10.3f   %10.3f %10.3f %10.3f\n",
-				ifile,isection,section->global_tie_snav,section->global_tie_status,
-				section->global_tie_offset_x_m,
-				section->global_tie_offset_y_m,
-				section->global_tie_offset_z_m,
-				offset_x / mbna_mtodeglon,
-				offset_y / mbna_mtodeglat,
-				offset_z,
-				(offset_x / mbna_mtodeglon - section->global_tie_offset_x_m),
-				(offset_y / mbna_mtodeglat - section->global_tie_offset_y_m),
-				(offset_z - section->global_tie_offset_z_m));
-			    do_info_add(message, MB_NO);
-			    }
-			}
-		    }
-
-		/* write updated project */
-		project.inversion = MBNA_INVERSION_CURRENT;
-		mbnavadjust_write_project();
-
-		/* deallocate arrays */
-		status = mb_freed(mbna_verbose, __FILE__, __LINE__, (void **)&x,&error);
-		status = mb_freed(mbna_verbose, __FILE__, __LINE__, (void **)&xx,&error);
-		status = mb_freed(mbna_verbose, __FILE__, __LINE__, (void **)&xa,&error);
-		status = mb_freed(mbna_verbose, __FILE__, __LINE__, (void **)&xs,&error);
-		status = mb_freed(mbna_verbose, __FILE__, __LINE__, (void **)&xw,&error);
-
-		/* turn off message dialog */
-		do_message_off();
-		}
-
- 	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-
-int
-mbnavadjust_applynav()
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_applynav";
-	int	status = MB_SUCCESS;
-	struct mbna_file *file;
-	struct mbna_section *section;
-	char	npath[STRING_MAX];
-	char	apath[STRING_MAX];
-	char	opath[STRING_MAX];
-	FILE	*nfp, *afp, *ofp;
-	char	*result;
-	char	buffer[BUFFER_MAX];
-	int	nscan;
-	int	time_i[7];
-	double	time_d;
-	double	navlon;
-	double	navlat;
-	double	heading;
-	double	speed;
-	double	draft;
-	double	roll;
-	double	pitch;
-	double	heave;
-	double	factor;
-	double	zoffset;
-	char	ostring[STRING_MAX];
-	int	mbp_heading_mode;
-	double	mbp_headingbias;
-	int	mbp_rollbias_mode;
-	double	mbp_rollbias;
-	double	mbp_rollbias_port;
-	double	mbp_rollbias_stbd;
-	int	done;
-	int	isection, isnav;
-	double	seconds;
-	int	i;
-
- 	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
-
-	/* output results from navigation solution */
-    	if (project.open == MB_YES
-    		&& project.num_crossings > 0
-		&& (project.num_crossings_analyzed >= 10
-			|| project.num_truecrossings_analyzed == project.num_truecrossings)
-		&& error == MB_ERROR_NO_ERROR)
-    		{
-
-		/* now output inverse solution */
-		sprintf(message,"Applying navigation solution...");
-		do_message_on(message);
-
-		/* generate new nav files */
-		for (i=0;i<project.num_files;i++)
-		    {
-		    file = &project.files[i];
-		    sprintf(npath,"%s/nvs_%4.4d.mb166",
-			project.datadir,i);
-		    sprintf(apath,"%s/nvs_%4.4d.na%d",
-			project.datadir,i,file->output_id);
-		    sprintf(opath,"%s.na%d", file->path, file->output_id);
-		    if (file->status == MBNA_FILE_FIXEDNAV)
-			{
-			sprintf(message, " > Not outputting updated nav to fixed file %s\n", opath);
-			do_info_add(message, MB_NO);
-			if (mbna_verbose == 0)
-				fprintf(stderr,"%s",message);
-			}
-		    else if ((nfp = fopen(npath,"r")) == NULL)
-			{
-			status = MB_FAILURE;
-			error = MB_ERROR_OPEN_FAIL;
-			sprintf(message, " > Unable to read initial nav file %s\n", npath);
-			do_info_add(message, MB_NO);
-			if (mbna_verbose == 0)
-				fprintf(stderr,"%s",message);
-			}
-		    else if ((afp = fopen(apath,"w")) == NULL)
-			{
-		        fclose(nfp);
-			status = MB_FAILURE;
-			error = MB_ERROR_OPEN_FAIL;
-			sprintf(message, " > Unable to open output nav file %s\n", apath);
-			do_info_add(message, MB_NO);
-			if (mbna_verbose == 0)
-				fprintf(stderr,"%s",message);
-			}
-		    else if ((ofp = fopen(opath,"w")) == NULL)
-			{
-		        fclose(nfp);
-		        fclose(afp);
-			status = MB_FAILURE;
-			error = MB_ERROR_OPEN_FAIL;
-			sprintf(message, " > Unable to open output nav file %s\n", opath);
-			do_info_add(message, MB_NO);
-			if (mbna_verbose == 0)
-				fprintf(stderr,"%s",message);
-			}
-		    else
-			{
-			sprintf(message, " > Output updated nav to %s\n", opath);
-			do_info_add(message, MB_NO);
-			if (mbna_verbose == 0)
-				fprintf(stderr,"%s",message);
-
-			/* write file header */
-			right_now = time((time_t *)0);
-			strcpy(date,ctime(&right_now));
-                        date[strlen(date)-1] = '\0';
-			if ((user_ptr = getenv("USER")) == NULL)
-				user_ptr = getenv("LOGNAME");
-			if (user_ptr != NULL)
-				strcpy(user,user_ptr);
-			else
-				strcpy(user, "unknown");
-			gethostname(host,MBP_FILENAMESIZE);
-			sprintf(ostring, "# Adjusted navigation generated using MBnavadjust\n");
-				fprintf(ofp, "%s", ostring);
-				fprintf(afp, "%s", ostring);
-			sprintf(ostring, "# MB-System version:        %s\n",MB_VERSION);
-				fprintf(ofp, "%s", ostring);
-				fprintf(afp, "%s", ostring);
-			sprintf(ostring, "# MB-System build data:     %s\n",MB_BUILD_DATE);
-				fprintf(ofp, "%s", ostring);
-				fprintf(afp, "%s", ostring);
-			sprintf(ostring, "# MBnavadjust version:      %s\n",rcs_id);
-				fprintf(ofp, "%s", ostring);
-				fprintf(afp, "%s", ostring);
-			sprintf(ostring, "# MBnavadjust project name: %s\n",project.name);
-				fprintf(ofp, "%s", ostring);
-				fprintf(afp, "%s", ostring);
-			sprintf(ostring, "# MBnavadjust project path: %s\n",project.path);
-				fprintf(ofp, "%s", ostring);
-				fprintf(afp, "%s", ostring);
-			sprintf(ostring, "# MBnavadjust project home: %s\n",project.home);
-				fprintf(ofp, "%s", ostring);
-				fprintf(afp, "%s", ostring);
-			sprintf(ostring, "# Generated by user <%s> on cpu <%s> at <%s>\n", user,host,date);
-				fprintf(ofp, "%s", ostring);
-				fprintf(afp, "%s", ostring);
-
-			/* read the input nav */
-			isection = 0;
-			section = &file->sections[isection];
-			isnav = 0;
-			done = MB_NO;
-			while (done == MB_NO)
-			    {
-			    if ((result = fgets(buffer,BUFFER_MAX,nfp)) != buffer)
-				{
-				done = MB_YES;
-				}
-			    else if ((nscan = sscanf(buffer, "%d %d %d %d %d %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf",
-						    &time_i[0], &time_i[1], &time_i[2], &time_i[3],
-						    &time_i[4], &seconds, &time_d,
-						    &navlon, &navlat, &heading, &speed,
-						    &draft, &roll, &pitch, &heave)) >= 11)
-				{
-				/* get integer seconds and microseconds */
-				time_i[5] = (int) floor(seconds);
-				time_i[6] = (int) ((seconds - (double)time_i[5]) * 1000000);
-				
-				/* fix nav from early version */
-				if (nscan < 15)
-				    {
-				    draft = 0.0;
-				    roll = 0.0;
-				    pitch = 0.0;
-				    heave = 0.0;
-				    }
-
-				/* get next snav interval if needed */
-				while (time_d > section->snav_time_d[isnav+1]
-				    && !(isection == file->num_sections - 1
-					&& isnav == section->num_snav - 2))
-				    {
-				    if (isnav < section->num_snav - 2)
-					{
-					isnav++;
-					}
-				    else if (isection < file->num_sections)
-					{
-					isection++;
-					section = &file->sections[isection];
-					isnav = 0;
-					}
-				    }
-
-				/* update the nav if possible (and it should be...) */
-				if (time_d < section->snav_time_d[isnav])
-				    {
-				    factor = 0.0;
-				    }
-				else if (time_d > section->snav_time_d[isnav+1])
-				    {
-				    factor = 1.0;
-				    }
-				else
-				    {
-				    if (section->snav_time_d[isnav+1] > section->snav_time_d[isnav])
-					{
-					factor = (time_d - section->snav_time_d[isnav])
-						    / (section->snav_time_d[isnav+1] - section->snav_time_d[isnav]);
-/*if (fabs(time_d - section->snav_time_d[isnav]) < 1.0)
-fprintf(stderr,"%f %f\n",pitch,section->snav_z_offset[isnav]);
-else if (fabs(time_d - section->snav_time_d[isnav+1]) < 1.0)
-fprintf(stderr,"%f %f\n",pitch,section->snav_z_offset[isnav+1]);*/
-					}
-				    else
-					factor = 0.0;
-				    }
-
-				/* update and output only nonzero navigation */
-				if (fabs(navlon) > 0.0000001 && fabs(navlat) > 0.0000001)
-				    {
-				    navlon += section->snav_lon_offset[isnav]
-						    + factor * (section->snav_lon_offset[isnav+1]
-							    - section->snav_lon_offset[isnav]);
-				    navlat += section->snav_lat_offset[isnav]
-						    + factor * (section->snav_lat_offset[isnav+1]
-							    - section->snav_lat_offset[isnav]);
-				    zoffset = section->snav_z_offset[isnav]
-						    + factor * (section->snav_z_offset[isnav+1]
-							    - section->snav_z_offset[isnav]);
-
-				    /* write the updated nav out */
-				    /* printing this string twice because in some situations the first
-					    print has the time_d value come out as "nan" - this is the worst sort
-					    of kluge for a real but mysterious bug - apologies to all who find this
-					    - DWC 18 Aug 2007 R/V Atlantis Cobb Segment JDF Ridge */
-				    sprintf(ostring, "%4.4d %2.2d %2.2d %2.2d %2.2d %2.2d.%6.6d %16.6f %.10f %.10f %.2f %.2f %.3f %.2f %.2f %.2f %.3f\r\n",
-						time_i[0], time_i[1], time_i[2], time_i[3],
-						time_i[4], time_i[5], time_i[6], time_d,
-						navlon, navlat, heading, speed,
-						draft, roll, pitch, heave, zoffset);
-				    sprintf(ostring, "%4.4d %2.2d %2.2d %2.2d %2.2d %2.2d.%6.6d %16.6f %.10f %.10f %.2f %.2f %.3f %.2f %.2f %.2f %.3f\r\n",
-						time_i[0], time_i[1], time_i[2], time_i[3],
-						time_i[4], time_i[5], time_i[6], time_d,
-						navlon, navlat, heading, speed,
-						draft, roll, pitch, heave, zoffset);
-				    fprintf(ofp, "%s", ostring);
-				    fprintf(afp, "%s", ostring);
-/* fprintf(stderr, "NAV OUT: %3.3d:%3.3d:%2.2d factor:%f | %s", i,isection,isnav,factor,ostring); */
-				    }
-				}
-			    }
-		        fclose(nfp);
-		        fclose(afp);
-		        fclose(ofp);
-
-			/* get bias values */
-			mb_pr_get_heading(mbna_verbose, file->path,
-					    &mbp_heading_mode,
-					    &mbp_headingbias,
-					    &error);
-			mb_pr_get_rollbias(mbna_verbose, file->path,
-					    &mbp_rollbias_mode,
-					    &mbp_rollbias,
-					    &mbp_rollbias_port,
-					    &mbp_rollbias_stbd,
-					    &error);
-
-			/* update output file in mbprocess parameter file */
-			status = mb_pr_update_format(mbna_verbose, file->path,
-				    MB_YES, file->format,
-				    &error);
-			status = mb_pr_update_navadj(mbna_verbose, file->path,
-				    MBP_NAVADJ_LLZ, opath,
-				    MBP_NAV_LINEAR,
-				    &error);
-
-			/* update heading bias in mbprocess parameter file */
-			mbp_headingbias = file->heading_bias + file->heading_bias_import;
-			if (mbp_headingbias == 0.0)
-			    {
-			    if (mbp_heading_mode == MBP_HEADING_OFF
-				|| mbp_heading_mode == MBP_HEADING_OFFSET)
-				mbp_heading_mode = MBP_HEADING_OFF;
-			    else if (mbp_heading_mode == MBP_HEADING_CALC
-				|| mbp_heading_mode == MBP_HEADING_CALCOFFSET)
-				mbp_heading_mode = MBP_HEADING_CALC;
-			    }
-			else
-			    {
-			    if (mbp_heading_mode == MBP_HEADING_OFF
-				|| mbp_heading_mode == MBP_HEADING_OFFSET)
-				mbp_heading_mode = MBP_HEADING_OFFSET;
-			    else if (mbp_heading_mode == MBP_HEADING_CALC
-				|| mbp_heading_mode == MBP_HEADING_CALCOFFSET)
-				mbp_heading_mode = MBP_HEADING_CALCOFFSET;
-			    }
-			status = mb_pr_update_heading(mbna_verbose, file->path,
-				    mbp_heading_mode, mbp_headingbias,
-				    &error);
-
-			/* update roll bias in mbprocess parameter file */
-			mbp_rollbias = file->roll_bias + file->roll_bias_import;
-			if (mbp_rollbias == 0.0)
-			    {
-			    if (mbp_rollbias_mode == MBP_ROLLBIAS_DOUBLE)
-				{
-				mbp_rollbias_port = mbp_rollbias
-					+ mbp_rollbias_port - file->roll_bias_import;
-				mbp_rollbias_stbd = mbp_rollbias
-					+ mbp_rollbias_stbd - file->roll_bias_import;
-				}
-			    else
-				mbp_rollbias_mode = MBP_ROLLBIAS_OFF;
-			    }
-			else
-			    {
-			    if (mbp_rollbias_mode == MBP_ROLLBIAS_DOUBLE)
-				{
-				mbp_rollbias_port = mbp_rollbias
-					+ mbp_rollbias_port - file->roll_bias_import;
-				mbp_rollbias_stbd = mbp_rollbias
-					+ mbp_rollbias_stbd - file->roll_bias_import;
-				}
-			    else
-				{
-				mbp_rollbias_mode = MBP_ROLLBIAS_SINGLE;
-				}
-			    }
-			status = mb_pr_update_rollbias(mbna_verbose, file->path,
-				    mbp_rollbias_mode, mbp_rollbias,
-				    mbp_rollbias_port, mbp_rollbias_stbd,
-				    &error);
-			}
-		    }
-
-		/* turn off message dialog */
-		do_message_off();
-		}
-
- 	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-
-
-/*--------------------------------------------------------------------*/
-
-int
-mbnavadjust_interpolatesolution()
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_interpolatesolution";
-	int	status = MB_SUCCESS;
-	struct mbna_file *file;
-	struct mbna_file *pfile;
-	struct mbna_section *section;
-	struct mbna_section *psection;
-	int	previoustie;
-	int	ifilestart;
-	int	isectionstart;
-	int	isnavstart;
-	double	plonoffset;
-	double	platoffset;
-	double	pzoffset;
-	double	ptime_d;
-	double	factor;
-	int	ok;
-	int	ii, jj, iisnav;
-	int	i, j, isnav;
-
- 	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
-
-	/* linearly interpolate solution between tied snavs */
-	previoustie = MB_NO;
-	ifilestart = 0;
-	isectionstart = 0;
-	isnavstart = 0;
-	for (i=0;i<project.num_files;i++)
-	    {
-	    file = &project.files[i];
-	    for (j=0;j<file->num_sections;j++)
-		{
-		section = &file->sections[j];
-		for (isnav=0;isnav<section->num_snav;isnav++)
-		    {
-		    /* deal with constrained snav points */
-		    if (section->snav_num_ties[isnav] > 0
-			|| section->global_tie_snav == isnav)
-			{
-			/* if no previous tie set apply current offset to intervening snav points */
-			if (previoustie == MB_NO)
-			    {
-			    for (ii=ifilestart;ii<=i;ii++)
-			    	{
-				pfile = &project.files[ii];
-				for (jj=0;jj<pfile->num_sections;jj++)
-				    {
-				    psection = &pfile->sections[jj];
-				    for (iisnav=0;iisnav<psection->num_snav;iisnav++)
-					{
-					ok = MB_YES;
-					if (ii == ifilestart && jj < isectionstart)
-						ok = MB_NO;
-					if (ii == ifilestart && jj == isectionstart && iisnav < isnavstart)
-						ok = MB_NO;
-					if (ii == i && jj > j)
-						ok = MB_NO;
-					if (ii == i && jj == j && iisnav > isnav)
-						ok = MB_NO;
-					if (ok == MB_YES)
-						{
-						psection->snav_lon_offset_int[iisnav] = section->snav_lon_offset[isnav];
-						psection->snav_lat_offset_int[iisnav] = section->snav_lat_offset[isnav];
-						psection->snav_z_offset_int[iisnav] = section->snav_z_offset[isnav];
-/*fprintf(stderr,"SET1: %d %d %d   %f %f %f\n",
-ii,jj,iisnav,
-psection->snav_lon_offset_int[iisnav],
-psection->snav_lat_offset_int[iisnav],
-psection->snav_z_offset_int[iisnav]);*/
-						}
-					}
-				    }
-				}
-			    }
-
-			/* if previous tie set interpolate intervening snav points */
-			if (previoustie == MB_YES)
-			    {
-			    pfile = &project.files[ifilestart];
-			    psection = &pfile->sections[isectionstart];
-			    plonoffset = psection->snav_lon_offset[isnavstart];
-			    platoffset = psection->snav_lat_offset[isnavstart];
-			    pzoffset = psection->snav_z_offset[isnavstart];
-			    ptime_d = psection->snav_time_d[isnavstart];
-			    for (ii=ifilestart;ii<=i;ii++)
-			    	{
-				pfile = &project.files[ii];
-				for (jj=0;jj<pfile->num_sections;jj++)
-				    {
-				    psection = &pfile->sections[jj];
-				    for (iisnav=0;iisnav<psection->num_snav;iisnav++)
-					{
-					ok = MB_YES;
-					if (ii == ifilestart && jj < isectionstart)
-						ok = MB_NO;
-					if (ii == ifilestart && jj == isectionstart && iisnav <= isnavstart)
-						ok = MB_NO;
-					if (ii == i && jj > j)
-						ok = MB_NO;
-					if (ii == i && jj == j && iisnav > isnav)
-						ok = MB_NO;
-					if (ok == MB_YES)
-						{
-						if ((section->snav_time_d[isnav] - ptime_d) > 0.0)
-							{
-							factor = (psection->snav_time_d[iisnav] - ptime_d)
-								/ (section->snav_time_d[isnav] - ptime_d);
-							}
-						else
-							{
-							factor = 0.0;
-							}
-						psection->snav_lon_offset_int[iisnav] = plonoffset
-							+ factor * (section->snav_lon_offset[isnav] - plonoffset);
-						psection->snav_lat_offset_int[iisnav] = platoffset
-							+ factor * (section->snav_lat_offset[isnav] - platoffset);
-						psection->snav_z_offset_int[iisnav] = pzoffset
-							+ factor * (section->snav_z_offset[isnav] - pzoffset);
-/*fprintf(stderr,"SET2: %d %d %d   %f %f %f   times: %f %f %f\n",
-ii,jj,iisnav,
-psection->snav_lon_offset_int[iisnav],
-psection->snav_lat_offset_int[iisnav],
-psection->snav_z_offset_int[iisnav],
-section->snav_time_d[isnav],psection->snav_time_d[iisnav],ptime_d);*/
-						}
-					}
-				    }
-				}
-			    }
-
-			/* reset tracking */
-			previoustie = MB_YES;
-			ifilestart = i;
-			isectionstart = j;
-			isnavstart = isnav;
-			}
-
-		    /* deal with a break in continuity */
-		    else if (isnav == 0 && section->continuity == MB_NO)
-		    	{
-			/* if previous tie set apply that offset to intervening snav points */
-			if (previoustie == MB_YES)
-			    {
-			    pfile = &project.files[ifilestart];
-			    psection = &pfile->sections[isectionstart];
-			    plonoffset = psection->snav_lon_offset[isnavstart];
-			    platoffset = psection->snav_lat_offset[isnavstart];
-			    pzoffset = psection->snav_z_offset[isnavstart];
-			    for (ii=ifilestart;ii<=i;ii++)
-			    	{
-				pfile = &project.files[ii];
-				for (jj=0;jj<pfile->num_sections;jj++)
-				    {
-				    psection = &pfile->sections[jj];
-				    for (iisnav=0;iisnav<psection->num_snav;iisnav++)
-					{
-					ok = MB_YES;
-					if (ii == ifilestart && jj < isectionstart)
-						ok = MB_NO;
-					if (ii == ifilestart && jj == isectionstart && iisnav <= isnavstart)
-						ok = MB_NO;
-					if (ii == i && jj > j)
-						ok = MB_NO;
-					if (ii == i && jj == j && iisnav >= isnav)
-						ok = MB_NO;
-					if (ok == MB_YES)
-						{
-						psection->snav_lon_offset_int[iisnav] = plonoffset;
-						psection->snav_lat_offset_int[iisnav] = platoffset;
-						psection->snav_z_offset_int[iisnav] = pzoffset;
-/*fprintf(stderr,"SET3: %d %d %d   %f %f %f\n",
-ii,jj,iisnav,
-psection->snav_lon_offset_int[iisnav],
-psection->snav_lat_offset_int[iisnav],
-psection->snav_z_offset_int[iisnav]);*/
-						}
-
-					}
-				    }
-				}
-			    }
-
-			/* reset tracking */
-			previoustie = MB_NO;
-			ifilestart = i;
-			isectionstart = j;
-			isnavstart = isnav;
-			}
-
-		    /* deal with end of data */
-		    else if (i == project.num_files - 1
-		    	&& j == file->num_sections - 1
-			&& isnav == section->num_snav - 1)
-		    	{
-			/* if previous tie set apply that offset to intervening snav points */
-			if (previoustie == MB_YES)
-			    {
-			    pfile = &project.files[ifilestart];
-			    psection = &pfile->sections[isectionstart];
-			    plonoffset = psection->snav_lon_offset[isnavstart];
-			    platoffset = psection->snav_lat_offset[isnavstart];
-			    pzoffset = psection->snav_z_offset[isnavstart];
-			    for (ii=ifilestart;ii<=i;ii++)
-			    	{
-				pfile = &project.files[ii];
-				for (jj=0;jj<pfile->num_sections;jj++)
-				    {
-				    psection = &pfile->sections[jj];
-				    for (iisnav=0;iisnav<psection->num_snav;iisnav++)
-					{
-					ok = MB_YES;
-					if (ii == ifilestart && jj < isectionstart)
-						ok = MB_NO;
-					if (ii == ifilestart && jj == isectionstart && iisnav <= isnavstart)
-						ok = MB_NO;
-					if (ii == i && jj > j)
-						ok = MB_NO;
-					if (ii == i && jj == j && iisnav > isnav)
-						ok = MB_NO;
-					if (ok == MB_YES)
-						{
-						psection->snav_lon_offset_int[iisnav] = plonoffset;
-						psection->snav_lat_offset_int[iisnav] = platoffset;
-						psection->snav_z_offset_int[iisnav] = pzoffset;
-/*fprintf(stderr,"SET4: %d %d %d   %f %f %f\n",
-ii,jj,iisnav,
-psection->snav_lon_offset_int[iisnav],
-psection->snav_lat_offset_int[iisnav],
-psection->snav_z_offset_int[iisnav]);*/
-						}
-
-					}
-				    }
-				}
-			    }
-
-			/* reset tracking */
-			previoustie = MB_NO;
-			ifilestart = i;
-			isectionstart = j;
-			isnavstart = isnav;
-			}
-
-		    /* zero unconstrained snav points - these will be interpolated later if possible */
-		    else
-		        {
-		    	section->snav_lon_offset_int[isnav] = 0.0;
-		    	section->snav_lat_offset_int[isnav] = 0.0;
-		    	section->snav_z_offset_int[isnav] = 0.0;
-/*fprintf(stderr,"SET5: %d %d %d   %f %f %f\n",
-i,j,isnav,
-section->snav_lon_offset_int[isnav],
-section->snav_lat_offset_int[isnav],
-section->snav_z_offset_int[isnav]);*/
-		        }
-		    }
-		}
-	    }
-/*for (i=0;i<project.num_files;i++)
-{
-file = &project.files[i];
-for (j=0;j<file->num_sections;j++)
-{
-section = &file->sections[j];
-for (isnav=0;isnav<section->num_snav;isnav++)
-{
-fprintf(stderr,"INTERPOLATION: %2d %2d %2d   %f %f %f\n",
-i,j,isnav,
-section->snav_lon_offset_int[isnav],
-section->snav_lat_offset_int[isnav],
-section->snav_z_offset_int[isnav]);
-}
-}
-}*/
-
- 	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbnavadjust_set_modelplot_graphics(void *mp_xgid, int *mp_brdr)
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_set_modelplot_graphics";
-	int	status = MB_SUCCESS;
-	int	i;
-
-	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       mp_xgid:      %p\n",mp_xgid);
-		fprintf(stderr,"dbg2       mp_brdr:      %d %d %d %d\n",
-			mp_brdr[0], mp_brdr[1], mp_brdr[2], mp_brdr[3]);
-		}
-
-	/* set graphics id */
-	pmodp_xgid = mp_xgid;
-
-	/* set borders */
-	for (i=0;i<4;i++)
-		{
-		modp_borders[i] = mp_brdr[i];
-		}
-
-	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-
-int
-mbnavadjust_modelplot_setzoom()
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_modelplot_setzoom";
-	int	status = MB_SUCCESS;
-	int	xo;
-	int	plot_width;
-	double	xscale;
-	int	ipingstart, ipingend;
-	int	itiestart, itieend;
-
- 	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
-
-	/* plot zoom if active */
-	if ((mbna_modelplot_zoom_x1 >= 0 || mbna_modelplot_zoom_x2 >= 0)
-	    && mbna_modelplot_zoom_x1 != mbna_modelplot_zoom_x2)
-		{
-		if (project.modelplot_style == MBNA_MODELPLOT_TIMESERIES)
-			{
-			plot_width = mbna_modelplot_width - 8 * MBNA_MODELPLOT_X_SPACE;
-			xo = 5 * MBNA_MODELPLOT_X_SPACE;
-			xscale = ((double)plot_width) / (mbna_modelplot_end - mbna_modelplot_start + 1);
-
-			ipingstart = (MIN(mbna_modelplot_zoom_x1, mbna_modelplot_zoom_x2) - xo) / xscale
-					+ mbna_modelplot_start;
-			ipingstart = MIN(MAX(ipingstart, 0), project.num_pings - 1);
-			ipingend = (MAX(mbna_modelplot_zoom_x1, mbna_modelplot_zoom_x2) - xo) / xscale
-					+ mbna_modelplot_start;
-			ipingend = MIN(MAX(ipingend, 0), project.num_pings - 1);
-
-			if (ipingend > ipingstart)
-				{
-				mbna_modelplot_zoom = MB_YES;
-				mbna_modelplot_startzoom = ipingstart;
-				mbna_modelplot_endzoom = ipingend;
-				}
-			else
-				mbna_modelplot_zoom = MB_NO;
-			}
-
-		else if (project.modelplot_style == MBNA_MODELPLOT_PERTURBATION)
-			{
-			plot_width = mbna_modelplot_width - 8 * MBNA_MODELPLOT_X_SPACE;
-			xo = 5 * MBNA_MODELPLOT_X_SPACE;
-			xscale = ((double)plot_width) / (mbna_modelplot_end - mbna_modelplot_start + 1);
-
-			ipingstart = (MIN(mbna_modelplot_zoom_x1, mbna_modelplot_zoom_x2) - xo) / xscale
-					+ mbna_modelplot_start;
-			ipingstart = MIN(MAX(ipingstart, 0), project.num_pings - 1);
-			ipingend = (MAX(mbna_modelplot_zoom_x1, mbna_modelplot_zoom_x2) - xo) / xscale
-					+ mbna_modelplot_start;
-			ipingend = MIN(MAX(ipingend, 0), project.num_pings - 1);
-
-			if (ipingend > ipingstart)
-				{
-				mbna_modelplot_zoom = MB_YES;
-				mbna_modelplot_startzoom = ipingstart;
-				mbna_modelplot_endzoom = ipingend;
-				}
-			else
-				mbna_modelplot_zoom = MB_NO;
-			}
-
-		else
-			{
-			itiestart = (MIN(mbna_modelplot_zoom_x1, mbna_modelplot_zoom_x2) - mbna_modelplot_xo)
-					/ mbna_modelplot_xscale;
-			itieend = (MAX(mbna_modelplot_zoom_x1, mbna_modelplot_zoom_x2) - mbna_modelplot_xo)
-					/ mbna_modelplot_xscale;
-			itiestart = MAX(0,itiestart);
-			itieend = MIN(mbna_num_ties_plot-1, itieend);
-			if (itieend > itiestart)
-				{
-				mbna_modelplot_tiezoom = MB_YES;
-				mbna_modelplot_tiestartzoom = itiestart;
-				mbna_modelplot_tieendzoom = itieend;
-				}
-			else
-				mbna_modelplot_tiezoom = MB_NO;
-			}
-
-		mbna_modelplot_zoom_x1 = 0;
-		mbna_modelplot_zoom_x2 = 0;
-		}
-
-	/* reset zoom to off otherwise */
-	else
-		{
-		if (project.modelplot_style == MBNA_MODELPLOT_TIMESERIES)
-			{
-			mbna_modelplot_zoom = MB_NO;
-			mbna_modelplot_start = 0;
-			mbna_modelplot_end = project.num_pings - 1;
-			}
-		else if (project.modelplot_style == MBNA_MODELPLOT_PERTURBATION)
-			{
-			mbna_modelplot_zoom = MB_NO;
-			mbna_modelplot_start = 0;
-			mbna_modelplot_end = project.num_pings - 1;
-			}
-		else
-			{
-			mbna_modelplot_tiezoom = MB_NO;
-			mbna_modelplot_tiestart = 0;
-			mbna_modelplot_tieend = mbna_num_ties_plot - 1;
-			}
-		}
-
-	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-
-int
-mbnavadjust_modelplot_pick(int x, int y)
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_modelplot_pick";
-	int	status = MB_SUCCESS;
-
- 	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2       x:           %d\n",x);
-		fprintf(stderr,"dbg2       y:           %d\n",y);
-		}
-
-	/* find nearest snav pt with tie */
-    	if (project.open == MB_YES
-    		&& project.inversion != MBNA_INVERSION_NONE
-		&& project.modelplot == MB_YES)
-    		{
-		if (project.modelplot_style == MBNA_MODELPLOT_TIMESERIES)
-			{
-			mbnavadjust_modelplot_pick_timeseries(x, y);
-			}
-		else if (project.modelplot_style == MBNA_MODELPLOT_PERTURBATION)
-			{
-			mbnavadjust_modelplot_pick_perturbation(x, y);
-			}
-		else
-			{
-			mbnavadjust_modelplot_pick_tieoffsets(x, y);
-			}
-		}
-
-	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-
-int
-mbnavadjust_modelplot_pick_timeseries(int x, int y)
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_modelplot_pick_timeseries";
-	int	status = MB_SUCCESS;
-	struct mbna_file *file;
-	struct mbna_section *section;
-	struct mbna_crossing *crossing;
-	struct mbna_tie *tie;
-	int	range;
-	int	rangemin;
-	int	pick_crossing;
-	int	pick_tie;
-	int	pick_file;
-	int	pick_section;
-	int	pick_snav;
-	int	ntieselect;
-	int	i, j, ix, iy, iping;
-
- 	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2       x:           %d\n",x);
-		fprintf(stderr,"dbg2       y:           %d\n",y);
-		}
-
-	/* find nearest snav pt with tie */
-    	if (project.open == MB_YES
-    		&& project.inversion != MBNA_INVERSION_NONE
-		&& project.modelplot == MB_YES)
-    		{
-		rangemin = 10000000;
-fprintf(stderr,"mbnavadjust_modelplot_pick_timeseries: %d %d\n",x,y);
-		/* search by looping over crossings */
-		for (i=0;i<project.num_crossings;i++)
-		    {
-		    crossing = &(project.crossings[i]);
-
-		    /* loop over all ties for this crossing */
-		    for (j=0;j<crossing->num_ties;j++)
-		    	{
-			tie = &(crossing->ties[j]);
-
-			/* handle first snav point */
-			file = &project.files[crossing->file_id_1];
-			section = &file->sections[crossing->section_1];
-
-			if (section->show_in_modelplot == MB_YES)
-				{
-				iping = section->modelplot_start_count + section->snav_id[tie->snav_1];
-				ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
-
-				iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * section->snav_lon_offset[tie->snav_1] / mbna_mtodeglon);
-				range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
-				if (range < rangemin)
-					{
-					rangemin = range;
-					pick_crossing = i;
-					pick_tie = j;
-					pick_file = crossing->file_id_1;
-					pick_section = crossing->section_1;
-					pick_snav = tie->snav_1;
-					}
-
-				iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * section->snav_lat_offset[tie->snav_1] / mbna_mtodeglat);
-				range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
-				if (range < rangemin)
-					{
-					rangemin = range;
-					pick_crossing = i;
-					pick_tie = j;
-					pick_file = crossing->file_id_1;
-					pick_section = crossing->section_1;
-					pick_snav = tie->snav_1;
-					}
-
-				iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * section->snav_z_offset[tie->snav_1]);
-				range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
-				if (range < rangemin)
-					{
-					rangemin = range;
-					pick_crossing = i;
-					pick_tie = j;
-					pick_file = crossing->file_id_1;
-					pick_section = crossing->section_1;
-					pick_snav = tie->snav_1;
-					}
-				}
-
-			/* handle second snav point */
-			file = &project.files[crossing->file_id_2];
-			section = &file->sections[crossing->section_2];
-
-			if (section->show_in_modelplot == MB_YES)
-				{
-			iping = section->modelplot_start_count + section->snav_id[tie->snav_2];
-			ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
-
-				iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * section->snav_lon_offset[tie->snav_2] / mbna_mtodeglon);
-				range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
-				if (range < rangemin)
-					{
-					rangemin = range;
-					pick_crossing = i;
-					pick_tie = j;
-					pick_file = crossing->file_id_2;
-					pick_section = crossing->section_2;
-					pick_snav = tie->snav_2;
-					}
-
-				iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * section->snav_lat_offset[tie->snav_2] / mbna_mtodeglat);
-				range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
-				if (range < rangemin)
-					{
-					rangemin = range;
-					pick_crossing = i;
-					pick_tie = j;
-					pick_file = crossing->file_id_2;
-					pick_section = crossing->section_2;
-					pick_snav = tie->snav_2;
-					}
-
-				iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * section->snav_z_offset[tie->snav_2]);
-				range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
-				if (range < rangemin)
-					{
-					rangemin = range;
-					pick_crossing = i;
-					pick_tie = j;
-					pick_file = crossing->file_id_2;
-					pick_section = crossing->section_2;
-					pick_snav = tie->snav_2;
-					}
-				}
-			}
-		    }
-
-		/* deal with successful pick */
-		if (rangemin < 10000000)
-			{
-			/* count the number of ties associated with the selected snav point */
-			ntieselect = 0;
-			for (i=0;i<project.num_crossings;i++)
-			    {
-			    crossing = &(project.crossings[i]);
-
-			    /* loop over all ties for this crossing */
-			    for (j=0;j<crossing->num_ties;j++)
-		    		{
-				tie = &(crossing->ties[j]);
-
-				/* handle first snav point */
-				file = &project.files[crossing->file_id_1];
-				section = &file->sections[crossing->section_1];
-				if (pick_file == crossing->file_id_1
-					&& pick_section == crossing->section_1
-					&& pick_snav == tie->snav_1)
-					ntieselect++;
-
-				/* handle second snav point */
-				file = &project.files[crossing->file_id_2];
-				section = &file->sections[crossing->section_2];
-				if (pick_file == crossing->file_id_2
-					&& pick_section == crossing->section_2
-					&& pick_snav == tie->snav_2)
-					ntieselect++;
-				}
-			    }
-
-			/* if only one tie go ahead and select it and open it in naverr */
-			if (ntieselect == 1)
-				{
-			    	mbna_crossing_select = pick_crossing;
-			    	mbna_tie_select = pick_tie;
-				mbna_modelplot_pickfile = MBNA_SELECT_NONE;
-				mbna_modelplot_picksection = MBNA_SELECT_NONE;
-				mbna_modelplot_picksnav = MBNA_SELECT_NONE;
-
-				/* bring up naverr window if required */
-				if (mbna_naverr_load == MB_NO)
-				    {
-				    do_naverr_init();
-				    }
-
-				/* else if naverr window is up, load selected crossing */
-				else
-				    {
-				    mbnavadjust_naverr_specific(mbna_crossing_select, mbna_tie_select);
-				    mbnavadjust_naverr_plot(MBNA_PLOT_MODE_FIRST);
-				    do_update_naverr();
-				    do_update_status();
-				    }
-				}
-
-			/* else if multiple ties */
-			else if (ntieselect > 1)
-				{
-				mbna_modelplot_pickfile = pick_file;
-				mbna_modelplot_picksection = pick_section;
-				mbna_modelplot_picksnav = pick_snav;
-
-				}
-			}
-		}
-
-	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-
-int
-mbnavadjust_modelplot_pick_perturbation(int x, int y)
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_modelplot_pick_perturbation";
-	int	status = MB_SUCCESS;
-	struct mbna_file *file;
-	struct mbna_section *section;
-	struct mbna_crossing *crossing;
-	struct mbna_tie *tie;
-	int	range;
-	int	rangemin;
-	int	pick_crossing;
-	int	pick_tie;
-	int	pick_file;
-	int	pick_section;
-	int	pick_snav;
-	int	ntieselect;
-	int	i, j, ix, iy, iping;
-
- 	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2       x:           %d\n",x);
-		fprintf(stderr,"dbg2       y:           %d\n",y);
-		}
-
-	/* find nearest snav pt with tie */
-    	if (project.open == MB_YES
-    		&& project.inversion != MBNA_INVERSION_NONE
-		&& project.modelplot == MB_YES)
-    		{
-		rangemin = 10000000;
-fprintf(stderr,"mbnavadjust_modelplot_pick_perturbation: %d %d\n",x,y);
-		/* search by looping over crossings */
-		for (i=0;i<project.num_crossings;i++)
-		    {
-		    crossing = &(project.crossings[i]);
-
-		    /* loop over all ties for this crossing */
-		    for (j=0;j<crossing->num_ties;j++)
-		    	{
-			tie = &(crossing->ties[j]);
-
-			/* handle first snav point */
-			file = &project.files[crossing->file_id_1];
-			section = &file->sections[crossing->section_1];
-
-			if (section->show_in_modelplot == MB_YES)
-				{
-				iping = section->modelplot_start_count + section->snav_id[tie->snav_1];
-				ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
-
-				iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * (section->snav_lon_offset[tie->snav_1] / mbna_mtodeglon - file->block_offset_x));
-				range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
-				if (range < rangemin)
-					{
-					rangemin = range;
-					pick_crossing = i;
-					pick_tie = j;
-					pick_file = crossing->file_id_1;
-					pick_section = crossing->section_1;
-					pick_snav = tie->snav_1;
-					}
-
-				iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * (section->snav_lat_offset[tie->snav_1] / mbna_mtodeglat - file->block_offset_y));
-				range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
-				if (range < rangemin)
-					{
-					rangemin = range;
-					pick_crossing = i;
-					pick_tie = j;
-					pick_file = crossing->file_id_1;
-					pick_section = crossing->section_1;
-					pick_snav = tie->snav_1;
-					}
-
-				iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * (section->snav_z_offset[tie->snav_1] - file->block_offset_z));
-				range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
-				if (range < rangemin)
-					{
-					rangemin = range;
-					pick_crossing = i;
-					pick_tie = j;
-					pick_file = crossing->file_id_1;
-					pick_section = crossing->section_1;
-					pick_snav = tie->snav_1;
-					}
-				}
-
-			/* handle second snav point */
-			file = &project.files[crossing->file_id_2];
-			section = &file->sections[crossing->section_2];
-
-			if (section->show_in_modelplot == MB_YES)
-				{
-			iping = section->modelplot_start_count + section->snav_id[tie->snav_2];
-			ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
-
-				iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * (section->snav_lon_offset[tie->snav_2] / mbna_mtodeglon - file->block_offset_x));
-				range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
-				if (range < rangemin)
-					{
-					rangemin = range;
-					pick_crossing = i;
-					pick_tie = j;
-					pick_file = crossing->file_id_2;
-					pick_section = crossing->section_2;
-					pick_snav = tie->snav_2;
-					}
-
-				iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * (section->snav_lat_offset[tie->snav_2] / mbna_mtodeglat - file->block_offset_y));
-				range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
-				if (range < rangemin)
-					{
-					rangemin = range;
-					pick_crossing = i;
-					pick_tie = j;
-					pick_file = crossing->file_id_2;
-					pick_section = crossing->section_2;
-					pick_snav = tie->snav_2;
-					}
-
-				iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * (section->snav_z_offset[tie->snav_2] - file->block_offset_z));
-				range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
-				if (range < rangemin)
-					{
-					rangemin = range;
-					pick_crossing = i;
-					pick_tie = j;
-					pick_file = crossing->file_id_2;
-					pick_section = crossing->section_2;
-					pick_snav = tie->snav_2;
-					}
-				}
-			}
-		    }
-
-		/* deal with successful pick */
-		if (rangemin < 10000000)
-			{
-			/* count the number of ties associated with the selected snav point */
-			ntieselect = 0;
-			for (i=0;i<project.num_crossings;i++)
-			    {
-			    crossing = &(project.crossings[i]);
-
-			    /* loop over all ties for this crossing */
-			    for (j=0;j<crossing->num_ties;j++)
-		    		{
-				tie = &(crossing->ties[j]);
-
-				/* handle first snav point */
-				file = &project.files[crossing->file_id_1];
-				section = &file->sections[crossing->section_1];
-				if (pick_file == crossing->file_id_1
-					&& pick_section == crossing->section_1
-					&& pick_snav == tie->snav_1)
-					ntieselect++;
-
-				/* handle second snav point */
-				file = &project.files[crossing->file_id_2];
-				section = &file->sections[crossing->section_2];
-				if (pick_file == crossing->file_id_2
-					&& pick_section == crossing->section_2
-					&& pick_snav == tie->snav_2)
-					ntieselect++;
-				}
-			    }
-
-			/* if only one tie go ahead and select it and open it in naverr */
-			if (ntieselect == 1)
-				{
-			    	mbna_crossing_select = pick_crossing;
-			    	mbna_tie_select = pick_tie;
-				mbna_modelplot_pickfile = MBNA_SELECT_NONE;
-				mbna_modelplot_picksection = MBNA_SELECT_NONE;
-				mbna_modelplot_picksnav = MBNA_SELECT_NONE;
-
-				/* bring up naverr window if required */
-				if (mbna_naverr_load == MB_NO)
-				    {
-				    do_naverr_init();
-				    }
-
-				/* else if naverr window is up, load selected crossing */
-				else
-				    {
-				    mbnavadjust_naverr_specific(mbna_crossing_select, mbna_tie_select);
-				    mbnavadjust_naverr_plot(MBNA_PLOT_MODE_FIRST);
-				    do_update_naverr();
-				    do_update_status();
-				    }
-				}
-
-			/* else if multiple ties */
-			else if (ntieselect > 1)
-				{
-				mbna_modelplot_pickfile = pick_file;
-				mbna_modelplot_picksection = pick_section;
-				mbna_modelplot_picksnav = pick_snav;
-
-				}
-			}
-		}
-
-	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-
-int
-mbnavadjust_modelplot_pick_tieoffsets(int x, int y)
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_modelplot_pick_tieoffsets";
-	int	status = MB_SUCCESS;
-	struct mbna_file *file;
-	struct mbna_section *section;
-	struct mbna_crossing *crossing;
-	struct mbna_tie *tie;
-	int	range;
-	int	rangemin;
-	int	pick_crossing;
-	int	pick_tie;
-	int	pick_file;
-	int	pick_section;
-	int	pick_snav;
-	int	i, j, ix, iy;
-
- 	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2       x:           %d\n",x);
-		fprintf(stderr,"dbg2       y:           %d\n",y);
-		}
-
-	/* find nearest snav pt with tie */
-    	if (project.open == MB_YES
-    		&& project.inversion != MBNA_INVERSION_NONE
-		&& project.modelplot == MB_YES)
-    		{
-		rangemin = 10000000;
-
-		/* search by looping over crossings */
-		for (i=0;i<project.num_crossings;i++)
-		    {
-		    crossing = &(project.crossings[i]);
-
-		    /* loop over all ties for this crossing */
-		    for (j=0;j<crossing->num_ties;j++)
-		    	{
-			tie = &(crossing->ties[j]);
-
-			/* handle first snav point */
-			file = &project.files[crossing->file_id_1];
-			section = &file->sections[crossing->section_1];
-
-			ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (tie->isurveyplotindex - mbna_modelplot_tiestart));
-
-			iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * tie->offset_x_m);
-			range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
-			if (range < rangemin)
-				{
-				rangemin = range;
-				pick_crossing = i;
-				pick_tie = j;
-				pick_file = crossing->file_id_1;
-				pick_section = crossing->section_1;
-				pick_snav = tie->snav_1;
-				}
-
-			iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale  * tie->offset_y_m);
-			range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
-			if (range < rangemin)
-				{
-				rangemin = range;
-				pick_crossing = i;
-				pick_tie = j;
-				pick_file = crossing->file_id_1;
-				pick_section = crossing->section_1;
-				pick_snav = tie->snav_1;
-				}
-
-			iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale  * tie->offset_z_m);
-			range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
-			if (range < rangemin)
-				{
-				rangemin = range;
-				pick_crossing = i;
-				pick_tie = j;
-				pick_file = crossing->file_id_1;
-				pick_section = crossing->section_1;
-				pick_snav = tie->snav_1;
-				}
-			}
-		    }
-
-		/* deal with successful pick */
-		if (rangemin < 10000000)
-			{
-			mbna_crossing_select = pick_crossing;
-			mbna_tie_select = pick_tie;
-			/* mbna_modelplot_pickfile = MBNA_SELECT_NONE; */
-			mbna_modelplot_picksection = MBNA_SELECT_NONE;
-			mbna_modelplot_picksnav = MBNA_SELECT_NONE;
-
-			/* bring up naverr window if required */
-			if (mbna_naverr_load == MB_NO)
-			    {
-			    do_naverr_init();
-			    }
-
-			/* else if naverr window is up, load selected crossing */
-			else
-			    {
-			    mbnavadjust_naverr_specific(mbna_crossing_select, mbna_tie_select);
-			    mbnavadjust_naverr_plot(MBNA_PLOT_MODE_FIRST);
-			    do_update_naverr();
-			    do_update_status();
-			    }
-			}
-		}
-
-
-	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-
-int
-mbnavadjust_modelplot_middlepick(int x, int y)
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_modelplot_middlepick";
-	int	status = MB_SUCCESS;
-	struct mbna_file *file;
-	struct mbna_section *section;
-	struct mbna_crossing *crossing;
-	struct mbna_tie *tie;
-	int	range;
-	int	rangemin;
-	int	pick_crossing;
-	int	pick_tie;
-	int	pick_file;
-	int	pick_section;
-	int	pick_snav;
-	int	i, j, ix, iy, iping;
-
- 	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2       x:           %d\n",x);
-		fprintf(stderr,"dbg2       y:           %d\n",y);
-		}
-
-	/* handle middle button pick */
-    	if (project.open == MB_YES
-    		&& project.inversion != MBNA_INVERSION_NONE
-		&& project.modelplot == MB_YES)
-		{
-		/* middle pick for timeseries plot is either choosing one of multiple available
-			ties from a tied crossing (left button) pick, or if that is not the
-			situation, picking the nearest untied crossing */
-		if (project.modelplot_style == MBNA_MODELPLOT_TIMESERIES)
-			{
-			/* first snav pick had multiple ties - now pick which one to use */
-			if (mbna_modelplot_pickfile != MBNA_SELECT_NONE)
-			    {
-			    rangemin = 10000000;
-
-			    for (i=0;i<project.num_crossings;i++)
-				{
-				/* check if this crossing includes the picked snav */
-				crossing = &(project.crossings[i]);
-
-				/* check first snav */
-				if (crossing->file_id_1 == mbna_modelplot_pickfile
-					&& crossing->section_1 == mbna_modelplot_picksection)
-				    {
-				    /* loop over the ties */
-				    for (j=0;j<crossing->num_ties;j++)
-					{
-					tie = &(crossing->ties[j]);
-					if (tie->snav_1 == mbna_modelplot_picksnav)
-					    {
-					    file = &project.files[crossing->file_id_2];
-					    section = &file->sections[crossing->section_2];
-					    iping = section->modelplot_start_count + section->snav_id[tie->snav_2];
-					    ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
-
-					    iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * section->snav_lon_offset[tie->snav_2] / mbna_mtodeglon);
-					    range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
-					    if (range < rangemin)
-						    {
-						    rangemin = range;
-						    pick_crossing = i;
-						    pick_tie = j;
-						    pick_file = crossing->file_id_2;
-						    pick_section = crossing->section_2;
-						    pick_snav = tie->snav_2;
-						    }
-	/*fprintf(stderr,"range:%d rangemin:%d\n",range,rangemin);*/
-
-					    iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * section->snav_lat_offset[tie->snav_2] / mbna_mtodeglat);
-					    range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
-					    if (range < rangemin)
-						    {
-						    rangemin = range;
-						    pick_crossing = i;
-						    pick_tie = j;
-						    pick_file = crossing->file_id_2;
-						    pick_section = crossing->section_2;
-						    pick_snav = tie->snav_2;
-						    }
-	    /*fprintf(stderr,"range:%d rangemin:%d\n",range,rangemin);*/
-
-					    iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * section->snav_z_offset[tie->snav_2]);
-					    range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
-					    if (range < rangemin)
-						    {
-						    rangemin = range;
-						    pick_crossing = i;
-						    pick_tie = j;
-						    pick_file = crossing->file_id_2;
-						    pick_section = crossing->section_2;
-						    pick_snav = tie->snav_2;
-						    }
-	    /*fprintf(stderr,"range:%d rangemin:%d\n",range,rangemin);*/
-					    }
-					}
-				    }
-
-				/* check second snav */
-				if (crossing->file_id_2 == mbna_modelplot_pickfile
-					&& crossing->section_2 == mbna_modelplot_picksection)
-				    {
-				    /* loop over the ties */
-				    for (j=0;j<crossing->num_ties;j++)
-					{
-					tie = &(crossing->ties[j]);
-					if (tie->snav_2 == mbna_modelplot_picksnav)
-					    {
-					    file = &project.files[crossing->file_id_1];
-					    section = &file->sections[crossing->section_1];
-					    iping = section->modelplot_start_count + section->snav_id[tie->snav_1];
-					    ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
-
-					    iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * section->snav_lon_offset[tie->snav_1] / mbna_mtodeglon);
-					    range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
-					    if (range < rangemin)
-						    {
-						    rangemin = range;
-						    pick_crossing = i;
-						    pick_tie = j;
-						    pick_file = crossing->file_id_1;
-						    pick_section = crossing->section_1;
-						    pick_snav = tie->snav_1;
-						    }
-	    /*fprintf(stderr,"range:%d rangemin:%d\n",range,rangemin);*/
-
-					    iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * section->snav_lat_offset[tie->snav_1] / mbna_mtodeglat);
-					    range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
-					    if (range < rangemin)
-						    {
-						    rangemin = range;
-						    pick_crossing = i;
-						    pick_tie = j;
-						    pick_file = crossing->file_id_1;
-						    pick_section = crossing->section_1;
-						    pick_snav = tie->snav_1;
-						    }
-	    /*fprintf(stderr,"range:%d rangemin:%d\n",range,rangemin);*/
-
-					    iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * section->snav_z_offset[tie->snav_1]);
-					    range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
-					    if (range < rangemin)
-						    {
-						    rangemin = range;
-						    pick_crossing = i;
-						    pick_tie = j;
-						    pick_file = crossing->file_id_1;
-						    pick_section = crossing->section_1;
-						    pick_snav = tie->snav_1;
-						    }
-	/*fprintf(stderr,"range:%d rangemin:%d\n",range,rangemin);*/
-					    }
-					}
-				    }
-				}
-
-			    /* deal with successful pick */
-			    if (rangemin < 10000000)
-				{
-				/* select tie and open it in naverr */
-				mbna_crossing_select = pick_crossing;
-				mbna_tie_select = pick_tie;
-				mbna_modelplot_pickfile = MBNA_SELECT_NONE;
-				mbna_modelplot_picksection = MBNA_SELECT_NONE;
-				mbna_modelplot_picksnav = MBNA_SELECT_NONE;
-
-				/* bring up naverr window if required */
-				if (mbna_naverr_load == MB_NO)
-				    {
-				    do_naverr_init();
-				    }
-
-				/* else if naverr window is up, load selected crossing */
-				else
-				    {
-				    mbnavadjust_naverr_specific(mbna_crossing_select, mbna_tie_select);
-				    mbnavadjust_naverr_plot(MBNA_PLOT_MODE_FIRST);
-				    do_update_naverr();
-				    do_update_status();
-				    }
-				}
-			    }
-
-			/* else pick closest untied crossing */
-			else
-			    {
-			    rangemin = 10000000;
-
-			    /* search by looping over crossings */
-			    for (i=0;i<project.num_crossings;i++)
-				{
-				crossing = &(project.crossings[i]);
-
-				/* check only untied crossings */
-				if (crossing->num_ties == 0)
-				    {
-				    file = &project.files[crossing->file_id_1];
-				    section = &file->sections[crossing->section_1];
-
-				    iping = section->modelplot_start_count + section->snav_id[section->num_snav/2];
-				    ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
-
-				    iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * section->snav_lon_offset[section->num_snav/2] / mbna_mtodeglon);
-				    range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
-				    if (range < rangemin)
-					    {
-					    rangemin = range;
-					    pick_crossing = i;
-					    pick_tie = MBNA_SELECT_NONE;
-					    pick_file = crossing->file_id_1;
-					    pick_section = crossing->section_1;
-					    pick_snav = section->num_snav/2;
-					    }
-
-				    iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * section->snav_lat_offset[section->num_snav/2] / mbna_mtodeglat);
-				    range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
-				    if (range < rangemin)
-					    {
-					    rangemin = range;
-					    pick_crossing = i;
-					    pick_tie = MBNA_SELECT_NONE;
-					    pick_file = crossing->file_id_1;
-					    pick_section = crossing->section_1;
-					    pick_snav = section->num_snav/2;
-					    }
-
-				    iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * section->snav_z_offset[section->num_snav/2]);
-				    range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
-				    if (range < rangemin)
-					    {
-					    rangemin = range;
-					    pick_crossing = i;
-					    pick_tie = MBNA_SELECT_NONE;
-					    pick_file = crossing->file_id_1;
-					    pick_section = crossing->section_1;
-					    pick_snav = section->num_snav/2;
-					    }
-
-				    /* handle second snav point */
-				    file = &project.files[crossing->file_id_2];
-				    section = &file->sections[crossing->section_2];
-
-				    iping = section->modelplot_start_count + section->snav_id[section->num_snav/2];
-				    ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
-
-				    iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * section->snav_lon_offset[section->num_snav/2] / mbna_mtodeglon);
-				    range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
-				    if (range < rangemin)
-					    {
-					    rangemin = range;
-					    pick_crossing = i;
-					    pick_tie = MBNA_SELECT_NONE;
-					    pick_file = crossing->file_id_2;
-					    pick_section = crossing->section_2;
-					    pick_snav = section->num_snav/2;
-					    }
-
-				    iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * section->snav_lat_offset[section->num_snav/2] / mbna_mtodeglat);
-				    range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
-				    if (range < rangemin)
-					    {
-					    rangemin = range;
-					    pick_crossing = i;
-					    pick_tie = MBNA_SELECT_NONE;
-					    pick_file = crossing->file_id_2;
-					    pick_section = crossing->section_2;
-					    pick_snav = section->num_snav/2;
-					    }
-
-				    iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * section->snav_z_offset[section->num_snav/2]);
-				    range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
-				    if (range < rangemin)
-					    {
-					    rangemin = range;
-					    pick_crossing = i;
-					    pick_tie = MBNA_SELECT_NONE;
-					    pick_file = crossing->file_id_2;
-					    pick_section = crossing->section_2;
-					    pick_snav = section->num_snav/2;
-					    }
-				    }
-				}
-
-			    /* deal with successful pick */
-			    if (rangemin < 10000000)
-				{
-				mbna_crossing_select = pick_crossing;
-				mbna_tie_select = MBNA_SELECT_NONE;
-				mbna_modelplot_pickfile = MBNA_SELECT_NONE;
-				mbna_modelplot_picksection = MBNA_SELECT_NONE;
-				mbna_modelplot_picksnav = MBNA_SELECT_NONE;
-
-				/* bring up naverr window if required */
-				if (mbna_naverr_load == MB_NO)
-				    {
-				    do_naverr_init();
-				    }
-
-				/* else if naverr window is up, load selected crossing */
-				else
-				    {
-				    mbnavadjust_naverr_specific(mbna_crossing_select, mbna_tie_select);
-				    mbnavadjust_naverr_plot(MBNA_PLOT_MODE_FIRST);
-				    do_update_naverr();
-				    do_update_status();
-				    }
-				}
-			    }
-			}
-
-		/* middle pick for perturbation plot is either choosing one of multiple available
-			ties from a tied crossing (left button) pick, or if that is not the
-			situation, picking the nearest untied crossing */
-		else if (project.modelplot_style == MBNA_MODELPLOT_PERTURBATION)
-			{
-			/* first snav pick had multiple ties - now pick which one to use */
-			if (mbna_modelplot_pickfile != MBNA_SELECT_NONE)
-			    {
-			    rangemin = 10000000;
-
-			    for (i=0;i<project.num_crossings;i++)
-				{
-				/* check if this crossing includes the picked snav */
-				crossing = &(project.crossings[i]);
-
-				/* check first snav */
-				if (crossing->file_id_1 == mbna_modelplot_pickfile
-					&& crossing->section_1 == mbna_modelplot_picksection)
-				    {
-				    /* loop over the ties */
-				    for (j=0;j<crossing->num_ties;j++)
-					{
-					tie = &(crossing->ties[j]);
-					if (tie->snav_1 == mbna_modelplot_picksnav)
-					    {
-					    file = &project.files[crossing->file_id_2];
-					    section = &file->sections[crossing->section_2];
-					    iping = section->modelplot_start_count + section->snav_id[tie->snav_2];
-					    ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
-
-					    iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * (section->snav_lon_offset[tie->snav_2] / mbna_mtodeglon - file->block_offset_x));
-					    range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
-					    if (range < rangemin)
-						    {
-						    rangemin = range;
-						    pick_crossing = i;
-						    pick_tie = j;
-						    pick_file = crossing->file_id_2;
-						    pick_section = crossing->section_2;
-						    pick_snav = tie->snav_2;
-						    }
-	/*fprintf(stderr,"range:%d rangemin:%d\n",range,rangemin);*/
-
-					    iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * (section->snav_lat_offset[tie->snav_2] / mbna_mtodeglat - file->block_offset_y));
-					    range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
-					    if (range < rangemin)
-						    {
-						    rangemin = range;
-						    pick_crossing = i;
-						    pick_tie = j;
-						    pick_file = crossing->file_id_2;
-						    pick_section = crossing->section_2;
-						    pick_snav = tie->snav_2;
-						    }
-	    /*fprintf(stderr,"range:%d rangemin:%d\n",range,rangemin);*/
-
-					    iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * (section->snav_z_offset[tie->snav_2] - file->block_offset_z));
-					    range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
-					    if (range < rangemin)
-						    {
-						    rangemin = range;
-						    pick_crossing = i;
-						    pick_tie = j;
-						    pick_file = crossing->file_id_2;
-						    pick_section = crossing->section_2;
-						    pick_snav = tie->snav_2;
-						    }
-	    /*fprintf(stderr,"range:%d rangemin:%d\n",range,rangemin);*/
-					    }
-					}
-				    }
-
-				/* check second snav */
-				if (crossing->file_id_2 == mbna_modelplot_pickfile
-					&& crossing->section_2 == mbna_modelplot_picksection)
-				    {
-				    /* loop over the ties */
-				    for (j=0;j<crossing->num_ties;j++)
-					{
-					tie = &(crossing->ties[j]);
-					if (tie->snav_2 == mbna_modelplot_picksnav)
-					    {
-					    file = &project.files[crossing->file_id_1];
-					    section = &file->sections[crossing->section_1];
-					    iping = section->modelplot_start_count + section->snav_id[tie->snav_1];
-					    ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
-
-					    iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * (section->snav_lon_offset[tie->snav_1] / mbna_mtodeglon - file->block_offset_x));
-					    range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
-					    if (range < rangemin)
-						    {
-						    rangemin = range;
-						    pick_crossing = i;
-						    pick_tie = j;
-						    pick_file = crossing->file_id_1;
-						    pick_section = crossing->section_1;
-						    pick_snav = tie->snav_1;
-						    }
-	    /*fprintf(stderr,"range:%d rangemin:%d\n",range,rangemin);*/
-
-					    iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * (section->snav_lat_offset[tie->snav_1] / mbna_mtodeglat - file->block_offset_y));
-					    range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
-					    if (range < rangemin)
-						    {
-						    rangemin = range;
-						    pick_crossing = i;
-						    pick_tie = j;
-						    pick_file = crossing->file_id_1;
-						    pick_section = crossing->section_1;
-						    pick_snav = tie->snav_1;
-						    }
-	    /*fprintf(stderr,"range:%d rangemin:%d\n",range,rangemin);*/
-
-					    iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * (section->snav_z_offset[tie->snav_1] - file->block_offset_z));
-					    range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
-					    if (range < rangemin)
-						    {
-						    rangemin = range;
-						    pick_crossing = i;
-						    pick_tie = j;
-						    pick_file = crossing->file_id_1;
-						    pick_section = crossing->section_1;
-						    pick_snav = tie->snav_1;
-						    }
-	/*fprintf(stderr,"range:%d rangemin:%d\n",range,rangemin);*/
-					    }
-					}
-				    }
-				}
-
-			    /* deal with successful pick */
-			    if (rangemin < 10000000)
-				{
-				/* select tie and open it in naverr */
-				mbna_crossing_select = pick_crossing;
-				mbna_tie_select = pick_tie;
-				mbna_modelplot_pickfile = MBNA_SELECT_NONE;
-				mbna_modelplot_picksection = MBNA_SELECT_NONE;
-				mbna_modelplot_picksnav = MBNA_SELECT_NONE;
-
-				/* bring up naverr window if required */
-				if (mbna_naverr_load == MB_NO)
-				    {
-				    do_naverr_init();
-				    }
-
-				/* else if naverr window is up, load selected crossing */
-				else
-				    {
-				    mbnavadjust_naverr_specific(mbna_crossing_select, mbna_tie_select);
-				    mbnavadjust_naverr_plot(MBNA_PLOT_MODE_FIRST);
-				    do_update_naverr();
-				    do_update_status();
-				    }
-				}
-			    }
-
-			/* else pick closest untied crossing */
-			else
-			    {
-			    rangemin = 10000000;
-
-			    /* search by looping over crossings */
-			    for (i=0;i<project.num_crossings;i++)
-				{
-				crossing = &(project.crossings[i]);
-
-				/* check only untied crossings */
-				if (crossing->num_ties == 0)
-				    {
-				    file = &project.files[crossing->file_id_1];
-				    section = &file->sections[crossing->section_1];
-
-				    iping = section->modelplot_start_count + section->snav_id[section->num_snav/2];
-				    ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
-
-				    iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * (section->snav_lon_offset[section->num_snav/2] / mbna_mtodeglon - file->block_offset_x));
-				    range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
-				    if (range < rangemin)
-					    {
-					    rangemin = range;
-					    pick_crossing = i;
-					    pick_tie = MBNA_SELECT_NONE;
-					    pick_file = crossing->file_id_1;
-					    pick_section = crossing->section_1;
-					    pick_snav = section->num_snav/2;
-					    }
-
-				    iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * (section->snav_lat_offset[section->num_snav/2] / mbna_mtodeglat - file->block_offset_y));
-				    range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
-				    if (range < rangemin)
-					    {
-					    rangemin = range;
-					    pick_crossing = i;
-					    pick_tie = MBNA_SELECT_NONE;
-					    pick_file = crossing->file_id_1;
-					    pick_section = crossing->section_1;
-					    pick_snav = section->num_snav/2;
-					    }
-
-				    iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * (section->snav_z_offset[section->num_snav/2] - file->block_offset_z));
-				    range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
-				    if (range < rangemin)
-					    {
-					    rangemin = range;
-					    pick_crossing = i;
-					    pick_tie = MBNA_SELECT_NONE;
-					    pick_file = crossing->file_id_1;
-					    pick_section = crossing->section_1;
-					    pick_snav = section->num_snav/2;
-					    }
-
-				    /* handle second snav point */
-				    file = &project.files[crossing->file_id_2];
-				    section = &file->sections[crossing->section_2];
-
-				    iping = section->modelplot_start_count + section->snav_id[section->num_snav/2];
-				    ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
-
-				    iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * (section->snav_lon_offset[section->num_snav/2] / mbna_mtodeglon - file->block_offset_x));
-				    range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
-				    if (range < rangemin)
-					    {
-					    rangemin = range;
-					    pick_crossing = i;
-					    pick_tie = MBNA_SELECT_NONE;
-					    pick_file = crossing->file_id_2;
-					    pick_section = crossing->section_2;
-					    pick_snav = section->num_snav/2;
-					    }
-
-				    iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * (section->snav_lat_offset[section->num_snav/2] / mbna_mtodeglat - file->block_offset_y));
-				    range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
-				    if (range < rangemin)
-					    {
-					    rangemin = range;
-					    pick_crossing = i;
-					    pick_tie = MBNA_SELECT_NONE;
-					    pick_file = crossing->file_id_2;
-					    pick_section = crossing->section_2;
-					    pick_snav = section->num_snav/2;
-					    }
-
-				    iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * (section->snav_z_offset[section->num_snav/2] - file->block_offset_z));
-				    range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
-				    if (range < rangemin)
-					    {
-					    rangemin = range;
-					    pick_crossing = i;
-					    pick_tie = MBNA_SELECT_NONE;
-					    pick_file = crossing->file_id_2;
-					    pick_section = crossing->section_2;
-					    pick_snav = section->num_snav/2;
-					    }
-				    }
-				}
-
-			    /* deal with successful pick */
-			    if (rangemin < 10000000)
-				{
-				mbna_crossing_select = pick_crossing;
-				mbna_tie_select = MBNA_SELECT_NONE;
-				mbna_modelplot_pickfile = MBNA_SELECT_NONE;
-				mbna_modelplot_picksection = MBNA_SELECT_NONE;
-				mbna_modelplot_picksnav = MBNA_SELECT_NONE;
-
-				/* bring up naverr window if required */
-				if (mbna_naverr_load == MB_NO)
-				    {
-				    do_naverr_init();
-				    }
-
-				/* else if naverr window is up, load selected crossing */
-				else
-				    {
-				    mbnavadjust_naverr_specific(mbna_crossing_select, mbna_tie_select);
-				    mbnavadjust_naverr_plot(MBNA_PLOT_MODE_FIRST);
-				    do_update_naverr();
-				    do_update_status();
-				    }
-				}
-			    }
-			}
-
-		/* middle pick for tie offsets plot is choosing which survey vs survey group (block)
-			to plot by itself */
-		else
-			{
-			rangemin = 10000000;
-
-			/* search by looping over crossings */
-			for (i=0;i<project.num_crossings;i++)
-			    {
-			    crossing = &(project.crossings[i]);
-
-			    /* loop over all ties for this crossing */
-			    for (j=0;j<crossing->num_ties;j++)
-				{
-				tie = &(crossing->ties[j]);
-
-				/* handle first snav point */
-				file = &project.files[crossing->file_id_1];
-				section = &file->sections[crossing->section_1];
-
-				ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (tie->isurveyplotindex - mbna_modelplot_tiestart));
-
-				iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * tie->offset_x_m);
-				range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
-				if (range < rangemin)
-					{
-					rangemin = range;
-					pick_crossing = i;
-					pick_tie = j;
-					pick_file = crossing->file_id_1;
-					pick_section = crossing->section_1;
-					pick_snav = tie->snav_1;
-					}
-
-				iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale  * tie->offset_y_m);
-				range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
-				if (range < rangemin)
-					{
-					rangemin = range;
-					pick_crossing = i;
-					pick_tie = j;
-					pick_file = crossing->file_id_1;
-					pick_section = crossing->section_1;
-					pick_snav = tie->snav_1;
-					}
-
-				iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale  * tie->offset_z_m);
-				range = (ix - x) * (ix - x) + (iy - y) * (iy - y);
-				if (range < rangemin)
-					{
-					rangemin = range;
-					pick_crossing = i;
-					pick_tie = j;
-					pick_file = crossing->file_id_1;
-					pick_section = crossing->section_1;
-					pick_snav = tie->snav_1;
-					}
-				}
-			    }
-
-			/* deal with successful pick */
-			if (rangemin < 10000000)
-				{
-				crossing = &(project.crossings[pick_crossing]);
-				mbna_crossing_select = pick_crossing;
-				mbna_tie_select = pick_tie;
-				mbna_modelplot_pickfile = MBNA_SELECT_NONE;
-				mbna_modelplot_picksection = MBNA_SELECT_NONE;
-				mbna_modelplot_picksnav = MBNA_SELECT_NONE;
-				mbna_modelplot_blocksurvey1 = project.files[crossing->file_id_1].block;
-				mbna_modelplot_blocksurvey2 = project.files[crossing->file_id_2].block;
-				mbna_modelplot_tiezoom = MB_NO;
-
-				/* bring up naverr window if required */
-				if (mbna_naverr_load == MB_NO)
-				    {
-				    do_naverr_init();
-				    }
-
-				/* else if naverr window is up, load selected crossing */
-				else
-				    {
-				    mbnavadjust_naverr_specific(mbna_crossing_select, mbna_tie_select);
-				    mbnavadjust_naverr_plot(MBNA_PLOT_MODE_FIRST);
-				    do_update_naverr();
-				    do_update_status();
-				    }
-				}
-			}
-		}
-
-	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-
-int
-mbnavadjust_modelplot_clearblock()
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_modelplot_clearblock";
-	int	status = MB_SUCCESS;
-	struct mbna_crossing *crossing;
-	int	block1, block2;
-	int	i, j;
-/*fprintf(stderr,"Called %s\n",function_name);*/
-
- 	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
-
-	/* only proceed if model plot is active and a crossing is selected */
-    	if (project.open == MB_YES
-		&& project.modelplot == MB_YES
-		&& mbna_current_crossing != MBNA_SELECT_NONE)
-    		{
-		/* delete all ties associated with the same pair of surveys as the currently selected crossing */
-		crossing = &(project.crossings[mbna_current_crossing]);
-		block1 = project.files[crossing->file_id_1].block;
-		block2 = project.files[crossing->file_id_2].block;
-		for (i=0;i<project.num_crossings;i++)
-		    {
-		    crossing = &(project.crossings[i]);
-		    if (crossing->num_ties > 0
-		    	&& ((project.files[crossing->file_id_1].block == block1
-		    		&& project.files[crossing->file_id_2].block == block2)
-			    || (project.files[crossing->file_id_1].block == block2
-		    		&& project.files[crossing->file_id_2].block == block1)))
-			{
-			for (j=crossing->num_ties-1;j>=0;j--)
-			    {
-			    mbnavadjust_deletetie(i, j, MBNA_CROSSING_STATUS_NONE);
-			    }
-			}
-		    }
-		}
-
- 	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-
-int
-mbnavadjust_modelplot_plot()
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_modelplot_plot";
-	int	status = MB_SUCCESS;
-/*fprintf(stderr,"Called %s\n",function_name);*/
-
- 	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
-
-	/* plot model if an inversion has been performed */
-    	if (project.open == MB_YES
-    		&& project.inversion != MBNA_INVERSION_NONE
-		&& project.modelplot == MB_YES)
-    		{
-		if (project.modelplot_style == MBNA_MODELPLOT_TIMESERIES)
-			{
-			mbnavadjust_modelplot_plot_timeseries();
-			}
-		else if (project.modelplot_style == MBNA_MODELPLOT_PERTURBATION)
-			{
-			mbnavadjust_modelplot_plot_perturbation();
-			}
-		else
-			{
-			mbnavadjust_modelplot_plot_tieoffsets();
-			}
-		}
-
- 	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-
-int
-mbnavadjust_modelplot_plot_timeseries()
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_modelplot_plot_timeseries";
-	int	status = MB_SUCCESS;
-	struct mbna_file *file;
-	struct mbna_section *section;
-	struct mbna_crossing *crossing;
-	struct mbna_tie *tie;
-	double	lon_offset_min;
-	double	lon_offset_max;
-	double	lat_offset_min;
-	double	lat_offset_max;
-	double	z_offset_min;
-	double	z_offset_max;
-	double	xymax, yzmax;
-	int	plot_width;
-	int	plot_height;
-	int	first, iping;
-	char	label[STRING_MAX];
-	int	stringwidth, stringascent, stringdescent;
-	int	pixel;
-	int	ixo, iyo, ix, iy;
-	int	i, j, isnav;
-	int	imodelplot_start, imodelplot_end;
-//fprintf(stderr,"Called %s\n",function_name);
-
- 	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
-
-	/* plot model if an inversion has been performed */
-    	if (project.open == MB_YES
-    		&& project.inversion != MBNA_INVERSION_NONE
-		&& project.modelplot == MB_YES)
-    		{
-		/* first loop over files setting all plot flags off for both files and sections */
-		first = MB_YES;
-		mbna_modelplot_count = 0;
- 		for (i=0;i<project.num_files;i++)
-			{
-			file = &project.files[i];
-			file->show_in_modelplot = MB_NO;
-			for (j=0;j<file->num_sections;j++)
-				{
-				section = &file->sections[j];
-				section->show_in_modelplot = MB_NO;
-				}
-			}
-
-		/* now loop over files setting file or section plot flags on as necessary */
- 		for (i=0;i<project.num_files;i++)
-			{
-			file = &project.files[i];
-
-			/* check if this file will be plotted */
-			if (mbna_view_mode == MBNA_VIEW_MODE_SURVEY || mbna_view_mode == MBNA_VIEW_MODE_WITHSURVEY)
-				{
-				if (file->block == mbna_survey_select)
-					{
-					file->show_in_modelplot = MB_YES;
-					}
-				}
-
-			/* check if this file will be plotted */
-			else if (mbna_view_mode == MBNA_VIEW_MODE_FILE || mbna_view_mode == MBNA_VIEW_MODE_WITHFILE)
-				{
-				if (i == mbna_file_select)
-					{
-					file->show_in_modelplot = MB_YES;
-					}
-				}
-
-			/* check if each section in this file will be plotted */
-			else if (mbna_view_mode == MBNA_VIEW_MODE_WITHSECTION)
-				{
-				for (j=0;j<file->num_sections;j++)
-					{
-					section = &file->sections[j];
-					if (i == mbna_file_select && j == mbna_section_select)
-						{
-						section->show_in_modelplot = MB_YES;
-						}
-					}
-				}
-
-			/* else every file will be plotted */
-			else if (mbna_view_mode == MBNA_VIEW_MODE_ALL)
-				{
-				file->show_in_modelplot = MB_YES;
-				}
-			}
-
-		/* if view mode is with survey loop over all crossings */
-		if (mbna_view_mode == MBNA_VIEW_MODE_WITHSURVEY)
-			{
-			for (i=0;i<project.num_crossings;i++)
-				{
-				crossing = &(project.crossings[i]);
-
-				/* if either file is part of the selected survey
-					then set plot flags on for both files */
-				if (project.files[crossing->file_id_1].block == mbna_survey_select
-				    || project.files[crossing->file_id_2].block == mbna_survey_select)
-					{
-					project.files[crossing->file_id_1].show_in_modelplot = MB_YES;
-					project.files[crossing->file_id_2].show_in_modelplot = MB_YES;
-					}
-				}
-			}
-
-		/* else if view mode is with file loop over all crossings */
-		else if (mbna_view_mode == MBNA_VIEW_MODE_WITHFILE)
-			{
-			for (i=0;i<project.num_crossings;i++)
-				{
-				crossing = &(project.crossings[i]);
-
-				/* if either file is selected
-					then set plot flags on for both files */
-				if (crossing->file_id_1 == mbna_file_select || crossing->file_id_2 == mbna_file_select)
-					{
-					project.files[crossing->file_id_1].show_in_modelplot = MB_YES;
-					project.files[crossing->file_id_2].show_in_modelplot = MB_YES;
-					}
-				}
-			}
-
-		/* else if view mode is with section loop over all crossings */
-		else if (mbna_view_mode == MBNA_VIEW_MODE_WITHSECTION)
-			{
-			for (i=0;i<project.num_crossings;i++)
-				{
-				crossing = &(project.crossings[i]);
-
-				/* if either section is selected
-					then set plot flags on for both files */
-				if ((crossing->file_id_1 == mbna_file_select && crossing->section_1 == mbna_section_select)
-				    || (crossing->file_id_2 == mbna_file_select && crossing->section_2 == mbna_section_select))
-					{
-					project.files[crossing->file_id_1].show_in_modelplot = MB_YES;
-					project.files[crossing->file_id_2].show_in_modelplot = MB_YES;
-					}
-				}
-			}
-
-		/* finally loop over files again setting all section plot flags on for files with plot flags on */
- 		for (i=0;i<project.num_files;i++)
-			{
-			file = &project.files[i];
-			if (file->show_in_modelplot == MB_YES)
-				{
-				for (j=0;j<file->num_sections;j++)
-					{
-					section = &file->sections[j];
-					section->show_in_modelplot = MB_YES;
-					}
-				}
-			}
-
-
-		/* get min maxes by looping over files and sections checking for sections to be plotted */
-		first = MB_YES;
-		mbna_modelplot_count = 0;
- 		for (i=0;i<project.num_files;i++)
-			{
-			file = &project.files[i];
-			for (j=0;j<file->num_sections;j++)
-				{
-				section = &file->sections[j];
-
-				/* if this section will be plotted use the snav values */
-				if (section->show_in_modelplot == MB_YES)
-					{
-					section->modelplot_start_count = mbna_modelplot_count;
-					for (isnav=0;isnav<section->num_snav;isnav++)
-						{
-						if (mbna_modelplot_zoom == MB_NO
-						    || (mbna_modelplot_count >= mbna_modelplot_startzoom && mbna_modelplot_count <= mbna_modelplot_endzoom))
-						    {
-							if (first == MB_YES)
-								{
-								lon_offset_min = section->snav_lon_offset[isnav] / mbna_mtodeglon;
-								lon_offset_max = section->snav_lon_offset[isnav] / mbna_mtodeglon;
-								lat_offset_min = section->snav_lat_offset[isnav] / mbna_mtodeglat;
-								lat_offset_max = section->snav_lat_offset[isnav] / mbna_mtodeglat;
-								z_offset_min = section->snav_z_offset[isnav];
-								z_offset_max = section->snav_z_offset[isnav];
-								first = MB_NO;
-								}
-							else
-								{
-								lon_offset_min = MIN(lon_offset_min, section->snav_lon_offset[isnav] / mbna_mtodeglon);
-								lon_offset_max = MAX(lon_offset_max, section->snav_lon_offset[isnav] / mbna_mtodeglon);
-								lat_offset_min = MIN(lat_offset_min, section->snav_lat_offset[isnav] / mbna_mtodeglat);
-								lat_offset_max = MAX(lat_offset_max, section->snav_lat_offset[isnav] / mbna_mtodeglat);
-								z_offset_min = MIN(z_offset_min, section->snav_z_offset[isnav]);
-								z_offset_max = MAX(z_offset_max, section->snav_z_offset[isnav]);
-								}
-							}
-						}
-					mbna_modelplot_count += section->snav_id[section->num_snav-1];
-					}
-				}
-			}
-
-		/* set plot bounds */
-		if (mbna_modelplot_zoom == MB_YES)
-			{
-			mbna_modelplot_start = mbna_modelplot_startzoom;
-			mbna_modelplot_end = mbna_modelplot_endzoom;
-			}
-		else
-			{
-			mbna_modelplot_start = 0;
-			mbna_modelplot_end = mbna_modelplot_count - 1;
-			}
-
-		/* get scaling */
-		plot_width = mbna_modelplot_width - 8 * MBNA_MODELPLOT_X_SPACE;
-		plot_height = (mbna_modelplot_height - 4 * MBNA_MODELPLOT_Y_SPACE) / 3;
-		mbna_modelplot_xo = 5 * MBNA_MODELPLOT_X_SPACE;
-		mbna_modelplot_yo_lon = MBNA_MODELPLOT_Y_SPACE + plot_height / 2;
-		mbna_modelplot_yo_lat = 2 * MBNA_MODELPLOT_Y_SPACE + 3 * plot_height / 2;
-		mbna_modelplot_yo_z = 3 * MBNA_MODELPLOT_Y_SPACE + 5 * plot_height / 2;
-		xymax = MAX(fabs(lon_offset_min),fabs(lon_offset_max));
-		xymax = MAX(fabs(lat_offset_min),xymax);
-		xymax = MAX(fabs(lat_offset_max),xymax);
-		mbna_modelplot_xscale = ((double)plot_width) / (mbna_modelplot_end - mbna_modelplot_start + 1);
-		mbna_modelplot_yscale = ((double)plot_height) / (2.2 * xymax);
-		yzmax = MAX(fabs(z_offset_min),fabs(z_offset_max));
-		yzmax = MAX(yzmax,0.5);
-		mbna_modelplot_yzscale = ((double)plot_height) / (2.2 * yzmax);
-
-		/* clear screens for first plot */
-		xg_fillrectangle(pmodp_xgid, 0, 0,
-				modp_borders[1], modp_borders[3],
-				pixel_values[mbna_color_background], XG_SOLIDLINE);
-
-		/* plot the bounds */
-		xg_drawrectangle(pmodp_xgid, mbna_modelplot_xo, mbna_modelplot_yo_lon - plot_height / 2, plot_width, plot_height, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-		xg_drawline(pmodp_xgid, mbna_modelplot_xo, mbna_modelplot_yo_lon, mbna_modelplot_xo + plot_width, mbna_modelplot_yo_lon, pixel_values[mbna_color_foreground], XG_DASHLINE);
-		xg_drawrectangle(pmodp_xgid, mbna_modelplot_xo, mbna_modelplot_yo_lat - plot_height / 2, plot_width, plot_height, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-		xg_drawline(pmodp_xgid, mbna_modelplot_xo, mbna_modelplot_yo_lat, mbna_modelplot_xo + plot_width, mbna_modelplot_yo_lat, pixel_values[mbna_color_foreground], XG_DASHLINE);
-		xg_drawrectangle(pmodp_xgid, mbna_modelplot_xo, mbna_modelplot_yo_z - plot_height / 2, plot_width, plot_height, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-		xg_drawline(pmodp_xgid, mbna_modelplot_xo, mbna_modelplot_yo_z, mbna_modelplot_xo + plot_width, mbna_modelplot_yo_z, pixel_values[mbna_color_foreground], XG_DASHLINE);
-
-		/* plot title */
-		if (mbna_view_mode == MBNA_VIEW_MODE_SURVEY)
-			{
-			sprintf(label, "Display Only Selected Survey - Selected Survey:%d", mbna_survey_select);
-			}
-		else if (mbna_view_mode == MBNA_VIEW_MODE_FILE)
-			{
-			sprintf(label, "Display Only Selected File - Selected Survey/File:%d/%d", mbna_survey_select, mbna_file_select);
-			}
-		else if (mbna_view_mode == MBNA_VIEW_MODE_WITHSURVEY)
-			{
-			sprintf(label, "Display With Selected Survey - Selected Survey:%d", mbna_survey_select);
-			}
-		else if (mbna_view_mode == MBNA_VIEW_MODE_WITHFILE)
-			{
-			sprintf(label, "Display With Selected File - Selected Survey/File:%d/%d", mbna_survey_select, mbna_file_select);
-			}
-		else if (mbna_view_mode == MBNA_VIEW_MODE_WITHSECTION)
-			{
-			sprintf(label, "Display With Selected Section: Selected Survey/File/Section:%d/%d/%d",
-				mbna_survey_select, mbna_file_select, mbna_section_select);
-			}
-		else if (mbna_view_mode == MBNA_VIEW_MODE_ALL)
-			{
-			sprintf(label, "Display All Data");
-			}
-
-		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
-		ix = mbna_modelplot_xo + (plot_width - stringwidth) / 2;
-		iy = MBNA_MODELPLOT_Y_SPACE - 2 * stringascent;
-		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-
-		/* plot labels */
-		sprintf(label, "East-West Offset (meters) vs. Ping Count");
-		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
-		ix = mbna_modelplot_xo + (plot_width - stringwidth) / 2;
-		iy = mbna_modelplot_yo_lon - plot_height / 2 - stringascent / 4;
-		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-
-		sprintf(label,"%d", mbna_modelplot_start);
-		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
-		ix = mbna_modelplot_xo - stringwidth / 2;
-		iy = mbna_modelplot_yo_lon + plot_height / 2 + 3 *stringascent / 2;
-		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-
-		sprintf(label,"%d", mbna_modelplot_end);
-		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
-		ix = mbna_modelplot_xo + plot_width - stringwidth / 2;
-		iy = mbna_modelplot_yo_lon + plot_height / 2 + 3 *stringascent / 2;
-		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-
-		sprintf(label,"%.2f", 1.1 * xymax);
-		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
-		ix = mbna_modelplot_xo - stringwidth - stringascent / 4;
-		iy = mbna_modelplot_yo_lon - plot_height / 2 + stringascent / 2;
-		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-
-		sprintf(label,"%.2f", 0.0);
-		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
-		ix = mbna_modelplot_xo - stringwidth - stringascent / 4;
-		iy = mbna_modelplot_yo_lon + stringascent / 2;
-		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-
-		sprintf(label,"%.2f", -1.1 * xymax);
-		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
-		ix = mbna_modelplot_xo - stringwidth - stringascent / 4;
-		iy = mbna_modelplot_yo_lon + plot_height / 2 + stringascent / 2;
-		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-
-
-		sprintf(label, "North-South Offset (meters) vs. Ping Count");
-		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
-		ix = mbna_modelplot_xo + (plot_width - stringwidth) / 2;
-		iy = mbna_modelplot_yo_lat - plot_height / 2 - stringascent / 4;
-		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-
-		sprintf(label,"%d", mbna_modelplot_start);
-		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
-		ix = mbna_modelplot_xo - stringwidth / 2;
-		iy = mbna_modelplot_yo_lat + plot_height / 2 + 3 *stringascent / 2;
-		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-
-		sprintf(label,"%d", mbna_modelplot_end);
-		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
-		ix = mbna_modelplot_xo + plot_width - stringwidth / 2;
-		iy = mbna_modelplot_yo_lat + plot_height / 2 + 3 *stringascent / 2;
-		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-
-		sprintf(label,"%.2f", 1.1 * xymax);
-		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
-		ix = mbna_modelplot_xo - stringwidth - stringascent / 4;
-		iy = mbna_modelplot_yo_lat - plot_height / 2 + stringascent / 2;
-		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-
-		sprintf(label,"%.2f", 0.0);
-		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
-		ix = mbna_modelplot_xo - stringwidth - stringascent / 4;
-		iy = mbna_modelplot_yo_lat + stringascent / 2;
-		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-
-		sprintf(label,"%.2f", -1.1 * xymax);
-		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
-		ix = mbna_modelplot_xo - stringwidth - stringascent / 4;
-		iy = mbna_modelplot_yo_lat + plot_height / 2 + stringascent / 2;
-		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-
-
-		sprintf(label, "Vertical Offset (meters) vs. Ping Count");
-		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
-		ix = mbna_modelplot_xo + (plot_width - stringwidth) / 2;
-		iy = mbna_modelplot_yo_z - plot_height / 2 - stringascent / 4;
-		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-
-		sprintf(label,"%d", mbna_modelplot_start);
-		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
-		ix = mbna_modelplot_xo - stringwidth / 2;
-		iy = mbna_modelplot_yo_z + plot_height / 2 + 3 *stringascent / 2;
-		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-
-		sprintf(label,"%d", mbna_modelplot_end);
-		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
-		ix = mbna_modelplot_xo + plot_width - stringwidth / 2;
-		iy = mbna_modelplot_yo_z + plot_height / 2 + 3 *stringascent / 2;
-		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-
-		sprintf(label,"%.2f", 1.1 * yzmax);
-		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
-		ix = mbna_modelplot_xo - stringwidth - stringascent / 4;
-		iy = mbna_modelplot_yo_z - plot_height / 2 + stringascent / 2;
-		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-
-		sprintf(label,"%.2f", 0.0);
-		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
-		ix = mbna_modelplot_xo - stringwidth - stringascent / 4;
-		iy = mbna_modelplot_yo_z + stringascent / 2;
-		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-
-		sprintf(label,"%.2f", -1.1 * yzmax);
-		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
-		ix = mbna_modelplot_xo - stringwidth - stringascent / 4;
-		iy = mbna_modelplot_yo_z + plot_height / 2 + stringascent / 2;
-		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-
-		/* set clipping */
-		xg_setclip(pmodp_xgid, mbna_modelplot_xo, 0, plot_width, mbna_modelplot_height);
-
-		/* loop over all crossings and plot and plot those without ties in green */
-		for (i=0;i<project.num_crossings;i++)
-		    {
-		    crossing = &(project.crossings[i]);
-		    if (crossing->num_ties== 0)
-		    	{
-			file = &project.files[crossing->file_id_1];
-			section = &file->sections[crossing->section_1];
-			iping = section->modelplot_start_count + section->snav_id[section->num_snav/2];
-
-			if (section->show_in_modelplot == MB_YES
-			    && (mbna_modelplot_zoom == MB_NO
-				|| (iping >= mbna_modelplot_startzoom && iping <= mbna_modelplot_endzoom)))
-				{
-				ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
-				iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * section->snav_lon_offset[section->num_snav/2] / mbna_mtodeglon);
-				xg_drawrectangle(pmodp_xgid, ix-3, iy-1, 3, 3, pixel_values[GREEN], XG_SOLIDLINE);
-				iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * section->snav_lat_offset[section->num_snav/2] / mbna_mtodeglat);
-				xg_drawrectangle(pmodp_xgid, ix-3, iy-1, 3, 3, pixel_values[GREEN], XG_SOLIDLINE);
-				iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * section->snav_z_offset[section->num_snav/2]);
-				xg_drawrectangle(pmodp_xgid, ix-3, iy-1, 3, 3, pixel_values[GREEN], XG_SOLIDLINE);
-				}
-
-			file = &project.files[crossing->file_id_2];
-			section = &file->sections[crossing->section_2];
-			iping = section->modelplot_start_count + section->snav_id[section->num_snav/2];
-
-			if (section->show_in_modelplot == MB_YES
-			    && (mbna_modelplot_zoom == MB_NO
-				|| (iping >= mbna_modelplot_startzoom && iping <= mbna_modelplot_endzoom)))
-				{
-				ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
-				iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * section->snav_lon_offset[section->num_snav/2] / mbna_mtodeglon);
-				xg_drawrectangle(pmodp_xgid, ix-3, iy-1, 3, 3, pixel_values[GREEN], XG_SOLIDLINE);
-				iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * section->snav_lat_offset[section->num_snav/2] / mbna_mtodeglat);
-				xg_drawrectangle(pmodp_xgid, ix-3, iy-1, 3, 3, pixel_values[GREEN], XG_SOLIDLINE);
-				iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * section->snav_z_offset[section->num_snav/2]);
-				xg_drawrectangle(pmodp_xgid, ix-3, iy-1, 3, 3, pixel_values[GREEN], XG_SOLIDLINE);
-				}
-			}
-		    }
-
-		/* Now plot the east-west offsets */
-		ixo = 0;
-		iyo = 0;
- 		for (i=0;i<project.num_files;i++)
-		    {
-		    file = &project.files[i];
-		    for (j=0;j<file->num_sections;j++)
-			{
-			section = &file->sections[j];
-			if (section->show_in_modelplot == MB_YES)
-				{
-				for (isnav=0;isnav<section->num_snav;isnav++)
-				    {
-				    iping = section->modelplot_start_count + section->snav_id[isnav];
-				    ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
-				    iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * section->snav_lon_offset[isnav] / mbna_mtodeglon);
-				    if ((i > 0 || j > 0) && section->continuity == MB_NO && isnav == 0)
-					xg_drawline(pmodp_xgid, ix, mbna_modelplot_yo_lon - plot_height / 2, ix, mbna_modelplot_yo_lon + plot_height / 2, pixel_values[GREEN], XG_SOLIDLINE);
-				    else if (i > 0 || j > 0)
-					{
-					/* if (j == 0 && isnav == 0 && section->continuity == MB_YES)
-						xg_drawline(pmodp_xgid, ix, mbna_modelplot_yo_lon - plot_height / 2, ix, mbna_modelplot_yo_lon + plot_height / 2, pixel_values[CORAL], XG_DASHLINE); */
-					xg_drawline(pmodp_xgid, ixo, iyo, ix, iy, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-					}
-				    ixo = ix;
-				    iyo = iy;
-				    }
-				}
-			}
-		    }
-
-		/* Now plot the north-south offsets */
-		ixo = 0;
-		iyo = 0;
- 		for (i=0;i<project.num_files;i++)
-		    {
-		    file = &project.files[i];
-		    for (j=0;j<file->num_sections;j++)
-			{
-			section = &file->sections[j];
-			if (section->show_in_modelplot == MB_YES)
-				{
-				for (isnav=0;isnav<section->num_snav;isnav++)
-				    {
-				    iping = section->modelplot_start_count + section->snav_id[isnav];
-				    ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
-				    iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * section->snav_lat_offset[isnav] / mbna_mtodeglat);
-				    if ((i > 0 || j > 0) && section->continuity == MB_NO && isnav == 0)
-					xg_drawline(pmodp_xgid, ix, mbna_modelplot_yo_lat - plot_height / 2, ix, mbna_modelplot_yo_lat + plot_height / 2, pixel_values[GREEN], XG_SOLIDLINE);
-				    else if (i > 0 || j > 0)
-					{
-					/* if (j == 0 && isnav == 0 && section->continuity == MB_YES)
-						xg_drawline(pmodp_xgid, ix, mbna_modelplot_yo_lat - plot_height / 2, ix, mbna_modelplot_yo_lat + plot_height / 2, pixel_values[CORAL], XG_DASHLINE); */
-					xg_drawline(pmodp_xgid, ixo, iyo, ix, iy, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-					}
-				    ixo = ix;
-				    iyo = iy;
-				    }
-				}
-			}
-		    }
-
-		/* Now plot the vertical offsets */
-		ixo = 0;
-		iyo = 0;
- 		for (i=0;i<project.num_files;i++)
-		    {
-		    file = &project.files[i];
-		    for (j=0;j<file->num_sections;j++)
-			{
-			section = &file->sections[j];
-			if (section->show_in_modelplot == MB_YES)
-				{
-				for (isnav=0;isnav<section->num_snav;isnav++)
-				    {
-				    iping = section->modelplot_start_count + section->snav_id[isnav];
-				    ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
-				    iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * section->snav_z_offset[isnav]);
-				    if ((i > 0 || j > 0) && section->continuity == MB_NO && isnav == 0)
-					xg_drawline(pmodp_xgid, ix, mbna_modelplot_yo_z - plot_height / 2, ix, mbna_modelplot_yo_z + plot_height / 2, pixel_values[GREEN], XG_SOLIDLINE);
-				    else if (i > 0 || j > 0)
-					{
-					/* if (j == 0 && isnav == 0 && section->continuity == MB_YES)
-						xg_drawline(pmodp_xgid, ix, mbna_modelplot_yo_z - plot_height / 2, ix, mbna_modelplot_yo_z + plot_height / 2, pixel_values[CORAL], XG_DASHLINE); */
-					xg_drawline(pmodp_xgid, ixo, iyo, ix, iy, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-					}
-				    ixo = ix;
-				    iyo = iy;
-				    }
-				}
-			}
-		    }
-
-		/* loop over all crossings and plot ties */
-		for (i=0;i<project.num_crossings;i++)
-		    {
-		    crossing = &(project.crossings[i]);
-		    for (j=0;j<crossing->num_ties;j++)
-		    	{
-			tie = &(crossing->ties[j]);
-
-			if (tie->inversion_status == MBNA_INVERSION_CURRENT)
-				pixel = pixel_values[mbna_color_foreground];
-			else
-				pixel = pixel_values[BLUE];
-
-			file = &project.files[crossing->file_id_1];
-			section = &file->sections[crossing->section_1];
-			iping = section->modelplot_start_count + section->snav_id[tie->snav_1];
-
-			if (section->show_in_modelplot == MB_YES
-			    && (mbna_modelplot_zoom == MB_NO
-				|| (iping >= mbna_modelplot_startzoom && iping <= mbna_modelplot_endzoom)))
-				{
-				ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
-				iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * section->snav_lon_offset[tie->snav_1] / mbna_mtodeglon);
-				xg_drawrectangle(pmodp_xgid, ix-2, iy-2, 5, 5, pixel, XG_SOLIDLINE);
-				iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * section->snav_lat_offset[tie->snav_1] / mbna_mtodeglat);
-				xg_drawrectangle(pmodp_xgid, ix-2, iy-2, 5, 5, pixel, XG_SOLIDLINE);
-				iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * section->snav_z_offset[tie->snav_1]);
-				xg_drawrectangle(pmodp_xgid, ix-2, iy-2, 5, 5, pixel, XG_SOLIDLINE);
-				}
-
-			file = &project.files[crossing->file_id_2];
-			section = &file->sections[crossing->section_2];
-			iping = section->modelplot_start_count + section->snav_id[tie->snav_2];
-
-			if (section->show_in_modelplot == MB_YES
-			    && (mbna_modelplot_zoom == MB_NO
-				|| (iping >= mbna_modelplot_startzoom && iping <= mbna_modelplot_endzoom)))
-				{
-				ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
-				iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * section->snav_lon_offset[tie->snav_2] / mbna_mtodeglon);
-				xg_drawrectangle(pmodp_xgid, ix-2, iy-2, 5, 5, pixel, XG_SOLIDLINE);
-				iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * section->snav_lat_offset[tie->snav_2] / mbna_mtodeglat);
-				xg_drawrectangle(pmodp_xgid, ix-2, iy-2, 5, 5, pixel, XG_SOLIDLINE);
-				iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * section->snav_z_offset[tie->snav_2]);
-				xg_drawrectangle(pmodp_xgid, ix-2, iy-2, 5, 5, pixel, XG_SOLIDLINE);
-				}
-			}
-		    }
-
-		/* Loop over all files plotting global ties */
- 		for (i=0;i<project.num_files;i++)
-		    {
-		    file = &project.files[i];
-		    for (j=0;j<file->num_sections;j++)
-			{
-			section = &file->sections[j];
-			if (section->show_in_modelplot == MB_YES && section->global_tie_status != MBNA_TIE_NONE)
-				{
-				for (isnav=0;isnav<section->num_snav;isnav++)
-				    {
-				    iping = section->modelplot_start_count + section->snav_id[section->global_tie_snav];
-				    ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
-				    
-				    if (section->global_tie_status != MBNA_TIE_Z)
-					{
-					/* east-west offsets */
-					iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * section->snav_lon_offset[section->global_tie_snav] / mbna_mtodeglon);
-					xg_drawline(pmodp_xgid, ix, mbna_modelplot_yo_lon, ix, iy, pixel_values[ORANGE], XG_SOLIDLINE);
-					xg_fillrectangle(pmodp_xgid, ix-2, iy-2, 5, 5, pixel_values[ORANGE], XG_SOLIDLINE);
-					xg_drawrectangle(pmodp_xgid, ix-2, iy-2, 5, 5, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-					
-					/* north-south offsets */
-					iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * section->snav_lat_offset[section->global_tie_snav] / mbna_mtodeglat);
-					xg_drawline(pmodp_xgid, ix, mbna_modelplot_yo_lat, ix, iy, pixel_values[ORANGE], XG_SOLIDLINE);
-					xg_fillrectangle(pmodp_xgid, ix-2, iy-2, 5, 5, pixel_values[ORANGE], XG_SOLIDLINE);
-					xg_drawrectangle(pmodp_xgid, ix-2, iy-2, 5, 5, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-					}
-				    
-				    if (section->global_tie_status != MBNA_TIE_XY)
-					{
-					/* vertical offsets */
-					iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * section->snav_z_offset[section->global_tie_snav]);
-					xg_drawline(pmodp_xgid, ix, mbna_modelplot_yo_z, ix, iy, pixel_values[ORANGE], XG_SOLIDLINE);
-					xg_fillrectangle(pmodp_xgid, ix-2, iy-2, 5, 5, pixel_values[ORANGE], XG_SOLIDLINE);
-					xg_drawrectangle(pmodp_xgid, ix-2, iy-2, 5, 5, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-					}
-				    }
-				}
-			}
-		    }
-
-		/* plot current tie in red */
-		if (mbna_current_crossing != MBNA_SELECT_NONE && mbna_current_tie != MBNA_SELECT_NONE)
-			{
-			crossing = &(project.crossings[mbna_current_crossing]);
-			tie = &(crossing->ties[mbna_current_tie]);
-
-			file = &project.files[crossing->file_id_1];
-			section = &file->sections[crossing->section_1];
-			iping = section->modelplot_start_count + section->snav_id[tie->snav_1];
-
-			if (section->show_in_modelplot == MB_YES
-			    && (mbna_modelplot_zoom == MB_NO
-				|| (iping >= mbna_modelplot_startzoom && iping <= mbna_modelplot_endzoom)))
-				{
-				ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
-				iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * section->snav_lon_offset[tie->snav_1] / mbna_mtodeglon);
-				xg_fillrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[RED], XG_SOLIDLINE);
-				xg_drawrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-				iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * section->snav_lat_offset[tie->snav_1] / mbna_mtodeglat);
-				xg_fillrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[RED], XG_SOLIDLINE);
-				xg_drawrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-				iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * section->snav_z_offset[tie->snav_1]);
-				xg_fillrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[RED], XG_SOLIDLINE);
-				xg_drawrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-				}
-
-			file = &project.files[crossing->file_id_2];
-			section = &file->sections[crossing->section_2];
-			iping = section->modelplot_start_count + section->snav_id[tie->snav_2];
-
-			if (section->show_in_modelplot == MB_YES
-			    && (mbna_modelplot_zoom == MB_NO
-				|| (iping >= mbna_modelplot_startzoom && iping <= mbna_modelplot_endzoom)))
-				{
-				ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
-				iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * section->snav_lon_offset[tie->snav_2] / mbna_mtodeglon);
-				xg_fillrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[RED], XG_SOLIDLINE);
-				xg_drawrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-				iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * section->snav_lat_offset[tie->snav_2] / mbna_mtodeglat);
-				xg_fillrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[RED], XG_SOLIDLINE);
-				xg_drawrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-				iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * section->snav_z_offset[tie->snav_2]);
-				xg_fillrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[RED], XG_SOLIDLINE);
-				xg_drawrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-				}
-			}
-
-		/* or if tie not selected then plot current crossing in red */
-		else if (mbna_current_crossing != MBNA_SELECT_NONE)
-			{
-			crossing = &(project.crossings[mbna_current_crossing]);
-
-			file = &project.files[crossing->file_id_1];
-			section = &file->sections[crossing->section_1];
-			iping = section->modelplot_start_count + section->snav_id[section->num_snav/2];
-
-			if (section->show_in_modelplot == MB_YES
-			    && (mbna_modelplot_zoom == MB_NO
-				|| (iping >= mbna_modelplot_startzoom && iping <= mbna_modelplot_endzoom)))
-				{
-				ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
-				iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * section->snav_lon_offset[section->num_snav/2] / mbna_mtodeglon);
-				xg_fillrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[RED], XG_SOLIDLINE);
-				xg_drawrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-				iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * section->snav_lat_offset[section->num_snav/2] / mbna_mtodeglat);
-				xg_fillrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[RED], XG_SOLIDLINE);
-				xg_drawrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-				iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * section->snav_z_offset[section->num_snav/2]);
-				xg_fillrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[RED], XG_SOLIDLINE);
-				xg_drawrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-				}
-
-			file = &project.files[crossing->file_id_2];
-			section = &file->sections[crossing->section_2];
-			iping = section->modelplot_start_count + section->snav_id[section->num_snav/2];
-
-			if (section->show_in_modelplot == MB_YES
-			    && (mbna_modelplot_zoom == MB_NO
-				|| (iping >= mbna_modelplot_startzoom && iping <= mbna_modelplot_endzoom)))
-				{
-				ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
-				iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * section->snav_lon_offset[section->num_snav/2] / mbna_mtodeglon);
-				xg_fillrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[RED], XG_SOLIDLINE);
-				xg_drawrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-				iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * section->snav_lat_offset[section->num_snav/2] / mbna_mtodeglat);
-				xg_fillrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[RED], XG_SOLIDLINE);
-				xg_drawrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-				iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * section->snav_z_offset[section->num_snav/2]);
-				xg_fillrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[RED], XG_SOLIDLINE);
-				xg_drawrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-				}
-			}
-
-		/* if a modelplot pick did not resolve a single tie, plot the options for a second pick */
-		if (mbna_modelplot_pickfile != MBNA_SELECT_NONE)
-			{
-			for (i=0;i<project.num_crossings;i++)
-				{
-				/* check if this crossing includes the picked snav */
-				crossing = &(project.crossings[i]);
-
-				/* check first snav */
-				if (crossing->file_id_1 == mbna_modelplot_pickfile
-					&& crossing->section_1 == mbna_modelplot_picksection)
-					{
-					/* loop over the ties */
-					for (j=0;j<crossing->num_ties;j++)
-						{
-						tie = &(crossing->ties[j]);
-						if (crossing->file_id_1 == mbna_modelplot_pickfile
-						    && crossing->section_1 == mbna_modelplot_picksection
-						    && tie->snav_1 == mbna_modelplot_picksnav)
-							{
-							file = &project.files[crossing->file_id_1];
-							section = &file->sections[crossing->section_1];
-							iping = section->modelplot_start_count + section->snav_id[tie->snav_1];
-
-							if (section->show_in_modelplot == MB_YES
-							    && (mbna_modelplot_zoom == MB_NO
-								|| (iping >= mbna_modelplot_startzoom && iping <= mbna_modelplot_endzoom)))
-								{
-								ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
-								iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * section->snav_lon_offset[tie->snav_1] / mbna_mtodeglon);
-								xg_fillrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[RED], XG_SOLIDLINE);
-								xg_drawrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-								iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * section->snav_lat_offset[tie->snav_1] / mbna_mtodeglat);
-								xg_fillrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[RED], XG_SOLIDLINE);
-								xg_drawrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-								iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * section->snav_z_offset[tie->snav_1]);
-								xg_fillrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[RED], XG_SOLIDLINE);
-								xg_drawrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-								}
-
-							file = &project.files[crossing->file_id_2];
-							section = &file->sections[crossing->section_2];
-							iping = section->modelplot_start_count + section->snav_id[tie->snav_2];
-
-							if (section->show_in_modelplot == MB_YES
-							    && (mbna_modelplot_zoom == MB_NO
-								|| (iping >= mbna_modelplot_startzoom && iping <= mbna_modelplot_endzoom)))
-								{
-								ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
-								iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * section->snav_lon_offset[tie->snav_2] / mbna_mtodeglon);
-								xg_fillrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[6], XG_SOLIDLINE);
-								xg_drawrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-								iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * section->snav_lat_offset[tie->snav_2] / mbna_mtodeglat);
-								xg_fillrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[6], XG_SOLIDLINE);
-								xg_drawrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-								iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * section->snav_z_offset[tie->snav_2]);
-								xg_fillrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[6], XG_SOLIDLINE);
-								xg_drawrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-								}
-							}
-						}
-					}
-
-				/* check second snav */
-				if (crossing->file_id_2 == mbna_modelplot_pickfile
-					&& crossing->section_2 == mbna_modelplot_picksection)
-					{
-					/* loop over the ties */
-					for (j=0;j<crossing->num_ties;j++)
-						{
-						tie = &(crossing->ties[j]);
-						if (crossing->file_id_2 == mbna_modelplot_pickfile
-						    && crossing->section_2 == mbna_modelplot_picksection
-						    && tie->snav_2 == mbna_modelplot_picksnav)
-							{
-							file = &project.files[crossing->file_id_2];
-							section = &file->sections[crossing->section_2];
-							iping = section->modelplot_start_count + section->snav_id[tie->snav_2];
-
-							if (section->show_in_modelplot == MB_YES
-							    && (mbna_modelplot_zoom == MB_NO
-								|| (iping >= mbna_modelplot_startzoom && iping <= mbna_modelplot_endzoom)))
-								{
-								ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
-								iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * section->snav_lon_offset[tie->snav_2] / mbna_mtodeglon);
-								xg_fillrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[RED], XG_SOLIDLINE);
-								xg_drawrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-								iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * section->snav_lat_offset[tie->snav_2] / mbna_mtodeglat);
-								xg_fillrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[RED], XG_SOLIDLINE);
-								xg_drawrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-								iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * section->snav_z_offset[tie->snav_2]);
-								xg_fillrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[RED], XG_SOLIDLINE);
-								xg_drawrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-								}
-
-							file = &project.files[crossing->file_id_1];
-							section = &file->sections[crossing->section_1];
-							iping = section->modelplot_start_count + section->snav_id[tie->snav_1];
-
-							if (section->show_in_modelplot == MB_YES
-							    && (mbna_modelplot_zoom == MB_NO
-								|| (iping >= mbna_modelplot_startzoom && iping <= mbna_modelplot_endzoom)))
-								{
-								ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
-								iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * section->snav_lon_offset[tie->snav_1] / mbna_mtodeglon);
-								xg_fillrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[6], XG_SOLIDLINE);
-								xg_drawrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-								iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * section->snav_lat_offset[tie->snav_1] / mbna_mtodeglat);
-								xg_fillrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[6], XG_SOLIDLINE);
-								xg_drawrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-								iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * section->snav_z_offset[tie->snav_1]);
-								xg_fillrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[6], XG_SOLIDLINE);
-								xg_drawrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-								}
-							}
-						}
-					}
-				}
-			}
-
-		/* plot zoom if active */
-		if (mbna_modelplot_zoom_x1 != 0 || mbna_modelplot_zoom_x2 != 0)
-			{
-			imodelplot_start = (MIN(mbna_modelplot_zoom_x1, mbna_modelplot_zoom_x2) - mbna_modelplot_xo) / mbna_modelplot_xscale + mbna_modelplot_start;
-			imodelplot_start = MIN(MAX(imodelplot_start, 0), project.num_pings - 1);
-			imodelplot_end = (MAX(mbna_modelplot_zoom_x1, mbna_modelplot_zoom_x2) - mbna_modelplot_xo) / mbna_modelplot_xscale + mbna_modelplot_start;
-			imodelplot_end = MIN(MAX(imodelplot_end, 0), project.num_pings - 1);
-
-			ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (imodelplot_start - mbna_modelplot_start));
-		   	xg_drawline(pmodp_xgid, ix, mbna_modelplot_yo_lon - plot_height / 2, ix, mbna_modelplot_yo_lon + plot_height / 2, pixel_values[mbna_color_foreground], XG_DASHLINE);
-		   	xg_drawline(pmodp_xgid, ix, mbna_modelplot_yo_lat - plot_height / 2, ix, mbna_modelplot_yo_lat + plot_height / 2, pixel_values[mbna_color_foreground], XG_DASHLINE);
-		   	xg_drawline(pmodp_xgid, ix, mbna_modelplot_yo_z - plot_height / 2, ix, mbna_modelplot_yo_z + plot_height / 2, pixel_values[mbna_color_foreground], XG_DASHLINE);
-
-			ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (imodelplot_end - mbna_modelplot_start));
-		   	xg_drawline(pmodp_xgid, ix, mbna_modelplot_yo_lon - plot_height / 2, ix, mbna_modelplot_yo_lon + plot_height / 2, pixel_values[mbna_color_foreground], XG_DASHLINE);
-		   	xg_drawline(pmodp_xgid, ix, mbna_modelplot_yo_lat - plot_height / 2, ix, mbna_modelplot_yo_lat + plot_height / 2, pixel_values[mbna_color_foreground], XG_DASHLINE);
-		   	xg_drawline(pmodp_xgid, ix, mbna_modelplot_yo_z - plot_height / 2, ix, mbna_modelplot_yo_z + plot_height / 2, pixel_values[mbna_color_foreground], XG_DASHLINE);
-			}
-
-		/* reset clipping */
-		xg_setclip(pmodp_xgid, 0, 0, mbna_modelplot_width, mbna_modelplot_height);
-
-		}
-
- 	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-
-int
-mbnavadjust_modelplot_plot_perturbation()
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_modelplot_plot_perturbation";
-	int	status = MB_SUCCESS;
-	struct mbna_file *file;
-	struct mbna_section *section;
-	struct mbna_crossing *crossing;
-	struct mbna_tie *tie;
-	double	lon_offset_min;
-	double	lon_offset_max;
-	double	lat_offset_min;
-	double	lat_offset_max;
-	double	z_offset_min;
-	double	z_offset_max;
-	double	xymax, yzmax;
-	int	plot_width;
-	int	plot_height;
-	int	first, iping;
-	char	label[STRING_MAX];
-	int	stringwidth, stringascent, stringdescent;
-	int	pixel;
-	int	ixo, iyo, ix, iy;
-	int	i, j, isnav;
-	int	imodelplot_start, imodelplot_end;
-//fprintf(stderr,"Called %s\n",function_name);
-
- 	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
-
-	/* plot model if an inversion has been performed */
-    	if (project.open == MB_YES
-    		&& project.inversion != MBNA_INVERSION_NONE
-		&& project.modelplot == MB_YES)
-    		{
-		/* first loop over files setting all plot flags off for both files and sections */
-		first = MB_YES;
-		mbna_modelplot_count = 0;
- 		for (i=0;i<project.num_files;i++)
-			{
-			file = &project.files[i];
-			file->show_in_modelplot = MB_NO;
-			for (j=0;j<file->num_sections;j++)
-				{
-				section = &file->sections[j];
-				section->show_in_modelplot = MB_NO;
-				}
-			}
-
-		/* now loop over files setting file or section plot flags on as necessary */
- 		for (i=0;i<project.num_files;i++)
-			{
-			file = &project.files[i];
-
-			/* check if this file will be plotted */
-			if (mbna_view_mode == MBNA_VIEW_MODE_SURVEY || mbna_view_mode == MBNA_VIEW_MODE_WITHSURVEY)
-				{
-				if (file->block == mbna_survey_select)
-					{
-					file->show_in_modelplot = MB_YES;
-					}
-				}
-
-			/* check if this file will be plotted */
-			else if (mbna_view_mode == MBNA_VIEW_MODE_FILE || mbna_view_mode == MBNA_VIEW_MODE_WITHFILE)
-				{
-				if (i == mbna_file_select)
-					{
-					file->show_in_modelplot = MB_YES;
-					}
-				}
-
-			/* check if each section in this file will be plotted */
-			else if (mbna_view_mode == MBNA_VIEW_MODE_WITHSECTION)
-				{
-				for (j=0;j<file->num_sections;j++)
-					{
-					section = &file->sections[j];
-					if (i == mbna_file_select && j == mbna_section_select)
-						{
-						section->show_in_modelplot = MB_YES;
-						}
-					}
-				}
-
-			/* else every file will be plotted */
-			else if (mbna_view_mode == MBNA_VIEW_MODE_ALL)
-				{
-				file->show_in_modelplot = MB_YES;
-				}
-			}
-
-		/* if view mode is with survey loop over all crossings */
-		if (mbna_view_mode == MBNA_VIEW_MODE_WITHSURVEY)
-			{
-			for (i=0;i<project.num_crossings;i++)
-				{
-				crossing = &(project.crossings[i]);
-
-				/* if either file is part of the selected survey
-					then set plot flags on for both files */
-				if (project.files[crossing->file_id_1].block == mbna_survey_select
-				    || project.files[crossing->file_id_2].block == mbna_survey_select)
-					{
-					project.files[crossing->file_id_1].show_in_modelplot = MB_YES;
-					project.files[crossing->file_id_2].show_in_modelplot = MB_YES;
-					}
-				}
-			}
-
-		/* else if view mode is with file loop over all crossings */
-		else if (mbna_view_mode == MBNA_VIEW_MODE_WITHFILE)
-			{
-			for (i=0;i<project.num_crossings;i++)
-				{
-				crossing = &(project.crossings[i]);
-
-				/* if either file is selected
-					then set plot flags on for both files */
-				if (crossing->file_id_1 == mbna_file_select || crossing->file_id_2 == mbna_file_select)
-					{
-					project.files[crossing->file_id_1].show_in_modelplot = MB_YES;
-					project.files[crossing->file_id_2].show_in_modelplot = MB_YES;
-					}
-				}
-			}
-
-		/* else if view mode is with section loop over all crossings */
-		else if (mbna_view_mode == MBNA_VIEW_MODE_WITHSECTION)
-			{
-			for (i=0;i<project.num_crossings;i++)
-				{
-				crossing = &(project.crossings[i]);
-
-				/* if either section is selected
-					then set plot flags on for both files */
-				if ((crossing->file_id_1 == mbna_file_select && crossing->section_1 == mbna_section_select)
-				    || (crossing->file_id_2 == mbna_file_select && crossing->section_2 == mbna_section_select))
-					{
-					project.files[crossing->file_id_1].show_in_modelplot = MB_YES;
-					project.files[crossing->file_id_2].show_in_modelplot = MB_YES;
-					}
-				}
-			}
-
-		/* finally loop over files again setting all section plot flags on for files with plot flags on */
- 		for (i=0;i<project.num_files;i++)
-			{
-			file = &project.files[i];
-			if (file->show_in_modelplot == MB_YES)
-				{
-				for (j=0;j<file->num_sections;j++)
-					{
-					section = &file->sections[j];
-					section->show_in_modelplot = MB_YES;
-					}
-				}
-			}
-
-
-		/* get min maxes by looping over files and sections checking for sections to be plotted */
-		first = MB_YES;
-		mbna_modelplot_count = 0;
- 		for (i=0;i<project.num_files;i++)
-			{
-			file = &project.files[i];
-			for (j=0;j<file->num_sections;j++)
-				{
-				section = &file->sections[j];
-
-				/* if this section will be plotted use the snav values */
-				if (section->show_in_modelplot == MB_YES)
-					{
-					section->modelplot_start_count = mbna_modelplot_count;
-					for (isnav=0;isnav<section->num_snav;isnav++)
-						{
-						if (mbna_modelplot_zoom == MB_NO
-						    || (mbna_modelplot_count >= mbna_modelplot_startzoom && mbna_modelplot_count <= mbna_modelplot_endzoom))
-						    {
-							if (first == MB_YES)
-								{
-								lon_offset_min = section->snav_lon_offset[isnav] / mbna_mtodeglon - file->block_offset_x;
-								lon_offset_max = section->snav_lon_offset[isnav] / mbna_mtodeglon - file->block_offset_x;
-								lat_offset_min = section->snav_lat_offset[isnav] / mbna_mtodeglat - file->block_offset_y;
-								lat_offset_max = section->snav_lat_offset[isnav] / mbna_mtodeglat - file->block_offset_y;
-								z_offset_min = section->snav_z_offset[isnav] - file->block_offset_z;
-								z_offset_max = section->snav_z_offset[isnav] - file->block_offset_z;
-								first = MB_NO;
-								}
-							else
-								{
-								lon_offset_min = MIN(lon_offset_min, section->snav_lon_offset[isnav] / mbna_mtodeglon - file->block_offset_x);
-								lon_offset_max = MAX(lon_offset_max, section->snav_lon_offset[isnav] / mbna_mtodeglon - file->block_offset_x);
-								lat_offset_min = MIN(lat_offset_min, section->snav_lat_offset[isnav] / mbna_mtodeglat - file->block_offset_y);
-								lat_offset_max = MAX(lat_offset_max, section->snav_lat_offset[isnav] / mbna_mtodeglat - file->block_offset_y);
-								z_offset_min = MIN(z_offset_min, section->snav_z_offset[isnav] - file->block_offset_z);
-								z_offset_max = MAX(z_offset_max, section->snav_z_offset[isnav] - file->block_offset_z);
-								}
-							}
-						}
-					mbna_modelplot_count += section->snav_id[section->num_snav-1];
-					}
-				}
-			}
-
-		/* set plot bounds */
-		if (mbna_modelplot_zoom == MB_YES)
-			{
-			mbna_modelplot_start = mbna_modelplot_startzoom;
-			mbna_modelplot_end = mbna_modelplot_endzoom;
-			}
-		else
-			{
-			mbna_modelplot_start = 0;
-			mbna_modelplot_end = mbna_modelplot_count - 1;
-			}
-
-		/* get scaling */
-		plot_width = mbna_modelplot_width - 8 * MBNA_MODELPLOT_X_SPACE;
-		plot_height = (mbna_modelplot_height - 4 * MBNA_MODELPLOT_Y_SPACE) / 3;
-		mbna_modelplot_xo = 5 * MBNA_MODELPLOT_X_SPACE;
-		mbna_modelplot_yo_lon = MBNA_MODELPLOT_Y_SPACE + plot_height / 2;
-		mbna_modelplot_yo_lat = 2 * MBNA_MODELPLOT_Y_SPACE + 3 * plot_height / 2;
-		mbna_modelplot_yo_z = 3 * MBNA_MODELPLOT_Y_SPACE + 5 * plot_height / 2;
-		xymax = MAX(fabs(lon_offset_min),fabs(lon_offset_max));
-		xymax = MAX(fabs(lat_offset_min),xymax);
-		xymax = MAX(fabs(lat_offset_max),xymax);
-		mbna_modelplot_xscale = ((double)plot_width) / (mbna_modelplot_end - mbna_modelplot_start + 1);
-		mbna_modelplot_yscale = ((double)plot_height) / (2.2 * xymax);
-		yzmax = MAX(fabs(z_offset_min),fabs(z_offset_max));
-		yzmax = MAX(yzmax,0.5);
-		mbna_modelplot_yzscale = ((double)plot_height) / (2.2 * yzmax);
-
-		/* clear screens for first plot */
-		xg_fillrectangle(pmodp_xgid, 0, 0,
-				modp_borders[1], modp_borders[3],
-				pixel_values[mbna_color_background], XG_SOLIDLINE);
-
-		/* plot the bounds */
-		xg_drawrectangle(pmodp_xgid, mbna_modelplot_xo, mbna_modelplot_yo_lon - plot_height / 2, plot_width, plot_height, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-		xg_drawline(pmodp_xgid, mbna_modelplot_xo, mbna_modelplot_yo_lon, mbna_modelplot_xo + plot_width, mbna_modelplot_yo_lon, pixel_values[mbna_color_foreground], XG_DASHLINE);
-		xg_drawrectangle(pmodp_xgid, mbna_modelplot_xo, mbna_modelplot_yo_lat - plot_height / 2, plot_width, plot_height, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-		xg_drawline(pmodp_xgid, mbna_modelplot_xo, mbna_modelplot_yo_lat, mbna_modelplot_xo + plot_width, mbna_modelplot_yo_lat, pixel_values[mbna_color_foreground], XG_DASHLINE);
-		xg_drawrectangle(pmodp_xgid, mbna_modelplot_xo, mbna_modelplot_yo_z - plot_height / 2, plot_width, plot_height, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-		xg_drawline(pmodp_xgid, mbna_modelplot_xo, mbna_modelplot_yo_z, mbna_modelplot_xo + plot_width, mbna_modelplot_yo_z, pixel_values[mbna_color_foreground], XG_DASHLINE);
-
-		/* plot title */
-		if (mbna_view_mode == MBNA_VIEW_MODE_SURVEY)
-			{
-			sprintf(label, "Display Only Selected Survey - Selected Survey:%d", mbna_survey_select);
-			}
-		else if (mbna_view_mode == MBNA_VIEW_MODE_FILE)
-			{
-			sprintf(label, "Display Only Selected File - Selected Survey/File:%d/%d", mbna_survey_select, mbna_file_select);
-			}
-		else if (mbna_view_mode == MBNA_VIEW_MODE_WITHSURVEY)
-			{
-			sprintf(label, "Display With Selected Survey - Selected Survey:%d", mbna_survey_select);
-			}
-		else if (mbna_view_mode == MBNA_VIEW_MODE_WITHFILE)
-			{
-			sprintf(label, "Display With Selected File - Selected Survey/File:%d/%d", mbna_survey_select, mbna_file_select);
-			}
-		else if (mbna_view_mode == MBNA_VIEW_MODE_WITHSECTION)
-			{
-			sprintf(label, "Display With Selected Section: Selected Survey/File/Section:%d/%d/%d",
-				mbna_survey_select, mbna_file_select, mbna_section_select);
-			}
-		else if (mbna_view_mode == MBNA_VIEW_MODE_ALL)
-			{
-			sprintf(label, "Display All Data");
-			}
-
-		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
-		ix = mbna_modelplot_xo + (plot_width - stringwidth) / 2;
-		iy = MBNA_MODELPLOT_Y_SPACE - 2 * stringascent;
-		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-
-		/* plot labels */
-		sprintf(label, "East-West Offset (meters) vs. Ping Count");
-		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
-		ix = mbna_modelplot_xo + (plot_width - stringwidth) / 2;
-		iy = mbna_modelplot_yo_lon - plot_height / 2 - stringascent / 4;
-		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-
-		sprintf(label,"%d", mbna_modelplot_start);
-		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
-		ix = mbna_modelplot_xo - stringwidth / 2;
-		iy = mbna_modelplot_yo_lon + plot_height / 2 + 3 *stringascent / 2;
-		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-
-		sprintf(label,"%d", mbna_modelplot_end);
-		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
-		ix = mbna_modelplot_xo + plot_width - stringwidth / 2;
-		iy = mbna_modelplot_yo_lon + plot_height / 2 + 3 *stringascent / 2;
-		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-
-		sprintf(label,"%.2f", 1.1 * xymax);
-		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
-		ix = mbna_modelplot_xo - stringwidth - stringascent / 4;
-		iy = mbna_modelplot_yo_lon - plot_height / 2 + stringascent / 2;
-		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-
-		sprintf(label,"%.2f", 0.0);
-		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
-		ix = mbna_modelplot_xo - stringwidth - stringascent / 4;
-		iy = mbna_modelplot_yo_lon + stringascent / 2;
-		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-
-		sprintf(label,"%.2f", -1.1 * xymax);
-		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
-		ix = mbna_modelplot_xo - stringwidth - stringascent / 4;
-		iy = mbna_modelplot_yo_lon + plot_height / 2 + stringascent / 2;
-		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-
-
-		sprintf(label, "North-South Offset (meters) vs. Ping Count");
-		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
-		ix = mbna_modelplot_xo + (plot_width - stringwidth) / 2;
-		iy = mbna_modelplot_yo_lat - plot_height / 2 - stringascent / 4;
-		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-
-		sprintf(label,"%d", mbna_modelplot_start);
-		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
-		ix = mbna_modelplot_xo - stringwidth / 2;
-		iy = mbna_modelplot_yo_lat + plot_height / 2 + 3 *stringascent / 2;
-		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-
-		sprintf(label,"%d", mbna_modelplot_end);
-		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
-		ix = mbna_modelplot_xo + plot_width - stringwidth / 2;
-		iy = mbna_modelplot_yo_lat + plot_height / 2 + 3 *stringascent / 2;
-		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-
-		sprintf(label,"%.2f", 1.1 * xymax);
-		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
-		ix = mbna_modelplot_xo - stringwidth - stringascent / 4;
-		iy = mbna_modelplot_yo_lat - plot_height / 2 + stringascent / 2;
-		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-
-		sprintf(label,"%.2f", 0.0);
-		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
-		ix = mbna_modelplot_xo - stringwidth - stringascent / 4;
-		iy = mbna_modelplot_yo_lat + stringascent / 2;
-		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-
-		sprintf(label,"%.2f", -1.1 * xymax);
-		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
-		ix = mbna_modelplot_xo - stringwidth - stringascent / 4;
-		iy = mbna_modelplot_yo_lat + plot_height / 2 + stringascent / 2;
-		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-
-
-		sprintf(label, "Vertical Offset (meters) vs. Ping Count");
-		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
-		ix = mbna_modelplot_xo + (plot_width - stringwidth) / 2;
-		iy = mbna_modelplot_yo_z - plot_height / 2 - stringascent / 4;
-		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-
-		sprintf(label,"%d", mbna_modelplot_start);
-		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
-		ix = mbna_modelplot_xo - stringwidth / 2;
-		iy = mbna_modelplot_yo_z + plot_height / 2 + 3 *stringascent / 2;
-		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-
-		sprintf(label,"%d", mbna_modelplot_end);
-		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
-		ix = mbna_modelplot_xo + plot_width - stringwidth / 2;
-		iy = mbna_modelplot_yo_z + plot_height / 2 + 3 *stringascent / 2;
-		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-
-		sprintf(label,"%.2f", 1.1 * yzmax);
-		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
-		ix = mbna_modelplot_xo - stringwidth - stringascent / 4;
-		iy = mbna_modelplot_yo_z - plot_height / 2 + stringascent / 2;
-		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-
-		sprintf(label,"%.2f", 0.0);
-		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
-		ix = mbna_modelplot_xo - stringwidth - stringascent / 4;
-		iy = mbna_modelplot_yo_z + stringascent / 2;
-		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-
-		sprintf(label,"%.2f", -1.1 * yzmax);
-		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
-		ix = mbna_modelplot_xo - stringwidth - stringascent / 4;
-		iy = mbna_modelplot_yo_z + plot_height / 2 + stringascent / 2;
-		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-
-		/* set clipping */
-		xg_setclip(pmodp_xgid, mbna_modelplot_xo, 0, plot_width, mbna_modelplot_height);
-
-		/* loop over all crossings and plot and plot those without ties in green */
-		for (i=0;i<project.num_crossings;i++)
-		    {
-		    crossing = &(project.crossings[i]);
-		    if (crossing->num_ties== 0)
-		    	{
-			file = &project.files[crossing->file_id_1];
-			section = &file->sections[crossing->section_1];
-			iping = section->modelplot_start_count + section->snav_id[section->num_snav/2];
-
-			if (section->show_in_modelplot == MB_YES
-			    && (mbna_modelplot_zoom == MB_NO
-				|| (iping >= mbna_modelplot_startzoom && iping <= mbna_modelplot_endzoom)))
-				{
-				ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
-				iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * (section->snav_lon_offset[section->num_snav/2] / mbna_mtodeglon - file->block_offset_x));
-				xg_drawrectangle(pmodp_xgid, ix-3, iy-1, 3, 3, pixel_values[GREEN], XG_SOLIDLINE);
-				iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * (section->snav_lat_offset[section->num_snav/2] / mbna_mtodeglat - file->block_offset_y));
-				xg_drawrectangle(pmodp_xgid, ix-3, iy-1, 3, 3, pixel_values[GREEN], XG_SOLIDLINE);
-				iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * (section->snav_z_offset[section->num_snav/2] - file->block_offset_z));
-				xg_drawrectangle(pmodp_xgid, ix-3, iy-1, 3, 3, pixel_values[GREEN], XG_SOLIDLINE);
-				}
-
-			file = &project.files[crossing->file_id_2];
-			section = &file->sections[crossing->section_2];
-			iping = section->modelplot_start_count + section->snav_id[section->num_snav/2];
-
-			if (section->show_in_modelplot == MB_YES
-			    && (mbna_modelplot_zoom == MB_NO
-				|| (iping >= mbna_modelplot_startzoom && iping <= mbna_modelplot_endzoom)))
-				{
-				ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
-				iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * (section->snav_lon_offset[section->num_snav/2] / mbna_mtodeglon - file->block_offset_x));
-				xg_drawrectangle(pmodp_xgid, ix-3, iy-1, 3, 3, pixel_values[GREEN], XG_SOLIDLINE);
-				iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * (section->snav_lat_offset[section->num_snav/2] / mbna_mtodeglat - file->block_offset_y));
-				xg_drawrectangle(pmodp_xgid, ix-3, iy-1, 3, 3, pixel_values[GREEN], XG_SOLIDLINE);
-				iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * (section->snav_z_offset[section->num_snav/2] - file->block_offset_z));
-				xg_drawrectangle(pmodp_xgid, ix-3, iy-1, 3, 3, pixel_values[GREEN], XG_SOLIDLINE);
-				}
-			}
-		    }
-
-		/* Now plot the east-west offsets */
-		ixo = 0;
-		iyo = 0;
- 		for (i=0;i<project.num_files;i++)
-		    {
-		    file = &project.files[i];
-		    for (j=0;j<file->num_sections;j++)
-			{
-			section = &file->sections[j];
-			if (section->show_in_modelplot == MB_YES)
-				{
-				for (isnav=0;isnav<section->num_snav;isnav++)
-				    {
-				    iping = section->modelplot_start_count + section->snav_id[isnav];
-				    ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
-				    iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * (section->snav_lon_offset[isnav] / mbna_mtodeglon - file->block_offset_x));
-				    if ((i > 0 || j > 0) && section->continuity == MB_NO && isnav == 0)
-					xg_drawline(pmodp_xgid, ix, mbna_modelplot_yo_lon - plot_height / 2, ix, mbna_modelplot_yo_lon + plot_height / 2, pixel_values[GREEN], XG_SOLIDLINE);
-				    else if (i > 0 || j > 0)
-					{
-					/* if (j == 0 && isnav == 0 && section->continuity == MB_YES)
-						xg_drawline(pmodp_xgid, ix, mbna_modelplot_yo_lon - plot_height / 2, ix, mbna_modelplot_yo_lon + plot_height / 2, pixel_values[CORAL], XG_DASHLINE); */
-					xg_drawline(pmodp_xgid, ixo, iyo, ix, iy, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-					}
-				    ixo = ix;
-				    iyo = iy;
-				    }
-				}
-			}
-		    }
-
-		/* Now plot the north-south offsets */
-		ixo = 0;
-		iyo = 0;
- 		for (i=0;i<project.num_files;i++)
-		    {
-		    file = &project.files[i];
-		    for (j=0;j<file->num_sections;j++)
-			{
-			section = &file->sections[j];
-			if (section->show_in_modelplot == MB_YES)
-				{
-				for (isnav=0;isnav<section->num_snav;isnav++)
-				    {
-				    iping = section->modelplot_start_count + section->snav_id[isnav];
-				    ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
-				    iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * (section->snav_lat_offset[isnav] / mbna_mtodeglat - file->block_offset_y));
-				    if ((i > 0 || j > 0) && section->continuity == MB_NO && isnav == 0)
-					xg_drawline(pmodp_xgid, ix, mbna_modelplot_yo_lat - plot_height / 2, ix, mbna_modelplot_yo_lat + plot_height / 2, pixel_values[GREEN], XG_SOLIDLINE);
-				    else if (i > 0 || j > 0)
-					{
-					/* if (j == 0 && isnav == 0 && section->continuity == MB_YES)
-						xg_drawline(pmodp_xgid, ix, mbna_modelplot_yo_lat - plot_height / 2, ix, mbna_modelplot_yo_lat + plot_height / 2, pixel_values[CORAL], XG_DASHLINE); */
-					xg_drawline(pmodp_xgid, ixo, iyo, ix, iy, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-					}
-				    ixo = ix;
-				    iyo = iy;
-				    }
-				}
-			}
-		    }
-
-		/* Now plot the vertical offsets */
-		ixo = 0;
-		iyo = 0;
- 		for (i=0;i<project.num_files;i++)
-		    {
-		    file = &project.files[i];
-		    for (j=0;j<file->num_sections;j++)
-			{
-			section = &file->sections[j];
-			if (section->show_in_modelplot == MB_YES)
-				{
-				for (isnav=0;isnav<section->num_snav;isnav++)
-				    {
-				    iping = section->modelplot_start_count + section->snav_id[isnav];
-				    ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
-				    iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * (section->snav_z_offset[isnav] - file->block_offset_z));
-				    if ((i > 0 || j > 0) && section->continuity == MB_NO && isnav == 0)
-					xg_drawline(pmodp_xgid, ix, mbna_modelplot_yo_z - plot_height / 2, ix, mbna_modelplot_yo_z + plot_height / 2, pixel_values[GREEN], XG_SOLIDLINE);
-				    else if (i > 0 || j > 0)
-					{
-					/* if (j == 0 && isnav == 0 && section->continuity == MB_YES)
-						xg_drawline(pmodp_xgid, ix, mbna_modelplot_yo_z - plot_height / 2, ix, mbna_modelplot_yo_z + plot_height / 2, pixel_values[CORAL], XG_DASHLINE); */
-					xg_drawline(pmodp_xgid, ixo, iyo, ix, iy, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-					}
-				    ixo = ix;
-				    iyo = iy;
-				    }
-				}
-			}
-		    }
-
-		/* loop over all crossings and plot ties */
-		for (i=0;i<project.num_crossings;i++)
-		    {
-		    crossing = &(project.crossings[i]);
-		    for (j=0;j<crossing->num_ties;j++)
-		    	{
-			tie = &(crossing->ties[j]);
-
-			if (tie->inversion_status == MBNA_INVERSION_CURRENT)
-				pixel = pixel_values[mbna_color_foreground];
-			else
-				pixel = pixel_values[BLUE];
-
-			file = &project.files[crossing->file_id_1];
-			section = &file->sections[crossing->section_1];
-			iping = section->modelplot_start_count + section->snav_id[tie->snav_1];
-
-			if (section->show_in_modelplot == MB_YES
-			    && (mbna_modelplot_zoom == MB_NO
-				|| (iping >= mbna_modelplot_startzoom && iping <= mbna_modelplot_endzoom)))
-				{
-				ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
-				iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * (section->snav_lon_offset[tie->snav_1] / mbna_mtodeglon - file->block_offset_x));
-				xg_drawrectangle(pmodp_xgid, ix-2, iy-2, 5, 5, pixel, XG_SOLIDLINE);
-				iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * (section->snav_lat_offset[tie->snav_1] / mbna_mtodeglat - file->block_offset_y));
-				xg_drawrectangle(pmodp_xgid, ix-2, iy-2, 5, 5, pixel, XG_SOLIDLINE);
-				iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * (section->snav_z_offset[tie->snav_1] - file->block_offset_z));
-				xg_drawrectangle(pmodp_xgid, ix-2, iy-2, 5, 5, pixel, XG_SOLIDLINE);
-				}
-
-			file = &project.files[crossing->file_id_2];
-			section = &file->sections[crossing->section_2];
-			iping = section->modelplot_start_count + section->snav_id[tie->snav_2];
-
-			if (section->show_in_modelplot == MB_YES
-			    && (mbna_modelplot_zoom == MB_NO
-				|| (iping >= mbna_modelplot_startzoom && iping <= mbna_modelplot_endzoom)))
-				{
-				ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
-				iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * (section->snav_lon_offset[tie->snav_2] / mbna_mtodeglon - file->block_offset_x));
-				xg_drawrectangle(pmodp_xgid, ix-2, iy-2, 5, 5, pixel, XG_SOLIDLINE);
-				iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * (section->snav_lat_offset[tie->snav_2] / mbna_mtodeglat - file->block_offset_y));
-				xg_drawrectangle(pmodp_xgid, ix-2, iy-2, 5, 5, pixel, XG_SOLIDLINE);
-				iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * (section->snav_z_offset[tie->snav_2] - file->block_offset_z));
-				xg_drawrectangle(pmodp_xgid, ix-2, iy-2, 5, 5, pixel, XG_SOLIDLINE);
-				}
-			}
-		    }
-
-		/* Loop over all files plotting global ties */
- 		for (i=0;i<project.num_files;i++)
-		    {
-		    file = &project.files[i];
-		    for (j=0;j<file->num_sections;j++)
-			{
-			section = &file->sections[j];
-			if (section->show_in_modelplot == MB_YES && section->global_tie_status != MBNA_TIE_NONE)
-				{
-				for (isnav=0;isnav<section->num_snav;isnav++)
-				    {
-				    iping = section->modelplot_start_count + section->snav_id[section->global_tie_snav];
-				    ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
-				    
-				    if (section->global_tie_status != MBNA_TIE_Z)
-					{
-					/* east-west offsets */
-					iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * (section->snav_lon_offset[section->global_tie_snav] / mbna_mtodeglon - file->block_offset_x));
-					xg_drawline(pmodp_xgid, ix, mbna_modelplot_yo_lon, ix, iy, pixel_values[ORANGE], XG_SOLIDLINE);
-					xg_fillrectangle(pmodp_xgid, ix-2, iy-2, 5, 5, pixel_values[ORANGE], XG_SOLIDLINE);
-					xg_drawrectangle(pmodp_xgid, ix-2, iy-2, 5, 5, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-					
-					/* north-south offsets */
-					iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * (section->snav_lat_offset[section->global_tie_snav] / mbna_mtodeglat - file->block_offset_y));
-					xg_drawline(pmodp_xgid, ix, mbna_modelplot_yo_lat, ix, iy, pixel_values[ORANGE], XG_SOLIDLINE);
-					xg_fillrectangle(pmodp_xgid, ix-2, iy-2, 5, 5, pixel_values[ORANGE], XG_SOLIDLINE);
-					xg_drawrectangle(pmodp_xgid, ix-2, iy-2, 5, 5, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-					}
-				    
-				    if (section->global_tie_status != MBNA_TIE_XY)
-					{
-					/* vertical offsets */
-					iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * (section->snav_z_offset[section->global_tie_snav] - file->block_offset_z));
-					xg_drawline(pmodp_xgid, ix, mbna_modelplot_yo_z, ix, iy, pixel_values[ORANGE], XG_SOLIDLINE);
-					xg_fillrectangle(pmodp_xgid, ix-2, iy-2, 5, 5, pixel_values[ORANGE], XG_SOLIDLINE);
-					xg_drawrectangle(pmodp_xgid, ix-2, iy-2, 5, 5, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-					}
-				    }
-				}
-			}
-		    }
-
-		/* plot current tie in red */
-		if (mbna_current_crossing != MBNA_SELECT_NONE && mbna_current_tie != MBNA_SELECT_NONE)
-			{
-			crossing = &(project.crossings[mbna_current_crossing]);
-			tie = &(crossing->ties[mbna_current_tie]);
-
-			file = &project.files[crossing->file_id_1];
-			section = &file->sections[crossing->section_1];
-			iping = section->modelplot_start_count + section->snav_id[tie->snav_1];
-
-			if (section->show_in_modelplot == MB_YES
-			    && (mbna_modelplot_zoom == MB_NO
-				|| (iping >= mbna_modelplot_startzoom && iping <= mbna_modelplot_endzoom)))
-				{
-				ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
-				iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * (section->snav_lon_offset[tie->snav_1] / mbna_mtodeglon - file->block_offset_x));
-				xg_fillrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[RED], XG_SOLIDLINE);
-				xg_drawrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-				iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * (section->snav_lat_offset[tie->snav_1] / mbna_mtodeglat - file->block_offset_y));
-				xg_fillrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[RED], XG_SOLIDLINE);
-				xg_drawrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-				iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * (section->snav_z_offset[tie->snav_1] - file->block_offset_z));
-				xg_fillrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[RED], XG_SOLIDLINE);
-				xg_drawrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-				}
-
-			file = &project.files[crossing->file_id_2];
-			section = &file->sections[crossing->section_2];
-			iping = section->modelplot_start_count + section->snav_id[tie->snav_2];
-
-			if (section->show_in_modelplot == MB_YES
-			    && (mbna_modelplot_zoom == MB_NO
-				|| (iping >= mbna_modelplot_startzoom && iping <= mbna_modelplot_endzoom)))
-				{
-				ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
-				iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * (section->snav_lon_offset[tie->snav_2] / mbna_mtodeglon - file->block_offset_x));
-				xg_fillrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[RED], XG_SOLIDLINE);
-				xg_drawrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-				iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * (section->snav_lat_offset[tie->snav_2] / mbna_mtodeglat - file->block_offset_y));
-				xg_fillrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[RED], XG_SOLIDLINE);
-				xg_drawrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-				iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * (section->snav_z_offset[tie->snav_2] - file->block_offset_z));
-				xg_fillrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[RED], XG_SOLIDLINE);
-				xg_drawrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-				}
-			}
-
-		/* or if tie not selected then plot current crossing in red */
-		else if (mbna_current_crossing != MBNA_SELECT_NONE)
-			{
-			crossing = &(project.crossings[mbna_current_crossing]);
-
-			file = &project.files[crossing->file_id_1];
-			section = &file->sections[crossing->section_1];
-			iping = section->modelplot_start_count + section->snav_id[section->num_snav/2];
-
-			if (section->show_in_modelplot == MB_YES
-			    && (mbna_modelplot_zoom == MB_NO
-				|| (iping >= mbna_modelplot_startzoom && iping <= mbna_modelplot_endzoom)))
-				{
-				ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
-				iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * (section->snav_lon_offset[section->num_snav/2] / mbna_mtodeglon - file->block_offset_x));
-				xg_fillrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[RED], XG_SOLIDLINE);
-				xg_drawrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-				iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * (section->snav_lat_offset[section->num_snav/2] / mbna_mtodeglat - file->block_offset_y));
-				xg_fillrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[RED], XG_SOLIDLINE);
-				xg_drawrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-				iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * (section->snav_z_offset[section->num_snav/2] - file->block_offset_z));
-				xg_fillrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[RED], XG_SOLIDLINE);
-				xg_drawrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-				}
-
-			file = &project.files[crossing->file_id_2];
-			section = &file->sections[crossing->section_2];
-			iping = section->modelplot_start_count + section->snav_id[section->num_snav/2];
-
-			if (section->show_in_modelplot == MB_YES
-			    && (mbna_modelplot_zoom == MB_NO
-				|| (iping >= mbna_modelplot_startzoom && iping <= mbna_modelplot_endzoom)))
-				{
-				ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
-				iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * (section->snav_lon_offset[section->num_snav/2] / mbna_mtodeglon - file->block_offset_x));
-				xg_fillrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[RED], XG_SOLIDLINE);
-				xg_drawrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-				iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * (section->snav_lat_offset[section->num_snav/2] / mbna_mtodeglat - file->block_offset_y));
-				xg_fillrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[RED], XG_SOLIDLINE);
-				xg_drawrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-				iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * (section->snav_z_offset[section->num_snav/2] - file->block_offset_z));
-				xg_fillrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[RED], XG_SOLIDLINE);
-				xg_drawrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-				}
-			}
-
-		/* if a modelplot pick did not resolve a single tie, plot the options for a second pick */
-		if (mbna_modelplot_pickfile != MBNA_SELECT_NONE)
-			{
-			for (i=0;i<project.num_crossings;i++)
-				{
-				/* check if this crossing includes the picked snav */
-				crossing = &(project.crossings[i]);
-
-				/* check first snav */
-				if (crossing->file_id_1 == mbna_modelplot_pickfile
-					&& crossing->section_1 == mbna_modelplot_picksection)
-					{
-					/* loop over the ties */
-					for (j=0;j<crossing->num_ties;j++)
-						{
-						tie = &(crossing->ties[j]);
-						if (crossing->file_id_1 == mbna_modelplot_pickfile
-						    && crossing->section_1 == mbna_modelplot_picksection
-						    && tie->snav_1 == mbna_modelplot_picksnav)
-							{
-							file = &project.files[crossing->file_id_1];
-							section = &file->sections[crossing->section_1];
-							iping = section->modelplot_start_count + section->snav_id[tie->snav_1];
-
-							if (section->show_in_modelplot == MB_YES
-							    && (mbna_modelplot_zoom == MB_NO
-								|| (iping >= mbna_modelplot_startzoom && iping <= mbna_modelplot_endzoom)))
-								{
-								ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
-								iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * (section->snav_lon_offset[tie->snav_1] / mbna_mtodeglon - file->block_offset_x));
-								xg_fillrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[RED], XG_SOLIDLINE);
-								xg_drawrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-								iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * (section->snav_lat_offset[tie->snav_1] / mbna_mtodeglat - file->block_offset_y));
-								xg_fillrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[RED], XG_SOLIDLINE);
-								xg_drawrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-								iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * (section->snav_z_offset[tie->snav_1] - file->block_offset_z));
-								xg_fillrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[RED], XG_SOLIDLINE);
-								xg_drawrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-								}
-
-							file = &project.files[crossing->file_id_2];
-							section = &file->sections[crossing->section_2];
-							iping = section->modelplot_start_count + section->snav_id[tie->snav_2];
-
-							if (section->show_in_modelplot == MB_YES
-							    && (mbna_modelplot_zoom == MB_NO
-								|| (iping >= mbna_modelplot_startzoom && iping <= mbna_modelplot_endzoom)))
-								{
-								ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
-								iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * (section->snav_lon_offset[tie->snav_2] / mbna_mtodeglon - file->block_offset_x));
-								xg_fillrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[6], XG_SOLIDLINE);
-								xg_drawrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-								iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * (section->snav_lat_offset[tie->snav_2] / mbna_mtodeglat - file->block_offset_y));
-								xg_fillrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[6], XG_SOLIDLINE);
-								xg_drawrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-								iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * (section->snav_z_offset[tie->snav_2] - file->block_offset_z));
-								xg_fillrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[6], XG_SOLIDLINE);
-								xg_drawrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-								}
-							}
-						}
-					}
-
-				/* check second snav */
-				if (crossing->file_id_2 == mbna_modelplot_pickfile
-					&& crossing->section_2 == mbna_modelplot_picksection)
-					{
-					/* loop over the ties */
-					for (j=0;j<crossing->num_ties;j++)
-						{
-						tie = &(crossing->ties[j]);
-						if (crossing->file_id_2 == mbna_modelplot_pickfile
-						    && crossing->section_2 == mbna_modelplot_picksection
-						    && tie->snav_2 == mbna_modelplot_picksnav)
-							{
-							file = &project.files[crossing->file_id_2];
-							section = &file->sections[crossing->section_2];
-							iping = section->modelplot_start_count + section->snav_id[tie->snav_2];
-
-							if (section->show_in_modelplot == MB_YES
-							    && (mbna_modelplot_zoom == MB_NO
-								|| (iping >= mbna_modelplot_startzoom && iping <= mbna_modelplot_endzoom)))
-								{
-								ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
-								iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * (section->snav_lon_offset[tie->snav_2] / mbna_mtodeglon - file->block_offset_x));
-								xg_fillrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[RED], XG_SOLIDLINE);
-								xg_drawrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-								iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * (section->snav_lat_offset[tie->snav_2] / mbna_mtodeglat - file->block_offset_y));
-								xg_fillrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[RED], XG_SOLIDLINE);
-								xg_drawrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-								iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * (section->snav_z_offset[tie->snav_2] - file->block_offset_z));
-								xg_fillrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[RED], XG_SOLIDLINE);
-								xg_drawrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-								}
-
-							file = &project.files[crossing->file_id_1];
-							section = &file->sections[crossing->section_1];
-							iping = section->modelplot_start_count + section->snav_id[tie->snav_1];
-
-							if (section->show_in_modelplot == MB_YES
-							    && (mbna_modelplot_zoom == MB_NO
-								|| (iping >= mbna_modelplot_startzoom && iping <= mbna_modelplot_endzoom)))
-								{
-								ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (iping - mbna_modelplot_start));
-								iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * (section->snav_lon_offset[tie->snav_1] / mbna_mtodeglon - file->block_offset_x));
-								xg_fillrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[6], XG_SOLIDLINE);
-								xg_drawrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-								iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * (section->snav_lat_offset[tie->snav_1] / mbna_mtodeglat - file->block_offset_y));
-								xg_fillrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[6], XG_SOLIDLINE);
-								xg_drawrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-								iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * (section->snav_z_offset[tie->snav_1] - file->block_offset_z));
-								xg_fillrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[6], XG_SOLIDLINE);
-								xg_drawrectangle(pmodp_xgid, ix-5, iy-5, 11, 11, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-								}
-							}
-						}
-					}
-				}
-			}
-
-		/* plot zoom if active */
-		if (mbna_modelplot_zoom_x1 != 0 || mbna_modelplot_zoom_x2 != 0)
-			{
-			imodelplot_start = (MIN(mbna_modelplot_zoom_x1, mbna_modelplot_zoom_x2) - mbna_modelplot_xo) / mbna_modelplot_xscale + mbna_modelplot_start;
-			imodelplot_start = MIN(MAX(imodelplot_start, 0), project.num_pings - 1);
-			imodelplot_end = (MAX(mbna_modelplot_zoom_x1, mbna_modelplot_zoom_x2) - mbna_modelplot_xo) / mbna_modelplot_xscale + mbna_modelplot_start;
-			imodelplot_end = MIN(MAX(imodelplot_end, 0), project.num_pings - 1);
-
-			ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (imodelplot_start - mbna_modelplot_start));
-		   	xg_drawline(pmodp_xgid, ix, mbna_modelplot_yo_lon - plot_height / 2, ix, mbna_modelplot_yo_lon + plot_height / 2, pixel_values[mbna_color_foreground], XG_DASHLINE);
-		   	xg_drawline(pmodp_xgid, ix, mbna_modelplot_yo_lat - plot_height / 2, ix, mbna_modelplot_yo_lat + plot_height / 2, pixel_values[mbna_color_foreground], XG_DASHLINE);
-		   	xg_drawline(pmodp_xgid, ix, mbna_modelplot_yo_z - plot_height / 2, ix, mbna_modelplot_yo_z + plot_height / 2, pixel_values[mbna_color_foreground], XG_DASHLINE);
-
-			ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (imodelplot_end - mbna_modelplot_start));
-		   	xg_drawline(pmodp_xgid, ix, mbna_modelplot_yo_lon - plot_height / 2, ix, mbna_modelplot_yo_lon + plot_height / 2, pixel_values[mbna_color_foreground], XG_DASHLINE);
-		   	xg_drawline(pmodp_xgid, ix, mbna_modelplot_yo_lat - plot_height / 2, ix, mbna_modelplot_yo_lat + plot_height / 2, pixel_values[mbna_color_foreground], XG_DASHLINE);
-		   	xg_drawline(pmodp_xgid, ix, mbna_modelplot_yo_z - plot_height / 2, ix, mbna_modelplot_yo_z + plot_height / 2, pixel_values[mbna_color_foreground], XG_DASHLINE);
-			}
-
-		/* reset clipping */
-		xg_setclip(pmodp_xgid, 0, 0, mbna_modelplot_width, mbna_modelplot_height);
-
-		}
-
- 	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-
-int
-mbnavadjust_modelplot_plot_tieoffsets()
-{
-	/* local variables */
-	char	*function_name = "mbnavadjust_modelplot_plot_tieoffsets";
-	int	status = MB_SUCCESS;
-	struct mbna_file *file;
-	struct mbna_section *section;
-	struct mbna_crossing *crossing;
-	struct mbna_tie *tie;
-	int	num_ties;
-	int	num_surveys;
-	double	lon_offset_min;
-	double	lon_offset_max;
-	double	lat_offset_min;
-	double	lat_offset_max;
-	double	z_offset_min;
-	double	z_offset_max;
-	double	xymax, yzmax;
-	int	plot_width;
-	int	plot_height;
-	int	first;
-	char	label[STRING_MAX];
-	int	stringwidth, stringascent, stringdescent;
-	int	pixel;
-	int	itiestart, itieend;
-	int	ix, iy;
-	int	num_ties_block;
-	int	num_blocks;
-	int	plot_index;
-	int	isurvey1, isurvey2;
-	int	i, j;
-//fprintf(stderr,"Called %s\n",function_name);
-
- 	/* print input debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
-
-	/* plot model if an inversion has been performed */
-    	if (project.open == MB_YES
-    		&& project.inversion != MBNA_INVERSION_NONE
-		&& project.modelplot == MB_YES)
-    		{
-		/* get number of ties and surveys */
-		num_ties = project.num_ties;
-		mbna_num_ties_plot = 0;
-		num_surveys = 0;
-
-		/* count surveys and plot blocks by looping over files */
-		num_surveys = 1;
- 		for (i=0;i<project.num_files;i++)
-			{
-			file = &project.files[i];
-			file->show_in_modelplot = -1;
-			for (j=0;j<file->num_sections;j++)
-				{
-				section = &file->sections[j];
-				if ((i > 0 || j > 0) && section->continuity == MB_NO)
-					num_surveys++;
-				}
-			}
-		num_blocks = 0;
-		for (i=0;i<num_surveys;i++)
-			num_blocks += i + 1;
-
-		/* Figure out which ties might be plotted */
- 		for (i=0;i<project.num_crossings;i++)
-			{
-			crossing = &project.crossings[i];
-			for (j=0;j<crossing->num_ties;j++)
-				{
-				tie = &crossing->ties[j];
-				tie->block_1 = project.files[crossing->file_id_1].block;
-				tie->block_2 = project.files[crossing->file_id_2].block;
-				tie->isurveyplotindex = -1;
-
-				/* check to see if this tie should be plotted */
-				if (mbna_modelplot_blocksurvey1 != MBNA_SELECT_NONE && mbna_modelplot_blocksurvey2 != MBNA_SELECT_NONE)
-					{
-					if (tie->block_1 == mbna_modelplot_blocksurvey1
-						&& tie->block_2 == mbna_modelplot_blocksurvey2)
-						{
-						tie->isurveyplotindex = 1;
-						mbna_num_ties_plot++;
-						}
-					}
-				else if (mbna_view_mode == MBNA_VIEW_MODE_SURVEY)
-					{
-					if (tie->block_1 == mbna_survey_select
-					    && tie->block_2 == mbna_survey_select)
-						{
-						tie->isurveyplotindex = 1;
-						mbna_num_ties_plot++;
-						}
-					}
-				else if (mbna_view_mode == MBNA_VIEW_MODE_WITHSURVEY)
-					{
-					if (tie->block_1 == mbna_survey_select
-					    || tie->block_2 == mbna_survey_select)
-						{
-						tie->isurveyplotindex = 1;
-						mbna_num_ties_plot++;
-						}
-					}
-				else if (mbna_view_mode == MBNA_VIEW_MODE_FILE)
-					{
-					if (crossing->file_id_1 == mbna_file_select
-					    && crossing->file_id_2 == mbna_file_select)
-						{
-						tie->isurveyplotindex = 1;
-						mbna_num_ties_plot++;
-						}
-					}
-				else if (mbna_view_mode == MBNA_VIEW_MODE_WITHFILE)
-					{
-					if (crossing->file_id_1 == mbna_file_select
-					    || crossing->file_id_2 == mbna_file_select)
-						{
-						tie->isurveyplotindex = 1;
-						mbna_num_ties_plot++;
-						}
-					}
-				else if (mbna_view_mode == MBNA_VIEW_MODE_WITHSECTION)
-					{
-					if ((crossing->file_id_1 == mbna_file_select && crossing->section_1 == mbna_section_select)
-					    || (crossing->file_id_2 == mbna_file_select && crossing->section_2 == mbna_section_select))
-						{
-						tie->isurveyplotindex = 1;
-						mbna_num_ties_plot++;
-						}
-					}
-				else if (mbna_view_mode == MBNA_VIEW_MODE_ALL)
-					{
-					tie->isurveyplotindex = 1;
-					mbna_num_ties_plot++;
-					}
-				}
-			}
-
-		/* Get min maxes by looping over surveys to locate each tie in plot */
-		plot_index = 0;
-		first = MB_YES;
-		if (mbna_modelplot_tiezoom == MB_YES)
-			{
-			mbna_modelplot_tiestart = mbna_modelplot_tiestartzoom;
-			mbna_modelplot_tieend = mbna_modelplot_tieendzoom;
-			}
-		else
-			{
-			mbna_modelplot_tiestart = 0;
-			mbna_modelplot_tieend = mbna_num_ties_plot - 1;
-			}
-		for (isurvey2=0;isurvey2<num_surveys;isurvey2++)
-			{
-			for (isurvey1=0;isurvey1<=isurvey2;isurvey1++)
-				{
-				/* loop over all ties looking for ones in current plot block
-					- current plot block is for ties between
-					surveys isurvey1 and isurvey2 */
-				for (i=0;i<project.num_crossings;i++)
-					{
-					crossing = &project.crossings[i];
-					for (j=0;j<crossing->num_ties;j++)
-						{
-						tie = &crossing->ties[j];
-
-						/* check if this tie is between the desired surveys */
-						if (tie->isurveyplotindex >= 0
-						    && ((tie->block_1 == isurvey1 && tie->block_2 == isurvey2)
-							|| (tie->block_2 == isurvey1 && tie->block_1 == isurvey2)))
-							{
-							/* set plot index for tie */
-							tie->isurveyplotindex = plot_index;
-
-							/* increment plot_index */
-							plot_index++;
-
-							/* if tie will be plotted (check for zoom) use it for min max */
-							if (tie->isurveyplotindex >= 0
-							    && (tie->isurveyplotindex >= mbna_modelplot_tiestart
-								    && tie->isurveyplotindex <= mbna_modelplot_tieend))
-								{
-								if (first == MB_YES)
-									{
-									lon_offset_min = tie->offset_x_m;
-									lon_offset_max = tie->offset_x_m;
-									lat_offset_min = tie->offset_y_m;
-									lat_offset_max = tie->offset_y_m;
-									z_offset_min = tie->offset_z_m;
-									z_offset_max = tie->offset_z_m;
-									first = MB_NO;
-									}
-								else
-									{
-									lon_offset_min = MIN(lon_offset_min, tie->offset_x_m);
-									lon_offset_max = MAX(lon_offset_max, tie->offset_x_m);
-									lat_offset_min = MIN(lat_offset_min, tie->offset_y_m);
-									lat_offset_max = MAX(lat_offset_max, tie->offset_y_m);
-									z_offset_min = MIN(z_offset_min, tie->offset_z_m);
-									z_offset_max = MAX(z_offset_max, tie->offset_z_m);
-									}
-								}
-							}
-						}
-					}
-				}
-			}
-
-		/* get scaling */
-		plot_width = mbna_modelplot_width - 8 * MBNA_MODELPLOT_X_SPACE;
-		plot_height = (mbna_modelplot_height - 4 * MBNA_MODELPLOT_Y_SPACE) / 3;
-		mbna_modelplot_xo = 5 * MBNA_MODELPLOT_X_SPACE;
-		mbna_modelplot_yo_lon = MBNA_MODELPLOT_Y_SPACE + plot_height / 2;
-		mbna_modelplot_yo_lat = 2 * MBNA_MODELPLOT_Y_SPACE + 3 * plot_height / 2;
-		mbna_modelplot_yo_z = 3 * MBNA_MODELPLOT_Y_SPACE + 5 * plot_height / 2;
-		xymax = MAX(fabs(lon_offset_min),fabs(lon_offset_max));
-		xymax = MAX(fabs(lat_offset_min),xymax);
-		xymax = MAX(fabs(lat_offset_max),xymax);
-		mbna_modelplot_xscale = ((double)plot_width) / (mbna_modelplot_tieend - mbna_modelplot_tiestart + 1);
-		mbna_modelplot_yscale = ((double)plot_height) / (2.2 * xymax);
-		yzmax = MAX(fabs(z_offset_min),fabs(z_offset_max));
-		yzmax = MAX(yzmax,0.5);
-		mbna_modelplot_yzscale = ((double)plot_height) / (2.2 * yzmax);
-
-		/* clear screens for first plot */
-		xg_fillrectangle(pmodp_xgid, 0, 0,
-				modp_borders[1], modp_borders[3],
-				pixel_values[mbna_color_background], XG_SOLIDLINE);
-
-		/* plot the bounds */
-		xg_drawrectangle(pmodp_xgid, mbna_modelplot_xo, mbna_modelplot_yo_lon - plot_height / 2, plot_width, plot_height, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-		xg_drawline(pmodp_xgid, mbna_modelplot_xo, mbna_modelplot_yo_lon, mbna_modelplot_xo + plot_width, mbna_modelplot_yo_lon, pixel_values[mbna_color_foreground], XG_DASHLINE);
-		xg_drawrectangle(pmodp_xgid, mbna_modelplot_xo, mbna_modelplot_yo_lat - plot_height / 2, plot_width, plot_height, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-		xg_drawline(pmodp_xgid, mbna_modelplot_xo, mbna_modelplot_yo_lat, mbna_modelplot_xo + plot_width, mbna_modelplot_yo_lat, pixel_values[mbna_color_foreground], XG_DASHLINE);
-		xg_drawrectangle(pmodp_xgid, mbna_modelplot_xo, mbna_modelplot_yo_z - plot_height / 2, plot_width, plot_height, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-		xg_drawline(pmodp_xgid, mbna_modelplot_xo, mbna_modelplot_yo_z, mbna_modelplot_xo + plot_width, mbna_modelplot_yo_z, pixel_values[mbna_color_foreground], XG_DASHLINE);
-
-		/* plot title */
-		if (mbna_view_mode == MBNA_VIEW_MODE_SURVEY)
-			{
-			sprintf(label, "Display Only Selected Survey - Selected Survey:%d", mbna_survey_select);
-			}
-		else if (mbna_view_mode == MBNA_VIEW_MODE_FILE)
-			{
-			sprintf(label, "Display Only Selected File - Selected Survey/File:%d/%d", mbna_survey_select, mbna_file_select);
-			}
-		else if (mbna_view_mode == MBNA_VIEW_MODE_WITHSURVEY)
-			{
-			sprintf(label, "Display With Selected Survey - Selected Survey:%d", mbna_survey_select);
-			}
-		else if (mbna_view_mode == MBNA_VIEW_MODE_WITHFILE)
-			{
-			sprintf(label, "Display With Selected File - Selected Survey/File:%d/%d", mbna_survey_select, mbna_file_select);
-			}
-		else if (mbna_view_mode == MBNA_VIEW_MODE_WITHSECTION)
-			{
-			sprintf(label, "Display With Selected Section: Selected Survey/File/Section:%d/%d/%d",
-				mbna_survey_select, mbna_file_select, mbna_section_select);
-			}
-		else if (mbna_view_mode == MBNA_VIEW_MODE_ALL)
-			{
-			sprintf(label, "Display All Data");
-			}
-
-		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
-		ix = mbna_modelplot_xo + (plot_width - stringwidth) / 2;
-		iy = MBNA_MODELPLOT_Y_SPACE - 2 * stringascent;
-		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-
-		/* plot labels */
-		sprintf(label, "Tie East-West Offset (meters) Grouped by Surveys");
-		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
-		ix = mbna_modelplot_xo + (plot_width - stringwidth) / 2;
-		iy = mbna_modelplot_yo_lon - plot_height / 2 - stringascent / 4;
-		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-
-		sprintf(label,"%d", mbna_modelplot_tiestart);
-		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
-		ix = mbna_modelplot_xo - stringwidth / 2;
-		iy = mbna_modelplot_yo_lon + plot_height / 2 + 3 *stringascent / 2;
-		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-
-		sprintf(label,"%d", mbna_modelplot_tieend);
-		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
-		ix = mbna_modelplot_xo + plot_width - stringwidth / 2;
-		iy = mbna_modelplot_yo_lon + plot_height / 2 + 3 *stringascent / 2;
-		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-
-		sprintf(label,"%.2f", 1.1 * xymax);
-		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
-		ix = mbna_modelplot_xo - stringwidth - stringascent / 4;
-		iy = mbna_modelplot_yo_lon - plot_height / 2 + stringascent / 2;
-		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-
-		sprintf(label,"%.2f", 0.0);
-		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
-		ix = mbna_modelplot_xo - stringwidth - stringascent / 4;
-		iy = mbna_modelplot_yo_lon + stringascent / 2;
-		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-
-		sprintf(label,"%.2f", -1.1 * xymax);
-		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
-		ix = mbna_modelplot_xo - stringwidth - stringascent / 4;
-		iy = mbna_modelplot_yo_lon + plot_height / 2 + stringascent / 2;
-		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-
-
-		sprintf(label, "Tie North-South Offset (meters) Grouped by Surveys");
-		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
-		ix = mbna_modelplot_xo + (plot_width - stringwidth) / 2;
-		iy = mbna_modelplot_yo_lat - plot_height / 2 - stringascent / 4;
-		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-
-		sprintf(label,"%d", mbna_modelplot_tiestart);
-		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
-		ix = mbna_modelplot_xo - stringwidth / 2;
-		iy = mbna_modelplot_yo_lat + plot_height / 2 + 3 *stringascent / 2;
-		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-
-		sprintf(label,"%d", mbna_modelplot_tieend);
-		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
-		ix = mbna_modelplot_xo + plot_width - stringwidth / 2;
-		iy = mbna_modelplot_yo_lat + plot_height / 2 + 3 *stringascent / 2;
-		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-
-		sprintf(label,"%.2f", 1.1 * xymax);
-		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
-		ix = mbna_modelplot_xo - stringwidth - stringascent / 4;
-		iy = mbna_modelplot_yo_lat - plot_height / 2 + stringascent / 2;
-		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-
-		sprintf(label,"%.2f", 0.0);
-		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
-		ix = mbna_modelplot_xo - stringwidth - stringascent / 4;
-		iy = mbna_modelplot_yo_lat + stringascent / 2;
-		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-
-		sprintf(label,"%.2f", -1.1 * xymax);
-		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
-		ix = mbna_modelplot_xo - stringwidth - stringascent / 4;
-		iy = mbna_modelplot_yo_lat + plot_height / 2 + stringascent / 2;
-		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-
-
-		sprintf(label, "Tie Vertical Offset (meters) Grouped by Surveys");
-		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
-		ix = mbna_modelplot_xo + (plot_width - stringwidth) / 2;
-		iy = mbna_modelplot_yo_z - plot_height / 2 - stringascent / 4;
-		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-
-		sprintf(label,"%d", mbna_modelplot_tiestart);
-		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
-		ix = mbna_modelplot_xo - stringwidth / 2;
-		iy = mbna_modelplot_yo_z + plot_height / 2 + 3 *stringascent / 2;
-		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-
-		sprintf(label,"%d", mbna_modelplot_tieend);
-		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
-		ix = mbna_modelplot_xo + plot_width - stringwidth / 2;
-		iy = mbna_modelplot_yo_z + plot_height / 2 + 3 *stringascent / 2;
-		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-
-		sprintf(label,"%.2f", 1.1 * yzmax);
-		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
-		ix = mbna_modelplot_xo - stringwidth - stringascent / 4;
-		iy = mbna_modelplot_yo_z - plot_height / 2 + stringascent / 2;
-		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-
-		sprintf(label,"%.2f", 0.0);
-		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
-		ix = mbna_modelplot_xo - stringwidth - stringascent / 4;
-		iy = mbna_modelplot_yo_z + stringascent / 2;
-		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-
-		sprintf(label,"%.2f", -1.1 * yzmax);
-		xg_justify(pmodp_xgid, label, &stringwidth, &stringascent, &stringdescent);
-		ix = mbna_modelplot_xo - stringwidth - stringascent / 4;
-		iy = mbna_modelplot_yo_z + plot_height / 2 + stringascent / 2;
-		xg_drawstring(pmodp_xgid, ix, iy, label, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-
-		/* set clipping */
-		xg_setclip(pmodp_xgid, mbna_modelplot_xo, 0, plot_width, mbna_modelplot_height);
-
-		/* loop over surveys to locate each tie in plot */
-		plot_index = 0;
-		for (isurvey2=0;isurvey2<num_surveys;isurvey2++)
-			{
-			for (isurvey1=0;isurvey1<=isurvey2;isurvey1++)
-				{
-				num_ties_block = 0;
-
-				/* loop over all ties looking for ones in current plot block
-					- current plot block is for ties between
-					surveys isurvey1 and isurvey2 */
-				for (i=0;i<project.num_crossings;i++)
-					{
-					crossing = &project.crossings[i];
-					for (j=0;j<crossing->num_ties;j++)
-						{
-						tie = &crossing->ties[j];
-
-						/* check if this tie is between the desired surveys */
-						if (tie->isurveyplotindex >= 0
-						    && ((tie->block_1 == isurvey1 && tie->block_2 == isurvey2)
-							|| (tie->block_2 == isurvey1 && tie->block_1 == isurvey2)))
-							{
-							if (tie->isurveyplotindex >= mbna_modelplot_tiestart
-								    && tie->isurveyplotindex <= mbna_modelplot_tieend)
-								{
-								/* plot tie */
-								if (tie->inversion_status == MBNA_INVERSION_CURRENT)
-									pixel = pixel_values[mbna_color_foreground];
-								else
-									pixel = pixel_values[BLUE];
-
-								ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (tie->isurveyplotindex - mbna_modelplot_tiestart));
-
-								iy = mbna_modelplot_yo_lon - (int)(mbna_modelplot_yscale * tie->offset_x_m);
-								if (i == mbna_current_crossing && j == mbna_current_tie)
-									{
-									xg_fillrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[RED], XG_SOLIDLINE);
-									xg_drawrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-									}
-								else
-									xg_drawrectangle(pmodp_xgid, ix-2, iy-2, 5, 5, pixel, XG_SOLIDLINE);
-
-								iy = mbna_modelplot_yo_lat - (int)(mbna_modelplot_yscale * tie->offset_y_m);
-								if (i == mbna_current_crossing && j == mbna_current_tie)
-									{
-									xg_fillrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[RED], XG_SOLIDLINE);
-									xg_drawrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-									}
-								else
-									xg_drawrectangle(pmodp_xgid, ix-2, iy-2, 5, 5, pixel, XG_SOLIDLINE);
-
-								iy = mbna_modelplot_yo_z - (int)(mbna_modelplot_yzscale * tie->offset_z_m);
-								if (i == mbna_current_crossing && j == mbna_current_tie)
-									{
-									xg_fillrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[RED], XG_SOLIDLINE);
-									xg_drawrectangle(pmodp_xgid, ix-3, iy-3, 7, 7, pixel_values[mbna_color_foreground], XG_SOLIDLINE);
-									}
-								else
-									xg_drawrectangle(pmodp_xgid, ix-2, iy-2, 5, 5, pixel, XG_SOLIDLINE);
-								}
-
-							/* increment plot_index */
-							plot_index++;
-
-							/* increment num_ties_block */
-							num_ties_block++;
-							}
-						}
-					}
-
-				/* plot line for boundary between plot blocks */
-				if (num_ties_block > 0)
-					{
-					/* plot line for boundary between plot blocks */
-					ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (plot_index - mbna_modelplot_tiestart - 0.5));
-					xg_drawline(pmodp_xgid, ix, mbna_modelplot_yo_lon - plot_height / 2,
-								ix, mbna_modelplot_yo_lon + plot_height / 2,
-								pixel_values[GREEN], XG_DASHLINE);
-					xg_drawline(pmodp_xgid, ix, mbna_modelplot_yo_lat - plot_height / 2,
-								ix, mbna_modelplot_yo_lat + plot_height / 2,
-								pixel_values[GREEN], XG_DASHLINE);
-					xg_drawline(pmodp_xgid, ix, mbna_modelplot_yo_z - plot_height / 2,
-								ix, mbna_modelplot_yo_z + plot_height / 2,
-								pixel_values[GREEN], XG_DASHLINE);
-					}
-				}
-			}
-
-		/* plot zoom if active */
-		if (mbna_modelplot_zoom_x1 != 0 || mbna_modelplot_zoom_x2 != 0)
-			{
-			itiestart = (MIN(mbna_modelplot_zoom_x1, mbna_modelplot_zoom_x2) - mbna_modelplot_xo) / mbna_modelplot_xscale + mbna_modelplot_tiestart;
-			itiestart = MIN(MAX(itiestart, 0), mbna_num_ties_plot - 1);
-			itieend = (MAX(mbna_modelplot_zoom_x1, mbna_modelplot_zoom_x2) - mbna_modelplot_xo) / mbna_modelplot_xscale + mbna_modelplot_tiestart;
-			itieend = MIN(MAX(itieend, 0), mbna_num_ties_plot - 1);
-
-			ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (itiestart - mbna_modelplot_tiestart));
-		   	xg_drawline(pmodp_xgid, ix, mbna_modelplot_yo_lon - plot_height / 2, ix, mbna_modelplot_yo_lon + plot_height / 2, pixel_values[mbna_color_foreground], XG_DASHLINE);
-		   	xg_drawline(pmodp_xgid, ix, mbna_modelplot_yo_lat - plot_height / 2, ix, mbna_modelplot_yo_lat + plot_height / 2, pixel_values[mbna_color_foreground], XG_DASHLINE);
-		   	xg_drawline(pmodp_xgid, ix, mbna_modelplot_yo_z - plot_height / 2, ix, mbna_modelplot_yo_z + plot_height / 2, pixel_values[mbna_color_foreground], XG_DASHLINE);
-
-			ix = mbna_modelplot_xo + (int)(mbna_modelplot_xscale * (itieend - mbna_modelplot_tiestart));
-		   	xg_drawline(pmodp_xgid, ix, mbna_modelplot_yo_lon - plot_height / 2, ix, mbna_modelplot_yo_lon + plot_height / 2, pixel_values[mbna_color_foreground], XG_DASHLINE);
-		   	xg_drawline(pmodp_xgid, ix, mbna_modelplot_yo_lat - plot_height / 2, ix, mbna_modelplot_yo_lat + plot_height / 2, pixel_values[mbna_color_foreground], XG_DASHLINE);
-		   	xg_drawline(pmodp_xgid, ix, mbna_modelplot_yo_z - plot_height / 2, ix, mbna_modelplot_yo_z + plot_height / 2, pixel_values[mbna_color_foreground], XG_DASHLINE);
-			}
-
-		/* reset clipping */
-		xg_setclip(pmodp_xgid, 0, 0, mbna_modelplot_width, mbna_modelplot_height);
-		}
-
- 	/* print output debug statements */
-	if (mbna_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBnavadjust function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
diff --git a/src/mbnavadjust/mbnavadjust_util.c b/src/mbnavadjust/mbnavadjust_util.c
deleted file mode 100644
index c509ec6..0000000
--- a/src/mbnavadjust/mbnavadjust_util.c
+++ /dev/null
@@ -1,3926 +0,0 @@
-/*
- * WARNING: This file is overwritten at code generation time.
- * Any changes to this file will be lost.
- */
-/*
- * MODULE: BxConvert.c
- * AUTHOR: Automatically generated by Builder Xcessory
- *
- * Description: This module contains various utilities, converters
- *	for XmStrings (to work properly with app-defaults), and if needed
- *	the XPM pixmap utilities.
- *
- * Edit the file ${BX}/gen/bxutils.c (BX$SYSTEM:[gen]bxutils.c on VMS) to
- * make system wide changes to this file which will be visible next time
- * this file is generated.
- * ${BX} is the directory where Builder Xcessory is installed.
- */
-
-/*
- * BX supplies a string format for compound strings:
- *
- *		::[#tag][:t][:r]["str"]
- *
- * where:
- *	:: = indicates compound string.
- *	tag =  the font tag
- *	:t = separator (if not seen no separator added to segment)
- *	:r = right to left (if not seen left to right assumed)
- *	"str" = the text of the string.
- *
- * The components for the compound string can be repeated any number of
- * times.
- */
-
-/*****************************************************************************
- *       INCLUDE FILES
- *****************************************************************************/
-/* Added HAVE_CONFIG_H for autogen files */
-#ifdef HAVE_CONFIG_H
-#include <mb_config.h>
-#endif
-
-#include <Xm/Xm.h>
-#include <Xm/RowColumn.h>
-#include <stdio.h>
-#include <ctype.h>
-#include <string.h>
-
-/*
- * Include stdlib.h and malloc.h if code is C++, ANSI, or Extended ANSI.
- */
-#if defined(__cplusplus) || defined(__STDC__) || defined(__EXTENSIONS__)
-#include <stdlib.h>
-#ifdef HAVE_MALLOC_H
-#include <malloc.h>
-#endif
-#endif
-
-/*****************************************************************************
- *       TYPDEFS AND DEFINES
- *****************************************************************************/
-
-/*
- * Undefine this if you want to use native strcasecmp.
- */
-#define LOCAL_STRCASECMP
-
-#ifdef _NO_PROTO
-#ifdef NeedFunctionPrototypes
-#undef NeedFunctionPrototypes
-#endif
-#endif
-
-/*
- * Define SUPPORTS_WCHARS if the system supports wide character sets
- * Note: the following line flags the VAXC compiler and not the
- * DECC compiler running VAXC emulation.
- */
-#if !((defined(VAXC) && !defined(__DECC)) || defined(__CENTERLINE__))
-#define SUPPORTS_WCHARS
-#endif
-
-/*
- * Handy definition used in SET_BACKGROUND_COLOR
-*/
-#define UNSET		(-1)
-
-/*
- * Set state of inclusion of prototypes properly
- */
-#ifdef NeedFunctionPrototypes
-#define ARGLIST(p)	(
-#define ARG(a, b)	a b,
-#define GRA(a, b)	a b)
-#else
-#define ARGLIST(p)	p
-#define ARG(a, b)	a b;
-#define GRA(a, b)	a b;
-#endif
-
-#ifdef NeedFunctionPrototypes
-#ifdef __cplusplus
-#define UARG(a, b)	a,
-#define GRAU(a, b)	a)
-#else
-#define UARG(a, b)	a b,
-#define GRAU(a, b)	a b)
-#endif
-#else
-#define UARG(a, b)	a b;
-#define GRAU(a, b)	a b;
-#endif
-
-/*
- * Set up strcasecmp function
- */
-#if defined(LOCAL_STRCASECMP)
-#define STRCASECMP	StrCasecmp
-#ifndef NeedFunctionPrototypes
-static int StrCasecmp();
-#else
-static int StrCasecmp(char*, char*);
-#endif
-#else
-#define STRCASECMP	strcasecmp
-#endif
-
-/*
- * Define XTPOINTER so it works with all releases of
- * Xt and c++.
- */
-#ifdef __cplusplus
-#if XtSpecificationRelease < 5
-#define XTPOINTER	char *
-#else
-#define XTPOINTER	XPointer
-#endif
-#else
-#define XTPOINTER	XtPointer
-#endif
-
-/*
- * The following enum is used to support wide character sets.
- * Use this enum for references into the Common Wide Characters array.
- * If you add to the array, ALWAYS keep NUM_COMMON_WCHARS as the last
- * entry in the enum.  This will maintain correct memory usage, etc.
- */
-enum { WNull, WTab, WNewLine, WCarriageReturn, WFormFeed, WVerticalTab,
-       WBackSlash, WQuote, WHash, WColon, WideF, WideL, WideN, WideR,
-       WideT, WideV, WideUF, WideUL, WideUR, WideUT, WideZero, WideOne,
-       NUM_COMMON_WCHARS };
-
-/*****************************************************************************
- *       GLOBAL DECLARATIONS
- *****************************************************************************/
-
-/*****************************************************************************
- *       EXTERNAL DECLARATIONS
- *****************************************************************************/
-
-/*****************************************************************************
- *	STATIC DECLARATION
- *****************************************************************************/
-
-#ifndef NeedFunctionPrototypes
-
-#ifndef SUPPORTS_WCHARS
-static int	 mblen			();
-#endif
-static int	strlenWc		();
-static size_t	doMbstowcs		();
-static size_t	doWcstombs 		();
-static void	copyWcsToMbs		();
-static int 	dombtowc		();
-static Boolean	extractSegment		();
-static XmString	StringToXmString	();
-static char*	getNextCStrDelim	();
-static int	getCStrCount		();
-static wchar_t *CStrCommonWideCharsGet	();
-
-#else
-
-#ifndef SUPPORTS_WCHARS
-static int 	mblen			(char*, size_t);
-#endif
-static int	strlenWc		(wchar_t*);
-static size_t	doMbstowcs		(wchar_t*, char*, size_t);
-static size_t	doWcstombs 		(char*, wchar_t*, size_t);
-static void	copyWcsToMbs		(char*, wchar_t*, int, Boolean);
-static int 	dombtowc		(wchar_t*, char*, size_t);
-static Boolean	extractSegment		(wchar_t**, wchar_t**, int *,
-					 wchar_t**, int*, int*,	Boolean*);
-static XmString	StringToXmString	(char*);
-static char*	getNextCStrDelim	(char*);
-static int	getCStrCount		(char*);
-static wchar_t *CStrCommonWideCharsGet	();
-
-#endif
-
-/*****************************************************************************
- *	STATIC CODE
- *****************************************************************************/
-
-#if defined(LOCAL_STRCASECMP)
-
-/*
- * Function:
- *      cmp = StrCasecmp(s1, s2);
- * Description:
- *      Compare two strings ignoring case
- * Input:
- *      s1 - char * : string 1 to compare
- *      s2 - char * : string 2 to compare
- * Output:
- *      int :  0; s1 == s2
- *             1; s1 != s2
- */
-static int StrCasecmp
-    ARGLIST((s1, s2))
-        ARG(register char *, s1)
-        GRA(register char *, s2)
-{
-    register int        c1, c2;
-
-    while (*s1 && *s2)
-    {
-        c1 = isupper(*s1) ? tolower(*s1) : *s1;
-        c2 = isupper(*s2) ? tolower(*s2) : *s2;
-        if (c1 != c2)
-        {
-            return(1);
-        }
-        s1++;
-        s2++;
-    }
-    if (*s1 || *s2)
-    {
-        return(1);
-    }
-    return(0);
-}
-#endif
-
-#ifndef SUPPORTS_WCHARS
-/*
- * Function:
- *      len = mblen(s, n);
- * Description:
- *      The mblen function for platforms that don't have one. This
- * 	function simply returns a length of 1 since no wide character
- *	support exists for this platform.
- * Input:
- *      s - char * : the character string to get the length from
- *	n - size_t : the size of the string
- * Output:
- *      int : always 1
- */
-static int mblen
-    ARGLIST((s, n))
-        ARG(char *, s)
-        GRA(size_t, n)
-{
-    return(1);
-}
-#endif
-
-/*
- * Function:
- *      len = strlenWc(ptr);
- * Description:
- *      Return the number of characters in a wide character string (not
- *	the characters in the resultant mbs).
- * Input:
- *      ptr - wchar_t* : pointer to the wcs to count
- * Output:
- *      int : the number of characters found
- */
-static int strlenWc
-    ARGLIST((ptr))
-        GRA(wchar_t *,ptr)
-{
-    register wchar_t	*p = ptr;
-    register int	x = 0;
-
-    if (!ptr) return(0);
-
-    while (*p++) x++;
-    return (x);
-}
-
-/*
- * Function:
- *      bytesConv = doMbstowcs(wcs, mbs, n);
- * Description:
- *      Create a wcs string from an input mbs.
- * Input:
- *	wcs - wchar_t* : pointer to result buffer of wcs
- *      mbs - char* : pointer to the source mbs
- *	n - size_t : the number of characters to convert
- * Output:
- *      bytesConv - size_t : number of bytes converted
- */
-static size_t doMbstowcs
-    ARGLIST((wcs, mbs, n))
-        ARG(wchar_t *,wcs)
-        ARG(char *, mbs)
-        GRA(size_t, n)
-{
-#ifndef SUPPORTS_WCHARS
-    int i;
-
-    for (i = 0; i < n && mbs[i] != 0; ++i)
-    {
-	wcs[i] = mbs[i];
-    }
-    wcs[i++] = 0;
-    return(i);
-#else
-    return(mbstowcs(wcs, mbs, n));
-#endif
-}
-
-/*
- * Function:
- *      bytesConv = doWcstombs(wcs, mbs, n);
- * Description:
- *      Create a mbs string from an input wcs.
- * Input:
- *	wcs - wchar_t* : pointer to the source wcs
- *      mbs - char* : pointer to result mbs buffer
- *	n - size_t : the number of characters to convert
- * Output:
- *      bytesConv - size_t : number of bytes converted
- */
-static size_t doWcstombs
-    ARGLIST((mbs, wcs, n))
-        ARG(char *, mbs)
-        ARG(wchar_t *, wcs)
-        GRA(size_t, n)
-{
-#ifndef SUPPORTS_WCHARS
-    int i;
-
-    for (i = 0; i < n && wcs[i] != 0; ++i)
-    {
-	mbs[i] = wcs[i];
-    }
-    mbs[i] = 0;
-    return(i);
-#else
-    size_t	retval;
-
-    retval = wcstombs(mbs, wcs, (n * sizeof(wchar_t)));
-    if ( retval == (size_t)-1 ) return(0);
-    else return(retval);
-#endif
-}
-
-/*
- * Function:
- *      copyWcsToMbs(mbs, wcs, len);
- * Description:
- *      Create a mbs string from an input wcs. This function allocates
- *	a buffer if necessary.
- * Input:
- *	mbs - char* : destination for the converted/copied output
- *	wcs - wchar_t* : pointer to wcs to copy/convert
- *	len - int : the number of wchar_t' to convert
- *	process_it - Boolean : True if processing of quoted charcters,
- *			False if blind.
- * Output:
- *      None
- */
-static void copyWcsToMbs
-    ARGLIST((mbs, wcs, len, process_it))
-        ARG(char *, mbs)
-        ARG(wchar_t *, wcs)
-        ARG(int, len)
-        GRA(Boolean, process_it)
-{
-    static	wchar_t	*tbuf = NULL;
-    static	int	tbufSize = 0;
-
-    int		numCvt;
-    int		lenToConvert;
-    wchar_t	*fromP = wcs;
-    wchar_t	*x = &fromP[len];
-    wchar_t	*toP;
-    wchar_t	*commonWChars = CStrCommonWideCharsGet();
-    wchar_t	tmp;
-
-    /*
-     * Make sure there's room in the buffer
-     */
-    if (tbufSize < len)
-    {
-	tbuf = (wchar_t*)XtRealloc((char*)tbuf, (len + 1) * sizeof(wchar_t));
-	tbufSize = len;
-    }
-
-    /*
-     * Now copy and process
-     */
-    toP = tbuf;
-    lenToConvert = 0;
-    while (fromP < x)
-    {
-	/*
-	 * Check for quoted characters
-	 */
-	if ((*fromP == commonWChars[WBackSlash]) && process_it)
-	{
-	    fromP++;		/* Skip quote */
-	    if (fromP == x)	/* Hanging quote? */
-	    {
-		*toP++ = commonWChars[WBackSlash];
-		lenToConvert++;
-		break;
-	    }
-	    tmp = *fromP++;
-	    if (tmp == commonWChars[WideN])
-	    {
-		*toP++ = commonWChars[WNewLine];
-	    }
-	    else if (tmp == commonWChars[WideT])
-	    {
-		*toP++ = commonWChars[WTab];
-	    }
-	    else if (tmp == commonWChars[WideR])
-	    {
-		*toP++ = commonWChars[WCarriageReturn];
-	    }
-	    else if (tmp == commonWChars[WideF])
-	    {
-		*toP++ = commonWChars[WFormFeed];
-	    }
-	    else if (tmp == commonWChars[WideV])
-	    {
-		*toP++ = commonWChars[WVerticalTab];
-	    }
-	    else if (tmp == commonWChars[WBackSlash])
-	    {
-		*toP++ = commonWChars[WBackSlash];
-	    }
-	    else
-	    {
-                /*
-		 * No special translation needed
-		 */
-		*toP++ = tmp;
-	    }
-	}
-	else
-	{
-	    *toP++ = *fromP++;
-	}
-	lenToConvert++;
-    }
-
-    tmp = tbuf[lenToConvert];
-    tbuf[lenToConvert] = (wchar_t) 0;
-    numCvt = doWcstombs(mbs, tbuf, lenToConvert);
-    tbuf[lenToConvert] = tmp;
-
-    mbs[numCvt] = '\0';
-}
-
-/*
- * Function:
- *      status = dombtowc(wide, multi, size);
- * Description:
- *      Convert a multibyte character to a wide character.
- * Input:
- *      wide	- wchar_t *	: where to put the wide character
- *	multi	- char *	: the multibyte character to convert
- *	size	- size_t	: the number of characters to convert
- * Output:
- *      0	- if multi is a NULL pointer or points to a NULL character
- *	#bytes	- number of bytes in the multibyte character
- *	-1	- multi is an invalid multibyte character.
- *
- *	NOTE:  if wide is NULL, then this returns the number of bytes in
- *	       the multibyte character.
- */
-static int dombtowc
-    ARGLIST((wide, multi, size))
-        ARG(wchar_t *, wide)
-        ARG(char *, multi)
-        GRA(size_t, size)
-{
-    int		retVal = 0;
-
-#ifndef SUPPORTS_WCHARS
-    if ((multi == NULL) || (*multi == '\000'))
-    {
-	if (wide) wide[0] = '\0';
-	return (0);
-    }
-
-    for (retVal = 0; retVal < size && multi[retVal] != '\000'; retVal++)
-    {
-	if (wide != NULL)
-	{
-	    wide[retVal] = multi[retVal];
-	}
-    }
-#else
-    retVal = mbtowc(wide, multi, size);
-#endif
-    return(retVal);
-}
-
-/*
- * Function:
- *	ptr = getNextSepartor(str);
- * Description:
- *	Parse through a string looking for the next compound string
- *	field separator
- * Inputs:
- *	str - wchar_t* : the address of address of the string to parse
- * Outputs:
- *	ptr - wchar_t* : pointer to character, if found, points to end
- *			of string otherwise ('\0').
- */
-static wchar_t* getNextSeparator
-    ARGLIST((str))
-        GRA(wchar_t *, str)
-{
-    wchar_t	*ptr = str;
-    wchar_t	*commonWChars = CStrCommonWideCharsGet();
-
-    while (*ptr)
-    {
-	/*
-	 * Check for separator
-	 */
-	if ((*ptr == commonWChars[WHash]) ||
-	    (*ptr == commonWChars[WQuote]) ||
-	    (*ptr == commonWChars[WColon]))
-	{
-	    return(ptr);
-	}
-	else if (*ptr == commonWChars[WBackSlash])
-	{
-	    ptr++;
-	    if (*ptr) ptr++;	/* Skip quoted character */
-	}
-	else
-	{
-	    ptr++;
-	}
-    }
-    return(ptr);
-}
-
-/*
- * Function:
- *	more =
- *        extractSegment(str, tagStart, tagLen, txtStart, txtLen,
- *			pDir, pSep);
- * Description:
- *	Parse through a string version of a compound string and extract
- *	the first compound string segment from the string.
- * Inputs:
- *	str - char** : the address of address of the string to parse
- *	tagStart - char** : address to return pointer to tag start into
- *	tagLen - int* : address where to return the tag length into
- *	txtStart - char** : address to return the text start into
- *	txtLen - int* : address where to return the text length
- *	pDir - int* : address to return the string direction into
- *	pSep - Boolean * : address to return the separtor into
- * Outputs:
- *	more - Boolean : True if more of the string to parse.
- *			False means done.
- */
-static Boolean extractSegment
-    ARGLIST((str, tagStart, tagLen, txtStart, txtLen, pDir, pSep))
-        ARG(wchar_t **, str)
-        ARG(wchar_t **, tagStart)
-        ARG(int *, tagLen)
-        ARG(wchar_t **, txtStart)
-        ARG(int *, txtLen)
-        ARG(int *, pDir)
-        GRA(Boolean *, pSep)
-{
-    wchar_t		*start;
-    wchar_t		*text;
-    int			textL;
-    Boolean		tagSeen;
-    wchar_t		*tag;
-    int			tagL;
-    Boolean		modsSeen;
-    Boolean		sep;
-    int			dir;
-    Boolean		done;
-    Boolean		checkDir;
-    wchar_t		*commonWChars;
-    wchar_t		emptyStrWcs[1];
-
-    /*
-     * Initialize variables
-     */
-    text = NULL;
-    textL = 0;
-    tagSeen = False;
-    tag = NULL;
-    tagL = 0;
-    modsSeen = False;
-    dir = XmSTRING_DIRECTION_L_TO_R;
-    sep = False;
-    done = False;
-    commonWChars = CStrCommonWideCharsGet();
-
-    /*
-     * Guard against nulls
-     */
-    if (!(start = *str))
-    {
-	start = emptyStrWcs;
-	emptyStrWcs[0] = commonWChars[WNull];
-    }
-
-    /*
-     * If the first character of the string isn't a # or a ", then we
-     * just have a regular old simple string. Do the same the thing for
-     * the empty string.
-     */
-    if ((*start == '\0') || (start != getNextSeparator(start)))
-    {
-	text = start;
-	if (!(textL = strlenWc(start)))
-	{
-	    text = NULL;
-	}
-	start += textL;
-    }
-    else
-    {
-	done = False;
-	while (!done)
-	{
-	    if (*start == commonWChars[WHash])
-	    {
-		if (tagSeen)
-		{
-		    done = True;
-		    break;
-		}
-		else
-		{
-		    tagSeen = True;
-		    tag = ++start;
-		    start = getNextSeparator(tag);
-		    if ((tagL = start - tag) == 0)
-		    {
-			tag = NULL;		/* Null tag specified */
-		    }
-		}
-	    }
-	    else if (*start == commonWChars[WQuote])
-	    {
-		text = ++start;
-		start = getNextSeparator(start);
-		while (!((*start == commonWChars[WQuote]) ||
-			 (*start == commonWChars[WNull])))
-		{
-		    start = getNextSeparator(++start);
-		}
-
-		if ((textL = start - text) == 0)
-		{
-		    text = NULL;	/* Null text specified  */
-		}
-                /*
-		 * if a quote, skip over it
-		 */
-		if (*start == commonWChars[WQuote])
-		{
-		    start++;
-		}
-		done = True;
-	    }
-	    else if (*start == commonWChars[WColon])
-	    {
-		if (modsSeen)
-		{
-		    done = True;
-		    break;
-		}
-
-		/*
-		 * If the next character is a t or f, the we've got
-		 * a separator.
-		 */
-		modsSeen = True;
-		checkDir = False;
-		start++;
-		if ((*start == commonWChars[WideT]) ||
-		    (*start == commonWChars[WideUT]) ||
-		    (*start == commonWChars[WideOne]))
-		{
-		    sep = True;
-		    start++;
-		    checkDir = True;
-		}
-		else if ((*start == commonWChars[WideF]) ||
-			 (*start == commonWChars[WideUF]) ||
-			 (*start == commonWChars[WideZero]))
-		{
-		    sep = False;
-		    start++;
-		    checkDir = True;
-		}
-		else if ((*start == commonWChars[WideR]) ||
-			 (*start == commonWChars[WideUR]))
-		{
-		    start++;
-		    dir = XmSTRING_DIRECTION_R_TO_L;
-		}
-		else if ((*start == commonWChars[WideL]) ||
-			 (*start == commonWChars[WideUL]))
-		{
-		    start++;
-		    dir = XmSTRING_DIRECTION_L_TO_R;
-		}
-		/*
-		 * Look for direction if necessary. This requires a bit of
-		 * look ahead.
-		 */
-		if (checkDir && (*start == commonWChars[WColon]))
-		{
-		    if ((*(start + 1) == commonWChars[WideL]) ||
-			(*(start + 1) == commonWChars[WideUL]))
-		    {
-			dir = XmSTRING_DIRECTION_L_TO_R;
-			start += 2;
-		    }
-		    else if ((*(start + 1) == commonWChars[WideR]) ||
-			     (*(start + 1) == commonWChars[WideUR]))
-		    {
-			dir = XmSTRING_DIRECTION_R_TO_L;
-			start+=2;
-		    }
-		}
-	    }
-            else
-	    {
-		/*
-		 * A bad string format! We'll just skip the character.
-		 */
-		start++;
-	    }
-	}
-    }
-
-    /*
-     * Now fill in return values
-     */
-    if (*str)		*str = start;
-    if (tagStart)	*tagStart = tag;
-    if (tagLen)		*tagLen = tagL;
-    if (txtStart)	*txtStart = text;
-    if (txtLen)		*txtLen = textL;
-    if (pDir)		*pDir = dir;
-    if (pSep)		*pSep = sep;
-
-    return ((*start == commonWChars[WNull]) ? False : True);
-}
-
-/*
- * Function:
- *	xstr = StringToXmString(str);
- * Description:
- *	Parse a string into an XmString.
- * Inputs:
- *	str - char * : the string to parse
- * Outputs:
- *	xstr - XmString : the allocated return structure
- */
-static XmString StringToXmString
-    ARGLIST((str))
-        GRA(char *,str)
-{
-    static char*	tagBuf = NULL;
-    static int		tagBufLen = 0;
-    static char*	textBuf = NULL;
-    static int		textBufLen = 0;
-
-    wchar_t		*ctx;
-    wchar_t		*tag;
-    int			tagLen;
-    wchar_t		*text;
-    int			textLen;
-    Boolean		sep;
-    int			dir;
-
-    Boolean		more;
-    wchar_t		*wcStr;
-    int			curDir;
-    XmString		xmStr;
-    XmString		s1;
-    XmString		s2;
-
-    if (!str) return(NULL);
-
-    /*
-     * For expediencies sake, we'll overallocate this buffer so that
-     * the wcs is guaranteed to fit (1 wc per byte in original string).
-     */
-    wcStr = (wchar_t*)XtMalloc((strlen(str) + 1) * sizeof(wchar_t));
-    doMbstowcs(wcStr, str, strlen(str) + 1);
-
-    /*
-     * Create the beginning segment
-     */
-    curDir = XmSTRING_DIRECTION_L_TO_R;
-    xmStr = XmStringDirectionCreate(curDir);
-
-    /*
-     * Convert the string.
-     */
-    more = True;
-    ctx = wcStr;
-    while (more)
-    {
-	more = extractSegment(&ctx, &tag, &tagLen,
-			      &text, &textLen, &dir, &sep);
-	/*
-	 * Pick up a direction change
-	 */
-	if (dir != curDir)
-	{
-#if defined(VMS) || (defined(__osf__) && defined(__alpha))
-#if XmVERSION > 1 || (XmVERSION == 1 && XmREVISION >= 2)
-	    /*
-	     * This is required on DEC Windows systems because they've
-	     * added the REVERT direction.
-	     */
-	    s1 = XmStringDirectionCreate(XmSTRING_DIRECTION_REVERT);
-	    s2 = xmStr;
-	    xmStr = XmStringConcat(s2, s1);
-	    XmStringFree(s1);
-	    XmStringFree(s2);
-#endif
-#endif
-	    curDir = dir;
-	    s1 = XmStringDirectionCreate(curDir);
-	    s2 = xmStr;
-	    xmStr = XmStringConcat(s2, s1);
-	    XmStringFree(s1);
-	    XmStringFree(s2);
-
-	}
-
-	/*
-	 * Create the segment. Text and tag first.
-	 */
-	if (textLen)
-	{
-	    if (textBufLen <= (textLen * sizeof(wchar_t)))
-	    {
-		textBufLen = (textLen + 1) * sizeof(wchar_t);
-		textBuf = (char*)XtRealloc(textBuf, textBufLen);
-	    }
-	    copyWcsToMbs(textBuf, text, textLen, True);
-
-	    if (tagLen)
-	    {
-		if (tagBufLen <= (tagLen * sizeof(wchar_t)))
-		{
-		    tagBufLen = (tagLen + 1) * sizeof(wchar_t);
-		    tagBuf = (char*)XtRealloc(tagBuf, tagBufLen);
-		}
-		copyWcsToMbs(tagBuf, tag, tagLen, False);
-	    }
-	    else
-	    {
-		if (!tagBuf)
-		{
-		    tagBufLen = strlen(XmSTRING_DEFAULT_CHARSET) + 1;
-		    tagBuf = (char*)XtMalloc(tagBufLen);
-		}
-		strcpy(tagBuf, XmSTRING_DEFAULT_CHARSET);
-	    }
-
-	    s1 = XmStringCreate(textBuf, tagBuf);
-	    s2 = xmStr;
-	    xmStr = XmStringConcat(s2, s1);
-	    XmStringFree(s1);
-	    XmStringFree(s2);
-	}
-
-	/*
-	 * Add in the separators.
-	 */
-	if (sep)
-	{
-	    s1 = XmStringSeparatorCreate();
-	    s2 = xmStr;
-	    xmStr = XmStringConcat(s2, s1);
-	    XmStringFree(s1);
-	    XmStringFree(s2);
-	}
-    }
-
-    /*
-     * Free up memory and return
-     */
-    XtFree((char*)wcStr);
-    return(xmStr);
-}
-
-/*
- * Function:
- *      nextCStr = getNextCStrDelim(str);
- * Description:
- *      Find the next unquoted , or \n in the string
- * Input:
- *	str - char * : the input string
- * Output:
- *      nextCStr - char* : pointer to the next delimiter. Returns NULL if no
- *			delimiter found.
- */
-static char* getNextCStrDelim
-    ARGLIST((str))
-        GRA(char *,str)
-{
-    char	*comma = str;
-    Boolean	inQuotes = False;
-    int		len;
-
-    if (!str) return(NULL);
-    if (!*str) return(NULL);	/* At end */
-
-#ifdef __CENTERLINE__
-    len = mblen((char *)NULL, sizeof(wchar_t));
-#else
-    len = mblen(NULL, sizeof(wchar_t));
-#endif
-    while (*comma)
-    {
-	if ((len = mblen(comma, sizeof(wchar_t))) > 1)
-	{
-	    comma += len;
-	    continue;
-	}
-
-	if (*comma == '\\')
-	{
-	    comma++;	/* Over quote */
-	    comma += mblen(comma, sizeof(wchar_t));
-	    continue;
-	}
-
-	/*
-	 * See if we have a delimiter
-	 */
-	if (!inQuotes)
-	{
-	    if ((*comma == ',') || (*comma == '\012'))
-	    {
-		return(comma);
-	    }
-	}
-
-	/*
-	 * Deal with quotes
-	 */
-	if (*comma == '\"')
-	{
-	    inQuotes = ~inQuotes;
-	}
-
-	comma++;
-    }
-
-    return(NULL);		/* None found */
-}
-
-/*
- * Function:
- *	cnt = getCStrCount(str);
- * Description:
- *      Get the count of cstrings in a compound string table ascii
- *	format.
- * Input:
- *      str - char * : string to parse
- * Output:
- *      cnt - int : the number of XmStrings found
- */
-static int getCStrCount
-    ARGLIST((str))
-        GRA(char *, str)
-{
-    int		x = 1;
-    char	*newStr;
-
-    if (!str) return(0);
-    if (!*str) return(0);
-
-    while ((newStr = getNextCStrDelim(str)))
-    {
-	x++;
-	str = ++newStr;
-    }
-    return(x);
-}
-
-/*
- * Function:
- *      cwc = CStrCommonWideCharsGet();
- * Description:
- *      Return the array of common wide characters.
- * Input:
- *      None.
- * Output:
- *     	cwc - wchar_t * : this array should never be written to or FREEd.
- */
-static wchar_t *CStrCommonWideCharsGet()
-{
-    static wchar_t	*CommonWideChars = NULL;
-    /*
-     * If you add to this array, don't forget to change the enum in
-     * the TYPEDEFS and DEFINES section above to correspond to this
-     * array.
-     */
-    static char	*characters[] = { "\000", "\t", "\n", "\r", "\f", "\v",
-				  "\\", "\"", "#", ":", "f", "l", "n", "r",
-				  "t", "v", "F", "L", "R", "T", "0", "1" };
-
-
-    if (CommonWideChars == NULL)
-    {
-	int	i;
-
-	/*
-	 * Allocate and create the array.
-	 */
-	CommonWideChars = (wchar_t*)XtMalloc(NUM_COMMON_WCHARS * sizeof(wchar_t));
-
-	for (i = 0; i < NUM_COMMON_WCHARS; i++)
-	{
-	    (void)dombtowc(&(CommonWideChars[i]), characters[i], 1);
-	}
-    }
-    return(CommonWideChars);
-}
-
-/*
- * Function:
- *	CONVERTER CvtStringToXmString
- *
- * Description:
- *	Convert a string to an XmString. This allows a string contained in
- *	resource file to contain multiple fonts. The syntax for the string
- *	is:
- *		::[#[font-tag]]"string"[#[font-tag]"string"] ...
- *
- *	note that the # can be escaped (\#).
- *
- * Input:
- * Output:
- *	Standard.
- */
-static Boolean CvtStringToXmString
-    ARGLIST((d, args, num_args, fromVal, toVal, data))
-        ARG(Display *, d)
-        UARG(XrmValue *, args)
-        ARG(Cardinal *, num_args)
-        ARG(XrmValue *, fromVal)
-        ARG(XrmValue *, toVal)
-        GRAU(XtPointer, data)
-{
-    static XmString	resStr;
-    char		*str;
-
-    /*
-     * This converter takes no parameters
-     */
-    if (*num_args != 0)
-    {
-	XtAppWarningMsg(XtDisplayToApplicationContext(d),
-			"cvtStringToXmString",
-			"wrongParameters",
-			"XtToolkitError",
-			"String to XmString converter needs no extra arguments",
-			(String *)NULL,
-			(Cardinal *)NULL);
-    }
-
-    /*
-     * See if this is a simple string
-     */
-    str = (char*)fromVal->addr;
-    if (strncmp(str, "::", 2))
-    {
-	resStr = XmStringCreateLtoR(fromVal->addr, XmSTRING_DEFAULT_CHARSET);
-    }
-    else
-    {
-	/*
-	 * Convert into internal format
-	 */
-	resStr = StringToXmString(fromVal->addr + 2);	/* skip :: */
-    }
-
-    /*
-     * Done, return result
-     */
-    if (toVal->addr == NULL)
-    {
-	toVal->addr = (XTPOINTER)&resStr;
-	toVal->size = sizeof(XmString);
-    }
-    else if (toVal->size < sizeof(XmString))
-    {
-	toVal->size = sizeof(XmString);
-	XtDisplayStringConversionWarning(d, fromVal->addr, "XmString");
-	XmStringFree(resStr);
-	return(False);
-    }
-    else
-    {
-	*(XmString *)toVal->addr = resStr;
-	toVal->size = sizeof(XmString);
-    }
-    return(True);
-}
-
-/*
- * Function:
- *      CONVERTER CvtStringToXmStringTable
- *
- * Description:
- *	Convert a string to an XmString table. This allows a string
- *	contained in resource file to contain multiple fonts. The syntax
- *	for the string is:
- *
- *	   compound_string = [#[font-tag]]"string"[#[font-tag]"string"] ...
- *	   compound_string_table = [compound_string][,compound_string] ...
- *
- *	note that the # can be escaped (\#).
- *
- * Input:
- * Output:
- *	Standard.
- */
-static Boolean CvtStringToXmStringTable
-    ARGLIST((d, args, num_args, fromVal, toVal, data))
-        ARG(Display *, d)
-        ARG(XrmValue *, args)
-        ARG(Cardinal *, num_args)
-        ARG(XrmValue *, fromVal)
-        ARG(XrmValue *, toVal)
-        GRAU(XtPointer, data)
-{
-    static XmString	*CStrTable;
-    XmString		*tblPtr;
-    char		*str;
-    char		*tmpBuf;
-    char		*nextDelim;
-    XrmValue		fVal;
-    XrmValue		tVal;
-
-    /*
-     * This converter takes no parameters
-     */
-    if (*num_args != 0)
-    {
-	XtAppWarningMsg
-	    (XtDisplayToApplicationContext(d),
-	     "cvtStringToXmStringTable",
-	     "wrongParameters",
-	     "XtToolkitError",
-	     "String to XmStringTable converter needs no extra arguments",
-	     (String *)NULL,
-	     (Cardinal *)NULL);
-    }
-
-    /*
-     * Set str and make sure there's somethin' there
-     */
-    if (!(str = (char*)fromVal->addr))
-    {
-	str = "";
-    }
-
-    /*
-     * Allocate the XmStrings + 1 for NULL termination
-     */
-    CStrTable = (XmString*)XtMalloc((getCStrCount(str) + 1) * sizeof(XmString*));
-
-    /*
-     * Use the string converter for the strings
-     */
-    tmpBuf = (char*)XtMalloc(strlen(str) + 1);
-    strcpy(tmpBuf, str);
-    str = tmpBuf;
-
-    /*
-     * Create strings
-     */
-    tblPtr = CStrTable;
-    if (*str)
-    {
-	while (str)
-	{
-	    nextDelim = getNextCStrDelim(str);
-
-	    /*
-	     * Overwrite nextDelim
-	     */
-	    if (nextDelim)
-	    {
-		*nextDelim = '\0';
-		nextDelim++;
-	    }
-
-	    /*
-	     * Convert it
-	     */
-	    fVal.size = strlen(str) + 1;
-	    fVal.addr = str;
-	    tVal.size = sizeof(XTPOINTER);
-	    tVal.addr = (XTPOINTER)tblPtr;
-
-	    /*
-	     * Call converter ourselves since this is used to create
-	     * the strings in the table we create. We need to do this
-	     * since we don't have a widget to send to the XtConvertAndStore
-	     * function. Side effects are that we can never get these
-	     * compound strings cached and that no destructor function is
-	     * called when the strings leave existance, but we nuke 'em
-	     * in the XmStringTable destuctor.
-	     */
-	    CvtStringToXmString(d, args, num_args, &fVal, &tVal, NULL);
-	    tblPtr++;
-	    str = nextDelim;
-	}
-    }
-    XtFree(tmpBuf);
-
-    /*
-     * Null terminate
-     */
-    *tblPtr = NULL;
-
-    /*
-     * Done, return result
-     */
-    if (toVal->addr == NULL)
-    {
-	toVal->addr = (XTPOINTER)&CStrTable;
-	toVal->size = sizeof(XmString);
-    }
-    else if (toVal->size < sizeof(XmString*))
-    {
-	toVal->size = sizeof(XmString*);
-	XtDisplayStringConversionWarning(d, fromVal->addr, "XmStringTable");
-
-	tblPtr = CStrTable;
-	while (*tblPtr)
-	{
-	    XmStringFree(*tblPtr);
-	}
-	XtFree((char*)CStrTable);
-	return(False);
-    }
-    else
-    {
-	*(XmString **)toVal->addr = CStrTable;
-	toVal->size = sizeof(XmString*);
-    }
-    return(True);
-}
-
-/*****************************************************************************
- *	GLOBAL CODE
- *****************************************************************************/
-
-/*
- * Function:
- *      RegisterBxConverters(appContext);
- * Description:
- *      This globally available function installs all the converters necessary
- *	to run BuilderXcessory generated interfaces that use compound
- *	strings. This is necessary since Motif has not supplied very smart
- *	converters.
- * Input:
- *      appContext - XtAppContext : the application context
- * Output:
- *      None
- */
-void RegisterBxConverters
-    ARGLIST((appContext))
-        GRA(XtAppContext, appContext)
-{
-    XtAppSetTypeConverter(appContext, XmRString, XmRXmString,
-			  (XtTypeConverter)CvtStringToXmString,
-			  NULL, 0, XtCacheNone, NULL);
-
-    XtAppSetTypeConverter(appContext, XmRString, XmRXmStringTable,
-			  (XtTypeConverter)CvtStringToXmStringTable,
-			  NULL, 0, XtCacheNone, NULL);
-}
-
-/*
- * Function:
- *      CONVERT(w, from_string, to_type, to_size, success);
- * Description:
- *      A converter wrapper for convenience from BuilderXcessory.
- * Input:
- *      w - Widget : the widget to use for conversion
- *	from_string - char * : the string to convert from
- *	to_type - char * : the type to convert to
- *	to_size - int : the size of the conversion result
- *	success - Boolean* : Set to the result value of the conversion
- * Output:
- *      None
- */
-#ifndef IGNORE_CONVERT
-XtPointer BX_CONVERT
-    ARGLIST((w, from_string, to_type, to_size, success))
-        ARG(Widget, w)
-        ARG(char *, from_string)
-        ARG(char *, to_type)
-        UARG(int, to_size)
-        GRA(Boolean *, success)
-{
-    XrmValue		fromVal, toVal;	/* resource holders		*/
-    Boolean		convResult;	/* return value			*/
-    XtPointer		val;		/* Pointer size return value    */
-
-    /*
-     * We will assume that the conversion is going to fail and change this
-     * value later if the conversion is a success.
-     */
-    *success = False;
-
-    /*
-     * Since we are converting from a string to some type we need to
-     * set the fromVal structure up with the string information that
-     * the caller passed in.
-     */
-    fromVal.size = strlen(from_string) + 1;
-    fromVal.addr = from_string;
-
-    /*
-     * Since we are not sure what type and size of data we are going to
-     * get back we will set this up so that the converter will point us
-     * at a block of valid data.
-     */
-    toVal.size = 0;
-    toVal.addr = NULL;
-
-    /*
-     * Now lets try to convert this data by calling this handy-dandy Xt
-     * routine.
-     */
-    convResult = XtConvertAndStore(w, XmRString, &fromVal, to_type, &toVal);
-
-
-    /*
-     * Now we have two conditions here.  One the conversion was a success
-     * and two the conversion failed.
-     */
-    if(!convResult)
-    {
-	/*
-	 * If this conversion failed that we can pretty much return right
-	 * here because there is nothing else we can do.
-	 */
-	return((XtPointer) NULL);
-    }
-
-    /*
-     * If we get this far that means we did the conversion and all is
-     * well.  Now we have to handle the special cases for type and
-     * size constraints.
-     */
-    if(!strcmp(to_type, "String"))
-    {
-	/*
-	 * Since strings are handled different in Xt we have to deal with
-	 * the conversion from a string to a string.  When this happens the
-	 * toVal.size will hold the strlen of the string so generic
-	 * conversion code can't handle it.  It is possible for a string to
-	 * string conversion to happen so we do have to watch for it.
-	 */
-	val = (XTPOINTER)toVal.addr;
-    }
-    else if(!strcmp(to_type, "Double"))
-    {
-	val = (XTPOINTER)((double*)toVal.addr);
-    }
-    else if(!strcmp(to_type, "Float"))
-    {
-	val = (XTPOINTER)((float*)toVal.addr);
-    }
-    else
-    {
-	/*
-	 * Here is the generic conversion return value handler.  This
-	 * just does some size specific casting so that value that we
-	 * return is in the correct bytes of the XtPointer that we
-	 * return.  Here we check all sizes from 1 to 8 bytes.
-	 */
-	switch(toVal.size)
-	{
-	case 1:
-	    val = (XTPOINTER)(long)(*(char*)toVal.addr);
-	    break;
-	case 2:
-	    val = (XTPOINTER)(long)(*(short*)toVal.addr);
-	    break;
-	case 4:
-	    val = (XTPOINTER)(long)(*(int*)toVal.addr);
-	    break;
-	case 8:
-	default:
-	    val = (XTPOINTER)(long)(*(long*)toVal.addr);
-	    break;
-	}
-    }
-
-    /*
-     * Well everything is done and the conversion was a success so lets
-     * set the success flag to True.
-     */
-    *success = convResult;
-
-    /*
-     * Finally lets return the converted value.
-     */
-    /*SUPPRESS 80*/
-    return(val);
-}
-
-#ifdef DEFINE_OLD_BXUTILS
-XtPointer CONVERT
-    ARGLIST((w, from_string, to_type, to_size, success))
-        ARG(Widget, w)
-        ARG(char *, from_string)
-        ARG(char *, to_type)
-        ARG(int, to_size)
-        GRA(Boolean *, success)
-{
-    return(BX_CONVERT(w, from_string, to_type, to_size, success));
-}
-#endif /* DEFINE_OLD_BXUTILS */
-#endif /* !IGNORE_CONVERT */
-
-/*
- * Function:
- *      MENU_POST(p, mw, ev, dispatch);
- * Description:
- *      A converter wrapper for convenience from BuilderXcessory.
- * Input:
- *      p - Widget : the widget to post
- *	mw - XtPointer : the menu widget
- *	ev - XEvent* : the event that caused the menu post
- *	dispatch - Boolean* : not used
- * Output:
- *      None
- */
-
-#ifndef IGNORE_MENU_POST
-void BX_MENU_POST
-    ARGLIST((p, mw, ev, dispatch))
-        UARG(Widget, p)
-        ARG(XtPointer, mw)
-        ARG(XEvent *, ev)
-        GRAU(Boolean *, dispatch)
-{
-    Arg	args[2];
-    int	argcnt;
-    int	button;
-    Widget m = (Widget)mw;
-    XButtonEvent *e = (XButtonEvent *)ev;
-
-    argcnt = 0;
-    XtSetArg(args[argcnt], XmNwhichButton, &button);
-    argcnt++;
-    XtGetValues(m, args, argcnt);
-    if(e->button != button) return;
-    XmMenuPosition(m, e);
-    XtManageChild(m);
-}
-
-#ifdef DEFINE_OLD_BXUTILS
-void MENU_POST
-    ARGLIST((p, mw, ev, dispatch))
-        UARG(Widget, p)
-        ARG(XtPointer, mw)
-        ARG(XEvent *, ev)
-        GRAU(Boolean *, dispatch)
-{
-    BX_MENU_POST(p, mw, ev, dispatch);
-}
-#endif /* DEFINE_OLD_BXUTILS */
-#endif /* !IGNORE_MENU_POST */
-
-/*
- * Function:
- *      SET_BACKGROUND_COLOR(w, args, argcnt, bg_color);
- * Description:
- *      Sets the background color and shadows of a widget.
- * Input:
- *      w - The widget to set the background color on.
- *      args, argcnt - The argument list so far.
- *      bg_color - The new background color as a pixel.
- * Output:
- *      none
- *
- *  NOTES:  This assumes that args later in the argument list
- *          override those already in the list.  Therfore i f
- *          there are shadow colors later in the list they will win.
- *
- *          There is no need to use this function when creating a widget
- *          only when doing a set values, shadow colors are automatically
- *          calculated at creation time.
- */
-void BX_SET_BACKGROUND_COLOR
-    ARGLIST((w, args, argcnt, bg_color))
-        ARG(Widget, w)
-        ARG(ArgList, args)
-        ARG(Cardinal *, argcnt)
-        GRA(Pixel, bg_color)
-{
-#if ((XmVERSION == 1) && (XmREVISION > 0))
-
-    /*
-     * Walk through the arglist to see if the user set the top or
-     * bottom shadow colors.
-     */
-    selectLoc = topShadowLoc =  bottomShadowLoc = UNSET;
-    for (i = 0; i < *argcnt; i++)
-    {
-	if ((strcmp(args[i].name, XmNtopShadowColor) == 0) ||
-	    (strcmp(args[i].name, XmNtopShadowPixmap) == 0))
-	{
-	    topShadowLoc = i;
-	}
-	else if ((strcmp(args[i].name, XmNbottomShadowColor) == 0) ||
-		 (strcmp(args[i].name, XmNbottomShadowPixmap) == 0))
-	{
-	    bottomShadowLoc = i;
-	}
-	else if (strcmp(args[i].name, XmNarmColor) == 0)
-	{
-	    selectLoc = i;
-	}
-	else if (strcmp(args[i].name, XmNforeground) == 0)
-	{
-	    fgLoc = i;
-	}
-    }
-
-    /*
-     * If either the top or bottom shadow are not set then we
-     * need to use XmGetColors to get the shadow colors from the backgound
-     * color and add those that are not already in the arglist to the
-     * arglist.
-     *
-     */
-    if ((bottomShadowLoc == UNSET) ||
-	(topShadowLoc == UNSET) ||
-	(selectLoc == UNSET) ||
-	(fgLoc == UNSET))
-    {
-	Arg		larg[1];
-	Colormap	cmap;
-	Pixel		topShadow;
-	Pixel		bottomShadow;
-	Pixel		select;
-	Pixel		fgColor;
-
-	XtSetArg(larg[0], XmNcolormap, &cmap);
-	XtGetValues(w, larg, 1);
-	XmGetColors(XtScreen(w), cmap, bg_color,
-		    &fgColor, &topShadow, &bottomShadow, &select);
-
-	if (topShadowLoc == UNSET)
-	{
-	    XtSetArg(args[*argcnt], XmNtopShadowColor, topShadow);
-	    (*argcnt)++;
-	}
-
-	if (bottomShadowLoc == UNSET)
-	{
-	    XtSetArg(args[*argcnt], XmNbottomShadowColor, bottomShadow);
-	    (*argcnt)++;
-	}
-
-	if (selectLoc == UNSET)
-	{
-	    XtSetArg(args[*argcnt], XmNarmColor, select);
-	    (*argcnt)++;
-	}
-
-	if (fgLoc == UNSET)
-	{
-	    XtSetArg(args[*argcnt], XmNforeground, fgColor);
-	    (*argcnt)++;
-	}
-    }
-#endif
-
-    XtSetArg(args[*argcnt], XmNbackground, bg_color); (*argcnt)++;
-}
-
-#ifdef DEFINE_OLD_BXUTILS
-void SET_BACKGROUND_COLOR
-    ARGLIST((w, args, argcnt, bg_color))
-        ARG(Widget, w)
-        ARG(ArgList, args)
-        ARG(Cardinal *, argcnt)
-        GRA(Pixel, bg_color)
-{
-    BX_SET_BACKGROUND_COLOR(w, args, argcnt, bg_color);
-}
-#endif /* DEFINE_OLD_BXUTILS */
-
-/*
- * Function:
- *	w = BxFindTopShell(start);
- * Description:
- *	Go up the hierarhcy until we find a shell widget.
- * Input:
- *      start - Widget : the widget to start with.
- * Output:
- *	w - Widget : the shell widget.
- */
-#ifndef _BX_FIND_TOP_SHELL
-#define _BX_FIND_TOP_SHELL
-
-Widget BxFindTopShell
-    ARGLIST((start))
-        GRA(Widget, start)
-{
-    Widget	p;
-
-    while((p = XtParent(start)))
-    {
-	start = p;
-    }
-    return(start);
-}
-#endif /* _BX_FIND_TOP_SHELL */
-
-/*
- * Function:
- *	BxWidgetIdsFromNames(ref, cbName, stringList)
- * Description:
- *	Return an array of widget ids from a list of widget names.
- * Input:
- *	ref - Widget : reference widget.
- *	cbName - char* : callback name.
- *	stringList - char*: list of widget names.
- * Output:
- *	WidgetList : array of widget IDs.
- */
-
-#ifndef _BX_WIDGETIDS_FROM_NAMES
-#define _BX_WIDGETIDS_FROM_NAMES
-
-WidgetList BxWidgetIdsFromNames
-    ARGLIST((ref, cbName, stringList))
-        ARG(Widget, ref)
-        ARG(char, *cbName)
-        GRA(char, *stringList)
-{
-    WidgetList	wgtIds = NULL;
-    int		wgtCount = 0;
-    Widget	inst;
-    Widget	current;
-    String	tmp;
-    String	start;
-    String	widget;
-    char       *ptr;
-
-    /*
-     * For backward compatibility, remove [ and ] from the list.
-     */
-    tmp = start = XtNewString(stringList);
-    if((start = strchr(start, '[')) != NULL) start++;
-    else start = tmp;
-
-    while((start && *start) && isspace(*start))
-    {
-	start++;
-    }
-    ptr = strrchr(start, ']');
-    if (ptr)
-    {
-	*ptr = '\0';
-    }
-
-    ptr = start + strlen(start) - 1;
-    while(ptr && *ptr)
-    {
-	if (isspace(*ptr))
-	{
-	    ptr--;
-	}
-	else
-	{
-	    ptr++;
-	    break;
-	}
-    }
-    if (ptr && *ptr)
-    {
-	*ptr = '\0';
-    }
-
-    /*
-     * start now points to the first character after the [.
-     * the list is now either empty, one, or more widget
-     * instance names.
-     */
-    start = strtok(start, ",");
-    while(start)
-    {
-        while((start && *start) && isspace(*start))
-        {
-            start++;
-        }
-        ptr = start + strlen(start) - 1;
-        while(ptr && *ptr)
-        {
-            if (isspace(*ptr))
-            {
-                ptr--;
-            }
-            else
-            {
-                ptr++;
-                break;
-            }
-        }
-        if (ptr && *ptr)
-        {
-            *ptr = '\0';
-        }
-
-	/*
-	 * Form a string to use with XtNameToWidget().
-	 */
-        widget = (char *)XtMalloc((strlen(start) + 2) * sizeof(char));
-        sprintf(widget, "*%s", start);
-
-	/*
-	 * Start at this level and continue up until the widget is found
-	 * or until the top of the hierarchy is reached.
-	 */
-	current = ref;
-	while (current != NULL)
-	{
-	    inst = XtNameToWidget(current, widget);
-	    if (inst != NULL )
-	    {
-		wgtCount++;
-		wgtIds = (WidgetList)XtRealloc((char *)wgtIds,
-					       wgtCount * sizeof(Widget));
-		wgtIds[wgtCount - 1] = inst;
-		break;
-	    }
-	    current = XtParent(current);
-	}
-
-	if (current == NULL)
-        {
-            printf("Callback Error (%s):\n\t\
-Cannot find widget %s\n", cbName, widget);
-        }
-        XtFree(widget);
-        start = strtok(NULL, ",");
-    }
-
-    /*
-     * NULL terminate the list.
-     */
-    wgtIds = (WidgetList)XtRealloc((char *)wgtIds,
-				   (wgtCount + 1) * sizeof(Widget));
-    wgtIds[wgtCount] = NULL;
-
-    XtFree((char *)tmp);
-    return(wgtIds);
-}
-#endif /* _BX_WIDGETIDS_FROM_NAMES */
-
-XtPointer BX_SINGLE
-    ARGLIST((val))
-    GRA(float, val)
-{
-    XtPointer pointer;
-
-    pointer = (XtPointer)XtMalloc(sizeof(float));
-    if ( pointer != NULL ) *((float *)pointer) = val;
-    return(pointer);
-}
-
-#ifdef DEFINE_OLD_BXUTILS
-XtPointer SINGLE
-    ARGLIST((val))
-    GRA(float, val)
-{
-    return(BX_SINGLE(val));
-}
-#endif /* DEFINE_OLD_BXUTILS */
-
-XtPointer BX_DOUBLE
-    ARGLIST((val))
-    GRA(double, val)
-{
-    XtPointer	pointer;
-
-    pointer = (XtPointer)XtMalloc(sizeof(double));
-    if ( pointer != NULL ) *((double *)pointer) = val;
-    return(pointer);
-}
-
-#ifdef DEFINE_OLD_BXUTILS
-XtPointer DOUBLE
-    ARGLIST((val))
-    GRA(double, val)
-{
-    return(BX_DOUBLE(val));
-}
-#endif /* DEFINE_OLD_BXUTILS */
-
-
-/****************************************************************************
- *
- * Big chunk of code inserted from Bull (based on modified 3.3)
- *
- ****************************************************************************/
-
-#ifndef IGNORE_XPM_PIXMAP
-
-#ifndef USE_XPM_LIBRARY
-
-#ifdef SYSV
-#include <memory.h>
-#endif
-
-/*
- * Copyright 1990, 1991 GROUPE BULL
- *
- * Permission to use, copy, modify, and distribute this software and its
- * documentation for any purpose and without fee is hereby granted, provided
- * that the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of GROUPE BULL not be used in advertising
- * or publicity pertaining to distribution of the software without specific,
- * written prior permission.  GROUPE BULL makes no representations about the
- * suitability of this software for any purpose.  It is provided "as is"
- * without express or implied warranty.
- *
- * GROUPE BULL disclaims all warranties with regard to this software,
- * including all implied warranties of merchantability and fitness,
- * in no event shall GROUPE BULL be liable for any special,
- * indirect or consequential damages or any damages
- * whatsoever resulting from loss of use, data or profits,
- * whether in an action of contract, negligence or other tortious
- * action, arising out of or in connection with the use
- * or performance of this software.
- *
- */
-
-/* Return ErrorStatus codes:
- * null     if full success
- * positive if partial success
- * negative if failure
- */
-
-#define BxXpmColorError    1
-#define BxXpmSuccess       0
-#define BxXpmOpenFailed   -1
-#define BxXpmFileInvalid  -2
-#define BxXpmNoMemory     -3
-#define BxXpmColorFailed  -4
-
-typedef struct {
-    char *name;                         /* Symbolic color name */
-    char *value;                        /* Color value */
-    Pixel pixel;                        /* Color pixel */
-} 	BxXpmColorSymbol;
-
-typedef struct {
-    unsigned long valuemask;            /* Specifies which attributes are
-                                         * defined */
-
-    Visual *visual;                     /* Specifies the visual to use */
-    Colormap colormap;                  /* Specifies the colormap to use */
-    unsigned int depth;                 /* Specifies the depth */
-    unsigned int width;                 /* Returns the width of the created
-                                         * pixmap */
-    unsigned int height;                /* Returns the height of the created
-                                         * pixmap */
-    unsigned int x_hotspot;             /* Returns the x hotspot's
-                                         * coordinate */
-    unsigned int y_hotspot;             /* Returns the y hotspot's
-                                         * coordinate */
-    unsigned int cpp;                   /* Specifies the number of char per
-                                         * pixel */
-    Pixel *pixels;                      /* List of used color pixels */
-    unsigned int npixels;               /* Number of pixels */
-    BxXpmColorSymbol *colorsymbols;       /* Array of color symbols to
-                                         * override */
-    unsigned int numsymbols;            /* Number of symbols */
-    char *rgb_fname;                    /* RGB text file name */
-
-    /* Infos */
-    unsigned int ncolors;               /* Number of colors */
-    char ***colorTable;                 /* Color table pointer */
-    char *hints_cmt;                    /* Comment of the hints section */
-    char *colors_cmt;                   /* Comment of the colors section */
-    char *pixels_cmt;                   /* Comment of the pixels section */
-    unsigned int mask_pixel;            /* Transparent pixel's color table
-                                         * index */
-}      BxXpmAttributes;
-
-/* Xpm attribute value masks bits */
-#define BxXpmVisual          (1L<<0)
-#define BxXpmColormap        (1L<<1)
-#define BxXpmDepth           (1L<<2)
-#define BxXpmSize            (1L<<3)      /* width & height */
-#define BxXpmHotspot         (1L<<4)      /* x_hotspot & y_hotspot */
-#define BxXpmCharsPerPixel   (1L<<5)
-#define BxXpmColorSymbols    (1L<<6)
-#define BxXpmRgbFilename     (1L<<7)
-#define BxXpmInfos           (1L<<8)      /* all infos members */
-
-#define BxXpmReturnPixels    (1L<<9)
-#define BxXpmReturnInfos     BxXpmInfos
-
-/*
- * minimal portability layer between ansi and KR C
- */
-
-/* forward declaration of functions with prototypes */
-
-#ifdef NeedFunctionPrototypes
-#define LFUNC(f, t, p) static t f p
-#else
-#define LFUNC(f, t, p) static t f()
-#endif
-
-/*
- * functions declarations
- */
-LFUNC(BxXpmCreatePixmapFromData, int, (Display * display,
-				       Drawable d,
-				       char **data,
-				       Pixmap * pixmap_return,
-				       Pixmap * shapemask_return,
-				       BxXpmAttributes * attributes));
-
-LFUNC(BxXpmCreateImageFromData, int, (Display * display,
-				      char **data,
-				      XImage ** image_return,
-				      XImage ** shapemask_return,
-				      BxXpmAttributes * attributes));
-
-LFUNC(BxXpmFreeAttributes, void, (BxXpmAttributes * attributes));
-
-typedef struct {
-    unsigned int type;
-    union {
-        FILE *file;
-        char **data;
-    }     stream;
-    char *cptr;
-    unsigned int line;
-    int CommentLength;
-    char Comment[BUFSIZ];
-    char *Bcmt, *Ecmt, Bos, Eos;
-    unsigned int InsideString;          /* used during parsing: 0 or 1
-                                         * whether we are inside or not */
-}      bxxpmData;
-
-#define BXXPMARRAY 0
-#define BXXPMFILE  1
-#define BXXPMPIPE  2
-
-typedef unsigned char byte;
-
-#define BX_TRANSPARENT_COLOR "None"        /* this must be a string! */
-
-/* number of BxXpmColorKeys */
-#define BXNKEYS 5
-
-/*
- * key numbers for visual type, they must fit along with the number key of
- * each corresponding element in BxXpmColorKeys[] defined in xpm.h
- */
-#define BXMONO    2
-#define BXGRAY4   3
-#define BXGRAY    4
-#define BXCOLOR   5
-
-/* structure containing data related to an Xpm pixmap */
-typedef struct {
-    char *name;
-    unsigned int width;
-    unsigned int height;
-    unsigned int cpp;
-    unsigned int ncolors;
-    char ***colorTable;
-    unsigned int *pixelindex;
-    XColor *xcolors;
-    char **colorStrings;
-    unsigned int mask_pixel;            /* mask pixel's colorTable index */
-}      bxxpmInternAttrib;
-
-#define BX_UNDEF_PIXEL 0x80000000
-
-char *BxXpmColorKeys[] =
-{
- "s",					/* key #1: symbol */
- "m",					/* key #2: mono visual */
- "g4",					/* key #3: 4 grays visual */
- "g",					/* key #4: gray visual */
- "c",					/* key #5: color visual */
-};
-
-/* XPM private routines */
-
-LFUNC(xpmCreateImage, int, (Display * display,
-                           bxxpmInternAttrib * attrib,
-                           XImage ** image_return,
-                           XImage ** shapeimage_return,
-                           BxXpmAttributes * attributes));
-
-LFUNC(xpmParseData, int, (bxxpmData * data,
-                         bxxpmInternAttrib * attrib_return,
-                         BxXpmAttributes * attributes));
-
-LFUNC(BxXpmVisualType, int, (Visual * visual));
-LFUNC(xpmFreeColorTable, void, (char ***colorTable, int ncolors));
-
-LFUNC(xpmInitInternAttrib, void, (bxxpmInternAttrib * xmpdata));
-
-LFUNC(xpmFreeInternAttrib, void, (bxxpmInternAttrib * xmpdata));
-
-LFUNC(xpmSetAttributes, void, (bxxpmInternAttrib * attrib,
-                             BxXpmAttributes * attributes));
-
-/* I/O utility */
-
-LFUNC(xpmNextString, void, (bxxpmData * mdata));
-LFUNC(xpmNextUI, int, (bxxpmData * mdata, unsigned int *ui_return));
-LFUNC(xpmGetC, int, (bxxpmData * mdata));
-LFUNC(xpmUngetC, int, (int c, bxxpmData * mdata));
-LFUNC(xpmNextWord, unsigned int, (bxxpmData * mdata, char *buf));
-LFUNC(xpmGetCmt, void, (bxxpmData * mdata, char **cmt));
-LFUNC(xpmOpenArray, int, (char **data, bxxpmData * mdata));
-LFUNC(XpmDataClose, void, (bxxpmData * mdata));
-
-/* RGB utility */
-
-LFUNC(xpm_xynormalizeimagebits, void, (register unsigned char *bp,
-                                     register XImage * img));
-LFUNC(xpm_znormalizeimagebits, void, (register unsigned char *bp,
-                                    register XImage * img));
-
-/* Image utility */
-
-LFUNC(SetColor, int, (Display * display, Colormap colormap, char *colorname,
-		      unsigned int color_index, Pixel * image_pixel,
-		      Pixel * mask_pixel, unsigned int *mask_pixel_index));
-
-LFUNC(CreateXImage, int, (Display * display, Visual * visual,
-			  unsigned int depth, unsigned int width,
-			  unsigned int height, XImage ** image_return));
-
-LFUNC(SetImagePixels, void, (XImage * image, unsigned int width,
-			    unsigned int height, unsigned int *pixelindex,
-			    Pixel * pixels));
-
-LFUNC(SetImagePixels32, void, (XImage * image, unsigned int width,
-			      unsigned int height, unsigned int *pixelindex,
-			      Pixel * pixels));
-
-LFUNC(SetImagePixels16, void, (XImage * image, unsigned int width,
-			      unsigned int height, unsigned int *pixelindex,
-			      Pixel * pixels));
-
-LFUNC(SetImagePixels8, void, (XImage * image, unsigned int width,
-			     unsigned int height, unsigned int *pixelindex,
-			     Pixel * pixels));
-
-LFUNC(SetImagePixels1, void, (XImage * image, unsigned int width,
-			     unsigned int height, unsigned int *pixelindex,
-			     Pixel * pixels));
-
-LFUNC(atoui, unsigned int, (char *p, unsigned int l, unsigned int *ui_return));
-
-/*
- * Macros
- *
- * The BXXYNORMALIZE macro determines whether XY format data requires
- * normalization and calls a routine to do so if needed. The logic in
- * this module is designed for LSBFirst byte and bit order, so
- * normalization is done as required to present the data in this order.
- *
- * The BXZNORMALIZE macro performs byte and nibble order normalization if
- * required for Z format data.
- *
- * The BXXYINDEX macro computes the index to the starting byte (char) boundary
- * for a bitmap_unit containing a pixel with coordinates x and y for image
- * data in XY format.
- *
- * The BXZINDEX* macros compute the index to the starting byte (char) boundary
- * for a pixel with coordinates x and y for image data in ZPixmap format.
- *
- */
-
-#define BXXYNORMALIZE(bp, img) \
-    if ((img->byte_order == MSBFirst) || (img->bitmap_bit_order == MSBFirst)) \
-        xpm_xynormalizeimagebits((unsigned char *)(bp), img)
-
-#define BXZNORMALIZE(bp, img) \
-    if (img->byte_order == MSBFirst) \
-        xpm_znormalizeimagebits((unsigned char *)(bp), img)
-
-#define BXXYINDEX(x, y, img) \
-    ((y) * img->bytes_per_line) + \
-    (((x) + img->xoffset) / img->bitmap_unit) * (img->bitmap_unit >> 3)
-
-#define BXZINDEX(x, y, img) ((y) * img->bytes_per_line) + \
-    (((x) * img->bits_per_pixel) >> 3)
-
-#define BXZINDEX32(x, y, img) ((y) * img->bytes_per_line) + ((x) << 2)
-
-#define BXZINDEX16(x, y, img) ((y) * img->bytes_per_line) + ((x) << 1)
-
-#define BXZINDEX8(x, y, img) ((y) * img->bytes_per_line) + (x)
-
-#define BXZINDEX1(x, y, img) ((y) * img->bytes_per_line) + ((x) >> 3)
-
-#if __STDC__
-#define Const const
-#else
-#define Const
-#endif
-
-
-
-static unsigned int atoui
-ARGLIST((p, l, ui_return))
-ARG(register char *, p)
-ARG(unsigned int, l)
-GRA(unsigned int *, ui_return)
-{
-    register int n, i;
-
-    n = 0;
-    for (i = 0; i < l; i++)
-        if (*p >= '0' && *p <= '9')
-            n = n * 10 + *p++ - '0';
-        else
-            break;
-
-    if (i != 0 && i == l) {
-        *ui_return = n;
-        return 1;
-    } else
-        return 0;
-}
-
-static int BxXpmCreatePixmapFromData
-ARGLIST((display, d, data, pixmap_return, shapemask_return, attributes))
-ARG(Display *, display)
-ARG(Drawable, d)
-ARG(char **, data)
-ARG(Pixmap *, pixmap_return)
-ARG(Pixmap *, shapemask_return)
-GRA(BxXpmAttributes *,attributes)
-{
-    XImage *image, **imageptr = NULL;
-    XImage *shapeimage, **shapeimageptr = NULL;
-    int ErrorStatus;
-    XGCValues gcv;
-    GC gc;
-
-    /*
-     * initialize return values
-     */
-    if (pixmap_return) {
-        *pixmap_return = (Pixmap) NULL;
-        imageptr = ℑ
-    }
-    if (shapemask_return) {
-        *shapemask_return = (Pixmap) NULL;
-        shapeimageptr = &shapeimage;
-    }
-
-    /*
-     * create the images
-     */
-    ErrorStatus = BxXpmCreateImageFromData(display, data, imageptr,
-                                         shapeimageptr, attributes);
-    if (ErrorStatus < 0)
-        return (ErrorStatus);
-
-    /*
-     * create the pixmaps
-     */
-    if (imageptr && image) {
-        *pixmap_return = XCreatePixmap(display, d, image->width,
-                                       image->height, image->depth);
-        gcv.function = GXcopy;
-        gc = XCreateGC(display, *pixmap_return, GCFunction, &gcv);
-
-        XPutImage(display, *pixmap_return, gc, image, 0, 0, 0, 0,
-                  image->width, image->height);
-
-        XDestroyImage(image);
-        XFreeGC(display, gc);
-    }
-    if (shapeimageptr && shapeimage) {
-        *shapemask_return = XCreatePixmap(display, d, shapeimage->width,
-                                          shapeimage->height,
-                                          shapeimage->depth);
-        gcv.function = GXcopy;
-        gc = XCreateGC(display, *shapemask_return, GCFunction, &gcv);
-
-        XPutImage(display, *shapemask_return, gc, shapeimage, 0, 0, 0, 0,
-                  shapeimage->width, shapeimage->height);
-
-        XDestroyImage(shapeimage);
-        XFreeGC(display, gc);
-    }
-    return (ErrorStatus);
-}
-
-
-static int BxXpmCreateImageFromData
-ARGLIST((display, data, image_return, shapeimage_return, attributes))
-ARG(Display *,display)
-ARG(char **, data)
-ARG(XImage **, image_return)
-ARG(XImage **, shapeimage_return)
-GRA(BxXpmAttributes *, attributes)
-{
-    bxxpmData mdata;
-    int ErrorStatus;
-    bxxpmInternAttrib attrib;
-
-    /*
-     * initialize return values
-     */
-    if (image_return)
-        *image_return = NULL;
-    if (shapeimage_return)
-        *shapeimage_return = NULL;
-
-    if ((ErrorStatus = xpmOpenArray(data, &mdata)) != BxXpmSuccess)
-        return (ErrorStatus);
-
-    xpmInitInternAttrib(&attrib);
-
-    ErrorStatus = xpmParseData(&mdata, &attrib, attributes);
-
-    if (ErrorStatus == BxXpmSuccess)
-        ErrorStatus = xpmCreateImage(display, &attrib, image_return,
-                                     shapeimage_return, attributes);
-
-    if (ErrorStatus >= 0)
-        xpmSetAttributes(&attrib, attributes);
-    else if (attributes)
-        BxXpmFreeAttributes(attributes);
-
-    xpmFreeInternAttrib(&attrib);
-    XpmDataClose(&mdata);
-
-    return (ErrorStatus);
-}
-
-/*
- * open the given array to be read or written as an bxxpmData which is returned
- */
-static int xpmOpenArray
-ARGLIST((data, mdata))
-ARG(char **,data)
-GRA(bxxpmData *,mdata)
-{
-    mdata->type = BXXPMARRAY;
-    mdata->stream.data = data;
-    mdata->cptr = *data;
-    mdata->line = 0;
-    mdata->CommentLength = 0;
-    mdata->Bcmt = mdata->Ecmt = NULL;
-    mdata->Bos = mdata->Eos = '\0';
-    mdata->InsideString = 0;
-    return (BxXpmSuccess);
-}
-
-/*
- * Intialize the bxxpmInternAttrib pointers to Null to know
- * which ones must be freed later on.
- */
-static void xpmInitInternAttrib
-ARGLIST((attrib))
-GRA(bxxpmInternAttrib *,attrib)
-{
-    attrib->ncolors = 0;
-    attrib->colorTable = NULL;
-    attrib->pixelindex = NULL;
-    attrib->xcolors = NULL;
-    attrib->colorStrings = NULL;
-    attrib->mask_pixel = BX_UNDEF_PIXEL;
-}
-
-/* function call in case of error, frees only localy allocated variables */
-#undef RETURN
-#define RETURN(status) \
-  { if (colorTable) xpmFreeColorTable(colorTable, ncolors); \
-    if (chars) free(chars); \
-    if (pixelindex) free((char *)pixelindex); \
-    if (hints_cmt)  free((char *)hints_cmt); \
-    if (colors_cmt) free((char *)colors_cmt); \
-    if (pixels_cmt) free((char *)pixels_cmt); \
-    return(status); }
-
-/*
- * This function parses an Xpm file or data and store the found informations
- * in an an bxxpmInternAttrib structure which is returned.
- */
-static int xpmParseData
-ARGLIST((data, attrib_return, attributes))
-ARG(bxxpmData *,data)
-ARG(bxxpmInternAttrib *, attrib_return)
-GRA(BxXpmAttributes *, attributes)
-{
-    /* variables to return */
-    unsigned int width, height;
-    unsigned int ncolors = 0;
-    unsigned int cpp;
-    unsigned int x_hotspot, y_hotspot, hotspot = 0;
-    char ***colorTable = NULL;
-    unsigned int *pixelindex = NULL;
-    char *hints_cmt = NULL;
-    char *colors_cmt = NULL;
-    char *pixels_cmt = NULL;
-
-    /* calculation variables */
-    unsigned int rncolors = 0;		/* read number of colors, it is
-					 * different to ncolors to avoid
-					 * problem when freeing the
-					 * colorTable in case an error
-					 * occurs while reading the hints
-					 * line */
-    unsigned int key;			/* color key */
-    char *chars = NULL, buf[BUFSIZ];
-    unsigned int *iptr;
-    unsigned int a, b, x, y, l;
-
-    unsigned int curkey;		/* current color key */
-    unsigned int lastwaskey;		/* key read */
-    char curbuf[BUFSIZ];		/* current buffer */
-
-    /*
-     * read hints: width, height, ncolors, chars_per_pixel
-     */
-    if (!(xpmNextUI(data, &width) && xpmNextUI(data, &height)
-	  && xpmNextUI(data, &rncolors) && xpmNextUI(data, &cpp)))
-	RETURN(BxXpmFileInvalid);
-
-    ncolors = rncolors;
-
-    /*
-     * read hotspot coordinates if any
-     */
-    hotspot = xpmNextUI(data, &x_hotspot) && xpmNextUI(data, &y_hotspot);
-
-    /*
-     * store the hints comment line
-     */
-    if (attributes && (attributes->valuemask & BxXpmReturnInfos))
-	xpmGetCmt(data, &hints_cmt);
-
-    /*
-     * read colors
-     */
-    colorTable = (char ***) calloc(ncolors, sizeof(char **));
-    if (!colorTable)
-	RETURN(BxXpmNoMemory);
-
-    for (a = 0; a < ncolors; a++) {
-	xpmNextString(data);		/* skip the line */
-	colorTable[a] = (char **) calloc((BXNKEYS + 1), sizeof(char *));
-	if (!colorTable[a])
-	    RETURN(BxXpmNoMemory);
-
-	/*
-	 * read pixel value
-	 */
-	colorTable[a][0] = (char *) malloc(cpp);
-	if (!colorTable[a][0])
-	    RETURN(BxXpmNoMemory);
-	for (b = 0; b < cpp; b++)
-	    colorTable[a][0][b] = xpmGetC(data);
-
-	/*
-	 * read color keys and values
-	 */
-	curkey = 0;
-	lastwaskey = 0;
-	while ((l = xpmNextWord(data, buf))) {
-	    if (!lastwaskey) {
-		for (key = 1; key < BXNKEYS + 1; key++)
-		    if ((strlen(BxXpmColorKeys[key - 1]) == l)
-			&& (!strncmp(BxXpmColorKeys[key - 1], buf, l)))
-			break;
-	    }
-	    if (!lastwaskey && key <= BXNKEYS) {	/* open new key */
-		if (curkey) {		/* flush string */
-		    colorTable[a][curkey] =
-			(char *) malloc(strlen(curbuf) + 1);
-		    if (!colorTable[a][curkey])
-			RETURN(BxXpmNoMemory);
-		    strcpy(colorTable[a][curkey], curbuf);
-		}
-		curkey = key;		/* set new key  */
-		curbuf[0] = '\0';	/* reset curbuf */
-		lastwaskey = 1;
-	    } else {
-		if (!curkey)
-		    RETURN(BxXpmFileInvalid);	/* key without value */
-		if (!lastwaskey)
-		    strcat(curbuf, " ");/* append space */
-		buf[l] = '\0';
-		strcat(curbuf, buf);	/* append buf */
-		lastwaskey = 0;
-	    }
-	}
-	if (!curkey)
-	    RETURN(BxXpmFileInvalid);	/* key without value */
-	colorTable[a][curkey] = (char *) malloc(strlen(curbuf) + 1);
-	if (!colorTable[a][curkey])
-	    RETURN(BxXpmNoMemory);
-	strcpy(colorTable[a][curkey], curbuf);
-    }
-
-    /*
-     * store the colors comment line
-     */
-    if (attributes && (attributes->valuemask & BxXpmReturnInfos))
-	xpmGetCmt(data, &colors_cmt);
-
-    /*
-     * read pixels and index them on color number
-     */
-    pixelindex =
-	(unsigned int *) malloc(sizeof(unsigned int) * width * height);
-    if (!pixelindex)
-	RETURN(BxXpmNoMemory);
-
-    iptr = pixelindex;
-
-    chars = (char *) malloc(cpp);
-    if (!chars)
-	RETURN(BxXpmNoMemory);
-
-    for (y = 0; y < height; y++) {
-	xpmNextString(data);
-	for (x = 0; x < width; x++, iptr++) {
-	    for (a = 0; a < cpp; a++)
-		chars[a] = xpmGetC(data);
-	    for (a = 0; a < ncolors; a++)
-		if (!strncmp(colorTable[a][0], chars, cpp))
-		    break;
-	    if (a == ncolors)
-		RETURN(BxXpmFileInvalid);	/* no color matches */
-	    *iptr = a;
-	}
-    }
-
-    /*
-     * store the pixels comment line
-     */
-    if (attributes && (attributes->valuemask & BxXpmReturnInfos))
-	xpmGetCmt(data, &pixels_cmt);
-
-    free(chars);
-
-    /*
-     * store found informations in the bxxpmInternAttrib structure
-     */
-    attrib_return->width = width;
-    attrib_return->height = height;
-    attrib_return->cpp = cpp;
-    attrib_return->ncolors = ncolors;
-    attrib_return->colorTable = colorTable;
-    attrib_return->pixelindex = pixelindex;
-
-    if (attributes) {
-	if (attributes->valuemask & BxXpmReturnInfos) {
-	    attributes->hints_cmt = hints_cmt;
-	    attributes->colors_cmt = colors_cmt;
-	    attributes->pixels_cmt = pixels_cmt;
-	}
-	if (hotspot) {
-	    attributes->x_hotspot = x_hotspot;
-	    attributes->y_hotspot = y_hotspot;
-	    attributes->valuemask |= BxXpmHotspot;
-	}
-    }
-    return (BxXpmSuccess);
-}
-
-/*
- * set the color pixel related to the given colorname,
- * return 0 if success, 1 otherwise.
- */
-
-static int SetColor
-ARGLIST((display, colormap,colorname, color_index, image_pixel, mask_pixel, mask_pixel_index))
-ARG(Display *, display)
-ARG(Colormap, colormap)
-ARG(char *, colorname)
-ARG(unsigned int, color_index)
-ARG(Pixel *, image_pixel)
-ARG(Pixel *, mask_pixel)
-GRA(unsigned int *, mask_pixel_index)
-{
-    XColor xcolor;
-
-    if (STRCASECMP(colorname, BX_TRANSPARENT_COLOR)) {
-	if (!XParseColor(display, colormap, colorname, &xcolor)
-	    || (!XAllocColor(display, colormap, &xcolor)))
-	    return (1);
-	*image_pixel = xcolor.pixel;
-	*mask_pixel = 1;
-    } else {
-	*image_pixel = 0;
-	*mask_pixel = 0;
-	*mask_pixel_index = color_index;/* store the color table index */
-    }
-    return (0);
-}
-
-/* function call in case of error, frees only localy allocated variables */
-#undef RETURN
-#define RETURN(status) \
-  { if (image) XDestroyImage(image); \
-    if (shapeimage) XDestroyImage(shapeimage); \
-    if (image_pixels) free((char *)image_pixels); \
-    if (mask_pixels) free((char *)mask_pixels); \
-    return(status); }
-
-static int xpmCreateImage
-ARGLIST((display, attrib, image_return, shapeimage_return, attributes))
-ARG(Display *, display)
-ARG(bxxpmInternAttrib *, attrib)
-ARG(XImage **, image_return)
-ARG(XImage **, shapeimage_return)
-GRA(BxXpmAttributes *, attributes)
-{
-    /* variables stored in the BxXpmAttributes structure */
-    Visual *visual;
-    Colormap colormap;
-    unsigned int depth;
-    BxXpmColorSymbol *colorsymbols;
-    unsigned int numsymbols;
-
-    /* variables to return */
-    XImage *image = NULL;
-    XImage *shapeimage = NULL;
-    unsigned int mask_pixel;
-    unsigned int ErrorStatus, ErrorStatus2;
-
-    /* calculation variables */
-    Pixel *image_pixels = NULL;
-    Pixel *mask_pixels = NULL;
-    char *colorname;
-    unsigned int a, b, l;
-    Boolean pixel_defined;
-    unsigned int key;
-
-
-    /*
-     * retrieve information from the BxXpmAttributes
-     */
-    if (attributes && attributes->valuemask & BxXpmColorSymbols) {
-	colorsymbols = attributes->colorsymbols;
-	numsymbols = attributes->numsymbols;
-    } else
-	numsymbols = 0;
-
-    if (attributes && attributes->valuemask & BxXpmVisual)
-	visual = attributes->visual;
-    else
-	visual = DefaultVisual(display, DefaultScreen(display));
-
-    if (attributes && attributes->valuemask & BxXpmColormap)
-	colormap = attributes->colormap;
-    else
-	colormap = DefaultColormap(display, DefaultScreen(display));
-
-    if (attributes && attributes->valuemask & BxXpmDepth)
-	depth = attributes->depth;
-    else
-	depth = DefaultDepth(display, DefaultScreen(display));
-
-
-    ErrorStatus = BxXpmSuccess;
-
-    /*
-     * alloc pixels index tables
-     */
-
-    key = BxXpmVisualType(visual);
-    image_pixels = (Pixel *) malloc(sizeof(Pixel) * attrib->ncolors);
-    if (!image_pixels)
-	RETURN(BxXpmNoMemory);
-
-    mask_pixels = (Pixel *) malloc(sizeof(Pixel) * attrib->ncolors);
-    if (!mask_pixels)
-	RETURN(BxXpmNoMemory);
-
-    mask_pixel = BX_UNDEF_PIXEL;
-
-    /*
-     * get pixel colors, store them in index tables
-     */
-    for (a = 0; a < attrib->ncolors; a++) {
-	colorname = NULL;
-	pixel_defined = False;
-
-	/*
-	 * look for a defined symbol
-	 */
-	if (numsymbols && attrib->colorTable[a][1]) {
-	    for (l = 0; l < numsymbols; l++)
-		if (!strcmp(colorsymbols[l].name, attrib->colorTable[a][1]))
-		    break;
-	    if (l != numsymbols) {
-		if (colorsymbols[l].value)
-		    colorname = colorsymbols[l].value;
-		else
-		    pixel_defined = True;
-	    }
-	}
-	if (!pixel_defined) {		/* pixel not given as symbol value */
-
-	    if (colorname) {		/* colorname given as symbol value */
-		if (!SetColor(display, colormap, colorname, a,
-			   &image_pixels[a], &mask_pixels[a], &mask_pixel))
-		    pixel_defined = True;
-		else
-		    ErrorStatus = BxXpmColorError;
-	    }
-	    b = key;
-	    while (!pixel_defined && b > 1) {
-		if (attrib->colorTable[a][b]) {
-		    if (!SetColor(display, colormap, attrib->colorTable[a][b],
-				  a, &image_pixels[a], &mask_pixels[a],
-				  &mask_pixel)) {
-			pixel_defined = True;
-			break;
-		    } else
-			ErrorStatus = BxXpmColorError;
-		}
-		b--;
-	    }
-
-	    b = key + 1;
-	    while (!pixel_defined && b < BXNKEYS + 1) {
-		if (attrib->colorTable[a][b]) {
-		    if (!SetColor(display, colormap, attrib->colorTable[a][b],
-				  a, &image_pixels[a], &mask_pixels[a],
-				  &mask_pixel)) {
-			pixel_defined = True;
-			break;
-		    } else
-			ErrorStatus = BxXpmColorError;
-		}
-		b++;
-	    }
-
-	    if (!pixel_defined)
-		RETURN(BxXpmColorFailed);
-
-	} else {
-	    image_pixels[a] = colorsymbols[l].pixel;
-	    mask_pixels[a] = 1;
-	}
-    }
-
-    /*
-     * create the image
-     */
-    if (image_return) {
-	ErrorStatus2 = CreateXImage(display, visual, depth,
-				    attrib->width, attrib->height, &image);
-	if (ErrorStatus2 != BxXpmSuccess)
-	    RETURN(ErrorStatus2);
-
-	/*
-	 * set the image data
-	 *
-	 * In case depth is 1 or bits_per_pixel is 4, 6, 8, 24 or 32 use
-	 * optimized functions, otherwise use slower but sure general one.
-	 *
-	 */
-
-	if (image->depth == 1)
-	    SetImagePixels1(image, attrib->width, attrib->height,
-			    attrib->pixelindex, image_pixels);
-	else if (image->bits_per_pixel == 8)
-	    SetImagePixels8(image, attrib->width, attrib->height,
-			    attrib->pixelindex, image_pixels);
-	else if (image->bits_per_pixel == 16)
-	    SetImagePixels16(image, attrib->width, attrib->height,
-			     attrib->pixelindex, image_pixels);
-	else if (image->bits_per_pixel == 32)
-	    SetImagePixels32(image, attrib->width, attrib->height,
-			     attrib->pixelindex, image_pixels);
-	else
-	    SetImagePixels(image, attrib->width, attrib->height,
-			   attrib->pixelindex, image_pixels);
-    }
-
-    /*
-     * create the shape mask image
-     */
-    if (mask_pixel != BX_UNDEF_PIXEL && shapeimage_return) {
-	ErrorStatus2 = CreateXImage(display, visual, 1, attrib->width,
-				    attrib->height, &shapeimage);
-	if (ErrorStatus2 != BxXpmSuccess)
-	    RETURN(ErrorStatus2);
-
-	SetImagePixels1(shapeimage, attrib->width, attrib->height,
-			attrib->pixelindex, mask_pixels);
-    }
-    free((char *)mask_pixels);
-
-    /*
-     * if requested store allocated pixels in the BxXpmAttributes structure
-     */
-    if (attributes &&
-	(attributes->valuemask & BxXpmReturnInfos
-	 || attributes->valuemask & BxXpmReturnPixels)) {
-	if (mask_pixel != BX_UNDEF_PIXEL) {
-	    Pixel *pixels, *p1, *p2;
-
-	    attributes->npixels = attrib->ncolors - 1;
-	    pixels = (Pixel *) malloc(sizeof(Pixel) * attributes->npixels);
-	    if (pixels) {
-		p1 = image_pixels;
-		p2 = pixels;
-		for (a = 0; a < attrib->ncolors; a++, p1++)
-		    if (a != mask_pixel)
-			*p2++ = *p1;
-		attributes->pixels = pixels;
-	    } else {
-		/* if error just say we can't return requested data */
-		attributes->valuemask &= ~BxXpmReturnPixels;
-		attributes->valuemask &= ~BxXpmReturnInfos;
-		attributes->pixels = NULL;
-		attributes->npixels = 0;
-	    }
-	    free((char *)image_pixels);
-	} else {
-	    attributes->pixels = image_pixels;
-	    attributes->npixels = attrib->ncolors;
-	}
-	attributes->mask_pixel = mask_pixel;
-    } else
-	free((char *)image_pixels);
-
-
-    /*
-     * return created images
-     */
-    if (image_return)
-	*image_return = image;
-
-    if (shapeimage_return)
-	*shapeimage_return = shapeimage;
-
-    return (ErrorStatus);
-}
-
-
-/*
- * Create an XImage
- */
-static int CreateXImage
-ARGLIST((display, visual, depth, width, height, image_return))
-ARG(Display *, display)
-ARG(Visual *, visual)
-ARG(unsigned int, depth)
-ARG(unsigned int, width)
-ARG(unsigned int, height)
-GRA(XImage **, image_return)
-{
-    int bitmap_pad;
-
-    /* first get bitmap_pad */
-    if (depth > 16)
-	bitmap_pad = 32;
-    else if (depth > 8)
-	bitmap_pad = 16;
-    else
-	bitmap_pad = 8;
-
-    /* then create the XImage with data = NULL and bytes_per_line = 0 */
-
-    *image_return = XCreateImage(display, visual, depth, ZPixmap, 0, 0,
-				 width, height, bitmap_pad, 0);
-    if (!*image_return)
-	return (BxXpmNoMemory);
-
-    /* now that bytes_per_line must have been set properly alloc data */
-
-    (*image_return)->data =
-	(char *) malloc((*image_return)->bytes_per_line * height);
-
-    if (!(*image_return)->data) {
-	XDestroyImage(*image_return);
-	*image_return = NULL;
-	return (BxXpmNoMemory);
-    }
-    return (BxXpmSuccess);
-}
-
-
-/*
- * The functions below are written from X11R5 MIT's code (XImUtil.c)
- *
- * The idea is to have faster functions than the standard XPutPixel function
- * to build the image data. Indeed we can speed up things by supressing tests
- * performed for each pixel. We do exactly the same tests but at the image
- * level. Assuming that we use only ZPixmap images.
- */
-
-LFUNC(_putbits, void, (register char *src, int dstoffset,
-		      register int numbits, register char *dst));
-
-LFUNC(_XReverse_Bytes, void, (register unsigned char *bpt, register int nb));
-
-static unsigned char Const _reverse_byte[0x100] = {
-			    0x00, 0x80, 0x40, 0xc0, 0x20, 0xa0, 0x60, 0xe0,
-			    0x10, 0x90, 0x50, 0xd0, 0x30, 0xb0, 0x70, 0xf0,
-			    0x08, 0x88, 0x48, 0xc8, 0x28, 0xa8, 0x68, 0xe8,
-			    0x18, 0x98, 0x58, 0xd8, 0x38, 0xb8, 0x78, 0xf8,
-			    0x04, 0x84, 0x44, 0xc4, 0x24, 0xa4, 0x64, 0xe4,
-			    0x14, 0x94, 0x54, 0xd4, 0x34, 0xb4, 0x74, 0xf4,
-			    0x0c, 0x8c, 0x4c, 0xcc, 0x2c, 0xac, 0x6c, 0xec,
-			    0x1c, 0x9c, 0x5c, 0xdc, 0x3c, 0xbc, 0x7c, 0xfc,
-			    0x02, 0x82, 0x42, 0xc2, 0x22, 0xa2, 0x62, 0xe2,
-			    0x12, 0x92, 0x52, 0xd2, 0x32, 0xb2, 0x72, 0xf2,
-			    0x0a, 0x8a, 0x4a, 0xca, 0x2a, 0xaa, 0x6a, 0xea,
-			    0x1a, 0x9a, 0x5a, 0xda, 0x3a, 0xba, 0x7a, 0xfa,
-			    0x06, 0x86, 0x46, 0xc6, 0x26, 0xa6, 0x66, 0xe6,
-			    0x16, 0x96, 0x56, 0xd6, 0x36, 0xb6, 0x76, 0xf6,
-			    0x0e, 0x8e, 0x4e, 0xce, 0x2e, 0xae, 0x6e, 0xee,
-			    0x1e, 0x9e, 0x5e, 0xde, 0x3e, 0xbe, 0x7e, 0xfe,
-			    0x01, 0x81, 0x41, 0xc1, 0x21, 0xa1, 0x61, 0xe1,
-			    0x11, 0x91, 0x51, 0xd1, 0x31, 0xb1, 0x71, 0xf1,
-			    0x09, 0x89, 0x49, 0xc9, 0x29, 0xa9, 0x69, 0xe9,
-			    0x19, 0x99, 0x59, 0xd9, 0x39, 0xb9, 0x79, 0xf9,
-			    0x05, 0x85, 0x45, 0xc5, 0x25, 0xa5, 0x65, 0xe5,
-			    0x15, 0x95, 0x55, 0xd5, 0x35, 0xb5, 0x75, 0xf5,
-			    0x0d, 0x8d, 0x4d, 0xcd, 0x2d, 0xad, 0x6d, 0xed,
-			    0x1d, 0x9d, 0x5d, 0xdd, 0x3d, 0xbd, 0x7d, 0xfd,
-			    0x03, 0x83, 0x43, 0xc3, 0x23, 0xa3, 0x63, 0xe3,
-			    0x13, 0x93, 0x53, 0xd3, 0x33, 0xb3, 0x73, 0xf3,
-			    0x0b, 0x8b, 0x4b, 0xcb, 0x2b, 0xab, 0x6b, 0xeb,
-			    0x1b, 0x9b, 0x5b, 0xdb, 0x3b, 0xbb, 0x7b, 0xfb,
-			    0x07, 0x87, 0x47, 0xc7, 0x27, 0xa7, 0x67, 0xe7,
-			    0x17, 0x97, 0x57, 0xd7, 0x37, 0xb7, 0x77, 0xf7,
-			    0x0f, 0x8f, 0x4f, 0xcf, 0x2f, 0xaf, 0x6f, 0xef,
-			     0x1f, 0x9f, 0x5f, 0xdf, 0x3f, 0xbf, 0x7f, 0xff
-};
-
-static void _XReverse_Bytes
-ARGLIST((bpt, nb))
-ARG(register unsigned char *, bpt)
-GRA(register int, nb)
-{
-    do {
-	*bpt = _reverse_byte[*bpt];
-	bpt++;
-    } while (--nb > 0);
-}
-
-static void xpm_xynormalizeimagebits
-ARGLIST((bp,img))
-ARG(register unsigned char *, bp)
-GRA(register XImage *, img)
-{
-    register unsigned char c;
-
-    if (img->byte_order != img->bitmap_bit_order) {
-	switch (img->bitmap_unit) {
-
-	case 16:
-	    c = *bp;
-	    *bp = *(bp + 1);
-	    *(bp + 1) = c;
-	    break;
-
-	case 32:
-	    c = *(bp + 3);
-	    *(bp + 3) = *bp;
-	    *bp = c;
-	    c = *(bp + 2);
-	    *(bp + 2) = *(bp + 1);
-	    *(bp + 1) = c;
-	    break;
-	}
-    }
-    if (img->bitmap_bit_order == MSBFirst)
-	_XReverse_Bytes(bp, img->bitmap_unit >> 3);
-}
-
-static void xpm_znormalizeimagebits
-ARGLIST((bp,img))
-ARG(register unsigned char *, bp)
-GRA(register XImage *, img)
-{
-    register unsigned char c;
-
-    switch (img->bits_per_pixel) {
-
-    case 4:
-	*bp = ((*bp >> 4) & 0xF) | ((*bp << 4) & ~0xF);
-	break;
-
-    case 16:
-	c = *bp;
-	*bp = *(bp + 1);
-	*(bp + 1) = c;
-	break;
-
-    case 24:
-	c = *(bp + 2);
-	*(bp + 2) = *bp;
-	*bp = c;
-	break;
-
-    case 32:
-	c = *(bp + 3);
-	*(bp + 3) = *bp;
-	*bp = c;
-	c = *(bp + 2);
-	*(bp + 2) = *(bp + 1);
-	*(bp + 1) = c;
-	break;
-    }
-}
-
-static unsigned char Const _lomask[0x09] = {
-		     0x00, 0x01, 0x03, 0x07, 0x0f, 0x1f, 0x3f, 0x7f, 0xff};
-static unsigned char Const _himask[0x09] = {
-		     0xff, 0xfe, 0xfc, 0xf8, 0xf0, 0xe0, 0xc0, 0x80, 0x00};
-
-static void _putbits
-ARGLIST((src, dstoffset, numbits, dst))
-ARG(register char *, src)		/* address of source bit string */
-ARG(int, dstoffset)			/* bit offset into destination;
-					 * range is 0-31 */
-ARG(register int, numbits)		/* number of bits to copy to
-					 * destination */
-GRA(register char *, dst)		/* address of destination bit string */
-{
-    register unsigned char chlo, chhi;
-    int hibits;
-
-    dst = dst + (dstoffset >> 3);
-    dstoffset = dstoffset & 7;
-    hibits = 8 - dstoffset;
-    chlo = *dst & _lomask[dstoffset];
-    for (;;) {
-	chhi = (*src << dstoffset) & _himask[dstoffset];
-	if (numbits <= hibits) {
-	    chhi = chhi & _lomask[dstoffset + numbits];
-	    *dst = (*dst & _himask[dstoffset + numbits]) | chlo | chhi;
-	    break;
-	}
-	*dst = chhi | chlo;
-	dst++;
-	numbits = numbits - hibits;
-	chlo = (unsigned char) (*src & _himask[hibits]) >> hibits;
-	src++;
-	if (numbits <= dstoffset) {
-	    chlo = chlo & _lomask[numbits];
-	    *dst = (*dst & _himask[numbits]) | chlo;
-	    break;
-	}
-	numbits = numbits - dstoffset;
-    }
-}
-
-/*
- * Default method to write pixels into a Z image data structure.
- * The algorithm used is:
- *
- *	copy the destination bitmap_unit or Zpixel to temp
- *	normalize temp if needed
- *	copy the pixel bits into the temp
- *	renormalize temp if needed
- *	copy the temp back into the destination image data
- */
-
-static void SetImagePixels
-ARGLIST((image, width, height, pixelindex, pixels))
-ARG(XImage *, image)
-ARG(unsigned int, width)
-ARG(unsigned int, height)
-ARG(unsigned int *, pixelindex)
-GRA(Pixel *, pixels)
-{
-    Pixel pixel;
-    unsigned long px;
-    register char *src;
-    register char *dst;
-    int nbytes;
-    register unsigned int *iptr;
-    register int x, y, i;
-
-    iptr = pixelindex;
-    if (image->depth == 1) {
-	for (y = 0; y < height; y++)
-	    for (x = 0; x < width; x++, iptr++) {
-		pixel = pixels[*iptr];
-		for (i = 0, px = pixel;
-		     i < sizeof(unsigned long); i++, px >>= 8)
-		    ((unsigned char *) &pixel)[i] = (unsigned char)px;
-		src = &image->data[BXXYINDEX(x, y, image)];
-		dst = (char *) &px;
-		px = 0;
-		nbytes = image->bitmap_unit >> 3;
-		for (i = nbytes; --i >= 0;)
-		    *dst++ = *src++;
-		BXXYNORMALIZE(&px, image);
-		i = ((x + image->xoffset) % image->bitmap_unit);
-		_putbits((char *) &pixel, i, 1, (char *) &px);
-		BXXYNORMALIZE(&px, image);
-		src = (char *) &px;
-		dst = &image->data[BXXYINDEX(x, y, image)];
-		for (i = nbytes; --i >= 0;)
-		    *dst++ = *src++;
-	    }
-    } else {
-	for (y = 0; y < height; y++)
-	    for (x = 0; x < width; x++, iptr++) {
-		pixel = pixels[*iptr];
-		if (image->depth == 4)
-		    pixel &= 0xf;
-		for (i = 0, px = pixel;
-		     i < sizeof(unsigned long); i++, px >>= 8)
-		    ((unsigned char *) &pixel)[i] = (unsigned char)px;
-		src = &image->data[BXZINDEX(x, y, image)];
-		dst = (char *) &px;
-		px = 0;
-		nbytes = (image->bits_per_pixel + 7) >> 3;
-		for (i = nbytes; --i >= 0;)
-		    *dst++ = *src++;
-		BXZNORMALIZE(&px, image);
-		_putbits((char *) &pixel,
-			 (x * image->bits_per_pixel) & 7,
-			 image->bits_per_pixel, (char *) &px);
-		BXZNORMALIZE(&px, image);
-		src = (char *) &px;
-		dst = &image->data[BXZINDEX(x, y, image)];
-		for (i = nbytes; --i >= 0;)
-		    *dst++ = *src++;
-	    }
-    }
-}
-
-/*
- * write pixels into a 32-bits Z image data structure
- */
-
-#ifndef WORD64
-static unsigned long byteorderpixel = MSBFirst << 24;
-
-#endif
-
-static void SetImagePixels32
-ARGLIST((image, width, height, pixelindex, pixels))
-ARG(XImage *, image)
-ARG(unsigned int, width)
-ARG(unsigned int, height)
-ARG(unsigned int *, pixelindex)
-GRA(Pixel *, pixels)
-{
-    register unsigned char *addr;
-    register unsigned int *paddr;
-    register unsigned int *iptr;
-    register int x, y;
-
-    iptr = pixelindex;
-#ifndef WORD64
-    if (*((char *) &byteorderpixel) == image->byte_order) {
-	for (y = 0; y < height; y++)
-	    for (x = 0; x < width; x++, iptr++) {
-		paddr =
-		    (unsigned int *)(&(image->data[BXZINDEX32(x, y, image)]));
-		*paddr = (unsigned int)pixels[*iptr];
-	    }
-    } else
-#endif
-    if (image->byte_order == MSBFirst)
-	for (y = 0; y < height; y++)
-	    for (x = 0; x < width; x++, iptr++) {
-		addr = &((unsigned char *) image->data)[BXZINDEX32(x, y, image)];
-		addr[0] = (unsigned char)(pixels[*iptr] >> 24);
-		addr[1] = (unsigned char)(pixels[*iptr] >> 16);
-		addr[2] = (unsigned char)(pixels[*iptr] >> 8);
-		addr[3] = (unsigned char)(pixels[*iptr]);
-	    }
-    else
-	for (y = 0; y < height; y++)
-	    for (x = 0; x < width; x++, iptr++) {
-		addr = &((unsigned char *) image->data)[BXZINDEX32(x, y, image)];
-		addr[3] = (unsigned char)(pixels[*iptr] >> 24);
-		addr[2] = (unsigned char)(pixels[*iptr] >> 16);
-		addr[1] = (unsigned char)(pixels[*iptr] >> 8);
-		addr[0] = (unsigned char)(pixels[*iptr]);
-	    }
-}
-
-/*
- * write pixels into a 16-bits Z image data structure
- */
-
-static void SetImagePixels16
-ARGLIST((image, width, height, pixelindex, pixels))
-ARG(XImage *, image)
-ARG(unsigned int, width)
-ARG(unsigned int, height)
-ARG(unsigned int *, pixelindex)
-GRA(Pixel *, pixels)
-{
-    register unsigned char *addr;
-    register unsigned int *iptr;
-    register int x, y;
-
-    iptr = pixelindex;
-    if (image->byte_order == MSBFirst)
-	for (y = 0; y < height; y++)
-	    for (x = 0; x < width; x++, iptr++) {
-		addr = &((unsigned char *) image->data)[BXZINDEX16(x, y, image)];
-		addr[0] = (unsigned char)(pixels[*iptr] >> 8);
-		addr[1] = (unsigned char)(pixels[*iptr]);
-	    }
-    else
-	for (y = 0; y < height; y++)
-	    for (x = 0; x < width; x++, iptr++) {
-		addr = &((unsigned char *) image->data)[BXZINDEX16(x, y, image)];
-		addr[1] = (unsigned char)(pixels[*iptr] >> 8);
-		addr[0] = (unsigned char)(pixels[*iptr]);
-	    }
-}
-
-/*
- * write pixels into a 8-bits Z image data structure
- */
-
-static void SetImagePixels8
-ARGLIST((image, width, height, pixelindex, pixels))
-ARG(XImage *, image)
-ARG(unsigned int, width)
-ARG(unsigned int, height)
-ARG(unsigned int *, pixelindex)
-GRA(Pixel *, pixels)
-
-{
-    register unsigned int *iptr;
-    register int x, y;
-
-    iptr = pixelindex;
-    for (y = 0; y < height; y++)
-	for (x = 0; x < width; x++, iptr++)
-	    image->data[BXZINDEX8(x, y, image)] = (char)pixels[*iptr];
-}
-
-/*
- * write pixels into a 1-bit depth image data structure and **offset null**
- */
-
-static void SetImagePixels1
-ARGLIST((image, width, height, pixelindex, pixels))
-ARG(XImage *, image)
-ARG(unsigned int, width)
-ARG(unsigned int, height)
-ARG(unsigned int *, pixelindex)
-GRA(Pixel *, pixels)
-{
-    unsigned char bit;
-    int xoff, yoff;
-    register unsigned int *iptr;
-    register int x, y;
-
-    if (image->byte_order != image->bitmap_bit_order)
-	SetImagePixels(image, width, height, pixelindex, pixels);
-    else {
-	iptr = pixelindex;
-	if (image->bitmap_bit_order == MSBFirst)
-	    for (y = 0; y < height; y++)
-		for (x = 0; x < width; x++, iptr++) {
-		    yoff = BXZINDEX1(x, y, image);
-		    xoff = x & 7;
-		    bit = 0x80 >> xoff;
-		    if (pixels[*iptr] & 1)
-			image->data[yoff] |= bit;
-		    else
-			image->data[yoff] &= ~bit;
-		}
-	else
-	    for (y = 0; y < height; y++)
-		for (x = 0; x < width; x++, iptr++) {
-		    yoff = BXZINDEX1(x, y, image);
-		    xoff = x & 7;
-		    bit = 1 << xoff;
-		    if (pixels[*iptr] & 1)
-			image->data[yoff] |= bit;
-		    else
-			image->data[yoff] &= ~bit;
-		}
-    }
-}
-
-/*
- * Store into the BxXpmAttributes structure the required informations stored in
- * the bxxpmInternAttrib structure.
- */
-
-static void xpmSetAttributes
-ARGLIST((attrib, attributes))
-ARG(bxxpmInternAttrib *, attrib)
-GRA(BxXpmAttributes *, attributes)
-{
-    if (attributes) {
-        if (attributes->valuemask & BxXpmReturnInfos) {
-            attributes->cpp = attrib->cpp;
-            attributes->ncolors = attrib->ncolors;
-            attributes->colorTable = attrib->colorTable;
-
-            attrib->ncolors = 0;
-            attrib->colorTable = NULL;
-        }
-        attributes->width = attrib->width;
-        attributes->height = attrib->height;
-        attributes->valuemask |= BxXpmSize;
-    }
-}
-
-/*
- * Free the BxXpmAttributes structure members
- * but the structure itself
- */
-
-static void BxXpmFreeAttributes
-ARGLIST((attributes))
-GRA(BxXpmAttributes *, attributes)
-{
-    if (attributes) {
-        if (attributes->valuemask & BxXpmReturnPixels && attributes->pixels) {
-            free((char *)attributes->pixels);
-            attributes->pixels = NULL;
-            attributes->npixels = 0;
-        }
-        if (attributes->valuemask & BxXpmInfos) {
-            if (attributes->colorTable) {
-                xpmFreeColorTable(attributes->colorTable, attributes->ncolors);
-                attributes->colorTable = NULL;
-                attributes->ncolors = 0;
-            }
-            if (attributes->hints_cmt) {
-                free(attributes->hints_cmt);
-                attributes->hints_cmt = NULL;
-            }
-            if (attributes->colors_cmt) {
-                free(attributes->colors_cmt);
-                attributes->colors_cmt = NULL;
-            }
-            if (attributes->pixels_cmt) {
-                free(attributes->pixels_cmt);
-                attributes->pixels_cmt = NULL;
-            }
-            if (attributes->pixels) {
-                free((char *)attributes->pixels);
-                attributes->pixels = NULL;
-            }
-        }
-        attributes->valuemask = 0;
-    }
-}
-
-/*
- * Free the bxxpmInternAttrib pointers which have been allocated
- */
-
-static void xpmFreeInternAttrib
-ARGLIST((attrib))
-GRA(bxxpmInternAttrib *, attrib)
-{
-    unsigned int a;
-
-    if (attrib->colorTable)
-        xpmFreeColorTable(attrib->colorTable, attrib->ncolors);
-    if (attrib->pixelindex)
-        free((char *)attrib->pixelindex);
-    if (attrib->xcolors)
-        free((char *)attrib->xcolors);
-    if (attrib->colorStrings) {
-        for (a = 0; a < attrib->ncolors; a++)
-            if (attrib->colorStrings[a])
-                free((char *)attrib->colorStrings[a]);
-        free((char *)attrib->colorStrings);
-    }
-}
-
-/*
- * close the file related to the bxxpmData if any
- */
-static void XpmDataClose
-ARGLIST((mdata))
-GRA(bxxpmData *, mdata)
-{
-    switch (mdata->type) {
-    case BXXPMARRAY:
-        break;
-    case BXXPMFILE:
-        if (mdata->stream.file != (stdout) && mdata->stream.file != (stdin))
-            fclose(mdata->stream.file);
-        break;
-#ifdef ZPIPE
-    case BXXPMPIPE:
-        pclose(mdata->stream.file);
-#endif
-    }
-}
-
-/*
- * skip whitespace and compute the following unsigned int,
- * returns 1 if one is found and 0 if not
- */
-static int xpmNextUI
-ARGLIST((mdata, ui_return))
-ARG(bxxpmData *, mdata)
-GRA(unsigned int *, ui_return)
-{
-    char buf[BUFSIZ];
-    int l;
-
-    l = xpmNextWord(mdata, buf);
-    return atoui(buf, l, ui_return);
-}
-
-/*
- * get the current comment line
- */
-static void xpmGetCmt
-ARGLIST((mdata, cmt))
-ARG(bxxpmData *, mdata)
-GRA(char **, cmt)
-{
-    switch (mdata->type) {
-    case BXXPMARRAY:
-        *cmt = NULL;
-        break;
-    case BXXPMFILE:
-    case BXXPMPIPE:
-        if (mdata->CommentLength) {
-            *cmt = (char *) malloc(mdata->CommentLength + 1);
-            strncpy(*cmt, mdata->Comment, mdata->CommentLength);
-            (*cmt)[mdata->CommentLength] = '\0';
-            mdata->CommentLength = 0;
-        } else
-            *cmt = NULL;
-        break;
-    }
-}
-
-/*
- * skip to the end of the current string and the beginning of the next one
- */
-static void xpmNextString
-ARGLIST((mdata))
-GRA(bxxpmData *, mdata)
-{
-    int c;
-
-    switch (mdata->type) {
-    case BXXPMARRAY:
-        mdata->cptr = (mdata->stream.data)[++mdata->line];
-        break;
-    case BXXPMFILE:
-    case BXXPMPIPE:
-        if (mdata->Eos)
-            while ((c = xpmGetC(mdata)) != mdata->Eos && c != EOF);
-        if (mdata->Bos)                 /* if not natural XPM2 */
-            while ((c = xpmGetC(mdata)) != mdata->Bos && c != EOF);
-        break;
-    }
-}
-
-/*
- * return the current character, skipping comments
- */
-static int xpmGetC
-ARGLIST((mdata))
-GRA(bxxpmData *, mdata)
-{
-    int c;
-    register unsigned int n = 0, a;
-    unsigned int notend;
-
-    switch (mdata->type) {
-    case BXXPMARRAY:
-        return (*mdata->cptr++);
-    case BXXPMFILE:
-    case BXXPMPIPE:
-        c = getc(mdata->stream.file);
-
-        if (mdata->Bos && mdata->Eos
-            && (c == mdata->Bos || c == mdata->Eos)) {
-            /* if not natural XPM2 */
-            mdata->InsideString = !mdata->InsideString;
-            return (c);
-        }
-        if (!mdata->InsideString && mdata->Bcmt && c == mdata->Bcmt[0]) {
-            mdata->Comment[0] = c;
-
-            /*
-             * skip the string begining comment
-             */
-            do {
-                c = getc(mdata->stream.file);
-                mdata->Comment[++n] = c;
-            } while (c == mdata->Bcmt[n] && mdata->Bcmt[n] != '\0'
-                     && c != EOF);
-
-            if (mdata->Bcmt[n] != '\0') {
-                /* this wasn't the begining of a comment */
-                /* put characters back in the order that we got them */
-                for (a = n; a > 0; a--)
-                    xpmUngetC(mdata->Comment[a], mdata);
-                return (mdata->Comment[0]);
-            }
-
-            /*
-             * store comment
-             */
-            mdata->Comment[0] = mdata->Comment[n];
-            notend = 1;
-            n = 0;
-            while (notend) {
-                while (mdata->Comment[n] != mdata->Ecmt[0] && c != EOF) {
-                    c = getc(mdata->stream.file);
-                    mdata->Comment[++n] = c;
-                }
-                mdata->CommentLength = n;
-                a = 0;
-                do {
-                    c = getc(mdata->stream.file);
-                    n++;
-                    a++;
-                    mdata->Comment[n] = c;
-                } while (c == mdata->Ecmt[a] && mdata->Ecmt[a] != '\0'
-                         && c != EOF);
-                if (mdata->Ecmt[a] == '\0') {
-                    /* this is the end of the comment */
-                    notend = 0;
-                    xpmUngetC(mdata->Comment[n], mdata);
-                }
-            }
-            c = xpmGetC(mdata);
-        }
-        return (c);
-    }
-    return('\0');
-}
-
-
-/*
- * push the given character back
- */
-static int xpmUngetC
-ARGLIST((c, mdata))
-ARG(int, c)
-GRA(bxxpmData *, mdata)
-{
-    switch (mdata->type) {
-    case BXXPMARRAY:
-        return (*--mdata->cptr = c);
-    case BXXPMFILE:
-    case BXXPMPIPE:
-        if (mdata->Bos && (c == mdata->Bos || c == mdata->Eos))
-            /* if not natural XPM2 */
-            mdata->InsideString = !mdata->InsideString;
-        return (ungetc(c, mdata->stream.file));
-    }
-    return('\0');
-}
-
-/*
- * skip whitespace and return the following word
- */
-static unsigned int xpmNextWord
-ARGLIST((mdata, buf))
-ARG(bxxpmData *, mdata)
-GRA(char *, buf)
-{
-    register unsigned int n = 0;
-    int c;
-
-    switch (mdata->type) {
-    case BXXPMARRAY:
-    	c = *mdata->cptr;
-        while (isspace(c) && c != mdata->Eos)
-            {
-	    mdata->cptr++;
-    	    c = *mdata->cptr;
-	    }
-        do {
-            c = *mdata->cptr++;
-            buf[n++] = c;
-        } while (!isspace(c) && c != mdata->Eos && c != '\0');
-        n--;
-        mdata->cptr--;
-        break;
-    case BXXPMFILE:
-    case BXXPMPIPE:
-        c = xpmGetC(mdata);
-        while (isspace(c) && c != mdata->Eos)
-	    c = xpmGetC(mdata);
-        while (!isspace(c) && c != mdata->Eos && c != EOF) {
-            buf[n++] = c;
-            c = xpmGetC(mdata);
-        }
-        xpmUngetC(c, mdata);
-        break;
-    }
-    return (n);
-}
-
-static int BxXpmVisualType
-ARGLIST((visual))
-GRA(Visual *, visual)
-{
-#if defined(__cplusplus) || defined(c_plusplus)
-    switch ( visual->c_class )
-#else
-    switch ( visual->class )
-#endif
-    {
-    case StaticGray:
-    case GrayScale:
-	switch (visual->map_entries)
-	{
-	case 2:
-	    return (BXMONO);
-	case 4:
-	    return (BXGRAY4);
-	default:
-	    return (BXGRAY);
-	}
-    default:
-	return (BXCOLOR);
-    }
-}
-
-/*
- * Free the computed color table
- */
-
-static void xpmFreeColorTable
-ARGLIST((colorTable, ncolors))
-ARG(char ***, colorTable)
-GRA(int, ncolors)
-{
-    int a, b;
-
-    if (colorTable) {
-        for (a = 0; a < ncolors; a++)
-            if (colorTable[a]) {
-                for (b = 0; b < (BXNKEYS + 1); b++)
-                    if (colorTable[a][b])
-                        free(colorTable[a][b]);
-                free((char *)colorTable[a]);
-            }
-        free((char *)colorTable);
-    }
-}
-
-#else /* USE_XPM_LIBRARY */
-
-#include <xpm.h>
-
-#define BxXpmColorError    		XpmColorError
-#define BxXpmSuccess       		XpmSuccess
-#define BxXpmOpenFailed    		XpmOpenFailed
-#define BxXpmFileInvalid   		XpmFileInvalid
-#define BxXpmNoMemory      		XpmNoMemory
-#define BxXpmColorFailed   		XpmColorFailed
-
-#define BxXpmVisual        		XpmVisual
-#define BxXpmColormap      		XpmColormap
-#define BxXpmDepth         		XpmDepth
-#define BxXpmSize          		XpmSize
-#define BxXpmHotspot       		XpmHotspot
-#define BxXpmCharsPerPixel 		XpmCharsPerPixel
-#define BxXpmColorSymbols  		XpmColorSymbols
-#define BxXpmRgbFilename   		XpmRgbFilename
-#define BxXpmInfos         		XpmInfos
-
-#define BxXpmReturnPixels  		XpmReturnPixels
-#define BxXpmReturnInfos   		XpmReturnInfos
-
-#define BxXpmCreatePixmapFromData	XpmCreatePixmapFromData
-#define BxXpmCreateImageFromData	XpmCreateImageFromData
-#define BxXpmFreeAttributes		XpmFreeAttributes
-
-typedef XpmAttributes      		BxXpmAttributes;
-
-#endif /* USE_XPM_LIBRARY */
-
-Pixmap XPM_PIXMAP
-ARGLIST((w, pixmapName))
-ARG(Widget, w)
-GRA(char **, pixmapName)
-{
-    BxXpmAttributes	attributes;
-    int			argcnt;
-    Arg			args[10];
-    Pixmap		pixmap;
-    Pixmap		shape;
-    int			returnValue;
-
-    argcnt = 0;
-    XtSetArg(args[argcnt], XmNdepth, &(attributes.depth)); argcnt++;
-    XtSetArg(args[argcnt], XmNcolormap, &(attributes.colormap)); argcnt++;
-    XtGetValues(w, args, argcnt);
-
-    attributes.visual = DefaultVisual(XtDisplay(w),
-				      DefaultScreen(XtDisplay(w)));
-    attributes.valuemask = (BxXpmDepth | BxXpmColormap | BxXpmVisual);
-
-    returnValue = BxXpmCreatePixmapFromData(XtDisplay(w),
-					  DefaultRootWindow(XtDisplay(w)),
-					  pixmapName, &pixmap, &shape,
-					  &attributes);
-    if ( shape )
-    {
-	XFreePixmap(XtDisplay(w), shape);
-    }
-
-    switch(returnValue)
-    {
-    case BxXpmOpenFailed:
-    case BxXpmFileInvalid:
-    case BxXpmNoMemory:
-    case BxXpmColorFailed:
-	XtWarning("Could not create pixmap.");
-	return(XmUNSPECIFIED_PIXMAP);
-    default:
-	return(pixmap);
-    }
-}
-
-#endif
-
-/* This structure is for capturing app-defaults values for a Class */
-
-typedef struct _UIAppDefault
-{
-    char*		cName;		/* Class name */
-    char*		wName; 		/* Widget name */
-    char*		cInstName;	/* Name of class instance(nested) */
-    char*		wRsc;		/* Widget resource */
-    char*		value;		/* value read from app-defaults */
-} UIAppDefault;
-
-
-void setDefaultResources ARGLIST((_name, w, resourceSpec))
-ARG(char*, _name)
-ARG(Widget, w)
-GRA(String *,resourceSpec)
-{
-   int         i;
-   Display    *dpy = XtDisplay ( w );	  /* Retrieve the display pointer */
-   XrmDatabase rdb = NULL;             /* A resource data base */
-
-   /* Create an empty resource database */
-
-   rdb = XrmGetStringDatabase ( "" );
-
-   /* Add the Component resources, prepending the name of the component */
-
-   i = 0;
-   while ( resourceSpec[i] != NULL )
-   {
-       char buf[1000];
-
-       sprintf(buf, "*%s%s", _name, resourceSpec[i++]);
-       XrmPutLineResource( &rdb, buf );
-   }
-
-   /* Merge them into the Xt database, with lowest precendence */
-
-   if ( rdb )
-   {
-#if (XlibSpecificationRelease>=5)
-        XrmDatabase db = XtDatabase(dpy);
-	XrmCombineDatabase(rdb, &db, FALSE);
-#else
-        XrmMergeDatabases ( dpy->db, &rdb );
-        dpy->db = rdb;
-#endif
-    }
-}
-
-/*
- * This method gets all the resources from the app-defaults file
- * (resource databse) and fills in the table (defs) if the app default
- * value exists.
- */
-void
-InitAppDefaults ARGLIST((parent, defs))
-ARG(Widget, parent)
-GRA(UIAppDefault *, defs)
-{
-    XrmQuark		cQuark;
-    XrmQuark		rsc[10];
-    XrmRepresentation	rep;
-    XrmValue		val;
-    XrmDatabase		rdb;
-    int			rscIdx;
-
-    /* Get the database */
-
-#if (XlibSpecificationRelease >= 5)
-    if ((rdb = XrmGetDatabase(XtDisplay(parent))) == NULL)
-    {
-	return;			/*  Can't get the database */
-    }
-#else
-    Display *dpy = XtDisplay(parent);
-    if ((rdb = dpy->db) == NULL)
-    {
-	return;
-    }
-#endif
-
-    /* Look for each resource in the table */
-
-    while (defs->wName)
-    {
-	rscIdx = 0;
-
-	cQuark = XrmStringToQuark(defs->cName);	/* class quark */
-	rsc[rscIdx++] = cQuark;
-	if (defs->wName[0] == '\0')
-	{
-	    rsc[rscIdx++] = cQuark;
-	}
-	else
-	{
-	    if( strchr(defs->wName, '.') == NULL )
-	    {
-		rsc[rscIdx++] = XrmStringToQuark(defs->wName);
-	    }
-	    else
-	    {
-		/*
-		 * If we found a '.' that means that this is not
-		 * a simple widget name, but a sub specification so
-		 * we need to split this into several quarks.
-		 */
-		char *copy = XtNewString(defs->wName), *ptr;
-
-		for( ptr = strtok(copy, "."); ptr != NULL;
-		     ptr = strtok(NULL, ".") )
-		{
-		    rsc[rscIdx++] = XrmStringToQuark(ptr);
-		}
-		XtFree(copy);
-	    }
-	}
-
-	if (defs->cInstName && defs->cInstName[0] != '\0')
-	{
-	    rsc[rscIdx++] = XrmStringToQuark(defs->cInstName);
-	}
-
-	rsc[rscIdx++] = XrmStringToQuark(defs->wRsc);
-	rsc[rscIdx++] = NULLQUARK;
-
-	if (XrmQGetResource(rdb, rsc, rsc, &rep, &val))
-	{
-	    defs->value = XtNewString((char*)val.addr);
-	}
-	defs++;
-    }
-}
-
-/*
- * This method applies the app defaults for the class to a specific
- * instance. All the widgets in the path are loosly coupled (use *).
- * To override a specific instance, use a tightly coupled app defaults
- * resource line (use .).
- */
-void
-SetAppDefaults ARGLIST((w, defs, inst_name, override_inst))
-ARG(Widget,w)
-ARG(UIAppDefault*, defs)
-ARG(char*, inst_name)
-GRA(Boolean, override_inst)
-{
-   Display*		dpy = XtDisplay ( w );	/*  Retrieve the display */
-   XrmDatabase		rdb = NULL;		/* A resource data base */
-   char			lineage[1000];
-   char			buf[1000];
-   Widget       	parent;
-
-   /* Protect ourselves */
-
-   if (inst_name == NULL) return;
-
-   /*  Create an empty resource database */
-
-   rdb = XrmGetStringDatabase ( "" );
-
-   /* Start the lineage with our name and then get our parents */
-
-   lineage[0] = '\0';
-   parent = w;
-
-   while (parent)
-   {
-       WidgetClass wclass = XtClass(parent);
-
-       if (wclass == applicationShellWidgetClass) break;
-
-       strcpy(buf, lineage);
-       sprintf(lineage, "*%s%s", XtName(parent), buf);
-
-       parent = XtParent(parent);
-   }
-
-   /*  Add the Component resources, prepending the name of the component */
-   while (defs->wName != NULL)
-   {
-       int name_length;
-       /*
-        * We don't deal with the resource if it isn't found in the
-	* Xrm database at class initializtion time (in initAppDefaults).
-	* Special handling of class instances.
-	*/
-       if (strchr(defs->wName, '.'))
-       {
-	   name_length = strlen(defs->wName) -
-		strlen(strchr(defs->wName, '.'));
-       }
-       else
-       {
-	   name_length = strlen(defs->wName) > strlen(inst_name) ?
-	       strlen(defs->wName) : strlen(inst_name);
-       }
-       if (defs->value == NULL ||
-	   (override_inst && strncmp(inst_name, defs->wName, name_length)) ||
-	   (! override_inst && defs->cInstName != NULL))
-       {
-	   defs++;
-	   continue;
-       }
-
-       /* Build up string after lineage */
-       if (defs->cInstName != NULL)
-       {
-	   /* Don't include class instance name if it is also the instance */
-	   /* being affected.  */
-
-	   if (*defs->cInstName != '\0')
-	   {
-	       sprintf(buf, "%s*%s*%s.%s: %s",
-		       lineage, defs->wName, defs->cInstName,
-			defs->wRsc, defs->value);
-	   }
-	   else
-	   {
-	       sprintf(buf, "%s*%s.%s: %s",
-		       lineage, defs->wName, defs->wRsc,
-			defs->value);
-	   }
-       }
-       else if (*defs->wName != '\0')
-       {
-	   sprintf(buf, "%s*%s*%s.%s: %s",
-		   lineage, inst_name, defs->wName, defs->wRsc, defs->value);
-       }
-       else
-       {
-	   sprintf(buf, "%s*%s.%s: %s",
-		   lineage, inst_name,defs->wRsc, defs->value);
-       }
-
-       XrmPutLineResource( &rdb, buf );
-       defs++;
-   }
-
-   /* Merge them into the Xt database, with lowest precendence */
-   if ( rdb )
-   {
-#if (XlibSpecificationRelease >= 5)
-        XrmDatabase db = XtDatabase(dpy);
-	XrmCombineDatabase(rdb, &db, FALSE);
-#else
-        XrmMergeDatabases ( dpy->db, &rdb );
-        dpy->db = rdb;
-#endif
-    }
-}
diff --git a/src/mbnavadjust/mbnavadjustmerge.c b/src/mbnavadjust/mbnavadjustmerge.c
deleted file mode 100644
index 4d0c2c8..0000000
--- a/src/mbnavadjust/mbnavadjustmerge.c
+++ /dev/null
@@ -1,2345 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbnavadjustmerge.c	4/14/2014
- *    $Id: mbnavadjustmerge.c 2239 2015-05-07 00:51:42Z caress $
- *
- *    Copyright (c) 2014-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * Mbnavadjustmerge merges two existing mbnavadjust projects. The result
- * can be to add one project to another or to create a new, third project
- * combining the two source projects.
- *
- * Author:	D. W. Caress
- * Date:	April 14, 2014
- *
- *
- */
-
-/* source file version string */
-static char version_id[] = "$Id: mbnavadjustmerge.c 2239 2015-05-07 00:51:42Z caress $";
-
-/* standard include files */
-#include <stdio.h>
-#include <stdlib.h>
-#include <getopt.h>
-#include <unistd.h>
-#include <math.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-
-/* MBIO include files */
-#include "mb_status.h"
-#include "mb_define.h"
-#include "mb_process.h"
-#include "mb_aux.h"
-#include "mbnavadjust_io.h"
-
-/* local defines */
-#define MBNAVADJUSTMERGE_MODE_NONE 	0
-#define MBNAVADJUSTMERGE_MODE_ADD 	1
-#define MBNAVADJUSTMERGE_MODE_MERGE 	2
-#define MBNAVADJUSTMERGE_MODE_COPY 	3
-#define MBNAVADJUSTMERGE_MODE_MODIFY 	4
-#define NUMBER_MODS_MAX			1000
-#define MOD_MODE_NONE 			0
-#define MOD_MODE_SET_GLOBAL_TIE 	1
-#define MOD_MODE_SET_GLOBAL_TIE_XYZ	2
-#define MOD_MODE_SET_GLOBAL_TIE_XY	3
-#define MOD_MODE_SET_GLOBAL_TIE_Z	4
-#define MOD_MODE_UNSET_GLOBAL_TIE	5
-#define MOD_MODE_ADD_CROSSING 		6
-#define MOD_MODE_SET_TIE 		7
-#define MOD_MODE_SET_TIE_XYZ		8
-#define MOD_MODE_SET_TIE_XY		9
-#define MOD_MODE_SET_TIE_Z		10
-#define MOD_MODE_UNSET_TIE		11
-#define MOD_MODE_SET_TIES_XYZ_FILE	12
-#define MOD_MODE_SET_TIES_XY_FILE	13
-#define MOD_MODE_SET_TIES_Z_FILE	14
-#define MOD_MODE_SET_TIES_XYZ_SURVEY	15
-#define MOD_MODE_SET_TIES_XY_SURVEY	16
-#define MOD_MODE_SET_TIES_Z_SURVEY	17
-#define MOD_MODE_SET_TIES_XYZ_BLOCK	18
-#define MOD_MODE_SET_TIES_XY_BLOCK	19
-#define MOD_MODE_SET_TIES_Z_BLOCK	20
-#define MOD_MODE_SET_TIES_ZOFFSET_BLOCK	21
-#define MOD_MODE_SKIP_UNSET_CROSSINGS	22
-#define MOD_MODE_INSERT_DISCONTINUITY   23
-
-struct mbnavadjust_mod
-	{
-	int	mode;
-	int	survey1;
-	int	file1;
-	int	section1;
-	int	snav1;
-	int	survey2;
-	int	file2;
-	int	section2;
-	int	snav2;
-	double	xoffset;
-	double	yoffset;
-	double	zoffset;
-	double	xsigma;
-	double	ysigma;
-	double	zsigma;
-	};
-
-/*--------------------------------------------------------------------*/
-
-int main (int argc, char **argv)
-{
-	char program_name[] = "mbnavadjustmerge";
-	char help_message[] =  "mbnavadjustmerge merges two existing mbnavadjust projects.\n";
-	char usage_message[] = "mbnavadjustmerge --input=project_path \n"
-				"\t[--input=project_path --output=project_path\n"
-				"\t--set-global-tie=file:section[:snav]/xoffset/yoffset/zoffset[/xsigma/ysigma/zsigma]\n"
-				"\t--set-global-tie-xyz=file:section[:snav]\n"
-				"\t--set-global-tie-xyonly=file:section[:snav]\n"
-				"\t--set-global-tie-zonly=file:section[:snav]\n"
-				"\t--unset-global-tie=file:section\n"
-				"\t--add-crossing=file1:section1/file2:section2\n"
-				"\t--set-tie=file1/file2/xoffset/yoffset/zoffset\n"
-				"\t--set-tie=file1:section1/file2:section2/xoffset/yoffset/zoffset\n"
-				"\t--set-tie=file1:section1/file2:section2/xoffset/yoffset/zoffset/xsigma/ysigma/zsigma\n"
-				"\t--set-tie-xyz=file1:section1/file2:section2\n"
-				"\t--set-tie-xyonly=file1:section1/file2:section2\n"
-				"\t--set-tie-zonly=file1:section1/file2:section2\n"
-				"\t--unset-tie=file1:section1/file2:section2\n"
-				"\t--set-ties-xyz-with-file=file\n"
-				"\t--set-ties-xyonly-with-file=file\n"
-				"\t--set-ties-zonly-with-file=file\n"
-				"\t--set-ties-xyz-by-survey=survey\n"
-				"\t--set-ties-xyonly-by-survey=survey\n"
-				"\t--set-ties-zonly-by-survey=survey\n"
-				"\t--set-ties-xyz-by-block=survey1/survey2\n"
-				"\t--set-ties-xyonly-by-block=survey1/survey2\n"
-				"\t--set-ties-zonly-by-block=survey1/survey2\n"
-				"\t--set-ties-zoffset-by-block=survey1/survey2/zoffset\n"
-				"\t--skip-unset-crossings\n"
-				"\t--insert-discontinuity=file:section\n"
-				"\t--verbose --help]\n";
-	extern char *optarg;
-	int	option_index;
-	int	errflg = 0;
-	int	c;
-	int	help = 0;
-
-	/* MBIO status variables */
-	int	status = MB_SUCCESS;
-	int	verbose = 0;
-	int	error = MB_ERROR_NO_ERROR;
-
-	/* command line option definitions */
-	/* mbnavadjustmerge --verbose
-	 * 		--help
-	 * 		--input=project_path
-	 * 		--output=project_path
-	 */
-	static struct option options[] =
-		{
-		{"verbose",			no_argument, 		NULL, 		0},
-		{"help",			no_argument, 		NULL, 		0},
-		{"input",			required_argument, 	NULL, 		0},
-		{"output",			required_argument, 	NULL, 		0},
-		{"set-global-tie",		required_argument, 	NULL, 		0},
-		{"set-global-tie-xyz",		required_argument, 	NULL, 		0},
-		{"set-global-tie-xyonly",	required_argument, 	NULL, 		0},
-		{"set-global-tie-zonly",	required_argument, 	NULL, 		0},
-		{"unset-global-tie",		required_argument, 	NULL, 		0},
-		{"add-crossing",		required_argument, 	NULL, 		0},
-		{"set-tie",			required_argument, 	NULL, 		0},
-		{"set-tie-xyz",			required_argument, 	NULL, 		0},
-		{"set-tie-xyonly",		required_argument, 	NULL, 		0},
-		{"set-tie-zonly",		required_argument, 	NULL, 		0},
-		{"unset-tie",			required_argument, 	NULL, 		0},
-		{"set-ties-xyz-with-file",	required_argument, 	NULL, 		0},
-		{"set-ties-xyonly-with-file",	required_argument, 	NULL, 		0},
-		{"set-ties-zonly-with-file",	required_argument, 	NULL, 		0},
-		{"set-ties-xyz-with-survey",	required_argument, 	NULL, 		0},
-		{"set-ties-xyonly-with-survey",	required_argument, 	NULL, 		0},
-		{"set-ties-zonly-with-survey",	required_argument, 	NULL, 		0},
-		{"set-ties-xyz-by-block",	required_argument, 	NULL, 		0},
-		{"set-ties-xyonly-by-block",	required_argument, 	NULL, 		0},
-		{"set-ties-zonly-by-block",	required_argument, 	NULL, 		0},
-		{"set-ties-zoffset-by-block",	required_argument, 	NULL, 		0},
-		{"skip-unset-crossings",	no_argument, 		NULL, 		0},
-		{"insert-discontinuity",	required_argument, 	NULL, 		0},
-		{NULL,				0, 			NULL, 		0}
-		};
-		
-	/* mbnavadjustmerge controls */
-	int	mbnavadjustmerge_mode = MBNAVADJUSTMERGE_MODE_NONE;
-	mb_path	project_inputbase_path;
-	mb_path	project_inputadd_path;
-	mb_path	project_output_path;
-	int	project_inputbase_set = MB_NO;
-	int	project_inputadd_set = MB_NO;
-	int	project_output_set = MB_NO;
-	struct mbna_project project_inputbase;
-	struct mbna_project project_inputadd;
-	struct mbna_project project_output;
-	
-	/* mbnavadjustmerge mod parameters */
-	struct mbnavadjust_mod mods[NUMBER_MODS_MAX];
-	int	num_mods = 0;
-	
-	struct mbna_file *file1;
-	struct mbna_section *section1;
-	struct mbna_file *file2;
-	struct mbna_section *section2;
-	struct mbna_crossing *crossing;
-	struct mbna_tie *tie;
-
-	int	nscan;
-	int	shellstatus;
-	mb_path	command;
-	double	mtodeglon, mtodeglat;
-	int	found, current_crossing;
-	int	imod, icrossing, itie;
-	int	i, j, k;
-	
-	memset(project_inputbase_path, 0, sizeof(mb_path));
-	memset(project_inputadd_path, 0, sizeof(mb_path));
-	memset(project_output_path, 0, sizeof(mb_path));
-	memset(mods, 0, NUMBER_MODS_MAX * sizeof(struct mbnavadjust_mod));
-
-	/* process argument list */
-	while ((c = getopt_long(argc, argv, "", options, &option_index)) != -1)
-	  switch (c)
-		{
-		/* long options all return c=0 */
-		case 0:
-			/* verbose */
-			if (strcmp("verbose", options[option_index].name) == 0)
-				{
-				verbose++;
-				}
-			
-			/* help */
-			else if (strcmp("help", options[option_index].name) == 0)
-				{
-				help = MB_YES;
-				}
-				
-			/*-------------------------------------------------------
-			 * Define input and output projects */
-			
-			/* input */
-			else if (strcmp("input", options[option_index].name) == 0)
-				{
-				if (project_inputbase_set == MB_NO)
-					{
-					strcpy(project_inputbase_path, optarg);
-					project_inputbase_set = MB_YES;
-					}
-				else if (project_inputadd_set == MB_NO)
-					{
-					strcpy(project_inputadd_path, optarg);
-					project_inputadd_set = MB_YES;
-					}
-				else
-					{
-					fprintf(stderr,"Input projects already set:\n\t%s\n\t%s\nProject %s ignored...\n\n",
-						project_inputbase_path, project_inputadd_path, optarg);
-					}
-				}
-						
-			/* output */
-			else if (strcmp("output", options[option_index].name) == 0)
-				{
-				if (project_output_set == MB_NO)
-					{
-					strcpy(project_output_path, optarg);
-					project_output_set = MB_YES;
-					}
-				else
-					{
-					fprintf(stderr,"Output project already set:\n\t%s\nProject %s ignored\n\n",
-						project_output_path, optarg);
-					}
-				}
-				
-			/*-------------------------------------------------------
-			 * set global tie 
-				--set-global-tie=file:section:snav/xoffset/yoffset/zoffset/xsigma/ysigma/zsigma
-				--set-global-tie=file:section/xoffset/yoffset/zoffset/xsigma/ysigma/zsigma
-				--set-global-tie=file:section:snav/xoffset/yoffset/zoffset 
-				--set-global-tie=file:section/xoffset/yoffset/zoffset */
-			else if (strcmp("set-global-tie", options[option_index].name) == 0)
-				{
-				if (num_mods < NUMBER_MODS_MAX)
-					{
-					if ((nscan = sscanf(optarg, "%d:%d:%d/%lf/%lf/%lf/%lf/%lf/%lf",
-						       &mods[num_mods].file1,
-						       &mods[num_mods].section1,
-						       &mods[num_mods].snav1,
-						       &mods[num_mods].xoffset,
-						       &mods[num_mods].yoffset,
-						       &mods[num_mods].zoffset,
-						       &mods[num_mods].xsigma,
-						       &mods[num_mods].ysigma,
-						       &mods[num_mods].zsigma)) == 9)
-						{
-						mods[num_mods].mode = MOD_MODE_SET_GLOBAL_TIE;
-						num_mods++;
-						}
-					else if ((nscan = sscanf(optarg, "%d:%d/%lf/%lf/%lf/%lf/%lf/%lf",
-						       &mods[num_mods].file1,
-						       &mods[num_mods].section1,
-						       &mods[num_mods].xoffset,
-						       &mods[num_mods].yoffset,
-						       &mods[num_mods].zoffset,
-						       &mods[num_mods].xsigma,
-						       &mods[num_mods].ysigma,
-						       &mods[num_mods].zsigma)) == 8)
-						{
-						mods[num_mods].mode = MOD_MODE_SET_GLOBAL_TIE;
-						mods[num_mods].snav1 = 0;
-						num_mods++;
-						}
-					else if ((nscan = sscanf(optarg, "%d:%d:%d/%lf/%lf/%lf",
-						       &mods[num_mods].file1,
-						       &mods[num_mods].section1,
-						       &mods[num_mods].snav1,
-						       &mods[num_mods].xoffset,
-						       &mods[num_mods].yoffset,
-						       &mods[num_mods].zoffset)) == 6)
-						{
-						mods[num_mods].mode = MOD_MODE_SET_GLOBAL_TIE;
-						mods[num_mods].xsigma = 10.0;
-						mods[num_mods].ysigma = 10.0;
-						mods[num_mods].zsigma = 0.5;
-						num_mods++;
-						}
-					else if ((nscan = sscanf(optarg, "%d:%d/%lf/%lf/%lf",
-						       &mods[num_mods].file1,
-						       &mods[num_mods].section1,
-						       &mods[num_mods].xoffset,
-						       &mods[num_mods].yoffset,
-						       &mods[num_mods].zoffset)) == 5)
-						{
-						mods[num_mods].mode = MOD_MODE_SET_GLOBAL_TIE;
-						mods[num_mods].snav1 = 0;
-						mods[num_mods].xsigma = 10.0;
-						mods[num_mods].ysigma = 10.0;
-						mods[num_mods].zsigma = 0.5;
-						num_mods++;
-						}
-					else
-						{
-						fprintf(stderr,"Failure to parse --set-global-tie=%s\n\tmod command ignored\n\n",
-							optarg);	
-						}
-					}
-				else
-					{
-					fprintf(stderr,"Maximum number of mod commands reached:\n\t--add-crossing=%s command ignored\n\n",
-							optarg);	
-					}
-				}
-				
-			/*-------------------------------------------------------
-			 * set global tie mode
-				--set-global-tie-xyz=file:section:snav
-				--set-global-tie-xyonly=file:section:snav
-				--set-global-tie-zonly=file:section:snav  
-				--unset-global-tie=file:section  */
-			else if (strcmp("set-global-tie-xyz", options[option_index].name) == 0)
-				{
-				if (num_mods < NUMBER_MODS_MAX)
-					{
-					if ((nscan = sscanf(optarg, "%d:%d:%d",
-						       &mods[num_mods].file1,
-						       &mods[num_mods].section1,
-						       &mods[num_mods].snav1)) == 3)
-						{
-						mods[num_mods].mode = MOD_MODE_SET_GLOBAL_TIE_XYZ;
-						num_mods++;
-						}
-					else if ((nscan = sscanf(optarg, "%d:%d",
-						       &mods[num_mods].file1,
-						       &mods[num_mods].section1)) == 2)
-						{
-						mods[num_mods].snav1 = 0;
-						mods[num_mods].mode = MOD_MODE_SET_GLOBAL_TIE_XYZ;
-						num_mods++;
-						}
-					else
-						{
-						fprintf(stderr,"Failure to parse --set-global-tie-xyz=%s\n\tmod command ignored\n\n",
-							optarg);	
-						}
-					}
-				else
-					{
-					fprintf(stderr,"Maximum number of mod commands reached:\n\t--add-crossing=%s command ignored\n\n",
-							optarg);	
-					}
-				}
-			else if (strcmp("set-global-tie-xyonly", options[option_index].name) == 0)
-				{
-				if (num_mods < NUMBER_MODS_MAX)
-					{
-					if ((nscan = sscanf(optarg, "%d:%d:%d",
-						       &mods[num_mods].file1,
-						       &mods[num_mods].section1,
-						       &mods[num_mods].snav1)) == 3)
-						{
-						mods[num_mods].mode = MOD_MODE_SET_GLOBAL_TIE_XY;
-						num_mods++;
-						}
-					else if ((nscan = sscanf(optarg, "%d:%d",
-						       &mods[num_mods].file1,
-						       &mods[num_mods].section1)) == 2)
-						{
-						mods[num_mods].snav1 = 0;
-						mods[num_mods].mode = MOD_MODE_SET_GLOBAL_TIE_XY;
-						num_mods++;
-						}
-					else
-						{
-						fprintf(stderr,"Failure to parse --set-global-tie-xy=%s\n\tmod command ignored\n\n",
-							optarg);	
-						}
-					}
-				else
-					{
-					fprintf(stderr,"Maximum number of mod commands reached:\n\t--add-crossing=%s command ignored\n\n",
-							optarg);	
-					}
-				}
-			else if (strcmp("set-global-tie-zonly", options[option_index].name) == 0)
-				{
-				if (num_mods < NUMBER_MODS_MAX)
-					{
-					if ((nscan = sscanf(optarg, "%d:%d:%d",
-						       &mods[num_mods].file1,
-						       &mods[num_mods].section1,
-						       &mods[num_mods].snav1)) == 3)
-						{
-						mods[num_mods].mode = MOD_MODE_SET_GLOBAL_TIE_Z;
-						num_mods++;
-						}
-					else if ((nscan = sscanf(optarg, "%d:%d",
-						       &mods[num_mods].file1,
-						       &mods[num_mods].section1)) == 2)
-						{
-						mods[num_mods].snav1 = 0;
-						mods[num_mods].mode = MOD_MODE_SET_GLOBAL_TIE_Z;
-						num_mods++;
-						}
-					else
-						{
-						fprintf(stderr,"Failure to parse --set-global-tie-z=%s\n\tmod command ignored\n\n",
-							optarg);	
-						}
-					}
-				else
-					{
-					fprintf(stderr,"Maximum number of mod commands reached:\n\t--add-crossing=%s command ignored\n\n",
-							optarg);	
-					}
-				}
-			else if (strcmp("unset-global-tie", options[option_index].name) == 0)
-				{
-				if (num_mods < NUMBER_MODS_MAX)
-					{
-					if ((nscan = sscanf(optarg, "%d:%d",
-						       &mods[num_mods].file1,
-						       &mods[num_mods].section1)) == 2)
-						{
-						mods[num_mods].mode = MOD_MODE_UNSET_GLOBAL_TIE;
-						num_mods++;
-						}
-					else
-						{
-						fprintf(stderr,"Failure to parse --set-global-tie-z=%s\n\tmod command ignored\n\n",
-							optarg);	
-						}
-					}
-				else
-					{
-					fprintf(stderr,"Maximum number of mod commands reached:\n\t--add-crossing=%s command ignored\n\n",
-							optarg);	
-					}
-				}
-				
-			/*-------------------------------------------------------
-			 * add crossing 
-				--add-crossing=file1:section1/file2:section2 */
-			else if (strcmp("add-crossing", options[option_index].name) == 0)
-				{
-				if (num_mods < NUMBER_MODS_MAX)
-					{
-					if ((nscan = sscanf(optarg, "%d:%d/%d:%d",
-						       &mods[num_mods].file1,
-						       &mods[num_mods].section1,
-						       &mods[num_mods].file2,
-						       &mods[num_mods].section2)) == 4)
-						{
-						mods[num_mods].mode = MOD_MODE_ADD_CROSSING;
-						num_mods++;
-						}
-					else if ((nscan = sscanf(optarg, "%d/%d",
-								&mods[num_mods].file1,
-								&mods[num_mods].file2)) == 2)
-						{
-						mods[num_mods].section1 = 0;
-						mods[num_mods].section2 = 0;
-						mods[num_mods].mode = MOD_MODE_ADD_CROSSING;
-						num_mods++;
-						}
-					else
-						{
-						fprintf(stderr,"Failure to parse --add-crossing=%s\n\tmod command ignored\n\n",
-							optarg);	
-						}
-					}
-				else
-					{
-					fprintf(stderr,"Maximum number of mod commands reached:\n\t--add-crossing=%s command ignored\n\n",
-							optarg);	
-					}
-				}
-			
-			/*-------------------------------------------------------
-			 * set tie offset values - add tie if needed
-				--set-tie=file1:section1/file2:section2/xoffset/yoffset/zoffset */
-			else if (strcmp("set-tie", options[option_index].name) == 0)
-				{
-				if (num_mods < NUMBER_MODS_MAX)
-					{
-					if ((nscan = sscanf(optarg, "%d:%d/%d:%d/%lf/%lf/%lf/%lf/%lf/%lf",
-						       &mods[num_mods].file1,
-						       &mods[num_mods].section1,
-						       &mods[num_mods].file2,
-						       &mods[num_mods].section2,
-						       &mods[num_mods].xoffset,
-						       &mods[num_mods].yoffset,
-						       &mods[num_mods].zoffset,
-						       &mods[num_mods].xsigma,
-						       &mods[num_mods].ysigma,
-						       &mods[num_mods].zsigma)) == 10)
-						{
-						mods[num_mods].mode = MOD_MODE_SET_TIE;
-						num_mods++;
-						}
-					else if ((nscan = sscanf(optarg, "%d:%d/%d:%d/%lf/%lf/%lf",
-						       &mods[num_mods].file1,
-						       &mods[num_mods].section1,
-						       &mods[num_mods].file2,
-						       &mods[num_mods].section2,
-						       &mods[num_mods].xoffset,
-						       &mods[num_mods].yoffset,
-						       &mods[num_mods].zoffset)) == 7)
-						{
-						mods[num_mods].xsigma = 10.0;
-						mods[num_mods].ysigma = 10.0;
-						mods[num_mods].zsigma = 1.0;
-						mods[num_mods].mode = MOD_MODE_SET_TIE;
-						num_mods++;
-						}
-					else if ((nscan = sscanf(optarg, "%d/%d/%lf/%lf/%lf",
-								&mods[num_mods].file1,
-								&mods[num_mods].file2,
-								&mods[num_mods].xoffset,
-								&mods[num_mods].yoffset,
-								&mods[num_mods].zoffset)) == 5)
-						{
-						mods[num_mods].section1 = 0;
-						mods[num_mods].section2 = 0;
-						mods[num_mods].xsigma = 10.0;
-						mods[num_mods].ysigma = 10.0;
-						mods[num_mods].zsigma = 1.0;
-						mods[num_mods].mode = MOD_MODE_SET_TIE;
-						num_mods++;
-						}
-					else
-						{
-						fprintf(stderr,"Failure to parse --set-tie=%s\n\tmod command ignored\n\n",
-							optarg);	
-						}
-					}
-				else
-					{
-					fprintf(stderr,"Maximum number of mod commands reached:\n\t--set-tie=%s command ignored\n\n",
-							optarg);	
-					}
-				}
-			
-			/*-------------------------------------------------------
-			 * set tie mode
-				--set-tie-xyz=file1:section1/file2:section2
-				--set-tie-xyonly=file1:section1/file2:section2
-				--set-tie-zonly=file1:section1/file2:section2 */
-			else if (strcmp("set-tie-xyz", options[option_index].name) == 0)
-				{
-				if (num_mods < NUMBER_MODS_MAX)
-					{
-					if ((nscan = sscanf(optarg, "%d:%d/%d:%d",
-						       &mods[num_mods].file1,
-						       &mods[num_mods].section1,
-						       &mods[num_mods].file2,
-						       &mods[num_mods].section2)) == 4)
-						{
-						mods[num_mods].mode = MOD_MODE_SET_TIE_XYZ;
-						num_mods++;
-						}
-					else if ((nscan = sscanf(optarg, "%d/%d",
-								&mods[num_mods].file1,
-								&mods[num_mods].file2)) == 2)
-						{
-						mods[num_mods].section1 = 0;
-						mods[num_mods].section2 = 0;
-						mods[num_mods].mode = MOD_MODE_SET_TIE_XYZ;
-						num_mods++;
-						}
-					else
-						{
-						fprintf(stderr,"Failure to parse --set-tie-xyz=%s\n\tmod command ignored\n\n",
-							optarg);	
-						}
-					}
-				else
-					{
-					fprintf(stderr,"Maximum number of mod commands reached:\n\t--set-tie-xyz=%s command ignored\n\n",
-							optarg);	
-					}
-				}
-			else if (strcmp("set-tie-xyonly", options[option_index].name) == 0)
-				{
-				if (num_mods < NUMBER_MODS_MAX)
-					{
-					if ((nscan = sscanf(optarg, "%d:%d/%d:%d",
-						       &mods[num_mods].file1,
-						       &mods[num_mods].section1,
-						       &mods[num_mods].file2,
-						       &mods[num_mods].section2)) == 4)
-						{
-						mods[num_mods].mode = MOD_MODE_SET_TIE_XY;
-						num_mods++;
-						}
-					else if ((nscan = sscanf(optarg, "%d/%d",
-								&mods[num_mods].file1,
-								&mods[num_mods].file2)) == 2)
-						{
-						mods[num_mods].section1 = 0;
-						mods[num_mods].section2 = 0;
-						mods[num_mods].mode = MOD_MODE_SET_TIE_XY;
-						num_mods++;
-						}
-					else
-						{
-						fprintf(stderr,"Failure to parse --set-tie-xy=%s\n\tmod command ignored\n\n",
-							optarg);	
-						}
-					}
-				else
-					{
-					fprintf(stderr,"Maximum number of mod commands reached:\n\t--set-tie-xy=%s command ignored\n\n",
-							optarg);	
-					}
-				}
-			else if (strcmp("set-tie-zonly", options[option_index].name) == 0)
-				{
-				if (num_mods < NUMBER_MODS_MAX)
-					{
-					if ((nscan = sscanf(optarg, "%d:%d/%d:%d",
-						       &mods[num_mods].file1,
-						       &mods[num_mods].section1,
-						       &mods[num_mods].file2,
-						       &mods[num_mods].section2)) == 4)
-						{
-						mods[num_mods].mode = MOD_MODE_SET_TIE_Z;
-						num_mods++;
-						}
-					else if ((nscan = sscanf(optarg, "%d/%d",
-								&mods[num_mods].file1,
-								&mods[num_mods].file2)) == 2)
-						{
-						mods[num_mods].section1 = 0;
-						mods[num_mods].section2 = 0;
-						mods[num_mods].mode = MOD_MODE_SET_TIE_Z;
-						num_mods++;
-						}
-					else
-						{
-						fprintf(stderr,"Failure to parse --set-tie-z=%s\n\tmod command ignored\n\n",
-							optarg);	
-						}
-					}
-				else
-					{
-					fprintf(stderr,"Maximum number of mod commands reached:\n\t--set-tie-z=%s command ignored\n\n",
-							optarg);	
-					}
-				}
-			else if (strcmp("unset-tie", options[option_index].name) == 0)
-				{
-				if (num_mods < NUMBER_MODS_MAX)
-					{
-					if ((nscan = sscanf(optarg, "%d:%d/%d:%d",
-						       &mods[num_mods].file1,
-						       &mods[num_mods].section1,
-						       &mods[num_mods].file2,
-						       &mods[num_mods].section2)) == 4)
-						{
-						mods[num_mods].mode = MOD_MODE_UNSET_TIE;
-						num_mods++;
-						}
-					else
-						{
-						fprintf(stderr,"Failure to parse --set-tie-z=%s\n\tmod command ignored\n\n",
-							optarg);	
-						}
-					}
-				else
-					{
-					fprintf(stderr,"Maximum number of mod commands reached:\n\t--set-tie-z=%s command ignored\n\n",
-							optarg);	
-					}
-				}
-			
-			/*-------------------------------------------------------
-			 * set mode of all ties with a file
-				--set-ties-xyz-with-file=file
-				--set-ties-xyonly-with-file=file
-				--set-ties-zonly-with-file=file */
-			else if (strcmp("set-ties-xyz-with-file", options[option_index].name) == 0)
-				{
-				if (num_mods < NUMBER_MODS_MAX)
-					{
-					if ((nscan = sscanf(optarg, "%d",
-						       &mods[num_mods].file1)) == 1)
-						{
-						mods[num_mods].mode = MOD_MODE_SET_TIES_XYZ_FILE;
-						num_mods++;
-						}
-					else
-						{
-						fprintf(stderr,"Failure to parse --set-ties-xyz-with-file=%s\n\tmod command ignored\n\n",
-							optarg);	
-						}
-					}
-				else
-					{
-					fprintf(stderr,"Maximum number of mod commands reached:\n\t--set-ties-xyz-with-file=%s command ignored\n\n",
-							optarg);	
-					}
-				}
-			else if (strcmp("set-ties-xyonly-with-file", options[option_index].name) == 0)
-				{
-				if (num_mods < NUMBER_MODS_MAX)
-					{
-					if ((nscan = sscanf(optarg, "%d",
-						       &mods[num_mods].file1)) == 1)
-						{
-						mods[num_mods].mode = MOD_MODE_SET_TIES_XY_FILE;
-						num_mods++;
-						}
-					else
-						{
-						fprintf(stderr,"Failure to parse --set-ties-xyonly-with-file=%s\n\tmod command ignored\n\n",
-							optarg);	
-						}
-					}
-				else
-					{
-					fprintf(stderr,"Maximum number of mod commands reached:\n\t--set-ties-xyonly-with-file=%s command ignored\n\n",
-							optarg);	
-					}
-				}
-			else if (strcmp("set-ties-xyz-with-file", options[option_index].name) == 0)
-				{
-				if (num_mods < NUMBER_MODS_MAX)
-					{
-					if ((nscan = sscanf(optarg, "%d",
-						       &mods[num_mods].file1)) == 1)
-						{
-						mods[num_mods].mode = MOD_MODE_SET_TIES_Z_FILE;
-						num_mods++;
-						}
-					else
-						{
-						fprintf(stderr,"Failure to parse --set-ties-xyz-with-file=%s\n\tmod command ignored\n\n",
-							optarg);	
-						}
-					}
-				else
-					{
-					fprintf(stderr,"Maximum number of mod commands reached:\n\t--set-ties-xyz-with-file=%s command ignored\n\n",
-							optarg);	
-					}
-				}
-
-			/*-------------------------------------------------------
-			 * set mode of all ties with a survey
-				--set-ties-xyz-by-survey=survey
-				--set-ties-xyonly-by-survey=survey
-				--set-ties-zonly-by-survey=survey */
-			else if (strcmp("set-ties-xyz-with-survey", options[option_index].name) == 0)
-				{
-				if (num_mods < NUMBER_MODS_MAX)
-					{
-					if ((nscan = sscanf(optarg, "%d",
-						       &mods[num_mods].survey1)) == 1)
-						{
-						mods[num_mods].mode = MOD_MODE_SET_TIES_XYZ_SURVEY;
-						num_mods++;
-						}
-					else
-						{
-						fprintf(stderr,"Failure to parse --set-ties-xyz-with-survey=%s\n\tmod command ignored\n\n",
-							optarg);	
-						}
-					}
-				else
-					{
-					fprintf(stderr,"Maximum number of mod commands reached:\n\t--set-ties-xyz-with-survey=%s command ignored\n\n",
-							optarg);	
-					}
-				}
-			else if (strcmp("set-ties-xyonly-with-survey", options[option_index].name) == 0)
-				{
-				if (num_mods < NUMBER_MODS_MAX)
-					{
-					if ((nscan = sscanf(optarg, "%d",
-						       &mods[num_mods].survey1)) == 1)
-						{
-						mods[num_mods].mode = MOD_MODE_SET_TIES_XY_SURVEY;
-						num_mods++;
-						}
-					else
-						{
-						fprintf(stderr,"Failure to parse --set-ties-xyonly-with-survey=%s\n\tmod command ignored\n\n",
-							optarg);	
-						}
-					}
-				else
-					{
-					fprintf(stderr,"Maximum number of mod commands reached:\n\t--set-ties-xyonly-with-survey=%s command ignored\n\n",
-							optarg);	
-					}
-				}
-			else if (strcmp("set-ties-xyz-with-survey", options[option_index].name) == 0)
-				{
-				if (num_mods < NUMBER_MODS_MAX)
-					{
-					if ((nscan = sscanf(optarg, "%d",
-						       &mods[num_mods].survey1)) == 1)
-						{
-						mods[num_mods].mode = MOD_MODE_SET_TIES_Z_SURVEY;
-						num_mods++;
-						}
-					else
-						{
-						fprintf(stderr,"Failure to parse --set-ties-xyz-with-survey=%s\n\tmod command ignored\n\n",
-							optarg);	
-						}
-					}
-				else
-					{
-					fprintf(stderr,"Maximum number of mod commands reached:\n\t--set-ties-xyz-with-survey=%s command ignored\n\n",
-							optarg);	
-					}
-				}
-			
-			/*-------------------------------------------------------
-			 * set mode of all ties between two surveys
-				--set-ties-xyz-by-block=survey1/survey2
-				--set-ties-xyonly-by-block=survey1/survey2
-				--set-ties-zonly-by-block=survey1/survey2 */
-			else if (strcmp("set-ties-xyz-by-block", options[option_index].name) == 0)
-				{
-				if (num_mods < NUMBER_MODS_MAX)
-					{
-					if ((nscan = sscanf(optarg, "%d/%d",
-						       &mods[num_mods].survey1, &mods[num_mods].survey2)) == 2)
-						{
-						mods[num_mods].mode = MOD_MODE_SET_TIES_XYZ_BLOCK;
-						num_mods++;
-						}
-					else
-						{
-						fprintf(stderr,"Failure to parse --set-ties-xyz-with-block=%s\n\tmod command ignored\n\n",
-							optarg);	
-						}
-					}
-				else
-					{
-					fprintf(stderr,"Maximum number of mod commands reached:\n\t--set-ties-xyz-with-block=%s command ignored\n\n",
-							optarg);	
-					}
-				}
-			else if (strcmp("set-ties-xyonly-by-block", options[option_index].name) == 0)
-				{
-				if (num_mods < NUMBER_MODS_MAX)
-					{
-					if ((nscan = sscanf(optarg, "%d/%d",
-						       &mods[num_mods].survey1, &mods[num_mods].survey2)) == 2)
-						{
-						mods[num_mods].mode = MOD_MODE_SET_TIES_XY_BLOCK;
-						num_mods++;
-						}
-					else
-						{
-						fprintf(stderr,"Failure to parse --set-ties-xyonly-with-block=%s\n\tmod command ignored\n\n",
-							optarg);	
-						}
-					}
-				else
-					{
-					fprintf(stderr,"Maximum number of mod commands reached:\n\t--set-ties-xyonly-with-block=%s command ignored\n\n",
-							optarg);	
-					}
-				}
-			else if (strcmp("set-ties-xyz-by-block", options[option_index].name) == 0)
-				{
-				if (num_mods < NUMBER_MODS_MAX)
-					{
-					if ((nscan = sscanf(optarg, "%d/%d",
-						       &mods[num_mods].survey1, &mods[num_mods].survey2)) == 2)
-						{
-						mods[num_mods].mode = MOD_MODE_SET_TIES_Z_BLOCK;
-						num_mods++;
-						}
-					else
-						{
-						fprintf(stderr,"Failure to parse --set-ties-xyz-with-block=%s\n\tmod command ignored\n\n",
-							optarg);	
-						}
-					}
-				else
-					{
-					fprintf(stderr,"Maximum number of mod commands reached:\n\t--set-ties-xyz-with-block=%s command ignored\n\n",
-							optarg);	
-					}
-				}
-			
-			/*-------------------------------------------------------
-			 * set zoffset of all ties between two surveys
-				--set-ties-zoffset-by-block=survey1/survey2/zoffset */
-			else if (strcmp("set-ties-zoffset-by-block", options[option_index].name) == 0)
-				{
-				if (num_mods < NUMBER_MODS_MAX)
-					{
-					if ((nscan = sscanf(optarg, "%d/%d/%lf",
-						       &mods[num_mods].survey1, &mods[num_mods].survey2, &mods[num_mods].zoffset)) == 3)
-						{
-						mods[num_mods].mode = MOD_MODE_SET_TIES_ZOFFSET_BLOCK;
-						num_mods++;
-						}
-					else
-						{
-						fprintf(stderr,"Failure to parse --set-ties-zoffset-with-block=%s\n\tmod command ignored\n\n",
-							optarg);	
-						}
-					}
-				else
-					{
-					fprintf(stderr,"Maximum number of mod commands reached:\n\t--set-ties-xyz-with-block=%s command ignored\n\n",
-							optarg);	
-					}
-				}
-				
-			/*-------------------------------------------------------
-			 * set all crossings without ties in the input project(s) to be skipped
-				--skip-unset-crossings */
-			else if (strcmp("skip-unset-crossings", options[option_index].name) == 0)
-				{
-				if (num_mods < NUMBER_MODS_MAX)
-					{
-					mods[num_mods].mode = MOD_MODE_SKIP_UNSET_CROSSINGS;
-					num_mods++;
-					}
-				else
-					{
-					fprintf(stderr,"Maximum number of mod commands reached:\n\tskip-unset-crossings command ignored\n\n");	
-					}
-				}
-				
-			/*-------------------------------------------------------
-			 * Insert discontinuity immediately before the file and section specified
-				--insert-discontinuity */
-			else if (strcmp("insert-discontinuity", options[option_index].name) == 0)
-				{
-				if (num_mods < NUMBER_MODS_MAX)
-					{
-					if ((nscan = sscanf(optarg, "%d:%d",
-						       &mods[num_mods].file1, &mods[num_mods].section1)) == 2)
-						{
-						mods[num_mods].mode = MOD_MODE_INSERT_DISCONTINUITY;
-						num_mods++;
-						}
-					}
-				else
-					{
-					fprintf(stderr,"Maximum number of mod commands reached:\n\tskip-unset-crossings command ignored\n\n");	
-					}
-				}
-			
-			break;
-		case '?':
-			errflg++;
-		}
-
-	/* if error flagged then print it and exit */
-	if (errflg)
-		{
-		fprintf(stderr,"usage: %s\n", usage_message);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		error = MB_ERROR_BAD_USAGE;
-		exit(error);
-		}
-
-	/* print starting message */
-	if (verbose == 1 || help)
-		{
-		fprintf(stderr,"\nProgram %s\n",program_name);
-		fprintf(stderr,"Source File Version %s\n",version_id);
-		fprintf(stderr,"MB-system Version %s\n",MB_VERSION);
-		}
-
-	/* print starting debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  Program <%s>\n",program_name);
-		fprintf(stderr,"dbg2  Version %s\n",version_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Control Parameters:\n");
-		fprintf(stderr,"dbg2       verbose:                    %d\n",verbose);
-		fprintf(stderr,"dbg2       help:                       %d\n",help);
-		fprintf(stderr,"dbg2       project_inputbase_set:      %d\n",project_inputbase_set);
-		fprintf(stderr,"dbg2       project_inputbase_path:     %s\n",project_inputbase_path);
-		fprintf(stderr,"dbg2       project_inputadd_set:       %d\n",project_inputadd_set);
-		fprintf(stderr,"dbg2       project_inputadd_path:      %s\n",project_inputadd_path);
-		fprintf(stderr,"dbg2       project_output_set:         %d\n",project_output_set);
-		fprintf(stderr,"dbg2       project_output_path:        %s\n",project_output_path);
-		fprintf(stderr,"dbg2       num_mods:                   %d\n",num_mods);
-		for (i=0;i<num_mods;i++)
-			{
-			fprintf(stderr,"dbg2       mods[%d]: %d  %d %d %d   %d %d %d  %f %f %f  %f %f %f\n",
-				i, mods[i].mode,
-				mods[i].survey1, mods[i].file1, mods[i].section1,
-				mods[i].survey1, mods[i].file1, mods[i].section1,
-				mods[i].xoffset, mods[i].yoffset, mods[i].zoffset,
-				mods[i].xsigma, mods[i].ysigma, mods[i].zsigma);
-			}
-		}
-
-	/* if help desired then print it and exit */
-	if (help)
-		{
-		fprintf(stderr,"\n%s\n",help_message);
-		fprintf(stderr,"\nusage: %s\n", usage_message);
-		exit(error);
-		}
-		
-	/* figure out mbnavadjust project merge mode */
-	if (project_inputbase_set == MB_NO)
-		{
-		fprintf(stderr,"No input base project has been set.\n");
-		fprintf(stderr,"\nProgram <%s> Terminated\n", program_name);
-		error = MB_ERROR_BAD_USAGE;
-		exit(error);
-		}
-	else if (project_inputbase_set == MB_YES
-		&& project_inputadd_set == MB_NO
-		&& project_output_set == MB_NO)
-		{
-		strcpy(project_output_path, project_inputbase_path);
-		project_output_set = MB_YES;
-		mbnavadjustmerge_mode = MBNAVADJUSTMERGE_MODE_MODIFY;
-		}
-	else if (project_inputbase_set == MB_YES
-		&& project_inputadd_set == MB_NO
-		&& project_output_set == MB_YES)
-		{
-		project_output_set = MB_YES;
-		mbnavadjustmerge_mode = MBNAVADJUSTMERGE_MODE_COPY;
-		}
-	else if (project_inputbase_set == MB_YES
-		&& project_inputadd_set == MB_YES
-		&& project_output_set == MB_NO)
-		{
-		strcpy(project_output_path, project_inputbase_path);
-		project_output_set = MB_YES;
-		mbnavadjustmerge_mode = MBNAVADJUSTMERGE_MODE_ADD;
-		}
-	else if (project_inputbase_set == MB_YES
-		&& project_inputadd_set == MB_YES
-		&& project_output_set == MB_YES
-		&& strcmp(project_output_path, project_inputadd_path) == 0)
-		{
-		fprintf(stderr,"The output project:\n\t%s\nis identical to the input add project:\n\t%s\n",
-			project_output_path, project_inputadd_path);
-		fprintf(stderr,"The output project must either be the input base project or a new project.\n");
-		fprintf(stderr,"\nProgram <%s> Terminated\n", program_name);
-		error = MB_ERROR_BAD_USAGE;
-		exit(error);
-		}
-	else if (project_inputbase_set == MB_YES
-		&& project_inputadd_set == MB_YES
-		&& project_output_set == MB_YES
-		&& strcmp(project_output_path, project_inputbase_path) == 0)
-		{
-		mbnavadjustmerge_mode = MBNAVADJUSTMERGE_MODE_ADD;
-		}
-	else if (project_inputbase_set == MB_YES
-		&& project_inputadd_set == MB_YES
-		&& project_output_set == MB_YES)
-		{
-		mbnavadjustmerge_mode = MBNAVADJUSTMERGE_MODE_MERGE;
-		}
-		
-	/* initialize the project structures */
-	memset(&project_inputbase, sizeof(struct mbna_project), 0);
-	memset(&project_inputadd, sizeof(struct mbna_project), 0);
-	memset(&project_output, sizeof(struct mbna_project), 0);
-		
-	/* if merging two projects then read the first, create new output project */
-	if (mbnavadjustmerge_mode == MBNAVADJUSTMERGE_MODE_MERGE
-		|| mbnavadjustmerge_mode == MBNAVADJUSTMERGE_MODE_COPY)
-		{
-		/* read the input base project */
-		status = mbnavadjust_read_project(verbose, project_inputbase_path,
-					&project_inputbase, &error);
-		if (status == MB_SUCCESS)
-			{
-			fprintf(stderr,"\nInput base project loaded:\n\t%s\n", project_inputbase_path);
-			fprintf(stderr,"\t%d files\n\t%d crossings\n\t%d ties\n",
-				project_inputbase.num_files, project_inputbase.num_crossings, project_inputbase.num_ties);
-			}
-		else
-			{
-			fprintf(stderr,"Load failure for input base project:\n\t%s\n",
-				project_inputbase_path);
-			fprintf(stderr,"\nProgram <%s> Terminated\n", program_name);
-			error = MB_ERROR_BAD_USAGE;
-			exit(error);
-			}
-
-		status = mbnavadjust_new_project(verbose, project_output_path,
-						project_inputbase.section_length,
-                        			project_inputbase.section_soundings,
-                        			project_inputbase.cont_int,
-                        			project_inputbase.col_int,
-                        			project_inputbase.tick_int,
-                        			project_inputbase.label_int,
-                        			project_inputbase.decimation,
-                        			project_inputbase.smoothing,
-                        			project_inputbase.zoffsetwidth,
-						&project_output, &error);
-		if (status == MB_SUCCESS)
-			{
-			fprintf(stderr,"\nOutput project created:\n\t%s\n", project_output_path);
-			}
-		else
-			{
-			fprintf(stderr,"Creation failure for output project:\n\t%s\n",
-				project_output_path);
-			fprintf(stderr,"\nProgram <%s> Terminated\n", program_name);
-			error = MB_ERROR_BAD_USAGE;
-			exit(error);
-			}
-		
-		/* copy the input base project to the output project */
-		//project_output.open = project_inputbase.open;
-		//strcpy(project_output.name, project_inputbase.name);
-		//strcpy(project_output.path, project_inputbase.path);
-		//strcpy(project_output.home, project_inputbase.home);
-		//strcpy(project_output.datadir, project_inputbase.datadir);
-		//strcpy(project_output.logfile, project_inputbase.logfile);
-		project_output.num_files = project_inputbase.num_files;
-		project_output.num_files_alloc = 0;
-		project_output.files = NULL;
-		project_output.num_blocks = project_inputbase.num_blocks;
-		project_output.num_snavs = project_inputbase.num_snavs;
-		project_output.num_pings = project_inputbase.num_pings;
-		project_output.num_beams = project_inputbase.num_beams;
-		project_output.num_crossings = project_inputbase.num_crossings;
-		project_output.num_crossings_alloc = 0;
-		project_output.num_crossings_analyzed = project_inputbase.num_crossings_analyzed;
-		project_output.num_goodcrossings = project_inputbase.num_goodcrossings;
-		project_output.num_truecrossings = project_inputbase.num_truecrossings;
-		project_output.num_truecrossings_analyzed = project_inputbase.num_truecrossings_analyzed;
-		project_output.crossings = NULL;
-		project_output.num_ties = project_inputbase.num_ties;
-		project_output.section_length = project_inputbase.section_length;
-		project_output.section_soundings = project_inputbase.section_soundings;
-		project_output.cont_int = project_inputbase.cont_int;
-		project_output.col_int = project_inputbase.col_int;
-		project_output.tick_int = project_inputbase.tick_int;
-		project_output.label_int = project_inputbase.label_int;
-		project_output.decimation = project_inputbase.decimation;
-		project_output.precision = project_inputbase.precision;
-		project_output.smoothing = project_inputbase.smoothing;
-		project_output.zoffsetwidth = project_inputbase.zoffsetwidth;
-		//project_output.inversion = project_inputbase.inversion;
-		//project_output.modelplot = project_inputbase.modelplot;
-		//project_output.modelplot_style = project_inputbase.modelplot_style;
-		//project_output.logfp;
-		
-		/* allocate and copy the files */
-		if (project_output.num_files > 0)
-			{
-			status = mb_mallocd(verbose, __FILE__, __LINE__,
-						sizeof(struct mbna_file) * (project_output.num_files),
-						(void **)&project_output.files,&error);
-			if (status == MB_SUCCESS && project_output.files != NULL)
-				{
-				/* copy the file data */
-				project_output.num_files_alloc = project_output.num_files;
-				memcpy(project_output.files, project_inputbase.files,
-				       project_output.num_files * sizeof(struct mbna_file));
-		
-				/* copy the sections in the files */
-				for (i=0;i<project_output.num_files && status == MB_SUCCESS;i++)
-					{
-					/* allocate and then copy the sections in this file */
-					project_output.files[i].sections = NULL;
-					if (project_output.files[i].num_sections > 0)
-						{
-						status = mb_mallocd(verbose, __FILE__, __LINE__,
-								sizeof(struct mbna_section) * (project_output.files[i].num_sections),
-								(void **)&project_output.files[i].sections, &error);
-						if (status == MB_SUCCESS && project_output.files[i].sections != NULL)
-							{
-							project_output.files[i].num_sections_alloc = project_output.files[i].num_sections;
-							memcpy(project_output.files[i].sections, project_inputbase.files[i].sections,
-							       project_output.files[i].num_sections * sizeof(struct mbna_section));
-							}
-						}
-					}
-				}
-			else
-				{
-				project_output.num_files_alloc = 0;
-				status = MB_FAILURE;
-				error = MB_ERROR_MEMORY_FAIL;
-				}
-			}
-                if (status == MB_FAILURE){fprintf(stderr,"Die at line:%d file:%s\n",__LINE__,__FILE__);exit(0);}
-			
-		/* allocate and copy the crossings */
-		if (project_output.num_crossings > 0)
-			{
-			status = mb_mallocd(verbose, __FILE__, __LINE__,
-						sizeof(struct mbna_crossing) * (project_output.num_crossings),
-						(void **)&project_output.crossings,&error);
-			if (status == MB_SUCCESS && project_output.crossings != NULL)
-				{
-				project_output.num_crossings_alloc = project_output.num_crossings;
-				memcpy(project_output.crossings, project_inputbase.crossings,
-				       project_output.num_crossings * sizeof(struct mbna_crossing));
-				}
-			else
-				{
-				project_output.num_crossings_alloc = 0;
-				status = MB_FAILURE;
-				error = MB_ERROR_MEMORY_FAIL;
-				}
-			}
-                if (status == MB_FAILURE){fprintf(stderr,"Die at line:%d file:%s\n",__LINE__,__FILE__);exit(0);}
-		
-		/* now concatenate the log.txt from the input project with the log.txt for the new output project */
-		sprintf(command,"mv %s/log.txt %s/logorg.txt", project_output.datadir, project_output.datadir);
-		//fprintf(stderr, "Executing in shell: %s\n", command);
-		shellstatus = system(command);
-		sprintf(command,"cat %s/log.txt %s/logorg.txt > %s/log.txt",
-			project_inputbase.datadir, project_output.datadir, project_output.datadir);
-		//fprintf(stderr, "Executing in shell: %s\n", command);
-		shellstatus = system(command);
-		
-		/* now fix the data file paths to be relative to the new project location */
-		for (i=0;i<project_output.num_files;i++)
-			{
-			strcpy(project_output.files[i].file, project_output.files[i].path);
-			status = mb_get_relative_path(verbose, project_output.files[i].file, project_output.path, &error);
-			}		
-		
-		/* now copy the actual data files from the input project to the new output project */
-		for (i=0;i<project_output.num_files;i++)
-			{
-			/* copy the file navigation */
-			sprintf(command,"cp %s/nvs_%4.4d.mb166 %s", project_inputbase.datadir, i, project_output.datadir);
-			//fprintf(stderr, "Executing in shell: %s\n", command);
-			shellstatus = system(command);
-				
-			/* copy all the section files */
-			for (j=0;j<project_output.files[i].num_sections;j++)
-				{
-				/* copy the section file */
-				sprintf(command,"cp %s/nvs_%4.4d_%4.4d.mb71 %s", project_inputbase.datadir, i, j, project_output.datadir);
-				//fprintf(stderr, "Executing in shell: %s\n", command);
-				shellstatus = system(command);
-				}
-			}		
-		fprintf(stderr,"\nCopied input base project to output project:\n\t%s\n", project_output_path);
-		fprintf(stderr,"\t%d files\n\t%d crossings\n\t%d ties\n",
-			project_output.num_files, project_output.num_crossings, project_output.num_ties);
-		}
-		
-	/* else if adding the second project to the first, or just modifying the first,
-		open the first as the output project */
-	else if (mbnavadjustmerge_mode == MBNAVADJUSTMERGE_MODE_ADD
-			|| mbnavadjustmerge_mode == MBNAVADJUSTMERGE_MODE_MODIFY)
-		{
-		/* read the input base project in as the output project */
-		status = mbnavadjust_read_project(verbose, project_output_path,
-					&project_output, &error);
-		if (status == MB_SUCCESS)
-			{
-			fprintf(stderr,"\nInput base project loaded as output:\n\t%s\n", project_output_path);
-			fprintf(stderr,"\t%d files\n\t%d crossings\n\t%d ties\n",
-				project_output.num_files, project_output.num_crossings, project_output.num_ties);
-			}
-		else
-			{
-			fprintf(stderr,"Load failure for input base project (which is also the intended output):\n\t%s\n",
-				project_output_path);
-			fprintf(stderr,"\nProgram <%s> Terminated\n", program_name);
-			error = MB_ERROR_BAD_USAGE;
-			exit(error);
-			}
-		}
-
-	/* if adding or merging projects read the input add project
-		then add the input add project to the output project */
-	if (mbnavadjustmerge_mode == MBNAVADJUSTMERGE_MODE_ADD
-			|| mbnavadjustmerge_mode == MBNAVADJUSTMERGE_MODE_MERGE)
-		{
-		status = mbnavadjust_read_project(verbose, project_inputadd_path,
-					&project_inputadd, &error);
-		if (status == MB_SUCCESS)
-			{
-			fprintf(stderr,"Input add project loaded:\n\t%s\n", project_inputadd_path);
-			fprintf(stderr,"\t%d files\n\t%d crossings\n\t%d ties\n",
-				project_inputadd.num_files, project_inputadd.num_crossings, project_inputadd.num_ties);
-			}
-		else
-			{
-			fprintf(stderr,"Load failure for input add project:\n\t%s\n",
-				project_inputadd_path);
-			fprintf(stderr,"\nProgram <%s> Terminated\n", program_name);
-			error = MB_ERROR_BAD_USAGE;
-			exit(error);
-			}
-
-		/* allocate space for additional files */
-		if (project_inputadd.num_files > 0)
-			{
-			/* allocate space for the files in project_inputadd */
-			status = mb_reallocd(verbose, __FILE__, __LINE__,
-						sizeof(struct mbna_file) * (project_output.num_files + project_inputadd.num_files),
-							(void **)&project_output.files,&error);
-			if (status == MB_FAILURE){fprintf(stderr,"Die at line:%d file:%s\n",__LINE__,__FILE__);exit(0);}
-			}
-	
-		/* copy the file data from project_inputadd to project_output */
-		project_output.num_files_alloc = project_output.num_files + project_inputadd.num_files;
-		memcpy(&project_output.files[project_output.num_files], project_inputadd.files,
-		       project_inputadd.num_files * sizeof(struct mbna_file));
-	
-		/* copy the sections in the files */
-		for (i=0;i<project_inputadd.num_files && status == MB_SUCCESS;i++)
-			{
-			j = project_output.num_files + i;
-			project_output.files[j].id += project_output.num_files;
-			project_output.files[j].block += project_output.num_blocks;
-			
-			/* allocate and then copy the sections in this file */
-			project_output.files[j].sections = NULL;
-			if (project_output.files[j].num_sections > 0)
-				{
-				status = mb_mallocd(verbose, __FILE__, __LINE__,
-						sizeof(struct mbna_section) * (project_output.files[j].num_sections),
-						(void **)&project_output.files[j].sections, &error);
-				if (status == MB_FAILURE){fprintf(stderr,"Die at line:%d file:%s\n",__LINE__,__FILE__);exit(0);}
-				if (project_output.files[j].sections != NULL)
-					{
-					project_output.files[j].num_sections_alloc = project_output.files[j].num_sections;
-					memcpy(project_output.files[j].sections, project_inputadd.files[i].sections,
-					       project_output.files[j].num_sections * sizeof(struct mbna_section));
-					}
-				}
-			for (k=0;k<project_output.files[j].num_sections;k++)
-				{
-				project_output.files[j].sections[k].global_start_ping += project_output.num_pings;
-				project_output.files[j].sections[k].global_start_snav += project_output.num_snavs;
-				}
-			}
-			
-		/* allocate and copy the crossings */
-		if (project_inputadd.num_crossings > 0)
-			{
-			status = mb_reallocd(verbose, __FILE__, __LINE__,
-						sizeof(struct mbna_crossing) * (project_output.num_crossings + project_inputadd.num_crossings),
-						(void **)&project_output.crossings,&error);
-			if (status == MB_FAILURE){fprintf(stderr,"Die at line:%d file:%s\n",__LINE__,__FILE__);exit(0);}
-			if (project_output.crossings != NULL)
-				{
-				project_output.num_crossings_alloc = project_output.num_crossings + project_inputadd.num_crossings;
-				memcpy(&project_output.crossings[project_output.num_crossings], project_inputadd.crossings,
-				       project_inputadd.num_crossings * sizeof(struct mbna_crossing));
-				}
-			else
-				{
-				project_output.num_crossings_alloc = 0;
-				status = MB_FAILURE;
-				error = MB_ERROR_MEMORY_FAIL;
-				}
-			for (i=0;i<project_inputadd.num_crossings;i++)
-				{
-				j = project_output.num_crossings + i;
-				project_output.crossings[j].file_id_1 = project_inputadd.crossings[i].file_id_1 + project_output.num_files;
-				project_output.crossings[j].file_id_2 = project_inputadd.crossings[i].file_id_2 + project_output.num_files;
-				for (k=0;k<project_output.crossings[j].num_ties;k++)
-					{
-					project_output.crossings[j].ties[k].block_1 += project_output.num_blocks;
-					project_output.crossings[j].ties[k].block_2 += project_output.num_blocks;
-					}
-				}
-			}
-		if (status == MB_FAILURE){fprintf(stderr,"Die at line:%d file:%s\n",__LINE__,__FILE__);exit(0);}
-		
-		/* now concatenate the log.txt from the inputadd project with the log.txt for the new output project */
-		sprintf(command,"cat %s/log.txt %s/logorg.txt > %s/log.txt",
-			project_inputadd.datadir, project_output.datadir, project_output.datadir);
-		//fprintf(stderr, "Executing in shell: %s\n", command);
-		shellstatus = system(command);
-		
-		/* now fix the data file paths to be relative to the new project location */
-		for (i=0;i<project_inputadd.num_files;i++)
-			{
-			k = project_output.num_files + i;
-			strcpy(project_output.files[k].file, project_output.files[k].path);
-			status = mb_get_relative_path(verbose, project_output.files[k].file, project_output.path, &error);
-			}		
-		
-		/* now copy the actual data files from the input project to the new output project */
-		for (i=0;i<project_inputadd.num_files;i++)
-			{
-			k = project_output.num_files + i;
-
-			/* copy the file navigation */
-			sprintf(command,"cp %s/nvs_%4.4d.mb166 %s/nvs_%4.4d.mb166", project_inputadd.datadir, i, project_output.datadir, k);
-			//fprintf(stderr, "Executing in shell: %s\n", command);
-			shellstatus = system(command);
-				
-			/* copy all the section files */
-			for (j=0;j<project_inputadd.files[i].num_sections;j++)
-				{
-				/* copy the section file */
-				sprintf(command,"cp %s/nvs_%4.4d_%4.4d.mb71 %s/nvs_%4.4d_%4.4d.mb71", project_inputadd.datadir, i, j, project_output.datadir, k, j);
-				//fprintf(stderr, "Executing in shell: %s\n", command);
-				shellstatus = system(command);
-				}
-			}		
-		fprintf(stderr,"\nCopied input add project to output project:\n\t%s\n", project_output_path);
-		fprintf(stderr,"\t%d files\n\t%d crossings\n\t%d ties\n",
-			project_output.num_files, project_output.num_crossings, project_output.num_ties);
-	
-		/* finally update all of the global counters */
-		project_output.num_files += project_inputadd.num_files;
-		project_output.num_blocks += project_inputadd.num_blocks;
-		project_output.num_snavs += project_inputadd.num_snavs;
-		project_output.num_pings += project_inputadd.num_pings;
-		project_output.num_beams += project_inputadd.num_beams;
-		project_output.num_crossings += project_inputadd.num_crossings;
-		project_output.num_crossings_analyzed += project_inputadd.num_crossings_analyzed;
-		project_output.num_goodcrossings += project_inputadd.num_goodcrossings;
-		project_output.num_truecrossings += project_inputadd.num_truecrossings;
-		project_output.num_truecrossings_analyzed += project_inputadd.num_truecrossings_analyzed;
-		project_output.num_ties += project_inputadd.num_ties;
-		}
-			
-	/* apply any specified changes to the output project */
-	for (imod=0;imod<num_mods;imod++)
-		{
-		switch (mods[imod].mode)
-			{
-			case MOD_MODE_SET_GLOBAL_TIE:
-fprintf(stderr,"\nCommand set-global-tie=%4.4d:%4.4d:%4.4d/%.3f/%.3f/%.3f/%.3f/%.3f/%.3f\n",
-mods[imod].file1,mods[imod].section1,mods[imod].snav2,
-mods[imod].xoffset,mods[imod].yoffset,mods[imod].zoffset,
-mods[imod].xsigma,mods[imod].ysigma,mods[imod].zsigma);
-
-				
-				/* if this file, section, and snav exists apply the global tie as XYZ
-					if the file and section exist but the snav does not then
-					unset the global tie */
-				if (mods[imod].file1 >= 0 && mods[imod].file1 < project_output.num_files)
-					{
-					file1 = (struct mbna_file *) &project_output.files[mods[imod].file1];
-					if (mods[imod].section1 >= 0 && mods[imod].section1 < file1->num_sections)
-						{
-						section1 = (struct mbna_section *) &file1->sections[mods[imod].section1];
-						mb_coor_scale(verbose,0.5 * (section1->latmin + section1->latmax),
-								&mtodeglon,&mtodeglat);
-						if (mods[imod].snav1 >= 0 && mods[imod].snav1 < section1->num_snav)
-							{
-							section1->global_tie_status = MBNA_TIE_XYZ;
-							section1->global_tie_snav = mods[imod].snav1;
-							section1->global_tie_offset_x = mods[imod].xoffset * mtodeglon;
-							section1->global_tie_offset_y = mods[imod].yoffset * mtodeglat;
-							section1->global_tie_offset_x_m = mods[imod].xoffset;
-							section1->global_tie_offset_y_m = mods[imod].yoffset;
-							section1->global_tie_offset_z_m = mods[imod].zoffset;
-							section1->global_tie_xsigma = mods[imod].xsigma;
-							section1->global_tie_ysigma = mods[imod].ysigma;
-							section1->global_tie_zsigma = mods[imod].zsigma;
-							}
-						else
-							{
-							section1->global_tie_status = MBNA_TIE_NONE;
-							section1->global_tie_snav = MBNA_SELECT_NONE;
-							section1->global_tie_offset_x = 0.0;
-							section1->global_tie_offset_y = 0.0;;
-							section1->global_tie_offset_x_m = 0.0;
-							section1->global_tie_offset_y_m = 0.0;;
-							section1->global_tie_offset_z_m = 0.0;;
-							section1->global_tie_xsigma = 0.0;;
-							section1->global_tie_ysigma = 0.0;;
-							section1->global_tie_zsigma = 0.0;;
-							}
-						}
-					}
-				break;
-				
-			case MOD_MODE_SET_GLOBAL_TIE_XYZ:
-fprintf(stderr,"\nCommand set-global-tie-xyz=%4.4d:%4.4d:%4.4d\n",
-mods[imod].file1,mods[imod].section1,mods[imod].snav2);
-
-				
-				/* if this file, section, and snav exists apply the global tie as XYZ
-					if the file and section exist but the snav does not then
-					unset the global tie */
-				if (mods[imod].file1 >= 0 && mods[imod].file1 < project_output.num_files)
-					{
-					file1 = (struct mbna_file *) &project_output.files[mods[imod].file1];
-					if (mods[imod].section1 >= 0 && mods[imod].section1 < file1->num_sections)
-						{
-						section1 = (struct mbna_section *) &file1->sections[mods[imod].section1];
-						if (mods[imod].snav1 >= 0 && mods[imod].snav1 < section1->num_snav)
-							{
-							section1->global_tie_status = MBNA_TIE_XYZ;
-							section1->global_tie_snav = mods[imod].snav1;
-							}
-						else
-							{
-							section1->global_tie_status = MBNA_TIE_NONE;
-							section1->global_tie_snav = MBNA_SELECT_NONE;
-							}
-						}
-					}
-				break;
-				
-			case MOD_MODE_SET_GLOBAL_TIE_XY:
-fprintf(stderr,"\nCommand set-global-tie-xyonly=%4.4d:%4.4d:%4.4d\n",
-mods[imod].file1,mods[imod].section1,mods[imod].snav2);
-
-				
-				/* if this file, section, and snav exists apply the global tie as XY-only
-					if the file and section exist but the snav does not then
-					unset the global tie */
-				if (mods[imod].file1 >= 0 && mods[imod].file1 < project_output.num_files)
-					{
-					file1 = (struct mbna_file *) &project_output.files[mods[imod].file1];
-					if (mods[imod].section1 >= 0 && mods[imod].section1 < file1->num_sections)
-						{
-						section1 = (struct mbna_section *) &file1->sections[mods[imod].section1];
-						if (mods[imod].snav1 >= 0 && mods[imod].snav1 < section1->num_snav)
-							{
-							section1->global_tie_status = MBNA_TIE_XY;
-							section1->global_tie_snav = mods[imod].snav1;
-							}
-						else
-							{
-							section1->global_tie_status = MBNA_TIE_NONE;
-							section1->global_tie_snav = MBNA_SELECT_NONE;
-							}
-						}
-					}
-				break;
-				
-			case MOD_MODE_SET_GLOBAL_TIE_Z:
-fprintf(stderr,"\nCommand set-global-tie-zonly=%4.4d:%4.4d:%4.4d\n",
-mods[imod].file1,mods[imod].section1,mods[imod].snav2);
-
-				
-				/* if this file, section, and snav exists apply the global tie as Z-only
-					if the file and section exist but the snav does not then
-					unset the global tie */
-				if (mods[imod].file1 >= 0 && mods[imod].file1 < project_output.num_files)
-					{
-					file1 = (struct mbna_file *) &project_output.files[mods[imod].file1];
-					if (mods[imod].section1 >= 0 && mods[imod].section1 < file1->num_sections)
-						{
-						section1 = (struct mbna_section *) &file1->sections[mods[imod].section1];
-						if (mods[imod].snav1 >= 0 && mods[imod].snav1 < section1->num_snav)
-							{
-							section1->global_tie_status = MBNA_TIE_Z;
-							section1->global_tie_snav = mods[imod].snav1;
-							}
-						else
-							{
-							section1->global_tie_status = MBNA_TIE_NONE;
-							section1->global_tie_snav = MBNA_SELECT_NONE;
-							}
-						}
-					}
-				break;
-				
-			case MOD_MODE_UNSET_GLOBAL_TIE:
-fprintf(stderr,"\nCommand unset-global-tie=%4.4d:%4.4d\n",
-mods[imod].file1,mods[imod].section1);
-
-				
-				/* if this file and section exists unset the global tie */
-				if (mods[imod].file1 >= 0 && mods[imod].file1 < project_output.num_files)
-					{
-					file1 = (struct mbna_file *) &project_output.files[mods[imod].file1];
-					if (mods[imod].section1 >= 0 && mods[imod].section1 < file1->num_sections)
-						{
-						section1 = (struct mbna_section *) &file1->sections[mods[imod].section1];
-						section1->global_tie_status = MBNA_TIE_NONE;
-						}
-					}
-				break;
-				
-			case MOD_MODE_ADD_CROSSING:
-fprintf(stderr,"\nCommand add-crossing=%4.4d:%4.4d/%4.4d:%4.4d\n",mods[imod].file1,mods[imod].section1,mods[imod].file2,mods[imod].section2);
-				
-				/* check to see if this crossing already exists */
-				found = MB_NO;
-				for (icrossing=0;icrossing<project_output.num_crossings && found == MB_NO;icrossing++)
-					{
-					crossing = &(project_output.crossings[icrossing]);
-					if (crossing->file_id_2 == mods[imod].file1 && crossing->file_id_1 == mods[imod].file2
-						&& crossing->section_2 == mods[imod].section1 && crossing->section_1 == mods[imod].section2)
-						{
-						found = MB_YES;
-						}
-					else if (crossing->file_id_1 == mods[imod].file1 && crossing->file_id_2 == mods[imod].file2
-						&& crossing->section_1 == mods[imod].section1 && crossing->section_2 == mods[imod].section2)
-						{
-						found = MB_YES;
-						}
-					}
-					
-				/* if the crossing does not exist, create it */
-				if (found == MB_NO)
-					{
-					/* allocate mbna_crossing array if needed */
-					if (project_output.num_crossings_alloc <= project_output.num_crossings)
-					    {
-					    project_output.crossings = (struct mbna_crossing *) realloc(project_output.crossings,
-							    sizeof(struct mbna_crossing) * (project_output.num_crossings_alloc + ALLOC_NUM));
-					    if (project_output.crossings != NULL)
-						    project_output.num_crossings_alloc += ALLOC_NUM;
-					    else
-						{
-						status = MB_FAILURE;
-						error = MB_ERROR_MEMORY_FAIL;
-						}
-					    }
-	
-					/* add crossing to list */
-					crossing = (struct mbna_crossing *) &project_output.crossings[project_output.num_crossings];
-					file1 = (struct mbna_file *) &project_output.files[crossing->file_id_1];
-					file2 = (struct mbna_file *) &project_output.files[crossing->file_id_2];
-					crossing->status = MBNA_CROSSING_STATUS_NONE;
-					crossing->truecrossing = MB_NO;
-					crossing->overlap = 0;
-					crossing->file_id_1 = mods[imod].file1;
-					crossing->section_1 = mods[imod].section1;
-					crossing->file_id_2 = mods[imod].file2;
-					crossing->section_2 = mods[imod].section2;
-					crossing->num_ties = 0;
-					current_crossing = project_output.num_crossings;
-					project_output.num_crossings++;
-
-fprintf(stderr,"Added crossing: %d  %2.2d:%4.4d:%4.4d   %2.2d:%4.4d:%4.4d\n",
-current_crossing,
-file1->block, crossing->file_id_1, crossing->section_1,
-file2->block, crossing->file_id_2, crossing->section_2);
-					}
-				break;
-			
-			case MOD_MODE_SET_TIE:
-fprintf(stderr,"\nCommand set-tie=%4.4d:%4.4d/%4.4d:%4.4d/%.3f/%.3f/%.3f/%.3f/%.3f/%.3f\n",
-mods[imod].file1,mods[imod].section1,mods[imod].file2,mods[imod].section2,
-mods[imod].xoffset,mods[imod].yoffset,mods[imod].zoffset,
-mods[imod].xsigma,mods[imod].ysigma,mods[imod].zsigma);
-				
-				/* check to see if this crossing already exists */
-				found = MB_NO;
-				for (icrossing=0;icrossing<project_output.num_crossings && found == MB_NO;icrossing++)
-					{
-					crossing = &(project_output.crossings[icrossing]);
-					if (crossing->file_id_2 == mods[imod].file1 && crossing->file_id_1 == mods[imod].file2
-						&& crossing->section_2 == mods[imod].section1 && crossing->section_1 == mods[imod].section2)
-						{
-						found = MB_YES;
-						current_crossing = icrossing;
-						crossing = (struct mbna_crossing *) &project_output.crossings[icrossing];
-						}
-					else if (crossing->file_id_1 == mods[imod].file1 && crossing->file_id_2 == mods[imod].file2
-						&& crossing->section_1 == mods[imod].section1 && crossing->section_2 == mods[imod].section2)
-						{
-						found = MB_YES;
-						current_crossing = icrossing;
-						crossing = (struct mbna_crossing *) &project_output.crossings[icrossing];
-						}
-					}
-					
-				/* if the crossing does not exist, create it */
-				if (found == MB_NO)
-					{
-					/* allocate mbna_crossing array if needed */
-					if (project_output.num_crossings_alloc <= project_output.num_crossings)
-					    {
-					    project_output.crossings = (struct mbna_crossing *) realloc(project_output.crossings,
-							    sizeof(struct mbna_crossing) * (project_output.num_crossings_alloc + ALLOC_NUM));
-					    if (project_output.crossings != NULL)
-						    project_output.num_crossings_alloc += ALLOC_NUM;
-					    else
-						{
-						status = MB_FAILURE;
-						error = MB_ERROR_MEMORY_FAIL;
-						}
-					    }
-	
-					/* add crossing to list */
-					current_crossing = project_output.num_crossings;
-					crossing = (struct mbna_crossing *) &project_output.crossings[current_crossing];
-					file1 = (struct mbna_file *) &project_output.files[crossing->file_id_1];
-					file2 = (struct mbna_file *) &project_output.files[crossing->file_id_2];
-					crossing->status = MBNA_CROSSING_STATUS_NONE;
-					crossing->truecrossing = MB_NO;
-					crossing->overlap = 0;
-					crossing->file_id_1 = mods[imod].file1;
-					crossing->section_1 = mods[imod].section1;
-					crossing->file_id_2 = mods[imod].file2;
-					crossing->section_2 = mods[imod].section2;
-					crossing->num_ties = 0;
-					current_crossing = project_output.num_crossings;
-					project_output.num_crossings++;
-
-fprintf(stderr,"Added crossing: %d  %2.2d:%4.4d:%4.4d   %2.2d:%4.4d:%4.4d\n",
-current_crossing,
-file1->block, crossing->file_id_1, crossing->section_1,
-file2->block, crossing->file_id_2, crossing->section_2);
-					}
-				
-				/* if the tie does not exist, create it */
-				if (crossing->num_ties == 0)
-					{
-					/* add tie and set number */
-					file1 = (struct mbna_file *) &project_output.files[crossing->file_id_1];
-					file2 = (struct mbna_file *) &project_output.files[crossing->file_id_2];
-					section1 = (struct mbna_section *) &file1->sections[crossing->section_1];
-					section2 = (struct mbna_section *) &file2->sections[crossing->section_2];
-					crossing->num_ties++;
-					project_output.num_ties++;
-					tie = &crossing->ties[0];
-		
-					if (crossing->status == MBNA_CROSSING_STATUS_NONE)
-						{
-						project_output.num_crossings_analyzed++;
-						if (crossing->truecrossing == MB_YES)
-							project_output.num_truecrossings_analyzed++;
-						}
-					crossing->status = MBNA_CROSSING_STATUS_SET;
-		
-					/* use midpoint nav points */
-					tie->snav_1 = section1->num_snav / 2;
-					tie->snav_2 = section2->num_snav / 2;
-
-fprintf(stderr,"Added tie: %d:%d  %2.2d:%4.4d:%4.4d:%2.2d   %2.2d:%4.4d:%4.4d:%2.2d\n",
-current_crossing, 0,
-file1->block, crossing->file_id_1, crossing->section_1, tie->snav_1,
-file2->block, crossing->file_id_2, crossing->section_2, tie->snav_2);
-					}
-					
-				/* set the tie parameters */
-				for (itie=0;itie<crossing->num_ties;itie++)
-					{
-					tie = &crossing->ties[itie];
-					tie->status = MBNA_TIE_XYZ;
-					tie->snav_1_time_d = section1->snav_time_d[tie->snav_1];
-					tie->snav_2_time_d = section2->snav_time_d[tie->snav_2];
-					mb_coor_scale(verbose,0.25 * (section1->latmin + section1->latmax + section2->latmin + section2->latmax),
-							&mtodeglon,&mtodeglat);
-					tie->offset_x = mods[imod].xoffset * mtodeglon;
-					tie->offset_y = mods[imod].yoffset * mtodeglat;
-					tie->offset_x_m = mods[imod].xoffset;
-					tie->offset_y_m = mods[imod].yoffset;
-					tie->offset_z_m = mods[imod].zoffset;
-					tie->sigmar1 = mods[imod].xsigma;
-					tie->sigmax1[0] = 1.0;
-					tie->sigmax1[1] = 0.0;
-					tie->sigmax1[2] = 0.0;
-					tie->sigmar2 = mods[imod].ysigma;
-					tie->sigmax2[0] = 0.0;
-					tie->sigmax2[1] = 1.0;
-					tie->sigmax2[2] = 0.0;
-					tie->sigmar3 = mods[imod].zsigma;
-					tie->sigmax3[0] = 0.0;
-					tie->sigmax3[1] = 0.0;
-					tie->sigmax3[2] = 1.0;
-					tie->inversion_offset_x = section2->snav_lon_offset[tie->snav_2]
-								- section1->snav_lon_offset[tie->snav_1];
-					tie->inversion_offset_y = section2->snav_lat_offset[tie->snav_2]
-								- section1->snav_lat_offset[tie->snav_1];
-					tie->inversion_offset_x_m = tie->inversion_offset_x / mtodeglon;
-					tie->inversion_offset_y_m = tie->inversion_offset_y / mtodeglat;
-					tie->inversion_offset_z_m = section2->snav_z_offset[tie->snav_2]
-								- section1->snav_z_offset[tie->snav_1];
-					tie->inversion_status = MBNA_INVERSION_NONE;
-					if (project_output.inversion == MBNA_INVERSION_CURRENT)
-						project_output.inversion = MBNA_INVERSION_OLD;
-		
-					/* reset tie counts for snavs */
-					section1->snav_num_ties[tie->snav_1]++;
-					section2->snav_num_ties[tie->snav_2]++;
-
-fprintf(stderr,"Set tie offsets:       %d:%d  %2.2d:%4.4d:%4.4d:%2.2d   %2.2d:%4.4d:%4.4d:%2.2d  %.3f %.3f %.3f\n",
-current_crossing, itie,
-file1->block, crossing->file_id_1, crossing->section_1, tie->snav_1,
-file2->block, crossing->file_id_2, crossing->section_2, tie->snav_2,
-tie->offset_x_m,tie->offset_y_m,tie->offset_z_m);
-					}
-				
-				break;
-			
-			case MOD_MODE_SET_TIE_XYZ:
-fprintf(stderr,"\nCommand set-tie-xyz=%4.4d:%4.4d/%4.4d:%4.4d\n",
-mods[imod].file1,mods[imod].section1,mods[imod].file2,mods[imod].section2);
-				
-				/* check to see if this crossing already exists */
-				found = MB_NO;
-				for (icrossing=0;icrossing<project_output.num_crossings && found == MB_NO;icrossing++)
-					{
-					crossing = &(project_output.crossings[icrossing]);
-					file1 = (struct mbna_file *) &project_output.files[crossing->file_id_1];
-					file2 = (struct mbna_file *) &project_output.files[crossing->file_id_2];
-					if (crossing->file_id_2 == mods[imod].file1 && crossing->file_id_1 == mods[imod].file2
-						&& crossing->section_2 == mods[imod].section1 && crossing->section_1 == mods[imod].section2)
-						{
-						found = MB_YES;
-						current_crossing = icrossing;
-						crossing = (struct mbna_crossing *) &project_output.crossings[icrossing];
-						}
-					else if (crossing->file_id_1 == mods[imod].file1 && crossing->file_id_2 == mods[imod].file2
-						&& crossing->section_1 == mods[imod].section1 && crossing->section_2 == mods[imod].section2)
-						{
-						found = MB_YES;
-						current_crossing = icrossing;
-						crossing = (struct mbna_crossing *) &project_output.crossings[icrossing];
-						}
-					}
-					
-				/* set the tie parameters */
-				if (found == MB_YES)
-					{
-					for (itie=0;itie<crossing->num_ties;itie++)
-						{
-						tie = &crossing->ties[itie];
-						tie->status = MBNA_TIE_XYZ;
-
-fprintf(stderr,"Set tie mode XYZ:      %d:%d  %2.2d:%4.4d:%4.4d:%2.2d   %2.2d:%4.4d:%4.4d:%2.2d  %.3f %.3f %.3f\n",
-current_crossing, itie,
-file1->block, crossing->file_id_1, crossing->section_1, tie->snav_1,
-file2->block, crossing->file_id_2, crossing->section_2, tie->snav_2,
-tie->offset_x_m,tie->offset_y_m,tie->offset_z_m);
-						}
-					}
-					
-				break;
-			
-			case MOD_MODE_SET_TIE_XY:
-fprintf(stderr,"\nCommand set-tie-xy=%4.4d:%4.4d/%4.4d:%4.4d\n",
-mods[imod].file1,mods[imod].section1,mods[imod].file2,mods[imod].section2);
-				
-				/* check to see if this crossing already exists */
-				found = MB_NO;
-				for (icrossing=0;icrossing<project_output.num_crossings && found == MB_NO;icrossing++)
-					{
-					crossing = &(project_output.crossings[icrossing]);
-					file1 = (struct mbna_file *) &project_output.files[crossing->file_id_1];
-					file2 = (struct mbna_file *) &project_output.files[crossing->file_id_2];
-					if (crossing->file_id_2 == mods[imod].file1 && crossing->file_id_1 == mods[imod].file2
-						&& crossing->section_2 == mods[imod].section1 && crossing->section_1 == mods[imod].section2)
-						{
-						found = MB_YES;
-						current_crossing = icrossing;
-						crossing = (struct mbna_crossing *) &project_output.crossings[icrossing];
-						}
-					else if (crossing->file_id_1 == mods[imod].file1 && crossing->file_id_2 == mods[imod].file2
-						&& crossing->section_1 == mods[imod].section1 && crossing->section_2 == mods[imod].section2)
-						{
-						found = MB_YES;
-						current_crossing = icrossing;
-						crossing = (struct mbna_crossing *) &project_output.crossings[icrossing];
-						}
-					}
-					
-				/* set the tie parameters */
-				if (found == MB_YES)
-					{
-					for (itie=0;itie<crossing->num_ties;itie++)
-						{
-						tie = &crossing->ties[itie];
-						tie->status = MBNA_TIE_XY;
-
-fprintf(stderr,"Set tie mode XY-only:  %d:%d  %2.2d:%4.4d:%4.4d:%2.2d   %2.2d:%4.4d:%4.4d:%2.2d  %.3f %.3f %.3f\n",
-current_crossing, itie,
-file1->block, crossing->file_id_1, crossing->section_1, tie->snav_1,
-file2->block, crossing->file_id_2, crossing->section_2, tie->snav_2,
-tie->offset_x_m,tie->offset_y_m,tie->offset_z_m);
-						}
-					}
-					
-				break;
-			
-			case MOD_MODE_SET_TIE_Z:
-fprintf(stderr,"\nCommand set-tie-z=%4.4d:%4.4d/%4.4d:%4.4d\n",
-mods[imod].file1,mods[imod].section1,mods[imod].file2,mods[imod].section2);
-				
-				/* check to see if this crossing already exists */
-				found = MB_NO;
-				for (icrossing=0;icrossing<project_output.num_crossings && found == MB_NO;icrossing++)
-					{
-					crossing = &(project_output.crossings[icrossing]);
-					file1 = (struct mbna_file *) &project_output.files[crossing->file_id_1];
-					file2 = (struct mbna_file *) &project_output.files[crossing->file_id_2];
-					if (crossing->file_id_2 == mods[imod].file1 && crossing->file_id_1 == mods[imod].file2
-						&& crossing->section_2 == mods[imod].section1 && crossing->section_1 == mods[imod].section2)
-						{
-						found = MB_YES;
-						current_crossing = icrossing;
-						crossing = (struct mbna_crossing *) &project_output.crossings[icrossing];
-						}
-					else if (crossing->file_id_1 == mods[imod].file1 && crossing->file_id_2 == mods[imod].file2
-						&& crossing->section_1 == mods[imod].section1 && crossing->section_2 == mods[imod].section2)
-						{
-						found = MB_YES;
-						current_crossing = icrossing;
-						crossing = (struct mbna_crossing *) &project_output.crossings[icrossing];
-						}
-					}
-					
-				/* set the tie parameters */
-				if (found == MB_YES)
-					{
-					for (itie=0;itie<crossing->num_ties;itie++)
-						{
-						tie = &crossing->ties[itie];
-						tie->status = MBNA_TIE_Z;
-
-fprintf(stderr,"Set tie mode Z-only:   %d:%d  %2.2d:%4.4d:%4.4d:%2.2d   %2.2d:%4.4d:%4.4d:%2.2d  %.3f %.3f %.3f\n",
-current_crossing, itie,
-file1->block, crossing->file_id_1, crossing->section_1, tie->snav_1,
-file2->block, crossing->file_id_2, crossing->section_2, tie->snav_2,
-tie->offset_x_m,tie->offset_y_m,tie->offset_z_m);
-						}
-					}
-					
-				break;
-			
-			case MOD_MODE_UNSET_TIE:
-fprintf(stderr,"\nCommand unset-tie=%4.4d:%4.4d/%4.4d:%4.4d\n",
-mods[imod].file1,mods[imod].section1,mods[imod].file2,mods[imod].section2);
-				
-				/* check to see if this crossing already exists */
-				found = MB_NO;
-				for (icrossing=0;icrossing<project_output.num_crossings && found == MB_NO;icrossing++)
-					{
-					crossing = &(project_output.crossings[icrossing]);
-					file1 = (struct mbna_file *) &project_output.files[crossing->file_id_1];
-					file2 = (struct mbna_file *) &project_output.files[crossing->file_id_2];
-					if (crossing->file_id_2 == mods[imod].file1 && crossing->file_id_1 == mods[imod].file2
-						&& crossing->section_2 == mods[imod].section1 && crossing->section_1 == mods[imod].section2)
-						{
-						found = MB_YES;
-						current_crossing = icrossing;
-						}
-					else if (crossing->file_id_1 == mods[imod].file1 && crossing->file_id_2 == mods[imod].file2
-						&& crossing->section_1 == mods[imod].section1 && crossing->section_2 == mods[imod].section2)
-						{
-						found = MB_YES;
-						current_crossing = icrossing;
-						}
-					}
-					
-				/* unset the ties associated with this crossing */
-				if (found == MB_YES && crossing->num_ties > 0)
-					{
-					crossing->num_ties = 0;
-
-fprintf(stderr,"Unset tie:   %d  %2.2d:%4.4d:%4.4d   %2.2d:%4.4d:%4.4d\n",
-current_crossing,
-file1->block, crossing->file_id_1, crossing->section_1,
-file2->block, crossing->file_id_2, crossing->section_2);
-					}
-					
-				break;
-			
-			case MOD_MODE_SET_TIES_XYZ_FILE:
-fprintf(stderr,"\nCommand set-ties-xyz-with-file=%4.4d\n", mods[imod].file1);
-
-				/* loop over all crossings looking for ones with specified file, then set the tie modes */
-				for (icrossing=0;icrossing<project_output.num_crossings;icrossing++)
-					{
-					crossing = &(project_output.crossings[icrossing]);
-					file1 = (struct mbna_file *) &project_output.files[crossing->file_id_1];
-					file2 = (struct mbna_file *) &project_output.files[crossing->file_id_2];
-					if (crossing->file_id_1 == mods[imod].file1 || crossing->file_id_2 == mods[imod].file2)
-						{
-						for (itie=0;itie<crossing->num_ties;itie++)
-							{
-							tie = &crossing->ties[itie];
-							tie->status = MBNA_TIE_XYZ;
-
-fprintf(stderr,"Set tie mode XYZ:      %d:%d  %2.2d:%4.4d:%4.4d:%2.2d   %2.2d:%4.4d:%4.4d:%2.2d  %.3f %.3f %.3f\n",
-icrossing, itie,
-file1->block, crossing->file_id_1, crossing->section_1, tie->snav_1,
-file2->block, crossing->file_id_2, crossing->section_2, tie->snav_2,
-tie->offset_x_m,tie->offset_y_m,tie->offset_z_m);
-							}
-						}
-					}
-				break;
-			
-			case MOD_MODE_SET_TIES_XY_FILE:
-fprintf(stderr,"\nCommand set-ties-xy-with-file=%4.4d\n", mods[imod].file1);
-
-				/* loop over all crossings looking for ones with specified file, then set the tie modes */
-				for (icrossing=0;icrossing<project_output.num_crossings;icrossing++)
-					{
-					crossing = &(project_output.crossings[icrossing]);
-					file1 = (struct mbna_file *) &project_output.files[crossing->file_id_1];
-					file2 = (struct mbna_file *) &project_output.files[crossing->file_id_2];
-					if (crossing->file_id_1 == mods[imod].file1 || crossing->file_id_2 == mods[imod].file2)
-						{
-						for (itie=0;itie<crossing->num_ties;itie++)
-							{
-							tie = &crossing->ties[itie];
-							tie->status = MBNA_TIE_XY;
-
-fprintf(stderr,"Set tie mode XY-only:  %d:%d  %2.2d:%4.4d:%4.4d:%2.2d   %2.2d:%4.4d:%4.4d:%2.2d  %.3f %.3f %.3f\n",
-icrossing, itie,
-file1->block, crossing->file_id_1, crossing->section_1, tie->snav_1,
-file2->block, crossing->file_id_2, crossing->section_2, tie->snav_2,
-tie->offset_x_m,tie->offset_y_m,tie->offset_z_m);
-							}
-						}
-					}
-				break;
-			
-			case MOD_MODE_SET_TIES_Z_FILE:
-fprintf(stderr,"\nCommand set-ties-z-with-file=%4.4d\n", mods[imod].file1);
-
-				/* loop over all crossings looking for ones with specified file, then set the tie modes */
-				for (icrossing=0;icrossing<project_output.num_crossings;icrossing++)
-					{
-					crossing = &(project_output.crossings[icrossing]);
-					file1 = (struct mbna_file *) &project_output.files[crossing->file_id_1];
-					file2 = (struct mbna_file *) &project_output.files[crossing->file_id_2];
-					if (crossing->file_id_1 == mods[imod].file1 || crossing->file_id_2 == mods[imod].file2)
-						{
-						for (itie=0;itie<crossing->num_ties;itie++)
-							{
-							tie = &crossing->ties[itie];
-							tie->status = MBNA_TIE_Z;
-
-fprintf(stderr,"Set tie mode Z-only:   %d:%d  %2.2d:%4.4d:%4.4d:%2.2d   %2.2d:%4.4d:%4.4d:%2.2d  %.3f %.3f %.3f\n",
-icrossing, itie,
-file1->block, crossing->file_id_1, crossing->section_1, tie->snav_1,
-file2->block, crossing->file_id_2, crossing->section_2, tie->snav_2,
-tie->offset_x_m,tie->offset_y_m,tie->offset_z_m);
-							}
-						}
-					}
-				break;
-			
-			case MOD_MODE_SET_TIES_XYZ_SURVEY:
-fprintf(stderr,"\nCommand set-ties-xyz-with-survey=%2.2d\n", mods[imod].survey1);
-
-				/* loop over all crossings looking for ones with specified survey, then set the tie modes */
-				for (icrossing=0;icrossing<project_output.num_crossings;icrossing++)
-					{
-					crossing = &(project_output.crossings[icrossing]);
-					file1 = (struct mbna_file *) &project_output.files[crossing->file_id_1];
-					file2 = (struct mbna_file *) &project_output.files[crossing->file_id_2];
-					if (project_output.files[crossing->file_id_1].block == mods[imod].survey1
-						|| project_output.files[crossing->file_id_2].block == mods[imod].survey1)
-						{
-						for (itie=0;itie<crossing->num_ties;itie++)
-							{
-							tie = &crossing->ties[itie];
-							tie->status = MBNA_TIE_XYZ;
-
-fprintf(stderr,"Set tie mode XYZ:      %d:%d  %2.2d:%4.4d:%4.4d:%2.2d   %2.2d:%4.4d:%4.4d:%2.2d  %.3f %.3f %.3f\n",
-icrossing, itie,
-file1->block, crossing->file_id_1, crossing->section_1, tie->snav_1,
-file2->block, crossing->file_id_2, crossing->section_2, tie->snav_2,
-tie->offset_x_m,tie->offset_y_m,tie->offset_z_m);
-							}
-						}
-					}
-				break;
-			
-			case MOD_MODE_SET_TIES_XY_SURVEY:
-fprintf(stderr,"\nCommand set-ties-xy-with-survey=%2.2d\n", mods[imod].survey1);
-
-				/* loop over all crossings looking for ones with specified survey, then set the tie modes */
-				for (icrossing=0;icrossing<project_output.num_crossings;icrossing++)
-					{
-					crossing = &(project_output.crossings[icrossing]);
-					file1 = (struct mbna_file *) &project_output.files[crossing->file_id_1];
-					file2 = (struct mbna_file *) &project_output.files[crossing->file_id_2];
-					if (project_output.files[crossing->file_id_1].block == mods[imod].survey1
-						|| project_output.files[crossing->file_id_2].block == mods[imod].survey1)
-						{
-						for (itie=0;itie<crossing->num_ties;itie++)
-							{
-							tie = &crossing->ties[itie];
-							tie->status = MBNA_TIE_XY;
-
-fprintf(stderr,"Set tie mode XY-only:  %d:%d  %2.2d:%4.4d:%4.4d:%2.2d   %2.2d:%4.4d:%4.4d:%2.2d  %.3f %.3f %.3f\n",
-icrossing, itie,
-file1->block, crossing->file_id_1, crossing->section_1, tie->snav_1,
-file2->block, crossing->file_id_2, crossing->section_2, tie->snav_2,
-tie->offset_x_m,tie->offset_y_m,tie->offset_z_m);
-							}
-						}
-					}
-				break;
-			
-			case MOD_MODE_SET_TIES_Z_SURVEY:
-fprintf(stderr,"\nCommand set-ties-z-with-survey=%2.2d\n", mods[imod].survey1);
-
-				/* loop over all crossings looking for ones with specified survey, then set the tie modes */
-				for (icrossing=0;icrossing<project_output.num_crossings;icrossing++)
-					{
-					crossing = &(project_output.crossings[icrossing]);
-					file1 = (struct mbna_file *) &project_output.files[crossing->file_id_1];
-					file2 = (struct mbna_file *) &project_output.files[crossing->file_id_2];
-					if (project_output.files[crossing->file_id_1].block == mods[imod].survey1
-						|| project_output.files[crossing->file_id_2].block == mods[imod].survey1)
-						{
-						for (itie=0;itie<crossing->num_ties;itie++)
-							{
-							tie = &crossing->ties[itie];
-							tie->status = MBNA_TIE_Z;
-
-fprintf(stderr,"Set tie mode Z-only:   %d:%d  %2.2d:%4.4d:%4.4d:%2.2d   %2.2d:%4.4d:%4.4d:%2.2d  %.3f %.3f %.3f\n",
-icrossing, itie,
-file1->block, crossing->file_id_1, crossing->section_1, tie->snav_1,
-file2->block, crossing->file_id_2, crossing->section_2, tie->snav_2,
-tie->offset_x_m,tie->offset_y_m,tie->offset_z_m);
-							}
-						}
-					}
-				break;
-			
-			case MOD_MODE_SET_TIES_XYZ_BLOCK:
-fprintf(stderr,"\nCommand set-ties-xyz-by-block=%2.2d/%2.2d\n", mods[imod].survey1, mods[imod].survey2);
-
-				/* loop over all crossings looking for ones with specified surveys, then set the tie modes */
-				for (icrossing=0;icrossing<project_output.num_crossings;icrossing++)
-					{
-					crossing = &(project_output.crossings[icrossing]);
-					file1 = (struct mbna_file *) &project_output.files[crossing->file_id_1];
-					file2 = (struct mbna_file *) &project_output.files[crossing->file_id_2];
-					if ((project_output.files[crossing->file_id_1].block == mods[imod].survey1
-							&& project_output.files[crossing->file_id_2].block == mods[imod].survey2)
-						|| (project_output.files[crossing->file_id_2].block == mods[imod].survey1
-							&& project_output.files[crossing->file_id_1].block == mods[imod].survey2))
-						{
-						for (itie=0;itie<crossing->num_ties;itie++)
-							{
-							tie = &crossing->ties[itie];
-							tie->status = MBNA_TIE_XYZ;
-
-fprintf(stderr,"Set tie mode XYZ:      %d:%d  %2.2d:%4.4d:%4.4d:%2.2d   %2.2d:%4.4d:%4.4d:%2.2d  %.3f %.3f %.3f\n",
-icrossing, itie,
-file1->block, crossing->file_id_1, crossing->section_1, tie->snav_1,
-file2->block, crossing->file_id_2, crossing->section_2, tie->snav_2,
-tie->offset_x_m,tie->offset_y_m,tie->offset_z_m);
-							}
-						}
-					}
-				break;
-			
-			case MOD_MODE_SET_TIES_XY_BLOCK:
-fprintf(stderr,"\nCommand set-ties-xy-by-block=%2.2d/%2.2d\n", mods[imod].survey1, mods[imod].survey2);
-
-				for (icrossing=0;icrossing<project_output.num_crossings;icrossing++)
-					{
-					crossing = &(project_output.crossings[icrossing]);
-					file1 = (struct mbna_file *) &project_output.files[crossing->file_id_1];
-					file2 = (struct mbna_file *) &project_output.files[crossing->file_id_2];
-					if ((project_output.files[crossing->file_id_1].block == mods[imod].survey1
-							&& project_output.files[crossing->file_id_2].block == mods[imod].survey2)
-						|| (project_output.files[crossing->file_id_2].block == mods[imod].survey1
-							&& project_output.files[crossing->file_id_1].block == mods[imod].survey2))
-						{
-						for (itie=0;itie<crossing->num_ties;itie++)
-							{
-							tie = &crossing->ties[itie];
-							tie->status = MBNA_TIE_XY;
-
-fprintf(stderr,"Set tie mode XY-only:  %d:%d  %2.2d:%4.4d:%4.4d:%2.2d   %2.2d:%4.4d:%4.4d:%2.2d  %.3f %.3f %.3f\n",
-icrossing, itie,
-file1->block, crossing->file_id_1, crossing->section_1, tie->snav_1,
-file2->block, crossing->file_id_2, crossing->section_2, tie->snav_2,
-tie->offset_x_m,tie->offset_y_m,tie->offset_z_m);
-							}
-						}
-					}
-				break;
-			
-			case MOD_MODE_SET_TIES_Z_BLOCK:
-fprintf(stderr,"\nCommand set-ties-z-by-block=%2.2d/%2.2d\n", mods[imod].survey1, mods[imod].survey2);
-
-				for (icrossing=0;icrossing<project_output.num_crossings;icrossing++)
-					{
-					crossing = &(project_output.crossings[icrossing]);
-					file1 = (struct mbna_file *) &project_output.files[crossing->file_id_1];
-					file2 = (struct mbna_file *) &project_output.files[crossing->file_id_2];
-					if ((project_output.files[crossing->file_id_1].block == mods[imod].survey1
-							&& project_output.files[crossing->file_id_2].block == mods[imod].survey2)
-						|| (project_output.files[crossing->file_id_2].block == mods[imod].survey1
-							&& project_output.files[crossing->file_id_1].block == mods[imod].survey2))
-						{
-						for (itie=0;itie<crossing->num_ties;itie++)
-							{
-							tie = &crossing->ties[itie];
-							tie->status = MBNA_TIE_Z;
-
-fprintf(stderr,"Set tie mode Z-only:   %d:%d  %2.2d:%4.4d:%4.4d:%2.2d   %2.2d:%4.4d:%4.4d:%2.2d  %.3f %.3f %.3f\n",
-icrossing, itie,
-file1->block, crossing->file_id_1, crossing->section_1, tie->snav_1,
-file2->block, crossing->file_id_2, crossing->section_2, tie->snav_2,
-tie->offset_x_m,tie->offset_y_m,tie->offset_z_m);
-							}
-						}
-					}
-				break;
-
-			case MOD_MODE_SET_TIES_ZOFFSET_BLOCK:
-fprintf(stderr,"\nCommand set-ties-zoffset-by-block=%2.2d/%2.2d/%f\n", mods[imod].survey1, mods[imod].survey2, mods[imod].zoffset);
-				
-				for (icrossing=0;icrossing<project_output.num_crossings;icrossing++)
-					{
-					crossing = &(project_output.crossings[icrossing]);
-					file1 = (struct mbna_file *) &project_output.files[crossing->file_id_1];
-					file2 = (struct mbna_file *) &project_output.files[crossing->file_id_2];
-					if ((project_output.files[crossing->file_id_1].block == mods[imod].survey1
-							&& project_output.files[crossing->file_id_2].block == mods[imod].survey2)
-						|| (project_output.files[crossing->file_id_2].block == mods[imod].survey1
-							&& project_output.files[crossing->file_id_1].block == mods[imod].survey2))
-						{
-						for (itie=0;itie<crossing->num_ties;itie++)
-							{
-							tie = &crossing->ties[itie];
-							tie->offset_z_m = mods[imod].zoffset;
-
-fprintf(stderr,"Set tie zoffset:   %d:%d  %2.2d:%4.4d:%4.4d:%2.2d   %2.2d:%4.4d:%4.4d:%2.2d  %.3f %.3f %.3f\n",
-icrossing, itie,
-file1->block, crossing->file_id_1, crossing->section_1, tie->snav_1,
-file2->block, crossing->file_id_2, crossing->section_2, tie->snav_2,
-tie->offset_x_m,tie->offset_y_m,tie->offset_z_m);
-							}
-						}
-					}
-				break;
-
-			case MOD_MODE_SKIP_UNSET_CROSSINGS:
-fprintf(stderr,"\nCommand skip-unset-crossings\n");
-
-				for (icrossing=0;icrossing<project_output.num_crossings;icrossing++)
-					{
-					crossing = (struct mbna_crossing *) &project_output.crossings[icrossing];
-					file1 = (struct mbna_file *) &project_output.files[crossing->file_id_1];
-					file2 = (struct mbna_file *) &project_output.files[crossing->file_id_2];
-					if (crossing->num_ties == 0)
-						{
-						crossing->status = MBNA_CROSSING_STATUS_SKIP;
-fprintf(stderr,"Set crossing status to skip:   %d  %2.2d:%4.4d:%4.4d   %2.2d:%4.4d:%4.4d\n",
-icrossing,
-file1->block, crossing->file_id_1, crossing->section_1,
-file2->block, crossing->file_id_2, crossing->section_2);
-						}
-					}
-				break;
-
-			case MOD_MODE_INSERT_DISCONTINUITY:
-fprintf(stderr,"\nCommand insert-discontinuity=%2.2d:%2.2d\n", mods[imod].file1, mods[imod].section1);
-				
-				if (mods[imod].file1 >= 0 && mods[imod].file1 < project_output.num_files)
-					{
-					file1 = &(project_output.files[mods[imod].file1]);
-					section1 = &(file1->sections[mods[imod].section1]);
-					if (mods[imod].section1 >= 0 && mods[imod].section1 < file1->num_sections
-						&& section1->continuity == MB_YES)
-						{
-						section1->continuity = MB_NO;
-fprintf(stderr,"Set discontinuity before survey:file:section :   %2.2d:%4.4d:%4.4d\n",
-file1->block, mods[imod].file1, mods[imod].section1);
-						}
-					}
-				break;
-
-			}
-		}
-
-	/* write out the new project file */
-	status = mbnavadjust_write_project(verbose, &project_output, &error);
-	if (status == MB_SUCCESS)
-		{
-		fprintf(stderr,"Output project written:\n\t%s\n", project_output_path);
-		fprintf(stderr,"\t%d files\n\t%d crossings\n\t%d ties\n",
-			project_output.num_files, project_output.num_crossings, project_output.num_ties);
-		}
-	else
-		{
-		fprintf(stderr,"Write failure for output project:\n\t%s\n",
-			project_output_path);
-		fprintf(stderr,"\nProgram <%s> Terminated\n", program_name);
-		error = MB_ERROR_BAD_USAGE;
-		exit(error);
-		}
-
-	/* check memory */
-	if (verbose >= 4)
-		status = mb_memory_list(verbose,&error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  Program <%s> completed\n",
-			program_name);
-		fprintf(stderr,"dbg2  Ending status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* end it all */
-	exit(error);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbnavedit/Makefile.am b/src/mbnavedit/Makefile.am
deleted file mode 100644
index 7a865d3..0000000
--- a/src/mbnavedit/Makefile.am
+++ /dev/null
@@ -1,22 +0,0 @@
-bin_PROGRAMS = mbnavedit
-
-AM_CFLAGS = ${libnetcdf_CFLAGS}
-
-AM_CPPFLAGS = -I${top_srcdir}/src/mbio \
-	      -I${top_srcdir}/src/mbaux \
-	      -I${top_srcdir}/src/gsf \
-	      ${libmotif_CPPFLAGS} 
-
-AM_LDFLAGS = 
-
-LIBS = ${top_builddir}/src/mbio/libmbio.la \
-	${top_builddir}/src/mbaux/libmbaux.la \
-       ${top_builddir}/src/mbaux/libmbxgr.la \
-       ${libgmt_LIBS} ${libnetcdf_LIBS} ${libproj_LIBS} \
-       ${libmotif_LIBS} \
-       $(LIBM)
-
-mbnavedit_SOURCES = mbnavedit.c mbnavedit_creation.c mbnavedit_util.c mbnavedit_callbacks.c \
-	mbnavedit_prog.c mbnavedit_creation.h mbnavedit_extrawidgets.h mbnavedit.h
-
-
diff --git a/src/mbnavedit/Makefile.in b/src/mbnavedit/Makefile.in
deleted file mode 100644
index 708724d..0000000
--- a/src/mbnavedit/Makefile.in
+++ /dev/null
@@ -1,672 +0,0 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
-
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-
-VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
-am__make_running_with_option = \
-  case $${target_option-} in \
-      ?) ;; \
-      *) echo "am__make_running_with_option: internal error: invalid" \
-              "target option '$${target_option-}' specified" >&2; \
-         exit 1;; \
-  esac; \
-  has_opt=no; \
-  sane_makeflags=$$MAKEFLAGS; \
-  if $(am__is_gnu_make); then \
-    sane_makeflags=$$MFLAGS; \
-  else \
-    case $$MAKEFLAGS in \
-      *\\[\ \	]*) \
-        bs=\\; \
-        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
-          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
-    esac; \
-  fi; \
-  skip_next=no; \
-  strip_trailopt () \
-  { \
-    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
-  }; \
-  for flg in $$sane_makeflags; do \
-    test $$skip_next = yes && { skip_next=no; continue; }; \
-    case $$flg in \
-      *=*|--*) continue;; \
-        -*I) strip_trailopt 'I'; skip_next=yes;; \
-      -*I?*) strip_trailopt 'I';; \
-        -*O) strip_trailopt 'O'; skip_next=yes;; \
-      -*O?*) strip_trailopt 'O';; \
-        -*l) strip_trailopt 'l'; skip_next=yes;; \
-      -*l?*) strip_trailopt 'l';; \
-      -[dEDm]) skip_next=yes;; \
-      -[JT]) skip_next=yes;; \
-    esac; \
-    case $$flg in \
-      *$$target_option*) has_opt=yes; break;; \
-    esac; \
-  done; \
-  test $$has_opt = yes
-am__make_dryrun = (target_option=n; $(am__make_running_with_option))
-am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-bin_PROGRAMS = mbnavedit$(EXEEXT)
-subdir = src/mbnavedit
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/depcomp
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
-	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
-	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
-	$(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-	$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/src/mbio/mb_config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-am__installdirs = "$(DESTDIR)$(bindir)"
-PROGRAMS = $(bin_PROGRAMS)
-am_mbnavedit_OBJECTS = mbnavedit.$(OBJEXT) \
-	mbnavedit_creation.$(OBJEXT) mbnavedit_util.$(OBJEXT) \
-	mbnavedit_callbacks.$(OBJEXT) mbnavedit_prog.$(OBJEXT)
-mbnavedit_OBJECTS = $(am_mbnavedit_OBJECTS)
-mbnavedit_LDADD = $(LDADD)
-AM_V_lt = $(am__v_lt_ at AM_V@)
-am__v_lt_ = $(am__v_lt_ at AM_DEFAULT_V@)
-am__v_lt_0 = --silent
-am__v_lt_1 = 
-AM_V_P = $(am__v_P_ at AM_V@)
-am__v_P_ = $(am__v_P_ at AM_DEFAULT_V@)
-am__v_P_0 = false
-am__v_P_1 = :
-AM_V_GEN = $(am__v_GEN_ at AM_V@)
-am__v_GEN_ = $(am__v_GEN_ at AM_DEFAULT_V@)
-am__v_GEN_0 = @echo "  GEN     " $@;
-am__v_GEN_1 = 
-AM_V_at = $(am__v_at_ at AM_V@)
-am__v_at_ = $(am__v_at_ at AM_DEFAULT_V@)
-am__v_at_0 = @
-am__v_at_1 = 
-DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)/src/mbio
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
-am__mv = mv -f
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
-	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
-	$(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
-	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
-	$(AM_CFLAGS) $(CFLAGS)
-AM_V_CC = $(am__v_CC_ at AM_V@)
-am__v_CC_ = $(am__v_CC_ at AM_DEFAULT_V@)
-am__v_CC_0 = @echo "  CC      " $@;
-am__v_CC_1 = 
-CCLD = $(CC)
-LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
-	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
-	$(AM_LDFLAGS) $(LDFLAGS) -o $@
-AM_V_CCLD = $(am__v_CCLD_ at AM_V@)
-am__v_CCLD_ = $(am__v_CCLD_ at AM_DEFAULT_V@)
-am__v_CCLD_0 = @echo "  CCLD    " $@;
-am__v_CCLD_1 = 
-SOURCES = $(mbnavedit_SOURCES)
-DIST_SOURCES = $(mbnavedit_SOURCES)
-am__can_run_installinfo = \
-  case $$AM_UPDATE_INFO_DIR in \
-    n|no|NO) false;; \
-    *) (install-info --version) >/dev/null 2>&1;; \
-  esac
-am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
-# Read a list of newline-separated strings from the standard input,
-# and print each of them once, without duplicates.  Input order is
-# *not* preserved.
-am__uniquify_input = $(AWK) '\
-  BEGIN { nonempty = 0; } \
-  { items[$$0] = 1; nonempty = 1; } \
-  END { if (nonempty) { for (i in items) print i; }; } \
-'
-# Make sure the list of sources is unique.  This is necessary because,
-# e.g., the same source file might be shared among _SOURCES variables
-# for different programs/libraries.
-am__define_uniq_tagged_files = \
-  list='$(am__tagged_files)'; \
-  unique=`for i in $$list; do \
-    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-  done | $(am__uniquify_input)`
-ETAGS = etags
-CTAGS = ctags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-CC = @CC@
-CCAS = @CCAS@
-CCASDEPMODE = @CCASDEPMODE@
-CCASFLAGS = @CCASFLAGS@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DLLTOOL = @DLLTOOL@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GREP = @GREP@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBM = @LIBM@
-LIBOBJS = @LIBOBJS@
-LIBS = ${top_builddir}/src/mbio/libmbio.la \
-	${top_builddir}/src/mbaux/libmbaux.la \
-       ${top_builddir}/src/mbaux/libmbxgr.la \
-       ${libgmt_LIBS} ${libnetcdf_LIBS} ${libproj_LIBS} \
-       ${libmotif_LIBS} \
-       $(LIBM)
-
-LIBTOOL = @LIBTOOL@
-LIBTOOL_DEPS = @LIBTOOL_DEPS@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LTLIBOBJS = @LTLIBOBJS@
-LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
-MAINT = @MAINT@
-MAKEINFO = @MAKEINFO@
-MANIFEST_TOOL = @MANIFEST_TOOL@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-OTPS_DIR = @OTPS_DIR@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_URL = @PACKAGE_URL@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PKG_CONFIG = @PKG_CONFIG@
-PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
-PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-VERSION = @VERSION@
-XDR_LIB = @XDR_LIB@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_AR = @ac_ct_AR@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-fftw_app = @fftw_app@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libGLU_CFLAGS = @libGLU_CFLAGS@
-libGLU_LIBS = @libGLU_LIBS@
-libXm_CFLAGS = @libXm_CFLAGS@
-libXm_LIBS = @libXm_LIBS@
-libdir = @libdir@
-libexecdir = @libexecdir@
-libfftw3_CFLAGS = @libfftw3_CFLAGS@
-libfftw3_LIBS = @libfftw3_LIBS@
-libfftw_CPPFLAGS = @libfftw_CPPFLAGS@
-libfftw_LIBS = @libfftw_LIBS@
-libgmt_CFLAGS = @libgmt_CFLAGS@
-libgmt_CPPFLAGS = @libgmt_CPPFLAGS@
-libgmt_LIBS = @libgmt_LIBS@
-libmotif_CPPFLAGS = @libmotif_CPPFLAGS@
-libmotif_LIBS = @libmotif_LIBS@
-libnetcdf_CFLAGS = @libnetcdf_CFLAGS@
-libnetcdf_CPPFLAGS = @libnetcdf_CPPFLAGS@
-libnetcdf_LIBS = @libnetcdf_LIBS@
-libopengl_CPPFLAGS = @libopengl_CPPFLAGS@
-libopengl_LIBS = @libopengl_LIBS@
-libproj_CFLAGS = @libproj_CFLAGS@
-libproj_CPPFLAGS = @libproj_CPPFLAGS@
-libproj_LIBS = @libproj_LIBS@
-libpsl_CFLAGS = @libpsl_CFLAGS@
-libpsl_LIBS = @libpsl_LIBS@
-localedir = @localedir@
-localstatedir = @localstatedir@
-mandir = @mandir@
-mbsystemdatadir = @mbsystemdatadir@
-mbsystemhtmldir = @mbsystemhtmldir@
-mbsystempsdir = @mbsystempsdir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-AM_CFLAGS = ${libnetcdf_CFLAGS}
-AM_CPPFLAGS = -I${top_srcdir}/src/mbio \
-	      -I${top_srcdir}/src/mbaux \
-	      -I${top_srcdir}/src/gsf \
-	      ${libmotif_CPPFLAGS} 
-
-AM_LDFLAGS = 
-mbnavedit_SOURCES = mbnavedit.c mbnavedit_creation.c mbnavedit_util.c mbnavedit_callbacks.c \
-	mbnavedit_prog.c mbnavedit_creation.h mbnavedit_extrawidgets.h mbnavedit.h
-
-all: all-am
-
-.SUFFIXES:
-.SUFFIXES: .c .lo .o .obj
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
-	@for dep in $?; do \
-	  case '$(am__configure_deps)' in \
-	    *$$dep*) \
-	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-	        && { if test -f $@; then exit 0; else break; fi; }; \
-	      exit 1;; \
-	  esac; \
-	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/mbnavedit/Makefile'; \
-	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --gnu src/mbnavedit/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	@case '$?' in \
-	  *config.status*) \
-	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-	esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-install-binPROGRAMS: $(bin_PROGRAMS)
-	@$(NORMAL_INSTALL)
-	@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
-	if test -n "$$list"; then \
-	  echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
-	  $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
-	fi; \
-	for p in $$list; do echo "$$p $$p"; done | \
-	sed 's/$(EXEEXT)$$//' | \
-	while read p p1; do if test -f $$p \
-	 || test -f $$p1 \
-	  ; then echo "$$p"; echo "$$p"; else :; fi; \
-	done | \
-	sed -e 'p;s,.*/,,;n;h' \
-	    -e 's|.*|.|' \
-	    -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
-	sed 'N;N;N;s,\n, ,g' | \
-	$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
-	  { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
-	    if ($$2 == $$4) files[d] = files[d] " " $$1; \
-	    else { print "f", $$3 "/" $$4, $$1; } } \
-	  END { for (d in files) print "f", d, files[d] }' | \
-	while read type dir files; do \
-	    if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
-	    test -z "$$files" || { \
-	    echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
-	    $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
-	    } \
-	; done
-
-uninstall-binPROGRAMS:
-	@$(NORMAL_UNINSTALL)
-	@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
-	files=`for p in $$list; do echo "$$p"; done | \
-	  sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
-	      -e 's/$$/$(EXEEXT)/' \
-	`; \
-	test -n "$$list" || exit 0; \
-	echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
-	cd "$(DESTDIR)$(bindir)" && rm -f $$files
-
-clean-binPROGRAMS:
-	@list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \
-	echo " rm -f" $$list; \
-	rm -f $$list || exit $$?; \
-	test -n "$(EXEEXT)" || exit 0; \
-	list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
-	echo " rm -f" $$list; \
-	rm -f $$list
-
-mbnavedit$(EXEEXT): $(mbnavedit_OBJECTS) $(mbnavedit_DEPENDENCIES) $(EXTRA_mbnavedit_DEPENDENCIES) 
-	@rm -f mbnavedit$(EXEEXT)
-	$(AM_V_CCLD)$(LINK) $(mbnavedit_OBJECTS) $(mbnavedit_LDADD) $(LIBS)
-
-mostlyclean-compile:
-	-rm -f *.$(OBJEXT)
-
-distclean-compile:
-	-rm -f *.tab.c
-
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbnavedit.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbnavedit_callbacks.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbnavedit_creation.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbnavedit_prog.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbnavedit_util.Po at am__quote@
-
-.c.o:
- at am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(COMPILE) -c -o $@ $<
-
-.c.obj:
- at am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
- at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-
-.c.lo:
- at am__fastdepCC_TRUE@	$(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(LTCOMPILE) -c -o $@ $<
-
-mostlyclean-libtool:
-	-rm -f *.lo
-
-clean-libtool:
-	-rm -rf .libs _libs
-
-ID: $(am__tagged_files)
-	$(am__define_uniq_tagged_files); mkid -fID $$unique
-tags: tags-am
-TAGS: tags
-
-tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
-	set x; \
-	here=`pwd`; \
-	$(am__define_uniq_tagged_files); \
-	shift; \
-	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
-	  test -n "$$unique" || unique=$$empty_fix; \
-	  if test $$# -gt 0; then \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      "$$@" $$unique; \
-	  else \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      $$unique; \
-	  fi; \
-	fi
-ctags: ctags-am
-
-CTAGS: ctags
-ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
-	$(am__define_uniq_tagged_files); \
-	test -z "$(CTAGS_ARGS)$$unique" \
-	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$unique
-
-GTAGS:
-	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && $(am__cd) $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) "$$here"
-cscopelist: cscopelist-am
-
-cscopelist-am: $(am__tagged_files)
-	list='$(am__tagged_files)'; \
-	case "$(srcdir)" in \
-	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
-	  *) sdir=$(subdir)/$(srcdir) ;; \
-	esac; \
-	for i in $$list; do \
-	  if test -f "$$i"; then \
-	    echo "$(subdir)/$$i"; \
-	  else \
-	    echo "$$sdir/$$i"; \
-	  fi; \
-	done >> $(top_builddir)/cscope.files
-
-distclean-tags:
-	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	list='$(DISTFILES)'; \
-	  dist_files=`for file in $$list; do echo $$file; done | \
-	  sed -e "s|^$$srcdirstrip/||;t" \
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
-	case $$dist_files in \
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
-			   sort -u` ;; \
-	esac; \
-	for file in $$dist_files; do \
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  if test -d $$d/$$file; then \
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
-	    if test -d "$(distdir)/$$file"; then \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
-	  else \
-	    test -f "$(distdir)/$$file" \
-	    || cp -p $$d/$$file "$(distdir)/$$file" \
-	    || exit 1; \
-	  fi; \
-	done
-check-am: all-am
-check: check-am
-all-am: Makefile $(PROGRAMS)
-installdirs:
-	for dir in "$(DESTDIR)$(bindir)"; do \
-	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
-	done
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
-	if test -z '$(STRIP)'; then \
-	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	      install; \
-	else \
-	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
-	fi
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
-	@echo "This command is intended for maintainers to use"
-	@echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am
-
-distclean: distclean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
-	distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am: install-binPROGRAMS
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic \
-	mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am: uninstall-binPROGRAMS
-
-.MAKE: install-am install-strip
-
-.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \
-	clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \
-	ctags ctags-am distclean distclean-compile distclean-generic \
-	distclean-libtool distclean-tags distdir dvi dvi-am html \
-	html-am info info-am install install-am install-binPROGRAMS \
-	install-data install-data-am install-dvi install-dvi-am \
-	install-exec install-exec-am install-html install-html-am \
-	install-info install-info-am install-man install-pdf \
-	install-pdf-am install-ps install-ps-am install-strip \
-	installcheck installcheck-am installdirs maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-compile \
-	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-	tags tags-am uninstall uninstall-am uninstall-binPROGRAMS
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/mbnavedit/mbnavedit.c b/src/mbnavedit/mbnavedit.c
deleted file mode 100644
index 0e50202..0000000
--- a/src/mbnavedit/mbnavedit.c
+++ /dev/null
@@ -1,167 +0,0 @@
-
-/* Begin user code block <abstract> */
-/* End user code block <abstract> */
-
-/**
- * README: Portions of this file are merged at file generation
- * time. Edits can be made *only* in between specified code blocks, look
- * for keywords <Begin user code> and <End user code>.
- */
-/*
- * Generated by the ICS Builder Xcessory (BX).
- *
- * BuilderXcessory Version 6.1.3
- * Code Generator Xcessory 6.1.3 (08/19/04) CGX Scripts 6.1 Motif 2.1
- *
- */
-
-
-/* Begin user code block <file_comments> */
-/* End user code block <file_comments> */
-
-/*
- * Motif required Headers
- */
-#include <X11/StringDefs.h>
-#include <Xm/Xm.h>
-#include <Xm/DialogS.h>
-#include <Xm/RepType.h>
-#include <Xm/MwmUtil.h>
-
-/**
- * Globally included information.
- */
-
-
-/*
- * Headers for classes used in this program
- */
-
-/**
- * Common constant and pixmap declarations.
- */
-#include "mbnavedit_creation.h"
-
-/**
- * Convenience functions from utilities file.
- */
-extern void RegisterBxConverters(XtAppContext);
-extern XtPointer BX_CONVERT(Widget, char *, char *, int, Boolean *);
-extern XtPointer BX_DOUBLE(double);
-extern XtPointer BX_SINGLE(float);
-extern void BX_MENU_POST(Widget, XtPointer, XEvent *, Boolean *);
-extern Pixmap XPM_PIXMAP(Widget, char **);
-extern void BX_SET_BACKGROUND_COLOR(Widget, ArgList, Cardinal *, Pixel);
-
-/**
- * Declarations for shell callbacks.
- */
-extern void BxExitCB(Widget, XtPointer, XtPointer);
-
-/* Begin user code block <globals> */
-
-Widget CreatemainWindow(Widget parent);
-void do_mbnavedit_init(int argc, char **argv);
-int do_wait_until_viewed(XtAppContext app);
-
-/* End user code block <globals> */
-
-/**
- * Change this line via the Output Application Names Dialog.
- */
-#define BX_APP_CLASS "mbnavedit"
-
-int main( int argc, char **argv)
-{
-    Widget       parent;
-    XtAppContext app;
-    Arg          args[256];
-    Cardinal     ac;
-    Widget   topLevelShell;
-    Widget   mainWindow;
-
-    /* Begin user code block <declarations> */
-
-    /* make sure that the argc that goes to XtVaAppInitialize
-       is 1 so that no options are removed by its option parsing */
-    int		 argc_save;
-    argc_save = argc;
-    argc = 1;
-
-    /* End user code block <declarations> */
-
-    /*
-     * Initialize Xt.
-     */
-
-    // XtSetLanguageProc(NULL, (XtLanguageProc) NULL, NULL);
-
-    /*
-     * The applicationShell is created as an unrealized
-     * parent for multiple topLevelShells.  The topLevelShells
-     * are created as popup children of the applicationShell.
-     * This is a recommendation of Paul Asente & Ralph Swick in
-     * _X_Window_System_Toolkit_ p. 677.
-     */
-
-    parent = XtVaOpenApplication ( &app,
-                                   BX_APP_CLASS,
-                                   NULL,
-                                   0,
-                                   &argc,
-                                   argv,
-                                   NULL,
-                                   sessionShellWidgetClass,
-                                   NULL );
-
-    RegisterBxConverters(app);
-    XmRepTypeInstallTearOffModelConverter();
-
-    /* Begin user code block <create_shells> */
-    /* End user code block <create_shells> */
-
-    /*
-     * Create classes and widgets used in this program.
-     */
-
-    /* Begin user code block <create_topLevelShell> */
-    /* End user code block <create_topLevelShell> */
-
-    ac = 0;
-    XtSetArg(args[ac], XmNtitle, "MBnavedit"); ac++;
-    XtSetArg(args[ac], XmNiconName, "MBnavedit"); ac++;
-    XtSetArg(args[ac], XmNallowShellResize, True); ac++;
-    XtSetArg(args[ac], XmNx, 964); ac++;
-    XtSetArg(args[ac], XmNy, 300); ac++;
-    XtSetArg(args[ac], XmNwidth, 1024); ac++;
-    XtSetArg(args[ac], XmNheight, 683); ac++;
-    topLevelShell = XtCreatePopupShell((char *)"topLevelShell",
-        topLevelShellWidgetClass,
-        parent,
-        args,
-        ac);
-    XtAddCallback(topLevelShell, XmNdestroyCallback, BxExitCB, (XtPointer)0);
-    mainWindow = (Widget)CreatemainWindow(topLevelShell);
-    XtManageChild(mainWindow);
-    XtPopup(XtParent(mainWindow), XtGrabNone);
-
-    /* Begin user code block <app_procedures> */
-
-    /* initialize app value and wait until view realized */
-    do_wait_until_viewed(app);
-
-    /* initialize everything */
-    do_mbnavedit_init(argc_save,argv);
-
-    /* End user code block <app_procedures> */
-
-    /* Begin user code block <main_loop> */
-    /* End user code block <main_loop> */
-
-    XtAppMainLoop(app);
-
-    /*
-     * A return value regardless of whether or not the main loop ends.
-     */
-     return(0);
-}
diff --git a/src/mbnavedit/mbnavedit.h b/src/mbnavedit/mbnavedit.h
deleted file mode 100644
index 408f9d4..0000000
--- a/src/mbnavedit/mbnavedit.h
+++ /dev/null
@@ -1,281 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbnavedit.h	6/24/95
- *    $Id: mbnavedit.h 2247 2015-05-29 21:28:28Z caress $
- *
- *    Copyright (c) 1995-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * MBNAVEDIT is an interactive navigation editor for swath sonar data.
- * It can work with any data format supported by the MBIO library.
- * This include file contains global control parameters shared with
- * the Motif interface code.
- *
- * Author:	D. W. Caress
- * Date:	June 24,  1995
- * Date:	August 28, 2000 (New version - no buffered i/o)
- *
- *
- */
-
-/*--------------------------------------------------------------------*/
-
-#ifndef MB_YES
-#include "mb_status.h"
-#endif
-
-#ifdef MBNAVEDIT_DECLARE_GLOBALS
-#define MBNAVEDIT_EXTERNAL
-#else
-#define MBNAVEDIT_EXTERNAL extern
-#endif
-
-/* mbnavedit global control parameters */
-MBNAVEDIT_EXTERNAL int	output_mode;
-MBNAVEDIT_EXTERNAL int	run_mbprocess;
-MBNAVEDIT_EXTERNAL int	gui_mode;
-MBNAVEDIT_EXTERNAL int	data_show_max;
-MBNAVEDIT_EXTERNAL int	data_show_size;
-MBNAVEDIT_EXTERNAL int	data_step_max;
-MBNAVEDIT_EXTERNAL int	data_step_size;
-MBNAVEDIT_EXTERNAL int	mode_pick;
-MBNAVEDIT_EXTERNAL int	mode_set_interval;
-MBNAVEDIT_EXTERNAL int	plot_tint;
-MBNAVEDIT_EXTERNAL int	plot_tint_org;
-MBNAVEDIT_EXTERNAL int	plot_lon;
-MBNAVEDIT_EXTERNAL int	plot_lon_org;
-MBNAVEDIT_EXTERNAL int	plot_lon_dr;
-MBNAVEDIT_EXTERNAL int	plot_lat;
-MBNAVEDIT_EXTERNAL int	plot_lat_org;
-MBNAVEDIT_EXTERNAL int	plot_lat_dr;
-MBNAVEDIT_EXTERNAL int	plot_speed;
-MBNAVEDIT_EXTERNAL int	plot_speed_org;
-MBNAVEDIT_EXTERNAL int	plot_smg;
-MBNAVEDIT_EXTERNAL int	plot_heading;
-MBNAVEDIT_EXTERNAL int	plot_heading_org;
-MBNAVEDIT_EXTERNAL int	plot_cmg;
-MBNAVEDIT_EXTERNAL int	plot_draft;
-MBNAVEDIT_EXTERNAL int	plot_draft_org;
-MBNAVEDIT_EXTERNAL int	plot_draft_dr;
-MBNAVEDIT_EXTERNAL int	plot_roll;
-MBNAVEDIT_EXTERNAL int	plot_pitch;
-MBNAVEDIT_EXTERNAL int	plot_heave;
-MBNAVEDIT_EXTERNAL int	mean_time_window;
-MBNAVEDIT_EXTERNAL int	drift_lon;
-MBNAVEDIT_EXTERNAL int	drift_lat;
-MBNAVEDIT_EXTERNAL int	timestamp_problem;
-MBNAVEDIT_EXTERNAL int	use_ping_data;
-MBNAVEDIT_EXTERNAL int	strip_comments;
-MBNAVEDIT_EXTERNAL int	format;
-MBNAVEDIT_EXTERNAL char	ifile[MB_PATH_MAXLINE];
-MBNAVEDIT_EXTERNAL char	nfile[MB_PATH_MAXLINE];
-MBNAVEDIT_EXTERNAL int	nfile_defined;
-MBNAVEDIT_EXTERNAL int	model_mode;
-MBNAVEDIT_EXTERNAL double	weight_speed;
-MBNAVEDIT_EXTERNAL double	weight_acceleration;
-MBNAVEDIT_EXTERNAL int	scrollcount;
-MBNAVEDIT_EXTERNAL double	offset_lon;
-MBNAVEDIT_EXTERNAL double	offset_lat;
-MBNAVEDIT_EXTERNAL double	offset_lon_applied;
-MBNAVEDIT_EXTERNAL double	offset_lat_applied;
-
-/* mbnavedit plot size parameters */
-MBNAVEDIT_EXTERNAL int	plot_width;
-MBNAVEDIT_EXTERNAL int	plot_height;
-MBNAVEDIT_EXTERNAL int	number_plots;
-MBNAVEDIT_EXTERNAL int	window_width;
-MBNAVEDIT_EXTERNAL int	window_height;
-
-/* Mode value defines */
-#define	PICK_MODE_PICK		0
-#define	PICK_MODE_SELECT	1
-#define	PICK_MODE_DESELECT	2
-#define	PICK_MODE_SELECTALL	3
-#define	PICK_MODE_DESELECTALL	4
-#define	OUTPUT_MODE_OUTPUT	0
-#define	OUTPUT_MODE_BROWSE	1
-#define	PLOT_TINT	0
-#define	PLOT_LONGITUDE	1
-#define	PLOT_LATITUDE	2
-#define	PLOT_SPEED	3
-#define	PLOT_HEADING	4
-#define	PLOT_DRAFT	5
-#define	PLOT_ROLL	6
-#define	PLOT_PITCH	7
-#define	PLOT_HEAVE	8
-#define	MODEL_MODE_OFF		0
-#define	MODEL_MODE_MEAN		1
-#define	MODEL_MODE_DR		2
-#define	MODEL_MODE_INVERT	3
-#define	NUM_FILES_MAX		1000
-
-/*--------------------------------------------------------------------*/
-
-/* function prototypes */
-void do_mbnavedit_init(int argc, char **argv);
-void  do_parse_datalist( char *file, int form);
-void do_editlistselection( Widget w, XtPointer client_data, XtPointer call_data);
-void do_filelist_remove( Widget w, XtPointer client_data, XtPointer call_data);
-void do_load_specific_file(int i_file);
-void do_build_filelist(void);
-void do_set_controls(void);
-void do_nextbuffer( Widget w, XtPointer client_data, XtPointer call_data);
-void do_done( Widget w, XtPointer client_data, XtPointer call_data);
-void do_start( Widget w, XtPointer client_data, XtPointer call_data);
-void do_end( Widget w, XtPointer client_data, XtPointer call_data);
-void do_forward( Widget w, XtPointer client_data, XtPointer call_data);
-void do_reverse( Widget w, XtPointer client_data, XtPointer call_data);
-void do_timespan( Widget w, XtPointer client_data, XtPointer call_data);
-void do_timestep( Widget w, XtPointer client_data, XtPointer call_data);
-void do_expose( Widget w, XtPointer client_data, XtPointer call_data);
-void do_event( Widget w, XtPointer client_data, XtPointer call_data);
-void do_resize( Widget w, XtPointer client_data, XEvent *event, Boolean *unused);
-void do_toggle_time( Widget w, XtPointer client_data, XtPointer call_data);
-void do_toggle_lon( Widget w, XtPointer client_data, XtPointer call_data);
-void do_toggle_lat( Widget w, XtPointer client_data, XtPointer call_data);
-void do_toggle_heading( Widget w, XtPointer client_data, XtPointer call_data);
-void do_toggle_speed( Widget w, XtPointer client_data, XtPointer call_data);
-void do_toggle_sonardepth( Widget w, XtPointer client_data, XtPointer call_data);
-void do_toggle_org_time( Widget w, XtPointer client_data, XtPointer call_data);
-void do_toggle_org_lon( Widget w, XtPointer client_data, XtPointer call_data);
-void do_toggle_org_lat( Widget w, XtPointer client_data, XtPointer call_data);
-void do_toggle_org_speed( Widget w, XtPointer client_data, XtPointer call_data);
-void do_toggle_dr_lat( Widget w, XtPointer client_data, XtPointer call_data);
-void do_toggle_dr_lon( Widget w, XtPointer client_data, XtPointer call_data);
-void do_flag( Widget w, XtPointer client_data, XtPointer call_data);
-void do_unflag( Widget w, XtPointer client_data, XtPointer call_data);
-void do_modeling_apply( Widget w, XtPointer client_data, XtPointer call_data);
-void do_model_mode( Widget w, XtPointer client_data, XtPointer call_data);
-void do_timeinterpolation_apply( Widget w, XtPointer client_data, XtPointer call_data);
-void do_deletebadtimetag_apply( Widget w, XtPointer client_data, XtPointer call_data);
-void do_meantimewindow( Widget w, XtPointer client_data, XtPointer call_data);
-void do_driftlon( Widget w, XtPointer client_data, XtPointer call_data);
-void do_driftlat( Widget w, XtPointer client_data, XtPointer call_data);
-void do_offset_apply( Widget w, XtPointer client_data, XtPointer call_data);
-void do_toggle_show_smg( Widget w, XtPointer client_data, XtPointer call_data);
-void do_toggle_org_heading( Widget w, XtPointer client_data, XtPointer call_data);
-void do_toggle_org_sonardepth( Widget w, XtPointer client_data, XtPointer call_data);
-void do_toggle_show_cmg( Widget w, XtPointer client_data, XtPointer call_data);
-void do_button_use_dr( Widget w, XtPointer client_data, XtPointer call_data);
-void do_button_use_smg( Widget w, XtPointer client_data, XtPointer call_data);
-void do_button_use_cmg( Widget w, XtPointer client_data, XtPointer call_data);
-void do_toggle_output_on( Widget w, XtPointer client_data, XtPointer call_data);
-void do_toggle_output_off( Widget w, XtPointer client_data, XtPointer call_data);
-void do_toggle_output_on_filelist( Widget w, XtPointer client_data, XtPointer call_data);
-void do_toggle_output_off_filelist( Widget w, XtPointer client_data, XtPointer call_data);
-void do_fileselection_cancel( Widget w, XtPointer client_data, XtPointer call_data);
-void do_filebutton_on(void);
-void do_filebutton_off(void);
-void do_fileselection_ok( Widget w, XtPointer client_data, XtPointer call_data);
-void do_checkuseprevious(void);
-void do_useprevious_yes( Widget w, XtPointer client_data, XtPointer call_data);
-void do_useprevious_no( Widget w, XtPointer client_data, XtPointer call_data);
-void do_load(int useprevious);
-void do_fileselection_filter( Widget w, XtPointer client_data, XtPointer call_data);
-void do_fileselection_list( Widget w, XtPointer client_data, XtPointer call_data);
-void do_fileselection_nomatch( Widget w, XtPointer client_data, XtPointer call_data);
-void do_toggle_pick( Widget w, XtPointer client_data, XtPointer call_data);
-void do_toggle_select( Widget w, XtPointer client_data, XtPointer call_data);
-void do_toggle_deselect( Widget w, XtPointer client_data, XtPointer call_data);
-void do_toggle_selectall( Widget w, XtPointer client_data, XtPointer call_data);
-void do_toggle_deselectall( Widget w, XtPointer client_data, XtPointer call_data);
-void do_quit( Widget w, XtPointer client_data, XtPointer call_data);
-void do_interpolation( Widget w, XtPointer client_data, XtPointer call_data);
-void do_interpolationrepeats( Widget w, XtPointer client_data, XtPointer call_data);
-void do_scroll( Widget w, XtPointer client_data, XtPointer call_data);
-void do_revert( Widget w, XtPointer client_data, XtPointer call_data);
-void do_showall( Widget w, XtPointer client_data, XtPointer call_data);
-void do_set_interval( Widget w, XtPointer client_data, XtPointer call_data);
-int do_unset_interval(void);
-void do_toggle_vru( Widget w, XtPointer client_data, XtPointer call_data);
-void mbnavedit_bell(int length);
-void mbnavedit_get_position(int *win_x, int *win_y, unsigned int *mask_return);
-void mbnavedit_pickcursor(void);
-void mbnavedit_selectcursor(void);
-void mbnavedit_deselectcursor(void);
-void mbnavedit_selectallcursor(void);
-void mbnavedit_deselectallcursor(void);
-void mbnavedit_setintervalcursor(void);
-int do_wait_until_viewed(XtAppContext app);
-int do_mbnavedit_settimer(void);
-int do_mbnavedit_workfunction(XtPointer client_data);
-int do_message_on(char *message);
-int do_message_off(void);
-int do_error_dialog(char *s1, char *s2, char *s3);
-void set_label_string(Widget w, String str);
-void set_label_multiline_string(Widget w, String str);
-void get_text_string(Widget w, String str);
-
-int mbnavedit_init_globals(void);
-int mbnavedit_init(int argc, char **argv, int *startup_file);
-int mbnavedit_set_graphics(void *xgid, int ncol, unsigned int *pixels);
-int mbnavedit_action_open(int useprevious);
-int mbnavedit_open_file(int useprevious);
-int mbnavedit_close_file(void);
-int mbnavedit_dump_data(int hold);
-int mbnavedit_load_data(void);
-int mbnavedit_clear_screen(void);
-int mbnavedit_action_next_buffer(int *quit);
-int mbnavedit_action_offset(void);
-int mbnavedit_action_close(void);
-int mbnavedit_action_done(int *quit);
-int mbnavedit_action_quit(void);
-int mbnavedit_action_step(int step);
-int mbnavedit_action_start(void);
-int mbnavedit_action_end(void);
-int mbnavedit_action_mouse_pick(int xx, int yy);
-int mbnavedit_action_mouse_select(int xx, int yy);
-int mbnavedit_action_mouse_deselect(int xx, int yy);
-int mbnavedit_action_mouse_selectall(int xx, int yy);
-int mbnavedit_action_mouse_deselectall(int xx, int yy);
-int mbnavedit_action_deselect_all(int type);
-int mbnavedit_action_set_interval(int xx, int yy, int which);
-int mbnavedit_action_use_dr(void);
-int mbnavedit_action_use_smg(void);
-int mbnavedit_action_use_cmg(void);
-int mbnavedit_action_interpolate(void);
-int mbnavedit_action_interpolaterepeats(void);
-int mbnavedit_action_revert(void);
-int mbnavedit_action_flag(void);
-int mbnavedit_action_unflag(void);
-int mbnavedit_action_fixtime(void);
-int mbnavedit_action_deletebadtime(void);
-int mbnavedit_action_showall(void);
-int mbnavedit_get_smgcmg(int i);
-int mbnavedit_get_model(void);
-int mbnavedit_get_gaussianmean(void);
-int mbnavedit_get_dr(void);
-int mbnavedit_get_inversion(void);
-int mbnavedit_plot_all(void);
-int mbnavedit_plot_tint(int iplot);
-int mbnavedit_plot_lon(int iplot);
-int mbnavedit_plot_lat(int iplot);
-int mbnavedit_plot_speed(int iplot);
-int mbnavedit_plot_heading(int iplot);
-int mbnavedit_plot_draft(int iplot);
-int mbnavedit_plot_roll(int iplot);
-int mbnavedit_plot_pitch(int iplot);
-int mbnavedit_plot_heave(int iplot);
-int mbnavedit_plot_tint_value(int iplot, int iping);
-int mbnavedit_plot_lon_value(int iplot, int iping);
-int mbnavedit_plot_lat_value(int iplot, int iping);
-int mbnavedit_plot_speed_value(int iplot, int iping);
-int mbnavedit_plot_heading_value(int iplot, int iping);
-int mbnavedit_plot_draft_value(int iplot, int iping);
-
-void BxUnmanageCB(Widget w, XtPointer client, XtPointer call);
-void BxManageCB(Widget w, XtPointer client, XtPointer call);
-void BxPopupCB(Widget w, XtPointer client, XtPointer call);
-void BxPopdownCB(Widget w, XtPointer client, XtPointer call);
-XtPointer BX_CONVERT(Widget w, char *from_string, char *to_type, int to_size, Boolean *success);
-void BxExitCB(Widget w, XtPointer client, XtPointer call);
-void BxSetValuesCB(Widget w, XtPointer client, XtPointer call);
-
-/*--------------------------------------------------------------------*/
diff --git a/src/mbnavedit/mbnavedit.uil b/src/mbnavedit/mbnavedit.uil
deleted file mode 100644
index 309224e..0000000
--- a/src/mbnavedit/mbnavedit.uil
+++ /dev/null
@@ -1,3749 +0,0 @@
-/*
- * Generated by the ICS builderXcessory (BX).
- *
- *
- * BuilderXcessory Version 6.1.3.
- *
- * Identification: 
- */
-module main_uil
-version = 'V2.1'
-names = case_sensitive
-!(BX) bx_info("c_options", "")
-!(BX) bx_info("c_libs", "-lGLw -lSgm -lXm -lXt -lGL -lXext -lX11 -lgen -lm")
-!(BX) bx_info("c_cflags", "-Aa -I/usr/include/Motif1.2 -I/usr/include/X11R5")
-!(BX) bx_info("c_cc", "cc")
-!(BX) bx_info("c_excludeungenerated", "false")
-!(BX) bx_info("c_target", "main-c")
-!(BX) bx_info("c_information", "")
-!(BX) bx_info("c_user_main_loop", "", false)
-!(BX) bx_info("c_ignore_shell_geometry", "false")
-!(BX) bx_info("c_visible_windows_only", "false")
-!(BX) bx_info("c_rm_exp_callbacks", "false")
-!(BX) bx_info("c_reverse_dialogs", "true")
-!(BX) bx_info("c_dialogs_in_routine", "true")
-!(BX) bx_info("c_unmanage_dialogs", "true")
-!(BX) bx_info("c_use_locales", "false")
-!(BX) bx_info("c_ansi", "true")
-!(BX) bx_info("c_name", "mbnavedit")
-!(BX) bx_info("c_class", "mbnavedit")
-!(BX) bx_info("c_app_defaults", "mbnavedit", true)
-!(BX) bx_info("c_utilities", "mbnavedit_util.c", true)
-!(BX) bx_info("c_constants", "mbnavedit_creation.h", true)
-!(BX) bx_info("c_callbacks", "mbnavedit_callbacks.c", true)
-!(BX) bx_info("c_creation", "mbnavedit_creation.c", true)
-!(BX) bx_info("c_main", "mbnavedit.c", true)
-!(BX) bx_info("c_acinclude_m4", "acinclude.m4", false)
-!(BX) bx_info("c_configure_in", "configure.in", false)
-!(BX) bx_info("c_makefile_am", "Makefile.am", false)
-!(BX) bx_info("c_cvsmake", "CVSMake", false)
-!(BX) bx_info("c_makefile", "Makefile.org", true)
-!(BX) bx_info("c_imakefile", "Imakefile", false)
-!(BX) bx_info("c_dirpath", "")
-!(BX) bx_info("include_path", ".", false)
-!(BX) bx_info("xrunner_command", "$(M_ROOT)/arch/X11.5/Xm1.2/mic_xm.o", false)
-!(BX) bx_info("system_directory", "/opt/bx-6.1")
-!(BX) bx_info("builder_version", "BuilderXcessory Version 6.1.3")
-!(BX) bx_info("build_lang", "C")
-!(BX) bx_info("default_cpp_args", "")
-!(BX) bx_info("new_mrm_style", "true")
-!(BX) bx_info("c_wrap_lines", "false")
-!(BX) bx_info("uil_wrap_lines", "true")
-!(BX) bx_info("integrate_purify", "false")
-!(BX) bx_info("purify_command", "purify")
-!(BX) bx_info("integrate_xrunner", "false")
-
-procedure BxGlobalWidgetId;
-identifier BXG_pushButton_end;
-identifier BXG_pushButton_start;
-identifier BXG_pushButton_file;
-identifier BXG_pushButton_interpolaterepeats;
-identifier BXG_pushButton_unflag;
-identifier BXG_pushButton_flag;
-identifier BXG_pushButton_controls_deletebadtimetag;
-identifier BXG_pushButton_controls_timeinterpolation;
-identifier BXG_toggleButton_org_sonardepth;
-identifier BXG_toggleButton_sonardepth;
-identifier BXG_pushButton_solution;
-identifier BXG_toggleButton_dr_lat;
-identifier BXG_toggleButton_dr_lon;
-identifier BXG_toggleButton_org_time;
-identifier BXG_toggleButton_time;
-identifier BXG_pushButton_done;
-identifier BXG_pushButton_forward;
-identifier BXG_pushButton_reverse;
-identifier BXG_toggleButton_vru;
-identifier BXG_pushButton_revert;
-identifier BXG_pushButton_interpolate;
-identifier BXG_toggleButton_deselectall;
-identifier BXG_toggleButton_selectall;
-identifier BXG_toggleButton_deselect;
-identifier BXG_toggleButton_select;
-identifier BXG_toggleButton_pick;
-identifier BXG_radioBox;
-identifier BXG_pushButton_heading_cmg;
-identifier BXG_toggleButton_show_cmg;
-identifier BXG_toggleButton_org_heading;
-identifier BXG_pushButton_speed_smg;
-identifier BXG_toggleButton_show_smg;
-identifier BXG_toggleButton_org_speed;
-identifier BXG_toggleButton_org_lat;
-identifier BXG_toggleButton_org_lon;
-identifier BXG_toggleButton_speed;
-identifier BXG_toggleButton_heading;
-identifier BXG_toggleButton_lat;
-identifier BXG_toggleButton_lon;
-identifier BXG_drawingArea;
-identifier BXG_scrolledWindow;
-identifier BXG_bulletinBoard;
-identifier BXG_label_about_version;
-identifier BXG_label_message;
-identifier BXG_bulletinBoard_message;
-identifier BXG_label_error_two;
-identifier BXG_label_error_one;
-identifier BXG_label_error_three;
-identifier BXG_bulletinBoard_error;
-identifier BXG_label_output_mode;
-identifier BXG_toggleButton_output_off;
-identifier BXG_toggleButton_output_on;
-identifier BXG_radioBox_output;
-identifier BXG_textField_format;
-identifier BXG_label_format;
-identifier BXG_fileSelectionBox;
-identifier BXG_bulletinBoard_fileselection;
-identifier BXG_xmDialogShell_fileselection;
-identifier BXG_label_timestep_2;
-identifier BXG_scale_timestep;
-identifier BXG_label_timestep_1;
-identifier BXG_label_timespan_2;
-identifier BXG_scale_timespan;
-identifier BXG_label_timespan_1;
-identifier BXG_scale_meantimewindow;
-identifier BXG_textField_modeling_acceleration;
-identifier BXG_textField_modeling_speed;
-identifier BXG_scale_driftlat;
-identifier BXG_scale_driftlon;
-identifier BXG_toggleButton_modeling_inversion;
-identifier BXG_toggleButton_modeling_dr;
-identifier BXG_toggleButton_modeling_meanfilter;
-identifier BXG_toggleButton_modeling_off;
-identifier BXG_bulletinBoard_useprevious;
-identifier BXG_bulletinBoard_timeinterpolation;
-identifier BXG_bulletinBoard_deletebadtimetag;
-identifier BXG_pushButton_offset_dismiss;
-identifier BXG_pushButton_offset_apply;
-identifier BXG_textField_lat_offset;
-identifier BXG_textField_lon_offset;
-identifier BXG_toggleButton_output_off_filelist;
-identifier BXG_toggleButton_output_on_filelist;
-identifier BXG_list_filelist;
-procedure BxExitCB(integer);
-procedure BxManageCB(string);
-procedure BxSetValuesCB(string);
-procedure BxUnmanageCB(string);
-procedure do_button_use_cmg();
-procedure do_button_use_dr();
-procedure do_button_use_smg();
-procedure do_deletebadtimetag_apply();
-procedure do_done();
-procedure do_driftlat();
-procedure do_driftlon();
-procedure do_editlistselection();
-procedure do_end();
-procedure do_event();
-procedure do_expose();
-procedure do_filelist_remove();
-procedure do_fileselection_cancel();
-procedure do_fileselection_filter();
-procedure do_fileselection_nomatch();
-procedure do_fileselection_ok();
-procedure do_flag();
-procedure do_forward();
-procedure do_interpolation();
-procedure do_interpolationrepeats();
-procedure do_meantimewindow();
-procedure do_model_mode();
-procedure do_modeling_apply();
-procedure do_nextbuffer();
-procedure do_offset_apply();
-procedure do_resize();
-procedure do_reverse();
-procedure do_revert();
-procedure do_set_interval();
-procedure do_showall();
-procedure do_start();
-procedure do_timeinterpolation_apply();
-procedure do_timespan();
-procedure do_timestep();
-procedure do_toggle_deselect();
-procedure do_toggle_deselectall();
-procedure do_toggle_dr_lat();
-procedure do_toggle_dr_lon();
-procedure do_toggle_heading();
-procedure do_toggle_lat();
-procedure do_toggle_lon();
-procedure do_toggle_org_heading();
-procedure do_toggle_org_lat();
-procedure do_toggle_org_lon();
-procedure do_toggle_org_sonardepth();
-procedure do_toggle_org_speed();
-procedure do_toggle_org_time();
-procedure do_toggle_output_off();
-procedure do_toggle_output_off_filelist();
-procedure do_toggle_output_on();
-procedure do_toggle_output_on_filelist();
-procedure do_toggle_pick();
-procedure do_toggle_select();
-procedure do_toggle_selectall();
-procedure do_toggle_show_cmg();
-procedure do_toggle_show_smg();
-procedure do_toggle_sonardepth();
-procedure do_toggle_speed();
-procedure do_toggle_time();
-procedure do_toggle_vru();
-procedure do_unflag();
-procedure do_useprevious_no();
-procedure do_useprevious_yes();
-
-list BaseStyle : arguments {
-};
-
-list BaseStyleReasons : callbacks {
-};
-
-!(BX)list BaseStyleHandlers : handlers {
-!(BX)};
-
-list Style_use : arguments {
-        arguments BaseStyle;
-        XmNfontList = font_table(
-		font('-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1'));
-};
-
-list Style_useReasons : callbacks {
-        callbacks BaseStyleReasons;
-};
-
-!(BX)list Style_useHandlers : handlers {
-!(BX)    handlers BaseStyleHandlers;
-!(BX)};
-
-
-object list_filelist : XmList widget {
-    arguments {
-        arguments Style_use;
-        XmNfontList = font_table(
-		font('-*-courier-*-r-*-*-*-90-*-*-*-*-iso8859-1'));
-        XmNselectionPolicy = XmSINGLE_SELECT;
-        XmNwidth = 339;
-        XmNheight = 450;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_list_filelist);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object scrolledWindow_filelist : XmScrolledWindow widget {
-    arguments {
-        arguments Style_use;
-        XmNscrollingPolicy = XmAPPLICATION_DEFINED;
-        XmNtopAttachment = XmATTACH_WIDGET;
-        XmNrightAttachment = XmATTACH_FORM;
-        XmNleftAttachment = XmATTACH_FORM;
-        XmNbottomAttachment = XmATTACH_WIDGET;
-        XmNbottomOffset = 10;
-        XmNbottomWidget = XmPushButton pushButton_filelist_remove;
-        XmNleftOffset = 0;
-        XmNrightOffset = 4;
-        XmNtopOffset = 6;
-        XmNtopWidget = XmRowColumn setting_output_filelist;
-        XmNx = 0;
-        XmNy = 50;
-        XmNwidth = 339;
-        XmNheight = 450;
-    };
-    controls {
-         managed XmList list_filelist;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object pushButton_filelist_dismiss : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Dismiss");
-        XmNrecomputeSize = false;
-        XmNtopAttachment = XmATTACH_NONE;
-        XmNrightAttachment = XmATTACH_FORM;
-        XmNleftAttachment = XmATTACH_NONE;
-        XmNbottomAttachment = XmATTACH_FORM;
-        XmNbottomOffset = 10;
-        XmNrightOffset = 13;
-        XmNx = 250;
-        XmNy = 510;
-        XmNwidth = 80;
-        XmNheight = 60;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNactivateCallback = procedure BxUnmanageCB("form_filelist");
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object toggleButton_output_on_filelist : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Output Edits");
-        XmNwidth = 116;
-        XmNheight = 28;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_toggleButton_output_on_filelist);
-        XmNvalueChangedCallback = procedure do_toggle_output_on_filelist();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object toggleButton_output_off_filelist : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Browse Only");
-        XmNwidth = 116;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_toggleButton_output_off_filelist);
-        XmNvalueChangedCallback = procedure do_toggle_output_off_filelist();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object setting_output_filelist : XmRowColumn widget {
-    arguments {
-        arguments Style_use;
-        XmNnumColumns = 1;
-        XmNpacking = XmPACK_COLUMN;
-        XmNradioBehavior = true;
-        XmNspacing = 0;
-        XmNorientation = XmHORIZONTAL;
-        XmNtopAttachment = XmATTACH_FORM;
-        XmNrightAttachment = XmATTACH_NONE;
-        XmNleftAttachment = XmATTACH_WIDGET;
-        XmNbottomAttachment = XmATTACH_NONE;
-        XmNbottomOffset = 0;
-        XmNleftOffset = 3;
-        XmNtopOffset = 10;
-        XmNleftWidget = XmLabel setting_output_label_filelist;
-        XmNx = 110;
-        XmNy = 10;
-        XmNwidth = 238;
-        XmNheight = 34;
-    };
-    controls {
-         managed XmToggleButton toggleButton_output_on_filelist;
-         managed XmToggleButton toggleButton_output_off_filelist;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object setting_output_label_filelist : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Output Mode:");
-        XmNmarginWidth = 0;
-        XmNrightAttachment = XmATTACH_NONE;
-        XmNleftAttachment = XmATTACH_FORM;
-        XmNleftOffset = 10;
-        XmNtopOffset = 10;
-        XmNx = 10;
-        XmNy = 10;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object pushButton_filelist_edit : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Edit", separate=true) &
- compound_string("Selected", separate=true) &
- compound_string("File");
-        XmNrecomputeSize = false;
-        XmNtopAttachment = XmATTACH_NONE;
-        XmNleftAttachment = XmATTACH_FORM;
-        XmNbottomAttachment = XmATTACH_FORM;
-        XmNbottomOffset = 10;
-        XmNleftOffset = 10;
-        XmNx = 10;
-        XmNy = 510;
-        XmNwidth = 90;
-        XmNheight = 60;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNactivateCallback = procedure do_editlistselection();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object pushButton_filelist_remove : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Remove", separate=true) &
- compound_string("Selected", separate=true) &
- compound_string("File");
-        XmNrecomputeSize = false;
-        XmNtopAttachment = XmATTACH_NONE;
-        XmNrightAttachment = XmATTACH_NONE;
-        XmNleftAttachment = XmATTACH_WIDGET;
-        XmNbottomAttachment = XmATTACH_FORM;
-        XmNbottomOffset = 10;
-        XmNleftOffset = 10;
-        XmNleftWidget = XmPushButton pushButton_filelist_edit;
-        XmNx = 110;
-        XmNy = 510;
-        XmNwidth = 104;
-        XmNheight = 60;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNactivateCallback = procedure do_filelist_remove();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object form_filelist : XmFormDialog widget {
-    arguments {
-        arguments Style_use;
-        XmNdialogTitle = compound_string("Files Available for Editing");
-        XmNautoUnmanage = false;
-        XmNresizePolicy = XmRESIZE_GROW;
-        XmNx = 1109;
-        XmNy = 1047;
-        XmNwidth = 343;
-        XmNheight = 580;
-    };
-    controls {
-         managed XmPushButton pushButton_filelist_remove;
-         managed XmPushButton pushButton_filelist_edit;
-         managed XmLabel setting_output_label_filelist;
-         managed XmRowColumn setting_output_filelist;
-         managed XmPushButton pushButton_filelist_dismiss;
-         managed XmScrolledWindow scrolledWindow_filelist;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-!(BX)object dialogShell_filelist : XmDialogShell widget {
-!(BX)    arguments {
-!(BX)        arguments Style_use;
-!(BX)        XmNwidth = 343;
-!(BX)        XmNheight = 580;
-!(BX)    };
-!(BX)    controls {
-!(BX)         managed XmFormDialog form_filelist;
-!(BX)    };
-!(BX)    callbacks {
-!(BX)        callbacks Style_useReasons;
-!(BX)    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-!(BX)};
-
-object label_offset_lon : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_END;
-        XmNlabelString = compound_string("Longitude Offset (degrees):");
-        XmNleftAttachment = XmATTACH_FORM;
-        XmNleftOffset = 10;
-        XmNtopOffset = 10;
-        XmNx = 10;
-        XmNy = 10;
-        XmNwidth = 220;
-        XmNheight = 40;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object label_offset_lat : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_END;
-        XmNlabelString = compound_string("Latitude Offset (degrees):");
-        XmNtopAttachment = XmATTACH_WIDGET;
-        XmNleftAttachment = XmATTACH_FORM;
-        XmNbottomAttachment = XmATTACH_NONE;
-        XmNbottomOffset = 0;
-        XmNleftOffset = 0;
-        XmNtopOffset = 10;
-        XmNtopWidget = XmLabel label_offset_lon;
-        XmNx = 0;
-        XmNy = 60;
-        XmNwidth = 230;
-        XmNheight = 40;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object textField_lon_offset : XmTextField widget {
-    arguments {
-        arguments Style_use;
-        XmNrightAttachment = XmATTACH_FORM;
-        XmNleftAttachment = XmATTACH_WIDGET;
-        XmNleftOffset = 10;
-        XmNrightOffset = 12;
-        XmNtopOffset = 10;
-        XmNleftWidget = XmLabel label_offset_lon;
-        XmNx = 240;
-        XmNy = 10;
-        XmNwidth = 149;
-        XmNheight = 40;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_textField_lon_offset);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object textField_lat_offset : XmTextField widget {
-    arguments {
-        arguments Style_use;
-        XmNtopAttachment = XmATTACH_WIDGET;
-        XmNrightAttachment = XmATTACH_FORM;
-        XmNleftAttachment = XmATTACH_FORM;
-        XmNbottomAttachment = XmATTACH_NONE;
-        XmNbottomOffset = 0;
-        XmNleftOffset = 240;
-        XmNrightOffset = 12;
-        XmNtopOffset = 10;
-        XmNtopWidget = XmTextField textField_lon_offset;
-        XmNx = 240;
-        XmNy = 60;
-        XmNwidth = 149;
-        XmNheight = 40;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_textField_lat_offset);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object pushButton_offset_apply : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Apply");
-        XmNtopAttachment = XmATTACH_NONE;
-        XmNrightAttachment = XmATTACH_WIDGET;
-        XmNleftAttachment = XmATTACH_FORM;
-        XmNbottomAttachment = XmATTACH_FORM;
-        XmNbottomOffset = 14;
-        XmNleftOffset = 50;
-        XmNrightOffset = 50;
-        XmNrightWidget = XmPushButton pushButton_offset_dismiss;
-        XmNx = 50;
-        XmNy = 120;
-        XmNwidth = 110;
-        XmNheight = 40;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_pushButton_offset_apply);
-        XmNactivateCallback = procedure do_offset_apply();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object pushButton_offset_dismiss : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Dismiss");
-        XmNtopAttachment = XmATTACH_NONE;
-        XmNrightAttachment = XmATTACH_FORM;
-        XmNleftAttachment = XmATTACH_FORM;
-        XmNbottomAttachment = XmATTACH_FORM;
-        XmNbottomOffset = 14;
-        XmNleftOffset = 210;
-        XmNrightOffset = 73;
-        XmNx = 210;
-        XmNy = 120;
-        XmNwidth = 118;
-        XmNheight = 40;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_pushButton_offset_dismiss);
-        XmNactivateCallback = procedure BxUnmanageCB("form_offset");
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object form_offset : XmFormDialog widget {
-    arguments {
-        arguments Style_use;
-        XmNdialogTitle = compound_string("Position Offset");
-        XmNresizePolicy = XmRESIZE_GROW;
-        XmNx = 1080;
-        XmNy = 1250;
-        XmNwidth = 401;
-        XmNheight = 174;
-    };
-    controls {
-         managed XmPushButton pushButton_offset_dismiss;
-         managed XmPushButton pushButton_offset_apply;
-         managed XmTextField textField_lat_offset;
-         managed XmTextField textField_lon_offset;
-         managed XmLabel label_offset_lat;
-         managed XmLabel label_offset_lon;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-!(BX)object xmDialogShell_offset : XmDialogShell widget {
-!(BX)    arguments {
-!(BX)        arguments Style_use;
-!(BX)        XmNwidth = 401;
-!(BX)        XmNheight = 174;
-!(BX)    };
-!(BX)    controls {
-!(BX)         managed XmFormDialog form_offset;
-!(BX)    };
-!(BX)    callbacks {
-!(BX)        callbacks Style_useReasons;
-!(BX)    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-!(BX)};
-
-object pushButton_deletebadtimetag_apply : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Apply");
-        XmNx = 20;
-        XmNy = 80;
-        XmNwidth = 130;
-        XmNheight = 50;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-       XmNactivateCallback = procedures {
-                 do_deletebadtimetag_apply();
-                 BxUnmanageCB("bulletinBoard_timeinterpolation" &
- "");
-        };
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object pushButton_deletebadtimetag_dismiss : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Dismiss");
-        XmNx = 160;
-        XmNy = 80;
-        XmNwidth = 130;
-        XmNheight = 50;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNactivateCallback = procedure BxUnmanageCB("bulletinBoard_deletebadtimetag");
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object label_deletetimetag : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Click \"Apply\" to delete duplic" &
- "ate ", separate=true) &
- compound_string("or reverse time stamps. Non-duplicate ", separate=true) &
- compound_string("time stamps will not be affected.");
-        XmNx = 10;
-        XmNy = 10;
-        XmNwidth = 290;
-        XmNheight = 70;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object bulletinBoard_deletebadtimetag : XmBulletinBoardDialog widget {
-    arguments {
-        arguments Style_use;
-        XmNautoUnmanage = false;
-        XmNresizePolicy = XmRESIZE_GROW;
-        XmNx = 1126;
-        XmNy = 1262;
-        XmNwidth = 310;
-        XmNheight = 149;
-    };
-    controls {
-         managed XmLabel label_deletetimetag;
-         managed XmPushButton pushButton_deletebadtimetag_dismiss;
-         managed XmPushButton pushButton_deletebadtimetag_apply;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_bulletinBoard_deletebadtimetag);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-!(BX)object dialogShell_deletebadtimetag : XmDialogShell widget {
-!(BX)    arguments {
-!(BX)        arguments Style_use;
-!(BX)        XmNtitle = "Delete Bad Times";
-!(BX)        XmNwidth = 310;
-!(BX)        XmNheight = 149;
-!(BX)    };
-!(BX)    controls {
-!(BX)         managed XmBulletinBoardDialog bulletinBoard_deletebadtimetag;
-!(BX)    };
-!(BX)    callbacks {
-!(BX)        callbacks Style_useReasons;
-!(BX)    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-!(BX)};
-
-object pushButton_timeinterpolation_apply : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Apply");
-        XmNx = 20;
-        XmNy = 80;
-        XmNwidth = 130;
-        XmNheight = 50;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-       XmNactivateCallback = procedures {
-                 do_timeinterpolation_apply();
-                 BxUnmanageCB("bulletinBoard_timeinterpolation" &
- "");
-        };
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object pushButton_timeinterpolation_dismiss : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Dismiss");
-        XmNx = 160;
-        XmNy = 80;
-        XmNwidth = 130;
-        XmNheight = 50;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNactivateCallback = procedure BxUnmanageCB("bulletinBoard_timeinterpolation" &
- "");
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object label_timeinterpolation : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Click \"Apply\" to interpolate d" &
- "uplicate ", separate=true) &
- compound_string("time stamps. Non-duplicate time stamps ", separate=true) &
- compound_string("will not be affected.");
-        XmNx = 10;
-        XmNy = 10;
-        XmNwidth = 290;
-        XmNheight = 70;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object bulletinBoard_timeinterpolation : XmBulletinBoardDialog widget {
-    arguments {
-        arguments Style_use;
-        XmNautoUnmanage = false;
-        XmNresizePolicy = XmRESIZE_GROW;
-        XmNx = 1127;
-        XmNy = 1262;
-        XmNwidth = 307;
-        XmNheight = 149;
-    };
-    controls {
-         managed XmLabel label_timeinterpolation;
-         managed XmPushButton pushButton_timeinterpolation_dismiss;
-         managed XmPushButton pushButton_timeinterpolation_apply;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_bulletinBoard_timeinterpolation);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-!(BX)object xmDialogShell_timeinterpolation : XmDialogShell widget {
-!(BX)    arguments {
-!(BX)        arguments Style_use;
-!(BX)        XmNtitle = "Time Interpolation";
-!(BX)        XmNwidth = 307;
-!(BX)        XmNheight = 149;
-!(BX)    };
-!(BX)    controls {
-!(BX)         managed XmBulletinBoardDialog bulletinBoard_timeinterpolation;
-!(BX)    };
-!(BX)    callbacks {
-!(BX)        callbacks Style_useReasons;
-!(BX)    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-!(BX)};
-
-object pushButton_useprevious_yes : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Yes");
-        XmNx = 110;
-        XmNy = 70;
-        XmNwidth = 110;
-        XmNheight = 40;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNactivateCallback = procedure do_useprevious_yes();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object pushButton_useprevious_no : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("No");
-        XmNx = 290;
-        XmNy = 70;
-        XmNwidth = 110;
-        XmNheight = 40;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNactivateCallback = procedure do_useprevious_no();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object label_useprevious : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Previously edited navigation exi" &
- "sts for the specified input file.", separate=true) &
- compound_string("Do you want to use the previously edited navigation?");
-        XmNx = 10;
-        XmNy = 10;
-        XmNwidth = 480;
-        XmNheight = 50;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object bulletinBoard_useprevious : XmBulletinBoardDialog widget {
-    arguments {
-        arguments Style_use;
-        XmNdialogTitle = compound_string("Use previously edited navigation" &
- "?");
-        XmNautoUnmanage = true;
-        XmNresizePolicy = XmRESIZE_GROW;
-        XmNx = 1029;
-        XmNy = 1274;
-        XmNwidth = 503;
-        XmNheight = 126;
-    };
-    controls {
-         managed XmLabel label_useprevious;
-         managed XmPushButton pushButton_useprevious_no;
-         managed XmPushButton pushButton_useprevious_yes;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_bulletinBoard_useprevious);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-!(BX)object xmDialogShell_useprevious : XmDialogShell widget {
-!(BX)    arguments {
-!(BX)        arguments Style_use;
-!(BX)        XmNwidth = 503;
-!(BX)        XmNheight = 126;
-!(BX)    };
-!(BX)    controls {
-!(BX)         managed XmBulletinBoardDialog bulletinBoard_useprevious;
-!(BX)    };
-!(BX)    callbacks {
-!(BX)        callbacks Style_useReasons;
-!(BX)    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-!(BX)};
-
-object toggleButton_modeling_off : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Off");
-        XmNwidth = 48;
-        XmNheight = 28;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_toggleButton_modeling_off);
-        XmNvalueChangedCallback = procedure do_model_mode();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object toggleButton_modeling_meanfilter : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Gaussian Mean");
-        XmNwidth = 135;
-        XmNheight = 28;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_toggleButton_modeling_meanfilter);
-        XmNvalueChangedCallback = procedure do_model_mode();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object toggleButton_modeling_dr : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Dead Reckoning");
-        XmNwidth = 143;
-        XmNheight = 28;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_toggleButton_modeling_dr);
-        XmNvalueChangedCallback = procedure do_model_mode();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object toggleButton_modeling_inversion : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Inversion");
-        XmNwidth = 93;
-        XmNheight = 28;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_toggleButton_modeling_inversion);
-        XmNvalueChangedCallback = procedure do_model_mode();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object radioBox_modeling : XmRadioBox widget {
-    arguments {
-        arguments Style_use;
-        XmNpacking = XmPACK_TIGHT;
-        XmNorientation = XmHORIZONTAL;
-        XmNx = 20;
-        XmNy = 40;
-        XmNwidth = 434;
-        XmNheight = 34;
-    };
-    controls {
-         managed XmToggleButton toggleButton_modeling_off;
-         managed XmToggleButton toggleButton_modeling_meanfilter;
-         managed XmToggleButton toggleButton_modeling_dr;
-         managed XmToggleButton toggleButton_modeling_inversion;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object label_modeling_mode : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNlabelString = compound_string("Navigation Modeling Mode:");
-        XmNx = 10;
-        XmNy = 10;
-        XmNwidth = 200;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object separator2 : XmSeparator widget {
-    arguments {
-        XmNx = 10;
-        XmNy = 160;
-        XmNwidth = 470;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-    };
-};
-
-object scale_driftlon : XmScale widget {
-    arguments {
-        arguments Style_use;
-        XmNminimum = -1000;
-        XmNdecimalPoints = 5;
-        XmNtitleString = compound_string("Dead Reckoning Longitude Drift (" &
- "deg/hr)");
-        XmNmaximum = 1000;
-        XmNshowArrows = TRUE;
-        XmNshowValue = TRUE;
-        XmNorientation = XmHORIZONTAL;
-        XmNx = 10;
-        XmNy = 180;
-        XmNwidth = 470;
-        XmNheight = 63;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_scale_driftlon);
-        XmNvalueChangedCallback = procedure do_driftlon();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object scale_driftlat : XmScale widget {
-    arguments {
-        arguments Style_use;
-        XmNminimum = -1000;
-        XmNdecimalPoints = 5;
-        XmNtitleString = compound_string("Dead Reckoning Latitude Drift (d" &
- "eg/hr)");
-        XmNmaximum = 1000;
-        XmNshowArrows = TRUE;
-        XmNshowValue = TRUE;
-        XmNorientation = XmHORIZONTAL;
-        XmNx = 10;
-        XmNy = 250;
-        XmNwidth = 470;
-        XmNheight = 63;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_scale_driftlat);
-        XmNvalueChangedCallback = procedure do_driftlat();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object separator3 : XmSeparator widget {
-    arguments {
-        XmNx = 10;
-        XmNy = 310;
-        XmNwidth = 470;
-        XmNheight = 20;
-    };
-    controls {
-    };
-    callbacks {
-    };
-};
-
-object pushButton_modeling_dismiss : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Dismiss");
-        XmNx = 190;
-        XmNy = 490;
-        XmNwidth = 110;
-        XmNheight = 40;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNactivateCallback = procedure BxUnmanageCB("bulletinBoard_modeling");
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object textField_modeling_speed : XmTextField widget {
-    arguments {
-        arguments Style_use;
-        XmNx = 320;
-        XmNy = 360;
-        XmNwidth = 140;
-        XmNheight = 40;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_textField_modeling_speed);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object textField_modeling_acceleration : XmTextField widget {
-    arguments {
-        arguments Style_use;
-        XmNx = 320;
-        XmNy = 410;
-        XmNwidth = 140;
-        XmNheight = 40;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_textField_modeling_acceleration);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object label_modeling_inversion : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNlabelString = compound_string("Inversion Penalty Weighting:");
-        XmNx = 10;
-        XmNy = 330;
-        XmNwidth = 220;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object label_modeling_speed : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_END;
-        XmNlabelString = compound_string("Speed Deviation:");
-        XmNx = 170;
-        XmNy = 360;
-        XmNwidth = 140;
-        XmNheight = 40;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object label_modeling_acceleration : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_END;
-        XmNlabelString = compound_string("Acceleration:");
-        XmNx = 160;
-        XmNy = 410;
-        XmNwidth = 150;
-        XmNheight = 40;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object separator4 : XmSeparator widget {
-    arguments {
-        XmNx = 10;
-        XmNy = 450;
-        XmNwidth = 470;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-    };
-};
-
-object pushButton_modeling_apply : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Apply");
-        XmNx = 30;
-        XmNy = 390;
-        XmNwidth = 110;
-        XmNheight = 40;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNactivateCallback = procedure do_modeling_apply();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object separator5 : XmSeparator widget {
-    arguments {
-        XmNx = 10;
-        XmNy = 70;
-        XmNwidth = 470;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-    };
-};
-
-object scale_meantimewindow : XmScale widget {
-    arguments {
-        arguments Style_use;
-        XmNminimum = 1;
-        XmNdecimalPoints = 1;
-        XmNvalue = 100;
-        XmNtitleString = compound_string("Gaussian Mean Time Window (secon" &
- "ds)");
-        XmNmaximum = 10000;
-        XmNshowArrows = TRUE;
-        XmNscaleMultiple = 1;
-        XmNshowValue = TRUE;
-        XmNorientation = XmHORIZONTAL;
-        XmNx = 10;
-        XmNy = 100;
-        XmNwidth = 470;
-        XmNheight = 63;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_scale_meantimewindow);
-        XmNvalueChangedCallback = procedure do_meantimewindow();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object bulletinBoard_modeling : XmBulletinBoardDialog widget {
-    arguments {
-        arguments Style_use;
-        XmNdialogTitle = compound_string("Navigation Modeling");
-        XmNautoUnmanage = false;
-        XmNresizePolicy = XmRESIZE_GROW;
-        XmNx = 1035;
-        XmNy = 1063;
-        XmNwidth = 492;
-        XmNheight = 548;
-    };
-    controls {
-         managed XmScale scale_meantimewindow;
-         managed XmSeparator separator5;
-         managed XmPushButton pushButton_modeling_apply;
-         managed XmSeparator separator4;
-         managed XmLabel label_modeling_acceleration;
-         managed XmLabel label_modeling_speed;
-         managed XmLabel label_modeling_inversion;
-         managed XmTextField textField_modeling_acceleration;
-         managed XmTextField textField_modeling_speed;
-         managed XmPushButton pushButton_modeling_dismiss;
-         managed XmSeparator separator3;
-         managed XmScale scale_driftlat;
-         managed XmScale scale_driftlon;
-         managed XmSeparator separator2;
-         managed XmLabel label_modeling_mode;
-         managed XmRadioBox radioBox_modeling;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-!(BX)object xmDialogShell_modeling : XmDialogShell widget {
-!(BX)    arguments {
-!(BX)        arguments Style_use;
-!(BX)        XmNtitle = "Navigation Modeling";
-!(BX)        XmNwidth = 492;
-!(BX)        XmNheight = 548;
-!(BX)    };
-!(BX)    controls {
-!(BX)         managed XmBulletinBoardDialog bulletinBoard_modeling;
-!(BX)    };
-!(BX)    callbacks {
-!(BX)        callbacks Style_useReasons;
-!(BX)    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-!(BX)};
-
-object label_timespan_1 : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_END;
-        XmNfontList = font_table(
-		font('-*-helvetica-bold-r-*-*-*-120-75-75-p-*-iso8859-1'));
-        XmNlabelString = compound_string("TIme Span Shown (sec):  1");
-        XmNrecomputeSize = false;
-        XmNx = 10;
-        XmNy = 30;
-        XmNwidth = 170;
-        XmNheight = 20;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_label_timespan_1);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object scale_timespan : XmScale widget {
-    arguments {
-        arguments Style_use;
-        XmNtitleString = compound_string(" ");
-        XmNfontList = font_table(
-		font('-*-helvetica-bold-r-*-*-*-120-75-75-p-*-iso8859-1'));
-        XmNorientation = XmHORIZONTAL;
-        XmNstringDirection = XmSTRING_DIRECTION_L_TO_R;
-        XmNx = 180;
-        XmNy = 10;
-        XmNwidth = 260;
-        XmNheight = 50;
-    };
-    controls {
-        Xm_Title {
-            arguments {
-                arguments Style_use;
-            };
-            callbacks {
-                    callbacks Style_useReasons;
-            };
-!(BX)            handlers {
-!(BX)                handlers Style_useHandlers;
-!(BX)            };
-        };
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_scale_timespan);
-        XmNvalueChangedCallback = procedure do_timespan();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object label_timespan_2 : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNfontList = font_table(
-		font('-*-helvetica-bold-r-*-*-*-120-75-75-p-*-iso8859-1'));
-        XmNlabelString = compound_string("500");
-        XmNrecomputeSize = false;
-        XmNx = 440;
-        XmNy = 30;
-        XmNwidth = 40;
-        XmNheight = 20;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_label_timespan_2);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object label_timestep_1 : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_END;
-        XmNfontList = font_table(
-		font('-*-helvetica-bold-r-*-*-*-120-75-75-p-*-iso8859-1'));
-        XmNlabelString = compound_string("Time Step (sec):  1");
-        XmNrecomputeSize = false;
-        XmNx = 10;
-        XmNy = 90;
-        XmNwidth = 170;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_label_timestep_1);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object scale_timestep : XmScale widget {
-    arguments {
-        arguments Style_use;
-        XmNfontList = font_table(
-		font('-*-helvetica-bold-r-*-*-*-120-75-75-p-*-iso8859-1'));
-        XmNorientation = XmHORIZONTAL;
-        XmNx = 180;
-        XmNy = 70;
-        XmNwidth = 260;
-        XmNheight = 50;
-    };
-    controls {
-        Xm_Title {
-            arguments {
-                arguments Style_use;
-            };
-            callbacks {
-                    callbacks Style_useReasons;
-            };
-!(BX)            handlers {
-!(BX)                handlers Style_useHandlers;
-!(BX)            };
-        };
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_scale_timestep);
-        XmNvalueChangedCallback = procedure do_timestep();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object label_timestep_2 : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNfontList = font_table(
-		font('-*-helvetica-bold-r-*-*-*-120-75-75-p-*-iso8859-1'));
-        XmNlabelString = compound_string("500");
-        XmNrecomputeSize = false;
-        XmNx = 440;
-        XmNy = 70;
-        XmNwidth = 40;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_label_timestep_2);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object pushButton_timestepping_dismiss : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Dismiss");
-        XmNx = 200;
-        XmNy = 140;
-        XmNwidth = 110;
-        XmNheight = 40;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNactivateCallback = procedure BxUnmanageCB("bulletinBoard_timestepping");
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object bulletinBoard_timestepping : XmBulletinBoardDialog widget {
-    arguments {
-        arguments Style_use;
-        XmNdialogTitle = compound_string("Time Stepping");
-        XmNautoUnmanage = false;
-        XmNresizePolicy = XmRESIZE_GROW;
-        XmNx = 1035;
-        XmNy = 1239;
-        XmNwidth = 491;
-        XmNheight = 195;
-    };
-    controls {
-         managed XmPushButton pushButton_timestepping_dismiss;
-         managed XmLabel label_timestep_2;
-         managed XmScale scale_timestep;
-         managed XmLabel label_timestep_1;
-         managed XmLabel label_timespan_2;
-         managed XmScale scale_timespan;
-         managed XmLabel label_timespan_1;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-!(BX)object xmDialogShell_timestepping : XmDialogShell widget {
-!(BX)    arguments {
-!(BX)        arguments Style_use;
-!(BX)        XmNtitle = "Controls";
-!(BX)        XmNwidth = 491;
-!(BX)        XmNheight = 195;
-!(BX)    };
-!(BX)    controls {
-!(BX)         managed XmBulletinBoardDialog bulletinBoard_timestepping;
-!(BX)    };
-!(BX)    callbacks {
-!(BX)        callbacks Style_useReasons;
-!(BX)    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-!(BX)};
-
-object fileSelectionBox : XmFileSelectionBox widget {
-    arguments {
-        XmNdialogTitle = compound_string("");
-        XmNlistVisibleItemCount = 13;
-        XmNtextFontList = font_table(
-		font('-adobe-helvetica-bold-r-normal--14-140-75-75-p-82-iso8859-1'));
-        XmNlabelFontList = font_table(
-		font('-adobe-helvetica-bold-r-normal--14-140-75-75-p-82-iso8859-1'));
-        XmNbuttonFontList = font_table(
-		font('-adobe-helvetica-bold-r-normal--14-140-75-75-p-82-iso8859-1'));
-        XmNautoUnmanage = false;
-        XmNnoResize = true;
-        XmNresizePolicy = XmRESIZE_NONE;
-        XmNx = 10;
-        XmNy = 10;
-        XmNwidth = 590;
-        XmNheight = 470;
-    };
-    controls {
-    };
-    callbacks {
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_fileSelectionBox);
-       XmNokCallback = procedures {
-                 do_fileselection_ok();
-                 BxUnmanageCB("bulletinBoard_fileselection");
-        };
-        XmNnoMatchCallback = procedure do_fileselection_nomatch();
-       XmNcancelCallback = procedures {
-                 do_fileselection_cancel();
-                 BxUnmanageCB("bulletinBoard_fileselection");
-        };
-        XmNapplyCallback = procedure do_fileselection_filter();
-    };
-};
-
-object label_format : XmLabel widget {
-    arguments {
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNfontList = font_table(
-		font('-adobe-helvetica-bold-r-normal--14-140-75-75-p-82-iso8859-1'));
-        XmNlabelString = compound_string("MBIO Format ID:");
-        XmNrecomputeSize = false;
-        XmNx = 20;
-        XmNy = 480;
-        XmNwidth = 120;
-        XmNheight = 40;
-    };
-    controls {
-    };
-    callbacks {
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_label_format);
-    };
-};
-
-object textField_format : XmTextField widget {
-    arguments {
-        XmNfontList = font_table(
-		font('-adobe-helvetica-bold-r-normal--14-140-75-75-p-82-iso8859-1'));
-        XmNx = 140;
-        XmNy = 480;
-        XmNwidth = 100;
-        XmNheight = 35;
-    };
-    controls {
-    };
-    callbacks {
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_textField_format);
-    };
-};
-
-object toggleButton_output_on : XmToggleButton widget {
-    arguments {
-        XmNfontList = font_table(
-		font('-adobe-helvetica-bold-r-normal--14-140-75-75-p-82-iso8859-1'));
-        XmNlabelString = compound_string("Output Edited Data");
-        XmNwidth = 161;
-        XmNheight = 28;
-    };
-    controls {
-    };
-    callbacks {
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_toggleButton_output_on);
-        XmNvalueChangedCallback = procedure do_toggle_output_on();
-    };
-};
-
-object toggleButton_output_off : XmToggleButton widget {
-    arguments {
-        XmNfontList = font_table(
-		font('-adobe-helvetica-bold-r-normal--14-140-75-75-p-82-iso8859-1'));
-        XmNlabelString = compound_string("Browse Only");
-        XmNwidth = 161;
-        XmNheight = 28;
-    };
-    controls {
-    };
-    callbacks {
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_toggleButton_output_off);
-        XmNvalueChangedCallback = procedure do_toggle_output_off();
-    };
-};
-
-object radioBox_output : XmRadioBox widget {
-    arguments {
-        XmNx = 390;
-        XmNy = 480;
-        XmNwidth = 167;
-        XmNheight = 65;
-    };
-    controls {
-         managed XmToggleButton toggleButton_output_on;
-         managed XmToggleButton toggleButton_output_off;
-    };
-    callbacks {
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_radioBox_output);
-    };
-};
-
-object label_output_mode : XmLabel widget {
-    arguments {
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNfontList = font_table(
-		font('-adobe-helvetica-bold-r-normal--14-140-75-75-p-82-iso8859-1'));
-        XmNlabelString = compound_string("Output Mode:");
-        XmNrecomputeSize = false;
-        XmNx = 290;
-        XmNy = 480;
-        XmNwidth = 100;
-        XmNheight = 40;
-    };
-    controls {
-    };
-    callbacks {
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_label_output_mode);
-    };
-};
-
-object bulletinBoard_fileselection : XmBulletinBoardDialog widget {
-    arguments {
-        XmNresizePolicy = XmRESIZE_NONE;
-        XmNx = 0;
-        XmNy = 1058;
-        XmNwidth = 606;
-        XmNheight = 557;
-    };
-    controls {
-         managed XmLabel label_output_mode;
-         managed XmRadioBox radioBox_output;
-         managed XmTextField textField_format;
-         managed XmLabel label_format;
-         managed XmFileSelectionBox fileSelectionBox;
-    };
-    callbacks {
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_bulletinBoard_fileselection);
-    };
-};
-
-!(BX)object xmDialogShell_fileselection : XmDialogShell widget {
-!(BX)    arguments {
-!(BX)        XmNtitle = "Select Input Data File";
-!(BX)        XmNallowShellResize = false;
-!(BX)        XmNwidth = 606;
-!(BX)        XmNheight = 557;
-!(BX)    };
-!(BX)    controls {
-!(BX)         managed XmBulletinBoardDialog bulletinBoard_fileselection;
-!(BX)    };
-!(BX)    callbacks {
-!(BX)        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_xmDialogShell_fileselection);
-!(BX)    };
-!(BX)};
-
-object pushButton_error : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("OK");
-        XmNx = 110;
-        XmNy = 110;
-        XmNwidth = 90;
-        XmNheight = 40;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object label_error_three : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("permission in this directory!");
-        XmNrecomputeSize = false;
-        XmNx = 10;
-        XmNy = 70;
-        XmNwidth = 290;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_label_error_three);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object label_error_one : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Unable to open output file.");
-        XmNrecomputeSize = false;
-        XmNx = 10;
-        XmNy = 10;
-        XmNwidth = 290;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_label_error_one);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object label_error_two : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("You probably do not have write");
-        XmNrecomputeSize = false;
-        XmNx = 10;
-        XmNy = 40;
-        XmNwidth = 290;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_label_error_two);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object bulletinBoard_error : XmBulletinBoardDialog widget {
-    arguments {
-        arguments Style_use;
-        XmNdialogStyle = XmDIALOG_APPLICATION_MODAL;
-        XmNresizePolicy = XmRESIZE_GROW;
-        XmNx = 1125;
-        XmNy = 1256;
-        XmNwidth = 311;
-        XmNheight = 161;
-    };
-    controls {
-         managed XmLabel label_error_two;
-         managed XmLabel label_error_one;
-         managed XmLabel label_error_three;
-         managed XmPushButton pushButton_error;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_bulletinBoard_error);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-!(BX)object xmDialogShell_error : XmDialogShell widget {
-!(BX)    arguments {
-!(BX)        XmNtitle = "Error";
-!(BX)        XmNwidth = 311;
-!(BX)        XmNheight = 161;
-!(BX)    };
-!(BX)    controls {
-!(BX)         managed XmBulletinBoardDialog bulletinBoard_error;
-!(BX)    };
-!(BX)    callbacks {
-!(BX)    };
-!(BX)};
-
-object label_message : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNlabelString = compound_string("MBvelocitytool is loading data.." &
- ".");
-        XmNx = 10;
-        XmNy = 10;
-        XmNwidth = 360;
-        XmNheight = 20;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_label_message);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object label_pleasewait : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNlabelString = compound_string("Thank you for your patience.");
-        XmNrecomputeSize = false;
-        XmNx = 10;
-        XmNy = 40;
-        XmNwidth = 360;
-        XmNheight = 20;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object bulletinBoard_message : XmBulletinBoardDialog widget {
-    arguments {
-        arguments Style_use;
-        XmNdialogStyle = XmDIALOG_FULL_APPLICATION_MODAL;
-        XmNresizePolicy = XmRESIZE_NONE;
-        XmNx = 1091;
-        XmNy = 1294;
-        XmNwidth = 379;
-        XmNheight = 86;
-    };
-    controls {
-         managed XmLabel label_pleasewait;
-         managed XmLabel label_message;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_bulletinBoard_message);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-!(BX)object xmDialogShell_message : XmDialogShell widget {
-!(BX)    arguments {
-!(BX)        arguments Style_use;
-!(BX)        XmNtitle = "Please Wait...";
-!(BX)        XmNmwmInputMode = MWM_INPUT_MODELESS;
-!(BX)        XmNdeleteResponse = XmUNMAP;
-!(BX)        XmNwidth = 379;
-!(BX)        XmNheight = 86;
-!(BX)    };
-!(BX)    controls {
-!(BX)         managed XmBulletinBoardDialog bulletinBoard_message;
-!(BX)    };
-!(BX)    callbacks {
-!(BX)        callbacks Style_useReasons;
-!(BX)    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-!(BX)};
-
-object label_about_mbedit : XmLabel widget {
-    arguments {
-        XmNfontList = font_table(
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1'));
-        XmNlabelString = compound_string("MBnavedit");
-        XmNx = 10;
-        XmNy = 10;
-        XmNwidth = 450;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-    };
-};
-
-object label_about_function : XmLabel widget {
-    arguments {
-        XmNfontList = font_table(
-		font('-*-times-bold-r-*-*-*-180-*-*-*-*-iso8859-1'));
-        XmNlabelString = compound_string("Interactive Navigation Editor");
-        XmNx = 10;
-        XmNy = 40;
-        XmNwidth = 450;
-        XmNheight = 23;
-    };
-    controls {
-    };
-    callbacks {
-    };
-};
-
-object label_about_version : XmLabel widget {
-    arguments {
-        XmNfontList = font_table(
-		font('-*-times-medium-r-*-*-*-140-*-*-*-*-iso8859-1'));
-        XmNlabelString = compound_string("MB-System Release 4.6", separate=true) &
- compound_string("April 14, 1999");
-        XmNrecomputeSize = false;
-        XmNx = 10;
-        XmNy = 360;
-        XmNwidth = 450;
-        XmNheight = 60;
-    };
-    controls {
-    };
-    callbacks {
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_label_about_version);
-    };
-};
-
-object separator : XmSeparator widget {
-    arguments {
-        XmNx = 10;
-        XmNy = 70;
-        XmNwidth = 450;
-        XmNheight = 20;
-    };
-    controls {
-    };
-    callbacks {
-    };
-};
-
-object label_about_for : XmLabel widget {
-    arguments {
-        XmNfontList = font_table(
-		font('-*-times-bold-r-*-*-*-140-*-*-*-*-iso8859-1'));
-        XmNlabelString = compound_string("for Processing and Display of Sw" &
- "ath Sonar Data");
-        XmNx = 10;
-        XmNy = 190;
-        XmNwidth = 460;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-    };
-};
-
-object label_about_component : XmLabel widget {
-    arguments {
-        XmNfontList = font_table(
-		font('-*-times-bold-r-*-*-*-140-*-*-*-*-iso8859-1'));
-        XmNlabelString = compound_string("One Component of the");
-        XmNx = 10;
-        XmNy = 90;
-        XmNwidth = 450;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-    };
-};
-
-object label_about_mbpub : XmLabel widget {
-    arguments {
-        XmNfontList = font_table(
-		font('-*-times-bold-r-*-*-*-140-*-*-*-*-iso8859-1'));
-        XmNlabelString = compound_string("An Open Source Software Package");
-        XmNx = 10;
-        XmNy = 160;
-        XmNwidth = 450;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-    };
-};
-
-object label_about_mbsystem : XmLabel widget {
-    arguments {
-        XmNfontList = font_table(
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1'));
-        XmNlabelString = compound_string("MB-System");
-        XmNx = 10;
-        XmNy = 120;
-        XmNwidth = 450;
-        XmNheight = 38;
-    };
-    controls {
-    };
-    callbacks {
-    };
-};
-
-object label_about_columbia : XmLabel widget {
-    arguments {
-        XmNfontList = font_table(
-		font('-*-times-bold-r-*-*-*-120-*-*-*-*-iso8859-1'));
-        XmNlabelString = compound_string("Monterey Bay", separate=true) &
- compound_string("Aquarium", separate=true) &
- compound_string("Research Institute");
-        XmNx = 60;
-        XmNy = 290;
-        XmNwidth = 160;
-        XmNheight = 70;
-    };
-    controls {
-    };
-    callbacks {
-    };
-};
-
-object label_about_lamont : XmLabel widget {
-    arguments {
-        XmNfontList = font_table(
-		font('-*-times-bold-r-*-*-*-120-*-*-*-*-iso8859-1'));
-        XmNlabelString = compound_string("Lamont-Doherty ", separate=true) &
- compound_string("Earth Observatory", separate=true) &
- compound_string("of Columbia University");
-        XmNx = 250;
-        XmNy = 290;
-        XmNwidth = 190;
-        XmNheight = 70;
-    };
-    controls {
-    };
-    callbacks {
-    };
-};
-
-object label_about_create : XmLabel widget {
-    arguments {
-        XmNfontList = font_table(
-		font('-*-times-bold-r-*-*-*-140-*-*-*-*-iso8859-1'));
-        XmNlabelString = compound_string("Created by:");
-        XmNx = 10;
-        XmNy = 240;
-        XmNwidth = 450;
-        XmNheight = 20;
-    };
-    controls {
-    };
-    callbacks {
-    };
-};
-
-object pushButton_about_dismiss : XmPushButton widget {
-    arguments {
-        XmNfontList = font_table(
-		font('-*-times-bold-r-*-*-*-140-*-*-*-*-iso8859-1'));
-        XmNlabelString = compound_string("Dismiss");
-        XmNx = 190;
-        XmNy = 420;
-        XmNwidth = 90;
-        XmNheight = 35;
-    };
-    controls {
-    };
-    callbacks {
-        XmNactivateCallback = procedure BxUnmanageCB("bulletinBoard_about");
-    };
-};
-
-object separator1 : XmSeparator widget {
-    arguments {
-        XmNx = 10;
-        XmNy = 220;
-        XmNwidth = 450;
-        XmNheight = 20;
-    };
-    controls {
-    };
-    callbacks {
-    };
-};
-
-object label_about_create1 : XmLabel widget {
-    arguments {
-        XmNfontList = font_table(
-		font('-*-times-bold-r-*-*-*-140-*-*-*-*-iso8859-1'));
-        XmNlabelString = compound_string("David W. Caress    and    Dale N" &
- ". Chayes");
-        XmNx = 10;
-        XmNy = 260;
-        XmNwidth = 450;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-    };
-};
-
-object bulletinBoard_about : XmBulletinBoardDialog widget {
-    arguments {
-        XmNresizePolicy = XmRESIZE_GROW;
-        XmNx = 1040;
-        XmNy = 1104;
-        XmNwidth = 481;
-        XmNheight = 466;
-    };
-    controls {
-         managed XmLabel label_about_create1;
-         managed XmSeparator separator1;
-         managed XmPushButton pushButton_about_dismiss;
-         managed XmLabel label_about_create;
-         managed XmLabel label_about_lamont;
-         managed XmLabel label_about_columbia;
-         managed XmLabel label_about_mbsystem;
-         managed XmLabel label_about_mbpub;
-         managed XmLabel label_about_component;
-         managed XmLabel label_about_for;
-         managed XmSeparator separator;
-         managed XmLabel label_about_version;
-         managed XmLabel label_about_function;
-         managed XmLabel label_about_mbedit;
-    };
-    callbacks {
-    };
-};
-
-!(BX)object xmDialogShell_about : XmDialogShell widget {
-!(BX)    arguments {
-!(BX)        XmNtitle = "About MBnavedit";
-!(BX)        XmNdeleteResponse = XmUNMAP;
-!(BX)        XmNwidth = 481;
-!(BX)        XmNheight = 466;
-!(BX)    };
-!(BX)    controls {
-!(BX)         managed XmBulletinBoardDialog bulletinBoard_about;
-!(BX)    };
-!(BX)    callbacks {
-!(BX)    };
-!(BX)};
-
-object drawingArea : XmDrawingArea widget {
-    arguments {
-        arguments Style_use;
-        XmNborderWidth = 1;
-        XmNbackground = color('white');
-        XmNwidth = 767;
-        XmNheight = 2000;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_drawingArea);
-        XmNresizeCallback = procedure do_resize();
-        XmNinputCallback = procedure do_event();
-        XmNexposeCallback = procedure do_expose();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object scrolledWindow : XmScrolledWindow widget {
-    arguments {
-        arguments Style_use;
-        XmNscrollingPolicy = XmAUTOMATIC;
-        XmNx = 210;
-        XmNy = 80;
-        XmNwidth = 800;
-        XmNheight = 590;
-    };
-    controls {
-         managed XmDrawingArea drawingArea;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_scrolledWindow);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object toggleButton_lon : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNfontList = font_table(
-		font('-*-helvetica-bold-r-*-*-*-120-75-75-p-*-iso8859-1'));
-        XmNindicatorOn = XmINDICATOR_CHECK_BOX;
-        XmNlabelString = compound_string("Longitude Plot");
-        XmNstringDirection = XmSTRING_DIRECTION_L_TO_R;
-        XmNrecomputeSize = false;
-        XmNx = 10;
-        XmNy = 140;
-        XmNwidth = 140;
-        XmNheight = 20;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_toggleButton_lon);
-        XmNvalueChangedCallback = procedure do_toggle_lon();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object toggleButton_lat : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNfontList = font_table(
-		font('-*-helvetica-bold-r-*-*-*-120-75-75-p-*-iso8859-1'));
-        XmNindicatorOn = XmINDICATOR_CHECK_BOX;
-        XmNlabelString = compound_string("Latitude Plot");
-        XmNrecomputeSize = false;
-        XmNx = 10;
-        XmNy = 210;
-        XmNwidth = 110;
-        XmNheight = 20;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_toggleButton_lat);
-        XmNvalueChangedCallback = procedure do_toggle_lat();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object toggleButton_heading : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNfontList = font_table(
-		font('-*-helvetica-bold-r-*-*-*-120-75-75-p-*-iso8859-1'));
-        XmNindicatorOn = XmINDICATOR_CHECK_BOX;
-        XmNlabelString = compound_string("Heading Plot");
-        XmNrecomputeSize = false;
-        XmNx = 10;
-        XmNy = 370;
-        XmNwidth = 110;
-        XmNheight = 20;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_toggleButton_heading);
-        XmNvalueChangedCallback = procedure do_toggle_heading();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object toggleButton_speed : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNfontList = font_table(
-		font('-*-helvetica-bold-r-*-*-*-120-75-75-p-*-iso8859-1'));
-        XmNindicatorOn = XmINDICATOR_CHECK_BOX;
-        XmNlabelString = compound_string("Speed Plot");
-        XmNrecomputeSize = false;
-        XmNx = 10;
-        XmNy = 280;
-        XmNwidth = 160;
-        XmNheight = 20;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_toggleButton_speed);
-        XmNvalueChangedCallback = procedure do_toggle_speed();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object toggleButton_org_lon : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNfontList = font_table(
-		font('-*-helvetica-bold-r-*-*-*-120-75-75-p-*-iso8859-1'));
-        XmNindicatorOn = XmINDICATOR_CHECK_BOX;
-        XmNlabelString = compound_string("Show Original Data");
-        XmNrecomputeSize = false;
-        XmNx = 20;
-        XmNy = 160;
-        XmNwidth = 150;
-        XmNheight = 20;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_toggleButton_org_lon);
-        XmNvalueChangedCallback = procedure do_toggle_org_lon();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object toggleButton_org_lat : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNfontList = font_table(
-		font('-*-helvetica-bold-r-*-*-*-120-75-75-p-*-iso8859-1'));
-        XmNindicatorOn = XmINDICATOR_CHECK_BOX;
-        XmNlabelString = compound_string("Show Original Data");
-        XmNrecomputeSize = false;
-        XmNx = 20;
-        XmNy = 230;
-        XmNwidth = 150;
-        XmNheight = 20;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_toggleButton_org_lat);
-        XmNvalueChangedCallback = procedure do_toggle_org_lat();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object toggleButton_org_speed : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNfontList = font_table(
-		font('-*-helvetica-bold-r-*-*-*-120-75-75-p-*-iso8859-1'));
-        XmNindicatorOn = XmINDICATOR_CHECK_BOX;
-        XmNlabelString = compound_string("Show Original Data");
-        XmNrecomputeSize = false;
-        XmNx = 20;
-        XmNy = 300;
-        XmNwidth = 180;
-        XmNheight = 20;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_toggleButton_org_speed);
-        XmNvalueChangedCallback = procedure do_toggle_org_speed();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object toggleButton_show_smg : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNfontList = font_table(
-		font('-*-helvetica-bold-r-*-*-*-120-75-75-p-*-iso8859-1'));
-        XmNindicatorOn = XmINDICATOR_CHECK_BOX;
-        XmNlabelString = compound_string("Show Speed-Made-Good");
-        XmNrecomputeSize = false;
-        XmNx = 20;
-        XmNy = 320;
-        XmNwidth = 180;
-        XmNheight = 20;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_toggleButton_show_smg);
-        XmNvalueChangedCallback = procedure do_toggle_show_smg();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object pushButton_speed_smg : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNfontList = font_table(
-		font('-*-helvetica-bold-r-*-*-*-120-75-75-p-*-iso8859-1'));
-        XmNlabelString = compound_string("Use Speed-Made-Good");
-        XmNrecomputeSize = false;
-        XmNx = 20;
-        XmNy = 340;
-        XmNwidth = 180;
-        XmNheight = 20;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_pushButton_speed_smg);
-        XmNactivateCallback = procedure do_button_use_smg();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object toggleButton_org_heading : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNfontList = font_table(
-		font('-*-helvetica-bold-r-*-*-*-120-75-75-p-*-iso8859-1'));
-        XmNindicatorOn = XmINDICATOR_CHECK_BOX;
-        XmNlabelString = compound_string("Show Original Data");
-        XmNrecomputeSize = false;
-        XmNx = 20;
-        XmNy = 390;
-        XmNwidth = 150;
-        XmNheight = 20;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_toggleButton_org_heading);
-        XmNvalueChangedCallback = procedure do_toggle_org_heading();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object toggleButton_show_cmg : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNfontList = font_table(
-		font('-*-helvetica-bold-r-*-*-*-120-75-75-p-*-iso8859-1'));
-        XmNindicatorOn = XmINDICATOR_CHECK_BOX;
-        XmNlabelString = compound_string("Show Course-Made-Good");
-        XmNrecomputeSize = false;
-        XmNx = 20;
-        XmNy = 410;
-        XmNwidth = 190;
-        XmNheight = 20;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_toggleButton_show_cmg);
-        XmNvalueChangedCallback = procedure do_toggle_show_cmg();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object pushButton_heading_cmg : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNfontList = font_table(
-		font('-*-helvetica-bold-r-*-*-*-120-75-75-p-*-iso8859-1'));
-        XmNlabelString = compound_string("Use Course-Made-Good");
-        XmNrecomputeSize = false;
-        XmNx = 20;
-        XmNy = 430;
-        XmNwidth = 180;
-        XmNheight = 20;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_pushButton_heading_cmg);
-        XmNactivateCallback = procedure do_button_use_cmg();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object toggleButton_pick : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNfontList = font_table(
-		font('-*-helvetica-bold-r-*-*-*-120-75-75-p-*-iso8859-1'));
-        XmNindicatorOn = XmINDICATOR_CHECK_BOX;
-        XmNlabelString = compound_string("Pick");
-        XmNwidth = 51;
-        XmNheight = 34;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_toggleButton_pick);
-        XmNvalueChangedCallback = procedure do_toggle_pick();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object toggleButton_select : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNfontList = font_table(
-		font('-*-helvetica-bold-r-*-*-*-120-75-75-p-*-iso8859-1'));
-        XmNindicatorOn = XmINDICATOR_CHECK_BOX;
-        XmNlabelString = compound_string("Select");
-        XmNwidth = 64;
-        XmNheight = 34;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_toggleButton_select);
-        XmNvalueChangedCallback = procedure do_toggle_select();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object toggleButton_deselect : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNfontList = font_table(
-		font('-*-helvetica-bold-r-*-*-*-120-75-75-p-*-iso8859-1'));
-        XmNindicatorOn = XmINDICATOR_CHECK_BOX;
-        XmNlabelString = compound_string("Deselect");
-        XmNwidth = 78;
-        XmNheight = 34;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_toggleButton_deselect);
-        XmNvalueChangedCallback = procedure do_toggle_deselect();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object toggleButton_selectall : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNfontList = font_table(
-		font('-*-helvetica-bold-r-*-*-*-120-75-75-p-*-iso8859-1'));
-        XmNindicatorOn = XmINDICATOR_CHECK_BOX;
-        XmNlabelString = compound_string("Select All");
-        XmNrecomputeSize = false;
-        XmNwidth = 93;
-        XmNheight = 34;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_toggleButton_selectall);
-        XmNvalueChangedCallback = procedure do_toggle_selectall();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object toggleButton_deselectall : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNfontList = font_table(
-		font('-*-helvetica-bold-r-*-*-*-120-75-75-p-*-iso8859-1'));
-        XmNindicatorOn = XmINDICATOR_CHECK_BOX;
-        XmNlabelString = compound_string("Deselect All");
-        XmNrecomputeSize = false;
-        XmNwidth = 110;
-        XmNheight = 34;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_toggleButton_deselectall);
-        XmNvalueChangedCallback = procedure do_toggle_deselectall();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object radioBox : XmRadioBox widget {
-    arguments {
-        arguments Style_use;
-        XmNpacking = XmPACK_TIGHT;
-        XmNlabelString = compound_string("");
-        XmNorientation = XmHORIZONTAL;
-        XmNx = 600;
-        XmNy = 40;
-        XmNwidth = 414;
-        XmNheight = 40;
-    };
-    controls {
-         managed XmToggleButton toggleButton_pick;
-         managed XmToggleButton toggleButton_select;
-         managed XmToggleButton toggleButton_deselect;
-         managed XmToggleButton toggleButton_selectall;
-         managed XmToggleButton toggleButton_deselectall;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_radioBox);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object pushButton_interpolate : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNfontList = font_table(
-		font('-adobe-helvetica-bold-r-normal--14-140-75-75-p-82-iso8859-1'));
-        XmNlabelString = compound_string("Interpolate");
-        XmNrecomputeSize = false;
-        XmNx = 10;
-        XmNy = 50;
-        XmNwidth = 90;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_pushButton_interpolate);
-        XmNactivateCallback = procedure do_interpolation();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object pushButton_revert : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNfontList = font_table(
-		font('-adobe-helvetica-bold-r-normal--14-140-75-75-p-82-iso8859-1'));
-        XmNlabelString = compound_string("Revert");
-        XmNrecomputeSize = false;
-        XmNx = 270;
-        XmNy = 50;
-        XmNwidth = 80;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_pushButton_revert);
-        XmNactivateCallback = procedure do_revert();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object pushButton_showall : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNfontList = font_table(
-		font('-adobe-helvetica-bold-r-normal--14-140-75-75-p-82-iso8859-1'));
-        XmNlabelString = compound_string("Show All");
-        XmNrecomputeSize = false;
-        XmNx = 580;
-        XmNy = 10;
-        XmNwidth = 80;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNactivateCallback = procedure do_showall();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object pushButton_set_interval : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNfontList = font_table(
-		font('-adobe-helvetica-bold-r-normal--14-140-75-75-p-82-iso8859-1'));
-        XmNlabelString = compound_string("Pick Zoom");
-        XmNrecomputeSize = false;
-        XmNx = 670;
-        XmNy = 10;
-        XmNwidth = 80;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNactivateCallback = procedure do_set_interval();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object toggleButton_vru : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNfontList = font_table(
-		font('-*-helvetica-bold-r-*-*-*-120-75-75-p-*-iso8859-1'));
-        XmNindicatorOn = XmINDICATOR_CHECK_BOX;
-        XmNlabelString = compound_string("Roll, Pitch, and Heave Plots");
-        XmNx = 10;
-        XmNy = 510;
-        XmNwidth = 191;
-        XmNheight = 26;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_toggleButton_vru);
-        XmNvalueChangedCallback = procedure do_toggle_vru();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object pushButton_about : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNfontList = font_table(
-		font('-*-helvetica-bold-r-*-*-*-140-*-*-*-*-iso8859-1'));
-        XmNlabelString = compound_string("About");
-        XmNx = 920;
-        XmNy = 10;
-        XmNwidth = 80;
-        XmNheight = 28;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNactivateCallback = procedure BxManageCB("bulletinBoard_about");
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object pushButton_quit : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNfontList = font_table(
-		font('-*-helvetica-bold-r-*-*-*-140-*-*-*-*-iso8859-1'));
-        XmNlabelString = compound_string("Quit");
-        XmNx = 840;
-        XmNy = 10;
-        XmNwidth = 70;
-        XmNheight = 28;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNactivateCallback = procedure BxExitCB(0);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object pushButton_reverse : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNfontList = font_table(
-		font('-*-helvetica-bold-r-*-*-*-140-*-*-*-*-iso8859-1'));
-        XmNlabelString = compound_string("Reverse");
-        XmNx = 250;
-        XmNy = 10;
-        XmNwidth = 69;
-        XmNheight = 28;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_pushButton_reverse);
-        XmNactivateCallback = procedure do_reverse();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object pushButton_forward : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNfontList = font_table(
-		font('-*-helvetica-bold-r-*-*-*-140-*-*-*-*-iso8859-1'));
-        XmNlabelString = compound_string("Forward");
-        XmNx = 320;
-        XmNy = 10;
-        XmNwidth = 69;
-        XmNheight = 28;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_pushButton_forward);
-        XmNactivateCallback = procedure do_forward();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object pushButton_done : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNfontList = font_table(
-		font('-*-helvetica-bold-r-*-*-*-140-*-*-*-*-iso8859-1'));
-        XmNlabelString = compound_string("Done");
-        XmNx = 760;
-        XmNy = 10;
-        XmNwidth = 70;
-        XmNheight = 28;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_pushButton_done);
-        XmNactivateCallback = procedure do_done();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object pushButton_nextbuffer : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNfontList = font_table(
-		font('-*-helvetica-bold-r-*-*-*-140-*-*-*-*-iso8859-1'));
-        XmNlabelString = compound_string("Next Buffer");
-        XmNx = 480;
-        XmNy = 10;
-        XmNwidth = 88;
-        XmNheight = 28;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNactivateCallback = procedure do_nextbuffer();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object toggleButton_time : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNfontList = font_table(
-		font('-*-helvetica-bold-r-*-*-*-120-75-75-p-*-iso8859-1'));
-        XmNindicatorOn = XmINDICATOR_CHECK_BOX;
-        XmNlabelString = compound_string("Time Interval Plot");
-        XmNstringDirection = XmSTRING_DIRECTION_L_TO_R;
-        XmNrecomputeSize = false;
-        XmNx = 10;
-        XmNy = 90;
-        XmNwidth = 150;
-        XmNheight = 20;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_toggleButton_time);
-        XmNvalueChangedCallback = procedure do_toggle_time();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object toggleButton_org_time : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNfontList = font_table(
-		font('-*-helvetica-bold-r-*-*-*-120-75-75-p-*-iso8859-1'));
-        XmNindicatorOn = XmINDICATOR_CHECK_BOX;
-        XmNlabelString = compound_string("Show Original Data");
-        XmNrecomputeSize = false;
-        XmNx = 20;
-        XmNy = 110;
-        XmNwidth = 150;
-        XmNheight = 20;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_toggleButton_org_time);
-        XmNvalueChangedCallback = procedure do_toggle_org_time();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object toggleButton_dr_lon : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNfontList = font_table(
-		font('-*-helvetica-bold-r-*-*-*-120-75-75-*-*-iso8859-1'));
-        XmNindicatorOn = XmINDICATOR_CHECK_BOX;
-        XmNlabelString = compound_string("Show Dead Reckoning");
-        XmNx = 20;
-        XmNy = 180;
-        XmNwidth = 159;
-        XmNheight = 26;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_toggleButton_dr_lon);
-        XmNvalueChangedCallback = procedure do_toggle_dr_lon();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object toggleButton_dr_lat : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNfontList = font_table(
-		font('-*-helvetica-bold-r-*-*-*-120-75-75-p-*-iso8859-1'));
-        XmNindicatorOn = XmINDICATOR_CHECK_BOX;
-        XmNlabelString = compound_string("Show Dead Reckoning");
-        XmNx = 20;
-        XmNy = 250;
-        XmNwidth = 159;
-        XmNheight = 26;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_toggleButton_dr_lat);
-        XmNvalueChangedCallback = procedure do_toggle_dr_lat();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object pushButton_solution : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNfontList = font_table(
-		font('-*-helvetica-bold-r-*-*-*-140-75-75-p-*-iso8859-1'));
-        XmNlabelString = compound_string("Use Solution");
-        XmNx = 360;
-        XmNy = 50;
-        XmNwidth = 100;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_pushButton_solution);
-        XmNactivateCallback = procedure do_button_use_dr();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object toggleButton_sonardepth : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNfontList = font_table(
-		font('-*-helvetica-bold-r-*-*-*-120-75-75-p-*-iso8859-1'));
-        XmNindicatorOn = XmINDICATOR_CHECK_BOX;
-        XmNlabelString = compound_string("Sonar Depth Plot");
-        XmNrecomputeSize = false;
-        XmNx = 10;
-        XmNy = 460;
-        XmNwidth = 140;
-        XmNheight = 20;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_toggleButton_sonardepth);
-        XmNvalueChangedCallback = procedure do_toggle_sonardepth();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object toggleButton_org_sonardepth : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNfontList = font_table(
-		font('-*-helvetica-bold-r-*-*-*-120-75-75-p-*-iso8859-1'));
-        XmNindicatorOn = XmINDICATOR_CHECK_BOX;
-        XmNlabelString = compound_string("Show Original Data");
-        XmNrecomputeSize = false;
-        XmNx = 20;
-        XmNy = 480;
-        XmNwidth = 150;
-        XmNheight = 20;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_toggleButton_org_sonardepth);
-        XmNvalueChangedCallback = procedure do_toggle_org_sonardepth();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object pushButton_controls_timespan : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Time Stepping");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNactivateCallback = procedure BxManageCB("bulletinBoard_timestepping");
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object pushButton_controls_modeling : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Nav Modeling");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNactivateCallback = procedure BxManageCB("bulletinBoard_modeling");
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object pushButton_controls_timeinterpolation : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Time Interpolation");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_pushButton_controls_timeinterpolation);
-        XmNactivateCallback = procedure BxManageCB("bulletinBoard_timeinterpolation" &
- "");
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object pushButton_controls_deletebadtimetag : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Delete Bad Times");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_pushButton_controls_deletebadtimetag);
-        XmNactivateCallback = procedure BxManageCB("bulletinBoard_deletebadtimetag");
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object pushButton_controls_offset : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Position Offset");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNactivateCallback = procedure BxManageCB("form_offset");
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object pulldownMenu_controls : XmPulldownMenu widget {
-    arguments {
-        arguments Style_use;
-        XmNx = 0;
-        XmNy = 0;
-        XmNwidth = 137;
-        XmNheight = 124;
-    };
-    controls {
-         managed XmPushButton pushButton_controls_timespan;
-         managed XmPushButton pushButton_controls_modeling;
-         managed XmPushButton pushButton_controls_timeinterpolation;
-         managed XmPushButton pushButton_controls_deletebadtimetag;
-         managed XmPushButton pushButton_controls_offset;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object cascadeButton_controls : XmCascadeButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Controls");
-        XmNx = 5;
-        XmNy = 5;
-        XmNwidth = 77;
-        XmNheight = 24;
-    };
-    controls {
-         unmanaged XmPulldownMenu pulldownMenu_controls;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object menuBar_controls : XmMenuBar widget {
-    arguments {
-        arguments Style_use;
-        XmNx = 80;
-        XmNy = 10;
-        XmNwidth = 87;
-        XmNheight = 34;
-    };
-    controls {
-         managed XmCascadeButton cascadeButton_controls;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object pushButton_flag : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Flag");
-        XmNx = 460;
-        XmNy = 50;
-        XmNwidth = 70;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_pushButton_flag);
-        XmNactivateCallback = procedure do_flag();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object pushButton_unflag : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Unflag");
-        XmNx = 530;
-        XmNy = 50;
-        XmNwidth = 70;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_pushButton_unflag);
-        XmNactivateCallback = procedure do_unflag();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object pushButton_interpolaterepeats : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNfontList = font_table(
-		font('-adobe-helvetica-bold-r-normal--14-140-75-75-p-82-iso8859-1'));
-        XmNlabelString = compound_string("Interpolate Repeats");
-        XmNrecomputeSize = false;
-        XmNx = 110;
-        XmNy = 50;
-        XmNwidth = 150;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_pushButton_interpolaterepeats);
-        XmNactivateCallback = procedure do_interpolationrepeats();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object pushButton_file : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNfontList = font_table(
-		font('-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1'));
-        XmNlabelString = compound_string("Open");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_pushButton_file);
-       XmNactivateCallback = procedures {
-                 BxManageCB("bulletinBoard_fileselection");
-                 BxSetValuesCB("label_format.labelString=MBIO F" &
- "ormat ID:");
-        };
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object pushButton_filelist : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("File Selection List");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNactivateCallback = procedure BxManageCB("form_filelist");
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object pulldownMenu_file : XmPulldownMenu widget {
-    arguments {
-        arguments Style_use;
-        XmNx = 0;
-        XmNy = 0;
-        XmNwidth = 135;
-        XmNheight = 52;
-    };
-    controls {
-         managed XmPushButton pushButton_file;
-         managed XmPushButton pushButton_filelist;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object cascadeButton_file : XmCascadeButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("File");
-        XmNx = 5;
-        XmNy = 5;
-        XmNwidth = 41;
-        XmNheight = 24;
-    };
-    controls {
-         unmanaged XmPulldownMenu pulldownMenu_file;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object menuBar_file : XmMenuBar widget {
-    arguments {
-        arguments Style_use;
-        XmNx = 10;
-        XmNy = 10;
-        XmNwidth = 51;
-        XmNheight = 34;
-    };
-    controls {
-         managed XmCascadeButton cascadeButton_file;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object pushButton_start : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNfontList = font_table(
-		font('-*-helvetica-bold-r-*-*-*-140-*-*-*-*-iso8859-1'));
-        XmNlabelString = compound_string("Start");
-        XmNx = 180;
-        XmNy = 10;
-        XmNwidth = 70;
-        XmNheight = 28;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_pushButton_start);
-        XmNactivateCallback = procedure do_start();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object pushButton_end : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNfontList = font_table(
-		font('-*-helvetica-bold-r-*-*-*-140-*-*-*-*-iso8859-1'));
-        XmNlabelString = compound_string("End");
-        XmNx = 390;
-        XmNy = 10;
-        XmNwidth = 70;
-        XmNheight = 28;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_pushButton_end);
-        XmNactivateCallback = procedure do_end();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object bulletinBoard : XmBulletinBoard widget {
-    arguments {
-        arguments Style_use;
-        XmNresizePolicy = XmRESIZE_GROW;
-        XmNwidth = 1024;
-        XmNheight = 683;
-    };
-    controls {
-         managed XmPushButton pushButton_end;
-         managed XmPushButton pushButton_start;
-         managed XmMenuBar menuBar_file;
-         managed XmPushButton pushButton_interpolaterepeats;
-         managed XmPushButton pushButton_unflag;
-         managed XmPushButton pushButton_flag;
-         managed XmMenuBar menuBar_controls;
-         managed XmToggleButton toggleButton_org_sonardepth;
-         managed XmToggleButton toggleButton_sonardepth;
-         managed XmPushButton pushButton_solution;
-         managed XmToggleButton toggleButton_dr_lat;
-         managed XmToggleButton toggleButton_dr_lon;
-         managed XmToggleButton toggleButton_org_time;
-         managed XmToggleButton toggleButton_time;
-         managed XmPushButton pushButton_nextbuffer;
-         managed XmPushButton pushButton_done;
-         managed XmPushButton pushButton_forward;
-         managed XmPushButton pushButton_reverse;
-         managed XmPushButton pushButton_quit;
-         managed XmPushButton pushButton_about;
-         managed XmToggleButton toggleButton_vru;
-         managed XmPushButton pushButton_set_interval;
-         managed XmPushButton pushButton_showall;
-         managed XmPushButton pushButton_revert;
-         managed XmPushButton pushButton_interpolate;
-         managed XmRadioBox radioBox;
-         managed XmPushButton pushButton_heading_cmg;
-         managed XmToggleButton toggleButton_show_cmg;
-         managed XmToggleButton toggleButton_org_heading;
-         managed XmPushButton pushButton_speed_smg;
-         managed XmToggleButton toggleButton_show_smg;
-         managed XmToggleButton toggleButton_org_speed;
-         managed XmToggleButton toggleButton_org_lat;
-         managed XmToggleButton toggleButton_org_lon;
-         managed XmToggleButton toggleButton_speed;
-         managed XmToggleButton toggleButton_heading;
-         managed XmToggleButton toggleButton_lat;
-         managed XmToggleButton toggleButton_lon;
-         managed XmScrolledWindow scrolledWindow;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_bulletinBoard);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mainWindow : XmMainWindow widget {
-    arguments {
-        arguments Style_use;
-        XmNx = 964;
-        XmNy = 300;
-        XmNwidth = 1024;
-        XmNheight = 683;
-    };
-    controls {
-!(BX)         unmanaged XmDialogShell dialogShell_filelist;
-!(BX)         unmanaged XmDialogShell xmDialogShell_offset;
-!(BX)         unmanaged XmDialogShell dialogShell_deletebadtimetag;
-!(BX)         unmanaged XmDialogShell xmDialogShell_timeinterpolation;
-!(BX)         unmanaged XmDialogShell xmDialogShell_useprevious;
-!(BX)         unmanaged XmDialogShell xmDialogShell_modeling;
-!(BX)         unmanaged XmDialogShell xmDialogShell_timestepping;
-!(BX)         unmanaged XmDialogShell xmDialogShell_fileselection;
-!(BX)         unmanaged XmDialogShell xmDialogShell_error;
-!(BX)         unmanaged XmDialogShell xmDialogShell_message;
-!(BX)         unmanaged XmDialogShell xmDialogShell_about;
-         managed XmBulletinBoard bulletinBoard;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-!(BX)object topLevelShell : TopLevelShell widget {
-!(BX)    arguments {
-!(BX)        arguments Style_use;
-!(BX)        XmNtitle = "MBnavedit";
-!(BX)        XmNiconName = "MBnavedit";
-!(BX)        XmNallowShellResize = true;
-!(BX)        XmNx = 964;
-!(BX)        XmNy = 300;
-!(BX)        XmNwidth = 1024;
-!(BX)        XmNheight = 683;
-!(BX)    };
-!(BX)    controls {
-!(BX)         managed XmMainWindow mainWindow;
-!(BX)    };
-!(BX)    callbacks {
-!(BX)        callbacks Style_useReasons;
-!(BX)        XmNdestroyCallback = procedure BxExitCB(0);
-!(BX)    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-!(BX)};
-end module;
diff --git a/src/mbnavedit/mbnavedit_callbacks.c b/src/mbnavedit/mbnavedit_callbacks.c
deleted file mode 100644
index 385a0af..0000000
--- a/src/mbnavedit/mbnavedit_callbacks.c
+++ /dev/null
@@ -1,3393 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbnavedit_callbacks.c	6/24/95
- *    $Id: mbnavedit_callbacks.c 2252 2015-07-01 19:35:37Z caress $
- *
- *    Copyright (c) 1995-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * MBNAVEDIT is an interactive navigation editor for swath sonar data.
- * It can work with any data format supported by the MBIO library.
- * This file contains the callback functions from the MOTIF interface.
- *
- * Author:	D. W. Caress
- * Date:	June 24,  1995
- * Date:	August 28, 2000 (New version - no buffered i/o)
- *
- *
- */
-
-/*--------------------------------------------------------------------*/
-
-/* include files */
-#include <stdio.h>
-#include <stdlib.h>
-#include <X11/Intrinsic.h>
-#include <Xm/Xm.h>
-#include <X11/cursorfont.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <Xm/FileSB.h>
-#include <Xm/Text.h>
-#include <Xm/TextF.h>
-#include <Xm/ToggleB.h>
-#include <Xm/List.h>
-
-#define MBNAVEDIT_DECLARE_GLOBALS
-#include "mb_status.h"
-#include "mb_define.h"
-#include "mb_io.h"
-#include "mb_process.h"
-#include "mb_xgraphics.h"
-#include "mbnavedit_extrawidgets.h"
-#include "mbnavedit.h"
-
-#include "mbnavedit_creation.h"
-
-/*--------------------------------------------------------------------*/
-/*
- * Standard includes for builtins.
- */
-#include <string.h>
-#include <ctype.h>
-
-/*
- * Macros to make code look nicer between ANSI and K&R.
- */
-#ifndef ARGLIST
-#if (NeedFunctionPrototypes == 0)
-#define PROTOTYPE(p)	()
-#define ARGLIST(p)	p
-#define ARG(a, b)	a b;
-#define GRA(a, b)	a b;
-#define UARG(a, b)      a b;
-#define GRAU(a, b)      a b;
-#else
-#define PROTOTYPE(p)	p
-#define ARGLIST(p)	(
-#define ARG(a, b)	a b,
-#define GRA(a, b)	a b)
-#ifdef __cplusplus
-#define UARG(a, b)      a,
-#define GRAU(a, b)      a)
-#else
-#define UARG(a, b)      a b,
-#define GRAU(a, b)      a b)
-#endif
-#endif
-#endif
-
-#ifndef FIXED
-#define FIXED "fixed"
-#endif
-
-Widget		BxFindTopShell PROTOTYPE((Widget));
-WidgetList	BxWidgetIdsFromNames PROTOTYPE((Widget, char*, char*));
-
-/*--------------------------------------------------------------------*/
-
-/* id variables */
-static char svn_id[] = "$Id: mbnavedit_callbacks.c 2252 2015-07-01 19:35:37Z caress $";
-static char program_name[] = "MBnavedit";
-
-#define xgfont "-*-"FIXED"-bold-r-normal-*-13-*-75-75-c-70-iso8859-1"
-#define EV_MASK (ButtonPressMask | KeyPressMask | KeyReleaseMask | ExposureMask)
-
-/* XG variable declarations */
-XtAppContext	app_context;
-Display		*display;
-Window		can_xid, root_return, child_return;
-Colormap	colormap;
-GC		gc;
-XGCValues	xgcv;
-XFontStruct	*fontStruct;
-
-/* file opening parameters */
-int	expose_plot_ok = True;
-
-void	*can_xgid;		/* XG graphics id */
-Cursor myCursor;
-XColor closest[2];
-XColor exact[2];
-
-/* Set the colors used for this program here. */
-#define NCOLORS 9
-XColor colors[NCOLORS];
-unsigned int mpixel_values[NCOLORS];
-XColor db_color;
-
-/* Set these to the dimensions of your canvas drawing */
-/* area, minus 1, located in mbnavedit.uil.              */
-static int mb_borders[4] =
-	{ 0, 1016, 0, 552 };
-
-int	status;
-char	string[MB_PATH_MAXLINE];
-
-/* file opening parameters */
-int	startup_file = 0;
-int	numfiles = 0;
-int	currentfile = -1;
-int	currentfile_shown = -1;
-int	fileformats[NUM_FILES_MAX];
-mb_path	filepaths[NUM_FILES_MAX];
-int	filelocks[NUM_FILES_MAX];
-int	filenves[NUM_FILES_MAX];
-int	timer_function_set = MB_NO;
-
-static char	input_file[MB_PATH_MAXLINE];
-int selected = 0; /* indicates an input file is selected */
-
-/*--------------------------------------------------------------------*/
-/*      Function Name:	BxExitCB
- *
- *      Description:   	This functions expects an integer to be passed in
- *		       	client data.  It calls the exit() system call with
- *			the integer value as the argument to the function.
- *
- *      Arguments:      Widget		w: 	the activating widget.
- *			XtPointer	client:	the integer exit value.
- *			XtPointer	call:	the call data (unused).
- */
-
-
-void
-BxExitCB ARGLIST((w, client, call))
-UARG( Widget, w)
-ARG( XtPointer, client)
-GRAU( XtPointer, call)
-{
-    int		status;
-    long	exitValue = EXIT_FAILURE;
-
-    /* finish with the current file */
-    status = mbnavedit_action_quit();
-    if (status == 0) mbnavedit_bell(100);
-
-    exit(exitValue);
-}
-/*--------------------------------------------------------------------*/
-/*      Function Name: 	BxManageCB
- *
- *      Description:   	Given a string of the form:
- *		       	"(WL)[widgetName, widgetName, ...]"
- *			BxManageCB attempts to convert the name to a Widget
- *			ID and manage the widget.
- *
- *      Arguments:     	Widget	    w:      the widget activating the callback.
- *		       	XtPointer   client: the list of widget names to attempt
- *					    to find and manage.
- *		       	XtPointer   call:   the call data (unused).
- *
- *      Notes:        *	This function expects that there is an application
- *		       	shell from which all other widgets are descended.
- */
-
-
-void
-BxManageCB ARGLIST((w, client, call))
-ARG( Widget, w)
-ARG( XtPointer, client)
-GRAU( XtPointer, call)
-{
-    WidgetList		widgets;
-    int			i;
-
-    /*
-     * This function returns a NULL terminated WidgetList.  The memory for
-     * the list needs to be freed when it is no longer needed.
-     */
-    widgets = BxWidgetIdsFromNames(w, "BxManageCB", (String)client);
-
-    i = 0;
-    while( widgets && widgets[i] != NULL )
-    {
-	XtManageChild(widgets[i]);
-	i++;
-    }
-    XtFree((char *)widgets);
-}
-/*--------------------------------------------------------------------*/
-/*      Function Name: 	BxUnmanageCB
- *
- *      Description:   	Given a string of the form:
- *		       	"(WL)[widgetName, widgetName, ...]"
- *			BxUnmanageCB attempts to convert the name to a Widget
- *			ID and unmanage the widget.
- *
- *      Arguments:     	Widget	    w:      the widget activating the callback.
- *		       	XtPointer   client: the list of widget names to attempt
- *					    to find and unmanage.
- *		       	XtPointer   call:   the call data (unused).
- *
- *      Notes:        *	This function expects that there is an application
- *		       	shell from which all other widgets are descended.
- */
-
-
-void
-BxUnmanageCB ARGLIST((w, client, call))
-ARG( Widget, w)
-ARG( XtPointer, client)
-GRAU( XtPointer, call)
-{
-    WidgetList		widgets;
-    int			i;
-
-    /*
-     * This function returns a NULL terminated WidgetList.  The memory for
-     * the list needs to be freed when it is no longer needed.
-     */
-    widgets = BxWidgetIdsFromNames(w, "BxUnmanageCB", (String)client);
-
-    i = 0;
-    while( widgets && widgets[i] != NULL )
-    {
-	XtUnmanageChild(widgets[i]);
-	i++;
-    }
-    XtFree((char *)widgets);
-
-	/* replot */
-	mbnavedit_plot_all();
-
-	/* replot */
-	mbnavedit_plot_all();
-
-	/* replot */
-	mbnavedit_plot_all();
-}
-/*--------------------------------------------------------------------*/
-/*      Function Name:	BxSetValuesCB
- *
- *      Description:   	This function accepts a string of the form:
- *			"widgetName.resourceName = value\n..."
- *			It then attempts to convert the widget name to a widget
- *			ID and the value to a valid resource value.  It then
- *			sets the value on the given widget.
- *
- *      Arguments:      Widget		w:	the activating widget.
- *			XtPointer	client:	the set values string.
- *			XtPointer	call:	the call data (unused).
- *
- *      Notes:        * This function expects that there is an application
- *                      shell from which all other widgets are descended.
- */
-#include <X11/StringDefs.h>
-
-
-void
-BxSetValuesCB ARGLIST((w, client, call))
-ARG( Widget, w)
-ARG( XtPointer, client)
-GRAU( XtPointer, call)
-{
-#define CHUNK	512
-
-    Boolean 	first = True;
-    String 	rscs = XtNewString((String)client);
-    String 	*valueList = (String *)XtCalloc(CHUNK, sizeof(String));
-    char 	*start;
-    char 	*ptr, *cptr;
-    String 	name;
-    String 	rsc;
-    int 	i, count = 0;
-    Widget 	*current;
-
-    for ( start = rscs; rscs && *rscs; rscs = strtok(NULL, "\n"))
-    {
-        if ( first )
-        {
-            rscs = strtok(rscs, "\n");
-            first = False;
-        }
-        valueList[count] = XtNewString(rscs);
-        count++;
-        if ( count == CHUNK )
-        {
-            valueList =
-		(String *)XtRealloc((char *)valueList,
-				    (count + CHUNK) * sizeof(String));
-        }
-    }
-    XtFree((char *)start);
-
-    for ( i = 0; i < count; i++ )
-    {
-	/*
-	 * First, extract the widget name and generate a string to
-	 * pass to BxWidgetIdsFromNames().
-	 */
-	cptr = strrchr(valueList[i], '.');
-	if ( cptr != NULL )
-	{
-	    *cptr = '\000';
-	}
-	else
-	{
-	    printf("Callback Error (BxSetValuesCB):\n\t\
-Syntax Error - specify BxSetValuesCB data as\n\t\
-    <Widget Name>.<Resource> = <Value>\n");
-	    XtFree((char *)(valueList[i]));
-	    continue;
-	}
-	name = valueList[i];
-	while( (name && *name) && isspace(*name) )
-	{
-	    name++;
-	}
-	ptr = name + strlen(name) - 1;
-	while( ptr && *ptr )
-	{
-            if ( isspace(*ptr) )
-            {
-                ptr--;
-            }
-            else
-            {
-                ptr++;
-                break;
-            }
-        }
-        if ( ptr && *ptr )
-        {
-            *ptr = '\0';
-        }
-	if ( ptr == NULL )
-	{
-	    printf("Callback Error (BxSetValuesCB):\n\t\
-Syntax Error - specify BxSetValuesCB data as\n\t\
-    <Widget Name>.<Resource> = <Value>\n");
-	    XtFree((char *)(valueList[i]));
-	    return;
-	}
-
-	/*
-	 * Next, get the resource name to set.
-	 */
-	rsc = ++cptr;
-	cptr = strchr(rsc, '=');
-	if ( cptr != NULL )
-	{
-	    *cptr = '\000';
-	}
-	else
-	{
-	    printf("Callback Error (BxSetValuesCB):\n\t\
-Syntax Error - specify BxSetValuesCB data as\n\t\
-    <Widget Name>.<Resource> = <Value>\n");
-	    XtFree((char *)(valueList[i]));
-	    continue;
-	}
-        while( (rsc && *rsc) && isspace(*rsc) )
-        {
-            rsc++;
-        }
-
-        ptr = rsc + strlen(rsc) - 1;
-        while( ptr && *ptr )
-        {
-            if ( isspace(*ptr) )
-            {
-                ptr--;
-            }
-            else
-            {
-                ptr++;
-                break;
-            }
-        }
-        if ( ptr && *ptr )
-        {
-            *ptr = '\0';
-        }
-
-	/*
-	 * Lastly, get the string value to which to set the resource.
-	 */
-	start = ++cptr;
-        while( (start && *start) && isspace(*start) )
-        {
-            start++;
-        }
-
-	if ( start == NULL )
-	{
-	    printf("Callback Error (BxSetValuesCB):\n\t\
-Syntax Error - specify BxSetValuesCB data as\n\t\
-    <Widget Name>.<Resource> = <Value>\n");
-	    XtFree((char *)(valueList[i]));
-	    return;
-	}
-
-        ptr = start + strlen(start) - 1;
-        while( ptr && *ptr )
-        {
-            if ( isspace(*ptr) )
-            {
-                ptr--;
-            }
-            else
-            {
-                ptr++;
-                break;
-            }
-        }
-        if ( ptr && *ptr )
-        {
-            *ptr = '\0';
-        }
-
-	/*
-	 * Now convert the widget name to a Widget ID
-	 */
-	current = BxWidgetIdsFromNames(w, "BxSetValuesCB", name);
-        if ( current[0] == NULL )
-        {
-	    XtFree((char *)(valueList[i]));
-	    continue;
-        }
-
-	/*
-	 * If the widget name conversion succeeded, we now need to get the
-	 * resource list for the widget so that we can do a resource conversion
-	 * of the value.
-	 */
-	XtVaSetValues(*current, XtVaTypedArg, rsc, XtRString, start,
-		      strlen(start)+1, NULL);
-        XtFree((char *)(valueList[i]));
-    }
-    XtFree((char *)valueList);
-
-#undef CHUNK
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_mbnavedit_init(int argc, char **argv)
-{
-    int	    i;
-
-    /* get additional widgets */
-    fileSelectionBox_list = (Widget)
-	XmFileSelectionBoxGetChild(fileSelectionBox,
-				    XmDIALOG_LIST);
-    fileSelectionBox_text = (Widget)
-	XmFileSelectionBoxGetChild(fileSelectionBox,
-				    XmDIALOG_TEXT);
-    XtAddCallback(fileSelectionBox_list,
-	    XmNbrowseSelectionCallback,
-	    do_fileselection_list, NULL);
-
-    XtUnmanageChild(
-	    (Widget) XmFileSelectionBoxGetChild(
-				    fileSelectionBox,
-				    XmDIALOG_HELP_BUTTON));
-
-    XtVaGetValues(scrolledWindow,
-			XmNhorizontalScrollBar,
-			&scrolledWindow_hscrollbar,
-			NULL);
-    XtVaGetValues(scrolledWindow,
-			XmNverticalScrollBar,
-			&scrolledWindow_vscrollbar,
-			NULL);
-    XtVaSetValues(scrolledWindow_hscrollbar,
-		XmCIncrement, 5, NULL);
-    XtVaSetValues(scrolledWindow_vscrollbar,
-		XmCIncrement, 5, NULL);
-    XtAddCallback(scrolledWindow_hscrollbar,
-		XmNvalueChangedCallback,
-		do_scroll, NULL);
-    XtAddCallback(scrolledWindow_vscrollbar,
-		XmNvalueChangedCallback,
-		do_scroll, NULL);
-    XtAddCallback(scrolledWindow_hscrollbar,
-		XmNdragCallback,
-		do_scroll, NULL);
-    XtAddCallback(scrolledWindow_vscrollbar,
-		XmNdragCallback,
-		do_scroll, NULL);
-
-    /* Setup the entire screen. */
-    display = XtDisplay(drawingArea);
-    colormap = DefaultColormap(display,XDefaultScreen(display));
-
-    /* Setup just the "canvas" part of the screen. */
-    can_xid = XtWindow(drawingArea);
-
-    /* Setup the "graphics Context" for just the "canvas" */
-    xgcv.background = WhitePixelOfScreen(DefaultScreenOfDisplay(display));
-    xgcv.foreground = BlackPixelOfScreen(DefaultScreenOfDisplay(display));
-    xgcv.line_width = 2;
-    gc = XCreateGC(display,can_xid,GCBackground | GCForeground
-	     | GCLineWidth, &xgcv);
-
-    /* Setup the font for just the "canvas" screen. */
-    fontStruct = XLoadQueryFont(display, xgfont);
-    if (fontStruct == NULL)
-        {
-	fprintf(stderr,"\nFailure to load font using XLoadQueryFont: %s\n", xgfont);
-        fprintf(stderr,"\tSource file: %s\n\tSource line: %d\n\tSource version: %s", __FILE__, __LINE__, svn_id);
-	fprintf(stderr,"\nProgram <%s> Terminated\n", program_name);
-	exit(-1);
-        }
-    XSetFont(display,gc,fontStruct->fid);
-
-    XSelectInput(display, can_xid, EV_MASK );
-
-    /* get resize events - add an event handler */
-    XtAddEventHandler(XtParent(bulletinBoard),
-			    StructureNotifyMask,
-			    False,
-			    (XtEventHandler) do_resize,
-			    (XtPointer)NULL);
-
-    /* Load the colors that will be used in this program. */
-    status = XLookupColor(display,colormap, "white",&db_color,&colors[0]);
-    if ((status = XAllocColor(display,colormap,&colors[0])) == 0)
-	    fprintf(stderr,"Failure to allocate color: white\n");
-    status = XLookupColor(display,colormap, "black",&db_color,&colors[1]);
-    if ((status = XAllocColor(display,colormap,&colors[1])) == 0)
-	    fprintf(stderr,"Failure to allocate color: black\n");
-    status = XLookupColor(display,colormap, "red",&db_color,&colors[2]);
-    if ((status = XAllocColor(display,colormap,&colors[2])) == 0)
-	    fprintf(stderr,"Failure to allocate color: red\n");
-    status = XLookupColor(display,colormap, "green",&db_color,&colors[3]);
-    if ((status = XAllocColor(display,colormap,&colors[3])) == 0)
-	    fprintf(stderr,"Failure to allocate color: green\n");
-    status = XLookupColor(display,colormap, "blue",&db_color,&colors[4]);
-    if ((status = XAllocColor(display,colormap,&colors[4])) == 0)
-	    fprintf(stderr,"Failure to allocate color: blue\n");
-    status = XLookupColor(display,colormap, "orange",&db_color,&colors[5]);
-    if ((status = XAllocColor(display,colormap,&colors[5])) == 0)
-	    fprintf(stderr,"Failure to allocate color: orange\n");
-    status = XLookupColor(display,colormap, "purple",&db_color,&colors[6]);
-    if ((status = XAllocColor(display,colormap,&colors[6])) == 0)
-	    fprintf(stderr,"Failure to allocate color: purple\n");
-    status = XLookupColor(display,colormap, "coral",&db_color,&colors[7]);
-    if ((status = XAllocColor(display,colormap,&colors[7])) == 0)
-	    fprintf(stderr,"Failure to allocate color: coral\n");
-    status = XLookupColor(display,colormap, "lightgrey",&db_color,&colors[8]);
-    if ((status = XAllocColor(display,colormap,&colors[8])) == 0)
-	    fprintf(stderr,"Failure to allocate color: lightgrey\n");
-    for (i=0;i<NCOLORS;i++)
-	    {
-	    mpixel_values[i] = colors[i].pixel;
-	    }
-
-    /* Setup initial cursor. This will be changed when changing "MODE". */
-    myCursor = XCreateFontCursor(display, XC_target);
-    XAllocNamedColor(display,colormap,"red",&closest[0],&exact[0]);
-    XAllocNamedColor(display,colormap,"coral",&closest[1],&exact[1]);
-    XRecolorCursor(display,myCursor,&closest[0],&closest[1]);
-    XDefineCursor(display,can_xid,myCursor);
-
-    /* initialize graphics */
-    status = mbnavedit_init_globals();
-    mb_borders[0] = 0;
-    mb_borders[1] = plot_width;
-    mb_borders[2] = 0;
-    mb_borders[3] = number_plots*plot_height;
-    xg_init(display, can_xid, mb_borders, xgfont, &can_xgid);
-    status = mbnavedit_set_graphics(can_xgid,
-		    NCOLORS, mpixel_values);
-
-    /* initialize mbnavedit proper */
-    status = mbnavedit_init(argc, argv, &startup_file);
-
-    do_set_controls();
-
-    /* set timer for function to keep updating the filelist */
-    do_mbnavedit_settimer();
-
-    /* if startup indicated by num_files > 0 try to open first file */
-    if (startup_file == MB_YES && numfiles > 0)
-	{
-	do_load_specific_file(0);
-	}
-}
-/*--------------------------------------------------------------------*/
-
-void
-do_parse_datalist( char *file, int form)
-{
-	void    *datalist;
-	int     done;
-	double  weight;
-	int     filestatus;
-	int     fileformat;
-	char    fileraw[MB_PATH_MAXLINE];
-	char    fileprocessed[MB_PATH_MAXLINE];
-	int     datalist_status = MB_SUCCESS;
-	int	error = MB_ERROR_NO_ERROR;
-	int	format;
-	int     verbose = 0;
-	int	i;
-
-fprintf(stderr,"Called do_parse_datalist:%s %d\n",file,form);
-    	/* try to resolve format if necessary */
-	format = form;
-	mb_get_format(verbose, file, NULL, &format, &error);
-
-	/* read in a single file */
-	if (format > 0 && numfiles < NUM_FILES_MAX)
-		{
-		strcpy(filepaths[numfiles], file);
-		fileformats[numfiles] = format;
-		filelocks[numfiles] = -1;
-		filenves[numfiles] = -1;
-		numfiles++;
-		}
-
-	/* read in datalist if forma = -1 */
-	else if (format == -1)
-		{
-		error = MB_ERROR_NO_ERROR;
-		done = MB_NO;
-		if ((datalist_status = mb_datalist_open(verbose, &datalist,
-						file, MB_DATALIST_LOOK_NO, &error)) == MB_SUCCESS)
-			{
-			while (done == MB_NO)
-				{
-				if ((datalist_status = mb_datalist_read2(verbose, datalist,
-						&filestatus, fileraw, fileprocessed, &fileformat, &weight, &error))
-						== MB_SUCCESS)
-					{
-					if (numfiles < NUM_FILES_MAX)
-						{
-						strcpy(filepaths[numfiles], fileraw);
-						fileformats[numfiles] = fileformat;
-						filelocks[numfiles] = -1;
-						filenves[numfiles] = -1;
-						numfiles++;
-						}
-					}
-				else
-					{
-					datalist_status = mb_datalist_close(verbose,&datalist,&error);
-					done = MB_YES;
-					}
-				}
-			}
-		}
-fprintf(stderr,"numfiles:%d\n",numfiles);
-for(i=0;i<numfiles;i++)
-fprintf(stderr,"\t%s\t%d\t%d\t%d\n",filepaths[i],fileformats[i],filelocks[i],filenves[i]);
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_editlistselection( Widget w, XtPointer client_data, XtPointer call_data)
-{
-	Cardinal ac;
-	Arg      args[256];
-	int	*position_list = NULL;
-	int	position_count = 0;
-	int	quit;
-	int	i;
-
-	/* turn off expose plots */
-	expose_plot_ok = False;
-
-	/* get the current selection, if any, from the list */
-	ac = 0;
-	XtSetArg(args[ac], XmNselectedPositionCount, (XtPointer) &position_count); ac++;
-	XtSetArg(args[ac], XmNselectedPositions, (XtPointer) &position_list); ac++;
-	XtGetValues(list_filelist, args, ac);
-
-fprintf(stderr,"position_count:%d\n",position_count);
-for(i=0;i<position_count;i++)
-fprintf(stderr,"  %d %d\n",i,position_list[i]);
-
-
-	/* if the selected file is different than what's already loaded, unload the old file and load the new one */
-	if (position_count > 0 && currentfile != position_list[0] - 1)
-		{
-		currentfile = position_list[0] - 1;
-
-		status = mbnavedit_action_done(&quit);
-		if (status == 0) XBell(display,100);
-
-		if (position_count > 0)
-			currentfile = position_list[0] - 1;
-		if (currentfile < numfiles)
-			{
-			do_load_specific_file(currentfile);
-			}
-		}
-
-	/* turn on expose plots */
-	expose_plot_ok = True;
-
-	/* update controls */
-	do_set_controls();
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_filelist_remove( Widget w, XtPointer client_data, XtPointer call_data)
-{
-	Cardinal ac;
-	Arg      args[256];
-	int	*position_list = NULL;
-	int	position_count = 0;
-	int	i;
-
-	/* turn off expose plots */
-	expose_plot_ok = False;
-
-	/* get the current selection, if any, from the list */
-	ac = 0;
-	XtSetArg(args[ac], XmNselectedPositionCount, (XtPointer) &position_count); ac++;
-	XtSetArg(args[ac], XmNselectedPositions, (XtPointer) &position_list); ac++;
-	XtGetValues(list_filelist, args, ac);
-
-	/* if the selected file is different than what's already loaded, remove it from the list */
-	if (position_count > 0 && currentfile != position_list[0] - 1)
-		{
-		for (i=position_list[0] - 1;i<numfiles-1;i++)
-			{
-			strcpy(filepaths[i], filepaths[i+1]);
-			fileformats[i] = fileformats[i+1];
-			filelocks[i] = filelocks[i+1];
-			filenves[i] = filenves[i+1];
-			}
-		numfiles--;
-		if (currentfile > position_list[0] - 1)
-			currentfile--;
-		}
-
-	/* turn on expose plots */
-	expose_plot_ok = True;
-
-	/* update controls */
-	do_set_controls();
-
-	/* replot */
-	mbnavedit_plot_all();
-}
-
-
-/*--------------------------------------------------------------------*/
-
-void
-do_load_specific_file(int i_file)
-{
-	struct stat file_status;
-	int	fstat;
-	int	save_mode = MB_NO;;
-	char    save_file[MB_PATH_MAXLINE];
-
-fprintf(stderr,"Called do_load_specific_file:%d\n",i_file);
-	/* check the specified file is in the list */
-	if (numfiles > 0 && i_file >= 0 && i_file < numfiles)
-		{
-		/* set current_file */
-		currentfile = i_file;
-
-		/* check for edit save file */
-		sprintf(save_file, "%s.nve", filepaths[currentfile]);
-		fstat = stat(save_file, &file_status);
-
-		/* if nve file exists deal with it */
-		if (fstat == 0
-		    && (file_status.st_mode & S_IFMT) != S_IFDIR)
-			{
-			/* if save_mode set load data using nve */
-			if (save_mode == MB_YES)
-			do_load(MB_YES);
-
-			/* else bring up dialog asking
-			if nve should be used */
-			else
-			do_checkuseprevious();
-			}
-
-		/* else just try to load the data without an nve */
-		else
-			{
-			(void) do_load(MB_NO);
-			}
-		}
-}
-
-/*--------------------------------------------------------------------*/
-
-void do_set_controls()
-{
-	char	value_text[MB_PATH_MAXLINE];
-
-	/* set about version label */
-	sprintf(value_text, ":::t\"MB-System Release %s\":t\"%s\"",
-		MB_VERSION, MB_BUILD_DATE);
-	set_label_multiline_string(label_about_version, value_text);
-
-	/* set value of format text item */
-	sprintf(string,"%2.2d",format);
-	XmTextFieldSetString(textField_format, string);
-
-	/* set the output mode */
-	if (output_mode == OUTPUT_MODE_OUTPUT)
-	    {
-	    XmToggleButtonSetState(toggleButton_output_on,
-			TRUE, TRUE);
-	    }
-	else
-	    {
-	    XmToggleButtonSetState(toggleButton_output_off,
-			TRUE, TRUE);
-	    }
-
-	/* set values of number of data shown slider */
-	XtVaSetValues(scale_timespan,
-			XmNminimum, 1,
-			XmNmaximum, data_show_max,
-			XmNvalue, MAX(data_show_size, 1),
-			NULL);
-	sprintf(string, "%d", data_show_max);
-	XtVaSetValues(label_timespan_2,
-			XtVaTypedArg, XmNlabelString,
-			    XmRString, string, (strlen(string) + 1),
-			NULL);
-
-	/* set values of number of data to step slider */
-	XtVaSetValues(scale_timestep,
-			XmNminimum, 1,
-			XmNmaximum, data_step_max,
-			XmNvalue, data_step_size,
-			NULL);
-	sprintf(string, "%d", data_step_max);
-	XtVaSetValues(label_timestep_2,
-			XtVaTypedArg, XmNlabelString,
-			    XmRString, string, (strlen(string) + 1),
-			NULL);
-
-	/* set the pick mode */
-	if (mode_pick == PICK_MODE_PICK)
-	    XmToggleButtonSetState(toggleButton_pick,
-			TRUE, TRUE);
-	else if (mode_pick == PICK_MODE_SELECT)
-	    XmToggleButtonSetState(toggleButton_select,
-			TRUE, TRUE);
-	else if (mode_pick == PICK_MODE_DESELECT)
-	    XmToggleButtonSetState(toggleButton_deselect,
-			TRUE, TRUE);
-	else if (mode_pick == PICK_MODE_SELECTALL)
-	    XmToggleButtonSetState(toggleButton_selectall,
-			TRUE, TRUE);
-	else if (mode_pick == PICK_MODE_DESELECTALL)
-	    XmToggleButtonSetState(toggleButton_deselectall,
-			TRUE, TRUE);
-
-	/* set the lon, lat, speed and heading plot toggles */
-	XmToggleButtonSetState(toggleButton_time,
-			plot_tint, TRUE);
-	XmToggleButtonSetState(toggleButton_org_time,
-			plot_tint_org, TRUE);
-	XmToggleButtonSetState(toggleButton_lon,
-			plot_lon, TRUE);
-	XmToggleButtonSetState(toggleButton_org_lon,
-			plot_lon_org, TRUE);
-	XmToggleButtonSetState(toggleButton_dr_lon,
-			plot_lon_dr, TRUE);
-	XmToggleButtonSetState(toggleButton_lat,
-			plot_lat, TRUE);
-	XmToggleButtonSetState(toggleButton_org_lat,
-			plot_lat_org, TRUE);
-	XmToggleButtonSetState(toggleButton_dr_lat,
-			plot_lat_dr, TRUE);
-	XmToggleButtonSetState(toggleButton_speed,
-			plot_speed, TRUE);
-	XmToggleButtonSetState(toggleButton_org_speed,
-			plot_speed_org, TRUE);
-	XmToggleButtonSetState(toggleButton_show_smg,
-			plot_smg, TRUE);
-	XmToggleButtonSetState(toggleButton_heading,
-			plot_heading, TRUE);
-	XmToggleButtonSetState(toggleButton_org_heading,
-			plot_heading_org, TRUE);
-	XmToggleButtonSetState(toggleButton_show_cmg,
-			plot_cmg, TRUE);
-	XmToggleButtonSetState(toggleButton_sonardepth,
-			plot_draft, TRUE);
-	XmToggleButtonSetState(toggleButton_org_sonardepth,
-			plot_draft_org, TRUE);
-
-	/* hide or display items according to toggle states */
-	if (plot_tint == MB_YES)
-		XtManageChild(toggleButton_org_time);
-	else
-		XtUnmanageChild(toggleButton_org_time);
-	if (plot_lon == MB_YES)
-		{
-		XtManageChild(toggleButton_org_lon);
-		if (model_mode == MODEL_MODE_OFF)
-		    {
-		    XtUnmanageChild(toggleButton_dr_lon);
-		    }
-		else if (model_mode == MODEL_MODE_MEAN)
-		    {
-		    set_label_string(toggleButton_dr_lon, "Show Gaussian Mean");
-		    XtManageChild(toggleButton_dr_lon);
-		    }
-		else if (model_mode == MODEL_MODE_DR)
-		    {
-		    set_label_string(toggleButton_dr_lon, "Show Dead Reckoning");
-		    XtManageChild(toggleButton_dr_lon);
-		    }
-		else if (model_mode == MODEL_MODE_INVERT)
-		    {
-		    set_label_string(toggleButton_dr_lon, "Show Smooth Inversion");
-		    XtManageChild(toggleButton_dr_lon);
-		    }
-		}
-	else
-		{
-		XtUnmanageChild(toggleButton_org_lon);
-		XtUnmanageChild(toggleButton_dr_lon);
-		}
-	if (plot_lat == MB_YES)
-		{
-		XtManageChild(toggleButton_org_lat);
-		if (model_mode == MODEL_MODE_OFF)
-		    {
-		    XtUnmanageChild(toggleButton_dr_lat);
-		    }
-		else if (model_mode == MODEL_MODE_MEAN)
-		    {
-		    set_label_string(toggleButton_dr_lat, "Show Gaussian Mean");
-		    XtManageChild(toggleButton_dr_lat);
-		    }
-		else if (model_mode == MODEL_MODE_DR)
-		    {
-		    set_label_string(toggleButton_dr_lat, "Show Dead Reckoning");
-		    XtManageChild(toggleButton_dr_lat);
-		    }
-		else if (model_mode == MODEL_MODE_INVERT)
-		    {
-		    set_label_string(toggleButton_dr_lat, "Show Smooth Inversion");
-		    XtManageChild(toggleButton_dr_lat);
-		    }
-		}
-	else
-		{
-		XtUnmanageChild(toggleButton_org_lat);
-		XtUnmanageChild(toggleButton_dr_lat);
-		}
-	if (plot_speed == MB_YES)
-		{
-		XtManageChild(toggleButton_org_speed);
-		XtManageChild(toggleButton_show_smg);
-		XtManageChild(pushButton_speed_smg);
-		}
-	else
-		{
-		XtUnmanageChild(toggleButton_org_speed);
-		XtUnmanageChild(toggleButton_show_smg);
-		XtUnmanageChild(pushButton_speed_smg);
-		}
-	if (plot_heading == MB_YES)
-		{
-		XtManageChild(toggleButton_org_heading);
-		XtManageChild(toggleButton_show_cmg);
-		XtManageChild(pushButton_heading_cmg);
-		}
-	else
-		{
-		XtUnmanageChild(toggleButton_org_heading);
-		XtUnmanageChild(toggleButton_show_cmg);
-		XtUnmanageChild(pushButton_heading_cmg);
-		}
-	if (plot_draft == MB_YES)
-		{
-		XtManageChild(toggleButton_org_sonardepth);
-		}
-	else
-		{
-		XtUnmanageChild(toggleButton_org_sonardepth);
-		}
-
-	/* get and set size of canvas */
-	number_plots = 0;
-	if (plot_tint == MB_YES)
-		number_plots++;
-	if (plot_lon == MB_YES)
-		number_plots++;
-	if (plot_lat == MB_YES)
-		number_plots++;
-	if (plot_speed == MB_YES)
-		number_plots++;
-	if (plot_heading == MB_YES)
-		number_plots++;
-	if (plot_draft == MB_YES)
-		number_plots++;
-	if (plot_roll == MB_YES)
-		number_plots++;
-	if (plot_pitch == MB_YES)
-		number_plots++;
-	if (plot_heave == MB_YES)
-		number_plots++;
-	XtVaSetValues(drawingArea,
-			XmNwidth, plot_width,
-			XmNheight, number_plots*plot_height,
-			NULL);
-
-	/* set modeling controls and hide or display buttons */
-	if (model_mode == MODEL_MODE_OFF)
-		{
-		XmToggleButtonSetState(toggleButton_modeling_off,
-			TRUE, FALSE);
-		XtUnmanageChild(pushButton_solution);
-		XtUnmanageChild(pushButton_flag);
-		XtUnmanageChild(pushButton_unflag);
-
-		}
-	else if (model_mode == MODEL_MODE_MEAN)
-		{
-		XmToggleButtonSetState(toggleButton_modeling_meanfilter,
-			TRUE, FALSE);
-		XtManageChild(pushButton_solution);
-		XtManageChild(pushButton_flag);
-		XtManageChild(pushButton_unflag);
-		}
-	else if (model_mode == MODEL_MODE_DR)
-		{
-		XmToggleButtonSetState(toggleButton_modeling_dr,
-			TRUE, FALSE);
-		XtManageChild(pushButton_solution);
-		XtUnmanageChild(pushButton_flag);
-		XtUnmanageChild(pushButton_unflag);
-		}
-	else if (model_mode == MODEL_MODE_INVERT)
-		{
-		XmToggleButtonSetState(toggleButton_modeling_inversion,
-			TRUE, FALSE);
-		XtManageChild(pushButton_solution);
-		XtManageChild(pushButton_flag);
-		XtManageChild(pushButton_unflag);
-		}
-	XtVaSetValues(scale_meantimewindow,
-			XmNvalue, mean_time_window,
-			NULL);
-	XtVaSetValues(scale_driftlon,
-			XmNvalue, drift_lon,
-			NULL);
-	XtVaSetValues(scale_driftlat,
-			XmNvalue, drift_lat,
-			NULL);
-	sprintf(value_text,"%.2f",weight_speed);
-	XmTextFieldSetString(
-	    textField_modeling_speed,
-	    value_text);
-	sprintf(value_text,"%.2f",weight_acceleration);
-	XmTextFieldSetString(
-	    textField_modeling_acceleration,
-	    value_text);
-
-	/* enable or disable time interpolation */
-	if (timestamp_problem == MB_YES)
-		{
-		XtVaSetValues(pushButton_controls_timeinterpolation,
-			XmNsensitive, True,
-			NULL);
-		XtVaSetValues(pushButton_controls_deletebadtimetag,
-			XmNsensitive, True,
-			NULL);
-		}
-	else
-		{
-		XtVaSetValues(pushButton_controls_timeinterpolation,
-			XmNsensitive, False,
-			NULL);
-		XtVaSetValues(pushButton_controls_deletebadtimetag,
-			XmNsensitive, False,
-			NULL);
-		XtUnmanageChild(bulletinBoard_deletebadtimetag);
-		XtUnmanageChild(bulletinBoard_timeinterpolation);
-		}
-
-	/* set offset values */
-	sprintf(value_text,"%.5f",offset_lon);
-	XmTextFieldSetString(
-	    textField_lon_offset,
-	    value_text);
-	sprintf(value_text,"%.5f",offset_lat);
-	XmTextFieldSetString(
-	    textField_lat_offset,
-	    value_text);
-
-}
-/*--------------------------------------------------------------------*/
-
-void
-do_build_filelist()
-{
-	int	update_filelist;
-	Cardinal ac;
-	Arg      args[256];
-	int	item_count;
-	int	*position_list = NULL;
-	int	position_count = 0;
-	int	selection;
-	char value_text[MB_PATH_MAXLINE];
-    	XmString *xstr;
-	char	*lockstrptr;
-	char	*lockedstr   = "<Locked>";
-	char	*unlockedstr = "        ";
-	char	*loadedstr   = "<loaded>";
-	char	*nvestrptr;
-	char	*nveyesstr   = "<nve>";
-	char	*nvenostr    = "     ";
-	int     verbose = 0;
-	int	i;
-
-	/* swath file locking variables */
-	int	lock_status;
-	int	lock_error = MB_ERROR_NO_ERROR;
-	int	locked;
-	int	lock_purpose;
-	mb_path	lock_program;
-	mb_path lock_cpu;
-	mb_path lock_user;
-	char	lock_date[25];
-
-	/* nve file checking variables */
-	int	nve_exists;
-	struct stat file_status;
-	int	fstat;
-	char    save_file[MB_PATH_MAXLINE];
-
-	/* check to see if anything has changed */
-	update_filelist = MB_NO;
-
-	/* check for change in number of files */
-	ac = 0;
-	XtSetArg(args[ac], XmNitemCount, (XtPointer) &item_count); ac++;
-	XtGetValues(list_filelist, args, ac);
-	if (item_count != numfiles)
-		update_filelist = MB_YES;
-
-	/* check current file shown vs loaded */
-	if (currentfile != currentfile_shown)
-		{
-		currentfile_shown = currentfile;
-		update_filelist = MB_YES;
-		}
-
-	/* check for change in lock status or nve status */
-	for (i=0;i<numfiles;i++)
-		{
-		/* check for locks */
-		lock_status = mb_pr_lockinfo(verbose, filepaths[i], &locked,
-				&lock_purpose, lock_program, lock_user, lock_cpu,
-				lock_date, &lock_error);
-		if (locked != filelocks[i])
-			{
-			filelocks[i] = locked;
-			update_filelist = MB_YES;
-			}
-
-		/* check for edit save file */
-		sprintf(save_file, "%s.nve", filepaths[i]);
-		fstat = stat(save_file, &file_status);
-		if (fstat == 0
-		    && (file_status.st_mode & S_IFMT) != S_IFDIR)
-			nve_exists = MB_YES;
-		else
-			nve_exists = MB_NO;
-		if (nve_exists != filenves[i])
-			{
-			filenves[i] = nve_exists;
-			update_filelist = MB_YES;
-			}
-		}
-
-	/* only rebuild the filelist if necessary */
-	if (update_filelist == MB_YES)
-		{
-		/* get the current selection, if any, from the list */
-		ac = 0;
-		XtSetArg(args[ac], XmNitemCount, (XtPointer) &item_count); ac++;
-		XtSetArg(args[ac], XmNselectedPositionCount, (XtPointer) &position_count); ac++;
-		XtSetArg(args[ac], XmNselectedPositions, (XtPointer) &position_list); ac++;
-		XtGetValues(list_filelist, args, ac);
-		if (position_count > 0)
-			selection = position_list[0];
-
-		/* build available file list */
-		XmListDeleteAllItems(list_filelist);
-		if (numfiles > 0)
-			{
-
-			/* allocate array of x strings */
-			xstr = (XmString *) malloc(numfiles * sizeof(XmString));
-			for (i=0;i<numfiles;i++)
-				{
-				/* check for locks */
-				if (currentfile == i)
-					lockstrptr = loadedstr;
-				else if (filelocks[i] == MB_YES)
-					lockstrptr = lockedstr;
-				else
-					lockstrptr = unlockedstr;
-
-				/* check for edit save file */
-				if (filenves[i] == MB_YES)
-					nvestrptr = nveyesstr;
-				else
-					nvestrptr = nvenostr;
-
-				/* build x string item */
-				sprintf(value_text,"%s %s %s %3d",
-					lockstrptr,
-					nvestrptr,
-					filepaths[i],
-					fileformats[i]);
-   				xstr[i] = XmStringCreateLocalized(value_text);
-
-				/* print out list of files */
-				/* if (currentfile == i)
-					fprintf(stderr," *** %s %d %s %d\n",lockstrptr,i+1,filepaths[i],fileformats[i]);
-				else
-					fprintf(stderr,"     %s %d %s %d\n",lockstrptr,i+1,filepaths[i],fileformats[i]); */
- 				}
-    			XmListAddItems(list_filelist,xstr,numfiles,0);
-			for (i=0;i<numfiles;i++)
-				{
-    				XmStringFree(xstr[i]);
-    				}
-    			free(xstr);
-
-			/* reinstate selection if the number of items is the same as before */
-			if (item_count == numfiles && position_count > 0)
-				{
-    				XmListSelectPos(list_filelist,selection,False);
-				}
-			}
-		}
-	}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_nextbuffer( Widget w, XtPointer client_data, XtPointer call_data)
-{
-	int	status;
-	int	quit;
-
-	XmAnyCallbackStruct *acs;
-	acs = (XmAnyCallbackStruct*)call_data;
-
-	/* turn off expose plots */
-	expose_plot_ok = False;
-
-	/* get next buffer */
-	status = mbnavedit_action_next_buffer(&quit);
-	if (status == 0) mbnavedit_bell(100);
-	do_unset_interval();
-
-	/* turn on expose plots */
-	expose_plot_ok = True;
-
-	/* quit if in GUI mode */
-	if (quit)
-		exit(0);
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_done( Widget w, XtPointer client_data, XtPointer call_data)
-{
-	int	quit;
-	int	status;
-
-	XmAnyCallbackStruct *acs;
-	acs = (XmAnyCallbackStruct*)call_data;
-
-	/* turn off expose plots */
-	expose_plot_ok = False;
-
-	/* finish with the current file */
-	status = mbnavedit_action_done(&quit);
-	if (status == 0) mbnavedit_bell(100);
-	do_unset_interval();
-
-	/* if there is another file in the list open it */
-	if (currentfile >= 0 && currentfile < numfiles - 1)
-		{
-		do_load_specific_file(currentfile + 1);
-		}
-
-	/* else do not open a file */
-	else
-		{
-		currentfile = -1;
-		}
-
-	/* turn on expose plots */
-	expose_plot_ok = True;
-
-	/* quit if required */
-	if (quit)
-		(void) BxExitCB(w, client_data, call_data);
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_start( Widget w, XtPointer client_data, XtPointer call_data)
-{
-	int	status;
-
-	XmAnyCallbackStruct *acs;
-	acs = (XmAnyCallbackStruct*)call_data;
-
-	/* step forward */
-	status = mbnavedit_action_start();
-	if (status == 0) mbnavedit_bell(100);
-	do_unset_interval();
-}
-/*--------------------------------------------------------------------*/
-
-void
-do_reverse( Widget w, XtPointer client_data, XtPointer call_data)
-{
-	int	status;
-
-	XmAnyCallbackStruct *acs;
-	acs = (XmAnyCallbackStruct*)call_data;
-
-	/* step back */
-	status = mbnavedit_action_step(-data_step_size);
-	if (status == 0) mbnavedit_bell(100);
-	do_unset_interval();
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_forward( Widget w, XtPointer client_data, XtPointer call_data)
-{
-	int	status;
-
-	XmAnyCallbackStruct *acs;
-	acs = (XmAnyCallbackStruct*)call_data;
-
-	/* step forward */
-	status = mbnavedit_action_step(data_step_size);
-	if (status == 0) mbnavedit_bell(100);
-	do_unset_interval();
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_end( Widget w, XtPointer client_data, XtPointer call_data)
-{
-	int	status;
-
-	XmAnyCallbackStruct *acs;
-	acs = (XmAnyCallbackStruct*)call_data;
-
-	/* step back */
-	status = mbnavedit_action_end();
-	if (status == 0) mbnavedit_bell(100);
-	do_unset_interval();
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_timespan( Widget w, XtPointer client_data, XtPointer call_data)
-{
-	XmAnyCallbackStruct *acs;
-	acs = (XmAnyCallbackStruct*)call_data;
-
-	/* get values */
-	XtVaGetValues(scale_timespan,
-			XmNmaximum, &data_show_max,
-			XmNvalue, &data_show_size,
-			NULL);
-
-	/* reset maximum if necessary */
-	if (data_show_size == data_show_max
-		|| data_show_size == 1)
-		{
-		if (data_show_size == data_show_max)
-			data_show_max = 2 * data_show_max;
-		else if (data_show_size == 1)
-			data_show_max = data_show_max/2;
-		if (data_show_max < 10)
-			data_show_max = 10;
-		XtVaSetValues(scale_timespan,
-			XmNmaximum, data_show_max,
-			NULL);
-		sprintf(string, "%d", data_show_max);
-		set_label_string(label_timespan_2, string);
-		}
-
-	/* replot */
-	mbnavedit_plot_all();
-
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_timestep( Widget w, XtPointer client_data, XtPointer call_data)
-{
-	XmAnyCallbackStruct *acs;
-	acs = (XmAnyCallbackStruct*)call_data;
-
-	/* get values */
-	XtVaGetValues(scale_timestep,
-			XmNmaximum, &data_step_max,
-			XmNvalue, &data_step_size,
-			NULL);
-
-	/* reset maximum if necessary */
-	if (data_step_size == data_step_max
-		|| data_step_size == 1)
-		{
-		if (data_step_size == data_step_max)
-			data_step_max = 2 * data_step_max;
-		else if (data_step_size == 1)
-			data_step_max = data_step_max/2;
-		if (data_step_max < 10)
-			data_step_max = 10;
-		XtVaSetValues(scale_timestep,
-			XmNmaximum, data_step_max,
-			NULL);
-		sprintf(string, "%d", data_step_max);
-		set_label_string(label_timestep_2, string);
-		}
-
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_expose( Widget w, XtPointer client_data, XtPointer call_data)
-{
-	XmAnyCallbackStruct *acs;
-	acs = (XmAnyCallbackStruct*)call_data;
-
-	/* replot */
-	if (expose_plot_ok == True)
-	    mbnavedit_plot_all();
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_event( Widget w, XtPointer client_data, XtPointer call_data)
-{
-	XmDrawingAreaCallbackStruct *cbs;
-	XEvent  *event;
-	static Position x_loc, y_loc;
-	unsigned int mask;
-	KeySym	keysym;
-	char	buffer[1];
-	int	actual;
-	int	win_x, win_y;
-	int	repeat;
-	int	status;
-
-	XmAnyCallbackStruct *acs;
-	acs = (XmAnyCallbackStruct*)call_data;
-
-	/* get event */
-	cbs = (XmDrawingAreaCallbackStruct *) call_data;
-	event = cbs->event;
-
-	/* If there is input in the drawing area */
-	if (cbs->reason == XmCR_INPUT)
-	{
-	  /* Deal with KeyPress events */
-	  if(event->xany.type == KeyPress)
-	  {
-	  /* Get key pressed - buffer[0] */
-	  actual = XLookupString((XKeyEvent *)event,
-			buffer, 1, &keysym, NULL);
-
-	  /* process events */
-	  switch (buffer[0])
-		{
-		case 'Y':
-		case 'y':
-		case 'Q':
-		case 'q':
-				{
-				mode_pick = PICK_MODE_PICK;
-				do_unset_interval();
-				XmToggleButtonSetState(toggleButton_pick,
-					TRUE, TRUE);
-				mbnavedit_pickcursor();
-				}
-			break;
-		case 'U':
-		case 'u':
-		case 'W':
-		case 'w':
-				{
-				mode_pick = PICK_MODE_SELECT;
-				do_unset_interval();
-				XmToggleButtonSetState(toggleButton_select,
-					TRUE, TRUE);
-				mbnavedit_selectcursor();
-				}
-			break;
-		case 'I':
-		case 'i':
-		case 'E':
-		case 'e':
-				{
-				mode_pick = PICK_MODE_DESELECT;
-				do_unset_interval();
-				XmToggleButtonSetState(toggleButton_deselect,
-					TRUE, TRUE);
-				mbnavedit_deselectcursor();
-				}
-			break;
-		case 'O':
-		case 'o':
-		case 'R':
-		case 'r':
-				{
-				mode_pick = PICK_MODE_SELECTALL;
-				do_unset_interval();
-				XmToggleButtonSetState(toggleButton_selectall,
-					TRUE, TRUE);
-				mbnavedit_selectallcursor();
-				}
-			break;
-		case 'P':
-		case 'p':
-		case 'T':
-		case 't':
-				{
-				mode_pick = PICK_MODE_DESELECTALL;
-				do_unset_interval();
-				XmToggleButtonSetState(toggleButton_deselectall,
-					TRUE, TRUE);
-				mbnavedit_deselectallcursor();
-				}
-			break;
-		default:
-			break;
-	      } /* end of key switch */
-
-	   } /* end of key press events */
-
-	  /* Deal with KeyRelease events */
-	  if(event->xany.type == KeyRelease)
-	  {
-	  /* Get key pressed - buffer[0] */
-	  actual = XLookupString((XKeyEvent *)event,
-			buffer, 1, &keysym, NULL);
-
-	  /* process events */
-	  switch (buffer[0])
-		{
-		default:
-			break;
-	      } /* end of key switch */
-
-	   } /* end of key release events */
-
-	  /* Check for mouse pressed and not pressed and released. */
-	  if(event->xany.type == ButtonPress)
-	  {
-	      /* If left mouse button is pushed then
-		    pick, erase, restore or set time interval. */
-	      if(event->xbutton.button == 1)
-	      {
-		x_loc = event->xbutton.x;
-		y_loc = event->xbutton.y;
-
-		do
-		    {
-	            if (mode_set_interval == MB_YES)
-			{
-			status = mbnavedit_action_set_interval(
-				x_loc, y_loc, 0);
-			if (status == MB_FAILURE)
-				mbnavedit_bell(100);
-			}
-	            else if (mode_pick == PICK_MODE_PICK)
-			status = mbnavedit_action_mouse_pick(
-				x_loc, y_loc);
-		    else if (mode_pick == PICK_MODE_SELECT)
-			status = mbnavedit_action_mouse_select(
-				x_loc, y_loc);
-		    else if (mode_pick == PICK_MODE_DESELECT)
-			status = mbnavedit_action_mouse_deselect(
-				x_loc, y_loc);
-		    else if (mode_pick == PICK_MODE_SELECTALL)
-			status = mbnavedit_action_mouse_selectall(
-				x_loc, y_loc);
-		    else if (mode_pick == PICK_MODE_DESELECTALL)
-			status = mbnavedit_action_mouse_deselectall(
-				x_loc, y_loc);
-
-		    /* get current cursor position */
-		    mbnavedit_get_position(&win_x, &win_y, &mask);
-		    x_loc = win_x;
-		    y_loc = win_y;
-
-		    /* If the button is still pressed then read the location */
-		    /* of the pointer and run the action mouse function again */
-		    if (mask == 256 && mode_pick != PICK_MODE_PICK
-			    && mode_set_interval == MB_NO)
-			   repeat = MB_YES;
-		    else
-			   repeat = MB_NO;
-		    }
-		while (repeat == MB_YES);
-
-		} /* end of left button events */
-
-		/* If middle mouse button is pushed. */
-		if(event->xbutton.button == 2)
-		{
-		    /* get current cursor position */
-		    mbnavedit_get_position(&win_x, &win_y, &mask);
-		    x_loc = win_x;
-		    y_loc = win_y;
-
-		    /* set second interval bound */
-	            if (mode_set_interval == MB_YES)
-			{
-			status = mbnavedit_action_set_interval(
-				x_loc, y_loc, 1);
-			if (status == MB_FAILURE)
-				mbnavedit_bell(100);
-			}
-
-		    /* scroll in reverse */
-		    else
-			{
-			status = mbnavedit_action_step(-data_step_size);
-			if (status == 0) mbnavedit_bell(100);
-			}
-		} /* end of middle button events */
-
-		/* If right mouse button is pushed. */
-		if(event->xbutton.button == 3)
-		{
-		    /* apply interval bounds */
-	            if (mode_set_interval == MB_YES)
-			{
-			status = mbnavedit_action_set_interval(
-				0, 0, 2);
-			if (status == MB_FAILURE)
-				mbnavedit_bell(100);
-			do_unset_interval();
-
-			/* set values of number of data shown slider */
-			XtVaSetValues(scale_timespan,
-				XmNminimum, 1,
-				XmNmaximum, data_show_max,
-				XmNvalue, MAX(data_show_size, 1),
-				NULL);
-			sprintf(string, "%d", data_show_max);
-			set_label_string(label_timespan_2, string);
-
-			/* set values of number of data to step slider */
-			XtVaSetValues(scale_timestep,
-					XmNminimum, 1,
-					XmNmaximum, data_step_max,
-					XmNvalue, data_step_size,
-					NULL);
-			sprintf(string, "%d", data_step_max);
-			XtVaSetValues(label_timestep_2,
-					XtVaTypedArg, XmNlabelString,
-					    XmRString, string, (strlen(string) + 1),
-					NULL);
-			}
-
-		    /* scroll forward */
-		    else
-			{
-			status = mbnavedit_action_step(data_step_size);
-			if (status == 0) mbnavedit_bell(100);
-			}
-		} /* end of right button events */
-	  } /* end of button pressed events */
-	} /* end of inputs from window */
-
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_resize( Widget w, XtPointer client_data, XEvent *event, Boolean *unused)
-{
-	XConfigureEvent *cevent = (XConfigureEvent *) event;
-	Dimension   width, height;
-
-	/* do this only if a resize event happens */
-	if (cevent->type == ConfigureNotify)
-		{
-		XtVaGetValues(bulletinBoard,
-			XmNwidth, &width,
-			XmNheight, &height,
-			NULL);
-		window_width = (int)width - 220;
-		window_height = (int)height - 90;
-		XtVaSetValues(scrolledWindow,
-			XmNwidth, (Dimension)window_width,
-			XmNheight, (Dimension)window_height,
-			NULL);
-		}
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_toggle_time( Widget w, XtPointer client_data, XtPointer call_data)
-{
-	int	screen_height;
-
-	XmAnyCallbackStruct *acs;
-	acs = (XmAnyCallbackStruct*)call_data;
-
-	plot_tint = XmToggleButtonGetState(toggleButton_time);
-	if (plot_tint == MB_YES)
-		XtManageChild(toggleButton_org_time);
-	else
-		{
-		XtUnmanageChild(toggleButton_org_time);
-		mbnavedit_action_deselect_all(PLOT_TINT);
-		}
-
-	/* get and set size of canvas */
-	number_plots = 0;
-	if (plot_tint == MB_YES)
-		number_plots++;
-	if (plot_lon == MB_YES)
-		number_plots++;
-	if (plot_lat == MB_YES)
-		number_plots++;
-	if (plot_speed == MB_YES)
-		number_plots++;
-	if (plot_heading == MB_YES)
-		number_plots++;
-	if (plot_draft == MB_YES)
-		number_plots++;
-	if (plot_roll == MB_YES)
-		number_plots++;
-	if (plot_pitch == MB_YES)
-		number_plots++;
-	if (plot_heave == MB_YES)
-		number_plots++;
-	screen_height = number_plots*plot_height;
-	if (screen_height <= 0)
-		screen_height = plot_height;
-	XtVaSetValues(drawingArea,
-			XmNwidth, plot_width,
-			XmNheight, screen_height,
-			NULL);
-
-	/* replot */
-	mbnavedit_plot_all();
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_toggle_lon( Widget w, XtPointer client_data, XtPointer call_data)
-{
-	int	screen_height;
-
-	XmAnyCallbackStruct *acs;
-	acs = (XmAnyCallbackStruct*)call_data;
-
-	plot_lon = XmToggleButtonGetState(toggleButton_lon);
-	if (plot_lon == MB_YES)
-		{
-		XtManageChild(toggleButton_org_lon);
-		XtManageChild(toggleButton_dr_lon);
-		}
-	else
-		{
-		XtUnmanageChild(toggleButton_org_lon);
-		XtUnmanageChild(toggleButton_dr_lon);
-		mbnavedit_action_deselect_all(PLOT_LONGITUDE);
-		}
-
-	/* get and set size of canvas */
-	number_plots = 0;
-	if (plot_tint == MB_YES)
-		number_plots++;
-	if (plot_lon == MB_YES)
-		number_plots++;
-	if (plot_lat == MB_YES)
-		number_plots++;
-	if (plot_speed == MB_YES)
-		number_plots++;
-	if (plot_heading == MB_YES)
-		number_plots++;
-	if (plot_draft == MB_YES)
-		number_plots++;
-	if (plot_roll == MB_YES)
-		number_plots++;
-	if (plot_pitch == MB_YES)
-		number_plots++;
-	if (plot_heave == MB_YES)
-		number_plots++;
-	screen_height = number_plots*plot_height;
-	if (screen_height <= 0)
-		screen_height = plot_height;
-	XtVaSetValues(drawingArea,
-			XmNwidth, plot_width,
-			XmNheight, screen_height,
-			NULL);
-
-	/* replot */
-	mbnavedit_plot_all();
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_toggle_lat( Widget w, XtPointer client_data, XtPointer call_data)
-{
-	int	screen_height;
-
-	XmAnyCallbackStruct *acs;
-	acs = (XmAnyCallbackStruct*)call_data;
-
-	plot_lat = XmToggleButtonGetState(toggleButton_lat);
-	if (plot_lat == MB_YES)
-		{
-		XtManageChild(toggleButton_org_lat);
-		XtManageChild(toggleButton_dr_lat);
-		}
-	else
-		{
-		XtUnmanageChild(toggleButton_org_lat);
-		XtUnmanageChild(toggleButton_dr_lat);
-		mbnavedit_action_deselect_all(PLOT_LATITUDE);
-		}
-
-	/* get and set size of canvas */
-	number_plots = 0;
-	if (plot_tint == MB_YES)
-		number_plots++;
-	if (plot_lon == MB_YES)
-		number_plots++;
-	if (plot_lat == MB_YES)
-		number_plots++;
-	if (plot_speed == MB_YES)
-		number_plots++;
-	if (plot_heading == MB_YES)
-		number_plots++;
-	if (plot_draft == MB_YES)
-		number_plots++;
-	if (plot_roll == MB_YES)
-		number_plots++;
-	if (plot_pitch == MB_YES)
-		number_plots++;
-	if (plot_heave == MB_YES)
-		number_plots++;
-	screen_height = number_plots*plot_height;
-	if (screen_height <= 0)
-		screen_height = plot_height;
-	XtVaSetValues(drawingArea,
-			XmNwidth, plot_width,
-			XmNheight, screen_height,
-			NULL);
-
-	/* replot */
-	mbnavedit_plot_all();
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_toggle_heading( Widget w, XtPointer client_data, XtPointer call_data)
-{
-	int	screen_height;
-
-	XmAnyCallbackStruct *acs;
-	acs = (XmAnyCallbackStruct*)call_data;
-
-	plot_heading = XmToggleButtonGetState(toggleButton_heading);
-	if (plot_heading == MB_YES)
-		{
-		XtManageChild(toggleButton_org_heading);
-		XtManageChild(toggleButton_show_cmg);
-		XtManageChild(pushButton_heading_cmg);
-		}
-	else
-		{
-		XtUnmanageChild(toggleButton_org_heading);
-		XtUnmanageChild(toggleButton_show_cmg);
-		XtUnmanageChild(pushButton_heading_cmg);
-		mbnavedit_action_deselect_all(PLOT_HEADING);
-		}
-
-	/* get and set size of canvas */
-	number_plots = 0;
-	if (plot_tint == MB_YES)
-		number_plots++;
-	if (plot_lon == MB_YES)
-		number_plots++;
-	if (plot_lat == MB_YES)
-		number_plots++;
-	if (plot_speed == MB_YES)
-		number_plots++;
-	if (plot_heading == MB_YES)
-		number_plots++;
-	if (plot_draft == MB_YES)
-		number_plots++;
-	if (plot_roll == MB_YES)
-		number_plots++;
-	if (plot_pitch == MB_YES)
-		number_plots++;
-	if (plot_heave == MB_YES)
-		number_plots++;
-	screen_height = number_plots*plot_height;
-	if (screen_height <= 0)
-		screen_height = plot_height;
-	XtVaSetValues(drawingArea,
-			XmNwidth, plot_width,
-			XmNheight, screen_height,
-			NULL);
-
-	/* replot */
-	mbnavedit_plot_all();
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_toggle_speed( Widget w, XtPointer client_data, XtPointer call_data)
-{
-	int	screen_height;
-
-	XmAnyCallbackStruct *acs;
-	acs = (XmAnyCallbackStruct*)call_data;
-
-	plot_speed = XmToggleButtonGetState(toggleButton_speed);
-	if (plot_speed == MB_YES)
-		{
-		XtManageChild(toggleButton_org_speed);
-		XtManageChild(toggleButton_show_smg);
-		XtManageChild(pushButton_speed_smg);
-		}
-	else
-		{
-		XtUnmanageChild(toggleButton_org_speed);
-		XtUnmanageChild(toggleButton_show_smg);
-		XtUnmanageChild(pushButton_speed_smg);
-		mbnavedit_action_deselect_all(PLOT_SPEED);
-		}
-
-	/* get and set size of canvas */
-	number_plots = 0;
-	number_plots = 0;
-	if (plot_tint == MB_YES)
-		number_plots++;
-	if (plot_lon == MB_YES)
-		number_plots++;
-	if (plot_lat == MB_YES)
-		number_plots++;
-	if (plot_speed == MB_YES)
-		number_plots++;
-	if (plot_heading == MB_YES)
-		number_plots++;
-	if (plot_draft == MB_YES)
-		number_plots++;
-	if (plot_roll == MB_YES)
-		number_plots++;
-	if (plot_pitch == MB_YES)
-		number_plots++;
-	if (plot_heave == MB_YES)
-		number_plots++;
-	screen_height = number_plots*plot_height;
-	if (screen_height <= 0)
-		screen_height = plot_height;
-	XtVaSetValues(drawingArea,
-			XmNwidth, plot_width,
-			XmNheight, screen_height,
-			NULL);
-
-	/* replot */
-	mbnavedit_plot_all();
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_toggle_sonardepth( Widget w, XtPointer client_data, XtPointer call_data)
-{
-	int	screen_height;
-
-	XmAnyCallbackStruct *acs;
-	acs = (XmAnyCallbackStruct*)call_data;
-
-	plot_draft = XmToggleButtonGetState(toggleButton_sonardepth);
-	if (plot_draft == MB_YES)
-		{
-		XtManageChild(toggleButton_org_sonardepth);
-		}
-	else
-		{
-		XtUnmanageChild(toggleButton_org_sonardepth);
-		mbnavedit_action_deselect_all(PLOT_DRAFT);
-		}
-
-	/* get and set size of canvas */
-	number_plots = 0;
-	number_plots = 0;
-	if (plot_tint == MB_YES)
-		number_plots++;
-	if (plot_lon == MB_YES)
-		number_plots++;
-	if (plot_lat == MB_YES)
-		number_plots++;
-	if (plot_speed == MB_YES)
-		number_plots++;
-	if (plot_heading == MB_YES)
-		number_plots++;
-	if (plot_draft == MB_YES)
-		number_plots++;
-	if (plot_roll == MB_YES)
-		number_plots++;
-	if (plot_pitch == MB_YES)
-		number_plots++;
-	if (plot_heave == MB_YES)
-		number_plots++;
-	screen_height = number_plots*plot_height;
-	if (screen_height <= 0)
-		screen_height = plot_height;
-	XtVaSetValues(drawingArea,
-			XmNwidth, plot_width,
-			XmNheight, screen_height,
-			NULL);
-
-	/* replot */
-	mbnavedit_plot_all();
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_toggle_org_time( Widget w, XtPointer client_data, XtPointer call_data)
-{
-	XmAnyCallbackStruct *acs;
-	acs = (XmAnyCallbackStruct*)call_data;
-
-	plot_tint_org = XmToggleButtonGetState(toggleButton_org_time);
-
-	/* replot */
-	mbnavedit_plot_all();
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_toggle_org_lon( Widget w, XtPointer client_data, XtPointer call_data)
-{
-	XmAnyCallbackStruct *acs;
-	acs = (XmAnyCallbackStruct*)call_data;
-
-	plot_lon_org = XmToggleButtonGetState(toggleButton_org_lon);
-
-	/* replot */
-	mbnavedit_plot_all();
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_toggle_org_lat( Widget w, XtPointer client_data, XtPointer call_data)
-{
-	XmAnyCallbackStruct *acs;
-	acs = (XmAnyCallbackStruct*)call_data;
-
-	plot_lat_org = XmToggleButtonGetState(toggleButton_org_lat);
-
-	/* replot */
-	mbnavedit_plot_all();
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_toggle_org_speed( Widget w, XtPointer client_data, XtPointer call_data)
-{
-	XmAnyCallbackStruct *acs;
-	acs = (XmAnyCallbackStruct*)call_data;
-
-	plot_speed_org = XmToggleButtonGetState(toggleButton_org_speed);
-
-	/* replot */
-	mbnavedit_plot_all();
-}
-/*--------------------------------------------------------------------*/
-
-void
-do_toggle_dr_lat( Widget w, XtPointer client_data, XtPointer call_data)
-{
-	XmAnyCallbackStruct *acs;
-	acs = (XmAnyCallbackStruct*)call_data;
-
-	plot_lat_dr = XmToggleButtonGetState(toggleButton_dr_lat);
-
-	/* replot */
-	mbnavedit_plot_all();
-}
-/*--------------------------------------------------------------------*/
-
-void
-do_toggle_dr_lon( Widget w, XtPointer client_data, XtPointer call_data)
-{
-	XmAnyCallbackStruct *acs;
-	acs = (XmAnyCallbackStruct*)call_data;
-
-	plot_lon_dr = XmToggleButtonGetState(toggleButton_dr_lon);
-
-	/* replot */
-	mbnavedit_plot_all();
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_flag( Widget w, XtPointer client_data, XtPointer call_data)
-{
-	XmAnyCallbackStruct *acs;
-	acs = (XmAnyCallbackStruct*)call_data;
-
-	/* interpolate time stamps */
-	mbnavedit_action_flag();
-
-	/* replot */
-	mbnavedit_plot_all();
-
-	/* update controls */
-	do_set_controls();
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_unflag( Widget w, XtPointer client_data, XtPointer call_data)
-{
-	XmAnyCallbackStruct *acs;
-	acs = (XmAnyCallbackStruct*)call_data;
-
-	/* interpolate time stamps */
-	mbnavedit_action_unflag();
-
-	/* replot */
-	mbnavedit_plot_all();
-
-	/* update controls */
-	do_set_controls();
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_modeling_apply( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    double  dvalue;
-	XmAnyCallbackStruct *acs;
-	acs = (XmAnyCallbackStruct*)call_data;
-
-	get_text_string(textField_modeling_speed, string);
-	if (sscanf(string, "%lf", &dvalue) == 1)
-		weight_speed = dvalue;
-
-	get_text_string(textField_modeling_acceleration, string);
-	if (sscanf(string, "%lf", &dvalue) == 1)
-		weight_acceleration = dvalue;
-
-	do_set_controls();
-
-	/* recalculate model */
-	mbnavedit_get_model();
-
-	/* replot */
-	mbnavedit_plot_all();
-
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_model_mode( Widget w, XtPointer client_data, XtPointer call_data)
-{
-	XmAnyCallbackStruct *acs;
-	acs = (XmAnyCallbackStruct*)call_data;
-
-	if (XmToggleButtonGetState(toggleButton_modeling_off))
-	    model_mode = MODEL_MODE_OFF;
-	else if (XmToggleButtonGetState(toggleButton_modeling_meanfilter))
-	    model_mode = MODEL_MODE_MEAN;
-	else if (XmToggleButtonGetState(toggleButton_modeling_dr))
-	    model_mode = MODEL_MODE_DR;
-	else
-	    model_mode = MODEL_MODE_INVERT;
-	if (model_mode != MODEL_MODE_OFF)
-	    {
-	    plot_lon_dr = TRUE;
-	    plot_lat_dr = TRUE;
-	    }
-
-	do_set_controls();
-
-	/* recalculate model */
-	mbnavedit_get_model();
-
-	/* replot */
-	mbnavedit_plot_all();
-
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_timeinterpolation_apply( Widget w, XtPointer client_data, XtPointer call_data)
-{
-	XmAnyCallbackStruct *acs;
-	acs = (XmAnyCallbackStruct*)call_data;
-
-	/* interpolate time stamps */
-	mbnavedit_action_fixtime();
-
-	/* reset timestamp problem flag */
-	timestamp_problem = MB_NO;
-
-	/* replot */
-	mbnavedit_plot_all();
-
-	/* update controls */
-	do_set_controls();
-
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_deletebadtimetag_apply( Widget w, XtPointer client_data, XtPointer call_data)
-{
-	XmAnyCallbackStruct *acs;
-	acs = (XmAnyCallbackStruct*)call_data;
-
-	/* interpolate time stamps */
-	mbnavedit_action_deletebadtime();
-
-	/* reset timestamp problem flag */
-	timestamp_problem = MB_NO;
-
-	/* replot */
-	mbnavedit_plot_all();
-
-	/* update controls */
-	do_set_controls();
-}
-
-/*--------------------------------------------------------------------*/
-
-
-void
-do_meantimewindow( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    	XmAnyCallbackStruct *acs;
-	acs = (XmAnyCallbackStruct*)call_data;
-
-	XtVaGetValues(scale_meantimewindow,
-			XmNvalue, &mean_time_window,
-			NULL);
-
-	/* recalculate model */
-	mbnavedit_get_model();
-
-	/* replot */
-	mbnavedit_plot_all();
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_driftlon( Widget w, XtPointer client_data, XtPointer call_data)
-{
-	XmAnyCallbackStruct *acs;
-	acs = (XmAnyCallbackStruct*)call_data;
-
-	XtVaGetValues(scale_driftlon,
-			XmNvalue, &drift_lon,
-			NULL);
-
-	/* recalculate model */
-	mbnavedit_get_model();
-
-	/* replot */
-	mbnavedit_plot_all();
-}
-/*--------------------------------------------------------------------*/
-
-void
-do_driftlat( Widget w, XtPointer client_data, XtPointer call_data)
-{
-	XmAnyCallbackStruct *acs;
-	acs = (XmAnyCallbackStruct*)call_data;
-
-	XtVaGetValues(scale_driftlat,
-			XmNvalue, &drift_lat,
-			NULL);
-
-	/* recalculate model */
-	mbnavedit_get_model();
-
-	/* replot */
-	mbnavedit_plot_all();
-}
-/*--------------------------------------------------------------------*/
-
-void
-do_offset_apply( Widget w, XtPointer client_data, XtPointer call_data)
-{
-	char	value_text[MB_PATH_MAXLINE];
-    	double  dvalue;
-	XmAnyCallbackStruct *acs;
-	acs = (XmAnyCallbackStruct*)call_data;
-
-	/* get values from widgets */
-	get_text_string(textField_lon_offset, string);
-	if (sscanf(string, "%lf", &dvalue) == 1)
-		offset_lon = dvalue;
-	get_text_string(textField_lat_offset, string);
-	if (sscanf(string, "%lf", &dvalue) == 1)
-		offset_lat = dvalue;
-
-	/* reset widgets so user sees what got applied */
-	sprintf(value_text,"%.5f",offset_lon);
-	XmTextFieldSetString(
-	    textField_lon_offset,
-	    value_text);
-	sprintf(value_text,"%.5f",offset_lat);
-	XmTextFieldSetString(
-	    textField_lat_offset,
-	    value_text);
-
-	/* apply offsets */
-	mbnavedit_action_offset();
-
-	/* replot */
-	mbnavedit_plot_all();
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_toggle_show_smg( Widget w, XtPointer client_data, XtPointer call_data)
-{
-	XmAnyCallbackStruct *acs;
-	acs = (XmAnyCallbackStruct*)call_data;
-
-	plot_smg = XmToggleButtonGetState(toggleButton_show_smg);
-
-	/* replot */
-	mbnavedit_plot_all();
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_toggle_org_heading( Widget w, XtPointer client_data, XtPointer call_data)
-{
-	XmAnyCallbackStruct *acs;
-	acs = (XmAnyCallbackStruct*)call_data;
-
-	plot_heading_org = XmToggleButtonGetState(toggleButton_org_heading);
-
-	/* replot */
-	mbnavedit_plot_all();
-}
-/*--------------------------------------------------------------------*/
-
-void
-do_toggle_org_sonardepth( Widget w, XtPointer client_data, XtPointer call_data)
-{
-	XmAnyCallbackStruct *acs;
-	acs = (XmAnyCallbackStruct*)call_data;
-
-	plot_draft_org = XmToggleButtonGetState(toggleButton_org_sonardepth);
-
-	/* replot */
-	mbnavedit_plot_all();
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_toggle_show_cmg( Widget w, XtPointer client_data, XtPointer call_data)
-{
-	XmAnyCallbackStruct *acs;
-	acs = (XmAnyCallbackStruct*)call_data;
-
-	plot_cmg = XmToggleButtonGetState(toggleButton_show_cmg);
-
-	/* replot */
-	mbnavedit_plot_all();
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_button_use_dr( Widget w, XtPointer client_data, XtPointer call_data)
-{
-	XmAnyCallbackStruct *acs;
-	acs = (XmAnyCallbackStruct*)call_data;
-
-	/* Use dr for selected lonlat values */
-	mbnavedit_action_use_dr();
-
-	/* replot */
-	mbnavedit_plot_all();
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_button_use_smg( Widget w, XtPointer client_data, XtPointer call_data)
-{
-	XmAnyCallbackStruct *acs;
-	acs = (XmAnyCallbackStruct*)call_data;
-
-	/* Use speed made good for selected speed values */
-	mbnavedit_action_use_smg();
-
-	/* replot */
-	mbnavedit_plot_all();
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_button_use_cmg( Widget w, XtPointer client_data, XtPointer call_data)
-{
-	XmAnyCallbackStruct *acs;
-	acs = (XmAnyCallbackStruct*)call_data;
-
-	/* Use course made good for selected heading values */
-	mbnavedit_action_use_cmg();
-
-	/* replot */
-	mbnavedit_plot_all();
-}
-/*--------------------------------------------------------------------*/
-
-void
-do_toggle_output_on( Widget w, XtPointer client_data, XtPointer call_data)
-{
-	XmAnyCallbackStruct *acs;
-	acs = (XmAnyCallbackStruct*)call_data;
-
-	if (XmToggleButtonGetState(toggleButton_output_on))
-		{
-		output_mode = OUTPUT_MODE_OUTPUT;
-	    	XmToggleButtonSetState(toggleButton_output_on_filelist,
-			TRUE, FALSE);
-	    	XmToggleButtonSetState(toggleButton_output_off_filelist,
-			FALSE, FALSE);
-		}
-	else
-		{
-		output_mode = OUTPUT_MODE_BROWSE;
-	    	XmToggleButtonSetState(toggleButton_output_on_filelist,
-			FALSE, FALSE);
-	    	XmToggleButtonSetState(toggleButton_output_off_filelist,
-			TRUE, FALSE);
-		}
-}
-
-
-/*--------------------------------------------------------------------*/
-
-void
-do_toggle_output_off( Widget w, XtPointer client_data, XtPointer call_data)
-{
-	XmAnyCallbackStruct *acs;
-	acs = (XmAnyCallbackStruct*)call_data;
-
-	if (XmToggleButtonGetState(toggleButton_output_on))
-		{
-		output_mode = OUTPUT_MODE_OUTPUT;
-	    	XmToggleButtonSetState(toggleButton_output_on_filelist,
-			TRUE, FALSE);
-	    	XmToggleButtonSetState(toggleButton_output_off_filelist,
-			FALSE, FALSE);
-		}
-	else
-		{
-		output_mode = OUTPUT_MODE_BROWSE;
-	    	XmToggleButtonSetState(toggleButton_output_on_filelist,
-			FALSE, FALSE);
-	    	XmToggleButtonSetState(toggleButton_output_off_filelist,
-			TRUE, FALSE);
-		}
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_toggle_output_on_filelist( Widget w, XtPointer client_data, XtPointer call_data)
-{
-	XmAnyCallbackStruct *acs;
-	acs = (XmAnyCallbackStruct*)call_data;
-
-	if (XmToggleButtonGetState(toggleButton_output_on_filelist))
-		{
-		output_mode = OUTPUT_MODE_OUTPUT;
-	    	XmToggleButtonSetState(toggleButton_output_on,
-			TRUE, FALSE);
-	    	XmToggleButtonSetState(toggleButton_output_off,
-			FALSE, FALSE);
-		}
-	else
-		{
-		output_mode = OUTPUT_MODE_BROWSE;
-	    	XmToggleButtonSetState(toggleButton_output_on,
-			FALSE, FALSE);
-	    	XmToggleButtonSetState(toggleButton_output_off,
-			TRUE, FALSE);
-		}
-}
-
-
-/*--------------------------------------------------------------------*/
-
-void
-do_toggle_output_off_filelist( Widget w, XtPointer client_data, XtPointer call_data)
-{
-	XmAnyCallbackStruct *acs;
-	acs = (XmAnyCallbackStruct*)call_data;
-
-	if (XmToggleButtonGetState(toggleButton_output_on_filelist))
-		{
-		output_mode = OUTPUT_MODE_OUTPUT;
-	    	XmToggleButtonSetState(toggleButton_output_on,
-			TRUE, FALSE);
-	    	XmToggleButtonSetState(toggleButton_output_off,
-			FALSE, FALSE);
-		}
-	else
-		{
-		output_mode = OUTPUT_MODE_BROWSE;
-	    	XmToggleButtonSetState(toggleButton_output_on,
-			FALSE, FALSE);
-	    	XmToggleButtonSetState(toggleButton_output_off,
-			TRUE, FALSE);
-		}
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_fileselection_cancel( Widget w, XtPointer client_data, XtPointer call_data)
-{
-	XmAnyCallbackStruct *acs;
-	acs = (XmAnyCallbackStruct*)call_data;
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_filebutton_on()
-{
-	Boolean  argok = False;
-        XmString    tmp0;
-
-	XtVaSetValues(pushButton_file,
-		XmNsensitive, True,
-		NULL);
-	XtVaSetValues(pushButton_done,
-		XmNsensitive, False,
-		NULL);
-        tmp0 = (XmString) BX_CONVERT(pushButton_done, (char *)"Done",
-                			XmRXmString, 0, &argok);
-	XtVaSetValues(pushButton_done,
-		XmNlabelString, tmp0,
-		NULL);
-        XmStringFree((XmString)tmp0);
-
-	XtVaSetValues(pushButton_forward,
-		XmNsensitive, False,
-		NULL);
-	XtVaSetValues(pushButton_reverse,
-		XmNsensitive, False,
-		NULL);
-	XtVaSetValues(pushButton_start,
-		XmNsensitive, False,
-		NULL);
-	XtVaSetValues(pushButton_end,
-		XmNsensitive, False,
-		NULL);
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_filebutton_off()
-{
-	Boolean  argok = False;
-        XmString    tmp0;
-
-	XtVaSetValues(pushButton_file,
-		XmNsensitive, True,
-		NULL);
-	XtVaSetValues(pushButton_done,
-		XmNsensitive, True,
-		NULL);
-	if (numfiles > 0 && currentfile >= 0 && currentfile < numfiles - 1)
-		{
-        	tmp0 = (XmString) BX_CONVERT(pushButton_done, (char *)"Next File",
-                				XmRXmString, 0, &argok);
-		XtVaSetValues(pushButton_done,
-			XmNlabelString, tmp0,
-			NULL);
-        	XmStringFree((XmString)tmp0);
-		}
-	else
-		{
-        	tmp0 = (XmString) BX_CONVERT(pushButton_done, (char *)"Done",
-                				XmRXmString, 0, &argok);
-		XtVaSetValues(pushButton_done,
-			XmNlabelString, tmp0,
-			NULL);
-        	XmStringFree((XmString)tmp0);
-		}
-	XtVaSetValues(pushButton_forward,
-		XmNsensitive, True,
-		NULL);
-	XtVaSetValues(pushButton_reverse,
-		XmNsensitive, True,
-		NULL);
-	XtVaSetValues(pushButton_start,
-		XmNsensitive, True,
-		NULL);
-	XtVaSetValues(pushButton_end,
-		XmNsensitive, True,
-		NULL);
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_fileselection_ok( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmFileSelectionBoxCallbackStruct *acs=(XmFileSelectionBoxCallbackStruct*)call_data;
-
-    char    *input_file_ptr;
-    static  char format_text[40];
-    int		format;
-    int		numfilessave;
-    int		quit;
-
-    /* read the input file name */
-    if(!XmStringGetLtoR(acs->value,
-	XmSTRING_DEFAULT_CHARSET,
-	&input_file_ptr))
-	{
-	fprintf(stderr,"\nno input multibeam file selected\n");
-	}
-    else
-	{
-	/* turn off expose plots */
-	expose_plot_ok = False;
-
-	/* close out previously open file */
-	status = mbnavedit_action_done(&quit);
-	if (status == 0) XBell(display,100);
-	currentfile = -1;
-
-	/* read the input file name */
-	numfilessave = numfiles;
-	strncpy(input_file, input_file_ptr, MB_PATH_MAXLINE);
-	XtFree(input_file_ptr);
-
-	/* read the mbio format number from the dialog */
-	get_text_string(textField_format, format_text);
-	sscanf(format_text, "%d", &format);
-
-	/* try to parse the selection */
-	do_parse_datalist(input_file, format);
-
-	/* load first new file in the list */
-	if (numfiles > 0 && numfilessave < numfiles)
-	    {
-	    currentfile = numfilessave;
-	    do_load_specific_file(numfilessave);
-	    }
-
-	/* turn on expose plots */
-	expose_plot_ok = True;
-	}
-}
-
-/*--------------------------------------------------------------------*/
-void
-do_checkuseprevious()
-{
-	     XtManageChild(bulletinBoard_useprevious);
-}
-
-/*--------------------------------------------------------------------*/
-void
-do_useprevious_yes( Widget w, XtPointer client_data, XtPointer call_data)
-{
-	XmAnyCallbackStruct *acs;
-	acs = (XmAnyCallbackStruct*)call_data;
-
-    do_load(MB_YES);
-}
-
-/*--------------------------------------------------------------------*/
-void
-do_useprevious_no( Widget w, XtPointer client_data, XtPointer call_data)
-{
-	XmAnyCallbackStruct *acs;
-	acs = (XmAnyCallbackStruct*)call_data;
-
-    do_load(MB_NO);
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_load(int useprevious)
-{
-	int	status;
-
-fprintf(stderr,"Called do_load:%d\n",useprevious);
-	/* turn off expose plots */
-	expose_plot_ok = False;
-
-	/* open the file */
-	strcpy(ifile,filepaths[currentfile]);
-	format = fileformats[currentfile];
-	status = mbnavedit_action_open(useprevious);
-
-	if (status == MB_FAILURE)
-		mbnavedit_bell(100);
-
-	do_unset_interval();
-
-	/* set values of number of data shown slider */
-	XtVaSetValues(scale_timespan,
-			XmNminimum, 1,
-			XmNmaximum, data_show_max,
-			XmNvalue, MAX(data_show_size, 1),
-			NULL);
-	sprintf(string, "%d", data_show_max);
-	set_label_string(label_timespan_2, string);
-
-	/* unmanage fileselection window so plotting will show */
-	XtUnmanageChild(xmDialogShell_fileselection);
-
-	/* replot */
-	if (status == MB_SUCCESS)
-		mbnavedit_plot_all();
-
-	/* turn on expose plots */
-	expose_plot_ok = True;
-
-	do_set_controls();
-}
-
-
-/*--------------------------------------------------------------------*/
-
-void
-do_fileselection_filter( Widget w, XtPointer client_data, XtPointer call_data)
-{
-	XmAnyCallbackStruct *acs;
-	acs = (XmAnyCallbackStruct*)call_data;
-
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_fileselection_list( Widget w, XtPointer client_data, XtPointer call_data)
-{
-	char	fileroot[MB_PATH_MAXLINE];
-	int	format_error;
-	int	form;
-	char	value_text[10];
-
-	XmAnyCallbackStruct *acs;
-	acs = (XmAnyCallbackStruct*)call_data;
-
-	/* get selected text */
-	get_text_string(fileSelectionBox_text, string);
-
-	/* get output file */
-	if((int)strlen(string) > 0)
-		{
-		/* get the file format and set the widget */
-		if (mb_get_format(0, string, fileroot,
-				    &form, &format_error)
-			== MB_SUCCESS)
-		    {
-		    format = form;
-		    sprintf(value_text,"%d",format);
-		    XmTextFieldSetString(
-			textField_format,
-			value_text);
-		    }
-
-		/* get the output filename */
-		strcpy(nfile,string);
-		strcat(nfile,".nve");
-	}
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_fileselection_nomatch( Widget w, XtPointer client_data, XtPointer call_data)
-{
-	XmAnyCallbackStruct *acs;
-	acs = (XmAnyCallbackStruct*)call_data;
-
-}
-/*--------------------------------------------------------------------*/
-
-void
-do_toggle_pick( Widget w, XtPointer client_data, XtPointer call_data)
-{
-	XmAnyCallbackStruct *acs;
-	acs = (XmAnyCallbackStruct*)call_data;
-
-	mode_pick = PICK_MODE_PICK;
-	do_unset_interval();
-	mbnavedit_pickcursor();
-}
-/*--------------------------------------------------------------------*/
-
-void
-do_toggle_select( Widget w, XtPointer client_data, XtPointer call_data)
-{
-	XmAnyCallbackStruct *acs;
-	acs = (XmAnyCallbackStruct*)call_data;
-
-	mode_pick = PICK_MODE_SELECT;
-	do_unset_interval();
-	mbnavedit_selectcursor();
-}
-/*--------------------------------------------------------------------*/
-
-void
-do_toggle_deselect( Widget w, XtPointer client_data, XtPointer call_data)
-{
-	XmAnyCallbackStruct *acs;
-	acs = (XmAnyCallbackStruct*)call_data;
-
-	mode_pick = PICK_MODE_DESELECT;
-	do_unset_interval();
-	mbnavedit_deselectcursor();
-}
-/*--------------------------------------------------------------------*/
-
-void
-do_toggle_selectall( Widget w, XtPointer client_data, XtPointer call_data)
-{
-	XmAnyCallbackStruct *acs;
-	acs = (XmAnyCallbackStruct*)call_data;
-
-	mode_pick = PICK_MODE_SELECTALL;
-	do_unset_interval();
-	mbnavedit_selectallcursor();
-}
-/*--------------------------------------------------------------------*/
-
-void
-do_toggle_deselectall( Widget w, XtPointer client_data, XtPointer call_data)
-{
-	XmAnyCallbackStruct *acs;
-	acs = (XmAnyCallbackStruct*)call_data;
-
-	mode_pick = PICK_MODE_DESELECTALL;
-	do_unset_interval();
-	mbnavedit_deselectallcursor();
-}
-/*--------------------------------------------------------------------*/
-
-
-void
-do_quit( Widget w, XtPointer client_data, XtPointer call_data)
-{
-	XmAnyCallbackStruct *acs;
-	acs = (XmAnyCallbackStruct*)call_data;
-
-	(void) BxExitCB(w, client_data, call_data);
-}
-/*--------------------------------------------------------------------*/
-
-void
-do_interpolation( Widget w, XtPointer client_data, XtPointer call_data)
-{
-	XmAnyCallbackStruct *acs;
-	acs = (XmAnyCallbackStruct*)call_data;
-
-	/* Interpolate any current selected data */
-	mbnavedit_action_interpolate();
-	do_unset_interval();
-
-	/* replot */
-	mbnavedit_plot_all();
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_interpolationrepeats( Widget w, XtPointer client_data, XtPointer call_data)
-{
-	XmAnyCallbackStruct *acs;
-	acs = (XmAnyCallbackStruct*)call_data;
-
-	/* Interpolate any current selected data */
-	mbnavedit_action_interpolaterepeats();
-	do_unset_interval();
-
-	/* replot */
-	mbnavedit_plot_all();
-}
-/*--------------------------------------------------------------------*/
-
-void
-do_scroll( Widget w, XtPointer client_data, XtPointer call_data)
-{
-
-	XmAnyCallbackStruct *acs;
-	acs = (XmAnyCallbackStruct*)call_data;
-}
-
-/*--------------------------------------------------------------------*/
-
-
-void
-do_revert( Widget w, XtPointer client_data, XtPointer call_data)
-{
-	XmAnyCallbackStruct *acs;
-	acs = (XmAnyCallbackStruct*)call_data;
-
-	/* Revert to original values for all selected data */
-	mbnavedit_action_revert();
-	do_unset_interval();
-
-	/* replot */
-	mbnavedit_plot_all();
-}
-/*--------------------------------------------------------------------*/
-
-void
-do_showall( Widget w, XtPointer client_data, XtPointer call_data)
-{
-	XmAnyCallbackStruct *acs;
-	acs = (XmAnyCallbackStruct*)call_data;
-
-	/* Show entire data buffer */
-	mbnavedit_action_showall();
-	do_unset_interval();
-
-	/* set values of number of data shown slider */
-	XtVaSetValues(scale_timespan,
-			XmNminimum, 1,
-			XmNmaximum, data_show_max,
-			XmNvalue, MAX(data_show_size, 1),
-			NULL);
-	sprintf(string, "%d", data_show_max);
-	set_label_string(label_timespan_2, string);
-}
-/*--------------------------------------------------------------------*/
-
-void
-do_set_interval( Widget w, XtPointer client_data, XtPointer call_data)
-{
-	XmAnyCallbackStruct *acs;
-	acs = (XmAnyCallbackStruct*)call_data;
-
-	/* turn on set interval mode */
-	mode_set_interval = MB_YES;
-	mbnavedit_setintervalcursor();
-}
-/*--------------------------------------------------------------------*/
-int
-do_unset_interval()
-{
-
-	/* turn off set interval mode */
-	mbnavedit_action_set_interval(0, 0, 3);
-	if (mode_set_interval == MB_YES)
-		{
-		mode_set_interval = MB_NO;
-		if (mode_pick == PICK_MODE_PICK)
-			mbnavedit_pickcursor();
-		else if (mode_pick == PICK_MODE_SELECT)
-			mbnavedit_selectcursor();
-		else if (mode_pick == PICK_MODE_DESELECT)
-			mbnavedit_deselectcursor();
-		else if (mode_pick == PICK_MODE_SELECTALL)
-			mbnavedit_selectallcursor();
-		else if (mode_pick == PICK_MODE_DESELECTALL)
-			mbnavedit_deselectallcursor();
-		}
-
-	return(MB_SUCCESS);
-}
-/*--------------------------------------------------------------------*/
-
-void
-do_toggle_vru( Widget w, XtPointer client_data, XtPointer call_data)
-{
-	int	screen_height;
-
-	XmAnyCallbackStruct *acs;
-	acs=(XmAnyCallbackStruct*)call_data;
-
-	plot_roll = XmToggleButtonGetState(toggleButton_vru);
-	plot_pitch = XmToggleButtonGetState(toggleButton_vru);
-	plot_heave = XmToggleButtonGetState(toggleButton_vru);
-
-	/* get and set size of canvas */
-	number_plots = 0;
-	if (plot_tint == MB_YES)
-		number_plots++;
-	if (plot_lon == MB_YES)
-		number_plots++;
-	if (plot_lat == MB_YES)
-		number_plots++;
-	if (plot_speed == MB_YES)
-		number_plots++;
-	if (plot_heading == MB_YES)
-		number_plots++;
-	if (plot_draft == MB_YES)
-		number_plots++;
-	if (plot_roll == MB_YES)
-		number_plots++;
-	if (plot_pitch == MB_YES)
-		number_plots++;
-	if (plot_heave == MB_YES)
-		number_plots++;
-	screen_height = number_plots*plot_height;
-	if (screen_height <= 0)
-		screen_height = plot_height;
-	XtVaSetValues(drawingArea,
-			XmNwidth, plot_width,
-			XmNheight, screen_height,
-			NULL);
-
-	/* replot */
-	mbnavedit_plot_all();
-}
-/*--------------------------------------------------------------------*/
-void
-mbnavedit_bell(int length)
-{
-	XBell(display,length);
-}
-/*--------------------------------------------------------------------*/
-void
-mbnavedit_get_position(int *win_x, int *win_y, unsigned int *mask_return)
-{
-	Window	root_return, child_return;
-	int	root_x_return, root_y_return;
-	int	status;
-
-	status = XQueryPointer(display, can_xid,
-		&root_return, &child_return,
-		&root_x_return, &root_y_return,
-		win_x, win_y, mask_return);
-}
-/*--------------------------------------------------------------------*/
-void
-mbnavedit_pickcursor()
-{
-	myCursor = XCreateFontCursor(display, XC_target);
-	XAllocNamedColor(display,colormap,"red",&closest[0],&exact[0]);
-	XAllocNamedColor(display,colormap,"coral",&closest[1],&exact[1]);
-	XRecolorCursor(display,myCursor,&closest[0],&closest[1]);
-	XDefineCursor(display,can_xid,myCursor);
-}
-/*--------------------------------------------------------------------*/
-void
-mbnavedit_selectcursor()
-{
-	myCursor = XCreateFontCursor(display, XC_exchange);
-	XAllocNamedColor(display,colormap,"red",&closest[0],&exact[0]);
-	XAllocNamedColor(display,colormap,"coral",&closest[1],&exact[1]);
-	XRecolorCursor(display,myCursor,&closest[0],&closest[1]);
-	XDefineCursor(display,can_xid,myCursor);
-}
-/*--------------------------------------------------------------------*/
-void
-mbnavedit_deselectcursor()
-{
-	myCursor = XCreateFontCursor(display, XC_exchange);
-	XAllocNamedColor(display,colormap,"green",&closest[0],&exact[0]);
-	XAllocNamedColor(display,colormap,"coral",&closest[1],&exact[1]);
-	XRecolorCursor(display,myCursor,&closest[0],&closest[1]);
-	XDefineCursor(display,can_xid,myCursor);
-}
-/*--------------------------------------------------------------------*/
-void
-mbnavedit_selectallcursor()
-{
-	myCursor = XCreateFontCursor(display, XC_cross);
-	XAllocNamedColor(display,colormap,"red",&closest[0],&exact[0]);
-	XAllocNamedColor(display,colormap,"coral",&closest[1],&exact[1]);
-	XRecolorCursor(display,myCursor,&closest[0],&closest[1]);
-	XDefineCursor(display,can_xid,myCursor);
-}
-/*--------------------------------------------------------------------*/
-void
-mbnavedit_deselectallcursor()
-{
-	myCursor = XCreateFontCursor(display, XC_cross);
-	XAllocNamedColor(display,colormap,"green",&closest[0],&exact[0]);
-	XAllocNamedColor(display,colormap,"coral",&closest[1],&exact[1]);
-	XRecolorCursor(display,myCursor,&closest[0],&closest[1]);
-	XDefineCursor(display,can_xid,myCursor);
-}
-/*--------------------------------------------------------------------*/
-void
-mbnavedit_setintervalcursor()
-{
-	myCursor = XCreateFontCursor(display, XC_crosshair);
-	XAllocNamedColor(display,colormap,"red",&closest[0],&exact[0]);
-	XAllocNamedColor(display,colormap,"coral",&closest[1],&exact[1]);
-	XRecolorCursor(display,myCursor,&closest[0],&closest[1]);
-	XDefineCursor(display,can_xid,myCursor);
-}
-/*--------------------------------------------------------------------*/
-/*--------------------------------------------------------------------*/
-
-int
-do_wait_until_viewed(XtAppContext app)
-{
-    Widget  topshell;
-    Window  topwindow;
-    XWindowAttributes	xwa;
-    XEvent  event;
-
-    /* set app_context */
-    app_context = app;
-
-    /* find the top level shell */
-    for (topshell = drawingArea;
-	    !XtIsTopLevelShell(topshell);
-	    topshell = XtParent(topshell))
-	;
-
-    /* keep processing events until it is viewed */
-    if (XtIsRealized(topshell))
-	{
-	topwindow = XtWindow(topshell);
-
-	/* wait for the window to be mapped */
-	while (XGetWindowAttributes(
-			XtDisplay(drawingArea),
-			topwindow, &xwa)
-		&& xwa.map_state != IsViewable)
-	    {
-	    XtAppNextEvent(app_context, &event);
-	    XtDispatchEvent(&event);
-	    }
-	}
-
-    XmUpdateDisplay(topshell);
-
-    return(MB_SUCCESS);
-}
-
-/*------------------------------------------------------------------------------*/
-
-int do_mbnavedit_settimer()
-{
-	int	status = MB_SUCCESS;
-	int	timer_timeout_time = 1000;
-	int	id;
-
-	/* set timer function if none set for this instance */
-	if (timer_function_set == MB_NO)
-		{
-		id =  XtAppAddTimeOut(app_context,
-				(unsigned long) timer_timeout_time,
-				(XtTimerCallbackProc)do_mbnavedit_workfunction,
-				(XtPointer) -1);
-		if (id > 0)
-			timer_function_set = MB_YES;
-		else
-			status = MB_FAILURE;
-		}
-
-/* else
-fprintf(stderr,"do_mbnavedit_settimer: FUNCTION ALREADY SET!!\n"); */
-
-	return(status);
-}
-
-/*------------------------------------------------------------------------------*/
-
-int do_mbnavedit_workfunction(XtPointer client_data)
-{
-	int	status = MB_SUCCESS;
-
-	timer_function_set = MB_NO;
-
-	/* reset filelist */
-	if (numfiles > 0 && expose_plot_ok == True)
-		{
-		do_build_filelist();
-		}
-
-	/* reset the timer function */
-	do_mbnavedit_settimer();
-
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-/* Message and error dialogs */
-/*--------------------------------------------------------------------*/
-
-int
-do_message_on(char *message)
-{
-    Widget  diashell, topshell;
-    Window  diawindow, topwindow;
-    XWindowAttributes	xwa;
-    XEvent  event;
-
-    set_label_string(label_message, message);
-    XtManageChild(bulletinBoard_message);
-
-    /* force the label to be visible */
-    for (diashell = label_message;
-	    !XtIsShell(diashell);
-	    diashell = XtParent(diashell))
-	;
-    for (topshell = diashell;
-	    !XtIsTopLevelShell(topshell);
-	    topshell = XtParent(topshell))
-	;
-    if (XtIsRealized(diashell) && XtIsRealized(topshell))
-	{
-	diawindow = XtWindow(diashell);
-	topwindow = XtWindow(topshell);
-
-	/* wait for the dialog to be mapped */
-	while (XGetWindowAttributes(display, diawindow, &xwa)
-		&& xwa.map_state != IsViewable)
-	    {
-	    if (XGetWindowAttributes(display, topwindow, &xwa)
-		    && xwa.map_state != IsViewable)
-		break;
-
-	    XtAppNextEvent(app_context, &event);
-	    XtDispatchEvent(&event);
-	    }
-	}
-
-    XmUpdateDisplay(topshell);
-
-    return(MB_SUCCESS);
-}
-
-/*--------------------------------------------------------------------*/
-
-int
-do_message_off()
-{
-    XtUnmanageChild(bulletinBoard_message);
-    XSync(XtDisplay(bulletinBoard_message), 0);
-    XmUpdateDisplay(drawingArea);
-
-    return(MB_SUCCESS);
-}
-
-/*--------------------------------------------------------------------*/
-
-int
-do_error_dialog(char *s1, char *s2, char *s3)
-{
-    set_label_string(label_error_one, s1);
-    set_label_string(label_error_two, s2);
-    set_label_string(label_error_three, s3);
-    XtManageChild(bulletinBoard_error);
-    XBell(display,100);
-
-    return(MB_SUCCESS);
-}
-
-/*--------------------------------------------------------------------*/
-/* Change label string cleanly, no memory leak */
-/*--------------------------------------------------------------------*/
-
-void set_label_string(Widget w, String str)
-{
-    XmString xstr;
-
-    xstr = XmStringCreateLocalized( str );
-    if ( xstr != NULL )
-	XtVaSetValues(w,
-	    XmNlabelString, xstr,
-	    NULL);
-    else
-	XtWarning("Failed to update labelString");
-
-    XmStringFree( xstr );
-}
-/*--------------------------------------------------------------------*/
-/* Change multiline label string cleanly, no memory leak */
-/*--------------------------------------------------------------------*/
-
-void set_label_multiline_string(Widget w, String str)
-{
-    XmString xstr;
-    Boolean      argok;
-
-    xstr = (XtPointer)BX_CONVERT(w, str, XmRXmString, 0, &argok);
-    if ( xstr != NULL && argok)
-        XtVaSetValues(w,
-            XmNlabelString, xstr,
-            NULL);
-    else
-        XtWarning("Failed to update labelString");
-
-    XmStringFree( xstr );
-}
-/*--------------------------------------------------------------------*/
-/* Get text item string cleanly, no memory leak */
-/*--------------------------------------------------------------------*/
-
-void get_text_string(Widget w, String str)
-{
-    char	*str_tmp;
-
-    str_tmp = (char *) XmTextGetString(w);
-    strcpy(str, str_tmp);
-    XtFree(str_tmp);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbnavedit/mbnavedit_creation.c b/src/mbnavedit/mbnavedit_creation.c
deleted file mode 100644
index dee0e61..0000000
--- a/src/mbnavedit/mbnavedit_creation.c
+++ /dev/null
@@ -1,4173 +0,0 @@
-
-/* Begin user code block <abstract> */
-/* End user code block <abstract> */
-
-/**
- * README: Portions of this file are merged at file generation
- * time. Edits can be made *only* in between specified code blocks, look
- * for keywords <Begin user code> and <End user code>.
- */
-/*
- * Generated by the ICS Builder Xcessory (BX).
- *
- * BuilderXcessory Version 6.1.3
- * Code Generator Xcessory 6.1.3 (08/19/04) CGX Scripts 6.1 Motif 2.1
- *
- */
-
-
-/* Begin user code block <file_comments> */
-
-#ifndef SANS
-#define SANS "helvetica"
-#endif
-#ifndef SERIF
-#define SERIF "times"
-#endif
-#ifndef MONO
-#define MONO "courier"
-#endif
-
-/* End user code block <file_comments> */
-
-#include <Xm/Xm.h>
-#include <Xm/MainW.h>
-#include <Xm/DialogS.h>
-#include <Xm/MwmUtil.h>
-#include <Xm/Form.h>
-#include <Xm/PushB.h>
-#include <Xm/Label.h>
-#include <Xm/RowColumn.h>
-#include <Xm/ToggleB.h>
-#include <Xm/ScrolledW.h>
-#include <Xm/List.h>
-#include <Xm/TextF.h>
-#include <Xm/BulletinB.h>
-#include <Xm/Scale.h>
-#include <Xm/Separator.h>
-#include <Xm/FileSB.h>
-#include <Xm/CascadeB.h>
-#include <Xm/DrawingA.h>
-#include <Xm/MainW.h>
-#include <Xm/DialogS.h>
-#include <Xm/MwmUtil.h>
-#include <Xm/Form.h>
-#include <Xm/PushB.h>
-#include <Xm/Label.h>
-#include <Xm/RowColumn.h>
-#include <Xm/ToggleB.h>
-#include <Xm/ScrolledW.h>
-#include <Xm/List.h>
-#include <Xm/TextF.h>
-#include <Xm/BulletinB.h>
-#include <Xm/Scale.h>
-#include <Xm/Separator.h>
-#include <Xm/FileSB.h>
-#include <Xm/CascadeB.h>
-#include <Xm/DrawingA.h>
-
-/*
- * Global declarations are now stored in the header file.
- *
- * If DECLARE_BX_GLOBALS is defined then this header file
- * declares the globals, otherwise it just externs them.
- */
-#define DECLARE_BX_GLOBALS
-
-/**
- * Globally included information.
- */
-
-
-/**
- * Common constant and pixmap declarations.
- */
-#include "mbnavedit_creation.h"
-
-/**
- * Convenience functions from utilities file.
- */
-extern void RegisterBxConverters(XtAppContext);
-extern XtPointer BX_CONVERT(Widget, char *, char *, int, Boolean *);
-extern XtPointer BX_DOUBLE(double);
-extern XtPointer BX_SINGLE(float);
-extern void BX_MENU_POST(Widget, XtPointer, XEvent *, Boolean *);
-extern Pixmap XPM_PIXMAP(Widget, char **);
-extern void BX_SET_BACKGROUND_COLOR(Widget, ArgList, Cardinal *, Pixel);
-
-/**
- * Declarations for callbacks and handlers.
- */
-extern void BxExitCB(Widget, XtPointer, XtPointer);
-extern void do_filelist_remove(Widget, XtPointer, XtPointer);
-extern void do_editlistselection(Widget, XtPointer, XtPointer);
-extern void BxUnmanageCB(Widget, XtPointer, XtPointer);
-extern void do_toggle_output_on_filelist(Widget, XtPointer, XtPointer);
-extern void do_toggle_output_off_filelist(Widget, XtPointer, XtPointer);
-extern void do_offset_apply(Widget, XtPointer, XtPointer);
-extern void do_deletebadtimetag_apply(Widget, XtPointer, XtPointer);
-extern void do_timeinterpolation_apply(Widget, XtPointer, XtPointer);
-extern void do_useprevious_no(Widget, XtPointer, XtPointer);
-extern void do_useprevious_yes(Widget, XtPointer, XtPointer);
-extern void do_meantimewindow(Widget, XtPointer, XtPointer);
-extern void do_modeling_apply(Widget, XtPointer, XtPointer);
-extern void do_driftlat(Widget, XtPointer, XtPointer);
-extern void do_driftlon(Widget, XtPointer, XtPointer);
-extern void do_model_mode(Widget, XtPointer, XtPointer);
-extern void do_timestep(Widget, XtPointer, XtPointer);
-extern void do_timespan(Widget, XtPointer, XtPointer);
-extern void do_fileselection_ok(Widget, XtPointer, XtPointer);
-extern void do_fileselection_nomatch(Widget, XtPointer, XtPointer);
-extern void do_fileselection_cancel(Widget, XtPointer, XtPointer);
-extern void do_fileselection_filter(Widget, XtPointer, XtPointer);
-extern void do_toggle_output_on(Widget, XtPointer, XtPointer);
-extern void do_toggle_output_off(Widget, XtPointer, XtPointer);
-extern void do_end(Widget, XtPointer, XtPointer);
-extern void do_start(Widget, XtPointer, XtPointer);
-extern void do_interpolationrepeats(Widget, XtPointer, XtPointer);
-extern void do_unflag(Widget, XtPointer, XtPointer);
-extern void do_flag(Widget, XtPointer, XtPointer);
-extern void do_toggle_org_sonardepth(Widget, XtPointer, XtPointer);
-extern void do_toggle_sonardepth(Widget, XtPointer, XtPointer);
-extern void do_button_use_dr(Widget, XtPointer, XtPointer);
-extern void do_toggle_dr_lat(Widget, XtPointer, XtPointer);
-extern void do_toggle_dr_lon(Widget, XtPointer, XtPointer);
-extern void do_toggle_org_time(Widget, XtPointer, XtPointer);
-extern void do_toggle_time(Widget, XtPointer, XtPointer);
-extern void do_nextbuffer(Widget, XtPointer, XtPointer);
-extern void do_done(Widget, XtPointer, XtPointer);
-extern void do_forward(Widget, XtPointer, XtPointer);
-extern void do_reverse(Widget, XtPointer, XtPointer);
-extern void BxManageCB(Widget, XtPointer, XtPointer);
-extern void do_toggle_vru(Widget, XtPointer, XtPointer);
-extern void do_set_interval(Widget, XtPointer, XtPointer);
-extern void do_showall(Widget, XtPointer, XtPointer);
-extern void do_revert(Widget, XtPointer, XtPointer);
-extern void do_interpolation(Widget, XtPointer, XtPointer);
-extern void do_button_use_cmg(Widget, XtPointer, XtPointer);
-extern void do_toggle_show_cmg(Widget, XtPointer, XtPointer);
-extern void do_toggle_org_heading(Widget, XtPointer, XtPointer);
-extern void do_button_use_smg(Widget, XtPointer, XtPointer);
-extern void do_toggle_show_smg(Widget, XtPointer, XtPointer);
-extern void do_toggle_org_speed(Widget, XtPointer, XtPointer);
-extern void do_toggle_org_lat(Widget, XtPointer, XtPointer);
-extern void do_toggle_org_lon(Widget, XtPointer, XtPointer);
-extern void do_toggle_speed(Widget, XtPointer, XtPointer);
-extern void do_toggle_heading(Widget, XtPointer, XtPointer);
-extern void do_toggle_lat(Widget, XtPointer, XtPointer);
-extern void do_toggle_lon(Widget, XtPointer, XtPointer);
-extern void BxSetValuesCB(Widget, XtPointer, XtPointer);
-extern void do_toggle_pick(Widget, XtPointer, XtPointer);
-extern void do_toggle_select(Widget, XtPointer, XtPointer);
-extern void do_toggle_deselect(Widget, XtPointer, XtPointer);
-extern void do_toggle_selectall(Widget, XtPointer, XtPointer);
-extern void do_toggle_deselectall(Widget, XtPointer, XtPointer);
-extern void do_resize(Widget, XtPointer, XtPointer);
-extern void do_event(Widget, XtPointer, XtPointer);
-extern void do_expose(Widget, XtPointer, XtPointer);
-
-/**
- * Create the mainWindow hierarchy of widgets.
- */
-Widget
-CreatemainWindow(Widget parent)
-{
-    Cardinal ac = 0;
-    Arg      args[256];
-    Boolean  argok = False;
-    Widget   mainWindow;
-    Widget   dialogShell_filelist;
-    Widget   form_filelist;
-    Widget   pushButton_filelist_remove;
-    Widget   pushButton_filelist_edit;
-    Widget   setting_output_label_filelist;
-    Widget   setting_output_filelist;
-    Widget   pushButton_filelist_dismiss;
-    Widget   scrolledWindow_filelist;
-    Widget   xmDialogShell_offset;
-    Widget   form_offset;
-    Widget   label_offset_lat;
-    Widget   label_offset_lon;
-    Widget   dialogShell_deletebadtimetag;
-    Widget   label_deletetimetag;
-    Widget   pushButton_deletebadtimetag_dismiss;
-    Widget   pushButton_deletebadtimetag_apply;
-    Widget   xmDialogShell_timeinterpolation;
-    Widget   label_timeinterpolation;
-    Widget   pushButton_timeinterpolation_dismiss;
-    Widget   pushButton_timeinterpolation_apply;
-    Widget   xmDialogShell_useprevious;
-    Widget   label_useprevious;
-    Widget   pushButton_useprevious_no;
-    Widget   pushButton_useprevious_yes;
-    Widget   xmDialogShell_modeling;
-    Widget   bulletinBoard_modeling;
-    Widget   separator5;
-    Widget   pushButton_modeling_apply;
-    Widget   separator4;
-    Widget   label_modeling_acceleration;
-    Widget   label_modeling_speed;
-    Widget   label_modeling_inversion;
-    Widget   pushButton_modeling_dismiss;
-    Widget   separator3;
-    Widget   separator2;
-    Widget   label_modeling_mode;
-    Widget   radioBox_modeling;
-    Widget   xmDialogShell_timestepping;
-    Widget   bulletinBoard_timestepping;
-    Widget   pushButton_timestepping_dismiss;
-    Widget   xmDialogShell_error;
-    Widget   pushButton_error;
-    Widget   xmDialogShell_message;
-    Widget   label_pleasewait;
-    Widget   xmDialogShell_about;
-    Widget   bulletinBoard_about;
-    Widget   label_about_create1;
-    Widget   separator1;
-    Widget   pushButton_about_dismiss;
-    Widget   label_about_create;
-    Widget   label_about_lamont;
-    Widget   label_about_columbia;
-    Widget   label_about_mbsystem;
-    Widget   label_about_mbpub;
-    Widget   label_about_component;
-    Widget   label_about_for;
-    Widget   separator;
-    Widget   label_about_function;
-    Widget   label_about_mbedit;
-    Widget   menuBar_file;
-    Widget   cascadeButton_file;
-    Widget   pulldownMenu_file;
-    Widget   pushButton_filelist;
-    Widget   menuBar_controls;
-    Widget   cascadeButton_controls;
-    Widget   pulldownMenu_controls;
-    Widget   pushButton_controls_timespan;
-    Widget   pushButton_controls_modeling;
-    Widget   pushButton_controls_offset;
-    Widget   pushButton_nextbuffer;
-    Widget   pushButton_quit;
-    Widget   pushButton_about;
-    Widget   pushButton_set_interval;
-    Widget   pushButton_showall;
-
-    /**
-     * Register the converters for the widgets.
-     */
-    RegisterBxConverters(XtWidgetToApplicationContext(parent));
-    XtInitializeWidgetClass((WidgetClass)xmMainWindowWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmDialogShellWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmFormWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmPushButtonWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmLabelWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmRowColumnWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmToggleButtonWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmScrolledWindowWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmListWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmTextFieldWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmBulletinBoardWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmScaleWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmSeparatorWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmRowColumnWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmFileSelectionBoxWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmBulletinBoardWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmRowColumnWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmCascadeButtonWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmRowColumnWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmDrawingAreaWidgetClass);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 964); ac++;
-    XtSetArg(args[ac], XmNy, 300); ac++;
-    XtSetArg(args[ac], XmNwidth, 1024); ac++;
-    XtSetArg(args[ac], XmNheight, 683); ac++;
-    mainWindow = XmCreateMainWindow(parent,
-        (char *)"mainWindow",
-        args,
-        ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNresizePolicy, XmRESIZE_GROW); ac++;
-    XtSetArg(args[ac], XmNwidth, 1024); ac++;
-    XtSetArg(args[ac], XmNheight, 683); ac++;
-    bulletinBoard = XmCreateBulletinBoard(mainWindow,
-        (char *)"bulletinBoard",
-        args,
-        ac);
-    XtManageChild(bulletinBoard);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard, (char *)"End",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 390); ac++;
-        XtSetArg(args[ac], XmNy, 10); ac++;
-        XtSetArg(args[ac], XmNwidth, 70); ac++;
-        XtSetArg(args[ac], XmNheight, 28); ac++;
-        pushButton_end = XmCreatePushButton(bulletinBoard,
-            (char *)"pushButton_end",
-            args,
-            ac);
-        XtManageChild(pushButton_end);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_end, XmNactivateCallback, do_end, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard, (char *)"Start",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 180); ac++;
-        XtSetArg(args[ac], XmNy, 10); ac++;
-        XtSetArg(args[ac], XmNwidth, 70); ac++;
-        XtSetArg(args[ac], XmNheight, 28); ac++;
-        pushButton_start = XmCreatePushButton(bulletinBoard,
-            (char *)"pushButton_start",
-            args,
-            ac);
-        XtManageChild(pushButton_start);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_start, XmNactivateCallback, do_start, (XtPointer)0);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 10); ac++;
-    XtSetArg(args[ac], XmNy, 10); ac++;
-    XtSetArg(args[ac], XmNwidth, 51); ac++;
-    XtSetArg(args[ac], XmNheight, 34); ac++;
-    menuBar_file = XmCreateMenuBar(bulletinBoard,
-        (char *)"menuBar_file",
-        args,
-        ac);
-    XtManageChild(menuBar_file);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(menuBar_file, (char *)"File",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 5); ac++;
-        XtSetArg(args[ac], XmNy, 5); ac++;
-        XtSetArg(args[ac], XmNwidth, 41); ac++;
-        XtSetArg(args[ac], XmNheight, 24); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(menuBar_file, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        cascadeButton_file = XmCreateCascadeButton(menuBar_file,
-            (char *)"cascadeButton_file",
-            args,
-            ac);
-        XtManageChild(cascadeButton_file);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 0); ac++;
-    XtSetArg(args[ac], XmNy, 0); ac++;
-    XtSetArg(args[ac], XmNwidth, 135); ac++;
-    XtSetArg(args[ac], XmNheight, 52); ac++;
-    pulldownMenu_file = XmCreatePulldownMenu(XtParent(cascadeButton_file),
-        (char *)"pulldownMenu_file",
-        args,
-        ac);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(pulldownMenu_file, (char *)"Open",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_file, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_file = XmCreatePushButton(pulldownMenu_file,
-            (char *)"pushButton_file",
-            args,
-            ac);
-        XtManageChild(pushButton_file);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_file, XmNactivateCallback, BxManageCB, (XtPointer)"bulletinBoard_fileselection");
-    XtAddCallback(pushButton_file, XmNactivateCallback, BxSetValuesCB, (XtPointer)"label_format.labelString=MBIO Format ID:");
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(pulldownMenu_file, (char *)"File Selection List",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_file, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_filelist = XmCreatePushButton(pulldownMenu_file,
-            (char *)"pushButton_filelist",
-            args,
-            ac);
-        XtManageChild(pushButton_filelist);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_filelist, XmNactivateCallback, BxManageCB, (XtPointer)"form_filelist");
-
-    ac = 0;
-    XtSetArg(args[ac], XmNsubMenuId, pulldownMenu_file); ac++;
-    XtSetValues(cascadeButton_file, args, ac);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard, (char *)"Interpolate Repeats",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard, (char *)"-*-"SANS"-bold-r-normal--14-140-75-75-p-82-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
-        XtSetArg(args[ac], XmNx, 110); ac++;
-        XtSetArg(args[ac], XmNy, 50); ac++;
-        XtSetArg(args[ac], XmNwidth, 150); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        pushButton_interpolaterepeats = XmCreatePushButton(bulletinBoard,
-            (char *)"pushButton_interpolaterepeats",
-            args,
-            ac);
-        XtManageChild(pushButton_interpolaterepeats);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_interpolaterepeats, XmNactivateCallback, do_interpolationrepeats, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard, (char *)"Unflag",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 530); ac++;
-        XtSetArg(args[ac], XmNy, 50); ac++;
-        XtSetArg(args[ac], XmNwidth, 70); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_unflag = XmCreatePushButton(bulletinBoard,
-            (char *)"pushButton_unflag",
-            args,
-            ac);
-        XtManageChild(pushButton_unflag);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_unflag, XmNactivateCallback, do_unflag, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard, (char *)"Flag",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 460); ac++;
-        XtSetArg(args[ac], XmNy, 50); ac++;
-        XtSetArg(args[ac], XmNwidth, 70); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_flag = XmCreatePushButton(bulletinBoard,
-            (char *)"pushButton_flag",
-            args,
-            ac);
-        XtManageChild(pushButton_flag);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_flag, XmNactivateCallback, do_flag, (XtPointer)0);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 80); ac++;
-    XtSetArg(args[ac], XmNy, 10); ac++;
-    XtSetArg(args[ac], XmNwidth, 87); ac++;
-    XtSetArg(args[ac], XmNheight, 34); ac++;
-    menuBar_controls = XmCreateMenuBar(bulletinBoard,
-        (char *)"menuBar_controls",
-        args,
-        ac);
-    XtManageChild(menuBar_controls);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(menuBar_controls, (char *)"Controls",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 5); ac++;
-        XtSetArg(args[ac], XmNy, 5); ac++;
-        XtSetArg(args[ac], XmNwidth, 77); ac++;
-        XtSetArg(args[ac], XmNheight, 24); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(menuBar_controls, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        cascadeButton_controls = XmCreateCascadeButton(menuBar_controls,
-            (char *)"cascadeButton_controls",
-            args,
-            ac);
-        XtManageChild(cascadeButton_controls);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 0); ac++;
-    XtSetArg(args[ac], XmNy, 0); ac++;
-    XtSetArg(args[ac], XmNwidth, 137); ac++;
-    XtSetArg(args[ac], XmNheight, 124); ac++;
-    pulldownMenu_controls = XmCreatePulldownMenu(XtParent(cascadeButton_controls),
-        (char *)"pulldownMenu_controls",
-        args,
-        ac);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(pulldownMenu_controls, (char *)"Time Stepping",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_controls, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_controls_timespan = XmCreatePushButton(pulldownMenu_controls,
-            (char *)"pushButton_controls_timespan",
-            args,
-            ac);
-        XtManageChild(pushButton_controls_timespan);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_controls_timespan, XmNactivateCallback, BxManageCB, (XtPointer)"bulletinBoard_timestepping");
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(pulldownMenu_controls, (char *)"Nav Modeling",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_controls, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_controls_modeling = XmCreatePushButton(pulldownMenu_controls,
-            (char *)"pushButton_controls_modeling",
-            args,
-            ac);
-        XtManageChild(pushButton_controls_modeling);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_controls_modeling, XmNactivateCallback, BxManageCB, (XtPointer)"bulletinBoard_modeling");
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(pulldownMenu_controls, (char *)"Time Interpolation",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_controls, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_controls_timeinterpolation = XmCreatePushButton(pulldownMenu_controls,
-            (char *)"pushButton_controls_timeinterpolation",
-            args,
-            ac);
-        XtManageChild(pushButton_controls_timeinterpolation);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_controls_timeinterpolation, XmNactivateCallback, BxManageCB, (XtPointer)"bulletinBoard_timeinterpolation");
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(pulldownMenu_controls, (char *)"Delete Bad Times",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_controls, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_controls_deletebadtimetag = XmCreatePushButton(pulldownMenu_controls,
-            (char *)"pushButton_controls_deletebadtimetag",
-            args,
-            ac);
-        XtManageChild(pushButton_controls_deletebadtimetag);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_controls_deletebadtimetag, XmNactivateCallback, BxManageCB, (XtPointer)"bulletinBoard_deletebadtimetag");
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(pulldownMenu_controls, (char *)"Position Offset",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(pulldownMenu_controls, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_controls_offset = XmCreatePushButton(pulldownMenu_controls,
-            (char *)"pushButton_controls_offset",
-            args,
-            ac);
-        XtManageChild(pushButton_controls_offset);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_controls_offset, XmNactivateCallback, BxManageCB, (XtPointer)"form_offset");
-
-    ac = 0;
-    XtSetArg(args[ac], XmNsubMenuId, pulldownMenu_controls); ac++;
-    XtSetValues(cascadeButton_controls, args, ac);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard, (char *)"Show Original Data",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-p-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNindicatorOn, XmINDICATOR_CHECK_BOX); ac++;
-        XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
-        XtSetArg(args[ac], XmNx, 20); ac++;
-        XtSetArg(args[ac], XmNy, 480); ac++;
-        XtSetArg(args[ac], XmNwidth, 150); ac++;
-        XtSetArg(args[ac], XmNheight, 20); ac++;
-        toggleButton_org_sonardepth = XmCreateToggleButton(bulletinBoard,
-            (char *)"toggleButton_org_sonardepth",
-            args,
-            ac);
-        XtManageChild(toggleButton_org_sonardepth);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(toggleButton_org_sonardepth, XmNvalueChangedCallback, do_toggle_org_sonardepth, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard, (char *)"Sonar Depth Plot",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-p-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNindicatorOn, XmINDICATOR_CHECK_BOX); ac++;
-        XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 460); ac++;
-        XtSetArg(args[ac], XmNwidth, 140); ac++;
-        XtSetArg(args[ac], XmNheight, 20); ac++;
-        toggleButton_sonardepth = XmCreateToggleButton(bulletinBoard,
-            (char *)"toggleButton_sonardepth",
-            args,
-            ac);
-        XtManageChild(toggleButton_sonardepth);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(toggleButton_sonardepth, XmNvalueChangedCallback, do_toggle_sonardepth, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard, (char *)"Use Solution",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-p-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 360); ac++;
-        XtSetArg(args[ac], XmNy, 50); ac++;
-        XtSetArg(args[ac], XmNwidth, 100); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        pushButton_solution = XmCreatePushButton(bulletinBoard,
-            (char *)"pushButton_solution",
-            args,
-            ac);
-        XtManageChild(pushButton_solution);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_solution, XmNactivateCallback, do_button_use_dr, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard, (char *)"Show Dead Reckoning",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-p-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNindicatorOn, XmINDICATOR_CHECK_BOX); ac++;
-        XtSetArg(args[ac], XmNx, 20); ac++;
-        XtSetArg(args[ac], XmNy, 250); ac++;
-        XtSetArg(args[ac], XmNwidth, 159); ac++;
-        XtSetArg(args[ac], XmNheight, 26); ac++;
-        toggleButton_dr_lat = XmCreateToggleButton(bulletinBoard,
-            (char *)"toggleButton_dr_lat",
-            args,
-            ac);
-        XtManageChild(toggleButton_dr_lat);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(toggleButton_dr_lat, XmNvalueChangedCallback, do_toggle_dr_lat, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard, (char *)"Show Dead Reckoning",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNindicatorOn, XmINDICATOR_CHECK_BOX); ac++;
-        XtSetArg(args[ac], XmNx, 20); ac++;
-        XtSetArg(args[ac], XmNy, 180); ac++;
-        XtSetArg(args[ac], XmNwidth, 159); ac++;
-        XtSetArg(args[ac], XmNheight, 26); ac++;
-        toggleButton_dr_lon = XmCreateToggleButton(bulletinBoard,
-            (char *)"toggleButton_dr_lon",
-            args,
-            ac);
-        XtManageChild(toggleButton_dr_lon);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(toggleButton_dr_lon, XmNvalueChangedCallback, do_toggle_dr_lon, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard, (char *)"Show Original Data",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-p-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNindicatorOn, XmINDICATOR_CHECK_BOX); ac++;
-        XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
-        XtSetArg(args[ac], XmNx, 20); ac++;
-        XtSetArg(args[ac], XmNy, 110); ac++;
-        XtSetArg(args[ac], XmNwidth, 150); ac++;
-        XtSetArg(args[ac], XmNheight, 20); ac++;
-        toggleButton_org_time = XmCreateToggleButton(bulletinBoard,
-            (char *)"toggleButton_org_time",
-            args,
-            ac);
-        XtManageChild(toggleButton_org_time);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(toggleButton_org_time, XmNvalueChangedCallback, do_toggle_org_time, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard, (char *)"Time Interval Plot",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-p-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNindicatorOn, XmINDICATOR_CHECK_BOX); ac++;
-        XtSetArg(args[ac], XmNstringDirection, XmSTRING_DIRECTION_L_TO_R); ac++;
-        XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 90); ac++;
-        XtSetArg(args[ac], XmNwidth, 150); ac++;
-        XtSetArg(args[ac], XmNheight, 20); ac++;
-        toggleButton_time = XmCreateToggleButton(bulletinBoard,
-            (char *)"toggleButton_time",
-            args,
-            ac);
-        XtManageChild(toggleButton_time);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(toggleButton_time, XmNvalueChangedCallback, do_toggle_time, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard, (char *)"Next Buffer",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 480); ac++;
-        XtSetArg(args[ac], XmNy, 10); ac++;
-        XtSetArg(args[ac], XmNwidth, 88); ac++;
-        XtSetArg(args[ac], XmNheight, 28); ac++;
-        pushButton_nextbuffer = XmCreatePushButton(bulletinBoard,
-            (char *)"pushButton_nextbuffer",
-            args,
-            ac);
-        XtManageChild(pushButton_nextbuffer);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_nextbuffer, XmNactivateCallback, do_nextbuffer, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard, (char *)"Done",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 760); ac++;
-        XtSetArg(args[ac], XmNy, 10); ac++;
-        XtSetArg(args[ac], XmNwidth, 70); ac++;
-        XtSetArg(args[ac], XmNheight, 28); ac++;
-        pushButton_done = XmCreatePushButton(bulletinBoard,
-            (char *)"pushButton_done",
-            args,
-            ac);
-        XtManageChild(pushButton_done);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_done, XmNactivateCallback, do_done, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard, (char *)"Forward",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 320); ac++;
-        XtSetArg(args[ac], XmNy, 10); ac++;
-        XtSetArg(args[ac], XmNwidth, 69); ac++;
-        XtSetArg(args[ac], XmNheight, 28); ac++;
-        pushButton_forward = XmCreatePushButton(bulletinBoard,
-            (char *)"pushButton_forward",
-            args,
-            ac);
-        XtManageChild(pushButton_forward);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_forward, XmNactivateCallback, do_forward, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard, (char *)"Reverse",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 250); ac++;
-        XtSetArg(args[ac], XmNy, 10); ac++;
-        XtSetArg(args[ac], XmNwidth, 69); ac++;
-        XtSetArg(args[ac], XmNheight, 28); ac++;
-        pushButton_reverse = XmCreatePushButton(bulletinBoard,
-            (char *)"pushButton_reverse",
-            args,
-            ac);
-        XtManageChild(pushButton_reverse);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_reverse, XmNactivateCallback, do_reverse, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard, (char *)"Quit",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 840); ac++;
-        XtSetArg(args[ac], XmNy, 10); ac++;
-        XtSetArg(args[ac], XmNwidth, 70); ac++;
-        XtSetArg(args[ac], XmNheight, 28); ac++;
-        pushButton_quit = XmCreatePushButton(bulletinBoard,
-            (char *)"pushButton_quit",
-            args,
-            ac);
-        XtManageChild(pushButton_quit);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_quit, XmNactivateCallback, BxExitCB, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard, (char *)"About",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 920); ac++;
-        XtSetArg(args[ac], XmNy, 10); ac++;
-        XtSetArg(args[ac], XmNwidth, 80); ac++;
-        XtSetArg(args[ac], XmNheight, 28); ac++;
-        pushButton_about = XmCreatePushButton(bulletinBoard,
-            (char *)"pushButton_about",
-            args,
-            ac);
-        XtManageChild(pushButton_about);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_about, XmNactivateCallback, BxManageCB, (XtPointer)"bulletinBoard_about");
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard, (char *)"Roll, Pitch, and Heave Plots",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-p-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNindicatorOn, XmINDICATOR_CHECK_BOX); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 510); ac++;
-        XtSetArg(args[ac], XmNwidth, 191); ac++;
-        XtSetArg(args[ac], XmNheight, 26); ac++;
-        toggleButton_vru = XmCreateToggleButton(bulletinBoard,
-            (char *)"toggleButton_vru",
-            args,
-            ac);
-        XtManageChild(toggleButton_vru);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(toggleButton_vru, XmNvalueChangedCallback, do_toggle_vru, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard, (char *)"Pick Zoom",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard, (char *)"-*-"SANS"-bold-r-normal--14-140-75-75-p-82-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
-        XtSetArg(args[ac], XmNx, 670); ac++;
-        XtSetArg(args[ac], XmNy, 10); ac++;
-        XtSetArg(args[ac], XmNwidth, 80); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        pushButton_set_interval = XmCreatePushButton(bulletinBoard,
-            (char *)"pushButton_set_interval",
-            args,
-            ac);
-        XtManageChild(pushButton_set_interval);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_set_interval, XmNactivateCallback, do_set_interval, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard, (char *)"Show All",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard, (char *)"-*-"SANS"-bold-r-normal--14-140-75-75-p-82-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
-        XtSetArg(args[ac], XmNx, 580); ac++;
-        XtSetArg(args[ac], XmNy, 10); ac++;
-        XtSetArg(args[ac], XmNwidth, 80); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        pushButton_showall = XmCreatePushButton(bulletinBoard,
-            (char *)"pushButton_showall",
-            args,
-            ac);
-        XtManageChild(pushButton_showall);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_showall, XmNactivateCallback, do_showall, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard, (char *)"Revert",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard, (char *)"-*-"SANS"-bold-r-normal--14-140-75-75-p-82-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
-        XtSetArg(args[ac], XmNx, 270); ac++;
-        XtSetArg(args[ac], XmNy, 50); ac++;
-        XtSetArg(args[ac], XmNwidth, 80); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        pushButton_revert = XmCreatePushButton(bulletinBoard,
-            (char *)"pushButton_revert",
-            args,
-            ac);
-        XtManageChild(pushButton_revert);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_revert, XmNactivateCallback, do_revert, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard, (char *)"Interpolate",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard, (char *)"-*-"SANS"-bold-r-normal--14-140-75-75-p-82-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 50); ac++;
-        XtSetArg(args[ac], XmNwidth, 90); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        pushButton_interpolate = XmCreatePushButton(bulletinBoard,
-            (char *)"pushButton_interpolate",
-            args,
-            ac);
-        XtManageChild(pushButton_interpolate);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_interpolate, XmNactivateCallback, do_interpolation, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard, (char *)"",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNpacking, XmPACK_TIGHT); ac++;
-        XtSetArg(args[ac], XmNorientation, XmHORIZONTAL); ac++;
-        XtSetArg(args[ac], XmNx, 600); ac++;
-        XtSetArg(args[ac], XmNy, 40); ac++;
-        XtSetArg(args[ac], XmNwidth, 414); ac++;
-        XtSetArg(args[ac], XmNheight, 40); ac++;
-        XtSetArg(args[ac], XmNisHomogeneous, False); ac++;
-        radioBox = XmCreateRadioBox(bulletinBoard,
-            (char *)"radioBox",
-            args,
-            ac);
-        XtManageChild(radioBox);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(radioBox, (char *)"Pick",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(radioBox, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-p-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNindicatorOn, XmINDICATOR_CHECK_BOX); ac++;
-        XtSetArg(args[ac], XmNwidth, 51); ac++;
-        XtSetArg(args[ac], XmNheight, 34); ac++;
-        toggleButton_pick = XmCreateToggleButton(radioBox,
-            (char *)"toggleButton_pick",
-            args,
-            ac);
-        XtManageChild(toggleButton_pick);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(toggleButton_pick, XmNvalueChangedCallback, do_toggle_pick, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(radioBox, (char *)"Select",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(radioBox, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-p-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNindicatorOn, XmINDICATOR_CHECK_BOX); ac++;
-        XtSetArg(args[ac], XmNwidth, 64); ac++;
-        XtSetArg(args[ac], XmNheight, 34); ac++;
-        toggleButton_select = XmCreateToggleButton(radioBox,
-            (char *)"toggleButton_select",
-            args,
-            ac);
-        XtManageChild(toggleButton_select);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(toggleButton_select, XmNvalueChangedCallback, do_toggle_select, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(radioBox, (char *)"Deselect",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(radioBox, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-p-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNindicatorOn, XmINDICATOR_CHECK_BOX); ac++;
-        XtSetArg(args[ac], XmNwidth, 78); ac++;
-        XtSetArg(args[ac], XmNheight, 34); ac++;
-        toggleButton_deselect = XmCreateToggleButton(radioBox,
-            (char *)"toggleButton_deselect",
-            args,
-            ac);
-        XtManageChild(toggleButton_deselect);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(toggleButton_deselect, XmNvalueChangedCallback, do_toggle_deselect, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(radioBox, (char *)"Select All",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(radioBox, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-p-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNindicatorOn, XmINDICATOR_CHECK_BOX); ac++;
-        XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
-        XtSetArg(args[ac], XmNwidth, 93); ac++;
-        XtSetArg(args[ac], XmNheight, 34); ac++;
-        toggleButton_selectall = XmCreateToggleButton(radioBox,
-            (char *)"toggleButton_selectall",
-            args,
-            ac);
-        XtManageChild(toggleButton_selectall);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(toggleButton_selectall, XmNvalueChangedCallback, do_toggle_selectall, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(radioBox, (char *)"Deselect All",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(radioBox, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-p-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNindicatorOn, XmINDICATOR_CHECK_BOX); ac++;
-        XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
-        XtSetArg(args[ac], XmNwidth, 110); ac++;
-        XtSetArg(args[ac], XmNheight, 34); ac++;
-        toggleButton_deselectall = XmCreateToggleButton(radioBox,
-            (char *)"toggleButton_deselectall",
-            args,
-            ac);
-        XtManageChild(toggleButton_deselectall);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(toggleButton_deselectall, XmNvalueChangedCallback, do_toggle_deselectall, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard, (char *)"Use Course-Made-Good",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-p-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
-        XtSetArg(args[ac], XmNx, 20); ac++;
-        XtSetArg(args[ac], XmNy, 430); ac++;
-        XtSetArg(args[ac], XmNwidth, 180); ac++;
-        XtSetArg(args[ac], XmNheight, 20); ac++;
-        pushButton_heading_cmg = XmCreatePushButton(bulletinBoard,
-            (char *)"pushButton_heading_cmg",
-            args,
-            ac);
-        XtManageChild(pushButton_heading_cmg);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_heading_cmg, XmNactivateCallback, do_button_use_cmg, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard, (char *)"Show Course-Made-Good",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-p-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNindicatorOn, XmINDICATOR_CHECK_BOX); ac++;
-        XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
-        XtSetArg(args[ac], XmNx, 20); ac++;
-        XtSetArg(args[ac], XmNy, 410); ac++;
-        XtSetArg(args[ac], XmNwidth, 190); ac++;
-        XtSetArg(args[ac], XmNheight, 20); ac++;
-        toggleButton_show_cmg = XmCreateToggleButton(bulletinBoard,
-            (char *)"toggleButton_show_cmg",
-            args,
-            ac);
-        XtManageChild(toggleButton_show_cmg);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(toggleButton_show_cmg, XmNvalueChangedCallback, do_toggle_show_cmg, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard, (char *)"Show Original Data",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-p-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNindicatorOn, XmINDICATOR_CHECK_BOX); ac++;
-        XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
-        XtSetArg(args[ac], XmNx, 20); ac++;
-        XtSetArg(args[ac], XmNy, 390); ac++;
-        XtSetArg(args[ac], XmNwidth, 150); ac++;
-        XtSetArg(args[ac], XmNheight, 20); ac++;
-        toggleButton_org_heading = XmCreateToggleButton(bulletinBoard,
-            (char *)"toggleButton_org_heading",
-            args,
-            ac);
-        XtManageChild(toggleButton_org_heading);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(toggleButton_org_heading, XmNvalueChangedCallback, do_toggle_org_heading, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard, (char *)"Use Speed-Made-Good",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-p-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
-        XtSetArg(args[ac], XmNx, 20); ac++;
-        XtSetArg(args[ac], XmNy, 340); ac++;
-        XtSetArg(args[ac], XmNwidth, 180); ac++;
-        XtSetArg(args[ac], XmNheight, 20); ac++;
-        pushButton_speed_smg = XmCreatePushButton(bulletinBoard,
-            (char *)"pushButton_speed_smg",
-            args,
-            ac);
-        XtManageChild(pushButton_speed_smg);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_speed_smg, XmNactivateCallback, do_button_use_smg, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard, (char *)"Show Speed-Made-Good",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-p-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNindicatorOn, XmINDICATOR_CHECK_BOX); ac++;
-        XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
-        XtSetArg(args[ac], XmNx, 20); ac++;
-        XtSetArg(args[ac], XmNy, 320); ac++;
-        XtSetArg(args[ac], XmNwidth, 180); ac++;
-        XtSetArg(args[ac], XmNheight, 20); ac++;
-        toggleButton_show_smg = XmCreateToggleButton(bulletinBoard,
-            (char *)"toggleButton_show_smg",
-            args,
-            ac);
-        XtManageChild(toggleButton_show_smg);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(toggleButton_show_smg, XmNvalueChangedCallback, do_toggle_show_smg, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard, (char *)"Show Original Data",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-p-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNindicatorOn, XmINDICATOR_CHECK_BOX); ac++;
-        XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
-        XtSetArg(args[ac], XmNx, 20); ac++;
-        XtSetArg(args[ac], XmNy, 300); ac++;
-        XtSetArg(args[ac], XmNwidth, 180); ac++;
-        XtSetArg(args[ac], XmNheight, 20); ac++;
-        toggleButton_org_speed = XmCreateToggleButton(bulletinBoard,
-            (char *)"toggleButton_org_speed",
-            args,
-            ac);
-        XtManageChild(toggleButton_org_speed);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(toggleButton_org_speed, XmNvalueChangedCallback, do_toggle_org_speed, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard, (char *)"Show Original Data",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-p-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNindicatorOn, XmINDICATOR_CHECK_BOX); ac++;
-        XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
-        XtSetArg(args[ac], XmNx, 20); ac++;
-        XtSetArg(args[ac], XmNy, 230); ac++;
-        XtSetArg(args[ac], XmNwidth, 150); ac++;
-        XtSetArg(args[ac], XmNheight, 20); ac++;
-        toggleButton_org_lat = XmCreateToggleButton(bulletinBoard,
-            (char *)"toggleButton_org_lat",
-            args,
-            ac);
-        XtManageChild(toggleButton_org_lat);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(toggleButton_org_lat, XmNvalueChangedCallback, do_toggle_org_lat, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard, (char *)"Show Original Data",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-p-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNindicatorOn, XmINDICATOR_CHECK_BOX); ac++;
-        XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
-        XtSetArg(args[ac], XmNx, 20); ac++;
-        XtSetArg(args[ac], XmNy, 160); ac++;
-        XtSetArg(args[ac], XmNwidth, 150); ac++;
-        XtSetArg(args[ac], XmNheight, 20); ac++;
-        toggleButton_org_lon = XmCreateToggleButton(bulletinBoard,
-            (char *)"toggleButton_org_lon",
-            args,
-            ac);
-        XtManageChild(toggleButton_org_lon);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(toggleButton_org_lon, XmNvalueChangedCallback, do_toggle_org_lon, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard, (char *)"Speed Plot",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-p-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNindicatorOn, XmINDICATOR_CHECK_BOX); ac++;
-        XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 280); ac++;
-        XtSetArg(args[ac], XmNwidth, 160); ac++;
-        XtSetArg(args[ac], XmNheight, 20); ac++;
-        toggleButton_speed = XmCreateToggleButton(bulletinBoard,
-            (char *)"toggleButton_speed",
-            args,
-            ac);
-        XtManageChild(toggleButton_speed);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(toggleButton_speed, XmNvalueChangedCallback, do_toggle_speed, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard, (char *)"Heading Plot",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-p-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNindicatorOn, XmINDICATOR_CHECK_BOX); ac++;
-        XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 370); ac++;
-        XtSetArg(args[ac], XmNwidth, 110); ac++;
-        XtSetArg(args[ac], XmNheight, 20); ac++;
-        toggleButton_heading = XmCreateToggleButton(bulletinBoard,
-            (char *)"toggleButton_heading",
-            args,
-            ac);
-        XtManageChild(toggleButton_heading);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(toggleButton_heading, XmNvalueChangedCallback, do_toggle_heading, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard, (char *)"Latitude Plot",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-p-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNindicatorOn, XmINDICATOR_CHECK_BOX); ac++;
-        XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 210); ac++;
-        XtSetArg(args[ac], XmNwidth, 110); ac++;
-        XtSetArg(args[ac], XmNheight, 20); ac++;
-        toggleButton_lat = XmCreateToggleButton(bulletinBoard,
-            (char *)"toggleButton_lat",
-            args,
-            ac);
-        XtManageChild(toggleButton_lat);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(toggleButton_lat, XmNvalueChangedCallback, do_toggle_lat, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard, (char *)"Longitude Plot",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-p-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNindicatorOn, XmINDICATOR_CHECK_BOX); ac++;
-        XtSetArg(args[ac], XmNstringDirection, XmSTRING_DIRECTION_L_TO_R); ac++;
-        XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 140); ac++;
-        XtSetArg(args[ac], XmNwidth, 140); ac++;
-        XtSetArg(args[ac], XmNheight, 20); ac++;
-        toggleButton_lon = XmCreateToggleButton(bulletinBoard,
-            (char *)"toggleButton_lon",
-            args,
-            ac);
-        XtManageChild(toggleButton_lon);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(toggleButton_lon, XmNvalueChangedCallback, do_toggle_lon, (XtPointer)0);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNscrollingPolicy, XmAUTOMATIC); ac++;
-    XtSetArg(args[ac], XmNx, 210); ac++;
-    XtSetArg(args[ac], XmNy, 80); ac++;
-    XtSetArg(args[ac], XmNwidth, 800); ac++;
-    XtSetArg(args[ac], XmNheight, 590); ac++;
-    scrolledWindow = XmCreateScrolledWindow(bulletinBoard,
-        (char *)"scrolledWindow",
-        args,
-        ac);
-    XtManageChild(scrolledWindow);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNborderWidth, 1); ac++;
-    XtSetArg(args[ac], XmNbackground,
-        BX_CONVERT(scrolledWindow, (char *)"white",
-        XmRPixel, 0, &argok)); if (argok) ac++;
-    XtSetArg(args[ac], XmNwidth, 767); ac++;
-    XtSetArg(args[ac], XmNheight, 2000); ac++;
-    drawingArea = XmCreateDrawingArea(scrolledWindow,
-        (char *)"drawingArea",
-        args,
-        ac);
-    XtManageChild(drawingArea);
-    XtAddCallback(drawingArea, XmNresizeCallback, do_resize, (XtPointer)0);
-    XtAddCallback(drawingArea, XmNinputCallback, do_event, (XtPointer)0);
-    XtAddCallback(drawingArea, XmNexposeCallback, do_expose, (XtPointer)0);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNtitle, "About MBnavedit"); ac++;
-    XtSetArg(args[ac], XmNdeleteResponse, XmUNMAP); ac++;
-    XtSetArg(args[ac], XmNwidth, 481); ac++;
-    XtSetArg(args[ac], XmNheight, 466); ac++;
-    xmDialogShell_about = XmCreateDialogShell(mainWindow,
-        (char *)"xmDialogShell_about",
-        args,
-        ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNresizePolicy, XmRESIZE_GROW); ac++;
-    XtSetArg(args[ac], XmNx, 1040); ac++;
-    XtSetArg(args[ac], XmNy, 1104); ac++;
-    XtSetArg(args[ac], XmNwidth, 481); ac++;
-    XtSetArg(args[ac], XmNheight, 466); ac++;
-    bulletinBoard_about = XtCreateWidget((char *)"bulletinBoard_about",
-        xmBulletinBoardWidgetClass,
-        xmDialogShell_about,
-        args,
-        ac);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_about, (char *)"David W. Caress    and    Dale N. Chayes",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_about, (char *)"-*-"SERIF"-bold-r-*-*-*-140-*-*-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 260); ac++;
-        XtSetArg(args[ac], XmNwidth, 450); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        label_about_create1 = XmCreateLabel(bulletinBoard_about,
-            (char *)"label_about_create1",
-            args,
-            ac);
-        XtManageChild(label_about_create1);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 10); ac++;
-    XtSetArg(args[ac], XmNy, 220); ac++;
-    XtSetArg(args[ac], XmNwidth, 450); ac++;
-    XtSetArg(args[ac], XmNheight, 20); ac++;
-    separator1 = XmCreateSeparator(bulletinBoard_about,
-        (char *)"separator1",
-        args,
-        ac);
-    XtManageChild(separator1);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_about, (char *)"Dismiss",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_about, (char *)"-*-"SERIF"-bold-r-*-*-*-140-*-*-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 190); ac++;
-        XtSetArg(args[ac], XmNy, 420); ac++;
-        XtSetArg(args[ac], XmNwidth, 90); ac++;
-        XtSetArg(args[ac], XmNheight, 35); ac++;
-        pushButton_about_dismiss = XmCreatePushButton(bulletinBoard_about,
-            (char *)"pushButton_about_dismiss",
-            args,
-            ac);
-        XtManageChild(pushButton_about_dismiss);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_about_dismiss, XmNactivateCallback, BxUnmanageCB, (XtPointer)"bulletinBoard_about");
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_about, (char *)"Created by:",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_about, (char *)"-*-"SERIF"-bold-r-*-*-*-140-*-*-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 240); ac++;
-        XtSetArg(args[ac], XmNwidth, 450); ac++;
-        XtSetArg(args[ac], XmNheight, 20); ac++;
-        label_about_create = XmCreateLabel(bulletinBoard_about,
-            (char *)"label_about_create",
-            args,
-            ac);
-        XtManageChild(label_about_create);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_about, (char *)":::t\"Lamont-Doherty \":t\"Earth Observatory\"\"of Columbia University\"",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_about, (char *)"-*-"SERIF"-bold-r-*-*-*-120-*-*-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 250); ac++;
-        XtSetArg(args[ac], XmNy, 290); ac++;
-        XtSetArg(args[ac], XmNwidth, 190); ac++;
-        XtSetArg(args[ac], XmNheight, 70); ac++;
-        label_about_lamont = XmCreateLabel(bulletinBoard_about,
-            (char *)"label_about_lamont",
-            args,
-            ac);
-        XtManageChild(label_about_lamont);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_about, (char *)":::t\"Monterey Bay\":t\"Aquarium\"\"Research Institute\"",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_about, (char *)"-*-"SERIF"-bold-r-*-*-*-120-*-*-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 60); ac++;
-        XtSetArg(args[ac], XmNy, 290); ac++;
-        XtSetArg(args[ac], XmNwidth, 160); ac++;
-        XtSetArg(args[ac], XmNheight, 70); ac++;
-        label_about_columbia = XmCreateLabel(bulletinBoard_about,
-            (char *)"label_about_columbia",
-            args,
-            ac);
-        XtManageChild(label_about_columbia);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_about, (char *)"MB-System",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_about, (char *)"-*-"SERIF"-bold-r-*-*-*-240-*-*-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 120); ac++;
-        XtSetArg(args[ac], XmNwidth, 450); ac++;
-        XtSetArg(args[ac], XmNheight, 38); ac++;
-        label_about_mbsystem = XmCreateLabel(bulletinBoard_about,
-            (char *)"label_about_mbsystem",
-            args,
-            ac);
-        XtManageChild(label_about_mbsystem);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_about, (char *)"An Open Source Software Package",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_about, (char *)"-*-"SERIF"-bold-r-*-*-*-140-*-*-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 160); ac++;
-        XtSetArg(args[ac], XmNwidth, 450); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        label_about_mbpub = XmCreateLabel(bulletinBoard_about,
-            (char *)"label_about_mbpub",
-            args,
-            ac);
-        XtManageChild(label_about_mbpub);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_about, (char *)"One Component of the",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_about, (char *)"-*-"SERIF"-bold-r-*-*-*-140-*-*-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 90); ac++;
-        XtSetArg(args[ac], XmNwidth, 450); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        label_about_component = XmCreateLabel(bulletinBoard_about,
-            (char *)"label_about_component",
-            args,
-            ac);
-        XtManageChild(label_about_component);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_about, (char *)"for Processing and Display of Swath Sonar Data",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_about, (char *)"-*-"SERIF"-bold-r-*-*-*-140-*-*-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 190); ac++;
-        XtSetArg(args[ac], XmNwidth, 460); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        label_about_for = XmCreateLabel(bulletinBoard_about,
-            (char *)"label_about_for",
-            args,
-            ac);
-        XtManageChild(label_about_for);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 10); ac++;
-    XtSetArg(args[ac], XmNy, 70); ac++;
-    XtSetArg(args[ac], XmNwidth, 450); ac++;
-    XtSetArg(args[ac], XmNheight, 20); ac++;
-    separator = XmCreateSeparator(bulletinBoard_about,
-        (char *)"separator",
-        args,
-        ac);
-    XtManageChild(separator);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_about, (char *)":::t\"MB-System Release 4.6\"\"April 14, 1999\"",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_about, (char *)"-*-"SERIF"-medium-r-*-*-*-140-*-*-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 360); ac++;
-        XtSetArg(args[ac], XmNwidth, 450); ac++;
-        XtSetArg(args[ac], XmNheight, 60); ac++;
-        label_about_version = XmCreateLabel(bulletinBoard_about,
-            (char *)"label_about_version",
-            args,
-            ac);
-        XtManageChild(label_about_version);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_about, (char *)"Interactive Navigation Editor",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_about, (char *)"-*-"SERIF"-bold-r-*-*-*-180-*-*-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 40); ac++;
-        XtSetArg(args[ac], XmNwidth, 450); ac++;
-        XtSetArg(args[ac], XmNheight, 23); ac++;
-        label_about_function = XmCreateLabel(bulletinBoard_about,
-            (char *)"label_about_function",
-            args,
-            ac);
-        XtManageChild(label_about_function);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_about, (char *)"MBnavedit",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_about, (char *)"-*-"SERIF"-bold-r-*-*-*-240-*-*-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 10); ac++;
-        XtSetArg(args[ac], XmNwidth, 450); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        label_about_mbedit = XmCreateLabel(bulletinBoard_about,
-            (char *)"label_about_mbedit",
-            args,
-            ac);
-        XtManageChild(label_about_mbedit);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNtitle, "Please Wait..."); ac++;
-    XtSetArg(args[ac], XmNmwmInputMode, MWM_INPUT_MODELESS); ac++;
-    XtSetArg(args[ac], XmNdeleteResponse, XmUNMAP); ac++;
-    XtSetArg(args[ac], XmNwidth, 379); ac++;
-    XtSetArg(args[ac], XmNheight, 86); ac++;
-    xmDialogShell_message = XmCreateDialogShell(mainWindow,
-        (char *)"xmDialogShell_message",
-        args,
-        ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNdialogStyle, XmDIALOG_FULL_APPLICATION_MODAL); ac++;
-    XtSetArg(args[ac], XmNresizePolicy, XmRESIZE_NONE); ac++;
-    XtSetArg(args[ac], XmNx, 1091); ac++;
-    XtSetArg(args[ac], XmNy, 1294); ac++;
-    XtSetArg(args[ac], XmNwidth, 379); ac++;
-    XtSetArg(args[ac], XmNheight, 86); ac++;
-    bulletinBoard_message = XtCreateWidget((char *)"bulletinBoard_message",
-        xmBulletinBoardWidgetClass,
-        xmDialogShell_message,
-        args,
-        ac);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_message, (char *)"Thank you for your patience.",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 40); ac++;
-        XtSetArg(args[ac], XmNwidth, 360); ac++;
-        XtSetArg(args[ac], XmNheight, 20); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_message, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        label_pleasewait = XmCreateLabel(bulletinBoard_message,
-            (char *)"label_pleasewait",
-            args,
-            ac);
-        XtManageChild(label_pleasewait);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_message, (char *)"MBvelocitytool is loading data...",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 10); ac++;
-        XtSetArg(args[ac], XmNwidth, 360); ac++;
-        XtSetArg(args[ac], XmNheight, 20); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_message, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        label_message = XmCreateLabel(bulletinBoard_message,
-            (char *)"label_message",
-            args,
-            ac);
-        XtManageChild(label_message);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNtitle, "Error"); ac++;
-    XtSetArg(args[ac], XmNwidth, 311); ac++;
-    XtSetArg(args[ac], XmNheight, 161); ac++;
-    xmDialogShell_error = XmCreateDialogShell(mainWindow,
-        (char *)"xmDialogShell_error",
-        args,
-        ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNdialogStyle, XmDIALOG_APPLICATION_MODAL); ac++;
-    XtSetArg(args[ac], XmNresizePolicy, XmRESIZE_GROW); ac++;
-    XtSetArg(args[ac], XmNx, 1125); ac++;
-    XtSetArg(args[ac], XmNy, 1256); ac++;
-    XtSetArg(args[ac], XmNwidth, 311); ac++;
-    XtSetArg(args[ac], XmNheight, 161); ac++;
-    bulletinBoard_error = XtCreateWidget((char *)"bulletinBoard_error",
-        xmBulletinBoardWidgetClass,
-        xmDialogShell_error,
-        args,
-        ac);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_error, (char *)"You probably do not have write",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 40); ac++;
-        XtSetArg(args[ac], XmNwidth, 290); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_error, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        label_error_two = XmCreateLabel(bulletinBoard_error,
-            (char *)"label_error_two",
-            args,
-            ac);
-        XtManageChild(label_error_two);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_error, (char *)"Unable to open output file.",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 10); ac++;
-        XtSetArg(args[ac], XmNwidth, 290); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_error, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        label_error_one = XmCreateLabel(bulletinBoard_error,
-            (char *)"label_error_one",
-            args,
-            ac);
-        XtManageChild(label_error_one);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_error, (char *)"permission in this directory!",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 70); ac++;
-        XtSetArg(args[ac], XmNwidth, 290); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_error, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        label_error_three = XmCreateLabel(bulletinBoard_error,
-            (char *)"label_error_three",
-            args,
-            ac);
-        XtManageChild(label_error_three);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_error, (char *)"OK",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 110); ac++;
-        XtSetArg(args[ac], XmNy, 110); ac++;
-        XtSetArg(args[ac], XmNwidth, 90); ac++;
-        XtSetArg(args[ac], XmNheight, 40); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_error, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_error = XmCreatePushButton(bulletinBoard_error,
-            (char *)"pushButton_error",
-            args,
-            ac);
-        XtManageChild(pushButton_error);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNtitle, "Select Input Data File"); ac++;
-    XtSetArg(args[ac], XmNallowShellResize, False); ac++;
-    XtSetArg(args[ac], XmNwidth, 606); ac++;
-    XtSetArg(args[ac], XmNheight, 557); ac++;
-    xmDialogShell_fileselection = XmCreateDialogShell(mainWindow,
-        (char *)"xmDialogShell_fileselection",
-        args,
-        ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNresizePolicy, XmRESIZE_NONE); ac++;
-    XtSetArg(args[ac], XmNx, 0); ac++;
-    XtSetArg(args[ac], XmNy, 1058); ac++;
-    XtSetArg(args[ac], XmNwidth, 606); ac++;
-    XtSetArg(args[ac], XmNheight, 557); ac++;
-    bulletinBoard_fileselection = XtCreateWidget((char *)"bulletinBoard_fileselection",
-        xmBulletinBoardWidgetClass,
-        xmDialogShell_fileselection,
-        args,
-        ac);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_fileselection, (char *)"Output Mode:",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_fileselection, (char *)"-*-"SANS"-bold-r-normal--14-140-75-75-p-82-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
-        XtSetArg(args[ac], XmNx, 290); ac++;
-        XtSetArg(args[ac], XmNy, 480); ac++;
-        XtSetArg(args[ac], XmNwidth, 100); ac++;
-        XtSetArg(args[ac], XmNheight, 40); ac++;
-        label_output_mode = XmCreateLabel(bulletinBoard_fileselection,
-            (char *)"label_output_mode",
-            args,
-            ac);
-        XtManageChild(label_output_mode);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 390); ac++;
-    XtSetArg(args[ac], XmNy, 480); ac++;
-    XtSetArg(args[ac], XmNwidth, 167); ac++;
-    XtSetArg(args[ac], XmNheight, 65); ac++;
-    XtSetArg(args[ac], XmNisHomogeneous, False); ac++;
-    radioBox_output = XmCreateRadioBox(bulletinBoard_fileselection,
-        (char *)"radioBox_output",
-        args,
-        ac);
-    XtManageChild(radioBox_output);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(radioBox_output, (char *)"Output Edited Data",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(radioBox_output, (char *)"-*-"SANS"-bold-r-normal--14-140-75-75-p-82-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNwidth, 161); ac++;
-        XtSetArg(args[ac], XmNheight, 28); ac++;
-        toggleButton_output_on = XmCreateToggleButton(radioBox_output,
-            (char *)"toggleButton_output_on",
-            args,
-            ac);
-        XtManageChild(toggleButton_output_on);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(toggleButton_output_on, XmNvalueChangedCallback, do_toggle_output_on, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(radioBox_output, (char *)"Browse Only",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(radioBox_output, (char *)"-*-"SANS"-bold-r-normal--14-140-75-75-p-82-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNwidth, 161); ac++;
-        XtSetArg(args[ac], XmNheight, 28); ac++;
-        toggleButton_output_off = XmCreateToggleButton(radioBox_output,
-            (char *)"toggleButton_output_off",
-            args,
-            ac);
-        XtManageChild(toggleButton_output_off);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(toggleButton_output_off, XmNvalueChangedCallback, do_toggle_output_off, (XtPointer)0);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(bulletinBoard_fileselection, (char *)"-*-"SANS"-bold-r-normal--14-140-75-75-p-82-iso8859-1",
-        XmRFontList, 0, &argok)); if (argok) ac++;
-    XtSetArg(args[ac], XmNx, 140); ac++;
-    XtSetArg(args[ac], XmNy, 480); ac++;
-    XtSetArg(args[ac], XmNwidth, 100); ac++;
-    XtSetArg(args[ac], XmNheight, 35); ac++;
-    textField_format = XmCreateTextField(bulletinBoard_fileselection,
-        (char *)"textField_format",
-        args,
-        ac);
-    XtManageChild(textField_format);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_fileselection, (char *)"MBIO Format ID:",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_fileselection, (char *)"-*-"SANS"-bold-r-normal--14-140-75-75-p-82-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
-        XtSetArg(args[ac], XmNx, 20); ac++;
-        XtSetArg(args[ac], XmNy, 480); ac++;
-        XtSetArg(args[ac], XmNwidth, 120); ac++;
-        XtSetArg(args[ac], XmNheight, 40); ac++;
-        label_format = XmCreateLabel(bulletinBoard_fileselection,
-            (char *)"label_format",
-            args,
-            ac);
-        XtManageChild(label_format);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_fileselection, (char *)"",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNdialogTitle, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNlistVisibleItemCount, 13); ac++;
-        XtSetArg(args[ac], XmNtextFontList,
-            BX_CONVERT(bulletinBoard_fileselection, (char *)"-*-"SANS"-bold-r-normal--14-140-75-75-p-82-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNlabelFontList,
-            BX_CONVERT(bulletinBoard_fileselection, (char *)"-*-"SANS"-bold-r-normal--14-140-75-75-p-82-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNbuttonFontList,
-            BX_CONVERT(bulletinBoard_fileselection, (char *)"-*-"SANS"-bold-r-normal--14-140-75-75-p-82-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNautoUnmanage, False); ac++;
-        XtSetArg(args[ac], XmNnoResize, True); ac++;
-        XtSetArg(args[ac], XmNresizePolicy, XmRESIZE_NONE); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 10); ac++;
-        XtSetArg(args[ac], XmNwidth, 590); ac++;
-        XtSetArg(args[ac], XmNheight, 470); ac++;
-        fileSelectionBox = XmCreateFileSelectionBox(bulletinBoard_fileselection,
-            (char *)"fileSelectionBox",
-            args,
-            ac);
-        XtManageChild(fileSelectionBox);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(fileSelectionBox, XmNokCallback, do_fileselection_ok, (XtPointer)0);
-    XtAddCallback(fileSelectionBox, XmNokCallback, BxUnmanageCB, (XtPointer)"bulletinBoard_fileselection");
-    XtAddCallback(fileSelectionBox, XmNnoMatchCallback, do_fileselection_nomatch, (XtPointer)0);
-    XtAddCallback(fileSelectionBox, XmNcancelCallback, do_fileselection_cancel, (XtPointer)0);
-    XtAddCallback(fileSelectionBox, XmNcancelCallback, BxUnmanageCB, (XtPointer)"bulletinBoard_fileselection");
-    XtAddCallback(fileSelectionBox, XmNapplyCallback, do_fileselection_filter, (XtPointer)0);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNtitle, "Controls"); ac++;
-    XtSetArg(args[ac], XmNwidth, 491); ac++;
-    XtSetArg(args[ac], XmNheight, 195); ac++;
-    xmDialogShell_timestepping = XmCreateDialogShell(mainWindow,
-        (char *)"xmDialogShell_timestepping",
-        args,
-        ac);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(xmDialogShell_timestepping, (char *)"Time Stepping",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNdialogTitle, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNautoUnmanage, False); ac++;
-        XtSetArg(args[ac], XmNresizePolicy, XmRESIZE_GROW); ac++;
-        XtSetArg(args[ac], XmNx, 1035); ac++;
-        XtSetArg(args[ac], XmNy, 1239); ac++;
-        XtSetArg(args[ac], XmNwidth, 491); ac++;
-        XtSetArg(args[ac], XmNheight, 195); ac++;
-        bulletinBoard_timestepping = XtCreateWidget((char *)"bulletinBoard_timestepping",
-            xmBulletinBoardWidgetClass,
-            xmDialogShell_timestepping,
-            args,
-            ac);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_timestepping, (char *)"Dismiss",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 200); ac++;
-        XtSetArg(args[ac], XmNy, 140); ac++;
-        XtSetArg(args[ac], XmNwidth, 110); ac++;
-        XtSetArg(args[ac], XmNheight, 40); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_timestepping, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_timestepping_dismiss = XmCreatePushButton(bulletinBoard_timestepping,
-            (char *)"pushButton_timestepping_dismiss",
-            args,
-            ac);
-        XtManageChild(pushButton_timestepping_dismiss);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_timestepping_dismiss, XmNactivateCallback, BxUnmanageCB, (XtPointer)"bulletinBoard_timestepping");
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_timestepping, (char *)"500",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_timestepping, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-p-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
-        XtSetArg(args[ac], XmNx, 440); ac++;
-        XtSetArg(args[ac], XmNy, 70); ac++;
-        XtSetArg(args[ac], XmNwidth, 40); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        label_timestep_2 = XmCreateLabel(bulletinBoard_timestepping,
-            (char *)"label_timestep_2",
-            args,
-            ac);
-        XtManageChild(label_timestep_2);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(bulletinBoard_timestepping, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-p-*-iso8859-1",
-        XmRFontList, 0, &argok)); if (argok) ac++;
-    XtSetArg(args[ac], XmNorientation, XmHORIZONTAL); ac++;
-    XtSetArg(args[ac], XmNx, 180); ac++;
-    XtSetArg(args[ac], XmNy, 70); ac++;
-    XtSetArg(args[ac], XmNwidth, 260); ac++;
-    XtSetArg(args[ac], XmNheight, 50); ac++;
-    scale_timestep = XmCreateScale(bulletinBoard_timestepping,
-        (char *)"scale_timestep",
-        args,
-        ac);
-    XtManageChild(scale_timestep);
-    XtAddCallback(scale_timestep, XmNvalueChangedCallback, do_timestep, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_timestepping, (char *)"Time Step (sec):  1",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_END); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_timestepping, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-p-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 90); ac++;
-        XtSetArg(args[ac], XmNwidth, 170); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        label_timestep_1 = XmCreateLabel(bulletinBoard_timestepping,
-            (char *)"label_timestep_1",
-            args,
-            ac);
-        XtManageChild(label_timestep_1);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_timestepping, (char *)"500",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_timestepping, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-p-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
-        XtSetArg(args[ac], XmNx, 440); ac++;
-        XtSetArg(args[ac], XmNy, 30); ac++;
-        XtSetArg(args[ac], XmNwidth, 40); ac++;
-        XtSetArg(args[ac], XmNheight, 20); ac++;
-        label_timespan_2 = XmCreateLabel(bulletinBoard_timestepping,
-            (char *)"label_timespan_2",
-            args,
-            ac);
-        XtManageChild(label_timespan_2);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_timestepping, (char *)" ",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNtitleString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_timestepping, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-p-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNorientation, XmHORIZONTAL); ac++;
-        XtSetArg(args[ac], XmNstringDirection, XmSTRING_DIRECTION_L_TO_R); ac++;
-        XtSetArg(args[ac], XmNx, 180); ac++;
-        XtSetArg(args[ac], XmNy, 10); ac++;
-        XtSetArg(args[ac], XmNwidth, 260); ac++;
-        XtSetArg(args[ac], XmNheight, 50); ac++;
-        scale_timespan = XmCreateScale(bulletinBoard_timestepping,
-            (char *)"scale_timespan",
-            args,
-            ac);
-        XtManageChild(scale_timespan);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(scale_timespan, XmNvalueChangedCallback, do_timespan, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_timestepping, (char *)"TIme Span Shown (sec):  1",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_END); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_timestepping, (char *)"-*-"SANS"-bold-r-*-*-*-120-75-75-p-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 30); ac++;
-        XtSetArg(args[ac], XmNwidth, 170); ac++;
-        XtSetArg(args[ac], XmNheight, 20); ac++;
-        label_timespan_1 = XmCreateLabel(bulletinBoard_timestepping,
-            (char *)"label_timespan_1",
-            args,
-            ac);
-        XtManageChild(label_timespan_1);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNtitle, "Navigation Modeling"); ac++;
-    XtSetArg(args[ac], XmNwidth, 492); ac++;
-    XtSetArg(args[ac], XmNheight, 548); ac++;
-    xmDialogShell_modeling = XmCreateDialogShell(mainWindow,
-        (char *)"xmDialogShell_modeling",
-        args,
-        ac);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(xmDialogShell_modeling, (char *)"Navigation Modeling",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNdialogTitle, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNautoUnmanage, False); ac++;
-        XtSetArg(args[ac], XmNresizePolicy, XmRESIZE_GROW); ac++;
-        XtSetArg(args[ac], XmNx, 1035); ac++;
-        XtSetArg(args[ac], XmNy, 1063); ac++;
-        XtSetArg(args[ac], XmNwidth, 492); ac++;
-        XtSetArg(args[ac], XmNheight, 548); ac++;
-        bulletinBoard_modeling = XtCreateWidget((char *)"bulletinBoard_modeling",
-            xmBulletinBoardWidgetClass,
-            xmDialogShell_modeling,
-            args,
-            ac);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_modeling, (char *)"Gaussian Mean Time Window (seconds)",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNtitleString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNminimum, 1); ac++;
-        XtSetArg(args[ac], XmNdecimalPoints, 1); ac++;
-        XtSetArg(args[ac], XmNvalue, 100); ac++;
-        XtSetArg(args[ac], XmNmaximum, 10000); ac++;
-        XtSetArg(args[ac], XmNshowArrows, TRUE); ac++;
-        XtSetArg(args[ac], XmNscaleMultiple, 1); ac++;
-        XtSetArg(args[ac], XmNshowValue, TRUE); ac++;
-        XtSetArg(args[ac], XmNorientation, XmHORIZONTAL); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 100); ac++;
-        XtSetArg(args[ac], XmNwidth, 470); ac++;
-        XtSetArg(args[ac], XmNheight, 63); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_modeling, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        scale_meantimewindow = XmCreateScale(bulletinBoard_modeling,
-            (char *)"scale_meantimewindow",
-            args,
-            ac);
-        XtManageChild(scale_meantimewindow);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(scale_meantimewindow, XmNvalueChangedCallback, do_meantimewindow, (XtPointer)0);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 10); ac++;
-    XtSetArg(args[ac], XmNy, 70); ac++;
-    XtSetArg(args[ac], XmNwidth, 470); ac++;
-    XtSetArg(args[ac], XmNheight, 30); ac++;
-    separator5 = XmCreateSeparator(bulletinBoard_modeling,
-        (char *)"separator5",
-        args,
-        ac);
-    XtManageChild(separator5);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_modeling, (char *)"Apply",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 30); ac++;
-        XtSetArg(args[ac], XmNy, 390); ac++;
-        XtSetArg(args[ac], XmNwidth, 110); ac++;
-        XtSetArg(args[ac], XmNheight, 40); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_modeling, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_modeling_apply = XmCreatePushButton(bulletinBoard_modeling,
-            (char *)"pushButton_modeling_apply",
-            args,
-            ac);
-        XtManageChild(pushButton_modeling_apply);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_modeling_apply, XmNactivateCallback, do_modeling_apply, (XtPointer)0);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 10); ac++;
-    XtSetArg(args[ac], XmNy, 450); ac++;
-    XtSetArg(args[ac], XmNwidth, 470); ac++;
-    XtSetArg(args[ac], XmNheight, 30); ac++;
-    separator4 = XmCreateSeparator(bulletinBoard_modeling,
-        (char *)"separator4",
-        args,
-        ac);
-    XtManageChild(separator4);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_modeling, (char *)"Acceleration:",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_END); ac++;
-        XtSetArg(args[ac], XmNx, 160); ac++;
-        XtSetArg(args[ac], XmNy, 410); ac++;
-        XtSetArg(args[ac], XmNwidth, 150); ac++;
-        XtSetArg(args[ac], XmNheight, 40); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_modeling, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        label_modeling_acceleration = XmCreateLabel(bulletinBoard_modeling,
-            (char *)"label_modeling_acceleration",
-            args,
-            ac);
-        XtManageChild(label_modeling_acceleration);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_modeling, (char *)"Speed Deviation:",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_END); ac++;
-        XtSetArg(args[ac], XmNx, 170); ac++;
-        XtSetArg(args[ac], XmNy, 360); ac++;
-        XtSetArg(args[ac], XmNwidth, 140); ac++;
-        XtSetArg(args[ac], XmNheight, 40); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_modeling, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        label_modeling_speed = XmCreateLabel(bulletinBoard_modeling,
-            (char *)"label_modeling_speed",
-            args,
-            ac);
-        XtManageChild(label_modeling_speed);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_modeling, (char *)"Inversion Penalty Weighting:",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 330); ac++;
-        XtSetArg(args[ac], XmNwidth, 220); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_modeling, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        label_modeling_inversion = XmCreateLabel(bulletinBoard_modeling,
-            (char *)"label_modeling_inversion",
-            args,
-            ac);
-        XtManageChild(label_modeling_inversion);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 320); ac++;
-    XtSetArg(args[ac], XmNy, 410); ac++;
-    XtSetArg(args[ac], XmNwidth, 140); ac++;
-    XtSetArg(args[ac], XmNheight, 40); ac++;
-    XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(bulletinBoard_modeling, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-        XmRFontList, 0, &argok)); if (argok) ac++;
-    textField_modeling_acceleration = XmCreateTextField(bulletinBoard_modeling,
-        (char *)"textField_modeling_acceleration",
-        args,
-        ac);
-    XtManageChild(textField_modeling_acceleration);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 320); ac++;
-    XtSetArg(args[ac], XmNy, 360); ac++;
-    XtSetArg(args[ac], XmNwidth, 140); ac++;
-    XtSetArg(args[ac], XmNheight, 40); ac++;
-    XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(bulletinBoard_modeling, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-        XmRFontList, 0, &argok)); if (argok) ac++;
-    textField_modeling_speed = XmCreateTextField(bulletinBoard_modeling,
-        (char *)"textField_modeling_speed",
-        args,
-        ac);
-    XtManageChild(textField_modeling_speed);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_modeling, (char *)"Dismiss",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 190); ac++;
-        XtSetArg(args[ac], XmNy, 490); ac++;
-        XtSetArg(args[ac], XmNwidth, 110); ac++;
-        XtSetArg(args[ac], XmNheight, 40); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_modeling, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_modeling_dismiss = XmCreatePushButton(bulletinBoard_modeling,
-            (char *)"pushButton_modeling_dismiss",
-            args,
-            ac);
-        XtManageChild(pushButton_modeling_dismiss);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_modeling_dismiss, XmNactivateCallback, BxUnmanageCB, (XtPointer)"bulletinBoard_modeling");
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 10); ac++;
-    XtSetArg(args[ac], XmNy, 310); ac++;
-    XtSetArg(args[ac], XmNwidth, 470); ac++;
-    XtSetArg(args[ac], XmNheight, 20); ac++;
-    separator3 = XmCreateSeparator(bulletinBoard_modeling,
-        (char *)"separator3",
-        args,
-        ac);
-    XtManageChild(separator3);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_modeling, (char *)"Dead Reckoning Latitude Drift (deg/hr)",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNtitleString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNminimum, -1000); ac++;
-        XtSetArg(args[ac], XmNdecimalPoints, 5); ac++;
-        XtSetArg(args[ac], XmNmaximum, 1000); ac++;
-        XtSetArg(args[ac], XmNshowArrows, TRUE); ac++;
-        XtSetArg(args[ac], XmNshowValue, TRUE); ac++;
-        XtSetArg(args[ac], XmNorientation, XmHORIZONTAL); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 250); ac++;
-        XtSetArg(args[ac], XmNwidth, 470); ac++;
-        XtSetArg(args[ac], XmNheight, 63); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_modeling, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        scale_driftlat = XmCreateScale(bulletinBoard_modeling,
-            (char *)"scale_driftlat",
-            args,
-            ac);
-        XtManageChild(scale_driftlat);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(scale_driftlat, XmNvalueChangedCallback, do_driftlat, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_modeling, (char *)"Dead Reckoning Longitude Drift (deg/hr)",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNtitleString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNminimum, -1000); ac++;
-        XtSetArg(args[ac], XmNdecimalPoints, 5); ac++;
-        XtSetArg(args[ac], XmNmaximum, 1000); ac++;
-        XtSetArg(args[ac], XmNshowArrows, TRUE); ac++;
-        XtSetArg(args[ac], XmNshowValue, TRUE); ac++;
-        XtSetArg(args[ac], XmNorientation, XmHORIZONTAL); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 180); ac++;
-        XtSetArg(args[ac], XmNwidth, 470); ac++;
-        XtSetArg(args[ac], XmNheight, 63); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_modeling, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        scale_driftlon = XmCreateScale(bulletinBoard_modeling,
-            (char *)"scale_driftlon",
-            args,
-            ac);
-        XtManageChild(scale_driftlon);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(scale_driftlon, XmNvalueChangedCallback, do_driftlon, (XtPointer)0);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 10); ac++;
-    XtSetArg(args[ac], XmNy, 160); ac++;
-    XtSetArg(args[ac], XmNwidth, 470); ac++;
-    XtSetArg(args[ac], XmNheight, 30); ac++;
-    separator2 = XmCreateSeparator(bulletinBoard_modeling,
-        (char *)"separator2",
-        args,
-        ac);
-    XtManageChild(separator2);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_modeling, (char *)"Navigation Modeling Mode:",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 10); ac++;
-        XtSetArg(args[ac], XmNwidth, 200); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_modeling, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        label_modeling_mode = XmCreateLabel(bulletinBoard_modeling,
-            (char *)"label_modeling_mode",
-            args,
-            ac);
-        XtManageChild(label_modeling_mode);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNpacking, XmPACK_TIGHT); ac++;
-    XtSetArg(args[ac], XmNorientation, XmHORIZONTAL); ac++;
-    XtSetArg(args[ac], XmNx, 20); ac++;
-    XtSetArg(args[ac], XmNy, 40); ac++;
-    XtSetArg(args[ac], XmNwidth, 434); ac++;
-    XtSetArg(args[ac], XmNheight, 34); ac++;
-    XtSetArg(args[ac], XmNisHomogeneous, False); ac++;
-    radioBox_modeling = XmCreateRadioBox(bulletinBoard_modeling,
-        (char *)"radioBox_modeling",
-        args,
-        ac);
-    XtManageChild(radioBox_modeling);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(radioBox_modeling, (char *)"Off",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNwidth, 48); ac++;
-        XtSetArg(args[ac], XmNheight, 28); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(radioBox_modeling, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        toggleButton_modeling_off = XmCreateToggleButton(radioBox_modeling,
-            (char *)"toggleButton_modeling_off",
-            args,
-            ac);
-        XtManageChild(toggleButton_modeling_off);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(toggleButton_modeling_off, XmNvalueChangedCallback, do_model_mode, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(radioBox_modeling, (char *)"Gaussian Mean",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNwidth, 135); ac++;
-        XtSetArg(args[ac], XmNheight, 28); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(radioBox_modeling, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        toggleButton_modeling_meanfilter = XmCreateToggleButton(radioBox_modeling,
-            (char *)"toggleButton_modeling_meanfilter",
-            args,
-            ac);
-        XtManageChild(toggleButton_modeling_meanfilter);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(toggleButton_modeling_meanfilter, XmNvalueChangedCallback, do_model_mode, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(radioBox_modeling, (char *)"Dead Reckoning",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNwidth, 143); ac++;
-        XtSetArg(args[ac], XmNheight, 28); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(radioBox_modeling, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        toggleButton_modeling_dr = XmCreateToggleButton(radioBox_modeling,
-            (char *)"toggleButton_modeling_dr",
-            args,
-            ac);
-        XtManageChild(toggleButton_modeling_dr);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(toggleButton_modeling_dr, XmNvalueChangedCallback, do_model_mode, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(radioBox_modeling, (char *)"Inversion",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNwidth, 93); ac++;
-        XtSetArg(args[ac], XmNheight, 28); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(radioBox_modeling, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        toggleButton_modeling_inversion = XmCreateToggleButton(radioBox_modeling,
-            (char *)"toggleButton_modeling_inversion",
-            args,
-            ac);
-        XtManageChild(toggleButton_modeling_inversion);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(toggleButton_modeling_inversion, XmNvalueChangedCallback, do_model_mode, (XtPointer)0);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNwidth, 503); ac++;
-    XtSetArg(args[ac], XmNheight, 126); ac++;
-    xmDialogShell_useprevious = XmCreateDialogShell(mainWindow,
-        (char *)"xmDialogShell_useprevious",
-        args,
-        ac);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(xmDialogShell_useprevious, (char *)"Use previously edited navigation?",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNdialogTitle, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNautoUnmanage, True); ac++;
-        XtSetArg(args[ac], XmNresizePolicy, XmRESIZE_GROW); ac++;
-        XtSetArg(args[ac], XmNx, 1029); ac++;
-        XtSetArg(args[ac], XmNy, 1274); ac++;
-        XtSetArg(args[ac], XmNwidth, 503); ac++;
-        XtSetArg(args[ac], XmNheight, 126); ac++;
-        bulletinBoard_useprevious = XtCreateWidget((char *)"bulletinBoard_useprevious",
-            xmBulletinBoardWidgetClass,
-            xmDialogShell_useprevious,
-            args,
-            ac);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_useprevious, (char *)":::t\"Previously edited navigation exists for the specified input file.\"\"Do you want to use the previously edited navigation?\"",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 10); ac++;
-        XtSetArg(args[ac], XmNwidth, 480); ac++;
-        XtSetArg(args[ac], XmNheight, 50); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_useprevious, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        label_useprevious = XmCreateLabel(bulletinBoard_useprevious,
-            (char *)"label_useprevious",
-            args,
-            ac);
-        XtManageChild(label_useprevious);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_useprevious, (char *)"No",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 290); ac++;
-        XtSetArg(args[ac], XmNy, 70); ac++;
-        XtSetArg(args[ac], XmNwidth, 110); ac++;
-        XtSetArg(args[ac], XmNheight, 40); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_useprevious, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_useprevious_no = XmCreatePushButton(bulletinBoard_useprevious,
-            (char *)"pushButton_useprevious_no",
-            args,
-            ac);
-        XtManageChild(pushButton_useprevious_no);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_useprevious_no, XmNactivateCallback, do_useprevious_no, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_useprevious, (char *)"Yes",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 110); ac++;
-        XtSetArg(args[ac], XmNy, 70); ac++;
-        XtSetArg(args[ac], XmNwidth, 110); ac++;
-        XtSetArg(args[ac], XmNheight, 40); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_useprevious, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_useprevious_yes = XmCreatePushButton(bulletinBoard_useprevious,
-            (char *)"pushButton_useprevious_yes",
-            args,
-            ac);
-        XtManageChild(pushButton_useprevious_yes);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_useprevious_yes, XmNactivateCallback, do_useprevious_yes, (XtPointer)0);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNtitle, "Time Interpolation"); ac++;
-    XtSetArg(args[ac], XmNwidth, 307); ac++;
-    XtSetArg(args[ac], XmNheight, 149); ac++;
-    xmDialogShell_timeinterpolation = XmCreateDialogShell(mainWindow,
-        (char *)"xmDialogShell_timeinterpolation",
-        args,
-        ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNautoUnmanage, False); ac++;
-    XtSetArg(args[ac], XmNresizePolicy, XmRESIZE_GROW); ac++;
-    XtSetArg(args[ac], XmNx, 1127); ac++;
-    XtSetArg(args[ac], XmNy, 1262); ac++;
-    XtSetArg(args[ac], XmNwidth, 307); ac++;
-    XtSetArg(args[ac], XmNheight, 149); ac++;
-    bulletinBoard_timeinterpolation = XtCreateWidget((char *)"bulletinBoard_timeinterpolation",
-        xmBulletinBoardWidgetClass,
-        xmDialogShell_timeinterpolation,
-        args,
-        ac);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_timeinterpolation, (char *)":::t\"Click \\\"Apply\\\" to interpolate duplicate \":t\"time stamps. Non-duplicate time stamps \"\"will not be affected.\"",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 10); ac++;
-        XtSetArg(args[ac], XmNwidth, 290); ac++;
-        XtSetArg(args[ac], XmNheight, 70); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_timeinterpolation, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        label_timeinterpolation = XmCreateLabel(bulletinBoard_timeinterpolation,
-            (char *)"label_timeinterpolation",
-            args,
-            ac);
-        XtManageChild(label_timeinterpolation);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_timeinterpolation, (char *)"Dismiss",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 160); ac++;
-        XtSetArg(args[ac], XmNy, 80); ac++;
-        XtSetArg(args[ac], XmNwidth, 130); ac++;
-        XtSetArg(args[ac], XmNheight, 50); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_timeinterpolation, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_timeinterpolation_dismiss = XmCreatePushButton(bulletinBoard_timeinterpolation,
-            (char *)"pushButton_timeinterpolation_dismiss",
-            args,
-            ac);
-        XtManageChild(pushButton_timeinterpolation_dismiss);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_timeinterpolation_dismiss, XmNactivateCallback, BxUnmanageCB, (XtPointer)"bulletinBoard_timeinterpolation");
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_timeinterpolation, (char *)"Apply",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 20); ac++;
-        XtSetArg(args[ac], XmNy, 80); ac++;
-        XtSetArg(args[ac], XmNwidth, 130); ac++;
-        XtSetArg(args[ac], XmNheight, 50); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_timeinterpolation, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_timeinterpolation_apply = XmCreatePushButton(bulletinBoard_timeinterpolation,
-            (char *)"pushButton_timeinterpolation_apply",
-            args,
-            ac);
-        XtManageChild(pushButton_timeinterpolation_apply);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_timeinterpolation_apply, XmNactivateCallback, do_timeinterpolation_apply, (XtPointer)0);
-    XtAddCallback(pushButton_timeinterpolation_apply, XmNactivateCallback, BxUnmanageCB, (XtPointer)"bulletinBoard_timeinterpolation");
-
-    ac = 0;
-    XtSetArg(args[ac], XmNtitle, "Delete Bad Times"); ac++;
-    XtSetArg(args[ac], XmNwidth, 310); ac++;
-    XtSetArg(args[ac], XmNheight, 149); ac++;
-    dialogShell_deletebadtimetag = XmCreateDialogShell(mainWindow,
-        (char *)"dialogShell_deletebadtimetag",
-        args,
-        ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNautoUnmanage, False); ac++;
-    XtSetArg(args[ac], XmNresizePolicy, XmRESIZE_GROW); ac++;
-    XtSetArg(args[ac], XmNx, 1126); ac++;
-    XtSetArg(args[ac], XmNy, 1262); ac++;
-    XtSetArg(args[ac], XmNwidth, 310); ac++;
-    XtSetArg(args[ac], XmNheight, 149); ac++;
-    bulletinBoard_deletebadtimetag = XtCreateWidget((char *)"bulletinBoard_deletebadtimetag",
-        xmBulletinBoardWidgetClass,
-        dialogShell_deletebadtimetag,
-        args,
-        ac);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_deletebadtimetag, (char *)":::t\"Click \\\"Apply\\\" to delete duplicate \":t\"or reverse time stamps. Non-duplicate \"\"time stamps will not be affected.\"",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 10); ac++;
-        XtSetArg(args[ac], XmNwidth, 290); ac++;
-        XtSetArg(args[ac], XmNheight, 70); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_deletebadtimetag, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        label_deletetimetag = XmCreateLabel(bulletinBoard_deletebadtimetag,
-            (char *)"label_deletetimetag",
-            args,
-            ac);
-        XtManageChild(label_deletetimetag);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_deletebadtimetag, (char *)"Dismiss",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 160); ac++;
-        XtSetArg(args[ac], XmNy, 80); ac++;
-        XtSetArg(args[ac], XmNwidth, 130); ac++;
-        XtSetArg(args[ac], XmNheight, 50); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_deletebadtimetag, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_deletebadtimetag_dismiss = XmCreatePushButton(bulletinBoard_deletebadtimetag,
-            (char *)"pushButton_deletebadtimetag_dismiss",
-            args,
-            ac);
-        XtManageChild(pushButton_deletebadtimetag_dismiss);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_deletebadtimetag_dismiss, XmNactivateCallback, BxUnmanageCB, (XtPointer)"bulletinBoard_deletebadtimetag");
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_deletebadtimetag, (char *)"Apply",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 20); ac++;
-        XtSetArg(args[ac], XmNy, 80); ac++;
-        XtSetArg(args[ac], XmNwidth, 130); ac++;
-        XtSetArg(args[ac], XmNheight, 50); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(bulletinBoard_deletebadtimetag, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_deletebadtimetag_apply = XmCreatePushButton(bulletinBoard_deletebadtimetag,
-            (char *)"pushButton_deletebadtimetag_apply",
-            args,
-            ac);
-        XtManageChild(pushButton_deletebadtimetag_apply);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_deletebadtimetag_apply, XmNactivateCallback, do_deletebadtimetag_apply, (XtPointer)0);
-    XtAddCallback(pushButton_deletebadtimetag_apply, XmNactivateCallback, BxUnmanageCB, (XtPointer)"bulletinBoard_timeinterpolation");
-
-    ac = 0;
-    XtSetArg(args[ac], XmNwidth, 401); ac++;
-    XtSetArg(args[ac], XmNheight, 174); ac++;
-    xmDialogShell_offset = XmCreateDialogShell(mainWindow,
-        (char *)"xmDialogShell_offset",
-        args,
-        ac);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(xmDialogShell_offset, (char *)"Position Offset",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNdialogTitle, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNresizePolicy, XmRESIZE_GROW); ac++;
-        XtSetArg(args[ac], XmNx, 1080); ac++;
-        XtSetArg(args[ac], XmNy, 1250); ac++;
-        XtSetArg(args[ac], XmNwidth, 401); ac++;
-        XtSetArg(args[ac], XmNheight, 174); ac++;
-        form_offset = XtCreateWidget((char *)"form_offset",
-            xmFormWidgetClass,
-            xmDialogShell_offset,
-            args,
-            ac);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(form_offset, (char *)"Dismiss",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 210); ac++;
-        XtSetArg(args[ac], XmNy, 120); ac++;
-        XtSetArg(args[ac], XmNwidth, 118); ac++;
-        XtSetArg(args[ac], XmNheight, 40); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(form_offset, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_offset_dismiss = XmCreatePushButton(form_offset,
-            (char *)"pushButton_offset_dismiss",
-            args,
-            ac);
-        XtManageChild(pushButton_offset_dismiss);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_offset_dismiss, XmNactivateCallback, BxUnmanageCB, (XtPointer)"form_offset");
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(form_offset, (char *)"Apply",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 50); ac++;
-        XtSetArg(args[ac], XmNy, 120); ac++;
-        XtSetArg(args[ac], XmNwidth, 110); ac++;
-        XtSetArg(args[ac], XmNheight, 40); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(form_offset, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_offset_apply = XmCreatePushButton(form_offset,
-            (char *)"pushButton_offset_apply",
-            args,
-            ac);
-        XtManageChild(pushButton_offset_apply);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_offset_apply, XmNactivateCallback, do_offset_apply, (XtPointer)0);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 240); ac++;
-    XtSetArg(args[ac], XmNy, 60); ac++;
-    XtSetArg(args[ac], XmNwidth, 149); ac++;
-    XtSetArg(args[ac], XmNheight, 40); ac++;
-    XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(form_offset, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-        XmRFontList, 0, &argok)); if (argok) ac++;
-    textField_lat_offset = XmCreateTextField(form_offset,
-        (char *)"textField_lat_offset",
-        args,
-        ac);
-    XtManageChild(textField_lat_offset);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 240); ac++;
-    XtSetArg(args[ac], XmNy, 10); ac++;
-    XtSetArg(args[ac], XmNwidth, 149); ac++;
-    XtSetArg(args[ac], XmNheight, 40); ac++;
-    XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(form_offset, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-        XmRFontList, 0, &argok)); if (argok) ac++;
-    textField_lon_offset = XmCreateTextField(form_offset,
-        (char *)"textField_lon_offset",
-        args,
-        ac);
-    XtManageChild(textField_lon_offset);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(form_offset, (char *)"Latitude Offset (degrees):",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_END); ac++;
-        XtSetArg(args[ac], XmNx, 0); ac++;
-        XtSetArg(args[ac], XmNy, 60); ac++;
-        XtSetArg(args[ac], XmNwidth, 230); ac++;
-        XtSetArg(args[ac], XmNheight, 40); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(form_offset, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        label_offset_lat = XmCreateLabel(form_offset,
-            (char *)"label_offset_lat",
-            args,
-            ac);
-        XtManageChild(label_offset_lat);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(form_offset, (char *)"Longitude Offset (degrees):",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_END); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 10); ac++;
-        XtSetArg(args[ac], XmNwidth, 220); ac++;
-        XtSetArg(args[ac], XmNheight, 40); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(form_offset, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        label_offset_lon = XmCreateLabel(form_offset,
-            (char *)"label_offset_lon",
-            args,
-            ac);
-        XtManageChild(label_offset_lon);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNwidth, 343); ac++;
-    XtSetArg(args[ac], XmNheight, 580); ac++;
-    dialogShell_filelist = XmCreateDialogShell(mainWindow,
-        (char *)"dialogShell_filelist",
-        args,
-        ac);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(dialogShell_filelist, (char *)"Files Available for Editing",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNdialogTitle, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNautoUnmanage, False); ac++;
-        XtSetArg(args[ac], XmNresizePolicy, XmRESIZE_GROW); ac++;
-        XtSetArg(args[ac], XmNx, 1109); ac++;
-        XtSetArg(args[ac], XmNy, 1047); ac++;
-        XtSetArg(args[ac], XmNwidth, 343); ac++;
-        XtSetArg(args[ac], XmNheight, 580); ac++;
-        form_filelist = XtCreateWidget((char *)"form_filelist",
-            xmFormWidgetClass,
-            dialogShell_filelist,
-            args,
-            ac);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(form_filelist, (char *)":::t\"Remove\":t\"Selected\"\"File\"",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
-        XtSetArg(args[ac], XmNx, 110); ac++;
-        XtSetArg(args[ac], XmNy, 510); ac++;
-        XtSetArg(args[ac], XmNwidth, 104); ac++;
-        XtSetArg(args[ac], XmNheight, 60); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(form_filelist, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_filelist_remove = XmCreatePushButton(form_filelist,
-            (char *)"pushButton_filelist_remove",
-            args,
-            ac);
-        XtManageChild(pushButton_filelist_remove);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_filelist_remove, XmNactivateCallback, do_filelist_remove, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(form_filelist, (char *)":::t\"Edit\":t\"Selected\"\"File\"",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 510); ac++;
-        XtSetArg(args[ac], XmNwidth, 90); ac++;
-        XtSetArg(args[ac], XmNheight, 60); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(form_filelist, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_filelist_edit = XmCreatePushButton(form_filelist,
-            (char *)"pushButton_filelist_edit",
-            args,
-            ac);
-        XtManageChild(pushButton_filelist_edit);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_filelist_edit, XmNactivateCallback, do_editlistselection, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(form_filelist, (char *)"Output Mode:",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNmarginWidth, 0); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 10); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(form_filelist, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        setting_output_label_filelist = XmCreateLabel(form_filelist,
-            (char *)"setting_output_label_filelist",
-            args,
-            ac);
-        XtManageChild(setting_output_label_filelist);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNnumColumns, 1); ac++;
-    XtSetArg(args[ac], XmNpacking, XmPACK_COLUMN); ac++;
-    XtSetArg(args[ac], XmNradioBehavior, True); ac++;
-    XtSetArg(args[ac], XmNspacing, 0); ac++;
-    XtSetArg(args[ac], XmNorientation, XmHORIZONTAL); ac++;
-    XtSetArg(args[ac], XmNx, 110); ac++;
-    XtSetArg(args[ac], XmNy, 10); ac++;
-    XtSetArg(args[ac], XmNwidth, 238); ac++;
-    XtSetArg(args[ac], XmNheight, 34); ac++;
-    setting_output_filelist = XmCreateRowColumn(form_filelist,
-        (char *)"setting_output_filelist",
-        args,
-        ac);
-    XtManageChild(setting_output_filelist);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(setting_output_filelist, (char *)"Output Edits",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNwidth, 116); ac++;
-        XtSetArg(args[ac], XmNheight, 28); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(setting_output_filelist, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        toggleButton_output_on_filelist = XmCreateToggleButton(setting_output_filelist,
-            (char *)"toggleButton_output_on_filelist",
-            args,
-            ac);
-        XtManageChild(toggleButton_output_on_filelist);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(toggleButton_output_on_filelist, XmNvalueChangedCallback, do_toggle_output_on_filelist, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(setting_output_filelist, (char *)"Browse Only",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNwidth, 116); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(setting_output_filelist, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        toggleButton_output_off_filelist = XmCreateToggleButton(setting_output_filelist,
-            (char *)"toggleButton_output_off_filelist",
-            args,
-            ac);
-        XtManageChild(toggleButton_output_off_filelist);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(toggleButton_output_off_filelist, XmNvalueChangedCallback, do_toggle_output_off_filelist, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(form_filelist, (char *)"Dismiss",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
-        XtSetArg(args[ac], XmNx, 250); ac++;
-        XtSetArg(args[ac], XmNy, 510); ac++;
-        XtSetArg(args[ac], XmNwidth, 80); ac++;
-        XtSetArg(args[ac], XmNheight, 60); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(form_filelist, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_filelist_dismiss = XmCreatePushButton(form_filelist,
-            (char *)"pushButton_filelist_dismiss",
-            args,
-            ac);
-        XtManageChild(pushButton_filelist_dismiss);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(pushButton_filelist_dismiss, XmNactivateCallback, BxUnmanageCB, (XtPointer)"form_filelist");
-
-    ac = 0;
-    XtSetArg(args[ac], XmNscrollingPolicy, XmAPPLICATION_DEFINED); ac++;
-    XtSetArg(args[ac], XmNx, 0); ac++;
-    XtSetArg(args[ac], XmNy, 50); ac++;
-    XtSetArg(args[ac], XmNwidth, 339); ac++;
-    XtSetArg(args[ac], XmNheight, 450); ac++;
-    scrolledWindow_filelist = XmCreateScrolledWindow(form_filelist,
-        (char *)"scrolledWindow_filelist",
-        args,
-        ac);
-    XtManageChild(scrolledWindow_filelist);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(scrolledWindow_filelist, (char *)"-*-"MONO"-*-r-*-*-*-90-*-*-*-*-iso8859-1",
-        XmRFontList, 0, &argok)); if (argok) ac++;
-    XtSetArg(args[ac], XmNselectionPolicy, XmSINGLE_SELECT); ac++;
-    XtSetArg(args[ac], XmNwidth, 339); ac++;
-    XtSetArg(args[ac], XmNheight, 450); ac++;
-    list_filelist = XmCreateList(scrolledWindow_filelist,
-        (char *)"list_filelist",
-        args,
-        ac);
-    XtManageChild(list_filelist);
-    ac = 0;
-    XtSetArg(args[ac], XmNtopAttachment, XmATTACH_NONE); ac++;
-    XtSetArg(args[ac], XmNrightAttachment, XmATTACH_NONE); ac++;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_WIDGET); ac++;
-    XtSetArg(args[ac], XmNbottomAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNbottomOffset, 10); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 10); ac++;
-    XtSetArg(args[ac], XmNleftWidget, pushButton_filelist_edit); ac++;
-    XtSetValues(pushButton_filelist_remove, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNtopAttachment, XmATTACH_NONE); ac++;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNbottomAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNbottomOffset, 10); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 10); ac++;
-    XtSetValues(pushButton_filelist_edit, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNrightAttachment, XmATTACH_NONE); ac++;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 10); ac++;
-    XtSetArg(args[ac], XmNtopOffset, 10); ac++;
-    XtSetValues(setting_output_label_filelist, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNtopAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNrightAttachment, XmATTACH_NONE); ac++;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_WIDGET); ac++;
-    XtSetArg(args[ac], XmNbottomAttachment, XmATTACH_NONE); ac++;
-    XtSetArg(args[ac], XmNbottomOffset, 0); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 3); ac++;
-    XtSetArg(args[ac], XmNtopOffset, 10); ac++;
-    XtSetArg(args[ac], XmNleftWidget, setting_output_label_filelist); ac++;
-    XtSetValues(setting_output_filelist, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNtopAttachment, XmATTACH_NONE); ac++;
-    XtSetArg(args[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_NONE); ac++;
-    XtSetArg(args[ac], XmNbottomAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNbottomOffset, 10); ac++;
-    XtSetArg(args[ac], XmNrightOffset, 13); ac++;
-    XtSetValues(pushButton_filelist_dismiss, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNtopAttachment, XmATTACH_WIDGET); ac++;
-    XtSetArg(args[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNbottomAttachment, XmATTACH_WIDGET); ac++;
-    XtSetArg(args[ac], XmNbottomOffset, 10); ac++;
-    XtSetArg(args[ac], XmNbottomWidget, pushButton_filelist_remove); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 0); ac++;
-    XtSetArg(args[ac], XmNrightOffset, 4); ac++;
-    XtSetArg(args[ac], XmNtopOffset, 6); ac++;
-    XtSetArg(args[ac], XmNtopWidget, setting_output_filelist); ac++;
-    XtSetValues(scrolledWindow_filelist, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNtopAttachment, XmATTACH_NONE); ac++;
-    XtSetArg(args[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNbottomAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNbottomOffset, 14); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 210); ac++;
-    XtSetArg(args[ac], XmNrightOffset, 73); ac++;
-    XtSetValues(pushButton_offset_dismiss, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNtopAttachment, XmATTACH_NONE); ac++;
-    XtSetArg(args[ac], XmNrightAttachment, XmATTACH_WIDGET); ac++;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNbottomAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNbottomOffset, 14); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 50); ac++;
-    XtSetArg(args[ac], XmNrightOffset, 50); ac++;
-    XtSetArg(args[ac], XmNrightWidget, pushButton_offset_dismiss); ac++;
-    XtSetValues(pushButton_offset_apply, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNtopAttachment, XmATTACH_WIDGET); ac++;
-    XtSetArg(args[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNbottomAttachment, XmATTACH_NONE); ac++;
-    XtSetArg(args[ac], XmNbottomOffset, 0); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 240); ac++;
-    XtSetArg(args[ac], XmNrightOffset, 12); ac++;
-    XtSetArg(args[ac], XmNtopOffset, 10); ac++;
-    XtSetArg(args[ac], XmNtopWidget, textField_lon_offset); ac++;
-    XtSetValues(textField_lat_offset, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_WIDGET); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 10); ac++;
-    XtSetArg(args[ac], XmNrightOffset, 12); ac++;
-    XtSetArg(args[ac], XmNtopOffset, 10); ac++;
-    XtSetArg(args[ac], XmNleftWidget, label_offset_lon); ac++;
-    XtSetValues(textField_lon_offset, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNtopAttachment, XmATTACH_WIDGET); ac++;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNbottomAttachment, XmATTACH_NONE); ac++;
-    XtSetArg(args[ac], XmNbottomOffset, 0); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 0); ac++;
-    XtSetArg(args[ac], XmNtopOffset, 10); ac++;
-    XtSetArg(args[ac], XmNtopWidget, label_offset_lon); ac++;
-    XtSetValues(label_offset_lat, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 10); ac++;
-    XtSetArg(args[ac], XmNtopOffset, 10); ac++;
-    XtSetValues(label_offset_lon, args, ac);
-
-
-
-    /* Begin user code block <end_CreatemainWindow> */
-    /* End user code block <end_CreatemainWindow> */
-    return( mainWindow );
-}
diff --git a/src/mbnavedit/mbnavedit_creation.h b/src/mbnavedit/mbnavedit_creation.h
deleted file mode 100644
index 5cd8f61..0000000
--- a/src/mbnavedit/mbnavedit_creation.h
+++ /dev/null
@@ -1,119 +0,0 @@
-
-/* Begin user code block <abstract> */
-/* End user code block <abstract> */
-
-/**
- * WARNING: This file is overwritten at code generation time.
- * Any changes to this file will be lost.
- */
-/*
- *
- * Created by BuilderXcessory Version 6.1.3
- * Generated by Code Generator Xcessory 6.1.3 (08/19/04) CGX Scripts 6.1 Motif 2.1 
- *
- */
-#ifndef mbnavedit_creation_H
-#define mbnavedit_creation_H
-
-/*
- * Global widget declarations.
- *        - EXTERNAL is set to extern if the
- *          defs file is not included from the
- *          main file.
- */
-#ifdef DECLARE_BX_GLOBALS
-#define EXTERNAL
-#else
-#define EXTERNAL extern
-#endif
-
-/**
- * Start Global Widget Declarations.
- */
-EXTERNAL Widget   toggleButton_output_on_filelist;
-EXTERNAL Widget   toggleButton_output_off_filelist;
-EXTERNAL Widget   list_filelist;
-EXTERNAL Widget   pushButton_offset_dismiss;
-EXTERNAL Widget   pushButton_offset_apply;
-EXTERNAL Widget   textField_lat_offset;
-EXTERNAL Widget   textField_lon_offset;
-EXTERNAL Widget   bulletinBoard_deletebadtimetag;
-EXTERNAL Widget   bulletinBoard_timeinterpolation;
-EXTERNAL Widget   bulletinBoard_useprevious;
-EXTERNAL Widget   scale_meantimewindow;
-EXTERNAL Widget   textField_modeling_acceleration;
-EXTERNAL Widget   textField_modeling_speed;
-EXTERNAL Widget   scale_driftlat;
-EXTERNAL Widget   scale_driftlon;
-EXTERNAL Widget   toggleButton_modeling_off;
-EXTERNAL Widget   toggleButton_modeling_meanfilter;
-EXTERNAL Widget   toggleButton_modeling_dr;
-EXTERNAL Widget   toggleButton_modeling_inversion;
-EXTERNAL Widget   label_timestep_2;
-EXTERNAL Widget   scale_timestep;
-EXTERNAL Widget   label_timestep_1;
-EXTERNAL Widget   label_timespan_2;
-EXTERNAL Widget   scale_timespan;
-EXTERNAL Widget   label_timespan_1;
-EXTERNAL Widget   xmDialogShell_fileselection;
-EXTERNAL Widget   bulletinBoard_fileselection;
-EXTERNAL Widget   label_output_mode;
-EXTERNAL Widget   radioBox_output;
-EXTERNAL Widget   toggleButton_output_on;
-EXTERNAL Widget   toggleButton_output_off;
-EXTERNAL Widget   textField_format;
-EXTERNAL Widget   label_format;
-EXTERNAL Widget   fileSelectionBox;
-EXTERNAL Widget   bulletinBoard_error;
-EXTERNAL Widget   label_error_two;
-EXTERNAL Widget   label_error_one;
-EXTERNAL Widget   label_error_three;
-EXTERNAL Widget   bulletinBoard_message;
-EXTERNAL Widget   label_message;
-EXTERNAL Widget   label_about_version;
-EXTERNAL Widget   bulletinBoard;
-EXTERNAL Widget   pushButton_end;
-EXTERNAL Widget   pushButton_start;
-EXTERNAL Widget   pushButton_file;
-EXTERNAL Widget   pushButton_interpolaterepeats;
-EXTERNAL Widget   pushButton_unflag;
-EXTERNAL Widget   pushButton_flag;
-EXTERNAL Widget   pushButton_controls_timeinterpolation;
-EXTERNAL Widget   pushButton_controls_deletebadtimetag;
-EXTERNAL Widget   toggleButton_org_sonardepth;
-EXTERNAL Widget   toggleButton_sonardepth;
-EXTERNAL Widget   pushButton_solution;
-EXTERNAL Widget   toggleButton_dr_lat;
-EXTERNAL Widget   toggleButton_dr_lon;
-EXTERNAL Widget   toggleButton_org_time;
-EXTERNAL Widget   toggleButton_time;
-EXTERNAL Widget   pushButton_done;
-EXTERNAL Widget   pushButton_forward;
-EXTERNAL Widget   pushButton_reverse;
-EXTERNAL Widget   toggleButton_vru;
-EXTERNAL Widget   pushButton_revert;
-EXTERNAL Widget   pushButton_interpolate;
-EXTERNAL Widget   radioBox;
-EXTERNAL Widget   toggleButton_pick;
-EXTERNAL Widget   toggleButton_select;
-EXTERNAL Widget   toggleButton_deselect;
-EXTERNAL Widget   toggleButton_selectall;
-EXTERNAL Widget   toggleButton_deselectall;
-EXTERNAL Widget   pushButton_heading_cmg;
-EXTERNAL Widget   toggleButton_show_cmg;
-EXTERNAL Widget   toggleButton_org_heading;
-EXTERNAL Widget   pushButton_speed_smg;
-EXTERNAL Widget   toggleButton_show_smg;
-EXTERNAL Widget   toggleButton_org_speed;
-EXTERNAL Widget   toggleButton_org_lat;
-EXTERNAL Widget   toggleButton_org_lon;
-EXTERNAL Widget   toggleButton_speed;
-EXTERNAL Widget   toggleButton_heading;
-EXTERNAL Widget   toggleButton_lat;
-EXTERNAL Widget   toggleButton_lon;
-EXTERNAL Widget   scrolledWindow;
-EXTERNAL Widget   drawingArea;
-/**
- * End Global Widget Declarations.
- */
-#endif
diff --git a/src/mbnavedit/mbnavedit_extrawidgets.h b/src/mbnavedit/mbnavedit_extrawidgets.h
deleted file mode 100644
index 3c0935e..0000000
--- a/src/mbnavedit/mbnavedit_extrawidgets.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbnavedit_extrawidgets.h	8/7/95
- *    $Id: mbnavedit_extrawidgets.h 2247 2015-05-29 21:28:28Z caress $
- *
- *    Copyright (c) 1995-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * MBNAVEDIT is an interactive navigation editor for swath sonar data.
- * It can work with any data format supported by the MBIO library.
- * This include file contains global widget parameters shared with
- * the Motif interface code.
- *
- * Author:	D. W. Caress
- * Date:	June 24,  1995
- *
- *
- */
-
-/*--------------------------------------------------------------------*/
-
-#ifndef MB_YES
-#include "mb_status.h"
-#endif
-
-#ifdef MBNAVEDIT_DECLARE_GLOBALS
-#define MBNAVEDIT_EXTERNAL
-#else
-#define MBNAVEDIT_EXTERNAL extern
-#endif
-
-/* Global Widget Declarations Added By Hand */
-
-MBNAVEDIT_EXTERNAL Widget       fileSelectionBox_list;
-MBNAVEDIT_EXTERNAL Widget       fileSelectionBox_text;
-MBNAVEDIT_EXTERNAL Widget       scrolledWindow_hscrollbar;
-MBNAVEDIT_EXTERNAL Widget       scrolledWindow_vscrollbar;
-
-/*--------------------------------------------------------------------*/
diff --git a/src/mbnavedit/mbnavedit_prog.c b/src/mbnavedit/mbnavedit_prog.c
deleted file mode 100644
index 7f4c35e..0000000
--- a/src/mbnavedit/mbnavedit_prog.c
+++ /dev/null
@@ -1,6900 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbnavedit_prog.c	6/23/95
- *    $Id: mbnavedit_prog.c 2247 2015-05-29 21:28:28Z caress $
- *
- *    Copyright (c) 1995-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * MBNAVEDIT is an interactive navigation editor for swath sonar data.
- * It can work with any data format supported by the MBIO library.
- * This file contains the code that does not directly depend on the
- * MOTIF interface - the companion files mbnavedit.c and
- * mbnavedit_callbacks.c contain the user interface related code.
- *
- * Author:	D. W. Caress
- * Date:	June 23,  1995
- * Date:	August 28, 2000 (New version - no buffered i/o)
- *
- *
- */
-
-/*--------------------------------------------------------------------*/
-
-/* standard include files */
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <math.h>
-#include <string.h>
-#include <time.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <X11/Intrinsic.h>
-
-/* MBIO include files */
-#include "mb_format.h"
-#include "mb_status.h"
-#include "mb_define.h"
-#include "mb_io.h"
-#include "mb_process.h"
-#include "mb_aux.h"
-#include "mb_xgraphics.h"
-
-/* define global control parameters */
-#include "mbnavedit.h"
-
-/* ping structure definition */
-struct mbnavedit_ping_struct
-	{
-	int	id;
-	int	record;
-	int	time_i[7];
-	double	time_d;
-	double	file_time_d;
-	double	tint;
-	double	lon;
-	double	lat;
-	double	speed;
-	double	heading;
-	double	draft;
-	double	roll;
-	double	pitch;
-	double	heave;
-	double	time_d_org;
-	double	tint_org;
-	double	lon_org;
-	double	lat_org;
-	int	mean_ok;
-	double	lon_dr;
-	double	lat_dr;
-	double	speed_org;
-	double	heading_org;
-	double	draft_org;
-	double	speed_made_good;
-	double	course_made_good;
-	int	tint_x;
-	int	tint_y;
-	int	lon_x;
-	int	lon_y;
-	int	lat_x;
-	int	lat_y;
-	int	speed_x;
-	int	speed_y;
-	int	heading_x;
-	int	heading_y;
-	int	draft_x;
-	int	draft_y;
-	int	tint_select;
-	int	lon_select;
-	int	lat_select;
-	int	speed_select;
-	int	heading_select;
-	int	draft_select;
-	int	lonlat_flag;
-	};
-
-/* plot structure definition */
-struct mbnavedit_plot_struct
-	{
-	int	type;
-	int	ixmin;
-	int	ixmax;
-	int	iymin;
-	int	iymax;
-	double	xmin;
-	double	xmax;
-	double	ymin;
-	double	ymax;
-	double	xscale;
-	double	yscale;
-	double	xinterval;
-	double	yinterval;
-	char	xlabel[128];
-	char	ylabel1[128];
-	char	ylabel2[128];
-	};
-
-/* id variables */
-static char rcs_id[] = "$Id: mbnavedit_prog.c 2247 2015-05-29 21:28:28Z caress $";
-static char program_name[] = "MBNAVEDIT";
-static char help_message[] =  "MBNAVEDIT is an interactive navigation editor for swath sonar data.\n\tIt can work with any data format supported by the MBIO library.\n";
-static char usage_message[] = "mbnavedit [-Byr/mo/da/hr/mn/sc -D  -Eyr/mo/da/hr/mn/sc \n\t-Fformat -Ifile -Ooutfile -X -V -H]";
-
-/* status variables */
-static int	error = MB_ERROR_NO_ERROR;
-static int	verbose = 0;
-static char	*message = NULL;
-
-/* MBIO control parameters */
-static int	nav_source;
-static int	heading_source;
-static int	vru_source;
-static int	svp_source;
-static int	pings;
-static int	lonflip;
-static double	bounds[4];
-static int	btime_i[7];
-static int	etime_i[7];
-static double	btime_d;
-static double	etime_d;
-static double	speedmin;
-static double	timegap;
-static int	beams_bath;
-static int	beams_amp;
-static int	pixels_ss;
-static void	*imbio_ptr = NULL;
-static int	uselockfiles = MB_YES;
-
-/* mbio read and write values */
-static void	*store_ptr = NULL;
-static int	kind;
-static double	distance;
-static double	altitude;
-static double	sonardepth;
-static int	nbath;
-static int	namp;
-static int	nss;
-static char	*beamflag = NULL;
-static double	*bath = NULL;
-static double	*bathacrosstrack = NULL;
-static double	*bathalongtrack = NULL;
-static double	*amp = NULL;
-static double	*ss = NULL;
-static double	*ssacrosstrack = NULL;
-static double	*ssalongtrack = NULL;
-static char	comment[MB_COMMENT_MAXLINE];
-
-/* buffer control variables */
-#define	MBNAVEDIT_BUFFER_SIZE	1000000
-static int	file_open = MB_NO;
-static int	nfile_open = MB_NO;
-static FILE	*nfp;
-static int	hold_size = 100;
-static int	nload = 0;
-static int	ndump = 0;
-static int	nbuff = 0;
-static int	current_id = 0;
-static int	nload_total = 0;
-static int	ndump_total = 0;
-static int	first_read = MB_NO;
-
-/* plotting control variables */
-#define	NUMBER_PLOTS_MAX	9
-#define	DEFAULT_PLOT_WIDTH	767
-#define	DEFAULT_PLOT_HEIGHT	300
-#define	MBNAVEDIT_PICK_DISTANCE		50
-#define	MBNAVEDIT_ERASE_DISTANCE	10
-static struct mbnavedit_ping_struct	ping[MBNAVEDIT_BUFFER_SIZE];
-static double	plot_start_time;
-static double	plot_end_time;
-static int	nplot;
-static void	*mbnavedit_xgid;
-static struct mbnavedit_plot_struct mbnavplot[NUMBER_PLOTS_MAX];
-static int	data_save;
-static double	file_start_time_d;
-
-/* color control values */
-#define	WHITE		0
-#define	BLACK		1
-#define RED		2
-#define GREEN		3
-#define BLUE		4
-#define ORANGE		5
-#define PURPLE		6
-#define CORAL		7
-#define LIGHTGREY	8
-#define	XG_SOLIDLINE	0
-#define	XG_DASHLINE	1
-static int	ncolors;
-static int	pixel_values[256];
-
-/*--------------------------------------------------------------------*/
-int mbnavedit_init_globals()
-{
-	/* local variables */
-	char	*function_name = "mbnavedit_init_globals";
-	int	status = MB_SUCCESS;
-
-	/* set default global control parameters */
-	output_mode = OUTPUT_MODE_OUTPUT;
-	run_mbprocess = MB_NO;
-	gui_mode = MB_NO;
-	data_show_max = 2000;
-	data_show_size = 1000;
-	data_step_max = 2000;
-	data_step_size = 750;
-	mode_pick = PICK_MODE_PICK;
-	mode_set_interval = MB_NO;
-	plot_tint = MB_YES;
-	plot_tint_org = MB_YES;
-	plot_lon = MB_YES;
-	plot_lon_org = MB_YES;
-	plot_lon_dr = MB_NO;
-	plot_lat = MB_YES;
-	plot_lat_org = MB_YES;
-	plot_lat_dr = MB_NO;
-	plot_speed = MB_YES;
-	plot_speed_org = MB_YES;
-	plot_smg = MB_YES;
-	plot_heading = MB_YES;
-	plot_heading_org = MB_YES;
-	plot_cmg = MB_YES;
-	plot_draft = MB_YES;
-	plot_draft_org = MB_YES;
-	plot_draft_dr = MB_NO;
-	plot_roll = MB_NO;
-	plot_pitch = MB_NO;
-	plot_heave = MB_NO;
-	mean_time_window = 100;
-	drift_lon = 0;
-	drift_lat = 0;
-	strcpy(ifile,"\0");
-	plot_width = DEFAULT_PLOT_WIDTH;
-	plot_height = DEFAULT_PLOT_HEIGHT;
-	number_plots = 0;
-	if (plot_tint == MB_YES)    number_plots++;
-	if (plot_lon == MB_YES)	    number_plots++;
-	if (plot_lat == MB_YES)	    number_plots++;
-	if (plot_speed == MB_YES)   number_plots++;
-	if (plot_heading == MB_YES) number_plots++;
-	if (plot_draft == MB_YES) number_plots++;
-	timestamp_problem = MB_NO;
-	use_ping_data = MB_NO;
-	strip_comments = MB_NO;
-	model_mode = MODEL_MODE_OFF;
-	weight_speed = 100.0;
-	weight_acceleration = 100.0;
-	scrollcount = 0;
-	offset_lon = 0.0;
-	offset_lat = 0.0;
-	offset_lon_applied = 0.0;
-	offset_lat_applied = 0.0;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-
-
-/*--------------------------------------------------------------------*/
-int mbnavedit_init(int argc, char **argv, int *startup_file)
-{
-	/* local variables */
-	char	*function_name = "mbnavedit_init";
-	int	status = MB_SUCCESS;
-	int	fileflag = 0;
-	int	i;
-
-	/* parsing variables */
-	extern char *optarg;
-	int	errflg = 0;
-	int	c;
-	int	help = 0;
-	int	flag = 0;
-
-	/* set default values */
-	status = mb_defaults(verbose,&format,&pings,&lonflip,bounds,
-		btime_i,etime_i,&speedmin,&timegap);
-	status = mb_uselockfiles(verbose,&uselockfiles);
-	pings = 1;
-	lonflip = 0;
-	bounds[0] = -360.;
-	bounds[1] = 360.;
-	bounds[2] = -90.;
-	bounds[3] = 90.;
-	btime_i[0] = 1962;
-	btime_i[1] = 2;
-	btime_i[2] = 21;
-	btime_i[3] = 10;
-	btime_i[4] = 30;
-	btime_i[5] = 0;
-	btime_i[6] = 0;
-	etime_i[0] = 2062;
-	etime_i[1] = 2;
-	etime_i[2] = 21;
-	etime_i[3] = 10;
-	etime_i[4] = 30;
-	etime_i[5] = 0;
-	etime_i[6] = 0;
-	speedmin = 0.0;
-	timegap = 1000000000.0;
-	strcpy(ifile,"\0");
-
-	/* process argument list */
-	while ((c = getopt(argc, argv, "VvHhB:b:DdE:e:F:f:GgI:i:NnPpXx")) != -1)
-	  switch (c)
-		{
-		case 'H':
-		case 'h':
-			help++;
-			break;
-		case 'V':
-		case 'v':
-			verbose++;
-			break;
-		case 'B':
-		case 'b':
-			sscanf (optarg,"%d/%d/%d/%d/%d/%d",
-				&btime_i[0],&btime_i[1],&btime_i[2],
-				&btime_i[3],&btime_i[4],&btime_i[5]);
-			btime_i[6] = 0;
-			flag++;
-			break;
-		case 'D':
-		case 'd':
-			output_mode = OUTPUT_MODE_BROWSE;
-			flag++;
-			break;
-		case 'E':
-		case 'e':
-			sscanf (optarg,"%d/%d/%d/%d/%d/%d",
-				&etime_i[0],&etime_i[1],&etime_i[2],
-				&etime_i[3],&etime_i[4],&etime_i[5]);
-			etime_i[6] = 0;
-			flag++;
-			break;
-		case 'F':
-		case 'f':
-			sscanf (optarg,"%d", &format);
-			flag++;
-			break;
-		case 'G':
-		case 'g':
-			gui_mode = MB_YES;
-			flag++;
-			break;
-		case 'I':
-		case 'i':
-			sscanf (optarg,"%s", ifile);
-			do_parse_datalist(ifile, format);
-			flag++;
-			fileflag++;
-			break;
-		case 'N':
-		case 'n':
-			strip_comments = MB_YES;
-			flag++;
-			break;
-		case 'P':
-		case 'p':
-			use_ping_data = MB_YES;
-			flag++;
-			break;
-		case 'X':
-		case 'x':
-			run_mbprocess = MB_YES;
-			flag++;
-			break;
-		case '?':
-			errflg++;
-		}
-
-	/* if error flagged then print it and exit */
-	if (errflg)
-		{
-		fprintf(stderr,"usage: %s\n", usage_message);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		error = MB_ERROR_BAD_USAGE;
-		exit(error);
-		}
-
-	/* print starting message */
-	if (verbose == 1 || help)
-		{
-		fprintf(stderr,"\nProgram %s\n",program_name);
-		fprintf(stderr,"Version %s\n",rcs_id);
-		fprintf(stderr,"MB-system Version %s\n",MB_VERSION);
-		}
-
-	/* print starting debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  Program <%s>\n",program_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Control Parameters:\n");
-		fprintf(stderr,"dbg2       verbose:         %d\n",verbose);
-		fprintf(stderr,"dbg2       help:            %d\n",help);
-		fprintf(stderr,"dbg2       format:          %d\n",format);
-		fprintf(stderr,"dbg2       input file:      %s\n",ifile);
-		}
-
-	/* if help desired then print it and exit */
-	if (help)
-		{
-		fprintf(stderr,"\n%s\n",help_message);
-		fprintf(stderr,"\nusage: %s\n", usage_message);
-		exit(error);
-		}
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       argc:      %d\n",argc);
-		for (i=0;i<argc;i++)
-			fprintf(stderr,"dbg2       argv[%d]:    %s\n",
-				i,argv[i]);
-		}
-
-	/* if file specified then use it */
-	if (fileflag > 0)
-		*startup_file = MB_YES;
-	else
-		*startup_file = MB_NO;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbnavedit_set_graphics(void *xgid, int ncol, unsigned int *pixels)
-{
-	/* local variables */
-	char	*function_name = "mbnavedit_set_graphics";
-	int	status = MB_SUCCESS;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       xgid:         %p\n",xgid);
-		fprintf(stderr,"dbg2       ncolors:      %d\n",ncol);
-		for (i=0;i<ncol;i++)
-			fprintf(stderr,"dbg2       pixel[%d]:     %d\n",
-				i, pixels[i]);
-		}
-
-	/* set graphics id */
-	mbnavedit_xgid = xgid;
-
-	/* set colors */
-	ncolors = ncol;
-	for (i=0;i<ncolors;i++)
-		pixel_values[i] = pixels[i];
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbnavedit_action_open(int useprevious)
-{
-	/* local variables */
-	char	*function_name = "mbnavedit_action_open";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
-
-	/* clear the screen */
-	status = mbnavedit_clear_screen();
-
-	/* open the file */
-	status = mbnavedit_open_file(useprevious);
-
-	/* load the buffer */
-	if (status == MB_SUCCESS)
-		status = mbnavedit_load_data();
-
-	/* set up plotting */
-	if (nbuff > 0)
-		{
-		/* set time span to zero so plotting resets it */
-		data_show_size = 0;
-
-		/* turn file button off */
-		do_filebutton_off();
-
-		/* now plot it */
-		status = mbnavedit_plot_all();
-		}
-
-	/* if no data read show error dialog */
-	else
-		do_error_dialog("No data were read from the input",
-				"file. You may have specified an",
-				"incorrect MB-System format id!");
-
-	/* reset data_save */
-	data_save = MB_NO;
-
-	/* print debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  File open attempted in MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Buffer values:\n");
-		fprintf(stderr,"dbg2       nload:       %d\n",ndump);
-		fprintf(stderr,"dbg2       nload:       %d\n",nload);
-		fprintf(stderr,"dbg2       nbuff:       %d\n",nbuff);
-		fprintf(stderr,"dbg2       current_id:  %d\n",current_id);
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbnavedit_open_file(int useprevious)
-{
-	/* local variables */
-	char	*function_name = "mbnavedit_open_file";
-	int	status = MB_SUCCESS;
-	char	ifile_use[MB_PATH_MAXLINE];
-	char	command[MB_PATH_MAXLINE];
-	int	format_use;
-	int	form;
-	int	format_error;
-	struct stat file_status;
-	int	fstat;
-	mb_path	error1;
-	mb_path	error2;
-	mb_path	error3;
-
-	/* swath file locking variables */
-	int	lock_status;
-	int	locked;
-	int	lock_purpose;
-	mb_path	lock_program;
-	mb_path lock_cpu;
-	mb_path lock_user;
-	char	lock_date[25];
-        int     shellstatus;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       file:        %s\n",ifile);
-		fprintf(stderr,"dbg2       format:      %d\n",format);
-		fprintf(stderr,"dbg2       useprevious: %d\n",useprevious);
-		}
-
-	/* reset message */
-	do_message_on("MBedit is opening a data file...");
-
-	/* get format if required */
-	if (format == 0)
-	    {
-	    if (mb_get_format(verbose, ifile, NULL,
-				    &form, &format_error)
-			== MB_SUCCESS)
-		    {
-		    format = form;
-		    }
-	    }
-
-	/* get the output filename */
-	strcpy(nfile,ifile);
-	strcat(nfile,".nve");
-
-	/* try to lock file */
-	if (output_mode == OUTPUT_MODE_OUTPUT && uselockfiles == MB_YES)
-		{
-		status = mb_pr_lockswathfile(verbose, ifile,
-				MBP_LOCK_EDITNAV, program_name, &error);
-		}
-	else
-		{
-		lock_status = mb_pr_lockinfo(verbose, ifile, &locked,
-				&lock_purpose, lock_program, lock_user, lock_cpu,
-				lock_date, &error);
-
-		/* if locked get lock info */
-		if (error == MB_ERROR_FILE_LOCKED)
-			{
-			fprintf(stderr, "\nFile %s locked but lock ignored\n", ifile);
-			fprintf(stderr, "File locked by <%s> running <%s>\n", lock_user, lock_program);
-			fprintf(stderr, "on cpu <%s> at <%s>\n", lock_cpu, lock_date);
-			error = MB_ERROR_NO_ERROR;
-			}
-		}
-
-	/* if locked let the user know file can't be opened */
-	if (status == MB_FAILURE)
-		{
-		/* turn off message */
-		do_message_off();
-
-		/* if locked get lock info */
-		if (error == MB_ERROR_FILE_LOCKED)
-			{
-			lock_status = mb_pr_lockinfo(verbose, ifile, &locked,
-					&lock_purpose, lock_program, lock_user, lock_cpu,
-					lock_date, &error);
-
-			sprintf(error1, "Unable to open input file:");
-			sprintf(error2, "File locked by <%s> running <%s>", lock_user, lock_program);
-			sprintf(error3, "on cpu <%s> at <%s>", lock_cpu, lock_date);
-			fprintf(stderr, "\nUnable to open input file:\n");
-			fprintf(stderr, "  %s\n", ifile);
-			fprintf(stderr, "File locked by <%s> running <%s>\n", lock_user, lock_program);
-			fprintf(stderr, "on cpu <%s> at <%s>\n", lock_cpu, lock_date);
-			}
-
-		/* else if unable to create lock file there is a permissions problem */
-		else if (error == MB_ERROR_OPEN_FAIL)
-			{
-			sprintf(error1, "Unable to create lock file");
-			sprintf(error2, "for intended input file:");
-			sprintf(error3, "-Likely permissions issue");
-			fprintf(stderr, "Unable to create lock file\n");
-			fprintf(stderr, "for intended input file:\n");
-			fprintf(stderr, "  %s\n", ifile);
-			fprintf(stderr, "-Likely permissions issue\n");
-			}
-
-		/* put up error dialog */
-		do_error_dialog(error1,error2, error3);
-		}
-
-	/* if successfully locked (or lock ignored) proceed */
-	if (status == MB_SUCCESS)
-		{
-		/* if output on and using previously edited nav first copy old nav
-		    and then read it as input instead of specified
-		    input file */
-		if (useprevious == MB_YES
-		    && output_mode != OUTPUT_MODE_BROWSE)
-		    {
-		    /* get temporary file name */
-		    sprintf(ifile_use, "%s.tmp", nfile);
-
-		    /* copy old edit save file to tmp file */
-		    sprintf(command, "cp %s %s\n",
-			nfile, ifile_use);
-		    format_use = MBF_MBPRONAV;
-		    shellstatus = system(command);
-		    fstat = stat(ifile_use, &file_status);
-		    if (fstat != 0
-			|| (file_status.st_mode & S_IFMT) == S_IFDIR)
-			{
-			do_error_dialog("Unable to copy previously edited",
-					"navigation. You may not have read",
-					"permission in this directory!");
-			status = MB_FAILURE;
-			return(status);
-			}
-		    }
-
-		/* if output off and using previously edited nav
-		    reset input names */
-		else if (useprevious == MB_YES)
-		    {
-		    sprintf(ifile_use, "%s", nfile);
-		    format_use = MBF_MBPRONAV;
-		    }
-
-		/* else just read from previously edited nav */
-		else
-		    {
-		    strcpy(ifile_use, ifile);
-		    format_use = format;
-		    }
-
-		/* initialize reading the input multibeam file */
-		status = mb_format_source(verbose, &format_use,
-				&nav_source, &heading_source,
-				&vru_source, &svp_source,
-				&error);
-		if ((status = mb_read_init(
-			verbose,ifile_use,format_use,pings,lonflip,bounds,
-			btime_i,etime_i,speedmin,timegap,
-			&imbio_ptr,&btime_d,&etime_d,
-			&beams_bath,&beams_amp,&pixels_ss,&error)) != MB_SUCCESS)
-			{
-			mb_error(verbose,error,&message);
-			fprintf(stderr,"\nMBIO Error returned from function <mb_read_init>:\n%s\n",message);
-			fprintf(stderr,"\nMultibeam File <%s> not initialized for reading\n",ifile);
-			status = MB_FAILURE;
-			do_error_dialog("Unable to open input file.",
-					"You may not have read",
-					"permission in this directory!");
-			return(status);
-			}
-
-		/* allocate memory for data arrays */
-		beamflag = NULL;
-		bath = NULL;
-		amp = NULL;
-		bathacrosstrack = NULL;
-		bathalongtrack = NULL;
-		ss = NULL;
-		ssacrosstrack = NULL;
-		ssalongtrack = NULL;
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							sizeof(char), (void **)&beamflag, &error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							sizeof(double), (void **)&bath, &error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_AMPLITUDE,
-							sizeof(double), (void **)&amp, &error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							sizeof(double), (void **)&bathacrosstrack, &error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							sizeof(double), (void **)&bathalongtrack, &error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_SIDESCAN,
-							sizeof(double), (void **)&ss, &error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_SIDESCAN,
-							sizeof(double), (void **)&ssacrosstrack, &error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_SIDESCAN,
-							sizeof(double), (void **)&ssalongtrack, &error);
-
-		/* if error initializing memory then quit */
-		if (error != MB_ERROR_NO_ERROR)
-			{
-			mb_error(verbose,error,&message);
-			fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",message);
-			fprintf(stderr,"\nProgram <%s> Terminated\n",
-				program_name);
-			exit(error);
-			}
-
-		/* initialize the buffer */
-		nbuff = 0;
-		first_read = MB_NO;
-
-		/* reset plotting time span */
-		plot_start_time = 0.0;
-		plot_end_time = data_show_size;
-
-		/* now deal with new nav save file */
-		nfile_open = MB_NO;
-		if (status == MB_SUCCESS
-			&& output_mode != OUTPUT_MODE_BROWSE)
-			{
-			/* get nav edit save file */
-			sprintf(nfile, "%s.nve", ifile);
-
-			/* open the nav edit save file */
-			if ((nfp = fopen(nfile,"w")) != NULL)
-			    {
-			    nfile_open = MB_YES;
-			    }
-			else
-			    {
-			    nfile_open = MB_NO;
-			    fprintf(stderr, "\nUnable to open new nav save file %s\n",
-				nfile);
-			    do_error_dialog("Unable to open new nav edit save file.",
-					    "You may not have write",
-					    "permission in this directory!");
-			    }
-			}
-
-		/* if we got here we must have succeeded */
-		if (verbose >= 1)
-			{
-			if (useprevious == MB_YES)
-			    {
-			    fprintf(stderr,"\nSwath data file <%s> specified for input\n",ifile);
-			    fprintf(stderr,"MB-System Data Format ID: %d\n",format);
-			    fprintf(stderr,"Navigation data file <%s> initialized for reading\n",ifile_use);
-			    fprintf(stderr,"MB-System Data Format ID: %d\n",format_use);
-			    }
-			else
-			    {
-			    fprintf(stderr,"\nSwath data file <%s> initialized for reading\n",ifile_use);
-			    fprintf(stderr,"MB-System Data Format ID: %d\n",format_use);
-			    }
-			if (output_mode == OUTPUT_MODE_OUTPUT)
-			    fprintf(stderr,"Navigation File <%s> initialized for writing\n",nfile);
-			}
-		file_open = MB_YES;
-		}
-
-	/* turn off message */
-	do_message_off();
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbnavedit_close_file()
-{
-	/* local variables */
-	char	*function_name = "mbnavedit_close_file";
-	int	status = MB_SUCCESS;
-	char	command[MB_PATH_MAXLINE];
-        int     shellstatus;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
-
-	/* reset message */
-	do_message_on("MBedit is closing a data file...");
-
-	/* close the files */
-	status = mb_close(verbose,&imbio_ptr,&error);
-	if (nfile_open == MB_YES)
-	    {
-	    /* close navigation file */
-	    fclose(nfp);
-	    nfile_open = MB_NO;
-	    }
-            
-        /* if not in browse mode, deal with locking and processing */
-        if (output_mode == OUTPUT_MODE_OUTPUT)
-            {
-
-            /* unlock the raw swath file */
-            if (uselockfiles == MB_YES)
-                    status = mb_pr_unlockswathfile(verbose, ifile,
-                                                    MBP_LOCK_EDITNAV, program_name, &error);
-    
-            /* update mbprocess parameter file */
-            status = mb_pr_update_format(verbose, ifile,
-                        MB_YES, format,
-                        &error);
-            status = mb_pr_update_nav(verbose, ifile,
-                        MBP_NAV_ON, nfile, 9,
-                        MBP_NAV_ON, MBP_NAV_ON, MBP_NAV_ON, MBP_NAV_ON,
-                        MBP_NAV_LINEAR,
-                        (double) 0.0,
-                        &error);
-    
-            /* run mbprocess if desired */
-            if (run_mbprocess == MB_YES)
-                   {
-                   /* turn message on */
-                   do_message_on("Navigation edits being applied using mbprocess...");
-
-                   /* run mbprocess */
-                   if (strip_comments == MB_YES)
-                       sprintf(command, "mbprocess -I %s -N\n",ifile);
-                   else
-                       sprintf(command, "mbprocess -I %s\n",ifile);
-                   if (verbose >= 1)
-                       fprintf(stderr,"\nExecuting command:\n%s\n",command);
-                   shellstatus = system(command);
-
-                   /* turn message off */
-                   do_message_off();
-                   }
-            }
-
-	/* check memory */
-	if (verbose >= 4)
-		status = mb_memory_list(verbose,&error);
-
-	/* if we got here we must have succeeded */
-	if (verbose >= 1)
-		{
-		fprintf(stderr,"\nMultibeam Input File <%s> closed\n",ifile);
-		if (output_mode == OUTPUT_MODE_OUTPUT)
-			fprintf(stderr,"Navigation Output File <%s> closed\n",nfile);
-		fprintf(stderr,"%d data records loaded\n",nload_total);
-		fprintf(stderr,"%d data records dumped\n",ndump_total);
-
-		}
-	file_open = MB_NO;
-	nload_total = 0;
-	ndump_total = 0;
-
-	/* reset offsets */
-	offset_lon = 0.0;
-	offset_lat = 0.0;
-	offset_lon_applied = offset_lon;
-	offset_lat_applied = offset_lat;
-
-	/* turn file button on */
-	do_filebutton_on();
-
-	/* turn off message */
-	do_message_off();
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbnavedit_dump_data(int hold)
-{
-	/* local variables */
-	char	*function_name = "mbnavedit_dump_data";
-	int	status = MB_SUCCESS;
-	int	iping;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       hold:       %d\n",hold);
-		}
-
-	/* write out edited data */
-
-	if (nfile_open == MB_YES)
-		{
-		for (iping=0;iping<nbuff-hold;iping++)
-			{
-			/* write the nav out */
-		    	fprintf(nfp, "%4.4d %2.2d %2.2d %2.2d %2.2d %2.2d.%6.6d %16.6f %.10f %.10f %.3f %.3f %.4f %.3f %.3f %.4f\r\n",
-				ping[iping].time_i[0],
-				ping[iping].time_i[1],
-				ping[iping].time_i[2],
-				ping[iping].time_i[3],
-				ping[iping].time_i[4],
-				ping[iping].time_i[5],
-				ping[iping].time_i[6],
-				ping[iping].time_d,
-				ping[iping].lon,
-				ping[iping].lat,
-				ping[iping].heading,
-				ping[iping].speed,
-				ping[iping].draft,
-				ping[iping].roll,
-				ping[iping].pitch,
-				ping[iping].heave);
-			}
-		}
-
-	/* dump or clear data from the buffer */
-	ndump = 0;
-	if (nbuff > 0)
-		{
-		/* turn message on */
-		do_message_on("MBnavedit is clearing data...");
-
-		/* copy data to be held */
-		for (iping=0;iping<hold;iping++)
-			{
-			ping[iping] = ping[iping+nbuff-hold];
-			}
-		ndump = nbuff - hold;
-		nbuff = hold;
-
-		/* turn message off */
-		do_message_off();
-		}
-	ndump_total += ndump;
-
-	/* reset current data pointer */
-	if (ndump > 0)
-		current_id = current_id - ndump;
-	if (current_id < 0)
-		current_id = 0;
-	if (current_id > nbuff - 1)
-		current_id = nbuff - 1;
-
-	/* print out information */
-	if (verbose >= 1)
-		{
-		if (output_mode == OUTPUT_MODE_OUTPUT)
-			fprintf(stderr,"\n%d data records dumped to output file <%s>\n",
-				ndump,nfile);
-		else
-			fprintf(stderr,"\n%d data records dumped from buffer\n",
-				ndump);
-		fprintf(stderr,"%d data records remain in buffer\n",nbuff);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return */
-	return (status);
-}
-/*--------------------------------------------------------------------*/
-int mbnavedit_load_data()
-{
-	/* local variables */
-	char	*function_name = "mbnavedit_load_data";
-	int	status = MB_SUCCESS;
-	int	i;
-	char	string[MB_PATH_MAXLINE];
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
-
-	/* turn message on */
-	nload = 0;
-	timestamp_problem = MB_NO;
-	sprintf(string, "MBnavedit: %d records loaded so far...", nload);
-	do_message_on(string);
-
-	/* load data */
-	if (status == MB_SUCCESS)
-	do
-		{
-		status = mb_get_all(verbose,imbio_ptr,&store_ptr,&kind,
-				ping[nbuff].time_i,
-				&ping[nbuff].time_d,
-				&ping[nbuff].lon,
-				&ping[nbuff].lat,
-				&ping[nbuff].speed,
-				&ping[nbuff].heading,
-				&distance,&altitude,&sonardepth,
-				&nbath,&namp,&nss,
-				beamflag,bath,amp,
-				bathacrosstrack,bathalongtrack,
-				ss,ssacrosstrack,ssalongtrack,
-				comment,&error);
-		if (error <= MB_ERROR_NO_ERROR
-		    && (kind == nav_source
-			|| (kind == MB_DATA_DATA
-			    && use_ping_data == MB_YES))
-		    && (error == MB_ERROR_NO_ERROR
-			    || error == MB_ERROR_TIME_GAP
-			    || error == MB_ERROR_OUT_BOUNDS
-			    || error == MB_ERROR_OUT_TIME
-			    || error == MB_ERROR_SPEED_TOO_SMALL))
-			{
-			status = MB_SUCCESS;
-			error = MB_ERROR_NO_ERROR;
-			}
-		else if (error <= MB_ERROR_NO_ERROR)
-			{
-			status = MB_FAILURE;
-			error = MB_ERROR_OTHER;
-			}
-		if (error == MB_ERROR_NO_ERROR
-		    && (kind == nav_source
-			|| (kind == MB_DATA_DATA
-			    && use_ping_data == MB_YES)))
-			{
-			status = mb_extract_nav(verbose,imbio_ptr,
-				store_ptr,&kind,
-				ping[nbuff].time_i,
-				&ping[nbuff].time_d,
-				&ping[nbuff].lon,
-				&ping[nbuff].lat,
-				&ping[nbuff].speed,
-				&ping[nbuff].heading,
-				&ping[nbuff].draft,
-				&ping[nbuff].roll,
-				&ping[nbuff].pitch,
-				&ping[nbuff].heave,
-				&error);
-			}
-		if (status == MB_SUCCESS)
-			{
-			/* get first time value if first record */
-			if (first_read == MB_NO)
-				{
-				file_start_time_d = ping[nbuff].time_d;
-				first_read = MB_YES;
-				}
-
-			/* get original values */
-			ping[nbuff].id = nload;
-			ping[nbuff].record = ping[nbuff].id + ndump_total;
-			ping[nbuff].lon_org = ping[nbuff].lon;
-			ping[nbuff].lat_org = ping[nbuff].lat;
-			ping[nbuff].speed_org = ping[nbuff].speed;
-			ping[nbuff].heading_org = ping[nbuff].heading;
-			ping[nbuff].draft_org = ping[nbuff].draft;
-			ping[nbuff].file_time_d =
-				ping[nbuff].time_d - file_start_time_d;
-
-			/* apply offsets */
-			ping[nbuff].lon += offset_lon;
-			ping[nbuff].lat += offset_lat;
-
-			/* set starting dr */
-			ping[nbuff].mean_ok = MB_NO;
-			ping[nbuff].lon_dr = ping[nbuff].lon;
-			ping[nbuff].lat_dr = ping[nbuff].lat;
-
-			/* set everything deselected */
-			ping[nbuff].tint_select = MB_NO;
-			ping[nbuff].lon_select = MB_NO;
-			ping[nbuff].lat_select = MB_NO;
-			ping[nbuff].speed_select = MB_NO;
-			ping[nbuff].heading_select = MB_NO;
-			ping[nbuff].draft_select = MB_NO;
-			ping[nbuff].lonlat_flag = MB_NO;
-
-			/* select repeated data */
-			if (nbuff > 0 && ping[nbuff].lon == ping[nbuff-1].lon
-				&& ping[nbuff].lat == ping[nbuff-1].lat)
-				{
-				ping[nbuff].lonlat_flag = MB_YES;
-				}
-
-			/* print output debug statements */
-			if (verbose >= 5)
-				{
-				fprintf(stderr,"\ndbg5  Next good data found in function <%s>:\n",
-					function_name);
-				fprintf(stderr,"dbg5       %4d %4d %4d  %d/%d/%d %2.2d:%2.2d:%2.2d.%6.6d  %15.10f %15.10f %6.3f %7.3f %8.4f %6.3f %6.3f %8.4f\n",
-					nbuff,ping[nbuff].id,ping[nbuff].record,
-					ping[nbuff].time_i[1],ping[nbuff].time_i[2],
-					ping[nbuff].time_i[0],ping[nbuff].time_i[3],
-					ping[nbuff].time_i[4],ping[nbuff].time_i[5],
-					ping[nbuff].time_i[6],
-					ping[nbuff].lon, ping[nbuff].lat,
-					ping[nbuff].speed, ping[nbuff].heading,
-					ping[nbuff].draft,
-					ping[nbuff].roll, ping[nbuff].pitch,
-					ping[nbuff].heave);
-				}
-
-			/* increment counting variables */
-			nbuff++;
-			nload++;
-
-			/* update message every 250 records */
-			if (nload % 250 == 0)
-			    {
-			    sprintf(string, "MBnavedit: %d records loaded so far...", nload);
-			    do_message_on(string);
-			    }
-			}
-		}
-	while (error <= MB_ERROR_NO_ERROR && nbuff < MBNAVEDIT_BUFFER_SIZE);
-	nload_total += nload;
-
-	/* define success */
-	if (nbuff > 0)
-		{
-		status = MB_SUCCESS;
-		error = MB_ERROR_NO_ERROR;
-		}
-
-	/* check for time stamp repeats */
-	timestamp_problem = MB_NO;
-	for (i=0;i<nbuff-1;i++)
-		{
-		if (ping[i+1].time_d <= ping[i].time_d)
-		    {
-		    timestamp_problem = MB_YES;
-		    }
-		}
-
-	/* calculate expected time */
-	if (nbuff > 1)
-	    {
-	    for (i=1;i<nbuff;i++)
-		{
-		ping[i].tint = ping[i].time_d - ping[i-1].time_d;
-		ping[i].tint_org = ping[i].tint;
-		ping[i].time_d_org = ping[i].time_d;
-		}
-	    ping[0].tint = ping[1].tint;
-	    ping[0].tint_org = ping[1].tint_org;
-	    ping[0].time_d_org = ping[0].time_d;
-	    }
-	else if (nbuff == 0)
-	    {
-	    ping[0].tint = 0.0;
-	    ping[0].tint_org = 0.0;
-	    ping[0].time_d_org = ping[0].time_d;
-	    }
-
-	/* find index of current ping */
-	current_id = 0;
-
-	/* reset plotting time span */
-	if (nbuff > 0)
-		{
-		data_show_size = 0;
-		plot_start_time = ping[0].file_time_d;
-		plot_end_time = ping[nbuff-1].file_time_d;
-		nplot = nbuff;
-		}
-
-	/* calculate speed-made-good and course-made-good */
-	for (i=0;i<nbuff;i++)
-		mbnavedit_get_smgcmg(i);
-
-	/* calculate model */
-	mbnavedit_get_model();
-
-	/* turn message off */
-	do_message_off();
-
-	/* print out information */
-	if (verbose >= 1)
-		{
-		fprintf(stderr,"\n%d data records loaded from input file <%s>\n",
-			nload,ifile);
-		fprintf(stderr,"%d data records now in buffer\n",nbuff);
-		fprintf(stderr,"Current data record:        %d\n",
-			current_id);
-		fprintf(stderr,"Current global data record: %d\n",
-			current_id + ndump_total);
-		}
-
-	/* put up warning if timestamp problem detected */
-	if (timestamp_problem == MB_YES)
-		{
-		do_error_dialog("Duplicate or reverse order time",
-				"stamps detected!! Time interpolation",
-				"available under Controls menu.");
-		}
-
-	/* update controls */
-	do_set_controls();
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return */
-	return (status);
-}
-/*--------------------------------------------------------------------*/
-int mbnavedit_clear_screen()
-{
-	/* local variables */
-	char	*function_name = "mbnavedit_clear_screen";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
-
-	/* clear screen */
-	xg_fillrectangle(mbnavedit_xgid,0,0,
-		plot_width,NUMBER_PLOTS_MAX*plot_height,
-		pixel_values[WHITE],XG_SOLIDLINE);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return */
-	return (status);
-}
-/*--------------------------------------------------------------------*/
-int mbnavedit_action_next_buffer(int *quit)
-{
-	/* local variables */
-	char	*function_name = "mbnavedit_action_next_buffer";
-	int	status = MB_SUCCESS;
-	int	save_dumped = 0;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
-
-	/* clear the screen */
-	status = mbnavedit_clear_screen();
-
-	/* set quit off */
-	*quit = MB_NO;
-
-	/* check if a file has been opened */
-	if (file_open == MB_YES)
-		{
-
-		/* dump the buffer */
-		status = mbnavedit_dump_data(hold_size);
-
-		/* load the buffer */
-		status = mbnavedit_load_data();
-
-		/* if end of file reached then
-			dump last buffer and close file */
-		if (nload <= 0)
-			{
-			save_dumped = ndump;
-			status = mbnavedit_dump_data(0);
-			status = mbnavedit_close_file();
-			ndump = ndump + save_dumped;
-
-			/* if in normal mode last next_buffer
-				does not mean quit,
-				if in gui mode it does mean quit */
-			if (gui_mode == MB_YES)
-				*quit = MB_YES;
-			else
-				*quit = MB_NO;
-
-			/* if quitting let the world know... */
-			if (*quit == MB_YES && verbose >= 1)
-				fprintf(stderr,"\nQuitting MBnavedit\nBye Bye...\n");
-			}
-
-		/* else plot it */
-		else
-			{
-			status = mbnavedit_plot_all();
-			}
-		}
-
-	/* if no file open set failure status */
-	else
-		{
-		status = MB_FAILURE;
-		ndump = 0;
-		nload = 0;
-		current_id = 0;
-		}
-
-	/* reset data_save */
-	data_save = MB_NO;
-
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       quit:        %d\n",*quit);
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbnavedit_action_offset()
-{
-	/* local variables */
-	char	*function_name = "mbnavedit_action_offset";
-	int	status = MB_SUCCESS;
-	int 	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
-
-	/* check if a file has been opened */
-	if (file_open == MB_YES)
-		{
-		/* apply position offsets to the data */
-		for (i=0;i<nbuff;i++)
-			{
-			ping[i].lon += offset_lon - offset_lon_applied;
-			ping[i].lat += offset_lat - offset_lat_applied;
-			}
-		}
-	offset_lon_applied = offset_lon;
-	offset_lat_applied = offset_lat;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbnavedit_action_close()
-{
-	/* local variables */
-	char	*function_name = "mbnavedit_action_close";
-	int	status = MB_SUCCESS;
-	int	save_nloaded = 0;
-	int	save_ndumped = 0;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
-
-	/* clear the screen */
-	status = mbnavedit_clear_screen();
-
-	/* if file has been opened and browse mode
-		just dump the current buffer and close the file */
-	if (file_open == MB_YES
-		&& output_mode == OUTPUT_MODE_BROWSE)
-		{
-		/* dump the buffer */
-		status = mbnavedit_dump_data(0);
-
-		/* now close the file */
-		status = mbnavedit_close_file();
-		}
-	/* if file has been opened deal with it */
-	else if (file_open == MB_YES)
-		{
-
-		/* dump and load until the end of the file is reached */
-		save_ndumped = 0;
-		save_nloaded = 0;
-		do
-			{
-			/* dump the buffer */
-			status = mbnavedit_dump_data(0);
-			save_ndumped += ndump;
-
-			/* load the buffer */
-			status = mbnavedit_load_data();
-			save_nloaded += nload;
-			}
-		while (nload > 0);
-		ndump = save_ndumped;
-		nload = save_nloaded;
-
-		/* now close the file */
-		status = mbnavedit_close_file();
-		}
-
-	else
-		{
-		ndump = 0;
-		nload = 0;
-		nbuff = 0;
-		current_id = 0;
-		status = MB_FAILURE;
-		}
-
-	/* reset data_save */
-	data_save = MB_NO;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbnavedit_action_done(int *quit)
-{
-	/* local variables */
-	char	*function_name = "mbnavedit_action_done";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
-
-	/* if in normal mode done does not mean quit,
-		if in gui mode done does mean quit */
-	if (gui_mode == MB_YES)
-		*quit = MB_YES;
-	else
-		*quit = MB_NO;
-
-	/* if quitting let the world know... */
-	if (*quit == MB_YES && verbose >= 1)
-		fprintf(stderr,"\nShutting MBnavedit down without further ado...\n");
-
-	/* call routine to deal with saving the current file, if any */
-	if (file_open == MB_YES)
-		status = mbnavedit_action_close();
-
-	/* if quitting let the world know... */
-	if (*quit == MB_YES && verbose >= 1)
-		fprintf(stderr,"\nQuitting MBnavedit\nBye Bye...\n");
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       quit:        %d\n",*quit);
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbnavedit_action_quit()
-{
-	/* local variables */
-	char	*function_name = "mbnavedit_action_quit";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
-
-	/* let the world know... */
-	if (verbose >= 1)
-		fprintf(stderr,"\nShutting MBnavedit down without further ado...\n");
-
-	/* call routine to deal with saving the current file, if any */
-	if (file_open == MB_YES)
-		status = mbnavedit_action_close();
-
-	/* let the world know... */
-	if (verbose >= 1)
-		fprintf(stderr,"\nQuitting MBnavedit\nBye Bye...\n");
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbnavedit_action_step(int step)
-{
-	/* local variables */
-	char	*function_name = "mbnavedit_action_step";
-	int	status = MB_SUCCESS;
-	int	old_id, new_id;
-	int	set;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       step:       %d\n",step);
-		}
-
-	/* check if a file has been opened */
-	if (file_open == MB_YES && nbuff > 0)
-		{
-
-		/* if current time span includes last data don't step */
-		if (step >= 0
-			&& plot_end_time < ping[nbuff-1].file_time_d)
-			{
-			plot_start_time = plot_start_time + step;
-			plot_end_time = plot_start_time + data_show_size;
-			}
-		else if (step < 0
-			&& plot_start_time > ping[0].file_time_d)
-			{
-			plot_start_time = plot_start_time + step;
-			plot_end_time = plot_start_time + data_show_size;
-			}
-
-		/* get current start of plotting data */
-		set = MB_NO;
-		old_id = current_id;
-		for (i=0;i<nbuff;i++)
-			{
-			if (set == MB_NO
-				&& ping[i].file_time_d
-				>= plot_start_time)
-				{
-				new_id = i;
-				set = MB_YES;
-				}
-			}
-		if (new_id < 0)
-			new_id = 0;
-		if (new_id >= nbuff)
-			new_id = nbuff - 1;
-		if (step < 0
-			&& new_id > 0
-			&& new_id == old_id)
-			new_id--;
-		if (step > 0
-			&& new_id < nbuff - 1
-			&& new_id == old_id)
-			new_id++;
-		current_id = new_id;
-
-		/* replot */
-		if (nbuff > 0)
-			{
-			status = mbnavedit_plot_all();
-			}
-
-		/* set failure flag if no step was made */
-		if (new_id == old_id)
-			status = MB_FAILURE;
-		}
-
-	/* if no file open set failure status */
-	else
-		{
-		status = MB_FAILURE;
-		current_id = 0;
-		}
-
-	/* print out information */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  Current buffer values:\n");
-		fprintf(stderr,"dbg2       nload:       %d\n",nload);
-		fprintf(stderr,"dbg2       nbuff:       %d\n",nbuff);
-		fprintf(stderr,"dbg2       nbuff:       %d\n",nbuff);
-		fprintf(stderr,"dbg2       nbuff:       %d\n",nbuff);
-		fprintf(stderr,"dbg2       current_id:  %d\n",current_id);
-		}
-
-	/* reset data_save */
-	data_save = MB_NO;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbnavedit_action_end()
-{
-	/* local variables */
-	char	*function_name = "mbnavedit_action_end";
-	int	status = MB_SUCCESS;
-	int	old_id;
-	int	set;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
-
-	/* check if a file has been opened */
-	if (file_open == MB_YES && nbuff > 0)
-		{
-		/* set time span to include last data */
-		plot_end_time = ping[nbuff-1].file_time_d;
-		plot_start_time = plot_end_time - data_show_size;
-
-		/* get current start of plotting data */
-		old_id = current_id;
-		set = MB_NO;
-		for (i=0;i<nbuff && set == MB_NO;i++)
-			{
-			if (ping[i].file_time_d >= plot_start_time)
-				{
-				current_id = i;
-				set = MB_YES;
-				}
-			}
-
-		/* replot */
-		status = mbnavedit_plot_all();
-
-		/* set failure flag if no step was made */
-		if (current_id == old_id)
-			status = MB_FAILURE;
-		}
-
-	/* if no file open set failure status */
-	else
-		{
-		status = MB_FAILURE;
-		current_id = 0;
-		}
-
-	/* print out information */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  Current buffer values:\n");
-		fprintf(stderr,"dbg2       nload:       %d\n",nload);
-		fprintf(stderr,"dbg2       nbuff:       %d\n",nbuff);
-		fprintf(stderr,"dbg2       nbuff:       %d\n",nbuff);
-		fprintf(stderr,"dbg2       nbuff:       %d\n",nbuff);
-		fprintf(stderr,"dbg2       current_id:  %d\n",current_id);
-		}
-
-	/* reset data_save */
-	data_save = MB_NO;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbnavedit_action_start()
-{
-	/* local variables */
-	char	*function_name = "mbnavedit_action_start";
-	int	status = MB_SUCCESS;
-	int	old_id;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
-
-	/* check if a file has been opened */
-	if (file_open == MB_YES && nbuff > 0)
-		{
-		old_id = current_id;
-		current_id = 0;
-		plot_start_time = ping[current_id].file_time_d;
-		plot_end_time = plot_start_time + data_show_size;
-
-		/* replot */
-		if (nbuff > 0)
-			{
-			status = mbnavedit_plot_all();
-			}
-
-		/* set failure flag if no step was made */
-		if (current_id == old_id)
-			status = MB_FAILURE;
-		}
-
-	/* if no file open set failure status */
-	else
-		{
-		status = MB_FAILURE;
-		current_id = 0;
-		}
-
-	/* print out information */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  Current buffer values:\n");
-		fprintf(stderr,"dbg2       nload:       %d\n",nload);
-		fprintf(stderr,"dbg2       nbuff:       %d\n",nbuff);
-		fprintf(stderr,"dbg2       nbuff:       %d\n",nbuff);
-		fprintf(stderr,"dbg2       nbuff:       %d\n",nbuff);
-		fprintf(stderr,"dbg2       current_id:  %d\n",current_id);
-		}
-
-	/* reset data_save */
-	data_save = MB_NO;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbnavedit_action_mouse_pick(int xx, int yy)
-{
-	/* local variables */
-	char	*function_name = "mbnavedit_action_mouse_pick";
-	int	status = MB_SUCCESS;
-	int	deselect;
-	int	iplot;
-	int	active_plot;
-	int	range, range_min;
-	int	iping;
-	int	ix, iy;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       xx:         %d\n",xx);
-		fprintf(stderr,"dbg2       yy:         %d\n",yy);
-		}
-
-	/* don't try to do anything if no data */
-	active_plot = -1;
-	if (nplot > 0)
-		{
-
-		/* figure out which plot the cursor is in */
-		for (iplot=0;iplot<number_plots;iplot++)
-			{
-			if (xx >= mbnavplot[iplot].ixmin
-				&& xx <= mbnavplot[iplot].ixmax
-				&& yy <= mbnavplot[iplot].iymin
-				&& yy >= mbnavplot[iplot].iymax)
-				active_plot = iplot;
-			}
-		}
-
-	/* don't try to do anything if no data or not in plot */
-	if (nplot > 0 && active_plot > -1)
-	{
-
-	/* deselect everything in non-active plots */
-	deselect = MB_NO;
-	for (iplot=0;iplot<number_plots;iplot++)
-		{
-		if (iplot != active_plot)
-			{
-			status = mbnavedit_action_deselect_all(
-					mbnavplot[iplot].type);
-			if (status == MB_SUCCESS)
-				deselect = MB_YES;
-			}
-		}
-
-	/* if anything was actually deselected, replot */
-	if (deselect == MB_SUCCESS)
-		{
-		/* clear the screen */
-		status = mbnavedit_clear_screen();
-
-		/* replot the screen */
-		status = mbnavedit_plot_all();
-		}
-	status = MB_SUCCESS;
-
-	/* figure out which data point is closest to cursor */
-	range_min = 100000;
-	for (i=current_id+1;i<current_id+nplot;i++)
-		{
-		if (mbnavplot[active_plot].type == PLOT_TINT)
-			{
-			ix = xx - ping[i].tint_x;
-			iy = yy - ping[i].tint_y;
-			}
-		else if (mbnavplot[active_plot].type == PLOT_LONGITUDE)
-			{
-			ix = xx - ping[i].lon_x;
-			iy = yy - ping[i].lon_y;
-			}
-		else if (mbnavplot[active_plot].type == PLOT_LATITUDE)
-			{
-			ix = xx - ping[i].lat_x;
-			iy = yy - ping[i].lat_y;
-			}
-		else if (mbnavplot[active_plot].type == PLOT_SPEED)
-			{
-			ix = xx - ping[i].speed_x;
-			iy = yy - ping[i].speed_y;
-			}
-		else if (mbnavplot[active_plot].type == PLOT_HEADING)
-			{
-			ix = xx - ping[i].heading_x;
-			iy = yy - ping[i].heading_y;
-			}
-		else if (mbnavplot[active_plot].type == PLOT_DRAFT)
-			{
-			ix = xx - ping[i].draft_x;
-			iy = yy - ping[i].draft_y;
-			}
-		range = (int) sqrt((double) (ix*ix + iy*iy));
-		if (range < range_min)
-			{
-			range_min = range;
-			iping = i;
-			}
-		}
-
-	/* if it is close enough select or unselect the value
-		and replot it */
-	if (range_min <= MBNAVEDIT_PICK_DISTANCE)
-		{
-		if (mbnavplot[active_plot].type == PLOT_TINT)
-			{
-			if (ping[iping].tint_select == MB_YES)
-				ping[iping].tint_select = MB_NO;
-			else
-				ping[iping].tint_select = MB_YES;
-			mbnavedit_plot_tint_value(active_plot,iping);
-			}
-		else if (mbnavplot[active_plot].type == PLOT_LONGITUDE)
-			{
-			if (ping[iping].lon_select == MB_YES)
-				ping[iping].lon_select = MB_NO;
-			else
-				ping[iping].lon_select = MB_YES;
-			mbnavedit_plot_lon_value(active_plot,iping);
-			}
-		else if (mbnavplot[active_plot].type == PLOT_LATITUDE)
-			{
-			if (ping[iping].lat_select == MB_YES)
-				ping[iping].lat_select = MB_NO;
-			else
-				ping[iping].lat_select = MB_YES;
-			mbnavedit_plot_lat_value(active_plot,iping);
-			}
-		else if (mbnavplot[active_plot].type == PLOT_SPEED)
-			{
-			if (ping[iping].speed_select == MB_YES)
-				ping[iping].speed_select = MB_NO;
-			else
-				ping[iping].speed_select = MB_YES;
-			mbnavedit_plot_speed_value(active_plot,iping);
-			}
-		else if (mbnavplot[active_plot].type == PLOT_HEADING)
-			{
-			if (ping[iping].heading_select == MB_YES)
-				ping[iping].heading_select = MB_NO;
-			else
-				ping[iping].heading_select = MB_YES;
-			mbnavedit_plot_heading_value(active_plot,iping);
-			}
-		else if (mbnavplot[active_plot].type == PLOT_DRAFT)
-			{
-			if (ping[iping].draft_select == MB_YES)
-				ping[iping].draft_select = MB_NO;
-			else
-				ping[iping].draft_select = MB_YES;
-			mbnavedit_plot_draft_value(active_plot,iping);
-			}
-		}
-	}
-	/* if no data then set failure flag */
-	else
-	status = MB_FAILURE;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbnavedit_action_mouse_select(int xx, int yy)
-{
-	/* local variables */
-	char	*function_name = "mbnavedit_action_mouse_select";
-	int	status = MB_SUCCESS;
-	int	deselect;
-	int	iplot;
-	int	active_plot;
-	int	range;
-	int	ix, iy;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       xx:         %d\n",xx);
-		fprintf(stderr,"dbg2       yy:         %d\n",yy);
-		}
-
-	/* don't try to do anything if no data */
-	active_plot = -1;
-	if (nplot > 0)
-		{
-
-		/* figure out which plot the cursor is in */
-		for (iplot=0;iplot<number_plots;iplot++)
-			{
-			if (xx >= mbnavplot[iplot].ixmin
-				&& xx <= mbnavplot[iplot].ixmax
-				&& yy <= mbnavplot[iplot].iymin
-				&& yy >= mbnavplot[iplot].iymax)
-				active_plot = iplot;
-			}
-		}
-
-	/* don't try to do anything if no data or not in plot */
-	if (nplot > 0 && active_plot > -1)
-	{
-
-	/* deselect everything in non-active plots */
-	deselect = MB_NO;
-	for (iplot=0;iplot<number_plots;iplot++)
-		{
-		if (iplot != active_plot)
-			{
-			status = mbnavedit_action_deselect_all(
-					mbnavplot[iplot].type);
-			if (status == MB_SUCCESS)
-				deselect = MB_YES;
-			}
-		}
-
-	/* if anything was actually deselected, replot */
-	if (deselect == MB_SUCCESS)
-		{
-		/* clear the screen */
-		status = mbnavedit_clear_screen();
-
-		/* replot the screen */
-		status = mbnavedit_plot_all();
-		}
-	status = MB_SUCCESS;
-
-	/* find all data points that are close enough */
-	for (i=current_id;i<current_id+nplot;i++)
-		{
-		if (mbnavplot[active_plot].type == PLOT_TINT)
-			{
-			ix = xx - ping[i].tint_x;
-			iy = yy - ping[i].tint_y;
-			}
-		else if (mbnavplot[active_plot].type == PLOT_LONGITUDE)
-			{
-			ix = xx - ping[i].lon_x;
-			iy = yy - ping[i].lon_y;
-			}
-		else if (mbnavplot[active_plot].type == PLOT_LATITUDE)
-			{
-			ix = xx - ping[i].lat_x;
-			iy = yy - ping[i].lat_y;
-			}
-		else if (mbnavplot[active_plot].type == PLOT_SPEED)
-			{
-			ix = xx - ping[i].speed_x;
-			iy = yy - ping[i].speed_y;
-			}
-		else if (mbnavplot[active_plot].type == PLOT_HEADING)
-			{
-			ix = xx - ping[i].heading_x;
-			iy = yy - ping[i].heading_y;
-			}
-		else if (mbnavplot[active_plot].type == PLOT_DRAFT)
-			{
-			ix = xx - ping[i].draft_x;
-			iy = yy - ping[i].draft_y;
-			}
-		range = (int) sqrt((double) (ix*ix + iy*iy));
-
-		/* if it is close enough select the value
-			and replot it */
-		if (range <= MBNAVEDIT_ERASE_DISTANCE)
-			{
-			if (mbnavplot[active_plot].type == PLOT_TINT)
-				{
-				ping[i].tint_select = MB_YES;
-				mbnavedit_plot_tint_value(active_plot,i);
-				}
-			else if (mbnavplot[active_plot].type == PLOT_LONGITUDE)
-				{
-				ping[i].lon_select = MB_YES;
-				mbnavedit_plot_lon_value(active_plot,i);
-				}
-			else if (mbnavplot[active_plot].type == PLOT_LATITUDE)
-				{
-				ping[i].lat_select = MB_YES;
-				mbnavedit_plot_lat_value(active_plot,i);
-				}
-			else if (mbnavplot[active_plot].type == PLOT_SPEED)
-				{
-				ping[i].speed_select = MB_YES;
-				mbnavedit_plot_speed_value(active_plot,i);
-				}
-			else if (mbnavplot[active_plot].type == PLOT_HEADING)
-				{
-				ping[i].heading_select = MB_YES;
-				mbnavedit_plot_heading_value(active_plot,i);
-				}
-			else if (mbnavplot[active_plot].type == PLOT_DRAFT)
-				{
-				ping[i].draft_select = MB_YES;
-				mbnavedit_plot_draft_value(active_plot,i);
-				}
-			}
-		}
-	}
-	/* if no data then set failure flag */
-	else
-	status = MB_FAILURE;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbnavedit_action_mouse_deselect(int xx, int yy)
-{
-	/* local variables */
-	char	*function_name = "mbnavedit_action_mouse_deselect";
-	int	status = MB_SUCCESS;
-	int	deselect;
-	int	iplot;
-	int	active_plot;
-	int	range;
-	int	ix, iy;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       xx:         %d\n",xx);
-		fprintf(stderr,"dbg2       yy:         %d\n",yy);
-		}
-
-	/* don't try to do anything if no data */
-	active_plot = -1;
-	if (nplot > 0)
-		{
-
-		/* figure out which plot the cursor is in */
-		for (iplot=0;iplot<number_plots;iplot++)
-			{
-			if (xx >= mbnavplot[iplot].ixmin
-				&& xx <= mbnavplot[iplot].ixmax
-				&& yy <= mbnavplot[iplot].iymin
-				&& yy >= mbnavplot[iplot].iymax)
-				active_plot = iplot;
-			}
-		}
-
-	/* don't try to do anything if no data or not in plot */
-	if (nplot > 0 && active_plot > -1)
-	{
-
-	/* deselect everything in non-active plots */
-	deselect = MB_NO;
-	for (iplot=0;iplot<number_plots;iplot++)
-		{
-		if (iplot != active_plot)
-			{
-			status = mbnavedit_action_deselect_all(
-					mbnavplot[iplot].type);
-			if (status == MB_SUCCESS)
-				deselect = MB_YES;
-			}
-		}
-
-	/* if anything was actually deselected, replot */
-	if (deselect == MB_SUCCESS)
-		{
-		/* clear the screen */
-		status = mbnavedit_clear_screen();
-
-		/* replot the screen */
-		status = mbnavedit_plot_all();
-		}
-	status = MB_SUCCESS;
-
-	/* find all data points that are close enough */
-	for (i=current_id;i<current_id+nplot;i++)
-		{
-		if (mbnavplot[active_plot].type == PLOT_TINT)
-			{
-			ix = xx - ping[i].tint_x;
-			iy = yy - ping[i].tint_y;
-			}
-		else if (mbnavplot[active_plot].type == PLOT_LONGITUDE)
-			{
-			ix = xx - ping[i].lon_x;
-			iy = yy - ping[i].lon_y;
-			}
-		else if (mbnavplot[active_plot].type == PLOT_LATITUDE)
-			{
-			ix = xx - ping[i].lat_x;
-			iy = yy - ping[i].lat_y;
-			}
-		else if (mbnavplot[active_plot].type == PLOT_SPEED)
-			{
-			ix = xx - ping[i].speed_x;
-			iy = yy - ping[i].speed_y;
-			}
-		else if (mbnavplot[active_plot].type == PLOT_HEADING)
-			{
-			ix = xx - ping[i].heading_x;
-			iy = yy - ping[i].heading_y;
-			}
-		else if (mbnavplot[active_plot].type == PLOT_DRAFT)
-			{
-			ix = xx - ping[i].draft_x;
-			iy = yy - ping[i].draft_y;
-			}
-		range = (int) sqrt((double) (ix*ix + iy*iy));
-
-		/* if it is close enough deselect the value
-			and replot it */
-		if (range <= MBNAVEDIT_ERASE_DISTANCE)
-			{
-			if (mbnavplot[active_plot].type == PLOT_TINT)
-				{
-				ping[i].tint_select = MB_NO;
-				mbnavedit_plot_tint_value(active_plot,i);
-				}
-			else if (mbnavplot[active_plot].type == PLOT_LONGITUDE)
-				{
-				ping[i].lon_select = MB_NO;
-				mbnavedit_plot_lon_value(active_plot,i);
-				}
-			else if (mbnavplot[active_plot].type == PLOT_LATITUDE)
-				{
-				ping[i].lat_select = MB_NO;
-				mbnavedit_plot_lat_value(active_plot,i);
-				}
-			else if (mbnavplot[active_plot].type == PLOT_SPEED)
-				{
-				ping[i].speed_select = MB_NO;
-				mbnavedit_plot_speed_value(active_plot,i);
-				}
-			else if (mbnavplot[active_plot].type == PLOT_HEADING)
-				{
-				ping[i].heading_select = MB_NO;
-				mbnavedit_plot_heading_value(active_plot,i);
-				}
-			else if (mbnavplot[active_plot].type == PLOT_DRAFT)
-				{
-				ping[i].draft_select = MB_NO;
-				mbnavedit_plot_draft_value(active_plot,i);
-				}
-			}
-		}
-	}
-	/* if no data then set failure flag */
-	else
-	status = MB_FAILURE;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbnavedit_action_mouse_selectall(int xx, int yy)
-{
-	/* local variables */
-	char	*function_name = "mbnavedit_action_mouse_selectall";
-	int	status = MB_SUCCESS;
-	int	iplot;
-	int	active_plot;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       xx:         %d\n",xx);
-		fprintf(stderr,"dbg2       yy:         %d\n",yy);
-		}
-
-	/* don't try to do anything if no data */
-	active_plot = -1;
-	if (nplot > 0)
-		{
-
-		/* figure out which plot the cursor is in */
-		for (iplot=0;iplot<number_plots;iplot++)
-			{
-			if (xx >= mbnavplot[iplot].ixmin
-				&& xx <= mbnavplot[iplot].ixmax
-				&& yy <= mbnavplot[iplot].iymin
-				&& yy >= mbnavplot[iplot].iymax)
-				active_plot = iplot;
-			}
-		}
-
-	/* don't try to do anything if no data or not in plot */
-	if (nplot > 0 && active_plot > -1)
-	{
-
-	/* deselect everything in non-active plots */
-	for (iplot=0;iplot<number_plots;iplot++)
-		{
-		if (iplot != active_plot)
-			{
-			mbnavedit_action_deselect_all(
-					mbnavplot[iplot].type);
-			}
-		}
-
-	/* select all data points in active plot */
-	for (i=current_id;i<current_id+nplot;i++)
-		{
-		if (mbnavplot[active_plot].type == PLOT_TINT)
-			ping[i].tint_select = MB_YES;
-		else if (mbnavplot[active_plot].type == PLOT_LONGITUDE)
-			ping[i].lon_select = MB_YES;
-		else if (mbnavplot[active_plot].type == PLOT_LATITUDE)
-			ping[i].lat_select = MB_YES;
-		else if (mbnavplot[active_plot].type == PLOT_SPEED)
-			ping[i]. speed_select = MB_YES;
-		else if (mbnavplot[active_plot].type == PLOT_HEADING)
-			ping[i].heading_select = MB_YES;
-		else if (mbnavplot[active_plot].type == PLOT_DRAFT)
-			ping[i].draft_select = MB_YES;
-		}
-
-	/* clear the screen */
-	status = mbnavedit_clear_screen();
-
-	/* replot the screen */
-	status = mbnavedit_plot_all();
-
-	}
-	/* if no data then set failure flag */
-	else
-	status = MB_FAILURE;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbnavedit_action_mouse_deselectall(int xx, int yy)
-{
-	/* local variables */
-	char	*function_name = "mbnavedit_action_mouse_deselectall";
-	int	status = MB_SUCCESS;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       xx:         %d\n",xx);
-		fprintf(stderr,"dbg2       yy:         %d\n",yy);
-		}
-
-	/* don't try to do anything if no data */
-	if (nplot > 0)
-	{
-
-	/* deselect all data points in all plots
-		- this logic follows from deselecting all
-		active plots plus all non-active plots */
-	for (i=current_id;i<current_id+nplot;i++)
-		{
-		ping[i].tint_select = MB_NO;
-		ping[i].lon_select = MB_NO;
-		ping[i].lat_select = MB_NO;
-		ping[i]. speed_select = MB_NO;
-		ping[i].heading_select = MB_NO;
-		ping[i].draft_select = MB_NO;
-		}
-
-	/* clear the screen */
-	status = mbnavedit_clear_screen();
-
-	/* replot the screen */
-	status = mbnavedit_plot_all();
-
-	}
-	/* if no data then set failure flag */
-	else
-	status = MB_FAILURE;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbnavedit_action_deselect_all(int type)
-{
-	/* local variables */
-	char	*function_name = "mbnavedit_action_mouse_deselect_all";
-	int	status = MB_SUCCESS;
-	int	ndeselect;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       type:       %d\n",type);
-		}
-
-	/* don't try to do anything if no data */
-	if (nplot > 0)
-	{
-
-	/* deselect all data points in specified data type */
-	ndeselect = 0;
-	for (i=0;i<nbuff;i++)
-		{
-		if (type == PLOT_TINT
-			&& ping[i].tint_select == MB_YES)
-			{
-			ping[i].tint_select = MB_NO;
-			ndeselect++;
-			}
-		else if (type == PLOT_LONGITUDE
-			&& ping[i].lon_select == MB_YES)
-			{
-			ping[i].lon_select = MB_NO;
-			ndeselect++;
-			}
-		else if (type == PLOT_LATITUDE
-			&& ping[i].lat_select == MB_YES)
-			{
-			ping[i].lat_select = MB_NO;
-			ndeselect++;
-			}
-		else if (type == PLOT_SPEED
-			&& ping[i].speed_select == MB_YES)
-			{
-			ping[i].speed_select = MB_NO;
-			ndeselect++;
-			}
-		else if (type == PLOT_HEADING
-			&& ping[i].heading_select == MB_YES)
-			{
-			ping[i].heading_select = MB_NO;
-			ndeselect++;
-			}
-		else if (type == PLOT_DRAFT
-			&& ping[i].draft_select == MB_YES)
-			{
-			ping[i].draft_select = MB_NO;
-			ndeselect++;
-			}
-		}
-	if (ndeselect > 0)
-		status = MB_SUCCESS;
-	else
-		status = MB_FAILURE;
-	}
-	/* if no data then set failure flag */
-	else
-	status = MB_FAILURE;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbnavedit_action_set_interval(int xx, int yy, int which)
-{
-	/* local variables */
-	char	*function_name = "mbnavedit_action_set_interval";
-	int	status = MB_SUCCESS;
-	static int interval_bound1;
-	static int interval_bound2;
-	static double interval_time1;
-	static double interval_time2;
-	static int interval_set1 = MB_NO;
-	static int interval_set2 = MB_NO;
-	int	itmp;
-	double	dtmp;
-	int	set;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       xx:         %d\n",xx);
-		fprintf(stderr,"dbg2       yy:         %d\n",yy);
-		fprintf(stderr,"dbg2       which:      %d\n",which);
-		}
-
-	/* don't try to do anything if no data */
-	if (nplot > 0 && number_plots > 0)
-	    {
-
-	    /* if which = 0 set first bound and draw dashed lines */
-	    if (which == 0)
-		{
-		/* unplot old line on all plots */
-		if (interval_set1 == MB_YES)
-		for (i=0;i<number_plots;i++)
-			{
-			xg_drawline(mbnavedit_xgid,
-				interval_bound1,
-				mbnavplot[i].iymin,
-				interval_bound1,
-				mbnavplot[i].iymax,
-				pixel_values[WHITE],XG_DASHLINE);
-			}
-
-		if (xx < mbnavplot[0].ixmin)
-			xx = mbnavplot[0].ixmin;
-		if (xx > mbnavplot[0].ixmax)
-			xx = mbnavplot[0].ixmax;
-
-		/* get lower bound time and location */
-		interval_bound1 = xx;
-		interval_time1 = mbnavplot[0].xmin +
-			(xx - mbnavplot[0].ixmin)/mbnavplot[0].xscale;
-		interval_set1 = MB_YES;
-
-		/* plot line on all plots */
-		for (i=0;i<number_plots;i++)
-			{
-			xg_drawline(mbnavedit_xgid,
-				interval_bound1,
-				mbnavplot[i].iymin,
-				interval_bound1,
-				mbnavplot[i].iymax,
-				pixel_values[RED],XG_DASHLINE);
-			}
-
-		}
-
-	    /* if which = 1 set second bound and draw dashed lines */
-	    else if (which == 1)
-		{
-		/* unplot old line on all plots */
-		if (interval_set1 == MB_YES)
-		for (i=0;i<number_plots;i++)
-			{
-			xg_drawline(mbnavedit_xgid,
-				interval_bound2,
-				mbnavplot[i].iymin,
-				interval_bound2,
-				mbnavplot[i].iymax,
-				pixel_values[WHITE],XG_DASHLINE);
-			}
-
-		if (xx < mbnavplot[0].ixmin)
-			xx = mbnavplot[0].ixmin;
-		if (xx > mbnavplot[0].ixmax)
-			xx = mbnavplot[0].ixmax;
-
-		/* get lower bound time and location */
-		interval_bound2 = xx;
-		interval_time2 = mbnavplot[0].xmin +
-			(xx - mbnavplot[0].ixmin)/mbnavplot[0].xscale;
-		interval_set2 = MB_YES;
-
-		/* plot line on all plots */
-		for (i=0;i<number_plots;i++)
-			{
-			xg_drawline(mbnavedit_xgid,
-				interval_bound2,
-				mbnavplot[i].iymin,
-				interval_bound2,
-				mbnavplot[i].iymax,
-				pixel_values[RED],XG_DASHLINE);
-			}
-
-		}
-
-	    /* if which = 2 use bounds and replot */
-	    else if (which == 2
-		&& interval_set1 == MB_YES
-		&& interval_set2 == MB_YES
-		&& interval_bound1 != interval_bound2)
-		{
-		/* switch bounds if necessary */
-		if (interval_bound1 > interval_bound2)
-			{
-			itmp = interval_bound2;
-			dtmp = interval_time2;
-			interval_bound2 = interval_bound1;
-			interval_time2 = interval_time1;
-			interval_bound1 = itmp;
-			interval_time1 = dtmp;
-			}
-
-		/* reset plotting parameters */
-		plot_start_time = interval_time1;
-		plot_end_time = interval_time2;
-		data_show_size = plot_end_time - plot_start_time;
-
-		/* reset time stepping parameters */
-		data_step_size = data_show_size / 4;
-		if (data_step_size > data_step_max)
-		    data_step_max = 2 * data_step_size;
-
-		/* get current start of plotting data */
-		set = MB_NO;
-		for (i=0;i<nbuff;i++)
-			{
-			if (set == MB_NO &&
-				ping[i].file_time_d >= plot_start_time)
-				{
-				current_id = i;
-				set = MB_YES;
-				}
-			}
-		if (current_id < 0)
-			current_id = 0;
-		if (current_id >= nbuff)
-			current_id = nbuff - 1;
-
-		/* replot */
-		mbnavedit_plot_all();
-		}
-
-	    /* else if which = 3 unset bounds */
-	    else if (which == 3)
-		{
-		interval_set1 = MB_NO;
-		interval_set2 = MB_NO;
-		}
-
-	    /* else failure */
-	    else
-		status = MB_FAILURE;
-	    }
-	/* if no data then set failure flag */
-	else
-	    status = MB_FAILURE;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbnavedit_action_use_dr()
-{
-	/* local variables */
-	char	*function_name = "mbnavedit_action_use_dr";
-	int	status = MB_SUCCESS;
-	int	iplot;
-	int	active_plot;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
-
-	/* don't try to do anything if no data */
-	if (nplot > 0)
-	{
-
-	/* make sure either a lon or lat plot is active */
-	active_plot = -1;
-	for (iplot=0;iplot<number_plots;iplot++)
-		{
-		if (mbnavplot[iplot].type == PLOT_LONGITUDE)
-			active_plot = iplot;
-		else if (mbnavplot[iplot].type == PLOT_LATITUDE)
-			active_plot = iplot;
-		}
-
-	/* set lonlat to dr lonlat for selected visible data */
-	if (active_plot > -1)
-		{
-		for (i=current_id;i<current_id+nplot;i++)
-			{
-			if (ping[i].lon_select == MB_YES
-			    || ping[i].lat_select == MB_YES)
-				{
-				ping[i].lon = ping[i].lon_dr;
-				ping[i].lat = ping[i].lat_dr;
-				}
-			}
-
-		/* calculate speed-made-good and course-made-good */
-		for (i=0;i<nbuff;i++)
-			mbnavedit_get_smgcmg(i);
-
-		/* clear the screen */
-		status = mbnavedit_clear_screen();
-
-		/* replot the screen */
-		status = mbnavedit_plot_all();
-		}
-
-	else
-		status = MB_FAILURE;
-
-	}
-	/* if no data then set failure flag */
-	else
-	status = MB_FAILURE;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbnavedit_action_use_smg()
-{
-	/* local variables */
-	char	*function_name = "mbnavedit_action_use_smg";
-	int	status = MB_SUCCESS;
-	int	iplot;
-	int	active_plot;
-	int	speedheading_change;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
-
-	/* don't try to do anything if no data */
-	if (nplot > 0)
-	{
-
-
-	/* figure out which plot is speed */
-	active_plot = -1;
-	for (iplot=0;iplot<number_plots;iplot++)
-		{
-		if (mbnavplot[iplot].type == PLOT_SPEED)
-			active_plot = iplot;
-		}
-
-	/* set speed to speed made good for selected visible data */
-	if (active_plot > -1)
-		{
-		speedheading_change = MB_NO;
-		for (i=current_id;i<current_id+nplot;i++)
-			{
-			if (ping[i].speed_select == MB_YES)
-				{
-				ping[i].speed = ping[i].speed_made_good;
-				speedheading_change = MB_YES;
-				}
-			}
-
-		/* recalculate model */
-		if (speedheading_change == MB_YES
-			&& model_mode == MODEL_MODE_DR)
-			mbnavedit_get_model();
-
-		/* clear the screen */
-		status = mbnavedit_clear_screen();
-
-		/* replot the screen */
-		status = mbnavedit_plot_all();
-		}
-
-	else
-		status = MB_FAILURE;
-
-	}
-	/* if no data then set failure flag */
-	else
-	status = MB_FAILURE;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbnavedit_action_use_cmg()
-{
-	/* local variables */
-	char	*function_name = "mbnavedit_action_use_cmg";
-	int	status = MB_SUCCESS;
-	int	iplot;
-	int	active_plot;
-	int	speedheading_change;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
-
-	/* don't try to do anything if no data */
-	if (nplot > 0)
-	{
-
-
-	/* figure out which plot is heading */
-	active_plot = -1;
-	for (iplot=0;iplot<number_plots;iplot++)
-		{
-		if (mbnavplot[iplot].type == PLOT_HEADING)
-			active_plot = iplot;
-		}
-
-	/* set heading to course made good for selected visible data */
-	if (active_plot > -1)
-		{
-		speedheading_change = MB_NO;
-		for (i=current_id;i<current_id+nplot;i++)
-			{
-			if (ping[i].heading_select == MB_YES)
-				{
-				ping[i].heading = ping[i].course_made_good;
-				speedheading_change = MB_YES;
-				}
-			}
-
-		/* recalculate model */
-		if (speedheading_change == MB_YES
-			&& model_mode == MODEL_MODE_DR)
-			mbnavedit_get_model();
-
-		/* clear the screen */
-		status = mbnavedit_clear_screen();
-
-		/* replot the screen */
-		status = mbnavedit_plot_all();
-		}
-
-	else
-		status = MB_FAILURE;
-
-	}
-	/* if no data then set failure flag */
-	else
-	status = MB_FAILURE;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbnavedit_action_interpolate()
-{
-	/* local variables */
-	char	*function_name = "mbnavedit_action_interpolate";
-	int	status = MB_SUCCESS;
-	int	iping;
-	int	ibefore, iafter;
-	int	timelonlat_change;
-	int	speedheading_change;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
-
-	/* don't try to do anything if no data */
-	if (nplot > 0)
-	{
-	/* look for position or time changes */
-	timelonlat_change = MB_NO;
-	speedheading_change = MB_NO;
-
-	/* do expected time */
-	for (iping=0;iping<nbuff;iping++)
-	    {
-	    if (ping[iping].tint_select == MB_YES)
-		{
-		ibefore = iping;
-		for (i=iping-1;i>=0;i--)
-		    if (ping[i].tint_select == MB_NO
-			&& ibefore == iping)
-			ibefore = i;
-		iafter = iping;
-		for (i=iping+1;i<nbuff;i++)
-		    if (ping[i].tint_select == MB_NO
-			&& iafter == iping)
-			iafter = i;
-		if (ibefore < iping && iafter > iping)
-		    {
-		    ping[iping].time_d = ping[ibefore].time_d
-			+ (ping[iafter].time_d - ping[ibefore].time_d)
-			*((double)(iping - ibefore))
-			    /	((double)(iafter - ibefore));
-		    ping[iping].tint = ping[iping].time_d
-					- ping[iping-1].time_d;
-		    timelonlat_change = MB_YES;
-		    }
-		else if (ibefore < iping && ibefore > 0)
-		    {
-		    ping[iping].time_d = ping[ibefore].time_d
-			+ (ping[ibefore].time_d - ping[ibefore-1].time_d)
-			* (iping - ibefore);
-		    ping[iping].tint = ping[iping].time_d
-					- ping[iping-1].time_d;
-		    timelonlat_change = MB_YES;
-		    }
-		else if (ibefore < iping)
-		    {
-		    ping[iping].time_d = ping[ibefore].time_d;
-		    ping[iping].tint = ping[iping].time_d
-					- ping[iping-1].time_d;
-		    timelonlat_change = MB_YES;
-		    }
-		else if (iafter > iping && iafter < nbuff - 1)
-		    {
-		    ping[iping].time_d = ping[iafter].time_d
-			+ (ping[iafter+1].time_d - ping[iafter].time_d)
-			*(iping - iafter);
-		    ping[iping].tint = 0.0;
-		    timelonlat_change = MB_YES;
-		    }
-		else if (iafter > iping)
-		    {
-		    ping[iping].time_d = ping[iafter].time_d;
-		    ping[iping].tint = ping[iping].time_d
-					- ping[iping-1].time_d;
-		    timelonlat_change = MB_YES;
-		    }
-		ping[iping].file_time_d =
-			ping[iping].time_d - file_start_time_d;
-		status = mb_get_date(verbose, ping[iping].time_d, ping[iping].time_i);
-		if (iping < nbuff - 1)
-		    if (ping[iping+1].tint_select == MB_NO)
-			ping[iping+1].tint = ping[iping+1].time_d
-						- ping[iping].time_d;
-		}
-	    }
-
-	/* do longitude */
-	for (iping=0;iping<nbuff;iping++)
-	    {
-	    if (ping[iping].lon_select == MB_YES)
-		{
-		ibefore = iping;
-		for (i=iping-1;i>=0;i--)
-		    if (ping[i].lon_select == MB_NO
-			&& ibefore == iping)
-			ibefore = i;
-		iafter = iping;
-		for (i=iping+1;i<nbuff;i++)
-		    if (ping[i].lon_select == MB_NO
-			&& iafter == iping)
-			iafter = i;
-		if (ibefore < iping && iafter > iping)
-		    {
-		    ping[iping].lon = ping[ibefore].lon
-			+ (ping[iafter].lon - ping[ibefore].lon)
-			*(ping[iping].time_d - ping[ibefore].time_d)
-			/(ping[iafter].time_d - ping[ibefore].time_d);
-		    timelonlat_change = MB_YES;
-		    }
-		else if (ibefore < iping && ibefore > 0)
-		    {
-		    ping[iping].lon = ping[ibefore].lon
-			+ (ping[ibefore].lon - ping[ibefore-1].lon)
-			*(ping[iping].time_d - ping[ibefore].time_d)
-			/(ping[ibefore].time_d - ping[ibefore-1].time_d);
-		    timelonlat_change = MB_YES;
-		    }
-		else if (ibefore < iping)
-		    {
-		    ping[iping].lon = ping[ibefore].lon;
-		    timelonlat_change = MB_YES;
-		    }
-		else if (iafter > iping && iafter < nbuff - 1)
-		    {
-		    ping[iping].lon = ping[iafter].lon
-			+ (ping[iafter+1].lon - ping[iafter].lon)
-			*(ping[iping].time_d - ping[iafter].time_d)
-			/(ping[iafter+1].time_d - ping[iafter].time_d);
-		    timelonlat_change = MB_YES;
-		    }
-		else if (iafter > iping)
-		    {
-		    ping[iping].lon = ping[iafter].lon;
-		    timelonlat_change = MB_YES;
-		    }
-		}
-	    }
-
-	/* do latitude */
-	for (iping=0;iping<nbuff;iping++)
-	    {
-	    if (ping[iping].lat_select == MB_YES)
-		{
-		ibefore = iping;
-		for (i=iping-1;i>=0;i--)
-		    if (ping[i].lat_select == MB_NO
-			&& ibefore == iping)
-			ibefore = i;
-		iafter = iping;
-		for (i=iping+1;i<nbuff;i++)
-		    if (ping[i].lat_select == MB_NO
-			&& iafter == iping)
-			iafter = i;
-		if (ibefore < iping && iafter > iping)
-		    {
-		    ping[iping].lat = ping[ibefore].lat
-			+ (ping[iafter].lat - ping[ibefore].lat)
-			*(ping[iping].time_d - ping[ibefore].time_d)
-			/(ping[iafter].time_d - ping[ibefore].time_d);
-		    timelonlat_change = MB_YES;
-		    }
-		else if (ibefore < iping && ibefore > 0)
-		    {
-		    ping[iping].lat = ping[ibefore].lat
-			+ (ping[ibefore].lat - ping[ibefore-1].lat)
-			*(ping[iping].time_d - ping[ibefore].time_d)
-			/(ping[ibefore].time_d - ping[ibefore-1].time_d);
-		    timelonlat_change = MB_YES;
-		    }
-		else if (ibefore < iping)
-		    {
-		    ping[iping].lat = ping[ibefore].lat;
-		    timelonlat_change = MB_YES;
-		    }
-		else if (iafter > iping && iafter < nbuff - 1)
-		    {
-		    ping[iping].lat = ping[iafter].lat
-			+ (ping[iafter+1].lat - ping[iafter].lat)
-			*(ping[iping].time_d - ping[iafter].time_d)
-			/(ping[iafter+1].time_d - ping[iafter].time_d);
-		    timelonlat_change = MB_YES;
-		    }
-		else if (iafter > iping)
-		    {
-		    ping[iping].lat = ping[iafter].lat;
-		    timelonlat_change = MB_YES;
-		    }
-		}
-	    }
-
-	/* do speed */
-	for (iping=0;iping<nbuff;iping++)
-	    {
-	    if (ping[iping].speed_select == MB_YES)
-		{
-		ibefore = iping;
-		for (i=iping-1;i>=0;i--)
-		    if (ping[i].speed_select == MB_NO
-			&& ibefore == iping)
-			ibefore = i;
-		iafter = iping;
-		for (i=iping+1;i<nbuff;i++)
-		    if (ping[i].speed_select == MB_NO
-			&& iafter == iping)
-			iafter = i;
-		if (ibefore < iping && iafter > iping)
-		    {
-		    ping[iping].speed = ping[ibefore].speed
-			+ (ping[iafter].speed - ping[ibefore].speed)
-			*(ping[iping].time_d - ping[ibefore].time_d)
-			/(ping[iafter].time_d - ping[ibefore].time_d);
-		    speedheading_change = MB_YES;
-		    }
-		else if (ibefore < iping)
-		    {
-		    ping[iping].speed = ping[ibefore].speed;
-		    speedheading_change = MB_YES;
-		    }
-		else if (iafter > iping)
-		    {
-		    ping[iping].speed = ping[iafter].speed;
-		    speedheading_change = MB_YES;
-		    }
-		}
-	    }
-
-	/* do heading */
-	for (iping=0;iping<nbuff;iping++)
-	    {
-	    if (ping[iping].heading_select == MB_YES)
-		{
-		ibefore = iping;
-		for (i=iping-1;i>=0;i--)
-		    if (ping[i].heading_select == MB_NO
-			&& ibefore == iping)
-			ibefore = i;
-		iafter = iping;
-		for (i=iping+1;i<nbuff;i++)
-		    if (ping[i].heading_select == MB_NO
-			&& iafter == iping)
-			iafter = i;
-		if (ibefore < iping && iafter > iping)
-		    {
-		    ping[iping].heading = ping[ibefore].heading
-			+ (ping[iafter].heading - ping[ibefore].heading)
-			*(ping[iping].time_d - ping[ibefore].time_d)
-			/(ping[iafter].time_d - ping[ibefore].time_d);
-		    speedheading_change = MB_YES;
-		    }
-		else if (ibefore < iping)
-		    {
-		    ping[iping].heading = ping[ibefore].heading;
-		    speedheading_change = MB_YES;
-		    }
-		else if (iafter > iping)
-		    {
-		    ping[iping].heading = ping[iafter].heading;
-		    speedheading_change = MB_YES;
-		    }
-		}
-	    }
-
-	/* do draft */
-	for (iping=0;iping<nbuff;iping++)
-	    {
-	    if (ping[iping].draft_select == MB_YES)
-		{
-		ibefore = iping;
-		for (i=iping-1;i>=0;i--)
-		    if (ping[i].draft_select == MB_NO
-			&& ibefore == iping)
-			ibefore = i;
-		iafter = iping;
-		for (i=iping+1;i<nbuff;i++)
-		    if (ping[i].draft_select == MB_NO
-			&& iafter == iping)
-			iafter = i;
-		if (ibefore < iping && iafter > iping)
-		    {
-		    ping[iping].draft = ping[ibefore].draft
-			+ (ping[iafter].draft - ping[ibefore].draft)
-			*(ping[iping].time_d - ping[ibefore].time_d)
-			/(ping[iafter].time_d - ping[ibefore].time_d);
-		    timelonlat_change = MB_YES;
-		    }
-		else if (ibefore < iping)
-		    {
-		    ping[iping].draft = ping[ibefore].draft;
-		    timelonlat_change = MB_YES;
-		    }
-		else if (iafter > iping)
-		    {
-		    ping[iping].draft = ping[iafter].draft;
-		    }
-		}
-	    }
-
-	/* recalculate speed-made-good and course-made-good */
-	if (timelonlat_change == MB_YES)
-		for (i=0;i<nbuff;i++)
-			mbnavedit_get_smgcmg(i);
-
-	/* recalculate model */
-	if (speedheading_change == MB_YES
-		&& model_mode == MODEL_MODE_DR)
-		mbnavedit_get_model();
-	}
-	/* if no data then set failure flag */
-	else
-	status = MB_FAILURE;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbnavedit_action_interpolaterepeats()
-{
-	/* local variables */
-	char	*function_name = "mbnavedit_action_interpolaterepeats";
-	int	status = MB_SUCCESS;
-	int	iping;
-	int	ibefore, iafter;
-	int	timelonlat_change;
-	int	speedheading_change;
-	int	found;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
-
-	/* don't try to do anything if no data */
-	if (nplot > 0)
-	{
-	/* look for position or time changes */
-	timelonlat_change = MB_NO;
-	speedheading_change = MB_NO;
-
-	/* do expected time */
-	for (iping=1;iping<nbuff-1;iping++)
-	    {
-	    if (ping[iping].tint_select == MB_YES
-	    	&& ping[iping].time_d == ping[iping-1].time_d)
-	    	{
-		/* find next changed value */
-		found = MB_NO;
-		ibefore = iping - 1;
-		for (j=iping+1;j<nbuff && found == MB_NO;j++)
-			{
-			if (ping[iping].time_d != ping[j].time_d)
-				{
-				found = MB_YES;
-				iafter = j;
-				}
-			}
-		for (j=iping;j<iafter;j++)
-			{
-			if (ping[j].tint_select == MB_YES)
-				{
-				ping[j].time_d = ping[ibefore].time_d
-				    + (ping[iafter].time_d - ping[ibefore].time_d)
-				    * ((double)(iping - ibefore))
-			    		/ ((double)(iafter - ibefore));
-				timelonlat_change = MB_YES;
-				}
-			}
-		}
-	    }
-
-	/* do longitude */
-	for (iping=1;iping<nbuff-1;iping++)
-	    {
-	    if (ping[iping].lon_select == MB_YES
-	    	&& ping[iping].lon == ping[iping-1].lon)
-	    	{
-		/* find next changed value */
-		found = MB_NO;
-		ibefore = iping - 1;
-		for (j=iping+1;j<nbuff && found == MB_NO;j++)
-			{
-			if (ping[iping].lon != ping[j].lon)
-				{
-				found = MB_YES;
-				iafter = j;
-				}
-			}
-		for (j=iping;j<iafter;j++)
-			{
-			if (ping[j].lon_select == MB_YES)
-				{
-				ping[j].lon = ping[ibefore].lon
-				    + (ping[iafter].lon - ping[ibefore].lon)
-				    *(ping[j].time_d - ping[ibefore].time_d)
-				    /(ping[iafter].time_d - ping[ibefore].time_d);
-				timelonlat_change = MB_YES;
-				}
-			}
-		}
-	    }
-
-	/* do latitude */
-	for (iping=1;iping<nbuff-1;iping++)
-	    {
-	    if (ping[iping].lat_select == MB_YES
-	    	&& ping[iping].lat == ping[iping-1].lat)
-	    	{
-		/* find next changed value */
-		found = MB_NO;
-		ibefore = iping - 1;
-		for (j=iping+1;j<nbuff && found == MB_NO;j++)
-			{
-			if (ping[iping].lat != ping[j].lat)
-				{
-				found = MB_YES;
-				iafter = j;
-				}
-			}
-		for (j=iping;j<iafter;j++)
-			{
-			if (ping[j].lat_select == MB_YES)
-				{
-				ping[j].lat = ping[ibefore].lat
-				    + (ping[iafter].lat - ping[ibefore].lat)
-				    *(ping[j].time_d - ping[ibefore].time_d)
-				    /(ping[iafter].time_d - ping[ibefore].time_d);
-				timelonlat_change = MB_YES;
-				}
-			}
-		}
-	    }
-
-	/* do speed */
-	for (iping=1;iping<nbuff-1;iping++)
-	    {
-	    if (ping[iping].speed_select == MB_YES
-	    	&& ping[iping].speed == ping[iping-1].speed)
-	    	{
-		/* find next changed value */
-		found = MB_NO;
-		ibefore = iping - 1;
-		for (j=iping+1;j<nbuff && found == MB_NO;j++)
-			{
-			if (ping[iping].speed != ping[j].speed)
-				{
-				found = MB_YES;
-				iafter = j;
-				}
-			}
-		for (j=iping;j<iafter;j++)
-			{
-			if (ping[j].speed_select == MB_YES)
-				{
-				ping[j].speed = ping[ibefore].speed
-				    + (ping[iafter].speed - ping[ibefore].speed)
-				    *(ping[j].time_d - ping[ibefore].time_d)
-				    /(ping[iafter].time_d - ping[ibefore].time_d);
-				speedheading_change = MB_YES;
-				}
-			}
-		}
-	    }
-
-	/* do heading */
-	for (iping=1;iping<nbuff-1;iping++)
-	    {
-	    if (ping[iping].heading_select == MB_YES
-	    	&& ping[iping].heading == ping[iping-1].heading)
-	    	{
-		/* find next changed value */
-		found = MB_NO;
-		ibefore = iping - 1;
-		for (j=iping+1;j<nbuff && found == MB_NO;j++)
-			{
-			if (ping[iping].heading != ping[j].heading)
-				{
-				found = MB_YES;
-				iafter = j;
-				}
-			}
-		for (j=iping;j<iafter;j++)
-			{
-			if (ping[j].heading_select == MB_YES)
-				{
-				ping[j].heading = ping[ibefore].heading
-				    + (ping[iafter].heading - ping[ibefore].heading)
-				    *(ping[j].time_d - ping[ibefore].time_d)
-				    /(ping[iafter].time_d - ping[ibefore].time_d);
-				speedheading_change = MB_YES;
-				}
-			}
-		}
-	    }
-
-	/* do draft */
-	for (iping=1;iping<nbuff-1;iping++)
-	    {
-	    if (ping[iping].draft_select == MB_YES
-	    	&& ping[iping].draft == ping[iping-1].draft)
-	    	{
-		/* find next changed value */
-		found = MB_NO;
-		ibefore = iping - 1;
-		for (j=iping+1;j<nbuff && found == MB_NO;j++)
-			{
-			if (ping[iping].draft != ping[j].draft)
-				{
-				found = MB_YES;
-				iafter = j;
-				}
-			}
-		for (j=iping;j<iafter;j++)
-			{
-			if (ping[j].draft_select == MB_YES)
-				{
-				ping[j].draft = ping[ibefore].draft
-				    + (ping[iafter].draft - ping[ibefore].draft)
-				    *(ping[j].time_d - ping[ibefore].time_d)
-				    /(ping[iafter].time_d - ping[ibefore].time_d);
-				timelonlat_change = MB_YES;
-				}
-			}
-		}
-	    }
-
-	/* recalculate speed-made-good and course-made-good */
-	if (timelonlat_change == MB_YES)
-		for (i=0;i<nbuff;i++)
-			mbnavedit_get_smgcmg(i);
-
-	/* recalculate model */
-	if (speedheading_change == MB_YES
-		&& model_mode == MODEL_MODE_DR)
-		mbnavedit_get_model();
-	}
-	/* if no data then set failure flag */
-	else
-	status = MB_FAILURE;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbnavedit_action_revert()
-{
-	/* local variables */
-	char	*function_name = "mbnavedit_action_revert";
-	int	status = MB_SUCCESS;
-	int	iplot;
-	int	timelonlat_change;
-	int	speedheading_change;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
-
-	/* don't try to do anything if no data */
-	if (nplot > 0)
-	{
-
-	/* look for position changes */
-	timelonlat_change = MB_NO;
-	speedheading_change = MB_NO;
-
-	/* loop over each of the plots */
-	for (iplot=0;iplot<number_plots;iplot++)
-		{
-		for (i=current_id;i<current_id+nplot;i++)
-			{
-			if (mbnavplot[iplot].type == PLOT_TINT)
-				{
-				if (ping[i].tint_select == MB_YES)
-					{
-					ping[i].time_d = ping[i].time_d_org;
-					ping[i].file_time_d =
-						ping[i].time_d - file_start_time_d;
-					ping[i].tint = ping[i].time_d
-							- ping[i-1].time_d;
-					timelonlat_change = MB_YES;
-					if (i < nbuff - 1)
-					    ping[i+1].tint = ping[i+1].time_d
-							    - ping[i].time_d;
-					status = mb_get_date(verbose, ping[i].time_d, ping[i].time_i);
-					}
-				}
-			else if (mbnavplot[iplot].type == PLOT_LONGITUDE)
-				{
-				if (ping[i].lon_select == MB_YES)
-					{
-					ping[i].lon = ping[i].lon_org;
-					timelonlat_change = MB_YES;
-					}
-				}
-			else if (mbnavplot[iplot].type == PLOT_LATITUDE)
-				{
-				if (ping[i].lat_select == MB_YES)
-					{
-					ping[i].lat = ping[i].lat_org;
-					timelonlat_change = MB_YES;
-					}
-				}
-			else if (mbnavplot[iplot].type == PLOT_SPEED)
-				{
-				if (ping[i].speed_select == MB_YES)
-					{
-					ping[i].speed = ping[i].speed_org;
-					speedheading_change = MB_YES;
-					}
-				}
-			else if (mbnavplot[iplot].type == PLOT_HEADING)
-				{
-				if (ping[i].heading_select == MB_YES)
-					{
-					ping[i].heading = ping[i].heading_org;
-					speedheading_change = MB_YES;
-					}
-				}
-			else if (mbnavplot[iplot].type == PLOT_DRAFT)
-				{
-				if (ping[i].draft_select == MB_YES)
-					{
-					ping[i].draft = ping[i].draft_org;
-					}
-				}
-			}
-		}
-
-	/* recalculate speed-made-good and course-made-good */
-	if (timelonlat_change == MB_YES)
-		for (i=0;i<nbuff;i++)
-			mbnavedit_get_smgcmg(i);
-
-	/* recalculate model */
-	if (speedheading_change == MB_YES
-	    && model_mode == MODEL_MODE_DR)
-		mbnavedit_get_model();
-
-	/* clear the screen */
-	status = mbnavedit_clear_screen();
-
-	/* replot the screen */
-	status = mbnavedit_plot_all();
-
-	}
-	/* if no data then set failure flag */
-	else
-	status = MB_FAILURE;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbnavedit_action_flag()
-{
-	/* local variables */
-	char	*function_name = "mbnavedit_action_flag";
-	int	status = MB_SUCCESS;
-	int	iplot;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
-
-	/* don't try to do anything if no data */
-	if (nplot > 0)
-	{
-
-	/* loop over each of the plots */
-	for (iplot=0;iplot<number_plots;iplot++)
-		{
-		for (i=current_id;i<current_id+nplot;i++)
-			{
-			if (mbnavplot[iplot].type == PLOT_LONGITUDE)
-				{
-				if (ping[i].lon_select == MB_YES)
-					{
-					ping[i].lonlat_flag = MB_YES;
-					}
-				}
-			else if (mbnavplot[iplot].type == PLOT_LATITUDE)
-				{
-				if (ping[i].lat_select == MB_YES)
-					{
-					ping[i].lonlat_flag = MB_YES;
-					}
-				}
-			}
-		}
-
-	/* clear the screen */
-	status = mbnavedit_clear_screen();
-
-	/* replot the screen */
-	status = mbnavedit_plot_all();
-
-	}
-	/* if no data then set failure flag */
-	else
-	status = MB_FAILURE;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbnavedit_action_unflag()
-{
-	/* local variables */
-	char	*function_name = "mbnavedit_action_unflag";
-	int	status = MB_SUCCESS;
-	int	iplot;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
-
-	/* don't try to do anything if no data */
-	if (nplot > 0)
-	{
-
-	/* loop over each of the plots */
-	for (iplot=0;iplot<number_plots;iplot++)
-		{
-		for (i=current_id;i<current_id+nplot;i++)
-			{
-			if (mbnavplot[iplot].type == PLOT_LONGITUDE)
-				{
-				if (ping[i].lon_select == MB_YES)
-					{
-					ping[i].lonlat_flag = MB_NO;
-					}
-				}
-			else if (mbnavplot[iplot].type == PLOT_LATITUDE)
-				{
-				if (ping[i].lat_select == MB_YES)
-					{
-					ping[i].lonlat_flag = MB_NO;
-					}
-				}
-			}
-		}
-
-	/* clear the screen */
-	status = mbnavedit_clear_screen();
-
-	/* replot the screen */
-	status = mbnavedit_plot_all();
-
-	}
-	/* if no data then set failure flag */
-	else
-	status = MB_FAILURE;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbnavedit_action_fixtime()
-{
-	/* local variables */
-	char	*function_name = "mbnavedit_action_fixtime";
-	int	status = MB_SUCCESS;
-	int	istart, iend;
-	double	start_time_d, end_time_d;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
-
-	/* loop over the data */
-	for (i=0;i<nbuff;i++)
-		{
-		if (i == 0)
-			{
-			istart = i;
-			start_time_d = ping[i].time_d;
-			}
-		else if (ping[i].time_d > start_time_d)
-			{
-			iend = i;
-			end_time_d = ping[i].time_d;
-			for (j=istart+1;j<iend;j++)
-				{
-				ping[j].time_d = start_time_d
-				    + (j - istart)
-				    * (end_time_d - start_time_d)
-				    / (iend - istart);
-				mb_get_date(verbose,
-					ping[j].time_d,
-					ping[j].time_i);
-				ping[j].file_time_d =
-					ping[j].time_d - file_start_time_d;
-				if (j>0)
-				ping[j-1].tint = ping[j].time_d
-						- ping[j-1].time_d;
-				if (j<nbuff-1)
-				ping[j].tint = ping[j+1].time_d
-						- ping[j].time_d;
-				}
-			istart = i;
-			start_time_d = ping[i].time_d;
-			}
-
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbnavedit_action_deletebadtime()
-{
-	/* local variables */
-	char	*function_name = "mbnavedit_action_deletebadtime";
-	int	status = MB_SUCCESS;
-	double	lastgood_time_d;
-	int	i, j, nbuffnew;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
-
-	/* loop over the data looking for bad times */
-	lastgood_time_d = ping[0].time_d;
-	for (i=1;i<nbuff;i++)
-		{
-		if ((ping[i].time_d - lastgood_time_d) <= 0.0)
-			{
-			ping[i].id = -1;
-			}
-		else if ((ping[i].time_d - lastgood_time_d) > 60.0)
-			{
-			if (i == nbuff - 1)
-				ping[i].id = -1;
-			else if (ping[i+1].time_d - ping[i].time_d <= 0.0)
-				ping[i].id = -1;
-			else
-				lastgood_time_d = ping[i].time_d;
-			}
-		else if (ping[i].time_d > ping[nbuff-1].time_d)
-			{
-			ping[i].id = -1;
-			}
-		else
-			{
-			lastgood_time_d = ping[i].time_d;
-			}
-		}
-
-	/* loop over the data in reverse deleting data with bad times */
-	nbuffnew = nbuff;
-	for (i=nbuff-1;i>=0;i--)
-		{
-		if (ping[i].id == -1)
-			{
-			for (j=i;j<nbuffnew-1;j++)
-				{
-				ping[j] = ping[j+1];
-				}
-			if (i > 0)
-				ping[i-1].tint = ping[i].time_d
-					- ping[i-1].time_d;
-			if (i == nbuffnew - 2 && i > 0)
-				ping[i].tint = ping[i-1].tint;
-			else if (i == nbuffnew - 2 && i == 0)
-				ping[i].tint = 0.0;
-			nbuffnew--;
-			}
-		}
-fprintf(stderr,"Data deleted: nbuff:%d nbuffnew:%d\n",nbuff,nbuffnew);
-	nbuff = nbuffnew;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbnavedit_action_showall()
-{
-	/* local variables */
-	char	*function_name = "mbnavedit_action_showall";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
-
-	/* reset plotting time span */
-	if (nbuff > 0)
-		{
-		plot_start_time = ping[0].file_time_d;
-		plot_end_time = ping[nbuff-1].file_time_d;
-		data_show_size = 0;
-		current_id = 0;
-		}
-
-	/* replot */
-	status = mbnavedit_plot_all();
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbnavedit_get_smgcmg(int i)
-{
-	/* local variables */
-	char	*function_name = "mbnavedit_get_smgcmg";
-	int	status = MB_SUCCESS;
-	double	time_d1, lon1, lat1;
-	double	time_d2, lon2, lat2;
-	double	mtodeglon, mtodeglat;
-	double	del_time, dx, dy, dist;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       i:          %d\n",i);
-		}
-
-	/* calculate speed made good and course made for ping i */
-	if (i < nbuff)
-		{
-		if (i == 0)
-			{
-			time_d1 = ping[i].time_d;
-			lon1 = ping[i].lon;
-			lat1 = ping[i].lat;
-			time_d2 = ping[i+1].time_d;
-			lon2 = ping[i+1].lon;
-			lat2 = ping[i+1].lat;
-			}
-		else if (i == nbuff - 1)
-			{
-			time_d1 = ping[i-1].time_d;
-			lon1 = ping[i-1].lon;
-			lat1 = ping[i-1].lat;
-			time_d2 = ping[i].time_d;
-			lon2 = ping[i].lon;
-			lat2 = ping[i].lat;
-			}
-		else
-			{
-			time_d1 = ping[i-1].time_d;
-			lon1 = ping[i-1].lon;
-			lat1 = ping[i-1].lat;
-			time_d2 = ping[i].time_d;
-			lon2 = ping[i].lon;
-			lat2 = ping[i].lat;
-			}
-		mb_coor_scale(verbose,lat1,&mtodeglon,&mtodeglat);
-		del_time = time_d2 - time_d1;
-		dx = (lon2 - lon1)/mtodeglon;
-		dy = (lat2 - lat1)/mtodeglat;
-		dist = sqrt(dx*dx + dy*dy);
-		if (del_time > 0.0)
-			ping[i].speed_made_good = 3.6*dist/del_time;
-		else
-			ping[i].speed_made_good = 0.0;
-		if (dist > 0.0)
-			ping[i].course_made_good = RTD*atan2(dx/dist,dy/dist);
-		else
-			ping[i].course_made_good = ping[i].heading;
-		if (ping[i].course_made_good < 0.0)
-			ping[i].course_made_good =
-				ping[i].course_made_good
-				+ 360.0;
-
-		status = MB_SUCCESS;
-		}
-	else
-		status = MB_FAILURE;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbnavedit_get_model()
-{
-	/* local variables */
-	char	*function_name = "mbnavedit_get_model";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		}
-
-	/* only model if data available */
-	if (nbuff > 0)
-	    {
-	    /* call correct modeling function */
-	    if (model_mode == MODEL_MODE_MEAN)
-		mbnavedit_get_gaussianmean();
-	    else if (model_mode == MODEL_MODE_DR)
-		mbnavedit_get_dr();
-	    else if (model_mode == MODEL_MODE_INVERT)
-		mbnavedit_get_inversion();
-	    }
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbnavedit_get_gaussianmean()
-{
-	/* local variables */
-	char	*function_name = "mbnavedit_get_gaussianmean";
-	int	status = MB_SUCCESS;
-	double	timewindow;
-	double	sumlon, sumlat, w, weight;
-	double	dt, a;
-	int	jstart, nsum, npos, nneg;
-	int	jbefore, jafter;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		}
-
-	/* loop over navigation calculating gaussian mean positions */
-	timewindow = 0.1 * mean_time_window;
-	a = -4.0 / (timewindow * timewindow);
-	jstart = 0;
-	for (i=0;i<nbuff;i++)
-		{
-		dt = 0.0;
-		weight = 0.0;
-		sumlon = 0.0;
-		sumlat = 0.0;
-		nsum = 0;
-		npos = 0;
-		nneg = 0;
-		for (j=jstart;j<nbuff && dt<=timewindow;j++)
-			{
-			dt = ping[j].time_d - ping[i].time_d;
-			if (ping[j].lonlat_flag == MB_NO
-				&& fabs(dt) <= timewindow)
-				{
-				w = exp(a * dt * dt);
-				nsum++;
-				if (dt < 0.0) nneg++;
-				if (dt >= 0.0) npos++;
-				weight += w;
-				sumlon += w * ping[j].lon;
-				sumlat += w * ping[j].lat;
-				if (nsum == 1)
-					jstart = j;
-				}
-			}
-		if (npos > 0 && nneg > 0)
-			{
-			ping[i].mean_ok = MB_YES;
-			ping[i].lon_dr = sumlon / weight;
-			ping[i].lat_dr = sumlat / weight;
-			}
-		else
-			{
-			ping[i].mean_ok = MB_NO;
-			ping[i].lon_dr = ping[i].lon;
-			ping[i].lat_dr = ping[i].lat;
-			}
-		}
-
-	/* loop over navigation performing linear interpolation to fill gaps */
-	jbefore = -1;
-	for (i=0;i<nbuff;i++)
-		{
-		/* only work on nav not smoothed in first past due to lack of nearby data */
-		if (ping[i].mean_ok == MB_NO)
-			{
-			/* find valid points before and after */
-			jafter = i;
-			for (j=jbefore;j<nbuff && jafter == i;j++)
-				{
-				if (j < i && ping[j].lonlat_flag == MB_NO)
-					jbefore = j;
-				if (j > i && ping[j].lonlat_flag == MB_NO)
-					jafter = j;
-				}
-			if (jbefore >= 0 && jafter > i)
-				{
-				dt = (ping[i].time_d - ping[jbefore].time_d)
-					/ (ping[jafter].time_d - ping[jbefore].time_d);
-				ping[i].lon_dr = ping[jbefore].lon + dt
-							* (ping[jafter].lon - ping[jbefore].lon);
-				ping[i].lat_dr = ping[jbefore].lat + dt
-							* (ping[jafter].lat - ping[jbefore].lat);
-				}
-			else if (jbefore >= 0)
-				{
-				ping[i].lon_dr = ping[jbefore].lon;
-				ping[i].lat_dr = ping[jbefore].lat;
-				}
-			else if (jafter > i)
-				{
-				ping[i].lon_dr = ping[jafter].lon;
-				ping[i].lat_dr = ping[jafter].lat;
-				}
-			else
-				{
-				ping[i].lon_dr = ping[i].lon;
-				ping[i].lat_dr = ping[i].lat;
-				}
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbnavedit_get_dr()
-{
-	/* local variables */
-	char	*function_name = "mbnavedit_get_dr";
-	int	status = MB_SUCCESS;
-	double	mtodeglon, mtodeglat;
-	double	del_time, dx, dy;
-	double	driftlon, driftlat;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		}
-
-	/* calculate dead reckoning */
-	driftlon = 0.00001 * drift_lon;
-	driftlat = 0.00001 * drift_lat;
-	for (i=0;i<nbuff;i++)
-		{
-		if (i == 0)
-			{
-			ping[i].lon_dr = ping[i].lon;
-			ping[i].lat_dr = ping[i].lat;
-			}
-		else
-			{
-			del_time = ping[i].time_d - ping[i-1].time_d;
-			if (del_time < 300.0)
-			    {
-			    mb_coor_scale(verbose,ping[i].lat,&mtodeglon,&mtodeglat);
-			    dx = sin(DTR * ping[i].heading) * ping[i].speed * del_time / 3.6;
-			    dy = cos(DTR * ping[i].heading) * ping[i].speed * del_time / 3.6;
-			    ping[i].lon_dr = ping[i-1].lon_dr + dx * mtodeglon + del_time * driftlon / 3600.0;
-			    ping[i].lat_dr = ping[i-1].lat_dr + dy * mtodeglat + del_time * driftlat / 3600.0;
-			    }
-			else
-			    {
-			    ping[i].lon_dr = ping[i].lon;
-			    ping[i].lat_dr = ping[i].lat;
-			    }
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbnavedit_get_inversion()
-{
-	/* local variables */
-	char	*function_name = "mbnavedit_get_inversion";
-	int	status = MB_SUCCESS;
-	int	nnz;
-	int	nrows;
-	int	ncols;
-	double	*a;
-	int	*ia;
-	int	*nia;
-	int	*nx;
-	double	*x;
-	double	*dx;
-	double	*d;
-	double	*sigma;
-	double	*work;
-	int	ncyc, nsig;
-	double	smax, sup, err, supt, slo, errlsq;
-	int	ncycle;
-	double	bandwidth;
-	int	nr, nc;
-	int	nlon_avg, nlat_avg;
-	double	lon_avg, lat_avg;
-	double	mtodeglon, mtodeglat;
-	double	dtime_d, dtime_d_sq;
-	char	string[MB_PATH_MAXLINE];
-	int	first, last;
-	int	i, ii, j, k;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		}
-
-	/* set maximum dimensions of the inverse problem */
-	nrows = nplot + (nplot - 1) + (nplot - 2);
-	ncols = nplot;
-	nnz = 3;
-	ncycle = 512;
-	bandwidth = 10000.0;
-
-	/* get average lon value */
-	lon_avg = 0.0;
-	nlon_avg = 0;
-	lat_avg = 0.0;
-	nlat_avg = 0;
-	first = current_id;
-	last = current_id;
-	for (i=current_id;i<current_id+nplot;i++)
-		{
-		/* constrain lon unless flagged by user */
-		if (ping[i].lonlat_flag == MB_NO)
-			{
-			lon_avg += ping[i].lon;
-			nlon_avg++;
-			lat_avg += ping[i].lat;
-			nlat_avg++;
-			last = i;
-			}
-		else if (first == i && i < current_id+nplot-1)
-			{
-			first = i + 1;
-			}
-		}
-	if (nlon_avg > 0)
-		lon_avg /= nlon_avg;
-	if (nlat_avg > 0)
-		lat_avg /= nlat_avg;
-
-	mb_coor_scale(verbose, lat_avg,
-			&mtodeglon, &mtodeglat);
-
-	/* allocate space for the inverse problem */
-	status = mb_mallocd(verbose, __FILE__, __LINE__, nnz * nrows * sizeof(double), (void **)&a,&error);
-	status = mb_mallocd(verbose, __FILE__, __LINE__, nnz * nrows * sizeof(int), (void **)&ia,&error);
-	status = mb_mallocd(verbose, __FILE__, __LINE__, nrows * sizeof(int), (void **)&nia,&error);
-	status = mb_mallocd(verbose, __FILE__, __LINE__, nrows * sizeof(double), (void **)&d,&error);
-	status = mb_mallocd(verbose, __FILE__, __LINE__, ncols * sizeof(double), (void **)&x,&error);
-	status = mb_mallocd(verbose, __FILE__, __LINE__, ncols * sizeof(int), (void **)&nx,&error);
-	status = mb_mallocd(verbose, __FILE__, __LINE__, ncols * sizeof(double), (void **)&dx,&error);
-	status = mb_mallocd(verbose, __FILE__, __LINE__, ncycle * sizeof(double), (void **)&sigma,&error);
-	status = mb_mallocd(verbose, __FILE__, __LINE__, ncycle * sizeof(double), (void **)&work,&error);
-
-	/* do inversion */
-	if (error == MB_ERROR_NO_ERROR)
-	    {
-	    /* set message */
-	    sprintf(string,"Setting up inversion of %d longitude points",
-		    nplot);
-	    do_message_on(string);
-
-	    /* initialize arrays */
-	    for (i=0;i<nrows;i++)
-		{
-		nia[i] = 0;
-		d[i] = 0.0;
-		for (j=0;j<nnz;j++)
-		    {
-		    k = nnz * i + j;
-		    ia[k] = 0;
-		    a[k] = 0.0;
-		    }
-		}
-	    for (i=0;i<ncols;i++)
-		{
-		nx[i] = 0;
-		x[i] = 0;
-		dx[i] = 0.0;
-		}
-	    for (i=0;i<ncycle;i++)
-		{
-		sigma[i] = 0;
-		work[i] = 0.0;
-		}
-
-	    /* loop over all nav points - add constraints for
-	       original lon values, speed, acceleration */
-	    nr = 0;
-	    nc = nplot;
-	    for (i=current_id;i<current_id+nplot;i++)
-		    {
-			ii = i - current_id;
-
-		    /* constrain lon unless flagged by user */
-		    if (ping[i].lonlat_flag == MB_NO)
-				{
-				k = nnz * nr;
-				d[nr] = (ping[i].lon_org - lon_avg) / mtodeglon;
-				nia[nr] = 1;
-				ia[k] = ii;
-				a[k] = 1.0;
-				nr++;
-				}
-
-		    /* constrain speed */
-		    if (weight_speed > 0.0
-			&& ii > 0 && ping[i].time_d > ping[i-1].time_d)
-				{
-				/* get time difference */
-				dtime_d = ping[i].time_d - ping[i-1].time_d;
-
-				/* constrain lon speed */
-				k = nnz * nr;
-				d[nr] = 0.0;
-				nia[nr] = 2;
-				ia[k] = ii - 1;
-				a[k] = -weight_speed / dtime_d;
-				ia[k+1] = ii;
-				a[k+1] = weight_speed / dtime_d;
-				nr++;
-				}
-
-		    /* constrain acceleration */
-		    if (weight_acceleration > 0.0
-				&& ii > 0 && ii < nplot - 1
-				&& ping[i+1].time_d > ping[i-1].time_d)
-				{
-				/* get time difference */
-				dtime_d = ping[i+1].time_d - ping[i-1].time_d;
-				dtime_d_sq = dtime_d * dtime_d;
-
-				/* constrain lon acceleration */
-				k = nnz * nr;
-				d[nr] = 0.0;
-				nia[nr] = 3;
-				ia[k] = ii - 1;
-				a[k] = weight_acceleration / dtime_d_sq;
-				ia[k+1] = ii;
-				a[k+1] = -2.0 * weight_acceleration / dtime_d_sq;
-				ia[k+2] = ii + 1;
-				a[k+2] = weight_acceleration / dtime_d_sq;
-				nr++;
-				}
-		    }
-
-	    /* set message */
-	    sprintf(string,"Inverting %dX%d for smooth longitude...",
-		    nc, nr);
-	    do_message_on(string);
-
-	    /* compute upper bound on maximum eigenvalue */
-	    ncyc = 0;
-	    nsig = 0;
-	    lspeig(a, ia, nia, nnz, nc, nr, ncyc,
-		    &nsig, x, dx, sigma, work, &smax, &err, &sup);
-	    supt = smax + err;
-	    if (sup > supt)
-		supt = sup;
-	    if (verbose > 1)
-	    fprintf(stderr, "Initial lspeig: %g %g %g %g\n",
-		sup, smax, err, supt);
-	    ncyc = 16;
-	    for (i=0;i<4;i++)
-		{
-		lspeig(a, ia, nia, nnz, nc, nr, ncyc,
-			&nsig, x, dx, sigma, work, &smax, &err, &sup);
-		supt = smax + err;
-		if (sup > supt)
-		    supt = sup;
-		if (verbose > 1)
-		fprintf(stderr, "lspeig[%d]: %g %g %g %g\n",
-		    i, sup, smax, err, supt);
-		}
-
-	    /* calculate chebyshev factors (errlsq is the theoretical error) */
-	    slo = supt / bandwidth;
-	    chebyu(sigma, ncycle, supt, slo, work);
-	    errlsq = errlim(sigma, ncycle, supt, slo);
-	    if (verbose > 1)
-	    fprintf(stderr, "Theoretical error: %f\n", errlsq);
-	    if (verbose > 1)
-	    for (i=0;i<ncycle;i++)
-		fprintf(stderr, "sigma[%d]: %f\n", i, sigma[i]);
-
-	    /* solve the problem */
-	    for (i=0;i<nc;i++)
-		x[i] = 0.0;
-	    lsqup(a, ia, nia, nnz, nc, nr, x, dx, d, 0, NULL, NULL, ncycle, sigma);
-
-	    /* generate solution */
-	    for (i=current_id;i<current_id+nplot;i++)
-		{
-		ii = i - current_id;
-		ping[i].lon_dr = lon_avg + mtodeglon * x[ii];
-		}
-
-	    /* make flagged ends of data flat */
-	    for (i=current_id;i<first;i++)
-		{
-		ii = first - current_id;
-		ping[i].lon_dr = lon_avg + mtodeglon * x[ii];
-		}
-	    for (i=last+1;i<current_id+nplot;i++)
-		{
-		ii = last - current_id;
-		ping[i].lon_dr = lon_avg + mtodeglon * x[ii];
-		}
-
-	    /* set message */
-	    sprintf(string,"Setting up inversion of %d latitude points",
-		    nplot);
-	    do_message_on(string);
-
-	    /* initialize arrays */
-	    for (i=0;i<nrows;i++)
-		{
-		nia[i] = 0;
-		d[i] = 0.0;
-		for (j=0;j<nnz;j++)
-		    {
-		    k = nnz * i + j;
-		    ia[k] = 0;
-		    a[k] = 0.0;
-		    }
-		}
-	    for (i=0;i<ncols;i++)
-		{
-		nx[i] = 0;
-		x[i] = 0;
-		dx[i] = 0.0;
-		}
-	    for (i=0;i<ncycle;i++)
-		{
-		sigma[i] = 0;
-		work[i] = 0.0;
-		}
-
-	    /* loop over all nav points - add constraints for
-	       original lat values, speed, acceleration */
-	    nr = 0;
-	    nc = nplot;
-	    for (i=current_id;i<current_id+nplot;i++)
-		    {
-			ii = i - current_id;
-
-		    /* constrain lat unless flagged by user */
-		    if (ping[i].lonlat_flag == MB_NO)
-				{
-				k = nnz * nr;
-				d[nr] = (ping[i].lat_org - lat_avg) / mtodeglat;
-				nia[nr] = 1;
-				ia[k] = ii;
-				a[k] = 1.0;
-				nr++;
-				}
-
-		    /* constrain speed */
-		    if (weight_speed > 0.0
-			&& ii > 0 && ping[i].time_d > ping[i-1].time_d)
-				{
-				/* get time difference */
-				dtime_d = ping[i].time_d - ping[i-1].time_d;
-
-				/* constrain lat speed */
-				k = nnz * nr;
-				d[nr] = 0.0;
-				nia[nr] = 2;
-				ia[k] = ii - 1;
-				a[k] = -weight_speed / dtime_d;
-				ia[k+1] = ii;
-				a[k+1] = weight_speed / dtime_d;
-				nr++;
-				}
-
-		    /* constrain acceleration */
-		    if (weight_acceleration > 0.0
-			&& ii > 0 && ii < nplot - 1
-			&& ping[i+1].time_d > ping[i-1].time_d)
-				{
-				/* get time difference */
-				dtime_d = ping[i+1].time_d - ping[i-1].time_d;
-				dtime_d_sq = dtime_d * dtime_d;
-
-				/* constrain lat acceleration */
-				k = nnz * nr;
-				d[nr] = 0.0;
-				nia[nr] = 3;
-				ia[k] = ii - 1;
-				a[k] = weight_acceleration / dtime_d_sq;
-				ia[k+1] = ii;
-				a[k+1] = -2.0 * weight_acceleration / dtime_d_sq;
-				ia[k+2] = ii + 1;
-				a[k+2] = weight_acceleration / dtime_d_sq;
-				nr++;
-				}
-		    }
-
-	    /* set message */
-	    sprintf(string,"Inverting %dX%d for smooth latitude...",
-		    nc, nr);
-	    do_message_on(string);
-
-	    /* compute upper bound on maximum eigenvalue */
-	    ncyc = 0;
-	    nsig = 0;
-	    lspeig(a, ia, nia, nnz, nc, nr, ncyc,
-		    &nsig, x, dx, sigma, work, &smax, &err, &sup);
-	    supt = smax + err;
-	    if (sup > supt)
-		supt = sup;
-	    if (verbose > 1)
-	    fprintf(stderr, "Initial lspeig: %g %g %g %g\n",
-		sup, smax, err, supt);
-	    ncyc = 16;
-	    for (i=0;i<4;i++)
-		{
-		lspeig(a, ia, nia, nnz, nc, nr, ncyc,
-			&nsig, x, dx, sigma, work, &smax, &err, &sup);
-		supt = smax + err;
-		if (sup > supt)
-		    supt = sup;
-		if (verbose > 1)
-		fprintf(stderr, "lspeig[%d]: %g %g %g %g\n",
-		    i, sup, smax, err, supt);
-		}
-
-	    /* calculate chebyshev factors (errlsq is the theoretical error) */
-	    slo = supt / bandwidth;
-	    chebyu(sigma, ncycle, supt, slo, work);
-	    errlsq = errlim(sigma, ncycle, supt, slo);
-	    if (verbose > 1)
-	    fprintf(stderr, "Theoretical error: %f\n", errlsq);
-	    if (verbose > 1)
-	    for (i=0;i<ncycle;i++)
-		fprintf(stderr, "sigma[%d]: %f\n", i, sigma[i]);
-
-	    /* solve the problem */
-	    for (i=0;i<nc;i++)
-		x[i] = 0.0;
-	    lsqup(a, ia, nia, nnz, nc, nr, x, dx, d, 0, NULL, NULL, ncycle, sigma);
-
-	    /* generate solution */
-	    for (i=current_id;i<current_id+nplot;i++)
-		{
-		ii = i - current_id;
-		ping[i].lat_dr = lat_avg + mtodeglat * x[ii];
-		}
-
-	    /* make flagged ends of data flat */
-	    for (i=current_id;i<first;i++)
-		{
-		ii = first - current_id;
-		ping[i].lat_dr = lat_avg + mtodeglat * x[ii];
-		}
-	    for (i=last+1;i<current_id+nplot;i++)
-		{
-		ii = last - current_id;
-		ping[i].lat_dr = lat_avg + mtodeglat * x[ii];
-		}
-
-	    /* deallocate arrays */
-	    status = mb_freed(verbose, __FILE__, __LINE__, (void **) &a,&error);
-	    status = mb_freed(verbose, __FILE__, __LINE__, (void **) &ia,&error);
-	    status = mb_freed(verbose, __FILE__, __LINE__, (void **) &nia,&error);
-	    status = mb_freed(verbose, __FILE__, __LINE__, (void **) &d,&error);
-	    status = mb_freed(verbose, __FILE__, __LINE__, (void **) &x,&error);
-	    status = mb_freed(verbose, __FILE__, __LINE__, (void **) &nx,&error);
-	    status = mb_freed(verbose, __FILE__, __LINE__, (void **) &dx,&error);
-	    status = mb_freed(verbose, __FILE__, __LINE__, (void **) &sigma,&error);
-	    status = mb_freed(verbose, __FILE__, __LINE__, (void **) &work,&error);
-
-	    /* turn message off */
-	    do_message_off();
-	    }
-
-	/* if error initializing memory then don't invert */
-	else if (error != MB_ERROR_NO_ERROR)
-		{
-		mb_error(verbose,error,&message);
-		fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",
-			message);
-		do_error_dialog("Unable to invert for smooth",
-				"navigation due to a memory",
-				"allocation error!");
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbnavedit_plot_all()
-{
-	/* local variables */
-	char	*function_name = "mbnavedit_plot_all";
-	int	status = MB_SUCCESS;
-	double	time_min;
-	double	time_max;
-	double	tint_min;
-	double	tint_max;
-	double	lon_min;
-	double	lon_max;
-	double	lat_min;
-	double	lat_max;
-	double	speed_min;
-	double	speed_max;
-	double	heading_min;
-	double	heading_max;
-	double	draft_min;
-	double	draft_max;
-	double	roll_min;
-	double	roll_max;
-	double	pitch_min;
-	double	pitch_max;
-	double	heave_min;
-	double	heave_max;
-	double	center, range;
-	int	margin_x, margin_y;
-	int	iyzero;
-	int	iplot;
-	int	center_x, center_y;
-	double	dx, x;
-	int	xtime_i[7];
-	int	ix;
-	int	swidth, sascent, sdescent;
-	char	yformat[10];
-	int	i;
-	char	string[MB_PATH_MAXLINE];
-	int	fpx, fpdx, fpy, fpdy;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
-
-	/* figure out which pings to plot */
-	nplot = 0;
-	if (data_show_size > 0 && nbuff > 0)
-		{
-		plot_start_time = ping[current_id].file_time_d;
-		plot_end_time = plot_start_time + data_show_size;
-		for (i=current_id;i<nbuff;i++)
-			if (ping[i].file_time_d <= plot_end_time)
-				nplot++;
-		}
-	else if (nbuff > 0)
-		{
-		plot_start_time = ping[0].file_time_d;
-		plot_end_time = ping[nbuff-1].file_time_d;
-		data_show_size = plot_end_time - plot_start_time + 1;
-		if (data_show_max < data_show_size)
-			data_show_max = data_show_size;
-		nplot = nbuff;
-		}
-
-	/* deselect data outside plots */
-	for (i=0;i<current_id;i++)
-		{
-		ping[i].tint_select = MB_NO;
-		ping[i].lon_select = MB_NO;
-		ping[i].lat_select = MB_NO;
-		ping[i].speed_select = MB_NO;
-		ping[i].heading_select = MB_NO;
-		ping[i].draft_select = MB_NO;
-		}
-	for (i=current_id+nplot;i<nbuff;i++)
-		{
-		ping[i].tint_select = MB_NO;
-		ping[i].lon_select = MB_NO;
-		ping[i].lat_select = MB_NO;
-		ping[i].speed_select = MB_NO;
-		ping[i].heading_select = MB_NO;
-		ping[i].draft_select = MB_NO;
-		}
-
-	/* don't try to plot if no data */
-	if (nplot > 0)
-	{
-
-	/* find min max values */
-	time_min = plot_start_time;
-	time_max = plot_end_time;
-	tint_min = ping[current_id].tint;
-	tint_max = ping[current_id].tint;
-	lon_min = ping[current_id].lon;
-	lon_max = ping[current_id].lon;
-	lat_min = ping[current_id].lat;
-	lat_max = ping[current_id].lat;
-	speed_min = 0.0;
-	speed_max = ping[current_id].speed;
-	heading_min = ping[current_id].heading;
-	heading_max = ping[current_id].heading;
-	draft_min = ping[current_id].draft;
-	draft_max = ping[current_id].draft;
-	roll_min = ping[current_id].roll;
-	roll_max = ping[current_id].roll;
-	pitch_min = ping[current_id].pitch;
-	pitch_max = ping[current_id].pitch;
-	heave_min = ping[current_id].heave;
-	heave_max = ping[current_id].heave;
-	for (i=current_id+1;i<current_id+nplot;i++)
-		{
-		tint_min = MIN(ping[i].tint, tint_min);
-		tint_max = MAX(ping[i].tint, tint_max);
-		if (plot_tint_org == MB_YES)
-			{
-			tint_min = MIN(ping[i].tint_org, tint_min);
-			tint_max = MAX(ping[i].tint_org, tint_max);
-			}
-		lon_min = MIN(ping[i].lon, lon_min);
-		lon_max = MAX(ping[i].lon, lon_max);
-		if (plot_lon_org == MB_YES)
-			{
-			lon_min = MIN(ping[i].lon_org, lon_min);
-			lon_max = MAX(ping[i].lon_org, lon_max);
-			}
-		if (model_mode != MODEL_MODE_OFF
-		    && plot_lon_dr == MB_YES)
-			{
-			lon_min = MIN(ping[i].lon_dr, lon_min);
-			lon_max = MAX(ping[i].lon_dr, lon_max);
-			}
-		lat_min = MIN(ping[i].lat, lat_min);
-		lat_max = MAX(ping[i].lat, lat_max);
-		if (plot_lat_org == MB_YES)
-			{
-			lat_min = MIN(ping[i].lat_org, lat_min);
-			lat_max = MAX(ping[i].lat_org, lat_max);
-			}
-		if (model_mode != MODEL_MODE_OFF
-		    && plot_lat_dr == MB_YES)
-			{
-			lat_min = MIN(ping[i].lat_dr, lat_min);
-			lat_max = MAX(ping[i].lat_dr, lat_max);
-			}
-		speed_min = MIN(ping[i].speed, speed_min);
-		speed_max = MAX(ping[i].speed, speed_max);
-		if (plot_speed_org == MB_YES)
-			{
-			speed_min = MIN(ping[i].speed_org, speed_min);
-			speed_max = MAX(ping[i].speed_org, speed_max);
-			}
-		if (plot_smg == MB_YES)
-			{
-			speed_min = MIN(ping[i].speed_made_good, speed_min);
-			speed_max = MAX(ping[i].speed_made_good, speed_max);
-			}
-		heading_min = MIN(ping[i].heading, heading_min);
-		heading_max = MAX(ping[i].heading, heading_max);
-		if (plot_heading_org == MB_YES)
-			{
-			heading_min = MIN(ping[i].heading_org,
-				heading_min);
-			heading_max = MAX(ping[i].heading_org,
-				heading_max);
-			}
-		if (plot_cmg == MB_YES)
-			{
-			heading_min = MIN(ping[i].course_made_good,
-				heading_min);
-			heading_max = MAX(ping[i].course_made_good,
-				heading_max);
-			}
-		draft_min = MIN(ping[i].draft, draft_min);
-		draft_max = MAX(ping[i].draft, draft_max);
-		if (plot_draft_org == MB_YES)
-			{
-			draft_min = MIN(ping[i].draft_org,
-				draft_min);
-			draft_max = MAX(ping[i].draft_org,
-				draft_max);
-			}
-		roll_min = MIN(ping[i].roll, roll_min);
-		roll_max = MAX(ping[i].roll, roll_max);
-		pitch_min = MIN(ping[i].pitch, pitch_min);
-		pitch_max = MAX(ping[i].pitch, pitch_max);
-		heave_min = MIN(ping[i].heave, heave_min);
-		heave_max = MAX(ping[i].heave, heave_max);
-		}
-
-	/* scale the min max a bit larger so all points fit on plots */
-	center = 0.5*(time_min + time_max);
-	range = 0.51*(time_max - time_min);
-	time_min = center - range;
-	time_max = center + range;
-	center = 0.5*(tint_min + tint_max);
-	range = 0.55*(tint_max - tint_min);
-	tint_min = center - range;
-	tint_max = center + range;
-	center = 0.5*(lon_min + lon_max);
-	range = 0.55*(lon_max - lon_min);
-	lon_min = center - range;
-	lon_max = center + range;
-	center = 0.5*(lat_min + lat_max);
-	range = 0.55*(lat_max - lat_min);
-	lat_min = center - range;
-	lat_max = center + range;
-	if (speed_min < 0.0)
-		{
-		center = 0.5*(speed_min + speed_max);
-		range = 0.55*(speed_max - speed_min);
-		speed_min = center - range;
-		speed_max = center + range;
-		}
-	else
-		speed_max = 1.05*speed_max;
-	center = 0.5*(heading_min + heading_max);
-	range = 0.55*(heading_max - heading_min);
-	heading_min = center - range;
-	heading_max = center + range;
-	center = 0.5*(draft_min + draft_max);
-	range = 0.55*(draft_max - draft_min);
-	draft_min = center - range;
-	draft_max = center + range;
-	roll_max = 1.1*MAX(fabs(roll_min), fabs(roll_max));
-	roll_min = -roll_max;
-	pitch_max = 1.1*MAX(fabs(pitch_min), fabs(pitch_max));
-	pitch_min = -pitch_max;
-	heave_max = 1.1*MAX(fabs(heave_min), fabs(heave_max));
-	heave_min = -heave_max;
-
-	/* make sure lon and lat scaled the same if both plotted */
-	if (plot_lon == MB_YES && plot_lat == MB_YES)
-		{
-		if ((lon_max - lon_min) > (lat_max - lat_min))
-			{
-			center = 0.5*(lat_min + lat_max);
-			lat_min = center - 0.5*(lon_max - lon_min);
-			lat_max = center + 0.5*(lon_max - lon_min);
-			}
-		else
-			{
-			center = 0.5*(lon_min + lon_max);
-			lon_min = center - 0.5*(lat_max - lat_min);
-			lon_max = center + 0.5*(lat_max - lat_min);
-			}
-		}
-
-	/* make sure min max values aren't too small */
-	if ((tint_max - tint_min) < 0.01)
-		{
-		center = 0.5*(tint_min + tint_max);
-		tint_min = center - 0.005;
-		tint_max = center + 0.005;
-		}
-	if ((lon_max - lon_min) < 0.001)
-		{
-		center = 0.5*(lon_min + lon_max);
-		lon_min = center - 0.0005;
-		lon_max = center + 0.0005;
-		}
-	if ((lat_max - lat_min) < 0.001)
-		{
-		center = 0.5*(lat_min + lat_max);
-		lat_min = center - 0.0005;
-		lat_max = center + 0.0005;
-		}
-	if (speed_max < 10.0)
-		speed_max = 10.0;
-	if ((heading_max - heading_min) < 10.0)
-		{
-		center = 0.5*(heading_min + heading_max);
-		heading_min = center - 5;
-		heading_max = center + 5;
-		}
-	if ((draft_max - draft_min) < 0.5)
-		{
-		center = 0.5*(draft_min + draft_max);
-		draft_min = center - 0.25;
-		draft_max = center + 0.25;
-		}
-	if ((roll_max - roll_min) < 2.0)
-		{
-		center = 0.5*(roll_min + roll_max);
-		roll_min = center - 1;
-		roll_max = center + 1;
-		}
-	if ((pitch_max - pitch_min) < 2.0)
-		{
-		center = 0.5*(pitch_min + pitch_max);
-		pitch_min = center - 1;
-		pitch_max = center + 1;
-		}
-	if ((heave_max - heave_min) < 0.02)
-		{
-		center = 0.5*(heave_min + heave_max);
-		heave_min = center - 0.01;
-		heave_max = center + 0.01;
-		}
-
-	/* print out information */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\n%d data records set for plotting (%d desired)\n",
-			nplot,data_show_size);
-		for (i=current_id;i<current_id+nplot;i++)
-			fprintf(stderr,"dbg5       %4d %4d %4d  %d/%d/%d %2.2d:%2.2d:%2.2d.%6.6d  %11.6f  %11.6f  %11.6f  %11.6f %11.6f %5.2f %5.1f %5.1f %5.1f %5.1f %5.1f\n",
-				i,ping[i].id,ping[i].record,
-				ping[i].time_i[1],ping[i].time_i[2],
-				ping[i].time_i[0],ping[i].time_i[3],
-				ping[i].time_i[4],ping[i].time_i[5],
-				ping[i].time_i[6],ping[i].time_d,
-				ping[i].file_time_d,ping[i].tint,
-				ping[i].lon, ping[i].lat,
-				ping[i].speed, ping[i].heading, ping[i].draft,
-				ping[i].roll, ping[i].pitch,
-				ping[i].heave);
-		}
-
-	/* get plot margins */
-	margin_x = plot_width/10;
-	margin_y = plot_height/6;
-
-	/* get date at start of file */
-	mb_get_date(verbose, file_start_time_d + plot_start_time, xtime_i);
-
-	/* figure out how many plots to make */
-	number_plots = 0;
-	if (plot_tint == MB_YES)
-		{
-		mbnavplot[number_plots].type = PLOT_TINT;
-		mbnavplot[number_plots].ixmin = 1.25*margin_x;
-		mbnavplot[number_plots].ixmax = plot_width - margin_x/2;
-		mbnavplot[number_plots].iymin = plot_height - margin_y
-			+ number_plots*plot_height;
-		mbnavplot[number_plots].iymax = number_plots*plot_height
-			+ margin_y;
-		mbnavplot[number_plots].xmin = time_min;
-		mbnavplot[number_plots].xmax = time_max;
-		mbnavplot[number_plots].ymin = tint_min;
-		mbnavplot[number_plots].ymax = tint_max;
-		mbnavplot[number_plots].xscale =
-			(mbnavplot[number_plots].ixmax
-			- mbnavplot[number_plots].ixmin)
-			/(mbnavplot[number_plots].xmax
-			- mbnavplot[number_plots].xmin);
-		mbnavplot[number_plots].yscale =
-			(mbnavplot[number_plots].iymax
-			- mbnavplot[number_plots].iymin)
-			/(mbnavplot[number_plots].ymax
-			- mbnavplot[number_plots].ymin);
-		mbnavplot[number_plots].xinterval = 100.0;
-		mbnavplot[number_plots].yinterval = 5.0;
-		sprintf(mbnavplot[number_plots].xlabel,
-			"Time (HH:MM:SS.SSS) beginning on %2.2d/%2.2d/%4.4d",
-			xtime_i[1], xtime_i[2], xtime_i[0]);
-		sprintf(mbnavplot[number_plots].ylabel1,
-			"dT");
-		sprintf(mbnavplot[number_plots].ylabel2,
-			"(seconds)");
-		number_plots++;
-		}
-	if (plot_lon == MB_YES)
-		{
-		mbnavplot[number_plots].type = PLOT_LONGITUDE;
-		mbnavplot[number_plots].ixmin = 1.25*margin_x;
-		mbnavplot[number_plots].ixmax = plot_width - margin_x/2;
-		mbnavplot[number_plots].iymin = plot_height - margin_y
-			+ number_plots*plot_height;
-		mbnavplot[number_plots].iymax = number_plots*plot_height
-			+ margin_y;
-		mbnavplot[number_plots].xmin = time_min;
-		mbnavplot[number_plots].xmax = time_max;
-		mbnavplot[number_plots].ymin = lon_min;
-		mbnavplot[number_plots].ymax = lon_max;
-		mbnavplot[number_plots].xscale =
-			(mbnavplot[number_plots].ixmax
-			- mbnavplot[number_plots].ixmin)
-			/(mbnavplot[number_plots].xmax
-			- mbnavplot[number_plots].xmin);
-		mbnavplot[number_plots].yscale =
-			(mbnavplot[number_plots].iymax
-			- mbnavplot[number_plots].iymin)
-			/(mbnavplot[number_plots].ymax
-			- mbnavplot[number_plots].ymin);
-		mbnavplot[number_plots].xinterval = 100.0;
-		mbnavplot[number_plots].yinterval = 45.0;
-		sprintf(mbnavplot[number_plots].xlabel,
-			"Time (HH:MM:SS.SSS) beginning on %2.2d/%2.2d/%4.4d",
-			xtime_i[1], xtime_i[2], xtime_i[0]);
-		sprintf(mbnavplot[number_plots].ylabel1,
-			"Longitude");
-		sprintf(mbnavplot[number_plots].ylabel2,
-			"(degrees)");
-		number_plots++;
-		}
-	if (plot_lat == MB_YES)
-		{
-		mbnavplot[number_plots].type = PLOT_LATITUDE;
-		mbnavplot[number_plots].ixmin = 1.25*margin_x;
-		mbnavplot[number_plots].ixmax = plot_width - margin_x/2;
-		mbnavplot[number_plots].iymin = plot_height - margin_y
-			+ number_plots*plot_height;
-		mbnavplot[number_plots].iymax = number_plots*plot_height
-			+ margin_y;
-		mbnavplot[number_plots].xmin = time_min;
-		mbnavplot[number_plots].xmax = time_max;
-		mbnavplot[number_plots].ymin = lat_min;
-		mbnavplot[number_plots].ymax = lat_max;
-		mbnavplot[number_plots].xscale =
-			(mbnavplot[number_plots].ixmax
-			- mbnavplot[number_plots].ixmin)
-			/(mbnavplot[number_plots].xmax
-			- mbnavplot[number_plots].xmin);
-		mbnavplot[number_plots].yscale =
-			(mbnavplot[number_plots].iymax
-			- mbnavplot[number_plots].iymin)
-			/(mbnavplot[number_plots].ymax
-			- mbnavplot[number_plots].ymin);
-		mbnavplot[number_plots].xinterval = 100.0;
-		mbnavplot[number_plots].yinterval = 45.0;
-		sprintf(mbnavplot[number_plots].xlabel,
-			"Time (HH:MM:SS.SSS) beginning on %2.2d/%2.2d/%4.4d",
-			xtime_i[1], xtime_i[2], xtime_i[0]);
-		sprintf(mbnavplot[number_plots].ylabel1,
-			"Latitude");
-		sprintf(mbnavplot[number_plots].ylabel2,
-			"(degrees)");
-		number_plots++;
-		}
-	if (plot_speed == MB_YES)
-		{
-		mbnavplot[number_plots].type = PLOT_SPEED;
-		mbnavplot[number_plots].ixmin = 1.25*margin_x;
-		mbnavplot[number_plots].ixmax = plot_width - margin_x/2;
-		mbnavplot[number_plots].iymin = plot_height - margin_y
-			+ number_plots*plot_height;
-		mbnavplot[number_plots].iymax = number_plots*plot_height
-			+ margin_y;
-		mbnavplot[number_plots].xmin = time_min;
-		mbnavplot[number_plots].xmax = time_max;
-		mbnavplot[number_plots].ymin = speed_min;
-		mbnavplot[number_plots].ymax = speed_max;
-		mbnavplot[number_plots].xscale =
-			(mbnavplot[number_plots].ixmax
-			- mbnavplot[number_plots].ixmin)
-			/(mbnavplot[number_plots].xmax
-			- mbnavplot[number_plots].xmin);
-		mbnavplot[number_plots].yscale =
-			(mbnavplot[number_plots].iymax
-			- mbnavplot[number_plots].iymin)
-			/(mbnavplot[number_plots].ymax
-			- mbnavplot[number_plots].ymin);
-		mbnavplot[number_plots].xinterval = 100.0;
-		mbnavplot[number_plots].yinterval = 10;
-		sprintf(mbnavplot[number_plots].xlabel,
-			"Time (HH:MM:SS.SSS) beginning on %2.2d/%2.2d/%4.4d",
-			xtime_i[1], xtime_i[2], xtime_i[0]);
-		sprintf(mbnavplot[number_plots].ylabel1,
-			"Speed");
-		sprintf(mbnavplot[number_plots].ylabel2,
-			"(km/hr)");
-		number_plots++;
-		}
-	if (plot_heading == MB_YES)
-		{
-		mbnavplot[number_plots].type = PLOT_HEADING;
-		mbnavplot[number_plots].ixmin = 1.25*margin_x;
-		mbnavplot[number_plots].ixmax = plot_width - margin_x/2;
-		mbnavplot[number_plots].iymin = plot_height - margin_y
-			+ number_plots*plot_height;
-		mbnavplot[number_plots].iymax = number_plots*plot_height
-			+ margin_y;
-		mbnavplot[number_plots].xmin = time_min;
-		mbnavplot[number_plots].xmax = time_max;
-		mbnavplot[number_plots].ymin = heading_min;
-		mbnavplot[number_plots].ymax = heading_max;
-		mbnavplot[number_plots].xscale =
-			(mbnavplot[number_plots].ixmax
-			- mbnavplot[number_plots].ixmin)
-			/(mbnavplot[number_plots].xmax
-			- mbnavplot[number_plots].xmin);
-		mbnavplot[number_plots].yscale =
-			(mbnavplot[number_plots].iymax
-			- mbnavplot[number_plots].iymin)
-			/(mbnavplot[number_plots].ymax
-			- mbnavplot[number_plots].ymin);
-		mbnavplot[number_plots].xinterval = 100.0;
-		mbnavplot[number_plots].yinterval = 45.0;
-		sprintf(mbnavplot[number_plots].xlabel,
-			"Time (HH:MM:SS.SSS) beginning on %2.2d/%2.2d/%4.4d",
-			xtime_i[1], xtime_i[2], xtime_i[0]);
-		sprintf(mbnavplot[number_plots].ylabel1,
-			"Heading");
-		sprintf(mbnavplot[number_plots].ylabel2,
-			"(degrees)");
-		number_plots++;
-		}
-	if (plot_draft == MB_YES)
-		{
-		mbnavplot[number_plots].type = PLOT_DRAFT;
-		mbnavplot[number_plots].ixmin = 1.25*margin_x;
-		mbnavplot[number_plots].ixmax = plot_width - margin_x/2;
-		mbnavplot[number_plots].iymin = plot_height - margin_y
-			+ number_plots*plot_height;
-		mbnavplot[number_plots].iymax = number_plots*plot_height
-			+ margin_y;
-		mbnavplot[number_plots].xmin = time_min;
-		mbnavplot[number_plots].xmax = time_max;
-		mbnavplot[number_plots].ymin = draft_max;
-		mbnavplot[number_plots].ymax = draft_min;
-		mbnavplot[number_plots].xscale =
-			(mbnavplot[number_plots].ixmax
-			- mbnavplot[number_plots].ixmin)
-			/(mbnavplot[number_plots].xmax
-			- mbnavplot[number_plots].xmin);
-		mbnavplot[number_plots].yscale =
-			(mbnavplot[number_plots].iymax
-			- mbnavplot[number_plots].iymin)
-			/(mbnavplot[number_plots].ymax
-			- mbnavplot[number_plots].ymin);
-		mbnavplot[number_plots].xinterval = 100.0;
-		mbnavplot[number_plots].yinterval = 45.0;
-		sprintf(mbnavplot[number_plots].xlabel,
-			"Time (HH:MM:SS.SSS) beginning on %2.2d/%2.2d/%4.4d",
-			xtime_i[1], xtime_i[2], xtime_i[0]);
-		sprintf(mbnavplot[number_plots].ylabel1,
-			"Sonar Depth");
-		sprintf(mbnavplot[number_plots].ylabel2,
-			"(meters)");
-		number_plots++;
-		}
-	if (plot_roll == MB_YES)
-		{
-		mbnavplot[number_plots].type = PLOT_ROLL;
-		mbnavplot[number_plots].ixmin = 1.25*margin_x;
-		mbnavplot[number_plots].ixmax = plot_width - margin_x/2;
-		mbnavplot[number_plots].iymin = plot_height - margin_y
-			+ number_plots*plot_height;
-		mbnavplot[number_plots].iymax = number_plots*plot_height
-			+ margin_y;
-		mbnavplot[number_plots].xmin = time_min;
-		mbnavplot[number_plots].xmax = time_max;
-		mbnavplot[number_plots].ymin = roll_min;
-		mbnavplot[number_plots].ymax = roll_max;
-		mbnavplot[number_plots].xscale =
-			(mbnavplot[number_plots].ixmax
-			- mbnavplot[number_plots].ixmin)
-			/(mbnavplot[number_plots].xmax
-			- mbnavplot[number_plots].xmin);
-		mbnavplot[number_plots].yscale =
-			(mbnavplot[number_plots].iymax
-			- mbnavplot[number_plots].iymin)
-			/(mbnavplot[number_plots].ymax
-			- mbnavplot[number_plots].ymin);
-		mbnavplot[number_plots].xinterval = 100.0;
-		mbnavplot[number_plots].yinterval = 45.0;
-		sprintf(mbnavplot[number_plots].xlabel,
-			"Time (HH:MM:SS.SSS) beginning on %2.2d/%2.2d/%4.4d",
-			xtime_i[1], xtime_i[2], xtime_i[0]);
-		sprintf(mbnavplot[number_plots].ylabel1,
-			"Roll");
-		sprintf(mbnavplot[number_plots].ylabel2,
-			"(degrees)");
-		number_plots++;
-		}
-	if (plot_pitch == MB_YES)
-		{
-		mbnavplot[number_plots].type = PLOT_PITCH;
-		mbnavplot[number_plots].ixmin = 1.25*margin_x;
-		mbnavplot[number_plots].ixmax = plot_width - margin_x/2;
-		mbnavplot[number_plots].iymin = plot_height - margin_y
-			+ number_plots*plot_height;
-		mbnavplot[number_plots].iymax = number_plots*plot_height
-			+ margin_y;
-		mbnavplot[number_plots].xmin = time_min;
-		mbnavplot[number_plots].xmax = time_max;
-		mbnavplot[number_plots].ymin = pitch_min;
-		mbnavplot[number_plots].ymax = pitch_max;
-		mbnavplot[number_plots].xscale =
-			(mbnavplot[number_plots].ixmax
-			- mbnavplot[number_plots].ixmin)
-			/(mbnavplot[number_plots].xmax
-			- mbnavplot[number_plots].xmin);
-		mbnavplot[number_plots].yscale =
-			(mbnavplot[number_plots].iymax
-			- mbnavplot[number_plots].iymin)
-			/(mbnavplot[number_plots].ymax
-			- mbnavplot[number_plots].ymin);
-		mbnavplot[number_plots].xinterval = 100.0;
-		mbnavplot[number_plots].yinterval = 45.0;
-		sprintf(mbnavplot[number_plots].xlabel,
-			"Time (HH:MM:SS.SSS) beginning on %2.2d/%2.2d/%4.4d",
-			xtime_i[1], xtime_i[2], xtime_i[0]);
-		sprintf(mbnavplot[number_plots].ylabel1,
-			"Pitch");
-		sprintf(mbnavplot[number_plots].ylabel2,
-			"(degrees)");
-		number_plots++;
-		}
-	if (plot_heave == MB_YES)
-		{
-		mbnavplot[number_plots].type = PLOT_HEAVE;
-		mbnavplot[number_plots].ixmin = 1.25*margin_x;
-		mbnavplot[number_plots].ixmax = plot_width - margin_x/2;
-		mbnavplot[number_plots].iymin = plot_height - margin_y
-			+ number_plots*plot_height;
-		mbnavplot[number_plots].iymax = number_plots*plot_height
-			+ margin_y;
-		mbnavplot[number_plots].xmin = time_min;
-		mbnavplot[number_plots].xmax = time_max;
-		mbnavplot[number_plots].ymin = heave_min;
-		mbnavplot[number_plots].ymax = heave_max;
-		mbnavplot[number_plots].xscale =
-			(mbnavplot[number_plots].ixmax
-			- mbnavplot[number_plots].ixmin)
-			/(mbnavplot[number_plots].xmax
-			- mbnavplot[number_plots].xmin);
-		mbnavplot[number_plots].yscale =
-			(mbnavplot[number_plots].iymax
-			- mbnavplot[number_plots].iymin)
-			/(mbnavplot[number_plots].ymax
-			- mbnavplot[number_plots].ymin);
-		mbnavplot[number_plots].xinterval = 100.0;
-		mbnavplot[number_plots].yinterval = 45.0;
-		sprintf(mbnavplot[number_plots].xlabel,
-			"Time (HH:MM:SS.SSS) beginning on %2.2d/%2.2d/%4.4d",
-			xtime_i[1], xtime_i[2], xtime_i[0]);
-		sprintf(mbnavplot[number_plots].ylabel1,
-			"Heave");
-		sprintf(mbnavplot[number_plots].ylabel2,
-			"(meters)");
-		number_plots++;
-		}
-
-	/* clear screen */
-	status = mbnavedit_clear_screen();
-
-	/* do plots */
-	for (iplot=0;iplot<number_plots;iplot++)
-		{
-		/* get center locations */
-		center_x = (mbnavplot[iplot].ixmin
-			+ mbnavplot[iplot].ixmax)/2;
-		center_y = (mbnavplot[iplot].iymin
-			+ mbnavplot[iplot].iymax)/2;
-
-		/* plot filename */
-		sprintf(string,"Data File: %s", ifile);
-		xg_justify(mbnavedit_xgid,string,&swidth,
-			&sascent,&sdescent);
-		xg_drawstring(mbnavedit_xgid,
-			center_x - swidth / 2,
-			mbnavplot[iplot].iymax - 5 * sascent / 2,
-			string,pixel_values[BLACK],XG_SOLIDLINE);
-
-		/* get bounds for position bar */
-		fpx = center_x - 2 * margin_x
-			+ (4 * margin_x * current_id) / nbuff;
-		fpdx = MAX(((4 * margin_x * nplot) / nbuff), 5);
-		fpy = mbnavplot[iplot].iymax - 2 * sascent;
-		fpdy = sascent;
-		if (fpdx > 4 * margin_x)
-		    fpx = center_x + 2 * margin_x - fpdx;
-
-		/* plot file position bar */
-		xg_drawrectangle(mbnavedit_xgid,
-			center_x - 2 * margin_x,
-			fpy,
-			4 * margin_x,
-			fpdy,
-			pixel_values[BLACK],XG_SOLIDLINE);
-		xg_drawrectangle(mbnavedit_xgid,
-			center_x - 2 * margin_x - 1,
-			fpy - 1,
-			4 * margin_x + 2,
-			fpdy + 2,
-			pixel_values[BLACK],XG_SOLIDLINE);
-		xg_fillrectangle(mbnavedit_xgid,
-			fpx, fpy, fpdx, fpdy,
-			pixel_values[LIGHTGREY],XG_SOLIDLINE);
-		xg_drawrectangle(mbnavedit_xgid,
-			fpx, fpy, fpdx, fpdy,
-			pixel_values[BLACK],XG_SOLIDLINE);
-		sprintf(string,"0 ");
-		xg_justify(mbnavedit_xgid,string,&swidth,
-			&sascent,&sdescent);
-		xg_drawstring(mbnavedit_xgid,
-			(int)(center_x - 2 * margin_x - swidth),
-			fpy + sascent,
-			string,
-			pixel_values[BLACK],XG_SOLIDLINE);
-		sprintf(string," %d", nbuff);
-		xg_drawstring(mbnavedit_xgid,
-			(int)(center_x + 2 * margin_x),
-			fpy + sascent,
-			string,
-			pixel_values[BLACK],XG_SOLIDLINE);
-
-		/* plot x label */
-		xg_justify(mbnavedit_xgid,
-			mbnavplot[iplot].xlabel,
-			&swidth,&sascent,&sdescent);
-		xg_drawstring(mbnavedit_xgid,
-			(int)(center_x - swidth/2),
-			(int)(mbnavplot[iplot].iymin+0.75*margin_y),
-			mbnavplot[iplot].xlabel,
-			pixel_values[BLACK],XG_SOLIDLINE);
-
-		/* plot y labels */
-		xg_justify(mbnavedit_xgid,
-			mbnavplot[iplot].ylabel1,
-			&swidth,&sascent,&sdescent);
-		xg_drawstring(mbnavedit_xgid,
-			(int)(mbnavplot[iplot].ixmin - swidth/2 - 0.75*margin_x),
-			(int)(center_y-sascent),
-			mbnavplot[iplot].ylabel1,
-			pixel_values[BLACK],XG_SOLIDLINE);
-		xg_justify(mbnavedit_xgid,
-			mbnavplot[iplot].ylabel2,
-			&swidth,&sascent,&sdescent);
-		xg_drawstring(mbnavedit_xgid,
-			(int)(mbnavplot[iplot].ixmin - swidth/2 - 0.75*margin_x),
-			(int)(center_y+2*sascent),
-			mbnavplot[iplot].ylabel2,
-			pixel_values[BLACK],XG_SOLIDLINE);
-
-		/* plot x axis time annotation */
-		dx = (plot_end_time - plot_start_time) / 5;
-		for (i=0;i<6;i++)
-			{
-			/* get x position */
-			x = plot_start_time + i * dx;
-			ix = mbnavplot[iplot].ixmin
-				+ mbnavplot[iplot].xscale
-				    * (x - mbnavplot[iplot].xmin);
-			x += file_start_time_d;
-
-			/* draw tickmarks */
-			xg_drawline(mbnavedit_xgid,
-				ix,
-				mbnavplot[iplot].iymin,
-				ix,
-				mbnavplot[iplot].iymin + 5,
-				pixel_values[BLACK],XG_SOLIDLINE);
-
-			/* draw annotations */
-			mb_get_date(verbose, x, xtime_i);
-			sprintf(string, "%2.2d:%2.2d:%2.2d.%3.3d",
-				xtime_i[3],
-				xtime_i[4],
-				xtime_i[5],
-				(int)(0.001 * xtime_i[6]));
-			xg_justify(mbnavedit_xgid,
-				string,
-				&swidth,&sascent,&sdescent);
-			xg_drawstring(mbnavedit_xgid,
-				(int)(ix - swidth/2),
-				(int)(mbnavplot[iplot].iymin
-					+ 5 + 1.75*sascent),
-				string,
-				pixel_values[BLACK],XG_SOLIDLINE);
-			}
-
-		/* plot y min max values */
-		if (mbnavplot[iplot].type == PLOT_LONGITUDE ||
-			mbnavplot[iplot].type == PLOT_LATITUDE)
-			strcpy(yformat, "%11.6f");
-		else
-			strcpy(yformat, "%6.2f");
-		sprintf(string, yformat, mbnavplot[iplot].ymin);
-		xg_justify(mbnavedit_xgid,
-			string,
-			&swidth,&sascent,&sdescent);
-		xg_drawstring(mbnavedit_xgid,
-			(int)(mbnavplot[iplot].ixmin - swidth - 0.03*margin_x),
-			(int)(mbnavplot[iplot].iymin + 0.5*sascent),
-			string,
-			pixel_values[BLACK],XG_SOLIDLINE);
-		sprintf(string, yformat, mbnavplot[iplot].ymax);
-		xg_justify(mbnavedit_xgid,
-			string,
-			&swidth,&sascent,&sdescent);
-		xg_drawstring(mbnavedit_xgid,
-			(int)(mbnavplot[iplot].ixmin - swidth - 0.03*margin_x),
-			(int)(mbnavplot[iplot].iymax + 0.5*sascent),
-			string,
-			pixel_values[BLACK],XG_SOLIDLINE);
-
-		/* plot zero values */
-		if ((mbnavplot[iplot].ymax > 0.0 && mbnavplot[iplot].ymin < 0.0)
-			|| (mbnavplot[iplot].ymax < 0.0 && mbnavplot[iplot].ymin > 0.0))
-			{
-			if (mbnavplot[iplot].type == PLOT_LONGITUDE ||
-				mbnavplot[iplot].type == PLOT_LATITUDE)
-				strcpy(yformat, "%11.6f");
-			else
-				strcpy(yformat, "%6.2f");
-			sprintf(string, yformat, 0.0);
-			xg_justify(mbnavedit_xgid,
-				string,
-				&swidth,&sascent,&sdescent);
-			iyzero = mbnavplot[iplot].iymin - mbnavplot[iplot].yscale*mbnavplot[iplot].ymin;
-			xg_drawstring(mbnavedit_xgid,
-				(int)(mbnavplot[iplot].ixmin - swidth - 0.03*margin_x),
-				(int)(iyzero + 0.5*sascent),
-				string,
-				pixel_values[BLACK],XG_SOLIDLINE);
-			xg_drawline(mbnavedit_xgid,
-				mbnavplot[iplot].ixmin, iyzero,
-				mbnavplot[iplot].ixmax, iyzero,
-				pixel_values[BLACK],XG_DASHLINE);
-			}
-
-		/* plot bounding box */
-		xg_drawrectangle(mbnavedit_xgid,
-			mbnavplot[iplot].ixmin,
-			mbnavplot[iplot].iymax,
-			mbnavplot[iplot].ixmax - mbnavplot[iplot].ixmin,
-			mbnavplot[iplot].iymin - mbnavplot[iplot].iymax,
-			pixel_values[BLACK],XG_SOLIDLINE);
-		xg_drawrectangle(mbnavedit_xgid,
-			mbnavplot[iplot].ixmin-1,
-			mbnavplot[iplot].iymax-1,
-			mbnavplot[iplot].ixmax - mbnavplot[iplot].ixmin + 2,
-			mbnavplot[iplot].iymin - mbnavplot[iplot].iymax + 2,
-			pixel_values[BLACK],XG_SOLIDLINE);
-
-		/* now plot the data */
-		if (mbnavplot[iplot].type == PLOT_TINT)
-			mbnavedit_plot_tint(iplot);
-		else if (mbnavplot[iplot].type == PLOT_LONGITUDE)
-			mbnavedit_plot_lon(iplot);
-		else if (mbnavplot[iplot].type == PLOT_LATITUDE)
-			mbnavedit_plot_lat(iplot);
-		else if (mbnavplot[iplot].type == PLOT_SPEED)
-			mbnavedit_plot_speed(iplot);
-		else if (mbnavplot[iplot].type == PLOT_HEADING)
-			mbnavedit_plot_heading(iplot);
-		else if (mbnavplot[iplot].type == PLOT_DRAFT)
-			mbnavedit_plot_draft(iplot);
-		else if (mbnavplot[iplot].type == PLOT_ROLL)
-			mbnavedit_plot_roll(iplot);
-		else if (mbnavplot[iplot].type == PLOT_PITCH)
-			mbnavedit_plot_pitch(iplot);
-		else if (mbnavplot[iplot].type == PLOT_HEAVE)
-			mbnavedit_plot_heave(iplot);
-		}
-
-	}
-
-	/* set status */
-	if (nplot > 0)
-		status = MB_SUCCESS;
-	else
-		status = MB_FAILURE;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return */
-	return (status);
-}
-/*--------------------------------------------------------------------*/
-int mbnavedit_plot_tint(int iplot)
-{
-	/* local variables */
-	char	*function_name = "mbnavedit_plot_tint";
-	int	status = MB_SUCCESS;
-	int	ixmin, ixmax, iymin, iymax;
-	double	xmin, xmax, ymin, ymax;
-	double	xscale, yscale;
-	int	tint_x1, tint_y1, tint_x2, tint_y2;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       iplot:       %d\n",iplot);
-		}
-
-	/* get scaling values */
-	ixmin = mbnavplot[iplot].ixmin;
-	ixmax = mbnavplot[iplot].ixmax;
-	iymin = mbnavplot[iplot].iymin;
-	iymax = mbnavplot[iplot].iymax;
-	xmin = mbnavplot[iplot].xmin;
-	xmax = mbnavplot[iplot].xmax;
-	ymin = mbnavplot[iplot].ymin;
-	ymax = mbnavplot[iplot].ymax;
-	xscale = mbnavplot[iplot].xscale;
-	yscale = mbnavplot[iplot].yscale;
-
-	/* plot original expected time data */
-	if (plot_tint_org == MB_YES)
-	{
-	tint_x1 = ixmin + xscale*(ping[current_id].file_time_d - xmin);
-	tint_y1 = iymin + yscale*(ping[current_id].tint_org - ymin);
-	for (i=current_id+1;i<current_id+nplot;i++)
-		{
-		tint_x2 = ixmin + xscale*(ping[i].file_time_d - xmin);
-		tint_y2 = iymin + yscale*(ping[i].tint_org - ymin);
-		xg_drawline(mbnavedit_xgid,
-			tint_x1, tint_y1, tint_x2, tint_y2,
-			pixel_values[GREEN],XG_SOLIDLINE);
-		tint_x1 = tint_x2;
-		tint_y1 = tint_y2;
-		}
-	}
-
-	/* plot basic expected time data */
-	for (i=current_id;i<current_id+nplot;i++)
-		{
-		ping[i].tint_x = ixmin + xscale*(ping[i].file_time_d - xmin);
-		ping[i].tint_y = iymin + yscale*(ping[i].tint - ymin);
-		if (ping[i].tint_select == MB_YES)
-			xg_drawrectangle(mbnavedit_xgid,
-				ping[i].tint_x-2,
-				ping[i].tint_y-2, 4, 4,
-				pixel_values[RED],XG_SOLIDLINE);
-		else if (ping[i].tint != ping[i].tint_org)
-			xg_drawrectangle(mbnavedit_xgid,
-				ping[i].tint_x-2,
-				ping[i].tint_y-2, 4, 4,
-				pixel_values[PURPLE],XG_SOLIDLINE);
-		else
-			xg_fillrectangle(mbnavedit_xgid,
-				ping[i].tint_x-2,
-				ping[i].tint_y-2, 4, 4,
-				pixel_values[BLACK],XG_SOLIDLINE);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return */
-	return (status);
-}
-/*--------------------------------------------------------------------*/
-int mbnavedit_plot_lon(int iplot)
-{
-	/* local variables */
-	char	*function_name = "mbnavedit_plot_lon";
-	int	status = MB_SUCCESS;
-	int	ixmin, ixmax, iymin, iymax;
-	double	xmin, xmax, ymin, ymax;
-	double	xscale, yscale;
-	int	lon_x1, lon_y1, lon_x2, lon_y2;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       iplot:       %d\n",iplot);
-		}
-
-	/* get scaling values */
-	ixmin = mbnavplot[iplot].ixmin;
-	ixmax = mbnavplot[iplot].ixmax;
-	iymin = mbnavplot[iplot].iymin;
-	iymax = mbnavplot[iplot].iymax;
-	xmin = mbnavplot[iplot].xmin;
-	xmax = mbnavplot[iplot].xmax;
-	ymin = mbnavplot[iplot].ymin;
-	ymax = mbnavplot[iplot].ymax;
-	xscale = mbnavplot[iplot].xscale;
-	yscale = mbnavplot[iplot].yscale;
-
-	/* plot original longitude data */
-	if (plot_lon_org == MB_YES)
-	{
-	lon_x1 = ixmin + xscale*(ping[current_id].file_time_d - xmin);
-	lon_y1 = iymin + yscale*(ping[current_id].lon_org - ymin);
-	for (i=current_id+1;i<current_id+nplot;i++)
-		{
-		lon_x2 = ixmin + xscale*(ping[i].file_time_d - xmin);
-		lon_y2 = iymin + yscale*(ping[i].lon_org - ymin);
-		xg_drawline(mbnavedit_xgid,
-			lon_x1, lon_y1, lon_x2, lon_y2,
-			pixel_values[GREEN],XG_SOLIDLINE);
-		lon_x1 = lon_x2;
-		lon_y1 = lon_y2;
-		}
-	}
-
-	/* plot dr longitude data */
-	if (model_mode != MODEL_MODE_OFF
-		    && plot_lon_dr == MB_YES)
-	{
-	lon_x1 = ixmin + xscale*(ping[current_id].file_time_d - xmin);
-	lon_y1 = iymin + yscale*(ping[current_id].lon_dr - ymin);
-	for (i=current_id+1;i<current_id+nplot;i++)
-		{
-		lon_x2 = ixmin + xscale*(ping[i].file_time_d - xmin);
-		lon_y2 = iymin + yscale*(ping[i].lon_dr - ymin);
-		xg_drawline(mbnavedit_xgid,
-			lon_x1, lon_y1, lon_x2, lon_y2,
-			pixel_values[BLUE],XG_SOLIDLINE);
-		lon_x1 = lon_x2;
-		lon_y1 = lon_y2;
-		}
-	}
-
-	/* plot flagged longitude data first so it is overlain by all else */
-	for (i=current_id;i<current_id+nplot;i++)
-		{
-		ping[i].lon_x = ixmin + xscale*(ping[i].file_time_d - xmin);
-		ping[i].lon_y = iymin + yscale*(ping[i].lon - ymin);
-		if (ping[i].lonlat_flag == MB_YES)
-			xg_drawrectangle(mbnavedit_xgid,
-				ping[i].lon_x-2,
-				ping[i].lon_y-2, 4, 4,
-				pixel_values[ORANGE],XG_SOLIDLINE);
-		}
-
-	/* plot basic longitude data */
-	for (i=current_id;i<current_id+nplot;i++)
-		{
-		ping[i].lon_x = ixmin + xscale*(ping[i].file_time_d - xmin);
-		ping[i].lon_y = iymin + yscale*(ping[i].lon - ymin);
-		if (ping[i].lon_select == MB_YES)
-			xg_drawrectangle(mbnavedit_xgid,
-				ping[i].lon_x-2,
-				ping[i].lon_y-2, 4, 4,
-				pixel_values[RED],XG_SOLIDLINE);
-		else if (ping[i].lonlat_flag == MB_YES)
-			{
-			;
-			}
-		else if (ping[i].lon != ping[i].lon_org)
-			xg_drawrectangle(mbnavedit_xgid,
-				ping[i].lon_x-2,
-				ping[i].lon_y-2, 4, 4,
-				pixel_values[PURPLE],XG_SOLIDLINE);
-		else
-			xg_fillrectangle(mbnavedit_xgid,
-				ping[i].lon_x-2,
-				ping[i].lon_y-2, 4, 4,
-				pixel_values[BLACK],XG_SOLIDLINE);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return */
-	return (status);
-}
-/*--------------------------------------------------------------------*/
-int mbnavedit_plot_lat(int iplot)
-{
-	/* local variables */
-	char	*function_name = "mbnavedit_plot_lat";
-	int	status = MB_SUCCESS;
-	int	ixmin, ixmax, iymin, iymax;
-	double	xmin, xmax, ymin, ymax;
-	double	xscale, yscale;
-	int	lat_x1, lat_y1, lat_x2, lat_y2;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       iplot:       %d\n",iplot);
-		}
-
-	/* get scaling values */
-	ixmin = mbnavplot[iplot].ixmin;
-	ixmax = mbnavplot[iplot].ixmax;
-	iymin = mbnavplot[iplot].iymin;
-	iymax = mbnavplot[iplot].iymax;
-	xmin = mbnavplot[iplot].xmin;
-	xmax = mbnavplot[iplot].xmax;
-	ymin = mbnavplot[iplot].ymin;
-	ymax = mbnavplot[iplot].ymax;
-	xscale = mbnavplot[iplot].xscale;
-	yscale = mbnavplot[iplot].yscale;
-
-	/* plot original latitude data */
-	if (plot_lat_org == MB_YES)
-	{
-	lat_x1 = ixmin + xscale*(ping[current_id].file_time_d - xmin);
-	lat_y1 = iymin + yscale*(ping[current_id].lat_org - ymin);
-	for (i=current_id+1;i<current_id+nplot;i++)
-		{
-		lat_x2 = ixmin + xscale*(ping[i].file_time_d - xmin);
-		lat_y2 = iymin + yscale*(ping[i].lat_org - ymin);
-		xg_drawline(mbnavedit_xgid,
-			lat_x1, lat_y1, lat_x2, lat_y2,
-			pixel_values[GREEN],XG_SOLIDLINE);
-		lat_x1 = lat_x2;
-		lat_y1 = lat_y2;
-		}
-	}
-
-	/* plot dr latitude data */
-	if (model_mode != MODEL_MODE_OFF
-		    && plot_lat_dr == MB_YES)
-	{
-	lat_x1 = ixmin + xscale*(ping[current_id].file_time_d - xmin);
-	lat_y1 = iymin + yscale*(ping[current_id].lat_dr - ymin);
-	for (i=current_id+1;i<current_id+nplot;i++)
-		{
-		lat_x2 = ixmin + xscale*(ping[i].file_time_d - xmin);
-		lat_y2 = iymin + yscale*(ping[i].lat_dr - ymin);
-		xg_drawline(mbnavedit_xgid,
-			lat_x1, lat_y1, lat_x2, lat_y2,
-			pixel_values[BLUE],XG_SOLIDLINE);
-		lat_x1 = lat_x2;
-		lat_y1 = lat_y2;
-		}
-	}
-
-	/* plot flagged latitude data first so it is overlain by all else */
-	for (i=current_id;i<current_id+nplot;i++)
-		{
-		ping[i].lat_x = ixmin + xscale*(ping[i].file_time_d - xmin);
-		ping[i].lat_y = iymin + yscale*(ping[i].lat - ymin);
-		if (ping[i].lonlat_flag == MB_YES)
-			xg_drawrectangle(mbnavedit_xgid,
-				ping[i].lat_x-2,
-				ping[i].lat_y-2, 4, 4,
-				pixel_values[ORANGE],XG_SOLIDLINE);
-		}
-
-	/* plot basic latitude data */
-	for (i=current_id;i<current_id+nplot;i++)
-		{
-		ping[i].lat_x = ixmin + xscale*(ping[i].file_time_d - xmin);
-		ping[i].lat_y = iymin + yscale*(ping[i].lat - ymin);
-		if (ping[i].lat_select == MB_YES)
-			xg_drawrectangle(mbnavedit_xgid,
-				ping[i].lat_x-2,
-				ping[i].lat_y-2, 4, 4,
-				pixel_values[RED],XG_SOLIDLINE);
-		else if (ping[i].lonlat_flag == MB_YES)
-			{
-			;
-			}
-		else if (ping[i].lat != ping[i].lat_org)
-			xg_drawrectangle(mbnavedit_xgid,
-				ping[i].lat_x-2,
-				ping[i].lat_y-2, 4, 4,
-				pixel_values[PURPLE],XG_SOLIDLINE);
-		else
-			xg_fillrectangle(mbnavedit_xgid,
-				ping[i].lat_x-2,
-				ping[i].lat_y-2, 4, 4,
-				pixel_values[BLACK],XG_SOLIDLINE);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return */
-	return (status);
-}
-/*--------------------------------------------------------------------*/
-int mbnavedit_plot_speed(int iplot)
-{
-	/* local variables */
-	char	*function_name = "mbnavedit_plot_speed";
-	int	status = MB_SUCCESS;
-	int	ixmin, ixmax, iymin, iymax;
-	double	xmin, xmax, ymin, ymax;
-	double	xscale, yscale;
-	int	speed_x1, speed_y1, speed_x2, speed_y2;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       iplot:       %d\n",iplot);
-		}
-
-	/* get scaling values */
-	ixmin = mbnavplot[iplot].ixmin;
-	ixmax = mbnavplot[iplot].ixmax;
-	iymin = mbnavplot[iplot].iymin;
-	iymax = mbnavplot[iplot].iymax;
-	xmin = mbnavplot[iplot].xmin;
-	xmax = mbnavplot[iplot].xmax;
-	ymin = mbnavplot[iplot].ymin;
-	ymax = mbnavplot[iplot].ymax;
-	xscale = mbnavplot[iplot].xscale;
-	yscale = mbnavplot[iplot].yscale;
-
-	/* plot original speed data */
-	if (plot_speed_org == MB_YES)
-	{
-	speed_x1 = ixmin + xscale*(ping[current_id].file_time_d - xmin);
-	speed_y1 = iymin + yscale*(ping[current_id].speed - ymin);
-	for (i=current_id+1;i<current_id+nplot;i++)
-		{
-		speed_x2 = ixmin + xscale*(ping[i].file_time_d - xmin);
-		speed_y2 = iymin + yscale*(ping[i].speed_org - ymin);
-		xg_drawline(mbnavedit_xgid,
-			speed_x1, speed_y1, speed_x2, speed_y2,
-			pixel_values[GREEN],XG_SOLIDLINE);
-		speed_x1 = speed_x2;
-		speed_y1 = speed_y2;
-		}
-	}
-
-	/* plot speed made good data */
-	if (plot_smg == MB_YES)
-	{
-	speed_x1 = ixmin + xscale*(ping[current_id].file_time_d - xmin);
-	speed_y1 = iymin + yscale*(ping[current_id].speed_made_good - ymin);
-	for (i=current_id+1;i<current_id+nplot;i++)
-		{
-		speed_x2 = ixmin + xscale*(ping[i].file_time_d - xmin);
-		speed_y2 = iymin + yscale*(ping[i].speed_made_good - ymin);
-		xg_drawline(mbnavedit_xgid,
-			speed_x1, speed_y1, speed_x2, speed_y2,
-			pixel_values[BLUE],XG_SOLIDLINE);
-		speed_x1 = speed_x2;
-		speed_y1 = speed_y2;
-		}
-	}
-
-	/* plot basic speed data */
-	for (i=current_id;i<current_id+nplot;i++)
-		{
-		ping[i].speed_x = ixmin + xscale*(ping[i].file_time_d - xmin);
-		ping[i].speed_y = iymin + yscale*(ping[i].speed - ymin);
-		if (ping[i].speed_select == MB_YES)
-			xg_drawrectangle(mbnavedit_xgid,
-				ping[i].speed_x-2,
-				ping[i].speed_y-2, 4, 4,
-				pixel_values[RED],XG_SOLIDLINE);
-		else if (ping[i].speed != ping[i].speed_org)
-			xg_drawrectangle(mbnavedit_xgid,
-				ping[i].speed_x-2,
-				ping[i].speed_y-2, 4, 4,
-				pixel_values[PURPLE],XG_SOLIDLINE);
-		else
-			xg_fillrectangle(mbnavedit_xgid,
-				ping[i].speed_x-2,
-				ping[i].speed_y-2, 4, 4,
-				pixel_values[BLACK],XG_SOLIDLINE);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return */
-	return (status);
-}
-/*--------------------------------------------------------------------*/
-int mbnavedit_plot_heading(int iplot)
-{
-	/* local variables */
-	char	*function_name = "mbnavedit_plot_heading";
-	int	status = MB_SUCCESS;
-	int	ixmin, ixmax, iymin, iymax;
-	double	xmin, xmax, ymin, ymax;
-	double	xscale, yscale;
-	int	heading_x1, heading_y1, heading_x2, heading_y2;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       iplot:       %d\n",iplot);
-		}
-
-	/* get scaling values */
-	ixmin = mbnavplot[iplot].ixmin;
-	ixmax = mbnavplot[iplot].ixmax;
-	iymin = mbnavplot[iplot].iymin;
-	iymax = mbnavplot[iplot].iymax;
-	xmin = mbnavplot[iplot].xmin;
-	xmax = mbnavplot[iplot].xmax;
-	ymin = mbnavplot[iplot].ymin;
-	ymax = mbnavplot[iplot].ymax;
-	xscale = mbnavplot[iplot].xscale;
-	yscale = mbnavplot[iplot].yscale;
-
-	/* plot original heading data */
-	if (plot_heading_org == MB_YES)
-	{
-	heading_x1 = ixmin + xscale*(ping[current_id].file_time_d - xmin);
-	heading_y1 = iymin + yscale*(ping[current_id].heading - ymin);
-	for (i=current_id+1;i<current_id+nplot;i++)
-		{
-		heading_x2 = ixmin + xscale*(ping[i].file_time_d - xmin);
-		heading_y2 = iymin + yscale*(ping[i].heading_org - ymin);
-		xg_drawline(mbnavedit_xgid,
-			heading_x1, heading_y1, heading_x2, heading_y2,
-			pixel_values[GREEN],XG_SOLIDLINE);
-		heading_x1 = heading_x2;
-		heading_y1 = heading_y2;
-		}
-	}
-
-	/* plot course made good data */
-	if (plot_cmg == MB_YES)
-	{
-	heading_x1 = ixmin + xscale*(ping[current_id].file_time_d - xmin);
-	heading_y1 = iymin + yscale*(ping[current_id].course_made_good - ymin);
-	for (i=current_id+1;i<current_id+nplot;i++)
-		{
-		heading_x2 = ixmin + xscale*(ping[i].file_time_d - xmin);
-		heading_y2 = iymin + yscale*(ping[i].course_made_good - ymin);
-		xg_drawline(mbnavedit_xgid,
-			heading_x1, heading_y1, heading_x2, heading_y2,
-			pixel_values[BLUE],XG_SOLIDLINE);
-		heading_x1 = heading_x2;
-		heading_y1 = heading_y2;
-		}
-	}
-
-	/* plot basic heading data */
-	for (i=current_id;i<current_id+nplot;i++)
-		{
-		ping[i].heading_x = ixmin + xscale*(ping[i].file_time_d - xmin);
-		ping[i].heading_y = iymin + yscale*(ping[i].heading - ymin);
-		if (ping[i].heading_select == MB_YES)
-			xg_drawrectangle(mbnavedit_xgid,
-				ping[i].heading_x-2,
-				ping[i].heading_y-2, 4, 4,
-				pixel_values[RED],XG_SOLIDLINE);
-		else if (ping[i].heading != ping[i].heading_org)
-			xg_drawrectangle(mbnavedit_xgid,
-				ping[i].heading_x-2,
-				ping[i].heading_y-2, 4, 4,
-				pixel_values[PURPLE],XG_SOLIDLINE);
-		else
-			xg_fillrectangle(mbnavedit_xgid,
-				ping[i].heading_x-2,
-				ping[i].heading_y-2, 4, 4,
-				pixel_values[BLACK],XG_SOLIDLINE);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return */
-	return (status);
-}
-/*--------------------------------------------------------------------*/
-int mbnavedit_plot_draft(int iplot)
-{
-	/* local variables */
-	char	*function_name = "mbnavedit_plot_draft";
-	int	status = MB_SUCCESS;
-	int	ixmin, ixmax, iymin, iymax;
-	double	xmin, xmax, ymin, ymax;
-	double	xscale, yscale;
-	int	draft_x1, draft_y1, draft_x2, draft_y2;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       iplot:       %d\n",iplot);
-		}
-
-	/* get scaling values */
-	ixmin = mbnavplot[iplot].ixmin;
-	ixmax = mbnavplot[iplot].ixmax;
-	iymin = mbnavplot[iplot].iymin;
-	iymax = mbnavplot[iplot].iymax;
-	xmin = mbnavplot[iplot].xmin;
-	xmax = mbnavplot[iplot].xmax;
-	ymin = mbnavplot[iplot].ymin;
-	ymax = mbnavplot[iplot].ymax;
-	xscale = mbnavplot[iplot].xscale;
-	yscale = mbnavplot[iplot].yscale;
-
-	/* plot original draft data */
-	if (plot_draft_org == MB_YES)
-	{
-	draft_x1 = ixmin + xscale*(ping[current_id].file_time_d - xmin);
-	draft_y1 = iymin + yscale*(ping[current_id].draft - ymin);
-	for (i=current_id+1;i<current_id+nplot;i++)
-		{
-		draft_x2 = ixmin + xscale*(ping[i].file_time_d - xmin);
-		draft_y2 = iymin + yscale*(ping[i].draft_org - ymin);
-		xg_drawline(mbnavedit_xgid,
-			draft_x1, draft_y1, draft_x2, draft_y2,
-			pixel_values[GREEN],XG_SOLIDLINE);
-		draft_x1 = draft_x2;
-		draft_y1 = draft_y2;
-		}
-	}
-
-	/* plot basic draft data */
-	for (i=current_id;i<current_id+nplot;i++)
-		{
-		ping[i].draft_x = ixmin + xscale*(ping[i].file_time_d - xmin);
-		ping[i].draft_y = iymin + yscale*(ping[i].draft - ymin);
-		if (ping[i].draft_select == MB_YES)
-			xg_drawrectangle(mbnavedit_xgid,
-				ping[i].draft_x-2,
-				ping[i].draft_y-2, 4, 4,
-				pixel_values[RED],XG_SOLIDLINE);
-		else if (ping[i].draft != ping[i].draft_org)
-			xg_drawrectangle(mbnavedit_xgid,
-				ping[i].draft_x-2,
-				ping[i].draft_y-2, 4, 4,
-				pixel_values[PURPLE],XG_SOLIDLINE);
-		else
-			xg_fillrectangle(mbnavedit_xgid,
-				ping[i].draft_x-2,
-				ping[i].draft_y-2, 4, 4,
-				pixel_values[BLACK],XG_SOLIDLINE);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return */
-	return (status);
-}
-/*--------------------------------------------------------------------*/
-int mbnavedit_plot_roll(int iplot)
-{
-	/* local variables */
-	char	*function_name = "mbnavedit_plot_roll";
-	int	status = MB_SUCCESS;
-	int	ixmin, ixmax, iymin, iymax;
-	double	xmin, xmax, ymin, ymax;
-	double	xscale, yscale;
-	int	roll_x1, roll_y1, roll_x2, roll_y2;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       iplot:       %d\n",iplot);
-		}
-
-	/* get scaling values */
-	ixmin = mbnavplot[iplot].ixmin;
-	ixmax = mbnavplot[iplot].ixmax;
-	iymin = mbnavplot[iplot].iymin;
-	iymax = mbnavplot[iplot].iymax;
-	xmin = mbnavplot[iplot].xmin;
-	xmax = mbnavplot[iplot].xmax;
-	ymin = mbnavplot[iplot].ymin;
-	ymax = mbnavplot[iplot].ymax;
-	xscale = mbnavplot[iplot].xscale;
-	yscale = mbnavplot[iplot].yscale;
-
-	/* plot roll data */
-	if (plot_roll == MB_YES)
-	{
-	roll_x1 = ixmin + xscale*(ping[current_id].file_time_d - xmin);
-	roll_y1 = iymin + yscale*(ping[current_id].roll - ymin);
-	for (i=current_id+1;i<current_id+nplot;i++)
-		{
-		roll_x2 = ixmin + xscale*(ping[i].file_time_d - xmin);
-		roll_y2 = iymin + yscale*(ping[i].roll - ymin);
-		xg_drawline(mbnavedit_xgid,
-			roll_x1, roll_y1, roll_x2, roll_y2,
-			pixel_values[GREEN],XG_SOLIDLINE);
-		roll_x1 = roll_x2;
-		roll_y1 = roll_y2;
-		}
-	}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return */
-	return (status);
-}
-/*--------------------------------------------------------------------*/
-int mbnavedit_plot_pitch(int iplot)
-{
-	/* local variables */
-	char	*function_name = "mbnavedit_plot_pitch";
-	int	status = MB_SUCCESS;
-	int	ixmin, ixmax, iymin, iymax;
-	double	xmin, xmax, ymin, ymax;
-	double	xscale, yscale;
-	int	pitch_x1, pitch_y1, pitch_x2, pitch_y2;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       iplot:       %d\n",iplot);
-		}
-
-	/* get scaling values */
-	ixmin = mbnavplot[iplot].ixmin;
-	ixmax = mbnavplot[iplot].ixmax;
-	iymin = mbnavplot[iplot].iymin;
-	iymax = mbnavplot[iplot].iymax;
-	xmin = mbnavplot[iplot].xmin;
-	xmax = mbnavplot[iplot].xmax;
-	ymin = mbnavplot[iplot].ymin;
-	ymax = mbnavplot[iplot].ymax;
-	xscale = mbnavplot[iplot].xscale;
-	yscale = mbnavplot[iplot].yscale;
-
-	/* plot pitch data */
-	if (plot_pitch == MB_YES)
-	{
-	pitch_x1 = ixmin + xscale*(ping[current_id].file_time_d - xmin);
-	pitch_y1 = iymin + yscale*(ping[current_id].pitch - ymin);
-	for (i=current_id+1;i<current_id+nplot;i++)
-		{
-		pitch_x2 = ixmin + xscale*(ping[i].file_time_d - xmin);
-		pitch_y2 = iymin + yscale*(ping[i].pitch - ymin);
-		xg_drawline(mbnavedit_xgid,
-			pitch_x1, pitch_y1, pitch_x2, pitch_y2,
-			pixel_values[GREEN],XG_SOLIDLINE);
-		pitch_x1 = pitch_x2;
-		pitch_y1 = pitch_y2;
-		}
-	}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return */
-	return (status);
-}
-/*--------------------------------------------------------------------*/
-int mbnavedit_plot_heave(int iplot)
-{
-	/* local variables */
-	char	*function_name = "mbnavedit_plot_heave";
-	int	status = MB_SUCCESS;
-	int	ixmin, ixmax, iymin, iymax;
-	double	xmin, xmax, ymin, ymax;
-	double	xscale, yscale;
-	int	heave_x1, heave_y1, heave_x2, heave_y2;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       iplot:       %d\n",iplot);
-		}
-
-	/* get scaling values */
-	ixmin = mbnavplot[iplot].ixmin;
-	ixmax = mbnavplot[iplot].ixmax;
-	iymin = mbnavplot[iplot].iymin;
-	iymax = mbnavplot[iplot].iymax;
-	xmin = mbnavplot[iplot].xmin;
-	xmax = mbnavplot[iplot].xmax;
-	ymin = mbnavplot[iplot].ymin;
-	ymax = mbnavplot[iplot].ymax;
-	xscale = mbnavplot[iplot].xscale;
-	yscale = mbnavplot[iplot].yscale;
-
-	/* plot heave data */
-	if (plot_heave == MB_YES)
-	{
-	heave_x1 = ixmin + xscale*(ping[current_id].file_time_d - xmin);
-	heave_y1 = iymin + yscale*(ping[current_id].heave - ymin);
-	for (i=current_id+1;i<current_id+nplot;i++)
-		{
-		heave_x2 = ixmin + xscale*(ping[i].file_time_d - xmin);
-		heave_y2 = iymin + yscale*(ping[i].heave - ymin);
-		xg_drawline(mbnavedit_xgid,
-			heave_x1, heave_y1, heave_x2, heave_y2,
-			pixel_values[GREEN],XG_SOLIDLINE);
-		heave_x1 = heave_x2;
-		heave_y1 = heave_y2;
-		}
-	}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return */
-	return (status);
-}
-/*--------------------------------------------------------------------*/
-int mbnavedit_plot_tint_value(int iplot, int iping)
-{
-	/* local variables */
-	char	*function_name = "mbnavedit_plot_tint_value";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       iplot:       %d\n",iplot);
-		fprintf(stderr,"dbg2       iping:       %d\n",iping);
-		}
-
-	/* unplot basic expected time data value */
-	xg_drawrectangle(mbnavedit_xgid,
-			ping[iping].tint_x-2,
-			ping[iping].tint_y-2, 4, 4,
-			pixel_values[WHITE],XG_SOLIDLINE);
-	xg_fillrectangle(mbnavedit_xgid,
-			ping[iping].tint_x-2,
-			ping[iping].tint_y-2, 4, 4,
-			pixel_values[WHITE],XG_SOLIDLINE);
-
-	/* replot basic expected time data value */
-	if (ping[iping].tint_select == MB_YES)
-		xg_drawrectangle(mbnavedit_xgid,
-			ping[iping].tint_x-2,
-			ping[iping].tint_y-2, 4, 4,
-			pixel_values[RED],XG_SOLIDLINE);
-	else if (ping[iping].tint != ping[iping].tint_org)
-		xg_drawrectangle(mbnavedit_xgid,
-			ping[iping].tint_x-2,
-			ping[iping].tint_y-2, 4, 4,
-			pixel_values[PURPLE],XG_SOLIDLINE);
-	else
-		xg_fillrectangle(mbnavedit_xgid,
-			ping[iping].tint_x-2,
-			ping[iping].tint_y-2, 4, 4,
-			pixel_values[BLACK],XG_SOLIDLINE);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return */
-	return (status);
-}
-/*--------------------------------------------------------------------*/
-int mbnavedit_plot_lon_value(int iplot, int iping)
-{
-	/* local variables */
-	char	*function_name = "mbnavedit_plot_lon_value";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       iplot:       %d\n",iplot);
-		fprintf(stderr,"dbg2       iping:       %d\n",iping);
-		}
-
-	/* unplot basic lon data value */
-	xg_drawrectangle(mbnavedit_xgid,
-			ping[iping].lon_x-2,
-			ping[iping].lon_y-2, 4, 4,
-			pixel_values[WHITE],XG_SOLIDLINE);
-	xg_fillrectangle(mbnavedit_xgid,
-			ping[iping].lon_x-2,
-			ping[iping].lon_y-2, 4, 4,
-			pixel_values[WHITE],XG_SOLIDLINE);
-
-	/* replot basic lon data value */
-	if (ping[iping].lon_select == MB_YES)
-		xg_drawrectangle(mbnavedit_xgid,
-			ping[iping].lon_x-2,
-			ping[iping].lon_y-2, 4, 4,
-			pixel_values[RED],XG_SOLIDLINE);
-	else if (ping[iping].lonlat_flag == MB_YES)
-		xg_drawrectangle(mbnavedit_xgid,
-			ping[iping].lon_x-2,
-			ping[iping].lon_y-2, 4, 4,
-			pixel_values[ORANGE],XG_SOLIDLINE);
-	else if (ping[iping].lon != ping[iping].lon_org)
-		xg_drawrectangle(mbnavedit_xgid,
-			ping[iping].lon_x-2,
-			ping[iping].lon_y-2, 4, 4,
-			pixel_values[PURPLE],XG_SOLIDLINE);
-	else
-		xg_fillrectangle(mbnavedit_xgid,
-			ping[iping].lon_x-2,
-			ping[iping].lon_y-2, 4, 4,
-			pixel_values[BLACK],XG_SOLIDLINE);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return */
-	return (status);
-}
-/*--------------------------------------------------------------------*/
-int mbnavedit_plot_lat_value(int iplot, int iping)
-{
-	/* local variables */
-	char	*function_name = "mbnavedit_plot_lat_value";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       iplot:       %d\n",iplot);
-		fprintf(stderr,"dbg2       iping:       %d\n",iping);
-		}
-
-	/* unplot basic lat data value */
-	xg_drawrectangle(mbnavedit_xgid,
-			ping[iping].lat_x-2,
-			ping[iping].lat_y-2, 4, 4,
-			pixel_values[WHITE],XG_SOLIDLINE);
-	xg_fillrectangle(mbnavedit_xgid,
-			ping[iping].lat_x-2,
-			ping[iping].lat_y-2, 4, 4,
-			pixel_values[WHITE],XG_SOLIDLINE);
-
-	/* replot basic lat data value */
-	if (ping[iping].lat_select == MB_YES)
-		xg_drawrectangle(mbnavedit_xgid,
-			ping[iping].lat_x-2,
-			ping[iping].lat_y-2, 4, 4,
-			pixel_values[RED],XG_SOLIDLINE);
-	else if (ping[iping].lonlat_flag == MB_YES)
-		xg_drawrectangle(mbnavedit_xgid,
-			ping[iping].lat_x-2,
-			ping[iping].lat_y-2, 4, 4,
-			pixel_values[ORANGE],XG_SOLIDLINE);
-	else if (ping[iping].lat != ping[iping].lat_org)
-		xg_drawrectangle(mbnavedit_xgid,
-			ping[iping].lat_x-2,
-			ping[iping].lat_y-2, 4, 4,
-			pixel_values[PURPLE],XG_SOLIDLINE);
-	else
-		xg_fillrectangle(mbnavedit_xgid,
-			ping[iping].lat_x-2,
-			ping[iping].lat_y-2, 4, 4,
-			pixel_values[BLACK],XG_SOLIDLINE);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return */
-	return (status);
-}
-/*--------------------------------------------------------------------*/
-int mbnavedit_plot_speed_value(int iplot, int iping)
-{
-	/* local variables */
-	char	*function_name = "mbnavedit_plot_speed_value";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       iplot:       %d\n",iplot);
-		fprintf(stderr,"dbg2       iping:       %d\n",iping);
-		}
-
-	/* unplot basic speed data value */
-	xg_drawrectangle(mbnavedit_xgid,
-			ping[iping].speed_x-2,
-			ping[iping].speed_y-2, 4, 4,
-			pixel_values[WHITE],XG_SOLIDLINE);
-	xg_fillrectangle(mbnavedit_xgid,
-			ping[iping].speed_x-2,
-			ping[iping].speed_y-2, 4, 4,
-			pixel_values[WHITE],XG_SOLIDLINE);
-
-	/* replot basic speed data value */
-	if (ping[iping].speed_select == MB_YES)
-		xg_drawrectangle(mbnavedit_xgid,
-			ping[iping].speed_x-2,
-			ping[iping].speed_y-2, 4, 4,
-			pixel_values[RED],XG_SOLIDLINE);
-	else if (ping[iping].speed != ping[iping].speed_org)
-		xg_drawrectangle(mbnavedit_xgid,
-			ping[iping].speed_x-2,
-			ping[iping].speed_y-2, 4, 4,
-			pixel_values[PURPLE],XG_SOLIDLINE);
-	else
-		xg_fillrectangle(mbnavedit_xgid,
-			ping[iping].speed_x-2,
-			ping[iping].speed_y-2, 4, 4,
-			pixel_values[BLACK],XG_SOLIDLINE);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return */
-	return (status);
-}
-/*--------------------------------------------------------------------*/
-int mbnavedit_plot_heading_value(int iplot, int iping)
-{
-	/* local variables */
-	char	*function_name = "mbnavedit_plot_heading_value";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       iplot:       %d\n",iplot);
-		fprintf(stderr,"dbg2       iping:       %d\n",iping);
-		}
-
-	/* unplot basic heading data value */
-	xg_drawrectangle(mbnavedit_xgid,
-			ping[iping].heading_x-2,
-			ping[iping].heading_y-2, 4, 4,
-			pixel_values[WHITE],XG_SOLIDLINE);
-	xg_fillrectangle(mbnavedit_xgid,
-			ping[iping].heading_x-2,
-			ping[iping].heading_y-2, 4, 4,
-			pixel_values[WHITE],XG_SOLIDLINE);
-
-	/* replot basic heading data value */
-	if (ping[iping].heading_select == MB_YES)
-		xg_drawrectangle(mbnavedit_xgid,
-			ping[iping].heading_x-2,
-			ping[iping].heading_y-2, 4, 4,
-			pixel_values[RED],XG_SOLIDLINE);
-	else if (ping[iping].heading != ping[iping].heading_org)
-		xg_drawrectangle(mbnavedit_xgid,
-			ping[iping].heading_x-2,
-			ping[iping].heading_y-2, 4, 4,
-			pixel_values[PURPLE],XG_SOLIDLINE);
-	else
-		xg_fillrectangle(mbnavedit_xgid,
-			ping[iping].heading_x-2,
-			ping[iping].heading_y-2, 4, 4,
-			pixel_values[BLACK],XG_SOLIDLINE);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return */
-	return (status);
-}
-/*--------------------------------------------------------------------*/
-int mbnavedit_plot_draft_value(int iplot, int iping)
-{
-	/* local variables */
-	char	*function_name = "mbnavedit_plot_draft_value";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       iplot:       %d\n",iplot);
-		fprintf(stderr,"dbg2       iping:       %d\n",iping);
-		}
-
-	/* unplot basic draft data value */
-	xg_drawrectangle(mbnavedit_xgid,
-			ping[iping].draft_x-2,
-			ping[iping].draft_y-2, 4, 4,
-			pixel_values[WHITE],XG_SOLIDLINE);
-	xg_fillrectangle(mbnavedit_xgid,
-			ping[iping].draft_x-2,
-			ping[iping].draft_y-2, 4, 4,
-			pixel_values[WHITE],XG_SOLIDLINE);
-
-	/* replot basic draft data value */
-	if (ping[iping].draft_select == MB_YES)
-		xg_drawrectangle(mbnavedit_xgid,
-			ping[iping].draft_x-2,
-			ping[iping].draft_y-2, 4, 4,
-			pixel_values[RED],XG_SOLIDLINE);
-	else if (ping[iping].draft != ping[iping].draft_org)
-		xg_drawrectangle(mbnavedit_xgid,
-			ping[iping].draft_x-2,
-			ping[iping].draft_y-2, 4, 4,
-			pixel_values[PURPLE],XG_SOLIDLINE);
-	else
-		xg_fillrectangle(mbnavedit_xgid,
-			ping[iping].draft_x-2,
-			ping[iping].draft_y-2, 4, 4,
-			pixel_values[BLACK],XG_SOLIDLINE);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return */
-	return (status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbnavedit/mbnavedit_util.c b/src/mbnavedit/mbnavedit_util.c
deleted file mode 100644
index 1b54cd6..0000000
--- a/src/mbnavedit/mbnavedit_util.c
+++ /dev/null
@@ -1,3928 +0,0 @@
-/*
- * WARNING: This file is overwritten at code generation time.
- * Any changes to this file will be lost.
- */
-/*
- * MODULE: BxConvert.c
- * AUTHOR: Automatically generated by Builder Xcessory
- *
- * Description: This module contains various utilities, converters
- *	for XmStrings (to work properly with app-defaults), and if needed
- *	the XPM pixmap utilities.
- *
- * Edit the file ${BX}/gen/bxutils.c (BX$SYSTEM:[gen]bxutils.c on VMS) to
- * make system wide changes to this file which will be visible next time
- * this file is generated.
- * ${BX} is the directory where Builder Xcessory is installed.
- */
-
-/*
- * BX supplies a string format for compound strings:
- *
- *		::[#tag][:t][:r]["str"]
- *
- * where:
- *	:: = indicates compound string.
- *	tag =  the font tag
- *	:t = separator (if not seen no separator added to segment)
- *	:r = right to left (if not seen left to right assumed)
- *	"str" = the text of the string.
- *
- * The components for the compound string can be repeated any number of
- * times.
- */
-
-/*****************************************************************************
- *       INCLUDE FILES
- *****************************************************************************/
-/* Added HAVE_CONFIG_H for autogen files */
-#ifdef HAVE_CONFIG_H
-#include <mb_config.h>
-#endif
-
-
-#include <Xm/Xm.h>
-#include <Xm/RowColumn.h>
-#include <stdio.h>
-#include <ctype.h>
-#include <string.h>
-
-/*
- * Include stdlib.h and malloc.h if code is C++, ANSI, or Extended ANSI.
- */
-#if defined(__cplusplus) || defined(__STDC__) || defined(__EXTENSIONS__)
-#include <stdlib.h>
-#ifdef HAVE_MALLOC_H
-#include <malloc.h>
-#endif
-#endif
-
-/*****************************************************************************
- *       TYPDEFS AND DEFINES
- *****************************************************************************/
-
-/*
- * Undefine this if you want to use native strcasecmp.
- */
-#define LOCAL_STRCASECMP
-
-#ifdef _NO_PROTO
-#ifdef NeedFunctionPrototypes
-#undef NeedFunctionPrototypes
-#endif
-#endif
-
-/*
- * Define SUPPORTS_WCHARS if the system supports wide character sets
- * Note: the following line flags the VAXC compiler and not the
- * DECC compiler running VAXC emulation.
- */
-#if !((defined(VAXC) && !defined(__DECC)) || defined(__CENTERLINE__))
-#define SUPPORTS_WCHARS
-#endif
-
-/*
- * Handy definition used in SET_BACKGROUND_COLOR
-*/
-#define UNSET		(-1)
-
-/*
- * Set state of inclusion of prototypes properly
- */
-#ifdef NeedFunctionPrototypes
-#define ARGLIST(p)	(
-#define ARG(a, b)	a b,
-#define GRA(a, b)	a b)
-#else
-#define ARGLIST(p)	p
-#define ARG(a, b)	a b;
-#define GRA(a, b)	a b;
-#endif
-
-#ifdef NeedFunctionPrototypes
-#ifdef __cplusplus
-#define UARG(a, b)	a,
-#define GRAU(a, b)	a)
-#else
-#define UARG(a, b)	a b,
-#define GRAU(a, b)	a b)
-#endif
-#else
-#define UARG(a, b)	a b;
-#define GRAU(a, b)	a b;
-#endif
-
-/*
- * Set up strcasecmp function
- */
-#if defined(LOCAL_STRCASECMP)
-#define STRCASECMP	StrCasecmp
-#ifndef NeedFunctionPrototypes
-static int StrCasecmp();
-#else
-static int StrCasecmp(char*, char*);
-#endif
-#else
-#define STRCASECMP	strcasecmp
-#endif
-
-/*
- * Define XTPOINTER so it works with all releases of
- * Xt and c++.
- */
-#ifdef __cplusplus
-#if XtSpecificationRelease < 5
-#define XTPOINTER	char *
-#else
-#define XTPOINTER	XPointer
-#endif
-#else
-#define XTPOINTER	XtPointer
-#endif
-
-/*
- * The following enum is used to support wide character sets.
- * Use this enum for references into the Common Wide Characters array.
- * If you add to the array, ALWAYS keep NUM_COMMON_WCHARS as the last
- * entry in the enum.  This will maintain correct memory usage, etc.
- */
-enum { WNull, WTab, WNewLine, WCarriageReturn, WFormFeed, WVerticalTab,
-       WBackSlash, WQuote, WHash, WColon, WideF, WideL, WideN, WideR,
-       WideT, WideV, WideUF, WideUL, WideUR, WideUT, WideZero, WideOne,
-       NUM_COMMON_WCHARS };
-
-/*****************************************************************************
- *       GLOBAL DECLARATIONS
- *****************************************************************************/
-
-/*****************************************************************************
- *       EXTERNAL DECLARATIONS
- *****************************************************************************/
-
-/*****************************************************************************
- *	STATIC DECLARATION
- *****************************************************************************/
-
-#ifndef NeedFunctionPrototypes
-
-#ifndef SUPPORTS_WCHARS
-static int	 mblen			();
-#endif
-static int	strlenWc		();
-static size_t	doMbstowcs		();
-static size_t	doWcstombs 		();
-static void	copyWcsToMbs		();
-static int 	dombtowc		();
-static Boolean	extractSegment		();
-static XmString	StringToXmString	();
-static char*	getNextCStrDelim	();
-static int	getCStrCount		();
-static wchar_t *CStrCommonWideCharsGet	();
-
-#else
-
-#ifndef SUPPORTS_WCHARS
-static int 	mblen			(char*, size_t);
-#endif
-static int	strlenWc		(wchar_t*);
-static size_t	doMbstowcs		(wchar_t*, char*, size_t);
-static size_t	doWcstombs 		(char*, wchar_t*, size_t);
-static void	copyWcsToMbs		(char*, wchar_t*, int, Boolean);
-static int 	dombtowc		(wchar_t*, char*, size_t);
-static Boolean	extractSegment		(wchar_t**, wchar_t**, int *,
-					 wchar_t**, int*, int*,	Boolean*);
-static XmString	StringToXmString	(char*);
-static char*	getNextCStrDelim	(char*);
-static int	getCStrCount		(char*);
-static wchar_t *CStrCommonWideCharsGet	();
-
-#endif
-
-/*****************************************************************************
- *	STATIC CODE
- *****************************************************************************/
-
-#if defined(LOCAL_STRCASECMP)
-
-/*
- * Function:
- *      cmp = StrCasecmp(s1, s2);
- * Description:
- *      Compare two strings ignoring case
- * Input:
- *      s1 - char * : string 1 to compare
- *      s2 - char * : string 2 to compare
- * Output:
- *      int :  0; s1 == s2
- *             1; s1 != s2
- */
-static int StrCasecmp
-    ARGLIST((s1, s2))
-        ARG(register char *, s1)
-        GRA(register char *, s2)
-{
-    register int        c1, c2;
-
-    while (*s1 && *s2)
-    {
-        c1 = isupper(*s1) ? tolower(*s1) : *s1;
-        c2 = isupper(*s2) ? tolower(*s2) : *s2;
-        if (c1 != c2)
-        {
-            return(1);
-        }
-        s1++;
-        s2++;
-    }
-    if (*s1 || *s2)
-    {
-        return(1);
-    }
-    return(0);
-}
-#endif
-
-#ifndef SUPPORTS_WCHARS
-/*
- * Function:
- *      len = mblen(s, n);
- * Description:
- *      The mblen function for platforms that don't have one. This
- * 	function simply returns a length of 1 since no wide character
- *	support exists for this platform.
- * Input:
- *      s - char * : the character string to get the length from
- *	n - size_t : the size of the string
- * Output:
- *      int : always 1
- */
-static int mblen
-    ARGLIST((s, n))
-        ARG(char *, s)
-        GRA(size_t, n)
-{
-    return(1);
-}
-#endif
-
-/*
- * Function:
- *      len = strlenWc(ptr);
- * Description:
- *      Return the number of characters in a wide character string (not
- *	the characters in the resultant mbs).
- * Input:
- *      ptr - wchar_t* : pointer to the wcs to count
- * Output:
- *      int : the number of characters found
- */
-static int strlenWc
-    ARGLIST((ptr))
-        GRA(wchar_t *,ptr)
-{
-    register wchar_t	*p = ptr;
-    register int	x = 0;
-
-    if (!ptr) return(0);
-
-    while (*p++) x++;
-    return (x);
-}
-
-/*
- * Function:
- *      bytesConv = doMbstowcs(wcs, mbs, n);
- * Description:
- *      Create a wcs string from an input mbs.
- * Input:
- *	wcs - wchar_t* : pointer to result buffer of wcs
- *      mbs - char* : pointer to the source mbs
- *	n - size_t : the number of characters to convert
- * Output:
- *      bytesConv - size_t : number of bytes converted
- */
-static size_t doMbstowcs
-    ARGLIST((wcs, mbs, n))
-        ARG(wchar_t *,wcs)
-        ARG(char *, mbs)
-        GRA(size_t, n)
-{
-#ifndef SUPPORTS_WCHARS
-    int i;
-
-    for (i = 0; i < n && mbs[i] != 0; ++i)
-    {
-	wcs[i] = mbs[i];
-    }
-    wcs[i++] = 0;
-    return(i);
-#else
-    return(mbstowcs(wcs, mbs, n));
-#endif
-}
-
-/*
- * Function:
- *      bytesConv = doWcstombs(wcs, mbs, n);
- * Description:
- *      Create a mbs string from an input wcs.
- * Input:
- *	wcs - wchar_t* : pointer to the source wcs
- *      mbs - char* : pointer to result mbs buffer
- *	n - size_t : the number of characters to convert
- * Output:
- *      bytesConv - size_t : number of bytes converted
- */
-static size_t doWcstombs
-    ARGLIST((mbs, wcs, n))
-        ARG(char *, mbs)
-        ARG(wchar_t *, wcs)
-        GRA(size_t, n)
-{
-#ifndef SUPPORTS_WCHARS
-    int i;
-
-    for (i = 0; i < n && wcs[i] != 0; ++i)
-    {
-	mbs[i] = wcs[i];
-    }
-    mbs[i] = 0;
-    return(i);
-#else
-    size_t	retval;
-
-    retval = wcstombs(mbs, wcs, (n * sizeof(wchar_t)));
-    if ( retval == (size_t)-1 ) return(0);
-    else return(retval);
-#endif
-}
-
-/*
- * Function:
- *      copyWcsToMbs(mbs, wcs, len);
- * Description:
- *      Create a mbs string from an input wcs. This function allocates
- *	a buffer if necessary.
- * Input:
- *	mbs - char* : destination for the converted/copied output
- *	wcs - wchar_t* : pointer to wcs to copy/convert
- *	len - int : the number of wchar_t' to convert
- *	process_it - Boolean : True if processing of quoted charcters,
- *			False if blind.
- * Output:
- *      None
- */
-static void copyWcsToMbs
-    ARGLIST((mbs, wcs, len, process_it))
-        ARG(char *, mbs)
-        ARG(wchar_t *, wcs)
-        ARG(int, len)
-        GRA(Boolean, process_it)
-{
-    static	wchar_t	*tbuf = NULL;
-    static	int	tbufSize = 0;
-
-    int		numCvt;
-    int		lenToConvert;
-    wchar_t	*fromP = wcs;
-    wchar_t	*x = &fromP[len];
-    wchar_t	*toP;
-    wchar_t	*commonWChars = CStrCommonWideCharsGet();
-    wchar_t	tmp;
-
-    /*
-     * Make sure there's room in the buffer
-     */
-    if (tbufSize < len)
-    {
-	tbuf = (wchar_t*)XtRealloc((char*)tbuf, (len + 1) * sizeof(wchar_t));
-	tbufSize = len;
-    }
-
-    /*
-     * Now copy and process
-     */
-    toP = tbuf;
-    lenToConvert = 0;
-    while (fromP < x)
-    {
-	/*
-	 * Check for quoted characters
-	 */
-	if ((*fromP == commonWChars[WBackSlash]) && process_it)
-	{
-	    fromP++;		/* Skip quote */
-	    if (fromP == x)	/* Hanging quote? */
-	    {
-		*toP++ = commonWChars[WBackSlash];
-		lenToConvert++;
-		break;
-	    }
-	    tmp = *fromP++;
-	    if (tmp == commonWChars[WideN])
-	    {
-		*toP++ = commonWChars[WNewLine];
-	    }
-	    else if (tmp == commonWChars[WideT])
-	    {
-		*toP++ = commonWChars[WTab];
-	    }
-	    else if (tmp == commonWChars[WideR])
-	    {
-		*toP++ = commonWChars[WCarriageReturn];
-	    }
-	    else if (tmp == commonWChars[WideF])
-	    {
-		*toP++ = commonWChars[WFormFeed];
-	    }
-	    else if (tmp == commonWChars[WideV])
-	    {
-		*toP++ = commonWChars[WVerticalTab];
-	    }
-	    else if (tmp == commonWChars[WBackSlash])
-	    {
-		*toP++ = commonWChars[WBackSlash];
-	    }
-	    else
-	    {
-                /*
-		 * No special translation needed
-		 */
-		*toP++ = tmp;
-	    }
-	}
-	else
-	{
-	    *toP++ = *fromP++;
-	}
-	lenToConvert++;
-    }
-
-    tmp = tbuf[lenToConvert];
-    tbuf[lenToConvert] = (wchar_t) 0;
-    numCvt = doWcstombs(mbs, tbuf, lenToConvert);
-    tbuf[lenToConvert] = tmp;
-
-    mbs[numCvt] = '\0';
-}
-
-/*
- * Function:
- *      status = dombtowc(wide, multi, size);
- * Description:
- *      Convert a multibyte character to a wide character.
- * Input:
- *      wide	- wchar_t *	: where to put the wide character
- *	multi	- char *	: the multibyte character to convert
- *	size	- size_t	: the number of characters to convert
- * Output:
- *      0	- if multi is a NULL pointer or points to a NULL character
- *	#bytes	- number of bytes in the multibyte character
- *	-1	- multi is an invalid multibyte character.
- *
- *	NOTE:  if wide is NULL, then this returns the number of bytes in
- *	       the multibyte character.
- */
-static int dombtowc
-    ARGLIST((wide, multi, size))
-        ARG(wchar_t *, wide)
-        ARG(char *, multi)
-        GRA(size_t, size)
-{
-    int		retVal = 0;
-
-#ifndef SUPPORTS_WCHARS
-    if ((multi == NULL) || (*multi == '\000'))
-    {
-	if (wide) wide[0] = '\0';
-	return (0);
-    }
-
-    for (retVal = 0; retVal < size && multi[retVal] != '\000'; retVal++)
-    {
-	if (wide != NULL)
-	{
-	    wide[retVal] = multi[retVal];
-	}
-    }
-#else
-    retVal = mbtowc(wide, multi, size);
-#endif
-    return(retVal);
-}
-
-/*
- * Function:
- *	ptr = getNextSepartor(str);
- * Description:
- *	Parse through a string looking for the next compound string
- *	field separator
- * Inputs:
- *	str - wchar_t* : the address of address of the string to parse
- * Outputs:
- *	ptr - wchar_t* : pointer to character, if found, points to end
- *			of string otherwise ('\0').
- */
-static wchar_t* getNextSeparator
-    ARGLIST((str))
-        GRA(wchar_t *, str)
-{
-    wchar_t	*ptr = str;
-    wchar_t	*commonWChars = CStrCommonWideCharsGet();
-
-    while (*ptr)
-    {
-	/*
-	 * Check for separator
-	 */
-	if ((*ptr == commonWChars[WHash]) ||
-	    (*ptr == commonWChars[WQuote]) ||
-	    (*ptr == commonWChars[WColon]))
-	{
-	    return(ptr);
-	}
-	else if (*ptr == commonWChars[WBackSlash])
-	{
-	    ptr++;
-	    if (*ptr) ptr++;	/* Skip quoted character */
-	}
-	else
-	{
-	    ptr++;
-	}
-    }
-    return(ptr);
-}
-
-/*
- * Function:
- *	more =
- *        extractSegment(str, tagStart, tagLen, txtStart, txtLen,
- *			pDir, pSep);
- * Description:
- *	Parse through a string version of a compound string and extract
- *	the first compound string segment from the string.
- * Inputs:
- *	str - char** : the address of address of the string to parse
- *	tagStart - char** : address to return pointer to tag start into
- *	tagLen - int* : address where to return the tag length into
- *	txtStart - char** : address to return the text start into
- *	txtLen - int* : address where to return the text length
- *	pDir - int* : address to return the string direction into
- *	pSep - Boolean * : address to return the separtor into
- * Outputs:
- *	more - Boolean : True if more of the string to parse.
- *			False means done.
- */
-static Boolean extractSegment
-    ARGLIST((str, tagStart, tagLen, txtStart, txtLen, pDir, pSep))
-        ARG(wchar_t **, str)
-        ARG(wchar_t **, tagStart)
-        ARG(int *, tagLen)
-        ARG(wchar_t **, txtStart)
-        ARG(int *, txtLen)
-        ARG(int *, pDir)
-        GRA(Boolean *, pSep)
-{
-    wchar_t		*start;
-    wchar_t		*text;
-    int			textL;
-    Boolean		tagSeen;
-    wchar_t		*tag;
-    int			tagL;
-    Boolean		modsSeen;
-    Boolean		sep;
-    int			dir;
-    Boolean		done;
-    Boolean		checkDir;
-    wchar_t		*commonWChars;
-    wchar_t		emptyStrWcs[1];
-
-    /*
-     * Initialize variables
-     */
-    text = NULL;
-    textL = 0;
-    tagSeen = False;
-    tag = NULL;
-    tagL = 0;
-    modsSeen = False;
-    dir = XmSTRING_DIRECTION_L_TO_R;
-    sep = False;
-    done = False;
-    commonWChars = CStrCommonWideCharsGet();
-
-    /*
-     * Guard against nulls
-     */
-    if (!(start = *str))
-    {
-	start = emptyStrWcs;
-	emptyStrWcs[0] = commonWChars[WNull];
-    }
-
-    /*
-     * If the first character of the string isn't a # or a ", then we
-     * just have a regular old simple string. Do the same the thing for
-     * the empty string.
-     */
-    if ((*start == '\0') || (start != getNextSeparator(start)))
-    {
-	text = start;
-	if (!(textL = strlenWc(start)))
-	{
-	    text = NULL;
-	}
-	start += textL;
-    }
-    else
-    {
-	done = False;
-	while (!done)
-	{
-	    if (*start == commonWChars[WHash])
-	    {
-		if (tagSeen)
-		{
-		    done = True;
-		    break;
-		}
-		else
-		{
-		    tagSeen = True;
-		    tag = ++start;
-		    start = getNextSeparator(tag);
-		    if ((tagL = start - tag) == 0)
-		    {
-			tag = NULL;		/* Null tag specified */
-		    }
-		}
-	    }
-	    else if (*start == commonWChars[WQuote])
-	    {
-		text = ++start;
-		start = getNextSeparator(start);
-		while (!((*start == commonWChars[WQuote]) ||
-			 (*start == commonWChars[WNull])))
-		{
-		    start = getNextSeparator(++start);
-		}
-
-		if ((textL = start - text) == 0)
-		{
-		    text = NULL;	/* Null text specified  */
-		}
-                /*
-		 * if a quote, skip over it
-		 */
-		if (*start == commonWChars[WQuote])
-		{
-		    start++;
-		}
-		done = True;
-	    }
-	    else if (*start == commonWChars[WColon])
-	    {
-		if (modsSeen)
-		{
-		    done = True;
-		    break;
-		}
-
-		/*
-		 * If the next character is a t or f, the we've got
-		 * a separator.
-		 */
-		modsSeen = True;
-		checkDir = False;
-		start++;
-		if ((*start == commonWChars[WideT]) ||
-		    (*start == commonWChars[WideUT]) ||
-		    (*start == commonWChars[WideOne]))
-		{
-		    sep = True;
-		    start++;
-		    checkDir = True;
-		}
-		else if ((*start == commonWChars[WideF]) ||
-			 (*start == commonWChars[WideUF]) ||
-			 (*start == commonWChars[WideZero]))
-		{
-		    sep = False;
-		    start++;
-		    checkDir = True;
-		}
-		else if ((*start == commonWChars[WideR]) ||
-			 (*start == commonWChars[WideUR]))
-		{
-		    start++;
-		    dir = XmSTRING_DIRECTION_R_TO_L;
-		}
-		else if ((*start == commonWChars[WideL]) ||
-			 (*start == commonWChars[WideUL]))
-		{
-		    start++;
-		    dir = XmSTRING_DIRECTION_L_TO_R;
-		}
-		/*
-		 * Look for direction if necessary. This requires a bit of
-		 * look ahead.
-		 */
-		if (checkDir && (*start == commonWChars[WColon]))
-		{
-		    if ((*(start + 1) == commonWChars[WideL]) ||
-			(*(start + 1) == commonWChars[WideUL]))
-		    {
-			dir = XmSTRING_DIRECTION_L_TO_R;
-			start += 2;
-		    }
-		    else if ((*(start + 1) == commonWChars[WideR]) ||
-			     (*(start + 1) == commonWChars[WideUR]))
-		    {
-			dir = XmSTRING_DIRECTION_R_TO_L;
-			start+=2;
-		    }
-		}
-	    }
-            else
-	    {
-		/*
-		 * A bad string format! We'll just skip the character.
-		 */
-		start++;
-	    }
-	}
-    }
-
-    /*
-     * Now fill in return values
-     */
-    if (*str)		*str = start;
-    if (tagStart)	*tagStart = tag;
-    if (tagLen)		*tagLen = tagL;
-    if (txtStart)	*txtStart = text;
-    if (txtLen)		*txtLen = textL;
-    if (pDir)		*pDir = dir;
-    if (pSep)		*pSep = sep;
-
-    return ((*start == commonWChars[WNull]) ? False : True);
-}
-
-/*
- * Function:
- *	xstr = StringToXmString(str);
- * Description:
- *	Parse a string into an XmString.
- * Inputs:
- *	str - char * : the string to parse
- * Outputs:
- *	xstr - XmString : the allocated return structure
- */
-static XmString StringToXmString
-    ARGLIST((str))
-        GRA(char *,str)
-{
-    static char*	tagBuf = NULL;
-    static int		tagBufLen = 0;
-    static char*	textBuf = NULL;
-    static int		textBufLen = 0;
-
-    wchar_t		*ctx;
-    wchar_t		*tag;
-    int			tagLen;
-    wchar_t		*text;
-    int			textLen;
-    Boolean		sep;
-    int			dir;
-
-    Boolean		more;
-    wchar_t		*wcStr;
-    int			curDir;
-    XmString		xmStr;
-    XmString		s1;
-    XmString		s2;
-
-    if (!str) return(NULL);
-
-    /*
-     * For expediencies sake, we'll overallocate this buffer so that
-     * the wcs is guaranteed to fit (1 wc per byte in original string).
-     */
-    wcStr = (wchar_t*)XtMalloc((strlen(str) + 1) * sizeof(wchar_t));
-    doMbstowcs(wcStr, str, strlen(str) + 1);
-
-    /*
-     * Create the beginning segment
-     */
-    curDir = XmSTRING_DIRECTION_L_TO_R;
-    xmStr = XmStringDirectionCreate(curDir);
-
-    /*
-     * Convert the string.
-     */
-    more = True;
-    ctx = wcStr;
-    while (more)
-    {
-	more = extractSegment(&ctx, &tag, &tagLen,
-			      &text, &textLen, &dir, &sep);
-	/*
-	 * Pick up a direction change
-	 */
-	if (dir != curDir)
-	{
-#if defined(VMS) || (defined(__osf__) && defined(__alpha))
-#if XmVERSION > 1 || (XmVERSION == 1 && XmREVISION >= 2)
-	    /*
-	     * This is required on DEC Windows systems because they've
-	     * added the REVERT direction.
-	     */
-	    s1 = XmStringDirectionCreate(XmSTRING_DIRECTION_REVERT);
-	    s2 = xmStr;
-	    xmStr = XmStringConcat(s2, s1);
-	    XmStringFree(s1);
-	    XmStringFree(s2);
-#endif
-#endif
-	    curDir = dir;
-	    s1 = XmStringDirectionCreate(curDir);
-	    s2 = xmStr;
-	    xmStr = XmStringConcat(s2, s1);
-	    XmStringFree(s1);
-	    XmStringFree(s2);
-
-	}
-
-	/*
-	 * Create the segment. Text and tag first.
-	 */
-	if (textLen)
-	{
-	    if (textBufLen <= (textLen * sizeof(wchar_t)))
-	    {
-		textBufLen = (textLen + 1) * sizeof(wchar_t);
-		textBuf = (char*)XtRealloc(textBuf, textBufLen);
-	    }
-	    copyWcsToMbs(textBuf, text, textLen, True);
-
-	    if (tagLen)
-	    {
-		if (tagBufLen <= (tagLen * sizeof(wchar_t)))
-		{
-		    tagBufLen = (tagLen + 1) * sizeof(wchar_t);
-		    tagBuf = (char*)XtRealloc(tagBuf, tagBufLen);
-		}
-		copyWcsToMbs(tagBuf, tag, tagLen, False);
-	    }
-	    else
-	    {
-		if (!tagBuf)
-		{
-		    tagBufLen = strlen(XmSTRING_DEFAULT_CHARSET) + 1;
-		    tagBuf = (char*)XtMalloc(tagBufLen);
-		}
-		strcpy(tagBuf, XmSTRING_DEFAULT_CHARSET);
-	    }
-
-	    s1 = XmStringCreate(textBuf, tagBuf);
-	    s2 = xmStr;
-	    xmStr = XmStringConcat(s2, s1);
-	    XmStringFree(s1);
-	    XmStringFree(s2);
-	}
-
-	/*
-	 * Add in the separators.
-	 */
-	if (sep)
-	{
-	    s1 = XmStringSeparatorCreate();
-	    s2 = xmStr;
-	    xmStr = XmStringConcat(s2, s1);
-	    XmStringFree(s1);
-	    XmStringFree(s2);
-	}
-    }
-
-    /*
-     * Free up memory and return
-     */
-    XtFree((char*)wcStr);
-    return(xmStr);
-}
-
-/*
- * Function:
- *      nextCStr = getNextCStrDelim(str);
- * Description:
- *      Find the next unquoted , or \n in the string
- * Input:
- *	str - char * : the input string
- * Output:
- *      nextCStr - char* : pointer to the next delimiter. Returns NULL if no
- *			delimiter found.
- */
-static char* getNextCStrDelim
-    ARGLIST((str))
-        GRA(char *,str)
-{
-    char	*comma = str;
-    Boolean	inQuotes = False;
-    int		len;
-
-    if (!str) return(NULL);
-    if (!*str) return(NULL);	/* At end */
-
-#ifdef __CENTERLINE__
-    len = mblen((char *)NULL, sizeof(wchar_t));
-#else
-    len = mblen(NULL, sizeof(wchar_t));
-#endif
-    while (*comma)
-    {
-	if ((len = mblen(comma, sizeof(wchar_t))) > 1)
-	{
-	    comma += len;
-	    continue;
-	}
-
-	if (*comma == '\\')
-	{
-	    comma++;	/* Over quote */
-	    comma += mblen(comma, sizeof(wchar_t));
-	    continue;
-	}
-
-	/*
-	 * See if we have a delimiter
-	 */
-	if (!inQuotes)
-	{
-	    if ((*comma == ',') || (*comma == '\012'))
-	    {
-		return(comma);
-	    }
-	}
-
-	/*
-	 * Deal with quotes
-	 */
-	if (*comma == '\"')
-	{
-	    inQuotes = ~inQuotes;
-	}
-
-	comma++;
-    }
-
-    return(NULL);		/* None found */
-}
-
-/*
- * Function:
- *	cnt = getCStrCount(str);
- * Description:
- *      Get the count of cstrings in a compound string table ascii
- *	format.
- * Input:
- *      str - char * : string to parse
- * Output:
- *      cnt - int : the number of XmStrings found
- */
-static int getCStrCount
-    ARGLIST((str))
-        GRA(char *, str)
-{
-    int		x = 1;
-    char	*newStr;
-
-    if (!str) return(0);
-    if (!*str) return(0);
-
-    while ((newStr = getNextCStrDelim(str)))
-    {
-	x++;
-	str = ++newStr;
-    }
-    return(x);
-}
-
-/*
- * Function:
- *      cwc = CStrCommonWideCharsGet();
- * Description:
- *      Return the array of common wide characters.
- * Input:
- *      None.
- * Output:
- *     	cwc - wchar_t * : this array should never be written to or FREEd.
- */
-static wchar_t *CStrCommonWideCharsGet()
-{
-    static wchar_t	*CommonWideChars = NULL;
-    /*
-     * If you add to this array, don't forget to change the enum in
-     * the TYPEDEFS and DEFINES section above to correspond to this
-     * array.
-     */
-    static char	*characters[] = { "\000", "\t", "\n", "\r", "\f", "\v",
-				  "\\", "\"", "#", ":", "f", "l", "n", "r",
-				  "t", "v", "F", "L", "R", "T", "0", "1" };
-
-
-    if (CommonWideChars == NULL)
-    {
-	int	i;
-
-	/*
-	 * Allocate and create the array.
-	 */
-	CommonWideChars = (wchar_t*)XtMalloc(NUM_COMMON_WCHARS * sizeof(wchar_t));
-
-	for (i = 0; i < NUM_COMMON_WCHARS; i++)
-	{
-	    (void)dombtowc(&(CommonWideChars[i]), characters[i], 1);
-	}
-    }
-    return(CommonWideChars);
-}
-
-/*
- * Function:
- *	CONVERTER CvtStringToXmString
- *
- * Description:
- *	Convert a string to an XmString. This allows a string contained in
- *	resource file to contain multiple fonts. The syntax for the string
- *	is:
- *		::[#[font-tag]]"string"[#[font-tag]"string"] ...
- *
- *	note that the # can be escaped (\#).
- *
- * Input:
- * Output:
- *	Standard.
- */
-static Boolean CvtStringToXmString
-    ARGLIST((d, args, num_args, fromVal, toVal, data))
-        ARG(Display *, d)
-        UARG(XrmValue *, args)
-        ARG(Cardinal *, num_args)
-        ARG(XrmValue *, fromVal)
-        ARG(XrmValue *, toVal)
-        GRAU(XtPointer, data)
-{
-    static XmString	resStr;
-    char		*str;
-
-    /*
-     * This converter takes no parameters
-     */
-    if (*num_args != 0)
-    {
-	XtAppWarningMsg(XtDisplayToApplicationContext(d),
-			"cvtStringToXmString",
-			"wrongParameters",
-			"XtToolkitError",
-			"String to XmString converter needs no extra arguments",
-			(String *)NULL,
-			(Cardinal *)NULL);
-    }
-
-    /*
-     * See if this is a simple string
-     */
-    str = (char*)fromVal->addr;
-    if (strncmp(str, "::", 2))
-    {
-	resStr = XmStringCreateLtoR(fromVal->addr, XmSTRING_DEFAULT_CHARSET);
-    }
-    else
-    {
-	/*
-	 * Convert into internal format
-	 */
-	resStr = StringToXmString(fromVal->addr + 2);	/* skip :: */
-    }
-
-    /*
-     * Done, return result
-     */
-    if (toVal->addr == NULL)
-    {
-	toVal->addr = (XTPOINTER)&resStr;
-	toVal->size = sizeof(XmString);
-    }
-    else if (toVal->size < sizeof(XmString))
-    {
-	toVal->size = sizeof(XmString);
-	XtDisplayStringConversionWarning(d, fromVal->addr, "XmString");
-	XmStringFree(resStr);
-	return(False);
-    }
-    else
-    {
-	*(XmString *)toVal->addr = resStr;
-	toVal->size = sizeof(XmString);
-    }
-    return(True);
-}
-
-/*
- * Function:
- *      CONVERTER CvtStringToXmStringTable
- *
- * Description:
- *	Convert a string to an XmString table. This allows a string
- *	contained in resource file to contain multiple fonts. The syntax
- *	for the string is:
- *
- *	   compound_string = [#[font-tag]]"string"[#[font-tag]"string"] ...
- *	   compound_string_table = [compound_string][,compound_string] ...
- *
- *	note that the # can be escaped (\#).
- *
- * Input:
- * Output:
- *	Standard.
- */
-static Boolean CvtStringToXmStringTable
-    ARGLIST((d, args, num_args, fromVal, toVal, data))
-        ARG(Display *, d)
-        ARG(XrmValue *, args)
-        ARG(Cardinal *, num_args)
-        ARG(XrmValue *, fromVal)
-        ARG(XrmValue *, toVal)
-        GRAU(XtPointer, data)
-{
-    static XmString	*CStrTable;
-    XmString		*tblPtr;
-    char		*str;
-    char		*tmpBuf;
-    char		*nextDelim;
-    XrmValue		fVal;
-    XrmValue		tVal;
-
-    /*
-     * This converter takes no parameters
-     */
-    if (*num_args != 0)
-    {
-	XtAppWarningMsg
-	    (XtDisplayToApplicationContext(d),
-	     "cvtStringToXmStringTable",
-	     "wrongParameters",
-	     "XtToolkitError",
-	     "String to XmStringTable converter needs no extra arguments",
-	     (String *)NULL,
-	     (Cardinal *)NULL);
-    }
-
-    /*
-     * Set str and make sure there's somethin' there
-     */
-    if (!(str = (char*)fromVal->addr))
-    {
-	str = "";
-    }
-
-    /*
-     * Allocate the XmStrings + 1 for NULL termination
-     */
-    CStrTable = (XmString*)XtMalloc((getCStrCount(str) + 1) * sizeof(XmString*));
-
-    /*
-     * Use the string converter for the strings
-     */
-    tmpBuf = (char*)XtMalloc(strlen(str) + 1);
-    strcpy(tmpBuf, str);
-    str = tmpBuf;
-
-    /*
-     * Create strings
-     */
-    tblPtr = CStrTable;
-    if (*str)
-    {
-	while (str)
-	{
-	    nextDelim = getNextCStrDelim(str);
-
-	    /*
-	     * Overwrite nextDelim
-	     */
-	    if (nextDelim)
-	    {
-		*nextDelim = '\0';
-		nextDelim++;
-	    }
-
-	    /*
-	     * Convert it
-	     */
-	    fVal.size = strlen(str) + 1;
-	    fVal.addr = str;
-	    tVal.size = sizeof(XTPOINTER);
-	    tVal.addr = (XTPOINTER)tblPtr;
-
-	    /*
-	     * Call converter ourselves since this is used to create
-	     * the strings in the table we create. We need to do this
-	     * since we don't have a widget to send to the XtConvertAndStore
-	     * function. Side effects are that we can never get these
-	     * compound strings cached and that no destructor function is
-	     * called when the strings leave existance, but we nuke 'em
-	     * in the XmStringTable destuctor.
-	     */
-	    CvtStringToXmString(d, args, num_args, &fVal, &tVal, NULL);
-	    tblPtr++;
-	    str = nextDelim;
-	}
-    }
-    XtFree(tmpBuf);
-
-    /*
-     * Null terminate
-     */
-    *tblPtr = NULL;
-
-    /*
-     * Done, return result
-     */
-    if (toVal->addr == NULL)
-    {
-	toVal->addr = (XTPOINTER)&CStrTable;
-	toVal->size = sizeof(XmString);
-    }
-    else if (toVal->size < sizeof(XmString*))
-    {
-	toVal->size = sizeof(XmString*);
-	XtDisplayStringConversionWarning(d, fromVal->addr, "XmStringTable");
-
-	tblPtr = CStrTable;
-	while (*tblPtr)
-	{
-	    XmStringFree(*tblPtr);
-	}
-	XtFree((char*)CStrTable);
-	return(False);
-    }
-    else
-    {
-	*(XmString **)toVal->addr = CStrTable;
-	toVal->size = sizeof(XmString*);
-    }
-    return(True);
-}
-
-/*****************************************************************************
- *	GLOBAL CODE
- *****************************************************************************/
-
-/*
- * Function:
- *      RegisterBxConverters(appContext);
- * Description:
- *      This globally available function installs all the converters necessary
- *	to run BuilderXcessory generated interfaces that use compound
- *	strings. This is necessary since Motif has not supplied very smart
- *	converters.
- * Input:
- *      appContext - XtAppContext : the application context
- * Output:
- *      None
- */
-void RegisterBxConverters
-    ARGLIST((appContext))
-        GRA(XtAppContext, appContext)
-{
-    XtAppSetTypeConverter(appContext, XmRString, XmRXmString,
-			  (XtTypeConverter)CvtStringToXmString,
-			  NULL, 0, XtCacheNone, NULL);
-
-    XtAppSetTypeConverter(appContext, XmRString, XmRXmStringTable,
-			  (XtTypeConverter)CvtStringToXmStringTable,
-			  NULL, 0, XtCacheNone, NULL);
-}
-
-/*
- * Function:
- *      CONVERT(w, from_string, to_type, to_size, success);
- * Description:
- *      A converter wrapper for convenience from BuilderXcessory.
- * Input:
- *      w - Widget : the widget to use for conversion
- *	from_string - char * : the string to convert from
- *	to_type - char * : the type to convert to
- *	to_size - int : the size of the conversion result
- *	success - Boolean* : Set to the result value of the conversion
- * Output:
- *      None
- */
-#ifndef IGNORE_CONVERT
-XtPointer BX_CONVERT
-    ARGLIST((w, from_string, to_type, to_size, success))
-        ARG(Widget, w)
-        ARG(char *, from_string)
-        ARG(char *, to_type)
-        UARG(int, to_size)
-        GRA(Boolean *, success)
-{
-    XrmValue		fromVal, toVal;	/* resource holders		*/
-    Boolean		convResult;	/* return value			*/
-    XtPointer		val;		/* Pointer size return value    */
-
-    /*
-     * We will assume that the conversion is going to fail and change this
-     * value later if the conversion is a success.
-     */
-    *success = False;
-
-    /*
-     * Since we are converting from a string to some type we need to
-     * set the fromVal structure up with the string information that
-     * the caller passed in.
-     */
-    fromVal.size = strlen(from_string) + 1;
-    fromVal.addr = from_string;
-
-    /*
-     * Since we are not sure what type and size of data we are going to
-     * get back we will set this up so that the converter will point us
-     * at a block of valid data.
-     */
-    toVal.size = 0;
-    toVal.addr = NULL;
-
-    /*
-     * Now lets try to convert this data by calling this handy-dandy Xt
-     * routine.
-     */
-    convResult = XtConvertAndStore(w, XmRString, &fromVal, to_type, &toVal);
-
-
-    /*
-     * Now we have two conditions here.  One the conversion was a success
-     * and two the conversion failed.
-     */
-    if(!convResult)
-    {
-	/*
-	 * If this conversion failed that we can pretty much return right
-	 * here because there is nothing else we can do.
-	 */
-	return((XtPointer) NULL);
-    }
-
-    /*
-     * If we get this far that means we did the conversion and all is
-     * well.  Now we have to handle the special cases for type and
-     * size constraints.
-     */
-    if(!strcmp(to_type, "String"))
-    {
-	/*
-	 * Since strings are handled different in Xt we have to deal with
-	 * the conversion from a string to a string.  When this happens the
-	 * toVal.size will hold the strlen of the string so generic
-	 * conversion code can't handle it.  It is possible for a string to
-	 * string conversion to happen so we do have to watch for it.
-	 */
-	val = (XTPOINTER)toVal.addr;
-    }
-    else if(!strcmp(to_type, "Double"))
-    {
-	val = (XTPOINTER)((double*)toVal.addr);
-    }
-    else if(!strcmp(to_type, "Float"))
-    {
-	val = (XTPOINTER)((float*)toVal.addr);
-    }
-    else
-    {
-	/*
-	 * Here is the generic conversion return value handler.  This
-	 * just does some size specific casting so that value that we
-	 * return is in the correct bytes of the XtPointer that we
-	 * return.  Here we check all sizes from 1 to 8 bytes.
-	 */
-	switch(toVal.size)
-	{
-	case 1:
-	    val = (XTPOINTER)(long)(*(char*)toVal.addr);
-	    break;
-	case 2:
-	    val = (XTPOINTER)(long)(*(short*)toVal.addr);
-	    break;
-	case 4:
-	    val = (XTPOINTER)(long)(*(int*)toVal.addr);
-	    break;
-	case 8:
-	default:
-	    val = (XTPOINTER)(long)(*(long*)toVal.addr);
-	    break;
-	}
-    }
-
-    /*
-     * Well everything is done and the conversion was a success so lets
-     * set the success flag to True.
-     */
-    *success = convResult;
-
-    /*
-     * Finally lets return the converted value.
-     */
-    /*SUPPRESS 80*/
-    return(val);
-}
-
-#ifdef DEFINE_OLD_BXUTILS
-XtPointer CONVERT
-    ARGLIST((w, from_string, to_type, to_size, success))
-        ARG(Widget, w)
-        ARG(char *, from_string)
-        ARG(char *, to_type)
-        ARG(int, to_size)
-        GRA(Boolean *, success)
-{
-    return(BX_CONVERT(w, from_string, to_type, to_size, success));
-}
-#endif /* DEFINE_OLD_BXUTILS */
-#endif /* !IGNORE_CONVERT */
-
-/*
- * Function:
- *      MENU_POST(p, mw, ev, dispatch);
- * Description:
- *      A converter wrapper for convenience from BuilderXcessory.
- * Input:
- *      p - Widget : the widget to post
- *	mw - XtPointer : the menu widget
- *	ev - XEvent* : the event that caused the menu post
- *	dispatch - Boolean* : not used
- * Output:
- *      None
- */
-
-#ifndef IGNORE_MENU_POST
-void BX_MENU_POST
-    ARGLIST((p, mw, ev, dispatch))
-        UARG(Widget, p)
-        ARG(XtPointer, mw)
-        ARG(XEvent *, ev)
-        GRAU(Boolean *, dispatch)
-{
-    Arg	args[2];
-    int	argcnt;
-    int	button;
-    Widget m = (Widget)mw;
-    XButtonEvent *e = (XButtonEvent *)ev;
-
-    argcnt = 0;
-    XtSetArg(args[argcnt], XmNwhichButton, &button);
-    argcnt++;
-    XtGetValues(m, args, argcnt);
-    if(e->button != button) return;
-    XmMenuPosition(m, e);
-    XtManageChild(m);
-}
-
-#ifdef DEFINE_OLD_BXUTILS
-void MENU_POST
-    ARGLIST((p, mw, ev, dispatch))
-        UARG(Widget, p)
-        ARG(XtPointer, mw)
-        ARG(XEvent *, ev)
-        GRAU(Boolean *, dispatch)
-{
-    BX_MENU_POST(p, mw, ev, dispatch);
-}
-#endif /* DEFINE_OLD_BXUTILS */
-#endif /* !IGNORE_MENU_POST */
-
-/*
- * Function:
- *      SET_BACKGROUND_COLOR(w, args, argcnt, bg_color);
- * Description:
- *      Sets the background color and shadows of a widget.
- * Input:
- *      w - The widget to set the background color on.
- *      args, argcnt - The argument list so far.
- *      bg_color - The new background color as a pixel.
- * Output:
- *      none
- *
- *  NOTES:  This assumes that args later in the argument list
- *          override those already in the list.  Therfore i f
- *          there are shadow colors later in the list they will win.
- *
- *          There is no need to use this function when creating a widget
- *          only when doing a set values, shadow colors are automatically
- *          calculated at creation time.
- */
-void BX_SET_BACKGROUND_COLOR
-    ARGLIST((w, args, argcnt, bg_color))
-        ARG(Widget, w)
-        ARG(ArgList, args)
-        ARG(Cardinal *, argcnt)
-        GRA(Pixel, bg_color)
-{
-
-#if ((XmVERSION == 1) && (XmREVISION > 0))
-
-    /*
-     * Walk through the arglist to see if the user set the top or
-     * bottom shadow colors.
-     */
-    selectLoc = topShadowLoc =  bottomShadowLoc = UNSET;
-    for (i = 0; i < *argcnt; i++)
-    {
-	if ((strcmp(args[i].name, XmNtopShadowColor) == 0) ||
-	    (strcmp(args[i].name, XmNtopShadowPixmap) == 0))
-	{
-	    topShadowLoc = i;
-	}
-	else if ((strcmp(args[i].name, XmNbottomShadowColor) == 0) ||
-		 (strcmp(args[i].name, XmNbottomShadowPixmap) == 0))
-	{
-	    bottomShadowLoc = i;
-	}
-	else if (strcmp(args[i].name, XmNarmColor) == 0)
-	{
-	    selectLoc = i;
-	}
-	else if (strcmp(args[i].name, XmNforeground) == 0)
-	{
-	    fgLoc = i;
-	}
-    }
-
-    /*
-     * If either the top or bottom shadow are not set then we
-     * need to use XmGetColors to get the shadow colors from the backgound
-     * color and add those that are not already in the arglist to the
-     * arglist.
-     *
-     */
-    if ((bottomShadowLoc == UNSET) ||
-	(topShadowLoc == UNSET) ||
-	(selectLoc == UNSET) ||
-	(fgLoc == UNSET))
-    {
-	Arg		larg[1];
-	Colormap	cmap;
-	Pixel		topShadow;
-	Pixel		bottomShadow;
-	Pixel		select;
-	Pixel		fgColor;
-
-	XtSetArg(larg[0], XmNcolormap, &cmap);
-	XtGetValues(w, larg, 1);
-	XmGetColors(XtScreen(w), cmap, bg_color,
-		    &fgColor, &topShadow, &bottomShadow, &select);
-
-	if (topShadowLoc == UNSET)
-	{
-	    XtSetArg(args[*argcnt], XmNtopShadowColor, topShadow);
-	    (*argcnt)++;
-	}
-
-	if (bottomShadowLoc == UNSET)
-	{
-	    XtSetArg(args[*argcnt], XmNbottomShadowColor, bottomShadow);
-	    (*argcnt)++;
-	}
-
-	if (selectLoc == UNSET)
-	{
-	    XtSetArg(args[*argcnt], XmNarmColor, select);
-	    (*argcnt)++;
-	}
-
-	if (fgLoc == UNSET)
-	{
-	    XtSetArg(args[*argcnt], XmNforeground, fgColor);
-	    (*argcnt)++;
-	}
-    }
-#endif
-
-    XtSetArg(args[*argcnt], XmNbackground, bg_color); (*argcnt)++;
-}
-
-#ifdef DEFINE_OLD_BXUTILS
-void SET_BACKGROUND_COLOR
-    ARGLIST((w, args, argcnt, bg_color))
-        ARG(Widget, w)
-        ARG(ArgList, args)
-        ARG(Cardinal *, argcnt)
-        GRA(Pixel, bg_color)
-{
-    BX_SET_BACKGROUND_COLOR(w, args, argcnt, bg_color);
-}
-#endif /* DEFINE_OLD_BXUTILS */
-
-/*
- * Function:
- *	w = BxFindTopShell(start);
- * Description:
- *	Go up the hierarhcy until we find a shell widget.
- * Input:
- *      start - Widget : the widget to start with.
- * Output:
- *	w - Widget : the shell widget.
- */
-#ifndef _BX_FIND_TOP_SHELL
-#define _BX_FIND_TOP_SHELL
-
-Widget BxFindTopShell
-    ARGLIST((start))
-        GRA(Widget, start)
-{
-    Widget	p;
-
-    while((p = XtParent(start)))
-    {
-	start = p;
-    }
-    return(start);
-}
-#endif /* _BX_FIND_TOP_SHELL */
-
-/*
- * Function:
- *	BxWidgetIdsFromNames(ref, cbName, stringList)
- * Description:
- *	Return an array of widget ids from a list of widget names.
- * Input:
- *	ref - Widget : reference widget.
- *	cbName - char* : callback name.
- *	stringList - char*: list of widget names.
- * Output:
- *	WidgetList : array of widget IDs.
- */
-
-#ifndef _BX_WIDGETIDS_FROM_NAMES
-#define _BX_WIDGETIDS_FROM_NAMES
-
-WidgetList BxWidgetIdsFromNames
-    ARGLIST((ref, cbName, stringList))
-        ARG(Widget, ref)
-        ARG(char, *cbName)
-        GRA(char, *stringList)
-{
-    WidgetList	wgtIds = NULL;
-    int		wgtCount = 0;
-    Widget	inst;
-    Widget	current;
-    String	tmp;
-    String	start;
-    String	widget;
-    char       *ptr;
-
-    /*
-     * For backward compatibility, remove [ and ] from the list.
-     */
-    tmp = start = XtNewString(stringList);
-    if((start = strchr(start, '[')) != NULL) start++;
-    else start = tmp;
-
-    while((start && *start) && isspace(*start))
-    {
-	start++;
-    }
-    ptr = strrchr(start, ']');
-    if (ptr)
-    {
-	*ptr = '\0';
-    }
-
-    ptr = start + strlen(start) - 1;
-    while(ptr && *ptr)
-    {
-	if (isspace(*ptr))
-	{
-	    ptr--;
-	}
-	else
-	{
-	    ptr++;
-	    break;
-	}
-    }
-    if (ptr && *ptr)
-    {
-	*ptr = '\0';
-    }
-
-    /*
-     * start now points to the first character after the [.
-     * the list is now either empty, one, or more widget
-     * instance names.
-     */
-    start = strtok(start, ",");
-    while(start)
-    {
-        while((start && *start) && isspace(*start))
-        {
-            start++;
-        }
-        ptr = start + strlen(start) - 1;
-        while(ptr && *ptr)
-        {
-            if (isspace(*ptr))
-            {
-                ptr--;
-            }
-            else
-            {
-                ptr++;
-                break;
-            }
-        }
-        if (ptr && *ptr)
-        {
-            *ptr = '\0';
-        }
-
-	/*
-	 * Form a string to use with XtNameToWidget().
-	 */
-        widget = (char *)XtMalloc((strlen(start) + 2) * sizeof(char));
-        sprintf(widget, "*%s", start);
-
-	/*
-	 * Start at this level and continue up until the widget is found
-	 * or until the top of the hierarchy is reached.
-	 */
-	current = ref;
-	while (current != NULL)
-	{
-	    inst = XtNameToWidget(current, widget);
-	    if (inst != NULL )
-	    {
-		wgtCount++;
-		wgtIds = (WidgetList)XtRealloc((char *)wgtIds,
-					       wgtCount * sizeof(Widget));
-		wgtIds[wgtCount - 1] = inst;
-		break;
-	    }
-	    current = XtParent(current);
-	}
-
-	if (current == NULL)
-        {
-            printf("Callback Error (%s):\n\t\
-Cannot find widget %s\n", cbName, widget);
-        }
-        XtFree(widget);
-        start = strtok(NULL, ",");
-    }
-
-    /*
-     * NULL terminate the list.
-     */
-    wgtIds = (WidgetList)XtRealloc((char *)wgtIds,
-				   (wgtCount + 1) * sizeof(Widget));
-    wgtIds[wgtCount] = NULL;
-
-    XtFree((char *)tmp);
-    return(wgtIds);
-}
-#endif /* _BX_WIDGETIDS_FROM_NAMES */
-
-XtPointer BX_SINGLE
-    ARGLIST((val))
-    GRA(float, val)
-{
-    XtPointer pointer;
-
-    pointer = (XtPointer)XtMalloc(sizeof(float));
-    if ( pointer != NULL ) *((float *)pointer) = val;
-    return(pointer);
-}
-
-#ifdef DEFINE_OLD_BXUTILS
-XtPointer SINGLE
-    ARGLIST((val))
-    GRA(float, val)
-{
-    return(BX_SINGLE(val));
-}
-#endif /* DEFINE_OLD_BXUTILS */
-
-XtPointer BX_DOUBLE
-    ARGLIST((val))
-    GRA(double, val)
-{
-    XtPointer	pointer;
-
-    pointer = (XtPointer)XtMalloc(sizeof(double));
-    if ( pointer != NULL ) *((double *)pointer) = val;
-    return(pointer);
-}
-
-#ifdef DEFINE_OLD_BXUTILS
-XtPointer DOUBLE
-    ARGLIST((val))
-    GRA(double, val)
-{
-    return(BX_DOUBLE(val));
-}
-#endif /* DEFINE_OLD_BXUTILS */
-
-
-/****************************************************************************
- *
- * Big chunk of code inserted from Bull (based on modified 3.3)
- *
- ****************************************************************************/
-
-#ifndef IGNORE_XPM_PIXMAP
-
-#ifndef USE_XPM_LIBRARY
-
-#ifdef SYSV
-#include <memory.h>
-#endif
-
-/*
- * Copyright 1990, 1991 GROUPE BULL
- *
- * Permission to use, copy, modify, and distribute this software and its
- * documentation for any purpose and without fee is hereby granted, provided
- * that the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of GROUPE BULL not be used in advertising
- * or publicity pertaining to distribution of the software without specific,
- * written prior permission.  GROUPE BULL makes no representations about the
- * suitability of this software for any purpose.  It is provided "as is"
- * without express or implied warranty.
- *
- * GROUPE BULL disclaims all warranties with regard to this software,
- * including all implied warranties of merchantability and fitness,
- * in no event shall GROUPE BULL be liable for any special,
- * indirect or consequential damages or any damages
- * whatsoever resulting from loss of use, data or profits,
- * whether in an action of contract, negligence or other tortious
- * action, arising out of or in connection with the use
- * or performance of this software.
- *
- */
-
-/* Return ErrorStatus codes:
- * null     if full success
- * positive if partial success
- * negative if failure
- */
-
-#define BxXpmColorError    1
-#define BxXpmSuccess       0
-#define BxXpmOpenFailed   -1
-#define BxXpmFileInvalid  -2
-#define BxXpmNoMemory     -3
-#define BxXpmColorFailed  -4
-
-typedef struct {
-    char *name;                         /* Symbolic color name */
-    char *value;                        /* Color value */
-    Pixel pixel;                        /* Color pixel */
-} 	BxXpmColorSymbol;
-
-typedef struct {
-    unsigned long valuemask;            /* Specifies which attributes are
-                                         * defined */
-
-    Visual *visual;                     /* Specifies the visual to use */
-    Colormap colormap;                  /* Specifies the colormap to use */
-    unsigned int depth;                 /* Specifies the depth */
-    unsigned int width;                 /* Returns the width of the created
-                                         * pixmap */
-    unsigned int height;                /* Returns the height of the created
-                                         * pixmap */
-    unsigned int x_hotspot;             /* Returns the x hotspot's
-                                         * coordinate */
-    unsigned int y_hotspot;             /* Returns the y hotspot's
-                                         * coordinate */
-    unsigned int cpp;                   /* Specifies the number of char per
-                                         * pixel */
-    Pixel *pixels;                      /* List of used color pixels */
-    unsigned int npixels;               /* Number of pixels */
-    BxXpmColorSymbol *colorsymbols;       /* Array of color symbols to
-                                         * override */
-    unsigned int numsymbols;            /* Number of symbols */
-    char *rgb_fname;                    /* RGB text file name */
-
-    /* Infos */
-    unsigned int ncolors;               /* Number of colors */
-    char ***colorTable;                 /* Color table pointer */
-    char *hints_cmt;                    /* Comment of the hints section */
-    char *colors_cmt;                   /* Comment of the colors section */
-    char *pixels_cmt;                   /* Comment of the pixels section */
-    unsigned int mask_pixel;            /* Transparent pixel's color table
-                                         * index */
-}      BxXpmAttributes;
-
-/* Xpm attribute value masks bits */
-#define BxXpmVisual          (1L<<0)
-#define BxXpmColormap        (1L<<1)
-#define BxXpmDepth           (1L<<2)
-#define BxXpmSize            (1L<<3)      /* width & height */
-#define BxXpmHotspot         (1L<<4)      /* x_hotspot & y_hotspot */
-#define BxXpmCharsPerPixel   (1L<<5)
-#define BxXpmColorSymbols    (1L<<6)
-#define BxXpmRgbFilename     (1L<<7)
-#define BxXpmInfos           (1L<<8)      /* all infos members */
-
-#define BxXpmReturnPixels    (1L<<9)
-#define BxXpmReturnInfos     BxXpmInfos
-
-/*
- * minimal portability layer between ansi and KR C
- */
-
-/* forward declaration of functions with prototypes */
-
-#ifdef NeedFunctionPrototypes
-#define LFUNC(f, t, p) static t f p
-#else
-#define LFUNC(f, t, p) static t f()
-#endif
-
-/*
- * functions declarations
- */
-LFUNC(BxXpmCreatePixmapFromData, int, (Display * display,
-				       Drawable d,
-				       char **data,
-				       Pixmap * pixmap_return,
-				       Pixmap * shapemask_return,
-				       BxXpmAttributes * attributes));
-
-LFUNC(BxXpmCreateImageFromData, int, (Display * display,
-				      char **data,
-				      XImage ** image_return,
-				      XImage ** shapemask_return,
-				      BxXpmAttributes * attributes));
-
-LFUNC(BxXpmFreeAttributes, void, (BxXpmAttributes * attributes));
-
-typedef struct {
-    unsigned int type;
-    union {
-        FILE *file;
-        char **data;
-    }     stream;
-    char *cptr;
-    unsigned int line;
-    int CommentLength;
-    char Comment[BUFSIZ];
-    char *Bcmt, *Ecmt, Bos, Eos;
-    unsigned int InsideString;          /* used during parsing: 0 or 1
-                                         * whether we are inside or not */
-}      bxxpmData;
-
-#define BXXPMARRAY 0
-#define BXXPMFILE  1
-#define BXXPMPIPE  2
-
-typedef unsigned char byte;
-
-#define BX_TRANSPARENT_COLOR "None"        /* this must be a string! */
-
-/* number of BxXpmColorKeys */
-#define BXNKEYS 5
-
-/*
- * key numbers for visual type, they must fit along with the number key of
- * each corresponding element in BxXpmColorKeys[] defined in xpm.h
- */
-#define BXMONO    2
-#define BXGRAY4   3
-#define BXGRAY    4
-#define BXCOLOR   5
-
-/* structure containing data related to an Xpm pixmap */
-typedef struct {
-    char *name;
-    unsigned int width;
-    unsigned int height;
-    unsigned int cpp;
-    unsigned int ncolors;
-    char ***colorTable;
-    unsigned int *pixelindex;
-    XColor *xcolors;
-    char **colorStrings;
-    unsigned int mask_pixel;            /* mask pixel's colorTable index */
-}      bxxpmInternAttrib;
-
-#define BX_UNDEF_PIXEL 0x80000000
-
-char *BxXpmColorKeys[] =
-{
- "s",					/* key #1: symbol */
- "m",					/* key #2: mono visual */
- "g4",					/* key #3: 4 grays visual */
- "g",					/* key #4: gray visual */
- "c",					/* key #5: color visual */
-};
-
-/* XPM private routines */
-
-LFUNC(xpmCreateImage, int, (Display * display,
-                           bxxpmInternAttrib * attrib,
-                           XImage ** image_return,
-                           XImage ** shapeimage_return,
-                           BxXpmAttributes * attributes));
-
-LFUNC(xpmParseData, int, (bxxpmData * data,
-                         bxxpmInternAttrib * attrib_return,
-                         BxXpmAttributes * attributes));
-
-LFUNC(BxXpmVisualType, int, (Visual * visual));
-LFUNC(xpmFreeColorTable, void, (char ***colorTable, int ncolors));
-
-LFUNC(xpmInitInternAttrib, void, (bxxpmInternAttrib * xmpdata));
-
-LFUNC(xpmFreeInternAttrib, void, (bxxpmInternAttrib * xmpdata));
-
-LFUNC(xpmSetAttributes, void, (bxxpmInternAttrib * attrib,
-                             BxXpmAttributes * attributes));
-
-/* I/O utility */
-
-LFUNC(xpmNextString, void, (bxxpmData * mdata));
-LFUNC(xpmNextUI, int, (bxxpmData * mdata, unsigned int *ui_return));
-LFUNC(xpmGetC, int, (bxxpmData * mdata));
-LFUNC(xpmUngetC, int, (int c, bxxpmData * mdata));
-LFUNC(xpmNextWord, unsigned int, (bxxpmData * mdata, char *buf));
-LFUNC(xpmGetCmt, void, (bxxpmData * mdata, char **cmt));
-LFUNC(xpmOpenArray, int, (char **data, bxxpmData * mdata));
-LFUNC(XpmDataClose, void, (bxxpmData * mdata));
-
-/* RGB utility */
-
-LFUNC(xpm_xynormalizeimagebits, void, (register unsigned char *bp,
-                                     register XImage * img));
-LFUNC(xpm_znormalizeimagebits, void, (register unsigned char *bp,
-                                    register XImage * img));
-
-/* Image utility */
-
-LFUNC(SetColor, int, (Display * display, Colormap colormap, char *colorname,
-		      unsigned int color_index, Pixel * image_pixel,
-		      Pixel * mask_pixel, unsigned int *mask_pixel_index));
-
-LFUNC(CreateXImage, int, (Display * display, Visual * visual,
-			  unsigned int depth, unsigned int width,
-			  unsigned int height, XImage ** image_return));
-
-LFUNC(SetImagePixels, void, (XImage * image, unsigned int width,
-			    unsigned int height, unsigned int *pixelindex,
-			    Pixel * pixels));
-
-LFUNC(SetImagePixels32, void, (XImage * image, unsigned int width,
-			      unsigned int height, unsigned int *pixelindex,
-			      Pixel * pixels));
-
-LFUNC(SetImagePixels16, void, (XImage * image, unsigned int width,
-			      unsigned int height, unsigned int *pixelindex,
-			      Pixel * pixels));
-
-LFUNC(SetImagePixels8, void, (XImage * image, unsigned int width,
-			     unsigned int height, unsigned int *pixelindex,
-			     Pixel * pixels));
-
-LFUNC(SetImagePixels1, void, (XImage * image, unsigned int width,
-			     unsigned int height, unsigned int *pixelindex,
-			     Pixel * pixels));
-
-LFUNC(atoui, unsigned int, (char *p, unsigned int l, unsigned int *ui_return));
-
-/*
- * Macros
- *
- * The BXXYNORMALIZE macro determines whether XY format data requires
- * normalization and calls a routine to do so if needed. The logic in
- * this module is designed for LSBFirst byte and bit order, so
- * normalization is done as required to present the data in this order.
- *
- * The BXZNORMALIZE macro performs byte and nibble order normalization if
- * required for Z format data.
- *
- * The BXXYINDEX macro computes the index to the starting byte (char) boundary
- * for a bitmap_unit containing a pixel with coordinates x and y for image
- * data in XY format.
- *
- * The BXZINDEX* macros compute the index to the starting byte (char) boundary
- * for a pixel with coordinates x and y for image data in ZPixmap format.
- *
- */
-
-#define BXXYNORMALIZE(bp, img) \
-    if ((img->byte_order == MSBFirst) || (img->bitmap_bit_order == MSBFirst)) \
-        xpm_xynormalizeimagebits((unsigned char *)(bp), img)
-
-#define BXZNORMALIZE(bp, img) \
-    if (img->byte_order == MSBFirst) \
-        xpm_znormalizeimagebits((unsigned char *)(bp), img)
-
-#define BXXYINDEX(x, y, img) \
-    ((y) * img->bytes_per_line) + \
-    (((x) + img->xoffset) / img->bitmap_unit) * (img->bitmap_unit >> 3)
-
-#define BXZINDEX(x, y, img) ((y) * img->bytes_per_line) + \
-    (((x) * img->bits_per_pixel) >> 3)
-
-#define BXZINDEX32(x, y, img) ((y) * img->bytes_per_line) + ((x) << 2)
-
-#define BXZINDEX16(x, y, img) ((y) * img->bytes_per_line) + ((x) << 1)
-
-#define BXZINDEX8(x, y, img) ((y) * img->bytes_per_line) + (x)
-
-#define BXZINDEX1(x, y, img) ((y) * img->bytes_per_line) + ((x) >> 3)
-
-#if __STDC__
-#define Const const
-#else
-#define Const
-#endif
-
-
-
-static unsigned int atoui
-ARGLIST((p, l, ui_return))
-ARG(register char *, p)
-ARG(unsigned int, l)
-GRA(unsigned int *, ui_return)
-{
-    register int n, i;
-
-    n = 0;
-    for (i = 0; i < l; i++)
-        if (*p >= '0' && *p <= '9')
-            n = n * 10 + *p++ - '0';
-        else
-            break;
-
-    if (i != 0 && i == l) {
-        *ui_return = n;
-        return 1;
-    } else
-        return 0;
-}
-
-static int BxXpmCreatePixmapFromData
-ARGLIST((display, d, data, pixmap_return, shapemask_return, attributes))
-ARG(Display *, display)
-ARG(Drawable, d)
-ARG(char **, data)
-ARG(Pixmap *, pixmap_return)
-ARG(Pixmap *, shapemask_return)
-GRA(BxXpmAttributes *,attributes)
-{
-    XImage *image, **imageptr = NULL;
-    XImage *shapeimage, **shapeimageptr = NULL;
-    int ErrorStatus;
-    XGCValues gcv;
-    GC gc;
-
-    /*
-     * initialize return values
-     */
-    if (pixmap_return) {
-        *pixmap_return = (Pixmap) NULL;
-        imageptr = ℑ
-    }
-    if (shapemask_return) {
-        *shapemask_return = (Pixmap) NULL;
-        shapeimageptr = &shapeimage;
-    }
-
-    /*
-     * create the images
-     */
-    ErrorStatus = BxXpmCreateImageFromData(display, data, imageptr,
-                                         shapeimageptr, attributes);
-    if (ErrorStatus < 0)
-        return (ErrorStatus);
-
-    /*
-     * create the pixmaps
-     */
-    if (imageptr && image) {
-        *pixmap_return = XCreatePixmap(display, d, image->width,
-                                       image->height, image->depth);
-        gcv.function = GXcopy;
-        gc = XCreateGC(display, *pixmap_return, GCFunction, &gcv);
-
-        XPutImage(display, *pixmap_return, gc, image, 0, 0, 0, 0,
-                  image->width, image->height);
-
-        XDestroyImage(image);
-        XFreeGC(display, gc);
-    }
-    if (shapeimageptr && shapeimage) {
-        *shapemask_return = XCreatePixmap(display, d, shapeimage->width,
-                                          shapeimage->height,
-                                          shapeimage->depth);
-        gcv.function = GXcopy;
-        gc = XCreateGC(display, *shapemask_return, GCFunction, &gcv);
-
-        XPutImage(display, *shapemask_return, gc, shapeimage, 0, 0, 0, 0,
-                  shapeimage->width, shapeimage->height);
-
-        XDestroyImage(shapeimage);
-        XFreeGC(display, gc);
-    }
-    return (ErrorStatus);
-}
-
-
-static int BxXpmCreateImageFromData
-ARGLIST((display, data, image_return, shapeimage_return, attributes))
-ARG(Display *,display)
-ARG(char **, data)
-ARG(XImage **, image_return)
-ARG(XImage **, shapeimage_return)
-GRA(BxXpmAttributes *, attributes)
-{
-    bxxpmData mdata;
-    int ErrorStatus;
-    bxxpmInternAttrib attrib;
-
-    /*
-     * initialize return values
-     */
-    if (image_return)
-        *image_return = NULL;
-    if (shapeimage_return)
-        *shapeimage_return = NULL;
-
-    if ((ErrorStatus = xpmOpenArray(data, &mdata)) != BxXpmSuccess)
-        return (ErrorStatus);
-
-    xpmInitInternAttrib(&attrib);
-
-    ErrorStatus = xpmParseData(&mdata, &attrib, attributes);
-
-    if (ErrorStatus == BxXpmSuccess)
-        ErrorStatus = xpmCreateImage(display, &attrib, image_return,
-                                     shapeimage_return, attributes);
-
-    if (ErrorStatus >= 0)
-        xpmSetAttributes(&attrib, attributes);
-    else if (attributes)
-        BxXpmFreeAttributes(attributes);
-
-    xpmFreeInternAttrib(&attrib);
-    XpmDataClose(&mdata);
-
-    return (ErrorStatus);
-}
-
-/*
- * open the given array to be read or written as an bxxpmData which is returned
- */
-static int xpmOpenArray
-ARGLIST((data, mdata))
-ARG(char **,data)
-GRA(bxxpmData *,mdata)
-{
-    mdata->type = BXXPMARRAY;
-    mdata->stream.data = data;
-    mdata->cptr = *data;
-    mdata->line = 0;
-    mdata->CommentLength = 0;
-    mdata->Bcmt = mdata->Ecmt = NULL;
-    mdata->Bos = mdata->Eos = '\0';
-    mdata->InsideString = 0;
-    return (BxXpmSuccess);
-}
-
-/*
- * Intialize the bxxpmInternAttrib pointers to Null to know
- * which ones must be freed later on.
- */
-static void xpmInitInternAttrib
-ARGLIST((attrib))
-GRA(bxxpmInternAttrib *,attrib)
-{
-    attrib->ncolors = 0;
-    attrib->colorTable = NULL;
-    attrib->pixelindex = NULL;
-    attrib->xcolors = NULL;
-    attrib->colorStrings = NULL;
-    attrib->mask_pixel = BX_UNDEF_PIXEL;
-}
-
-/* function call in case of error, frees only localy allocated variables */
-#undef RETURN
-#define RETURN(status) \
-  { if (colorTable) xpmFreeColorTable(colorTable, ncolors); \
-    if (chars) free(chars); \
-    if (pixelindex) free((char *)pixelindex); \
-    if (hints_cmt)  free((char *)hints_cmt); \
-    if (colors_cmt) free((char *)colors_cmt); \
-    if (pixels_cmt) free((char *)pixels_cmt); \
-    return(status); }
-
-/*
- * This function parses an Xpm file or data and store the found informations
- * in an an bxxpmInternAttrib structure which is returned.
- */
-static int xpmParseData
-ARGLIST((data, attrib_return, attributes))
-ARG(bxxpmData *,data)
-ARG(bxxpmInternAttrib *, attrib_return)
-GRA(BxXpmAttributes *, attributes)
-{
-    /* variables to return */
-    unsigned int width, height;
-    unsigned int ncolors = 0;
-    unsigned int cpp;
-    unsigned int x_hotspot, y_hotspot, hotspot = 0;
-    char ***colorTable = NULL;
-    unsigned int *pixelindex = NULL;
-    char *hints_cmt = NULL;
-    char *colors_cmt = NULL;
-    char *pixels_cmt = NULL;
-
-    /* calculation variables */
-    unsigned int rncolors = 0;		/* read number of colors, it is
-					 * different to ncolors to avoid
-					 * problem when freeing the
-					 * colorTable in case an error
-					 * occurs while reading the hints
-					 * line */
-    unsigned int key;			/* color key */
-    char *chars = NULL, buf[BUFSIZ];
-    unsigned int *iptr;
-    unsigned int a, b, x, y, l;
-
-    unsigned int curkey;		/* current color key */
-    unsigned int lastwaskey;		/* key read */
-    char curbuf[BUFSIZ];		/* current buffer */
-
-    /*
-     * read hints: width, height, ncolors, chars_per_pixel
-     */
-    if (!(xpmNextUI(data, &width) && xpmNextUI(data, &height)
-	  && xpmNextUI(data, &rncolors) && xpmNextUI(data, &cpp)))
-	RETURN(BxXpmFileInvalid);
-
-    ncolors = rncolors;
-
-    /*
-     * read hotspot coordinates if any
-     */
-    hotspot = xpmNextUI(data, &x_hotspot) && xpmNextUI(data, &y_hotspot);
-
-    /*
-     * store the hints comment line
-     */
-    if (attributes && (attributes->valuemask & BxXpmReturnInfos))
-	xpmGetCmt(data, &hints_cmt);
-
-    /*
-     * read colors
-     */
-    colorTable = (char ***) calloc(ncolors, sizeof(char **));
-    if (!colorTable)
-	RETURN(BxXpmNoMemory);
-
-    for (a = 0; a < ncolors; a++) {
-	xpmNextString(data);		/* skip the line */
-	colorTable[a] = (char **) calloc((BXNKEYS + 1), sizeof(char *));
-	if (!colorTable[a])
-	    RETURN(BxXpmNoMemory);
-
-	/*
-	 * read pixel value
-	 */
-	colorTable[a][0] = (char *) malloc(cpp);
-	if (!colorTable[a][0])
-	    RETURN(BxXpmNoMemory);
-	for (b = 0; b < cpp; b++)
-	    colorTable[a][0][b] = xpmGetC(data);
-
-	/*
-	 * read color keys and values
-	 */
-	curkey = 0;
-	lastwaskey = 0;
-	while ((l = xpmNextWord(data, buf))) {
-	    if (!lastwaskey) {
-		for (key = 1; key < BXNKEYS + 1; key++)
-		    if ((strlen(BxXpmColorKeys[key - 1]) == l)
-			&& (!strncmp(BxXpmColorKeys[key - 1], buf, l)))
-			break;
-	    }
-	    if (!lastwaskey && key <= BXNKEYS) {	/* open new key */
-		if (curkey) {		/* flush string */
-		    colorTable[a][curkey] =
-			(char *) malloc(strlen(curbuf) + 1);
-		    if (!colorTable[a][curkey])
-			RETURN(BxXpmNoMemory);
-		    strcpy(colorTable[a][curkey], curbuf);
-		}
-		curkey = key;		/* set new key  */
-		curbuf[0] = '\0';	/* reset curbuf */
-		lastwaskey = 1;
-	    } else {
-		if (!curkey)
-		    RETURN(BxXpmFileInvalid);	/* key without value */
-		if (!lastwaskey)
-		    strcat(curbuf, " ");/* append space */
-		buf[l] = '\0';
-		strcat(curbuf, buf);	/* append buf */
-		lastwaskey = 0;
-	    }
-	}
-	if (!curkey)
-	    RETURN(BxXpmFileInvalid);	/* key without value */
-	colorTable[a][curkey] = (char *) malloc(strlen(curbuf) + 1);
-	if (!colorTable[a][curkey])
-	    RETURN(BxXpmNoMemory);
-	strcpy(colorTable[a][curkey], curbuf);
-    }
-
-    /*
-     * store the colors comment line
-     */
-    if (attributes && (attributes->valuemask & BxXpmReturnInfos))
-	xpmGetCmt(data, &colors_cmt);
-
-    /*
-     * read pixels and index them on color number
-     */
-    pixelindex =
-	(unsigned int *) malloc(sizeof(unsigned int) * width * height);
-    if (!pixelindex)
-	RETURN(BxXpmNoMemory);
-
-    iptr = pixelindex;
-
-    chars = (char *) malloc(cpp);
-    if (!chars)
-	RETURN(BxXpmNoMemory);
-
-    for (y = 0; y < height; y++) {
-	xpmNextString(data);
-	for (x = 0; x < width; x++, iptr++) {
-	    for (a = 0; a < cpp; a++)
-		chars[a] = xpmGetC(data);
-	    for (a = 0; a < ncolors; a++)
-		if (!strncmp(colorTable[a][0], chars, cpp))
-		    break;
-	    if (a == ncolors)
-		RETURN(BxXpmFileInvalid);	/* no color matches */
-	    *iptr = a;
-	}
-    }
-
-    /*
-     * store the pixels comment line
-     */
-    if (attributes && (attributes->valuemask & BxXpmReturnInfos))
-	xpmGetCmt(data, &pixels_cmt);
-
-    free(chars);
-
-    /*
-     * store found informations in the bxxpmInternAttrib structure
-     */
-    attrib_return->width = width;
-    attrib_return->height = height;
-    attrib_return->cpp = cpp;
-    attrib_return->ncolors = ncolors;
-    attrib_return->colorTable = colorTable;
-    attrib_return->pixelindex = pixelindex;
-
-    if (attributes) {
-	if (attributes->valuemask & BxXpmReturnInfos) {
-	    attributes->hints_cmt = hints_cmt;
-	    attributes->colors_cmt = colors_cmt;
-	    attributes->pixels_cmt = pixels_cmt;
-	}
-	if (hotspot) {
-	    attributes->x_hotspot = x_hotspot;
-	    attributes->y_hotspot = y_hotspot;
-	    attributes->valuemask |= BxXpmHotspot;
-	}
-    }
-    return (BxXpmSuccess);
-}
-
-/*
- * set the color pixel related to the given colorname,
- * return 0 if success, 1 otherwise.
- */
-
-static int SetColor
-ARGLIST((display, colormap,colorname, color_index, image_pixel, mask_pixel, mask_pixel_index))
-ARG(Display *, display)
-ARG(Colormap, colormap)
-ARG(char *, colorname)
-ARG(unsigned int, color_index)
-ARG(Pixel *, image_pixel)
-ARG(Pixel *, mask_pixel)
-GRA(unsigned int *, mask_pixel_index)
-{
-    XColor xcolor;
-
-    if (STRCASECMP(colorname, BX_TRANSPARENT_COLOR)) {
-	if (!XParseColor(display, colormap, colorname, &xcolor)
-	    || (!XAllocColor(display, colormap, &xcolor)))
-	    return (1);
-	*image_pixel = xcolor.pixel;
-	*mask_pixel = 1;
-    } else {
-	*image_pixel = 0;
-	*mask_pixel = 0;
-	*mask_pixel_index = color_index;/* store the color table index */
-    }
-    return (0);
-}
-
-/* function call in case of error, frees only localy allocated variables */
-#undef RETURN
-#define RETURN(status) \
-  { if (image) XDestroyImage(image); \
-    if (shapeimage) XDestroyImage(shapeimage); \
-    if (image_pixels) free((char *)image_pixels); \
-    if (mask_pixels) free((char *)mask_pixels); \
-    return(status); }
-
-static int xpmCreateImage
-ARGLIST((display, attrib, image_return, shapeimage_return, attributes))
-ARG(Display *, display)
-ARG(bxxpmInternAttrib *, attrib)
-ARG(XImage **, image_return)
-ARG(XImage **, shapeimage_return)
-GRA(BxXpmAttributes *, attributes)
-{
-    /* variables stored in the BxXpmAttributes structure */
-    Visual *visual;
-    Colormap colormap;
-    unsigned int depth;
-    BxXpmColorSymbol *colorsymbols;
-    unsigned int numsymbols;
-
-    /* variables to return */
-    XImage *image = NULL;
-    XImage *shapeimage = NULL;
-    unsigned int mask_pixel;
-    unsigned int ErrorStatus, ErrorStatus2;
-
-    /* calculation variables */
-    Pixel *image_pixels = NULL;
-    Pixel *mask_pixels = NULL;
-    char *colorname;
-    unsigned int a, b, l;
-    Boolean pixel_defined;
-    unsigned int key;
-
-
-    /*
-     * retrieve information from the BxXpmAttributes
-     */
-    if (attributes && attributes->valuemask & BxXpmColorSymbols) {
-	colorsymbols = attributes->colorsymbols;
-	numsymbols = attributes->numsymbols;
-    } else
-	numsymbols = 0;
-
-    if (attributes && attributes->valuemask & BxXpmVisual)
-	visual = attributes->visual;
-    else
-	visual = DefaultVisual(display, DefaultScreen(display));
-
-    if (attributes && attributes->valuemask & BxXpmColormap)
-	colormap = attributes->colormap;
-    else
-	colormap = DefaultColormap(display, DefaultScreen(display));
-
-    if (attributes && attributes->valuemask & BxXpmDepth)
-	depth = attributes->depth;
-    else
-	depth = DefaultDepth(display, DefaultScreen(display));
-
-
-    ErrorStatus = BxXpmSuccess;
-
-    /*
-     * alloc pixels index tables
-     */
-
-    key = BxXpmVisualType(visual);
-    image_pixels = (Pixel *) malloc(sizeof(Pixel) * attrib->ncolors);
-    if (!image_pixels)
-	RETURN(BxXpmNoMemory);
-
-    mask_pixels = (Pixel *) malloc(sizeof(Pixel) * attrib->ncolors);
-    if (!mask_pixels)
-	RETURN(BxXpmNoMemory);
-
-    mask_pixel = BX_UNDEF_PIXEL;
-
-    /*
-     * get pixel colors, store them in index tables
-     */
-    for (a = 0; a < attrib->ncolors; a++) {
-	colorname = NULL;
-	pixel_defined = False;
-
-	/*
-	 * look for a defined symbol
-	 */
-	if (numsymbols && attrib->colorTable[a][1]) {
-	    for (l = 0; l < numsymbols; l++)
-		if (!strcmp(colorsymbols[l].name, attrib->colorTable[a][1]))
-		    break;
-	    if (l != numsymbols) {
-		if (colorsymbols[l].value)
-		    colorname = colorsymbols[l].value;
-		else
-		    pixel_defined = True;
-	    }
-	}
-	if (!pixel_defined) {		/* pixel not given as symbol value */
-
-	    if (colorname) {		/* colorname given as symbol value */
-		if (!SetColor(display, colormap, colorname, a,
-			   &image_pixels[a], &mask_pixels[a], &mask_pixel))
-		    pixel_defined = True;
-		else
-		    ErrorStatus = BxXpmColorError;
-	    }
-	    b = key;
-	    while (!pixel_defined && b > 1) {
-		if (attrib->colorTable[a][b]) {
-		    if (!SetColor(display, colormap, attrib->colorTable[a][b],
-				  a, &image_pixels[a], &mask_pixels[a],
-				  &mask_pixel)) {
-			pixel_defined = True;
-			break;
-		    } else
-			ErrorStatus = BxXpmColorError;
-		}
-		b--;
-	    }
-
-	    b = key + 1;
-	    while (!pixel_defined && b < BXNKEYS + 1) {
-		if (attrib->colorTable[a][b]) {
-		    if (!SetColor(display, colormap, attrib->colorTable[a][b],
-				  a, &image_pixels[a], &mask_pixels[a],
-				  &mask_pixel)) {
-			pixel_defined = True;
-			break;
-		    } else
-			ErrorStatus = BxXpmColorError;
-		}
-		b++;
-	    }
-
-	    if (!pixel_defined)
-		RETURN(BxXpmColorFailed);
-
-	} else {
-	    image_pixels[a] = colorsymbols[l].pixel;
-	    mask_pixels[a] = 1;
-	}
-    }
-
-    /*
-     * create the image
-     */
-    if (image_return) {
-	ErrorStatus2 = CreateXImage(display, visual, depth,
-				    attrib->width, attrib->height, &image);
-	if (ErrorStatus2 != BxXpmSuccess)
-	    RETURN(ErrorStatus2);
-
-	/*
-	 * set the image data
-	 *
-	 * In case depth is 1 or bits_per_pixel is 4, 6, 8, 24 or 32 use
-	 * optimized functions, otherwise use slower but sure general one.
-	 *
-	 */
-
-	if (image->depth == 1)
-	    SetImagePixels1(image, attrib->width, attrib->height,
-			    attrib->pixelindex, image_pixels);
-	else if (image->bits_per_pixel == 8)
-	    SetImagePixels8(image, attrib->width, attrib->height,
-			    attrib->pixelindex, image_pixels);
-	else if (image->bits_per_pixel == 16)
-	    SetImagePixels16(image, attrib->width, attrib->height,
-			     attrib->pixelindex, image_pixels);
-	else if (image->bits_per_pixel == 32)
-	    SetImagePixels32(image, attrib->width, attrib->height,
-			     attrib->pixelindex, image_pixels);
-	else
-	    SetImagePixels(image, attrib->width, attrib->height,
-			   attrib->pixelindex, image_pixels);
-    }
-
-    /*
-     * create the shape mask image
-     */
-    if (mask_pixel != BX_UNDEF_PIXEL && shapeimage_return) {
-	ErrorStatus2 = CreateXImage(display, visual, 1, attrib->width,
-				    attrib->height, &shapeimage);
-	if (ErrorStatus2 != BxXpmSuccess)
-	    RETURN(ErrorStatus2);
-
-	SetImagePixels1(shapeimage, attrib->width, attrib->height,
-			attrib->pixelindex, mask_pixels);
-    }
-    free((char *)mask_pixels);
-
-    /*
-     * if requested store allocated pixels in the BxXpmAttributes structure
-     */
-    if (attributes &&
-	(attributes->valuemask & BxXpmReturnInfos
-	 || attributes->valuemask & BxXpmReturnPixels)) {
-	if (mask_pixel != BX_UNDEF_PIXEL) {
-	    Pixel *pixels, *p1, *p2;
-
-	    attributes->npixels = attrib->ncolors - 1;
-	    pixels = (Pixel *) malloc(sizeof(Pixel) * attributes->npixels);
-	    if (pixels) {
-		p1 = image_pixels;
-		p2 = pixels;
-		for (a = 0; a < attrib->ncolors; a++, p1++)
-		    if (a != mask_pixel)
-			*p2++ = *p1;
-		attributes->pixels = pixels;
-	    } else {
-		/* if error just say we can't return requested data */
-		attributes->valuemask &= ~BxXpmReturnPixels;
-		attributes->valuemask &= ~BxXpmReturnInfos;
-		attributes->pixels = NULL;
-		attributes->npixels = 0;
-	    }
-	    free((char *)image_pixels);
-	} else {
-	    attributes->pixels = image_pixels;
-	    attributes->npixels = attrib->ncolors;
-	}
-	attributes->mask_pixel = mask_pixel;
-    } else
-	free((char *)image_pixels);
-
-
-    /*
-     * return created images
-     */
-    if (image_return)
-	*image_return = image;
-
-    if (shapeimage_return)
-	*shapeimage_return = shapeimage;
-
-    return (ErrorStatus);
-}
-
-
-/*
- * Create an XImage
- */
-static int CreateXImage
-ARGLIST((display, visual, depth, width, height, image_return))
-ARG(Display *, display)
-ARG(Visual *, visual)
-ARG(unsigned int, depth)
-ARG(unsigned int, width)
-ARG(unsigned int, height)
-GRA(XImage **, image_return)
-{
-    int bitmap_pad;
-
-    /* first get bitmap_pad */
-    if (depth > 16)
-	bitmap_pad = 32;
-    else if (depth > 8)
-	bitmap_pad = 16;
-    else
-	bitmap_pad = 8;
-
-    /* then create the XImage with data = NULL and bytes_per_line = 0 */
-
-    *image_return = XCreateImage(display, visual, depth, ZPixmap, 0, 0,
-				 width, height, bitmap_pad, 0);
-    if (!*image_return)
-	return (BxXpmNoMemory);
-
-    /* now that bytes_per_line must have been set properly alloc data */
-
-    (*image_return)->data =
-	(char *) malloc((*image_return)->bytes_per_line * height);
-
-    if (!(*image_return)->data) {
-	XDestroyImage(*image_return);
-	*image_return = NULL;
-	return (BxXpmNoMemory);
-    }
-    return (BxXpmSuccess);
-}
-
-
-/*
- * The functions below are written from X11R5 MIT's code (XImUtil.c)
- *
- * The idea is to have faster functions than the standard XPutPixel function
- * to build the image data. Indeed we can speed up things by supressing tests
- * performed for each pixel. We do exactly the same tests but at the image
- * level. Assuming that we use only ZPixmap images.
- */
-
-LFUNC(_putbits, void, (register char *src, int dstoffset,
-		      register int numbits, register char *dst));
-
-LFUNC(_XReverse_Bytes, void, (register unsigned char *bpt, register int nb));
-
-static unsigned char Const _reverse_byte[0x100] = {
-			    0x00, 0x80, 0x40, 0xc0, 0x20, 0xa0, 0x60, 0xe0,
-			    0x10, 0x90, 0x50, 0xd0, 0x30, 0xb0, 0x70, 0xf0,
-			    0x08, 0x88, 0x48, 0xc8, 0x28, 0xa8, 0x68, 0xe8,
-			    0x18, 0x98, 0x58, 0xd8, 0x38, 0xb8, 0x78, 0xf8,
-			    0x04, 0x84, 0x44, 0xc4, 0x24, 0xa4, 0x64, 0xe4,
-			    0x14, 0x94, 0x54, 0xd4, 0x34, 0xb4, 0x74, 0xf4,
-			    0x0c, 0x8c, 0x4c, 0xcc, 0x2c, 0xac, 0x6c, 0xec,
-			    0x1c, 0x9c, 0x5c, 0xdc, 0x3c, 0xbc, 0x7c, 0xfc,
-			    0x02, 0x82, 0x42, 0xc2, 0x22, 0xa2, 0x62, 0xe2,
-			    0x12, 0x92, 0x52, 0xd2, 0x32, 0xb2, 0x72, 0xf2,
-			    0x0a, 0x8a, 0x4a, 0xca, 0x2a, 0xaa, 0x6a, 0xea,
-			    0x1a, 0x9a, 0x5a, 0xda, 0x3a, 0xba, 0x7a, 0xfa,
-			    0x06, 0x86, 0x46, 0xc6, 0x26, 0xa6, 0x66, 0xe6,
-			    0x16, 0x96, 0x56, 0xd6, 0x36, 0xb6, 0x76, 0xf6,
-			    0x0e, 0x8e, 0x4e, 0xce, 0x2e, 0xae, 0x6e, 0xee,
-			    0x1e, 0x9e, 0x5e, 0xde, 0x3e, 0xbe, 0x7e, 0xfe,
-			    0x01, 0x81, 0x41, 0xc1, 0x21, 0xa1, 0x61, 0xe1,
-			    0x11, 0x91, 0x51, 0xd1, 0x31, 0xb1, 0x71, 0xf1,
-			    0x09, 0x89, 0x49, 0xc9, 0x29, 0xa9, 0x69, 0xe9,
-			    0x19, 0x99, 0x59, 0xd9, 0x39, 0xb9, 0x79, 0xf9,
-			    0x05, 0x85, 0x45, 0xc5, 0x25, 0xa5, 0x65, 0xe5,
-			    0x15, 0x95, 0x55, 0xd5, 0x35, 0xb5, 0x75, 0xf5,
-			    0x0d, 0x8d, 0x4d, 0xcd, 0x2d, 0xad, 0x6d, 0xed,
-			    0x1d, 0x9d, 0x5d, 0xdd, 0x3d, 0xbd, 0x7d, 0xfd,
-			    0x03, 0x83, 0x43, 0xc3, 0x23, 0xa3, 0x63, 0xe3,
-			    0x13, 0x93, 0x53, 0xd3, 0x33, 0xb3, 0x73, 0xf3,
-			    0x0b, 0x8b, 0x4b, 0xcb, 0x2b, 0xab, 0x6b, 0xeb,
-			    0x1b, 0x9b, 0x5b, 0xdb, 0x3b, 0xbb, 0x7b, 0xfb,
-			    0x07, 0x87, 0x47, 0xc7, 0x27, 0xa7, 0x67, 0xe7,
-			    0x17, 0x97, 0x57, 0xd7, 0x37, 0xb7, 0x77, 0xf7,
-			    0x0f, 0x8f, 0x4f, 0xcf, 0x2f, 0xaf, 0x6f, 0xef,
-			     0x1f, 0x9f, 0x5f, 0xdf, 0x3f, 0xbf, 0x7f, 0xff
-};
-
-static void _XReverse_Bytes
-ARGLIST((bpt, nb))
-ARG(register unsigned char *, bpt)
-GRA(register int, nb)
-{
-    do {
-	*bpt = _reverse_byte[*bpt];
-	bpt++;
-    } while (--nb > 0);
-}
-
-static void xpm_xynormalizeimagebits
-ARGLIST((bp,img))
-ARG(register unsigned char *, bp)
-GRA(register XImage *, img)
-{
-    register unsigned char c;
-
-    if (img->byte_order != img->bitmap_bit_order) {
-	switch (img->bitmap_unit) {
-
-	case 16:
-	    c = *bp;
-	    *bp = *(bp + 1);
-	    *(bp + 1) = c;
-	    break;
-
-	case 32:
-	    c = *(bp + 3);
-	    *(bp + 3) = *bp;
-	    *bp = c;
-	    c = *(bp + 2);
-	    *(bp + 2) = *(bp + 1);
-	    *(bp + 1) = c;
-	    break;
-	}
-    }
-    if (img->bitmap_bit_order == MSBFirst)
-	_XReverse_Bytes(bp, img->bitmap_unit >> 3);
-}
-
-static void xpm_znormalizeimagebits
-ARGLIST((bp,img))
-ARG(register unsigned char *, bp)
-GRA(register XImage *, img)
-{
-    register unsigned char c;
-
-    switch (img->bits_per_pixel) {
-
-    case 4:
-	*bp = ((*bp >> 4) & 0xF) | ((*bp << 4) & ~0xF);
-	break;
-
-    case 16:
-	c = *bp;
-	*bp = *(bp + 1);
-	*(bp + 1) = c;
-	break;
-
-    case 24:
-	c = *(bp + 2);
-	*(bp + 2) = *bp;
-	*bp = c;
-	break;
-
-    case 32:
-	c = *(bp + 3);
-	*(bp + 3) = *bp;
-	*bp = c;
-	c = *(bp + 2);
-	*(bp + 2) = *(bp + 1);
-	*(bp + 1) = c;
-	break;
-    }
-}
-
-static unsigned char Const _lomask[0x09] = {
-		     0x00, 0x01, 0x03, 0x07, 0x0f, 0x1f, 0x3f, 0x7f, 0xff};
-static unsigned char Const _himask[0x09] = {
-		     0xff, 0xfe, 0xfc, 0xf8, 0xf0, 0xe0, 0xc0, 0x80, 0x00};
-
-static void _putbits
-ARGLIST((src, dstoffset, numbits, dst))
-ARG(register char *, src)		/* address of source bit string */
-ARG(int, dstoffset)			/* bit offset into destination;
-					 * range is 0-31 */
-ARG(register int, numbits)		/* number of bits to copy to
-					 * destination */
-GRA(register char *, dst)		/* address of destination bit string */
-{
-    register unsigned char chlo, chhi;
-    int hibits;
-
-    dst = dst + (dstoffset >> 3);
-    dstoffset = dstoffset & 7;
-    hibits = 8 - dstoffset;
-    chlo = *dst & _lomask[dstoffset];
-    for (;;) {
-	chhi = (*src << dstoffset) & _himask[dstoffset];
-	if (numbits <= hibits) {
-	    chhi = chhi & _lomask[dstoffset + numbits];
-	    *dst = (*dst & _himask[dstoffset + numbits]) | chlo | chhi;
-	    break;
-	}
-	*dst = chhi | chlo;
-	dst++;
-	numbits = numbits - hibits;
-	chlo = (unsigned char) (*src & _himask[hibits]) >> hibits;
-	src++;
-	if (numbits <= dstoffset) {
-	    chlo = chlo & _lomask[numbits];
-	    *dst = (*dst & _himask[numbits]) | chlo;
-	    break;
-	}
-	numbits = numbits - dstoffset;
-    }
-}
-
-/*
- * Default method to write pixels into a Z image data structure.
- * The algorithm used is:
- *
- *	copy the destination bitmap_unit or Zpixel to temp
- *	normalize temp if needed
- *	copy the pixel bits into the temp
- *	renormalize temp if needed
- *	copy the temp back into the destination image data
- */
-
-static void SetImagePixels
-ARGLIST((image, width, height, pixelindex, pixels))
-ARG(XImage *, image)
-ARG(unsigned int, width)
-ARG(unsigned int, height)
-ARG(unsigned int *, pixelindex)
-GRA(Pixel *, pixels)
-{
-    Pixel pixel;
-    unsigned long px;
-    register char *src;
-    register char *dst;
-    int nbytes;
-    register unsigned int *iptr;
-    register int x, y, i;
-
-    iptr = pixelindex;
-    if (image->depth == 1) {
-	for (y = 0; y < height; y++)
-	    for (x = 0; x < width; x++, iptr++) {
-		pixel = pixels[*iptr];
-		for (i = 0, px = pixel;
-		     i < sizeof(unsigned long); i++, px >>= 8)
-		    ((unsigned char *) &pixel)[i] = (unsigned char)px;
-		src = &image->data[BXXYINDEX(x, y, image)];
-		dst = (char *) &px;
-		px = 0;
-		nbytes = image->bitmap_unit >> 3;
-		for (i = nbytes; --i >= 0;)
-		    *dst++ = *src++;
-		BXXYNORMALIZE(&px, image);
-		i = ((x + image->xoffset) % image->bitmap_unit);
-		_putbits((char *) &pixel, i, 1, (char *) &px);
-		BXXYNORMALIZE(&px, image);
-		src = (char *) &px;
-		dst = &image->data[BXXYINDEX(x, y, image)];
-		for (i = nbytes; --i >= 0;)
-		    *dst++ = *src++;
-	    }
-    } else {
-	for (y = 0; y < height; y++)
-	    for (x = 0; x < width; x++, iptr++) {
-		pixel = pixels[*iptr];
-		if (image->depth == 4)
-		    pixel &= 0xf;
-		for (i = 0, px = pixel;
-		     i < sizeof(unsigned long); i++, px >>= 8)
-		    ((unsigned char *) &pixel)[i] = (unsigned char)px;
-		src = &image->data[BXZINDEX(x, y, image)];
-		dst = (char *) &px;
-		px = 0;
-		nbytes = (image->bits_per_pixel + 7) >> 3;
-		for (i = nbytes; --i >= 0;)
-		    *dst++ = *src++;
-		BXZNORMALIZE(&px, image);
-		_putbits((char *) &pixel,
-			 (x * image->bits_per_pixel) & 7,
-			 image->bits_per_pixel, (char *) &px);
-		BXZNORMALIZE(&px, image);
-		src = (char *) &px;
-		dst = &image->data[BXZINDEX(x, y, image)];
-		for (i = nbytes; --i >= 0;)
-		    *dst++ = *src++;
-	    }
-    }
-}
-
-/*
- * write pixels into a 32-bits Z image data structure
- */
-
-#ifndef WORD64
-static unsigned long byteorderpixel = MSBFirst << 24;
-
-#endif
-
-static void SetImagePixels32
-ARGLIST((image, width, height, pixelindex, pixels))
-ARG(XImage *, image)
-ARG(unsigned int, width)
-ARG(unsigned int, height)
-ARG(unsigned int *, pixelindex)
-GRA(Pixel *, pixels)
-{
-    register unsigned char *addr;
-    register unsigned int *paddr;
-    register unsigned int *iptr;
-    register int x, y;
-
-    iptr = pixelindex;
-#ifndef WORD64
-    if (*((char *) &byteorderpixel) == image->byte_order) {
-	for (y = 0; y < height; y++)
-	    for (x = 0; x < width; x++, iptr++) {
-		paddr =
-		    (unsigned int *)(&(image->data[BXZINDEX32(x, y, image)]));
-		*paddr = (unsigned int)pixels[*iptr];
-	    }
-    } else
-#endif
-    if (image->byte_order == MSBFirst)
-	for (y = 0; y < height; y++)
-	    for (x = 0; x < width; x++, iptr++) {
-		addr = &((unsigned char *) image->data)[BXZINDEX32(x, y, image)];
-		addr[0] = (unsigned char)(pixels[*iptr] >> 24);
-		addr[1] = (unsigned char)(pixels[*iptr] >> 16);
-		addr[2] = (unsigned char)(pixels[*iptr] >> 8);
-		addr[3] = (unsigned char)(pixels[*iptr]);
-	    }
-    else
-	for (y = 0; y < height; y++)
-	    for (x = 0; x < width; x++, iptr++) {
-		addr = &((unsigned char *) image->data)[BXZINDEX32(x, y, image)];
-		addr[3] = (unsigned char)(pixels[*iptr] >> 24);
-		addr[2] = (unsigned char)(pixels[*iptr] >> 16);
-		addr[1] = (unsigned char)(pixels[*iptr] >> 8);
-		addr[0] = (unsigned char)(pixels[*iptr]);
-	    }
-}
-
-/*
- * write pixels into a 16-bits Z image data structure
- */
-
-static void SetImagePixels16
-ARGLIST((image, width, height, pixelindex, pixels))
-ARG(XImage *, image)
-ARG(unsigned int, width)
-ARG(unsigned int, height)
-ARG(unsigned int *, pixelindex)
-GRA(Pixel *, pixels)
-{
-    register unsigned char *addr;
-    register unsigned int *iptr;
-    register int x, y;
-
-    iptr = pixelindex;
-    if (image->byte_order == MSBFirst)
-	for (y = 0; y < height; y++)
-	    for (x = 0; x < width; x++, iptr++) {
-		addr = &((unsigned char *) image->data)[BXZINDEX16(x, y, image)];
-		addr[0] = (unsigned char)(pixels[*iptr] >> 8);
-		addr[1] = (unsigned char)(pixels[*iptr]);
-	    }
-    else
-	for (y = 0; y < height; y++)
-	    for (x = 0; x < width; x++, iptr++) {
-		addr = &((unsigned char *) image->data)[BXZINDEX16(x, y, image)];
-		addr[1] = (unsigned char)(pixels[*iptr] >> 8);
-		addr[0] = (unsigned char)(pixels[*iptr]);
-	    }
-}
-
-/*
- * write pixels into a 8-bits Z image data structure
- */
-
-static void SetImagePixels8
-ARGLIST((image, width, height, pixelindex, pixels))
-ARG(XImage *, image)
-ARG(unsigned int, width)
-ARG(unsigned int, height)
-ARG(unsigned int *, pixelindex)
-GRA(Pixel *, pixels)
-
-{
-    register unsigned int *iptr;
-    register int x, y;
-
-    iptr = pixelindex;
-    for (y = 0; y < height; y++)
-	for (x = 0; x < width; x++, iptr++)
-	    image->data[BXZINDEX8(x, y, image)] = (char)pixels[*iptr];
-}
-
-/*
- * write pixels into a 1-bit depth image data structure and **offset null**
- */
-
-static void SetImagePixels1
-ARGLIST((image, width, height, pixelindex, pixels))
-ARG(XImage *, image)
-ARG(unsigned int, width)
-ARG(unsigned int, height)
-ARG(unsigned int *, pixelindex)
-GRA(Pixel *, pixels)
-{
-    unsigned char bit;
-    int xoff, yoff;
-    register unsigned int *iptr;
-    register int x, y;
-
-    if (image->byte_order != image->bitmap_bit_order)
-	SetImagePixels(image, width, height, pixelindex, pixels);
-    else {
-	iptr = pixelindex;
-	if (image->bitmap_bit_order == MSBFirst)
-	    for (y = 0; y < height; y++)
-		for (x = 0; x < width; x++, iptr++) {
-		    yoff = BXZINDEX1(x, y, image);
-		    xoff = x & 7;
-		    bit = 0x80 >> xoff;
-		    if (pixels[*iptr] & 1)
-			image->data[yoff] |= bit;
-		    else
-			image->data[yoff] &= ~bit;
-		}
-	else
-	    for (y = 0; y < height; y++)
-		for (x = 0; x < width; x++, iptr++) {
-		    yoff = BXZINDEX1(x, y, image);
-		    xoff = x & 7;
-		    bit = 1 << xoff;
-		    if (pixels[*iptr] & 1)
-			image->data[yoff] |= bit;
-		    else
-			image->data[yoff] &= ~bit;
-		}
-    }
-}
-
-/*
- * Store into the BxXpmAttributes structure the required informations stored in
- * the bxxpmInternAttrib structure.
- */
-
-static void xpmSetAttributes
-ARGLIST((attrib, attributes))
-ARG(bxxpmInternAttrib *, attrib)
-GRA(BxXpmAttributes *, attributes)
-{
-    if (attributes) {
-        if (attributes->valuemask & BxXpmReturnInfos) {
-            attributes->cpp = attrib->cpp;
-            attributes->ncolors = attrib->ncolors;
-            attributes->colorTable = attrib->colorTable;
-
-            attrib->ncolors = 0;
-            attrib->colorTable = NULL;
-        }
-        attributes->width = attrib->width;
-        attributes->height = attrib->height;
-        attributes->valuemask |= BxXpmSize;
-    }
-}
-
-/*
- * Free the BxXpmAttributes structure members
- * but the structure itself
- */
-
-static void BxXpmFreeAttributes
-ARGLIST((attributes))
-GRA(BxXpmAttributes *, attributes)
-{
-    if (attributes) {
-        if (attributes->valuemask & BxXpmReturnPixels && attributes->pixels) {
-            free((char *)attributes->pixels);
-            attributes->pixels = NULL;
-            attributes->npixels = 0;
-        }
-        if (attributes->valuemask & BxXpmInfos) {
-            if (attributes->colorTable) {
-                xpmFreeColorTable(attributes->colorTable, attributes->ncolors);
-                attributes->colorTable = NULL;
-                attributes->ncolors = 0;
-            }
-            if (attributes->hints_cmt) {
-                free(attributes->hints_cmt);
-                attributes->hints_cmt = NULL;
-            }
-            if (attributes->colors_cmt) {
-                free(attributes->colors_cmt);
-                attributes->colors_cmt = NULL;
-            }
-            if (attributes->pixels_cmt) {
-                free(attributes->pixels_cmt);
-                attributes->pixels_cmt = NULL;
-            }
-            if (attributes->pixels) {
-                free((char *)attributes->pixels);
-                attributes->pixels = NULL;
-            }
-        }
-        attributes->valuemask = 0;
-    }
-}
-
-/*
- * Free the bxxpmInternAttrib pointers which have been allocated
- */
-
-static void xpmFreeInternAttrib
-ARGLIST((attrib))
-GRA(bxxpmInternAttrib *, attrib)
-{
-    unsigned int a;
-
-    if (attrib->colorTable)
-        xpmFreeColorTable(attrib->colorTable, attrib->ncolors);
-    if (attrib->pixelindex)
-        free((char *)attrib->pixelindex);
-    if (attrib->xcolors)
-        free((char *)attrib->xcolors);
-    if (attrib->colorStrings) {
-        for (a = 0; a < attrib->ncolors; a++)
-            if (attrib->colorStrings[a])
-                free((char *)attrib->colorStrings[a]);
-        free((char *)attrib->colorStrings);
-    }
-}
-
-/*
- * close the file related to the bxxpmData if any
- */
-static void XpmDataClose
-ARGLIST((mdata))
-GRA(bxxpmData *, mdata)
-{
-    switch (mdata->type) {
-    case BXXPMARRAY:
-        break;
-    case BXXPMFILE:
-        if (mdata->stream.file != (stdout) && mdata->stream.file != (stdin))
-            fclose(mdata->stream.file);
-        break;
-#ifdef ZPIPE
-    case BXXPMPIPE:
-        pclose(mdata->stream.file);
-#endif
-    }
-}
-
-/*
- * skip whitespace and compute the following unsigned int,
- * returns 1 if one is found and 0 if not
- */
-static int xpmNextUI
-ARGLIST((mdata, ui_return))
-ARG(bxxpmData *, mdata)
-GRA(unsigned int *, ui_return)
-{
-    char buf[BUFSIZ];
-    int l;
-
-    l = xpmNextWord(mdata, buf);
-    return atoui(buf, l, ui_return);
-}
-
-/*
- * get the current comment line
- */
-static void xpmGetCmt
-ARGLIST((mdata, cmt))
-ARG(bxxpmData *, mdata)
-GRA(char **, cmt)
-{
-    switch (mdata->type) {
-    case BXXPMARRAY:
-        *cmt = NULL;
-        break;
-    case BXXPMFILE:
-    case BXXPMPIPE:
-        if (mdata->CommentLength) {
-            *cmt = (char *) malloc(mdata->CommentLength + 1);
-            strncpy(*cmt, mdata->Comment, mdata->CommentLength);
-            (*cmt)[mdata->CommentLength] = '\0';
-            mdata->CommentLength = 0;
-        } else
-            *cmt = NULL;
-        break;
-    }
-}
-
-/*
- * skip to the end of the current string and the beginning of the next one
- */
-static void xpmNextString
-ARGLIST((mdata))
-GRA(bxxpmData *, mdata)
-{
-    int c;
-
-    switch (mdata->type) {
-    case BXXPMARRAY:
-        mdata->cptr = (mdata->stream.data)[++mdata->line];
-        break;
-    case BXXPMFILE:
-    case BXXPMPIPE:
-        if (mdata->Eos)
-            while ((c = xpmGetC(mdata)) != mdata->Eos && c != EOF);
-        if (mdata->Bos)                 /* if not natural XPM2 */
-            while ((c = xpmGetC(mdata)) != mdata->Bos && c != EOF);
-        break;
-    }
-}
-
-/*
- * return the current character, skipping comments
- */
-static int xpmGetC
-ARGLIST((mdata))
-GRA(bxxpmData *, mdata)
-{
-    int c;
-    register unsigned int n = 0, a;
-    unsigned int notend;
-
-    switch (mdata->type) {
-    case BXXPMARRAY:
-        return (*mdata->cptr++);
-    case BXXPMFILE:
-    case BXXPMPIPE:
-        c = getc(mdata->stream.file);
-
-        if (mdata->Bos && mdata->Eos
-            && (c == mdata->Bos || c == mdata->Eos)) {
-            /* if not natural XPM2 */
-            mdata->InsideString = !mdata->InsideString;
-            return (c);
-        }
-        if (!mdata->InsideString && mdata->Bcmt && c == mdata->Bcmt[0]) {
-            mdata->Comment[0] = c;
-
-            /*
-             * skip the string begining comment
-             */
-            do {
-                c = getc(mdata->stream.file);
-                mdata->Comment[++n] = c;
-            } while (c == mdata->Bcmt[n] && mdata->Bcmt[n] != '\0'
-                     && c != EOF);
-
-            if (mdata->Bcmt[n] != '\0') {
-                /* this wasn't the begining of a comment */
-                /* put characters back in the order that we got them */
-                for (a = n; a > 0; a--)
-                    xpmUngetC(mdata->Comment[a], mdata);
-                return (mdata->Comment[0]);
-            }
-
-            /*
-             * store comment
-             */
-            mdata->Comment[0] = mdata->Comment[n];
-            notend = 1;
-            n = 0;
-            while (notend) {
-                while (mdata->Comment[n] != mdata->Ecmt[0] && c != EOF) {
-                    c = getc(mdata->stream.file);
-                    mdata->Comment[++n] = c;
-                }
-                mdata->CommentLength = n;
-                a = 0;
-                do {
-                    c = getc(mdata->stream.file);
-                    n++;
-                    a++;
-                    mdata->Comment[n] = c;
-                } while (c == mdata->Ecmt[a] && mdata->Ecmt[a] != '\0'
-                         && c != EOF);
-                if (mdata->Ecmt[a] == '\0') {
-                    /* this is the end of the comment */
-                    notend = 0;
-                    xpmUngetC(mdata->Comment[n], mdata);
-                }
-            }
-            c = xpmGetC(mdata);
-        }
-        return (c);
-    }
-    return('\0');
-}
-
-
-/*
- * push the given character back
- */
-static int xpmUngetC
-ARGLIST((c, mdata))
-ARG(int, c)
-GRA(bxxpmData *, mdata)
-{
-    switch (mdata->type) {
-    case BXXPMARRAY:
-        return (*--mdata->cptr = c);
-    case BXXPMFILE:
-    case BXXPMPIPE:
-        if (mdata->Bos && (c == mdata->Bos || c == mdata->Eos))
-            /* if not natural XPM2 */
-            mdata->InsideString = !mdata->InsideString;
-        return (ungetc(c, mdata->stream.file));
-    }
-    return('\0');
-}
-
-/*
- * skip whitespace and return the following word
- */
-static unsigned int xpmNextWord
-ARGLIST((mdata, buf))
-ARG(bxxpmData *, mdata)
-GRA(char *, buf)
-{
-    register unsigned int n = 0;
-    int c;
-
-    switch (mdata->type) {
-    case BXXPMARRAY:
-    	c = *mdata->cptr;
-        while (isspace(c) && c != mdata->Eos)
-            {
-	    mdata->cptr++;
-    	    c = *mdata->cptr;
-	    }
-        do {
-            c = *mdata->cptr++;
-            buf[n++] = c;
-        } while (!isspace(c) && c != mdata->Eos && c != '\0');
-        n--;
-        mdata->cptr--;
-        break;
-    case BXXPMFILE:
-    case BXXPMPIPE:
-        c = xpmGetC(mdata);
-        while (isspace(c) && c != mdata->Eos)
-	    c = xpmGetC(mdata);
-        while (!isspace(c) && c != mdata->Eos && c != EOF) {
-            buf[n++] = c;
-            c = xpmGetC(mdata);
-        }
-        xpmUngetC(c, mdata);
-        break;
-    }
-    return (n);
-}
-
-static int BxXpmVisualType
-ARGLIST((visual))
-GRA(Visual *, visual)
-{
-#if defined(__cplusplus) || defined(c_plusplus)
-    switch ( visual->c_class )
-#else
-    switch ( visual->class )
-#endif
-    {
-    case StaticGray:
-    case GrayScale:
-	switch (visual->map_entries)
-	{
-	case 2:
-	    return (BXMONO);
-	case 4:
-	    return (BXGRAY4);
-	default:
-	    return (BXGRAY);
-	}
-    default:
-	return (BXCOLOR);
-    }
-}
-
-/*
- * Free the computed color table
- */
-
-static void xpmFreeColorTable
-ARGLIST((colorTable, ncolors))
-ARG(char ***, colorTable)
-GRA(int, ncolors)
-{
-    int a, b;
-
-    if (colorTable) {
-        for (a = 0; a < ncolors; a++)
-            if (colorTable[a]) {
-                for (b = 0; b < (BXNKEYS + 1); b++)
-                    if (colorTable[a][b])
-                        free(colorTable[a][b]);
-                free((char *)colorTable[a]);
-            }
-        free((char *)colorTable);
-    }
-}
-
-#else /* USE_XPM_LIBRARY */
-
-#include <xpm.h>
-
-#define BxXpmColorError    		XpmColorError
-#define BxXpmSuccess       		XpmSuccess
-#define BxXpmOpenFailed    		XpmOpenFailed
-#define BxXpmFileInvalid   		XpmFileInvalid
-#define BxXpmNoMemory      		XpmNoMemory
-#define BxXpmColorFailed   		XpmColorFailed
-
-#define BxXpmVisual        		XpmVisual
-#define BxXpmColormap      		XpmColormap
-#define BxXpmDepth         		XpmDepth
-#define BxXpmSize          		XpmSize
-#define BxXpmHotspot       		XpmHotspot
-#define BxXpmCharsPerPixel 		XpmCharsPerPixel
-#define BxXpmColorSymbols  		XpmColorSymbols
-#define BxXpmRgbFilename   		XpmRgbFilename
-#define BxXpmInfos         		XpmInfos
-
-#define BxXpmReturnPixels  		XpmReturnPixels
-#define BxXpmReturnInfos   		XpmReturnInfos
-
-#define BxXpmCreatePixmapFromData	XpmCreatePixmapFromData
-#define BxXpmCreateImageFromData	XpmCreateImageFromData
-#define BxXpmFreeAttributes		XpmFreeAttributes
-
-typedef XpmAttributes      		BxXpmAttributes;
-
-#endif /* USE_XPM_LIBRARY */
-
-Pixmap XPM_PIXMAP
-ARGLIST((w, pixmapName))
-ARG(Widget, w)
-GRA(char **, pixmapName)
-{
-    BxXpmAttributes	attributes;
-    int			argcnt;
-    Arg			args[10];
-    Pixmap		pixmap;
-    Pixmap		shape;
-    int			returnValue;
-
-    argcnt = 0;
-    XtSetArg(args[argcnt], XmNdepth, &(attributes.depth)); argcnt++;
-    XtSetArg(args[argcnt], XmNcolormap, &(attributes.colormap)); argcnt++;
-    XtGetValues(w, args, argcnt);
-
-    attributes.visual = DefaultVisual(XtDisplay(w),
-				      DefaultScreen(XtDisplay(w)));
-    attributes.valuemask = (BxXpmDepth | BxXpmColormap | BxXpmVisual);
-
-    returnValue = BxXpmCreatePixmapFromData(XtDisplay(w),
-					  DefaultRootWindow(XtDisplay(w)),
-					  pixmapName, &pixmap, &shape,
-					  &attributes);
-    if ( shape )
-    {
-	XFreePixmap(XtDisplay(w), shape);
-    }
-
-    switch(returnValue)
-    {
-    case BxXpmOpenFailed:
-    case BxXpmFileInvalid:
-    case BxXpmNoMemory:
-    case BxXpmColorFailed:
-	XtWarning("Could not create pixmap.");
-	return(XmUNSPECIFIED_PIXMAP);
-    default:
-	return(pixmap);
-    }
-}
-
-#endif
-
-/* This structure is for capturing app-defaults values for a Class */
-
-typedef struct _UIAppDefault
-{
-    char*		cName;		/* Class name */
-    char*		wName; 		/* Widget name */
-    char*		cInstName;	/* Name of class instance(nested) */
-    char*		wRsc;		/* Widget resource */
-    char*		value;		/* value read from app-defaults */
-} UIAppDefault;
-
-
-void setDefaultResources ARGLIST((_name, w, resourceSpec))
-ARG(char*, _name)
-ARG(Widget, w)
-GRA(String *,resourceSpec)
-{
-   int         i;
-   Display    *dpy = XtDisplay ( w );	  /* Retrieve the display pointer */
-   XrmDatabase rdb = NULL;             /* A resource data base */
-
-   /* Create an empty resource database */
-
-   rdb = XrmGetStringDatabase ( "" );
-
-   /* Add the Component resources, prepending the name of the component */
-
-   i = 0;
-   while ( resourceSpec[i] != NULL )
-   {
-       char buf[1000];
-
-       sprintf(buf, "*%s%s", _name, resourceSpec[i++]);
-       XrmPutLineResource( &rdb, buf );
-   }
-
-   /* Merge them into the Xt database, with lowest precendence */
-
-   if ( rdb )
-   {
-#if (XlibSpecificationRelease>=5)
-        XrmDatabase db = XtDatabase(dpy);
-	XrmCombineDatabase(rdb, &db, FALSE);
-#else
-        XrmMergeDatabases ( dpy->db, &rdb );
-        dpy->db = rdb;
-#endif
-    }
-}
-
-/*
- * This method gets all the resources from the app-defaults file
- * (resource databse) and fills in the table (defs) if the app default
- * value exists.
- */
-void
-InitAppDefaults ARGLIST((parent, defs))
-ARG(Widget, parent)
-GRA(UIAppDefault *, defs)
-{
-    XrmQuark		cQuark;
-    XrmQuark		rsc[10];
-    XrmRepresentation	rep;
-    XrmValue		val;
-    XrmDatabase		rdb;
-    int			rscIdx;
-
-    /* Get the database */
-
-#if (XlibSpecificationRelease >= 5)
-    if ((rdb = XrmGetDatabase(XtDisplay(parent))) == NULL)
-    {
-	return;			/*  Can't get the database */
-    }
-#else
-    Display *dpy = XtDisplay(parent);
-    if ((rdb = dpy->db) == NULL)
-    {
-	return;
-    }
-#endif
-
-    /* Look for each resource in the table */
-
-    while (defs->wName)
-    {
-	rscIdx = 0;
-
-	cQuark = XrmStringToQuark(defs->cName);	/* class quark */
-	rsc[rscIdx++] = cQuark;
-	if (defs->wName[0] == '\0')
-	{
-	    rsc[rscIdx++] = cQuark;
-	}
-	else
-	{
-	    if( strchr(defs->wName, '.') == NULL )
-	    {
-		rsc[rscIdx++] = XrmStringToQuark(defs->wName);
-	    }
-	    else
-	    {
-		/*
-		 * If we found a '.' that means that this is not
-		 * a simple widget name, but a sub specification so
-		 * we need to split this into several quarks.
-		 */
-		char *copy = XtNewString(defs->wName), *ptr;
-
-		for( ptr = strtok(copy, "."); ptr != NULL;
-		     ptr = strtok(NULL, ".") )
-		{
-		    rsc[rscIdx++] = XrmStringToQuark(ptr);
-		}
-		XtFree(copy);
-	    }
-	}
-
-	if (defs->cInstName && defs->cInstName[0] != '\0')
-	{
-	    rsc[rscIdx++] = XrmStringToQuark(defs->cInstName);
-	}
-
-	rsc[rscIdx++] = XrmStringToQuark(defs->wRsc);
-	rsc[rscIdx++] = NULLQUARK;
-
-	if (XrmQGetResource(rdb, rsc, rsc, &rep, &val))
-	{
-	    defs->value = XtNewString((char*)val.addr);
-	}
-	defs++;
-    }
-}
-
-/*
- * This method applies the app defaults for the class to a specific
- * instance. All the widgets in the path are loosly coupled (use *).
- * To override a specific instance, use a tightly coupled app defaults
- * resource line (use .).
- */
-void
-SetAppDefaults ARGLIST((w, defs, inst_name, override_inst))
-ARG(Widget,w)
-ARG(UIAppDefault*, defs)
-ARG(char*, inst_name)
-GRA(Boolean, override_inst)
-{
-   Display*		dpy = XtDisplay ( w );	/*  Retrieve the display */
-   XrmDatabase		rdb = NULL;		/* A resource data base */
-   char			lineage[1000];
-   char			buf[1000];
-   Widget       	parent;
-
-   /* Protect ourselves */
-
-   if (inst_name == NULL) return;
-
-   /*  Create an empty resource database */
-
-   rdb = XrmGetStringDatabase ( "" );
-
-   /* Start the lineage with our name and then get our parents */
-
-   lineage[0] = '\0';
-   parent = w;
-
-   while (parent)
-   {
-       WidgetClass wclass = XtClass(parent);
-
-       if (wclass == applicationShellWidgetClass) break;
-
-       strcpy(buf, lineage);
-       sprintf(lineage, "*%s%s", XtName(parent), buf);
-
-       parent = XtParent(parent);
-   }
-
-   /*  Add the Component resources, prepending the name of the component */
-   while (defs->wName != NULL)
-   {
-       int name_length;
-       /*
-        * We don't deal with the resource if it isn't found in the
-	* Xrm database at class initializtion time (in initAppDefaults).
-	* Special handling of class instances.
-	*/
-       if (strchr(defs->wName, '.'))
-       {
-	   name_length = strlen(defs->wName) -
-		strlen(strchr(defs->wName, '.'));
-       }
-       else
-       {
-	   name_length = strlen(defs->wName) > strlen(inst_name) ?
-	       strlen(defs->wName) : strlen(inst_name);
-       }
-       if (defs->value == NULL ||
-	   (override_inst && strncmp(inst_name, defs->wName, name_length)) ||
-	   (! override_inst && defs->cInstName != NULL))
-       {
-	   defs++;
-	   continue;
-       }
-
-       /* Build up string after lineage */
-       if (defs->cInstName != NULL)
-       {
-	   /* Don't include class instance name if it is also the instance */
-	   /* being affected.  */
-
-	   if (*defs->cInstName != '\0')
-	   {
-	       sprintf(buf, "%s*%s*%s.%s: %s",
-		       lineage, defs->wName, defs->cInstName,
-			defs->wRsc, defs->value);
-	   }
-	   else
-	   {
-	       sprintf(buf, "%s*%s.%s: %s",
-		       lineage, defs->wName, defs->wRsc,
-			defs->value);
-	   }
-       }
-       else if (*defs->wName != '\0')
-       {
-	   sprintf(buf, "%s*%s*%s.%s: %s",
-		   lineage, inst_name, defs->wName, defs->wRsc, defs->value);
-       }
-       else
-       {
-	   sprintf(buf, "%s*%s.%s: %s",
-		   lineage, inst_name,defs->wRsc, defs->value);
-       }
-
-       XrmPutLineResource( &rdb, buf );
-       defs++;
-   }
-
-   /* Merge them into the Xt database, with lowest precendence */
-   if ( rdb )
-   {
-#if (XlibSpecificationRelease >= 5)
-        XrmDatabase db = XtDatabase(dpy);
-	XrmCombineDatabase(rdb, &db, FALSE);
-#else
-        XrmMergeDatabases ( dpy->db, &rdb );
-        dpy->db = rdb;
-#endif
-    }
-}
diff --git a/src/mbvelocitytool/Makefile.am b/src/mbvelocitytool/Makefile.am
deleted file mode 100644
index e9614f6..0000000
--- a/src/mbvelocitytool/Makefile.am
+++ /dev/null
@@ -1,21 +0,0 @@
-bin_PROGRAMS = mbvelocitytool
-
-AM_CFLAGS = ${libnetcdf_CFLAGS}
-
-AM_CPPFLAGS = -I${top_srcdir}/src/mbio \
-	      -I${top_srcdir}/src/mbaux \
-	      -I${top_srcdir}/src/gsf \
-	      ${libnetcdf_CPPFLAGS} \
-	      ${libmotif_CPPFLAGS}
-
-AM_LDFLAGS = 
-
-LIBS = ${top_builddir}/src/mbio/libmbio.la \
-       ${top_builddir}/src/mbaux/libmbaux.la \
-       ${top_builddir}/src/mbaux/libmbxgr.la \
-       ${libgmt_LIBS} ${libnetcdf_LIBS} ${libproj_LIBS} \
-       ${libmotif_LIBS} \
-       $(LIBM)
-
-mbvelocitytool_SOURCES = mbvelocity_bxutils.c mbvelocity.c mbvelocity_callbacks.c \
-        mbvelocity_creation.c mbvelocity_prog.c mbvelocity_creation.h mbvelocity.h
diff --git a/src/mbvelocitytool/Makefile.in b/src/mbvelocitytool/Makefile.in
deleted file mode 100644
index 71b35f4..0000000
--- a/src/mbvelocitytool/Makefile.in
+++ /dev/null
@@ -1,673 +0,0 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
-
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-
-VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
-am__make_running_with_option = \
-  case $${target_option-} in \
-      ?) ;; \
-      *) echo "am__make_running_with_option: internal error: invalid" \
-              "target option '$${target_option-}' specified" >&2; \
-         exit 1;; \
-  esac; \
-  has_opt=no; \
-  sane_makeflags=$$MAKEFLAGS; \
-  if $(am__is_gnu_make); then \
-    sane_makeflags=$$MFLAGS; \
-  else \
-    case $$MAKEFLAGS in \
-      *\\[\ \	]*) \
-        bs=\\; \
-        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
-          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
-    esac; \
-  fi; \
-  skip_next=no; \
-  strip_trailopt () \
-  { \
-    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
-  }; \
-  for flg in $$sane_makeflags; do \
-    test $$skip_next = yes && { skip_next=no; continue; }; \
-    case $$flg in \
-      *=*|--*) continue;; \
-        -*I) strip_trailopt 'I'; skip_next=yes;; \
-      -*I?*) strip_trailopt 'I';; \
-        -*O) strip_trailopt 'O'; skip_next=yes;; \
-      -*O?*) strip_trailopt 'O';; \
-        -*l) strip_trailopt 'l'; skip_next=yes;; \
-      -*l?*) strip_trailopt 'l';; \
-      -[dEDm]) skip_next=yes;; \
-      -[JT]) skip_next=yes;; \
-    esac; \
-    case $$flg in \
-      *$$target_option*) has_opt=yes; break;; \
-    esac; \
-  done; \
-  test $$has_opt = yes
-am__make_dryrun = (target_option=n; $(am__make_running_with_option))
-am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-bin_PROGRAMS = mbvelocitytool$(EXEEXT)
-subdir = src/mbvelocitytool
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/depcomp
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
-	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
-	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
-	$(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-	$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/src/mbio/mb_config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-am__installdirs = "$(DESTDIR)$(bindir)"
-PROGRAMS = $(bin_PROGRAMS)
-am_mbvelocitytool_OBJECTS = mbvelocity_bxutils.$(OBJEXT) \
-	mbvelocity.$(OBJEXT) mbvelocity_callbacks.$(OBJEXT) \
-	mbvelocity_creation.$(OBJEXT) mbvelocity_prog.$(OBJEXT)
-mbvelocitytool_OBJECTS = $(am_mbvelocitytool_OBJECTS)
-mbvelocitytool_LDADD = $(LDADD)
-AM_V_lt = $(am__v_lt_ at AM_V@)
-am__v_lt_ = $(am__v_lt_ at AM_DEFAULT_V@)
-am__v_lt_0 = --silent
-am__v_lt_1 = 
-AM_V_P = $(am__v_P_ at AM_V@)
-am__v_P_ = $(am__v_P_ at AM_DEFAULT_V@)
-am__v_P_0 = false
-am__v_P_1 = :
-AM_V_GEN = $(am__v_GEN_ at AM_V@)
-am__v_GEN_ = $(am__v_GEN_ at AM_DEFAULT_V@)
-am__v_GEN_0 = @echo "  GEN     " $@;
-am__v_GEN_1 = 
-AM_V_at = $(am__v_at_ at AM_V@)
-am__v_at_ = $(am__v_at_ at AM_DEFAULT_V@)
-am__v_at_0 = @
-am__v_at_1 = 
-DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)/src/mbio
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
-am__mv = mv -f
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
-	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
-	$(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
-	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
-	$(AM_CFLAGS) $(CFLAGS)
-AM_V_CC = $(am__v_CC_ at AM_V@)
-am__v_CC_ = $(am__v_CC_ at AM_DEFAULT_V@)
-am__v_CC_0 = @echo "  CC      " $@;
-am__v_CC_1 = 
-CCLD = $(CC)
-LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
-	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
-	$(AM_LDFLAGS) $(LDFLAGS) -o $@
-AM_V_CCLD = $(am__v_CCLD_ at AM_V@)
-am__v_CCLD_ = $(am__v_CCLD_ at AM_DEFAULT_V@)
-am__v_CCLD_0 = @echo "  CCLD    " $@;
-am__v_CCLD_1 = 
-SOURCES = $(mbvelocitytool_SOURCES)
-DIST_SOURCES = $(mbvelocitytool_SOURCES)
-am__can_run_installinfo = \
-  case $$AM_UPDATE_INFO_DIR in \
-    n|no|NO) false;; \
-    *) (install-info --version) >/dev/null 2>&1;; \
-  esac
-am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
-# Read a list of newline-separated strings from the standard input,
-# and print each of them once, without duplicates.  Input order is
-# *not* preserved.
-am__uniquify_input = $(AWK) '\
-  BEGIN { nonempty = 0; } \
-  { items[$$0] = 1; nonempty = 1; } \
-  END { if (nonempty) { for (i in items) print i; }; } \
-'
-# Make sure the list of sources is unique.  This is necessary because,
-# e.g., the same source file might be shared among _SOURCES variables
-# for different programs/libraries.
-am__define_uniq_tagged_files = \
-  list='$(am__tagged_files)'; \
-  unique=`for i in $$list; do \
-    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-  done | $(am__uniquify_input)`
-ETAGS = etags
-CTAGS = ctags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-CC = @CC@
-CCAS = @CCAS@
-CCASDEPMODE = @CCASDEPMODE@
-CCASFLAGS = @CCASFLAGS@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DLLTOOL = @DLLTOOL@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GREP = @GREP@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBM = @LIBM@
-LIBOBJS = @LIBOBJS@
-LIBS = ${top_builddir}/src/mbio/libmbio.la \
-       ${top_builddir}/src/mbaux/libmbaux.la \
-       ${top_builddir}/src/mbaux/libmbxgr.la \
-       ${libgmt_LIBS} ${libnetcdf_LIBS} ${libproj_LIBS} \
-       ${libmotif_LIBS} \
-       $(LIBM)
-
-LIBTOOL = @LIBTOOL@
-LIBTOOL_DEPS = @LIBTOOL_DEPS@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LTLIBOBJS = @LTLIBOBJS@
-LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
-MAINT = @MAINT@
-MAKEINFO = @MAKEINFO@
-MANIFEST_TOOL = @MANIFEST_TOOL@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-OTPS_DIR = @OTPS_DIR@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_URL = @PACKAGE_URL@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PKG_CONFIG = @PKG_CONFIG@
-PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
-PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-VERSION = @VERSION@
-XDR_LIB = @XDR_LIB@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_AR = @ac_ct_AR@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-fftw_app = @fftw_app@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libGLU_CFLAGS = @libGLU_CFLAGS@
-libGLU_LIBS = @libGLU_LIBS@
-libXm_CFLAGS = @libXm_CFLAGS@
-libXm_LIBS = @libXm_LIBS@
-libdir = @libdir@
-libexecdir = @libexecdir@
-libfftw3_CFLAGS = @libfftw3_CFLAGS@
-libfftw3_LIBS = @libfftw3_LIBS@
-libfftw_CPPFLAGS = @libfftw_CPPFLAGS@
-libfftw_LIBS = @libfftw_LIBS@
-libgmt_CFLAGS = @libgmt_CFLAGS@
-libgmt_CPPFLAGS = @libgmt_CPPFLAGS@
-libgmt_LIBS = @libgmt_LIBS@
-libmotif_CPPFLAGS = @libmotif_CPPFLAGS@
-libmotif_LIBS = @libmotif_LIBS@
-libnetcdf_CFLAGS = @libnetcdf_CFLAGS@
-libnetcdf_CPPFLAGS = @libnetcdf_CPPFLAGS@
-libnetcdf_LIBS = @libnetcdf_LIBS@
-libopengl_CPPFLAGS = @libopengl_CPPFLAGS@
-libopengl_LIBS = @libopengl_LIBS@
-libproj_CFLAGS = @libproj_CFLAGS@
-libproj_CPPFLAGS = @libproj_CPPFLAGS@
-libproj_LIBS = @libproj_LIBS@
-libpsl_CFLAGS = @libpsl_CFLAGS@
-libpsl_LIBS = @libpsl_LIBS@
-localedir = @localedir@
-localstatedir = @localstatedir@
-mandir = @mandir@
-mbsystemdatadir = @mbsystemdatadir@
-mbsystemhtmldir = @mbsystemhtmldir@
-mbsystempsdir = @mbsystempsdir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-AM_CFLAGS = ${libnetcdf_CFLAGS}
-AM_CPPFLAGS = -I${top_srcdir}/src/mbio \
-	      -I${top_srcdir}/src/mbaux \
-	      -I${top_srcdir}/src/gsf \
-	      ${libnetcdf_CPPFLAGS} \
-	      ${libmotif_CPPFLAGS}
-
-AM_LDFLAGS = 
-mbvelocitytool_SOURCES = mbvelocity_bxutils.c mbvelocity.c mbvelocity_callbacks.c \
-        mbvelocity_creation.c mbvelocity_prog.c mbvelocity_creation.h mbvelocity.h
-
-all: all-am
-
-.SUFFIXES:
-.SUFFIXES: .c .lo .o .obj
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
-	@for dep in $?; do \
-	  case '$(am__configure_deps)' in \
-	    *$$dep*) \
-	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-	        && { if test -f $@; then exit 0; else break; fi; }; \
-	      exit 1;; \
-	  esac; \
-	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/mbvelocitytool/Makefile'; \
-	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --gnu src/mbvelocitytool/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	@case '$?' in \
-	  *config.status*) \
-	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-	esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-install-binPROGRAMS: $(bin_PROGRAMS)
-	@$(NORMAL_INSTALL)
-	@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
-	if test -n "$$list"; then \
-	  echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
-	  $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
-	fi; \
-	for p in $$list; do echo "$$p $$p"; done | \
-	sed 's/$(EXEEXT)$$//' | \
-	while read p p1; do if test -f $$p \
-	 || test -f $$p1 \
-	  ; then echo "$$p"; echo "$$p"; else :; fi; \
-	done | \
-	sed -e 'p;s,.*/,,;n;h' \
-	    -e 's|.*|.|' \
-	    -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
-	sed 'N;N;N;s,\n, ,g' | \
-	$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
-	  { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
-	    if ($$2 == $$4) files[d] = files[d] " " $$1; \
-	    else { print "f", $$3 "/" $$4, $$1; } } \
-	  END { for (d in files) print "f", d, files[d] }' | \
-	while read type dir files; do \
-	    if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
-	    test -z "$$files" || { \
-	    echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
-	    $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
-	    } \
-	; done
-
-uninstall-binPROGRAMS:
-	@$(NORMAL_UNINSTALL)
-	@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
-	files=`for p in $$list; do echo "$$p"; done | \
-	  sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
-	      -e 's/$$/$(EXEEXT)/' \
-	`; \
-	test -n "$$list" || exit 0; \
-	echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
-	cd "$(DESTDIR)$(bindir)" && rm -f $$files
-
-clean-binPROGRAMS:
-	@list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \
-	echo " rm -f" $$list; \
-	rm -f $$list || exit $$?; \
-	test -n "$(EXEEXT)" || exit 0; \
-	list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
-	echo " rm -f" $$list; \
-	rm -f $$list
-
-mbvelocitytool$(EXEEXT): $(mbvelocitytool_OBJECTS) $(mbvelocitytool_DEPENDENCIES) $(EXTRA_mbvelocitytool_DEPENDENCIES) 
-	@rm -f mbvelocitytool$(EXEEXT)
-	$(AM_V_CCLD)$(LINK) $(mbvelocitytool_OBJECTS) $(mbvelocitytool_LDADD) $(LIBS)
-
-mostlyclean-compile:
-	-rm -f *.$(OBJEXT)
-
-distclean-compile:
-	-rm -f *.tab.c
-
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbvelocity.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbvelocity_bxutils.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbvelocity_callbacks.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbvelocity_creation.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbvelocity_prog.Po at am__quote@
-
-.c.o:
- at am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(COMPILE) -c -o $@ $<
-
-.c.obj:
- at am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
- at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-
-.c.lo:
- at am__fastdepCC_TRUE@	$(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(LTCOMPILE) -c -o $@ $<
-
-mostlyclean-libtool:
-	-rm -f *.lo
-
-clean-libtool:
-	-rm -rf .libs _libs
-
-ID: $(am__tagged_files)
-	$(am__define_uniq_tagged_files); mkid -fID $$unique
-tags: tags-am
-TAGS: tags
-
-tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
-	set x; \
-	here=`pwd`; \
-	$(am__define_uniq_tagged_files); \
-	shift; \
-	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
-	  test -n "$$unique" || unique=$$empty_fix; \
-	  if test $$# -gt 0; then \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      "$$@" $$unique; \
-	  else \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      $$unique; \
-	  fi; \
-	fi
-ctags: ctags-am
-
-CTAGS: ctags
-ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
-	$(am__define_uniq_tagged_files); \
-	test -z "$(CTAGS_ARGS)$$unique" \
-	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$unique
-
-GTAGS:
-	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && $(am__cd) $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) "$$here"
-cscopelist: cscopelist-am
-
-cscopelist-am: $(am__tagged_files)
-	list='$(am__tagged_files)'; \
-	case "$(srcdir)" in \
-	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
-	  *) sdir=$(subdir)/$(srcdir) ;; \
-	esac; \
-	for i in $$list; do \
-	  if test -f "$$i"; then \
-	    echo "$(subdir)/$$i"; \
-	  else \
-	    echo "$$sdir/$$i"; \
-	  fi; \
-	done >> $(top_builddir)/cscope.files
-
-distclean-tags:
-	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	list='$(DISTFILES)'; \
-	  dist_files=`for file in $$list; do echo $$file; done | \
-	  sed -e "s|^$$srcdirstrip/||;t" \
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
-	case $$dist_files in \
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
-			   sort -u` ;; \
-	esac; \
-	for file in $$dist_files; do \
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  if test -d $$d/$$file; then \
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
-	    if test -d "$(distdir)/$$file"; then \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
-	  else \
-	    test -f "$(distdir)/$$file" \
-	    || cp -p $$d/$$file "$(distdir)/$$file" \
-	    || exit 1; \
-	  fi; \
-	done
-check-am: all-am
-check: check-am
-all-am: Makefile $(PROGRAMS)
-installdirs:
-	for dir in "$(DESTDIR)$(bindir)"; do \
-	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
-	done
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
-	if test -z '$(STRIP)'; then \
-	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	      install; \
-	else \
-	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
-	fi
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
-	@echo "This command is intended for maintainers to use"
-	@echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am
-
-distclean: distclean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
-	distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am: install-binPROGRAMS
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic \
-	mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am: uninstall-binPROGRAMS
-
-.MAKE: install-am install-strip
-
-.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \
-	clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \
-	ctags ctags-am distclean distclean-compile distclean-generic \
-	distclean-libtool distclean-tags distdir dvi dvi-am html \
-	html-am info info-am install install-am install-binPROGRAMS \
-	install-data install-data-am install-dvi install-dvi-am \
-	install-exec install-exec-am install-html install-html-am \
-	install-info install-info-am install-man install-pdf \
-	install-pdf-am install-ps install-ps-am install-strip \
-	installcheck installcheck-am installdirs maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-compile \
-	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-	tags tags-am uninstall uninstall-am uninstall-binPROGRAMS
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/mbvelocitytool/mbvelocity.c b/src/mbvelocitytool/mbvelocity.c
deleted file mode 100644
index 109e4fd..0000000
--- a/src/mbvelocitytool/mbvelocity.c
+++ /dev/null
@@ -1,173 +0,0 @@
-
-/* Begin user code block <abstract> */
-/* End user code block <abstract> */
-
-/**
- * README: Portions of this file are merged at file generation
- * time. Edits can be made *only* in between specified code blocks, look
- * for keywords <Begin user code> and <End user code>.
- */
-/*
- * Generated by the ICS Builder Xcessory (BX).
- *
- * BuilderXcessory Version 6.1.3
- * Code Generator Xcessory 6.1.3 (08/19/04) CGX Scripts 6.1 Motif 2.1
- *
- */
-
-
-/* Begin user code block <file_comments> */
-/* End user code block <file_comments> */
-
-/*
- * Motif required Headers
- */
-#include <X11/Intrinsic.h>
-#include <X11/StringDefs.h>
-#include <Xm/Xm.h>
-#include <Xm/DialogS.h>
-#include <Xm/RepType.h>
-#include <Xm/MwmUtil.h>
-
-/**
- * Globally included information.
- */
-
-
-/*
- * Headers for classes used in this program
- */
-
-/**
- * Common constant and pixmap declarations.
- */
-#include "mbvelocity_creation.h"
-
-/**
- * Convenience functions from utilities file.
- */
-extern void RegisterBxConverters(XtAppContext);
-extern XtPointer BX_CONVERT(Widget, char *, char *, int, Boolean *);
-extern XtPointer BX_DOUBLE(double);
-extern XtPointer BX_SINGLE(float);
-extern void BX_MENU_POST(Widget, XtPointer, XEvent *, Boolean *);
-extern Pixmap XPM_PIXMAP(Widget, char **);
-extern void BX_SET_BACKGROUND_COLOR(Widget, ArgList, Cardinal *, Pixel);
-
-/**
- * Declarations for shell callbacks.
- */
-extern void do_quit(Widget, XtPointer, XtPointer);
-
-/* Avoid conflict due to BOOL redefinitions (Xm vs Win headers) */
-#ifdef WIN32
-#	undef BOOL
-#endif
-
-/* Begin user code block <globals> */
-
-#include "mb_define.h"
-#include "mbvelocity.h"
-
-Widget Createwindow_mbvelocity(Widget parent);
-
-/* End user code block <globals> */
-
-/**
- * Change this line via the Output Application Names Dialog.
- */
-#define BX_APP_CLASS "MB-system"
-
-int main( int argc, char **argv)
-{
-    Widget       parent;
-    XtAppContext app;
-    Arg          args[256];
-    Cardinal     ac;
-    Widget   topLevelShell;
-    Widget   window_mbvelocity;
-
-    /* Begin user code block <declarations> */
-
-    /* make sure that the argc that goes to XtVaAppInitialize
-       is 1 so that no options are removed by its option parsing */
-    int		 argc_save;
-    argc_save = argc;
-    argc = 1;
-
-    /* End user code block <declarations> */
-
-    /*
-     * Initialize Xt.
-     */
-
-    // XtSetLanguageProc(NULL, (XtLanguageProc) NULL, NULL);
-
-    /*
-     * The applicationShell is created as an unrealized
-     * parent for multiple topLevelShells.  The topLevelShells
-     * are created as popup children of the applicationShell.
-     * This is a recommendation of Paul Asente & Ralph Swick in
-     * _X_Window_System_Toolkit_ p. 677.
-     */
-
-    parent = XtVaOpenApplication ( &app,
-                                   BX_APP_CLASS,
-                                   NULL,
-                                   0,
-                                   &argc,
-                                   argv,
-                                   NULL,
-                                   sessionShellWidgetClass,
-                                   NULL );
-
-    RegisterBxConverters(app);
-    XmRepTypeInstallTearOffModelConverter();
-
-    /* Begin user code block <create_shells> */
-    /* End user code block <create_shells> */
-
-    /*
-     * Create classes and widgets used in this program.
-     */
-
-    /* Begin user code block <create_topLevelShell> */
-    /* End user code block <create_topLevelShell> */
-
-    ac = 0;
-    XtSetArg(args[ac], XmNtitle, "MBvelocityTool"); ac++;
-    XtSetArg(args[ac], XmNiconName, "MBvelocitytool"); ac++;
-    XtSetArg(args[ac], XmNx, 365); ac++;
-    XtSetArg(args[ac], XmNy, 192); ac++;
-    XtSetArg(args[ac], XmNwidth, 1016); ac++;
-    XtSetArg(args[ac], XmNheight, 668); ac++;
-    topLevelShell = XtCreatePopupShell((char *)"topLevelShell",
-        topLevelShellWidgetClass,
-        parent,
-        args,
-        ac);
-    XtAddCallback(topLevelShell, XmNdestroyCallback, do_quit, (XtPointer)0);
-    window_mbvelocity = (Widget)Createwindow_mbvelocity(topLevelShell);
-    XtManageChild(window_mbvelocity);
-    XtPopup(XtParent(window_mbvelocity), XtGrabNone);
-
-    /* Begin user code block <app_procedures> */
-
-    /* initialize app value and wait until view realized */
-    do_wait_until_viewed(app);
-
-    /* initialize everything */
-    do_mbvelocity_init(argc_save,argv);
-
-    /* End user code block <app_procedures> */
-
-    /* Begin user code block <main_loop> */
-    /* End user code block <main_loop> */
-
-    XtAppMainLoop(app);
-
-    /*
-     * A return value regardless of whether or not the main loop ends.
-     */
-     return(0);
-}
diff --git a/src/mbvelocitytool/mbvelocity.h b/src/mbvelocitytool/mbvelocity.h
deleted file mode 100644
index c7fbf2f..0000000
--- a/src/mbvelocitytool/mbvelocity.h
+++ /dev/null
@@ -1,138 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbvelocity.h	10/15/2009
- *    $Id: mbvelocity.h 2247 2015-05-29 21:28:28Z caress $
- *
- *    Copyright (c); 2009-2015 by
- *    David W. Caress (caress at mbari.org);
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu);
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * MBVELOCITYTOOL is an interactive water velocity profile editor
- * used to examine multiple water velocity profiles and to create
- * new water velocity profiles which can be used for the processing
- * of multibeam sonar data.  In general, this tool is used to examine
- * water velocity profiles obtained from XBTs, CTDs, or databases,
- * and to construct new profiles consistent with these various
- * sources of information. This file contains
- * contains function prototypes and was added in 2009.
- *
- * Author:	D. W. Caress
- * Date:	October 15, 2009
- *
- */
-
-/*--------------------------------------------------------------------*/
-
-/* mbvelocitytool control defines */
-#define	MAX_PROFILES	100
-#define	PICK_DISTANCE	50
-#define	NUM_EDIT_START	6
-
-/* velocity profile structure definition */
-struct profile
-	{
-	int	n;
-	int	nalloc;
-	mb_path	name;
-	double	*depth;
-	double	*velocity;
-	};
-
-/* ping structure definition */
-struct mbvt_ping_struct
-	{
-	int	allocated;
-	int	time_i[7];
-	double	time_d;
-	double	navlon;
-	double	navlat;
-	double	speed;
-	double	heading;
-	double	sonardepth;
-	double	ssv;
-	int	beams_bath;
-	char	*beamflag;
-	double	*bath;
-	double	*bathacrosstrack;
-	double	*bathalongtrack;
-	double	*ttimes;
-	double	*angles;
-	double	*angles_forward;
-	double	*angles_null;
-	double	*heave;
-	double	*alongtrack_offset;
-	};
-
-/* function prototypes */
-void do_mbvelocity_init(int argc, char **argv);
-void do_set_controls(void);
-void do_velrange( Widget w, XtPointer client_data, XtPointer call_data);
-void do_velcenter( Widget w, XtPointer client_data, XtPointer call_data);
-void do_process_mb( Widget w, XtPointer client_data, XtPointer call_data);
-void do_maxdepth( Widget w, XtPointer client_data, XtPointer call_data);
-void do_anglemode( Widget w, XtPointer client_data, XtPointer call_data);
-void do_quit( Widget w, XtPointer client_data, XtPointer call_data);
-void do_fileselection_list( Widget w, XtPointer client_data, XtPointer call_data);
-void do_open( Widget w, XtPointer client_data, XtPointer call_data);
-void do_open_commandline(char *wfile, char *sfile, char *file, int format);
-void do_new_profile( Widget w, XtPointer client_data, XtPointer call_data);
-void do_residual_range( Widget w, XtPointer client_data, XtPointer call_data);
-void do_canvas_event( Widget w, XtPointer client_data, XtPointer call_data);
-void do_save_swath_svp( Widget w, XtPointer client_data, XtPointer call_data);
-void do_save_residuals( Widget w, XtPointer client_data, XtPointer call_data);
-void do_io_mode_mb( Widget w, XtPointer client_data, XtPointer call_data);
-void do_io_mode_open_svp_display( Widget w, XtPointer client_data, XtPointer call_data);
-void do_io_mode_save_svp( Widget w, XtPointer client_data, XtPointer call_data);
-void do_io_mode_open_svp_edit( Widget w, XtPointer client_data, XtPointer call_data);
-void do_expose( Widget w, XtPointer client_data, XtPointer call_data);
-int do_wait_until_viewed(XtAppContext app);
-int do_message_on(char *message);
-int do_message_off(void);
-int do_error_dialog(char *s1, char *s2, char *s3);
-void set_label_string(Widget w, String str);
-void set_label_multiline_string(Widget w, String str);
-void get_text_string(Widget w, String str);
-
-int mbvt_init(int argc, char **argv);
-int mbvt_quit(void);
-int mbvt_set_graphics(void *xgid, int *brdr, int ncol, unsigned int *pixels);
-int mbvt_get_values(int *s_edit, int *s_ndisplay, double *s_maxdepth,
-	double *s_velrange, double *s_velcenter, double *s_resrange,
-	int *s_anglemode, int *s_format);
-int mbvt_set_values(int s_edit, int s_ndisplay,
-		double s_maxdepth, double s_velrange, double s_velcenter,
-		double s_resrange, int s_anglemode);
-int mbvt_open_edit_profile(char *file);
-int mbvt_new_edit_profile(void);
-int mbvt_save_edit_profile(char *file);
-int mbvt_save_swath_profile(char *file);
-int mbvt_save_residuals(char *file);
-int mbvt_open_display_profile(char *file);
-int mbvt_get_display_names(int *nlist, char *list[MAX_PROFILES]);
-int mbvt_delete_display_profile(int select);
-int mbvt_plot(void);
-int mbvt_action_select_node(int x, int y);
-int mbvt_action_mouse_up(int x, int y);
-int mbvt_action_drag_node(int x, int y);
-int mbvt_action_add_node(int x, int y);
-int mbvt_action_delete_node(int x, int y);
-int mbvt_get_format(char *file, int *form);
-int mbvt_open_swath_file(char *file, int form, int *numload);
-int mbvt_deallocate_swath(void);
-int mbvt_process_multibeam(void);
-
-
-void BxUnmanageCB(Widget w, XtPointer client, XtPointer call);
-void BxManageCB(Widget w, XtPointer client, XtPointer call);
-void BxPopupCB(Widget w, XtPointer client, XtPointer call);
-XtPointer BX_CONVERT(Widget w, char *from_string, char *to_type, int to_size, Boolean *success);
-void BxExitCB(Widget w, XtPointer client, XtPointer call);
-void BxSetValuesCB(Widget w, XtPointer client, XtPointer call);
-
-/*--------------------------------------------------------------------*/
diff --git a/src/mbvelocitytool/mbvelocity.uil b/src/mbvelocitytool/mbvelocity.uil
deleted file mode 100644
index 4be489e..0000000
--- a/src/mbvelocitytool/mbvelocity.uil
+++ /dev/null
@@ -1,2029 +0,0 @@
-/*
- * Generated by the ICS builderXcessory (BX).
- *
- *
- * BuilderXcessory Version 6.1.3.
- *
- * Identification: 
- */
-module main_uil
-version = 'V2.1'
-names = case_sensitive
-!(BX) bx_info("c_options", "")
-!(BX) bx_info("c_libs", "-lXm -lXt -lXext -lX11 -lgen -lm")
-!(BX) bx_info("c_cflags", "-Aa -I/usr/include/Motif1.2 -I/usr/include/X11R5")
-!(BX) bx_info("c_cc", "cc")
-!(BX) bx_info("c_excludeungenerated", "false")
-!(BX) bx_info("c_target", "main-c")
-!(BX) bx_info("c_information", "")
-!(BX) bx_info("c_user_main_loop", "", false)
-!(BX) bx_info("c_ignore_shell_geometry", "false")
-!(BX) bx_info("c_visible_windows_only", "false")
-!(BX) bx_info("c_rm_exp_callbacks", "false")
-!(BX) bx_info("c_reverse_dialogs", "true")
-!(BX) bx_info("c_dialogs_in_routine", "true")
-!(BX) bx_info("c_unmanage_dialogs", "true")
-!(BX) bx_info("c_use_locales", "false")
-!(BX) bx_info("c_ansi", "true")
-!(BX) bx_info("c_name", "MB-system")
-!(BX) bx_info("c_class", "MB-system")
-!(BX) bx_info("c_app_defaults", "mbvelocitytool", true)
-!(BX) bx_info("c_utilities", "mbvelocity_bxutils.c", true)
-!(BX) bx_info("c_constants", "mbvelocity_creation.h", true)
-!(BX) bx_info("c_callbacks", "mbvelocity_callbacks.c", true)
-!(BX) bx_info("c_creation", "mbvelocity_creation.c", true)
-!(BX) bx_info("c_main", "mbvelocity.c", true)
-!(BX) bx_info("c_acinclude_m4", "acinclude.m4", false)
-!(BX) bx_info("c_configure_in", "configure.in", false)
-!(BX) bx_info("c_makefile_am", "Makefile.am", false)
-!(BX) bx_info("c_cvsmake", "CVSMake", false)
-!(BX) bx_info("c_makefile", "Makefile.org", true)
-!(BX) bx_info("c_imakefile", "Imakefile", true)
-!(BX) bx_info("c_dirpath", "")
-!(BX) bx_info("include_path", ".", false)
-!(BX) bx_info("xrunner_command", "$(M_ROOT)/arch/X11.5/Xm1.2/mic_xm.o", false)
-!(BX) bx_info("purify_command", "purify", false)
-!(BX) bx_info("system_directory", "/opt/bx-6.1")
-!(BX) bx_info("builder_version", "BuilderXcessory Version 6.1.3")
-!(BX) bx_info("build_lang", "C")
-!(BX) bx_info("default_cpp_args", "")
-!(BX) bx_info("new_mrm_style", "true")
-!(BX) bx_info("c_wrap_lines", "false")
-!(BX) bx_info("uil_wrap_lines", "true")
-!(BX) bx_info("integrate_purify", "false")
-!(BX) bx_info("purify_command", "purify")
-!(BX) bx_info("integrate_xrunner", "false")
-
-procedure BxGlobalWidgetId;
-identifier BXG_pushButton_save_residuals;
-identifier BXG_pushButton_save_svpfile;
-identifier BXG_pushButton_open_mb;
-identifier BXG_pushButton_save_svp;
-identifier BXG_pushButton_process;
-identifier BXG_drawingArea;
-identifier BXG_label_status_display;
-identifier BXG_label_status_edit;
-identifier BXG_label_status_mb;
-identifier BXG_label_about_version;
-identifier BXG_label_message;
-identifier BXG_bulletinBoard_message;
-identifier BXG_label_mbformat;
-identifier BXG_textField_mbformat;
-identifier BXG_fileSelectionBox;
-identifier BXG_xmDialogShell_fileselect;
-identifier BXG_label_error_two;
-identifier BXG_label_error_one;
-identifier BXG_label_error_three;
-identifier BXG_bulletinBoard_error;
-identifier BXG_label_vel_center_max;
-identifier BXG_slider_velcenter;
-identifier BXG_label_res_range_max;
-identifier BXG_slider_residual_range;
-identifier BXG_label_vel_range_max;
-identifier BXG_slider_velrange;
-identifier BXG_label_max_depth_max;
-identifier BXG_slider_maxdepth;
-identifier BXG_toggleButton_mode_null;
-identifier BXG_toggleButton_mode_snell;
-identifier BXG_toggleButton_mode_ok;
-procedure BxManageCB(string);
-procedure BxSetValuesCB(string);
-procedure BxUnmanageCB(string);
-procedure do_anglemode();
-procedure do_canvas_event();
-procedure do_expose();
-procedure do_io_mode_mb();
-procedure do_io_mode_open_svp_display();
-procedure do_io_mode_open_svp_edit();
-procedure do_io_mode_save_svp();
-procedure do_maxdepth();
-procedure do_new_profile();
-procedure do_open();
-procedure do_process_mb();
-procedure do_quit();
-procedure do_residual_range();
-procedure do_save_residuals();
-procedure do_save_swath_svp();
-procedure do_velcenter();
-procedure do_velrange();
-!(BX) "Widget" "bulletinBoard_mode"
-identifier bulletinBoard_mode;
-
-list BaseStyle : arguments {
-};
-
-list BaseStyleReasons : callbacks {
-};
-
-!(BX)list BaseStyleHandlers : handlers {
-!(BX)};
-
-list Style_use : arguments {
-        arguments BaseStyle;
-        XmNfontList = font_table(
-		font('-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1'));
-};
-
-list Style_useReasons : callbacks {
-        callbacks BaseStyleReasons;
-};
-
-!(BX)list Style_useHandlers : handlers {
-!(BX)    handlers BaseStyleHandlers;
-!(BX)};
-
-
-object pushButton_mode_dismiss : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Dismiss");
-        XmNx = 120;
-        XmNy = 120;
-        XmNwidth = 100;
-        XmNheight = 40;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNactivateCallback = procedure BxUnmanageCB("bulletinBoard_mode");
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object toggleButton_mode_ok : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Do Not Change Beam Angles");
-        XmNwidth = 287;
-        XmNheight = 28;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_toggleButton_mode_ok);
-        XmNvalueChangedCallback = procedure do_anglemode();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object toggleButton_mode_snell : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Adjust Angles Using Snell\'s Law" &
- "");
-        XmNwidth = 287;
-        XmNheight = 28;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_toggleButton_mode_snell);
-        XmNvalueChangedCallback = procedure do_anglemode();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object toggleButton_mode_null : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Adjust Angles Using Sonar Geomet" &
- "ry");
-        XmNwidth = 287;
-        XmNheight = 28;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_toggleButton_mode_null);
-        XmNvalueChangedCallback = procedure do_anglemode();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object radioBox_mode : XmRadioBox widget {
-    arguments {
-        arguments Style_use;
-        XmNx = 20;
-        XmNy = 10;
-        XmNwidth = 293;
-        XmNheight = 96;
-    };
-    controls {
-         managed XmToggleButton toggleButton_mode_ok;
-         managed XmToggleButton toggleButton_mode_snell;
-         managed XmToggleButton toggleButton_mode_null;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object bulletinBoard_mode : XmBulletinBoardDialog widget {
-    arguments {
-        arguments Style_use;
-        XmNdialogTitle = compound_string("Beam Angle Mode");
-        XmNautoUnmanage = false;
-        XmNresizePolicy = XmRESIZE_GROW;
-        XmNx = 875;
-        XmNy = 481;
-        XmNwidth = 348;
-        XmNheight = 172;
-    };
-    controls {
-         managed XmRadioBox radioBox_mode;
-         managed XmPushButton pushButton_mode_dismiss;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-!(BX)object dialogShell_mode : XmDialogShell widget {
-!(BX)    arguments {
-!(BX)        arguments Style_use;
-!(BX)        XmNtitle = "Beam Angle Mode";
-!(BX)        XmNwidth = 348;
-!(BX)        XmNheight = 172;
-!(BX)    };
-!(BX)    controls {
-!(BX)         managed XmBulletinBoardDialog bulletinBoard_mode;
-!(BX)    };
-!(BX)    callbacks {
-!(BX)        callbacks Style_useReasons;
-!(BX)    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-!(BX)};
-
-object label_max_depth : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Maximum Depth (m):     1");
-        XmNx = 10;
-        XmNy = 10;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object slider_maxdepth : XmScale widget {
-    arguments {
-        arguments Style_use;
-        XmNminimum = 1;
-        XmNvalue = 3000;
-        XmNmaximum = 13000;
-        XmNscaleHeight = 15;
-        XmNshowArrows = TRUE;
-        XmNscaleMultiple = 1;
-        XmNshowValue = TRUE;
-        XmNhighlightThickness = 1;
-        XmNorientation = XmHORIZONTAL;
-        XmNx = 200;
-        XmNy = 10;
-        XmNwidth = 270;
-        XmNheight = 34;
-    };
-    controls {
-        Xm_Title {
-            arguments {
-                arguments Style_use;
-            };
-            callbacks {
-                    callbacks Style_useReasons;
-            };
-!(BX)            handlers {
-!(BX)                handlers Style_useHandlers;
-!(BX)            };
-        };
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_slider_maxdepth);
-        XmNvalueChangedCallback = procedure do_maxdepth();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object label_max_depth_max : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("13000");
-        XmNrecomputeSize = false;
-        XmNx = 470;
-        XmNy = 10;
-        XmNwidth = 50;
-        XmNheight = 20;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_label_max_depth_max);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object label_velrange : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Velocity Range (m/s): 25");
-        XmNx = 10;
-        XmNy = 50;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object slider_velrange : XmScale widget {
-    arguments {
-        arguments Style_use;
-        XmNminimum = 25;
-        XmNvalue = 500;
-        XmNmaximum = 1000;
-        XmNscaleHeight = 15;
-        XmNshowArrows = TRUE;
-        XmNscaleMultiple = 1;
-        XmNshowValue = TRUE;
-        XmNhighlightThickness = 1;
-        XmNorientation = XmHORIZONTAL;
-        XmNx = 200;
-        XmNy = 40;
-        XmNwidth = 270;
-        XmNheight = 34;
-    };
-    controls {
-        Xm_Title {
-            arguments {
-                arguments Style_use;
-            };
-            callbacks {
-                    callbacks Style_useReasons;
-            };
-!(BX)            handlers {
-!(BX)                handlers Style_useHandlers;
-!(BX)            };
-        };
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_slider_velrange);
-        XmNvalueChangedCallback = procedure do_velrange();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object label_vel_range_max : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("1000");
-        XmNrecomputeSize = false;
-        XmNx = 470;
-        XmNy = 50;
-        XmNwidth = 50;
-        XmNheight = 20;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_label_vel_range_max);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object label_residual_range : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Residual Range (m):    1");
-        XmNx = 10;
-        XmNy = 130;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object slider_residual_range : XmScale widget {
-    arguments {
-        arguments Style_use;
-        XmNminimum = 1;
-        XmNdecimalPoints = 1;
-        XmNvalue = 100;
-        XmNtitleString = compound_string("");
-        XmNmaximum = 2000;
-        XmNscaleHeight = 15;
-        XmNshowArrows = TRUE;
-        XmNscaleMultiple = 1;
-        XmNshowValue = TRUE;
-        XmNhighlightThickness = 1;
-        XmNorientation = XmHORIZONTAL;
-        XmNx = 200;
-        XmNy = 120;
-        XmNwidth = 270;
-        XmNheight = 39;
-    };
-    controls {
-        Xm_Title {
-            arguments {
-                arguments Style_use;
-            };
-            callbacks {
-                    callbacks Style_useReasons;
-            };
-!(BX)            handlers {
-!(BX)                handlers Style_useHandlers;
-!(BX)            };
-        };
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_slider_residual_range);
-        XmNvalueChangedCallback = procedure do_residual_range();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object label_res_range_max : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("200");
-        XmNrecomputeSize = false;
-        XmNx = 470;
-        XmNy = 130;
-        XmNwidth = 50;
-        XmNheight = 20;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_label_res_range_max);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object pushButton_scaling_dismiss : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Dismiss");
-        XmNx = 230;
-        XmNy = 170;
-        XmNwidth = 90;
-        XmNheight = 40;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNactivateCallback = procedure BxUnmanageCB("bulletinBoard_scaling");
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object slider_velcenter : XmScale widget {
-    arguments {
-        arguments Style_use;
-        XmNminimum = 25;
-        XmNvalue = 500;
-        XmNmaximum = 1000;
-        XmNscaleHeight = 15;
-        XmNshowArrows = TRUE;
-        XmNscaleMultiple = 1;
-        XmNshowValue = TRUE;
-        XmNhighlightThickness = 1;
-        XmNorientation = XmHORIZONTAL;
-        XmNx = 200;
-        XmNy = 80;
-        XmNwidth = 270;
-        XmNheight = 34;
-    };
-    controls {
-        Xm_Title {
-            arguments {
-                arguments Style_use;
-            };
-            callbacks {
-                    callbacks Style_useReasons;
-            };
-!(BX)            handlers {
-!(BX)                handlers Style_useHandlers;
-!(BX)            };
-        };
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_slider_velcenter);
-        XmNvalueChangedCallback = procedure do_velcenter();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object label_velcenter : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Velocity Center (m/s): 1300");
-        XmNx = 10;
-        XmNy = 90;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object label_vel_center_max : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("1700");
-        XmNrecomputeSize = false;
-        XmNx = 470;
-        XmNy = 90;
-        XmNwidth = 50;
-        XmNheight = 20;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_label_vel_center_max);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object bulletinBoard_scaling : XmBulletinBoardDialog widget {
-    arguments {
-        arguments Style_use;
-        XmNresizePolicy = XmRESIZE_GROW;
-        XmNx = 143;
-        XmNy = 513;
-        XmNwidth = 543;
-        XmNheight = 220;
-    };
-    controls {
-         managed XmLabel label_vel_center_max;
-         managed XmLabel label_velcenter;
-         managed XmScale slider_velcenter;
-         managed XmPushButton pushButton_scaling_dismiss;
-         managed XmLabel label_res_range_max;
-         managed XmScale slider_residual_range;
-         managed XmLabel label_residual_range;
-         managed XmLabel label_vel_range_max;
-         managed XmScale slider_velrange;
-         managed XmLabel label_velrange;
-         managed XmLabel label_max_depth_max;
-         managed XmScale slider_maxdepth;
-         managed XmLabel label_max_depth;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-!(BX)object xmDialogShell_scaling : XmDialogShell widget {
-!(BX)    arguments {
-!(BX)        arguments Style_use;
-!(BX)        XmNtitle = "Plot Scaling";
-!(BX)        XmNwidth = 543;
-!(BX)        XmNheight = 220;
-!(BX)    };
-!(BX)    controls {
-!(BX)         managed XmBulletinBoardDialog bulletinBoard_scaling;
-!(BX)    };
-!(BX)    callbacks {
-!(BX)        callbacks Style_useReasons;
-!(BX)    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-!(BX)};
-
-object pushButton_error : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("OK");
-        XmNx = 110;
-        XmNy = 110;
-        XmNwidth = 90;
-        XmNheight = 40;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object label_error_three : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("permission in this directory!");
-        XmNrecomputeSize = false;
-        XmNx = 10;
-        XmNy = 70;
-        XmNwidth = 290;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_label_error_three);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object label_error_one : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Unable to open output file.");
-        XmNrecomputeSize = false;
-        XmNx = 10;
-        XmNy = 10;
-        XmNwidth = 290;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_label_error_one);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object label_error_two : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("You probably do not have write");
-        XmNrecomputeSize = false;
-        XmNx = 10;
-        XmNy = 40;
-        XmNwidth = 290;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_label_error_two);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object bulletinBoard_error : XmBulletinBoardDialog widget {
-    arguments {
-        arguments Style_use;
-        XmNdialogStyle = XmDIALOG_APPLICATION_MODAL;
-        XmNresizePolicy = XmRESIZE_GROW;
-        XmNx = 888;
-        XmNy = 511;
-        XmNwidth = 311;
-        XmNheight = 161;
-    };
-    controls {
-         managed XmLabel label_error_two;
-         managed XmLabel label_error_one;
-         managed XmLabel label_error_three;
-         managed XmPushButton pushButton_error;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_bulletinBoard_error);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-!(BX)object xmDialogShell_error : XmDialogShell widget {
-!(BX)    arguments {
-!(BX)        arguments Style_use;
-!(BX)        XmNtitle = "Error";
-!(BX)        XmNwidth = 311;
-!(BX)        XmNheight = 161;
-!(BX)    };
-!(BX)    controls {
-!(BX)         managed XmBulletinBoardDialog bulletinBoard_error;
-!(BX)    };
-!(BX)    callbacks {
-!(BX)        callbacks Style_useReasons;
-!(BX)    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-!(BX)};
-
-object fileSelectionBox : XmFileSelectionBox widget {
-    arguments {
-        arguments Style_use;
-        XmNmarginHeight = 2;
-        XmNmarginWidth = 2;
-        XmNresizePolicy = XmRESIZE_GROW;
-        XmNx = 10;
-        XmNy = 10;
-        XmNwidth = 570;
-        XmNheight = 470;
-    };
-    controls {
-        Xm_Items managed {
-            arguments {
-                arguments Style_use;
-            };
-            callbacks {
-                    callbacks Style_useReasons;
-            };
-!(BX)            handlers {
-!(BX)                handlers Style_useHandlers;
-!(BX)            };
-        };
-        Xm_ItemsList managed {
-            arguments {
-                arguments Style_use;
-            };
-            callbacks {
-                    callbacks Style_useReasons;
-            };
-!(BX)            handlers {
-!(BX)                handlers Style_useHandlers;
-!(BX)            };
-        };
-        Xm_Selection managed {
-            arguments {
-                arguments Style_use;
-            };
-            callbacks {
-                    callbacks Style_useReasons;
-            };
-!(BX)            handlers {
-!(BX)                handlers Style_useHandlers;
-!(BX)            };
-        };
-        Xm_Text managed {
-            arguments {
-                arguments Style_use;
-            };
-            callbacks {
-                    callbacks Style_useReasons;
-            };
-!(BX)            handlers {
-!(BX)                handlers Style_useHandlers;
-!(BX)            };
-        };
-        Xm_Separator managed {
-            arguments {
-                arguments Style_use;
-            };
-            callbacks {
-                    callbacks Style_useReasons;
-            };
-!(BX)            handlers {
-!(BX)                handlers Style_useHandlers;
-!(BX)            };
-        };
-        Xm_OK managed {
-            arguments {
-                arguments Style_use;
-            };
-            callbacks {
-                    callbacks Style_useReasons;
-            };
-!(BX)            handlers {
-!(BX)                handlers Style_useHandlers;
-!(BX)            };
-        };
-        Xm_Cancel managed {
-            arguments {
-                arguments Style_use;
-            };
-            callbacks {
-                    callbacks Style_useReasons;
-            };
-!(BX)            handlers {
-!(BX)                handlers Style_useHandlers;
-!(BX)            };
-        };
-        Xm_Help managed {
-            arguments {
-                arguments Style_use;
-            };
-            callbacks {
-                    callbacks Style_useReasons;
-            };
-!(BX)            handlers {
-!(BX)                handlers Style_useHandlers;
-!(BX)            };
-        };
-        Xm_Apply managed {
-            arguments {
-                arguments Style_use;
-            };
-            callbacks {
-                    callbacks Style_useReasons;
-            };
-!(BX)            handlers {
-!(BX)                handlers Style_useHandlers;
-!(BX)            };
-        };
-        Xm_FilterLabel managed {
-            arguments {
-                arguments Style_use;
-            };
-            callbacks {
-                    callbacks Style_useReasons;
-            };
-!(BX)            handlers {
-!(BX)                handlers Style_useHandlers;
-!(BX)            };
-        };
-        Xm_FilterText managed {
-            arguments {
-                arguments Style_use;
-            };
-            callbacks {
-                    callbacks Style_useReasons;
-            };
-!(BX)            handlers {
-!(BX)                handlers Style_useHandlers;
-!(BX)            };
-        };
-        Xm_DirList managed {
-            arguments {
-                arguments Style_use;
-            };
-            callbacks {
-                    callbacks Style_useReasons;
-            };
-!(BX)            handlers {
-!(BX)                handlers Style_useHandlers;
-!(BX)            };
-        };
-        Xm_Dir managed {
-            arguments {
-                arguments Style_use;
-            };
-            callbacks {
-                    callbacks Style_useReasons;
-            };
-!(BX)            handlers {
-!(BX)                handlers Style_useHandlers;
-!(BX)            };
-        };
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_fileSelectionBox);
-       XmNokCallback = procedures {
-                 do_open();
-                 BxUnmanageCB("bulletinBoard_fileselect");
-        };
-        XmNcancelCallback = procedure BxUnmanageCB("bulletinBoard_fileselect");
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object textField_mbformat : XmTextField widget {
-    arguments {
-        arguments Style_use;
-        XmNborderWidth = 1;
-        XmNvalue = "1";
-        XmNcolumns = 5;
-        XmNmaxLength = 5;
-        XmNresizeWidth = false;
-        XmNcursorPosition = 1;
-        XmNhighlightOnEnter = false;
-        XmNmarginHeight = 2;
-        XmNshadowThickness = 0;
-        XmNhighlightThickness = 0;
-        XmNmarginWidth = 2;
-        XmNx = 210;
-        XmNy = 490;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_textField_mbformat);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object label_mbformat : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Swath Sonar Format ID:");
-        XmNx = 20;
-        XmNy = 490;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_label_mbformat);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object bulletinBoard_fileselect : XmBulletinBoardDialog widget {
-    arguments {
-        arguments Style_use;
-        XmNautoUnmanage = false;
-        XmNresizePolicy = XmRESIZE_GROW;
-        XmNx = 512;
-        XmNy = 316;
-        XmNwidth = 591;
-        XmNheight = 537;
-    };
-    controls {
-         managed XmLabel label_mbformat;
-         managed XmTextField textField_mbformat;
-         managed XmFileSelectionBox fileSelectionBox;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-!(BX)object xmDialogShell_fileselect : XmDialogShell widget {
-!(BX)    arguments {
-!(BX)        arguments Style_use;
-!(BX)        XmNtitle = "Open Swath Sonar Data";
-!(BX)        XmNwidth = 591;
-!(BX)        XmNheight = 537;
-!(BX)    };
-!(BX)    controls {
-!(BX)         managed XmBulletinBoardDialog bulletinBoard_fileselect;
-!(BX)    };
-!(BX)    callbacks {
-!(BX)        callbacks Style_useReasons;
-!(BX)        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_xmDialogShell_fileselect);
-!(BX)    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-!(BX)};
-
-object label_message : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNlabelString = compound_string("MBvelocitytool is loading data.." &
- ".");
-        XmNx = 10;
-        XmNy = 10;
-        XmNwidth = 360;
-        XmNheight = 20;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_label_message);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object label_pleasewait : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNlabelString = compound_string("Thank you for your patience.");
-        XmNrecomputeSize = false;
-        XmNx = 10;
-        XmNy = 40;
-        XmNwidth = 360;
-        XmNheight = 20;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object bulletinBoard_message : XmBulletinBoardDialog widget {
-    arguments {
-        arguments Style_use;
-        XmNdialogStyle = XmDIALOG_FULL_APPLICATION_MODAL;
-        XmNresizePolicy = XmRESIZE_NONE;
-        XmNx = 1001;
-        XmNy = 467;
-        XmNwidth = 379;
-        XmNheight = 88;
-    };
-    controls {
-         managed XmLabel label_pleasewait;
-         managed XmLabel label_message;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_bulletinBoard_message);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-!(BX)object xmDialogShell_message : XmDialogShell widget {
-!(BX)    arguments {
-!(BX)        arguments Style_use;
-!(BX)        XmNtitle = "Please Wait...";
-!(BX)        XmNmwmInputMode = MWM_INPUT_MODELESS;
-!(BX)        XmNdeleteResponse = XmUNMAP;
-!(BX)        XmNwidth = 379;
-!(BX)        XmNheight = 88;
-!(BX)    };
-!(BX)    controls {
-!(BX)         managed XmBulletinBoardDialog bulletinBoard_message;
-!(BX)    };
-!(BX)    callbacks {
-!(BX)        callbacks Style_useReasons;
-!(BX)    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-!(BX)};
-
-object label_about_mbedit : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNfontList = font_table(
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1'));
-        XmNlabelString = compound_string("MBvelocitytool");
-        XmNx = 10;
-        XmNy = 10;
-        XmNwidth = 460;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object label_about_function : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNfontList = font_table(
-		font('-*-times-bold-r-*-*-*-180-*-*-*-*-iso8859-1'));
-        XmNlabelString = compound_string("Interactive SVP Modeler/Editor");
-        XmNx = 10;
-        XmNy = 40;
-        XmNwidth = 460;
-        XmNheight = 23;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object label_about_version : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNfontList = font_table(
-		font('-*-times-medium-r-*-*-*-140-*-*-*-*-iso8859-1'));
-        XmNlabelString = compound_string("MB-System Release 4.6", separate=true) &
- compound_string("April 14, 1999");
-        XmNrecomputeSize = false;
-        XmNx = 10;
-        XmNy = 350;
-        XmNwidth = 460;
-        XmNheight = 60;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_label_about_version);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object separator : XmSeparator widget {
-    arguments {
-        arguments Style_use;
-        XmNx = 10;
-        XmNy = 70;
-        XmNwidth = 460;
-        XmNheight = 20;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object label_about_for : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNfontList = font_table(
-		font('-*-times-bold-r-*-*-*-140-*-*-*-*-iso8859-1'));
-        XmNlabelString = compound_string("for Processing and Display of Sw" &
- "ath Sonar Data");
-        XmNx = 10;
-        XmNy = 190;
-        XmNwidth = 460;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object label_about_component : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNfontList = font_table(
-		font('-*-times-bold-r-*-*-*-140-*-*-*-*-iso8859-1'));
-        XmNlabelString = compound_string("One Component of the");
-        XmNx = 10;
-        XmNy = 90;
-        XmNwidth = 450;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object label_about_mbpub : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNfontList = font_table(
-		font('-*-times-bold-r-*-*-*-140-*-*-*-*-iso8859-1'));
-        XmNlabelString = compound_string("An Open Source Software Package");
-        XmNx = 10;
-        XmNy = 160;
-        XmNwidth = 450;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object label_about_mbsystem : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNfontList = font_table(
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1'));
-        XmNlabelString = compound_string("MB-System");
-        XmNx = 10;
-        XmNy = 120;
-        XmNwidth = 450;
-        XmNheight = 38;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object label_about_columbia : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNfontList = font_table(
-		font('-*-times-bold-r-*-*-*-120-*-*-*-*-iso8859-1'));
-        XmNlabelString = compound_string("Monterey Bay", separate=true) &
- compound_string("Aquarium", separate=true) &
- compound_string("Research Institute");
-        XmNx = 70;
-        XmNy = 280;
-        XmNwidth = 140;
-        XmNheight = 60;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object label_about_lamont : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNfontList = font_table(
-		font('-*-times-bold-r-*-*-*-120-*-*-*-*-iso8859-1'));
-        XmNlabelString = compound_string("Lamont-Doherty", separate=true) &
- compound_string("Earth Observatory", separate=true) &
- compound_string("of Columbia University");
-        XmNx = 250;
-        XmNy = 280;
-        XmNwidth = 180;
-        XmNheight = 60;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object label_about_create : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNfontList = font_table(
-		font('-*-times-bold-r-*-*-*-140-*-*-*-*-iso8859-1'));
-        XmNlabelString = compound_string("Created by:");
-        XmNx = 10;
-        XmNy = 240;
-        XmNwidth = 460;
-        XmNheight = 20;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object pushButton_about_dismiss : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNfontList = font_table(
-		font('-*-times-bold-r-*-*-*-140-*-*-*-*-iso8859-1'));
-        XmNlabelString = compound_string("Dismiss");
-        XmNx = 200;
-        XmNy = 410;
-        XmNwidth = 80;
-        XmNheight = 35;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNactivateCallback = procedure BxUnmanageCB("bulletinBoard_about");
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object separator2 : XmSeparator widget {
-    arguments {
-        arguments Style_use;
-        XmNx = 10;
-        XmNy = 220;
-        XmNwidth = 460;
-        XmNheight = 20;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object label_about_create1 : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNfontList = font_table(
-		font('-*-times-bold-r-*-*-*-140-*-*-*-*-iso8859-1'));
-        XmNlabelString = compound_string("David W. Caress    and    Dale N" &
- ". Chayes");
-        XmNx = 10;
-        XmNy = 260;
-        XmNwidth = 460;
-        XmNheight = 20;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object bulletinBoard_about : XmBulletinBoardDialog widget {
-    arguments {
-        arguments Style_use;
-        XmNresizePolicy = XmRESIZE_GROW;
-        XmNx = 542;
-        XmNy = 288;
-        XmNwidth = 481;
-        XmNheight = 456;
-    };
-    controls {
-         managed XmLabel label_about_create1;
-         managed XmSeparator separator2;
-         managed XmPushButton pushButton_about_dismiss;
-         managed XmLabel label_about_create;
-         managed XmLabel label_about_lamont;
-         managed XmLabel label_about_columbia;
-         managed XmLabel label_about_mbsystem;
-         managed XmLabel label_about_mbpub;
-         managed XmLabel label_about_component;
-         managed XmLabel label_about_for;
-         managed XmSeparator separator;
-         managed XmLabel label_about_version;
-         managed XmLabel label_about_function;
-         managed XmLabel label_about_mbedit;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-!(BX)object xmDialogShell_about : XmDialogShell widget {
-!(BX)    arguments {
-!(BX)        arguments Style_use;
-!(BX)        XmNtitle = "About MBedit";
-!(BX)        XmNdeleteResponse = XmUNMAP;
-!(BX)        XmNwidth = 481;
-!(BX)        XmNheight = 456;
-!(BX)    };
-!(BX)    controls {
-!(BX)         managed XmBulletinBoardDialog bulletinBoard_about;
-!(BX)    };
-!(BX)    callbacks {
-!(BX)        callbacks Style_useReasons;
-!(BX)    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-!(BX)};
-
-object label_status_mb : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNlabelString = compound_string("No MultiBeam Data Loaded");
-        XmNx = 0;
-        XmNy = 80;
-        XmNwidth = 1010;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_label_status_mb);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object label_status_edit : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNlabelString = compound_string("No Editable Sound Velocity Profi" &
- "le Loaded");
-        XmNx = 0;
-        XmNy = 60;
-        XmNwidth = 1010;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_label_status_edit);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object label_status_display : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNlabelString = compound_string("No Display Sound Velocity Profil" &
- "es Loaded");
-        XmNx = 0;
-        XmNy = 40;
-        XmNwidth = 1010;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_label_status_display);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object drawingArea : XmDrawingArea widget {
-    arguments {
-        arguments Style_use;
-        XmNborderWidth = 1;
-        XmNbackground = color('white');
-        XmNx = 0;
-        XmNy = 100;
-        XmNwidth = 1010;
-        XmNheight = 560;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_drawingArea);
-        XmNinputCallback = procedure do_canvas_event();
-        XmNexposeCallback = procedure do_expose();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object pushButton_process : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Reprocess");
-        XmNx = 520;
-        XmNy = 0;
-        XmNwidth = 90;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_pushButton_process);
-        XmNactivateCallback = procedure do_process_mb();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object pushButton_quit : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Quit");
-        XmNx = 700;
-        XmNy = 0;
-        XmNwidth = 80;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNactivateCallback = procedure do_quit();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object pushButton_about : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("About");
-        XmNx = 930;
-        XmNy = 0;
-        XmNwidth = 80;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNactivateCallback = procedure BxManageCB("bulletinBoard_about");
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object pushButton_open_svp_display : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Open display profile");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-       XmNactivateCallback = procedures {
-                 BxManageCB("bulletinBoard_fileselect");
-                 do_io_mode_open_svp_display();
-                 BxUnmanageCB("label_mbformat");
-                 BxUnmanageCB("textField_mbformat");
-                 BxSetValuesCB("xmDialogShell_fileselect.title=" &
- "Open Display Sound Velocity Profile (SVP)");
-        };
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object pushButton_open_svp_edit : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Open editable profile");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-       XmNactivateCallback = procedures {
-                 BxManageCB("bulletinBoard_fileselect");
-                 do_io_mode_open_svp_edit();
-                 BxUnmanageCB("label_mbformat");
-                 BxUnmanageCB("textField_mbformat");
-                 BxSetValuesCB("xmDialogShell_fileselect.title=" &
- "Open Editable Sound Velocity Profile (SVP)");
-        };
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object pushButton_new_svp_edit : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("New editable profile...");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNactivateCallback = procedure do_new_profile();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object pushButton_save_svp : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Save editable profile");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_pushButton_save_svp);
-       XmNactivateCallback = procedures {
-                 BxManageCB("bulletinBoard_fileselect");
-                 do_io_mode_save_svp();
-                 BxUnmanageCB("label_mbformat");
-                 BxUnmanageCB("textField_mbformat");
-                 BxSetValuesCB("xmDialogShell_fileselect.title=" &
- "Save Editable Sound Velocity Profile (SVP)");
-        };
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object separator1 : XmSeparator widget {
-    arguments {
-        arguments Style_use;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object pushButton_open_mb : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Open swath sonar data");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_pushButton_open_mb);
-       XmNactivateCallback = procedures {
-                 BxManageCB("bulletinBoard_fileselect");
-                 do_io_mode_mb();
-                 BxManageCB("label_mbformat");
-                 BxManageCB("textField_mbformat");
-                 BxSetValuesCB("xmDialogShell_fileselect.title=" &
- "Open Swath Sonar Data");
-        };
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object separator3 : XmSeparator widget {
-    arguments {
-    };
-    controls {
-    };
-    callbacks {
-    };
-};
-
-object pushButton_save_svpfile : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNsensitive = false;
-        XmNlabelString = compound_string("Save swath svp file");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_pushButton_save_svpfile);
-        XmNactivateCallback = procedure do_save_swath_svp();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object pushButton_save_residuals : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Save residuals as offsets");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_pushButton_save_residuals);
-        XmNactivateCallback = procedure do_save_residuals();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object pulldownMenu_file : XmPulldownMenu widget {
-    arguments {
-        arguments Style_use;
-        XmNx = 0;
-        XmNy = 0;
-        XmNwidth = 184;
-        XmNheight = 176;
-    };
-    controls {
-         managed XmPushButton pushButton_open_svp_display;
-         managed XmPushButton pushButton_open_svp_edit;
-         managed XmPushButton pushButton_new_svp_edit;
-         managed XmPushButton pushButton_save_svp;
-         managed XmSeparator separator1;
-         managed XmPushButton pushButton_open_mb;
-         managed XmSeparator separator3;
-         managed XmPushButton pushButton_save_svpfile;
-         managed XmPushButton pushButton_save_residuals;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object cascadeButton_file : XmCascadeButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("    File    ");
-        XmNx = 2;
-        XmNy = 2;
-        XmNwidth = 73;
-        XmNheight = 24;
-    };
-    controls {
-         unmanaged XmPulldownMenu pulldownMenu_file;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object menuBar_file : XmMenuBar widget {
-    arguments {
-        arguments Style_use;
-        XmNmarginHeight = 0;
-        XmNmarginWidth = 0;
-        XmNwidth = 77;
-        XmNheight = 28;
-    };
-    controls {
-         managed XmCascadeButton cascadeButton_file;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object rowColumn : XmRowColumn widget {
-    arguments {
-        arguments Style_use;
-        XmNx = 0;
-        XmNy = 0;
-        XmNwidth = 83;
-        XmNheight = 34;
-    };
-    controls {
-         managed XmMenuBar menuBar_file;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object pushButton_plotscaling : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Plot Scaling");
-        XmNx = 160;
-        XmNy = 0;
-        XmNwidth = 90;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNactivateCallback = procedure BxManageCB("bulletinBoard_scaling");
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object pushButton_mode : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Angle Mode");
-        XmNx = 330;
-        XmNy = 0;
-        XmNwidth = 90;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNactivateCallback = procedure BxManageCB("bulletinBoard_mode");
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object input_screen : XmBulletinBoard widget {
-    arguments {
-        arguments Style_use;
-        XmNmarginHeight = 0;
-        XmNmarginWidth = 0;
-        XmNresizePolicy = XmRESIZE_GROW;
-        XmNwidth = 1016;
-        XmNheight = 668;
-    };
-    controls {
-         managed XmPushButton pushButton_mode;
-         managed XmPushButton pushButton_plotscaling;
-         managed XmRowColumn rowColumn;
-         managed XmPushButton pushButton_about;
-         managed XmPushButton pushButton_quit;
-         managed XmPushButton pushButton_process;
-         managed XmDrawingArea drawingArea;
-         managed XmLabel label_status_display;
-         managed XmLabel label_status_edit;
-         managed XmLabel label_status_mb;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object window_mbvelocity : XmMainWindow widget {
-    arguments {
-        arguments Style_use;
-        XmNx = 365;
-        XmNy = 192;
-        XmNwidth = 1016;
-        XmNheight = 668;
-    };
-    controls {
-        Xm_Separator1 {
-            arguments {
-                arguments Style_use;
-            };
-            callbacks {
-                    callbacks Style_useReasons;
-            };
-!(BX)            handlers {
-!(BX)                handlers Style_useHandlers;
-!(BX)            };
-        };
-        Xm_Separator2 {
-            arguments {
-                arguments Style_use;
-            };
-            callbacks {
-                    callbacks Style_useReasons;
-            };
-!(BX)            handlers {
-!(BX)                handlers Style_useHandlers;
-!(BX)            };
-        };
-        Xm_Separator3 {
-            arguments {
-                arguments Style_use;
-            };
-            callbacks {
-                    callbacks Style_useReasons;
-            };
-!(BX)            handlers {
-!(BX)                handlers Style_useHandlers;
-!(BX)            };
-        };
-!(BX)         unmanaged XmDialogShell dialogShell_mode;
-!(BX)         unmanaged XmDialogShell xmDialogShell_scaling;
-!(BX)         unmanaged XmDialogShell xmDialogShell_error;
-!(BX)         unmanaged XmDialogShell xmDialogShell_fileselect;
-!(BX)         unmanaged XmDialogShell xmDialogShell_message;
-!(BX)         unmanaged XmDialogShell xmDialogShell_about;
-         managed XmBulletinBoard input_screen;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-!(BX)object topLevelShell : TopLevelShell widget {
-!(BX)    arguments {
-!(BX)        arguments Style_use;
-!(BX)        XmNtitle = "MBvelocityTool";
-!(BX)        XmNiconName = "MBvelocitytool";
-!(BX)        XmNx = 365;
-!(BX)        XmNy = 192;
-!(BX)        XmNwidth = 1016;
-!(BX)        XmNheight = 668;
-!(BX)    };
-!(BX)    controls {
-!(BX)         managed XmMainWindow window_mbvelocity;
-!(BX)    };
-!(BX)    callbacks {
-!(BX)        callbacks Style_useReasons;
-!(BX)        XmNdestroyCallback = procedure do_quit();
-!(BX)    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-!(BX)};
-end module;
diff --git a/src/mbvelocitytool/mbvelocity_bxutils.c b/src/mbvelocitytool/mbvelocity_bxutils.c
deleted file mode 100644
index 7213827..0000000
--- a/src/mbvelocitytool/mbvelocity_bxutils.c
+++ /dev/null
@@ -1,3927 +0,0 @@
-/*
- * WARNING: This file is overwritten at code generation time.
- * Any changes to this file will be lost.
- */
-/*
- * MODULE: BxConvert.c
- * AUTHOR: Automatically generated by Builder Xcessory
- *
- * Description: This module contains various utilities, converters
- *	for XmStrings (to work properly with app-defaults), and if needed
- *	the XPM pixmap utilities.
- *
- * Edit the file ${BX}/gen/bxutils.c (BX$SYSTEM:[gen]bxutils.c on VMS) to
- * make system wide changes to this file which will be visible next time
- * this file is generated.
- * ${BX} is the directory where Builder Xcessory is installed.
- */
-
-/*
- * BX supplies a string format for compound strings:
- *
- *		::[#tag][:t][:r]["str"]
- *
- * where:
- *	:: = indicates compound string.
- *	tag =  the font tag
- *	:t = separator (if not seen no separator added to segment)
- *	:r = right to left (if not seen left to right assumed)
- *	"str" = the text of the string.
- *
- * The components for the compound string can be repeated any number of
- * times.
- */
-
-/*****************************************************************************
- *       INCLUDE FILES
- *****************************************************************************/
-/* Added HAVE_CONFIG_H for autogen files */
-#ifdef HAVE_CONFIG_H
-#include <mb_config.h>
-#endif
-
-#include <Xm/Xm.h>
-#include <Xm/RowColumn.h>
-#include <stdio.h>
-#include <ctype.h>
-#include <string.h>
-
-/*
- * Include stdlib.h and malloc.h if code is C++, ANSI, or Extended ANSI.
- */
-#if defined(__cplusplus) || defined(__STDC__) || defined(__EXTENSIONS__)
-#include <stdlib.h>
-#ifdef HAVE_MALLOC_H
-#include <malloc.h>
-#endif
-#endif
-
-/*****************************************************************************
- *       TYPDEFS AND DEFINES
- *****************************************************************************/
-
-/*
- * Undefine this if you want to use native strcasecmp.
- */
-#define LOCAL_STRCASECMP
-
-#ifdef _NO_PROTO
-#ifdef NeedFunctionPrototypes
-#undef NeedFunctionPrototypes
-#endif
-#endif
-
-/*
- * Define SUPPORTS_WCHARS if the system supports wide character sets
- * Note: the following line flags the VAXC compiler and not the
- * DECC compiler running VAXC emulation.
- */
-#if !((defined(VAXC) && !defined(__DECC)) || defined(__CENTERLINE__))
-#define SUPPORTS_WCHARS
-#endif
-
-/*
- * Handy definition used in SET_BACKGROUND_COLOR
-*/
-#define UNSET		(-1)
-
-/*
- * Set state of inclusion of prototypes properly
- */
-#ifdef NeedFunctionPrototypes
-#define ARGLIST(p)	(
-#define ARG(a, b)	a b,
-#define GRA(a, b)	a b)
-#else
-#define ARGLIST(p)	p
-#define ARG(a, b)	a b;
-#define GRA(a, b)	a b;
-#endif
-
-#ifdef NeedFunctionPrototypes
-#ifdef __cplusplus
-#define UARG(a, b)	a,
-#define GRAU(a, b)	a)
-#else
-#define UARG(a, b)	a b,
-#define GRAU(a, b)	a b)
-#endif
-#else
-#define UARG(a, b)	a b;
-#define GRAU(a, b)	a b;
-#endif
-
-/*
- * Set up strcasecmp function
- */
-#if defined(LOCAL_STRCASECMP)
-#define STRCASECMP	StrCasecmp
-#ifndef NeedFunctionPrototypes
-static int StrCasecmp();
-#else
-static int StrCasecmp(char*, char*);
-#endif
-#else
-#define STRCASECMP	strcasecmp
-#endif
-
-/*
- * Define XTPOINTER so it works with all releases of
- * Xt and c++.
- */
-#ifdef __cplusplus
-#if XtSpecificationRelease < 5
-#define XTPOINTER	char *
-#else
-#define XTPOINTER	XPointer
-#endif
-#else
-#define XTPOINTER	XtPointer
-#endif
-
-/*
- * The following enum is used to support wide character sets.
- * Use this enum for references into the Common Wide Characters array.
- * If you add to the array, ALWAYS keep NUM_COMMON_WCHARS as the last
- * entry in the enum.  This will maintain correct memory usage, etc.
- */
-enum { WNull, WTab, WNewLine, WCarriageReturn, WFormFeed, WVerticalTab,
-       WBackSlash, WQuote, WHash, WColon, WideF, WideL, WideN, WideR,
-       WideT, WideV, WideUF, WideUL, WideUR, WideUT, WideZero, WideOne,
-       NUM_COMMON_WCHARS };
-
-/*****************************************************************************
- *       GLOBAL DECLARATIONS
- *****************************************************************************/
-
-/*****************************************************************************
- *       EXTERNAL DECLARATIONS
- *****************************************************************************/
-
-/*****************************************************************************
- *	STATIC DECLARATION
- *****************************************************************************/
-
-#ifndef NeedFunctionPrototypes
-
-#ifndef SUPPORTS_WCHARS
-static int	 mblen			();
-#endif
-static int	strlenWc		();
-static size_t	doMbstowcs		();
-static size_t	doWcstombs 		();
-static void	copyWcsToMbs		();
-static int 	dombtowc		();
-static Boolean	extractSegment		();
-static XmString	StringToXmString	();
-static char*	getNextCStrDelim	();
-static int	getCStrCount		();
-static wchar_t *CStrCommonWideCharsGet	();
-
-#else
-
-#ifndef SUPPORTS_WCHARS
-static int 	mblen			(char*, size_t);
-#endif
-static int	strlenWc		(wchar_t*);
-static size_t	doMbstowcs		(wchar_t*, char*, size_t);
-static size_t	doWcstombs 		(char*, wchar_t*, size_t);
-static void	copyWcsToMbs		(char*, wchar_t*, int, Boolean);
-static int 	dombtowc		(wchar_t*, char*, size_t);
-static Boolean	extractSegment		(wchar_t**, wchar_t**, int *,
-					 wchar_t**, int*, int*,	Boolean*);
-static XmString	StringToXmString	(char*);
-static char*	getNextCStrDelim	(char*);
-static int	getCStrCount		(char*);
-static wchar_t *CStrCommonWideCharsGet	();
-
-#endif
-
-/*****************************************************************************
- *	STATIC CODE
- *****************************************************************************/
-
-#if defined(LOCAL_STRCASECMP)
-
-/*
- * Function:
- *      cmp = StrCasecmp(s1, s2);
- * Description:
- *      Compare two strings ignoring case
- * Input:
- *      s1 - char * : string 1 to compare
- *      s2 - char * : string 2 to compare
- * Output:
- *      int :  0; s1 == s2
- *             1; s1 != s2
- */
-static int StrCasecmp
-    ARGLIST((s1, s2))
-        ARG(register char *, s1)
-        GRA(register char *, s2)
-{
-    register int        c1, c2;
-
-    while (*s1 && *s2)
-    {
-        c1 = isupper(*s1) ? tolower(*s1) : *s1;
-        c2 = isupper(*s2) ? tolower(*s2) : *s2;
-        if (c1 != c2)
-        {
-            return(1);
-        }
-        s1++;
-        s2++;
-    }
-    if (*s1 || *s2)
-    {
-        return(1);
-    }
-    return(0);
-}
-#endif
-
-#ifndef SUPPORTS_WCHARS
-/*
- * Function:
- *      len = mblen(s, n);
- * Description:
- *      The mblen function for platforms that don't have one. This
- * 	function simply returns a length of 1 since no wide character
- *	support exists for this platform.
- * Input:
- *      s - char * : the character string to get the length from
- *	n - size_t : the size of the string
- * Output:
- *      int : always 1
- */
-static int mblen
-    ARGLIST((s, n))
-        ARG(char *, s)
-        GRA(size_t, n)
-{
-    return(1);
-}
-#endif
-
-/*
- * Function:
- *      len = strlenWc(ptr);
- * Description:
- *      Return the number of characters in a wide character string (not
- *	the characters in the resultant mbs).
- * Input:
- *      ptr - wchar_t* : pointer to the wcs to count
- * Output:
- *      int : the number of characters found
- */
-static int strlenWc
-    ARGLIST((ptr))
-        GRA(wchar_t *,ptr)
-{
-    register wchar_t	*p = ptr;
-    register int	x = 0;
-
-    if (!ptr) return(0);
-
-    while (*p++) x++;
-    return (x);
-}
-
-/*
- * Function:
- *      bytesConv = doMbstowcs(wcs, mbs, n);
- * Description:
- *      Create a wcs string from an input mbs.
- * Input:
- *	wcs - wchar_t* : pointer to result buffer of wcs
- *      mbs - char* : pointer to the source mbs
- *	n - size_t : the number of characters to convert
- * Output:
- *      bytesConv - size_t : number of bytes converted
- */
-static size_t doMbstowcs
-    ARGLIST((wcs, mbs, n))
-        ARG(wchar_t *,wcs)
-        ARG(char *, mbs)
-        GRA(size_t, n)
-{
-#ifndef SUPPORTS_WCHARS
-    int i;
-
-    for (i = 0; i < n && mbs[i] != 0; ++i)
-    {
-	wcs[i] = mbs[i];
-    }
-    wcs[i++] = 0;
-    return(i);
-#else
-    return(mbstowcs(wcs, mbs, n));
-#endif
-}
-
-/*
- * Function:
- *      bytesConv = doWcstombs(wcs, mbs, n);
- * Description:
- *      Create a mbs string from an input wcs.
- * Input:
- *	wcs - wchar_t* : pointer to the source wcs
- *      mbs - char* : pointer to result mbs buffer
- *	n - size_t : the number of characters to convert
- * Output:
- *      bytesConv - size_t : number of bytes converted
- */
-static size_t doWcstombs
-    ARGLIST((mbs, wcs, n))
-        ARG(char *, mbs)
-        ARG(wchar_t *, wcs)
-        GRA(size_t, n)
-{
-#ifndef SUPPORTS_WCHARS
-    int i;
-
-    for (i = 0; i < n && wcs[i] != 0; ++i)
-    {
-	mbs[i] = wcs[i];
-    }
-    mbs[i] = 0;
-    return(i);
-#else
-    size_t	retval;
-
-    retval = wcstombs(mbs, wcs, (n * sizeof(wchar_t)));
-    if ( retval == (size_t)-1 ) return(0);
-    else return(retval);
-#endif
-}
-
-/*
- * Function:
- *      copyWcsToMbs(mbs, wcs, len);
- * Description:
- *      Create a mbs string from an input wcs. This function allocates
- *	a buffer if necessary.
- * Input:
- *	mbs - char* : destination for the converted/copied output
- *	wcs - wchar_t* : pointer to wcs to copy/convert
- *	len - int : the number of wchar_t' to convert
- *	process_it - Boolean : True if processing of quoted charcters,
- *			False if blind.
- * Output:
- *      None
- */
-static void copyWcsToMbs
-    ARGLIST((mbs, wcs, len, process_it))
-        ARG(char *, mbs)
-        ARG(wchar_t *, wcs)
-        ARG(int, len)
-        GRA(Boolean, process_it)
-{
-    static	wchar_t	*tbuf = NULL;
-    static	int	tbufSize = 0;
-
-    int		numCvt;
-    int		lenToConvert;
-    wchar_t	*fromP = wcs;
-    wchar_t	*x = &fromP[len];
-    wchar_t	*toP;
-    wchar_t	*commonWChars = CStrCommonWideCharsGet();
-    wchar_t	tmp;
-
-    /*
-     * Make sure there's room in the buffer
-     */
-    if (tbufSize < len)
-    {
-	tbuf = (wchar_t*)XtRealloc((char*)tbuf, (len + 1) * sizeof(wchar_t));
-	tbufSize = len;
-    }
-
-    /*
-     * Now copy and process
-     */
-    toP = tbuf;
-    lenToConvert = 0;
-    while (fromP < x)
-    {
-	/*
-	 * Check for quoted characters
-	 */
-	if ((*fromP == commonWChars[WBackSlash]) && process_it)
-	{
-	    fromP++;		/* Skip quote */
-	    if (fromP == x)	/* Hanging quote? */
-	    {
-		*toP++ = commonWChars[WBackSlash];
-		lenToConvert++;
-		break;
-	    }
-	    tmp = *fromP++;
-	    if (tmp == commonWChars[WideN])
-	    {
-		*toP++ = commonWChars[WNewLine];
-	    }
-	    else if (tmp == commonWChars[WideT])
-	    {
-		*toP++ = commonWChars[WTab];
-	    }
-	    else if (tmp == commonWChars[WideR])
-	    {
-		*toP++ = commonWChars[WCarriageReturn];
-	    }
-	    else if (tmp == commonWChars[WideF])
-	    {
-		*toP++ = commonWChars[WFormFeed];
-	    }
-	    else if (tmp == commonWChars[WideV])
-	    {
-		*toP++ = commonWChars[WVerticalTab];
-	    }
-	    else if (tmp == commonWChars[WBackSlash])
-	    {
-		*toP++ = commonWChars[WBackSlash];
-	    }
-	    else
-	    {
-                /*
-		 * No special translation needed
-		 */
-		*toP++ = tmp;
-	    }
-	}
-	else
-	{
-	    *toP++ = *fromP++;
-	}
-	lenToConvert++;
-    }
-
-    tmp = tbuf[lenToConvert];
-    tbuf[lenToConvert] = (wchar_t) 0;
-    numCvt = doWcstombs(mbs, tbuf, lenToConvert);
-    tbuf[lenToConvert] = tmp;
-
-    mbs[numCvt] = '\0';
-}
-
-/*
- * Function:
- *      status = dombtowc(wide, multi, size);
- * Description:
- *      Convert a multibyte character to a wide character.
- * Input:
- *      wide	- wchar_t *	: where to put the wide character
- *	multi	- char *	: the multibyte character to convert
- *	size	- size_t	: the number of characters to convert
- * Output:
- *      0	- if multi is a NULL pointer or points to a NULL character
- *	#bytes	- number of bytes in the multibyte character
- *	-1	- multi is an invalid multibyte character.
- *
- *	NOTE:  if wide is NULL, then this returns the number of bytes in
- *	       the multibyte character.
- */
-static int dombtowc
-    ARGLIST((wide, multi, size))
-        ARG(wchar_t *, wide)
-        ARG(char *, multi)
-        GRA(size_t, size)
-{
-    int		retVal = 0;
-
-#ifndef SUPPORTS_WCHARS
-    if ((multi == NULL) || (*multi == '\000'))
-    {
-	if (wide) wide[0] = '\0';
-	return (0);
-    }
-
-    for (retVal = 0; retVal < size && multi[retVal] != '\000'; retVal++)
-    {
-	if (wide != NULL)
-	{
-	    wide[retVal] = multi[retVal];
-	}
-    }
-#else
-    retVal = mbtowc(wide, multi, size);
-#endif
-    return(retVal);
-}
-
-/*
- * Function:
- *	ptr = getNextSepartor(str);
- * Description:
- *	Parse through a string looking for the next compound string
- *	field separator
- * Inputs:
- *	str - wchar_t* : the address of address of the string to parse
- * Outputs:
- *	ptr - wchar_t* : pointer to character, if found, points to end
- *			of string otherwise ('\0').
- */
-static wchar_t* getNextSeparator
-    ARGLIST((str))
-        GRA(wchar_t *, str)
-{
-    wchar_t	*ptr = str;
-    wchar_t	*commonWChars = CStrCommonWideCharsGet();
-
-    while (*ptr)
-    {
-	/*
-	 * Check for separator
-	 */
-	if ((*ptr == commonWChars[WHash]) ||
-	    (*ptr == commonWChars[WQuote]) ||
-	    (*ptr == commonWChars[WColon]))
-	{
-	    return(ptr);
-	}
-	else if (*ptr == commonWChars[WBackSlash])
-	{
-	    ptr++;
-	    if (*ptr) ptr++;	/* Skip quoted character */
-	}
-	else
-	{
-	    ptr++;
-	}
-    }
-    return(ptr);
-}
-
-/*
- * Function:
- *	more =
- *        extractSegment(str, tagStart, tagLen, txtStart, txtLen,
- *			pDir, pSep);
- * Description:
- *	Parse through a string version of a compound string and extract
- *	the first compound string segment from the string.
- * Inputs:
- *	str - char** : the address of address of the string to parse
- *	tagStart - char** : address to return pointer to tag start into
- *	tagLen - int* : address where to return the tag length into
- *	txtStart - char** : address to return the text start into
- *	txtLen - int* : address where to return the text length
- *	pDir - int* : address to return the string direction into
- *	pSep - Boolean * : address to return the separtor into
- * Outputs:
- *	more - Boolean : True if more of the string to parse.
- *			False means done.
- */
-static Boolean extractSegment
-    ARGLIST((str, tagStart, tagLen, txtStart, txtLen, pDir, pSep))
-        ARG(wchar_t **, str)
-        ARG(wchar_t **, tagStart)
-        ARG(int *, tagLen)
-        ARG(wchar_t **, txtStart)
-        ARG(int *, txtLen)
-        ARG(int *, pDir)
-        GRA(Boolean *, pSep)
-{
-    wchar_t		*start;
-    wchar_t		*text;
-    int			textL;
-    Boolean		tagSeen;
-    wchar_t		*tag;
-    int			tagL;
-    Boolean		modsSeen;
-    Boolean		sep;
-    int			dir;
-    Boolean		done;
-    Boolean		checkDir;
-    wchar_t		*commonWChars;
-    wchar_t		emptyStrWcs[1];
-
-    /*
-     * Initialize variables
-     */
-    text = NULL;
-    textL = 0;
-    tagSeen = False;
-    tag = NULL;
-    tagL = 0;
-    modsSeen = False;
-    dir = XmSTRING_DIRECTION_L_TO_R;
-    sep = False;
-    done = False;
-    commonWChars = CStrCommonWideCharsGet();
-
-    /*
-     * Guard against nulls
-     */
-    if (!(start = *str))
-    {
-	start = emptyStrWcs;
-	emptyStrWcs[0] = commonWChars[WNull];
-    }
-
-    /*
-     * If the first character of the string isn't a # or a ", then we
-     * just have a regular old simple string. Do the same the thing for
-     * the empty string.
-     */
-    if ((*start == '\0') || (start != getNextSeparator(start)))
-    {
-	text = start;
-	if (!(textL = strlenWc(start)))
-	{
-	    text = NULL;
-	}
-	start += textL;
-    }
-    else
-    {
-	done = False;
-	while (!done)
-	{
-	    if (*start == commonWChars[WHash])
-	    {
-		if (tagSeen)
-		{
-		    done = True;
-		    break;
-		}
-		else
-		{
-		    tagSeen = True;
-		    tag = ++start;
-		    start = getNextSeparator(tag);
-		    if ((tagL = start - tag) == 0)
-		    {
-			tag = NULL;		/* Null tag specified */
-		    }
-		}
-	    }
-	    else if (*start == commonWChars[WQuote])
-	    {
-		text = ++start;
-		start = getNextSeparator(start);
-		while (!((*start == commonWChars[WQuote]) ||
-			 (*start == commonWChars[WNull])))
-		{
-		    start = getNextSeparator(++start);
-		}
-
-		if ((textL = start - text) == 0)
-		{
-		    text = NULL;	/* Null text specified  */
-		}
-                /*
-		 * if a quote, skip over it
-		 */
-		if (*start == commonWChars[WQuote])
-		{
-		    start++;
-		}
-		done = True;
-	    }
-	    else if (*start == commonWChars[WColon])
-	    {
-		if (modsSeen)
-		{
-		    done = True;
-		    break;
-		}
-
-		/*
-		 * If the next character is a t or f, the we've got
-		 * a separator.
-		 */
-		modsSeen = True;
-		checkDir = False;
-		start++;
-		if ((*start == commonWChars[WideT]) ||
-		    (*start == commonWChars[WideUT]) ||
-		    (*start == commonWChars[WideOne]))
-		{
-		    sep = True;
-		    start++;
-		    checkDir = True;
-		}
-		else if ((*start == commonWChars[WideF]) ||
-			 (*start == commonWChars[WideUF]) ||
-			 (*start == commonWChars[WideZero]))
-		{
-		    sep = False;
-		    start++;
-		    checkDir = True;
-		}
-		else if ((*start == commonWChars[WideR]) ||
-			 (*start == commonWChars[WideUR]))
-		{
-		    start++;
-		    dir = XmSTRING_DIRECTION_R_TO_L;
-		}
-		else if ((*start == commonWChars[WideL]) ||
-			 (*start == commonWChars[WideUL]))
-		{
-		    start++;
-		    dir = XmSTRING_DIRECTION_L_TO_R;
-		}
-		/*
-		 * Look for direction if necessary. This requires a bit of
-		 * look ahead.
-		 */
-		if (checkDir && (*start == commonWChars[WColon]))
-		{
-		    if ((*(start + 1) == commonWChars[WideL]) ||
-			(*(start + 1) == commonWChars[WideUL]))
-		    {
-			dir = XmSTRING_DIRECTION_L_TO_R;
-			start += 2;
-		    }
-		    else if ((*(start + 1) == commonWChars[WideR]) ||
-			     (*(start + 1) == commonWChars[WideUR]))
-		    {
-			dir = XmSTRING_DIRECTION_R_TO_L;
-			start+=2;
-		    }
-		}
-	    }
-            else
-	    {
-		/*
-		 * A bad string format! We'll just skip the character.
-		 */
-		start++;
-	    }
-	}
-    }
-
-    /*
-     * Now fill in return values
-     */
-    if (*str)		*str = start;
-    if (tagStart)	*tagStart = tag;
-    if (tagLen)		*tagLen = tagL;
-    if (txtStart)	*txtStart = text;
-    if (txtLen)		*txtLen = textL;
-    if (pDir)		*pDir = dir;
-    if (pSep)		*pSep = sep;
-
-    return ((*start == commonWChars[WNull]) ? False : True);
-}
-
-/*
- * Function:
- *	xstr = StringToXmString(str);
- * Description:
- *	Parse a string into an XmString.
- * Inputs:
- *	str - char * : the string to parse
- * Outputs:
- *	xstr - XmString : the allocated return structure
- */
-static XmString StringToXmString
-    ARGLIST((str))
-        GRA(char *,str)
-{
-    static char*	tagBuf = NULL;
-    static int		tagBufLen = 0;
-    static char*	textBuf = NULL;
-    static int		textBufLen = 0;
-
-    wchar_t		*ctx;
-    wchar_t		*tag;
-    int			tagLen;
-    wchar_t		*text;
-    int			textLen;
-    Boolean		sep;
-    int			dir;
-
-    Boolean		more;
-    wchar_t		*wcStr;
-    int			curDir;
-    XmString		xmStr;
-    XmString		s1;
-    XmString		s2;
-
-    if (!str) return(NULL);
-
-    /*
-     * For expediencies sake, we'll overallocate this buffer so that
-     * the wcs is guaranteed to fit (1 wc per byte in original string).
-     */
-    wcStr = (wchar_t*)XtMalloc((strlen(str) + 1) * sizeof(wchar_t));
-    doMbstowcs(wcStr, str, strlen(str) + 1);
-
-    /*
-     * Create the beginning segment
-     */
-    curDir = XmSTRING_DIRECTION_L_TO_R;
-    xmStr = XmStringDirectionCreate(curDir);
-
-    /*
-     * Convert the string.
-     */
-    more = True;
-    ctx = wcStr;
-    while (more)
-    {
-	more = extractSegment(&ctx, &tag, &tagLen,
-			      &text, &textLen, &dir, &sep);
-	/*
-	 * Pick up a direction change
-	 */
-	if (dir != curDir)
-	{
-#if defined(VMS) || (defined(__osf__) && defined(__alpha))
-#if XmVERSION > 1 || (XmVERSION == 1 && XmREVISION >= 2)
-	    /*
-	     * This is required on DEC Windows systems because they've
-	     * added the REVERT direction.
-	     */
-	    s1 = XmStringDirectionCreate(XmSTRING_DIRECTION_REVERT);
-	    s2 = xmStr;
-	    xmStr = XmStringConcat(s2, s1);
-	    XmStringFree(s1);
-	    XmStringFree(s2);
-#endif
-#endif
-	    curDir = dir;
-	    s1 = XmStringDirectionCreate(curDir);
-	    s2 = xmStr;
-	    xmStr = XmStringConcat(s2, s1);
-	    XmStringFree(s1);
-	    XmStringFree(s2);
-
-	}
-
-	/*
-	 * Create the segment. Text and tag first.
-	 */
-	if (textLen)
-	{
-	    if (textBufLen <= (textLen * sizeof(wchar_t)))
-	    {
-		textBufLen = (textLen + 1) * sizeof(wchar_t);
-		textBuf = (char*)XtRealloc(textBuf, textBufLen);
-	    }
-	    copyWcsToMbs(textBuf, text, textLen, True);
-
-	    if (tagLen)
-	    {
-		if (tagBufLen <= (tagLen * sizeof(wchar_t)))
-		{
-		    tagBufLen = (tagLen + 1) * sizeof(wchar_t);
-		    tagBuf = (char*)XtRealloc(tagBuf, tagBufLen);
-		}
-		copyWcsToMbs(tagBuf, tag, tagLen, False);
-	    }
-	    else
-	    {
-		if (!tagBuf)
-		{
-		    tagBufLen = strlen(XmSTRING_DEFAULT_CHARSET) + 1;
-		    tagBuf = (char*)XtMalloc(tagBufLen);
-		}
-		strcpy(tagBuf, XmSTRING_DEFAULT_CHARSET);
-	    }
-
-	    s1 = XmStringCreate(textBuf, tagBuf);
-	    s2 = xmStr;
-	    xmStr = XmStringConcat(s2, s1);
-	    XmStringFree(s1);
-	    XmStringFree(s2);
-	}
-
-	/*
-	 * Add in the separators.
-	 */
-	if (sep)
-	{
-	    s1 = XmStringSeparatorCreate();
-	    s2 = xmStr;
-	    xmStr = XmStringConcat(s2, s1);
-	    XmStringFree(s1);
-	    XmStringFree(s2);
-	}
-    }
-
-    /*
-     * Free up memory and return
-     */
-    XtFree((char*)wcStr);
-    return(xmStr);
-}
-
-/*
- * Function:
- *      nextCStr = getNextCStrDelim(str);
- * Description:
- *      Find the next unquoted , or \n in the string
- * Input:
- *	str - char * : the input string
- * Output:
- *      nextCStr - char* : pointer to the next delimiter. Returns NULL if no
- *			delimiter found.
- */
-static char* getNextCStrDelim
-    ARGLIST((str))
-        GRA(char *,str)
-{
-    char	*comma = str;
-    Boolean	inQuotes = False;
-    int		len;
-
-    if (!str) return(NULL);
-    if (!*str) return(NULL);	/* At end */
-
-#ifdef __CENTERLINE__
-    len = mblen((char *)NULL, sizeof(wchar_t));
-#else
-    len = mblen(NULL, sizeof(wchar_t));
-#endif
-    while (*comma)
-    {
-	if ((len = mblen(comma, sizeof(wchar_t))) > 1)
-	{
-	    comma += len;
-	    continue;
-	}
-
-	if (*comma == '\\')
-	{
-	    comma++;	/* Over quote */
-	    comma += mblen(comma, sizeof(wchar_t));
-	    continue;
-	}
-
-	/*
-	 * See if we have a delimiter
-	 */
-	if (!inQuotes)
-	{
-	    if ((*comma == ',') || (*comma == '\012'))
-	    {
-		return(comma);
-	    }
-	}
-
-	/*
-	 * Deal with quotes
-	 */
-	if (*comma == '\"')
-	{
-	    inQuotes = ~inQuotes;
-	}
-
-	comma++;
-    }
-
-    return(NULL);		/* None found */
-}
-
-/*
- * Function:
- *	cnt = getCStrCount(str);
- * Description:
- *      Get the count of cstrings in a compound string table ascii
- *	format.
- * Input:
- *      str - char * : string to parse
- * Output:
- *      cnt - int : the number of XmStrings found
- */
-static int getCStrCount
-    ARGLIST((str))
-        GRA(char *, str)
-{
-    int		x = 1;
-    char	*newStr;
-
-    if (!str) return(0);
-    if (!*str) return(0);
-
-    while ((newStr = getNextCStrDelim(str)))
-    {
-	x++;
-	str = ++newStr;
-    }
-    return(x);
-}
-
-/*
- * Function:
- *      cwc = CStrCommonWideCharsGet();
- * Description:
- *      Return the array of common wide characters.
- * Input:
- *      None.
- * Output:
- *     	cwc - wchar_t * : this array should never be written to or FREEd.
- */
-static wchar_t *CStrCommonWideCharsGet()
-{
-    static wchar_t	*CommonWideChars = NULL;
-    /*
-     * If you add to this array, don't forget to change the enum in
-     * the TYPEDEFS and DEFINES section above to correspond to this
-     * array.
-     */
-    static char	*characters[] = { "\000", "\t", "\n", "\r", "\f", "\v",
-				  "\\", "\"", "#", ":", "f", "l", "n", "r",
-				  "t", "v", "F", "L", "R", "T", "0", "1" };
-
-
-    if (CommonWideChars == NULL)
-    {
-	int	i;
-
-	/*
-	 * Allocate and create the array.
-	 */
-	CommonWideChars = (wchar_t*)XtMalloc(NUM_COMMON_WCHARS * sizeof(wchar_t));
-
-	for (i = 0; i < NUM_COMMON_WCHARS; i++)
-	{
-	    (void)dombtowc(&(CommonWideChars[i]), characters[i], 1);
-	}
-    }
-    return(CommonWideChars);
-}
-
-/*
- * Function:
- *	CONVERTER CvtStringToXmString
- *
- * Description:
- *	Convert a string to an XmString. This allows a string contained in
- *	resource file to contain multiple fonts. The syntax for the string
- *	is:
- *		::[#[font-tag]]"string"[#[font-tag]"string"] ...
- *
- *	note that the # can be escaped (\#).
- *
- * Input:
- * Output:
- *	Standard.
- */
-static Boolean CvtStringToXmString
-    ARGLIST((d, args, num_args, fromVal, toVal, data))
-        ARG(Display *, d)
-        UARG(XrmValue *, args)
-        ARG(Cardinal *, num_args)
-        ARG(XrmValue *, fromVal)
-        ARG(XrmValue *, toVal)
-        GRAU(XtPointer, data)
-{
-    static XmString	resStr;
-    char		*str;
-
-    /*
-     * This converter takes no parameters
-     */
-    if (*num_args != 0)
-    {
-	XtAppWarningMsg(XtDisplayToApplicationContext(d),
-			"cvtStringToXmString",
-			"wrongParameters",
-			"XtToolkitError",
-			"String to XmString converter needs no extra arguments",
-			(String *)NULL,
-			(Cardinal *)NULL);
-    }
-
-    /*
-     * See if this is a simple string
-     */
-    str = (char*)fromVal->addr;
-    if (strncmp(str, "::", 2))
-    {
-	resStr = XmStringCreateLtoR(fromVal->addr, XmSTRING_DEFAULT_CHARSET);
-    }
-    else
-    {
-	/*
-	 * Convert into internal format
-	 */
-	resStr = StringToXmString(fromVal->addr + 2);	/* skip :: */
-    }
-
-    /*
-     * Done, return result
-     */
-    if (toVal->addr == NULL)
-    {
-	toVal->addr = (XTPOINTER)&resStr;
-	toVal->size = sizeof(XmString);
-    }
-    else if (toVal->size < sizeof(XmString))
-    {
-	toVal->size = sizeof(XmString);
-	XtDisplayStringConversionWarning(d, fromVal->addr, "XmString");
-	XmStringFree(resStr);
-	return(False);
-    }
-    else
-    {
-	*(XmString *)toVal->addr = resStr;
-	toVal->size = sizeof(XmString);
-    }
-    return(True);
-}
-
-/*
- * Function:
- *      CONVERTER CvtStringToXmStringTable
- *
- * Description:
- *	Convert a string to an XmString table. This allows a string
- *	contained in resource file to contain multiple fonts. The syntax
- *	for the string is:
- *
- *	   compound_string = [#[font-tag]]"string"[#[font-tag]"string"] ...
- *	   compound_string_table = [compound_string][,compound_string] ...
- *
- *	note that the # can be escaped (\#).
- *
- * Input:
- * Output:
- *	Standard.
- */
-static Boolean CvtStringToXmStringTable
-    ARGLIST((d, args, num_args, fromVal, toVal, data))
-        ARG(Display *, d)
-        ARG(XrmValue *, args)
-        ARG(Cardinal *, num_args)
-        ARG(XrmValue *, fromVal)
-        ARG(XrmValue *, toVal)
-        GRAU(XtPointer, data)
-{
-    static XmString	*CStrTable;
-    XmString		*tblPtr;
-    char		*str;
-    char		*tmpBuf;
-    char		*nextDelim;
-    XrmValue		fVal;
-    XrmValue		tVal;
-
-    /*
-     * This converter takes no parameters
-     */
-    if (*num_args != 0)
-    {
-	XtAppWarningMsg
-	    (XtDisplayToApplicationContext(d),
-	     "cvtStringToXmStringTable",
-	     "wrongParameters",
-	     "XtToolkitError",
-	     "String to XmStringTable converter needs no extra arguments",
-	     (String *)NULL,
-	     (Cardinal *)NULL);
-    }
-
-    /*
-     * Set str and make sure there's somethin' there
-     */
-    if (!(str = (char*)fromVal->addr))
-    {
-	str = "";
-    }
-
-    /*
-     * Allocate the XmStrings + 1 for NULL termination
-     */
-    CStrTable = (XmString*)XtMalloc((getCStrCount(str) + 1) * sizeof(XmString*));
-
-    /*
-     * Use the string converter for the strings
-     */
-    tmpBuf = (char*)XtMalloc(strlen(str) + 1);
-    strcpy(tmpBuf, str);
-    str = tmpBuf;
-
-    /*
-     * Create strings
-     */
-    tblPtr = CStrTable;
-    if (*str)
-    {
-	while (str)
-	{
-	    nextDelim = getNextCStrDelim(str);
-
-	    /*
-	     * Overwrite nextDelim
-	     */
-	    if (nextDelim)
-	    {
-		*nextDelim = '\0';
-		nextDelim++;
-	    }
-
-	    /*
-	     * Convert it
-	     */
-	    fVal.size = strlen(str) + 1;
-	    fVal.addr = str;
-	    tVal.size = sizeof(XTPOINTER);
-	    tVal.addr = (XTPOINTER)tblPtr;
-
-	    /*
-	     * Call converter ourselves since this is used to create
-	     * the strings in the table we create. We need to do this
-	     * since we don't have a widget to send to the XtConvertAndStore
-	     * function. Side effects are that we can never get these
-	     * compound strings cached and that no destructor function is
-	     * called when the strings leave existance, but we nuke 'em
-	     * in the XmStringTable destuctor.
-	     */
-	    CvtStringToXmString(d, args, num_args, &fVal, &tVal, NULL);
-	    tblPtr++;
-	    str = nextDelim;
-	}
-    }
-    XtFree(tmpBuf);
-
-    /*
-     * Null terminate
-     */
-    *tblPtr = NULL;
-
-    /*
-     * Done, return result
-     */
-    if (toVal->addr == NULL)
-    {
-	toVal->addr = (XTPOINTER)&CStrTable;
-	toVal->size = sizeof(XmString);
-    }
-    else if (toVal->size < sizeof(XmString*))
-    {
-	toVal->size = sizeof(XmString*);
-	XtDisplayStringConversionWarning(d, fromVal->addr, "XmStringTable");
-
-	tblPtr = CStrTable;
-	while (*tblPtr)
-	{
-	    XmStringFree(*tblPtr);
-	}
-	XtFree((char*)CStrTable);
-	return(False);
-    }
-    else
-    {
-	*(XmString **)toVal->addr = CStrTable;
-	toVal->size = sizeof(XmString*);
-    }
-    return(True);
-}
-
-/*****************************************************************************
- *	GLOBAL CODE
- *****************************************************************************/
-
-/*
- * Function:
- *      RegisterBxConverters(appContext);
- * Description:
- *      This globally available function installs all the converters necessary
- *	to run BuilderXcessory generated interfaces that use compound
- *	strings. This is necessary since Motif has not supplied very smart
- *	converters.
- * Input:
- *      appContext - XtAppContext : the application context
- * Output:
- *      None
- */
-void RegisterBxConverters
-    ARGLIST((appContext))
-        GRA(XtAppContext, appContext)
-{
-    XtAppSetTypeConverter(appContext, XmRString, XmRXmString,
-			  (XtTypeConverter)CvtStringToXmString,
-			  NULL, 0, XtCacheNone, NULL);
-
-    XtAppSetTypeConverter(appContext, XmRString, XmRXmStringTable,
-			  (XtTypeConverter)CvtStringToXmStringTable,
-			  NULL, 0, XtCacheNone, NULL);
-}
-
-/*
- * Function:
- *      CONVERT(w, from_string, to_type, to_size, success);
- * Description:
- *      A converter wrapper for convenience from BuilderXcessory.
- * Input:
- *      w - Widget : the widget to use for conversion
- *	from_string - char * : the string to convert from
- *	to_type - char * : the type to convert to
- *	to_size - int : the size of the conversion result
- *	success - Boolean* : Set to the result value of the conversion
- * Output:
- *      None
- */
-#ifndef IGNORE_CONVERT
-XtPointer BX_CONVERT
-    ARGLIST((w, from_string, to_type, to_size, success))
-        ARG(Widget, w)
-        ARG(char *, from_string)
-        ARG(char *, to_type)
-        UARG(int, to_size)
-        GRA(Boolean *, success)
-{
-    XrmValue		fromVal, toVal;	/* resource holders		*/
-    Boolean		convResult;	/* return value			*/
-    XtPointer		val;		/* Pointer size return value    */
-
-    /*
-     * We will assume that the conversion is going to fail and change this
-     * value later if the conversion is a success.
-     */
-    *success = False;
-
-    /*
-     * Since we are converting from a string to some type we need to
-     * set the fromVal structure up with the string information that
-     * the caller passed in.
-     */
-    fromVal.size = strlen(from_string) + 1;
-    fromVal.addr = from_string;
-
-    /*
-     * Since we are not sure what type and size of data we are going to
-     * get back we will set this up so that the converter will point us
-     * at a block of valid data.
-     */
-    toVal.size = 0;
-    toVal.addr = NULL;
-
-    /*
-     * Now lets try to convert this data by calling this handy-dandy Xt
-     * routine.
-     */
-    convResult = XtConvertAndStore(w, XmRString, &fromVal, to_type, &toVal);
-
-
-    /*
-     * Now we have two conditions here.  One the conversion was a success
-     * and two the conversion failed.
-     */
-    if(!convResult)
-    {
-	/*
-	 * If this conversion failed that we can pretty much return right
-	 * here because there is nothing else we can do.
-	 */
-	return((XtPointer) NULL);
-    }
-
-    /*
-     * If we get this far that means we did the conversion and all is
-     * well.  Now we have to handle the special cases for type and
-     * size constraints.
-     */
-    if(!strcmp(to_type, "String"))
-    {
-	/*
-	 * Since strings are handled different in Xt we have to deal with
-	 * the conversion from a string to a string.  When this happens the
-	 * toVal.size will hold the strlen of the string so generic
-	 * conversion code can't handle it.  It is possible for a string to
-	 * string conversion to happen so we do have to watch for it.
-	 */
-	val = (XTPOINTER)toVal.addr;
-    }
-    else if(!strcmp(to_type, "Double"))
-    {
-	val = (XTPOINTER)((double*)toVal.addr);
-    }
-    else if(!strcmp(to_type, "Float"))
-    {
-	val = (XTPOINTER)((float*)toVal.addr);
-    }
-    else
-    {
-	/*
-	 * Here is the generic conversion return value handler.  This
-	 * just does some size specific casting so that value that we
-	 * return is in the correct bytes of the XtPointer that we
-	 * return.  Here we check all sizes from 1 to 8 bytes.
-	 */
-	switch(toVal.size)
-	{
-	case 1:
-	    val = (XTPOINTER)(long)(*(char*)toVal.addr);
-	    break;
-	case 2:
-	    val = (XTPOINTER)(long)(*(short*)toVal.addr);
-	    break;
-	case 4:
-	    val = (XTPOINTER)(long)(*(int*)toVal.addr);
-	    break;
-	case 8:
-	default:
-	    val = (XTPOINTER)(long)(*(long*)toVal.addr);
-	    break;
-	}
-    }
-
-    /*
-     * Well everything is done and the conversion was a success so lets
-     * set the success flag to True.
-     */
-    *success = convResult;
-
-    /*
-     * Finally lets return the converted value.
-     */
-    /*SUPPRESS 80*/
-    return(val);
-}
-
-#ifdef DEFINE_OLD_BXUTILS
-XtPointer CONVERT
-    ARGLIST((w, from_string, to_type, to_size, success))
-        ARG(Widget, w)
-        ARG(char *, from_string)
-        ARG(char *, to_type)
-        ARG(int, to_size)
-        GRA(Boolean *, success)
-{
-    return(BX_CONVERT(w, from_string, to_type, to_size, success));
-}
-#endif /* DEFINE_OLD_BXUTILS */
-#endif /* !IGNORE_CONVERT */
-
-/*
- * Function:
- *      MENU_POST(p, mw, ev, dispatch);
- * Description:
- *      A converter wrapper for convenience from BuilderXcessory.
- * Input:
- *      p - Widget : the widget to post
- *	mw - XtPointer : the menu widget
- *	ev - XEvent* : the event that caused the menu post
- *	dispatch - Boolean* : not used
- * Output:
- *      None
- */
-
-#ifndef IGNORE_MENU_POST
-void BX_MENU_POST
-    ARGLIST((p, mw, ev, dispatch))
-        UARG(Widget, p)
-        ARG(XtPointer, mw)
-        ARG(XEvent *, ev)
-        GRAU(Boolean *, dispatch)
-{
-    Arg	args[2];
-    int	argcnt;
-    int	button;
-    Widget m = (Widget)mw;
-    XButtonEvent *e = (XButtonEvent *)ev;
-
-    argcnt = 0;
-    XtSetArg(args[argcnt], XmNwhichButton, &button);
-    argcnt++;
-    XtGetValues(m, args, argcnt);
-    if(e->button != button) return;
-    XmMenuPosition(m, e);
-    XtManageChild(m);
-}
-
-#ifdef DEFINE_OLD_BXUTILS
-void MENU_POST
-    ARGLIST((p, mw, ev, dispatch))
-        UARG(Widget, p)
-        ARG(XtPointer, mw)
-        ARG(XEvent *, ev)
-        GRAU(Boolean *, dispatch)
-{
-    BX_MENU_POST(p, mw, ev, dispatch);
-}
-#endif /* DEFINE_OLD_BXUTILS */
-#endif /* !IGNORE_MENU_POST */
-
-/*
- * Function:
- *      SET_BACKGROUND_COLOR(w, args, argcnt, bg_color);
- * Description:
- *      Sets the background color and shadows of a widget.
- * Input:
- *      w - The widget to set the background color on.
- *      args, argcnt - The argument list so far.
- *      bg_color - The new background color as a pixel.
- * Output:
- *      none
- *
- *  NOTES:  This assumes that args later in the argument list
- *          override those already in the list.  Therfore i f
- *          there are shadow colors later in the list they will win.
- *
- *          There is no need to use this function when creating a widget
- *          only when doing a set values, shadow colors are automatically
- *          calculated at creation time.
- */
-void BX_SET_BACKGROUND_COLOR
-    ARGLIST((w, args, argcnt, bg_color))
-        ARG(Widget, w)
-        ARG(ArgList, args)
-        ARG(Cardinal *, argcnt)
-        GRA(Pixel, bg_color)
-{
-
-#if ((XmVERSION == 1) && (XmREVISION > 0))
-
-    /*
-     * Walk through the arglist to see if the user set the top or
-     * bottom shadow colors.
-     */
-    selectLoc = topShadowLoc =  bottomShadowLoc = UNSET;
-    for (i = 0; i < *argcnt; i++)
-    {
-	if ((strcmp(args[i].name, XmNtopShadowColor) == 0) ||
-	    (strcmp(args[i].name, XmNtopShadowPixmap) == 0))
-	{
-	    topShadowLoc = i;
-	}
-	else if ((strcmp(args[i].name, XmNbottomShadowColor) == 0) ||
-		 (strcmp(args[i].name, XmNbottomShadowPixmap) == 0))
-	{
-	    bottomShadowLoc = i;
-	}
-	else if (strcmp(args[i].name, XmNarmColor) == 0)
-	{
-	    selectLoc = i;
-	}
-	else if (strcmp(args[i].name, XmNforeground) == 0)
-	{
-	    fgLoc = i;
-	}
-    }
-
-    /*
-     * If either the top or bottom shadow are not set then we
-     * need to use XmGetColors to get the shadow colors from the backgound
-     * color and add those that are not already in the arglist to the
-     * arglist.
-     *
-     */
-    if ((bottomShadowLoc == UNSET) ||
-	(topShadowLoc == UNSET) ||
-	(selectLoc == UNSET) ||
-	(fgLoc == UNSET))
-    {
-	Arg		larg[1];
-	Colormap	cmap;
-	Pixel		topShadow;
-	Pixel		bottomShadow;
-	Pixel		select;
-	Pixel		fgColor;
-
-	XtSetArg(larg[0], XmNcolormap, &cmap);
-	XtGetValues(w, larg, 1);
-	XmGetColors(XtScreen(w), cmap, bg_color,
-		    &fgColor, &topShadow, &bottomShadow, &select);
-
-	if (topShadowLoc == UNSET)
-	{
-	    XtSetArg(args[*argcnt], XmNtopShadowColor, topShadow);
-	    (*argcnt)++;
-	}
-
-	if (bottomShadowLoc == UNSET)
-	{
-	    XtSetArg(args[*argcnt], XmNbottomShadowColor, bottomShadow);
-	    (*argcnt)++;
-	}
-
-	if (selectLoc == UNSET)
-	{
-	    XtSetArg(args[*argcnt], XmNarmColor, select);
-	    (*argcnt)++;
-	}
-
-	if (fgLoc == UNSET)
-	{
-	    XtSetArg(args[*argcnt], XmNforeground, fgColor);
-	    (*argcnt)++;
-	}
-    }
-#endif
-
-    XtSetArg(args[*argcnt], XmNbackground, bg_color); (*argcnt)++;
-}
-
-#ifdef DEFINE_OLD_BXUTILS
-void SET_BACKGROUND_COLOR
-    ARGLIST((w, args, argcnt, bg_color))
-        ARG(Widget, w)
-        ARG(ArgList, args)
-        ARG(Cardinal *, argcnt)
-        GRA(Pixel, bg_color)
-{
-    BX_SET_BACKGROUND_COLOR(w, args, argcnt, bg_color);
-}
-#endif /* DEFINE_OLD_BXUTILS */
-
-/*
- * Function:
- *	w = BxFindTopShell(start);
- * Description:
- *	Go up the hierarhcy until we find a shell widget.
- * Input:
- *      start - Widget : the widget to start with.
- * Output:
- *	w - Widget : the shell widget.
- */
-#ifndef _BX_FIND_TOP_SHELL
-#define _BX_FIND_TOP_SHELL
-
-Widget BxFindTopShell
-    ARGLIST((start))
-        GRA(Widget, start)
-{
-    Widget	p;
-
-    while((p = XtParent(start)))
-    {
-	start = p;
-    }
-    return(start);
-}
-#endif /* _BX_FIND_TOP_SHELL */
-
-/*
- * Function:
- *	BxWidgetIdsFromNames(ref, cbName, stringList)
- * Description:
- *	Return an array of widget ids from a list of widget names.
- * Input:
- *	ref - Widget : reference widget.
- *	cbName - char* : callback name.
- *	stringList - char*: list of widget names.
- * Output:
- *	WidgetList : array of widget IDs.
- */
-
-#ifndef _BX_WIDGETIDS_FROM_NAMES
-#define _BX_WIDGETIDS_FROM_NAMES
-
-WidgetList BxWidgetIdsFromNames
-    ARGLIST((ref, cbName, stringList))
-        ARG(Widget, ref)
-        ARG(char, *cbName)
-        GRA(char, *stringList)
-{
-    WidgetList	wgtIds = NULL;
-    int		wgtCount = 0;
-    Widget	inst;
-    Widget	current;
-    String	tmp;
-    String	start;
-    String	widget;
-    char       *ptr;
-
-    /*
-     * For backward compatibility, remove [ and ] from the list.
-     */
-    tmp = start = XtNewString(stringList);
-    if((start = strchr(start, '[')) != NULL) start++;
-    else start = tmp;
-
-    while((start && *start) && isspace(*start))
-    {
-	start++;
-    }
-    ptr = strrchr(start, ']');
-    if (ptr)
-    {
-	*ptr = '\0';
-    }
-
-    ptr = start + strlen(start) - 1;
-    while(ptr && *ptr)
-    {
-	if (isspace(*ptr))
-	{
-	    ptr--;
-	}
-	else
-	{
-	    ptr++;
-	    break;
-	}
-    }
-    if (ptr && *ptr)
-    {
-	*ptr = '\0';
-    }
-
-    /*
-     * start now points to the first character after the [.
-     * the list is now either empty, one, or more widget
-     * instance names.
-     */
-    start = strtok(start, ",");
-    while(start)
-    {
-        while((start && *start) && isspace(*start))
-        {
-            start++;
-        }
-        ptr = start + strlen(start) - 1;
-        while(ptr && *ptr)
-        {
-            if (isspace(*ptr))
-            {
-                ptr--;
-            }
-            else
-            {
-                ptr++;
-                break;
-            }
-        }
-        if (ptr && *ptr)
-        {
-            *ptr = '\0';
-        }
-
-	/*
-	 * Form a string to use with XtNameToWidget().
-	 */
-        widget = (char *)XtMalloc((strlen(start) + 2) * sizeof(char));
-        sprintf(widget, "*%s", start);
-
-	/*
-	 * Start at this level and continue up until the widget is found
-	 * or until the top of the hierarchy is reached.
-	 */
-	current = ref;
-	while (current != NULL)
-	{
-	    inst = XtNameToWidget(current, widget);
-	    if (inst != NULL )
-	    {
-		wgtCount++;
-		wgtIds = (WidgetList)XtRealloc((char *)wgtIds,
-					       wgtCount * sizeof(Widget));
-		wgtIds[wgtCount - 1] = inst;
-		break;
-	    }
-	    current = XtParent(current);
-	}
-
-	if (current == NULL)
-        {
-            printf("Callback Error (%s):\n\t\
-Cannot find widget %s\n", cbName, widget);
-        }
-        XtFree(widget);
-        start = strtok(NULL, ",");
-    }
-
-    /*
-     * NULL terminate the list.
-     */
-    wgtIds = (WidgetList)XtRealloc((char *)wgtIds,
-				   (wgtCount + 1) * sizeof(Widget));
-    wgtIds[wgtCount] = NULL;
-
-    XtFree((char *)tmp);
-    return(wgtIds);
-}
-#endif /* _BX_WIDGETIDS_FROM_NAMES */
-
-XtPointer BX_SINGLE
-    ARGLIST((val))
-    GRA(float, val)
-{
-    XtPointer pointer;
-
-    pointer = (XtPointer)XtMalloc(sizeof(float));
-    if ( pointer != NULL ) *((float *)pointer) = val;
-    return(pointer);
-}
-
-#ifdef DEFINE_OLD_BXUTILS
-XtPointer SINGLE
-    ARGLIST((val))
-    GRA(float, val)
-{
-    return(BX_SINGLE(val));
-}
-#endif /* DEFINE_OLD_BXUTILS */
-
-XtPointer BX_DOUBLE
-    ARGLIST((val))
-    GRA(double, val)
-{
-    XtPointer	pointer;
-
-    pointer = (XtPointer)XtMalloc(sizeof(double));
-    if ( pointer != NULL ) *((double *)pointer) = val;
-    return(pointer);
-}
-
-#ifdef DEFINE_OLD_BXUTILS
-XtPointer DOUBLE
-    ARGLIST((val))
-    GRA(double, val)
-{
-    return(BX_DOUBLE(val));
-}
-#endif /* DEFINE_OLD_BXUTILS */
-
-
-/****************************************************************************
- *
- * Big chunk of code inserted from Bull (based on modified 3.3)
- *
- ****************************************************************************/
-
-#ifndef IGNORE_XPM_PIXMAP
-
-#ifndef USE_XPM_LIBRARY
-
-#ifdef SYSV
-#include <memory.h>
-#endif
-
-/*
- * Copyright 1990, 1991 GROUPE BULL
- *
- * Permission to use, copy, modify, and distribute this software and its
- * documentation for any purpose and without fee is hereby granted, provided
- * that the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of GROUPE BULL not be used in advertising
- * or publicity pertaining to distribution of the software without specific,
- * written prior permission.  GROUPE BULL makes no representations about the
- * suitability of this software for any purpose.  It is provided "as is"
- * without express or implied warranty.
- *
- * GROUPE BULL disclaims all warranties with regard to this software,
- * including all implied warranties of merchantability and fitness,
- * in no event shall GROUPE BULL be liable for any special,
- * indirect or consequential damages or any damages
- * whatsoever resulting from loss of use, data or profits,
- * whether in an action of contract, negligence or other tortious
- * action, arising out of or in connection with the use
- * or performance of this software.
- *
- */
-
-/* Return ErrorStatus codes:
- * null     if full success
- * positive if partial success
- * negative if failure
- */
-
-#define BxXpmColorError    1
-#define BxXpmSuccess       0
-#define BxXpmOpenFailed   -1
-#define BxXpmFileInvalid  -2
-#define BxXpmNoMemory     -3
-#define BxXpmColorFailed  -4
-
-typedef struct {
-    char *name;                         /* Symbolic color name */
-    char *value;                        /* Color value */
-    Pixel pixel;                        /* Color pixel */
-} 	BxXpmColorSymbol;
-
-typedef struct {
-    unsigned long valuemask;            /* Specifies which attributes are
-                                         * defined */
-
-    Visual *visual;                     /* Specifies the visual to use */
-    Colormap colormap;                  /* Specifies the colormap to use */
-    unsigned int depth;                 /* Specifies the depth */
-    unsigned int width;                 /* Returns the width of the created
-                                         * pixmap */
-    unsigned int height;                /* Returns the height of the created
-                                         * pixmap */
-    unsigned int x_hotspot;             /* Returns the x hotspot's
-                                         * coordinate */
-    unsigned int y_hotspot;             /* Returns the y hotspot's
-                                         * coordinate */
-    unsigned int cpp;                   /* Specifies the number of char per
-                                         * pixel */
-    Pixel *pixels;                      /* List of used color pixels */
-    unsigned int npixels;               /* Number of pixels */
-    BxXpmColorSymbol *colorsymbols;       /* Array of color symbols to
-                                         * override */
-    unsigned int numsymbols;            /* Number of symbols */
-    char *rgb_fname;                    /* RGB text file name */
-
-    /* Infos */
-    unsigned int ncolors;               /* Number of colors */
-    char ***colorTable;                 /* Color table pointer */
-    char *hints_cmt;                    /* Comment of the hints section */
-    char *colors_cmt;                   /* Comment of the colors section */
-    char *pixels_cmt;                   /* Comment of the pixels section */
-    unsigned int mask_pixel;            /* Transparent pixel's color table
-                                         * index */
-}      BxXpmAttributes;
-
-/* Xpm attribute value masks bits */
-#define BxXpmVisual          (1L<<0)
-#define BxXpmColormap        (1L<<1)
-#define BxXpmDepth           (1L<<2)
-#define BxXpmSize            (1L<<3)      /* width & height */
-#define BxXpmHotspot         (1L<<4)      /* x_hotspot & y_hotspot */
-#define BxXpmCharsPerPixel   (1L<<5)
-#define BxXpmColorSymbols    (1L<<6)
-#define BxXpmRgbFilename     (1L<<7)
-#define BxXpmInfos           (1L<<8)      /* all infos members */
-
-#define BxXpmReturnPixels    (1L<<9)
-#define BxXpmReturnInfos     BxXpmInfos
-
-/*
- * minimal portability layer between ansi and KR C
- */
-
-/* forward declaration of functions with prototypes */
-
-#ifdef NeedFunctionPrototypes
-#define LFUNC(f, t, p) static t f p
-#else
-#define LFUNC(f, t, p) static t f()
-#endif
-
-/*
- * functions declarations
- */
-LFUNC(BxXpmCreatePixmapFromData, int, (Display * display,
-				       Drawable d,
-				       char **data,
-				       Pixmap * pixmap_return,
-				       Pixmap * shapemask_return,
-				       BxXpmAttributes * attributes));
-
-LFUNC(BxXpmCreateImageFromData, int, (Display * display,
-				      char **data,
-				      XImage ** image_return,
-				      XImage ** shapemask_return,
-				      BxXpmAttributes * attributes));
-
-LFUNC(BxXpmFreeAttributes, void, (BxXpmAttributes * attributes));
-
-typedef struct {
-    unsigned int type;
-    union {
-        FILE *file;
-        char **data;
-    }     stream;
-    char *cptr;
-    unsigned int line;
-    int CommentLength;
-    char Comment[BUFSIZ];
-    char *Bcmt, *Ecmt, Bos, Eos;
-    unsigned int InsideString;          /* used during parsing: 0 or 1
-                                         * whether we are inside or not */
-}      bxxpmData;
-
-#define BXXPMARRAY 0
-#define BXXPMFILE  1
-#define BXXPMPIPE  2
-
-typedef unsigned char byte;
-
-#define BX_TRANSPARENT_COLOR "None"        /* this must be a string! */
-
-/* number of BxXpmColorKeys */
-#define BXNKEYS 5
-
-/*
- * key numbers for visual type, they must fit along with the number key of
- * each corresponding element in BxXpmColorKeys[] defined in xpm.h
- */
-#define BXMONO    2
-#define BXGRAY4   3
-#define BXGRAY    4
-#define BXCOLOR   5
-
-/* structure containing data related to an Xpm pixmap */
-typedef struct {
-    char *name;
-    unsigned int width;
-    unsigned int height;
-    unsigned int cpp;
-    unsigned int ncolors;
-    char ***colorTable;
-    unsigned int *pixelindex;
-    XColor *xcolors;
-    char **colorStrings;
-    unsigned int mask_pixel;            /* mask pixel's colorTable index */
-}      bxxpmInternAttrib;
-
-#define BX_UNDEF_PIXEL 0x80000000
-
-char *BxXpmColorKeys[] =
-{
- "s",					/* key #1: symbol */
- "m",					/* key #2: mono visual */
- "g4",					/* key #3: 4 grays visual */
- "g",					/* key #4: gray visual */
- "c",					/* key #5: color visual */
-};
-
-/* XPM private routines */
-
-LFUNC(xpmCreateImage, int, (Display * display,
-                           bxxpmInternAttrib * attrib,
-                           XImage ** image_return,
-                           XImage ** shapeimage_return,
-                           BxXpmAttributes * attributes));
-
-LFUNC(xpmParseData, int, (bxxpmData * data,
-                         bxxpmInternAttrib * attrib_return,
-                         BxXpmAttributes * attributes));
-
-LFUNC(BxXpmVisualType, int, (Visual * visual));
-LFUNC(xpmFreeColorTable, void, (char ***colorTable, int ncolors));
-
-LFUNC(xpmInitInternAttrib, void, (bxxpmInternAttrib * xmpdata));
-
-LFUNC(xpmFreeInternAttrib, void, (bxxpmInternAttrib * xmpdata));
-
-LFUNC(xpmSetAttributes, void, (bxxpmInternAttrib * attrib,
-                             BxXpmAttributes * attributes));
-
-/* I/O utility */
-
-LFUNC(xpmNextString, void, (bxxpmData * mdata));
-LFUNC(xpmNextUI, int, (bxxpmData * mdata, unsigned int *ui_return));
-LFUNC(xpmGetC, int, (bxxpmData * mdata));
-LFUNC(xpmUngetC, int, (int c, bxxpmData * mdata));
-LFUNC(xpmNextWord, unsigned int, (bxxpmData * mdata, char *buf));
-LFUNC(xpmGetCmt, void, (bxxpmData * mdata, char **cmt));
-LFUNC(xpmOpenArray, int, (char **data, bxxpmData * mdata));
-LFUNC(XpmDataClose, void, (bxxpmData * mdata));
-
-/* RGB utility */
-
-LFUNC(xpm_xynormalizeimagebits, void, (register unsigned char *bp,
-                                     register XImage * img));
-LFUNC(xpm_znormalizeimagebits, void, (register unsigned char *bp,
-                                    register XImage * img));
-
-/* Image utility */
-
-LFUNC(SetColor, int, (Display * display, Colormap colormap, char *colorname,
-		      unsigned int color_index, Pixel * image_pixel,
-		      Pixel * mask_pixel, unsigned int *mask_pixel_index));
-
-LFUNC(CreateXImage, int, (Display * display, Visual * visual,
-			  unsigned int depth, unsigned int width,
-			  unsigned int height, XImage ** image_return));
-
-LFUNC(SetImagePixels, void, (XImage * image, unsigned int width,
-			    unsigned int height, unsigned int *pixelindex,
-			    Pixel * pixels));
-
-LFUNC(SetImagePixels32, void, (XImage * image, unsigned int width,
-			      unsigned int height, unsigned int *pixelindex,
-			      Pixel * pixels));
-
-LFUNC(SetImagePixels16, void, (XImage * image, unsigned int width,
-			      unsigned int height, unsigned int *pixelindex,
-			      Pixel * pixels));
-
-LFUNC(SetImagePixels8, void, (XImage * image, unsigned int width,
-			     unsigned int height, unsigned int *pixelindex,
-			     Pixel * pixels));
-
-LFUNC(SetImagePixels1, void, (XImage * image, unsigned int width,
-			     unsigned int height, unsigned int *pixelindex,
-			     Pixel * pixels));
-
-LFUNC(atoui, unsigned int, (char *p, unsigned int l, unsigned int *ui_return));
-
-/*
- * Macros
- *
- * The BXXYNORMALIZE macro determines whether XY format data requires
- * normalization and calls a routine to do so if needed. The logic in
- * this module is designed for LSBFirst byte and bit order, so
- * normalization is done as required to present the data in this order.
- *
- * The BXZNORMALIZE macro performs byte and nibble order normalization if
- * required for Z format data.
- *
- * The BXXYINDEX macro computes the index to the starting byte (char) boundary
- * for a bitmap_unit containing a pixel with coordinates x and y for image
- * data in XY format.
- *
- * The BXZINDEX* macros compute the index to the starting byte (char) boundary
- * for a pixel with coordinates x and y for image data in ZPixmap format.
- *
- */
-
-#define BXXYNORMALIZE(bp, img) \
-    if ((img->byte_order == MSBFirst) || (img->bitmap_bit_order == MSBFirst)) \
-        xpm_xynormalizeimagebits((unsigned char *)(bp), img)
-
-#define BXZNORMALIZE(bp, img) \
-    if (img->byte_order == MSBFirst) \
-        xpm_znormalizeimagebits((unsigned char *)(bp), img)
-
-#define BXXYINDEX(x, y, img) \
-    ((y) * img->bytes_per_line) + \
-    (((x) + img->xoffset) / img->bitmap_unit) * (img->bitmap_unit >> 3)
-
-#define BXZINDEX(x, y, img) ((y) * img->bytes_per_line) + \
-    (((x) * img->bits_per_pixel) >> 3)
-
-#define BXZINDEX32(x, y, img) ((y) * img->bytes_per_line) + ((x) << 2)
-
-#define BXZINDEX16(x, y, img) ((y) * img->bytes_per_line) + ((x) << 1)
-
-#define BXZINDEX8(x, y, img) ((y) * img->bytes_per_line) + (x)
-
-#define BXZINDEX1(x, y, img) ((y) * img->bytes_per_line) + ((x) >> 3)
-
-#if __STDC__
-#define Const const
-#else
-#define Const
-#endif
-
-
-
-static unsigned int atoui
-ARGLIST((p, l, ui_return))
-ARG(register char *, p)
-ARG(unsigned int, l)
-GRA(unsigned int *, ui_return)
-{
-    register int n, i;
-
-    n = 0;
-    for (i = 0; i < l; i++)
-        if (*p >= '0' && *p <= '9')
-            n = n * 10 + *p++ - '0';
-        else
-            break;
-
-    if (i != 0 && i == l) {
-        *ui_return = n;
-        return 1;
-    } else
-        return 0;
-}
-
-static int BxXpmCreatePixmapFromData
-ARGLIST((display, d, data, pixmap_return, shapemask_return, attributes))
-ARG(Display *, display)
-ARG(Drawable, d)
-ARG(char **, data)
-ARG(Pixmap *, pixmap_return)
-ARG(Pixmap *, shapemask_return)
-GRA(BxXpmAttributes *,attributes)
-{
-    XImage *image, **imageptr = NULL;
-    XImage *shapeimage, **shapeimageptr = NULL;
-    int ErrorStatus;
-    XGCValues gcv;
-    GC gc;
-
-    /*
-     * initialize return values
-     */
-    if (pixmap_return) {
-        *pixmap_return = (Pixmap) NULL;
-        imageptr = ℑ
-    }
-    if (shapemask_return) {
-        *shapemask_return = (Pixmap) NULL;
-        shapeimageptr = &shapeimage;
-    }
-
-    /*
-     * create the images
-     */
-    ErrorStatus = BxXpmCreateImageFromData(display, data, imageptr,
-                                         shapeimageptr, attributes);
-    if (ErrorStatus < 0)
-        return (ErrorStatus);
-
-    /*
-     * create the pixmaps
-     */
-    if (imageptr && image) {
-        *pixmap_return = XCreatePixmap(display, d, image->width,
-                                       image->height, image->depth);
-        gcv.function = GXcopy;
-        gc = XCreateGC(display, *pixmap_return, GCFunction, &gcv);
-
-        XPutImage(display, *pixmap_return, gc, image, 0, 0, 0, 0,
-                  image->width, image->height);
-
-        XDestroyImage(image);
-        XFreeGC(display, gc);
-    }
-    if (shapeimageptr && shapeimage) {
-        *shapemask_return = XCreatePixmap(display, d, shapeimage->width,
-                                          shapeimage->height,
-                                          shapeimage->depth);
-        gcv.function = GXcopy;
-        gc = XCreateGC(display, *shapemask_return, GCFunction, &gcv);
-
-        XPutImage(display, *shapemask_return, gc, shapeimage, 0, 0, 0, 0,
-                  shapeimage->width, shapeimage->height);
-
-        XDestroyImage(shapeimage);
-        XFreeGC(display, gc);
-    }
-    return (ErrorStatus);
-}
-
-
-static int BxXpmCreateImageFromData
-ARGLIST((display, data, image_return, shapeimage_return, attributes))
-ARG(Display *,display)
-ARG(char **, data)
-ARG(XImage **, image_return)
-ARG(XImage **, shapeimage_return)
-GRA(BxXpmAttributes *, attributes)
-{
-    bxxpmData mdata;
-    int ErrorStatus;
-    bxxpmInternAttrib attrib;
-
-    /*
-     * initialize return values
-     */
-    if (image_return)
-        *image_return = NULL;
-    if (shapeimage_return)
-        *shapeimage_return = NULL;
-
-    if ((ErrorStatus = xpmOpenArray(data, &mdata)) != BxXpmSuccess)
-        return (ErrorStatus);
-
-    xpmInitInternAttrib(&attrib);
-
-    ErrorStatus = xpmParseData(&mdata, &attrib, attributes);
-
-    if (ErrorStatus == BxXpmSuccess)
-        ErrorStatus = xpmCreateImage(display, &attrib, image_return,
-                                     shapeimage_return, attributes);
-
-    if (ErrorStatus >= 0)
-        xpmSetAttributes(&attrib, attributes);
-    else if (attributes)
-        BxXpmFreeAttributes(attributes);
-
-    xpmFreeInternAttrib(&attrib);
-    XpmDataClose(&mdata);
-
-    return (ErrorStatus);
-}
-
-/*
- * open the given array to be read or written as an bxxpmData which is returned
- */
-static int xpmOpenArray
-ARGLIST((data, mdata))
-ARG(char **,data)
-GRA(bxxpmData *,mdata)
-{
-    mdata->type = BXXPMARRAY;
-    mdata->stream.data = data;
-    mdata->cptr = *data;
-    mdata->line = 0;
-    mdata->CommentLength = 0;
-    mdata->Bcmt = mdata->Ecmt = NULL;
-    mdata->Bos = mdata->Eos = '\0';
-    mdata->InsideString = 0;
-    return (BxXpmSuccess);
-}
-
-/*
- * Intialize the bxxpmInternAttrib pointers to Null to know
- * which ones must be freed later on.
- */
-static void xpmInitInternAttrib
-ARGLIST((attrib))
-GRA(bxxpmInternAttrib *,attrib)
-{
-    attrib->ncolors = 0;
-    attrib->colorTable = NULL;
-    attrib->pixelindex = NULL;
-    attrib->xcolors = NULL;
-    attrib->colorStrings = NULL;
-    attrib->mask_pixel = BX_UNDEF_PIXEL;
-}
-
-/* function call in case of error, frees only localy allocated variables */
-#undef RETURN
-#define RETURN(status) \
-  { if (colorTable) xpmFreeColorTable(colorTable, ncolors); \
-    if (chars) free(chars); \
-    if (pixelindex) free((char *)pixelindex); \
-    if (hints_cmt)  free((char *)hints_cmt); \
-    if (colors_cmt) free((char *)colors_cmt); \
-    if (pixels_cmt) free((char *)pixels_cmt); \
-    return(status); }
-
-/*
- * This function parses an Xpm file or data and store the found informations
- * in an an bxxpmInternAttrib structure which is returned.
- */
-static int xpmParseData
-ARGLIST((data, attrib_return, attributes))
-ARG(bxxpmData *,data)
-ARG(bxxpmInternAttrib *, attrib_return)
-GRA(BxXpmAttributes *, attributes)
-{
-    /* variables to return */
-    unsigned int width, height;
-    unsigned int ncolors = 0;
-    unsigned int cpp;
-    unsigned int x_hotspot, y_hotspot, hotspot = 0;
-    char ***colorTable = NULL;
-    unsigned int *pixelindex = NULL;
-    char *hints_cmt = NULL;
-    char *colors_cmt = NULL;
-    char *pixels_cmt = NULL;
-
-    /* calculation variables */
-    unsigned int rncolors = 0;		/* read number of colors, it is
-					 * different to ncolors to avoid
-					 * problem when freeing the
-					 * colorTable in case an error
-					 * occurs while reading the hints
-					 * line */
-    unsigned int key;			/* color key */
-    char *chars = NULL, buf[BUFSIZ];
-    unsigned int *iptr;
-    unsigned int a, b, x, y, l;
-
-    unsigned int curkey;		/* current color key */
-    unsigned int lastwaskey;		/* key read */
-    char curbuf[BUFSIZ];		/* current buffer */
-
-    /*
-     * read hints: width, height, ncolors, chars_per_pixel
-     */
-    if (!(xpmNextUI(data, &width) && xpmNextUI(data, &height)
-	  && xpmNextUI(data, &rncolors) && xpmNextUI(data, &cpp)))
-	RETURN(BxXpmFileInvalid);
-
-    ncolors = rncolors;
-
-    /*
-     * read hotspot coordinates if any
-     */
-    hotspot = xpmNextUI(data, &x_hotspot) && xpmNextUI(data, &y_hotspot);
-
-    /*
-     * store the hints comment line
-     */
-    if (attributes && (attributes->valuemask & BxXpmReturnInfos))
-	xpmGetCmt(data, &hints_cmt);
-
-    /*
-     * read colors
-     */
-    colorTable = (char ***) calloc(ncolors, sizeof(char **));
-    if (!colorTable)
-	RETURN(BxXpmNoMemory);
-
-    for (a = 0; a < ncolors; a++) {
-	xpmNextString(data);		/* skip the line */
-	colorTable[a] = (char **) calloc((BXNKEYS + 1), sizeof(char *));
-	if (!colorTable[a])
-	    RETURN(BxXpmNoMemory);
-
-	/*
-	 * read pixel value
-	 */
-	colorTable[a][0] = (char *) malloc(cpp);
-	if (!colorTable[a][0])
-	    RETURN(BxXpmNoMemory);
-	for (b = 0; b < cpp; b++)
-	    colorTable[a][0][b] = xpmGetC(data);
-
-	/*
-	 * read color keys and values
-	 */
-	curkey = 0;
-	lastwaskey = 0;
-	while ((l = xpmNextWord(data, buf))) {
-	    if (!lastwaskey) {
-		for (key = 1; key < BXNKEYS + 1; key++)
-		    if ((strlen(BxXpmColorKeys[key - 1]) == l)
-			&& (!strncmp(BxXpmColorKeys[key - 1], buf, l)))
-			break;
-	    }
-	    if (!lastwaskey && key <= BXNKEYS) {	/* open new key */
-		if (curkey) {		/* flush string */
-		    colorTable[a][curkey] =
-			(char *) malloc(strlen(curbuf) + 1);
-		    if (!colorTable[a][curkey])
-			RETURN(BxXpmNoMemory);
-		    strcpy(colorTable[a][curkey], curbuf);
-		}
-		curkey = key;		/* set new key  */
-		curbuf[0] = '\0';	/* reset curbuf */
-		lastwaskey = 1;
-	    } else {
-		if (!curkey)
-		    RETURN(BxXpmFileInvalid);	/* key without value */
-		if (!lastwaskey)
-		    strcat(curbuf, " ");/* append space */
-		buf[l] = '\0';
-		strcat(curbuf, buf);	/* append buf */
-		lastwaskey = 0;
-	    }
-	}
-	if (!curkey)
-	    RETURN(BxXpmFileInvalid);	/* key without value */
-	colorTable[a][curkey] = (char *) malloc(strlen(curbuf) + 1);
-	if (!colorTable[a][curkey])
-	    RETURN(BxXpmNoMemory);
-	strcpy(colorTable[a][curkey], curbuf);
-    }
-
-    /*
-     * store the colors comment line
-     */
-    if (attributes && (attributes->valuemask & BxXpmReturnInfos))
-	xpmGetCmt(data, &colors_cmt);
-
-    /*
-     * read pixels and index them on color number
-     */
-    pixelindex =
-	(unsigned int *) malloc(sizeof(unsigned int) * width * height);
-    if (!pixelindex)
-	RETURN(BxXpmNoMemory);
-
-    iptr = pixelindex;
-
-    chars = (char *) malloc(cpp);
-    if (!chars)
-	RETURN(BxXpmNoMemory);
-
-    for (y = 0; y < height; y++) {
-	xpmNextString(data);
-	for (x = 0; x < width; x++, iptr++) {
-	    for (a = 0; a < cpp; a++)
-		chars[a] = xpmGetC(data);
-	    for (a = 0; a < ncolors; a++)
-		if (!strncmp(colorTable[a][0], chars, cpp))
-		    break;
-	    if (a == ncolors)
-		RETURN(BxXpmFileInvalid);	/* no color matches */
-	    *iptr = a;
-	}
-    }
-
-    /*
-     * store the pixels comment line
-     */
-    if (attributes && (attributes->valuemask & BxXpmReturnInfos))
-	xpmGetCmt(data, &pixels_cmt);
-
-    free(chars);
-
-    /*
-     * store found informations in the bxxpmInternAttrib structure
-     */
-    attrib_return->width = width;
-    attrib_return->height = height;
-    attrib_return->cpp = cpp;
-    attrib_return->ncolors = ncolors;
-    attrib_return->colorTable = colorTable;
-    attrib_return->pixelindex = pixelindex;
-
-    if (attributes) {
-	if (attributes->valuemask & BxXpmReturnInfos) {
-	    attributes->hints_cmt = hints_cmt;
-	    attributes->colors_cmt = colors_cmt;
-	    attributes->pixels_cmt = pixels_cmt;
-	}
-	if (hotspot) {
-	    attributes->x_hotspot = x_hotspot;
-	    attributes->y_hotspot = y_hotspot;
-	    attributes->valuemask |= BxXpmHotspot;
-	}
-    }
-    return (BxXpmSuccess);
-}
-
-/*
- * set the color pixel related to the given colorname,
- * return 0 if success, 1 otherwise.
- */
-
-static int SetColor
-ARGLIST((display, colormap,colorname, color_index, image_pixel, mask_pixel, mask_pixel_index))
-ARG(Display *, display)
-ARG(Colormap, colormap)
-ARG(char *, colorname)
-ARG(unsigned int, color_index)
-ARG(Pixel *, image_pixel)
-ARG(Pixel *, mask_pixel)
-GRA(unsigned int *, mask_pixel_index)
-{
-    XColor xcolor;
-
-    if (STRCASECMP(colorname, BX_TRANSPARENT_COLOR)) {
-	if (!XParseColor(display, colormap, colorname, &xcolor)
-	    || (!XAllocColor(display, colormap, &xcolor)))
-	    return (1);
-	*image_pixel = xcolor.pixel;
-	*mask_pixel = 1;
-    } else {
-	*image_pixel = 0;
-	*mask_pixel = 0;
-	*mask_pixel_index = color_index;/* store the color table index */
-    }
-    return (0);
-}
-
-/* function call in case of error, frees only localy allocated variables */
-#undef RETURN
-#define RETURN(status) \
-  { if (image) XDestroyImage(image); \
-    if (shapeimage) XDestroyImage(shapeimage); \
-    if (image_pixels) free((char *)image_pixels); \
-    if (mask_pixels) free((char *)mask_pixels); \
-    return(status); }
-
-static int xpmCreateImage
-ARGLIST((display, attrib, image_return, shapeimage_return, attributes))
-ARG(Display *, display)
-ARG(bxxpmInternAttrib *, attrib)
-ARG(XImage **, image_return)
-ARG(XImage **, shapeimage_return)
-GRA(BxXpmAttributes *, attributes)
-{
-    /* variables stored in the BxXpmAttributes structure */
-    Visual *visual;
-    Colormap colormap;
-    unsigned int depth;
-    BxXpmColorSymbol *colorsymbols;
-    unsigned int numsymbols;
-
-    /* variables to return */
-    XImage *image = NULL;
-    XImage *shapeimage = NULL;
-    unsigned int mask_pixel;
-    unsigned int ErrorStatus, ErrorStatus2;
-
-    /* calculation variables */
-    Pixel *image_pixels = NULL;
-    Pixel *mask_pixels = NULL;
-    char *colorname;
-    unsigned int a, b, l;
-    Boolean pixel_defined;
-    unsigned int key;
-
-
-    /*
-     * retrieve information from the BxXpmAttributes
-     */
-    if (attributes && attributes->valuemask & BxXpmColorSymbols) {
-	colorsymbols = attributes->colorsymbols;
-	numsymbols = attributes->numsymbols;
-    } else
-	numsymbols = 0;
-
-    if (attributes && attributes->valuemask & BxXpmVisual)
-	visual = attributes->visual;
-    else
-	visual = DefaultVisual(display, DefaultScreen(display));
-
-    if (attributes && attributes->valuemask & BxXpmColormap)
-	colormap = attributes->colormap;
-    else
-	colormap = DefaultColormap(display, DefaultScreen(display));
-
-    if (attributes && attributes->valuemask & BxXpmDepth)
-	depth = attributes->depth;
-    else
-	depth = DefaultDepth(display, DefaultScreen(display));
-
-
-    ErrorStatus = BxXpmSuccess;
-
-    /*
-     * alloc pixels index tables
-     */
-
-    key = BxXpmVisualType(visual);
-    image_pixels = (Pixel *) malloc(sizeof(Pixel) * attrib->ncolors);
-    if (!image_pixels)
-	RETURN(BxXpmNoMemory);
-
-    mask_pixels = (Pixel *) malloc(sizeof(Pixel) * attrib->ncolors);
-    if (!mask_pixels)
-	RETURN(BxXpmNoMemory);
-
-    mask_pixel = BX_UNDEF_PIXEL;
-
-    /*
-     * get pixel colors, store them in index tables
-     */
-    for (a = 0; a < attrib->ncolors; a++) {
-	colorname = NULL;
-	pixel_defined = False;
-
-	/*
-	 * look for a defined symbol
-	 */
-	if (numsymbols && attrib->colorTable[a][1]) {
-	    for (l = 0; l < numsymbols; l++)
-		if (!strcmp(colorsymbols[l].name, attrib->colorTable[a][1]))
-		    break;
-	    if (l != numsymbols) {
-		if (colorsymbols[l].value)
-		    colorname = colorsymbols[l].value;
-		else
-		    pixel_defined = True;
-	    }
-	}
-	if (!pixel_defined) {		/* pixel not given as symbol value */
-
-	    if (colorname) {		/* colorname given as symbol value */
-		if (!SetColor(display, colormap, colorname, a,
-			   &image_pixels[a], &mask_pixels[a], &mask_pixel))
-		    pixel_defined = True;
-		else
-		    ErrorStatus = BxXpmColorError;
-	    }
-	    b = key;
-	    while (!pixel_defined && b > 1) {
-		if (attrib->colorTable[a][b]) {
-		    if (!SetColor(display, colormap, attrib->colorTable[a][b],
-				  a, &image_pixels[a], &mask_pixels[a],
-				  &mask_pixel)) {
-			pixel_defined = True;
-			break;
-		    } else
-			ErrorStatus = BxXpmColorError;
-		}
-		b--;
-	    }
-
-	    b = key + 1;
-	    while (!pixel_defined && b < BXNKEYS + 1) {
-		if (attrib->colorTable[a][b]) {
-		    if (!SetColor(display, colormap, attrib->colorTable[a][b],
-				  a, &image_pixels[a], &mask_pixels[a],
-				  &mask_pixel)) {
-			pixel_defined = True;
-			break;
-		    } else
-			ErrorStatus = BxXpmColorError;
-		}
-		b++;
-	    }
-
-	    if (!pixel_defined)
-		RETURN(BxXpmColorFailed);
-
-	} else {
-	    image_pixels[a] = colorsymbols[l].pixel;
-	    mask_pixels[a] = 1;
-	}
-    }
-
-    /*
-     * create the image
-     */
-    if (image_return) {
-	ErrorStatus2 = CreateXImage(display, visual, depth,
-				    attrib->width, attrib->height, &image);
-	if (ErrorStatus2 != BxXpmSuccess)
-	    RETURN(ErrorStatus2);
-
-	/*
-	 * set the image data
-	 *
-	 * In case depth is 1 or bits_per_pixel is 4, 6, 8, 24 or 32 use
-	 * optimized functions, otherwise use slower but sure general one.
-	 *
-	 */
-
-	if (image->depth == 1)
-	    SetImagePixels1(image, attrib->width, attrib->height,
-			    attrib->pixelindex, image_pixels);
-	else if (image->bits_per_pixel == 8)
-	    SetImagePixels8(image, attrib->width, attrib->height,
-			    attrib->pixelindex, image_pixels);
-	else if (image->bits_per_pixel == 16)
-	    SetImagePixels16(image, attrib->width, attrib->height,
-			     attrib->pixelindex, image_pixels);
-	else if (image->bits_per_pixel == 32)
-	    SetImagePixels32(image, attrib->width, attrib->height,
-			     attrib->pixelindex, image_pixels);
-	else
-	    SetImagePixels(image, attrib->width, attrib->height,
-			   attrib->pixelindex, image_pixels);
-    }
-
-    /*
-     * create the shape mask image
-     */
-    if (mask_pixel != BX_UNDEF_PIXEL && shapeimage_return) {
-	ErrorStatus2 = CreateXImage(display, visual, 1, attrib->width,
-				    attrib->height, &shapeimage);
-	if (ErrorStatus2 != BxXpmSuccess)
-	    RETURN(ErrorStatus2);
-
-	SetImagePixels1(shapeimage, attrib->width, attrib->height,
-			attrib->pixelindex, mask_pixels);
-    }
-    free((char *)mask_pixels);
-
-    /*
-     * if requested store allocated pixels in the BxXpmAttributes structure
-     */
-    if (attributes &&
-	(attributes->valuemask & BxXpmReturnInfos
-	 || attributes->valuemask & BxXpmReturnPixels)) {
-	if (mask_pixel != BX_UNDEF_PIXEL) {
-	    Pixel *pixels, *p1, *p2;
-
-	    attributes->npixels = attrib->ncolors - 1;
-	    pixels = (Pixel *) malloc(sizeof(Pixel) * attributes->npixels);
-	    if (pixels) {
-		p1 = image_pixels;
-		p2 = pixels;
-		for (a = 0; a < attrib->ncolors; a++, p1++)
-		    if (a != mask_pixel)
-			*p2++ = *p1;
-		attributes->pixels = pixels;
-	    } else {
-		/* if error just say we can't return requested data */
-		attributes->valuemask &= ~BxXpmReturnPixels;
-		attributes->valuemask &= ~BxXpmReturnInfos;
-		attributes->pixels = NULL;
-		attributes->npixels = 0;
-	    }
-	    free((char *)image_pixels);
-	} else {
-	    attributes->pixels = image_pixels;
-	    attributes->npixels = attrib->ncolors;
-	}
-	attributes->mask_pixel = mask_pixel;
-    } else
-	free((char *)image_pixels);
-
-
-    /*
-     * return created images
-     */
-    if (image_return)
-	*image_return = image;
-
-    if (shapeimage_return)
-	*shapeimage_return = shapeimage;
-
-    return (ErrorStatus);
-}
-
-
-/*
- * Create an XImage
- */
-static int CreateXImage
-ARGLIST((display, visual, depth, width, height, image_return))
-ARG(Display *, display)
-ARG(Visual *, visual)
-ARG(unsigned int, depth)
-ARG(unsigned int, width)
-ARG(unsigned int, height)
-GRA(XImage **, image_return)
-{
-    int bitmap_pad;
-
-    /* first get bitmap_pad */
-    if (depth > 16)
-	bitmap_pad = 32;
-    else if (depth > 8)
-	bitmap_pad = 16;
-    else
-	bitmap_pad = 8;
-
-    /* then create the XImage with data = NULL and bytes_per_line = 0 */
-
-    *image_return = XCreateImage(display, visual, depth, ZPixmap, 0, 0,
-				 width, height, bitmap_pad, 0);
-    if (!*image_return)
-	return (BxXpmNoMemory);
-
-    /* now that bytes_per_line must have been set properly alloc data */
-
-    (*image_return)->data =
-	(char *) malloc((*image_return)->bytes_per_line * height);
-
-    if (!(*image_return)->data) {
-	XDestroyImage(*image_return);
-	*image_return = NULL;
-	return (BxXpmNoMemory);
-    }
-    return (BxXpmSuccess);
-}
-
-
-/*
- * The functions below are written from X11R5 MIT's code (XImUtil.c)
- *
- * The idea is to have faster functions than the standard XPutPixel function
- * to build the image data. Indeed we can speed up things by supressing tests
- * performed for each pixel. We do exactly the same tests but at the image
- * level. Assuming that we use only ZPixmap images.
- */
-
-LFUNC(_putbits, void, (register char *src, int dstoffset,
-		      register int numbits, register char *dst));
-
-LFUNC(_XReverse_Bytes, void, (register unsigned char *bpt, register int nb));
-
-static unsigned char Const _reverse_byte[0x100] = {
-			    0x00, 0x80, 0x40, 0xc0, 0x20, 0xa0, 0x60, 0xe0,
-			    0x10, 0x90, 0x50, 0xd0, 0x30, 0xb0, 0x70, 0xf0,
-			    0x08, 0x88, 0x48, 0xc8, 0x28, 0xa8, 0x68, 0xe8,
-			    0x18, 0x98, 0x58, 0xd8, 0x38, 0xb8, 0x78, 0xf8,
-			    0x04, 0x84, 0x44, 0xc4, 0x24, 0xa4, 0x64, 0xe4,
-			    0x14, 0x94, 0x54, 0xd4, 0x34, 0xb4, 0x74, 0xf4,
-			    0x0c, 0x8c, 0x4c, 0xcc, 0x2c, 0xac, 0x6c, 0xec,
-			    0x1c, 0x9c, 0x5c, 0xdc, 0x3c, 0xbc, 0x7c, 0xfc,
-			    0x02, 0x82, 0x42, 0xc2, 0x22, 0xa2, 0x62, 0xe2,
-			    0x12, 0x92, 0x52, 0xd2, 0x32, 0xb2, 0x72, 0xf2,
-			    0x0a, 0x8a, 0x4a, 0xca, 0x2a, 0xaa, 0x6a, 0xea,
-			    0x1a, 0x9a, 0x5a, 0xda, 0x3a, 0xba, 0x7a, 0xfa,
-			    0x06, 0x86, 0x46, 0xc6, 0x26, 0xa6, 0x66, 0xe6,
-			    0x16, 0x96, 0x56, 0xd6, 0x36, 0xb6, 0x76, 0xf6,
-			    0x0e, 0x8e, 0x4e, 0xce, 0x2e, 0xae, 0x6e, 0xee,
-			    0x1e, 0x9e, 0x5e, 0xde, 0x3e, 0xbe, 0x7e, 0xfe,
-			    0x01, 0x81, 0x41, 0xc1, 0x21, 0xa1, 0x61, 0xe1,
-			    0x11, 0x91, 0x51, 0xd1, 0x31, 0xb1, 0x71, 0xf1,
-			    0x09, 0x89, 0x49, 0xc9, 0x29, 0xa9, 0x69, 0xe9,
-			    0x19, 0x99, 0x59, 0xd9, 0x39, 0xb9, 0x79, 0xf9,
-			    0x05, 0x85, 0x45, 0xc5, 0x25, 0xa5, 0x65, 0xe5,
-			    0x15, 0x95, 0x55, 0xd5, 0x35, 0xb5, 0x75, 0xf5,
-			    0x0d, 0x8d, 0x4d, 0xcd, 0x2d, 0xad, 0x6d, 0xed,
-			    0x1d, 0x9d, 0x5d, 0xdd, 0x3d, 0xbd, 0x7d, 0xfd,
-			    0x03, 0x83, 0x43, 0xc3, 0x23, 0xa3, 0x63, 0xe3,
-			    0x13, 0x93, 0x53, 0xd3, 0x33, 0xb3, 0x73, 0xf3,
-			    0x0b, 0x8b, 0x4b, 0xcb, 0x2b, 0xab, 0x6b, 0xeb,
-			    0x1b, 0x9b, 0x5b, 0xdb, 0x3b, 0xbb, 0x7b, 0xfb,
-			    0x07, 0x87, 0x47, 0xc7, 0x27, 0xa7, 0x67, 0xe7,
-			    0x17, 0x97, 0x57, 0xd7, 0x37, 0xb7, 0x77, 0xf7,
-			    0x0f, 0x8f, 0x4f, 0xcf, 0x2f, 0xaf, 0x6f, 0xef,
-			     0x1f, 0x9f, 0x5f, 0xdf, 0x3f, 0xbf, 0x7f, 0xff
-};
-
-static void _XReverse_Bytes
-ARGLIST((bpt, nb))
-ARG(register unsigned char *, bpt)
-GRA(register int, nb)
-{
-    do {
-	*bpt = _reverse_byte[*bpt];
-	bpt++;
-    } while (--nb > 0);
-}
-
-static void xpm_xynormalizeimagebits
-ARGLIST((bp,img))
-ARG(register unsigned char *, bp)
-GRA(register XImage *, img)
-{
-    register unsigned char c;
-
-    if (img->byte_order != img->bitmap_bit_order) {
-	switch (img->bitmap_unit) {
-
-	case 16:
-	    c = *bp;
-	    *bp = *(bp + 1);
-	    *(bp + 1) = c;
-	    break;
-
-	case 32:
-	    c = *(bp + 3);
-	    *(bp + 3) = *bp;
-	    *bp = c;
-	    c = *(bp + 2);
-	    *(bp + 2) = *(bp + 1);
-	    *(bp + 1) = c;
-	    break;
-	}
-    }
-    if (img->bitmap_bit_order == MSBFirst)
-	_XReverse_Bytes(bp, img->bitmap_unit >> 3);
-}
-
-static void xpm_znormalizeimagebits
-ARGLIST((bp,img))
-ARG(register unsigned char *, bp)
-GRA(register XImage *, img)
-{
-    register unsigned char c;
-
-    switch (img->bits_per_pixel) {
-
-    case 4:
-	*bp = ((*bp >> 4) & 0xF) | ((*bp << 4) & ~0xF);
-	break;
-
-    case 16:
-	c = *bp;
-	*bp = *(bp + 1);
-	*(bp + 1) = c;
-	break;
-
-    case 24:
-	c = *(bp + 2);
-	*(bp + 2) = *bp;
-	*bp = c;
-	break;
-
-    case 32:
-	c = *(bp + 3);
-	*(bp + 3) = *bp;
-	*bp = c;
-	c = *(bp + 2);
-	*(bp + 2) = *(bp + 1);
-	*(bp + 1) = c;
-	break;
-    }
-}
-
-static unsigned char Const _lomask[0x09] = {
-		     0x00, 0x01, 0x03, 0x07, 0x0f, 0x1f, 0x3f, 0x7f, 0xff};
-static unsigned char Const _himask[0x09] = {
-		     0xff, 0xfe, 0xfc, 0xf8, 0xf0, 0xe0, 0xc0, 0x80, 0x00};
-
-static void _putbits
-ARGLIST((src, dstoffset, numbits, dst))
-ARG(register char *, src)		/* address of source bit string */
-ARG(int, dstoffset)			/* bit offset into destination;
-					 * range is 0-31 */
-ARG(register int, numbits)		/* number of bits to copy to
-					 * destination */
-GRA(register char *, dst)		/* address of destination bit string */
-{
-    register unsigned char chlo, chhi;
-    int hibits;
-
-    dst = dst + (dstoffset >> 3);
-    dstoffset = dstoffset & 7;
-    hibits = 8 - dstoffset;
-    chlo = *dst & _lomask[dstoffset];
-    for (;;) {
-	chhi = (*src << dstoffset) & _himask[dstoffset];
-	if (numbits <= hibits) {
-	    chhi = chhi & _lomask[dstoffset + numbits];
-	    *dst = (*dst & _himask[dstoffset + numbits]) | chlo | chhi;
-	    break;
-	}
-	*dst = chhi | chlo;
-	dst++;
-	numbits = numbits - hibits;
-	chlo = (unsigned char) (*src & _himask[hibits]) >> hibits;
-	src++;
-	if (numbits <= dstoffset) {
-	    chlo = chlo & _lomask[numbits];
-	    *dst = (*dst & _himask[numbits]) | chlo;
-	    break;
-	}
-	numbits = numbits - dstoffset;
-    }
-}
-
-/*
- * Default method to write pixels into a Z image data structure.
- * The algorithm used is:
- *
- *	copy the destination bitmap_unit or Zpixel to temp
- *	normalize temp if needed
- *	copy the pixel bits into the temp
- *	renormalize temp if needed
- *	copy the temp back into the destination image data
- */
-
-static void SetImagePixels
-ARGLIST((image, width, height, pixelindex, pixels))
-ARG(XImage *, image)
-ARG(unsigned int, width)
-ARG(unsigned int, height)
-ARG(unsigned int *, pixelindex)
-GRA(Pixel *, pixels)
-{
-    Pixel pixel;
-    unsigned long px;
-    register char *src;
-    register char *dst;
-    int nbytes;
-    register unsigned int *iptr;
-    register int x, y, i;
-
-    iptr = pixelindex;
-    if (image->depth == 1) {
-	for (y = 0; y < height; y++)
-	    for (x = 0; x < width; x++, iptr++) {
-		pixel = pixels[*iptr];
-		for (i = 0, px = pixel;
-		     i < sizeof(unsigned long); i++, px >>= 8)
-		    ((unsigned char *) &pixel)[i] = (unsigned char)px;
-		src = &image->data[BXXYINDEX(x, y, image)];
-		dst = (char *) &px;
-		px = 0;
-		nbytes = image->bitmap_unit >> 3;
-		for (i = nbytes; --i >= 0;)
-		    *dst++ = *src++;
-		BXXYNORMALIZE(&px, image);
-		i = ((x + image->xoffset) % image->bitmap_unit);
-		_putbits((char *) &pixel, i, 1, (char *) &px);
-		BXXYNORMALIZE(&px, image);
-		src = (char *) &px;
-		dst = &image->data[BXXYINDEX(x, y, image)];
-		for (i = nbytes; --i >= 0;)
-		    *dst++ = *src++;
-	    }
-    } else {
-	for (y = 0; y < height; y++)
-	    for (x = 0; x < width; x++, iptr++) {
-		pixel = pixels[*iptr];
-		if (image->depth == 4)
-		    pixel &= 0xf;
-		for (i = 0, px = pixel;
-		     i < sizeof(unsigned long); i++, px >>= 8)
-		    ((unsigned char *) &pixel)[i] = (unsigned char)px;
-		src = &image->data[BXZINDEX(x, y, image)];
-		dst = (char *) &px;
-		px = 0;
-		nbytes = (image->bits_per_pixel + 7) >> 3;
-		for (i = nbytes; --i >= 0;)
-		    *dst++ = *src++;
-		BXZNORMALIZE(&px, image);
-		_putbits((char *) &pixel,
-			 (x * image->bits_per_pixel) & 7,
-			 image->bits_per_pixel, (char *) &px);
-		BXZNORMALIZE(&px, image);
-		src = (char *) &px;
-		dst = &image->data[BXZINDEX(x, y, image)];
-		for (i = nbytes; --i >= 0;)
-		    *dst++ = *src++;
-	    }
-    }
-}
-
-/*
- * write pixels into a 32-bits Z image data structure
- */
-
-#ifndef WORD64
-static unsigned long byteorderpixel = MSBFirst << 24;
-
-#endif
-
-static void SetImagePixels32
-ARGLIST((image, width, height, pixelindex, pixels))
-ARG(XImage *, image)
-ARG(unsigned int, width)
-ARG(unsigned int, height)
-ARG(unsigned int *, pixelindex)
-GRA(Pixel *, pixels)
-{
-    register unsigned char *addr;
-    register unsigned int *paddr;
-    register unsigned int *iptr;
-    register int x, y;
-
-    iptr = pixelindex;
-#ifndef WORD64
-    if (*((char *) &byteorderpixel) == image->byte_order) {
-	for (y = 0; y < height; y++)
-	    for (x = 0; x < width; x++, iptr++) {
-		paddr =
-		    (unsigned int *)(&(image->data[BXZINDEX32(x, y, image)]));
-		*paddr = (unsigned int)pixels[*iptr];
-	    }
-    } else
-#endif
-    if (image->byte_order == MSBFirst)
-	for (y = 0; y < height; y++)
-	    for (x = 0; x < width; x++, iptr++) {
-		addr = &((unsigned char *) image->data)[BXZINDEX32(x, y, image)];
-		addr[0] = (unsigned char)(pixels[*iptr] >> 24);
-		addr[1] = (unsigned char)(pixels[*iptr] >> 16);
-		addr[2] = (unsigned char)(pixels[*iptr] >> 8);
-		addr[3] = (unsigned char)(pixels[*iptr]);
-	    }
-    else
-	for (y = 0; y < height; y++)
-	    for (x = 0; x < width; x++, iptr++) {
-		addr = &((unsigned char *) image->data)[BXZINDEX32(x, y, image)];
-		addr[3] = (unsigned char)(pixels[*iptr] >> 24);
-		addr[2] = (unsigned char)(pixels[*iptr] >> 16);
-		addr[1] = (unsigned char)(pixels[*iptr] >> 8);
-		addr[0] = (unsigned char)(pixels[*iptr]);
-	    }
-}
-
-/*
- * write pixels into a 16-bits Z image data structure
- */
-
-static void SetImagePixels16
-ARGLIST((image, width, height, pixelindex, pixels))
-ARG(XImage *, image)
-ARG(unsigned int, width)
-ARG(unsigned int, height)
-ARG(unsigned int *, pixelindex)
-GRA(Pixel *, pixels)
-{
-    register unsigned char *addr;
-    register unsigned int *iptr;
-    register int x, y;
-
-    iptr = pixelindex;
-    if (image->byte_order == MSBFirst)
-	for (y = 0; y < height; y++)
-	    for (x = 0; x < width; x++, iptr++) {
-		addr = &((unsigned char *) image->data)[BXZINDEX16(x, y, image)];
-		addr[0] = (unsigned char)(pixels[*iptr] >> 8);
-		addr[1] = (unsigned char)(pixels[*iptr]);
-	    }
-    else
-	for (y = 0; y < height; y++)
-	    for (x = 0; x < width; x++, iptr++) {
-		addr = &((unsigned char *) image->data)[BXZINDEX16(x, y, image)];
-		addr[1] = (unsigned char)(pixels[*iptr] >> 8);
-		addr[0] = (unsigned char)(pixels[*iptr]);
-	    }
-}
-
-/*
- * write pixels into a 8-bits Z image data structure
- */
-
-static void SetImagePixels8
-ARGLIST((image, width, height, pixelindex, pixels))
-ARG(XImage *, image)
-ARG(unsigned int, width)
-ARG(unsigned int, height)
-ARG(unsigned int *, pixelindex)
-GRA(Pixel *, pixels)
-
-{
-    register unsigned int *iptr;
-    register int x, y;
-
-    iptr = pixelindex;
-    for (y = 0; y < height; y++)
-	for (x = 0; x < width; x++, iptr++)
-	    image->data[BXZINDEX8(x, y, image)] = (char)pixels[*iptr];
-}
-
-/*
- * write pixels into a 1-bit depth image data structure and **offset null**
- */
-
-static void SetImagePixels1
-ARGLIST((image, width, height, pixelindex, pixels))
-ARG(XImage *, image)
-ARG(unsigned int, width)
-ARG(unsigned int, height)
-ARG(unsigned int *, pixelindex)
-GRA(Pixel *, pixels)
-{
-    unsigned char bit;
-    int xoff, yoff;
-    register unsigned int *iptr;
-    register int x, y;
-
-    if (image->byte_order != image->bitmap_bit_order)
-	SetImagePixels(image, width, height, pixelindex, pixels);
-    else {
-	iptr = pixelindex;
-	if (image->bitmap_bit_order == MSBFirst)
-	    for (y = 0; y < height; y++)
-		for (x = 0; x < width; x++, iptr++) {
-		    yoff = BXZINDEX1(x, y, image);
-		    xoff = x & 7;
-		    bit = 0x80 >> xoff;
-		    if (pixels[*iptr] & 1)
-			image->data[yoff] |= bit;
-		    else
-			image->data[yoff] &= ~bit;
-		}
-	else
-	    for (y = 0; y < height; y++)
-		for (x = 0; x < width; x++, iptr++) {
-		    yoff = BXZINDEX1(x, y, image);
-		    xoff = x & 7;
-		    bit = 1 << xoff;
-		    if (pixels[*iptr] & 1)
-			image->data[yoff] |= bit;
-		    else
-			image->data[yoff] &= ~bit;
-		}
-    }
-}
-
-/*
- * Store into the BxXpmAttributes structure the required informations stored in
- * the bxxpmInternAttrib structure.
- */
-
-static void xpmSetAttributes
-ARGLIST((attrib, attributes))
-ARG(bxxpmInternAttrib *, attrib)
-GRA(BxXpmAttributes *, attributes)
-{
-    if (attributes) {
-        if (attributes->valuemask & BxXpmReturnInfos) {
-            attributes->cpp = attrib->cpp;
-            attributes->ncolors = attrib->ncolors;
-            attributes->colorTable = attrib->colorTable;
-
-            attrib->ncolors = 0;
-            attrib->colorTable = NULL;
-        }
-        attributes->width = attrib->width;
-        attributes->height = attrib->height;
-        attributes->valuemask |= BxXpmSize;
-    }
-}
-
-/*
- * Free the BxXpmAttributes structure members
- * but the structure itself
- */
-
-static void BxXpmFreeAttributes
-ARGLIST((attributes))
-GRA(BxXpmAttributes *, attributes)
-{
-    if (attributes) {
-        if (attributes->valuemask & BxXpmReturnPixels && attributes->pixels) {
-            free((char *)attributes->pixels);
-            attributes->pixels = NULL;
-            attributes->npixels = 0;
-        }
-        if (attributes->valuemask & BxXpmInfos) {
-            if (attributes->colorTable) {
-                xpmFreeColorTable(attributes->colorTable, attributes->ncolors);
-                attributes->colorTable = NULL;
-                attributes->ncolors = 0;
-            }
-            if (attributes->hints_cmt) {
-                free(attributes->hints_cmt);
-                attributes->hints_cmt = NULL;
-            }
-            if (attributes->colors_cmt) {
-                free(attributes->colors_cmt);
-                attributes->colors_cmt = NULL;
-            }
-            if (attributes->pixels_cmt) {
-                free(attributes->pixels_cmt);
-                attributes->pixels_cmt = NULL;
-            }
-            if (attributes->pixels) {
-                free((char *)attributes->pixels);
-                attributes->pixels = NULL;
-            }
-        }
-        attributes->valuemask = 0;
-    }
-}
-
-/*
- * Free the bxxpmInternAttrib pointers which have been allocated
- */
-
-static void xpmFreeInternAttrib
-ARGLIST((attrib))
-GRA(bxxpmInternAttrib *, attrib)
-{
-    unsigned int a;
-
-    if (attrib->colorTable)
-        xpmFreeColorTable(attrib->colorTable, attrib->ncolors);
-    if (attrib->pixelindex)
-        free((char *)attrib->pixelindex);
-    if (attrib->xcolors)
-        free((char *)attrib->xcolors);
-    if (attrib->colorStrings) {
-        for (a = 0; a < attrib->ncolors; a++)
-            if (attrib->colorStrings[a])
-                free((char *)attrib->colorStrings[a]);
-        free((char *)attrib->colorStrings);
-    }
-}
-
-/*
- * close the file related to the bxxpmData if any
- */
-static void XpmDataClose
-ARGLIST((mdata))
-GRA(bxxpmData *, mdata)
-{
-    switch (mdata->type) {
-    case BXXPMARRAY:
-        break;
-    case BXXPMFILE:
-        if (mdata->stream.file != (stdout) && mdata->stream.file != (stdin))
-            fclose(mdata->stream.file);
-        break;
-#ifdef ZPIPE
-    case BXXPMPIPE:
-        pclose(mdata->stream.file);
-#endif
-    }
-}
-
-/*
- * skip whitespace and compute the following unsigned int,
- * returns 1 if one is found and 0 if not
- */
-static int xpmNextUI
-ARGLIST((mdata, ui_return))
-ARG(bxxpmData *, mdata)
-GRA(unsigned int *, ui_return)
-{
-    char buf[BUFSIZ];
-    int l;
-
-    l = xpmNextWord(mdata, buf);
-    return atoui(buf, l, ui_return);
-}
-
-/*
- * get the current comment line
- */
-static void xpmGetCmt
-ARGLIST((mdata, cmt))
-ARG(bxxpmData *, mdata)
-GRA(char **, cmt)
-{
-    switch (mdata->type) {
-    case BXXPMARRAY:
-        *cmt = NULL;
-        break;
-    case BXXPMFILE:
-    case BXXPMPIPE:
-        if (mdata->CommentLength) {
-            *cmt = (char *) malloc(mdata->CommentLength + 1);
-            strncpy(*cmt, mdata->Comment, mdata->CommentLength);
-            (*cmt)[mdata->CommentLength] = '\0';
-            mdata->CommentLength = 0;
-        } else
-            *cmt = NULL;
-        break;
-    }
-}
-
-/*
- * skip to the end of the current string and the beginning of the next one
- */
-static void xpmNextString
-ARGLIST((mdata))
-GRA(bxxpmData *, mdata)
-{
-    int c;
-
-    switch (mdata->type) {
-    case BXXPMARRAY:
-        mdata->cptr = (mdata->stream.data)[++mdata->line];
-        break;
-    case BXXPMFILE:
-    case BXXPMPIPE:
-        if (mdata->Eos)
-            while ((c = xpmGetC(mdata)) != mdata->Eos && c != EOF);
-        if (mdata->Bos)                 /* if not natural XPM2 */
-            while ((c = xpmGetC(mdata)) != mdata->Bos && c != EOF);
-        break;
-    }
-}
-
-/*
- * return the current character, skipping comments
- */
-static int xpmGetC
-ARGLIST((mdata))
-GRA(bxxpmData *, mdata)
-{
-    int c;
-    register unsigned int n = 0, a;
-    unsigned int notend;
-
-    switch (mdata->type) {
-    case BXXPMARRAY:
-        return (*mdata->cptr++);
-    case BXXPMFILE:
-    case BXXPMPIPE:
-        c = getc(mdata->stream.file);
-
-        if (mdata->Bos && mdata->Eos
-            && (c == mdata->Bos || c == mdata->Eos)) {
-            /* if not natural XPM2 */
-            mdata->InsideString = !mdata->InsideString;
-            return (c);
-        }
-        if (!mdata->InsideString && mdata->Bcmt && c == mdata->Bcmt[0]) {
-            mdata->Comment[0] = c;
-
-            /*
-             * skip the string begining comment
-             */
-            do {
-                c = getc(mdata->stream.file);
-                mdata->Comment[++n] = c;
-            } while (c == mdata->Bcmt[n] && mdata->Bcmt[n] != '\0'
-                     && c != EOF);
-
-            if (mdata->Bcmt[n] != '\0') {
-                /* this wasn't the begining of a comment */
-                /* put characters back in the order that we got them */
-                for (a = n; a > 0; a--)
-                    xpmUngetC(mdata->Comment[a], mdata);
-                return (mdata->Comment[0]);
-            }
-
-            /*
-             * store comment
-             */
-            mdata->Comment[0] = mdata->Comment[n];
-            notend = 1;
-            n = 0;
-            while (notend) {
-                while (mdata->Comment[n] != mdata->Ecmt[0] && c != EOF) {
-                    c = getc(mdata->stream.file);
-                    mdata->Comment[++n] = c;
-                }
-                mdata->CommentLength = n;
-                a = 0;
-                do {
-                    c = getc(mdata->stream.file);
-                    n++;
-                    a++;
-                    mdata->Comment[n] = c;
-                } while (c == mdata->Ecmt[a] && mdata->Ecmt[a] != '\0'
-                         && c != EOF);
-                if (mdata->Ecmt[a] == '\0') {
-                    /* this is the end of the comment */
-                    notend = 0;
-                    xpmUngetC(mdata->Comment[n], mdata);
-                }
-            }
-            c = xpmGetC(mdata);
-        }
-        return (c);
-    }
-    return('\0');
-}
-
-
-/*
- * push the given character back
- */
-static int xpmUngetC
-ARGLIST((c, mdata))
-ARG(int, c)
-GRA(bxxpmData *, mdata)
-{
-    switch (mdata->type) {
-    case BXXPMARRAY:
-        return (*--mdata->cptr = c);
-    case BXXPMFILE:
-    case BXXPMPIPE:
-        if (mdata->Bos && (c == mdata->Bos || c == mdata->Eos))
-            /* if not natural XPM2 */
-            mdata->InsideString = !mdata->InsideString;
-        return (ungetc(c, mdata->stream.file));
-    }
-    return('\0');
-}
-
-/*
- * skip whitespace and return the following word
- */
-static unsigned int xpmNextWord
-ARGLIST((mdata, buf))
-ARG(bxxpmData *, mdata)
-GRA(char *, buf)
-{
-    register unsigned int n = 0;
-    int c;
-
-    switch (mdata->type) {
-    case BXXPMARRAY:
-    	c = *mdata->cptr;
-        while (isspace(c) && c != mdata->Eos)
-            {
-	    mdata->cptr++;
-    	    c = *mdata->cptr;
-	    }
-        do {
-            c = *mdata->cptr++;
-            buf[n++] = c;
-        } while (!isspace(c) && c != mdata->Eos && c != '\0');
-        n--;
-        mdata->cptr--;
-        break;
-    case BXXPMFILE:
-    case BXXPMPIPE:
-        c = xpmGetC(mdata);
-        while (isspace(c) && c != mdata->Eos)
-	    c = xpmGetC(mdata);
-        while (!isspace(c) && c != mdata->Eos && c != EOF) {
-            buf[n++] = c;
-            c = xpmGetC(mdata);
-        }
-        xpmUngetC(c, mdata);
-        break;
-    }
-    return (n);
-}
-
-static int BxXpmVisualType
-ARGLIST((visual))
-GRA(Visual *, visual)
-{
-#if defined(__cplusplus) || defined(c_plusplus)
-    switch ( visual->c_class )
-#else
-    switch ( visual->class )
-#endif
-    {
-    case StaticGray:
-    case GrayScale:
-	switch (visual->map_entries)
-	{
-	case 2:
-	    return (BXMONO);
-	case 4:
-	    return (BXGRAY4);
-	default:
-	    return (BXGRAY);
-	}
-    default:
-	return (BXCOLOR);
-    }
-}
-
-/*
- * Free the computed color table
- */
-
-static void xpmFreeColorTable
-ARGLIST((colorTable, ncolors))
-ARG(char ***, colorTable)
-GRA(int, ncolors)
-{
-    int a, b;
-
-    if (colorTable) {
-        for (a = 0; a < ncolors; a++)
-            if (colorTable[a]) {
-                for (b = 0; b < (BXNKEYS + 1); b++)
-                    if (colorTable[a][b])
-                        free(colorTable[a][b]);
-                free((char *)colorTable[a]);
-            }
-        free((char *)colorTable);
-    }
-}
-
-#else /* USE_XPM_LIBRARY */
-
-#include <xpm.h>
-
-#define BxXpmColorError    		XpmColorError
-#define BxXpmSuccess       		XpmSuccess
-#define BxXpmOpenFailed    		XpmOpenFailed
-#define BxXpmFileInvalid   		XpmFileInvalid
-#define BxXpmNoMemory      		XpmNoMemory
-#define BxXpmColorFailed   		XpmColorFailed
-
-#define BxXpmVisual        		XpmVisual
-#define BxXpmColormap      		XpmColormap
-#define BxXpmDepth         		XpmDepth
-#define BxXpmSize          		XpmSize
-#define BxXpmHotspot       		XpmHotspot
-#define BxXpmCharsPerPixel 		XpmCharsPerPixel
-#define BxXpmColorSymbols  		XpmColorSymbols
-#define BxXpmRgbFilename   		XpmRgbFilename
-#define BxXpmInfos         		XpmInfos
-
-#define BxXpmReturnPixels  		XpmReturnPixels
-#define BxXpmReturnInfos   		XpmReturnInfos
-
-#define BxXpmCreatePixmapFromData	XpmCreatePixmapFromData
-#define BxXpmCreateImageFromData	XpmCreateImageFromData
-#define BxXpmFreeAttributes		XpmFreeAttributes
-
-typedef XpmAttributes      		BxXpmAttributes;
-
-#endif /* USE_XPM_LIBRARY */
-
-Pixmap XPM_PIXMAP
-ARGLIST((w, pixmapName))
-ARG(Widget, w)
-GRA(char **, pixmapName)
-{
-    BxXpmAttributes	attributes;
-    int			argcnt;
-    Arg			args[10];
-    Pixmap		pixmap;
-    Pixmap		shape;
-    int			returnValue;
-
-    argcnt = 0;
-    XtSetArg(args[argcnt], XmNdepth, &(attributes.depth)); argcnt++;
-    XtSetArg(args[argcnt], XmNcolormap, &(attributes.colormap)); argcnt++;
-    XtGetValues(w, args, argcnt);
-
-    attributes.visual = DefaultVisual(XtDisplay(w),
-				      DefaultScreen(XtDisplay(w)));
-    attributes.valuemask = (BxXpmDepth | BxXpmColormap | BxXpmVisual);
-
-    returnValue = BxXpmCreatePixmapFromData(XtDisplay(w),
-					  DefaultRootWindow(XtDisplay(w)),
-					  pixmapName, &pixmap, &shape,
-					  &attributes);
-    if ( shape )
-    {
-	XFreePixmap(XtDisplay(w), shape);
-    }
-
-    switch(returnValue)
-    {
-    case BxXpmOpenFailed:
-    case BxXpmFileInvalid:
-    case BxXpmNoMemory:
-    case BxXpmColorFailed:
-	XtWarning("Could not create pixmap.");
-	return(XmUNSPECIFIED_PIXMAP);
-    default:
-	return(pixmap);
-    }
-}
-
-#endif
-
-/* This structure is for capturing app-defaults values for a Class */
-
-typedef struct _UIAppDefault
-{
-    char*		cName;		/* Class name */
-    char*		wName; 		/* Widget name */
-    char*		cInstName;	/* Name of class instance(nested) */
-    char*		wRsc;		/* Widget resource */
-    char*		value;		/* value read from app-defaults */
-} UIAppDefault;
-
-
-void setDefaultResources ARGLIST((_name, w, resourceSpec))
-ARG(char*, _name)
-ARG(Widget, w)
-GRA(String *,resourceSpec)
-{
-   int         i;
-   Display    *dpy = XtDisplay ( w );	  /* Retrieve the display pointer */
-   XrmDatabase rdb = NULL;             /* A resource data base */
-
-   /* Create an empty resource database */
-
-   rdb = XrmGetStringDatabase ( "" );
-
-   /* Add the Component resources, prepending the name of the component */
-
-   i = 0;
-   while ( resourceSpec[i] != NULL )
-   {
-       char buf[1000];
-
-       sprintf(buf, "*%s%s", _name, resourceSpec[i++]);
-       XrmPutLineResource( &rdb, buf );
-   }
-
-   /* Merge them into the Xt database, with lowest precendence */
-
-   if ( rdb )
-   {
-#if (XlibSpecificationRelease>=5)
-        XrmDatabase db = XtDatabase(dpy);
-	XrmCombineDatabase(rdb, &db, FALSE);
-#else
-        XrmMergeDatabases ( dpy->db, &rdb );
-        dpy->db = rdb;
-#endif
-    }
-}
-
-/*
- * This method gets all the resources from the app-defaults file
- * (resource databse) and fills in the table (defs) if the app default
- * value exists.
- */
-void
-InitAppDefaults ARGLIST((parent, defs))
-ARG(Widget, parent)
-GRA(UIAppDefault *, defs)
-{
-    XrmQuark		cQuark;
-    XrmQuark		rsc[10];
-    XrmRepresentation	rep;
-    XrmValue		val;
-    XrmDatabase		rdb;
-    int			rscIdx;
-
-    /* Get the database */
-
-#if (XlibSpecificationRelease >= 5)
-    if ((rdb = XrmGetDatabase(XtDisplay(parent))) == NULL)
-    {
-	return;			/*  Can't get the database */
-    }
-#else
-    Display *dpy = XtDisplay(parent);
-    if ((rdb = dpy->db) == NULL)
-    {
-	return;
-    }
-#endif
-
-    /* Look for each resource in the table */
-
-    while (defs->wName)
-    {
-	rscIdx = 0;
-
-	cQuark = XrmStringToQuark(defs->cName);	/* class quark */
-	rsc[rscIdx++] = cQuark;
-	if (defs->wName[0] == '\0')
-	{
-	    rsc[rscIdx++] = cQuark;
-	}
-	else
-	{
-	    if( strchr(defs->wName, '.') == NULL )
-	    {
-		rsc[rscIdx++] = XrmStringToQuark(defs->wName);
-	    }
-	    else
-	    {
-		/*
-		 * If we found a '.' that means that this is not
-		 * a simple widget name, but a sub specification so
-		 * we need to split this into several quarks.
-		 */
-		char *copy = XtNewString(defs->wName), *ptr;
-
-		for( ptr = strtok(copy, "."); ptr != NULL;
-		     ptr = strtok(NULL, ".") )
-		{
-		    rsc[rscIdx++] = XrmStringToQuark(ptr);
-		}
-		XtFree(copy);
-	    }
-	}
-
-	if (defs->cInstName && defs->cInstName[0] != '\0')
-	{
-	    rsc[rscIdx++] = XrmStringToQuark(defs->cInstName);
-	}
-
-	rsc[rscIdx++] = XrmStringToQuark(defs->wRsc);
-	rsc[rscIdx++] = NULLQUARK;
-
-	if (XrmQGetResource(rdb, rsc, rsc, &rep, &val))
-	{
-	    defs->value = XtNewString((char*)val.addr);
-	}
-	defs++;
-    }
-}
-
-/*
- * This method applies the app defaults for the class to a specific
- * instance. All the widgets in the path are loosly coupled (use *).
- * To override a specific instance, use a tightly coupled app defaults
- * resource line (use .).
- */
-void
-SetAppDefaults ARGLIST((w, defs, inst_name, override_inst))
-ARG(Widget,w)
-ARG(UIAppDefault*, defs)
-ARG(char*, inst_name)
-GRA(Boolean, override_inst)
-{
-   Display*		dpy = XtDisplay ( w );	/*  Retrieve the display */
-   XrmDatabase		rdb = NULL;		/* A resource data base */
-   char			lineage[1000];
-   char			buf[1000];
-   Widget       	parent;
-
-   /* Protect ourselves */
-
-   if (inst_name == NULL) return;
-
-   /*  Create an empty resource database */
-
-   rdb = XrmGetStringDatabase ( "" );
-
-   /* Start the lineage with our name and then get our parents */
-
-   lineage[0] = '\0';
-   parent = w;
-
-   while (parent)
-   {
-       WidgetClass wclass = XtClass(parent);
-
-       if (wclass == applicationShellWidgetClass) break;
-
-       strcpy(buf, lineage);
-       sprintf(lineage, "*%s%s", XtName(parent), buf);
-
-       parent = XtParent(parent);
-   }
-
-   /*  Add the Component resources, prepending the name of the component */
-   while (defs->wName != NULL)
-   {
-       int name_length;
-       /*
-        * We don't deal with the resource if it isn't found in the
-	* Xrm database at class initializtion time (in initAppDefaults).
-	* Special handling of class instances.
-	*/
-       if (strchr(defs->wName, '.'))
-       {
-	   name_length = strlen(defs->wName) -
-		strlen(strchr(defs->wName, '.'));
-       }
-       else
-       {
-	   name_length = strlen(defs->wName) > strlen(inst_name) ?
-	       strlen(defs->wName) : strlen(inst_name);
-       }
-       if (defs->value == NULL ||
-	   (override_inst && strncmp(inst_name, defs->wName, name_length)) ||
-	   (! override_inst && defs->cInstName != NULL))
-       {
-	   defs++;
-	   continue;
-       }
-
-       /* Build up string after lineage */
-       if (defs->cInstName != NULL)
-       {
-	   /* Don't include class instance name if it is also the instance */
-	   /* being affected.  */
-
-	   if (*defs->cInstName != '\0')
-	   {
-	       sprintf(buf, "%s*%s*%s.%s: %s",
-		       lineage, defs->wName, defs->cInstName,
-			defs->wRsc, defs->value);
-	   }
-	   else
-	   {
-	       sprintf(buf, "%s*%s.%s: %s",
-		       lineage, defs->wName, defs->wRsc,
-			defs->value);
-	   }
-       }
-       else if (*defs->wName != '\0')
-       {
-	   sprintf(buf, "%s*%s*%s.%s: %s",
-		   lineage, inst_name, defs->wName, defs->wRsc, defs->value);
-       }
-       else
-       {
-	   sprintf(buf, "%s*%s.%s: %s",
-		   lineage, inst_name,defs->wRsc, defs->value);
-       }
-
-       XrmPutLineResource( &rdb, buf );
-       defs++;
-   }
-
-   /* Merge them into the Xt database, with lowest precendence */
-   if ( rdb )
-   {
-#if (XlibSpecificationRelease >= 5)
-        XrmDatabase db = XtDatabase(dpy);
-	XrmCombineDatabase(rdb, &db, FALSE);
-#else
-        XrmMergeDatabases ( dpy->db, &rdb );
-        dpy->db = rdb;
-#endif
-    }
-}
diff --git a/src/mbvelocitytool/mbvelocity_callbacks.c b/src/mbvelocitytool/mbvelocity_callbacks.c
deleted file mode 100644
index 22662aa..0000000
--- a/src/mbvelocitytool/mbvelocity_callbacks.c
+++ /dev/null
@@ -1,1456 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbvelocity_callbacks.c	4/7/97
- *    $Id: mbvelocity_callbacks.c 2252 2015-07-01 19:35:37Z caress $
- *
- *    Copyright (c) 1993-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * MBVELOCITYTOOL is an interactive water velocity profile editor
- * used to examine multiple water velocity profiles and to create
- * new water velocity profiles which can be used for the processing
- * of swath sonar data.  In general, this tool is used to examine
- * water velocity profiles obtained from XBTs, CTDs, or databases,
- * and to construct new profiles consistent with these various
- * sources of information.
- *
- * Author:	D. W. Caress
- * Date:	April 8, 1993
- * Date:	April 7, 1997  GUI recast
- *
- */
-/*
- * README: This file is appended to at file generation time.
- * Edits can be made throughout the file
- */
-/*
- * Generated by the ICS Builder Xcessory (BX).
- *
- * Builder Xcessory 4.0
- * Code Generator Xcessory 2.0 (09/09/96)
- *
- */
-#include <Xm/Xm.h>
-
-
-/*
- * Standard includes for builtins.
- */
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-
-/* X11 includes */
-#include <X11/cursorfont.h>
-#include <X11/Xlib.h>
-#include <X11/Xutil.h>
-#include <X11/Intrinsic.h>
-#include <X11/keysym.h>
-#include <X11/keysymdef.h>
-#include <Xm/FileSB.h>
-#include <Xm/Text.h>
-#include <Xm/TextF.h>
-#include <Xm/ToggleB.h>
-
-/* mbedit widget includes */
-#include "mbvelocity_creation.h"
-#include "mb_define.h"
-#include "mb_status.h"
-#include "mb_xgraphics.h"
-#include "mbvelocity.h"
-
-/*
- * Macros to make code look nicer between ANSI and K&R.
- */
-#ifndef ARGLIST
-#if (NeedFunctionPrototypes == 0)
-#define PROTOTYPE(p)	()
-#define ARGLIST(p)	p
-#define ARG(a, b)	a b;
-#define GRA(a, b)	a b;
-#define UARG(a, b)      a b;
-#define GRAU(a, b)      a b;
-#else
-#define PROTOTYPE(p)	p
-#define ARGLIST(p)	(
-#define ARG(a, b)	a b,
-#define GRA(a, b)	a b)
-#ifdef __cplusplus
-#define UARG(a, b)      a,
-#define GRAU(a, b)      a)
-#else
-#define UARG(a, b)      a b,
-#define GRAU(a, b)      a b)
-#endif
-#endif
-#endif
-
-#ifndef FIXED
-#define FIXED "fixed"
-#endif
-
-Widget		BxFindTopShell PROTOTYPE((Widget));
-WidgetList	BxWidgetIdsFromNames PROTOTYPE((Widget, char*, char*));
-
-
-/*--------------------------------------------------------------------*/
-
-/* id variables */
-static char svn_id[] = "$Id: mbvelocity_callbacks.c 2252 2015-07-01 19:35:37Z caress $";
-static char program_name[] = "MBvelocitytool";
-
-/* additional widgets */
-Widget	fileSelectionList;
-Widget	fileSelectionText;
-
-/* global defines and variables */
-#define EV_MASK (ButtonPressMask | KeyPressMask | KeyReleaseMask | ExposureMask )
-#define xgfont "-*-"FIXED"-bold-r-normal-*-13-*-75-75-c-70-iso8859-1"
-
-XtAppContext	app_context;
-Display		*display;
-Window		can_xid, root_return, child_return;
-Colormap	colormap;
-GC		gc;
-XGCValues	xgcv;
-XFontStruct	*fontStruct;
-
-int	status;
-
-static mb_path message_str;
-static mb_path	input_file;
-int selected = 0; /* indicates an input file is selected */
-
-void	*can_xgid;		/* XG graphics id */
-Cursor myCursor;
-XColor closest[2];
-XColor exact[2];
-
-/* Set the colors used for this program here. */
-#define NCOLORS 7
-XColor colors[NCOLORS];
-unsigned int mpixel_values[NCOLORS];
-XColor db_color;
-
-/* Global mbvelocitytool definitions */
-int	expose_plot_ok = False;
-int	edit_gui;
-int	ndisplay_gui;
-double	maxdepth_gui;
-double	velrange_gui;
-double	velcenter_gui;
-double	resrange_gui;
-int	format_gui;
-int	anglemode_gui;
-int	nload;
-
-/* file opening parameters */
-#define	MBVT_IO_NONE			0
-#define	MBVT_IO_OPEN_DISPLAY_SVP	1
-#define	MBVT_IO_OPEN_EDIT_SVP		2
-#define	MBVT_IO_SAVE_EDIT_SVP		3
-#define	MBVT_IO_OPEN_MB			4
-int	open_type = MBVT_IO_NONE;
-
-/* Set these to the dimensions of your canvas drawing */
-/* area, minus 1, located in mbvelocity.uil.              */
-static int borders[4] =
-	{ 0, 1019, 0, 550 };
-
-void	do_fileselection_list();
-void	set_label_string(Widget, String);
-void	set_label_multiline_string(Widget, String);
-void	get_text_string(Widget, String);
-void	do_set_controls();
-
-/*--------------------------------------------------------------------*/
-
-/*      Function Name: 	BxManageCB
- *
- *      Description:   	Given a string of the form:
- *		       	"(WL)[widgetName, widgetName, ...]"
- *			BxManageCB attempts to convert the name to a Widget
- *			ID and manage the widget.
- *
- *      Arguments:     	Widget	    w:      the widget activating the callback.
- *		       	XtPointer   client: the list of widget names to attempt
- *					    to find and manage.
- *		       	XtPointer   call:   the call data (unused).
- *
- *      Notes:        *	This function expects that there is an application
- *		       	shell from which all other widgets are descended.
- */
-
-/* ARGSUSED */
-void
-BxManageCB ARGLIST((w, client, call))
-ARG( Widget, w)
-ARG( XtPointer, client)
-GRAU( XtPointer, call)
-{
-    WidgetList		widgets;
-    int			i;
-
-    /*
-     * This function returns a NULL terminated WidgetList.  The memory for
-     * the list needs to be freed when it is no longer needed.
-     */
-    widgets = BxWidgetIdsFromNames(w, "BxManageCB", (String)client);
-
-    i = 0;
-    while( widgets && widgets[i] != NULL )
-    {
-	XtManageChild(widgets[i]);
-	i++;
-    }
-    XtFree((char *)widgets);
-}
-
-/*--------------------------------------------------------------------*/
-
-/*      Function Name: 	BxUnmanageCB
- *
- *      Description:   	Given a string of the form:
- *		       	"(WL)[widgetName, widgetName, ...]"
- *			BxUnmanageCB attempts to convert the name to a Widget
- *			ID and unmanage the widget.
- *
- *      Arguments:     	Widget	    w:      the widget activating the callback.
- *		       	XtPointer   client: the list of widget names to attempt
- *					    to find and unmanage.
- *		       	XtPointer   call:   the call data (unused).
- *
- *      Notes:        *	This function expects that there is an application
- *		       	shell from which all other widgets are descended.
- */
-
-/* ARGSUSED */
-void
-BxUnmanageCB ARGLIST((w, client, call))
-ARG( Widget, w)
-ARG( XtPointer, client)
-GRAU( XtPointer, call)
-{
-    WidgetList		widgets;
-    int			i;
-
-    /*
-     * This function returns a NULL terminated WidgetList.  The memory for
-     * the list needs to be freed when it is no longer needed.
-     */
-    widgets = BxWidgetIdsFromNames(w, "BxUnmanageCB", (String)client);
-
-    i = 0;
-    while( widgets && widgets[i] != NULL )
-    {
-	XtUnmanageChild(widgets[i]);
-	i++;
-    }
-    XtFree((char *)widgets);
-}
-
-/*--------------------------------------------------------------------*/
-
-/*      Function Name:	BxSetValuesCB
- *
- *      Description:   	This function accepts a string of the form:
- *			"widgetName.resourceName = value\n..."
- *			It then attempts to convert the widget name to a widget
- *			ID and the value to a valid resource value.  It then
- *			sets the value on the given widget.
- *
- *      Arguments:      Widget		w:	the activating widget.
- *			XtPointer	client:	the set values string.
- *			XtPointer	call:	the call data (unused).
- *
- *      Notes:        * This function expects that there is an application
- *                      shell from which all other widgets are descended.
- */
-#include <X11/StringDefs.h>
-
-/* ARGSUSED */
-void
-BxSetValuesCB ARGLIST((w, client, call))
-ARG( Widget, w)
-ARG( XtPointer, client)
-GRAU( XtPointer, call)
-{
-#define CHUNK	512
-
-    Boolean 	first = True;
-    String 	rscs = XtNewString((String)client);
-    String 	*valueList = (String *)XtCalloc(CHUNK, sizeof(String));
-    char 	*start;
-    char 	*ptr, *cptr;
-    String 	name;
-    String 	rsc;
-    int 	i, count = 0;
-    Widget 	*current;
-
-    for ( start = rscs; rscs && *rscs; rscs = strtok(NULL, "\n"))
-    {
-        if ( first )
-        {
-            rscs = strtok(rscs, "\n");
-            first = False;
-        }
-        valueList[count] = XtNewString(rscs);
-        count++;
-        if ( count == CHUNK )
-        {
-            valueList =
-		(String *)XtRealloc((char *)valueList,
-				    (count + CHUNK) * sizeof(String));
-        }
-    }
-    XtFree((char *)start);
-
-    for ( i = 0; i < count; i++ )
-    {
-	/*
-	 * First, extract the widget name and generate a string to
-	 * pass to BxWidgetIdsFromNames().
-	 */
-	cptr = strrchr(valueList[i], '.');
-	if ( cptr != NULL )
-	{
-	    *cptr = '\000';
-	}
-	else
-	{
-	    printf("Callback Error (BxSetValuesCB):\n\t\
-Syntax Error - specify BxSetValuesCB data as\n\t\
-    <Widget Name>.<Resource> = <Value>\n");
-	    XtFree((char *)(valueList[i]));
-	    continue;
-	}
-	name = valueList[i];
-	while( (name && *name) && isspace(*name) )
-	{
-	    name++;
-	}
-	ptr = name + strlen(name) - 1;
-	while( ptr && *ptr )
-	{
-            if ( isspace(*ptr) )
-            {
-                ptr--;
-            }
-            else
-            {
-                ptr++;
-                break;
-            }
-        }
-        if ( ptr && *ptr )
-        {
-            *ptr = '\0';
-        }
-	if ( ptr == NULL )
-	{
-	    printf("Callback Error (BxSetValuesCB):\n\t\
-Syntax Error - specify BxSetValuesCB data as\n\t\
-    <Widget Name>.<Resource> = <Value>\n");
-	    XtFree((char *)(valueList[i]));
-	    return;
-	}
-
-	/*
-	 * Next, get the resource name to set.
-	 */
-	rsc = ++cptr;
-	cptr = strchr(rsc, '=');
-	if ( cptr != NULL )
-	{
-	    *cptr = '\000';
-	}
-	else
-	{
-	    printf("Callback Error (BxSetValuesCB):\n\t\
-Syntax Error - specify BxSetValuesCB data as\n\t\
-    <Widget Name>.<Resource> = <Value>\n");
-	    XtFree((char *)(valueList[i]));
-	    continue;
-	}
-        while( (rsc && *rsc) && isspace(*rsc) )
-        {
-            rsc++;
-        }
-
-        ptr = rsc + strlen(rsc) - 1;
-        while( ptr && *ptr )
-        {
-            if ( isspace(*ptr) )
-            {
-                ptr--;
-            }
-            else
-            {
-                ptr++;
-                break;
-            }
-        }
-        if ( ptr && *ptr )
-        {
-            *ptr = '\0';
-        }
-
-	/*
-	 * Lastly, get the string value to which to set the resource.
-	 */
-	start = ++cptr;
-        while( (start && *start) && isspace(*start) )
-        {
-            start++;
-        }
-
-	if ( start == NULL )
-	{
-	    printf("Callback Error (BxSetValuesCB):\n\t\
-Syntax Error - specify BxSetValuesCB data as\n\t\
-    <Widget Name>.<Resource> = <Value>\n");
-	    XtFree((char *)(valueList[i]));
-	    return;
-	}
-
-        ptr = start + strlen(start) - 1;
-        while( ptr && *ptr )
-        {
-            if ( isspace(*ptr) )
-            {
-                ptr--;
-            }
-            else
-            {
-                ptr++;
-                break;
-            }
-        }
-        if ( ptr && *ptr )
-        {
-            *ptr = '\0';
-        }
-
-	/*
-	 * Now convert the widget name to a Widget ID
-	 */
-	current = BxWidgetIdsFromNames(w, "BxSetValuesCB", name);
-        if ( current[0] == NULL )
-        {
-	    XtFree((char *)(valueList[i]));
-	    continue;
-        }
-
-	/*
-	 * If the widget name conversion succeeded, we now need to get the
-	 * resource list for the widget so that we can do a resource conversion
-	 * of the value.
-	 */
-	XtVaSetValues(*current, XtVaTypedArg, rsc, XtRString, start,
-		      strlen(start)+1, NULL);
-        XtFree((char *)(valueList[i]));
-    }
-    XtFree((char *)valueList);
-
-#undef CHUNK
-}
-
-
-
-/*--------------------------------------------------------------------*/
-
-void
-do_mbvelocity_init(int argc, char **argv)
-{
-    int	    i;
-
-    /* make sure expose plots are off */
-    expose_plot_ok = False;
-
-    /* get additional widgets */
-    fileSelectionList = (Widget)
-	XmFileSelectionBoxGetChild(fileSelectionBox,
-				    XmDIALOG_LIST);
-    fileSelectionText = (Widget)
-	XmFileSelectionBoxGetChild(fileSelectionBox,
-				    XmDIALOG_TEXT);
-    XtAddCallback(fileSelectionList,
-	    XmNbrowseSelectionCallback,
-	    do_fileselection_list, NULL);
-
-    XtUnmanageChild(
-	    (Widget) XmFileSelectionBoxGetChild(
-				    fileSelectionBox,
-				    XmDIALOG_HELP_BUTTON));
-
-    /* Setup the entire screen. */
-    display = XtDisplay(drawingArea);
-    colormap = DefaultColormap(display,XDefaultScreen(display));
-
-    /* Setup just the "canvas" part of the screen. */
-    can_xid = XtWindow(drawingArea);
-
-    /* Setup the "graphics Context" for just the "canvas" */
-    xgcv.background = WhitePixelOfScreen(DefaultScreenOfDisplay(display));
-    xgcv.foreground = BlackPixelOfScreen(DefaultScreenOfDisplay(display));
-    xgcv.line_width = 2;
-    gc = XCreateGC(display,can_xid,GCBackground | GCForeground
-	     | GCLineWidth, &xgcv);
-
-    /* Setup the font for just the "canvas" screen. */
-    fontStruct = XLoadQueryFont(display, xgfont);
-    if (fontStruct == NULL)
-        {
-	fprintf(stderr,"\nFailure to load font using XLoadQueryFont: %s\n", xgfont);
-        fprintf(stderr,"\tSource file: %s\n\tSource line: %d\n\tSource version: %s", __FILE__, __LINE__, svn_id);
-	fprintf(stderr,"\nProgram <%s> Terminated\n", program_name);
-	exit(-1);
-        }
-    XSetFont(display,gc,fontStruct->fid);
-
-    XSelectInput(display, can_xid, EV_MASK );
-
-    /* Load the colors that will be used in this program. */
-    status = XLookupColor(display,colormap, "white",&db_color,&colors[0]);
-    if ((status = XAllocColor(display,colormap,&colors[0])) == 0)
-	    fprintf(stderr,"Failure to allocate color: white\n");
-    status = XLookupColor(display,colormap, "black",&db_color,&colors[1]);
-    if ((status = XAllocColor(display,colormap,&colors[1])) == 0)
-	    fprintf(stderr,"Failure to allocate color: black\n");
-    status = XLookupColor(display,colormap, "red",&db_color,&colors[2]);
-    if ((status = XAllocColor(display,colormap,&colors[2])) == 0)
-	    fprintf(stderr,"Failure to allocate color: red\n");
-    status = XLookupColor(display,colormap, "green",&db_color,&colors[3]);
-    if ((status = XAllocColor(display,colormap,&colors[3])) == 0)
-	    fprintf(stderr,"Failure to allocate color: green\n");
-    status = XLookupColor(display,colormap, "blue",&db_color,&colors[4]);
-    if ((status = XAllocColor(display,colormap,&colors[4])) == 0)
-	    fprintf(stderr,"Failure to allocate color: blue\n");
-    status = XLookupColor(display,colormap, "coral",&db_color,&colors[5]);
-    if ((status = XAllocColor(display,colormap,&colors[5])) == 0)
-	    fprintf(stderr,"Failure to allocate color: coral\n");
-    status = XLookupColor(display,colormap, "lightgrey",&db_color,&colors[6]);
-    if ((status = XAllocColor(display,colormap,&colors[6])) == 0)
-	    fprintf(stderr,"Failure to allocate color: lightgrey\n");
-    for (i=0;i<NCOLORS;i++)
-	    {
-	    mpixel_values[i] = colors[i].pixel;
-	    }
-
-    /* Setup initial cursor. This will be changed when changing "MODE". */
-    myCursor = XCreateFontCursor(display, XC_target);
-    XAllocNamedColor(display,colormap,"red",&closest[0],&exact[0]);
-    XAllocNamedColor(display,colormap,"coral",&closest[1],&exact[1]);
-    XRecolorCursor(display,myCursor,&closest[0],&closest[1]);
-    XDefineCursor(display,can_xid,myCursor);
-
-    /* initialize graphics */
-    xg_init(display, can_xid, borders, xgfont, &can_xgid);
-
-    status = mbvt_set_graphics(can_xgid, borders,
-		    NCOLORS, mpixel_values);
-
-    /* initialize some labels */
-    strcpy(message_str, "No display SVPs loaded...");
-    set_label_string(label_status_display, message_str);
-    strcpy(message_str, "No editable SVP loaded...");
-    set_label_string(label_status_edit, message_str);
-    strcpy(message_str, "No swath sonar data loaded...");
-    set_label_string(label_status_mb, message_str);
-
-    /* initialize mbvelocitytool proper */
-    status = mbvt_init(argc,argv);
-
-    /* set the controls */
-    do_set_controls();
-
-    /* finally allow expose plots */
-    expose_plot_ok = True;
-}
-
-/*--------------------------------------------------------------------*/
-
-void do_set_controls()
-{
-	/* get some values from mbvelocitytool */
-	mbvt_get_values(&edit_gui,&ndisplay_gui,&maxdepth_gui,
-		&velrange_gui,&velcenter_gui,&resrange_gui,&anglemode_gui,&format_gui);
-
-	/* set about version label */
-	sprintf(message_str, ":::t\"MB-System Release %s\":t\"%s\"",
-		MB_VERSION, MB_BUILD_DATE);
-	set_label_multiline_string(label_about_version, message_str);
-
-	if (ndisplay_gui < 1)
-	    strcpy(message_str, "No display SVPs loaded...");
-	else if (ndisplay_gui == 1)
-	    sprintf(message_str, "Loaded %d display SVP", ndisplay_gui);
-	else
-	    sprintf(message_str, "Loaded %d display SVPs", ndisplay_gui);
-	set_label_string(label_status_display, message_str);
-
-	/* set pushbuttons */
-	if (edit_gui == 1)
-	    {
-	    XtVaSetValues(pushButton_save_svp,
-			XmNsensitive, True,
-			NULL);
-	    XtVaSetValues(pushButton_save_svpfile,
-			XmNsensitive, True,
-			NULL);
-	    }
-	else
-	    {
-	    XtVaSetValues(pushButton_save_svp,
-			XmNsensitive, False,
-			NULL);
-	    XtVaSetValues(pushButton_save_svpfile,
-			XmNsensitive, False,
-			NULL);
-	    }
-	if (nload > 0)
-	    {
-	    XtVaSetValues(pushButton_process,
-			XmNsensitive, True,
-			NULL);
-	    XtVaSetValues(pushButton_save_residuals,
-			XmNsensitive, True,
-			NULL);
-	    }
-	else
-	    {
-	    XtVaSetValues(pushButton_process,
-			XmNsensitive, False,
-			NULL);
-	    XtVaSetValues(pushButton_save_residuals,
-			XmNsensitive, False,
-			NULL);
-	    }
-
-	/* set values of maximum depth slider */
-	XtVaSetValues(slider_maxdepth,
-			XmNvalue, (int)maxdepth_gui,
-			NULL);
-
-	/* set values of velocity range slider */
-	XtVaSetValues(slider_velrange,
-			XmNvalue, (int)velrange_gui,
-			NULL);
-
-	/* set values of velocity center slider */
-	XtVaSetValues(slider_velcenter,
-			XmNvalue, (int)velcenter_gui,
-			XmNminimum, (int)1300,
-			XmNmaximum, (int)1700,
-			NULL);
-
-	/* set values of residual range slider */
-	XtVaSetValues(slider_residual_range,
-			XmNvalue, ((int) (10 * resrange_gui)),
-			NULL);
-
-	/* set values of angle mode radiobox */
-	if (anglemode_gui == 0)
-	    XmToggleButtonSetState(toggleButton_mode_ok,
-			TRUE, TRUE);
-	else if (anglemode_gui == 1)
-	    XmToggleButtonSetState(toggleButton_mode_snell,
-			TRUE, TRUE);
-	else if (anglemode_gui == 2)
-	    XmToggleButtonSetState(toggleButton_mode_null,
-			TRUE, TRUE);
-
-	/* set value of format text item */
-	sprintf(message_str,"%2.2d",format_gui);
-	XmTextFieldSetString(textField_mbformat, message_str);
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_velrange( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmScaleCallbackStruct *acs;
-    acs=(XmScaleCallbackStruct*)call_data;
-
-    velrange_gui = (double) acs->value;
-
-    mbvt_set_values(edit_gui,ndisplay_gui,maxdepth_gui,
-	    velrange_gui,velcenter_gui,resrange_gui,anglemode_gui);
-
-    /* replot everything */
-    do_set_controls();
-
-    mbvt_plot();
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_velcenter( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmScaleCallbackStruct *acs;
-    acs=(XmScaleCallbackStruct*)call_data;
-
-    velcenter_gui = (double) acs->value;
-
-    mbvt_set_values(edit_gui,ndisplay_gui,maxdepth_gui,
-	    velrange_gui,velcenter_gui,resrange_gui,anglemode_gui);
-
-    /* replot everything */
-    do_set_controls();
-
-    mbvt_plot();
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_process_mb( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs=(XmAnyCallbackStruct*)call_data;
-
-    fprintf(stderr, "\nAbout to process data\n");
-
-    /* turn off expose plots */
-    expose_plot_ok = False;
-
-    /* process Swath Sonar data */
-    status = mbvt_process_multibeam();
-    if (status != 1)
-	    XBell(display,100);
-
-    /* turn on expose plots */
-    expose_plot_ok = True;
-
-    /* replot everything */
-    do_set_controls();
-
-    mbvt_plot();
-
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_maxdepth( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmScaleCallbackStruct *acs;
-    acs=(XmScaleCallbackStruct*)call_data;
-
-    maxdepth_gui = (double) acs->value;
-
-    mbvt_set_values(edit_gui,ndisplay_gui,maxdepth_gui,
-	    velrange_gui,velcenter_gui,resrange_gui,anglemode_gui);
-
-    /* replot everything */
-    do_set_controls();
-
-    mbvt_plot();
-
-}
-/*--------------------------------------------------------------------*/
-
-void
-do_anglemode( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-
-    if (XmToggleButtonGetState(toggleButton_mode_ok))
-	anglemode_gui = 0;
-    else if (XmToggleButtonGetState(toggleButton_mode_snell))
-	anglemode_gui = 1;
-    else if (XmToggleButtonGetState(toggleButton_mode_null))
-	anglemode_gui = 2;
-
-    mbvt_set_values(edit_gui,ndisplay_gui,maxdepth_gui,
-	    velrange_gui,velcenter_gui,resrange_gui,anglemode_gui);
-
-    /* replot everything */
-    do_set_controls();
-
-    mbvt_plot();
-
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_quit( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs=(XmAnyCallbackStruct*)call_data;
-
-    mbvt_quit();
-
-    fprintf(stderr,"\nExiting mbvelocity!\n");
-
-    exit(0);
-
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_fileselection_list( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs=(XmAnyCallbackStruct*)call_data;
-
-    static mb_path selection_text;
-    int	form;
-
-    /* get selected text */
-    get_text_string(fileSelectionText, selection_text);
-
-    /* get output file */
-    if((int)strlen(selection_text) > 0)
-	    {
-	    /* look for MB suffix convention */
-	    form = format_gui;
-	    if ((status = mbvt_get_format(selection_text,
-			    &form)) == MB_SUCCESS)
-		{
-		format_gui = form;
-		sprintf(message_str,"%d",format_gui);
-		XmTextFieldSetString(
-		    textField_mbformat,
-		    message_str);
-		}
-	    }
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_open( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmFileSelectionBoxCallbackStruct *acs;
-    acs=(XmFileSelectionBoxCallbackStruct*)call_data;
-
-    /* local definitions */
-    int	selected;
-    int	status = 0;
-    char    format_text[10];
-    char    *input_file_ptr;
-
-    /* read the input file name */
-    if(!XmStringGetLtoR(acs->value,
-	    XmSTRING_DEFAULT_CHARSET,
-	    &input_file_ptr))
-	    {
-	    selected = 0;
-	    }
-    else
-	    {
-	    selected = 1;
-	    strncpy(input_file, input_file_ptr, 128);
-	    XtFree(input_file_ptr);
-	    }
-
-    if (selected > 0)
-       {
-       /* get selected filename id and file format id */
-       if (open_type == MBVT_IO_OPEN_DISPLAY_SVP)
-	    {
-	    /* open file */
-	    status = mbvt_open_display_profile(input_file);
-
-	    /* reset status message */
-	    if (status == 1)
-	      {
-	      sprintf(message_str, "Loaded display SVP from: %s", input_file);
-	      set_label_string(label_status_display,
-			message_str);
-	      }
-	    }
-       else if (open_type == MBVT_IO_OPEN_EDIT_SVP)
-	    {
-	    /* open file */
-	    status = mbvt_open_edit_profile(input_file);
-
-	    /* reset status message */
-	    if (status == 1)
-	      {
-	      edit_gui = 1;
-	       sprintf(message_str, "Loaded editable SVP from: %s", input_file);
-	       set_label_string(label_status_edit,
-			message_str);
-	      }
-	    }
-       else if (open_type == MBVT_IO_SAVE_EDIT_SVP
-	    && edit_gui == 1)
-	    {
-	    /* save file */
-	    status = mbvt_save_edit_profile(input_file);
-
-	    /* reset status message */
-	    if (status == 1)
-	      {
-	       sprintf(message_str, "Saved editable SVP to: %s", input_file);
-	       set_label_string(label_status_edit,
-			message_str);
-	      }
-	    }
-       else if (open_type == MBVT_IO_OPEN_MB)
-	    {
-	    /* turn off expose plots */
-	    expose_plot_ok = False;
-
-	    /* get format id value */
-	    get_text_string(textField_mbformat, format_text);
-	    sscanf(format_text, "%d", &format_gui);
-
-	    /* open file */
-	    status = mbvt_open_swath_file(input_file,format_gui, &nload);
-
-	    /* reset status message */
-	    if (status == 1)
-	      {
-	      sprintf(message_str, "Read %d pings from swath file: %s",
-			    nload, input_file);
-	      set_label_string(label_status_mb,
-			message_str);
-	      }
-	    if (status == 1 && edit_gui != 1)
-	      {
-	       sprintf(message_str, "Loaded default editable SVP");
-	       set_label_string(label_status_edit,
-			message_str);
-	      }
-
-	    /* turn on expose plots */
-	    expose_plot_ok = True;
-	    }
-
-       if (status != 1)
-	    XBell(display,100);
-
-       /* replot everything */
-       do_set_controls();
-       mbvt_plot();
-
-    }
-}
-/*--------------------------------------------------------------------*/
-
-void
-do_open_commandline(char *wfile, char *sfile, char *file, int format)
-{
-	/* local definitions */
-	int	status;
-
-	/* turn off expose plots */
-	expose_plot_ok = False;
-
-       /* get selected filename id and file format id */
-       if (strlen(file) > 0)
-	    {
-	    /* turn off expose plots */
-	    expose_plot_ok = False;
-
-	    /* get format id value */
-	    strcpy(input_file, file);
-	    format_gui = format;
-
-	    /* open file */
-	    status = mbvt_open_swath_file(input_file,format_gui, &nload);
-
-	    /* reset status message */
-	    if (status == 1)
-	      {
-	      sprintf(message_str, "Read %d pings from swath file: %s",
-			    nload, input_file);
-	      set_label_string(label_status_mb,
-			message_str);
-	      }
-	    if (status == 1 && edit_gui != 1)
-	      {
-	       sprintf(message_str, "Loaded default editable SVP");
-	       set_label_string(label_status_edit,
-			message_str);
-	      }
-	    }
-       if (strlen(wfile) > 0)
-	    {
-	    /* open file */
-	    edit_gui = 1;
-	    status = mbvt_open_edit_profile(wfile);
-
-	    /* reset status message */
-	    if (status == 1)
-	      {
-	       sprintf(message_str, "Loaded editable SVP from: %s", wfile);
-	       set_label_string(label_status_edit,
-			message_str);
-	      }
-	    }
-       if (strlen(sfile) > 0)
-	    {
-	    /* open file */
-	    status = mbvt_open_display_profile(sfile);
-
-	    /* reset status message */
-	    if (status == 1)
-	      {
-	      sprintf(message_str, "Loaded display SVP from: %s", wfile);
-	      set_label_string(label_status_display,
-			message_str);
-	      }
-	    }
-
-	/* turn on expose plots */
-	expose_plot_ok = True;
-
-	if (status != 1)
-	    XBell(display,100);
-
-	/* replot everything */
-	do_set_controls();
-	mbvt_plot();
-
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_new_profile( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmListCallbackStruct *acs;
-    acs=(XmListCallbackStruct*)call_data;
-
-    /* get new edit velocity profile */
-    mbvt_new_edit_profile();
-
-    sprintf(message_str, "Loaded default editable SVP");
-    set_label_string(label_status_edit, message_str);
-
-    /* replot everything */
-    do_set_controls();
-
-    mbvt_plot();
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_residual_range( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmScaleCallbackStruct *acs;
-    acs=(XmScaleCallbackStruct*)call_data;
-
-    resrange_gui = ((double)acs->value / 10.0);
-
-    mbvt_set_values(edit_gui,ndisplay_gui,maxdepth_gui,
-	    velrange_gui,velcenter_gui,resrange_gui,anglemode_gui);
-
-    /* replot everything */
-    do_set_controls();
-
-    mbvt_plot();
-}
-
-
-/*--------------------------------------------------------------------*/
-
-void
-do_canvas_event( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XEvent  *event;
-    XmDrawingAreaCallbackStruct *acs;
-    acs=(XmDrawingAreaCallbackStruct*)call_data;
-    event = acs->event;
-
-    static Position x_loc, y_loc;
-    int root_x_return, root_y_return,win_x,win_y;
-    unsigned int mask_return;
-    int	    doit;
-    int	    ring_bell;
-    int	    status;
-
-    /* If there is input in the drawing area */
-    if (acs->reason == XmCR_INPUT)
-    {
-      /* Check for mouse pressed and not pressed and released. */
-      if(event->xany.type == ButtonPress)
-      {
-	  /* If left mouse button is pushed then move nearest svp node. */
-	  if(event->xbutton.button == 1)
-	  {
-	    x_loc = event->xbutton.x;
-	    y_loc = event->xbutton.y;
-
-	    status = mbvt_action_select_node(
-			    x_loc,y_loc);
-
-	    doit = True;
-	    ring_bell = False;
-	    while (doit == True)
-		    {
-		    status = mbvt_action_drag_node(
-			    x_loc,y_loc);
-		    if (status == 0 && ring_bell == False)
-			    {
-			    ring_bell = True;
-			    XBell(display,100);
-			    }
-
-		    status = XQueryPointer(display,can_xid,
-			    &root_return,&child_return,&root_x_return,
-			    &root_y_return, &win_x, &win_y, &mask_return);
-
-		    x_loc = win_x;
-		    y_loc = win_y;
-
-		    /* If the button is still pressed then read the location */
-		    /* of the pointer and run the action mouse function again */
-		    if (mask_return == 256 )
-			doit = True;
-		    else
-			doit = False;
-		    }
-	      if (ring_bell == True)
-		    XBell(display,100);
-
-	      /* replot graph */
-	      mbvt_plot();
-
-	    } /* end of left mouse pressed */
-
-	  /* If middle mouse button is pushed then add svp node. */
-	  else if(event->xbutton.button == 2)
-	  {
-	    x_loc = event->xbutton.x;
-	    y_loc = event->xbutton.y;
-
-	    status = mbvt_action_add_node(
-			    x_loc,y_loc);
-	    if (status != 1)
-		XBell(display,100);
-
-	      /* replot graph */
-	      mbvt_plot();
-
-	    } /* end of middle mouse pressed */
-
-	  /* If right mouse button is pushed then delete nearest svp node. */
-	  else if(event->xbutton.button == 3)
-	  {
-	    x_loc = event->xbutton.x;
-	    y_loc = event->xbutton.y;
-
-	    status = mbvt_action_delete_node(
-			    x_loc,y_loc);
-	    if (status != 1)
-		XBell(display,100);
-
-	      /* replot graph */
-	      mbvt_plot();
-
-	    }; /* end of right mouse pressed */
-
-       }; /* end of button press event */
-
-      /* button release event */
-      if(event->xany.type == ButtonRelease)
-      {
-	  if(event->xbutton.button == 1)
-	  {
-		    status = mbvt_action_mouse_up(x_loc, y_loc);
-
-		    if (status == 0) XBell(display,100);
-
-	  }; /* end of button 1 button release */
-      }; /* end of button release */
-    }; /* end of input to canvas */
-
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_save_swath_svp( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-
-       if (edit_gui == 1)
-	    {
-	    /* save file */
-	    status = mbvt_save_swath_profile(input_file);
-
-	    /* reset status message */
-	    if (status == 1)
-	      {
-	       strcpy(message_str, "Saved Editable Sound Velocity Profile: ");
-	       strcat(message_str, input_file);
-	       set_label_string(label_status_edit, message_str);
-	      }
-	    }
-
-       if (status != 1)
-	    XBell(display,100);
-
-       /* replot everything */
-       do_set_controls();
-       mbvt_plot();
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_save_residuals( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-
-       if (edit_gui == 1 && nload > 0)
-	    {
-	    /* save file */
-	    status = mbvt_save_residuals(input_file);
-
-	    /* reset status message */
-	    if (status == 1)
-	      {
-	       strcpy(message_str, "Saved Residuals as Beam Offsets: ");
-	       strcat(message_str, input_file);
-	       set_label_string(label_status_edit, message_str);
-	      }
-	    }
-
-       if (status != 1)
-	    XBell(display,100);
-
-       /* replot everything */
-       do_set_controls();
-       mbvt_plot();
-}
-
-/*--------------------------------------------------------------------*/
-
-
-void
-do_io_mode_mb( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs=(XmAnyCallbackStruct*)call_data;
-
-    open_type = MBVT_IO_OPEN_MB;
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_io_mode_open_svp_display( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs=(XmAnyCallbackStruct*)call_data;
-
-    open_type = MBVT_IO_OPEN_DISPLAY_SVP;
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_io_mode_save_svp( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs=(XmAnyCallbackStruct*)call_data;
-
-    open_type = MBVT_IO_SAVE_EDIT_SVP;
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_io_mode_open_svp_edit( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs=(XmAnyCallbackStruct*)call_data;
-
-    open_type = MBVT_IO_OPEN_EDIT_SVP;
-}
-
-/*--------------------------------------------------------------------*/
-
-void
-do_expose( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs=(XmAnyCallbackStruct*)call_data;
-
-    if (expose_plot_ok == True)
-	    mbvt_plot();
-}
-
-/*--------------------------------------------------------------------*/
-
-int
-do_wait_until_viewed(XtAppContext app)
-{
-    Widget  topshell;
-    Window  topwindow;
-    XWindowAttributes	xwa;
-    XEvent  event;
-
-    /* set app_context */
-    app_context = app;
-
-    /* find the top level shell */
-    for (topshell = drawingArea;
-	    !XtIsTopLevelShell(topshell);
-	    topshell = XtParent(topshell))
-	;
-
-    /* keep processing events until it is viewed */
-    if (XtIsRealized(topshell))
-	{
-	topwindow = XtWindow(topshell);
-
-	/* wait for the window to be mapped */
-	while (XGetWindowAttributes(
-			XtDisplay(drawingArea),
-			topwindow, &xwa)
-		&& xwa.map_state != IsViewable)
-	    {
-	    XtAppNextEvent(app_context, &event);
-	    XtDispatchEvent(&event);
-	    }
-	}
-
-    XmUpdateDisplay(topshell);
-
-    return(1);
-}
-
-/*--------------------------------------------------------------------*/
-
-int
-do_message_on(char *message)
-{
-    Widget  diashell, topshell;
-    Window  diawindow, topwindow;
-    XWindowAttributes	xwa;
-    XEvent  event;
-
-    set_label_string(label_message, message);
-    XtManageChild(bulletinBoard_message);
-
-    /* force the label to be visible */
-    for (diashell = label_message;
-	    !XtIsShell(diashell);
-	    diashell = XtParent(diashell))
-	;
-    for (topshell = diashell;
-	    !XtIsTopLevelShell(topshell);
-	    topshell = XtParent(topshell))
-	;
-    if (XtIsRealized(diashell) && XtIsRealized(topshell))
-	{
-	diawindow = XtWindow(diashell);
-	topwindow = XtWindow(topshell);
-
-	/* wait for the dialog to be mapped */
-	while (XGetWindowAttributes(display, diawindow, &xwa)
-		&& xwa.map_state != IsViewable)
-	    {
-	    if (XGetWindowAttributes(display, topwindow, &xwa)
-		    && xwa.map_state != IsViewable)
-		break;
-
-	    XtAppNextEvent(app_context, &event);
-	    XtDispatchEvent(&event);
-	    }
-	}
-
-    XmUpdateDisplay(topshell);
-
-    return(1);
-}
-
-/*--------------------------------------------------------------------*/
-
-int
-do_message_off()
-{
-    XtUnmanageChild(bulletinBoard_message);
-    XSync(XtDisplay(bulletinBoard_message), 0);
-    XmUpdateDisplay(bulletinBoard_message);
-
-    return(1);
-}
-
-/*--------------------------------------------------------------------*/
-
-int
-do_error_dialog(char *s1, char *s2, char *s3)
-{
-    set_label_string(label_error_one, s1);
-    set_label_string(label_error_two, s2);
-    set_label_string(label_error_three, s3);
-    XtManageChild(bulletinBoard_error);
-    XBell(display,100);
-
-    return(1);
-}
-
-/*--------------------------------------------------------------------*/
-/* Change label string cleanly, no memory leak */
-/*--------------------------------------------------------------------*/
-
-void set_label_string(Widget w, String str)
-{
-    XmString xstr;
-
-    xstr = XmStringCreateLocalized( str );
-    if ( xstr != NULL )
-	XtVaSetValues(w,
-	    XmNlabelString, xstr,
-	    NULL);
-    else
-	XtWarning("Failed to update labelString");
-
-    XmStringFree( xstr );
-}
-/*--------------------------------------------------------------------*/
-/* Change multiline label string cleanly, no memory leak */
-/*--------------------------------------------------------------------*/
-
-void set_label_multiline_string(Widget w, String str)
-{
-    XmString xstr;
-    Boolean      argok;
-
-    xstr = (XtPointer)BX_CONVERT(w, str, XmRXmString, 0, &argok);
-    if ( xstr != NULL && argok)
-        XtVaSetValues(w,
-            XmNlabelString, xstr,
-            NULL);
-    else
-        XtWarning("Failed to update labelString");
-
-    XmStringFree( xstr );
-}
-/*--------------------------------------------------------------------*/
-/* Get text item string cleanly, no memory leak */
-/*--------------------------------------------------------------------*/
-
-void get_text_string(Widget w, String str)
-{
-    char	*str_tmp;
-
-    str_tmp = (char *) XmTextGetString(w);
-    strcpy(str, str_tmp);
-    XtFree(str_tmp);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbvelocitytool/mbvelocity_creation.c b/src/mbvelocitytool/mbvelocity_creation.c
deleted file mode 100644
index 7228402..0000000
--- a/src/mbvelocitytool/mbvelocity_creation.c
+++ /dev/null
@@ -1,1917 +0,0 @@
-
-/* Begin user code block <abstract> */
-/* End user code block <abstract> */
-
-/**
- * README: Portions of this file are merged at file generation
- * time. Edits can be made *only* in between specified code blocks, look
- * for keywords <Begin user code> and <End user code>.
- */
-/*
- * Generated by the ICS Builder Xcessory (BX).
- *
- * BuilderXcessory Version 6.1.3
- * Code Generator Xcessory 6.1.3 (08/19/04) CGX Scripts 6.1 Motif 2.1 
- *
- */
-
-
-/* Begin user code block <file_comments> */
-
-#ifndef SANS
-#define SANS "helvetica"
-#endif
-#ifndef SERIF
-#define SERIF "times"
-#endif
-#ifndef MONO
-#define MONO "courier"
-#endif
-
-/* End user code block <file_comments> */
-
-#include <Xm/Xm.h>
-#include <Xm/MainW.h>
-#include <Xm/DialogS.h>
-#include <Xm/MwmUtil.h>
-#include <Xm/BulletinB.h>
-#include <Xm/RowColumn.h>
-#include <Xm/ToggleB.h>
-#include <Xm/PushB.h>
-#include <Xm/Label.h>
-#include <Xm/Scale.h>
-#include <Xm/TextF.h>
-#include <Xm/FileSB.h>
-#include <Xm/Separator.h>
-#include <Xm/CascadeB.h>
-#include <Xm/DrawingA.h>
-#include <Xm/MainW.h>
-#include <Xm/DialogS.h>
-#include <Xm/MwmUtil.h>
-#include <Xm/BulletinB.h>
-#include <Xm/RowColumn.h>
-#include <Xm/ToggleB.h>
-#include <Xm/PushB.h>
-#include <Xm/Label.h>
-#include <Xm/Scale.h>
-#include <Xm/TextF.h>
-#include <Xm/FileSB.h>
-#include <Xm/Separator.h>
-#include <Xm/CascadeB.h>
-#include <Xm/DrawingA.h>
-
-/*
- * Global declarations are now stored in the header file.
- *
- * If DECLARE_BX_GLOBALS is defined then this header file
- * declares the globals, otherwise it just externs them.
- */
-#define DECLARE_BX_GLOBALS
-
-/**
- * Globally included information.
- */
-
-
-/**
- * Common constant and pixmap declarations.
- */
-#include "mbvelocity_creation.h"
-
-/**
- * Convenience functions from utilities file.
- */
-extern void RegisterBxConverters(XtAppContext);
-extern XtPointer BX_CONVERT(Widget, char *, char *, int, Boolean *);
-extern XtPointer BX_DOUBLE(double);
-extern XtPointer BX_SINGLE(float);
-extern void BX_MENU_POST(Widget, XtPointer, XEvent *, Boolean *);
-extern Pixmap XPM_PIXMAP(Widget, char **);
-extern void BX_SET_BACKGROUND_COLOR(Widget, ArgList, Cardinal *, Pixel);
-
-/**
- * Declarations for callbacks and handlers.
- */
-extern void do_quit(Widget, XtPointer, XtPointer);
-extern void BxUnmanageCB(Widget, XtPointer, XtPointer);
-extern void do_anglemode(Widget, XtPointer, XtPointer);
-extern void do_velcenter(Widget, XtPointer, XtPointer);
-extern void do_residual_range(Widget, XtPointer, XtPointer);
-extern void do_velrange(Widget, XtPointer, XtPointer);
-extern void do_maxdepth(Widget, XtPointer, XtPointer);
-extern void do_open(Widget, XtPointer, XtPointer);
-extern void BxManageCB(Widget, XtPointer, XtPointer);
-extern void do_process_mb(Widget, XtPointer, XtPointer);
-extern void do_canvas_event(Widget, XtPointer, XtPointer);
-extern void do_expose(Widget, XtPointer, XtPointer);
-extern void do_io_mode_open_svp_display(Widget, XtPointer, XtPointer);
-extern void BxSetValuesCB(Widget, XtPointer, XtPointer);
-extern void do_io_mode_open_svp_edit(Widget, XtPointer, XtPointer);
-extern void do_new_profile(Widget, XtPointer, XtPointer);
-extern void do_io_mode_save_svp(Widget, XtPointer, XtPointer);
-extern void do_io_mode_mb(Widget, XtPointer, XtPointer);
-extern void do_save_swath_svp(Widget, XtPointer, XtPointer);
-extern void do_save_residuals(Widget, XtPointer, XtPointer);
-
-/**
- * Create the window_mbvelocity hierarchy of widgets.
- */
-Widget
-Createwindow_mbvelocity(Widget parent)
-{
-    Cardinal ac = 0;
-    Arg      args[256];
-    Boolean  argok = False;
-    Widget   window_mbvelocity;
-    Widget   dialogShell_mode;
-    Widget   bulletinBoard_mode;
-    Widget   radioBox_mode;
-    Widget   pushButton_mode_dismiss;
-    Widget   xmDialogShell_scaling;
-    Widget   bulletinBoard_scaling;
-    Widget   label_velcenter;
-    Widget   pushButton_scaling_dismiss;
-    Widget   label_residual_range;
-    Widget   label_velrange;
-    Widget   label_max_depth;
-    Widget   xmDialogShell_error;
-    Widget   pushButton_error;
-    Widget   bulletinBoard_fileselect;
-    Widget   xmDialogShell_message;
-    Widget   label_pleasewait;
-    Widget   xmDialogShell_about;
-    Widget   bulletinBoard_about;
-    Widget   label_about_create1;
-    Widget   separator2;
-    Widget   pushButton_about_dismiss;
-    Widget   label_about_create;
-    Widget   label_about_lamont;
-    Widget   label_about_columbia;
-    Widget   label_about_mbsystem;
-    Widget   label_about_mbpub;
-    Widget   label_about_component;
-    Widget   label_about_for;
-    Widget   separator;
-    Widget   label_about_function;
-    Widget   label_about_mbedit;
-    Widget   input_screen;
-    Widget   pushButton_mode;
-    Widget   pushButton_plotscaling;
-    Widget   rowColumn;
-    Widget   menuBar_file;
-    Widget   cascadeButton_file;
-    Widget   pulldownMenu_file;
-    Widget   pushButton_open_svp_display;
-    Widget   pushButton_open_svp_edit;
-    Widget   pushButton_new_svp_edit;
-    Widget   separator1;
-    Widget   separator3;
-    Widget   pushButton_about;
-    Widget   pushButton_quit;
-    
-    /**
-     * Register the converters for the widgets.
-     */
-    RegisterBxConverters(XtWidgetToApplicationContext(parent));
-    XtInitializeWidgetClass((WidgetClass)xmMainWindowWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmDialogShellWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmBulletinBoardWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmRowColumnWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmToggleButtonWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmPushButtonWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmLabelWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmScaleWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmTextFieldWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmFileSelectionBoxWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmSeparatorWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmBulletinBoardWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmRowColumnWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmRowColumnWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmCascadeButtonWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmRowColumnWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmDrawingAreaWidgetClass);
-    
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 365); ac++;
-    XtSetArg(args[ac], XmNy, 192); ac++;
-    XtSetArg(args[ac], XmNwidth, 1016); ac++;
-    XtSetArg(args[ac], XmNheight, 668); ac++;
-    window_mbvelocity = XmCreateMainWindow(parent,
-        (char *)"window_mbvelocity",
-        args, 
-        ac);
-    
-    ac = 0;
-    XtSetArg(args[ac], XmNmarginHeight, 0); ac++;
-    XtSetArg(args[ac], XmNmarginWidth, 0); ac++;
-    XtSetArg(args[ac], XmNresizePolicy, XmRESIZE_GROW); ac++;
-    XtSetArg(args[ac], XmNwidth, 1016); ac++;
-    XtSetArg(args[ac], XmNheight, 668); ac++;
-    input_screen = XmCreateBulletinBoard(window_mbvelocity,
-        (char *)"input_screen",
-        args, 
-        ac);
-    XtManageChild(input_screen);
-    
-    ac = 0;
-    {
-        XmString    tmp0;
-        
-        tmp0 = (XmString) BX_CONVERT(input_screen, (char *)"Angle Mode", 
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 330); ac++;
-        XtSetArg(args[ac], XmNy, 0); ac++;
-        XtSetArg(args[ac], XmNwidth, 90); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList, 
-            BX_CONVERT(input_screen, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_mode = XmCreatePushButton(input_screen,
-            (char *)"pushButton_mode",
-            args, 
-            ac);
-        XtManageChild(pushButton_mode);
-        
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-    
-    XtAddCallback(pushButton_mode, XmNactivateCallback, BxManageCB, (XtPointer)"bulletinBoard_mode");
-    
-    ac = 0;
-    {
-        XmString    tmp0;
-        
-        tmp0 = (XmString) BX_CONVERT(input_screen, (char *)"Plot Scaling", 
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 160); ac++;
-        XtSetArg(args[ac], XmNy, 0); ac++;
-        XtSetArg(args[ac], XmNwidth, 90); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList, 
-            BX_CONVERT(input_screen, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_plotscaling = XmCreatePushButton(input_screen,
-            (char *)"pushButton_plotscaling",
-            args, 
-            ac);
-        XtManageChild(pushButton_plotscaling);
-        
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-    
-    XtAddCallback(pushButton_plotscaling, XmNactivateCallback, BxManageCB, (XtPointer)"bulletinBoard_scaling");
-    
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 0); ac++;
-    XtSetArg(args[ac], XmNy, 0); ac++;
-    XtSetArg(args[ac], XmNwidth, 83); ac++;
-    XtSetArg(args[ac], XmNheight, 34); ac++;
-    rowColumn = XmCreateRowColumn(input_screen,
-        (char *)"rowColumn",
-        args, 
-        ac);
-    XtManageChild(rowColumn);
-    
-    ac = 0;
-    XtSetArg(args[ac], XmNmarginHeight, 0); ac++;
-    XtSetArg(args[ac], XmNmarginWidth, 0); ac++;
-    XtSetArg(args[ac], XmNwidth, 77); ac++;
-    XtSetArg(args[ac], XmNheight, 28); ac++;
-    menuBar_file = XmCreateMenuBar(rowColumn,
-        (char *)"menuBar_file",
-        args, 
-        ac);
-    XtManageChild(menuBar_file);
-    
-    ac = 0;
-    {
-        XmString    tmp0;
-        
-        tmp0 = (XmString) BX_CONVERT(menuBar_file, (char *)"    File    ", 
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 2); ac++;
-        XtSetArg(args[ac], XmNy, 2); ac++;
-        XtSetArg(args[ac], XmNwidth, 73); ac++;
-        XtSetArg(args[ac], XmNheight, 24); ac++;
-        XtSetArg(args[ac], XmNfontList, 
-            BX_CONVERT(menuBar_file, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        cascadeButton_file = XmCreateCascadeButton(menuBar_file,
-            (char *)"cascadeButton_file",
-            args, 
-            ac);
-        XtManageChild(cascadeButton_file);
-        
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-    
-    
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 0); ac++;
-    XtSetArg(args[ac], XmNy, 0); ac++;
-    XtSetArg(args[ac], XmNwidth, 184); ac++;
-    XtSetArg(args[ac], XmNheight, 176); ac++;
-    pulldownMenu_file = XmCreatePulldownMenu(XtParent(cascadeButton_file),
-        (char *)"pulldownMenu_file",
-        args, 
-        ac);
-    
-    ac = 0;
-    {
-        XmString    tmp0;
-        
-        tmp0 = (XmString) BX_CONVERT(pulldownMenu_file, (char *)"Open display profile", 
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList, 
-            BX_CONVERT(pulldownMenu_file, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_open_svp_display = XmCreatePushButton(pulldownMenu_file,
-            (char *)"pushButton_open_svp_display",
-            args, 
-            ac);
-        XtManageChild(pushButton_open_svp_display);
-        
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-    
-    XtAddCallback(pushButton_open_svp_display, XmNactivateCallback, BxManageCB, (XtPointer)"bulletinBoard_fileselect");
-    XtAddCallback(pushButton_open_svp_display, XmNactivateCallback, do_io_mode_open_svp_display, (XtPointer)0);
-    XtAddCallback(pushButton_open_svp_display, XmNactivateCallback, BxUnmanageCB, (XtPointer)"label_mbformat");
-    XtAddCallback(pushButton_open_svp_display, XmNactivateCallback, BxUnmanageCB, (XtPointer)"textField_mbformat");
-    XtAddCallback(pushButton_open_svp_display, XmNactivateCallback, BxSetValuesCB, (XtPointer)"xmDialogShell_fileselect.title=Open Display Sound Velocity Profile (SVP)");
-    
-    ac = 0;
-    {
-        XmString    tmp0;
-        
-        tmp0 = (XmString) BX_CONVERT(pulldownMenu_file, (char *)"Open editable profile", 
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList, 
-            BX_CONVERT(pulldownMenu_file, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_open_svp_edit = XmCreatePushButton(pulldownMenu_file,
-            (char *)"pushButton_open_svp_edit",
-            args, 
-            ac);
-        XtManageChild(pushButton_open_svp_edit);
-        
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-    
-    XtAddCallback(pushButton_open_svp_edit, XmNactivateCallback, BxManageCB, (XtPointer)"bulletinBoard_fileselect");
-    XtAddCallback(pushButton_open_svp_edit, XmNactivateCallback, do_io_mode_open_svp_edit, (XtPointer)0);
-    XtAddCallback(pushButton_open_svp_edit, XmNactivateCallback, BxUnmanageCB, (XtPointer)"label_mbformat");
-    XtAddCallback(pushButton_open_svp_edit, XmNactivateCallback, BxUnmanageCB, (XtPointer)"textField_mbformat");
-    XtAddCallback(pushButton_open_svp_edit, XmNactivateCallback, BxSetValuesCB, (XtPointer)"xmDialogShell_fileselect.title=Open Editable Sound Velocity Profile (SVP)");
-    
-    ac = 0;
-    {
-        XmString    tmp0;
-        
-        tmp0 = (XmString) BX_CONVERT(pulldownMenu_file, (char *)"New editable profile...", 
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList, 
-            BX_CONVERT(pulldownMenu_file, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_new_svp_edit = XmCreatePushButton(pulldownMenu_file,
-            (char *)"pushButton_new_svp_edit",
-            args, 
-            ac);
-        XtManageChild(pushButton_new_svp_edit);
-        
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-    
-    XtAddCallback(pushButton_new_svp_edit, XmNactivateCallback, do_new_profile, (XtPointer)0);
-    
-    ac = 0;
-    {
-        XmString    tmp0;
-        
-        tmp0 = (XmString) BX_CONVERT(pulldownMenu_file, (char *)"Save editable profile", 
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList, 
-            BX_CONVERT(pulldownMenu_file, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_save_svp = XmCreatePushButton(pulldownMenu_file,
-            (char *)"pushButton_save_svp",
-            args, 
-            ac);
-        XtManageChild(pushButton_save_svp);
-        
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-    
-    XtAddCallback(pushButton_save_svp, XmNactivateCallback, BxManageCB, (XtPointer)"bulletinBoard_fileselect");
-    XtAddCallback(pushButton_save_svp, XmNactivateCallback, do_io_mode_save_svp, (XtPointer)0);
-    XtAddCallback(pushButton_save_svp, XmNactivateCallback, BxUnmanageCB, (XtPointer)"label_mbformat");
-    XtAddCallback(pushButton_save_svp, XmNactivateCallback, BxUnmanageCB, (XtPointer)"textField_mbformat");
-    XtAddCallback(pushButton_save_svp, XmNactivateCallback, BxSetValuesCB, (XtPointer)"xmDialogShell_fileselect.title=Save Editable Sound Velocity Profile (SVP)");
-    
-    ac = 0;
-    separator1 = XmCreateSeparator(pulldownMenu_file,
-        (char *)"separator1",
-        args, 
-        ac);
-    XtManageChild(separator1);
-    
-    ac = 0;
-    {
-        XmString    tmp0;
-        
-        tmp0 = (XmString) BX_CONVERT(pulldownMenu_file, (char *)"Open swath sonar data", 
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList, 
-            BX_CONVERT(pulldownMenu_file, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_open_mb = XmCreatePushButton(pulldownMenu_file,
-            (char *)"pushButton_open_mb",
-            args, 
-            ac);
-        XtManageChild(pushButton_open_mb);
-        
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-    
-    XtAddCallback(pushButton_open_mb, XmNactivateCallback, BxManageCB, (XtPointer)"bulletinBoard_fileselect");
-    XtAddCallback(pushButton_open_mb, XmNactivateCallback, do_io_mode_mb, (XtPointer)0);
-    XtAddCallback(pushButton_open_mb, XmNactivateCallback, BxManageCB, (XtPointer)"label_mbformat");
-    XtAddCallback(pushButton_open_mb, XmNactivateCallback, BxManageCB, (XtPointer)"textField_mbformat");
-    XtAddCallback(pushButton_open_mb, XmNactivateCallback, BxSetValuesCB, (XtPointer)"xmDialogShell_fileselect.title=Open Swath Sonar Data");
-    
-    ac = 0;
-    separator3 = XmCreateSeparator(pulldownMenu_file,
-        (char *)"separator3",
-        args, 
-        ac);
-    XtManageChild(separator3);
-    
-    ac = 0;
-    {
-        XmString    tmp0;
-        
-        tmp0 = (XmString) BX_CONVERT(pulldownMenu_file, (char *)"Save swath svp file", 
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNsensitive, False); ac++;
-        XtSetArg(args[ac], XmNfontList, 
-            BX_CONVERT(pulldownMenu_file, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_save_svpfile = XmCreatePushButton(pulldownMenu_file,
-            (char *)"pushButton_save_svpfile",
-            args, 
-            ac);
-        XtManageChild(pushButton_save_svpfile);
-        
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-    
-    XtAddCallback(pushButton_save_svpfile, XmNactivateCallback, do_save_swath_svp, (XtPointer)0);
-    
-    ac = 0;
-    {
-        XmString    tmp0;
-        
-        tmp0 = (XmString) BX_CONVERT(pulldownMenu_file, (char *)"Save residuals as offsets", 
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList, 
-            BX_CONVERT(pulldownMenu_file, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_save_residuals = XmCreatePushButton(pulldownMenu_file,
-            (char *)"pushButton_save_residuals",
-            args, 
-            ac);
-        XtManageChild(pushButton_save_residuals);
-        
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-    
-    XtAddCallback(pushButton_save_residuals, XmNactivateCallback, do_save_residuals, (XtPointer)0);
-    
-    ac = 0;
-    XtSetArg(args[ac], XmNsubMenuId, pulldownMenu_file); ac++;
-    XtSetValues(cascadeButton_file, args, ac);
-    
-    ac = 0;
-    {
-        XmString    tmp0;
-        
-        tmp0 = (XmString) BX_CONVERT(input_screen, (char *)"About", 
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 930); ac++;
-        XtSetArg(args[ac], XmNy, 0); ac++;
-        XtSetArg(args[ac], XmNwidth, 80); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList, 
-            BX_CONVERT(input_screen, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_about = XmCreatePushButton(input_screen,
-            (char *)"pushButton_about",
-            args, 
-            ac);
-        XtManageChild(pushButton_about);
-        
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-    
-    XtAddCallback(pushButton_about, XmNactivateCallback, BxManageCB, (XtPointer)"bulletinBoard_about");
-    
-    ac = 0;
-    {
-        XmString    tmp0;
-        
-        tmp0 = (XmString) BX_CONVERT(input_screen, (char *)"Quit", 
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 700); ac++;
-        XtSetArg(args[ac], XmNy, 0); ac++;
-        XtSetArg(args[ac], XmNwidth, 80); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList, 
-            BX_CONVERT(input_screen, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_quit = XmCreatePushButton(input_screen,
-            (char *)"pushButton_quit",
-            args, 
-            ac);
-        XtManageChild(pushButton_quit);
-        
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-    
-    XtAddCallback(pushButton_quit, XmNactivateCallback, do_quit, (XtPointer)0);
-    
-    ac = 0;
-    {
-        XmString    tmp0;
-        
-        tmp0 = (XmString) BX_CONVERT(input_screen, (char *)"Reprocess", 
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 520); ac++;
-        XtSetArg(args[ac], XmNy, 0); ac++;
-        XtSetArg(args[ac], XmNwidth, 90); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList, 
-            BX_CONVERT(input_screen, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_process = XmCreatePushButton(input_screen,
-            (char *)"pushButton_process",
-            args, 
-            ac);
-        XtManageChild(pushButton_process);
-        
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-    
-    XtAddCallback(pushButton_process, XmNactivateCallback, do_process_mb, (XtPointer)0);
-    
-    ac = 0;
-    XtSetArg(args[ac], XmNborderWidth, 1); ac++;
-    XtSetArg(args[ac], XmNbackground, 
-        BX_CONVERT(input_screen, (char *)"white", 
-        XmRPixel, 0, &argok)); if (argok) ac++;
-    XtSetArg(args[ac], XmNx, 0); ac++;
-    XtSetArg(args[ac], XmNy, 100); ac++;
-    XtSetArg(args[ac], XmNwidth, 1010); ac++;
-    XtSetArg(args[ac], XmNheight, 560); ac++;
-    drawingArea = XmCreateDrawingArea(input_screen,
-        (char *)"drawingArea",
-        args, 
-        ac);
-    XtManageChild(drawingArea);
-    XtAddCallback(drawingArea, XmNinputCallback, do_canvas_event, (XtPointer)0);
-    XtAddCallback(drawingArea, XmNexposeCallback, do_expose, (XtPointer)0);
-    
-    ac = 0;
-    {
-        XmString    tmp0;
-        
-        tmp0 = (XmString) BX_CONVERT(input_screen, (char *)"No Display Sound Velocity Profiles Loaded", 
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNx, 0); ac++;
-        XtSetArg(args[ac], XmNy, 40); ac++;
-        XtSetArg(args[ac], XmNwidth, 1010); ac++;
-        XtSetArg(args[ac], XmNfontList, 
-            BX_CONVERT(input_screen, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        label_status_display = XmCreateLabel(input_screen,
-            (char *)"label_status_display",
-            args, 
-            ac);
-        XtManageChild(label_status_display);
-        
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-    
-    
-    ac = 0;
-    {
-        XmString    tmp0;
-        
-        tmp0 = (XmString) BX_CONVERT(input_screen, (char *)"No Editable Sound Velocity Profile Loaded", 
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNx, 0); ac++;
-        XtSetArg(args[ac], XmNy, 60); ac++;
-        XtSetArg(args[ac], XmNwidth, 1010); ac++;
-        XtSetArg(args[ac], XmNfontList, 
-            BX_CONVERT(input_screen, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        label_status_edit = XmCreateLabel(input_screen,
-            (char *)"label_status_edit",
-            args, 
-            ac);
-        XtManageChild(label_status_edit);
-        
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-    
-    
-    ac = 0;
-    {
-        XmString    tmp0;
-        
-        tmp0 = (XmString) BX_CONVERT(input_screen, (char *)"No MultiBeam Data Loaded", 
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNx, 0); ac++;
-        XtSetArg(args[ac], XmNy, 80); ac++;
-        XtSetArg(args[ac], XmNwidth, 1010); ac++;
-        XtSetArg(args[ac], XmNfontList, 
-            BX_CONVERT(input_screen, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        label_status_mb = XmCreateLabel(input_screen,
-            (char *)"label_status_mb",
-            args, 
-            ac);
-        XtManageChild(label_status_mb);
-        
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-    
-    
-    ac = 0;
-    XtSetArg(args[ac], XmNtitle, "About MBedit"); ac++;
-    XtSetArg(args[ac], XmNdeleteResponse, XmUNMAP); ac++;
-    XtSetArg(args[ac], XmNwidth, 481); ac++;
-    XtSetArg(args[ac], XmNheight, 456); ac++;
-    xmDialogShell_about = XmCreateDialogShell(window_mbvelocity,
-        (char *)"xmDialogShell_about",
-        args, 
-        ac);
-    
-    ac = 0;
-    XtSetArg(args[ac], XmNresizePolicy, XmRESIZE_GROW); ac++;
-    XtSetArg(args[ac], XmNx, 542); ac++;
-    XtSetArg(args[ac], XmNy, 288); ac++;
-    XtSetArg(args[ac], XmNwidth, 481); ac++;
-    XtSetArg(args[ac], XmNheight, 456); ac++;
-    bulletinBoard_about = XtCreateWidget((char *)"bulletinBoard_about",
-        xmBulletinBoardWidgetClass,
-        xmDialogShell_about,
-        args, 
-        ac);
-    
-    ac = 0;
-    {
-        XmString    tmp0;
-        
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_about, (char *)"David W. Caress    and    Dale N. Chayes", 
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList, 
-            BX_CONVERT(bulletinBoard_about, (char *)"-*-"SERIF"-bold-r-*-*-*-140-*-*-*-*-iso8859-1", 
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 260); ac++;
-        XtSetArg(args[ac], XmNwidth, 460); ac++;
-        XtSetArg(args[ac], XmNheight, 20); ac++;
-        label_about_create1 = XmCreateLabel(bulletinBoard_about,
-            (char *)"label_about_create1",
-            args, 
-            ac);
-        XtManageChild(label_about_create1);
-        
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-    
-    
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 10); ac++;
-    XtSetArg(args[ac], XmNy, 220); ac++;
-    XtSetArg(args[ac], XmNwidth, 460); ac++;
-    XtSetArg(args[ac], XmNheight, 20); ac++;
-    separator2 = XmCreateSeparator(bulletinBoard_about,
-        (char *)"separator2",
-        args, 
-        ac);
-    XtManageChild(separator2);
-    
-    ac = 0;
-    {
-        XmString    tmp0;
-        
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_about, (char *)"Dismiss", 
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList, 
-            BX_CONVERT(bulletinBoard_about, (char *)"-*-"SERIF"-bold-r-*-*-*-140-*-*-*-*-iso8859-1", 
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 200); ac++;
-        XtSetArg(args[ac], XmNy, 410); ac++;
-        XtSetArg(args[ac], XmNwidth, 80); ac++;
-        XtSetArg(args[ac], XmNheight, 35); ac++;
-        pushButton_about_dismiss = XmCreatePushButton(bulletinBoard_about,
-            (char *)"pushButton_about_dismiss",
-            args, 
-            ac);
-        XtManageChild(pushButton_about_dismiss);
-        
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-    
-    XtAddCallback(pushButton_about_dismiss, XmNactivateCallback, BxUnmanageCB, (XtPointer)"bulletinBoard_about");
-    
-    ac = 0;
-    {
-        XmString    tmp0;
-        
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_about, (char *)"Created by:", 
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList, 
-            BX_CONVERT(bulletinBoard_about, (char *)"-*-"SERIF"-bold-r-*-*-*-140-*-*-*-*-iso8859-1", 
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 240); ac++;
-        XtSetArg(args[ac], XmNwidth, 460); ac++;
-        XtSetArg(args[ac], XmNheight, 20); ac++;
-        label_about_create = XmCreateLabel(bulletinBoard_about,
-            (char *)"label_about_create",
-            args, 
-            ac);
-        XtManageChild(label_about_create);
-        
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-    
-    
-    ac = 0;
-    {
-        XmString    tmp0;
-        
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_about, (char *)":::t\"Lamont-Doherty\":t\"Earth Observatory\"\"of Columbia University\"", 
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList, 
-            BX_CONVERT(bulletinBoard_about, (char *)"-*-"SERIF"-bold-r-*-*-*-120-*-*-*-*-iso8859-1", 
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 250); ac++;
-        XtSetArg(args[ac], XmNy, 280); ac++;
-        XtSetArg(args[ac], XmNwidth, 180); ac++;
-        XtSetArg(args[ac], XmNheight, 60); ac++;
-        label_about_lamont = XmCreateLabel(bulletinBoard_about,
-            (char *)"label_about_lamont",
-            args, 
-            ac);
-        XtManageChild(label_about_lamont);
-        
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-    
-    
-    ac = 0;
-    {
-        XmString    tmp0;
-        
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_about, (char *)":::t\"Monterey Bay\":t\"Aquarium\"\"Research Institute\"", 
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList, 
-            BX_CONVERT(bulletinBoard_about, (char *)"-*-"SERIF"-bold-r-*-*-*-120-*-*-*-*-iso8859-1", 
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 70); ac++;
-        XtSetArg(args[ac], XmNy, 280); ac++;
-        XtSetArg(args[ac], XmNwidth, 140); ac++;
-        XtSetArg(args[ac], XmNheight, 60); ac++;
-        label_about_columbia = XmCreateLabel(bulletinBoard_about,
-            (char *)"label_about_columbia",
-            args, 
-            ac);
-        XtManageChild(label_about_columbia);
-        
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-    
-    
-    ac = 0;
-    {
-        XmString    tmp0;
-        
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_about, (char *)"MB-System", 
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList, 
-            BX_CONVERT(bulletinBoard_about, (char *)"-*-"SERIF"-bold-r-*-*-*-240-*-*-*-*-iso8859-1", 
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 120); ac++;
-        XtSetArg(args[ac], XmNwidth, 450); ac++;
-        XtSetArg(args[ac], XmNheight, 38); ac++;
-        label_about_mbsystem = XmCreateLabel(bulletinBoard_about,
-            (char *)"label_about_mbsystem",
-            args, 
-            ac);
-        XtManageChild(label_about_mbsystem);
-        
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-    
-    
-    ac = 0;
-    {
-        XmString    tmp0;
-        
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_about, (char *)"An Open Source Software Package", 
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList, 
-            BX_CONVERT(bulletinBoard_about, (char *)"-*-"SERIF"-bold-r-*-*-*-140-*-*-*-*-iso8859-1", 
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 160); ac++;
-        XtSetArg(args[ac], XmNwidth, 450); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        label_about_mbpub = XmCreateLabel(bulletinBoard_about,
-            (char *)"label_about_mbpub",
-            args, 
-            ac);
-        XtManageChild(label_about_mbpub);
-        
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-    
-    
-    ac = 0;
-    {
-        XmString    tmp0;
-        
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_about, (char *)"One Component of the", 
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList, 
-            BX_CONVERT(bulletinBoard_about, (char *)"-*-"SERIF"-bold-r-*-*-*-140-*-*-*-*-iso8859-1", 
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 90); ac++;
-        XtSetArg(args[ac], XmNwidth, 450); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        label_about_component = XmCreateLabel(bulletinBoard_about,
-            (char *)"label_about_component",
-            args, 
-            ac);
-        XtManageChild(label_about_component);
-        
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-    
-    
-    ac = 0;
-    {
-        XmString    tmp0;
-        
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_about, (char *)"for Processing and Display of Swath Sonar Data", 
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList, 
-            BX_CONVERT(bulletinBoard_about, (char *)"-*-"SERIF"-bold-r-*-*-*-140-*-*-*-*-iso8859-1", 
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 190); ac++;
-        XtSetArg(args[ac], XmNwidth, 460); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        label_about_for = XmCreateLabel(bulletinBoard_about,
-            (char *)"label_about_for",
-            args, 
-            ac);
-        XtManageChild(label_about_for);
-        
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-    
-    
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 10); ac++;
-    XtSetArg(args[ac], XmNy, 70); ac++;
-    XtSetArg(args[ac], XmNwidth, 460); ac++;
-    XtSetArg(args[ac], XmNheight, 20); ac++;
-    separator = XmCreateSeparator(bulletinBoard_about,
-        (char *)"separator",
-        args, 
-        ac);
-    XtManageChild(separator);
-    
-    ac = 0;
-    {
-        XmString    tmp0;
-        
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_about, (char *)":::t\"MB-System Release 4.6\"\"April 14, 1999\"", 
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList, 
-            BX_CONVERT(bulletinBoard_about, (char *)"-*-"SERIF"-medium-r-*-*-*-140-*-*-*-*-iso8859-1", 
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 350); ac++;
-        XtSetArg(args[ac], XmNwidth, 460); ac++;
-        XtSetArg(args[ac], XmNheight, 60); ac++;
-        label_about_version = XmCreateLabel(bulletinBoard_about,
-            (char *)"label_about_version",
-            args, 
-            ac);
-        XtManageChild(label_about_version);
-        
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-    
-    
-    ac = 0;
-    {
-        XmString    tmp0;
-        
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_about, (char *)"Interactive SVP Modeler/Editor", 
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList, 
-            BX_CONVERT(bulletinBoard_about, (char *)"-*-"SERIF"-bold-r-*-*-*-180-*-*-*-*-iso8859-1", 
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 40); ac++;
-        XtSetArg(args[ac], XmNwidth, 460); ac++;
-        XtSetArg(args[ac], XmNheight, 23); ac++;
-        label_about_function = XmCreateLabel(bulletinBoard_about,
-            (char *)"label_about_function",
-            args, 
-            ac);
-        XtManageChild(label_about_function);
-        
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-    
-    
-    ac = 0;
-    {
-        XmString    tmp0;
-        
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_about, (char *)"MBvelocitytool", 
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList, 
-            BX_CONVERT(bulletinBoard_about, (char *)"-*-"SERIF"-bold-r-*-*-*-240-*-*-*-*-iso8859-1", 
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 10); ac++;
-        XtSetArg(args[ac], XmNwidth, 460); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        label_about_mbedit = XmCreateLabel(bulletinBoard_about,
-            (char *)"label_about_mbedit",
-            args, 
-            ac);
-        XtManageChild(label_about_mbedit);
-        
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-    
-    
-    ac = 0;
-    XtSetArg(args[ac], XmNtitle, "Please Wait..."); ac++;
-    XtSetArg(args[ac], XmNmwmInputMode, MWM_INPUT_MODELESS); ac++;
-    XtSetArg(args[ac], XmNdeleteResponse, XmUNMAP); ac++;
-    XtSetArg(args[ac], XmNwidth, 379); ac++;
-    XtSetArg(args[ac], XmNheight, 88); ac++;
-    xmDialogShell_message = XmCreateDialogShell(window_mbvelocity,
-        (char *)"xmDialogShell_message",
-        args, 
-        ac);
-    
-    ac = 0;
-    XtSetArg(args[ac], XmNdialogStyle, XmDIALOG_FULL_APPLICATION_MODAL); ac++;
-    XtSetArg(args[ac], XmNresizePolicy, XmRESIZE_NONE); ac++;
-    XtSetArg(args[ac], XmNx, 1001); ac++;
-    XtSetArg(args[ac], XmNy, 467); ac++;
-    XtSetArg(args[ac], XmNwidth, 379); ac++;
-    XtSetArg(args[ac], XmNheight, 88); ac++;
-    bulletinBoard_message = XtCreateWidget((char *)"bulletinBoard_message",
-        xmBulletinBoardWidgetClass,
-        xmDialogShell_message,
-        args, 
-        ac);
-    
-    ac = 0;
-    {
-        XmString    tmp0;
-        
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_message, (char *)"Thank you for your patience.", 
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 40); ac++;
-        XtSetArg(args[ac], XmNwidth, 360); ac++;
-        XtSetArg(args[ac], XmNheight, 20); ac++;
-        XtSetArg(args[ac], XmNfontList, 
-            BX_CONVERT(bulletinBoard_message, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        label_pleasewait = XmCreateLabel(bulletinBoard_message,
-            (char *)"label_pleasewait",
-            args, 
-            ac);
-        XtManageChild(label_pleasewait);
-        
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-    
-    
-    ac = 0;
-    {
-        XmString    tmp0;
-        
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_message, (char *)"MBvelocitytool is loading data...", 
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 10); ac++;
-        XtSetArg(args[ac], XmNwidth, 360); ac++;
-        XtSetArg(args[ac], XmNheight, 20); ac++;
-        XtSetArg(args[ac], XmNfontList, 
-            BX_CONVERT(bulletinBoard_message, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        label_message = XmCreateLabel(bulletinBoard_message,
-            (char *)"label_message",
-            args, 
-            ac);
-        XtManageChild(label_message);
-        
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-    
-    
-    ac = 0;
-    XtSetArg(args[ac], XmNtitle, "Open Swath Sonar Data"); ac++;
-    XtSetArg(args[ac], XmNwidth, 591); ac++;
-    XtSetArg(args[ac], XmNheight, 537); ac++;
-    xmDialogShell_fileselect = XmCreateDialogShell(window_mbvelocity,
-        (char *)"xmDialogShell_fileselect",
-        args, 
-        ac);
-    
-    ac = 0;
-    XtSetArg(args[ac], XmNautoUnmanage, False); ac++;
-    XtSetArg(args[ac], XmNresizePolicy, XmRESIZE_GROW); ac++;
-    XtSetArg(args[ac], XmNx, 512); ac++;
-    XtSetArg(args[ac], XmNy, 316); ac++;
-    XtSetArg(args[ac], XmNwidth, 591); ac++;
-    XtSetArg(args[ac], XmNheight, 537); ac++;
-    bulletinBoard_fileselect = XtCreateWidget((char *)"bulletinBoard_fileselect",
-        xmBulletinBoardWidgetClass,
-        xmDialogShell_fileselect,
-        args, 
-        ac);
-    
-    ac = 0;
-    {
-        XmString    tmp0;
-        
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_fileselect, (char *)"Swath Sonar Format ID:", 
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 20); ac++;
-        XtSetArg(args[ac], XmNy, 490); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList, 
-            BX_CONVERT(bulletinBoard_fileselect, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        label_mbformat = XmCreateLabel(bulletinBoard_fileselect,
-            (char *)"label_mbformat",
-            args, 
-            ac);
-        XtManageChild(label_mbformat);
-        
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-    
-    
-    ac = 0;
-    XtSetArg(args[ac], XmNborderWidth, 1); ac++;
-    XtSetArg(args[ac], XmNvalue, "1"); ac++;
-    XtSetArg(args[ac], XmNcolumns, 5); ac++;
-    XtSetArg(args[ac], XmNmaxLength, 5); ac++;
-    XtSetArg(args[ac], XmNresizeWidth, False); ac++;
-    XtSetArg(args[ac], XmNcursorPosition, 1); ac++;
-    XtSetArg(args[ac], XmNhighlightOnEnter, False); ac++;
-    XtSetArg(args[ac], XmNmarginHeight, 2); ac++;
-    XtSetArg(args[ac], XmNshadowThickness, 0); ac++;
-    XtSetArg(args[ac], XmNhighlightThickness, 0); ac++;
-    XtSetArg(args[ac], XmNmarginWidth, 2); ac++;
-    XtSetArg(args[ac], XmNx, 210); ac++;
-    XtSetArg(args[ac], XmNy, 490); ac++;
-    XtSetArg(args[ac], XmNheight, 30); ac++;
-    XtSetArg(args[ac], XmNfontList, 
-        BX_CONVERT(bulletinBoard_fileselect, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
-        XmRFontList, 0, &argok)); if (argok) ac++;
-    textField_mbformat = XmCreateTextField(bulletinBoard_fileselect,
-        (char *)"textField_mbformat",
-        args, 
-        ac);
-    XtManageChild(textField_mbformat);
-    
-    ac = 0;
-    XtSetArg(args[ac], XmNmarginHeight, 2); ac++;
-    XtSetArg(args[ac], XmNmarginWidth, 2); ac++;
-    XtSetArg(args[ac], XmNresizePolicy, XmRESIZE_GROW); ac++;
-    XtSetArg(args[ac], XmNx, 10); ac++;
-    XtSetArg(args[ac], XmNy, 10); ac++;
-    XtSetArg(args[ac], XmNwidth, 570); ac++;
-    XtSetArg(args[ac], XmNheight, 470); ac++;
-    fileSelectionBox = XmCreateFileSelectionBox(bulletinBoard_fileselect,
-        (char *)"fileSelectionBox",
-        args, 
-        ac);
-    XtManageChild(fileSelectionBox);
-    XtAddCallback(fileSelectionBox, XmNokCallback, do_open, (XtPointer)0);
-    XtAddCallback(fileSelectionBox, XmNokCallback, BxUnmanageCB, (XtPointer)"bulletinBoard_fileselect");
-    XtAddCallback(fileSelectionBox, XmNcancelCallback, BxUnmanageCB, (XtPointer)"bulletinBoard_fileselect");
-    
-    ac = 0;
-    XtSetArg(args[ac], XmNtitle, "Error"); ac++;
-    XtSetArg(args[ac], XmNwidth, 311); ac++;
-    XtSetArg(args[ac], XmNheight, 161); ac++;
-    xmDialogShell_error = XmCreateDialogShell(window_mbvelocity,
-        (char *)"xmDialogShell_error",
-        args, 
-        ac);
-    
-    ac = 0;
-    XtSetArg(args[ac], XmNdialogStyle, XmDIALOG_APPLICATION_MODAL); ac++;
-    XtSetArg(args[ac], XmNresizePolicy, XmRESIZE_GROW); ac++;
-    XtSetArg(args[ac], XmNx, 888); ac++;
-    XtSetArg(args[ac], XmNy, 511); ac++;
-    XtSetArg(args[ac], XmNwidth, 311); ac++;
-    XtSetArg(args[ac], XmNheight, 161); ac++;
-    bulletinBoard_error = XtCreateWidget((char *)"bulletinBoard_error",
-        xmBulletinBoardWidgetClass,
-        xmDialogShell_error,
-        args, 
-        ac);
-    
-    ac = 0;
-    {
-        XmString    tmp0;
-        
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_error, (char *)"You probably do not have write", 
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 40); ac++;
-        XtSetArg(args[ac], XmNwidth, 290); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList, 
-            BX_CONVERT(bulletinBoard_error, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        label_error_two = XmCreateLabel(bulletinBoard_error,
-            (char *)"label_error_two",
-            args, 
-            ac);
-        XtManageChild(label_error_two);
-        
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-    
-    
-    ac = 0;
-    {
-        XmString    tmp0;
-        
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_error, (char *)"Unable to open output file.", 
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 10); ac++;
-        XtSetArg(args[ac], XmNwidth, 290); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList, 
-            BX_CONVERT(bulletinBoard_error, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        label_error_one = XmCreateLabel(bulletinBoard_error,
-            (char *)"label_error_one",
-            args, 
-            ac);
-        XtManageChild(label_error_one);
-        
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-    
-    
-    ac = 0;
-    {
-        XmString    tmp0;
-        
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_error, (char *)"permission in this directory!", 
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 70); ac++;
-        XtSetArg(args[ac], XmNwidth, 290); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList, 
-            BX_CONVERT(bulletinBoard_error, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        label_error_three = XmCreateLabel(bulletinBoard_error,
-            (char *)"label_error_three",
-            args, 
-            ac);
-        XtManageChild(label_error_three);
-        
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-    
-    
-    ac = 0;
-    {
-        XmString    tmp0;
-        
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_error, (char *)"OK", 
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 110); ac++;
-        XtSetArg(args[ac], XmNy, 110); ac++;
-        XtSetArg(args[ac], XmNwidth, 90); ac++;
-        XtSetArg(args[ac], XmNheight, 40); ac++;
-        XtSetArg(args[ac], XmNfontList, 
-            BX_CONVERT(bulletinBoard_error, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_error = XmCreatePushButton(bulletinBoard_error,
-            (char *)"pushButton_error",
-            args, 
-            ac);
-        XtManageChild(pushButton_error);
-        
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-    
-    
-    ac = 0;
-    XtSetArg(args[ac], XmNtitle, "Plot Scaling"); ac++;
-    XtSetArg(args[ac], XmNwidth, 543); ac++;
-    XtSetArg(args[ac], XmNheight, 220); ac++;
-    xmDialogShell_scaling = XmCreateDialogShell(window_mbvelocity,
-        (char *)"xmDialogShell_scaling",
-        args, 
-        ac);
-    
-    ac = 0;
-    XtSetArg(args[ac], XmNresizePolicy, XmRESIZE_GROW); ac++;
-    XtSetArg(args[ac], XmNx, 143); ac++;
-    XtSetArg(args[ac], XmNy, 513); ac++;
-    XtSetArg(args[ac], XmNwidth, 543); ac++;
-    XtSetArg(args[ac], XmNheight, 220); ac++;
-    bulletinBoard_scaling = XtCreateWidget((char *)"bulletinBoard_scaling",
-        xmBulletinBoardWidgetClass,
-        xmDialogShell_scaling,
-        args, 
-        ac);
-    
-    ac = 0;
-    {
-        XmString    tmp0;
-        
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_scaling, (char *)"1700", 
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
-        XtSetArg(args[ac], XmNx, 470); ac++;
-        XtSetArg(args[ac], XmNy, 90); ac++;
-        XtSetArg(args[ac], XmNwidth, 50); ac++;
-        XtSetArg(args[ac], XmNheight, 20); ac++;
-        XtSetArg(args[ac], XmNfontList, 
-            BX_CONVERT(bulletinBoard_scaling, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        label_vel_center_max = XmCreateLabel(bulletinBoard_scaling,
-            (char *)"label_vel_center_max",
-            args, 
-            ac);
-        XtManageChild(label_vel_center_max);
-        
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-    
-    
-    ac = 0;
-    {
-        XmString    tmp0;
-        
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_scaling, (char *)"Velocity Center (m/s): 1300", 
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 90); ac++;
-        XtSetArg(args[ac], XmNfontList, 
-            BX_CONVERT(bulletinBoard_scaling, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        label_velcenter = XmCreateLabel(bulletinBoard_scaling,
-            (char *)"label_velcenter",
-            args, 
-            ac);
-        XtManageChild(label_velcenter);
-        
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-    
-    
-    ac = 0;
-    XtSetArg(args[ac], XmNminimum, 25); ac++;
-    XtSetArg(args[ac], XmNvalue, 500); ac++;
-    XtSetArg(args[ac], XmNmaximum, 1000); ac++;
-    XtSetArg(args[ac], XmNscaleHeight, 15); ac++;
-    XtSetArg(args[ac], XmNshowArrows, TRUE); ac++;
-    XtSetArg(args[ac], XmNscaleMultiple, 1); ac++;
-    XtSetArg(args[ac], XmNshowValue, TRUE); ac++;
-    XtSetArg(args[ac], XmNhighlightThickness, 1); ac++;
-    XtSetArg(args[ac], XmNorientation, XmHORIZONTAL); ac++;
-    XtSetArg(args[ac], XmNx, 200); ac++;
-    XtSetArg(args[ac], XmNy, 80); ac++;
-    XtSetArg(args[ac], XmNwidth, 270); ac++;
-    XtSetArg(args[ac], XmNheight, 34); ac++;
-    XtSetArg(args[ac], XmNfontList, 
-        BX_CONVERT(bulletinBoard_scaling, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
-        XmRFontList, 0, &argok)); if (argok) ac++;
-    slider_velcenter = XmCreateScale(bulletinBoard_scaling,
-        (char *)"slider_velcenter",
-        args, 
-        ac);
-    XtManageChild(slider_velcenter);
-    XtAddCallback(slider_velcenter, XmNvalueChangedCallback, do_velcenter, (XtPointer)0);
-    
-    ac = 0;
-    {
-        XmString    tmp0;
-        
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_scaling, (char *)"Dismiss", 
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 230); ac++;
-        XtSetArg(args[ac], XmNy, 170); ac++;
-        XtSetArg(args[ac], XmNwidth, 90); ac++;
-        XtSetArg(args[ac], XmNheight, 40); ac++;
-        XtSetArg(args[ac], XmNfontList, 
-            BX_CONVERT(bulletinBoard_scaling, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_scaling_dismiss = XmCreatePushButton(bulletinBoard_scaling,
-            (char *)"pushButton_scaling_dismiss",
-            args, 
-            ac);
-        XtManageChild(pushButton_scaling_dismiss);
-        
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-    
-    XtAddCallback(pushButton_scaling_dismiss, XmNactivateCallback, BxUnmanageCB, (XtPointer)"bulletinBoard_scaling");
-    
-    ac = 0;
-    {
-        XmString    tmp0;
-        
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_scaling, (char *)"200", 
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
-        XtSetArg(args[ac], XmNx, 470); ac++;
-        XtSetArg(args[ac], XmNy, 130); ac++;
-        XtSetArg(args[ac], XmNwidth, 50); ac++;
-        XtSetArg(args[ac], XmNheight, 20); ac++;
-        XtSetArg(args[ac], XmNfontList, 
-            BX_CONVERT(bulletinBoard_scaling, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        label_res_range_max = XmCreateLabel(bulletinBoard_scaling,
-            (char *)"label_res_range_max",
-            args, 
-            ac);
-        XtManageChild(label_res_range_max);
-        
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-    
-    
-    ac = 0;
-    {
-        XmString    tmp0;
-        
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_scaling, (char *)"", 
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNtitleString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNminimum, 1); ac++;
-        XtSetArg(args[ac], XmNdecimalPoints, 1); ac++;
-        XtSetArg(args[ac], XmNvalue, 100); ac++;
-        XtSetArg(args[ac], XmNmaximum, 2000); ac++;
-        XtSetArg(args[ac], XmNscaleHeight, 15); ac++;
-        XtSetArg(args[ac], XmNshowArrows, TRUE); ac++;
-        XtSetArg(args[ac], XmNscaleMultiple, 1); ac++;
-        XtSetArg(args[ac], XmNshowValue, TRUE); ac++;
-        XtSetArg(args[ac], XmNhighlightThickness, 1); ac++;
-        XtSetArg(args[ac], XmNorientation, XmHORIZONTAL); ac++;
-        XtSetArg(args[ac], XmNx, 200); ac++;
-        XtSetArg(args[ac], XmNy, 120); ac++;
-        XtSetArg(args[ac], XmNwidth, 270); ac++;
-        XtSetArg(args[ac], XmNheight, 39); ac++;
-        XtSetArg(args[ac], XmNfontList, 
-            BX_CONVERT(bulletinBoard_scaling, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        slider_residual_range = XmCreateScale(bulletinBoard_scaling,
-            (char *)"slider_residual_range",
-            args, 
-            ac);
-        XtManageChild(slider_residual_range);
-        
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-    
-    XtAddCallback(slider_residual_range, XmNvalueChangedCallback, do_residual_range, (XtPointer)0);
-    
-    ac = 0;
-    {
-        XmString    tmp0;
-        
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_scaling, (char *)"Residual Range (m):    1", 
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 130); ac++;
-        XtSetArg(args[ac], XmNfontList, 
-            BX_CONVERT(bulletinBoard_scaling, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        label_residual_range = XmCreateLabel(bulletinBoard_scaling,
-            (char *)"label_residual_range",
-            args, 
-            ac);
-        XtManageChild(label_residual_range);
-        
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-    
-    
-    ac = 0;
-    {
-        XmString    tmp0;
-        
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_scaling, (char *)"1000", 
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
-        XtSetArg(args[ac], XmNx, 470); ac++;
-        XtSetArg(args[ac], XmNy, 50); ac++;
-        XtSetArg(args[ac], XmNwidth, 50); ac++;
-        XtSetArg(args[ac], XmNheight, 20); ac++;
-        XtSetArg(args[ac], XmNfontList, 
-            BX_CONVERT(bulletinBoard_scaling, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        label_vel_range_max = XmCreateLabel(bulletinBoard_scaling,
-            (char *)"label_vel_range_max",
-            args, 
-            ac);
-        XtManageChild(label_vel_range_max);
-        
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-    
-    
-    ac = 0;
-    XtSetArg(args[ac], XmNminimum, 25); ac++;
-    XtSetArg(args[ac], XmNvalue, 500); ac++;
-    XtSetArg(args[ac], XmNmaximum, 1000); ac++;
-    XtSetArg(args[ac], XmNscaleHeight, 15); ac++;
-    XtSetArg(args[ac], XmNshowArrows, TRUE); ac++;
-    XtSetArg(args[ac], XmNscaleMultiple, 1); ac++;
-    XtSetArg(args[ac], XmNshowValue, TRUE); ac++;
-    XtSetArg(args[ac], XmNhighlightThickness, 1); ac++;
-    XtSetArg(args[ac], XmNorientation, XmHORIZONTAL); ac++;
-    XtSetArg(args[ac], XmNx, 200); ac++;
-    XtSetArg(args[ac], XmNy, 40); ac++;
-    XtSetArg(args[ac], XmNwidth, 270); ac++;
-    XtSetArg(args[ac], XmNheight, 34); ac++;
-    XtSetArg(args[ac], XmNfontList, 
-        BX_CONVERT(bulletinBoard_scaling, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
-        XmRFontList, 0, &argok)); if (argok) ac++;
-    slider_velrange = XmCreateScale(bulletinBoard_scaling,
-        (char *)"slider_velrange",
-        args, 
-        ac);
-    XtManageChild(slider_velrange);
-    XtAddCallback(slider_velrange, XmNvalueChangedCallback, do_velrange, (XtPointer)0);
-    
-    ac = 0;
-    {
-        XmString    tmp0;
-        
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_scaling, (char *)"Velocity Range (m/s): 25", 
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 50); ac++;
-        XtSetArg(args[ac], XmNfontList, 
-            BX_CONVERT(bulletinBoard_scaling, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        label_velrange = XmCreateLabel(bulletinBoard_scaling,
-            (char *)"label_velrange",
-            args, 
-            ac);
-        XtManageChild(label_velrange);
-        
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-    
-    
-    ac = 0;
-    {
-        XmString    tmp0;
-        
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_scaling, (char *)"13000", 
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
-        XtSetArg(args[ac], XmNx, 470); ac++;
-        XtSetArg(args[ac], XmNy, 10); ac++;
-        XtSetArg(args[ac], XmNwidth, 50); ac++;
-        XtSetArg(args[ac], XmNheight, 20); ac++;
-        XtSetArg(args[ac], XmNfontList, 
-            BX_CONVERT(bulletinBoard_scaling, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        label_max_depth_max = XmCreateLabel(bulletinBoard_scaling,
-            (char *)"label_max_depth_max",
-            args, 
-            ac);
-        XtManageChild(label_max_depth_max);
-        
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-    
-    
-    ac = 0;
-    XtSetArg(args[ac], XmNminimum, 1); ac++;
-    XtSetArg(args[ac], XmNvalue, 3000); ac++;
-    XtSetArg(args[ac], XmNmaximum, 13000); ac++;
-    XtSetArg(args[ac], XmNscaleHeight, 15); ac++;
-    XtSetArg(args[ac], XmNshowArrows, TRUE); ac++;
-    XtSetArg(args[ac], XmNscaleMultiple, 1); ac++;
-    XtSetArg(args[ac], XmNshowValue, TRUE); ac++;
-    XtSetArg(args[ac], XmNhighlightThickness, 1); ac++;
-    XtSetArg(args[ac], XmNorientation, XmHORIZONTAL); ac++;
-    XtSetArg(args[ac], XmNx, 200); ac++;
-    XtSetArg(args[ac], XmNy, 10); ac++;
-    XtSetArg(args[ac], XmNwidth, 270); ac++;
-    XtSetArg(args[ac], XmNheight, 34); ac++;
-    XtSetArg(args[ac], XmNfontList, 
-        BX_CONVERT(bulletinBoard_scaling, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
-        XmRFontList, 0, &argok)); if (argok) ac++;
-    slider_maxdepth = XmCreateScale(bulletinBoard_scaling,
-        (char *)"slider_maxdepth",
-        args, 
-        ac);
-    XtManageChild(slider_maxdepth);
-    XtAddCallback(slider_maxdepth, XmNvalueChangedCallback, do_maxdepth, (XtPointer)0);
-    
-    ac = 0;
-    {
-        XmString    tmp0;
-        
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_scaling, (char *)"Maximum Depth (m):     1", 
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 10); ac++;
-        XtSetArg(args[ac], XmNfontList, 
-            BX_CONVERT(bulletinBoard_scaling, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        label_max_depth = XmCreateLabel(bulletinBoard_scaling,
-            (char *)"label_max_depth",
-            args, 
-            ac);
-        XtManageChild(label_max_depth);
-        
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-    
-    
-    ac = 0;
-    XtSetArg(args[ac], XmNtitle, "Beam Angle Mode"); ac++;
-    XtSetArg(args[ac], XmNwidth, 348); ac++;
-    XtSetArg(args[ac], XmNheight, 172); ac++;
-    dialogShell_mode = XmCreateDialogShell(window_mbvelocity,
-        (char *)"dialogShell_mode",
-        args, 
-        ac);
-    
-    ac = 0;
-    {
-        XmString    tmp0;
-        
-        tmp0 = (XmString) BX_CONVERT(dialogShell_mode, (char *)"Beam Angle Mode", 
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNdialogTitle, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNautoUnmanage, False); ac++;
-        XtSetArg(args[ac], XmNresizePolicy, XmRESIZE_GROW); ac++;
-        XtSetArg(args[ac], XmNx, 875); ac++;
-        XtSetArg(args[ac], XmNy, 481); ac++;
-        XtSetArg(args[ac], XmNwidth, 348); ac++;
-        XtSetArg(args[ac], XmNheight, 172); ac++;
-        bulletinBoard_mode = XtCreateWidget((char *)"bulletinBoard_mode",
-            xmBulletinBoardWidgetClass,
-            dialogShell_mode,
-            args, 
-            ac);
-        
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-    
-    
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 20); ac++;
-    XtSetArg(args[ac], XmNy, 10); ac++;
-    XtSetArg(args[ac], XmNwidth, 293); ac++;
-    XtSetArg(args[ac], XmNheight, 96); ac++;
-    XtSetArg(args[ac], XmNisHomogeneous, False); ac++;
-    radioBox_mode = XmCreateRadioBox(bulletinBoard_mode,
-        (char *)"radioBox_mode",
-        args, 
-        ac);
-    XtManageChild(radioBox_mode);
-    
-    ac = 0;
-    {
-        XmString    tmp0;
-        
-        tmp0 = (XmString) BX_CONVERT(radioBox_mode, (char *)"Do Not Change Beam Angles", 
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNwidth, 287); ac++;
-        XtSetArg(args[ac], XmNheight, 28); ac++;
-        XtSetArg(args[ac], XmNfontList, 
-            BX_CONVERT(radioBox_mode, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        toggleButton_mode_ok = XmCreateToggleButton(radioBox_mode,
-            (char *)"toggleButton_mode_ok",
-            args, 
-            ac);
-        XtManageChild(toggleButton_mode_ok);
-        
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-    
-    XtAddCallback(toggleButton_mode_ok, XmNvalueChangedCallback, do_anglemode, (XtPointer)0);
-    
-    ac = 0;
-    {
-        XmString    tmp0;
-        
-        tmp0 = (XmString) BX_CONVERT(radioBox_mode, (char *)"Adjust Angles Using Snell\'s Law", 
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNwidth, 287); ac++;
-        XtSetArg(args[ac], XmNheight, 28); ac++;
-        XtSetArg(args[ac], XmNfontList, 
-            BX_CONVERT(radioBox_mode, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        toggleButton_mode_snell = XmCreateToggleButton(radioBox_mode,
-            (char *)"toggleButton_mode_snell",
-            args, 
-            ac);
-        XtManageChild(toggleButton_mode_snell);
-        
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-    
-    XtAddCallback(toggleButton_mode_snell, XmNvalueChangedCallback, do_anglemode, (XtPointer)0);
-    
-    ac = 0;
-    {
-        XmString    tmp0;
-        
-        tmp0 = (XmString) BX_CONVERT(radioBox_mode, (char *)"Adjust Angles Using Sonar Geometry", 
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNwidth, 287); ac++;
-        XtSetArg(args[ac], XmNheight, 28); ac++;
-        XtSetArg(args[ac], XmNfontList, 
-            BX_CONVERT(radioBox_mode, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        toggleButton_mode_null = XmCreateToggleButton(radioBox_mode,
-            (char *)"toggleButton_mode_null",
-            args, 
-            ac);
-        XtManageChild(toggleButton_mode_null);
-        
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-    
-    XtAddCallback(toggleButton_mode_null, XmNvalueChangedCallback, do_anglemode, (XtPointer)0);
-    
-    ac = 0;
-    {
-        XmString    tmp0;
-        
-        tmp0 = (XmString) BX_CONVERT(bulletinBoard_mode, (char *)"Dismiss", 
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 120); ac++;
-        XtSetArg(args[ac], XmNy, 120); ac++;
-        XtSetArg(args[ac], XmNwidth, 100); ac++;
-        XtSetArg(args[ac], XmNheight, 40); ac++;
-        XtSetArg(args[ac], XmNfontList, 
-            BX_CONVERT(bulletinBoard_mode, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1", 
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        pushButton_mode_dismiss = XmCreatePushButton(bulletinBoard_mode,
-            (char *)"pushButton_mode_dismiss",
-            args, 
-            ac);
-        XtManageChild(pushButton_mode_dismiss);
-        
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-    
-    XtAddCallback(pushButton_mode_dismiss, XmNactivateCallback, BxUnmanageCB, (XtPointer)"bulletinBoard_mode");
-    
-    
-    /* Begin user code block <end_Createwindow_mbvelocity> */
-    /* End user code block <end_Createwindow_mbvelocity> */
-    return( window_mbvelocity );
-}
diff --git a/src/mbvelocitytool/mbvelocity_creation.h b/src/mbvelocitytool/mbvelocity_creation.h
deleted file mode 100644
index 9b6ad97..0000000
--- a/src/mbvelocitytool/mbvelocity_creation.h
+++ /dev/null
@@ -1,67 +0,0 @@
-
-/* Begin user code block <abstract> */
-/* End user code block <abstract> */
-
-/**
- * WARNING: This file is overwritten at code generation time.
- * Any changes to this file will be lost.
- */
-/*
- *
- * Created by BuilderXcessory Version 6.1.3
- * Generated by Code Generator Xcessory 6.1.3 (08/19/04) CGX Scripts 6.1 Motif 2.1 
- *
- */
-#ifndef mbvelocity_creation_H
-#define mbvelocity_creation_H
-
-/*
- * Global widget declarations.
- *        - EXTERNAL is set to extern if the
- *          defs file is not included from the
- *          main file.
- */
-#ifdef DECLARE_BX_GLOBALS
-#define EXTERNAL
-#else
-#define EXTERNAL extern
-#endif
-
-/**
- * Start Global Widget Declarations.
- */
-EXTERNAL Widget   toggleButton_mode_ok;
-EXTERNAL Widget   toggleButton_mode_snell;
-EXTERNAL Widget   toggleButton_mode_null;
-EXTERNAL Widget   label_vel_center_max;
-EXTERNAL Widget   slider_velcenter;
-EXTERNAL Widget   label_res_range_max;
-EXTERNAL Widget   slider_residual_range;
-EXTERNAL Widget   label_vel_range_max;
-EXTERNAL Widget   slider_velrange;
-EXTERNAL Widget   label_max_depth_max;
-EXTERNAL Widget   slider_maxdepth;
-EXTERNAL Widget   bulletinBoard_error;
-EXTERNAL Widget   label_error_two;
-EXTERNAL Widget   label_error_one;
-EXTERNAL Widget   label_error_three;
-EXTERNAL Widget   xmDialogShell_fileselect;
-EXTERNAL Widget   label_mbformat;
-EXTERNAL Widget   textField_mbformat;
-EXTERNAL Widget   fileSelectionBox;
-EXTERNAL Widget   bulletinBoard_message;
-EXTERNAL Widget   label_message;
-EXTERNAL Widget   label_about_version;
-EXTERNAL Widget   pushButton_save_svp;
-EXTERNAL Widget   pushButton_open_mb;
-EXTERNAL Widget   pushButton_save_svpfile;
-EXTERNAL Widget   pushButton_save_residuals;
-EXTERNAL Widget   pushButton_process;
-EXTERNAL Widget   drawingArea;
-EXTERNAL Widget   label_status_display;
-EXTERNAL Widget   label_status_edit;
-EXTERNAL Widget   label_status_mb;
-/**
- * End Global Widget Declarations.
- */
-#endif
diff --git a/src/mbvelocitytool/mbvelocity_prog.c b/src/mbvelocitytool/mbvelocity_prog.c
deleted file mode 100644
index d097d29..0000000
--- a/src/mbvelocitytool/mbvelocity_prog.c
+++ /dev/null
@@ -1,3158 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:    mbvelocitytool.c        6/6/93
- *    $Id: mbvelocity_prog.c 2239 2015-05-07 00:51:42Z caress $
- *
- *    Copyright (c) 1993-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * MBVELOCITYTOOL is an interactive water velocity profile editor
- * used to examine multiple water velocity profiles and to create
- * new water velocity profiles which can be used for the processing
- * of multibeam sonar data.  In general, this tool is used to examine
- * water velocity profiles obtained from XBTs, CTDs, or databases,
- * and to construct new profiles consistent with these various
- * sources of information.
- *
- * Author:      D. W. Caress
- * Date:        June 6, 1993
- *
- *
- */
-
-/*--------------------------------------------------------------------*/
-
-/* standard include files */
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <math.h>
-#include <string.h>
-#include <sys/stat.h>
-#include <time.h>
-#include <X11/Intrinsic.h>
-
-/* MBIO include files */
-#include "mb_format.h"
-#include "mb_status.h"
-#include "mb_define.h"
-#include "mb_io.h"
-#include "mb_swap.h"
-#include "mb_process.h"
-#include "mb_aux.h"
-#include "mb_xgraphics.h"
-#include "mbvelocity.h"
-
-/* id variables */
-static char rcs_id[] = "$Id: mbvelocity_prog.c 2239 2015-05-07 00:51:42Z caress $";
-static char program_name[] = "MBVELOCITYTOOL";
-static char help_message[] = "MBVELOCITYTOOL is an interactive water velocity profile editor  \nused to examine multiple water velocity profiles and to create  \nnew water velocity profiles which can be used for the processing  \nof multibeam sonar data.  In general, this tool is used to  \nexamine water velocity profiles obtained from XBTs, CTDs, or  \ndatabases, and to construct new profiles consistent with these  \nvarious sources of information.";
-static char usage_message[] = "mbvelocitytool [-Byr/mo/da/hr/mn/sc -Eyr/mo/da/hr/mn/sc \n\t-Fformat -Ifile -Ssvpfile -Wsvpfile -V -H]";
-
-/* status variables */
-int	error = MB_ERROR_NO_ERROR;
-int	verbose = 0;
-char	*message = NULL;
-
-/* mbvelocitytool control variables */
-struct profile	profile_display[MAX_PROFILES];
-struct profile	profile_edit;
-int	*edit_x = NULL;
-int	*edit_y = NULL;
-mb_path	editfile;
-int	edit = 0;
-int	ndisplay = 0;
-void	*mbvt_xgid;
-int	borders[4];
-double	maxdepth = 3000.0;
-double	velrange = 500.0;
-double	velcenter = 1490.0;
-double	resrange = 200.0;
-double	ssv_start = 0.0;
-int	anglemode = MBP_ANGLES_SNELL;
-
-/* plotting variables */
-int	xmin, xmax, ymin, ymax;
-double	xminimum, xmaximum, yminimum, ymaximum;
-double	xscale, yscale;
-int	xrmin, xrmax, yrmin, yrmax;
-double	xrminimum, xrmaximum, yrminimum, yrmaximum;
-double	xrscale, yrscale;
-int	xpmin, xpmax, ypmin, ypmax;
-double	xpminimum, xpmaximum, ypminimum, ypmaximum;
-double	xpscale, ypscale;
-int	active = -1;
-
-/* default edit profile */
-int	depthedit[NUM_EDIT_START]
-		    = { 0, 300, 1000,  3000, 7000, 12000 };
-int	veledit[NUM_EDIT_START]
-		    = { 1500, 1500, 1500, 1500, 1500, 1500 };
-
-/* MBIO control parameters */
-int	format;
-int	pings;
-int	lonflip;
-double	bounds[4];
-int	btime_i[7];
-int	etime_i[7];
-double	btime_d;
-double	etime_d;
-double	speedmin;
-double	timegap;
-int	beams_bath;
-int	beams_amp;
-int	pixels_ss;
-mb_path	swathfile;
-void	*mbio_ptr;
-
-/* mbio read and write values */
-void	*store_ptr = NULL;
-int	kind;
-int	id;
-int	nbeams;
-
-/* buffer control variables */
-#define	MBVT_BUFFER_SIZE	25000
-int	nbuffer;
-
-/* survey ping raytracing arrays */
-int	time_i[7];
-double	time_d;
-double	navlon, navlat;
-double	speed, heading;
-int	nbath, namp, nss;
-char	*beamflag = NULL;
-double	*bath = NULL;
-double	*amp = NULL;
-double	*bathacrosstrack = NULL;
-double	*bathalongtrack = NULL;
-double	*ss = NULL;
-double	*ssacrosstrack = NULL;
-double	*ssalongtrack = NULL;
-char	comment[MB_COMMENT_MAXLINE];
-double	*p = NULL;
-int	nraypathmax;
-int	*nraypath = NULL;
-double	**raypathx = NULL;
-double	**raypathy = NULL;
-double	*depth = NULL;
-double	*acrosstrack = NULL;
-double	rayxmax;
-double	raydepthmin;
-double	raydepthmax;
-struct mbvt_ping_struct	ping[MBVT_BUFFER_SIZE];
-
-/* ESF File read */
-char    esffile[MB_PATH_MAXLINE];
-struct  mb_esf_struct esf;
-
-/* depth range variables */
-double	bath_min = 0.0;
-double	bath_max = 0.0;
-
-/* residual variables */
-double	*angle = NULL;
-double	*residual = NULL;
-double	*res_sd = NULL;
-int	*nresidual = NULL;
-
-/* beam range variables */
-int	beam_first = 0;
-int	beam_last = 100;
-
-/* color control values */
-#define	WHITE	0
-#define	BLACK	1
-#define RED	2
-#define GREEN	3
-#define BLUE	4
-#define CORAL	5
-#define	XG_SOLIDLINE	0
-#define	XG_DASHLINE	1
-int	ncolors;
-int	pixel_values[256];
-
-/* system function declarations */
-char	*ctime();
-#ifndef WIN32
-char	*getenv();
-#endif
-
-/*--------------------------------------------------------------------*/
-/* Initialize the 'mbio' struct                                       */
-/* Called by:                                                         */
-/*                  main                                              */
-/* Functions called:                                                  */
-/*                  mb_defaults                                       */
-/* Function returns:                                                  */
-/*                  int status                                        */
-/*--------------------------------------------------------------------*/
-int mbvt_init(int argc, char **argv)
-{
-	/* local variables */
-	char	*function_name = "mbvt_init";
-	int	status = MB_SUCCESS;
-	mb_path	ifile, sfile, wfile;
-	int	i;
-
-	/* parsing variables */
-	extern char *optarg;
-	int	errflg = 0;
-	int	c;
-	int	help = 0;
-	int	flag = 0;
-
-	/* set default values */
-	status = mb_defaults(verbose,&format,&pings,&lonflip,bounds,
-		btime_i,etime_i,&speedmin,&timegap);
-	pings = 1;
-	lonflip = 0;
-	bounds[0] = -360.;
-	bounds[1] = 360.;
-	bounds[2] = -90.;
-	bounds[3] = 90.;
-	btime_i[0] = 1962;
-	btime_i[1] = 2;
-	btime_i[2] = 21;
-	btime_i[3] = 10;
-	btime_i[4] = 30;
-	btime_i[5] = 0;
-	etime_i[0] = 2062;
-	etime_i[1] = 2;
-	etime_i[2] = 21;
-	etime_i[3] = 10;
-	etime_i[4] = 30;
-	etime_i[5] = 0;
-	speedmin = 0.0;
-	timegap = 1000000000.0;
-	nbeams = 16;
-	strcpy(ifile, "\0");
-	strcpy(sfile, "\0");
-	strcpy(wfile, "\0");
-
-	/* process argument list */
-	while ((c = getopt(argc, argv, "B:b:E:e:F:f:I:i:S:s:W:w:VvHh")) != -1)
-	  switch (c)
-		{
-		case 'H':
-		case 'h':
-			help++;
-			break;
-		case 'V':
-		case 'v':
-			verbose++;
-			break;
-		case 'B':
-		case 'b':
-			sscanf (optarg,"%d/%d/%d/%d/%d/%d",
-				&btime_i[0],&btime_i[1],&btime_i[2],
-				&btime_i[3],&btime_i[4],&btime_i[5]);
-			btime_i[6] = 0;
-			flag++;
-			break;
-		case 'E':
-		case 'e':
-			sscanf (optarg,"%d/%d/%d/%d/%d/%d",
-				&etime_i[0],&etime_i[1],&etime_i[2],
-				&etime_i[3],&etime_i[4],&etime_i[5]);
-			etime_i[6] = 0;
-			flag++;
-			break;
-		case 'F':
-		case 'f':
-			sscanf (optarg,"%d", &format);
-			flag++;
-			break;
-		case 'I':
-		case 'i':
-			sscanf (optarg,"%s", ifile);
-			flag++;
-			break;
-		case 'S':
-		case 's':
-			sscanf (optarg,"%s", sfile);
-			flag++;
-			break;
-		case 'W':
-		case 'w':
-			sscanf (optarg,"%s", wfile);
-			flag++;
-			break;
-		case '?':
-			errflg++;
-		}
-
-	/* if error flagged then print it and exit */
-	if (errflg)
-		{
-		fprintf(stderr,"usage: %s\n", usage_message);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		error = MB_ERROR_BAD_USAGE;
-		exit(error);
-		}
-
-	/* print starting message */
-	if (verbose == 1 || help)
-		{
-		fprintf(stderr,"\nProgram %s\n",program_name);
-		fprintf(stderr,"Version %s\n",rcs_id);
-		fprintf(stderr,"MB-system Version %s\n",MB_VERSION);
-		}
-
-	/* print starting debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  Program <%s>\n",program_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Control Parameters:\n");
-		fprintf(stderr,"dbg2       verbose:            %d\n",verbose);
-		fprintf(stderr,"dbg2       help:               %d\n",help);
-		fprintf(stderr,"dbg2       format:             %d\n",format);
-		fprintf(stderr,"dbg2       input file:         %s\n",ifile);
-		fprintf(stderr,"dbg2       display svp file:   %s\n",sfile);
-		fprintf(stderr,"dbg2       edit svp file:      %s\n",wfile);
-		}
-
-	/* if help desired then print it and exit */
-	if (help)
-		{
-		fprintf(stderr,"\n%s\n",help_message);
-		fprintf(stderr,"\nusage: %s\n", usage_message);
-		exit(error);
-		}
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       argc:      %d\n",argc);
-		for (i=0;i<argc;i++)
-			fprintf(stderr,"dbg2       argv[%d]:    %s\n",
-				i,argv[i]);
-		}
-
-	/* if files specified then use them at startup */
-	if (strlen(wfile) > 0
-		|| strlen(sfile) > 0
-		|| strlen(ifile) > 0)
-		{
-	    	if (format == 0 && strlen(ifile) > 0)
-			mb_get_format(verbose,ifile,NULL,&format,&error);
-fprintf(stderr,"calling do_open_commandline: <%s> <%s> <%s> <%d>\n",
-wfile, sfile, ifile, format);
-		do_open_commandline(wfile, sfile, ifile, format);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-/* exits the program - from "QUIT" on menu bar.                       */
-/* Called by:                                                         */
-/*                  mbvelocity_callbacks.c                            */
-/* Functions called:                                                  */
-/*                  mb_free                                           */
-/*                  mb_memory_list                                    */
-/* Function returns:                                                  */
-/*                  int status                                        */
-/*--------------------------------------------------------------------*/
-int mbvt_quit()
-{
-	/* local variables */
-	char	*function_name = "mbvt_quit";
-	int	status;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
-
-	/* deallocate previously loaded data, if any */
-	mbvt_deallocate_swath();
-
-	/* check allocated memory */
-	status = mb_memory_list(verbose,&error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-/* mbvt_set_graphics - sets mbvt_xgrid to a pointer to the display    */
-/*                     and sets borders.                              */
-/* Called by:                                                         */
-/*                  main                                              */
-/* Functions called:                                                  */
-/*                  none                                              */
-/* Function returns:                                                  */
-/*                  int status                                        */
-/*--------------------------------------------------------------------*/
-int mbvt_set_graphics(void *xgid, int *brdr, int ncol, unsigned int *pixels)
-{
-	/* local variables */
-	char	*function_name = "mbvt_set_graphics";
-	int	status = MB_SUCCESS;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       xgid:         %p\n",xgid);
-		for (i=0;i<4;i++)
-			fprintf(stderr,"dbg2       borders[%d]:   %d\n",
-				i,brdr[i]);
-		fprintf(stderr,"dbg2       ncolors:      %d\n",ncol);
-		for (i=0;i<ncol;i++)
-			fprintf(stderr,"dbg2       pixel[%d]:     %d\n",
-				i, pixels[i]);
-		}
-
-	/* set graphics id */
-	mbvt_xgid = xgid;
-
-	/* set graphics bounds */
-	for (i=0;i<4;i++)
-		borders[i] = brdr[i];
-
-	/* set colors */
-	ncolors = ncol;
-	for (i=0;i<ncolors;i++)
-		pixel_values[i] = pixels[i];
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-/* Sets some of the mbio variables                                    */
-/* Called by:                                                         */
-/*                  main                                              */
-/* Functions called:                                                  */
-/*                  none                                              */
-/* Function returns:                                                  */
-/*                  int status                                        */
-/*--------------------------------------------------------------------*/
-int mbvt_get_values(int *s_edit, int *s_ndisplay, double *s_maxdepth,
-	double *s_velrange, double *s_velcenter, double *s_resrange,
-	int *s_anglemode, int *s_format)
-{
-	/* local variables */
-	char	*function_name = "mbvt_get_values";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
-
-	/* set values */
-	*s_edit = edit;
-	*s_ndisplay = ndisplay;
-	*s_maxdepth = maxdepth;
-	*s_velrange = velrange;
-	*s_velcenter = velcenter;
-	*s_resrange = resrange;
-	*s_anglemode = anglemode;
-	*s_format = format;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       s_edit:      %d\n",*s_edit);
-		fprintf(stderr,"dbg2       s_ndisplay:  %d\n",*s_ndisplay);
-		fprintf(stderr,"dbg2       s_maxdepth:  %f\n",*s_maxdepth);
-		fprintf(stderr,"dbg2       s_velrange:  %f\n",*s_velrange);
-		fprintf(stderr,"dbg2       s_velcenter: %f\n",*s_velcenter);
-		fprintf(stderr,"dbg2       s_resrange:  %f\n",*s_resrange);
-		fprintf(stderr,"dbg2       s_anglemode: %d\n",*s_anglemode);
-		fprintf(stderr,"dbg2       s_format:    %d\n",*s_format);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-/* Sets some of the mbio variables.                                   */
-/* Called by:                                                         */
-/*                  action_maxdepth - mbvelocity_callbacks - slider   */
-/*                  action_velrange - mbvelocity_callbacks - slider   */
-/*                  action_velcenter - mbvelocity_callbacks - slider   */
-/*                  action_residual_range - mbvelocity_callbacks      */
-/* Functions called:                                                  */
-/*                  none                                              */
-/* Function returns:                                                  */
-/*                  status                                            */
-/*--------------------------------------------------------------------*/
-int mbvt_set_values(int s_edit, int s_ndisplay,
-		double s_maxdepth, double s_velrange, double s_velcenter,
-		double s_resrange, int s_anglemode)
-{
-	/* local variables */
-	char	*function_name = "mbvt_set_values";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input values:\n");
-		fprintf(stderr,"dbg2       s_edit:      %d\n",s_edit);
-		fprintf(stderr,"dbg2       s_ndisplay:  %d\n",s_ndisplay);
-		fprintf(stderr,"dbg2       s_maxdepth:  %f\n",s_maxdepth);
-		fprintf(stderr,"dbg2       s_velrange:  %f\n",s_velrange);
-		fprintf(stderr,"dbg2       s_velcenter: %f\n",s_velcenter);
-		fprintf(stderr,"dbg2       s_resrange:  %f\n",s_resrange);
-		fprintf(stderr,"dbg2       s_anglemode: %d\n",s_anglemode);
-		}
-
-	/* set values */
-	edit = s_edit;
-	ndisplay = s_ndisplay;
-	maxdepth = s_maxdepth;
-	velrange = s_velrange;
-	velcenter = s_velcenter;
-	resrange = s_resrange;
-	anglemode = s_anglemode;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-/* This function attempts to open a file as editable.                 */
-/* Called by:                                                         */
-/*                 open_file_ok in mbvelocity_callbacks.c. This is called */
-/*		     by selecting the "OK" button in the file         */
-/*		     selection widget for an editable file.           */
-/* Functions called:                                                  */
-/*                  mb_free                                           */
-/*                  mb_malloc                                         */
-/* Function returns:                                                  */
-/*                  status                                            */
-/*--------------------------------------------------------------------*/
-int mbvt_open_edit_profile(char *file)
-{
-	/* local variables */
-	char	*function_name = "mbvt_open_edit_profile";
-	int	status = MB_SUCCESS;
-	int	size;
-	mb_path	buffer;
-	char	*result;
-	struct profile *profile;
-	FILE	*fp;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input values:\n");
-		fprintf(stderr,"dbg2       file:        %s\n",file);
-		}
-
-	/* get profile pointer */
-	profile = &profile_edit;
-
-	/* clear out old velocity data */
-	if (edit == MB_YES)
-		{
-		edit = MB_NO;
-		profile->n = 0;
-		strcpy(profile->name,"\0");
-		mb_freed(verbose,__FILE__,__LINE__,(void **)&edit_x,&error);
-		mb_freed(verbose,__FILE__,__LINE__,(void **)&edit_y,&error);
-		mb_freed(verbose,__FILE__,__LINE__,(void **)&profile->depth,&error);
-		mb_freed(verbose,__FILE__,__LINE__,(void **)&profile->velocity,&error);
-		}
-
-	/* open the file if possible and count the velocity points */
-	profile->n = 0;
-	if ((fp = fopen(file, "r")) == NULL)
-		{
-		status = MB_FAILURE;
-		fprintf(stderr,"\nUnable to Open Velocity Profile File <%s> for reading\n",file);
-		do_error_dialog("Unable to open input SVP file.",
-				"File may not exist or you may not have",
-				"read permission in this directory!");
-		return(status);
-		}
-	while ((result = fgets(buffer,MB_PATH_MAXLINE,fp)) == buffer)
-		if (buffer[0] != '#')
-			profile->n++;
-	fclose(fp);
-
-	/* allocate space for the velocity profile and raytracing tables */
-	profile->nalloc = MAX(10 * profile->n, 60);
-	size = profile->nalloc * sizeof(int);
-	status = mb_mallocd(verbose,__FILE__,__LINE__,size,(void **)&edit_x,&error);
-	status = mb_mallocd(verbose,__FILE__,__LINE__,size,(void **)&edit_y,&error);
-	size = profile->nalloc * sizeof(double);
-	status = mb_mallocd(verbose,__FILE__,__LINE__,size,(void **)&(profile->depth),&error);
-	status = mb_mallocd(verbose,__FILE__,__LINE__,size,(void **)&(profile->velocity),&error);
-
-	/* if error initializing memory then quit */
-	if (error != MB_ERROR_NO_ERROR)
-		{
-		mb_error(verbose,error,&message);
-		fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",message);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-
-	/* open the file if possible and read the velocity points */
-	profile->n = 0;
-	strcpy(profile->name,file);
-	if ((fp = fopen(file, "r")) == NULL)
-		{
-		status = MB_FAILURE;
-		fprintf(stderr,"\nUnable to Open Velocity Profile File <%s> for reading\n",file);
-		return(status);
-		}
-	strncpy(buffer,"\0",sizeof(buffer));
-	while ((result = fgets(buffer,MB_PATH_MAXLINE,fp)) == buffer)
-		{
-		if (buffer[0] != '#')
-			{
-			sscanf(buffer,"%lf %lf",
-				&(profile->depth[profile->n]),
-				&(profile->velocity[profile->n]));
-
-			/* output some debug values */
-			if (verbose >= 5)
-				{
-				fprintf(stderr,"\ndbg5  New velocity value read in program <%s>\n",program_name);
-				fprintf(stderr,"dbg5       dep[%d]: %f  vel[%d]: %f\n",
-					profile->n,
-					profile->depth[profile->n],
-					profile->n,
-					profile->velocity[profile->n]);
-				}
-			profile->n++;
-			}
-		strncpy(buffer,"\0",sizeof(buffer));
-		}
-	fclose(fp);
-
-	/* assume success */
-	edit = MB_YES;
-	status = MB_SUCCESS;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-/* This function displays a new editable profile.                     */
-/* Called by:                                                         */
-/*                  action_new_profile in mbvelocity_callbacks.c      */
-/*		      which is called by selecting the "NEW EDITABLE  */
-/*                    PROFILE" from the "FILE" pulldown menu.         */
-/*		    - also called from mbvt_process_multibeam()	      */
-/*		      if no editable profile already exists.	      */
-/* Functions called:                                                  */
-/*                  mb_free                                           */
-/*		    mb_malloc                                         */
-/* Function returns:                                                  */
-/*                  status                                            */
-/*--------------------------------------------------------------------*/
-int mbvt_new_edit_profile()
-{
-	/* local variables */
-	char	*function_name = "mbvt_new_edit_profile";
-	int	status = MB_SUCCESS;
-	struct profile *profile;
-	int	size;
-	double	dz;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
-
-	/* get profile pointer */
-	profile = &profile_edit;
-
-	/* clear out old velocity data */
-	if (edit == MB_YES)
-		{
-		edit = MB_NO;
-		profile->n = 0;
-		strcpy(profile->name,"\0");
-		mb_freed(verbose,__FILE__,__LINE__,(void **)&edit_x,&error);
-		mb_freed(verbose,__FILE__,__LINE__,(void **)&edit_y,&error);
-		mb_freed(verbose,__FILE__,__LINE__,(void **)&profile->depth,&error);
-		mb_freed(verbose,__FILE__,__LINE__,(void **)&profile->velocity,&error);
-		}
-
-	/* allocate space for the velocity profile and raytracing tables */
-	profile->nalloc = 10 * NUM_EDIT_START;
-	size = profile->nalloc * sizeof(int);
-	status = mb_mallocd(verbose,__FILE__,__LINE__,size,(void **)&edit_x,&error);
-	status = mb_mallocd(verbose,__FILE__,__LINE__,size,(void **)&edit_y,&error);
-	size = profile->nalloc * sizeof(double);
-	profile->depth = NULL;
-	profile->velocity = NULL;
-	status = mb_mallocd(verbose,__FILE__,__LINE__,size,(void **)&(profile->depth),&error);
-	status = mb_mallocd(verbose,__FILE__,__LINE__,size,(void **)&(profile->velocity),&error);
-
-	/* if error initializing memory then quit */
-	if (error != MB_ERROR_NO_ERROR)
-		{
-		mb_error(verbose,error,&message);
-		fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",message);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-
-	/* copy the default values */
-	strcpy(profile->name,"new");
-	if (bath_max > bath_min && bath_max < 2000)
-		{
-		profile->n = NUM_EDIT_START;
-		dz = 1.25 * bath_max / (profile->n - 2);
-		for (i=0;i<profile->n-1;i++)
-			{
-			profile->depth[i] = i * dz;
-			profile->velocity[i] = veledit[i];
-			}
-		profile->depth[profile->n-1]
-			= depthedit[profile->n-1];
-		profile->velocity[profile->n-1]
-			= veledit[profile->n-1];
-		}
-	else
-		{
-		profile->n = NUM_EDIT_START;
-		for (i=0;i<profile->n;i++)
-			{
-			profile->depth[i] = depthedit[i];
-			profile->velocity[i] = veledit[i];
-			}
-		}
-
-	/* assume success */
-	edit = MB_YES;
-	status = MB_SUCCESS;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-/* This function saves the editable profile.                          */
-/* Called by:                                                         */
-/*                  controls_save_file in mbvelocity_callbacks.c. It is   */
-/*                    called when the user selects "OK" from the      */
-/*                    save editable file widget.                      */
-/* Functions called:                                                  */
-/*                  none                                              */
-/* Function returns:                                                  */
-/*                  status                                            */
-/*--------------------------------------------------------------------*/
-int mbvt_save_edit_profile(char *file)
-{
-	/* local variables */
-	char	*function_name = "mbvt_save_edit_profile";
-	int	status = MB_SUCCESS;
-	struct profile *profile;
-	FILE	*fp;
-	int	i;
-
-	/* time, user, host variables */
-	time_t	right_now;
-	char	date[32], *user_ptr;
-        mb_path user, host;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input values:\n");
-		fprintf(stderr,"dbg2       file:        %s\n",file);
-		}
-
-	/* get profile pointer */
-	profile = &profile_edit;
-
-	/* open the file if possible */
-	if ((fp = fopen(file, "w")) == NULL)
-		{
-		status = MB_FAILURE;
-		fprintf(stderr,"\nUnable to Open Output Velocity Profile File <%s> for writing\n",file);
-		do_error_dialog("Unable to open output file.",
-				"You may not have write",
-				"permission in this directory!");
-		return(status);
-		}
-
-	/* write the svp */
-	fprintf(fp, "## Water Sound Velocity Profile (SVP)\n");
-	fprintf(fp, "## Output by Program %s\n",program_name);
-	fprintf(fp, "## Program Version %s\n",rcs_id);
-	fprintf(fp, "## MB-System Version %s\n",MB_VERSION);
-	right_now = time((time_t *)0);
-	strcpy(date,ctime(&right_now));
-        date[strlen(date)-1] = '\0';
-	if ((user_ptr = getenv("USER")) == NULL)
-		user_ptr = getenv("LOGNAME");
-	if (user_ptr != NULL)
-		strcpy(user,user_ptr);
-	else
-		strcpy(user, "unknown");
-	gethostname(host,MB_PATH_MAXLINE);
-	fprintf(fp, "## Run by user <%s> on cpu <%s> at <%s>\n",
-		user,host,date);
-	fprintf(fp, "## Number of SVP Points: %d\n",profile->n);
-	for (i=0;i<profile->n;i++)
-		fprintf(fp,"%f %f\n",profile->depth[i],
-			profile->velocity[i]);
-
-	/* close the file */
-	fclose(fp);
-
-	/* assume success */
-	edit = MB_YES;
-	status = MB_SUCCESS;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-/* This function saves the editable profile and sets up               */
-/*                  its use by mbprocess                              */
-/* Called by:                                                         */
-/*                  controls_save_file in mbvelocity_callbacks.c. It is   */
-/*                    called when the user selects "OK" from the      */
-/*                    save editable file widget.                      */
-/* Functions called:                                                  */
-/*                  none                                              */
-/* Function returns:                                                  */
-/*                  status                                            */
-/*--------------------------------------------------------------------*/
-int mbvt_save_swath_profile(char *file)
-{
-	/* local variables */
-	char	*function_name = "mbvt_save_swath_profile";
-	int	status = MB_SUCCESS;
-	struct profile *profile;
-	FILE	*fp;
-	int	oldmode, oldanglemode, corrected;
-	mb_path	oldfile;
-	int	i;
-
-	/* time, user, host variables */
-	time_t	right_now;
-	char	date[32], *user_ptr;
-        mb_path user, host;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input values:\n");
-		fprintf(stderr,"dbg2       file:        %s\n",file);
-		}
-
-	/* get profile pointer */
-	profile = &profile_edit;
-
-	/* do this if edit profile exists and swath data read */
-	if (profile->n > 2 && nbuffer > 0)
-	    {
-
-	    /* open the file if possible */
-	    sprintf(file, "%s.svp", swathfile);
-	    if ((fp = fopen(file, "w")) == NULL)
-		{
-		status = MB_FAILURE;
-		fprintf(stderr,"\nUnable to Open Output Velocity Profile File <%s> for writing\n",file);
-		do_error_dialog("Unable to open output file.",
-				"You may not have write",
-				"permission in this directory!");
-		return(status);
-		}
-
-	    /* write the svp */
-	    fprintf(fp, "## Water Sound Velocity Profile (SVP)\n");
-	    fprintf(fp, "## Output by Program %s\n", program_name);
-	    fprintf(fp, "## Program Version %s\n", rcs_id);
-	    fprintf(fp, "## MB-System Version %s\n", MB_VERSION);
-	    right_now = time((time_t *)0);
-	    strcpy(date,ctime(&right_now));
-            date[strlen(date)-1] = '\0';
-	    if ((user_ptr = getenv("USER")) == NULL)
-		    user_ptr = getenv("LOGNAME");
-	    if (user_ptr != NULL)
-		    strcpy(user, user_ptr);
-	    else
-		    strcpy(user, "unknown");
-	    gethostname(host,MB_PATH_MAXLINE);
-	    fprintf(fp, "## Run by user <%s> on cpu <%s> at <%s>\n",
-		    user, host, date);
-	    fprintf(fp, "## Swath File: %s\n", swathfile);
-	    fprintf(fp, "## Number of SVP Points: %d\n", profile->n);
-	    for (i=0;i<profile->n;i++)
-		    fprintf(fp,"%f %f\n", profile->depth[i],
-			    profile->velocity[i]);
-
-	    /* close the file */
-	    fclose(fp);
-
-	    /* set par file for use with mbprocess */
-	    status = mb_pr_get_svp(verbose, swathfile,
-			&oldmode, oldfile,
-			&oldanglemode, &corrected, &error);
-	    status = mb_pr_update_svp(verbose, swathfile,
-			MB_YES, file, anglemode, corrected, &error);
-
-	    /* check success */
-	    if (status == MB_SUCCESS)
-		edit = MB_YES;
-	    }
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-/* This function saves the residuals at beam statics and sets up      */
-/*                  their use by mbprocess                            */
-/* Called by:                                                         */
-/*                  do_save_residuals() in mbvelocity_callbacks.c.    */
-/*                    called when the user selects "Save Residuals"   */
-/* Functions called:                                                  */
-/*                  none                                              */
-/* Function returns:                                                  */
-/*                  status                                            */
-/*--------------------------------------------------------------------*/
-int mbvt_save_residuals(char *file)
-{
-	/* local variables */
-	char	*function_name = "mbvt_save_residuals";
-	int	status = MB_SUCCESS;
-	FILE	*fp;
-	int	oldmode;
-	mb_path	oldfile;
-	int	i;
-
-	/* time, user, host variables */
-	time_t	right_now;
-	char	date[32], *user_ptr;
-        mb_path user, host;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input values:\n");
-		fprintf(stderr,"dbg2       file:        %s\n",file);
-		}
-
-	/* do this if edit profile exists and swath data read */
-	if (profile_edit.n > 2 && nbuffer > 0)
-	    {
-
-	    /* open the file if possible */
-	    sprintf(file, "%s.sbo", swathfile);
-	    if ((fp = fopen(file, "w")) == NULL)
-		{
-		status = MB_FAILURE;
-		fprintf(stderr,"\nUnable to Open Output Static Beam Offset File <%s> for writing\n",file);
-		do_error_dialog("Unable to open output file.",
-				"You may not have write",
-				"permission in this directory!");
-		return(status);
-		}
-
-	    /* write the sbo file */
-	    fprintf(fp, "## Static Beam Offset (SBO)\n");
-	    fprintf(fp, "## Output by Program %s\n", program_name);
-	    fprintf(fp, "## Program Version %s\n", rcs_id);
-	    fprintf(fp, "## MB-System Version %s\n", MB_VERSION);
-	    right_now = time((time_t *)0);
-	    strcpy(date,ctime(&right_now));
-            date[strlen(date)-1] = '\0';
-	    if ((user_ptr = getenv("USER")) == NULL)
-		    user_ptr = getenv("LOGNAME");
-	    if (user_ptr != NULL)
-		    strcpy(user, user_ptr);
-	    else
-		    strcpy(user, "unknown");
-	    gethostname(host,MB_PATH_MAXLINE);
-	    fprintf(fp, "## Run by user <%s> on cpu <%s> at <%s>\n",
-		    user, host, date);
-	    fprintf(fp, "## Swath File: %s\n", swathfile);
-	    fprintf(fp, "## Number of Static Beam Offset Points: %d\n", nbeams);
-	    for (i=0;i<nbeams;i++)
-		    fprintf(fp," %4d  %9.3f  %9.3f\n",
-				i, residual[i], res_sd[i]);
-
-	    /* close the file */
-	    fclose(fp);
-
-	    /* set par file for use with mbprocess */
-	    status = mb_pr_get_static(verbose, swathfile,
-			&oldmode, oldfile, &error);
-	    status = mb_pr_update_static(verbose, swathfile,
-			MB_YES, file, &error);
-
-	    /* check success */
-	    if (status == MB_SUCCESS)
-		edit = MB_YES;
-	    }
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-/* This function reads the data in the requested display file.        */
-/* Called by:                                                         */
-/*                  open_file_ok in mbvelocity_callbacks.c                */
-/* Functions called:                                                  */
-/*                  mb_malloc                                         */
-/* Function returns:                                                  */
-/*                  status                                            */
-/*--------------------------------------------------------------------*/
-int mbvt_open_display_profile(char *file)
-{
-	/* local variables */
-	char	*function_name = "mbvt_open_display_profile";
-	int	status = MB_SUCCESS;
-	mb_path	buffer;
-	char	*result;
-	struct profile *profile;
-	FILE	*fp;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input values:\n");
-		fprintf(stderr,"dbg2       file:        %s\n",file);
-		}
-
-	/* check that there is room for these data */
-	if (ndisplay >= MAX_PROFILES)
-		{
-		status = MB_FAILURE;
-		fprintf(stderr,"\nNo room for another display velocity profile\n");
-		do_error_dialog("Unable to open input SVP file.",
-				"There is no room for another",
-				"display SVP!");
-		return(status);
-		}
-
-	/* get profile pointer */
-	profile = &profile_display[ndisplay];
-
-	/* open the file if possible and count the velocity points */
-	profile->n = 0;
-	if ((fp = fopen(file, "r")) == NULL)
-		{
-		status = MB_FAILURE;
-		fprintf(stderr,"\nUnable to Open Velocity Profile File <%s> for reading\n",file);
-		do_error_dialog("Unable to open input SVP file.",
-				"File may not exist or you may not have",
-				"read permission in this directory!");
-		return(status);
-		}
-	while ((result = fgets(buffer,MB_PATH_MAXLINE,fp)) == buffer)
-		if (buffer[0] != '#')
-			profile->n++;
-	fclose(fp);
-
-	/* allocate space for the velocity profile and raytracing tables */
-	profile->depth = NULL;
-	profile->velocity = NULL;
-	profile->nalloc = profile->n;
-	status = mb_mallocd(verbose,__FILE__,__LINE__,profile->nalloc * sizeof(double),
-		(void **)&(profile->depth),&error);
-	status = mb_mallocd(verbose,__FILE__,__LINE__,profile->nalloc * sizeof(double),
-		(void **)&(profile->velocity),&error);
-
-	/* if error initializing memory then quit */
-	if (error != MB_ERROR_NO_ERROR)
-		{
-		mb_error(verbose,error,&message);
-		fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",message);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-
-	/* open the file if possible and read the velocity points */
-	profile->n = 0;
-	strcpy(profile->name,file);
-	if ((fp = fopen(file, "r")) == NULL)
-		{
-		status = MB_FAILURE;
-		fprintf(stderr,"\nUnable to Open Velocity Profile File <%s> for reading\n",file);
-		return(status);
-		}
-	strncpy(buffer,"\0",sizeof(buffer));
-	while ((result = fgets(buffer,MB_PATH_MAXLINE,fp)) == buffer)
-		{
-		if (buffer[0] != '#')
-			{
-			sscanf(buffer,"%lf %lf",
-				&(profile->depth[profile->n]),
-				&(profile->velocity[profile->n]));
-
-			/* output some debug values */
-			if (verbose >= 5)
-				{
-				fprintf(stderr,"\ndbg5  New velocity value read in program <%s>\n",program_name);
-				fprintf(stderr,"dbg5       dep[%d]: %f  vel[%d]: %f\n",
-					profile->n,
-					profile->depth[profile->n],
-					profile->n,
-					profile->velocity[profile->n]);
-				}
-			profile->n++;
-			}
-		strncpy(buffer,"\0",sizeof(buffer));
-		}
-	fclose(fp);
-
-	/* assume success */
-	ndisplay++;
-	status = MB_SUCCESS;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-/* This function is used to keep track of the display profiles that   */
-/*   are being displayed so the user can remove unwanted displayed.   */
-/*   This feature is not functional at this time.                     */
-/* Called by:                                                         */
-/*                  mbvelocitytool_set_menu which is not being used   */
-/*		      at this time.                                   */
-/* Functions called:                                                  */
-/*                  none                                              */
-/* Function returns:                                                  */
-/*                  status                                            */
-/*--------------------------------------------------------------------*/
-int mbvt_get_display_names(int *nlist, char *list[MAX_PROFILES])
-{
-	/* local variables */
-	char	*function_name = "mbvt_get_display_names";
-	int	status = MB_SUCCESS;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input values:\n");
-		fprintf(stderr,"dbg2       list:        %p\n",list);
-		}
-
-	/* set values */
-	*nlist = ndisplay;
-	for (i=0;i<*nlist;i++)
-		list[i] = profile_display[i].name;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       nlist:       %d\n",*nlist);
-		for (i=0;i<*nlist;i++)
-			fprintf(stderr,"dbg2       name[%d]: %s\n",i,list[i]);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-/* This function is used to delete an unwanted display profile from   */
-/*   the screen. This feature is not in use at this time.             */
-/* Called by:                                                         */
-/*                  none - not in use                                 */
-/* Functions called:                                                  */
-/*                  mb_free                                           */
-/* Function returns:                                                  */
-/*                  status                                            */
-/*--------------------------------------------------------------------*/
-int mbvt_delete_display_profile(int select)
-{
-	/* local variables */
-	char	*function_name = "mbvt_delete_display_profile";
-	struct profile *profile;
-	int	status = MB_SUCCESS;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input values:\n");
-		fprintf(stderr,"dbg2       select:      %d\n",select);
-		}
-
-	/* check if reasonable */
-	if (select < ndisplay)
-		{
-		/* remove selected profile */
-		profile = &profile_display[select];
-		profile->n = 0;
-		profile->nalloc = 0;
-		strcpy(profile->name,"\0");
-		mb_freed(verbose,__FILE__,__LINE__,(void **)&profile->depth,&error);
-		mb_freed(verbose,__FILE__,__LINE__,(void **)&profile->velocity,&error);
-
-		/* reorder remaining profiles */
-		for (i=select+1;i<ndisplay;i++)
-			{
-			profile_display[i-1].n = profile_display[i].n;
-			strcpy(profile_display[i-1].name,
-				profile_display[i].name);
-			for (j=0;j<profile_display[i-1].n;j++)
-				{
-				profile_display[i-1].depth[j]
-					= profile_display[i].depth[j];
-				profile_display[i-1].velocity[j]
-					= profile_display[i].velocity[j];
-				}
-			}
-		ndisplay--;
-		}
-	else
-		status = MB_FAILURE;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-/* This is the main plotting function. It does all the drawing in the */
-/*   canvas part of the screen.                                       */
-/* Called by:                                                         */
-/*                  main                                              */
-/*                  display_menu                                      */
-/*                  action_new_profile                                */
-/*                  controls_save_file                                */
-/*                  open_file_ok                                      */
-/*                  action_maxdepth                                   */
-/*                  action_menu_close_profile                         */
-/*                  action_velrange                                   */
-/*                  action_canvas_event                               */
-/*                  action_residual_range                             */
-/*                  action_process_mb                                 */
-/*                  mbvt_open_swath_file                             */
-/* Functions called:                                                  */
-/*                  xg_setclip                                        */
-/*                  xg_fillrectangle                                  */
-/*                  xg_drawline                                       */
-/* 		    xg_justify                                        */
-/* 		    xg_drawstring                                     */
-/* 		    xg_drawrectangle                                  */
-/* Function returns:                                                  */
-/*                  status                                            */
-/*--------------------------------------------------------------------*/
-int mbvt_plot()
-{
-	/* local variables */
-	char	*function_name = "mbvt_plot";
-	int	status = MB_SUCCESS;
-
-	/* plotting variables */
-	int	margin;
-	int	xcen, ycen;
-	double	deltax, deltay;
-	int	nx_int, ny_int;
-	int	x_int, y_int;
-	int	xrcen, yrcen;
-	double	deltaxr, deltayr;
-	int	nxr_int, nyr_int;
-	int	xr_int, yr_int;
-	int	xpcen, ypcen;
-	double	deltaxp, deltayp;
-	int	nxp_int, nyp_int;
-	int	xp_int, yp_int;
-	int	xx, yy;
-	int	yyl, yyu;
-	double	vx, vy;
-	int	xxo, yyo;
-	int	swidth, sascent, sdescent;
-	mb_path	string;
-	char	format_str[10];
-	int	color;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr," borders[0] = %d\n", borders[0]);
-		fprintf(stderr," borders[1] = %d\n", borders[1]);
-		fprintf(stderr," borders[2] = %d\n", borders[2]);
-		fprintf(stderr," borders[3] = %d\n", borders[3]);
-		fprintf(stderr," mbvt_xgid  = %p\n", mbvt_xgid);
-		}
-
-	/* turn clipp mask back to whole canvas */
-        /* set clip rectangle */
-
-	xg_setclip(mbvt_xgid,borders[0],borders[2],
-		borders[1]-borders[0],borders[3]-borders[2]);
-
-	/* clear screen */
-	xg_fillrectangle(mbvt_xgid,borders[0],borders[2],
-		borders[1]-borders[0],borders[3]-borders[2],
-		pixel_values[WHITE],XG_SOLIDLINE);
-
-	/* set scaling */
-	margin = (borders[3] - borders[2])/15;
-	xmin = 2.25*margin;
-	xmax = 0.5*(borders[1] - borders[0]) - margin;
-	ymin = margin;
-	ymax = 0.5*(borders[3] - borders[2]);
-	xcen = xmin + (xmax - xmin)/2;
-	ycen = ymin + (ymax - ymin)/2;
-	xminimum = velcenter - velrange/2;
-	xmaximum = velcenter + velrange/2;
-	deltax = 0.15*(xmaximum - xminimum);
-	xscale = (xmax - xmin)/(xmaximum - xminimum);
-	x_int = deltax*xscale;
-	nx_int = (xmaximum - xminimum)/deltax + 1;
-	yminimum = 0.0;
-	ymaximum = maxdepth;
-	deltay = 0.1*(ymaximum - yminimum);
-	yscale = (ymax - ymin)/(ymaximum - yminimum);
-	y_int = deltay*yscale;
-	ny_int = (ymaximum - yminimum)/deltay + 1;
-
-	/* plot grid */
-	xg_drawline(mbvt_xgid,xmin,ymin,xmin,ymax,
-		pixel_values[BLACK],XG_SOLIDLINE);
-	xg_drawline(mbvt_xgid,xmax,ymin,xmax,ymax,
-		pixel_values[BLACK],XG_SOLIDLINE);
-	for (i=0;i<nx_int;i++)
-		{
-		xx = xmin + i*x_int;
-		vx = xminimum + i*deltax;
-		xg_drawline(mbvt_xgid,xx,ymin,xx,ymax,
-			pixel_values[BLACK],XG_DASHLINE);
-		sprintf(string,"%.1f",vx);
-		xg_justify(mbvt_xgid,string,&swidth,
-			&sascent,&sdescent);
-		xg_drawstring(mbvt_xgid,xx-swidth/2,
-			ymax+sascent+5,string,
-			pixel_values[BLACK],XG_SOLIDLINE);
-		}
-	xg_drawline(mbvt_xgid,xmin,ymin,xmax,ymin,
-			pixel_values[BLACK],XG_SOLIDLINE);
-	xg_drawline(mbvt_xgid,xmin,ymax,xmax,ymax,
-			pixel_values[BLACK],XG_SOLIDLINE);
-	for (i=0;i<ny_int;i++)
-		{
-		yy = ymin + i*y_int;
-		vy = yminimum + i*deltay;
-		xg_drawline(mbvt_xgid,xmin,yy,xmax,yy,
-			pixel_values[BLACK],XG_DASHLINE);
-		sprintf(string,"%.1f",vy);
-		xg_justify(mbvt_xgid,string,&swidth,
-			&sascent,&sdescent);
-		xg_drawstring(mbvt_xgid,xmin-swidth-5,
-			yy+sascent/2,string,
-			pixel_values[BLACK],XG_SOLIDLINE);
-		}
-	strcpy(string,"Water Sound Velocity Profiles");
-	xg_justify(mbvt_xgid,string,&swidth,
-		&sascent,&sdescent);
-	xg_drawstring(mbvt_xgid,xcen-swidth/2,
-		ymin-2*sascent+10,string,
-		pixel_values[BLACK],XG_SOLIDLINE);
-	strcpy(string,"Water Sound Velocity (m/s)");
-	xg_justify(mbvt_xgid,string,&swidth,
-		&sascent,&sdescent);
-	xg_drawstring(mbvt_xgid,xcen-swidth/2,
-		ymax+2*sascent+10,string,
-		pixel_values[BLACK],XG_SOLIDLINE);
-	strcpy(string,"Depth");
-	xg_justify(mbvt_xgid,string,&swidth,
-		&sascent,&sdescent);
-	xg_drawstring(mbvt_xgid,xmin-2*swidth-10,
-		ycen-sascent,string,
-		pixel_values[BLACK],XG_SOLIDLINE);
-	strcpy(string,"(m)");
-	xg_drawstring(mbvt_xgid,xmin-2*swidth,
-		ycen+sascent,string,
-		pixel_values[BLACK],XG_SOLIDLINE);
-
-	/* turn clipping on */
-
-	xg_setclip(mbvt_xgid,xmin,ymin,(xmax-xmin),(ymax-ymin));
-
-	/* plot display profiles */
-	for (i=0;i<ndisplay;i++)
-	  {
-	  color = i%3 + 2;
-	  for (j=0;j<profile_display[i].n;j++)
-		{
-		xx = xmin + (profile_display[i].velocity[j] - xminimum)*xscale;
-		yy = ymin + (profile_display[i].depth[j] - yminimum)*yscale;
-		xx = MIN(xx, 32000);
-		yy = MIN(yy, 32000);
-/*		xg_drawrectangle(mbvt_xgid, xx-2, yy-2, 4, 4,
-			pixel_values[color],XG_SOLIDLINE);*/
-		if (j > 0)
-			xg_drawline(mbvt_xgid,xxo,yyo,xx,yy,
-				pixel_values[color],XG_SOLIDLINE);
-		xxo = xx;
-		yyo = yy;
-		}
-	  }
-
-	/* plot edit profile */
-	if (edit == MB_YES)
-	  {
-	  for (j=0;j<profile_edit.n;j++)
-		{
-		xx = xmin + (profile_edit.velocity[j] - xminimum)*xscale;
-		yy = ymin + (profile_edit.depth[j] - yminimum)*yscale;
-		xx = MIN(xx, 32000);
-		yy = MIN(yy, 32000);
-		xg_fillrectangle(mbvt_xgid, xx-2, yy-2, 4, 4,
-			pixel_values[BLACK],XG_SOLIDLINE);
-		if (j > 0)
-			{
-			xg_drawline(mbvt_xgid,xxo,yyo,xx,yy,
-				pixel_values[BLACK],XG_SOLIDLINE);
-			}
-		xxo = xx;
-		yyo = yy;
-		edit_x[j] = xx;
-		edit_y[j] = yy;
-		}
-	  }
-
-	/* now plot grid for Bathymetry Residuals */
-	/* turn clip mask back to whole canvas */
-
-	xg_setclip(mbvt_xgid,borders[0],borders[2],
-		borders[1]-borders[0],borders[3]-borders[2]);
-
-	/* set scaling */
-	xrmin = 0.5*(borders[1] - borders[0]) + 2*margin;
-	xrmax = borders[1] - 0.5*margin;
-	yrmin = margin;
-	yrmax = 0.5*(borders[3] - borders[2]);
-	xrcen = xrmin + (xrmax - xrmin)/2;
-	yrcen = yrmin + (yrmax - yrmin)/2;
-	xrminimum = beam_first - 1.0;
-	xrmaximum = beam_last + 1.0;
-	deltaxr = (int) (0.1*(xrmaximum - xrminimum));
-	xrscale = (xrmax - xrmin)/(xrmaximum - xrminimum);
-	xr_int = deltaxr*xrscale;
-	nxr_int = (xrmaximum - xrminimum)/deltaxr + 1;
-	yrminimum = -resrange;
-	yrmaximum = resrange;
-	deltayr = 0.1*(yrmaximum - yrminimum);
-	yrscale = (yrmax - yrmin)/(yrmaximum - yrminimum);
-	yr_int = deltayr*yrscale;
-	nyr_int = (yrmaximum - yrminimum)/deltayr/2 + 1;
-
-	/* plot grid */
-	xg_drawline(mbvt_xgid,xrmin,yrmin,xrmin,yrmax,
-		pixel_values[BLACK],XG_SOLIDLINE);
-	xg_drawline(mbvt_xgid,xrmax,yrmin,xrmax,yrmax,
-		pixel_values[BLACK],XG_SOLIDLINE);
-	for (i=0;i<nxr_int;i++)
-		{
-		xx = xrmin + i*xr_int;
-		vx = xrminimum + i*deltaxr;
-		xg_drawline(mbvt_xgid,xx,yrmin,xx,yrmax,
-			pixel_values[BLACK],XG_DASHLINE);
-		sprintf(string,"%.0f",vx);
-		xg_justify(mbvt_xgid,string,&swidth,
-			&sascent,&sdescent);
-		xg_drawstring(mbvt_xgid,xx-swidth/2,
-			yrmax+sascent+5,string,
-			pixel_values[BLACK],XG_SOLIDLINE);
-		}
-	xg_drawline(mbvt_xgid,xrmin,yrmin,xrmax,yrmin,
-		pixel_values[BLACK],XG_SOLIDLINE);
-	xg_drawline(mbvt_xgid,xrmin,yrmax,xrmax,yrmax,
-		pixel_values[BLACK],XG_SOLIDLINE);
-	if (resrange > 100.0)
-		sprintf(format_str, "%s", "%.0f");
-	else if (resrange > 10.0)
-		sprintf(format_str, "%s", "%.1f");
-	else
-		sprintf(format_str, "%s", "%.2f");
-	for (i=0;i<nyr_int;i++)
-		{
-		yy = yrcen + i*yr_int;
-		vy = i*deltayr;
-		xg_drawline(mbvt_xgid,xrmin,yy,xrmax,yy,
-			pixel_values[BLACK],XG_DASHLINE);
-		sprintf(string,format_str,vy);
-		xg_justify(mbvt_xgid,string,&swidth,
-			&sascent,&sdescent);
-		xg_drawstring(mbvt_xgid,xrmin-swidth-5,
-			yy+sascent/2,string,
-			pixel_values[BLACK],XG_SOLIDLINE);
-		yy = yrcen - i*yr_int;
-		vy = -i*deltayr;
-		xg_drawline(mbvt_xgid,xrmin,yy,xrmax,yy,
-			pixel_values[BLACK],XG_DASHLINE);
-		sprintf(string,format_str,vy);
-		xg_justify(mbvt_xgid,string,&swidth,
-			&sascent,&sdescent);
-		xg_drawstring(mbvt_xgid,xrmin-swidth-5,
-			yy+sascent/2,string,
-			pixel_values[BLACK],XG_SOLIDLINE);
-		}
-	if (nbuffer > 0)
-		{
-		sprintf(string,"Depth Range:  minimum: %5.0f m   maximum: %5.0f m",
-			bath_min, bath_max);
-		xg_justify(mbvt_xgid,string,&swidth,
-			&sascent,&sdescent);
-		xg_drawstring(mbvt_xgid,
-			borders[1]/2-swidth/2,
-			yrmin-4*sascent+14,string,
-			pixel_values[BLACK],XG_SOLIDLINE);
-		}
-	strcpy(string,"Swath Bathymetry Beam Residuals");
-	xg_justify(mbvt_xgid,string,&swidth,
-		&sascent,&sdescent);
-	xg_drawstring(mbvt_xgid,xrcen-swidth/2,
-		yrmin-2*sascent+10,string,
-		pixel_values[BLACK],XG_SOLIDLINE);
-	strcpy(string,"Bathymetry Beam Number");
-	xg_justify(mbvt_xgid,string,&swidth,
-		&sascent,&sdescent);
-	xg_drawstring(mbvt_xgid,xrcen-swidth/2,
-		yrmax+2*sascent+10,string,
-		pixel_values[BLACK],XG_SOLIDLINE);
-	strcpy(string,"Residual");
-	xg_justify(mbvt_xgid,string,&swidth,
-		&sascent,&sdescent);
-	xg_drawstring(mbvt_xgid,xrmin-swidth-30,
-		yrcen-sascent,string,
-		pixel_values[BLACK],XG_SOLIDLINE);
-	strcpy(string,"(m)");
-	xg_drawstring(mbvt_xgid,xrmin-swidth-10,
-		yrcen+sascent,string,
-		pixel_values[BLACK],XG_SOLIDLINE);
-
-	/* turn clipping on for residual plot box */
-	xg_setclip(mbvt_xgid,xrmin,yrmin,(xrmax-xrmin),(yrmax-yrmin));
-
-	/* plot residuals */
-	if (nbuffer > 0)
-	  for (i=0;i<nbeams;i++)
-	    {
-	    if (nresidual[i] > 0)
-		{
-		xx = xrmin + (i - xrminimum)*xrscale;
-		yy = yrmin + (residual[i] - yrminimum) * yrscale;
-		xx = MIN(xx, 32000);
-		yy = MIN(yy, 32000);
-		yyl = yrmin + (residual[i] - res_sd[i] - yrminimum)
-				* yrscale;
-		yyu = yrmin + (residual[i] + res_sd[i] - yrminimum)
-				* yrscale;
-		xg_fillrectangle(mbvt_xgid, xx-2, yy-2, 4, 4,
-			pixel_values[BLACK],XG_SOLIDLINE);
-		xg_drawline(mbvt_xgid,xx,yyl,xx,yyu,
-			pixel_values[BLACK],XG_SOLIDLINE);
-		if (i > 0 && nresidual[i-1] > 0)
-			xg_drawline(mbvt_xgid,xxo,yyo,xx,yy,
-				pixel_values[BLACK],XG_SOLIDLINE);
-		xxo = xx;
-		yyo = yy;
-		}
-	     }
-
-	/* now plot grid for raypaths */
-	/* turn clip mask back to whole canvas */
-
-	xg_setclip(mbvt_xgid,borders[0],borders[2],
-		borders[1]-borders[0],borders[3]-borders[2]);
-
-	/* set scaling */
-	xpmin = 2.25*margin;
-	xpmax = borders[1] - 0.5*margin;
-	ypmin = 0.5*(borders[3] - borders[2]) + 1.5*margin;
-	ypmax = ypmin + (xpmax - xpmin)/5.0;
-	xpcen = xpmin + (xpmax - xpmin)/2;
-	ypcen = ypmin + (ypmax - ypmin)/2;
-
-	if (nbuffer == 0 || nraypath == NULL)
-		{
-		raydepthmin = 0.0;
-		raydepthmax = maxdepth;
-		}
-
-	ypminimum = raydepthmin - 0.02 * (raydepthmax - raydepthmin);
-	ypmaximum = raydepthmax + 0.02 * (raydepthmax - raydepthmin);
-	ypscale = (ypmax - ypmin)/(ypmaximum - ypminimum);
-	xpscale = ypscale;
-	xpmaximum = (xpmax - xpmin)/(2*xpscale);
-	xpminimum = -xpmaximum;
-	if (xpmaximum < rayxmax)
-		{
-		xpmaximum = 1.02 * rayxmax;
-		xpminimum = -xpmaximum;
-		xpscale = (xpmax - xpmin)/(xpmaximum - xpminimum);
-		ypscale = xpscale;
-		ypmaximum = ypminimum + (ypmax - ypmin) / ypscale;
-		}
-
-	deltaxp = 0.4 * (raydepthmax - raydepthmin);
-	xp_int = deltaxp*xpscale;
-	nxp_int = (xpmaximum - xpminimum)/deltaxp/2 + 1;
-	deltayp = 0.2*(ypmaximum - ypminimum);
-	yp_int = deltayp*ypscale;
-	nyp_int = (ypmaximum - ypminimum)/deltayp + 1;
-
-	/* plot grid */
-	xg_drawline(mbvt_xgid,xpmin,ypmin,xpmin,ypmax,
-		pixel_values[BLACK],XG_SOLIDLINE);
-	xg_drawline(mbvt_xgid,xpmax,ypmin,xpmax,ypmax,
-		pixel_values[BLACK],XG_SOLIDLINE);
-	for (i=0;i<nxp_int;i++)
-		{
-		xx = xpcen + i*xp_int;
-		vx = i*deltaxp;
-		xg_drawline(mbvt_xgid,xx,ypmin,xx,ypmax,
-			pixel_values[BLACK],XG_DASHLINE);
-		sprintf(string,"%.1f",vx);
-		xg_justify(mbvt_xgid,string,&swidth,
-			&sascent,&sdescent);
-		xg_drawstring(mbvt_xgid,xx-swidth/2,
-			ypmax+sascent+5,string,
-			pixel_values[BLACK],XG_SOLIDLINE);
-		xx = xpcen - i*xp_int;
-		vx = -i*deltaxp;
-		xg_drawline(mbvt_xgid,xx,ypmin,xx,ypmax,
-			pixel_values[BLACK],XG_DASHLINE);
-		sprintf(string,"%.1f",vx);
-		xg_justify(mbvt_xgid,string,&swidth,
-			&sascent,&sdescent);
-		xg_drawstring(mbvt_xgid,xx-swidth/2,
-			ypmax+sascent+5,string,
-			pixel_values[BLACK],XG_SOLIDLINE);
-		}
-	xg_drawline(mbvt_xgid,xpmin,ypmin,xpmax,ypmin,
-		pixel_values[BLACK],XG_SOLIDLINE);
-	xg_drawline(mbvt_xgid,xpmin,ypmax,xpmax,ypmax,
-		pixel_values[BLACK],XG_SOLIDLINE);
-	for (i=0;i<nyp_int;i++)
-		{
-		yy = ypmin + i*yp_int;
-		vy = ypminimum + i*deltayp;
-		xg_drawline(mbvt_xgid,xpmin,yy,xpmax,yy,
-			pixel_values[BLACK],XG_DASHLINE);
-		sprintf(string,"%.1f",vy);
-		xg_justify(mbvt_xgid,string,&swidth,
-			&sascent,&sdescent);
-		xg_drawstring(mbvt_xgid,xpmin-swidth-5,
-			yy+sascent/2,string,
-			pixel_values[BLACK],XG_SOLIDLINE);
-		}
-	strcpy(string,"Raypaths");
-	xg_justify(mbvt_xgid,string,&swidth,
-		&sascent,&sdescent);
-	xg_drawstring(mbvt_xgid,xpcen-swidth/2,
-		ypmin-2*sascent+10,string,
-		pixel_values[BLACK],XG_SOLIDLINE);
-	strcpy(string,"Acrosstrack Distance (m)");
-	xg_justify(mbvt_xgid,string,&swidth,
-		&sascent,&sdescent);
-	xg_drawstring(mbvt_xgid,xpcen-swidth/2,
-		ypmax+2*sascent+10,string,
-		pixel_values[BLACK],XG_SOLIDLINE);
-	strcpy(string,"Depth");
-	xg_justify(mbvt_xgid,string,&swidth,
-		&sascent,&sdescent);
-	xg_drawstring(mbvt_xgid,xpmin-2*swidth-10,
-		ypcen-sascent,string,
-		pixel_values[BLACK],XG_SOLIDLINE);
-	strcpy(string,"(m)");
-	xg_drawstring(mbvt_xgid,xpmin-2*swidth,
-		ypcen+sascent,string,
-		pixel_values[BLACK],XG_SOLIDLINE);
-
-	/* turn clipping on for raypath plot box */
-	xg_setclip(mbvt_xgid,xpmin,ypmin,(xpmax-xpmin),(ypmax-ypmin));
-
-	/* plot raypaths */
-	if (nbuffer > 0 && nraypath != NULL)
-	  for (i=0;i<nbeams;i++)
-	    {
-	    if (nraypath[i] > 0)
-		{
-		xxo = xpmin + (raypathx[i][0] - xpminimum)*xpscale;
-		yyo = ypmin + (raypathy[i][0] - ypminimum)*ypscale;
-		for (j=1;j<nraypath[i];j++)
-			{
-			xx = xpmin + (raypathx[i][j] - xpminimum)*xpscale;
-			yy = ypmin + (raypathy[i][j] - ypminimum)*ypscale;
-			xx = MIN(xx, 32000);
-			yy = MIN(yy, 32000);
-			xg_drawline(mbvt_xgid,xxo,yyo,xx,yy,
-				pixel_values[BLACK],XG_SOLIDLINE);
-			xxo = xx;
-			yyo = yy;
-			}
-		xg_fillrectangle(mbvt_xgid, xx-2, yy-2, 4, 4,
-			pixel_values[RED],XG_SOLIDLINE);
-		}
-	     }
-
-	/* turn clipping on for velocity profile box */
-	xg_setclip(mbvt_xgid,xmin,ymin,(xmax-xmin),(ymax-ymin));
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-/* This function is called when the right mouse button is pressed     */
-/*   when it is in the canvas area. It finds the mouse location so    */
-/*   the program knows which editable point to move.                  */
-/* Called by:                                                         */
-/*                  action_canvas_event                               */
-/* Functions called:                                                  */
-/*                  none                                              */
-/* Function returns:                                                  */
-/*                  status                                            */
-/*--------------------------------------------------------------------*/
-int mbvt_action_select_node(int x, int y)
-{
-	/* local variables */
-	char	*function_name = "mbvt_action_select_node";
-	int	status = MB_SUCCESS;
-	double	distance, distance_min;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input values:\n");
-		fprintf(stderr,"dbg2       x:            %d\n",x);
-		fprintf(stderr,"dbg2       y:            %d\n",y);
-		}
-
-	/* select node if possible */
-	if (x >= xmin && x <= xmax && y >= ymin && y <= ymax)
-		{
-
-		/* find the closest node */
-		distance_min = 20000.0;
-		active = -1;
-		for (i=0;i<profile_edit.n;i++)
-			{
-			distance = (edit_x[i] - x)*(edit_x[i] - x)
-				+ (edit_y[i] - y)*(edit_y[i] - y);
-			if (distance < distance_min)
-				{
-				distance_min = distance;
-				active = i;
-				}
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-/* This function is called when the right mouse button is released.   */
-/*   The only thing it really does is set the active flag to -1.      */
-/* Called by:                                                         */
-/*                  action_canvas_event                               */
-/* Functions called:                                                  */
-/*                  none                                              */
-/* Function returns:                                                  */
-/*                  status                                            */
-/*--------------------------------------------------------------------*/
-int mbvt_action_mouse_up(int x, int y)
-{
-	/* local variables */
-	char	*function_name = "mbvt_action_mouse_up";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input values:\n");
-		fprintf(stderr,"dbg2       x:            %d\n",x);
-		fprintf(stderr,"dbg2       y:            %d\n",y);
-		}
-
-	/* relocate and deselect node if selected */
-	if (active > 0)
-		{
-		active = -1;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-/* This function is continuously called as long as the left mouse is  */
-/*   is depressed. It moves the selected point with elastic lines     */
-/*   untill the button is released.                                   */
-/* Called by:                                                         */
-/*                  action_canvas_event                               */
-/* Functions called:                                                  */
-/*                  xg_fillrectangle                                  */
-/*                  xg_drawline                                       */
-/* Function returns:                                                  */
-/*                  status                                            */
-/*--------------------------------------------------------------------*/
-int mbvt_action_drag_node(int x, int y)
-{
-	/* local variables */
-	char	*function_name = "mbvt_action_drag_node";
-	int	status = MB_SUCCESS;
-	int	ylim_min, ylim_max;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input values:\n");
-		fprintf(stderr,"dbg2       x:            %d\n",x);
-		fprintf(stderr,"dbg2       y:            %d\n",y);
-		}
-
-	/* relocate node if selected */
-	if (active > -1 &&
-		x >= xmin && x <= xmax && y >= ymin && y <= ymax)
-		{
-		/* find upper and lower bounds for current node */
-		if (active == 0)
-			ylim_min = ymin;
-		else
-			ylim_min = edit_y[active - 1];
-		if (active == profile_edit.n - 1)
-			ylim_max = ymax;
-		else
-			ylim_max = edit_y[active + 1];
-
-		/* get new location */
-		if (x <= xmin)
-			x = xmin + 1;
-		if (x >= xmax)
-			x = xmax - 1;
-		if (y <= ylim_min)
-			y = ylim_min + 1;
-		if (y >= ylim_max)
-			y = ylim_max;
-		if (active == 0)
-			y = ymin;
-
-		/* unplot the current ping */
-		xg_fillrectangle(mbvt_xgid, edit_x[active]-2,
-			edit_y[active]-2, 4, 4,
-			pixel_values[WHITE],XG_SOLIDLINE);
-		if (active > 0)
-			{
-			xg_drawline(mbvt_xgid,
-				edit_x[active-1],edit_y[active-1],
-				edit_x[active],edit_y[active],
-				pixel_values[WHITE],XG_SOLIDLINE);
-			}
-		if (active < profile_edit.n - 1)
-			{
-			xg_drawline(mbvt_xgid,
-				edit_x[active],edit_y[active],
-				edit_x[active+1],edit_y[active+1],
-				pixel_values[WHITE],XG_SOLIDLINE);
-			}
-
-		/* get new location and velocity values */
-		edit_x[active] = x;
-		edit_y[active] = y;
-		profile_edit.velocity[active] = (x - xmin)/xscale + xminimum;
-		profile_edit.depth[active] = (y - ymin)/yscale + yminimum;
-
-		/* replot the current svp */
-		if (active > 0)
-			{
-			xg_drawline(mbvt_xgid,
-				edit_x[active-1],edit_y[active-1],
-				edit_x[active],edit_y[active],
-				pixel_values[BLACK],XG_SOLIDLINE);
-			}
-		if (active < profile_edit.n - 1)
-			{
-			xg_drawline(mbvt_xgid,
-				edit_x[active],edit_y[active],
-				edit_x[active+1],edit_y[active+1],
-				pixel_values[BLACK],XG_SOLIDLINE);
-			}
-		if (active > 0)
-			xg_fillrectangle(mbvt_xgid, edit_x[active-1]-2,
-				edit_y[active-1]-2, 4, 4,
-				pixel_values[BLACK],XG_SOLIDLINE);
-		xg_fillrectangle(mbvt_xgid, edit_x[active]-2,
-			edit_y[active]-2, 4, 4,
-			pixel_values[BLACK],XG_SOLIDLINE);
-		if (active < profile_edit.n - 1)
-			xg_fillrectangle(mbvt_xgid, edit_x[active+1]-2,
-				edit_y[active+1]-2, 4, 4,
-				pixel_values[BLACK],XG_SOLIDLINE);
-		}
-	else
-		status = MB_FAILURE;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-/* This function is called when the middle mouse button is pressed    */
-/*   when it is in the canvas area. It finds the mouse location so    */
-/*   the program knows where to add a new svp node .                  */
-/* Called by:                                                         */
-/*                  action_canvas_event                               */
-/* Functions called:                                                  */
-/*                  none                                              */
-/* Function returns:                                                  */
-/*                  status                                            */
-/*--------------------------------------------------------------------*/
-int mbvt_action_add_node(int x, int y)
-{
-	/* local variables */
-	char	*function_name = "mbvt_action_add_node";
-	int	status = MB_SUCCESS;
-	int	add_i, add_x, add_y;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input values:\n");
-		fprintf(stderr,"dbg2       x:            %d\n",x);
-		fprintf(stderr,"dbg2       y:            %d\n",y);
-		}
-
-	/* select node if possible */
-	status = MB_FAILURE;
-	if (x >= xmin && x <= xmax && y >= ymin && y <= ymax)
-		{
-
-		/* find the vertical place of new node */
-		add_i = -1;
-		for (i = 1; i < profile_edit.n && add_i == -1; i++)
-			{
-			if (y > edit_y[i-1]
-				&& y < edit_y[i])
-			    {
-			    add_i = i;
-			    add_x = x;
-			    add_y = y;
-			    }
-			else if (y == edit_y[i])
-			    {
-			    add_i = i;
-			    add_x = x;
-			    add_y = y - 1;
-			    }
-			}
-
-		/* add in the node */
-		if (add_i > -1
-			&& profile_edit.n < profile_edit.nalloc)
-			{
-			for (i=profile_edit.n-1;i>=add_i;i--)
-			    {
-			    profile_edit.depth[i+1] = profile_edit.depth[i];
-			    profile_edit.velocity[i+1] = profile_edit.velocity[i];
-			    edit_x[i+1] = edit_x[i];
-			    edit_y[i+1] = edit_y[i];
-			    }
-			profile_edit.n++;
-			edit_x[add_i] = add_x;
-			edit_y[add_i] = add_y;
-			profile_edit.velocity[add_i] = (add_x - xmin)/xscale + xminimum;
-			profile_edit.depth[add_i] = (add_y - ymin)/yscale + yminimum;
-
-			status = MB_SUCCESS;
-
-			mbvt_plot();
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-/* This function is called when the right mouse button is pressed    */
-/*   when it is in the canvas area. It finds the mouse location so    */
-/*   the program knows where to add a new svp node .                  */
-/* Called by:                                                         */
-/*                  action_canvas_event                               */
-/* Functions called:                                                  */
-/*                  none                                              */
-/* Function returns:                                                  */
-/*                  status                                            */
-/*--------------------------------------------------------------------*/
-int mbvt_action_delete_node(int x, int y)
-{
-	/* local variables */
-	char	*function_name = "mbvt_action_delete_node";
-	int	status = MB_SUCCESS;
-	double	distance, distance_min;
-	int	delete;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input values:\n");
-		fprintf(stderr,"dbg2       x:            %d\n",x);
-		fprintf(stderr,"dbg2       y:            %d\n",y);
-		}
-
-	/* select node if possible */
-	status = MB_FAILURE;
-	if (x >= xmin && x <= xmax && y >= ymin && y <= ymax)
-		{
-
-		/* find the closest node */
-		distance_min = 10.0;
-		delete = -1;
-		for (i=0;i<profile_edit.n;i++)
-			{
-			distance = (edit_x[i] - x)*(edit_x[i] - x)
-				+ (edit_y[i] - y)*(edit_y[i] - y);
-			if (distance < distance_min)
-				{
-				distance_min = distance;
-				delete = i;
-				}
-			}
-
-		/* delete the node */
-		if (delete > -1
-			&& profile_edit.n > 2)
-			{
-			for (i=delete;i<profile_edit.n;i++)
-			    {
-			    profile_edit.depth[i] = profile_edit.depth[i+1];
-			    profile_edit.velocity[i] = profile_edit.velocity[i+1];
-			    edit_x[i] = edit_x[i+1];
-			    edit_y[i] = edit_y[i+1];
-			    }
-			profile_edit.n--;
-
-			status = MB_SUCCESS;
-
-			mbvt_plot();
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbvt_get_format(char *file, int *form)
-{
-	/* local variables */
-	char	*function_name = "mbvt_get_format";
-	int	status = MB_SUCCESS;
-	mb_path	tmp;
-	int	tform;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       file:        %s\n",file);
-		fprintf(stderr,"dbg2       format:      %d\n",*form);
-		}
-
-	/* get filenames */
-	/* look for MB suffix convention */
-	if ((status = mb_get_format(verbose, file, tmp,
-				    &tform, &error))
-				    == MB_SUCCESS)
-	    {
-	    *form = tform;
-	    }
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       format:      %d\n",*form);
-		fprintf(stderr,"dbg2       error:      %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-/* This function reads the data from the multibeam file and makes    */
-/*   the calls to display it.                                         */
-/* Called by:                                                         */
-/*                  action_process_mb                                 */
-/*                  open_file_ok                                      */
-/* Functions called:                                                  */
-/*                  mb_malloc                                         */
-/*                  mb_format                                         */
-/*                  mb_buffer_close                                   */
-/*                  mb_close                                          */
-/*                  mb_free                                           */
-/*                  mb_read_init                                      */
-/*                  mb_error                                          */
-/*                  mb_buffer_init                                    */
-/*                  mb_buffer_load                                    */
-/*                  mbvt_setup_raytracing                             */
-/*                  mbvt_process_multibeam                           */
-/*                  mbvt_plot                                         */
-/* Function returns:                                                  */
-/*                  status                                            */
-/*--------------------------------------------------------------------*/
-int mbvt_open_swath_file(char *file, int form, int *numload)
-{
-	/* local variables */
-	char	*function_name = "mbvt_open_swath_file";
-	int	status = MB_SUCCESS;
-	int	kind;
-	double	navlon_levitus, navlat_levitus;
-	double	distance;
-	double	altitude;
-	double	sonardepth;
-	int	variable_beams;
-	int	traveltime;
-	int	beam_flagging;
-	mb_path	command;
-	mb_path	string;
-	mb_path	svp_file;
-	int	done, count;
-	struct stat file_status;
-	int	fstat;
-	double	rr, zz;
-        int     shellstatus;
-	int	i, k;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       file:        %s\n",file);
-		fprintf(stderr,"dbg2       format:      %d\n",form);
-		}
-
-	/* check for format with travel time data */
-	format = form;
-	if (format == 0)
-	    mb_get_format(verbose, file, NULL, &format, &error);
-	status = mb_format_flags(verbose, &format,
-			&variable_beams, &traveltime, &beam_flagging,
-			&error);
-	if (status == MB_FAILURE)
-		{
-		fprintf(stderr,"\nFormat id %d does not correspond to a supported format.\n",format);
-		fprintf(stderr,"\nSwath Sonar File <%s> not initialized for reading\n",file);
-		status = MB_FAILURE;
-		do_error_dialog("Data loading aborted.",
-				"The specified swath data",
-				"format is incorrect!");
-		return(status);
-		}
-	if (traveltime == MB_NO)
-		{
-		fprintf(stderr,"\nProgram <%s> requires travel time data.\n",program_name);
-		fprintf(stderr,"Format %d is does not include travel time data.\n",format);
-		fprintf(stderr,"Travel times and angles are being estimated\n");
-		fprintf(stderr,"assuming a 1500 m/s half-space\n");
-		status = MB_FAILURE;
-		do_error_dialog("Data doesn't include travel times!",
-				"Travel times and angles estimated",
-				"assuming 1500 m/s sound speed.");
-		}
-	/* if (traveltime == MB_NO)
-		{
-		fprintf(stderr,"\nProgram <%s> requires travel time data.\n",program_name);
-		fprintf(stderr,"Format %d is unacceptable because it does not include travel time data.\n",format);
-		fprintf(stderr,"\nSwath Sonar File <%s> not initialized for reading\n",file);
-		status = MB_FAILURE;
-		do_error_dialog("Data loading aborted.",
-				"The specified swath data format does",
-				"not include travel time data!");
-		return(status);
-		}*/
-
-	/* deallocate previously loaded data, if any */
-	mbvt_deallocate_swath();
-
-	/* initialize reading the input multibeam file */
-	strcpy(swathfile, file);
-	if ((status = mb_read_init(
-		verbose,swathfile,format,pings,lonflip,bounds,
-		btime_i,etime_i,speedmin,timegap,
-		&mbio_ptr,&btime_d,&etime_d,
-		&beams_bath,&beams_amp,&pixels_ss,&error)) != MB_SUCCESS)
-		{
-		mb_error(verbose,error,&message);
-		fprintf(stderr,"\nMBIO Error returned from function <mb_read_init>:\n%s\n",message);
-		fprintf(stderr,"\nSwath Sonar File <%s> not initialized for reading\n",swathfile);
-		status = MB_FAILURE;
-		do_error_dialog("Unable to open input swath file.",
-				"File may not exist or you may not have",
-				"read permission in this directory!");
-		return(status);
-		}
-
-	/* turn message on */
-	do_message_on("MBvelocitytool is loading data...");
-
-	/* set beam_first and beam_last */
-	beam_first = 0;
-	beam_last = beams_bath;
-
-	/* allocate memory for data arrays */
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(char), (void **)&beamflag, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(double), (void **)&bath, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_AMPLITUDE,
-						sizeof(double), (void **)&amp, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(double), (void **)&bathacrosstrack, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(double), (void **)&bathalongtrack, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_SIDESCAN,
-						sizeof(double), (void **)&ss, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_SIDESCAN,
-						sizeof(double), (void **)&ssacrosstrack, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_SIDESCAN,
-						sizeof(double), (void **)&ssalongtrack, &error);
-
-	/* if error initializing memory then quit */
-	if (error != MB_ERROR_NO_ERROR)
-		{
-		mb_error(verbose,error,&message);
-		fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",message);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-
-	/* initialize the buffer */
-	nbuffer = 0;
-	ssv_start = 0.0;
-	navlon_levitus = 0.0;
-	navlat_levitus = 0.0;
-
-	/* turn message on */
-	*numload = 0;
-	sprintf(string, "MBvelocitytool: %d records loaded so far...", *numload);
-	do_message_on(string);
-
-	/* Load with ESF File if avialable */
-        if (status == MB_SUCCESS)
-        {
-                status = mb_esf_load(verbose, swathfile, MB_YES, MB_NO, esffile, &esf, &error);
-
-        }
-
-	/* load data */
-	do
-		{
-		status = mb_get_all(verbose,mbio_ptr,&store_ptr,&kind,
-				ping[nbuffer].time_i,
-				&ping[nbuffer].time_d,
-				&ping[nbuffer].navlon,
-				&ping[nbuffer].navlat,
-				&ping[nbuffer].speed,
-				&ping[nbuffer].heading,
-				&distance,&altitude,&sonardepth,
-				&ping[nbuffer].beams_bath,&namp,&nss,
-				beamflag,bath,amp,
-				bathacrosstrack,bathalongtrack,
-				ss,ssacrosstrack,ssalongtrack,
-				comment,&error);
-		if (error <= MB_ERROR_NO_ERROR
-		    && (kind == MB_DATA_DATA)
-		    && (error == MB_ERROR_NO_ERROR
-			    || error == MB_ERROR_TIME_GAP
-			    || error == MB_ERROR_OUT_BOUNDS
-			    || error == MB_ERROR_OUT_TIME
-			    || error == MB_ERROR_SPEED_TOO_SMALL))
-			{
-			status = MB_SUCCESS;
-			error = MB_ERROR_NO_ERROR;
-			}
-		else if (error <= MB_ERROR_NO_ERROR)
-			{
-			status = MB_FAILURE;
-			error = MB_ERROR_OTHER;
-			}
-
-		/* Apply ESF Edits if available */
-                if (esf.nedit > 0 && error == MB_ERROR_NO_ERROR && kind == MB_DATA_DATA)
-                {
-                        status = mb_esf_apply(verbose, &esf,
-                                        ping[nbuffer].time_d, 0,
-                                        ping[nbuffer].beams_bath, beamflag, &error);
-
-                }
-
-		if (status == MB_SUCCESS
-			&& ping[nbuffer].allocated > 0
-			&& ping[nbuffer].allocated < ping[nbuffer].beams_bath)
-			{
-			ping[nbuffer].allocated = 0;
-			free(ping[nbuffer].beamflag);
-			free(ping[nbuffer].bath);
-			free(ping[nbuffer].bathacrosstrack);
-			free(ping[nbuffer].bathalongtrack);
-			free(ping[nbuffer].ttimes);
-			free(ping[nbuffer].angles);
-			free(ping[nbuffer].angles_forward);
-			free(ping[nbuffer].angles_null);
-			free(ping[nbuffer].heave);
-			free(ping[nbuffer].alongtrack_offset);
-			}
-		if (status == MB_SUCCESS
-			&& ping[nbuffer].allocated < ping[nbuffer].beams_bath)
-			{
-			ping[nbuffer].beamflag = NULL;
-			ping[nbuffer].bath = NULL;
-			ping[nbuffer].bathacrosstrack = NULL;
-			ping[nbuffer].bathalongtrack = NULL;
-			ping[nbuffer].ttimes = NULL;
-			ping[nbuffer].angles = NULL;
-			ping[nbuffer].angles_forward = NULL;
-			ping[nbuffer].angles_null = NULL;
-			ping[nbuffer].heave = NULL;
-			ping[nbuffer].alongtrack_offset = NULL;
-			ping[nbuffer].beamflag = (char *) malloc(ping[nbuffer].beams_bath*sizeof(char));
-			ping[nbuffer].bath = (double *) malloc(ping[nbuffer].beams_bath*sizeof(double));
-			ping[nbuffer].bathacrosstrack = (double *) malloc(ping[nbuffer].beams_bath*sizeof(double));
-			ping[nbuffer].bathalongtrack = (double *) malloc(ping[nbuffer].beams_bath*sizeof(double));
-			ping[nbuffer].ttimes = (double *) malloc(ping[nbuffer].beams_bath*sizeof(double));
-			ping[nbuffer].angles = (double *) malloc(ping[nbuffer].beams_bath*sizeof(double));
-			ping[nbuffer].angles_forward = (double *) malloc(ping[nbuffer].beams_bath*sizeof(double));
-			ping[nbuffer].angles_null = (double *) malloc(ping[nbuffer].beams_bath*sizeof(double));
-			ping[nbuffer].heave = (double *) malloc(ping[nbuffer].beams_bath*sizeof(double));
-			ping[nbuffer].alongtrack_offset = (double *) malloc(ping[nbuffer].beams_bath*sizeof(double));
-			ping[nbuffer].allocated = ping[nbuffer].beams_bath;
-			}
-		if (status == MB_SUCCESS
-			&& beams_bath < ping[nbuffer].beams_bath)
-			beams_bath = ping[nbuffer].beams_bath;
-
-		if (status == MB_SUCCESS
-			&& ping[nbuffer].allocated > 0)
-			{
-			for (i=0;i<ping[nbuffer].beams_bath;i++)
-			    {
-			    ping[nbuffer].beamflag[i] = beamflag[i];
-			    ping[nbuffer].bath[i] = bath[i];
-			    ping[nbuffer].bathacrosstrack[i] = bathacrosstrack[i];
-			    ping[nbuffer].bathalongtrack[i] = bathalongtrack[i];
-			    }
-			if (traveltime == MB_YES)
-			    {
-			    status = mb_ttimes(verbose,mbio_ptr,
-					    store_ptr,&kind,&nbeams,
-					    ping[nbuffer].ttimes,
-					    ping[nbuffer].angles,
-					    ping[nbuffer].angles_forward,
-					    ping[nbuffer].angles_null,
-					    ping[nbuffer].heave,
-					    ping[nbuffer].alongtrack_offset,
-					    &ping[nbuffer].sonardepth,
-					    &ping[nbuffer].ssv,&error);
-			    }
-			else
-			    {
-			    nbeams = ping[nbuffer].beams_bath;
-			    ping[nbuffer].sonardepth = sonardepth;
-			    ping[nbuffer].ssv = 1500.0;
-			    for (i=0;i<ping[nbuffer].beams_bath;i++)
-				{
-				if (mb_beam_ok(ping[nbuffer].beamflag[i]))
-				    {
-				    zz = bath[i] - sonardepth;
-				    rr = sqrt(zz * zz
-					+ bathacrosstrack[i] * bathacrosstrack[i]
-					+ bathalongtrack[i] * bathalongtrack[i]);
-				    ping[nbuffer].ttimes[i] = rr / 750.0;
-				    mb_xyz_to_takeoff(verbose,
-						bathacrosstrack[i],
-						bathalongtrack[i],
-						(bath[i] - sonardepth),
-						&ping[nbuffer].angles[i],
-						&ping[nbuffer].angles_forward[i],
-						&error);
-				    ping[nbuffer].angles_null[i] = 0.0;
-				    ping[nbuffer].heave[i] = 0.0;
-				    ping[nbuffer].alongtrack_offset[i] = 0.0;
-				    }
-				}
-			    }
-
-			/* get first nav */
-			if (navlon_levitus == 0.0
-			    && navlat_levitus == 0.0)
-			    {
-			    navlon_levitus = ping[nbuffer].navlon;
-			    navlat_levitus = ping[nbuffer].navlat;
-			    }
-
-			/* check for first nonzero ssv */
-			if (ping[nbuffer].ssv > 0.0 && ssv_start == 0.0)
-				ssv_start = ping[nbuffer].ssv;
-			}
-		if (status == MB_SUCCESS)
-			{
-			nbuffer++;
-			(*numload)++;
-
-			/* update message every 250 records */
-			if ((*numload) % 250 == 0)
-			    {
-			    sprintf(string, "MBvelocitytool: %d records loaded so far...", *numload);
-			    do_message_on(string);
-			    }
-			}
-		}
-	while (error <= MB_ERROR_NO_ERROR && nbuffer < MBVT_BUFFER_SIZE);
-
-	/* close input file */
-	status = mb_close(verbose,&mbio_ptr,&error);
-
-	/* Close ESF file if avialable */
-        if (esf.nedit > 0)
-                mb_esf_close(verbose, &esf, &error);
-
-	/* define success */
-	if (nbuffer > 0)
-		{
-		status = MB_SUCCESS;
-		error = MB_ERROR_NO_ERROR;
-		}
-
-	/* allocate resicual arrays to accomodate greatest number of beams */
-	if (status == MB_SUCCESS)
-		{
-		status = mb_mallocd(verbose,__FILE__,__LINE__,beams_bath*sizeof(double),(void **)&depth,&error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,beams_bath*sizeof(double),(void **)&acrosstrack,&error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,beams_bath*sizeof(double),(void **)&angle,&error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,beams_bath*sizeof(double),(void **)&residual,&error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,beams_bath*sizeof(double),(void **)&res_sd,&error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,beams_bath*sizeof(int),(void **)&nresidual,&error);
-		}
-
-	/* set error message */
-	if (nbuffer <= 0)
-		do_error_dialog("No data were read from the input",
-				"swath file. You may have specified an",
-				"incorrect MB-System format id!");
-
-	if (ssv_start <= 0.0)
-		ssv_start = 1500.0;
-
-	/* get approximate min max depths */
-	bath_min = 10000.0;
-	bath_max = 0.0;
-	for (k=0;k<nbuffer;k++)
-		{
-		/* loop over the beams */
-		for (i=0;i<ping[k].beams_bath;i++)
-		    {
-		    if (mb_beam_ok(ping[k].beamflag[i]))
-			{
-			depth[i] = 750 * ping[k].ttimes[i]
-				* cos(DTR * ping[k].angles[i])
-				+ ping[k].sonardepth + ping[k].heave[i];
-
-			/* get min max depths */
-			if (depth[i] < bath_min)
-			    bath_min = depth[i];
-			if (depth[i] > bath_max)
-			    bath_max = depth[i];
-			}
-		     }
-		}
-
-	/* set maxdepth and apply */
-	if (bath_max > 0.0 && bath_max < 13000.0)
-		{
-		maxdepth = 1.25 * bath_max;
-		resrange = 0.02 * bath_max;
-		if (resrange > 200.0)
-			resrange = 200.0;
-		else if (resrange < 0.1)
-			resrange = 0.1;
-		do_set_controls();
-		}
-
-	/* output info */
-	if (verbose >= 1)
-		{
-		if (status == MB_SUCCESS)
-			fprintf(stderr,"\nSwath Sonar File <%s> read\n",swathfile);
-		else
-			fprintf(stderr,"\nSwath Sonar File <%s> not read\n",swathfile);
-		fprintf(stderr,"Swath Sonar Data Format ID:   %d\n",format);
-		fprintf(stderr,"Records loaded into buffer: %d\n",*numload);
-		fprintf(stderr,"Records in buffer:          %d\n",nbuffer);
-		}
-
-	/* turn message off */
-	do_message_off();
-
-	/* get editable svp if needed */
-	if (edit != MB_YES)
-	    mbvt_new_edit_profile();
-
-	/* add Levitus display profile if nav available */
-	if (navlon_levitus != 0.0 || navlat_levitus != 0.0)
-		{
-		sprintf(command,
-			"mblevitus -R%f/%f -Ombvt_levitus_tmp.svp\n",
-			navlon_levitus, navlat_levitus);
-		shellstatus = system(command);
-		mbvt_open_display_profile("mbvt_levitus_tmp.svp");
-		shellstatus = system("rm -f mbvt_levitus_tmp.svp");
-		}
-
-	/* load svp files generated by mbsvplist if available */
-	done = MB_NO;
-	count = 0;
-	while (done == MB_NO)
-		{
-		sprintf(svp_file, "%s_%3.3d.svp", swathfile, count);
-		if ((fstat = stat(svp_file, &file_status)) == 0
-		    && (file_status.st_mode & S_IFMT) != S_IFDIR)
-		    {
-		    mbvt_open_display_profile(svp_file);
-		    }
-		else if (count > 0)
-		    done = MB_YES;
-		count++;
-		}
-
-	/* allocate memory for raytracing arrays */
-	status = mb_mallocd(verbose,__FILE__,__LINE__,beams_bath*sizeof(int),(void **)&nraypath,&error);
-	status = mb_mallocd(verbose,__FILE__,__LINE__,beams_bath*sizeof(double *),
-				(void **)&raypathx,&error);
-	status = mb_mallocd(verbose,__FILE__,__LINE__,beams_bath*sizeof(double *),
-				(void **)&raypathy,&error);
-	nraypathmax = 100*profile_edit.n;
-	for (i=0;i<beams_bath;i++)
-		{
-		status = mb_mallocd(verbose,__FILE__,__LINE__,nraypathmax*sizeof(double),
-				(void **)&(raypathx[i]),&error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,nraypathmax*sizeof(double),
-				(void **)&(raypathy[i]),&error);
-		}
-
-	/* if error initializing memory then quit */
-	if (error != MB_ERROR_NO_ERROR)
-		{
-		mb_error(verbose,error,&message);
-		fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",message);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-
-	/* process the data */
-	if (status == MB_SUCCESS && edit == MB_YES)
-		status = mbvt_process_multibeam();
-
-	/* plot everything */
-	mbvt_plot();
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       numload:    %d\n",*numload);
-		fprintf(stderr,"dbg2       error:      %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-/* This function deallocates swath data.                              */
-/* Called by:                                                         */
-/*                  mbvt_open_swath_file                              */
-/*                  mbvt_quit                                         */
-/* Functions called:                                                  */
-/*                  mb_free                                           */
-/*                  free                                              */
-/* Function returns:                                                  */
-/*                  status                                            */
-/*--------------------------------------------------------------------*/
-int mbvt_deallocate_swath()
-{
-	/* local variables */
-	char	*function_name = "mbvt_deallocate_swath";
-	int	status = MB_SUCCESS;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
-
-	/* deallocate previously loaded data, if any */
-	if (nbuffer > 0)
-		{
-		mb_freed(verbose,__FILE__,__LINE__,(void **)&nraypath,&error);
-		for (i=0;i<beams_bath;i++)
-			{
-			mb_freed(verbose,__FILE__,__LINE__,(void **)&(raypathx[i]),&error);
-			mb_freed(verbose,__FILE__,__LINE__,(void **)&(raypathy[i]),&error);
-			}
-		mb_freed(verbose,__FILE__,__LINE__,(void **)&raypathx,&error);
-		mb_freed(verbose,__FILE__,__LINE__,(void **)&raypathy,&error);
-		mb_freed(verbose,__FILE__,__LINE__,(void **)&depth,&error);
-		mb_freed(verbose,__FILE__,__LINE__,(void **)&acrosstrack,&error);
-		mb_freed(verbose,__FILE__,__LINE__,(void **)&angle,&error);
-		mb_freed(verbose,__FILE__,__LINE__,(void **)&residual,&error);
-		mb_freed(verbose,__FILE__,__LINE__,(void **)&res_sd,&error);
-		mb_freed(verbose,__FILE__,__LINE__,(void **)&nresidual,&error);
-                nraypath = NULL;
-                raypathx = NULL;
-                raypathy = NULL;
-                depth = NULL;
-                acrosstrack = NULL;
-                angle = NULL;
-                residual = NULL;
-                res_sd = NULL;
-                nresidual = NULL;
-
-		for (i=0;i<MBVT_BUFFER_SIZE;i++)
-			{
-			if (ping[i].allocated > 0 && ping[i].allocated != 60)
-			    {
-			    ping[i].allocated = 0;
-			    free(ping[i].beamflag);
-			    free(ping[i].bath);
-			    free(ping[i].bathacrosstrack);
-			    free(ping[i].bathalongtrack);
-			    free(ping[i].ttimes);
-			    free(ping[i].angles);
-			    free(ping[i].angles_forward);
-			    free(ping[i].angles_null);
-			    free(ping[i].heave);
-			    free(ping[i].alongtrack_offset);
-			    }
-			}
-		nbuffer = 0;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-/* This function is called when the "PROCESS MULTIBEAM"               */
-/*   selection is made from the menu bar.                             */
-/* Called by:                                                         */
-/*                  action_process_mb                                 */
-/* Functions called:                                                  */
-/*                  mb_ttimes                                         */
-/* Function returns:                                                  */
-/*                  status                                            */
-/*--------------------------------------------------------------------*/
-int mbvt_process_multibeam()
-{
-	/* local variables */
-	char	*function_name = "mbvt_process_multibeam";
-	int	status = MB_SUCCESS;
-	double	*dep;
-	double	*vel;
-	int	nvel;
-	void	*rt_svp = NULL;
-	int	first;
-	double	ttime;
-	int	ray_stat;
-	double	factor;
-	double	sx, sy, sxx, sxy;
-	double	delta, a, b;
-	int	ns;
-	double	depth_predict, res;
-	double	sonardepth, sonardepthshift, heave_use;
-        int     found;
-	int	i, j, k;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		}
-
-	/* check for data and velocity profile */
-	if (profile_edit.n <= 0)
-		{
-		fprintf(stderr,"\nNo edit velocity profile available - bathymetry processing aborted.\n");
-		status = MB_FAILURE;
-		return(status);
-		}
-	if (nbuffer <= 0)
-		{
-		fprintf(stderr,"\nNo swath sonar data available - bathymetry processing aborted.\n");
-		status = MB_FAILURE;
-		return(status);
-		}
-
-	/* turn message on */
-	do_message_on("MBvelocitytool is processing data...");
-
-	/* initialize residuals and raypaths */
-	for (i=0;i<beams_bath;i++)
-		{
-		angle[i] = 0.0;
-		residual[i] = 0.0;
-		res_sd[i] = 0.0;
-		nresidual[i] = 0;
-		nraypath[i] = 0;
-		}
-
-	/* initialize min-max variables */
-	bath_min = 10000.0;
-	bath_max = 0.0;
-
-	/* set up raytracing */
-	nvel = profile_edit.n;
-	vel = profile_edit.velocity;
-	dep = profile_edit.depth;
-	status = mb_rt_init(verbose, nvel, dep, vel, (void **)&rt_svp, &error);
-	first = MB_YES;
-	nbeams = 0;
-	rayxmax = 0.0;
-	raydepthmin = 10000;
-	raydepthmax = 0.0;
-
-	/* loop over the data records */
-	for (k=0;k<nbuffer;k++)
-		{
-		/* initialize linear fit variables */
-		sx = 0.0;
-		sy = 0.0;
-		sxx = 0.0;
-		sxy = 0.0;
-		ns = 0;
-		depth_predict = 0.0;
-		res = 0.0;
-
-		/* set surface sound speed to default if needed */
-		if (ping[k].ssv <= 0.0)
-			ping[k].ssv = ssv_start;
-		else
-			ssv_start = ping[k].ssv;
-
-		/* find a good heave value */
-                found = MB_NO;
-		for (i = 0; i < ping[k].beams_bath && found == MB_NO; i++)
-		    {
-		    if (mb_beam_ok(ping[k].beamflag[i]))
-			{
-			heave_use = ping[k].heave[i];
-                        found = MB_YES;
-                        }
-                    }
-
-		sonardepth = heave_use + ping[k].sonardepth;
-		sonardepthshift = 0.0;
-		if (first == MB_YES)
-			raydepthmin = MIN(raydepthmin, sonardepth);
-		if (sonardepth < 0.0)
-			{
-			sonardepthshift = sonardepth;
-			sonardepth = 0.0;
-			}
-
-		/* loop over the beams */
-		for (i=0;i<ping[k].beams_bath;i++)
-		    {
-		    /* trace the ray */
-		    if (mb_beam_ok(ping[k].beamflag[i]))
-			{
-			/* get max beam id */
-			nbeams = MAX(nbeams, i + 1);
-
-			/* get factor relating lateral distance to
-			    acrosstrack distance */
-			factor = cos(DTR*ping[k].angles_forward[i]);
-
-			/* trace rays */
-			if (first == MB_NO)
-			    {
-			    /* call raytracing without keeping
-				plotting list */
-			    status = mb_rt(verbose,
-				    rt_svp, sonardepth,
-				    ping[k].angles[i], 0.5*ping[k].ttimes[i],
-				    anglemode, ping[k].ssv, ping[k].angles_null[i],
-				    0, NULL, NULL, NULL,
-				    &acrosstrack[i], &depth[i],
-				    &ttime, &ray_stat, &error);
-			    }
-			else
-			    {
-			    /* call raytracing keeping
-				plotting list */
-			    status = mb_rt(verbose,
-				    rt_svp, sonardepth,
-				    ping[k].angles[i], 0.5*ping[k].ttimes[i],
-				    anglemode, ping[k].ssv, ping[k].angles_null[i],
-				    nraypathmax, &nraypath[i],
-				    raypathx[i], raypathy[i],
-				    &acrosstrack[i], &depth[i],
-				    &ttime, &ray_stat, &error);
-
-			    /* reset acrosstrack distances */
-			    for (j=0;j<nraypath[i];j++)
-				raypathx[i][j] = factor * raypathx[i][j];
-			    }
-
-			/* get acrosstrack distance */
-			acrosstrack[i] = factor * acrosstrack[i];
-
-			/* add to depth if needed */
-			depth[i] += sonardepthshift;
-
-			/* get min max depths */
-			if (depth[i] < bath_min)
-			    bath_min = depth[i];
-			if (depth[i] > bath_max)
-			    bath_max = depth[i];
-			if (first == MB_YES)
-				{
-				rayxmax = MAX(rayxmax, fabs(acrosstrack[i]));
-				raydepthmax = MAX(raydepthmax, depth[i]);
-				}
-
-			/* output some debug values */
-			if (verbose >= 5)
-			    fprintf(stderr,"dbg5       %3d %3d %6.3f %6.3f %8.2f %8.2f %8.2f %8.2f\n",
-				k, i, 0.5*ping[k].ttimes[i], ping[k].angles[i], acrosstrack[i],
-				ping[k].heave[i],ping[k].sonardepth,depth[i]);
-
-			/* get sums for linear fit */
-			sx += acrosstrack[i];
-			sy += depth[i];
-			sxx += acrosstrack[i]*acrosstrack[i];
-			sxy += acrosstrack[i]*depth[i];
-			ns++;
-			}
-		    }
-
-		/* reset first flag */
-		first = MB_NO;
-
-		/* get linear fit to ping */
-		if (ns > 0)
-			{
-			delta = ns*sxx - sx*sx;
-			a = (sxx*sy - sx*sxy)/delta;
-			b = (ns*sxy - sx*sy)/delta;
-			}
-
-		/* get residuals */
-		if (ns > 0)
-		  {
-		  /* output some debug values */
-		  if (verbose >= 5)
-			fprintf(stderr,"dbg5       beam   xtrack   depth     fit    residual\n");
-
-		  /* loop over all beams */
-		  for (i=0;i<ping[k].beams_bath;i++)
-		    if (mb_beam_ok(ping[k].beamflag[i]))
-			{
-			depth_predict = a + b*acrosstrack[i];
-			res = depth[i] - depth_predict;
-			angle[i] += ping[k].angles[i];
-			residual[i] += res;
-			res_sd[i] += res * res;
-			nresidual[i]++;
-
-			/* output some debug values */
-			if (verbose >= 5)
-		    		fprintf(stderr,"dbg5       %4d %10f %10f %10f %10f\n",
-					i,acrosstrack[i],depth[i],
-					depth_predict,res);
-
-			}
-		  }
-		}
-
-	/* end raytracing */
-	status = mb_rt_deall(verbose, (void **)&rt_svp, &error);
-
-	/* calculate final residuals */
-	beam_first = nbeams;
-	beam_last = -1;
-	for (i=0;i<nbeams;i++)
-		if (nresidual[i] > 0)
-			{
-			angle[i] = angle[i]/nresidual[i];
-			residual[i] = residual[i]/nresidual[i];
-			res_sd[i] = sqrt(res_sd[i]/nresidual[i]
-					    - residual[i] * residual[i]);
-			if (i < beam_first)
-				beam_first = i;
-			if (i > beam_last)
-				beam_last = i;
-			}
-
-	/* output residuals and stuff */
-	if (verbose >= 1)
-		{
-		fprintf(stderr,"\nCurrent Bathymetry Depth Range:\n");
-		fprintf(stderr,"\tminimum depth: %f\n",bath_min);
-		fprintf(stderr,"\tmaximum depth: %f\n",bath_max);
-		fprintf(stderr,"\nSwath Bathymetry Beam Residuals:\n");
-			fprintf(stderr," beam   angle   residual     sigma  calculations\n");
-		for (i=0;i<nbeams;i++)
-			fprintf(stderr," %4d  %7.3f  %9.3f  %9.3f  %5d\n",
-				i,angle[i], residual[i], res_sd[i], nresidual[i]);
-		}
-	/* turn message off */
-	do_message_off();
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/mbview/MB3DNavList.c b/src/mbview/MB3DNavList.c
deleted file mode 100644
index 615e3ee..0000000
--- a/src/mbview/MB3DNavList.c
+++ /dev/null
@@ -1,291 +0,0 @@
-
-/* Begin user code block <abstract> */
-/* End user code block <abstract> */
-
-/**
- * README: Portions of this file are merged at file generation
- * time. Edits can be made *only* in between specified code blocks, look
- * for keywords <Begin user code> and <End user code>.
- */
-/*
- * Generated by the ICS Builder Xcessory (BX).
- *
- * BuilderXcessory Version 6.1.3
- * Code Generator Xcessory 6.1.3 (08/19/04) CGX Scripts 6.1 Motif 2.1
- *
- */
-
-/* Begin user code block <file_comments> */
-
-#ifndef SANS
-#define SANS "helvetica"
-#endif
-#ifndef SERIF
-#define SERIF "times"
-#endif
-#ifndef MONO
-#define MONO "courier"
-#endif
-
-/* End user code block <file_comments> */
-
-#include <Xm/Xm.h>
-#include <Xm/Form.h>
-#include <Xm/Label.h>
-#include <Xm/PushB.h>
-#include <Xm/ScrolledW.h>
-#include <Xm/List.h>
-#include <Xm/Form.h>
-#include <Xm/Label.h>
-#include <Xm/PushB.h>
-#include <Xm/ScrolledW.h>
-#include <Xm/List.h>
-#include "MB3DNavList.h"
-
-/**
- * Common constant and pixmap declarations.
- */
-#include "creation-c.h"
-
-/**
- * Convenience functions from utilities file.
- */
-extern void RegisterBxConverters(XtAppContext);
-extern XtPointer BX_CONVERT(Widget, char *, char *, int, Boolean *);
-extern XtPointer BX_DOUBLE(double);
-extern XtPointer BX_SINGLE(float);
-extern void BX_MENU_POST(Widget, XtPointer, XEvent *, Boolean *);
-extern Pixmap XPM_PIXMAP(Widget, char **);
-extern void BX_SET_BACKGROUND_COLOR(Widget, ArgList, Cardinal *, Pixel);
-
-/**
- * Declarations for callbacks and handlers.
- */
-extern void do_mbview_navlist_delete(Widget, XtPointer, XtPointer);
-extern void do_mbview_navlist_popdown(Widget, XtPointer, XtPointer);
-extern void do_mbview_navlistselect(Widget, XtPointer, XtPointer);
-
-/*
- * This table is used to define class resources that are placed
- * in app-defaults. This table is necessary so each instance
- * of this class has the proper default resource values set.
- * This eliminates the need for each instance to have
- * its own app-defaults values. This table must be NULL terminated.
- */
-typedef struct _UIAppDefault {
-    char*      cName;       /* Class name */
-    char*      wName;       /* Widget name */
-    char*      cInstName;   /* Name of class instance (nested class) */
-    char*      wRsc;        /* Widget resource */
-    char*      value;       /* value read from app-defaults */
-} UIAppDefault;
-
-static Boolean doInitAppDefaults = True;
-static UIAppDefault  appDefaults[] = {
-    {NULL, NULL, NULL, NULL, NULL}
-};
-/*
- * The functions to call in the apputils.c
- */
-extern void InitAppDefaults(Widget, UIAppDefault*);
-extern void SetAppDefaults(Widget, UIAppDefault*, char*, Boolean);
-
-MB3DNavListDataPtr
-MB3DNavListCreate ( MB3DNavListDataPtr class_in, Widget parent, String name, ArgList args_in, Cardinal ac_in)
-{
-    Cardinal ac = 0;
-    Arg      args[256];
-    Boolean  argok = False;
-
-    /**
-     * Register the converters for the widgets.
-     */
-    RegisterBxConverters(XtWidgetToApplicationContext(parent));
-    XtInitializeWidgetClass((WidgetClass)xmFormWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmLabelWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmPushButtonWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmScrolledWindowWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmListWidgetClass);
-    /**
-     * Setup app-defaults fallback table if not already done.
-     */
-    if (doInitAppDefaults)
-    {
-        InitAppDefaults(parent, appDefaults);
-        doInitAppDefaults = False;
-    }
-    /**
-     * Now set the app-defaults for this instance.
-     */
-    SetAppDefaults(parent, appDefaults, name, False);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNresizePolicy, XmRESIZE_GROW); ac++;
-    XtSetArg(args[ac], XmNx, 76); ac++;
-    XtSetArg(args[ac], XmNy, 548); ac++;
-    XtSetArg(args[ac], XmNwidth, 415); ac++;
-    XtSetArg(args[ac], XmNheight, 243); ac++;
-    class_in->MB3DNavList = XmCreateForm(parent,
-        (char *)name,
-        args,
-        ac);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->MB3DNavList, (char *)"Navigation List:",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 10); ac++;
-        XtSetArg(args[ac], XmNwidth, 390); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->MB3DNavList, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_navlist_label = XmCreateLabel(class_in->MB3DNavList,
-            (char *)"mbview_navlist_label",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_navlist_label);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->MB3DNavList, (char *)"Delete Selected Navigation",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 200); ac++;
-        XtSetArg(args[ac], XmNwidth, 210); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->MB3DNavList, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_pushButton_navlist_delete = XmCreatePushButton(class_in->MB3DNavList,
-            (char *)"mbview_pushButton_navlist_delete",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_pushButton_navlist_delete);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbview_pushButton_navlist_delete, XmNactivateCallback, do_mbview_navlist_delete, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->MB3DNavList, (char *)"Dismiss",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 290); ac++;
-        XtSetArg(args[ac], XmNy, 200); ac++;
-        XtSetArg(args[ac], XmNwidth, 110); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->MB3DNavList, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_pushButton_navlist_dismiss = XmCreatePushButton(class_in->MB3DNavList,
-            (char *)"mbview_pushButton_navlist_dismiss",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_pushButton_navlist_dismiss);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbview_pushButton_navlist_dismiss, XmNactivateCallback, do_mbview_navlist_popdown, (XtPointer)0);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNscrollingPolicy, XmAPPLICATION_DEFINED); ac++;
-    XtSetArg(args[ac], XmNx, 10); ac++;
-    XtSetArg(args[ac], XmNy, 40); ac++;
-    XtSetArg(args[ac], XmNwidth, 390); ac++;
-    XtSetArg(args[ac], XmNheight, 150); ac++;
-    class_in->mbview_scrolledWindow_navlist = XmCreateScrolledWindow(class_in->MB3DNavList,
-        (char *)"mbview_scrolledWindow_navlist",
-        args,
-        ac);
-    XtManageChild(class_in->mbview_scrolledWindow_navlist);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNselectionPolicy, XmEXTENDED_SELECT); ac++;
-    XtSetArg(args[ac], XmNwidth, 390); ac++;
-    XtSetArg(args[ac], XmNheight, 150); ac++;
-    XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(class_in->mbview_scrolledWindow_navlist, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-        XmRFontList, 0, &argok)); if (argok) ac++;
-    class_in->mbview_list_navlist = XmCreateList(class_in->mbview_scrolledWindow_navlist,
-        (char *)"mbview_list_navlist",
-        args,
-        ac);
-    XtManageChild(class_in->mbview_list_navlist);
-    XtAddCallback(class_in->mbview_list_navlist, XmNsingleSelectionCallback, do_mbview_navlistselect, (XtPointer)0);
-    XtAddCallback(class_in->mbview_list_navlist, XmNextendedSelectionCallback, do_mbview_navlistselect, (XtPointer)0);
-    XtAddCallback(class_in->mbview_list_navlist, XmNbrowseSelectionCallback, do_mbview_navlistselect, (XtPointer)0);
-    ac = 0;
-    XtSetArg(args[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 10); ac++;
-    XtSetArg(args[ac], XmNrightOffset, 15); ac++;
-    XtSetArg(args[ac], XmNtopOffset, 10); ac++;
-    XtSetValues(class_in->mbview_navlist_label, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNtopAttachment, XmATTACH_NONE); ac++;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNbottomAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNbottomOffset, 13); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 10); ac++;
-    XtSetValues(class_in->mbview_pushButton_navlist_delete, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNtopAttachment, XmATTACH_NONE); ac++;
-    XtSetArg(args[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_NONE); ac++;
-    XtSetArg(args[ac], XmNbottomAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNbottomOffset, 13); ac++;
-    XtSetArg(args[ac], XmNrightOffset, 15); ac++;
-    XtSetValues(class_in->mbview_pushButton_navlist_dismiss, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNtopAttachment, XmATTACH_WIDGET); ac++;
-    XtSetArg(args[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNbottomAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNbottomOffset, 53); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 10); ac++;
-    XtSetArg(args[ac], XmNrightOffset, 15); ac++;
-    XtSetArg(args[ac], XmNtopOffset, 0); ac++;
-    XtSetArg(args[ac], XmNtopWidget, class_in->mbview_navlist_label); ac++;
-    XtSetValues(class_in->mbview_scrolledWindow_navlist, args, ac);
-
-
-    /*
-     * Assign functions to class record
-     */
-
-
-    /* Begin user code block <end_MB3DNavListCreate> */
-    /* End user code block <end_MB3DNavListCreate> */
-
-    return( class_in );
-}
diff --git a/src/mbview/MB3DNavList.h b/src/mbview/MB3DNavList.h
deleted file mode 100644
index 53353ae..0000000
--- a/src/mbview/MB3DNavList.h
+++ /dev/null
@@ -1,66 +0,0 @@
-
-/* Begin user code block <abstract> */
-/* End user code block <abstract> */
-
-/**
- * README: Portions of this file are merged at file generation
- * time. Edits can be made *only* in between specified code blocks, look
- * for keywords <Begin user code> and <End user code>.
- */
-/*
- * Generated by the ICS Builder Xcessory (BX).
- *
- * BuilderXcessory Version 6.1.3
- * Code Generator Xcessory 6.1.3 (08/19/04) CGX Scripts 6.1 Motif 2.1 
- *
- */
-#ifndef MB3DNavList_H
-#define MB3DNavList_H
-
-/**
- * Forward declare the class data pointer type so that it can
- * easily be used as a parameter to class functions and data members.
- */
-typedef struct _MB3DNavListData *MB3DNavListDataPtr;
-
-/**
- * Globally included information.
- */
-
-
-/**
- * Class specific includes.
- */
-
-
-typedef struct _MB3DNavListData
-{
-    /*
-     * Classes created by this class.
-     */
-    
-    /*
-     * Widgets created by this class.
-     */
-    Widget MB3DNavList;
-    Widget mbview_navlist_label;
-    Widget mbview_pushButton_navlist_delete;
-    Widget mbview_pushButton_navlist_dismiss;
-    Widget mbview_scrolledWindow_navlist;
-    Widget mbview_list_navlist;
-    
-    /**
-     * All methods and data..
-     */
-} MB3DNavListData;
-
-/*
- * Function: MB3DNavListCreate()
- *		The creation for class MB3DNavList.
- */
-MB3DNavListDataPtr MB3DNavListCreate(MB3DNavListDataPtr, Widget, String, ArgList, Cardinal);
-
-/**
- * Set routines for exposed resources.
- */
-#endif
diff --git a/src/mbview/MB3DRouteList.c b/src/mbview/MB3DRouteList.c
deleted file mode 100644
index e43af40..0000000
--- a/src/mbview/MB3DRouteList.c
+++ /dev/null
@@ -1,291 +0,0 @@
-
-/* Begin user code block <abstract> */
-/* End user code block <abstract> */
-
-/**
- * README: Portions of this file are merged at file generation
- * time. Edits can be made *only* in between specified code blocks, look
- * for keywords <Begin user code> and <End user code>.
- */
-/*
- * Generated by the ICS Builder Xcessory (BX).
- *
- * BuilderXcessory Version 6.1.3
- * Code Generator Xcessory 6.1.3 (08/19/04) CGX Scripts 6.1 Motif 2.1
- *
- */
-
-/* Begin user code block <file_comments> */
-
-#ifndef SANS
-#define SANS "helvetica"
-#endif
-#ifndef SERIF
-#define SERIF "times"
-#endif
-#ifndef MONO
-#define MONO "courier"
-#endif
-
-/* End user code block <file_comments> */
-
-#include <Xm/Xm.h>
-#include <Xm/Form.h>
-#include <Xm/Label.h>
-#include <Xm/PushB.h>
-#include <Xm/ScrolledW.h>
-#include <Xm/List.h>
-#include <Xm/Form.h>
-#include <Xm/Label.h>
-#include <Xm/PushB.h>
-#include <Xm/ScrolledW.h>
-#include <Xm/List.h>
-#include "MB3DRouteList.h"
-
-/**
- * Common constant and pixmap declarations.
- */
-#include "creation-c.h"
-
-/**
- * Convenience functions from utilities file.
- */
-extern void RegisterBxConverters(XtAppContext);
-extern XtPointer BX_CONVERT(Widget, char *, char *, int, Boolean *);
-extern XtPointer BX_DOUBLE(double);
-extern XtPointer BX_SINGLE(float);
-extern void BX_MENU_POST(Widget, XtPointer, XEvent *, Boolean *);
-extern Pixmap XPM_PIXMAP(Widget, char **);
-extern void BX_SET_BACKGROUND_COLOR(Widget, ArgList, Cardinal *, Pixel);
-
-/**
- * Declarations for callbacks and handlers.
- */
-extern void do_mbview_routelist_delete(Widget, XtPointer, XtPointer);
-extern void do_mbview_routelist_popdown(Widget, XtPointer, XtPointer);
-extern void do_mbview_routelistselect(Widget, XtPointer, XtPointer);
-
-/*
- * This table is used to define class resources that are placed
- * in app-defaults. This table is necessary so each instance
- * of this class has the proper default resource values set.
- * This eliminates the need for each instance to have
- * its own app-defaults values. This table must be NULL terminated.
- */
-typedef struct _UIAppDefault {
-    char*      cName;       /* Class name */
-    char*      wName;       /* Widget name */
-    char*      cInstName;   /* Name of class instance (nested class) */
-    char*      wRsc;        /* Widget resource */
-    char*      value;       /* value read from app-defaults */
-} UIAppDefault;
-
-static Boolean doInitAppDefaults = True;
-static UIAppDefault  appDefaults[] = {
-    {NULL, NULL, NULL, NULL, NULL}
-};
-/*
- * The functions to call in the apputils.c
- */
-extern void InitAppDefaults(Widget, UIAppDefault*);
-extern void SetAppDefaults(Widget, UIAppDefault*, char*, Boolean);
-
-MB3DRouteListDataPtr
-MB3DRouteListCreate ( MB3DRouteListDataPtr class_in, Widget parent, String name, ArgList args_in, Cardinal ac_in)
-{
-    Cardinal ac = 0;
-    Arg      args[256];
-    Boolean  argok = False;
-
-    /**
-     * Register the converters for the widgets.
-     */
-    RegisterBxConverters(XtWidgetToApplicationContext(parent));
-    XtInitializeWidgetClass((WidgetClass)xmFormWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmLabelWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmPushButtonWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmScrolledWindowWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmListWidgetClass);
-    /**
-     * Setup app-defaults fallback table if not already done.
-     */
-    if (doInitAppDefaults)
-    {
-        InitAppDefaults(parent, appDefaults);
-        doInitAppDefaults = False;
-    }
-    /**
-     * Now set the app-defaults for this instance.
-     */
-    SetAppDefaults(parent, appDefaults, name, False);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNresizePolicy, XmRESIZE_GROW); ac++;
-    XtSetArg(args[ac], XmNx, 72); ac++;
-    XtSetArg(args[ac], XmNy, 524); ac++;
-    XtSetArg(args[ac], XmNwidth, 415); ac++;
-    XtSetArg(args[ac], XmNheight, 239); ac++;
-    class_in->MB3DRouteList = XmCreateForm(parent,
-        (char *)name,
-        args,
-        ac);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->MB3DRouteList, (char *)"Route List:",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 10); ac++;
-        XtSetArg(args[ac], XmNwidth, 390); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->MB3DRouteList, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_routelist_label = XmCreateLabel(class_in->MB3DRouteList,
-            (char *)"mbview_routelist_label",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_routelist_label);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->MB3DRouteList, (char *)"Delete Selected Routes",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 200); ac++;
-        XtSetArg(args[ac], XmNwidth, 170); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->MB3DRouteList, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_pushButton_routelist_delete = XmCreatePushButton(class_in->MB3DRouteList,
-            (char *)"mbview_pushButton_routelist_delete",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_pushButton_routelist_delete);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbview_pushButton_routelist_delete, XmNactivateCallback, do_mbview_routelist_delete, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->MB3DRouteList, (char *)"Dismiss",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 290); ac++;
-        XtSetArg(args[ac], XmNy, 200); ac++;
-        XtSetArg(args[ac], XmNwidth, 110); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->MB3DRouteList, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_pushButton_routelist_dismiss = XmCreatePushButton(class_in->MB3DRouteList,
-            (char *)"mbview_pushButton_routelist_dismiss",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_pushButton_routelist_dismiss);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbview_pushButton_routelist_dismiss, XmNactivateCallback, do_mbview_routelist_popdown, (XtPointer)0);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNscrollingPolicy, XmAPPLICATION_DEFINED); ac++;
-    XtSetArg(args[ac], XmNx, 10); ac++;
-    XtSetArg(args[ac], XmNy, 40); ac++;
-    XtSetArg(args[ac], XmNwidth, 390); ac++;
-    XtSetArg(args[ac], XmNheight, 150); ac++;
-    class_in->mbview_scrolledWindow_routelist = XmCreateScrolledWindow(class_in->MB3DRouteList,
-        (char *)"mbview_scrolledWindow_routelist",
-        args,
-        ac);
-    XtManageChild(class_in->mbview_scrolledWindow_routelist);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNselectionPolicy, XmEXTENDED_SELECT); ac++;
-    XtSetArg(args[ac], XmNwidth, 390); ac++;
-    XtSetArg(args[ac], XmNheight, 150); ac++;
-    XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(class_in->mbview_scrolledWindow_routelist, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-        XmRFontList, 0, &argok)); if (argok) ac++;
-    class_in->mbview_list_routelist = XmCreateList(class_in->mbview_scrolledWindow_routelist,
-        (char *)"mbview_list_routelist",
-        args,
-        ac);
-    XtManageChild(class_in->mbview_list_routelist);
-    XtAddCallback(class_in->mbview_list_routelist, XmNsingleSelectionCallback, do_mbview_routelistselect, (XtPointer)0);
-    XtAddCallback(class_in->mbview_list_routelist, XmNextendedSelectionCallback, do_mbview_routelistselect, (XtPointer)0);
-    XtAddCallback(class_in->mbview_list_routelist, XmNbrowseSelectionCallback, do_mbview_routelistselect, (XtPointer)0);
-    ac = 0;
-    XtSetArg(args[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 10); ac++;
-    XtSetArg(args[ac], XmNrightOffset, 15); ac++;
-    XtSetArg(args[ac], XmNtopOffset, 10); ac++;
-    XtSetValues(class_in->mbview_routelist_label, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNtopAttachment, XmATTACH_NONE); ac++;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNbottomAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNbottomOffset, 9); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 10); ac++;
-    XtSetValues(class_in->mbview_pushButton_routelist_delete, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNtopAttachment, XmATTACH_NONE); ac++;
-    XtSetArg(args[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_NONE); ac++;
-    XtSetArg(args[ac], XmNbottomAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNbottomOffset, 9); ac++;
-    XtSetArg(args[ac], XmNrightOffset, 15); ac++;
-    XtSetValues(class_in->mbview_pushButton_routelist_dismiss, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNtopAttachment, XmATTACH_WIDGET); ac++;
-    XtSetArg(args[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNbottomAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNbottomOffset, 49); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 10); ac++;
-    XtSetArg(args[ac], XmNrightOffset, 15); ac++;
-    XtSetArg(args[ac], XmNtopOffset, 0); ac++;
-    XtSetArg(args[ac], XmNtopWidget, class_in->mbview_routelist_label); ac++;
-    XtSetValues(class_in->mbview_scrolledWindow_routelist, args, ac);
-
-
-    /*
-     * Assign functions to class record
-     */
-
-
-    /* Begin user code block <end_MB3DRouteListCreate> */
-    /* End user code block <end_MB3DRouteListCreate> */
-
-    return( class_in );
-}
diff --git a/src/mbview/MB3DRouteList.h b/src/mbview/MB3DRouteList.h
deleted file mode 100644
index 8d594bd..0000000
--- a/src/mbview/MB3DRouteList.h
+++ /dev/null
@@ -1,66 +0,0 @@
-
-/* Begin user code block <abstract> */
-/* End user code block <abstract> */
-
-/**
- * README: Portions of this file are merged at file generation
- * time. Edits can be made *only* in between specified code blocks, look
- * for keywords <Begin user code> and <End user code>.
- */
-/*
- * Generated by the ICS Builder Xcessory (BX).
- *
- * BuilderXcessory Version 6.1.3
- * Code Generator Xcessory 6.1.3 (08/19/04) CGX Scripts 6.1 Motif 2.1 
- *
- */
-#ifndef MB3DRouteList_H
-#define MB3DRouteList_H
-
-/**
- * Forward declare the class data pointer type so that it can
- * easily be used as a parameter to class functions and data members.
- */
-typedef struct _MB3DRouteListData *MB3DRouteListDataPtr;
-
-/**
- * Globally included information.
- */
-
-
-/**
- * Class specific includes.
- */
-
-
-typedef struct _MB3DRouteListData
-{
-    /*
-     * Classes created by this class.
-     */
-    
-    /*
-     * Widgets created by this class.
-     */
-    Widget MB3DRouteList;
-    Widget mbview_routelist_label;
-    Widget mbview_pushButton_routelist_delete;
-    Widget mbview_pushButton_routelist_dismiss;
-    Widget mbview_scrolledWindow_routelist;
-    Widget mbview_list_routelist;
-    
-    /**
-     * All methods and data..
-     */
-} MB3DRouteListData;
-
-/*
- * Function: MB3DRouteListCreate()
- *		The creation for class MB3DRouteList.
- */
-MB3DRouteListDataPtr MB3DRouteListCreate(MB3DRouteListDataPtr, Widget, String, ArgList, Cardinal);
-
-/**
- * Set routines for exposed resources.
- */
-#endif
diff --git a/src/mbview/MB3DSiteList.c b/src/mbview/MB3DSiteList.c
deleted file mode 100644
index 2641928..0000000
--- a/src/mbview/MB3DSiteList.c
+++ /dev/null
@@ -1,292 +0,0 @@
-
-/* Begin user code block <abstract> */
-/* End user code block <abstract> */
-
-/**
- * README: Portions of this file are merged at file generation
- * time. Edits can be made *only* in between specified code blocks, look
- * for keywords <Begin user code> and <End user code>.
- */
-/*
- * Generated by the ICS Builder Xcessory (BX).
- *
- * BuilderXcessory Version 6.1.3
- * Code Generator Xcessory 6.1.3 (08/19/04) CGX Scripts 6.1 Motif 2.1
- *
- */
-
-/* Begin user code block <file_comments> */
-
-#ifndef SANS
-#define SANS "helvetica"
-#endif
-#ifndef SERIF
-#define SERIF "times"
-#endif
-#ifndef MONO
-#define MONO "courier"
-#endif
-
-/* End user code block <file_comments> */
-
-
-#include <Xm/Xm.h>
-#include <Xm/Form.h>
-#include <Xm/PushB.h>
-#include <Xm/Label.h>
-#include <Xm/ScrolledW.h>
-#include <Xm/List.h>
-#include <Xm/Form.h>
-#include <Xm/PushB.h>
-#include <Xm/Label.h>
-#include <Xm/ScrolledW.h>
-#include <Xm/List.h>
-#include "MB3DSiteList.h"
-
-/**
- * Common constant and pixmap declarations.
- */
-#include "creation-c.h"
-
-/**
- * Convenience functions from utilities file.
- */
-extern void RegisterBxConverters(XtAppContext);
-extern XtPointer BX_CONVERT(Widget, char *, char *, int, Boolean *);
-extern XtPointer BX_DOUBLE(double);
-extern XtPointer BX_SINGLE(float);
-extern void BX_MENU_POST(Widget, XtPointer, XEvent *, Boolean *);
-extern Pixmap XPM_PIXMAP(Widget, char **);
-extern void BX_SET_BACKGROUND_COLOR(Widget, ArgList, Cardinal *, Pixel);
-
-/**
- * Declarations for callbacks and handlers.
- */
-extern void do_mbview_sitelist_popdown(Widget, XtPointer, XtPointer);
-extern void do_mbview_sitelist_delete(Widget, XtPointer, XtPointer);
-extern void do_mbview_sitelistselect(Widget, XtPointer, XtPointer);
-
-/*
- * This table is used to define class resources that are placed
- * in app-defaults. This table is necessary so each instance
- * of this class has the proper default resource values set.
- * This eliminates the need for each instance to have
- * its own app-defaults values. This table must be NULL terminated.
- */
-typedef struct _UIAppDefault {
-    char*      cName;       /* Class name */
-    char*      wName;       /* Widget name */
-    char*      cInstName;   /* Name of class instance (nested class) */
-    char*      wRsc;        /* Widget resource */
-    char*      value;       /* value read from app-defaults */
-} UIAppDefault;
-
-static Boolean doInitAppDefaults = True;
-static UIAppDefault  appDefaults[] = {
-    {NULL, NULL, NULL, NULL, NULL}
-};
-/*
- * The functions to call in the apputils.c
- */
-extern void InitAppDefaults(Widget, UIAppDefault*);
-extern void SetAppDefaults(Widget, UIAppDefault*, char*, Boolean);
-
-MB3DSiteListDataPtr
-MB3DSiteListCreate ( MB3DSiteListDataPtr class_in, Widget parent, String name, ArgList args_in, Cardinal ac_in)
-{
-    Cardinal ac = 0;
-    Arg      args[256];
-    Boolean  argok = False;
-
-    /**
-     * Register the converters for the widgets.
-     */
-    RegisterBxConverters(XtWidgetToApplicationContext(parent));
-    XtInitializeWidgetClass((WidgetClass)xmFormWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmPushButtonWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmLabelWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmScrolledWindowWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmListWidgetClass);
-    /**
-     * Setup app-defaults fallback table if not already done.
-     */
-    if (doInitAppDefaults)
-    {
-        InitAppDefaults(parent, appDefaults);
-        doInitAppDefaults = False;
-    }
-    /**
-     * Now set the app-defaults for this instance.
-     */
-    SetAppDefaults(parent, appDefaults, name, False);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNresizePolicy, XmRESIZE_GROW); ac++;
-    XtSetArg(args[ac], XmNx, 87); ac++;
-    XtSetArg(args[ac], XmNy, 496); ac++;
-    XtSetArg(args[ac], XmNwidth, 411); ac++;
-    XtSetArg(args[ac], XmNheight, 286); ac++;
-    class_in->MB3DSiteList = XmCreateForm(parent,
-        (char *)name,
-        args,
-        ac);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->MB3DSiteList, (char *)"Dismiss",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 290); ac++;
-        XtSetArg(args[ac], XmNy, 240); ac++;
-        XtSetArg(args[ac], XmNwidth, 110); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->MB3DSiteList, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_pushButton_sitelist_dismiss = XmCreatePushButton(class_in->MB3DSiteList,
-            (char *)"mbview_pushButton_sitelist_dismiss",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_pushButton_sitelist_dismiss);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbview_pushButton_sitelist_dismiss, XmNactivateCallback, do_mbview_sitelist_popdown, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->MB3DSiteList, (char *)"Delete Selected Sites",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 240); ac++;
-        XtSetArg(args[ac], XmNwidth, 170); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->MB3DSiteList, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_pushButton_sitelist_delete = XmCreatePushButton(class_in->MB3DSiteList,
-            (char *)"mbview_pushButton_sitelist_delete",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_pushButton_sitelist_delete);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbview_pushButton_sitelist_delete, XmNactivateCallback, do_mbview_sitelist_delete, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->MB3DSiteList, (char *)"Site List:",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 10); ac++;
-        XtSetArg(args[ac], XmNwidth, 390); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->MB3DSiteList, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_sitelist_label = XmCreateLabel(class_in->MB3DSiteList,
-            (char *)"mbview_sitelist_label",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_sitelist_label);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNscrollingPolicy, XmAPPLICATION_DEFINED); ac++;
-    XtSetArg(args[ac], XmNx, 10); ac++;
-    XtSetArg(args[ac], XmNy, 46); ac++;
-    XtSetArg(args[ac], XmNwidth, 390); ac++;
-    XtSetArg(args[ac], XmNheight, 180); ac++;
-    class_in->mbview_scrolledWindow_sitelist = XmCreateScrolledWindow(class_in->MB3DSiteList,
-        (char *)"mbview_scrolledWindow_sitelist",
-        args,
-        ac);
-    XtManageChild(class_in->mbview_scrolledWindow_sitelist);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNselectionPolicy, XmEXTENDED_SELECT); ac++;
-    XtSetArg(args[ac], XmNwidth, 390); ac++;
-    XtSetArg(args[ac], XmNheight, 180); ac++;
-    XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(class_in->mbview_scrolledWindow_sitelist, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-        XmRFontList, 0, &argok)); if (argok) ac++;
-    class_in->mbview_list_sitelist = XmCreateList(class_in->mbview_scrolledWindow_sitelist,
-        (char *)"mbview_list_sitelist",
-        args,
-        ac);
-    XtManageChild(class_in->mbview_list_sitelist);
-    XtAddCallback(class_in->mbview_list_sitelist, XmNsingleSelectionCallback, do_mbview_sitelistselect, (XtPointer)0);
-    XtAddCallback(class_in->mbview_list_sitelist, XmNextendedSelectionCallback, do_mbview_sitelistselect, (XtPointer)0);
-    XtAddCallback(class_in->mbview_list_sitelist, XmNbrowseSelectionCallback, do_mbview_sitelistselect, (XtPointer)0);
-    ac = 0;
-    XtSetArg(args[ac], XmNtopAttachment, XmATTACH_NONE); ac++;
-    XtSetArg(args[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_NONE); ac++;
-    XtSetArg(args[ac], XmNbottomAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNbottomOffset, 16); ac++;
-    XtSetArg(args[ac], XmNrightOffset, 11); ac++;
-    XtSetValues(class_in->mbview_pushButton_sitelist_dismiss, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNtopAttachment, XmATTACH_NONE); ac++;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNbottomAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNbottomOffset, 16); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 10); ac++;
-    XtSetValues(class_in->mbview_pushButton_sitelist_delete, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 10); ac++;
-    XtSetArg(args[ac], XmNrightOffset, 11); ac++;
-    XtSetArg(args[ac], XmNtopOffset, 10); ac++;
-    XtSetValues(class_in->mbview_sitelist_label, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNtopAttachment, XmATTACH_WIDGET); ac++;
-    XtSetArg(args[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNbottomAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNbottomOffset, 60); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 10); ac++;
-    XtSetArg(args[ac], XmNrightOffset, 11); ac++;
-    XtSetArg(args[ac], XmNtopOffset, 6); ac++;
-    XtSetArg(args[ac], XmNtopWidget, class_in->mbview_sitelist_label); ac++;
-    XtSetValues(class_in->mbview_scrolledWindow_sitelist, args, ac);
-
-
-    /*
-     * Assign functions to class record
-     */
-
-
-    /* Begin user code block <end_MB3DSiteListCreate> */
-    /* End user code block <end_MB3DSiteListCreate> */
-
-    return( class_in );
-}
diff --git a/src/mbview/MB3DSiteList.h b/src/mbview/MB3DSiteList.h
deleted file mode 100644
index 894b54a..0000000
--- a/src/mbview/MB3DSiteList.h
+++ /dev/null
@@ -1,66 +0,0 @@
-
-/* Begin user code block <abstract> */
-/* End user code block <abstract> */
-
-/**
- * README: Portions of this file are merged at file generation
- * time. Edits can be made *only* in between specified code blocks, look
- * for keywords <Begin user code> and <End user code>.
- */
-/*
- * Generated by the ICS Builder Xcessory (BX).
- *
- * BuilderXcessory Version 6.1.3
- * Code Generator Xcessory 6.1.3 (08/19/04) CGX Scripts 6.1 Motif 2.1 
- *
- */
-#ifndef MB3DSiteList_H
-#define MB3DSiteList_H
-
-/**
- * Forward declare the class data pointer type so that it can
- * easily be used as a parameter to class functions and data members.
- */
-typedef struct _MB3DSiteListData *MB3DSiteListDataPtr;
-
-/**
- * Globally included information.
- */
-
-
-/**
- * Class specific includes.
- */
-
-
-typedef struct _MB3DSiteListData
-{
-    /*
-     * Classes created by this class.
-     */
-    
-    /*
-     * Widgets created by this class.
-     */
-    Widget MB3DSiteList;
-    Widget mbview_pushButton_sitelist_dismiss;
-    Widget mbview_pushButton_sitelist_delete;
-    Widget mbview_sitelist_label;
-    Widget mbview_scrolledWindow_sitelist;
-    Widget mbview_list_sitelist;
-    
-    /**
-     * All methods and data..
-     */
-} MB3DSiteListData;
-
-/*
- * Function: MB3DSiteListCreate()
- *		The creation for class MB3DSiteList.
- */
-MB3DSiteListDataPtr MB3DSiteListCreate(MB3DSiteListDataPtr, Widget, String, ArgList, Cardinal);
-
-/**
- * Set routines for exposed resources.
- */
-#endif
diff --git a/src/mbview/MB3DView.c b/src/mbview/MB3DView.c
deleted file mode 100644
index 8160690..0000000
--- a/src/mbview/MB3DView.c
+++ /dev/null
@@ -1,5174 +0,0 @@
-
-/* Begin user code block <abstract> */
-/* End user code block <abstract> */
-
-/**
- * README: Portions of this file are merged at file generation
- * time. Edits can be made *only* in between specified code blocks, look
- * for keywords <Begin user code> and <End user code>.
- */
-/*
- * Generated by the ICS Builder Xcessory (BX).
- *
- * BuilderXcessory Version 6.1.3
- * Code Generator Xcessory 6.1.3 (08/19/04) CGX Scripts 6.1 Motif 2.1
- *
- */
-
-/* Begin user code block <file_comments> */
-
-#ifndef SANS
-#define SANS "helvetica"
-#endif
-#ifndef SERIF
-#define SERIF "times"
-#endif
-#ifndef MONO
-#define MONO "courier"
-#endif
-
-/* End user code block <file_comments> */
-
-#include <Xm/Xm.h>
-#include <Xm/BulletinB.h>
-#include <Xm/PushB.h>
-#include <Xm/RowColumn.h>
-#include <Xm/ToggleB.h>
-#include <Xm/Label.h>
-#include <Xm/CascadeB.h>
-#include <Xm/Separator.h>
-#include <Xm/DrawingA.h>
-#include <Xm/DialogS.h>
-#include <Xm/MwmUtil.h>
-#include <Xm/TextF.h>
-#include <Xm/Scale.h>
-#include <Xm/Form.h>
-#include <Xm/ScrolledW.h>
-#include <Xm/BulletinB.h>
-#include <Xm/PushB.h>
-#include <Xm/RowColumn.h>
-#include <Xm/ToggleB.h>
-#include <Xm/Label.h>
-#include <Xm/CascadeB.h>
-#include <Xm/Separator.h>
-#include <Xm/DrawingA.h>
-#include <Xm/DialogS.h>
-#include <Xm/MwmUtil.h>
-#include <Xm/TextF.h>
-#include <Xm/Scale.h>
-#include <Xm/Form.h>
-#include <Xm/ScrolledW.h>
-#include "MB3DView.h"
-
-/**
- * Common constant and pixmap declarations.
- */
-#include "creation-c.h"
-
-/**
- * Convenience functions from utilities file.
- */
-extern void RegisterBxConverters(XtAppContext);
-extern XtPointer BX_CONVERT(Widget, char *, char *, int, Boolean *);
-extern XtPointer BX_DOUBLE(double);
-extern XtPointer BX_SINGLE(float);
-extern void BX_MENU_POST(Widget, XtPointer, XEvent *, Boolean *);
-extern Pixmap XPM_PIXMAP(Widget, char **);
-extern void BX_SET_BACKGROUND_COLOR(Widget, ArgList, Cardinal *, Pixel);
-
-/**
- * Declarations for callbacks and handlers.
- */
-extern void do_mbview_goaway(Widget, XtPointer, XtPointer);
-extern void do_mbview_clearpicks(Widget, XtPointer, XtPointer);
-extern void do_mbview_reset_view(Widget, XtPointer, XtPointer);
-extern void do_mbview_full_render(Widget, XtPointer, XtPointer);
-extern void do_mbview_mouse_rmode(Widget, XtPointer, XtPointer);
-extern void do_mbview_display_2D(Widget, XtPointer, XtPointer);
-extern void do_mbview_display_3D(Widget, XtPointer, XtPointer);
-extern void do_mbview_data_primary(Widget, XtPointer, XtPointer);
-extern void do_mbview_data_primaryslope(Widget, XtPointer, XtPointer);
-extern void do_mbview_data_secondary(Widget, XtPointer, XtPointer);
-extern void do_mbview_histogram(Widget, XtPointer, XtPointer);
-extern void do_mbview_overlay_none(Widget, XtPointer, XtPointer);
-extern void do_mbview_overlay_illumination(Widget, XtPointer, XtPointer);
-extern void do_mbview_overlay_slope(Widget, XtPointer, XtPointer);
-extern void do_mbview_overlay_secondary(Widget, XtPointer, XtPointer);
-extern void do_mbview_overlay_contour(Widget, XtPointer, XtPointer);
-extern void do_mbview_site(Widget, XtPointer, XtPointer);
-extern void do_mbview_route(Widget, XtPointer, XtPointer);
-extern void do_mbview_nav(Widget, XtPointer, XtPointer);
-extern void do_mbview_navdrape(Widget, XtPointer, XtPointer);
-extern void do_mbview_vector(Widget, XtPointer, XtPointer);
-extern void do_mbview_colortable_haxby(Widget, XtPointer, XtPointer);
-extern void do_mbview_colortable_bright(Widget, XtPointer, XtPointer);
-extern void do_mbview_colortable_muted(Widget, XtPointer, XtPointer);
-extern void do_mbview_colortable_gray(Widget, XtPointer, XtPointer);
-extern void do_mbview_colortable_flat(Widget, XtPointer, XtPointer);
-extern void do_mbview_colortable_sealevel1(Widget, XtPointer, XtPointer);
-extern void do_mbview_colortable_sealevel2(Widget, XtPointer, XtPointer);
-extern void do_mbview_view_profile(Widget, XtPointer, XtPointer);
-extern void do_mbview_colorboundspopup(Widget, XtPointer, XtPointer);
-extern void do_mbview_2dparmspopup(Widget, XtPointer, XtPointer);
-extern void do_mbview_3dparmspopup(Widget, XtPointer, XtPointer);
-extern void do_mbview_shadeparmspopup(Widget, XtPointer, XtPointer);
-extern void do_mbview_resolutionpopup(Widget, XtPointer, XtPointer);
-extern void do_mbview_projection_popup(Widget, XtPointer, XtPointer);
-extern void do_mbview_sitelistpopup(Widget, XtPointer, XtPointer);
-extern void do_mbview_routelistpopup(Widget, XtPointer, XtPointer);
-extern void do_mbview_navlistpopup(Widget, XtPointer, XtPointer);
-extern void do_mbview_mouse_mode(Widget, XtPointer, XtPointer);
-extern void do_mbview_aboutpopup(Widget, XtPointer, XtPointer);
-extern void do_mbview_dismiss(Widget, XtPointer, XtPointer);
-extern void do_mbview_colorboundsapply(Widget, XtPointer, XtPointer);
-extern void do_mbview_colorboundspopdown(Widget, XtPointer, XtPointer);
-extern void do_mbview_resolutionchange(Widget, XtPointer, XtPointer);
-extern void do_mbview_resolutionpopdown(Widget, XtPointer, XtPointer);
-extern void do_mbview_aboutpopdown(Widget, XtPointer, XtPointer);
-extern void do_mbview_shadeparmsapply(Widget, XtPointer, XtPointer);
-extern void do_mbview_shadeparmspopdown(Widget, XtPointer, XtPointer);
-extern void do_mbview_3dparmsapply(Widget, XtPointer, XtPointer);
-extern void do_mbview_3dparmspopdown(Widget, XtPointer, XtPointer);
-extern void do_mbview_2dparmsapply(Widget, XtPointer, XtPointer);
-extern void do_mbview_2dparmspopdown(Widget, XtPointer, XtPointer);
-extern void do_mbview_projection_popdown(Widget, XtPointer, XtPointer);
-extern void do_mbview_display_geographic(Widget, XtPointer, XtPointer);
-extern void do_mbview_display_utm(Widget, XtPointer, XtPointer);
-extern void do_mbview_display_spheroid(Widget, XtPointer, XtPointer);
-extern void do_mbview_profile_width(Widget, XtPointer, XtPointer);
-extern void do_mbview_profile_slope(Widget, XtPointer, XtPointer);
-extern void do_mbview_profile_exager(Widget, XtPointer, XtPointer);
-extern void do_mbview_profile_dismiss(Widget, XtPointer, XtPointer);
-
-/*
- * This table is used to define class resources that are placed
- * in app-defaults. This table is necessary so each instance
- * of this class has the proper default resource values set.
- * This eliminates the need for each instance to have
- * its own app-defaults values. This table must be NULL terminated.
- */
-typedef struct _UIAppDefault {
-    char*      cName;       /* Class name */
-    char*      wName;       /* Widget name */
-    char*      cInstName;   /* Name of class instance (nested class) */
-    char*      wRsc;        /* Widget resource */
-    char*      value;       /* value read from app-defaults */
-} UIAppDefault;
-
-static Boolean doInitAppDefaults = True;
-static UIAppDefault  appDefaults[] = {
-    {NULL, NULL, NULL, NULL, NULL}
-};
-/*
- * The functions to call in the apputils.c
- */
-extern void InitAppDefaults(Widget, UIAppDefault*);
-extern void SetAppDefaults(Widget, UIAppDefault*, char*, Boolean);
-
-MB3DViewDataPtr
-MB3DViewCreate ( MB3DViewDataPtr class_in, Widget parent, String name, ArgList args_in, Cardinal ac_in)
-{
-    Cardinal ac = 0;
-    Arg      args[256];
-    Boolean  argok = False;
-
-    /**
-     * Register the converters for the widgets.
-     */
-    RegisterBxConverters(XtWidgetToApplicationContext(parent));
-    XtInitializeWidgetClass((WidgetClass)xmBulletinBoardWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmPushButtonWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmRowColumnWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmToggleButtonWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmLabelWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmRowColumnWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmCascadeButtonWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmRowColumnWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmSeparatorWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmDrawingAreaWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmDialogShellWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmBulletinBoardWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmTextFieldWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmScaleWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmFormWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmScrolledWindowWidgetClass);
-    /**
-     * Setup app-defaults fallback table if not already done.
-     */
-    if (doInitAppDefaults)
-    {
-        InitAppDefaults(parent, appDefaults);
-        doInitAppDefaults = False;
-    }
-    /**
-     * Now set the app-defaults for this instance.
-     */
-    SetAppDefaults(parent, appDefaults, name, False);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNresizePolicy, XmRESIZE_GROW); ac++;
-    XtSetArg(args[ac], XmNx, 76); ac++;
-    XtSetArg(args[ac], XmNy, 447); ac++;
-    XtSetArg(args[ac], XmNwidth, 801); ac++;
-    XtSetArg(args[ac], XmNheight, 814); ac++;
-    class_in->MB3DView = XmCreateBulletinBoard(parent,
-        (char *)name,
-        args,
-        ac);
-    XtAddCallback(class_in->MB3DView, XmNdestroyCallback, do_mbview_goaway, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->MB3DView, (char *)"Clear",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 110); ac++;
-        XtSetArg(args[ac], XmNy, 410); ac++;
-        XtSetArg(args[ac], XmNwidth, 60); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->MB3DView, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_pushButton_clearpicks = XmCreatePushButton(class_in->MB3DView,
-            (char *)"mbview_pushButton_clearpicks",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_pushButton_clearpicks);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbview_pushButton_clearpicks, XmNactivateCallback, do_mbview_clearpicks, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->MB3DView, (char *)"Reset",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 60); ac++;
-        XtSetArg(args[ac], XmNy, 410); ac++;
-        XtSetArg(args[ac], XmNwidth, 50); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->MB3DView, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_pushButton_reset = XmCreatePushButton(class_in->MB3DView,
-            (char *)"mbview_pushButton_reset",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_pushButton_reset);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbview_pushButton_reset, XmNactivateCallback, do_mbview_reset_view, (XtPointer)0);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNborderWidth, 2); ac++;
-    XtSetArg(args[ac], XmNspacing, 0); ac++;
-    XtSetArg(args[ac], XmNx, 10); ac++;
-    XtSetArg(args[ac], XmNy, 490); ac++;
-    XtSetArg(args[ac], XmNwidth, 131); ac++;
-    XtSetArg(args[ac], XmNheight, 294); ac++;
-    XtSetArg(args[ac], XmNisHomogeneous, False); ac++;
-    class_in->mbview_radioBox_mouse = XmCreateRadioBox(class_in->MB3DView,
-        (char *)"mbview_radioBox_mouse",
-        args,
-        ac);
-    XtManageChild(class_in->mbview_radioBox_mouse);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_radioBox_mouse, (char *)"Pan & Zoom",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNshadowThickness, 2); ac++;
-        XtSetArg(args[ac], XmNvisibleWhenOff, False); ac++;
-        XtSetArg(args[ac], XmNheight, 32); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_radioBox_mouse, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_toggleButton_mode_rmove = XmCreateToggleButton(class_in->mbview_radioBox_mouse,
-            (char *)"mbview_toggleButton_mode_rmove",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_toggleButton_mode_rmove);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbview_toggleButton_mode_rmove, XmNvalueChangedCallback, do_mbview_mouse_rmode, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_radioBox_mouse, (char *)"Rotate Model",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNshadowThickness, 2); ac++;
-        XtSetArg(args[ac], XmNvisibleWhenOff, False); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_radioBox_mouse, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_toggleButton_mode_rrotate = XmCreateToggleButton(class_in->mbview_radioBox_mouse,
-            (char *)"mbview_toggleButton_mode_rrotate",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_toggleButton_mode_rrotate);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbview_toggleButton_mode_rrotate, XmNvalueChangedCallback, do_mbview_mouse_rmode, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_radioBox_mouse, (char *)"Rotate View",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNshadowThickness, 2); ac++;
-        XtSetArg(args[ac], XmNvisibleWhenOff, False); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_radioBox_mouse, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_toggleButton_mode_rviewpoint = XmCreateToggleButton(class_in->mbview_radioBox_mouse,
-            (char *)"mbview_toggleButton_mode_rviewpoint",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_toggleButton_mode_rviewpoint);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbview_toggleButton_mode_rviewpoint, XmNvalueChangedCallback, do_mbview_mouse_rmode, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_radioBox_mouse, (char *)"Shading",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNshadowThickness, 2); ac++;
-        XtSetArg(args[ac], XmNvisibleWhenOff, False); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_radioBox_mouse, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_toggleButton_mode_rshade = XmCreateToggleButton(class_in->mbview_radioBox_mouse,
-            (char *)"mbview_toggleButton_mode_rshade",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_toggleButton_mode_rshade);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbview_toggleButton_mode_rshade, XmNvalueChangedCallback, do_mbview_mouse_rmode, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_radioBox_mouse, (char *)"Pick Area",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNshadowThickness, 2); ac++;
-        XtSetArg(args[ac], XmNvisibleWhenOff, False); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_radioBox_mouse, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_toggleButton_mode_rarea = XmCreateToggleButton(class_in->mbview_radioBox_mouse,
-            (char *)"mbview_toggleButton_mode_rarea",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_toggleButton_mode_rarea);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbview_toggleButton_mode_rarea, XmNvalueChangedCallback, do_mbview_mouse_rmode, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_radioBox_mouse, (char *)"Edit Sites",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNshadowThickness, 2); ac++;
-        XtSetArg(args[ac], XmNvisibleWhenOff, False); ac++;
-        XtSetArg(args[ac], XmNwidth, 125); ac++;
-        XtSetArg(args[ac], XmNheight, 32); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_radioBox_mouse, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_toggleButton_mode_rsite = XmCreateToggleButton(class_in->mbview_radioBox_mouse,
-            (char *)"mbview_toggleButton_mode_rsite",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_toggleButton_mode_rsite);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbview_toggleButton_mode_rsite, XmNvalueChangedCallback, do_mbview_mouse_rmode, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_radioBox_mouse, (char *)"Edit Routes",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNshadowThickness, 2); ac++;
-        XtSetArg(args[ac], XmNvisibleWhenOff, False); ac++;
-        XtSetArg(args[ac], XmNwidth, 125); ac++;
-        XtSetArg(args[ac], XmNheight, 32); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_radioBox_mouse, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_toggleButton_mode_rroute = XmCreateToggleButton(class_in->mbview_radioBox_mouse,
-            (char *)"mbview_toggleButton_mode_rroute",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_toggleButton_mode_rroute);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbview_toggleButton_mode_rroute, XmNvalueChangedCallback, do_mbview_mouse_rmode, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_radioBox_mouse, (char *)"Pick Nav",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNshadowThickness, 2); ac++;
-        XtSetArg(args[ac], XmNvisibleWhenOff, False); ac++;
-        XtSetArg(args[ac], XmNwidth, 125); ac++;
-        XtSetArg(args[ac], XmNheight, 32); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_radioBox_mouse, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_toggleButton_mode_rnav = XmCreateToggleButton(class_in->mbview_radioBox_mouse,
-            (char *)"mbview_toggleButton_mode_rnav",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_toggleButton_mode_rnav);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbview_toggleButton_mode_rnav, XmNvalueChangedCallback, do_mbview_mouse_rmode, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_radioBox_mouse, (char *)"Pick Nav File",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNshadowThickness, 2); ac++;
-        XtSetArg(args[ac], XmNvisibleWhenOff, False); ac++;
-        XtSetArg(args[ac], XmNwidth, 125); ac++;
-        XtSetArg(args[ac], XmNheight, 32); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_radioBox_mouse, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_toggleButton_mode_rnavfile = XmCreateToggleButton(class_in->mbview_radioBox_mouse,
-            (char *)"mbview_toggleButton_mode_rnavfile",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_toggleButton_mode_rnavfile);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbview_toggleButton_mode_rnavfile, XmNvalueChangedCallback, do_mbview_mouse_rmode, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->MB3DView, (char *)"Done.",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNborderWidth, 1); ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNbackground,
-            BX_CONVERT(class_in->MB3DView, (char *)"White",
-            XmRPixel, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 450); ac++;
-        XtSetArg(args[ac], XmNwidth, 160); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->MB3DView, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_label_status = XmCreateLabel(class_in->MB3DView,
-            (char *)"mbview_label_status",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_label_status);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->MB3DView, (char *)"Full",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 410); ac++;
-        XtSetArg(args[ac], XmNwidth, 50); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->MB3DView, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_pushButton_fullrez = XmCreatePushButton(class_in->MB3DView,
-            (char *)"mbview_pushButton_fullrez",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_pushButton_fullrez);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbview_pushButton_fullrez, XmNactivateCallback, do_mbview_full_render, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->MB3DView, (char *)":::t\"Pick Info:\":t\"Lon 1: -122.894345 W\":t\"Lat 1: 37.308996 N\":t\"Depth 1: -324.314 m\":t\"Lon 2: -122.545680 W\":t\"Lat 2: 36.640972 N\":t\"Depth 2: -2338.025 m\":t\"Bearing: 157.4 deg\"\"Distance: 80333.459 m\"",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNborderWidth, 1); ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNbackground,
-            BX_CONVERT(class_in->MB3DView, (char *)"White",
-            XmRPixel, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 240); ac++;
-        XtSetArg(args[ac], XmNwidth, 160); ac++;
-        XtSetArg(args[ac], XmNheight, 160); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->MB3DView, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_label_pickinfo = XmCreateLabel(class_in->MB3DView,
-            (char *)"mbview_label_pickinfo",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_label_pickinfo);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNorientation, XmVERTICAL); ac++;
-    XtSetArg(args[ac], XmNx, 10); ac++;
-    XtSetArg(args[ac], XmNy, 10); ac++;
-    XtSetArg(args[ac], XmNwidth, 87); ac++;
-    XtSetArg(args[ac], XmNheight, 130); ac++;
-    class_in->mbview_menuBar_mbview = XmCreateMenuBar(class_in->MB3DView,
-        (char *)"mbview_menuBar_mbview",
-        args,
-        ac);
-    XtManageChild(class_in->mbview_menuBar_mbview);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_menuBar_mbview, (char *)"View",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 5); ac++;
-        XtSetArg(args[ac], XmNy, 5); ac++;
-        XtSetArg(args[ac], XmNwidth, 77); ac++;
-        XtSetArg(args[ac], XmNheight, 24); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_menuBar_mbview, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_cascadeButton_view = XmCreateCascadeButton(class_in->mbview_menuBar_mbview,
-            (char *)"mbview_cascadeButton_view",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_cascadeButton_view);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 168); ac++;
-    XtSetArg(args[ac], XmNy, 462); ac++;
-    XtSetArg(args[ac], XmNwidth, 211); ac++;
-    XtSetArg(args[ac], XmNheight, 568); ac++;
-    class_in->mbview_pulldownMenu_view = XmCreatePulldownMenu(XtParent(class_in->mbview_cascadeButton_view),
-        (char *)"mbview_pulldownMenu_view",
-        args,
-        ac);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_pulldownMenu_view, (char *)"Map Display",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_toggleButton_display_2D = XmCreateToggleButton(class_in->mbview_pulldownMenu_view,
-            (char *)"mbview_toggleButton_display_2D",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_toggleButton_display_2D);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbview_toggleButton_display_2D, XmNvalueChangedCallback, do_mbview_display_2D, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_pulldownMenu_view, (char *)"3D Display",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_toggleButton_display_3D = XmCreateToggleButton(class_in->mbview_pulldownMenu_view,
-            (char *)"mbview_toggleButton_display_3D",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_toggleButton_display_3D);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbview_toggleButton_display_3D, XmNvalueChangedCallback, do_mbview_display_3D, (XtPointer)0);
-
-    ac = 0;
-    class_in->mbview_separator10 = XmCreateSeparator(class_in->mbview_pulldownMenu_view,
-        (char *)"mbview_separator10",
-        args,
-        ac);
-    XtManageChild(class_in->mbview_separator10);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_pulldownMenu_view, (char *)"Topography",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_toggleButton_data_primary = XmCreateToggleButton(class_in->mbview_pulldownMenu_view,
-            (char *)"mbview_toggleButton_data_primary",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_toggleButton_data_primary);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbview_toggleButton_data_primary, XmNvalueChangedCallback, do_mbview_data_primary, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_pulldownMenu_view, (char *)"Topography Slope",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_toggleButton_data_primaryslope = XmCreateToggleButton(class_in->mbview_pulldownMenu_view,
-            (char *)"mbview_toggleButton_data_primaryslope",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_toggleButton_data_primaryslope);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbview_toggleButton_data_primaryslope, XmNvalueChangedCallback, do_mbview_data_primaryslope, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_pulldownMenu_view, (char *)"Overlay",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_toggleButton_data_secondary = XmCreateToggleButton(class_in->mbview_pulldownMenu_view,
-            (char *)"mbview_toggleButton_data_secondary",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_toggleButton_data_secondary);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbview_toggleButton_data_secondary, XmNvalueChangedCallback, do_mbview_data_secondary, (XtPointer)0);
-
-    ac = 0;
-    class_in->mbview_separator = XmCreateSeparator(class_in->mbview_pulldownMenu_view,
-        (char *)"mbview_separator",
-        args,
-        ac);
-    XtManageChild(class_in->mbview_separator);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_pulldownMenu_view, (char *)"Histogram Equalization",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_toggleButton_histogram = XmCreateToggleButton(class_in->mbview_pulldownMenu_view,
-            (char *)"mbview_toggleButton_histogram",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_toggleButton_histogram);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbview_toggleButton_histogram, XmNvalueChangedCallback, do_mbview_histogram, (XtPointer)0);
-
-    ac = 0;
-    class_in->mbview_separator21 = XmCreateSeparator(class_in->mbview_pulldownMenu_view,
-        (char *)"mbview_separator21",
-        args,
-        ac);
-    XtManageChild(class_in->mbview_separator21);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_pulldownMenu_view, (char *)"No Shading",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_toggleButton_overlay_none = XmCreateToggleButton(class_in->mbview_pulldownMenu_view,
-            (char *)"mbview_toggleButton_overlay_none",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_toggleButton_overlay_none);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbview_toggleButton_overlay_none, XmNvalueChangedCallback, do_mbview_overlay_none, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_pulldownMenu_view, (char *)"Shading by Illumination",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_toggleButton_overlay_illumination = XmCreateToggleButton(class_in->mbview_pulldownMenu_view,
-            (char *)"mbview_toggleButton_overlay_illumination",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_toggleButton_overlay_illumination);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbview_toggleButton_overlay_illumination, XmNvalueChangedCallback, do_mbview_overlay_illumination, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_pulldownMenu_view, (char *)"Shading by Slope",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_toggleButton_overlay_slope = XmCreateToggleButton(class_in->mbview_pulldownMenu_view,
-            (char *)"mbview_toggleButton_overlay_slope",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_toggleButton_overlay_slope);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbview_toggleButton_overlay_slope, XmNvalueChangedCallback, do_mbview_overlay_slope, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_pulldownMenu_view, (char *)"Shading by Overlay",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_toggleButton_overlay_secondary = XmCreateToggleButton(class_in->mbview_pulldownMenu_view,
-            (char *)"mbview_toggleButton_overlay_secondary",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_toggleButton_overlay_secondary);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbview_toggleButton_overlay_secondary, XmNvalueChangedCallback, do_mbview_overlay_secondary, (XtPointer)0);
-
-    ac = 0;
-    class_in->mbview_separator1 = XmCreateSeparator(class_in->mbview_pulldownMenu_view,
-        (char *)"mbview_separator1",
-        args,
-        ac);
-    XtManageChild(class_in->mbview_separator1);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_pulldownMenu_view, (char *)"Topography Contours",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_toggleButton_overlay_contour = XmCreateToggleButton(class_in->mbview_pulldownMenu_view,
-            (char *)"mbview_toggleButton_overlay_contour",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_toggleButton_overlay_contour);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbview_toggleButton_overlay_contour, XmNvalueChangedCallback, do_mbview_overlay_contour, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_pulldownMenu_view, (char *)"Sites",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_toggleButton_site = XmCreateToggleButton(class_in->mbview_pulldownMenu_view,
-            (char *)"mbview_toggleButton_site",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_toggleButton_site);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbview_toggleButton_site, XmNvalueChangedCallback, do_mbview_site, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_pulldownMenu_view, (char *)"Routes",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_toggleButton_route = XmCreateToggleButton(class_in->mbview_pulldownMenu_view,
-            (char *)"mbview_toggleButton_route",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_toggleButton_route);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbview_toggleButton_route, XmNvalueChangedCallback, do_mbview_route, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_pulldownMenu_view, (char *)"Navigation",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_toggleButton_nav = XmCreateToggleButton(class_in->mbview_pulldownMenu_view,
-            (char *)"mbview_toggleButton_nav",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_toggleButton_nav);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbview_toggleButton_nav, XmNvalueChangedCallback, do_mbview_nav, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_pulldownMenu_view, (char *)"Draped Navigation",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_toggleButton_navdrape = XmCreateToggleButton(class_in->mbview_pulldownMenu_view,
-            (char *)"mbview_toggleButton_navdrape",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_toggleButton_navdrape);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbview_toggleButton_navdrape, XmNvalueChangedCallback, do_mbview_navdrape, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_pulldownMenu_view, (char *)"Vector",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_toggleButton_vector = XmCreateToggleButton(class_in->mbview_pulldownMenu_view,
-            (char *)"mbview_toggleButton_vector",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_toggleButton_vector);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbview_toggleButton_vector, XmNvalueChangedCallback, do_mbview_vector, (XtPointer)0);
-
-    ac = 0;
-    class_in->mbview_separator8 = XmCreateSeparator(class_in->mbview_pulldownMenu_view,
-        (char *)"mbview_separator8",
-        args,
-        ac);
-    XtManageChild(class_in->mbview_separator8);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_pulldownMenu_view, (char *)"Haxby Colortable",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_toggleButton_colortable_haxby = XmCreateToggleButton(class_in->mbview_pulldownMenu_view,
-            (char *)"mbview_toggleButton_colortable_haxby",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_toggleButton_colortable_haxby);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbview_toggleButton_colortable_haxby, XmNvalueChangedCallback, do_mbview_colortable_haxby, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_pulldownMenu_view, (char *)"Bright Rainbow Colortable",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_toggleButton_colortable_bright = XmCreateToggleButton(class_in->mbview_pulldownMenu_view,
-            (char *)"mbview_toggleButton_colortable_bright",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_toggleButton_colortable_bright);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbview_toggleButton_colortable_bright, XmNvalueChangedCallback, do_mbview_colortable_bright, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_pulldownMenu_view, (char *)"Muted Rainbow Colortable",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_toggleButton_colortable_muted = XmCreateToggleButton(class_in->mbview_pulldownMenu_view,
-            (char *)"mbview_toggleButton_colortable_muted",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_toggleButton_colortable_muted);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbview_toggleButton_colortable_muted, XmNvalueChangedCallback, do_mbview_colortable_muted, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_pulldownMenu_view, (char *)"Grayscale Colortable",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_toggleButton_colortable_gray = XmCreateToggleButton(class_in->mbview_pulldownMenu_view,
-            (char *)"mbview_toggleButton_colortable_gray",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_toggleButton_colortable_gray);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbview_toggleButton_colortable_gray, XmNvalueChangedCallback, do_mbview_colortable_gray, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_pulldownMenu_view, (char *)"Flat Gray Colortable",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_toggleButton_colortable_flat = XmCreateToggleButton(class_in->mbview_pulldownMenu_view,
-            (char *)"mbview_toggleButton_colortable_flat",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_toggleButton_colortable_flat);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbview_toggleButton_colortable_flat, XmNvalueChangedCallback, do_mbview_colortable_flat, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_pulldownMenu_view, (char *)"Sealevel1 Colortable",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_toggleButton_colortable_sealevel1 = XmCreateToggleButton(class_in->mbview_pulldownMenu_view,
-            (char *)"mbview_toggleButton_colortable_sealevel1",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_toggleButton_colortable_sealevel1);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbview_toggleButton_colortable_sealevel1, XmNvalueChangedCallback, do_mbview_colortable_sealevel1, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_pulldownMenu_view, (char *)"Sealevel2 Colortable",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_toggleButton_colortable_sealevel2 = XmCreateToggleButton(class_in->mbview_pulldownMenu_view,
-            (char *)"mbview_toggleButton_colortable_sealevel2",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_toggleButton_colortable_sealevel2);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbview_toggleButton_colortable_sealevel2, XmNvalueChangedCallback, do_mbview_colortable_sealevel2, (XtPointer)0);
-
-    ac = 0;
-    class_in->separator1 = XmCreateSeparator(class_in->mbview_pulldownMenu_view,
-        (char *)"separator1",
-        args,
-        ac);
-    XtManageChild(class_in->separator1);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_pulldownMenu_view, (char *)"Profile",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_toggleButton_profile = XmCreateToggleButton(class_in->mbview_pulldownMenu_view,
-            (char *)"mbview_toggleButton_profile",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_toggleButton_profile);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbview_toggleButton_profile, XmNvalueChangedCallback, do_mbview_view_profile, (XtPointer)0);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNsubMenuId, class_in->mbview_pulldownMenu_view); ac++;
-    XtSetValues(class_in->mbview_cascadeButton_view, args, ac);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_menuBar_mbview, (char *)"Controls",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 5); ac++;
-        XtSetArg(args[ac], XmNy, 29); ac++;
-        XtSetArg(args[ac], XmNwidth, 77); ac++;
-        XtSetArg(args[ac], XmNheight, 24); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_menuBar_mbview, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_cascadeButton_controls = XmCreateCascadeButton(class_in->mbview_menuBar_mbview,
-            (char *)"mbview_cascadeButton_controls",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_cascadeButton_controls);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 0); ac++;
-    XtSetArg(args[ac], XmNy, 0); ac++;
-    XtSetArg(args[ac], XmNwidth, 144); ac++;
-    XtSetArg(args[ac], XmNheight, 220); ac++;
-    class_in->mbview_pulldownMenu_controls = XmCreatePulldownMenu(XtParent(class_in->mbview_cascadeButton_controls),
-        (char *)"mbview_pulldownMenu_controls",
-        args,
-        ac);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_pulldownMenu_controls, (char *)"Colors & Contours",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_pulldownMenu_controls, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_pushButton_colorbounds = XmCreatePushButton(class_in->mbview_pulldownMenu_controls,
-            (char *)"mbview_pushButton_colorbounds",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_pushButton_colorbounds);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbview_pushButton_colorbounds, XmNactivateCallback, do_mbview_colorboundspopup, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_pulldownMenu_controls, (char *)"2D Controls",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_pulldownMenu_controls, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_pushButton_2dview = XmCreatePushButton(class_in->mbview_pulldownMenu_controls,
-            (char *)"mbview_pushButton_2dview",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_pushButton_2dview);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbview_pushButton_2dview, XmNactivateCallback, do_mbview_2dparmspopup, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_pulldownMenu_controls, (char *)"3D Controls",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_pulldownMenu_controls, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_pushButton_3dview = XmCreatePushButton(class_in->mbview_pulldownMenu_controls,
-            (char *)"mbview_pushButton_3dview",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_pushButton_3dview);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbview_pushButton_3dview, XmNactivateCallback, do_mbview_3dparmspopup, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_pulldownMenu_controls, (char *)"Shading",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_pulldownMenu_controls, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_pushButton_shadeparms = XmCreatePushButton(class_in->mbview_pulldownMenu_controls,
-            (char *)"mbview_pushButton_shadeparms",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_pushButton_shadeparms);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbview_pushButton_shadeparms, XmNactivateCallback, do_mbview_shadeparmspopup, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_pulldownMenu_controls, (char *)"Resolution",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_pulldownMenu_controls, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_pushButton_resolution = XmCreatePushButton(class_in->mbview_pulldownMenu_controls,
-            (char *)"mbview_pushButton_resolution",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_pushButton_resolution);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbview_pushButton_resolution, XmNactivateCallback, do_mbview_resolutionpopup, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_pulldownMenu_controls, (char *)"Projections",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_pulldownMenu_controls, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_pushButton_projections = XmCreatePushButton(class_in->mbview_pulldownMenu_controls,
-            (char *)"mbview_pushButton_projections",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_pushButton_projections);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbview_pushButton_projections, XmNactivateCallback, do_mbview_projection_popup, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_pulldownMenu_controls, (char *)"Site List",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_pulldownMenu_controls, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_pushButton_sitelist = XmCreatePushButton(class_in->mbview_pulldownMenu_controls,
-            (char *)"mbview_pushButton_sitelist",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_pushButton_sitelist);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbview_pushButton_sitelist, XmNactivateCallback, do_mbview_sitelistpopup, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_pulldownMenu_controls, (char *)"Route List",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_pulldownMenu_controls, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_pushButton_routelist = XmCreatePushButton(class_in->mbview_pulldownMenu_controls,
-            (char *)"mbview_pushButton_routelist",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_pushButton_routelist);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbview_pushButton_routelist, XmNactivateCallback, do_mbview_routelistpopup, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_pulldownMenu_controls, (char *)"Navigation List",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_pulldownMenu_controls, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_pushButton_navlist = XmCreatePushButton(class_in->mbview_pulldownMenu_controls,
-            (char *)"mbview_pushButton_navlist",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_pushButton_navlist);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbview_pushButton_navlist, XmNactivateCallback, do_mbview_navlistpopup, (XtPointer)0);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNsubMenuId, class_in->mbview_pulldownMenu_controls); ac++;
-    XtSetValues(class_in->mbview_cascadeButton_controls, args, ac);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_menuBar_mbview, (char *)"Mouse",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 5); ac++;
-        XtSetArg(args[ac], XmNy, 53); ac++;
-        XtSetArg(args[ac], XmNwidth, 77); ac++;
-        XtSetArg(args[ac], XmNheight, 24); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_menuBar_mbview, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_cascadeButton_mouse = XmCreateCascadeButton(class_in->mbview_menuBar_mbview,
-            (char *)"mbview_cascadeButton_mouse",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_cascadeButton_mouse);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 0); ac++;
-    XtSetArg(args[ac], XmNy, 0); ac++;
-    XtSetArg(args[ac], XmNwidth, 129); ac++;
-    XtSetArg(args[ac], XmNheight, 220); ac++;
-    class_in->mbview_pulldownMenu_mouse = XmCreatePulldownMenu(XtParent(class_in->mbview_cascadeButton_mouse),
-        (char *)"mbview_pulldownMenu_mouse",
-        args,
-        ac);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_pulldownMenu_mouse, (char *)"Pan & Zoom",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNvisibleWhenOff, False); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_pulldownMenu_mouse, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_toggleButton_mode_move = XmCreateToggleButton(class_in->mbview_pulldownMenu_mouse,
-            (char *)"mbview_toggleButton_mode_move",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_toggleButton_mode_move);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbview_toggleButton_mode_move, XmNvalueChangedCallback, do_mbview_mouse_mode, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_pulldownMenu_mouse, (char *)"Rotate Model",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNvisibleWhenOff, False); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_pulldownMenu_mouse, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_toggleButton_mode_rotate = XmCreateToggleButton(class_in->mbview_pulldownMenu_mouse,
-            (char *)"mbview_toggleButton_mode_rotate",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_toggleButton_mode_rotate);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbview_toggleButton_mode_rotate, XmNvalueChangedCallback, do_mbview_mouse_mode, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_pulldownMenu_mouse, (char *)"Rotate View",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNvisibleWhenOff, False); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_pulldownMenu_mouse, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_toggleButton_mode_viewpoint = XmCreateToggleButton(class_in->mbview_pulldownMenu_mouse,
-            (char *)"mbview_toggleButton_mode_viewpoint",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_toggleButton_mode_viewpoint);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbview_toggleButton_mode_viewpoint, XmNvalueChangedCallback, do_mbview_mouse_mode, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_pulldownMenu_mouse, (char *)"Shading",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNvisibleWhenOff, False); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_pulldownMenu_mouse, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_toggleButton_mode_shade = XmCreateToggleButton(class_in->mbview_pulldownMenu_mouse,
-            (char *)"mbview_toggleButton_mode_shade",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_toggleButton_mode_shade);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbview_toggleButton_mode_shade, XmNvalueChangedCallback, do_mbview_mouse_mode, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_pulldownMenu_mouse, (char *)"Pick Area",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNvisibleWhenOff, False); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_pulldownMenu_mouse, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_toggleButton_mode_area = XmCreateToggleButton(class_in->mbview_pulldownMenu_mouse,
-            (char *)"mbview_toggleButton_mode_area",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_toggleButton_mode_area);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbview_toggleButton_mode_area, XmNvalueChangedCallback, do_mbview_mouse_mode, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_pulldownMenu_mouse, (char *)"Edit Sites",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_pulldownMenu_mouse, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_toggleButton_mode_site = XmCreateToggleButton(class_in->mbview_pulldownMenu_mouse,
-            (char *)"mbview_toggleButton_mode_site",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_toggleButton_mode_site);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbview_toggleButton_mode_site, XmNvalueChangedCallback, do_mbview_mouse_mode, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_pulldownMenu_mouse, (char *)"Edit Routes",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_pulldownMenu_mouse, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_toggleButton_mode_route = XmCreateToggleButton(class_in->mbview_pulldownMenu_mouse,
-            (char *)"mbview_toggleButton_mode_route",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_toggleButton_mode_route);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbview_toggleButton_mode_route, XmNvalueChangedCallback, do_mbview_mouse_mode, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_pulldownMenu_mouse, (char *)"Select Nav",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_pulldownMenu_mouse, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_toggleButton_mode_nav = XmCreateToggleButton(class_in->mbview_pulldownMenu_mouse,
-            (char *)"mbview_toggleButton_mode_nav",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_toggleButton_mode_nav);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbview_toggleButton_mode_nav, XmNvalueChangedCallback, do_mbview_mouse_mode, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_pulldownMenu_mouse, (char *)"Select Nav File",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_pulldownMenu_mouse, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_toggleButton_mode_navfile = XmCreateToggleButton(class_in->mbview_pulldownMenu_mouse,
-            (char *)"mbview_toggleButton_mode_navfile",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_toggleButton_mode_navfile);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbview_toggleButton_mode_navfile, XmNvalueChangedCallback, do_mbview_mouse_mode, (XtPointer)0);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNsubMenuId, class_in->mbview_pulldownMenu_mouse); ac++;
-    XtSetValues(class_in->mbview_cascadeButton_mouse, args, ac);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_menuBar_mbview, (char *)"Action",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 5); ac++;
-        XtSetArg(args[ac], XmNy, 77); ac++;
-        XtSetArg(args[ac], XmNwidth, 77); ac++;
-        XtSetArg(args[ac], XmNheight, 24); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_menuBar_mbview, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_cascadeButton_action = XmCreateCascadeButton(class_in->mbview_menuBar_mbview,
-            (char *)"mbview_cascadeButton_action",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_cascadeButton_action);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 0); ac++;
-    XtSetArg(args[ac], XmNy, 0); ac++;
-    XtSetArg(args[ac], XmNwidth, 123); ac++;
-    XtSetArg(args[ac], XmNheight, 28); ac++;
-    class_in->mbview_pulldownMenu_action = XmCreatePulldownMenu(XtParent(class_in->mbview_cascadeButton_action),
-        (char *)"mbview_pulldownMenu_action",
-        args,
-        ac);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_pulldownMenu_action, (char *)"About MBview...",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_pulldownMenu_action, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_pushButton_help_about = XmCreatePushButton(class_in->mbview_pulldownMenu_action,
-            (char *)"mbview_pushButton_help_about",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_pushButton_help_about);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbview_pushButton_help_about, XmNactivateCallback, do_mbview_aboutpopup, (XtPointer)0);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNsubMenuId, class_in->mbview_pulldownMenu_action); ac++;
-    XtSetValues(class_in->mbview_cascadeButton_action, args, ac);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_menuBar_mbview, (char *)"Dismiss",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 5); ac++;
-        XtSetArg(args[ac], XmNy, 101); ac++;
-        XtSetArg(args[ac], XmNwidth, 77); ac++;
-        XtSetArg(args[ac], XmNheight, 24); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_menuBar_mbview, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_cascadeButton_dismiss = XmCreateCascadeButton(class_in->mbview_menuBar_mbview,
-            (char *)"mbview_cascadeButton_dismiss",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_cascadeButton_dismiss);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 0); ac++;
-    XtSetArg(args[ac], XmNy, 0); ac++;
-    XtSetArg(args[ac], XmNwidth, 67); ac++;
-    XtSetArg(args[ac], XmNheight, 28); ac++;
-    class_in->mbview_pulldownMenu_dismiss = XmCreatePulldownMenu(XtParent(class_in->mbview_cascadeButton_dismiss),
-        (char *)"mbview_pulldownMenu_dismiss",
-        args,
-        ac);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_pulldownMenu_dismiss, (char *)"Dismiss",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_pulldownMenu_dismiss, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_pushButton_dismiss = XmCreatePushButton(class_in->mbview_pulldownMenu_dismiss,
-            (char *)"mbview_pushButton_dismiss",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_pushButton_dismiss);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbview_pushButton_dismiss, XmNactivateCallback, do_mbview_dismiss, (XtPointer)0);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNsubMenuId, class_in->mbview_pulldownMenu_dismiss); ac++;
-    XtSetValues(class_in->mbview_cascadeButton_dismiss, args, ac);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->MB3DView, (char *)":::t\"Mouse Mode:\":t\"  R: Pick\":t\"  L: Pan\"\"  M: Zoom\"",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNborderWidth, 1); ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNbackground,
-            BX_CONVERT(class_in->MB3DView, (char *)"White",
-            XmRPixel, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 150); ac++;
-        XtSetArg(args[ac], XmNwidth, 160); ac++;
-        XtSetArg(args[ac], XmNheight, 80); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->MB3DView, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_label_mouse = XmCreateLabel(class_in->MB3DView,
-            (char *)"mbview_label_mouse",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_label_mouse);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNborderWidth, 1); ac++;
-    XtSetArg(args[ac], XmNbackground,
-        BX_CONVERT(class_in->MB3DView, (char *)"white",
-        XmRPixel, 0, &argok)); if (argok) ac++;
-    XtSetArg(args[ac], XmNmarginHeight, 0); ac++;
-    XtSetArg(args[ac], XmNmarginWidth, 0); ac++;
-    XtSetArg(args[ac], XmNx, 180); ac++;
-    XtSetArg(args[ac], XmNy, 10); ac++;
-    XtSetArg(args[ac], XmNwidth, 590); ac++;
-    XtSetArg(args[ac], XmNheight, 490); ac++;
-    class_in->mbview_drawingArea_mbview = XmCreateDrawingArea(class_in->MB3DView,
-        (char *)"mbview_drawingArea_mbview",
-        args,
-        ac);
-    XtManageChild(class_in->mbview_drawingArea_mbview);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 814); ac++;
-    XtSetArg(args[ac], XmNy, 1149); ac++;
-    XtSetArg(args[ac], XmNwidth, 934); ac++;
-    XtSetArg(args[ac], XmNheight, 375); ac++;
-    XtSetArg(args[ac], XmNdeleteResponse, XmDO_NOTHING); ac++;
-    class_in->mbview_dialogShell_profile = XmCreateDialogShell(class_in->MB3DView,
-        (char *)"mbview_dialogShell_profile",
-        args,
-        ac);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_dialogShell_profile, (char *)"MBview Profile Display",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNdialogTitle, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNresizePolicy, XmRESIZE_GROW); ac++;
-        XtSetArg(args[ac], XmNx, 814); ac++;
-        XtSetArg(args[ac], XmNy, 1149); ac++;
-        XtSetArg(args[ac], XmNwidth, 934); ac++;
-        XtSetArg(args[ac], XmNheight, 375); ac++;
-        class_in->mbview_form_profile = XtCreateWidget((char *)"mbview_form_profile",
-            xmFormWidgetClass,
-            class_in->mbview_dialogShell_profile,
-            args,
-            ac);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_form_profile, (char *)"Display Width Multiple",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNtitleString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNminimum, 1); ac++;
-        XtSetArg(args[ac], XmNdecimalPoints, 0); ac++;
-        XtSetArg(args[ac], XmNvalue, 1); ac++;
-        XtSetArg(args[ac], XmNmaximum, 5); ac++;
-        XtSetArg(args[ac], XmNshowArrows, TRUE); ac++;
-        XtSetArg(args[ac], XmNscaleMultiple, 1); ac++;
-        XtSetArg(args[ac], XmNshowValue, TRUE); ac++;
-        XtSetArg(args[ac], XmNorientation, XmHORIZONTAL); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 263); ac++;
-        XtSetArg(args[ac], XmNwidth, 270); ac++;
-        XtSetArg(args[ac], XmNheight, 62); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_form_profile, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_scale_profile_width = XmCreateScale(class_in->mbview_form_profile,
-            (char *)"mbview_scale_profile_width",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_scale_profile_width);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbview_scale_profile_width, XmNvalueChangedCallback, do_mbview_profile_width, (XtPointer)0);
-    XtAddCallback(class_in->mbview_scale_profile_width, XmNdragCallback, do_mbview_profile_width, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_form_profile, (char *)"Slope Threshold",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNtitleString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNminimum, 1); ac++;
-        XtSetArg(args[ac], XmNdecimalPoints, 2); ac++;
-        XtSetArg(args[ac], XmNvalue, 200); ac++;
-        XtSetArg(args[ac], XmNmaximum, 200); ac++;
-        XtSetArg(args[ac], XmNshowArrows, TRUE); ac++;
-        XtSetArg(args[ac], XmNscaleMultiple, 1); ac++;
-        XtSetArg(args[ac], XmNshowValue, TRUE); ac++;
-        XtSetArg(args[ac], XmNorientation, XmHORIZONTAL); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 200); ac++;
-        XtSetArg(args[ac], XmNwidth, 270); ac++;
-        XtSetArg(args[ac], XmNheight, 63); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_form_profile, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_scale_profile_slope = XmCreateScale(class_in->mbview_form_profile,
-            (char *)"mbview_scale_profile_slope",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_scale_profile_slope);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbview_scale_profile_slope, XmNvalueChangedCallback, do_mbview_profile_slope, (XtPointer)0);
-    XtAddCallback(class_in->mbview_scale_profile_slope, XmNdragCallback, do_mbview_profile_slope, (XtPointer)0);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNscrollingPolicy, XmAUTOMATIC); ac++;
-    XtSetArg(args[ac], XmNx, 290); ac++;
-    XtSetArg(args[ac], XmNy, 0); ac++;
-    XtSetArg(args[ac], XmNwidth, 638); ac++;
-    XtSetArg(args[ac], XmNheight, 365); ac++;
-    class_in->mbview_scrolledWindow_profile = XmCreateScrolledWindow(class_in->mbview_form_profile,
-        (char *)"mbview_scrolledWindow_profile",
-        args,
-        ac);
-    XtManageChild(class_in->mbview_scrolledWindow_profile);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNborderWidth, 1); ac++;
-    XtSetArg(args[ac], XmNbackground,
-        BX_CONVERT(class_in->mbview_scrolledWindow_profile, (char *)"White",
-        XmRPixel, 0, &argok)); if (argok) ac++;
-    XtSetArg(args[ac], XmNwidth, 500); ac++;
-    XtSetArg(args[ac], XmNheight, 240); ac++;
-    class_in->mbview_drawingArea_profile = XmCreateDrawingArea(class_in->mbview_scrolledWindow_profile,
-        (char *)"mbview_drawingArea_profile",
-        args,
-        ac);
-    XtManageChild(class_in->mbview_drawingArea_profile);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_form_profile, (char *)":::t\"Profile Source: Route \":t\"Length: 1.0 km\":t\"Vertical Range: -100.5 to 512.0 m\"",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNborderWidth, 1); ac++;
-        XtSetArg(args[ac], XmNbackground,
-            BX_CONVERT(class_in->mbview_form_profile, (char *)"white",
-            XmRPixel, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 0); ac++;
-        XtSetArg(args[ac], XmNwidth, 270); ac++;
-        XtSetArg(args[ac], XmNheight, 130); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_form_profile, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_profile_label_info = XmCreateLabel(class_in->mbview_form_profile,
-            (char *)"mbview_profile_label_info",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_profile_label_info);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_form_profile, (char *)"Vertical Exageration",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNtitleString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNdecimalPoints, 1); ac++;
-        XtSetArg(args[ac], XmNvalue, 10); ac++;
-        XtSetArg(args[ac], XmNshowArrows, TRUE); ac++;
-        XtSetArg(args[ac], XmNshowValue, TRUE); ac++;
-        XtSetArg(args[ac], XmNorientation, XmHORIZONTAL); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 140); ac++;
-        XtSetArg(args[ac], XmNwidth, 270); ac++;
-        XtSetArg(args[ac], XmNheight, 60); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_form_profile, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_scale_profile_exager = XmCreateScale(class_in->mbview_form_profile,
-            (char *)"mbview_scale_profile_exager",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_scale_profile_exager);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbview_scale_profile_exager, XmNvalueChangedCallback, do_mbview_profile_exager, (XtPointer)0);
-    XtAddCallback(class_in->mbview_scale_profile_exager, XmNdragCallback, do_mbview_profile_exager, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_form_profile, (char *)"Dismiss",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 90); ac++;
-        XtSetArg(args[ac], XmNy, 330); ac++;
-        XtSetArg(args[ac], XmNwidth, 110); ac++;
-        XtSetArg(args[ac], XmNheight, 32); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_form_profile, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_profile_pushButton_dismiss = XmCreatePushButton(class_in->mbview_form_profile,
-            (char *)"mbview_profile_pushButton_dismiss",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_profile_pushButton_dismiss);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbview_profile_pushButton_dismiss, XmNactivateCallback, do_mbview_profile_dismiss, (XtPointer)0);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNtitle, "Projections"); ac++;
-    XtSetArg(args[ac], XmNx, 1098); ac++;
-    XtSetArg(args[ac], XmNy, 1193); ac++;
-    XtSetArg(args[ac], XmNwidth, 365); ac++;
-    XtSetArg(args[ac], XmNheight, 288); ac++;
-    XtSetArg(args[ac], XmNdeleteResponse, XmDO_NOTHING); ac++;
-    class_in->mbview_dialogShell_projection = XmCreateDialogShell(class_in->MB3DView,
-        (char *)"mbview_dialogShell_projection",
-        args,
-        ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNresizePolicy, XmRESIZE_GROW); ac++;
-    XtSetArg(args[ac], XmNx, 1098); ac++;
-    XtSetArg(args[ac], XmNy, 1193); ac++;
-    XtSetArg(args[ac], XmNwidth, 365); ac++;
-    XtSetArg(args[ac], XmNheight, 288); ac++;
-    class_in->mbview_bulletinBoard_projection = XtCreateWidget((char *)"mbview_bulletinBoard_projection",
-        xmBulletinBoardWidgetClass,
-        class_in->mbview_dialogShell_projection,
-        args,
-        ac);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_bulletinBoard_projection, (char *)"Display Projection:",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 210); ac++;
-        XtSetArg(args[ac], XmNy, 10); ac++;
-        XtSetArg(args[ac], XmNwidth, 150); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_projection, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_label_displayprojection = XmCreateLabel(class_in->mbview_bulletinBoard_projection,
-            (char *)"mbview_label_displayprojection",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_label_displayprojection);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 220); ac++;
-    XtSetArg(args[ac], XmNy, 40); ac++;
-    XtSetArg(args[ac], XmNwidth, 115); ac++;
-    XtSetArg(args[ac], XmNheight, 96); ac++;
-    XtSetArg(args[ac], XmNisHomogeneous, False); ac++;
-    class_in->mbview_radioBox_projection = XmCreateRadioBox(class_in->mbview_bulletinBoard_projection,
-        (char *)"mbview_radioBox_projection",
-        args,
-        ac);
-    XtManageChild(class_in->mbview_radioBox_projection);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_radioBox_projection, (char *)"Geographic",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNwidth, 109); ac++;
-        XtSetArg(args[ac], XmNheight, 28); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_radioBox_projection, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_toggleButton_geographic = XmCreateToggleButton(class_in->mbview_radioBox_projection,
-            (char *)"mbview_toggleButton_geographic",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_toggleButton_geographic);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbview_toggleButton_geographic, XmNvalueChangedCallback, do_mbview_display_geographic, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_radioBox_projection, (char *)"UTM",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNwidth, 109); ac++;
-        XtSetArg(args[ac], XmNheight, 28); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_radioBox_projection, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_toggleButton_utm = XmCreateToggleButton(class_in->mbview_radioBox_projection,
-            (char *)"mbview_toggleButton_utm",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_toggleButton_utm);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbview_toggleButton_utm, XmNvalueChangedCallback, do_mbview_display_utm, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_radioBox_projection, (char *)"Spheroid",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNwidth, 109); ac++;
-        XtSetArg(args[ac], XmNheight, 28); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_radioBox_projection, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_toggleButton_spheroid = XmCreateToggleButton(class_in->mbview_radioBox_projection,
-            (char *)"mbview_toggleButton_spheroid",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_toggleButton_spheroid);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbview_toggleButton_spheroid, XmNvalueChangedCallback, do_mbview_display_spheroid, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_bulletinBoard_projection, (char *)"Primary Grid Projection:",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNborderWidth, 1); ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNbackground,
-            BX_CONVERT(class_in->mbview_bulletinBoard_projection, (char *)"white",
-            XmRPixel, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 10); ac++;
-        XtSetArg(args[ac], XmNwidth, 190); ac++;
-        XtSetArg(args[ac], XmNheight, 220); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_projection, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_label_projection = XmCreateLabel(class_in->mbview_bulletinBoard_projection,
-            (char *)"mbview_label_projection",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_label_projection);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_bulletinBoard_projection, (char *)"Dismiss",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 110); ac++;
-        XtSetArg(args[ac], XmNy, 240); ac++;
-        XtSetArg(args[ac], XmNwidth, 130); ac++;
-        XtSetArg(args[ac], XmNheight, 40); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_projection, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_pushButton_projection_dismiss = XmCreatePushButton(class_in->mbview_bulletinBoard_projection,
-            (char *)"mbview_pushButton_projection_dismiss",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_pushButton_projection_dismiss);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbview_pushButton_projection_dismiss, XmNactivateCallback, do_mbview_projection_popdown, (XtPointer)0);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 1187); ac++;
-    XtSetArg(args[ac], XmNy, 1229); ac++;
-    XtSetArg(args[ac], XmNwidth, 187); ac++;
-    XtSetArg(args[ac], XmNheight, 215); ac++;
-    XtSetArg(args[ac], XmNdeleteResponse, XmDO_NOTHING); ac++;
-    class_in->mbview_dialogShell_2dparms = XmCreateDialogShell(class_in->MB3DView,
-        (char *)"mbview_dialogShell_2dparms",
-        args,
-        ac);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_dialogShell_2dparms, (char *)"MBview 2D Parameters",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNdialogTitle, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNautoUnmanage, False); ac++;
-        XtSetArg(args[ac], XmNresizePolicy, XmRESIZE_GROW); ac++;
-        XtSetArg(args[ac], XmNx, 1187); ac++;
-        XtSetArg(args[ac], XmNy, 1229); ac++;
-        XtSetArg(args[ac], XmNwidth, 187); ac++;
-        XtSetArg(args[ac], XmNheight, 215); ac++;
-        class_in->mbview_bulletinBoard_2dparms = XtCreateWidget((char *)"mbview_bulletinBoard_2dparms",
-            xmBulletinBoardWidgetClass,
-            class_in->mbview_dialogShell_2dparms,
-            args,
-            ac);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 70); ac++;
-    XtSetArg(args[ac], XmNy, 100); ac++;
-    XtSetArg(args[ac], XmNwidth, 110); ac++;
-    XtSetArg(args[ac], XmNheight, 30); ac++;
-    XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(class_in->mbview_bulletinBoard_2dparms, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-        XmRFontList, 0, &argok)); if (argok) ac++;
-    class_in->mbview_textField_view_2dzoom = XmCreateTextField(class_in->mbview_bulletinBoard_2dparms,
-        (char *)"mbview_textField_view_2dzoom",
-        args,
-        ac);
-    XtManageChild(class_in->mbview_textField_view_2dzoom);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_bulletinBoard_2dparms, (char *)"Zoom:",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_END); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 100); ac++;
-        XtSetArg(args[ac], XmNwidth, 60); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_2dparms, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_label_view_2dzoom = XmCreateLabel(class_in->mbview_bulletinBoard_2dparms,
-            (char *)"mbview_label_view_2dzoom",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_label_view_2dzoom);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 70); ac++;
-    XtSetArg(args[ac], XmNy, 70); ac++;
-    XtSetArg(args[ac], XmNwidth, 110); ac++;
-    XtSetArg(args[ac], XmNheight, 30); ac++;
-    XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(class_in->mbview_bulletinBoard_2dparms, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-        XmRFontList, 0, &argok)); if (argok) ac++;
-    class_in->mbview_textField_view_2doffsety = XmCreateTextField(class_in->mbview_bulletinBoard_2dparms,
-        (char *)"mbview_textField_view_2doffsety",
-        args,
-        ac);
-    XtManageChild(class_in->mbview_textField_view_2doffsety);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_bulletinBoard_2dparms, (char *)"Y:",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_END); ac++;
-        XtSetArg(args[ac], XmNx, 20); ac++;
-        XtSetArg(args[ac], XmNy, 70); ac++;
-        XtSetArg(args[ac], XmNwidth, 50); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_2dparms, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_label_view_2doffsety = XmCreateLabel(class_in->mbview_bulletinBoard_2dparms,
-            (char *)"mbview_label_view_2doffsety",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_label_view_2doffsety);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 10); ac++;
-    XtSetArg(args[ac], XmNy, 130); ac++;
-    XtSetArg(args[ac], XmNwidth, 170); ac++;
-    XtSetArg(args[ac], XmNheight, 20); ac++;
-    class_in->mbview_separator14 = XmCreateSeparator(class_in->mbview_bulletinBoard_2dparms,
-        (char *)"mbview_separator14",
-        args,
-        ac);
-    XtManageChild(class_in->mbview_separator14);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 70); ac++;
-    XtSetArg(args[ac], XmNy, 40); ac++;
-    XtSetArg(args[ac], XmNwidth, 110); ac++;
-    XtSetArg(args[ac], XmNheight, 30); ac++;
-    XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(class_in->mbview_bulletinBoard_2dparms, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-        XmRFontList, 0, &argok)); if (argok) ac++;
-    class_in->mbview_textField_view_2doffsetx = XmCreateTextField(class_in->mbview_bulletinBoard_2dparms,
-        (char *)"mbview_textField_view_2doffsetx",
-        args,
-        ac);
-    XtManageChild(class_in->mbview_textField_view_2doffsetx);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_bulletinBoard_2dparms, (char *)"X:",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_END); ac++;
-        XtSetArg(args[ac], XmNx, 20); ac++;
-        XtSetArg(args[ac], XmNy, 40); ac++;
-        XtSetArg(args[ac], XmNwidth, 50); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_2dparms, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_label_view_2doffsetx = XmCreateLabel(class_in->mbview_bulletinBoard_2dparms,
-            (char *)"mbview_label_view_2doffsetx",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_label_view_2doffsetx);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_bulletinBoard_2dparms, (char *)"View Offset:",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 10); ac++;
-        XtSetArg(args[ac], XmNwidth, 90); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_2dparms, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_label_2d_offset = XmCreateLabel(class_in->mbview_bulletinBoard_2dparms,
-            (char *)"mbview_label_2d_offset",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_label_2d_offset);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_bulletinBoard_2dparms, (char *)"Apply",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 20); ac++;
-        XtSetArg(args[ac], XmNy, 150); ac++;
-        XtSetArg(args[ac], XmNwidth, 70); ac++;
-        XtSetArg(args[ac], XmNheight, 50); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_2dparms, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_pushButton_view_2d_apply = XmCreatePushButton(class_in->mbview_bulletinBoard_2dparms,
-            (char *)"mbview_pushButton_view_2d_apply",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_pushButton_view_2d_apply);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbview_pushButton_view_2d_apply, XmNactivateCallback, do_mbview_2dparmsapply, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_bulletinBoard_2dparms, (char *)"Dismiss",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 100); ac++;
-        XtSetArg(args[ac], XmNy, 150); ac++;
-        XtSetArg(args[ac], XmNwidth, 70); ac++;
-        XtSetArg(args[ac], XmNheight, 50); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_2dparms, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_pushButton_view_2d_dismiss = XmCreatePushButton(class_in->mbview_bulletinBoard_2dparms,
-            (char *)"mbview_pushButton_view_2d_dismiss",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_pushButton_view_2d_dismiss);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbview_pushButton_view_2d_dismiss, XmNactivateCallback, do_mbview_2dparmspopdown, (XtPointer)0);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 1140); ac++;
-    XtSetArg(args[ac], XmNy, 1098); ac++;
-    XtSetArg(args[ac], XmNwidth, 281); ac++;
-    XtSetArg(args[ac], XmNheight, 478); ac++;
-    XtSetArg(args[ac], XmNdeleteResponse, XmDO_NOTHING); ac++;
-    class_in->mbview_dialogShell_3dparms = XmCreateDialogShell(class_in->MB3DView,
-        (char *)"mbview_dialogShell_3dparms",
-        args,
-        ac);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_dialogShell_3dparms, (char *)"MBview 3D Parameters",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNdialogTitle, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNautoUnmanage, False); ac++;
-        XtSetArg(args[ac], XmNresizePolicy, XmRESIZE_GROW); ac++;
-        XtSetArg(args[ac], XmNx, 1140); ac++;
-        XtSetArg(args[ac], XmNy, 1098); ac++;
-        XtSetArg(args[ac], XmNwidth, 281); ac++;
-        XtSetArg(args[ac], XmNheight, 478); ac++;
-        class_in->mbview_bulletinBoard_3dparms = XtCreateWidget((char *)"mbview_bulletinBoard_3dparms",
-            xmBulletinBoardWidgetClass,
-            class_in->mbview_dialogShell_3dparms,
-            args,
-            ac);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 160); ac++;
-    XtSetArg(args[ac], XmNy, 100); ac++;
-    XtSetArg(args[ac], XmNwidth, 110); ac++;
-    XtSetArg(args[ac], XmNheight, 30); ac++;
-    XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(class_in->mbview_bulletinBoard_3dparms, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-        XmRFontList, 0, &argok)); if (argok) ac++;
-    class_in->mbview_textField_model_3dzoom = XmCreateTextField(class_in->mbview_bulletinBoard_3dparms,
-        (char *)"mbview_textField_model_3dzoom",
-        args,
-        ac);
-    XtManageChild(class_in->mbview_textField_model_3dzoom);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_bulletinBoard_3dparms, (char *)"Zoom:",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_END); ac++;
-        XtSetArg(args[ac], XmNx, 60); ac++;
-        XtSetArg(args[ac], XmNy, 100); ac++;
-        XtSetArg(args[ac], XmNwidth, 100); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_3dparms, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_label_model_3dzoom = XmCreateLabel(class_in->mbview_bulletinBoard_3dparms,
-            (char *)"mbview_label_model_3dzoom",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_label_model_3dzoom);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 10); ac++;
-    XtSetArg(args[ac], XmNy, 320); ac++;
-    XtSetArg(args[ac], XmNwidth, 260); ac++;
-    XtSetArg(args[ac], XmNheight, 20); ac++;
-    class_in->mbview_separator11 = XmCreateSeparator(class_in->mbview_bulletinBoard_3dparms,
-        (char *)"mbview_separator11",
-        args,
-        ac);
-    XtManageChild(class_in->mbview_separator11);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 160); ac++;
-    XtSetArg(args[ac], XmNy, 240); ac++;
-    XtSetArg(args[ac], XmNwidth, 110); ac++;
-    XtSetArg(args[ac], XmNheight, 30); ac++;
-    XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(class_in->mbview_bulletinBoard_3dparms, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-        XmRFontList, 0, &argok)); if (argok) ac++;
-    class_in->mbview_textField_view_3dzoom = XmCreateTextField(class_in->mbview_bulletinBoard_3dparms,
-        (char *)"mbview_textField_view_3dzoom",
-        args,
-        ac);
-    XtManageChild(class_in->mbview_textField_view_3dzoom);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_bulletinBoard_3dparms, (char *)"Zoom:",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_END); ac++;
-        XtSetArg(args[ac], XmNx, 60); ac++;
-        XtSetArg(args[ac], XmNy, 240); ac++;
-        XtSetArg(args[ac], XmNwidth, 100); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_3dparms, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_label_view_3dzoom = XmCreateLabel(class_in->mbview_bulletinBoard_3dparms,
-            (char *)"mbview_label_view_3dzoom",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_label_view_3dzoom);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 160); ac++;
-    XtSetArg(args[ac], XmNy, 370); ac++;
-    XtSetArg(args[ac], XmNwidth, 110); ac++;
-    XtSetArg(args[ac], XmNheight, 30); ac++;
-    XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(class_in->mbview_bulletinBoard_3dparms, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-        XmRFontList, 0, &argok)); if (argok) ac++;
-    class_in->mbview_textField_view_3doffsety = XmCreateTextField(class_in->mbview_bulletinBoard_3dparms,
-        (char *)"mbview_textField_view_3doffsety",
-        args,
-        ac);
-    XtManageChild(class_in->mbview_textField_view_3doffsety);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_bulletinBoard_3dparms, (char *)"Y:",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_END); ac++;
-        XtSetArg(args[ac], XmNx, 60); ac++;
-        XtSetArg(args[ac], XmNy, 370); ac++;
-        XtSetArg(args[ac], XmNwidth, 100); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_3dparms, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_label_view_3doffsety = XmCreateLabel(class_in->mbview_bulletinBoard_3dparms,
-            (char *)"mbview_label_view_3doffsety",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_label_view_3doffsety);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 10); ac++;
-    XtSetArg(args[ac], XmNy, 400); ac++;
-    XtSetArg(args[ac], XmNwidth, 260); ac++;
-    XtSetArg(args[ac], XmNheight, 20); ac++;
-    class_in->mbview_separator20 = XmCreateSeparator(class_in->mbview_bulletinBoard_3dparms,
-        (char *)"mbview_separator20",
-        args,
-        ac);
-    XtManageChild(class_in->mbview_separator20);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 160); ac++;
-    XtSetArg(args[ac], XmNy, 340); ac++;
-    XtSetArg(args[ac], XmNwidth, 110); ac++;
-    XtSetArg(args[ac], XmNheight, 30); ac++;
-    XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(class_in->mbview_bulletinBoard_3dparms, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-        XmRFontList, 0, &argok)); if (argok) ac++;
-    class_in->mbview_textField_view_3doffsetx = XmCreateTextField(class_in->mbview_bulletinBoard_3dparms,
-        (char *)"mbview_textField_view_3doffsetx",
-        args,
-        ac);
-    XtManageChild(class_in->mbview_textField_view_3doffsetx);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_bulletinBoard_3dparms, (char *)"X:",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_END); ac++;
-        XtSetArg(args[ac], XmNx, 100); ac++;
-        XtSetArg(args[ac], XmNy, 340); ac++;
-        XtSetArg(args[ac], XmNwidth, 60); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_3dparms, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_label_view_3doffsetx = XmCreateLabel(class_in->mbview_bulletinBoard_3dparms,
-            (char *)"mbview_label_view_3doffsetx",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_label_view_3doffsetx);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_bulletinBoard_3dparms, (char *)"Pan:",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 340); ac++;
-        XtSetArg(args[ac], XmNwidth, 90); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_3dparms, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_label_view_offset = XmCreateLabel(class_in->mbview_bulletinBoard_3dparms,
-            (char *)"mbview_label_view_offset",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_label_view_offset);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 160); ac++;
-    XtSetArg(args[ac], XmNy, 210); ac++;
-    XtSetArg(args[ac], XmNwidth, 110); ac++;
-    XtSetArg(args[ac], XmNheight, 30); ac++;
-    XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(class_in->mbview_bulletinBoard_3dparms, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-        XmRFontList, 0, &argok)); if (argok) ac++;
-    class_in->mbview_textField_view_elevation = XmCreateTextField(class_in->mbview_bulletinBoard_3dparms,
-        (char *)"mbview_textField_view_elevation",
-        args,
-        ac);
-    XtManageChild(class_in->mbview_textField_view_elevation);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_bulletinBoard_3dparms, (char *)"Elevation (degrees):",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_END); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 210); ac++;
-        XtSetArg(args[ac], XmNwidth, 150); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_3dparms, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_label_view_elevation = XmCreateLabel(class_in->mbview_bulletinBoard_3dparms,
-            (char *)"mbview_label_view_elevation",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_label_view_elevation);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 10); ac++;
-    XtSetArg(args[ac], XmNy, 270); ac++;
-    XtSetArg(args[ac], XmNwidth, 260); ac++;
-    XtSetArg(args[ac], XmNheight, 20); ac++;
-    class_in->mbview_separator4 = XmCreateSeparator(class_in->mbview_bulletinBoard_3dparms,
-        (char *)"mbview_separator4",
-        args,
-        ac);
-    XtManageChild(class_in->mbview_separator4);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 160); ac++;
-    XtSetArg(args[ac], XmNy, 180); ac++;
-    XtSetArg(args[ac], XmNwidth, 110); ac++;
-    XtSetArg(args[ac], XmNheight, 30); ac++;
-    XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(class_in->mbview_bulletinBoard_3dparms, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-        XmRFontList, 0, &argok)); if (argok) ac++;
-    class_in->mbview_textField_view_azimuth = XmCreateTextField(class_in->mbview_bulletinBoard_3dparms,
-        (char *)"mbview_textField_view_azimuth",
-        args,
-        ac);
-    XtManageChild(class_in->mbview_textField_view_azimuth);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_bulletinBoard_3dparms, (char *)"Azimuth (degrees):",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_END); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 180); ac++;
-        XtSetArg(args[ac], XmNwidth, 150); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_3dparms, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_label_view_azimuth = XmCreateLabel(class_in->mbview_bulletinBoard_3dparms,
-            (char *)"mbview_label_view_azimuth",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_label_view_azimuth);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_bulletinBoard_3dparms, (char *)"View Orientation & Zoom:",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 150); ac++;
-        XtSetArg(args[ac], XmNwidth, 200); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_3dparms, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_label_view = XmCreateLabel(class_in->mbview_bulletinBoard_3dparms,
-            (char *)"mbview_label_view",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_label_view);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 160); ac++;
-    XtSetArg(args[ac], XmNy, 70); ac++;
-    XtSetArg(args[ac], XmNwidth, 110); ac++;
-    XtSetArg(args[ac], XmNheight, 30); ac++;
-    XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(class_in->mbview_bulletinBoard_3dparms, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-        XmRFontList, 0, &argok)); if (argok) ac++;
-    class_in->mbview_textField_model_elevation = XmCreateTextField(class_in->mbview_bulletinBoard_3dparms,
-        (char *)"mbview_textField_model_elevation",
-        args,
-        ac);
-    XtManageChild(class_in->mbview_textField_model_elevation);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 160); ac++;
-    XtSetArg(args[ac], XmNy, 40); ac++;
-    XtSetArg(args[ac], XmNwidth, 110); ac++;
-    XtSetArg(args[ac], XmNheight, 30); ac++;
-    XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(class_in->mbview_bulletinBoard_3dparms, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-        XmRFontList, 0, &argok)); if (argok) ac++;
-    class_in->mbview_textField_model_azimuth = XmCreateTextField(class_in->mbview_bulletinBoard_3dparms,
-        (char *)"mbview_textField_model_azimuth",
-        args,
-        ac);
-    XtManageChild(class_in->mbview_textField_model_azimuth);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_bulletinBoard_3dparms, (char *)"Elevation (degrees):",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_END); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 70); ac++;
-        XtSetArg(args[ac], XmNwidth, 150); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_3dparms, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_label_model_elevation = XmCreateLabel(class_in->mbview_bulletinBoard_3dparms,
-            (char *)"mbview_label_model_elevation",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_label_model_elevation);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_bulletinBoard_3dparms, (char *)"Azimuth (degrees):",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_END); ac++;
-        XtSetArg(args[ac], XmNx, 20); ac++;
-        XtSetArg(args[ac], XmNy, 40); ac++;
-        XtSetArg(args[ac], XmNwidth, 140); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_3dparms, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_label_model_azimuth = XmCreateLabel(class_in->mbview_bulletinBoard_3dparms,
-            (char *)"mbview_label_model_azimuth",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_label_model_azimuth);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_bulletinBoard_3dparms, (char *)"Model Orientation & Zoom:",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 10); ac++;
-        XtSetArg(args[ac], XmNwidth, 200); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_3dparms, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_label_model = XmCreateLabel(class_in->mbview_bulletinBoard_3dparms,
-            (char *)"mbview_label_model",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_label_model);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 10); ac++;
-    XtSetArg(args[ac], XmNy, 130); ac++;
-    XtSetArg(args[ac], XmNwidth, 260); ac++;
-    XtSetArg(args[ac], XmNheight, 20); ac++;
-    class_in->mbview_separator9 = XmCreateSeparator(class_in->mbview_bulletinBoard_3dparms,
-        (char *)"mbview_separator9",
-        args,
-        ac);
-    XtManageChild(class_in->mbview_separator9);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_bulletinBoard_3dparms, (char *)"Apply",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 20); ac++;
-        XtSetArg(args[ac], XmNy, 420); ac++;
-        XtSetArg(args[ac], XmNwidth, 100); ac++;
-        XtSetArg(args[ac], XmNheight, 50); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_3dparms, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_pushButton_view_3d_apply = XmCreatePushButton(class_in->mbview_bulletinBoard_3dparms,
-            (char *)"mbview_pushButton_view_3d_apply",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_pushButton_view_3d_apply);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbview_pushButton_view_3d_apply, XmNactivateCallback, do_mbview_3dparmsapply, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_bulletinBoard_3dparms, (char *)"Vertical Exageration:",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_END); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 290); ac++;
-        XtSetArg(args[ac], XmNwidth, 150); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_3dparms, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_label_exager = XmCreateLabel(class_in->mbview_bulletinBoard_3dparms,
-            (char *)"mbview_label_exager",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_label_exager);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 160); ac++;
-    XtSetArg(args[ac], XmNy, 290); ac++;
-    XtSetArg(args[ac], XmNwidth, 110); ac++;
-    XtSetArg(args[ac], XmNheight, 30); ac++;
-    XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(class_in->mbview_bulletinBoard_3dparms, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-        XmRFontList, 0, &argok)); if (argok) ac++;
-    class_in->mbview_textField_exageration = XmCreateTextField(class_in->mbview_bulletinBoard_3dparms,
-        (char *)"mbview_textField_exageration",
-        args,
-        ac);
-    XtManageChild(class_in->mbview_textField_exageration);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_bulletinBoard_3dparms, (char *)"Dismiss",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 160); ac++;
-        XtSetArg(args[ac], XmNy, 420); ac++;
-        XtSetArg(args[ac], XmNwidth, 100); ac++;
-        XtSetArg(args[ac], XmNheight, 50); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_3dparms, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_pushButton_view_3d_dismiss = XmCreatePushButton(class_in->mbview_bulletinBoard_3dparms,
-            (char *)"mbview_pushButton_view_3d_dismiss",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_pushButton_view_3d_dismiss);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbview_pushButton_view_3d_dismiss, XmNactivateCallback, do_mbview_3dparmspopdown, (XtPointer)0);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 1141); ac++;
-    XtSetArg(args[ac], XmNy, 1117); ac++;
-    XtSetArg(args[ac], XmNwidth, 280); ac++;
-    XtSetArg(args[ac], XmNheight, 440); ac++;
-    XtSetArg(args[ac], XmNdeleteResponse, XmDO_NOTHING); ac++;
-    class_in->mbview_dialogShell_shadeparms = XmCreateDialogShell(class_in->MB3DView,
-        (char *)"mbview_dialogShell_shadeparms",
-        args,
-        ac);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_dialogShell_shadeparms, (char *)"MBview Shading Parameters",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNdialogTitle, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNautoUnmanage, False); ac++;
-        XtSetArg(args[ac], XmNresizePolicy, XmRESIZE_GROW); ac++;
-        XtSetArg(args[ac], XmNx, 1141); ac++;
-        XtSetArg(args[ac], XmNy, 1117); ac++;
-        XtSetArg(args[ac], XmNwidth, 280); ac++;
-        XtSetArg(args[ac], XmNheight, 440); ac++;
-        class_in->mbview_bulletinBoard_shadeparms = XtCreateWidget((char *)"mbview_bulletinBoard_shadeparms",
-            xmBulletinBoardWidgetClass,
-            class_in->mbview_dialogShell_shadeparms,
-            args,
-            ac);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 10); ac++;
-    XtSetArg(args[ac], XmNy, 360); ac++;
-    XtSetArg(args[ac], XmNwidth, 260); ac++;
-    XtSetArg(args[ac], XmNheight, 20); ac++;
-    class_in->mbview_separator13 = XmCreateSeparator(class_in->mbview_bulletinBoard_shadeparms,
-        (char *)"mbview_separator13",
-        args,
-        ac);
-    XtManageChild(class_in->mbview_separator13);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 160); ac++;
-    XtSetArg(args[ac], XmNy, 300); ac++;
-    XtSetArg(args[ac], XmNwidth, 110); ac++;
-    XtSetArg(args[ac], XmNheight, 30); ac++;
-    XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(class_in->mbview_bulletinBoard_shadeparms, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-        XmRFontList, 0, &argok)); if (argok) ac++;
-    class_in->mbview_textField_overlay_center = XmCreateTextField(class_in->mbview_bulletinBoard_shadeparms,
-        (char *)"mbview_textField_overlay_center",
-        args,
-        ac);
-    XtManageChild(class_in->mbview_textField_overlay_center);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_bulletinBoard_shadeparms, (char *)"Center:",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_END); ac++;
-        XtSetArg(args[ac], XmNx, 60); ac++;
-        XtSetArg(args[ac], XmNy, 300); ac++;
-        XtSetArg(args[ac], XmNwidth, 100); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_shadeparms, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_label_overlay_center = XmCreateLabel(class_in->mbview_bulletinBoard_shadeparms,
-            (char *)"mbview_label_overlay_center",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_label_overlay_center);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_bulletinBoard_shadeparms, (char *)"Shading by Overlay:",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 240); ac++;
-        XtSetArg(args[ac], XmNwidth, 200); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_shadeparms, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_label_overlayshade = XmCreateLabel(class_in->mbview_bulletinBoard_shadeparms,
-            (char *)"mbview_label_overlayshade",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_label_overlayshade);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNorientation, XmHORIZONTAL); ac++;
-    XtSetArg(args[ac], XmNx, 30); ac++;
-    XtSetArg(args[ac], XmNy, 330); ac++;
-    XtSetArg(args[ac], XmNwidth, 227); ac++;
-    XtSetArg(args[ac], XmNheight, 34); ac++;
-    XtSetArg(args[ac], XmNisHomogeneous, False); ac++;
-    class_in->mbview_radioBox_overlay_shade = XmCreateRadioBox(class_in->mbview_bulletinBoard_shadeparms,
-        (char *)"mbview_radioBox_overlay_shade",
-        args,
-        ac);
-    XtManageChild(class_in->mbview_radioBox_overlay_shade);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_radioBox_overlay_shade, (char *)"Cold-to-Hot",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNwidth, 109); ac++;
-        XtSetArg(args[ac], XmNheight, 28); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_radioBox_overlay_shade, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_toggleButton_overlay_shade_ctoh = XmCreateToggleButton(class_in->mbview_radioBox_overlay_shade,
-            (char *)"mbview_toggleButton_overlay_shade_ctoh",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_toggleButton_overlay_shade_ctoh);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_radioBox_overlay_shade, (char *)"Hot-to-Cold",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNwidth, 109); ac++;
-        XtSetArg(args[ac], XmNheight, 28); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_radioBox_overlay_shade, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_toggleButton_overlay_shade_htoc = XmCreateToggleButton(class_in->mbview_radioBox_overlay_shade,
-            (char *)"mbview_toggleButton_overlay_shade_htoc",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_toggleButton_overlay_shade_htoc);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 160); ac++;
-    XtSetArg(args[ac], XmNy, 270); ac++;
-    XtSetArg(args[ac], XmNwidth, 110); ac++;
-    XtSetArg(args[ac], XmNheight, 30); ac++;
-    XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(class_in->mbview_bulletinBoard_shadeparms, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-        XmRFontList, 0, &argok)); if (argok) ac++;
-    class_in->mbview_textField_overlay_amp = XmCreateTextField(class_in->mbview_bulletinBoard_shadeparms,
-        (char *)"mbview_textField_overlay_amp",
-        args,
-        ac);
-    XtManageChild(class_in->mbview_textField_overlay_amp);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_bulletinBoard_shadeparms, (char *)"Amplitude:",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_END); ac++;
-        XtSetArg(args[ac], XmNx, 60); ac++;
-        XtSetArg(args[ac], XmNy, 270); ac++;
-        XtSetArg(args[ac], XmNwidth, 100); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_shadeparms, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_label_overlay_amp = XmCreateLabel(class_in->mbview_bulletinBoard_shadeparms,
-            (char *)"mbview_label_overlay_amp",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_label_overlay_amp);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 10); ac++;
-    XtSetArg(args[ac], XmNy, 220); ac++;
-    XtSetArg(args[ac], XmNwidth, 260); ac++;
-    XtSetArg(args[ac], XmNheight, 20); ac++;
-    class_in->mbview_separator15 = XmCreateSeparator(class_in->mbview_bulletinBoard_shadeparms,
-        (char *)"mbview_separator15",
-        args,
-        ac);
-    XtManageChild(class_in->mbview_separator15);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 160); ac++;
-    XtSetArg(args[ac], XmNy, 190); ac++;
-    XtSetArg(args[ac], XmNwidth, 110); ac++;
-    XtSetArg(args[ac], XmNheight, 30); ac++;
-    XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(class_in->mbview_bulletinBoard_shadeparms, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-        XmRFontList, 0, &argok)); if (argok) ac++;
-    class_in->mbview_textField_slope_amp = XmCreateTextField(class_in->mbview_bulletinBoard_shadeparms,
-        (char *)"mbview_textField_slope_amp",
-        args,
-        ac);
-    XtManageChild(class_in->mbview_textField_slope_amp);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_bulletinBoard_shadeparms, (char *)"Amplitude:",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_END); ac++;
-        XtSetArg(args[ac], XmNx, 50); ac++;
-        XtSetArg(args[ac], XmNy, 190); ac++;
-        XtSetArg(args[ac], XmNwidth, 110); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_shadeparms, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_label_slope_amp = XmCreateLabel(class_in->mbview_bulletinBoard_shadeparms,
-            (char *)"mbview_label_slope_amp",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_label_slope_amp);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_bulletinBoard_shadeparms, (char *)"Shading by Slope:",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 160); ac++;
-        XtSetArg(args[ac], XmNwidth, 200); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_shadeparms, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_label_slopeshade = XmCreateLabel(class_in->mbview_bulletinBoard_shadeparms,
-            (char *)"mbview_label_slopeshade",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_label_slopeshade);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 160); ac++;
-    XtSetArg(args[ac], XmNy, 70); ac++;
-    XtSetArg(args[ac], XmNwidth, 110); ac++;
-    XtSetArg(args[ac], XmNheight, 30); ac++;
-    XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(class_in->mbview_bulletinBoard_shadeparms, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-        XmRFontList, 0, &argok)); if (argok) ac++;
-    class_in->mbview_textField_illum_azi = XmCreateTextField(class_in->mbview_bulletinBoard_shadeparms,
-        (char *)"mbview_textField_illum_azi",
-        args,
-        ac);
-    XtManageChild(class_in->mbview_textField_illum_azi);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 160); ac++;
-    XtSetArg(args[ac], XmNy, 40); ac++;
-    XtSetArg(args[ac], XmNwidth, 110); ac++;
-    XtSetArg(args[ac], XmNheight, 30); ac++;
-    XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(class_in->mbview_bulletinBoard_shadeparms, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-        XmRFontList, 0, &argok)); if (argok) ac++;
-    class_in->mbview_textField_illum_amp = XmCreateTextField(class_in->mbview_bulletinBoard_shadeparms,
-        (char *)"mbview_textField_illum_amp",
-        args,
-        ac);
-    XtManageChild(class_in->mbview_textField_illum_amp);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_bulletinBoard_shadeparms, (char *)"Azimuth (degrees):",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_END); ac++;
-        XtSetArg(args[ac], XmNx, 20); ac++;
-        XtSetArg(args[ac], XmNy, 70); ac++;
-        XtSetArg(args[ac], XmNwidth, 140); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_shadeparms, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_label_illum_azi = XmCreateLabel(class_in->mbview_bulletinBoard_shadeparms,
-            (char *)"mbview_label_illum_azi",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_label_illum_azi);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_bulletinBoard_shadeparms, (char *)"Amplitude:",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_END); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 40); ac++;
-        XtSetArg(args[ac], XmNwidth, 150); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_shadeparms, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_label_illum_amp = XmCreateLabel(class_in->mbview_bulletinBoard_shadeparms,
-            (char *)"mbview_label_illum_amp",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_label_illum_amp);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_bulletinBoard_shadeparms, (char *)"Shading by Illumination:",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 10); ac++;
-        XtSetArg(args[ac], XmNwidth, 180); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_shadeparms, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_label_illumination = XmCreateLabel(class_in->mbview_bulletinBoard_shadeparms,
-            (char *)"mbview_label_illumination",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_label_illumination);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 10); ac++;
-    XtSetArg(args[ac], XmNy, 140); ac++;
-    XtSetArg(args[ac], XmNwidth, 260); ac++;
-    XtSetArg(args[ac], XmNheight, 20); ac++;
-    class_in->mbview_separator16 = XmCreateSeparator(class_in->mbview_bulletinBoard_shadeparms,
-        (char *)"mbview_separator16",
-        args,
-        ac);
-    XtManageChild(class_in->mbview_separator16);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_bulletinBoard_shadeparms, (char *)"Apply",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 20); ac++;
-        XtSetArg(args[ac], XmNy, 380); ac++;
-        XtSetArg(args[ac], XmNwidth, 100); ac++;
-        XtSetArg(args[ac], XmNheight, 50); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_shadeparms, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_pushButton_shadeparms_apply = XmCreatePushButton(class_in->mbview_bulletinBoard_shadeparms,
-            (char *)"mbview_pushButton_shadeparms_apply",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_pushButton_shadeparms_apply);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbview_pushButton_shadeparms_apply, XmNactivateCallback, do_mbview_shadeparmsapply, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_bulletinBoard_shadeparms, (char *)"Elevation (degrees):",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_END); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 100); ac++;
-        XtSetArg(args[ac], XmNwidth, 150); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_shadeparms, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_label_illum_elev = XmCreateLabel(class_in->mbview_bulletinBoard_shadeparms,
-            (char *)"mbview_label_illum_elev",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_label_illum_elev);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 160); ac++;
-    XtSetArg(args[ac], XmNy, 100); ac++;
-    XtSetArg(args[ac], XmNwidth, 110); ac++;
-    XtSetArg(args[ac], XmNheight, 30); ac++;
-    XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(class_in->mbview_bulletinBoard_shadeparms, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-        XmRFontList, 0, &argok)); if (argok) ac++;
-    class_in->mbview_textField_illum_elev = XmCreateTextField(class_in->mbview_bulletinBoard_shadeparms,
-        (char *)"mbview_textField_illum_elev",
-        args,
-        ac);
-    XtManageChild(class_in->mbview_textField_illum_elev);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_bulletinBoard_shadeparms, (char *)"Dismiss",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 160); ac++;
-        XtSetArg(args[ac], XmNy, 380); ac++;
-        XtSetArg(args[ac], XmNwidth, 100); ac++;
-        XtSetArg(args[ac], XmNheight, 50); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_shadeparms, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_pushButton_shadeparms_dismiss2 = XmCreatePushButton(class_in->mbview_bulletinBoard_shadeparms,
-            (char *)"mbview_pushButton_shadeparms_dismiss2",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_pushButton_shadeparms_dismiss2);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbview_pushButton_shadeparms_dismiss2, XmNactivateCallback, do_mbview_shadeparmspopdown, (XtPointer)0);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 1049); ac++;
-    XtSetArg(args[ac], XmNy, 1071); ac++;
-    XtSetArg(args[ac], XmNwidth, 463); ac++;
-    XtSetArg(args[ac], XmNheight, 531); ac++;
-    XtSetArg(args[ac], XmNdeleteResponse, XmDO_NOTHING); ac++;
-    class_in->mbview_dialogShell_about = XmCreateDialogShell(class_in->MB3DView,
-        (char *)"mbview_dialogShell_about",
-        args,
-        ac);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_dialogShell_about, (char *)"About MBview...",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNdialogTitle, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNresizePolicy, XmRESIZE_GROW); ac++;
-        XtSetArg(args[ac], XmNx, 1049); ac++;
-        XtSetArg(args[ac], XmNy, 1071); ac++;
-        XtSetArg(args[ac], XmNwidth, 463); ac++;
-        XtSetArg(args[ac], XmNheight, 531); ac++;
-        class_in->mbview_bulletinBoard_about = XtCreateWidget((char *)"mbview_bulletinBoard_about",
-            xmBulletinBoardWidgetClass,
-            class_in->mbview_dialogShell_about,
-            args,
-            ac);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_bulletinBoard_about, (char *)"::#TimesMedium14:t\"MB-System Release 5.0.0\"#TimesMedium14\"August 26, 2003\"",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_about, (char *)"-*-"SERIF"-bold-r-*-*-*-240-*-*-*-*-iso8859-1=TimesBold24,-*-"SERIF"-bold-r-*-*-*-120-*-*-*-*-iso8859-1=TimesBold12,-*-"SERIF"-bold-r-*-*-*-140-*-*-*-*-iso8859-1=TimesBold14,-*-"SERIF"-medium-r-*-*-*-140-*-*-*-*-iso8859-1=TimesMedium14,-*-"SERIF"-bold-r-*-*-*-120-*-*-*-*-iso8859-1=TimesBold12,-*-"SERIF"-bold-r-*-*-*-140-*-*-*-*-iso8859-1=TimesBold14,-*-"SERIF"-medium-r-*-*-*-140-*-*-*-*-iso8859-1=TimesMedium14,-*-"SERI [...]
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 410); ac++;
-        XtSetArg(args[ac], XmNwidth, 440); ac++;
-        XtSetArg(args[ac], XmNheight, 50); ac++;
-        class_in->mbview_label_about_version = XmCreateLabel(class_in->mbview_bulletinBoard_about,
-            (char *)"mbview_label_about_version",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_label_about_version);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_bulletinBoard_about, (char *)"::#TimesBold14:t\"Created By:\"#TimesBold14\"David W. Caress   and   Dale N. Chayes \"",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_about, (char *)"-*-"SERIF"-bold-r-*-*-*-140-*-*-*-*-iso8859-1=TimesBold14,-*-"SERIF"-bold-r-*-*-*-240-*-*-*-*-iso8859-1=TimesBold24,-*-"SERIF"-bold-r-*-*-*-120-*-*-*-*-iso8859-1=TimesBold12,-*-"SERIF"-bold-r-*-*-*-240-*-*-*-*-iso8859-1=TimesBold24,-*-"SERIF"-bold-r-*-*-*-120-*-*-*-*-iso8859-1=TimesBold12,-*-"SERIF"-bold-r-*-*-*-240-*-*-*-*-iso8859-1=TimesBold24,-*-"SERIF"-bold-r-*-*-*-120-*-*-*-*-iso8859-1=TimesBold12,-*-"SERIF"-bold- [...]
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 280); ac++;
-        XtSetArg(args[ac], XmNwidth, 440); ac++;
-        XtSetArg(args[ac], XmNheight, 60); ac++;
-        class_in->mbview_label_about_authors = XmCreateLabel(class_in->mbview_bulletinBoard_about,
-            (char *)"mbview_label_about_authors",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_label_about_authors);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_bulletinBoard_about, (char *)"::#TimesBold12:t\"Monterey Bay\"#TimesBold12:t\"Aquarium\"#TimesBold12\"Research Institute\"",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_about, (char *)"-*-"SERIF"-bold-r-*-*-*-140-*-*-*-*-iso8859-1=TimesBold14,-*-"SERIF"-bold-r-*-*-*-240-*-*-*-*-iso8859-1=TimesBold24,-*-"SERIF"-bold-r-*-*-*-120-*-*-*-*-iso8859-1=TimesBold12,-*-"SERIF"-bold-r-*-*-*-240-*-*-*-*-iso8859-1=TimesBold24,-*-"SERIF"-bold-r-*-*-*-120-*-*-*-*-iso8859-1=TimesBold12,-*-"SERIF"-bold-r-*-*-*-240-*-*-*-*-iso8859-1=TimesBold24,-*-"SERIF"-bold-r-*-*-*-120-*-*-*-*-iso8859-1=TimesBold12,-*-"SERIF"-bold- [...]
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 70); ac++;
-        XtSetArg(args[ac], XmNy, 340); ac++;
-        XtSetArg(args[ac], XmNwidth, 140); ac++;
-        XtSetArg(args[ac], XmNheight, 80); ac++;
-        class_in->mbview_label_about_MBARI = XmCreateLabel(class_in->mbview_bulletinBoard_about,
-            (char *)"mbview_label_about_MBARI",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_label_about_MBARI);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_bulletinBoard_about, (char *)"::#TimesBold12:t\"Lamont-Doherty\"#TimesBold12:t\"Earth Observatory\"#TimesBold12\"of Columbia University\"",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_about, (char *)"-*-"SERIF"-bold-r-*-*-*-140-*-*-*-*-iso8859-1=TimesBold14,-*-"SERIF"-bold-r-*-*-*-240-*-*-*-*-iso8859-1=TimesBold24,-*-"SERIF"-bold-r-*-*-*-240-*-*-*-*-iso8859-1=TimesBold24,-*-"SERIF"-bold-r-*-*-*-240-*-*-*-*-iso8859-1=TimesBold24,-*-"SERIF"-bold-r-*-*-*-240-*-*-*-*-iso8859-1=TimesBold24,-*-"SERIF"-bold-r-*-*-*-240-*-*-*-*-iso8859-1=TimesBold24,-*-"SERIF"-bold-r-*-*-*-240-*-*-*-*-iso8859-1=TimesBold24,-*-"SERIF"-bold- [...]
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 230); ac++;
-        XtSetArg(args[ac], XmNy, 340); ac++;
-        XtSetArg(args[ac], XmNwidth, 180); ac++;
-        XtSetArg(args[ac], XmNheight, 80); ac++;
-        class_in->mbview_label_about_LDEO = XmCreateLabel(class_in->mbview_bulletinBoard_about,
-            (char *)"mbview_label_about_LDEO",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_label_about_LDEO);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 10); ac++;
-    XtSetArg(args[ac], XmNy, 260); ac++;
-    XtSetArg(args[ac], XmNwidth, 440); ac++;
-    XtSetArg(args[ac], XmNheight, 20); ac++;
-    class_in->mbview_separator6 = XmCreateSeparator(class_in->mbview_bulletinBoard_about,
-        (char *)"mbview_separator6",
-        args,
-        ac);
-    XtManageChild(class_in->mbview_separator6);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_bulletinBoard_about, (char *)"::#TimesBold14:t\"One component of the\"#TimesBold24\"MB-System\"#TimesBold14:t\"\"#TimesBold14:t\"An open Source Software Package\"#TimesBold14:t\"for Processing and Display\"#TimesBold14\"of Swath Sonar Data\"",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_about, (char *)"-*-"SERIF"-bold-r-*-*-*-140-*-*-*-*-iso8859-1=TimesBold14,-*-"SERIF"-bold-r-*-*-*-240-*-*-*-*-iso8859-1=TimesBold24,-*-"SERIF"-bold-r-*-*-*-240-*-*-*-*-iso8859-1=TimesBold24,-*-"SERIF"-bold-r-*-*-*-240-*-*-*-*-iso8859-1=TimesBold24,-*-"SERIF"-bold-r-*-*-*-240-*-*-*-*-iso8859-1=TimesBold24,-*-"SERIF"-bold-r-*-*-*-240-*-*-*-*-iso8859-1=TimesBold24,-*-"SERIF"-bold-r-*-*-*-240-*-*-*-*-iso8859-1=TimesBold24,-*-"SERIF"-bold- [...]
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 120); ac++;
-        XtSetArg(args[ac], XmNwidth, 440); ac++;
-        XtSetArg(args[ac], XmNheight, 140); ac++;
-        class_in->mbview_label_about_mbsystem = XmCreateLabel(class_in->mbview_bulletinBoard_about,
-            (char *)"mbview_label_about_mbsystem",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_label_about_mbsystem);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 10); ac++;
-    XtSetArg(args[ac], XmNy, 100); ac++;
-    XtSetArg(args[ac], XmNwidth, 440); ac++;
-    XtSetArg(args[ac], XmNheight, 20); ac++;
-    class_in->mbview_separator7 = XmCreateSeparator(class_in->mbview_bulletinBoard_about,
-        (char *)"mbview_separator7",
-        args,
-        ac);
-    XtManageChild(class_in->mbview_separator7);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_bulletinBoard_about, (char *)"::#TimesBold24\"MBview\":t\"\"#TimesBold18\"A 2D/3D Visualization API\"",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_about, (char *)"-*-"SERIF"-bold-r-*-*-*-180-*-*-*-*-iso8859-1=TimesBold18,-*-"SERIF"-bold-r-*-*-*-240-*-*-*-*-iso8859-1=TimesBold24,-*-"SERIF"-bold-r-*-*-*-240-*-*-*-*-iso8859-1=TimesBold24,-*-"SERIF"-bold-r-*-*-*-240-*-*-*-*-iso8859-1=TimesBold24,-*-"SERIF"-bold-r-*-*-*-240-*-*-*-*-iso8859-1=TimesBold24,-*-"SERIF"-bold-r-*-*-*-240-*-*-*-*-iso8859-1=TimesBold24,-*-"SERIF"-bold-r-*-*-*-240-*-*-*-*-iso8859-1=TimesBold24,-*-"SERIF"-bold- [...]
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 10); ac++;
-        XtSetArg(args[ac], XmNwidth, 440); ac++;
-        XtSetArg(args[ac], XmNheight, 90); ac++;
-        class_in->mbview_label_about_title = XmCreateLabel(class_in->mbview_bulletinBoard_about,
-            (char *)"mbview_label_about_title",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_label_about_title);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_bulletinBoard_about, (char *)"Dismiss",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 170); ac++;
-        XtSetArg(args[ac], XmNy, 470); ac++;
-        XtSetArg(args[ac], XmNwidth, 120); ac++;
-        XtSetArg(args[ac], XmNheight, 50); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_about, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_pushButton_about_dismiss = XmCreatePushButton(class_in->mbview_bulletinBoard_about,
-            (char *)"mbview_pushButton_about_dismiss",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_pushButton_about_dismiss);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbview_pushButton_about_dismiss, XmNactivateCallback, do_mbview_aboutpopdown, (XtPointer)0);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 1070); ac++;
-    XtSetArg(args[ac], XmNy, 1289); ac++;
-    XtSetArg(args[ac], XmNwidth, 421); ac++;
-    XtSetArg(args[ac], XmNheight, 95); ac++;
-    XtSetArg(args[ac], XmNdeleteResponse, XmDO_NOTHING); ac++;
-    class_in->mbview_dialogShell_message = XmCreateDialogShell(class_in->MB3DView,
-        (char *)"mbview_dialogShell_message",
-        args,
-        ac);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_dialogShell_message, (char *)"MBview: Please wait...",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNdialogTitle, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNdialogStyle, XmDIALOG_FULL_APPLICATION_MODAL); ac++;
-        XtSetArg(args[ac], XmNresizePolicy, XmRESIZE_GROW); ac++;
-        XtSetArg(args[ac], XmNx, 1070); ac++;
-        XtSetArg(args[ac], XmNy, 1289); ac++;
-        XtSetArg(args[ac], XmNwidth, 421); ac++;
-        XtSetArg(args[ac], XmNheight, 95); ac++;
-        class_in->mbview_bulletinBoard_message = XtCreateWidget((char *)"mbview_bulletinBoard_message",
-            xmBulletinBoardWidgetClass,
-            class_in->mbview_dialogShell_message,
-            args,
-            ac);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_bulletinBoard_message, (char *)"MB3Dview is doing something...",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 10); ac++;
-        XtSetArg(args[ac], XmNwidth, 400); ac++;
-        XtSetArg(args[ac], XmNheight, 40); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_message, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_label_message = XmCreateLabel(class_in->mbview_bulletinBoard_message,
-            (char *)"mbview_label_message",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_label_message);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_bulletinBoard_message, (char *)"Thank you for your patience.",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 50); ac++;
-        XtSetArg(args[ac], XmNwidth, 400); ac++;
-        XtSetArg(args[ac], XmNheight, 40); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_message, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_label_thanks = XmCreateLabel(class_in->mbview_bulletinBoard_message,
-            (char *)"mbview_label_thanks",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_label_thanks);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNtitle, "MB3DView Rendering Resolution"); ac++;
-    XtSetArg(args[ac], XmNx, 1135); ac++;
-    XtSetArg(args[ac], XmNy, 1111); ac++;
-    XtSetArg(args[ac], XmNwidth, 291); ac++;
-    XtSetArg(args[ac], XmNheight, 451); ac++;
-    XtSetArg(args[ac], XmNdeleteResponse, XmDO_NOTHING); ac++;
-    class_in->mbview_dialogShell_resolution = XmCreateDialogShell(class_in->MB3DView,
-        (char *)"mbview_dialogShell_resolution",
-        args,
-        ac);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_dialogShell_resolution, (char *)"MBview Rendering Resolution",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNdialogTitle, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNautoUnmanage, False); ac++;
-        XtSetArg(args[ac], XmNresizePolicy, XmRESIZE_GROW); ac++;
-        XtSetArg(args[ac], XmNx, 1135); ac++;
-        XtSetArg(args[ac], XmNy, 1111); ac++;
-        XtSetArg(args[ac], XmNwidth, 291); ac++;
-        XtSetArg(args[ac], XmNheight, 451); ac++;
-        class_in->mbview_bulletinBoard_resolution = XtCreateWidget((char *)"mbview_bulletinBoard_resolution",
-            xmBulletinBoardWidgetClass,
-            class_in->mbview_dialogShell_resolution,
-            args,
-            ac);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_bulletinBoard_resolution, (char *)"Medium Resolution Decimation",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNtitleString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNminimum, 1); ac++;
-        XtSetArg(args[ac], XmNvalue, 2); ac++;
-        XtSetArg(args[ac], XmNmaximum, 10); ac++;
-        XtSetArg(args[ac], XmNshowArrows, TRUE); ac++;
-        XtSetArg(args[ac], XmNscaleMultiple, 1); ac++;
-        XtSetArg(args[ac], XmNshowValue, TRUE); ac++;
-        XtSetArg(args[ac], XmNorientation, XmHORIZONTAL); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 320); ac++;
-        XtSetArg(args[ac], XmNwidth, 260); ac++;
-        XtSetArg(args[ac], XmNheight, 60); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_resolution, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_scale_navmediumresolution = XmCreateScale(class_in->mbview_bulletinBoard_resolution,
-            (char *)"mbview_scale_navmediumresolution",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_scale_navmediumresolution);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbview_scale_navmediumresolution, XmNvalueChangedCallback, do_mbview_resolutionchange, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_bulletinBoard_resolution, (char *)"Low Resolution Decimation",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNtitleString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNminimum, 1); ac++;
-        XtSetArg(args[ac], XmNvalue, 5); ac++;
-        XtSetArg(args[ac], XmNmaximum, 25); ac++;
-        XtSetArg(args[ac], XmNshowArrows, TRUE); ac++;
-        XtSetArg(args[ac], XmNscaleMultiple, 2); ac++;
-        XtSetArg(args[ac], XmNshowValue, TRUE); ac++;
-        XtSetArg(args[ac], XmNorientation, XmHORIZONTAL); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 240); ac++;
-        XtSetArg(args[ac], XmNwidth, 260); ac++;
-        XtSetArg(args[ac], XmNheight, 60); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_resolution, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_scale_navlowresolution = XmCreateScale(class_in->mbview_bulletinBoard_resolution,
-            (char *)"mbview_scale_navlowresolution",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_scale_navlowresolution);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbview_scale_navlowresolution, XmNvalueChangedCallback, do_mbview_resolutionchange, (XtPointer)0);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 10); ac++;
-    XtSetArg(args[ac], XmNy, 180); ac++;
-    XtSetArg(args[ac], XmNwidth, 260); ac++;
-    XtSetArg(args[ac], XmNheight, 20); ac++;
-    class_in->separator = XmCreateSeparator(class_in->mbview_bulletinBoard_resolution,
-        (char *)"separator",
-        args,
-        ac);
-    XtManageChild(class_in->separator);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_bulletinBoard_resolution, (char *)"Nav Rendering Decimation",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 200); ac++;
-        XtSetArg(args[ac], XmNwidth, 270); ac++;
-        XtSetArg(args[ac], XmNheight, 40); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_resolution, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_label_navrenderdecimation = XmCreateLabel(class_in->mbview_bulletinBoard_resolution,
-            (char *)"mbview_label_navrenderdecimation",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_label_navrenderdecimation);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_bulletinBoard_resolution, (char *)"Grid Rendering Resolution:",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 10); ac++;
-        XtSetArg(args[ac], XmNwidth, 270); ac++;
-        XtSetArg(args[ac], XmNheight, 40); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_resolution, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_label_gridrenderres = XmCreateLabel(class_in->mbview_bulletinBoard_resolution,
-            (char *)"mbview_label_gridrenderres",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_label_gridrenderres);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_bulletinBoard_resolution, (char *)"Medium Resolution Dimension",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNtitleString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNminimum, 100); ac++;
-        XtSetArg(args[ac], XmNvalue, 300); ac++;
-        XtSetArg(args[ac], XmNmaximum, 1000); ac++;
-        XtSetArg(args[ac], XmNshowArrows, TRUE); ac++;
-        XtSetArg(args[ac], XmNscaleMultiple, 100); ac++;
-        XtSetArg(args[ac], XmNshowValue, TRUE); ac++;
-        XtSetArg(args[ac], XmNorientation, XmHORIZONTAL); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 120); ac++;
-        XtSetArg(args[ac], XmNwidth, 260); ac++;
-        XtSetArg(args[ac], XmNheight, 63); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_resolution, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_scale_mediumresolution = XmCreateScale(class_in->mbview_bulletinBoard_resolution,
-            (char *)"mbview_scale_mediumresolution",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_scale_mediumresolution);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbview_scale_mediumresolution, XmNvalueChangedCallback, do_mbview_resolutionchange, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_bulletinBoard_resolution, (char *)"Low Resolution Dimension",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNtitleString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNminimum, 10); ac++;
-        XtSetArg(args[ac], XmNvalue, 100); ac++;
-        XtSetArg(args[ac], XmNmaximum, 500); ac++;
-        XtSetArg(args[ac], XmNshowArrows, TRUE); ac++;
-        XtSetArg(args[ac], XmNscaleMultiple, 50); ac++;
-        XtSetArg(args[ac], XmNshowValue, TRUE); ac++;
-        XtSetArg(args[ac], XmNorientation, XmHORIZONTAL); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 50); ac++;
-        XtSetArg(args[ac], XmNwidth, 260); ac++;
-        XtSetArg(args[ac], XmNheight, 63); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_resolution, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_scale_lowresolution = XmCreateScale(class_in->mbview_bulletinBoard_resolution,
-            (char *)"mbview_scale_lowresolution",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_scale_lowresolution);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbview_scale_lowresolution, XmNvalueChangedCallback, do_mbview_resolutionchange, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_bulletinBoard_resolution, (char *)"Dismiss",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 100); ac++;
-        XtSetArg(args[ac], XmNy, 400); ac++;
-        XtSetArg(args[ac], XmNwidth, 100); ac++;
-        XtSetArg(args[ac], XmNheight, 40); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_resolution, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_pushButton_resolution_dismiss = XmCreatePushButton(class_in->mbview_bulletinBoard_resolution,
-            (char *)"mbview_pushButton_resolution_dismiss",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_pushButton_resolution_dismiss);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbview_pushButton_resolution_dismiss, XmNactivateCallback, do_mbview_resolutionpopdown, (XtPointer)0);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNtitle, "MB3DView Colors & Contours"); ac++;
-    XtSetArg(args[ac], XmNx, 1061); ac++;
-    XtSetArg(args[ac], XmNy, 1114); ac++;
-    XtSetArg(args[ac], XmNwidth, 440); ac++;
-    XtSetArg(args[ac], XmNheight, 445); ac++;
-    XtSetArg(args[ac], XmNdeleteResponse, XmDO_NOTHING); ac++;
-    class_in->mbview_dialogShell_colorbounds = XmCreateDialogShell(class_in->MB3DView,
-        (char *)"mbview_dialogShell_colorbounds",
-        args,
-        ac);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_dialogShell_colorbounds, (char *)"MBview Colors and Contours",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNdialogTitle, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNautoUnmanage, False); ac++;
-        XtSetArg(args[ac], XmNresizePolicy, XmRESIZE_GROW); ac++;
-        XtSetArg(args[ac], XmNx, 1061); ac++;
-        XtSetArg(args[ac], XmNy, 1114); ac++;
-        XtSetArg(args[ac], XmNwidth, 440); ac++;
-        XtSetArg(args[ac], XmNheight, 445); ac++;
-        class_in->mbview_bulletinBoard_colorbounds = XtCreateWidget((char *)"mbview_bulletinBoard_colorbounds",
-            xmBulletinBoardWidgetClass,
-            class_in->mbview_dialogShell_colorbounds,
-            args,
-            ac);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 10); ac++;
-    XtSetArg(args[ac], XmNy, 360); ac++;
-    XtSetArg(args[ac], XmNwidth, 410); ac++;
-    XtSetArg(args[ac], XmNheight, 20); ac++;
-    class_in->mbview_separator5 = XmCreateSeparator(class_in->mbview_bulletinBoard_colorbounds,
-        (char *)"mbview_separator5",
-        args,
-        ac);
-    XtManageChild(class_in->mbview_separator5);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNorientation, XmHORIZONTAL); ac++;
-    XtSetArg(args[ac], XmNx, 30); ac++;
-    XtSetArg(args[ac], XmNy, 330); ac++;
-    XtSetArg(args[ac], XmNwidth, 227); ac++;
-    XtSetArg(args[ac], XmNheight, 34); ac++;
-    XtSetArg(args[ac], XmNisHomogeneous, False); ac++;
-    class_in->mbview_radioBox_overlaymode = XmCreateRadioBox(class_in->mbview_bulletinBoard_colorbounds,
-        (char *)"mbview_radioBox_overlaymode",
-        args,
-        ac);
-    XtManageChild(class_in->mbview_radioBox_overlaymode);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_radioBox_overlaymode, (char *)"Cold-to-Hot",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNwidth, 109); ac++;
-        XtSetArg(args[ac], XmNheight, 28); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_radioBox_overlaymode, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_toggleButton_overlay_ctoh = XmCreateToggleButton(class_in->mbview_radioBox_overlaymode,
-            (char *)"mbview_toggleButton_overlay_ctoh",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_toggleButton_overlay_ctoh);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_radioBox_overlaymode, (char *)"Hot-to-Cold",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNwidth, 109); ac++;
-        XtSetArg(args[ac], XmNheight, 28); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_radioBox_overlaymode, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_toggleButton_overlay_htoc = XmCreateToggleButton(class_in->mbview_radioBox_overlaymode,
-            (char *)"mbview_toggleButton_overlay_htoc",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_toggleButton_overlay_htoc);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 310); ac++;
-    XtSetArg(args[ac], XmNy, 300); ac++;
-    XtSetArg(args[ac], XmNwidth, 110); ac++;
-    XtSetArg(args[ac], XmNheight, 30); ac++;
-    XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(class_in->mbview_bulletinBoard_colorbounds, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-        XmRFontList, 0, &argok)); if (argok) ac++;
-    class_in->mbview_textField_overlaymax = XmCreateTextField(class_in->mbview_bulletinBoard_colorbounds,
-        (char *)"mbview_textField_overlaymax",
-        args,
-        ac);
-    XtManageChild(class_in->mbview_textField_overlaymax);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_bulletinBoard_colorbounds, (char *)"Maximum:",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_END); ac++;
-        XtSetArg(args[ac], XmNx, 230); ac++;
-        XtSetArg(args[ac], XmNy, 300); ac++;
-        XtSetArg(args[ac], XmNwidth, 80); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_colorbounds, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_label_overlaymax = XmCreateLabel(class_in->mbview_bulletinBoard_colorbounds,
-            (char *)"mbview_label_overlaymax",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_label_overlaymax);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 110); ac++;
-    XtSetArg(args[ac], XmNy, 300); ac++;
-    XtSetArg(args[ac], XmNwidth, 110); ac++;
-    XtSetArg(args[ac], XmNheight, 30); ac++;
-    XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(class_in->mbview_bulletinBoard_colorbounds, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-        XmRFontList, 0, &argok)); if (argok) ac++;
-    class_in->mbview_textField_overlaymin = XmCreateTextField(class_in->mbview_bulletinBoard_colorbounds,
-        (char *)"mbview_textField_overlaymin",
-        args,
-        ac);
-    XtManageChild(class_in->mbview_textField_overlaymin);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_bulletinBoard_colorbounds, (char *)"Minimum:",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_END); ac++;
-        XtSetArg(args[ac], XmNx, 30); ac++;
-        XtSetArg(args[ac], XmNy, 300); ac++;
-        XtSetArg(args[ac], XmNwidth, 80); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_colorbounds, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_label_overlaymin = XmCreateLabel(class_in->mbview_bulletinBoard_colorbounds,
-            (char *)"mbview_label_overlaymin",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_label_overlaymin);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_bulletinBoard_colorbounds, (char *)"Overlay Color Bounds:",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 270); ac++;
-        XtSetArg(args[ac], XmNwidth, 200); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_colorbounds, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_label_overlaybounds = XmCreateLabel(class_in->mbview_bulletinBoard_colorbounds,
-            (char *)"mbview_label_overlaybounds",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_label_overlaybounds);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 10); ac++;
-    XtSetArg(args[ac], XmNy, 250); ac++;
-    XtSetArg(args[ac], XmNwidth, 410); ac++;
-    XtSetArg(args[ac], XmNheight, 20); ac++;
-    class_in->mbview_separator3 = XmCreateSeparator(class_in->mbview_bulletinBoard_colorbounds,
-        (char *)"mbview_separator3",
-        args,
-        ac);
-    XtManageChild(class_in->mbview_separator3);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNorientation, XmHORIZONTAL); ac++;
-    XtSetArg(args[ac], XmNx, 30); ac++;
-    XtSetArg(args[ac], XmNy, 220); ac++;
-    XtSetArg(args[ac], XmNwidth, 227); ac++;
-    XtSetArg(args[ac], XmNheight, 34); ac++;
-    XtSetArg(args[ac], XmNisHomogeneous, False); ac++;
-    class_in->mbview_radioBox_slopemode = XmCreateRadioBox(class_in->mbview_bulletinBoard_colorbounds,
-        (char *)"mbview_radioBox_slopemode",
-        args,
-        ac);
-    XtManageChild(class_in->mbview_radioBox_slopemode);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_radioBox_slopemode, (char *)"Cold-to-Hot",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNwidth, 109); ac++;
-        XtSetArg(args[ac], XmNheight, 28); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_radioBox_slopemode, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_toggleButton_slope_ctoh = XmCreateToggleButton(class_in->mbview_radioBox_slopemode,
-            (char *)"mbview_toggleButton_slope_ctoh",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_toggleButton_slope_ctoh);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_radioBox_slopemode, (char *)"Hot-to-Cold",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNwidth, 109); ac++;
-        XtSetArg(args[ac], XmNheight, 28); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_radioBox_slopemode, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_toggleButton_slope_htoc = XmCreateToggleButton(class_in->mbview_radioBox_slopemode,
-            (char *)"mbview_toggleButton_slope_htoc",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_toggleButton_slope_htoc);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 310); ac++;
-    XtSetArg(args[ac], XmNy, 190); ac++;
-    XtSetArg(args[ac], XmNwidth, 110); ac++;
-    XtSetArg(args[ac], XmNheight, 30); ac++;
-    XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(class_in->mbview_bulletinBoard_colorbounds, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-        XmRFontList, 0, &argok)); if (argok) ac++;
-    class_in->mbview_textField_slopemax = XmCreateTextField(class_in->mbview_bulletinBoard_colorbounds,
-        (char *)"mbview_textField_slopemax",
-        args,
-        ac);
-    XtManageChild(class_in->mbview_textField_slopemax);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_bulletinBoard_colorbounds, (char *)"Maximum:",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_END); ac++;
-        XtSetArg(args[ac], XmNx, 230); ac++;
-        XtSetArg(args[ac], XmNy, 190); ac++;
-        XtSetArg(args[ac], XmNwidth, 80); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_colorbounds, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_label_slopemax = XmCreateLabel(class_in->mbview_bulletinBoard_colorbounds,
-            (char *)"mbview_label_slopemax",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_label_slopemax);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 110); ac++;
-    XtSetArg(args[ac], XmNy, 190); ac++;
-    XtSetArg(args[ac], XmNwidth, 110); ac++;
-    XtSetArg(args[ac], XmNheight, 30); ac++;
-    XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(class_in->mbview_bulletinBoard_colorbounds, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-        XmRFontList, 0, &argok)); if (argok) ac++;
-    class_in->mbview_textField_slopemin = XmCreateTextField(class_in->mbview_bulletinBoard_colorbounds,
-        (char *)"mbview_textField_slopemin",
-        args,
-        ac);
-    XtManageChild(class_in->mbview_textField_slopemin);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_bulletinBoard_colorbounds, (char *)"Minimum:",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_END); ac++;
-        XtSetArg(args[ac], XmNx, 30); ac++;
-        XtSetArg(args[ac], XmNy, 190); ac++;
-        XtSetArg(args[ac], XmNwidth, 80); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_colorbounds, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_label_slopemin = XmCreateLabel(class_in->mbview_bulletinBoard_colorbounds,
-            (char *)"mbview_label_slopemin",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_label_slopemin);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_bulletinBoard_colorbounds, (char *)"Data Slope Color Bounds:",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 160); ac++;
-        XtSetArg(args[ac], XmNwidth, 200); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_colorbounds, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_label_slopebounds = XmCreateLabel(class_in->mbview_bulletinBoard_colorbounds,
-            (char *)"mbview_label_slopebounds",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_label_slopebounds);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNorientation, XmHORIZONTAL); ac++;
-    XtSetArg(args[ac], XmNx, 30); ac++;
-    XtSetArg(args[ac], XmNy, 70); ac++;
-    XtSetArg(args[ac], XmNwidth, 227); ac++;
-    XtSetArg(args[ac], XmNheight, 34); ac++;
-    XtSetArg(args[ac], XmNisHomogeneous, False); ac++;
-    class_in->mbview_radioBox_colormode = XmCreateRadioBox(class_in->mbview_bulletinBoard_colorbounds,
-        (char *)"mbview_radioBox_colormode",
-        args,
-        ac);
-    XtManageChild(class_in->mbview_radioBox_colormode);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_radioBox_colormode, (char *)"Cold-to-Hot",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNwidth, 109); ac++;
-        XtSetArg(args[ac], XmNheight, 28); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_radioBox_colormode, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_toggleButton_data_ctoh = XmCreateToggleButton(class_in->mbview_radioBox_colormode,
-            (char *)"mbview_toggleButton_data_ctoh",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_toggleButton_data_ctoh);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_radioBox_colormode, (char *)"Hot-to-Cold",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNwidth, 109); ac++;
-        XtSetArg(args[ac], XmNheight, 28); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_radioBox_colormode, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_toggleButton_data_htoc = XmCreateToggleButton(class_in->mbview_radioBox_colormode,
-            (char *)"mbview_toggleButton_data_htoc",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_toggleButton_data_htoc);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 310); ac++;
-    XtSetArg(args[ac], XmNy, 40); ac++;
-    XtSetArg(args[ac], XmNwidth, 110); ac++;
-    XtSetArg(args[ac], XmNheight, 30); ac++;
-    XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(class_in->mbview_bulletinBoard_colorbounds, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-        XmRFontList, 0, &argok)); if (argok) ac++;
-    class_in->mbview_textField_datamax = XmCreateTextField(class_in->mbview_bulletinBoard_colorbounds,
-        (char *)"mbview_textField_datamax",
-        args,
-        ac);
-    XtManageChild(class_in->mbview_textField_datamax);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 110); ac++;
-    XtSetArg(args[ac], XmNy, 40); ac++;
-    XtSetArg(args[ac], XmNwidth, 110); ac++;
-    XtSetArg(args[ac], XmNheight, 30); ac++;
-    XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(class_in->mbview_bulletinBoard_colorbounds, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-        XmRFontList, 0, &argok)); if (argok) ac++;
-    class_in->mbview_textField_datamin = XmCreateTextField(class_in->mbview_bulletinBoard_colorbounds,
-        (char *)"mbview_textField_datamin",
-        args,
-        ac);
-    XtManageChild(class_in->mbview_textField_datamin);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_bulletinBoard_colorbounds, (char *)"Maximum:",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_END); ac++;
-        XtSetArg(args[ac], XmNx, 230); ac++;
-        XtSetArg(args[ac], XmNy, 40); ac++;
-        XtSetArg(args[ac], XmNwidth, 80); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_colorbounds, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_label_colormax = XmCreateLabel(class_in->mbview_bulletinBoard_colorbounds,
-            (char *)"mbview_label_colormax",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_label_colormax);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_bulletinBoard_colorbounds, (char *)"Minimum:",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_END); ac++;
-        XtSetArg(args[ac], XmNx, 30); ac++;
-        XtSetArg(args[ac], XmNy, 40); ac++;
-        XtSetArg(args[ac], XmNwidth, 80); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_colorbounds, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_label_colormin = XmCreateLabel(class_in->mbview_bulletinBoard_colorbounds,
-            (char *)"mbview_label_colormin",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_label_colormin);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_bulletinBoard_colorbounds, (char *)"Data Color Bounds:",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 10); ac++;
-        XtSetArg(args[ac], XmNwidth, 180); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_colorbounds, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_label_colorbounds = XmCreateLabel(class_in->mbview_bulletinBoard_colorbounds,
-            (char *)"mbview_label_colorbounds",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_label_colorbounds);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 10); ac++;
-    XtSetArg(args[ac], XmNy, 140); ac++;
-    XtSetArg(args[ac], XmNwidth, 410); ac++;
-    XtSetArg(args[ac], XmNheight, 20); ac++;
-    class_in->mbview_separator2 = XmCreateSeparator(class_in->mbview_bulletinBoard_colorbounds,
-        (char *)"mbview_separator2",
-        args,
-        ac);
-    XtManageChild(class_in->mbview_separator2);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_bulletinBoard_colorbounds, (char *)"Apply",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 110); ac++;
-        XtSetArg(args[ac], XmNy, 380); ac++;
-        XtSetArg(args[ac], XmNwidth, 100); ac++;
-        XtSetArg(args[ac], XmNheight, 50); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_colorbounds, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_pushButton_colorbounds_apply = XmCreatePushButton(class_in->mbview_bulletinBoard_colorbounds,
-            (char *)"mbview_pushButton_colorbounds_apply",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_pushButton_colorbounds_apply);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbview_pushButton_colorbounds_apply, XmNactivateCallback, do_mbview_colorboundsapply, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_bulletinBoard_colorbounds, (char *)"Data Contour Interval (meters):",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 110); ac++;
-        XtSetArg(args[ac], XmNwidth, 230); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_colorbounds, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_label_contour = XmCreateLabel(class_in->mbview_bulletinBoard_colorbounds,
-            (char *)"mbview_label_contour",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_label_contour);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 310); ac++;
-    XtSetArg(args[ac], XmNy, 110); ac++;
-    XtSetArg(args[ac], XmNwidth, 110); ac++;
-    XtSetArg(args[ac], XmNheight, 30); ac++;
-    XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(class_in->mbview_bulletinBoard_colorbounds, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-        XmRFontList, 0, &argok)); if (argok) ac++;
-    class_in->mbview_textField_contours = XmCreateTextField(class_in->mbview_bulletinBoard_colorbounds,
-        (char *)"mbview_textField_contours",
-        args,
-        ac);
-    XtManageChild(class_in->mbview_textField_contours);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbview_bulletinBoard_colorbounds, (char *)"Dismiss",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 240); ac++;
-        XtSetArg(args[ac], XmNy, 380); ac++;
-        XtSetArg(args[ac], XmNwidth, 110); ac++;
-        XtSetArg(args[ac], XmNheight, 50); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbview_bulletinBoard_colorbounds, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbview_pushButton_colorbounds_dismiss = XmCreatePushButton(class_in->mbview_bulletinBoard_colorbounds,
-            (char *)"mbview_pushButton_colorbounds_dismiss",
-            args,
-            ac);
-        XtManageChild(class_in->mbview_pushButton_colorbounds_dismiss);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbview_pushButton_colorbounds_dismiss, XmNactivateCallback, do_mbview_colorboundspopdown, (XtPointer)0);
-    ac = 0;
-    XtSetArg(args[ac], XmNtopAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNbottomAttachment, XmATTACH_NONE); ac++;
-    XtSetArg(args[ac], XmNbottomOffset, 0); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 10); ac++;
-    XtSetArg(args[ac], XmNtopOffset, 263); ac++;
-    XtSetValues(class_in->mbview_scale_profile_width, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNtopAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNbottomAttachment, XmATTACH_NONE); ac++;
-    XtSetArg(args[ac], XmNbottomOffset, 0); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 10); ac++;
-    XtSetArg(args[ac], XmNtopOffset, 200); ac++;
-    XtSetValues(class_in->mbview_scale_profile_slope, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNtopAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNbottomAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNbottomOffset, 10); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 290); ac++;
-    XtSetArg(args[ac], XmNrightOffset, 6); ac++;
-    XtSetArg(args[ac], XmNtopOffset, 0); ac++;
-    XtSetValues(class_in->mbview_scrolledWindow_profile, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 10); ac++;
-    XtSetArg(args[ac], XmNtopOffset, 0); ac++;
-    XtSetValues(class_in->mbview_profile_label_info, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 10); ac++;
-    XtSetArg(args[ac], XmNtopOffset, 140); ac++;
-    XtSetValues(class_in->mbview_scale_profile_exager, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNtopAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNbottomAttachment, XmATTACH_NONE); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 90); ac++;
-    XtSetArg(args[ac], XmNtopOffset, 330); ac++;
-    XtSetValues(class_in->mbview_profile_pushButton_dismiss, args, ac);
-
-
-    /*
-     * Assign functions to class record
-     */
-
-
-    /* Begin user code block <end_MB3DViewCreate> */
-    /* End user code block <end_MB3DViewCreate> */
-
-    return( class_in );
-}
diff --git a/src/mbview/MB3DView.h b/src/mbview/MB3DView.h
deleted file mode 100644
index ad0a396..0000000
--- a/src/mbview/MB3DView.h
+++ /dev/null
@@ -1,281 +0,0 @@
-
-/* Begin user code block <abstract> */
-/* End user code block <abstract> */
-
-/**
- * README: Portions of this file are merged at file generation
- * time. Edits can be made *only* in between specified code blocks, look
- * for keywords <Begin user code> and <End user code>.
- */
-/*
- * Generated by the ICS Builder Xcessory (BX).
- *
- * BuilderXcessory Version 6.1.3
- * Code Generator Xcessory 6.1.3 (08/19/04) CGX Scripts 6.1 Motif 2.1 
- *
- */
-#ifndef MB3DView_H
-#define MB3DView_H
-
-/**
- * Forward declare the class data pointer type so that it can
- * easily be used as a parameter to class functions and data members.
- */
-typedef struct _MB3DViewData *MB3DViewDataPtr;
-
-/**
- * Globally included information.
- */
-
-
-/**
- * Class specific includes.
- */
-
-
-typedef struct _MB3DViewData
-{
-    /*
-     * Classes created by this class.
-     */
-    
-    /*
-     * Widgets created by this class.
-     */
-    Widget MB3DView;
-    Widget mbview_pushButton_clearpicks;
-    Widget mbview_pushButton_reset;
-    Widget mbview_radioBox_mouse;
-    Widget mbview_toggleButton_mode_rmove;
-    Widget mbview_toggleButton_mode_rrotate;
-    Widget mbview_toggleButton_mode_rviewpoint;
-    Widget mbview_toggleButton_mode_rshade;
-    Widget mbview_toggleButton_mode_rarea;
-    Widget mbview_toggleButton_mode_rsite;
-    Widget mbview_toggleButton_mode_rroute;
-    Widget mbview_toggleButton_mode_rnav;
-    Widget mbview_toggleButton_mode_rnavfile;
-    Widget mbview_label_status;
-    Widget mbview_pushButton_fullrez;
-    Widget mbview_label_pickinfo;
-    Widget mbview_menuBar_mbview;
-    Widget mbview_cascadeButton_view;
-    Widget mbview_pulldownMenu_view;
-    Widget mbview_toggleButton_display_2D;
-    Widget mbview_toggleButton_display_3D;
-    Widget mbview_separator10;
-    Widget mbview_toggleButton_data_primary;
-    Widget mbview_toggleButton_data_primaryslope;
-    Widget mbview_toggleButton_data_secondary;
-    Widget mbview_separator;
-    Widget mbview_toggleButton_histogram;
-    Widget mbview_separator21;
-    Widget mbview_toggleButton_overlay_none;
-    Widget mbview_toggleButton_overlay_illumination;
-    Widget mbview_toggleButton_overlay_slope;
-    Widget mbview_toggleButton_overlay_secondary;
-    Widget mbview_separator1;
-    Widget mbview_toggleButton_overlay_contour;
-    Widget mbview_toggleButton_site;
-    Widget mbview_toggleButton_route;
-    Widget mbview_toggleButton_nav;
-    Widget mbview_toggleButton_navdrape;
-    Widget mbview_toggleButton_vector;
-    Widget mbview_separator8;
-    Widget mbview_toggleButton_colortable_haxby;
-    Widget mbview_toggleButton_colortable_bright;
-    Widget mbview_toggleButton_colortable_muted;
-    Widget mbview_toggleButton_colortable_gray;
-    Widget mbview_toggleButton_colortable_flat;
-    Widget mbview_toggleButton_colortable_sealevel1;
-    Widget mbview_toggleButton_colortable_sealevel2;
-    Widget separator1;
-    Widget mbview_toggleButton_profile;
-    Widget mbview_cascadeButton_controls;
-    Widget mbview_pulldownMenu_controls;
-    Widget mbview_pushButton_colorbounds;
-    Widget mbview_pushButton_2dview;
-    Widget mbview_pushButton_3dview;
-    Widget mbview_pushButton_shadeparms;
-    Widget mbview_pushButton_resolution;
-    Widget mbview_pushButton_projections;
-    Widget mbview_pushButton_sitelist;
-    Widget mbview_pushButton_routelist;
-    Widget mbview_pushButton_navlist;
-    Widget mbview_cascadeButton_mouse;
-    Widget mbview_pulldownMenu_mouse;
-    Widget mbview_toggleButton_mode_move;
-    Widget mbview_toggleButton_mode_rotate;
-    Widget mbview_toggleButton_mode_viewpoint;
-    Widget mbview_toggleButton_mode_shade;
-    Widget mbview_toggleButton_mode_area;
-    Widget mbview_toggleButton_mode_site;
-    Widget mbview_toggleButton_mode_route;
-    Widget mbview_toggleButton_mode_nav;
-    Widget mbview_toggleButton_mode_navfile;
-    Widget mbview_cascadeButton_action;
-    Widget mbview_pulldownMenu_action;
-    Widget mbview_pushButton_help_about;
-    Widget mbview_cascadeButton_dismiss;
-    Widget mbview_pulldownMenu_dismiss;
-    Widget mbview_pushButton_dismiss;
-    Widget mbview_label_mouse;
-    Widget mbview_drawingArea_mbview;
-    Widget mbview_dialogShell_colorbounds;
-    Widget mbview_bulletinBoard_colorbounds;
-    Widget mbview_separator5;
-    Widget mbview_radioBox_overlaymode;
-    Widget mbview_toggleButton_overlay_ctoh;
-    Widget mbview_toggleButton_overlay_htoc;
-    Widget mbview_textField_overlaymax;
-    Widget mbview_label_overlaymax;
-    Widget mbview_textField_overlaymin;
-    Widget mbview_label_overlaymin;
-    Widget mbview_label_overlaybounds;
-    Widget mbview_separator3;
-    Widget mbview_radioBox_slopemode;
-    Widget mbview_toggleButton_slope_ctoh;
-    Widget mbview_toggleButton_slope_htoc;
-    Widget mbview_textField_slopemax;
-    Widget mbview_label_slopemax;
-    Widget mbview_textField_slopemin;
-    Widget mbview_label_slopemin;
-    Widget mbview_label_slopebounds;
-    Widget mbview_radioBox_colormode;
-    Widget mbview_toggleButton_data_ctoh;
-    Widget mbview_toggleButton_data_htoc;
-    Widget mbview_textField_datamax;
-    Widget mbview_textField_datamin;
-    Widget mbview_label_colormax;
-    Widget mbview_label_colormin;
-    Widget mbview_label_colorbounds;
-    Widget mbview_separator2;
-    Widget mbview_pushButton_colorbounds_apply;
-    Widget mbview_label_contour;
-    Widget mbview_textField_contours;
-    Widget mbview_pushButton_colorbounds_dismiss;
-    Widget mbview_dialogShell_resolution;
-    Widget mbview_bulletinBoard_resolution;
-    Widget mbview_scale_navmediumresolution;
-    Widget mbview_scale_navlowresolution;
-    Widget separator;
-    Widget mbview_label_navrenderdecimation;
-    Widget mbview_label_gridrenderres;
-    Widget mbview_scale_mediumresolution;
-    Widget mbview_scale_lowresolution;
-    Widget mbview_pushButton_resolution_dismiss;
-    Widget mbview_dialogShell_message;
-    Widget mbview_bulletinBoard_message;
-    Widget mbview_label_message;
-    Widget mbview_label_thanks;
-    Widget mbview_dialogShell_about;
-    Widget mbview_bulletinBoard_about;
-    Widget mbview_label_about_version;
-    Widget mbview_label_about_authors;
-    Widget mbview_label_about_MBARI;
-    Widget mbview_label_about_LDEO;
-    Widget mbview_separator6;
-    Widget mbview_label_about_mbsystem;
-    Widget mbview_separator7;
-    Widget mbview_label_about_title;
-    Widget mbview_pushButton_about_dismiss;
-    Widget mbview_dialogShell_shadeparms;
-    Widget mbview_bulletinBoard_shadeparms;
-    Widget mbview_separator13;
-    Widget mbview_textField_overlay_center;
-    Widget mbview_label_overlay_center;
-    Widget mbview_label_overlayshade;
-    Widget mbview_radioBox_overlay_shade;
-    Widget mbview_toggleButton_overlay_shade_ctoh;
-    Widget mbview_toggleButton_overlay_shade_htoc;
-    Widget mbview_textField_overlay_amp;
-    Widget mbview_label_overlay_amp;
-    Widget mbview_separator15;
-    Widget mbview_textField_slope_amp;
-    Widget mbview_label_slope_amp;
-    Widget mbview_label_slopeshade;
-    Widget mbview_textField_illum_azi;
-    Widget mbview_textField_illum_amp;
-    Widget mbview_label_illum_azi;
-    Widget mbview_label_illum_amp;
-    Widget mbview_label_illumination;
-    Widget mbview_separator16;
-    Widget mbview_pushButton_shadeparms_apply;
-    Widget mbview_label_illum_elev;
-    Widget mbview_textField_illum_elev;
-    Widget mbview_pushButton_shadeparms_dismiss2;
-    Widget mbview_dialogShell_3dparms;
-    Widget mbview_bulletinBoard_3dparms;
-    Widget mbview_textField_model_3dzoom;
-    Widget mbview_label_model_3dzoom;
-    Widget mbview_separator11;
-    Widget mbview_textField_view_3dzoom;
-    Widget mbview_label_view_3dzoom;
-    Widget mbview_textField_view_3doffsety;
-    Widget mbview_label_view_3doffsety;
-    Widget mbview_separator20;
-    Widget mbview_textField_view_3doffsetx;
-    Widget mbview_label_view_3doffsetx;
-    Widget mbview_label_view_offset;
-    Widget mbview_textField_view_elevation;
-    Widget mbview_label_view_elevation;
-    Widget mbview_separator4;
-    Widget mbview_textField_view_azimuth;
-    Widget mbview_label_view_azimuth;
-    Widget mbview_label_view;
-    Widget mbview_textField_model_elevation;
-    Widget mbview_textField_model_azimuth;
-    Widget mbview_label_model_elevation;
-    Widget mbview_label_model_azimuth;
-    Widget mbview_label_model;
-    Widget mbview_separator9;
-    Widget mbview_pushButton_view_3d_apply;
-    Widget mbview_label_exager;
-    Widget mbview_textField_exageration;
-    Widget mbview_pushButton_view_3d_dismiss;
-    Widget mbview_dialogShell_2dparms;
-    Widget mbview_bulletinBoard_2dparms;
-    Widget mbview_textField_view_2dzoom;
-    Widget mbview_label_view_2dzoom;
-    Widget mbview_textField_view_2doffsety;
-    Widget mbview_label_view_2doffsety;
-    Widget mbview_separator14;
-    Widget mbview_textField_view_2doffsetx;
-    Widget mbview_label_view_2doffsetx;
-    Widget mbview_label_2d_offset;
-    Widget mbview_pushButton_view_2d_apply;
-    Widget mbview_pushButton_view_2d_dismiss;
-    Widget mbview_dialogShell_projection;
-    Widget mbview_bulletinBoard_projection;
-    Widget mbview_label_displayprojection;
-    Widget mbview_radioBox_projection;
-    Widget mbview_toggleButton_geographic;
-    Widget mbview_toggleButton_utm;
-    Widget mbview_toggleButton_spheroid;
-    Widget mbview_label_projection;
-    Widget mbview_pushButton_projection_dismiss;
-    Widget mbview_dialogShell_profile;
-    Widget mbview_form_profile;
-    Widget mbview_scale_profile_width;
-    Widget mbview_scale_profile_slope;
-    Widget mbview_scrolledWindow_profile;
-    Widget mbview_drawingArea_profile;
-    Widget mbview_profile_label_info;
-    Widget mbview_scale_profile_exager;
-    Widget mbview_profile_pushButton_dismiss;
-    
-    /**
-     * All methods and data..
-     */
-} MB3DViewData;
-
-/*
- * Function: MB3DViewCreate()
- *		The creation for class MB3DView.
- */
-MB3DViewDataPtr MB3DViewCreate(MB3DViewDataPtr, Widget, String, ArgList, Cardinal);
-
-/**
- * Set routines for exposed resources.
- */
-#endif
diff --git a/src/mbview/MBpedit.c b/src/mbview/MBpedit.c
deleted file mode 100644
index c83381c..0000000
--- a/src/mbview/MBpedit.c
+++ /dev/null
@@ -1,2623 +0,0 @@
-
-/* Begin user code block <abstract> */
-/* End user code block <abstract> */
-
-/**
- * README: Portions of this file are merged at file generation
- * time. Edits can be made *only* in between specified code blocks, look
- * for keywords <Begin user code> and <End user code>.
- */
-/*
- * Generated by the ICS Builder Xcessory (BX).
- *
- * BuilderXcessory Version 6.1.3
- * Code Generator Xcessory 6.1.3 (08/19/04) CGX Scripts 6.1 Motif 2.1
- *
- */
-
-/* Begin user code block <file_comments> */
-
-#ifndef SANS
-#define SANS "helvetica"
-#endif
-#ifndef SERIF
-#define SERIF "times"
-#endif
-#ifndef MONO
-#define MONO "courier"
-#endif
-
-/* End user code block <file_comments> */
-
-#include <Xm/Xm.h>
-#include <Xm/Form.h>
-#include <Xm/BulletinB.h>
-#include <Xm/PushB.h>
-#include <Xm/RowColumn.h>
-#include <Xm/CascadeB.h>
-#include <Xm/ToggleB.h>
-#include <Xm/Separator.h>
-#include <Xm/Label.h>
-#include <Xm/Scale.h>
-#include <Xm/DrawingA.h>
-#include <Xm/DialogS.h>
-#include <Xm/MwmUtil.h>
-#include <Xm/ScrolledW.h>
-#include <Xm/Form.h>
-#include <Xm/BulletinB.h>
-#include <Xm/PushB.h>
-#include <Xm/RowColumn.h>
-#include <Xm/CascadeB.h>
-#include <Xm/ToggleB.h>
-#include <Xm/Separator.h>
-#include <Xm/Label.h>
-#include <Xm/Scale.h>
-#include <Xm/DrawingA.h>
-#include <Xm/DialogS.h>
-#include <Xm/MwmUtil.h>
-#include <Xm/ScrolledW.h>
-#include "MBpedit.h"
-
-/**
- * Common constant and pixmap declarations.
- */
-#include "mbpingedit_creation.h"
-
-/**
- * Convenience functions from utilities file.
- */
-extern void RegisterBxConverters(XtAppContext);
-extern XtPointer BX_CONVERT(Widget, char *, char *, int, Boolean *);
-extern XtPointer BX_DOUBLE(double);
-extern XtPointer BX_SINGLE(float);
-extern void BX_MENU_POST(Widget, XtPointer, XEvent *, Boolean *);
-extern Pixmap XPM_PIXMAP(Widget, char **);
-extern void BX_SET_BACKGROUND_COLOR(Widget, ArgList, Cardinal *, Pixel);
-
-/**
- * Declarations for callbacks and handlers.
- */
-extern void do_mbpingedit_event(Widget, XtPointer, XtPointer);
-extern void do_mbpingedit_expose(Widget, XtPointer, XtPointer);
-extern void do_mbpingedit_flag_view(Widget, XtPointer, XtPointer);
-extern void do_mbpingedit_unflag_all(Widget, XtPointer, XtPointer);
-extern void do_mbpingedit_unflag_view(Widget, XtPointer, XtPointer);
-extern void do_mbpingedit_next_buffer(Widget, XtPointer, XtPointer);
-extern void do_mbpingedit_dismiss(Widget, XtPointer, XtPointer);
-extern void do_mbpingedit_forward(Widget, XtPointer, XtPointer);
-extern void do_mbpingedit_reverse(Widget, XtPointer, XtPointer);
-extern void do_mbpingedit_scale_x(Widget, XtPointer, XtPointer);
-extern void do_mbpingedit_scale_y(Widget, XtPointer, XtPointer);
-extern void do_mbpingedit_number_pings(Widget, XtPointer, XtPointer);
-extern void do_mbpingedit_number_step(Widget, XtPointer, XtPointer);
-extern void do_mbpingedit_view_mode(Widget, XtPointer, XtPointer);
-extern void do_mbpingedit_show_flagged(Widget, XtPointer, XtPointer);
-extern void do_mbpingedit_show_detects(Widget, XtPointer, XtPointer);
-extern void do_mbpingedit_show_time(Widget, XtPointer, XtPointer);
-extern void BxManageCB(Widget, XtPointer, XtPointer);
-extern void do_mbpingedit_reverse_keys(Widget, XtPointer, XtPointer);
-extern void do_mbpingedit_reverse_mouse(Widget, XtPointer, XtPointer);
-extern void do_mbpingedit_mode_toggle(Widget, XtPointer, XtPointer);
-extern void do_mbpingedit_mode_pick(Widget, XtPointer, XtPointer);
-extern void do_mbpingedit_mode_erase(Widget, XtPointer, XtPointer);
-extern void do_mbpingedit_mode_restore(Widget, XtPointer, XtPointer);
-extern void do_mbpingedit_mode_grab(Widget, XtPointer, XtPointer);
-extern void do_mbpingedit_mode_info(Widget, XtPointer, XtPointer);
-extern void do_mbpingedit_reset_filters(Widget, XtPointer, XtPointer);
-extern void do_mbpingedit_set_filters(Widget, XtPointer, XtPointer);
-extern void BxUnmanageCB(Widget, XtPointer, XtPointer);
-extern void do_mbpingedit_check_median_ltrack(Widget, XtPointer, XtPointer);
-extern void do_mbpingedit_check_median_xtrack(Widget, XtPointer, XtPointer);
-extern void do_mbpingedit_y_interval(Widget, XtPointer, XtPointer);
-extern void do_mbpingedit_x_interval(Widget, XtPointer, XtPointer);
-
-/*
- * This table is used to define class resources that are placed
- * in app-defaults. This table is necessary so each instance
- * of this class has the proper default resource values set.
- * This eliminates the need for each instance to have
- * its own app-defaults values. This table must be NULL terminated.
- */
-typedef struct _UIAppDefault {
-    char*      cName;       /* Class name */
-    char*      wName;       /* Widget name */
-    char*      cInstName;   /* Name of class instance (nested class) */
-    char*      wRsc;        /* Widget resource */
-    char*      value;       /* value read from app-defaults */
-} UIAppDefault;
-
-static Boolean doInitAppDefaults = True;
-static UIAppDefault  appDefaults[] = {
-    {NULL, NULL, NULL, NULL, NULL}
-};
-/*
- * The functions to call in the apputils.c
- */
-extern void InitAppDefaults(Widget, UIAppDefault*);
-extern void SetAppDefaults(Widget, UIAppDefault*, char*, Boolean);
-
-MBpeditDataPtr
-MBpeditCreate ( MBpeditDataPtr class_in, Widget parent, String name, ArgList args_in, Cardinal ac_in)
-{
-    Cardinal ac = 0;
-    Arg      args[256];
-    Boolean  argok = False;
-
-    /**
-     * Register the converters for the widgets.
-     */
-    RegisterBxConverters(XtWidgetToApplicationContext(parent));
-    XtInitializeWidgetClass((WidgetClass)xmFormWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmBulletinBoardWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmPushButtonWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmRowColumnWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmCascadeButtonWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmRowColumnWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmToggleButtonWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmSeparatorWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmLabelWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmScaleWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmRowColumnWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmDrawingAreaWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmDialogShellWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmFormWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmScrolledWindowWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmRowColumnWidgetClass);
-    /**
-     * Setup app-defaults fallback table if not already done.
-     */
-    if (doInitAppDefaults)
-    {
-        InitAppDefaults(parent, appDefaults);
-        doInitAppDefaults = False;
-    }
-    /**
-     * Now set the app-defaults for this instance.
-     */
-    SetAppDefaults(parent, appDefaults, name, False);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(parent, (char *)"MBeditviz Swath View",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNdialogTitle, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNresizePolicy, XmRESIZE_GROW); ac++;
-        XtSetArg(args[ac], XmNx, 452); ac++;
-        XtSetArg(args[ac], XmNy, 354); ac++;
-        XtSetArg(args[ac], XmNwidth, 1004); ac++;
-        XtSetArg(args[ac], XmNheight, 694); ac++;
-        class_in->MBpedit = XmCreateForm(parent,
-            (char *)name,
-            args,
-            ac);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNmarginHeight, 0); ac++;
-    XtSetArg(args[ac], XmNmarginWidth, 0); ac++;
-    XtSetArg(args[ac], XmNresizePolicy, XmRESIZE_GROW); ac++;
-    XtSetArg(args[ac], XmNx, 0); ac++;
-    XtSetArg(args[ac], XmNy, 0); ac++;
-    XtSetArg(args[ac], XmNwidth, 1005); ac++;
-    XtSetArg(args[ac], XmNheight, 154); ac++;
-    class_in->mbpingedit_controls = XmCreateBulletinBoard(class_in->MBpedit,
-        (char *)"mbpingedit_controls",
-        args,
-        ac);
-    XtManageChild(class_in->mbpingedit_controls);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbpingedit_controls, (char *)"Flag View",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 480); ac++;
-        XtSetArg(args[ac], XmNy, 0); ac++;
-        XtSetArg(args[ac], XmNwidth, 120); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_controls, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbpingedit_pushButton_flag_view = XmCreatePushButton(class_in->mbpingedit_controls,
-            (char *)"mbpingedit_pushButton_flag_view",
-            args,
-            ac);
-        XtManageChild(class_in->mbpingedit_pushButton_flag_view);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbpingedit_pushButton_flag_view, XmNactivateCallback, do_mbpingedit_flag_view, (XtPointer)0);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNpacking, XmPACK_TIGHT); ac++;
-    XtSetArg(args[ac], XmNx, 10); ac++;
-    XtSetArg(args[ac], XmNy, 0); ac++;
-    XtSetArg(args[ac], XmNwidth, 58); ac++;
-    XtSetArg(args[ac], XmNheight, 34); ac++;
-    class_in->mbpingedit_menuBar_view = XmCreateMenuBar(class_in->mbpingedit_controls,
-        (char *)"mbpingedit_menuBar_view",
-        args,
-        ac);
-    XtManageChild(class_in->mbpingedit_menuBar_view);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbpingedit_menuBar_view, (char *)"View",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 5); ac++;
-        XtSetArg(args[ac], XmNy, 5); ac++;
-        XtSetArg(args[ac], XmNwidth, 48); ac++;
-        XtSetArg(args[ac], XmNheight, 24); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_menuBar_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbpingedit_cascadeButton_view = XmCreateCascadeButton(class_in->mbpingedit_menuBar_view,
-            (char *)"mbpingedit_cascadeButton_view",
-            args,
-            ac);
-        XtManageChild(class_in->mbpingedit_cascadeButton_view);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 0); ac++;
-    XtSetArg(args[ac], XmNy, 0); ac++;
-    XtSetArg(args[ac], XmNwidth, 247); ac++;
-    XtSetArg(args[ac], XmNheight, 440); ac++;
-    class_in->mbpingedit_pulldownMenu_view = XmCreatePulldownMenu(XtParent(class_in->mbpingedit_cascadeButton_view),
-        (char *)"mbpingedit_pulldownMenu_view",
-        args,
-        ac);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbpingedit_pulldownMenu_view, (char *)"Waterfall View",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbpingedit_toggleButton_view_waterfall = XmCreateToggleButton(class_in->mbpingedit_pulldownMenu_view,
-            (char *)"mbpingedit_toggleButton_view_waterfall",
-            args,
-            ac);
-        XtManageChild(class_in->mbpingedit_toggleButton_view_waterfall);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbpingedit_toggleButton_view_waterfall, XmNvalueChangedCallback, do_mbpingedit_view_mode, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbpingedit_pulldownMenu_view, (char *)"Alongtrack View",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbpingedit_toggleButton_view_alongtrack = XmCreateToggleButton(class_in->mbpingedit_pulldownMenu_view,
-            (char *)"mbpingedit_toggleButton_view_alongtrack",
-            args,
-            ac);
-        XtManageChild(class_in->mbpingedit_toggleButton_view_alongtrack);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbpingedit_toggleButton_view_alongtrack, XmNvalueChangedCallback, do_mbpingedit_view_mode, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbpingedit_pulldownMenu_view, (char *)"Acrosstrack View",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbpingedit_toggleButton_view_acrosstrack = XmCreateToggleButton(class_in->mbpingedit_pulldownMenu_view,
-            (char *)"mbpingedit_toggleButton_view_acrosstrack",
-            args,
-            ac);
-        XtManageChild(class_in->mbpingedit_toggleButton_view_acrosstrack);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbpingedit_toggleButton_view_acrosstrack, XmNvalueChangedCallback, do_mbpingedit_view_mode, (XtPointer)0);
-
-    ac = 0;
-    class_in->mbpingedit_separator2 = XmCreateSeparator(class_in->mbpingedit_pulldownMenu_view,
-        (char *)"mbpingedit_separator2",
-        args,
-        ac);
-    XtManageChild(class_in->mbpingedit_separator2);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbpingedit_pulldownMenu_view, (char *)"Show Flagged Profile",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbpingedit_toggleButton_show_flagged_on = XmCreateToggleButton(class_in->mbpingedit_pulldownMenu_view,
-            (char *)"mbpingedit_toggleButton_show_flagged_on",
-            args,
-            ac);
-        XtManageChild(class_in->mbpingedit_toggleButton_show_flagged_on);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbpingedit_toggleButton_show_flagged_on, XmNvalueChangedCallback, do_mbpingedit_show_flagged, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbpingedit_pulldownMenu_view, (char *)"Show Bottom Detect Algorithms",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbpingedit_toggleButton_show_detects = XmCreateToggleButton(class_in->mbpingedit_pulldownMenu_view,
-            (char *)"mbpingedit_toggleButton_show_detects",
-            args,
-            ac);
-        XtManageChild(class_in->mbpingedit_toggleButton_show_detects);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbpingedit_toggleButton_show_detects, XmNvalueChangedCallback, do_mbpingedit_show_detects, (XtPointer)0);
-
-    ac = 0;
-    class_in->mbpingedit_separator9 = XmCreateSeparator(class_in->mbpingedit_pulldownMenu_view,
-        (char *)"mbpingedit_separator9",
-        args,
-        ac);
-    XtManageChild(class_in->mbpingedit_separator9);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbpingedit_pulldownMenu_view, (char *)"Wide Bathymetry Profiles",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbpingedit_toggleButton_show_wideplot = XmCreateToggleButton(class_in->mbpingedit_pulldownMenu_view,
-            (char *)"mbpingedit_toggleButton_show_wideplot",
-            args,
-            ac);
-        XtManageChild(class_in->mbpingedit_toggleButton_show_wideplot);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbpingedit_toggleButton_show_wideplot, XmNvalueChangedCallback, do_mbpingedit_show_time, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbpingedit_pulldownMenu_view, (char *)"Print Time Stamps",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbpingedit_toggleButton_show_time = XmCreateToggleButton(class_in->mbpingedit_pulldownMenu_view,
-            (char *)"mbpingedit_toggleButton_show_time",
-            args,
-            ac);
-        XtManageChild(class_in->mbpingedit_toggleButton_show_time);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbpingedit_toggleButton_show_time, XmNvalueChangedCallback, do_mbpingedit_show_time, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbpingedit_pulldownMenu_view, (char *)"Plot Ping Interval",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbpingedit_toggleButton_show_interval = XmCreateToggleButton(class_in->mbpingedit_pulldownMenu_view,
-            (char *)"mbpingedit_toggleButton_show_interval",
-            args,
-            ac);
-        XtManageChild(class_in->mbpingedit_toggleButton_show_interval);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbpingedit_toggleButton_show_interval, XmNvalueChangedCallback, do_mbpingedit_show_time, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbpingedit_pulldownMenu_view, (char *)"Plot Longitude",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbpingedit_toggleButton_show_lon = XmCreateToggleButton(class_in->mbpingedit_pulldownMenu_view,
-            (char *)"mbpingedit_toggleButton_show_lon",
-            args,
-            ac);
-        XtManageChild(class_in->mbpingedit_toggleButton_show_lon);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbpingedit_toggleButton_show_lon, XmNvalueChangedCallback, do_mbpingedit_show_time, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbpingedit_pulldownMenu_view, (char *)"Plot Latitude",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbpingedit_toggleButton_show_latitude = XmCreateToggleButton(class_in->mbpingedit_pulldownMenu_view,
-            (char *)"mbpingedit_toggleButton_show_latitude",
-            args,
-            ac);
-        XtManageChild(class_in->mbpingedit_toggleButton_show_latitude);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbpingedit_toggleButton_show_latitude, XmNvalueChangedCallback, do_mbpingedit_show_time, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbpingedit_pulldownMenu_view, (char *)"Plot Heading",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbpingedit_toggleButton_show_heading = XmCreateToggleButton(class_in->mbpingedit_pulldownMenu_view,
-            (char *)"mbpingedit_toggleButton_show_heading",
-            args,
-            ac);
-        XtManageChild(class_in->mbpingedit_toggleButton_show_heading);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbpingedit_toggleButton_show_heading, XmNvalueChangedCallback, do_mbpingedit_show_time, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbpingedit_pulldownMenu_view, (char *)"Plot Speed",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbpingedit_toggleButton_show_speed = XmCreateToggleButton(class_in->mbpingedit_pulldownMenu_view,
-            (char *)"mbpingedit_toggleButton_show_speed",
-            args,
-            ac);
-        XtManageChild(class_in->mbpingedit_toggleButton_show_speed);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbpingedit_toggleButton_show_speed, XmNvalueChangedCallback, do_mbpingedit_show_time, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbpingedit_pulldownMenu_view, (char *)"Plot Center Beam Depth",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbpingedit_toggleButton_show_depth = XmCreateToggleButton(class_in->mbpingedit_pulldownMenu_view,
-            (char *)"mbpingedit_toggleButton_show_depth",
-            args,
-            ac);
-        XtManageChild(class_in->mbpingedit_toggleButton_show_depth);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbpingedit_toggleButton_show_depth, XmNvalueChangedCallback, do_mbpingedit_show_time, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbpingedit_pulldownMenu_view, (char *)"Plot Sonar Altitude",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbpingedit_toggleButton_show_altitude = XmCreateToggleButton(class_in->mbpingedit_pulldownMenu_view,
-            (char *)"mbpingedit_toggleButton_show_altitude",
-            args,
-            ac);
-        XtManageChild(class_in->mbpingedit_toggleButton_show_altitude);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbpingedit_toggleButton_show_altitude, XmNvalueChangedCallback, do_mbpingedit_show_time, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbpingedit_pulldownMenu_view, (char *)"Plot Sonar Depth",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbpingedit_toggleButton_show_sonardepth = XmCreateToggleButton(class_in->mbpingedit_pulldownMenu_view,
-            (char *)"mbpingedit_toggleButton_show_sonardepth",
-            args,
-            ac);
-        XtManageChild(class_in->mbpingedit_toggleButton_show_sonardepth);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbpingedit_toggleButton_show_sonardepth, XmNvalueChangedCallback, do_mbpingedit_show_time, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbpingedit_pulldownMenu_view, (char *)"Plot Roll",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbpingedit_toggleButton_show_roll = XmCreateToggleButton(class_in->mbpingedit_pulldownMenu_view,
-            (char *)"mbpingedit_toggleButton_show_roll",
-            args,
-            ac);
-        XtManageChild(class_in->mbpingedit_toggleButton_show_roll);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbpingedit_toggleButton_show_roll, XmNvalueChangedCallback, do_mbpingedit_show_time, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbpingedit_pulldownMenu_view, (char *)"Plot Pitch",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbpingedit_toggleButton_show_pitch = XmCreateToggleButton(class_in->mbpingedit_pulldownMenu_view,
-            (char *)"mbpingedit_toggleButton_show_pitch",
-            args,
-            ac);
-        XtManageChild(class_in->mbpingedit_toggleButton_show_pitch);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbpingedit_toggleButton_show_pitch, XmNvalueChangedCallback, do_mbpingedit_show_time, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbpingedit_pulldownMenu_view, (char *)"Plot Heave",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbpingedit_toggleButton_show_heave = XmCreateToggleButton(class_in->mbpingedit_pulldownMenu_view,
-            (char *)"mbpingedit_toggleButton_show_heave",
-            args,
-            ac);
-        XtManageChild(class_in->mbpingedit_toggleButton_show_heave);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbpingedit_toggleButton_show_heave, XmNvalueChangedCallback, do_mbpingedit_show_time, (XtPointer)0);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNsubMenuId, class_in->mbpingedit_pulldownMenu_view); ac++;
-    XtSetValues(class_in->mbpingedit_cascadeButton_view, args, ac);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbpingedit_controls, (char *)"Unflag Forward",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 730); ac++;
-        XtSetArg(args[ac], XmNy, 0); ac++;
-        XtSetArg(args[ac], XmNwidth, 120); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_controls, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbpingedit_pushButton_unflag_all = XmCreatePushButton(class_in->mbpingedit_controls,
-            (char *)"mbpingedit_pushButton_unflag_all",
-            args,
-            ac);
-        XtManageChild(class_in->mbpingedit_pushButton_unflag_all);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbpingedit_pushButton_unflag_all, XmNactivateCallback, do_mbpingedit_unflag_all, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbpingedit_controls, (char *)"Unflag View",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 610); ac++;
-        XtSetArg(args[ac], XmNy, 0); ac++;
-        XtSetArg(args[ac], XmNwidth, 120); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_controls, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbpingedit_pushButton_unflag_view = XmCreatePushButton(class_in->mbpingedit_controls,
-            (char *)"mbpingedit_pushButton_unflag_view",
-            args,
-            ac);
-        XtManageChild(class_in->mbpingedit_pushButton_unflag_view);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbpingedit_pushButton_unflag_view, XmNactivateCallback, do_mbpingedit_unflag_view, (XtPointer)0);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 80); ac++;
-    XtSetArg(args[ac], XmNy, 0); ac++;
-    XtSetArg(args[ac], XmNwidth, 87); ac++;
-    XtSetArg(args[ac], XmNheight, 34); ac++;
-    class_in->mbpingedit_menuBar_controls = XmCreateMenuBar(class_in->mbpingedit_controls,
-        (char *)"mbpingedit_menuBar_controls",
-        args,
-        ac);
-    XtManageChild(class_in->mbpingedit_menuBar_controls);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbpingedit_menuBar_controls, (char *)"Controls",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 5); ac++;
-        XtSetArg(args[ac], XmNy, 5); ac++;
-        XtSetArg(args[ac], XmNwidth, 77); ac++;
-        XtSetArg(args[ac], XmNheight, 24); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_menuBar_controls, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbpingedit_cascadeButton_controls = XmCreateCascadeButton(class_in->mbpingedit_menuBar_controls,
-            (char *)"mbpingedit_cascadeButton_controls",
-            args,
-            ac);
-        XtManageChild(class_in->mbpingedit_cascadeButton_controls);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 0); ac++;
-    XtSetArg(args[ac], XmNy, 0); ac++;
-    XtSetArg(args[ac], XmNwidth, 240); ac++;
-    XtSetArg(args[ac], XmNheight, 150); ac++;
-    class_in->mbpingedit_pulldownMenu_controls = XmCreatePulldownMenu(XtParent(class_in->mbpingedit_cascadeButton_controls),
-        (char *)"mbpingedit_pulldownMenu_controls",
-        args,
-        ac);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbpingedit_pulldownMenu_controls, (char *)"Go To Specified Time...",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_pulldownMenu_controls, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbpingedit_pushButton_goto = XmCreatePushButton(class_in->mbpingedit_pulldownMenu_controls,
-            (char *)"mbpingedit_pushButton_goto",
-            args,
-            ac);
-        XtManageChild(class_in->mbpingedit_pushButton_goto);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbpingedit_pushButton_goto, XmNactivateCallback, BxManageCB, (XtPointer)"mbpingedit_bulletinBoard_goto");
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbpingedit_pulldownMenu_controls, (char *)"Buffer Controls...",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_pulldownMenu_controls, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbpingedit_pushButton_buffer = XmCreatePushButton(class_in->mbpingedit_pulldownMenu_controls,
-            (char *)"mbpingedit_pushButton_buffer",
-            args,
-            ac);
-        XtManageChild(class_in->mbpingedit_pushButton_buffer);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbpingedit_pushButton_buffer, XmNactivateCallback, BxManageCB, (XtPointer)"mbpingedit_bulletinBoard_buffer");
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbpingedit_pulldownMenu_controls, (char *)"Annotation...",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_pulldownMenu_controls, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbpingedit_pushButton_annotation = XmCreatePushButton(class_in->mbpingedit_pulldownMenu_controls,
-            (char *)"mbpingedit_pushButton_annotation",
-            args,
-            ac);
-        XtManageChild(class_in->mbpingedit_pushButton_annotation);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbpingedit_pushButton_annotation, XmNactivateCallback, BxManageCB, (XtPointer)"mbpingedit_bulletinBoard_annotation");
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbpingedit_pulldownMenu_controls, (char *)"Filters...",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_pulldownMenu_controls, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbpingedit_pushButton_filters = XmCreatePushButton(class_in->mbpingedit_pulldownMenu_controls,
-            (char *)"mbpingedit_pushButton_filters",
-            args,
-            ac);
-        XtManageChild(class_in->mbpingedit_pushButton_filters);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbpingedit_pushButton_filters, XmNactivateCallback, BxManageCB, (XtPointer)"mbpingedit_bulletinBoard_filters");
-
-    ac = 0;
-    class_in->mbpingedit_separator7 = XmCreateSeparator(class_in->mbpingedit_pulldownMenu_controls,
-        (char *)"mbpingedit_separator7",
-        args,
-        ac);
-    XtManageChild(class_in->mbpingedit_separator7);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbpingedit_pulldownMenu_controls, (char *)"Reverse Right/Left Key Macros",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_pulldownMenu_controls, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbpingedit_toggleButton_reverse_keys = XmCreateToggleButton(class_in->mbpingedit_pulldownMenu_controls,
-            (char *)"mbpingedit_toggleButton_reverse_keys",
-            args,
-            ac);
-        XtManageChild(class_in->mbpingedit_toggleButton_reverse_keys);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbpingedit_toggleButton_reverse_keys, XmNvalueChangedCallback, do_mbpingedit_reverse_keys, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbpingedit_pulldownMenu_controls, (char *)"Reverse Mouse Buttons",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_pulldownMenu_controls, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbpingedit_toggleButton_reverse_mouse = XmCreateToggleButton(class_in->mbpingedit_pulldownMenu_controls,
-            (char *)"mbpingedit_toggleButton_reverse_mouse",
-            args,
-            ac);
-        XtManageChild(class_in->mbpingedit_toggleButton_reverse_mouse);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbpingedit_toggleButton_reverse_mouse, XmNvalueChangedCallback, do_mbpingedit_reverse_mouse, (XtPointer)0);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNsubMenuId, class_in->mbpingedit_pulldownMenu_controls); ac++;
-    XtSetValues(class_in->mbpingedit_cascadeButton_controls, args, ac);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbpingedit_controls, (char *)"Next File",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 360); ac++;
-        XtSetArg(args[ac], XmNy, 0); ac++;
-        XtSetArg(args[ac], XmNwidth, 90); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_controls, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbpingedit_pushButton_next = XmCreatePushButton(class_in->mbpingedit_controls,
-            (char *)"mbpingedit_pushButton_next",
-            args,
-            ac);
-        XtManageChild(class_in->mbpingedit_pushButton_next);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbpingedit_pushButton_next, XmNactivateCallback, do_mbpingedit_next_buffer, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbpingedit_controls, (char *)"Dismiss",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 910); ac++;
-        XtSetArg(args[ac], XmNy, 0); ac++;
-        XtSetArg(args[ac], XmNwidth, 80); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_controls, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbpingedit_pushButton_dismiss = XmCreatePushButton(class_in->mbpingedit_controls,
-            (char *)"mbpingedit_pushButton_dismiss",
-            args,
-            ac);
-        XtManageChild(class_in->mbpingedit_pushButton_dismiss);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbpingedit_pushButton_dismiss, XmNactivateCallback, do_mbpingedit_dismiss, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbpingedit_controls, (char *)"Forward",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 270); ac++;
-        XtSetArg(args[ac], XmNy, 0); ac++;
-        XtSetArg(args[ac], XmNwidth, 80); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_controls, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbpingedit_pushButton_forward = XmCreatePushButton(class_in->mbpingedit_controls,
-            (char *)"mbpingedit_pushButton_forward",
-            args,
-            ac);
-        XtManageChild(class_in->mbpingedit_pushButton_forward);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbpingedit_pushButton_forward, XmNactivateCallback, do_mbpingedit_forward, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbpingedit_controls, (char *)"Reverse",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 180); ac++;
-        XtSetArg(args[ac], XmNy, 0); ac++;
-        XtSetArg(args[ac], XmNwidth, 80); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_controls, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbpingedit_pushButton_reverse = XmCreatePushButton(class_in->mbpingedit_controls,
-            (char *)"mbpingedit_pushButton_reverse",
-            args,
-            ac);
-        XtManageChild(class_in->mbpingedit_pushButton_reverse);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbpingedit_pushButton_reverse, XmNactivateCallback, do_mbpingedit_reverse, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbpingedit_controls, (char *)"Acrosstrack Width (m):  1",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_END); ac++;
-        XtSetArg(args[ac], XmNx, 30); ac++;
-        XtSetArg(args[ac], XmNy, 50); ac++;
-        XtSetArg(args[ac], XmNheight, 20); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_controls, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbpingedit_slider_mbpingedit_scale_x_label = XmCreateLabel(class_in->mbpingedit_controls,
-            (char *)"mbpingedit_slider_mbpingedit_scale_x_label",
-            args,
-            ac);
-        XtManageChild(class_in->mbpingedit_slider_mbpingedit_scale_x_label);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNminimum, 1); ac++;
-    XtSetArg(args[ac], XmNvalue, 1000); ac++;
-    XtSetArg(args[ac], XmNmaximum, 20000); ac++;
-    XtSetArg(args[ac], XmNscaleHeight, 15); ac++;
-    XtSetArg(args[ac], XmNshowArrows, TRUE); ac++;
-    XtSetArg(args[ac], XmNscaleMultiple, 1); ac++;
-    XtSetArg(args[ac], XmNshowValue, TRUE); ac++;
-    XtSetArg(args[ac], XmNorientation, XmHORIZONTAL); ac++;
-    XtSetArg(args[ac], XmNx, 210); ac++;
-    XtSetArg(args[ac], XmNy, 40); ac++;
-    XtSetArg(args[ac], XmNwidth, 260); ac++;
-    XtSetArg(args[ac], XmNheight, 34); ac++;
-    XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(class_in->mbpingedit_controls, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-        XmRFontList, 0, &argok)); if (argok) ac++;
-    class_in->mbpingedit_slider_mbpingedit_scale_x = XmCreateScale(class_in->mbpingedit_controls,
-        (char *)"mbpingedit_slider_mbpingedit_scale_x",
-        args,
-        ac);
-    XtManageChild(class_in->mbpingedit_slider_mbpingedit_scale_x);
-    XtAddCallback(class_in->mbpingedit_slider_mbpingedit_scale_x, XmNvalueChangedCallback, do_mbpingedit_scale_x, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbpingedit_controls, (char *)"20000",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
-        XtSetArg(args[ac], XmNx, 470); ac++;
-        XtSetArg(args[ac], XmNy, 50); ac++;
-        XtSetArg(args[ac], XmNwidth, 60); ac++;
-        XtSetArg(args[ac], XmNheight, 20); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_controls, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbpingedit_slider_mbpingedit_scale_x_max_label = XmCreateLabel(class_in->mbpingedit_controls,
-            (char *)"mbpingedit_slider_mbpingedit_scale_x_max_label",
-            args,
-            ac);
-        XtManageChild(class_in->mbpingedit_slider_mbpingedit_scale_x_max_label);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbpingedit_controls, (char *)"Vertical Exaggeration: 0.01",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_END); ac++;
-        XtSetArg(args[ac], XmNx, 20); ac++;
-        XtSetArg(args[ac], XmNy, 90); ac++;
-        XtSetArg(args[ac], XmNheight, 20); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_controls, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbpingedit_slider_mbpingedit_scale_y_label = XmCreateLabel(class_in->mbpingedit_controls,
-            (char *)"mbpingedit_slider_mbpingedit_scale_y_label",
-            args,
-            ac);
-        XtManageChild(class_in->mbpingedit_slider_mbpingedit_scale_y_label);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNminimum, 1); ac++;
-    XtSetArg(args[ac], XmNdecimalPoints, 2); ac++;
-    XtSetArg(args[ac], XmNvalue, 100); ac++;
-    XtSetArg(args[ac], XmNmaximum, 2000); ac++;
-    XtSetArg(args[ac], XmNscaleHeight, 15); ac++;
-    XtSetArg(args[ac], XmNshowArrows, TRUE); ac++;
-    XtSetArg(args[ac], XmNscaleMultiple, 1); ac++;
-    XtSetArg(args[ac], XmNshowValue, TRUE); ac++;
-    XtSetArg(args[ac], XmNorientation, XmHORIZONTAL); ac++;
-    XtSetArg(args[ac], XmNx, 210); ac++;
-    XtSetArg(args[ac], XmNy, 80); ac++;
-    XtSetArg(args[ac], XmNwidth, 260); ac++;
-    XtSetArg(args[ac], XmNheight, 34); ac++;
-    XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(class_in->mbpingedit_controls, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-        XmRFontList, 0, &argok)); if (argok) ac++;
-    class_in->mbpingedit_slider_mbpingedit_scale_y = XmCreateScale(class_in->mbpingedit_controls,
-        (char *)"mbpingedit_slider_mbpingedit_scale_y",
-        args,
-        ac);
-    XtManageChild(class_in->mbpingedit_slider_mbpingedit_scale_y);
-    XtAddCallback(class_in->mbpingedit_slider_mbpingedit_scale_y, XmNvalueChangedCallback, do_mbpingedit_scale_y, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbpingedit_controls, (char *)"20.00",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
-        XtSetArg(args[ac], XmNx, 470); ac++;
-        XtSetArg(args[ac], XmNy, 90); ac++;
-        XtSetArg(args[ac], XmNwidth, 65); ac++;
-        XtSetArg(args[ac], XmNheight, 20); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_controls, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbpingedit_slider_mbpingedit_scale_y_max_label = XmCreateLabel(class_in->mbpingedit_controls,
-            (char *)"mbpingedit_slider_mbpingedit_scale_y_max_label",
-            args,
-            ac);
-        XtManageChild(class_in->mbpingedit_slider_mbpingedit_scale_y_max_label);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbpingedit_controls, (char *)"Pings shown:   1",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_END); ac++;
-        XtSetArg(args[ac], XmNx, 550); ac++;
-        XtSetArg(args[ac], XmNy, 50); ac++;
-        XtSetArg(args[ac], XmNheight, 20); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_controls, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbpingedit_slider_number_pings_label = XmCreateLabel(class_in->mbpingedit_controls,
-            (char *)"mbpingedit_slider_number_pings_label",
-            args,
-            ac);
-        XtManageChild(class_in->mbpingedit_slider_number_pings_label);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNminimum, 1); ac++;
-    XtSetArg(args[ac], XmNvalue, 10); ac++;
-    XtSetArg(args[ac], XmNmaximum, 20); ac++;
-    XtSetArg(args[ac], XmNscaleHeight, 15); ac++;
-    XtSetArg(args[ac], XmNshowArrows, TRUE); ac++;
-    XtSetArg(args[ac], XmNscaleMultiple, 1); ac++;
-    XtSetArg(args[ac], XmNshowValue, TRUE); ac++;
-    XtSetArg(args[ac], XmNorientation, XmHORIZONTAL); ac++;
-    XtSetArg(args[ac], XmNx, 670); ac++;
-    XtSetArg(args[ac], XmNy, 40); ac++;
-    XtSetArg(args[ac], XmNwidth, 290); ac++;
-    XtSetArg(args[ac], XmNheight, 34); ac++;
-    XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(class_in->mbpingedit_controls, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-        XmRFontList, 0, &argok)); if (argok) ac++;
-    class_in->mbpingedit_slider_number_pings = XmCreateScale(class_in->mbpingedit_controls,
-        (char *)"mbpingedit_slider_number_pings",
-        args,
-        ac);
-    XtManageChild(class_in->mbpingedit_slider_number_pings);
-    XtAddCallback(class_in->mbpingedit_slider_number_pings, XmNvalueChangedCallback, do_mbpingedit_number_pings, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbpingedit_controls, (char *)"20",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
-        XtSetArg(args[ac], XmNx, 960); ac++;
-        XtSetArg(args[ac], XmNy, 50); ac++;
-        XtSetArg(args[ac], XmNwidth, 50); ac++;
-        XtSetArg(args[ac], XmNheight, 20); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_controls, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbpingedit_slider_num_pings_max_label = XmCreateLabel(class_in->mbpingedit_controls,
-            (char *)"mbpingedit_slider_num_pings_max_label",
-            args,
-            ac);
-        XtManageChild(class_in->mbpingedit_slider_num_pings_max_label);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbpingedit_controls, (char *)"Pings to step:  1",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_END); ac++;
-        XtSetArg(args[ac], XmNx, 550); ac++;
-        XtSetArg(args[ac], XmNy, 90); ac++;
-        XtSetArg(args[ac], XmNheight, 20); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_controls, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbpingedit_slider_number_step_label = XmCreateLabel(class_in->mbpingedit_controls,
-            (char *)"mbpingedit_slider_number_step_label",
-            args,
-            ac);
-        XtManageChild(class_in->mbpingedit_slider_number_step_label);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNminimum, 1); ac++;
-    XtSetArg(args[ac], XmNvalue, 5); ac++;
-    XtSetArg(args[ac], XmNmaximum, 20); ac++;
-    XtSetArg(args[ac], XmNscaleHeight, 15); ac++;
-    XtSetArg(args[ac], XmNshowArrows, TRUE); ac++;
-    XtSetArg(args[ac], XmNscaleMultiple, 1); ac++;
-    XtSetArg(args[ac], XmNshowValue, TRUE); ac++;
-    XtSetArg(args[ac], XmNorientation, XmHORIZONTAL); ac++;
-    XtSetArg(args[ac], XmNx, 670); ac++;
-    XtSetArg(args[ac], XmNy, 80); ac++;
-    XtSetArg(args[ac], XmNwidth, 290); ac++;
-    XtSetArg(args[ac], XmNheight, 34); ac++;
-    XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(class_in->mbpingedit_controls, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-        XmRFontList, 0, &argok)); if (argok) ac++;
-    class_in->mbpingedit_slider_number_step = XmCreateScale(class_in->mbpingedit_controls,
-        (char *)"mbpingedit_slider_number_step",
-        args,
-        ac);
-    XtManageChild(class_in->mbpingedit_slider_number_step);
-    XtAddCallback(class_in->mbpingedit_slider_number_step, XmNvalueChangedCallback, do_mbpingedit_number_step, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbpingedit_controls, (char *)"20",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
-        XtSetArg(args[ac], XmNx, 960); ac++;
-        XtSetArg(args[ac], XmNy, 90); ac++;
-        XtSetArg(args[ac], XmNwidth, 50); ac++;
-        XtSetArg(args[ac], XmNheight, 20); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_controls, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbpingedit_slider_number_max_step_label = XmCreateLabel(class_in->mbpingedit_controls,
-            (char *)"mbpingedit_slider_number_max_step_label",
-            args,
-            ac);
-        XtManageChild(class_in->mbpingedit_slider_number_max_step_label);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbpingedit_controls, (char *)"Mode:",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNmarginWidth, 0); ac++;
-        XtSetArg(args[ac], XmNx, 70); ac++;
-        XtSetArg(args[ac], XmNy, 120); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_controls, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbpingedit_setting_mode_label = XmCreateLabel(class_in->mbpingedit_controls,
-            (char *)"mbpingedit_setting_mode_label",
-            args,
-            ac);
-        XtManageChild(class_in->mbpingedit_setting_mode_label);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNnumColumns, 1); ac++;
-    XtSetArg(args[ac], XmNpacking, XmPACK_TIGHT); ac++;
-    XtSetArg(args[ac], XmNradioBehavior, True); ac++;
-    XtSetArg(args[ac], XmNspacing, 0); ac++;
-    XtSetArg(args[ac], XmNorientation, XmHORIZONTAL); ac++;
-    XtSetArg(args[ac], XmNx, 120); ac++;
-    XtSetArg(args[ac], XmNy, 120); ac++;
-    XtSetArg(args[ac], XmNwidth, 405); ac++;
-    XtSetArg(args[ac], XmNheight, 34); ac++;
-    class_in->mbpingedit_setting_mode = XmCreateRowColumn(class_in->mbpingedit_controls,
-        (char *)"mbpingedit_setting_mode",
-        args,
-        ac);
-    XtManageChild(class_in->mbpingedit_setting_mode);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbpingedit_setting_mode, (char *)"Toggle",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNwidth, 75); ac++;
-        XtSetArg(args[ac], XmNheight, 28); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_setting_mode, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbpingedit_togglebutton_toggle = XmCreateToggleButton(class_in->mbpingedit_setting_mode,
-            (char *)"mbpingedit_togglebutton_toggle",
-            args,
-            ac);
-        XtManageChild(class_in->mbpingedit_togglebutton_toggle);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbpingedit_togglebutton_toggle, XmNvalueChangedCallback, do_mbpingedit_mode_toggle, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbpingedit_setting_mode, (char *)"Pick",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_setting_mode, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbpingedit_togglebutton_pick = XmCreateToggleButton(class_in->mbpingedit_setting_mode,
-            (char *)"mbpingedit_togglebutton_pick",
-            args,
-            ac);
-        XtManageChild(class_in->mbpingedit_togglebutton_pick);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbpingedit_togglebutton_pick, XmNvalueChangedCallback, do_mbpingedit_mode_pick, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbpingedit_setting_mode, (char *)"Erase",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_setting_mode, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbpingedit_togglebutton_erase = XmCreateToggleButton(class_in->mbpingedit_setting_mode,
-            (char *)"mbpingedit_togglebutton_erase",
-            args,
-            ac);
-        XtManageChild(class_in->mbpingedit_togglebutton_erase);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbpingedit_togglebutton_erase, XmNvalueChangedCallback, do_mbpingedit_mode_erase, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbpingedit_setting_mode, (char *)"Restore",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_setting_mode, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbpingedit_togglebutton_restore = XmCreateToggleButton(class_in->mbpingedit_setting_mode,
-            (char *)"mbpingedit_togglebutton_restore",
-            args,
-            ac);
-        XtManageChild(class_in->mbpingedit_togglebutton_restore);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbpingedit_togglebutton_restore, XmNvalueChangedCallback, do_mbpingedit_mode_restore, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbpingedit_setting_mode, (char *)"Grab",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNwidth, 62); ac++;
-        XtSetArg(args[ac], XmNheight, 28); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_setting_mode, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbpingedit_togglebutton_grab = XmCreateToggleButton(class_in->mbpingedit_setting_mode,
-            (char *)"mbpingedit_togglebutton_grab",
-            args,
-            ac);
-        XtManageChild(class_in->mbpingedit_togglebutton_grab);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbpingedit_togglebutton_grab, XmNvalueChangedCallback, do_mbpingedit_mode_grab, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbpingedit_setting_mode, (char *)"Info",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNwidth, 54); ac++;
-        XtSetArg(args[ac], XmNheight, 28); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_setting_mode, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbpingedit_togglebutton_info = XmCreateToggleButton(class_in->mbpingedit_setting_mode,
-            (char *)"mbpingedit_togglebutton_info",
-            args,
-            ac);
-        XtManageChild(class_in->mbpingedit_togglebutton_info);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbpingedit_togglebutton_info, XmNvalueChangedCallback, do_mbpingedit_mode_info, (XtPointer)0);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNborderWidth, 1); ac++;
-    XtSetArg(args[ac], XmNbackground,
-        BX_CONVERT(class_in->MBpedit, (char *)"white",
-        XmRPixel, 0, &argok)); if (argok) ac++;
-    XtSetArg(args[ac], XmNx, 0); ac++;
-    XtSetArg(args[ac], XmNy, 150); ac++;
-    XtSetArg(args[ac], XmNwidth, 1000); ac++;
-    XtSetArg(args[ac], XmNheight, 540); ac++;
-    class_in->mbpingedit_canvas = XmCreateDrawingArea(class_in->MBpedit,
-        (char *)"mbpingedit_canvas",
-        args,
-        ac);
-    XtManageChild(class_in->mbpingedit_canvas);
-    XtAddCallback(class_in->mbpingedit_canvas, XmNinputCallback, do_mbpingedit_event, (XtPointer)0);
-    XtAddCallback(class_in->mbpingedit_canvas, XmNexposeCallback, do_mbpingedit_expose, (XtPointer)0);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNtitle, "MBeditviz Swath View Annotation"); ac++;
-    XtSetArg(args[ac], XmNx, 630); ac++;
-    XtSetArg(args[ac], XmNy, 480); ac++;
-    XtSetArg(args[ac], XmNwidth, 524); ac++;
-    XtSetArg(args[ac], XmNheight, 136); ac++;
-    XtSetArg(args[ac], XmNdeleteResponse, XmDO_NOTHING); ac++;
-    class_in->mbpingedit_dialogShell_annotation = XmCreateDialogShell(class_in->MBpedit,
-        (char *)"mbpingedit_dialogShell_annotation",
-        args,
-        ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNresizePolicy, XmRESIZE_GROW); ac++;
-    XtSetArg(args[ac], XmNx, 630); ac++;
-    XtSetArg(args[ac], XmNy, 480); ac++;
-    XtSetArg(args[ac], XmNwidth, 524); ac++;
-    XtSetArg(args[ac], XmNheight, 136); ac++;
-    class_in->mbpingedit_form_annotation = XtCreateWidget((char *)"mbpingedit_form_annotation",
-        xmFormWidgetClass,
-        class_in->mbpingedit_dialogShell_annotation,
-        args,
-        ac);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbpingedit_form_annotation, (char *)"Dismiss",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 230); ac++;
-        XtSetArg(args[ac], XmNy, 93); ac++;
-        XtSetArg(args[ac], XmNwidth, 77); ac++;
-        XtSetArg(args[ac], XmNheight, 28); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_form_annotation, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbpingedit_pushButton_annotation_dismiss = XmCreatePushButton(class_in->mbpingedit_form_annotation,
-            (char *)"mbpingedit_pushButton_annotation_dismiss",
-            args,
-            ac);
-        XtManageChild(class_in->mbpingedit_pushButton_annotation_dismiss);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbpingedit_form_annotation, (char *)"1000",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
-        XtSetArg(args[ac], XmNx, 450); ac++;
-        XtSetArg(args[ac], XmNy, 50); ac++;
-        XtSetArg(args[ac], XmNwidth, 65); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_form_annotation, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbpingedit_slider_y_max_interval_label = XmCreateLabel(class_in->mbpingedit_form_annotation,
-            (char *)"mbpingedit_slider_y_max_interval_label",
-            args,
-            ac);
-        XtManageChild(class_in->mbpingedit_slider_y_max_interval_label);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNminimum, 1); ac++;
-    XtSetArg(args[ac], XmNvalue, 250); ac++;
-    XtSetArg(args[ac], XmNmaximum, 1000); ac++;
-    XtSetArg(args[ac], XmNscaleHeight, 15); ac++;
-    XtSetArg(args[ac], XmNshowArrows, TRUE); ac++;
-    XtSetArg(args[ac], XmNscaleMultiple, 1); ac++;
-    XtSetArg(args[ac], XmNshowValue, TRUE); ac++;
-    XtSetArg(args[ac], XmNorientation, XmHORIZONTAL); ac++;
-    XtSetArg(args[ac], XmNx, 190); ac++;
-    XtSetArg(args[ac], XmNy, 40); ac++;
-    XtSetArg(args[ac], XmNwidth, 270); ac++;
-    XtSetArg(args[ac], XmNheight, 34); ac++;
-    XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(class_in->mbpingedit_form_annotation, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-        XmRFontList, 0, &argok)); if (argok) ac++;
-    class_in->mbpingedit_slider_y_interval = XmCreateScale(class_in->mbpingedit_form_annotation,
-        (char *)"mbpingedit_slider_y_interval",
-        args,
-        ac);
-    XtManageChild(class_in->mbpingedit_slider_y_interval);
-    XtAddCallback(class_in->mbpingedit_slider_y_interval, XmNvalueChangedCallback, do_mbpingedit_y_interval, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbpingedit_form_annotation, (char *)"Y Axis Tick Interval (m): 1",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_END); ac++;
-        XtSetArg(args[ac], XmNx, 0); ac++;
-        XtSetArg(args[ac], XmNy, 50); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_form_annotation, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbpingedit_slider_y_interval_label = XmCreateLabel(class_in->mbpingedit_form_annotation,
-            (char *)"mbpingedit_slider_y_interval_label",
-            args,
-            ac);
-        XtManageChild(class_in->mbpingedit_slider_y_interval_label);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbpingedit_form_annotation, (char *)"5000",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
-        XtSetArg(args[ac], XmNx, 450); ac++;
-        XtSetArg(args[ac], XmNy, 10); ac++;
-        XtSetArg(args[ac], XmNwidth, 65); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_form_annotation, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbpingedit_slider_x_max_interval_label = XmCreateLabel(class_in->mbpingedit_form_annotation,
-            (char *)"mbpingedit_slider_x_max_interval_label",
-            args,
-            ac);
-        XtManageChild(class_in->mbpingedit_slider_x_max_interval_label);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNminimum, 1); ac++;
-    XtSetArg(args[ac], XmNvalue, 1000); ac++;
-    XtSetArg(args[ac], XmNmaximum, 5000); ac++;
-    XtSetArg(args[ac], XmNscaleHeight, 15); ac++;
-    XtSetArg(args[ac], XmNshowArrows, TRUE); ac++;
-    XtSetArg(args[ac], XmNscaleMultiple, 1); ac++;
-    XtSetArg(args[ac], XmNshowValue, TRUE); ac++;
-    XtSetArg(args[ac], XmNorientation, XmHORIZONTAL); ac++;
-    XtSetArg(args[ac], XmNx, 190); ac++;
-    XtSetArg(args[ac], XmNy, 0); ac++;
-    XtSetArg(args[ac], XmNwidth, 270); ac++;
-    XtSetArg(args[ac], XmNheight, 34); ac++;
-    XtSetArg(args[ac], XmNfontList,
-        BX_CONVERT(class_in->mbpingedit_form_annotation, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-        XmRFontList, 0, &argok)); if (argok) ac++;
-    class_in->mbpingedit_slider_x_interval = XmCreateScale(class_in->mbpingedit_form_annotation,
-        (char *)"mbpingedit_slider_x_interval",
-        args,
-        ac);
-    XtManageChild(class_in->mbpingedit_slider_x_interval);
-    XtAddCallback(class_in->mbpingedit_slider_x_interval, XmNvalueChangedCallback, do_mbpingedit_x_interval, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbpingedit_form_annotation, (char *)"X Axis Tick Interval (m): 1",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_END); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 10); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_form_annotation, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbpingedit_slider_x_interval_label = XmCreateLabel(class_in->mbpingedit_form_annotation,
-            (char *)"mbpingedit_slider_x_interval_label",
-            args,
-            ac);
-        XtManageChild(class_in->mbpingedit_slider_x_interval_label);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNtitle, "MBeditviz Swath View Filters"); ac++;
-    XtSetArg(args[ac], XmNx, 950); ac++;
-    XtSetArg(args[ac], XmNy, 657); ac++;
-    XtSetArg(args[ac], XmNwidth, 408); ac++;
-    XtSetArg(args[ac], XmNheight, 361); ac++;
-    XtSetArg(args[ac], XmNdeleteResponse, XmDO_NOTHING); ac++;
-    class_in->mbpingedit_dialogShell_filters = XmCreateDialogShell(class_in->MBpedit,
-        (char *)"mbpingedit_dialogShell_filters",
-        args,
-        ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNresizePolicy, XmRESIZE_GROW); ac++;
-    XtSetArg(args[ac], XmNx, 950); ac++;
-    XtSetArg(args[ac], XmNy, 657); ac++;
-    XtSetArg(args[ac], XmNwidth, 408); ac++;
-    XtSetArg(args[ac], XmNheight, 361); ac++;
-    class_in->mbpingedit_form_filters = XtCreateWidget((char *)"mbpingedit_form_filters",
-        xmFormWidgetClass,
-        class_in->mbpingedit_dialogShell_filters,
-        args,
-        ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNscrollingPolicy, XmAUTOMATIC); ac++;
-    XtSetArg(args[ac], XmNx, 0); ac++;
-    XtSetArg(args[ac], XmNy, 0); ac++;
-    XtSetArg(args[ac], XmNwidth, 404); ac++;
-    XtSetArg(args[ac], XmNheight, 301); ac++;
-    class_in->scrolledWindow_filters = XmCreateScrolledWindow(class_in->mbpingedit_form_filters,
-        (char *)"scrolledWindow_filters",
-        args,
-        ac);
-    XtManageChild(class_in->scrolledWindow_filters);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNresizePolicy, XmRESIZE_GROW); ac++;
-    XtSetArg(args[ac], XmNwidth, 375); ac++;
-    XtSetArg(args[ac], XmNheight, 810); ac++;
-    class_in->mbpingedit_bulletinBoard_scrollfilters = XmCreateBulletinBoard(class_in->scrolledWindow_filters,
-        (char *)"mbpingedit_bulletinBoard_scrollfilters",
-        args,
-        ac);
-    XtManageChild(class_in->mbpingedit_bulletinBoard_scrollfilters);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 90); ac++;
-    XtSetArg(args[ac], XmNy, 70); ac++;
-    XtSetArg(args[ac], XmNwidth, 16); ac++;
-    XtSetArg(args[ac], XmNheight, 16); ac++;
-    XtSetArg(args[ac], XmNisHomogeneous, False); ac++;
-    class_in->mbpingedit_radioBox_mediancalc = XmCreateRadioBox(class_in->mbpingedit_bulletinBoard_scrollfilters,
-        (char *)"mbpingedit_radioBox_mediancalc",
-        args,
-        ac);
-    XtManageChild(class_in->mbpingedit_radioBox_mediancalc);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbpingedit_bulletinBoard_scrollfilters, (char *)"Median Alongtrack Dimension",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNtitleString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNminimum, 1); ac++;
-        XtSetArg(args[ac], XmNvalue, 1); ac++;
-        XtSetArg(args[ac], XmNmaximum, 20); ac++;
-        XtSetArg(args[ac], XmNshowArrows, TRUE); ac++;
-        XtSetArg(args[ac], XmNscaleMultiple, 1); ac++;
-        XtSetArg(args[ac], XmNshowValue, TRUE); ac++;
-        XtSetArg(args[ac], XmNorientation, XmHORIZONTAL); ac++;
-        XtSetArg(args[ac], XmNx, 100); ac++;
-        XtSetArg(args[ac], XmNy, 140); ac++;
-        XtSetArg(args[ac], XmNwidth, 260); ac++;
-        XtSetArg(args[ac], XmNheight, 63); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_bulletinBoard_scrollfilters, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbpingedit_scale_median_local_ltrack = XmCreateScale(class_in->mbpingedit_bulletinBoard_scrollfilters,
-            (char *)"mbpingedit_scale_median_local_ltrack",
-            args,
-            ac);
-        XtManageChild(class_in->mbpingedit_scale_median_local_ltrack);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbpingedit_scale_median_local_ltrack, XmNvalueChangedCallback, do_mbpingedit_check_median_ltrack, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbpingedit_bulletinBoard_scrollfilters, (char *)"Median Acrosstrack Dimension",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNtitleString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNminimum, 1); ac++;
-        XtSetArg(args[ac], XmNvalue, 5); ac++;
-        XtSetArg(args[ac], XmNshowArrows, TRUE); ac++;
-        XtSetArg(args[ac], XmNscaleMultiple, 1); ac++;
-        XtSetArg(args[ac], XmNshowValue, TRUE); ac++;
-        XtSetArg(args[ac], XmNorientation, XmHORIZONTAL); ac++;
-        XtSetArg(args[ac], XmNx, 100); ac++;
-        XtSetArg(args[ac], XmNy, 80); ac++;
-        XtSetArg(args[ac], XmNwidth, 260); ac++;
-        XtSetArg(args[ac], XmNheight, 63); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_bulletinBoard_scrollfilters, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbpingedit_scale_median_local_xtrack = XmCreateScale(class_in->mbpingedit_bulletinBoard_scrollfilters,
-            (char *)"mbpingedit_scale_median_local_xtrack",
-            args,
-            ac);
-        XtManageChild(class_in->mbpingedit_scale_median_local_xtrack);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbpingedit_scale_median_local_xtrack, XmNvalueChangedCallback, do_mbpingedit_check_median_xtrack, (XtPointer)0);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 10); ac++;
-    XtSetArg(args[ac], XmNy, 650); ac++;
-    XtSetArg(args[ac], XmNwidth, 350); ac++;
-    XtSetArg(args[ac], XmNheight, 20); ac++;
-    class_in->mbpingedit_separator6 = XmCreateSeparator(class_in->mbpingedit_bulletinBoard_scrollfilters,
-        (char *)"mbpingedit_separator6",
-        args,
-        ac);
-    XtManageChild(class_in->mbpingedit_separator6);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbpingedit_bulletinBoard_scrollfilters, (char *)"End Flagging Angle (deg)",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNtitleString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNdecimalPoints, 2); ac++;
-        XtSetArg(args[ac], XmNvalue, 1000); ac++;
-        XtSetArg(args[ac], XmNmaximum, 10000); ac++;
-        XtSetArg(args[ac], XmNshowArrows, TRUE); ac++;
-        XtSetArg(args[ac], XmNscaleMultiple, 1); ac++;
-        XtSetArg(args[ac], XmNshowValue, TRUE); ac++;
-        XtSetArg(args[ac], XmNorientation, XmHORIZONTAL); ac++;
-        XtSetArg(args[ac], XmNx, 100); ac++;
-        XtSetArg(args[ac], XmNy, 580); ac++;
-        XtSetArg(args[ac], XmNwidth, 260); ac++;
-        XtSetArg(args[ac], XmNheight, 63); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_bulletinBoard_scrollfilters, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbpingedit_scale_filters_cutangleend = XmCreateScale(class_in->mbpingedit_bulletinBoard_scrollfilters,
-            (char *)"mbpingedit_scale_filters_cutangleend",
-            args,
-            ac);
-        XtManageChild(class_in->mbpingedit_scale_filters_cutangleend);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbpingedit_bulletinBoard_scrollfilters, (char *)"Start Flagging Angle (deg)",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNtitleString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNdecimalPoints, 2); ac++;
-        XtSetArg(args[ac], XmNvalue, 1000); ac++;
-        XtSetArg(args[ac], XmNmaximum, 10000); ac++;
-        XtSetArg(args[ac], XmNshowArrows, TRUE); ac++;
-        XtSetArg(args[ac], XmNscaleMultiple, 1); ac++;
-        XtSetArg(args[ac], XmNshowValue, TRUE); ac++;
-        XtSetArg(args[ac], XmNorientation, XmHORIZONTAL); ac++;
-        XtSetArg(args[ac], XmNx, 100); ac++;
-        XtSetArg(args[ac], XmNy, 520); ac++;
-        XtSetArg(args[ac], XmNwidth, 260); ac++;
-        XtSetArg(args[ac], XmNheight, 63); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_bulletinBoard_scrollfilters, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbpingedit_scale_filters_cutanglestart = XmCreateScale(class_in->mbpingedit_bulletinBoard_scrollfilters,
-            (char *)"mbpingedit_scale_filters_cutanglestart",
-            args,
-            ac);
-        XtManageChild(class_in->mbpingedit_scale_filters_cutanglestart);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbpingedit_bulletinBoard_scrollfilters, (char *)":::t\"Flag by\":t\"Beam\"\"Angle\"",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 530); ac++;
-        XtSetArg(args[ac], XmNwidth, 80); ac++;
-        XtSetArg(args[ac], XmNheight, 60); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_bulletinBoard_scrollfilters, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbpingedit_toggleButton_filters_cutangle = XmCreateToggleButton(class_in->mbpingedit_bulletinBoard_scrollfilters,
-            (char *)"mbpingedit_toggleButton_filters_cutangle",
-            args,
-            ac);
-        XtManageChild(class_in->mbpingedit_toggleButton_filters_cutangle);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 10); ac++;
-    XtSetArg(args[ac], XmNy, 500); ac++;
-    XtSetArg(args[ac], XmNwidth, 350); ac++;
-    XtSetArg(args[ac], XmNheight, 20); ac++;
-    class_in->mbpingedit_separator5 = XmCreateSeparator(class_in->mbpingedit_bulletinBoard_scrollfilters,
-        (char *)"mbpingedit_separator5",
-        args,
-        ac);
-    XtManageChild(class_in->mbpingedit_separator5);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbpingedit_bulletinBoard_scrollfilters, (char *)"End Flagging Distance (m)",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNtitleString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNdecimalPoints, 2); ac++;
-        XtSetArg(args[ac], XmNvalue, 1000); ac++;
-        XtSetArg(args[ac], XmNmaximum, 10000); ac++;
-        XtSetArg(args[ac], XmNshowArrows, TRUE); ac++;
-        XtSetArg(args[ac], XmNscaleMultiple, 1); ac++;
-        XtSetArg(args[ac], XmNshowValue, TRUE); ac++;
-        XtSetArg(args[ac], XmNorientation, XmHORIZONTAL); ac++;
-        XtSetArg(args[ac], XmNx, 100); ac++;
-        XtSetArg(args[ac], XmNy, 440); ac++;
-        XtSetArg(args[ac], XmNwidth, 260); ac++;
-        XtSetArg(args[ac], XmNheight, 63); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_bulletinBoard_scrollfilters, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbpingedit_scale_filters_cutdistanceend = XmCreateScale(class_in->mbpingedit_bulletinBoard_scrollfilters,
-            (char *)"mbpingedit_scale_filters_cutdistanceend",
-            args,
-            ac);
-        XtManageChild(class_in->mbpingedit_scale_filters_cutdistanceend);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbpingedit_bulletinBoard_scrollfilters, (char *)"Start Flagging Distance (m)",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNtitleString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNdecimalPoints, 2); ac++;
-        XtSetArg(args[ac], XmNvalue, 1000); ac++;
-        XtSetArg(args[ac], XmNmaximum, 10000); ac++;
-        XtSetArg(args[ac], XmNshowArrows, TRUE); ac++;
-        XtSetArg(args[ac], XmNscaleMultiple, 1); ac++;
-        XtSetArg(args[ac], XmNshowValue, TRUE); ac++;
-        XtSetArg(args[ac], XmNorientation, XmHORIZONTAL); ac++;
-        XtSetArg(args[ac], XmNx, 100); ac++;
-        XtSetArg(args[ac], XmNy, 380); ac++;
-        XtSetArg(args[ac], XmNwidth, 260); ac++;
-        XtSetArg(args[ac], XmNheight, 63); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_bulletinBoard_scrollfilters, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbpingedit_scale_filters_cutdistancestart = XmCreateScale(class_in->mbpingedit_bulletinBoard_scrollfilters,
-            (char *)"mbpingedit_scale_filters_cutdistancestart",
-            args,
-            ac);
-        XtManageChild(class_in->mbpingedit_scale_filters_cutdistancestart);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbpingedit_bulletinBoard_scrollfilters, (char *)":::t\"Flag by\"\"Distance\"",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 390); ac++;
-        XtSetArg(args[ac], XmNwidth, 90); ac++;
-        XtSetArg(args[ac], XmNheight, 40); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_bulletinBoard_scrollfilters, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbpingedit_toggleButton_filters_cutdistance = XmCreateToggleButton(class_in->mbpingedit_bulletinBoard_scrollfilters,
-            (char *)"mbpingedit_toggleButton_filters_cutdistance",
-            args,
-            ac);
-        XtManageChild(class_in->mbpingedit_toggleButton_filters_cutdistance);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 10); ac++;
-    XtSetArg(args[ac], XmNy, 210); ac++;
-    XtSetArg(args[ac], XmNwidth, 350); ac++;
-    XtSetArg(args[ac], XmNheight, 20); ac++;
-    class_in->mbpingedit_separator4 = XmCreateSeparator(class_in->mbpingedit_bulletinBoard_scrollfilters,
-        (char *)"mbpingedit_separator4",
-        args,
-        ac);
-    XtManageChild(class_in->mbpingedit_separator4);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbpingedit_bulletinBoard_scrollfilters, (char *)"End Flagging Beam Number",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNtitleString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNvalue, 10); ac++;
-        XtSetArg(args[ac], XmNmaximum, 100); ac++;
-        XtSetArg(args[ac], XmNshowArrows, TRUE); ac++;
-        XtSetArg(args[ac], XmNshowValue, TRUE); ac++;
-        XtSetArg(args[ac], XmNorientation, XmHORIZONTAL); ac++;
-        XtSetArg(args[ac], XmNx, 100); ac++;
-        XtSetArg(args[ac], XmNy, 290); ac++;
-        XtSetArg(args[ac], XmNwidth, 260); ac++;
-        XtSetArg(args[ac], XmNheight, 63); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_bulletinBoard_scrollfilters, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbpingedit_scale_filters_cutbeamend = XmCreateScale(class_in->mbpingedit_bulletinBoard_scrollfilters,
-            (char *)"mbpingedit_scale_filters_cutbeamend",
-            args,
-            ac);
-        XtManageChild(class_in->mbpingedit_scale_filters_cutbeamend);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbpingedit_bulletinBoard_scrollfilters, (char *)"Start Flagging Beam Number",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNtitleString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNvalue, 10); ac++;
-        XtSetArg(args[ac], XmNmaximum, 100); ac++;
-        XtSetArg(args[ac], XmNshowArrows, TRUE); ac++;
-        XtSetArg(args[ac], XmNshowValue, TRUE); ac++;
-        XtSetArg(args[ac], XmNorientation, XmHORIZONTAL); ac++;
-        XtSetArg(args[ac], XmNx, 100); ac++;
-        XtSetArg(args[ac], XmNy, 230); ac++;
-        XtSetArg(args[ac], XmNwidth, 260); ac++;
-        XtSetArg(args[ac], XmNheight, 63); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_bulletinBoard_scrollfilters, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbpingedit_scale_filters_cutbeamstart = XmCreateScale(class_in->mbpingedit_bulletinBoard_scrollfilters,
-            (char *)"mbpingedit_scale_filters_cutbeamstart",
-            args,
-            ac);
-        XtManageChild(class_in->mbpingedit_scale_filters_cutbeamstart);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbpingedit_bulletinBoard_scrollfilters, (char *)":::t\"Flag by\":t\"Beam\"\"Number\"",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 240); ac++;
-        XtSetArg(args[ac], XmNwidth, 90); ac++;
-        XtSetArg(args[ac], XmNheight, 60); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_bulletinBoard_scrollfilters, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbpingedit_toggleButton_filters_cutbeam = XmCreateToggleButton(class_in->mbpingedit_bulletinBoard_scrollfilters,
-            (char *)"mbpingedit_toggleButton_filters_cutbeam",
-            args,
-            ac);
-        XtManageChild(class_in->mbpingedit_toggleButton_filters_cutbeam);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 10); ac++;
-    XtSetArg(args[ac], XmNy, 360); ac++;
-    XtSetArg(args[ac], XmNwidth, 350); ac++;
-    XtSetArg(args[ac], XmNheight, 20); ac++;
-    class_in->mbpingedit_separator3 = XmCreateSeparator(class_in->mbpingedit_bulletinBoard_scrollfilters,
-        (char *)"mbpingedit_separator3",
-        args,
-        ac);
-    XtManageChild(class_in->mbpingedit_separator3);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbpingedit_bulletinBoard_scrollfilters, (char *)"Beams from Center Threshold",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNtitleString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNvalue, 10); ac++;
-        XtSetArg(args[ac], XmNmaximum, 100); ac++;
-        XtSetArg(args[ac], XmNshowArrows, TRUE); ac++;
-        XtSetArg(args[ac], XmNshowValue, TRUE); ac++;
-        XtSetArg(args[ac], XmNorientation, XmHORIZONTAL); ac++;
-        XtSetArg(args[ac], XmNx, 100); ac++;
-        XtSetArg(args[ac], XmNy, 670); ac++;
-        XtSetArg(args[ac], XmNwidth, 260); ac++;
-        XtSetArg(args[ac], XmNheight, 63); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_bulletinBoard_scrollfilters, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbpingedit_scale_filters_wrongside = XmCreateScale(class_in->mbpingedit_bulletinBoard_scrollfilters,
-            (char *)"mbpingedit_scale_filters_wrongside",
-            args,
-            ac);
-        XtManageChild(class_in->mbpingedit_scale_filters_wrongside);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbpingedit_bulletinBoard_scrollfilters, (char *)":::t\"Wrong\":t\"Side\"\"Filter\"",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 680); ac++;
-        XtSetArg(args[ac], XmNwidth, 90); ac++;
-        XtSetArg(args[ac], XmNheight, 60); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_bulletinBoard_scrollfilters, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbpingedit_toggleButton_filters_wrongside = XmCreateToggleButton(class_in->mbpingedit_bulletinBoard_scrollfilters,
-            (char *)"mbpingedit_toggleButton_filters_wrongside",
-            args,
-            ac);
-        XtManageChild(class_in->mbpingedit_toggleButton_filters_wrongside);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbpingedit_bulletinBoard_scrollfilters, (char *)"% Median Depth Threshold ",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNtitleString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNminimum, 1); ac++;
-        XtSetArg(args[ac], XmNdecimalPoints, 0); ac++;
-        XtSetArg(args[ac], XmNvalue, 10); ac++;
-        XtSetArg(args[ac], XmNshowArrows, TRUE); ac++;
-        XtSetArg(args[ac], XmNshowValue, TRUE); ac++;
-        XtSetArg(args[ac], XmNorientation, XmHORIZONTAL); ac++;
-        XtSetArg(args[ac], XmNx, 100); ac++;
-        XtSetArg(args[ac], XmNy, 10); ac++;
-        XtSetArg(args[ac], XmNwidth, 260); ac++;
-        XtSetArg(args[ac], XmNheight, 63); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_bulletinBoard_scrollfilters, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbpingedit_scale_filters_medianspike = XmCreateScale(class_in->mbpingedit_bulletinBoard_scrollfilters,
-            (char *)"mbpingedit_scale_filters_medianspike",
-            args,
-            ac);
-        XtManageChild(class_in->mbpingedit_scale_filters_medianspike);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbpingedit_bulletinBoard_scrollfilters, (char *)":::t\"Median\":t\"Spike\"\"Filter\"",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNx, 10); ac++;
-        XtSetArg(args[ac], XmNy, 20); ac++;
-        XtSetArg(args[ac], XmNwidth, 90); ac++;
-        XtSetArg(args[ac], XmNheight, 60); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_bulletinBoard_scrollfilters, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbpingedit_toggleButton_filters_medianspike = XmCreateToggleButton(class_in->mbpingedit_bulletinBoard_scrollfilters,
-            (char *)"mbpingedit_toggleButton_filters_medianspike",
-            args,
-            ac);
-        XtManageChild(class_in->mbpingedit_toggleButton_filters_medianspike);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbpingedit_form_filters, (char *)"Reset",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 150); ac++;
-        XtSetArg(args[ac], XmNy, 311); ac++;
-        XtSetArg(args[ac], XmNwidth, 90); ac++;
-        XtSetArg(args[ac], XmNheight, 40); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_form_filters, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbpingedit_pushButton_filters_reset = XmCreatePushButton(class_in->mbpingedit_form_filters,
-            (char *)"mbpingedit_pushButton_filters_reset",
-            args,
-            ac);
-        XtManageChild(class_in->mbpingedit_pushButton_filters_reset);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbpingedit_pushButton_filters_reset, XmNactivateCallback, do_mbpingedit_reset_filters, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbpingedit_form_filters, (char *)"Apply",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 40); ac++;
-        XtSetArg(args[ac], XmNy, 311); ac++;
-        XtSetArg(args[ac], XmNwidth, 90); ac++;
-        XtSetArg(args[ac], XmNheight, 40); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_form_filters, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbpingedit_pushButton_filters_apply = XmCreatePushButton(class_in->mbpingedit_form_filters,
-            (char *)"mbpingedit_pushButton_filters_apply",
-            args,
-            ac);
-        XtManageChild(class_in->mbpingedit_pushButton_filters_apply);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbpingedit_pushButton_filters_apply, XmNactivateCallback, do_mbpingedit_set_filters, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->mbpingedit_form_filters, (char *)"Dismiss",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 260); ac++;
-        XtSetArg(args[ac], XmNy, 311); ac++;
-        XtSetArg(args[ac], XmNwidth, 90); ac++;
-        XtSetArg(args[ac], XmNheight, 40); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->mbpingedit_form_filters, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->mbpingedit_pushButton_filters_dismiss = XmCreatePushButton(class_in->mbpingedit_form_filters,
-            (char *)"mbpingedit_pushButton_filters_dismiss",
-            args,
-            ac);
-        XtManageChild(class_in->mbpingedit_pushButton_filters_dismiss);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->mbpingedit_pushButton_filters_dismiss, XmNactivateCallback, BxUnmanageCB, (XtPointer)"mbpingedit_bulletinBoard_filters");
-    ac = 0;
-    XtSetArg(args[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 0); ac++;
-    XtSetArg(args[ac], XmNrightOffset, -1); ac++;
-    XtSetArg(args[ac], XmNtopOffset, 0); ac++;
-    XtSetValues(class_in->mbpingedit_controls, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNtopAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNbottomAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNbottomOffset, 2); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 0); ac++;
-    XtSetArg(args[ac], XmNrightOffset, 2); ac++;
-    XtSetArg(args[ac], XmNtopOffset, 150); ac++;
-    XtSetValues(class_in->mbpingedit_canvas, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNtopAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNbottomAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNbottomOffset, 60); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 0); ac++;
-    XtSetArg(args[ac], XmNrightOffset, 4); ac++;
-    XtSetArg(args[ac], XmNtopOffset, 0); ac++;
-    XtSetValues(class_in->scrolledWindow_filters, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNtopAttachment, XmATTACH_NONE); ac++;
-    XtSetArg(args[ac], XmNbottomAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNbottomOffset, 10); ac++;
-    XtSetValues(class_in->mbpingedit_pushButton_filters_reset, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNtopAttachment, XmATTACH_NONE); ac++;
-    XtSetArg(args[ac], XmNbottomAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNbottomOffset, 10); ac++;
-    XtSetValues(class_in->mbpingedit_pushButton_filters_apply, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNtopAttachment, XmATTACH_NONE); ac++;
-    XtSetArg(args[ac], XmNbottomAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNbottomOffset, 10); ac++;
-    XtSetValues(class_in->mbpingedit_pushButton_filters_dismiss, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNtopAttachment, XmATTACH_NONE); ac++;
-    XtSetArg(args[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNbottomAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNbottomOffset, 15); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 230); ac++;
-    XtSetArg(args[ac], XmNrightOffset, 217); ac++;
-    XtSetValues(class_in->mbpingedit_pushButton_annotation_dismiss, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 450); ac++;
-    XtSetArg(args[ac], XmNrightOffset, 9); ac++;
-    XtSetArg(args[ac], XmNtopOffset, 50); ac++;
-    XtSetValues(class_in->mbpingedit_slider_y_max_interval_label, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 190); ac++;
-    XtSetArg(args[ac], XmNrightOffset, 64); ac++;
-    XtSetArg(args[ac], XmNtopOffset, 40); ac++;
-    XtSetValues(class_in->mbpingedit_slider_y_interval, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 0); ac++;
-    XtSetArg(args[ac], XmNtopOffset, 50); ac++;
-    XtSetValues(class_in->mbpingedit_slider_y_interval_label, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 450); ac++;
-    XtSetArg(args[ac], XmNrightOffset, 9); ac++;
-    XtSetArg(args[ac], XmNtopOffset, 10); ac++;
-    XtSetValues(class_in->mbpingedit_slider_x_max_interval_label, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 190); ac++;
-    XtSetArg(args[ac], XmNrightOffset, 64); ac++;
-    XtSetArg(args[ac], XmNtopOffset, 0); ac++;
-    XtSetValues(class_in->mbpingedit_slider_x_interval, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 10); ac++;
-    XtSetArg(args[ac], XmNtopOffset, 10); ac++;
-    XtSetValues(class_in->mbpingedit_slider_x_interval_label, args, ac);
-
-
-    /*
-     * Assign functions to class record
-     */
-
-
-    /* Begin user code block <end_MBpeditCreate> */
-    /* End user code block <end_MBpeditCreate> */
-
-    return( class_in );
-}
diff --git a/src/mbview/MBpedit.h b/src/mbview/MBpedit.h
deleted file mode 100644
index 069f289..0000000
--- a/src/mbview/MBpedit.h
+++ /dev/null
@@ -1,159 +0,0 @@
-
-/* Begin user code block <abstract> */
-/* End user code block <abstract> */
-
-/**
- * README: Portions of this file are merged at file generation
- * time. Edits can be made *only* in between specified code blocks, look
- * for keywords <Begin user code> and <End user code>.
- */
-/*
- * Generated by the ICS Builder Xcessory (BX).
- *
- * BuilderXcessory Version 6.1.3
- * Code Generator Xcessory 6.1.3 (08/19/04) CGX Scripts 6.1 Motif 2.1 
- *
- */
-#ifndef MBpedit_H
-#define MBpedit_H
-
-/**
- * Forward declare the class data pointer type so that it can
- * easily be used as a parameter to class functions and data members.
- */
-typedef struct _MBpeditData *MBpeditDataPtr;
-
-/**
- * Globally included information.
- */
-
-
-/**
- * Class specific includes.
- */
-
-
-typedef struct _MBpeditData
-{
-    /*
-     * Classes created by this class.
-     */
-    
-    /*
-     * Widgets created by this class.
-     */
-    Widget MBpedit;
-    Widget mbpingedit_controls;
-    Widget mbpingedit_pushButton_flag_view;
-    Widget mbpingedit_menuBar_view;
-    Widget mbpingedit_cascadeButton_view;
-    Widget mbpingedit_pulldownMenu_view;
-    Widget mbpingedit_toggleButton_view_waterfall;
-    Widget mbpingedit_toggleButton_view_alongtrack;
-    Widget mbpingedit_toggleButton_view_acrosstrack;
-    Widget mbpingedit_separator2;
-    Widget mbpingedit_toggleButton_show_flagged_on;
-    Widget mbpingedit_toggleButton_show_detects;
-    Widget mbpingedit_separator9;
-    Widget mbpingedit_toggleButton_show_wideplot;
-    Widget mbpingedit_toggleButton_show_time;
-    Widget mbpingedit_toggleButton_show_interval;
-    Widget mbpingedit_toggleButton_show_lon;
-    Widget mbpingedit_toggleButton_show_latitude;
-    Widget mbpingedit_toggleButton_show_heading;
-    Widget mbpingedit_toggleButton_show_speed;
-    Widget mbpingedit_toggleButton_show_depth;
-    Widget mbpingedit_toggleButton_show_altitude;
-    Widget mbpingedit_toggleButton_show_sonardepth;
-    Widget mbpingedit_toggleButton_show_roll;
-    Widget mbpingedit_toggleButton_show_pitch;
-    Widget mbpingedit_toggleButton_show_heave;
-    Widget mbpingedit_pushButton_unflag_all;
-    Widget mbpingedit_pushButton_unflag_view;
-    Widget mbpingedit_menuBar_controls;
-    Widget mbpingedit_cascadeButton_controls;
-    Widget mbpingedit_pulldownMenu_controls;
-    Widget mbpingedit_pushButton_goto;
-    Widget mbpingedit_pushButton_buffer;
-    Widget mbpingedit_pushButton_annotation;
-    Widget mbpingedit_pushButton_filters;
-    Widget mbpingedit_separator7;
-    Widget mbpingedit_toggleButton_reverse_keys;
-    Widget mbpingedit_toggleButton_reverse_mouse;
-    Widget mbpingedit_pushButton_next;
-    Widget mbpingedit_pushButton_dismiss;
-    Widget mbpingedit_pushButton_forward;
-    Widget mbpingedit_pushButton_reverse;
-    Widget mbpingedit_slider_mbpingedit_scale_x_label;
-    Widget mbpingedit_slider_mbpingedit_scale_x;
-    Widget mbpingedit_slider_mbpingedit_scale_x_max_label;
-    Widget mbpingedit_slider_mbpingedit_scale_y_label;
-    Widget mbpingedit_slider_mbpingedit_scale_y;
-    Widget mbpingedit_slider_mbpingedit_scale_y_max_label;
-    Widget mbpingedit_slider_number_pings_label;
-    Widget mbpingedit_slider_number_pings;
-    Widget mbpingedit_slider_num_pings_max_label;
-    Widget mbpingedit_slider_number_step_label;
-    Widget mbpingedit_slider_number_step;
-    Widget mbpingedit_slider_number_max_step_label;
-    Widget mbpingedit_setting_mode_label;
-    Widget mbpingedit_setting_mode;
-    Widget mbpingedit_togglebutton_toggle;
-    Widget mbpingedit_togglebutton_pick;
-    Widget mbpingedit_togglebutton_erase;
-    Widget mbpingedit_togglebutton_restore;
-    Widget mbpingedit_togglebutton_grab;
-    Widget mbpingedit_togglebutton_info;
-    Widget mbpingedit_canvas;
-    Widget mbpingedit_dialogShell_filters;
-    Widget mbpingedit_form_filters;
-    Widget scrolledWindow_filters;
-    Widget mbpingedit_bulletinBoard_scrollfilters;
-    Widget mbpingedit_radioBox_mediancalc;
-    Widget mbpingedit_scale_median_local_ltrack;
-    Widget mbpingedit_scale_median_local_xtrack;
-    Widget mbpingedit_separator6;
-    Widget mbpingedit_scale_filters_cutangleend;
-    Widget mbpingedit_scale_filters_cutanglestart;
-    Widget mbpingedit_toggleButton_filters_cutangle;
-    Widget mbpingedit_separator5;
-    Widget mbpingedit_scale_filters_cutdistanceend;
-    Widget mbpingedit_scale_filters_cutdistancestart;
-    Widget mbpingedit_toggleButton_filters_cutdistance;
-    Widget mbpingedit_separator4;
-    Widget mbpingedit_scale_filters_cutbeamend;
-    Widget mbpingedit_scale_filters_cutbeamstart;
-    Widget mbpingedit_toggleButton_filters_cutbeam;
-    Widget mbpingedit_separator3;
-    Widget mbpingedit_scale_filters_wrongside;
-    Widget mbpingedit_toggleButton_filters_wrongside;
-    Widget mbpingedit_scale_filters_medianspike;
-    Widget mbpingedit_toggleButton_filters_medianspike;
-    Widget mbpingedit_pushButton_filters_reset;
-    Widget mbpingedit_pushButton_filters_apply;
-    Widget mbpingedit_pushButton_filters_dismiss;
-    Widget mbpingedit_dialogShell_annotation;
-    Widget mbpingedit_form_annotation;
-    Widget mbpingedit_pushButton_annotation_dismiss;
-    Widget mbpingedit_slider_y_max_interval_label;
-    Widget mbpingedit_slider_y_interval;
-    Widget mbpingedit_slider_y_interval_label;
-    Widget mbpingedit_slider_x_max_interval_label;
-    Widget mbpingedit_slider_x_interval;
-    Widget mbpingedit_slider_x_interval_label;
-    
-    /**
-     * All methods and data..
-     */
-} MBpeditData;
-
-/*
- * Function: MBpeditCreate()
- *		The creation for class MBpedit.
- */
-MBpeditDataPtr MBpeditCreate(MBpeditDataPtr, Widget, String, ArgList, Cardinal);
-
-/**
- * Set routines for exposed resources.
- */
-#endif
diff --git a/src/mbview/Makefile.am b/src/mbview/Makefile.am
deleted file mode 100644
index 4242472..0000000
--- a/src/mbview/Makefile.am
+++ /dev/null
@@ -1,32 +0,0 @@
-lib_LTLIBRARIES = libmbview.la
-
-include_HEADERS = mbview.h
-
-AM_CFLAGS = ${libgmt_CFLAGS} ${libnetcdf_CFLAGS}
-
-AM_CPPFLAGS = -I${top_srcdir}/src/mbio \
-       -I${top_srcdir}/src/mbaux \
-       -I${top_srcdir}/src/mr1pr \
-       -I${top_srcdir}/src/surf \
-       -I${top_srcdir}/src/gsf \
-       ${libgmt_CPPFLAGS} \
-       ${libnetcdf_CPPFLAGS} \
-       ${libmotif_CPPFLAGS} \
-       ${libopengl_CPPFLAGS}
-
-libmbview_la_CFLAGS = -DMBVIEW_LIBRARY
-libmbview_la_LDFLAGS = -no-undefined -version-info 0:0:0
-libmbview_la_SOURCES = \
-       MB3DView.c MB3DSiteList.c MB3DRouteList.c MB3DNavList.c \
-       mbview_callbacks.c mbview_process.c mbview_plot.c mbview_primary.c \
-       mbview_secondary.c mbview_pick.c mbview_profile.c mbview_site.c \
-       mbview_route.c mbview_nav.c mbview_vector.c mbview_bxutils.c mb_glwdrawa.c Mb3dsdg.c \
-       mb3dsoundings_callbacks.c MBpedit.c mbpingedit_callbacks.c
-libmbview_la_LIBADD = \
-       ${top_builddir}/src/bsio/libmbbsio.la \
-       ${top_builddir}/src/surf/libmbsapi.la \
-       ${top_builddir}/src/mbio/libmbio.la \
-       ${top_builddir}/src/mbaux/libmbaux.la \
-       ${libgmt_LIBS} ${libnetcdf_LIBS} ${libproj_LIBS} \
-       ${libmotif_LIBS} ${libopengl_LIBS} \
-       ${XDR_LIB}
diff --git a/src/mbview/Makefile.in b/src/mbview/Makefile.in
deleted file mode 100644
index 7d7d23e..0000000
--- a/src/mbview/Makefile.in
+++ /dev/null
@@ -1,906 +0,0 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
-
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-
-
-VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
-am__make_running_with_option = \
-  case $${target_option-} in \
-      ?) ;; \
-      *) echo "am__make_running_with_option: internal error: invalid" \
-              "target option '$${target_option-}' specified" >&2; \
-         exit 1;; \
-  esac; \
-  has_opt=no; \
-  sane_makeflags=$$MAKEFLAGS; \
-  if $(am__is_gnu_make); then \
-    sane_makeflags=$$MFLAGS; \
-  else \
-    case $$MAKEFLAGS in \
-      *\\[\ \	]*) \
-        bs=\\; \
-        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
-          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
-    esac; \
-  fi; \
-  skip_next=no; \
-  strip_trailopt () \
-  { \
-    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
-  }; \
-  for flg in $$sane_makeflags; do \
-    test $$skip_next = yes && { skip_next=no; continue; }; \
-    case $$flg in \
-      *=*|--*) continue;; \
-        -*I) strip_trailopt 'I'; skip_next=yes;; \
-      -*I?*) strip_trailopt 'I';; \
-        -*O) strip_trailopt 'O'; skip_next=yes;; \
-      -*O?*) strip_trailopt 'O';; \
-        -*l) strip_trailopt 'l'; skip_next=yes;; \
-      -*l?*) strip_trailopt 'l';; \
-      -[dEDm]) skip_next=yes;; \
-      -[JT]) skip_next=yes;; \
-    esac; \
-    case $$flg in \
-      *$$target_option*) has_opt=yes; break;; \
-    esac; \
-  done; \
-  test $$has_opt = yes
-am__make_dryrun = (target_option=n; $(am__make_running_with_option))
-am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-subdir = src/mbview
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/depcomp $(include_HEADERS)
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
-	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
-	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
-	$(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-	$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/src/mbio/mb_config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
-am__vpath_adj = case $$p in \
-    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
-    *) f=$$p;; \
-  esac;
-am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
-am__install_max = 40
-am__nobase_strip_setup = \
-  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
-am__nobase_strip = \
-  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
-am__nobase_list = $(am__nobase_strip_setup); \
-  for p in $$list; do echo "$$p $$p"; done | \
-  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
-  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
-    if (++n[$$2] == $(am__install_max)) \
-      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
-    END { for (dir in files) print dir, files[dir] }'
-am__base_list = \
-  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
-  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
-am__uninstall_files_from_dir = { \
-  test -z "$$files" \
-    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
-    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
-         $(am__cd) "$$dir" && rm -f $$files; }; \
-  }
-am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includedir)"
-LTLIBRARIES = $(lib_LTLIBRARIES)
-am__DEPENDENCIES_1 =
-libmbview_la_DEPENDENCIES = ${top_builddir}/src/bsio/libmbbsio.la \
-	${top_builddir}/src/surf/libmbsapi.la \
-	${top_builddir}/src/mbio/libmbio.la \
-	${top_builddir}/src/mbaux/libmbaux.la $(am__DEPENDENCIES_1) \
-	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
-	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
-	$(am__DEPENDENCIES_1)
-am_libmbview_la_OBJECTS = libmbview_la-MB3DView.lo \
-	libmbview_la-MB3DSiteList.lo libmbview_la-MB3DRouteList.lo \
-	libmbview_la-MB3DNavList.lo libmbview_la-mbview_callbacks.lo \
-	libmbview_la-mbview_process.lo libmbview_la-mbview_plot.lo \
-	libmbview_la-mbview_primary.lo \
-	libmbview_la-mbview_secondary.lo libmbview_la-mbview_pick.lo \
-	libmbview_la-mbview_profile.lo libmbview_la-mbview_site.lo \
-	libmbview_la-mbview_route.lo libmbview_la-mbview_nav.lo \
-	libmbview_la-mbview_vector.lo libmbview_la-mbview_bxutils.lo \
-	libmbview_la-mb_glwdrawa.lo libmbview_la-Mb3dsdg.lo \
-	libmbview_la-mb3dsoundings_callbacks.lo \
-	libmbview_la-MBpedit.lo libmbview_la-mbpingedit_callbacks.lo
-libmbview_la_OBJECTS = $(am_libmbview_la_OBJECTS)
-AM_V_lt = $(am__v_lt_ at AM_V@)
-am__v_lt_ = $(am__v_lt_ at AM_DEFAULT_V@)
-am__v_lt_0 = --silent
-am__v_lt_1 = 
-libmbview_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
-	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(libmbview_la_CFLAGS) \
-	$(CFLAGS) $(libmbview_la_LDFLAGS) $(LDFLAGS) -o $@
-AM_V_P = $(am__v_P_ at AM_V@)
-am__v_P_ = $(am__v_P_ at AM_DEFAULT_V@)
-am__v_P_0 = false
-am__v_P_1 = :
-AM_V_GEN = $(am__v_GEN_ at AM_V@)
-am__v_GEN_ = $(am__v_GEN_ at AM_DEFAULT_V@)
-am__v_GEN_0 = @echo "  GEN     " $@;
-am__v_GEN_1 = 
-AM_V_at = $(am__v_at_ at AM_V@)
-am__v_at_ = $(am__v_at_ at AM_DEFAULT_V@)
-am__v_at_0 = @
-am__v_at_1 = 
-DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)/src/mbio
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
-am__mv = mv -f
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
-	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
-	$(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
-	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
-	$(AM_CFLAGS) $(CFLAGS)
-AM_V_CC = $(am__v_CC_ at AM_V@)
-am__v_CC_ = $(am__v_CC_ at AM_DEFAULT_V@)
-am__v_CC_0 = @echo "  CC      " $@;
-am__v_CC_1 = 
-CCLD = $(CC)
-LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
-	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
-	$(AM_LDFLAGS) $(LDFLAGS) -o $@
-AM_V_CCLD = $(am__v_CCLD_ at AM_V@)
-am__v_CCLD_ = $(am__v_CCLD_ at AM_DEFAULT_V@)
-am__v_CCLD_0 = @echo "  CCLD    " $@;
-am__v_CCLD_1 = 
-SOURCES = $(libmbview_la_SOURCES)
-DIST_SOURCES = $(libmbview_la_SOURCES)
-am__can_run_installinfo = \
-  case $$AM_UPDATE_INFO_DIR in \
-    n|no|NO) false;; \
-    *) (install-info --version) >/dev/null 2>&1;; \
-  esac
-HEADERS = $(include_HEADERS)
-am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
-# Read a list of newline-separated strings from the standard input,
-# and print each of them once, without duplicates.  Input order is
-# *not* preserved.
-am__uniquify_input = $(AWK) '\
-  BEGIN { nonempty = 0; } \
-  { items[$$0] = 1; nonempty = 1; } \
-  END { if (nonempty) { for (i in items) print i; }; } \
-'
-# Make sure the list of sources is unique.  This is necessary because,
-# e.g., the same source file might be shared among _SOURCES variables
-# for different programs/libraries.
-am__define_uniq_tagged_files = \
-  list='$(am__tagged_files)'; \
-  unique=`for i in $$list; do \
-    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-  done | $(am__uniquify_input)`
-ETAGS = etags
-CTAGS = ctags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-CC = @CC@
-CCAS = @CCAS@
-CCASDEPMODE = @CCASDEPMODE@
-CCASFLAGS = @CCASFLAGS@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DLLTOOL = @DLLTOOL@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GREP = @GREP@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBM = @LIBM@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIBTOOL_DEPS = @LIBTOOL_DEPS@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LTLIBOBJS = @LTLIBOBJS@
-LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
-MAINT = @MAINT@
-MAKEINFO = @MAKEINFO@
-MANIFEST_TOOL = @MANIFEST_TOOL@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-OTPS_DIR = @OTPS_DIR@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_URL = @PACKAGE_URL@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PKG_CONFIG = @PKG_CONFIG@
-PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
-PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-VERSION = @VERSION@
-XDR_LIB = @XDR_LIB@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_AR = @ac_ct_AR@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-fftw_app = @fftw_app@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libGLU_CFLAGS = @libGLU_CFLAGS@
-libGLU_LIBS = @libGLU_LIBS@
-libXm_CFLAGS = @libXm_CFLAGS@
-libXm_LIBS = @libXm_LIBS@
-libdir = @libdir@
-libexecdir = @libexecdir@
-libfftw3_CFLAGS = @libfftw3_CFLAGS@
-libfftw3_LIBS = @libfftw3_LIBS@
-libfftw_CPPFLAGS = @libfftw_CPPFLAGS@
-libfftw_LIBS = @libfftw_LIBS@
-libgmt_CFLAGS = @libgmt_CFLAGS@
-libgmt_CPPFLAGS = @libgmt_CPPFLAGS@
-libgmt_LIBS = @libgmt_LIBS@
-libmotif_CPPFLAGS = @libmotif_CPPFLAGS@
-libmotif_LIBS = @libmotif_LIBS@
-libnetcdf_CFLAGS = @libnetcdf_CFLAGS@
-libnetcdf_CPPFLAGS = @libnetcdf_CPPFLAGS@
-libnetcdf_LIBS = @libnetcdf_LIBS@
-libopengl_CPPFLAGS = @libopengl_CPPFLAGS@
-libopengl_LIBS = @libopengl_LIBS@
-libproj_CFLAGS = @libproj_CFLAGS@
-libproj_CPPFLAGS = @libproj_CPPFLAGS@
-libproj_LIBS = @libproj_LIBS@
-libpsl_CFLAGS = @libpsl_CFLAGS@
-libpsl_LIBS = @libpsl_LIBS@
-localedir = @localedir@
-localstatedir = @localstatedir@
-mandir = @mandir@
-mbsystemdatadir = @mbsystemdatadir@
-mbsystemhtmldir = @mbsystemhtmldir@
-mbsystempsdir = @mbsystempsdir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-lib_LTLIBRARIES = libmbview.la
-include_HEADERS = mbview.h
-AM_CFLAGS = ${libgmt_CFLAGS} ${libnetcdf_CFLAGS}
-AM_CPPFLAGS = -I${top_srcdir}/src/mbio \
-       -I${top_srcdir}/src/mbaux \
-       -I${top_srcdir}/src/mr1pr \
-       -I${top_srcdir}/src/surf \
-       -I${top_srcdir}/src/gsf \
-       ${libgmt_CPPFLAGS} \
-       ${libnetcdf_CPPFLAGS} \
-       ${libmotif_CPPFLAGS} \
-       ${libopengl_CPPFLAGS}
-
-libmbview_la_CFLAGS = -DMBVIEW_LIBRARY
-libmbview_la_LDFLAGS = -no-undefined -version-info 0:0:0
-libmbview_la_SOURCES = \
-       MB3DView.c MB3DSiteList.c MB3DRouteList.c MB3DNavList.c \
-       mbview_callbacks.c mbview_process.c mbview_plot.c mbview_primary.c \
-       mbview_secondary.c mbview_pick.c mbview_profile.c mbview_site.c \
-       mbview_route.c mbview_nav.c mbview_vector.c mbview_bxutils.c mb_glwdrawa.c Mb3dsdg.c \
-       mb3dsoundings_callbacks.c MBpedit.c mbpingedit_callbacks.c
-
-libmbview_la_LIBADD = \
-       ${top_builddir}/src/bsio/libmbbsio.la \
-       ${top_builddir}/src/surf/libmbsapi.la \
-       ${top_builddir}/src/mbio/libmbio.la \
-       ${top_builddir}/src/mbaux/libmbaux.la \
-       ${libgmt_LIBS} ${libnetcdf_LIBS} ${libproj_LIBS} \
-       ${libmotif_LIBS} ${libopengl_LIBS} \
-       ${XDR_LIB}
-
-all: all-am
-
-.SUFFIXES:
-.SUFFIXES: .c .lo .o .obj
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
-	@for dep in $?; do \
-	  case '$(am__configure_deps)' in \
-	    *$$dep*) \
-	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-	        && { if test -f $@; then exit 0; else break; fi; }; \
-	      exit 1;; \
-	  esac; \
-	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/mbview/Makefile'; \
-	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --gnu src/mbview/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	@case '$?' in \
-	  *config.status*) \
-	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-	esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-
-install-libLTLIBRARIES: $(lib_LTLIBRARIES)
-	@$(NORMAL_INSTALL)
-	@list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
-	list2=; for p in $$list; do \
-	  if test -f $$p; then \
-	    list2="$$list2 $$p"; \
-	  else :; fi; \
-	done; \
-	test -z "$$list2" || { \
-	  echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \
-	  $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \
-	}
-
-uninstall-libLTLIBRARIES:
-	@$(NORMAL_UNINSTALL)
-	@list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
-	for p in $$list; do \
-	  $(am__strip_dir) \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \
-	done
-
-clean-libLTLIBRARIES:
-	-test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
-	@list='$(lib_LTLIBRARIES)'; \
-	locs=`for p in $$list; do echo $$p; done | \
-	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
-	      sort -u`; \
-	test -z "$$locs" || { \
-	  echo rm -f $${locs}; \
-	  rm -f $${locs}; \
-	}
-
-libmbview.la: $(libmbview_la_OBJECTS) $(libmbview_la_DEPENDENCIES) $(EXTRA_libmbview_la_DEPENDENCIES) 
-	$(AM_V_CCLD)$(libmbview_la_LINK) -rpath $(libdir) $(libmbview_la_OBJECTS) $(libmbview_la_LIBADD) $(LIBS)
-
-mostlyclean-compile:
-	-rm -f *.$(OBJEXT)
-
-distclean-compile:
-	-rm -f *.tab.c
-
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libmbview_la-MB3DNavList.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libmbview_la-MB3DRouteList.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libmbview_la-MB3DSiteList.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libmbview_la-MB3DView.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libmbview_la-MBpedit.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libmbview_la-Mb3dsdg.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libmbview_la-mb3dsoundings_callbacks.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libmbview_la-mb_glwdrawa.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libmbview_la-mbpingedit_callbacks.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libmbview_la-mbview_bxutils.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libmbview_la-mbview_callbacks.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libmbview_la-mbview_nav.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libmbview_la-mbview_pick.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libmbview_la-mbview_plot.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libmbview_la-mbview_primary.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libmbview_la-mbview_process.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libmbview_la-mbview_profile.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libmbview_la-mbview_route.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libmbview_la-mbview_secondary.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libmbview_la-mbview_site.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libmbview_la-mbview_vector.Plo at am__quote@
-
-.c.o:
- at am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(COMPILE) -c -o $@ $<
-
-.c.obj:
- at am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
- at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-
-.c.lo:
- at am__fastdepCC_TRUE@	$(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(LTCOMPILE) -c -o $@ $<
-
-libmbview_la-MB3DView.lo: MB3DView.c
- at am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmbview_la_CFLAGS) $(CFLAGS) -MT libmbview_la-MB3DView.lo -MD -MP -MF $(DEPDIR)/libmbview_la-MB3DView.Tpo -c -o libmbview_la-MB3DView.lo `test -f 'MB3DView.c' || echo '$(srcdir)/'`MB3DView.c
- at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libmbview_la-MB3DView.Tpo $(DEPDIR)/libmbview_la-MB3DView.Plo
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='MB3DView.c' object='libmbview_la-MB3DView.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmbview_la_CFLAGS) $(CFLAGS) -c -o libmbview_la-MB3DView.lo `test -f 'MB3DView.c' || echo '$(srcdir)/'`MB3DView.c
-
-libmbview_la-MB3DSiteList.lo: MB3DSiteList.c
- at am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmbview_la_CFLAGS) $(CFLAGS) -MT libmbview_la-MB3DSiteList.lo -MD -MP -MF $(DEPDIR)/libmbview_la-MB3DSiteList.Tpo -c -o libmbview_la-MB3DSiteList.lo `test -f 'MB3DSiteList.c' || echo '$(srcdir)/'`MB3DSiteList.c
- at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libmbview_la-MB3DSiteList.Tpo $(DEPDIR)/libmbview_la-MB3DSiteList.Plo
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='MB3DSiteList.c' object='libmbview_la-MB3DSiteList.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmbview_la_CFLAGS) $(CFLAGS) -c -o libmbview_la-MB3DSiteList.lo `test -f 'MB3DSiteList.c' || echo '$(srcdir)/'`MB3DSiteList.c
-
-libmbview_la-MB3DRouteList.lo: MB3DRouteList.c
- at am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmbview_la_CFLAGS) $(CFLAGS) -MT libmbview_la-MB3DRouteList.lo -MD -MP -MF $(DEPDIR)/libmbview_la-MB3DRouteList.Tpo -c -o libmbview_la-MB3DRouteList.lo `test -f 'MB3DRouteList.c' || echo '$(srcdir)/'`MB3DRouteList.c
- at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libmbview_la-MB3DRouteList.Tpo $(DEPDIR)/libmbview_la-MB3DRouteList.Plo
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='MB3DRouteList.c' object='libmbview_la-MB3DRouteList.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmbview_la_CFLAGS) $(CFLAGS) -c -o libmbview_la-MB3DRouteList.lo `test -f 'MB3DRouteList.c' || echo '$(srcdir)/'`MB3DRouteList.c
-
-libmbview_la-MB3DNavList.lo: MB3DNavList.c
- at am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmbview_la_CFLAGS) $(CFLAGS) -MT libmbview_la-MB3DNavList.lo -MD -MP -MF $(DEPDIR)/libmbview_la-MB3DNavList.Tpo -c -o libmbview_la-MB3DNavList.lo `test -f 'MB3DNavList.c' || echo '$(srcdir)/'`MB3DNavList.c
- at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libmbview_la-MB3DNavList.Tpo $(DEPDIR)/libmbview_la-MB3DNavList.Plo
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='MB3DNavList.c' object='libmbview_la-MB3DNavList.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmbview_la_CFLAGS) $(CFLAGS) -c -o libmbview_la-MB3DNavList.lo `test -f 'MB3DNavList.c' || echo '$(srcdir)/'`MB3DNavList.c
-
-libmbview_la-mbview_callbacks.lo: mbview_callbacks.c
- at am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmbview_la_CFLAGS) $(CFLAGS) -MT libmbview_la-mbview_callbacks.lo -MD -MP -MF $(DEPDIR)/libmbview_la-mbview_callbacks.Tpo -c -o libmbview_la-mbview_callbacks.lo `test -f 'mbview_callbacks.c' || echo '$(srcdir)/'`mbview_callbacks.c
- at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libmbview_la-mbview_callbacks.Tpo $(DEPDIR)/libmbview_la-mbview_callbacks.Plo
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='mbview_callbacks.c' object='libmbview_la-mbview_callbacks.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmbview_la_CFLAGS) $(CFLAGS) -c -o libmbview_la-mbview_callbacks.lo `test -f 'mbview_callbacks.c' || echo '$(srcdir)/'`mbview_callbacks.c
-
-libmbview_la-mbview_process.lo: mbview_process.c
- at am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmbview_la_CFLAGS) $(CFLAGS) -MT libmbview_la-mbview_process.lo -MD -MP -MF $(DEPDIR)/libmbview_la-mbview_process.Tpo -c -o libmbview_la-mbview_process.lo `test -f 'mbview_process.c' || echo '$(srcdir)/'`mbview_process.c
- at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libmbview_la-mbview_process.Tpo $(DEPDIR)/libmbview_la-mbview_process.Plo
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='mbview_process.c' object='libmbview_la-mbview_process.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmbview_la_CFLAGS) $(CFLAGS) -c -o libmbview_la-mbview_process.lo `test -f 'mbview_process.c' || echo '$(srcdir)/'`mbview_process.c
-
-libmbview_la-mbview_plot.lo: mbview_plot.c
- at am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmbview_la_CFLAGS) $(CFLAGS) -MT libmbview_la-mbview_plot.lo -MD -MP -MF $(DEPDIR)/libmbview_la-mbview_plot.Tpo -c -o libmbview_la-mbview_plot.lo `test -f 'mbview_plot.c' || echo '$(srcdir)/'`mbview_plot.c
- at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libmbview_la-mbview_plot.Tpo $(DEPDIR)/libmbview_la-mbview_plot.Plo
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='mbview_plot.c' object='libmbview_la-mbview_plot.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmbview_la_CFLAGS) $(CFLAGS) -c -o libmbview_la-mbview_plot.lo `test -f 'mbview_plot.c' || echo '$(srcdir)/'`mbview_plot.c
-
-libmbview_la-mbview_primary.lo: mbview_primary.c
- at am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmbview_la_CFLAGS) $(CFLAGS) -MT libmbview_la-mbview_primary.lo -MD -MP -MF $(DEPDIR)/libmbview_la-mbview_primary.Tpo -c -o libmbview_la-mbview_primary.lo `test -f 'mbview_primary.c' || echo '$(srcdir)/'`mbview_primary.c
- at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libmbview_la-mbview_primary.Tpo $(DEPDIR)/libmbview_la-mbview_primary.Plo
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='mbview_primary.c' object='libmbview_la-mbview_primary.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmbview_la_CFLAGS) $(CFLAGS) -c -o libmbview_la-mbview_primary.lo `test -f 'mbview_primary.c' || echo '$(srcdir)/'`mbview_primary.c
-
-libmbview_la-mbview_secondary.lo: mbview_secondary.c
- at am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmbview_la_CFLAGS) $(CFLAGS) -MT libmbview_la-mbview_secondary.lo -MD -MP -MF $(DEPDIR)/libmbview_la-mbview_secondary.Tpo -c -o libmbview_la-mbview_secondary.lo `test -f 'mbview_secondary.c' || echo '$(srcdir)/'`mbview_secondary.c
- at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libmbview_la-mbview_secondary.Tpo $(DEPDIR)/libmbview_la-mbview_secondary.Plo
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='mbview_secondary.c' object='libmbview_la-mbview_secondary.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmbview_la_CFLAGS) $(CFLAGS) -c -o libmbview_la-mbview_secondary.lo `test -f 'mbview_secondary.c' || echo '$(srcdir)/'`mbview_secondary.c
-
-libmbview_la-mbview_pick.lo: mbview_pick.c
- at am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmbview_la_CFLAGS) $(CFLAGS) -MT libmbview_la-mbview_pick.lo -MD -MP -MF $(DEPDIR)/libmbview_la-mbview_pick.Tpo -c -o libmbview_la-mbview_pick.lo `test -f 'mbview_pick.c' || echo '$(srcdir)/'`mbview_pick.c
- at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libmbview_la-mbview_pick.Tpo $(DEPDIR)/libmbview_la-mbview_pick.Plo
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='mbview_pick.c' object='libmbview_la-mbview_pick.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmbview_la_CFLAGS) $(CFLAGS) -c -o libmbview_la-mbview_pick.lo `test -f 'mbview_pick.c' || echo '$(srcdir)/'`mbview_pick.c
-
-libmbview_la-mbview_profile.lo: mbview_profile.c
- at am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmbview_la_CFLAGS) $(CFLAGS) -MT libmbview_la-mbview_profile.lo -MD -MP -MF $(DEPDIR)/libmbview_la-mbview_profile.Tpo -c -o libmbview_la-mbview_profile.lo `test -f 'mbview_profile.c' || echo '$(srcdir)/'`mbview_profile.c
- at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libmbview_la-mbview_profile.Tpo $(DEPDIR)/libmbview_la-mbview_profile.Plo
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='mbview_profile.c' object='libmbview_la-mbview_profile.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmbview_la_CFLAGS) $(CFLAGS) -c -o libmbview_la-mbview_profile.lo `test -f 'mbview_profile.c' || echo '$(srcdir)/'`mbview_profile.c
-
-libmbview_la-mbview_site.lo: mbview_site.c
- at am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmbview_la_CFLAGS) $(CFLAGS) -MT libmbview_la-mbview_site.lo -MD -MP -MF $(DEPDIR)/libmbview_la-mbview_site.Tpo -c -o libmbview_la-mbview_site.lo `test -f 'mbview_site.c' || echo '$(srcdir)/'`mbview_site.c
- at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libmbview_la-mbview_site.Tpo $(DEPDIR)/libmbview_la-mbview_site.Plo
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='mbview_site.c' object='libmbview_la-mbview_site.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmbview_la_CFLAGS) $(CFLAGS) -c -o libmbview_la-mbview_site.lo `test -f 'mbview_site.c' || echo '$(srcdir)/'`mbview_site.c
-
-libmbview_la-mbview_route.lo: mbview_route.c
- at am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmbview_la_CFLAGS) $(CFLAGS) -MT libmbview_la-mbview_route.lo -MD -MP -MF $(DEPDIR)/libmbview_la-mbview_route.Tpo -c -o libmbview_la-mbview_route.lo `test -f 'mbview_route.c' || echo '$(srcdir)/'`mbview_route.c
- at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libmbview_la-mbview_route.Tpo $(DEPDIR)/libmbview_la-mbview_route.Plo
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='mbview_route.c' object='libmbview_la-mbview_route.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmbview_la_CFLAGS) $(CFLAGS) -c -o libmbview_la-mbview_route.lo `test -f 'mbview_route.c' || echo '$(srcdir)/'`mbview_route.c
-
-libmbview_la-mbview_nav.lo: mbview_nav.c
- at am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmbview_la_CFLAGS) $(CFLAGS) -MT libmbview_la-mbview_nav.lo -MD -MP -MF $(DEPDIR)/libmbview_la-mbview_nav.Tpo -c -o libmbview_la-mbview_nav.lo `test -f 'mbview_nav.c' || echo '$(srcdir)/'`mbview_nav.c
- at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libmbview_la-mbview_nav.Tpo $(DEPDIR)/libmbview_la-mbview_nav.Plo
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='mbview_nav.c' object='libmbview_la-mbview_nav.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmbview_la_CFLAGS) $(CFLAGS) -c -o libmbview_la-mbview_nav.lo `test -f 'mbview_nav.c' || echo '$(srcdir)/'`mbview_nav.c
-
-libmbview_la-mbview_vector.lo: mbview_vector.c
- at am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmbview_la_CFLAGS) $(CFLAGS) -MT libmbview_la-mbview_vector.lo -MD -MP -MF $(DEPDIR)/libmbview_la-mbview_vector.Tpo -c -o libmbview_la-mbview_vector.lo `test -f 'mbview_vector.c' || echo '$(srcdir)/'`mbview_vector.c
- at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libmbview_la-mbview_vector.Tpo $(DEPDIR)/libmbview_la-mbview_vector.Plo
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='mbview_vector.c' object='libmbview_la-mbview_vector.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmbview_la_CFLAGS) $(CFLAGS) -c -o libmbview_la-mbview_vector.lo `test -f 'mbview_vector.c' || echo '$(srcdir)/'`mbview_vector.c
-
-libmbview_la-mbview_bxutils.lo: mbview_bxutils.c
- at am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmbview_la_CFLAGS) $(CFLAGS) -MT libmbview_la-mbview_bxutils.lo -MD -MP -MF $(DEPDIR)/libmbview_la-mbview_bxutils.Tpo -c -o libmbview_la-mbview_bxutils.lo `test -f 'mbview_bxutils.c' || echo '$(srcdir)/'`mbview_bxutils.c
- at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libmbview_la-mbview_bxutils.Tpo $(DEPDIR)/libmbview_la-mbview_bxutils.Plo
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='mbview_bxutils.c' object='libmbview_la-mbview_bxutils.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmbview_la_CFLAGS) $(CFLAGS) -c -o libmbview_la-mbview_bxutils.lo `test -f 'mbview_bxutils.c' || echo '$(srcdir)/'`mbview_bxutils.c
-
-libmbview_la-mb_glwdrawa.lo: mb_glwdrawa.c
- at am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmbview_la_CFLAGS) $(CFLAGS) -MT libmbview_la-mb_glwdrawa.lo -MD -MP -MF $(DEPDIR)/libmbview_la-mb_glwdrawa.Tpo -c -o libmbview_la-mb_glwdrawa.lo `test -f 'mb_glwdrawa.c' || echo '$(srcdir)/'`mb_glwdrawa.c
- at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libmbview_la-mb_glwdrawa.Tpo $(DEPDIR)/libmbview_la-mb_glwdrawa.Plo
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='mb_glwdrawa.c' object='libmbview_la-mb_glwdrawa.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmbview_la_CFLAGS) $(CFLAGS) -c -o libmbview_la-mb_glwdrawa.lo `test -f 'mb_glwdrawa.c' || echo '$(srcdir)/'`mb_glwdrawa.c
-
-libmbview_la-Mb3dsdg.lo: Mb3dsdg.c
- at am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmbview_la_CFLAGS) $(CFLAGS) -MT libmbview_la-Mb3dsdg.lo -MD -MP -MF $(DEPDIR)/libmbview_la-Mb3dsdg.Tpo -c -o libmbview_la-Mb3dsdg.lo `test -f 'Mb3dsdg.c' || echo '$(srcdir)/'`Mb3dsdg.c
- at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libmbview_la-Mb3dsdg.Tpo $(DEPDIR)/libmbview_la-Mb3dsdg.Plo
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='Mb3dsdg.c' object='libmbview_la-Mb3dsdg.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmbview_la_CFLAGS) $(CFLAGS) -c -o libmbview_la-Mb3dsdg.lo `test -f 'Mb3dsdg.c' || echo '$(srcdir)/'`Mb3dsdg.c
-
-libmbview_la-mb3dsoundings_callbacks.lo: mb3dsoundings_callbacks.c
- at am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmbview_la_CFLAGS) $(CFLAGS) -MT libmbview_la-mb3dsoundings_callbacks.lo -MD -MP -MF $(DEPDIR)/libmbview_la-mb3dsoundings_callbacks.Tpo -c -o libmbview_la-mb3dsoundings_callbacks.lo `test -f 'mb3dsoundings_callbacks.c' || echo '$(srcdir)/'`mb3dsoundings_callbacks.c
- at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libmbview_la-mb3dsoundings_callbacks.Tpo $(DEPDIR)/libmbview_la-mb3dsoundings_callbacks.Plo
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='mb3dsoundings_callbacks.c' object='libmbview_la-mb3dsoundings_callbacks.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmbview_la_CFLAGS) $(CFLAGS) -c -o libmbview_la-mb3dsoundings_callbacks.lo `test -f 'mb3dsoundings_callbacks.c' || echo '$(srcdir)/'`mb3dsoundings_callbacks.c
-
-libmbview_la-MBpedit.lo: MBpedit.c
- at am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmbview_la_CFLAGS) $(CFLAGS) -MT libmbview_la-MBpedit.lo -MD -MP -MF $(DEPDIR)/libmbview_la-MBpedit.Tpo -c -o libmbview_la-MBpedit.lo `test -f 'MBpedit.c' || echo '$(srcdir)/'`MBpedit.c
- at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libmbview_la-MBpedit.Tpo $(DEPDIR)/libmbview_la-MBpedit.Plo
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='MBpedit.c' object='libmbview_la-MBpedit.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmbview_la_CFLAGS) $(CFLAGS) -c -o libmbview_la-MBpedit.lo `test -f 'MBpedit.c' || echo '$(srcdir)/'`MBpedit.c
-
-libmbview_la-mbpingedit_callbacks.lo: mbpingedit_callbacks.c
- at am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmbview_la_CFLAGS) $(CFLAGS) -MT libmbview_la-mbpingedit_callbacks.lo -MD -MP -MF $(DEPDIR)/libmbview_la-mbpingedit_callbacks.Tpo -c -o libmbview_la-mbpingedit_callbacks.lo `test -f 'mbpingedit_callbacks.c' || echo '$(srcdir)/'`mbpingedit_callbacks.c
- at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libmbview_la-mbpingedit_callbacks.Tpo $(DEPDIR)/libmbview_la-mbpingedit_callbacks.Plo
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='mbpingedit_callbacks.c' object='libmbview_la-mbpingedit_callbacks.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmbview_la_CFLAGS) $(CFLAGS) -c -o libmbview_la-mbpingedit_callbacks.lo `test -f 'mbpingedit_callbacks.c' || echo '$(srcdir)/'`mbpingedit_callbacks.c
-
-mostlyclean-libtool:
-	-rm -f *.lo
-
-clean-libtool:
-	-rm -rf .libs _libs
-install-includeHEADERS: $(include_HEADERS)
-	@$(NORMAL_INSTALL)
-	@list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \
-	if test -n "$$list"; then \
-	  echo " $(MKDIR_P) '$(DESTDIR)$(includedir)'"; \
-	  $(MKDIR_P) "$(DESTDIR)$(includedir)" || exit 1; \
-	fi; \
-	for p in $$list; do \
-	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
-	  echo "$$d$$p"; \
-	done | $(am__base_list) | \
-	while read files; do \
-	  echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includedir)'"; \
-	  $(INSTALL_HEADER) $$files "$(DESTDIR)$(includedir)" || exit $$?; \
-	done
-
-uninstall-includeHEADERS:
-	@$(NORMAL_UNINSTALL)
-	@list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \
-	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
-	dir='$(DESTDIR)$(includedir)'; $(am__uninstall_files_from_dir)
-
-ID: $(am__tagged_files)
-	$(am__define_uniq_tagged_files); mkid -fID $$unique
-tags: tags-am
-TAGS: tags
-
-tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
-	set x; \
-	here=`pwd`; \
-	$(am__define_uniq_tagged_files); \
-	shift; \
-	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
-	  test -n "$$unique" || unique=$$empty_fix; \
-	  if test $$# -gt 0; then \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      "$$@" $$unique; \
-	  else \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      $$unique; \
-	  fi; \
-	fi
-ctags: ctags-am
-
-CTAGS: ctags
-ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
-	$(am__define_uniq_tagged_files); \
-	test -z "$(CTAGS_ARGS)$$unique" \
-	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$unique
-
-GTAGS:
-	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && $(am__cd) $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) "$$here"
-cscopelist: cscopelist-am
-
-cscopelist-am: $(am__tagged_files)
-	list='$(am__tagged_files)'; \
-	case "$(srcdir)" in \
-	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
-	  *) sdir=$(subdir)/$(srcdir) ;; \
-	esac; \
-	for i in $$list; do \
-	  if test -f "$$i"; then \
-	    echo "$(subdir)/$$i"; \
-	  else \
-	    echo "$$sdir/$$i"; \
-	  fi; \
-	done >> $(top_builddir)/cscope.files
-
-distclean-tags:
-	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	list='$(DISTFILES)'; \
-	  dist_files=`for file in $$list; do echo $$file; done | \
-	  sed -e "s|^$$srcdirstrip/||;t" \
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
-	case $$dist_files in \
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
-			   sort -u` ;; \
-	esac; \
-	for file in $$dist_files; do \
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  if test -d $$d/$$file; then \
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
-	    if test -d "$(distdir)/$$file"; then \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
-	  else \
-	    test -f "$(distdir)/$$file" \
-	    || cp -p $$d/$$file "$(distdir)/$$file" \
-	    || exit 1; \
-	  fi; \
-	done
-check-am: all-am
-check: check-am
-all-am: Makefile $(LTLIBRARIES) $(HEADERS)
-installdirs:
-	for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includedir)"; do \
-	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
-	done
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
-	if test -z '$(STRIP)'; then \
-	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	      install; \
-	else \
-	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
-	fi
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
-	@echo "This command is intended for maintainers to use"
-	@echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \
-	mostlyclean-am
-
-distclean: distclean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
-	distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am: install-includeHEADERS
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am: install-libLTLIBRARIES
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic \
-	mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am: uninstall-includeHEADERS uninstall-libLTLIBRARIES
-
-.MAKE: install-am install-strip
-
-.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
-	clean-libLTLIBRARIES clean-libtool cscopelist-am ctags \
-	ctags-am distclean distclean-compile distclean-generic \
-	distclean-libtool distclean-tags distdir dvi dvi-am html \
-	html-am info info-am install install-am install-data \
-	install-data-am install-dvi install-dvi-am install-exec \
-	install-exec-am install-html install-html-am \
-	install-includeHEADERS install-info install-info-am \
-	install-libLTLIBRARIES install-man install-pdf install-pdf-am \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-compile \
-	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-	tags tags-am uninstall uninstall-am uninstall-includeHEADERS \
-	uninstall-libLTLIBRARIES
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/mbview/Mb3dsdg.c b/src/mbview/Mb3dsdg.c
deleted file mode 100644
index f2e6acc..0000000
--- a/src/mbview/Mb3dsdg.c
+++ /dev/null
@@ -1,1357 +0,0 @@
-
-/* Begin user code block <abstract> */
-/* End user code block <abstract> */
-
-/**
- * README: Portions of this file are merged at file generation
- * time. Edits can be made *only* in between specified code blocks, look
- * for keywords <Begin user code> and <End user code>.
- */
-/*
- * Generated by the ICS Builder Xcessory (BX).
- *
- * BuilderXcessory Version 6.1.3
- * Code Generator Xcessory 6.1.3 (08/19/04) CGX Scripts 6.1 Motif 2.1
- *
- */
-
-/* Begin user code block <file_comments> */
-
-#ifndef SANS
-#define SANS "helvetica"
-#endif
-#ifndef SERIF
-#define SERIF "times"
-#endif
-#ifndef MONO
-#define MONO "courier"
-#endif
-
-/* End user code block <file_comments> */
-
-#include <Xm/Xm.h>
-#include <Xm/Form.h>
-#include <Xm/PushB.h>
-#include <Xm/Scale.h>
-#include <Xm/ToggleB.h>
-#include <Xm/Label.h>
-#include <Xm/RowColumn.h>
-#include <Xm/CascadeB.h>
-#include <Xm/Separator.h>
-#include <Xm/DrawingA.h>
-#include <Xm/Form.h>
-#include <Xm/PushB.h>
-#include <Xm/Scale.h>
-#include <Xm/ToggleB.h>
-#include <Xm/Label.h>
-#include <Xm/RowColumn.h>
-#include <Xm/CascadeB.h>
-#include <Xm/Separator.h>
-#include <Xm/DrawingA.h>
-#include "Mb3dsdg.h"
-
-/**
- * Common constant and pixmap declarations.
- */
-#include "mb3dsoundings_creation.h"
-
-/**
- * Convenience functions from utilities file.
- */
-extern void RegisterBxConverters(XtAppContext);
-extern XtPointer BX_CONVERT(Widget, char *, char *, int, Boolean *);
-extern XtPointer BX_DOUBLE(double);
-extern XtPointer BX_SINGLE(float);
-extern void BX_MENU_POST(Widget, XtPointer, XEvent *, Boolean *);
-extern Pixmap XPM_PIXMAP(Widget, char **);
-extern void BX_SET_BACKGROUND_COLOR(Widget, ArgList, Cardinal *, Pixel);
-
-/**
- * Declarations for callbacks and handlers.
- */
-extern void do_mb3dsdg_resetview(Widget, XtPointer, XtPointer);
-extern void do_mb3dsdg_timelag(Widget, XtPointer, XtPointer);
-extern void do_mb3dsdg_mouse_panzoom(Widget, XtPointer, XtPointer);
-extern void do_mb3dsdg_mouse_rotate(Widget, XtPointer, XtPointer);
-extern void do_mb3dsdg_headingbias(Widget, XtPointer, XtPointer);
-extern void do_mb3dsdg_pitchbias(Widget, XtPointer, XtPointer);
-extern void do_mb3dsdg_rollbias(Widget, XtPointer, XtPointer);
-extern void do_mb3dsdg_input(Widget, XtPointer, XtPointer);
-extern void do_mb3dsdg_view_boundingbox(Widget, XtPointer, XtPointer);
-extern void do_mb3dsdg_view_flagged(Widget, XtPointer, XtPointer);
-extern void do_mb3dsdg_view_noprofile(Widget, XtPointer, XtPointer);
-extern void do_mb3dsdg_view_goodprofile(Widget, XtPointer, XtPointer);
-extern void do_mb3dsdg_view_allprofile(Widget, XtPointer, XtPointer);
-extern void do_mb3dsdg_view_scalewithflagged(Widget, XtPointer, XtPointer);
-extern void do_mb3dsdg_action_applybias(Widget, XtPointer, XtPointer);
-extern void do_mb3dsdg_action_colorsoundingsblack(Widget, XtPointer, XtPointer);
-extern void do_mb3dsdg_action_colorsoundingsred(Widget, XtPointer, XtPointer);
-extern void do_mb3dsdg_action_colorsoundingsyellow(Widget, XtPointer, XtPointer);
-extern void do_mb3dsdg_action_colorsoundingsgreen(Widget, XtPointer, XtPointer);
-extern void do_mb3dsdg_action_colorsoundingsbluegreen(Widget, XtPointer, XtPointer);
-extern void do_mb3dsdg_action_colorsoundingsblue(Widget, XtPointer, XtPointer);
-extern void do_mb3dsdg_action_colorsoundingspurple(Widget, XtPointer, XtPointer);
-extern void do_mb3dsdg_dismiss(Widget, XtPointer, XtPointer);
-extern void do_mb3dsdg_mouse_toggle(Widget, XtPointer, XtPointer);
-extern void do_mb3dsdg_mouse_pick(Widget, XtPointer, XtPointer);
-extern void do_mb3dsdg_mouse_erase(Widget, XtPointer, XtPointer);
-extern void do_mb3dsdg_mouse_restore(Widget, XtPointer, XtPointer);
-extern void do_mb3dsdg_mouse_grab(Widget, XtPointer, XtPointer);
-extern void do_mb3dsdg_mouse_info(Widget, XtPointer, XtPointer);
-
-/*
- * This table is used to define class resources that are placed
- * in app-defaults. This table is necessary so each instance
- * of this class has the proper default resource values set.
- * This eliminates the need for each instance to have
- * its own app-defaults values. This table must be NULL terminated.
- */
-typedef struct _UIAppDefault {
-    char*      cName;       /* Class name */
-    char*      wName;       /* Widget name */
-    char*      cInstName;   /* Name of class instance (nested class) */
-    char*      wRsc;        /* Widget resource */
-    char*      value;       /* value read from app-defaults */
-} UIAppDefault;
-
-static Boolean doInitAppDefaults = True;
-static UIAppDefault  appDefaults[] = {
-    {NULL, NULL, NULL, NULL, NULL}
-};
-/*
- * The functions to call in the apputils.c
- */
-extern void InitAppDefaults(Widget, UIAppDefault*);
-extern void SetAppDefaults(Widget, UIAppDefault*, char*, Boolean);
-
-Mb3dsdgDataPtr
-Mb3dsdgCreate ( Mb3dsdgDataPtr class_in, Widget parent, String name, ArgList args_in, Cardinal ac_in)
-{
-    Cardinal ac = 0;
-    Arg      args[256];
-    Boolean  argok = False;
-
-    /**
-     * Register the converters for the widgets.
-     */
-    RegisterBxConverters(XtWidgetToApplicationContext(parent));
-    XtInitializeWidgetClass((WidgetClass)xmFormWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmPushButtonWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmScaleWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmToggleButtonWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmLabelWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmRowColumnWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmCascadeButtonWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmRowColumnWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmSeparatorWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmDrawingAreaWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmRowColumnWidgetClass);
-    /**
-     * Setup app-defaults fallback table if not already done.
-     */
-    if (doInitAppDefaults)
-    {
-        InitAppDefaults(parent, appDefaults);
-        doInitAppDefaults = False;
-    }
-    /**
-     * Now set the app-defaults for this instance.
-     */
-    SetAppDefaults(parent, appDefaults, name, False);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(parent, (char *)"3D Soundings",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNdialogTitle, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNresizePolicy, XmRESIZE_GROW); ac++;
-        XtSetArg(args[ac], XmNx, 671); ac++;
-        XtSetArg(args[ac], XmNy, 275); ac++;
-        XtSetArg(args[ac], XmNwidth, 987); ac++;
-        XtSetArg(args[ac], XmNheight, 584); ac++;
-        XtSetArg(args[ac], XmNdeleteResponse, XmDO_NOTHING); ac++;
-        class_in->Mb3dsdg = XmCreateForm(parent,
-            (char *)name,
-            args,
-            ac);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->Mb3dsdg, (char *)"Reset View",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 810); ac++;
-        XtSetArg(args[ac], XmNy, 10); ac++;
-        XtSetArg(args[ac], XmNwidth, 170); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->Mb3dsdg, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->pushButton_reset = XmCreatePushButton(class_in->Mb3dsdg,
-            (char *)"pushButton_reset",
-            args,
-            ac);
-        XtManageChild(class_in->pushButton_reset);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->pushButton_reset, XmNactivateCallback, do_mb3dsdg_resetview, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->Mb3dsdg, (char *)"Time Lag (seconds)",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNtitleString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNminimum, -100); ac++;
-        XtSetArg(args[ac], XmNdecimalPoints, 2); ac++;
-        XtSetArg(args[ac], XmNshowArrows, TRUE); ac++;
-        XtSetArg(args[ac], XmNscaleMultiple, 1); ac++;
-        XtSetArg(args[ac], XmNshowValue, TRUE); ac++;
-        XtSetArg(args[ac], XmNorientation, XmHORIZONTAL); ac++;
-        XtSetArg(args[ac], XmNx, 630); ac++;
-        XtSetArg(args[ac], XmNy, 70); ac++;
-        XtSetArg(args[ac], XmNwidth, 170); ac++;
-        XtSetArg(args[ac], XmNheight, 63); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->Mb3dsdg, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->scale_timelag = XmCreateScale(class_in->Mb3dsdg,
-            (char *)"scale_timelag",
-            args,
-            ac);
-        XtManageChild(class_in->scale_timelag);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->scale_timelag, XmNvalueChangedCallback, do_mb3dsdg_timelag, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->Mb3dsdg, (char *)"Pan and Zoom",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 650); ac++;
-        XtSetArg(args[ac], XmNy, 40); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->Mb3dsdg, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->toggleButton_mouse_panzoom1 = XmCreateToggleButton(class_in->Mb3dsdg,
-            (char *)"toggleButton_mouse_panzoom1",
-            args,
-            ac);
-        XtManageChild(class_in->toggleButton_mouse_panzoom1);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->toggleButton_mouse_panzoom1, XmNvalueChangedCallback, do_mb3dsdg_mouse_panzoom, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->Mb3dsdg, (char *)"Rotate Soundings",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 650); ac++;
-        XtSetArg(args[ac], XmNy, 10); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->Mb3dsdg, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->toggleButton_mouse_rotate1 = XmCreateToggleButton(class_in->Mb3dsdg,
-            (char *)"toggleButton_mouse_rotate1",
-            args,
-            ac);
-        XtManageChild(class_in->toggleButton_mouse_rotate1);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->toggleButton_mouse_rotate1, XmNvalueChangedCallback, do_mb3dsdg_mouse_rotate, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->Mb3dsdg, (char *)":::t\"Mouse Mode:\":t\"L: Edit (Toggle)\":t\"M: Rotate Soundings\"\"R: Exageration\"",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNborderWidth, 1); ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNbackground,
-            BX_CONVERT(class_in->Mb3dsdg, (char *)"white",
-            XmRPixel, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNrecomputeSize, False); ac++;
-        XtSetArg(args[ac], XmNx, 810); ac++;
-        XtSetArg(args[ac], XmNy, 50); ac++;
-        XtSetArg(args[ac], XmNwidth, 170); ac++;
-        XtSetArg(args[ac], XmNheight, 80); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->Mb3dsdg, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->label_mousemode = XmCreateLabel(class_in->Mb3dsdg,
-            (char *)"label_mousemode",
-            args,
-            ac);
-        XtManageChild(class_in->label_mousemode);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->Mb3dsdg, (char *)"Heading Bias (degrees)",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNtitleString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNminimum, -100); ac++;
-        XtSetArg(args[ac], XmNdecimalPoints, 2); ac++;
-        XtSetArg(args[ac], XmNshowArrows, TRUE); ac++;
-        XtSetArg(args[ac], XmNscaleMultiple, 1); ac++;
-        XtSetArg(args[ac], XmNshowValue, TRUE); ac++;
-        XtSetArg(args[ac], XmNorientation, XmHORIZONTAL); ac++;
-        XtSetArg(args[ac], XmNx, 460); ac++;
-        XtSetArg(args[ac], XmNy, 70); ac++;
-        XtSetArg(args[ac], XmNwidth, 165); ac++;
-        XtSetArg(args[ac], XmNheight, 63); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->Mb3dsdg, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->scale_headingbias = XmCreateScale(class_in->Mb3dsdg,
-            (char *)"scale_headingbias",
-            args,
-            ac);
-        XtManageChild(class_in->scale_headingbias);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->scale_headingbias, XmNvalueChangedCallback, do_mb3dsdg_headingbias, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->Mb3dsdg, (char *)"Pitch Bias (degrees)",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNtitleString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNminimum, -100); ac++;
-        XtSetArg(args[ac], XmNdecimalPoints, 2); ac++;
-        XtSetArg(args[ac], XmNshowArrows, TRUE); ac++;
-        XtSetArg(args[ac], XmNscaleMultiple, 1); ac++;
-        XtSetArg(args[ac], XmNshowValue, TRUE); ac++;
-        XtSetArg(args[ac], XmNorientation, XmHORIZONTAL); ac++;
-        XtSetArg(args[ac], XmNx, 270); ac++;
-        XtSetArg(args[ac], XmNy, 70); ac++;
-        XtSetArg(args[ac], XmNwidth, 190); ac++;
-        XtSetArg(args[ac], XmNheight, 63); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->Mb3dsdg, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->scale_pitchbias = XmCreateScale(class_in->Mb3dsdg,
-            (char *)"scale_pitchbias",
-            args,
-            ac);
-        XtManageChild(class_in->scale_pitchbias);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->scale_pitchbias, XmNvalueChangedCallback, do_mb3dsdg_pitchbias, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->Mb3dsdg, (char *)"Roll Bias (degrees)",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNtitleString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNminimum, -100); ac++;
-        XtSetArg(args[ac], XmNdecimalPoints, 2); ac++;
-        XtSetArg(args[ac], XmNshowArrows, TRUE); ac++;
-        XtSetArg(args[ac], XmNscaleMultiple, 1); ac++;
-        XtSetArg(args[ac], XmNshowValue, TRUE); ac++;
-        XtSetArg(args[ac], XmNorientation, XmHORIZONTAL); ac++;
-        XtSetArg(args[ac], XmNx, 100); ac++;
-        XtSetArg(args[ac], XmNy, 70); ac++;
-        XtSetArg(args[ac], XmNwidth, 170); ac++;
-        XtSetArg(args[ac], XmNheight, 63); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->Mb3dsdg, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->scale_rollbias = XmCreateScale(class_in->Mb3dsdg,
-            (char *)"scale_rollbias",
-            args,
-            ac);
-        XtManageChild(class_in->scale_rollbias);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->scale_rollbias, XmNvalueChangedCallback, do_mb3dsdg_rollbias, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->Mb3dsdg, (char *)"Azimuth: 0.00 | Elevation: 0.00 | Vert. Exager.: 1.00",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNborderWidth, 1); ac++;
-        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-        XtSetArg(args[ac], XmNbackground,
-            BX_CONVERT(class_in->Mb3dsdg, (char *)"white",
-            XmRPixel, 0, &argok)); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 100); ac++;
-        XtSetArg(args[ac], XmNy, 10); ac++;
-        XtSetArg(args[ac], XmNwidth, 540); ac++;
-        XtSetArg(args[ac], XmNheight, 30); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->Mb3dsdg, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->label_status = XmCreateLabel(class_in->Mb3dsdg,
-            (char *)"label_status",
-            args,
-            ac);
-        XtManageChild(class_in->label_status);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNorientation, XmVERTICAL); ac++;
-    XtSetArg(args[ac], XmNx, 10); ac++;
-    XtSetArg(args[ac], XmNy, 10); ac++;
-    XtSetArg(args[ac], XmNwidth, 81); ac++;
-    XtSetArg(args[ac], XmNheight, 106); ac++;
-    class_in->menuBar = XmCreateMenuBar(class_in->Mb3dsdg,
-        (char *)"menuBar",
-        args,
-        ac);
-    XtManageChild(class_in->menuBar);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->menuBar, (char *)"View",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 5); ac++;
-        XtSetArg(args[ac], XmNy, 5); ac++;
-        XtSetArg(args[ac], XmNwidth, 71); ac++;
-        XtSetArg(args[ac], XmNheight, 24); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->menuBar, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->cascadeButton_view = XmCreateCascadeButton(class_in->menuBar,
-            (char *)"cascadeButton_view",
-            args,
-            ac);
-        XtManageChild(class_in->cascadeButton_view);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 0); ac++;
-    XtSetArg(args[ac], XmNy, 0); ac++;
-    XtSetArg(args[ac], XmNwidth, 236); ac++;
-    XtSetArg(args[ac], XmNheight, 154); ac++;
-    class_in->pulldownMenu_view = XmCreatePulldownMenu(XtParent(class_in->cascadeButton_view),
-        (char *)"pulldownMenu_view",
-        args,
-        ac);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->pulldownMenu_view, (char *)"Show Bounding Box",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->toggleButton_view_boundingbox = XmCreateToggleButton(class_in->pulldownMenu_view,
-            (char *)"toggleButton_view_boundingbox",
-            args,
-            ac);
-        XtManageChild(class_in->toggleButton_view_boundingbox);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->toggleButton_view_boundingbox, XmNvalueChangedCallback, do_mb3dsdg_view_boundingbox, (XtPointer)0);
-
-    ac = 0;
-    class_in->separator1 = XmCreateSeparator(class_in->pulldownMenu_view,
-        (char *)"separator1",
-        args,
-        ac);
-    XtManageChild(class_in->separator1);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->pulldownMenu_view, (char *)"Show Flagged Soundings",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->toggleButton_view_flagged = XmCreateToggleButton(class_in->pulldownMenu_view,
-            (char *)"toggleButton_view_flagged",
-            args,
-            ac);
-        XtManageChild(class_in->toggleButton_view_flagged);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->toggleButton_view_flagged, XmNvalueChangedCallback, do_mb3dsdg_view_flagged, (XtPointer)0);
-
-    ac = 0;
-    class_in->separator = XmCreateSeparator(class_in->pulldownMenu_view,
-        (char *)"separator",
-        args,
-        ac);
-    XtManageChild(class_in->separator);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->pulldownMenu_view, (char *)"Show No Profiles",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->toggleButton_view_noconnect = XmCreateToggleButton(class_in->pulldownMenu_view,
-            (char *)"toggleButton_view_noconnect",
-            args,
-            ac);
-        XtManageChild(class_in->toggleButton_view_noconnect);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->toggleButton_view_noconnect, XmNvalueChangedCallback, do_mb3dsdg_view_noprofile, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->pulldownMenu_view, (char *)"Show Good Profiles",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->toggleButton_view_connectgood = XmCreateToggleButton(class_in->pulldownMenu_view,
-            (char *)"toggleButton_view_connectgood",
-            args,
-            ac);
-        XtManageChild(class_in->toggleButton_view_connectgood);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->toggleButton_view_connectgood, XmNvalueChangedCallback, do_mb3dsdg_view_goodprofile, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->pulldownMenu_view, (char *)"Show All Profiles",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->toggleButton_view_connectall = XmCreateToggleButton(class_in->pulldownMenu_view,
-            (char *)"toggleButton_view_connectall",
-            args,
-            ac);
-        XtManageChild(class_in->toggleButton_view_connectall);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->toggleButton_view_connectall, XmNvalueChangedCallback, do_mb3dsdg_view_allprofile, (XtPointer)0);
-
-    ac = 0;
-    class_in->separator2 = XmCreateSeparator(class_in->pulldownMenu_view,
-        (char *)"separator2",
-        args,
-        ac);
-    XtManageChild(class_in->separator2);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->pulldownMenu_view, (char *)"Scale with Flagged Soundings",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->pulldownMenu_view, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->toggleButton_view_scalewithflagged = XmCreateToggleButton(class_in->pulldownMenu_view,
-            (char *)"toggleButton_view_scalewithflagged",
-            args,
-            ac);
-        XtManageChild(class_in->toggleButton_view_scalewithflagged);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->toggleButton_view_scalewithflagged, XmNvalueChangedCallback, do_mb3dsdg_view_scalewithflagged, (XtPointer)0);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNsubMenuId, class_in->pulldownMenu_view); ac++;
-    XtSetValues(class_in->cascadeButton_view, args, ac);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->menuBar, (char *)"Mouse",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 5); ac++;
-        XtSetArg(args[ac], XmNy, 29); ac++;
-        XtSetArg(args[ac], XmNwidth, 71); ac++;
-        XtSetArg(args[ac], XmNheight, 24); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->menuBar, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->cascadeButton_mouse = XmCreateCascadeButton(class_in->menuBar,
-            (char *)"cascadeButton_mouse",
-            args,
-            ac);
-        XtManageChild(class_in->cascadeButton_mouse);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 0); ac++;
-    XtSetArg(args[ac], XmNy, 0); ac++;
-    XtSetArg(args[ac], XmNwidth, 152); ac++;
-    XtSetArg(args[ac], XmNheight, 52); ac++;
-    class_in->pulldownMenu_mouse = XmCreatePulldownMenu(XtParent(class_in->cascadeButton_mouse),
-        (char *)"pulldownMenu_mouse",
-        args,
-        ac);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->pulldownMenu_mouse, (char *)"Rotate Soundings",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->pulldownMenu_mouse, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->toggleButton_mouse_rotate = XmCreateToggleButton(class_in->pulldownMenu_mouse,
-            (char *)"toggleButton_mouse_rotate",
-            args,
-            ac);
-        XtManageChild(class_in->toggleButton_mouse_rotate);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->toggleButton_mouse_rotate, XmNvalueChangedCallback, do_mb3dsdg_mouse_rotate, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->pulldownMenu_mouse, (char *)"Pan and Zoom",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->pulldownMenu_mouse, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->toggleButton_mouse_panzoom = XmCreateToggleButton(class_in->pulldownMenu_mouse,
-            (char *)"toggleButton_mouse_panzoom",
-            args,
-            ac);
-        XtManageChild(class_in->toggleButton_mouse_panzoom);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->toggleButton_mouse_panzoom, XmNvalueChangedCallback, do_mb3dsdg_mouse_panzoom, (XtPointer)0);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNsubMenuId, class_in->pulldownMenu_mouse); ac++;
-    XtSetValues(class_in->cascadeButton_mouse, args, ac);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->menuBar, (char *)"Action",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 5); ac++;
-        XtSetArg(args[ac], XmNy, 53); ac++;
-        XtSetArg(args[ac], XmNwidth, 71); ac++;
-        XtSetArg(args[ac], XmNheight, 24); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->menuBar, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->cascadeButton_action = XmCreateCascadeButton(class_in->menuBar,
-            (char *)"cascadeButton_action",
-            args,
-            ac);
-        XtManageChild(class_in->cascadeButton_action);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 0); ac++;
-    XtSetArg(args[ac], XmNy, 0); ac++;
-    XtSetArg(args[ac], XmNwidth, 189); ac++;
-    XtSetArg(args[ac], XmNheight, 28); ac++;
-    class_in->pulldownMenu_action = XmCreatePulldownMenu(XtParent(class_in->cascadeButton_action),
-        (char *)"pulldownMenu_action",
-        args,
-        ac);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->pulldownMenu_action, (char *)"Apply Bias Values to Grid",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->pulldownMenu_action, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->pushButton_action_applybias = XmCreatePushButton(class_in->pulldownMenu_action,
-            (char *)"pushButton_action_applybias",
-            args,
-            ac);
-        XtManageChild(class_in->pushButton_action_applybias);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->pushButton_action_applybias, XmNactivateCallback, do_mb3dsdg_action_applybias, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->pulldownMenu_action, (char *)"Color Unflagged Soundings Black",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->pulldownMenu_action, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->pushButton_action_colorsoundingsblack = XmCreatePushButton(class_in->pulldownMenu_action,
-            (char *)"pushButton_action_colorsoundingsblack",
-            args,
-            ac);
-        XtManageChild(class_in->pushButton_action_colorsoundingsblack);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->pushButton_action_colorsoundingsblack, XmNactivateCallback, do_mb3dsdg_action_colorsoundingsblack, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->pulldownMenu_action, (char *)"Color Unflagged Soundings Red",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->pulldownMenu_action, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->pushButton_action_colorsoundingsred = XmCreatePushButton(class_in->pulldownMenu_action,
-            (char *)"pushButton_action_colorsoundingsred",
-            args,
-            ac);
-        XtManageChild(class_in->pushButton_action_colorsoundingsred);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->pushButton_action_colorsoundingsred, XmNactivateCallback, do_mb3dsdg_action_colorsoundingsred, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->pulldownMenu_action, (char *)"Color Unflagged Soundings Yellow",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->pulldownMenu_action, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->pushButton_action_colorsoundingsyellow = XmCreatePushButton(class_in->pulldownMenu_action,
-            (char *)"pushButton_action_colorsoundingsyellow",
-            args,
-            ac);
-        XtManageChild(class_in->pushButton_action_colorsoundingsyellow);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->pushButton_action_colorsoundingsyellow, XmNactivateCallback, do_mb3dsdg_action_colorsoundingsyellow, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->pulldownMenu_action, (char *)"Color Unflagged Soundings Green",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->pulldownMenu_action, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->pushButton_action_colorsoundingsgreen = XmCreatePushButton(class_in->pulldownMenu_action,
-            (char *)"pushButton_action_colorsoundingsgreen",
-            args,
-            ac);
-        XtManageChild(class_in->pushButton_action_colorsoundingsgreen);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->pushButton_action_colorsoundingsgreen, XmNactivateCallback, do_mb3dsdg_action_colorsoundingsgreen, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->pulldownMenu_action, (char *)"Color Unflagged Soundings Bluegreen",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->pulldownMenu_action, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->pushButton_action_colorsoundingsbluegreen = XmCreatePushButton(class_in->pulldownMenu_action,
-            (char *)"pushButton_action_colorsoundingsbluegreen",
-            args,
-            ac);
-        XtManageChild(class_in->pushButton_action_colorsoundingsbluegreen);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->pushButton_action_colorsoundingsbluegreen, XmNactivateCallback, do_mb3dsdg_action_colorsoundingsbluegreen, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->pulldownMenu_action, (char *)"Color Unflagged Soundings Blue",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->pulldownMenu_action, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->pushButton_action_colorsoundingsblue = XmCreatePushButton(class_in->pulldownMenu_action,
-            (char *)"pushButton_action_colorsoundingsblue",
-            args,
-            ac);
-        XtManageChild(class_in->pushButton_action_colorsoundingsblue);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->pushButton_action_colorsoundingsblue, XmNactivateCallback, do_mb3dsdg_action_colorsoundingsblue, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->pulldownMenu_action, (char *)"Color Unflagged Soundings Purple",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->pulldownMenu_action, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->pushButton_action_colorsoundingspurple = XmCreatePushButton(class_in->pulldownMenu_action,
-            (char *)"pushButton_action_colorsoundingspurple",
-            args,
-            ac);
-        XtManageChild(class_in->pushButton_action_colorsoundingspurple);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->pushButton_action_colorsoundingspurple, XmNactivateCallback, do_mb3dsdg_action_colorsoundingspurple, (XtPointer)0);
-    
-    ac = 0;
-    XtSetArg(args[ac], XmNsubMenuId, class_in->pulldownMenu_action); ac++;
-    XtSetValues(class_in->cascadeButton_action, args, ac);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->menuBar, (char *)"Dismiss",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNx, 5); ac++;
-        XtSetArg(args[ac], XmNy, 77); ac++;
-        XtSetArg(args[ac], XmNwidth, 71); ac++;
-        XtSetArg(args[ac], XmNheight, 24); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->menuBar, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->cascadeButton_dismiss = XmCreateCascadeButton(class_in->menuBar,
-            (char *)"cascadeButton_dismiss",
-            args,
-            ac);
-        XtManageChild(class_in->cascadeButton_dismiss);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 0); ac++;
-    XtSetArg(args[ac], XmNy, 0); ac++;
-    XtSetArg(args[ac], XmNwidth, 67); ac++;
-    XtSetArg(args[ac], XmNheight, 28); ac++;
-    class_in->pulldownMenu_dismiss = XmCreatePulldownMenu(XtParent(class_in->cascadeButton_dismiss),
-        (char *)"pulldownMenu_dismiss",
-        args,
-        ac);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->pulldownMenu_dismiss, (char *)"Dismiss",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->pulldownMenu_dismiss, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->pushButton_dismiss = XmCreatePushButton(class_in->pulldownMenu_dismiss,
-            (char *)"pushButton_dismiss",
-            args,
-            ac);
-        XtManageChild(class_in->pushButton_dismiss);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->pushButton_dismiss, XmNactivateCallback, do_mb3dsdg_dismiss, (XtPointer)0);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNsubMenuId, class_in->pulldownMenu_dismiss); ac++;
-    XtSetValues(class_in->cascadeButton_dismiss, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNborderWidth, 1); ac++;
-    XtSetArg(args[ac], XmNbackground,
-        BX_CONVERT(class_in->Mb3dsdg, (char *)"white",
-        XmRPixel, 0, &argok)); if (argok) ac++;
-    XtSetArg(args[ac], XmNborderColor,
-        BX_CONVERT(class_in->Mb3dsdg, (char *)"black",
-        XmRPixel, 0, &argok)); if (argok) ac++;
-    XtSetArg(args[ac], XmNx, 10); ac++;
-    XtSetArg(args[ac], XmNy, 140); ac++;
-    XtSetArg(args[ac], XmNwidth, 970); ac++;
-    XtSetArg(args[ac], XmNheight, 435); ac++;
-    class_in->drawingArea = XmCreateDrawingArea(class_in->Mb3dsdg,
-        (char *)"drawingArea",
-        args,
-        ac);
-    XtManageChild(class_in->drawingArea);
-    XtAddCallback(class_in->drawingArea, XmNinputCallback, do_mb3dsdg_input, (XtPointer)0);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNorientation, XmHORIZONTAL); ac++;
-    XtSetArg(args[ac], XmNx, 100); ac++;
-    XtSetArg(args[ac], XmNy, 40); ac++;
-    XtSetArg(args[ac], XmNwidth, 519); ac++;
-    XtSetArg(args[ac], XmNheight, 34); ac++;
-    XtSetArg(args[ac], XmNisHomogeneous, False); ac++;
-    class_in->radioBox_soundingsmode = XmCreateRadioBox(class_in->Mb3dsdg,
-        (char *)"radioBox_soundingsmode",
-        args,
-        ac);
-    XtManageChild(class_in->radioBox_soundingsmode);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->radioBox_soundingsmode, (char *)"Toggle",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNwidth, 83); ac++;
-        XtSetArg(args[ac], XmNheight, 28); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->radioBox_soundingsmode, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->toggleButton_mouse_toggle = XmCreateToggleButton(class_in->radioBox_soundingsmode,
-            (char *)"toggleButton_mouse_toggle",
-            args,
-            ac);
-        XtManageChild(class_in->toggleButton_mouse_toggle);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->toggleButton_mouse_toggle, XmNvalueChangedCallback, do_mb3dsdg_mouse_toggle, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->radioBox_soundingsmode, (char *)"Pick",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNwidth, 83); ac++;
-        XtSetArg(args[ac], XmNheight, 28); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->radioBox_soundingsmode, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->toggleButton_mouse_pick = XmCreateToggleButton(class_in->radioBox_soundingsmode,
-            (char *)"toggleButton_mouse_pick",
-            args,
-            ac);
-        XtManageChild(class_in->toggleButton_mouse_pick);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->toggleButton_mouse_pick, XmNvalueChangedCallback, do_mb3dsdg_mouse_pick, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->radioBox_soundingsmode, (char *)"Erase",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNwidth, 83); ac++;
-        XtSetArg(args[ac], XmNheight, 28); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->radioBox_soundingsmode, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->toggleButton_mouse_erase = XmCreateToggleButton(class_in->radioBox_soundingsmode,
-            (char *)"toggleButton_mouse_erase",
-            args,
-            ac);
-        XtManageChild(class_in->toggleButton_mouse_erase);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->toggleButton_mouse_erase, XmNvalueChangedCallback, do_mb3dsdg_mouse_erase, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->radioBox_soundingsmode, (char *)"Restore",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNwidth, 83); ac++;
-        XtSetArg(args[ac], XmNheight, 28); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->radioBox_soundingsmode, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->toggleButton_mouse_restore = XmCreateToggleButton(class_in->radioBox_soundingsmode,
-            (char *)"toggleButton_mouse_restore",
-            args,
-            ac);
-        XtManageChild(class_in->toggleButton_mouse_restore);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->toggleButton_mouse_restore, XmNvalueChangedCallback, do_mb3dsdg_mouse_restore, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->radioBox_soundingsmode, (char *)"Grab",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNwidth, 83); ac++;
-        XtSetArg(args[ac], XmNheight, 28); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->radioBox_soundingsmode, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->toggleButton_mouse_grab = XmCreateToggleButton(class_in->radioBox_soundingsmode,
-            (char *)"toggleButton_mouse_grab",
-            args,
-            ac);
-        XtManageChild(class_in->toggleButton_mouse_grab);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->toggleButton_mouse_grab, XmNvalueChangedCallback, do_mb3dsdg_mouse_grab, (XtPointer)0);
-
-    ac = 0;
-    {
-        XmString    tmp0;
-
-        tmp0 = (XmString) BX_CONVERT(class_in->radioBox_soundingsmode, (char *)"Info",
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNwidth, 83); ac++;
-        XtSetArg(args[ac], XmNheight, 28); ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(class_in->radioBox_soundingsmode, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-        class_in->toggleButton_mouse_info = XmCreateToggleButton(class_in->radioBox_soundingsmode,
-            (char *)"toggleButton_mouse_info",
-            args,
-            ac);
-        XtManageChild(class_in->toggleButton_mouse_info);
-
-        /**
-         * Free any memory allocated for resources.
-         */
-        XmStringFree((XmString)tmp0);
-    }
-
-    XtAddCallback(class_in->toggleButton_mouse_info, XmNvalueChangedCallback, do_mb3dsdg_mouse_info, (XtPointer)0);
-    ac = 0;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 810); ac++;
-    XtSetArg(args[ac], XmNtopOffset, 10); ac++;
-    XtSetValues(class_in->pushButton_reset, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 630); ac++;
-    XtSetArg(args[ac], XmNtopOffset, 70); ac++;
-    XtSetValues(class_in->scale_timelag, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 650); ac++;
-    XtSetArg(args[ac], XmNtopOffset, 40); ac++;
-    XtSetValues(class_in->toggleButton_mouse_panzoom1, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNtopAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNbottomAttachment, XmATTACH_NONE); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 650); ac++;
-    XtSetArg(args[ac], XmNtopOffset, 10); ac++;
-    XtSetValues(class_in->toggleButton_mouse_rotate1, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNrightAttachment, XmATTACH_NONE); ac++;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 810); ac++;
-    XtSetArg(args[ac], XmNrightOffset, 0); ac++;
-    XtSetArg(args[ac], XmNtopOffset, 50); ac++;
-    XtSetValues(class_in->label_mousemode, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNrightAttachment, XmATTACH_NONE); ac++;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 460); ac++;
-    XtSetArg(args[ac], XmNtopOffset, 70); ac++;
-    XtSetValues(class_in->scale_headingbias, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNrightAttachment, XmATTACH_NONE); ac++;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 270); ac++;
-    XtSetArg(args[ac], XmNtopOffset, 70); ac++;
-    XtSetValues(class_in->scale_pitchbias, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNrightAttachment, XmATTACH_NONE); ac++;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 100); ac++;
-    XtSetArg(args[ac], XmNtopOffset, 70); ac++;
-    XtSetValues(class_in->scale_rollbias, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNrightAttachment, XmATTACH_NONE); ac++;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 100); ac++;
-    XtSetArg(args[ac], XmNtopOffset, 10); ac++;
-    XtSetValues(class_in->label_status, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 10); ac++;
-    XtSetArg(args[ac], XmNtopOffset, 10); ac++;
-    XtSetValues(class_in->menuBar, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNtopAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNbottomAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNbottomOffset, 7); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 10); ac++;
-    XtSetArg(args[ac], XmNrightOffset, 5); ac++;
-    XtSetArg(args[ac], XmNtopOffset, 140); ac++;
-    XtSetValues(class_in->drawingArea, args, ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNrightAttachment, XmATTACH_NONE); ac++;
-    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
-    XtSetArg(args[ac], XmNleftOffset, 100); ac++;
-    XtSetArg(args[ac], XmNtopOffset, 40); ac++;
-    XtSetValues(class_in->radioBox_soundingsmode, args, ac);
-
-
-    /*
-     * Assign functions to class record
-     */
-
-
-    /* Begin user code block <end_Mb3dsdgCreate> */
-    /* End user code block <end_Mb3dsdgCreate> */
-
-    return( class_in );
-}
diff --git a/src/mbview/Mb3dsdg.h b/src/mbview/Mb3dsdg.h
deleted file mode 100644
index 8aa8c04..0000000
--- a/src/mbview/Mb3dsdg.h
+++ /dev/null
@@ -1,107 +0,0 @@
-
-/* Begin user code block <abstract> */
-/* End user code block <abstract> */
-
-/**
- * README: Portions of this file are merged at file generation
- * time. Edits can be made *only* in between specified code blocks, look
- * for keywords <Begin user code> and <End user code>.
- */
-/*
- * Generated by the ICS Builder Xcessory (BX).
- *
- * BuilderXcessory Version 6.1.3
- * Code Generator Xcessory 6.1.3 (08/19/04) CGX Scripts 6.1 Motif 2.1 
- *
- */
-#ifndef Mb3dsdg_H
-#define Mb3dsdg_H
-
-/**
- * Forward declare the class data pointer type so that it can
- * easily be used as a parameter to class functions and data members.
- */
-typedef struct _Mb3dsdgData *Mb3dsdgDataPtr;
-
-/**
- * Globally included information.
- */
-
-
-/**
- * Class specific includes.
- */
-
-
-typedef struct _Mb3dsdgData
-{
-    /*
-     * Classes created by this class.
-     */
-    
-    /*
-     * Widgets created by this class.
-     */
-    Widget Mb3dsdg;
-    Widget pushButton_reset;
-    Widget scale_timelag;
-    Widget toggleButton_mouse_panzoom1;
-    Widget toggleButton_mouse_rotate1;
-    Widget label_mousemode;
-    Widget scale_headingbias;
-    Widget scale_pitchbias;
-    Widget scale_rollbias;
-    Widget label_status;
-    Widget menuBar;
-    Widget cascadeButton_view;
-    Widget pulldownMenu_view;
-    Widget toggleButton_view_boundingbox;
-    Widget separator1;
-    Widget toggleButton_view_flagged;
-    Widget separator;
-    Widget toggleButton_view_noconnect;
-    Widget toggleButton_view_connectgood;
-    Widget toggleButton_view_connectall;
-    Widget separator2;
-    Widget toggleButton_view_scalewithflagged;
-    Widget cascadeButton_mouse;
-    Widget pulldownMenu_mouse;
-    Widget toggleButton_mouse_rotate;
-    Widget toggleButton_mouse_panzoom;
-    Widget cascadeButton_action;
-    Widget pulldownMenu_action;
-    Widget pushButton_action_applybias;
-    Widget pushButton_action_colorsoundingsblack;
-    Widget pushButton_action_colorsoundingsred;
-    Widget pushButton_action_colorsoundingsyellow;
-    Widget pushButton_action_colorsoundingsgreen;
-    Widget pushButton_action_colorsoundingsbluegreen;
-    Widget pushButton_action_colorsoundingsblue;
-    Widget pushButton_action_colorsoundingspurple;
-    Widget cascadeButton_dismiss;
-    Widget pulldownMenu_dismiss;
-    Widget pushButton_dismiss;
-    Widget drawingArea;
-    Widget radioBox_soundingsmode;
-    Widget toggleButton_mouse_toggle;
-    Widget toggleButton_mouse_pick;
-    Widget toggleButton_mouse_erase;
-    Widget toggleButton_mouse_restore;
-    Widget toggleButton_mouse_grab;
-    Widget toggleButton_mouse_info;
-    
-    /**
-     * All methods and data..
-     */
-} Mb3dsdgData;
-
-/*
- * Function: Mb3dsdgCreate()
- *		The creation for class Mb3dsdg.
- */
-Mb3dsdgDataPtr Mb3dsdgCreate(Mb3dsdgDataPtr, Widget, String, ArgList, Cardinal);
-
-/**
- * Set routines for exposed resources.
- */
-#endif
diff --git a/src/mbview/creation-c.h b/src/mbview/creation-c.h
deleted file mode 100644
index 3d36d9c..0000000
--- a/src/mbview/creation-c.h
+++ /dev/null
@@ -1,38 +0,0 @@
-
-/* Begin user code block <abstract> */
-/* End user code block <abstract> */
-
-/**
- * WARNING: This file is overwritten at code generation time.
- * Any changes to this file will be lost.
- */
-/*
- *
- * Created by BuilderXcessory Version 6.1.3
- * Generated by Code Generator Xcessory 6.1.3 (08/19/04) CGX Scripts 6.1 Motif 2.1 
- *
- */
-#ifndef creation_c_H
-#define creation_c_H
-
-/*
- * Global widget declarations.
- *        - EXTERNAL is set to extern if the
- *          defs file is not included from the
- *          main file.
- */
-#ifdef DECLARE_BX_GLOBALS
-#define EXTERNAL
-#else
-#define EXTERNAL extern
-#endif
-
-#include "MB3DView.h"
-/**
- * Start Global Widget Declarations.
- */
-EXTERNAL MB3DViewData mbview_mbgrdviz;
-/**
- * End Global Widget Declarations.
- */
-#endif
diff --git a/src/mbview/mb3dsoundings.uil b/src/mbview/mb3dsoundings.uil
deleted file mode 100644
index 1bb97ae..0000000
--- a/src/mbview/mb3dsoundings.uil
+++ /dev/null
@@ -1,1241 +0,0 @@
-/*
- * Generated by the ICS builderXcessory (BX).
- *
- *
- * BuilderXcessory Version 6.1.3.
- *
- * Identification: 
- */
-module main_uil
-version = 'V2.1'
-names = case_sensitive
-!(BX) bx_info("c_options", "")
-!(BX) bx_info("c_libs", "-L/usr/lib/Motif1.2 -lXm -lXt -lX11")
-!(BX) bx_info("c_cflags", "-Aa -I/usr/include/Motif1.2 -I/usr/include/X11R5")
-!(BX) bx_info("c_cc", "cc")
-!(BX) bx_info("c_excludeungenerated", "false")
-!(BX) bx_info("c_target", "main-c")
-!(BX) bx_info("c_information", "")
-!(BX) bx_info("c_user_main_loop", "", false)
-!(BX) bx_info("c_ignore_shell_geometry", "false")
-!(BX) bx_info("c_visible_windows_only", "false")
-!(BX) bx_info("c_rm_exp_callbacks", "false")
-!(BX) bx_info("c_reverse_dialogs", "true")
-!(BX) bx_info("c_dialogs_in_routine", "true")
-!(BX) bx_info("c_unmanage_dialogs", "true")
-!(BX) bx_info("c_use_locales", "false")
-!(BX) bx_info("c_ansi", "true")
-!(BX) bx_info("c_name", "MB-System")
-!(BX) bx_info("c_class", "MB-System")
-!(BX) bx_info("c_app_defaults", "app-defaults", true)
-!(BX) bx_info("c_utilities", "mb3dsoundings_bxutils.c", true)
-!(BX) bx_info("c_constants", "mb3dsoundings_creation.h", true)
-!(BX) bx_info("c_callbacks", "mb3dsoundings_callbacks.c", true)
-!(BX) bx_info("c_creation", "mb3dsoundings_creation.c", true)
-!(BX) bx_info("c_main", "mb3dsoundings_main.c", true)
-!(BX) bx_info("c_acinclude_m4", "acinclude.m4", false)
-!(BX) bx_info("c_configure_in", "configure.in", false)
-!(BX) bx_info("c_makefile_am", "Makefile.am", false)
-!(BX) bx_info("c_cvsmake", "CVSMake", false)
-!(BX) bx_info("c_makefile", "makefile_mb3dsoundings-c", true)
-!(BX) bx_info("c_imakefile", "Imakefile_mb3dsoundings", true)
-!(BX) bx_info("c_dirpath", "")
-!(BX) bx_info("include_path", ".", false)
-!(BX) bx_info("xrunner_command", "$(M_ROOT)/arch/X11.5/Xm1.2/mic_xm.o", false)
-!(BX) bx_info("system_directory", "/opt/bx-6.1")
-!(BX) bx_info("builder_version", "BuilderXcessory Version 6.1.3")
-!(BX) bx_info("build_lang", "C")
-!(BX) bx_info("default_cpp_args", "")
-!(BX) bx_info("new_mrm_style", "true")
-!(BX) bx_info("c_wrap_lines", "false")
-!(BX) bx_info("uil_wrap_lines", "true")
-!(BX) bx_info("integrate_purify", "false")
-!(BX) bx_info("purify_command", "purify")
-!(BX) bx_info("integrate_xrunner", "false")
-
-procedure BxExitCB(integer);
-procedure do_mb3dsdg_action_applybias();
-procedure do_mb3dsdg_dismiss();
-procedure do_mb3dsdg_headingbias();
-procedure do_mb3dsdg_input();
-procedure do_mb3dsdg_mouse_erase();
-procedure do_mb3dsdg_mouse_grab();
-procedure do_mb3dsdg_mouse_info();
-procedure do_mb3dsdg_mouse_panzoom();
-procedure do_mb3dsdg_mouse_pick();
-procedure do_mb3dsdg_mouse_restore();
-procedure do_mb3dsdg_mouse_rotate();
-procedure do_mb3dsdg_mouse_toggle();
-procedure do_mb3dsdg_pitchbias();
-procedure do_mb3dsdg_resetview();
-procedure do_mb3dsdg_rollbias();
-procedure do_mb3dsdg_timelag();
-procedure do_mb3dsdg_view_allprofile();
-procedure do_mb3dsdg_view_boundingbox();
-procedure do_mb3dsdg_view_flagged();
-procedure do_mb3dsdg_view_goodprofile();
-procedure do_mb3dsdg_view_noprofile();
-procedure do_mb3dsdg_view_scalewithflagged();
-
-list BaseStyle : arguments {
-};
-
-list BaseStyleReasons : callbacks {
-};
-
-!(BX)list BaseStyleHandlers : handlers {
-!(BX)};
-
-list Style_use : arguments {
-        arguments BaseStyle;
-        XmNfontList = font_table(
-		font('-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1'));
-};
-
-list Style_useReasons : callbacks {
-        callbacks BaseStyleReasons;
-};
-
-!(BX)list Style_useHandlers : handlers {
-!(BX)    handlers BaseStyleHandlers;
-!(BX)};
-
-
-object mb3dsdg : XmFormDialog widget {
-    arguments {
-!(BX) BxNclass = "Mb3dsdg";
-!(BX) BxNsubclassDerived = "False";
-        arguments Style_use;
-        XmNdialogTitle = compound_string("3D Soundings");
-        XmNresizePolicy = XmRESIZE_GROW;
-        XmNx = 775;
-        XmNy = 932;
-        XmNwidth = 1011;
-        XmNheight = 660;
-    };
-    controls {
-         managed XmPushButton mb3dsdg_pushButton_reset;
-         managed XmScale mb3dsdg_scale_timelag;
-         managed XmToggleButton mb3dsdg_toggleButton_mouse_panzoom1;
-         managed XmToggleButton mb3dsdg_toggleButton_mouse_rotate1;
-         managed XmLabel mb3dsdg_label_mousemode;
-         managed XmScale mb3dsdg_scale_headingbias;
-         managed XmScale mb3dsdg_scale_pitchbias;
-         managed XmScale mb3dsdg_scale_rollbias;
-         managed XmLabel mb3dsdg_label_status;
-         managed XmMenuBar mb3dsdg_menuBar;
-         managed XmDrawingArea mb3dsdg_drawingArea;
-         managed XmRadioBox mb3dsdg_radioBox_soundingsmode;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-!(BX)object mb3dsdg_dialogShell : XmDialogShell widget {
-!(BX)    arguments {
-!(BX)        arguments Style_use;
-!(BX)        XmNwidth = 1011;
-!(BX)        XmNheight = 660;
-!(BX)    };
-!(BX)    controls {
-!(BX)         managed XmFormDialog mb3dsdg;
-!(BX)    };
-!(BX)    callbacks {
-!(BX)        callbacks Style_useReasons;
-!(BX)    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-!(BX)};
-
-object mb3dsdg_mainWindow : XmMainWindow widget {
-    arguments {
-        arguments Style_use;
-        XmNx = 747;
-        XmNy = 56;
-        XmNwidth = 197;
-        XmNheight = 104;
-    };
-    controls {
-        Xm_Separator1 {
-            arguments {
-                arguments Style_use;
-            };
-            callbacks {
-                    callbacks Style_useReasons;
-            };
-!(BX)            handlers {
-!(BX)                handlers Style_useHandlers;
-!(BX)            };
-        };
-        Xm_Separator2 {
-            arguments {
-                arguments Style_use;
-            };
-            callbacks {
-                    callbacks Style_useReasons;
-            };
-!(BX)            handlers {
-!(BX)                handlers Style_useHandlers;
-!(BX)            };
-        };
-        Xm_Separator3 {
-            arguments {
-                arguments Style_use;
-            };
-            callbacks {
-                    callbacks Style_useReasons;
-            };
-!(BX)            handlers {
-!(BX)                handlers Style_useHandlers;
-!(BX)            };
-        };
-!(BX)         unmanaged XmDialogShell mb3dsdg_dialogShell;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNdestroyCallback = procedure BxExitCB(0);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-!(BX)object topLevelShell : TopLevelShell widget {
-!(BX)    arguments {
-!(BX)        arguments Style_use;
-!(BX)        XmNtitle = "MBgrdviz";
-!(BX)        XmNx = 747;
-!(BX)        XmNy = 56;
-!(BX)        XmNwidth = 197;
-!(BX)        XmNheight = 104;
-!(BX)    };
-!(BX)    controls {
-!(BX)         managed XmMainWindow mb3dsdg_mainWindow;
-!(BX)    };
-!(BX)    callbacks {
-!(BX)        callbacks Style_useReasons;
-!(BX)    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-!(BX)};
-
-object mb3dsdg_toggleButton_mouse_toggle : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Toggle");
-        XmNwidth = 83;
-        XmNheight = 28;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNvalueChangedCallback = procedure do_mb3dsdg_mouse_toggle();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mb3dsdg_toggleButton_mouse_pick : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Pick");
-        XmNwidth = 83;
-        XmNheight = 28;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNvalueChangedCallback = procedure do_mb3dsdg_mouse_pick();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mb3dsdg_toggleButton_mouse_erase : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Erase");
-        XmNwidth = 83;
-        XmNheight = 28;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNvalueChangedCallback = procedure do_mb3dsdg_mouse_erase();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mb3dsdg_toggleButton_mouse_restore : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Restore");
-        XmNwidth = 83;
-        XmNheight = 28;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNvalueChangedCallback = procedure do_mb3dsdg_mouse_restore();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mb3dsdg_toggleButton_mouse_grab : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Grab");
-        XmNwidth = 83;
-        XmNheight = 28;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNvalueChangedCallback = procedure do_mb3dsdg_mouse_grab();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mb3dsdg_toggleButton_mouse_info : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Info");
-        XmNwidth = 83;
-        XmNheight = 28;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNvalueChangedCallback = procedure do_mb3dsdg_mouse_info();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mb3dsdg_radioBox_soundingsmode : XmRadioBox widget {
-    arguments {
-        arguments Style_use;
-        XmNorientation = XmHORIZONTAL;
-        XmNrightAttachment = XmATTACH_NONE;
-        XmNleftAttachment = XmATTACH_FORM;
-        XmNleftOffset = 100;
-        XmNtopOffset = 40;
-        XmNx = 100;
-        XmNy = 40;
-        XmNwidth = 519;
-        XmNheight = 34;
-    };
-    controls {
-         managed XmToggleButton mb3dsdg_toggleButton_mouse_toggle;
-         managed XmToggleButton mb3dsdg_toggleButton_mouse_pick;
-         managed XmToggleButton mb3dsdg_toggleButton_mouse_erase;
-         managed XmToggleButton mb3dsdg_toggleButton_mouse_restore;
-         managed XmToggleButton mb3dsdg_toggleButton_mouse_grab;
-         managed XmToggleButton mb3dsdg_toggleButton_mouse_info;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mb3dsdg_drawingArea : XmDrawingArea widget {
-    arguments {
-        arguments Style_use;
-        XmNborderWidth = 1;
-        XmNbackground = color('white');
-        XmNborderColor = color('black');
-        XmNtopAttachment = XmATTACH_FORM;
-        XmNrightAttachment = XmATTACH_FORM;
-        XmNleftAttachment = XmATTACH_FORM;
-        XmNbottomAttachment = XmATTACH_FORM;
-        XmNbottomOffset = 7;
-        XmNleftOffset = 10;
-        XmNrightOffset = 5;
-        XmNtopOffset = 140;
-        XmNx = 10;
-        XmNy = 140;
-        XmNwidth = 970;
-        XmNheight = 435;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNinputCallback = procedure do_mb3dsdg_input();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mb3dsdg_toggleButton_view_boundingbox : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Show Bounding Box");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNvalueChangedCallback = procedure do_mb3dsdg_view_boundingbox();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mb3dsdg_separator1 : XmSeparator widget {
-    arguments {
-        arguments Style_use;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mb3dsdg_toggleButton_view_flagged : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Show Flagged Soundings");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNvalueChangedCallback = procedure do_mb3dsdg_view_flagged();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mb3dsdg_separator : XmSeparator widget {
-    arguments {
-        arguments Style_use;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mb3dsdg_toggleButton_view_noconnect : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Show No Profiles");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNvalueChangedCallback = procedure do_mb3dsdg_view_noprofile();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mb3dsdg_toggleButton_view_connectgood : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Show Good Profiles");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNvalueChangedCallback = procedure do_mb3dsdg_view_goodprofile();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mb3dsdg_toggleButton_view_connectall : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Show All Profiles");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNvalueChangedCallback = procedure do_mb3dsdg_view_allprofile();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mb3dsdg_separator2 : XmSeparator widget {
-    arguments {
-        arguments Style_use;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mb3dsdg_toggleButton_view_scalewithflagged : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Scale with Flagged Soundings");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNvalueChangedCallback = procedure do_mb3dsdg_view_scalewithflagged();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mb3dsdg_pulldownMenu_view : XmPulldownMenu widget {
-    arguments {
-        arguments Style_use;
-        XmNx = 757;
-        XmNy = 290;
-        XmNwidth = 236;
-        XmNheight = 154;
-    };
-    controls {
-         managed XmToggleButton mb3dsdg_toggleButton_view_boundingbox;
-         managed XmSeparator mb3dsdg_separator1;
-         managed XmToggleButton mb3dsdg_toggleButton_view_flagged;
-         managed XmSeparator mb3dsdg_separator;
-         managed XmToggleButton mb3dsdg_toggleButton_view_noconnect;
-         managed XmToggleButton mb3dsdg_toggleButton_view_connectgood;
-         managed XmToggleButton mb3dsdg_toggleButton_view_connectall;
-         managed XmSeparator mb3dsdg_separator2;
-         managed XmToggleButton mb3dsdg_toggleButton_view_scalewithflagged;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mb3dsdg_cascadeButton_view : XmCascadeButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("View");
-        XmNx = 5;
-        XmNy = 5;
-        XmNwidth = 71;
-        XmNheight = 24;
-    };
-    controls {
-         unmanaged XmPulldownMenu mb3dsdg_pulldownMenu_view;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mb3dsdg_toggleButton_mouse_rotate : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Rotate Soundings");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNvalueChangedCallback = procedure do_mb3dsdg_mouse_rotate();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mb3dsdg_toggleButton_mouse_panzoom : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Pan and Zoom");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNvalueChangedCallback = procedure do_mb3dsdg_mouse_panzoom();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mb3dsdg_pulldownMenu_mouse : XmPulldownMenu widget {
-    arguments {
-        arguments Style_use;
-        XmNx = 0;
-        XmNy = 0;
-        XmNwidth = 152;
-        XmNheight = 52;
-    };
-    controls {
-         managed XmToggleButton mb3dsdg_toggleButton_mouse_rotate;
-         managed XmToggleButton mb3dsdg_toggleButton_mouse_panzoom;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mb3dsdg_cascadeButton_mouse : XmCascadeButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Mouse");
-        XmNx = 5;
-        XmNy = 29;
-        XmNwidth = 71;
-        XmNheight = 24;
-    };
-    controls {
-         unmanaged XmPulldownMenu mb3dsdg_pulldownMenu_mouse;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mb3dsdg_pushButton_action_applybias : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Apply Bias Values to Grid");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNactivateCallback = procedure do_mb3dsdg_action_applybias();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mb3dsdg_pushButton_action_colorsoundingsblack : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Color Unflagged Soundings Black");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNactivateCallback = procedure do_mb3dsdg_action_colorsoundingsblack();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mb3dsdg_pushButton_action_colorsoundingsred : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Color Unflagged Soundings Red");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNactivateCallback = procedure do_mb3dsdg_action_colorsoundingsred();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mb3dsdg_pushButton_action_colorsoundingsyellow : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Color Unflagged Soundings Yellow");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNactivateCallback = procedure do_mb3dsdg_action_colorsoundingsyellow();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mb3dsdg_pushButton_action_colorsoundingsgreen : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Color Unflagged Soundings Green");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNactivateCallback = procedure do_mb3dsdg_action_colorsoundingsgreen();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mb3dsdg_pushButton_action_colorsoundingsbluegreen : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Color Unflagged Soundings Bluegreen");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNactivateCallback = procedure do_mb3dsdg_action_colorsoundingsbluegreen();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mb3dsdg_pushButton_action_colorsoundingsblue : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Color Unflagged Soundings Blue");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNactivateCallback = procedure do_mb3dsdg_action_colorsoundingsblue();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mb3dsdg_pushButton_action_colorsoundingspurple : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Color Unflagged Soundings Purple");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNactivateCallback = procedure do_mb3dsdg_action_colorsoundingspurple();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mb3dsdg_pulldownMenu_action : XmPulldownMenu widget {
-    arguments {
-        arguments Style_use;
-        XmNx = 0;
-        XmNy = 0;
-        XmNwidth = 189;
-        XmNheight = 28;
-    };
-    controls {
-         managed XmPushButton mb3dsdg_pushButton_action_applybias;
-         managed XmPushButton mb3dsdg_pushButton_action_colorsoundingsblack;
-         managed XmPushButton mb3dsdg_pushButton_action_colorsoundingsred;
-         managed XmPushButton mb3dsdg_pushButton_action_colorsoundingsyellow;
-         managed XmPushButton mb3dsdg_pushButton_action_colorsoundingsgreen;
-         managed XmPushButton mb3dsdg_pushButton_action_colorsoundingsbluegreen;
-         managed XmPushButton mb3dsdg_pushButton_action_colorsoundingsblue;
-         managed XmPushButton mb3dsdg_pushButton_action_colorsoundingspurple;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mb3dsdg_cascadeButton_action : XmCascadeButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Action");
-        XmNx = 5;
-        XmNy = 53;
-        XmNwidth = 71;
-        XmNheight = 24;
-    };
-    controls {
-         unmanaged XmPulldownMenu mb3dsdg_pulldownMenu_action;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mb3dsdg_pushButton_dismiss : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Dismiss");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNactivateCallback = procedure do_mb3dsdg_dismiss();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mb3dsdg_pulldownMenu_dismiss : XmPulldownMenu widget {
-    arguments {
-        arguments Style_use;
-        XmNx = 0;
-        XmNy = 0;
-        XmNwidth = 67;
-        XmNheight = 28;
-    };
-    controls {
-         managed XmPushButton mb3dsdg_pushButton_dismiss;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mb3dsdg_cascadeButton_dismiss : XmCascadeButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Dismiss");
-        XmNx = 5;
-        XmNy = 77;
-        XmNwidth = 71;
-        XmNheight = 24;
-    };
-    controls {
-         unmanaged XmPulldownMenu mb3dsdg_pulldownMenu_dismiss;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mb3dsdg_menuBar : XmMenuBar widget {
-    arguments {
-        arguments Style_use;
-        XmNorientation = XmVERTICAL;
-        XmNleftAttachment = XmATTACH_FORM;
-        XmNleftOffset = 10;
-        XmNtopOffset = 10;
-        XmNx = 10;
-        XmNy = 10;
-        XmNwidth = 81;
-        XmNheight = 106;
-    };
-    controls {
-         managed XmCascadeButton mb3dsdg_cascadeButton_view;
-         managed XmCascadeButton mb3dsdg_cascadeButton_mouse;
-         managed XmCascadeButton mb3dsdg_cascadeButton_action;
-         managed XmCascadeButton mb3dsdg_cascadeButton_dismiss;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mb3dsdg_label_status : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNborderWidth = 1;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNbackground = color('white');
-        XmNlabelString = compound_string("Azimuth: 0.00 | Elevation: 0.00 " &
- "| Vert. Exager.: 1.00");
-        XmNrightAttachment = XmATTACH_NONE;
-        XmNleftAttachment = XmATTACH_FORM;
-        XmNleftOffset = 100;
-        XmNtopOffset = 10;
-        XmNx = 100;
-        XmNy = 10;
-        XmNwidth = 540;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mb3dsdg_scale_rollbias : XmScale widget {
-    arguments {
-        arguments Style_use;
-        XmNminimum = -100;
-        XmNdecimalPoints = 2;
-        XmNtitleString = compound_string("Roll Bias (degrees)");
-        XmNshowArrows = TRUE;
-        XmNscaleMultiple = 1;
-        XmNshowValue = TRUE;
-        XmNorientation = XmHORIZONTAL;
-        XmNrightAttachment = XmATTACH_NONE;
-        XmNleftAttachment = XmATTACH_FORM;
-        XmNleftOffset = 100;
-        XmNtopOffset = 70;
-        XmNx = 100;
-        XmNy = 70;
-        XmNwidth = 170;
-        XmNheight = 63;
-    };
-    controls {
-        Xm_Title {
-            arguments {
-                arguments Style_use;
-            };
-            callbacks {
-                    callbacks Style_useReasons;
-            };
-!(BX)            handlers {
-!(BX)                handlers Style_useHandlers;
-!(BX)            };
-        };
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNvalueChangedCallback = procedure do_mb3dsdg_rollbias();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mb3dsdg_scale_pitchbias : XmScale widget {
-    arguments {
-        arguments Style_use;
-        XmNminimum = -100;
-        XmNdecimalPoints = 2;
-        XmNtitleString = compound_string("Pitch Bias (degrees)");
-        XmNshowArrows = TRUE;
-        XmNscaleMultiple = 1;
-        XmNshowValue = TRUE;
-        XmNorientation = XmHORIZONTAL;
-        XmNrightAttachment = XmATTACH_NONE;
-        XmNleftAttachment = XmATTACH_FORM;
-        XmNleftOffset = 270;
-        XmNtopOffset = 70;
-        XmNx = 270;
-        XmNy = 70;
-        XmNwidth = 190;
-        XmNheight = 63;
-    };
-    controls {
-        Xm_Title {
-            arguments {
-                arguments Style_use;
-            };
-            callbacks {
-                    callbacks Style_useReasons;
-            };
-!(BX)            handlers {
-!(BX)                handlers Style_useHandlers;
-!(BX)            };
-        };
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNvalueChangedCallback = procedure do_mb3dsdg_pitchbias();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mb3dsdg_scale_headingbias : XmScale widget {
-    arguments {
-        arguments Style_use;
-        XmNminimum = -100;
-        XmNdecimalPoints = 2;
-        XmNtitleString = compound_string("Heading Bias (degrees)");
-        XmNshowArrows = TRUE;
-        XmNscaleMultiple = 1;
-        XmNshowValue = TRUE;
-        XmNorientation = XmHORIZONTAL;
-        XmNrightAttachment = XmATTACH_NONE;
-        XmNleftAttachment = XmATTACH_FORM;
-        XmNleftOffset = 460;
-        XmNtopOffset = 70;
-        XmNx = 460;
-        XmNy = 70;
-        XmNwidth = 165;
-        XmNheight = 63;
-    };
-    controls {
-        Xm_Title {
-            arguments {
-                arguments Style_use;
-            };
-            callbacks {
-                    callbacks Style_useReasons;
-            };
-!(BX)            handlers {
-!(BX)                handlers Style_useHandlers;
-!(BX)            };
-        };
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNvalueChangedCallback = procedure do_mb3dsdg_headingbias();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mb3dsdg_label_mousemode : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNborderWidth = 1;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNbackground = color('white');
-        XmNlabelString = compound_string("Mouse Mode:", separate=true) &
- compound_string("L: Edit (Toggle)", separate=true) &
- compound_string("M: Rotate Soundings", separate=true) &
- compound_string("R: Exageration");
-        XmNrecomputeSize = false;
-        XmNrightAttachment = XmATTACH_NONE;
-        XmNleftAttachment = XmATTACH_FORM;
-        XmNleftOffset = 810;
-        XmNrightOffset = 0;
-        XmNtopOffset = 50;
-        XmNx = 810;
-        XmNy = 50;
-        XmNwidth = 170;
-        XmNheight = 80;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mb3dsdg_toggleButton_mouse_rotate1 : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Rotate Soundings");
-        XmNtopAttachment = XmATTACH_FORM;
-        XmNleftAttachment = XmATTACH_FORM;
-        XmNbottomAttachment = XmATTACH_NONE;
-        XmNleftOffset = 650;
-        XmNtopOffset = 10;
-        XmNx = 650;
-        XmNy = 10;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNvalueChangedCallback = procedure do_mb3dsdg_mouse_rotate();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mb3dsdg_toggleButton_mouse_panzoom1 : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Pan and Zoom");
-        XmNleftAttachment = XmATTACH_FORM;
-        XmNleftOffset = 650;
-        XmNtopOffset = 40;
-        XmNx = 650;
-        XmNy = 40;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNvalueChangedCallback = procedure do_mb3dsdg_mouse_panzoom();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mb3dsdg_scale_timelag : XmScale widget {
-    arguments {
-        arguments Style_use;
-        XmNminimum = -100;
-        XmNdecimalPoints = 2;
-        XmNtitleString = compound_string("TIme Lag (seconds)");
-        XmNshowArrows = TRUE;
-        XmNscaleMultiple = 1;
-        XmNshowValue = TRUE;
-        XmNorientation = XmHORIZONTAL;
-        XmNleftAttachment = XmATTACH_FORM;
-        XmNleftOffset = 630;
-        XmNtopOffset = 70;
-        XmNx = 630;
-        XmNy = 70;
-        XmNwidth = 170;
-        XmNheight = 63;
-    };
-    controls {
-        Xm_Title {
-            arguments {
-                arguments Style_use;
-            };
-            callbacks {
-                    callbacks Style_useReasons;
-            };
-!(BX)            handlers {
-!(BX)                handlers Style_useHandlers;
-!(BX)            };
-        };
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNvalueChangedCallback = procedure do_mb3dsdg_timelag();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mb3dsdg_pushButton_reset : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Reset View");
-        XmNleftAttachment = XmATTACH_FORM;
-        XmNleftOffset = 810;
-        XmNtopOffset = 10;
-        XmNx = 810;
-        XmNy = 10;
-        XmNwidth = 170;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNactivateCallback = procedure do_mb3dsdg_resetview();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mb3dsdg_form : XmForm widget {
-    arguments {
-!(BX) BxNclassOnly = "Mb3dsdg";
-!(BX) BxNsubclassDerived = "False";
-!(BX) BxNclassOnlyFile = "False";
-!(BX) BxNbaseInclude = asciz_string_table('');
-!(BX) BxNderivedInclude = asciz_string_table('');
-!(BX) BxNderived = "Mb3dsdgDerived";
-!(BX) BxNfilebase = "Mb3dsdgDerived";
-!(BX) BxNclassFilebase = "Mb3dsdg";
-!(BX) BxNclassGeometry = "987x584+671+275";
-!(BX) BxNgenerate = "True";
-!(BX) BxNreference = "True";
-!(BX) BxNpaletteGroup = "Project Classes";
-!(BX) BxNpaletteName = "Mb3dsdg";
-!(BX) BxNpaletteGeom = "+0+0";
-        arguments Style_use;
-        XmNdialogTitle = compound_string("3D Soundings");
-        XmNresizePolicy = XmRESIZE_GROW;
-        XmNx = 671;
-        XmNy = 275;
-        XmNwidth = 987;
-        XmNheight = 584;
-    };
-    controls {
-         managed XmPushButton mb3dsdg_pushButton_reset;
-         managed XmScale mb3dsdg_scale_timelag;
-         managed XmToggleButton mb3dsdg_toggleButton_mouse_panzoom1;
-         managed XmToggleButton mb3dsdg_toggleButton_mouse_rotate1;
-         managed XmLabel mb3dsdg_label_mousemode;
-         managed XmScale mb3dsdg_scale_headingbias;
-         managed XmScale mb3dsdg_scale_pitchbias;
-         managed XmScale mb3dsdg_scale_rollbias;
-         managed XmLabel mb3dsdg_label_status;
-         managed XmMenuBar mb3dsdg_menuBar;
-         managed XmDrawingArea mb3dsdg_drawingArea;
-         managed XmRadioBox mb3dsdg_radioBox_soundingsmode;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-end module;
diff --git a/src/mbview/mb3dsoundings_bxutils.c b/src/mbview/mb3dsoundings_bxutils.c
deleted file mode 100644
index f4b6a09..0000000
--- a/src/mbview/mb3dsoundings_bxutils.c
+++ /dev/null
@@ -1,4026 +0,0 @@
-
-/* Begin user code block <abstract> */
-/* End user code block <abstract> */
-
-/**
- * WARNING: This file is overwritten at code generation time.
- * Any changes to this file will be lost.
- */
-/*
- * MODULE: BxConvert.c
- * AUTHOR: Automatically generated by Builder Xcessory
- *
- * Description: This module contains various utilities, converters
- *	for XmStrings (to work properly with app-defaults), and if needed
- *	the XPM pixmap utilities.
- *
- * Edit the file ${BX}/gen/bxutils.c (BX$SYSTEM:[gen]bxutils.c on VMS) to
- * make system wide changes to this file which will be visible next time
- * this file is generated.
- * ${BX} is the directory where Builder Xcessory is installed.
- */
-
-/*
- * BX supplies a string format for compound strings:
- *
- *		::[#tag][:t][:r]["str"]
- *
- * where:
- *	:: = indicates compound string.
- *	tag =  the font tag
- *	:t = separator (if not seen no separator added to segment)
- *	:r = right to left (if not seen left to right assumed)
- *	"str" = the text of the string.
- *
- * The components for the compound string can be repeated any number of
- * times.
- */
-
-/*****************************************************************************
- *       INCLUDE FILES
- *****************************************************************************/
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#if defined(__hpux)
-#define XLIB_ILLEGAL_ACCESS
-#endif
-#include <Xm/Xm.h>
-#include <Xm/RowColumn.h>
-#include <stdio.h>
-#include <ctype.h>
-#include <string.h>
-
-/*
- * Include stdlib.h and malloc.h if code is C++, ANSI, or Extended ANSI.
- */
-#if defined(__cplusplus) || defined(__STDC__) || defined(__EXTENSIONS__)
-#include <stdlib.h>
-#ifndef VMS
-#include <malloc.h>
-#endif
-#endif
-
-/*****************************************************************************
- *       TYPDEFS AND DEFINES
- *****************************************************************************/
-
-/*
- * Undefine this if you want to use native strcasecmp.
- */
-#define LOCAL_STRCASECMP
-
-#ifdef _NO_PROTO
-#ifdef NeedFunctionPrototypes
-#undef NeedFunctionPrototypes
-#endif
-#endif
-
-/*
- * Define SUPPORTS_WCHARS if the system supports wide character sets
- * Note: the following line flags the VAXC compiler and not the
- * DECC compiler running VAXC emulation.
- */
-#if !((defined(VAXC) && !defined(__DECC)) || defined(__CENTERLINE__))
-#define SUPPORTS_WCHARS
-#endif
-
-/*
- * Handy definition used in SET_BACKGROUND_COLOR
-*/
-#define UNSET		(-1)
-
-/*
- * Set state of inclusion of prototypes properly
- */
-#ifdef NeedFunctionPrototypes
-#define ARGLIST(p)	(
-#define ARG(a, b)	a b,
-#define GRA(a, b)	a b)
-#else
-#define ARGLIST(p)	p
-#define ARG(a, b)	a b;
-#define GRA(a, b)	a b;
-#endif
-
-#ifdef NeedFunctionPrototypes
-#ifdef __cplusplus
-#define UARG(a, b)	a,
-#define GRAU(a, b)	a)
-#else
-#define UARG(a, b)	a b,
-#define GRAU(a, b)	a b)
-#endif
-#else
-#define UARG(a, b)	a b;
-#define GRAU(a, b)	a b;
-#endif
-
-/*
- * Set up strcasecmp function
- */
-#if defined(LOCAL_STRCASECMP)
-#define STRCASECMP	StrCasecmp
-#ifndef NeedFunctionPrototypes
-static int StrCasecmp();
-#else
-static int StrCasecmp(char*, char*);
-#endif
-#else
-#define STRCASECMP	strcasecmp
-#endif
-
-/*
- * Define XTPOINTER so it works with all releases of
- * Xt and c++.
- */
-#ifdef __cplusplus
-#if XtSpecificationRelease < 5
-#define XTPOINTER	char *
-#else
-#define XTPOINTER	XPointer
-#endif
-#else
-#define XTPOINTER	XtPointer
-#endif
-
-/*
- * The following enum is used to support wide character sets.
- * Use this enum for references into the Common Wide Characters array.
- * If you add to the array, ALWAYS keep NUM_COMMON_WCHARS as the last
- * entry in the enum.  This will maintain correct memory usage, etc.
- */
-enum { WNull, WTab, WNewLine, WCarriageReturn, WFormFeed, WVerticalTab,
-       WBackSlash, WQuote, WHash, WColon, WideF, WideL, WideN, WideR,
-       WideT, WideV, WideUF, WideUL, WideUR, WideUT, WideZero, WideOne,
-       NUM_COMMON_WCHARS };
-
-/*****************************************************************************
- *       GLOBAL DECLARATIONS
- *****************************************************************************/
-
-/*****************************************************************************
- *       EXTERNAL DECLARATIONS
- *****************************************************************************/
-
-/*****************************************************************************
- *	STATIC DECLARATION
- *****************************************************************************/
-
-#ifndef NeedFunctionPrototypes
-
-#ifndef SUPPORTS_WCHARS
-static int	 mblen			();
-#endif
-static int	strlenWc		();
-static size_t	doMbstowcs		();
-static size_t	doWcstombs 		();
-static void	copyWcsToMbs		();
-static int 	dombtowc		();
-static Boolean	extractSegment		();
-static XmString	StringToXmString	();
-static char*	getNextCStrDelim	();
-static int	getCStrCount		();
-static wchar_t *CStrCommonWideCharsGet	();
-
-#else
-
-#ifndef SUPPORTS_WCHARS
-static int 	mblen			(char*, size_t);
-#endif
-static int	strlenWc		(wchar_t*);
-static size_t	doMbstowcs		(wchar_t*, char*, size_t);
-static size_t	doWcstombs 		(char*, wchar_t*, size_t);
-static void	copyWcsToMbs		(char*, wchar_t*, int, Boolean);
-static int 	dombtowc		(wchar_t*, char*, size_t);
-static Boolean	extractSegment		(wchar_t**, wchar_t**, int *,
-					 wchar_t**, int*, int*,	Boolean*);
-static XmString	StringToXmString	(char*);
-static char*	getNextCStrDelim	(char*);
-static int	getCStrCount		(char*);
-static wchar_t *CStrCommonWideCharsGet	();
-
-#endif
-
-/*****************************************************************************
- *	STATIC CODE
- *****************************************************************************/
-
-#if defined(LOCAL_STRCASECMP)
-
-/*
- * Function:
- *      cmp = StrCasecmp(s1, s2);
- * Description:
- *      Compare two strings ignoring case
- * Input:
- *      s1 - char * : string 1 to compare
- *      s2 - char * : string 2 to compare
- * Output:
- *      int :  0; s1 == s2
- *             1; s1 != s2
- */
-static int StrCasecmp
-    ARGLIST((s1, s2))
-        ARG(register char *, s1)
-        GRA(register char *, s2)
-{
-    register int        c1, c2;
-
-    while (*s1 && *s2)
-    {
-        c1 = isupper(*s1) ? tolower(*s1) : *s1;
-        c2 = isupper(*s2) ? tolower(*s2) : *s2;
-        if (c1 != c2)
-        {
-            return(1);
-        }
-        s1++;
-        s2++;
-    }
-    if (*s1 || *s2)
-    {
-        return(1);
-    }
-    return(0);
-}
-#endif
-
-#ifndef SUPPORTS_WCHARS
-/*
- * Function:
- *      len = mblen(s, n);
- * Description:
- *      The mblen function for platforms that don't have one. This
- * 	function simply returns a length of 1 since no wide character
- *	support exists for this platform.
- * Input:
- *      s - char * : the character string to get the length from
- *	n - size_t : the size of the string
- * Output:
- *      int : always 1
- */
-static int mblen
-    ARGLIST((s, n))
-        ARG(char *, s)
-        GRA(size_t, n)
-{
-    return(1);
-}
-#endif
-
-/*
- * Function:
- *      len = strlenWc(ptr);
- * Description:
- *      Return the number of characters in a wide character string (not
- *	the characters in the resultant mbs).
- * Input:
- *      ptr - wchar_t* : pointer to the wcs to count
- * Output:
- *      int : the number of characters found
- */
-static int strlenWc
-    ARGLIST((ptr))
-        GRA(wchar_t *,ptr)
-{
-    register wchar_t	*p = ptr;
-    register int	x = 0;
-
-    if (!ptr) return(0);
-
-    while (*p++) x++;
-    return (x);
-}
-
-/*
- * Function:
- *      bytesConv = doMbstowcs(wcs, mbs, n);
- * Description:
- *      Create a wcs string from an input mbs.
- * Input:
- *	wcs - wchar_t* : pointer to result buffer of wcs
- *      mbs - char* : pointer to the source mbs
- *	n - size_t : the number of characters to convert
- * Output:
- *      bytesConv - size_t : number of bytes converted
- */
-static size_t doMbstowcs
-    ARGLIST((wcs, mbs, n))
-        ARG(wchar_t *,wcs)
-        ARG(char *, mbs)
-        GRA(size_t, n)
-{
-#ifndef SUPPORTS_WCHARS
-    int i;
-
-    for (i = 0; i < n && mbs[i] != 0; ++i)
-    {
-	wcs[i] = mbs[i];
-    }
-    wcs[i++] = 0;
-    return(i);
-#else
-    return(mbstowcs(wcs, mbs, n));
-#endif
-}
-
-/*
- * Function:
- *      bytesConv = doWcstombs(wcs, mbs, n);
- * Description:
- *      Create a mbs string from an input wcs.
- * Input:
- *	wcs - wchar_t* : pointer to the source wcs
- *      mbs - char* : pointer to result mbs buffer
- *	n - size_t : the number of characters to convert
- * Output:
- *      bytesConv - size_t : number of bytes converted
- */
-static size_t doWcstombs
-    ARGLIST((mbs, wcs, n))
-        ARG(char *, mbs)
-        ARG(wchar_t *, wcs)
-        GRA(size_t, n)
-{
-#ifndef SUPPORTS_WCHARS
-    int i;
-
-    for (i = 0; i < n && wcs[i] != 0; ++i)
-    {
-	mbs[i] = wcs[i];
-    }
-    mbs[i] = 0;
-    return(i);
-#else
-    size_t	retval;
-
-    retval = wcstombs(mbs, wcs, (n * sizeof(wchar_t)));
-    if ( retval == (size_t)-1 ) return(0);
-    else return(retval);
-#endif
-}
-
-/*
- * Function:
- *      copyWcsToMbs(mbs, wcs, len);
- * Description:
- *      Create a mbs string from an input wcs. This function allocates
- *	a buffer if necessary.
- * Input:
- *	mbs - char* : destination for the converted/copied output
- *	wcs - wchar_t* : pointer to wcs to copy/convert
- *	len - int : the number of wchar_t' to convert
- *	process_it - Boolean : True if processing of quoted charcters,
- *			False if blind.
- * Output:
- *      None
- */
-static void copyWcsToMbs
-    ARGLIST((mbs, wcs, len, process_it))
-        ARG(char *, mbs)
-        ARG(wchar_t *, wcs)
-        ARG(int, len)
-        GRA(Boolean, process_it)
-{
-    static	wchar_t	*tbuf = NULL;
-    static	int	tbufSize = 0;
-
-    int		numCvt;
-    int		lenToConvert;
-    wchar_t	*fromP = wcs;
-    wchar_t	*x = &fromP[len];
-    wchar_t	*toP;
-    wchar_t	*commonWChars = CStrCommonWideCharsGet();
-    wchar_t	tmp;
-
-    /*
-     * Make sure there's room in the buffer
-     */
-    if (tbufSize < len)
-    {
-	tbuf = (wchar_t*)XtRealloc((char*)tbuf, (len + 1) * sizeof(wchar_t));
-	tbufSize = len;
-    }
-
-    /*
-     * Now copy and process
-     */
-    toP = tbuf;
-    lenToConvert = 0;
-    while (fromP < x)
-    {
-	/*
-	 * Check for quoted characters
-	 */
-	if ((*fromP == commonWChars[WBackSlash]) && process_it)
-	{
-	    fromP++;		/* Skip quote */
-	    if (fromP == x)	/* Hanging quote? */
-	    {
-		*toP++ = commonWChars[WBackSlash];
-		lenToConvert++;
-		break;
-	    }
-	    tmp = *fromP++;
-	    if (tmp == commonWChars[WideN])
-	    {
-		*toP++ = commonWChars[WNewLine];
-	    }
-	    else if (tmp == commonWChars[WideT])
-	    {
-		*toP++ = commonWChars[WTab];
-	    }
-	    else if (tmp == commonWChars[WideR])
-	    {
-		*toP++ = commonWChars[WCarriageReturn];
-	    }
-	    else if (tmp == commonWChars[WideF])
-	    {
-		*toP++ = commonWChars[WFormFeed];
-	    }
-	    else if (tmp == commonWChars[WideV])
-	    {
-		*toP++ = commonWChars[WVerticalTab];
-	    }
-	    else if (tmp == commonWChars[WBackSlash])
-	    {
-		*toP++ = commonWChars[WBackSlash];
-	    }
-	    else
-	    {
-                /*
-		 * No special translation needed
-		 */
-		*toP++ = tmp;
-	    }
-	}
-	else
-	{
-	    *toP++ = *fromP++;
-	}
-	lenToConvert++;
-    }
-
-    tmp = tbuf[lenToConvert];
-    tbuf[lenToConvert] = (wchar_t) 0;
-    numCvt = doWcstombs(mbs, tbuf, lenToConvert);
-    tbuf[lenToConvert] = tmp;
-
-    mbs[numCvt] = '\0';
-}
-
-/*
- * Function:
- *      status = dombtowc(wide, multi, size);
- * Description:
- *      Convert a multibyte character to a wide character.
- * Input:
- *      wide	- wchar_t *	: where to put the wide character
- *	multi	- char *	: the multibyte character to convert
- *	size	- size_t	: the number of characters to convert
- * Output:
- *      0	- if multi is a NULL pointer or points to a NULL character
- *	#bytes	- number of bytes in the multibyte character
- *	-1	- multi is an invalid multibyte character.
- *
- *	NOTE:  if wide is NULL, then this returns the number of bytes in
- *	       the multibyte character.
- */
-static int dombtowc
-    ARGLIST((wide, multi, size))
-        ARG(wchar_t *, wide)
-        ARG(char *, multi)
-        GRA(size_t, size)
-{
-    int		retVal = 0;
-
-#ifndef SUPPORTS_WCHARS
-    if ((multi == NULL) || (*multi == '\000'))
-    {
-	if (wide) wide[0] = '\0';
-	return (0);
-    }
-
-    for (retVal = 0; retVal < size && multi[retVal] != '\000'; retVal++)
-    {
-	if (wide != NULL)
-	{
-	    wide[retVal] = multi[retVal];
-	}
-    }
-#else
-    retVal = mbtowc(wide, multi, size);
-#endif
-    return(retVal);
-}
-
-/*
- * Function:
- *	ptr = getNextSepartor(str);
- * Description:
- *	Parse through a string looking for the next compound string
- *	field separator
- * Inputs:
- *	str - wchar_t* : the address of address of the string to parse
- * Outputs:
- *	ptr - wchar_t* : pointer to character, if found, points to end
- *			of string otherwise ('\0').
- */
-static wchar_t* getNextSeparator
-    ARGLIST((str))
-        GRA(wchar_t *, str)
-{
-    wchar_t	*ptr = str;
-    wchar_t	*commonWChars = CStrCommonWideCharsGet();
-
-    while (*ptr)
-    {
-	/*
-	 * Check for separator
-	 */
-	if ((*ptr == commonWChars[WHash]) ||
-	    (*ptr == commonWChars[WQuote]) ||
-	    (*ptr == commonWChars[WColon]))
-	{
-	    return(ptr);
-	}
-	else if (*ptr == commonWChars[WBackSlash])
-	{
-	    ptr++;
-	    if (*ptr) ptr++;	/* Skip quoted character */
-	}
-	else
-	{
-	    ptr++;
-	}
-    }
-    return(ptr);
-}
-
-/*
- * Function:
- *	more =
- *        extractSegment(str, tagStart, tagLen, txtStart, txtLen,
- *			pDir, pSep);
- * Description:
- *	Parse through a string version of a compound string and extract
- *	the first compound string segment from the string.
- * Inputs:
- *	str - char** : the address of address of the string to parse
- *	tagStart - char** : address to return pointer to tag start into
- *	tagLen - int* : address where to return the tag length into
- *	txtStart - char** : address to return the text start into
- *	txtLen - int* : address where to return the text length
- *	pDir - int* : address to return the string direction into
- *	pSep - Boolean * : address to return the separtor into
- * Outputs:
- *	more - Boolean : True if more of the string to parse.
- *			False means done.
- */
-static Boolean extractSegment
-    ARGLIST((str, tagStart, tagLen, txtStart, txtLen, pDir, pSep))
-        ARG(wchar_t **, str)
-        ARG(wchar_t **, tagStart)
-        ARG(int *, tagLen)
-        ARG(wchar_t **, txtStart)
-        ARG(int *, txtLen)
-        ARG(int *, pDir)
-        GRA(Boolean *, pSep)
-{
-    wchar_t		*start;
-    wchar_t		*text;
-    int			textL;
-    Boolean		tagSeen;
-    wchar_t		*tag;
-    int			tagL;
-    Boolean		modsSeen;
-    Boolean		sep;
-    int			dir;
-    Boolean		done;
-    Boolean		checkDir;
-    wchar_t		*commonWChars;
-    wchar_t		emptyStrWcs[1];
-
-    /*
-     * Initialize variables
-     */
-    text = NULL;
-    textL = 0;
-    tagSeen = False;
-    tag = NULL;
-    tagL = 0;
-    modsSeen = False;
-    dir = XmSTRING_DIRECTION_L_TO_R;
-    sep = False;
-    done = False;
-    commonWChars = CStrCommonWideCharsGet();
-
-    /*
-     * Guard against nulls
-     */
-    if (!(start = *str))
-    {
-	start = emptyStrWcs;
-	emptyStrWcs[0] = commonWChars[WNull];
-    }
-
-    /*
-     * If the first character of the string isn't a # or a ", then we
-     * just have a regular old simple string. Do the same the thing for
-     * the empty string.
-     */
-    if ((*start == '\0') || (start != getNextSeparator(start)))
-    {
-	text = start;
-	if (!(textL = strlenWc(start)))
-	{
-	    text = NULL;
-	}
-	start += textL;
-    }
-    else
-    {
-	done = False;
-	while (!done)
-	{
-	    if (*start == commonWChars[WHash])
-	    {
-		if (tagSeen)
-		{
-		    done = True;
-		    break;
-		}
-		else
-		{
-		    tagSeen = True;
-		    tag = ++start;
-		    start = getNextSeparator(tag);
-		    if ((tagL = start - tag) == 0)
-		    {
-			tag = NULL;		/* Null tag specified */
-		    }
-		}
-	    }
-	    else if (*start == commonWChars[WQuote])
-	    {
-		text = ++start;
-		start = getNextSeparator(start);
-		while (!((*start == commonWChars[WQuote]) ||
-			 (*start == commonWChars[WNull])))
-		{
-		    start = getNextSeparator(++start);
-		}
-
-		if ((textL = start - text) == 0)
-		{
-		    text = NULL;	/* Null text specified  */
-		}
-                /*
-		 * if a quote, skip over it
-		 */
-		if (*start == commonWChars[WQuote])
-		{
-		    start++;
-		}
-		done = True;
-	    }
-	    else if (*start == commonWChars[WColon])
-	    {
-		if (modsSeen)
-		{
-		    done = True;
-		    break;
-		}
-
-		/*
-		 * If the next character is a t or f, the we've got
-		 * a separator.
-		 */
-		modsSeen = True;
-		checkDir = False;
-		start++;
-		if ((*start == commonWChars[WideT]) ||
-		    (*start == commonWChars[WideUT]) ||
-		    (*start == commonWChars[WideOne]))
-		{
-		    sep = True;
-		    start++;
-		    checkDir = True;
-		}
-		else if ((*start == commonWChars[WideF]) ||
-			 (*start == commonWChars[WideUF]) ||
-			 (*start == commonWChars[WideZero]))
-		{
-		    sep = False;
-		    start++;
-		    checkDir = True;
-		}
-		else if ((*start == commonWChars[WideR]) ||
-			 (*start == commonWChars[WideUR]))
-		{
-		    start++;
-		    dir = XmSTRING_DIRECTION_R_TO_L;
-		}
-		else if ((*start == commonWChars[WideL]) ||
-			 (*start == commonWChars[WideUL]))
-		{
-		    start++;
-		    dir = XmSTRING_DIRECTION_L_TO_R;
-		}
-		/*
-		 * Look for direction if necessary. This requires a bit of
-		 * look ahead.
-		 */
-		if (checkDir && (*start == commonWChars[WColon]))
-		{
-		    if ((*(start + 1) == commonWChars[WideL]) ||
-			(*(start + 1) == commonWChars[WideUL]))
-		    {
-			dir = XmSTRING_DIRECTION_L_TO_R;
-			start += 2;
-		    }
-		    else if ((*(start + 1) == commonWChars[WideR]) ||
-			     (*(start + 1) == commonWChars[WideUR]))
-		    {
-			dir = XmSTRING_DIRECTION_R_TO_L;
-			start+=2;
-		    }
-		}
-	    }
-            else
-	    {
-		/*
-		 * A bad string format! We'll just skip the character.
-		 */
-		start++;
-	    }
-	}
-    }
-
-    /*
-     * Now fill in return values
-     */
-    if (*str)		*str = start;
-    if (tagStart)	*tagStart = tag;
-    if (tagLen)		*tagLen = tagL;
-    if (txtStart)	*txtStart = text;
-    if (txtLen)		*txtLen = textL;
-    if (pDir)		*pDir = dir;
-    if (pSep)		*pSep = sep;
-
-    return ((*start == commonWChars[WNull]) ? False : True);
-}
-
-/*
- * Function:
- *	xstr = StringToXmString(str);
- * Description:
- *	Parse a string into an XmString.
- * Inputs:
- *	str - char * : the string to parse
- * Outputs:
- *	xstr - XmString : the allocated return structure
- */
-static XmString StringToXmString
-    ARGLIST((str))
-        GRA(char *,str)
-{
-    static char*	tagBuf = NULL;
-    static int		tagBufLen = 0;
-    static char*	textBuf = NULL;
-    static int		textBufLen = 0;
-
-    wchar_t		*ctx;
-    wchar_t		*tag;
-    int			tagLen;
-    wchar_t		*text;
-    int			textLen;
-    Boolean		sep;
-    int			dir;
-
-    Boolean		more;
-    wchar_t		*wcStr;
-    int			curDir;
-    XmString		xmStr;
-    XmString		s1;
-    XmString		s2;
-
-    if (!str) return(NULL);
-
-    /*
-     * For expediencies sake, we'll overallocate this buffer so that
-     * the wcs is guaranteed to fit (1 wc per byte in original string).
-     */
-    wcStr = (wchar_t*)XtMalloc((strlen(str) + 1) * sizeof(wchar_t));
-    doMbstowcs(wcStr, str, strlen(str) + 1);
-
-    /*
-     * Create the beginning segment
-     */
-    curDir = XmSTRING_DIRECTION_L_TO_R;
-    xmStr = XmStringDirectionCreate(curDir);
-
-    /*
-     * Convert the string.
-     */
-    more = True;
-    ctx = wcStr;
-    while (more)
-    {
-	more = extractSegment(&ctx, &tag, &tagLen,
-			      &text, &textLen, &dir, &sep);
-	/*
-	 * Pick up a direction change
-	 */
-	if (dir != curDir)
-	{
-#if defined(VMS) || (defined(__osf__) && defined(__alpha))
-#if XmVERSION > 1 || (XmVERSION == 1 && XmREVISION >= 2)
-	    /*
-	     * This is required on DEC Windows systems because they've
-	     * added the REVERT direction.
-	     */
-	    s1 = XmStringDirectionCreate(XmSTRING_DIRECTION_REVERT);
-	    s2 = xmStr;
-	    xmStr = XmStringConcat(s2, s1);
-	    XmStringFree(s1);
-	    XmStringFree(s2);
-#endif
-#endif
-	    curDir = dir;
-	    s1 = XmStringDirectionCreate(curDir);
-	    s2 = xmStr;
-	    xmStr = XmStringConcat(s2, s1);
-	    XmStringFree(s1);
-	    XmStringFree(s2);
-
-	}
-
-	/*
-	 * Create the segment. Text and tag first.
-	 */
-	if (textLen)
-	{
-	    if (textBufLen <= (textLen * sizeof(wchar_t)))
-	    {
-		textBufLen = (textLen + 1) * sizeof(wchar_t);
-		textBuf = (char*)XtRealloc(textBuf, textBufLen);
-	    }
-	    copyWcsToMbs(textBuf, text, textLen, True);
-
-	    if (tagLen)
-	    {
-		if (tagBufLen <= (tagLen * sizeof(wchar_t)))
-		{
-		    tagBufLen = (tagLen + 1) * sizeof(wchar_t);
-		    tagBuf = (char*)XtRealloc(tagBuf, tagBufLen);
-		}
-		copyWcsToMbs(tagBuf, tag, tagLen, False);
-	    }
-	    else
-	    {
-		if (!tagBuf)
-		{
-		    tagBufLen = strlen(XmSTRING_DEFAULT_CHARSET) + 1;
-		    tagBuf = (char*)XtMalloc(tagBufLen);
-		}
-		strcpy(tagBuf, XmSTRING_DEFAULT_CHARSET);
-	    }
-
-	    s1 = XmStringCreate(textBuf, tagBuf);
-	    s2 = xmStr;
-	    xmStr = XmStringConcat(s2, s1);
-	    XmStringFree(s1);
-	    XmStringFree(s2);
-	}
-
-	/*
-	 * Add in the separators.
-	 */
-	if (sep)
-	{
-	    s1 = XmStringSeparatorCreate();
-	    s2 = xmStr;
-	    xmStr = XmStringConcat(s2, s1);
-	    XmStringFree(s1);
-	    XmStringFree(s2);
-	}
-    }
-
-    /*
-     * Free up memory and return
-     */
-    XtFree((char*)wcStr);
-    return(xmStr);
-}
-
-/*
- * Function:
- *      nextCStr = getNextCStrDelim(str);
- * Description:
- *      Find the next unquoted , or \n in the string
- * Input:
- *	str - char * : the input string
- * Output:
- *      nextCStr - char* : pointer to the next delimiter. Returns NULL if no
- *			delimiter found.
- */
-static char* getNextCStrDelim
-    ARGLIST((str))
-        GRA(char *,str)
-{
-    char	*comma = str;
-    Boolean	inQuotes = False;
-    int		len;
-
-    if (!str) return(NULL);
-    if (!*str) return(NULL);	/* At end */
-
-#ifdef __CENTERLINE__
-    len = mblen((char *)NULL, sizeof(wchar_t));
-#else
-    len = mblen(NULL, sizeof(wchar_t));
-#endif
-    while (*comma)
-    {
-	if ((len = mblen(comma, sizeof(wchar_t))) > 1)
-	{
-	    comma += len;
-	    continue;
-	}
-
-	if (*comma == '\\')
-	{
-	    comma++;	/* Over quote */
-	    comma += mblen(comma, sizeof(wchar_t));
-	    continue;
-	}
-
-	/*
-	 * See if we have a delimiter
-	 */
-	if (!inQuotes)
-	{
-	    if ((*comma == ',') || (*comma == '\012'))
-	    {
-		return(comma);
-	    }
-	}
-
-	/*
-	 * Deal with quotes
-	 */
-	if (*comma == '\"')
-	{
-	    inQuotes = ~inQuotes;
-	}
-
-	comma++;
-    }
-
-    return(NULL);		/* None found */
-}
-
-/*
- * Function:
- *	cnt = getCStrCount(str);
- * Description:
- *      Get the count of cstrings in a compound string table ascii
- *	format.
- * Input:
- *      str - char * : string to parse
- * Output:
- *      cnt - int : the number of XmStrings found
- */
-static int getCStrCount
-    ARGLIST((str))
-        GRA(char *, str)
-{
-    int		x = 1;
-    char	*newStr;
-
-    if (!str) return(0);
-    if (!*str) return(0);
-
-    while (newStr = getNextCStrDelim(str))
-    {
-	x++;
-	str = ++newStr;
-    }
-    return(x);
-}
-
-/*
- * Function:
- *      cwc = CStrCommonWideCharsGet();
- * Description:
- *      Return the array of common wide characters.
- * Input:
- *      None.
- * Output:
- *     	cwc - wchar_t * : this array should never be written to or FREEd.
- */
-static wchar_t *CStrCommonWideCharsGet()
-{
-    static wchar_t	*CommonWideChars = NULL;
-    /*
-     * If you add to this array, don't forget to change the enum in
-     * the TYPEDEFS and DEFINES section above to correspond to this
-     * array.
-     */
-    static char	*characters[] = {
-	(char *)"\000", (char *)"\t", (char *)"\n", (char *)"\r",
-	(char *)"\f",   (char *)"\v", (char *)"\\", (char *)"\"",
-	(char *)"#", 	(char *)":",  (char *)"f",  (char *)"l",
-	(char *)"n", 	(char *)"r",  (char *)"t",  (char *)"v",
-	(char *)"F", 	(char *)"L",  (char *)"R",  (char *)"T",
-	(char *)"0",    (char *)"1"
-    };
-
-    if (CommonWideChars == NULL)
-    {
-	int	i;
-
-	/*
-	 * Allocate and create the array.
-	 */
-	CommonWideChars = (wchar_t*)XtMalloc(NUM_COMMON_WCHARS * sizeof(wchar_t));
-
-	for (i = 0; i < NUM_COMMON_WCHARS; i++)
-	{
-	    (void)dombtowc(&(CommonWideChars[i]), characters[i], 1);
-	}
-    }
-    return(CommonWideChars);
-}
-
-/*
- * Function:
- *      CvtXmStringDestructor(app, converted, data, args, num_args)
- * Description:
- *      This destructor is called by the X Toolkit Intrinsics to delete
- *	the memory allocated in CvtStringToXmString.
- * Input:
- *      app		- XtAppContext	: The Xt application context
- *	converted	- XrmValue *	: The value allocated by
- *					  CvtStringToXmString
- *	data		- XtPointer	: The extra data originally passed
- *					  to the converter
- *	args		- XrmValue *	: The extra arguments originally
- *					  passed to the converter
- *	num_args	- Cardinal *	: The number of args originally
- *					  passed to the converter
- * Output:
- *      None
- */
-static void
-CvtXmStringDestructor
-    ARGLIST((app, converted, data, args, num_args))
-        UARG(XtAppContext, app)
-        ARG(XrmValue *, converted)
-        UARG(XtPointer, data)
-        UARG(XrmValue *, args)
-        GRAU(Cardinal *, num_args)
-{
-    XmString	freestr = (XmString)converted->addr;
-    if ( freestr != NULL ) XmStringFree(freestr);
-}
-
-/*
- * Function:
- *	CONVERTER CvtStringToXmString
- *
- * Description:
- *	Convert a string to an XmString. This allows a string contained in
- *	resource file to contain multiple fonts. The syntax for the string
- *	is:
- *		::[#[font-tag]]"string"[#[font-tag]"string"] ...
- *
- *	note that the # can be escaped (\#).
- *
- * Input:
- * Output:
- *	Standard.
- */
-static Boolean CvtStringToXmString
-    ARGLIST((d, args, num_args, fromVal, toVal, data))
-        ARG(Display *, d)
-        UARG(XrmValue *, args)
-        ARG(Cardinal *, num_args)
-        ARG(XrmValue *, fromVal)
-        ARG(XrmValue *, toVal)
-        GRAU(XtPointer, data)
-{
-    static XmString	resStr;
-    char		*str;
-
-    /*
-     * This converter takes no parameters
-     */
-    if (*num_args != 0)
-    {
-	XtAppWarningMsg(XtDisplayToApplicationContext(d),
-			"cvtStringToXmString",
-			"wrongParameters",
-			"XtToolkitError",
-			"String to XmString converter needs no extra arguments",
-			(String *)NULL,
-			(Cardinal *)NULL);
-    }
-
-    /*
-     * See if this is a simple string
-     */
-    str = (char*)fromVal->addr;
-    if (strncmp(str, "::", 2))
-    {
-	resStr = XmStringCreateLtoR(fromVal->addr, XmSTRING_DEFAULT_CHARSET);
-    }
-    else
-    {
-	/*
-	 * Convert into internal format
-	 */
-	resStr = StringToXmString(fromVal->addr + 2);	/* skip :: */
-    }
-
-    /*
-     * Done, return result
-     */
-    if (toVal->addr == NULL)
-    {
-	toVal->addr = (XTPOINTER)&resStr;
-	toVal->size = sizeof(XmString);
-    }
-    else if (toVal->size < sizeof(XmString))
-    {
-	toVal->size = sizeof(XmString);
-	XtDisplayStringConversionWarning(d, fromVal->addr, "XmString");
-	XmStringFree(resStr);
-	return(False);
-    }
-    else
-    {
-	*(XmString *)toVal->addr = resStr;
-	toVal->size = sizeof(XmString);
-    }
-    return(True);
-}
-
-/*
- * Function:
- *      CONVERTER CvtStringToXmStringTable
- *
- * Description:
- *	Convert a string to an XmString table. This allows a string
- *	contained in resource file to contain multiple fonts. The syntax
- *	for the string is:
- *
- *	   compound_string = [#[font-tag]]"string"[#[font-tag]"string"] ...
- *	   compound_string_table = [compound_string][,compound_string] ...
- *
- *	note that the # can be escaped (\#).
- *
- * Input:
- * Output:
- *	Standard.
- */
-static Boolean CvtStringToXmStringTable
-    ARGLIST((d, args, num_args, fromVal, toVal, data))
-        ARG(Display *, d)
-        ARG(XrmValue *, args)
-        ARG(Cardinal *, num_args)
-        ARG(XrmValue *, fromVal)
-        ARG(XrmValue *, toVal)
-        GRAU(XtPointer, data)
-{
-    static XmString	*CStrTable;
-    XmString		*tblPtr;
-    char		*str;
-    char		*tmpBuf;
-    char		*nextDelim;
-    XrmValue		fVal;
-    XrmValue		tVal;
-
-    /*
-     * This converter takes no parameters
-     */
-    if (*num_args != 0)
-    {
-	XtAppWarningMsg
-	    (XtDisplayToApplicationContext(d),
-	     "cvtStringToXmStringTable",
-	     "wrongParameters",
-	     "XtToolkitError",
-	     "String to XmStringTable converter needs no extra arguments",
-	     (String *)NULL,
-	     (Cardinal *)NULL);
-    }
-
-    /*
-     * Set str and make sure there's somethin' there
-     */
-    if (!(str = (char*)fromVal->addr))
-    {
-	str = (char *)"";
-    }
-
-    /*
-     * Allocate the XmStrings + 1 for NULL termination
-     */
-    CStrTable = (XmString*)XtMalloc((getCStrCount(str) + 1) * sizeof(XmString*));
-
-    /*
-     * Use the string converter for the strings
-     */
-    tmpBuf = (char*)XtMalloc(strlen(str) + 1);
-    strcpy(tmpBuf, str);
-    str = tmpBuf;
-
-    /*
-     * Create strings
-     */
-    tblPtr = CStrTable;
-    if (*str)
-    {
-	while (str)
-	{
-	    nextDelim = getNextCStrDelim(str);
-
-	    /*
-	     * Overwrite nextDelim
-	     */
-	    if (nextDelim)
-	    {
-		*nextDelim = '\0';
-		nextDelim++;
-	    }
-
-	    /*
-	     * Convert it
-	     */
-	    fVal.size = strlen(str) + 1;
-	    fVal.addr = str;
-	    tVal.size = sizeof(XTPOINTER);
-	    tVal.addr = (XTPOINTER)tblPtr;
-
-	    /*
-	     * Call converter ourselves since this is used to create
-	     * the strings in the table we create. We need to do this
-	     * since we don't have a widget to send to the XtConvertAndStore
-	     * function. Side effects are that we can never get these
-	     * compound strings cached and that no destructor function is
-	     * called when the strings leave existance, but we nuke 'em
-	     * in the XmStringTable destuctor.
-	     */
-	    CvtStringToXmString(d, args, num_args, &fVal, &tVal, NULL);
-	    tblPtr++;
-	    str = nextDelim;
-	}
-    }
-    XtFree(tmpBuf);
-
-    /*
-     * Null terminate
-     */
-    *tblPtr = NULL;
-
-    /*
-     * Done, return result
-     */
-    if (toVal->addr == NULL)
-    {
-	toVal->addr = (XTPOINTER)&CStrTable;
-	toVal->size = sizeof(XmString);
-    }
-    else if (toVal->size < sizeof(XmString*))
-    {
-	toVal->size = sizeof(XmString*);
-	XtDisplayStringConversionWarning(d, fromVal->addr, "XmStringTable");
-
-	tblPtr = CStrTable;
-	while (*tblPtr)
-	{
-	    XmStringFree(*tblPtr);
-	}
-	XtFree((char*)CStrTable);
-	return(False);
-    }
-    else
-    {
-	*(XmString **)toVal->addr = CStrTable;
-	toVal->size = sizeof(XmString*);
-    }
-    return(True);
-}
-
-/*
- * Function:
- *      CvtXmStringTableDestructor(app, converted, data, args, num_args)
- * Description:
- *      This destructor is called by the X Toolkit Intrinsics to delete
- *	the memory allocated in CvtStringToXmString.
- * Input:
- *      app		- XtAppContext	: The Xt application context
- *	converted	- XrmValue *	: The value allocated by
- *					  CvtStringToXmStringTable
- *	data		- XtPointer	: The extra data originally passed
- *					  to the converter
- *	args		- XrmValue *	: The extra arguments originally
- *					  passed to the converter
- *	num_args	- Cardinal *	: The number of args originally
- *					  passed to the converter
- * Output:
- *      None
- */
-static void
-CvtXmStringTableDestructor
-    ARGLIST((app, converted, data, args, num_args))
-        UARG(XtAppContext, app)
-        ARG(XrmValue *, converted)
-        UARG(XtPointer, data)
-        UARG(XrmValue *, args)
-        GRAU(Cardinal *, num_args)
-{
-    XmString	*ptr = (XmString *)converted->addr;
-    while ( *ptr != NULL )
-    {
-	XmStringFree(*ptr);
-	ptr++;
-    }
-    XtFree((char*)converted->addr);
-}
-
-/*****************************************************************************
- *	GLOBAL CODE
- *****************************************************************************/
-
-/*
- * Function:
- *      RegisterBxConverters(appContext);
- * Description:
- *      This globally available function installs all the converters necessary
- *	to run BuilderXcessory generated interfaces that use compound
- *	strings. This is necessary since Motif has not supplied very smart
- *	converters.
- * Input:
- *      appContext - XtAppContext : the application context
- * Output:
- *      None
- */
-void RegisterBxConverters
-    ARGLIST((appContext))
-        GRA(XtAppContext, appContext)
-{
-    XtAppSetTypeConverter(appContext, XmRString, XmRXmString,
-			  (XtTypeConverter)&CvtStringToXmString,
-			  NULL, 0, XtCacheNone,
-                          (XtDestructor)&CvtXmStringDestructor);
-
-    XtAppSetTypeConverter(appContext, XmRString, XmRXmStringTable,
-			  (XtTypeConverter)&CvtStringToXmStringTable,
-			  NULL, 0, XtCacheNone,
-			  (XtDestructor)&CvtXmStringTableDestructor);
-}
-
-/*
- * Function:
- *      CONVERT(w, from_string, to_type, to_size, success);
- * Description:
- *      A converter wrapper for convenience from BuilderXcessory.
- * Input:
- *      w - Widget : the widget to use for conversion
- *	from_string - char * : the string to convert from
- *	to_type - char * : the type to convert to
- *	to_size - int : the size of the conversion result
- *	success - Boolean* : Set to the result value of the conversion
- * Output:
- *      None
- */
-#ifndef IGNORE_CONVERT
-XtPointer BX_CONVERT
-    ARGLIST((w, from_string, to_type, to_size, success))
-        ARG(Widget, w)
-        ARG(char *, from_string)
-        ARG(char *, to_type)
-        UARG(int, to_size)
-        GRA(Boolean *, success)
-{
-    XrmValue		fromVal, toVal;	/* resource holders		*/
-    Boolean		convResult;	/* return value			*/
-    XtPointer		val;		/* Pointer size return value    */
-
-    /*
-     * We will assume that the conversion is going to fail and change this
-     * value later if the conversion is a success.
-     */
-    *success = False;
-
-    /*
-     * Since we are converting from a string to some type we need to
-     * set the fromVal structure up with the string information that
-     * the caller passed in.
-     */
-    fromVal.size = strlen(from_string) + 1;
-    fromVal.addr = from_string;
-
-    /*
-     * Since we are not sure what type and size of data we are going to
-     * get back we will set this up so that the converter will point us
-     * at a block of valid data.
-     */
-    toVal.size = 0;
-    toVal.addr = NULL;
-
-    /*
-     * Now lets try to convert this data by calling this handy-dandy Xt
-     * routine.
-     */
-    convResult = XtConvertAndStore(w, XmRString, &fromVal, to_type, &toVal);
-
-
-    /*
-     * Now we have two conditions here.  One the conversion was a success
-     * and two the conversion failed.
-     */
-    if(!convResult)
-    {
-	/*
-	 * If this conversion failed that we can pretty much return right
-	 * here because there is nothing else we can do.
-	 */
-	return((XtPointer) NULL);
-    }
-
-    /*
-     * If we get this far that means we did the conversion and all is
-     * well.  Now we have to handle the special cases for type and
-     * size constraints.
-     */
-    if(!strcmp(to_type, "String"))
-    {
-	/*
-	 * Since strings are handled different in Xt we have to deal with
-	 * the conversion from a string to a string.  When this happens the
-	 * toVal.size will hold the strlen of the string so generic
-	 * conversion code can't handle it.  It is possible for a string to
-	 * string conversion to happen so we do have to watch for it.
-	 */
-	val = (XTPOINTER)toVal.addr;
-    }
-    else if(!strcmp(to_type, "Double"))
-    {
-	val = (XTPOINTER)((double*)toVal.addr);
-    }
-    else if(!strcmp(to_type, "Float"))
-    {
-	val = (XTPOINTER)((float*)toVal.addr);
-    }
-    else
-    {
-	/*
-	 * Here is the generic conversion return value handler.  This
-	 * just does some size specific casting so that value that we
-	 * return is in the correct bytes of the XtPointer that we
-	 * return.  Here we check all sizes from 1 to 8 bytes.
-	 */
-	switch(toVal.size)
-	{
-	case 1:
-	    val = (XTPOINTER)(*(char*)toVal.addr);
-	    break;
-	case 2:
-	    val = (XTPOINTER)(*(short*)toVal.addr);
-	    break;
-	case 4:
-	    val = (XTPOINTER)(*(int*)toVal.addr);
-	    break;
-	case 8:
-	default:
-	    val = (XTPOINTER)(*(long*)toVal.addr);
-	    break;
-	}
-    }
-
-    /*
-     * Well everything is done and the conversion was a success so lets
-     * set the success flag to True.
-     */
-    *success = convResult;
-
-    /*
-     * Finally lets return the converted value.
-     */
-    /*SUPPRESS 80*/
-    return(val);
-}
-
-#ifdef DEFINE_OLD_BXUTILS
-XtPointer CONVERT
-    ARGLIST((w, from_string, to_type, to_size, success))
-        ARG(Widget, w)
-        ARG(char *, from_string)
-        ARG(char *, to_type)
-        ARG(int, to_size)
-        GRA(Boolean *, success)
-{
-    return(BX_CONVERT(w, from_string, to_type, to_size, success));
-}
-#endif /* DEFINE_OLD_BXUTILS */
-#endif /* !IGNORE_CONVERT */
-
-/*
- * Function:
- *      MENU_POST(p, mw, ev, dispatch);
- * Description:
- *      A converter wrapper for convenience from BuilderXcessory.
- * Input:
- *      p - Widget : the widget to post
- *	mw - XtPointer : the menu widget
- *	ev - XEvent* : the event that caused the menu post
- *	dispatch - Boolean* : not used
- * Output:
- *      None
- */
-
-#ifndef IGNORE_MENU_POST
-void BX_MENU_POST
-    ARGLIST((p, mw, ev, dispatch))
-        UARG(Widget, p)
-        ARG(XtPointer, mw)
-        ARG(XEvent *, ev)
-        GRAU(Boolean *, dispatch)
-{
-    Arg	args[2];
-    int	argcnt;
-    int	button;
-    Widget m = (Widget)mw;
-    XButtonEvent *e = (XButtonEvent *)ev;
-
-    argcnt = 0;
-    XtSetArg(args[argcnt], XmNwhichButton, &button);
-    argcnt++;
-    XtGetValues(m, args, argcnt);
-    if(e->button != button) return;
-    XmMenuPosition(m, e);
-    XtManageChild(m);
-}
-
-#ifdef DEFINE_OLD_BXUTILS
-void MENU_POST
-    ARGLIST((p, mw, ev, dispatch))
-        ARG(Widget, p)
-        ARG(XtPointer, mw)
-        ARG(XEvent *, ev)
-        GRA(Boolean *, dispatch)
-{
-    BX_MENU_POST(p, mw, ev, dispatch);
-}
-#endif /* DEFINE_OLD_BXUTILS */
-#endif /* !IGNORE_MENU_POST */
-
-/*
- * Function:
- *      SET_BACKGROUND_COLOR(w, args, argcnt, bg_color);
- * Description:
- *      Sets the background color and shadows of a widget.
- * Input:
- *      w - The widget to set the background color on.
- *      args, argcnt - The argument list so far.
- *      bg_color - The new background color as a pixel.
- * Output:
- *      none
- *
- *  NOTES:  This assumes that args later in the argument list
- *          override those already in the list.  Therfore i f
- *          there are shadow colors later in the list they will win.
- *
- *          There is no need to use this function when creating a widget
- *          only when doing a set values, shadow colors are automatically
- *          calculated at creation time.
- */
-void BX_SET_BACKGROUND_COLOR
-    ARGLIST((w, args, argcnt, bg_color))
-        ARG(Widget, w)
-        ARG(ArgList, args)
-        ARG(Cardinal *, argcnt)
-        GRA(Pixel, bg_color)
-{
-    int		i;
-    int		topShadowLoc;
-    int		bottomShadowLoc;
-    int		selectLoc;
-    int		fgLoc;
-
-#if (((XmVERSION == 1) && (XmREVISION > 0)) || (XmVERSION > 1))
-
-    /*
-     * Walk through the arglist to see if the user set the top or
-     * bottom shadow colors.
-     */
-    selectLoc = topShadowLoc =  bottomShadowLoc = UNSET;
-    for (i = 0; i < *argcnt; i++)
-    {
-	if ((strcmp(args[i].name, XmNtopShadowColor) == 0) ||
-	    (strcmp(args[i].name, XmNtopShadowPixmap) == 0))
-	{
-	    topShadowLoc = i;
-	}
-	else if ((strcmp(args[i].name, XmNbottomShadowColor) == 0) ||
-		 (strcmp(args[i].name, XmNbottomShadowPixmap) == 0))
-	{
-	    bottomShadowLoc = i;
-	}
-	else if (strcmp(args[i].name, XmNarmColor) == 0)
-	{
-	    selectLoc = i;
-	}
-	else if (strcmp(args[i].name, XmNforeground) == 0)
-	{
-	    fgLoc = i;
-	}
-    }
-
-    /*
-     * If either the top or bottom shadow are not set then we
-     * need to use XmGetColors to get the shadow colors from the backgound
-     * color and add those that are not already in the arglist to the
-     * arglist.
-     *
-     */
-    if ((bottomShadowLoc == UNSET) ||
-	(topShadowLoc == UNSET) ||
-	(selectLoc == UNSET) ||
-	(fgLoc == UNSET))
-    {
-	Arg		larg[1];
-	Colormap	cmap;
-	Pixel		topShadow;
-	Pixel		bottomShadow;
-	Pixel		select;
-	Pixel		fgColor;
-
-	XtSetArg(larg[0], XmNcolormap, &cmap);
-	XtGetValues(w, larg, 1);
-	XmGetColors(XtScreen(w), cmap, bg_color,
-		    &fgColor, &topShadow, &bottomShadow, &select);
-
-	if (topShadowLoc == UNSET)
-	{
-	    XtSetArg(args[*argcnt], XmNtopShadowColor, topShadow);
-	    (*argcnt)++;
-	}
-
-	if (bottomShadowLoc == UNSET)
-	{
-	    XtSetArg(args[*argcnt], XmNbottomShadowColor, bottomShadow);
-	    (*argcnt)++;
-	}
-
-	if (selectLoc == UNSET)
-	{
-	    XtSetArg(args[*argcnt], XmNarmColor, select);
-	    (*argcnt)++;
-	}
-
-	if (fgLoc == UNSET)
-	{
-	    XtSetArg(args[*argcnt], XmNforeground, fgColor);
-	    (*argcnt)++;
-	}
-    }
-#endif
-
-    XtSetArg(args[*argcnt], XmNbackground, bg_color); (*argcnt)++;
-}
-
-#ifdef DEFINE_OLD_BXUTILS
-void SET_BACKGROUND_COLOR
-    ARGLIST((w, args, argcnt, bg_color))
-        ARG(Widget, w)
-        ARG(ArgList, args)
-        ARG(Cardinal *, argcnt)
-        GRA(Pixel, bg_color)
-{
-    BX_SET_BACKGROUND_COLOR(w, args, argcnt, bg_color);
-}
-#endif /* DEFINE_OLD_BXUTILS */
-
-/*
- * Function:
- *	w = BxFindTopShell(start);
- * Description:
- *	Go up the hierarhcy until we find a shell widget.
- * Input:
- *      start - Widget : the widget to start with.
- * Output:
- *	w - Widget : the shell widget.
- */
-#ifndef _BX_FIND_TOP_SHELL
-#define _BX_FIND_TOP_SHELL
-
-Widget BxFindTopShell
-    ARGLIST((start))
-        GRA(Widget, start)
-{
-    Widget	p;
-
-    while(p = XtParent(start))
-    {
-	start = p;
-    }
-    return(start);
-}
-#endif /* _BX_FIND_TOP_SHELL */
-
-/*
- * Function:
- *	BxWidgetIdsFromNames(ref, cbName, stringList)
- * Description:
- *	Return an array of widget ids from a list of widget names.
- * Input:
- *	ref - Widget : reference widget.
- *	cbName - char* : callback name.
- *	stringList - char*: list of widget names.
- * Output:
- *	WidgetList : array of widget IDs.
- */
-
-#ifndef _BX_WIDGETIDS_FROM_NAMES
-#define _BX_WIDGETIDS_FROM_NAMES
-
-WidgetList BxWidgetIdsFromNames
-    ARGLIST((ref, cbName, stringList))
-        ARG(Widget, ref)
-        ARG(char, *cbName)
-        GRA(char, *stringList)
-{
-    WidgetList	wgtIds = NULL;
-    int		wgtCount = 0;
-    Widget	inst;
-    Widget	current;
-    String	tmp;
-    String	start;
-    String	widget;
-    char       *ptr;
-
-    /*
-     * For backward compatibility, remove [ and ] from the list.
-     */
-    tmp = start = XtNewString(stringList);
-    if((start = strchr(start, '[')) != NULL) start++;
-    else start = tmp;
-
-    while((start && *start) && isspace(*start))
-    {
-	start++;
-    }
-    ptr = strrchr(start, ']');
-    if (ptr)
-    {
-	*ptr = '\0';
-    }
-
-    ptr = start + strlen(start) - 1;
-    while(ptr && *ptr)
-    {
-	if (isspace(*ptr))
-	{
-	    ptr--;
-	}
-	else
-	{
-	    ptr++;
-	    break;
-	}
-    }
-    if (ptr && *ptr)
-    {
-	*ptr = '\0';
-    }
-
-    /*
-     * start now points to the first character after the [.
-     * the list is now either empty, one, or more widget
-     * instance names.
-     */
-    start = strtok(start, ",");
-    while(start)
-    {
-        while((start && *start) && isspace(*start))
-        {
-            start++;
-        }
-        ptr = start + strlen(start) - 1;
-        while(ptr && *ptr)
-        {
-            if (isspace(*ptr))
-            {
-                ptr--;
-            }
-            else
-            {
-                ptr++;
-                break;
-            }
-        }
-        if (ptr && *ptr)
-        {
-            *ptr = '\0';
-        }
-
-	/*
-	 * Form a string to use with XtNameToWidget().
-	 */
-        widget = (char *)XtMalloc((strlen(start) + 2) * sizeof(char));
-        sprintf(widget, "*%s", start);
-
-	/*
-	 * Start at this level and continue up until the widget is found
-	 * or until the top of the hierarchy is reached.
-	 */
-	current = ref;
-	while (current != NULL)
-	{
-	    inst = XtNameToWidget(current, widget);
-	    if (inst != NULL )
-	    {
-		wgtCount++;
-		wgtIds = (WidgetList)XtRealloc((char *)wgtIds,
-					       wgtCount * sizeof(Widget));
-		wgtIds[wgtCount - 1] = inst;
-		break;
-	    }
-	    current = XtParent(current);
-	}
-
-	if (current == NULL)
-        {
-            printf("Callback Error (%s):\n\t\
-Cannot find widget %s\n", cbName, widget);
-        }
-        XtFree(widget);
-        start = strtok(NULL, ",");
-    }
-
-    /*
-     * NULL terminate the list.
-     */
-    wgtIds = (WidgetList)XtRealloc((char *)wgtIds,
-				   (wgtCount + 1) * sizeof(Widget));
-    wgtIds[wgtCount] = NULL;
-
-    XtFree((char *)tmp);
-    return(wgtIds);
-}
-#endif /* _BX_WIDGETIDS_FROM_NAMES */
-
-XtPointer BX_SINGLE
-    ARGLIST((val))
-    GRA(float, val)
-{
-    XtPointer pointer;
-
-    pointer = (XtPointer)XtMalloc(sizeof(float));
-    if ( pointer != NULL ) *((float *)pointer) = val;
-    return(pointer);
-}
-
-#ifdef DEFINE_OLD_BXUTILS
-XtPointer SINGLE
-    ARGLIST((val))
-    GRA(float, val)
-{
-    return(BX_SINGLE(val));
-}
-#endif /* DEFINE_OLD_BXUTILS */
-
-XtPointer BX_DOUBLE
-    ARGLIST((val))
-    GRA(double, val)
-{
-    XtPointer	pointer;
-
-    pointer = (XtPointer)XtMalloc(sizeof(double));
-    if ( pointer != NULL ) *((double *)pointer) = val;
-    return(pointer);
-}
-
-#ifdef DEFINE_OLD_BXUTILS
-XtPointer DOUBLE
-    ARGLIST((val))
-    GRA(double, val)
-{
-    return(BX_DOUBLE(val));
-}
-#endif /* DEFINE_OLD_BXUTILS */
-
-
-/****************************************************************************
- *
- * Big chunk of code inserted from Bull (based on modified 3.3)
- *
- ****************************************************************************/
-
-#ifndef IGNORE_XPM_PIXMAP
-
-#ifndef USE_XPM_LIBRARY
-
-#ifdef SYSV
-#include <memory.h>
-#endif
-
-/*
- * Copyright 1990, 1991 GROUPE BULL
- *
- * Permission to use, copy, modify, and distribute this software and its
- * documentation for any purpose and without fee is hereby granted, provided
- * that the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of GROUPE BULL not be used in advertising
- * or publicity pertaining to distribution of the software without specific,
- * written prior permission.  GROUPE BULL makes no representations about the
- * suitability of this software for any purpose.  It is provided "as is"
- * without express or implied warranty.
- *
- * GROUPE BULL disclaims all warranties with regard to this software,
- * including all implied warranties of merchantability and fitness,
- * in no event shall GROUPE BULL be liable for any special,
- * indirect or consequential damages or any damages
- * whatsoever resulting from loss of use, data or profits,
- * whether in an action of contract, negligence or other tortious
- * action, arising out of or in connection with the use
- * or performance of this software.
- *
- */
-
-/* Return ErrorStatus codes:
- * null     if full success
- * positive if partial success
- * negative if failure
- */
-
-#define BxXpmColorError    1
-#define BxXpmSuccess       0
-#define BxXpmOpenFailed   -1
-#define BxXpmFileInvalid  -2
-#define BxXpmNoMemory     -3
-#define BxXpmColorFailed  -4
-
-typedef struct {
-    char *name;                         /* Symbolic color name */
-    char *value;                        /* Color value */
-    Pixel pixel;                        /* Color pixel */
-} 	BxXpmColorSymbol;
-
-typedef struct {
-    unsigned long valuemask;            /* Specifies which attributes are
-                                         * defined */
-
-    Visual *visual;                     /* Specifies the visual to use */
-    Colormap colormap;                  /* Specifies the colormap to use */
-    unsigned int depth;                 /* Specifies the depth */
-    unsigned int width;                 /* Returns the width of the created
-                                         * pixmap */
-    unsigned int height;                /* Returns the height of the created
-                                         * pixmap */
-    unsigned int x_hotspot;             /* Returns the x hotspot's
-                                         * coordinate */
-    unsigned int y_hotspot;             /* Returns the y hotspot's
-                                         * coordinate */
-    unsigned int cpp;                   /* Specifies the number of char per
-                                         * pixel */
-    Pixel *pixels;                      /* List of used color pixels */
-    unsigned int npixels;               /* Number of pixels */
-    BxXpmColorSymbol *colorsymbols;       /* Array of color symbols to
-                                         * override */
-    unsigned int numsymbols;            /* Number of symbols */
-    char *rgb_fname;                    /* RGB text file name */
-
-    /* Infos */
-    unsigned int ncolors;               /* Number of colors */
-    char ***colorTable;                 /* Color table pointer */
-    char *hints_cmt;                    /* Comment of the hints section */
-    char *colors_cmt;                   /* Comment of the colors section */
-    char *pixels_cmt;                   /* Comment of the pixels section */
-    unsigned int mask_pixel;            /* Transparent pixel's color table
-                                         * index */
-}      BxXpmAttributes;
-
-/* Xpm attribute value masks bits */
-#define BxXpmVisual          (1L<<0)
-#define BxXpmColormap        (1L<<1)
-#define BxXpmDepth           (1L<<2)
-#define BxXpmSize            (1L<<3)      /* width & height */
-#define BxXpmHotspot         (1L<<4)      /* x_hotspot & y_hotspot */
-#define BxXpmCharsPerPixel   (1L<<5)
-#define BxXpmColorSymbols    (1L<<6)
-#define BxXpmRgbFilename     (1L<<7)
-#define BxXpmInfos           (1L<<8)      /* all infos members */
-
-#define BxXpmReturnPixels    (1L<<9)
-#define BxXpmReturnInfos     BxXpmInfos
-
-/*
- * minimal portability layer between ansi and KR C
- */
-
-/* forward declaration of functions with prototypes */
-
-#ifdef NeedFunctionPrototypes
-#define LFUNC(f, t, p) static t f p
-#else
-#define LFUNC(f, t, p) static t f()
-#endif
-
-/*
- * functions declarations
- */
-LFUNC(BxXpmCreatePixmapFromData, int, (Display * display,
-				       Drawable d,
-				       char **data,
-				       Pixmap * pixmap_return,
-				       Pixmap * shapemask_return,
-				       BxXpmAttributes * attributes));
-
-LFUNC(BxXpmCreateImageFromData, int, (Display * display,
-				      char **data,
-				      XImage ** image_return,
-				      XImage ** shapemask_return,
-				      BxXpmAttributes * attributes));
-
-LFUNC(BxXpmFreeAttributes, void, (BxXpmAttributes * attributes));
-
-typedef struct {
-    unsigned int type;
-    union {
-        FILE *file;
-        char **data;
-    }     stream;
-    char *cptr;
-    unsigned int line;
-    int CommentLength;
-    char Comment[BUFSIZ];
-    char *Bcmt, *Ecmt, Bos, Eos;
-    unsigned int InsideString;          /* used during parsing: 0 or 1
-                                         * whether we are inside or not */
-}      bxxpmData;
-
-#define BXXPMARRAY 0
-#define BXXPMFILE  1
-#define BXXPMPIPE  2
-
-typedef unsigned char byte;
-
-#define BX_TRANSPARENT_COLOR "None"        /* this must be a string! */
-
-/* number of BxXpmColorKeys */
-#define BXNKEYS 5
-
-/*
- * key numbers for visual type, they must fit along with the number key of
- * each corresponding element in BxXpmColorKeys[] defined in xpm.h
- */
-#define BXMONO    2
-#define BXGRAY4   3
-#define BXGRAY    4
-#define BXCOLOR   5
-
-/* structure containing data related to an Xpm pixmap */
-typedef struct {
-    char *name;
-    unsigned int width;
-    unsigned int height;
-    unsigned int cpp;
-    unsigned int ncolors;
-    char ***colorTable;
-    unsigned int *pixelindex;
-    XColor *xcolors;
-    char **colorStrings;
-    unsigned int mask_pixel;            /* mask pixel's colorTable index */
-}      bxxpmInternAttrib;
-
-#define BX_UNDEF_PIXEL 0x80000000
-
-char *BxXpmColorKeys[] =
-{
- (char *)"s",				/* key #1: symbol */
- (char *)"m",				/* key #2: mono visual */
- (char *)"g4",				/* key #3: 4 grays visual */
- (char *)"g",				/* key #4: gray visual */
- (char *)"c",				/* key #5: color visual */
-};
-
-/* XPM private routines */
-
-LFUNC(xpmCreateImage, int, (Display * display,
-                           bxxpmInternAttrib * attrib,
-                           XImage ** image_return,
-                           XImage ** shapeimage_return,
-                           BxXpmAttributes * attributes));
-
-LFUNC(xpmParseData, int, (bxxpmData * data,
-                         bxxpmInternAttrib * attrib_return,
-                         BxXpmAttributes * attributes));
-
-LFUNC(BxXpmVisualType, int, (Visual * visual));
-LFUNC(xpmFreeColorTable, void, (char ***colorTable, int ncolors));
-
-LFUNC(xpmInitInternAttrib, void, (bxxpmInternAttrib * xmpdata));
-
-LFUNC(xpmFreeInternAttrib, void, (bxxpmInternAttrib * xmpdata));
-
-LFUNC(xpmSetAttributes, void, (bxxpmInternAttrib * attrib,
-                             BxXpmAttributes * attributes));
-
-/* I/O utility */
-
-LFUNC(xpmNextString, void, (bxxpmData * mdata));
-LFUNC(xpmNextUI, int, (bxxpmData * mdata, unsigned int *ui_return));
-LFUNC(xpmGetC, int, (bxxpmData * mdata));
-LFUNC(xpmUngetC, int, (int c, bxxpmData * mdata));
-LFUNC(xpmNextWord, unsigned int, (bxxpmData * mdata, char *buf));
-LFUNC(xpmGetCmt, void, (bxxpmData * mdata, char **cmt));
-LFUNC(xpmOpenArray, int, (char **data, bxxpmData * mdata));
-LFUNC(XpmDataClose, void, (bxxpmData * mdata));
-
-/* RGB utility */
-
-LFUNC(xpm_xynormalizeimagebits, void, (register unsigned char *bp,
-                                     register XImage * img));
-LFUNC(xpm_znormalizeimagebits, void, (register unsigned char *bp,
-                                    register XImage * img));
-
-/* Image utility */
-
-LFUNC(SetColor, int, (Display * display, Colormap colormap, char *colorname,
-		      unsigned int color_index, Pixel * image_pixel,
-		      Pixel * mask_pixel, unsigned int *mask_pixel_index));
-
-LFUNC(CreateXImage, int, (Display * display, Visual * visual,
-			  unsigned int depth, unsigned int width,
-			  unsigned int height, XImage ** image_return));
-
-LFUNC(SetImagePixels, void, (XImage * image, unsigned int width,
-			    unsigned int height, unsigned int *pixelindex,
-			    Pixel * pixels));
-
-LFUNC(SetImagePixels32, void, (XImage * image, unsigned int width,
-			      unsigned int height, unsigned int *pixelindex,
-			      Pixel * pixels));
-
-LFUNC(SetImagePixels16, void, (XImage * image, unsigned int width,
-			      unsigned int height, unsigned int *pixelindex,
-			      Pixel * pixels));
-
-LFUNC(SetImagePixels8, void, (XImage * image, unsigned int width,
-			     unsigned int height, unsigned int *pixelindex,
-			     Pixel * pixels));
-
-LFUNC(SetImagePixels1, void, (XImage * image, unsigned int width,
-			     unsigned int height, unsigned int *pixelindex,
-			     Pixel * pixels));
-
-LFUNC(atoui, unsigned int, (char *p, unsigned int l, unsigned int *ui_return));
-
-/*
- * Macros
- *
- * The BXXYNORMALIZE macro determines whether XY format data requires
- * normalization and calls a routine to do so if needed. The logic in
- * this module is designed for LSBFirst byte and bit order, so
- * normalization is done as required to present the data in this order.
- *
- * The BXZNORMALIZE macro performs byte and nibble order normalization if
- * required for Z format data.
- *
- * The BXXYINDEX macro computes the index to the starting byte (char) boundary
- * for a bitmap_unit containing a pixel with coordinates x and y for image
- * data in XY format.
- *
- * The BXZINDEX* macros compute the index to the starting byte (char) boundary
- * for a pixel with coordinates x and y for image data in ZPixmap format.
- *
- */
-
-#define BXXYNORMALIZE(bp, img) \
-    if ((img->byte_order == MSBFirst) || (img->bitmap_bit_order == MSBFirst)) \
-        xpm_xynormalizeimagebits((unsigned char *)(bp), img)
-
-#define BXZNORMALIZE(bp, img) \
-    if (img->byte_order == MSBFirst) \
-        xpm_znormalizeimagebits((unsigned char *)(bp), img)
-
-#define BXXYINDEX(x, y, img) \
-    ((y) * img->bytes_per_line) + \
-    (((x) + img->xoffset) / img->bitmap_unit) * (img->bitmap_unit >> 3)
-
-#define BXZINDEX(x, y, img) ((y) * img->bytes_per_line) + \
-    (((x) * img->bits_per_pixel) >> 3)
-
-#define BXZINDEX32(x, y, img) ((y) * img->bytes_per_line) + ((x) << 2)
-
-#define BXZINDEX16(x, y, img) ((y) * img->bytes_per_line) + ((x) << 1)
-
-#define BXZINDEX8(x, y, img) ((y) * img->bytes_per_line) + (x)
-
-#define BXZINDEX1(x, y, img) ((y) * img->bytes_per_line) + ((x) >> 3)
-
-#if __STDC__
-#define Const const
-#else
-#define Const
-#endif
-
-
-
-static unsigned int atoui
-ARGLIST((p, l, ui_return))
-ARG(register char *, p)
-ARG(unsigned int, l)
-GRA(unsigned int *, ui_return)
-{
-    register int n, i;
-
-    n = 0;
-    for (i = 0; i < l; i++)
-        if (*p >= '0' && *p <= '9')
-            n = n * 10 + *p++ - '0';
-        else
-            break;
-
-    if (i != 0 && i == l) {
-        *ui_return = n;
-        return 1;
-    } else
-        return 0;
-}
-
-static int BxXpmCreatePixmapFromData
-ARGLIST((display, d, data, pixmap_return, shapemask_return, attributes))
-ARG(Display *, display)
-ARG(Drawable, d)
-ARG(char **, data)
-ARG(Pixmap *, pixmap_return)
-ARG(Pixmap *, shapemask_return)
-GRA(BxXpmAttributes *,attributes)
-{
-    XImage *image, **imageptr = NULL;
-    XImage *shapeimage, **shapeimageptr = NULL;
-    int ErrorStatus;
-    XGCValues gcv;
-    GC gc;
-
-    /*
-     * initialize return values
-     */
-    if (pixmap_return) {
-        *pixmap_return = (Pixmap) NULL;
-        imageptr = ℑ
-    }
-    if (shapemask_return) {
-        *shapemask_return = (Pixmap) NULL;
-        shapeimageptr = &shapeimage;
-    }
-
-    /*
-     * create the images
-     */
-    ErrorStatus = BxXpmCreateImageFromData(display, data, imageptr,
-                                         shapeimageptr, attributes);
-    if (ErrorStatus < 0)
-        return (ErrorStatus);
-
-    /*
-     * create the pixmaps
-     */
-    if (imageptr && image) {
-        *pixmap_return = XCreatePixmap(display, d, image->width,
-                                       image->height, image->depth);
-        gcv.function = GXcopy;
-        gc = XCreateGC(display, *pixmap_return, GCFunction, &gcv);
-
-        XPutImage(display, *pixmap_return, gc, image, 0, 0, 0, 0,
-                  image->width, image->height);
-
-        XDestroyImage(image);
-        XFreeGC(display, gc);
-    }
-    if (shapeimageptr && shapeimage) {
-        *shapemask_return = XCreatePixmap(display, d, shapeimage->width,
-                                          shapeimage->height,
-                                          shapeimage->depth);
-        gcv.function = GXcopy;
-        gc = XCreateGC(display, *shapemask_return, GCFunction, &gcv);
-
-        XPutImage(display, *shapemask_return, gc, shapeimage, 0, 0, 0, 0,
-                  shapeimage->width, shapeimage->height);
-
-        XDestroyImage(shapeimage);
-        XFreeGC(display, gc);
-    }
-    return (ErrorStatus);
-}
-
-
-static int BxXpmCreateImageFromData
-ARGLIST((display, data, image_return, shapeimage_return, attributes))
-ARG(Display *,display)
-ARG(char **, data)
-ARG(XImage **, image_return)
-ARG(XImage **, shapeimage_return)
-GRA(BxXpmAttributes *, attributes)
-{
-    bxxpmData mdata;
-    int ErrorStatus;
-    bxxpmInternAttrib attrib;
-
-    /*
-     * initialize return values
-     */
-    if (image_return)
-        *image_return = NULL;
-    if (shapeimage_return)
-        *shapeimage_return = NULL;
-
-    if ((ErrorStatus = xpmOpenArray(data, &mdata)) != BxXpmSuccess)
-        return (ErrorStatus);
-
-    xpmInitInternAttrib(&attrib);
-
-    ErrorStatus = xpmParseData(&mdata, &attrib, attributes);
-
-    if (ErrorStatus == BxXpmSuccess)
-        ErrorStatus = xpmCreateImage(display, &attrib, image_return,
-                                     shapeimage_return, attributes);
-
-    if (ErrorStatus >= 0)
-        xpmSetAttributes(&attrib, attributes);
-    else if (attributes)
-        BxXpmFreeAttributes(attributes);
-
-    xpmFreeInternAttrib(&attrib);
-    XpmDataClose(&mdata);
-
-    return (ErrorStatus);
-}
-
-/*
- * open the given array to be read or written as an bxxpmData which is returned
- */
-static int xpmOpenArray
-ARGLIST((data, mdata))
-ARG(char **,data)
-GRA(bxxpmData *,mdata)
-{
-    mdata->type = BXXPMARRAY;
-    mdata->stream.data = data;
-    mdata->cptr = *data;
-    mdata->line = 0;
-    mdata->CommentLength = 0;
-    mdata->Bcmt = mdata->Ecmt = NULL;
-    mdata->Bos = mdata->Eos = '\0';
-    mdata->InsideString = 0;
-    return (BxXpmSuccess);
-}
-
-/*
- * Intialize the bxxpmInternAttrib pointers to Null to know
- * which ones must be freed later on.
- */
-static void xpmInitInternAttrib
-ARGLIST((attrib))
-GRA(bxxpmInternAttrib *,attrib)
-{
-    attrib->ncolors = 0;
-    attrib->colorTable = NULL;
-    attrib->pixelindex = NULL;
-    attrib->xcolors = NULL;
-    attrib->colorStrings = NULL;
-    attrib->mask_pixel = BX_UNDEF_PIXEL;
-}
-
-/* function call in case of error, frees only localy allocated variables */
-#undef RETURN
-#define RETURN(status) \
-  { if (colorTable) xpmFreeColorTable(colorTable, ncolors); \
-    if (chars) free(chars); \
-    if (pixelindex) free((char *)pixelindex); \
-    if (hints_cmt)  free((char *)hints_cmt); \
-    if (colors_cmt) free((char *)colors_cmt); \
-    if (pixels_cmt) free((char *)pixels_cmt); \
-    return(status); }
-
-/*
- * This function parses an Xpm file or data and store the found informations
- * in an an bxxpmInternAttrib structure which is returned.
- */
-static int xpmParseData
-ARGLIST((data, attrib_return, attributes))
-ARG(bxxpmData *,data)
-ARG(bxxpmInternAttrib *, attrib_return)
-GRA(BxXpmAttributes *, attributes)
-{
-    /* variables to return */
-    unsigned int width, height;
-    unsigned int ncolors = 0;
-    unsigned int cpp;
-    unsigned int x_hotspot, y_hotspot, hotspot = 0;
-    char ***colorTable = NULL;
-    unsigned int *pixelindex = NULL;
-    char *hints_cmt = NULL;
-    char *colors_cmt = NULL;
-    char *pixels_cmt = NULL;
-
-    /* calculation variables */
-    unsigned int rncolors = 0;		/* read number of colors, it is
-					 * different to ncolors to avoid
-					 * problem when freeing the
-					 * colorTable in case an error
-					 * occurs while reading the hints
-					 * line */
-    unsigned int key;			/* color key */
-    char *chars = NULL, buf[BUFSIZ];
-    unsigned int *iptr;
-    unsigned int a, b, x, y, l;
-
-    unsigned int curkey;		/* current color key */
-    unsigned int lastwaskey;		/* key read */
-    char curbuf[BUFSIZ];		/* current buffer */
-
-    /*
-     * read hints: width, height, ncolors, chars_per_pixel
-     */
-    if (!(xpmNextUI(data, &width) && xpmNextUI(data, &height)
-	  && xpmNextUI(data, &rncolors) && xpmNextUI(data, &cpp)))
-	RETURN(BxXpmFileInvalid);
-
-    ncolors = rncolors;
-
-    /*
-     * read hotspot coordinates if any
-     */
-    hotspot = xpmNextUI(data, &x_hotspot) && xpmNextUI(data, &y_hotspot);
-
-    /*
-     * store the hints comment line
-     */
-    if (attributes && (attributes->valuemask & BxXpmReturnInfos))
-	xpmGetCmt(data, &hints_cmt);
-
-    /*
-     * read colors
-     */
-    colorTable = (char ***) calloc(ncolors, sizeof(char **));
-    if (!colorTable)
-	RETURN(BxXpmNoMemory);
-
-    for (a = 0; a < ncolors; a++) {
-	xpmNextString(data);		/* skip the line */
-	colorTable[a] = (char **) calloc((BXNKEYS + 1), sizeof(char *));
-	if (!colorTable[a])
-	    RETURN(BxXpmNoMemory);
-
-	/*
-	 * read pixel value
-	 */
-	colorTable[a][0] = (char *) malloc(cpp);
-	if (!colorTable[a][0])
-	    RETURN(BxXpmNoMemory);
-	for (b = 0; b < cpp; b++)
-	    colorTable[a][0][b] = xpmGetC(data);
-
-	/*
-	 * read color keys and values
-	 */
-	curkey = 0;
-	lastwaskey = 0;
-	while (l = xpmNextWord(data, buf)) {
-	    if (!lastwaskey) {
-		for (key = 1; key < BXNKEYS + 1; key++)
-		    if ((strlen(BxXpmColorKeys[key - 1]) == l)
-			&& (!strncmp(BxXpmColorKeys[key - 1], buf, l)))
-			break;
-	    }
-	    if (!lastwaskey && key <= BXNKEYS) {	/* open new key */
-		if (curkey) {		/* flush string */
-		    colorTable[a][curkey] =
-			(char *) malloc(strlen(curbuf) + 1);
-		    if (!colorTable[a][curkey])
-			RETURN(BxXpmNoMemory);
-		    strcpy(colorTable[a][curkey], curbuf);
-		}
-		curkey = key;		/* set new key  */
-		curbuf[0] = '\0';	/* reset curbuf */
-		lastwaskey = 1;
-	    } else {
-		if (!curkey)
-		    RETURN(BxXpmFileInvalid);	/* key without value */
-		if (!lastwaskey)
-		    strcat(curbuf, " ");/* append space */
-		buf[l] = '\0';
-		strcat(curbuf, buf);	/* append buf */
-		lastwaskey = 0;
-	    }
-	}
-	if (!curkey)
-	    RETURN(BxXpmFileInvalid);	/* key without value */
-	colorTable[a][curkey] = (char *) malloc(strlen(curbuf) + 1);
-	if (!colorTable[a][curkey])
-	    RETURN(BxXpmNoMemory);
-	strcpy(colorTable[a][curkey], curbuf);
-    }
-
-    /*
-     * store the colors comment line
-     */
-    if (attributes && (attributes->valuemask & BxXpmReturnInfos))
-	xpmGetCmt(data, &colors_cmt);
-
-    /*
-     * read pixels and index them on color number
-     */
-    pixelindex =
-	(unsigned int *) malloc(sizeof(unsigned int) * width * height);
-    if (!pixelindex)
-	RETURN(BxXpmNoMemory);
-
-    iptr = pixelindex;
-
-    chars = (char *) malloc(cpp);
-    if (!chars)
-	RETURN(BxXpmNoMemory);
-
-    for (y = 0; y < height; y++) {
-	xpmNextString(data);
-	for (x = 0; x < width; x++, iptr++) {
-	    for (a = 0; a < cpp; a++)
-		chars[a] = xpmGetC(data);
-	    for (a = 0; a < ncolors; a++)
-		if (!strncmp(colorTable[a][0], chars, cpp))
-		    break;
-	    if (a == ncolors)
-		RETURN(BxXpmFileInvalid);	/* no color matches */
-	    *iptr = a;
-	}
-    }
-
-    /*
-     * store the pixels comment line
-     */
-    if (attributes && (attributes->valuemask & BxXpmReturnInfos))
-	xpmGetCmt(data, &pixels_cmt);
-
-    free(chars);
-
-    /*
-     * store found informations in the bxxpmInternAttrib structure
-     */
-    attrib_return->width = width;
-    attrib_return->height = height;
-    attrib_return->cpp = cpp;
-    attrib_return->ncolors = ncolors;
-    attrib_return->colorTable = colorTable;
-    attrib_return->pixelindex = pixelindex;
-
-    if (attributes) {
-	if (attributes->valuemask & BxXpmReturnInfos) {
-	    attributes->hints_cmt = hints_cmt;
-	    attributes->colors_cmt = colors_cmt;
-	    attributes->pixels_cmt = pixels_cmt;
-	}
-	if (hotspot) {
-	    attributes->x_hotspot = x_hotspot;
-	    attributes->y_hotspot = y_hotspot;
-	    attributes->valuemask |= BxXpmHotspot;
-	}
-    }
-    return (BxXpmSuccess);
-}
-
-/*
- * set the color pixel related to the given colorname,
- * return 0 if success, 1 otherwise.
- */
-
-static int SetColor
-ARGLIST((display, colormap,colorname, color_index, image_pixel, mask_pixel, mask_pixel_index))
-ARG(Display *, display)
-ARG(Colormap, colormap)
-ARG(char *, colorname)
-ARG(unsigned int, color_index)
-ARG(Pixel *, image_pixel)
-ARG(Pixel *, mask_pixel)
-GRA(unsigned int *, mask_pixel_index)
-{
-    XColor xcolor;
-
-    if (STRCASECMP(colorname, (char *)BX_TRANSPARENT_COLOR)) {
-	if (!XParseColor(display, colormap, colorname, &xcolor)
-	    || (!XAllocColor(display, colormap, &xcolor)))
-	    return (1);
-	*image_pixel = xcolor.pixel;
-	*mask_pixel = 1;
-    } else {
-	*image_pixel = 0;
-	*mask_pixel = 0;
-	*mask_pixel_index = color_index;/* store the color table index */
-    }
-    return (0);
-}
-
-/* function call in case of error, frees only localy allocated variables */
-#undef RETURN
-#define RETURN(status) \
-  { if (image) XDestroyImage(image); \
-    if (shapeimage) XDestroyImage(shapeimage); \
-    if (image_pixels) free((char *)image_pixels); \
-    if (mask_pixels) free((char *)mask_pixels); \
-    return(status); }
-
-static int xpmCreateImage
-ARGLIST((display, attrib, image_return, shapeimage_return, attributes))
-ARG(Display *, display)
-ARG(bxxpmInternAttrib *, attrib)
-ARG(XImage **, image_return)
-ARG(XImage **, shapeimage_return)
-GRA(BxXpmAttributes *, attributes)
-{
-    /* variables stored in the BxXpmAttributes structure */
-    Visual *visual;
-    Colormap colormap;
-    unsigned int depth;
-    BxXpmColorSymbol *colorsymbols;
-    unsigned int numsymbols;
-
-    /* variables to return */
-    XImage *image = NULL;
-    XImage *shapeimage = NULL;
-    unsigned int mask_pixel;
-    unsigned int ErrorStatus, ErrorStatus2;
-
-    /* calculation variables */
-    Pixel *image_pixels = NULL;
-    Pixel *mask_pixels = NULL;
-    char *colorname;
-    unsigned int a, b, l;
-    Boolean pixel_defined;
-    unsigned int key;
-
-    /*
-     * retrieve information from the BxXpmAttributes
-     */
-    if (attributes && attributes->valuemask & BxXpmColorSymbols) {
-	colorsymbols = attributes->colorsymbols;
-	numsymbols = attributes->numsymbols;
-    } else
-	numsymbols = 0;
-
-    if (attributes && attributes->valuemask & BxXpmVisual)
-	visual = attributes->visual;
-    else
-	visual = DefaultVisual(display, DefaultScreen(display));
-
-    if (attributes && attributes->valuemask & BxXpmColormap)
-	colormap = attributes->colormap;
-    else
-	colormap = DefaultColormap(display, DefaultScreen(display));
-
-    if (attributes && attributes->valuemask & BxXpmDepth)
-	depth = attributes->depth;
-    else
-	depth = DefaultDepth(display, DefaultScreen(display));
-
-
-    ErrorStatus = BxXpmSuccess;
-
-    /*
-     * alloc pixels index tables
-     */
-
-    key = BxXpmVisualType(visual);
-    image_pixels = (Pixel *) malloc(sizeof(Pixel) * attrib->ncolors);
-    if (!image_pixels)
-	RETURN(BxXpmNoMemory);
-
-    mask_pixels = (Pixel *) malloc(sizeof(Pixel) * attrib->ncolors);
-    if (!mask_pixels)
-	RETURN(BxXpmNoMemory);
-
-    mask_pixel = BX_UNDEF_PIXEL;
-
-    /*
-     * get pixel colors, store them in index tables
-     */
-    for (a = 0; a < attrib->ncolors; a++) {
-	colorname = NULL;
-	pixel_defined = False;
-
-	/*
-	 * look for a defined symbol
-	 */
-	if (numsymbols && attrib->colorTable[a][1]) {
-	    for (l = 0; l < numsymbols; l++)
-		if (!strcmp(colorsymbols[l].name, attrib->colorTable[a][1]))
-		    break;
-	    if (l != numsymbols) {
-		if (colorsymbols[l].value)
-		    colorname = colorsymbols[l].value;
-		else
-		    pixel_defined = True;
-	    }
-	}
-	if (!pixel_defined) {		/* pixel not given as symbol value */
-
-	    if (colorname) {		/* colorname given as symbol value */
-		if (!SetColor(display, colormap, colorname, a,
-			   &image_pixels[a], &mask_pixels[a], &mask_pixel))
-		    pixel_defined = True;
-		else
-		    ErrorStatus = BxXpmColorError;
-	    }
-	    b = key;
-	    while (!pixel_defined && b > 1) {
-		if (attrib->colorTable[a][b]) {
-		    if (!SetColor(display, colormap, attrib->colorTable[a][b],
-				  a, &image_pixels[a], &mask_pixels[a],
-				  &mask_pixel)) {
-			pixel_defined = True;
-			break;
-		    } else
-			ErrorStatus = BxXpmColorError;
-		}
-		b--;
-	    }
-
-	    b = key + 1;
-	    while (!pixel_defined && b < BXNKEYS + 1) {
-		if (attrib->colorTable[a][b]) {
-		    if (!SetColor(display, colormap, attrib->colorTable[a][b],
-				  a, &image_pixels[a], &mask_pixels[a],
-				  &mask_pixel)) {
-			pixel_defined = True;
-			break;
-		    } else
-			ErrorStatus = BxXpmColorError;
-		}
-		b++;
-	    }
-
-	    if (!pixel_defined)
-		RETURN(BxXpmColorFailed);
-
-	} else {
-	    image_pixels[a] = colorsymbols[l].pixel;
-	    mask_pixels[a] = 1;
-	}
-    }
-
-    /*
-     * create the image
-     */
-    if (image_return) {
-	ErrorStatus2 = CreateXImage(display, visual, depth,
-				    attrib->width, attrib->height, &image);
-	if (ErrorStatus2 != BxXpmSuccess)
-	    RETURN(ErrorStatus2);
-
-	/*
-	 * set the image data
-	 *
-	 * In case depth is 1 or bits_per_pixel is 4, 6, 8, 24 or 32 use
-	 * optimized functions, otherwise use slower but sure general one.
-	 *
-	 */
-
-	if (image->depth == 1)
-	    SetImagePixels1(image, attrib->width, attrib->height,
-			    attrib->pixelindex, image_pixels);
-	else if (image->bits_per_pixel == 8)
-	    SetImagePixels8(image, attrib->width, attrib->height,
-			    attrib->pixelindex, image_pixels);
-	else if (image->bits_per_pixel == 16)
-	    SetImagePixels16(image, attrib->width, attrib->height,
-			     attrib->pixelindex, image_pixels);
-	else if (image->bits_per_pixel == 32)
-	    SetImagePixels32(image, attrib->width, attrib->height,
-			     attrib->pixelindex, image_pixels);
-	else
-	    SetImagePixels(image, attrib->width, attrib->height,
-			   attrib->pixelindex, image_pixels);
-    }
-
-    /*
-     * create the shape mask image
-     */
-    if (mask_pixel != BX_UNDEF_PIXEL && shapeimage_return) {
-	ErrorStatus2 = CreateXImage(display, visual, 1, attrib->width,
-				    attrib->height, &shapeimage);
-	if (ErrorStatus2 != BxXpmSuccess)
-	    RETURN(ErrorStatus2);
-
-	SetImagePixels1(shapeimage, attrib->width, attrib->height,
-			attrib->pixelindex, mask_pixels);
-    }
-    free((char *)mask_pixels);
-
-    /*
-     * if requested store allocated pixels in the BxXpmAttributes structure
-     */
-    if (attributes &&
-	(attributes->valuemask & BxXpmReturnInfos
-	 || attributes->valuemask & BxXpmReturnPixels)) {
-	if (mask_pixel != BX_UNDEF_PIXEL) {
-	    Pixel *pixels, *p1, *p2;
-
-	    attributes->npixels = attrib->ncolors - 1;
-	    pixels = (Pixel *) malloc(sizeof(Pixel) * attributes->npixels);
-	    if (pixels) {
-		p1 = image_pixels;
-		p2 = pixels;
-		for (a = 0; a < attrib->ncolors; a++, p1++)
-		    if (a != mask_pixel)
-			*p2++ = *p1;
-		attributes->pixels = pixels;
-	    } else {
-		/* if error just say we can't return requested data */
-		attributes->valuemask &= ~BxXpmReturnPixels;
-		attributes->valuemask &= ~BxXpmReturnInfos;
-		attributes->pixels = NULL;
-		attributes->npixels = 0;
-	    }
-	    free((char *)image_pixels);
-	} else {
-	    attributes->pixels = image_pixels;
-	    attributes->npixels = attrib->ncolors;
-	}
-	attributes->mask_pixel = mask_pixel;
-    } else
-	free((char *)image_pixels);
-
-
-    /*
-     * return created images
-     */
-    if (image_return)
-	*image_return = image;
-
-    if (shapeimage_return)
-	*shapeimage_return = shapeimage;
-
-    return (ErrorStatus);
-}
-
-
-/*
- * Create an XImage
- */
-static int CreateXImage
-ARGLIST((display, visual, depth, width, height, image_return))
-ARG(Display *, display)
-ARG(Visual *, visual)
-ARG(unsigned int, depth)
-ARG(unsigned int, width)
-ARG(unsigned int, height)
-GRA(XImage **, image_return)
-{
-    int bitmap_pad;
-
-    /* first get bitmap_pad */
-    if (depth > 16)
-	bitmap_pad = 32;
-    else if (depth > 8)
-	bitmap_pad = 16;
-    else
-	bitmap_pad = 8;
-
-    /* then create the XImage with data = NULL and bytes_per_line = 0 */
-
-    *image_return = XCreateImage(display, visual, depth, ZPixmap, 0, 0,
-				 width, height, bitmap_pad, 0);
-    if (!*image_return)
-	return (BxXpmNoMemory);
-
-    /* now that bytes_per_line must have been set properly alloc data */
-
-    (*image_return)->data =
-	(char *) malloc((*image_return)->bytes_per_line * height);
-
-    if (!(*image_return)->data) {
-	XDestroyImage(*image_return);
-	*image_return = NULL;
-	return (BxXpmNoMemory);
-    }
-    return (BxXpmSuccess);
-}
-
-
-/*
- * The functions below are written from X11R5 MIT's code (XImUtil.c)
- *
- * The idea is to have faster functions than the standard XPutPixel function
- * to build the image data. Indeed we can speed up things by supressing tests
- * performed for each pixel. We do exactly the same tests but at the image
- * level. Assuming that we use only ZPixmap images.
- */
-
-LFUNC(_putbits, void, (register char *src, int dstoffset,
-		      register int numbits, register char *dst));
-
-LFUNC(_XReverse_Bytes, void, (register unsigned char *bpt, register int nb));
-
-static unsigned char Const _reverse_byte[0x100] = {
-			    0x00, 0x80, 0x40, 0xc0, 0x20, 0xa0, 0x60, 0xe0,
-			    0x10, 0x90, 0x50, 0xd0, 0x30, 0xb0, 0x70, 0xf0,
-			    0x08, 0x88, 0x48, 0xc8, 0x28, 0xa8, 0x68, 0xe8,
-			    0x18, 0x98, 0x58, 0xd8, 0x38, 0xb8, 0x78, 0xf8,
-			    0x04, 0x84, 0x44, 0xc4, 0x24, 0xa4, 0x64, 0xe4,
-			    0x14, 0x94, 0x54, 0xd4, 0x34, 0xb4, 0x74, 0xf4,
-			    0x0c, 0x8c, 0x4c, 0xcc, 0x2c, 0xac, 0x6c, 0xec,
-			    0x1c, 0x9c, 0x5c, 0xdc, 0x3c, 0xbc, 0x7c, 0xfc,
-			    0x02, 0x82, 0x42, 0xc2, 0x22, 0xa2, 0x62, 0xe2,
-			    0x12, 0x92, 0x52, 0xd2, 0x32, 0xb2, 0x72, 0xf2,
-			    0x0a, 0x8a, 0x4a, 0xca, 0x2a, 0xaa, 0x6a, 0xea,
-			    0x1a, 0x9a, 0x5a, 0xda, 0x3a, 0xba, 0x7a, 0xfa,
-			    0x06, 0x86, 0x46, 0xc6, 0x26, 0xa6, 0x66, 0xe6,
-			    0x16, 0x96, 0x56, 0xd6, 0x36, 0xb6, 0x76, 0xf6,
-			    0x0e, 0x8e, 0x4e, 0xce, 0x2e, 0xae, 0x6e, 0xee,
-			    0x1e, 0x9e, 0x5e, 0xde, 0x3e, 0xbe, 0x7e, 0xfe,
-			    0x01, 0x81, 0x41, 0xc1, 0x21, 0xa1, 0x61, 0xe1,
-			    0x11, 0x91, 0x51, 0xd1, 0x31, 0xb1, 0x71, 0xf1,
-			    0x09, 0x89, 0x49, 0xc9, 0x29, 0xa9, 0x69, 0xe9,
-			    0x19, 0x99, 0x59, 0xd9, 0x39, 0xb9, 0x79, 0xf9,
-			    0x05, 0x85, 0x45, 0xc5, 0x25, 0xa5, 0x65, 0xe5,
-			    0x15, 0x95, 0x55, 0xd5, 0x35, 0xb5, 0x75, 0xf5,
-			    0x0d, 0x8d, 0x4d, 0xcd, 0x2d, 0xad, 0x6d, 0xed,
-			    0x1d, 0x9d, 0x5d, 0xdd, 0x3d, 0xbd, 0x7d, 0xfd,
-			    0x03, 0x83, 0x43, 0xc3, 0x23, 0xa3, 0x63, 0xe3,
-			    0x13, 0x93, 0x53, 0xd3, 0x33, 0xb3, 0x73, 0xf3,
-			    0x0b, 0x8b, 0x4b, 0xcb, 0x2b, 0xab, 0x6b, 0xeb,
-			    0x1b, 0x9b, 0x5b, 0xdb, 0x3b, 0xbb, 0x7b, 0xfb,
-			    0x07, 0x87, 0x47, 0xc7, 0x27, 0xa7, 0x67, 0xe7,
-			    0x17, 0x97, 0x57, 0xd7, 0x37, 0xb7, 0x77, 0xf7,
-			    0x0f, 0x8f, 0x4f, 0xcf, 0x2f, 0xaf, 0x6f, 0xef,
-			     0x1f, 0x9f, 0x5f, 0xdf, 0x3f, 0xbf, 0x7f, 0xff
-};
-
-static void _XReverse_Bytes
-ARGLIST((bpt, nb))
-ARG(register unsigned char *, bpt)
-GRA(register int, nb)
-{
-    do {
-	*bpt = _reverse_byte[*bpt];
-	bpt++;
-    } while (--nb > 0);
-}
-
-static void xpm_xynormalizeimagebits
-ARGLIST((bp,img))
-ARG(register unsigned char *, bp)
-GRA(register XImage *, img)
-{
-    register unsigned char c;
-
-    if (img->byte_order != img->bitmap_bit_order) {
-	switch (img->bitmap_unit) {
-
-	case 16:
-	    c = *bp;
-	    *bp = *(bp + 1);
-	    *(bp + 1) = c;
-	    break;
-
-	case 32:
-	    c = *(bp + 3);
-	    *(bp + 3) = *bp;
-	    *bp = c;
-	    c = *(bp + 2);
-	    *(bp + 2) = *(bp + 1);
-	    *(bp + 1) = c;
-	    break;
-	}
-    }
-    if (img->bitmap_bit_order == MSBFirst)
-	_XReverse_Bytes(bp, img->bitmap_unit >> 3);
-}
-
-static void xpm_znormalizeimagebits
-ARGLIST((bp,img))
-ARG(register unsigned char *, bp)
-GRA(register XImage *, img)
-{
-    register unsigned char c;
-
-    switch (img->bits_per_pixel) {
-
-    case 4:
-	*bp = ((*bp >> 4) & 0xF) | ((*bp << 4) & ~0xF);
-	break;
-
-    case 16:
-	c = *bp;
-	*bp = *(bp + 1);
-	*(bp + 1) = c;
-	break;
-
-    case 24:
-	c = *(bp + 2);
-	*(bp + 2) = *bp;
-	*bp = c;
-	break;
-
-    case 32:
-	c = *(bp + 3);
-	*(bp + 3) = *bp;
-	*bp = c;
-	c = *(bp + 2);
-	*(bp + 2) = *(bp + 1);
-	*(bp + 1) = c;
-	break;
-    }
-}
-
-static unsigned char Const _lomask[0x09] = {
-		     0x00, 0x01, 0x03, 0x07, 0x0f, 0x1f, 0x3f, 0x7f, 0xff};
-static unsigned char Const _himask[0x09] = {
-		     0xff, 0xfe, 0xfc, 0xf8, 0xf0, 0xe0, 0xc0, 0x80, 0x00};
-
-static void _putbits
-ARGLIST((src, dstoffset, numbits, dst))
-ARG(register char *, src)		/* address of source bit string */
-ARG(int, dstoffset)			/* bit offset into destination;
-					 * range is 0-31 */
-ARG(register int, numbits)		/* number of bits to copy to
-					 * destination */
-GRA(register char *, dst)		/* address of destination bit string */
-{
-    register unsigned char chlo, chhi;
-    int hibits;
-
-    dst = dst + (dstoffset >> 3);
-    dstoffset = dstoffset & 7;
-    hibits = 8 - dstoffset;
-    chlo = *dst & _lomask[dstoffset];
-    for (;;) {
-	chhi = (*src << dstoffset) & _himask[dstoffset];
-	if (numbits <= hibits) {
-	    chhi = chhi & _lomask[dstoffset + numbits];
-	    *dst = (*dst & _himask[dstoffset + numbits]) | chlo | chhi;
-	    break;
-	}
-	*dst = chhi | chlo;
-	dst++;
-	numbits = numbits - hibits;
-	chlo = (unsigned char) (*src & _himask[hibits]) >> hibits;
-	src++;
-	if (numbits <= dstoffset) {
-	    chlo = chlo & _lomask[numbits];
-	    *dst = (*dst & _himask[numbits]) | chlo;
-	    break;
-	}
-	numbits = numbits - dstoffset;
-    }
-}
-
-/*
- * Default method to write pixels into a Z image data structure.
- * The algorithm used is:
- *
- *	copy the destination bitmap_unit or Zpixel to temp
- *	normalize temp if needed
- *	copy the pixel bits into the temp
- *	renormalize temp if needed
- *	copy the temp back into the destination image data
- */
-
-static void SetImagePixels
-ARGLIST((image, width, height, pixelindex, pixels))
-ARG(XImage *, image)
-ARG(unsigned int, width)
-ARG(unsigned int, height)
-ARG(unsigned int *, pixelindex)
-GRA(Pixel *, pixels)
-{
-    Pixel pixel;
-    unsigned long px;
-    register char *src;
-    register char *dst;
-    int nbytes;
-    register unsigned int *iptr;
-    register int x, y, i;
-
-    iptr = pixelindex;
-    if (image->depth == 1) {
-	for (y = 0; y < height; y++)
-	    for (x = 0; x < width; x++, iptr++) {
-		pixel = pixels[*iptr];
-		for (i = 0, px = pixel;
-		     i < sizeof(unsigned long); i++, px >>= 8)
-		    ((unsigned char *) &pixel)[i] = (unsigned char)px;
-		src = &image->data[BXXYINDEX(x, y, image)];
-		dst = (char *) &px;
-		px = 0;
-		nbytes = image->bitmap_unit >> 3;
-		for (i = nbytes; --i >= 0;)
-		    *dst++ = *src++;
-		BXXYNORMALIZE(&px, image);
-		i = ((x + image->xoffset) % image->bitmap_unit);
-		_putbits((char *) &pixel, i, 1, (char *) &px);
-		BXXYNORMALIZE(&px, image);
-		src = (char *) &px;
-		dst = &image->data[BXXYINDEX(x, y, image)];
-		for (i = nbytes; --i >= 0;)
-		    *dst++ = *src++;
-	    }
-    } else {
-	for (y = 0; y < height; y++)
-	    for (x = 0; x < width; x++, iptr++) {
-		pixel = pixels[*iptr];
-		if (image->depth == 4)
-		    pixel &= 0xf;
-		for (i = 0, px = pixel;
-		     i < sizeof(unsigned long); i++, px >>= 8)
-		    ((unsigned char *) &pixel)[i] = (unsigned char)px;
-		src = &image->data[BXZINDEX(x, y, image)];
-		dst = (char *) &px;
-		px = 0;
-		nbytes = (image->bits_per_pixel + 7) >> 3;
-		for (i = nbytes; --i >= 0;)
-		    *dst++ = *src++;
-		BXZNORMALIZE(&px, image);
-		_putbits((char *) &pixel,
-			 (x * image->bits_per_pixel) & 7,
-			 image->bits_per_pixel, (char *) &px);
-		BXZNORMALIZE(&px, image);
-		src = (char *) &px;
-		dst = &image->data[BXZINDEX(x, y, image)];
-		for (i = nbytes; --i >= 0;)
-		    *dst++ = *src++;
-	    }
-    }
-}
-
-/*
- * write pixels into a 32-bits Z image data structure
- */
-
-#ifndef WORD64
-static unsigned long byteorderpixel = MSBFirst << 24;
-
-#endif
-
-static void SetImagePixels32
-ARGLIST((image, width, height, pixelindex, pixels))
-ARG(XImage *, image)
-ARG(unsigned int, width)
-ARG(unsigned int, height)
-ARG(unsigned int *, pixelindex)
-GRA(Pixel *, pixels)
-{
-    register unsigned char *addr;
-    register unsigned int *paddr;
-    register unsigned int *iptr;
-    register int x, y;
-
-    iptr = pixelindex;
-#ifndef WORD64
-    if (*((char *) &byteorderpixel) == image->byte_order) {
-	for (y = 0; y < height; y++)
-	    for (x = 0; x < width; x++, iptr++) {
-		paddr =
-		    (unsigned int *)(&(image->data[BXZINDEX32(x, y, image)]));
-		*paddr = (unsigned int)pixels[*iptr];
-	    }
-    } else
-#endif
-    if (image->byte_order == MSBFirst)
-	for (y = 0; y < height; y++)
-	    for (x = 0; x < width; x++, iptr++) {
-		addr = &((unsigned char *) image->data)[BXZINDEX32(x, y, image)];
-		addr[0] = (unsigned char)(pixels[*iptr] >> 24);
-		addr[1] = (unsigned char)(pixels[*iptr] >> 16);
-		addr[2] = (unsigned char)(pixels[*iptr] >> 8);
-		addr[3] = (unsigned char)(pixels[*iptr]);
-	    }
-    else
-	for (y = 0; y < height; y++)
-	    for (x = 0; x < width; x++, iptr++) {
-		addr = &((unsigned char *) image->data)[BXZINDEX32(x, y, image)];
-		addr[3] = (unsigned char)(pixels[*iptr] >> 24);
-		addr[2] = (unsigned char)(pixels[*iptr] >> 16);
-		addr[1] = (unsigned char)(pixels[*iptr] >> 8);
-		addr[0] = (unsigned char)(pixels[*iptr]);
-	    }
-}
-
-/*
- * write pixels into a 16-bits Z image data structure
- */
-
-static void SetImagePixels16
-ARGLIST((image, width, height, pixelindex, pixels))
-ARG(XImage *, image)
-ARG(unsigned int, width)
-ARG(unsigned int, height)
-ARG(unsigned int *, pixelindex)
-GRA(Pixel *, pixels)
-{
-    register unsigned char *addr;
-    register unsigned int *iptr;
-    register int x, y;
-
-    iptr = pixelindex;
-    if (image->byte_order == MSBFirst)
-	for (y = 0; y < height; y++)
-	    for (x = 0; x < width; x++, iptr++) {
-		addr = &((unsigned char *) image->data)[BXZINDEX16(x, y, image)];
-		addr[0] = (unsigned char)(pixels[*iptr] >> 8);
-		addr[1] = (unsigned char)(pixels[*iptr]);
-	    }
-    else
-	for (y = 0; y < height; y++)
-	    for (x = 0; x < width; x++, iptr++) {
-		addr = &((unsigned char *) image->data)[BXZINDEX16(x, y, image)];
-		addr[1] = (unsigned char)(pixels[*iptr] >> 8);
-		addr[0] = (unsigned char)(pixels[*iptr]);
-	    }
-}
-
-/*
- * write pixels into a 8-bits Z image data structure
- */
-
-static void SetImagePixels8
-ARGLIST((image, width, height, pixelindex, pixels))
-ARG(XImage *, image)
-ARG(unsigned int, width)
-ARG(unsigned int, height)
-ARG(unsigned int *, pixelindex)
-GRA(Pixel *, pixels)
-
-{
-    register unsigned int *iptr;
-    register int x, y;
-
-    iptr = pixelindex;
-    for (y = 0; y < height; y++)
-	for (x = 0; x < width; x++, iptr++)
-	    image->data[BXZINDEX8(x, y, image)] = (char)pixels[*iptr];
-}
-
-/*
- * write pixels into a 1-bit depth image data structure and **offset null**
- */
-
-static void SetImagePixels1
-ARGLIST((image, width, height, pixelindex, pixels))
-ARG(XImage *, image)
-ARG(unsigned int, width)
-ARG(unsigned int, height)
-ARG(unsigned int *, pixelindex)
-GRA(Pixel *, pixels)
-{
-    unsigned char bit;
-    int xoff, yoff;
-    register unsigned int *iptr;
-    register int x, y;
-
-    if (image->byte_order != image->bitmap_bit_order)
-	SetImagePixels(image, width, height, pixelindex, pixels);
-    else {
-	iptr = pixelindex;
-	if (image->bitmap_bit_order == MSBFirst)
-	    for (y = 0; y < height; y++)
-		for (x = 0; x < width; x++, iptr++) {
-		    yoff = BXZINDEX1(x, y, image);
-		    xoff = x & 7;
-		    bit = 0x80 >> xoff;
-		    if (pixels[*iptr] & 1)
-			image->data[yoff] |= bit;
-		    else
-			image->data[yoff] &= ~bit;
-		}
-	else
-	    for (y = 0; y < height; y++)
-		for (x = 0; x < width; x++, iptr++) {
-		    yoff = BXZINDEX1(x, y, image);
-		    xoff = x & 7;
-		    bit = 1 << xoff;
-		    if (pixels[*iptr] & 1)
-			image->data[yoff] |= bit;
-		    else
-			image->data[yoff] &= ~bit;
-		}
-    }
-}
-
-/*
- * Store into the BxXpmAttributes structure the required informations stored in
- * the bxxpmInternAttrib structure.
- */
-
-static void xpmSetAttributes
-ARGLIST((attrib, attributes))
-ARG(bxxpmInternAttrib *, attrib)
-GRA(BxXpmAttributes *, attributes)
-{
-    if (attributes) {
-        if (attributes->valuemask & BxXpmReturnInfos) {
-            attributes->cpp = attrib->cpp;
-            attributes->ncolors = attrib->ncolors;
-            attributes->colorTable = attrib->colorTable;
-
-            attrib->ncolors = 0;
-            attrib->colorTable = NULL;
-        }
-        attributes->width = attrib->width;
-        attributes->height = attrib->height;
-        attributes->valuemask |= BxXpmSize;
-    }
-}
-
-/*
- * Free the BxXpmAttributes structure members
- * but the structure itself
- */
-
-static void BxXpmFreeAttributes
-ARGLIST((attributes))
-GRA(BxXpmAttributes *, attributes)
-{
-    if (attributes) {
-        if (attributes->valuemask & BxXpmReturnPixels && attributes->pixels) {
-            free((char *)attributes->pixels);
-            attributes->pixels = NULL;
-            attributes->npixels = 0;
-        }
-        if (attributes->valuemask & BxXpmInfos) {
-            if (attributes->colorTable) {
-                xpmFreeColorTable(attributes->colorTable, attributes->ncolors);
-                attributes->colorTable = NULL;
-                attributes->ncolors = 0;
-            }
-            if (attributes->hints_cmt) {
-                free(attributes->hints_cmt);
-                attributes->hints_cmt = NULL;
-            }
-            if (attributes->colors_cmt) {
-                free(attributes->colors_cmt);
-                attributes->colors_cmt = NULL;
-            }
-            if (attributes->pixels_cmt) {
-                free(attributes->pixels_cmt);
-                attributes->pixels_cmt = NULL;
-            }
-            if (attributes->pixels) {
-                free((char *)attributes->pixels);
-                attributes->pixels = NULL;
-            }
-        }
-        attributes->valuemask = 0;
-    }
-}
-
-/*
- * Free the bxxpmInternAttrib pointers which have been allocated
- */
-
-static void xpmFreeInternAttrib
-ARGLIST((attrib))
-GRA(bxxpmInternAttrib *, attrib)
-{
-    unsigned int a;
-
-    if (attrib->colorTable)
-        xpmFreeColorTable(attrib->colorTable, attrib->ncolors);
-    if (attrib->pixelindex)
-        free((char *)attrib->pixelindex);
-    if (attrib->xcolors)
-        free((char *)attrib->xcolors);
-    if (attrib->colorStrings) {
-        for (a = 0; a < attrib->ncolors; a++)
-            if (attrib->colorStrings[a])
-                free((char *)attrib->colorStrings[a]);
-        free((char *)attrib->colorStrings);
-    }
-}
-
-/*
- * close the file related to the bxxpmData if any
- */
-static void XpmDataClose
-ARGLIST((mdata))
-GRA(bxxpmData *, mdata)
-{
-    switch (mdata->type) {
-    case BXXPMARRAY:
-        break;
-    case BXXPMFILE:
-        if (mdata->stream.file != (stdout) && mdata->stream.file != (stdin))
-            fclose(mdata->stream.file);
-        break;
-#ifdef ZPIPE
-    case BXXPMPIPE:
-        pclose(mdata->stream.file);
-#endif
-    }
-}
-
-/*
- * skip whitespace and compute the following unsigned int,
- * returns 1 if one is found and 0 if not
- */
-static int xpmNextUI
-ARGLIST((mdata, ui_return))
-ARG(bxxpmData *, mdata)
-GRA(unsigned int *, ui_return)
-{
-    char buf[BUFSIZ];
-    int l;
-
-    l = xpmNextWord(mdata, buf);
-    return atoui(buf, l, ui_return);
-}
-
-/*
- * get the current comment line
- */
-static void xpmGetCmt
-ARGLIST((mdata, cmt))
-ARG(bxxpmData *, mdata)
-GRA(char **, cmt)
-{
-    switch (mdata->type) {
-    case BXXPMARRAY:
-        *cmt = NULL;
-        break;
-    case BXXPMFILE:
-    case BXXPMPIPE:
-        if (mdata->CommentLength) {
-            *cmt = (char *) malloc(mdata->CommentLength + 1);
-            strncpy(*cmt, mdata->Comment, mdata->CommentLength);
-            (*cmt)[mdata->CommentLength] = '\0';
-            mdata->CommentLength = 0;
-        } else
-            *cmt = NULL;
-        break;
-    }
-}
-
-/*
- * skip to the end of the current string and the beginning of the next one
- */
-static void xpmNextString
-ARGLIST((mdata))
-GRA(bxxpmData *, mdata)
-{
-    int c;
-
-    switch (mdata->type) {
-    case BXXPMARRAY:
-        mdata->cptr = (mdata->stream.data)[++mdata->line];
-        break;
-    case BXXPMFILE:
-    case BXXPMPIPE:
-        if (mdata->Eos)
-            while ((c = xpmGetC(mdata)) != mdata->Eos && c != EOF);
-        if (mdata->Bos)                 /* if not natural XPM2 */
-            while ((c = xpmGetC(mdata)) != mdata->Bos && c != EOF);
-        break;
-    }
-}
-
-/*
- * return the current character, skipping comments
- */
-static int xpmGetC
-ARGLIST((mdata))
-GRA(bxxpmData *, mdata)
-{
-    int c;
-    register unsigned int n = 0, a;
-    unsigned int notend;
-
-    switch (mdata->type) {
-    case BXXPMARRAY:
-        return (*mdata->cptr++);
-    case BXXPMFILE:
-    case BXXPMPIPE:
-        c = getc(mdata->stream.file);
-
-        if (mdata->Bos && mdata->Eos
-            && (c == mdata->Bos || c == mdata->Eos)) {
-            /* if not natural XPM2 */
-            mdata->InsideString = !mdata->InsideString;
-            return (c);
-        }
-        if (!mdata->InsideString && mdata->Bcmt && c == mdata->Bcmt[0]) {
-            mdata->Comment[0] = c;
-
-            /*
-             * skip the string begining comment
-             */
-            do {
-                c = getc(mdata->stream.file);
-                mdata->Comment[++n] = c;
-            } while (c == mdata->Bcmt[n] && mdata->Bcmt[n] != '\0'
-                     && c != EOF);
-
-            if (mdata->Bcmt[n] != '\0') {
-                /* this wasn't the begining of a comment */
-                /* put characters back in the order that we got them */
-                for (a = n; a > 0; a--)
-                    xpmUngetC(mdata->Comment[a], mdata);
-                return (mdata->Comment[0]);
-            }
-
-            /*
-             * store comment
-             */
-            mdata->Comment[0] = mdata->Comment[n];
-            notend = 1;
-            n = 0;
-            while (notend) {
-                while (mdata->Comment[n] != mdata->Ecmt[0] && c != EOF) {
-                    c = getc(mdata->stream.file);
-                    mdata->Comment[++n] = c;
-                }
-                mdata->CommentLength = n;
-                a = 0;
-                do {
-                    c = getc(mdata->stream.file);
-                    n++;
-                    a++;
-                    mdata->Comment[n] = c;
-                } while (c == mdata->Ecmt[a] && mdata->Ecmt[a] != '\0'
-                         && c != EOF);
-                if (mdata->Ecmt[a] == '\0') {
-                    /* this is the end of the comment */
-                    notend = 0;
-                    xpmUngetC(mdata->Comment[n], mdata);
-                }
-            }
-            c = xpmGetC(mdata);
-        }
-        return (c);
-    }
-    return('\0');
-}
-
-
-/*
- * push the given character back
- */
-static int xpmUngetC
-ARGLIST((c, mdata))
-ARG(int, c)
-GRA(bxxpmData *, mdata)
-{
-    switch (mdata->type) {
-    case BXXPMARRAY:
-        return (*--mdata->cptr = c);
-    case BXXPMFILE:
-    case BXXPMPIPE:
-        if (mdata->Bos && (c == mdata->Bos || c == mdata->Eos))
-            /* if not natural XPM2 */
-            mdata->InsideString = !mdata->InsideString;
-        return (ungetc(c, mdata->stream.file));
-    }
-    return('\0');
-}
-
-/*
- * skip whitespace and return the following word
- */
-static unsigned int xpmNextWord
-ARGLIST((mdata, buf))
-ARG(bxxpmData *, mdata)
-GRA(char *, buf)
-{
-    register unsigned int n = 0;
-    int c;
-
-    switch (mdata->type) {
-    case BXXPMARRAY:
-    	c = *mdata->cptr;
-        while (isspace(c) && c != mdata->Eos)
-            {
-	    mdata->cptr++;
-    	    c = *mdata->cptr;
-	    }
-        do {
-            c = *mdata->cptr++;
-            buf[n++] = c;
-        } while (!isspace(c) && c != mdata->Eos && c != '\0');
-        n--;
-        mdata->cptr--;
-        break;
-    case BXXPMFILE:
-    case BXXPMPIPE:
-        c = xpmGetC(mdata);
-        while (isspace(c) && c != mdata->Eos)
-	    c = xpmGetC(mdata);
-        while (!isspace(c) && c != mdata->Eos && c != EOF) {
-            buf[n++] = c;
-            c = xpmGetC(mdata);
-        }
-        xpmUngetC(c, mdata);
-        break;
-    }
-    return (n);
-}
-
-static int BxXpmVisualType
-ARGLIST((visual))
-GRA(Visual *, visual)
-{
-#if defined(__cplusplus) || defined(c_plusplus)
-    switch ( visual->c_class )
-#else
-    switch ( visual->class )
-#endif
-    {
-    case StaticGray:
-    case GrayScale:
-	switch (visual->map_entries)
-	{
-	case 2:
-	    return (BXMONO);
-	case 4:
-	    return (BXGRAY4);
-	default:
-	    return (BXGRAY);
-	}
-    default:
-	return (BXCOLOR);
-    }
-}
-
-/*
- * Free the computed color table
- */
-
-static void xpmFreeColorTable
-ARGLIST((colorTable, ncolors))
-ARG(char ***, colorTable)
-GRA(int, ncolors)
-{
-    int a, b;
-
-    if (colorTable) {
-        for (a = 0; a < ncolors; a++)
-            if (colorTable[a]) {
-                for (b = 0; b < (BXNKEYS + 1); b++)
-                    if (colorTable[a][b])
-                        free(colorTable[a][b]);
-                free((char *)colorTable[a]);
-            }
-        free((char *)colorTable);
-    }
-}
-
-#else /* USE_XPM_LIBRARY */
-
-#include <xpm.h>
-
-#define BxXpmColorError    		XpmColorError
-#define BxXpmSuccess       		XpmSuccess
-#define BxXpmOpenFailed    		XpmOpenFailed
-#define BxXpmFileInvalid   		XpmFileInvalid
-#define BxXpmNoMemory      		XpmNoMemory
-#define BxXpmColorFailed   		XpmColorFailed
-
-#define BxXpmVisual        		XpmVisual
-#define BxXpmColormap      		XpmColormap
-#define BxXpmDepth         		XpmDepth
-#define BxXpmSize          		XpmSize
-#define BxXpmHotspot       		XpmHotspot
-#define BxXpmCharsPerPixel 		XpmCharsPerPixel
-#define BxXpmColorSymbols  		XpmColorSymbols
-#define BxXpmRgbFilename   		XpmRgbFilename
-#define BxXpmInfos         		XpmInfos
-
-#define BxXpmReturnPixels  		XpmReturnPixels
-#define BxXpmReturnInfos   		XpmReturnInfos
-
-#define BxXpmCreatePixmapFromData	XpmCreatePixmapFromData
-#define BxXpmCreateImageFromData	XpmCreateImageFromData
-#define BxXpmFreeAttributes		XpmFreeAttributes
-
-typedef XpmAttributes      		BxXpmAttributes;
-
-#endif /* USE_XPM_LIBRARY */
-
-Pixmap XPM_PIXMAP
-ARGLIST((w, pixmapName))
-ARG(Widget, w)
-GRA(char **, pixmapName)
-{
-    BxXpmAttributes	attributes;
-    int			argcnt;
-    Arg			args[10];
-    Pixmap		pixmap;
-    Pixmap		shape;
-    int			returnValue;
-
-    attributes.valuemask = 0;
-    attributes.depth = 0;
-    attributes.colormap = 0;
-    attributes.visual = 0;
-
-    argcnt = 0;
-    XtSetArg(args[argcnt], XmNdepth, &(attributes.depth)); argcnt++;
-    XtSetArg(args[argcnt], XmNcolormap, &(attributes.colormap)); argcnt++;
-    if ( ! XtIsWidget(w) )
-    {
-	XtGetValues(XtParent(w), args, argcnt);
-    }
-    else
-    {
-	XtGetValues(w, args, argcnt);
-    }
-
-    attributes.visual = DefaultVisual(XtDisplayOfObject(w),
-				      DefaultScreen(XtDisplayOfObject(w)));
-
-    if ( attributes.depth != 0 ) attributes.valuemask |= BxXpmDepth;
-    if ( attributes.colormap != 0 ) attributes.valuemask |= BxXpmColormap;
-    if ( attributes.visual != 0 ) attributes.valuemask |= BxXpmVisual;
-
-    returnValue = BxXpmCreatePixmapFromData(XtDisplayOfObject(w),
-				       DefaultRootWindow(XtDisplayOfObject(w)),
-				       pixmapName, &pixmap, &shape,
-				       &attributes);
-    if ( shape )
-    {
-	XFreePixmap(XtDisplayOfObject(w), shape);
-    }
-
-    switch(returnValue)
-    {
-    case BxXpmOpenFailed:
-    case BxXpmFileInvalid:
-    case BxXpmNoMemory:
-    case BxXpmColorFailed:
-	XtWarning("Could not create pixmap.");
-	return(XmUNSPECIFIED_PIXMAP);
-    default:
-	return(pixmap);
-    }
-}
-
-#endif
-
- /* This structure is for capturing app-defaults values for a Class */
-
-typedef struct _UIAppDefault
-{
-    char*		cName;		/* Class name */
-    char*		wName; 		/* Widget name */
-    char*		cInstName;	/* Name of class instance(nested) */
-    char*		wRsc;		/* Widget resource */
-    char*		value;		/* value read from app-defaults */
-} UIAppDefault;
-
-
-void setDefaultResources ARGLIST((_name, w, resourceSpec))
-ARG(char*, _name)
-ARG(Widget, w)
-GRA(String *,resourceSpec)
-{
-   int         i;
-   Display    *dpy = XtDisplay ( w );	  /* Retrieve the display pointer */
-   XrmDatabase rdb = NULL;             /* A resource data base */
-
-   /* Create an empty resource database */
-
-   rdb = XrmGetStringDatabase ( (char *)"" );
-
-   /* Add the Component resources, prepending the name of the component */
-
-   i = 0;
-   while ( resourceSpec[i] != NULL )
-   {
-       char buf[1000];
-
-       sprintf(buf, "*%s%s", _name, resourceSpec[i++]);
-       XrmPutLineResource( &rdb, buf );
-   }
-
-   /* Merge them into the Xt database, with lowest precendence */
-
-   if ( rdb )
-   {
-#if (XlibSpecificationRelease>=5)
-        XrmDatabase db = XtDatabase(dpy);
-	XrmCombineDatabase(rdb, &db, FALSE);
-#else
-        XrmMergeDatabases ( dpy->db, &rdb );
-        dpy->db = rdb;
-#endif
-    }
-}
-
-/*
- * This method gets all the resources from the app-defaults file
- * (resource databse) and fills in the table (defs) if the app default
- * value exists.
- */
-void
-InitAppDefaults ARGLIST((parent, defs))
-ARG(Widget, parent)
-GRA(UIAppDefault *, defs)
-{
-    XrmQuark		cQuark;
-    XrmQuark		rsc[10];
-    XrmRepresentation	rep;
-    XrmValue		val;
-    XrmDatabase		rdb;
-    int			rscIdx;
-
-    /* Get the database */
-
-#if (XlibSpecificationRelease >= 5)
-    if ((rdb = XrmGetDatabase(XtDisplay(parent))) == NULL)
-    {
-	return;			/*  Can't get the database */
-    }
-#else
-    Display *dpy = XtDisplay(parent);
-    if ((rdb = dpy->db) == NULL)
-    {
-	return;
-    }
-#endif
-
-    /* Look for each resource in the table */
-
-    while (defs->wName)
-    {
-	rscIdx = 0;
-
-	cQuark = XrmStringToQuark(defs->cName);	/* class quark */
-	rsc[rscIdx++] = cQuark;
-	if (defs->wName[0] == '\0')
-	{
-	    rsc[rscIdx++] = cQuark;
-	}
-	else
-	{
-	    if( strchr(defs->wName, '.') == NULL )
-	    {
-		rsc[rscIdx++] = XrmStringToQuark(defs->wName);
-	    }
-	    else
-	    {
-		/*
-		 * If we found a '.' that means that this is not
-		 * a simple widget name, but a sub specification so
-		 * we need to split this into several quarks.
-		 */
-		char *copy = XtNewString(defs->wName), *ptr;
-
-		for( ptr = strtok(copy, "."); ptr != NULL;
-		     ptr = strtok(NULL, ".") )
-		{
-		    rsc[rscIdx++] = XrmStringToQuark(ptr);
-		}
-		XtFree(copy);
-	    }
-	}
-
-	if (defs->cInstName && defs->cInstName[0] != '\0')
-	{
-	    rsc[rscIdx++] = XrmStringToQuark(defs->cInstName);
-	}
-
-	rsc[rscIdx++] = XrmStringToQuark(defs->wRsc);
-	rsc[rscIdx++] = NULLQUARK;
-
-	if (XrmQGetResource(rdb, rsc, rsc, &rep, &val))
-	{
-	    defs->value = XtNewString((char*)val.addr);
-	}
-	defs++;
-    }
-}
-
-/*
- * This method applies the app defaults for the class to a specific
- * instance. All the widgets in the path are loosly coupled (use *).
- * To override a specific instance, use a tightly coupled app defaults
- * resource line (use .).
- */
-void
-SetAppDefaults ARGLIST((w, defs, inst_name, override_inst))
-ARG(Widget,w)
-ARG(UIAppDefault*, defs)
-ARG(char*, inst_name)
-GRA(Boolean, override_inst)
-{
-   Display*		dpy = XtDisplay (w);	/*  Retrieve the display */
-   XrmDatabase		rdb = NULL;		/* A resource data base */
-   char			buf[1000];
-   char 		*appName, *appClass;
-
-   /*
-    * Protect ourselves
-    */
-   if ( inst_name == NULL ) return;
-
-   /*
-    * Create an empty resource database
-    */
-   rdb = XrmGetStringDatabase ((char *)"");
-   XtGetApplicationNameAndClass(XtDisplay(w), &appName, &appClass);
-
-   /*
-    * Add the Component resources, prepending the name of the component
-    */
-   while ( defs->wName != NULL )
-   {
-       int namelen;
-       /*
-        * We don't deal with the resource if it isn't found in the
-	* Xrm database at class initializtion time (in initAppDefaults).
-	* Special handling of class instances.
-	*/
-       if ( strchr(defs->wName, '.') )
-       {
-	   namelen = strlen(defs->wName) - strlen(strchr(defs->wName, '.'));
-       }
-       else
-       {
-	   int		wnamelen = strlen(defs->wName);
-	   int		inamelen = strlen(inst_name);
-	   namelen = (wnamelen > inamelen ? wnamelen : inamelen);
-       }
-       if ( defs->value == NULL ||
-	    (override_inst && strncmp(inst_name, defs->wName, namelen)) ||
-	    (!override_inst && defs->cInstName != NULL) )
-       {
-	   defs++;
-	   continue;
-       }
-
-       /*
-	* Build up resource database string
-	*/
-       if ( defs->cInstName != NULL )
-       {
-	   /*
-	    * Don't include class instance name if it is also
-	    * the widget instance being worked on.
-	    */
-	   if ( *defs->cInstName != '\0' )
-	   {
-	       sprintf(buf, "%s*%s*%s.%s: %s", appClass, defs->cInstName,
-		       defs->wName, defs->wRsc, defs->value);
-	   }
-	   else
-	   {
-	       sprintf(buf, "%s*%s.%s: %s",
-		       appClass, defs->wName, defs->wRsc, defs->value);
-	   }
-       }
-       else if ( *defs->wName != '\0' )
-       {
-	   sprintf(buf, "%s*%s*%s.%s: %s",
-		   appClass, inst_name, defs->wName, defs->wRsc, defs->value);
-       }
-       else
-       {
-	   sprintf(buf, "%s*%s.%s: %s",
-		   appClass, inst_name,defs->wRsc, defs->value);
-       }
-
-       XrmPutLineResource(&rdb, buf);
-       defs++;
-   }
-
-   /*
-    * Merge them into the Xt database, with lowest precendence
-    */
-   if ( rdb )
-   {
-       /*  DO NOT do an XrmDestroyDatabase(rdb) here.  This looks like a
-	* program leak, but is really an X problem.
-	*
-	* XrmCombineDatabase() squirrels away a copy of the pointers in
-	* rdb.  Either XrmCombineDatabase should save a duplicate, or else
-	* XrmCombineDatabase needs to assume responsibility for destroying
-	* rdb at the right time.  We do not know when the pointers are no
-	* longer needed.
-	*/
-#if (XlibSpecificationRelease >= 5)
-        XrmDatabase db = XtDatabase(dpy);
-	XrmCombineDatabase(rdb, &db, FALSE);
-#else
-        XrmMergeDatabases ( dpy->db, &rdb );
-        dpy->db = rdb;
-#endif
-    }
-}
diff --git a/src/mbview/mb3dsoundings_callbacks.c b/src/mbview/mb3dsoundings_callbacks.c
deleted file mode 100644
index c356ad9..0000000
--- a/src/mbview/mb3dsoundings_callbacks.c
+++ /dev/null
@@ -1,3685 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mb3dsoundings_callbacks.c		5/25/2007
- *    $Id: mb3dsoundings_callbacks.c 2239 2015-05-07 00:51:42Z caress $
- *
- *    Copyright (c) 2007-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-
-/* Begin user code block <abstract> */
-/* End user code block <abstract> */
-
-/**
- * README: This file is appended to at file generation time.
- * Edits can be made throughout the file
- */
-/*
- * Generated by the ICS Builder Xcessory (BX).
- *
- * BuilderXcessory Version 6.1.3
- * Code Generator Xcessory 6.1.3 (08/19/04) CGX Scripts 6.1 Motif 2.1
- *
- */
-/*
- * Standard includes for builtins.
- */
-#include <stdio.h>
-#include <string.h>
-#include <ctype.h>
-#include <math.h>
-
-/* Motif required Headers */
-#include <X11/StringDefs.h>
-#include <X11/cursorfont.h>
-#include <Xm/Xm.h>
-#include <Xm/MainW.h>
-#include <Xm/DialogS.h>
-#include <Xm/RepType.h>
-#include <Xm/MwmUtil.h>
-#include <Xm/BulletinB.h>
-#include <Xm/RowColumn.h>
-#include <Xm/CascadeB.h>
-#include <Xm/PushB.h>
-#include <Xm/Separator.h>
-#include <Xm/ToggleB.h>
-#include "Mb3dsdg.h"
-#include "MB3DRouteList.h"
-#include "MB3DSiteList.h"
-#include "MB3DNavList.h"
-#include "MB3DView.h"
-
-/* OpenGL include files */
-#ifdef WIN32
-#undef BOOL		/* It was defined by a chain of inclusions in the (patched) X11/Xmd.h */
-#include <windows.h>
-#endif
-
-#include <GL/gl.h>
-#include <GL/glu.h>
-#ifndef WIN32
-#	include <GL/glx.h>
-#endif
-#include "mb_glwdrawa.h"
-
-/* MBIO include files */
-#include "mb_status.h"
-#include "mb_define.h"
-
-/* Set flag to define mb3dsoundings global variables in this code block */
-#define MB3DSOUNDINGSGLOBAL
-
-/* mb3dsoundings include */
-#include "mb3dsoundingsprivate.h"
-#include "mbview.h"
-#include "mbviewprivate.h"
-
-/*------------------------------------------------------------------------------*/
-
-/* local variables */
-static Cardinal 	ac;
-static Arg      	args[256];
-static char		value_text[MB_PATH_MAXLINE];
-
-static char rcs_id[]="$Id: mb3dsoundings_callbacks.c 2239 2015-05-07 00:51:42Z caress $";
-
-/* function prototypes */
-/*------------------------------------------------------------------------------*/
-
-/*------------------------------------------------------------------------------*/
-/* code used in original BX application, not used for library */
-
-#ifndef MBVIEW_LIBRARY
-
-#include "creation-c.h"
-
-/*
- * Macros to make code look nicer between ANSI and K&R.
- */
-#ifndef ARGLIST
-#if (NeedFunctionPrototypes == 0)
-#define PROTOTYPE(p)	()
-#define ARGLIST(p)	p
-#define ARG(a, b)	a b;
-#define GRA(a, b)	a b;
-#define UARG(a, b)      a b;
-#define GRAU(a, b)      a b;
-#else
-#define PROTOTYPE(p)	p
-#define ARGLIST(p)	(
-#define ARG(a, b)	a b,
-#define GRA(a, b)	a b)
-#ifdef __cplusplus
-#define UARG(a, b)      a,
-#define GRAU(a, b)      a)
-#else
-#define UARG(a, b)      a b,
-#define GRAU(a, b)      a b)
-#endif
-#endif
-#endif
-
-Widget		BxFindTopShell PROTOTYPE((Widget));
-WidgetList	BxWidgetIdsFromNames PROTOTYPE((Widget, char*, char*));
-
-/*      Function Name:	BxExitCB
- *
- *      Description:   	This functions expects an integer to be passed in
- *		       	client data.  It calls the exit() system call with
- *			the integer value as the argument to the function.
- *
- *      Arguments:      Widget		w: 	the activating widget.
- *			XtPointer	client:	the integer exit value.
- *			XtPointer	call:	the call data (unused).
- */
-
-#ifdef VMS
-#include <stdlib.h>
-#endif
-/*---------------------------------------------------------------------------------------*/
-
-
-/* ARGSUSED */
-void
-BxExitCB ARGLIST((w, client, call))
-UARG( Widget, w)
-ARG( XtPointer, client)
-GRAU( XtPointer, call)
-{
-    long	exitValue = EXIT_FAILURE;
-    exit(exitValue);
-}
-#endif
-/*------------------------------------------------------------------------------*/
-/* code below used for mb3dsoundings library                                           */
-/*------------------------------------------------------------------------------*/
-int mb3dsoundings_startup(int verbose, Widget parent, XtAppContext app, int *error)
-{
-	/* local variables */
-	char	*function_name = "mb3dsoundings_startup";
-
-	/* set local verbosity */
-	mbs_verbose = verbose;
-
-	/* print starting debug statements */
-	if (mbs_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:                 %d\n", verbose);
-		fprintf(stderr,"dbg2       parent:                  %p\n", parent);
-		fprintf(stderr,"dbg2       app:                     %p\n", app);
-		}
-
-	/* set parent widget and app context */
-	mbs_parent_widget = parent;
-	mbs_app_context = app;
-	mbs_work_function_set = MB_NO;
-	mbs_timer_count = 0;
-
-	/* initialize window */
-	mb3dsoundings_reset();
-
-	/* set error */
-	*error = mbs_error;
-
-	/* print output debug statements */
-	if (mbs_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:        %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:       %d\n",mbs_status);
-		}
-
-	/* return */
-	return(mbs_status);
-}
-/*------------------------------------------------------------------------------*/
-int mb3dsoundings_updatecursor()
-{
-	/* deal with pick according to edit_mode */
-	if (mb3dsoundings.edit_mode == MBS_EDIT_TOGGLE)
-		{
-	  	XDefineCursor(XtDisplay(mb3dsoundings.mb3dsdg.Mb3dsdg),
-					XtWindow(mb3dsoundings.mb3dsdg.drawingArea),
-					mb3dsoundings.TargetRedCursor);
-		}
-	else if (mb3dsoundings.edit_mode == MBS_EDIT_PICK)
-		{
-	  	XDefineCursor(XtDisplay(mb3dsoundings.mb3dsdg.Mb3dsdg),
-					XtWindow(mb3dsoundings.mb3dsdg.drawingArea),
-					mb3dsoundings.TargetRedCursor);
-		}
-	else if (mb3dsoundings.edit_mode == MBS_EDIT_ERASE)
-		{
-	  	XDefineCursor(XtDisplay(mb3dsoundings.mb3dsdg.Mb3dsdg),
-					XtWindow(mb3dsoundings.mb3dsdg.drawingArea),
-					mb3dsoundings.ExchangeRedCursor);
-		}
-	else if (mb3dsoundings.edit_mode == MBS_EDIT_RESTORE)
-		{
-	  	XDefineCursor(XtDisplay(mb3dsoundings.mb3dsdg.Mb3dsdg),
-					XtWindow(mb3dsoundings.mb3dsdg.drawingArea),
-					mb3dsoundings.ExchangeGreenCursor);
-		}
-	else if (mb3dsoundings.edit_mode == MBS_EDIT_GRAB)
-		{
-	  	XDefineCursor(XtDisplay(mb3dsoundings.mb3dsdg.Mb3dsdg),
-					XtWindow(mb3dsoundings.mb3dsdg.drawingArea),
-					mb3dsoundings.TargetRedCursor);
-		}
-	else if (mb3dsoundings.edit_mode == MBS_EDIT_INFO)
-		{
-	  	XDefineCursor(XtDisplay(mb3dsoundings.mb3dsdg.Mb3dsdg),
-					XtWindow(mb3dsoundings.mb3dsdg.drawingArea),
-					mb3dsoundings.TargetBlueCursor);
-		}
-
-	/* return */
-	return(mbs_status);
-}
-/*------------------------------------------------------------------------------*/
-int mb3dsoundings_updategui()
-{
-	/* local variables */
-	struct mb3dsoundings_struct *soundingdata;
-    	int	ibiasmin, ibiasmax;
-
-	soundingdata = (struct mb3dsoundings_struct *) mb3dsoundings.soundingdata;
-
-	ibiasmin = 100 *(mb3dsoundings.irollbias / 100) - 100;
-	ibiasmax = 100 *(mb3dsoundings.irollbias / 100) + 100;
-	ac = 0;
-        XtSetArg(args[ac], XmNminimum, ibiasmin); ac++;
-        XtSetArg(args[ac], XmNmaximum, ibiasmax); ac++;
-        XtSetArg(args[ac], XmNvalue, mb3dsoundings.irollbias); ac++;
-	XtSetValues(mb3dsoundings.mb3dsdg.scale_rollbias, args, ac);
-
-	ibiasmin = 100 *(mb3dsoundings.ipitchbias / 100) - 100;
-	ibiasmax = 100 *(mb3dsoundings.ipitchbias / 100) + 100;
-	ac = 0;
-        XtSetArg(args[ac], XmNminimum, ibiasmin); ac++;
-        XtSetArg(args[ac], XmNmaximum, ibiasmax); ac++;
-        XtSetArg(args[ac], XmNvalue, mb3dsoundings.ipitchbias); ac++;
-	XtSetValues(mb3dsoundings.mb3dsdg.scale_pitchbias, args, ac);
-
-	ibiasmin = 100 *(mb3dsoundings.iheadingbias / 100) - 100;
-	ibiasmax = 100 *(mb3dsoundings.iheadingbias / 100) + 100;
-	ac = 0;
-        XtSetArg(args[ac], XmNminimum, ibiasmin); ac++;
-        XtSetArg(args[ac], XmNmaximum, ibiasmax); ac++;
-        XtSetArg(args[ac], XmNvalue, mb3dsoundings.iheadingbias); ac++;
-	XtSetValues(mb3dsoundings.mb3dsdg.scale_headingbias, args, ac);
-
-	ibiasmin = 100 *(mb3dsoundings.itimelag / 100) - 100;
-	ibiasmax = 100 *(mb3dsoundings.itimelag / 100) + 100;
-	ac = 0;
-        XtSetArg(args[ac], XmNminimum, ibiasmin); ac++;
-        XtSetArg(args[ac], XmNmaximum, ibiasmax); ac++;
-        XtSetArg(args[ac], XmNvalue, mb3dsoundings.itimelag); ac++;
-	XtSetValues(mb3dsoundings.mb3dsdg.scale_timelag, args, ac);
-
-	if (mb3dsoundings.view_boundingbox == MB_YES)
-		{
-    		XmToggleButtonSetState(mb3dsoundings.mb3dsdg.toggleButton_view_boundingbox,
-				True, False);
-		}
-	else
-		{
-    		XmToggleButtonSetState(mb3dsoundings.mb3dsdg.toggleButton_view_boundingbox,
-				False, False);
-		}
-
-	if (mb3dsoundings.view_flagged == MB_YES)
-		{
-    		XmToggleButtonSetState(mb3dsoundings.mb3dsdg.toggleButton_view_flagged,
-				True, False);
-		}
-	else
-		{
-    		XmToggleButtonSetState(mb3dsoundings.mb3dsdg.toggleButton_view_flagged,
-				False, False);
-		}
-
-	if (mb3dsoundings.view_scalewithflagged == MB_YES)
-		{
-    		XmToggleButtonSetState(mb3dsoundings.mb3dsdg.toggleButton_view_scalewithflagged,
-				True, False);
-		}
-	else
-		{
-    		XmToggleButtonSetState(mb3dsoundings.mb3dsdg.toggleButton_view_scalewithflagged,
-				False, False);
-		}
-
-	if (mb3dsoundings.view_profiles == MBS_VIEW_PROFILES_NONE)
-		{
-    		XmToggleButtonSetState(mb3dsoundings.mb3dsdg.toggleButton_view_noconnect,
-				True, False);
-    		XmToggleButtonSetState(mb3dsoundings.mb3dsdg.toggleButton_view_connectgood,
-				False, False);
-    		XmToggleButtonSetState(mb3dsoundings.mb3dsdg.toggleButton_view_connectall,
-				False, False);
-		}
-	else if (mb3dsoundings.view_profiles == MBS_VIEW_PROFILES_UNFLAGGED)
-		{
-    		XmToggleButtonSetState(mb3dsoundings.mb3dsdg.toggleButton_view_noconnect,
-				False, False);
-    		XmToggleButtonSetState(mb3dsoundings.mb3dsdg.toggleButton_view_connectgood,
-				True, False);
-    		XmToggleButtonSetState(mb3dsoundings.mb3dsdg.toggleButton_view_connectall,
-				False, False);
-		}
-	else
-		{
-    		XmToggleButtonSetState(mb3dsoundings.mb3dsdg.toggleButton_view_noconnect,
-				False, False);
-    		XmToggleButtonSetState(mb3dsoundings.mb3dsdg.toggleButton_view_connectgood,
-				False, False);
-    		XmToggleButtonSetState(mb3dsoundings.mb3dsdg.toggleButton_view_connectall,
-				True, False);
-		}
-
-	if (mb3dsoundings.mouse_mode == MBS_MOUSE_ROTATE)
-		{
-    		XmToggleButtonSetState(mb3dsoundings.mb3dsdg.toggleButton_mouse_rotate,
-				True, False);
-    		XmToggleButtonSetState(mb3dsoundings.mb3dsdg.toggleButton_mouse_panzoom,
-				False, False);
-    		XmToggleButtonSetState(mb3dsoundings.mb3dsdg.toggleButton_mouse_rotate1,
-				True, False);
-    		XmToggleButtonSetState(mb3dsoundings.mb3dsdg.toggleButton_mouse_panzoom1,
-				False, False);
-		}
-	else
-		{
-    		XmToggleButtonSetState(mb3dsoundings.mb3dsdg.toggleButton_mouse_rotate,
-				False, False);
-    		XmToggleButtonSetState(mb3dsoundings.mb3dsdg.toggleButton_mouse_panzoom,
-				True, False);
-    		XmToggleButtonSetState(mb3dsoundings.mb3dsdg.toggleButton_mouse_rotate1,
-				False, False);
-    		XmToggleButtonSetState(mb3dsoundings.mb3dsdg.toggleButton_mouse_panzoom1,
-				True, False);
-		}
-
-	/* set the mode toggles */
-	mb3dsoundings_updatemodetoggles();
-
-	/* set status label */
-	mb3dsoundings_updatestatus();
-
-	/* set edit cursor */
-	mb3dsoundings_updatecursor();
-
-	/* return */
-	return(mbs_status);
-}
-/*------------------------------------------------------------------------------*/
-int mb3dsoundings_updatemodetoggles()
-{
-	/* set the mode toggles */
-	if (mb3dsoundings.edit_mode == MBS_EDIT_TOGGLE)
-	    {
-	    XmToggleButtonSetState(mb3dsoundings.mb3dsdg.toggleButton_mouse_toggle,  TRUE, FALSE);
-	    XmToggleButtonSetState(mb3dsoundings.mb3dsdg.toggleButton_mouse_pick,    FALSE, FALSE);
-	    XmToggleButtonSetState(mb3dsoundings.mb3dsdg.toggleButton_mouse_erase,   FALSE, FALSE);
-	    XmToggleButtonSetState(mb3dsoundings.mb3dsdg.toggleButton_mouse_restore, FALSE, FALSE);
-	    XmToggleButtonSetState(mb3dsoundings.mb3dsdg.toggleButton_mouse_grab,    FALSE, FALSE);
-	    XmToggleButtonSetState(mb3dsoundings.mb3dsdg.toggleButton_mouse_info,    FALSE, FALSE);
-	    }
-	else if (mb3dsoundings.edit_mode == MBS_EDIT_PICK)
-	    {
-	    XmToggleButtonSetState(mb3dsoundings.mb3dsdg.toggleButton_mouse_toggle,  FALSE, FALSE);
-	    XmToggleButtonSetState(mb3dsoundings.mb3dsdg.toggleButton_mouse_pick,    TRUE, FALSE);
-	    XmToggleButtonSetState(mb3dsoundings.mb3dsdg.toggleButton_mouse_erase,   FALSE, FALSE);
-	    XmToggleButtonSetState(mb3dsoundings.mb3dsdg.toggleButton_mouse_restore, FALSE, FALSE);
-	    XmToggleButtonSetState(mb3dsoundings.mb3dsdg.toggleButton_mouse_grab,    FALSE, FALSE);
-	    XmToggleButtonSetState(mb3dsoundings.mb3dsdg.toggleButton_mouse_info,    FALSE, FALSE);
-	    }
-	else if (mb3dsoundings.edit_mode == MBS_EDIT_ERASE)
-	    {
-	    XmToggleButtonSetState(mb3dsoundings.mb3dsdg.toggleButton_mouse_toggle,  FALSE, FALSE);
-	    XmToggleButtonSetState(mb3dsoundings.mb3dsdg.toggleButton_mouse_pick,    FALSE, FALSE);
-	    XmToggleButtonSetState(mb3dsoundings.mb3dsdg.toggleButton_mouse_erase,   TRUE, FALSE);
-	    XmToggleButtonSetState(mb3dsoundings.mb3dsdg.toggleButton_mouse_restore, FALSE, FALSE);
-	    XmToggleButtonSetState(mb3dsoundings.mb3dsdg.toggleButton_mouse_grab,    FALSE, FALSE);
-	    XmToggleButtonSetState(mb3dsoundings.mb3dsdg.toggleButton_mouse_info,    FALSE, FALSE);
-	    }
-	else if (mb3dsoundings.edit_mode == MBS_EDIT_RESTORE)
-	    {
-	    XmToggleButtonSetState(mb3dsoundings.mb3dsdg.toggleButton_mouse_toggle,  FALSE, FALSE);
-	    XmToggleButtonSetState(mb3dsoundings.mb3dsdg.toggleButton_mouse_pick,    FALSE, FALSE);
-	    XmToggleButtonSetState(mb3dsoundings.mb3dsdg.toggleButton_mouse_erase,   FALSE, FALSE);
-	    XmToggleButtonSetState(mb3dsoundings.mb3dsdg.toggleButton_mouse_restore, TRUE, FALSE);
-	    XmToggleButtonSetState(mb3dsoundings.mb3dsdg.toggleButton_mouse_grab,    FALSE, FALSE);
-	    XmToggleButtonSetState(mb3dsoundings.mb3dsdg.toggleButton_mouse_info,    FALSE, FALSE);
-	    }
-	else if (mb3dsoundings.edit_mode == MBS_EDIT_GRAB)
-	    {
-	    XmToggleButtonSetState(mb3dsoundings.mb3dsdg.toggleButton_mouse_toggle,  FALSE, FALSE);
-	    XmToggleButtonSetState(mb3dsoundings.mb3dsdg.toggleButton_mouse_pick,    FALSE, FALSE);
-	    XmToggleButtonSetState(mb3dsoundings.mb3dsdg.toggleButton_mouse_erase,   FALSE, FALSE);
-	    XmToggleButtonSetState(mb3dsoundings.mb3dsdg.toggleButton_mouse_restore, FALSE, FALSE);
-	    XmToggleButtonSetState(mb3dsoundings.mb3dsdg.toggleButton_mouse_grab,    TRUE, FALSE);
-	    XmToggleButtonSetState(mb3dsoundings.mb3dsdg.toggleButton_mouse_info,    FALSE, FALSE);
-	    }
-	else if (mb3dsoundings.edit_mode == MBS_EDIT_INFO)
-	    {
-	    XmToggleButtonSetState(mb3dsoundings.mb3dsdg.toggleButton_mouse_toggle,  FALSE, FALSE);
-	    XmToggleButtonSetState(mb3dsoundings.mb3dsdg.toggleButton_mouse_pick,    FALSE, FALSE);
-	    XmToggleButtonSetState(mb3dsoundings.mb3dsdg.toggleButton_mouse_erase,   FALSE, FALSE);
-	    XmToggleButtonSetState(mb3dsoundings.mb3dsdg.toggleButton_mouse_restore, FALSE, FALSE);
-	    XmToggleButtonSetState(mb3dsoundings.mb3dsdg.toggleButton_mouse_grab,    FALSE, FALSE);
-	    XmToggleButtonSetState(mb3dsoundings.mb3dsdg.toggleButton_mouse_info,    TRUE, FALSE);
-	    }
-
-	/* return */
-	return(mbs_status);
-}
-/*------------------------------------------------------------------------------*/
-int mb3dsoundings_updatestatus()
-{
-	/* local variables */
-	struct mb3dsoundings_struct *soundingdata;
-	struct mb3dsoundings_sounding_struct *sounding;
-
-	soundingdata = (struct mb3dsoundings_struct *) mb3dsoundings.soundingdata;
-
-	/* if in info mode and sounding picked print info as status */
-	if (mb3dsoundings.edit_mode == MBS_EDIT_INFO
-		&& mb3dsoundings.last_sounding_defined == MB_YES)
-		{
-		sounding = (struct mb3dsoundings_sounding_struct *) &(soundingdata->soundings[mb3dsoundings.last_sounding_edited]);
-		(mb3dsoundings.mb3dsoundings_info_notify)(sounding->ifile, sounding->iping,
-							sounding->ibeam, value_text);
-fprintf(stderr,"\n%s\n",value_text);
-		}
-
-	/* else set standard status label */
-	else
-		{
-		sprintf(value_text, "Azi:%.2f | Elev: %.2f | Exager:%.2f | Tot:%d Good:%d Flagged:%d",
-			mb3dsoundings.azimuth, mb3dsoundings.elevation, mb3dsoundings.exageration,
-			soundingdata->num_soundings, soundingdata->num_soundings_unflagged,
-			soundingdata->num_soundings_flagged);
-		}
-
-	/* put up the new status string */
-	set_mbview_label_string(mb3dsoundings.mb3dsdg.label_status, value_text);
-
-	/* return */
-	return(mbs_status);
-}
-/*------------------------------------------------------------------------------*/
-int mb3dsoundings_end(int verbose, int *error)
-{
-	/* local variables */
-	char	*function_name = "mb3dsoundings_end()";
-
-	/* set local verbosity */
-	mbs_verbose = verbose;
-
-	/* print starting debug statements */
-	if (mbs_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:                 %d\n", verbose);
-		}
-
-	/* handle destruction if not already handled */
-	if (mb3dsoundings.init != MBS_WINDOW_NULL)
-	    {
-	    /* delete old glx_context if it exists */
-	    if (mb3dsoundings.glx_init == MB_YES)
-		{
-		glXDestroyContext(mb3dsoundings.dpy, mb3dsoundings.glx_context);
-		XtDestroyWidget(mb3dsoundings.glwmda);
-		mb3dsoundings.glx_init = MB_NO;
-		}
-
-	    /* destroy the topLevelShell and all its children */
-	    XtDestroyWidget(mb3dsoundings.topLevelShell);
-
-	    /* reset init flag */
-	    mb3dsoundings.init = MBS_WINDOW_NULL;
-	    }
-
-	/* reinitialize parameters */
-	mb3dsoundings_reset();
-
-	/* set flags */
-	mbs_status = MB_SUCCESS;
-	mbs_error = MB_ERROR_NO_ERROR;
-
-	/* set error */
-	*error = mbs_error;
-
-	/* print output debug statements */
-	if (mbs_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:        %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:       %d\n",mbs_status);
-		}
-
-	/* return */
-	return(mbs_status);
-}
-/*------------------------------------------------------------------------------*/
-
-int mb3dsoundings_set_dismiss_notify(int verbose, void (dismiss_notify)(), int *error)
-{
-	/* local variables */
-	char	*function_name = "mb3dsoundings_set_dismiss_notify";
-
-	/* print starting debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:                 %d\n", verbose);
-		}
-
-	/* set the function pointer */
-	mb3dsoundings.mb3dsoundings_dismiss_notify = dismiss_notify;
-
-	/* set error */
-	*error = mbs_error;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:        %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:       %d\n",mbs_status);
-		}
-
-	/* return */
-	return(mbs_status);
-}
-
-/*------------------------------------------------------------------------------*/
-int mb3dsoundings_set_edit_notify(int verbose, void (edit_notify)(int, int, int, char, int), int *error)
-{
-	/* local variables */
-	char	*function_name = "mb3dsoundings_set_edit_notify";
-
-	/* print starting debug statements */
-	if (mbs_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:                 %d\n", verbose);
-		}
-
-	/* set the function pointer */
-	mb3dsoundings.mb3dsoundings_edit_notify = edit_notify;
-
-	/* set error */
-	*error = mbs_error;
-
-	/* set error */
-	*error = mbs_error;
-
-	/* print output debug statements */
-	if (mbs_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:        %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:       %d\n",mbs_status);
-		}
-
-	/* return */
-	return(mbs_status);
-}
-
-/*------------------------------------------------------------------------------*/
-int mb3dsoundings_set_info_notify(int verbose, void (info_notify)(int, int, int, char *), int *error)
-{
-	/* local variables */
-	char	*function_name = "mb3dsoundings_set_info_notify";
-
-	/* print starting debug statements */
-	if (mbs_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:                 %d\n", verbose);
-		}
-
-	/* set the function pointer */
-	mb3dsoundings.mb3dsoundings_info_notify = info_notify;
-
-	/* set error */
-	*error = mbs_error;
-
-	/* set error */
-	*error = mbs_error;
-
-	/* print output debug statements */
-	if (mbs_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:        %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:       %d\n",mbs_status);
-		}
-
-	/* return */
-	return(mbs_status);
-}
-
-/*------------------------------------------------------------------------------*/
-int mb3dsoundings_set_bias_notify(int verbose, void (bias_notify)(double, double, double, double), int *error)
-{
-	/* local variables */
-	char	*function_name = "mb3dsoundings_set_bias_notify";
-
-	/* print starting debug statements */
-	if (mbs_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:                 %d\n", verbose);
-		}
-
-	/* set the function pointer */
-	mb3dsoundings.mb3dsoundings_bias_notify = bias_notify;
-
-	/* set error */
-	*error = mbs_error;
-
-	/* set error */
-	*error = mbs_error;
-
-	/* print output debug statements */
-	if (mbs_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:        %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:       %d\n",mbs_status);
-		}
-
-	/* return */
-	return(mbs_status);
-}
-
-/*------------------------------------------------------------------------------*/
-int mb3dsoundings_set_biasapply_notify(int verbose, void (biasapply_notify)(double, double, double, double), int *error)
-{
-	/* local variables */
-	char	*function_name = "mb3dsoundings_set_biasapply_notify";
-
-	/* print starting debug statements */
-	if (mbs_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:                 %d\n", verbose);
-		}
-
-	/* set the function pointer */
-	mb3dsoundings.mb3dsoundings_biasapply_notify = biasapply_notify;
-
-	/* set error */
-	*error = mbs_error;
-
-	/* set error */
-	*error = mbs_error;
-
-	/* print output debug statements */
-	if (mbs_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:        %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:       %d\n",mbs_status);
-		}
-
-	/* return */
-	return(mbs_status);
-}
-
-/*------------------------------------------------------------------------------*/
-int mb3dsoundings_set_colorsoundings_notify(int verbose, void (colorsoundings_notify)(int), int *error)
-{
-	/* local variables */
-	char	*function_name = "mb3dsoundings_set_colorsoundings_notify";
-
-	/* print starting debug statements */
-	if (mbs_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:                 %d\n", verbose);
-		}
-
-	/* set the function pointer */
-	mb3dsoundings.mb3dsoundings_colorsoundings_notify = colorsoundings_notify;
-
-	/* set error */
-	*error = mbs_error;
-
-	/* set error */
-	*error = mbs_error;
-
-	/* print output debug statements */
-	if (mbs_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:        %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:       %d\n",mbs_status);
-		}
-
-	/* return */
-	return(mbs_status);
-}
-
-/*------------------------------------------------------------------------------*/
-int mb3dsoundings_reset()
-{
-	/* local variables */
-	char	*function_name = "mb3dsoundings_reset";
-
-	/* print starting debug statements */
-	if (mbs_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		}
-
-	/* initialize mb3dsoungings data and parameters */
-	mb3dsoundings.init = MBS_WINDOW_NULL;
-
-	mb3dsoundings.mb3dsoundings_dismiss_notify = NULL;
-	mb3dsoundings.mb3dsoundings_edit_notify = NULL;
-	mb3dsoundings.mb3dsoundings_info_notify = NULL;
-	mb3dsoundings.mb3dsoundings_bias_notify = NULL;
-	mb3dsoundings.mb3dsoundings_biasapply_notify = NULL;
-
-	mb3dsoundings.topLevelShell = NULL;
-	mb3dsoundings.mainWindow = NULL;
-	mb3dsoundings.glwmda = NULL;
-	mb3dsoundings.dpy = NULL;
-	mb3dsoundings.vi = NULL;
-	mb3dsoundings.glx_init = MB_NO;
-	mb3dsoundings.glx_context = NULL;
-	mb3dsoundings.message_on = MB_NO;
-	mb3dsoundings.edit_mode = MBS_EDIT_TOGGLE;
-	mb3dsoundings.mouse_mode = MBS_MOUSE_ROTATE;
-	mb3dsoundings.keyreverse_mode = MB_NO;
-	mb3dsoundings.mousereverse_mode = MB_NO;
-
-	/* drawing variables */
-	mb3dsoundings.elevation = 0.0;
-	mb3dsoundings.azimuth = 0.0;
-	mb3dsoundings.exageration = 1.0;
-	mb3dsoundings.gl_width = 0;
-	mb3dsoundings.gl_height = 0;;
-	mb3dsoundings.right = -1.0;
-	mb3dsoundings.left = 1.0;
-	mb3dsoundings.top = 1.0;
-	mb3dsoundings.bottom = -1.0;
-	mb3dsoundings.aspect_ratio = 1.0;
-	mb3dsoundings.gl_offset_x = 0.0;
-	mb3dsoundings.gl_offset_y = 0.0;
-	mb3dsoundings.gl_offset_x_save = 0.0;
-	mb3dsoundings.gl_offset_y_save = 0.0;
-	mb3dsoundings.gl_size = 1.0;
-	mb3dsoundings.gl_size_save = 1.0;
-
-	/* button parameters */
-	mb3dsoundings.button1down = MB_NO;
-	mb3dsoundings.button2down = MB_NO;
-	mb3dsoundings.button3down = MB_NO;
-	mb3dsoundings.button_down_x = 0;
-	mb3dsoundings.button_down_y = 0;
-	mb3dsoundings.button_move_x = 0;
-	mb3dsoundings.button_move_y = 0;
-	mb3dsoundings.button_up_x = 0;
-	mb3dsoundings.button_up_y = 0;
-
-    	/* edit grab parameters */
-	mb3dsoundings.grab_start_defined = MB_NO;
-	mb3dsoundings.grab_end_defined = MB_NO;
-	mb3dsoundings.grab_start_x = 0;
-	mb3dsoundings.grab_start_y = 0;
-	mb3dsoundings.grab_end_x = 0;
-	mb3dsoundings.grab_end_y = 0;
-
-	/* patch test parameters */
-	mb3dsoundings.irollbias = 0;
-	mb3dsoundings.ipitchbias = 0;
-	mb3dsoundings.iheadingbias = 0;
-	mb3dsoundings.itimelag = 0;
-
-	/* view parameters */
-	mb3dsoundings.view_boundingbox = MB_YES;
-	mb3dsoundings.view_flagged = MB_YES;
-	mb3dsoundings.view_profiles = MBS_VIEW_PROFILES_NONE;
-	mb3dsoundings.view_scalewithflagged = MB_YES;
-
-	/* last sounding edited */
-	mb3dsoundings.last_sounding_defined = MB_NO;
-	mb3dsoundings.last_sounding_edited = 0;
-
-	/* print output debug statements */
-	if (mbs_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:       %d\n",mbs_status);
-		}
-
-	/* return */
-	return(mbs_status);
-}
-
-/*---------------------------------------------------------------------------------------*/
-int mb3dsoundings_open(int verbose, struct mb3dsoundings_struct *soundingdata, int *error)
-{
-	/* local variables */
-	char	*function_name = "mb3dsoundings_open";
-	XColor	XColorBlack;
-	XColor	XColorWhite;
-	XColor	XColorRed;
-	XColor	XColorGreen;
-	XColor	XColorBlue;
-	XColor	XColorCoral;
-	XColor	exact;
-
-/* fprintf(stderr,"Called mb3dsoundings_open\n"); */
-
-	/* print starting debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:       %d\n",verbose);
-		fprintf(stderr,"dbg2       soundingdata:  %p\n",soundingdata);
-		}
-
-	/* set the data pointer */
-	mb3dsoundings.soundingdata = (struct mb3dsoundings_struct *)soundingdata;
-	mb3dsoundings_scale(verbose, error);
-
-	/* if not yet created then create the MB3DView class in
-		a topLevelShell as a child of Widget parent */
-	if (mb3dsoundings.init == MBS_WINDOW_NULL)
-		{
-		ac = 0;
-		XtSetArg(args[ac], XmNtitle, "3D Soundings"); ac++;
-		XtSetArg(args[ac], XmNwidth, 800); ac++;
-		XtSetArg(args[ac], XmNheight, 600); ac++;
-		mb3dsoundings.topLevelShell = XtCreatePopupShell("topLevelShell",
-		    topLevelShellWidgetClass,
-		    mbs_parent_widget,
-		    args,
-		    ac);
-		mb3dsoundings.mainWindow = XmCreateMainWindow(
-		    mb3dsoundings.topLevelShell,
-		    "mainWindow_mb3dsoundings",
-        	    args,
-        	    ac);
-    		XtManageChild(mb3dsoundings.mainWindow);
-		Mb3dsdgCreate(&(mb3dsoundings.mb3dsdg),
-        	    mb3dsoundings.mainWindow,
-        	    "mb3dsdg",
-        	    args,
-        	    ac);
-
-		ac = 0;
-		XtSetArg(args[ac], XmNx, mb3dsoundings.gl_xo); ac++;
-		XtSetArg(args[ac], XmNy, mb3dsoundings.gl_yo); ac++;
-		XtSetArg(args[ac], XmNwidth, mb3dsoundings.gl_width + MBS_LEFT_WIDTH); ac++;
-		XtSetArg(args[ac], XmNheight, mb3dsoundings.gl_height + MBS_LEFT_HEIGHT); ac++;
-		XtSetValues(mb3dsoundings.mb3dsdg.Mb3dsdg, args, ac);
-
-    		XtManageChild(mb3dsoundings.mb3dsdg.Mb3dsdg);
-
-		/* get resize events - add event handlers */
-		XtAddEventHandler(mb3dsoundings.mb3dsdg.drawingArea,
-					StructureNotifyMask,
-					False,
-					(XtEventHandler)do_mb3dsdg_resize,
-					(XtPointer)0);
-
-		/* set the mode toggles */
-		XmToggleButtonSetState(mb3dsoundings.mb3dsdg.toggleButton_mouse_toggle, 0, FALSE);
-		XmToggleButtonSetState(mb3dsoundings.mb3dsdg.toggleButton_mouse_pick, 0, FALSE);
-		XmToggleButtonSetState(mb3dsoundings.mb3dsdg.toggleButton_mouse_erase, 0, FALSE);
-		XmToggleButtonSetState(mb3dsoundings.mb3dsdg.toggleButton_mouse_restore, 0, FALSE);
-		XmToggleButtonSetState(mb3dsoundings.mb3dsdg.toggleButton_mouse_grab, 0, FALSE);
-		XmToggleButtonSetState(mb3dsoundings.mb3dsdg.toggleButton_mouse_info, 0, FALSE);
-		if (mb3dsoundings.edit_mode == MBS_EDIT_TOGGLE)
-		    XmToggleButtonSetState(mb3dsoundings.mb3dsdg.toggleButton_mouse_toggle, 1, FALSE);
-		else if (mb3dsoundings.edit_mode == MBS_EDIT_PICK)
-		    XmToggleButtonSetState(mb3dsoundings.mb3dsdg.toggleButton_mouse_pick, 1, FALSE);
-		else if (mb3dsoundings.edit_mode == MBS_EDIT_ERASE)
-		    XmToggleButtonSetState(mb3dsoundings.mb3dsdg.toggleButton_mouse_erase, 1, FALSE);
-		else if (mb3dsoundings.edit_mode == MBS_EDIT_RESTORE)
-		    XmToggleButtonSetState(mb3dsoundings.mb3dsdg.toggleButton_mouse_restore, 1, FALSE);
-		else if (mb3dsoundings.edit_mode == MBS_EDIT_GRAB)
-		    XmToggleButtonSetState(mb3dsoundings.mb3dsdg.toggleButton_mouse_grab, 1, FALSE);
-		else if (mb3dsoundings.edit_mode == MBS_EDIT_INFO)
-		    XmToggleButtonSetState(mb3dsoundings.mb3dsdg.toggleButton_mouse_info, 1, FALSE);
-
-		/* get display and xid */
-		mb3dsoundings.dpy = (Display *) XtDisplay(mb3dsoundings.mb3dsdg.Mb3dsdg);
-		mb3dsoundings.xid = XtWindow(mb3dsoundings.mb3dsdg.drawingArea);
-
-		/* generate cursors for later use */
-		XAllocNamedColor(mb3dsoundings.dpy,
-    				    DefaultColormap(mb3dsoundings.dpy, XDefaultScreen(mb3dsoundings.dpy)),
-				    "red", &XColorRed, &exact);
-		XAllocNamedColor(mb3dsoundings.dpy,
-    				    DefaultColormap(mb3dsoundings.dpy, XDefaultScreen(mb3dsoundings.dpy)),
-				    "green", &XColorGreen, &exact);
-		XAllocNamedColor(mb3dsoundings.dpy,
-    				    DefaultColormap(mb3dsoundings.dpy, XDefaultScreen(mb3dsoundings.dpy)),
-				    "blue", &XColorBlue, &exact);
-		XAllocNamedColor(mb3dsoundings.dpy,
-    				    DefaultColormap(mb3dsoundings.dpy, XDefaultScreen(mb3dsoundings.dpy)),
-				    "black", &XColorBlack, &exact);
-		XAllocNamedColor(mb3dsoundings.dpy,
-    				    DefaultColormap(mb3dsoundings.dpy, XDefaultScreen(mb3dsoundings.dpy)),
-				    "white", &XColorWhite, &exact);
-		XAllocNamedColor(mb3dsoundings.dpy,
-    				    DefaultColormap(mb3dsoundings.dpy, XDefaultScreen(mb3dsoundings.dpy)),
-				    "coral", &XColorCoral, &exact);
-		mb3dsoundings.TargetBlackCursor = XCreateFontCursor(mb3dsoundings.dpy, XC_target);
-		mb3dsoundings.TargetGreenCursor = XCreateFontCursor(mb3dsoundings.dpy, XC_target);
-		mb3dsoundings.TargetRedCursor = XCreateFontCursor(mb3dsoundings.dpy, XC_target);
-		mb3dsoundings.TargetBlueCursor = XCreateFontCursor(mb3dsoundings.dpy, XC_target);
-		mb3dsoundings.ExchangeBlackCursor = XCreateFontCursor(mb3dsoundings.dpy, XC_exchange);
-		mb3dsoundings.ExchangeGreenCursor = XCreateFontCursor(mb3dsoundings.dpy, XC_exchange);
-		mb3dsoundings.ExchangeRedCursor = XCreateFontCursor(mb3dsoundings.dpy, XC_exchange);
-		mb3dsoundings.FleurBlackCursor = XCreateFontCursor(mb3dsoundings.dpy, XC_fleur);
-		mb3dsoundings.FleurRedCursor = XCreateFontCursor(mb3dsoundings.dpy, XC_fleur);
-		mb3dsoundings.SizingBlackCursor = XCreateFontCursor(mb3dsoundings.dpy, XC_sizing);
-		mb3dsoundings.SizingRedCursor = XCreateFontCursor(mb3dsoundings.dpy, XC_sizing);
-		mb3dsoundings.BoatBlackCursor = XCreateFontCursor(mb3dsoundings.dpy, XC_boat);
-		mb3dsoundings.BoatRedCursor = XCreateFontCursor(mb3dsoundings.dpy, XC_boat);
-		mb3dsoundings.WatchBlackCursor = XCreateFontCursor(mb3dsoundings.dpy, XC_watch);
-		mb3dsoundings.WatchRedCursor = XCreateFontCursor(mb3dsoundings.dpy, XC_watch);
-		XRecolorCursor(mb3dsoundings.dpy,mb3dsoundings.TargetRedCursor,&XColorRed,&XColorCoral);
-		XRecolorCursor(mb3dsoundings.dpy,mb3dsoundings.TargetGreenCursor,&XColorGreen,&XColorCoral);
-		XRecolorCursor(mb3dsoundings.dpy,mb3dsoundings.TargetBlueCursor,&XColorBlue,&XColorCoral);
-		XRecolorCursor(mb3dsoundings.dpy,mb3dsoundings.ExchangeRedCursor,&XColorRed,&XColorCoral);
-		XRecolorCursor(mb3dsoundings.dpy,mb3dsoundings.ExchangeGreenCursor,&XColorGreen,&XColorCoral);
-		XRecolorCursor(mb3dsoundings.dpy,mb3dsoundings.FleurRedCursor,&XColorRed,&XColorCoral);
-		XRecolorCursor(mb3dsoundings.dpy,mb3dsoundings.SizingRedCursor,&XColorRed,&XColorCoral);
-		XRecolorCursor(mb3dsoundings.dpy,mb3dsoundings.BoatRedCursor,&XColorRed,&XColorCoral);
-		XRecolorCursor(mb3dsoundings.dpy,mb3dsoundings.WatchRedCursor,&XColorRed,&XColorCoral);
-
-		mb3dsoundings.init = MBS_WINDOW_HIDDEN;
-		}
-
-    	if (mb3dsoundings.init == MBS_WINDOW_HIDDEN)
-		{
-		XtPopup(XtParent(mb3dsoundings.mainWindow), XtGrabNone);
-		mb3dsoundings.init = MBS_WINDOW_VISIBLE;
-		}
-
-	/* update gui widgets */
-	mb3dsoundings_updategui();
-
-	/* reset OpenGL */
-	mb3dsoundings_reset_glx();
-
-	/* recalculate vertical scaling */
-	mb3dsoundings_setzscale(verbose, error);
-
-	/* replot the data */
-	mb3dsoundings_plot(verbose, error);
-
-	/* set error */
-	*error = mbs_error;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:        %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:       %d\n",mbs_status);
-		}
-
-	/* return */
-	return(mbs_status);
-}
-/*------------------------------------------------------------------------------*/
-int mb3dsoundings_reset_glx()
-{
-	/* local variables */
-	char	*function_name = "mb3dsoundings_reset_glx";
-
-	/* print starting debug statements */
-	if (mbs_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		}
-/* fprintf(stderr,"mb3dsoundings_reset_glx 1\n"); */
-
-	/* delete old glx_context if it exists */
-	if (mb3dsoundings.glx_init == MB_YES)
-		{
-		glXDestroyContext(mb3dsoundings.dpy, mb3dsoundings.glx_context);
-		XtDestroyWidget(mb3dsoundings.glwmda);
-		mb3dsoundings.glx_init = MB_NO;
-		}
-
-	/* get dimensions of the drawingArea */
-	XtVaGetValues(mb3dsoundings.mb3dsdg.drawingArea,
-		XmNwidth, &mb3dsoundings.gl_width,
-		XmNheight, &mb3dsoundings.gl_height,
-		NULL);
-	mb3dsoundings.gl_width -= 20;
-	mb3dsoundings.gl_height -= 20;
-
-	/* intitialize OpenGL graphics */
-	ac = 0;
-	XtSetArg(args[ac], mbGLwNrgba, TRUE); ac++;
-	XtSetArg(args[ac], mbGLwNdepthSize, 1); ac++;
-	XtSetArg(args[ac], mbGLwNdoublebuffer, True); ac++;
-	XtSetArg(args[ac], mbGLwNallocateBackground, TRUE); ac++;
-	XtSetArg(args[ac], XmNwidth, mb3dsoundings.gl_width); ac++;
-	XtSetArg(args[ac], XmNheight, mb3dsoundings.gl_height); ac++;
-	mb3dsoundings.glwmda = mbGLwCreateMDrawingArea(mb3dsoundings.mb3dsdg.drawingArea,
-		"glwidget", args, ac);
-
-	XtManageChild (mb3dsoundings.glwmda);
-	XtAddCallback(mb3dsoundings.glwmda, "exposeCallback",
-		    &(do_mb3dsdg_glwda_expose), (XtPointer) NULL);
-	XtAddCallback(mb3dsoundings.glwmda, "resizeCallback",
-		    &(do_mb3dsdg_glwda_resize), (XtPointer) NULL);
-	XtAddCallback(mb3dsoundings.glwmda, "inputCallback",
-		    &(do_mb3dsdg_glwda_input), (XtPointer) NULL);
-
-	/* set up a new opengl context */
-	ac = 0;
-	XtSetArg(args[ac], mbGLwNvisualInfo, &(mb3dsoundings.vi)); ac++;
-	XtGetValues(mb3dsoundings.glwmda, args, ac);
-#ifdef MBV_DEBUG_GLX
-fprintf(stderr,"%s:%d:%s glXCreateContext(%p,%p)\n",
-__FILE__,__LINE__,function_name,mb3dsoundings.dpy,mb3dsoundings.vi);
-#endif
-	mb3dsoundings.glx_context = glXCreateContext(mb3dsoundings.dpy, mb3dsoundings.vi,
-                	     NULL, GL_TRUE);
-#ifdef MBV_DEBUG_GLX
-fprintf(stderr,"%s:%d:%s glXMakeCurrent(%p,%p,%p)\n",
-__FILE__,__LINE__,function_name,XtDisplay(mb3dsoundings.glwmda),XtWindow(mb3dsoundings.glwmda),mb3dsoundings.glx_context);
-#endif
-	glXMakeCurrent(XtDisplay(mb3dsoundings.glwmda),
-			XtWindow(mb3dsoundings.glwmda),
-			mb3dsoundings.glx_context);
-#ifdef MBV_GET_GLX_ERRORS
-mbview_glerrorcheck(0, __FILE__, __LINE__, function_name);
-#endif
-        glViewport(0, 0, mb3dsoundings.gl_width, mb3dsoundings.gl_height);
-	mb3dsoundings.aspect_ratio = ((float)mb3dsoundings.gl_width) / ((float)mb3dsoundings.gl_height);
-	mb3dsoundings.glx_init = MB_YES;
-
-	mb3dsoundings.dpy = (Display *) XtDisplay(mb3dsoundings.mb3dsdg.Mb3dsdg);
-	mb3dsoundings.xid = XtWindow(mb3dsoundings.mb3dsdg.drawingArea);
-	XDefineCursor(XtDisplay(mb3dsoundings.mb3dsdg.Mb3dsdg),
-			XtWindow(mb3dsoundings.mb3dsdg.drawingArea),
-			mb3dsoundings.TargetBlackCursor);
-#ifdef MBV_GET_GLX_ERRORS
-mbview_glerrorcheck(0, __FILE__, __LINE__, function_name);
-#endif
-
-	/* print output debug statements */
-	if (mbs_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",mbs_status);
-		}
-
-	/* return */
-	return(mbs_status);
-}
-
-/*------------------------------------------------------------------------------*/
-
-void
-do_mb3dsdg_resize( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-/* fprintf(stderr,"Called do_mb3dsdg_resize\n"); */
-
-	/* reset OpenGL */
-	mb3dsoundings_reset_glx();
-
-	/* replot the data */
-	mb3dsoundings_plot(mbs_verbose, &mbs_error);
-}
-
-/*---------------------------------------------------------------------------------------*/
-
-void
-do_mb3dsdg_dismiss( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-/* fprintf(stderr,"Called do_mb3dsdg_dismiss\n"); */
-
-    	XtPopdown(XtParent(mb3dsoundings.mainWindow));
-	mb3dsoundings.init = MBS_WINDOW_HIDDEN;
-	(mb3dsoundings.mb3dsoundings_dismiss_notify)();
-}
-
-/*---------------------------------------------------------------------------------------*/
-
-void
-do_mb3dsdg_mouse_toggle( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-/* fprintf(stderr,"Called do_mb3dsdg_mouse_toggle\n"); */
-
-	mb3dsoundings.edit_mode = MBS_EDIT_TOGGLE;
-
-	/* set edit cursor */
-	mb3dsoundings_updatecursor();
-
-	/* set status label */
-	mb3dsoundings_updatestatus();
-}
-
-/*------------------------------------------------------------------------------*/
-
-void
-do_mb3dsdg_mouse_pick( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-/* fprintf(stderr,"Called do_mb3dsdg_mouse_pick\n"); */
-
-	mb3dsoundings.edit_mode = MBS_EDIT_PICK;
-
-	/* set edit cursor */
-	mb3dsoundings_updatecursor();
-
-	/* set status label */
-	mb3dsoundings_updatestatus();
-}
-
-/*---------------------------------------------------------------------------------------*/
-
-void
-do_mb3dsdg_mouse_erase( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-/* fprintf(stderr,"Called do_mb3dsdg_mouse_erase\n"); */
-
-	mb3dsoundings.edit_mode = MBS_EDIT_ERASE;
-
-	/* set edit cursor */
-	mb3dsoundings_updatecursor();
-
-	/* set status label */
-	mb3dsoundings_updatestatus();
-}
-
-/*---------------------------------------------------------------------------------------*/
-
-void
-do_mb3dsdg_mouse_restore( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-/* fprintf(stderr,"Called do_mb3dsdg_mouse_restore\n"); */
-
-	mb3dsoundings.edit_mode = MBS_EDIT_RESTORE;
-
-	/* set edit cursor */
-	mb3dsoundings_updatecursor();
-
-	/* set status label */
-	mb3dsoundings_updatestatus();
-}
-
-/*---------------------------------------------------------------------------------------*/
-
-void
-do_mb3dsdg_mouse_grab( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-/* fprintf(stderr,"Called do_mb3dsdg_mouse_grab\n"); */
-
-	mb3dsoundings.edit_mode = MBS_EDIT_GRAB;
-
-	/* set edit cursor */
-	mb3dsoundings_updatecursor();
-
-	/* set status label */
-	mb3dsoundings_updatestatus();
-}
-
-/*---------------------------------------------------------------------------------------*/
-
-void
-do_mb3dsdg_mouse_info( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-/* fprintf(stderr,"Called do_mb3dsdg_mouse_info\n"); */
-
-	mb3dsoundings.edit_mode = MBS_EDIT_INFO;
-
-	/* set edit cursor */
-	mb3dsoundings_updatecursor();
-
-	/* set status label */
-	mb3dsoundings_updatestatus();
-}
-
-/*---------------------------------------------------------------------------------------*/
-
-void
-do_mb3dsdg_input( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-	XEvent  *event;
-
-    /* get event */
-    event = acs->event;
-
-/* fprintf(stderr,"--------\nCalled do_mb3dsdg_input: reason:%d type:%d\n-------\n", acs->reason, event->xany.type); */
-}
-
-/*---------------------------------------------------------------------------------------*/
-
-void
-do_mb3dsdg_glwda_expose( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-/* fprintf(stderr,"Called do_mb3dsdg_glwda_expose\n"); */
-}
-
-/*---------------------------------------------------------------------------------------*/
-
-void
-do_mb3dsdg_glwda_input( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    mbGLwDrawingAreaCallbackStruct *acs;
-    acs = (mbGLwDrawingAreaCallbackStruct*)call_data;
-	XEvent  *event;
-	KeySym keysym;
-	char buffer[1];
-	int actual;
-
-    acs = (mbGLwDrawingAreaCallbackStruct*)call_data;
-
-    /* get event */
-    event = acs->event;
-
-/* fprintf(stderr,"Called do_mb3dsdg_glwda_input: reason:%d type:%d\n", acs->reason, event->xany.type); */
-    /* If there is input in the drawing area */
-    if (acs->reason == XmCR_INPUT)
-    {
-
-      /* Check for mouse pressed. */
-      if (event->xany.type == ButtonPress)
-      {
-/* fprintf(stderr, "event->xany.type == ButtonPress  button:%d position: %d %d  mouse mode:%d\n",
-event->xbutton.button,event->xbutton.x,event->xbutton.y, mb3dsoundings.mouse_mode); */
-	  /* save location */
-	  mb3dsoundings.button_down_x = event->xbutton.x;
-	  mb3dsoundings.button_down_y = mb3dsoundings.gl_height - 1 - event->xbutton.y;
-
-	  /* If left mouse button is pushed */
-	  if (event->xbutton.button == 1)
-		{
-		/* set button1down flag */
-		mb3dsoundings.button1down = MB_YES;
-
-		/* deal with pick according to edit_mode */
-		if (mb3dsoundings.edit_mode == MBS_EDIT_TOGGLE)
-			{
-			mb3dsoundings_pick(mb3dsoundings.button_down_x,
-						mb3dsoundings.button_down_y);
-			}
-		else if (mb3dsoundings.edit_mode == MBS_EDIT_PICK)
-			{
-			mb3dsoundings_pick(mb3dsoundings.button_down_x,
-						mb3dsoundings.button_down_y);
-			}
-		else if (mb3dsoundings.edit_mode == MBS_EDIT_ERASE)
-			{
-			mb3dsoundings_eraserestore(mb3dsoundings.button_down_x,
-						mb3dsoundings.button_down_y);
-			}
-		else if (mb3dsoundings.edit_mode == MBS_EDIT_RESTORE)
-			{
-			mb3dsoundings_eraserestore(mb3dsoundings.button_down_x,
-						mb3dsoundings.button_down_y);
-			}
-		else if (mb3dsoundings.edit_mode == MBS_EDIT_GRAB)
-			{
-			mb3dsoundings_grab(mb3dsoundings.button_down_x,
-						mb3dsoundings.button_down_y, MBS_EDIT_GRAB_START);
-			}
-		else if (mb3dsoundings.edit_mode == MBS_EDIT_INFO)
-			{
-			mb3dsoundings_info(mb3dsoundings.button_down_x,
-						mb3dsoundings.button_down_y);
-
-			mb3dsoundings_updatestatus();
-			mb3dsoundings_plot(mbs_verbose, &mbs_error);
-			}
-
-		} /* end of left button events */
-
-	   /* If middle mouse button is pushed */
-	   else if (event->xbutton.button == 2)
-		{
-		/* rotate mode */
-		if (mb3dsoundings.mouse_mode == MBS_MOUSE_ROTATE)
-			{
-			/* set button2down flag */
-			mb3dsoundings.button2down = MB_YES;
-
-			/* set cursor for rotate */
-	  		XDefineCursor(XtDisplay(mb3dsoundings.mb3dsdg.Mb3dsdg),
-					XtWindow(mb3dsoundings.mb3dsdg.drawingArea),
-					mb3dsoundings.FleurBlackCursor);
-
-			mb3dsoundings.azimuth_save = mb3dsoundings.azimuth;
-			mb3dsoundings.elevation_save = mb3dsoundings.elevation;
-			}
-
-		/* pan zoom mode */
-		else if (mb3dsoundings.mouse_mode == MBS_MOUSE_PANZOOM)
-			{
-			/* set button2down flag */
-			mb3dsoundings.button2down = MB_YES;
-
-			/* set cursor for rotate */
-	  		XDefineCursor(XtDisplay(mb3dsoundings.mb3dsdg.Mb3dsdg),
-					XtWindow(mb3dsoundings.mb3dsdg.drawingArea),
-					mb3dsoundings.FleurBlackCursor);
-
-			mb3dsoundings.gl_offset_x_save = mb3dsoundings.gl_offset_x;
-			mb3dsoundings.gl_offset_y_save = mb3dsoundings.gl_offset_y;
-			}
-		} /* end of middle button events */
-
-	   /* If right mouse button is pushed */
-	   else if (event->xbutton.button == 3)
-		{
-		/* rotate mode */
-		if (mb3dsoundings.mouse_mode == MBS_MOUSE_ROTATE)
-			{
-			/* set button3down flag */
-			mb3dsoundings.button3down = MB_YES;
-
-			/* set cursor for exagerate */
-	  		XDefineCursor(XtDisplay(mb3dsoundings.mb3dsdg.Mb3dsdg),
-					XtWindow(mb3dsoundings.mb3dsdg.drawingArea),
-					mb3dsoundings.FleurBlackCursor);
-
-			mb3dsoundings.exageration_save = mb3dsoundings.exageration;
-			}
-
-		/* pan zoom mode */
-		else if (mb3dsoundings.mouse_mode == MBS_MOUSE_PANZOOM)
-			{
-			/* set button3down flag */
-			mb3dsoundings.button3down = MB_YES;
-
-			/* set cursor for exagerate */
-	  		XDefineCursor(XtDisplay(mb3dsoundings.mb3dsdg.Mb3dsdg),
-					XtWindow(mb3dsoundings.mb3dsdg.drawingArea),
-					mb3dsoundings.FleurBlackCursor);
-
-			mb3dsoundings.gl_size_save = mb3dsoundings.gl_size;
-			}
-
-		} /* end of right button events */
-
-      } /* end of button press events */
-
-      /* Check for mouse motion while pressed. */
-      if (event->xany.type == MotionNotify)
-      {
-/* fprintf(stderr, "event->xany.type == MotionNotify  %d %d  mouse mode:%d\n",
-event->xbutton.x,event->xmotion.y, mb3dsoundings.mouse_mode); */
-
-	  /* save location */
-	  mb3dsoundings.button_move_x = event->xmotion.x;
-	  mb3dsoundings.button_move_y = mb3dsoundings.gl_height - 1 - event->xmotion.y;
-
-	   /* If left mouse button is dragged */
-	  if (mb3dsoundings.button1down == MB_YES)
-		{
-
-		/* deal with pick according to edit_mode */
-		if (mb3dsoundings.edit_mode == MBS_EDIT_TOGGLE)
-			{
-			}
-		else if (mb3dsoundings.edit_mode == MBS_EDIT_PICK)
-			{
-			}
-		else if (mb3dsoundings.edit_mode == MBS_EDIT_TOGGLE)
-			{
-			}
-		else if (mb3dsoundings.edit_mode == MBS_EDIT_ERASE)
-			{
-			mb3dsoundings_eraserestore(mb3dsoundings.button_move_x,
-						mb3dsoundings.button_move_y);
-			}
-		else if (mb3dsoundings.edit_mode == MBS_EDIT_RESTORE)
-			{
-			mb3dsoundings_eraserestore(mb3dsoundings.button_move_x,
-						mb3dsoundings.button_move_y);
-			}
-		else if (mb3dsoundings.edit_mode == MBS_EDIT_GRAB)
-			{
-			mb3dsoundings_grab(mb3dsoundings.button_move_x,
-						mb3dsoundings.button_move_y, MBS_EDIT_GRAB_MOVE);
-			}
-		else if (mb3dsoundings.edit_mode == MBS_EDIT_INFO)
-			{
-			}
-
-
-		} /* end of left button events */
-
-	   /* If middle mouse button is dragged */
-	  else if (mb3dsoundings.button2down == MB_YES)
-		{
-		/* rotate mode */
-		if (mb3dsoundings.mouse_mode == MBS_MOUSE_ROTATE)
-			{
-			/* set cursor for rotate */
-	  		XDefineCursor(XtDisplay(mb3dsoundings.mb3dsdg.Mb3dsdg),
-					XtWindow(mb3dsoundings.mb3dsdg.drawingArea),
-					mb3dsoundings.FleurRedCursor);
-
-			/* rotate viewpoint of 3D map */
-			mb3dsoundings.azimuth = mb3dsoundings.azimuth_save
-				+ 180.0 * ((double)(mb3dsoundings.button_move_x
-						- mb3dsoundings.button_down_x))
-					/ ((double)mb3dsoundings.gl_width);
-			mb3dsoundings.elevation = mb3dsoundings.elevation_save
-				+ 180.0 * ((double)(mb3dsoundings.button_down_y
-						- mb3dsoundings.button_move_y))
-					/ ((double)mb3dsoundings.gl_height);
-
-			/* keep elevation and azimuth values in appropriate bounds */
-			if (mb3dsoundings.elevation > 180.0)
-				mb3dsoundings.elevation -= 360.0;
-			if (mb3dsoundings.elevation < -180.0)
-				mb3dsoundings.elevation += 360.0;
-			if (mb3dsoundings.azimuth < 0.0)
-				mb3dsoundings.azimuth += 360.0;
-			if (mb3dsoundings.azimuth > 360.0)
-				mb3dsoundings.azimuth -= 360.0;
-
-			mb3dsoundings_updatestatus();
-			mb3dsoundings_plot(mbs_verbose, &mbs_error);
-			}
-
-		/* pan zoom mode */
-		else if (mb3dsoundings.mouse_mode == MBS_MOUSE_PANZOOM)
-			{
-			/* set cursor for pan zoom */
-	  		XDefineCursor(XtDisplay(mb3dsoundings.mb3dsdg.Mb3dsdg),
-					XtWindow(mb3dsoundings.mb3dsdg.drawingArea),
-					mb3dsoundings.FleurRedCursor);
-
-			/* pan */
-			mb3dsoundings.gl_offset_x = mb3dsoundings.gl_offset_x_save
-				+ ((double)(mb3dsoundings.button_move_x
-						- mb3dsoundings.button_down_x))
-			    		* (mb3dsoundings.right - mb3dsoundings.left)
-					/ ((double)mb3dsoundings.gl_width);
-			mb3dsoundings.gl_offset_y = mb3dsoundings.gl_offset_y_save
-				+ ((double)(mb3dsoundings.button_move_y
-						- mb3dsoundings.button_down_y))
-			    		* (mb3dsoundings.top - mb3dsoundings.bottom)
-					/ ((double)mb3dsoundings.gl_width);
-
-			mb3dsoundings_updatestatus();
-			mb3dsoundings_plot(mbs_verbose, &mbs_error);
-			}
-		} /* end of middle button events */
-
-	   /* If right mouse button is dragged */
-	  else if (mb3dsoundings.button3down == MB_YES)
-		{
-		/* rotate mode */
-		if (mb3dsoundings.mouse_mode == MBS_MOUSE_ROTATE)
-			{
-			/* set cursor for exagerate */
-	  		XDefineCursor(XtDisplay(mb3dsoundings.mb3dsdg.Mb3dsdg),
-					XtWindow(mb3dsoundings.mb3dsdg.drawingArea),
-					mb3dsoundings.FleurRedCursor);
-
-			/* change vertical exageration of 3D map */
-			mb3dsoundings.exageration = mb3dsoundings.exageration_save
-				* exp(((double)(mb3dsoundings.button_move_y - mb3dsoundings.button_down_y))
-					/ ((double)mb3dsoundings.gl_height));
-
-			mb3dsoundings_scalez(mbs_verbose, &mbs_error);
-			mb3dsoundings_updatestatus();
-			mb3dsoundings_plot(mbs_verbose, &mbs_error);
-			}
-
-		/* pan zoom mode */
-		else if (mb3dsoundings.mouse_mode == MBS_MOUSE_PANZOOM)
-			{
-			/* set cursor for zoom */
-	  		XDefineCursor(XtDisplay(mb3dsoundings.mb3dsdg.Mb3dsdg),
-					XtWindow(mb3dsoundings.mb3dsdg.drawingArea),
-					mb3dsoundings.FleurRedCursor);
-
-			/* change zoom */
-			mb3dsoundings.gl_size = mb3dsoundings.gl_size_save
-			    * exp(((double)(mb3dsoundings.button_move_y - mb3dsoundings.button_down_y))
-				    / ((double)mb3dsoundings.gl_height));
-
-			mb3dsoundings_updatestatus();
-			mb3dsoundings_plot(mbs_verbose, &mbs_error);
-			}
-		} /* end of right button events */
-
-      } /* end of motion notify events */
-
-
-      /* Check for mouse released. */
-      if (event->xany.type == ButtonRelease)
-      {
-/* fprintf(stderr, "event->xany.type == ButtonRelease  %d %d  mouse mode:%d\n",
-event->xbutton.x,event->xbutton.y, mb3dsoundings.mouse_mode); */
-
-	  /* save location */
-	  mb3dsoundings.button_up_x = event->xbutton.x;
-	  mb3dsoundings.button_up_y = mb3dsoundings.gl_height - 1 - event->xbutton.y;
-
-	   /* If left mouse button is released */
-	  if (mb3dsoundings.button1down == MB_YES)
-		{
-
-		/* deal with pick according to edit_mode */
-		if (mb3dsoundings.edit_mode == MBS_EDIT_TOGGLE)
-			{
-			}
-		else if (mb3dsoundings.edit_mode == MBS_EDIT_PICK)
-			{
-			}
-		else if (mb3dsoundings.edit_mode == MBS_EDIT_TOGGLE)
-			{
-			}
-		else if (mb3dsoundings.edit_mode == MBS_EDIT_ERASE)
-			{
-			}
-		else if (mb3dsoundings.edit_mode == MBS_EDIT_RESTORE)
-			{
-			}
-		else if (mb3dsoundings.edit_mode == MBS_EDIT_GRAB)
-			{
-			mb3dsoundings_grab(mb3dsoundings.button_down_x,
-						mb3dsoundings.button_down_y, MBS_EDIT_GRAB_END);
-			}
-		else if (mb3dsoundings.edit_mode == MBS_EDIT_INFO)
-			{
-			}
-
-		}
-
-	   /* If middle mouse button is released */
-	  else if (mb3dsoundings.button2down == MB_YES)
-		{
-		} /* end of middle button events */
-
-	   /* If right mouse button is released */
-	  else if (mb3dsoundings.button3down == MB_YES)
-		{
-		} /* end of right button events */
-
-
-	  /* unset all buttondown flags */
-	  mb3dsoundings.button1down = MB_NO;
-	  mb3dsoundings.button2down = MB_NO;
-	  mb3dsoundings.button3down = MB_NO;
-
-	  /* set edit cursor */
-	  mb3dsoundings_updatecursor();
-
-     } /* end of button release events */
-
-      /* deal with expose events by replotting */
-      if (event->xany.type == Expose || event->xany.type == GraphicsExpose)
-		{
-		mb3dsoundings_updatestatus();
-		mb3dsoundings_plot(mbs_verbose, &mbs_error);
-		}
-
-      /* Deal with KeyPress events */
-      if(event->xany.type == KeyPress)
-      {
-/* fprintf(stderr,"KeyPress event\n"); */
-      /* Get key pressed - buffer[0] */
-      actual = XLookupString((XKeyEvent *)event,
-		    buffer, 1, &keysym, NULL);
-
-      /* process events */
-      switch (buffer[0])
-	    {
-	    case 'G':
-	    case 'g':
-		    key_g_down = 1;
-		    break;
-	    case 'M':
-	    case 'm':
-	    case 'Z':
-	    case 'z':
-		    mb3dsoundings_bad_ping();
-		    key_z_down = 1;
-		    key_s_down = 0;
-		    key_a_down = 0;
-		    key_d_down = 0;
-		    break;
-	    case 'K':
-	    case 'k':
-	    case 'S':
-	    case 's':
-		    mb3dsoundings_good_ping();
-		    key_z_down = 0;
-		    key_s_down = 1;
-		    key_a_down = 0;
-		    key_d_down = 0;
-		    break;
-	    case 'J':
-	    case 'j':
-	    case 'A':
-	    case 'a':
-		    if (mb3dsoundings.keyreverse_mode == MB_NO)
-		    	mb3dsoundings_left_ping();
-		    else
-		    	mb3dsoundings_right_ping();
-		    key_z_down = 0;
-		    key_s_down = 0;
-		    key_a_down = 1;
-		    key_d_down = 0;
-		    break;
-	    case 'L':
-	    case 'l':
-	    case 'D':
-	    case 'd':
-		    if (mb3dsoundings.keyreverse_mode == MB_NO)
-		    	mb3dsoundings_right_ping();
-		    else
-		    	mb3dsoundings_left_ping();
-		    key_z_down = 0;
-		    key_s_down = 0;
-		    key_a_down = 0;
-		    key_d_down = 1;
-		    break;
-	    case '<':
-	    case ',':
-	    case 'X':
-	    case 'x':
-		    mb3dsoundings_flag_view();
-		    break;
-	    case '>':
-	    case '.':
-	    case 'C':
-	    case 'c':
-		    mb3dsoundings_unflag_view();
-		    break;
-	    case '!':
-		    mb3dsoundings_zero_ping();
-		    break;
-	    case 'U':
-	    case 'u':
-	    case 'Q':
-	    case 'q':
-			    {
-			    mb3dsoundings.edit_mode = MBS_EDIT_TOGGLE;
-			    mb3dsoundings_updatemodetoggles();
-			    mb3dsoundings_updatecursor();
-			    }
-		    break;
-	    case 'I':
-	    case 'i':
-	    case 'W':
-	    case 'w':
-			    {
-			    mb3dsoundings.edit_mode = MBS_EDIT_PICK;
-			    mb3dsoundings_updatemodetoggles();
-			    mb3dsoundings_updatecursor();
-			    }
-		    break;
-	    case 'O':
-	    case 'o':
-	    case 'E':
-	    case 'e':
-			    {
-			    mb3dsoundings.edit_mode = MBS_EDIT_ERASE;
-			    mb3dsoundings_updatemodetoggles();
-			    mb3dsoundings_updatecursor();
-			    }
-		    break;
-	    case 'P':
-	    case 'p':
-	    case 'R':
-	    case 'r':
-			    {
-			    mb3dsoundings.edit_mode = MBS_EDIT_RESTORE;
-			    mb3dsoundings_updatemodetoggles();
-			    mb3dsoundings_updatecursor();
-			    }
-		    break;
-	    case '{':
-	    case '[':
-	    case 'T':
-	    case 't':
-			    {
-			    mb3dsoundings.edit_mode = MBS_EDIT_GRAB;
-			    mb3dsoundings_updatemodetoggles();
-			    mb3dsoundings_updatecursor();
-			    }
-		    break;
-	    case '}':
-	    case ']':
-	    case 'Y':
-	    case 'y':
-			    {
-			    mb3dsoundings.edit_mode = MBS_EDIT_INFO;
-			    mb3dsoundings_updatemodetoggles();
-			    mb3dsoundings_updatecursor();
-			    }
-		    break;
-	    default:
-		    break;
-	    } /* end of key switch */
-       } /* end of key press events */
-
-      /* Deal with KeyRelease events */
-      if(event->xany.type == KeyRelease)
-      {
-      /* Get key pressed - buffer[0] */
-      actual = XLookupString((XKeyEvent *)event,
-		    buffer, 1, &keysym, NULL);
-
-      /* process events */
-      switch (buffer[0])
-	    {
-	    case 'G':
-	    case 'g':
-		    key_g_down = 0;
-		    break;
-	    case 'M':
-	    case 'm':
-	    case 'Z':
-	    case 'z':
-		    key_z_down = 0;
-		    break;
-	    case 'K':
-	    case 'k':
-	    case 'S':
-	    case 's':
-		    key_s_down = 0;
-		    break;
-	    case 'J':
-	    case 'j':
-	    case 'A':
-	    case 'a':
-		    key_a_down = 0;
-		    break;
-	    case 'L':
-	    case 'l':
-	    case 'D':
-	    case 'd':
-		    key_d_down = 0;
-		    break;
-	    default:
-		    break;
-	    } /* end of key switch */
-       } /* end of key release events */
-
-
-     } /* end of inputs from window */
-
-
-}
-
-/*---------------------------------------------------------------------------------------*/
-
-void
-do_mb3dsdg_glwda_resize( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-/* fprintf(stderr,"Called do_mb3dsdg_glwda_resize\n"); */
-}
-
-/*---------------------------------------------------------------------------------------*/
-
-int
-mb3dsoundings_scale(int verbose, int *error)
-{
-    struct mb3dsoundings_struct *soundingdata;
-    struct mb3dsoundings_sounding_struct *sounding;
-    int	i;
-
-/* fprintf(stderr,"Called mb3dsoundings_scale\n"); */
-
-	/* loop over all soundings */
-	soundingdata = (struct mb3dsoundings_struct *) mb3dsoundings.soundingdata;
-	for (i=0;i<soundingdata->num_soundings;i++)
-		{
-		sounding = (struct mb3dsoundings_sounding_struct *) &(soundingdata->soundings[i]);
-		sounding->glx = soundingdata->scale * sounding->x;
-		sounding->gly = soundingdata->scale * sounding->y;
-		sounding->glz = mb3dsoundings.exageration * soundingdata->zscale * sounding->z;
-		}
-
-	/* return */
-	return(mbs_status);
-
-}
-
-/*---------------------------------------------------------------------------------------*/
-
-int
-mb3dsoundings_scalez(int verbose, int *error)
-{
-    struct mb3dsoundings_struct *soundingdata;
-    struct mb3dsoundings_sounding_struct *sounding;
-    int	i;
-
-/* fprintf(stderr,"Called mb3dsoundings_scalez\n"); */
-
-	/* loop over all soundings */
-	soundingdata = (struct mb3dsoundings_struct *) mb3dsoundings.soundingdata;
-	for (i=0;i<soundingdata->num_soundings;i++)
-		{
-		sounding = (struct mb3dsoundings_sounding_struct *) &(soundingdata->soundings[i]);
-		sounding->glz = mb3dsoundings.exageration * soundingdata->zscale * sounding->z;
-		}
-
-	/* return */
-	return(mbs_status);
-}
-/*---------------------------------------------------------------------------------------*/
-
-int
-mb3dsoundings_pick(int x, int y)
-{
-    struct mb3dsoundings_struct *soundingdata;
-    struct mb3dsoundings_sounding_struct *sounding;
-    int		irmin;
-    double	dx, dy, r, rmin;
-    int		editevent;
-    int		i;
-
-/* fprintf(stderr,"Called mb3dsoundings_pick\n"); */
-
-	/* loop over all soundings */
-	soundingdata = (struct mb3dsoundings_struct *) mb3dsoundings.soundingdata;
-	rmin = 10000.0;
-	irmin = 0;
-	editevent = MB_NO;
-	for (i=0;i<soundingdata->num_soundings;i++)
-		{
-		sounding = (struct mb3dsoundings_sounding_struct *) &(soundingdata->soundings[i]);
-		dx = (double)(x - sounding->winx);
-		dy = (double)(y - sounding->winy);
-		r = sqrt(dx * dx + dy * dy);
-		if (r < rmin
-			&& (mb3dsoundings.edit_mode == MBS_EDIT_TOGGLE
-				|| mb_beam_ok(sounding->beamflag)))
-			{
-			irmin = i;
-			rmin = r;
-			}
-		}
-	if (rmin < MBS_PICK_THRESHOLD)
-		{
-		sounding = (struct mb3dsoundings_sounding_struct *) &(soundingdata->soundings[irmin]);
-		if (mb3dsoundings.edit_mode == MBS_EDIT_TOGGLE)
-			{
-			if (mb_beam_ok(sounding->beamflag))
-				{
-				sounding->beamflag = MB_FLAG_FLAG + MB_FLAG_MANUAL;
-				soundingdata->num_soundings_unflagged--;
-				soundingdata->num_soundings_flagged++;
-				editevent = MB_YES;
-
-				/* last sounding edited */
-				mb3dsoundings.last_sounding_defined = MB_YES;
-				mb3dsoundings.last_sounding_edited = irmin;
-				}
-			else
-				{
-				sounding->beamflag = MB_FLAG_NONE;
-				soundingdata->num_soundings_unflagged++;
-				soundingdata->num_soundings_flagged--;
-				editevent = MB_YES;
-
-				/* last sounding edited */
-				mb3dsoundings.last_sounding_defined = MB_YES;
-				mb3dsoundings.last_sounding_edited = irmin;
-				}
-			}
-		else if (mb3dsoundings.edit_mode == MBS_EDIT_PICK)
-			{
-			if (mb_beam_ok(sounding->beamflag))
-				{
-				sounding->beamflag = MB_FLAG_FLAG + MB_FLAG_MANUAL;
-				soundingdata->num_soundings_unflagged--;
-				soundingdata->num_soundings_flagged++;
-				editevent = MB_YES;
-
-				/* last sounding edited */
-				mb3dsoundings.last_sounding_defined = MB_YES;
-				mb3dsoundings.last_sounding_edited = irmin;
-				}
-			}
-		}
-	else
-		{
-		XBell(mb3dsoundings.dpy,100);
-		}
-
-	/* replot the data */
-	if (editevent == MB_YES)
-		{
-		mb3dsoundings_plot(mbs_verbose, &mbs_error);
-		mb3dsoundings_updatestatus();
-		}
-
-	/* communicate edit event back to calling application */
-	if (editevent == MB_YES && mb3dsoundings.mb3dsoundings_edit_notify != NULL)
-		{
-		(mb3dsoundings.mb3dsoundings_edit_notify)(sounding->ifile, sounding->iping,
-							sounding->ibeam, sounding->beamflag, MB3DSDG_EDIT_FLUSH);
-		}
-
-	/* return */
-	return(mbs_status);
-
-}
-/*---------------------------------------------------------------------------------------*/
-
-int
-mb3dsoundings_eraserestore(int x, int y)
-{
-    struct mb3dsoundings_struct *soundingdata;
-    struct mb3dsoundings_sounding_struct *sounding;
-    double	dx, dy, r;
-    int		editevent, neditevent;
-    int		i;
-
-/* fprintf(stderr,"\nCalled mb3dsoundings_eraserestore\n"); */
-
-	/* loop over all soundings */
-	neditevent = 0;
-	soundingdata = (struct mb3dsoundings_struct *) mb3dsoundings.soundingdata;
-	for (i=0;i<soundingdata->num_soundings;i++)
-		{
-		sounding = (struct mb3dsoundings_sounding_struct *) &(soundingdata->soundings[i]);
-		editevent = MB_NO;
-		dx = (double)(x - sounding->winx);
-		dy = (double)(y - sounding->winy);
-		r = sqrt(dx * dx + dy * dy);
-		if (r < MBS_ERASE_THRESHOLD)
-			{
-			if (mb3dsoundings.edit_mode == MBS_EDIT_ERASE
-				&& mb_beam_ok(sounding->beamflag))
-				{
-				sounding->beamflag = MB_FLAG_FLAG + MB_FLAG_MANUAL;
-				soundingdata->num_soundings_unflagged--;
-				soundingdata->num_soundings_flagged++;
-				editevent = MB_YES;
-
-				/* last sounding edited */
-				mb3dsoundings.last_sounding_defined = MB_YES;
-				mb3dsoundings.last_sounding_edited = i;
-				}
-			else if (mb3dsoundings.edit_mode == MBS_EDIT_RESTORE
-				&& !mb_beam_ok(sounding->beamflag))
-				{
-				sounding->beamflag = MB_FLAG_NONE;
-				soundingdata->num_soundings_unflagged++;
-				soundingdata->num_soundings_flagged--;
-				editevent = MB_YES;
-
-				/* last sounding edited */
-				mb3dsoundings.last_sounding_defined = MB_YES;
-				mb3dsoundings.last_sounding_edited = i;
-				}
-
-			/* handle valid edit event */
-			if (editevent == MB_YES)
-				{
-				neditevent++;
-
-				/* communicate edit event back to calling application */
-/* fprintf(stderr,"calling mb3dsoundings_edit_notify: sounding:%d file:%d ping:%d beam:%d beamflag:%d flush:%d\n",
-i,sounding->ifile, sounding->iping,sounding->ibeam, sounding->beamflag,MB3DSDG_EDIT_NOFLUSH); */
-				if  (mb3dsoundings.mb3dsoundings_edit_notify != NULL)
-					(mb3dsoundings.mb3dsoundings_edit_notify)(sounding->ifile, sounding->iping,
-									sounding->ibeam, sounding->beamflag,
-									MB3DSDG_EDIT_NOFLUSH);
-				}
-			}
-		}
-
-	/* replot and flush the edit events in the calling application */
-	if (neditevent > 0)
-		{
-		/* replot the data */
-		mb3dsoundings_plot(mbs_verbose, &mbs_error);
-		mb3dsoundings_updatestatus();
-
-		/* flush the edit events in the calling application */
-		(mb3dsoundings.mb3dsoundings_edit_notify)(0, 0, 0,
-						MB_FLAG_NULL,MB3DSDG_EDIT_FLUSHPREVIOUS);
-		}
-
-	/* return */
-	return(mbs_status);
-
-}
-/*---------------------------------------------------------------------------------------*/
-
-int
-mb3dsoundings_grab(int x, int y, int grabmode)
-{
-    struct mb3dsoundings_struct *soundingdata;
-    struct mb3dsoundings_sounding_struct *sounding;
-    int		xmin, xmax, ymin, ymax;
-    int		editevent, neditevent;
-    int		i;
-
-/* fprintf(stderr,"Called mb3dsoundings_grab mode:%d x:%d y:%d\n", grabmode, x, y); */
-
-	/* save grab start point */
-	if (grabmode == MBS_EDIT_GRAB_START)
-		{
-		/* set grab parameters */
-		mb3dsoundings.grab_start_defined = MB_YES;
-		mb3dsoundings.grab_end_defined = MB_NO;
-		mb3dsoundings.grab_start_x = x;
-		mb3dsoundings.grab_start_y = y;
-		mb3dsoundings.grab_end_x = x;
-		mb3dsoundings.grab_end_y = y;
-
-		/* replot the data */
-		mb3dsoundings_plot(mbs_verbose, &mbs_error);
-		}
-
-	/* save grab end point */
-	else if (grabmode == MBS_EDIT_GRAB_MOVE)
-		{
-		/* set grab parameters */
-		mb3dsoundings.grab_end_defined = MB_YES;
-		mb3dsoundings.grab_end_x = x;
-		mb3dsoundings.grab_end_y = y;
-
-		/* replot the data */
-		mb3dsoundings_plot(mbs_verbose, &mbs_error);
-		}
-
-	/* apply grab */
-	else if (grabmode == MBS_EDIT_GRAB_END)
-		{
-		/* loop over all soundings */
-		neditevent = 0;
-		xmin = MIN(mb3dsoundings.grab_start_x, mb3dsoundings.grab_end_x);
-		xmax = MAX(mb3dsoundings.grab_start_x, mb3dsoundings.grab_end_x);
-		ymin = MIN(mb3dsoundings.grab_start_y, mb3dsoundings.grab_end_y);
-		ymax = MAX(mb3dsoundings.grab_start_y, mb3dsoundings.grab_end_y);
-/* fprintf(stderr, "Grab bounds: %d %d %d %d\n", xmin, xmax, ymin, ymax); */
-		soundingdata = (struct mb3dsoundings_struct *) mb3dsoundings.soundingdata;
-		for (i=0;i<soundingdata->num_soundings;i++)
-			{
-			sounding = (struct mb3dsoundings_sounding_struct *) &(soundingdata->soundings[i]);
-			editevent = MB_NO;
-			if (sounding->winx >= xmin && sounding->winx <= xmax
-				&& sounding->winy >= ymin && sounding->winy <= ymax)
-				{
-				if (mb_beam_ok(sounding->beamflag))
-					{
-					sounding->beamflag = MB_FLAG_FLAG + MB_FLAG_MANUAL;
-					soundingdata->num_soundings_unflagged--;
-					soundingdata->num_soundings_flagged++;
-					editevent = MB_YES;
-					neditevent++;
-
-					/* last sounding edited */
-					mb3dsoundings.last_sounding_defined = MB_YES;
-					mb3dsoundings.last_sounding_edited = i;
-
-					/* communicate edit event back to calling application */
-					if  (mb3dsoundings.mb3dsoundings_edit_notify != NULL)
-						(mb3dsoundings.mb3dsoundings_edit_notify)(sounding->ifile, sounding->iping,
-										sounding->ibeam, sounding->beamflag,
-										MB3DSDG_EDIT_NOFLUSH);
-					}
-				}
-			}
-
-		/* grab done so unset grab flags */
-		mb3dsoundings.grab_start_defined = MB_NO;
-		mb3dsoundings.grab_end_defined = MB_NO;
-
-		/* replot and flush the edit events in the calling application */
-		if (neditevent > 0)
-			{
-			/* replot the data */
-			mb3dsoundings_plot(mbs_verbose, &mbs_error);
-			mb3dsoundings_updatestatus();
-
-			/* flush the edit events in the calling application */
-			(mb3dsoundings.mb3dsoundings_edit_notify)(0, 0, 0,
-							MB_FLAG_NULL,MB3DSDG_EDIT_FLUSHPREVIOUS);
-			}
-		}
-
-	/* return */
-	return(mbs_status);
-
-}
-/*---------------------------------------------------------------------------------------*/
-
-int
-mb3dsoundings_unflag_view()
-{
-    struct mb3dsoundings_struct *soundingdata;
-    struct mb3dsoundings_sounding_struct *sounding;
-    int		neditevent;
-    int		i;
-
-/* fprintf(stderr,"Called mb3dsoundings_unflag_view\n"); */
-
-	/* loop over all soundings */
-	neditevent = 0;
-	soundingdata = (struct mb3dsoundings_struct *) mb3dsoundings.soundingdata;
-	for (i=0;i<soundingdata->num_soundings;i++)
-		{
-		sounding = (struct mb3dsoundings_sounding_struct *) &(soundingdata->soundings[i]);
-		if (!mb_beam_ok(sounding->beamflag))
-			{
-			sounding->beamflag = MB_FLAG_NONE;
-			soundingdata->num_soundings_unflagged++;
-			soundingdata->num_soundings_flagged--;
-			neditevent++;
-
-			/* communicate edit event back to calling application */
-			if  (mb3dsoundings.mb3dsoundings_edit_notify != NULL)
-				(mb3dsoundings.mb3dsoundings_edit_notify)(sounding->ifile, sounding->iping,
-								sounding->ibeam, sounding->beamflag,
-								MB3DSDG_EDIT_NOFLUSH);
-			}
-		}
-
-	/* last sounding edited */
-	mb3dsoundings.last_sounding_defined = MB_NO;
-	mb3dsoundings.last_sounding_edited = 0;
-
-	/* replot and flush the edit events in the calling application */
-	if (neditevent > 0)
-		{
-		/* replot the data */
-		mb3dsoundings_plot(mbs_verbose, &mbs_error);
-		mb3dsoundings_updatestatus();
-
-		/* flush the edit events in the calling application */
-		(mb3dsoundings.mb3dsoundings_edit_notify)(0, 0, 0,
-						MB_FLAG_NULL,MB3DSDG_EDIT_FLUSHPREVIOUS);
-		}
-
-	/* return */
-	return(mbs_status);
-
-}
-/*---------------------------------------------------------------------------------------*/
-
-int
-mb3dsoundings_flag_view()
-{
-    struct mb3dsoundings_struct *soundingdata;
-    struct mb3dsoundings_sounding_struct *sounding;
-    int		neditevent;
-    int		i;
-
-/* fprintf(stderr,"Called mb3dsoundings_flag_view\n"); */
-
-	/* loop over all soundings */
-	neditevent = 0;
-	soundingdata = (struct mb3dsoundings_struct *) mb3dsoundings.soundingdata;
-	for (i=0;i<soundingdata->num_soundings;i++)
-		{
-		sounding = (struct mb3dsoundings_sounding_struct *) &(soundingdata->soundings[i]);
-		if (mb_beam_ok(sounding->beamflag))
-			{
-			sounding->beamflag = MB_FLAG_FLAG + MB_FLAG_MANUAL;
-			soundingdata->num_soundings_unflagged--;
-			soundingdata->num_soundings_flagged++;
-			neditevent++;
-
-			/* communicate edit event back to calling application */
-			if  (mb3dsoundings.mb3dsoundings_edit_notify != NULL)
-				(mb3dsoundings.mb3dsoundings_edit_notify)(sounding->ifile, sounding->iping,
-								sounding->ibeam, sounding->beamflag,
-								MB3DSDG_EDIT_NOFLUSH);
-			}
-		}
-
-	/* last sounding edited */
-	mb3dsoundings.last_sounding_defined = MB_NO;
-	mb3dsoundings.last_sounding_edited = 0;
-
-	/* replot and flush the edit events in the calling application */
-	if (neditevent > 0)
-		{
-		/* replot the data */
-		mb3dsoundings_plot(mbs_verbose, &mbs_error);
-		mb3dsoundings_updatestatus();
-
-		/* flush the edit events in the calling application */
-		(mb3dsoundings.mb3dsoundings_edit_notify)(0, 0, 0,
-						MB_FLAG_NULL,MB3DSDG_EDIT_FLUSHPREVIOUS);
-		}
-
-	/* return */
-	return(mbs_status);
-
-}
-/*---------------------------------------------------------------------------------------*/
-
-int
-mb3dsoundings_info(int x, int y)
-{
-    struct mb3dsoundings_struct *soundingdata;
-    struct mb3dsoundings_sounding_struct *sounding;
-    int		irmin;
-    double	dx, dy, r, rmin;
-    int		i;
-
-/* fprintf(stderr,"Called mb3dsoundings_info\n"); */
-
-	/* loop over all soundings */
-	soundingdata = (struct mb3dsoundings_struct *) mb3dsoundings.soundingdata;
-	rmin = 10000.0;
-	irmin = 0;
-	for (i=0;i<soundingdata->num_soundings;i++)
-		{
-		sounding = (struct mb3dsoundings_sounding_struct *) &(soundingdata->soundings[i]);
-		dx = (double)(x - sounding->winx);
-		dy = (double)(y - sounding->winy);
-		r = sqrt(dx * dx + dy * dy);
-		if (r < rmin
-			&& (mb3dsoundings.edit_mode == MBS_EDIT_TOGGLE
-				|| mb_beam_ok(sounding->beamflag)))
-			{
-			irmin = i;
-			rmin = r;
-			}
-		}
-	if (rmin < MBS_PICK_THRESHOLD)
-		{
-		/* select closest sounding */
-		mb3dsoundings.last_sounding_defined = MB_YES;
-		mb3dsoundings.last_sounding_edited = irmin;
-
-		mb3dsoundings_plot(mbs_verbose, &mbs_error);
-		mb3dsoundings_updatestatus();
-		}
-	else
-		{
-		XBell(mb3dsoundings.dpy,100);
-		}
-
-	/* return */
-	return(mbs_status);
-
-}
-/*---------------------------------------------------------------------------------------*/
-
-int
-mb3dsoundings_bad_ping()
-{
-    struct mb3dsoundings_struct *soundingdata;
-    struct mb3dsoundings_sounding_struct *sounding;
-    struct mb3dsoundings_sounding_struct *lastsounding;
-    int		neditevent;
-    int		i;
-
-/* fprintf(stderr,"Called mb3dsoundings_bad_ping last sounding: %d %d\n",
-mb3dsoundings.last_sounding_defined, mb3dsoundings.last_sounding_edited); */
-
-	/* only check if last sounding defined */
-	neditevent = 0;
-	soundingdata = (struct mb3dsoundings_struct *) mb3dsoundings.soundingdata;
-	if (mb3dsoundings.last_sounding_defined == MB_YES
-		&& mb3dsoundings.last_sounding_edited < soundingdata->num_soundings)
-		{
-		/* loop over all soundings */
-		lastsounding = (struct mb3dsoundings_sounding_struct *)
-					&(soundingdata->soundings[mb3dsoundings.last_sounding_edited]);
-		for (i=0;i<soundingdata->num_soundings;i++)
-			{
-			sounding = (struct mb3dsoundings_sounding_struct *) &(soundingdata->soundings[i]);
-			if (sounding->ifile == lastsounding->ifile
-				&& sounding->iping == lastsounding->iping
-				&& mb_beam_ok(sounding->beamflag))
-				{
-				sounding->beamflag = MB_FLAG_FLAG + MB_FLAG_MANUAL;
-				soundingdata->num_soundings_unflagged--;
-				soundingdata->num_soundings_flagged++;
-				neditevent++;
-
-				/* communicate edit event back to calling application */
-				if  (mb3dsoundings.mb3dsoundings_edit_notify != NULL)
-					(mb3dsoundings.mb3dsoundings_edit_notify)(sounding->ifile, sounding->iping,
-									sounding->ibeam, sounding->beamflag,
-									MB3DSDG_EDIT_NOFLUSH);
-				}
-			}
-		}
-	else
-		{
-		XBell(mb3dsoundings.dpy,100);
-		}
-
-	/* replot and flush the edit events in the calling application */
-	if (neditevent > 0)
-		{
-		/* replot the data */
-		mb3dsoundings_plot(mbs_verbose, &mbs_error);
-		mb3dsoundings_updatestatus();
-
-		/* flush the edit events in the calling application */
-		(mb3dsoundings.mb3dsoundings_edit_notify)(0, 0, 0,
-						MB_FLAG_NULL,MB3DSDG_EDIT_FLUSHPREVIOUS);
-		}
-
-	/* return */
-	return(mbs_status);
-
-}
-/*---------------------------------------------------------------------------------------*/
-
-int
-mb3dsoundings_zero_ping()
-{
-    struct mb3dsoundings_struct *soundingdata;
-    struct mb3dsoundings_sounding_struct *sounding;
-    struct mb3dsoundings_sounding_struct *lastsounding;
-    int		neditevent;
-    int		i;
-
-/* fprintf(stderr,"Called mb3dsoundings_bad_ping last sounding: %d %d\n",
-mb3dsoundings.last_sounding_defined, mb3dsoundings.last_sounding_edited); */
-
-	/* only check if last sounding defined */
-	neditevent = 0;
-	soundingdata = (struct mb3dsoundings_struct *) mb3dsoundings.soundingdata;
-	if (mb3dsoundings.last_sounding_defined == MB_YES
-		&& mb3dsoundings.last_sounding_edited < soundingdata->num_soundings)
-		{
-		/* loop over all soundings */
-		lastsounding = (struct mb3dsoundings_sounding_struct *)
-					&(soundingdata->soundings[mb3dsoundings.last_sounding_edited]);
-		for (i=0;i<soundingdata->num_soundings;i++)
-			{
-			sounding = (struct mb3dsoundings_sounding_struct *) &(soundingdata->soundings[i]);
-			if (sounding->ifile == lastsounding->ifile
-				&& sounding->iping == lastsounding->iping)
-				{
-				if (mb_beam_ok(sounding->beamflag))
-					soundingdata->num_soundings_unflagged--;
-				if (!mb_beam_ok(sounding->beamflag))
-					soundingdata->num_soundings_flagged--;
-				sounding->beamflag = MB_FLAG_NULL;
-				neditevent++;
-
-				/* communicate edit event back to calling application */
-				if  (mb3dsoundings.mb3dsoundings_edit_notify != NULL)
-					(mb3dsoundings.mb3dsoundings_edit_notify)(sounding->ifile, sounding->iping,
-									sounding->ibeam, sounding->beamflag,
-									MB3DSDG_EDIT_NOFLUSH);
-				}
-			}
-		}
-	else
-		{
-		XBell(mb3dsoundings.dpy,100);
-		}
-
-	/* replot and flush the edit events in the calling application */
-	if (neditevent > 0)
-		{
-		/* replot the data */
-		mb3dsoundings_plot(mbs_verbose, &mbs_error);
-		mb3dsoundings_updatestatus();
-
-		/* flush the edit events in the calling application */
-		(mb3dsoundings.mb3dsoundings_edit_notify)(0, 0, 0,
-						MB_FLAG_NULL,MB3DSDG_EDIT_FLUSHPREVIOUS);
-		}
-
-	/* return */
-	return(mbs_status);
-
-}
-/*---------------------------------------------------------------------------------------*/
-
-int
-mb3dsoundings_left_ping()
-{
-    struct mb3dsoundings_struct *soundingdata;
-    struct mb3dsoundings_sounding_struct *sounding;
-    struct mb3dsoundings_sounding_struct *lastsounding;
-    int		neditevent;
-    int		i;
-
-/* fprintf(stderr,"Called mb3dsoundings_left_ping last sounding: %d %d\n",
-mb3dsoundings.last_sounding_defined, mb3dsoundings.last_sounding_edited); */
-
-	/* only check if last sounding defined */
-	neditevent = 0;
-	soundingdata = (struct mb3dsoundings_struct *) mb3dsoundings.soundingdata;
-	if (mb3dsoundings.last_sounding_defined == MB_YES
-		&& mb3dsoundings.last_sounding_edited < soundingdata->num_soundings)
-		{
-		/* loop over all soundings */
-		lastsounding = (struct mb3dsoundings_sounding_struct *)
-					&(soundingdata->soundings[mb3dsoundings.last_sounding_edited]);
-		for (i=0;i<soundingdata->num_soundings;i++)
-			{
-			sounding = (struct mb3dsoundings_sounding_struct *) &(soundingdata->soundings[i]);
-			if (sounding->ifile == lastsounding->ifile
-				&& sounding->iping == lastsounding->iping
-				&& sounding->ibeam <= lastsounding->ibeam
-				&& mb_beam_ok(sounding->beamflag))
-				{
-				sounding->beamflag = MB_FLAG_FLAG + MB_FLAG_MANUAL;
-				soundingdata->num_soundings_unflagged--;
-				soundingdata->num_soundings_flagged++;
-				neditevent++;
-
-				/* communicate edit event back to calling application */
-				if  (mb3dsoundings.mb3dsoundings_edit_notify != NULL)
-					(mb3dsoundings.mb3dsoundings_edit_notify)(sounding->ifile, sounding->iping,
-									sounding->ibeam, sounding->beamflag,
-									MB3DSDG_EDIT_NOFLUSH);
-				}
-			}
-		}
-
-	/* replot and flush the edit events in the calling application */
-	if (neditevent > 0)
-		{
-		/* replot the data */
-		mb3dsoundings_plot(mbs_verbose, &mbs_error);
-		mb3dsoundings_updatestatus();
-
-		/* flush the edit events in the calling application */
-		(mb3dsoundings.mb3dsoundings_edit_notify)(0, 0, 0,
-						MB_FLAG_NULL,MB3DSDG_EDIT_FLUSHPREVIOUS);
-		}
-	else
-		{
-		XBell(mb3dsoundings.dpy,100);
-		}
-
-	/* return */
-	return(mbs_status);
-
-}
-/*---------------------------------------------------------------------------------------*/
-
-int
-mb3dsoundings_right_ping()
-{
-    struct mb3dsoundings_struct *soundingdata;
-    struct mb3dsoundings_sounding_struct *sounding;
-    struct mb3dsoundings_sounding_struct *lastsounding;
-    int		neditevent;
-    int		i;
-
-/* fprintf(stderr,"Called mb3dsoundings_right_ping last sounding: %d %d\n",
-mb3dsoundings.last_sounding_defined, mb3dsoundings.last_sounding_edited); */
-
-	/* only check if last sounding defined */
-	neditevent = 0;
-	soundingdata = (struct mb3dsoundings_struct *) mb3dsoundings.soundingdata;
-	if (mb3dsoundings.last_sounding_defined == MB_YES
-		&& mb3dsoundings.last_sounding_edited < soundingdata->num_soundings)
-		{
-		/* loop over all soundings */
-		lastsounding = (struct mb3dsoundings_sounding_struct *)
-					&(soundingdata->soundings[mb3dsoundings.last_sounding_edited]);
-		for (i=0;i<soundingdata->num_soundings;i++)
-			{
-			sounding = (struct mb3dsoundings_sounding_struct *) &(soundingdata->soundings[i]);
-			if (sounding->ifile == lastsounding->ifile
-				&& sounding->iping == lastsounding->iping
-				&& sounding->ibeam >= lastsounding->ibeam
-				&& mb_beam_ok(sounding->beamflag))
-				{
-				sounding->beamflag = MB_FLAG_FLAG + MB_FLAG_MANUAL;
-				soundingdata->num_soundings_unflagged--;
-				soundingdata->num_soundings_flagged++;
-				neditevent++;
-
-				/* communicate edit event back to calling application */
-				if  (mb3dsoundings.mb3dsoundings_edit_notify != NULL)
-					(mb3dsoundings.mb3dsoundings_edit_notify)(sounding->ifile, sounding->iping,
-									sounding->ibeam, sounding->beamflag,
-									MB3DSDG_EDIT_NOFLUSH);
-				}
-			}
-		}
-
-	/* replot and flush the edit events in the calling application */
-	if (neditevent > 0)
-		{
-		/* replot the data */
-		mb3dsoundings_plot(mbs_verbose, &mbs_error);
-		mb3dsoundings_updatestatus();
-
-		/* flush the edit events in the calling application */
-		(mb3dsoundings.mb3dsoundings_edit_notify)(0, 0, 0,
-						MB_FLAG_NULL,MB3DSDG_EDIT_FLUSHPREVIOUS);
-		}
-	else
-		{
-		XBell(mb3dsoundings.dpy,100);
-		}
-
-	/* return */
-	return(mbs_status);
-
-}
-/*---------------------------------------------------------------------------------------*/
-
-int
-mb3dsoundings_good_ping()
-{
-    struct mb3dsoundings_struct *soundingdata;
-    struct mb3dsoundings_sounding_struct *sounding;
-    struct mb3dsoundings_sounding_struct *lastsounding;
-    int		neditevent;
-    int		i;
-
-/* fprintf(stderr,"Called mb3dsoundings_good_ping last sounding: %d %d\n",
-mb3dsoundings.last_sounding_defined, mb3dsoundings.last_sounding_edited); */
-
-	/* only check if last sounding defined */
-	neditevent = 0;
-	soundingdata = (struct mb3dsoundings_struct *) mb3dsoundings.soundingdata;
-	if (mb3dsoundings.last_sounding_defined == MB_YES
-		&& mb3dsoundings.last_sounding_edited < soundingdata->num_soundings)
-		{
-		/* loop over all soundings */
-		lastsounding = (struct mb3dsoundings_sounding_struct *)
-					&(soundingdata->soundings[mb3dsoundings.last_sounding_edited]);
-		for (i=0;i<soundingdata->num_soundings;i++)
-			{
-			sounding = (struct mb3dsoundings_sounding_struct *) &(soundingdata->soundings[i]);
-			if (sounding->ifile == lastsounding->ifile
-				&& sounding->iping == lastsounding->iping
-				&& !mb_beam_ok(sounding->beamflag))
-				{
-				sounding->beamflag = MB_FLAG_NONE;
-				soundingdata->num_soundings_unflagged++;
-				soundingdata->num_soundings_flagged--;
-				neditevent++;
-
-				/* communicate edit event back to calling application */
-				if  (mb3dsoundings.mb3dsoundings_edit_notify != NULL)
-					(mb3dsoundings.mb3dsoundings_edit_notify)(sounding->ifile, sounding->iping,
-									sounding->ibeam, sounding->beamflag,
-									MB3DSDG_EDIT_NOFLUSH);
-				}
-			}
-		}
-	else
-		{
-		XBell(mb3dsoundings.dpy,100);
-		}
-
-	/* replot and flush the edit events in the calling application */
-	if (neditevent > 0)
-		{
-		/* replot the data */
-		mb3dsoundings_plot(mbs_verbose, &mbs_error);
-		mb3dsoundings_updatestatus();
-
-		/* flush the edit events in the calling application */
-		(mb3dsoundings.mb3dsoundings_edit_notify)(0, 0, 0,
-						MB_FLAG_NULL,MB3DSDG_EDIT_FLUSHPREVIOUS);
-		}
-
-	/* return */
-	return(mbs_status);
-
-}
-/*---------------------------------------------------------------------------------------*/
-
-int
-mb3dsoundings_setzscale(int verbose, int *error)
-{
-    struct mb3dsoundings_struct *soundingdata;
-    struct mb3dsoundings_sounding_struct *sounding;
-    int		nunflagged = 0;
-    double	zmin, zmax, dz;
-    int		i;
-
-	/* get sounding data structure */
-	soundingdata = (struct mb3dsoundings_struct *) mb3dsoundings.soundingdata;
-/* fprintf(stderr,"Called mb3dsoundings_setzscale: %d soundings\n",soundingdata->num_soundings); */
-
-	/* initialize zmin and zmax */
-	zmin = 0.0;
-	zmax = 0.0;
-
-	/* get vertical min maxes for scaling of all soundings */
-	if (mb3dsoundings.view_scalewithflagged == MB_YES && soundingdata->num_soundings > 0)
-		{
-		sounding = (struct mb3dsoundings_sounding_struct *) &(soundingdata->soundings[0]);
-		zmin = sounding->z;
-		zmax = sounding->z;
-		for (i=1;i<soundingdata->num_soundings;i++)
-			{
-			sounding = (struct mb3dsoundings_sounding_struct *) &(soundingdata->soundings[i]);
-			zmin = MIN(sounding->z, zmin);
-			zmax = MAX(sounding->z, zmax);
-			}
-		}
-
-	/* else get vertical min maxes for scaling of only unflagged soundings */
-	else if (soundingdata->num_soundings > 0)
-		{
-		nunflagged = 0;
-		for (i=1;i<soundingdata->num_soundings;i++)
-			{
-			sounding = (struct mb3dsoundings_sounding_struct *) &(soundingdata->soundings[i]);
-			if (mb_beam_ok(sounding->beamflag))
-				{
-				if (nunflagged == 0)
-					{
-					zmin = sounding->z;
-					zmax = sounding->z;
-					}
-				else
-					{
-					zmin = MIN(sounding->z, zmin);
-					zmax = MAX(sounding->z, zmax);
-					}
-				nunflagged++;
-				}
-			}
-		}
-
-	dz = zmax - zmin;
-	soundingdata->zorigin = 0.5 * (zmin + zmax);
-	soundingdata->zmin = -0.5 * dz;
-	soundingdata->zmax = 0.5 * dz;
-	for (i=0;i<soundingdata->num_soundings;i++)
-		{
-		sounding = (struct mb3dsoundings_sounding_struct *) &(soundingdata->soundings[i]);
-		sounding->z = sounding->z - soundingdata->zorigin;
-		sounding->glz = mb3dsoundings.exageration * soundingdata->zscale * sounding->z;
-		}
-
-	/* return */
-	return(mbs_status);
-
-}
-
-/*---------------------------------------------------------------------------------------*/
-
-int
-mb3dsoundings_plot(int verbose, int *error)
-{
-	/* local variables */
-	char	*function_name = "mb3dsoundings_plot";
-
-	struct mb3dsoundings_struct *soundingdata;
-	struct mb3dsoundings_sounding_struct *sounding;
-	struct mb3dsoundings_sounding_struct *sounding2;
-	GLdouble 	model_matrix[16];
-	GLdouble 	projection_matrix[16];
-	GLint	viewport[4];
-	int		grabxmin, grabxmax, grabymin, grabymax;
-	float	glxmin, glymin, glzmin, glxmax, glymax, glzmax;
-	double	xx, yy, zz;
-	int	i;
-
-	/* print starting debug statements */
-	if (mbs_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:                 %d\n", verbose);
-		}
-
-	/* get sounding data structure */
-	soundingdata = (struct mb3dsoundings_struct *) mb3dsoundings.soundingdata;
-/* fprintf(stderr,"Called mb3dsoundings_plot: %d soundings\n",
-soundingdata->num_soundings); */
-
-	/* make correct window current for OpenGL */
-#ifdef MBV_DEBUG_GLX
-fprintf(stderr,"%s:%d:%s glXMakeCurrent(%p,%p,%p)\n",
-__FILE__,__LINE__,function_name,XtDisplay(mb3dsoundings.glwmda),XtWindow(mb3dsoundings.glwmda),mb3dsoundings.glx_context);
-#endif
-	glXMakeCurrent(XtDisplay(mb3dsoundings.glwmda),
-			XtWindow(mb3dsoundings.glwmda),
-			mb3dsoundings.glx_context);
-
-#ifdef MBV_GET_GLX_ERRORS
-mbview_glerrorcheck(0, __FILE__, __LINE__, function_name);
-#endif
-
-	/* set background color */
-	glClearColor(1.0, 1.0, 1.0, 0.0);
-	glClearDepth((GLclampd)(2000 * MBS_OPENGL_WIDTH));
-	glDepthFunc(GL_LESS);
-	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
-
-	/* set projection */
-	mb3dsoundings.left = -1.0 / mb3dsoundings.gl_size;
-	mb3dsoundings.right = 1.0 / mb3dsoundings.gl_size;
-	mb3dsoundings.bottom = -1.0 / mb3dsoundings.gl_size;
-	mb3dsoundings.top = 1.0 / mb3dsoundings.gl_size;
-	mb3dsoundings.aspect_ratio = 1.0 / mb3dsoundings.gl_size;
-	glMatrixMode(GL_PROJECTION);
-	glLoadIdentity();
-	glOrtho(mb3dsoundings.left, mb3dsoundings.right,
-			mb3dsoundings.bottom, mb3dsoundings.top,
-			MBS_OPENGL_ZMIN2D, MBS_OPENGL_ZMAX2D);
-
-	/* set up translations */
-	glMatrixMode(GL_MODELVIEW);
-	glLoadIdentity();
-	glTranslated (mb3dsoundings.gl_offset_x,
-			mb3dsoundings.gl_offset_y,
-			MBS_OPENGL_ZMIN2D);
-	glRotated ((float)(mb3dsoundings.elevation - 90.0), 1.0, 0.0, 0.0);
-	glRotated ((float)(mb3dsoundings.azimuth), 0.0, 0.0, 1.0);
-/* fprintf(stderr,"elevation:%f azimuth:%f\n",mb3dsoundings.elevation,mb3dsoundings.azimuth); */
-
-	/* get modelview and projection matrices and viewport */
-	glGetDoublev(GL_MODELVIEW_MATRIX, model_matrix);
-	glGetDoublev(GL_PROJECTION_MATRIX, projection_matrix);
-	glGetIntegerv(GL_VIEWPORT, viewport);
-
-	/* Plot the bounding box if desired */
-	if (mb3dsoundings.view_boundingbox == MB_YES)
-		{
-		glxmin = soundingdata->scale * soundingdata->xmin;
-		glxmax = soundingdata->scale * soundingdata->xmax;
-		glymin = soundingdata->scale * soundingdata->ymin;
-		glymax = soundingdata->scale * soundingdata->ymax;
-		glzmin = mb3dsoundings.exageration * soundingdata->zscale * soundingdata->zmin;
-		glzmax = mb3dsoundings.exageration * soundingdata->zscale * soundingdata->zmax;
-		glLineWidth(1.0);
-		glColor3f(0.0, 0.0, 0.0);
-		glEnable(GL_LINE_STIPPLE);
-
-		if (mb3dsoundings.elevation <= 0.0)
-			glLineStipple(1, 0xFFFF);
-		else
-			glLineStipple(1, 0x1111);
-		glBegin(GL_LINE_LOOP);
-		glVertex3f(glxmin, glymin, glzmin);
-		glVertex3f(glxmax, glymin, glzmin);
-		glVertex3f(glxmax, glymax, glzmin);
-		glVertex3f(glxmin, glymax, glzmin);
-		glEnd();
-
-		if (mb3dsoundings.elevation >= 0.0)
-			glLineStipple(1, 0xFFFF);
-		else
-			glLineStipple(1, 0x1111);
-		glBegin(GL_LINE_LOOP);
-		glVertex3f(glxmin, glymin, glzmax);
-		glVertex3f(glxmax, glymin, glzmax);
-		glVertex3f(glxmax, glymax, glzmax);
-		glVertex3f(glxmin, glymax, glzmax);
-		glEnd();
-
-		if ((mb3dsoundings.azimuth >= 0.0 && mb3dsoundings.azimuth <= 90.0)
-			|| (mb3dsoundings.azimuth >= 270.0 && mb3dsoundings.azimuth <= 360.0))
-			{
-			if (mb3dsoundings.elevation >= -90.0 && mb3dsoundings.elevation <= 90.0)
-				glLineStipple(1, 0xFFFF);
-			else
-				glLineStipple(1, 0x1111);
-			}
-		else
-			{
-			if (mb3dsoundings.elevation >= -90.0 && mb3dsoundings.elevation <= 90.0)
-				glLineStipple(1, 0x1111);
-			else
-				glLineStipple(1, 0xFFFF);
-			}
-		glBegin(GL_LINE_LOOP);
-		glVertex3f(glxmin, glymin, glzmin);
-		glVertex3f(glxmax, glymin, glzmin);
-		glVertex3f(glxmax, glymin, glzmax);
-		glVertex3f(glxmin, glymin, glzmax);
-		glEnd();
-
-		if (mb3dsoundings.azimuth >= 180.0 && mb3dsoundings.azimuth <= 360.0)
-			{
-			if (mb3dsoundings.elevation >= -90.0 && mb3dsoundings.elevation <= 90.0)
-				glLineStipple(1, 0xFFFF);
-			else
-				glLineStipple(1, 0x1111);
-			}
-		else
-			{
-			if (mb3dsoundings.elevation >= -90.0 && mb3dsoundings.elevation <= 90.0)
-				glLineStipple(1, 0x1111);
-			else
-				glLineStipple(1, 0xFFFF);
-			}
-		glBegin(GL_LINE_LOOP);
-		glVertex3f(glxmax, glymin, glzmin);
-		glVertex3f(glxmax, glymax, glzmin);
-		glVertex3f(glxmax, glymax, glzmax);
-		glVertex3f(glxmax, glymin, glzmax);
-		glEnd();
-
-		if (mb3dsoundings.azimuth >= 90.0 && mb3dsoundings.azimuth <= 270.0)
-			{
-			if (mb3dsoundings.elevation >= -90.0 && mb3dsoundings.elevation <= 90.0)
-				glLineStipple(1, 0xFFFF);
-			else
-				glLineStipple(1, 0x1111);
-			}
-		else
-			{
-			if (mb3dsoundings.elevation >= -90.0 && mb3dsoundings.elevation <= 90.0)
-				glLineStipple(1, 0x1111);
-			else
-				glLineStipple(1, 0xFFFF);
-			}
-		glBegin(GL_LINE_LOOP);
-		glVertex3f(glxmax, glymax, glzmin);
-		glVertex3f(glxmin, glymax, glzmin);
-		glVertex3f(glxmin, glymax, glzmax);
-		glVertex3f(glxmax, glymax, glzmax);
-		glEnd();
-
-		if ((mb3dsoundings.azimuth >= 0.0 && mb3dsoundings.azimuth <= 180.0)
-			|| (mb3dsoundings.azimuth >= 0.0 && mb3dsoundings.azimuth <= 90.0))
-			{
-			if (mb3dsoundings.elevation >= -90.0 && mb3dsoundings.elevation <= 90.0)
-				glLineStipple(1, 0xFFFF);
-			else
-				glLineStipple(1, 0x1111);
-			}
-		else
-			{
-			if (mb3dsoundings.elevation >= -90.0 && mb3dsoundings.elevation <= 90.0)
-				glLineStipple(1, 0x1111);
-			else
-				glLineStipple(1, 0xFFFF);
-			}
-		glBegin(GL_LINE_LOOP);
-		glVertex3f(glxmin, glymax, glzmin);
-		glVertex3f(glxmin, glymin, glzmin);
-		glVertex3f(glxmin, glymin, glzmax);
-		glVertex3f(glxmin, glymax, glzmax);
-		glEnd();
-
-		glDisable(GL_LINE_STIPPLE);
-		}
-
-	/* Plot the profiles if desired */
-	if (mb3dsoundings.view_profiles != MBS_VIEW_PROFILES_NONE)
-		{
-		glLineWidth(1.0);
-		glBegin(GL_LINES);
-		for (i=0;i<soundingdata->num_soundings-1;i++)
-			{
-			sounding = (struct mb3dsoundings_sounding_struct *) &(soundingdata->soundings[i]);
-			sounding2 = (struct mb3dsoundings_sounding_struct *) &(soundingdata->soundings[i+1]);
-
-			/* plot segment only if soundings are from the same ping */
-			if (sounding2->ifile == sounding->ifile && sounding->iping == sounding2->iping)
-				{
-				/* plot in black if both soundings are good */
-				if (mb_beam_ok(sounding->beamflag) && mb_beam_ok(sounding2->beamflag))
-					{
-					glColor3f(0.0, 0.0, 0.0);
-					glVertex3f(sounding->glx, sounding->gly, sounding->glz);
-					glVertex3f(sounding2->glx, sounding2->gly, sounding2->glz);
-					}
-
-				/* else plot in red if flagged profiles are desired */
-				else if (mb3dsoundings.view_profiles == MBS_VIEW_PROFILES_ALL)
-					{
-					glColor3f(1.0, 0.0, 0.0);
-					glVertex3f(sounding->glx, sounding->gly, sounding->glz);
-					glVertex3f(sounding2->glx, sounding2->gly, sounding2->glz);
-					}
-				}
-			}
-		glEnd();
-		}
-
-	/* Plot the unflagged soundings */
-	glPointSize(3.0);
-	glColor3f(0.0, 0.0, 0.0);
-	glBegin(GL_POINTS);
-	for (i=0;i<soundingdata->num_soundings;i++)
-		{
-		sounding = (struct mb3dsoundings_sounding_struct *) &(soundingdata->soundings[i]);
-/*fprintf(stderr,"%d %f %f %f  %f %f %f %d", i,
-sounding->x, sounding->y, sounding->z,
-sounding->glx, sounding->gly, sounding->glz, sounding->beamflag);*/
-		if (mb_beam_ok(sounding->beamflag))
-			{
-			glColor3f(colortable_object_red[sounding->beamcolor],
-				colortable_object_green[sounding->beamcolor],
-				colortable_object_blue[sounding->beamcolor]);
-			glVertex3f(sounding->glx, sounding->gly, sounding->glz);
-			/* fprintf(stderr," PLOTTED");*/
-			}
-/*fprintf(stderr,"\n");*/
-		}
-	glEnd();
-
-	/* Plot the flagged soundings if desired */
-	if (mb3dsoundings.view_flagged == MB_YES)
-		{
-		glColor3f(1.0, 0.0, 0.0);
-		glBegin(GL_POINTS);
-		for (i=0;i<soundingdata->num_soundings;i++)
-			{
-			sounding = (struct mb3dsoundings_sounding_struct *) &(soundingdata->soundings[i]);
-			if (!mb_beam_ok(sounding->beamflag))
-				glVertex3f(sounding->glx, sounding->gly, sounding->glz);
-/*fprintf(stderr,"%f %f %f\n", sounding->glx, sounding->gly, sounding->glz);*/
-			}
-		glEnd();
-		}
-
-	/* If in info mode and sounding picked plot it green */
-	if (mb3dsoundings.edit_mode == MBS_EDIT_INFO
-		&& mb3dsoundings.last_sounding_defined == MB_YES)
-		{
-		glColor3f(0.0, 1.0, 1.0);
-		glBegin(GL_POINTS);
-		sounding = (struct mb3dsoundings_sounding_struct *) &(soundingdata->soundings[mb3dsoundings.last_sounding_edited]);
-		glVertex3f(sounding->glx, sounding->gly, sounding->glz);
-		glEnd();
-		}
-
-	/* save the screen positions of the soundings to facillitate picking */
-	for (i=0;i<soundingdata->num_soundings;i++)
-		{
-		sounding = (struct mb3dsoundings_sounding_struct *) &(soundingdata->soundings[i]);
-		if (mb_beam_ok(sounding->beamflag))
-			{
-			glVertex3f(sounding->glx, sounding->gly, sounding->glz);
-			/* fprintf(stderr," PLOTTED");*/
-			}
-		gluProject((double)(sounding->glx),
-			(double)(sounding->gly),
-			(double)(sounding->glz),
-			model_matrix,
-			projection_matrix,
-			viewport,
-			&xx, &yy, &zz);
-		sounding->winx = (int)xx;
-		sounding->winy = (int)yy;
-		}
-
-	/* plot grab rectangle before rotations */
-	glMatrixMode(GL_MODELVIEW);
-	glLoadIdentity();
-	if  (mb3dsoundings.button1down == MB_YES
-		&& mb3dsoundings.grab_start_defined == MB_YES
-		&& mb3dsoundings.grab_end_defined == MB_YES)
-		{
-		grabxmin = MIN(mb3dsoundings.grab_start_x, mb3dsoundings.grab_end_x);
-		grabxmax = MAX(mb3dsoundings.grab_start_x, mb3dsoundings.grab_end_x);
-		grabymin = MIN(mb3dsoundings.grab_start_y, mb3dsoundings.grab_end_y);
-		grabymax = MAX(mb3dsoundings.grab_start_y, mb3dsoundings.grab_end_y);
-		glxmin = (mb3dsoundings.right - mb3dsoundings.left)
-			* ((float)grabxmin) / ((float)mb3dsoundings.gl_width)
-				- 0.5 * (mb3dsoundings.right - mb3dsoundings.left);
-		glxmax = (mb3dsoundings.right - mb3dsoundings.left)
-			* ((float)grabxmax) / ((float)mb3dsoundings.gl_width)
-				- 0.5 * (mb3dsoundings.right - mb3dsoundings.left);
-		glymin = (mb3dsoundings.top - mb3dsoundings.bottom)
-			* ((float)grabymin) / ((float)mb3dsoundings.gl_height)
-				- 0.5 * (mb3dsoundings.top - mb3dsoundings.bottom);
-		glymax = (mb3dsoundings.top - mb3dsoundings.bottom)
-			* ((float)grabymax) / ((float)mb3dsoundings.gl_height)
-				- 0.5 * (mb3dsoundings.top - mb3dsoundings.bottom);
-/* fprintf(stderr,"glxmin:%f glxmax:%f glymin:%f glymax:%f\n", glxmin, glxmax, glymin, glymax); */
-		glColor3f(1.0, 1.0, 0.0);
-		glLineWidth(3.0);
-		glBegin(GL_LINE_LOOP);
-		glVertex3f(glxmin, glymin, -MBS_OPENGL_ZMIN2D - 0.5 * (MBS_OPENGL_ZMAX2D - MBS_OPENGL_ZMIN2D));
-		glVertex3f(glxmax, glymin, -MBS_OPENGL_ZMIN2D - 0.5 * (MBS_OPENGL_ZMAX2D - MBS_OPENGL_ZMIN2D));
-		glVertex3f(glxmax, glymax, -MBS_OPENGL_ZMIN2D - 0.5 * (MBS_OPENGL_ZMAX2D - MBS_OPENGL_ZMIN2D));
-		glVertex3f(glxmin, glymax, -MBS_OPENGL_ZMIN2D - 0.5 * (MBS_OPENGL_ZMAX2D - MBS_OPENGL_ZMIN2D));
-		glEnd();
-		glLineWidth(1.0);
-		}
-
-	/* flush opengl buffers */
-	glFlush();
-
-	/* swap opengl buffers */
-	glXSwapBuffers (XtDisplay(mb3dsoundings.glwmda),
-			XtWindow(mb3dsoundings.glwmda));
-
-#ifdef MBV_GET_GLX_ERRORS
-mbview_glerrorcheck(0, __FILE__, __LINE__, function_name);
-#endif
-
-	/* print output debug statements */
-	if (mbs_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:        %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:       %d\n",mbs_status);
-		}
-
-	/* return */
-	return(mbs_status);
-
-}
-
-/*---------------------------------------------------------------------------------------*/
-int
-mb3dsoundings_get_bias_values(int verbose, double *rollbias, double *pitchbias,
-				double *headingbias, double *timelag, int *error)
-{
-/* fprintf(stderr,"Called mb3dsoundings_get_bias_values\n"); */
-
-	/* get bias parameters */
-	*rollbias = 0.01 * ((double)mb3dsoundings.irollbias);
-	*pitchbias = 0.01 * ((double)mb3dsoundings.ipitchbias);
-	*headingbias = 0.01 * ((double)mb3dsoundings.iheadingbias);
-	*timelag = 0.01 * ((double)mb3dsoundings.itimelag);
-
-	/* return */
-	return(mbs_status);
-
-
-}
-
-/*---------------------------------------------------------------------------------------*/
-
-void
-do_mb3dsdg_rollbias( Widget w, XtPointer client_data, XtPointer call_data)
-{
-	XmScaleCallbackStruct *acs;
-    	int	irollbiasmin, irollbiasmax;
-
-	acs = (XmScaleCallbackStruct*)call_data;
-
-/* fprintf(stderr,"Called do_mb3dsdg_rollbias: %d\n", acs->value); */
-
-	mb3dsoundings.irollbias = acs->value;
-
-	ac = 0;
-        XtSetArg(args[ac], XmNminimum, &irollbiasmin); ac++;
-        XtSetArg(args[ac], XmNmaximum, &irollbiasmax); ac++;
-        XtSetArg(args[ac], XmNvalue, &(mb3dsoundings.irollbias)); ac++;
-	XtGetValues(mb3dsoundings.mb3dsdg.scale_rollbias, args, ac);
-
-	/* send bias parameters to calling program */
-	if (mb3dsoundings.mb3dsoundings_bias_notify != NULL)
-	(mb3dsoundings.mb3dsoundings_bias_notify)(0.01 *((double)mb3dsoundings.irollbias),
-						0.01 *((double)mb3dsoundings.ipitchbias),
-						0.01 *((double)mb3dsoundings.iheadingbias),
-						0.01 *((double)mb3dsoundings.itimelag));
-
-	/* rescale data to the gl coordinates */
-	mb3dsoundings_scale(mbs_verbose, &mbs_error);
-	mb3dsoundings_setzscale(mbs_verbose, &mbs_error);
-
-	/* replot the data */
-	mb3dsoundings_plot(mbs_verbose, &mbs_error);
-
-	/* reset scale min max */
-	if (mb3dsoundings.irollbias == irollbiasmin || mb3dsoundings.irollbias == irollbiasmax)
-		{
-		irollbiasmin = mb3dsoundings.irollbias - 100;
-		irollbiasmax = mb3dsoundings.irollbias + 100;
-		ac = 0;
-        	XtSetArg(args[ac], XmNminimum, irollbiasmin); ac++;
-        	XtSetArg(args[ac], XmNmaximum, irollbiasmax); ac++;
- 		XtSetValues(mb3dsoundings.mb3dsdg.scale_rollbias, args, ac);
-		}
-}
-
-/*---------------------------------------------------------------------------------------*/
-
-void
-do_mb3dsdg_pitchbias( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmScaleCallbackStruct *acs;
-    acs = (XmScaleCallbackStruct*)call_data;
-    	int	ipitchbiasmin, ipitchbiasmax;
-
-   	acs = (XmScaleCallbackStruct*)call_data;
-
-/* fprintf(stderr,"Called do_mb3dsdg_pitchbias: %d\n", acs->value); */
-
-	mb3dsoundings.ipitchbias = acs->value;
-
-	ac = 0;
-        XtSetArg(args[ac], XmNminimum, &ipitchbiasmin); ac++;
-        XtSetArg(args[ac], XmNmaximum, &ipitchbiasmax); ac++;
-        XtSetArg(args[ac], XmNvalue, &(mb3dsoundings.ipitchbias)); ac++;
-	XtGetValues(mb3dsoundings.mb3dsdg.scale_pitchbias, args, ac);
-
-	/* send bias parameters to calling program */
-	if (mb3dsoundings.mb3dsoundings_bias_notify != NULL)
-	(mb3dsoundings.mb3dsoundings_bias_notify)(0.01 *((double)mb3dsoundings.irollbias),
-						0.01 *((double)mb3dsoundings.ipitchbias),
-						0.01 *((double)mb3dsoundings.iheadingbias),
-						0.01 *((double)mb3dsoundings.itimelag));
-
-	/* rescale data to the gl coordinates */
-	mb3dsoundings_scale(mbs_verbose, &mbs_error);
-	mb3dsoundings_setzscale(mbs_verbose, &mbs_error);
-
-	/* replot the data */
-	mb3dsoundings_plot(mbs_verbose, &mbs_error);
-
-	/* reset scale min max */
-	if (mb3dsoundings.ipitchbias == ipitchbiasmin || mb3dsoundings.ipitchbias == ipitchbiasmax)
-		{
-		ipitchbiasmin = mb3dsoundings.ipitchbias - 100;
-		ipitchbiasmax = mb3dsoundings.ipitchbias + 100;
-		ac = 0;
-        	XtSetArg(args[ac], XmNminimum, ipitchbiasmin); ac++;
-        	XtSetArg(args[ac], XmNmaximum, ipitchbiasmax); ac++;
-		XtSetValues(mb3dsoundings.mb3dsdg.scale_pitchbias, args, ac);
-		}
-}
-
-/*---------------------------------------------------------------------------------------*/
-
-void
-do_mb3dsdg_headingbias( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmScaleCallbackStruct *acs;
-    acs = (XmScaleCallbackStruct*)call_data;
-    	int	iheadingbiasmin, iheadingbiasmax;
-
-  	acs = (XmScaleCallbackStruct*)call_data;
-
-/* fprintf(stderr,"Called do_mb3dsdg_headingbias: %d\n", acs->value); */
-
-	mb3dsoundings.iheadingbias = acs->value;
-
-	ac = 0;
-        XtSetArg(args[ac], XmNminimum, &iheadingbiasmin); ac++;
-        XtSetArg(args[ac], XmNmaximum, &iheadingbiasmax); ac++;
-        XtSetArg(args[ac], XmNvalue, &(mb3dsoundings.iheadingbias)); ac++;
-	XtGetValues(mb3dsoundings.mb3dsdg.scale_headingbias, args, ac);
-
-	/* send bias parameters to calling program */
-	if (mb3dsoundings.mb3dsoundings_bias_notify != NULL)
-	(mb3dsoundings.mb3dsoundings_bias_notify)(0.01 *((double)mb3dsoundings.irollbias),
-						0.01 *((double)mb3dsoundings.ipitchbias),
-						0.01 *((double)mb3dsoundings.iheadingbias),
-						0.01 *((double)mb3dsoundings.itimelag));
-
-	/* rescale data to the gl coordinates */
-	mb3dsoundings_scale(mbs_verbose, &mbs_error);
-	mb3dsoundings_setzscale(mbs_verbose, &mbs_error);
-
-	/* replot the data */
-	mb3dsoundings_plot(mbs_verbose, &mbs_error);
-
-	/* reset scale min max */
-	if (mb3dsoundings.iheadingbias == iheadingbiasmin
-		|| mb3dsoundings.iheadingbias == iheadingbiasmax)
-		{
-		iheadingbiasmin = mb3dsoundings.iheadingbias - 100;
-		iheadingbiasmax = mb3dsoundings.iheadingbias + 100;
-		ac = 0;
-        	XtSetArg(args[ac], XmNminimum, iheadingbiasmin); ac++;
-        	XtSetArg(args[ac], XmNmaximum, iheadingbiasmax); ac++;
-		XtSetValues(mb3dsoundings.mb3dsdg.scale_headingbias, args, ac);
-		}
-}
-
-/*---------------------------------------------------------------------------------------*/
-
-void
-do_mb3dsdg_timelag( Widget w, XtPointer client_data, XtPointer call_data)
-{
-	XmScaleCallbackStruct *acs;
-    	int	itimelagmin, itimelagmax;
-
-	acs = (XmScaleCallbackStruct*)call_data;
-
-/* fprintf(stderr,"Called do_mb3dsdg_timelag: %d\n", acs->value); */
-
-	mb3dsoundings.itimelag = acs->value;
-
-	ac = 0;
-        XtSetArg(args[ac], XmNminimum, &itimelagmin); ac++;
-        XtSetArg(args[ac], XmNmaximum, &itimelagmax); ac++;
-        XtSetArg(args[ac], XmNvalue, &(mb3dsoundings.itimelag)); ac++;
-	XtGetValues(mb3dsoundings.mb3dsdg.scale_timelag, args, ac);
-
-	/* send bias parameters to calling program */
-	if (mb3dsoundings.mb3dsoundings_bias_notify != NULL)
-	(mb3dsoundings.mb3dsoundings_bias_notify)(0.01 *((double)mb3dsoundings.irollbias),
-						0.01 *((double)mb3dsoundings.ipitchbias),
-						0.01 *((double)mb3dsoundings.iheadingbias),
-						0.01 *((double)mb3dsoundings.itimelag));
-
-	/* rescale data to the gl coordinates */
-	mb3dsoundings_scale(mbs_verbose, &mbs_error);
-	mb3dsoundings_setzscale(mbs_verbose, &mbs_error);
-
-	/* replot the data */
-	mb3dsoundings_plot(mbs_verbose, &mbs_error);
-
-	/* reset scale min max */
-	if (mb3dsoundings.itimelag == itimelagmin
-		|| mb3dsoundings.itimelag == itimelagmax)
-		{
-		itimelagmin = mb3dsoundings.itimelag - 100;
-		itimelagmax = mb3dsoundings.itimelag + 100;
-		ac = 0;
-        	XtSetArg(args[ac], XmNminimum, itimelagmin); ac++;
-        	XtSetArg(args[ac], XmNmaximum, itimelagmax); ac++;
-		XtSetValues(mb3dsoundings.mb3dsdg.scale_timelag, args, ac);
-		}
-}
-
-/*---------------------------------------------------------------------------------------*/
-
-void
-do_mb3dsdg_view_flagged( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-
-/* fprintf(stderr,"Called do_mb3dsdg_view_flagged\n"); */
-
-	mb3dsoundings.view_flagged = XmToggleButtonGetState(mb3dsoundings.mb3dsdg.toggleButton_view_flagged);
-
-	/* replot the data */
-	mb3dsoundings_plot(mbs_verbose, &mbs_error);
-}
-
-/*---------------------------------------------------------------------------------------*/
-
-void
-do_mb3dsdg_view_noprofile( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-
-/* fprintf(stderr,"Called do_mb3dsdg_view_noprofile\n"); */
-
-	mb3dsoundings.view_profiles = MBS_VIEW_PROFILES_NONE;
-
-   	XmToggleButtonSetState(mb3dsoundings.mb3dsdg.toggleButton_view_noconnect,
-			True, False);
-    	XmToggleButtonSetState(mb3dsoundings.mb3dsdg.toggleButton_view_connectgood,
-			False, False);
-    	XmToggleButtonSetState(mb3dsoundings.mb3dsdg.toggleButton_view_connectall,
-			False, False);
-
-	/* replot the data */
-	mb3dsoundings_plot(mbs_verbose, &mbs_error);
-}
-
-/*---------------------------------------------------------------------------------------*/
-
-void
-do_mb3dsdg_view_goodprofile( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-
-/* fprintf(stderr,"Called do_mb3dsdg_view_goodprofile\n"); */
-
-	mb3dsoundings.view_profiles = MBS_VIEW_PROFILES_UNFLAGGED;
-
-    	XmToggleButtonSetState(mb3dsoundings.mb3dsdg.toggleButton_view_noconnect,
-			False, False);
-    	XmToggleButtonSetState(mb3dsoundings.mb3dsdg.toggleButton_view_connectgood,
-			True, False);
-    	XmToggleButtonSetState(mb3dsoundings.mb3dsdg.toggleButton_view_connectall,
-			False, False);
-
-	/* replot the data */
-	mb3dsoundings_plot(mbs_verbose, &mbs_error);
-}
-
-/*---------------------------------------------------------------------------------------*/
-
-void
-do_mb3dsdg_view_allprofile( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-
-/* fprintf(stderr,"Called do_mb3dsdg_view_allprofile\n"); */
-
-	mb3dsoundings.view_profiles = MBS_VIEW_PROFILES_ALL;
-
-    	XmToggleButtonSetState(mb3dsoundings.mb3dsdg.toggleButton_view_noconnect,
-			False, False);
-    	XmToggleButtonSetState(mb3dsoundings.mb3dsdg.toggleButton_view_connectgood,
-			False, False);
-    	XmToggleButtonSetState(mb3dsoundings.mb3dsdg.toggleButton_view_connectall,
-			True, False);
-
-	/* replot the data */
-	mb3dsoundings_plot(mbs_verbose, &mbs_error);
-}
-
-/*---------------------------------------------------------------------------------------*/
-
-void
-do_mb3dsdg_resetview( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-
-/* fprintf(stderr,"Called do_mb3dsdg_view_reset\n"); */
-
-	/* reset view orientation */
-	mb3dsoundings.elevation = 0.0;
-	mb3dsoundings.azimuth = 0.0;
-	mb3dsoundings.exageration = 1.0;
-
-	/* rescale */
-	mb3dsoundings_scalez(mbs_verbose, &mbs_error);
-	mb3dsoundings_updatestatus();
-
-	/* replot the data */
-	mb3dsoundings_plot(mbs_verbose, &mbs_error);
-}
-
-/*---------------------------------------------------------------------------------------*/
-
-void
-do_mb3dsdg_view_boundingbox( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-
-/* fprintf(stderr,"Called do_mb3dsdg_view_boundingbox\n"); */
-
-	mb3dsoundings.view_boundingbox = XmToggleButtonGetState(mb3dsoundings.mb3dsdg.toggleButton_view_boundingbox);
-
-	/* replot the data */
-	mb3dsoundings_plot(mbs_verbose, &mbs_error);
-}
-
-/*---------------------------------------------------------------------------------------*/
-
-void
-do_mb3dsdg_view_scalewithflagged( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-
-/* fprintf(stderr,"Called do_mb3dsdg_view_scalewithflagged\n"); */
-
-	mb3dsoundings.view_scalewithflagged = XmToggleButtonGetState(mb3dsoundings.mb3dsdg.toggleButton_view_scalewithflagged);
-
-	/* replot the data */
-	mb3dsoundings_setzscale(mbs_verbose, &mbs_error);
-	mb3dsoundings_plot(mbs_verbose, &mbs_error);
-}
-
-/*---------------------------------------------------------------------------------------*/
-
-void
-do_mb3dsdg_action_applybias( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-
-/* fprintf(stderr,"Called do_mb3dsdg_action_applybias\n"); */
-
-	/* send bias parameters to calling program to be applied */
-	if (mb3dsoundings.mb3dsoundings_biasapply_notify != NULL)
-	(mb3dsoundings.mb3dsoundings_biasapply_notify)(0.01 *((double)mb3dsoundings.irollbias),
-						0.01 *((double)mb3dsoundings.ipitchbias),
-						0.01 *((double)mb3dsoundings.iheadingbias),
-						0.01 *((double)mb3dsoundings.itimelag));
-}
-/*---------------------------------------------------------------------------------------*/
-
-void
-do_mb3dsdg_action_colorsoundingsblack( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-
-/* fprintf(stderr,"Called do_mb3dsdg_action_colorsoundingsblack\n"); */
-
-	/* notify calling program to color current selected unflagged soundings */
-	if (mb3dsoundings.mb3dsoundings_colorsoundings_notify != NULL)
-	(mb3dsoundings.mb3dsoundings_colorsoundings_notify)(MBV_COLOR_BLACK);
-
-	/* replot the data */
-	mb3dsoundings_plot(mbs_verbose, &mbs_error);
-}
-
-/*---------------------------------------------------------------------------------------*/
-
-void
-do_mb3dsdg_action_colorsoundingsred( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-
-/* fprintf(stderr,"Called do_mb3dsdg_action_colorsoundingsred\n"); */
-
-	/* notify calling program to color current selected unflagged soundings */
-	if (mb3dsoundings.mb3dsoundings_colorsoundings_notify != NULL)
-	(mb3dsoundings.mb3dsoundings_colorsoundings_notify)(MBV_COLOR_RED);
-
-	/* replot the data */
-	mb3dsoundings_plot(mbs_verbose, &mbs_error);
-}
-
-/*---------------------------------------------------------------------------------------*/
-
-void
-do_mb3dsdg_action_colorsoundingsyellow( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-
-/* fprintf(stderr,"Called do_mb3dsdg_action_colorsoundingsyellow\n"); */
-
-	/* notify calling program to color current selected unflagged soundings */
-	if (mb3dsoundings.mb3dsoundings_colorsoundings_notify != NULL)
-	(mb3dsoundings.mb3dsoundings_colorsoundings_notify)(MBV_COLOR_YELLOW);
-
-	/* replot the data */
-	mb3dsoundings_plot(mbs_verbose, &mbs_error);
-}
-
-/*---------------------------------------------------------------------------------------*/
-
-void
-do_mb3dsdg_action_colorsoundingsgreen( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-
-/* fprintf(stderr,"Called do_mb3dsdg_action_colorsoundingsgreen\n"); */
-
-	/* notify calling program to color current selected unflagged soundings */
-	if (mb3dsoundings.mb3dsoundings_colorsoundings_notify != NULL)
-	(mb3dsoundings.mb3dsoundings_colorsoundings_notify)(MBV_COLOR_GREEN);
-
-	/* replot the data */
-	mb3dsoundings_plot(mbs_verbose, &mbs_error);
-}
-
-/*---------------------------------------------------------------------------------------*/
-
-void
-do_mb3dsdg_action_colorsoundingsbluegreen( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-
-/* fprintf(stderr,"Called do_mb3dsdg_action_colorsoundingsbluegreen\n"); */
-
-	/* notify calling program to color current selected unflagged soundings */
-	if (mb3dsoundings.mb3dsoundings_colorsoundings_notify != NULL)
-	(mb3dsoundings.mb3dsoundings_colorsoundings_notify)(MBV_COLOR_BLUEGREEN);
-
-	/* replot the data */
-	mb3dsoundings_plot(mbs_verbose, &mbs_error);
-}
-
-/*---------------------------------------------------------------------------------------*/
-
-void
-do_mb3dsdg_action_colorsoundingsblue( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-
-/* fprintf(stderr,"Called do_mb3dsdg_action_colorsoundingsblue\n"); */
-
-	/* notify calling program to color current selected unflagged soundings */
-	if (mb3dsoundings.mb3dsoundings_colorsoundings_notify != NULL)
-	(mb3dsoundings.mb3dsoundings_colorsoundings_notify)(MBV_COLOR_BLUE);
-
-	/* replot the data */
-	mb3dsoundings_plot(mbs_verbose, &mbs_error);
-}
-
-/*---------------------------------------------------------------------------------------*/
-
-void
-do_mb3dsdg_action_colorsoundingspurple( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-
-/* fprintf(stderr,"Called do_mb3dsdg_action_colorsoundingspurple\n"); */
-
-	/* notify calling program to color current selected unflagged soundings */
-	if (mb3dsoundings.mb3dsoundings_colorsoundings_notify != NULL)
-	(mb3dsoundings.mb3dsoundings_colorsoundings_notify)(MBV_COLOR_PURPLE);
-
-	/* replot the data */
-	mb3dsoundings_plot(mbs_verbose, &mbs_error);
-}
-
-/*---------------------------------------------------------------------------------------*/
-
-void
-do_mb3dsdg_mouse_panzoom( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-
-/* fprintf(stderr,"Called do_mb3dsdg_mouse_panzoom\n"); */
-
-	mb3dsoundings.mouse_mode = MBS_MOUSE_PANZOOM;
-   	XmToggleButtonSetState(mb3dsoundings.mb3dsdg.toggleButton_mouse_rotate,
-			False, False);
-    	XmToggleButtonSetState(mb3dsoundings.mb3dsdg.toggleButton_mouse_panzoom,
-			True, False);
-   	XmToggleButtonSetState(mb3dsoundings.mb3dsdg.toggleButton_mouse_rotate1,
-			False, False);
-    	XmToggleButtonSetState(mb3dsoundings.mb3dsdg.toggleButton_mouse_panzoom1,
-			True, False);
-
-	/* set mouse mode label */
-        sprintf(value_text, ":::t\"Mouse Mode:\":t\"L: Edit (Toggle)\":t\"M: Pan\"\"R: Zoom\"");
-	set_mbview_label_multiline_string(mb3dsoundings.mb3dsdg.label_mousemode, value_text);
-}
-
-/*---------------------------------------------------------------------------------------*/
-
-void
-do_mb3dsdg_mouse_rotate( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-
-/* fprintf(stderr,"Called do_mb3dsdg_mouse_rotate\n"); */
-
-	mb3dsoundings.mouse_mode = MBS_MOUSE_ROTATE;
-
-    	XmToggleButtonSetState(mb3dsoundings.mb3dsdg.toggleButton_mouse_rotate,
-			True, False);
-    	XmToggleButtonSetState(mb3dsoundings.mb3dsdg.toggleButton_mouse_panzoom,
-			False, False);
-    	XmToggleButtonSetState(mb3dsoundings.mb3dsdg.toggleButton_mouse_rotate1,
-			True, False);
-    	XmToggleButtonSetState(mb3dsoundings.mb3dsdg.toggleButton_mouse_panzoom1,
-			False, False);
-
-	/* set mouse mode label */
-        sprintf(value_text, ":::t\"Mouse Mode:\":t\"L: Edit (Toggle)\":t\"M: Rotate Soundings\"\"R: Exageration\"");
-	set_mbview_label_multiline_string(mb3dsoundings.mb3dsdg.label_mousemode, value_text);
-}
-
-/*---------------------------------------------------------------------------------------*/
diff --git a/src/mbview/mb3dsoundings_creation.c b/src/mbview/mb3dsoundings_creation.c
deleted file mode 100644
index 4314c98..0000000
--- a/src/mbview/mb3dsoundings_creation.c
+++ /dev/null
@@ -1,128 +0,0 @@
-
-/* Begin user code block <abstract> */
-/* End user code block <abstract> */
-
-/**
- * README: Portions of this file are merged at file generation
- * time. Edits can be made *only* in between specified code blocks, look
- * for keywords <Begin user code> and <End user code>.
- */
-/*
- * Generated by the ICS Builder Xcessory (BX).
- *
- * BuilderXcessory Version 6.1.3
- * Code Generator Xcessory 6.1.3 (08/19/04) CGX Scripts 6.1 Motif 2.1
- *
- */
-
-
-/* Begin user code block <file_comments> */
-
-#ifndef SANS
-#define SANS "helvetica"
-#endif
-#ifndef SERIF
-#define SERIF "times"
-#endif
-#ifndef MONO
-#define MONO "courier"
-#endif
-
-/* End user code block <file_comments> */
-
-#include <Xm/Xm.h>
-#include <Xm/MainW.h>
-#include <Xm/DialogS.h>
-#include <Xm/MwmUtil.h>
-#include <Xm/Form.h>
-#include <Xm/MainW.h>
-#include <Xm/DialogS.h>
-#include <Xm/MwmUtil.h>
-#include <Xm/Form.h>
-
-/**
- * Globally included information.
- */
-
-#include "Mb3dsdg.h"
-
-/**
- * Common constant and pixmap declarations.
- */
-#include "mb3dsoundings_creation.h"
-
-/**
- * Convenience functions from utilities file.
- */
-extern void RegisterBxConverters(XtAppContext);
-extern XtPointer BX_CONVERT(Widget, char *, char *, int, Boolean *);
-extern XtPointer BX_DOUBLE(double);
-extern XtPointer BX_SINGLE(float);
-extern void BX_MENU_POST(Widget, XtPointer, XEvent *, Boolean *);
-extern Pixmap XPM_PIXMAP(Widget, char **);
-extern void BX_SET_BACKGROUND_COLOR(Widget, ArgList, Cardinal *, Pixel);
-
-/**
- * Declarations for callbacks and handlers.
- */
-extern void BxExitCB(Widget, XtPointer, XtPointer);
-
-/**
- * Create the mb3dsdg_mainWindow hierarchy of widgets.
- */
-Widget
-Createmb3dsdg_mainWindow(Widget parent)
-{
-    Cardinal ac = 0;
-    Arg      args[256];
-    Cardinal cdc = 0;
-    Boolean  argok = False;
-    Widget   mb3dsdg_mainWindow;
-    Widget   mb3dsdg_dialogShell;
-    static Mb3dsdgData mb3dsdg;
-
-    /**
-     * Register the converters for the widgets.
-     */
-    RegisterBxConverters(XtWidgetToApplicationContext(parent));
-    XtInitializeWidgetClass((WidgetClass)xmMainWindowWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmDialogShellWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmFormWidgetClass);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 747); ac++;
-    XtSetArg(args[ac], XmNy, 78); ac++;
-    XtSetArg(args[ac], XmNwidth, 197); ac++;
-    XtSetArg(args[ac], XmNheight, 104); ac++;
-    mb3dsdg_mainWindow = XmCreateMainWindow(parent,
-        (char *)"mb3dsdg_mainWindow",
-        args,
-        ac);
-    XtAddCallback(mb3dsdg_mainWindow, XmNdestroyCallback, BxExitCB, (XtPointer)0);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNwidth, 1011); ac++;
-    XtSetArg(args[ac], XmNheight, 660); ac++;
-    XtSetArg(args[ac], XmNdeleteResponse, XmDO_NOTHING); ac++;
-    mb3dsdg_dialogShell = XmCreateDialogShell(mb3dsdg_mainWindow,
-        (char *)"mb3dsdg_dialogShell",
-        args,
-        ac);
-
-    Mb3dsdgCreate(&(mb3dsdg),
-        mb3dsdg_dialogShell,
-        "mb3dsdg",
-        args,
-        ac);
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 0); ac++;
-    XtSetArg(args[ac], XmNy, 1007); ac++;
-    XtSetArg(args[ac], XmNwidth, 1011); ac++;
-    XtSetArg(args[ac], XmNheight, 660); ac++;
-    XtSetValues(mb3dsdg.Mb3dsdg, args, ac);
-
-
-    /* Begin user code block <end_Createmb3dsdg_mainWindow> */
-    /* End user code block <end_Createmb3dsdg_mainWindow> */
-    return( mb3dsdg_mainWindow );
-}
diff --git a/src/mbview/mb3dsoundings_creation.h b/src/mbview/mb3dsoundings_creation.h
deleted file mode 100644
index 1f26232..0000000
--- a/src/mbview/mb3dsoundings_creation.h
+++ /dev/null
@@ -1,17 +0,0 @@
-
-/* Begin user code block <abstract> */
-/* End user code block <abstract> */
-
-/**
- * WARNING: This file is overwritten at code generation time.
- * Any changes to this file will be lost.
- */
-/*
- *
- * Created by BuilderXcessory Version 6.1.3
- * Generated by Code Generator Xcessory 6.1.3 (08/19/04) CGX Scripts 6.1 Motif 2.1 
- *
- */
-#ifndef mb3dsoundings_creation_H
-#define mb3dsoundings_creation_H
-#endif
diff --git a/src/mbview/mb3dsoundings_main.c b/src/mbview/mb3dsoundings_main.c
deleted file mode 100644
index 7a8a1fc..0000000
--- a/src/mbview/mb3dsoundings_main.c
+++ /dev/null
@@ -1,142 +0,0 @@
-
-/* Begin user code block <abstract> */
-/* End user code block <abstract> */
-
-/**
- * README: Portions of this file are merged at file generation
- * time. Edits can be made *only* in between specified code blocks, look
- * for keywords <Begin user code> and <End user code>.
- */
-/*
- * Generated by the ICS Builder Xcessory (BX).
- *
- * BuilderXcessory Version 6.1.3
- * Code Generator Xcessory 6.1.3 (08/19/04) CGX Scripts 6.1 Motif 2.1
- *
- */
-
-
-/* Begin user code block <file_comments> */
-/* End user code block <file_comments> */
-
-/*
- * Motif required Headers
- */
-#include <X11/StringDefs.h>
-#include <Xm/Xm.h>
-#include <Xm/DialogS.h>
-#include <Xm/RepType.h>
-#include <Xm/MwmUtil.h>
-
-/**
- * Globally included information.
- */
-
-
-/*
- * Headers for classes used in this program
- */
-#include "Mb3dsdg.h"
-
-/**
- * Common constant and pixmap declarations.
- */
-#include "mb3dsoundings_creation.h"
-
-/**
- * Convenience functions from utilities file.
- */
-extern void RegisterBxConverters(XtAppContext);
-extern XtPointer BX_CONVERT(Widget, char *, char *, int, Boolean *);
-extern XtPointer BX_DOUBLE(double);
-extern XtPointer BX_SINGLE(float);
-extern void BX_MENU_POST(Widget, XtPointer, XEvent *, Boolean *);
-extern Pixmap XPM_PIXMAP(Widget, char **);
-extern void BX_SET_BACKGROUND_COLOR(Widget, ArgList, Cardinal *, Pixel);
-
-/* Begin user code block <globals> */
-/* End user code block <globals> */
-
-/**
- * Change this line via the Output Application Names Dialog.
- */
-#define BX_APP_CLASS "MB-System"
-
-int main( int argc, char **argv)
-{
-    Widget       parent;
-    XtAppContext app;
-    Arg          args[256];
-    Cardinal     ac;
-    Boolean      argok=False;
-    Widget   topLevelShell;
-    Widget   mb3dsdg_mainWindow;
-
-    /* Begin user code block <declarations> */
-    /* End user code block <declarations> */
-
-    /*
-     * Initialize Xt.
-     */
-
-    // XtSetLanguageProc(NULL, (XtLanguageProc) NULL, NULL);
-
-    /*
-     * The applicationShell is created as an unrealized
-     * parent for multiple topLevelShells.  The topLevelShells
-     * are created as popup children of the applicationShell.
-     * This is a recommendation of Paul Asente & Ralph Swick in
-     * _X_Window_System_Toolkit_ p. 677.
-     */
-
-    parent = XtVaOpenApplication ( &app,
-                                   BX_APP_CLASS,
-                                   NULL,
-                                   0,
-                                   &argc,
-                                   argv,
-                                   NULL,
-                                   sessionShellWidgetClass,
-                                   NULL );
-
-    RegisterBxConverters(app);
-    XmRepTypeInstallTearOffModelConverter();
-
-    /* Begin user code block <create_shells> */
-    /* End user code block <create_shells> */
-
-    /*
-     * Create classes and widgets used in this program.
-     */
-
-    /* Begin user code block <create_topLevelShell> */
-    /* End user code block <create_topLevelShell> */
-
-    ac = 0;
-    XtSetArg(args[ac], XmNtitle, "MBgrdviz"); ac++;
-    XtSetArg(args[ac], XmNx, 747); ac++;
-    XtSetArg(args[ac], XmNy, 78); ac++;
-    XtSetArg(args[ac], XmNwidth, 197); ac++;
-    XtSetArg(args[ac], XmNheight, 104); ac++;
-    topLevelShell = XtCreatePopupShell((char *)"topLevelShell",
-        topLevelShellWidgetClass,
-        parent,
-        args,
-        ac);
-    mb3dsdg_mainWindow = (Widget)Createmb3dsdg_mainWindow(topLevelShell);
-    XtManageChild(mb3dsdg_mainWindow);
-    XtPopup(XtParent(mb3dsdg_mainWindow), XtGrabNone);
-
-    /* Begin user code block <app_procedures> */
-    /* End user code block <app_procedures> */
-
-    /* Begin user code block <main_loop> */
-    /* End user code block <main_loop> */
-
-    XtAppMainLoop(app);
-
-    /*
-     * A return value regardless of whether or not the main loop ends.
-     */
-     return(0);
-}
diff --git a/src/mbview/mb3dsoundingsprivate.h b/src/mbview/mb3dsoundingsprivate.h
deleted file mode 100644
index 0423257..0000000
--- a/src/mbview/mb3dsoundingsprivate.h
+++ /dev/null
@@ -1,310 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mb3dsoundingsprivate.h	9/24/2003
- *    $Id: mb3dsoundingsprivate.h 2247 2015-05-29 21:28:28Z caress $
- *
- *    Copyright (c) 2007-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- *
- * Author:	D. W. Caress
- * Date:	May 25,  2007
- *
- *
- */
-
-/*--------------------------------------------------------------------*/
-
-/* OpenGL Error checking */
-/* #define MBS_GETERRORS 1 */
-
-/* OpenGL plotting parameters */
-#define LEFT_WIDTH 200
-#define LEFT_HEIGHT 30
-#define MBS_OPENGL_WIDTH 3.0
-#define MBS_OPENGL_ZMIN2D -5.0
-#define MBS_OPENGL_ZMAX2D 1000.0
-#define MBS_OPENGL_ZMIN3D 100000.0
-#define MBS_OPENGL_ZMAX3D 100000000.0
-
-/* OpenGL list IDs */
-#define MBS_GLLIST_3DSOUNDINGS  41
-
-#define MBS_PICK_IDIVISION 15
-#define MBS_PICK_DIVISION ((double)MBS_PICK_IDIVISION)
-#define MBS_PICK_DOWN	1
-#define MBS_PICK_MOVE	2
-#define MBS_PICK_UP	3
-
-#define MBS_WINDOW_NULL 	0
-#define MBS_WINDOW_HIDDEN 	1
-#define MBS_WINDOW_VISIBLE 	2
-#define MBS_LEFT_WIDTH		40
-#define MBS_LEFT_HEIGHT		40
-#define	MBS_NUM_COLORS   11
-
-#define MBS_OPENGL_WIDTH 3.0
-#define MBS_OPENGL_ZMIN2D -5.0
-#define MBS_OPENGL_ZMAX2D 1000.0
-#define MBS_OPENGL_ZMIN3D 100000.0
-#define MBS_OPENGL_ZMAX3D 100000000.0
-#define MBS_OPENGL_3D_CONTOUR_OFFSET 0.001
-#define MBS_OPENGL_3D_LINE_OFFSET 0.005
-#define MBS_OPENGL_ZPROFILE1 -100.0
-#define MBS_OPENGL_ZPROFILE2 -200.0
-
-#define	MBS_MOUSE_ROTATE	0
-#define	MBS_MOUSE_PANZOOM	1
-#define MBS_EDIT_TOGGLE		0
-#define MBS_EDIT_PICK		1
-#define MBS_EDIT_ERASE		2
-#define MBS_EDIT_RESTORE	3
-#define MBS_EDIT_GRAB		4
-#define MBS_EDIT_INFO		5
-#define MBS_PICK_THRESHOLD	50
-#define MBS_ERASE_THRESHOLD	15
-#define MBS_EDIT_GRAB_START	0
-#define MBS_EDIT_GRAB_MOVE	1
-#define MBS_EDIT_GRAB_END	2
-
-#define	MBS_VIEW_PROFILES_NONE		0
-#define	MBS_VIEW_PROFILES_UNFLAGGED	1
-#define	MBS_VIEW_PROFILES_ALL		2
-
-
-/* structure to hold instances of mb3dsoundings windows */
-struct mb3dsoundings_world_struct
-    {
-    /* flag if this instance is initialized */
-    int			init;
-
-    /* function pointers */
-    void (*mb3dsoundings_dismiss_notify)(void);
-    void (*mb3dsoundings_edit_notify)(int ifile, int iping, int ibeam, char beamflag, int flush);
-    void (*mb3dsoundings_info_notify)(int ifile, int iping, int ibeam, char *infostring);
-    void (*mb3dsoundings_bias_notify)(double rollbias, double pitchbias, double headingbias, double timelag);
-    void (*mb3dsoundings_biasapply_notify)(double rollbias, double pitchbias, double headingbias, double timelag);
-    void (*mb3dsoundings_colorsoundings_notify)(int color);
-
-    /* pointer to structure holding data to be rendered */
-    struct mb3dsoundings_struct *soundingdata;
-
-    /* widgets and other Xwindows stuff of interest */
-    Widget		topLevelShell;
-    Widget		mainWindow;
-    Widget		glwmda;
-    Mb3dsdgData		mb3dsdg;
-    Display		*dpy;
-    Window		xid;
-    XVisualInfo 	*vi;
-    int			glx_init;
-#ifdef WIN32
-    HGLRC		glx_context;
-#else
-    GLXContext		glx_context;
-#endif
-    int			message_on;
-
-    /* mode parameters */
-    int			mouse_mode;
-    int			edit_mode;
-    int			keyreverse_mode;
-    int			mousereverse_mode;
-
-    /* cursors */
-    Cursor TargetBlackCursor;
-    Cursor TargetGreenCursor;
-    Cursor TargetRedCursor;
-    Cursor TargetBlueCursor;
-    Cursor ExchangeBlackCursor;
-    Cursor ExchangeGreenCursor;
-    Cursor ExchangeRedCursor;
-    Cursor FleurBlackCursor;
-    Cursor FleurRedCursor;
-    Cursor SizingBlackCursor;
-    Cursor SizingRedCursor;
-    Cursor BoatBlackCursor;
-    Cursor BoatRedCursor;
-    Cursor WatchBlackCursor;
-    Cursor WatchRedCursor;
-
-    /* drawing variables */
-    float elevation;
-    float azimuth;
-    float exageration;
-    float elevation_save;
-    float azimuth_save;
-    float exageration_save;
-    Dimension gl_xo;
-    Dimension gl_yo;
-    Dimension gl_width;
-    Dimension gl_height;
-    float right;
-    float left;
-    float top;
-    float bottom;
-    float aspect_ratio;
-    float gl_offset_x;
-    float gl_offset_y;
-    float gl_offset_x_save;
-    float gl_offset_y_save;
-    float gl_size;
-    float gl_size_save;
-
-    /* button parameters */
-    int button1down;
-    int button2down;
-    int button3down;
-    int button_down_x;
-    int button_down_y;
-    int button_move_x;
-    int button_move_y;
-    int button_up_x;
-    int button_up_y;
-
-    /* edit grab parameters */
-    int grab_start_defined;
-    int grab_end_defined;
-    int	grab_start_x;
-    int	grab_start_y;
-    int	grab_end_x;
-    int	grab_end_y;
-
-    /* patch test parameters */
-    int	irollbias;
-    int	ipitchbias;
-    int	iheadingbias;
-    int	itimelag;
-
-    /* view parameters */
-    int	view_boundingbox;
-    int	view_flagged;
-    int	view_profiles;
-    int	view_scalewithflagged;
-
-    /* last sounding edited */
-    int	last_sounding_defined;
-    int	last_sounding_edited;
-    };
-
-/* library variables */
-/*   note that global mb3dsoundings variables will only be defined when
-     this code is included in mb3dsoundings_callbacks.c where the
-     MB3DSOUNDINGSGLOBAL flag is defined - other blocks of code will
-     have these variables declared as extern  */
-#ifdef MB3DSOUNDINGSGLOBAL
-#define EXTERNAL
-#else
-#define EXTERNAL extern
-#endif
-
-/* general library global variables */
-EXTERNAL int	mbs_verbose;
-EXTERNAL int	mbs_status;
-EXTERNAL int	mbs_error;
-EXTERNAL int	mbs_ninstance;
-EXTERNAL Widget	mbs_parent_widget;
-EXTERNAL XtAppContext	mbs_app_context;
-EXTERNAL int	mbs_work_function_set;
-EXTERNAL int	mbs_timer_count;
-EXTERNAL struct mb3dsoundings_world_struct mb3dsoundings;
-EXTERNAL int key_g_down = 0;
-EXTERNAL int key_z_down = 0;
-EXTERNAL int key_s_down = 0;
-EXTERNAL int key_a_down = 0;
-EXTERNAL int key_d_down = 0;
-
-/* global declarations */
-#ifdef MB3DSOUNDINGSGLOBAL
-
-/* library colortables */
-char	*mb3dsoundings_colorname[MBS_NUM_COLORS] =
-		{ "Black",
-		  "White",
-		  "Red",
-		  "Yellow",
-		  "Green",
-		  "Blue-Green",
-		  "Blue",
-		  "Purple" };
-
-/* extern declarations */
-#else
-
-/* library colortables */
-extern char	*mb3dsoundings_colorname[MBS_NUM_COLORS];
-#endif
-
-/*--------------------------------------------------------------------*/
-
-int mb3dsoundings_startup(int verbose, Widget parent, XtAppContext app, int *error);
-int mb3dsoundings_updatecursor(void);
-int mb3dsoundings_updategui(void);
-int mb3dsoundings_updatestatus(void);
-int mb3dsoundings_reset(void);
-int mb3dsoundings_reset_glx(void);
-void do_mb3dsdg_resize( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mb3dsdg_dismiss( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mb3dsdg_mouse_pick( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mb3dsdg_mouse_grab( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mb3dsdg_mouse_erase( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mb3dsdg_mouse_toggle( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mb3dsdg_mouse_restore( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mb3dsdg_mouse_info( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mb3dsdg_input( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mb3dsdg_glwda_expose( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mb3dsdg_glwda_input( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mb3dsdg_glwda_resize( Widget w, XtPointer client_data, XtPointer call_data);
-int mb3dsoundings_setzscale(int verbose, int *error);
-int mb3dsoundings_scale(int verbose, int *error);
-int mb3dsoundings_scalez(int verbose, int *error);
-int mb3dsoundings_pick(int x, int y);
-int mb3dsoundings_eraserestore(int x, int y);
-int mb3dsoundings_grab(int x, int y, int grabmode);
-int mb3dsoundings_info(int x, int y);
-void do_mb3dsdg_rollbias( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mb3dsdg_pitchbias( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mb3dsdg_headingbias( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mb3dsdg_timelag( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mb3dsdg_view_flagged( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mb3dsdg_view_noprofile( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mb3dsdg_view_goodprofile( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mb3dsdg_view_allprofile( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mb3dsdg_resetview( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mb3dsdg_action_applybias( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mb3dsdg_action_colorsoundingsblack( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mb3dsdg_action_colorsoundingsred( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mb3dsdg_action_colorsoundingsyellow( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mb3dsdg_action_colorsoundingsgreen( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mb3dsdg_action_colorsoundingsbluegreen( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mb3dsdg_action_colorsoundingsblue( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mb3dsdg_action_colorsoundingspurple( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mb3dsdg_view_boundingbox( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mb3dsdg_view_scalewithflagged( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mb3dsdg_view_reset( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mb3dsdg_mouse_panzoom( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mb3dsdg_mouse_rotate( Widget w, XtPointer client_data, XtPointer call_data);
-int mb3dsoundings_updatemodetoggles(void);
-int mb3dsoundings_bad_ping(void);
-int mb3dsoundings_good_ping(void);
-int mb3dsoundings_left_ping(void);
-int mb3dsoundings_right_ping(void);
-int mb3dsoundings_flag_view(void);
-int mb3dsoundings_unflag_view(void);
-int mb3dsoundings_zero_ping(void);
-
-void BxUnmanageCB(Widget w, XtPointer client, XtPointer call);
-void BxManageCB(Widget w, XtPointer client, XtPointer call);
-void BxPopupCB(Widget w, XtPointer client, XtPointer call);
-XtPointer BX_CONVERT(Widget w, char *from_string, char *to_type, int to_size, Boolean *success);
-void BxExitCB(Widget w, XtPointer client, XtPointer call);
-void BxSetValuesCB(Widget w, XtPointer client, XtPointer call);
-
-/*--------------------------------------------------------------------*/
diff --git a/src/mbview/mb_glwdrawa.c b/src/mbview/mb_glwdrawa.c
deleted file mode 100644
index be76230..0000000
--- a/src/mbview/mb_glwdrawa.c
+++ /dev/null
@@ -1,680 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mb_glwdrawa.c	5/22/2007
- *    $Id: mb_glwdrawa.c 2239 2015-05-07 00:51:42Z caress $
- *
- *    Altered from original code for MB-System by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See notes below for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- *
- * Author:	D. W. Caress
- * Date:	May 22, 2007
- *
- * $Log: mb_glwdrawa.c,v $
- * Revision 5.0  2007/06/17 23:16:14  caress
- * Added MBeditviz.
- *
- * Revision 5.0  2007/05/23 16:39:54  caress
- * Added library for Motif OpenGL widget because this library is no longer uniformly available in Xfree86 distributions.
- *
- *
- */
-/*------------------------------------------------------------------------------*/
-/*
- * (c) Copyright 1993, Silicon Graphics, Inc.
- * ALL RIGHTS RESERVED 
- * Permission to use, copy, modify, and distribute this software for 
- * any purpose and without fee is hereby granted, provided that the above
- * copyright notice appear in all copies and that both the copyright notice
- * and this permission notice appear in supporting documentation, and that 
- * the name of Silicon Graphics, Inc. not be used in advertising
- * or publicity pertaining to distribution of the software without specific,
- * written prior permission. 
- *
- * THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS"
- * AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE,
- * INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR
- * FITNESS FOR A PARTICULAR PURPOSE.  IN NO EVENT SHALL SILICON
- * GRAPHICS, INC.  BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT,
- * SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY
- * KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION,
- * LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF
- * THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC.  HAS BEEN
- * ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE
- * POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE.
- * 
- * 
- * US Government Users Restricted Rights 
- * Use, duplication, or disclosure by the Government is subject to
- * restrictions set forth in FAR 52.227.19(c)(2) or subparagraph
- * (c)(1)(ii) of the Rights in Technical Data and Computer Software
- * clause at DFARS 252.227-7013 and/or in similar or successor
- * clauses in the FAR or the DOD or NASA FAR Supplement.
- * Unpublished-- rights reserved under the copyright laws of the
- * United States.  Contractor/manufacturer is Silicon Graphics,
- * Inc., 2011 N.  Shoreline Blvd., Mountain View, CA 94039-7311.
- *
- * OpenGL(TM) is a trademark of Silicon Graphics, Inc.
- */
-
-/*
- *
- * This file has been slightly modified from the original for use with Mesa
- *
- *     Jeroen van der Zijp
- *
- *     jvz at cyberia.cfdrc.com
- *
- */
-#include <X11/IntrinsicP.h>
-#include <X11/StringDefs.h>
-
-#ifdef WIN32
-#undef BOOL		/* It was defined by a chain of inclusions in the (patched) X11/Xmd.h */
-#include <windows.h>
-#endif
-
-#ifndef WIN32
-#	include <GL/glx.h>
-#endif
-#include <GL/gl.h>
-#include <Xm/PrimitiveP.h>
-#include "mb_glwdrawap.h"
-#include <assert.h>
-#include <stdio.h>
-
-#define mbGLwDrawingAreaWidget             mbGLwMDrawingAreaWidget
-#define mbGLwDrawingAreaClassRec           mbGLwMDrawingAreaClassRec
-#define mbglwDrawingAreaClassRec         mbglwMDrawingAreaClassRec
-#define mbglwDrawingAreaWidgetClass      mbglwMDrawingAreaWidgetClass
-#define mbGLwDrawingAreaRec                mbGLwMDrawingAreaRec
-
-#define ATTRIBLIST_SIZE 32
-
-#define offset(field) XtOffset(mbGLwDrawingAreaWidget,mbglwDrawingArea.field)
-
-
-/* forward definitions */
-static void createColormap(mbGLwDrawingAreaWidget w,int offset,XrmValue *value);
-static void Initialize(mbGLwDrawingAreaWidget req,mbGLwDrawingAreaWidget neww,ArgList args,Cardinal *num_args);
-static void Realize(Widget w,Mask *valueMask,XSetWindowAttributes *attributes);
-static void Redraw(mbGLwDrawingAreaWidget w,XEvent *event,Region region);
-static void Resize(mbGLwDrawingAreaWidget mbglw);
-static void Destroy(mbGLwDrawingAreaWidget mbglw);
-static void mbglwInput(mbGLwDrawingAreaWidget mbglw,XEvent *event,String *params,Cardinal *numParams);
-
-
-
-static char defaultTranslations[] =
-     "<Key>osfHelp:PrimitiveHelp() \n"
-    "<KeyDown>:   mbglwInput() \n\
-     <KeyUp>:     mbglwInput() \n\
-     <BtnDown>:   mbglwInput() \n\
-     <BtnUp>:     mbglwInput() \n\
-     <BtnMotion>: mbglwInput() ";
-
-
-static XtActionsRec actions[] = {
-  {"mbglwInput",(XtActionProc)mbglwInput},                /* key or mouse input */
-  };
-
-
-/*
- * There is a bit of unusual handling of the resources here.
- * Because Xt insists on allocating the colormap resource when it is
- * processing the core resources (even if we redeclare the colormap
- * resource here, we need to do a little trick.  When Xt first allocates
- * the colormap, we allow it to allocate the default one, since we have
- * not yet determined the appropriate visual (which is determined from
- * resources parsed after the colormap).  We also let it allocate colors
- * in that default colormap.
- *
- * In the initialize proc we calculate the actual visual.  Then, we
- * reobtain the colormap resource using XtGetApplicationResources in
- * the initialize proc.  If requested, we also reallocate colors in
- * that colormap using the same method.
- */
-
-static XtResource resources[] = {
-  /* The GLX attributes.  Add any new attributes here */
-
-  {mbGLwNbufferSize, mbGLwCBufferSize, XtRInt, sizeof (int),
-       offset(bufferSize), XtRImmediate, (XtPointer) 0},
-  
-  {mbGLwNlevel, mbGLwCLevel, XtRInt, sizeof (int),
-       offset(level), XtRImmediate, (XtPointer) 0},
-  
-  {mbGLwNrgba, mbGLwCRgba, XtRBoolean, sizeof (Boolean),
-       offset(rgba), XtRImmediate, (XtPointer) FALSE},
-  
-  {mbGLwNdoublebuffer, mbGLwCDoublebuffer, XtRBoolean, sizeof (Boolean),
-       offset(doublebuffer), XtRImmediate, (XtPointer) FALSE},
-  
-  {mbGLwNstereo, mbGLwCStereo, XtRBoolean, sizeof (Boolean),
-       offset(stereo), XtRImmediate, (XtPointer) FALSE},
-  
-  {mbGLwNauxBuffers, mbGLwCAuxBuffers, XtRInt, sizeof (int),
-       offset(auxBuffers), XtRImmediate, (XtPointer) 0},
-  
-  {mbGLwNredSize, mbGLwCColorSize, XtRInt, sizeof (int),
-       offset(redSize), XtRImmediate, (XtPointer) 1},
-  
-  {mbGLwNgreenSize, mbGLwCColorSize, XtRInt, sizeof (int),
-       offset(greenSize), XtRImmediate, (XtPointer) 1},
-  
-  {mbGLwNblueSize, mbGLwCColorSize, XtRInt, sizeof (int),
-       offset(blueSize), XtRImmediate, (XtPointer) 1},
-  
-  {mbGLwNalphaSize, mbGLwCAlphaSize, XtRInt, sizeof (int),
-       offset(alphaSize), XtRImmediate, (XtPointer) 0},
-  
-  {mbGLwNdepthSize, mbGLwCDepthSize, XtRInt, sizeof (int),
-       offset(depthSize), XtRImmediate, (XtPointer) 0},
-  
-  {mbGLwNstencilSize, mbGLwCStencilSize, XtRInt, sizeof (int),
-       offset(stencilSize), XtRImmediate, (XtPointer) 0},
-  
-  {mbGLwNaccumRedSize, mbGLwCAccumColorSize, XtRInt, sizeof (int),
-       offset(accumRedSize), XtRImmediate, (XtPointer) 0},
-  
-  {mbGLwNaccumGreenSize, mbGLwCAccumColorSize, XtRInt, sizeof (int),
-       offset(accumGreenSize), XtRImmediate, (XtPointer) 0},
-  
-  {mbGLwNaccumBlueSize, mbGLwCAccumColorSize, XtRInt, sizeof (int),
-       offset(accumBlueSize), XtRImmediate, (XtPointer) 0},
-  
-  {mbGLwNaccumAlphaSize, mbGLwCAccumAlphaSize, XtRInt, sizeof (int),
-       offset(accumAlphaSize), XtRImmediate, (XtPointer) 0},
-  
-  /* the attribute list */
-  {mbGLwNattribList, mbGLwCAttribList, XtRPointer, sizeof(int *),
-       offset(attribList), XtRImmediate, (XtPointer) NULL},
-
-  /* the visual info */
-  {mbGLwNvisualInfo, mbGLwCVisualInfo, mbGLwRVisualInfo, sizeof (XVisualInfo *),
-       offset(visualInfo), XtRImmediate, (XtPointer) NULL},
-
-  /* miscellaneous resources */
-  {mbGLwNinstallColormap, mbGLwCInstallColormap, XtRBoolean, sizeof (Boolean),
-       offset(installColormap), XtRImmediate, (XtPointer) TRUE},
-
-  {mbGLwNallocateBackground, mbGLwCAllocateColors, XtRBoolean, sizeof (Boolean),
-       offset(allocateBackground), XtRImmediate, (XtPointer) FALSE},
-
-  {mbGLwNallocateOtherColors, mbGLwCAllocateColors, XtRBoolean, sizeof (Boolean),
-       offset(allocateOtherColors), XtRImmediate, (XtPointer) FALSE},
-
-  {mbGLwNinstallBackground, mbGLwCInstallBackground, XtRBoolean, sizeof (Boolean),
-       offset(installBackground), XtRImmediate, (XtPointer) TRUE},
-
-  {mbGLwNginitCallback, mbGLwCCallback, XtRCallback, sizeof (XtCallbackList),
-       offset(ginitCallback), XtRImmediate, (XtPointer) NULL},
-
-  {mbGLwNinputCallback, mbGLwCCallback, XtRCallback, sizeof (XtCallbackList),
-       offset(inputCallback), XtRImmediate, (XtPointer) NULL},
-
-  {mbGLwNresizeCallback, mbGLwCCallback, XtRCallback, sizeof (XtCallbackList),
-       offset(resizeCallback), XtRImmediate, (XtPointer) NULL},
-
-  {mbGLwNexposeCallback, mbGLwCCallback, XtRCallback, sizeof (XtCallbackList),
-       offset(exposeCallback), XtRImmediate, (XtPointer) NULL},
-
-  /* Changes to Motif primitive resources */
-  {XmNtraversalOn, XmCTraversalOn, XmRBoolean, sizeof (Boolean),
-   XtOffset (mbGLwDrawingAreaWidget, primitive.traversal_on), XmRImmediate,
-   (XtPointer)FALSE},
-  
-  /* highlighting is normally disabled, as when Motif tries to disable
-   * highlighting, it tries to reset the color back to the parent's
-   * background (usually Motif blue).  Unfortunately, that is in a
-   * different colormap, and doesn't work too well.
-   */
-  {XmNhighlightOnEnter, XmCHighlightOnEnter, XmRBoolean, sizeof (Boolean),
-   XtOffset (mbGLwDrawingAreaWidget, primitive.highlight_on_enter),
-   XmRImmediate, (XtPointer) FALSE},
-  
-  {XmNhighlightThickness, XmCHighlightThickness, XmRHorizontalDimension,
-   sizeof (Dimension),
-   XtOffset (mbGLwDrawingAreaWidget, primitive.highlight_thickness),
-   XmRImmediate, (XtPointer) 0},
-  };
-
-
-/*
-** The following resources are reobtained using XtGetApplicationResources
-** in the initialize proc.
-*/
-
-/* The colormap */
-static XtResource initializeResources[] = {
-  /* reobtain the colormap with the new visual */
-  {XtNcolormap, XtCColormap, XtRColormap, sizeof(Colormap),
-   XtOffset(mbGLwDrawingAreaWidget, core.colormap),
-   XtRCallProc,(XtPointer) createColormap},
-  };
-
-
-/* reallocate any colors we need in the new colormap */
-  
-/* The background is obtained only if the allocateBackground resource is TRUE*/
-static XtResource backgroundResources[] = {
-  {XmNbackground, XmCBackground,XmRPixel, 
-   sizeof(Pixel),XtOffset(mbGLwDrawingAreaWidget,core.background_pixel),
-   XmRString,(XtPointer)"lightgrey"},
-   /*XmRCallProc,(XtPointer)_XmBackgroundColorDefault},*/
-
-  {XmNbackgroundPixmap,XmCPixmap,XmRXmBackgroundPixmap, 
-   sizeof(Pixmap),XtOffset(mbGLwDrawingAreaWidget,core.background_pixmap),
-   XmRImmediate,(XtPointer)XmUNSPECIFIED_PIXMAP},
-  };
-
-
-
-/* The other colors such as the foreground are allocated only if
- * allocateOtherColors are set.  These resources only exist in Motif.
- */
-static XtResource otherColorResources[] = {
-  {XmNforeground,XmCForeground,XmRPixel, 
-   sizeof(Pixel),XtOffset(mbGLwDrawingAreaWidget,primitive.foreground),
-   XmRString,(XtPointer)"lighgrey"},
-   /*XmRCallProc, (XtPointer) _XmForegroundColorDefault},*/
-
-  {XmNhighlightColor,XmCHighlightColor,XmRPixel,sizeof(Pixel),
-   XtOffset(mbGLwDrawingAreaWidget,primitive.highlight_color),
-   XmRString,(XtPointer)"lightgrey"},
-   /*XmRCallProc,(XtPointer)_XmHighlightColorDefault},*/
-
-  {XmNhighlightPixmap,XmCHighlightPixmap,XmRPrimHighlightPixmap,
-   sizeof(Pixmap),
-   XtOffset(mbGLwDrawingAreaWidget,primitive.highlight_pixmap),
-   XmRImmediate,(XtPointer)XmUNSPECIFIED_PIXMAP},
-   /*XmRCallProc,(XtPointer)_XmPrimitiveHighlightPixmapDefault},*/
-  };
-
-
-#undef offset
-
-
-mbGLwDrawingAreaClassRec mbglwDrawingAreaClassRec = {
-  { /* core fields */
-    /* superclass                */        (WidgetClass) &xmPrimitiveClassRec,
-    /* class_name                */        "mbGLwMDrawingArea",
-    /* widget_size               */        sizeof(mbGLwDrawingAreaRec),
-    /* class_initialize          */        NULL,
-    /* class_part_initialize     */        NULL,
-    /* class_inited              */        FALSE,
-    /* initialize                */        (XtInitProc) Initialize,
-    /* initialize_hook           */        NULL,
-    /* realize                   */        Realize,
-    /* actions                   */        actions,
-    /* num_actions               */        XtNumber(actions),
-    /* resources                 */        resources,
-    /* num_resources             */        XtNumber(resources),
-    /* xrm_class                 */        NULLQUARK,
-    /* compress_motion           */        TRUE,
-    /* compress_exposure         */        TRUE,
-    /* compress_enterleave       */        TRUE,
-    /* visible_interest          */        TRUE,
-    /* destroy                   */        (XtWidgetProc) Destroy,
-    /* resize                    */        (XtWidgetProc) Resize,
-    /* expose                    */        (XtExposeProc) Redraw,
-    /* set_values                */        NULL,
-    /* set_values_hook           */        NULL,
-    /* set_values_almost         */        XtInheritSetValuesAlmost,
-    /* get_values_hook           */        NULL,
-    /* accept_focus              */        NULL,
-    /* version                   */        XtVersion,
-    /* callback_private          */        NULL,
-    /* tm_table                  */        defaultTranslations,
-    /* query_geometry            */        XtInheritQueryGeometry,
-    /* display_accelerator       */        XtInheritDisplayAccelerator,
-    /* extension                 */        NULL
-  },
-  {
-    /* border_highlight          */        XmInheritBorderHighlight,
-    /* border_unhighlight        */        XmInheritBorderUnhighlight,
-    /* translations              */        XtInheritTranslations,
-    /* arm_and_activate          */        NULL,
-    /* get_resources             */        NULL,
-    /* num get_resources         */        0,
-    /* extension                 */        NULL,                                
-  }
-  };
-
-WidgetClass mbglwDrawingAreaWidgetClass=(WidgetClass)&mbglwDrawingAreaClassRec;
-
-
-
-static void error(Widget w,char* string){
-  char buf[100];
-  sprintf(buf,"mbGLwMDrawingArea: %s\n",string);
-  XtAppError(XtWidgetToApplicationContext(w),buf);
-  }
-
-
-static void warning(Widget w,char* string){
-  char buf[100];
-  sprintf (buf, "mbGLwMDraw: %s\n", string);
-  XtAppWarning(XtWidgetToApplicationContext(w), buf);
-  }
-
-
-#ifdef WIN32
-#	define GLX_BUFFER_SIZE 2
-#	define GLX_LEVEL 3
-#	define GLX_RGBA 4
-#	define GLX_DOUBLEBUFFER 5
-#	define GLX_STEREO 6
-#	define GLX_AUX_BUFFERS 7
-#	define GLX_RED_SIZE 8
-#	define GLX_GREEN_SIZE 9
-#	define GLX_BLUE_SIZE 10
-#	define GLX_ALPHA_SIZE 11
-#	define GLX_DEPTH_SIZE 12
-#	define GLX_STENCIL_SIZE 13
-#	define GLX_ACCUM_RED_SIZE 14
-#	define GLX_ACCUM_GREEN_SIZE 15
-#	define GLX_ACCUM_BLUE_SIZE 16
-#	define GLX_ACCUM_ALPHA_SIZE 17
-#endif
-
-/* Initialize the attribList based on the attributes */
-static void createAttribList(mbGLwDrawingAreaWidget w){
-  int *ptr;
-  w->mbglwDrawingArea.attribList = (int*)XtMalloc(ATTRIBLIST_SIZE*sizeof(int));
-  if(!w->mbglwDrawingArea.attribList){
-    error((Widget)w,"Unable to allocate attribute list");
-    }
-  ptr = w->mbglwDrawingArea.attribList;
-  *ptr++ = GLX_BUFFER_SIZE;
-  *ptr++ = w->mbglwDrawingArea.bufferSize;
-  *ptr++ = GLX_LEVEL;
-  *ptr++ = w->mbglwDrawingArea.level;
-  if(w->mbglwDrawingArea.rgba) *ptr++ = GLX_RGBA;
-  if(w->mbglwDrawingArea.doublebuffer) *ptr++ = GLX_DOUBLEBUFFER;
-  if(w->mbglwDrawingArea.stereo) *ptr++ = GLX_STEREO;
-  *ptr++ = GLX_AUX_BUFFERS;
-  *ptr++ = w->mbglwDrawingArea.auxBuffers;
-  *ptr++ = GLX_RED_SIZE;
-  *ptr++ = w->mbglwDrawingArea.redSize;
-  *ptr++ = GLX_GREEN_SIZE;
-  *ptr++ = w->mbglwDrawingArea.greenSize;
-  *ptr++ = GLX_BLUE_SIZE;
-  *ptr++ = w->mbglwDrawingArea.blueSize;
-  *ptr++ = GLX_ALPHA_SIZE;
-  *ptr++ = w->mbglwDrawingArea.alphaSize;
-  *ptr++ = GLX_DEPTH_SIZE;
-  *ptr++ = w->mbglwDrawingArea.depthSize;
-  *ptr++ = GLX_STENCIL_SIZE;
-  *ptr++ = w->mbglwDrawingArea.stencilSize;
-  *ptr++ = GLX_ACCUM_RED_SIZE;
-  *ptr++ = w->mbglwDrawingArea.accumRedSize;
-  *ptr++ = GLX_ACCUM_GREEN_SIZE;
-  *ptr++ = w->mbglwDrawingArea.accumGreenSize;
-  *ptr++ = GLX_ACCUM_BLUE_SIZE;
-  *ptr++ = w->mbglwDrawingArea.accumBlueSize;
-  *ptr++ = GLX_ACCUM_ALPHA_SIZE;
-  *ptr++ = w->mbglwDrawingArea.accumAlphaSize;
-  *ptr++ = None;
-  assert((ptr-w->mbglwDrawingArea.attribList)<ATTRIBLIST_SIZE);
-  }
-
-
-
-/* Initialize the visualInfo based on the attribute list */
-static void createVisualInfo(mbGLwDrawingAreaWidget w){
-  assert(w->mbglwDrawingArea.attribList);
-  w->mbglwDrawingArea.visualInfo=glXChooseVisual(XtDisplay(w),XScreenNumberOfScreen(XtScreen(w)),w->mbglwDrawingArea.attribList);
-  if(!w->mbglwDrawingArea.visualInfo) error((Widget)w,"requested visual not supported");
-  }
-
-
-
-/* Initialize the colormap based on the visual info.
- * This routine maintains a cache of visual-infos to colormaps.  If two
- * widgets share the same visual info, they share the same colormap.
- * This function is called by the callProc of the colormap resource entry.
- */
-static void createColormap(mbGLwDrawingAreaWidget w,int offset,XrmValue *value){
-  static struct cmapCache { Visual *visual; Colormap cmap; } *cmapCache;
-  static int cacheEntries=0;
-  static int cacheMalloced=0;
-  register int i;
-    
-  assert(w->mbglwDrawingArea.visualInfo);
-
-  /* see if we can find it in the cache */
-  for(i=0; i<cacheEntries; i++){
-    if(cmapCache[i].visual==w->mbglwDrawingArea.visualInfo->visual){
-      value->addr=(XtPointer)(&cmapCache[i].cmap);
-      return;
-      }
-    }
-
-  /* not in the cache, create a new entry */
-  if(cacheEntries >= cacheMalloced){
-    /* need to malloc a new one.  Since we are likely to have only a
-     * few colormaps, we allocate one the first time, and double
-     * each subsequent time.
-     */
-    if(cacheMalloced==0){
-      cacheMalloced=1;
-      cmapCache=(struct cmapCache*)XtMalloc(sizeof(struct cmapCache));
-      }
-    else{
-      cacheMalloced<<=1;
-      cmapCache=(struct cmapCache*)XtRealloc((char*)cmapCache,sizeof(struct cmapCache)*cacheMalloced);
-      }
-    }
-       
-  cmapCache[cacheEntries].cmap=XCreateColormap(XtDisplay(w),
-                                               RootWindow(XtDisplay(w),
-                                               w->mbglwDrawingArea.visualInfo->screen),
-                                               w->mbglwDrawingArea.visualInfo->visual,
-                                               AllocNone);
-  cmapCache[cacheEntries].visual=w->mbglwDrawingArea.visualInfo->visual;
-  value->addr=(XtPointer)(&cmapCache[cacheEntries++].cmap);
-  }
-
-
-
-static void Initialize(mbGLwDrawingAreaWidget req,mbGLwDrawingAreaWidget neww,ArgList args,Cardinal *num_args){
-
-  /* fix size */
-  if(req->core.width==0) neww->core.width=100;
-  if(req->core.height==0) neww->core.width=100;
-
-  /* create the attribute list if needed */
-  neww->mbglwDrawingArea.myList=FALSE;
-  if(neww->mbglwDrawingArea.attribList==NULL){
-    neww->mbglwDrawingArea.myList=TRUE;
-    createAttribList(neww);
-    }
-
-  /* Gotta have it */
-  assert(neww->mbglwDrawingArea.attribList);
-
-  /* determine the visual info if needed */
-  neww->mbglwDrawingArea.myVisual=FALSE;
-  if(neww->mbglwDrawingArea.visualInfo==NULL){
-    neww->mbglwDrawingArea.myVisual=TRUE;
-    createVisualInfo(neww);
-    }
-
-  /* Gotta have that too */
-  assert(neww->mbglwDrawingArea.visualInfo);
-
-  neww->core.depth=neww->mbglwDrawingArea.visualInfo->depth;
-
-  /* Reobtain the colormap and colors in it using XtGetApplicationResources*/
-  XtGetApplicationResources((Widget)neww,neww,initializeResources,XtNumber(initializeResources),args,*num_args);
-
-  /* obtain the color resources if appropriate */
-  if(req->mbglwDrawingArea.allocateBackground){
-    XtGetApplicationResources((Widget)neww,neww,backgroundResources,XtNumber(backgroundResources),args,*num_args);
-    }
-
-  if(req->mbglwDrawingArea.allocateOtherColors){
-    XtGetApplicationResources((Widget)neww,neww,otherColorResources,XtNumber(otherColorResources),args,*num_args);
-    }
-  }
-
-
-
-static void Realize(Widget w,Mask *valueMask,XSetWindowAttributes *attributes){
-  register mbGLwDrawingAreaWidget mbglw=(mbGLwDrawingAreaWidget)w;
-  mbGLwDrawingAreaCallbackStruct cb;
-  Widget parentShell;
-  Status status;
-  Window windows[2],*windowsReturn,*windowList;
-  int countReturn,i;
-   
-  /* if we haven't requested that the background be both installed and
-   * allocated, don't install it.
-   */
-  if(!(mbglw->mbglwDrawingArea.installBackground && mbglw->mbglwDrawingArea.allocateBackground)){
-    *valueMask&=~CWBackPixel;
-    }
- 
-  XtCreateWindow(w,(unsigned int)InputOutput,mbglw->mbglwDrawingArea.visualInfo->visual,*valueMask,attributes);
-
-  /* if appropriate, call XSetWMColormapWindows to install the colormap */
-  if(mbglw->mbglwDrawingArea.installColormap){
-
-    /* Get parent shell */
-    for(parentShell=XtParent(w); parentShell&&!XtIsShell(parentShell); parentShell=XtParent(parentShell));
-
-    if(parentShell && XtWindow(parentShell)){
-
-      /* check to see if there is already a property */
-      status=XGetWMColormapWindows(XtDisplay(parentShell),XtWindow(parentShell),&windowsReturn,&countReturn);
-            
-      /* if no property, just create one */
-      if(!status){
-        windows[0]=XtWindow(w);
-        windows[1]=XtWindow(parentShell);
-        XSetWMColormapWindows(XtDisplay(parentShell),XtWindow(parentShell),windows,2);
-        }
-
-      /* there was a property, add myself to the beginning */
-      else{
-        windowList=(Window *)XtMalloc((sizeof(Window))*(countReturn+1));
-        windowList[0]=XtWindow(w);
-        for(i=0; i<countReturn; i++) windowList[i+1]=windowsReturn[i];
-        XSetWMColormapWindows(XtDisplay(parentShell),XtWindow(parentShell),windowList,countReturn+1);
-        XtFree((char*)windowList);
-        XtFree((char*)windowsReturn);
-        }
-      }
-    else{
-      warning(w,"Could not set colormap property on parent shell");
-      }
-    }
-
-  /* Invoke callbacks */
-  cb.reason=mbGLwCR_GINIT;
-  cb.event=NULL;
-  cb.width=mbglw->core.width;
-  cb.height=mbglw->core.height;
-  XtCallCallbackList((Widget)mbglw,mbglw->mbglwDrawingArea.ginitCallback,&cb);
-  }
-
-
-
-static void Redraw(mbGLwDrawingAreaWidget w,XEvent *event,Region region){
-  mbGLwDrawingAreaCallbackStruct cb;
-  if(!XtIsRealized((Widget)w)) return;
-  cb.reason=mbGLwCR_EXPOSE;
-  cb.event=event;
-  cb.width=w->core.width;
-  cb.height=w->core.height;
-  XtCallCallbackList((Widget)w,w->mbglwDrawingArea.exposeCallback,&cb);
-  }
-
-
-
-static void Resize(mbGLwDrawingAreaWidget mbglw){
-  mbGLwDrawingAreaCallbackStruct cb;
-  if(!XtIsRealized((Widget)mbglw)) return;
-  cb.reason=mbGLwCR_RESIZE;
-  cb.event=NULL;
-  cb.width=mbglw->core.width;
-  cb.height=mbglw->core.height;
-  XtCallCallbackList((Widget)mbglw,mbglw->mbglwDrawingArea.resizeCallback,&cb);
-  }
-
-
-
-static void Destroy(mbGLwDrawingAreaWidget mbglw){
-  Window *windowsReturn;
-  Widget parentShell;
-  Status status;
-  int countReturn;
-  register int i;
-
-  if(mbglw->mbglwDrawingArea.myList && mbglw->mbglwDrawingArea.attribList){
-    XtFree((XtPointer)mbglw->mbglwDrawingArea.attribList);
-    }
-
-  if(mbglw->mbglwDrawingArea.myVisual && mbglw->mbglwDrawingArea.visualInfo){
-    XtFree((XtPointer)mbglw->mbglwDrawingArea.visualInfo);
-    }
-
-  /* if my colormap was installed, remove it */
-  if(mbglw->mbglwDrawingArea.installColormap){
-
-    /* Get parent shell */
-    for(parentShell=XtParent(mbglw); parentShell&&!XtIsShell(parentShell); parentShell=XtParent(parentShell));
-
-    if(parentShell && XtWindow(parentShell)){
-
-      /* make sure there is a property */
-      status=XGetWMColormapWindows(XtDisplay(parentShell),XtWindow(parentShell),&windowsReturn,&countReturn);
-            
-      /* if no property, just return.  If there was a property, continue */
-      if(status){
-
-        /* search for a match */
-        for(i=0; i<countReturn; i++){
-          if(windowsReturn[i]==XtWindow(mbglw)){
-
-            /* we found a match, now copy the rest down */
-            for(i++; i<countReturn; i++){ windowsReturn[i-1]=windowsReturn[i]; }
-
-            XSetWMColormapWindows(XtDisplay(parentShell),XtWindow(parentShell),windowsReturn,countReturn-1);
-            break; 
-            }
-          }
-        XtFree((char *)windowsReturn);
-        }
-      }
-    }
-  }
-
-
-
-/* Action routine for keyboard and mouse events */
-static void mbglwInput(mbGLwDrawingAreaWidget mbglw,XEvent *event,String *params,Cardinal *numParams){
-  mbGLwDrawingAreaCallbackStruct cb;
-  cb.reason=mbGLwCR_INPUT;
-  cb.event=event;
-  cb.width=mbglw->core.width;
-  cb.height=mbglw->core.height;
-  XtCallCallbackList((Widget)mbglw,mbglw->mbglwDrawingArea.inputCallback,&cb);
-  }
-
-
-
-/* Create routine */
-Widget mbGLwCreateMDrawingArea(Widget parent, char *name,ArgList arglist,Cardinal argcount){
-  return XtCreateWidget(name,mbglwMDrawingAreaWidgetClass, parent, arglist,argcount);
-  }
-
diff --git a/src/mbview/mb_glwdrawa.h b/src/mbview/mb_glwdrawa.h
deleted file mode 100644
index d8a30de..0000000
--- a/src/mbview/mb_glwdrawa.h
+++ /dev/null
@@ -1,211 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mb_glwdrawa.h	5/22/2007
- *    $Id: mb_glwdrawa.h 2239 2015-05-07 00:51:42Z caress $
- *
- *    Altered from original code for MB-System by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See notes below for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- *
- * Author:	D. W. Caress
- * Date:	May 22, 2007
- *
- * $Log: mb_glwdrawa.h,v $
- * Revision 5.0  2007/06/17 23:16:14  caress
- * Added MBeditviz.
- *
- * Revision 5.0  2007/05/23 16:39:54  caress
- * Added library for Motif OpenGL widget because this library is no longer uniformly available in Xfree86 distributions.
- *
- *
- */
-/*------------------------------------------------------------------------------*/
-/*
- * (c) Copyright 1993, Silicon Graphics, Inc.
- * ALL RIGHTS RESERVED 
- * Permission to use, copy, modify, and distribute this software for 
- * any purpose and without fee is hereby granted, provided that the above
- * copyright notice appear in all copies and that both the copyright notice
- * and this permission notice appear in supporting documentation, and that 
- * the name of Silicon Graphics, Inc. not be used in advertising
- * or publicity pertaining to distribution of the software without specific,
- * written prior permission. 
- *
- * THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS"
- * AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE,
- * INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR
- * FITNESS FOR A PARTICULAR PURPOSE.  IN NO EVENT SHALL SILICON
- * GRAPHICS, INC.  BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT,
- * SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY
- * KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION,
- * LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF
- * THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC.  HAS BEEN
- * ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE
- * POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE.
- * 
- * 
- * US Government Users Restricted Rights 
- * Use, duplication, or disclosure by the Government is subject to
- * restrictions set forth in FAR 52.227.19(c)(2) or subparagraph
- * (c)(1)(ii) of the Rights in Technical Data and Computer Software
- * clause at DFARS 252.227-7013 and/or in similar or successor
- * clauses in the FAR or the DOD or NASA FAR Supplement.
- * Unpublished-- rights reserved under the copyright laws of the
- * United States.  Contractor/manufacturer is Silicon Graphics,
- * Inc., 2011 N.  Shoreline Blvd., Mountain View, CA 94039-7311.
- *
- * OpenGL(TM) is a trademark of Silicon Graphics, Inc.
- */
-#ifndef _mbGLwDrawA_h
-#define _mbGLwDrawA_h
-
-#ifndef WIN32
-#	include <GL/glx.h>
-#endif
-#include <GL/gl.h>
-
-/****************************************************************
- *
- * mbGLwDrawingArea widgets
- *
- ****************************************************************/
-
-/* Resources:
-
- Name		     Class		RepType		Default Value
- ----		     -----		-------		-------------
- attribList	     AttribList		int *		NULL
- visualInfo	     VisualInfo		VisualInfo	NULL
- installColormap     InstallColormap	Boolean		TRUE
- allocateBackground  AllocateColors	Boolean		FALSE
- allocateOtherColors AllocateColors	Boolean		FALSE
- installBackground   InstallBackground	Boolean		TRUE
- exposeCallback      Callback		Pointer		NULL
- ginitCallback       Callback		Pointer		NULL
- inputCallback       Callback		Pointer		NULL
- resizeCallback      Callback		Pointer		NULL
-
-*** The following resources all correspond to the GLX configuration
-*** attributes and are used to create the attribList if it is NULL
- bufferSize	     BufferSize		int		0
- level		     Level		int		0
- rgba		     Rgba		Boolean		FALSE
- doublebuffer	     Doublebuffer	Boolean		FALSE
- stereo		     Stereo		Boolean		FALSE
- auxBuffers	     AuxBuffers		int		0
- redSize	     ColorSize		int		1
- greenSize	     ColorSize		int		1
- blueSize	     ColorSize		int		1
- alphaSize	     AlphaSize		int		0
- depthSize	     DepthSize		int		0
- stencilSize	     StencilSize	int		0
- accumRedSize	     AccumColorSize	int		0
- accumGreenSize	     AccumColorSize	int		0
- accumBlueSize	     AccumColorSize	int		0
- accumAlphaSize	     AccumAlphaSize	int		0
-*/
-
-#define mbGLwNattribList		"attribList"
-#define mbGLwCAttribList		"AttribList"
-#define mbGLwNvisualInfo		"visualInfo"
-#define mbGLwCVisualInfo		"VisualInfo"
-#define mbGLwRVisualInfo		"VisualInfo"
-
-#define mbGLwNinstallColormap	"installColormap"
-#define mbGLwCInstallColormap	"InstallColormap"
-#define mbGLwNallocateBackground	"allocateBackground"
-#define mbGLwNallocateOtherColors	"allocateOtherColors"
-#define mbGLwCAllocateColors	"AllocateColors"
-#define mbGLwNinstallBackground	"installBackground"
-#define mbGLwCInstallBackground	"InstallBackground"
-
-#define mbGLwCCallback		"Callback"
-#define mbGLwNexposeCallback	"exposeCallback"
-#define mbGLwNginitCallback	"ginitCallback"
-#define mbGLwNresizeCallback	"resizeCallback"
-#define mbGLwNinputCallback	"inputCallback"
-
-#define mbGLwNbufferSize		"bufferSize"
-#define mbGLwCBufferSize		"BufferSize"
-#define mbGLwNlevel		"level"
-#define mbGLwCLevel		"Level"
-#define mbGLwNrgba		"rgba"
-#define mbGLwCRgba		"Rgba"
-#define mbGLwNdoublebuffer	"doublebuffer"
-#define mbGLwCDoublebuffer	"Doublebuffer"
-#define mbGLwNstereo		"stereo"
-#define mbGLwCStereo		"Stereo"
-#define mbGLwNauxBuffers		"auxBuffers"
-#define mbGLwCAuxBuffers		"AuxBuffers"
-#define mbGLwNredSize		"redSize"
-#define mbGLwNgreenSize		"greenSize"
-#define mbGLwNblueSize		"blueSize"
-#define mbGLwCColorSize		"ColorSize"
-#define mbGLwNalphaSize		"alphaSize"
-#define mbGLwCAlphaSize		"AlphaSize"
-#define mbGLwNdepthSize		"depthSize"
-#define mbGLwCDepthSize		"DepthSize"
-#define mbGLwNstencilSize		"stencilSize"
-#define mbGLwCStencilSize		"StencilSize"
-#define mbGLwNaccumRedSize	"accumRedSize"
-#define mbGLwNaccumGreenSize	"accumGreenSize"
-#define mbGLwNaccumBlueSize	"accumBlueSize"
-#define mbGLwCAccumColorSize	"AccumColorSize"
-#define mbGLwNaccumAlphaSize	"accumAlphaSize"
-#define mbGLwCAccumAlphaSize	"AccumAlphaSize"
-
-#define mbglwMDrawingAreaWidgetClass    mbglwM2DrawingAreaWidgetClass
-#define mbglwMDrawingAreaClassRec   mbglwM2DrawingAreaClassRec
-//#define mbGLwCreateMDrawingArea     mbGLwCreateM2DrawingArea
-
-typedef struct _mbGLwMDrawingAreaClassRec	*mbGLwMDrawingAreaWidgetClass;
-typedef struct _mbGLwMDrawingAreaRec	*mbGLwMDrawingAreaWidget;
-
-extern WidgetClass mbglwMDrawingAreaWidgetClass;
-
-/* Callback reasons */
-#define mbGLwCR_EXPOSE	XmCR_EXPOSE
-#define mbGLwCR_RESIZE	XmCR_RESIZE
-#define mbGLwCR_INPUT	XmCR_INPUT
-
-#define mbGLwCR_GINIT	32135	/* Arbitrary number that should neverr clash */
-
-typedef struct 
-  {
-  int       reason;
-  XEvent   *event;
-  Dimension width,height;
-  } 
-  mbGLwDrawingAreaCallbackStruct;
-
-/* front ends to glXMakeCurrent and glXSwapBuffers */
-#ifdef WIN32
-extern void mbGLwDrawingAreaMakeCurrent(Widget w,HGLRC hglrc);
-#else
-extern void mbGLwDrawingAreaMakeCurrent(Widget w,GLXContext ctx);
-#endif
-extern void mbGLwDrawingAreaSwapBuffers(Widget w);
-
-#ifdef WIN32
-#	ifdef _NO_PROTO
-	//WINGDIAPI Widget mbGLwCreateMDrawingArea();	/* It's defined in mb_glwdrawa.c */
-#	else
-	//WINGDIAPI Widget mbGLwCreateMDrawingArea(Widget parent,char *name,ArgList arglist,Cardinal argcount);
-#	endif
-#else
-#	ifdef _NO_PROTO
-	GLAPI Widget mbGLwCreateMDrawingArea();
-#	else
-	GLAPI Widget mbGLwCreateMDrawingArea(Widget parent,char *name,ArgList arglist,Cardinal argcount);
-#	endif
-#endif
-
-#endif
diff --git a/src/mbview/mb_glwdrawap.h b/src/mbview/mb_glwdrawap.h
deleted file mode 100644
index 721eb31..0000000
--- a/src/mbview/mb_glwdrawap.h
+++ /dev/null
@@ -1,131 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mb_glwdrawap.c	5/22/2007
- *    $Id: mb_glwdrawap.h 2239 2015-05-07 00:51:42Z caress $
- *
- *    Altered from original code for MB-System by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See notes below for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- *
- * Author:	D. W. Caress
- * Date:	May 22, 2007
- *
- * $Log: mb_glwdrawap.h,v $
- * Revision 5.0  2007/06/17 23:16:14  caress
- * Added MBeditviz.
- *
- * Revision 5.0  2007/05/23 16:39:54  caress
- * Added library for Motif OpenGL widget because this library is no longer uniformly available in Xfree86 distributions.
- *
- *
- */
-/*------------------------------------------------------------------------------*/
-/*
- * (c) Copyright 1993, Silicon Graphics, Inc.
- * ALL RIGHTS RESERVED
- * Permission to use, copy, modify, and distribute this software for
- * any purpose and without fee is hereby granted, provided that the above
- * copyright notice appear in all copies and that both the copyright notice
- * and this permission notice appear in supporting documentation, and that
- * the name of Silicon Graphics, Inc. not be used in advertising
- * or publicity pertaining to distribution of the software without specific,
- * written prior permission.
- *
- * THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS"
- * AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE,
- * INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR
- * FITNESS FOR A PARTICULAR PURPOSE.  IN NO EVENT SHALL SILICON
- * GRAPHICS, INC.  BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT,
- * SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY
- * KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION,
- * LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF
- * THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC.  HAS BEEN
- * ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE
- * POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- *
- * US Government Users Restricted Rights
- * Use, duplication, or disclosure by the Government is subject to
- * restrictions set forth in FAR 52.227.19(c)(2) or subparagraph
- * (c)(1)(ii) of the Rights in Technical Data and Computer Software
- * clause at DFARS 252.227-7013 and/or in similar or successor
- * clauses in the FAR or the DOD or NASA FAR Supplement.
- * Unpublished-- rights reserved under the copyright laws of the
- * United States.  Contractor/manufacturer is Silicon Graphics,
- * Inc., 2011 N.  Shoreline Blvd., Mountain View, CA 94039-7311.
- *
- * OpenGL(TM) is a trademark of Silicon Graphics, Inc.
- */
-#ifndef _mbGLwDrawAP_h
-#define _mbGLwDrawAP_h
-
-#include "mb_glwdrawa.h"
-
-typedef struct _mbGLwDrawingAreaClassPart {
-#ifdef WIN32
-  char* extension;
-#else
-  caddr_t extension;
-#endif
-  } mbGLwDrawingAreaClassPart;
-
-
-typedef struct _mbGLwMDrawingAreaClassRec {
-  CoreClassPart               core_class;
-  XmPrimitiveClassPart        primitive_class;
-  mbGLwDrawingAreaClassPart     mbglwDrawingArea_class;
-  } mbGLwMDrawingAreaClassRec;
-
-
-extern mbGLwMDrawingAreaClassRec mbglwMDrawingAreaClassRec;
-
-
-
-typedef struct {
-  /* resources */
-  int *                attribList;
-  XVisualInfo *        visualInfo;
-  Boolean              myList;                /* TRUE if we malloced the attribList*/
-  Boolean              myVisual;        /* TRUE if we created the visualInfo*/
-  Boolean              installColormap;
-  Boolean              allocateBackground;
-  Boolean              allocateOtherColors;
-  Boolean              installBackground;
-  XtCallbackList       ginitCallback;
-  XtCallbackList       resizeCallback;
-  XtCallbackList       exposeCallback;
-  XtCallbackList       inputCallback;
-  /* specific attributes; add as we get new attributes */
-  int                  bufferSize;
-  int                  level;
-  Boolean              rgba;
-  Boolean              doublebuffer;
-  Boolean              stereo;
-  int                  auxBuffers;
-  int                  redSize;
-  int                  greenSize;
-  int                  blueSize;
-  int                  alphaSize;
-  int                  depthSize;
-  int                  stencilSize;
-  int                  accumRedSize;
-  int                  accumGreenSize;
-  int                  accumBlueSize;
-  int                  accumAlphaSize;
-  } mbGLwDrawingAreaPart;
-
-typedef struct _mbGLwMDrawingAreaRec {
-  CorePart             core;
-  XmPrimitivePart      primitive;
-  mbGLwDrawingAreaPart   mbglwDrawingArea;
-  } mbGLwMDrawingAreaRec;
-
-#endif
diff --git a/src/mbview/mbpingedit.c b/src/mbview/mbpingedit.c
deleted file mode 100644
index 809007c..0000000
--- a/src/mbview/mbpingedit.c
+++ /dev/null
@@ -1,150 +0,0 @@
-
-/* Begin user code block <abstract> */
-/* End user code block <abstract> */
-
-/**
- * README: Portions of this file are merged at file generation
- * time. Edits can be made *only* in between specified code blocks, look
- * for keywords <Begin user code> and <End user code>.
- */
-/*
- * Generated by the ICS Builder Xcessory (BX).
- *
- * BuilderXcessory Version 6.1.3
- * Code Generator Xcessory 6.1.3 (08/19/04) CGX Scripts 6.1 Motif 2.1 
- *
- */
-
-
-/* Begin user code block <file_comments> */
-/* End user code block <file_comments> */
-
-/*
- * Motif required Headers
- */
-#include <X11/StringDefs.h>
-#include <Xm/Xm.h>
-#include <Xm/DialogS.h>
-#include <Xm/RepType.h>
-#include <Xm/MwmUtil.h>
-
-/**
- * Globally included information.
- */
-
-
-/*
- * Headers for classes used in this program
- */
-#include "MBpedit.h"
-
-/**
- * Common constant and pixmap declarations.
- */
-#include "mbpingedit_creation.h"
-
-/**
- * Convenience functions from utilities file.
- */
-extern void RegisterBxConverters(XtAppContext);
-extern XtPointer BX_CONVERT(Widget, char *, char *, int, Boolean *);
-extern XtPointer BX_DOUBLE(double);
-extern XtPointer BX_SINGLE(float);
-extern void BX_MENU_POST(Widget, XtPointer, XEvent *, Boolean *);
-extern Pixmap XPM_PIXMAP(Widget, char **);
-extern void BX_SET_BACKGROUND_COLOR(Widget, ArgList, Cardinal *, Pixel);
-
-/**
- * Declarations for shell callbacks.
- */
-extern void do_mbpingedit_dismiss(Widget, XtPointer, XtPointer);
-
-/* Begin user code block <globals> */
-/* End user code block <globals> */
-
-/**
- * Change this line via the Output Application Names Dialog.
- */
-#define BX_APP_CLASS "mbpingedit"
-
-int main( int argc, char **argv)
-{
-    Widget       parent;
-    XtAppContext app;
-    Arg          args[256];
-    Cardinal     ac;
-    Boolean      argok=False;
-    Widget   topLevelShell;
-    
-    /* Begin user code block <declarations> */
-    /* End user code block <declarations> */
-    
-    /*
-     * Initialize Xt. 
-     */
-    
-    // XtSetLanguageProc(NULL, (XtLanguageProc) NULL, NULL); 
-    
-    /*
-     * The applicationShell is created as an unrealized
-     * parent for multiple topLevelShells.  The topLevelShells
-     * are created as popup children of the applicationShell.
-     * This is a recommendation of Paul Asente & Ralph Swick in
-     * _X_Window_System_Toolkit_ p. 677.
-     */
-    
-    parent = XtVaOpenApplication ( &app, 
-                                   BX_APP_CLASS, 
-                                   NULL, 
-                                   0, 
-                                   &argc, 
-                                   argv, 
-                                   NULL, 
-                                   sessionShellWidgetClass, 
-                                   NULL );
-    
-    RegisterBxConverters(app);
-    XmRepTypeInstallTearOffModelConverter();
-    
-    /* Begin user code block <create_shells> */
-    /* End user code block <create_shells> */
-    
-    /*
-     * Create classes and widgets used in this program. 
-     */
-    
-    /* Begin user code block <create_topLevelShell> */
-    /* End user code block <create_topLevelShell> */
-    
-    ac = 0;
-    XtSetArg(args[ac], XmNtitle, "MBpedit"); ac++;
-    XtSetArg(args[ac], XmNiconName, "MBpedit"); ac++;
-    XtSetArg(args[ac], XmNallowShellResize, False); ac++;
-    XtSetArg(args[ac], XmNdeleteResponse, XmDESTROY); ac++;
-    XtSetArg(args[ac], XmNx, 135); ac++;
-    XtSetArg(args[ac], XmNy, 180); ac++;
-    XtSetArg(args[ac], XmNwidth, 143); ac++;
-    XtSetArg(args[ac], XmNheight, 52); ac++;
-    topLevelShell = XtCreatePopupShell((char *)"topLevelShell",
-        topLevelShellWidgetClass,
-        parent,
-        args, 
-        ac);
-    XtAddCallback(topLevelShell, XmNdestroyCallback, do_mbpingedit_dismiss, (XtPointer)0);
-    mbpingedit_window = (Widget)Creatembpingedit_window(topLevelShell);
-    XtManageChild(mbpingedit_window);
-    XtPopup(XtParent(mbpingedit_window), XtGrabNone);
-    
-    /* Begin user code block <app_procedures> */
-    /* End user code block <app_procedures> */
-    
-    /* Begin user code block <main_loop> */
-    /* End user code block <main_loop> */
-    
-    XtAppMainLoop(app);
-    
-    /*
-     * A return value regardless of whether or not the main loop ends. 
-     */
-     return(0); 
-}
diff --git a/src/mbview/mbpingedit.uil b/src/mbview/mbpingedit.uil
deleted file mode 100644
index 4bffceb..0000000
--- a/src/mbview/mbpingedit.uil
+++ /dev/null
@@ -1,2512 +0,0 @@
-/*
- * Generated by the ICS builderXcessory (BX).
- *
- *
- * BuilderXcessory Version 6.1.3.
- *
- * Identification: 
- */
-module main_uil
-version = 'V2.1'
-names = case_sensitive
-!(BX) bx_info("c_options", "")
-!(BX) bx_info("c_libs", "-lGLw -lSgm -lXm -lXt -lGL -lXext -lX11 -lgen -lm")
-!(BX) bx_info("c_cflags", "-Aa -I/usr/include/Motif1.2 -I/usr/include/X11R5")
-!(BX) bx_info("c_cc", "cc")
-!(BX) bx_info("c_excludeungenerated", "false")
-!(BX) bx_info("c_target", "main-c")
-!(BX) bx_info("c_information", "")
-!(BX) bx_info("c_user_main_loop", "", false)
-!(BX) bx_info("c_ignore_shell_geometry", "false")
-!(BX) bx_info("c_visible_windows_only", "false")
-!(BX) bx_info("c_rm_exp_callbacks", "false")
-!(BX) bx_info("c_reverse_dialogs", "true")
-!(BX) bx_info("c_dialogs_in_routine", "true")
-!(BX) bx_info("c_unmanage_dialogs", "true")
-!(BX) bx_info("c_use_locales", "false")
-!(BX) bx_info("c_ansi", "true")
-!(BX) bx_info("c_name", "mbpingedit")
-!(BX) bx_info("c_class", "mbpingedit")
-!(BX) bx_info("c_app_defaults", "mbpingedit", true)
-!(BX) bx_info("c_utilities", "mbpingedit_bxutils.c", true)
-!(BX) bx_info("c_constants", "mbpingedit_creation.h", true)
-!(BX) bx_info("c_callbacks", "mbpingedit_callbacks.c", true)
-!(BX) bx_info("c_creation", "mbpingedit_creation.c", true)
-!(BX) bx_info("c_main", "mbpingedit.c", true)
-!(BX) bx_info("c_acinclude_m4", "acinclude.m4", false)
-!(BX) bx_info("c_configure_in", "configure.in", false)
-!(BX) bx_info("c_makefile_am", "Makefile.am", false)
-!(BX) bx_info("c_cvsmake", "CVSMake", false)
-!(BX) bx_info("c_makefile", "Makefile.org", true)
-!(BX) bx_info("c_imakefile", "Imakefile", true)
-!(BX) bx_info("c_dirpath", "")
-!(BX) bx_info("include_path", ".", false)
-!(BX) bx_info("xrunner_command", "$(M_ROOT)/arch/X11.5/Xm1.2/mic_xm.o", false)
-!(BX) bx_info("system_directory", "/opt/bx-6.1")
-!(BX) bx_info("builder_version", "BuilderXcessory Version 6.1.3")
-!(BX) bx_info("build_lang", "C")
-!(BX) bx_info("default_cpp_args", "")
-!(BX) bx_info("new_mrm_style", "true")
-!(BX) bx_info("c_wrap_lines", "false")
-!(BX) bx_info("uil_wrap_lines", "true")
-!(BX) bx_info("integrate_purify", "false")
-!(BX) bx_info("purify_command", "purify")
-!(BX) bx_info("integrate_xrunner", "false")
-
-procedure BxGlobalWidgetId;
-identifier BXG_mbpingedit_window;
-procedure BxManageCB(string);
-procedure BxUnmanageCB(string);
-procedure do_mbpingedit_check_median_ltrack();
-procedure do_mbpingedit_check_median_xtrack();
-procedure do_mbpingedit_dismiss();
-procedure do_mbpingedit_event();
-procedure do_mbpingedit_expose();
-procedure do_mbpingedit_flag_view();
-procedure do_mbpingedit_forward();
-procedure do_mbpingedit_mode_erase();
-procedure do_mbpingedit_mode_grab();
-procedure do_mbpingedit_mode_info();
-procedure do_mbpingedit_mode_pick();
-procedure do_mbpingedit_mode_restore();
-procedure do_mbpingedit_mode_toggle();
-procedure do_mbpingedit_next_buffer();
-procedure do_mbpingedit_number_pings();
-procedure do_mbpingedit_number_step();
-procedure do_mbpingedit_reset_filters();
-procedure do_mbpingedit_reverse();
-procedure do_mbpingedit_reverse_keys();
-procedure do_mbpingedit_reverse_mouse();
-procedure do_mbpingedit_scale_x();
-procedure do_mbpingedit_scale_y();
-procedure do_mbpingedit_set_filters();
-procedure do_mbpingedit_show_detects();
-procedure do_mbpingedit_show_flagged();
-procedure do_mbpingedit_show_time();
-procedure do_mbpingedit_unflag_all();
-procedure do_mbpingedit_unflag_view();
-procedure do_mbpingedit_view_mode();
-procedure do_mbpingedit_x_interval();
-procedure do_mbpingedit_y_interval();
-
-list BaseStyle : arguments {
-};
-
-list BaseStyleReasons : callbacks {
-};
-
-!(BX)list BaseStyleHandlers : handlers {
-!(BX)};
-
-list Style_use : arguments {
-        arguments BaseStyle;
-        XmNfontList = font_table(
-		font('-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1'));
-};
-
-list Style_useReasons : callbacks {
-        callbacks BaseStyleReasons;
-};
-
-!(BX)list Style_useHandlers : handlers {
-!(BX)    handlers BaseStyleHandlers;
-!(BX)};
-
-
-object mBpedit : XmFormDialog widget {
-    arguments {
-!(BX) BxNclass = "MBpedit";
-!(BX) BxNsubclassDerived = "False";
-        arguments Style_use;
-        XmNdialogTitle = compound_string("MBeditviz Swath View");
-        XmNresizePolicy = XmRESIZE_GROW;
-        XmNx = 518;
-        XmNy = 310;
-        XmNwidth = 1004;
-        XmNheight = 694;
-    };
-    controls {
-         managed XmBulletinBoard mBpedit_mbpingedit_controls;
-         managed XmDrawingArea mBpedit_mbpingedit_canvas;
-!(BX)         unmanaged XmDialogShell mBpedit_mbpingedit_dialogShell_filters;
-!(BX)         unmanaged XmDialogShell mBpedit_mbpingedit_dialogShell_annotation;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-!(BX)object mbpingedit_dialogShell : XmDialogShell widget {
-!(BX)    arguments {
-!(BX)        arguments Style_use;
-!(BX)        XmNtitle = "MBeditviz Swath View";
-!(BX)        XmNwidth = 1004;
-!(BX)        XmNheight = 694;
-!(BX)    };
-!(BX)    controls {
-!(BX)         managed XmFormDialog mBpedit;
-!(BX)    };
-!(BX)    callbacks {
-!(BX)        callbacks Style_useReasons;
-!(BX)    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-!(BX)};
-
-object mbpingedit_window : XmMainWindow widget {
-    arguments {
-        arguments Style_use;
-        XmNx = 135;
-        XmNy = 180;
-        XmNwidth = 143;
-        XmNheight = 52;
-    };
-    controls {
-!(BX)         unmanaged XmDialogShell mbpingedit_dialogShell;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_mbpingedit_window);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-!(BX)object topLevelShell : TopLevelShell widget {
-!(BX)    arguments {
-!(BX)        arguments Style_use;
-!(BX)        XmNtitle = "MBpedit";
-!(BX)        XmNiconName = "MBpedit";
-!(BX)        XmNallowShellResize = false;
-!(BX)        XmNdeleteResponse = XmDESTROY;
-!(BX)        XmNx = 135;
-!(BX)        XmNy = 180;
-!(BX)        XmNwidth = 143;
-!(BX)        XmNheight = 52;
-!(BX)    };
-!(BX)    controls {
-!(BX)         managed XmMainWindow mbpingedit_window;
-!(BX)    };
-!(BX)    callbacks {
-!(BX)        callbacks Style_useReasons;
-!(BX)        XmNdestroyCallback = procedure do_mbpingedit_dismiss();
-!(BX)    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-!(BX)};
-
-object mBpedit_mbpingedit_slider_x_interval_label : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_END;
-        XmNlabelString = compound_string("X Axis Tick Interval (m): 1");
-        XmNleftAttachment = XmATTACH_FORM;
-        XmNleftOffset = 10;
-        XmNtopOffset = 10;
-        XmNx = 10;
-        XmNy = 10;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mBpedit_mbpingedit_slider_x_interval : XmScale widget {
-    arguments {
-        arguments Style_use;
-        XmNminimum = 1;
-        XmNvalue = 1000;
-        XmNmaximum = 5000;
-        XmNscaleHeight = 15;
-        XmNshowArrows = TRUE;
-        XmNscaleMultiple = 1;
-        XmNshowValue = TRUE;
-        XmNorientation = XmHORIZONTAL;
-        XmNrightAttachment = XmATTACH_FORM;
-        XmNleftAttachment = XmATTACH_FORM;
-        XmNleftOffset = 190;
-        XmNrightOffset = 64;
-        XmNtopOffset = 0;
-        XmNx = 190;
-        XmNy = 0;
-        XmNwidth = 270;
-        XmNheight = 34;
-    };
-    controls {
-        Xm_Title {
-            arguments {
-                arguments Style_use;
-            };
-            callbacks {
-                    callbacks Style_useReasons;
-            };
-!(BX)            handlers {
-!(BX)                handlers Style_useHandlers;
-!(BX)            };
-        };
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNvalueChangedCallback = procedure do_mbpingedit_x_interval();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mBpedit_mbpingedit_slider_x_max_interval_label : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("5000");
-        XmNrecomputeSize = false;
-        XmNrightAttachment = XmATTACH_FORM;
-        XmNleftAttachment = XmATTACH_FORM;
-        XmNleftOffset = 450;
-        XmNrightOffset = 9;
-        XmNtopOffset = 10;
-        XmNx = 450;
-        XmNy = 10;
-        XmNwidth = 65;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mBpedit_mbpingedit_slider_y_interval_label : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_END;
-        XmNlabelString = compound_string("Y Axis Tick Interval (m): 1");
-        XmNleftAttachment = XmATTACH_FORM;
-        XmNleftOffset = 0;
-        XmNtopOffset = 50;
-        XmNx = 0;
-        XmNy = 50;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mBpedit_mbpingedit_slider_y_interval : XmScale widget {
-    arguments {
-        arguments Style_use;
-        XmNminimum = 1;
-        XmNvalue = 250;
-        XmNmaximum = 1000;
-        XmNscaleHeight = 15;
-        XmNshowArrows = TRUE;
-        XmNscaleMultiple = 1;
-        XmNshowValue = TRUE;
-        XmNorientation = XmHORIZONTAL;
-        XmNrightAttachment = XmATTACH_FORM;
-        XmNleftAttachment = XmATTACH_FORM;
-        XmNleftOffset = 190;
-        XmNrightOffset = 64;
-        XmNtopOffset = 40;
-        XmNx = 190;
-        XmNy = 40;
-        XmNwidth = 270;
-        XmNheight = 34;
-    };
-    controls {
-        Xm_Title {
-            arguments {
-                arguments Style_use;
-            };
-            callbacks {
-                    callbacks Style_useReasons;
-            };
-!(BX)            handlers {
-!(BX)                handlers Style_useHandlers;
-!(BX)            };
-        };
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNvalueChangedCallback = procedure do_mbpingedit_y_interval();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mBpedit_mbpingedit_slider_y_max_interval_label : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("1000");
-        XmNrecomputeSize = false;
-        XmNrightAttachment = XmATTACH_FORM;
-        XmNleftAttachment = XmATTACH_FORM;
-        XmNleftOffset = 450;
-        XmNrightOffset = 9;
-        XmNtopOffset = 50;
-        XmNx = 450;
-        XmNy = 50;
-        XmNwidth = 65;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mBpedit_mbpingedit_pushButton_annotation_dismiss : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Dismiss");
-        XmNtopAttachment = XmATTACH_NONE;
-        XmNrightAttachment = XmATTACH_FORM;
-        XmNleftAttachment = XmATTACH_FORM;
-        XmNbottomAttachment = XmATTACH_FORM;
-        XmNbottomOffset = 15;
-        XmNleftOffset = 230;
-        XmNrightOffset = 217;
-        XmNx = 230;
-        XmNy = 93;
-        XmNwidth = 77;
-        XmNheight = 28;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mBpedit_mbpingedit_form_annotation : XmFormDialog widget {
-    arguments {
-        arguments Style_use;
-        XmNresizePolicy = XmRESIZE_GROW;
-        XmNx = 630;
-        XmNy = 480;
-        XmNwidth = 524;
-        XmNheight = 136;
-    };
-    controls {
-         managed XmPushButton mBpedit_mbpingedit_pushButton_annotation_dismiss;
-         managed XmLabel mBpedit_mbpingedit_slider_y_max_interval_label;
-         managed XmScale mBpedit_mbpingedit_slider_y_interval;
-         managed XmLabel mBpedit_mbpingedit_slider_y_interval_label;
-         managed XmLabel mBpedit_mbpingedit_slider_x_max_interval_label;
-         managed XmScale mBpedit_mbpingedit_slider_x_interval;
-         managed XmLabel mBpedit_mbpingedit_slider_x_interval_label;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-!(BX)object mBpedit_mbpingedit_dialogShell_annotation : XmDialogShell widget {
-!(BX)    arguments {
-!(BX)        arguments Style_use;
-!(BX)        XmNtitle = "MBeditviz Swath View Annotation";
-!(BX)        XmNx = 630;
-!(BX)        XmNy = 480;
-!(BX)        XmNwidth = 524;
-!(BX)        XmNheight = 136;
-!(BX)    };
-!(BX)    controls {
-!(BX)         managed XmFormDialog mBpedit_mbpingedit_form_annotation;
-!(BX)    };
-!(BX)    callbacks {
-!(BX)        callbacks Style_useReasons;
-!(BX)    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-!(BX)};
-
-object mBpedit_mbpingedit_pushButton_filters_dismiss : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Dismiss");
-        XmNtopAttachment = XmATTACH_NONE;
-        XmNbottomAttachment = XmATTACH_FORM;
-        XmNbottomOffset = 10;
-        XmNx = 260;
-        XmNy = 311;
-        XmNwidth = 90;
-        XmNheight = 40;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNactivateCallback = procedure BxUnmanageCB("mbpingedit_bulletinBoard_filter" &
- "s");
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mBpedit_mbpingedit_pushButton_filters_apply : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Apply");
-        XmNtopAttachment = XmATTACH_NONE;
-        XmNbottomAttachment = XmATTACH_FORM;
-        XmNbottomOffset = 10;
-        XmNx = 40;
-        XmNy = 311;
-        XmNwidth = 90;
-        XmNheight = 40;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNactivateCallback = procedure do_mbpingedit_set_filters();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mBpedit_mbpingedit_pushButton_filters_reset : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Reset");
-        XmNtopAttachment = XmATTACH_NONE;
-        XmNbottomAttachment = XmATTACH_FORM;
-        XmNbottomOffset = 10;
-        XmNx = 150;
-        XmNy = 311;
-        XmNwidth = 90;
-        XmNheight = 40;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNactivateCallback = procedure do_mbpingedit_reset_filters();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mBpedit_mbpingedit_toggleButton_filters_medianspike : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNlabelString = compound_string("Median", separate=true) &
- compound_string("Spike", separate=true) &
- compound_string("Filter");
-        XmNx = 10;
-        XmNy = 20;
-        XmNwidth = 90;
-        XmNheight = 60;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mBpedit_mbpingedit_scale_filters_medianspike : XmScale widget {
-    arguments {
-        arguments Style_use;
-        XmNminimum = 1;
-        XmNdecimalPoints = 0;
-        XmNvalue = 10;
-        XmNtitleString = compound_string("% Median Depth Threshold ");
-        XmNshowArrows = TRUE;
-        XmNshowValue = TRUE;
-        XmNorientation = XmHORIZONTAL;
-        XmNx = 100;
-        XmNy = 10;
-        XmNwidth = 260;
-        XmNheight = 63;
-    };
-    controls {
-        Xm_Title {
-            arguments {
-                arguments Style_use;
-            };
-            callbacks {
-                    callbacks Style_useReasons;
-            };
-!(BX)            handlers {
-!(BX)                handlers Style_useHandlers;
-!(BX)            };
-        };
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mBpedit_mbpingedit_toggleButton_filters_wrongside : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNlabelString = compound_string("Wrong", separate=true) &
- compound_string("Side", separate=true) &
- compound_string("Filter");
-        XmNx = 10;
-        XmNy = 680;
-        XmNwidth = 90;
-        XmNheight = 60;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mBpedit_mbpingedit_scale_filters_wrongside : XmScale widget {
-    arguments {
-        arguments Style_use;
-        XmNvalue = 10;
-        XmNtitleString = compound_string("Beams from Center Threshold");
-        XmNmaximum = 100;
-        XmNshowArrows = TRUE;
-        XmNshowValue = TRUE;
-        XmNorientation = XmHORIZONTAL;
-        XmNx = 100;
-        XmNy = 670;
-        XmNwidth = 260;
-        XmNheight = 63;
-    };
-    controls {
-        Xm_Title {
-            arguments {
-                arguments Style_use;
-            };
-            callbacks {
-                    callbacks Style_useReasons;
-            };
-!(BX)            handlers {
-!(BX)                handlers Style_useHandlers;
-!(BX)            };
-        };
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mBpedit_mbpingedit_separator3 : XmSeparator widget {
-    arguments {
-        arguments Style_use;
-        XmNx = 10;
-        XmNy = 360;
-        XmNwidth = 350;
-        XmNheight = 20;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mBpedit_mbpingedit_toggleButton_filters_cutbeam : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNlabelString = compound_string("Flag by", separate=true) &
- compound_string("Beam", separate=true) &
- compound_string("Number");
-        XmNx = 10;
-        XmNy = 240;
-        XmNwidth = 90;
-        XmNheight = 60;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mBpedit_mbpingedit_scale_filters_cutbeamstart : XmScale widget {
-    arguments {
-        arguments Style_use;
-        XmNvalue = 10;
-        XmNtitleString = compound_string("Start Flagging Beam Number");
-        XmNmaximum = 100;
-        XmNshowArrows = TRUE;
-        XmNshowValue = TRUE;
-        XmNorientation = XmHORIZONTAL;
-        XmNx = 100;
-        XmNy = 230;
-        XmNwidth = 260;
-        XmNheight = 63;
-    };
-    controls {
-        Xm_Title {
-            arguments {
-                arguments Style_use;
-            };
-            callbacks {
-                    callbacks Style_useReasons;
-            };
-!(BX)            handlers {
-!(BX)                handlers Style_useHandlers;
-!(BX)            };
-        };
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mBpedit_mbpingedit_scale_filters_cutbeamend : XmScale widget {
-    arguments {
-        arguments Style_use;
-        XmNvalue = 10;
-        XmNtitleString = compound_string("End Flagging Beam Number");
-        XmNmaximum = 100;
-        XmNshowArrows = TRUE;
-        XmNshowValue = TRUE;
-        XmNorientation = XmHORIZONTAL;
-        XmNx = 100;
-        XmNy = 290;
-        XmNwidth = 260;
-        XmNheight = 63;
-    };
-    controls {
-        Xm_Title {
-            arguments {
-                arguments Style_use;
-            };
-            callbacks {
-                    callbacks Style_useReasons;
-            };
-!(BX)            handlers {
-!(BX)                handlers Style_useHandlers;
-!(BX)            };
-        };
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mBpedit_mbpingedit_separator4 : XmSeparator widget {
-    arguments {
-        arguments Style_use;
-        XmNx = 10;
-        XmNy = 210;
-        XmNwidth = 350;
-        XmNheight = 20;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mBpedit_mbpingedit_toggleButton_filters_cutdistance : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNlabelString = compound_string("Flag by", separate=true) &
- compound_string("Distance");
-        XmNx = 10;
-        XmNy = 390;
-        XmNwidth = 90;
-        XmNheight = 40;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mBpedit_mbpingedit_scale_filters_cutdistancestart : XmScale widget {
-    arguments {
-        arguments Style_use;
-        XmNdecimalPoints = 2;
-        XmNvalue = 1000;
-        XmNtitleString = compound_string("Start Flagging Distance (m)");
-        XmNmaximum = 10000;
-        XmNshowArrows = TRUE;
-        XmNscaleMultiple = 1;
-        XmNshowValue = TRUE;
-        XmNorientation = XmHORIZONTAL;
-        XmNx = 100;
-        XmNy = 380;
-        XmNwidth = 260;
-        XmNheight = 63;
-    };
-    controls {
-        Xm_Title {
-            arguments {
-                arguments Style_use;
-            };
-            callbacks {
-                    callbacks Style_useReasons;
-            };
-!(BX)            handlers {
-!(BX)                handlers Style_useHandlers;
-!(BX)            };
-        };
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mBpedit_mbpingedit_scale_filters_cutdistanceend : XmScale widget {
-    arguments {
-        arguments Style_use;
-        XmNdecimalPoints = 2;
-        XmNvalue = 1000;
-        XmNtitleString = compound_string("End Flagging Distance (m)");
-        XmNmaximum = 10000;
-        XmNshowArrows = TRUE;
-        XmNscaleMultiple = 1;
-        XmNshowValue = TRUE;
-        XmNorientation = XmHORIZONTAL;
-        XmNx = 100;
-        XmNy = 440;
-        XmNwidth = 260;
-        XmNheight = 63;
-    };
-    controls {
-        Xm_Title {
-            arguments {
-                arguments Style_use;
-            };
-            callbacks {
-                    callbacks Style_useReasons;
-            };
-!(BX)            handlers {
-!(BX)                handlers Style_useHandlers;
-!(BX)            };
-        };
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mBpedit_mbpingedit_separator5 : XmSeparator widget {
-    arguments {
-        arguments Style_use;
-        XmNx = 10;
-        XmNy = 500;
-        XmNwidth = 350;
-        XmNheight = 20;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mBpedit_mbpingedit_toggleButton_filters_cutangle : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNlabelString = compound_string("Flag by", separate=true) &
- compound_string("Beam", separate=true) &
- compound_string("Angle");
-        XmNx = 10;
-        XmNy = 530;
-        XmNwidth = 80;
-        XmNheight = 60;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mBpedit_mbpingedit_scale_filters_cutanglestart : XmScale widget {
-    arguments {
-        arguments Style_use;
-        XmNdecimalPoints = 2;
-        XmNvalue = 1000;
-        XmNtitleString = compound_string("Start Flagging Angle (deg)");
-        XmNmaximum = 10000;
-        XmNshowArrows = TRUE;
-        XmNscaleMultiple = 1;
-        XmNshowValue = TRUE;
-        XmNorientation = XmHORIZONTAL;
-        XmNx = 100;
-        XmNy = 520;
-        XmNwidth = 260;
-        XmNheight = 63;
-    };
-    controls {
-        Xm_Title {
-            arguments {
-                arguments Style_use;
-            };
-            callbacks {
-                    callbacks Style_useReasons;
-            };
-!(BX)            handlers {
-!(BX)                handlers Style_useHandlers;
-!(BX)            };
-        };
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mBpedit_mbpingedit_scale_filters_cutangleend : XmScale widget {
-    arguments {
-        arguments Style_use;
-        XmNdecimalPoints = 2;
-        XmNvalue = 1000;
-        XmNtitleString = compound_string("End Flagging Angle (deg)");
-        XmNmaximum = 10000;
-        XmNshowArrows = TRUE;
-        XmNscaleMultiple = 1;
-        XmNshowValue = TRUE;
-        XmNorientation = XmHORIZONTAL;
-        XmNx = 100;
-        XmNy = 580;
-        XmNwidth = 260;
-        XmNheight = 63;
-    };
-    controls {
-        Xm_Title {
-            arguments {
-                arguments Style_use;
-            };
-            callbacks {
-                    callbacks Style_useReasons;
-            };
-!(BX)            handlers {
-!(BX)                handlers Style_useHandlers;
-!(BX)            };
-        };
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mBpedit_mbpingedit_separator6 : XmSeparator widget {
-    arguments {
-        arguments Style_use;
-        XmNx = 10;
-        XmNy = 650;
-        XmNwidth = 350;
-        XmNheight = 20;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mBpedit_mbpingedit_scale_median_local_xtrack : XmScale widget {
-    arguments {
-        arguments Style_use;
-        XmNminimum = 1;
-        XmNvalue = 5;
-        XmNtitleString = compound_string("Median Acrosstrack Dimension");
-        XmNshowArrows = TRUE;
-        XmNscaleMultiple = 1;
-        XmNshowValue = TRUE;
-        XmNorientation = XmHORIZONTAL;
-        XmNx = 100;
-        XmNy = 80;
-        XmNwidth = 260;
-        XmNheight = 63;
-    };
-    controls {
-        Xm_Title {
-            arguments {
-                arguments Style_use;
-            };
-            callbacks {
-                    callbacks Style_useReasons;
-            };
-!(BX)            handlers {
-!(BX)                handlers Style_useHandlers;
-!(BX)            };
-        };
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNvalueChangedCallback = procedure do_mbpingedit_check_median_xtrack();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mBpedit_mbpingedit_scale_median_local_ltrack : XmScale widget {
-    arguments {
-        arguments Style_use;
-        XmNminimum = 1;
-        XmNvalue = 1;
-        XmNtitleString = compound_string("Median Alongtrack Dimension");
-        XmNmaximum = 20;
-        XmNshowArrows = TRUE;
-        XmNscaleMultiple = 1;
-        XmNshowValue = TRUE;
-        XmNorientation = XmHORIZONTAL;
-        XmNx = 100;
-        XmNy = 140;
-        XmNwidth = 260;
-        XmNheight = 63;
-    };
-    controls {
-        Xm_Title {
-            arguments {
-                arguments Style_use;
-            };
-            callbacks {
-                    callbacks Style_useReasons;
-            };
-!(BX)            handlers {
-!(BX)                handlers Style_useHandlers;
-!(BX)            };
-        };
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNvalueChangedCallback = procedure do_mbpingedit_check_median_ltrack();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mBpedit_mbpingedit_radioBox_mediancalc : XmRadioBox widget {
-    arguments {
-        arguments Style_use;
-        XmNx = 90;
-        XmNy = 70;
-        XmNwidth = 16;
-        XmNheight = 16;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mBpedit_mbpingedit_bulletinBoard_scrollfilters : XmBulletinBoard widget {
-    arguments {
-        arguments Style_use;
-        XmNresizePolicy = XmRESIZE_GROW;
-        XmNwidth = 375;
-        XmNheight = 810;
-    };
-    controls {
-         managed XmRadioBox mBpedit_mbpingedit_radioBox_mediancalc;
-         managed XmScale mBpedit_mbpingedit_scale_median_local_ltrack;
-         managed XmScale mBpedit_mbpingedit_scale_median_local_xtrack;
-         managed XmSeparator mBpedit_mbpingedit_separator6;
-         managed XmScale mBpedit_mbpingedit_scale_filters_cutangleend;
-         managed XmScale mBpedit_mbpingedit_scale_filters_cutanglestart;
-         managed XmToggleButton mBpedit_mbpingedit_toggleButton_filters_cutangle;
-         managed XmSeparator mBpedit_mbpingedit_separator5;
-         managed XmScale mBpedit_mbpingedit_scale_filters_cutdistanceend;
-         managed XmScale mBpedit_mbpingedit_scale_filters_cutdistancestart;
-         managed XmToggleButton mBpedit_mbpingedit_toggleButton_filters_cutdistance;
-         managed XmSeparator mBpedit_mbpingedit_separator4;
-         managed XmScale mBpedit_mbpingedit_scale_filters_cutbeamend;
-         managed XmScale mBpedit_mbpingedit_scale_filters_cutbeamstart;
-         managed XmToggleButton mBpedit_mbpingedit_toggleButton_filters_cutbeam;
-         managed XmSeparator mBpedit_mbpingedit_separator3;
-         managed XmScale mBpedit_mbpingedit_scale_filters_wrongside;
-         managed XmToggleButton mBpedit_mbpingedit_toggleButton_filters_wrongside;
-         managed XmScale mBpedit_mbpingedit_scale_filters_medianspike;
-         managed XmToggleButton mBpedit_mbpingedit_toggleButton_filters_medianspike;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mBpedit_scrolledWindow_filters : XmScrolledWindow widget {
-    arguments {
-        arguments Style_use;
-        XmNscrollingPolicy = XmAUTOMATIC;
-        XmNtopAttachment = XmATTACH_FORM;
-        XmNrightAttachment = XmATTACH_FORM;
-        XmNleftAttachment = XmATTACH_FORM;
-        XmNbottomAttachment = XmATTACH_FORM;
-        XmNbottomOffset = 60;
-        XmNleftOffset = 0;
-        XmNrightOffset = 4;
-        XmNtopOffset = 0;
-        XmNx = 0;
-        XmNy = 0;
-        XmNwidth = 404;
-        XmNheight = 301;
-    };
-    controls {
-        Xm_VertScrollBar {
-            arguments {
-                arguments Style_use;
-            };
-            callbacks {
-                    callbacks Style_useReasons;
-            };
-!(BX)            handlers {
-!(BX)                handlers Style_useHandlers;
-!(BX)            };
-        };
-        Xm_HorScrollBar {
-            arguments {
-                arguments Style_use;
-            };
-            callbacks {
-                    callbacks Style_useReasons;
-            };
-!(BX)            handlers {
-!(BX)                handlers Style_useHandlers;
-!(BX)            };
-        };
-         managed XmBulletinBoard mBpedit_mbpingedit_bulletinBoard_scrollfilters;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mBpedit_mbpingedit_form_filters : XmFormDialog widget {
-    arguments {
-        arguments Style_use;
-        XmNresizePolicy = XmRESIZE_GROW;
-        XmNx = 950;
-        XmNy = 657;
-        XmNwidth = 408;
-        XmNheight = 361;
-    };
-    controls {
-         managed XmScrolledWindow mBpedit_scrolledWindow_filters;
-         managed XmPushButton mBpedit_mbpingedit_pushButton_filters_reset;
-         managed XmPushButton mBpedit_mbpingedit_pushButton_filters_apply;
-         managed XmPushButton mBpedit_mbpingedit_pushButton_filters_dismiss;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-!(BX)object mBpedit_mbpingedit_dialogShell_filters : XmDialogShell widget {
-!(BX)    arguments {
-!(BX)        arguments Style_use;
-!(BX)        XmNtitle = "MBeditviz Swath View Filters";
-!(BX)        XmNx = 950;
-!(BX)        XmNy = 657;
-!(BX)        XmNwidth = 408;
-!(BX)        XmNheight = 361;
-!(BX)    };
-!(BX)    controls {
-!(BX)         managed XmFormDialog mBpedit_mbpingedit_form_filters;
-!(BX)    };
-!(BX)    callbacks {
-!(BX)        callbacks Style_useReasons;
-!(BX)    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-!(BX)};
-
-object mBpedit_mbpingedit_canvas : XmDrawingArea widget {
-    arguments {
-        arguments Style_use;
-        XmNborderWidth = 1;
-        XmNbackground = color('white');
-        XmNtopAttachment = XmATTACH_FORM;
-        XmNrightAttachment = XmATTACH_FORM;
-        XmNleftAttachment = XmATTACH_FORM;
-        XmNbottomAttachment = XmATTACH_FORM;
-        XmNbottomOffset = 2;
-        XmNleftOffset = 0;
-        XmNrightOffset = 2;
-        XmNtopOffset = 150;
-        XmNx = 0;
-        XmNy = 150;
-        XmNwidth = 1000;
-        XmNheight = 540;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNinputCallback = procedure do_mbpingedit_event();
-        XmNexposeCallback = procedure do_mbpingedit_expose();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mBpedit_mbpingedit_togglebutton_toggle : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Toggle");
-        XmNwidth = 75;
-        XmNheight = 28;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNvalueChangedCallback = procedure do_mbpingedit_mode_toggle();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mBpedit_mbpingedit_togglebutton_pick : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Pick");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNvalueChangedCallback = procedure do_mbpingedit_mode_pick();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mBpedit_mbpingedit_togglebutton_erase : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Erase");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNvalueChangedCallback = procedure do_mbpingedit_mode_erase();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mBpedit_mbpingedit_togglebutton_restore : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Restore");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNvalueChangedCallback = procedure do_mbpingedit_mode_restore();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mBpedit_mbpingedit_togglebutton_grab : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Grab");
-        XmNwidth = 62;
-        XmNheight = 28;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNvalueChangedCallback = procedure do_mbpingedit_mode_grab();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mBpedit_mbpingedit_togglebutton_info : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Info");
-        XmNwidth = 54;
-        XmNheight = 28;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNvalueChangedCallback = procedure do_mbpingedit_mode_info();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mBpedit_mbpingedit_setting_mode : XmRowColumn widget {
-    arguments {
-        arguments Style_use;
-        XmNnumColumns = 1;
-        XmNpacking = XmPACK_TIGHT;
-        XmNradioBehavior = true;
-        XmNspacing = 0;
-        XmNorientation = XmHORIZONTAL;
-        XmNx = 120;
-        XmNy = 120;
-        XmNwidth = 405;
-        XmNheight = 34;
-    };
-    controls {
-         managed XmToggleButton mBpedit_mbpingedit_togglebutton_toggle;
-         managed XmToggleButton mBpedit_mbpingedit_togglebutton_pick;
-         managed XmToggleButton mBpedit_mbpingedit_togglebutton_erase;
-         managed XmToggleButton mBpedit_mbpingedit_togglebutton_restore;
-         managed XmToggleButton mBpedit_mbpingedit_togglebutton_grab;
-         managed XmToggleButton mBpedit_mbpingedit_togglebutton_info;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mBpedit_mbpingedit_setting_mode_label : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Mode:");
-        XmNmarginWidth = 0;
-        XmNx = 70;
-        XmNy = 120;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mBpedit_mbpingedit_slider_number_max_step_label : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("20");
-        XmNrecomputeSize = false;
-        XmNx = 960;
-        XmNy = 90;
-        XmNwidth = 50;
-        XmNheight = 20;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mBpedit_mbpingedit_slider_number_step : XmScale widget {
-    arguments {
-        arguments Style_use;
-        XmNminimum = 1;
-        XmNvalue = 5;
-        XmNmaximum = 20;
-        XmNscaleHeight = 15;
-        XmNshowArrows = TRUE;
-        XmNscaleMultiple = 1;
-        XmNshowValue = TRUE;
-        XmNorientation = XmHORIZONTAL;
-        XmNx = 670;
-        XmNy = 80;
-        XmNwidth = 290;
-        XmNheight = 34;
-    };
-    controls {
-        Xm_Title {
-            arguments {
-                arguments Style_use;
-            };
-            callbacks {
-                    callbacks Style_useReasons;
-            };
-!(BX)            handlers {
-!(BX)                handlers Style_useHandlers;
-!(BX)            };
-        };
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNvalueChangedCallback = procedure do_mbpingedit_number_step();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mBpedit_mbpingedit_slider_number_step_label : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_END;
-        XmNlabelString = compound_string("Pings to step:  1");
-        XmNx = 550;
-        XmNy = 90;
-        XmNheight = 20;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mBpedit_mbpingedit_slider_num_pings_max_label : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("20");
-        XmNrecomputeSize = false;
-        XmNx = 960;
-        XmNy = 50;
-        XmNwidth = 50;
-        XmNheight = 20;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mBpedit_mbpingedit_slider_number_pings : XmScale widget {
-    arguments {
-        arguments Style_use;
-        XmNminimum = 1;
-        XmNvalue = 10;
-        XmNmaximum = 20;
-        XmNscaleHeight = 15;
-        XmNshowArrows = TRUE;
-        XmNscaleMultiple = 1;
-        XmNshowValue = TRUE;
-        XmNorientation = XmHORIZONTAL;
-        XmNx = 670;
-        XmNy = 40;
-        XmNwidth = 290;
-        XmNheight = 34;
-    };
-    controls {
-        Xm_Title {
-            arguments {
-                arguments Style_use;
-            };
-            callbacks {
-                    callbacks Style_useReasons;
-            };
-!(BX)            handlers {
-!(BX)                handlers Style_useHandlers;
-!(BX)            };
-        };
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNvalueChangedCallback = procedure do_mbpingedit_number_pings();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mBpedit_mbpingedit_slider_number_pings_label : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_END;
-        XmNlabelString = compound_string("Pings shown:   1");
-        XmNx = 550;
-        XmNy = 50;
-        XmNheight = 20;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mBpedit_mbpingedit_slider_mbpingedit_scale_y_max_label : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("20.00");
-        XmNrecomputeSize = false;
-        XmNx = 470;
-        XmNy = 90;
-        XmNwidth = 65;
-        XmNheight = 20;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mBpedit_mbpingedit_slider_mbpingedit_scale_y : XmScale widget {
-    arguments {
-        arguments Style_use;
-        XmNminimum = 1;
-        XmNdecimalPoints = 2;
-        XmNvalue = 100;
-        XmNmaximum = 2000;
-        XmNscaleHeight = 15;
-        XmNshowArrows = TRUE;
-        XmNscaleMultiple = 1;
-        XmNshowValue = TRUE;
-        XmNorientation = XmHORIZONTAL;
-        XmNx = 210;
-        XmNy = 80;
-        XmNwidth = 260;
-        XmNheight = 34;
-    };
-    controls {
-        Xm_Title {
-            arguments {
-                arguments Style_use;
-            };
-            callbacks {
-                    callbacks Style_useReasons;
-            };
-!(BX)            handlers {
-!(BX)                handlers Style_useHandlers;
-!(BX)            };
-        };
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNvalueChangedCallback = procedure do_mbpingedit_scale_y();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mBpedit_mbpingedit_slider_mbpingedit_scale_y_label : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_END;
-        XmNlabelString = compound_string("Vertical Exaggeration: 0.01");
-        XmNx = 20;
-        XmNy = 90;
-        XmNheight = 20;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mBpedit_mbpingedit_slider_mbpingedit_scale_x_max_label : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("20000");
-        XmNrecomputeSize = false;
-        XmNx = 470;
-        XmNy = 50;
-        XmNwidth = 60;
-        XmNheight = 20;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mBpedit_mbpingedit_slider_mbpingedit_scale_x : XmScale widget {
-    arguments {
-        arguments Style_use;
-        XmNminimum = 1;
-        XmNvalue = 1000;
-        XmNmaximum = 20000;
-        XmNscaleHeight = 15;
-        XmNshowArrows = TRUE;
-        XmNscaleMultiple = 1;
-        XmNshowValue = TRUE;
-        XmNorientation = XmHORIZONTAL;
-        XmNx = 210;
-        XmNy = 40;
-        XmNwidth = 260;
-        XmNheight = 34;
-    };
-    controls {
-        Xm_Title {
-            arguments {
-                arguments Style_use;
-            };
-            callbacks {
-                    callbacks Style_useReasons;
-            };
-!(BX)            handlers {
-!(BX)                handlers Style_useHandlers;
-!(BX)            };
-        };
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNvalueChangedCallback = procedure do_mbpingedit_scale_x();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mBpedit_mbpingedit_slider_mbpingedit_scale_x_label : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_END;
-        XmNlabelString = compound_string("Acrosstrack Width (m):  1");
-        XmNx = 30;
-        XmNy = 50;
-        XmNheight = 20;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mBpedit_mbpingedit_pushButton_reverse : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Reverse");
-        XmNx = 180;
-        XmNy = 0;
-        XmNwidth = 80;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNactivateCallback = procedure do_mbpingedit_reverse();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mBpedit_mbpingedit_pushButton_forward : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Forward");
-        XmNx = 270;
-        XmNy = 0;
-        XmNwidth = 80;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNactivateCallback = procedure do_mbpingedit_forward();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mBpedit_mbpingedit_pushButton_dismiss : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Dismiss");
-        XmNx = 910;
-        XmNy = 0;
-        XmNwidth = 80;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNactivateCallback = procedure do_mbpingedit_dismiss();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mBpedit_mbpingedit_pushButton_next : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Next File");
-        XmNx = 360;
-        XmNy = 0;
-        XmNwidth = 90;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNactivateCallback = procedure do_mbpingedit_next_buffer();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mBpedit_mbpingedit_pushButton_goto : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Go To Specified Time...");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNactivateCallback = procedure BxManageCB("mbpingedit_bulletinBoard_goto");
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mBpedit_mbpingedit_pushButton_buffer : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Buffer Controls...");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNactivateCallback = procedure BxManageCB("mbpingedit_bulletinBoard_buffer" &
- "");
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mBpedit_mbpingedit_pushButton_annotation : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Annotation...");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNactivateCallback = procedure BxManageCB("mbpingedit_bulletinBoard_annota" &
- "tion");
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mBpedit_mbpingedit_pushButton_filters : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Filters...");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNactivateCallback = procedure BxManageCB("mbpingedit_bulletinBoard_filter" &
- "s");
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mBpedit_mbpingedit_separator7 : XmSeparator widget {
-    arguments {
-        arguments Style_use;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mBpedit_mbpingedit_toggleButton_reverse_keys : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNlabelString = compound_string("Reverse Right/Left Key Macros");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNvalueChangedCallback = procedure do_mbpingedit_reverse_keys();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mBpedit_mbpingedit_toggleButton_reverse_mouse : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNlabelString = compound_string("Reverse Mouse Buttons");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNvalueChangedCallback = procedure do_mbpingedit_reverse_mouse();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mBpedit_mbpingedit_pulldownMenu_controls : XmPulldownMenu widget {
-    arguments {
-        arguments Style_use;
-        XmNx = 0;
-        XmNy = 0;
-        XmNwidth = 240;
-        XmNheight = 150;
-    };
-    controls {
-         managed XmPushButton mBpedit_mbpingedit_pushButton_goto;
-         managed XmPushButton mBpedit_mbpingedit_pushButton_buffer;
-         managed XmPushButton mBpedit_mbpingedit_pushButton_annotation;
-         managed XmPushButton mBpedit_mbpingedit_pushButton_filters;
-         managed XmSeparator mBpedit_mbpingedit_separator7;
-         managed XmToggleButton mBpedit_mbpingedit_toggleButton_reverse_keys;
-         managed XmToggleButton mBpedit_mbpingedit_toggleButton_reverse_mouse;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mBpedit_mbpingedit_cascadeButton_controls : XmCascadeButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Controls");
-        XmNx = 5;
-        XmNy = 5;
-        XmNwidth = 77;
-        XmNheight = 24;
-    };
-    controls {
-         unmanaged XmPulldownMenu mBpedit_mbpingedit_pulldownMenu_controls;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mBpedit_mbpingedit_menuBar_controls : XmMenuBar widget {
-    arguments {
-        arguments Style_use;
-        XmNx = 80;
-        XmNy = 0;
-        XmNwidth = 87;
-        XmNheight = 34;
-    };
-    controls {
-         managed XmCascadeButton mBpedit_mbpingedit_cascadeButton_controls;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mBpedit_mbpingedit_pushButton_unflag_view : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Unflag View");
-        XmNx = 610;
-        XmNy = 0;
-        XmNwidth = 120;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNactivateCallback = procedure do_mbpingedit_unflag_view();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mBpedit_mbpingedit_pushButton_unflag_all : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Unflag Forward");
-        XmNx = 730;
-        XmNy = 0;
-        XmNwidth = 120;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNactivateCallback = procedure do_mbpingedit_unflag_all();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mBpedit_mbpingedit_toggleButton_view_waterfall : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Waterfall View");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNvalueChangedCallback = procedure do_mbpingedit_view_mode();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mBpedit_mbpingedit_toggleButton_view_alongtrack : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Alongtrack View");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNvalueChangedCallback = procedure do_mbpingedit_view_mode();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mBpedit_mbpingedit_toggleButton_view_acrosstrack : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Acrosstrack View");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNvalueChangedCallback = procedure do_mbpingedit_view_mode();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mBpedit_mbpingedit_separator2 : XmSeparator widget {
-    arguments {
-        arguments Style_use;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mBpedit_mbpingedit_toggleButton_show_flagged_on : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNlabelString = compound_string("Show Flagged Profile");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNvalueChangedCallback = procedure do_mbpingedit_show_flagged();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mBpedit_mbpingedit_toggleButton_show_detects : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNlabelString = compound_string("Show Bottom Detect Algorithms");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNvalueChangedCallback = procedure do_mbpingedit_show_detects();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mBpedit_mbpingedit_separator9 : XmSeparator widget {
-    arguments {
-        arguments Style_use;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mBpedit_mbpingedit_toggleButton_show_wideplot : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNlabelString = compound_string("Wide Bathymetry Profiles");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNvalueChangedCallback = procedure do_mbpingedit_show_time();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mBpedit_mbpingedit_toggleButton_show_time : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNlabelString = compound_string("Print Time Stamps");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNvalueChangedCallback = procedure do_mbpingedit_show_time();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mBpedit_mbpingedit_toggleButton_show_interval : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Plot Ping Interval");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNvalueChangedCallback = procedure do_mbpingedit_show_time();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mBpedit_mbpingedit_toggleButton_show_lon : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Plot Longitude");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNvalueChangedCallback = procedure do_mbpingedit_show_time();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mBpedit_mbpingedit_toggleButton_show_latitude : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Plot Latitude");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNvalueChangedCallback = procedure do_mbpingedit_show_time();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mBpedit_mbpingedit_toggleButton_show_heading : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNlabelString = compound_string("Plot Heading");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNvalueChangedCallback = procedure do_mbpingedit_show_time();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mBpedit_mbpingedit_toggleButton_show_speed : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Plot Speed");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNvalueChangedCallback = procedure do_mbpingedit_show_time();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mBpedit_mbpingedit_toggleButton_show_depth : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Plot Center Beam Depth");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNvalueChangedCallback = procedure do_mbpingedit_show_time();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mBpedit_mbpingedit_toggleButton_show_altitude : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Plot Sonar Altitude");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNvalueChangedCallback = procedure do_mbpingedit_show_time();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mBpedit_mbpingedit_toggleButton_show_sonardepth : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Plot Sonar Depth");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNvalueChangedCallback = procedure do_mbpingedit_show_time();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mBpedit_mbpingedit_toggleButton_show_roll : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Plot Roll");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNvalueChangedCallback = procedure do_mbpingedit_show_time();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mBpedit_mbpingedit_toggleButton_show_pitch : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Plot Pitch");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNvalueChangedCallback = procedure do_mbpingedit_show_time();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mBpedit_mbpingedit_toggleButton_show_heave : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Plot Heave");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNvalueChangedCallback = procedure do_mbpingedit_show_time();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mBpedit_mbpingedit_pulldownMenu_view : XmPulldownMenu widget {
-    arguments {
-        arguments Style_use;
-        XmNx = 0;
-        XmNy = 0;
-        XmNwidth = 247;
-        XmNheight = 440;
-    };
-    controls {
-         managed XmToggleButton mBpedit_mbpingedit_toggleButton_view_waterfall;
-         managed XmToggleButton mBpedit_mbpingedit_toggleButton_view_alongtrack;
-         managed XmToggleButton mBpedit_mbpingedit_toggleButton_view_acrosstrack;
-         managed XmSeparator mBpedit_mbpingedit_separator2;
-         managed XmToggleButton mBpedit_mbpingedit_toggleButton_show_flagged_on;
-         managed XmToggleButton mBpedit_mbpingedit_toggleButton_show_detects;
-         managed XmSeparator mBpedit_mbpingedit_separator9;
-         managed XmToggleButton mBpedit_mbpingedit_toggleButton_show_wideplot;
-         managed XmToggleButton mBpedit_mbpingedit_toggleButton_show_time;
-         managed XmToggleButton mBpedit_mbpingedit_toggleButton_show_interval;
-         managed XmToggleButton mBpedit_mbpingedit_toggleButton_show_lon;
-         managed XmToggleButton mBpedit_mbpingedit_toggleButton_show_latitude;
-         managed XmToggleButton mBpedit_mbpingedit_toggleButton_show_heading;
-         managed XmToggleButton mBpedit_mbpingedit_toggleButton_show_speed;
-         managed XmToggleButton mBpedit_mbpingedit_toggleButton_show_depth;
-         managed XmToggleButton mBpedit_mbpingedit_toggleButton_show_altitude;
-         managed XmToggleButton mBpedit_mbpingedit_toggleButton_show_sonardepth;
-         managed XmToggleButton mBpedit_mbpingedit_toggleButton_show_roll;
-         managed XmToggleButton mBpedit_mbpingedit_toggleButton_show_pitch;
-         managed XmToggleButton mBpedit_mbpingedit_toggleButton_show_heave;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mBpedit_mbpingedit_cascadeButton_view : XmCascadeButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("View");
-        XmNx = 5;
-        XmNy = 5;
-        XmNwidth = 48;
-        XmNheight = 24;
-    };
-    controls {
-         unmanaged XmPulldownMenu mBpedit_mbpingedit_pulldownMenu_view;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mBpedit_mbpingedit_menuBar_view : XmMenuBar widget {
-    arguments {
-        arguments Style_use;
-        XmNpacking = XmPACK_TIGHT;
-        XmNx = 10;
-        XmNy = 0;
-        XmNwidth = 58;
-        XmNheight = 34;
-    };
-    controls {
-         managed XmCascadeButton mBpedit_mbpingedit_cascadeButton_view;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mBpedit_mbpingedit_pushButton_flag_view : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Flag View");
-        XmNx = 480;
-        XmNy = 0;
-        XmNwidth = 120;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNactivateCallback = procedure do_mbpingedit_flag_view();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mBpedit_mbpingedit_controls : XmBulletinBoard widget {
-    arguments {
-        arguments Style_use;
-        XmNmarginHeight = 0;
-        XmNmarginWidth = 0;
-        XmNresizePolicy = XmRESIZE_GROW;
-        XmNrightAttachment = XmATTACH_FORM;
-        XmNleftAttachment = XmATTACH_FORM;
-        XmNleftOffset = 0;
-        XmNrightOffset = -1;
-        XmNtopOffset = 0;
-        XmNx = 0;
-        XmNy = 0;
-        XmNwidth = 1005;
-        XmNheight = 154;
-    };
-    controls {
-         managed XmPushButton mBpedit_mbpingedit_pushButton_flag_view;
-         managed XmMenuBar mBpedit_mbpingedit_menuBar_view;
-         managed XmPushButton mBpedit_mbpingedit_pushButton_unflag_all;
-         managed XmPushButton mBpedit_mbpingedit_pushButton_unflag_view;
-         managed XmMenuBar mBpedit_mbpingedit_menuBar_controls;
-         managed XmPushButton mBpedit_mbpingedit_pushButton_next;
-         managed XmPushButton mBpedit_mbpingedit_pushButton_dismiss;
-         managed XmPushButton mBpedit_mbpingedit_pushButton_forward;
-         managed XmPushButton mBpedit_mbpingedit_pushButton_reverse;
-         managed XmLabel mBpedit_mbpingedit_slider_mbpingedit_scale_x_label;
-         managed XmScale mBpedit_mbpingedit_slider_mbpingedit_scale_x;
-         managed XmLabel mBpedit_mbpingedit_slider_mbpingedit_scale_x_max_label;
-         managed XmLabel mBpedit_mbpingedit_slider_mbpingedit_scale_y_label;
-         managed XmScale mBpedit_mbpingedit_slider_mbpingedit_scale_y;
-         managed XmLabel mBpedit_mbpingedit_slider_mbpingedit_scale_y_max_label;
-         managed XmLabel mBpedit_mbpingedit_slider_number_pings_label;
-         managed XmScale mBpedit_mbpingedit_slider_number_pings;
-         managed XmLabel mBpedit_mbpingedit_slider_num_pings_max_label;
-         managed XmLabel mBpedit_mbpingedit_slider_number_step_label;
-         managed XmScale mBpedit_mbpingedit_slider_number_step;
-         managed XmLabel mBpedit_mbpingedit_slider_number_max_step_label;
-         managed XmLabel mBpedit_mbpingedit_setting_mode_label;
-         managed XmRowColumn mBpedit_mbpingedit_setting_mode;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mBpedit_mbpingedit_form : XmForm widget {
-    arguments {
-!(BX) BxNclassOnly = "MBpedit";
-!(BX) BxNsubclassDerived = "False";
-!(BX) BxNclassOnlyFile = "False";
-!(BX) BxNbaseInclude = asciz_string_table('');
-!(BX) BxNderivedInclude = asciz_string_table('');
-!(BX) BxNderived = "MBpeditDerived";
-!(BX) BxNfilebase = "MBpeditDerived";
-!(BX) BxNclassFilebase = "MBpedit";
-!(BX) BxNclassGeometry = "1004x694+452+354";
-!(BX) BxNgenerate = "True";
-!(BX) BxNreference = "True";
-!(BX) BxNpaletteGroup = "Project Classes";
-!(BX) BxNpaletteName = "MBpedit";
-!(BX) BxNpaletteGeom = "+0+0";
-        arguments Style_use;
-        XmNdialogTitle = compound_string("MBeditviz Swath View");
-        XmNresizePolicy = XmRESIZE_GROW;
-        XmNx = 452;
-        XmNy = 354;
-        XmNwidth = 1004;
-        XmNheight = 694;
-    };
-    controls {
-         managed XmBulletinBoard mBpedit_mbpingedit_controls;
-         managed XmDrawingArea mBpedit_mbpingedit_canvas;
-!(BX)         unmanaged XmDialogShell mBpedit_mbpingedit_dialogShell_filters;
-!(BX)         unmanaged XmDialogShell mBpedit_mbpingedit_dialogShell_annotation;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-end module;
diff --git a/src/mbview/mbpingedit_bxutils.c b/src/mbview/mbpingedit_bxutils.c
deleted file mode 100644
index f4b6a09..0000000
--- a/src/mbview/mbpingedit_bxutils.c
+++ /dev/null
@@ -1,4026 +0,0 @@
-
-/* Begin user code block <abstract> */
-/* End user code block <abstract> */
-
-/**
- * WARNING: This file is overwritten at code generation time.
- * Any changes to this file will be lost.
- */
-/*
- * MODULE: BxConvert.c
- * AUTHOR: Automatically generated by Builder Xcessory
- *
- * Description: This module contains various utilities, converters
- *	for XmStrings (to work properly with app-defaults), and if needed
- *	the XPM pixmap utilities.
- *
- * Edit the file ${BX}/gen/bxutils.c (BX$SYSTEM:[gen]bxutils.c on VMS) to
- * make system wide changes to this file which will be visible next time
- * this file is generated.
- * ${BX} is the directory where Builder Xcessory is installed.
- */
-
-/*
- * BX supplies a string format for compound strings:
- *
- *		::[#tag][:t][:r]["str"]
- *
- * where:
- *	:: = indicates compound string.
- *	tag =  the font tag
- *	:t = separator (if not seen no separator added to segment)
- *	:r = right to left (if not seen left to right assumed)
- *	"str" = the text of the string.
- *
- * The components for the compound string can be repeated any number of
- * times.
- */
-
-/*****************************************************************************
- *       INCLUDE FILES
- *****************************************************************************/
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#if defined(__hpux)
-#define XLIB_ILLEGAL_ACCESS
-#endif
-#include <Xm/Xm.h>
-#include <Xm/RowColumn.h>
-#include <stdio.h>
-#include <ctype.h>
-#include <string.h>
-
-/*
- * Include stdlib.h and malloc.h if code is C++, ANSI, or Extended ANSI.
- */
-#if defined(__cplusplus) || defined(__STDC__) || defined(__EXTENSIONS__)
-#include <stdlib.h>
-#ifndef VMS
-#include <malloc.h>
-#endif
-#endif
-
-/*****************************************************************************
- *       TYPDEFS AND DEFINES
- *****************************************************************************/
-
-/*
- * Undefine this if you want to use native strcasecmp.
- */
-#define LOCAL_STRCASECMP
-
-#ifdef _NO_PROTO
-#ifdef NeedFunctionPrototypes
-#undef NeedFunctionPrototypes
-#endif
-#endif
-
-/*
- * Define SUPPORTS_WCHARS if the system supports wide character sets
- * Note: the following line flags the VAXC compiler and not the
- * DECC compiler running VAXC emulation.
- */
-#if !((defined(VAXC) && !defined(__DECC)) || defined(__CENTERLINE__))
-#define SUPPORTS_WCHARS
-#endif
-
-/*
- * Handy definition used in SET_BACKGROUND_COLOR
-*/
-#define UNSET		(-1)
-
-/*
- * Set state of inclusion of prototypes properly
- */
-#ifdef NeedFunctionPrototypes
-#define ARGLIST(p)	(
-#define ARG(a, b)	a b,
-#define GRA(a, b)	a b)
-#else
-#define ARGLIST(p)	p
-#define ARG(a, b)	a b;
-#define GRA(a, b)	a b;
-#endif
-
-#ifdef NeedFunctionPrototypes
-#ifdef __cplusplus
-#define UARG(a, b)	a,
-#define GRAU(a, b)	a)
-#else
-#define UARG(a, b)	a b,
-#define GRAU(a, b)	a b)
-#endif
-#else
-#define UARG(a, b)	a b;
-#define GRAU(a, b)	a b;
-#endif
-
-/*
- * Set up strcasecmp function
- */
-#if defined(LOCAL_STRCASECMP)
-#define STRCASECMP	StrCasecmp
-#ifndef NeedFunctionPrototypes
-static int StrCasecmp();
-#else
-static int StrCasecmp(char*, char*);
-#endif
-#else
-#define STRCASECMP	strcasecmp
-#endif
-
-/*
- * Define XTPOINTER so it works with all releases of
- * Xt and c++.
- */
-#ifdef __cplusplus
-#if XtSpecificationRelease < 5
-#define XTPOINTER	char *
-#else
-#define XTPOINTER	XPointer
-#endif
-#else
-#define XTPOINTER	XtPointer
-#endif
-
-/*
- * The following enum is used to support wide character sets.
- * Use this enum for references into the Common Wide Characters array.
- * If you add to the array, ALWAYS keep NUM_COMMON_WCHARS as the last
- * entry in the enum.  This will maintain correct memory usage, etc.
- */
-enum { WNull, WTab, WNewLine, WCarriageReturn, WFormFeed, WVerticalTab,
-       WBackSlash, WQuote, WHash, WColon, WideF, WideL, WideN, WideR,
-       WideT, WideV, WideUF, WideUL, WideUR, WideUT, WideZero, WideOne,
-       NUM_COMMON_WCHARS };
-
-/*****************************************************************************
- *       GLOBAL DECLARATIONS
- *****************************************************************************/
-
-/*****************************************************************************
- *       EXTERNAL DECLARATIONS
- *****************************************************************************/
-
-/*****************************************************************************
- *	STATIC DECLARATION
- *****************************************************************************/
-
-#ifndef NeedFunctionPrototypes
-
-#ifndef SUPPORTS_WCHARS
-static int	 mblen			();
-#endif
-static int	strlenWc		();
-static size_t	doMbstowcs		();
-static size_t	doWcstombs 		();
-static void	copyWcsToMbs		();
-static int 	dombtowc		();
-static Boolean	extractSegment		();
-static XmString	StringToXmString	();
-static char*	getNextCStrDelim	();
-static int	getCStrCount		();
-static wchar_t *CStrCommonWideCharsGet	();
-
-#else
-
-#ifndef SUPPORTS_WCHARS
-static int 	mblen			(char*, size_t);
-#endif
-static int	strlenWc		(wchar_t*);
-static size_t	doMbstowcs		(wchar_t*, char*, size_t);
-static size_t	doWcstombs 		(char*, wchar_t*, size_t);
-static void	copyWcsToMbs		(char*, wchar_t*, int, Boolean);
-static int 	dombtowc		(wchar_t*, char*, size_t);
-static Boolean	extractSegment		(wchar_t**, wchar_t**, int *,
-					 wchar_t**, int*, int*,	Boolean*);
-static XmString	StringToXmString	(char*);
-static char*	getNextCStrDelim	(char*);
-static int	getCStrCount		(char*);
-static wchar_t *CStrCommonWideCharsGet	();
-
-#endif
-
-/*****************************************************************************
- *	STATIC CODE
- *****************************************************************************/
-
-#if defined(LOCAL_STRCASECMP)
-
-/*
- * Function:
- *      cmp = StrCasecmp(s1, s2);
- * Description:
- *      Compare two strings ignoring case
- * Input:
- *      s1 - char * : string 1 to compare
- *      s2 - char * : string 2 to compare
- * Output:
- *      int :  0; s1 == s2
- *             1; s1 != s2
- */
-static int StrCasecmp
-    ARGLIST((s1, s2))
-        ARG(register char *, s1)
-        GRA(register char *, s2)
-{
-    register int        c1, c2;
-
-    while (*s1 && *s2)
-    {
-        c1 = isupper(*s1) ? tolower(*s1) : *s1;
-        c2 = isupper(*s2) ? tolower(*s2) : *s2;
-        if (c1 != c2)
-        {
-            return(1);
-        }
-        s1++;
-        s2++;
-    }
-    if (*s1 || *s2)
-    {
-        return(1);
-    }
-    return(0);
-}
-#endif
-
-#ifndef SUPPORTS_WCHARS
-/*
- * Function:
- *      len = mblen(s, n);
- * Description:
- *      The mblen function for platforms that don't have one. This
- * 	function simply returns a length of 1 since no wide character
- *	support exists for this platform.
- * Input:
- *      s - char * : the character string to get the length from
- *	n - size_t : the size of the string
- * Output:
- *      int : always 1
- */
-static int mblen
-    ARGLIST((s, n))
-        ARG(char *, s)
-        GRA(size_t, n)
-{
-    return(1);
-}
-#endif
-
-/*
- * Function:
- *      len = strlenWc(ptr);
- * Description:
- *      Return the number of characters in a wide character string (not
- *	the characters in the resultant mbs).
- * Input:
- *      ptr - wchar_t* : pointer to the wcs to count
- * Output:
- *      int : the number of characters found
- */
-static int strlenWc
-    ARGLIST((ptr))
-        GRA(wchar_t *,ptr)
-{
-    register wchar_t	*p = ptr;
-    register int	x = 0;
-
-    if (!ptr) return(0);
-
-    while (*p++) x++;
-    return (x);
-}
-
-/*
- * Function:
- *      bytesConv = doMbstowcs(wcs, mbs, n);
- * Description:
- *      Create a wcs string from an input mbs.
- * Input:
- *	wcs - wchar_t* : pointer to result buffer of wcs
- *      mbs - char* : pointer to the source mbs
- *	n - size_t : the number of characters to convert
- * Output:
- *      bytesConv - size_t : number of bytes converted
- */
-static size_t doMbstowcs
-    ARGLIST((wcs, mbs, n))
-        ARG(wchar_t *,wcs)
-        ARG(char *, mbs)
-        GRA(size_t, n)
-{
-#ifndef SUPPORTS_WCHARS
-    int i;
-
-    for (i = 0; i < n && mbs[i] != 0; ++i)
-    {
-	wcs[i] = mbs[i];
-    }
-    wcs[i++] = 0;
-    return(i);
-#else
-    return(mbstowcs(wcs, mbs, n));
-#endif
-}
-
-/*
- * Function:
- *      bytesConv = doWcstombs(wcs, mbs, n);
- * Description:
- *      Create a mbs string from an input wcs.
- * Input:
- *	wcs - wchar_t* : pointer to the source wcs
- *      mbs - char* : pointer to result mbs buffer
- *	n - size_t : the number of characters to convert
- * Output:
- *      bytesConv - size_t : number of bytes converted
- */
-static size_t doWcstombs
-    ARGLIST((mbs, wcs, n))
-        ARG(char *, mbs)
-        ARG(wchar_t *, wcs)
-        GRA(size_t, n)
-{
-#ifndef SUPPORTS_WCHARS
-    int i;
-
-    for (i = 0; i < n && wcs[i] != 0; ++i)
-    {
-	mbs[i] = wcs[i];
-    }
-    mbs[i] = 0;
-    return(i);
-#else
-    size_t	retval;
-
-    retval = wcstombs(mbs, wcs, (n * sizeof(wchar_t)));
-    if ( retval == (size_t)-1 ) return(0);
-    else return(retval);
-#endif
-}
-
-/*
- * Function:
- *      copyWcsToMbs(mbs, wcs, len);
- * Description:
- *      Create a mbs string from an input wcs. This function allocates
- *	a buffer if necessary.
- * Input:
- *	mbs - char* : destination for the converted/copied output
- *	wcs - wchar_t* : pointer to wcs to copy/convert
- *	len - int : the number of wchar_t' to convert
- *	process_it - Boolean : True if processing of quoted charcters,
- *			False if blind.
- * Output:
- *      None
- */
-static void copyWcsToMbs
-    ARGLIST((mbs, wcs, len, process_it))
-        ARG(char *, mbs)
-        ARG(wchar_t *, wcs)
-        ARG(int, len)
-        GRA(Boolean, process_it)
-{
-    static	wchar_t	*tbuf = NULL;
-    static	int	tbufSize = 0;
-
-    int		numCvt;
-    int		lenToConvert;
-    wchar_t	*fromP = wcs;
-    wchar_t	*x = &fromP[len];
-    wchar_t	*toP;
-    wchar_t	*commonWChars = CStrCommonWideCharsGet();
-    wchar_t	tmp;
-
-    /*
-     * Make sure there's room in the buffer
-     */
-    if (tbufSize < len)
-    {
-	tbuf = (wchar_t*)XtRealloc((char*)tbuf, (len + 1) * sizeof(wchar_t));
-	tbufSize = len;
-    }
-
-    /*
-     * Now copy and process
-     */
-    toP = tbuf;
-    lenToConvert = 0;
-    while (fromP < x)
-    {
-	/*
-	 * Check for quoted characters
-	 */
-	if ((*fromP == commonWChars[WBackSlash]) && process_it)
-	{
-	    fromP++;		/* Skip quote */
-	    if (fromP == x)	/* Hanging quote? */
-	    {
-		*toP++ = commonWChars[WBackSlash];
-		lenToConvert++;
-		break;
-	    }
-	    tmp = *fromP++;
-	    if (tmp == commonWChars[WideN])
-	    {
-		*toP++ = commonWChars[WNewLine];
-	    }
-	    else if (tmp == commonWChars[WideT])
-	    {
-		*toP++ = commonWChars[WTab];
-	    }
-	    else if (tmp == commonWChars[WideR])
-	    {
-		*toP++ = commonWChars[WCarriageReturn];
-	    }
-	    else if (tmp == commonWChars[WideF])
-	    {
-		*toP++ = commonWChars[WFormFeed];
-	    }
-	    else if (tmp == commonWChars[WideV])
-	    {
-		*toP++ = commonWChars[WVerticalTab];
-	    }
-	    else if (tmp == commonWChars[WBackSlash])
-	    {
-		*toP++ = commonWChars[WBackSlash];
-	    }
-	    else
-	    {
-                /*
-		 * No special translation needed
-		 */
-		*toP++ = tmp;
-	    }
-	}
-	else
-	{
-	    *toP++ = *fromP++;
-	}
-	lenToConvert++;
-    }
-
-    tmp = tbuf[lenToConvert];
-    tbuf[lenToConvert] = (wchar_t) 0;
-    numCvt = doWcstombs(mbs, tbuf, lenToConvert);
-    tbuf[lenToConvert] = tmp;
-
-    mbs[numCvt] = '\0';
-}
-
-/*
- * Function:
- *      status = dombtowc(wide, multi, size);
- * Description:
- *      Convert a multibyte character to a wide character.
- * Input:
- *      wide	- wchar_t *	: where to put the wide character
- *	multi	- char *	: the multibyte character to convert
- *	size	- size_t	: the number of characters to convert
- * Output:
- *      0	- if multi is a NULL pointer or points to a NULL character
- *	#bytes	- number of bytes in the multibyte character
- *	-1	- multi is an invalid multibyte character.
- *
- *	NOTE:  if wide is NULL, then this returns the number of bytes in
- *	       the multibyte character.
- */
-static int dombtowc
-    ARGLIST((wide, multi, size))
-        ARG(wchar_t *, wide)
-        ARG(char *, multi)
-        GRA(size_t, size)
-{
-    int		retVal = 0;
-
-#ifndef SUPPORTS_WCHARS
-    if ((multi == NULL) || (*multi == '\000'))
-    {
-	if (wide) wide[0] = '\0';
-	return (0);
-    }
-
-    for (retVal = 0; retVal < size && multi[retVal] != '\000'; retVal++)
-    {
-	if (wide != NULL)
-	{
-	    wide[retVal] = multi[retVal];
-	}
-    }
-#else
-    retVal = mbtowc(wide, multi, size);
-#endif
-    return(retVal);
-}
-
-/*
- * Function:
- *	ptr = getNextSepartor(str);
- * Description:
- *	Parse through a string looking for the next compound string
- *	field separator
- * Inputs:
- *	str - wchar_t* : the address of address of the string to parse
- * Outputs:
- *	ptr - wchar_t* : pointer to character, if found, points to end
- *			of string otherwise ('\0').
- */
-static wchar_t* getNextSeparator
-    ARGLIST((str))
-        GRA(wchar_t *, str)
-{
-    wchar_t	*ptr = str;
-    wchar_t	*commonWChars = CStrCommonWideCharsGet();
-
-    while (*ptr)
-    {
-	/*
-	 * Check for separator
-	 */
-	if ((*ptr == commonWChars[WHash]) ||
-	    (*ptr == commonWChars[WQuote]) ||
-	    (*ptr == commonWChars[WColon]))
-	{
-	    return(ptr);
-	}
-	else if (*ptr == commonWChars[WBackSlash])
-	{
-	    ptr++;
-	    if (*ptr) ptr++;	/* Skip quoted character */
-	}
-	else
-	{
-	    ptr++;
-	}
-    }
-    return(ptr);
-}
-
-/*
- * Function:
- *	more =
- *        extractSegment(str, tagStart, tagLen, txtStart, txtLen,
- *			pDir, pSep);
- * Description:
- *	Parse through a string version of a compound string and extract
- *	the first compound string segment from the string.
- * Inputs:
- *	str - char** : the address of address of the string to parse
- *	tagStart - char** : address to return pointer to tag start into
- *	tagLen - int* : address where to return the tag length into
- *	txtStart - char** : address to return the text start into
- *	txtLen - int* : address where to return the text length
- *	pDir - int* : address to return the string direction into
- *	pSep - Boolean * : address to return the separtor into
- * Outputs:
- *	more - Boolean : True if more of the string to parse.
- *			False means done.
- */
-static Boolean extractSegment
-    ARGLIST((str, tagStart, tagLen, txtStart, txtLen, pDir, pSep))
-        ARG(wchar_t **, str)
-        ARG(wchar_t **, tagStart)
-        ARG(int *, tagLen)
-        ARG(wchar_t **, txtStart)
-        ARG(int *, txtLen)
-        ARG(int *, pDir)
-        GRA(Boolean *, pSep)
-{
-    wchar_t		*start;
-    wchar_t		*text;
-    int			textL;
-    Boolean		tagSeen;
-    wchar_t		*tag;
-    int			tagL;
-    Boolean		modsSeen;
-    Boolean		sep;
-    int			dir;
-    Boolean		done;
-    Boolean		checkDir;
-    wchar_t		*commonWChars;
-    wchar_t		emptyStrWcs[1];
-
-    /*
-     * Initialize variables
-     */
-    text = NULL;
-    textL = 0;
-    tagSeen = False;
-    tag = NULL;
-    tagL = 0;
-    modsSeen = False;
-    dir = XmSTRING_DIRECTION_L_TO_R;
-    sep = False;
-    done = False;
-    commonWChars = CStrCommonWideCharsGet();
-
-    /*
-     * Guard against nulls
-     */
-    if (!(start = *str))
-    {
-	start = emptyStrWcs;
-	emptyStrWcs[0] = commonWChars[WNull];
-    }
-
-    /*
-     * If the first character of the string isn't a # or a ", then we
-     * just have a regular old simple string. Do the same the thing for
-     * the empty string.
-     */
-    if ((*start == '\0') || (start != getNextSeparator(start)))
-    {
-	text = start;
-	if (!(textL = strlenWc(start)))
-	{
-	    text = NULL;
-	}
-	start += textL;
-    }
-    else
-    {
-	done = False;
-	while (!done)
-	{
-	    if (*start == commonWChars[WHash])
-	    {
-		if (tagSeen)
-		{
-		    done = True;
-		    break;
-		}
-		else
-		{
-		    tagSeen = True;
-		    tag = ++start;
-		    start = getNextSeparator(tag);
-		    if ((tagL = start - tag) == 0)
-		    {
-			tag = NULL;		/* Null tag specified */
-		    }
-		}
-	    }
-	    else if (*start == commonWChars[WQuote])
-	    {
-		text = ++start;
-		start = getNextSeparator(start);
-		while (!((*start == commonWChars[WQuote]) ||
-			 (*start == commonWChars[WNull])))
-		{
-		    start = getNextSeparator(++start);
-		}
-
-		if ((textL = start - text) == 0)
-		{
-		    text = NULL;	/* Null text specified  */
-		}
-                /*
-		 * if a quote, skip over it
-		 */
-		if (*start == commonWChars[WQuote])
-		{
-		    start++;
-		}
-		done = True;
-	    }
-	    else if (*start == commonWChars[WColon])
-	    {
-		if (modsSeen)
-		{
-		    done = True;
-		    break;
-		}
-
-		/*
-		 * If the next character is a t or f, the we've got
-		 * a separator.
-		 */
-		modsSeen = True;
-		checkDir = False;
-		start++;
-		if ((*start == commonWChars[WideT]) ||
-		    (*start == commonWChars[WideUT]) ||
-		    (*start == commonWChars[WideOne]))
-		{
-		    sep = True;
-		    start++;
-		    checkDir = True;
-		}
-		else if ((*start == commonWChars[WideF]) ||
-			 (*start == commonWChars[WideUF]) ||
-			 (*start == commonWChars[WideZero]))
-		{
-		    sep = False;
-		    start++;
-		    checkDir = True;
-		}
-		else if ((*start == commonWChars[WideR]) ||
-			 (*start == commonWChars[WideUR]))
-		{
-		    start++;
-		    dir = XmSTRING_DIRECTION_R_TO_L;
-		}
-		else if ((*start == commonWChars[WideL]) ||
-			 (*start == commonWChars[WideUL]))
-		{
-		    start++;
-		    dir = XmSTRING_DIRECTION_L_TO_R;
-		}
-		/*
-		 * Look for direction if necessary. This requires a bit of
-		 * look ahead.
-		 */
-		if (checkDir && (*start == commonWChars[WColon]))
-		{
-		    if ((*(start + 1) == commonWChars[WideL]) ||
-			(*(start + 1) == commonWChars[WideUL]))
-		    {
-			dir = XmSTRING_DIRECTION_L_TO_R;
-			start += 2;
-		    }
-		    else if ((*(start + 1) == commonWChars[WideR]) ||
-			     (*(start + 1) == commonWChars[WideUR]))
-		    {
-			dir = XmSTRING_DIRECTION_R_TO_L;
-			start+=2;
-		    }
-		}
-	    }
-            else
-	    {
-		/*
-		 * A bad string format! We'll just skip the character.
-		 */
-		start++;
-	    }
-	}
-    }
-
-    /*
-     * Now fill in return values
-     */
-    if (*str)		*str = start;
-    if (tagStart)	*tagStart = tag;
-    if (tagLen)		*tagLen = tagL;
-    if (txtStart)	*txtStart = text;
-    if (txtLen)		*txtLen = textL;
-    if (pDir)		*pDir = dir;
-    if (pSep)		*pSep = sep;
-
-    return ((*start == commonWChars[WNull]) ? False : True);
-}
-
-/*
- * Function:
- *	xstr = StringToXmString(str);
- * Description:
- *	Parse a string into an XmString.
- * Inputs:
- *	str - char * : the string to parse
- * Outputs:
- *	xstr - XmString : the allocated return structure
- */
-static XmString StringToXmString
-    ARGLIST((str))
-        GRA(char *,str)
-{
-    static char*	tagBuf = NULL;
-    static int		tagBufLen = 0;
-    static char*	textBuf = NULL;
-    static int		textBufLen = 0;
-
-    wchar_t		*ctx;
-    wchar_t		*tag;
-    int			tagLen;
-    wchar_t		*text;
-    int			textLen;
-    Boolean		sep;
-    int			dir;
-
-    Boolean		more;
-    wchar_t		*wcStr;
-    int			curDir;
-    XmString		xmStr;
-    XmString		s1;
-    XmString		s2;
-
-    if (!str) return(NULL);
-
-    /*
-     * For expediencies sake, we'll overallocate this buffer so that
-     * the wcs is guaranteed to fit (1 wc per byte in original string).
-     */
-    wcStr = (wchar_t*)XtMalloc((strlen(str) + 1) * sizeof(wchar_t));
-    doMbstowcs(wcStr, str, strlen(str) + 1);
-
-    /*
-     * Create the beginning segment
-     */
-    curDir = XmSTRING_DIRECTION_L_TO_R;
-    xmStr = XmStringDirectionCreate(curDir);
-
-    /*
-     * Convert the string.
-     */
-    more = True;
-    ctx = wcStr;
-    while (more)
-    {
-	more = extractSegment(&ctx, &tag, &tagLen,
-			      &text, &textLen, &dir, &sep);
-	/*
-	 * Pick up a direction change
-	 */
-	if (dir != curDir)
-	{
-#if defined(VMS) || (defined(__osf__) && defined(__alpha))
-#if XmVERSION > 1 || (XmVERSION == 1 && XmREVISION >= 2)
-	    /*
-	     * This is required on DEC Windows systems because they've
-	     * added the REVERT direction.
-	     */
-	    s1 = XmStringDirectionCreate(XmSTRING_DIRECTION_REVERT);
-	    s2 = xmStr;
-	    xmStr = XmStringConcat(s2, s1);
-	    XmStringFree(s1);
-	    XmStringFree(s2);
-#endif
-#endif
-	    curDir = dir;
-	    s1 = XmStringDirectionCreate(curDir);
-	    s2 = xmStr;
-	    xmStr = XmStringConcat(s2, s1);
-	    XmStringFree(s1);
-	    XmStringFree(s2);
-
-	}
-
-	/*
-	 * Create the segment. Text and tag first.
-	 */
-	if (textLen)
-	{
-	    if (textBufLen <= (textLen * sizeof(wchar_t)))
-	    {
-		textBufLen = (textLen + 1) * sizeof(wchar_t);
-		textBuf = (char*)XtRealloc(textBuf, textBufLen);
-	    }
-	    copyWcsToMbs(textBuf, text, textLen, True);
-
-	    if (tagLen)
-	    {
-		if (tagBufLen <= (tagLen * sizeof(wchar_t)))
-		{
-		    tagBufLen = (tagLen + 1) * sizeof(wchar_t);
-		    tagBuf = (char*)XtRealloc(tagBuf, tagBufLen);
-		}
-		copyWcsToMbs(tagBuf, tag, tagLen, False);
-	    }
-	    else
-	    {
-		if (!tagBuf)
-		{
-		    tagBufLen = strlen(XmSTRING_DEFAULT_CHARSET) + 1;
-		    tagBuf = (char*)XtMalloc(tagBufLen);
-		}
-		strcpy(tagBuf, XmSTRING_DEFAULT_CHARSET);
-	    }
-
-	    s1 = XmStringCreate(textBuf, tagBuf);
-	    s2 = xmStr;
-	    xmStr = XmStringConcat(s2, s1);
-	    XmStringFree(s1);
-	    XmStringFree(s2);
-	}
-
-	/*
-	 * Add in the separators.
-	 */
-	if (sep)
-	{
-	    s1 = XmStringSeparatorCreate();
-	    s2 = xmStr;
-	    xmStr = XmStringConcat(s2, s1);
-	    XmStringFree(s1);
-	    XmStringFree(s2);
-	}
-    }
-
-    /*
-     * Free up memory and return
-     */
-    XtFree((char*)wcStr);
-    return(xmStr);
-}
-
-/*
- * Function:
- *      nextCStr = getNextCStrDelim(str);
- * Description:
- *      Find the next unquoted , or \n in the string
- * Input:
- *	str - char * : the input string
- * Output:
- *      nextCStr - char* : pointer to the next delimiter. Returns NULL if no
- *			delimiter found.
- */
-static char* getNextCStrDelim
-    ARGLIST((str))
-        GRA(char *,str)
-{
-    char	*comma = str;
-    Boolean	inQuotes = False;
-    int		len;
-
-    if (!str) return(NULL);
-    if (!*str) return(NULL);	/* At end */
-
-#ifdef __CENTERLINE__
-    len = mblen((char *)NULL, sizeof(wchar_t));
-#else
-    len = mblen(NULL, sizeof(wchar_t));
-#endif
-    while (*comma)
-    {
-	if ((len = mblen(comma, sizeof(wchar_t))) > 1)
-	{
-	    comma += len;
-	    continue;
-	}
-
-	if (*comma == '\\')
-	{
-	    comma++;	/* Over quote */
-	    comma += mblen(comma, sizeof(wchar_t));
-	    continue;
-	}
-
-	/*
-	 * See if we have a delimiter
-	 */
-	if (!inQuotes)
-	{
-	    if ((*comma == ',') || (*comma == '\012'))
-	    {
-		return(comma);
-	    }
-	}
-
-	/*
-	 * Deal with quotes
-	 */
-	if (*comma == '\"')
-	{
-	    inQuotes = ~inQuotes;
-	}
-
-	comma++;
-    }
-
-    return(NULL);		/* None found */
-}
-
-/*
- * Function:
- *	cnt = getCStrCount(str);
- * Description:
- *      Get the count of cstrings in a compound string table ascii
- *	format.
- * Input:
- *      str - char * : string to parse
- * Output:
- *      cnt - int : the number of XmStrings found
- */
-static int getCStrCount
-    ARGLIST((str))
-        GRA(char *, str)
-{
-    int		x = 1;
-    char	*newStr;
-
-    if (!str) return(0);
-    if (!*str) return(0);
-
-    while (newStr = getNextCStrDelim(str))
-    {
-	x++;
-	str = ++newStr;
-    }
-    return(x);
-}
-
-/*
- * Function:
- *      cwc = CStrCommonWideCharsGet();
- * Description:
- *      Return the array of common wide characters.
- * Input:
- *      None.
- * Output:
- *     	cwc - wchar_t * : this array should never be written to or FREEd.
- */
-static wchar_t *CStrCommonWideCharsGet()
-{
-    static wchar_t	*CommonWideChars = NULL;
-    /*
-     * If you add to this array, don't forget to change the enum in
-     * the TYPEDEFS and DEFINES section above to correspond to this
-     * array.
-     */
-    static char	*characters[] = {
-	(char *)"\000", (char *)"\t", (char *)"\n", (char *)"\r",
-	(char *)"\f",   (char *)"\v", (char *)"\\", (char *)"\"",
-	(char *)"#", 	(char *)":",  (char *)"f",  (char *)"l",
-	(char *)"n", 	(char *)"r",  (char *)"t",  (char *)"v",
-	(char *)"F", 	(char *)"L",  (char *)"R",  (char *)"T",
-	(char *)"0",    (char *)"1"
-    };
-
-    if (CommonWideChars == NULL)
-    {
-	int	i;
-
-	/*
-	 * Allocate and create the array.
-	 */
-	CommonWideChars = (wchar_t*)XtMalloc(NUM_COMMON_WCHARS * sizeof(wchar_t));
-
-	for (i = 0; i < NUM_COMMON_WCHARS; i++)
-	{
-	    (void)dombtowc(&(CommonWideChars[i]), characters[i], 1);
-	}
-    }
-    return(CommonWideChars);
-}
-
-/*
- * Function:
- *      CvtXmStringDestructor(app, converted, data, args, num_args)
- * Description:
- *      This destructor is called by the X Toolkit Intrinsics to delete
- *	the memory allocated in CvtStringToXmString.
- * Input:
- *      app		- XtAppContext	: The Xt application context
- *	converted	- XrmValue *	: The value allocated by
- *					  CvtStringToXmString
- *	data		- XtPointer	: The extra data originally passed
- *					  to the converter
- *	args		- XrmValue *	: The extra arguments originally
- *					  passed to the converter
- *	num_args	- Cardinal *	: The number of args originally
- *					  passed to the converter
- * Output:
- *      None
- */
-static void
-CvtXmStringDestructor
-    ARGLIST((app, converted, data, args, num_args))
-        UARG(XtAppContext, app)
-        ARG(XrmValue *, converted)
-        UARG(XtPointer, data)
-        UARG(XrmValue *, args)
-        GRAU(Cardinal *, num_args)
-{
-    XmString	freestr = (XmString)converted->addr;
-    if ( freestr != NULL ) XmStringFree(freestr);
-}
-
-/*
- * Function:
- *	CONVERTER CvtStringToXmString
- *
- * Description:
- *	Convert a string to an XmString. This allows a string contained in
- *	resource file to contain multiple fonts. The syntax for the string
- *	is:
- *		::[#[font-tag]]"string"[#[font-tag]"string"] ...
- *
- *	note that the # can be escaped (\#).
- *
- * Input:
- * Output:
- *	Standard.
- */
-static Boolean CvtStringToXmString
-    ARGLIST((d, args, num_args, fromVal, toVal, data))
-        ARG(Display *, d)
-        UARG(XrmValue *, args)
-        ARG(Cardinal *, num_args)
-        ARG(XrmValue *, fromVal)
-        ARG(XrmValue *, toVal)
-        GRAU(XtPointer, data)
-{
-    static XmString	resStr;
-    char		*str;
-
-    /*
-     * This converter takes no parameters
-     */
-    if (*num_args != 0)
-    {
-	XtAppWarningMsg(XtDisplayToApplicationContext(d),
-			"cvtStringToXmString",
-			"wrongParameters",
-			"XtToolkitError",
-			"String to XmString converter needs no extra arguments",
-			(String *)NULL,
-			(Cardinal *)NULL);
-    }
-
-    /*
-     * See if this is a simple string
-     */
-    str = (char*)fromVal->addr;
-    if (strncmp(str, "::", 2))
-    {
-	resStr = XmStringCreateLtoR(fromVal->addr, XmSTRING_DEFAULT_CHARSET);
-    }
-    else
-    {
-	/*
-	 * Convert into internal format
-	 */
-	resStr = StringToXmString(fromVal->addr + 2);	/* skip :: */
-    }
-
-    /*
-     * Done, return result
-     */
-    if (toVal->addr == NULL)
-    {
-	toVal->addr = (XTPOINTER)&resStr;
-	toVal->size = sizeof(XmString);
-    }
-    else if (toVal->size < sizeof(XmString))
-    {
-	toVal->size = sizeof(XmString);
-	XtDisplayStringConversionWarning(d, fromVal->addr, "XmString");
-	XmStringFree(resStr);
-	return(False);
-    }
-    else
-    {
-	*(XmString *)toVal->addr = resStr;
-	toVal->size = sizeof(XmString);
-    }
-    return(True);
-}
-
-/*
- * Function:
- *      CONVERTER CvtStringToXmStringTable
- *
- * Description:
- *	Convert a string to an XmString table. This allows a string
- *	contained in resource file to contain multiple fonts. The syntax
- *	for the string is:
- *
- *	   compound_string = [#[font-tag]]"string"[#[font-tag]"string"] ...
- *	   compound_string_table = [compound_string][,compound_string] ...
- *
- *	note that the # can be escaped (\#).
- *
- * Input:
- * Output:
- *	Standard.
- */
-static Boolean CvtStringToXmStringTable
-    ARGLIST((d, args, num_args, fromVal, toVal, data))
-        ARG(Display *, d)
-        ARG(XrmValue *, args)
-        ARG(Cardinal *, num_args)
-        ARG(XrmValue *, fromVal)
-        ARG(XrmValue *, toVal)
-        GRAU(XtPointer, data)
-{
-    static XmString	*CStrTable;
-    XmString		*tblPtr;
-    char		*str;
-    char		*tmpBuf;
-    char		*nextDelim;
-    XrmValue		fVal;
-    XrmValue		tVal;
-
-    /*
-     * This converter takes no parameters
-     */
-    if (*num_args != 0)
-    {
-	XtAppWarningMsg
-	    (XtDisplayToApplicationContext(d),
-	     "cvtStringToXmStringTable",
-	     "wrongParameters",
-	     "XtToolkitError",
-	     "String to XmStringTable converter needs no extra arguments",
-	     (String *)NULL,
-	     (Cardinal *)NULL);
-    }
-
-    /*
-     * Set str and make sure there's somethin' there
-     */
-    if (!(str = (char*)fromVal->addr))
-    {
-	str = (char *)"";
-    }
-
-    /*
-     * Allocate the XmStrings + 1 for NULL termination
-     */
-    CStrTable = (XmString*)XtMalloc((getCStrCount(str) + 1) * sizeof(XmString*));
-
-    /*
-     * Use the string converter for the strings
-     */
-    tmpBuf = (char*)XtMalloc(strlen(str) + 1);
-    strcpy(tmpBuf, str);
-    str = tmpBuf;
-
-    /*
-     * Create strings
-     */
-    tblPtr = CStrTable;
-    if (*str)
-    {
-	while (str)
-	{
-	    nextDelim = getNextCStrDelim(str);
-
-	    /*
-	     * Overwrite nextDelim
-	     */
-	    if (nextDelim)
-	    {
-		*nextDelim = '\0';
-		nextDelim++;
-	    }
-
-	    /*
-	     * Convert it
-	     */
-	    fVal.size = strlen(str) + 1;
-	    fVal.addr = str;
-	    tVal.size = sizeof(XTPOINTER);
-	    tVal.addr = (XTPOINTER)tblPtr;
-
-	    /*
-	     * Call converter ourselves since this is used to create
-	     * the strings in the table we create. We need to do this
-	     * since we don't have a widget to send to the XtConvertAndStore
-	     * function. Side effects are that we can never get these
-	     * compound strings cached and that no destructor function is
-	     * called when the strings leave existance, but we nuke 'em
-	     * in the XmStringTable destuctor.
-	     */
-	    CvtStringToXmString(d, args, num_args, &fVal, &tVal, NULL);
-	    tblPtr++;
-	    str = nextDelim;
-	}
-    }
-    XtFree(tmpBuf);
-
-    /*
-     * Null terminate
-     */
-    *tblPtr = NULL;
-
-    /*
-     * Done, return result
-     */
-    if (toVal->addr == NULL)
-    {
-	toVal->addr = (XTPOINTER)&CStrTable;
-	toVal->size = sizeof(XmString);
-    }
-    else if (toVal->size < sizeof(XmString*))
-    {
-	toVal->size = sizeof(XmString*);
-	XtDisplayStringConversionWarning(d, fromVal->addr, "XmStringTable");
-
-	tblPtr = CStrTable;
-	while (*tblPtr)
-	{
-	    XmStringFree(*tblPtr);
-	}
-	XtFree((char*)CStrTable);
-	return(False);
-    }
-    else
-    {
-	*(XmString **)toVal->addr = CStrTable;
-	toVal->size = sizeof(XmString*);
-    }
-    return(True);
-}
-
-/*
- * Function:
- *      CvtXmStringTableDestructor(app, converted, data, args, num_args)
- * Description:
- *      This destructor is called by the X Toolkit Intrinsics to delete
- *	the memory allocated in CvtStringToXmString.
- * Input:
- *      app		- XtAppContext	: The Xt application context
- *	converted	- XrmValue *	: The value allocated by
- *					  CvtStringToXmStringTable
- *	data		- XtPointer	: The extra data originally passed
- *					  to the converter
- *	args		- XrmValue *	: The extra arguments originally
- *					  passed to the converter
- *	num_args	- Cardinal *	: The number of args originally
- *					  passed to the converter
- * Output:
- *      None
- */
-static void
-CvtXmStringTableDestructor
-    ARGLIST((app, converted, data, args, num_args))
-        UARG(XtAppContext, app)
-        ARG(XrmValue *, converted)
-        UARG(XtPointer, data)
-        UARG(XrmValue *, args)
-        GRAU(Cardinal *, num_args)
-{
-    XmString	*ptr = (XmString *)converted->addr;
-    while ( *ptr != NULL )
-    {
-	XmStringFree(*ptr);
-	ptr++;
-    }
-    XtFree((char*)converted->addr);
-}
-
-/*****************************************************************************
- *	GLOBAL CODE
- *****************************************************************************/
-
-/*
- * Function:
- *      RegisterBxConverters(appContext);
- * Description:
- *      This globally available function installs all the converters necessary
- *	to run BuilderXcessory generated interfaces that use compound
- *	strings. This is necessary since Motif has not supplied very smart
- *	converters.
- * Input:
- *      appContext - XtAppContext : the application context
- * Output:
- *      None
- */
-void RegisterBxConverters
-    ARGLIST((appContext))
-        GRA(XtAppContext, appContext)
-{
-    XtAppSetTypeConverter(appContext, XmRString, XmRXmString,
-			  (XtTypeConverter)&CvtStringToXmString,
-			  NULL, 0, XtCacheNone,
-                          (XtDestructor)&CvtXmStringDestructor);
-
-    XtAppSetTypeConverter(appContext, XmRString, XmRXmStringTable,
-			  (XtTypeConverter)&CvtStringToXmStringTable,
-			  NULL, 0, XtCacheNone,
-			  (XtDestructor)&CvtXmStringTableDestructor);
-}
-
-/*
- * Function:
- *      CONVERT(w, from_string, to_type, to_size, success);
- * Description:
- *      A converter wrapper for convenience from BuilderXcessory.
- * Input:
- *      w - Widget : the widget to use for conversion
- *	from_string - char * : the string to convert from
- *	to_type - char * : the type to convert to
- *	to_size - int : the size of the conversion result
- *	success - Boolean* : Set to the result value of the conversion
- * Output:
- *      None
- */
-#ifndef IGNORE_CONVERT
-XtPointer BX_CONVERT
-    ARGLIST((w, from_string, to_type, to_size, success))
-        ARG(Widget, w)
-        ARG(char *, from_string)
-        ARG(char *, to_type)
-        UARG(int, to_size)
-        GRA(Boolean *, success)
-{
-    XrmValue		fromVal, toVal;	/* resource holders		*/
-    Boolean		convResult;	/* return value			*/
-    XtPointer		val;		/* Pointer size return value    */
-
-    /*
-     * We will assume that the conversion is going to fail and change this
-     * value later if the conversion is a success.
-     */
-    *success = False;
-
-    /*
-     * Since we are converting from a string to some type we need to
-     * set the fromVal structure up with the string information that
-     * the caller passed in.
-     */
-    fromVal.size = strlen(from_string) + 1;
-    fromVal.addr = from_string;
-
-    /*
-     * Since we are not sure what type and size of data we are going to
-     * get back we will set this up so that the converter will point us
-     * at a block of valid data.
-     */
-    toVal.size = 0;
-    toVal.addr = NULL;
-
-    /*
-     * Now lets try to convert this data by calling this handy-dandy Xt
-     * routine.
-     */
-    convResult = XtConvertAndStore(w, XmRString, &fromVal, to_type, &toVal);
-
-
-    /*
-     * Now we have two conditions here.  One the conversion was a success
-     * and two the conversion failed.
-     */
-    if(!convResult)
-    {
-	/*
-	 * If this conversion failed that we can pretty much return right
-	 * here because there is nothing else we can do.
-	 */
-	return((XtPointer) NULL);
-    }
-
-    /*
-     * If we get this far that means we did the conversion and all is
-     * well.  Now we have to handle the special cases for type and
-     * size constraints.
-     */
-    if(!strcmp(to_type, "String"))
-    {
-	/*
-	 * Since strings are handled different in Xt we have to deal with
-	 * the conversion from a string to a string.  When this happens the
-	 * toVal.size will hold the strlen of the string so generic
-	 * conversion code can't handle it.  It is possible for a string to
-	 * string conversion to happen so we do have to watch for it.
-	 */
-	val = (XTPOINTER)toVal.addr;
-    }
-    else if(!strcmp(to_type, "Double"))
-    {
-	val = (XTPOINTER)((double*)toVal.addr);
-    }
-    else if(!strcmp(to_type, "Float"))
-    {
-	val = (XTPOINTER)((float*)toVal.addr);
-    }
-    else
-    {
-	/*
-	 * Here is the generic conversion return value handler.  This
-	 * just does some size specific casting so that value that we
-	 * return is in the correct bytes of the XtPointer that we
-	 * return.  Here we check all sizes from 1 to 8 bytes.
-	 */
-	switch(toVal.size)
-	{
-	case 1:
-	    val = (XTPOINTER)(*(char*)toVal.addr);
-	    break;
-	case 2:
-	    val = (XTPOINTER)(*(short*)toVal.addr);
-	    break;
-	case 4:
-	    val = (XTPOINTER)(*(int*)toVal.addr);
-	    break;
-	case 8:
-	default:
-	    val = (XTPOINTER)(*(long*)toVal.addr);
-	    break;
-	}
-    }
-
-    /*
-     * Well everything is done and the conversion was a success so lets
-     * set the success flag to True.
-     */
-    *success = convResult;
-
-    /*
-     * Finally lets return the converted value.
-     */
-    /*SUPPRESS 80*/
-    return(val);
-}
-
-#ifdef DEFINE_OLD_BXUTILS
-XtPointer CONVERT
-    ARGLIST((w, from_string, to_type, to_size, success))
-        ARG(Widget, w)
-        ARG(char *, from_string)
-        ARG(char *, to_type)
-        ARG(int, to_size)
-        GRA(Boolean *, success)
-{
-    return(BX_CONVERT(w, from_string, to_type, to_size, success));
-}
-#endif /* DEFINE_OLD_BXUTILS */
-#endif /* !IGNORE_CONVERT */
-
-/*
- * Function:
- *      MENU_POST(p, mw, ev, dispatch);
- * Description:
- *      A converter wrapper for convenience from BuilderXcessory.
- * Input:
- *      p - Widget : the widget to post
- *	mw - XtPointer : the menu widget
- *	ev - XEvent* : the event that caused the menu post
- *	dispatch - Boolean* : not used
- * Output:
- *      None
- */
-
-#ifndef IGNORE_MENU_POST
-void BX_MENU_POST
-    ARGLIST((p, mw, ev, dispatch))
-        UARG(Widget, p)
-        ARG(XtPointer, mw)
-        ARG(XEvent *, ev)
-        GRAU(Boolean *, dispatch)
-{
-    Arg	args[2];
-    int	argcnt;
-    int	button;
-    Widget m = (Widget)mw;
-    XButtonEvent *e = (XButtonEvent *)ev;
-
-    argcnt = 0;
-    XtSetArg(args[argcnt], XmNwhichButton, &button);
-    argcnt++;
-    XtGetValues(m, args, argcnt);
-    if(e->button != button) return;
-    XmMenuPosition(m, e);
-    XtManageChild(m);
-}
-
-#ifdef DEFINE_OLD_BXUTILS
-void MENU_POST
-    ARGLIST((p, mw, ev, dispatch))
-        ARG(Widget, p)
-        ARG(XtPointer, mw)
-        ARG(XEvent *, ev)
-        GRA(Boolean *, dispatch)
-{
-    BX_MENU_POST(p, mw, ev, dispatch);
-}
-#endif /* DEFINE_OLD_BXUTILS */
-#endif /* !IGNORE_MENU_POST */
-
-/*
- * Function:
- *      SET_BACKGROUND_COLOR(w, args, argcnt, bg_color);
- * Description:
- *      Sets the background color and shadows of a widget.
- * Input:
- *      w - The widget to set the background color on.
- *      args, argcnt - The argument list so far.
- *      bg_color - The new background color as a pixel.
- * Output:
- *      none
- *
- *  NOTES:  This assumes that args later in the argument list
- *          override those already in the list.  Therfore i f
- *          there are shadow colors later in the list they will win.
- *
- *          There is no need to use this function when creating a widget
- *          only when doing a set values, shadow colors are automatically
- *          calculated at creation time.
- */
-void BX_SET_BACKGROUND_COLOR
-    ARGLIST((w, args, argcnt, bg_color))
-        ARG(Widget, w)
-        ARG(ArgList, args)
-        ARG(Cardinal *, argcnt)
-        GRA(Pixel, bg_color)
-{
-    int		i;
-    int		topShadowLoc;
-    int		bottomShadowLoc;
-    int		selectLoc;
-    int		fgLoc;
-
-#if (((XmVERSION == 1) && (XmREVISION > 0)) || (XmVERSION > 1))
-
-    /*
-     * Walk through the arglist to see if the user set the top or
-     * bottom shadow colors.
-     */
-    selectLoc = topShadowLoc =  bottomShadowLoc = UNSET;
-    for (i = 0; i < *argcnt; i++)
-    {
-	if ((strcmp(args[i].name, XmNtopShadowColor) == 0) ||
-	    (strcmp(args[i].name, XmNtopShadowPixmap) == 0))
-	{
-	    topShadowLoc = i;
-	}
-	else if ((strcmp(args[i].name, XmNbottomShadowColor) == 0) ||
-		 (strcmp(args[i].name, XmNbottomShadowPixmap) == 0))
-	{
-	    bottomShadowLoc = i;
-	}
-	else if (strcmp(args[i].name, XmNarmColor) == 0)
-	{
-	    selectLoc = i;
-	}
-	else if (strcmp(args[i].name, XmNforeground) == 0)
-	{
-	    fgLoc = i;
-	}
-    }
-
-    /*
-     * If either the top or bottom shadow are not set then we
-     * need to use XmGetColors to get the shadow colors from the backgound
-     * color and add those that are not already in the arglist to the
-     * arglist.
-     *
-     */
-    if ((bottomShadowLoc == UNSET) ||
-	(topShadowLoc == UNSET) ||
-	(selectLoc == UNSET) ||
-	(fgLoc == UNSET))
-    {
-	Arg		larg[1];
-	Colormap	cmap;
-	Pixel		topShadow;
-	Pixel		bottomShadow;
-	Pixel		select;
-	Pixel		fgColor;
-
-	XtSetArg(larg[0], XmNcolormap, &cmap);
-	XtGetValues(w, larg, 1);
-	XmGetColors(XtScreen(w), cmap, bg_color,
-		    &fgColor, &topShadow, &bottomShadow, &select);
-
-	if (topShadowLoc == UNSET)
-	{
-	    XtSetArg(args[*argcnt], XmNtopShadowColor, topShadow);
-	    (*argcnt)++;
-	}
-
-	if (bottomShadowLoc == UNSET)
-	{
-	    XtSetArg(args[*argcnt], XmNbottomShadowColor, bottomShadow);
-	    (*argcnt)++;
-	}
-
-	if (selectLoc == UNSET)
-	{
-	    XtSetArg(args[*argcnt], XmNarmColor, select);
-	    (*argcnt)++;
-	}
-
-	if (fgLoc == UNSET)
-	{
-	    XtSetArg(args[*argcnt], XmNforeground, fgColor);
-	    (*argcnt)++;
-	}
-    }
-#endif
-
-    XtSetArg(args[*argcnt], XmNbackground, bg_color); (*argcnt)++;
-}
-
-#ifdef DEFINE_OLD_BXUTILS
-void SET_BACKGROUND_COLOR
-    ARGLIST((w, args, argcnt, bg_color))
-        ARG(Widget, w)
-        ARG(ArgList, args)
-        ARG(Cardinal *, argcnt)
-        GRA(Pixel, bg_color)
-{
-    BX_SET_BACKGROUND_COLOR(w, args, argcnt, bg_color);
-}
-#endif /* DEFINE_OLD_BXUTILS */
-
-/*
- * Function:
- *	w = BxFindTopShell(start);
- * Description:
- *	Go up the hierarhcy until we find a shell widget.
- * Input:
- *      start - Widget : the widget to start with.
- * Output:
- *	w - Widget : the shell widget.
- */
-#ifndef _BX_FIND_TOP_SHELL
-#define _BX_FIND_TOP_SHELL
-
-Widget BxFindTopShell
-    ARGLIST((start))
-        GRA(Widget, start)
-{
-    Widget	p;
-
-    while(p = XtParent(start))
-    {
-	start = p;
-    }
-    return(start);
-}
-#endif /* _BX_FIND_TOP_SHELL */
-
-/*
- * Function:
- *	BxWidgetIdsFromNames(ref, cbName, stringList)
- * Description:
- *	Return an array of widget ids from a list of widget names.
- * Input:
- *	ref - Widget : reference widget.
- *	cbName - char* : callback name.
- *	stringList - char*: list of widget names.
- * Output:
- *	WidgetList : array of widget IDs.
- */
-
-#ifndef _BX_WIDGETIDS_FROM_NAMES
-#define _BX_WIDGETIDS_FROM_NAMES
-
-WidgetList BxWidgetIdsFromNames
-    ARGLIST((ref, cbName, stringList))
-        ARG(Widget, ref)
-        ARG(char, *cbName)
-        GRA(char, *stringList)
-{
-    WidgetList	wgtIds = NULL;
-    int		wgtCount = 0;
-    Widget	inst;
-    Widget	current;
-    String	tmp;
-    String	start;
-    String	widget;
-    char       *ptr;
-
-    /*
-     * For backward compatibility, remove [ and ] from the list.
-     */
-    tmp = start = XtNewString(stringList);
-    if((start = strchr(start, '[')) != NULL) start++;
-    else start = tmp;
-
-    while((start && *start) && isspace(*start))
-    {
-	start++;
-    }
-    ptr = strrchr(start, ']');
-    if (ptr)
-    {
-	*ptr = '\0';
-    }
-
-    ptr = start + strlen(start) - 1;
-    while(ptr && *ptr)
-    {
-	if (isspace(*ptr))
-	{
-	    ptr--;
-	}
-	else
-	{
-	    ptr++;
-	    break;
-	}
-    }
-    if (ptr && *ptr)
-    {
-	*ptr = '\0';
-    }
-
-    /*
-     * start now points to the first character after the [.
-     * the list is now either empty, one, or more widget
-     * instance names.
-     */
-    start = strtok(start, ",");
-    while(start)
-    {
-        while((start && *start) && isspace(*start))
-        {
-            start++;
-        }
-        ptr = start + strlen(start) - 1;
-        while(ptr && *ptr)
-        {
-            if (isspace(*ptr))
-            {
-                ptr--;
-            }
-            else
-            {
-                ptr++;
-                break;
-            }
-        }
-        if (ptr && *ptr)
-        {
-            *ptr = '\0';
-        }
-
-	/*
-	 * Form a string to use with XtNameToWidget().
-	 */
-        widget = (char *)XtMalloc((strlen(start) + 2) * sizeof(char));
-        sprintf(widget, "*%s", start);
-
-	/*
-	 * Start at this level and continue up until the widget is found
-	 * or until the top of the hierarchy is reached.
-	 */
-	current = ref;
-	while (current != NULL)
-	{
-	    inst = XtNameToWidget(current, widget);
-	    if (inst != NULL )
-	    {
-		wgtCount++;
-		wgtIds = (WidgetList)XtRealloc((char *)wgtIds,
-					       wgtCount * sizeof(Widget));
-		wgtIds[wgtCount - 1] = inst;
-		break;
-	    }
-	    current = XtParent(current);
-	}
-
-	if (current == NULL)
-        {
-            printf("Callback Error (%s):\n\t\
-Cannot find widget %s\n", cbName, widget);
-        }
-        XtFree(widget);
-        start = strtok(NULL, ",");
-    }
-
-    /*
-     * NULL terminate the list.
-     */
-    wgtIds = (WidgetList)XtRealloc((char *)wgtIds,
-				   (wgtCount + 1) * sizeof(Widget));
-    wgtIds[wgtCount] = NULL;
-
-    XtFree((char *)tmp);
-    return(wgtIds);
-}
-#endif /* _BX_WIDGETIDS_FROM_NAMES */
-
-XtPointer BX_SINGLE
-    ARGLIST((val))
-    GRA(float, val)
-{
-    XtPointer pointer;
-
-    pointer = (XtPointer)XtMalloc(sizeof(float));
-    if ( pointer != NULL ) *((float *)pointer) = val;
-    return(pointer);
-}
-
-#ifdef DEFINE_OLD_BXUTILS
-XtPointer SINGLE
-    ARGLIST((val))
-    GRA(float, val)
-{
-    return(BX_SINGLE(val));
-}
-#endif /* DEFINE_OLD_BXUTILS */
-
-XtPointer BX_DOUBLE
-    ARGLIST((val))
-    GRA(double, val)
-{
-    XtPointer	pointer;
-
-    pointer = (XtPointer)XtMalloc(sizeof(double));
-    if ( pointer != NULL ) *((double *)pointer) = val;
-    return(pointer);
-}
-
-#ifdef DEFINE_OLD_BXUTILS
-XtPointer DOUBLE
-    ARGLIST((val))
-    GRA(double, val)
-{
-    return(BX_DOUBLE(val));
-}
-#endif /* DEFINE_OLD_BXUTILS */
-
-
-/****************************************************************************
- *
- * Big chunk of code inserted from Bull (based on modified 3.3)
- *
- ****************************************************************************/
-
-#ifndef IGNORE_XPM_PIXMAP
-
-#ifndef USE_XPM_LIBRARY
-
-#ifdef SYSV
-#include <memory.h>
-#endif
-
-/*
- * Copyright 1990, 1991 GROUPE BULL
- *
- * Permission to use, copy, modify, and distribute this software and its
- * documentation for any purpose and without fee is hereby granted, provided
- * that the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of GROUPE BULL not be used in advertising
- * or publicity pertaining to distribution of the software without specific,
- * written prior permission.  GROUPE BULL makes no representations about the
- * suitability of this software for any purpose.  It is provided "as is"
- * without express or implied warranty.
- *
- * GROUPE BULL disclaims all warranties with regard to this software,
- * including all implied warranties of merchantability and fitness,
- * in no event shall GROUPE BULL be liable for any special,
- * indirect or consequential damages or any damages
- * whatsoever resulting from loss of use, data or profits,
- * whether in an action of contract, negligence or other tortious
- * action, arising out of or in connection with the use
- * or performance of this software.
- *
- */
-
-/* Return ErrorStatus codes:
- * null     if full success
- * positive if partial success
- * negative if failure
- */
-
-#define BxXpmColorError    1
-#define BxXpmSuccess       0
-#define BxXpmOpenFailed   -1
-#define BxXpmFileInvalid  -2
-#define BxXpmNoMemory     -3
-#define BxXpmColorFailed  -4
-
-typedef struct {
-    char *name;                         /* Symbolic color name */
-    char *value;                        /* Color value */
-    Pixel pixel;                        /* Color pixel */
-} 	BxXpmColorSymbol;
-
-typedef struct {
-    unsigned long valuemask;            /* Specifies which attributes are
-                                         * defined */
-
-    Visual *visual;                     /* Specifies the visual to use */
-    Colormap colormap;                  /* Specifies the colormap to use */
-    unsigned int depth;                 /* Specifies the depth */
-    unsigned int width;                 /* Returns the width of the created
-                                         * pixmap */
-    unsigned int height;                /* Returns the height of the created
-                                         * pixmap */
-    unsigned int x_hotspot;             /* Returns the x hotspot's
-                                         * coordinate */
-    unsigned int y_hotspot;             /* Returns the y hotspot's
-                                         * coordinate */
-    unsigned int cpp;                   /* Specifies the number of char per
-                                         * pixel */
-    Pixel *pixels;                      /* List of used color pixels */
-    unsigned int npixels;               /* Number of pixels */
-    BxXpmColorSymbol *colorsymbols;       /* Array of color symbols to
-                                         * override */
-    unsigned int numsymbols;            /* Number of symbols */
-    char *rgb_fname;                    /* RGB text file name */
-
-    /* Infos */
-    unsigned int ncolors;               /* Number of colors */
-    char ***colorTable;                 /* Color table pointer */
-    char *hints_cmt;                    /* Comment of the hints section */
-    char *colors_cmt;                   /* Comment of the colors section */
-    char *pixels_cmt;                   /* Comment of the pixels section */
-    unsigned int mask_pixel;            /* Transparent pixel's color table
-                                         * index */
-}      BxXpmAttributes;
-
-/* Xpm attribute value masks bits */
-#define BxXpmVisual          (1L<<0)
-#define BxXpmColormap        (1L<<1)
-#define BxXpmDepth           (1L<<2)
-#define BxXpmSize            (1L<<3)      /* width & height */
-#define BxXpmHotspot         (1L<<4)      /* x_hotspot & y_hotspot */
-#define BxXpmCharsPerPixel   (1L<<5)
-#define BxXpmColorSymbols    (1L<<6)
-#define BxXpmRgbFilename     (1L<<7)
-#define BxXpmInfos           (1L<<8)      /* all infos members */
-
-#define BxXpmReturnPixels    (1L<<9)
-#define BxXpmReturnInfos     BxXpmInfos
-
-/*
- * minimal portability layer between ansi and KR C
- */
-
-/* forward declaration of functions with prototypes */
-
-#ifdef NeedFunctionPrototypes
-#define LFUNC(f, t, p) static t f p
-#else
-#define LFUNC(f, t, p) static t f()
-#endif
-
-/*
- * functions declarations
- */
-LFUNC(BxXpmCreatePixmapFromData, int, (Display * display,
-				       Drawable d,
-				       char **data,
-				       Pixmap * pixmap_return,
-				       Pixmap * shapemask_return,
-				       BxXpmAttributes * attributes));
-
-LFUNC(BxXpmCreateImageFromData, int, (Display * display,
-				      char **data,
-				      XImage ** image_return,
-				      XImage ** shapemask_return,
-				      BxXpmAttributes * attributes));
-
-LFUNC(BxXpmFreeAttributes, void, (BxXpmAttributes * attributes));
-
-typedef struct {
-    unsigned int type;
-    union {
-        FILE *file;
-        char **data;
-    }     stream;
-    char *cptr;
-    unsigned int line;
-    int CommentLength;
-    char Comment[BUFSIZ];
-    char *Bcmt, *Ecmt, Bos, Eos;
-    unsigned int InsideString;          /* used during parsing: 0 or 1
-                                         * whether we are inside or not */
-}      bxxpmData;
-
-#define BXXPMARRAY 0
-#define BXXPMFILE  1
-#define BXXPMPIPE  2
-
-typedef unsigned char byte;
-
-#define BX_TRANSPARENT_COLOR "None"        /* this must be a string! */
-
-/* number of BxXpmColorKeys */
-#define BXNKEYS 5
-
-/*
- * key numbers for visual type, they must fit along with the number key of
- * each corresponding element in BxXpmColorKeys[] defined in xpm.h
- */
-#define BXMONO    2
-#define BXGRAY4   3
-#define BXGRAY    4
-#define BXCOLOR   5
-
-/* structure containing data related to an Xpm pixmap */
-typedef struct {
-    char *name;
-    unsigned int width;
-    unsigned int height;
-    unsigned int cpp;
-    unsigned int ncolors;
-    char ***colorTable;
-    unsigned int *pixelindex;
-    XColor *xcolors;
-    char **colorStrings;
-    unsigned int mask_pixel;            /* mask pixel's colorTable index */
-}      bxxpmInternAttrib;
-
-#define BX_UNDEF_PIXEL 0x80000000
-
-char *BxXpmColorKeys[] =
-{
- (char *)"s",				/* key #1: symbol */
- (char *)"m",				/* key #2: mono visual */
- (char *)"g4",				/* key #3: 4 grays visual */
- (char *)"g",				/* key #4: gray visual */
- (char *)"c",				/* key #5: color visual */
-};
-
-/* XPM private routines */
-
-LFUNC(xpmCreateImage, int, (Display * display,
-                           bxxpmInternAttrib * attrib,
-                           XImage ** image_return,
-                           XImage ** shapeimage_return,
-                           BxXpmAttributes * attributes));
-
-LFUNC(xpmParseData, int, (bxxpmData * data,
-                         bxxpmInternAttrib * attrib_return,
-                         BxXpmAttributes * attributes));
-
-LFUNC(BxXpmVisualType, int, (Visual * visual));
-LFUNC(xpmFreeColorTable, void, (char ***colorTable, int ncolors));
-
-LFUNC(xpmInitInternAttrib, void, (bxxpmInternAttrib * xmpdata));
-
-LFUNC(xpmFreeInternAttrib, void, (bxxpmInternAttrib * xmpdata));
-
-LFUNC(xpmSetAttributes, void, (bxxpmInternAttrib * attrib,
-                             BxXpmAttributes * attributes));
-
-/* I/O utility */
-
-LFUNC(xpmNextString, void, (bxxpmData * mdata));
-LFUNC(xpmNextUI, int, (bxxpmData * mdata, unsigned int *ui_return));
-LFUNC(xpmGetC, int, (bxxpmData * mdata));
-LFUNC(xpmUngetC, int, (int c, bxxpmData * mdata));
-LFUNC(xpmNextWord, unsigned int, (bxxpmData * mdata, char *buf));
-LFUNC(xpmGetCmt, void, (bxxpmData * mdata, char **cmt));
-LFUNC(xpmOpenArray, int, (char **data, bxxpmData * mdata));
-LFUNC(XpmDataClose, void, (bxxpmData * mdata));
-
-/* RGB utility */
-
-LFUNC(xpm_xynormalizeimagebits, void, (register unsigned char *bp,
-                                     register XImage * img));
-LFUNC(xpm_znormalizeimagebits, void, (register unsigned char *bp,
-                                    register XImage * img));
-
-/* Image utility */
-
-LFUNC(SetColor, int, (Display * display, Colormap colormap, char *colorname,
-		      unsigned int color_index, Pixel * image_pixel,
-		      Pixel * mask_pixel, unsigned int *mask_pixel_index));
-
-LFUNC(CreateXImage, int, (Display * display, Visual * visual,
-			  unsigned int depth, unsigned int width,
-			  unsigned int height, XImage ** image_return));
-
-LFUNC(SetImagePixels, void, (XImage * image, unsigned int width,
-			    unsigned int height, unsigned int *pixelindex,
-			    Pixel * pixels));
-
-LFUNC(SetImagePixels32, void, (XImage * image, unsigned int width,
-			      unsigned int height, unsigned int *pixelindex,
-			      Pixel * pixels));
-
-LFUNC(SetImagePixels16, void, (XImage * image, unsigned int width,
-			      unsigned int height, unsigned int *pixelindex,
-			      Pixel * pixels));
-
-LFUNC(SetImagePixels8, void, (XImage * image, unsigned int width,
-			     unsigned int height, unsigned int *pixelindex,
-			     Pixel * pixels));
-
-LFUNC(SetImagePixels1, void, (XImage * image, unsigned int width,
-			     unsigned int height, unsigned int *pixelindex,
-			     Pixel * pixels));
-
-LFUNC(atoui, unsigned int, (char *p, unsigned int l, unsigned int *ui_return));
-
-/*
- * Macros
- *
- * The BXXYNORMALIZE macro determines whether XY format data requires
- * normalization and calls a routine to do so if needed. The logic in
- * this module is designed for LSBFirst byte and bit order, so
- * normalization is done as required to present the data in this order.
- *
- * The BXZNORMALIZE macro performs byte and nibble order normalization if
- * required for Z format data.
- *
- * The BXXYINDEX macro computes the index to the starting byte (char) boundary
- * for a bitmap_unit containing a pixel with coordinates x and y for image
- * data in XY format.
- *
- * The BXZINDEX* macros compute the index to the starting byte (char) boundary
- * for a pixel with coordinates x and y for image data in ZPixmap format.
- *
- */
-
-#define BXXYNORMALIZE(bp, img) \
-    if ((img->byte_order == MSBFirst) || (img->bitmap_bit_order == MSBFirst)) \
-        xpm_xynormalizeimagebits((unsigned char *)(bp), img)
-
-#define BXZNORMALIZE(bp, img) \
-    if (img->byte_order == MSBFirst) \
-        xpm_znormalizeimagebits((unsigned char *)(bp), img)
-
-#define BXXYINDEX(x, y, img) \
-    ((y) * img->bytes_per_line) + \
-    (((x) + img->xoffset) / img->bitmap_unit) * (img->bitmap_unit >> 3)
-
-#define BXZINDEX(x, y, img) ((y) * img->bytes_per_line) + \
-    (((x) * img->bits_per_pixel) >> 3)
-
-#define BXZINDEX32(x, y, img) ((y) * img->bytes_per_line) + ((x) << 2)
-
-#define BXZINDEX16(x, y, img) ((y) * img->bytes_per_line) + ((x) << 1)
-
-#define BXZINDEX8(x, y, img) ((y) * img->bytes_per_line) + (x)
-
-#define BXZINDEX1(x, y, img) ((y) * img->bytes_per_line) + ((x) >> 3)
-
-#if __STDC__
-#define Const const
-#else
-#define Const
-#endif
-
-
-
-static unsigned int atoui
-ARGLIST((p, l, ui_return))
-ARG(register char *, p)
-ARG(unsigned int, l)
-GRA(unsigned int *, ui_return)
-{
-    register int n, i;
-
-    n = 0;
-    for (i = 0; i < l; i++)
-        if (*p >= '0' && *p <= '9')
-            n = n * 10 + *p++ - '0';
-        else
-            break;
-
-    if (i != 0 && i == l) {
-        *ui_return = n;
-        return 1;
-    } else
-        return 0;
-}
-
-static int BxXpmCreatePixmapFromData
-ARGLIST((display, d, data, pixmap_return, shapemask_return, attributes))
-ARG(Display *, display)
-ARG(Drawable, d)
-ARG(char **, data)
-ARG(Pixmap *, pixmap_return)
-ARG(Pixmap *, shapemask_return)
-GRA(BxXpmAttributes *,attributes)
-{
-    XImage *image, **imageptr = NULL;
-    XImage *shapeimage, **shapeimageptr = NULL;
-    int ErrorStatus;
-    XGCValues gcv;
-    GC gc;
-
-    /*
-     * initialize return values
-     */
-    if (pixmap_return) {
-        *pixmap_return = (Pixmap) NULL;
-        imageptr = ℑ
-    }
-    if (shapemask_return) {
-        *shapemask_return = (Pixmap) NULL;
-        shapeimageptr = &shapeimage;
-    }
-
-    /*
-     * create the images
-     */
-    ErrorStatus = BxXpmCreateImageFromData(display, data, imageptr,
-                                         shapeimageptr, attributes);
-    if (ErrorStatus < 0)
-        return (ErrorStatus);
-
-    /*
-     * create the pixmaps
-     */
-    if (imageptr && image) {
-        *pixmap_return = XCreatePixmap(display, d, image->width,
-                                       image->height, image->depth);
-        gcv.function = GXcopy;
-        gc = XCreateGC(display, *pixmap_return, GCFunction, &gcv);
-
-        XPutImage(display, *pixmap_return, gc, image, 0, 0, 0, 0,
-                  image->width, image->height);
-
-        XDestroyImage(image);
-        XFreeGC(display, gc);
-    }
-    if (shapeimageptr && shapeimage) {
-        *shapemask_return = XCreatePixmap(display, d, shapeimage->width,
-                                          shapeimage->height,
-                                          shapeimage->depth);
-        gcv.function = GXcopy;
-        gc = XCreateGC(display, *shapemask_return, GCFunction, &gcv);
-
-        XPutImage(display, *shapemask_return, gc, shapeimage, 0, 0, 0, 0,
-                  shapeimage->width, shapeimage->height);
-
-        XDestroyImage(shapeimage);
-        XFreeGC(display, gc);
-    }
-    return (ErrorStatus);
-}
-
-
-static int BxXpmCreateImageFromData
-ARGLIST((display, data, image_return, shapeimage_return, attributes))
-ARG(Display *,display)
-ARG(char **, data)
-ARG(XImage **, image_return)
-ARG(XImage **, shapeimage_return)
-GRA(BxXpmAttributes *, attributes)
-{
-    bxxpmData mdata;
-    int ErrorStatus;
-    bxxpmInternAttrib attrib;
-
-    /*
-     * initialize return values
-     */
-    if (image_return)
-        *image_return = NULL;
-    if (shapeimage_return)
-        *shapeimage_return = NULL;
-
-    if ((ErrorStatus = xpmOpenArray(data, &mdata)) != BxXpmSuccess)
-        return (ErrorStatus);
-
-    xpmInitInternAttrib(&attrib);
-
-    ErrorStatus = xpmParseData(&mdata, &attrib, attributes);
-
-    if (ErrorStatus == BxXpmSuccess)
-        ErrorStatus = xpmCreateImage(display, &attrib, image_return,
-                                     shapeimage_return, attributes);
-
-    if (ErrorStatus >= 0)
-        xpmSetAttributes(&attrib, attributes);
-    else if (attributes)
-        BxXpmFreeAttributes(attributes);
-
-    xpmFreeInternAttrib(&attrib);
-    XpmDataClose(&mdata);
-
-    return (ErrorStatus);
-}
-
-/*
- * open the given array to be read or written as an bxxpmData which is returned
- */
-static int xpmOpenArray
-ARGLIST((data, mdata))
-ARG(char **,data)
-GRA(bxxpmData *,mdata)
-{
-    mdata->type = BXXPMARRAY;
-    mdata->stream.data = data;
-    mdata->cptr = *data;
-    mdata->line = 0;
-    mdata->CommentLength = 0;
-    mdata->Bcmt = mdata->Ecmt = NULL;
-    mdata->Bos = mdata->Eos = '\0';
-    mdata->InsideString = 0;
-    return (BxXpmSuccess);
-}
-
-/*
- * Intialize the bxxpmInternAttrib pointers to Null to know
- * which ones must be freed later on.
- */
-static void xpmInitInternAttrib
-ARGLIST((attrib))
-GRA(bxxpmInternAttrib *,attrib)
-{
-    attrib->ncolors = 0;
-    attrib->colorTable = NULL;
-    attrib->pixelindex = NULL;
-    attrib->xcolors = NULL;
-    attrib->colorStrings = NULL;
-    attrib->mask_pixel = BX_UNDEF_PIXEL;
-}
-
-/* function call in case of error, frees only localy allocated variables */
-#undef RETURN
-#define RETURN(status) \
-  { if (colorTable) xpmFreeColorTable(colorTable, ncolors); \
-    if (chars) free(chars); \
-    if (pixelindex) free((char *)pixelindex); \
-    if (hints_cmt)  free((char *)hints_cmt); \
-    if (colors_cmt) free((char *)colors_cmt); \
-    if (pixels_cmt) free((char *)pixels_cmt); \
-    return(status); }
-
-/*
- * This function parses an Xpm file or data and store the found informations
- * in an an bxxpmInternAttrib structure which is returned.
- */
-static int xpmParseData
-ARGLIST((data, attrib_return, attributes))
-ARG(bxxpmData *,data)
-ARG(bxxpmInternAttrib *, attrib_return)
-GRA(BxXpmAttributes *, attributes)
-{
-    /* variables to return */
-    unsigned int width, height;
-    unsigned int ncolors = 0;
-    unsigned int cpp;
-    unsigned int x_hotspot, y_hotspot, hotspot = 0;
-    char ***colorTable = NULL;
-    unsigned int *pixelindex = NULL;
-    char *hints_cmt = NULL;
-    char *colors_cmt = NULL;
-    char *pixels_cmt = NULL;
-
-    /* calculation variables */
-    unsigned int rncolors = 0;		/* read number of colors, it is
-					 * different to ncolors to avoid
-					 * problem when freeing the
-					 * colorTable in case an error
-					 * occurs while reading the hints
-					 * line */
-    unsigned int key;			/* color key */
-    char *chars = NULL, buf[BUFSIZ];
-    unsigned int *iptr;
-    unsigned int a, b, x, y, l;
-
-    unsigned int curkey;		/* current color key */
-    unsigned int lastwaskey;		/* key read */
-    char curbuf[BUFSIZ];		/* current buffer */
-
-    /*
-     * read hints: width, height, ncolors, chars_per_pixel
-     */
-    if (!(xpmNextUI(data, &width) && xpmNextUI(data, &height)
-	  && xpmNextUI(data, &rncolors) && xpmNextUI(data, &cpp)))
-	RETURN(BxXpmFileInvalid);
-
-    ncolors = rncolors;
-
-    /*
-     * read hotspot coordinates if any
-     */
-    hotspot = xpmNextUI(data, &x_hotspot) && xpmNextUI(data, &y_hotspot);
-
-    /*
-     * store the hints comment line
-     */
-    if (attributes && (attributes->valuemask & BxXpmReturnInfos))
-	xpmGetCmt(data, &hints_cmt);
-
-    /*
-     * read colors
-     */
-    colorTable = (char ***) calloc(ncolors, sizeof(char **));
-    if (!colorTable)
-	RETURN(BxXpmNoMemory);
-
-    for (a = 0; a < ncolors; a++) {
-	xpmNextString(data);		/* skip the line */
-	colorTable[a] = (char **) calloc((BXNKEYS + 1), sizeof(char *));
-	if (!colorTable[a])
-	    RETURN(BxXpmNoMemory);
-
-	/*
-	 * read pixel value
-	 */
-	colorTable[a][0] = (char *) malloc(cpp);
-	if (!colorTable[a][0])
-	    RETURN(BxXpmNoMemory);
-	for (b = 0; b < cpp; b++)
-	    colorTable[a][0][b] = xpmGetC(data);
-
-	/*
-	 * read color keys and values
-	 */
-	curkey = 0;
-	lastwaskey = 0;
-	while (l = xpmNextWord(data, buf)) {
-	    if (!lastwaskey) {
-		for (key = 1; key < BXNKEYS + 1; key++)
-		    if ((strlen(BxXpmColorKeys[key - 1]) == l)
-			&& (!strncmp(BxXpmColorKeys[key - 1], buf, l)))
-			break;
-	    }
-	    if (!lastwaskey && key <= BXNKEYS) {	/* open new key */
-		if (curkey) {		/* flush string */
-		    colorTable[a][curkey] =
-			(char *) malloc(strlen(curbuf) + 1);
-		    if (!colorTable[a][curkey])
-			RETURN(BxXpmNoMemory);
-		    strcpy(colorTable[a][curkey], curbuf);
-		}
-		curkey = key;		/* set new key  */
-		curbuf[0] = '\0';	/* reset curbuf */
-		lastwaskey = 1;
-	    } else {
-		if (!curkey)
-		    RETURN(BxXpmFileInvalid);	/* key without value */
-		if (!lastwaskey)
-		    strcat(curbuf, " ");/* append space */
-		buf[l] = '\0';
-		strcat(curbuf, buf);	/* append buf */
-		lastwaskey = 0;
-	    }
-	}
-	if (!curkey)
-	    RETURN(BxXpmFileInvalid);	/* key without value */
-	colorTable[a][curkey] = (char *) malloc(strlen(curbuf) + 1);
-	if (!colorTable[a][curkey])
-	    RETURN(BxXpmNoMemory);
-	strcpy(colorTable[a][curkey], curbuf);
-    }
-
-    /*
-     * store the colors comment line
-     */
-    if (attributes && (attributes->valuemask & BxXpmReturnInfos))
-	xpmGetCmt(data, &colors_cmt);
-
-    /*
-     * read pixels and index them on color number
-     */
-    pixelindex =
-	(unsigned int *) malloc(sizeof(unsigned int) * width * height);
-    if (!pixelindex)
-	RETURN(BxXpmNoMemory);
-
-    iptr = pixelindex;
-
-    chars = (char *) malloc(cpp);
-    if (!chars)
-	RETURN(BxXpmNoMemory);
-
-    for (y = 0; y < height; y++) {
-	xpmNextString(data);
-	for (x = 0; x < width; x++, iptr++) {
-	    for (a = 0; a < cpp; a++)
-		chars[a] = xpmGetC(data);
-	    for (a = 0; a < ncolors; a++)
-		if (!strncmp(colorTable[a][0], chars, cpp))
-		    break;
-	    if (a == ncolors)
-		RETURN(BxXpmFileInvalid);	/* no color matches */
-	    *iptr = a;
-	}
-    }
-
-    /*
-     * store the pixels comment line
-     */
-    if (attributes && (attributes->valuemask & BxXpmReturnInfos))
-	xpmGetCmt(data, &pixels_cmt);
-
-    free(chars);
-
-    /*
-     * store found informations in the bxxpmInternAttrib structure
-     */
-    attrib_return->width = width;
-    attrib_return->height = height;
-    attrib_return->cpp = cpp;
-    attrib_return->ncolors = ncolors;
-    attrib_return->colorTable = colorTable;
-    attrib_return->pixelindex = pixelindex;
-
-    if (attributes) {
-	if (attributes->valuemask & BxXpmReturnInfos) {
-	    attributes->hints_cmt = hints_cmt;
-	    attributes->colors_cmt = colors_cmt;
-	    attributes->pixels_cmt = pixels_cmt;
-	}
-	if (hotspot) {
-	    attributes->x_hotspot = x_hotspot;
-	    attributes->y_hotspot = y_hotspot;
-	    attributes->valuemask |= BxXpmHotspot;
-	}
-    }
-    return (BxXpmSuccess);
-}
-
-/*
- * set the color pixel related to the given colorname,
- * return 0 if success, 1 otherwise.
- */
-
-static int SetColor
-ARGLIST((display, colormap,colorname, color_index, image_pixel, mask_pixel, mask_pixel_index))
-ARG(Display *, display)
-ARG(Colormap, colormap)
-ARG(char *, colorname)
-ARG(unsigned int, color_index)
-ARG(Pixel *, image_pixel)
-ARG(Pixel *, mask_pixel)
-GRA(unsigned int *, mask_pixel_index)
-{
-    XColor xcolor;
-
-    if (STRCASECMP(colorname, (char *)BX_TRANSPARENT_COLOR)) {
-	if (!XParseColor(display, colormap, colorname, &xcolor)
-	    || (!XAllocColor(display, colormap, &xcolor)))
-	    return (1);
-	*image_pixel = xcolor.pixel;
-	*mask_pixel = 1;
-    } else {
-	*image_pixel = 0;
-	*mask_pixel = 0;
-	*mask_pixel_index = color_index;/* store the color table index */
-    }
-    return (0);
-}
-
-/* function call in case of error, frees only localy allocated variables */
-#undef RETURN
-#define RETURN(status) \
-  { if (image) XDestroyImage(image); \
-    if (shapeimage) XDestroyImage(shapeimage); \
-    if (image_pixels) free((char *)image_pixels); \
-    if (mask_pixels) free((char *)mask_pixels); \
-    return(status); }
-
-static int xpmCreateImage
-ARGLIST((display, attrib, image_return, shapeimage_return, attributes))
-ARG(Display *, display)
-ARG(bxxpmInternAttrib *, attrib)
-ARG(XImage **, image_return)
-ARG(XImage **, shapeimage_return)
-GRA(BxXpmAttributes *, attributes)
-{
-    /* variables stored in the BxXpmAttributes structure */
-    Visual *visual;
-    Colormap colormap;
-    unsigned int depth;
-    BxXpmColorSymbol *colorsymbols;
-    unsigned int numsymbols;
-
-    /* variables to return */
-    XImage *image = NULL;
-    XImage *shapeimage = NULL;
-    unsigned int mask_pixel;
-    unsigned int ErrorStatus, ErrorStatus2;
-
-    /* calculation variables */
-    Pixel *image_pixels = NULL;
-    Pixel *mask_pixels = NULL;
-    char *colorname;
-    unsigned int a, b, l;
-    Boolean pixel_defined;
-    unsigned int key;
-
-    /*
-     * retrieve information from the BxXpmAttributes
-     */
-    if (attributes && attributes->valuemask & BxXpmColorSymbols) {
-	colorsymbols = attributes->colorsymbols;
-	numsymbols = attributes->numsymbols;
-    } else
-	numsymbols = 0;
-
-    if (attributes && attributes->valuemask & BxXpmVisual)
-	visual = attributes->visual;
-    else
-	visual = DefaultVisual(display, DefaultScreen(display));
-
-    if (attributes && attributes->valuemask & BxXpmColormap)
-	colormap = attributes->colormap;
-    else
-	colormap = DefaultColormap(display, DefaultScreen(display));
-
-    if (attributes && attributes->valuemask & BxXpmDepth)
-	depth = attributes->depth;
-    else
-	depth = DefaultDepth(display, DefaultScreen(display));
-
-
-    ErrorStatus = BxXpmSuccess;
-
-    /*
-     * alloc pixels index tables
-     */
-
-    key = BxXpmVisualType(visual);
-    image_pixels = (Pixel *) malloc(sizeof(Pixel) * attrib->ncolors);
-    if (!image_pixels)
-	RETURN(BxXpmNoMemory);
-
-    mask_pixels = (Pixel *) malloc(sizeof(Pixel) * attrib->ncolors);
-    if (!mask_pixels)
-	RETURN(BxXpmNoMemory);
-
-    mask_pixel = BX_UNDEF_PIXEL;
-
-    /*
-     * get pixel colors, store them in index tables
-     */
-    for (a = 0; a < attrib->ncolors; a++) {
-	colorname = NULL;
-	pixel_defined = False;
-
-	/*
-	 * look for a defined symbol
-	 */
-	if (numsymbols && attrib->colorTable[a][1]) {
-	    for (l = 0; l < numsymbols; l++)
-		if (!strcmp(colorsymbols[l].name, attrib->colorTable[a][1]))
-		    break;
-	    if (l != numsymbols) {
-		if (colorsymbols[l].value)
-		    colorname = colorsymbols[l].value;
-		else
-		    pixel_defined = True;
-	    }
-	}
-	if (!pixel_defined) {		/* pixel not given as symbol value */
-
-	    if (colorname) {		/* colorname given as symbol value */
-		if (!SetColor(display, colormap, colorname, a,
-			   &image_pixels[a], &mask_pixels[a], &mask_pixel))
-		    pixel_defined = True;
-		else
-		    ErrorStatus = BxXpmColorError;
-	    }
-	    b = key;
-	    while (!pixel_defined && b > 1) {
-		if (attrib->colorTable[a][b]) {
-		    if (!SetColor(display, colormap, attrib->colorTable[a][b],
-				  a, &image_pixels[a], &mask_pixels[a],
-				  &mask_pixel)) {
-			pixel_defined = True;
-			break;
-		    } else
-			ErrorStatus = BxXpmColorError;
-		}
-		b--;
-	    }
-
-	    b = key + 1;
-	    while (!pixel_defined && b < BXNKEYS + 1) {
-		if (attrib->colorTable[a][b]) {
-		    if (!SetColor(display, colormap, attrib->colorTable[a][b],
-				  a, &image_pixels[a], &mask_pixels[a],
-				  &mask_pixel)) {
-			pixel_defined = True;
-			break;
-		    } else
-			ErrorStatus = BxXpmColorError;
-		}
-		b++;
-	    }
-
-	    if (!pixel_defined)
-		RETURN(BxXpmColorFailed);
-
-	} else {
-	    image_pixels[a] = colorsymbols[l].pixel;
-	    mask_pixels[a] = 1;
-	}
-    }
-
-    /*
-     * create the image
-     */
-    if (image_return) {
-	ErrorStatus2 = CreateXImage(display, visual, depth,
-				    attrib->width, attrib->height, &image);
-	if (ErrorStatus2 != BxXpmSuccess)
-	    RETURN(ErrorStatus2);
-
-	/*
-	 * set the image data
-	 *
-	 * In case depth is 1 or bits_per_pixel is 4, 6, 8, 24 or 32 use
-	 * optimized functions, otherwise use slower but sure general one.
-	 *
-	 */
-
-	if (image->depth == 1)
-	    SetImagePixels1(image, attrib->width, attrib->height,
-			    attrib->pixelindex, image_pixels);
-	else if (image->bits_per_pixel == 8)
-	    SetImagePixels8(image, attrib->width, attrib->height,
-			    attrib->pixelindex, image_pixels);
-	else if (image->bits_per_pixel == 16)
-	    SetImagePixels16(image, attrib->width, attrib->height,
-			     attrib->pixelindex, image_pixels);
-	else if (image->bits_per_pixel == 32)
-	    SetImagePixels32(image, attrib->width, attrib->height,
-			     attrib->pixelindex, image_pixels);
-	else
-	    SetImagePixels(image, attrib->width, attrib->height,
-			   attrib->pixelindex, image_pixels);
-    }
-
-    /*
-     * create the shape mask image
-     */
-    if (mask_pixel != BX_UNDEF_PIXEL && shapeimage_return) {
-	ErrorStatus2 = CreateXImage(display, visual, 1, attrib->width,
-				    attrib->height, &shapeimage);
-	if (ErrorStatus2 != BxXpmSuccess)
-	    RETURN(ErrorStatus2);
-
-	SetImagePixels1(shapeimage, attrib->width, attrib->height,
-			attrib->pixelindex, mask_pixels);
-    }
-    free((char *)mask_pixels);
-
-    /*
-     * if requested store allocated pixels in the BxXpmAttributes structure
-     */
-    if (attributes &&
-	(attributes->valuemask & BxXpmReturnInfos
-	 || attributes->valuemask & BxXpmReturnPixels)) {
-	if (mask_pixel != BX_UNDEF_PIXEL) {
-	    Pixel *pixels, *p1, *p2;
-
-	    attributes->npixels = attrib->ncolors - 1;
-	    pixels = (Pixel *) malloc(sizeof(Pixel) * attributes->npixels);
-	    if (pixels) {
-		p1 = image_pixels;
-		p2 = pixels;
-		for (a = 0; a < attrib->ncolors; a++, p1++)
-		    if (a != mask_pixel)
-			*p2++ = *p1;
-		attributes->pixels = pixels;
-	    } else {
-		/* if error just say we can't return requested data */
-		attributes->valuemask &= ~BxXpmReturnPixels;
-		attributes->valuemask &= ~BxXpmReturnInfos;
-		attributes->pixels = NULL;
-		attributes->npixels = 0;
-	    }
-	    free((char *)image_pixels);
-	} else {
-	    attributes->pixels = image_pixels;
-	    attributes->npixels = attrib->ncolors;
-	}
-	attributes->mask_pixel = mask_pixel;
-    } else
-	free((char *)image_pixels);
-
-
-    /*
-     * return created images
-     */
-    if (image_return)
-	*image_return = image;
-
-    if (shapeimage_return)
-	*shapeimage_return = shapeimage;
-
-    return (ErrorStatus);
-}
-
-
-/*
- * Create an XImage
- */
-static int CreateXImage
-ARGLIST((display, visual, depth, width, height, image_return))
-ARG(Display *, display)
-ARG(Visual *, visual)
-ARG(unsigned int, depth)
-ARG(unsigned int, width)
-ARG(unsigned int, height)
-GRA(XImage **, image_return)
-{
-    int bitmap_pad;
-
-    /* first get bitmap_pad */
-    if (depth > 16)
-	bitmap_pad = 32;
-    else if (depth > 8)
-	bitmap_pad = 16;
-    else
-	bitmap_pad = 8;
-
-    /* then create the XImage with data = NULL and bytes_per_line = 0 */
-
-    *image_return = XCreateImage(display, visual, depth, ZPixmap, 0, 0,
-				 width, height, bitmap_pad, 0);
-    if (!*image_return)
-	return (BxXpmNoMemory);
-
-    /* now that bytes_per_line must have been set properly alloc data */
-
-    (*image_return)->data =
-	(char *) malloc((*image_return)->bytes_per_line * height);
-
-    if (!(*image_return)->data) {
-	XDestroyImage(*image_return);
-	*image_return = NULL;
-	return (BxXpmNoMemory);
-    }
-    return (BxXpmSuccess);
-}
-
-
-/*
- * The functions below are written from X11R5 MIT's code (XImUtil.c)
- *
- * The idea is to have faster functions than the standard XPutPixel function
- * to build the image data. Indeed we can speed up things by supressing tests
- * performed for each pixel. We do exactly the same tests but at the image
- * level. Assuming that we use only ZPixmap images.
- */
-
-LFUNC(_putbits, void, (register char *src, int dstoffset,
-		      register int numbits, register char *dst));
-
-LFUNC(_XReverse_Bytes, void, (register unsigned char *bpt, register int nb));
-
-static unsigned char Const _reverse_byte[0x100] = {
-			    0x00, 0x80, 0x40, 0xc0, 0x20, 0xa0, 0x60, 0xe0,
-			    0x10, 0x90, 0x50, 0xd0, 0x30, 0xb0, 0x70, 0xf0,
-			    0x08, 0x88, 0x48, 0xc8, 0x28, 0xa8, 0x68, 0xe8,
-			    0x18, 0x98, 0x58, 0xd8, 0x38, 0xb8, 0x78, 0xf8,
-			    0x04, 0x84, 0x44, 0xc4, 0x24, 0xa4, 0x64, 0xe4,
-			    0x14, 0x94, 0x54, 0xd4, 0x34, 0xb4, 0x74, 0xf4,
-			    0x0c, 0x8c, 0x4c, 0xcc, 0x2c, 0xac, 0x6c, 0xec,
-			    0x1c, 0x9c, 0x5c, 0xdc, 0x3c, 0xbc, 0x7c, 0xfc,
-			    0x02, 0x82, 0x42, 0xc2, 0x22, 0xa2, 0x62, 0xe2,
-			    0x12, 0x92, 0x52, 0xd2, 0x32, 0xb2, 0x72, 0xf2,
-			    0x0a, 0x8a, 0x4a, 0xca, 0x2a, 0xaa, 0x6a, 0xea,
-			    0x1a, 0x9a, 0x5a, 0xda, 0x3a, 0xba, 0x7a, 0xfa,
-			    0x06, 0x86, 0x46, 0xc6, 0x26, 0xa6, 0x66, 0xe6,
-			    0x16, 0x96, 0x56, 0xd6, 0x36, 0xb6, 0x76, 0xf6,
-			    0x0e, 0x8e, 0x4e, 0xce, 0x2e, 0xae, 0x6e, 0xee,
-			    0x1e, 0x9e, 0x5e, 0xde, 0x3e, 0xbe, 0x7e, 0xfe,
-			    0x01, 0x81, 0x41, 0xc1, 0x21, 0xa1, 0x61, 0xe1,
-			    0x11, 0x91, 0x51, 0xd1, 0x31, 0xb1, 0x71, 0xf1,
-			    0x09, 0x89, 0x49, 0xc9, 0x29, 0xa9, 0x69, 0xe9,
-			    0x19, 0x99, 0x59, 0xd9, 0x39, 0xb9, 0x79, 0xf9,
-			    0x05, 0x85, 0x45, 0xc5, 0x25, 0xa5, 0x65, 0xe5,
-			    0x15, 0x95, 0x55, 0xd5, 0x35, 0xb5, 0x75, 0xf5,
-			    0x0d, 0x8d, 0x4d, 0xcd, 0x2d, 0xad, 0x6d, 0xed,
-			    0x1d, 0x9d, 0x5d, 0xdd, 0x3d, 0xbd, 0x7d, 0xfd,
-			    0x03, 0x83, 0x43, 0xc3, 0x23, 0xa3, 0x63, 0xe3,
-			    0x13, 0x93, 0x53, 0xd3, 0x33, 0xb3, 0x73, 0xf3,
-			    0x0b, 0x8b, 0x4b, 0xcb, 0x2b, 0xab, 0x6b, 0xeb,
-			    0x1b, 0x9b, 0x5b, 0xdb, 0x3b, 0xbb, 0x7b, 0xfb,
-			    0x07, 0x87, 0x47, 0xc7, 0x27, 0xa7, 0x67, 0xe7,
-			    0x17, 0x97, 0x57, 0xd7, 0x37, 0xb7, 0x77, 0xf7,
-			    0x0f, 0x8f, 0x4f, 0xcf, 0x2f, 0xaf, 0x6f, 0xef,
-			     0x1f, 0x9f, 0x5f, 0xdf, 0x3f, 0xbf, 0x7f, 0xff
-};
-
-static void _XReverse_Bytes
-ARGLIST((bpt, nb))
-ARG(register unsigned char *, bpt)
-GRA(register int, nb)
-{
-    do {
-	*bpt = _reverse_byte[*bpt];
-	bpt++;
-    } while (--nb > 0);
-}
-
-static void xpm_xynormalizeimagebits
-ARGLIST((bp,img))
-ARG(register unsigned char *, bp)
-GRA(register XImage *, img)
-{
-    register unsigned char c;
-
-    if (img->byte_order != img->bitmap_bit_order) {
-	switch (img->bitmap_unit) {
-
-	case 16:
-	    c = *bp;
-	    *bp = *(bp + 1);
-	    *(bp + 1) = c;
-	    break;
-
-	case 32:
-	    c = *(bp + 3);
-	    *(bp + 3) = *bp;
-	    *bp = c;
-	    c = *(bp + 2);
-	    *(bp + 2) = *(bp + 1);
-	    *(bp + 1) = c;
-	    break;
-	}
-    }
-    if (img->bitmap_bit_order == MSBFirst)
-	_XReverse_Bytes(bp, img->bitmap_unit >> 3);
-}
-
-static void xpm_znormalizeimagebits
-ARGLIST((bp,img))
-ARG(register unsigned char *, bp)
-GRA(register XImage *, img)
-{
-    register unsigned char c;
-
-    switch (img->bits_per_pixel) {
-
-    case 4:
-	*bp = ((*bp >> 4) & 0xF) | ((*bp << 4) & ~0xF);
-	break;
-
-    case 16:
-	c = *bp;
-	*bp = *(bp + 1);
-	*(bp + 1) = c;
-	break;
-
-    case 24:
-	c = *(bp + 2);
-	*(bp + 2) = *bp;
-	*bp = c;
-	break;
-
-    case 32:
-	c = *(bp + 3);
-	*(bp + 3) = *bp;
-	*bp = c;
-	c = *(bp + 2);
-	*(bp + 2) = *(bp + 1);
-	*(bp + 1) = c;
-	break;
-    }
-}
-
-static unsigned char Const _lomask[0x09] = {
-		     0x00, 0x01, 0x03, 0x07, 0x0f, 0x1f, 0x3f, 0x7f, 0xff};
-static unsigned char Const _himask[0x09] = {
-		     0xff, 0xfe, 0xfc, 0xf8, 0xf0, 0xe0, 0xc0, 0x80, 0x00};
-
-static void _putbits
-ARGLIST((src, dstoffset, numbits, dst))
-ARG(register char *, src)		/* address of source bit string */
-ARG(int, dstoffset)			/* bit offset into destination;
-					 * range is 0-31 */
-ARG(register int, numbits)		/* number of bits to copy to
-					 * destination */
-GRA(register char *, dst)		/* address of destination bit string */
-{
-    register unsigned char chlo, chhi;
-    int hibits;
-
-    dst = dst + (dstoffset >> 3);
-    dstoffset = dstoffset & 7;
-    hibits = 8 - dstoffset;
-    chlo = *dst & _lomask[dstoffset];
-    for (;;) {
-	chhi = (*src << dstoffset) & _himask[dstoffset];
-	if (numbits <= hibits) {
-	    chhi = chhi & _lomask[dstoffset + numbits];
-	    *dst = (*dst & _himask[dstoffset + numbits]) | chlo | chhi;
-	    break;
-	}
-	*dst = chhi | chlo;
-	dst++;
-	numbits = numbits - hibits;
-	chlo = (unsigned char) (*src & _himask[hibits]) >> hibits;
-	src++;
-	if (numbits <= dstoffset) {
-	    chlo = chlo & _lomask[numbits];
-	    *dst = (*dst & _himask[numbits]) | chlo;
-	    break;
-	}
-	numbits = numbits - dstoffset;
-    }
-}
-
-/*
- * Default method to write pixels into a Z image data structure.
- * The algorithm used is:
- *
- *	copy the destination bitmap_unit or Zpixel to temp
- *	normalize temp if needed
- *	copy the pixel bits into the temp
- *	renormalize temp if needed
- *	copy the temp back into the destination image data
- */
-
-static void SetImagePixels
-ARGLIST((image, width, height, pixelindex, pixels))
-ARG(XImage *, image)
-ARG(unsigned int, width)
-ARG(unsigned int, height)
-ARG(unsigned int *, pixelindex)
-GRA(Pixel *, pixels)
-{
-    Pixel pixel;
-    unsigned long px;
-    register char *src;
-    register char *dst;
-    int nbytes;
-    register unsigned int *iptr;
-    register int x, y, i;
-
-    iptr = pixelindex;
-    if (image->depth == 1) {
-	for (y = 0; y < height; y++)
-	    for (x = 0; x < width; x++, iptr++) {
-		pixel = pixels[*iptr];
-		for (i = 0, px = pixel;
-		     i < sizeof(unsigned long); i++, px >>= 8)
-		    ((unsigned char *) &pixel)[i] = (unsigned char)px;
-		src = &image->data[BXXYINDEX(x, y, image)];
-		dst = (char *) &px;
-		px = 0;
-		nbytes = image->bitmap_unit >> 3;
-		for (i = nbytes; --i >= 0;)
-		    *dst++ = *src++;
-		BXXYNORMALIZE(&px, image);
-		i = ((x + image->xoffset) % image->bitmap_unit);
-		_putbits((char *) &pixel, i, 1, (char *) &px);
-		BXXYNORMALIZE(&px, image);
-		src = (char *) &px;
-		dst = &image->data[BXXYINDEX(x, y, image)];
-		for (i = nbytes; --i >= 0;)
-		    *dst++ = *src++;
-	    }
-    } else {
-	for (y = 0; y < height; y++)
-	    for (x = 0; x < width; x++, iptr++) {
-		pixel = pixels[*iptr];
-		if (image->depth == 4)
-		    pixel &= 0xf;
-		for (i = 0, px = pixel;
-		     i < sizeof(unsigned long); i++, px >>= 8)
-		    ((unsigned char *) &pixel)[i] = (unsigned char)px;
-		src = &image->data[BXZINDEX(x, y, image)];
-		dst = (char *) &px;
-		px = 0;
-		nbytes = (image->bits_per_pixel + 7) >> 3;
-		for (i = nbytes; --i >= 0;)
-		    *dst++ = *src++;
-		BXZNORMALIZE(&px, image);
-		_putbits((char *) &pixel,
-			 (x * image->bits_per_pixel) & 7,
-			 image->bits_per_pixel, (char *) &px);
-		BXZNORMALIZE(&px, image);
-		src = (char *) &px;
-		dst = &image->data[BXZINDEX(x, y, image)];
-		for (i = nbytes; --i >= 0;)
-		    *dst++ = *src++;
-	    }
-    }
-}
-
-/*
- * write pixels into a 32-bits Z image data structure
- */
-
-#ifndef WORD64
-static unsigned long byteorderpixel = MSBFirst << 24;
-
-#endif
-
-static void SetImagePixels32
-ARGLIST((image, width, height, pixelindex, pixels))
-ARG(XImage *, image)
-ARG(unsigned int, width)
-ARG(unsigned int, height)
-ARG(unsigned int *, pixelindex)
-GRA(Pixel *, pixels)
-{
-    register unsigned char *addr;
-    register unsigned int *paddr;
-    register unsigned int *iptr;
-    register int x, y;
-
-    iptr = pixelindex;
-#ifndef WORD64
-    if (*((char *) &byteorderpixel) == image->byte_order) {
-	for (y = 0; y < height; y++)
-	    for (x = 0; x < width; x++, iptr++) {
-		paddr =
-		    (unsigned int *)(&(image->data[BXZINDEX32(x, y, image)]));
-		*paddr = (unsigned int)pixels[*iptr];
-	    }
-    } else
-#endif
-    if (image->byte_order == MSBFirst)
-	for (y = 0; y < height; y++)
-	    for (x = 0; x < width; x++, iptr++) {
-		addr = &((unsigned char *) image->data)[BXZINDEX32(x, y, image)];
-		addr[0] = (unsigned char)(pixels[*iptr] >> 24);
-		addr[1] = (unsigned char)(pixels[*iptr] >> 16);
-		addr[2] = (unsigned char)(pixels[*iptr] >> 8);
-		addr[3] = (unsigned char)(pixels[*iptr]);
-	    }
-    else
-	for (y = 0; y < height; y++)
-	    for (x = 0; x < width; x++, iptr++) {
-		addr = &((unsigned char *) image->data)[BXZINDEX32(x, y, image)];
-		addr[3] = (unsigned char)(pixels[*iptr] >> 24);
-		addr[2] = (unsigned char)(pixels[*iptr] >> 16);
-		addr[1] = (unsigned char)(pixels[*iptr] >> 8);
-		addr[0] = (unsigned char)(pixels[*iptr]);
-	    }
-}
-
-/*
- * write pixels into a 16-bits Z image data structure
- */
-
-static void SetImagePixels16
-ARGLIST((image, width, height, pixelindex, pixels))
-ARG(XImage *, image)
-ARG(unsigned int, width)
-ARG(unsigned int, height)
-ARG(unsigned int *, pixelindex)
-GRA(Pixel *, pixels)
-{
-    register unsigned char *addr;
-    register unsigned int *iptr;
-    register int x, y;
-
-    iptr = pixelindex;
-    if (image->byte_order == MSBFirst)
-	for (y = 0; y < height; y++)
-	    for (x = 0; x < width; x++, iptr++) {
-		addr = &((unsigned char *) image->data)[BXZINDEX16(x, y, image)];
-		addr[0] = (unsigned char)(pixels[*iptr] >> 8);
-		addr[1] = (unsigned char)(pixels[*iptr]);
-	    }
-    else
-	for (y = 0; y < height; y++)
-	    for (x = 0; x < width; x++, iptr++) {
-		addr = &((unsigned char *) image->data)[BXZINDEX16(x, y, image)];
-		addr[1] = (unsigned char)(pixels[*iptr] >> 8);
-		addr[0] = (unsigned char)(pixels[*iptr]);
-	    }
-}
-
-/*
- * write pixels into a 8-bits Z image data structure
- */
-
-static void SetImagePixels8
-ARGLIST((image, width, height, pixelindex, pixels))
-ARG(XImage *, image)
-ARG(unsigned int, width)
-ARG(unsigned int, height)
-ARG(unsigned int *, pixelindex)
-GRA(Pixel *, pixels)
-
-{
-    register unsigned int *iptr;
-    register int x, y;
-
-    iptr = pixelindex;
-    for (y = 0; y < height; y++)
-	for (x = 0; x < width; x++, iptr++)
-	    image->data[BXZINDEX8(x, y, image)] = (char)pixels[*iptr];
-}
-
-/*
- * write pixels into a 1-bit depth image data structure and **offset null**
- */
-
-static void SetImagePixels1
-ARGLIST((image, width, height, pixelindex, pixels))
-ARG(XImage *, image)
-ARG(unsigned int, width)
-ARG(unsigned int, height)
-ARG(unsigned int *, pixelindex)
-GRA(Pixel *, pixels)
-{
-    unsigned char bit;
-    int xoff, yoff;
-    register unsigned int *iptr;
-    register int x, y;
-
-    if (image->byte_order != image->bitmap_bit_order)
-	SetImagePixels(image, width, height, pixelindex, pixels);
-    else {
-	iptr = pixelindex;
-	if (image->bitmap_bit_order == MSBFirst)
-	    for (y = 0; y < height; y++)
-		for (x = 0; x < width; x++, iptr++) {
-		    yoff = BXZINDEX1(x, y, image);
-		    xoff = x & 7;
-		    bit = 0x80 >> xoff;
-		    if (pixels[*iptr] & 1)
-			image->data[yoff] |= bit;
-		    else
-			image->data[yoff] &= ~bit;
-		}
-	else
-	    for (y = 0; y < height; y++)
-		for (x = 0; x < width; x++, iptr++) {
-		    yoff = BXZINDEX1(x, y, image);
-		    xoff = x & 7;
-		    bit = 1 << xoff;
-		    if (pixels[*iptr] & 1)
-			image->data[yoff] |= bit;
-		    else
-			image->data[yoff] &= ~bit;
-		}
-    }
-}
-
-/*
- * Store into the BxXpmAttributes structure the required informations stored in
- * the bxxpmInternAttrib structure.
- */
-
-static void xpmSetAttributes
-ARGLIST((attrib, attributes))
-ARG(bxxpmInternAttrib *, attrib)
-GRA(BxXpmAttributes *, attributes)
-{
-    if (attributes) {
-        if (attributes->valuemask & BxXpmReturnInfos) {
-            attributes->cpp = attrib->cpp;
-            attributes->ncolors = attrib->ncolors;
-            attributes->colorTable = attrib->colorTable;
-
-            attrib->ncolors = 0;
-            attrib->colorTable = NULL;
-        }
-        attributes->width = attrib->width;
-        attributes->height = attrib->height;
-        attributes->valuemask |= BxXpmSize;
-    }
-}
-
-/*
- * Free the BxXpmAttributes structure members
- * but the structure itself
- */
-
-static void BxXpmFreeAttributes
-ARGLIST((attributes))
-GRA(BxXpmAttributes *, attributes)
-{
-    if (attributes) {
-        if (attributes->valuemask & BxXpmReturnPixels && attributes->pixels) {
-            free((char *)attributes->pixels);
-            attributes->pixels = NULL;
-            attributes->npixels = 0;
-        }
-        if (attributes->valuemask & BxXpmInfos) {
-            if (attributes->colorTable) {
-                xpmFreeColorTable(attributes->colorTable, attributes->ncolors);
-                attributes->colorTable = NULL;
-                attributes->ncolors = 0;
-            }
-            if (attributes->hints_cmt) {
-                free(attributes->hints_cmt);
-                attributes->hints_cmt = NULL;
-            }
-            if (attributes->colors_cmt) {
-                free(attributes->colors_cmt);
-                attributes->colors_cmt = NULL;
-            }
-            if (attributes->pixels_cmt) {
-                free(attributes->pixels_cmt);
-                attributes->pixels_cmt = NULL;
-            }
-            if (attributes->pixels) {
-                free((char *)attributes->pixels);
-                attributes->pixels = NULL;
-            }
-        }
-        attributes->valuemask = 0;
-    }
-}
-
-/*
- * Free the bxxpmInternAttrib pointers which have been allocated
- */
-
-static void xpmFreeInternAttrib
-ARGLIST((attrib))
-GRA(bxxpmInternAttrib *, attrib)
-{
-    unsigned int a;
-
-    if (attrib->colorTable)
-        xpmFreeColorTable(attrib->colorTable, attrib->ncolors);
-    if (attrib->pixelindex)
-        free((char *)attrib->pixelindex);
-    if (attrib->xcolors)
-        free((char *)attrib->xcolors);
-    if (attrib->colorStrings) {
-        for (a = 0; a < attrib->ncolors; a++)
-            if (attrib->colorStrings[a])
-                free((char *)attrib->colorStrings[a]);
-        free((char *)attrib->colorStrings);
-    }
-}
-
-/*
- * close the file related to the bxxpmData if any
- */
-static void XpmDataClose
-ARGLIST((mdata))
-GRA(bxxpmData *, mdata)
-{
-    switch (mdata->type) {
-    case BXXPMARRAY:
-        break;
-    case BXXPMFILE:
-        if (mdata->stream.file != (stdout) && mdata->stream.file != (stdin))
-            fclose(mdata->stream.file);
-        break;
-#ifdef ZPIPE
-    case BXXPMPIPE:
-        pclose(mdata->stream.file);
-#endif
-    }
-}
-
-/*
- * skip whitespace and compute the following unsigned int,
- * returns 1 if one is found and 0 if not
- */
-static int xpmNextUI
-ARGLIST((mdata, ui_return))
-ARG(bxxpmData *, mdata)
-GRA(unsigned int *, ui_return)
-{
-    char buf[BUFSIZ];
-    int l;
-
-    l = xpmNextWord(mdata, buf);
-    return atoui(buf, l, ui_return);
-}
-
-/*
- * get the current comment line
- */
-static void xpmGetCmt
-ARGLIST((mdata, cmt))
-ARG(bxxpmData *, mdata)
-GRA(char **, cmt)
-{
-    switch (mdata->type) {
-    case BXXPMARRAY:
-        *cmt = NULL;
-        break;
-    case BXXPMFILE:
-    case BXXPMPIPE:
-        if (mdata->CommentLength) {
-            *cmt = (char *) malloc(mdata->CommentLength + 1);
-            strncpy(*cmt, mdata->Comment, mdata->CommentLength);
-            (*cmt)[mdata->CommentLength] = '\0';
-            mdata->CommentLength = 0;
-        } else
-            *cmt = NULL;
-        break;
-    }
-}
-
-/*
- * skip to the end of the current string and the beginning of the next one
- */
-static void xpmNextString
-ARGLIST((mdata))
-GRA(bxxpmData *, mdata)
-{
-    int c;
-
-    switch (mdata->type) {
-    case BXXPMARRAY:
-        mdata->cptr = (mdata->stream.data)[++mdata->line];
-        break;
-    case BXXPMFILE:
-    case BXXPMPIPE:
-        if (mdata->Eos)
-            while ((c = xpmGetC(mdata)) != mdata->Eos && c != EOF);
-        if (mdata->Bos)                 /* if not natural XPM2 */
-            while ((c = xpmGetC(mdata)) != mdata->Bos && c != EOF);
-        break;
-    }
-}
-
-/*
- * return the current character, skipping comments
- */
-static int xpmGetC
-ARGLIST((mdata))
-GRA(bxxpmData *, mdata)
-{
-    int c;
-    register unsigned int n = 0, a;
-    unsigned int notend;
-
-    switch (mdata->type) {
-    case BXXPMARRAY:
-        return (*mdata->cptr++);
-    case BXXPMFILE:
-    case BXXPMPIPE:
-        c = getc(mdata->stream.file);
-
-        if (mdata->Bos && mdata->Eos
-            && (c == mdata->Bos || c == mdata->Eos)) {
-            /* if not natural XPM2 */
-            mdata->InsideString = !mdata->InsideString;
-            return (c);
-        }
-        if (!mdata->InsideString && mdata->Bcmt && c == mdata->Bcmt[0]) {
-            mdata->Comment[0] = c;
-
-            /*
-             * skip the string begining comment
-             */
-            do {
-                c = getc(mdata->stream.file);
-                mdata->Comment[++n] = c;
-            } while (c == mdata->Bcmt[n] && mdata->Bcmt[n] != '\0'
-                     && c != EOF);
-
-            if (mdata->Bcmt[n] != '\0') {
-                /* this wasn't the begining of a comment */
-                /* put characters back in the order that we got them */
-                for (a = n; a > 0; a--)
-                    xpmUngetC(mdata->Comment[a], mdata);
-                return (mdata->Comment[0]);
-            }
-
-            /*
-             * store comment
-             */
-            mdata->Comment[0] = mdata->Comment[n];
-            notend = 1;
-            n = 0;
-            while (notend) {
-                while (mdata->Comment[n] != mdata->Ecmt[0] && c != EOF) {
-                    c = getc(mdata->stream.file);
-                    mdata->Comment[++n] = c;
-                }
-                mdata->CommentLength = n;
-                a = 0;
-                do {
-                    c = getc(mdata->stream.file);
-                    n++;
-                    a++;
-                    mdata->Comment[n] = c;
-                } while (c == mdata->Ecmt[a] && mdata->Ecmt[a] != '\0'
-                         && c != EOF);
-                if (mdata->Ecmt[a] == '\0') {
-                    /* this is the end of the comment */
-                    notend = 0;
-                    xpmUngetC(mdata->Comment[n], mdata);
-                }
-            }
-            c = xpmGetC(mdata);
-        }
-        return (c);
-    }
-    return('\0');
-}
-
-
-/*
- * push the given character back
- */
-static int xpmUngetC
-ARGLIST((c, mdata))
-ARG(int, c)
-GRA(bxxpmData *, mdata)
-{
-    switch (mdata->type) {
-    case BXXPMARRAY:
-        return (*--mdata->cptr = c);
-    case BXXPMFILE:
-    case BXXPMPIPE:
-        if (mdata->Bos && (c == mdata->Bos || c == mdata->Eos))
-            /* if not natural XPM2 */
-            mdata->InsideString = !mdata->InsideString;
-        return (ungetc(c, mdata->stream.file));
-    }
-    return('\0');
-}
-
-/*
- * skip whitespace and return the following word
- */
-static unsigned int xpmNextWord
-ARGLIST((mdata, buf))
-ARG(bxxpmData *, mdata)
-GRA(char *, buf)
-{
-    register unsigned int n = 0;
-    int c;
-
-    switch (mdata->type) {
-    case BXXPMARRAY:
-    	c = *mdata->cptr;
-        while (isspace(c) && c != mdata->Eos)
-            {
-	    mdata->cptr++;
-    	    c = *mdata->cptr;
-	    }
-        do {
-            c = *mdata->cptr++;
-            buf[n++] = c;
-        } while (!isspace(c) && c != mdata->Eos && c != '\0');
-        n--;
-        mdata->cptr--;
-        break;
-    case BXXPMFILE:
-    case BXXPMPIPE:
-        c = xpmGetC(mdata);
-        while (isspace(c) && c != mdata->Eos)
-	    c = xpmGetC(mdata);
-        while (!isspace(c) && c != mdata->Eos && c != EOF) {
-            buf[n++] = c;
-            c = xpmGetC(mdata);
-        }
-        xpmUngetC(c, mdata);
-        break;
-    }
-    return (n);
-}
-
-static int BxXpmVisualType
-ARGLIST((visual))
-GRA(Visual *, visual)
-{
-#if defined(__cplusplus) || defined(c_plusplus)
-    switch ( visual->c_class )
-#else
-    switch ( visual->class )
-#endif
-    {
-    case StaticGray:
-    case GrayScale:
-	switch (visual->map_entries)
-	{
-	case 2:
-	    return (BXMONO);
-	case 4:
-	    return (BXGRAY4);
-	default:
-	    return (BXGRAY);
-	}
-    default:
-	return (BXCOLOR);
-    }
-}
-
-/*
- * Free the computed color table
- */
-
-static void xpmFreeColorTable
-ARGLIST((colorTable, ncolors))
-ARG(char ***, colorTable)
-GRA(int, ncolors)
-{
-    int a, b;
-
-    if (colorTable) {
-        for (a = 0; a < ncolors; a++)
-            if (colorTable[a]) {
-                for (b = 0; b < (BXNKEYS + 1); b++)
-                    if (colorTable[a][b])
-                        free(colorTable[a][b]);
-                free((char *)colorTable[a]);
-            }
-        free((char *)colorTable);
-    }
-}
-
-#else /* USE_XPM_LIBRARY */
-
-#include <xpm.h>
-
-#define BxXpmColorError    		XpmColorError
-#define BxXpmSuccess       		XpmSuccess
-#define BxXpmOpenFailed    		XpmOpenFailed
-#define BxXpmFileInvalid   		XpmFileInvalid
-#define BxXpmNoMemory      		XpmNoMemory
-#define BxXpmColorFailed   		XpmColorFailed
-
-#define BxXpmVisual        		XpmVisual
-#define BxXpmColormap      		XpmColormap
-#define BxXpmDepth         		XpmDepth
-#define BxXpmSize          		XpmSize
-#define BxXpmHotspot       		XpmHotspot
-#define BxXpmCharsPerPixel 		XpmCharsPerPixel
-#define BxXpmColorSymbols  		XpmColorSymbols
-#define BxXpmRgbFilename   		XpmRgbFilename
-#define BxXpmInfos         		XpmInfos
-
-#define BxXpmReturnPixels  		XpmReturnPixels
-#define BxXpmReturnInfos   		XpmReturnInfos
-
-#define BxXpmCreatePixmapFromData	XpmCreatePixmapFromData
-#define BxXpmCreateImageFromData	XpmCreateImageFromData
-#define BxXpmFreeAttributes		XpmFreeAttributes
-
-typedef XpmAttributes      		BxXpmAttributes;
-
-#endif /* USE_XPM_LIBRARY */
-
-Pixmap XPM_PIXMAP
-ARGLIST((w, pixmapName))
-ARG(Widget, w)
-GRA(char **, pixmapName)
-{
-    BxXpmAttributes	attributes;
-    int			argcnt;
-    Arg			args[10];
-    Pixmap		pixmap;
-    Pixmap		shape;
-    int			returnValue;
-
-    attributes.valuemask = 0;
-    attributes.depth = 0;
-    attributes.colormap = 0;
-    attributes.visual = 0;
-
-    argcnt = 0;
-    XtSetArg(args[argcnt], XmNdepth, &(attributes.depth)); argcnt++;
-    XtSetArg(args[argcnt], XmNcolormap, &(attributes.colormap)); argcnt++;
-    if ( ! XtIsWidget(w) )
-    {
-	XtGetValues(XtParent(w), args, argcnt);
-    }
-    else
-    {
-	XtGetValues(w, args, argcnt);
-    }
-
-    attributes.visual = DefaultVisual(XtDisplayOfObject(w),
-				      DefaultScreen(XtDisplayOfObject(w)));
-
-    if ( attributes.depth != 0 ) attributes.valuemask |= BxXpmDepth;
-    if ( attributes.colormap != 0 ) attributes.valuemask |= BxXpmColormap;
-    if ( attributes.visual != 0 ) attributes.valuemask |= BxXpmVisual;
-
-    returnValue = BxXpmCreatePixmapFromData(XtDisplayOfObject(w),
-				       DefaultRootWindow(XtDisplayOfObject(w)),
-				       pixmapName, &pixmap, &shape,
-				       &attributes);
-    if ( shape )
-    {
-	XFreePixmap(XtDisplayOfObject(w), shape);
-    }
-
-    switch(returnValue)
-    {
-    case BxXpmOpenFailed:
-    case BxXpmFileInvalid:
-    case BxXpmNoMemory:
-    case BxXpmColorFailed:
-	XtWarning("Could not create pixmap.");
-	return(XmUNSPECIFIED_PIXMAP);
-    default:
-	return(pixmap);
-    }
-}
-
-#endif
-
- /* This structure is for capturing app-defaults values for a Class */
-
-typedef struct _UIAppDefault
-{
-    char*		cName;		/* Class name */
-    char*		wName; 		/* Widget name */
-    char*		cInstName;	/* Name of class instance(nested) */
-    char*		wRsc;		/* Widget resource */
-    char*		value;		/* value read from app-defaults */
-} UIAppDefault;
-
-
-void setDefaultResources ARGLIST((_name, w, resourceSpec))
-ARG(char*, _name)
-ARG(Widget, w)
-GRA(String *,resourceSpec)
-{
-   int         i;
-   Display    *dpy = XtDisplay ( w );	  /* Retrieve the display pointer */
-   XrmDatabase rdb = NULL;             /* A resource data base */
-
-   /* Create an empty resource database */
-
-   rdb = XrmGetStringDatabase ( (char *)"" );
-
-   /* Add the Component resources, prepending the name of the component */
-
-   i = 0;
-   while ( resourceSpec[i] != NULL )
-   {
-       char buf[1000];
-
-       sprintf(buf, "*%s%s", _name, resourceSpec[i++]);
-       XrmPutLineResource( &rdb, buf );
-   }
-
-   /* Merge them into the Xt database, with lowest precendence */
-
-   if ( rdb )
-   {
-#if (XlibSpecificationRelease>=5)
-        XrmDatabase db = XtDatabase(dpy);
-	XrmCombineDatabase(rdb, &db, FALSE);
-#else
-        XrmMergeDatabases ( dpy->db, &rdb );
-        dpy->db = rdb;
-#endif
-    }
-}
-
-/*
- * This method gets all the resources from the app-defaults file
- * (resource databse) and fills in the table (defs) if the app default
- * value exists.
- */
-void
-InitAppDefaults ARGLIST((parent, defs))
-ARG(Widget, parent)
-GRA(UIAppDefault *, defs)
-{
-    XrmQuark		cQuark;
-    XrmQuark		rsc[10];
-    XrmRepresentation	rep;
-    XrmValue		val;
-    XrmDatabase		rdb;
-    int			rscIdx;
-
-    /* Get the database */
-
-#if (XlibSpecificationRelease >= 5)
-    if ((rdb = XrmGetDatabase(XtDisplay(parent))) == NULL)
-    {
-	return;			/*  Can't get the database */
-    }
-#else
-    Display *dpy = XtDisplay(parent);
-    if ((rdb = dpy->db) == NULL)
-    {
-	return;
-    }
-#endif
-
-    /* Look for each resource in the table */
-
-    while (defs->wName)
-    {
-	rscIdx = 0;
-
-	cQuark = XrmStringToQuark(defs->cName);	/* class quark */
-	rsc[rscIdx++] = cQuark;
-	if (defs->wName[0] == '\0')
-	{
-	    rsc[rscIdx++] = cQuark;
-	}
-	else
-	{
-	    if( strchr(defs->wName, '.') == NULL )
-	    {
-		rsc[rscIdx++] = XrmStringToQuark(defs->wName);
-	    }
-	    else
-	    {
-		/*
-		 * If we found a '.' that means that this is not
-		 * a simple widget name, but a sub specification so
-		 * we need to split this into several quarks.
-		 */
-		char *copy = XtNewString(defs->wName), *ptr;
-
-		for( ptr = strtok(copy, "."); ptr != NULL;
-		     ptr = strtok(NULL, ".") )
-		{
-		    rsc[rscIdx++] = XrmStringToQuark(ptr);
-		}
-		XtFree(copy);
-	    }
-	}
-
-	if (defs->cInstName && defs->cInstName[0] != '\0')
-	{
-	    rsc[rscIdx++] = XrmStringToQuark(defs->cInstName);
-	}
-
-	rsc[rscIdx++] = XrmStringToQuark(defs->wRsc);
-	rsc[rscIdx++] = NULLQUARK;
-
-	if (XrmQGetResource(rdb, rsc, rsc, &rep, &val))
-	{
-	    defs->value = XtNewString((char*)val.addr);
-	}
-	defs++;
-    }
-}
-
-/*
- * This method applies the app defaults for the class to a specific
- * instance. All the widgets in the path are loosly coupled (use *).
- * To override a specific instance, use a tightly coupled app defaults
- * resource line (use .).
- */
-void
-SetAppDefaults ARGLIST((w, defs, inst_name, override_inst))
-ARG(Widget,w)
-ARG(UIAppDefault*, defs)
-ARG(char*, inst_name)
-GRA(Boolean, override_inst)
-{
-   Display*		dpy = XtDisplay (w);	/*  Retrieve the display */
-   XrmDatabase		rdb = NULL;		/* A resource data base */
-   char			buf[1000];
-   char 		*appName, *appClass;
-
-   /*
-    * Protect ourselves
-    */
-   if ( inst_name == NULL ) return;
-
-   /*
-    * Create an empty resource database
-    */
-   rdb = XrmGetStringDatabase ((char *)"");
-   XtGetApplicationNameAndClass(XtDisplay(w), &appName, &appClass);
-
-   /*
-    * Add the Component resources, prepending the name of the component
-    */
-   while ( defs->wName != NULL )
-   {
-       int namelen;
-       /*
-        * We don't deal with the resource if it isn't found in the
-	* Xrm database at class initializtion time (in initAppDefaults).
-	* Special handling of class instances.
-	*/
-       if ( strchr(defs->wName, '.') )
-       {
-	   namelen = strlen(defs->wName) - strlen(strchr(defs->wName, '.'));
-       }
-       else
-       {
-	   int		wnamelen = strlen(defs->wName);
-	   int		inamelen = strlen(inst_name);
-	   namelen = (wnamelen > inamelen ? wnamelen : inamelen);
-       }
-       if ( defs->value == NULL ||
-	    (override_inst && strncmp(inst_name, defs->wName, namelen)) ||
-	    (!override_inst && defs->cInstName != NULL) )
-       {
-	   defs++;
-	   continue;
-       }
-
-       /*
-	* Build up resource database string
-	*/
-       if ( defs->cInstName != NULL )
-       {
-	   /*
-	    * Don't include class instance name if it is also
-	    * the widget instance being worked on.
-	    */
-	   if ( *defs->cInstName != '\0' )
-	   {
-	       sprintf(buf, "%s*%s*%s.%s: %s", appClass, defs->cInstName,
-		       defs->wName, defs->wRsc, defs->value);
-	   }
-	   else
-	   {
-	       sprintf(buf, "%s*%s.%s: %s",
-		       appClass, defs->wName, defs->wRsc, defs->value);
-	   }
-       }
-       else if ( *defs->wName != '\0' )
-       {
-	   sprintf(buf, "%s*%s*%s.%s: %s",
-		   appClass, inst_name, defs->wName, defs->wRsc, defs->value);
-       }
-       else
-       {
-	   sprintf(buf, "%s*%s.%s: %s",
-		   appClass, inst_name,defs->wRsc, defs->value);
-       }
-
-       XrmPutLineResource(&rdb, buf);
-       defs++;
-   }
-
-   /*
-    * Merge them into the Xt database, with lowest precendence
-    */
-   if ( rdb )
-   {
-       /*  DO NOT do an XrmDestroyDatabase(rdb) here.  This looks like a
-	* program leak, but is really an X problem.
-	*
-	* XrmCombineDatabase() squirrels away a copy of the pointers in
-	* rdb.  Either XrmCombineDatabase should save a duplicate, or else
-	* XrmCombineDatabase needs to assume responsibility for destroying
-	* rdb at the right time.  We do not know when the pointers are no
-	* longer needed.
-	*/
-#if (XlibSpecificationRelease >= 5)
-        XrmDatabase db = XtDatabase(dpy);
-	XrmCombineDatabase(rdb, &db, FALSE);
-#else
-        XrmMergeDatabases ( dpy->db, &rdb );
-        dpy->db = rdb;
-#endif
-    }
-}
diff --git a/src/mbview/mbpingedit_callbacks.c b/src/mbview/mbpingedit_callbacks.c
deleted file mode 100644
index 3800107..0000000
--- a/src/mbview/mbpingedit_callbacks.c
+++ /dev/null
@@ -1,539 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbpingedit_callbacks.c		11/13/2007
- *    $Id: mbpingedit_callbacks.c 2239 2015-05-07 00:51:42Z caress $
- *
- *    Copyright (c) 2007-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-
-
-/* Begin user code block <abstract> */
-/* End user code block <abstract> */
-
-/**
- * README: This file is appended to at file generation time.
- * Edits can be made throughout the file
- */
-/*
- * Generated by the ICS Builder Xcessory (BX).
- *
- * BuilderXcessory Version 6.1.3
- * Code Generator Xcessory 6.1.3 (08/19/04) CGX Scripts 6.1 Motif 2.1
- *
- */
-#include <Xm/Xm.h>
-
-
-/*
- * Standard includes for builtins.
- */
-#include <stdio.h>
-#include <string.h>
-#include <ctype.h>
-#include <math.h>
-
-/* Motif required Headers */
-#include <X11/StringDefs.h>
-#include <X11/cursorfont.h>
-#include <Xm/Xm.h>
-#include <Xm/MainW.h>
-#include <Xm/DialogS.h>
-#include <Xm/RepType.h>
-#include <Xm/MwmUtil.h>
-#include <Xm/BulletinB.h>
-#include <Xm/RowColumn.h>
-#include <Xm/CascadeB.h>
-#include <Xm/PushB.h>
-#include <Xm/Separator.h>
-#include "Mb3dsdg.h"
-
-/* OpenGL include files */
-#ifdef WIN32
-#undef BOOL		/* It was defined by a chain of inclusions in the (patched) X11/Xmd.h */
-#include <windows.h>
-#endif
-
-#include <GL/gl.h>
-#include <GL/glu.h>
-#ifndef WIN32
-#	include <GL/glx.h>
-#endif
-#include "mb_glwdrawa.h"
-
-/* MBIO include files */
-#include "mb_status.h"
-#include "mb_define.h"
-
-/* Set flag to define mbpingedit global variables in this code block */
-#define MBPINGEDITGLOBAL
-
-/* mbpingedit include */
-#include "mbview.h"
-#include "mbpingeditprivate.h"
-
-/*------------------------------------------------------------------------------*/
-
-/* local variables */
-
-static char rcs_id[]="$Id: mbpingedit_callbacks.c 2239 2015-05-07 00:51:42Z caress $";
-
-/* function prototypes */
-/*------------------------------------------------------------------------------*/
-
-/*------------------------------------------------------------------------------*/
-/* code used in original BX application, not used for library */
-/*
- * Macros to make code look nicer between ANSI and K&R.
- */
-#ifndef ARGLIST
-#if (NeedFunctionPrototypes == 0)
-#define PROTOTYPE(p)	()
-#define ARGLIST(p)	p
-#define ARG(a, b)	a b;
-#define GRA(a, b)	a b;
-#define UARG(a, b)      a b;
-#define GRAU(a, b)      a b;
-#else
-#define PROTOTYPE(p)	p
-#define ARGLIST(p)	(
-#define ARG(a, b)	a b,
-#define GRA(a, b)	a b)
-#ifdef __cplusplus
-#define UARG(a, b)      a,
-#define GRAU(a, b)      a)
-#else
-#define UARG(a, b)      a b,
-#define GRAU(a, b)      a b)
-#endif
-#endif
-#endif
-
-Widget		BxFindTopShell PROTOTYPE((Widget));
-WidgetList	BxWidgetIdsFromNames PROTOTYPE((Widget, char*, char*));
-
-
-/*------------------------------------------------------------------------------*/
-/* code below used for mbpingedit library                                       */
-/*------------------------------------------------------------------------------*/
-
-int mbpingedit_startup(int verbose, Widget parent, XtAppContext app, int *error)
-{
-	/* local variables */
-	char	*function_name = "mbpingedit_startup";
-
-	/* set local verbosity */
-	mbp_verbose = verbose;
-
-	/* print starting debug statements */
-	if (mbp_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:                 %d\n", verbose);
-		fprintf(stderr,"dbg2       parent:                  %p\n", parent);
-		fprintf(stderr,"dbg2       app:                     %p\n", app);
-		}
-
-	/* set parent widget and app context */
-	mbp_parent_widget = parent;
-	mbp_app_context = app;
-	mbp_work_function_set = MB_NO;
-	mbp_timer_count = 0;
-
-	/* initialize window */
-	/*mbpingedit_reset();*/
-
-	/* set error */
-	*error = mbp_error;
-
-	/* print output debug statements */
-	if (mbp_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:        %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:       %d\n",mbp_status);
-		}
-
-	/* return */
-	return(mbp_status);
-}
-
-/*------------------------------------------------------------------------------*/
-
-void
-do_mbpingedit_mode_toggle( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-}
-
-/*------------------------------------------------------------------------------*/
-
-void
-do_mbpingedit_show_detects( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-}
-
-/*------------------------------------------------------------------------------*/
-
-void
-do_mbpingedit_dismiss( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-}
-
-/*------------------------------------------------------------------------------*/
-
-void
-do_mbpingedit_next_buffer( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-}
-
-/*------------------------------------------------------------------------------*/
-
-void
-do_mbpingedit_scale_x( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-}
-
-/*------------------------------------------------------------------------------*/
-
-void
-do_mbpingedit_scale_y( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-}
-
-/*------------------------------------------------------------------------------*/
-
-void
-do_mbpingedit_check_median_ltrack( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-}
-
-/*------------------------------------------------------------------------------*/
-
-void
-do_mbpingedit_check_median_xtrack( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-}
-
-/*------------------------------------------------------------------------------*/
-
-void
-do_mbpingedit_mode_grab( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-}
-
-/*------------------------------------------------------------------------------*/
-
-void
-do_mbpingedit_mode_erase( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-}
-
-/*------------------------------------------------------------------------------*/
-
-void
-do_mbpingedit_show_flagged( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-}
-
-/*------------------------------------------------------------------------------*/
-
-void
-do_mbpingedit_reverse( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-}
-
-/*------------------------------------------------------------------------------*/
-
-void
-do_mbpingedit_number_step( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-}
-
-/*------------------------------------------------------------------------------*/
-
-void
-do_mbpingedit_set_filters( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-}
-
-/*------------------------------------------------------------------------------*/
-
-void
-do_mbpingedit_view_mode( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-}
-
-/*------------------------------------------------------------------------------*/
-
-void
-do_mbpingedit_reset_filters( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-}
-
-/*------------------------------------------------------------------------------*/
-
-void
-do_mbpingedit_x_interval( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-}
-
-/*------------------------------------------------------------------------------*/
-
-void
-do_mbpingedit_y_interval( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-}
-
-/*------------------------------------------------------------------------------*/
-
-void
-do_mbpingedit_mode_info( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-}
-
-/*------------------------------------------------------------------------------*/
-
-void
-do_mbpingedit_unflag_all( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-}
-
-/*------------------------------------------------------------------------------*/
-
-void
-do_mbpingedit_flag_view( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-}
-/*      Function Name: 	BxManageCB
- *
- *      Description:   	Given a string of the form:
- *		       	"(WL)[widgetName, widgetName, ...]"
- *			BxManageCB attempts to convert the name to a Widget
- *			ID and manage the widget.
- *
- *      Arguments:     	Widget	    w:      the widget activating the callback.
- *		       	XtPointer   client: the list of widget names to attempt
- *					    to find and manage.
- *		       	XtPointer   call:   the call data (unused).
- *
- *      Notes:        *	This function expects that there is an application
- *		       	shell from which all other widgets are descended.
- */
-
-/* ARGSUSED */
-/*------------------------------------------------------------------------------*/
-
-void
-BxManageCB ARGLIST((w, client, call))
-ARG( Widget, w)
-ARG( XtPointer, client)
-GRAU( XtPointer, call)
-{
-    WidgetList		widgets;
-    int			i;
-
-    /*
-     * This function returns a NULL terminated WidgetList.  The memory for
-     * the list needs to be freed when it is no longer needed.
-     */
-    widgets = BxWidgetIdsFromNames(w, "BxManageCB", (String)client);
-
-    i = 0;
-    while( widgets && widgets[i] != NULL )
-    {
-	XtManageChild(widgets[i]);
-	i++;
-    }
-    XtFree((char *)widgets);
-}
-
-/*      Function Name: 	BxUnmanageCB
- *
- *      Description:   	Given a string of the form:
- *		       	"(WL)[widgetName, widgetName, ...]"
- *			BxUnmanageCB attempts to convert the name to a Widget
- *			ID and unmanage the widget.
- *
- *      Arguments:     	Widget	    w:      the widget activating the callback.
- *		       	XtPointer   client: the list of widget names to attempt
- *					    to find and unmanage.
- *		       	XtPointer   call:   the call data (unused).
- *
- *      Notes:        *	This function expects that there is an application
- *		       	shell from which all other widgets are descended.
- */
-
-/* ARGSUSED */
-/*------------------------------------------------------------------------------*/
-
-void
-BxUnmanageCB ARGLIST((w, client, call))
-ARG( Widget, w)
-ARG( XtPointer, client)
-GRAU( XtPointer, call)
-{
-    WidgetList		widgets;
-    int			i;
-
-    /*
-     * This function returns a NULL terminated WidgetList.  The memory for
-     * the list needs to be freed when it is no longer needed.
-     */
-    widgets = BxWidgetIdsFromNames(w, "BxUnmanageCB", (String)client);
-
-    i = 0;
-    while( widgets && widgets[i] != NULL )
-    {
-	XtUnmanageChild(widgets[i]);
-	i++;
-    }
-    XtFree((char *)widgets);
-}
-
-
-/*------------------------------------------------------------------------------*/
-
-void
-do_mbpingedit_reverse_keys( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-}
-
-/*------------------------------------------------------------------------------*/
-
-void
-do_mbpingedit_event( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-}
-
-/*------------------------------------------------------------------------------*/
-
-void
-do_mbpingedit_number_pings( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-}
-
-/*------------------------------------------------------------------------------*/
-
-void
-do_mbpingedit_forward( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-}
-
-/*------------------------------------------------------------------------------*/
-
-void
-do_mbpingedit_show_time( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-}
-
-/*------------------------------------------------------------------------------*/
-
-void
-do_mbpingedit_mode_restore( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-}
-
-/*------------------------------------------------------------------------------*/
-
-void
-do_mbpingedit_reverse_mouse( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-}
-
-/*------------------------------------------------------------------------------*/
-
-void
-do_mbpingedit_mode_pick( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-}
-
-/*------------------------------------------------------------------------------*/
-
-void
-do_mbpingedit_expose( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-}
-
-/*------------------------------------------------------------------------------*/
-
-void
-do_mbpingedit_unflag_view( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-}
-
-/*------------------------------------------------------------------------------*/
diff --git a/src/mbview/mbpingedit_creation.c b/src/mbview/mbpingedit_creation.c
deleted file mode 100644
index 9ec74c4..0000000
--- a/src/mbview/mbpingedit_creation.c
+++ /dev/null
@@ -1,135 +0,0 @@
-
-/* Begin user code block <abstract> */
-/* End user code block <abstract> */
-
-/**
- * README: Portions of this file are merged at file generation
- * time. Edits can be made *only* in between specified code blocks, look
- * for keywords <Begin user code> and <End user code>.
- */
-/*
- * Generated by the ICS Builder Xcessory (BX).
- *
- * BuilderXcessory Version 6.1.3
- * Code Generator Xcessory 6.1.3 (08/19/04) CGX Scripts 6.1 Motif 2.1
- *
- */
-
-
-/* Begin user code block <file_comments> */
-
-#ifndef SANS
-#define SANS "helvetica"
-#endif
-#ifndef SERIF
-#define SERIF "times"
-#endif
-#ifndef MONO
-#define MONO "courier"
-#endif
-
-/* End user code block <file_comments> */
-
-#include <Xm/Xm.h>
-#include <Xm/MainW.h>
-#include <Xm/DialogS.h>
-#include <Xm/MwmUtil.h>
-#include <Xm/Form.h>
-#include <Xm/MainW.h>
-#include <Xm/DialogS.h>
-#include <Xm/MwmUtil.h>
-#include <Xm/Form.h>
-
-/*
- * Global declarations are now stored in the header file.
- *
- * If DECLARE_BX_GLOBALS is defined then this header file
- * declares the globals, otherwise it just externs them.
- */
-#define DECLARE_BX_GLOBALS
-
-/**
- * Globally included information.
- */
-
-#include "MBpedit.h"
-
-/**
- * Common constant and pixmap declarations.
- */
-#include "mbpingedit_creation.h"
-
-/**
- * Convenience functions from utilities file.
- */
-extern void RegisterBxConverters(XtAppContext);
-extern XtPointer BX_CONVERT(Widget, char *, char *, int, Boolean *);
-extern XtPointer BX_DOUBLE(double);
-extern XtPointer BX_SINGLE(float);
-extern void BX_MENU_POST(Widget, XtPointer, XEvent *, Boolean *);
-extern Pixmap XPM_PIXMAP(Widget, char **);
-extern void BX_SET_BACKGROUND_COLOR(Widget, ArgList, Cardinal *, Pixel);
-
-/**
- * Declarations for callbacks and handlers.
- */
-extern void do_mbpingedit_dismiss(Widget, XtPointer, XtPointer);
-
-/**
- * Create the mbpingedit_window hierarchy of widgets.
- */
-Widget
-Creatembpingedit_window(Widget parent)
-{
-    Cardinal ac = 0;
-    Arg      args[256];
-    Cardinal cdc = 0;
-    Boolean  argok = False;
-    Widget   mbpingedit_dialogShell;
-    static MBpeditData mBpedit;
-
-    /**
-     * Register the converters for the widgets.
-     */
-    RegisterBxConverters(XtWidgetToApplicationContext(parent));
-    XtInitializeWidgetClass((WidgetClass)xmMainWindowWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmDialogShellWidgetClass);
-    XtInitializeWidgetClass((WidgetClass)xmFormWidgetClass);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 135); ac++;
-    XtSetArg(args[ac], XmNy, 180); ac++;
-    XtSetArg(args[ac], XmNwidth, 143); ac++;
-    XtSetArg(args[ac], XmNheight, 52); ac++;
-    mbpingedit_window = XmCreateMainWindow(parent,
-        (char *)"mbpingedit_window",
-        args,
-        ac);
-
-    ac = 0;
-    XtSetArg(args[ac], XmNtitle, "MBeditviz Swath View"); ac++;
-    XtSetArg(args[ac], XmNwidth, 1004); ac++;
-    XtSetArg(args[ac], XmNheight, 694); ac++;
-    XtSetArg(args[ac], XmNdeleteResponse, XmDO_NOTHING); ac++;
-    mbpingedit_dialogShell = XmCreateDialogShell(mbpingedit_window,
-        (char *)"mbpingedit_dialogShell",
-        args,
-        ac);
-
-    MBpeditCreate(&(mBpedit),
-        mbpingedit_dialogShell,
-        "mBpedit",
-        args,
-        ac);
-    ac = 0;
-    XtSetArg(args[ac], XmNx, 518); ac++;
-    XtSetArg(args[ac], XmNy, 310); ac++;
-    XtSetArg(args[ac], XmNwidth, 1004); ac++;
-    XtSetArg(args[ac], XmNheight, 694); ac++;
-    XtSetValues(mBpedit.MBpedit, args, ac);
-
-
-    /* Begin user code block <end_Creatembpingedit_window> */
-    /* End user code block <end_Creatembpingedit_window> */
-    return( mbpingedit_window );
-}
diff --git a/src/mbview/mbpingedit_creation.h b/src/mbview/mbpingedit_creation.h
deleted file mode 100644
index 0e3c87c..0000000
--- a/src/mbview/mbpingedit_creation.h
+++ /dev/null
@@ -1,37 +0,0 @@
-
-/* Begin user code block <abstract> */
-/* End user code block <abstract> */
-
-/**
- * WARNING: This file is overwritten at code generation time.
- * Any changes to this file will be lost.
- */
-/*
- *
- * Created by BuilderXcessory Version 6.1.3
- * Generated by Code Generator Xcessory 6.1.3 (08/19/04) CGX Scripts 6.1 Motif 2.1 
- *
- */
-#ifndef mbpingedit_creation_H
-#define mbpingedit_creation_H
-
-/*
- * Global widget declarations.
- *        - EXTERNAL is set to extern if the
- *          defs file is not included from the
- *          main file.
- */
-#ifdef DECLARE_BX_GLOBALS
-#define EXTERNAL
-#else
-#define EXTERNAL extern
-#endif
-
-/**
- * Start Global Widget Declarations.
- */
-EXTERNAL Widget   mbpingedit_window;
-/**
- * End Global Widget Declarations.
- */
-#endif
diff --git a/src/mbview/mbpingeditprivate.h b/src/mbview/mbpingeditprivate.h
deleted file mode 100644
index 8a48e51..0000000
--- a/src/mbview/mbpingeditprivate.h
+++ /dev/null
@@ -1,271 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mb3dsoundingsprivate.h	11/19/2007
- *    $Id: mbpingeditprivate.h 2247 2015-05-29 21:28:28Z caress $
- *
- *    Copyright (c) 2007-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- *
- * Author:	D. W. Caress
- * Date:	November 11,  2007
- *
- */
-
-/*--------------------------------------------------------------------*/
-
-/* OpenGL Error checking */
-/* #define MBP_GETERRORS 1 */
-
-/* OpenGL plotting parameters */
-#define LEFT_WIDTH 200
-#define LEFT_HEIGHT 30
-#define MBP_OPENGL_WIDTH 3.0
-#define MBP_OPENGL_ZMIN2D -5.0
-#define MBP_OPENGL_ZMAX2D 1000.0
-#define MBP_OPENGL_ZMIN3D 100000.0
-#define MBP_OPENGL_ZMAX3D 100000000.0
-
-/* OpenGL list IDs */
-#define MBP_GLLIST_3DSOUNDINGS  41
-
-#define MBP_PICK_IDIVISION 15
-#define MBP_PICK_DIVISION ((double)MBP_PICK_IDIVISION)
-#define MBP_PICK_DOWN	1
-#define MBP_PICK_MOVE	2
-#define MBP_PICK_UP	3
-
-#define MBP_WINDOW_NULL 	0
-#define MBP_WINDOW_HIDDEN 	1
-#define MBP_WINDOW_VISIBLE 	2
-#define MBP_LEFT_WIDTH		40
-#define MBP_LEFT_HEIGHT		40
-#define	MBP_NUM_COLORS   11
-
-#define MBP_OPENGL_WIDTH 3.0
-#define MBP_OPENGL_ZMIN2D -5.0
-#define MBP_OPENGL_ZMAX2D 1000.0
-#define MBP_OPENGL_ZMIN3D 100000.0
-#define MBP_OPENGL_ZMAX3D 100000000.0
-#define MBP_OPENGL_3D_CONTOUR_OFFSET 0.001
-#define MBP_OPENGL_3D_LINE_OFFSET 0.005
-#define MBP_OPENGL_ZPROFILE1 -100.0
-#define MBP_OPENGL_ZPROFILE2 -200.0
-
-#define	MBP_MOUSE_ROTATE	0
-#define	MBP_MOUSE_PANZOOM	1
-#define MBP_EDIT_TOGGLE		0
-#define MBP_EDIT_PICK		1
-#define MBP_EDIT_ERASE		2
-#define MBP_EDIT_RESTORE	3
-#define MBP_EDIT_GRAB		4
-#define MBP_EDIT_INFO		5
-#define MBP_PICK_THRESHOLD	50
-#define MBP_ERASE_THRESHOLD	15
-#define MBP_EDIT_GRAB_START	0
-#define MBP_EDIT_GRAB_MOVE	1
-#define MBP_EDIT_GRAB_END	2
-
-#define	MBP_VIEW_PROFILES_NONE		0
-#define	MBP_VIEW_PROFILES_UNFLAGGED	1
-#define	MBP_VIEW_PROFILES_ALL		2
-
-
-/* structure to hold instances of mbpingedit windows */
-struct mbpingedit_world_struct
-    {
-    /* flag if this instance is initialized */
-    int			init;
-
-    /* function pointers */
-    void (*mbpingedit_dismiss_notify)(void);
-    void (*mbpingedit_edit_notify)(int ifile, int iping, int ibeam, char beamflag, int flush);
-    void (*mbpingedit_info_notify)(int ifile, int iping, int ibeam, char *infostring);
-
-    /* pointer to structure holding data to be rendered */
-    struct mbpingedit_struct *soundingdata;
-
-    /* widgets and other Xwindows stuff of interest */
-    Widget		topLevelShell;
-    Widget		mainWindow;
-    Widget		glwmda;
-    Mb3dsdgData		mb3dsdg;
-    Display		*dpy;
-    Window		xid;
-    XVisualInfo 	*vi;
-    int			glx_init;
-#ifdef WIN32
-    HGLRC		glx_context;
-#else
-    GLXContext		glx_context;
-#endif
-    int			message_on;
-
-    /* mode parameters */
-    int			mouse_mode;
-    int			edit_mode;
-
-    /* cursors */
-    Cursor TargetBlackCursor;
-    Cursor TargetGreenCursor;
-    Cursor TargetRedCursor;
-    Cursor TargetBlueCursor;
-    Cursor ExchangeBlackCursor;
-    Cursor ExchangeGreenCursor;
-    Cursor ExchangeRedCursor;
-    Cursor FleurBlackCursor;
-    Cursor FleurRedCursor;
-    Cursor SizingBlackCursor;
-    Cursor SizingRedCursor;
-    Cursor BoatBlackCursor;
-    Cursor BoatRedCursor;
-    Cursor WatchBlackCursor;
-    Cursor WatchRedCursor;
-
-    /* drawing variables */
-    float elevation;
-    float azimuth;
-    float exageration;
-    float elevation_save;
-    float azimuth_save;
-    float exageration_save;
-    Dimension gl_xo;
-    Dimension gl_yo;
-    Dimension gl_width;
-    Dimension gl_height;
-    float right;
-    float left;
-    float top;
-    float bottom;
-    float aspect_ratio;
-    float gl_offset_x;
-    float gl_offset_y;
-    float gl_offset_x_save;
-    float gl_offset_y_save;
-    float gl_size;
-    float gl_size_save;
-
-    /* button parameters */
-    int button1down;
-    int button2down;
-    int button3down;
-    int button_down_x;
-    int button_down_y;
-    int button_move_x;
-    int button_move_y;
-    int button_up_x;
-    int button_up_y;
-
-    /* edit grab parameters */
-    int grab_start_defined;
-    int grab_end_defined;
-    int	grab_start_x;
-    int	grab_start_y;
-    int	grab_end_x;
-    int	grab_end_y;
-
-    /* patch test parameters */
-    int	irollbias;
-    int	ipitchbias;
-    int	iheadingbias;
-    int	itimelag;
-
-    /* view parameters */
-    int	view_boundingbox;
-    int	view_flagged;
-    int	view_profiles;
-    };
-
-/* library variables */
-/*   note that global mbpingedit variables will only be defined when
-     this code is included in mbpingedit_callbacks.c where the
-     MBPINGEDITGLOBAL flag is defined - other blocks of code will
-     have these variables declared as extern  */
-#ifdef MBPINGEDITGLOBAL
-#define EXTERNAL
-#else
-#define EXTERNAL extern
-#endif
-
-/* general library global variables */
-EXTERNAL int	mbp_verbose;
-EXTERNAL int	mbp_status;
-EXTERNAL int	mbp_error;
-EXTERNAL int	mbp_ninstance;
-EXTERNAL Widget	mbp_parent_widget;
-EXTERNAL XtAppContext	mbp_app_context;
-EXTERNAL int	mbp_work_function_set;
-EXTERNAL int	mbp_timer_count;
-EXTERNAL struct mbpingedit_world_struct mbpingedit;
-
-/* global declarations */
-#ifdef MBPINGEDITGLOBAL
-
-/* library colortables */
-char	*mbpingedit_colorname[MBP_NUM_COLORS] =
-		{ "Black",
-		  "White",
-		  "Red",
-		  "Yellow",
-		  "Green",
-		  "Blue-Green",
-		  "Blue",
-		  "Purple" };
-
-/* extern declarations */
-#else
-
-/* library colortables */
-extern char	*mbpingedit_colorname[MBP_NUM_COLORS];
-#endif
-
-/*------------------------------------------------------------------------------*/
-
-void do_mbpingedit_reverse_keys( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbpingedit_event( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbpingedit_number_pings( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbpingedit_forward( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbpingedit_show_time( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbpingedit_mode_restore( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbpingedit_reverse_mouse( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbpingedit_mode_pick( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbpingedit_expose( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbpingedit_unflag_view( Widget w, XtPointer client_data, XtPointer call_data);
-int mbpingedit_startup(int verbose, Widget parent, XtAppContext app, int *error);
-void do_mbpingedit_mode_toggle( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbpingedit_show_detects( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbpingedit_dismiss( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbpingedit_next_buffer( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbpingedit_scale_x( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbpingedit_scale_y( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbpingedit_check_median_ltrack( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbpingedit_check_median_xtrack( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbpingedit_mode_grab( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbpingedit_mode_erase( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbpingedit_show_flagged( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbpingedit_reverse( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbpingedit_number_step( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbpingedit_set_filters( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbpingedit_view_mode( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbpingedit_reset_filters( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbpingedit_x_interval( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbpingedit_y_interval( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbpingedit_mode_info( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbpingedit_unflag_all( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbpingedit_flag_view( Widget w, XtPointer client_data, XtPointer call_data);
-
-void BxUnmanageCB(Widget w, XtPointer client, XtPointer call);
-void BxManageCB(Widget w, XtPointer client, XtPointer call);
-void BxPopupCB(Widget w, XtPointer client, XtPointer call);
-XtPointer BX_CONVERT(Widget w, char *from_string, char *to_type, int to_size, Boolean *success);
-void BxExitCB(Widget w, XtPointer client, XtPointer call);
-void BxSetValuesCB(Widget w, XtPointer client, XtPointer call);
-
-/*------------------------------------------------------------------------------*/
diff --git a/src/mbview/mbview.h b/src/mbview/mbview.h
deleted file mode 100644
index 71150a8..0000000
--- a/src/mbview/mbview.h
+++ /dev/null
@@ -1,1181 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbview.h	10/9/2002
- *    $Id: mbview.h 2247 2015-05-29 21:28:28Z caress $
- *
- *    Copyright (c); 2002-2015 by
- *    David W. Caress (caress at mbari.org);
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu);
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- *
- * Author:	D. W. Caress
- * Date:	October 10,  2002
- *
- */
-
-/*--------------------------------------------------------------------*/
-
-#ifndef MB_STATUS_DEF
-#include "mb_status.h"
-#endif
-
-#ifndef MB_DEFINE_DEF
-#include "mb_define.h"
-#endif
-
-/* maximum number of mbview windows */
-#define MBV_MAX_WINDOWS		10
-
-/* no window / invalid instance flag */
-#define MBV_NO_WINDOW		999
-
-/* typical number of array elements to allocate at a time */
-#define MBV_ALLOC_NUM		128
-
-/* mouse mode defines */
-#define MBV_MOUSE_MOVE		0
-#define MBV_MOUSE_ROTATE	1
-#define MBV_MOUSE_SHADE		2
-#define MBV_MOUSE_VIEWPOINT	3
-#define MBV_MOUSE_AREA		4
-#define MBV_MOUSE_SITE		5
-#define MBV_MOUSE_ROUTE		6
-#define MBV_MOUSE_NAV		7
-#define MBV_MOUSE_NAVFILE	8
-#define MBV_MOUSE_VECTOR	9
-
-/* projection mode */
-#define	MBV_PROJECTION_GEOGRAPHIC	0
-#define	MBV_PROJECTION_PROJECTED	1
-#define	MBV_PROJECTION_ALREADYPROJECTED	2
-#define	MBV_PROJECTION_SPHEROID		3
-#define	MBV_PROJECTION_ELLIPSOID	4
-
-/* display mode defines */
-#define	MBV_DISPLAY_2D		0
-#define	MBV_DISPLAY_3D		1
-
-/* data type defines */
-#define	MBV_DATA_PRIMARY		0
-#define	MBV_DATA_PRIMARYSLOPE		1
-#define	MBV_DATA_SECONDARY		2
-
-/* grid view mode defines */
-#define	MBV_GRID_VIEW_PRIMARY		0
-#define	MBV_GRID_VIEW_PRIMARYSLOPE	1
-#define	MBV_GRID_VIEW_SECONDARY		2
-
-/* shade view mode defines */
-#define	MBV_SHADE_VIEW_NONE		0
-#define	MBV_SHADE_VIEW_ILLUMINATION	1
-#define	MBV_SHADE_VIEW_SLOPE		2
-#define	MBV_SHADE_VIEW_OVERLAY		3
-
-/* simple view mode defines for contours, sites, routes, etc */
-#define	MBV_VIEW_OFF		0
-#define	MBV_VIEW_ON		1
-
-/* lon lat style mode */
-#define MBV_LONLAT_DECIMAL	0
-#define	MBV_LONLAT_MINUTES	1
-
-/* colortable view mode defines */
-#define	MBV_COLORTABLE_NORMAL		0
-#define	MBV_COLORTABLE_REVERSED		1
-
-/* colortable view mode defines */
-#define	MBV_COLORTABLE_HAXBY		0
-#define	MBV_COLORTABLE_BRIGHT		1
-#define	MBV_COLORTABLE_MUTED		2
-#define	MBV_COLORTABLE_GRAY		3
-#define	MBV_COLORTABLE_FLAT		4
-#define	MBV_COLORTABLE_SEALEVEL1	5
-#define	MBV_COLORTABLE_SEALEVEL2	6
-
-/* individual color defines */
-#define	MBV_COLOR_BLACK			0
-#define	MBV_COLOR_WHITE			1
-#define	MBV_COLOR_RED			2
-#define	MBV_COLOR_YELLOW		3
-#define	MBV_COLOR_GREEN			4
-#define	MBV_COLOR_BLUEGREEN		5
-#define	MBV_COLOR_BLUE			6
-#define	MBV_COLOR_PURPLE		7
-
-/* default no data value define */
-#define	MBV_DEFAULT_NODATA		-9999999.9
-
-/* selection defines */
-#define MBV_SELECT_NONE			-1
-#define MBV_SELECT_ALL			-2
-
-/* pick defines */
-#define MBV_PICK_NONE			0
-#define MBV_PICK_ONEPOINT		1
-#define MBV_PICK_TWOPOINT		2
-#define MBV_PICK_AREA			3
-#define MBV_PICK_REGION			4
-#define MBV_PICK_SITE			5
-#define MBV_PICK_ROUTE			6
-#define MBV_PICK_NAV			7
-#define MBV_PICK_VECTOR			8
-
-/* region defines */
-#define MBV_REGION_REPICKWIDTH		2
-#define MBV_REGION_NONE			0
-#define MBV_REGION_ONEPOINT		1
-#define MBV_REGION_QUAD			2
-#define MBV_REGION_PICKCORNER0		0
-#define MBV_REGION_PICKCORNER1		1
-#define MBV_REGION_PICKCORNER2		2
-#define MBV_REGION_PICKCORNER3		3
-
-/* area defines */
-#define MBV_AREA_REPICKWIDTH		2
-#define MBV_AREA_NONE			0
-#define MBV_AREA_ONEPOINT		1
-#define MBV_AREA_QUAD			2
-#define MBV_AREA_PICKENDPOINT0		0
-#define MBV_AREA_PICKENDPOINT1		1
-
-/* site defines */
-#define MBV_SITE_OFF			0
-#define MBV_SITE_VIEW			1
-#define MBV_SITE_EDIT			2
-
-/* route defines */
-#define MBV_ROUTE_OFF			0
-#define MBV_ROUTE_VIEW			1
-#define MBV_ROUTE_EDIT			2
-#define MBV_ROUTE_WAYPOINT_DELETEFLAG	-1
-#define MBV_ROUTE_WAYPOINT_NONE		0
-#define MBV_ROUTE_WAYPOINT_SIMPLE	1
-#define MBV_ROUTE_WAYPOINT_TRANSIT	2
-#define MBV_ROUTE_WAYPOINT_STARTLINE	3
-#define MBV_ROUTE_WAYPOINT_ENDLINE	4
-#define MBV_ROUTE_WAYPOINT_STARTLINE2	5
-#define MBV_ROUTE_WAYPOINT_ENDLINE2	6
-#define MBV_ROUTE_WAYPOINT_STARTLINE3	7
-#define MBV_ROUTE_WAYPOINT_ENDLINE3	8
-#define MBV_ROUTE_WAYPOINT_STARTLINE4	9
-#define MBV_ROUTE_WAYPOINT_ENDLINE4	10
-
-/* nav defines */
-#define MBV_NAV_OFF			0
-#define MBV_NAV_VIEW			1
-
-/* vector defines */
-#define MBV_VECTOR_OFF			0
-#define MBV_VECTOR_VIEW			1
-
-/* stat masks */
-#define MBV_STATMASK0	0x01
-#define MBV_STATMASK1	0x02
-#define MBV_STATMASK2	0x04
-#define MBV_STATMASK3	0x08
-#define MBV_STATMASK4	0x10
-#define MBV_STATMASK5	0x20
-#define MBV_STATMASK6	0x40
-#define MBV_STATMASK7	0x80
-
-/* pick sensitivity masks */
-#define MBV_PICKMASK_NONE			0
-#define MBV_PICKMASK_ONEPOINT			1
-#define MBV_PICKMASK_TWOPOINT			2
-#define MBV_PICKMASK_AREA			4
-#define MBV_PICKMASK_REGION			8
-#define MBV_PICKMASK_SITE			16
-#define MBV_PICKMASK_ROUTE			32
-#define MBV_PICKMASK_NAVONEPOINT		64
-#define MBV_PICKMASK_NAVTWOPOINT		128
-#define MBV_PICKMASK_NAVANY			256
-#define MBV_PICKMASK_NEWINSTANCE		512
-#define MBV_EXISTMASK_SITE			1024
-#define MBV_EXISTMASK_ROUTE			2048
-#define MBV_EXISTMASK_NAV			4096
-
-/* profile defines */
-#define MBV_PROFILE_NONE			0
-#define MBV_PROFILE_TWOPOINT			1
-#define MBV_PROFILE_ROUTE			2
-#define MBV_PROFILE_NAV				3
-#define	MBV_PROFILE_FACTOR_MAX 			4.0
-
-/* mb3dsounding mouse mode value defines */
-#define	MB3DSDG_MOUSE_TOGGLE	0
-#define	MB3DSDG_MOUSE_PICK	1
-#define	MB3DSDG_MOUSE_ERASE	2
-#define	MB3DSDG_MOUSE_RESTORE	3
-#define	MB3DSDG_MOUSE_GRAB	4
-#define	MB3DSDG_MOUSE_INFO	5
-#define	MB3DSDG_EDIT_NOFLUSH		0
-#define	MB3DSDG_EDIT_FLUSH		1
-#define	MB3DSDG_EDIT_FLUSHPREVIOUS	2
-
-/*--------------------------------------------------------------------*/
-
-/* structure declarations */
-struct mbview_contoursegment_struct {
-	float	x[2];
-	float	y[2];
-	float	z;
-	float	level;
-	};
-
-struct mbview_point_struct {
-	double	xgrid;
-	double	ygrid;
-	double	xlon;
-	double	ylat;
-	double	zdata;
-	double	xdisplay;
-	double	ydisplay;
-	double	zdisplay;
-	};
-
-struct mbview_pointw_struct {
-	double	xgrid[MBV_MAX_WINDOWS];
-	double	ygrid[MBV_MAX_WINDOWS];
-	double	xlon;
-	double	ylat;
-	double	zdata;
-	double	xdisplay[MBV_MAX_WINDOWS];
-	double	ydisplay[MBV_MAX_WINDOWS];
-	double	zdisplay[MBV_MAX_WINDOWS];
-	};
-
-struct mbview_navpoint_struct {
-	int	draped;
-	int	selected;
-	double	time_d;
-	double	heading;
-	double	speed;
-	struct mbview_point_struct point;
-	struct mbview_point_struct pointport;
-	struct mbview_point_struct pointcntr;
-	struct mbview_point_struct pointstbd;
-	int	line;
-	int	shot;
-	int	cdp;
-	};
-
-struct mbview_navpointw_struct {
-	int	draped;
-	int	selected;
-	double	time_d;
-	double	heading;
-	double	speed;
-	struct mbview_pointw_struct point;
-	struct mbview_pointw_struct pointport;
-	struct mbview_pointw_struct pointcntr;
-	struct mbview_pointw_struct pointstbd;
-	int	line;
-	int	shot;
-	int	cdp;
-	};
-
-struct mbview_vectorpointw_struct {
-	int	draped;
-	int	selected;
-	struct mbview_pointw_struct point;
-	double	data;
-	};
-
-struct mbview_profilepoint_struct {
-	int	boundary;
-	double	xgrid;
-	double	ygrid;
-	double	xlon;
-	double	ylat;
-	double	zdata;
-	double	distance;
-	double	distovertopo;
-	double	xdisplay;
-	double	ydisplay;
-	double	navzdata;
-	double	navtime_d;
-	double	slope;
-	double	bearing;
-	};
-
-struct mbview_linesegment_struct {
-	struct mbview_point_struct endpoints[2];
-	int	nls;
-	int	nls_alloc;
-	struct mbview_point_struct *lspoints;
-	};
-
-struct mbview_linesegmentw_struct {
-	struct mbview_pointw_struct endpoints[2];
-	int	nls;
-	int	nls_alloc;
-	struct mbview_pointw_struct *lspoints;
-	};
-
-struct mbview_pick_struct {
-	double	range;
-	double	bearing;
-	struct mbview_point_struct endpoints[2];
-	struct mbview_point_struct xpoints[8];
-	struct mbview_linesegment_struct segment;
-	struct mbview_linesegment_struct xsegments[4];
-	};
-
-struct mbview_pickw_struct {
-	struct mbview_pointw_struct endpoints[2];
-	struct mbview_pointw_struct xpoints[8];
-	struct mbview_linesegmentw_struct segment;
-	struct mbview_linesegmentw_struct xsegments[4];
-	};
-
-struct mbview_region_struct {
-	double	width;
-	double	height;
-	struct mbview_point_struct cornerpoints[4];
-	struct mbview_linesegment_struct segments[4];
-	};
-
-struct mbview_area_struct {
-	double	width;
-	double	length;
-	double	bearing;
-	struct mbview_point_struct endpoints[2];
-	struct mbview_linesegment_struct segment;
-	struct mbview_point_struct cornerpoints[4];
-	struct mbview_linesegment_struct segments[4];
-	};
-
-struct mbview_site_struct {
-	struct mbview_pointw_struct point;
-	int	color;
-	int	size;
-	mb_path	name;
-	};
-
-struct mbview_route_struct {
-	int	color;
-	int	size;
-	int	editmode;
-	mb_path	name;
-	double	distancelateral;
-	double	distancetopo;
-	int	npoints;
-	int	npoints_alloc;
-	int	nroutepoint;
-	int	*waypoint;
-	double	*distlateral;
-	double	*disttopo;
-	struct mbview_pointw_struct *points;
-	struct mbview_linesegmentw_struct *segments;
-	};
-
-struct mbview_nav_struct {
-	int	color;
-	int	size;
-	mb_path	name;
-	int	pathstatus;
-	mb_path	pathraw;
-	mb_path	pathprocessed;
-	int	format;
-	int	swathbounds;
-	int	line;
-	int	shot;
-	int	cdp;
-	int	decimation;
-	int	npoints;
-	int	npoints_alloc;
-	int	nselected;
-	struct mbview_navpointw_struct *navpts;
-	struct mbview_linesegmentw_struct *segments;
-	};
-
-struct mbview_vector_struct {
-	int	color;
-	int	size;
-	mb_path	name;
-	int	format;
-	int	npoints;
-	int	npoints_alloc;
-	int	nselected;
-	double	datamin;
-	double	datamax;
-	struct mbview_vectorpointw_struct *vectorpts;
-	struct mbview_linesegmentw_struct *segments;
-	};
-
-struct mbview_profile_struct {
-	int	source;
-	mb_path	source_name;
-	double	length;
-	double	zmin;
-	double	zmax;
-	int	npoints;
-	int	npoints_alloc;
-	struct mbview_profilepoint_struct *points;
-	};
-
-struct mbview_shareddata_struct {
-	/* nav pick */
-	int	navpick_type;
-	struct mbview_pickw_struct navpick;
-
-	/* site data */
-	int	site_mode;
-	int	nsite;
-	int	nsite_alloc;
-	int	site_selected;
-	struct mbview_site_struct *sites;
-
-	/* route data */
-	int	route_mode;
-	int	nroute;
-	int	nroute_alloc;
-	int	route_selected;
-	int	route_point_selected;
-	struct mbview_route_struct *routes;
-
-	/* nav data */
-	int	nav_mode;
-	int	nnav;
-	int	nnav_alloc;
-	int	nav_selected[2];
-	int	nav_point_selected[2];
-	struct mbview_nav_struct *navs;
-
-	/* vector data */
-	int	vector_mode;
-	int	nvector;
-	int	nvector_alloc;
-	int	vector_selected;
-	int	vector_point_selected;
-	struct mbview_vector_struct *vectors;
-	};
-
-struct mbview_struct {
-
-	/* function pointers */
-	int (*mbview_dismiss_notify)(size_t id);
-	void (*mbview_pickonepoint_notify)(size_t id);
-	void (*mbview_picktwopoint_notify)(size_t id);
-	void (*mbview_pickarea_notify)(size_t id);
-	void (*mbview_pickregion_notify)(size_t id);
-	void (*mbview_picksite_notify)(size_t id);
-	void (*mbview_pickroute_notify)(size_t id);
-	void (*mbview_picknav_notify)(size_t id);
-	void (*mbview_pickvector_notify)(size_t id);
-	void (*mbview_sensitivity_notify)(void);
-
-	/* active flag */
-	int	active;
-
-	/* main plot widget controls */
-	mb_path	title;
-	int	xo;
-	int	yo;
-	int	width;
-	int	height;
-	int	lorez_dimension;
-	int	hirez_dimension;
-	int	lorez_navdecimate;
-	int	hirez_navdecimate;
-
-	/* profile plot widget controls */
-	mb_path	prtitle;
-	int	prwidth;
-	int	prheight;
-
-	/* mode controls */
-	int	display_mode;
-	int	mouse_mode;
-	int	grid_mode;
-	int	grid_shade_mode;
-	int	grid_contour_mode;
-
-	/* histogram equalization controls */
-	int	primary_histogram;
-	int	primaryslope_histogram;
-	int	secondary_histogram;
-
-	/* colortable controls */
-	int	primary_colortable;
-	int	primary_colortable_mode;
-	double	primary_colortable_min;
-	double	primary_colortable_max;
-	int	primary_shade_mode;
-	int	slope_colortable;
-	int	slope_colortable_mode;
-	double	slope_colortable_min;
-	double	slope_colortable_max;
-	int	slope_shade_mode;
-	int	secondary_colortable;
-	int	secondary_colortable_mode;
-	double	secondary_colortable_min;
-	double	secondary_colortable_max;
-	int	secondary_shade_mode;
-
-	/* view controls */
-	double	exageration;
-	double	modelelevation3d;
-	double	modelazimuth3d;
-	double	viewelevation3d;
-	double	viewazimuth3d;
-	int	viewbounds[4];
-
-	/* shading controls */
-	double	illuminate_magnitude;
-	double	illuminate_elevation;
-	double	illuminate_azimuth;
-	double	slope_magnitude;
-	double	overlay_shade_magnitude;
-	double	overlay_shade_center;
-	int	overlay_shade_mode;
-
-	/* contour controls */
-	double	contour_interval;
-
-	/* profile controls */
-	double	profile_exageration;
-	int	profile_widthfactor;
-	double	profile_slopethreshold;
-
-	/* projection controls */
-	int	primary_grid_projection_mode;
-	mb_path	primary_grid_projection_id;
-	int	secondary_grid_projection_mode;
-	mb_path	secondary_grid_projection_id;
-	int	display_projection_mode;
-	mb_path	display_projection_id;
-
-	/* grid data */
-	float	primary_nodatavalue;
-	int	primary_nxy;
-	int	primary_nx;
-	int	primary_ny;
-	double	primary_min;
-	double	primary_max;
-	double	primary_xmin;
-	double	primary_xmax;
-	double	primary_ymin;
-	double	primary_ymax;
-	double	primary_dx;
-	double	primary_dy;
-	float	*primary_data;
-	float	*primary_x;
-	float	*primary_y;
-	float	*primary_z;
-	float	*primary_dzdx;
-	float	*primary_dzdy;
-	float	*primary_r;
-	float	*primary_g;
-	float	*primary_b;
-	char	*primary_stat_color;
-	char	*primary_stat_z;
-	int	secondary_sameas_primary;
-	float	secondary_nodatavalue;
-	int	secondary_nxy;
-	int	secondary_nx;
-	int	secondary_ny;
-	double	secondary_min;
-	double	secondary_max;
-	double	secondary_xmin;
-	double	secondary_xmax;
-	double	secondary_ymin;
-	double	secondary_ymax;
-	double	secondary_dx;
-	double	secondary_dy;
-	float	*secondary_data;
-
-	/* pick info flag */
-	int	pickinfo_mode;
-
-	/* point and line pick */
-	int	pick_type;
-	struct mbview_pick_struct pick;
-
-	/* area data */
-	int	area_type;
-	int	area_pickendpoint;
-	struct mbview_area_struct area;
-
-	/* region data */
-	int	region_type;
-	int	region_pickcorner;
-	struct mbview_region_struct region;
-
-	/* profile data */
-	struct mbview_profile_struct profile;
-
-	/* global data view modes */
-	int	site_view_mode;
-	int	route_view_mode;
-	int	nav_view_mode;
-	int	navdrape_view_mode;
-	int	vector_view_mode;
-	int	profile_view_mode;
-
-	};
-
-/*--------------------------------------------------------------------*/
-
-/* mb3dsounding data structures */
-struct mb3dsoundings_sounding_struct {
-	int	ifile;
-	int	iping;
-	int	ibeam;
-        int     beamcolor;
-	char	beamflag;
-        char	beamflagorg;
-	double	x;
-	double	y;
-	double	z;
-	float	glx;
-	float	gly;
-	float	glz;
-	int	winx;
-	int	winy;
-};
-
-struct mb3dsoundings_struct {
-	/* location and scale parameters */
-	double	xorigin;
-	double	yorigin;
-	double	zorigin;
-	double	xmin;
-	double	ymin;
-	double	zmin;
-	double	xmax;
-	double	ymax;
-	double	zmax;
-	double	bearing;
-	double	sinbearing;
-	double	cosbearing;
-	double	scale;
-	double	zscale;
-
-	/* sounding data */
-	int	num_soundings;
-	int	num_soundings_unflagged;
-	int	num_soundings_flagged;
-	int	num_soundings_alloc;
-	struct mb3dsoundings_sounding_struct *soundings;
-};
-
-
-/*--------------------------------------------------------------------*/
-
-/* mbview_callbacks.c function prototypes */
-int mbview_startup(int verbose, Widget parent, XtAppContext app, int *error);
-int mbview_init(int verbose, size_t *instance, int *error);
-int mbview_quit(int verbose, int *error);
-int mbview_getdataptr(int verbose, size_t instance, struct mbview_struct **datahandle, int *error);
-int mbview_getsharedptr(int verbose, struct mbview_shareddata_struct **sharedhandle, int *error);
-int mbview_setwindowparms(int verbose, size_t instance,
-			int	(*mbview_dismiss_notify)(size_t),
-			char	*title,
-			int	xo,
-			int	yo,
-			int	width,
-			int	height,
-			int	lorez_dimension,
-			int	hirez_dimension,
-			int	lorez_navdecimate,
-			int	hirez_navdecimate,
-			int	*error);
-int mbview_setviewcontrols(int verbose, size_t instance,
-			int	display_mode,
-			int	mouse_mode,
-			int	grid_mode,
-			int	primary_histogram,
-			int	primaryslope_histogram,
-			int	secondary_histogram,
-			int	primary_shade_mode,
-			int	slope_shade_mode,
-			int	secondary_shade_mode,
-			int	grid_contour_mode,
-			int	site_view_mode,
-			int	route_view_mode,
-			int	nav_view_mode,
-			int	navdrape_view_mode,
-			int	vector_view_mode,
-			double	exageration,
-			double	modelelevation3d,
-			double	modelazimuth3d,
-			double	viewelevation3d,
-			double	viewazimuth3d,
-			double	illuminate_magnitude,
-			double	illuminate_elevation,
-			double	illuminate_azimuth,
-			double	slope_magnitude,
-			double	overlay_shade_magnitude,
-			double	overlay_shade_center,
-			int	overlay_shade_mode,
-			double	contour_interval,
-			int	display_projection_mode,
-			char	*display_projection_id,
-			int *error);
-int mbview_open(int verbose, size_t instance, int *error);
-int mbview_update(int verbose, size_t instance, int *error);
-int mbview_set_widgets(int verbose, size_t instance, int *error);
-int mbview_addaction(int verbose, size_t instance,
-			void	(mbview_action_notify)(Widget, XtPointer, XtPointer),
-			char	*label,
-			int	sensitive,
-			int *error);
-int mbview_addpicknotify(int verbose, size_t instance,
-			int	picktype,
-			void	(mbview_pick_notify)(size_t),
-			int *error);
-int mbview_setsensitivitynotify(int verbose, size_t instance,
-			void	(mbview_sensitivity_notify)(),
-			int *error);
-void mbview_resize( Widget w, XtPointer client_data, XEvent *event, Boolean *unused);
-int mbview_destroy(int verbose, size_t instance, int destroywidgets, int *error);
-int mbview_quit(int verbose, int *error);
-int do_mbview_message_on(char *message, size_t instance);
-int do_mbview_message_off(size_t instance);
-void set_mbview_label_string(Widget w, String str);
-void set_mbview_label_multiline_string(Widget w, String str);
-
-/* mbview_primary.c function prototypes */
-int mbview_setprimarygrid(int verbose, size_t instance,
-			int	primary_grid_projection_mode,
-			char	*primary_grid_projection_id,
-			float	primary_nodatavalue,
-			int	primary_nx,
-			int	primary_ny,
-			double	primary_min,
-			double	primary_max,
-			double	primary_xmin,
-			double	primary_xmax,
-			double	primary_ymin,
-			double	primary_ymax,
-			double	primary_dx,
-			double	primary_dy,
-			float	*primary_data,
-			int *error);
-int mbview_updateprimarygrid(int verbose, size_t instance,
-			int	primary_nx,
-			int	primary_ny,
-			float	*primary_data,
-			int *error);
-int mbview_updateprimarygridcell(int verbose, size_t instance,
-			int	primary_ix,
-			int	primary_jy,
-			float	value,
-			int *error);
-int mbview_setprimarycolortable(int verbose, size_t instance,
-			int	primary_colortable,
-			int	primary_colortable_mode,
-			double	primary_colortable_min,
-			double	primary_colortable_max,
-			int *error);
-int mbview_setslopecolortable(int verbose, size_t instance,
-			int	slope_colortable,
-			int	slope_colortable_mode,
-			double	slope_colortable_min,
-			double	slope_colortable_max,
-			int *error);
-
-/* mbview_secondary.c function prototypes */
-int mbview_setsecondarygrid(int verbose, size_t instance,
-			int	secondary_grid_projection_mode,
-			char	*secondary_grid_projection_id,
-			float	secondary_nodatavalue,
-			int	secondary_nx,
-			int	secondary_ny,
-			double	secondary_min,
-			double	secondary_max,
-			double	secondary_xmin,
-			double	secondary_xmax,
-			double	secondary_ymin,
-			double	secondary_ymax,
-			double	secondary_dx,
-			double	secondary_dy,
-			float	*secondary_data,
-			int *error);
-int mbview_updatesecondarygrid(int verbose, size_t instance,
-			int	secondary_nx,
-			int	secondary_ny,
-			float	*secondary_data,
-			int *error);
-int mbview_updatesecondarygridcell(int verbose, size_t instance,
-			int	primary_ix,
-			int	primary_jy,
-			float	value,
-			int *error);
-int mbview_setsecondarycolortable(int verbose, size_t instance,
-			int	secondary_colortable,
-			int	secondary_colortable_mode,
-			double	secondary_colortable_min,
-			double	secondary_colortable_max,
-			double	overlay_shade_magnitude,
-			double	overlay_shade_center,
-			int	overlay_shade_mode,
-			int *error);
-int mbview_setsecondaryname(int verbose, size_t instance,
-			char *name, int *error);
-
-/* mbview_process.c function prototypes */
-int mbview_projectdata(size_t instance);
-int mbview_projectforward(size_t instance, int needlonlat,
-				double xgrid, double ygrid, double zdata,
-				double *xlon, double *ylat,
-				double *xdisplay, double *ydisplay, double *zdisplay);
-int mbview_projectinverse(size_t instance, int needlonlat,
-				double xdisplay, double ydisplay,double zdisplay,
-				double *xlon, double *ylat,
-				double *xgrid, double *ygrid);
-int mbview_projectfromlonlat(size_t instance,
-				double xlon, double ylat, double zdata,
-				double *xgrid, double *ygrid,
-				double *xdisplay, double *ydisplay, double *zdisplay);
-int mbview_projectgrid2ll(size_t instance,
-				double xgrid, double ygrid,
-				double *xlon, double *ylat);
-int mbview_projectll2xygrid(size_t instance,
-				double xlon, double ylat,
-				double *xgrid, double *ygrid);
-int mbview_projectll2xyzgrid(size_t instance,
-				double xlon, double ylat,
-				double *xgrid, double *ygrid, double *zdata);
-int mbview_projectll2display(size_t instance,
-				double xlon, double ylat, double zdata,
-				double *xdisplay, double *ydisplay, double *zdisplay);
-int mbview_projectdisplay2ll(size_t instance,
-				double xdisplay, double ydisplay, double zdisplay,
-				double *xlon, double *ylat);
-int mbview_projectdistance(size_t instance,
-				double xlon1, double ylat1, double zdata1,
-				double xlon2, double ylat2, double zdata2,
-				double *distancelateral,
-				double *distanceoverground,
-				double *slope);
-int mbview_getzdata(size_t instance,
-			double xgrid, double ygrid,
-			int *found, double *zdata);
-int mbview_getzdata(size_t instance,
-			double xgrid, double ygrid,
-			int *found, double *zdata);
-
-/* mbview_plot.c function prototypes */
-int mbview_reset_glx(size_t instance);
-int mbview_drawdata(size_t instance, int rez);
-int mbview_plotlowall(size_t instance);
-int mbview_plotlowhighall(size_t instance);
-int mbview_plothighall(size_t instance);
-int mbview_plotlow(size_t instance);
-int mbview_plotlowhigh(size_t instance);
-int mbview_plothigh(size_t instance);
-int mbview_plotfull(size_t instance);
-int mbview_plot(size_t instance, int rez);
-int mbview_drapesegment(size_t instance, struct mbview_linesegment_struct *seg);
-
-/* mbview_pick.c function prototypes */
-
-/* mbview_nav.c function prototypes */
-int mbview_getnavcount(int verbose, size_t instance,
-			int *nnav,
-			int *error);
-int mbview_getnavpointcount(int verbose, size_t instance,
-			int	nav,
-			int	*npoint,
-			int	*nintpoint,
-			int *error);
-int mbview_allocnavarrays(int verbose,
-			int	npointtotal,
-			double	**time_d,
-			double	**navlon,
-			double	**navlat,
-			double	**navz,
-			double	**heading,
-			double	**speed,
-			double	**navportlon,
-			double	**navportlat,
-			double	**navstbdlon,
-			double	**navstbdlat,
-			int	**line,
-			int	**shot,
-			int	**cdp,
-			int 	*error);
-int mbview_freenavarrays(int verbose,
-			double	**time_d,
-			double	**navlon,
-			double	**navlat,
-			double	**navz,
-			double	**heading,
-			double	**speed,
-			double	**navportlon,
-			double	**navportlat,
-			double	**navstbdlon,
-			double	**navstbdlat,
-			int	**line,
-			int	**shot,
-			int	**cdp,
-			int *error);
-int mbview_addnav(int verbose, size_t instance,
-			int	npoint,
-			double	*time_d,
-			double	*navlon,
-			double	*navlat,
-			double	*navz,
-			double	*heading,
-			double	*speed,
-			double	*navportlon,
-			double	*navportlat,
-			double	*navstbdlon,
-			double	*navstbdlat,
-			int	*line,
-			int	*shot,
-			int	*cdp,
-			int	navcolor,
-			int	navsize,
-			mb_path	navname,
-			int	navpathstatus,
-			mb_path	navpathraw,
-			mb_path	navpathprocessed,
-			int	navformat,
-			int	navswathbounds,
-			int	navline,
-			int	navshot,
-			int	navcdp,
-			int	decimation,
-			int *error);
-int mbview_enableviewnavs(int verbose, size_t instance,
-			int *error);
-
-/* mbview_vector.c function prototypes */
-int mbview_getvectorcount(int verbose, size_t instance,
-			int *nvec,
-			int *error);
-int mbview_getvectorpointcount(int verbose, size_t instance,
-			int	vec,
-			int	*npoint,
-			int	*nintpoint,
-			int *error);
-int mbview_allocvectorarrays(int verbose,
-			int	npointtotal,
-			double	**veclon,
-			double	**veclat,
-			double	**vecz,
-			double	**vecdata,
-			int 	*error);
-int mbview_freevectorarrays(int verbose,
-			double	**veclon,
-			double	**veclat,
-			double	**vecz,
-			double	**vecdata,
-			int *error);
-int mbview_addvector(int verbose, size_t instance,
-			int	npoint,
-			double	*veclon,
-			double	*veclat,
-			double	*vecz,
-			double	*vecdata,
-			int	veccolor,
-			int	vecsize,
-			mb_path	vecname,
-			double	vecdatamin,
-			double	vecdatamax,
-			int *error);
-int mbview_enableviewvectors(int verbose, size_t instance,
-			int *error);
-int mbview_pick_vector_select(size_t instance, int select, int which, int xpixel, int ypixel);
-int mbview_vector_delete(size_t instance, int ivec);
-int mbview_drawvectorpick(size_t instance);
-int mbview_drawvector(size_t instance, int rez);
-
-/* mbview_route.c function prototypes */
-int mbview_getroutecount(int verbose, size_t instance,
-			int	*nroute,
-			int *error);
-int mbview_getroutepointcount(int verbose, size_t instance,
-			int	route,
-			int	*npoint,
-			int	*nintpoint,
-			int *error);
-int mbview_getrouteselected(int verbose, size_t instance,
-			int	route,
-			int	*selected,
-			int *error);
-int mbview_getrouteinfo(int verbose, size_t instance,
-			int working_route,
-			int *nroutewaypoint,
-			int *nroutpoint,
-			char *routename,
-			int *routecolor,
-			int *routesize,
-			double *routedistancelateral,
-			double *routedistancetopo,
-			int *error);
-int mbview_allocroutearrays(int verbose,
-			int	npointtotal,
-			double	**routelon,
-			double	**routelat,
-			int	**waypoint,
-			double	**routetopo,
-			double	**routebearing,
-			double	**distlateral,
-			double	**distovertopo,
-			double	**slope,
-			int *error);
-int mbview_freeroutearrays(int verbose,
-			double	**routelon,
-			double	**routelat,
-			int	**waypoint,
-			double	**routetopo,
-			double	**routebearing,
-			double	**distlateral,
-			double	**distovertopo,
-			double	**slope,
-			int *error);
-int mbview_addroute(int verbose, size_t instance,
-			int	npoint,
-			double	*routelon,
-			double	*routelat,
-			int	*waypoint,
-			int	routecolor,
-			int	routesize,
-                        int     routeeditmode,
-			mb_path	routename,
-			int 	*iroute,
-			int *error);
-int mbview_deleteroute(int verbose, size_t instance,
-			int	iroute,
-			int *error);
-int mbview_getroute(int verbose, size_t instance,
-			int	route,
-			int	*npointtotal,
-			double	*routelon,
-			double	*routelat,
-			int	*waypoint,
-			double	*routetopo,
-			double	*routebearing,
-			double	*distlateral,
-			double	*distovertopo,
-			double	*slope,
-			int	*routecolor,
-			int	*routesize,
-			mb_path	routename,
-			int *error);
-int mbview_enableviewroutes(int verbose, size_t instance,
-			int *error);
-int mbview_enableeditroutes(int verbose, size_t instance,
-			int *error);
-int mbview_route_add(size_t instance, int inew, int jnew, int waypoint,
-				double xgrid, double ygrid,
-				double xlon, double ylat, double zdata,
-				double xdisplay, double ydisplay, double zdisplay);
-
-/* mbview_site.c function prototypes */
-int mbview_getsitecount(int verbose, size_t instance,
-			int	*nsite,
-			int *error);
-int mbview_allocsitearrays(int verbose,
-			int	nsite,
-			double	**sitelon,
-			double	**sitelat,
-			double	**sitetopo,
-			int	**sitecolor,
-			int	**sitesize,
-			mb_path	**sitename,
-			int *error);
-int mbview_freesitearrays(int verbose,
-			double	**sitelon,
-			double	**sitelat,
-			double	**sitetopo,
-			int	**sitecolor,
-			int	**sitesize,
-			mb_path	**sitename,
-			int *error);
-int mbview_addsites(int verbose, size_t instance,
-			int	nsite,
-			double	*sitelon,
-			double	*sitelat,
-			double	*sitetopo,
-			int	*sitecolor,
-			int	*sitesize,
-			mb_path	*sitename,
-			int *error);
-int mbview_getsites(int verbose, size_t instance,
-			int	*nsite,
-			double	*sitelon,
-			double	*sitelat,
-			double	*sitetopo,
-			int	*sitecolor,
-			int	*sitesize,
-			mb_path	*sitename,
-			int *error);
-int mbview_enableviewsites(int verbose, size_t instance,
-			int *error);
-int mbview_enableeditsites(int verbose, size_t instance,
-			int *error);
-
-/* mbview_profile.c function prototypes */
-int mbview_getprofilecount(int verbose, size_t instance,
-			int *npoints,
-			int *error);
-int mbview_allocprofilepoints(int verbose,
-			int	npoints,
-			struct mbview_profilepoint_struct **points,
-			int 	*error);
-int mbview_freeprofilepoints(int verbose,
-			double	**points,
-			int *error);
-int mbview_allocprofilearrays(int verbose,
-			int	npoints,
-			double	**distance,
-			double	**zdata,
-			int	**boundary,
-			double	**xlon,
-			double	**ylat,
-			double	**distovertopo,
-			double	**bearing,
-			double	**slope,
-			int 	*error);
-int mbview_freeprofilearrays(int verbose,
-			double	**distance,
-			double	**zdata,
-			int	**boundary,
-			double	**xlon,
-			double	**ylat,
-			double	**distovertopo,
-			double	**bearing,
-			double	**slope,
-			int *error);
-int mbview_getprofile(int verbose, size_t instance,
-			mb_path	source_name,
-			double	*length,
-			double	*zmin,
-			double	*zmax,
-			int	*npoints,
-			double	*distance,
-			double	*zdata,
-			int	*boundary,
-			double	*xlon,
-			double	*ylat,
-			double	*distovertopo,
-			double	*bearing,
-			double	*slope,
-			int *error);
-
-/*--------------------------------------------------------------------*/
-
-/* mb3dsounding API functions */
-int mb3dsoundings_startup(int verbose, Widget parent, XtAppContext app, int *error);
-int mb3dsoundings_open(int verbose, struct mb3dsoundings_struct *soundingdata, int *error);
-int mb3dsoundings_end(int verbose, int *error);
-int mb3dsoundings_set_dismiss_notify(int verbose, void (dismiss_notify)(), int *error);
-int mb3dsoundings_set_edit_notify(int verbose, void (edit_notify)(int, int, int, char, int), int *error);
-int mb3dsoundings_set_info_notify(int verbose, void (edit_notify)(int, int, int, char *), int *error);
-int mb3dsoundings_set_bias_notify(int verbose, void (bias_notify)(double, double, double, double), int *error);
-int mb3dsoundings_set_biasapply_notify(int verbose, void (biasapply_notify)(double, double, double, double), int *error);
-int mb3dsoundings_set_colorsoundings_notify(int verbose, void (colorsoundings_notify)(int), int *error);
-int mb3dsoundings_plot(int verbose, int *error);
-int mb3dsoundings_get_bias_values(int verbose, double *rollbias, double *pitchbias, double *headingbias, double *timelag, int *error);
-/*--------------------------------------------------------------------*/
diff --git a/src/mbview/mbview.uil b/src/mbview/mbview.uil
deleted file mode 100644
index 69671d5..0000000
--- a/src/mbview/mbview.uil
+++ /dev/null
@@ -1,5313 +0,0 @@
-/*
- * Generated by the ICS builderXcessory (BX).
- *
- *
- * BuilderXcessory Version 6.1.3.
- *
- * Identification: 
- */
-module main_uil
-version = 'V2.1'
-names = case_sensitive
-!(BX) bx_info("c_options", "")
-!(BX) bx_info("c_libs", "-L/usr/lib/Motif1.2 -lXm -lXt -lX11")
-!(BX) bx_info("c_cflags", "-Aa -I/usr/include/Motif1.2 -I/usr/include/X11R5")
-!(BX) bx_info("c_cc", "cc")
-!(BX) bx_info("c_excludeungenerated", "false")
-!(BX) bx_info("c_target", "main-c")
-!(BX) bx_info("c_information", "")
-!(BX) bx_info("c_user_main_loop", "", false)
-!(BX) bx_info("c_ignore_shell_geometry", "false")
-!(BX) bx_info("c_visible_windows_only", "false")
-!(BX) bx_info("c_rm_exp_callbacks", "false")
-!(BX) bx_info("c_reverse_dialogs", "true")
-!(BX) bx_info("c_dialogs_in_routine", "true")
-!(BX) bx_info("c_unmanage_dialogs", "true")
-!(BX) bx_info("c_use_locales", "false")
-!(BX) bx_info("c_ansi", "true")
-!(BX) bx_info("c_name", "MB-System")
-!(BX) bx_info("c_class", "MB-System")
-!(BX) bx_info("c_app_defaults", "app-defaults", true)
-!(BX) bx_info("c_utilities", "bxutils-c.c", true)
-!(BX) bx_info("c_constants", "creation-c.h", true)
-!(BX) bx_info("c_callbacks", "mbview_callbacks.c", true)
-!(BX) bx_info("c_creation", "creation-c.c", true)
-!(BX) bx_info("c_main", "main-c.c", true)
-!(BX) bx_info("c_acinclude_m4", "acinclude.m4", false)
-!(BX) bx_info("c_configure_in", "configure.in", false)
-!(BX) bx_info("c_makefile_am", "Makefile.am", false)
-!(BX) bx_info("c_cvsmake", "CVSMake", false)
-!(BX) bx_info("c_makefile", "makefile-c", true)
-!(BX) bx_info("c_imakefile", "Imakefile", true)
-!(BX) bx_info("c_dirpath", "")
-!(BX) bx_info("include_path", ".", false)
-!(BX) bx_info("xrunner_command", "$(M_ROOT)/arch/X11.5/Xm1.2/mic_xm.o", false)
-!(BX) bx_info("purify_command", "purify", false)
-!(BX) bx_info("system_directory", "/opt/bx-6.1")
-!(BX) bx_info("builder_version", "BuilderXcessory Version 6.1.3")
-!(BX) bx_info("build_lang", "C")
-!(BX) bx_info("default_cpp_args", "")
-!(BX) bx_info("new_mrm_style", "true")
-!(BX) bx_info("c_wrap_lines", "false")
-!(BX) bx_info("uil_wrap_lines", "true")
-!(BX) bx_info("integrate_purify", "false")
-!(BX) bx_info("purify_command", "purify")
-!(BX) bx_info("integrate_xrunner", "false")
-
-procedure BxGlobalWidgetId;
-identifier BXG_mbview_mbgrdviz;
-procedure BxExitCB(integer);
-procedure do_mbview_2dparmsapply();
-procedure do_mbview_2dparmspopdown();
-procedure do_mbview_2dparmspopup();
-procedure do_mbview_3dparmsapply();
-procedure do_mbview_3dparmspopdown();
-procedure do_mbview_3dparmspopup();
-procedure do_mbview_aboutpopdown();
-procedure do_mbview_aboutpopup();
-procedure do_mbview_clearpicks();
-procedure do_mbview_colorboundsapply();
-procedure do_mbview_colorboundspopdown();
-procedure do_mbview_colorboundspopup();
-procedure do_mbview_colortable_bright();
-procedure do_mbview_colortable_flat();
-procedure do_mbview_colortable_gray();
-procedure do_mbview_colortable_haxby();
-procedure do_mbview_colortable_muted();
-procedure do_mbview_colortable_sealevel1();
-procedure do_mbview_colortable_sealevel2();
-procedure do_mbview_data_primary();
-procedure do_mbview_data_primaryslope();
-procedure do_mbview_data_secondary();
-procedure do_mbview_dismiss();
-procedure do_mbview_display_2D();
-procedure do_mbview_display_3D();
-procedure do_mbview_display_geographic();
-procedure do_mbview_display_spheroid();
-procedure do_mbview_display_utm();
-procedure do_mbview_full_render();
-procedure do_mbview_goaway();
-procedure do_mbview_histogram();
-procedure do_mbview_mouse_mode();
-procedure do_mbview_mouse_rmode();
-procedure do_mbview_nav();
-procedure do_mbview_navdrape();
-procedure do_mbview_navlist_delete();
-procedure do_mbview_navlist_popdown();
-procedure do_mbview_navlistpopup();
-procedure do_mbview_navlistselect();
-procedure do_mbview_overlay_contour();
-procedure do_mbview_overlay_illumination();
-procedure do_mbview_overlay_none();
-procedure do_mbview_overlay_secondary();
-procedure do_mbview_overlay_slope();
-procedure do_mbview_profile_dismiss();
-procedure do_mbview_profile_exager();
-procedure do_mbview_profile_slope();
-procedure do_mbview_profile_width();
-procedure do_mbview_projection_popdown();
-procedure do_mbview_projection_popup();
-procedure do_mbview_reset_view();
-procedure do_mbview_resolutionchange();
-procedure do_mbview_resolutionpopdown();
-procedure do_mbview_resolutionpopup();
-procedure do_mbview_route();
-procedure do_mbview_routelist_delete();
-procedure do_mbview_routelist_popdown();
-procedure do_mbview_routelistpopup();
-procedure do_mbview_routelistselect();
-procedure do_mbview_shadeparmsapply();
-procedure do_mbview_shadeparmspopdown();
-procedure do_mbview_shadeparmspopup();
-procedure do_mbview_site();
-procedure do_mbview_sitelist_delete();
-procedure do_mbview_sitelist_popdown();
-procedure do_mbview_sitelistpopup();
-procedure do_mbview_sitelistselect();
-procedure do_mbview_vector();
-procedure do_mbview_view_profile();
-
-list BaseStyle : arguments {
-};
-
-list BaseStyleReasons : callbacks {
-};
-
-!(BX)list BaseStyleHandlers : handlers {
-!(BX)};
-
-list Style_use : arguments {
-        arguments BaseStyle;
-        XmNfontList = font_table(
-		font('-*-helvetica-bold-r-*-*-*-140-75-75-*-*-iso8859-1'));
-};
-
-list Style_useReasons : callbacks {
-        callbacks BaseStyleReasons;
-};
-
-!(BX)list Style_useHandlers : handlers {
-!(BX)    handlers BaseStyleHandlers;
-!(BX)};
-
-
-object mB3DNavList : XmFormDialog widget {
-    arguments {
-!(BX) BxNclass = "MB3DNavList";
-!(BX) BxNsubclassDerived = "False";
-        arguments Style_use;
-        XmNresizePolicy = XmRESIZE_GROW;
-        XmNx = 1181;
-        XmNy = 1237;
-        XmNwidth = 200;
-        XmNheight = 200;
-    };
-    controls {
-         managed XmLabel mB3DNavList_mbview_navlist_label;
-         managed XmPushButton mB3DNavList_mbview_pushButton_navlist_delete;
-         managed XmPushButton mB3DNavList_mbview_pushButton_navlist_dismiss;
-         managed XmScrolledWindow mB3DNavList_mbview_scrolledWindow_navlist;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-!(BX)object mbview_dialogShell_navlist : XmDialogShell widget {
-!(BX)    arguments {
-!(BX)        arguments Style_use;
-!(BX)        XmNtitle = "Navigation List";
-!(BX)        XmNwidth = 200;
-!(BX)        XmNheight = 200;
-!(BX)    };
-!(BX)    controls {
-!(BX)         managed XmFormDialog mB3DNavList;
-!(BX)    };
-!(BX)    callbacks {
-!(BX)        callbacks Style_useReasons;
-!(BX)    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-!(BX)};
-
-object mB3DRouteList : XmFormDialog widget {
-    arguments {
-!(BX) BxNclass = "MB3DRouteList";
-!(BX) BxNsubclassDerived = "False";
-        arguments Style_use;
-        XmNresizePolicy = XmRESIZE_GROW;
-        XmNx = 1181;
-        XmNy = 1237;
-        XmNwidth = 200;
-        XmNheight = 200;
-    };
-    controls {
-         managed XmLabel mB3DRouteList_mbview_routelist_label;
-         managed XmPushButton mB3DRouteList_mbview_pushButton_routelist_delete;
-         managed XmPushButton mB3DRouteList_mbview_pushButton_routelist_dismiss;
-         managed XmScrolledWindow mB3DRouteList_mbview_scrolledWindow_routelist;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-!(BX)object mbview_dialogShell_routelist : XmDialogShell widget {
-!(BX)    arguments {
-!(BX)        arguments Style_use;
-!(BX)        XmNtitle = "Route List";
-!(BX)        XmNwidth = 200;
-!(BX)        XmNheight = 200;
-!(BX)    };
-!(BX)    controls {
-!(BX)         managed XmFormDialog mB3DRouteList;
-!(BX)    };
-!(BX)    callbacks {
-!(BX)        callbacks Style_useReasons;
-!(BX)    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-!(BX)};
-
-object mB3DSiteList : XmFormDialog widget {
-    arguments {
-!(BX) BxNclass = "MB3DSiteList";
-!(BX) BxNsubclassDerived = "False";
-        arguments Style_use;
-        XmNresizePolicy = XmRESIZE_GROW;
-        XmNx = 1181;
-        XmNy = 1237;
-        XmNwidth = 200;
-        XmNheight = 200;
-    };
-    controls {
-         managed XmPushButton mB3DSiteList_mbview_pushButton_sitelist_dismiss;
-         managed XmPushButton mB3DSiteList_mbview_pushButton_sitelist_delete;
-         managed XmLabel mB3DSiteList_mbview_sitelist_label;
-         managed XmScrolledWindow mB3DSiteList_mbview_scrolledWindow_sitelist;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-!(BX)object mbview_dialogShell_sitelist : XmDialogShell widget {
-!(BX)    arguments {
-!(BX)        arguments Style_use;
-!(BX)        XmNtitle = "Site List";
-!(BX)        XmNwidth = 200;
-!(BX)        XmNheight = 200;
-!(BX)    };
-!(BX)    controls {
-!(BX)         managed XmFormDialog mB3DSiteList;
-!(BX)    };
-!(BX)    callbacks {
-!(BX)        callbacks Style_useReasons;
-!(BX)    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-!(BX)};
-
-object mbview_mbgrdviz : XmBulletinBoardDialog widget {
-    arguments {
-!(BX) BxNclass = "MB3DView";
-!(BX) BxNsubclassDerived = "False";
-        arguments Style_use;
-        XmNborderWidth = 0;
-        XmNresizePolicy = XmRESIZE_GROW;
-        XmNx = 889;
-        XmNy = 879;
-        XmNwidth = 783;
-        XmNheight = 915;
-    };
-    controls {
-         managed XmPushButton mB3DView_mbview_pushButton_clearpicks;
-         managed XmPushButton mB3DView_mbview_pushButton_reset;
-         managed XmRadioBox mB3DView_mbview_radioBox_mouse;
-         managed XmLabel mB3DView_mbview_label_status;
-         managed XmPushButton mB3DView_mbview_pushButton_fullrez;
-         managed XmLabel mB3DView_mbview_label_pickinfo;
-         managed XmMenuBar mbview_menuBar_mbview;
-         managed XmLabel mB3DView_mbview_label_mouse;
-         managed XmDrawingArea mbview_drawingArea_mbview;
-!(BX)         unmanaged XmDialogShell mB3DView_mbview_dialogShell_colorbounds;
-!(BX)         unmanaged XmDialogShell mB3DView_mbview_dialogShell_resolution;
-!(BX)         unmanaged XmDialogShell mB3DView_mbview_dialogShell_message;
-!(BX)         unmanaged XmDialogShell mB3DView_mbview_dialogShell_about;
-!(BX)         unmanaged XmDialogShell mB3DView_mbview_dialogShell_shadeparms;
-!(BX)         unmanaged XmDialogShell mB3DView_mbview_dialogShell_3dparms;
-!(BX)         unmanaged XmDialogShell mB3DView_mbview_dialogShell_2dparms;
-!(BX)         unmanaged XmDialogShell mB3DView_mbview_dialogShell_projection;
-!(BX)         unmanaged XmDialogShell mB3DView_mbview_dialogShell_profile;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNdestroyCallback = procedure do_mbview_goaway();
-        MrmNcreateCallback = procedure BxGlobalWidgetId(BXG_mbview_mbgrdviz);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-!(BX)object dialogShell_mbview : XmDialogShell widget {
-!(BX)    arguments {
-!(BX)        arguments Style_use;
-!(BX)        XmNtitle = "MBview in MBgrdviz";
-!(BX)        XmNwidth = 783;
-!(BX)        XmNheight = 915;
-!(BX)    };
-!(BX)    controls {
-!(BX)         managed XmBulletinBoardDialog mbview_mbgrdviz;
-!(BX)    };
-!(BX)    callbacks {
-!(BX)        callbacks Style_useReasons;
-!(BX)    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-!(BX)};
-
-object mainWindow_mbgrdviz : XmMainWindow widget {
-    arguments {
-        arguments Style_use;
-        XmNx = 119;
-        XmNy = 214;
-        XmNwidth = 197;
-        XmNheight = 104;
-    };
-    controls {
-        Xm_Separator1 {
-            arguments {
-                arguments Style_use;
-            };
-            callbacks {
-                    callbacks Style_useReasons;
-            };
-!(BX)            handlers {
-!(BX)                handlers Style_useHandlers;
-!(BX)            };
-        };
-        Xm_Separator2 {
-            arguments {
-                arguments Style_use;
-            };
-            callbacks {
-                    callbacks Style_useReasons;
-            };
-!(BX)            handlers {
-!(BX)                handlers Style_useHandlers;
-!(BX)            };
-        };
-        Xm_Separator3 {
-            arguments {
-                arguments Style_use;
-            };
-            callbacks {
-                    callbacks Style_useReasons;
-            };
-!(BX)            handlers {
-!(BX)                handlers Style_useHandlers;
-!(BX)            };
-        };
-!(BX)         unmanaged XmDialogShell mbview_dialogShell_navlist;
-!(BX)         unmanaged XmDialogShell mbview_dialogShell_routelist;
-!(BX)         unmanaged XmDialogShell mbview_dialogShell_sitelist;
-!(BX)         unmanaged XmDialogShell dialogShell_mbview;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNdestroyCallback = procedure BxExitCB(0);
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-!(BX)object topLevelShell : TopLevelShell widget {
-!(BX)    arguments {
-!(BX)        arguments Style_use;
-!(BX)        XmNtitle = "MBgrdviz";
-!(BX)        XmNx = 119;
-!(BX)        XmNy = 214;
-!(BX)        XmNwidth = 197;
-!(BX)        XmNheight = 104;
-!(BX)    };
-!(BX)    controls {
-!(BX)         managed XmMainWindow mainWindow_mbgrdviz;
-!(BX)    };
-!(BX)    callbacks {
-!(BX)        callbacks Style_useReasons;
-!(BX)    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-!(BX)};
-
-object mB3DSiteList_mbview_list_sitelist : XmList widget {
-    arguments {
-        arguments Style_use;
-        XmNselectionPolicy = XmEXTENDED_SELECT;
-        XmNwidth = 390;
-        XmNheight = 180;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNsingleSelectionCallback = procedure do_mbview_sitelistselect();
-        XmNextendedSelectionCallback = procedure do_mbview_sitelistselect();
-        XmNbrowseSelectionCallback = procedure do_mbview_sitelistselect();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DSiteList_mbview_scrolledWindow_sitelist : XmScrolledWindow widget {
-    arguments {
-        arguments Style_use;
-        XmNscrollingPolicy = XmAPPLICATION_DEFINED;
-        XmNtopAttachment = XmATTACH_WIDGET;
-        XmNrightAttachment = XmATTACH_FORM;
-        XmNleftAttachment = XmATTACH_FORM;
-        XmNbottomAttachment = XmATTACH_FORM;
-        XmNbottomOffset = 60;
-        XmNleftOffset = 10;
-        XmNrightOffset = 11;
-        XmNtopOffset = 6;
-        XmNtopWidget = XmLabel mB3DSiteList_mbview_sitelist_label;
-        XmNx = 10;
-        XmNy = 46;
-        XmNwidth = 390;
-        XmNheight = 180;
-    };
-    controls {
-         managed XmList mB3DSiteList_mbview_list_sitelist;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DSiteList_mbview_sitelist_label : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNlabelString = compound_string("Site List:");
-        XmNrightAttachment = XmATTACH_FORM;
-        XmNleftAttachment = XmATTACH_FORM;
-        XmNleftOffset = 10;
-        XmNrightOffset = 11;
-        XmNtopOffset = 10;
-        XmNx = 10;
-        XmNy = 10;
-        XmNwidth = 390;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DSiteList_mbview_pushButton_sitelist_delete : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Delete Selected Sites");
-        XmNtopAttachment = XmATTACH_NONE;
-        XmNleftAttachment = XmATTACH_FORM;
-        XmNbottomAttachment = XmATTACH_FORM;
-        XmNbottomOffset = 16;
-        XmNleftOffset = 10;
-        XmNx = 10;
-        XmNy = 240;
-        XmNwidth = 170;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNactivateCallback = procedure do_mbview_sitelist_delete();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DSiteList_mbview_pushButton_sitelist_dismiss : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Dismiss");
-        XmNtopAttachment = XmATTACH_NONE;
-        XmNrightAttachment = XmATTACH_FORM;
-        XmNleftAttachment = XmATTACH_NONE;
-        XmNbottomAttachment = XmATTACH_FORM;
-        XmNbottomOffset = 16;
-        XmNrightOffset = 11;
-        XmNx = 290;
-        XmNy = 240;
-        XmNwidth = 110;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNactivateCallback = procedure do_mbview_sitelist_popdown();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DSiteList_mbview_form_sitelist : XmForm widget {
-    arguments {
-!(BX) BxNclassOnly = "MB3DSiteList";
-!(BX) BxNsubclassDerived = "False";
-!(BX) BxNclassOnlyFile = "False";
-!(BX) BxNbaseInclude = asciz_string_table('');
-!(BX) BxNderivedInclude = asciz_string_table('');
-!(BX) BxNderived = "MB3DSiteListDerived";
-!(BX) BxNfilebase = "MB3DSiteListDerived";
-!(BX) BxNclassFilebase = "MB3DSiteList";
-!(BX) BxNclassGeometry = "411x286+87+496";
-!(BX) BxNgenerate = "True";
-!(BX) BxNreference = "True";
-!(BX) BxNpaletteGroup = "Project Classes";
-!(BX) BxNpaletteName = "MB3DSiteList";
-!(BX) BxNpaletteGeom = "+0+0";
-        arguments Style_use;
-        XmNresizePolicy = XmRESIZE_GROW;
-        XmNx = 87;
-        XmNy = 496;
-        XmNwidth = 411;
-        XmNheight = 286;
-    };
-    controls {
-         managed XmPushButton mB3DSiteList_mbview_pushButton_sitelist_dismiss;
-         managed XmPushButton mB3DSiteList_mbview_pushButton_sitelist_delete;
-         managed XmLabel mB3DSiteList_mbview_sitelist_label;
-         managed XmScrolledWindow mB3DSiteList_mbview_scrolledWindow_sitelist;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DRouteList_mbview_list_routelist : XmList widget {
-    arguments {
-        arguments Style_use;
-        XmNselectionPolicy = XmEXTENDED_SELECT;
-        XmNwidth = 390;
-        XmNheight = 150;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNsingleSelectionCallback = procedure do_mbview_routelistselect();
-        XmNextendedSelectionCallback = procedure do_mbview_routelistselect();
-        XmNbrowseSelectionCallback = procedure do_mbview_routelistselect();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DRouteList_mbview_scrolledWindow_routelist : XmScrolledWindow widget {
-    arguments {
-        arguments Style_use;
-        XmNscrollingPolicy = XmAPPLICATION_DEFINED;
-        XmNtopAttachment = XmATTACH_WIDGET;
-        XmNrightAttachment = XmATTACH_FORM;
-        XmNleftAttachment = XmATTACH_FORM;
-        XmNbottomAttachment = XmATTACH_FORM;
-        XmNbottomOffset = 49;
-        XmNleftOffset = 10;
-        XmNrightOffset = 15;
-        XmNtopOffset = 0;
-        XmNtopWidget = XmLabel mB3DRouteList_mbview_routelist_label;
-        XmNx = 10;
-        XmNy = 40;
-        XmNwidth = 390;
-        XmNheight = 150;
-    };
-    controls {
-         managed XmList mB3DRouteList_mbview_list_routelist;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DRouteList_mbview_pushButton_routelist_dismiss : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Dismiss");
-        XmNtopAttachment = XmATTACH_NONE;
-        XmNrightAttachment = XmATTACH_FORM;
-        XmNleftAttachment = XmATTACH_NONE;
-        XmNbottomAttachment = XmATTACH_FORM;
-        XmNbottomOffset = 9;
-        XmNrightOffset = 15;
-        XmNx = 290;
-        XmNy = 200;
-        XmNwidth = 110;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNactivateCallback = procedure do_mbview_routelist_popdown();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DRouteList_mbview_pushButton_routelist_delete : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Delete Selected Routes");
-        XmNtopAttachment = XmATTACH_NONE;
-        XmNleftAttachment = XmATTACH_FORM;
-        XmNbottomAttachment = XmATTACH_FORM;
-        XmNbottomOffset = 9;
-        XmNleftOffset = 10;
-        XmNx = 10;
-        XmNy = 200;
-        XmNwidth = 170;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNactivateCallback = procedure do_mbview_routelist_delete();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DRouteList_mbview_routelist_label : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNlabelString = compound_string("Route List:");
-        XmNrightAttachment = XmATTACH_FORM;
-        XmNleftAttachment = XmATTACH_FORM;
-        XmNleftOffset = 10;
-        XmNrightOffset = 15;
-        XmNtopOffset = 10;
-        XmNx = 10;
-        XmNy = 10;
-        XmNwidth = 390;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DRouteList_mbview_form_routelist : XmForm widget {
-    arguments {
-!(BX) BxNclassOnly = "MB3DRouteList";
-!(BX) BxNsubclassDerived = "False";
-!(BX) BxNclassOnlyFile = "False";
-!(BX) BxNbaseInclude = asciz_string_table('');
-!(BX) BxNderivedInclude = asciz_string_table('');
-!(BX) BxNderived = "MB3DRouteListDerived";
-!(BX) BxNfilebase = "MB3DRouteListDerived";
-!(BX) BxNclassFilebase = "MB3DRouteList";
-!(BX) BxNclassGeometry = "415x239+72+524";
-!(BX) BxNgenerate = "True";
-!(BX) BxNreference = "True";
-!(BX) BxNpaletteGroup = "Project Classes";
-!(BX) BxNpaletteName = "MB3DRouteList";
-!(BX) BxNpaletteGeom = "+0+0";
-        arguments Style_use;
-        XmNresizePolicy = XmRESIZE_GROW;
-        XmNx = 72;
-        XmNy = 524;
-        XmNwidth = 415;
-        XmNheight = 239;
-    };
-    controls {
-         managed XmLabel mB3DRouteList_mbview_routelist_label;
-         managed XmPushButton mB3DRouteList_mbview_pushButton_routelist_delete;
-         managed XmPushButton mB3DRouteList_mbview_pushButton_routelist_dismiss;
-         managed XmScrolledWindow mB3DRouteList_mbview_scrolledWindow_routelist;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DNavList_mbview_list_navlist : XmList widget {
-    arguments {
-        arguments Style_use;
-        XmNselectionPolicy = XmEXTENDED_SELECT;
-        XmNwidth = 390;
-        XmNheight = 150;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNsingleSelectionCallback = procedure do_mbview_navlistselect();
-        XmNextendedSelectionCallback = procedure do_mbview_navlistselect();
-        XmNbrowseSelectionCallback = procedure do_mbview_navlistselect();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DNavList_mbview_scrolledWindow_navlist : XmScrolledWindow widget {
-    arguments {
-        arguments Style_use;
-        XmNscrollingPolicy = XmAPPLICATION_DEFINED;
-        XmNtopAttachment = XmATTACH_WIDGET;
-        XmNrightAttachment = XmATTACH_FORM;
-        XmNleftAttachment = XmATTACH_FORM;
-        XmNbottomAttachment = XmATTACH_FORM;
-        XmNbottomOffset = 53;
-        XmNleftOffset = 10;
-        XmNrightOffset = 15;
-        XmNtopOffset = 0;
-        XmNtopWidget = XmLabel mB3DNavList_mbview_navlist_label;
-        XmNx = 10;
-        XmNy = 40;
-        XmNwidth = 390;
-        XmNheight = 150;
-    };
-    controls {
-         managed XmList mB3DNavList_mbview_list_navlist;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DNavList_mbview_pushButton_navlist_dismiss : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Dismiss");
-        XmNtopAttachment = XmATTACH_NONE;
-        XmNrightAttachment = XmATTACH_FORM;
-        XmNleftAttachment = XmATTACH_NONE;
-        XmNbottomAttachment = XmATTACH_FORM;
-        XmNbottomOffset = 13;
-        XmNrightOffset = 15;
-        XmNx = 290;
-        XmNy = 200;
-        XmNwidth = 110;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNactivateCallback = procedure do_mbview_navlist_popdown();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DNavList_mbview_pushButton_navlist_delete : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Delete Selected Navigation");
-        XmNtopAttachment = XmATTACH_NONE;
-        XmNleftAttachment = XmATTACH_FORM;
-        XmNbottomAttachment = XmATTACH_FORM;
-        XmNbottomOffset = 13;
-        XmNleftOffset = 10;
-        XmNx = 10;
-        XmNy = 200;
-        XmNwidth = 210;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNactivateCallback = procedure do_mbview_navlist_delete();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DNavList_mbview_navlist_label : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNlabelString = compound_string("Navigation List:");
-        XmNrightAttachment = XmATTACH_FORM;
-        XmNleftAttachment = XmATTACH_FORM;
-        XmNleftOffset = 10;
-        XmNrightOffset = 15;
-        XmNtopOffset = 10;
-        XmNx = 10;
-        XmNy = 10;
-        XmNwidth = 390;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DNavList_mbview_form_navlist : XmForm widget {
-    arguments {
-!(BX) BxNclassOnly = "MB3DNavList";
-!(BX) BxNsubclassDerived = "False";
-!(BX) BxNclassOnlyFile = "False";
-!(BX) BxNbaseInclude = asciz_string_table('');
-!(BX) BxNderivedInclude = asciz_string_table('');
-!(BX) BxNderived = "MB3DNavListDerived";
-!(BX) BxNfilebase = "MB3DNavListDerived";
-!(BX) BxNclassFilebase = "MB3DNavList";
-!(BX) BxNclassGeometry = "415x243+76+548";
-!(BX) BxNgenerate = "True";
-!(BX) BxNreference = "True";
-!(BX) BxNpaletteGroup = "Project Classes";
-!(BX) BxNpaletteName = "MB3DNavList";
-!(BX) BxNpaletteGeom = "+0+0";
-        arguments Style_use;
-        XmNresizePolicy = XmRESIZE_GROW;
-        XmNx = 76;
-        XmNy = 548;
-        XmNwidth = 415;
-        XmNheight = 243;
-    };
-    controls {
-         managed XmLabel mB3DNavList_mbview_navlist_label;
-         managed XmPushButton mB3DNavList_mbview_pushButton_navlist_delete;
-         managed XmPushButton mB3DNavList_mbview_pushButton_navlist_dismiss;
-         managed XmScrolledWindow mB3DNavList_mbview_scrolledWindow_navlist;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_profile_pushButton_dismiss : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Dismiss");
-        XmNtopAttachment = XmATTACH_FORM;
-        XmNleftAttachment = XmATTACH_FORM;
-        XmNbottomAttachment = XmATTACH_NONE;
-        XmNleftOffset = 90;
-        XmNtopOffset = 330;
-        XmNx = 90;
-        XmNy = 330;
-        XmNwidth = 110;
-        XmNheight = 32;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNactivateCallback = procedure do_mbview_profile_dismiss();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_scale_profile_exager : XmScale widget {
-    arguments {
-        arguments Style_use;
-        XmNdecimalPoints = 1;
-        XmNvalue = 10;
-        XmNtitleString = compound_string("Vertical Exageration");
-        XmNshowArrows = TRUE;
-        XmNshowValue = TRUE;
-        XmNorientation = XmHORIZONTAL;
-        XmNleftAttachment = XmATTACH_FORM;
-        XmNleftOffset = 10;
-        XmNtopOffset = 140;
-        XmNx = 10;
-        XmNy = 140;
-        XmNwidth = 270;
-        XmNheight = 60;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNvalueChangedCallback = procedure do_mbview_profile_exager();
-        XmNdragCallback = procedure do_mbview_profile_exager();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_profile_label_info : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNborderWidth = 1;
-        XmNbackground = color('white');
-        XmNlabelString = compound_string("Profile Source: Route ", separate=true) &
- compound_string("Length: 1.0 km", separate=true) &
- compound_string("Vertical Range: -100.5 to 512.0 m", separate=true);
-        XmNrecomputeSize = false;
-        XmNleftAttachment = XmATTACH_FORM;
-        XmNleftOffset = 10;
-        XmNtopOffset = 0;
-        XmNx = 10;
-        XmNy = 0;
-        XmNwidth = 270;
-        XmNheight = 130;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_drawingArea_profile : XmDrawingArea widget {
-    arguments {
-        arguments Style_use;
-        XmNborderWidth = 1;
-        XmNbackground = color('White');
-        XmNwidth = 500;
-        XmNheight = 240;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_scrolledWindow_profile : XmScrolledWindow widget {
-    arguments {
-        arguments Style_use;
-        XmNscrollingPolicy = XmAUTOMATIC;
-        XmNtopAttachment = XmATTACH_FORM;
-        XmNrightAttachment = XmATTACH_FORM;
-        XmNleftAttachment = XmATTACH_FORM;
-        XmNbottomAttachment = XmATTACH_FORM;
-        XmNbottomOffset = 10;
-        XmNleftOffset = 290;
-        XmNrightOffset = 6;
-        XmNtopOffset = 0;
-        XmNx = 290;
-        XmNy = 0;
-        XmNwidth = 638;
-        XmNheight = 365;
-    };
-    controls {
-         managed XmDrawingArea mB3DView_mbview_drawingArea_profile;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_scale_profile_slope : XmScale widget {
-    arguments {
-        arguments Style_use;
-        XmNminimum = 1;
-        XmNdecimalPoints = 2;
-        XmNvalue = 200;
-        XmNtitleString = compound_string("Slope Threshold");
-        XmNmaximum = 200;
-        XmNshowArrows = TRUE;
-        XmNscaleMultiple = 1;
-        XmNshowValue = TRUE;
-        XmNorientation = XmHORIZONTAL;
-        XmNtopAttachment = XmATTACH_FORM;
-        XmNleftAttachment = XmATTACH_FORM;
-        XmNbottomAttachment = XmATTACH_NONE;
-        XmNbottomOffset = 0;
-        XmNleftOffset = 10;
-        XmNtopOffset = 200;
-        XmNx = 10;
-        XmNy = 200;
-        XmNwidth = 270;
-        XmNheight = 63;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNvalueChangedCallback = procedure do_mbview_profile_slope();
-        XmNdragCallback = procedure do_mbview_profile_slope();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_scale_profile_width : XmScale widget {
-    arguments {
-        arguments Style_use;
-        XmNminimum = 1;
-        XmNdecimalPoints = 0;
-        XmNvalue = 1;
-        XmNtitleString = compound_string("Display Width Multiple");
-        XmNmaximum = 5;
-        XmNshowArrows = TRUE;
-        XmNscaleMultiple = 1;
-        XmNshowValue = TRUE;
-        XmNorientation = XmHORIZONTAL;
-        XmNtopAttachment = XmATTACH_FORM;
-        XmNleftAttachment = XmATTACH_FORM;
-        XmNbottomAttachment = XmATTACH_NONE;
-        XmNbottomOffset = 0;
-        XmNleftOffset = 10;
-        XmNtopOffset = 263;
-        XmNx = 10;
-        XmNy = 263;
-        XmNwidth = 270;
-        XmNheight = 62;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNvalueChangedCallback = procedure do_mbview_profile_width();
-        XmNdragCallback = procedure do_mbview_profile_width();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_form_profile : XmFormDialog widget {
-    arguments {
-        arguments Style_use;
-        XmNdialogTitle = compound_string("MBview Profile Display");
-        XmNresizePolicy = XmRESIZE_GROW;
-        XmNx = 814;
-        XmNy = 1149;
-        XmNwidth = 934;
-        XmNheight = 375;
-    };
-    controls {
-         managed XmScale mB3DView_mbview_scale_profile_width;
-         managed XmScale mB3DView_mbview_scale_profile_slope;
-         managed XmScrolledWindow mB3DView_mbview_scrolledWindow_profile;
-         managed XmLabel mB3DView_mbview_profile_label_info;
-         managed XmScale mB3DView_mbview_scale_profile_exager;
-         managed XmPushButton mB3DView_mbview_profile_pushButton_dismiss;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-!(BX)object mB3DView_mbview_dialogShell_profile : XmDialogShell widget {
-!(BX)    arguments {
-!(BX)        arguments Style_use;
-!(BX)        XmNx = 814;
-!(BX)        XmNy = 1149;
-!(BX)        XmNwidth = 934;
-!(BX)        XmNheight = 375;
-!(BX)    };
-!(BX)    controls {
-!(BX)         managed XmFormDialog mB3DView_mbview_form_profile;
-!(BX)    };
-!(BX)    callbacks {
-!(BX)        callbacks Style_useReasons;
-!(BX)    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-!(BX)};
-
-object mB3DView_mbview_pushButton_projection_dismiss : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Dismiss");
-        XmNx = 110;
-        XmNy = 240;
-        XmNwidth = 130;
-        XmNheight = 40;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNactivateCallback = procedure do_mbview_projection_popdown();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_label_projection : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNborderWidth = 1;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNbackground = color('white');
-        XmNlabelString = compound_string("Primary Grid Projection:");
-        XmNx = 10;
-        XmNy = 10;
-        XmNwidth = 190;
-        XmNheight = 220;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_toggleButton_geographic : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Geographic");
-        XmNwidth = 109;
-        XmNheight = 28;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNvalueChangedCallback = procedure do_mbview_display_geographic();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_toggleButton_utm : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("UTM");
-        XmNwidth = 109;
-        XmNheight = 28;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNvalueChangedCallback = procedure do_mbview_display_utm();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_toggleButton_spheroid : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Spheroid");
-        XmNwidth = 109;
-        XmNheight = 28;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNvalueChangedCallback = procedure do_mbview_display_spheroid();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_radioBox_projection : XmRadioBox widget {
-    arguments {
-        arguments Style_use;
-        XmNx = 220;
-        XmNy = 40;
-        XmNwidth = 115;
-        XmNheight = 96;
-    };
-    controls {
-         managed XmToggleButton mB3DView_mbview_toggleButton_geographic;
-         managed XmToggleButton mB3DView_mbview_toggleButton_utm;
-         managed XmToggleButton mB3DView_mbview_toggleButton_spheroid;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_label_displayprojection : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Display Projection:");
-        XmNx = 210;
-        XmNy = 10;
-        XmNwidth = 150;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_bulletinBoard_projection : XmBulletinBoardDialog widget {
-    arguments {
-        arguments Style_use;
-        XmNresizePolicy = XmRESIZE_GROW;
-        XmNx = 1098;
-        XmNy = 1193;
-        XmNwidth = 365;
-        XmNheight = 288;
-    };
-    controls {
-         managed XmLabel mB3DView_mbview_label_displayprojection;
-         managed XmRadioBox mB3DView_mbview_radioBox_projection;
-         managed XmLabel mB3DView_mbview_label_projection;
-         managed XmPushButton mB3DView_mbview_pushButton_projection_dismiss;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-!(BX)object mB3DView_mbview_dialogShell_projection : XmDialogShell widget {
-!(BX)    arguments {
-!(BX)        arguments Style_use;
-!(BX)        XmNtitle = "Projections";
-!(BX)        XmNx = 1098;
-!(BX)        XmNy = 1193;
-!(BX)        XmNwidth = 365;
-!(BX)        XmNheight = 288;
-!(BX)    };
-!(BX)    controls {
-!(BX)         managed XmBulletinBoardDialog mB3DView_mbview_bulletinBoard_projection;
-!(BX)    };
-!(BX)    callbacks {
-!(BX)        callbacks Style_useReasons;
-!(BX)    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-!(BX)};
-
-object mB3DView_mbview_pushButton_view_2d_dismiss : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Dismiss");
-        XmNx = 100;
-        XmNy = 150;
-        XmNwidth = 70;
-        XmNheight = 50;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNactivateCallback = procedure do_mbview_2dparmspopdown();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_pushButton_view_2d_apply : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Apply");
-        XmNx = 20;
-        XmNy = 150;
-        XmNwidth = 70;
-        XmNheight = 50;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNactivateCallback = procedure do_mbview_2dparmsapply();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_label_2d_offset : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNlabelString = compound_string("View Offset:");
-        XmNx = 10;
-        XmNy = 10;
-        XmNwidth = 90;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_label_view_2doffsetx : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_END;
-        XmNlabelString = compound_string("X:");
-        XmNx = 20;
-        XmNy = 40;
-        XmNwidth = 50;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_textField_view_2doffsetx : XmTextField widget {
-    arguments {
-        arguments Style_use;
-        XmNx = 70;
-        XmNy = 40;
-        XmNwidth = 110;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_separator14 : XmSeparator widget {
-    arguments {
-        XmNx = 10;
-        XmNy = 130;
-        XmNwidth = 170;
-        XmNheight = 20;
-    };
-    controls {
-    };
-    callbacks {
-    };
-};
-
-object mB3DView_mbview_label_view_2doffsety : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_END;
-        XmNlabelString = compound_string("Y:");
-        XmNx = 20;
-        XmNy = 70;
-        XmNwidth = 50;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_textField_view_2doffsety : XmTextField widget {
-    arguments {
-        arguments Style_use;
-        XmNx = 70;
-        XmNy = 70;
-        XmNwidth = 110;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_label_view_2dzoom : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_END;
-        XmNlabelString = compound_string("Zoom:");
-        XmNx = 10;
-        XmNy = 100;
-        XmNwidth = 60;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_textField_view_2dzoom : XmTextField widget {
-    arguments {
-        arguments Style_use;
-        XmNx = 70;
-        XmNy = 100;
-        XmNwidth = 110;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_bulletinBoard_2dparms : XmBulletinBoardDialog widget {
-    arguments {
-        arguments Style_use;
-        XmNdialogTitle = compound_string("MBview 2D Parameters");
-        XmNautoUnmanage = false;
-        XmNresizePolicy = XmRESIZE_GROW;
-        XmNx = 1187;
-        XmNy = 1229;
-        XmNwidth = 187;
-        XmNheight = 215;
-    };
-    controls {
-         managed XmTextField mB3DView_mbview_textField_view_2dzoom;
-         managed XmLabel mB3DView_mbview_label_view_2dzoom;
-         managed XmTextField mB3DView_mbview_textField_view_2doffsety;
-         managed XmLabel mB3DView_mbview_label_view_2doffsety;
-         managed XmSeparator mB3DView_mbview_separator14;
-         managed XmTextField mB3DView_mbview_textField_view_2doffsetx;
-         managed XmLabel mB3DView_mbview_label_view_2doffsetx;
-         managed XmLabel mB3DView_mbview_label_2d_offset;
-         managed XmPushButton mB3DView_mbview_pushButton_view_2d_apply;
-         managed XmPushButton mB3DView_mbview_pushButton_view_2d_dismiss;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-!(BX)object mB3DView_mbview_dialogShell_2dparms : XmDialogShell widget {
-!(BX)    arguments {
-!(BX)        arguments Style_use;
-!(BX)        XmNx = 1187;
-!(BX)        XmNy = 1229;
-!(BX)        XmNwidth = 187;
-!(BX)        XmNheight = 215;
-!(BX)    };
-!(BX)    controls {
-!(BX)         managed XmBulletinBoardDialog mB3DView_mbview_bulletinBoard_2dparms;
-!(BX)    };
-!(BX)    callbacks {
-!(BX)        callbacks Style_useReasons;
-!(BX)    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-!(BX)};
-
-object mB3DView_mbview_pushButton_view_3d_dismiss : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Dismiss");
-        XmNx = 160;
-        XmNy = 420;
-        XmNwidth = 100;
-        XmNheight = 50;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNactivateCallback = procedure do_mbview_3dparmspopdown();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_textField_exageration : XmTextField widget {
-    arguments {
-        arguments Style_use;
-        XmNx = 160;
-        XmNy = 290;
-        XmNwidth = 110;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_label_exager : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_END;
-        XmNlabelString = compound_string("Vertical Exageration:");
-        XmNx = 10;
-        XmNy = 290;
-        XmNwidth = 150;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_pushButton_view_3d_apply : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Apply");
-        XmNx = 20;
-        XmNy = 420;
-        XmNwidth = 100;
-        XmNheight = 50;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNactivateCallback = procedure do_mbview_3dparmsapply();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_separator9 : XmSeparator widget {
-    arguments {
-        XmNx = 10;
-        XmNy = 130;
-        XmNwidth = 260;
-        XmNheight = 20;
-    };
-    controls {
-    };
-    callbacks {
-    };
-};
-
-object mB3DView_mbview_label_model : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNlabelString = compound_string("Model Orientation & Zoom:");
-        XmNx = 10;
-        XmNy = 10;
-        XmNwidth = 200;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_label_model_azimuth : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_END;
-        XmNlabelString = compound_string("Azimuth (degrees):");
-        XmNx = 20;
-        XmNy = 40;
-        XmNwidth = 140;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_label_model_elevation : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_END;
-        XmNlabelString = compound_string("Elevation (degrees):");
-        XmNx = 10;
-        XmNy = 70;
-        XmNwidth = 150;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_textField_model_azimuth : XmTextField widget {
-    arguments {
-        arguments Style_use;
-        XmNx = 160;
-        XmNy = 40;
-        XmNwidth = 110;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_textField_model_elevation : XmTextField widget {
-    arguments {
-        arguments Style_use;
-        XmNx = 160;
-        XmNy = 70;
-        XmNwidth = 110;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_label_view : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNlabelString = compound_string("View Orientation & Zoom:");
-        XmNx = 10;
-        XmNy = 150;
-        XmNwidth = 200;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_label_view_azimuth : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_END;
-        XmNlabelString = compound_string("Azimuth (degrees):");
-        XmNx = 10;
-        XmNy = 180;
-        XmNwidth = 150;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_textField_view_azimuth : XmTextField widget {
-    arguments {
-        arguments Style_use;
-        XmNx = 160;
-        XmNy = 180;
-        XmNwidth = 110;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_separator4 : XmSeparator widget {
-    arguments {
-        XmNx = 10;
-        XmNy = 270;
-        XmNwidth = 260;
-        XmNheight = 20;
-    };
-    controls {
-    };
-    callbacks {
-    };
-};
-
-object mB3DView_mbview_label_view_elevation : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_END;
-        XmNlabelString = compound_string("Elevation (degrees):");
-        XmNx = 10;
-        XmNy = 210;
-        XmNwidth = 150;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_textField_view_elevation : XmTextField widget {
-    arguments {
-        arguments Style_use;
-        XmNx = 160;
-        XmNy = 210;
-        XmNwidth = 110;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_label_view_offset : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNlabelString = compound_string("Pan:");
-        XmNx = 10;
-        XmNy = 340;
-        XmNwidth = 90;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_label_view_3doffsetx : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_END;
-        XmNlabelString = compound_string("X:");
-        XmNx = 100;
-        XmNy = 340;
-        XmNwidth = 60;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_textField_view_3doffsetx : XmTextField widget {
-    arguments {
-        arguments Style_use;
-        XmNx = 160;
-        XmNy = 340;
-        XmNwidth = 110;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_separator20 : XmSeparator widget {
-    arguments {
-        XmNx = 10;
-        XmNy = 400;
-        XmNwidth = 260;
-        XmNheight = 20;
-    };
-    controls {
-    };
-    callbacks {
-    };
-};
-
-object mB3DView_mbview_label_view_3doffsety : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_END;
-        XmNlabelString = compound_string("Y:");
-        XmNx = 60;
-        XmNy = 370;
-        XmNwidth = 100;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_textField_view_3doffsety : XmTextField widget {
-    arguments {
-        arguments Style_use;
-        XmNx = 160;
-        XmNy = 370;
-        XmNwidth = 110;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_label_view_3dzoom : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_END;
-        XmNlabelString = compound_string("Zoom:");
-        XmNx = 60;
-        XmNy = 240;
-        XmNwidth = 100;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_textField_view_3dzoom : XmTextField widget {
-    arguments {
-        arguments Style_use;
-        XmNx = 160;
-        XmNy = 240;
-        XmNwidth = 110;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_separator11 : XmSeparator widget {
-    arguments {
-        XmNx = 10;
-        XmNy = 320;
-        XmNwidth = 260;
-        XmNheight = 20;
-    };
-    controls {
-    };
-    callbacks {
-    };
-};
-
-object mB3DView_mbview_label_model_3dzoom : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_END;
-        XmNlabelString = compound_string("Zoom:");
-        XmNx = 60;
-        XmNy = 100;
-        XmNwidth = 100;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_textField_model_3dzoom : XmTextField widget {
-    arguments {
-        arguments Style_use;
-        XmNx = 160;
-        XmNy = 100;
-        XmNwidth = 110;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_bulletinBoard_3dparms : XmBulletinBoardDialog widget {
-    arguments {
-        arguments Style_use;
-        XmNdialogTitle = compound_string("MBview 3D Parameters");
-        XmNautoUnmanage = false;
-        XmNresizePolicy = XmRESIZE_GROW;
-        XmNx = 1140;
-        XmNy = 1098;
-        XmNwidth = 281;
-        XmNheight = 478;
-    };
-    controls {
-         managed XmTextField mB3DView_mbview_textField_model_3dzoom;
-         managed XmLabel mB3DView_mbview_label_model_3dzoom;
-         managed XmSeparator mB3DView_mbview_separator11;
-         managed XmTextField mB3DView_mbview_textField_view_3dzoom;
-         managed XmLabel mB3DView_mbview_label_view_3dzoom;
-         managed XmTextField mB3DView_mbview_textField_view_3doffsety;
-         managed XmLabel mB3DView_mbview_label_view_3doffsety;
-         managed XmSeparator mB3DView_mbview_separator20;
-         managed XmTextField mB3DView_mbview_textField_view_3doffsetx;
-         managed XmLabel mB3DView_mbview_label_view_3doffsetx;
-         managed XmLabel mB3DView_mbview_label_view_offset;
-         managed XmTextField mB3DView_mbview_textField_view_elevation;
-         managed XmLabel mB3DView_mbview_label_view_elevation;
-         managed XmSeparator mB3DView_mbview_separator4;
-         managed XmTextField mB3DView_mbview_textField_view_azimuth;
-         managed XmLabel mB3DView_mbview_label_view_azimuth;
-         managed XmLabel mB3DView_mbview_label_view;
-         managed XmTextField mB3DView_mbview_textField_model_elevation;
-         managed XmTextField mB3DView_mbview_textField_model_azimuth;
-         managed XmLabel mB3DView_mbview_label_model_elevation;
-         managed XmLabel mB3DView_mbview_label_model_azimuth;
-         managed XmLabel mB3DView_mbview_label_model;
-         managed XmSeparator mB3DView_mbview_separator9;
-         managed XmPushButton mB3DView_mbview_pushButton_view_3d_apply;
-         managed XmLabel mB3DView_mbview_label_exager;
-         managed XmTextField mB3DView_mbview_textField_exageration;
-         managed XmPushButton mB3DView_mbview_pushButton_view_3d_dismiss;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-!(BX)object mB3DView_mbview_dialogShell_3dparms : XmDialogShell widget {
-!(BX)    arguments {
-!(BX)        arguments Style_use;
-!(BX)        XmNx = 1140;
-!(BX)        XmNy = 1098;
-!(BX)        XmNwidth = 281;
-!(BX)        XmNheight = 478;
-!(BX)    };
-!(BX)    controls {
-!(BX)         managed XmBulletinBoardDialog mB3DView_mbview_bulletinBoard_3dparms;
-!(BX)    };
-!(BX)    callbacks {
-!(BX)        callbacks Style_useReasons;
-!(BX)    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-!(BX)};
-
-object mB3DView_mbview_pushButton_shadeparms_dismiss2 : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Dismiss");
-        XmNx = 160;
-        XmNy = 380;
-        XmNwidth = 100;
-        XmNheight = 50;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNactivateCallback = procedure do_mbview_shadeparmspopdown();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_textField_illum_elev : XmTextField widget {
-    arguments {
-        arguments Style_use;
-        XmNx = 160;
-        XmNy = 100;
-        XmNwidth = 110;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_label_illum_elev : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_END;
-        XmNlabelString = compound_string("Elevation (degrees):");
-        XmNx = 10;
-        XmNy = 100;
-        XmNwidth = 150;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_pushButton_shadeparms_apply : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Apply");
-        XmNx = 20;
-        XmNy = 380;
-        XmNwidth = 100;
-        XmNheight = 50;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNactivateCallback = procedure do_mbview_shadeparmsapply();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_separator16 : XmSeparator widget {
-    arguments {
-        XmNx = 10;
-        XmNy = 140;
-        XmNwidth = 260;
-        XmNheight = 20;
-    };
-    controls {
-    };
-    callbacks {
-    };
-};
-
-object mB3DView_mbview_label_illumination : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNlabelString = compound_string("Shading by Illumination:");
-        XmNx = 10;
-        XmNy = 10;
-        XmNwidth = 180;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_label_illum_amp : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_END;
-        XmNlabelString = compound_string("Amplitude:");
-        XmNx = 10;
-        XmNy = 40;
-        XmNwidth = 150;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_label_illum_azi : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_END;
-        XmNlabelString = compound_string("Azimuth (degrees):");
-        XmNx = 20;
-        XmNy = 70;
-        XmNwidth = 140;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_textField_illum_amp : XmTextField widget {
-    arguments {
-        arguments Style_use;
-        XmNx = 160;
-        XmNy = 40;
-        XmNwidth = 110;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_textField_illum_azi : XmTextField widget {
-    arguments {
-        arguments Style_use;
-        XmNx = 160;
-        XmNy = 70;
-        XmNwidth = 110;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_label_slopeshade : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNlabelString = compound_string("Shading by Slope:");
-        XmNx = 10;
-        XmNy = 160;
-        XmNwidth = 200;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_label_slope_amp : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_END;
-        XmNlabelString = compound_string("Amplitude:");
-        XmNx = 50;
-        XmNy = 190;
-        XmNwidth = 110;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_textField_slope_amp : XmTextField widget {
-    arguments {
-        arguments Style_use;
-        XmNx = 160;
-        XmNy = 190;
-        XmNwidth = 110;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_separator15 : XmSeparator widget {
-    arguments {
-        XmNx = 10;
-        XmNy = 220;
-        XmNwidth = 260;
-        XmNheight = 20;
-    };
-    controls {
-    };
-    callbacks {
-    };
-};
-
-object mB3DView_mbview_label_overlay_amp : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_END;
-        XmNlabelString = compound_string("Amplitude:");
-        XmNx = 60;
-        XmNy = 270;
-        XmNwidth = 100;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_textField_overlay_amp : XmTextField widget {
-    arguments {
-        arguments Style_use;
-        XmNx = 160;
-        XmNy = 270;
-        XmNwidth = 110;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_toggleButton_overlay_shade_ctoh : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Cold-to-Hot");
-        XmNwidth = 109;
-        XmNheight = 28;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_toggleButton_overlay_shade_htoc : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Hot-to-Cold");
-        XmNwidth = 109;
-        XmNheight = 28;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_radioBox_overlay_shade : XmRadioBox widget {
-    arguments {
-        arguments Style_use;
-        XmNorientation = XmHORIZONTAL;
-        XmNx = 30;
-        XmNy = 330;
-        XmNwidth = 227;
-        XmNheight = 34;
-    };
-    controls {
-         managed XmToggleButton mB3DView_mbview_toggleButton_overlay_shade_ctoh;
-         managed XmToggleButton mB3DView_mbview_toggleButton_overlay_shade_htoc;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_label_overlayshade : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNlabelString = compound_string("Shading by Overlay:");
-        XmNx = 10;
-        XmNy = 240;
-        XmNwidth = 200;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_label_overlay_center : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_END;
-        XmNlabelString = compound_string("Center:");
-        XmNx = 60;
-        XmNy = 300;
-        XmNwidth = 100;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_textField_overlay_center : XmTextField widget {
-    arguments {
-        arguments Style_use;
-        XmNx = 160;
-        XmNy = 300;
-        XmNwidth = 110;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_separator13 : XmSeparator widget {
-    arguments {
-        XmNx = 10;
-        XmNy = 360;
-        XmNwidth = 260;
-        XmNheight = 20;
-    };
-    controls {
-    };
-    callbacks {
-    };
-};
-
-object mB3DView_mbview_bulletinBoard_shadeparms : XmBulletinBoardDialog widget {
-    arguments {
-        arguments Style_use;
-        XmNdialogTitle = compound_string("MBview Shading Parameters");
-        XmNautoUnmanage = false;
-        XmNresizePolicy = XmRESIZE_GROW;
-        XmNx = 1141;
-        XmNy = 1117;
-        XmNwidth = 280;
-        XmNheight = 440;
-    };
-    controls {
-         managed XmSeparator mB3DView_mbview_separator13;
-         managed XmTextField mB3DView_mbview_textField_overlay_center;
-         managed XmLabel mB3DView_mbview_label_overlay_center;
-         managed XmLabel mB3DView_mbview_label_overlayshade;
-         managed XmRadioBox mB3DView_mbview_radioBox_overlay_shade;
-         managed XmTextField mB3DView_mbview_textField_overlay_amp;
-         managed XmLabel mB3DView_mbview_label_overlay_amp;
-         managed XmSeparator mB3DView_mbview_separator15;
-         managed XmTextField mB3DView_mbview_textField_slope_amp;
-         managed XmLabel mB3DView_mbview_label_slope_amp;
-         managed XmLabel mB3DView_mbview_label_slopeshade;
-         managed XmTextField mB3DView_mbview_textField_illum_azi;
-         managed XmTextField mB3DView_mbview_textField_illum_amp;
-         managed XmLabel mB3DView_mbview_label_illum_azi;
-         managed XmLabel mB3DView_mbview_label_illum_amp;
-         managed XmLabel mB3DView_mbview_label_illumination;
-         managed XmSeparator mB3DView_mbview_separator16;
-         managed XmPushButton mB3DView_mbview_pushButton_shadeparms_apply;
-         managed XmLabel mB3DView_mbview_label_illum_elev;
-         managed XmTextField mB3DView_mbview_textField_illum_elev;
-         managed XmPushButton mB3DView_mbview_pushButton_shadeparms_dismiss2;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-!(BX)object mB3DView_mbview_dialogShell_shadeparms : XmDialogShell widget {
-!(BX)    arguments {
-!(BX)        arguments Style_use;
-!(BX)        XmNx = 1141;
-!(BX)        XmNy = 1117;
-!(BX)        XmNwidth = 280;
-!(BX)        XmNheight = 440;
-!(BX)    };
-!(BX)    controls {
-!(BX)         managed XmBulletinBoardDialog mB3DView_mbview_bulletinBoard_shadeparms;
-!(BX)    };
-!(BX)    callbacks {
-!(BX)        callbacks Style_useReasons;
-!(BX)    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-!(BX)};
-
-object mB3DView_mbview_pushButton_about_dismiss : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Dismiss");
-        XmNx = 170;
-        XmNy = 470;
-        XmNwidth = 120;
-        XmNheight = 50;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNactivateCallback = procedure do_mbview_aboutpopdown();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_label_about_title : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNfontList = font_table(
-		font('-*-times-bold-r-*-*-*-180-*-*-*-*-iso8859-1',character_set=character_set('TimesBold18')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')));
-        XmNlabelString = compound_string(#character_set("TimesBold24")"MBv" &
- "iew") &
- compound_string("", separate=true) &
- compound_string(#character_set("TimesBold18")"A 2D/3D Visualization API");
-        XmNx = 10;
-        XmNy = 10;
-        XmNwidth = 440;
-        XmNheight = 90;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_separator7 : XmSeparator widget {
-    arguments {
-        arguments Style_use;
-        XmNx = 10;
-        XmNy = 100;
-        XmNwidth = 440;
-        XmNheight = 20;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_label_about_mbsystem : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNfontList = font_table(
-		font('-*-times-bold-r-*-*-*-140-*-*-*-*-iso8859-1',character_set=character_set('TimesBold14')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')));
-        XmNlabelString = compound_string(#character_set("TimesBold14")"One" &
- " component of the", separate=true) &
- compound_string(#character_set("T" &
- "imesBold24")"MB-System") &
- compound_string(#character_set("TimesBold14")"", separate=true) &
- compound_string(#character_set("TimesBold14")"An open Source Software Package", separate=true) &
- compound_string(#character_set("TimesBold14")"for Processing and Display", separate=true) &
- compound_string(#character_set("TimesBold14")"of Swath Sonar Data");
-        XmNx = 10;
-        XmNy = 120;
-        XmNwidth = 440;
-        XmNheight = 140;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_separator6 : XmSeparator widget {
-    arguments {
-        arguments Style_use;
-        XmNx = 10;
-        XmNy = 260;
-        XmNwidth = 440;
-        XmNheight = 20;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_label_about_LDEO : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNfontList = font_table(
-		font('-*-times-bold-r-*-*-*-140-*-*-*-*-iso8859-1',character_set=character_set('TimesBold14')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')));
-        XmNlabelString = compound_string(#character_set("TimesBold12")"Lam" &
- "ont-Doherty", separate=true) &
- compound_string(#character_set("T" &
- "imesBold12")"Earth Observatory", separate=true) &
- compound_string(#character_set("TimesBold12")"of Columbia University");
-        XmNx = 230;
-        XmNy = 340;
-        XmNwidth = 180;
-        XmNheight = 80;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_label_about_MBARI : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNfontList = font_table(
-		font('-*-times-bold-r-*-*-*-140-*-*-*-*-iso8859-1',character_set=character_set('TimesBold14')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-120-*-*-*-*-iso8859-1',character_set=character_set('TimesBold12')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-120-*-*-*-*-iso8859-1',character_set=character_set('TimesBold12')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-120-*-*-*-*-iso8859-1',character_set=character_set('TimesBold12')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-120-*-*-*-*-iso8859-1',character_set=character_set('TimesBold12')));
-        XmNlabelString = compound_string(#character_set("TimesBold12")"Mon" &
- "terey Bay", separate=true) &
- compound_string(#character_set("T" &
- "imesBold12")"Aquarium", separate=true) &
- compound_string(#character_set("TimesBold12")"Research Institute");
-        XmNx = 70;
-        XmNy = 340;
-        XmNwidth = 140;
-        XmNheight = 80;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_label_about_authors : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNfontList = font_table(
-		font('-*-times-bold-r-*-*-*-140-*-*-*-*-iso8859-1',character_set=character_set('TimesBold14')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-120-*-*-*-*-iso8859-1',character_set=character_set('TimesBold12')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-120-*-*-*-*-iso8859-1',character_set=character_set('TimesBold12')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-120-*-*-*-*-iso8859-1',character_set=character_set('TimesBold12')),
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-120-*-*-*-*-iso8859-1',character_set=character_set('TimesBold12')));
-        XmNlabelString = compound_string(#character_set("TimesBold14")"Cre" &
- "ated By:", separate=true) &
- compound_string(#character_set("T" &
- "imesBold14")"David W. Caress   and   Dale N. Chayes ");
-        XmNx = 10;
-        XmNy = 280;
-        XmNwidth = 440;
-        XmNheight = 60;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_label_about_version : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNfontList = font_table(
-		font('-*-times-bold-r-*-*-*-240-*-*-*-*-iso8859-1',character_set=character_set('TimesBold24')),
-		font('-*-times-bold-r-*-*-*-120-*-*-*-*-iso8859-1',character_set=character_set('TimesBold12')),
-		font('-*-times-bold-r-*-*-*-140-*-*-*-*-iso8859-1',character_set=character_set('TimesBold14')),
-		font('-*-times-medium-r-*-*-*-140-*-*-*-*-iso8859-1',character_set=character_set('TimesMedium14')),
-		font('-*-times-bold-r-*-*-*-120-*-*-*-*-iso8859-1',character_set=character_set('TimesBold12')),
-		font('-*-times-bold-r-*-*-*-140-*-*-*-*-iso8859-1',character_set=character_set('TimesBold14')),
-		font('-*-times-medium-r-*-*-*-140-*-*-*-*-iso8859-1',character_set=character_set('TimesMedium14')),
-		font('-*-times-bold-r-*-*-*-120-*-*-*-*-iso8859-1',character_set=character_set('TimesBold12')),
-		font('-*-times-bold-r-*-*-*-140-*-*-*-*-iso8859-1',character_set=character_set('TimesBold14')),
-		font('-*-times-medium-r-*-*-*-140-*-*-*-*-iso8859-1',character_set=character_set('TimesMedium14')),
-		font('-*-times-bold-r-*-*-*-120-*-*-*-*-iso8859-1',character_set=character_set('TimesBold12')),
-		font('-*-times-bold-r-*-*-*-140-*-*-*-*-iso8859-1',character_set=character_set('TimesBold14')),
-		font('-*-times-medium-r-*-*-*-140-*-*-*-*-iso8859-1',character_set=character_set('TimesMedium14')));
-        XmNlabelString = compound_string(#character_set("TimesMedium14")"M" &
- "B-System Release 5.0.0", separate=true) &
- compound_string(#character_set("T" &
- "imesMedium14")"August 26, 2003");
-        XmNrecomputeSize = false;
-        XmNx = 10;
-        XmNy = 410;
-        XmNwidth = 440;
-        XmNheight = 50;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_bulletinBoard_about : XmBulletinBoardDialog widget {
-    arguments {
-        arguments Style_use;
-        XmNdialogTitle = compound_string("About MBview...");
-        XmNresizePolicy = XmRESIZE_GROW;
-        XmNx = 1049;
-        XmNy = 1071;
-        XmNwidth = 463;
-        XmNheight = 531;
-    };
-    controls {
-         managed XmLabel mB3DView_mbview_label_about_version;
-         managed XmLabel mB3DView_mbview_label_about_authors;
-         managed XmLabel mB3DView_mbview_label_about_MBARI;
-         managed XmLabel mB3DView_mbview_label_about_LDEO;
-         managed XmSeparator mB3DView_mbview_separator6;
-         managed XmLabel mB3DView_mbview_label_about_mbsystem;
-         managed XmSeparator mB3DView_mbview_separator7;
-         managed XmLabel mB3DView_mbview_label_about_title;
-         managed XmPushButton mB3DView_mbview_pushButton_about_dismiss;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-!(BX)object mB3DView_mbview_dialogShell_about : XmDialogShell widget {
-!(BX)    arguments {
-!(BX)        arguments Style_use;
-!(BX)        XmNx = 1049;
-!(BX)        XmNy = 1071;
-!(BX)        XmNwidth = 463;
-!(BX)        XmNheight = 531;
-!(BX)    };
-!(BX)    controls {
-!(BX)         managed XmBulletinBoardDialog mB3DView_mbview_bulletinBoard_about;
-!(BX)    };
-!(BX)    callbacks {
-!(BX)        callbacks Style_useReasons;
-!(BX)    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-!(BX)};
-
-object mB3DView_mbview_label_thanks : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNlabelString = compound_string("Thank you for your patience.");
-        XmNx = 10;
-        XmNy = 50;
-        XmNwidth = 400;
-        XmNheight = 40;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_label_message : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNlabelString = compound_string("MB3Dview is doing something...");
-        XmNx = 10;
-        XmNy = 10;
-        XmNwidth = 400;
-        XmNheight = 40;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_bulletinBoard_message : XmBulletinBoardDialog widget {
-    arguments {
-        arguments Style_use;
-        XmNdialogStyle = XmDIALOG_FULL_APPLICATION_MODAL;
-        XmNdialogTitle = compound_string("MBview: Please wait...");
-        XmNresizePolicy = XmRESIZE_GROW;
-        XmNx = 1070;
-        XmNy = 1289;
-        XmNwidth = 421;
-        XmNheight = 95;
-    };
-    controls {
-         managed XmLabel mB3DView_mbview_label_message;
-         managed XmLabel mB3DView_mbview_label_thanks;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-!(BX)object mB3DView_mbview_dialogShell_message : XmDialogShell widget {
-!(BX)    arguments {
-!(BX)        arguments Style_use;
-!(BX)        XmNx = 1070;
-!(BX)        XmNy = 1289;
-!(BX)        XmNwidth = 421;
-!(BX)        XmNheight = 95;
-!(BX)    };
-!(BX)    controls {
-!(BX)         managed XmBulletinBoardDialog mB3DView_mbview_bulletinBoard_message;
-!(BX)    };
-!(BX)    callbacks {
-!(BX)        callbacks Style_useReasons;
-!(BX)    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-!(BX)};
-
-object mB3DView_mbview_pushButton_resolution_dismiss : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Dismiss");
-        XmNx = 100;
-        XmNy = 400;
-        XmNwidth = 100;
-        XmNheight = 40;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNactivateCallback = procedure do_mbview_resolutionpopdown();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_scale_lowresolution : XmScale widget {
-    arguments {
-        arguments Style_use;
-        XmNminimum = 10;
-        XmNvalue = 100;
-        XmNtitleString = compound_string("Low Resolution Dimension");
-        XmNmaximum = 500;
-        XmNshowArrows = TRUE;
-        XmNscaleMultiple = 50;
-        XmNshowValue = TRUE;
-        XmNorientation = XmHORIZONTAL;
-        XmNx = 10;
-        XmNy = 50;
-        XmNwidth = 260;
-        XmNheight = 63;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNvalueChangedCallback = procedure do_mbview_resolutionchange();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_scale_mediumresolution : XmScale widget {
-    arguments {
-        arguments Style_use;
-        XmNminimum = 100;
-        XmNvalue = 300;
-        XmNtitleString = compound_string("Medium Resolution Dimension");
-        XmNmaximum = 1000;
-        XmNshowArrows = TRUE;
-        XmNscaleMultiple = 100;
-        XmNshowValue = TRUE;
-        XmNorientation = XmHORIZONTAL;
-        XmNx = 10;
-        XmNy = 120;
-        XmNwidth = 260;
-        XmNheight = 63;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNvalueChangedCallback = procedure do_mbview_resolutionchange();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_label_gridrenderres : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Grid Rendering Resolution:");
-        XmNx = 10;
-        XmNy = 10;
-        XmNwidth = 270;
-        XmNheight = 40;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_label_navrenderdecimation : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Nav Rendering Decimation");
-        XmNx = 10;
-        XmNy = 200;
-        XmNwidth = 270;
-        XmNheight = 40;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_separator : XmSeparator widget {
-    arguments {
-        XmNx = 10;
-        XmNy = 180;
-        XmNwidth = 260;
-        XmNheight = 20;
-    };
-    controls {
-    };
-    callbacks {
-    };
-};
-
-object mB3DView_mbview_scale_navlowresolution : XmScale widget {
-    arguments {
-        arguments Style_use;
-        XmNminimum = 1;
-        XmNvalue = 5;
-        XmNtitleString = compound_string("Low Resolution Decimation");
-        XmNmaximum = 25;
-        XmNshowArrows = TRUE;
-        XmNscaleMultiple = 2;
-        XmNshowValue = TRUE;
-        XmNorientation = XmHORIZONTAL;
-        XmNx = 10;
-        XmNy = 240;
-        XmNwidth = 260;
-        XmNheight = 60;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNvalueChangedCallback = procedure do_mbview_resolutionchange();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_scale_navmediumresolution : XmScale widget {
-    arguments {
-        arguments Style_use;
-        XmNminimum = 1;
-        XmNvalue = 2;
-        XmNtitleString = compound_string("Medium Resolution Decimation");
-        XmNmaximum = 10;
-        XmNshowArrows = TRUE;
-        XmNscaleMultiple = 1;
-        XmNshowValue = TRUE;
-        XmNorientation = XmHORIZONTAL;
-        XmNx = 10;
-        XmNy = 320;
-        XmNwidth = 260;
-        XmNheight = 60;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNvalueChangedCallback = procedure do_mbview_resolutionchange();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_bulletinBoard_resolution : XmBulletinBoardDialog widget {
-    arguments {
-        arguments Style_use;
-        XmNdialogTitle = compound_string("MBview Rendering Resolution");
-        XmNautoUnmanage = false;
-        XmNresizePolicy = XmRESIZE_GROW;
-        XmNx = 1135;
-        XmNy = 1111;
-        XmNwidth = 291;
-        XmNheight = 451;
-    };
-    controls {
-         managed XmScale mB3DView_mbview_scale_navmediumresolution;
-         managed XmScale mB3DView_mbview_scale_navlowresolution;
-         managed XmSeparator mB3DView_separator;
-         managed XmLabel mB3DView_mbview_label_navrenderdecimation;
-         managed XmLabel mB3DView_mbview_label_gridrenderres;
-         managed XmScale mB3DView_mbview_scale_mediumresolution;
-         managed XmScale mB3DView_mbview_scale_lowresolution;
-         managed XmPushButton mB3DView_mbview_pushButton_resolution_dismiss;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-!(BX)object mB3DView_mbview_dialogShell_resolution : XmDialogShell widget {
-!(BX)    arguments {
-!(BX)        arguments Style_use;
-!(BX)        XmNtitle = "MB3DView Rendering Resolution";
-!(BX)        XmNx = 1135;
-!(BX)        XmNy = 1111;
-!(BX)        XmNwidth = 291;
-!(BX)        XmNheight = 451;
-!(BX)    };
-!(BX)    controls {
-!(BX)         managed XmBulletinBoardDialog mB3DView_mbview_bulletinBoard_resolution;
-!(BX)    };
-!(BX)    callbacks {
-!(BX)        callbacks Style_useReasons;
-!(BX)    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-!(BX)};
-
-object mB3DView_mbview_pushButton_colorbounds_dismiss : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Dismiss");
-        XmNx = 240;
-        XmNy = 380;
-        XmNwidth = 110;
-        XmNheight = 50;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNactivateCallback = procedure do_mbview_colorboundspopdown();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_textField_contours : XmTextField widget {
-    arguments {
-        arguments Style_use;
-        XmNx = 310;
-        XmNy = 110;
-        XmNwidth = 110;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_label_contour : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNlabelString = compound_string("Data Contour Interval (meters):");
-        XmNx = 10;
-        XmNy = 110;
-        XmNwidth = 230;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_pushButton_colorbounds_apply : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Apply");
-        XmNx = 110;
-        XmNy = 380;
-        XmNwidth = 100;
-        XmNheight = 50;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNactivateCallback = procedure do_mbview_colorboundsapply();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_separator2 : XmSeparator widget {
-    arguments {
-        XmNx = 10;
-        XmNy = 140;
-        XmNwidth = 410;
-        XmNheight = 20;
-    };
-    controls {
-    };
-    callbacks {
-    };
-};
-
-object mB3DView_mbview_label_colorbounds : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNlabelString = compound_string("Data Color Bounds:");
-        XmNx = 10;
-        XmNy = 10;
-        XmNwidth = 180;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_label_colormin : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_END;
-        XmNlabelString = compound_string("Minimum:");
-        XmNx = 30;
-        XmNy = 40;
-        XmNwidth = 80;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_label_colormax : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_END;
-        XmNlabelString = compound_string("Maximum:");
-        XmNx = 230;
-        XmNy = 40;
-        XmNwidth = 80;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_textField_datamin : XmTextField widget {
-    arguments {
-        arguments Style_use;
-        XmNx = 110;
-        XmNy = 40;
-        XmNwidth = 110;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_textField_datamax : XmTextField widget {
-    arguments {
-        arguments Style_use;
-        XmNx = 310;
-        XmNy = 40;
-        XmNwidth = 110;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_toggleButton_data_ctoh : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Cold-to-Hot");
-        XmNwidth = 109;
-        XmNheight = 28;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_toggleButton_data_htoc : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Hot-to-Cold");
-        XmNwidth = 109;
-        XmNheight = 28;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_radioBox_colormode : XmRadioBox widget {
-    arguments {
-        arguments Style_use;
-        XmNorientation = XmHORIZONTAL;
-        XmNx = 30;
-        XmNy = 70;
-        XmNwidth = 227;
-        XmNheight = 34;
-    };
-    controls {
-         managed XmToggleButton mB3DView_mbview_toggleButton_data_ctoh;
-         managed XmToggleButton mB3DView_mbview_toggleButton_data_htoc;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_label_slopebounds : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNlabelString = compound_string("Data Slope Color Bounds:");
-        XmNx = 10;
-        XmNy = 160;
-        XmNwidth = 200;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_label_slopemin : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_END;
-        XmNlabelString = compound_string("Minimum:");
-        XmNx = 30;
-        XmNy = 190;
-        XmNwidth = 80;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_textField_slopemin : XmTextField widget {
-    arguments {
-        arguments Style_use;
-        XmNx = 110;
-        XmNy = 190;
-        XmNwidth = 110;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_label_slopemax : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_END;
-        XmNlabelString = compound_string("Maximum:");
-        XmNx = 230;
-        XmNy = 190;
-        XmNwidth = 80;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_textField_slopemax : XmTextField widget {
-    arguments {
-        arguments Style_use;
-        XmNx = 310;
-        XmNy = 190;
-        XmNwidth = 110;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_toggleButton_slope_ctoh : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Cold-to-Hot");
-        XmNwidth = 109;
-        XmNheight = 28;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_toggleButton_slope_htoc : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Hot-to-Cold");
-        XmNwidth = 109;
-        XmNheight = 28;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_radioBox_slopemode : XmRadioBox widget {
-    arguments {
-        arguments Style_use;
-        XmNorientation = XmHORIZONTAL;
-        XmNx = 30;
-        XmNy = 220;
-        XmNwidth = 227;
-        XmNheight = 34;
-    };
-    controls {
-         managed XmToggleButton mB3DView_mbview_toggleButton_slope_ctoh;
-         managed XmToggleButton mB3DView_mbview_toggleButton_slope_htoc;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_separator3 : XmSeparator widget {
-    arguments {
-        XmNx = 10;
-        XmNy = 250;
-        XmNwidth = 410;
-        XmNheight = 20;
-    };
-    controls {
-    };
-    callbacks {
-    };
-};
-
-object mB3DView_mbview_label_overlaybounds : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNlabelString = compound_string("Overlay Color Bounds:");
-        XmNx = 10;
-        XmNy = 270;
-        XmNwidth = 200;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_label_overlaymin : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_END;
-        XmNlabelString = compound_string("Minimum:");
-        XmNx = 30;
-        XmNy = 300;
-        XmNwidth = 80;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_textField_overlaymin : XmTextField widget {
-    arguments {
-        arguments Style_use;
-        XmNx = 110;
-        XmNy = 300;
-        XmNwidth = 110;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_label_overlaymax : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNalignment = XmALIGNMENT_END;
-        XmNlabelString = compound_string("Maximum:");
-        XmNx = 230;
-        XmNy = 300;
-        XmNwidth = 80;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_textField_overlaymax : XmTextField widget {
-    arguments {
-        arguments Style_use;
-        XmNx = 310;
-        XmNy = 300;
-        XmNwidth = 110;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_toggleButton_overlay_ctoh : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Cold-to-Hot");
-        XmNwidth = 109;
-        XmNheight = 28;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_toggleButton_overlay_htoc : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Hot-to-Cold");
-        XmNwidth = 109;
-        XmNheight = 28;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_radioBox_overlaymode : XmRadioBox widget {
-    arguments {
-        arguments Style_use;
-        XmNorientation = XmHORIZONTAL;
-        XmNx = 30;
-        XmNy = 330;
-        XmNwidth = 227;
-        XmNheight = 34;
-    };
-    controls {
-         managed XmToggleButton mB3DView_mbview_toggleButton_overlay_ctoh;
-         managed XmToggleButton mB3DView_mbview_toggleButton_overlay_htoc;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_separator5 : XmSeparator widget {
-    arguments {
-        XmNx = 10;
-        XmNy = 360;
-        XmNwidth = 410;
-        XmNheight = 20;
-    };
-    controls {
-    };
-    callbacks {
-    };
-};
-
-object mB3DView_mbview_bulletinBoard_colorbounds : XmBulletinBoardDialog widget {
-    arguments {
-        arguments Style_use;
-        XmNdialogTitle = compound_string("MBview Colors and Contours");
-        XmNautoUnmanage = false;
-        XmNresizePolicy = XmRESIZE_GROW;
-        XmNx = 1061;
-        XmNy = 1114;
-        XmNwidth = 440;
-        XmNheight = 445;
-    };
-    controls {
-         managed XmSeparator mB3DView_mbview_separator5;
-         managed XmRadioBox mB3DView_mbview_radioBox_overlaymode;
-         managed XmTextField mB3DView_mbview_textField_overlaymax;
-         managed XmLabel mB3DView_mbview_label_overlaymax;
-         managed XmTextField mB3DView_mbview_textField_overlaymin;
-         managed XmLabel mB3DView_mbview_label_overlaymin;
-         managed XmLabel mB3DView_mbview_label_overlaybounds;
-         managed XmSeparator mB3DView_mbview_separator3;
-         managed XmRadioBox mB3DView_mbview_radioBox_slopemode;
-         managed XmTextField mB3DView_mbview_textField_slopemax;
-         managed XmLabel mB3DView_mbview_label_slopemax;
-         managed XmTextField mB3DView_mbview_textField_slopemin;
-         managed XmLabel mB3DView_mbview_label_slopemin;
-         managed XmLabel mB3DView_mbview_label_slopebounds;
-         managed XmRadioBox mB3DView_mbview_radioBox_colormode;
-         managed XmTextField mB3DView_mbview_textField_datamax;
-         managed XmTextField mB3DView_mbview_textField_datamin;
-         managed XmLabel mB3DView_mbview_label_colormax;
-         managed XmLabel mB3DView_mbview_label_colormin;
-         managed XmLabel mB3DView_mbview_label_colorbounds;
-         managed XmSeparator mB3DView_mbview_separator2;
-         managed XmPushButton mB3DView_mbview_pushButton_colorbounds_apply;
-         managed XmLabel mB3DView_mbview_label_contour;
-         managed XmTextField mB3DView_mbview_textField_contours;
-         managed XmPushButton mB3DView_mbview_pushButton_colorbounds_dismiss;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-!(BX)object mB3DView_mbview_dialogShell_colorbounds : XmDialogShell widget {
-!(BX)    arguments {
-!(BX)        arguments Style_use;
-!(BX)        XmNtitle = "MB3DView Colors & Contours";
-!(BX)        XmNx = 1061;
-!(BX)        XmNy = 1114;
-!(BX)        XmNwidth = 440;
-!(BX)        XmNheight = 445;
-!(BX)    };
-!(BX)    controls {
-!(BX)         managed XmBulletinBoardDialog mB3DView_mbview_bulletinBoard_colorbounds;
-!(BX)    };
-!(BX)    callbacks {
-!(BX)        callbacks Style_useReasons;
-!(BX)    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-!(BX)};
-
-object mbview_drawingArea_mbview : XmDrawingArea widget {
-    arguments {
-        arguments Style_use;
-        XmNborderWidth = 1;
-        XmNbackground = color('white');
-        XmNmarginHeight = 0;
-        XmNmarginWidth = 0;
-        XmNx = 180;
-        XmNy = 10;
-        XmNwidth = 590;
-        XmNheight = 490;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_label_mouse : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNborderWidth = 1;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNbackground = color('White');
-        XmNlabelString = compound_string("Mouse Mode:", separate=true) &
- compound_string("  R: Pick", separate=true) &
- compound_string("  L: Pan", separate=true) &
- compound_string("  M: Zoom");
-        XmNrecomputeSize = false;
-        XmNx = 10;
-        XmNy = 150;
-        XmNwidth = 160;
-        XmNheight = 80;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_toggleButton_display_2D : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Map Display");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNvalueChangedCallback = procedure do_mbview_display_2D();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_toggleButton_display_3D : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("3D Display");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNvalueChangedCallback = procedure do_mbview_display_3D();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_separator10 : XmSeparator widget {
-    arguments {
-        arguments Style_use;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mbview_toggleButton_data_primary : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Topography");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNvalueChangedCallback = procedure do_mbview_data_primary();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mbview_toggleButton_data_primaryslope : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Topography Slope");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNvalueChangedCallback = procedure do_mbview_data_primaryslope();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_toggleButton_data_secondary : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Overlay");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNvalueChangedCallback = procedure do_mbview_data_secondary();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mbview_separator : XmSeparator widget {
-    arguments {
-        arguments Style_use;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_toggleButton_histogram : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Histogram Equalization");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNvalueChangedCallback = procedure do_mbview_histogram();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mbview_separator21 : XmSeparator widget {
-    arguments {
-        arguments Style_use;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mbview_toggleButton_overlay_none : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("No Shading");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNvalueChangedCallback = procedure do_mbview_overlay_none();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mbview_toggleButton_overlay_illumination : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Shading by Illumination");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNvalueChangedCallback = procedure do_mbview_overlay_illumination();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mbview_toggleButton_overlay_slope : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Shading by Slope");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNvalueChangedCallback = procedure do_mbview_overlay_slope();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_toggleButton_overlay_secondary : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Shading by Overlay");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNvalueChangedCallback = procedure do_mbview_overlay_secondary();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mbview_separator1 : XmSeparator widget {
-    arguments {
-        arguments Style_use;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mbview_toggleButton_overlay_contour : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Topography Contours");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNvalueChangedCallback = procedure do_mbview_overlay_contour();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_toggleButton_site : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Sites");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNvalueChangedCallback = procedure do_mbview_site();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_toggleButton_route : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Routes");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNvalueChangedCallback = procedure do_mbview_route();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_toggleButton_nav : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Navigation");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNvalueChangedCallback = procedure do_mbview_nav();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_toggleButton_navdrape : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Draped Navigation");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNvalueChangedCallback = procedure do_mbview_navdrape();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_toggleButton_vector : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Vector");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNvalueChangedCallback = procedure do_mbview_vector();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_separator8 : XmSeparator widget {
-    arguments {
-        arguments Style_use;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_toggleButton_colortable_haxby : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Haxby Colortable");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNvalueChangedCallback = procedure do_mbview_colortable_haxby();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_toggleButton_colortable_bright : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Bright Rainbow Colortable");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNvalueChangedCallback = procedure do_mbview_colortable_bright();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_toggleButton_colortable_muted : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Muted Rainbow Colortable");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNvalueChangedCallback = procedure do_mbview_colortable_muted();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_toggleButton_colortable_gray : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Grayscale Colortable");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNvalueChangedCallback = procedure do_mbview_colortable_gray();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_toggleButton_colortable_flat : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Flat Gray Colortable");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNvalueChangedCallback = procedure do_mbview_colortable_flat();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_toggleButton_colortable_sealevel1 : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Sealevel1 Colortable");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNvalueChangedCallback = procedure do_mbview_colortable_sealevel1();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_toggleButton_colortable_sealevel2 : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Sealevel2 Colortable");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNvalueChangedCallback = procedure do_mbview_colortable_sealevel2();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_separator1 : XmSeparator widget {
-    arguments {
-    };
-    controls {
-    };
-    callbacks {
-    };
-};
-
-object mB3DView_mbview_toggleButton_profile : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Profile");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNvalueChangedCallback = procedure do_mbview_view_profile();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mbview_pulldownMenu_view : XmPulldownMenu widget {
-    arguments {
-        arguments Style_use;
-        XmNx = 168;
-        XmNy = 462;
-        XmNwidth = 211;
-        XmNheight = 568;
-    };
-    controls {
-         managed XmToggleButton mB3DView_mbview_toggleButton_display_2D;
-         managed XmToggleButton mB3DView_mbview_toggleButton_display_3D;
-         managed XmSeparator mB3DView_mbview_separator10;
-         managed XmToggleButton mbview_toggleButton_data_primary;
-         managed XmToggleButton mbview_toggleButton_data_primaryslope;
-         managed XmToggleButton mB3DView_mbview_toggleButton_data_secondary;
-         managed XmSeparator mbview_separator;
-         managed XmToggleButton mB3DView_mbview_toggleButton_histogram;
-         managed XmSeparator mbview_separator21;
-         managed XmToggleButton mbview_toggleButton_overlay_none;
-         managed XmToggleButton mbview_toggleButton_overlay_illumination;
-         managed XmToggleButton mbview_toggleButton_overlay_slope;
-         managed XmToggleButton mB3DView_mbview_toggleButton_overlay_secondary;
-         managed XmSeparator mbview_separator1;
-         managed XmToggleButton mbview_toggleButton_overlay_contour;
-         managed XmToggleButton mB3DView_mbview_toggleButton_site;
-         managed XmToggleButton mB3DView_mbview_toggleButton_route;
-         managed XmToggleButton mB3DView_mbview_toggleButton_nav;
-         managed XmToggleButton mB3DView_mbview_toggleButton_navdrape;
-         managed XmToggleButton mB3DView_mbview_toggleButton_vector;
-         managed XmSeparator mB3DView_mbview_separator8;
-         managed XmToggleButton mB3DView_mbview_toggleButton_colortable_haxby;
-         managed XmToggleButton mB3DView_mbview_toggleButton_colortable_bright;
-         managed XmToggleButton mB3DView_mbview_toggleButton_colortable_muted;
-         managed XmToggleButton mB3DView_mbview_toggleButton_colortable_gray;
-         managed XmToggleButton mB3DView_mbview_toggleButton_colortable_flat;
-         managed XmToggleButton mB3DView_mbview_toggleButton_colortable_sealevel1;
-         managed XmToggleButton mB3DView_mbview_toggleButton_colortable_sealevel2;
-         managed XmSeparator mB3DView_separator1;
-         managed XmToggleButton mB3DView_mbview_toggleButton_profile;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mbview_cascadeButton_view : XmCascadeButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("View");
-        XmNx = 5;
-        XmNy = 5;
-        XmNwidth = 77;
-        XmNheight = 24;
-    };
-    controls {
-         unmanaged XmPulldownMenu mbview_pulldownMenu_view;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_pushButton_colorbounds : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Colors & Contours");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNactivateCallback = procedure do_mbview_colorboundspopup();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_pushButton_2dview : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("2D Controls");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNactivateCallback = procedure do_mbview_2dparmspopup();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_pushButton_3dview : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("3D Controls");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNactivateCallback = procedure do_mbview_3dparmspopup();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_pushButton_shadeparms : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Shading");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNactivateCallback = procedure do_mbview_shadeparmspopup();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_pushButton_resolution : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Resolution");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNactivateCallback = procedure do_mbview_resolutionpopup();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_pushButton_projections : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Projections");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNactivateCallback = procedure do_mbview_projection_popup();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_pushButton_sitelist : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Site List");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNactivateCallback = procedure do_mbview_sitelistpopup();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_pushButton_routelist : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Route List");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNactivateCallback = procedure do_mbview_routelistpopup();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_pushButton_navlist : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Navigation List");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNactivateCallback = procedure do_mbview_navlistpopup();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mbview_pulldownMenu_controls : XmPulldownMenu widget {
-    arguments {
-        arguments Style_use;
-        XmNx = 0;
-        XmNy = 0;
-        XmNwidth = 144;
-        XmNheight = 220;
-    };
-    controls {
-         managed XmPushButton mB3DView_mbview_pushButton_colorbounds;
-         managed XmPushButton mB3DView_mbview_pushButton_2dview;
-         managed XmPushButton mB3DView_mbview_pushButton_3dview;
-         managed XmPushButton mB3DView_mbview_pushButton_shadeparms;
-         managed XmPushButton mB3DView_mbview_pushButton_resolution;
-         managed XmPushButton mB3DView_mbview_pushButton_projections;
-         managed XmPushButton mB3DView_mbview_pushButton_sitelist;
-         managed XmPushButton mB3DView_mbview_pushButton_routelist;
-         managed XmPushButton mB3DView_mbview_pushButton_navlist;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_cascadeButton_controls : XmCascadeButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Controls");
-        XmNx = 5;
-        XmNy = 29;
-        XmNwidth = 77;
-        XmNheight = 24;
-    };
-    controls {
-         unmanaged XmPulldownMenu mbview_pulldownMenu_controls;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_toggleButton_mode_move : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Pan & Zoom");
-        XmNvisibleWhenOff = false;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNvalueChangedCallback = procedure do_mbview_mouse_mode();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_toggleButton_mode_rotate : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Rotate Model");
-        XmNvisibleWhenOff = false;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNvalueChangedCallback = procedure do_mbview_mouse_mode();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_toggleButton_mode_viewpoint : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Rotate View");
-        XmNvisibleWhenOff = false;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNvalueChangedCallback = procedure do_mbview_mouse_mode();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_toggleButton_mode_shade : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Shading");
-        XmNvisibleWhenOff = false;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNvalueChangedCallback = procedure do_mbview_mouse_mode();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_toggleButton_mode_area : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Pick Area");
-        XmNvisibleWhenOff = false;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNvalueChangedCallback = procedure do_mbview_mouse_mode();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_toggleButton_mode_site : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Edit Sites");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNvalueChangedCallback = procedure do_mbview_mouse_mode();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_toggleButton_mode_route : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Edit Routes");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNvalueChangedCallback = procedure do_mbview_mouse_mode();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_toggleButton_mode_nav : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Select Nav");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNvalueChangedCallback = procedure do_mbview_mouse_mode();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_toggleButton_mode_navfile : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Select Nav File");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNvalueChangedCallback = procedure do_mbview_mouse_mode();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_pulldownMenu_mouse : XmPulldownMenu widget {
-    arguments {
-        arguments Style_use;
-        XmNx = 0;
-        XmNy = 0;
-        XmNwidth = 129;
-        XmNheight = 220;
-    };
-    controls {
-         managed XmToggleButton mB3DView_mbview_toggleButton_mode_move;
-         managed XmToggleButton mB3DView_mbview_toggleButton_mode_rotate;
-         managed XmToggleButton mB3DView_mbview_toggleButton_mode_viewpoint;
-         managed XmToggleButton mB3DView_mbview_toggleButton_mode_shade;
-         managed XmToggleButton mB3DView_mbview_toggleButton_mode_area;
-         managed XmToggleButton mB3DView_mbview_toggleButton_mode_site;
-         managed XmToggleButton mB3DView_mbview_toggleButton_mode_route;
-         managed XmToggleButton mB3DView_mbview_toggleButton_mode_nav;
-         managed XmToggleButton mB3DView_mbview_toggleButton_mode_navfile;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_cascadeButton_mouse : XmCascadeButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Mouse");
-        XmNx = 5;
-        XmNy = 53;
-        XmNwidth = 77;
-        XmNheight = 24;
-    };
-    controls {
-         unmanaged XmPulldownMenu mB3DView_mbview_pulldownMenu_mouse;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mbview_pushButton_help_about : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("About MBview...");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNactivateCallback = procedure do_mbview_aboutpopup();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_pulldownMenu_action : XmPulldownMenu widget {
-    arguments {
-        arguments Style_use;
-        XmNx = 0;
-        XmNy = 0;
-        XmNwidth = 123;
-        XmNheight = 28;
-    };
-    controls {
-         managed XmPushButton mbview_pushButton_help_about;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_cascadeButton_action : XmCascadeButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Action");
-        XmNx = 5;
-        XmNy = 77;
-        XmNwidth = 77;
-        XmNheight = 24;
-    };
-    controls {
-         unmanaged XmPulldownMenu mB3DView_mbview_pulldownMenu_action;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_pushButton_dismiss : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Dismiss");
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNactivateCallback = procedure do_mbview_dismiss();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_pulldownMenu_dismiss : XmPulldownMenu widget {
-    arguments {
-        arguments Style_use;
-        XmNx = 0;
-        XmNy = 0;
-        XmNwidth = 67;
-        XmNheight = 28;
-    };
-    controls {
-         managed XmPushButton mB3DView_mbview_pushButton_dismiss;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_cascadeButton_dismiss : XmCascadeButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Dismiss");
-        XmNx = 5;
-        XmNy = 101;
-        XmNwidth = 77;
-        XmNheight = 24;
-    };
-    controls {
-         unmanaged XmPulldownMenu mB3DView_mbview_pulldownMenu_dismiss;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mbview_menuBar_mbview : XmMenuBar widget {
-    arguments {
-        arguments Style_use;
-        XmNorientation = XmVERTICAL;
-        XmNx = 10;
-        XmNy = 10;
-        XmNwidth = 87;
-        XmNheight = 130;
-    };
-    controls {
-         managed XmCascadeButton mbview_cascadeButton_view;
-         managed XmCascadeButton mB3DView_mbview_cascadeButton_controls;
-         managed XmCascadeButton mB3DView_mbview_cascadeButton_mouse;
-         managed XmCascadeButton mB3DView_mbview_cascadeButton_action;
-         managed XmCascadeButton mB3DView_mbview_cascadeButton_dismiss;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_label_pickinfo : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNborderWidth = 1;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNbackground = color('White');
-        XmNlabelString = compound_string("Pick Info:", separate=true) &
- compound_string("Lon 1: -122.894345 W", separate=true) &
- compound_string("Lat 1: 37.308996 N", separate=true) &
- compound_string("Depth 1: -324.314 m", separate=true) &
- compound_string("Lon 2: -122.545680 W", separate=true) &
- compound_string("Lat 2: 36.640972 N", separate=true) &
- compound_string("Depth 2: -2338.025 m", separate=true) &
- compound_string("Bearing: 157.4 deg", separate=true) &
- compound_string("Distance: 80333.459 m");
-        XmNrecomputeSize = false;
-        XmNx = 10;
-        XmNy = 240;
-        XmNwidth = 160;
-        XmNheight = 160;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_pushButton_fullrez : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Full");
-        XmNx = 10;
-        XmNy = 410;
-        XmNwidth = 50;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNactivateCallback = procedure do_mbview_full_render();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_label_status : XmLabel widget {
-    arguments {
-        arguments Style_use;
-        XmNborderWidth = 1;
-        XmNalignment = XmALIGNMENT_BEGINNING;
-        XmNbackground = color('White');
-        XmNlabelString = compound_string("Done.");
-        XmNrecomputeSize = false;
-        XmNx = 10;
-        XmNy = 450;
-        XmNwidth = 160;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_toggleButton_mode_rmove : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Pan & Zoom");
-        XmNshadowThickness = 2;
-        XmNvisibleWhenOff = false;
-        XmNheight = 32;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNvalueChangedCallback = procedure do_mbview_mouse_rmode();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_toggleButton_mode_rrotate : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Rotate Model");
-        XmNshadowThickness = 2;
-        XmNvisibleWhenOff = false;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNvalueChangedCallback = procedure do_mbview_mouse_rmode();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_toggleButton_mode_rviewpoint : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Rotate View");
-        XmNshadowThickness = 2;
-        XmNvisibleWhenOff = false;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNvalueChangedCallback = procedure do_mbview_mouse_rmode();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_toggleButton_mode_rshade : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Shading");
-        XmNshadowThickness = 2;
-        XmNvisibleWhenOff = false;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNvalueChangedCallback = procedure do_mbview_mouse_rmode();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_toggleButton_mode_rarea : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Pick Area");
-        XmNshadowThickness = 2;
-        XmNvisibleWhenOff = false;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNvalueChangedCallback = procedure do_mbview_mouse_rmode();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_toggleButton_mode_rsite : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Edit Sites");
-        XmNshadowThickness = 2;
-        XmNvisibleWhenOff = false;
-        XmNwidth = 125;
-        XmNheight = 32;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNvalueChangedCallback = procedure do_mbview_mouse_rmode();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_toggleButton_mode_rroute : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Edit Routes");
-        XmNshadowThickness = 2;
-        XmNvisibleWhenOff = false;
-        XmNwidth = 125;
-        XmNheight = 32;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNvalueChangedCallback = procedure do_mbview_mouse_rmode();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_toggleButton_mode_rnav : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Pick Nav");
-        XmNshadowThickness = 2;
-        XmNvisibleWhenOff = false;
-        XmNwidth = 125;
-        XmNheight = 32;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNvalueChangedCallback = procedure do_mbview_mouse_rmode();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_toggleButton_mode_rnavfile : XmToggleButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Pick Nav File");
-        XmNshadowThickness = 2;
-        XmNvisibleWhenOff = false;
-        XmNwidth = 125;
-        XmNheight = 32;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNvalueChangedCallback = procedure do_mbview_mouse_rmode();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_radioBox_mouse : XmRadioBox widget {
-    arguments {
-        arguments Style_use;
-        XmNborderWidth = 2;
-        XmNspacing = 0;
-        XmNx = 10;
-        XmNy = 490;
-        XmNwidth = 131;
-        XmNheight = 294;
-    };
-    controls {
-         managed XmToggleButton mB3DView_mbview_toggleButton_mode_rmove;
-         managed XmToggleButton mB3DView_mbview_toggleButton_mode_rrotate;
-         managed XmToggleButton mB3DView_mbview_toggleButton_mode_rviewpoint;
-         managed XmToggleButton mB3DView_mbview_toggleButton_mode_rshade;
-         managed XmToggleButton mB3DView_mbview_toggleButton_mode_rarea;
-         managed XmToggleButton mB3DView_mbview_toggleButton_mode_rsite;
-         managed XmToggleButton mB3DView_mbview_toggleButton_mode_rroute;
-         managed XmToggleButton mB3DView_mbview_toggleButton_mode_rnav;
-         managed XmToggleButton mB3DView_mbview_toggleButton_mode_rnavfile;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_pushButton_reset : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Reset");
-        XmNx = 60;
-        XmNy = 410;
-        XmNwidth = 50;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNactivateCallback = procedure do_mbview_reset_view();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mB3DView_mbview_pushButton_clearpicks : XmPushButton widget {
-    arguments {
-        arguments Style_use;
-        XmNlabelString = compound_string("Clear");
-        XmNx = 110;
-        XmNy = 410;
-        XmNwidth = 60;
-        XmNheight = 30;
-    };
-    controls {
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNactivateCallback = procedure do_mbview_clearpicks();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-
-object mbview_bulletinBoard_mbview : XmBulletinBoard widget {
-    arguments {
-!(BX) BxNclassOnly = "MB3DView";
-!(BX) BxNsubclassDerived = "False";
-!(BX) BxNclassOnlyFile = "False";
-!(BX) BxNbaseInclude = asciz_string_table('');
-!(BX) BxNderivedInclude = asciz_string_table('');
-!(BX) BxNderived = "MB3DViewDerived";
-!(BX) BxNfilebase = "MB3DViewDerived";
-!(BX) BxNclassFilebase = "MB3DView";
-!(BX) BxNclassGeometry = "801x814+76+447";
-!(BX) BxNgenerate = "True";
-!(BX) BxNreference = "True";
-!(BX) BxNpaletteGroup = "Project Classes";
-!(BX) BxNpaletteName = "MB3DView";
-!(BX) BxNpaletteGeom = "+0+0";
-        arguments Style_use;
-        XmNresizePolicy = XmRESIZE_GROW;
-        XmNx = 76;
-        XmNy = 447;
-        XmNwidth = 801;
-        XmNheight = 814;
-    };
-    controls {
-         managed XmPushButton mB3DView_mbview_pushButton_clearpicks;
-         managed XmPushButton mB3DView_mbview_pushButton_reset;
-         managed XmRadioBox mB3DView_mbview_radioBox_mouse;
-         managed XmLabel mB3DView_mbview_label_status;
-         managed XmPushButton mB3DView_mbview_pushButton_fullrez;
-         managed XmLabel mB3DView_mbview_label_pickinfo;
-         managed XmMenuBar mbview_menuBar_mbview;
-         managed XmLabel mB3DView_mbview_label_mouse;
-         managed XmDrawingArea mbview_drawingArea_mbview;
-!(BX)         unmanaged XmDialogShell mB3DView_mbview_dialogShell_colorbounds;
-!(BX)         unmanaged XmDialogShell mB3DView_mbview_dialogShell_resolution;
-!(BX)         unmanaged XmDialogShell mB3DView_mbview_dialogShell_message;
-!(BX)         unmanaged XmDialogShell mB3DView_mbview_dialogShell_about;
-!(BX)         unmanaged XmDialogShell mB3DView_mbview_dialogShell_shadeparms;
-!(BX)         unmanaged XmDialogShell mB3DView_mbview_dialogShell_3dparms;
-!(BX)         unmanaged XmDialogShell mB3DView_mbview_dialogShell_2dparms;
-!(BX)         unmanaged XmDialogShell mB3DView_mbview_dialogShell_projection;
-!(BX)         unmanaged XmDialogShell mB3DView_mbview_dialogShell_profile;
-    };
-    callbacks {
-        callbacks Style_useReasons;
-        XmNdestroyCallback = procedure do_mbview_goaway();
-    };
-!(BX)    handlers {
-!(BX)        handlers Style_useHandlers;
-!(BX)    };
-};
-end module;
diff --git a/src/mbview/mbview_bxutils.c b/src/mbview/mbview_bxutils.c
deleted file mode 100644
index 2f225ad..0000000
--- a/src/mbview/mbview_bxutils.c
+++ /dev/null
@@ -1,4026 +0,0 @@
-
-/* Begin user code block <abstract> */
-/* End user code block <abstract> */
-
-/**
- * WARNING: This file is overwritten at code generation time.
- * Any changes to this file will be lost.
- */
-/*
- * MODULE: BxConvert.c
- * AUTHOR: Automatically generated by Builder Xcessory
- *
- * Description: This module contains various utilities, converters
- *	for XmStrings (to work properly with app-defaults), and if needed
- *	the XPM pixmap utilities.
- *
- * Edit the file ${BX}/gen/bxutils.c (BX$SYSTEM:[gen]bxutils.c on VMS) to
- * make system wide changes to this file which will be visible next time
- * this file is generated.
- * ${BX} is the directory where Builder Xcessory is installed.
- */
-
-/*
- * BX supplies a string format for compound strings:
- *
- *		::[#tag][:t][:r]["str"]
- *
- * where:
- *	:: = indicates compound string.
- *	tag =  the font tag
- *	:t = separator (if not seen no separator added to segment)
- *	:r = right to left (if not seen left to right assumed)
- *	"str" = the text of the string.
- *
- * The components for the compound string can be repeated any number of
- * times.
- */
-
-/*****************************************************************************
- *       INCLUDE FILES
- *****************************************************************************/
-#ifdef HAVE_CONFIG_H
-#include <mb_config.h>
-#endif
-
-#if defined(__hpux)
-#define XLIB_ILLEGAL_ACCESS
-#endif
-#include <Xm/Xm.h>
-#include <Xm/RowColumn.h>
-#include <stdio.h>
-#include <ctype.h>
-#include <string.h>
-
-/*
- * Include stdlib.h and malloc.h if code is C++, ANSI, or Extended ANSI.
- */
-#if defined(__cplusplus) || defined(__STDC__) || defined(__EXTENSIONS__)
-#include <stdlib.h>
-#ifdef HAVE_MALLOC_H
-#include <malloc.h>
-#endif
-#endif
-
-/*****************************************************************************
- *       TYPDEFS AND DEFINES
- *****************************************************************************/
-
-/*
- * Undefine this if you want to use native strcasecmp.
- */
-#define LOCAL_STRCASECMP
-
-#ifdef _NO_PROTO
-#ifdef NeedFunctionPrototypes
-#undef NeedFunctionPrototypes
-#endif
-#endif
-
-/*
- * Define SUPPORTS_WCHARS if the system supports wide character sets
- * Note: the following line flags the VAXC compiler and not the
- * DECC compiler running VAXC emulation.
- */
-#if !((defined(VAXC) && !defined(__DECC)) || defined(__CENTERLINE__))
-#define SUPPORTS_WCHARS
-#endif
-
-/*
- * Handy definition used in SET_BACKGROUND_COLOR
-*/
-#define UNSET		(-1)
-
-/*
- * Set state of inclusion of prototypes properly
- */
-#ifdef NeedFunctionPrototypes
-#define ARGLIST(p)	(
-#define ARG(a, b)	a b,
-#define GRA(a, b)	a b)
-#else
-#define ARGLIST(p)	p
-#define ARG(a, b)	a b;
-#define GRA(a, b)	a b;
-#endif
-
-#ifdef NeedFunctionPrototypes
-#ifdef __cplusplus
-#define UARG(a, b)	a,
-#define GRAU(a, b)	a)
-#else
-#define UARG(a, b)	a b,
-#define GRAU(a, b)	a b)
-#endif
-#else
-#define UARG(a, b)	a b;
-#define GRAU(a, b)	a b;
-#endif
-
-/*
- * Set up strcasecmp function
- */
-#if defined(LOCAL_STRCASECMP)
-#define STRCASECMP	StrCasecmp
-#ifndef NeedFunctionPrototypes
-static int StrCasecmp();
-#else
-static int StrCasecmp(char*, char*);
-#endif
-#else
-#define STRCASECMP	strcasecmp
-#endif
-
-/*
- * Define XTPOINTER so it works with all releases of
- * Xt and c++.
- */
-#ifdef __cplusplus
-#if XtSpecificationRelease < 5
-#define XTPOINTER	char *
-#else
-#define XTPOINTER	XPointer
-#endif
-#else
-#define XTPOINTER	XtPointer
-#endif
-
-/*
- * The following enum is used to support wide character sets.
- * Use this enum for references into the Common Wide Characters array.
- * If you add to the array, ALWAYS keep NUM_COMMON_WCHARS as the last
- * entry in the enum.  This will maintain correct memory usage, etc.
- */
-enum { WNull, WTab, WNewLine, WCarriageReturn, WFormFeed, WVerticalTab,
-       WBackSlash, WQuote, WHash, WColon, WideF, WideL, WideN, WideR,
-       WideT, WideV, WideUF, WideUL, WideUR, WideUT, WideZero, WideOne,
-       NUM_COMMON_WCHARS };
-
-/*****************************************************************************
- *       GLOBAL DECLARATIONS
- *****************************************************************************/
-
-/*****************************************************************************
- *       EXTERNAL DECLARATIONS
- *****************************************************************************/
-
-/*****************************************************************************
- *	STATIC DECLARATION
- *****************************************************************************/
-
-#ifndef NeedFunctionPrototypes
-
-#ifndef SUPPORTS_WCHARS
-static int	 mblen			();
-#endif
-static int	strlenWc		();
-static size_t	doMbstowcs		();
-static size_t	doWcstombs 		();
-static void	copyWcsToMbs		();
-static int 	dombtowc		();
-static Boolean	extractSegment		();
-static XmString	StringToXmString	();
-static char*	getNextCStrDelim	();
-static int	getCStrCount		();
-static wchar_t *CStrCommonWideCharsGet	();
-
-#else
-
-#ifndef SUPPORTS_WCHARS
-static int 	mblen			(char*, size_t);
-#endif
-static int	strlenWc		(wchar_t*);
-static size_t	doMbstowcs		(wchar_t*, char*, size_t);
-static size_t	doWcstombs 		(char*, wchar_t*, size_t);
-static void	copyWcsToMbs		(char*, wchar_t*, int, Boolean);
-static int 	dombtowc		(wchar_t*, char*, size_t);
-static Boolean	extractSegment		(wchar_t**, wchar_t**, int *,
-					 wchar_t**, int*, int*,	Boolean*);
-static XmString	StringToXmString	(char*);
-static char*	getNextCStrDelim	(char*);
-static int	getCStrCount		(char*);
-static wchar_t *CStrCommonWideCharsGet	();
-
-#endif
-
-/*****************************************************************************
- *	STATIC CODE
- *****************************************************************************/
-
-#if defined(LOCAL_STRCASECMP)
-
-/*
- * Function:
- *      cmp = StrCasecmp(s1, s2);
- * Description:
- *      Compare two strings ignoring case
- * Input:
- *      s1 - char * : string 1 to compare
- *      s2 - char * : string 2 to compare
- * Output:
- *      int :  0; s1 == s2
- *             1; s1 != s2
- */
-static int StrCasecmp
-    ARGLIST((s1, s2))
-        ARG(register char *, s1)
-        GRA(register char *, s2)
-{
-    register int        c1, c2;
-
-    while (*s1 && *s2)
-    {
-        c1 = isupper(*s1) ? tolower(*s1) : *s1;
-        c2 = isupper(*s2) ? tolower(*s2) : *s2;
-        if (c1 != c2)
-        {
-            return(1);
-        }
-        s1++;
-        s2++;
-    }
-    if (*s1 || *s2)
-    {
-        return(1);
-    }
-    return(0);
-}
-#endif
-
-#ifndef SUPPORTS_WCHARS
-/*
- * Function:
- *      len = mblen(s, n);
- * Description:
- *      The mblen function for platforms that don't have one. This
- * 	function simply returns a length of 1 since no wide character
- *	support exists for this platform.
- * Input:
- *      s - char * : the character string to get the length from
- *	n - size_t : the size of the string
- * Output:
- *      int : always 1
- */
-static int mblen
-    ARGLIST((s, n))
-        ARG(char *, s)
-        GRA(size_t, n)
-{
-    return(1);
-}
-#endif
-
-/*
- * Function:
- *      len = strlenWc(ptr);
- * Description:
- *      Return the number of characters in a wide character string (not
- *	the characters in the resultant mbs).
- * Input:
- *      ptr - wchar_t* : pointer to the wcs to count
- * Output:
- *      int : the number of characters found
- */
-static int strlenWc
-    ARGLIST((ptr))
-        GRA(wchar_t *,ptr)
-{
-    register wchar_t	*p = ptr;
-    register int	x = 0;
-
-    if (!ptr) return(0);
-
-    while (*p++) x++;
-    return (x);
-}
-
-/*
- * Function:
- *      bytesConv = doMbstowcs(wcs, mbs, n);
- * Description:
- *      Create a wcs string from an input mbs.
- * Input:
- *	wcs - wchar_t* : pointer to result buffer of wcs
- *      mbs - char* : pointer to the source mbs
- *	n - size_t : the number of characters to convert
- * Output:
- *      bytesConv - size_t : number of bytes converted
- */
-static size_t doMbstowcs
-    ARGLIST((wcs, mbs, n))
-        ARG(wchar_t *,wcs)
-        ARG(char *, mbs)
-        GRA(size_t, n)
-{
-#ifndef SUPPORTS_WCHARS
-    int i;
-
-    for (i = 0; i < n && mbs[i] != 0; ++i)
-    {
-	wcs[i] = mbs[i];
-    }
-    wcs[i++] = 0;
-    return(i);
-#else
-    return(mbstowcs(wcs, mbs, n));
-#endif
-}
-
-/*
- * Function:
- *      bytesConv = doWcstombs(wcs, mbs, n);
- * Description:
- *      Create a mbs string from an input wcs.
- * Input:
- *	wcs - wchar_t* : pointer to the source wcs
- *      mbs - char* : pointer to result mbs buffer
- *	n - size_t : the number of characters to convert
- * Output:
- *      bytesConv - size_t : number of bytes converted
- */
-static size_t doWcstombs
-    ARGLIST((mbs, wcs, n))
-        ARG(char *, mbs)
-        ARG(wchar_t *, wcs)
-        GRA(size_t, n)
-{
-#ifndef SUPPORTS_WCHARS
-    int i;
-
-    for (i = 0; i < n && wcs[i] != 0; ++i)
-    {
-	mbs[i] = wcs[i];
-    }
-    mbs[i] = 0;
-    return(i);
-#else
-    size_t	retval;
-
-    retval = wcstombs(mbs, wcs, (n * sizeof(wchar_t)));
-    if ( retval == (size_t)-1 ) return(0);
-    else return(retval);
-#endif
-}
-
-/*
- * Function:
- *      copyWcsToMbs(mbs, wcs, len);
- * Description:
- *      Create a mbs string from an input wcs. This function allocates
- *	a buffer if necessary.
- * Input:
- *	mbs - char* : destination for the converted/copied output
- *	wcs - wchar_t* : pointer to wcs to copy/convert
- *	len - int : the number of wchar_t' to convert
- *	process_it - Boolean : True if processing of quoted charcters,
- *			False if blind.
- * Output:
- *      None
- */
-static void copyWcsToMbs
-    ARGLIST((mbs, wcs, len, process_it))
-        ARG(char *, mbs)
-        ARG(wchar_t *, wcs)
-        ARG(int, len)
-        GRA(Boolean, process_it)
-{
-    static	wchar_t	*tbuf = NULL;
-    static	int	tbufSize = 0;
-
-    int		numCvt;
-    int		lenToConvert;
-    wchar_t	*fromP = wcs;
-    wchar_t	*x = &fromP[len];
-    wchar_t	*toP;
-    wchar_t	*commonWChars = CStrCommonWideCharsGet();
-    wchar_t	tmp;
-
-    /*
-     * Make sure there's room in the buffer
-     */
-    if (tbufSize < len)
-    {
-	tbuf = (wchar_t*)XtRealloc((char*)tbuf, (len + 1) * sizeof(wchar_t));
-	tbufSize = len;
-    }
-
-    /*
-     * Now copy and process
-     */
-    toP = tbuf;
-    lenToConvert = 0;
-    while (fromP < x)
-    {
-	/*
-	 * Check for quoted characters
-	 */
-	if ((*fromP == commonWChars[WBackSlash]) && process_it)
-	{
-	    fromP++;		/* Skip quote */
-	    if (fromP == x)	/* Hanging quote? */
-	    {
-		*toP++ = commonWChars[WBackSlash];
-		lenToConvert++;
-		break;
-	    }
-	    tmp = *fromP++;
-	    if (tmp == commonWChars[WideN])
-	    {
-		*toP++ = commonWChars[WNewLine];
-	    }
-	    else if (tmp == commonWChars[WideT])
-	    {
-		*toP++ = commonWChars[WTab];
-	    }
-	    else if (tmp == commonWChars[WideR])
-	    {
-		*toP++ = commonWChars[WCarriageReturn];
-	    }
-	    else if (tmp == commonWChars[WideF])
-	    {
-		*toP++ = commonWChars[WFormFeed];
-	    }
-	    else if (tmp == commonWChars[WideV])
-	    {
-		*toP++ = commonWChars[WVerticalTab];
-	    }
-	    else if (tmp == commonWChars[WBackSlash])
-	    {
-		*toP++ = commonWChars[WBackSlash];
-	    }
-	    else
-	    {
-                /*
-		 * No special translation needed
-		 */
-		*toP++ = tmp;
-	    }
-	}
-	else
-	{
-	    *toP++ = *fromP++;
-	}
-	lenToConvert++;
-    }
-
-    tmp = tbuf[lenToConvert];
-    tbuf[lenToConvert] = (wchar_t) 0;
-    numCvt = doWcstombs(mbs, tbuf, lenToConvert);
-    tbuf[lenToConvert] = tmp;
-
-    mbs[numCvt] = '\0';
-}
-
-/*
- * Function:
- *      status = dombtowc(wide, multi, size);
- * Description:
- *      Convert a multibyte character to a wide character.
- * Input:
- *      wide	- wchar_t *	: where to put the wide character
- *	multi	- char *	: the multibyte character to convert
- *	size	- size_t	: the number of characters to convert
- * Output:
- *      0	- if multi is a NULL pointer or points to a NULL character
- *	#bytes	- number of bytes in the multibyte character
- *	-1	- multi is an invalid multibyte character.
- *
- *	NOTE:  if wide is NULL, then this returns the number of bytes in
- *	       the multibyte character.
- */
-static int dombtowc
-    ARGLIST((wide, multi, size))
-        ARG(wchar_t *, wide)
-        ARG(char *, multi)
-        GRA(size_t, size)
-{
-    int		retVal = 0;
-
-#ifndef SUPPORTS_WCHARS
-    if ((multi == NULL) || (*multi == '\000'))
-    {
-	if (wide) wide[0] = '\0';
-	return (0);
-    }
-
-    for (retVal = 0; retVal < size && multi[retVal] != '\000'; retVal++)
-    {
-	if (wide != NULL)
-	{
-	    wide[retVal] = multi[retVal];
-	}
-    }
-#else
-    retVal = mbtowc(wide, multi, size);
-#endif
-    return(retVal);
-}
-
-/*
- * Function:
- *	ptr = getNextSepartor(str);
- * Description:
- *	Parse through a string looking for the next compound string
- *	field separator
- * Inputs:
- *	str - wchar_t* : the address of address of the string to parse
- * Outputs:
- *	ptr - wchar_t* : pointer to character, if found, points to end
- *			of string otherwise ('\0').
- */
-static wchar_t* getNextSeparator
-    ARGLIST((str))
-        GRA(wchar_t *, str)
-{
-    wchar_t	*ptr = str;
-    wchar_t	*commonWChars = CStrCommonWideCharsGet();
-
-    while (*ptr)
-    {
-	/*
-	 * Check for separator
-	 */
-	if ((*ptr == commonWChars[WHash]) ||
-	    (*ptr == commonWChars[WQuote]) ||
-	    (*ptr == commonWChars[WColon]))
-	{
-	    return(ptr);
-	}
-	else if (*ptr == commonWChars[WBackSlash])
-	{
-	    ptr++;
-	    if (*ptr) ptr++;	/* Skip quoted character */
-	}
-	else
-	{
-	    ptr++;
-	}
-    }
-    return(ptr);
-}
-
-/*
- * Function:
- *	more =
- *        extractSegment(str, tagStart, tagLen, txtStart, txtLen,
- *			pDir, pSep);
- * Description:
- *	Parse through a string version of a compound string and extract
- *	the first compound string segment from the string.
- * Inputs:
- *	str - char** : the address of address of the string to parse
- *	tagStart - char** : address to return pointer to tag start into
- *	tagLen - int* : address where to return the tag length into
- *	txtStart - char** : address to return the text start into
- *	txtLen - int* : address where to return the text length
- *	pDir - int* : address to return the string direction into
- *	pSep - Boolean * : address to return the separtor into
- * Outputs:
- *	more - Boolean : True if more of the string to parse.
- *			False means done.
- */
-static Boolean extractSegment
-    ARGLIST((str, tagStart, tagLen, txtStart, txtLen, pDir, pSep))
-        ARG(wchar_t **, str)
-        ARG(wchar_t **, tagStart)
-        ARG(int *, tagLen)
-        ARG(wchar_t **, txtStart)
-        ARG(int *, txtLen)
-        ARG(int *, pDir)
-        GRA(Boolean *, pSep)
-{
-    wchar_t		*start;
-    wchar_t		*text;
-    int			textL;
-    Boolean		tagSeen;
-    wchar_t		*tag;
-    int			tagL;
-    Boolean		modsSeen;
-    Boolean		sep;
-    int			dir;
-    Boolean		done;
-    Boolean		checkDir;
-    wchar_t		*commonWChars;
-    wchar_t		emptyStrWcs[1];
-
-    /*
-     * Initialize variables
-     */
-    text = NULL;
-    textL = 0;
-    tagSeen = False;
-    tag = NULL;
-    tagL = 0;
-    modsSeen = False;
-    dir = XmSTRING_DIRECTION_L_TO_R;
-    sep = False;
-    done = False;
-    commonWChars = CStrCommonWideCharsGet();
-
-    /*
-     * Guard against nulls
-     */
-    if (!(start = *str))
-    {
-	start = emptyStrWcs;
-	emptyStrWcs[0] = commonWChars[WNull];
-    }
-
-    /*
-     * If the first character of the string isn't a # or a ", then we
-     * just have a regular old simple string. Do the same the thing for
-     * the empty string.
-     */
-    if ((*start == '\0') || (start != getNextSeparator(start)))
-    {
-	text = start;
-	if (!(textL = strlenWc(start)))
-	{
-	    text = NULL;
-	}
-	start += textL;
-    }
-    else
-    {
-	done = False;
-	while (!done)
-	{
-	    if (*start == commonWChars[WHash])
-	    {
-		if (tagSeen)
-		{
-		    done = True;
-		    break;
-		}
-		else
-		{
-		    tagSeen = True;
-		    tag = ++start;
-		    start = getNextSeparator(tag);
-		    if ((tagL = start - tag) == 0)
-		    {
-			tag = NULL;		/* Null tag specified */
-		    }
-		}
-	    }
-	    else if (*start == commonWChars[WQuote])
-	    {
-		text = ++start;
-		start = getNextSeparator(start);
-		while (!((*start == commonWChars[WQuote]) ||
-			 (*start == commonWChars[WNull])))
-		{
-		    start = getNextSeparator(++start);
-		}
-
-		if ((textL = start - text) == 0)
-		{
-		    text = NULL;	/* Null text specified  */
-		}
-                /*
-		 * if a quote, skip over it
-		 */
-		if (*start == commonWChars[WQuote])
-		{
-		    start++;
-		}
-		done = True;
-	    }
-	    else if (*start == commonWChars[WColon])
-	    {
-		if (modsSeen)
-		{
-		    done = True;
-		    break;
-		}
-
-		/*
-		 * If the next character is a t or f, the we've got
-		 * a separator.
-		 */
-		modsSeen = True;
-		checkDir = False;
-		start++;
-		if ((*start == commonWChars[WideT]) ||
-		    (*start == commonWChars[WideUT]) ||
-		    (*start == commonWChars[WideOne]))
-		{
-		    sep = True;
-		    start++;
-		    checkDir = True;
-		}
-		else if ((*start == commonWChars[WideF]) ||
-			 (*start == commonWChars[WideUF]) ||
-			 (*start == commonWChars[WideZero]))
-		{
-		    sep = False;
-		    start++;
-		    checkDir = True;
-		}
-		else if ((*start == commonWChars[WideR]) ||
-			 (*start == commonWChars[WideUR]))
-		{
-		    start++;
-		    dir = XmSTRING_DIRECTION_R_TO_L;
-		}
-		else if ((*start == commonWChars[WideL]) ||
-			 (*start == commonWChars[WideUL]))
-		{
-		    start++;
-		    dir = XmSTRING_DIRECTION_L_TO_R;
-		}
-		/*
-		 * Look for direction if necessary. This requires a bit of
-		 * look ahead.
-		 */
-		if (checkDir && (*start == commonWChars[WColon]))
-		{
-		    if ((*(start + 1) == commonWChars[WideL]) ||
-			(*(start + 1) == commonWChars[WideUL]))
-		    {
-			dir = XmSTRING_DIRECTION_L_TO_R;
-			start += 2;
-		    }
-		    else if ((*(start + 1) == commonWChars[WideR]) ||
-			     (*(start + 1) == commonWChars[WideUR]))
-		    {
-			dir = XmSTRING_DIRECTION_R_TO_L;
-			start+=2;
-		    }
-		}
-	    }
-            else
-	    {
-		/*
-		 * A bad string format! We'll just skip the character.
-		 */
-		start++;
-	    }
-	}
-    }
-
-    /*
-     * Now fill in return values
-     */
-    if (*str)		*str = start;
-    if (tagStart)	*tagStart = tag;
-    if (tagLen)		*tagLen = tagL;
-    if (txtStart)	*txtStart = text;
-    if (txtLen)		*txtLen = textL;
-    if (pDir)		*pDir = dir;
-    if (pSep)		*pSep = sep;
-
-    return ((*start == commonWChars[WNull]) ? False : True);
-}
-
-/*
- * Function:
- *	xstr = StringToXmString(str);
- * Description:
- *	Parse a string into an XmString.
- * Inputs:
- *	str - char * : the string to parse
- * Outputs:
- *	xstr - XmString : the allocated return structure
- */
-static XmString StringToXmString
-    ARGLIST((str))
-        GRA(char *,str)
-{
-    static char*	tagBuf = NULL;
-    static int		tagBufLen = 0;
-    static char*	textBuf = NULL;
-    static int		textBufLen = 0;
-
-    wchar_t		*ctx;
-    wchar_t		*tag;
-    int			tagLen;
-    wchar_t		*text;
-    int			textLen;
-    Boolean		sep;
-    int			dir;
-
-    Boolean		more;
-    wchar_t		*wcStr;
-    int			curDir;
-    XmString		xmStr;
-    XmString		s1;
-    XmString		s2;
-
-    if (!str) return(NULL);
-
-    /*
-     * For expediencies sake, we'll overallocate this buffer so that
-     * the wcs is guaranteed to fit (1 wc per byte in original string).
-     */
-    wcStr = (wchar_t*)XtMalloc((strlen(str) + 1) * sizeof(wchar_t));
-    doMbstowcs(wcStr, str, strlen(str) + 1);
-
-    /*
-     * Create the beginning segment
-     */
-    curDir = XmSTRING_DIRECTION_L_TO_R;
-    xmStr = XmStringDirectionCreate(curDir);
-
-    /*
-     * Convert the string.
-     */
-    more = True;
-    ctx = wcStr;
-    while (more)
-    {
-	more = extractSegment(&ctx, &tag, &tagLen,
-			      &text, &textLen, &dir, &sep);
-	/*
-	 * Pick up a direction change
-	 */
-	if (dir != curDir)
-	{
-#if defined(VMS) || (defined(__osf__) && defined(__alpha))
-#if XmVERSION > 1 || (XmVERSION == 1 && XmREVISION >= 2)
-	    /*
-	     * This is required on DEC Windows systems because they've
-	     * added the REVERT direction.
-	     */
-	    s1 = XmStringDirectionCreate(XmSTRING_DIRECTION_REVERT);
-	    s2 = xmStr;
-	    xmStr = XmStringConcat(s2, s1);
-	    XmStringFree(s1);
-	    XmStringFree(s2);
-#endif
-#endif
-	    curDir = dir;
-	    s1 = XmStringDirectionCreate(curDir);
-	    s2 = xmStr;
-	    xmStr = XmStringConcat(s2, s1);
-	    XmStringFree(s1);
-	    XmStringFree(s2);
-
-	}
-
-	/*
-	 * Create the segment. Text and tag first.
-	 */
-	if (textLen)
-	{
-	    if (textBufLen <= (textLen * sizeof(wchar_t)))
-	    {
-		textBufLen = (textLen + 1) * sizeof(wchar_t);
-		textBuf = (char*)XtRealloc(textBuf, textBufLen);
-	    }
-	    copyWcsToMbs(textBuf, text, textLen, True);
-
-	    if (tagLen)
-	    {
-		if (tagBufLen <= (tagLen * sizeof(wchar_t)))
-		{
-		    tagBufLen = (tagLen + 1) * sizeof(wchar_t);
-		    tagBuf = (char*)XtRealloc(tagBuf, tagBufLen);
-		}
-		copyWcsToMbs(tagBuf, tag, tagLen, False);
-	    }
-	    else
-	    {
-		if (!tagBuf)
-		{
-		    tagBufLen = strlen(XmSTRING_DEFAULT_CHARSET) + 1;
-		    tagBuf = (char*)XtMalloc(tagBufLen);
-		}
-		strcpy(tagBuf, XmSTRING_DEFAULT_CHARSET);
-	    }
-
-	    s1 = XmStringCreate(textBuf, tagBuf);
-	    s2 = xmStr;
-	    xmStr = XmStringConcat(s2, s1);
-	    XmStringFree(s1);
-	    XmStringFree(s2);
-	}
-
-	/*
-	 * Add in the separators.
-	 */
-	if (sep)
-	{
-	    s1 = XmStringSeparatorCreate();
-	    s2 = xmStr;
-	    xmStr = XmStringConcat(s2, s1);
-	    XmStringFree(s1);
-	    XmStringFree(s2);
-	}
-    }
-
-    /*
-     * Free up memory and return
-     */
-    XtFree((char*)wcStr);
-    return(xmStr);
-}
-
-/*
- * Function:
- *      nextCStr = getNextCStrDelim(str);
- * Description:
- *      Find the next unquoted , or \n in the string
- * Input:
- *	str - char * : the input string
- * Output:
- *      nextCStr - char* : pointer to the next delimiter. Returns NULL if no
- *			delimiter found.
- */
-static char* getNextCStrDelim
-    ARGLIST((str))
-        GRA(char *,str)
-{
-    char	*comma = str;
-    Boolean	inQuotes = False;
-    int		len;
-
-    if (!str) return(NULL);
-    if (!*str) return(NULL);	/* At end */
-
-#ifdef __CENTERLINE__
-    len = mblen((char *)NULL, sizeof(wchar_t));
-#else
-    len = mblen(NULL, sizeof(wchar_t));
-#endif
-    while (*comma)
-    {
-	if ((len = mblen(comma, sizeof(wchar_t))) > 1)
-	{
-	    comma += len;
-	    continue;
-	}
-
-	if (*comma == '\\')
-	{
-	    comma++;	/* Over quote */
-	    comma += mblen(comma, sizeof(wchar_t));
-	    continue;
-	}
-
-	/*
-	 * See if we have a delimiter
-	 */
-	if (!inQuotes)
-	{
-	    if ((*comma == ',') || (*comma == '\012'))
-	    {
-		return(comma);
-	    }
-	}
-
-	/*
-	 * Deal with quotes
-	 */
-	if (*comma == '\"')
-	{
-	    inQuotes = ~inQuotes;
-	}
-
-	comma++;
-    }
-
-    return(NULL);		/* None found */
-}
-
-/*
- * Function:
- *	cnt = getCStrCount(str);
- * Description:
- *      Get the count of cstrings in a compound string table ascii
- *	format.
- * Input:
- *      str - char * : string to parse
- * Output:
- *      cnt - int : the number of XmStrings found
- */
-static int getCStrCount
-    ARGLIST((str))
-        GRA(char *, str)
-{
-    int		x = 1;
-    char	*newStr;
-
-    if (!str) return(0);
-    if (!*str) return(0);
-
-    while ((newStr = getNextCStrDelim(str)))
-    {
-	x++;
-	str = ++newStr;
-    }
-    return(x);
-}
-
-/*
- * Function:
- *      cwc = CStrCommonWideCharsGet();
- * Description:
- *      Return the array of common wide characters.
- * Input:
- *      None.
- * Output:
- *     	cwc - wchar_t * : this array should never be written to or FREEd.
- */
-static wchar_t *CStrCommonWideCharsGet()
-{
-    static wchar_t	*CommonWideChars = NULL;
-    /*
-     * If you add to this array, don't forget to change the enum in
-     * the TYPEDEFS and DEFINES section above to correspond to this
-     * array.
-     */
-    static char	*characters[] = {
-	(char *)"\000", (char *)"\t", (char *)"\n", (char *)"\r",
-	(char *)"\f",   (char *)"\v", (char *)"\\", (char *)"\"",
-	(char *)"#", 	(char *)":",  (char *)"f",  (char *)"l",
-	(char *)"n", 	(char *)"r",  (char *)"t",  (char *)"v",
-	(char *)"F", 	(char *)"L",  (char *)"R",  (char *)"T",
-	(char *)"0",    (char *)"1"
-    };
-
-    if (CommonWideChars == NULL)
-    {
-	int	i;
-
-	/*
-	 * Allocate and create the array.
-	 */
-	CommonWideChars = (wchar_t*)XtMalloc(NUM_COMMON_WCHARS * sizeof(wchar_t));
-
-	for (i = 0; i < NUM_COMMON_WCHARS; i++)
-	{
-	    (void)dombtowc(&(CommonWideChars[i]), characters[i], 1);
-	}
-    }
-    return(CommonWideChars);
-}
-
-/*
- * Function:
- *      CvtXmStringDestructor(app, converted, data, args, num_args)
- * Description:
- *      This destructor is called by the X Toolkit Intrinsics to delete
- *	the memory allocated in CvtStringToXmString.
- * Input:
- *      app		- XtAppContext	: The Xt application context
- *	converted	- XrmValue *	: The value allocated by
- *					  CvtStringToXmString
- *	data		- XtPointer	: The extra data originally passed
- *					  to the converter
- *	args		- XrmValue *	: The extra arguments originally
- *					  passed to the converter
- *	num_args	- Cardinal *	: The number of args originally
- *					  passed to the converter
- * Output:
- *      None
- */
-static void
-CvtXmStringDestructor
-    ARGLIST((app, converted, data, args, num_args))
-        UARG(XtAppContext, app)
-        ARG(XrmValue *, converted)
-        UARG(XtPointer, data)
-        UARG(XrmValue *, args)
-        GRAU(Cardinal *, num_args)
-{
-    XmString	freestr = (XmString)converted->addr;
-    if ( freestr != NULL ) XmStringFree(freestr);
-}
-
-/*
- * Function:
- *	CONVERTER CvtStringToXmString
- *
- * Description:
- *	Convert a string to an XmString. This allows a string contained in
- *	resource file to contain multiple fonts. The syntax for the string
- *	is:
- *		::[#[font-tag]]"string"[#[font-tag]"string"] ...
- *
- *	note that the # can be escaped (\#).
- *
- * Input:
- * Output:
- *	Standard.
- */
-static Boolean CvtStringToXmString
-    ARGLIST((d, args, num_args, fromVal, toVal, data))
-        ARG(Display *, d)
-        UARG(XrmValue *, args)
-        ARG(Cardinal *, num_args)
-        ARG(XrmValue *, fromVal)
-        ARG(XrmValue *, toVal)
-        GRAU(XtPointer, data)
-{
-    static XmString	resStr;
-    char		*str;
-
-    /*
-     * This converter takes no parameters
-     */
-    if (*num_args != 0)
-    {
-	XtAppWarningMsg(XtDisplayToApplicationContext(d),
-			"cvtStringToXmString",
-			"wrongParameters",
-			"XtToolkitError",
-			"String to XmString converter needs no extra arguments",
-			(String *)NULL,
-			(Cardinal *)NULL);
-    }
-
-    /*
-     * See if this is a simple string
-     */
-    str = (char*)fromVal->addr;
-    if (strncmp(str, "::", 2))
-    {
-	resStr = XmStringCreateLtoR(fromVal->addr, XmSTRING_DEFAULT_CHARSET);
-    }
-    else
-    {
-	/*
-	 * Convert into internal format
-	 */
-	resStr = StringToXmString(fromVal->addr + 2);	/* skip :: */
-    }
-
-    /*
-     * Done, return result
-     */
-    if (toVal->addr == NULL)
-    {
-	toVal->addr = (XTPOINTER)&resStr;
-	toVal->size = sizeof(XmString);
-    }
-    else if (toVal->size < sizeof(XmString))
-    {
-	toVal->size = sizeof(XmString);
-	XtDisplayStringConversionWarning(d, fromVal->addr, "XmString");
-	XmStringFree(resStr);
-	return(False);
-    }
-    else
-    {
-	*(XmString *)toVal->addr = resStr;
-	toVal->size = sizeof(XmString);
-    }
-    return(True);
-}
-
-/*
- * Function:
- *      CONVERTER CvtStringToXmStringTable
- *
- * Description:
- *	Convert a string to an XmString table. This allows a string
- *	contained in resource file to contain multiple fonts. The syntax
- *	for the string is:
- *
- *	   compound_string = [#[font-tag]]"string"[#[font-tag]"string"] ...
- *	   compound_string_table = [compound_string][,compound_string] ...
- *
- *	note that the # can be escaped (\#).
- *
- * Input:
- * Output:
- *	Standard.
- */
-static Boolean CvtStringToXmStringTable
-    ARGLIST((d, args, num_args, fromVal, toVal, data))
-        ARG(Display *, d)
-        ARG(XrmValue *, args)
-        ARG(Cardinal *, num_args)
-        ARG(XrmValue *, fromVal)
-        ARG(XrmValue *, toVal)
-        GRAU(XtPointer, data)
-{
-    static XmString	*CStrTable;
-    XmString		*tblPtr;
-    char		*str;
-    char		*tmpBuf;
-    char		*nextDelim;
-    XrmValue		fVal;
-    XrmValue		tVal;
-
-    /*
-     * This converter takes no parameters
-     */
-    if (*num_args != 0)
-    {
-	XtAppWarningMsg
-	    (XtDisplayToApplicationContext(d),
-	     "cvtStringToXmStringTable",
-	     "wrongParameters",
-	     "XtToolkitError",
-	     "String to XmStringTable converter needs no extra arguments",
-	     (String *)NULL,
-	     (Cardinal *)NULL);
-    }
-
-    /*
-     * Set str and make sure there's somethin' there
-     */
-    if (!(str = (char*)fromVal->addr))
-    {
-	str = (char *)"";
-    }
-
-    /*
-     * Allocate the XmStrings + 1 for NULL termination
-     */
-    CStrTable = (XmString*)XtMalloc((getCStrCount(str) + 1) * sizeof(XmString*));
-
-    /*
-     * Use the string converter for the strings
-     */
-    tmpBuf = (char*)XtMalloc(strlen(str) + 1);
-    strcpy(tmpBuf, str);
-    str = tmpBuf;
-
-    /*
-     * Create strings
-     */
-    tblPtr = CStrTable;
-    if (*str)
-    {
-	while (str)
-	{
-	    nextDelim = getNextCStrDelim(str);
-
-	    /*
-	     * Overwrite nextDelim
-	     */
-	    if (nextDelim)
-	    {
-		*nextDelim = '\0';
-		nextDelim++;
-	    }
-
-	    /*
-	     * Convert it
-	     */
-	    fVal.size = strlen(str) + 1;
-	    fVal.addr = str;
-	    tVal.size = sizeof(XTPOINTER);
-	    tVal.addr = (XTPOINTER)tblPtr;
-
-	    /*
-	     * Call converter ourselves since this is used to create
-	     * the strings in the table we create. We need to do this
-	     * since we don't have a widget to send to the XtConvertAndStore
-	     * function. Side effects are that we can never get these
-	     * compound strings cached and that no destructor function is
-	     * called when the strings leave existance, but we nuke 'em
-	     * in the XmStringTable destuctor.
-	     */
-	    CvtStringToXmString(d, args, num_args, &fVal, &tVal, NULL);
-	    tblPtr++;
-	    str = nextDelim;
-	}
-    }
-    XtFree(tmpBuf);
-
-    /*
-     * Null terminate
-     */
-    *tblPtr = NULL;
-
-    /*
-     * Done, return result
-     */
-    if (toVal->addr == NULL)
-    {
-	toVal->addr = (XTPOINTER)&CStrTable;
-	toVal->size = sizeof(XmString);
-    }
-    else if (toVal->size < sizeof(XmString*))
-    {
-	toVal->size = sizeof(XmString*);
-	XtDisplayStringConversionWarning(d, fromVal->addr, "XmStringTable");
-
-	tblPtr = CStrTable;
-	while (*tblPtr)
-	{
-	    XmStringFree(*tblPtr);
-	}
-	XtFree((char*)CStrTable);
-	return(False);
-    }
-    else
-    {
-	*(XmString **)toVal->addr = CStrTable;
-	toVal->size = sizeof(XmString*);
-    }
-    return(True);
-}
-
-/*
- * Function:
- *      CvtXmStringTableDestructor(app, converted, data, args, num_args)
- * Description:
- *      This destructor is called by the X Toolkit Intrinsics to delete
- *	the memory allocated in CvtStringToXmString.
- * Input:
- *      app		- XtAppContext	: The Xt application context
- *	converted	- XrmValue *	: The value allocated by
- *					  CvtStringToXmStringTable
- *	data		- XtPointer	: The extra data originally passed
- *					  to the converter
- *	args		- XrmValue *	: The extra arguments originally
- *					  passed to the converter
- *	num_args	- Cardinal *	: The number of args originally
- *					  passed to the converter
- * Output:
- *      None
- */
-static void
-CvtXmStringTableDestructor
-    ARGLIST((app, converted, data, args, num_args))
-        UARG(XtAppContext, app)
-        ARG(XrmValue *, converted)
-        UARG(XtPointer, data)
-        UARG(XrmValue *, args)
-        GRAU(Cardinal *, num_args)
-{
-    XmString	*ptr = (XmString *)converted->addr;
-    while ( *ptr != NULL )
-    {
-	XmStringFree(*ptr);
-	ptr++;
-    }
-    XtFree((char*)converted->addr);
-}
-
-/*****************************************************************************
- *	GLOBAL CODE
- *****************************************************************************/
-
-/*
- * Function:
- *      RegisterBxConverters(appContext);
- * Description:
- *      This globally available function installs all the converters necessary
- *	to run BuilderXcessory generated interfaces that use compound
- *	strings. This is necessary since Motif has not supplied very smart
- *	converters.
- * Input:
- *      appContext - XtAppContext : the application context
- * Output:
- *      None
- */
-void RegisterBxConverters
-    ARGLIST((appContext))
-        GRA(XtAppContext, appContext)
-{
-    XtAppSetTypeConverter(appContext, XmRString, XmRXmString,
-			  (XtTypeConverter)&CvtStringToXmString,
-			  NULL, 0, XtCacheNone,
-                          (XtDestructor)&CvtXmStringDestructor);
-
-    XtAppSetTypeConverter(appContext, XmRString, XmRXmStringTable,
-			  (XtTypeConverter)&CvtStringToXmStringTable,
-			  NULL, 0, XtCacheNone,
-			  (XtDestructor)&CvtXmStringTableDestructor);
-}
-
-/*
- * Function:
- *      CONVERT(w, from_string, to_type, to_size, success);
- * Description:
- *      A converter wrapper for convenience from BuilderXcessory.
- * Input:
- *      w - Widget : the widget to use for conversion
- *	from_string - char * : the string to convert from
- *	to_type - char * : the type to convert to
- *	to_size - int : the size of the conversion result
- *	success - Boolean* : Set to the result value of the conversion
- * Output:
- *      None
- */
-#ifndef IGNORE_CONVERT
-XtPointer BX_CONVERT
-    ARGLIST((w, from_string, to_type, to_size, success))
-        ARG(Widget, w)
-        ARG(char *, from_string)
-        ARG(char *, to_type)
-        UARG(int, to_size)
-        GRA(Boolean *, success)
-{
-    XrmValue		fromVal, toVal;	/* resource holders		*/
-    Boolean		convResult;	/* return value			*/
-    XtPointer		val;		/* Pointer size return value    */
-
-    /*
-     * We will assume that the conversion is going to fail and change this
-     * value later if the conversion is a success.
-     */
-    *success = False;
-
-    /*
-     * Since we are converting from a string to some type we need to
-     * set the fromVal structure up with the string information that
-     * the caller passed in.
-     */
-    fromVal.size = strlen(from_string) + 1;
-    fromVal.addr = from_string;
-
-    /*
-     * Since we are not sure what type and size of data we are going to
-     * get back we will set this up so that the converter will point us
-     * at a block of valid data.
-     */
-    toVal.size = 0;
-    toVal.addr = NULL;
-
-    /*
-     * Now lets try to convert this data by calling this handy-dandy Xt
-     * routine.
-     */
-    convResult = XtConvertAndStore(w, XmRString, &fromVal, to_type, &toVal);
-
-
-    /*
-     * Now we have two conditions here.  One the conversion was a success
-     * and two the conversion failed.
-     */
-    if(!convResult)
-    {
-	/*
-	 * If this conversion failed that we can pretty much return right
-	 * here because there is nothing else we can do.
-	 */
-	return((XtPointer) NULL);
-    }
-
-    /*
-     * If we get this far that means we did the conversion and all is
-     * well.  Now we have to handle the special cases for type and
-     * size constraints.
-     */
-    if(!strcmp(to_type, "String"))
-    {
-	/*
-	 * Since strings are handled different in Xt we have to deal with
-	 * the conversion from a string to a string.  When this happens the
-	 * toVal.size will hold the strlen of the string so generic
-	 * conversion code can't handle it.  It is possible for a string to
-	 * string conversion to happen so we do have to watch for it.
-	 */
-	val = (XTPOINTER)toVal.addr;
-    }
-    else if(!strcmp(to_type, "Double"))
-    {
-	val = (XTPOINTER)((double*)toVal.addr);
-    }
-    else if(!strcmp(to_type, "Float"))
-    {
-	val = (XTPOINTER)((float*)toVal.addr);
-    }
-    else
-    {
-	/*
-	 * Here is the generic conversion return value handler.  This
-	 * just does some size specific casting so that value that we
-	 * return is in the correct bytes of the XtPointer that we
-	 * return.  Here we check all sizes from 1 to 8 bytes.
-	 */
-	switch(toVal.size)
-	{
-	case 1:
-	    val = (XTPOINTER)(size_t)(*(char*)toVal.addr);
-	    break;
-	case 2:
-	    val = (XTPOINTER)(size_t)(*(short*)toVal.addr);
-	    break;
-	case 4:
-	    val = (XTPOINTER)(size_t)(*(int*)toVal.addr);
-	    break;
-	case 8:
-	default:
-	    val = (XTPOINTER)(*(long*)toVal.addr);
-	    break;
-	}
-    }
-
-    /*
-     * Well everything is done and the conversion was a success so lets
-     * set the success flag to True.
-     */
-    *success = convResult;
-
-    /*
-     * Finally lets return the converted value.
-     */
-    /*SUPPRESS 80*/
-    return(val);
-}
-
-#ifdef DEFINE_OLD_BXUTILS
-XtPointer CONVERT
-    ARGLIST((w, from_string, to_type, to_size, success))
-        ARG(Widget, w)
-        ARG(char *, from_string)
-        ARG(char *, to_type)
-        ARG(int, to_size)
-        GRA(Boolean *, success)
-{
-    return(BX_CONVERT(w, from_string, to_type, to_size, success));
-}
-#endif /* DEFINE_OLD_BXUTILS */
-#endif /* !IGNORE_CONVERT */
-
-/*
- * Function:
- *      MENU_POST(p, mw, ev, dispatch);
- * Description:
- *      A converter wrapper for convenience from BuilderXcessory.
- * Input:
- *      p - Widget : the widget to post
- *	mw - XtPointer : the menu widget
- *	ev - XEvent* : the event that caused the menu post
- *	dispatch - Boolean* : not used
- * Output:
- *      None
- */
-
-#ifndef IGNORE_MENU_POST
-void BX_MENU_POST
-    ARGLIST((p, mw, ev, dispatch))
-        UARG(Widget, p)
-        ARG(XtPointer, mw)
-        ARG(XEvent *, ev)
-        GRAU(Boolean *, dispatch)
-{
-    Arg	args[2];
-    int	argcnt;
-    int	button;
-    Widget m = (Widget)mw;
-    XButtonEvent *e = (XButtonEvent *)ev;
-
-    argcnt = 0;
-    XtSetArg(args[argcnt], XmNwhichButton, &button);
-    argcnt++;
-    XtGetValues(m, args, argcnt);
-    if(e->button != button) return;
-    XmMenuPosition(m, e);
-    XtManageChild(m);
-}
-
-#ifdef DEFINE_OLD_BXUTILS
-void MENU_POST
-    ARGLIST((p, mw, ev, dispatch))
-        ARG(Widget, p)
-        ARG(XtPointer, mw)
-        ARG(XEvent *, ev)
-        GRA(Boolean *, dispatch)
-{
-    BX_MENU_POST(p, mw, ev, dispatch);
-}
-#endif /* DEFINE_OLD_BXUTILS */
-#endif /* !IGNORE_MENU_POST */
-
-/*
- * Function:
- *      SET_BACKGROUND_COLOR(w, args, argcnt, bg_color);
- * Description:
- *      Sets the background color and shadows of a widget.
- * Input:
- *      w - The widget to set the background color on.
- *      args, argcnt - The argument list so far.
- *      bg_color - The new background color as a pixel.
- * Output:
- *      none
- *
- *  NOTES:  This assumes that args later in the argument list
- *          override those already in the list.  Therfore i f
- *          there are shadow colors later in the list they will win.
- *
- *          There is no need to use this function when creating a widget
- *          only when doing a set values, shadow colors are automatically
- *          calculated at creation time.
- */
-void BX_SET_BACKGROUND_COLOR
-    ARGLIST((w, args, argcnt, bg_color))
-        ARG(Widget, w)
-        ARG(ArgList, args)
-        ARG(Cardinal *, argcnt)
-        GRA(Pixel, bg_color)
-{
-    int		i;
-    int		topShadowLoc;
-    int		bottomShadowLoc;
-    int		selectLoc;
-    int		fgLoc;
-
-#if (((XmVERSION == 1) && (XmREVISION > 0)) || (XmVERSION > 1))
-
-    /*
-     * Walk through the arglist to see if the user set the top or
-     * bottom shadow colors.
-     */
-    selectLoc = topShadowLoc =  bottomShadowLoc = UNSET;
-    for (i = 0; i < *argcnt; i++)
-    {
-	if ((strcmp(args[i].name, XmNtopShadowColor) == 0) ||
-	    (strcmp(args[i].name, XmNtopShadowPixmap) == 0))
-	{
-	    topShadowLoc = i;
-	}
-	else if ((strcmp(args[i].name, XmNbottomShadowColor) == 0) ||
-		 (strcmp(args[i].name, XmNbottomShadowPixmap) == 0))
-	{
-	    bottomShadowLoc = i;
-	}
-	else if (strcmp(args[i].name, XmNarmColor) == 0)
-	{
-	    selectLoc = i;
-	}
-	else if (strcmp(args[i].name, XmNforeground) == 0)
-	{
-	    fgLoc = i;
-	}
-    }
-
-    /*
-     * If either the top or bottom shadow are not set then we
-     * need to use XmGetColors to get the shadow colors from the backgound
-     * color and add those that are not already in the arglist to the
-     * arglist.
-     *
-     */
-    if ((bottomShadowLoc == UNSET) ||
-	(topShadowLoc == UNSET) ||
-	(selectLoc == UNSET) ||
-	(fgLoc == UNSET))
-    {
-	Arg		larg[1];
-	Colormap	cmap;
-	Pixel		topShadow;
-	Pixel		bottomShadow;
-	Pixel		select;
-	Pixel		fgColor;
-
-	XtSetArg(larg[0], XmNcolormap, &cmap);
-	XtGetValues(w, larg, 1);
-	XmGetColors(XtScreen(w), cmap, bg_color,
-		    &fgColor, &topShadow, &bottomShadow, &select);
-
-	if (topShadowLoc == UNSET)
-	{
-	    XtSetArg(args[*argcnt], XmNtopShadowColor, topShadow);
-	    (*argcnt)++;
-	}
-
-	if (bottomShadowLoc == UNSET)
-	{
-	    XtSetArg(args[*argcnt], XmNbottomShadowColor, bottomShadow);
-	    (*argcnt)++;
-	}
-
-	if (selectLoc == UNSET)
-	{
-	    XtSetArg(args[*argcnt], XmNarmColor, select);
-	    (*argcnt)++;
-	}
-
-	if (fgLoc == UNSET)
-	{
-	    XtSetArg(args[*argcnt], XmNforeground, fgColor);
-	    (*argcnt)++;
-	}
-    }
-#endif
-
-    XtSetArg(args[*argcnt], XmNbackground, bg_color); (*argcnt)++;
-}
-
-#ifdef DEFINE_OLD_BXUTILS
-void SET_BACKGROUND_COLOR
-    ARGLIST((w, args, argcnt, bg_color))
-        ARG(Widget, w)
-        ARG(ArgList, args)
-        ARG(Cardinal *, argcnt)
-        GRA(Pixel, bg_color)
-{
-    BX_SET_BACKGROUND_COLOR(w, args, argcnt, bg_color);
-}
-#endif /* DEFINE_OLD_BXUTILS */
-
-/*
- * Function:
- *	w = BxFindTopShell(start);
- * Description:
- *	Go up the hierarhcy until we find a shell widget.
- * Input:
- *      start - Widget : the widget to start with.
- * Output:
- *	w - Widget : the shell widget.
- */
-#ifndef _BX_FIND_TOP_SHELL
-#define _BX_FIND_TOP_SHELL
-
-Widget BxFindTopShell
-    ARGLIST((start))
-        GRA(Widget, start)
-{
-    Widget	p;
-
-    while((p = XtParent(start)))
-    {
-	start = p;
-    }
-    return(start);
-}
-#endif /* _BX_FIND_TOP_SHELL */
-
-/*
- * Function:
- *	BxWidgetIdsFromNames(ref, cbName, stringList)
- * Description:
- *	Return an array of widget ids from a list of widget names.
- * Input:
- *	ref - Widget : reference widget.
- *	cbName - char* : callback name.
- *	stringList - char*: list of widget names.
- * Output:
- *	WidgetList : array of widget IDs.
- */
-
-#ifndef _BX_WIDGETIDS_FROM_NAMES
-#define _BX_WIDGETIDS_FROM_NAMES
-
-WidgetList BxWidgetIdsFromNames
-    ARGLIST((ref, cbName, stringList))
-        ARG(Widget, ref)
-        ARG(char, *cbName)
-        GRA(char, *stringList)
-{
-    WidgetList	wgtIds = NULL;
-    int		wgtCount = 0;
-    Widget	inst;
-    Widget	current;
-    String	tmp;
-    String	start;
-    String	widget;
-    char       *ptr;
-
-    /*
-     * For backward compatibility, remove [ and ] from the list.
-     */
-    tmp = start = XtNewString(stringList);
-    if((start = strchr(start, '[')) != NULL) start++;
-    else start = tmp;
-
-    while((start && *start) && isspace(*start))
-    {
-	start++;
-    }
-    ptr = strrchr(start, ']');
-    if (ptr)
-    {
-	*ptr = '\0';
-    }
-
-    ptr = start + strlen(start) - 1;
-    while(ptr && *ptr)
-    {
-	if (isspace(*ptr))
-	{
-	    ptr--;
-	}
-	else
-	{
-	    ptr++;
-	    break;
-	}
-    }
-    if (ptr && *ptr)
-    {
-	*ptr = '\0';
-    }
-
-    /*
-     * start now points to the first character after the [.
-     * the list is now either empty, one, or more widget
-     * instance names.
-     */
-    start = strtok(start, ",");
-    while(start)
-    {
-        while((start && *start) && isspace(*start))
-        {
-            start++;
-        }
-        ptr = start + strlen(start) - 1;
-        while(ptr && *ptr)
-        {
-            if (isspace(*ptr))
-            {
-                ptr--;
-            }
-            else
-            {
-                ptr++;
-                break;
-            }
-        }
-        if (ptr && *ptr)
-        {
-            *ptr = '\0';
-        }
-
-	/*
-	 * Form a string to use with XtNameToWidget().
-	 */
-        widget = (char *)XtMalloc((strlen(start) + 2) * sizeof(char));
-        sprintf(widget, "*%s", start);
-
-	/*
-	 * Start at this level and continue up until the widget is found
-	 * or until the top of the hierarchy is reached.
-	 */
-	current = ref;
-	while (current != NULL)
-	{
-	    inst = XtNameToWidget(current, widget);
-	    if (inst != NULL )
-	    {
-		wgtCount++;
-		wgtIds = (WidgetList)XtRealloc((char *)wgtIds,
-					       wgtCount * sizeof(Widget));
-		wgtIds[wgtCount - 1] = inst;
-		break;
-	    }
-	    current = XtParent(current);
-	}
-
-	if (current == NULL)
-        {
-            printf("Callback Error (%s):\n\t\
-Cannot find widget %s\n", cbName, widget);
-        }
-        XtFree(widget);
-        start = strtok(NULL, ",");
-    }
-
-    /*
-     * NULL terminate the list.
-     */
-    wgtIds = (WidgetList)XtRealloc((char *)wgtIds,
-				   (wgtCount + 1) * sizeof(Widget));
-    wgtIds[wgtCount] = NULL;
-
-    XtFree((char *)tmp);
-    return(wgtIds);
-}
-#endif /* _BX_WIDGETIDS_FROM_NAMES */
-
-XtPointer BX_SINGLE
-    ARGLIST((val))
-    GRA(float, val)
-{
-    XtPointer pointer;
-
-    pointer = (XtPointer)XtMalloc(sizeof(float));
-    if ( pointer != NULL ) *((float *)pointer) = val;
-    return(pointer);
-}
-
-#ifdef DEFINE_OLD_BXUTILS
-XtPointer SINGLE
-    ARGLIST((val))
-    GRA(float, val)
-{
-    return(BX_SINGLE(val));
-}
-#endif /* DEFINE_OLD_BXUTILS */
-
-XtPointer BX_DOUBLE
-    ARGLIST((val))
-    GRA(double, val)
-{
-    XtPointer	pointer;
-
-    pointer = (XtPointer)XtMalloc(sizeof(double));
-    if ( pointer != NULL ) *((double *)pointer) = val;
-    return(pointer);
-}
-
-#ifdef DEFINE_OLD_BXUTILS
-XtPointer DOUBLE
-    ARGLIST((val))
-    GRA(double, val)
-{
-    return(BX_DOUBLE(val));
-}
-#endif /* DEFINE_OLD_BXUTILS */
-
-
-/****************************************************************************
- *
- * Big chunk of code inserted from Bull (based on modified 3.3)
- *
- ****************************************************************************/
-
-#ifndef IGNORE_XPM_PIXMAP
-
-#ifndef USE_XPM_LIBRARY
-
-#ifdef SYSV
-#include <memory.h>
-#endif
-
-/*
- * Copyright 1990, 1991 GROUPE BULL
- *
- * Permission to use, copy, modify, and distribute this software and its
- * documentation for any purpose and without fee is hereby granted, provided
- * that the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of GROUPE BULL not be used in advertising
- * or publicity pertaining to distribution of the software without specific,
- * written prior permission.  GROUPE BULL makes no representations about the
- * suitability of this software for any purpose.  It is provided "as is"
- * without express or implied warranty.
- *
- * GROUPE BULL disclaims all warranties with regard to this software,
- * including all implied warranties of merchantability and fitness,
- * in no event shall GROUPE BULL be liable for any special,
- * indirect or consequential damages or any damages
- * whatsoever resulting from loss of use, data or profits,
- * whether in an action of contract, negligence or other tortious
- * action, arising out of or in connection with the use
- * or performance of this software.
- *
- */
-
-/* Return ErrorStatus codes:
- * null     if full success
- * positive if partial success
- * negative if failure
- */
-
-#define BxXpmColorError    1
-#define BxXpmSuccess       0
-#define BxXpmOpenFailed   -1
-#define BxXpmFileInvalid  -2
-#define BxXpmNoMemory     -3
-#define BxXpmColorFailed  -4
-
-typedef struct {
-    char *name;                         /* Symbolic color name */
-    char *value;                        /* Color value */
-    Pixel pixel;                        /* Color pixel */
-} 	BxXpmColorSymbol;
-
-typedef struct {
-    unsigned long valuemask;            /* Specifies which attributes are
-                                         * defined */
-
-    Visual *visual;                     /* Specifies the visual to use */
-    Colormap colormap;                  /* Specifies the colormap to use */
-    unsigned int depth;                 /* Specifies the depth */
-    unsigned int width;                 /* Returns the width of the created
-                                         * pixmap */
-    unsigned int height;                /* Returns the height of the created
-                                         * pixmap */
-    unsigned int x_hotspot;             /* Returns the x hotspot's
-                                         * coordinate */
-    unsigned int y_hotspot;             /* Returns the y hotspot's
-                                         * coordinate */
-    unsigned int cpp;                   /* Specifies the number of char per
-                                         * pixel */
-    Pixel *pixels;                      /* List of used color pixels */
-    unsigned int npixels;               /* Number of pixels */
-    BxXpmColorSymbol *colorsymbols;       /* Array of color symbols to
-                                         * override */
-    unsigned int numsymbols;            /* Number of symbols */
-    char *rgb_fname;                    /* RGB text file name */
-
-    /* Infos */
-    unsigned int ncolors;               /* Number of colors */
-    char ***colorTable;                 /* Color table pointer */
-    char *hints_cmt;                    /* Comment of the hints section */
-    char *colors_cmt;                   /* Comment of the colors section */
-    char *pixels_cmt;                   /* Comment of the pixels section */
-    unsigned int mask_pixel;            /* Transparent pixel's color table
-                                         * index */
-}      BxXpmAttributes;
-
-/* Xpm attribute value masks bits */
-#define BxXpmVisual          (1L<<0)
-#define BxXpmColormap        (1L<<1)
-#define BxXpmDepth           (1L<<2)
-#define BxXpmSize            (1L<<3)      /* width & height */
-#define BxXpmHotspot         (1L<<4)      /* x_hotspot & y_hotspot */
-#define BxXpmCharsPerPixel   (1L<<5)
-#define BxXpmColorSymbols    (1L<<6)
-#define BxXpmRgbFilename     (1L<<7)
-#define BxXpmInfos           (1L<<8)      /* all infos members */
-
-#define BxXpmReturnPixels    (1L<<9)
-#define BxXpmReturnInfos     BxXpmInfos
-
-/*
- * minimal portability layer between ansi and KR C
- */
-
-/* forward declaration of functions with prototypes */
-
-#ifdef NeedFunctionPrototypes
-#define LFUNC(f, t, p) static t f p
-#else
-#define LFUNC(f, t, p) static t f()
-#endif
-
-/*
- * functions declarations
- */
-LFUNC(BxXpmCreatePixmapFromData, int, (Display * display,
-				       Drawable d,
-				       char **data,
-				       Pixmap * pixmap_return,
-				       Pixmap * shapemask_return,
-				       BxXpmAttributes * attributes));
-
-LFUNC(BxXpmCreateImageFromData, int, (Display * display,
-				      char **data,
-				      XImage ** image_return,
-				      XImage ** shapemask_return,
-				      BxXpmAttributes * attributes));
-
-LFUNC(BxXpmFreeAttributes, void, (BxXpmAttributes * attributes));
-
-typedef struct {
-    unsigned int type;
-    union {
-        FILE *file;
-        char **data;
-    }     stream;
-    char *cptr;
-    unsigned int line;
-    int CommentLength;
-    char Comment[BUFSIZ];
-    char *Bcmt, *Ecmt, Bos, Eos;
-    unsigned int InsideString;          /* used during parsing: 0 or 1
-                                         * whether we are inside or not */
-}      bxxpmData;
-
-#define BXXPMARRAY 0
-#define BXXPMFILE  1
-#define BXXPMPIPE  2
-
-typedef unsigned char byte;
-
-#define BX_TRANSPARENT_COLOR "None"        /* this must be a string! */
-
-/* number of BxXpmColorKeys */
-#define BXNKEYS 5
-
-/*
- * key numbers for visual type, they must fit along with the number key of
- * each corresponding element in BxXpmColorKeys[] defined in xpm.h
- */
-#define BXMONO    2
-#define BXGRAY4   3
-#define BXGRAY    4
-#define BXCOLOR   5
-
-/* structure containing data related to an Xpm pixmap */
-typedef struct {
-    char *name;
-    unsigned int width;
-    unsigned int height;
-    unsigned int cpp;
-    unsigned int ncolors;
-    char ***colorTable;
-    unsigned int *pixelindex;
-    XColor *xcolors;
-    char **colorStrings;
-    unsigned int mask_pixel;            /* mask pixel's colorTable index */
-}      bxxpmInternAttrib;
-
-#define BX_UNDEF_PIXEL 0x80000000
-
-char *BxXpmColorKeys[] =
-{
- (char *)"s",				/* key #1: symbol */
- (char *)"m",				/* key #2: mono visual */
- (char *)"g4",				/* key #3: 4 grays visual */
- (char *)"g",				/* key #4: gray visual */
- (char *)"c",				/* key #5: color visual */
-};
-
-/* XPM private routines */
-
-LFUNC(xpmCreateImage, int, (Display * display,
-                           bxxpmInternAttrib * attrib,
-                           XImage ** image_return,
-                           XImage ** shapeimage_return,
-                           BxXpmAttributes * attributes));
-
-LFUNC(xpmParseData, int, (bxxpmData * data,
-                         bxxpmInternAttrib * attrib_return,
-                         BxXpmAttributes * attributes));
-
-LFUNC(BxXpmVisualType, int, (Visual * visual));
-LFUNC(xpmFreeColorTable, void, (char ***colorTable, int ncolors));
-
-LFUNC(xpmInitInternAttrib, void, (bxxpmInternAttrib * xmpdata));
-
-LFUNC(xpmFreeInternAttrib, void, (bxxpmInternAttrib * xmpdata));
-
-LFUNC(xpmSetAttributes, void, (bxxpmInternAttrib * attrib,
-                             BxXpmAttributes * attributes));
-
-/* I/O utility */
-
-LFUNC(xpmNextString, void, (bxxpmData * mdata));
-LFUNC(xpmNextUI, int, (bxxpmData * mdata, unsigned int *ui_return));
-LFUNC(xpmGetC, int, (bxxpmData * mdata));
-LFUNC(xpmUngetC, int, (int c, bxxpmData * mdata));
-LFUNC(xpmNextWord, unsigned int, (bxxpmData * mdata, char *buf));
-LFUNC(xpmGetCmt, void, (bxxpmData * mdata, char **cmt));
-LFUNC(xpmOpenArray, int, (char **data, bxxpmData * mdata));
-LFUNC(XpmDataClose, void, (bxxpmData * mdata));
-
-/* RGB utility */
-
-LFUNC(xpm_xynormalizeimagebits, void, (register unsigned char *bp,
-                                     register XImage * img));
-LFUNC(xpm_znormalizeimagebits, void, (register unsigned char *bp,
-                                    register XImage * img));
-
-/* Image utility */
-
-LFUNC(SetColor, int, (Display * display, Colormap colormap, char *colorname,
-		      unsigned int color_index, Pixel * image_pixel,
-		      Pixel * mask_pixel, unsigned int *mask_pixel_index));
-
-LFUNC(CreateXImage, int, (Display * display, Visual * visual,
-			  unsigned int depth, unsigned int width,
-			  unsigned int height, XImage ** image_return));
-
-LFUNC(SetImagePixels, void, (XImage * image, unsigned int width,
-			    unsigned int height, unsigned int *pixelindex,
-			    Pixel * pixels));
-
-LFUNC(SetImagePixels32, void, (XImage * image, unsigned int width,
-			      unsigned int height, unsigned int *pixelindex,
-			      Pixel * pixels));
-
-LFUNC(SetImagePixels16, void, (XImage * image, unsigned int width,
-			      unsigned int height, unsigned int *pixelindex,
-			      Pixel * pixels));
-
-LFUNC(SetImagePixels8, void, (XImage * image, unsigned int width,
-			     unsigned int height, unsigned int *pixelindex,
-			     Pixel * pixels));
-
-LFUNC(SetImagePixels1, void, (XImage * image, unsigned int width,
-			     unsigned int height, unsigned int *pixelindex,
-			     Pixel * pixels));
-
-LFUNC(atoui, unsigned int, (char *p, unsigned int l, unsigned int *ui_return));
-
-/*
- * Macros
- *
- * The BXXYNORMALIZE macro determines whether XY format data requires
- * normalization and calls a routine to do so if needed. The logic in
- * this module is designed for LSBFirst byte and bit order, so
- * normalization is done as required to present the data in this order.
- *
- * The BXZNORMALIZE macro performs byte and nibble order normalization if
- * required for Z format data.
- *
- * The BXXYINDEX macro computes the index to the starting byte (char) boundary
- * for a bitmap_unit containing a pixel with coordinates x and y for image
- * data in XY format.
- *
- * The BXZINDEX* macros compute the index to the starting byte (char) boundary
- * for a pixel with coordinates x and y for image data in ZPixmap format.
- *
- */
-
-#define BXXYNORMALIZE(bp, img) \
-    if ((img->byte_order == MSBFirst) || (img->bitmap_bit_order == MSBFirst)) \
-        xpm_xynormalizeimagebits((unsigned char *)(bp), img)
-
-#define BXZNORMALIZE(bp, img) \
-    if (img->byte_order == MSBFirst) \
-        xpm_znormalizeimagebits((unsigned char *)(bp), img)
-
-#define BXXYINDEX(x, y, img) \
-    ((y) * img->bytes_per_line) + \
-    (((x) + img->xoffset) / img->bitmap_unit) * (img->bitmap_unit >> 3)
-
-#define BXZINDEX(x, y, img) ((y) * img->bytes_per_line) + \
-    (((x) * img->bits_per_pixel) >> 3)
-
-#define BXZINDEX32(x, y, img) ((y) * img->bytes_per_line) + ((x) << 2)
-
-#define BXZINDEX16(x, y, img) ((y) * img->bytes_per_line) + ((x) << 1)
-
-#define BXZINDEX8(x, y, img) ((y) * img->bytes_per_line) + (x)
-
-#define BXZINDEX1(x, y, img) ((y) * img->bytes_per_line) + ((x) >> 3)
-
-#if __STDC__
-#define Const const
-#else
-#define Const
-#endif
-
-
-
-static unsigned int atoui
-ARGLIST((p, l, ui_return))
-ARG(register char *, p)
-ARG(unsigned int, l)
-GRA(unsigned int *, ui_return)
-{
-    register int n, i;
-
-    n = 0;
-    for (i = 0; i < l; i++)
-        if (*p >= '0' && *p <= '9')
-            n = n * 10 + *p++ - '0';
-        else
-            break;
-
-    if (i != 0 && i == l) {
-        *ui_return = n;
-        return 1;
-    } else
-        return 0;
-}
-
-static int BxXpmCreatePixmapFromData
-ARGLIST((display, d, data, pixmap_return, shapemask_return, attributes))
-ARG(Display *, display)
-ARG(Drawable, d)
-ARG(char **, data)
-ARG(Pixmap *, pixmap_return)
-ARG(Pixmap *, shapemask_return)
-GRA(BxXpmAttributes *,attributes)
-{
-    XImage *image, **imageptr = NULL;
-    XImage *shapeimage, **shapeimageptr = NULL;
-    int ErrorStatus;
-    XGCValues gcv;
-    GC gc;
-
-    /*
-     * initialize return values
-     */
-    if (pixmap_return) {
-        *pixmap_return = (Pixmap) NULL;
-        imageptr = ℑ
-    }
-    if (shapemask_return) {
-        *shapemask_return = (Pixmap) NULL;
-        shapeimageptr = &shapeimage;
-    }
-
-    /*
-     * create the images
-     */
-    ErrorStatus = BxXpmCreateImageFromData(display, data, imageptr,
-                                         shapeimageptr, attributes);
-    if (ErrorStatus < 0)
-        return (ErrorStatus);
-
-    /*
-     * create the pixmaps
-     */
-    if (imageptr && image) {
-        *pixmap_return = XCreatePixmap(display, d, image->width,
-                                       image->height, image->depth);
-        gcv.function = GXcopy;
-        gc = XCreateGC(display, *pixmap_return, GCFunction, &gcv);
-
-        XPutImage(display, *pixmap_return, gc, image, 0, 0, 0, 0,
-                  image->width, image->height);
-
-        XDestroyImage(image);
-        XFreeGC(display, gc);
-    }
-    if (shapeimageptr && shapeimage) {
-        *shapemask_return = XCreatePixmap(display, d, shapeimage->width,
-                                          shapeimage->height,
-                                          shapeimage->depth);
-        gcv.function = GXcopy;
-        gc = XCreateGC(display, *shapemask_return, GCFunction, &gcv);
-
-        XPutImage(display, *shapemask_return, gc, shapeimage, 0, 0, 0, 0,
-                  shapeimage->width, shapeimage->height);
-
-        XDestroyImage(shapeimage);
-        XFreeGC(display, gc);
-    }
-    return (ErrorStatus);
-}
-
-
-static int BxXpmCreateImageFromData
-ARGLIST((display, data, image_return, shapeimage_return, attributes))
-ARG(Display *,display)
-ARG(char **, data)
-ARG(XImage **, image_return)
-ARG(XImage **, shapeimage_return)
-GRA(BxXpmAttributes *, attributes)
-{
-    bxxpmData mdata;
-    int ErrorStatus;
-    bxxpmInternAttrib attrib;
-
-    /*
-     * initialize return values
-     */
-    if (image_return)
-        *image_return = NULL;
-    if (shapeimage_return)
-        *shapeimage_return = NULL;
-
-    if ((ErrorStatus = xpmOpenArray(data, &mdata)) != BxXpmSuccess)
-        return (ErrorStatus);
-
-    xpmInitInternAttrib(&attrib);
-
-    ErrorStatus = xpmParseData(&mdata, &attrib, attributes);
-
-    if (ErrorStatus == BxXpmSuccess)
-        ErrorStatus = xpmCreateImage(display, &attrib, image_return,
-                                     shapeimage_return, attributes);
-
-    if (ErrorStatus >= 0)
-        xpmSetAttributes(&attrib, attributes);
-    else if (attributes)
-        BxXpmFreeAttributes(attributes);
-
-    xpmFreeInternAttrib(&attrib);
-    XpmDataClose(&mdata);
-
-    return (ErrorStatus);
-}
-
-/*
- * open the given array to be read or written as an bxxpmData which is returned
- */
-static int xpmOpenArray
-ARGLIST((data, mdata))
-ARG(char **,data)
-GRA(bxxpmData *,mdata)
-{
-    mdata->type = BXXPMARRAY;
-    mdata->stream.data = data;
-    mdata->cptr = *data;
-    mdata->line = 0;
-    mdata->CommentLength = 0;
-    mdata->Bcmt = mdata->Ecmt = NULL;
-    mdata->Bos = mdata->Eos = '\0';
-    mdata->InsideString = 0;
-    return (BxXpmSuccess);
-}
-
-/*
- * Intialize the bxxpmInternAttrib pointers to Null to know
- * which ones must be freed later on.
- */
-static void xpmInitInternAttrib
-ARGLIST((attrib))
-GRA(bxxpmInternAttrib *,attrib)
-{
-    attrib->ncolors = 0;
-    attrib->colorTable = NULL;
-    attrib->pixelindex = NULL;
-    attrib->xcolors = NULL;
-    attrib->colorStrings = NULL;
-    attrib->mask_pixel = BX_UNDEF_PIXEL;
-}
-
-/* function call in case of error, frees only localy allocated variables */
-#undef RETURN
-#define RETURN(status) \
-  { if (colorTable) xpmFreeColorTable(colorTable, ncolors); \
-    if (chars) free(chars); \
-    if (pixelindex) free((char *)pixelindex); \
-    if (hints_cmt)  free((char *)hints_cmt); \
-    if (colors_cmt) free((char *)colors_cmt); \
-    if (pixels_cmt) free((char *)pixels_cmt); \
-    return(status); }
-
-/*
- * This function parses an Xpm file or data and store the found informations
- * in an an bxxpmInternAttrib structure which is returned.
- */
-static int xpmParseData
-ARGLIST((data, attrib_return, attributes))
-ARG(bxxpmData *,data)
-ARG(bxxpmInternAttrib *, attrib_return)
-GRA(BxXpmAttributes *, attributes)
-{
-    /* variables to return */
-    unsigned int width, height;
-    unsigned int ncolors = 0;
-    unsigned int cpp;
-    unsigned int x_hotspot, y_hotspot, hotspot = 0;
-    char ***colorTable = NULL;
-    unsigned int *pixelindex = NULL;
-    char *hints_cmt = NULL;
-    char *colors_cmt = NULL;
-    char *pixels_cmt = NULL;
-
-    /* calculation variables */
-    unsigned int rncolors = 0;		/* read number of colors, it is
-					 * different to ncolors to avoid
-					 * problem when freeing the
-					 * colorTable in case an error
-					 * occurs while reading the hints
-					 * line */
-    unsigned int key;			/* color key */
-    char *chars = NULL, buf[BUFSIZ];
-    unsigned int *iptr;
-    unsigned int a, b, x, y, l;
-
-    unsigned int curkey;		/* current color key */
-    unsigned int lastwaskey;		/* key read */
-    char curbuf[BUFSIZ];		/* current buffer */
-
-    /*
-     * read hints: width, height, ncolors, chars_per_pixel
-     */
-    if (!(xpmNextUI(data, &width) && xpmNextUI(data, &height)
-	  && xpmNextUI(data, &rncolors) && xpmNextUI(data, &cpp)))
-	RETURN(BxXpmFileInvalid);
-
-    ncolors = rncolors;
-
-    /*
-     * read hotspot coordinates if any
-     */
-    hotspot = xpmNextUI(data, &x_hotspot) && xpmNextUI(data, &y_hotspot);
-
-    /*
-     * store the hints comment line
-     */
-    if (attributes && (attributes->valuemask & BxXpmReturnInfos))
-	xpmGetCmt(data, &hints_cmt);
-
-    /*
-     * read colors
-     */
-    colorTable = (char ***) calloc(ncolors, sizeof(char **));
-    if (!colorTable)
-	RETURN(BxXpmNoMemory);
-
-    for (a = 0; a < ncolors; a++) {
-	xpmNextString(data);		/* skip the line */
-	colorTable[a] = (char **) calloc((BXNKEYS + 1), sizeof(char *));
-	if (!colorTable[a])
-	    RETURN(BxXpmNoMemory);
-
-	/*
-	 * read pixel value
-	 */
-	colorTable[a][0] = (char *) malloc(cpp);
-	if (!colorTable[a][0])
-	    RETURN(BxXpmNoMemory);
-	for (b = 0; b < cpp; b++)
-	    colorTable[a][0][b] = xpmGetC(data);
-
-	/*
-	 * read color keys and values
-	 */
-	curkey = 0;
-	lastwaskey = 0;
-	while ((l = xpmNextWord(data, buf))) {
-	    if (!lastwaskey) {
-		for (key = 1; key < BXNKEYS + 1; key++)
-		    if ((strlen(BxXpmColorKeys[key - 1]) == l)
-			&& (!strncmp(BxXpmColorKeys[key - 1], buf, l)))
-			break;
-	    }
-	    if (!lastwaskey && key <= BXNKEYS) {	/* open new key */
-		if (curkey) {		/* flush string */
-		    colorTable[a][curkey] =
-			(char *) malloc(strlen(curbuf) + 1);
-		    if (!colorTable[a][curkey])
-			RETURN(BxXpmNoMemory);
-		    strcpy(colorTable[a][curkey], curbuf);
-		}
-		curkey = key;		/* set new key  */
-		curbuf[0] = '\0';	/* reset curbuf */
-		lastwaskey = 1;
-	    } else {
-		if (!curkey)
-		    RETURN(BxXpmFileInvalid);	/* key without value */
-		if (!lastwaskey)
-		    strcat(curbuf, " ");/* append space */
-		buf[l] = '\0';
-		strcat(curbuf, buf);	/* append buf */
-		lastwaskey = 0;
-	    }
-	}
-	if (!curkey)
-	    RETURN(BxXpmFileInvalid);	/* key without value */
-	colorTable[a][curkey] = (char *) malloc(strlen(curbuf) + 1);
-	if (!colorTable[a][curkey])
-	    RETURN(BxXpmNoMemory);
-	strcpy(colorTable[a][curkey], curbuf);
-    }
-
-    /*
-     * store the colors comment line
-     */
-    if (attributes && (attributes->valuemask & BxXpmReturnInfos))
-	xpmGetCmt(data, &colors_cmt);
-
-    /*
-     * read pixels and index them on color number
-     */
-    pixelindex =
-	(unsigned int *) malloc(sizeof(unsigned int) * width * height);
-    if (!pixelindex)
-	RETURN(BxXpmNoMemory);
-
-    iptr = pixelindex;
-
-    chars = (char *) malloc(cpp);
-    if (!chars)
-	RETURN(BxXpmNoMemory);
-
-    for (y = 0; y < height; y++) {
-	xpmNextString(data);
-	for (x = 0; x < width; x++, iptr++) {
-	    for (a = 0; a < cpp; a++)
-		chars[a] = xpmGetC(data);
-	    for (a = 0; a < ncolors; a++)
-		if (!strncmp(colorTable[a][0], chars, cpp))
-		    break;
-	    if (a == ncolors)
-		RETURN(BxXpmFileInvalid);	/* no color matches */
-	    *iptr = a;
-	}
-    }
-
-    /*
-     * store the pixels comment line
-     */
-    if (attributes && (attributes->valuemask & BxXpmReturnInfos))
-	xpmGetCmt(data, &pixels_cmt);
-
-    free(chars);
-
-    /*
-     * store found informations in the bxxpmInternAttrib structure
-     */
-    attrib_return->width = width;
-    attrib_return->height = height;
-    attrib_return->cpp = cpp;
-    attrib_return->ncolors = ncolors;
-    attrib_return->colorTable = colorTable;
-    attrib_return->pixelindex = pixelindex;
-
-    if (attributes) {
-	if (attributes->valuemask & BxXpmReturnInfos) {
-	    attributes->hints_cmt = hints_cmt;
-	    attributes->colors_cmt = colors_cmt;
-	    attributes->pixels_cmt = pixels_cmt;
-	}
-	if (hotspot) {
-	    attributes->x_hotspot = x_hotspot;
-	    attributes->y_hotspot = y_hotspot;
-	    attributes->valuemask |= BxXpmHotspot;
-	}
-    }
-    return (BxXpmSuccess);
-}
-
-/*
- * set the color pixel related to the given colorname,
- * return 0 if success, 1 otherwise.
- */
-
-static int SetColor
-ARGLIST((display, colormap,colorname, color_index, image_pixel, mask_pixel, mask_pixel_index))
-ARG(Display *, display)
-ARG(Colormap, colormap)
-ARG(char *, colorname)
-ARG(unsigned int, color_index)
-ARG(Pixel *, image_pixel)
-ARG(Pixel *, mask_pixel)
-GRA(unsigned int *, mask_pixel_index)
-{
-    XColor xcolor;
-
-    if (STRCASECMP(colorname, (char *)BX_TRANSPARENT_COLOR)) {
-	if (!XParseColor(display, colormap, colorname, &xcolor)
-	    || (!XAllocColor(display, colormap, &xcolor)))
-	    return (1);
-	*image_pixel = xcolor.pixel;
-	*mask_pixel = 1;
-    } else {
-	*image_pixel = 0;
-	*mask_pixel = 0;
-	*mask_pixel_index = color_index;/* store the color table index */
-    }
-    return (0);
-}
-
-/* function call in case of error, frees only localy allocated variables */
-#undef RETURN
-#define RETURN(status) \
-  { if (image) XDestroyImage(image); \
-    if (shapeimage) XDestroyImage(shapeimage); \
-    if (image_pixels) free((char *)image_pixels); \
-    if (mask_pixels) free((char *)mask_pixels); \
-    return(status); }
-
-static int xpmCreateImage
-ARGLIST((display, attrib, image_return, shapeimage_return, attributes))
-ARG(Display *, display)
-ARG(bxxpmInternAttrib *, attrib)
-ARG(XImage **, image_return)
-ARG(XImage **, shapeimage_return)
-GRA(BxXpmAttributes *, attributes)
-{
-    /* variables stored in the BxXpmAttributes structure */
-    Visual *visual;
-    Colormap colormap;
-    unsigned int depth;
-    BxXpmColorSymbol *colorsymbols;
-    unsigned int numsymbols;
-
-    /* variables to return */
-    XImage *image = NULL;
-    XImage *shapeimage = NULL;
-    unsigned int mask_pixel;
-    unsigned int ErrorStatus, ErrorStatus2;
-
-    /* calculation variables */
-    Pixel *image_pixels = NULL;
-    Pixel *mask_pixels = NULL;
-    char *colorname;
-    unsigned int a, b, l;
-    Boolean pixel_defined;
-    unsigned int key;
-
-    /*
-     * retrieve information from the BxXpmAttributes
-     */
-    if (attributes && attributes->valuemask & BxXpmColorSymbols) {
-	colorsymbols = attributes->colorsymbols;
-	numsymbols = attributes->numsymbols;
-    } else
-	numsymbols = 0;
-
-    if (attributes && attributes->valuemask & BxXpmVisual)
-	visual = attributes->visual;
-    else
-	visual = DefaultVisual(display, DefaultScreen(display));
-
-    if (attributes && attributes->valuemask & BxXpmColormap)
-	colormap = attributes->colormap;
-    else
-	colormap = DefaultColormap(display, DefaultScreen(display));
-
-    if (attributes && attributes->valuemask & BxXpmDepth)
-	depth = attributes->depth;
-    else
-	depth = DefaultDepth(display, DefaultScreen(display));
-
-
-    ErrorStatus = BxXpmSuccess;
-
-    /*
-     * alloc pixels index tables
-     */
-
-    key = BxXpmVisualType(visual);
-    image_pixels = (Pixel *) malloc(sizeof(Pixel) * attrib->ncolors);
-    if (!image_pixels)
-	RETURN(BxXpmNoMemory);
-
-    mask_pixels = (Pixel *) malloc(sizeof(Pixel) * attrib->ncolors);
-    if (!mask_pixels)
-	RETURN(BxXpmNoMemory);
-
-    mask_pixel = BX_UNDEF_PIXEL;
-
-    /*
-     * get pixel colors, store them in index tables
-     */
-    for (a = 0; a < attrib->ncolors; a++) {
-	colorname = NULL;
-	pixel_defined = False;
-
-	/*
-	 * look for a defined symbol
-	 */
-	if (numsymbols && attrib->colorTable[a][1]) {
-	    for (l = 0; l < numsymbols; l++)
-		if (!strcmp(colorsymbols[l].name, attrib->colorTable[a][1]))
-		    break;
-	    if (l != numsymbols) {
-		if (colorsymbols[l].value)
-		    colorname = colorsymbols[l].value;
-		else
-		    pixel_defined = True;
-	    }
-	}
-	if (!pixel_defined) {		/* pixel not given as symbol value */
-
-	    if (colorname) {		/* colorname given as symbol value */
-		if (!SetColor(display, colormap, colorname, a,
-			   &image_pixels[a], &mask_pixels[a], &mask_pixel))
-		    pixel_defined = True;
-		else
-		    ErrorStatus = BxXpmColorError;
-	    }
-	    b = key;
-	    while (!pixel_defined && b > 1) {
-		if (attrib->colorTable[a][b]) {
-		    if (!SetColor(display, colormap, attrib->colorTable[a][b],
-				  a, &image_pixels[a], &mask_pixels[a],
-				  &mask_pixel)) {
-			pixel_defined = True;
-			break;
-		    } else
-			ErrorStatus = BxXpmColorError;
-		}
-		b--;
-	    }
-
-	    b = key + 1;
-	    while (!pixel_defined && b < BXNKEYS + 1) {
-		if (attrib->colorTable[a][b]) {
-		    if (!SetColor(display, colormap, attrib->colorTable[a][b],
-				  a, &image_pixels[a], &mask_pixels[a],
-				  &mask_pixel)) {
-			pixel_defined = True;
-			break;
-		    } else
-			ErrorStatus = BxXpmColorError;
-		}
-		b++;
-	    }
-
-	    if (!pixel_defined)
-		RETURN(BxXpmColorFailed);
-
-	} else {
-	    image_pixels[a] = colorsymbols[l].pixel;
-	    mask_pixels[a] = 1;
-	}
-    }
-
-    /*
-     * create the image
-     */
-    if (image_return) {
-	ErrorStatus2 = CreateXImage(display, visual, depth,
-				    attrib->width, attrib->height, &image);
-	if (ErrorStatus2 != BxXpmSuccess)
-	    RETURN(ErrorStatus2);
-
-	/*
-	 * set the image data
-	 *
-	 * In case depth is 1 or bits_per_pixel is 4, 6, 8, 24 or 32 use
-	 * optimized functions, otherwise use slower but sure general one.
-	 *
-	 */
-
-	if (image->depth == 1)
-	    SetImagePixels1(image, attrib->width, attrib->height,
-			    attrib->pixelindex, image_pixels);
-	else if (image->bits_per_pixel == 8)
-	    SetImagePixels8(image, attrib->width, attrib->height,
-			    attrib->pixelindex, image_pixels);
-	else if (image->bits_per_pixel == 16)
-	    SetImagePixels16(image, attrib->width, attrib->height,
-			     attrib->pixelindex, image_pixels);
-	else if (image->bits_per_pixel == 32)
-	    SetImagePixels32(image, attrib->width, attrib->height,
-			     attrib->pixelindex, image_pixels);
-	else
-	    SetImagePixels(image, attrib->width, attrib->height,
-			   attrib->pixelindex, image_pixels);
-    }
-
-    /*
-     * create the shape mask image
-     */
-    if (mask_pixel != BX_UNDEF_PIXEL && shapeimage_return) {
-	ErrorStatus2 = CreateXImage(display, visual, 1, attrib->width,
-				    attrib->height, &shapeimage);
-	if (ErrorStatus2 != BxXpmSuccess)
-	    RETURN(ErrorStatus2);
-
-	SetImagePixels1(shapeimage, attrib->width, attrib->height,
-			attrib->pixelindex, mask_pixels);
-    }
-    free((char *)mask_pixels);
-
-    /*
-     * if requested store allocated pixels in the BxXpmAttributes structure
-     */
-    if (attributes &&
-	(attributes->valuemask & BxXpmReturnInfos
-	 || attributes->valuemask & BxXpmReturnPixels)) {
-	if (mask_pixel != BX_UNDEF_PIXEL) {
-	    Pixel *pixels, *p1, *p2;
-
-	    attributes->npixels = attrib->ncolors - 1;
-	    pixels = (Pixel *) malloc(sizeof(Pixel) * attributes->npixels);
-	    if (pixels) {
-		p1 = image_pixels;
-		p2 = pixels;
-		for (a = 0; a < attrib->ncolors; a++, p1++)
-		    if (a != mask_pixel)
-			*p2++ = *p1;
-		attributes->pixels = pixels;
-	    } else {
-		/* if error just say we can't return requested data */
-		attributes->valuemask &= ~BxXpmReturnPixels;
-		attributes->valuemask &= ~BxXpmReturnInfos;
-		attributes->pixels = NULL;
-		attributes->npixels = 0;
-	    }
-	    free((char *)image_pixels);
-	} else {
-	    attributes->pixels = image_pixels;
-	    attributes->npixels = attrib->ncolors;
-	}
-	attributes->mask_pixel = mask_pixel;
-    } else
-	free((char *)image_pixels);
-
-
-    /*
-     * return created images
-     */
-    if (image_return)
-	*image_return = image;
-
-    if (shapeimage_return)
-	*shapeimage_return = shapeimage;
-
-    return (ErrorStatus);
-}
-
-
-/*
- * Create an XImage
- */
-static int CreateXImage
-ARGLIST((display, visual, depth, width, height, image_return))
-ARG(Display *, display)
-ARG(Visual *, visual)
-ARG(unsigned int, depth)
-ARG(unsigned int, width)
-ARG(unsigned int, height)
-GRA(XImage **, image_return)
-{
-    int bitmap_pad;
-
-    /* first get bitmap_pad */
-    if (depth > 16)
-	bitmap_pad = 32;
-    else if (depth > 8)
-	bitmap_pad = 16;
-    else
-	bitmap_pad = 8;
-
-    /* then create the XImage with data = NULL and bytes_per_line = 0 */
-
-    *image_return = XCreateImage(display, visual, depth, ZPixmap, 0, 0,
-				 width, height, bitmap_pad, 0);
-    if (!*image_return)
-	return (BxXpmNoMemory);
-
-    /* now that bytes_per_line must have been set properly alloc data */
-
-    (*image_return)->data =
-	(char *) malloc((*image_return)->bytes_per_line * height);
-
-    if (!(*image_return)->data) {
-	XDestroyImage(*image_return);
-	*image_return = NULL;
-	return (BxXpmNoMemory);
-    }
-    return (BxXpmSuccess);
-}
-
-
-/*
- * The functions below are written from X11R5 MIT's code (XImUtil.c)
- *
- * The idea is to have faster functions than the standard XPutPixel function
- * to build the image data. Indeed we can speed up things by supressing tests
- * performed for each pixel. We do exactly the same tests but at the image
- * level. Assuming that we use only ZPixmap images.
- */
-
-LFUNC(_putbits, void, (register char *src, int dstoffset,
-		      register int numbits, register char *dst));
-
-LFUNC(_XReverse_Bytes, void, (register unsigned char *bpt, register int nb));
-
-static unsigned char Const _reverse_byte[0x100] = {
-			    0x00, 0x80, 0x40, 0xc0, 0x20, 0xa0, 0x60, 0xe0,
-			    0x10, 0x90, 0x50, 0xd0, 0x30, 0xb0, 0x70, 0xf0,
-			    0x08, 0x88, 0x48, 0xc8, 0x28, 0xa8, 0x68, 0xe8,
-			    0x18, 0x98, 0x58, 0xd8, 0x38, 0xb8, 0x78, 0xf8,
-			    0x04, 0x84, 0x44, 0xc4, 0x24, 0xa4, 0x64, 0xe4,
-			    0x14, 0x94, 0x54, 0xd4, 0x34, 0xb4, 0x74, 0xf4,
-			    0x0c, 0x8c, 0x4c, 0xcc, 0x2c, 0xac, 0x6c, 0xec,
-			    0x1c, 0x9c, 0x5c, 0xdc, 0x3c, 0xbc, 0x7c, 0xfc,
-			    0x02, 0x82, 0x42, 0xc2, 0x22, 0xa2, 0x62, 0xe2,
-			    0x12, 0x92, 0x52, 0xd2, 0x32, 0xb2, 0x72, 0xf2,
-			    0x0a, 0x8a, 0x4a, 0xca, 0x2a, 0xaa, 0x6a, 0xea,
-			    0x1a, 0x9a, 0x5a, 0xda, 0x3a, 0xba, 0x7a, 0xfa,
-			    0x06, 0x86, 0x46, 0xc6, 0x26, 0xa6, 0x66, 0xe6,
-			    0x16, 0x96, 0x56, 0xd6, 0x36, 0xb6, 0x76, 0xf6,
-			    0x0e, 0x8e, 0x4e, 0xce, 0x2e, 0xae, 0x6e, 0xee,
-			    0x1e, 0x9e, 0x5e, 0xde, 0x3e, 0xbe, 0x7e, 0xfe,
-			    0x01, 0x81, 0x41, 0xc1, 0x21, 0xa1, 0x61, 0xe1,
-			    0x11, 0x91, 0x51, 0xd1, 0x31, 0xb1, 0x71, 0xf1,
-			    0x09, 0x89, 0x49, 0xc9, 0x29, 0xa9, 0x69, 0xe9,
-			    0x19, 0x99, 0x59, 0xd9, 0x39, 0xb9, 0x79, 0xf9,
-			    0x05, 0x85, 0x45, 0xc5, 0x25, 0xa5, 0x65, 0xe5,
-			    0x15, 0x95, 0x55, 0xd5, 0x35, 0xb5, 0x75, 0xf5,
-			    0x0d, 0x8d, 0x4d, 0xcd, 0x2d, 0xad, 0x6d, 0xed,
-			    0x1d, 0x9d, 0x5d, 0xdd, 0x3d, 0xbd, 0x7d, 0xfd,
-			    0x03, 0x83, 0x43, 0xc3, 0x23, 0xa3, 0x63, 0xe3,
-			    0x13, 0x93, 0x53, 0xd3, 0x33, 0xb3, 0x73, 0xf3,
-			    0x0b, 0x8b, 0x4b, 0xcb, 0x2b, 0xab, 0x6b, 0xeb,
-			    0x1b, 0x9b, 0x5b, 0xdb, 0x3b, 0xbb, 0x7b, 0xfb,
-			    0x07, 0x87, 0x47, 0xc7, 0x27, 0xa7, 0x67, 0xe7,
-			    0x17, 0x97, 0x57, 0xd7, 0x37, 0xb7, 0x77, 0xf7,
-			    0x0f, 0x8f, 0x4f, 0xcf, 0x2f, 0xaf, 0x6f, 0xef,
-			     0x1f, 0x9f, 0x5f, 0xdf, 0x3f, 0xbf, 0x7f, 0xff
-};
-
-static void _XReverse_Bytes
-ARGLIST((bpt, nb))
-ARG(register unsigned char *, bpt)
-GRA(register int, nb)
-{
-    do {
-	*bpt = _reverse_byte[*bpt];
-	bpt++;
-    } while (--nb > 0);
-}
-
-static void xpm_xynormalizeimagebits
-ARGLIST((bp,img))
-ARG(register unsigned char *, bp)
-GRA(register XImage *, img)
-{
-    register unsigned char c;
-
-    if (img->byte_order != img->bitmap_bit_order) {
-	switch (img->bitmap_unit) {
-
-	case 16:
-	    c = *bp;
-	    *bp = *(bp + 1);
-	    *(bp + 1) = c;
-	    break;
-
-	case 32:
-	    c = *(bp + 3);
-	    *(bp + 3) = *bp;
-	    *bp = c;
-	    c = *(bp + 2);
-	    *(bp + 2) = *(bp + 1);
-	    *(bp + 1) = c;
-	    break;
-	}
-    }
-    if (img->bitmap_bit_order == MSBFirst)
-	_XReverse_Bytes(bp, img->bitmap_unit >> 3);
-}
-
-static void xpm_znormalizeimagebits
-ARGLIST((bp,img))
-ARG(register unsigned char *, bp)
-GRA(register XImage *, img)
-{
-    register unsigned char c;
-
-    switch (img->bits_per_pixel) {
-
-    case 4:
-	*bp = ((*bp >> 4) & 0xF) | ((*bp << 4) & ~0xF);
-	break;
-
-    case 16:
-	c = *bp;
-	*bp = *(bp + 1);
-	*(bp + 1) = c;
-	break;
-
-    case 24:
-	c = *(bp + 2);
-	*(bp + 2) = *bp;
-	*bp = c;
-	break;
-
-    case 32:
-	c = *(bp + 3);
-	*(bp + 3) = *bp;
-	*bp = c;
-	c = *(bp + 2);
-	*(bp + 2) = *(bp + 1);
-	*(bp + 1) = c;
-	break;
-    }
-}
-
-static unsigned char Const _lomask[0x09] = {
-		     0x00, 0x01, 0x03, 0x07, 0x0f, 0x1f, 0x3f, 0x7f, 0xff};
-static unsigned char Const _himask[0x09] = {
-		     0xff, 0xfe, 0xfc, 0xf8, 0xf0, 0xe0, 0xc0, 0x80, 0x00};
-
-static void _putbits
-ARGLIST((src, dstoffset, numbits, dst))
-ARG(register char *, src)		/* address of source bit string */
-ARG(int, dstoffset)			/* bit offset into destination;
-					 * range is 0-31 */
-ARG(register int, numbits)		/* number of bits to copy to
-					 * destination */
-GRA(register char *, dst)		/* address of destination bit string */
-{
-    register unsigned char chlo, chhi;
-    int hibits;
-
-    dst = dst + (dstoffset >> 3);
-    dstoffset = dstoffset & 7;
-    hibits = 8 - dstoffset;
-    chlo = *dst & _lomask[dstoffset];
-    for (;;) {
-	chhi = (*src << dstoffset) & _himask[dstoffset];
-	if (numbits <= hibits) {
-	    chhi = chhi & _lomask[dstoffset + numbits];
-	    *dst = (*dst & _himask[dstoffset + numbits]) | chlo | chhi;
-	    break;
-	}
-	*dst = chhi | chlo;
-	dst++;
-	numbits = numbits - hibits;
-	chlo = (unsigned char) (*src & _himask[hibits]) >> hibits;
-	src++;
-	if (numbits <= dstoffset) {
-	    chlo = chlo & _lomask[numbits];
-	    *dst = (*dst & _himask[numbits]) | chlo;
-	    break;
-	}
-	numbits = numbits - dstoffset;
-    }
-}
-
-/*
- * Default method to write pixels into a Z image data structure.
- * The algorithm used is:
- *
- *	copy the destination bitmap_unit or Zpixel to temp
- *	normalize temp if needed
- *	copy the pixel bits into the temp
- *	renormalize temp if needed
- *	copy the temp back into the destination image data
- */
-
-static void SetImagePixels
-ARGLIST((image, width, height, pixelindex, pixels))
-ARG(XImage *, image)
-ARG(unsigned int, width)
-ARG(unsigned int, height)
-ARG(unsigned int *, pixelindex)
-GRA(Pixel *, pixels)
-{
-    Pixel pixel;
-    unsigned long px;
-    register char *src;
-    register char *dst;
-    int nbytes;
-    register unsigned int *iptr;
-    register int x, y, i;
-
-    iptr = pixelindex;
-    if (image->depth == 1) {
-	for (y = 0; y < height; y++)
-	    for (x = 0; x < width; x++, iptr++) {
-		pixel = pixels[*iptr];
-		for (i = 0, px = pixel;
-		     i < sizeof(unsigned long); i++, px >>= 8)
-		    ((unsigned char *) &pixel)[i] = (unsigned char)px;
-		src = &image->data[BXXYINDEX(x, y, image)];
-		dst = (char *) &px;
-		px = 0;
-		nbytes = image->bitmap_unit >> 3;
-		for (i = nbytes; --i >= 0;)
-		    *dst++ = *src++;
-		BXXYNORMALIZE(&px, image);
-		i = ((x + image->xoffset) % image->bitmap_unit);
-		_putbits((char *) &pixel, i, 1, (char *) &px);
-		BXXYNORMALIZE(&px, image);
-		src = (char *) &px;
-		dst = &image->data[BXXYINDEX(x, y, image)];
-		for (i = nbytes; --i >= 0;)
-		    *dst++ = *src++;
-	    }
-    } else {
-	for (y = 0; y < height; y++)
-	    for (x = 0; x < width; x++, iptr++) {
-		pixel = pixels[*iptr];
-		if (image->depth == 4)
-		    pixel &= 0xf;
-		for (i = 0, px = pixel;
-		     i < sizeof(unsigned long); i++, px >>= 8)
-		    ((unsigned char *) &pixel)[i] = (unsigned char)px;
-		src = &image->data[BXZINDEX(x, y, image)];
-		dst = (char *) &px;
-		px = 0;
-		nbytes = (image->bits_per_pixel + 7) >> 3;
-		for (i = nbytes; --i >= 0;)
-		    *dst++ = *src++;
-		BXZNORMALIZE(&px, image);
-		_putbits((char *) &pixel,
-			 (x * image->bits_per_pixel) & 7,
-			 image->bits_per_pixel, (char *) &px);
-		BXZNORMALIZE(&px, image);
-		src = (char *) &px;
-		dst = &image->data[BXZINDEX(x, y, image)];
-		for (i = nbytes; --i >= 0;)
-		    *dst++ = *src++;
-	    }
-    }
-}
-
-/*
- * write pixels into a 32-bits Z image data structure
- */
-
-#ifndef WORD64
-static unsigned long byteorderpixel = MSBFirst << 24;
-
-#endif
-
-static void SetImagePixels32
-ARGLIST((image, width, height, pixelindex, pixels))
-ARG(XImage *, image)
-ARG(unsigned int, width)
-ARG(unsigned int, height)
-ARG(unsigned int *, pixelindex)
-GRA(Pixel *, pixels)
-{
-    register unsigned char *addr;
-    register unsigned int *paddr;
-    register unsigned int *iptr;
-    register int x, y;
-
-    iptr = pixelindex;
-#ifndef WORD64
-    if (*((char *) &byteorderpixel) == image->byte_order) {
-	for (y = 0; y < height; y++)
-	    for (x = 0; x < width; x++, iptr++) {
-		paddr =
-		    (unsigned int *)(&(image->data[BXZINDEX32(x, y, image)]));
-		*paddr = (unsigned int)pixels[*iptr];
-	    }
-    } else
-#endif
-    if (image->byte_order == MSBFirst)
-	for (y = 0; y < height; y++)
-	    for (x = 0; x < width; x++, iptr++) {
-		addr = &((unsigned char *) image->data)[BXZINDEX32(x, y, image)];
-		addr[0] = (unsigned char)(pixels[*iptr] >> 24);
-		addr[1] = (unsigned char)(pixels[*iptr] >> 16);
-		addr[2] = (unsigned char)(pixels[*iptr] >> 8);
-		addr[3] = (unsigned char)(pixels[*iptr]);
-	    }
-    else
-	for (y = 0; y < height; y++)
-	    for (x = 0; x < width; x++, iptr++) {
-		addr = &((unsigned char *) image->data)[BXZINDEX32(x, y, image)];
-		addr[3] = (unsigned char)(pixels[*iptr] >> 24);
-		addr[2] = (unsigned char)(pixels[*iptr] >> 16);
-		addr[1] = (unsigned char)(pixels[*iptr] >> 8);
-		addr[0] = (unsigned char)(pixels[*iptr]);
-	    }
-}
-
-/*
- * write pixels into a 16-bits Z image data structure
- */
-
-static void SetImagePixels16
-ARGLIST((image, width, height, pixelindex, pixels))
-ARG(XImage *, image)
-ARG(unsigned int, width)
-ARG(unsigned int, height)
-ARG(unsigned int *, pixelindex)
-GRA(Pixel *, pixels)
-{
-    register unsigned char *addr;
-    register unsigned int *iptr;
-    register int x, y;
-
-    iptr = pixelindex;
-    if (image->byte_order == MSBFirst)
-	for (y = 0; y < height; y++)
-	    for (x = 0; x < width; x++, iptr++) {
-		addr = &((unsigned char *) image->data)[BXZINDEX16(x, y, image)];
-		addr[0] = (unsigned char)(pixels[*iptr] >> 8);
-		addr[1] = (unsigned char)(pixels[*iptr]);
-	    }
-    else
-	for (y = 0; y < height; y++)
-	    for (x = 0; x < width; x++, iptr++) {
-		addr = &((unsigned char *) image->data)[BXZINDEX16(x, y, image)];
-		addr[1] = (unsigned char)(pixels[*iptr] >> 8);
-		addr[0] = (unsigned char)(pixels[*iptr]);
-	    }
-}
-
-/*
- * write pixels into a 8-bits Z image data structure
- */
-
-static void SetImagePixels8
-ARGLIST((image, width, height, pixelindex, pixels))
-ARG(XImage *, image)
-ARG(unsigned int, width)
-ARG(unsigned int, height)
-ARG(unsigned int *, pixelindex)
-GRA(Pixel *, pixels)
-
-{
-    register unsigned int *iptr;
-    register int x, y;
-
-    iptr = pixelindex;
-    for (y = 0; y < height; y++)
-	for (x = 0; x < width; x++, iptr++)
-	    image->data[BXZINDEX8(x, y, image)] = (char)pixels[*iptr];
-}
-
-/*
- * write pixels into a 1-bit depth image data structure and **offset null**
- */
-
-static void SetImagePixels1
-ARGLIST((image, width, height, pixelindex, pixels))
-ARG(XImage *, image)
-ARG(unsigned int, width)
-ARG(unsigned int, height)
-ARG(unsigned int *, pixelindex)
-GRA(Pixel *, pixels)
-{
-    unsigned char bit;
-    int xoff, yoff;
-    register unsigned int *iptr;
-    register int x, y;
-
-    if (image->byte_order != image->bitmap_bit_order)
-	SetImagePixels(image, width, height, pixelindex, pixels);
-    else {
-	iptr = pixelindex;
-	if (image->bitmap_bit_order == MSBFirst)
-	    for (y = 0; y < height; y++)
-		for (x = 0; x < width; x++, iptr++) {
-		    yoff = BXZINDEX1(x, y, image);
-		    xoff = x & 7;
-		    bit = 0x80 >> xoff;
-		    if (pixels[*iptr] & 1)
-			image->data[yoff] |= bit;
-		    else
-			image->data[yoff] &= ~bit;
-		}
-	else
-	    for (y = 0; y < height; y++)
-		for (x = 0; x < width; x++, iptr++) {
-		    yoff = BXZINDEX1(x, y, image);
-		    xoff = x & 7;
-		    bit = 1 << xoff;
-		    if (pixels[*iptr] & 1)
-			image->data[yoff] |= bit;
-		    else
-			image->data[yoff] &= ~bit;
-		}
-    }
-}
-
-/*
- * Store into the BxXpmAttributes structure the required informations stored in
- * the bxxpmInternAttrib structure.
- */
-
-static void xpmSetAttributes
-ARGLIST((attrib, attributes))
-ARG(bxxpmInternAttrib *, attrib)
-GRA(BxXpmAttributes *, attributes)
-{
-    if (attributes) {
-        if (attributes->valuemask & BxXpmReturnInfos) {
-            attributes->cpp = attrib->cpp;
-            attributes->ncolors = attrib->ncolors;
-            attributes->colorTable = attrib->colorTable;
-
-            attrib->ncolors = 0;
-            attrib->colorTable = NULL;
-        }
-        attributes->width = attrib->width;
-        attributes->height = attrib->height;
-        attributes->valuemask |= BxXpmSize;
-    }
-}
-
-/*
- * Free the BxXpmAttributes structure members
- * but the structure itself
- */
-
-static void BxXpmFreeAttributes
-ARGLIST((attributes))
-GRA(BxXpmAttributes *, attributes)
-{
-    if (attributes) {
-        if (attributes->valuemask & BxXpmReturnPixels && attributes->pixels) {
-            free((char *)attributes->pixels);
-            attributes->pixels = NULL;
-            attributes->npixels = 0;
-        }
-        if (attributes->valuemask & BxXpmInfos) {
-            if (attributes->colorTable) {
-                xpmFreeColorTable(attributes->colorTable, attributes->ncolors);
-                attributes->colorTable = NULL;
-                attributes->ncolors = 0;
-            }
-            if (attributes->hints_cmt) {
-                free(attributes->hints_cmt);
-                attributes->hints_cmt = NULL;
-            }
-            if (attributes->colors_cmt) {
-                free(attributes->colors_cmt);
-                attributes->colors_cmt = NULL;
-            }
-            if (attributes->pixels_cmt) {
-                free(attributes->pixels_cmt);
-                attributes->pixels_cmt = NULL;
-            }
-            if (attributes->pixels) {
-                free((char *)attributes->pixels);
-                attributes->pixels = NULL;
-            }
-        }
-        attributes->valuemask = 0;
-    }
-}
-
-/*
- * Free the bxxpmInternAttrib pointers which have been allocated
- */
-
-static void xpmFreeInternAttrib
-ARGLIST((attrib))
-GRA(bxxpmInternAttrib *, attrib)
-{
-    unsigned int a;
-
-    if (attrib->colorTable)
-        xpmFreeColorTable(attrib->colorTable, attrib->ncolors);
-    if (attrib->pixelindex)
-        free((char *)attrib->pixelindex);
-    if (attrib->xcolors)
-        free((char *)attrib->xcolors);
-    if (attrib->colorStrings) {
-        for (a = 0; a < attrib->ncolors; a++)
-            if (attrib->colorStrings[a])
-                free((char *)attrib->colorStrings[a]);
-        free((char *)attrib->colorStrings);
-    }
-}
-
-/*
- * close the file related to the bxxpmData if any
- */
-static void XpmDataClose
-ARGLIST((mdata))
-GRA(bxxpmData *, mdata)
-{
-    switch (mdata->type) {
-    case BXXPMARRAY:
-        break;
-    case BXXPMFILE:
-        if (mdata->stream.file != (stdout) && mdata->stream.file != (stdin))
-            fclose(mdata->stream.file);
-        break;
-#ifdef ZPIPE
-    case BXXPMPIPE:
-        pclose(mdata->stream.file);
-#endif
-    }
-}
-
-/*
- * skip whitespace and compute the following unsigned int,
- * returns 1 if one is found and 0 if not
- */
-static int xpmNextUI
-ARGLIST((mdata, ui_return))
-ARG(bxxpmData *, mdata)
-GRA(unsigned int *, ui_return)
-{
-    char buf[BUFSIZ];
-    int l;
-
-    l = xpmNextWord(mdata, buf);
-    return atoui(buf, l, ui_return);
-}
-
-/*
- * get the current comment line
- */
-static void xpmGetCmt
-ARGLIST((mdata, cmt))
-ARG(bxxpmData *, mdata)
-GRA(char **, cmt)
-{
-    switch (mdata->type) {
-    case BXXPMARRAY:
-        *cmt = NULL;
-        break;
-    case BXXPMFILE:
-    case BXXPMPIPE:
-        if (mdata->CommentLength) {
-            *cmt = (char *) malloc(mdata->CommentLength + 1);
-            strncpy(*cmt, mdata->Comment, mdata->CommentLength);
-            (*cmt)[mdata->CommentLength] = '\0';
-            mdata->CommentLength = 0;
-        } else
-            *cmt = NULL;
-        break;
-    }
-}
-
-/*
- * skip to the end of the current string and the beginning of the next one
- */
-static void xpmNextString
-ARGLIST((mdata))
-GRA(bxxpmData *, mdata)
-{
-    int c;
-
-    switch (mdata->type) {
-    case BXXPMARRAY:
-        mdata->cptr = (mdata->stream.data)[++mdata->line];
-        break;
-    case BXXPMFILE:
-    case BXXPMPIPE:
-        if (mdata->Eos)
-            while ((c = xpmGetC(mdata)) != mdata->Eos && c != EOF);
-        if (mdata->Bos)                 /* if not natural XPM2 */
-            while ((c = xpmGetC(mdata)) != mdata->Bos && c != EOF);
-        break;
-    }
-}
-
-/*
- * return the current character, skipping comments
- */
-static int xpmGetC
-ARGLIST((mdata))
-GRA(bxxpmData *, mdata)
-{
-    int c;
-    register unsigned int n = 0, a;
-    unsigned int notend;
-
-    switch (mdata->type) {
-    case BXXPMARRAY:
-        return (*mdata->cptr++);
-    case BXXPMFILE:
-    case BXXPMPIPE:
-        c = getc(mdata->stream.file);
-
-        if (mdata->Bos && mdata->Eos
-            && (c == mdata->Bos || c == mdata->Eos)) {
-            /* if not natural XPM2 */
-            mdata->InsideString = !mdata->InsideString;
-            return (c);
-        }
-        if (!mdata->InsideString && mdata->Bcmt && c == mdata->Bcmt[0]) {
-            mdata->Comment[0] = c;
-
-            /*
-             * skip the string begining comment
-             */
-            do {
-                c = getc(mdata->stream.file);
-                mdata->Comment[++n] = c;
-            } while (c == mdata->Bcmt[n] && mdata->Bcmt[n] != '\0'
-                     && c != EOF);
-
-            if (mdata->Bcmt[n] != '\0') {
-                /* this wasn't the begining of a comment */
-                /* put characters back in the order that we got them */
-                for (a = n; a > 0; a--)
-                    xpmUngetC(mdata->Comment[a], mdata);
-                return (mdata->Comment[0]);
-            }
-
-            /*
-             * store comment
-             */
-            mdata->Comment[0] = mdata->Comment[n];
-            notend = 1;
-            n = 0;
-            while (notend) {
-                while (mdata->Comment[n] != mdata->Ecmt[0] && c != EOF) {
-                    c = getc(mdata->stream.file);
-                    mdata->Comment[++n] = c;
-                }
-                mdata->CommentLength = n;
-                a = 0;
-                do {
-                    c = getc(mdata->stream.file);
-                    n++;
-                    a++;
-                    mdata->Comment[n] = c;
-                } while (c == mdata->Ecmt[a] && mdata->Ecmt[a] != '\0'
-                         && c != EOF);
-                if (mdata->Ecmt[a] == '\0') {
-                    /* this is the end of the comment */
-                    notend = 0;
-                    xpmUngetC(mdata->Comment[n], mdata);
-                }
-            }
-            c = xpmGetC(mdata);
-        }
-        return (c);
-    }
-    return('\0');
-}
-
-
-/*
- * push the given character back
- */
-static int xpmUngetC
-ARGLIST((c, mdata))
-ARG(int, c)
-GRA(bxxpmData *, mdata)
-{
-    switch (mdata->type) {
-    case BXXPMARRAY:
-        return (*--mdata->cptr = c);
-    case BXXPMFILE:
-    case BXXPMPIPE:
-        if (mdata->Bos && (c == mdata->Bos || c == mdata->Eos))
-            /* if not natural XPM2 */
-            mdata->InsideString = !mdata->InsideString;
-        return (ungetc(c, mdata->stream.file));
-    }
-    return('\0');
-}
-
-/*
- * skip whitespace and return the following word
- */
-static unsigned int xpmNextWord
-ARGLIST((mdata, buf))
-ARG(bxxpmData *, mdata)
-GRA(char *, buf)
-{
-    register unsigned int n = 0;
-    int c;
-
-    switch (mdata->type) {
-    case BXXPMARRAY:
-    	c = *mdata->cptr;
-        while (isspace(c) && c != mdata->Eos)
-            {
-	    mdata->cptr++;
-    	    c = *mdata->cptr;
-	    }
-        do {
-            c = *mdata->cptr++;
-            buf[n++] = c;
-        } while (!isspace(c) && c != mdata->Eos && c != '\0');
-        n--;
-        mdata->cptr--;
-        break;
-    case BXXPMFILE:
-    case BXXPMPIPE:
-        c = xpmGetC(mdata);
-        while (isspace(c) && c != mdata->Eos)
-	    c = xpmGetC(mdata);
-        while (!isspace(c) && c != mdata->Eos && c != EOF) {
-            buf[n++] = c;
-            c = xpmGetC(mdata);
-        }
-        xpmUngetC(c, mdata);
-        break;
-    }
-    return (n);
-}
-
-static int BxXpmVisualType
-ARGLIST((visual))
-GRA(Visual *, visual)
-{
-#if defined(__cplusplus) || defined(c_plusplus)
-    switch ( visual->c_class )
-#else
-    switch ( visual->class )
-#endif
-    {
-    case StaticGray:
-    case GrayScale:
-	switch (visual->map_entries)
-	{
-	case 2:
-	    return (BXMONO);
-	case 4:
-	    return (BXGRAY4);
-	default:
-	    return (BXGRAY);
-	}
-    default:
-	return (BXCOLOR);
-    }
-}
-
-/*
- * Free the computed color table
- */
-
-static void xpmFreeColorTable
-ARGLIST((colorTable, ncolors))
-ARG(char ***, colorTable)
-GRA(int, ncolors)
-{
-    int a, b;
-
-    if (colorTable) {
-        for (a = 0; a < ncolors; a++)
-            if (colorTable[a]) {
-                for (b = 0; b < (BXNKEYS + 1); b++)
-                    if (colorTable[a][b])
-                        free(colorTable[a][b]);
-                free((char *)colorTable[a]);
-            }
-        free((char *)colorTable);
-    }
-}
-
-#else /* USE_XPM_LIBRARY */
-
-#include <xpm.h>
-
-#define BxXpmColorError    		XpmColorError
-#define BxXpmSuccess       		XpmSuccess
-#define BxXpmOpenFailed    		XpmOpenFailed
-#define BxXpmFileInvalid   		XpmFileInvalid
-#define BxXpmNoMemory      		XpmNoMemory
-#define BxXpmColorFailed   		XpmColorFailed
-
-#define BxXpmVisual        		XpmVisual
-#define BxXpmColormap      		XpmColormap
-#define BxXpmDepth         		XpmDepth
-#define BxXpmSize          		XpmSize
-#define BxXpmHotspot       		XpmHotspot
-#define BxXpmCharsPerPixel 		XpmCharsPerPixel
-#define BxXpmColorSymbols  		XpmColorSymbols
-#define BxXpmRgbFilename   		XpmRgbFilename
-#define BxXpmInfos         		XpmInfos
-
-#define BxXpmReturnPixels  		XpmReturnPixels
-#define BxXpmReturnInfos   		XpmReturnInfos
-
-#define BxXpmCreatePixmapFromData	XpmCreatePixmapFromData
-#define BxXpmCreateImageFromData	XpmCreateImageFromData
-#define BxXpmFreeAttributes		XpmFreeAttributes
-
-typedef XpmAttributes      		BxXpmAttributes;
-
-#endif /* USE_XPM_LIBRARY */
-
-Pixmap XPM_PIXMAP
-ARGLIST((w, pixmapName))
-ARG(Widget, w)
-GRA(char **, pixmapName)
-{
-    BxXpmAttributes	attributes;
-    int			argcnt;
-    Arg			args[10];
-    Pixmap		pixmap;
-    Pixmap		shape;
-    int			returnValue;
-
-    attributes.valuemask = 0;
-    attributes.depth = 0;
-    attributes.colormap = 0;
-    attributes.visual = 0;
-
-    argcnt = 0;
-    XtSetArg(args[argcnt], XmNdepth, &(attributes.depth)); argcnt++;
-    XtSetArg(args[argcnt], XmNcolormap, &(attributes.colormap)); argcnt++;
-    if ( ! XtIsWidget(w) )
-    {
-	XtGetValues(XtParent(w), args, argcnt);
-    }
-    else
-    {
-	XtGetValues(w, args, argcnt);
-    }
-
-    attributes.visual = DefaultVisual(XtDisplayOfObject(w),
-				      DefaultScreen(XtDisplayOfObject(w)));
-
-    if ( attributes.depth != 0 ) attributes.valuemask |= BxXpmDepth;
-    if ( attributes.colormap != 0 ) attributes.valuemask |= BxXpmColormap;
-    if ( attributes.visual != 0 ) attributes.valuemask |= BxXpmVisual;
-
-    returnValue = BxXpmCreatePixmapFromData(XtDisplayOfObject(w),
-				       DefaultRootWindow(XtDisplayOfObject(w)),
-				       pixmapName, &pixmap, &shape,
-				       &attributes);
-    if ( shape )
-    {
-	XFreePixmap(XtDisplayOfObject(w), shape);
-    }
-
-    switch(returnValue)
-    {
-    case BxXpmOpenFailed:
-    case BxXpmFileInvalid:
-    case BxXpmNoMemory:
-    case BxXpmColorFailed:
-	XtWarning("Could not create pixmap.");
-	return(XmUNSPECIFIED_PIXMAP);
-    default:
-	return(pixmap);
-    }
-}
-
-#endif
-
- /* This structure is for capturing app-defaults values for a Class */
-
-typedef struct _UIAppDefault
-{
-    char*		cName;		/* Class name */
-    char*		wName; 		/* Widget name */
-    char*		cInstName;	/* Name of class instance(nested) */
-    char*		wRsc;		/* Widget resource */
-    char*		value;		/* value read from app-defaults */
-} UIAppDefault;
-
-
-void setDefaultResources ARGLIST((_name, w, resourceSpec))
-ARG(char*, _name)
-ARG(Widget, w)
-GRA(String *,resourceSpec)
-{
-   int         i;
-   Display    *dpy = XtDisplay ( w );	  /* Retrieve the display pointer */
-   XrmDatabase rdb = NULL;             /* A resource data base */
-
-   /* Create an empty resource database */
-
-   rdb = XrmGetStringDatabase ( (char *)"" );
-
-   /* Add the Component resources, prepending the name of the component */
-
-   i = 0;
-   while ( resourceSpec[i] != NULL )
-   {
-       char buf[1000];
-
-       sprintf(buf, "*%s%s", _name, resourceSpec[i++]);
-       XrmPutLineResource( &rdb, buf );
-   }
-
-   /* Merge them into the Xt database, with lowest precendence */
-
-   if ( rdb )
-   {
-#if (XlibSpecificationRelease>=5)
-        XrmDatabase db = XtDatabase(dpy);
-	XrmCombineDatabase(rdb, &db, FALSE);
-#else
-        XrmMergeDatabases ( dpy->db, &rdb );
-        dpy->db = rdb;
-#endif
-    }
-}
-
-/*
- * This method gets all the resources from the app-defaults file
- * (resource databse) and fills in the table (defs) if the app default
- * value exists.
- */
-void
-InitAppDefaults ARGLIST((parent, defs))
-ARG(Widget, parent)
-GRA(UIAppDefault *, defs)
-{
-    XrmQuark		cQuark;
-    XrmQuark		rsc[10];
-    XrmRepresentation	rep;
-    XrmValue		val;
-    XrmDatabase		rdb;
-    int			rscIdx;
-
-    /* Get the database */
-
-#if (XlibSpecificationRelease >= 5)
-    if ((rdb = XrmGetDatabase(XtDisplay(parent))) == NULL)
-    {
-	return;			/*  Can't get the database */
-    }
-#else
-    Display *dpy = XtDisplay(parent);
-    if ((rdb = dpy->db) == NULL)
-    {
-	return;
-    }
-#endif
-
-    /* Look for each resource in the table */
-
-    while (defs->wName)
-    {
-	rscIdx = 0;
-
-	cQuark = XrmStringToQuark(defs->cName);	/* class quark */
-	rsc[rscIdx++] = cQuark;
-	if (defs->wName[0] == '\0')
-	{
-	    rsc[rscIdx++] = cQuark;
-	}
-	else
-	{
-	    if( strchr(defs->wName, '.') == NULL )
-	    {
-		rsc[rscIdx++] = XrmStringToQuark(defs->wName);
-	    }
-	    else
-	    {
-		/*
-		 * If we found a '.' that means that this is not
-		 * a simple widget name, but a sub specification so
-		 * we need to split this into several quarks.
-		 */
-		char *copy = XtNewString(defs->wName), *ptr;
-
-		for( ptr = strtok(copy, "."); ptr != NULL;
-		     ptr = strtok(NULL, ".") )
-		{
-		    rsc[rscIdx++] = XrmStringToQuark(ptr);
-		}
-		XtFree(copy);
-	    }
-	}
-
-	if (defs->cInstName && defs->cInstName[0] != '\0')
-	{
-	    rsc[rscIdx++] = XrmStringToQuark(defs->cInstName);
-	}
-
-	rsc[rscIdx++] = XrmStringToQuark(defs->wRsc);
-	rsc[rscIdx++] = NULLQUARK;
-
-	if (XrmQGetResource(rdb, rsc, rsc, &rep, &val))
-	{
-	    defs->value = XtNewString((char*)val.addr);
-	}
-	defs++;
-    }
-}
-
-/*
- * This method applies the app defaults for the class to a specific
- * instance. All the widgets in the path are loosly coupled (use *).
- * To override a specific instance, use a tightly coupled app defaults
- * resource line (use .).
- */
-void
-SetAppDefaults ARGLIST((w, defs, inst_name, override_inst))
-ARG(Widget,w)
-ARG(UIAppDefault*, defs)
-ARG(char*, inst_name)
-GRA(Boolean, override_inst)
-{
-   Display*		dpy = XtDisplay (w);	/*  Retrieve the display */
-   XrmDatabase		rdb = NULL;		/* A resource data base */
-   char			buf[1000];
-   char 		*appName, *appClass;
-
-   /*
-    * Protect ourselves
-    */
-   if ( inst_name == NULL ) return;
-
-   /*
-    * Create an empty resource database
-    */
-   rdb = XrmGetStringDatabase ((char *)"");
-   XtGetApplicationNameAndClass(XtDisplay(w), &appName, &appClass);
-
-   /*
-    * Add the Component resources, prepending the name of the component
-    */
-   while ( defs->wName != NULL )
-   {
-       int namelen;
-       /*
-        * We don't deal with the resource if it isn't found in the
-	* Xrm database at class initializtion time (in initAppDefaults).
-	* Special handling of class instances.
-	*/
-       if ( strchr(defs->wName, '.') )
-       {
-	   namelen = strlen(defs->wName) - strlen(strchr(defs->wName, '.'));
-       }
-       else
-       {
-	   int		wnamelen = strlen(defs->wName);
-	   int		inamelen = strlen(inst_name);
-	   namelen = (wnamelen > inamelen ? wnamelen : inamelen);
-       }
-       if ( defs->value == NULL ||
-	    (override_inst && strncmp(inst_name, defs->wName, namelen)) ||
-	    (!override_inst && defs->cInstName != NULL) )
-       {
-	   defs++;
-	   continue;
-       }
-
-       /*
-	* Build up resource database string
-	*/
-       if ( defs->cInstName != NULL )
-       {
-	   /*
-	    * Don't include class instance name if it is also
-	    * the widget instance being worked on.
-	    */
-	   if ( *defs->cInstName != '\0' )
-	   {
-	       sprintf(buf, "%s*%s*%s.%s: %s", appClass, defs->cInstName,
-		       defs->wName, defs->wRsc, defs->value);
-	   }
-	   else
-	   {
-	       sprintf(buf, "%s*%s.%s: %s",
-		       appClass, defs->wName, defs->wRsc, defs->value);
-	   }
-       }
-       else if ( *defs->wName != '\0' )
-       {
-	   sprintf(buf, "%s*%s*%s.%s: %s",
-		   appClass, inst_name, defs->wName, defs->wRsc, defs->value);
-       }
-       else
-       {
-	   sprintf(buf, "%s*%s.%s: %s",
-		   appClass, inst_name,defs->wRsc, defs->value);
-       }
-
-       XrmPutLineResource(&rdb, buf);
-       defs++;
-   }
-
-   /*
-    * Merge them into the Xt database, with lowest precendence
-    */
-   if ( rdb )
-   {
-       /*  DO NOT do an XrmDestroyDatabase(rdb) here.  This looks like a
-	* program leak, but is really an X problem.
-	*
-	* XrmCombineDatabase() squirrels away a copy of the pointers in
-	* rdb.  Either XrmCombineDatabase should save a duplicate, or else
-	* XrmCombineDatabase needs to assume responsibility for destroying
-	* rdb at the right time.  We do not know when the pointers are no
-	* longer needed.
-	*/
-#if (XlibSpecificationRelease >= 5)
-        XrmDatabase db = XtDatabase(dpy);
-	XrmCombineDatabase(rdb, &db, FALSE);
-#else
-        XrmMergeDatabases ( dpy->db, &rdb );
-        dpy->db = rdb;
-#endif
-    }
-}
diff --git a/src/mbview/mbview_callbacks.c b/src/mbview/mbview_callbacks.c
deleted file mode 100644
index 17c194b..0000000
--- a/src/mbview/mbview_callbacks.c
+++ /dev/null
@@ -1,9939 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbview_callbacks.c	10/7/2002
- *    $Id: mbview_callbacks.c 2251 2015-07-01 01:02:06Z caress $
- *
- *    Copyright (c) 2002-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- *
- * Author:	D. W. Caress
- * Date:	October 7, 2002
- *
- *
- */
-
-/*------------------------------------------------------------------------------*/
-/*
- * README: This file is appended to at file generation time.
- * Edits can be made throughout the file
- */
-/*
- * Generated by the ICS Builder Xcessory (BX).
- *
- * Builder Xcessory Version 5.0.3
- * Code Generator Xcessory 5.0.1 (09/29/98)
- *
- */
-
-/* Begin user code block <file_comments> */
-
-#ifndef SANS
-#define SANS "helvetica"
-#endif
-#ifndef SERIF
-#define SERIF "times"
-#endif
-#ifndef MONO
-#define MONO "courier"
-#endif
-
-/* End user code block <file_comments> */
-
-/*
- * Standard includes for builtins.
- */
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include <math.h>
-
-/* Motif required Headers */
-#include <X11/StringDefs.h>
-#include <X11/cursorfont.h>
-#include <Xm/Xm.h>
-#include <Xm/MainW.h>
-#include <Xm/DialogS.h>
-#include <Xm/RepType.h>
-#include <Xm/MwmUtil.h>
-#include <Xm/BulletinB.h>
-#include <Xm/RowColumn.h>
-#include <Xm/CascadeB.h>
-#include <Xm/List.h>
-#include <Xm/PushB.h>
-#include <Xm/Separator.h>
-#include <Xm/FileSB.h>
-#include <Xm/Text.h>
-#include <Xm/TextF.h>
-#include <Xm/ToggleB.h>
-#include "MB3DView.h"
-#include "MB3DSiteList.h"
-#include "MB3DRouteList.h"
-#include "MB3DNavList.h"
-
-/* OpenGL include files */
-#ifdef WIN32
-#undef BOOL		/* It was defined by a chain of inclusions in the (patched) X11/Xmd.h */
-#include <windows.h>
-#endif
-
-#include <GL/gl.h>
-#include <GL/glu.h>
-#ifndef WIN32
-#	include <GL/glx.h>
-#endif
-#include "mb_glwdrawa.h"
-
-/* MBIO include files */
-#include "mb_status.h"
-#include "mb_define.h"
-
-/* Set flag to define mbview global variables in this code block */
-#define MBVIEWGLOBAL
-
-/* mbview include */
-#include "mbview.h"
-#include "mbviewprivate.h"
-
-/*------------------------------------------------------------------------------*/
-
-/* local variables */
-static Cardinal 	ac;
-static Arg      	args[256];
-static char		value_text[MB_PATH_MAXLINE];
-
-static char rcs_id[]="$Id: mbview_callbacks.c 2251 2015-07-01 01:02:06Z caress $";
-
-/* function prototypes */
-/*------------------------------------------------------------------------------*/
-
-/*------------------------------------------------------------------------------*/
-/* code used in original BX application, not used for library */
-
-#ifndef MBVIEW_LIBRARY
-
-#include "creation-c.h"
-
-/*
- * Macros to make code look nicer between ANSI and K&R.
- */
-#ifndef ARGLIST
-#if (NeedFunctionPrototypes == 0)
-#define PROTOTYPE(p)	()
-#define ARGLIST(p)	p
-#define ARG(a, b)	a b;
-#define GRA(a, b)	a b;
-#define UARG(a, b)      a b;
-#define GRAU(a, b)      a b;
-#else
-#define PROTOTYPE(p)	p
-#define ARGLIST(p)	(
-#define ARG(a, b)	a b,
-#define GRA(a, b)	a b)
-#ifdef __cplusplus
-#define UARG(a, b)      a,
-#define GRAU(a, b)      a)
-#else
-#define UARG(a, b)      a b,
-#define GRAU(a, b)      a b)
-#endif
-#endif
-#endif
-
-Widget		BxFindTopShell PROTOTYPE((Widget));
-WidgetList	BxWidgetIdsFromNames PROTOTYPE((Widget, char*, char*));
-
-
-/*      Function Name: 	BxManageCB
- *
- *      Description:   	Given a string of the form:
- *		       	"(WL)[widgetName, widgetName, ...]"
- *			BxManageCB attempts to convert the name to a Widget
- *			ID and manage the widget.
- *
- *      Arguments:     	Widget	    w:      the widget activating the callback.
- *		       	XtPointer   client: the list of widget names to attempt
- *					    to find and manage.
- *		       	XtPointer   call:   the call data (unused).
- *
- *      Notes:        *	This function expects that there is an application
- *		       	shell from which all other widgets are descended.
- */
-
-/* ARGSUSED */
-void
-BxManageCB ARGLIST((w, client, call))
-ARG( Widget, w)
-ARG( XtPointer, client)
-GRAU( XtPointer, call)
-{
-    WidgetList		widgets;
-    int			i;
-
-    /*
-     * This function returns a NULL terminated WidgetList.  The memory for
-     * the list needs to be freed when it is no longer needed.
-     */
-    widgets = BxWidgetIdsFromNames(w, "BxManageCB", (String)client);
-
-    i = 0;
-    while( widgets && widgets[i] != NULL )
-    {
-	XtManageChild(widgets[i]);
-	i++;
-    }
-    XtFree((char *)widgets);
-}
-
-/*      Function Name: 	BxUnmanageCB
- *
- *      Description:   	Given a string of the form:
- *		       	"(WL)[widgetName, widgetName, ...]"
- *			BxUnmanageCB attempts to convert the name to a Widget
- *			ID and unmanage the widget.
- *
- *      Arguments:     	Widget	    w:      the widget activating the callback.
- *		       	XtPointer   client: the list of widget names to attempt
- *					    to find and unmanage.
- *		       	XtPointer   call:   the call data (unused).
- *
- *      Notes:        *	This function expects that there is an application
- *		       	shell from which all other widgets are descended.
- */
-
-/* ARGSUSED */
-void
-BxUnmanageCB ARGLIST((w, client, call))
-ARG( Widget, w)
-ARG( XtPointer, client)
-GRAU( XtPointer, call)
-{
-    WidgetList		widgets;
-    int			i;
-
-    /*
-     * This function returns a NULL terminated WidgetList.  The memory for
-     * the list needs to be freed when it is no longer needed.
-     */
-    widgets = BxWidgetIdsFromNames(w, "BxUnmanageCB", (String)client);
-
-    i = 0;
-    while( widgets && widgets[i] != NULL )
-    {
-	XtUnmanageChild(widgets[i]);
-	i++;
-    }
-    XtFree((char *)widgets);
-}
-
-/*      Function Name:	BxExitCB
- *
- *      Description:   	This functions expects an integer to be passed in
- *		       	client data.  It calls the exit() system call with
- *			the integer value as the argument to the function.
- *
- *      Arguments:      Widget		w: 	the activating widget.
- *			XtPointer	client:	the integer exit value.
- *			XtPointer	call:	the call data (unused).
- */
-
-#ifdef VMS
-#include <stdlib.h>
-#endif
-
-/* ARGSUSED */
-void
-BxExitCB ARGLIST((w, client, call))
-UARG( Widget, w)
-ARG( XtPointer, client)
-GRAU( XtPointer, call)
-{
-    long	exitValue = EXIT_FAILURE;
-    exit(exitValue);
-}
-
-#endif
-/*------------------------------------------------------------------------------*/
-/* code below used for mbview library                                           */
-/*------------------------------------------------------------------------------*/
-
-/*------------------------------------------------------------------------------*/
-int mbview_startup(int verbose, Widget parent, XtAppContext app, int *error)
-{
-	/* local variables */
-	char	*function_name = "mbview_startup";
-	int	status = MB_SUCCESS;
-	XmString    tmp0;
-	Boolean  argok = False;
-	int	i;
-
-	/* set local verbosity */
-	mbv_verbose = verbose;
-
-	/* print starting debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:                 %d\n", verbose);
-		fprintf(stderr,"dbg2       parent:                  %p\n", parent);
-		fprintf(stderr,"dbg2       app:                     %p\n", app);
-		}
-
-	/* set parent widget and app context */
-	parent_widget = parent;
-	app_context = app;
-
-	/* set global work function parameters */
-	work_function_enabled = MB_YES;
-	work_function_set = MB_NO;
-	timer_timeout_time = 100;
-	timer_timeout_count = 10;
-	timer_count = 0;
-
-	/* set starting number of windows */
-	mbv_ninstance = 0;
-
-	/* initialize shared data */
-	mbview_reset_shared(MB_YES);
-
-	/* initialize windows */
-	for (i=0;i<MBV_MAX_WINDOWS;i++)
-		{
-		mbview_reset(i);
-		}
-
-	/* create and manage site list window */
-	shared.init_sitelist = MBV_WINDOW_NULL;
-	ac = 0;
-	XtSetArg(args[ac], XmNtitle, "Site List"); ac++;
-	shared.topLevelShell_sitelist = XtCreatePopupShell("topLevelShell",
-	    topLevelShellWidgetClass,
-	    parent_widget,
-	    args,
-	    ac);
-	shared.mainWindow_sitelist = XmCreateMainWindow(
-	    shared.topLevelShell_sitelist,
-	    "mainWindow_sitelist",
-            args,
-            ac);
-    	XtManageChild(shared.mainWindow_sitelist);
-	MB3DSiteListCreate(&(shared.mb3d_sitelist),
-            shared.mainWindow_sitelist,
-            "mbview_sitelist",
-            args,
-            ac);
-	ac = 0;
-        tmp0 = (XmString) BX_CONVERT(shared.mb3d_sitelist.MB3DSiteList,
-				(char *)"Site | Lon | Lat | Depth | Color | Size | Name",
-                		XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-	XtSetValues(shared.mb3d_sitelist.mbview_sitelist_label, args, ac);
-    	XtManageChild(shared.mb3d_sitelist.MB3DSiteList);
-
-	/* create and manage route list window */
-	shared.init_routelist = MBV_WINDOW_NULL;
-	ac = 0;
-	XtSetArg(args[ac], XmNtitle, "Route List"); ac++;
-	shared.topLevelShell_routelist = XtCreatePopupShell("topLevelShell",
-	    topLevelShellWidgetClass,
-	    parent_widget,
-	    args,
-	    ac);
-	shared.mainWindow_routelist = XmCreateMainWindow(
-	    shared.topLevelShell_routelist,
-	    "mainWindow_routelist",
-            args,
-            ac);
-    	XtManageChild(shared.mainWindow_routelist);
-	MB3DRouteListCreate(&(shared.mb3d_routelist),
-            shared.mainWindow_routelist,
-            "mbview_routelist",
-            args,
-            ac);
-	ac = 0;
-        tmp0 = (XmString) BX_CONVERT(shared.mb3d_routelist.MB3DRouteList,
-				(char *)"Route | Waypoint | Lon | Lat | Depth | Distance | DistanceOverTopo | Waypoint Type",
-                		XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-	XtSetValues(shared.mb3d_routelist.mbview_routelist_label, args, ac);
-    	XtManageChild(shared.mb3d_routelist.MB3DRouteList);
-
-	/* create and manage navigation list window */
-	shared.init_navlist = MBV_WINDOW_NULL;
-	ac = 0;
-	XtSetArg(args[ac], XmNtitle, "Navigation List"); ac++;
-	shared.topLevelShell_navlist = XtCreatePopupShell("topLevelShell",
-	    topLevelShellWidgetClass,
-	    parent_widget,
-	    args,
-	    ac);
-	shared.mainWindow_navlist = XmCreateMainWindow(
-	    shared.topLevelShell_navlist,
-	    "mainWindow_navlist",
-            args,
-            ac);
-    	XtManageChild(shared.mainWindow_navlist);
-	MB3DNavListCreate(&(shared.mb3d_navlist),
-            shared.mainWindow_navlist,
-            "mbview_navlist",
-            args,
-            ac);
-	ac = 0;
-        tmp0 = (XmString) BX_CONVERT(shared.mb3d_navlist.MB3DNavList,
-			(char *)"Route | Navpoints | Color | Size | Name",
-                	XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-	XtSetValues(shared.mb3d_navlist.mbview_navlist_label, args, ac);
-    	XtManageChild(shared.mb3d_navlist.MB3DNavList);
-
-	/* set timer function */
-	do_mbview_settimer();
-
-	/* print output debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:        %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:       %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-
-/*------------------------------------------------------------------------------*/
-int mbview_reset_shared(int mode)
-{
-	/* local variables */
-	char	*function_name = "mbview_reset_shared";
-	int	status = MB_SUCCESS;
-	size_t	instance;
-	int	i, j;
-
-	/* print starting debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2       mode:                    %d\n", mode);
-		}
-
-	if (mode == MB_YES)
-		{
-		shared.init_sitelist = MBV_WINDOW_NULL;
-		shared.topLevelShell_sitelist = NULL;
-		shared.mainWindow_sitelist = NULL;
-		shared.init_routelist = MBV_WINDOW_NULL;
-		shared.topLevelShell_routelist = NULL;
-		shared.mainWindow_routelist = NULL;
-		shared.init_navlist = MBV_WINDOW_NULL;
-		shared.topLevelShell_navlist = NULL;
-		shared.mainWindow_navlist = NULL;
-		}
-
-	/* global lon lat print style */
-	shared.lonlatstyle = MBV_LONLAT_MINUTES;
-
-	/* site data */
-	shared.shareddata.site_mode = MBV_SITE_OFF;
-	shared.shareddata.nsite = 0;
-	shared.shareddata.nsite_alloc = 0;
-	shared.shareddata.site_selected = MBV_SELECT_NONE;
-	shared.shareddata.sites = NULL;
-
-	/* route data */
-	shared.shareddata.route_mode = MBV_ROUTE_OFF;
-	shared.shareddata.nroute = 0;
-	shared.shareddata.nroute_alloc = 0;
-	shared.shareddata.route_selected = MBV_SELECT_NONE;
-	shared.shareddata.route_point_selected = MBV_SELECT_NONE;
-	shared.shareddata.routes = NULL;
-
-	/* nav data */
-	shared.shareddata.nav_mode = MBV_NAV_OFF;
-	shared.shareddata.nnav = 0;
-	shared.shareddata.nnav_alloc = 0;
-	shared.shareddata.nav_selected[0] = MBV_SELECT_NONE;
-	shared.shareddata.nav_point_selected[0] = MBV_SELECT_NONE;
-	shared.shareddata.nav_selected[1] = MBV_SELECT_NONE;
-	shared.shareddata.nav_point_selected[1] = MBV_SELECT_NONE;
-	shared.shareddata.navs = NULL;
-
-	for (instance=0;instance<MBV_MAX_WINDOWS;instance++)
-		{
-		/* nav pick data */
-		shared.shareddata.navpick_type = MBV_PICK_NONE;
-		for (i=0;i<2;i++)
-		    {
-		    shared.shareddata.navpick.endpoints[i].xgrid[instance] = 0.0;
-		    shared.shareddata.navpick.endpoints[i].ygrid[instance] = 0.0;
-		    shared.shareddata.navpick.endpoints[i].xlon = 0.0;
-		    shared.shareddata.navpick.endpoints[i].ylat = 0.0;
-		    shared.shareddata.navpick.endpoints[i].zdata = 0.0;
-		    shared.shareddata.navpick.endpoints[i].xdisplay[instance] = 0.0;
-		    shared.shareddata.navpick.endpoints[i].ydisplay[instance] = 0.0;
-		    shared.shareddata.navpick.endpoints[i].zdisplay[instance] = 0.0;
-		    shared.shareddata.navpick.segment.endpoints[i]
-		    		= shared.shareddata.navpick.endpoints[i];
-		    }
-		shared.shareddata.navpick.segment.nls = 0;
-		shared.shareddata.navpick.segment.nls_alloc = 0;
-		shared.shareddata.navpick.segment.lspoints = NULL;
-		for (i=0;i<8;i++)
-		    {
-		    shared.shareddata.navpick.xpoints[i].xgrid[instance] = 0.0;
-		    shared.shareddata.navpick.xpoints[i].ygrid[instance] = 0.0;
-		    shared.shareddata.navpick.xpoints[i].xlon = 0.0;
-		    shared.shareddata.navpick.xpoints[i].ylat = 0.0;
-		    shared.shareddata.navpick.xpoints[i].zdata = 0.0;
-		    shared.shareddata.navpick.xpoints[i].xdisplay[instance] = 0.0;
-		    shared.shareddata.navpick.xpoints[i].ydisplay[instance] = 0.0;
-		    shared.shareddata.navpick.xpoints[i].zdisplay[instance] = 0.0;
-		    }
-		}
-	for (j=0;j<4;j++)
-	    {
-	    shared.shareddata.navpick.xsegments[j].nls = 0;
-	    shared.shareddata.navpick.xsegments[j].nls_alloc = 0;
-	    shared.shareddata.navpick.xsegments[j].lspoints = NULL;
-	    for (i=0;i<2;i++)
-		{
-		shared.shareddata.navpick.xsegments[j].endpoints[i]
-		    	    = shared.shareddata.navpick.xpoints[2*j+i];
-		}
-	    }
-
-	/* vector data */
-	shared.shareddata.vector_mode = MBV_VECTOR_OFF;
-	shared.shareddata.nvector = 0;
-	shared.shareddata.vector_selected = MBV_SELECT_NONE;
-	shared.shareddata.vector_point_selected = MBV_SELECT_NONE;
-	shared.shareddata.vectors = NULL;
-
-	/* print output debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:       %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-
-/*------------------------------------------------------------------------------*/
-int mbview_reset(size_t instance)
-{
-	/* local variables */
-	char	*function_name = "mbview_reset";
-	int	status = MB_SUCCESS;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-	int	dummy_format;
-	int	dummy_pings;
-	double	dummy_bounds[4];
-	int	dummy_btime_i[7];
-	int	dummy_etime_i[7];
-	double	dummy_speedmin;
-	int	i, j, ii;
-
-	/* print starting debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       instance:                %zu\n", instance);
-		}
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* initialize windows */
-	if (instance != MBV_NO_WINDOW && instance < MBV_MAX_WINDOWS)
-		{
-		view->init = MBV_WINDOW_NULL;
-
-		/* initialize function pointers */
-		data->mbview_pickonepoint_notify = NULL;
-		data->mbview_picktwopoint_notify = NULL;
-		data->mbview_pickarea_notify = NULL;
-		data->mbview_pickregion_notify = NULL;
-		data->mbview_picksite_notify = NULL;
-		data->mbview_pickroute_notify = NULL;
-		data->mbview_picknav_notify = NULL;
-		data->mbview_sensitivity_notify = NULL;
-
-		/* initialize data structure */
-		data->active = MB_NO;
-
-		/* initialize mbview data */
-		strcpy(data->title, "MB3DView - MBgrdviz");
-		data->xo = 0;
-		data->yo = 0;
-		data->width = 560;
-		data->height = 500;
-		data->lorez_dimension = 100;
-		data->hirez_dimension = 500;
-		data->lorez_navdecimate = 5;
-		data->hirez_navdecimate = 1;
-
-		/* mode controls */
-		data->display_mode = MBV_DISPLAY_2D;
-		data->mouse_mode = MBV_MOUSE_MOVE;
-		data->grid_mode = MBV_GRID_VIEW_PRIMARY;
-		data->grid_contour_mode = MBV_VIEW_OFF;
-
-		data->primary_histogram = MB_NO;
-		data->primaryslope_histogram = MB_NO;
-		data->secondary_histogram = MB_NO;
-
-		data->primary_colortable = MBV_COLORTABLE_HAXBY;
-		data->primary_colortable_mode = MBV_COLORTABLE_NORMAL;
-		data->primary_colortable_min = 0.0;
-		data->primary_colortable_max = 0.0;
-		data->primary_shade_mode = MBV_SHADE_VIEW_NONE;
-		data->slope_colortable = MBV_COLORTABLE_HAXBY;
-		data->slope_colortable_mode = MBV_COLORTABLE_REVERSED;
-		data->slope_colortable_min = 0.0;
-		data->slope_colortable_max = 0.5;
-		data->slope_shade_mode = MBV_SHADE_VIEW_NONE;
-		data->secondary_colortable = MBV_COLORTABLE_HAXBY;
-		data->secondary_colortable_mode = MBV_COLORTABLE_NORMAL;
-		data->secondary_colortable_min = 0.0;
-		data->secondary_colortable_max = 0.0;
-		data->secondary_shade_mode = MBV_SHADE_VIEW_NONE;
-
-		data->exageration = 1.0;
-		data->modelelevation3d = 90.0;
-		data->modelazimuth3d = 0.0;
-		data->viewelevation3d = 90.0;
-		data->viewazimuth3d = 0.0;
-		data->viewbounds[0] = 0;
-		data->viewbounds[1] = 0;
-		data->viewbounds[2] = 0;
-		data->viewbounds[3] = 0;
-
-		/* shading controls */
-		data->illuminate_magnitude = 1.0;
-		data->illuminate_elevation = 5.0;
-		data->illuminate_azimuth = 90.0;
-		data->slope_magnitude = 1.0;
-		data->overlay_shade_magnitude = 1.0;
-		data->overlay_shade_center = 0.0;
-		data->overlay_shade_mode = MBV_COLORTABLE_NORMAL;
-
-		/* contour controls */
-		data->contour_interval = 100.0;
-
-		/* profile controls */
-		data->profile_exageration = 1.0;
-		data->profile_widthfactor = 1;
-		data->profile_slopethreshold = 2.00;
-
-		/* projection controls */
-		data->primary_grid_projection_mode = MBV_PROJECTION_GEOGRAPHIC;
-		strcpy(data->primary_grid_projection_id, "GEOGRAPHIC");
-		data->secondary_grid_projection_mode = MBV_PROJECTION_GEOGRAPHIC;
-		strcpy(data->secondary_grid_projection_id, "GEOGRAPHIC");
-		data->display_projection_mode = MBV_PROJECTION_GEOGRAPHIC;
-		strcpy(data->display_projection_id, "GEOGRAPHIC");
-
-		/* grid data */
-		data->primary_nodatavalue = MBV_DEFAULT_NODATA;
-		data->primary_nxy = 0;
-		data->primary_nx = 0;
-		data->primary_ny = 0;
-		data->primary_xmin = 0.0;
-		data->primary_xmax = 0.0;
-		data->primary_ymin = 0.0;
-		data->primary_ymax = 0.0;
-		data->primary_dx = 0.0;
-		data->primary_dy = 0.0;
-		data->primary_data = NULL;
-		data->primary_x = NULL;
-		data->primary_y = NULL;
-		data->primary_z = NULL;
-		data->primary_dzdx = NULL;
-		data->primary_dzdy = NULL;
-		data->primary_r = NULL;
-		data->primary_g = NULL;
-		data->primary_b = NULL;
-		data->primary_stat_color = NULL;
-		data->primary_stat_z = NULL;
-		data->secondary_sameas_primary = MB_NO;
-		data->secondary_nodatavalue = MBV_DEFAULT_NODATA;
-		data->secondary_nxy = 0;
-		data->secondary_nx = 0;
-		data->secondary_ny = 0;
-		data->secondary_xmin = 0.0;
-		data->secondary_xmax = 0.0;
-		data->secondary_ymin = 0.0;
-		data->secondary_ymax = 0.0;
-		data->secondary_dx = 0.0;
-		data->secondary_dy = 0.0;
-		data->secondary_data = NULL;
-
-		/* pick info flag */
-		data->pickinfo_mode = MBV_PICK_NONE;
-
-		/* point and line pick data */
-		data->pick_type = MBV_PICK_NONE;
-		for (i=0;i<2;i++)
-		    {
-		    data->pick.endpoints[i].xgrid = 0.0;
-		    data->pick.endpoints[i].ygrid = 0.0;
-		    data->pick.endpoints[i].xlon = 0.0;
-		    data->pick.endpoints[i].ylat = 0.0;
-		    data->pick.endpoints[i].zdata = 0.0;
-		    data->pick.endpoints[i].xdisplay = 0.0;
-		    data->pick.endpoints[i].ydisplay = 0.0;
-		    data->pick.endpoints[i].zdisplay = 0.0;
-		    data->pick.segment.endpoints[i]
-		    		= data->pick.endpoints[i];
-		    }
-		data->pick.segment.nls = 0;
-		data->pick.segment.nls_alloc = 0;
-		data->pick.segment.lspoints = NULL;
-		for (i=0;i<8;i++)
-		    {
-		    data->pick.xpoints[i].xgrid = 0.0;
-		    data->pick.xpoints[i].ygrid = 0.0;
-		    data->pick.xpoints[i].xlon = 0.0;
-		    data->pick.xpoints[i].ylat = 0.0;
-		    data->pick.xpoints[i].zdata = 0.0;
-		    data->pick.xpoints[i].xdisplay = 0.0;
-		    data->pick.xpoints[i].ydisplay = 0.0;
-		    data->pick.xpoints[i].zdisplay = 0.0;
-		    }
-		for (j=0;j<4;j++)
-		    {
-		    data->pick.xsegments[j].nls = 0;
-		    data->pick.xsegments[j].nls_alloc = 0;
-		    data->pick.xsegments[j].lspoints = NULL;
-		    for (i=0;i<2;i++)
-			{
-			data->pick.xsegments[j].endpoints[i]
-		    		    = data->pick.xpoints[2*j+i];
-			}
-		    }
-
-		/* region pick data */
-		data->region_type = MBV_REGION_NONE;
-	    	data->region.width = 0.0;
-	    	data->region.height = 0.0;
-		for (i=0;i<4;i++)
-		    {
-		    data->region.cornerpoints[i].xgrid = 0.0;
-		    data->region.cornerpoints[i].ygrid = 0.0;
-		    data->region.cornerpoints[i].xlon = 0.0;
-		    data->region.cornerpoints[i].ylat = 0.0;
-		    data->region.cornerpoints[i].zdata = 0.0;
-		    data->region.cornerpoints[i].xdisplay = 0.0;
-		    data->region.cornerpoints[i].ydisplay = 0.0;
-		    data->region.cornerpoints[i].zdisplay = 0.0;
-		    }
-		for (i=0;i<4;i++)
-		    {
-		    if (i == 0)
-		    	ii = 1;
-		    else if (i == 1)
-		    	ii = 3;
-		    else if (i == 2)
-		    	ii = 0;
-		    else if (i == 3)
-		    	ii = 2;
-		    data->region.segments[i].endpoints[0] = data->region.cornerpoints[i];
-		    data->region.segments[i].endpoints[1] = data->region.cornerpoints[ii];
-		    data->region.segments[i].nls = 0;
-		    data->region.segments[i].nls_alloc = 0;
-		    data->region.segments[i].lspoints = NULL;
-		    }
-
-		/* area pick data */
-		data->area_type = MBV_AREA_NONE;
-	    	data->area.width = 0.0;
-	    	data->area.length = 0.0;
-	    	data->area.bearing = 0.0;
-		for (i=0;i<2;i++)
-		    {
-		    data->area.endpoints[i].xgrid = 0.0;
-		    data->area.endpoints[i].ygrid = 0.0;
-		    data->area.endpoints[i].xlon = 0.0;
-		    data->area.endpoints[i].ylat = 0.0;
-		    data->area.endpoints[i].zdata = 0.0;
-		    data->area.endpoints[i].xdisplay = 0.0;
-		    data->area.endpoints[i].ydisplay = 0.0;
-		    data->area.endpoints[i].zdisplay = 0.0;
-	    	    data->area.segment.endpoints[i] = data->area.endpoints[i];
-		    }
-	    	data->area.segment.nls = 0;
-	    	data->area.segment.nls_alloc = 0;
-	    	data->area.segment.lspoints = NULL;
-		for (i=0;i<4;i++)
-		    {
-		    data->area.cornerpoints[i].xgrid = 0.0;
-		    data->area.cornerpoints[i].ygrid = 0.0;
-		    data->area.cornerpoints[i].xlon = 0.0;
-		    data->area.cornerpoints[i].ylat = 0.0;
-		    data->area.cornerpoints[i].zdata = 0.0;
-		    data->area.cornerpoints[i].xdisplay = 0.0;
-		    data->area.cornerpoints[i].ydisplay = 0.0;
-		    data->area.cornerpoints[i].zdisplay = 0.0;
-		    }
-		for (i=0;i<4;i++)
-		    {
-		    ii = i + 1;
-		    if (ii > 3) ii = 0;
-		    data->area.segments[i].endpoints[0] = data->area.cornerpoints[i];
-		    data->area.segments[i].endpoints[1] = data->area.cornerpoints[ii];
-		    data->area.segments[i].nls = 0;
-		    data->area.segments[i].nls_alloc = 0;
-		    data->area.segments[i].lspoints = NULL;
-		    }
-
-		/* site data */
-		data->site_view_mode = MBV_VIEW_OFF;
-
-		/* route data */
-		data->route_view_mode = MBV_VIEW_OFF;
-
-		/* nav data */
-		data->nav_view_mode = MBV_VIEW_OFF;
-		data->navdrape_view_mode = MBV_VIEW_OFF;
-
-		/* vector data */
-		data->vector_view_mode = MBV_VIEW_OFF;
-
-		/* profile data */
-		data->profile_view_mode = MBV_VIEW_OFF;
-
-		/* set mbview default values */
-		status = mb_mbview_defaults(mbv_verbose,
-					    &data->primary_colortable,
-					    &data->primary_colortable_mode,
-					    &data->primary_shade_mode,
-					    &data->slope_colortable,
-					    &data->slope_colortable_mode,
-					    &data->secondary_colortable,
-					    &data->secondary_colortable_mode,
-					    &data->illuminate_magnitude,
-					    &data->illuminate_elevation,
-					    &data->illuminate_azimuth,
-					    &data->slope_magnitude);
-
-		/* windows */
-		view->topLevelShell = NULL;
-		view->mainWindow = NULL;
-		view->glwmda = NULL;
-		view->prglwmda = NULL;
-		view->dpy = NULL;
-		view->glx_init = MB_NO;
-		view->prglx_init = MB_NO;
-		view->message_on = MB_NO;
-		view->plot_recursion = 0;
-		view->plot_done = MB_NO;
-		view->plot_interrupt_allowed = MB_YES;
-		view->naction = 0;
-		for (i=0;i<MBV_NUM_ACTIONS;i++)
-			{
-			view->actionsensitive[i] = 0;
-			view->pushButton_action[i] = NULL;
-			}
-
-    		/* drawing variables */
-		view->gl_width = 0;
-		view->gl_height = 0;
-		view->projected = MB_NO;
-		view->globalprojected = MB_NO;
-		view->lastdrawrez = MBV_REZ_NONE;
-		view->viewboundscount = MBV_BOUNDSFREQUENCY;
-		mbview_zscaleclear(instance);
-		mbview_setcolorparms(instance);
-		mbview_colorclear(instance);
-		view->contourlorez = MB_NO;
-		view->contourhirez = MB_NO;
-		view->contourfullrez = MB_NO;
-		view->primary_histogram_set = MB_NO;
-		view->primaryslope_histogram_set = MB_NO;
-		view->secondary_histogram_set = MB_NO;
-
-		/* grid display bounds */
-		view->xmin = 0.0;
-		view->xmax = 0.0;
-		view->ymin = 0.0;
-		view->ymax = 0.0;
-		view->xorigin = 0.0;
-		view->yorigin = 0.0;
-		view->zorigin = 0.0;
-		view->scale = 0.0;
-
-		view->offset2d_x = 0.0;
-		view->offset2d_y = 0.0;
-		view->offset2d_x_save = 0.0;
-		view->offset2d_y_save = 0.0;
-		view->size2d = 0.0;
-		view->size2d_save = 0.0;
-		view->offset3d_x = 0.0;
-		view->offset3d_y = 0.0;
-		view->offset3d_z = 0.0;
-		view->viewoffset3d_z = 0.0;
-		view->offset3d_x_save = 0.0;
-		view->offset3d_y_save = 0.0;
-		view->offset3d_z_save = 0.0;
-		view->viewoffset3d_z_save = 0.0;
-		view->areaaspect = 0.5;
-		view->areaaspect_save = 0.5;
-		view->exageration_save = 0.0;
-		view->modelelevation3d_save = 0.0;
-		view->modelazimuth3d_save = 0.0;
-		view->viewelevation3d_save = 0.0;
-		view->viewazimuth3d_save = 0.0;
-		view->illuminate_magnitude_save = 0.0;
-		view->illuminate_elevation_save = 0.0;
-		view->illuminate_azimuth_save = 0.0;
-		view->slope_magnitude_save = 0.0;
-		view->overlay_shade_magnitude_save = 0.0;
-
-		/* set mbio default values */
-		status = mb_defaults(mbv_verbose,&dummy_format,&dummy_pings,
-					&(view->lonflip),dummy_bounds,
-					dummy_btime_i,dummy_etime_i,
-					&dummy_speedmin,&(view->timegap));
-		}
-
-	/* print output debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:       %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-
-
-/*------------------------------------------------------------------------------*/
-int mbview_init(int verbose, size_t *instance, int *error)
-{
-	/* local variables */
-	char	*function_name = "mbview_init";
-	int	status = MB_SUCCESS;
-	struct mbview_world_struct *view;
-	size_t	i;
-
-	/* print starting debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:                   %d\n", verbose);
-		}
-
-	/* get next instance number */
-	*instance = MBV_NO_WINDOW;
-	for (i=0;i<MBV_MAX_WINDOWS;i++)
-	    {
-	    if (*instance == MBV_NO_WINDOW && mbviews[i].init != MBV_WINDOW_VISIBLE)
-		*instance = i;
-	    }
-	if (*instance == MBV_NO_WINDOW)
-	    {
-	    fprintf(stderr, "Unable to create mbview - all %d mbview windows already in use.\n",
-		MBV_MAX_WINDOWS);
-	    status = MB_FAILURE;
-	    return(status);
-	    }
-
-	/* get view */
-	view = &(mbviews[*instance]);
-
-	/* copy control structure */
-	view->mainWindow = parent_widget;
-	mbv_ninstance++;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       instance:                  %zu\n",*instance);
-		fprintf(stderr,"dbg2       error:                     %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:                    %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-
-/*------------------------------------------------------------------------------*/
-int mbview_getdataptr(int verbose, size_t instance, struct mbview_struct **datahandle, int *error)
-{
-	/* local variables */
-	char	*function_name = "mbview_getdataptr";
-	int	status = MB_SUCCESS;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-	int	i,  j;
-
-	/* print starting debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:                   %d\n", verbose);
-		fprintf(stderr,"dbg2       instance:                  %zu\n", instance);
-		}
-
-	/* get view */
-	view = &(mbviews[instance]);
-	*datahandle = &(view->data);
-	data = &(view->data);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       datahandle:                %p\n", *datahandle);
-
-		/* widget controls */
-		fprintf(stderr,"dbg2       title:                     %s\n", data->title);
-		fprintf(stderr,"dbg2       xo:                        %d\n", data->xo);
-		fprintf(stderr,"dbg2       yo:                        %d\n", data->yo);
-		fprintf(stderr,"dbg2       width:                     %d\n", data->width);
-		fprintf(stderr,"dbg2       height:                    %d\n", data->height);
-		fprintf(stderr,"dbg2       lorez_dimension:           %d\n", data->lorez_dimension);
-		fprintf(stderr,"dbg2       hirez_dimension:           %d\n", data->hirez_dimension);
-		fprintf(stderr,"dbg2       lorez_navdecimate:         %d\n", data->lorez_navdecimate);
-		fprintf(stderr,"dbg2       hirez_navdecimate:         %d\n", data->hirez_navdecimate);
-
-		/* mode controls */
-		fprintf(stderr,"dbg2       display_mode:              %d\n", data->display_mode);
-		fprintf(stderr,"dbg2       mouse_mode:                %d\n", data->mouse_mode);
-		fprintf(stderr,"dbg2       grid_mode:                 %d\n", data->grid_mode);
-		fprintf(stderr,"dbg2       grid_contour_mode:         %d\n", data->grid_contour_mode);
-
-		/* colortable controls */
-		fprintf(stderr,"dbg2       primary_colortable:        %d\n", data->primary_colortable);
-		fprintf(stderr,"dbg2       primary_colortable_mode:   %d\n", data->primary_colortable_mode);
-		fprintf(stderr,"dbg2       primary_colortable_min:    %f\n", data->primary_colortable_min);
-		fprintf(stderr,"dbg2       primary_colortable_max:    %f\n", data->primary_colortable_max);
-		fprintf(stderr,"dbg2       primary_shade_mode:        %d\n", data->primary_shade_mode);
-		fprintf(stderr,"dbg2       slope_colortable:          %d\n", data->slope_colortable);
-		fprintf(stderr,"dbg2       slope_colortable_mode:     %d\n", data->slope_colortable_mode);
-		fprintf(stderr,"dbg2       slope_colortable_min:      %f\n", data->slope_colortable_min);
-		fprintf(stderr,"dbg2       slope_colortable_max:      %f\n", data->slope_colortable_max);
-		fprintf(stderr,"dbg2       slope_shade_mode:          %d\n", data->slope_shade_mode);
-		fprintf(stderr,"dbg2       secondary_colortable:      %d\n", data->secondary_colortable);
-		fprintf(stderr,"dbg2       secondary_colortable_mode: %d\n", data->secondary_colortable_mode);
-		fprintf(stderr,"dbg2       secondary_colortable_min:  %f\n", data->secondary_colortable_min);
-		fprintf(stderr,"dbg2       secondary_colortable_max:  %f\n", data->secondary_colortable_max);
-		fprintf(stderr,"dbg2       secondary_shade_mode:      %d\n", data->secondary_shade_mode);
-
-		/* view controls */
-		fprintf(stderr,"dbg2       exageration:               %f\n", data->exageration);
-		fprintf(stderr,"dbg2       modelelevation3d:          %f\n", data->modelelevation3d);
-		fprintf(stderr,"dbg2       modelazimuth3d:            %f\n", data->modelazimuth3d);
-		fprintf(stderr,"dbg2       viewelevation3d:           %f\n", data->viewelevation3d);
-		fprintf(stderr,"dbg2       viewazimuth3d:             %f\n", data->viewazimuth3d);
-
-		/* shading controls */
-		fprintf(stderr,"dbg2       illuminate_magnitude:      %f\n", data->illuminate_magnitude);
-		fprintf(stderr,"dbg2       illuminate_elevation:      %f\n", data->illuminate_elevation);
-		fprintf(stderr,"dbg2       illuminate_azimuth:        %f\n", data->illuminate_azimuth);
-		fprintf(stderr,"dbg2       slope_magnitude:           %f\n", data->slope_magnitude);
-
-		/* contour controls */
-		fprintf(stderr,"dbg2       contour_interval:           %f\n", data->slope_magnitude);
-
-		/* profile controls */
-		fprintf(stderr,"dbg2       profile_exageration:        %f\n", data->profile_exageration);
-		fprintf(stderr,"dbg2       profile_widthfactor:        %d\n", data->profile_widthfactor);
-		fprintf(stderr,"dbg2       profile_slopethreshold:     %f\n", data->profile_slopethreshold);
-
-		/* projection controls */
-		fprintf(stderr,"dbg2       primary_grid_projection_mode:   %d\n", data->primary_grid_projection_mode);
-		fprintf(stderr,"dbg2       primary_grid_projection_id:     %s\n", data->primary_grid_projection_id);
-		fprintf(stderr,"dbg2       secondary_grid_projection_mode: %d\n", data->secondary_grid_projection_mode);
-		fprintf(stderr,"dbg2       secondary_grid_projection_id:   %s\n", data->secondary_grid_projection_id);
-		fprintf(stderr,"dbg2       display_projection_mode:        %d\n", data->display_projection_mode);
-		fprintf(stderr,"dbg2       display_projection_id:          %s\n", data->display_projection_id);
-
-		/* primary grid data */
-		fprintf(stderr,"dbg2       primary_nodatavalue:       %f\n", data->primary_nodatavalue);
-		fprintf(stderr,"dbg2       primary_nxy:               %d\n", data->primary_nxy);
-		fprintf(stderr,"dbg2       primary_nx:                %d\n", data->primary_nx);
-		fprintf(stderr,"dbg2       primary_ny:                %d\n", data->primary_ny);
-		fprintf(stderr,"dbg2       primary_min:               %f\n", data->primary_min);
-		fprintf(stderr,"dbg2       primary_max:               %f\n", data->primary_max);
-		fprintf(stderr,"dbg2       primary_xmin:              %f\n", data->primary_xmin);
-		fprintf(stderr,"dbg2       primary_xmax:              %f\n", data->primary_xmax);
-		fprintf(stderr,"dbg2       primary_ymin:              %f\n", data->primary_ymin);
-		fprintf(stderr,"dbg2       primary_ymax:              %f\n", data->primary_ymax);
-		fprintf(stderr,"dbg2       primary_dx:                %f\n", data->primary_dx);
-		fprintf(stderr,"dbg2       primary_dy:                %f\n", data->primary_dy);
-		fprintf(stderr,"dbg2       primary_data:              %p\n", data->primary_data);
-		fprintf(stderr,"dbg2       primary_x:                 %p\n", data->primary_x);
-		fprintf(stderr,"dbg2       primary_y:                 %p\n", data->primary_y);
-		fprintf(stderr,"dbg2       primary_z:                 %p\n", data->primary_z);
-		fprintf(stderr,"dbg2       primary_dxdz:              %p\n", data->primary_dzdx);
-		fprintf(stderr,"dbg2       primary_dydz:              %p\n", data->primary_dzdy);
-		fprintf(stderr,"dbg2       primary_r:                 %p\n", data->primary_r);
-		fprintf(stderr,"dbg2       primary_g:                 %p\n", data->primary_g);
-		fprintf(stderr,"dbg2       primary_b:                 %p\n", data->primary_b);
-		fprintf(stderr,"dbg2       primary_stat_color:        %p\n", data->primary_stat_color);
-		fprintf(stderr,"dbg2       primary_stat_z:            %p\n", data->primary_stat_z);
-
-		/* secondary grid data */
-		fprintf(stderr,"dbg2       secondary_sameas_primary:  %d\n", data->secondary_sameas_primary);
-		fprintf(stderr,"dbg2       secondary_nodatavalue:     %f\n", data->secondary_nodatavalue);
-		fprintf(stderr,"dbg2       secondary_nxy:             %d\n", data->secondary_nxy);
-		fprintf(stderr,"dbg2       secondary_nx:              %d\n", data->secondary_nx);
-		fprintf(stderr,"dbg2       secondary_ny:              %d\n", data->secondary_ny);
-		fprintf(stderr,"dbg2       secondary_xmin:            %f\n", data->secondary_xmin);
-		fprintf(stderr,"dbg2       secondary_xmax:            %f\n", data->secondary_xmax);
-		fprintf(stderr,"dbg2       secondary_ymin:            %f\n", data->secondary_ymin);
-		fprintf(stderr,"dbg2       secondary_ymax:            %f\n", data->secondary_ymax);
-		fprintf(stderr,"dbg2       secondary_dx:              %f\n", data->secondary_dx);
-		fprintf(stderr,"dbg2       secondary_dy:              %f\n", data->secondary_dy);
-		fprintf(stderr,"dbg2       secondary_data:            %p\n", data->secondary_data);
-
-		/* site data */
-		fprintf(stderr,"dbg2       site_view_mode:       %d\n",data->site_view_mode);
-		fprintf(stderr,"dbg2       site_mode:            %d\n",shared.shareddata.site_mode);
-		fprintf(stderr,"dbg2       nsite:                %d\n",shared.shareddata.nsite);
-		fprintf(stderr,"dbg2       nsite_alloc:          %d\n",shared.shareddata.nsite_alloc);
-		fprintf(stderr,"dbg2       site_selected:        %d\n",shared.shareddata.site_selected);
-		for (i=0;i<shared.shareddata.nsite;i++)
-			{
-			fprintf(stderr,"dbg2       site %d xgrid:       %f\n",i,shared.shareddata.sites[i].point.xgrid[0]);
-			fprintf(stderr,"dbg2       site %d ygrid:       %f\n",i,shared.shareddata.sites[i].point.ygrid[0]);
-			fprintf(stderr,"dbg2       site %d xlon:        %f\n",i,shared.shareddata.sites[i].point.xlon);
-			fprintf(stderr,"dbg2       site %d ylat:        %f\n",i,shared.shareddata.sites[i].point.ylat);
-			fprintf(stderr,"dbg2       site %d zdata:       %f\n",i,shared.shareddata.sites[i].point.zdata);
-			fprintf(stderr,"dbg2       site %d xdisplay:    %f\n",i,shared.shareddata.sites[i].point.xdisplay[0]);
-			fprintf(stderr,"dbg2       site %d ydisplay:    %f\n",i,shared.shareddata.sites[i].point.ydisplay[0]);
-			fprintf(stderr,"dbg2       site %d zdisplay:    %f\n",i,shared.shareddata.sites[i].point.zdisplay[0]);
-			fprintf(stderr,"dbg2       site %d color:       %d\n",i,shared.shareddata.sites[i].color);
-			fprintf(stderr,"dbg2       site %d size:        %d\n",i,shared.shareddata.sites[i].size);
-			fprintf(stderr,"dbg2       site %d name:        %s\n",i,shared.shareddata.sites[i].name);
-			}
-
-		/* route data */
-		fprintf(stderr,"dbg2       route_view_mode:      %d\n",data->route_view_mode);
-		fprintf(stderr,"dbg2       route_mode:           %d\n",shared.shareddata.route_mode);
-		fprintf(stderr,"dbg2       nroute:               %d\n",shared.shareddata.nroute);
-		fprintf(stderr,"dbg2       nroute_alloc:         %d\n",shared.shareddata.nroute_alloc);
-		fprintf(stderr,"dbg2       route_selected:       %d\n",shared.shareddata.route_selected);
-		fprintf(stderr,"dbg2       route_point_selected: %d\n",shared.shareddata.route_point_selected);
-		for (i=0;i<shared.shareddata.nroute;i++)
-			{
-			fprintf(stderr,"dbg2       route %d color:       %d\n",i,shared.shareddata.routes[i].color);
-			fprintf(stderr,"dbg2       route %d size:        %d\n",i,shared.shareddata.routes[i].size);
-			fprintf(stderr,"dbg2       route %d name:        %s\n",i,shared.shareddata.routes[i].name);
-			for (j=0;j<shared.shareddata.routes[i].npoints;j++)
-				{
-				fprintf(stderr,"dbg2       route %d %d xgrid:       %f\n",i,j,shared.shareddata.routes[i].points[j].xgrid[0]);
-				fprintf(stderr,"dbg2       route %d %d ygrid:       %f\n",i,j,shared.shareddata.routes[i].points[j].ygrid[0]);
-				fprintf(stderr,"dbg2       route %d %d xlon:        %f\n",i,j,shared.shareddata.routes[i].points[j].xlon);
-				fprintf(stderr,"dbg2       route %d %d ylat:        %f\n",i,j,shared.shareddata.routes[i].points[j].ylat);
-				fprintf(stderr,"dbg2       route %d %d zdata:       %f\n",i,j,shared.shareddata.routes[i].points[j].zdata);
-				fprintf(stderr,"dbg2       route %d %d xdisplay:    %f\n",i,j,shared.shareddata.routes[i].points[j].xdisplay[0]);
-				fprintf(stderr,"dbg2       route %d %d ydisplay:    %f\n",i,j,shared.shareddata.routes[i].points[j].ydisplay[0]);
-				fprintf(stderr,"dbg2       route %d %d zdisplay:    %f\n",i,j,shared.shareddata.routes[i].points[j].zdisplay[0]);
-				fprintf(stderr,"dbg2       route %d %d distlateral: %f\n",i,j,shared.shareddata.routes[i].distlateral[j]);
-				fprintf(stderr,"dbg2       route %d %d distlateral: %f\n",i,j,shared.shareddata.routes[i].disttopo[j]);
-				fprintf(stderr,"dbg2       route %d %d distlateral: %f\n",i,j,shared.shareddata.routes[i].distlateral[j]);
-				fprintf(stderr,"dbg2       route %d %d distlateral: %f\n",i,j,shared.shareddata.routes[i].disttopo[j]);
-				fprintf(stderr,"dbg2       route %d %d distlateral: %f\n",i,j,shared.shareddata.routes[i].distlateral[j]);				  }
-				fprintf(stderr,"dbg2       route %d %d distlateral: %f\n",i,j,shared.shareddata.routes[i].disttopo[j]);   			  }
-
-		/* nav data */
-		fprintf(stderr,"dbg2       nav_view_mode:             %d\n",data->nav_view_mode);
-		fprintf(stderr,"dbg2       navdrape_view_mode:        %d\n",data->navdrape_view_mode);
-		fprintf(stderr,"dbg2       nav_mode:                  %d\n",shared.shareddata.nav_mode);
-		fprintf(stderr,"dbg2       nnav:                      %d\n",shared.shareddata.nnav);
-		fprintf(stderr,"dbg2       nnav_alloc:                %d\n",shared.shareddata.nnav_alloc);
-		fprintf(stderr,"dbg2       nav_selected:              %p\n",shared.shareddata.nav_selected);
-		fprintf(stderr,"dbg2       nav_point_selected:        %p\n",shared.shareddata.nav_point_selected);
-		for (i=0;i<shared.shareddata.nnav;i++)
-			{
-			fprintf(stderr,"dbg2       nav %d color:         %d\n",i,shared.shareddata.navs[i].color);
-			fprintf(stderr,"dbg2       nav %d size:          %d\n",i,shared.shareddata.navs[i].size);
-			fprintf(stderr,"dbg2       nav %d name:          %s\n",i,shared.shareddata.navs[i].name);
-			fprintf(stderr,"dbg2       nav %d swathbounds:   %d\n",i,shared.shareddata.navs[i].swathbounds);
-			fprintf(stderr,"dbg2       nav %d shot:          %d\n",i,shared.shareddata.navs[i].shot);
-			fprintf(stderr,"dbg2       nav %d cdp:           %d\n",i,shared.shareddata.navs[i].cdp);
-			fprintf(stderr,"dbg2       nav %d npoints:       %d\n",i,shared.shareddata.navs[i].npoints);
-			fprintf(stderr,"dbg2       nav %d npoints_alloc: %d\n",i,shared.shareddata.navs[i].npoints_alloc);
-			fprintf(stderr,"dbg2       nav %d nselected:     %d\n",i,shared.shareddata.navs[i].nselected);
-			for (j=0;j<shared.shareddata.navs[i].npoints;j++)
-				{
-				fprintf(stderr,"dbg2       nav %d %d xgrid:    %f\n",i,j,shared.shareddata.navs[i].navpts[j].point.xgrid[0]);
-				fprintf(stderr,"dbg2       nav %d %d ygrid:    %f\n",i,j,shared.shareddata.navs[i].navpts[j].point.ygrid[0]);
-				fprintf(stderr,"dbg2       nav %d %d xlon:     %f\n",i,j,shared.shareddata.navs[i].navpts[j].point.xlon);
-				fprintf(stderr,"dbg2       nav %d %d ylat:     %f\n",i,j,shared.shareddata.navs[i].navpts[j].point.ylat);
-				fprintf(stderr,"dbg2       nav %d %d zdata:    %f\n",i,j,shared.shareddata.navs[i].navpts[j].point.zdata);
-				fprintf(stderr,"dbg2       nav %d %d xdisplay: %f\n",i,j,shared.shareddata.navs[i].navpts[j].point.xdisplay[0]);
-				fprintf(stderr,"dbg2       nav %d %d ydisplay: %f\n",i,j,shared.shareddata.navs[i].navpts[j].point.ydisplay[0]);
-				fprintf(stderr,"dbg2       nav %d %d zdisplay: %f\n",i,j,shared.shareddata.navs[i].navpts[j].point.zdisplay[0]);
-				fprintf(stderr,"dbg2       nav %d %d port xgrid:    %f\n",i,j,shared.shareddata.navs[i].navpts[j].pointport.xgrid[0]);
-				fprintf(stderr,"dbg2       nav %d %d port ygrid:    %f\n",i,j,shared.shareddata.navs[i].navpts[j].pointport.ygrid[0]);
-				fprintf(stderr,"dbg2       nav %d %d port xlon:     %f\n",i,j,shared.shareddata.navs[i].navpts[j].pointport.xlon);
-				fprintf(stderr,"dbg2       nav %d %d port ylat:     %f\n",i,j,shared.shareddata.navs[i].navpts[j].pointport.ylat);
-				fprintf(stderr,"dbg2       nav %d %d port zdata:    %f\n",i,j,shared.shareddata.navs[i].navpts[j].pointport.zdata);
-				fprintf(stderr,"dbg2       nav %d %d port xdisplay: %f\n",i,j,shared.shareddata.navs[i].navpts[j].pointport.xdisplay[0]);
-				fprintf(stderr,"dbg2       nav %d %d port ydisplay: %f\n",i,j,shared.shareddata.navs[i].navpts[j].pointport.ydisplay[0]);
-				fprintf(stderr,"dbg2       nav %d %d port zdisplay: %f\n",i,j,shared.shareddata.navs[i].navpts[j].pointport.zdisplay[0]);
-				fprintf(stderr,"dbg2       nav %d %d cntr xgrid:    %f\n",i,j,shared.shareddata.navs[i].navpts[j].pointcntr.xgrid[0]);
-				fprintf(stderr,"dbg2       nav %d %d cntr ygrid:    %f\n",i,j,shared.shareddata.navs[i].navpts[j].pointcntr.ygrid[0]);
-				fprintf(stderr,"dbg2       nav %d %d cntr xlon:     %f\n",i,j,shared.shareddata.navs[i].navpts[j].pointcntr.xlon);
-				fprintf(stderr,"dbg2       nav %d %d cntr ylat:     %f\n",i,j,shared.shareddata.navs[i].navpts[j].pointcntr.ylat);
-				fprintf(stderr,"dbg2       nav %d %d cntr zdata:    %f\n",i,j,shared.shareddata.navs[i].navpts[j].pointcntr.zdata);
-				fprintf(stderr,"dbg2       nav %d %d cntr xdisplay: %f\n",i,j,shared.shareddata.navs[i].navpts[j].pointcntr.xdisplay[0]);
-				fprintf(stderr,"dbg2       nav %d %d cntr ydisplay: %f\n",i,j,shared.shareddata.navs[i].navpts[j].pointcntr.ydisplay[0]);
-				fprintf(stderr,"dbg2       nav %d %d cntr zdisplay: %f\n",i,j,shared.shareddata.navs[i].navpts[j].pointcntr.zdisplay[0]);
-				fprintf(stderr,"dbg2       nav %d %d stbd xgrid:    %f\n",i,j,shared.shareddata.navs[i].navpts[j].pointstbd.xgrid[0]);
-				fprintf(stderr,"dbg2       nav %d %d stbd ygrid:    %f\n",i,j,shared.shareddata.navs[i].navpts[j].pointstbd.ygrid[0]);
-				fprintf(stderr,"dbg2       nav %d %d stbd xlon:     %f\n",i,j,shared.shareddata.navs[i].navpts[j].pointstbd.xlon);
-				fprintf(stderr,"dbg2       nav %d %d stbd ylat:     %f\n",i,j,shared.shareddata.navs[i].navpts[j].pointstbd.ylat);
-				fprintf(stderr,"dbg2       nav %d %d stbd zdata:    %f\n",i,j,shared.shareddata.navs[i].navpts[j].pointstbd.zdata);
-				fprintf(stderr,"dbg2       nav %d %d stbd xdisplay: %f\n",i,j,shared.shareddata.navs[i].navpts[j].pointstbd.xdisplay[0]);
-				fprintf(stderr,"dbg2       nav %d %d stbd ydisplay: %f\n",i,j,shared.shareddata.navs[i].navpts[j].pointstbd.ydisplay[0]);
-				fprintf(stderr,"dbg2       nav %d %d stbd zdisplay: %f\n",i,j,shared.shareddata.navs[i].navpts[j].pointstbd.zdisplay[0]);
-				}
-			}
-
-		/* vector data */
-		fprintf(stderr,"dbg2       vector_view_mode:          %d\n",data->vector_view_mode);
-		fprintf(stderr,"dbg2       vector_mode:               %d\n",shared.shareddata.vector_mode);
-		fprintf(stderr,"dbg2       nvector:                   %d\n",shared.shareddata.nvector);
-		fprintf(stderr,"dbg2       nvector_alloc:             %d\n",shared.shareddata.nvector_alloc);
-		fprintf(stderr,"dbg2       vector_selected:           %d\n",shared.shareddata.vector_selected);
-		fprintf(stderr,"dbg2       vector_point_selected:     %d\n",shared.shareddata.vector_point_selected);
-		for (i=0;i<shared.shareddata.nvector;i++)
-			{
-			fprintf(stderr,"dbg2       vector %d color:         %d\n",i,shared.shareddata.vectors[i].color);
-			fprintf(stderr,"dbg2       vector %d size:          %d\n",i,shared.shareddata.vectors[i].size);
-			fprintf(stderr,"dbg2       vector %d name:          %s\n",i,shared.shareddata.vectors[i].name);
-			fprintf(stderr,"dbg2       vector %d format:        %d\n",i,shared.shareddata.vectors[i].format);
-			fprintf(stderr,"dbg2       vector %d npoints:       %d\n",i,shared.shareddata.vectors[i].npoints);
-			fprintf(stderr,"dbg2       vector %d npoints_alloc: %d\n",i,shared.shareddata.vectors[i].npoints_alloc);
-			fprintf(stderr,"dbg2       vector %d nselected:     %d\n",i,shared.shareddata.vectors[i].nselected);
-			for (j=0;j<shared.shareddata.navs[i].npoints;j++)
-				{
-				fprintf(stderr,"dbg2       vector %d %d xgrid:    %f\n",i,j,shared.shareddata.vectors[i].vectorpts[j].point.xgrid[0]);
-				fprintf(stderr,"dbg2       vector %d %d ygrid:    %f\n",i,j,shared.shareddata.vectors[i].vectorpts[j].point.ygrid[0]);
-				fprintf(stderr,"dbg2       vector %d %d xlon:     %f\n",i,j,shared.shareddata.vectors[i].vectorpts[j].point.xlon);
-				fprintf(stderr,"dbg2       vector %d %d ylat:     %f\n",i,j,shared.shareddata.vectors[i].vectorpts[j].point.ylat);
-				fprintf(stderr,"dbg2       vector %d %d zdata:    %f\n",i,j,shared.shareddata.vectors[i].vectorpts[j].point.zdata);
-				fprintf(stderr,"dbg2       vector %d %d xdisplay: %f\n",i,j,shared.shareddata.vectors[i].vectorpts[j].point.xdisplay[0]);
-				fprintf(stderr,"dbg2       vector %d %d ydisplay: %f\n",i,j,shared.shareddata.vectors[i].vectorpts[j].point.ydisplay[0]);
-				fprintf(stderr,"dbg2       vector %d %d zdisplay: %f\n",i,j,shared.shareddata.vectors[i].vectorpts[j].point.zdisplay[0]);
-				}
-			}
-
-		/* profile data */
-		fprintf(stderr,"dbg2       profile_view_mode:         %d\n",data->profile_view_mode);
-		fprintf(stderr,"dbg2       source:                    %d\n",data->profile.source);
-		fprintf(stderr,"dbg2       source_name:               %s\n",data->profile.source_name);
-		fprintf(stderr,"dbg2       length:                    %f\n",data->profile.length);
-		fprintf(stderr,"dbg2       zmin:                      %f\n",data->profile.zmin);
-		fprintf(stderr,"dbg2       zmax:                      %f\n",data->profile.zmax);
-		fprintf(stderr,"dbg2       npoints:                   %d\n",data->profile.npoints);
-		fprintf(stderr,"dbg2       npoints_alloc:             %d\n",data->profile.npoints_alloc);
-		for (i=0;i<data->profile.npoints;i++)
-			{
-			fprintf(stderr,"dbg2       profile %d boundary: %d\n",i,data->profile.points[i].boundary);
-			fprintf(stderr,"dbg2       profile %d xgrid:    %f\n",i,data->profile.points[i].xgrid);
-			fprintf(stderr,"dbg2       profile %d ygrid:    %f\n",i,data->profile.points[i].ygrid);
-			fprintf(stderr,"dbg2       profile %d xlon:     %f\n",i,data->profile.points[i].xlon);
-			fprintf(stderr,"dbg2       profile %d ylat:     %f\n",i,data->profile.points[i].ylat);
-			fprintf(stderr,"dbg2       profile %d zdata:    %f\n",i,data->profile.points[i].zdata);
-			fprintf(stderr,"dbg2       profile %d distance: %f\n",i,data->profile.points[i].distance);
-			fprintf(stderr,"dbg2       profile %d xdisplay: %f\n",i,data->profile.points[i].xdisplay);
-			fprintf(stderr,"dbg2       profile %d ydisplay: %f\n",i,data->profile.points[i].ydisplay);
-			}
-
-		fprintf(stderr,"dbg2       error:                     %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:                    %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-
-/*------------------------------------------------------------------------------*/
-int mbview_getsharedptr(int verbose, struct mbview_shareddata_struct **sharedhandle, int *error)
-{
-	/* local variables */
-	char	*function_name = "mbview_getsharedptr";
-	int	status = MB_SUCCESS;
-	int	i,  j;
-
-	/* print starting debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:                   %d\n", verbose);
-		}
-
-	/* get shared ptr */
-	*sharedhandle = &(shared.shareddata);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       sharedhandle:              %p\n", *sharedhandle);
-
-		/* site data */
-		fprintf(stderr,"dbg2       site_mode:            %d\n",shared.shareddata.site_mode);
-		fprintf(stderr,"dbg2       nsite:                %d\n",shared.shareddata.nsite);
-		fprintf(stderr,"dbg2       nsite_alloc:          %d\n",shared.shareddata.nsite_alloc);
-		fprintf(stderr,"dbg2       site_selected:        %d\n",shared.shareddata.site_selected);
-		for (i=0;i<shared.shareddata.nsite;i++)
-			{
-			fprintf(stderr,"dbg2       site %d xgrid:       %f\n",i,shared.shareddata.sites[i].point.xgrid[0]);
-			fprintf(stderr,"dbg2       site %d ygrid:       %f\n",i,shared.shareddata.sites[i].point.ygrid[0]);
-			fprintf(stderr,"dbg2       site %d xlon:        %f\n",i,shared.shareddata.sites[i].point.xlon);
-			fprintf(stderr,"dbg2       site %d ylat:        %f\n",i,shared.shareddata.sites[i].point.ylat);
-			fprintf(stderr,"dbg2       site %d zdata:       %f\n",i,shared.shareddata.sites[i].point.zdata);
-			fprintf(stderr,"dbg2       site %d xdisplay:    %f\n",i,shared.shareddata.sites[i].point.xdisplay[0]);
-			fprintf(stderr,"dbg2       site %d ydisplay:    %f\n",i,shared.shareddata.sites[i].point.ydisplay[0]);
-			fprintf(stderr,"dbg2       site %d zdisplay:    %f\n",i,shared.shareddata.sites[i].point.zdisplay[0]);
-			fprintf(stderr,"dbg2       site %d color:       %d\n",i,shared.shareddata.sites[i].color);
-			fprintf(stderr,"dbg2       site %d size:        %d\n",i,shared.shareddata.sites[i].size);
-			fprintf(stderr,"dbg2       site %d name:        %s\n",i,shared.shareddata.sites[i].name);
-			}
-
-		/* route data */
-		fprintf(stderr,"dbg2       route_mode:           %d\n",shared.shareddata.route_mode);
-		fprintf(stderr,"dbg2       nroute:               %d\n",shared.shareddata.nroute);
-		fprintf(stderr,"dbg2       nroute_alloc:         %d\n",shared.shareddata.nroute_alloc);
-		fprintf(stderr,"dbg2       route_selected:       %d\n",shared.shareddata.route_selected);
-		fprintf(stderr,"dbg2       route_point_selected: %d\n",shared.shareddata.route_point_selected);
-		for (i=0;i<shared.shareddata.nroute;i++)
-			{
-			fprintf(stderr,"dbg2       route %d color:       %d\n",i,shared.shareddata.routes[i].color);
-			fprintf(stderr,"dbg2       route %d size:        %d\n",i,shared.shareddata.routes[i].size);
-			fprintf(stderr,"dbg2       route %d name:        %s\n",i,shared.shareddata.routes[i].name);
-			for (j=0;j<shared.shareddata.routes[i].npoints;j++)
-				{
-				fprintf(stderr,"dbg2       route %d %d xgrid:       %f\n",i,j,shared.shareddata.routes[i].points[j].xgrid[0]);
-				fprintf(stderr,"dbg2       route %d %d ygrid:       %f\n",i,j,shared.shareddata.routes[i].points[j].ygrid[0]);
-				fprintf(stderr,"dbg2       route %d %d xlon:        %f\n",i,j,shared.shareddata.routes[i].points[j].xlon);
-				fprintf(stderr,"dbg2       route %d %d ylat:        %f\n",i,j,shared.shareddata.routes[i].points[j].ylat);
-				fprintf(stderr,"dbg2       route %d %d zdata:       %f\n",i,j,shared.shareddata.routes[i].points[j].zdata);
-				fprintf(stderr,"dbg2       route %d %d xdisplay:    %f\n",i,j,shared.shareddata.routes[i].points[j].xdisplay[0]);
-				fprintf(stderr,"dbg2       route %d %d ydisplay:    %f\n",i,j,shared.shareddata.routes[i].points[j].ydisplay[0]);
-				fprintf(stderr,"dbg2       route %d %d zdisplay:    %f\n",i,j,shared.shareddata.routes[i].points[j].zdisplay[0]);
-				fprintf(stderr,"dbg2       route %d %d distlateral: %f\n",i,j,shared.shareddata.routes[i].distlateral[j]);
-				fprintf(stderr,"dbg2       route %d %d distlateral: %f\n",i,j,shared.shareddata.routes[i].disttopo[j]);
-				}
-			}
-
-		/* nav data */
-		fprintf(stderr,"dbg2       nav_mode:                  %d\n",shared.shareddata.nav_mode);
-		fprintf(stderr,"dbg2       nnav:                      %d\n",shared.shareddata.nnav);
-		fprintf(stderr,"dbg2       nnav_alloc:                %d\n",shared.shareddata.nnav_alloc);
-		fprintf(stderr,"dbg2       nav_selected:              %p\n",shared.shareddata.nav_selected);
-		fprintf(stderr,"dbg2       nav_point_selected:        %p\n",shared.shareddata.nav_point_selected);
-		for (i=0;i<shared.shareddata.nnav;i++)
-			{
-			fprintf(stderr,"dbg2       nav %d color:         %d\n",i,shared.shareddata.navs[i].color);
-			fprintf(stderr,"dbg2       nav %d size:          %d\n",i,shared.shareddata.navs[i].size);
-			fprintf(stderr,"dbg2       nav %d name:          %s\n",i,shared.shareddata.navs[i].name);
-			fprintf(stderr,"dbg2       nav %d swathbounds:   %d\n",i,shared.shareddata.navs[i].swathbounds);
-			fprintf(stderr,"dbg2       nav %d shot:          %d\n",i,shared.shareddata.navs[i].shot);
-			fprintf(stderr,"dbg2       nav %d cdp:           %d\n",i,shared.shareddata.navs[i].cdp);
-			fprintf(stderr,"dbg2       nav %d npoints:       %d\n",i,shared.shareddata.navs[i].npoints);
-			fprintf(stderr,"dbg2       nav %d npoints_alloc: %d\n",i,shared.shareddata.navs[i].npoints_alloc);
-			fprintf(stderr,"dbg2       nav %d nselected:     %d\n",i,shared.shareddata.navs[i].nselected);
-			for (j=0;j<shared.shareddata.navs[i].npoints;j++)
-				{
-				fprintf(stderr,"dbg2       nav %d %d draped:        %d\n",i,j,shared.shareddata.navs[i].navpts[j].draped);
-				fprintf(stderr,"dbg2       nav %d %d selected:      %d\n",i,j,shared.shareddata.navs[i].navpts[j].selected);
-				fprintf(stderr,"dbg2       nav %d %d time_d:        %f\n",i,j,shared.shareddata.navs[i].navpts[j].time_d);
-				fprintf(stderr,"dbg2       nav %d %d heading:       %f\n",i,j,shared.shareddata.navs[i].navpts[j].heading);
-				fprintf(stderr,"dbg2       nav %d %d speed:         %f\n",i,j,shared.shareddata.navs[i].navpts[j].speed);
-				fprintf(stderr,"dbg2       nav %d %d xgrid:         %f\n",i,j,shared.shareddata.navs[i].navpts[j].point.xgrid[0]);
-				fprintf(stderr,"dbg2       nav %d %d ygrid:         %f\n",i,j,shared.shareddata.navs[i].navpts[j].point.ygrid[0]);
-				fprintf(stderr,"dbg2       nav %d %d xlon:          %f\n",i,j,shared.shareddata.navs[i].navpts[j].point.xlon);
-				fprintf(stderr,"dbg2       nav %d %d ylat:          %f\n",i,j,shared.shareddata.navs[i].navpts[j].point.ylat);
-				fprintf(stderr,"dbg2       nav %d %d zdata:         %f\n",i,j,shared.shareddata.navs[i].navpts[j].point.zdata);
-				fprintf(stderr,"dbg2       nav %d %d xdisplay:      %f\n",i,j,shared.shareddata.navs[i].navpts[j].point.xdisplay[0]);
-				fprintf(stderr,"dbg2       nav %d %d ydisplay:      %f\n",i,j,shared.shareddata.navs[i].navpts[j].point.ydisplay[0]);
-				fprintf(stderr,"dbg2       nav %d %d zdisplay:      %f\n",i,j,shared.shareddata.navs[i].navpts[j].point.zdisplay[0]);
-				fprintf(stderr,"dbg2       nav %d %d port xgrid:    %f\n",i,j,shared.shareddata.navs[i].navpts[j].pointport.xgrid[0]);
-				fprintf(stderr,"dbg2       nav %d %d port ygrid:    %f\n",i,j,shared.shareddata.navs[i].navpts[j].pointport.ygrid[0]);
-				fprintf(stderr,"dbg2       nav %d %d port xlon:     %f\n",i,j,shared.shareddata.navs[i].navpts[j].pointport.xlon);
-				fprintf(stderr,"dbg2       nav %d %d port ylat:     %f\n",i,j,shared.shareddata.navs[i].navpts[j].pointport.ylat);
-				fprintf(stderr,"dbg2       nav %d %d port zdata:    %f\n",i,j,shared.shareddata.navs[i].navpts[j].pointport.zdata);
-				fprintf(stderr,"dbg2       nav %d %d port xdisplay: %f\n",i,j,shared.shareddata.navs[i].navpts[j].pointport.xdisplay[0]);
-				fprintf(stderr,"dbg2       nav %d %d port ydisplay: %f\n",i,j,shared.shareddata.navs[i].navpts[j].pointport.ydisplay[0]);
-				fprintf(stderr,"dbg2       nav %d %d port zdisplay: %f\n",i,j,shared.shareddata.navs[i].navpts[j].pointport.zdisplay[0]);
-				fprintf(stderr,"dbg2       nav %d %d cntr xgrid:    %f\n",i,j,shared.shareddata.navs[i].navpts[j].pointcntr.xgrid[0]);
-				fprintf(stderr,"dbg2       nav %d %d cntr ygrid:    %f\n",i,j,shared.shareddata.navs[i].navpts[j].pointcntr.ygrid[0]);
-				fprintf(stderr,"dbg2       nav %d %d cntr xlon:     %f\n",i,j,shared.shareddata.navs[i].navpts[j].pointcntr.xlon);
-				fprintf(stderr,"dbg2       nav %d %d cntr ylat:     %f\n",i,j,shared.shareddata.navs[i].navpts[j].pointcntr.ylat);
-				fprintf(stderr,"dbg2       nav %d %d cntr zdata:    %f\n",i,j,shared.shareddata.navs[i].navpts[j].pointcntr.zdata);
-				fprintf(stderr,"dbg2       nav %d %d cntr xdisplay: %f\n",i,j,shared.shareddata.navs[i].navpts[j].pointcntr.xdisplay[0]);
-				fprintf(stderr,"dbg2       nav %d %d cntr ydisplay: %f\n",i,j,shared.shareddata.navs[i].navpts[j].pointcntr.ydisplay[0]);
-				fprintf(stderr,"dbg2       nav %d %d cntr zdisplay: %f\n",i,j,shared.shareddata.navs[i].navpts[j].pointcntr.zdisplay[0]);
-				fprintf(stderr,"dbg2       nav %d %d stbd xgrid:    %f\n",i,j,shared.shareddata.navs[i].navpts[j].pointstbd.xgrid[0]);
-				fprintf(stderr,"dbg2       nav %d %d stbd ygrid:    %f\n",i,j,shared.shareddata.navs[i].navpts[j].pointstbd.ygrid[0]);
-				fprintf(stderr,"dbg2       nav %d %d stbd xlon:     %f\n",i,j,shared.shareddata.navs[i].navpts[j].pointstbd.xlon);
-				fprintf(stderr,"dbg2       nav %d %d stbd ylat:     %f\n",i,j,shared.shareddata.navs[i].navpts[j].pointstbd.ylat);
-				fprintf(stderr,"dbg2       nav %d %d stbd zdata:    %f\n",i,j,shared.shareddata.navs[i].navpts[j].pointstbd.zdata);
-				fprintf(stderr,"dbg2       nav %d %d stbd xdisplay: %f\n",i,j,shared.shareddata.navs[i].navpts[j].pointstbd.xdisplay[0]);
-				fprintf(stderr,"dbg2       nav %d %d stbd ydisplay: %f\n",i,j,shared.shareddata.navs[i].navpts[j].pointstbd.ydisplay[0]);
-				fprintf(stderr,"dbg2       nav %d %d stbd zdisplay: %f\n",i,j,shared.shareddata.navs[i].navpts[j].pointstbd.zdisplay[0]);
-				}
-			}
-
-		/* vector data */
-		fprintf(stderr,"dbg2       vector_mode:               %d\n",shared.shareddata.vector_mode);
-		fprintf(stderr,"dbg2       nvector:                   %d\n",shared.shareddata.nvector);
-		fprintf(stderr,"dbg2       nvector_alloc:             %d\n",shared.shareddata.nvector_alloc);
-		fprintf(stderr,"dbg2       vector_selected:           %d\n",shared.shareddata.vector_selected);
-		fprintf(stderr,"dbg2       vector_point_selected:     %d\n",shared.shareddata.vector_point_selected);
-		for (i=0;i<shared.shareddata.nvector;i++)
-			{
-			fprintf(stderr,"dbg2       vector %d color:         %d\n",i,shared.shareddata.vectors[i].color);
-			fprintf(stderr,"dbg2       vector %d size:          %d\n",i,shared.shareddata.vectors[i].size);
-			fprintf(stderr,"dbg2       vector %d name:          %s\n",i,shared.shareddata.vectors[i].name);
-			fprintf(stderr,"dbg2       vector %d format:        %d\n",i,shared.shareddata.vectors[i].format);
-			fprintf(stderr,"dbg2       vector %d npoints:       %d\n",i,shared.shareddata.vectors[i].npoints);
-			fprintf(stderr,"dbg2       vector %d npoints_alloc: %d\n",i,shared.shareddata.vectors[i].npoints_alloc);
-			fprintf(stderr,"dbg2       vector %d nselected:     %d\n",i,shared.shareddata.vectors[i].nselected);
-			for (j=0;j<shared.shareddata.navs[i].npoints;j++)
-				{
-				fprintf(stderr,"dbg2       vector %d %d xgrid:    %f\n",i,j,shared.shareddata.vectors[i].vectorpts[j].point.xgrid[0]);
-				fprintf(stderr,"dbg2       vector %d %d ygrid:    %f\n",i,j,shared.shareddata.vectors[i].vectorpts[j].point.ygrid[0]);
-				fprintf(stderr,"dbg2       vector %d %d xlon:     %f\n",i,j,shared.shareddata.vectors[i].vectorpts[j].point.xlon);
-				fprintf(stderr,"dbg2       vector %d %d ylat:     %f\n",i,j,shared.shareddata.vectors[i].vectorpts[j].point.ylat);
-				fprintf(stderr,"dbg2       vector %d %d zdata:    %f\n",i,j,shared.shareddata.vectors[i].vectorpts[j].point.zdata);
-				fprintf(stderr,"dbg2       vector %d %d xdisplay: %f\n",i,j,shared.shareddata.vectors[i].vectorpts[j].point.xdisplay[0]);
-				fprintf(stderr,"dbg2       vector %d %d ydisplay: %f\n",i,j,shared.shareddata.vectors[i].vectorpts[j].point.ydisplay[0]);
-				fprintf(stderr,"dbg2       vector %d %d zdisplay: %f\n",i,j,shared.shareddata.vectors[i].vectorpts[j].point.zdisplay[0]);
-				}
-			}
-
-		fprintf(stderr,"dbg2       error:                     %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:                    %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-
-/*------------------------------------------------------------------------------*/
-int mbview_setwindowparms(int verbose, size_t instance,
-			int	(*mbview_dismiss_notify)(size_t),
-			char	*title,
-			int	xo,
-			int	yo,
-			int	width,
-			int	height,
-			int	lorez_dimension,
-			int	hirez_dimension,
-			int	lorez_navdecimate,
-			int	hirez_navdecimate,
-			int	*error)
-
-{
-	/* local variables */
-	char	*function_name = "mbview_setwindowparms";
-	int	status = MB_SUCCESS;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-
-	/* print starting debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:                   %d\n", verbose);
-		fprintf(stderr,"dbg2       instance:                  %zu\n", instance);
-		fprintf(stderr,"dbg2       mbview_dismiss_notify:     %p\n", mbview_dismiss_notify);
-		fprintf(stderr,"dbg2       title:                     %s\n", title);
-		fprintf(stderr,"dbg2       xo:                        %d\n", xo);
-		fprintf(stderr,"dbg2       yo:                        %d\n", yo);
-		fprintf(stderr,"dbg2       width:                     %d\n", width);
-		fprintf(stderr,"dbg2       height:                    %d\n", height);
-		fprintf(stderr,"dbg2       lorez_dimension:           %d\n", lorez_dimension);
-		fprintf(stderr,"dbg2       hirez_dimension:           %d\n", hirez_dimension);
-		fprintf(stderr,"dbg2       lorez_navdecimate:         %d\n", lorez_navdecimate);
-		fprintf(stderr,"dbg2       hirez_navdecimate:         %d\n", hirez_navdecimate);
-		}
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* set values */
-	data->mbview_dismiss_notify = mbview_dismiss_notify;
-	strcpy(data->title, title);
-	data->xo = xo;
-	data->yo = yo;
-	data->width = width;
-	data->height = height;
-	data->lorez_dimension = lorez_dimension;
-	data->hirez_dimension = hirez_dimension;
-	data->lorez_navdecimate = lorez_navdecimate;
-	data->hirez_navdecimate = hirez_navdecimate;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:                     %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:                    %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-
-/*------------------------------------------------------------------------------*/
-int mbview_setviewcontrols(int verbose, size_t instance,
-			int	display_mode,
-			int	mouse_mode,
-			int	grid_mode,
-			int	primary_histogram,
-			int	primaryslope_histogram,
-			int	secondary_histogram,
-			int	primary_shade_mode,
-			int	slope_shade_mode,
-			int	secondary_shade_mode,
-			int	grid_contour_mode,
-			int	site_view_mode,
-			int	route_view_mode,
-			int	nav_view_mode,
-			int	navdrape_view_mode,
-			int	vector_view_mode,
-			double	exageration,
-			double	modelelevation3d,
-			double	modelazimuth3d,
-			double	viewelevation3d,
-			double	viewazimuth3d,
-			double	illuminate_magnitude,
-			double	illuminate_elevation,
-			double	illuminate_azimuth,
-			double	slope_magnitude,
-			double	overlay_shade_magnitude,
-			double	overlay_shade_center,
-			int	overlay_shade_mode,
-			double	contour_interval,
-			int	display_projection_mode,
-			char	*display_projection_id,
-			int *error)
-
-{
-	/* local variables */
-	char	*function_name = "mbview_setviewcontrols";
-	int	status = MB_SUCCESS;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-
-	/* print starting debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:                   %d\n", verbose);
-		fprintf(stderr,"dbg2       instance:                  %zu\n", instance);
-		fprintf(stderr,"dbg2       display_mode:              %d\n", display_mode);
-		fprintf(stderr,"dbg2       mouse_mode:                %d\n", mouse_mode);
-		fprintf(stderr,"dbg2       grid_mode:                 %d\n", grid_mode);
-		fprintf(stderr,"dbg2       primary_histogram:         %d\n", primary_histogram);
-		fprintf(stderr,"dbg2       primaryslope_histogram:    %d\n", primaryslope_histogram);
-		fprintf(stderr,"dbg2       secondary_histogram:       %d\n", secondary_histogram);
-		fprintf(stderr,"dbg2       primary_shade_mode:        %d\n", primary_shade_mode);
-		fprintf(stderr,"dbg2       slope_shade_mode:          %d\n", slope_shade_mode);
-		fprintf(stderr,"dbg2       secondary_shade_mode:      %d\n", secondary_shade_mode);
-		fprintf(stderr,"dbg2       grid_contour_mode:         %d\n", grid_contour_mode);
-		fprintf(stderr,"dbg2       site_view_mode:            %d\n", site_view_mode);
-		fprintf(stderr,"dbg2       route_view_mode:           %d\n", route_view_mode);
-		fprintf(stderr,"dbg2       nav_view_mode:             %d\n", nav_view_mode);
-		fprintf(stderr,"dbg2       navdrape_view_mode:        %d\n", navdrape_view_mode);
-		fprintf(stderr,"dbg2       vector_view_mode:          %d\n", vector_view_mode);
-		fprintf(stderr,"dbg2       exageration:               %f\n", exageration);
-		fprintf(stderr,"dbg2       modelelevation3d:          %f\n", modelelevation3d);
-		fprintf(stderr,"dbg2       modelazimuth3d:            %f\n", modelazimuth3d);
-		fprintf(stderr,"dbg2       viewelevation3d:           %f\n", viewelevation3d);
-		fprintf(stderr,"dbg2       viewazimuth3d:             %f\n", viewazimuth3d);
-		fprintf(stderr,"dbg2       illuminate_magnitude:      %f\n", illuminate_magnitude);
-		fprintf(stderr,"dbg2       illuminate_elevation:      %f\n", illuminate_elevation);
-		fprintf(stderr,"dbg2       illuminate_azimuth:        %f\n", illuminate_azimuth);
-		fprintf(stderr,"dbg2       slope_magnitude:           %f\n", slope_magnitude);
-		fprintf(stderr,"dbg2       overlay_shade_magnitude:   %f\n", overlay_shade_magnitude);
-		fprintf(stderr,"dbg2       overlay_shade_center:      %f\n", overlay_shade_center);
-		fprintf(stderr,"dbg2       overlay_shade_mode:        %d\n", overlay_shade_mode);
-		fprintf(stderr,"dbg2       contour_interval:          %f\n", slope_magnitude);
-		fprintf(stderr,"dbg2       display_projection_mode:   %d\n", display_projection_mode);
-		fprintf(stderr,"dbg2       display_projection_id:     %s\n", display_projection_id);
-		}
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* set values */
-        data->display_mode = display_mode;
-        data->mouse_mode = mouse_mode;
-        data->grid_mode = grid_mode;
-        data->primary_histogram = primary_histogram;
-        data->primaryslope_histogram = primaryslope_histogram;
-        data->secondary_histogram = secondary_histogram;
-        data->primary_shade_mode = primary_shade_mode;
-        data->slope_shade_mode = slope_shade_mode;
-        data->secondary_shade_mode = secondary_shade_mode;
-        data->grid_contour_mode = grid_contour_mode;
-        data->site_view_mode = site_view_mode;
-        data->route_view_mode = route_view_mode;
-        data->nav_view_mode = nav_view_mode;
-        data->navdrape_view_mode = navdrape_view_mode;
-        data->vector_view_mode = vector_view_mode;
-        data->exageration = exageration;
-        data->modelelevation3d = modelelevation3d;
-        data->modelazimuth3d = modelazimuth3d;
-        data->viewelevation3d = viewelevation3d;
-        data->viewazimuth3d = viewazimuth3d;
-        data->illuminate_magnitude = illuminate_magnitude;
-        data->illuminate_elevation = illuminate_elevation;
-        data->illuminate_azimuth = illuminate_azimuth;
-        data->slope_magnitude = slope_magnitude;
-        data->overlay_shade_magnitude = overlay_shade_magnitude;
-        data->overlay_shade_center = overlay_shade_center;
-        data->overlay_shade_mode = overlay_shade_mode;
-        data->contour_interval = contour_interval;
-        data->display_projection_mode = display_projection_mode;
-        strcpy(data->display_projection_id, display_projection_id);
-
-	/* set widgets */
-	if (data->active == MB_YES)
-		mbview_set_widgets(verbose, instance, error);
-
-	/* set widget sensitivity */
-	if (data->active == MB_YES)
-		mbview_update_sensitivity(verbose, instance, error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:                     %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:                    %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-
-
-/*------------------------------------------------------------------------------*/
-int mbview_open(int verbose, size_t instance, int *error)
-{
-	/* local variables */
-	char	*function_name = "mbview_open";
-	int	status = MB_SUCCESS;
-	XColor	XColorBlack;
-	XColor	XColorWhite;
-	XColor	XColorRed;
-	XColor	XColorGreen;
-	XColor	XColorBlue;
-	XColor	XColorCoral;
-	XColor	exact;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-	int	i,  j;
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* print starting debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:                   %d\n", verbose);
-		fprintf(stderr,"dbg2       instance:                  %zu\n", instance);
-		fprintf(stderr,"dbg2       view:                      %p\n", view);
-		fprintf(stderr,"dbg2       data:                      %p\n", data);
-
-		/* widget controls */
-		fprintf(stderr,"dbg2       title:                     %s\n", data->title);
-		fprintf(stderr,"dbg2       xo:                        %d\n", data->xo);
-		fprintf(stderr,"dbg2       yo:                        %d\n", data->yo);
-		fprintf(stderr,"dbg2       width:                     %d\n", data->width);
-		fprintf(stderr,"dbg2       height:                    %d\n", data->height);
-		fprintf(stderr,"dbg2       lorez_dimension:           %d\n", data->lorez_dimension);
-		fprintf(stderr,"dbg2       hirez_dimension:           %d\n", data->hirez_dimension);
-		fprintf(stderr,"dbg2       lorez_navdecimate:         %d\n", data->lorez_navdecimate);
-		fprintf(stderr,"dbg2       hirez_navdecimate:         %d\n", data->hirez_navdecimate);
-
-		/* mode controls */
-		fprintf(stderr,"dbg2       display_mode:              %d\n", data->display_mode);
-		fprintf(stderr,"dbg2       mouse_mode:                %d\n", data->mouse_mode);
-		fprintf(stderr,"dbg2       grid_mode:                 %d\n", data->grid_mode);
-		fprintf(stderr,"dbg2       grid_contour_mode:         %d\n", data->grid_contour_mode);
-
-		/* colortable controls */
-		fprintf(stderr,"dbg2       primary_colortable:        %d\n", data->primary_colortable);
-		fprintf(stderr,"dbg2       primary_colortable_mode:   %d\n", data->primary_colortable_mode);
-		fprintf(stderr,"dbg2       primary_colortable_min:    %f\n", data->primary_colortable_min);
-		fprintf(stderr,"dbg2       primary_colortable_max:    %f\n", data->primary_colortable_max);
-		fprintf(stderr,"dbg2       slope_colortable:          %d\n", data->slope_colortable);
-		fprintf(stderr,"dbg2       slope_colortable_mode:     %d\n", data->slope_colortable_mode);
-		fprintf(stderr,"dbg2       slope_colortable_min:      %f\n", data->slope_colortable_min);
-		fprintf(stderr,"dbg2       slope_colortable_max:      %f\n", data->slope_colortable_max);
-		fprintf(stderr,"dbg2       slope_shade_mode:          %d\n", data->slope_shade_mode);
-		fprintf(stderr,"dbg2       secondary_colortable:      %d\n", data->secondary_colortable);
-		fprintf(stderr,"dbg2       secondary_colortable_mode: %d\n", data->secondary_colortable_mode);
-		fprintf(stderr,"dbg2       secondary_colortable_min:  %f\n", data->secondary_colortable_min);
-		fprintf(stderr,"dbg2       secondary_colortable_max:  %f\n", data->secondary_colortable_max);
-		fprintf(stderr,"dbg2       secondary_shade_mode:      %d\n", data->secondary_shade_mode);
-
-		/* view controls */
-		fprintf(stderr,"dbg2       exageration:               %f\n", data->exageration);
-		fprintf(stderr,"dbg2       modelelevation3d:          %f\n", data->modelelevation3d);
-		fprintf(stderr,"dbg2       modelazimuth3d:            %f\n", data->modelazimuth3d);
-		fprintf(stderr,"dbg2       viewelevation3d:           %f\n", data->viewelevation3d);
-		fprintf(stderr,"dbg2       viewazimuth3d:             %f\n", data->viewazimuth3d);
-
-		/* shading controls */
-		fprintf(stderr,"dbg2       illuminate_magnitude:      %f\n", data->illuminate_magnitude);
-		fprintf(stderr,"dbg2       illuminate_elevation:      %f\n", data->illuminate_elevation);
-		fprintf(stderr,"dbg2       illuminate_azimuth:        %f\n", data->illuminate_azimuth);
-		fprintf(stderr,"dbg2       slope_magnitude:           %f\n", data->slope_magnitude);
-
-		/* contour controls */
-		fprintf(stderr,"dbg2       contour_interval:           %f\n", data->slope_magnitude);
-
-		/* profile controls */
-		fprintf(stderr,"dbg2       profile_exageration:        %f\n", data->profile_exageration);
-		fprintf(stderr,"dbg2       profile_widthfactor:        %d\n", data->profile_widthfactor);
-		fprintf(stderr,"dbg2       profile_slopethreshold:     %f\n", data->profile_slopethreshold);
-
-		/* projection controls */
-		fprintf(stderr,"dbg2       primary_grid_projection_mode:   %d\n", data->primary_grid_projection_mode);
-		fprintf(stderr,"dbg2       primary_grid_projection_id:     %s\n", data->primary_grid_projection_id);
-		fprintf(stderr,"dbg2       secondary_grid_projection_mode: %d\n", data->secondary_grid_projection_mode);
-		fprintf(stderr,"dbg2       secondary_grid_projection_id:   %s\n", data->secondary_grid_projection_id);
-		fprintf(stderr,"dbg2       display_projection_mode:        %d\n", data->display_projection_mode);
-		fprintf(stderr,"dbg2       display_projection_id:          %s\n", data->display_projection_id);
-
-		/* primary grid data */
-		fprintf(stderr,"dbg2       primary_nodatavalue:       %f\n", data->primary_nodatavalue);
-		fprintf(stderr,"dbg2       primary_nxy:               %d\n", data->primary_nxy);
-		fprintf(stderr,"dbg2       primary_nx:                %d\n", data->primary_nx);
-		fprintf(stderr,"dbg2       primary_ny:                %d\n", data->primary_ny);
-		fprintf(stderr,"dbg2       primary_min:               %f\n", data->primary_min);
-		fprintf(stderr,"dbg2       primary_max:               %f\n", data->primary_max);
-		fprintf(stderr,"dbg2       primary_xmin:              %f\n", data->primary_xmin);
-		fprintf(stderr,"dbg2       primary_xmax:              %f\n", data->primary_xmax);
-		fprintf(stderr,"dbg2       primary_ymin:              %f\n", data->primary_ymin);
-		fprintf(stderr,"dbg2       primary_ymax:              %f\n", data->primary_ymax);
-		fprintf(stderr,"dbg2       primary_dx:                %f\n", data->primary_dx);
-		fprintf(stderr,"dbg2       primary_dy:                %f\n", data->primary_dy);
-		fprintf(stderr,"dbg2       primary_data:              %p\n",  data->primary_data);
-		fprintf(stderr,"dbg2       primary_x:                 %p\n",  data->primary_x);
-		fprintf(stderr,"dbg2       primary_y:                 %p\n",  data->primary_y);
-		fprintf(stderr,"dbg2       primary_z:                 %p\n",  data->primary_z);
-		fprintf(stderr,"dbg2       primary_dxdz:              %p\n",  data->primary_dzdx);
-		fprintf(stderr,"dbg2       primary_dydz:              %p\n",  data->primary_dzdy);
-		fprintf(stderr,"dbg2       primary_r:                 %p\n",  data->primary_r);
-		fprintf(stderr,"dbg2       primary_g:                 %p\n",  data->primary_g);
-		fprintf(stderr,"dbg2       primary_b:                 %p\n",  data->primary_b);
-		fprintf(stderr,"dbg2       primary_stat_color:        %p\n",  data->primary_stat_color);
-		fprintf(stderr,"dbg2       primary_stat_z:            %p\n",  data->primary_stat_z);
-
-		/* secondary grid data */
-		fprintf(stderr,"dbg2       secondary_sameas_primary:  %d\n", data->secondary_sameas_primary);
-		fprintf(stderr,"dbg2       secondary_nodatavalue:     %f\n", data->secondary_nodatavalue);
-		fprintf(stderr,"dbg2       secondary_nxy:             %d\n", data->secondary_nxy);
-		fprintf(stderr,"dbg2       secondary_nx:              %d\n", data->secondary_nx);
-		fprintf(stderr,"dbg2       secondary_ny:              %d\n", data->secondary_ny);
-		fprintf(stderr,"dbg2       secondary_xmin:            %f\n", data->secondary_xmin);
-		fprintf(stderr,"dbg2       secondary_xmax:            %f\n", data->secondary_xmax);
-		fprintf(stderr,"dbg2       secondary_ymin:            %f\n", data->secondary_ymin);
-		fprintf(stderr,"dbg2       secondary_ymax:            %f\n", data->secondary_ymax);
-		fprintf(stderr,"dbg2       secondary_dx:              %f\n", data->secondary_dx);
-		fprintf(stderr,"dbg2       secondary_dy:              %f\n", data->secondary_dy);
-		fprintf(stderr,"dbg2       secondary_data:            %p\n",  data->secondary_data);
-
-		/* site data */
-		fprintf(stderr,"dbg2       site_view_mode:       %d\n",data->site_view_mode);
-		fprintf(stderr,"dbg2       site_mode:            %d\n",shared.shareddata.site_mode);
-		fprintf(stderr,"dbg2       nsite:                %d\n",shared.shareddata.nsite);
-		fprintf(stderr,"dbg2       nsite_alloc:          %d\n",shared.shareddata.nsite_alloc);
-		fprintf(stderr,"dbg2       site_selected:        %d\n",shared.shareddata.site_selected);
-		for (i=0;i<shared.shareddata.nsite;i++)
-			{
-			fprintf(stderr,"dbg2       site %d xgrid:       %f\n",i,shared.shareddata.sites[i].point.xgrid[0]);
-			fprintf(stderr,"dbg2       site %d ygrid:       %f\n",i,shared.shareddata.sites[i].point.ygrid[0]);
-			fprintf(stderr,"dbg2       site %d xlon:        %f\n",i,shared.shareddata.sites[i].point.xlon);
-			fprintf(stderr,"dbg2       site %d ylat:        %f\n",i,shared.shareddata.sites[i].point.ylat);
-			fprintf(stderr,"dbg2       site %d zdata:       %f\n",i,shared.shareddata.sites[i].point.zdata);
-			fprintf(stderr,"dbg2       site %d xdisplay:    %f\n",i,shared.shareddata.sites[i].point.xdisplay[0]);
-			fprintf(stderr,"dbg2       site %d ydisplay:    %f\n",i,shared.shareddata.sites[i].point.ydisplay[0]);
-			fprintf(stderr,"dbg2       site %d zdisplay:    %f\n",i,shared.shareddata.sites[i].point.zdisplay[0]);
-			fprintf(stderr,"dbg2       site %d color:       %d\n",i,shared.shareddata.sites[i].color);
-			fprintf(stderr,"dbg2       site %d size:        %d\n",i,shared.shareddata.sites[i].size);
-			fprintf(stderr,"dbg2       site %d name:        %s\n",i,shared.shareddata.sites[i].name);
-			}
-
-		/* route data */
-		fprintf(stderr,"dbg2       route_view_mode:      %d\n",data->route_view_mode);
-		fprintf(stderr,"dbg2       route_mode:           %d\n",shared.shareddata.route_mode);
-		fprintf(stderr,"dbg2       nroute:               %d\n",shared.shareddata.nroute);
-		fprintf(stderr,"dbg2       nroute_alloc:         %d\n",shared.shareddata.nroute_alloc);
-		fprintf(stderr,"dbg2       route_selected:       %d\n",shared.shareddata.route_selected);
-		fprintf(stderr,"dbg2       route_point_selected: %d\n",shared.shareddata.route_point_selected);
-		for (i=0;i<shared.shareddata.nroute;i++)
-			{
-			fprintf(stderr,"dbg2       route %d color:       %d\n",i,shared.shareddata.routes[i].color);
-			fprintf(stderr,"dbg2       route %d size:        %d\n",i,shared.shareddata.routes[i].size);
-			fprintf(stderr,"dbg2       route %d name:        %s\n",i,shared.shareddata.routes[i].name);
-			fprintf(stderr,"dbg2       route %d npoints:     %d\n",i,shared.shareddata.routes[i].npoints);
-			fprintf(stderr,"dbg2       route %d npoints_alloc: %d\n",i,shared.shareddata.routes[i].npoints_alloc);
-			for (j=0;j<shared.shareddata.routes[i].npoints;j++)
-				{
-				fprintf(stderr,"dbg2       route %d %d xgrid:       %f\n",i,j,shared.shareddata.routes[i].points[j].xgrid[0]);
-				fprintf(stderr,"dbg2       route %d %d ygrid:       %f\n",i,j,shared.shareddata.routes[i].points[j].ygrid[0]);
-				fprintf(stderr,"dbg2       route %d %d xlon:        %f\n",i,j,shared.shareddata.routes[i].points[j].xlon);
-				fprintf(stderr,"dbg2       route %d %d ylat:        %f\n",i,j,shared.shareddata.routes[i].points[j].ylat);
-				fprintf(stderr,"dbg2       route %d %d zdata:       %f\n",i,j,shared.shareddata.routes[i].points[j].zdata);
-				fprintf(stderr,"dbg2       route %d %d xdisplay:    %f\n",i,j,shared.shareddata.routes[i].points[j].xdisplay[0]);
-				fprintf(stderr,"dbg2       route %d %d ydisplay:    %f\n",i,j,shared.shareddata.routes[i].points[j].ydisplay[0]);
-				fprintf(stderr,"dbg2       route %d %d zdisplay:    %f\n",i,j,shared.shareddata.routes[i].points[j].zdisplay[0]);
-				fprintf(stderr,"dbg2       route %d %d distlateral: %f\n",i,j,shared.shareddata.routes[i].distlateral[j]);
-				fprintf(stderr,"dbg2       route %d %d distlateral: %f\n",i,j,shared.shareddata.routes[i].disttopo[j]);
-				}
-			}
-
-		/* nav data */
-		fprintf(stderr,"dbg2       nav_view_mode:         %d\n",data->nav_view_mode);
-		fprintf(stderr,"dbg2       navdrape_view_mode:    %d\n",data->navdrape_view_mode);
-		fprintf(stderr,"dbg2       vector_view_mode:      %d\n",data->vector_view_mode);
-		fprintf(stderr,"dbg2       nav_mode:              %d\n",shared.shareddata.nav_mode);
-		fprintf(stderr,"dbg2       nnav:                  %d\n",shared.shareddata.nnav);
-		fprintf(stderr,"dbg2       nnav_alloc:            %d\n",shared.shareddata.nnav_alloc);
-		fprintf(stderr,"dbg2       nav_selected:          %p\n",  shared.shareddata.nav_selected);
-		fprintf(stderr,"dbg2       nav_point_selected:    %p\n",  shared.shareddata.nav_point_selected);
-		for (i=0;i<shared.shareddata.nnav;i++)
-			{
-			fprintf(stderr,"dbg2       nav %d color:         %d\n",i,shared.shareddata.navs[i].color);
-			fprintf(stderr,"dbg2       nav %d size:          %d\n",i,shared.shareddata.navs[i].size);
-			fprintf(stderr,"dbg2       nav %d name:          %s\n",i,shared.shareddata.navs[i].name);
-			fprintf(stderr,"dbg2       nav %d swathbounds:   %d\n",i,shared.shareddata.navs[i].swathbounds);
-			fprintf(stderr,"dbg2       nav %d shot:          %d\n",i,shared.shareddata.navs[i].shot);
-			fprintf(stderr,"dbg2       nav %d cdp:           %d\n",i,shared.shareddata.navs[i].cdp);
-			fprintf(stderr,"dbg2       nav %d npoints:       %d\n",i,shared.shareddata.navs[i].npoints);
-			fprintf(stderr,"dbg2       nav %d npoints_alloc: %d\n",i,shared.shareddata.navs[i].npoints_alloc);
-			fprintf(stderr,"dbg2       nav %d nselected:     %d\n",i,shared.shareddata.navs[i].nselected);
-			for (j=0;j<shared.shareddata.navs[i].npoints;j++)
-				{
-				fprintf(stderr,"dbg2       nav %d %d draped:   %d\n",i,j,shared.shareddata.navs[i].navpts[j].draped);
-				fprintf(stderr,"dbg2       nav %d %d selected: %d\n",i,j,shared.shareddata.navs[i].navpts[j].selected);
-				fprintf(stderr,"dbg2       nav %d %d time_d:   %f\n",i,j,shared.shareddata.navs[i].navpts[j].time_d);
-				fprintf(stderr,"dbg2       nav %d %d heading:  %f\n",i,j,shared.shareddata.navs[i].navpts[j].heading);
-				fprintf(stderr,"dbg2       nav %d %d speed:    %f\n",i,j,shared.shareddata.navs[i].navpts[j].speed);
-				fprintf(stderr,"dbg2       nav %d %d shot:     %d\n",i,j,shared.shareddata.navs[i].navpts[j].shot);
-				fprintf(stderr,"dbg2       nav %d %d cdp:      %d\n",i,j,shared.shareddata.navs[i].navpts[j].cdp);
-				fprintf(stderr,"dbg2       nav %d %d xgrid:    %f\n",i,j,shared.shareddata.navs[i].navpts[j].point.xgrid[0]);
-				fprintf(stderr,"dbg2       nav %d %d ygrid:    %f\n",i,j,shared.shareddata.navs[i].navpts[j].point.ygrid[0]);
-				fprintf(stderr,"dbg2       nav %d %d xlon:     %f\n",i,j,shared.shareddata.navs[i].navpts[j].point.xlon);
-				fprintf(stderr,"dbg2       nav %d %d ylat:     %f\n",i,j,shared.shareddata.navs[i].navpts[j].point.ylat);
-				fprintf(stderr,"dbg2       nav %d %d zdata:    %f\n",i,j,shared.shareddata.navs[i].navpts[j].point.zdata);
-				fprintf(stderr,"dbg2       nav %d %d xdisplay: %f\n",i,j,shared.shareddata.navs[i].navpts[j].point.xdisplay[0]);
-				fprintf(stderr,"dbg2       nav %d %d ydisplay: %f\n",i,j,shared.shareddata.navs[i].navpts[j].point.ydisplay[0]);
-				fprintf(stderr,"dbg2       nav %d %d zdisplay: %f\n",i,j,shared.shareddata.navs[i].navpts[j].point.zdisplay[0]);
-				fprintf(stderr,"dbg2       nav %d %d port xgrid:    %f\n",i,j,shared.shareddata.navs[i].navpts[j].pointport.xgrid[0]);
-				fprintf(stderr,"dbg2       nav %d %d port ygrid:    %f\n",i,j,shared.shareddata.navs[i].navpts[j].pointport.ygrid[0]);
-				fprintf(stderr,"dbg2       nav %d %d port xlon:     %f\n",i,j,shared.shareddata.navs[i].navpts[j].pointport.xlon);
-				fprintf(stderr,"dbg2       nav %d %d port ylat:     %f\n",i,j,shared.shareddata.navs[i].navpts[j].pointport.ylat);
-				fprintf(stderr,"dbg2       nav %d %d port zdata:    %f\n",i,j,shared.shareddata.navs[i].navpts[j].pointport.zdata);
-				fprintf(stderr,"dbg2       nav %d %d port xdisplay: %f\n",i,j,shared.shareddata.navs[i].navpts[j].pointport.xdisplay[0]);
-				fprintf(stderr,"dbg2       nav %d %d port ydisplay: %f\n",i,j,shared.shareddata.navs[i].navpts[j].pointport.ydisplay[0]);
-				fprintf(stderr,"dbg2       nav %d %d port zdisplay: %f\n",i,j,shared.shareddata.navs[i].navpts[j].pointport.zdisplay[0]);
-				fprintf(stderr,"dbg2       nav %d %d cntr xgrid:    %f\n",i,j,shared.shareddata.navs[i].navpts[j].pointcntr.xgrid[0]);
-				fprintf(stderr,"dbg2       nav %d %d cntr ygrid:    %f\n",i,j,shared.shareddata.navs[i].navpts[j].pointcntr.ygrid[0]);
-				fprintf(stderr,"dbg2       nav %d %d cntr xlon:     %f\n",i,j,shared.shareddata.navs[i].navpts[j].pointcntr.xlon);
-				fprintf(stderr,"dbg2       nav %d %d cntr ylat:     %f\n",i,j,shared.shareddata.navs[i].navpts[j].pointcntr.ylat);
-				fprintf(stderr,"dbg2       nav %d %d cntr zdata:    %f\n",i,j,shared.shareddata.navs[i].navpts[j].pointcntr.zdata);
-				fprintf(stderr,"dbg2       nav %d %d cntr xdisplay: %f\n",i,j,shared.shareddata.navs[i].navpts[j].pointcntr.xdisplay[0]);
-				fprintf(stderr,"dbg2       nav %d %d cntr ydisplay: %f\n",i,j,shared.shareddata.navs[i].navpts[j].pointcntr.ydisplay[0]);
-				fprintf(stderr,"dbg2       nav %d %d cntr zdisplay: %f\n",i,j,shared.shareddata.navs[i].navpts[j].pointcntr.zdisplay[0]);
-				fprintf(stderr,"dbg2       nav %d %d stbd xgrid:    %f\n",i,j,shared.shareddata.navs[i].navpts[j].pointstbd.xgrid[0]);
-				fprintf(stderr,"dbg2       nav %d %d stbd ygrid:    %f\n",i,j,shared.shareddata.navs[i].navpts[j].pointstbd.ygrid[0]);
-				fprintf(stderr,"dbg2       nav %d %d stbd xlon:     %f\n",i,j,shared.shareddata.navs[i].navpts[j].pointstbd.xlon);
-				fprintf(stderr,"dbg2       nav %d %d stbd ylat:     %f\n",i,j,shared.shareddata.navs[i].navpts[j].pointstbd.ylat);
-				fprintf(stderr,"dbg2       nav %d %d stbd zdata:    %f\n",i,j,shared.shareddata.navs[i].navpts[j].pointstbd.zdata);
-				fprintf(stderr,"dbg2       nav %d %d stbd xdisplay: %f\n",i,j,shared.shareddata.navs[i].navpts[j].pointstbd.xdisplay[0]);
-				fprintf(stderr,"dbg2       nav %d %d stbd ydisplay: %f\n",i,j,shared.shareddata.navs[i].navpts[j].pointstbd.ydisplay[0]);
-				fprintf(stderr,"dbg2       nav %d %d stbd zdisplay: %f\n",i,j,shared.shareddata.navs[i].navpts[j].pointstbd.zdisplay[0]);
-				}
-			}
-
-		/* profile data */
-		fprintf(stderr,"dbg2       profile_view_mode:         %d\n",data->profile_view_mode);
-		fprintf(stderr,"dbg2       source:                    %d\n",data->profile.source);
-		fprintf(stderr,"dbg2       source_name:               %s\n",data->profile.source_name);
-		fprintf(stderr,"dbg2       length:                    %f\n",data->profile.length);
-		fprintf(stderr,"dbg2       zmin:                      %f\n",data->profile.zmin);
-		fprintf(stderr,"dbg2       zmax:                      %f\n",data->profile.zmax);
-		fprintf(stderr,"dbg2       npoints:                   %d\n",data->profile.npoints);
-		fprintf(stderr,"dbg2       npoints_alloc:             %d\n",data->profile.npoints_alloc);
-		for (i=0;i<data->profile.npoints;i++)
-			{
-			fprintf(stderr,"dbg2       profile %d boundary: %d\n",i,data->profile.points[i].boundary);
-			fprintf(stderr,"dbg2       profile %d xgrid:    %f\n",i,data->profile.points[i].xgrid);
-			fprintf(stderr,"dbg2       profile %d ygrid:    %f\n",i,data->profile.points[i].ygrid);
-			fprintf(stderr,"dbg2       profile %d xlon:     %f\n",i,data->profile.points[i].xlon);
-			fprintf(stderr,"dbg2       profile %d ylat:     %f\n",i,data->profile.points[i].ylat);
-			fprintf(stderr,"dbg2       profile %d zdata:    %f\n",i,data->profile.points[i].zdata);
-			fprintf(stderr,"dbg2       profile %d distance: %f\n",i,data->profile.points[i].distance);
-			fprintf(stderr,"dbg2       profile %d xdisplay: %f\n",i,data->profile.points[i].xdisplay);
-			fprintf(stderr,"dbg2       profile %d ydisplay: %f\n",i,data->profile.points[i].ydisplay);
-			}
-		}
-
-	/* set active */
-	data->active = MB_YES;
-
-	/* if not yet created then create the MB3DView class in
-		a topLevelShell as a child of Widget parent */
-	if (view->init != MBV_WINDOW_VISIBLE)
-		{
-		ac = 0;
-		XtSetArg(args[ac], XmNtitle, data->title); ac++;
-		XtSetArg(args[ac], XmNwidth, data->width + LEFT_WIDTH); ac++;
-		XtSetArg(args[ac], XmNheight, data->height + LEFT_HEIGHT); ac++;
-		view->topLevelShell = XtCreatePopupShell("topLevelShell",
-		    topLevelShellWidgetClass,
-		    parent_widget,
-		    args,
-		    ac);
-		view->mainWindow = XmCreateMainWindow(
-		    view->topLevelShell,
-		    "mainWindow_mbview",
-        	    args,
-        	    ac);
-    		XtManageChild(view->mainWindow);
-		MB3DViewCreate(&(view->mb3dview),
-        	    view->mainWindow,
-        	    "mbview_mbgrdviz",
-        	    args,
-        	    ac);
-
-		ac = 0;
-		XtSetArg(args[ac], XmNx, data->xo); ac++;
-		XtSetArg(args[ac], XmNy, data->yo); ac++;
-		XtSetArg(args[ac], XmNwidth, data->width + LEFT_WIDTH); ac++;
-		XtSetArg(args[ac], XmNheight, data->height + LEFT_HEIGHT); ac++;
-		XtSetValues(view->mb3dview.MB3DView, args, ac);
-    		XtManageChild(view->mb3dview.MB3DView);
-    		XtPopup(XtParent(view->mainWindow), XtGrabNone);
-
-		/* get resize events - add event handlers */
-		XtAddEventHandler(view->topLevelShell,
-					StructureNotifyMask,
-					False,
-					mbview_resize,
-					(XtPointer)instance);
-		XtAddEventHandler(view->mb3dview.mbview_form_profile,
-					StructureNotifyMask,
-					False,
-					do_mbview_profile_resize,
-					(XtPointer)instance);
-
-		/* intitialize OpenGL graphics */
-		ac = 0;
-		XtSetArg(args[ac], mbGLwNrgba, TRUE);
-		ac++;
-		XtSetArg(args[ac], mbGLwNdepthSize, 1);
-		ac++;
-		XtSetArg(args[ac], mbGLwNdoublebuffer, True);
-		ac++;
-		XtSetArg(args[ac], mbGLwNallocateBackground, TRUE);
-		ac++;
-		XtSetArg(args[ac], XmNwidth, data->width);
-		ac++;
-		XtSetArg(args[ac], XmNheight, data->height);
-		ac++;
-		view->dpy = (Display *) XtDisplay(view->mb3dview.MB3DView);
-		view->glwmda = mbGLwCreateMDrawingArea(view->mb3dview.mbview_drawingArea_mbview,
-			"glwidget", args, ac);
-		/* view->glwmda = XtCreateWidget("glwidget", mbGLwDrawingAreaWidgetClass, view->mb3dview.mbview_drawingArea_mbview, args, ac);*/
-		XtManageChild (view->glwmda);
-		XtAddCallback(view->glwmda, "exposeCallback",
-			    &(do_mbview_glwda_expose), (XtPointer) NULL);
-		XtAddCallback(view->glwmda, "resizeCallback",
-			    &(do_mbview_glwda_resize), (XtPointer) NULL);
-		XtAddCallback(view->glwmda, "inputCallback",
-			    &(do_mbview_glwda_input), (XtPointer) NULL);
-		XSelectInput(view->dpy, XtWindow(view->glwmda),
-			(ButtonPressMask | ButtonReleaseMask | ButtonMotionMask
-				| KeyPressMask | KeyReleaseMask | ExposureMask ) );
-
-		/* generate cursors for later use */
-		view->xid = XtWindow(view->mb3dview.mbview_drawingArea_mbview);
-		XAllocNamedColor(view->dpy,
-    				    DefaultColormap(view->dpy, XDefaultScreen(view->dpy)),
-				    "red", &XColorRed, &exact);
-		XAllocNamedColor(view->dpy,
-    				    DefaultColormap(view->dpy, XDefaultScreen(view->dpy)),
-				    "green", &XColorGreen, &exact);
-		XAllocNamedColor(view->dpy,
-    				    DefaultColormap(view->dpy, XDefaultScreen(view->dpy)),
-				    "blue", &XColorBlue, &exact);
-		XAllocNamedColor(view->dpy,
-    				    DefaultColormap(view->dpy, XDefaultScreen(view->dpy)),
-				    "black", &XColorBlack, &exact);
-		XAllocNamedColor(view->dpy,
-    				    DefaultColormap(view->dpy, XDefaultScreen(view->dpy)),
-				    "white", &XColorWhite, &exact);
-		XAllocNamedColor(view->dpy,
-    				    DefaultColormap(view->dpy, XDefaultScreen(view->dpy)),
-				    "coral", &XColorCoral, &exact);
-		view->TargetBlackCursor = XCreateFontCursor(view->dpy, XC_target);
-		view->TargetGreenCursor = XCreateFontCursor(view->dpy, XC_target);
-		view->TargetRedCursor = XCreateFontCursor(view->dpy, XC_target);
-		view->FleurBlackCursor = XCreateFontCursor(view->dpy, XC_fleur);
-		view->FleurRedCursor = XCreateFontCursor(view->dpy, XC_fleur);
-		view->SizingBlackCursor = XCreateFontCursor(view->dpy, XC_sizing);
-		view->SizingRedCursor = XCreateFontCursor(view->dpy, XC_sizing);
-		view->BoatBlackCursor = XCreateFontCursor(view->dpy, XC_boat);
-		view->BoatRedCursor = XCreateFontCursor(view->dpy, XC_boat);
-		view->WatchBlackCursor = XCreateFontCursor(view->dpy, XC_watch);
-		view->WatchRedCursor = XCreateFontCursor(view->dpy, XC_watch);
-		XRecolorCursor(view->dpy,view->TargetRedCursor,&XColorRed,&XColorCoral);
-		XRecolorCursor(view->dpy,view->TargetGreenCursor,&XColorGreen,&XColorCoral);
-		XRecolorCursor(view->dpy,view->FleurRedCursor,&XColorRed,&XColorCoral);
-		XRecolorCursor(view->dpy,view->SizingRedCursor,&XColorRed,&XColorCoral);
-		XRecolorCursor(view->dpy,view->BoatRedCursor,&XColorRed,&XColorCoral);
-		XRecolorCursor(view->dpy,view->WatchRedCursor,&XColorRed,&XColorCoral);
-		XDefineCursor(view->dpy,view->xid,view->TargetBlackCursor);
-
-		/* set instance into XmNuserData resources */
-		ac = 0;
-		XtSetArg(args[ac], XmNuserData, (XtPointer)instance); ac++;
-		XtSetValues(view->topLevelShell, args, ac);
-		XtSetValues(view->mainWindow, args, ac);
-		XtSetValues(view->mb3dview.MB3DView, args, ac);
-		XtSetValues(view->mb3dview.mbview_pushButton_clearpicks, args, ac);
-		XtSetValues(view->mb3dview.mbview_pushButton_reset, args, ac);
-		XtSetValues(view->mb3dview.mbview_radioBox_mouse, args, ac);
-		XtSetValues(view->mb3dview.mbview_toggleButton_mode_rmove, args, ac);
-		XtSetValues(view->mb3dview.mbview_toggleButton_mode_rrotate, args, ac);
-		XtSetValues(view->mb3dview.mbview_toggleButton_mode_rviewpoint, args, ac);
-		XtSetValues(view->mb3dview.mbview_toggleButton_mode_rshade, args, ac);
-		XtSetValues(view->mb3dview.mbview_toggleButton_mode_rarea, args, ac);
-		XtSetValues(view->mb3dview.mbview_toggleButton_mode_rsite, args, ac);
-		XtSetValues(view->mb3dview.mbview_toggleButton_mode_rroute, args, ac);
-		XtSetValues(view->mb3dview.mbview_toggleButton_mode_rnav, args, ac);
-		XtSetValues(view->mb3dview.mbview_toggleButton_mode_rnavfile, args, ac);
-		XtSetValues(view->mb3dview.mbview_label_status, args, ac);
-		XtSetValues(view->mb3dview.mbview_pushButton_fullrez, args, ac);
-		XtSetValues(view->mb3dview.mbview_label_pickinfo, args, ac);
-		XtSetValues(view->mb3dview.mbview_menuBar_mbview, args, ac);
-		XtSetValues(view->mb3dview.mbview_cascadeButton_view, args, ac);
-		XtSetValues(view->mb3dview.mbview_pulldownMenu_view, args, ac);
-		XtSetValues(view->mb3dview.mbview_toggleButton_display_2D, args, ac);
-		XtSetValues(view->mb3dview.mbview_toggleButton_display_3D, args, ac);
-		XtSetValues(view->mb3dview.mbview_separator10, args, ac);
-		XtSetValues(view->mb3dview.mbview_toggleButton_data_primary, args, ac);
-		XtSetValues(view->mb3dview.mbview_toggleButton_data_primaryslope, args, ac);
-		XtSetValues(view->mb3dview.mbview_toggleButton_data_secondary, args, ac);
-		XtSetValues(view->mb3dview.mbview_separator, args, ac);
-		XtSetValues(view->mb3dview.mbview_toggleButton_histogram, args, ac);
-		XtSetValues(view->mb3dview.mbview_separator21, args, ac);
-		XtSetValues(view->mb3dview.mbview_toggleButton_overlay_none, args, ac);
-		XtSetValues(view->mb3dview.mbview_toggleButton_overlay_illumination, args, ac);
-		XtSetValues(view->mb3dview.mbview_toggleButton_overlay_slope, args, ac);
-		XtSetValues(view->mb3dview.mbview_toggleButton_overlay_secondary, args, ac);
-		XtSetValues(view->mb3dview.mbview_separator1, args, ac);
-		XtSetValues(view->mb3dview.mbview_toggleButton_overlay_contour, args, ac);
-		XtSetValues(view->mb3dview.mbview_toggleButton_site, args, ac);
-		XtSetValues(view->mb3dview.mbview_toggleButton_route, args, ac);
-		XtSetValues(view->mb3dview.mbview_toggleButton_nav, args, ac);
-		XtSetValues(view->mb3dview.mbview_toggleButton_navdrape, args, ac);
-		XtSetValues(view->mb3dview.mbview_separator8, args, ac);
-		XtSetValues(view->mb3dview.mbview_toggleButton_colortable_haxby, args, ac);
-		XtSetValues(view->mb3dview.mbview_toggleButton_colortable_bright, args, ac);
-		XtSetValues(view->mb3dview.mbview_toggleButton_colortable_muted, args, ac);
-		XtSetValues(view->mb3dview.mbview_toggleButton_colortable_gray, args, ac);
-		XtSetValues(view->mb3dview.mbview_toggleButton_colortable_flat, args, ac);
-		XtSetValues(view->mb3dview.mbview_toggleButton_colortable_sealevel1, args, ac);
-		XtSetValues(view->mb3dview.mbview_toggleButton_colortable_sealevel2, args, ac);
-		XtSetValues(view->mb3dview.separator1, args, ac);
-		XtSetValues(view->mb3dview.mbview_toggleButton_profile, args, ac);
-		XtSetValues(view->mb3dview.mbview_cascadeButton_controls, args, ac);
-		XtSetValues(view->mb3dview.mbview_pulldownMenu_controls, args, ac);
-		XtSetValues(view->mb3dview.mbview_pushButton_colorbounds, args, ac);
-		XtSetValues(view->mb3dview.mbview_pushButton_2dview, args, ac);
-		XtSetValues(view->mb3dview.mbview_pushButton_3dview, args, ac);
-		XtSetValues(view->mb3dview.mbview_pushButton_shadeparms, args, ac);
-		XtSetValues(view->mb3dview.mbview_pushButton_resolution, args, ac);
-		XtSetValues(view->mb3dview.mbview_pushButton_projections, args, ac);
-		XtSetValues(view->mb3dview.mbview_pushButton_sitelist, args, ac);
-		XtSetValues(view->mb3dview.mbview_pushButton_routelist, args, ac);
-		XtSetValues(view->mb3dview.mbview_pushButton_navlist, args, ac);
-		XtSetValues(view->mb3dview.mbview_cascadeButton_mouse, args, ac);
-		XtSetValues(view->mb3dview.mbview_pulldownMenu_mouse, args, ac);
-		XtSetValues(view->mb3dview.mbview_toggleButton_mode_move, args, ac);
-		XtSetValues(view->mb3dview.mbview_toggleButton_mode_rotate, args, ac);
-		XtSetValues(view->mb3dview.mbview_toggleButton_mode_viewpoint, args, ac);
-		XtSetValues(view->mb3dview.mbview_toggleButton_mode_shade, args, ac);
-		XtSetValues(view->mb3dview.mbview_toggleButton_mode_area, args, ac);
-		XtSetValues(view->mb3dview.mbview_toggleButton_mode_site, args, ac);
-		XtSetValues(view->mb3dview.mbview_toggleButton_mode_route, args, ac);
-		XtSetValues(view->mb3dview.mbview_toggleButton_mode_nav, args, ac);
-		XtSetValues(view->mb3dview.mbview_toggleButton_mode_navfile, args, ac);
-		XtSetValues(view->mb3dview.mbview_cascadeButton_action, args, ac);
-		XtSetValues(view->mb3dview.mbview_pulldownMenu_action, args, ac);
-		XtSetValues(view->mb3dview.mbview_pushButton_help_about, args, ac);
-		XtSetValues(view->mb3dview.mbview_cascadeButton_dismiss, args, ac);
-		XtSetValues(view->mb3dview.mbview_pulldownMenu_dismiss, args, ac);
-		XtSetValues(view->mb3dview.mbview_pushButton_dismiss, args, ac);
-		XtSetValues(view->mb3dview.mbview_label_mouse, args, ac);
-		XtSetValues(view->mb3dview.mbview_drawingArea_mbview, args, ac);
-		XtSetValues(view->mb3dview.mbview_dialogShell_colorbounds, args, ac);
-		XtSetValues(view->mb3dview.mbview_bulletinBoard_colorbounds, args, ac);
-		XtSetValues(view->mb3dview.mbview_separator5, args, ac);
-		XtSetValues(view->mb3dview.mbview_radioBox_overlaymode, args, ac);
-		XtSetValues(view->mb3dview.mbview_toggleButton_overlay_ctoh, args, ac);
-		XtSetValues(view->mb3dview.mbview_toggleButton_overlay_htoc, args, ac);
-		XtSetValues(view->mb3dview.mbview_textField_overlaymax, args, ac);
-		XtSetValues(view->mb3dview.mbview_label_overlaymax, args, ac);
-		XtSetValues(view->mb3dview.mbview_textField_overlaymin, args, ac);
-		XtSetValues(view->mb3dview.mbview_label_overlaymin, args, ac);
-		XtSetValues(view->mb3dview.mbview_label_overlaybounds, args, ac);
-		XtSetValues(view->mb3dview.mbview_separator3, args, ac);
-		XtSetValues(view->mb3dview.mbview_radioBox_slopemode, args, ac);
-		XtSetValues(view->mb3dview.mbview_toggleButton_slope_ctoh, args, ac);
-		XtSetValues(view->mb3dview.mbview_toggleButton_slope_htoc, args, ac);
-		XtSetValues(view->mb3dview.mbview_textField_slopemax, args, ac);
-		XtSetValues(view->mb3dview.mbview_label_slopemax, args, ac);
-		XtSetValues(view->mb3dview.mbview_textField_slopemin, args, ac);
-		XtSetValues(view->mb3dview.mbview_label_slopemin, args, ac);
-		XtSetValues(view->mb3dview.mbview_label_slopebounds, args, ac);
-		XtSetValues(view->mb3dview.mbview_radioBox_colormode, args, ac);
-		XtSetValues(view->mb3dview.mbview_toggleButton_data_ctoh, args, ac);
-		XtSetValues(view->mb3dview.mbview_toggleButton_data_htoc, args, ac);
-		XtSetValues(view->mb3dview.mbview_textField_datamax, args, ac);
-		XtSetValues(view->mb3dview.mbview_textField_datamin, args, ac);
-		XtSetValues(view->mb3dview.mbview_label_colormax, args, ac);
-		XtSetValues(view->mb3dview.mbview_label_colormin, args, ac);
-		XtSetValues(view->mb3dview.mbview_label_colorbounds, args, ac);
-		XtSetValues(view->mb3dview.mbview_separator2, args, ac);
-		XtSetValues(view->mb3dview.mbview_pushButton_colorbounds_apply, args, ac);
-		XtSetValues(view->mb3dview.mbview_label_contour, args, ac);
-		XtSetValues(view->mb3dview.mbview_textField_contours, args, ac);
-		XtSetValues(view->mb3dview.mbview_pushButton_colorbounds_dismiss, args, ac);
-		XtSetValues(view->mb3dview.mbview_dialogShell_resolution, args, ac);
-		XtSetValues(view->mb3dview.mbview_bulletinBoard_resolution, args, ac);
-		XtSetValues(view->mb3dview.mbview_scale_navmediumresolution, args, ac);
-		XtSetValues(view->mb3dview.mbview_scale_navlowresolution, args, ac);
-		XtSetValues(view->mb3dview.separator, args, ac);
-		XtSetValues(view->mb3dview.mbview_label_navrenderdecimation, args, ac);
-		XtSetValues(view->mb3dview.mbview_label_gridrenderres, args, ac);
-		XtSetValues(view->mb3dview.mbview_scale_mediumresolution, args, ac);
-		XtSetValues(view->mb3dview.mbview_scale_lowresolution, args, ac);
-		XtSetValues(view->mb3dview.mbview_pushButton_resolution_dismiss, args, ac);
-		XtSetValues(view->mb3dview.mbview_dialogShell_message, args, ac);
-		XtSetValues(view->mb3dview.mbview_bulletinBoard_message, args, ac);
-		XtSetValues(view->mb3dview.mbview_label_message, args, ac);
-		XtSetValues(view->mb3dview.mbview_label_thanks, args, ac);
-		XtSetValues(view->mb3dview.mbview_dialogShell_about, args, ac);
-		XtSetValues(view->mb3dview.mbview_bulletinBoard_about, args, ac);
-		XtSetValues(view->mb3dview.mbview_label_about_version, args, ac);
-		XtSetValues(view->mb3dview.mbview_label_about_authors, args, ac);
-		XtSetValues(view->mb3dview.mbview_label_about_MBARI, args, ac);
-		XtSetValues(view->mb3dview.mbview_label_about_LDEO, args, ac);
-		XtSetValues(view->mb3dview.mbview_separator6, args, ac);
-		XtSetValues(view->mb3dview.mbview_label_about_mbsystem, args, ac);
-		XtSetValues(view->mb3dview.mbview_separator7, args, ac);
-		XtSetValues(view->mb3dview.mbview_label_about_title, args, ac);
-		XtSetValues(view->mb3dview.mbview_pushButton_about_dismiss, args, ac);
-		XtSetValues(view->mb3dview.mbview_dialogShell_shadeparms, args, ac);
-		XtSetValues(view->mb3dview.mbview_bulletinBoard_shadeparms, args, ac);
-		XtSetValues(view->mb3dview.mbview_separator13, args, ac);
-		XtSetValues(view->mb3dview.mbview_textField_overlay_center, args, ac);
-		XtSetValues(view->mb3dview.mbview_label_overlay_center, args, ac);
-		XtSetValues(view->mb3dview.mbview_label_overlayshade, args, ac);
-		XtSetValues(view->mb3dview.mbview_radioBox_overlay_shade, args, ac);
-		XtSetValues(view->mb3dview.mbview_toggleButton_overlay_shade_ctoh, args, ac);
-		XtSetValues(view->mb3dview.mbview_toggleButton_overlay_shade_htoc, args, ac);
-		XtSetValues(view->mb3dview.mbview_textField_overlay_amp, args, ac);
-		XtSetValues(view->mb3dview.mbview_label_overlay_amp, args, ac);
-		XtSetValues(view->mb3dview.mbview_separator15, args, ac);
-		XtSetValues(view->mb3dview.mbview_textField_slope_amp, args, ac);
-		XtSetValues(view->mb3dview.mbview_label_slope_amp, args, ac);
-		XtSetValues(view->mb3dview.mbview_label_slopeshade, args, ac);
-		XtSetValues(view->mb3dview.mbview_textField_illum_azi, args, ac);
-		XtSetValues(view->mb3dview.mbview_textField_illum_amp, args, ac);
-		XtSetValues(view->mb3dview.mbview_label_illum_azi, args, ac);
-		XtSetValues(view->mb3dview.mbview_label_illum_amp, args, ac);
-		XtSetValues(view->mb3dview.mbview_label_illumination, args, ac);
-		XtSetValues(view->mb3dview.mbview_separator16, args, ac);
-		XtSetValues(view->mb3dview.mbview_pushButton_shadeparms_apply, args, ac);
-		XtSetValues(view->mb3dview.mbview_label_illum_elev, args, ac);
-		XtSetValues(view->mb3dview.mbview_textField_illum_elev, args, ac);
-		XtSetValues(view->mb3dview.mbview_pushButton_shadeparms_dismiss2, args, ac);
-		XtSetValues(view->mb3dview.mbview_dialogShell_3dparms, args, ac);
-		XtSetValues(view->mb3dview.mbview_bulletinBoard_3dparms, args, ac);
-		XtSetValues(view->mb3dview.mbview_textField_model_3dzoom, args, ac);
-		XtSetValues(view->mb3dview.mbview_label_model_3dzoom, args, ac);
-		XtSetValues(view->mb3dview.mbview_separator11, args, ac);
-		XtSetValues(view->mb3dview.mbview_textField_view_3dzoom, args, ac);
-		XtSetValues(view->mb3dview.mbview_label_view_3dzoom, args, ac);
-		XtSetValues(view->mb3dview.mbview_textField_view_3doffsety, args, ac);
-		XtSetValues(view->mb3dview.mbview_label_view_3doffsety, args, ac);
-		XtSetValues(view->mb3dview.mbview_separator20, args, ac);
-		XtSetValues(view->mb3dview.mbview_textField_view_3doffsetx, args, ac);
-		XtSetValues(view->mb3dview.mbview_label_view_3doffsetx, args, ac);
-		XtSetValues(view->mb3dview.mbview_label_view_offset, args, ac);
-		XtSetValues(view->mb3dview.mbview_textField_view_elevation, args, ac);
-		XtSetValues(view->mb3dview.mbview_label_view_elevation, args, ac);
-		XtSetValues(view->mb3dview.mbview_separator4, args, ac);
-		XtSetValues(view->mb3dview.mbview_textField_view_azimuth, args, ac);
-		XtSetValues(view->mb3dview.mbview_label_view_azimuth, args, ac);
-		XtSetValues(view->mb3dview.mbview_label_view, args, ac);
-		XtSetValues(view->mb3dview.mbview_textField_model_elevation, args, ac);
-		XtSetValues(view->mb3dview.mbview_textField_model_azimuth, args, ac);
-		XtSetValues(view->mb3dview.mbview_label_model_elevation, args, ac);
-		XtSetValues(view->mb3dview.mbview_label_model_azimuth, args, ac);
-		XtSetValues(view->mb3dview.mbview_label_model, args, ac);
-		XtSetValues(view->mb3dview.mbview_separator9, args, ac);
-		XtSetValues(view->mb3dview.mbview_pushButton_view_3d_apply, args, ac);
-		XtSetValues(view->mb3dview.mbview_label_exager, args, ac);
-		XtSetValues(view->mb3dview.mbview_textField_exageration, args, ac);
-		XtSetValues(view->mb3dview.mbview_pushButton_view_3d_dismiss, args, ac);
-		XtSetValues(view->mb3dview.mbview_dialogShell_2dparms, args, ac);
-		XtSetValues(view->mb3dview.mbview_bulletinBoard_2dparms, args, ac);
-		XtSetValues(view->mb3dview.mbview_textField_view_2dzoom, args, ac);
-		XtSetValues(view->mb3dview.mbview_label_view_2dzoom, args, ac);
-		XtSetValues(view->mb3dview.mbview_textField_view_2doffsety, args, ac);
-		XtSetValues(view->mb3dview.mbview_label_view_2doffsety, args, ac);
-		XtSetValues(view->mb3dview.mbview_separator14, args, ac);
-		XtSetValues(view->mb3dview.mbview_textField_view_2doffsetx, args, ac);
-		XtSetValues(view->mb3dview.mbview_label_view_2doffsetx, args, ac);
-		XtSetValues(view->mb3dview.mbview_label_2d_offset, args, ac);
-		XtSetValues(view->mb3dview.mbview_pushButton_view_2d_apply, args, ac);
-		XtSetValues(view->mb3dview.mbview_pushButton_view_2d_dismiss, args, ac);
-		XtSetValues(view->mb3dview.mbview_dialogShell_projection, args, ac);
-		XtSetValues(view->mb3dview.mbview_bulletinBoard_projection, args, ac);
-		XtSetValues(view->mb3dview.mbview_label_displayprojection, args, ac);
-		XtSetValues(view->mb3dview.mbview_radioBox_projection, args, ac);
-		XtSetValues(view->mb3dview.mbview_toggleButton_geographic, args, ac);
-		XtSetValues(view->mb3dview.mbview_toggleButton_utm, args, ac);
-		XtSetValues(view->mb3dview.mbview_toggleButton_spheroid, args, ac);
-		XtSetValues(view->mb3dview.mbview_label_projection, args, ac);
-		XtSetValues(view->mb3dview.mbview_pushButton_projection_dismiss, args, ac);
-		XtSetValues(view->mb3dview.mbview_dialogShell_profile, args, ac);
-		XtSetValues(view->mb3dview.mbview_form_profile, args, ac);
-		XtSetValues(view->mb3dview.mbview_scale_profile_width, args, ac);
-		XtSetValues(view->mb3dview.mbview_scale_profile_slope, args, ac);
-		XtSetValues(view->mb3dview.mbview_scrolledWindow_profile, args, ac);
-		XtSetValues(view->mb3dview.mbview_drawingArea_profile, args, ac);
-		XtSetValues(view->mb3dview.mbview_profile_label_info, args, ac);
-		XtSetValues(view->mb3dview.mbview_scale_profile_exager, args, ac);
-		XtSetValues(view->mb3dview.mbview_profile_pushButton_dismiss, args, ac);
-		XtSetValues(view->glwmda, args, ac);
-		/* set the initialization flag */
-		view->init = MBV_WINDOW_VISIBLE;
-		}
-
-	/* make sure some key parameters are set */
-	view->projected = MB_NO;
-	view->globalprojected = MB_NO;
-	view->lastdrawrez = MBV_REZ_NONE;
-	view->viewboundscount = MBV_BOUNDSFREQUENCY;
-	mbview_zscaleclear(instance);
-	mbview_setcolorparms(instance);
-	mbview_colorclear(instance);
-	view->contourlorez = MB_NO;
-	view->contourhirez = MB_NO;
-	view->contourfullrez = MB_NO;
-	view->primary_histogram_set = MB_NO;
-	view->primaryslope_histogram_set = MB_NO;
-	view->secondary_histogram_set = MB_NO;
-	if (data->primary_colortable_max
-		<= data->primary_colortable_min)
-		{
-    		data->primary_colortable_min
-			= data->primary_min
-				- 0.01 * (data->primary_max
-						- data->primary_min);
-    		data->primary_colortable_max
-			= data->primary_max
-				+ 0.01 * (data->primary_max
-						- data->primary_min);
-		data->contour_interval
-			= pow(10.0, floor(log10(data->primary_max
-						- data->primary_min)) - 1.0);
-		}
-
-	/* set about version label */
-	sprintf(value_text, "::#TimesMedium14:t\"MB-System Release %s\"#TimesMedium14\"%s\"",
-		MB_VERSION, MB_BUILD_DATE);
-	set_mbview_label_multiline_string(view->mb3dview.mbview_label_about_version, value_text);
-
-	/* set widgets */
-	mbview_set_widgets(verbose, instance, error);
-
-	/* set widget sensitivity */
-	mbview_update_sensitivity(verbose, instance, error);
-	mbview_action_sensitivityall();
-
-	/* create glx context */
-	mbview_reset_glx(instance);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:        %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:       %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-
-
-/*------------------------------------------------------------------------------*/
-int mbview_update(int verbose, size_t instance, int *error)
-{
-	/* local variables */
-	char	*function_name = "mbview_update";
-	int	status = MB_SUCCESS;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-
-	/* print starting debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:                   %d\n", verbose);
-		fprintf(stderr,"dbg2       instance:                  %zu\n", instance);
-		}
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* make sure some key parameters are set */
-	/*view->projected = MB_NO;*/
-	/*view->globalprojected = MB_NO;*/
-	view->lastdrawrez = MBV_REZ_NONE;
-	view->viewboundscount = MBV_BOUNDSFREQUENCY;
-	mbview_zscaleclear(instance);
-	mbview_setcolorparms(instance);
-	mbview_colorclear(instance);
-	view->contourlorez = MB_NO;
-	view->contourhirez = MB_NO;
-	view->contourfullrez = MB_NO;
-	view->primary_histogram_set = MB_NO;
-	view->primaryslope_histogram_set = MB_NO;
-	view->secondary_histogram_set = MB_NO;
-	if (data->primary_nxy > 0
-		&& data->primary_colortable_max
-			<= data->primary_colortable_min)
-		{
-    		data->primary_colortable_min
-			= data->primary_min
-				- 0.01 * (data->primary_max
-						- data->primary_min);
-    		data->primary_colortable_max
-			= data->primary_max
-				+ 0.01 * (data->primary_max
-						- data->primary_min);
-		data->contour_interval
-			= pow(10.0, floor(log10(data->primary_max
-						- data->primary_min)) - 1.0);
-		}
-	if (data->secondary_nxy > 0
-		&& data->secondary_colortable_max
-			<= data->secondary_colortable_min)
-		{
-    		data->secondary_colortable_min
-			= data->secondary_min
-				- 0.01 * (data->secondary_max
-						- data->secondary_min);
-    		data->secondary_colortable_max
-			= data->secondary_max
-				+ 0.01 * (data->secondary_max
-						- data->secondary_min);
-    		data->overlay_shade_center
-			= 0.5 * (data->secondary_max
-						+ data->secondary_min);
-		}
-
-	/* set widgets */
-	if (data->active == MB_YES)
-		mbview_set_widgets(verbose, instance, error);
-
-	/* set widget sensitivity */
-	if (data->active == MB_YES)
-		mbview_update_sensitivity(verbose, instance, error);
-
-	/* draw */
-if (mbv_verbose >= 2)
-fprintf(stderr,"Calling mbview_plotlowhigh from mbview_update\n");
-	mbview_plotlowhigh(instance);
-	mbview_plotlowhighall(instance);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:        %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:       %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-
-/*------------------------------------------------------------------------------*/
-int mbview_update_sensitivity(int verbose, size_t instance, int *error)
-{
-	/* local variables */
-	char	*function_name = "mbview_update_sensitivity";
-	int	status = MB_SUCCESS;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-
-	/* print starting debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:                   %d\n", verbose);
-		fprintf(stderr,"dbg2       instance:                  %zu\n", instance);
-		}
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* set widget sensitivity */
-
-	ac = 0;
-	if (data->display_projection_mode == MBV_PROJECTION_SPHEROID)
-		{
-		XtSetArg(args[ac], XmNsensitive, False); ac++;
-		data->display_mode = MBV_DISPLAY_3D;
-		}
-	else
-		{
-		XtSetArg(args[ac], XmNsensitive, True); ac++;
-		}
-	XtSetValues(view->mb3dview.mbview_toggleButton_display_2D, args, ac);
-
-	ac = 0;
-	if (data->primary_nxy <= 0 || data->primary_data == NULL)
-		{
-		XtSetArg(args[ac], XmNsensitive, False); ac++;
-		}
-	else
-		{
-		XtSetArg(args[ac], XmNsensitive, True); ac++;
-		}
-	XtSetValues(view->mb3dview.mbview_toggleButton_data_primary, args, ac);
-	XtSetValues(view->mb3dview.mbview_toggleButton_data_primaryslope, args, ac);
-	XtSetValues(view->mb3dview.mbview_toggleButton_histogram, args, ac);
-	XtSetValues(view->mb3dview.mbview_toggleButton_overlay_none, args, ac);
-	XtSetValues(view->mb3dview.mbview_toggleButton_overlay_illumination, args, ac);
-	XtSetValues(view->mb3dview.mbview_toggleButton_overlay_slope, args, ac);
-	XtSetValues(view->mb3dview.mbview_toggleButton_overlay_contour, args, ac);
-	XtSetValues(view->mb3dview.mbview_toggleButton_profile, args, ac);
-	XtSetValues(view->mb3dview.mbview_radioBox_slopemode, args, ac);
-	XtSetValues(view->mb3dview.mbview_toggleButton_slope_ctoh, args, ac);
-	XtSetValues(view->mb3dview.mbview_toggleButton_slope_htoc, args, ac);
-	XtSetValues(view->mb3dview.mbview_textField_slopemax, args, ac);
-	XtSetValues(view->mb3dview.mbview_textField_slopemin, args, ac);
-	XtSetValues(view->mb3dview.mbview_radioBox_colormode, args, ac);
-	XtSetValues(view->mb3dview.mbview_toggleButton_data_ctoh, args, ac);
-	XtSetValues(view->mb3dview.mbview_toggleButton_data_htoc, args, ac);
-	XtSetValues(view->mb3dview.mbview_textField_datamax, args, ac);
-	XtSetValues(view->mb3dview.mbview_textField_datamin, args, ac);
-	XtSetValues(view->mb3dview.mbview_textField_contours, args, ac);
-	XtSetValues(view->mb3dview.mbview_textField_slope_amp, args, ac);
-	XtSetValues(view->mb3dview.mbview_textField_illum_azi, args, ac);
-	XtSetValues(view->mb3dview.mbview_textField_illum_amp, args, ac);
-	XtSetValues(view->mb3dview.mbview_textField_illum_elev, args, ac);
-	XtSetValues(view->mb3dview.mbview_pushButton_shadeparms_apply, args, ac);
-	XtSetValues(view->mb3dview.mbview_textField_model_azimuth, args, ac);
-	XtSetValues(view->mb3dview.mbview_textField_model_elevation, args, ac);
-	XtSetValues(view->mb3dview.mbview_textField_model_3dzoom, args, ac);
-	XtSetValues(view->mb3dview.mbview_label_model_3dzoom, args, ac);
-	XtSetValues(view->mb3dview.mbview_textField_exageration, args, ac);
-	XtSetValues(view->mb3dview.mbview_textField_view_azimuth, args, ac);
-	XtSetValues(view->mb3dview.mbview_textField_view_elevation, args, ac);
-	XtSetValues(view->mb3dview.mbview_textField_view_3doffsetx, args, ac);
-	XtSetValues(view->mb3dview.mbview_textField_view_3doffsety, args, ac);
-	XtSetValues(view->mb3dview.mbview_textField_view_3dzoom, args, ac);
-	XtSetValues(view->mb3dview.mbview_pushButton_view_3d_apply, args, ac);
-	XtSetValues(view->mb3dview.mbview_textField_view_2doffsetx, args, ac);
-	XtSetValues(view->mb3dview.mbview_textField_view_2doffsety, args, ac);
-	XtSetValues(view->mb3dview.mbview_textField_view_2dzoom, args, ac);
-	XtSetValues(view->mb3dview.mbview_pushButton_view_2d_apply, args, ac);
-
-	ac = 0;
-	if (data->secondary_nxy <= 0 || data->secondary_data == NULL)
-		{
-		XtSetArg(args[ac], XmNsensitive, False); ac++;
-		}
-	else
-		{
-		XtSetArg(args[ac], XmNsensitive, True); ac++;
-		}
-	XtSetValues(view->mb3dview.mbview_toggleButton_data_secondary, args, ac);
-	XtSetValues(view->mb3dview.mbview_toggleButton_overlay_secondary, args, ac);
-	XtSetValues(view->mb3dview.mbview_radioBox_overlaymode, args, ac);
-	XtSetValues(view->mb3dview.mbview_toggleButton_overlay_ctoh, args, ac);
-	XtSetValues(view->mb3dview.mbview_toggleButton_overlay_htoc, args, ac);
-	XtSetValues(view->mb3dview.mbview_textField_overlaymax, args, ac);
-	XtSetValues(view->mb3dview.mbview_textField_overlaymin, args, ac);
-	XtSetValues(view->mb3dview.mbview_radioBox_overlay_shade, args, ac);
-	XtSetValues(view->mb3dview.mbview_toggleButton_overlay_shade_ctoh, args, ac);
-	XtSetValues(view->mb3dview.mbview_toggleButton_overlay_shade_htoc, args, ac);
-	XtSetValues(view->mb3dview.mbview_textField_overlay_amp, args, ac);
-	XtSetValues(view->mb3dview.mbview_textField_overlay_center, args, ac);
-
-	ac = 0;
-	if (shared.shareddata.site_mode == MBV_SITE_OFF)
-		{
-		XtSetArg(args[ac], XmNsensitive, False); ac++;
-		}
-	else
-		{
-		XtSetArg(args[ac], XmNsensitive, True); ac++;
-		}
-	XtSetValues(view->mb3dview.mbview_toggleButton_site, args, ac);
-	XtSetValues(view->mb3dview.mbview_toggleButton_mode_site, args, ac);
-	XtSetValues(view->mb3dview.mbview_toggleButton_mode_rsite, args, ac);
-	if (shared.shareddata.site_mode != MBV_SITE_EDIT)
-		{
-		set_mbview_label_string(view->mb3dview.mbview_toggleButton_mode_site, "Pick Sites");
-		set_mbview_label_string(view->mb3dview.mbview_toggleButton_mode_rsite, "Pick Sites");
-		}
-	else
-		{
-		set_mbview_label_string(view->mb3dview.mbview_toggleButton_mode_site, "Edit Sites");
-		set_mbview_label_string(view->mb3dview.mbview_toggleButton_mode_rsite, "Edit Sites");
-		}
-
-	ac = 0;
-	if (shared.shareddata.route_mode == MBV_ROUTE_OFF)
-		{
-		XtSetArg(args[ac], XmNsensitive, False); ac++;
-		}
-	else
-		{
-		XtSetArg(args[ac], XmNsensitive, True); ac++;
-		}
-	XtSetValues(view->mb3dview.mbview_toggleButton_route, args, ac);
-	XtSetValues(view->mb3dview.mbview_toggleButton_mode_route, args, ac);
-	XtSetValues(view->mb3dview.mbview_toggleButton_mode_rroute, args, ac);
-	if (shared.shareddata.route_mode != MBV_ROUTE_EDIT)
-		{
-		set_mbview_label_string(view->mb3dview.mbview_toggleButton_mode_route, "Pick Routes");
-		set_mbview_label_string(view->mb3dview.mbview_toggleButton_mode_rroute, "Pick Routes");
-		}
-	else
-		{
-		set_mbview_label_string(view->mb3dview.mbview_toggleButton_mode_route, "Edit Routes");
-		set_mbview_label_string(view->mb3dview.mbview_toggleButton_mode_rroute, "Edit Routes");
-		}
-
-	ac = 0;
-	if (shared.shareddata.nav_mode == MBV_NAV_OFF)
-		{
-		XtSetArg(args[ac], XmNsensitive, False); ac++;
-		}
-	else
-		{
-		XtSetArg(args[ac], XmNsensitive, True); ac++;
-		}
-	XtSetValues(view->mb3dview.mbview_toggleButton_nav, args, ac);
-	XtSetValues(view->mb3dview.mbview_toggleButton_navdrape, args, ac);
-	XtSetValues(view->mb3dview.mbview_toggleButton_mode_nav, args, ac);
-	XtSetValues(view->mb3dview.mbview_toggleButton_mode_rnav, args, ac);
-	XtSetValues(view->mb3dview.mbview_toggleButton_mode_navfile, args, ac);
-	XtSetValues(view->mb3dview.mbview_toggleButton_mode_rnavfile, args, ac);
-	set_mbview_label_string(view->mb3dview.mbview_toggleButton_mode_nav, "Pick Nav");
-	set_mbview_label_string(view->mb3dview.mbview_toggleButton_mode_rnav, "Pick Nav");
-	set_mbview_label_string(view->mb3dview.mbview_toggleButton_mode_navfile, "Pick Nav File");
-	set_mbview_label_string(view->mb3dview.mbview_toggleButton_mode_rnavfile, "Pick Nav File");
-
-	ac = 0;
-	if (shared.shareddata.vector_mode == MBV_VECTOR_OFF)
-		{
-		XtSetArg(args[ac], XmNsensitive, False); ac++;
-		}
-	else
-		{
-		XtSetArg(args[ac], XmNsensitive, True); ac++;
-		}
-	XtSetValues(view->mb3dview.mbview_toggleButton_vector, args, ac);
-
-	/* now set action buttons according to current pick states */
-	mbview_action_sensitivity(instance);
-
-	/* reset sensitivity in parent program */
-/* fprintf(stderr,"could call mbview_sensitivity_notify:%d\n",data->mbview_sensitivity_notify); */
-	if (data->mbview_sensitivity_notify != NULL)
-		(data->mbview_sensitivity_notify)();
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:        %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:       %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-
-/*------------------------------------------------------------------------------*/
-int mbview_action_sensitivityall()
-{
-	/* local variables */
-	char	*function_name = "mbview_action_sensitivityall";
-	int	status = MB_SUCCESS;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-	size_t	instance;
-
-	/* print starting debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       mbv_verbose:               %d\n", mbv_verbose);
-		}
-
-	/* set action sensitivity on all active instances */
-	for (instance=0;instance<MBV_MAX_WINDOWS;instance++)
-		{
-		/* get view */
-		view = &(mbviews[instance]);
-		data = &(view->data);
-
-		/* if instance active reset action sensitivity */
-		if (data->active == MB_YES)
-			mbview_action_sensitivity(instance);
-		}
-
-	/* print output debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:       %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-
-/*------------------------------------------------------------------------------*/
-int mbview_action_sensitivity(size_t instance)
-{
-	/* local variables */
-	char	*function_name = "mbview_action_sensitivity";
-	int	status = MB_SUCCESS;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-	int	mbview_allactive;
-	int	i, j;
-
-	/* print starting debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       mbv_verbose:               %d\n", mbv_verbose);
-		fprintf(stderr,"dbg2       instance:                  %zu\n", instance);
-		}
-
-	/* check if all available instances are active */
-	mbview_allactive = MB_YES;
-	for (i=0;i<MBV_MAX_WINDOWS;i++)
-		{
-		if (mbviews[i].data.active == MB_NO)
-			mbview_allactive = MB_NO;
-		}
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* now set action buttons according to current pick states */
-	for (i=0;i<view->naction;i++)
-		{
-		if (view->pushButton_action[i] != NULL)
-			{
-			ac = 0;
-			XtSetArg(args[ac], XmNsensitive, False);
-			if (view->actionsensitive[i] == MBV_PICKMASK_NONE)
-				{
-				XtSetArg(args[ac], XmNsensitive, True);
-				}
-			else if (view->actionsensitive[i] & MBV_PICKMASK_ONEPOINT
-				&& data->pick_type == MBV_PICK_ONEPOINT)
-				{
-				XtSetArg(args[ac], XmNsensitive, True);
-				}
-			else if (view->actionsensitive[i] & MBV_PICKMASK_TWOPOINT
-				&& data->pick_type == MBV_PICK_TWOPOINT)
-				{
-				XtSetArg(args[ac], XmNsensitive, True);
-				}
-			else if (view->actionsensitive[i] & MBV_PICKMASK_AREA
-				&& data->area_type == MBV_AREA_QUAD)
-				{
-				XtSetArg(args[ac], XmNsensitive, True);
-				}
-			else if (view->actionsensitive[i] & MBV_PICKMASK_REGION
-				&& data->region_type == MBV_REGION_QUAD)
-				{
-				XtSetArg(args[ac], XmNsensitive, True);
-				}
-			else if (view->actionsensitive[i] & MBV_PICKMASK_SITE
-				&& shared.shareddata.site_selected >= 0)
-				{
-				XtSetArg(args[ac], XmNsensitive, True);
-				}
-			else if (view->actionsensitive[i] & MBV_PICKMASK_ROUTE
-				&& shared.shareddata.route_selected >= 0)
-				{
-				XtSetArg(args[ac], XmNsensitive, True);
-				}
-			else if (view->actionsensitive[i] & MBV_PICKMASK_NAVONEPOINT
-				&& shared.shareddata.navpick_type == MBV_PICK_ONEPOINT)
-				{
-				XtSetArg(args[ac], XmNsensitive, True);
-				}
-			else if (view->actionsensitive[i] & MBV_PICKMASK_NAVTWOPOINT
-				&& shared.shareddata.navpick_type == MBV_PICK_TWOPOINT)
-				{
-				XtSetArg(args[ac], XmNsensitive, True);
-				}
-			else if (view->actionsensitive[i] & MBV_PICKMASK_NAVANY)
-				{
-				for (j=0;j<shared.shareddata.nnav;j++)
-					{
-					if (shared.shareddata.navs[j].nselected > 0)
-						XtSetArg(args[ac], XmNsensitive, True);
-					}
-				}
-			else if (view->actionsensitive[i] & MBV_EXISTMASK_SITE
-				&& shared.shareddata.nsite > 0)
-				{
-				XtSetArg(args[ac], XmNsensitive, True);
-				}
-			else if (view->actionsensitive[i] & MBV_EXISTMASK_ROUTE
-				&& shared.shareddata.nroute > 0)
-				{
-				XtSetArg(args[ac], XmNsensitive, True);
-				}
-			if (view->actionsensitive[i] & MBV_PICKMASK_NEWINSTANCE
-				&& mbview_allactive == MB_YES)
-				{
-				XtSetArg(args[ac], XmNsensitive, False);
-				}
-			ac++;
-			XtSetValues(view->pushButton_action[i], args, ac);
-			}
-		}
-
-	/* reset sensitivity in parent program */
-/* fprintf(stderr,"could call mbview_sensitivity_notify:%d\n",data->mbview_sensitivity_notify); */
-	if (data->mbview_sensitivity_notify != NULL)
-		(data->mbview_sensitivity_notify)();
-
-	/* print output debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:       %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-
-/*------------------------------------------------------------------------------*/
-int mbview_set_widgets(int verbose, size_t instance, int *error)
-{
-	/* local variables */
-	char	*function_name = "mbview_set_widgets";
-	int	status = MB_SUCCESS;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-
-	/* print starting debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:         %d\n",verbose);
-		fprintf(stderr,"dbg2       instance:        %zu\n",instance);
-		}
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-    	/* check for spheroid projection */
-	if (data->display_projection_mode == MBV_PROJECTION_SPHEROID)
-		{
-		data->display_mode = MBV_DISPLAY_3D;
-		}
-
-	/* set widgets */
-	set_mbview_display_mode(instance, data->display_mode);
-	set_mbview_mouse_mode(instance, data->mouse_mode);
-	set_mbview_grid_mode(instance, data->grid_mode);
-	if (data->grid_mode == MBV_GRID_VIEW_PRIMARY)
-		{
-		set_mbview_histogram_mode(instance, data->primary_histogram);
-		}
-	else if (data->grid_mode == MBV_GRID_VIEW_PRIMARYSLOPE)
-		{
-		set_mbview_histogram_mode(instance, data->primaryslope_histogram);
-		}
-	else if (data->grid_mode == MBV_GRID_VIEW_SECONDARY)
-		{
-		set_mbview_histogram_mode(instance, data->secondary_histogram);
-		}
-	set_mbview_contour_mode(instance, data->grid_contour_mode);
-	set_mbview_site_view_mode(instance, data->site_view_mode);
-	set_mbview_route_view_mode(instance, data->route_view_mode);
-	set_mbview_nav_view_mode(instance, data->nav_view_mode);
-	set_mbview_navdrape_view_mode(instance, data->navdrape_view_mode);
-	set_mbview_vector_view_mode(instance, data->vector_view_mode);
-	if (data->grid_mode == MBV_GRID_VIEW_PRIMARY)
-		{
-		set_mbview_colortable(instance, data->primary_colortable);
-		set_mbview_colortable_mode(instance, data->primary_colortable_mode);
-		set_mbview_shade_mode(instance, data->primary_shade_mode);
-		}
-	else if (data->grid_mode == MBV_GRID_VIEW_PRIMARYSLOPE)
-		{
-		set_mbview_colortable(instance, data->slope_colortable);
-		set_mbview_colortable_mode(instance, data->slope_colortable_mode);
-		set_mbview_shade_mode(instance, data->slope_shade_mode);
-		}
-	else if (data->grid_mode == MBV_GRID_VIEW_SECONDARY)
-		{
-		set_mbview_colortable(instance, data->secondary_colortable);
-		set_mbview_colortable_mode(instance, data->secondary_colortable_mode);
-		set_mbview_shade_mode(instance, data->secondary_shade_mode);
-		}
-
-	/* reset if mouse radiobox controls are visible or not */
-	if (data->height > MBV_WINDOW_HEIGHT_THRESHOLD)
-	    {
-	    XtManageChild(view->mb3dview.mbview_radioBox_mouse);
-	    }
-	else
-	    {
-	    XtUnmanageChild(view->mb3dview.mbview_radioBox_mouse);
-	    }
-
-	/* set pick annotation */
-	mbview_pick_text(instance);
-
-	/* set projection label */
-	do_mbview_set_projection_label(instance);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:        %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-
-/*------------------------------------------------------------------------------*/
-int mbview_addaction(int verbose, size_t instance,
-			void	(mbview_action_notify)(Widget, XtPointer, XtPointer),
-			char	*label,
-			int	sensitive,
-			int *error)
-{
-	/* local variables */
-	char	*function_name = "mbview_addaction";
-	int	status = MB_SUCCESS;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-        Cardinal ac = 0;
-        Arg      args[256];
-       Boolean  argok = False;
-        XmString    tmp0;
-
-	/* print starting debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:              %d\n",verbose);
-		fprintf(stderr,"dbg2       instance:             %zu\n",instance);
-		fprintf(stderr,"dbg2       mbview_action_notify: %p\n",mbview_action_notify);
-		fprintf(stderr,"dbg2       label:                %s\n",label);
-		fprintf(stderr,"dbg2       sensitive:            %d\n",sensitive);
-		}
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* add pushbutton to action menu */
-    	ac = 0;
-        tmp0 = (XmString) BX_CONVERT(view->mb3dview.mbview_pulldownMenu_action, label,
-                XmRXmString, 0, &argok);
-        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-        XtSetArg(args[ac], XmNfontList,
-            BX_CONVERT(view->mb3dview.mbview_pulldownMenu_action, "-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
-            XmRFontList, 0, &argok)); if (argok) ac++;
-	XtSetArg(args[ac], XmNuserData, (XtPointer)instance); ac++;
-        view->pushButton_action[view->naction] = (Widget) XmCreatePushButton(view->mb3dview.mbview_pulldownMenu_action,
-            label,
-            args,
-            ac);
-	view->actionsensitive[view->naction] = sensitive;
-        XmStringFree((XmString)tmp0);
-        XtManageChild(view->pushButton_action[view->naction]);
-	XtAddCallback(view->pushButton_action[view->naction], XmNactivateCallback, mbview_action_notify, (XtPointer)instance);
-	view->naction++;
-
-	/* now set action buttons according to current pick states */
-	mbview_action_sensitivity(instance);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:        %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-
-/*------------------------------------------------------------------------------*/
-int mbview_addpicknotify(int verbose, size_t instance,
-			int	picktype,
-			void	(mbview_pick_notify)(size_t),
-			int *error)
-{
-	/* local variables */
-	char	*function_name = "mbview_addpicknotify";
-	int	status = MB_SUCCESS;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-
-	/* print starting debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:              %d\n",verbose);
-		fprintf(stderr,"dbg2       instance:             %zu\n",instance);
-		fprintf(stderr,"dbg2       picktype:             %d\n",picktype);
-		fprintf(stderr,"dbg2       mbview_pick_notify:   %p\n",mbview_pick_notify);
-		}
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* set the pick notify function */
-	if (picktype == MBV_PICK_ONEPOINT)
-		{
-		data->mbview_pickonepoint_notify = mbview_pick_notify;
-		}
-	else if (picktype == MBV_PICK_TWOPOINT)
-		{
-		data->mbview_picktwopoint_notify = mbview_pick_notify;
-		}
-	else if (picktype == MBV_PICK_AREA)
-		{
-		data->mbview_pickarea_notify = mbview_pick_notify;
-		}
-	else if (picktype == MBV_PICK_REGION)
-		{
-		data->mbview_pickregion_notify = mbview_pick_notify;
-		}
-	else if (picktype == MBV_PICK_SITE)
-		{
-		data->mbview_picksite_notify = mbview_pick_notify;
-		}
-	else if (picktype == MBV_PICK_ROUTE)
-		{
-		data->mbview_pickroute_notify = mbview_pick_notify;
-		}
-	else if (picktype == MBV_PICK_NAV)
-		{
-		data->mbview_picknav_notify = mbview_pick_notify;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:        %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-
-
-/*------------------------------------------------------------------------------*/
-int mbview_setsensitivitynotify(int verbose, size_t instance,
-			void	(mbview_sensitivity_notify)(),
-			int *error)
-{
-	/* local variables */
-	char	*function_name = "mbview_setsensitivitynotify";
-	int	status = MB_SUCCESS;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-
-	/* print starting debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:                   %d\n",verbose);
-		fprintf(stderr,"dbg2       instance:                  %zu\n",instance);
-		fprintf(stderr,"dbg2       mbview_sensitivity_notify: %p\n",mbview_sensitivity_notify);
-		}
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* set the pick notify function */
-	data->mbview_sensitivity_notify = mbview_sensitivity_notify;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:        %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-
-/*------------------------------------------------------------------------------*/
-void
-mbview_resize( Widget w, XtPointer client_data, XEvent *event, Boolean *unused)
-{
-	size_t	instance;
-	Dimension	width;
-	Dimension	height;
-	XConfigureEvent *cevent = (XConfigureEvent *) event;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-
-	/* do this only if a resize event happens */
-	if (cevent->type == ConfigureNotify)
-	    {
-	    /* get view */
-	    instance = (size_t)client_data;
-	    view = &(mbviews[instance]);
-	    data = &(view->data);
-
-	    /* get new shell size */
-	    XtVaGetValues(view->topLevelShell,
-	    	XmNwidth, &width,
-	    	XmNheight, &height,
-	   	NULL);
-
-	    /* do this only if the shell was REALLY resized and not just moved */
-	    if (data->width != width - LEFT_WIDTH
-	    	|| data->height != height - LEFT_HEIGHT)
-	    	{
-/*fprintf(stderr,"mbview_resize: %d %d instance: %d\n",
-width, height, instance);*/
-
-		/* set drawing area size */
-		data->width = width - LEFT_WIDTH;
-		data->height = height - LEFT_HEIGHT;
-		ac = 0;
-		XtSetArg(args[ac], XmNwidth, data->width); ac++;
-		XtSetArg(args[ac], XmNheight, data->height); ac++;
-		XtSetValues(view->mb3dview.mbview_drawingArea_mbview, args, ac);
-/*fprintf(stderr,"mbviews[%d].mb3dview.mbview_drawingArea_mbview: %d %d\n",
-instance, data->width, data->height);*/
-
-		/* set glwda size */
-		ac = 0;
-		XtSetArg(args[ac], XmNwidth, data->width); ac++;
-		XtSetArg(args[ac], XmNheight, data->height); ac++;
-		XtSetValues(view->glwmda, args, ac);
-/*fprintf(stderr,"mbviews[%d].glwmda: %d %d\n\n",
-instance, data->width, data->height);*/
-
-		/* update the gl drawing context */
-		mbview_reset_glx(instance);
-
-		/* reset if mouse radiobox controls are visible or not */
-		if (data->height > MBV_WINDOW_HEIGHT_THRESHOLD)
-		    {
-		    XtManageChild(view->mb3dview.mbview_radioBox_mouse);
-		    }
-		else
-		    {
-		    XtUnmanageChild(view->mb3dview.mbview_radioBox_mouse);
-		    }
-
-		/* draw */
-if (mbv_verbose >= 2)
-fprintf(stderr,"Calling mbview_plotlowhigh from mbview_resize\n");
-		mbview_plotlowhigh(instance);
-
-	    	}
-	    }
-}
-/*------------------------------------------------------------------------------*/
-void
-do_mbview_projection_popup( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-	size_t	instance;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-
-	/* get instance */
-	ac = 0;
-	XtSetArg(args[ac], XmNuserData, (XtPointer) &instance); ac++;
-	XtGetValues(w, args, ac);
-
-fprintf(stderr,"do_mbview_projection_popup: instance:%zu\n", instance);
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-    	XtManageChild(view->mb3dview.mbview_bulletinBoard_projection);
-
-	/* set values of widgets */
-	if (data->display_projection_mode == MBV_PROJECTION_GEOGRAPHIC)
-		{
-	    	XmToggleButtonSetState(view->mb3dview.mbview_toggleButton_geographic,
-			TRUE, FALSE);
-		XmToggleButtonSetState(view->mb3dview.mbview_toggleButton_utm,
-			FALSE, FALSE);
-		XmToggleButtonSetState(view->mb3dview.mbview_toggleButton_spheroid,
-			FALSE, FALSE);
-		}
-	else if (data->display_projection_mode == MBV_PROJECTION_PROJECTED
-		|| data->display_projection_mode == MBV_PROJECTION_ALREADYPROJECTED)
-		{
-		XmToggleButtonSetState(view->mb3dview.mbview_toggleButton_geographic,
-			FALSE, FALSE);
-	    	XmToggleButtonSetState(view->mb3dview.mbview_toggleButton_utm,
-			TRUE, FALSE);
-		XmToggleButtonSetState(view->mb3dview.mbview_toggleButton_spheroid,
-			FALSE, FALSE);
-		}
-	else if (data->display_projection_mode == MBV_PROJECTION_SPHEROID)
-		{
-	    	XmToggleButtonSetState(view->mb3dview.mbview_toggleButton_spheroid,
-			TRUE, FALSE);
-		XmToggleButtonSetState(view->mb3dview.mbview_toggleButton_utm,
-			FALSE, FALSE);
-		XmToggleButtonSetState(view->mb3dview.mbview_toggleButton_spheroid,
-			FALSE, FALSE);
-		}
-
-	/* set label */
-	do_mbview_set_projection_label(instance);
-
-}
-
-
-/*------------------------------------------------------------------------------*/
-void
-do_mbview_set_projection_label(size_t instance)
-{
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-	int	projectionid;
-	mb_path	tmptext;
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* set projection label */
-	sprintf(value_text,":::t\"Primary Grid Projection:\"");
-	if (data->primary_grid_projection_mode == MBV_PROJECTION_GEOGRAPHIC)
-		{
-		strcat(value_text, ":t\"  Geographic\"");
-		}
-	else if (data->primary_grid_projection_mode == MBV_PROJECTION_PROJECTED
-		|| data->primary_grid_projection_mode == MBV_PROJECTION_ALREADYPROJECTED)
-		{
-		if (sscanf(data->primary_grid_projection_id, "epsg%d", &projectionid) == 1
-			&& projectionid == 32661)
-			{
-			sprintf(tmptext,":t\"  Projected: %s\":t\"    North Polar Steographic\"",
-				data->secondary_grid_projection_id);
-			strcat(value_text, tmptext);
-			}
-		else if (sscanf(data->primary_grid_projection_id, "epsg%d", &projectionid) == 1
-			&& projectionid == 32761)
-			{
-			sprintf(tmptext,":t\"  Projected: %s\":t\"    South Polar Steographic\"",
-				data->secondary_grid_projection_id);
-			strcat(value_text, tmptext);
-			}
-		else if (sscanf(data->primary_grid_projection_id, "epsg%d", &projectionid) == 1
-			&& projectionid >= 32600 && projectionid < 32700)
-			{
-			sprintf(tmptext,":t\"  Projected: %s\":t\"    UTM Zone %d N\"",
-				data->primary_grid_projection_id,
-				projectionid - 32600);
-			strcat(value_text, tmptext);
-			}
-		else if (sscanf(data->primary_grid_projection_id, "epsg%d", &projectionid) == 1
-			&& projectionid >= 32700 && projectionid < 32800)
-			{
-			sprintf(tmptext,":t\"  Projected: %s\":t\"    UTM Zone %d S\"",
-				data->primary_grid_projection_id,
-				projectionid - 32700);
-			strcat(value_text, tmptext);
-			}
-		else
-			{
-			sprintf(tmptext,":t\"  Projected: %s\"", data->primary_grid_projection_id);
-			strcat(value_text, tmptext);
-			}
-		}
-	else if (data->primary_grid_projection_mode == MBV_PROJECTION_SPHEROID)
-		{
-		strcat(value_text, ":t\"  Spheroid\"");
-		}
-
-	if (data->secondary_nxy > 0)
-		{
-		strcat(value_text,":t\"Secondary Grid Projection:\"");
-		if (data->secondary_grid_projection_mode == MBV_PROJECTION_GEOGRAPHIC)
-			{
-			strcat(value_text, ":t\"  Geographic\"");
-			}
-		else if (data->secondary_grid_projection_mode == MBV_PROJECTION_PROJECTED
-			|| data->secondary_grid_projection_mode == MBV_PROJECTION_ALREADYPROJECTED)
-			{
-			if (sscanf(data->secondary_grid_projection_id, "epsg%d", &projectionid) == 1
-				&& projectionid == 32661)
-				{
-				sprintf(tmptext,":t\"  Projected: %s\":t\"    North Polar Steographic\"",
-					data->secondary_grid_projection_id);
-				strcat(value_text, tmptext);
-				}
-			else if (sscanf(data->secondary_grid_projection_id, "epsg%d", &projectionid) == 1
-				&& projectionid == 32761)
-				{
-				sprintf(tmptext,":t\"  Projected: %s\":t\"    South Polar Steographic\"",
-					data->secondary_grid_projection_id);
-				strcat(value_text, tmptext);
-				}
-			else if (sscanf(data->secondary_grid_projection_id, "epsg%d", &projectionid) == 1
-				&& projectionid >= 32600 && projectionid < 32700)
-				{
-				sprintf(tmptext,":t\"  Projected: %s\":t\"    UTM Zone %d N\"",
-					data->secondary_grid_projection_id,
-					projectionid - 32600);
-				strcat(value_text, tmptext);
-				}
-			else if (sscanf(data->secondary_grid_projection_id, "epsg%d", &projectionid) == 1
-				&& projectionid >= 32700 && projectionid < 32800)
-				{
-				sprintf(tmptext,":t\"  Projected: %s\":t\"    UTM Zone %d S\"",
-					data->secondary_grid_projection_id,
-					projectionid - 32700);
-				strcat(value_text, tmptext);
-				}
-			else
-				{
-				sprintf(tmptext,":t\"  Projected: %s\"", data->secondary_grid_projection_id);
-				strcat(value_text, tmptext);
-				}
-			}
-		else if (data->secondary_grid_projection_mode == MBV_PROJECTION_SPHEROID)
-			{
-			strcat(value_text, ":t\"  Spheroid\"");
-			}
-		}
-
-	strcat(value_text,":t\"Display Grid Projection:\"");
-	if (data->display_projection_mode == MBV_PROJECTION_GEOGRAPHIC)
-		{
-		strcat(value_text, ":t\"  Geographic\"");
-		}
-	else if (data->display_projection_mode == MBV_PROJECTION_PROJECTED
-		|| data->display_projection_mode == MBV_PROJECTION_ALREADYPROJECTED)
-		{
-		if (sscanf(data->display_projection_id, "epsg%d", &projectionid) == 1
-			&& projectionid == 32661)
-			{
-			sprintf(tmptext,":t\"  Projected: %s\":t\"    North Polar Steographic\"",
-				data->secondary_grid_projection_id);
-			strcat(value_text, tmptext);
-			}
-		else if (sscanf(data->display_projection_id, "epsg%d", &projectionid) == 1
-			&& projectionid == 32761)
-			{
-			sprintf(tmptext,":t\"  Projected: %s\":t\"    South Polar Steographic\"",
-				data->secondary_grid_projection_id);
-			strcat(value_text, tmptext);
-			}
-		else if (sscanf(data->display_projection_id, "epsg%d", &projectionid) == 1
-			&& projectionid >= 32600 && projectionid < 32700)
-			{
-			sprintf(tmptext,":t\"  Projected: %s\":t\"    UTM Zone %d N",
-				data->display_projection_id,
-				projectionid - 32600);
-			strcat(value_text, tmptext);
-			}
-		else if (sscanf(data->display_projection_id, "epsg%d", &projectionid) == 1
-			&& projectionid >= 32700 && projectionid < 32800)
-			{
-			sprintf(tmptext,":t\"  Projected: %s\":t\"    UTM Zone %d S\"",
-				data->display_projection_id,
-				projectionid - 32700);
-			strcat(value_text, tmptext);
-			}
-		else
-			{
-			sprintf(tmptext,":t\"  Projected: %s\"", data->display_projection_id);
-			strcat(value_text, tmptext);
-			}
-		}
-	else if (data->display_projection_mode == MBV_PROJECTION_SPHEROID)
-		{
-		strcat(value_text, ":t\"  Spheroid\"");
-		}
-        set_mbview_label_multiline_string(view->mb3dview.mbview_label_projection, value_text);
-
-}
-
-
-/*------------------------------------------------------------------------------*/
-void
-do_mbview_projection_popdown( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-	size_t	instance;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-
-	/* get instance */
-	ac = 0;
-	XtSetArg(args[ac], XmNuserData, (XtPointer) &instance); ac++;
-	XtGetValues(w, args, ac);
-
-if (mbv_verbose >= 0)
-fprintf(stderr,"do_mbview_projection_popdown: instance:%zu\n", instance);
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-    	XtUnmanageChild(view->mb3dview.mbview_bulletinBoard_projection);
-}
-
-/*------------------------------------------------------------------------------*/
-void
-do_mbview_display_spheroid( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-	size_t	instance;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-
-	/* get instance */
-	ac = 0;
-	XtSetArg(args[ac], XmNuserData, (XtPointer) &instance); ac++;
-	XtGetValues(w, args, ac);
-
-fprintf(stderr,"do_mbview_display_spheroid: instance:%zu\n", instance);
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* reproject as spheroid if the togglebutton has been set */
-	if (XmToggleButtonGetState(view->mb3dview.mbview_toggleButton_spheroid))
-		{
-		data->display_projection_mode = MBV_PROJECTION_SPHEROID;
-		view->plot_done = MB_NO;
-		view->projected = MB_NO;
-		view->globalprojected = MB_NO;
-		view->viewboundscount = MBV_BOUNDSFREQUENCY;
-
-		/* set label */
-		do_mbview_set_projection_label(instance);
-
-		/* clear zscale for grid */
-		mbview_zscaleclear(instance);
-
-		/* project and scale data other than the grid */
-		mbview_zscale(instance);
-
-		/* draw */
-fprintf(stderr,"Calling mbview_plotlowhigh from do_mbview_display_spheroid\n");
-		mbview_plotlowhigh(instance);
-		}
-}
-/*------------------------------------------------------------------------------*/
-
-void
-do_mbview_display_geographic( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-	size_t	instance;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-
-	/* get instance */
-	ac = 0;
-	XtSetArg(args[ac], XmNuserData, (XtPointer) &instance); ac++;
-	XtGetValues(w, args, ac);
-
-fprintf(stderr,"do_mbview_display_geographic: instance:%zu\n", instance);
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* reproject as geographic if the togglebutton has been set */
-	if (XmToggleButtonGetState(view->mb3dview.mbview_toggleButton_geographic))
-		{
-		data->display_projection_mode = MBV_PROJECTION_GEOGRAPHIC;
-		view->plot_done = MB_NO;
-		view->projected = MB_NO;
-		view->globalprojected = MB_NO;
-		view->viewboundscount = MBV_BOUNDSFREQUENCY;
-
-		/* set label */
-		do_mbview_set_projection_label(instance);
-
-		/* clear zscale for grid */
-		mbview_zscaleclear(instance);
-
-		/* project and scale data other than the grid */
-		mbview_zscale(instance);
-
-		/* draw */
-fprintf(stderr,"Calling mbview_plotlowhigh from do_mbview_display_geographic\n");
-		mbview_plotlowhigh(instance);
-		}
-}
-
-
-/*------------------------------------------------------------------------------*/
-void
-do_mbview_display_utm( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-	size_t	instance;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-	int	projectionid, utmzone;
-	double	reference_lon;
-	double	reference_lat;
-
-	/* get instance */
-	ac = 0;
-	XtSetArg(args[ac], XmNuserData, (XtPointer) &instance); ac++;
-	XtGetValues(w, args, ac);
-
-fprintf(stderr,"do_mbview_display_utm: instance:%zu\n", instance);
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* reproject as utm if the togglebutton has been set */
-	if (XmToggleButtonGetState(view->mb3dview.mbview_toggleButton_utm))
-		{
-		data->display_projection_mode = MBV_PROJECTION_PROJECTED;
-		view->plot_done = MB_NO;
-		view->projected = MB_NO;
-		view->globalprojected = MB_NO;
-		view->viewboundscount = MBV_BOUNDSFREQUENCY;
-
-		mbview_projectgrid2ll(instance,
-				0.5 * (data->primary_xmin + data->primary_xmax),
-				0.5 * (data->primary_ymin + data->primary_ymax),
-				&reference_lon, &reference_lat);
-		if (reference_lon > 180.0)
-			reference_lon -= 360.0;
-		utmzone = (int)(((reference_lon + 183.0)
-				/ 6.0) + 0.5);
-		if (reference_lat >= 0.0)
-			projectionid = 32600 + utmzone;
-		else
-			projectionid = 32700 + utmzone;
-		sprintf(data->display_projection_id, "epsg%d", projectionid);
-
-		/* set label */
-		do_mbview_set_projection_label(instance);
-
-		/* clear zscale for grid */
-		mbview_zscaleclear(instance);
-
-		/* project and scale data other than the grid */
-		mbview_zscale(instance);
-
-		/* draw */
-fprintf(stderr,"Calling mbview_plotlowhigh from do_mbview_display_utm\n");
-		mbview_plotlowhigh(instance);
-		}
-}
-
-/*------------------------------------------------------------------------------*/
-
-void
-do_mbview_glwda_expose( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    mbGLwDrawingAreaCallbackStruct *acs;
-    acs = (mbGLwDrawingAreaCallbackStruct*)call_data;
-	size_t	instance;
-
-    	ac = 0;
-    XtSetArg(args[ac], XmNuserData, (XtPointer) &instance); ac++;
-    XtGetValues(w, args, ac);
-
-	    /* draw */
-if (mbv_verbose >= 2)
-fprintf(stderr,"Calling mbview_plotlowhigh from do_mbview_glwda_expose\n");
-		mbview_plotlowhigh(instance);
-}
-/*------------------------------------------------------------------------------*/
-
-void
-do_mbview_glwda_resize( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    mbGLwDrawingAreaCallbackStruct *acs;
-    acs = (mbGLwDrawingAreaCallbackStruct*)call_data;
-	size_t	instance;
-
-    	ac = 0;
-    XtSetArg(args[ac], XmNuserData, (XtPointer) &instance); ac++;
-    XtGetValues(w, args, ac);
-}
-/*------------------------------------------------------------------------------*/
-
-void
-do_mbview_glwda_input( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    mbGLwDrawingAreaCallbackStruct *acs;
-    acs = (mbGLwDrawingAreaCallbackStruct*)call_data;
-	size_t	instance;
-	XEvent  *event;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-	KeySym keysym;
-	char buffer[1];
-	int actual;
-	int shade_mode;
-	int replotall;
-	int replotprofile;
-
-    /* get instance */
-    ac = 0;
-    XtSetArg(args[ac], XmNuserData, (XtPointer) &instance); ac++;
-    XtGetValues(w, args, ac);
-
-    acs = (mbGLwDrawingAreaCallbackStruct*)call_data;
-
-    /* get view */
-    view = &(mbviews[instance]);
-    data = &(view->data);
-
-    /* set replotall to MB_NO */
-    replotall = MB_NO;
-
-    /* set replotprofile to MB_NO */
-    replotprofile = MB_NO;
-
-    /* get event */
-    acs = (mbGLwDrawingAreaCallbackStruct*)call_data;
-    event = acs->event;
-
-if (mbv_verbose >= 2)
-fprintf(stderr,"do_mbview_glwda_input: %d %d  instance:%zu type:%d\n",
-acs->width, acs->height, instance, event->xany.type);
-
-    /* If there is input in the drawing area and the drawing area is still initialized */
-    if (acs->reason == XmCR_INPUT && view->init != MBV_WINDOW_NULL)
-    {
-
-      /* Check for mouse pressed. */
-      if (event->xany.type == ButtonPress)
-      {
-/*fprintf(stderr, "event->xany.type == ButtonPress  %d %d  mouse mode:%d\n",
-event->xbutton.x,event->xbutton.y, data->mouse_mode);*/
-	  /* save location */
-	  view->button_down_x = event->xbutton.x;
-	  view->button_down_y = event->xbutton.y;
-
-	  /* If left mouse button is pushed */
-	  if (event->xbutton.button == 1)
-		{
-		/* set button1down flag */
-		view->button1down = MB_YES;
-
-		/* handle move */
-		if (data->mouse_mode == MBV_MOUSE_MOVE
-		    || data->mouse_mode == MBV_MOUSE_ROTATE
-		    || data->mouse_mode == MBV_MOUSE_SHADE
-		    || data->mouse_mode == MBV_MOUSE_VIEWPOINT
-		    || data->mouse_mode == MBV_MOUSE_NAV
-		    || data->mouse_mode == MBV_MOUSE_NAVFILE)
-		    {
-		    /* set cursor for pick */
-		    XDefineCursor(view->dpy,view->xid,view->TargetRedCursor);
-
-		    /* process pick */
-		    mbview_pick(instance, MBV_PICK_DOWN,
-				    view->button_down_x,
-				    data->height - view->button_down_y);
-
-		    /* set replotprofile */
-		    replotprofile = MB_YES;
-
-		    /* replot */
-		    mbview_plotlow(instance);
-		    }
-
-		/* handle region picking */
-		else if (data->mouse_mode == MBV_MOUSE_AREA)
-		    {
-		    /* set cursor for area */
-		    XDefineCursor(view->dpy,view->xid,view->TargetRedCursor);
-
-		    /* process area */
-		    mbview_region(instance, MBV_REGION_DOWN,
-				    view->button_down_x,
-				    data->height - view->button_down_y);
-
-		    /* replot */
-		    mbview_plotlow(instance);
-		    }
-
-		/* handle editing sites */
-		else if (data->mouse_mode == MBV_MOUSE_SITE)
-		    {
-		    /* set cursor for site */
-		    XDefineCursor(view->dpy,view->xid,view->TargetRedCursor);
-
-		    /* process site select */
-		    mbview_pick_site_select(instance, MBV_PICK_DOWN,
-				    view->button_down_x,
-				    data->height - view->button_down_y);
-
-		    /* set replotall */
-		    replotall = MB_YES;
-
-		    /* replot */
-		    mbview_plotlow(instance);
-		    }
-
-		/* handle editing routes */
-		else if (data->mouse_mode == MBV_MOUSE_ROUTE)
-		    {
-		    /* set cursor for route */
-		    XDefineCursor(view->dpy,view->xid,view->TargetRedCursor);
-
-		    /* process route select */
-		    mbview_pick_route_select(instance, MBV_PICK_DOWN,
-				    view->button_down_x,
-				    data->height - view->button_down_y);
-
-		    /* set replotall */
-		    replotall = MB_YES;
-
-		    /* set replotprofile */
-		    replotprofile = MB_YES;
-
-		    /* replot */
-		    mbview_plotlow(instance);
-		    }
-
-		} /* end of left button events */
-
-	   /* If middle mouse button is pushed */
-	   else if (event->xbutton.button == 2)
-		{
-		/* set button2down flag */
-		view->button2down = MB_YES;
-
-		/* handle move */
-		if (data->mouse_mode == MBV_MOUSE_MOVE)
-		    {
-		    /* set cursor for move */
-		    XDefineCursor(view->dpy,view->xid,view->FleurBlackCursor);
-
-		    /* save starting position offsets */
-		    if (data->display_mode == MBV_DISPLAY_2D)
-			    {
-			    view->offset2d_x_save = view->offset2d_x;
-			    view->offset2d_y_save = view->offset2d_y;
-			    }
-		    else
-			    {
-			    view->offset3d_x_save = view->offset3d_x;
-			    view->offset3d_y_save = view->offset3d_y;
-			    }
-		    }
-
-		/* handle 3D rotate */
-		else if (data->mouse_mode == MBV_MOUSE_ROTATE)
-		    {
-		    /* set cursor for rotate */
-		    XDefineCursor(view->dpy,view->xid,view->FleurBlackCursor);
-
-		    view->modelazimuth3d_save = data->modelazimuth3d;
-		    view->modelelevation3d_save = data->modelelevation3d;
-		    }
-
-		/* handle shading */
-		else if (data->mouse_mode == MBV_MOUSE_SHADE)
-		    {
-		    /* get shade mode */
-		    if (data->grid_mode == MBV_GRID_VIEW_PRIMARY)
-		    	shade_mode = data->primary_shade_mode;
-		    else if (data->grid_mode == MBV_GRID_VIEW_PRIMARYSLOPE)
-		    	shade_mode = data->slope_shade_mode;
-		    else /* if (data->grid_mode == MBV_GRID_VIEW_SECONDARY) */
-		    	shade_mode = data->secondary_shade_mode;
-
-		    /* handle shading by illumination */
-		    if (shade_mode == MBV_SHADE_VIEW_ILLUMINATION)
-		    	{
-			/* set cursor for shade */
-			XDefineCursor(view->dpy,view->xid,view->FleurBlackCursor);
-
-			view->illuminate_azimuth_save = data->illuminate_azimuth;
-			view->illuminate_elevation_save = data->illuminate_elevation;
-			}
-
-		    /* handle shading by overlay */
-		    else if (shade_mode == MBV_SHADE_VIEW_SLOPE)
-			{
-			/* set cursor for shade */
-			XDefineCursor(view->dpy,view->xid,view->FleurBlackCursor);
-			}
-
-		    /* handle shading by overlay */
-		    else if (shade_mode == MBV_SHADE_VIEW_OVERLAY)
-			{
-			/* set cursor for shade */
-			XDefineCursor(view->dpy,view->xid,view->FleurBlackCursor);
-			}
-		    }
-
-		/* handle viewpoint rotation */
-		else if (data->mouse_mode == MBV_MOUSE_VIEWPOINT)
-		    {
-		    /* set cursor for rotate */
-		    XDefineCursor(view->dpy,view->xid,view->FleurBlackCursor);
-
-		    view->viewazimuth3d_save = data->viewazimuth3d;
-		    view->viewelevation3d_save = data->viewelevation3d;
-		    }
-
-		/* handle area picking */
-		else if (data->mouse_mode == MBV_MOUSE_AREA)
-		    {
-		    /* set cursor for area */
-		    XDefineCursor(view->dpy,view->xid,view->TargetRedCursor);
-
-		    /* process area */
-		    mbview_area(instance, MBV_AREALENGTH_DOWN,
-				    view->button_down_x,
-				    data->height - view->button_down_y);
-
-		    /* replot */
-		    mbview_plotlow(instance);
-		    }
-
-		/* handle editing sites */
-		else if (data->mouse_mode == MBV_MOUSE_SITE)
-		    {
-		    /* set cursor for site */
-		    XDefineCursor(view->dpy,view->xid,view->TargetRedCursor);
-
-		    /* process site select */
-		    mbview_pick_site_add(instance, MBV_PICK_DOWN,
-				    view->button_down_x,
-				    data->height - view->button_down_y);
-
-		    /* set replotall */
-		    replotall = MB_YES;
-
-		    /* replot */
-		    mbview_plotlow(instance);
-		    }
-
-		/* handle editing routes */
-		else if (data->mouse_mode == MBV_MOUSE_ROUTE)
-		    {
-		    /* set cursor for route */
-		    XDefineCursor(view->dpy,view->xid,view->TargetRedCursor);
-
-		    /* process route select */
-		    mbview_pick_route_add(instance, MBV_PICK_DOWN,
-				    view->button_down_x,
-				    data->height - view->button_down_y);
-
-		    /* set replotall */
-		    replotall = MB_YES;
-
-		    /* set replotprofile */
-		    replotprofile = MB_YES;
-
-		    /* replot */
-		    mbview_plotlow(instance);
-		    }
-
-		/* handle selecting navigation */
-		else if (data->mouse_mode == MBV_MOUSE_NAV || data->mouse_mode == MBV_MOUSE_NAVFILE)
-		    {
-		    /* set cursor for nav */
-		    XDefineCursor(view->dpy,view->xid,view->TargetRedCursor);
-
-		    /* process nav select */
-		    mbview_pick_nav_select(instance, MB_YES, MBV_PICK_DOWN,
-				    view->button_down_x,
-				    data->height - view->button_down_y);
-
-		    /* set replotall */
-		    replotall = MB_YES;
-
-		    /* replot */
-		    mbview_plotlow(instance);
-		    }
-
-		} /* end of middle button events */
-
-	   /* If right mouse button is pushed */
-	   else if (event->xbutton.button == 3)
-		{
-		/* set button3down flag */
-		view->button3down = MB_YES;
-
-		/* change the map scaling */
-		if (data->mouse_mode == MBV_MOUSE_MOVE)
-		    {
-		    /* set cursor for scaling */
-		    XDefineCursor(view->dpy,view->xid,view->SizingBlackCursor);
-
-		    /* save starting size */
-		    if (data->display_mode == MBV_DISPLAY_2D)
-			    {
-			    view->size2d_save = view->size2d;
-			    }
-		    else
-			    {
-			    view->offset3d_z_save = view->offset3d_z;
-			    }
-		    }
-
-		/* handle vertical exagerate */
-		else if (data->mouse_mode == MBV_MOUSE_ROTATE)
-		    {
-		    /* set cursor for exagerate */
-		    XDefineCursor(view->dpy,view->xid,view->FleurBlackCursor);
-
-		    view->exageration_save = data->exageration;
-		    }
-
-		/* handle shading */
-		else if (data->mouse_mode == MBV_MOUSE_SHADE)
-		    {
-		    /* get shade mode */
-		    if (data->grid_mode == MBV_GRID_VIEW_PRIMARY)
-		    	shade_mode = data->primary_shade_mode;
-		    else if (data->grid_mode == MBV_GRID_VIEW_PRIMARYSLOPE)
-		    	shade_mode = data->slope_shade_mode;
-		    else /* if (data->grid_mode == MBV_GRID_VIEW_SECONDARY) */
-		    	shade_mode = data->secondary_shade_mode;
-
-		    /* handle shading by illumination */
-		    if (shade_mode == MBV_SHADE_VIEW_ILLUMINATION)
-			{
-			/* set cursor for shading */
-			XDefineCursor(view->dpy,view->xid,view->FleurBlackCursor);
-
-			view->illuminate_magnitude_save = data->illuminate_magnitude;
-			}
-
-		    /* handle shading by slope */
-		    else if (shade_mode == MBV_SHADE_VIEW_SLOPE)
-			{
-			/* set cursor for shading */
-			XDefineCursor(view->dpy,view->xid,view->FleurBlackCursor);
-
-			view->slope_magnitude_save = data->slope_magnitude;
-			}
-
-		    /* handle shading by overlay */
-		    else if (shade_mode == MBV_SHADE_VIEW_OVERLAY)
-			{
-			/* set cursor for shading */
-			XDefineCursor(view->dpy,view->xid,view->FleurBlackCursor);
-
-			view->overlay_shade_magnitude_save = data->overlay_shade_magnitude;
-			}
-		    }
-
-		/* handle viewpoint rotation */
-		else if (data->mouse_mode == MBV_MOUSE_VIEWPOINT)
-		    {
-		    /* set cursor for scaling */
-		    XDefineCursor(view->dpy,view->xid,view->SizingBlackCursor);
-
-		    /* save starting size */
-		    if (data->display_mode == MBV_DISPLAY_2D)
-			    {
-			    view->size2d_save = view->size2d;
-			    }
-		    else
-			    {
-			    view->viewoffset3d_z_save = view->viewoffset3d_z;
-			    }
-		    }
-
-		/* handle area picking */
-		else if (data->mouse_mode == MBV_MOUSE_AREA)
-		    {
-		    /* set cursor for area width */
-		    XDefineCursor(view->dpy,view->xid,view->SizingBlackCursor);
-
-		    /* process area */
-		    view->areaaspect_save = view->areaaspect;
-		    }
-
-		/* handle editing sites */
-		else if (data->mouse_mode == MBV_MOUSE_SITE)
-		    {
-		    /* set cursor for area */
-		    XDefineCursor(view->dpy,view->xid,view->TargetRedCursor);
-
-		    /* process site select */
-		    mbview_pick_site_delete(instance,
-				    view->button_down_x,
-				    data->height - view->button_down_y);
-
-		    /* set replotall */
-		    replotall = MB_YES;
-
-		    /* replot */
-		    mbview_plotlow(instance);
-		    }
-
-		/* handle editing routes */
-		else if (data->mouse_mode == MBV_MOUSE_ROUTE)
-		    {
-		    /* set cursor for area */
-		    XDefineCursor(view->dpy,view->xid,view->TargetRedCursor);
-
-		    /* process route select */
-		    mbview_pick_route_delete(instance,
-				    view->button_down_x,
-				    data->height - view->button_down_y);
-
-		    /* set replotall */
-		    replotall = MB_YES;
-
-		    /* set replotprofile */
-		    replotprofile = MB_YES;
-
-		    /* replot */
-		    mbview_plotlow(instance);
-		    }
-
-		/* handle deselecting navigation */
-		else if (data->mouse_mode == MBV_MOUSE_NAV || data->mouse_mode == MBV_MOUSE_NAVFILE)
-		    {
-		    /* set cursor for area */
-		    XDefineCursor(view->dpy,view->xid,view->TargetRedCursor);
-
-		    /* process nav deselect */
-		    mbview_pick_nav_select(instance, MB_NO, MBV_PICK_DOWN,
-				    view->button_down_x,
-				    data->height - view->button_down_y);
-
-		    /* set replotall */
-		    replotall = MB_YES;
-
-		    /* replot */
-		    mbview_plotlow(instance);
-		    }
-
-		} /* end of right button events */
-
-	  /* if needed replot all active instances */
-	  if (replotall == MB_YES)
-		{
-		mbview_plotlowall(instance);
-		}
-
-      } /* end of button press events */
-
-      /* Check for mouse motion while pressed. */
-      if (event->xany.type == MotionNotify)
-      {
-/*fprintf(stderr, "event->xany.type == MotionNotify  %d %d  mouse mode:%d\n",
-event->xbutton.x,event->xbutton.y, data->mouse_mode);*/
-
-	  /* prohibit event interruption of plotting */
-	  view->plot_interrupt_allowed = MB_NO;
-
-	  /* save location */
-	  view->button_move_x = event->xmotion.x;
-	  view->button_move_y = event->xmotion.y;
-
-	   /* If left mouse button is dragged */
-	  if (view->button1down == MB_YES)
-		{
-
-		/* set cursor for drag */
-		XDefineCursor(view->dpy,view->xid,view->FleurRedCursor);
-
-		/* handle move */
-		if (data->mouse_mode == MBV_MOUSE_MOVE
-		    || data->mouse_mode == MBV_MOUSE_ROTATE
-		    || data->mouse_mode == MBV_MOUSE_SHADE
-		    || data->mouse_mode == MBV_MOUSE_VIEWPOINT
-		    || data->mouse_mode == MBV_MOUSE_NAV
-		    || data->mouse_mode == MBV_MOUSE_NAVFILE)
-		    {
-		    /* process pick */
-		    mbview_pick(instance, MBV_PICK_MOVE,
-				view->button_move_x,
-				data->height - view->button_move_y);
-
-		    /* set replotprofile */
-		    replotprofile = MB_YES;
-
-		    /* replot */
-		    mbview_plotlow(instance);
-		    }
-
-		/* handle region picking */
-		else if (data->mouse_mode == MBV_MOUSE_AREA)
-		    {
-		    /* set cursor for region */
-		    XDefineCursor(view->dpy,view->xid,view->TargetRedCursor);
-
-		    /* process region */
-		    mbview_region(instance, MBV_REGION_MOVE,
-				    view->button_move_x,
-				    data->height - view->button_move_y);
-
-		    /* replot */
-		    mbview_plotlow(instance);
-		    }
-
-		/* handle editing sites */
-		else if (data->mouse_mode == MBV_MOUSE_SITE)
-		    {
-		    /* set cursor for site */
-		    XDefineCursor(view->dpy,view->xid,view->TargetRedCursor);
-
-		    /* process site select */
-		    mbview_pick_site_select(instance, MBV_PICK_MOVE,
-				    view->button_move_x,
-				    data->height - view->button_move_y);
-
-		    /* set replotall */
-		    replotall = MB_YES;
-
-		    /* replot */
-		    mbview_plotlow(instance);
-		    }
-
-		/* handle editing routes */
-		else if (data->mouse_mode == MBV_MOUSE_ROUTE)
-		    {
-		    /* set cursor for route */
-		    XDefineCursor(view->dpy,view->xid,view->TargetRedCursor);
-
-		    /* process route select */
-		    mbview_pick_route_select(instance, MBV_PICK_MOVE,
-				    view->button_move_x,
-				    data->height - view->button_move_y);
-
-		    /* set replotall */
-		    replotall = MB_YES;
-
-		    /* set replotprofile */
-		    replotprofile = MB_YES;
-
-		    /* replot */
-		    mbview_plotlow(instance);
-		    }
-
-		} /* end of left button events */
-
-	   /* If middle mouse button is dragged */
-	  else if (view->button2down == MB_YES)
-		{
-		/* handle move */
-		if (data->mouse_mode == MBV_MOUSE_MOVE)
-		    {
-		    /* set cursor for move */
-		    XDefineCursor(view->dpy,view->xid,view->FleurRedCursor);
-
-		    /* move map */
-		    if (data->display_mode == MBV_DISPLAY_2D)
-			{
-			view->offset2d_x = view->offset2d_x_save
-			    + (view->button_move_x - view->button_down_x)
-			    * (view->right - view->left) / data->width;
-			view->offset2d_y = view->offset2d_y_save
-			    - (view->button_move_y - view->button_down_y)
-			    * (view->top - view->bottom) / data->height;
-			if (XtIsManaged(view->mb3dview.mbview_textField_view_2doffsetx))
-				{
-				sprintf(value_text,"%g", view->offset2d_x);
-				XmTextFieldSetString(view->mb3dview.mbview_textField_view_2doffsetx,
-						value_text);
-				sprintf(value_text,"%g", view->offset2d_y);
-				XmTextFieldSetString(view->mb3dview.mbview_textField_view_2doffsety,
-						value_text);
-				}
-			}
-		    else
-			{
-			view->offset3d_x = view->offset3d_x_save
-			    + (view->button_move_x - view->button_down_x)
-			    	* MBV_OPENGL_WIDTH * MBV_OPENGL_WIDTH
-			    	/ data->width;
-			view->offset3d_y = view->offset3d_y_save
-			    - (view->button_move_y - view->button_down_y)
-			    	* view->aspect_ratio * view->aspect_ratio
-			    	* MBV_OPENGL_WIDTH * MBV_OPENGL_WIDTH
-				/ data->height;
-			if (XtIsManaged(view->mb3dview.mbview_textField_view_3doffsetx))
-				{
-				sprintf(value_text,"%g", view->offset3d_x);
-				XmTextFieldSetString(view->mb3dview.mbview_textField_view_3doffsetx,
-						value_text);
-				sprintf(value_text,"%g", view->offset3d_y);
-				XmTextFieldSetString(view->mb3dview.mbview_textField_view_3doffsety,
-						value_text);
-				}
-			}
-
-		    /* set flag to reset view bounds */
-		    view->viewboundscount++;
-
-		    /* replot */
-		    mbview_plotlow(instance);
-		    }
-
-		/* handle 3D rotate */
-		else if (data->mouse_mode == MBV_MOUSE_ROTATE)
-		    {
-		    /* set cursor for rotate */
-		    XDefineCursor(view->dpy,view->xid,view->FleurRedCursor);
-
-		    /* rotate viewpoint of 3D map */
-		    data->modelazimuth3d = view->modelazimuth3d_save
-			    + 180.0 * ((double)(view->button_move_x
-					    - view->button_down_x))
-				    / ((double)data->width);
-		    data->modelelevation3d = view->modelelevation3d_save
-			    + 180.0 * ((double)(view->button_move_y
-					    - view->button_down_y))
-				    / ((double)data->height);
-		    if (XtIsManaged(view->mb3dview.mbview_textField_model_azimuth))
-			    {
-			    sprintf(value_text,"%g", data->modelazimuth3d);
-			    XmTextFieldSetString(view->mb3dview.mbview_textField_model_azimuth,
-					    value_text);
-			    sprintf(value_text,"%g", data->modelelevation3d);
-			    XmTextFieldSetString(view->mb3dview.mbview_textField_model_elevation,
-					    value_text);
-			    }
-
-		    /* set flag to reset view bounds */
-		    view->viewboundscount++;
-
-		    /* replot */
-		    mbview_plotlow(instance);
-		    }
-
-		/* handle shading */
-		else if (data->mouse_mode == MBV_MOUSE_SHADE)
-		    {
-		    /* get shade mode */
-		    if (data->grid_mode == MBV_GRID_VIEW_PRIMARY)
-		    	shade_mode = data->primary_shade_mode;
-		    else if (data->grid_mode == MBV_GRID_VIEW_PRIMARYSLOPE)
-		    	shade_mode = data->slope_shade_mode;
-		    else if (data->grid_mode == MBV_GRID_VIEW_SECONDARY)
-		    	shade_mode = data->secondary_shade_mode;
-
-		    /* handle shading by illumination */
-		    if (shade_mode == MBV_SHADE_VIEW_ILLUMINATION)
-			{
-			/* set cursor for shade */
-			XDefineCursor(view->dpy,view->xid,view->FleurBlackCursor);
-
-			/* rotate illumination */
-			data->illuminate_azimuth = view->illuminate_azimuth_save
-				+ 180.0 * ((double)(view->button_move_x
-						- view->button_down_x))
-					/ ((double)data->width);
-			data->illuminate_elevation = view->illuminate_elevation_save
-				+ 180.0 * ((double)(view->button_move_y
-						- view->button_down_y))
-					/ ((double)data->height);
-			if (XtIsManaged(view->mb3dview.mbview_textField_illum_azi))
-				{
-				sprintf(value_text,"%g", data->illuminate_azimuth);
-				XmTextFieldSetString(view->mb3dview.mbview_textField_illum_azi,
-						value_text);
-				sprintf(value_text,"%g", data->illuminate_elevation);
-				XmTextFieldSetString(view->mb3dview.mbview_textField_illum_elev,
-						value_text);
-				}
-
-			/* clear color status array */
-			mbview_setcolorparms(instance);
-			mbview_colorclear(instance);
-
-			/* replot */
-			mbview_plotlow(instance);
-			}
-		    }
-
-		/* handle viewpoint rotation */
-		else if (data->mouse_mode == MBV_MOUSE_VIEWPOINT)
-		    {
-		    /* set cursor for rotate */
-		    XDefineCursor(view->dpy,view->xid,view->FleurRedCursor);
-
-		    /* rotate viewpoint of 3D map */
-		    data->viewazimuth3d = view->viewazimuth3d_save
-			    + 180.0 * ((double)(view->button_move_x
-					    - view->button_down_x))
-				    / ((double)data->width);
-		    data->viewelevation3d = view->viewelevation3d_save
-			    + 180.0 * ((double)(view->button_move_y
-					    - view->button_down_y))
-				    / ((double)data->height);
-		    if (XtIsManaged(view->mb3dview.mbview_textField_view_azimuth))
-			    {
-			    sprintf(value_text,"%g", data->viewazimuth3d);
-			    XmTextFieldSetString(view->mb3dview.mbview_textField_view_azimuth,
-					    value_text);
-			    sprintf(value_text,"%g", data->viewelevation3d);
-			    XmTextFieldSetString(view->mb3dview.mbview_textField_view_elevation,
-					    value_text);
-			    }
-
-		    /* set flag to reset view bounds */
-		    view->viewboundscount++;
-
-		    /* replot */
-		    mbview_plotlow(instance);
-		    }
-
-		/* handle area picking */
-		else if (data->mouse_mode == MBV_MOUSE_AREA)
-		    {
-		    /* set cursor for area */
-		    XDefineCursor(view->dpy,view->xid,view->TargetRedCursor);
-
-		    /* process area */
-		    mbview_area(instance, MBV_AREALENGTH_MOVE,
-				    view->button_move_x,
-				    data->height - view->button_move_y);
-
-		    /* replot */
-		    mbview_plotlow(instance);
-		    }
-
-		/* handle editing sites */
-		else if (data->mouse_mode == MBV_MOUSE_SITE)
-		    {
-		    /* set cursor for site */
-		    XDefineCursor(view->dpy,view->xid,view->TargetRedCursor);
-
-		    /* process site select */
-		    mbview_pick_site_add(instance, MBV_PICK_MOVE,
-				    view->button_move_x,
-				    data->height - view->button_move_y);
-
-		    /* set replotall */
-		    replotall = MB_YES;
-
-		    /* replot */
-		    mbview_plotlow(instance);
-		    }
-
-		/* handle editing routes */
-		else if (data->mouse_mode == MBV_MOUSE_ROUTE)
-		    {
-		    /* set cursor for route */
-		    XDefineCursor(view->dpy,view->xid,view->TargetRedCursor);
-
-		    /* process route select */
-		    mbview_pick_route_add(instance, MBV_PICK_MOVE,
-				    view->button_move_x,
-				    data->height - view->button_move_y);
-
-		    /* set replotall */
-		    replotall = MB_YES;
-
-		    /* set replotprofile */
-		    replotprofile = MB_YES;
-
-		    /* replot */
-		    mbview_plotlow(instance);
-		    }
-
-		/* handle selecting navigation */
-		else if (data->mouse_mode == MBV_MOUSE_NAV || data->mouse_mode == MBV_MOUSE_NAVFILE)
-		    {
-		    /* set cursor for nav */
-		    XDefineCursor(view->dpy,view->xid,view->TargetRedCursor);
-
-		    /* process nav select */
-		    mbview_pick_nav_select(instance, MB_YES, MBV_PICK_MOVE,
-				    view->button_move_x,
-				    data->height - view->button_move_y);
-
-		    /* set replotall */
-		    replotall = MB_YES;
-
-		    /* replot */
-		    mbview_plotlow(instance);
-		    }
-
-		} /* end of middle button events */
-
-	   /* If right mouse button is dragged */
-	  else if (view->button3down == MB_YES)
-		{
-
-		/* change the map scaling */
-		if (data->mouse_mode == MBV_MOUSE_MOVE)
-		    {
-		    /* set cursor for scaling */
-		    XDefineCursor(view->dpy,view->xid,view->SizingBlackCursor);
-
-		    /* rescale 2D map */
-		    if (data->display_mode == MBV_DISPLAY_2D)
-			{
-			view->size2d = view->size2d_save
-			    * exp(((double)(view->button_down_y - view->button_move_y))
-				    / ((double)data->height));
-			if (XtIsManaged(view->mb3dview.mbview_textField_view_2dzoom))
-				{
-				sprintf(value_text,"%g", view->size2d);
-				XmTextFieldSetString(view->mb3dview.mbview_textField_view_2dzoom,
-						value_text);
-				}
-			}
-
-		    /* rescale 3D map */
-		    else
-			{
-			view->offset3d_z = view->offset3d_z_save
-			    + 2.0 * (((double)(view->button_down_y - view->button_move_y))
-				    / ((double)data->height));
-			if (XtIsManaged(view->mb3dview.mbview_textField_model_3dzoom))
-				{
-				sprintf(value_text,"%g", view->offset3d_z);
-				XmTextFieldSetString(view->mb3dview.mbview_textField_model_3dzoom,
-						value_text);
-				}
-			}
-
-		    /* set flag to reset view bounds */
-		    view->viewboundscount++;
-
-		    /* replot */
-		    mbview_plotlow(instance);
-		    }
-
-		/* handle vertical exagerate */
-		else if (data->mouse_mode == MBV_MOUSE_ROTATE)
-		    {
-		    /* set cursor for exagerate */
-		    XDefineCursor(view->dpy,view->xid,view->FleurRedCursor);
-
-		    /* change vertical exageration of 3D map */
-		    data->exageration = view->exageration_save
-			    * exp(((double)(view->button_down_y - view->button_move_y))
-				    / ((double)data->height));
-		    if (data->display_projection_mode != MBV_PROJECTION_SPHEROID)
-			{
-		    	view->zorigin = data->exageration
-		    			* 0.5 * (data->primary_min
-							+ data->primary_max);
-			}
-		    if (XtIsManaged(view->mb3dview.mbview_textField_exageration))
-			    {
-			    sprintf(value_text,"%g", data->exageration);
-			    XmTextFieldSetString(view->mb3dview.mbview_textField_exageration,
-					    value_text);
-			    }
-
-		    /* reset flags */
-		    mbview_zscaleclear(instance);
-    		    view->contourlorez = MB_NO;
-		    view->contourhirez = MB_NO;
-		    view->contourfullrez = MB_NO;
-
-		    /* rescale data other than the grid */
-		    mbview_zscale(instance);
-
-		    /* set flag to reset view bounds */
-		    view->viewboundscount++;
-
-		    /* replot */
-		    mbview_plotlow(instance);
-		    }
-
-		/* handle shading */
-		else if (data->mouse_mode == MBV_MOUSE_SHADE)
-		    {
-		    /* get shade mode */
-		    if (data->grid_mode == MBV_GRID_VIEW_PRIMARY)
-		    	shade_mode = data->primary_shade_mode;
-		    else if (data->grid_mode == MBV_GRID_VIEW_PRIMARYSLOPE)
-		    	shade_mode = data->slope_shade_mode;
-		    else if (data->grid_mode == MBV_GRID_VIEW_SECONDARY)
-		    	shade_mode = data->secondary_shade_mode;
-
-		    /* handle shading by illumination */
-		    if (shade_mode == MBV_SHADE_VIEW_ILLUMINATION)
-			{
-			/* set cursor for shading */
-			XDefineCursor(view->dpy,view->xid,view->FleurBlackCursor);
-
-			/* change magnitude of illumination */
-			data->illuminate_magnitude = view->illuminate_magnitude_save
-				* exp(((double)(view->button_down_y - view->button_move_y))
-					/ ((double)data->height));
-			if (XtIsManaged(view->mb3dview.mbview_textField_illum_amp))
-				{
-				sprintf(value_text,"%g", data->illuminate_magnitude);
-				XmTextFieldSetString(view->mb3dview.mbview_textField_illum_amp,
-						value_text);
-				}
-
-			/* clear color status array */
-			mbview_setcolorparms(instance);
-			mbview_colorclear(instance);
-
-			/* replot */
-			mbview_plotlow(instance);
-			}
-
-		    /* handle shading by slope */
-		    else if (shade_mode == MBV_SHADE_VIEW_SLOPE)
-			{
-			/* set cursor for shading */
-			XDefineCursor(view->dpy,view->xid,view->FleurBlackCursor);
-
-			/* change magnitude of slope shading */
-			data->slope_magnitude = view->slope_magnitude_save
-				* exp(((double)(view->button_down_y - view->button_move_y))
-					/ ((double)data->height));
-			if (XtIsManaged(view->mb3dview.mbview_textField_slope_amp))
-				{
-				sprintf(value_text,"%g", data->slope_magnitude);
-				XmTextFieldSetString(view->mb3dview.mbview_textField_slope_amp,
-						value_text);
-				}
-
-			/* clear color status array */
-			mbview_setcolorparms(instance);
-			mbview_colorclear(instance);
-
-			/* replot */
-			mbview_plotlow(instance);
-			}
-
-		    /* handle shading by overlay */
-		    else if (shade_mode == MBV_SHADE_VIEW_OVERLAY)
-			{
-			/* set cursor for shading */
-			XDefineCursor(view->dpy,view->xid,view->FleurBlackCursor);
-
-			/* change magnitude of overlay shading */
-			data->overlay_shade_magnitude = view->overlay_shade_magnitude_save
-				* exp(((double)(view->button_down_y - view->button_move_y))
-					/ ((double)data->height));
-			if (XtIsManaged(view->mb3dview.mbview_textField_overlay_amp))
-				{
-				sprintf(value_text,"%g", data->overlay_shade_magnitude);
-				XmTextFieldSetString(view->mb3dview.mbview_textField_overlay_amp,
-						value_text);
-				}
-
-			/* clear color status array */
-			mbview_setcolorparms(instance);
-			mbview_colorclear(instance);
-
-			/* replot */
-			mbview_plotlow(instance);
-			}
-		    }
-
-		/* handle viewpoint rotation */
-		else if (data->mouse_mode == MBV_MOUSE_VIEWPOINT)
-		    {
-		    /* set cursor for scaling */
-		    XDefineCursor(view->dpy,view->xid,view->SizingBlackCursor);
-
-		    /* rescale 2D map */
-		    if (data->display_mode == MBV_DISPLAY_2D)
-			{
-			view->size2d = view->size2d_save
-			    * exp(((double)(view->button_down_y - view->button_move_y))
-				    / ((double)data->height));
-			if (XtIsManaged(view->mb3dview.mbview_textField_view_2dzoom))
-				{
-				sprintf(value_text,"%g", view->size2d);
-				XmTextFieldSetString(view->mb3dview.mbview_textField_view_2dzoom,
-						value_text);
-				}
-			}
-
-		    /* rescale 3D map */
-		    else
-			{
-			view->viewoffset3d_z = view->viewoffset3d_z_save
-			    + 2.0 * (((double)(view->button_down_y - view->button_move_y))
-				    / ((double)data->height));
-			if (XtIsManaged(view->mb3dview.mbview_textField_view_3dzoom))
-				{
-				sprintf(value_text,"%g", view->viewoffset3d_z);
-				XmTextFieldSetString(view->mb3dview.mbview_textField_view_3dzoom,
-						value_text);
-				}
-			}
-
-		    /* set flag to reset view bounds */
-		    view->viewboundscount++;
-
-		    /* replot */
-		    mbview_plotlow(instance);
-		    }
-
-		/* handle area picking */
-		else if (data->mouse_mode == MBV_MOUSE_AREA)
-		    {
-		    /* set cursor for area */
-		    XDefineCursor(view->dpy,view->xid,view->SizingBlackCursor);
-
-		    /* process area */
-		    view->areaaspect = view->areaaspect_save
-			    * exp(((double)(view->button_down_y - view->button_move_y))
-				    / ((double)data->height));
-
-		    /* process area */
-		    mbview_area(instance, MBV_AREAASPECT_CHANGE,
-				    view->button_move_x,
-				    data->height - view->button_move_y);
-
-		    /* replot */
-		    mbview_plotlow(instance);
-		    }
-
-		/* handle editing sites */
-		else if (data->mouse_mode == MBV_MOUSE_SITE)
-		    {
-		    /* set cursor for sites */
-		    XDefineCursor(view->dpy,view->xid,view->TargetRedCursor);
-
-		    /* set replotall */
-		    replotall = MB_YES;
-
-		    /* replot */
-		    mbview_plotlow(instance);
-		    }
-
-		/* handle editing routes */
-		else if (data->mouse_mode == MBV_MOUSE_ROUTE)
-		    {
-		    /* set cursor for routes */
-		    XDefineCursor(view->dpy,view->xid,view->TargetRedCursor);
-
-		    /* set replotall */
-		    replotall = MB_YES;
-
-		    /* set replotprofile */
-		    replotprofile = MB_YES;
-
-		    /* replot */
-		    mbview_plotlow(instance);
-		    }
-
-		/* handle deselecting navigation */
-		else if (data->mouse_mode == MBV_MOUSE_NAV || data->mouse_mode == MBV_MOUSE_NAVFILE)
-		    {
-		    /* set cursor for nav */
-		    XDefineCursor(view->dpy,view->xid,view->TargetRedCursor);
-
-		    /* process nav deselect */
-		    mbview_pick_nav_select(instance, MB_NO, MBV_PICK_MOVE,
-				    view->button_move_x,
-				    data->height - view->button_move_y);
-
-		    /* set replotall */
-		    replotall = MB_YES;
-
-		    /* replot */
-		    mbview_plotlow(instance);
-		    }
-
-		} /* end of right button events */
-
-	  /* if needed replot all active instances */
-	  if (replotall == MB_YES)
-		{
-		mbview_plotlowall(instance);
-		}
-
-      } /* end of motion notify events */
-
-
-      /* Check for mouse released. */
-      if (event->xany.type == ButtonRelease)
-      {
-/*fprintf(stderr, "event->xany.type == ButtonRelease  %d %d  mouse mode:%d\n",
-event->xbutton.x,event->xbutton.y, data->mouse_mode);*/
-
-	  /* save location */
-	  view->button_up_x = event->xbutton.x;
-	  view->button_up_y = event->xbutton.y;
-
-	   /* If left mouse button is released */
-	  if (view->button1down == MB_YES)
-		{
-
-		/* handle move */
-		if ((data->mouse_mode == MBV_MOUSE_MOVE
-		    || data->mouse_mode == MBV_MOUSE_ROTATE
-		    || data->mouse_mode == MBV_MOUSE_SHADE
-		    || data->mouse_mode == MBV_MOUSE_VIEWPOINT)
-		    && ((view->button_down_x != view->button_up_x)
-		    	|| (view->button_down_y != view->button_up_y)))
-		    {
-		    /* set cursor for pick */
-		    XDefineCursor(view->dpy,view->xid,view->TargetRedCursor);
-
-		    /* process pick */
-		    mbview_pick(instance, MBV_PICK_UP,
-				    view->button_up_x,
-				    data->height - view->button_up_y);
-
-		    /* set replotprofile */
-		    replotprofile = MB_YES;
-
-		    /* replot */
-		    mbview_plotlow(instance);
-		    }
-
-		/* handle area picking */
-		else if ((data->mouse_mode == MBV_MOUSE_AREA
-		    && (view->button_down_x != view->button_up_x
-		    	|| view->button_down_y != view->button_up_y)))
-		    {
-		    /* process area */
-		    mbview_region(instance, MBV_REGION_UP,
-				    view->button_up_x,
-				    data->height - view->button_up_y);
-
-		    /* set replotall */
-		    replotall = MB_YES;
-		    }
-
-		/* handle editing sites */
-		else if (data->mouse_mode == MBV_MOUSE_SITE)
-		    {
-		    /* set replotall */
-		    replotall = MB_YES;
-		    }
-
-		/* handle editing routes */
-		else if (data->mouse_mode == MBV_MOUSE_ROUTE)
-		    {
-		    /* set replotall */
-		    replotall = MB_YES;
-
-		    /* set replotprofile */
-		    replotprofile = MB_YES;
-		    }
-		}
-
-	   /* If middle mouse button is released */
-	  else if (view->button2down == MB_YES)
-		{
-		/* handle move */
-		if (data->mouse_mode == MBV_MOUSE_MOVE)
-		    {
-		    /* set flag to reset view bounds */
-		    view->viewboundscount = MBV_BOUNDSFREQUENCY;
-		    }
-
-		/* handle 3D rotate */
-		else if (data->mouse_mode == MBV_MOUSE_ROTATE)
-		    {
-		    /* set flag to reset view bounds */
-		    view->viewboundscount = MBV_BOUNDSFREQUENCY;
-		    }
-
-		/* handle viewpoint rotation */
-		else if (data->mouse_mode == MBV_MOUSE_VIEWPOINT)
-		    {
-		    /* set flag to reset view bounds */
-		    view->viewboundscount = MBV_BOUNDSFREQUENCY;
-		    }
-
-		/* handle area picking */
-		else if (data->mouse_mode == MBV_MOUSE_AREA
-		    && (view->button_down_x != view->button_up_x
-		    	|| view->button_down_y != view->button_up_y))
-		    {
-		    /* process area */
-		    mbview_area(instance, MBV_AREALENGTH_UP,
-				    view->button_up_x,
-				    data->height - view->button_up_y);
-
-		    /* set replotall */
-		    replotall = MB_YES;
-		    }
-
-		/* handle editing sites */
-		else if (data->mouse_mode == MBV_MOUSE_SITE)
-		    {
-		    /* set replotall */
-		    replotall = MB_YES;
-		    }
-
-		/* handle editing routes */
-		else if (data->mouse_mode == MBV_MOUSE_ROUTE)
-		    {
-		    /* set replotall */
-		    replotall = MB_YES;
-
-		    /* set replotprofile */
-		    replotprofile = MB_YES;
-		    }
-
-		/* handle selecting navigation */
-		else if (data->mouse_mode == MBV_MOUSE_NAV || data->mouse_mode == MBV_MOUSE_NAVFILE)
-		    {
-		    /* process nav select */
-		    mbview_pick_nav_select(instance, MB_YES, MBV_PICK_UP,
-				    view->button_move_x,
-				    data->height - view->button_move_y);
-
-		    /* set replotall */
-		    replotall = MB_YES;
-
-		    /* set replotprofile */
-		    replotprofile = MB_YES;
-
-		    /* replot */
-		    mbview_plotlow(instance);
-		    }
-		} /* end of middle button events */
-
-	   /* If right mouse button is released */
-	  else if (view->button3down == MB_YES)
-		{
-		/* change the map scaling */
-		if (data->mouse_mode == MBV_MOUSE_MOVE)
-		    {
-		    /* set flag to reset view bounds */
-		    view->viewboundscount = MBV_BOUNDSFREQUENCY;
-		    }
-
-		/* handle vertical exagerate */
-		else if (data->mouse_mode == MBV_MOUSE_ROTATE)
-		    {
-		    /* set flag to reset view bounds */
-		    view->viewboundscount = MBV_BOUNDSFREQUENCY;
-		    }
-
-		/* handle vertical exagerate */
-		else if (data->mouse_mode == MBV_MOUSE_VIEWPOINT)
-		    {
-		    /* set flag to reset view bounds */
-		    view->viewboundscount = MBV_BOUNDSFREQUENCY;
-		    }
-
-		/* handle area picking */
-		else if (data->mouse_mode == MBV_MOUSE_AREA
-		    && (view->button_down_x != view->button_up_x
-		    	|| view->button_down_y != view->button_up_y))
-		    {
-		    /* process area */
-		    mbview_area(instance, MBV_AREAASPECT_UP,
-				    view->button_up_x,
-				    data->height - view->button_up_y);
-
-		    /* set replotall */
-		    replotall = MB_YES;
-		    }
-
-		/* handle editing sites */
-		else if (data->mouse_mode == MBV_MOUSE_SITE)
-		    {
-		    /* set replotall */
-		    replotall = MB_YES;
-		    }
-
-		/* handle editing routes */
-		else if (data->mouse_mode == MBV_MOUSE_ROUTE)
-		    {
-		    /* set replotall */
-		    replotall = MB_YES;
-
-		    /* set replotprofile */
-		    replotprofile = MB_YES;
-		    }
-
-		/* handle deselecting navigation */
-		if (data->mouse_mode == MBV_MOUSE_NAV || data->mouse_mode == MBV_MOUSE_NAVFILE)
-		    {
-		    /* process nav deselect */
-		    mbview_pick_nav_select(instance, MB_NO, MBV_PICK_UP,
-				    view->button_move_x,
-				    data->height - view->button_move_y);
-
-		    /* set replotall */
-		    replotall = MB_YES;
-
-		    /* set replotprofile */
-		    replotprofile = MB_YES;
-
-		    /* replot */
-		    mbview_plotlow(instance);
-		    }
-		} /* end of right button events */
-
-
-	  /* unset all buttondown flags */
-	  view->button1down = MB_NO;
-	  view->button2down = MB_NO;
-	  view->button3down = MB_NO;
-
-	  /* replot in high rez if last draw was low rez */
-	  if (view->lastdrawrez == MBV_REZ_LOW)
-	  	{
-		/* replot the current instance */
-		mbview_plothigh(instance);
-		}
-
-	  /* if needed replot all active instances */
-	  if (replotall == MB_YES)
-		{
-		mbview_plothighall(instance);
-		}
-
-	  /* reset cursor */
-	  XDefineCursor(view->dpy,view->xid,view->TargetBlackCursor);
-
-	  /* allow event interruption of plotting */
-	  view->plot_interrupt_allowed = MB_YES;
-      } /* end of button release events */
-
-      /* Deal with KeyPress events */
-      if(event->xany.type == KeyPress)
-      {
-/* fprintf(stderr,"KeyPress event\n"); */
-      /* Get key pressed - buffer[0] */
-      actual = XLookupString((XKeyEvent *)event,
-		    buffer, 1, &keysym, NULL);
-
-      /* process events */
-      switch (buffer[0])
-	    {
-	    case 'R':
-	    case 'r':
-		    do_mbview_reset_view(w, client_data, call_data);
-		    break;
-	    default:
-		    break;
-	  } /* end of key switch */
-
-       } /* end of key press events */
-
-       /* if needed replot profile */
-       if (replotprofile == MB_YES)
-	  {
-	  /* extract profile if pick is right type */
-	  if (data->pickinfo_mode == MBV_PICK_TWOPOINT)
-	     mbview_extract_pick_profile(instance);
-	  else if (data->pickinfo_mode == MBV_PICK_ROUTE)
-	     mbview_extract_route_profile(instance);
-	  else if (data->pickinfo_mode == MBV_PICK_NAV)
-	     mbview_extract_nav_profile(instance);
-
-	  /* now replot profile */
-	  mbview_plotprofile(instance);
-	  }
-
-     /* update action buttons according to pick state */
-/* fprintf(stderr,"About to call mbview_action_sensitivity %zu\n",instance); */
-     mbview_action_sensitivity(instance);
-
-     } /* end of inputs from window */
-
-}
-
-/*------------------------------------------------------------------------------*/
-
-void
-do_mbview_dismiss( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-	size_t	instance;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-	int	error = MB_ERROR_NO_ERROR;
-
-	/* get instance */
-    	ac = 0;
-	XtSetArg(args[ac], XmNuserData, (XtPointer) &instance); ac++;
-	XtGetValues(w, args, ac);
-
-if (mbv_verbose >= 2)
-fprintf(stderr,"do_mbview_dismiss: instance:%zu\n", instance);
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* destroy the widgets for this instance  */
-	if (data->active == MB_YES)
-		mbview_destroy(mbv_verbose, instance, MB_YES, &error);
-}
-
-/*------------------------------------------------------------------------------*/
-
-void
-do_mbview_goaway( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-	size_t	instance;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-	int	error = MB_ERROR_NO_ERROR;
-
-	/* get instance */
-    	ac = 0;
-	XtSetArg(args[ac], XmNuserData, (XtPointer) &instance); ac++;
-	XtGetValues(w, args, ac);
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* destroy the widgets for this instance  */
-	if (data->active == MB_YES)
-		mbview_destroy(mbv_verbose, instance, MB_NO, &error);
-}
-/*------------------------------------------------------------------------------*/
-
-int mbview_destroy(int verbose, size_t instance, int destroywidgets, int *error)
-{
-	/* local variables */
-	char	*function_name = "mbview_destroy";
-	int	status = MB_SUCCESS;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-	int	i, j;
-
-	/* print starting debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:         %d\n",verbose);
-		fprintf(stderr,"dbg2       instance:        %zu\n",instance);
-		fprintf(stderr,"dbg2       destroywidgets:  %d\n",destroywidgets);
-		}
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* handle destruction if not already handled */
-	if (data->active == MB_YES)
-	    {
-	    /* destroy the widgets */
-	    if (destroywidgets == MB_YES)
-		{
-		/* delete old glx_context if it exists */
-		if (view->prglx_init == MB_YES)
-		    {
-		    /* make correct window current for OpenGL */
-#ifdef MBV_DEBUG_GLX
-fprintf(stderr,"%s:%d:%s instance:%zu glXMakeCurrent(%p,%p,%p)\n",
-__FILE__,__LINE__,function_name,instance,view->dpy,XtWindow(view->prglwmda),view->prglx_context);
-#endif
-		    glXMakeCurrent(view->dpy,XtWindow(view->prglwmda),view->prglx_context);
-
-#ifdef MBV_GET_GLX_ERRORS
-mbview_glerrorcheck(instance, __FILE__, __LINE__, function_name);
-#endif
-
-#ifdef MBV_DEBUG_GLX
-fprintf(stderr,"%s:%d:%s instance:%zu glXDestroyContext(%p,%p)\n",
-__FILE__,__LINE__,function_name,instance,view->dpy,view->prglx_context);
-#endif
-		    glXDestroyContext(view->dpy, view->prglx_context);
-		    view->prglx_init = MB_NO;
-
-#ifdef MBV_GET_GLX_ERRORS
-mbview_glerrorcheck(instance, __FILE__, __LINE__, function_name);
-#endif
-		    }
-
-		/* delete old glx_context if it exists */
-		if (view->glx_init == MB_YES)
-		    {
-		    /* make correct window current for OpenGL */
-#ifdef MBV_DEBUG_GLX
-fprintf(stderr,"%s:%d:%s instance:%zu glXMakeCurrent(%p,%p,%p)\n",
-__FILE__,__LINE__,function_name,instance,XtDisplay(view->glwmda),XtWindow(view->glwmda),view->glx_context);
-#endif
-		    glXMakeCurrent(XtDisplay(view->glwmda),XtWindow(view->glwmda),view->glx_context);
-
-#ifdef MBV_GET_GLX_ERRORS
-mbview_glerrorcheck(instance, __FILE__, __LINE__, function_name);
-#endif
-
-#ifdef MBV_DEBUG_GLX
-fprintf(stderr,"%s:%d:%s instance:%zu glXDestroyContext(%p,%p)\n",
-__FILE__,__LINE__,function_name,instance,view->dpy,view->glx_context);
-#endif
-		    glXDestroyContext(view->dpy, view->glx_context);
-		    view->glx_init = MB_NO;
-
-#ifdef MBV_GET_GLX_ERRORS
-mbview_glerrorcheck(instance, __FILE__, __LINE__, function_name);
-#endif
-		    }
-
-		/* destroy the topLevelShell and all its children */
-#ifdef MBV_DEBUG_GLX
-fprintf(stderr,"%s:%d:%s instance:%zu XtDestroyWidget(%p)\n",
-__FILE__,__LINE__,function_name,instance,view->topLevelShell);
-#endif
-		XtDestroyWidget(view->topLevelShell);
-
-#ifdef MBV_GET_GLX_ERRORS
-mbview_glerrorcheck(instance, __FILE__, __LINE__, function_name);
-#endif
-		}
-
-	    data->active = MB_NO;
-	    view->init = MBV_WINDOW_NULL;
-	    mbv_ninstance--;
-
-	    /* deallocate memory */
-    	    if (status == MB_SUCCESS
-		    && data->primary_data != NULL)
-    	    status = mb_freed(mbv_verbose, __FILE__, __LINE__, (void **)&data->primary_data, error);
-    	    if (status == MB_SUCCESS
-		    && data->primary_x != NULL)
-	    status = mb_freed(mbv_verbose, __FILE__, __LINE__, (void **)&data->primary_x, error);
-    	    if (status == MB_SUCCESS
-		    && data->primary_y != NULL)
-    	    status = mb_freed(mbv_verbose, __FILE__, __LINE__, (void **)&data->primary_y, error);
-    	    if (status == MB_SUCCESS
-		    && data->primary_z != NULL)
-    	    status = mb_freed(mbv_verbose, __FILE__, __LINE__, (void **)&data->primary_z,error);
-    	    if (status == MB_SUCCESS
-		    && data->primary_dzdx != NULL)
-    	    status = mb_freed(mbv_verbose, __FILE__, __LINE__, (void **)&data->primary_dzdx, error);
-    	    if (status == MB_SUCCESS
-		    && data->primary_dzdy != NULL)
-    	    status = mb_freed(mbv_verbose, __FILE__, __LINE__, (void **)&data->primary_dzdy, error);
-    	    if (status == MB_SUCCESS
-		    && data->primary_r != NULL)
-    	    status = mb_freed(mbv_verbose, __FILE__, __LINE__, (void **)&data->primary_r, error);
-    	    if (status == MB_SUCCESS
-		    && data->primary_g != NULL)
-    	    status = mb_freed(mbv_verbose, __FILE__, __LINE__, (void **)&data->primary_g, error);
-     	    if (status == MB_SUCCESS
-		    && data->primary_b != NULL)
-   	    status = mb_freed(mbv_verbose, __FILE__, __LINE__, (void **)&data->primary_b, error);
-     	    if (status == MB_SUCCESS
-		    && data->primary_stat_color != NULL)
-   	    status = mb_freed(mbv_verbose, __FILE__, __LINE__, (void **)&data->primary_stat_color, error);
-     	    if (status == MB_SUCCESS
-		    && data->primary_stat_z != NULL)
-   	    status = mb_freed(mbv_verbose, __FILE__, __LINE__, (void **)&data->primary_stat_z, error);
-    	    if (status == MB_SUCCESS
-		    && data->secondary_data != NULL)
-    	    status = mb_freed(mbv_verbose, __FILE__, __LINE__, (void **)&data->secondary_data, error);
-	    if (status == MB_SUCCESS
-		    && data->pick.segment.nls_alloc != 0
-		    && data->pick.segment.lspoints != NULL)
-		    {
-		    status = mb_freed(mbv_verbose, __FILE__, __LINE__, (void **)&data->pick.segment.lspoints, error);
-		    data->pick.segment.nls_alloc = 0;
-		    }
-	    for (i=0;i<4;i++)
-		    {
-     		    if (status == MB_SUCCESS
-		    && data->pick.xsegments[i].nls_alloc != 0
-		    && data->pick.xsegments[i].lspoints != NULL)
-			    {
-   			    status = mb_freed(mbv_verbose, __FILE__, __LINE__, (void **)&data->pick.xsegments[i].lspoints, error);
-			    data->pick.xsegments[i].nls_alloc = 0;
-			    }
-		    }
-     	    if (status == MB_SUCCESS
-		    && data->area.segment.nls_alloc != 0
-		    && data->area.segment.lspoints != NULL)
-		    {
-   		    status = mb_freed(mbv_verbose, __FILE__, __LINE__, (void **)&data->area.segment.lspoints, error);
-		    data->area.segment.nls_alloc = 0;
-		    }
-	    for (i=0;i<4;i++)
-		    {
-     		    if (status == MB_SUCCESS
-		    && data->area.segments[i].nls_alloc != 0
-		    && data->area.segments[i].lspoints != NULL)
-			    {
-   			    status = mb_freed(mbv_verbose, __FILE__, __LINE__, (void **)&data->area.segments[i].lspoints, error);
-			    data->area.segments[i].nls_alloc = 0;
-			    }
-		    }
-	    for (i=0;i<4;i++)
-		    {
-     		    if (status == MB_SUCCESS
-		    && data->region.segments[i].nls_alloc != 0
-		    && data->region.segments[i].lspoints != NULL)
-			    {
-   			    status = mb_freed(mbv_verbose, __FILE__, __LINE__, (void **)&data->region.segments[i].lspoints, error);
-			    data->region.segments[i].nls_alloc = 0;
-			    }
-		    }
-	    if (data->profile.npoints_alloc > 0)
-	    	    {
-   		    status = mb_freed(mbv_verbose, __FILE__, __LINE__, (void **)&data->profile.points, error);
-		    data->profile.npoints_alloc = 0;
-		    }
-
-	    /* deallocate shared data if no more active instances */
-	    if (mbv_ninstance <= 0)
-	    	{
-		shared.init_sitelist = MBV_WINDOW_NULL;
-		XmListDeleteAllItems(shared.mb3d_sitelist.mbview_list_sitelist);
-    		XtPopdown(XtParent(shared.mainWindow_sitelist));
-
-		shared.init_routelist = MBV_WINDOW_NULL;
-		XmListDeleteAllItems(shared.mb3d_routelist.mbview_list_routelist);
-    		XtPopdown(XtParent(shared.mainWindow_routelist));
-
-		shared.init_navlist = MBV_WINDOW_NULL;
- 		XmListDeleteAllItems(shared.mb3d_navlist.mbview_list_navlist);
-   		XtPopdown(XtParent(shared.mainWindow_navlist));
-
-		if (status == MB_SUCCESS
-		    && shared.shareddata.navpick.segment.nls_alloc != 0
-		    && shared.shareddata.navpick.segment.lspoints != NULL)
-		    {
-		    status = mb_freed(mbv_verbose, __FILE__, __LINE__, (void **)&shared.shareddata.navpick.segment.lspoints, error);
-		    shared.shareddata.navpick.segment.nls_alloc = 0;
-		    }
-		for (i=0;i<4;i++)
-		    {
-		    if (status == MB_SUCCESS
-		    && shared.shareddata.navpick.xsegments[i].lspoints != 0
-		    && shared.shareddata.navpick.xsegments[i].lspoints != NULL)
-		    status = mb_freed(mbv_verbose, __FILE__, __LINE__, (void **)&shared.shareddata.navpick.xsegments[i].lspoints, error);
-		    }
-		if (status == MB_SUCCESS
-		    && shared.shareddata.nsite_alloc != 0
-		    && shared.shareddata.sites != NULL)
-		    {
-		    status = mb_freed(mbv_verbose, __FILE__, __LINE__, (void **)&(shared.shareddata.sites), error);
-		    shared.shareddata.nsite_alloc = 0;
-		    shared.shareddata.sites = NULL;
-		    }
-		if (status == MB_SUCCESS
-		    && shared.shareddata.nroute_alloc != 0
-		    && shared.shareddata.routes != NULL)
-		    {
-		    for (i=0;i<shared.shareddata.nroute_alloc;i++)
-		    	{
-			for (j=0;j<shared.shareddata.routes[i].npoints_alloc;j++)
-			    {
-			    if (shared.shareddata.routes[i].segments[j].nls_alloc != 0
-				&& shared.shareddata.routes[i].segments[j].lspoints != NULL)
-				{
-				status = mb_freed(mbv_verbose, __FILE__, __LINE__, (void **)&shared.shareddata.routes[i].segments[j].lspoints, error);
-				shared.shareddata.routes[i].segments[j].nls_alloc = 0;
-				}
-			    }
-		    	status = mb_freed(mbv_verbose, __FILE__, __LINE__, (void **)&(shared.shareddata.routes[i].waypoint), error);
-		    	status = mb_freed(mbv_verbose, __FILE__, __LINE__, (void **)&(shared.shareddata.routes[i].distlateral), error);
-		    	status = mb_freed(mbv_verbose, __FILE__, __LINE__, (void **)&(shared.shareddata.routes[i].disttopo), error);
-		    	status = mb_freed(mbv_verbose, __FILE__, __LINE__, (void **)&(shared.shareddata.routes[i].points), error);
-		    	status = mb_freed(mbv_verbose, __FILE__, __LINE__, (void **)&(shared.shareddata.routes[i].segments), error);
-			}
-		    status = mb_freed(mbv_verbose, __FILE__, __LINE__, (void **)&(shared.shareddata.routes), error);
-		    shared.shareddata.nroute_alloc = 0;
-		    shared.shareddata.routes = NULL;
-		    }
-		if (status == MB_SUCCESS
-		    && shared.shareddata.nnav_alloc != 0
-		    && shared.shareddata.navs != NULL)
-		    {
-		    status = mb_freed(mbv_verbose, __FILE__, __LINE__, (void **)&(shared.shareddata.navs), error);
-		    shared.shareddata.nnav_alloc = 0;
-		    shared.shareddata.navs = NULL;
-		    }
-		}
-
-	    if (status != MB_SUCCESS)
-		    {
-		    fprintf(stderr,"\nUnable to free memory\n");
-		    fprintf(stderr,"\nProgram terminated in function <%s>\n",
-			    function_name);
-		    exit(0);
-		    }
-
-	    /* if no more active instances reset shared data */
-	    if (mbv_ninstance <= 0)
-	    	mbview_reset_shared(MB_NO);
-
-	    /* initialize view for next use */
-	    mbview_reset(instance);
-
-	    /* reset action button sensitivity for all instances */
-	    mbview_action_sensitivityall();
-
-	    /* let the calling program know */
-	    (data->mbview_dismiss_notify)(instance);
-	    }
-
-	/* print output debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:        %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-/*------------------------------------------------------------------------------*/
-
-int mbview_quit(int verbose, int *error)
-{
-	/* local variables */
-	char	*function_name = "mbview_quit";
-	int	status = MB_SUCCESS;
-	int	i;
-
-	/* print starting debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:         %d\n",verbose);
-		}
-
-	/* Destroy the list windows */
-    	XtUnmanageChild(shared.mb3d_sitelist.MB3DSiteList);
-    	XtUnmanageChild(shared.mb3d_routelist.MB3DRouteList);
-    	XtUnmanageChild(shared.mb3d_navlist.MB3DNavList);
-
-	/* loope over all possible instances and dismiss anything that's up */
-	for (i=0;i<MBV_MAX_WINDOWS;i++)
-		{
-		if (mbviews[i].init == MB_YES)
-			mbview_destroy(verbose, i, MB_YES, error);
-		}
-
-	/* print output debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:        %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-
-/*------------------------------------------------------------------------------*/
-
-void
-do_mbview_display_2D( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-    size_t	instance;
-    struct mbview_world_struct *view;
-    struct mbview_struct *data;
-
-    /* get instance */
-    ac = 0;
-    XtSetArg(args[ac], XmNuserData, (XtPointer) &instance); ac++;
-    XtGetValues(w, args, ac);
-
-    /* get view */
-    view = &(mbviews[instance]);
-    data = &(view->data);
-
-    /* get mode value */
-    data->display_mode = MBV_DISPLAY_2D;
-
-    /* set togglebuttons */
-    set_mbview_display_mode(instance, data->display_mode);
-    set_mbview_mouse_mode(instance, data->mouse_mode);
-
-if (mbv_verbose >= 2)
-fprintf(stderr,"do_mbview_display_2d instance:%zu mode:%d\n",
-instance, data->display_mode);
-
-    /* set contour flags */
-    view->contourlorez = MB_NO;
-    view->contourhirez = MB_NO;
-    view->contourfullrez = MB_NO;
-
-    /* set flag to reset view bounds */
-    view->viewboundscount = MBV_BOUNDSFREQUENCY;
-
-    /* draw */
-if (mbv_verbose >= 2)
-fprintf(stderr,"Calling mbview_plotlowhigh from do_mbview_display_2D\n");
-    mbview_plotlowhigh(instance);
-}
-/*------------------------------------------------------------------------------*/
-
-void
-do_mbview_display_3D( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-    size_t	instance;
-    struct mbview_world_struct *view;
-    struct mbview_struct *data;
-
-    /* get instance */
-    ac = 0;
-    XtSetArg(args[ac], XmNuserData, (XtPointer) &instance); ac++;
-    XtGetValues(w, args, ac);
-
-    /* get view */
-    view = &(mbviews[instance]);
-    data = &(view->data);
-
-    /* get mode value */
-    data->display_mode = MBV_DISPLAY_3D;
-
-    /* set togglebuttons */
-    set_mbview_display_mode(instance, data->display_mode);
-    set_mbview_mouse_mode(instance, data->mouse_mode);
-
-if (mbv_verbose >= 2)
-fprintf(stderr,"do_mbview_display_3d instance:%zu mode:%d\n",
-instance, data->display_mode);
-
-    /* set contour flags */
-    view->contourlorez = MB_NO;
-    view->contourhirez = MB_NO;
-    view->contourfullrez = MB_NO;
-
-    /* set flag to reset view bounds */
-    view->viewboundscount = MBV_BOUNDSFREQUENCY;
-
-    /* draw */
-if (mbv_verbose >= 2)
-fprintf(stderr,"Calling mbview_plotlowhigh from do_mbview_display_3D\n");
-    mbview_plotlowhigh(instance);
-}
-/*------------------------------------------------------------------------------*/
-
-void
-do_mbview_data_primary( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-    size_t	instance;
-    struct mbview_world_struct *view;
-    struct mbview_struct *data;
-
-    /* get instance */
-    ac = 0;
-    XtSetArg(args[ac], XmNuserData, (XtPointer) &instance); ac++;
-    XtGetValues(w, args, ac);
-
-    /* get view */
-    view = &(mbviews[instance]);
-    data = &(view->data);
-
-    /* get mode value */
-    data->grid_mode = MBV_GRID_VIEW_PRIMARY;
-
-if (mbv_verbose >= 2)
-fprintf(stderr,"do_mbview_data_primary instance:%zu mode:%d\n",
-instance, data->grid_mode);
-
-    /* set togglebuttons */
-    set_mbview_grid_mode(instance, data->grid_mode);
-    set_mbview_histogram_mode(instance, data->primary_histogram);
-    set_mbview_colortable(instance, data->primary_colortable);
-    set_mbview_colortable_mode(instance, data->primary_colortable_mode);
-    set_mbview_shade_mode(instance, data->primary_shade_mode);
-
-    /* clear color status array */
-    mbview_setcolorparms(instance);
-    mbview_colorclear(instance);
-
-     /* draw */
-if (mbv_verbose >= 2)
-fprintf(stderr,"Calling mbview_plotlowhigh from do_mbview_data_primary\n");
-    mbview_plotlowhigh(instance);
-}
-
-/*------------------------------------------------------------------------------*/
-void
-do_mbview_data_primaryslope( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-    size_t	instance;
-    struct mbview_world_struct *view;
-    struct mbview_struct *data;
-
-    /* get instance */
-    ac = 0;
-    XtSetArg(args[ac], XmNuserData, (XtPointer) &instance); ac++;
-    XtGetValues(w, args, ac);
-
-    /* get view */
-    view = &(mbviews[instance]);
-    data = &(view->data);
-
-    /* get mode value */
-    data->grid_mode = MBV_GRID_VIEW_PRIMARYSLOPE;
-
-if (mbv_verbose >= 2)
-fprintf(stderr,"do_mbview_data_primaryslope instance:%zu mode:%d\n",
-instance, data->grid_mode);
-
-    /* set togglebuttons */
-    set_mbview_grid_mode(instance, data->grid_mode);
-    set_mbview_histogram_mode(instance, data->primaryslope_histogram);
-    set_mbview_colortable(instance, data->slope_colortable);
-    set_mbview_colortable_mode(instance, data->slope_colortable_mode);
-    set_mbview_shade_mode(instance, data->slope_shade_mode);
-
-    /* clear color status array */
-    mbview_setcolorparms(instance);
-    mbview_colorclear(instance);
-
-    /* draw */
-if (mbv_verbose >= 2)
-fprintf(stderr,"Calling mbview_plotlowhigh from do_mbview_data_primaryslope\n");
-    mbview_plotlowhigh(instance);
-}
-
-/*------------------------------------------------------------------------------*/
-void
-do_mbview_data_secondary( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-    size_t	instance;
-    struct mbview_world_struct *view;
-    struct mbview_struct *data;
-
-    /* get instance */
-    ac = 0;
-    XtSetArg(args[ac], XmNuserData, (XtPointer) &instance); ac++;
-    XtGetValues(w, args, ac);
-
-    /* get view */
-    view = &(mbviews[instance]);
-    data = &(view->data);
-
-    /* get mode value */
-    data->grid_mode = MBV_GRID_VIEW_SECONDARY;
-
-if (mbv_verbose >= 2)
-fprintf(stderr,"do_mbview_data_secondary instance:%zu mode:%d\n",
-instance, data->grid_mode);
-
-    /* set togglebuttons */
-    set_mbview_grid_mode(instance, data->grid_mode);
-    set_mbview_histogram_mode(instance, data->secondary_histogram);
-    set_mbview_colortable(instance, data->secondary_colortable);
-    set_mbview_colortable_mode(instance, data->secondary_colortable_mode);
-    set_mbview_shade_mode(instance, data->secondary_shade_mode);
-
-    /* clear color status array */
-    mbview_setcolorparms(instance);
-    mbview_colorclear(instance);
-
-    /* draw */
-if (mbv_verbose >= 2)
-fprintf(stderr,"Calling mbview_plotlowhigh from do_mbview_data_secondary\n");
-    mbview_plotlowhigh(instance);
-}
-
-/*------------------------------------------------------------------------------*/
-void
-do_mbview_histogram( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-    size_t	instance;
-    Boolean	value;
-    struct mbview_world_struct *view;
-    struct mbview_struct *data;
-
-    /* get instance */
-    ac = 0;
-    XtSetArg(args[ac], XmNuserData, (XtPointer) &instance); ac++;
-    XtGetValues(w, args, ac);
-/*fprintf(stderr,"do_mbview_histogram instance:%zu\n", instance);*/
-
-    /* get view */
-    view = &(mbviews[instance]);
-    data = &(view->data);
-
-    /* get histogram value */
-    if (XmToggleButtonGetState(w))
-    	value = MB_YES;
-    else
-        value = MB_NO;
-    if (data->grid_mode == MBV_GRID_VIEW_PRIMARY)
-	    {
-	    data->primary_histogram = value;
-	    }
-    else if (data->grid_mode == MBV_GRID_VIEW_PRIMARYSLOPE)
-	    {
-	    data->primaryslope_histogram = value;
-	    }
-    else if (data->grid_mode == MBV_GRID_VIEW_SECONDARY)
-	    {
-	    data->secondary_histogram = value;
-	    }
-
-if (mbv_verbose >= 2)
-fprintf(stderr,"do_mbview_histogram instance:%zu mode:%d\n",
-instance, data->grid_mode);
-
-    /* clear color status array */
-    mbview_setcolorparms(instance);
-    mbview_colorclear(instance);
-
-    /* draw */
-if (mbv_verbose >= 2)
-fprintf(stderr,"Calling mbview_plotlowhigh from do_mbview_histogram\n");
-    mbview_plotlowhigh(instance);
-}
-
-/*------------------------------------------------------------------------------*/
-void
-do_mbview_overlay_none( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-    size_t	instance;
-    struct mbview_world_struct *view;
-    struct mbview_struct *data;
-
-    /* get instance */
-    ac = 0;
-    XtSetArg(args[ac], XmNuserData, (XtPointer) &instance); ac++;
-    XtGetValues(w, args, ac);
-
-    /* get view */
-    view = &(mbviews[instance]);
-    data = &(view->data);
-
-if (mbv_verbose >= 2)
-fprintf(stderr,"do_mbview_overlay_none instance:%zu\n", instance);
-
-    /* set mode value */
-    if (data->grid_mode == MBV_GRID_VIEW_PRIMARY)
-	{
-    	data->primary_shade_mode = MBV_SHADE_VIEW_NONE;
-	set_mbview_shade_mode(instance, data->primary_shade_mode);
-	}
-    else if (data->grid_mode == MBV_GRID_VIEW_PRIMARYSLOPE)
-	{
-    	data->slope_shade_mode = MBV_SHADE_VIEW_NONE;
-	set_mbview_shade_mode(instance, data->slope_shade_mode);
-	}
-    else if (data->grid_mode == MBV_GRID_VIEW_SECONDARY)
-	{
-    	data->secondary_shade_mode = MBV_SHADE_VIEW_NONE;
-	set_mbview_shade_mode(instance, data->secondary_shade_mode);
-	}
-
-    /* clear color status array */
-    mbview_setcolorparms(instance);
-    mbview_colorclear(instance);
-
-    /* draw */
-if (mbv_verbose >= 2)
-fprintf(stderr,"Calling mbview_plotlowhigh from do_mbview_overlay_none\n");
-    mbview_plotlowhigh(instance);
-}
-
-/*------------------------------------------------------------------------------*/
-void
-do_mbview_overlay_slope( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-    size_t	instance;
-    struct mbview_world_struct *view;
-    struct mbview_struct *data;
-
-    /* get instance */
-    ac = 0;
-    XtSetArg(args[ac], XmNuserData, (XtPointer) &instance); ac++;
-    XtGetValues(w, args, ac);
-
-    /* get view */
-    view = &(mbviews[instance]);
-    data = &(view->data);
-
-if (mbv_verbose >= 2)
-fprintf(stderr,"do_mbview_overlay_slope instance:%zu\n", instance);
-
-    /* set mode value */
-    if (data->grid_mode == MBV_GRID_VIEW_PRIMARY)
-	{
-    	data->primary_shade_mode = MBV_SHADE_VIEW_SLOPE;
-	set_mbview_shade_mode(instance, data->primary_shade_mode);
-	}
-    else if (data->grid_mode == MBV_GRID_VIEW_PRIMARYSLOPE)
-	{
-    	data->slope_shade_mode = MBV_SHADE_VIEW_SLOPE;
-	set_mbview_shade_mode(instance, data->slope_shade_mode);
-	}
-    else if (data->grid_mode == MBV_GRID_VIEW_SECONDARY)
-	{
-    	data->secondary_shade_mode = MBV_SHADE_VIEW_SLOPE;
-	set_mbview_shade_mode(instance, data->secondary_shade_mode);
-	}
-
-    /* clear color status array */
-    mbview_setcolorparms(instance);
-    mbview_colorclear(instance);
-
-    /* draw */
-if (mbv_verbose >= 2)
-fprintf(stderr,"Calling mbview_plotlowhigh from do_mbview_overlay_slope\n");
-    mbview_plotlowhigh(instance);
-}
-
-/*------------------------------------------------------------------------------*/
-void
-do_mbview_overlay_illumination( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-    size_t	instance;
-    struct mbview_world_struct *view;
-    struct mbview_struct *data;
-
-    /* get instance */
-    ac = 0;
-    XtSetArg(args[ac], XmNuserData, (XtPointer) &instance); ac++;
-    XtGetValues(w, args, ac);
-
-    /* get view */
-    view = &(mbviews[instance]);
-    data = &(view->data);
-
-if (mbv_verbose >= 2)
-fprintf(stderr,"do_mbview_overlay_illumination instance:%zu\n", instance);
-
-    /* set mode value */
-    if (data->grid_mode == MBV_GRID_VIEW_PRIMARY)
-	{
-    	data->primary_shade_mode = MBV_SHADE_VIEW_ILLUMINATION;
-	set_mbview_shade_mode(instance, data->primary_shade_mode);
-	}
-    else if (data->grid_mode == MBV_GRID_VIEW_PRIMARYSLOPE)
-	{
-    	data->slope_shade_mode = MBV_SHADE_VIEW_ILLUMINATION;
-	set_mbview_shade_mode(instance, data->slope_shade_mode);
-	}
-    else if (data->grid_mode == MBV_GRID_VIEW_SECONDARY)
-	{
-    	data->secondary_shade_mode = MBV_SHADE_VIEW_ILLUMINATION;
-	set_mbview_shade_mode(instance, data->secondary_shade_mode);
-	}
-
-    /* clear color status array */
-    mbview_setcolorparms(instance);
-    mbview_colorclear(instance);
-
-    /* draw */
-if (mbv_verbose >= 2)
-fprintf(stderr,"Calling mbview_plotlowhigh from do_mbview_overlay_illumination\n");
-    mbview_plotlowhigh(instance);
-}
-
-/*------------------------------------------------------------------------------*/
-void
-do_mbview_overlay_secondary( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-    size_t	instance;
-    struct mbview_world_struct *view;
-    struct mbview_struct *data;
-
-    /* get instance */
-    ac = 0;
-    XtSetArg(args[ac], XmNuserData, (XtPointer) &instance); ac++;
-    XtGetValues(w, args, ac);
-
-    /* get view */
-    view = &(mbviews[instance]);
-    data = &(view->data);
-
-if (mbv_verbose >= 2)
-fprintf(stderr,"do_mbview_overlay_secondary instance:%zu\n", instance);
-
-    /* set mode value */
-    if (data->grid_mode == MBV_GRID_VIEW_PRIMARY)
-	{
-    	data->primary_shade_mode = MBV_SHADE_VIEW_OVERLAY;
-	set_mbview_shade_mode(instance, data->primary_shade_mode);
-	}
-    else if (data->grid_mode == MBV_GRID_VIEW_PRIMARYSLOPE)
-	{
-    	data->slope_shade_mode = MBV_SHADE_VIEW_OVERLAY;
-	set_mbview_shade_mode(instance, data->slope_shade_mode);
-	}
-    else if (data->grid_mode == MBV_GRID_VIEW_SECONDARY)
-	{
-    	data->secondary_shade_mode = MBV_SHADE_VIEW_OVERLAY;
-	set_mbview_shade_mode(instance, data->secondary_shade_mode);
-	}
-
-    /* clear color status array */
-    mbview_setcolorparms(instance);
-    mbview_colorclear(instance);
-
-    /* draw */
-if (mbv_verbose >= 2)
-fprintf(stderr,"Calling mbview_plotlowhigh from do_mbview_overlay_secondary\n");
-    mbview_plotlowhigh(instance);
-}
-
-/*------------------------------------------------------------------------------*/
-void
-do_mbview_overlay_contour( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-    size_t	instance;
-    Boolean	value;
-    struct mbview_world_struct *view;
-    struct mbview_struct *data;
-
-    /* get instance */
-    ac = 0;
-    XtSetArg(args[ac], XmNuserData, (XtPointer) &instance); ac++;
-    XtGetValues(w, args, ac);
-
-    /* get view */
-    view = &(mbviews[instance]);
-    data = &(view->data);
-
-    /* get mode value */
-    value = XmToggleButtonGetState(w);
-    if (value == True)
-	data->grid_contour_mode = MBV_VIEW_ON;
-    else
-	data->grid_contour_mode = MBV_VIEW_OFF;
-
-if (mbv_verbose >= 2)
-fprintf(stderr,"do_mbview_overlay_contour instance:%zu mode:%d\n",
-instance, data->grid_contour_mode);
-
-    /* draw */
-if (mbv_verbose >= 2)
-fprintf(stderr,"Calling mbview_plotlowhigh from do_mbview_overlay_contour\n");
-    mbview_plotlowhigh(instance);
-}
-/*------------------------------------------------------------------------------*/
-
-void
-do_mbview_site( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-    size_t	instance;
-    Boolean	value;
-    struct mbview_world_struct *view;
-    struct mbview_struct *data;
-
-    /* get instance */
-    ac = 0;
-    XtSetArg(args[ac], XmNuserData, (XtPointer) &instance); ac++;
-    XtGetValues(w, args, ac);
-
-    /* get view */
-    view = &(mbviews[instance]);
-    data = &(view->data);
-
-    /* get mode value */
-    value = XmToggleButtonGetState(w);
-    if (value == True)
-	data->site_view_mode = MBV_VIEW_ON;
-    else
-	{
-	data->site_view_mode = MBV_VIEW_OFF;
-
-	/* if site view is off, site edit must be off */
-	if (data->mouse_mode == MBV_MOUSE_SITE)
-	    {
-	    data->mouse_mode = MBV_MOUSE_MOVE;
-	    set_mbview_mouse_mode(instance, data->mouse_mode);
-
-	    /* make sure sites aren't selected if edit modes off */
-	    shared.shareddata.site_selected = MBV_SELECT_NONE;
-	    data->pickinfo_mode = data->pick_type;
-
-	    /* set pick annotation */
-	    mbview_pick_text(instance);
-	    }
-	}
-
-if (mbv_verbose >= 2)
-fprintf(stderr,"do_mbview_site instance:%zu mode:%d\n",
-instance, data->site_view_mode);
-
-    /* draw */
-if (mbv_verbose >= 2)
-fprintf(stderr,"Calling mbview_plotlowhigh from do_mbview_site\n");
-    mbview_plotlowhigh(instance);
-}
-/*------------------------------------------------------------------------------*/
-
-void
-do_mbview_route( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-    size_t	instance;
-    Boolean	value;
-    struct mbview_world_struct *view;
-    struct mbview_struct *data;
-
-    /* get instance */
-    ac = 0;
-    XtSetArg(args[ac], XmNuserData, (XtPointer) &instance); ac++;
-    XtGetValues(w, args, ac);
-
-    /* get view */
-    view = &(mbviews[instance]);
-    data = &(view->data);
-
-    /* get mode value */
-    value = XmToggleButtonGetState(w);
-    if (value == True)
-	data->route_view_mode = MBV_VIEW_ON;
-    else
-	{
-	data->route_view_mode = MBV_VIEW_OFF;
-
-	/* if route view is off, route edit must be off */
-	if (data->mouse_mode == MBV_MOUSE_ROUTE)
-	    {
-	    data->mouse_mode = MBV_MOUSE_MOVE;
-	    set_mbview_mouse_mode(instance, data->mouse_mode);
-
-	    /* make sure routes aren't selected if edit modes off */
-	    shared.shareddata.route_selected = MBV_SELECT_NONE;
-	    shared.shareddata.route_point_selected = MBV_SELECT_NONE;
-	    data->pickinfo_mode = data->pick_type;
-
-	    /* set pick annotation */
-	    mbview_pick_text(instance);
-	    }
-	}
-
-if (mbv_verbose >= 2)
-fprintf(stderr,"do_mbview_route instance:%zu mode:%d\n",
-instance, data->route_view_mode);
-
-    /* draw */
-if (mbv_verbose >= 2)
-fprintf(stderr,"Calling mbview_plotlowhigh from do_mbview_route\n");
-    mbview_plotlowhigh(instance);
-}
-
-/*------------------------------------------------------------------------------*/
-
-void
-do_mbview_nav( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-    size_t	instance;
-    Boolean	value;
-    struct mbview_world_struct *view;
-    struct mbview_struct *data;
-
-    /* get instance */
-    ac = 0;
-    XtSetArg(args[ac], XmNuserData, (XtPointer) &instance); ac++;
-    XtGetValues(w, args, ac);
-
-    /* get view */
-    view = &(mbviews[instance]);
-    data = &(view->data);
-
-    /* get mode value */
-    value = XmToggleButtonGetState(w);
-    if (value == True)
-	data->nav_view_mode = MBV_VIEW_ON;
-    else
-    	{
-	data->nav_view_mode = MBV_VIEW_OFF;
-	if (data->navdrape_view_mode == MBV_VIEW_OFF
-		&& (data->mouse_mode == MBV_MOUSE_NAV
-			|| data->mouse_mode == MBV_MOUSE_NAVFILE))
-		{
-		data->mouse_mode = MBV_MOUSE_MOVE;
-		set_mbview_mouse_mode(instance, data->mouse_mode);
-		}
-	}
-
-if (mbv_verbose >= 2)
-fprintf(stderr,"do_mbview_nav instance:%zu mode:%d\n",
-instance, data->nav_view_mode);
-
-    /* draw */
-if (mbv_verbose >= 2)
-fprintf(stderr,"Calling mbview_plotlowhigh from do_mbview_nav\n");
-    mbview_plotlowhigh(instance);
-}
-
-/*------------------------------------------------------------------------------*/
-
-void
-do_mbview_navdrape( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-    size_t	instance;
-    Boolean	value;
-    struct mbview_world_struct *view;
-    struct mbview_struct *data;
-
-    /* get instance */
-    ac = 0;
-    XtSetArg(args[ac], XmNuserData, (XtPointer) &instance); ac++;
-    XtGetValues(w, args, ac);
-
-    /* get view */
-    view = &(mbviews[instance]);
-    data = &(view->data);
-
-    /* get mode value */
-    value = XmToggleButtonGetState(w);
-    if (value == True)
-	data->navdrape_view_mode = MBV_VIEW_ON;
-    else
-   	{
-	data->navdrape_view_mode = MBV_VIEW_OFF;
- 	if (data->nav_view_mode == MBV_VIEW_OFF
-		&& (data->mouse_mode == MBV_MOUSE_NAV
-			|| data->mouse_mode == MBV_MOUSE_NAVFILE))
-		{
-		data->mouse_mode = MBV_MOUSE_MOVE;
-		set_mbview_mouse_mode(instance, data->mouse_mode);
-		}
-	}
-
-if (mbv_verbose >= 2)
-fprintf(stderr,"do_mbview_navdrape instance:%zu mode:%d\n",
-instance, data->navdrape_view_mode);
-
-    /* draw */
-if (mbv_verbose >= 2)
-fprintf(stderr,"Calling mbview_plotlowhigh from do_mbview_navdrape\n");
-    mbview_plotlowhigh(instance);
-}
-/*------------------------------------------------------------------------------*/
-
-void
-do_mbview_vector( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-    size_t	instance;
-    Boolean	value;
-    struct mbview_world_struct *view;
-    struct mbview_struct *data;
-
-    /* get instance */
-    ac = 0;
-    XtSetArg(args[ac], XmNuserData, (XtPointer) &instance); ac++;
-    XtGetValues(w, args, ac);
-
-    /* get view */
-    view = &(mbviews[instance]);
-    data = &(view->data);
-
-    /* get mode value */
-    value = XmToggleButtonGetState(w);
-    if (value == True)
-	data->vector_view_mode = MBV_VIEW_ON;
-    else
-   	{
-	data->vector_view_mode = MBV_VIEW_OFF;
- 	if (data->nav_view_mode == MBV_VIEW_OFF
-		&& (data->mouse_mode == MBV_MOUSE_NAV
-			|| data->mouse_mode == MBV_MOUSE_NAVFILE))
-		{
-		data->mouse_mode = MBV_MOUSE_MOVE;
-		set_mbview_mouse_mode(instance, data->mouse_mode);
-		}
-	}
-
-if (mbv_verbose >= 2)
-fprintf(stderr,"do_mbview_vector instance:%zu mode:%d\n",
-instance, data->vector_view_mode);
-
-    /* draw */
-if (mbv_verbose >= 2)
-fprintf(stderr,"Calling mbview_plotlowhigh from do_mbview_vector\n");
-    mbview_plotlowhigh(instance);
-}
-
-/*------------------------------------------------------------------------------*/
-
-void
-do_mbview_colortable_haxby( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-    size_t	instance;
-    struct mbview_world_struct *view;
-    struct mbview_struct *data;
-
-    /* get instance */
-    ac = 0;
-    XtSetArg(args[ac], XmNuserData, (XtPointer) &instance); ac++;
-    XtGetValues(w, args, ac);
-
-    /* get view */
-    view = &(mbviews[instance]);
-    data = &(view->data);
-
-    /* get mode value */
-    if (data->grid_mode == MBV_GRID_VIEW_PRIMARY)
-    	{
-	data->primary_colortable = MBV_COLORTABLE_HAXBY;
-        set_mbview_colortable(instance, data->primary_colortable);
-        set_mbview_colortable_mode(instance, data->primary_colortable_mode);
-	}
-    else if (data->grid_mode == MBV_GRID_VIEW_PRIMARYSLOPE)
-    	{
-	data->slope_colortable = MBV_COLORTABLE_HAXBY;
-        set_mbview_colortable(instance, data->slope_colortable);
-        set_mbview_colortable_mode(instance, data->slope_colortable_mode);
-	}
-    else if (data->grid_mode == MBV_GRID_VIEW_SECONDARY)
-    	{
-	data->secondary_colortable = MBV_COLORTABLE_HAXBY;
-        set_mbview_colortable(instance, data->secondary_colortable);
-        set_mbview_colortable_mode(instance, data->secondary_colortable_mode);
-	}
-
-if (mbv_verbose >= 2)
-fprintf(stderr,"do_mbview_colortable_haxby instance:%zu\n", instance);
-
-    /* clear color status array */
-    mbview_setcolorparms(instance);
-    mbview_colorclear(instance);
-
-    /* draw */
-if (mbv_verbose >= 2)
-fprintf(stderr,"Calling mbview_plotlowhigh from do_mbview_colortable_haxby\n");
-    mbview_plotlowhigh(instance);
-}
-/*------------------------------------------------------------------------------*/
-
-void
-do_mbview_colortable_bright( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-    size_t	instance;
-    struct mbview_world_struct *view;
-    struct mbview_struct *data;
-
-    /* get instance */
-    ac = 0;
-    XtSetArg(args[ac], XmNuserData, (XtPointer) &instance); ac++;
-    XtGetValues(w, args, ac);
-
-    /* get view */
-    view = &(mbviews[instance]);
-    data = &(view->data);
-
-    /* get mode value */
-    if (data->grid_mode == MBV_GRID_VIEW_PRIMARY)
-    	{
-	data->primary_colortable = MBV_COLORTABLE_BRIGHT;
-        set_mbview_colortable(instance, data->primary_colortable);
-        set_mbview_colortable_mode(instance, data->primary_colortable_mode);
-	}
-    else if (data->grid_mode == MBV_GRID_VIEW_PRIMARYSLOPE)
-    	{
-	data->slope_colortable = MBV_COLORTABLE_BRIGHT;
-        set_mbview_colortable(instance, data->slope_colortable);
-        set_mbview_colortable_mode(instance, data->slope_colortable_mode);
-	}
-    else if (data->grid_mode == MBV_GRID_VIEW_SECONDARY)
-    	{
-	data->secondary_colortable = MBV_COLORTABLE_BRIGHT;
-        set_mbview_colortable(instance, data->secondary_colortable);
-        set_mbview_colortable_mode(instance, data->secondary_colortable_mode);
-	}
-
-if (mbv_verbose >= 2)
-fprintf(stderr,"do_mbview_colortable_bright instance:%zu\n", instance);
-
-    /* clear color status array */
-    mbview_setcolorparms(instance);
-    mbview_colorclear(instance);
-
-    /* draw */
-if (mbv_verbose >= 2)
-fprintf(stderr,"Calling mbview_plotlowhigh from do_mbview_colortable_bright\n");
-    mbview_plotlowhigh(instance);
- }
-/*------------------------------------------------------------------------------*/
-
-void
-do_mbview_colortable_muted( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-    size_t	instance;
-    struct mbview_world_struct *view;
-    struct mbview_struct *data;
-
-    /* get instance */
-    ac = 0;
-    XtSetArg(args[ac], XmNuserData, (XtPointer) &instance); ac++;
-    XtGetValues(w, args, ac);
-
-    /* get view */
-    view = &(mbviews[instance]);
-    data = &(view->data);
-
-    /* get mode value */
-    if (data->grid_mode == MBV_GRID_VIEW_PRIMARY)
-    	{
-	data->primary_colortable = MBV_COLORTABLE_MUTED;
-        set_mbview_colortable(instance, data->primary_colortable);
-        set_mbview_colortable_mode(instance, data->primary_colortable_mode);
-	}
-    else if (data->grid_mode == MBV_GRID_VIEW_PRIMARYSLOPE)
-    	{
-	data->slope_colortable = MBV_COLORTABLE_MUTED;
-        set_mbview_colortable(instance, data->slope_colortable);
-        set_mbview_colortable_mode(instance, data->slope_colortable_mode);
-	}
-    else if (data->grid_mode == MBV_GRID_VIEW_SECONDARY)
-    	{
-	data->secondary_colortable = MBV_COLORTABLE_MUTED;
-        set_mbview_colortable(instance, data->secondary_colortable);
-        set_mbview_colortable_mode(instance, data->secondary_colortable_mode);
-	}
-
-if (mbv_verbose >= 2)
-fprintf(stderr,"do_mbview_colortable_muted instance:%zu\n", instance);
-
-    /* clear color status array */
-    mbview_setcolorparms(instance);
-    mbview_colorclear(instance);
-
-    /* draw */
-if (mbv_verbose >= 2)
-fprintf(stderr,"Calling mbview_plotlowhigh from do_mbview_colortable_muted\n");
-    mbview_plotlowhigh(instance);
-}
-/*------------------------------------------------------------------------------*/
-
-void
-do_mbview_colortable_gray( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-    size_t	instance;
-    struct mbview_world_struct *view;
-    struct mbview_struct *data;
-
-    /* get instance */
-    ac = 0;
-    XtSetArg(args[ac], XmNuserData, (XtPointer) &instance); ac++;
-    XtGetValues(w, args, ac);
-
-    /* get view */
-    view = &(mbviews[instance]);
-    data = &(view->data);
-
-    /* get mode value */
-    if (data->grid_mode == MBV_GRID_VIEW_PRIMARY)
-    	{
-	data->primary_colortable = MBV_COLORTABLE_GRAY;
-        set_mbview_colortable(instance, data->primary_colortable);
-        set_mbview_colortable_mode(instance, data->primary_colortable_mode);
-	}
-    else if (data->grid_mode == MBV_GRID_VIEW_PRIMARYSLOPE)
-    	{
-	data->slope_colortable = MBV_COLORTABLE_GRAY;
-        set_mbview_colortable(instance, data->slope_colortable);
-        set_mbview_colortable_mode(instance, data->slope_colortable_mode);
-	}
-    else if (data->grid_mode == MBV_GRID_VIEW_SECONDARY)
-    	{
-	data->secondary_colortable = MBV_COLORTABLE_GRAY;
-        set_mbview_colortable(instance, data->secondary_colortable);
-        set_mbview_colortable_mode(instance, data->secondary_colortable_mode);
-	}
-
-if (mbv_verbose >= 2)
-fprintf(stderr,"do_mbview_colortable_gray instance:%zu\n", instance);
-
-    /* clear color status array */
-    mbview_setcolorparms(instance);
-    mbview_colorclear(instance);
-
-    /* draw */
-if (mbv_verbose >= 2)
-fprintf(stderr,"Calling mbview_plotlowhigh from do_mbview_colortable_gray\n");
-    mbview_plotlowhigh(instance);
-}
-/*------------------------------------------------------------------------------*/
-
-void
-do_mbview_colortable_flat( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-    size_t	instance;
-    struct mbview_world_struct *view;
-    struct mbview_struct *data;
-
-    /* get instance */
-    ac = 0;
-    XtSetArg(args[ac], XmNuserData, (XtPointer) &instance); ac++;
-    XtGetValues(w, args, ac);
-
-    /* get view */
-    view = &(mbviews[instance]);
-    data = &(view->data);
-
-    /* get mode value */
-    if (data->grid_mode == MBV_GRID_VIEW_PRIMARY)
-    	{
-	data->primary_colortable = MBV_COLORTABLE_FLAT;
-        set_mbview_colortable(instance, data->primary_colortable);
-        set_mbview_colortable_mode(instance, data->primary_colortable_mode);
-	}
-    else if (data->grid_mode == MBV_GRID_VIEW_PRIMARYSLOPE)
-    	{
-	data->slope_colortable = MBV_COLORTABLE_FLAT;
-        set_mbview_colortable(instance, data->slope_colortable);
-        set_mbview_colortable_mode(instance, data->slope_colortable_mode);
-	}
-    else if (data->grid_mode == MBV_GRID_VIEW_SECONDARY)
-    	{
-	data->secondary_colortable = MBV_COLORTABLE_FLAT;
-        set_mbview_colortable(instance, data->secondary_colortable);
-        set_mbview_colortable_mode(instance, data->secondary_colortable_mode);
-	}
-
-if (mbv_verbose >= 2)
-fprintf(stderr,"do_mbview_colortable_flat instance:%zu\n", instance);
-
-    /* clear color status array */
-    mbview_setcolorparms(instance);
-    mbview_colorclear(instance);
-
-    /* draw */
-if (mbv_verbose >= 2)
-fprintf(stderr,"Calling mbview_plotlowhigh from do_mbview_colortable_flat\n");
-    mbview_plotlowhigh(instance);
-}
-
-/*------------------------------------------------------------------------------*/
-
-void
-do_mbview_colortable_sealevel1( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-    size_t	instance;
-    struct mbview_world_struct *view;
-    struct mbview_struct *data;
-
-    /* get instance */
-    ac = 0;
-    XtSetArg(args[ac], XmNuserData, (XtPointer) &instance); ac++;
-    XtGetValues(w, args, ac);
-
-    /* get view */
-    view = &(mbviews[instance]);
-    data = &(view->data);
-
-    /* get mode value */
-    if (data->grid_mode == MBV_GRID_VIEW_PRIMARY)
-    	{
-	data->primary_colortable = MBV_COLORTABLE_SEALEVEL1;
-        set_mbview_colortable(instance, data->primary_colortable);
-        set_mbview_colortable_mode(instance, data->primary_colortable_mode);
-	}
-    else if (data->grid_mode == MBV_GRID_VIEW_PRIMARYSLOPE)
-    	{
-	data->slope_colortable = MBV_COLORTABLE_SEALEVEL1;
-        set_mbview_colortable(instance, data->slope_colortable);
-        set_mbview_colortable_mode(instance, data->slope_colortable_mode);
-	}
-    else if (data->grid_mode == MBV_GRID_VIEW_SECONDARY)
-    	{
-	data->secondary_colortable = MBV_COLORTABLE_SEALEVEL1;
-        set_mbview_colortable(instance, data->secondary_colortable);
-        set_mbview_colortable_mode(instance, data->secondary_colortable_mode);
-	}
-
-if (mbv_verbose >= 2)
-fprintf(stderr,"do_mbview_colortable_sealevel1 instance:%zu\n", instance);
-
-    /* clear color status array */
-    mbview_setcolorparms(instance);
-    mbview_colorclear(instance);
-
-    /* draw */
-if (mbv_verbose >= 2)
-fprintf(stderr,"Calling mbview_plotlowhigh from do_mbview_colortable_sealevel1\n");
-    mbview_plotlowhigh(instance);
-}
-/*------------------------------------------------------------------------------*/
-
-void
-do_mbview_colortable_sealevel2( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-    size_t	instance;
-    struct mbview_world_struct *view;
-    struct mbview_struct *data;
-
-    /* get instance */
-    ac = 0;
-    XtSetArg(args[ac], XmNuserData, (XtPointer) &instance); ac++;
-    XtGetValues(w, args, ac);
-
-    /* get view */
-    view = &(mbviews[instance]);
-    data = &(view->data);
-
-    /* get mode value */
-    if (data->grid_mode == MBV_GRID_VIEW_PRIMARY)
-    	{
-	data->primary_colortable = MBV_COLORTABLE_SEALEVEL2;
-        set_mbview_colortable(instance, data->primary_colortable);
-        set_mbview_colortable_mode(instance, data->primary_colortable_mode);
-	}
-    else if (data->grid_mode == MBV_GRID_VIEW_PRIMARYSLOPE)
-    	{
-	data->slope_colortable = MBV_COLORTABLE_SEALEVEL2;
-        set_mbview_colortable(instance, data->slope_colortable);
-        set_mbview_colortable_mode(instance, data->slope_colortable_mode);
-	}
-    else if (data->grid_mode == MBV_GRID_VIEW_SECONDARY)
-    	{
-	data->secondary_colortable = MBV_COLORTABLE_SEALEVEL2;
-        set_mbview_colortable(instance, data->secondary_colortable);
-        set_mbview_colortable_mode(instance, data->secondary_colortable_mode);
-	}
-
-if (mbv_verbose >= 2)
-fprintf(stderr,"do_mbview_colortable_sealevel2 instance:%zu\n", instance);
-
-    /* clear color status array */
-    mbview_setcolorparms(instance);
-    mbview_colorclear(instance);
-
-    /* draw */
-if (mbv_verbose >= 2)
-fprintf(stderr,"Calling mbview_plotlowhigh from do_mbview_colortable_sealevel2\n");
-    mbview_plotlowhigh(instance);
-}
-
-/*------------------------------------------------------------------------------*/
-void
-do_mbview_mouse_rmode( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmToggleButtonCallbackStruct *acs;
-    acs = (XmToggleButtonCallbackStruct*)call_data;
-    size_t	instance;
-    struct mbview_world_struct *view;
-    struct mbview_struct *data;
-    MB3DViewData	*mb3dviewptr;
-    int	    replot = MB_NO;
-
-if (mbv_verbose >= 2)
-fprintf(stderr,"do_mbview_mouse_rmode: \n");
-
-    acs = (XmToggleButtonCallbackStruct*)call_data;
-
-    /* do nothing unless calling widget is set */
-    if (acs->event != NULL && acs->set > 0)
-    	{
-	/* get instance */
-	ac = 0;
-	XtSetArg(args[ac], XmNuserData, (XtPointer) &instance); ac++;
-	XtGetValues(w, args, ac);
-
-    	/* get view */
-    	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* get mode value */
-	mb3dviewptr = &(view->mb3dview);
-
-	if (w == (mb3dviewptr->mbview_toggleButton_mode_rmove))
-	    data->mouse_mode = MBV_MOUSE_MOVE;
-	else if (w == (mb3dviewptr->mbview_toggleButton_mode_rrotate))
-	    data->mouse_mode = MBV_MOUSE_ROTATE;
-	else if (w == (mb3dviewptr->mbview_toggleButton_mode_rshade))
-	    data->mouse_mode = MBV_MOUSE_SHADE;
-	else if (w == (mb3dviewptr->mbview_toggleButton_mode_rviewpoint))
-	    data->mouse_mode = MBV_MOUSE_VIEWPOINT;
-	else if (w == (mb3dviewptr->mbview_toggleButton_mode_rarea))
-	    data->mouse_mode = MBV_MOUSE_AREA;
-	else if (w == (mb3dviewptr->mbview_toggleButton_mode_rsite))
-	    {
-	    data->mouse_mode = MBV_MOUSE_SITE;
-	    data->site_view_mode = MBV_VIEW_ON;
-	    set_mbview_site_view_mode(instance, data->site_view_mode);
-	    replot = MB_YES;
-	    }
-	else if (w == (mb3dviewptr->mbview_toggleButton_mode_rroute))
-	    {
-	    data->mouse_mode = MBV_MOUSE_ROUTE;
-	    data->route_view_mode = MBV_VIEW_ON;
-	    set_mbview_route_view_mode(instance, data->route_view_mode);
-	    replot = MB_YES;
-	    }
-	else if (w == (mb3dviewptr->mbview_toggleButton_mode_rnav))
-	    {
-	    data->mouse_mode = MBV_MOUSE_NAV;
-	    if (data->display_mode == MBV_DISPLAY_3D)
-	    	{
-	    	data->navdrape_view_mode = MBV_VIEW_ON;
-	    	set_mbview_navdrape_view_mode(instance, data->navdrape_view_mode);
-	    	replot = MB_YES;
-		}
-	    else
-	    	{
-	    	data->nav_view_mode = MBV_VIEW_ON;
-	    	set_mbview_nav_view_mode(instance, data->nav_view_mode);
-	    	replot = MB_YES;
-		}
-	    }
-	else if (w == (mb3dviewptr->mbview_toggleButton_mode_rnavfile))
-	    {
-	    data->mouse_mode = MBV_MOUSE_NAVFILE;
-	    if (data->display_mode == MBV_DISPLAY_3D)
-	    	{
-	    	data->navdrape_view_mode = MBV_VIEW_ON;
-	    	set_mbview_navdrape_view_mode(instance, data->navdrape_view_mode);
-	    	replot = MB_YES;
-		}
-	    else
-	    	{
-	    	data->nav_view_mode = MBV_VIEW_ON;
-	    	set_mbview_nav_view_mode(instance, data->nav_view_mode);
-	    	replot = MB_YES;
-		}
-	    }
-
-	/* make sure sites or routes aren't selected if edit modes off */
-	if (data->mouse_mode != MBV_MOUSE_SITE
-	    && shared.shareddata.site_selected != MBV_SELECT_NONE)
-	    {
-	    shared.shareddata.site_selected = MBV_SELECT_NONE;
-	    data->pickinfo_mode = data->pick_type;
-	    replot = MB_YES;
-	    }
-	if (data->mouse_mode != MBV_MOUSE_ROUTE
-	    && shared.shareddata.route_selected != MBV_SELECT_NONE)
-	    {
-	    shared.shareddata.route_selected = MBV_SELECT_NONE;
-	    shared.shareddata.route_point_selected = MBV_SELECT_NONE;
-	    data->pickinfo_mode = data->pick_type;
-	    replot = MB_YES;
-	    }
-
-    	/* set mouse togglebuttons */
-    	set_mbview_mouse_mode(instance, data->mouse_mode);
-
-	/* replot if necessary */
-	if (replot == MB_YES)
-	    {
-	    /* set pick annotation */
-	    mbview_pick_text(instance);
-
-	    /* draw */
-if (mbv_verbose >= 2)
-fprintf(stderr,"Calling mbview_plotlowhigh from do_mbview_mouse_rmode\n");
-	    mbview_plotlowhigh(instance);
-	    }
-
-	}
-}
-
-/*------------------------------------------------------------------------------*/
-void
-do_mbview_mouse_mode( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmToggleButtonCallbackStruct *acs;
-    acs = (XmToggleButtonCallbackStruct*)call_data;
-    size_t	instance;
-    struct mbview_world_struct *view;
-    struct mbview_struct *data;
-    MB3DViewData	*mb3dviewptr;
-    int	    replot = MB_NO;
-
-if (mbv_verbose >= 2)
-fprintf(stderr,"do_mbview_mouse_mode: \n");
-
-	acs = (XmToggleButtonCallbackStruct*)call_data;
-
-    /* do nothing unless calling widget is set */
-/*    if (acs->event != NULL && acs->set > 0)*/
-    	{
-	/* get instance */
-	ac = 0;
-	XtSetArg(args[ac], XmNuserData, (XtPointer) &instance); ac++;
-	XtGetValues(w, args, ac);
-
-    	/* get view */
-    	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* get mode value */
-	mb3dviewptr = &(view->mb3dview);
-
-	if (w == (mb3dviewptr->mbview_toggleButton_mode_move))
-	    data->mouse_mode = MBV_MOUSE_MOVE;
-	else if (w == (mb3dviewptr->mbview_toggleButton_mode_rotate))
-	    data->mouse_mode = MBV_MOUSE_ROTATE;
-	else if (w == (mb3dviewptr->mbview_toggleButton_mode_shade))
-	    data->mouse_mode = MBV_MOUSE_SHADE;
-	else if (w == (mb3dviewptr->mbview_toggleButton_mode_viewpoint))
-	    data->mouse_mode = MBV_MOUSE_VIEWPOINT;
-	else if (w == (mb3dviewptr->mbview_toggleButton_mode_area))
-	    data->mouse_mode = MBV_MOUSE_AREA;
-	else if (w == (mb3dviewptr->mbview_toggleButton_mode_site))
-	    {
-	    data->mouse_mode = MBV_MOUSE_SITE;
-	    data->site_view_mode = MBV_VIEW_ON;
-	    set_mbview_site_view_mode(instance, data->site_view_mode);
-	    }
-	else if (w == (mb3dviewptr->mbview_toggleButton_mode_route))
-	    {
-	    data->mouse_mode = MBV_MOUSE_ROUTE;
-	    data->route_view_mode = MBV_VIEW_ON;
-	    set_mbview_route_view_mode(instance, data->route_view_mode);
-	    }
-	else if (w == (mb3dviewptr->mbview_toggleButton_mode_nav))
-	    {
-	    data->mouse_mode = MBV_MOUSE_NAV;
-	    if (data->display_mode == MBV_DISPLAY_3D)
-	    	{
-	    	data->navdrape_view_mode = MBV_VIEW_ON;
-	    	set_mbview_navdrape_view_mode(instance, data->nav_view_mode);
-		}
-	    else
-	    	{
-	    	data->nav_view_mode = MBV_VIEW_ON;
-	    	set_mbview_nav_view_mode(instance, data->nav_view_mode);
-		}
-	    }
-	else if (w == (mb3dviewptr->mbview_toggleButton_mode_navfile))
-	    {
-	    data->mouse_mode = MBV_MOUSE_NAVFILE;
-	    if (data->display_mode == MBV_DISPLAY_3D)
-	    	{
-	    	data->navdrape_view_mode = MBV_VIEW_ON;
-	    	set_mbview_navdrape_view_mode(instance, data->nav_view_mode);
-		}
-	    else
-	    	{
-	    	data->nav_view_mode = MBV_VIEW_ON;
-	    	set_mbview_nav_view_mode(instance, data->nav_view_mode);
-		}
-	    }
-
-	/* make sure sites or routes aren't selected if edit modes off */
-	if (data->mouse_mode != MBV_MOUSE_SITE
-	    && shared.shareddata.site_selected != MBV_SELECT_NONE)
-	    {
-	    shared.shareddata.site_selected = MBV_SELECT_NONE;
-	    data->pickinfo_mode = data->pick_type;
-	    replot = MB_YES;
-	    }
-	if (data->mouse_mode != MBV_MOUSE_ROUTE
-	    && shared.shareddata.route_selected != MBV_SELECT_NONE)
-	    {
-	    shared.shareddata.route_selected = MBV_SELECT_NONE;
-	    shared.shareddata.route_point_selected = MBV_SELECT_NONE;
-	    data->pickinfo_mode = data->pick_type;
-	    replot = MB_YES;
-	    }
-
-    	/* set mouse togglebuttons */
-    	set_mbview_mouse_mode(instance, data->mouse_mode);
-
-	/* replot if necessary */
-	if (replot == MB_YES)
-	    {
-	    /* set pick annotation */
-	    mbview_pick_text(instance);
-
-	    /* draw */
-if (mbv_verbose >= 2)
-fprintf(stderr,"Calling mbview_plotlowhigh from do_mbview_mouse_mode\n");
-	    mbview_plotlowhigh(instance);
-	    }
-
-	}
-}
-
-/*------------------------------------------------------------------------------*/
-void
-set_mbview_mouse_mode(size_t instance, int mode)
-{
-    struct mbview_world_struct *view;
-    struct mbview_struct *data;
-    MB3DViewData	*mb3dviewptr;
-
-if (mbv_verbose >= 2)
-fprintf(stderr,"do_mbview_mouse_mode: instance:%zu mode:%d\n", instance, mode);
-
-    /* get view */
-    view = &(mbviews[instance]);
-    data = &(view->data);
-
-    mb3dviewptr = &(view->mb3dview);
-
-    /*set mode */
-    data->mouse_mode = mode;
-    if (data->display_mode == MBV_DISPLAY_2D
-    	&& (data->mouse_mode == MBV_MOUSE_ROTATE
-    	    || data->mouse_mode == MBV_MOUSE_VIEWPOINT))
-	data->mouse_mode = MBV_MOUSE_MOVE;
-
-    XmToggleButtonSetState(mb3dviewptr->mbview_toggleButton_mode_move,
-				False, False);
-    XmToggleButtonSetState(mb3dviewptr->mbview_toggleButton_mode_rotate,
-				False, False);
-    XmToggleButtonSetState(mb3dviewptr->mbview_toggleButton_mode_shade,
-				False, False);
-    XmToggleButtonSetState(mb3dviewptr->mbview_toggleButton_mode_viewpoint,
-				False, False);
-    XmToggleButtonSetState(mb3dviewptr->mbview_toggleButton_mode_area,
-				False, False);
-    XmToggleButtonSetState(mb3dviewptr->mbview_toggleButton_mode_site,
-				False, False);
-    XmToggleButtonSetState(mb3dviewptr->mbview_toggleButton_mode_route,
-				False, False);
-    XmToggleButtonSetState(mb3dviewptr->mbview_toggleButton_mode_nav,
-				False, False);
-    XmToggleButtonSetState(mb3dviewptr->mbview_toggleButton_mode_navfile,
-				False, False);
-
-    XmToggleButtonSetState(mb3dviewptr->mbview_toggleButton_mode_rmove,
-				False, False);
-    XmToggleButtonSetState(mb3dviewptr->mbview_toggleButton_mode_rrotate,
-				False, False);
-    XmToggleButtonSetState(mb3dviewptr->mbview_toggleButton_mode_rshade,
-				False, False);
-    XmToggleButtonSetState(mb3dviewptr->mbview_toggleButton_mode_rviewpoint,
-				False, False);
-    XmToggleButtonSetState(mb3dviewptr->mbview_toggleButton_mode_rarea,
-				False, False);
-    XmToggleButtonSetState(mb3dviewptr->mbview_toggleButton_mode_rsite,
-				False, False);
-    XmToggleButtonSetState(mb3dviewptr->mbview_toggleButton_mode_rroute,
-				False, False);
-    XmToggleButtonSetState(mb3dviewptr->mbview_toggleButton_mode_rnav,
-				False, False);
-    XmToggleButtonSetState(mb3dviewptr->mbview_toggleButton_mode_rnavfile,
-				False, False);
-
-    if (data->mouse_mode == MBV_MOUSE_MOVE)
-	{
-	XmToggleButtonSetState(mb3dviewptr->mbview_toggleButton_mode_move,
-				    True, False);
-	XmToggleButtonSetState(mb3dviewptr->mbview_toggleButton_mode_rmove,
-				    True, False);
-	}
-    else if (data->mouse_mode == MBV_MOUSE_ROTATE)
-	{
-	XmToggleButtonSetState(mb3dviewptr->mbview_toggleButton_mode_rotate,
-				    True, False);
-	XmToggleButtonSetState(mb3dviewptr->mbview_toggleButton_mode_rrotate,
-				    True, False);
-	}
-    else if (data->mouse_mode == MBV_MOUSE_SHADE)
-	{
-	XmToggleButtonSetState(mb3dviewptr->mbview_toggleButton_mode_shade,
-				    True, False);
-	XmToggleButtonSetState(mb3dviewptr->mbview_toggleButton_mode_rshade,
-				    True, False);
-	}
-    else if (data->mouse_mode == MBV_MOUSE_VIEWPOINT)
-	{
-	XmToggleButtonSetState(mb3dviewptr->mbview_toggleButton_mode_viewpoint,
-				    True, False);
-	XmToggleButtonSetState(mb3dviewptr->mbview_toggleButton_mode_rviewpoint,
-				    True, False);
-	}
-    else if (data->mouse_mode == MBV_MOUSE_AREA)
-	{
-	XmToggleButtonSetState(mb3dviewptr->mbview_toggleButton_mode_area,
-				    True, False);
-	XmToggleButtonSetState(mb3dviewptr->mbview_toggleButton_mode_rarea,
-				    True, False);
-	}
-    else if (data->mouse_mode == MBV_MOUSE_SITE)
-	{
-	XmToggleButtonSetState(mb3dviewptr->mbview_toggleButton_mode_site,
-				    True, False);
-	XmToggleButtonSetState(mb3dviewptr->mbview_toggleButton_mode_rsite,
-				    True, False);
-	}
-    else if (data->mouse_mode == MBV_MOUSE_ROUTE)
-	{
-	XmToggleButtonSetState(mb3dviewptr->mbview_toggleButton_mode_route,
-				    True, False);
-	XmToggleButtonSetState(mb3dviewptr->mbview_toggleButton_mode_rroute,
-				    True, False);
-	}
-    else if (data->mouse_mode == MBV_MOUSE_NAV)
-	{
-	XmToggleButtonSetState(mb3dviewptr->mbview_toggleButton_mode_nav,
-				    True, False);
-	XmToggleButtonSetState(mb3dviewptr->mbview_toggleButton_mode_rnav,
-				    True, False);
-	}
-    else if (data->mouse_mode == MBV_MOUSE_NAVFILE)
-	{
-	XmToggleButtonSetState(mb3dviewptr->mbview_toggleButton_mode_navfile,
-				    True, False);
-	XmToggleButtonSetState(mb3dviewptr->mbview_toggleButton_mode_rnavfile,
-				    True, False);
-	}
-
-    /* set widget sensitivity and visability */
-    if (data->display_mode == MBV_DISPLAY_2D)
-    	{
-	XtVaSetValues(mb3dviewptr->mbview_toggleButton_mode_rotate,
-		XmNsensitive, False,
-		NULL);
-	XtVaSetValues(mb3dviewptr->mbview_toggleButton_mode_viewpoint,
-		XmNsensitive, False,
-		NULL);
-	XtVaSetValues(mb3dviewptr->mbview_toggleButton_mode_rrotate,
-		XmNsensitive, False,
-		NULL);
-	XtVaSetValues(mb3dviewptr->mbview_toggleButton_mode_rviewpoint,
-		XmNsensitive, False,
-		NULL);
-	}
-    else
-	{
-	XtVaSetValues(mb3dviewptr->mbview_toggleButton_mode_rotate,
-		XmNsensitive, True,
-		NULL);
-	XtVaSetValues(mb3dviewptr->mbview_toggleButton_mode_viewpoint,
-		XmNsensitive, True,
-		NULL);
-	XtVaSetValues(mb3dviewptr->mbview_toggleButton_mode_rrotate,
-		XmNsensitive, True,
-		NULL);
-	XtVaSetValues(mb3dviewptr->mbview_toggleButton_mode_rviewpoint,
-		XmNsensitive, True,
-		NULL);
-	}
-
-    /* set label */
-    if (data->mouse_mode == MBV_MOUSE_MOVE)
-	sprintf(value_text,":::t\"Mouse Mode:\":t\"L: Pick\":t\"M: Pan\":t\"R: Zoom\"");
-    else if (data->mouse_mode == MBV_MOUSE_ROTATE)
-	sprintf(value_text,":::t\"Mouse Mode:\":t\"L: Pick\":t\"M: Rotate\":t\"R:Exageration\"");
-    else if (data->mouse_mode == MBV_MOUSE_SHADE)
-	sprintf(value_text,":::t\"Mouse Mode:\":t\"L: Pick\":t\"M: Light Source\":t\"R: Shade Magnitude\"");
-    else if (data->mouse_mode == MBV_MOUSE_VIEWPOINT)
-	sprintf(value_text,":::t\"Mouse Mode:\":t\"L: Pick\":t\"M: View Rotate\":t\"R: Exageration\"");
-    else if (data->mouse_mode == MBV_MOUSE_AREA)
-	sprintf(value_text,":::t\"Mouse Mode:\":t\"L: Drag Region\":t\"M: Drag Area\":t\"R: Area Width\"");
-    else if (data->mouse_mode == MBV_MOUSE_SITE)
-	sprintf(value_text,":::t\"Mouse Mode:\":t\"L: Select Site\":t\"M: Add Site\":t\"R: Delete Site\"");
-    else if (data->mouse_mode == MBV_MOUSE_ROUTE)
-	sprintf(value_text,":::t\"Mouse Mode:\":t\"L: Select Route\":t\"M: Add Route\":t\"R: Delete Route\"");
-    else if (data->mouse_mode == MBV_MOUSE_NAV)
-	sprintf(value_text,":::t\"Mouse Mode:\":t\"L: Pick\":t\"M: Select Nav\":t\"R: Deselect Nav\"");
-    else if (data->mouse_mode == MBV_MOUSE_NAVFILE)
-	sprintf(value_text,":::t\"Mouse Mode:\":t\"L: Pick\":t\"M: Select Nav File\":t\"R: Deselect Nav File\"");
-    set_mbview_label_multiline_string(view->mb3dview.mbview_label_mouse, value_text);
-
-
-}
-
-/*------------------------------------------------------------------------------*/
-void
-set_mbview_grid_mode(size_t instance, int mode)
-{
-    Boolean	value;
-    struct mbview_world_struct *view;
-    struct mbview_struct *data;
-    MB3DViewData	*mb3dviewptr;
-
-if (mbv_verbose >= 2)
-fprintf(stderr,"set_mbview_grid_mode: instance:%zu mode:%d\n", instance, mode);
-
-    /* get view */
-    view = &(mbviews[instance]);
-    data = &(view->data);
-
-    mb3dviewptr = &(view->mb3dview);
-
-	if (mode == MBV_GRID_VIEW_PRIMARY)
-		value = True;
-	else
-		value = False;
-	XmToggleButtonSetState(mb3dviewptr->mbview_toggleButton_data_primary,
-				    value, False);
-
-	if (mode == MBV_GRID_VIEW_PRIMARYSLOPE)
-		value = True;
-	else
-		value = False;
-	XmToggleButtonSetState(mb3dviewptr->mbview_toggleButton_data_primaryslope,
-				    value, False);
-
-	if (mode == MBV_GRID_VIEW_SECONDARY)
-		value = True;
-	else
-		value = False;
-	XmToggleButtonSetState(mb3dviewptr->mbview_toggleButton_data_secondary,
-				    value, False);
-}
-
-/*------------------------------------------------------------------------------*/
-void
-set_mbview_histogram_mode(size_t instance, int mode)
-{
-    Boolean	value;
-    struct mbview_world_struct *view;
-    struct mbview_struct *data;
-    MB3DViewData	*mb3dviewptr;
-
-if (mbv_verbose >= 2)
-fprintf(stderr,"set_mbview_histogram_mode: instance:%zu mode:%d\n", instance, mode);
-
-    /* get view */
-    view = &(mbviews[instance]);
-    data = &(view->data);
-
-    mb3dviewptr = &(view->mb3dview);
-	if (mode == MB_YES)
-		value = True;
-	else
-		value = False;
-	XmToggleButtonSetState(mb3dviewptr->mbview_toggleButton_histogram,
-				    value, False);
-
-}
-
-/*------------------------------------------------------------------------------*/
-void
-set_mbview_shade_mode(size_t instance, int mode)
-{
-    Boolean	value;
-    struct mbview_world_struct *view;
-    struct mbview_struct *data;
-    MB3DViewData	*mb3dviewptr;
-
-if (mbv_verbose >= 2)
-fprintf(stderr,"do_mbview_shade_mode: instance:%zu mode:%d\n", instance, mode);
-
-    /* get view */
-    view = &(mbviews[instance]);
-    data = &(view->data);
-
-    mb3dviewptr = &(view->mb3dview);
-
-	if (mode == MBV_SHADE_VIEW_NONE)
-		value = True;
-	else
-		value = False;
-	XmToggleButtonSetState(mb3dviewptr->mbview_toggleButton_overlay_none,
-				    value, False);
-
-	if (mode == MBV_SHADE_VIEW_ILLUMINATION)
-		value = True;
-	else
-		value = False;
-	XmToggleButtonSetState(mb3dviewptr->mbview_toggleButton_overlay_illumination,
-				    value, False);
-
-	if (mode == MBV_SHADE_VIEW_SLOPE)
-		value = True;
-	else
-		value = False;
-	XmToggleButtonSetState(mb3dviewptr->mbview_toggleButton_overlay_slope,
-				    value, False);
-
-	if (mode == MBV_SHADE_VIEW_OVERLAY)
-		value = True;
-	else
-		value = False;
-	XmToggleButtonSetState(mb3dviewptr->mbview_toggleButton_overlay_secondary,
-				    value, False);
-}
-
-/*------------------------------------------------------------------------------*/
-void
-set_mbview_contour_mode(size_t instance, int mode)
-{
-    Boolean	value;
-    struct mbview_world_struct *view;
-    struct mbview_struct *data;
-    MB3DViewData	*mb3dviewptr;
-
-if (mbv_verbose >= 2)
-fprintf(stderr,"do_mbview_contour_mode: instance:%zu mode:%d\n", instance, mode);
-
-    /* get view */
-    view = &(mbviews[instance]);
-    data = &(view->data);
-
-    mb3dviewptr = &(view->mb3dview);
-	if (mode == MBV_VIEW_ON)
-		value = True;
-	else
-		value = False;
-	XmToggleButtonSetState(mb3dviewptr->mbview_toggleButton_overlay_contour,
-				    value, False);
-
-}
-
-/*------------------------------------------------------------------------------*/
-void
-set_mbview_site_view_mode(size_t instance, int mode)
-{
-    Boolean	value;
-    struct mbview_world_struct *view;
-    struct mbview_struct *data;
-    MB3DViewData	*mb3dviewptr;
-
-if (mbv_verbose >= 2)
-fprintf(stderr,"do_mbview_site_view_mode: instance:%zu mode:%d\n", instance, mode);
-
-    /* get view */
-    view = &(mbviews[instance]);
-    data = &(view->data);
-
-    mb3dviewptr = &(view->mb3dview);
-	if (mode == MBV_VIEW_ON)
-		value = True;
-	else
-		value = False;
-	XmToggleButtonSetState(mb3dviewptr->mbview_toggleButton_site,
-				    value, False);
-
-}
-
-/*------------------------------------------------------------------------------*/
-void
-set_mbview_route_view_mode(size_t instance, int mode)
-{
-    Boolean	value;
-    struct mbview_world_struct *view;
-    struct mbview_struct *data;
-    MB3DViewData	*mb3dviewptr;
-
-if (mbv_verbose >= 2)
-fprintf(stderr,"do_mbview_route_view_mode: instance:%zu mode:%d\n", instance, mode);
-
-    /* get view */
-    view = &(mbviews[instance]);
-    data = &(view->data);
-
-    mb3dviewptr = &(view->mb3dview);
-	if (mode == MBV_VIEW_ON)
-		value = True;
-	else
-		value = False;
-	XmToggleButtonSetState(mb3dviewptr->mbview_toggleButton_route,
-				    value, False);
-
-}
-
-/*------------------------------------------------------------------------------*/
-void
-set_mbview_nav_view_mode(size_t instance, int mode)
-{
-    Boolean	value;
-    struct mbview_world_struct *view;
-    struct mbview_struct *data;
-    MB3DViewData	*mb3dviewptr;
-
-if (mbv_verbose >= 2)
-fprintf(stderr,"do_mbview_nav_view_mode: instance:%zu mode:%d\n", instance, mode);
-
-    /* get view */
-    view = &(mbviews[instance]);
-    data = &(view->data);
-
-    mb3dviewptr = &(view->mb3dview);
-	if (mode == MBV_VIEW_ON)
-		value = True;
-	else
-		value = False;
-	XmToggleButtonSetState(mb3dviewptr->mbview_toggleButton_nav,
-				    value, False);
-
-}
-
-/*------------------------------------------------------------------------------*/
-void
-set_mbview_navdrape_view_mode(size_t instance, int mode)
-{
-    Boolean	value;
-    struct mbview_world_struct *view;
-    struct mbview_struct *data;
-    MB3DViewData	*mb3dviewptr;
-
-if (mbv_verbose >= 2)
-fprintf(stderr,"do_mbview_nav_view_mode: instance:%zu mode:%d\n", instance, mode);
-
-    /* get view */
-    view = &(mbviews[instance]);
-    data = &(view->data);
-
-    mb3dviewptr = &(view->mb3dview);
-	if (mode == MBV_VIEW_ON)
-		value = True;
-	else
-		value = False;
-	XmToggleButtonSetState(mb3dviewptr->mbview_toggleButton_navdrape,
-				    value, False);
-
-}
-
-/*------------------------------------------------------------------------------*/
-void
-set_mbview_vector_view_mode(size_t instance, int mode)
-{
-    Boolean	value;
-    struct mbview_world_struct *view;
-    struct mbview_struct *data;
-    MB3DViewData	*mb3dviewptr;
-
-if (mbv_verbose >= 2)
-fprintf(stderr,"do_mbview_vector_view_mode: instance:%zu mode:%d\n", instance, mode);
-
-    /* get view */
-    view = &(mbviews[instance]);
-    data = &(view->data);
-
-    mb3dviewptr = &(view->mb3dview);
-	if (mode == MBV_VIEW_ON)
-		value = True;
-	else
-		value = False;
-	XmToggleButtonSetState(mb3dviewptr->mbview_toggleButton_vector,
-				    value, False);
-
-}
-
-/*------------------------------------------------------------------------------*/
-void
-set_mbview_display_mode(size_t instance, int mode)
-{
-    Boolean	value;
-    struct mbview_world_struct *view;
-    struct mbview_struct *data;
-    MB3DViewData	*mb3dviewptr;
-
-if (mbv_verbose >= 2)
-fprintf(stderr,"set_mbview_display_mode: instance:%zu mode:%d\n", instance, mode);
-
-    /* get view */
-    view = &(mbviews[instance]);
-    data = &(view->data);
-
-    mb3dviewptr = &(view->mb3dview);
-
-	if (mode == MBV_DISPLAY_2D)
-		value = True;
-	else
-		value = False;
-	XmToggleButtonSetState(mb3dviewptr->mbview_toggleButton_display_2D,
-				    value, False);
-
-	if (mode == MBV_DISPLAY_3D)
-		value = True;
-	else
-		value = False;
-	XmToggleButtonSetState(mb3dviewptr->mbview_toggleButton_display_3D,
-				    value, False);
-}
-/*------------------------------------------------------------------------------*/
-void
-set_mbview_colortable(size_t instance, int mode)
-{
-    Boolean	value;
-    struct mbview_world_struct *view;
-    struct mbview_struct *data;
-    MB3DViewData	*mb3dviewptr;
-
-if (mbv_verbose >= 2)
-fprintf(stderr,"do_mbview_colortable: instance:%zu mode:%d\n", instance, mode);
-
-    /* get view */
-    view = &(mbviews[instance]);
-    data = &(view->data);
-
-    mb3dviewptr = &(view->mb3dview);
-
-	if (mode == MBV_COLORTABLE_HAXBY)
-		value = True;
-	else
-		value = False;
-	XmToggleButtonSetState(mb3dviewptr->mbview_toggleButton_colortable_haxby,
-				    value, False);
-
-	if (mode == MBV_COLORTABLE_BRIGHT)
-		value = True;
-	else
-		value = False;
-	XmToggleButtonSetState(mb3dviewptr->mbview_toggleButton_colortable_bright,
-				    value, False);
-
-	if (mode == MBV_COLORTABLE_MUTED)
-		value = True;
-	else
-		value = False;
-	XmToggleButtonSetState(mb3dviewptr->mbview_toggleButton_colortable_muted,
-				    value, False);
-
-	if (mode == MBV_COLORTABLE_GRAY)
-		value = True;
-	else
-		value = False;
-	XmToggleButtonSetState(mb3dviewptr->mbview_toggleButton_colortable_gray,
-				    value, False);
-
-	if (mode == MBV_COLORTABLE_FLAT)
-		value = True;
-	else
-		value = False;
-	XmToggleButtonSetState(mb3dviewptr->mbview_toggleButton_colortable_flat,
-				    value, False);
-
-	if (mode == MBV_COLORTABLE_SEALEVEL1)
-		value = True;
-	else
-		value = False;
-	XmToggleButtonSetState(mb3dviewptr->mbview_toggleButton_colortable_sealevel1,
-				    value, False);
-
-	if (mode == MBV_COLORTABLE_SEALEVEL2)
-		value = True;
-	else
-		value = False;
-	XmToggleButtonSetState(mb3dviewptr->mbview_toggleButton_colortable_sealevel2,
-				    value, False);
-
-}
-
-/*------------------------------------------------------------------------------*/
-void
-set_mbview_colortable_mode(size_t instance, int mode)
-{
-    struct mbview_world_struct *view;
-    struct mbview_struct *data;
-
-if (mbv_verbose >= 2)
-fprintf(stderr,"do_mbview_colortable_mode: instance:%zu mode:%d\n", instance, mode);
-
-    /* get view */
-    view = &(mbviews[instance]);
-    data = &(view->data);
-
-}
-
-/*------------------------------------------------------------------------------*/
-
-void
-do_mbview_aboutpopdown( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-	size_t	instance;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-
-	/* get instance */
-	ac = 0;
-	XtSetArg(args[ac], XmNuserData, (XtPointer) &instance); ac++;
-	XtGetValues(w, args, ac);
-
-if (mbv_verbose >= 2)
-fprintf(stderr,"do_mbview_aboutpopdown: instance:%zu\n", instance);
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-    	XtUnmanageChild(view->mb3dview.mbview_bulletinBoard_about);
-}
-/*------------------------------------------------------------------------------*/
-
-void
-do_mbview_aboutpopup( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-	size_t	instance;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-
-	/* get instance */
-	ac = 0;
-	XtSetArg(args[ac], XmNuserData, (XtPointer) &instance); ac++;
-	XtGetValues(w, args, ac);
-
-if (mbv_verbose >= 2)
-fprintf(stderr,"do_mbview_aboutpopup: instance:%zu\n", instance);
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-    	XtManageChild(view->mb3dview.mbview_bulletinBoard_about);
-
-}
-
-/*------------------------------------------------------------------------------*/
-
-void
-do_mbview_colorboundspopup( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-	size_t	instance;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-
-	/* get instance */
-	ac = 0;
-	XtSetArg(args[ac], XmNuserData, (XtPointer) &instance); ac++;
-	XtGetValues(w, args, ac);
-
-if (mbv_verbose >= 2)
-fprintf(stderr,"do_mbview_colorboundspopup: instance:%zu\n", instance);
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-    	XtManageChild(view->mb3dview.mbview_bulletinBoard_colorbounds);
-
-	/* set values of widgets */
-	sprintf(value_text,"%g", data->primary_colortable_min);
-	XmTextFieldSetString(view->mb3dview.mbview_textField_datamin,
-			value_text);
-	sprintf(value_text,"%g", data->primary_colortable_max);
-	XmTextFieldSetString(view->mb3dview.mbview_textField_datamax,
-			value_text);
-	sprintf(value_text,"%g", data->contour_interval);
-	XmTextFieldSetString(view->mb3dview.mbview_textField_contours,
-			value_text);
-	if (data->primary_colortable_mode == MBV_COLORTABLE_NORMAL)
-		{
-	    	XmToggleButtonSetState(view->mb3dview.mbview_toggleButton_data_ctoh,
-			TRUE, TRUE);
-		}
-	else
-		{
-	    	XmToggleButtonSetState(view->mb3dview.mbview_toggleButton_data_htoc,
-			TRUE, TRUE);
-		}
-	sprintf(value_text,"%g", data->slope_colortable_min);
-	XmTextFieldSetString(view->mb3dview.mbview_textField_slopemin,
-			value_text);
-	sprintf(value_text,"%g", data->slope_colortable_max);
-	XmTextFieldSetString(view->mb3dview.mbview_textField_slopemax,
-			value_text);
-	if (data->slope_colortable_mode == MBV_COLORTABLE_NORMAL)
-		{
-	    	XmToggleButtonSetState(view->mb3dview.mbview_toggleButton_slope_ctoh,
-			TRUE, TRUE);
-		}
-	else
-		{
-	    	XmToggleButtonSetState(view->mb3dview.mbview_toggleButton_slope_htoc,
-			TRUE, TRUE);
-		}
-	sprintf(value_text,"%g", data->secondary_colortable_min);
-	XmTextFieldSetString(view->mb3dview.mbview_textField_overlaymin,
-			value_text);
-	sprintf(value_text,"%g", data->secondary_colortable_max);
-	XmTextFieldSetString(view->mb3dview.mbview_textField_overlaymax,
-			value_text);
-	if (data->secondary_colortable_mode == MBV_COLORTABLE_NORMAL)
-		{
-	    	XmToggleButtonSetState(view->mb3dview.mbview_toggleButton_overlay_ctoh,
-			TRUE, TRUE);
-		}
-	else
-		{
-	    	XmToggleButtonSetState(view->mb3dview.mbview_toggleButton_overlay_htoc,
-			TRUE, TRUE);
-		}
-
-}
-/*------------------------------------------------------------------------------*/
-
-void
-do_mbview_colorboundspopdown( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-	size_t	instance;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-
-	/* get instance */
-	ac = 0;
-	XtSetArg(args[ac], XmNuserData, (XtPointer) &instance); ac++;
-	XtGetValues(w, args, ac);
-
-if (mbv_verbose >= 2)
-fprintf(stderr,"do_mbview_colorboundspopdown: instance:%zu\n", instance);
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-    	XtUnmanageChild(view->mb3dview.mbview_bulletinBoard_colorbounds);
-}
-/*------------------------------------------------------------------------------*/
-
-void
-do_mbview_colorboundsapply( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-	size_t	instance;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-	int	ivalue;
-	double	dvalue;
-	int	change;
-
-	/* get instance */
-	ac = 0;
-	XtSetArg(args[ac], XmNuserData, (XtPointer) &instance); ac++;
-	XtGetValues(w, args, ac);
-
-if (mbv_verbose >= 2)
-fprintf(stderr,"do_mbview_colorboundsapply: instance:%zu\n", instance);
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* get values of widgets */
-
-	change = MB_NO;
-
-	get_mbview_text_string(view->mb3dview.mbview_textField_datamin, value_text);
-	sscanf(value_text,"%lf", &dvalue);
-	if (dvalue != data->primary_colortable_min)
-		{
-		data->primary_colortable_min = dvalue;
-		if (data->grid_mode == MBV_GRID_VIEW_PRIMARY)
-			change = MB_YES;
-		}
-
-	get_mbview_text_string(view->mb3dview.mbview_textField_datamax, value_text);
-	sscanf(value_text,"%lf", &dvalue);
-	if (dvalue != data->primary_colortable_max)
-		{
-		data->primary_colortable_max = dvalue;
- 		if (data->grid_mode == MBV_GRID_VIEW_PRIMARY)
-			change = MB_YES;
-		}
-
-	get_mbview_text_string(view->mb3dview.mbview_textField_contours, value_text);
-	sscanf(value_text,"%lf", &dvalue);
-	if (dvalue != data->contour_interval)
-		{
-		data->contour_interval = dvalue;
-    		view->contourlorez = MB_NO;
-    		view->contourhirez = MB_NO;
-    		view->contourfullrez = MB_NO;
-		view->primary_histogram_set = MB_NO;
-		view->primaryslope_histogram_set = MB_NO;
-		view->secondary_histogram_set = MB_NO;
- 		if (data->grid_contour_mode == MBV_VIEW_ON)
-			change = MB_YES;
-		}
-
-	ivalue = XmToggleButtonGetState(view->mb3dview.mbview_toggleButton_data_htoc);
-	if (ivalue != data->primary_colortable_mode)
-		{
-		data->primary_colortable_mode = ivalue;
-		if (data->grid_mode == MBV_GRID_VIEW_PRIMARY)
-			change = MB_YES;
-		}
-
-	get_mbview_text_string(view->mb3dview.mbview_textField_slopemin, value_text);
-	sscanf(value_text,"%lf", &dvalue);
-	if (dvalue != data->slope_colortable_min)
-		{
-		data->slope_colortable_min = dvalue;
-		if (data->grid_mode == MBV_GRID_VIEW_PRIMARYSLOPE)
-			change = MB_YES;
-		}
-
-	get_mbview_text_string(view->mb3dview.mbview_textField_slopemax, value_text);
-	sscanf(value_text,"%lf", &dvalue);
-	if (dvalue != data->slope_colortable_max)
-		{
-		data->slope_colortable_max = dvalue;
- 		if (data->grid_mode == MBV_GRID_VIEW_PRIMARYSLOPE)
-			change = MB_YES;
-		}
-
-	ivalue = XmToggleButtonGetState(view->mb3dview.mbview_toggleButton_slope_htoc);
-	if (ivalue != data->slope_colortable_mode)
-		{
-		data->slope_colortable_mode = ivalue;
-		if (data->grid_mode == MBV_GRID_VIEW_PRIMARYSLOPE)
-			change = MB_YES;
-		}
-
-	get_mbview_text_string(view->mb3dview.mbview_textField_overlaymin, value_text);
-	sscanf(value_text,"%lf", &dvalue);
-	if (dvalue != data->secondary_colortable_min)
-		{
-		data->secondary_colortable_min = dvalue;
-		if (data->grid_mode == MBV_GRID_VIEW_SECONDARY)
-			change = MB_YES;
-		}
-
-	get_mbview_text_string(view->mb3dview.mbview_textField_overlaymax, value_text);
-	sscanf(value_text,"%lf", &dvalue);
-	if (dvalue != data->secondary_colortable_max)
-		{
-		data->secondary_colortable_max = dvalue;
- 		if (data->grid_mode == MBV_GRID_VIEW_SECONDARY)
-			change = MB_YES;
-		}
-
-	ivalue = XmToggleButtonGetState(view->mb3dview.mbview_toggleButton_overlay_htoc);
-	if (ivalue != data->secondary_colortable_mode)
-		{
-		data->secondary_colortable_mode = ivalue;
-		if (data->grid_mode == MBV_GRID_VIEW_SECONDARY)
-			change = MB_YES;
-		}
-
-    /* clear color status array */
-    if (change == MB_YES)
-	    {
-    	    view->lastdrawrez = MBV_REZ_NONE;
-    	    mbview_setcolorparms(instance);
-	    mbview_colorclear(instance);
-	    }
-
-    /* draw */
-if (mbv_verbose >= 2)
-fprintf(stderr,"Calling mbview_plotlowhigh from do_mbview_colorboundsapply\n");
-    mbview_plotlowhigh(instance);
-
-}
-/*------------------------------------------------------------------------------*/
-
-void
-do_mbview_shadeparmspopup( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-	size_t	instance;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-
-	/* get instance */
-	ac = 0;
-	XtSetArg(args[ac], XmNuserData, (XtPointer) &instance); ac++;
-	XtGetValues(w, args, ac);
-
-if (mbv_verbose >= 0)
-fprintf(stderr,"do_mbview_shadeparmspopup: instance:%zu\n", instance);
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-    	XtManageChild(view->mb3dview.mbview_bulletinBoard_shadeparms);
-
-	/* set values of widgets */
-	sprintf(value_text,"%g", data->illuminate_magnitude);
-	XmTextFieldSetString(view->mb3dview.mbview_textField_illum_amp,
-			value_text);
-	sprintf(value_text,"%g", data->illuminate_azimuth);
-	XmTextFieldSetString(view->mb3dview.mbview_textField_illum_azi,
-			value_text);
-	sprintf(value_text,"%g", data->illuminate_elevation);
-	XmTextFieldSetString(view->mb3dview.mbview_textField_illum_elev,
-			value_text);
-	sprintf(value_text,"%g", data->slope_magnitude);
-	XmTextFieldSetString(view->mb3dview.mbview_textField_slope_amp,
-			value_text);
-	sprintf(value_text,"%g", data->overlay_shade_magnitude);
-	XmTextFieldSetString(view->mb3dview.mbview_textField_overlay_amp,
-			value_text);
-	sprintf(value_text,"%g", data->overlay_shade_center);
-	XmTextFieldSetString(view->mb3dview.mbview_textField_overlay_center,
-			value_text);
-	if (data->overlay_shade_mode == MBV_COLORTABLE_NORMAL)
-		{
-	    	XmToggleButtonSetState(view->mb3dview.mbview_toggleButton_overlay_shade_ctoh,
-			TRUE, TRUE);
-		}
-	else
-		{
-	    	XmToggleButtonSetState(view->mb3dview.mbview_toggleButton_overlay_shade_htoc,
-			TRUE, TRUE);
-		}
-
-}
-/*------------------------------------------------------------------------------*/
-
-void
-do_mbview_shadeparmspopdown( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-	size_t	instance;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-
-	/* get instance */
-	ac = 0;
-	XtSetArg(args[ac], XmNuserData, (XtPointer) &instance); ac++;
-	XtGetValues(w, args, ac);
-
-if (mbv_verbose >= 2)
-fprintf(stderr,"do_mbview_shadeparmspopdown: instance:%zu\n", instance);
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-    	XtUnmanageChild(view->mb3dview.mbview_bulletinBoard_shadeparms);
-}
-/*------------------------------------------------------------------------------*/
-
-void
-do_mbview_shadeparmsapply( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-	size_t	instance;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-	int	ivalue;
-	double	dvalue;
-	int	change;
-	int	shade_mode;
-
-	/* get instance */
-	ac = 0;
-	XtSetArg(args[ac], XmNuserData, (XtPointer) &instance); ac++;
-	XtGetValues(w, args, ac);
-
-if (mbv_verbose >= 2)
-fprintf(stderr,"do_mbview_shadeparmsapply: instance:%zu\n", instance);
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* check current shading mode */
-	if (data->grid_mode == MBV_GRID_VIEW_PRIMARY)
-	    shade_mode = data->primary_shade_mode;
-	else if (data->grid_mode == MBV_GRID_VIEW_PRIMARYSLOPE)
-	    shade_mode = data->slope_shade_mode;
-	else if (data->grid_mode == MBV_GRID_VIEW_SECONDARY)
-	    shade_mode = data->secondary_shade_mode;
-
-	/* get values of widgets */
-
-	/* handle illumination */
-	change = MB_NO;
-
-	get_mbview_text_string(view->mb3dview.mbview_textField_illum_amp, value_text);
-	sscanf(value_text,"%lf", &dvalue);
-	if (dvalue != data->illuminate_magnitude)
-		{
-		data->illuminate_magnitude = dvalue;
-		if (shade_mode == MBV_SHADE_VIEW_ILLUMINATION)
-			change = MB_YES;
-		}
-
-	get_mbview_text_string(view->mb3dview.mbview_textField_illum_azi, value_text);
-	sscanf(value_text,"%lf", &dvalue);
-	if (dvalue != data->illuminate_azimuth)
-		{
-		data->illuminate_azimuth = dvalue;
-		if (shade_mode == MBV_SHADE_VIEW_ILLUMINATION)
-			change = MB_YES;
-		}
-
-	get_mbview_text_string(view->mb3dview.mbview_textField_illum_elev, value_text);
-	sscanf(value_text,"%lf", &dvalue);
-	if (dvalue != data->illuminate_elevation)
-		{
-		data->illuminate_elevation = dvalue;
-		if (shade_mode == MBV_SHADE_VIEW_ILLUMINATION)
-			change = MB_YES;
-		}
-
-	get_mbview_text_string(view->mb3dview.mbview_textField_slope_amp, value_text);
-	sscanf(value_text,"%lf", &dvalue);
-	if (dvalue != data->slope_magnitude)
-		{
-		data->slope_magnitude = dvalue;
-		if (shade_mode == MBV_SHADE_VIEW_SLOPE)
-			change = MB_YES;
-		}
-
-	get_mbview_text_string(view->mb3dview.mbview_textField_overlay_amp, value_text);
-	sscanf(value_text,"%lf", &dvalue);
-	if (dvalue != data->overlay_shade_magnitude)
-		{
-		data->overlay_shade_magnitude = dvalue;
-		if (shade_mode == MBV_SHADE_VIEW_OVERLAY)
-			change = MB_YES;
-		}
-
-	get_mbview_text_string(view->mb3dview.mbview_textField_overlay_center, value_text);
-	sscanf(value_text,"%lf", &dvalue);
-	if (dvalue != data->overlay_shade_center)
-		{
-		data->overlay_shade_center = dvalue;
-		if (shade_mode == MBV_SHADE_VIEW_OVERLAY)
-			change = MB_YES;
-		}
-
-	ivalue = XmToggleButtonGetState(view->mb3dview.mbview_toggleButton_overlay_shade_ctoh);
-	if (ivalue != data->overlay_shade_mode)
-		{
-		data->overlay_shade_mode = ivalue;
-		if (shade_mode == MBV_SHADE_VIEW_OVERLAY)
-			change = MB_YES;
-		}
-
-    /* clear color status array */
-    if (change == MB_YES)
-	    {
-    	    view->lastdrawrez = MBV_REZ_NONE;
-    	    mbview_setcolorparms(instance);
-	    mbview_colorclear(instance);
-	    }
-
-    /* draw */
-if (mbv_verbose >= 2)
-fprintf(stderr,"Calling mbview_plotlowhigh from do_mbview_shadeparmsapply\n");
-    mbview_plotlowhigh(instance);
-
-}
-/*------------------------------------------------------------------------------*/
-
-int do_mbview_3dparmstext(size_t instance)
-{
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-
-if (mbv_verbose >= 2)
-fprintf(stderr,"do_mbview_3dparmstext: instance:%zu\n", instance);
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* set values of widgets */
-	sprintf(value_text,"%g", data->modelazimuth3d);
-	XmTextFieldSetString(view->mb3dview.mbview_textField_model_azimuth,
-			value_text);
-	sprintf(value_text,"%g", data->modelelevation3d);
-	XmTextFieldSetString(view->mb3dview.mbview_textField_model_elevation,
-			value_text);
-	sprintf(value_text,"%g", data->viewazimuth3d);
-	XmTextFieldSetString(view->mb3dview.mbview_textField_view_azimuth,
-			value_text);
-	sprintf(value_text,"%g", data->viewelevation3d);
-	XmTextFieldSetString(view->mb3dview.mbview_textField_view_elevation,
-			value_text);
-	sprintf(value_text,"%g", data->exageration);
-	XmTextFieldSetString(view->mb3dview.mbview_textField_exageration,
-			value_text);
-	sprintf(value_text,"%g", view->offset3d_x);
-	XmTextFieldSetString(view->mb3dview.mbview_textField_view_3doffsetx,
-			value_text);
-	sprintf(value_text,"%g", view->offset3d_y);
-	XmTextFieldSetString(view->mb3dview.mbview_textField_view_3doffsety,
-			value_text);
-	sprintf(value_text,"%g", view->offset3d_z);
-	XmTextFieldSetString(view->mb3dview.mbview_textField_model_3dzoom,
-			value_text);
-	sprintf(value_text,"%g", view->viewoffset3d_z);
-	XmTextFieldSetString(view->mb3dview.mbview_textField_view_3dzoom,
-			value_text);
-
-	return(0);
-}
-/*------------------------------------------------------------------------------*/
-
-void
-do_mbview_3dparmspopup( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-	size_t	instance;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-
-	/* get instance */
-	ac = 0;
-	XtSetArg(args[ac], XmNuserData, (XtPointer) &instance); ac++;
-	XtGetValues(w, args, ac);
-
-if (mbv_verbose >= 2)
-fprintf(stderr,"do_mbview_3dparmspopup: instance:%zu\n", instance);
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-    	XtManageChild(view->mb3dview.mbview_bulletinBoard_3dparms);
-
-	/* set values of widgets */
-	do_mbview_3dparmstext(instance);
-
-}
-/*------------------------------------------------------------------------------*/
-
-void
-do_mbview_3dparmspopdown( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-	size_t	instance;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-
-	/* get instance */
-	ac = 0;
-	XtSetArg(args[ac], XmNuserData, (XtPointer) &instance); ac++;
-	XtGetValues(w, args, ac);
-
-if (mbv_verbose >= 2)
-fprintf(stderr,"do_mbview_3dparmspopdown: instance:%zu\n", instance);
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-    	XtUnmanageChild(view->mb3dview.mbview_bulletinBoard_3dparms);
-}
-/*------------------------------------------------------------------------------*/
-
-void
-do_mbview_3dparmsapply( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-	size_t	instance;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-	double	dvalue;
-	int	change;
-
-	/* get instance */
-	ac = 0;
-	XtSetArg(args[ac], XmNuserData, (XtPointer) &instance); ac++;
-	XtGetValues(w, args, ac);
-
-if (mbv_verbose >= 2)
-fprintf(stderr,"do_mbview_3dparmsapply: instance:%zu\n", instance);
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* get values of widgets */
-
-	change = MB_NO;
-
-	get_mbview_text_string(view->mb3dview.mbview_textField_model_azimuth, value_text);
-	sscanf(value_text,"%lf", &dvalue);
-	if (dvalue != data->modelazimuth3d)
-		{
-		data->modelazimuth3d = dvalue;
-		change = MB_YES;
-		}
-
-	get_mbview_text_string(view->mb3dview.mbview_textField_model_elevation, value_text);
-	sscanf(value_text,"%lf", &dvalue);
-	if (dvalue != data->modelelevation3d)
-		{
-		data->modelelevation3d = dvalue;
-		change = MB_YES;
-		}
-
-	get_mbview_text_string(view->mb3dview.mbview_textField_view_azimuth, value_text);
-	sscanf(value_text,"%lf", &dvalue);
-	if (dvalue != data->viewazimuth3d)
-		{
-		data->viewazimuth3d = dvalue;
-		change = MB_YES;
-		}
-
-	get_mbview_text_string(view->mb3dview.mbview_textField_view_elevation, value_text);
-	sscanf(value_text,"%lf", &dvalue);
-	if (dvalue != data->viewelevation3d)
-		{
-		data->viewelevation3d = dvalue;
-		change = MB_YES;
-		}
-
-	get_mbview_text_string(view->mb3dview.mbview_textField_exageration, value_text);
-	sscanf(value_text,"%lf", &dvalue);
-	if (dvalue != data->exageration)
-		{
-		data->exageration = dvalue;
-		if (data->display_projection_mode != MBV_PROJECTION_SPHEROID)
-			{
-			view->zorigin = data->exageration
-		    			* 0.5 * (data->primary_min
-							+ data->primary_max);
-			}
-		change = MB_YES;
-
-		mbview_zscaleclear(instance);
-    		view->contourlorez = MB_NO;
-		view->contourhirez = MB_NO;
-		view->contourfullrez = MB_NO;
-
-		/* rescale data other than the grid */
-		mbview_zscale(instance);
-
-		/* set flag to reset view bounds */
-		view->viewboundscount++;
-		}
-
-	get_mbview_text_string(view->mb3dview.mbview_textField_view_3doffsetx, value_text);
-	sscanf(value_text,"%lf", &dvalue);
-	if (dvalue != view->offset3d_x)
-		{
-		view->offset3d_x = dvalue;
-		change = MB_YES;
-		}
-
-	get_mbview_text_string(view->mb3dview.mbview_textField_view_3doffsety, value_text);
-	sscanf(value_text,"%lf", &dvalue);
-	if (dvalue != view->offset3d_y)
-		{
-		view->offset3d_y = dvalue;
-		change = MB_YES;
-		}
-
-	get_mbview_text_string(view->mb3dview.mbview_textField_model_3dzoom, value_text);
-	sscanf(value_text,"%lf", &dvalue);
-	if (dvalue != view->offset3d_z)
-		{
-		view->offset3d_z = dvalue;
-		change = MB_YES;
-		}
-
-	get_mbview_text_string(view->mb3dview.mbview_textField_view_3dzoom, value_text);
-	sscanf(value_text,"%lf", &dvalue);
-	if (dvalue != view->viewoffset3d_z)
-		{
-		view->viewoffset3d_z = dvalue;
-		change = MB_YES;
-		}
-
-    /* clear color status array */
-   if (change == MB_YES && data->display_mode == MBV_DISPLAY_3D)
-	    {
-    	    view->lastdrawrez = MBV_REZ_NONE;
-    	    mbview_setcolorparms(instance);
-	    mbview_colorclear(instance);
-	    }
-
-    /* set flag to reset view bounds */
-    view->viewboundscount = MBV_BOUNDSFREQUENCY;
-
-    /* draw */
-if (mbv_verbose >= 2)
-fprintf(stderr,"Calling mbview_plotlowhigh from do_mbview_3dparmsapply\n");
-    mbview_plotlowhigh(instance);
-
-}
-/*------------------------------------------------------------------------------*/
-
-int do_mbview_2dparmstext(size_t instance)
-{
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-
-if (mbv_verbose >= 2)
-fprintf(stderr,"do_mbview_2dparmstext: instance:%zu\n", instance);
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
- 	/* set values of widgets */
-	sprintf(value_text,"%g", view->offset2d_x);
-	XmTextFieldSetString(view->mb3dview.mbview_textField_view_2doffsetx,
-			value_text);
-	sprintf(value_text,"%g", view->offset2d_y);
-	XmTextFieldSetString(view->mb3dview.mbview_textField_view_2doffsety,
-			value_text);
-	sprintf(value_text,"%g", view->size2d);
-	XmTextFieldSetString(view->mb3dview.mbview_textField_view_2dzoom,
-			value_text);
-
-	return(0);
-
-}
-/*------------------------------------------------------------------------------*/
-
-void
-do_mbview_2dparmspopup( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-	size_t	instance;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-
-	/* get instance */
-	ac = 0;
-	XtSetArg(args[ac], XmNuserData, (XtPointer) &instance); ac++;
-	XtGetValues(w, args, ac);
-
-if (mbv_verbose >= 2)
-fprintf(stderr,"do_mbview_2dparmspopup: instance:%zu\n", instance);
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-    	XtManageChild(view->mb3dview.mbview_bulletinBoard_2dparms);
-
-	/* set values of widgets */
-	do_mbview_2dparmstext(instance);
-
-}
-/*------------------------------------------------------------------------------*/
-
-void
-do_mbview_2dparmspopdown( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-	size_t	instance;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-
-	/* get instance */
-	ac = 0;
-	XtSetArg(args[ac], XmNuserData, (XtPointer) &instance); ac++;
-	XtGetValues(w, args, ac);
-
-if (mbv_verbose >= 2)
-fprintf(stderr,"do_mbview_2dparmspopdown: instance:%zu\n", instance);
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-    	XtUnmanageChild(view->mb3dview.mbview_bulletinBoard_2dparms);
-}
-/*------------------------------------------------------------------------------*/
-
-void
-do_mbview_2dparmsapply( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-	size_t	instance;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-	double	dvalue;
-	int	change;
-
-	/* get instance */
-	ac = 0;
-	XtSetArg(args[ac], XmNuserData, (XtPointer) &instance); ac++;
-	XtGetValues(w, args, ac);
-
-if (mbv_verbose >= 2)
-fprintf(stderr,"do_mbview_2dparmsapply: instance:%zu\n", instance);
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* get values of widgets */
-
-	change = MB_NO;
-
-	get_mbview_text_string(view->mb3dview.mbview_textField_view_2doffsetx, value_text);
-	sscanf(value_text,"%lf", &dvalue);
-	if (dvalue != view->offset2d_x)
-		{
-		view->offset2d_x = dvalue;
-		change = MB_YES;
-		}
-
-	get_mbview_text_string(view->mb3dview.mbview_textField_view_2doffsety, value_text);
-	sscanf(value_text,"%lf", &dvalue);
-	if (dvalue != view->offset2d_y)
-		{
-		view->offset2d_y = dvalue;
-		change = MB_YES;
-		}
-
-	get_mbview_text_string(view->mb3dview.mbview_textField_view_2dzoom, value_text);
-	sscanf(value_text,"%lf", &dvalue);
-	if (dvalue != view->size2d)
-		{
-		view->size2d = dvalue;
-		change = MB_YES;
-		}
-
-    /* clear color status array */
-   if (change == MB_YES && data->display_mode == MBV_DISPLAY_2D)
-	    {
-    	    view->lastdrawrez = MBV_REZ_NONE;
-    	    mbview_setcolorparms(instance);
-	    mbview_colorclear(instance);
-	    }
-
-    /* set flag to reset view bounds */
-    view->viewboundscount = MBV_BOUNDSFREQUENCY;
-
-    /* draw */
-if (mbv_verbose >= 2)
-fprintf(stderr,"Calling mbview_plotlowhigh from do_mbview_2dparmsapply\n");
-    mbview_plotlowhigh(instance);
-
-}
-/*------------------------------------------------------------------------------*/
-
-void
-do_mbview_resolutionpopup( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-	size_t	instance;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-
-	/* get instance */
-	ac = 0;
-	XtSetArg(args[ac], XmNuserData, (XtPointer) &instance); ac++;
-	XtGetValues(w, args, ac);
-
-if (mbv_verbose >= 2)
-fprintf(stderr,"do_mbview_resolutionpopup: instance:%zu\n", instance);
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-    	XtManageChild(view->mb3dview.mbview_bulletinBoard_resolution);
-
-	/* set values of resolution sliders */
-	XtVaSetValues(view->mb3dview.mbview_scale_lowresolution,
-			XmNvalue, data->lorez_dimension,
-			NULL);
-	XtVaSetValues(view->mb3dview.mbview_scale_mediumresolution,
-			XmNvalue, data->hirez_dimension,
-			NULL);
-	XtVaSetValues(view->mb3dview.mbview_scale_navlowresolution,
-			XmNvalue, data->lorez_navdecimate,
-			NULL);
-	XtVaSetValues(view->mb3dview.mbview_scale_navmediumresolution,
-			XmNvalue, data->hirez_navdecimate,
-			NULL);
-
-}
-/*------------------------------------------------------------------------------*/
-
-void
-do_mbview_resolutionpopdown( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-	size_t	instance;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-
-	/* get instance */
-	ac = 0;
-	XtSetArg(args[ac], XmNuserData, (XtPointer) &instance); ac++;
-	XtGetValues(w, args, ac);
-
-if (mbv_verbose >= 2)
-fprintf(stderr,"do_mbview_resolutionpopdown: instance:%zu\n", instance);
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-    	XtUnmanageChild(view->mb3dview.mbview_bulletinBoard_resolution);
-}
-/*------------------------------------------------------------------------------*/
-void
-do_mbview_resolutionchange( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-	size_t	instance;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-	int lorez_dimension;
-	int hirez_dimension;
-	int lorez_navdecimate;
-	int hirez_navdecimate;
-
-	/* get instance */
-	ac = 0;
-	XtSetArg(args[ac], XmNuserData, (XtPointer) &instance); ac++;
-	XtGetValues(w, args, ac);
-
-if (mbv_verbose >= 2)
-fprintf(stderr,"do_mbview_resolutionchange: instance:%zu\n", instance);
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* get values of resolution sliders */
-	XtVaGetValues(view->mb3dview.mbview_scale_lowresolution,
-		XmNvalue, &lorez_dimension,
-		NULL);
-	XtVaGetValues(view->mb3dview.mbview_scale_mediumresolution,
-		XmNvalue, &hirez_dimension,
-		NULL);
-	XtVaGetValues(view->mb3dview.mbview_scale_navlowresolution,
-		XmNvalue, &lorez_navdecimate,
-		NULL);
-	XtVaGetValues(view->mb3dview.mbview_scale_navmediumresolution,
-		XmNvalue, &hirez_navdecimate,
-		NULL);
-
-	/* make dimensions even multiples of 10 */
-	if (lorez_dimension > hirez_dimension)
-	    hirez_dimension = lorez_dimension;
-	data->lorez_dimension = 25 * ((int)((lorez_dimension + 12.5) / 25));
-	data->hirez_dimension = 25 * ((int)((hirez_dimension + 12.5) / 25));
-
-	/* set values of resolution sliders */
-	XtVaSetValues(view->mb3dview.mbview_scale_lowresolution,
-			XmNvalue, data->lorez_dimension,
-			NULL);
-	XtVaSetValues(view->mb3dview.mbview_scale_mediumresolution,
-			XmNvalue, data->hirez_dimension,
-			NULL);
-
-	/* set nav decimation */
-	data->lorez_navdecimate = lorez_navdecimate;
-	data->hirez_navdecimate = hirez_navdecimate;
-
-    /* reset status flags and arrays */
-    view->lastdrawrez = MBV_REZ_NONE;
-    mbview_setcolorparms(instance);
-    mbview_colorclear(instance);
-    mbview_zscaleclear(instance);
-    view->contourlorez = MB_NO;
-    view->contourhirez = MB_NO;
-    view->contourfullrez = MB_NO;
-
-if (mbv_verbose >= 2)
-fprintf(stderr,"do_mbview_resolutionchange instance:%zu resolutions: %d %d decimations: %d %d\n",
-instance, data->lorez_dimension, data->hirez_dimension,
-data->lorez_navdecimate, data->hirez_navdecimate);
-
-    /* draw */
-if (mbv_verbose >= 2)
-fprintf(stderr,"Calling mbview_plotlowhigh from do_mbview_resolutionchange\n");
-    mbview_plotlowhigh(instance);
-}
-
-/*------------------------------------------------------------------------------*/
-
-void
-do_mbview_sitelistpopup( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-
-if (mbv_verbose >= 2)
-fprintf(stderr,"do_mbview_sitelistpopup: \n");
-
-    	XtPopup(XtParent(shared.mainWindow_sitelist), XtGrabNone);
-	shared.init_sitelist = MBV_WINDOW_VISIBLE;
-	mbview_updatesitelist();
-}
-/*------------------------------------------------------------------------------*/
-
-void
-do_mbview_routelistpopup( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-
-if (mbv_verbose >= 2)
-fprintf(stderr,"do_mbview_routelistpopup:\n");
-
-    	XtPopup(XtParent(shared.mainWindow_routelist), XtGrabNone);
-	shared.init_routelist = MBV_WINDOW_VISIBLE;
-	mbview_updateroutelist();
-}
-/*------------------------------------------------------------------------------*/
-
-void
-do_mbview_navlistpopup( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-
-if (mbv_verbose >= 2)
-fprintf(stderr,"do_mbview_navlistpopup:\n");
-
-    	XtPopup(XtParent(shared.mainWindow_navlist), XtGrabNone);
-	shared.init_navlist = MBV_WINDOW_VISIBLE;
-	mbview_updatenavlist();
-}
-/*------------------------------------------------------------------------------*/
-
-void
-do_mbview_sitelistselect( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-    int	*position_list = NULL;
-    int position_count = 0;
-    size_t	instance;
-    int	site_selected_old;
-    int	isite;
-    size_t	i;
-
-if (mbv_verbose >= 2)
-fprintf(stderr,"do_mbview_sitelistselect:\n");
-
-	/* get position of selected list item */
-	ac = 0;
-	XtSetArg(args[ac], XmNselectedPositionCount, (XtPointer) &position_count); ac++;
-	XtSetArg(args[ac], XmNselectedPositions, (XtPointer) &position_list); ac++;
-	XtGetValues(w, args, ac);
-
-	/* save last site selection if any */
-	site_selected_old = shared.shareddata.site_selected;
-
-	/* find selected site point if any */
-	shared.shareddata.site_selected = MBV_SELECT_NONE;
-	if (position_count == 1)
-		{
-		shared.shareddata.site_selected = position_list[0] - 1;
-		}
-
-	/* change site color if clicked more than once */
-	if (site_selected_old == shared.shareddata.site_selected)
-		{
-		isite = shared.shareddata.site_selected;
-
-		/* increment color */
-		shared.shareddata.sites[isite].color++;
-		if (shared.shareddata.sites[isite].color == MBV_COLOR_RED)
-			shared.shareddata.sites[isite].color++;
-		if (shared.shareddata.sites[isite].color > MBV_COLOR_PURPLE)
-			shared.shareddata.sites[isite].color = MBV_COLOR_BLACK;
-
-		/* update site list */
-		mbview_updatesitelist();
-		}
-
-
-	/* redraw valid instances */
-	instance = MBV_NO_WINDOW;
-	for (i=0;i<MBV_MAX_WINDOWS;i++)
-		{
-		if (mbviews[i].data.active == MB_YES)
-			{
-			/* set instance to first good instance */
-			if (instance == MBV_NO_WINDOW)
-				instance = i;
-
-			/* set pick annotation */
-			mbviews[i].data.pickinfo_mode = MBV_PICK_SITE;
-			mbview_pick_text(i);
-			/* draw */
-if (mbv_verbose >= 2)
-fprintf(stderr,"Calling mbview_plotlowhigh from do_mbview_sitelistselect instance:%zu\n",instance);
-			mbview_plotlowhigh(i);
-			mbview_plotlowhighall(i);
-			}
-		}
-
-}
-/*------------------------------------------------------------------------------*/
-
-void
-do_mbview_routelistselect( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-    int	*position_list = NULL;
-    int position_count = 0;
-    int	iroute, iposition;
-    int	iroutepos;
-    size_t	instance;
-    int	route_selected_old;
-    int	route_point_selected_old;
-    int	iwaypoint;
-    size_t	i;
-
-if (mbv_verbose >= 2)
-fprintf(stderr,"do_mbview_routelistselect:\n");
-
-	/* get position of selected list item */
-	ac = 0;
-	XtSetArg(args[ac], XmNselectedPositionCount, (XtPointer) &position_count); ac++;
-	XtSetArg(args[ac], XmNselectedPositions, (XtPointer) &position_list); ac++;
-	XtGetValues(shared.mb3d_routelist.mbview_list_routelist, args, ac);
-
-	/* save last route selection if any */
-	route_selected_old = shared.shareddata.route_selected;
-	route_point_selected_old = shared.shareddata.route_point_selected;
-
-	/* find selected route point if any */
-	shared.shareddata.route_selected = MBV_SELECT_NONE;
-	shared.shareddata.route_point_selected = MBV_SELECT_NONE;
-	if (position_count == 1)
-		{
-		iposition = position_list[0] - 1;
-		iroutepos = 0;
-		for (iroute=0;iroute<shared.shareddata.nroute;iroute++)
-			{
-			if (iroutepos == iposition)
-				{
-				shared.shareddata.route_selected = iroute;
-				shared.shareddata.route_point_selected = MBV_SELECT_ALL;
-				}
-			else if (iroutepos < iposition
-				&& iroutepos + shared.shareddata.routes[iroute].npoints >= iposition)
-				{
-				shared.shareddata.route_selected = iroute;
-				shared.shareddata.route_point_selected = iposition - iroutepos - 1;
-				}
-			iroutepos += shared.shareddata.routes[iroute].npoints + 1;
-			}
-
-		/* change route color if clicked more than once */
-		if (route_selected_old == shared.shareddata.route_selected
-			&& route_point_selected_old == MBV_SELECT_ALL
-			&& shared.shareddata.route_point_selected == MBV_SELECT_ALL)
-			{
-			iroute = shared.shareddata.route_selected;
-
-			/* increment color */
-			shared.shareddata.routes[iroute].color++;
-			if (shared.shareddata.routes[iroute].color == MBV_COLOR_RED)
-				shared.shareddata.routes[iroute].color++;
-			if (shared.shareddata.routes[iroute].color > MBV_COLOR_PURPLE)
-				shared.shareddata.routes[iroute].color = MBV_COLOR_BLACK;
-
-			/* update route list */
-			mbview_updateroutelist();
-			}
-
-		/* change waypoint type if waypoint clicked more than once */
-		if (route_selected_old == shared.shareddata.route_selected
-			&& route_point_selected_old == shared.shareddata.route_point_selected)
-			{
-			iroute = shared.shareddata.route_selected;
-			iwaypoint = shared.shareddata.route_point_selected;
-
-			/* increment waypoint type */
-			shared.shareddata.routes[iroute].waypoint[iwaypoint]++;
-			if (shared.shareddata.routes[iroute].waypoint[iwaypoint] < MBV_ROUTE_WAYPOINT_SIMPLE
-				|| shared.shareddata.routes[iroute].waypoint[iwaypoint] > MBV_ROUTE_WAYPOINT_ENDLINE4)
-				shared.shareddata.routes[iroute].waypoint[iwaypoint] = MBV_ROUTE_WAYPOINT_SIMPLE;
-
-			/* update route list */
-			mbview_updateroutelist();
-			}
-		}
-
-	/* redraw valid instances */
-	instance = MBV_NO_WINDOW;
-	for (i=0;i<MBV_MAX_WINDOWS;i++)
-		{
-		if (mbviews[i].data.active == MB_YES)
-			{
-			/* set instance to first good instance */
-			if (instance == MBV_NO_WINDOW)
-				instance = i;
-
-			/* set pick annotation */
-			mbviews[i].data.pickinfo_mode = MBV_PICK_ROUTE;
-			mbview_pick_text(i);
-
-			/* draw */
-if (mbv_verbose >= 2)
-fprintf(stderr,"Calling mbview_plotlowhigh from do_mbview_routelistselect\n");
-			mbview_plotlowhigh(i);
-			mbview_plotlowhighall(i);
-			}
-		}
-}
-/*------------------------------------------------------------------------------*/
-
-void
-do_mbview_navlistselect( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-    int	*position_list = NULL;
-    int position_count = 0;
-    int	inav, jpt;
-    size_t instance;
-    size_t i;
-    int	j;
-
-if (mbv_verbose >= 2)
-fprintf(stderr,"do_mbview_navlistselect:\n");
-
-	/* get position of selected list item */
-	ac = 0;
-	XtSetArg(args[ac], XmNselectedPositionCount, (XtPointer) &position_count); ac++;
-	XtSetArg(args[ac], XmNselectedPositions, (XtPointer) &position_list); ac++;
-	XtGetValues(shared.mb3d_navlist.mbview_list_navlist, args, ac);
-
-	/* first deselect all navigation */
-	shared.shareddata.navpick_type = MBV_PICK_NONE;
-	shared.shareddata.nav_selected[0] = MBV_SELECT_NONE;
-	shared.shareddata.nav_point_selected[0] = MBV_SELECT_NONE;
-	shared.shareddata.nav_selected[1] = MBV_SELECT_NONE;
-	shared.shareddata.nav_point_selected[1] = MBV_SELECT_NONE;
-	for (inav=0;inav<shared.shareddata.nnav;inav++)
-		{
-		shared.shareddata.navs[inav].nselected = 0;
-		for (jpt=0;jpt<shared.shareddata.navs[inav].npoints;jpt++)
-			{
-			shared.shareddata.navs[inav].navpts[jpt].selected = MB_NO;
-			}
-		}
-
-	/* now select all nav points in selected files */
-	for (j=0;j<position_count;j++)
-		{
-		inav = position_list[j] - 1;
-		if (shared.shareddata.navs[inav].npoints > 0)
-			{
-
-			/* Select all nav points in inav */
-			for (jpt=0;jpt<shared.shareddata.navs[inav].npoints;jpt++)
-				{
-				shared.shareddata.navs[inav].navpts[jpt].selected = MB_YES;
-				shared.shareddata.navs[inav].nselected++;
-				}
-
-			/* pick first and last navigation points */
-			if (j == 0)
-				{
-				shared.shareddata.navpick_type = MBV_PICK_ONEPOINT;
-				shared.shareddata.nav_selected[0] = inav;
-				shared.shareddata.nav_point_selected[0] = 0;
-				shared.shareddata.navpick.endpoints[0]
-					= shared.shareddata.navs[inav].navpts[shared.shareddata.nav_point_selected[0]].point;
-				}
-			if (j == position_count - 1)
-				{
-				shared.shareddata.navpick_type = MBV_PICK_TWOPOINT;
-				shared.shareddata.nav_selected[1] = inav;
-				shared.shareddata.nav_point_selected[1] = shared.shareddata.navs[inav].npoints - 1;
-				shared.shareddata.navpick.endpoints[1]
-					= shared.shareddata.navs[inav].navpts[shared.shareddata.nav_point_selected[1]].point;
-				}
-			}
-		}
-
-	/* only call it a two point pick if the two points are different */
-	if (shared.shareddata.navpick_type == MBV_PICK_TWOPOINT
-			&& shared.shareddata.nav_selected[0] == shared.shareddata.nav_selected[1]
-			&& shared.shareddata.nav_point_selected[0] == shared.shareddata.nav_point_selected[1])
-		shared.shareddata.navpick_type = MBV_PICK_ONEPOINT;
-
-	/* redraw valid instances */
-	instance = MBV_NO_WINDOW;
-	for (i=0;i<MBV_MAX_WINDOWS;i++)
-		{
-		if (mbviews[i].data.active == MB_YES)
-			{
-			/* set instance to first good instance */
-			if (instance == MBV_NO_WINDOW)
-				instance = i;
-
-			/* generate 3D drape of pick marks */
-			mbview_navpicksize(i);
-
-			/* set pick annotation */
-			mbviews[i].data.pickinfo_mode = MBV_PICK_NAV;
-			mbview_pick_text(i);
-
-			/* draw */
-if (mbv_verbose >= 2)
-fprintf(stderr,"Calling mbview_plotlowhigh from do_mbview_sitelistselect: instance:%zu\n", i);
-			mbview_plotlowhigh(i);
-			mbview_plotlowhighall(i);
-
-			/* extract profile if pick is right type */
-			if (mbviews[i].data.pickinfo_mode == MBV_PICK_NAV)
-			   mbview_extract_nav_profile(i);
-
-			/* now replot profile */
-			mbview_plotprofile(i);
-			}
-		}
-
-	/* set widget sensitivity */
-	mbview_action_sensitivityall();
-}
-
-/*------------------------------------------------------------------------------*/
-void
-do_mbview_sitelist_delete( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-    int	*position_list = NULL;
-    int position_count = 0;
-    int	isite;
-    size_t	instance;
-    int	i;
-
-if (mbv_verbose >= 2)
-fprintf(stderr,"do_mbview_sitelist_delete:\n");
-
-	/* get position of selected list item */
-	ac = 0;
-	XtSetArg(args[ac], XmNselectedPositionCount, (XtPointer) &position_count); ac++;
-	XtSetArg(args[ac], XmNselectedPositions, (XtPointer) &position_list); ac++;
-	XtGetValues(shared.mb3d_sitelist.mbview_list_sitelist, args, ac);
-
-	/* deselect any selected site */
-	shared.shareddata.site_selected = MBV_SELECT_NONE;
-
-	/* get first valid instance */
-	instance = MBV_NO_WINDOW;
-	for (i=0;i<MBV_MAX_WINDOWS;i++)
-		{
-		if (instance == MBV_NO_WINDOW && mbviews[i].data.active == MB_YES)
-			instance = i;
-		}
-
-	/* delete selected site points in reverse order if any */
-	for (i=position_count-1;i>=0;i--)
-		{
-		isite = position_list[i] - 1;
-		mbview_site_delete(instance, isite);
-		}
-
-	/* reset pick annotation */
-	if (position_count > 0)
-		{
-		for (i=0;i<MBV_MAX_WINDOWS;i++)
-			{
-			if (mbviews[i].data.active == MB_YES)
-				{
-				/* set pick annotation */
-				if (mbviews[i].data.pickinfo_mode == MBV_PICK_SITE)
-					mbviews[i].data.pickinfo_mode = MBV_PICK_NONE;
-				mbview_pick_text(i);
-
-				/* draw */
-if (mbv_verbose >= 2)
-fprintf(stderr,"Calling mbview_plotlowhigh from do_mbview_sitelist_delete\n");
-				mbview_plotlowhigh(i);
-				mbview_plotlowhighall(i);
-				}
-			}
-
-		/* update site list */
-		mbview_updatesitelist();
-		}
-
-	/* set widget sensitivity */
-	mbview_action_sensitivityall();
-}
-
-/*------------------------------------------------------------------------------*/
-void
-do_mbview_routelist_delete( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-    int	*position_list = NULL;
-    int position_count = 0;
-    int	iposition;
-    int	iroute, jwaypoint;
-    size_t	instance;
-    int	done;
-    int	i;
-
-if (mbv_verbose >= 2)
-fprintf(stderr,"do_mbview_routelist_delete:\n");
-
-	/* get position of selected list item */
-	ac = 0;
-	XtSetArg(args[ac], XmNselectedPositionCount, (XtPointer) &position_count); ac++;
-	XtSetArg(args[ac], XmNselectedPositions, (XtPointer) &position_list); ac++;
-	XtGetValues(shared.mb3d_routelist.mbview_list_routelist, args, ac);
-
-	/* deselect any selected route */
-	shared.shareddata.route_selected = MBV_SELECT_NONE;
-
-	/* get first valid instance */
-	instance = MBV_NO_WINDOW;
-	for (i=0;i<MBV_MAX_WINDOWS;i++)
-		{
-		if (instance == MBV_NO_WINDOW && mbviews[i].data.active == MB_YES)
-			instance = i;
-		}
-
-	/* figure out which routes and waypoints are selected,
-		and flag them for deletion by settting waypoint
-		values to MBV_ROUTE_WAYPOINT_DELETEFLAG */
-	for (i=0;i<position_count;i++)
-		{
-		iposition = 0;
-		done = MB_NO;
-		for (iroute=0;iroute<shared.shareddata.nroute && done == MB_NO;iroute++)
-			{
-			iposition++;
-
-			/* delete entire route */
-			if (iposition == position_list[i])
-				{
-				for (jwaypoint=0;jwaypoint<shared.shareddata.routes[iroute].npoints;jwaypoint++)
-					{
-					shared.shareddata.routes[iroute].waypoint[jwaypoint] = MBV_ROUTE_WAYPOINT_DELETEFLAG;
-					}
-				done = MB_YES;
-				}
-
-			/* else check waypoints */
-			else
-				{
-				for (jwaypoint=0;jwaypoint<shared.shareddata.routes[iroute].npoints && done == MB_NO;jwaypoint++)
-					{
-					iposition++;
-					if (iposition == position_list[i])
-						{
-						shared.shareddata.routes[iroute].waypoint[jwaypoint] = MBV_ROUTE_WAYPOINT_DELETEFLAG;
-						done = MB_YES;
-						}
-					}
-				}
-			}
-		}
-
-	/* now loop over all route waypoints backwards, deleting any that have been flagged */
-	for (iroute=shared.shareddata.nroute-1;iroute>=0;iroute--)
-		{
-		for (jwaypoint=shared.shareddata.routes[iroute].npoints-1;jwaypoint>=0;jwaypoint--)
-			{
-			if (shared.shareddata.routes[iroute].waypoint[jwaypoint]
-				== MBV_ROUTE_WAYPOINT_DELETEFLAG)
-				mbview_route_delete(instance, iroute, jwaypoint);
-			}
-		}
-
-	/* reset pick annotation */
-	if (position_count > 0)
-		{
-		for (i=0;i<MBV_MAX_WINDOWS;i++)
-			{
-			if (mbviews[i].data.active == MB_YES)
-				{
-				/* set pick annotation */
-				if (mbviews[i].data.pickinfo_mode == MBV_PICK_ROUTE)
-					mbviews[i].data.pickinfo_mode = MBV_PICK_NONE;
-				mbview_pick_text(i);
-
-				/* draw */
-if (mbv_verbose >= 2)
-fprintf(stderr,"Calling mbview_plotlowhigh from do_mbview_routelist_delete\n");
-				mbview_plotlowhigh(i);
-				mbview_plotlowhighall(i);
-				}
-			}
-
-		/* update route list */
-		mbview_updateroutelist();
-		}
-
-	/* set widget sensitivity */
-	mbview_action_sensitivityall();
-}
-/*------------------------------------------------------------------------------*/
-void
-do_mbview_navlist_delete( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-    int	*position_list = NULL;
-    int position_count = 0;
-    int	inav;
-    size_t	instance;
-    int		i;
-
-if (mbv_verbose >= 2)
-fprintf(stderr,"do_mbview_navlist_delete:\n");
-
-	/* get position of selected list item */
-	ac = 0;
-	XtSetArg(args[ac], XmNselectedPositionCount, (XtPointer) &position_count); ac++;
-	XtSetArg(args[ac], XmNselectedPositions, (XtPointer) &position_list); ac++;
-	XtGetValues(shared.mb3d_navlist.mbview_list_navlist, args, ac);
-
-	/* deselect any selected nav */
-	shared.shareddata.navpick_type = MBV_PICK_NONE;
-	shared.shareddata.nav_selected[0] = MBV_SELECT_NONE;
-	shared.shareddata.nav_selected[1] = MBV_SELECT_NONE;
-
-	/* get first valid instance */
-	instance = MBV_NO_WINDOW;
-	for (i=0;i<MBV_MAX_WINDOWS;i++)
-		{
-		if (instance == MBV_NO_WINDOW && mbviews[i].data.active == MB_YES)
-			instance = i;
-		}
-
-	/* delete selected nav points in reverse order if any */
-	for (i=position_count-1;i>=0;i--)
-		{
-		inav = position_list[i] - 1;
-		mbview_nav_delete(instance, inav);
-		}
-
-	/* reset pick annotation */
-	if (position_count > 0)
-		{
-		for (i=0;i<MBV_MAX_WINDOWS;i++)
-			{
-			if (mbviews[i].data.active == MB_YES)
-				{
-				/* set pick annotation */
-				if (mbviews[i].data.pickinfo_mode == MBV_PICK_NAV)
-					mbviews[i].data.pickinfo_mode = MBV_PICK_NONE;
-				mbview_pick_text(i);
-
-				/* draw */
-if (mbv_verbose >= 2)
-fprintf(stderr,"Calling mbview_plotlowhigh from do_mbview_navlist_delete\n");
-				mbview_plotlowhigh(instance);
-				mbview_plotlowhighall(instance);
-
-				/* extract profile if pick is right type */
-				if (mbviews[i].data.pickinfo_mode == MBV_PICK_NAV)
-			 	  mbview_extract_nav_profile(i);
-
-				/* now replot profile */
-				mbview_plotprofile(i);
-				}
-			}
-
-		/* update nav list */
-		mbview_updatenavlist();
-		}
-
-	/* set widget sensitivity */
-	mbview_action_sensitivityall();
-}
-
-/*------------------------------------------------------------------------------*/
-
-void
-do_mbview_sitelist_popdown( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-
-if (mbv_verbose >= 0)
-fprintf(stderr,"do_mbview_sitelist_popdown:\n");
-
-	shared.init_sitelist = MBV_WINDOW_NULL;
-	XmListDeleteAllItems(shared.mb3d_sitelist.mbview_list_sitelist);
-    	XtPopdown(XtParent(shared.mainWindow_sitelist));
-}
-/*------------------------------------------------------------------------------*/
-
-void
-do_mbview_routelist_popdown( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-
-if (mbv_verbose >= 0)
-fprintf(stderr,"do_mbview_routelist_popdown:\n");
-
-	shared.init_routelist = MBV_WINDOW_NULL;
-	XmListDeleteAllItems(shared.mb3d_routelist.mbview_list_routelist);
-    	XtPopdown(XtParent(shared.mainWindow_routelist));
-}
-/*------------------------------------------------------------------------------*/
-
-void
-do_mbview_navlist_popdown( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-
-if (mbv_verbose >= 0)
-fprintf(stderr,"do_mbview_navlist_popdown:\n");
-
-	shared.init_navlist = MBV_WINDOW_NULL;
- 	XmListDeleteAllItems(shared.mb3d_navlist.mbview_list_navlist);
-   	XtPopdown(XtParent(shared.mainWindow_navlist));
-}
-/*------------------------------------------------------------------------------*/
-void
-do_mbview_full_render( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-	size_t	instance;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-
-	/* get instance */
-	ac = 0;
-	XtSetArg(args[ac], XmNuserData, (XtPointer) &instance); ac++;
-	XtGetValues(w, args, ac);
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-if (mbv_verbose >= 2)
-fprintf(stderr,"do_mbview_full_render\n");
-
-	/* replot in full rez if last draw was lower rez */
-	if (view->lastdrawrez != MBV_REZ_FULL)
-	    {
-if (mbv_verbose >= 2)
-fprintf(stderr,"Calling mbview_plotfull from do_mbview_full_render:\n");
-	    mbview_plotfull(instance);
-	    }
-}
-
-/*------------------------------------------------------------------------------*/
-void
-do_mbview_reset_view( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-	size_t	instance;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-
-	/* get instance */
-	ac = 0;
-	XtSetArg(args[ac], XmNuserData, (XtPointer) &instance); ac++;
-	XtGetValues(w, args, ac);
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-if (mbv_verbose >= 2)
-fprintf(stderr,"do_mbview_reset_view\n");
-
-	/* reset the the view to defaults */
-	view->offset2d_x = 0.0;
-	view->offset2d_y = 0.0;
-	view->size2d = 0.0;
-	view->offset3d_x = 0.0;
-	view->offset3d_y = 0.0;
-	view->offset3d_z = 0.0;
-	view->viewoffset3d_z = 0.0;
-	data->exageration = 1.0;
-	data->modelelevation3d = 90.0;
-	data->modelazimuth3d = 0.0;
-	data->viewelevation3d = 90.0;
-	data->viewazimuth3d = 0.0;
-	view->size2d = 1.0;
-
-	/* reset dialog widgets */
-	do_mbview_3dparmstext(instance);
-	do_mbview_2dparmstext(instance);
-
-	/* rescale grid */
-    	mbview_zscaleclear(instance);
-
-	/* rescale data other than the grid */
-	mbview_zscale(instance);
-
-	/* clear color status array */
-	if (data->display_mode == MBV_DISPLAY_3D)
-		{
-		view->lastdrawrez = MBV_REZ_NONE;
-		mbview_setcolorparms(instance);
-		mbview_colorclear(instance);
-		}
-
-	/* set flag to reset view bounds */
-	view->viewboundscount = MBV_BOUNDSFREQUENCY;
-
-    /* draw */
-if (mbv_verbose >= 2)
-fprintf(stderr,"Calling mbview_plotlowhigh from do_mbview_reset_view\n");
-    mbview_plotlowhigh(instance);
-}
-
-/*------------------------------------------------------------------------------*/
-
-void
-do_mbview_clearpicks( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-    	int	error;
-	size_t	instance;
-	int	replotinstance;
-	int	replotall;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-	int	inav, jpoint;
-
-	/* get instance */
-	ac = 0;
-	XtSetArg(args[ac], XmNuserData, (XtPointer) &instance); ac++;
-	XtGetValues(w, args, ac);
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-if (mbv_verbose >= 2)
-fprintf(stderr,"do_mbview_clearpicks\n");
-
-	/* clear local picks */
-	replotinstance = MB_NO;
-	replotall = MB_NO;
-	if (data->pick_type != MBV_PICK_NONE)
-		{
-		data->pick_type = MBV_PICK_NONE;
-		replotinstance = MB_YES;
-		}
-	if (data->region_type != MBV_REGION_NONE)
-		{
-		data->region_type = MBV_REGION_NONE;
-		replotinstance = MB_YES;
-		}
-	if (data->area_type != MBV_AREA_NONE)
-		{
-		data->area_type = MBV_AREA_NONE;
-		replotinstance = MB_YES;
-		}
-
-	/* clear local profile */
-	if (data->profile.npoints > 0)
-		{
-		data->profile.npoints = 0;
-		data->profile.source = MBV_PROFILE_NONE;
-		if (data->profile_view_mode == MBV_VIEW_ON)
-			mbview_plotprofile(instance);
-		}
-
-	/* clear shared picks */
-	if (shared.shareddata.navpick_type != MBV_PICK_NONE)
-		{
-		shared.shareddata.navpick_type = MBV_PICK_NONE;
-		shared.shareddata.nav_selected[0] = MBV_SELECT_NONE;
-		shared.shareddata.nav_selected[1] = MBV_SELECT_NONE;
-		replotall = MB_YES;
-
-		/* loop over the navs resetting selected points */
-		for (inav=0;inav<shared.shareddata.nnav;inav++)
-			{
-			shared.shareddata.navs[inav].nselected = 0;
-			for (jpoint=0;jpoint<shared.shareddata.navs[inav].npoints;jpoint++)
-				{
-				/* set size and color */
-				if (shared.shareddata.navs[inav].navpts[jpoint].selected == MB_YES)
-					{
-					shared.shareddata.navs[inav].navpts[jpoint].selected = MB_NO;
-					replotall = MB_YES;
-					}
-				}
-			}
-		}
-	if (shared.shareddata.site_selected != MBV_SELECT_NONE)
-		{
-		shared.shareddata.site_selected = MBV_SELECT_NONE;
-		replotall = MB_YES;
-		}
-	if (shared.shareddata.route_selected != MBV_SELECT_NONE)
-		{
-		shared.shareddata.route_selected = MBV_SELECT_NONE;
-		shared.shareddata.route_point_selected = MBV_SELECT_NONE;
-		replotall = MB_YES;
-		}
-
-	/* set widget sensitivity */
-	if (data->active == MB_YES)
-		mbview_update_sensitivity(mbv_verbose, instance, &error);
-
-	/* set pick annotation */
-	mbview_pick_text(instance);
-
-	/* update nav, site, and route lists */
-	mbview_updatenavlist();
-	mbview_updatesitelist();
-	mbview_updateroutelist();
-
-    /* draw */
-    if (replotinstance == MB_YES || replotall == MB_YES)
-    	{
-if (mbv_verbose >= 2)
-fprintf(stderr,"Calling mbview_plotlowhigh from do_mbview_clearpicks\n");
-    	mbview_plotlowhigh(instance);
-	}
-
-    /* if needed replot all active instances */
-    if (replotall == MB_YES)
-	{
-	mbview_plothighall(instance);
-	}
-}
-/*------------------------------------------------------------------------------*/
-
-void
-do_mbview_profile_dismiss( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-	size_t	instance;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-
-	/* get instance */
-	ac = 0;
-	XtSetArg(args[ac], XmNuserData, (XtPointer) &instance); ac++;
-	XtGetValues(w, args, ac);
-
-if (mbv_verbose >= 0)
-fprintf(stderr,"do_mbview_profile_dismiss: instance:%zu\n", instance);
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	if (data->profile_view_mode == MBV_VIEW_ON)
-		{
-		/* destroy opengl context */
-		mbview_destroy_prglx(instance);
-
-		/* turn off profile viewing */
-    		XtUnmanageChild(view->mb3dview.mbview_form_profile);
-		data->profile_view_mode = MBV_VIEW_OFF;
-		}
-
-	/* reset the togglebutton */
-	ac = 0;
-	if (data->profile_view_mode == MBV_VIEW_ON)
-		{
-		XtSetArg(args[ac], XmNset, XmSET); ac++;
-		}
-	else
-		{
-		XtSetArg(args[ac], XmNset, XmUNSET); ac++;
-		}
-	XtSetValues(view->mb3dview.mbview_toggleButton_profile, args, ac);
-
-}
-/*------------------------------------------------------------------------------*/
-
-void
-do_mbview_view_profile( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmAnyCallbackStruct *acs;
-    acs = (XmAnyCallbackStruct*)call_data;
-	size_t	instance;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-
-	/* get instance */
-	ac = 0;
-	XtSetArg(args[ac], XmNuserData, (XtPointer) &instance); ac++;
-	XtGetValues(w, args, ac);
-
-if (mbv_verbose >= 2)
-fprintf(stderr,"do_mbview_view_profile: instance:%zu\n", instance);
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	if (data->profile_view_mode == MBV_VIEW_OFF)
-		{
-
-    		XtManageChild(view->mb3dview.mbview_form_profile);
-		data->profile_view_mode = MBV_VIEW_ON;
-
-		/* intitialize OpenGL graphics */
-		ac = 0;
-		XtSetArg(args[ac], mbGLwNrgba, TRUE);
-		ac++;
-		XtSetArg(args[ac], mbGLwNdepthSize, 1);
-		ac++;
-		XtSetArg(args[ac], mbGLwNdoublebuffer, True);
-		ac++;
-		XtSetArg(args[ac], mbGLwNallocateBackground, FALSE);
-		ac++;
-		XtSetArg(args[ac], XmNwidth, data->prwidth);
-		ac++;
-		XtSetArg(args[ac], XmNheight, data->prheight);
-		ac++;
-		view->dpy = (Display *) XtDisplay(view->mb3dview.MB3DView);
-		view->prglwmda = mbGLwCreateMDrawingArea(view->mb3dview.mbview_drawingArea_profile,
-			"glwidget", args, ac);
-		/* view->prglwmda = XtCreateWidget("glwidget", mbGLwDrawingAreaWidgetClass, view->mb3dview.mbview_drawingArea_profile, args, ac);*/
-		XtManageChild (view->prglwmda);
-		XSelectInput(view->dpy, XtWindow(view->prglwmda),
-			(ButtonPressMask | ButtonReleaseMask | ButtonMotionMask
-				| KeyPressMask | KeyReleaseMask | ExposureMask ) );
-
-		/* initialize the opengl widget */
-		mbview_reset_prglx(instance);
-
-		/* draw the profile */
-		mbview_plotprofile(instance);
-		}
-
-	/* reset the togglebutton */
-	ac = 0;
-	if (data->profile_view_mode == MBV_VIEW_ON)
-		{
-		XtSetArg(args[ac], XmNset, XmSET); ac++;
-		}
-	else
-		{
-		XtSetArg(args[ac], XmNset, XmUNSET); ac++;
-		}
-	XtSetValues(view->mb3dview.mbview_toggleButton_profile, args, ac);
-
-}
-/*------------------------------------------------------------------------------*/
-
-void
-do_mbview_profile_resize( Widget w, XtPointer client_data, XEvent *event, Boolean *unused)
-{
-	size_t	instance;
-	Dimension	width;
-	Dimension	height;
-	XConfigureEvent *cevent = (XConfigureEvent *) event;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-
-	/* get instance */
-	instance = (size_t)client_data;
-
-if (mbv_verbose >= 0)
-fprintf(stderr,"do_mbview_profile_resize: instance:%zu\n", instance);
-
-	/* do this only if a resize event happens */
-	if (cevent->type == ConfigureNotify)
-		{
-		/* get view */
-		view = &(mbviews[instance]);
-		data = &(view->data);
-
-		/* get new shell size */
-		XtVaGetValues(view->mb3dview.mbview_scrolledWindow_profile,
-			XmNwidth, &width,
-			XmNheight, &height,
-			NULL);
-fprintf(stderr,"view->mbview_scrolledWindow_profile: width:%d height:%d\n",width,height);
-
-		/* reinitialize the opengl widget */
-		mbview_reset_prglx(instance);
-
-		/* draw the profile */
-		mbview_plotprofile(instance);
-
-		}
-}
-/*------------------------------------------------------------------------------*/
-
-void
-do_mbview_profile_exager( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmScaleCallbackStruct *acs;
-    acs = (XmScaleCallbackStruct*)call_data;
-	size_t	instance;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-	int	profile_exager;
-
-	acs = (XmScaleCallbackStruct*)call_data;
-
-	/* get instance */
-	ac = 0;
-	XtSetArg(args[ac], XmNuserData, (XtPointer) &instance); ac++;
-	XtGetValues(w, args, ac);
-
-if (mbv_verbose >= 2)
-fprintf(stderr,"do_mbview_profile_exager: instance:%zu\n", instance);
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	profile_exager = acs->value;
-	data->profile_exageration = 0.1 * ((double)profile_exager);
-
-	/* reinitialize the opengl widget */
-	mbview_reset_prglx(instance);
-
-	/* draw the profile */
-	mbview_plotprofile(instance);
-}
-/*------------------------------------------------------------------------------*/
-
-void
-do_mbview_profile_width( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmScaleCallbackStruct *acs;
-    acs = (XmScaleCallbackStruct*)call_data;
-	size_t	instance;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-	int	profile_widthfactor;
-
-	acs = (XmScaleCallbackStruct*)call_data;
-
-	/* get instance */
-	ac = 0;
-	XtSetArg(args[ac], XmNuserData, (XtPointer) &instance); ac++;
-	XtGetValues(w, args, ac);
-
-if (mbv_verbose >= 2)
-fprintf(stderr,"do_mbview_profile_width: instance:%zu\n", instance);
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	profile_widthfactor = acs->value;
-	data->profile_widthfactor = profile_widthfactor;
-
-	/* reinitialize the opengl widget */
-	mbview_reset_prglx(instance);
-
-	/* draw the profile */
-	mbview_plotprofile(instance);
-}
-/*------------------------------------------------------------------------------*/
-
-void
-do_mbview_profile_slope( Widget w, XtPointer client_data, XtPointer call_data)
-{
-    XmScaleCallbackStruct *acs;
-    acs = (XmScaleCallbackStruct*)call_data;
-	size_t	instance;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-	int	profile_slopethreshold;
-
-	acs = (XmScaleCallbackStruct*)call_data;
-
-	/* get instance */
-	ac = 0;
-	XtSetArg(args[ac], XmNuserData, (XtPointer) &instance); ac++;
-	XtGetValues(w, args, ac);
-
-if (mbv_verbose >= 2)
-fprintf(stderr,"do_mbview_profile_slope: instance:%zu\n", instance);
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	acs = (XmScaleCallbackStruct*)call_data;
-	profile_slopethreshold = acs->value;
-	data->profile_slopethreshold = 0.01 * ((double)profile_slopethreshold);
-
-	/* reinitialize the opengl widget */
-	mbview_reset_prglx(instance);
-
-	/* draw the profile */
-	mbview_plotprofile(instance);
-}
-/*------------------------------------------------------------------------------*/
-/* MBview status and message functions */
-/*------------------------------------------------------------------------------*/
-
-int
-do_mbview_status(char *message, size_t instance)
-{
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	view->message_on = MB_YES;
-
-    	set_mbview_label_string(view->mb3dview.mbview_label_status, message);
-
-    	return(1);
-}
-
-/*------------------------------------------------------------------------------*/
-
-int
-do_mbview_message_on(char *message, size_t instance)
-{
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-  	Widget  diashell, topshell;
-    	Window  diawindow, topwindow;
-    	XWindowAttributes	xwa;
-    	XEvent  event;
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	view->message_on = MB_YES;
-
-    	set_mbview_label_string(view->mb3dview.mbview_label_message, message);
-    	XtManageChild(view->mb3dview.mbview_bulletinBoard_message);
-
-    	/* force the label to be visible */
-    	for (diashell = view->mb3dview.mbview_label_message;
-	    	!XtIsShell(diashell);
-	    	diashell = XtParent(diashell));
-    	for (topshell = diashell;
-	    	!XtIsTopLevelShell(topshell);
-	    	topshell = XtParent(topshell));
-    	if (XtIsRealized(diashell) && XtIsRealized(topshell))
-		{
-		diawindow = XtWindow(diashell);
-		topwindow = XtWindow(topshell);
-
-		/* wait for the dialog to be mapped */
-		while (XGetWindowAttributes(view->dpy, diawindow, &xwa)
-			&& xwa.map_state != IsViewable)
-	    		{
-	    		if (XGetWindowAttributes(view->dpy, topwindow, &xwa)
-		    		&& xwa.map_state != IsViewable)
-			break;
-
-	    		XtAppNextEvent(app_context, &event);
-	    		XtDispatchEvent(&event);
-	    		}
-		}
-
-    	XmUpdateDisplay(topshell);
-
-    	return(1);
-}
-
-/*------------------------------------------------------------------------------*/
-
-int
-do_mbview_message_off(size_t instance)
-{
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-     	XtUnmanageChild(view->mb3dview.mbview_bulletinBoard_message);
-    	XSync(XtDisplay(view->mb3dview.mbview_bulletinBoard_message), 0);
-    	XmUpdateDisplay(view->mainWindow);
-
-
-    	return(1);
-}
-
-/*------------------------------------------------------------------------------*/
-/* Change label string cleanly, no memory leak */
-/*------------------------------------------------------------------------------*/
-
-void set_mbview_label_string(Widget w, String str)
-{
-    XmString xstr;
-
-    xstr = XmStringCreateLocalized( str );
-    if ( xstr != NULL )
-	XtVaSetValues(w,
-	    XmNlabelString, xstr,
-	    NULL);
-    else
-	XtWarning("Failed to update labelString");
-
-    XmStringFree( xstr );
-}
-/*------------------------------------------------------------------------------*/
-/* Change multiline label string cleanly, no memory leak */
-/*------------------------------------------------------------------------------*/
-
-void set_mbview_label_multiline_string(Widget w, String str)
-{
-    XmString xstr;
-    Boolean      argok;
-
-    xstr = (XtPointer)BX_CONVERT(w, str, XmRXmString, 0, &argok);
-    if ( xstr != NULL && argok)
-        XtVaSetValues(w,
-            XmNlabelString, xstr,
-            NULL);
-    else
-        XtWarning("Failed to update labelString");
-
-    XmStringFree( xstr );
-}
-/*------------------------------------------------------------------------------*/
-/* Get text item string cleanly, no memory leak */
-/*------------------------------------------------------------------------------*/
-
-void get_mbview_text_string(Widget w, String str)
-{
-    char	*str_tmp;
-
-    str_tmp = (char *) XmTextGetString(w);
-    strcpy(str, str_tmp);
-    XtFree(str_tmp);
-}
-
-/*------------------------------------------------------------------------------*/
-/* Deal with pending X events */
-/*------------------------------------------------------------------------------*/
-
-void do_mbview_xevents()
-{
-	XEvent  event;
-
-	if (XtAppPending(app_context))
-		{
-		XtAppNextEvent(app_context, &event);
-		XtDispatchEvent(&event);
-		}
-}
-
-
-/*------------------------------------------------------------------------------*/
-/* Add work procedure */
-/*------------------------------------------------------------------------------*/
-
-int do_mbview_setbackgroundwork(size_t instance)
-{
-	int	status = MB_SUCCESS;
-    	struct mbview_world_struct *view;
-    	struct mbview_struct *data;
-	int		id;
-
-    	/* get view */
-    	view = &(mbviews[instance]);
-    	data = &(view->data);
-
-	/* set work function if none set for this instance */
-	if (work_function_set == MB_NO)
-		{
-		id =  XtAppAddWorkProc(app_context,
-				(XtWorkProc)do_mbview_workfunction,
-				(XtPointer) instance);
-		if (id > 0)
-			work_function_set = MB_YES;
-		else
-			status = MB_FAILURE;
-/*fprintf(stderr,"do_mbview_setbackgroundwork: instance:%zu id:%d\n",
-instance, id);*/
-		}
-
-else
-fprintf(stderr,"do_mbview_setbackgroundwork: FUNCTION ALREADY SET for instance:%zu!!\n",
-instance);
-
-	return(status);
-}
-
-/*------------------------------------------------------------------------------*/
-
-int do_mbview_settimer()
-{
-	int	status = MB_SUCCESS;
-	int		id;
-
-	/* set timer function if none set for this instance */
-	if (work_function_set == MB_NO)
-		{
-		id =  XtAppAddTimeOut(app_context,
-				(unsigned long) timer_timeout_time,
-				(XtTimerCallbackProc)do_mbview_workfunction,
-				(XtPointer) -1);
-		if (id > 0)
-			work_function_set = MB_YES;
-		else
-			status = MB_FAILURE;
-/*fprintf(stderr,"do_mbview_settimer: \n");*/
-		}
-
-else
-fprintf(stderr,"do_mbview_settimer: FUNCTION ALREADY SET!!\n");
-
-	return(status);
-}
-
-/*------------------------------------------------------------------------------*/
-
-int do_mbview_workfunction(XtPointer client_data)
-{
-	int	status = MB_SUCCESS;
-	size_t	instance;
-    	struct mbview_world_struct *view;
-    	struct mbview_struct *data;
-	int	plotting;
-	int	found;
-	int	mode;
-	int	use_histogram;
-	float	*histogram;
-	int	ncalc;
-	int	i, j, k;
-
-    	/* set starting values */
-	instance = (size_t) client_data;
-	plotting = MB_NO;
-	found = MB_NO;
-	mode = MBV_BACKGROUND_NONE;
-
-/*fprintf(stderr,"\ndo_mbview_workfunction called: instance:%zu timer_count:%d\n", instance, timer_count);*/
-
-	/* first make sure no plotting is active */
-	for (i = 0; i < MBV_MAX_WINDOWS && plotting == MB_NO; i++)
-		{
-    		/* get view */
-    		view = &(mbviews[i]);
-    		data = &(view->data);
-
-		/* check it if nothing already found */
-		if (data->primary_nxy > 0 &&
-			(view->plot_recursion > 0
-				|| view->plot_interrupt_allowed == MB_NO
-				|| view->button1down == MB_YES
-				|| view->button2down == MB_YES
-				|| view->button3down == MB_YES))
-			{
-			plotting = MB_YES;
-			}
-		}
-
-	/* first see if possible to work with instance value */
-	if (plotting == MB_NO
-		&& instance != MBV_NO_WINDOW
-		&& instance < MBV_MAX_WINDOWS
-		&& data->primary_nxy > 0)
-		{
-    		/* get view */
-    		view = &(mbviews[instance]);
-    		data = &(view->data);
-
-		if (view->zscaledonecount < data->primary_nxy - 1)
-			{
-			/* set found */
-			found = MB_YES;
-			mode = MBV_BACKGROUND_ZSCALE;
-			}
-
-		/* then work on color */
-		else if (view->colordonecount < data->primary_nxy - 1)
-			{
-			/* set found */
-			found = MB_YES;
-			mode = MBV_BACKGROUND_COLOR;
-			}
-
-		/* finally do the full rez plot */
-		else if (view->lastdrawrez != MBV_REZ_FULL
-			&& timer_count > timer_timeout_count)
-			{
-			/* set found */
-			found = MB_YES;
-			mode = MBV_BACKGROUND_FULLPLOT;
-			}
-		}
-
-	/* if not found check all possible instances */
-	if (plotting == MB_NO
-		&& found == MB_NO)
-	    {
-	    for (i=0;i<MBV_MAX_WINDOWS;i++)
-		{
-    		/* get view */
-    		view = &(mbviews[i]);
-    		data = &(view->data);
-
-		/* check it if nothing already found */
-		if (found == MB_NO
-			&& data->primary_nxy > 0)
-			{
-			if (view->zscaledonecount < data->primary_nxy - 1)
-				{
-				/* set found */
-				found = MB_YES;
-				mode = MBV_BACKGROUND_ZSCALE;
-				instance = i;
-				}
-
-			/* then work on color */
-			else if (view->colordonecount < data->primary_nxy - 1)
-				{
-				/* set found */
-				found = MB_YES;
-				mode = MBV_BACKGROUND_COLOR;
-				instance = i;
-				}
-
-			/* finally do the full rez plot */
-			else if (view->lastdrawrez != MBV_REZ_FULL
-				&& timer_count > timer_timeout_count)
-				{
-				/* set found */
-				found = MB_YES;
-				mode = MBV_BACKGROUND_FULLPLOT;
-				instance = i;
-				}
-			}
-		}
-	    }
-/*fprintf(stderr, "do_mbview_workfunction: plotting:%d found:%d instance:%zu mode:%d\n",
-plotting,found,instance,mode);*/
-
-	/* do the work if instance found */
-	if (plotting == MB_NO
-		&& found == MB_YES)
-		{
-    		/* get view */
-    		view = &(mbviews[instance]);
-    		data = &(view->data);
-
-		/* first work on zscale */
-		if (mode == MBV_BACKGROUND_ZSCALE)
-			{
-/*fprintf(stderr,"do_mbview_workfunction: recalculating zscale in background %d of %d...\n",
-view->zscaledonecount,data->primary_nxy);*/
-			/* recalculate zscale for MBV_NUMBACKGROUNDCALC cells */
-			ncalc = 0;
-			for (k = view->zscaledonecount; k < data->primary_nxy && ncalc < MBV_NUMBACKGROUNDCALC; k++)
-				{
-				if (!(data->primary_stat_z[k/8] & statmask[k%8]))
-					{
-					mbview_zscalegridpoint(instance, k);
-					ncalc++;
-					}
-				view->zscaledonecount = k;
-				}
-			}
-
-		/* then work on color */
-		else if (mode == MBV_BACKGROUND_COLOR)
-			{
-/* fprintf(stderr,"do_mbview_workfunction: recalculating color in background %d of %d...\n",
-view->colordonecount,data->primary_nxy);*/
-
-			/* use histogram equalization if needed */
-			use_histogram = MB_NO;
-			if (data->grid_mode == MBV_GRID_VIEW_PRIMARY
-				&& data->primary_histogram == MB_YES)
-				{
-				use_histogram = MB_YES;
-				histogram = view->primary_histogram;
-				}
-			else if (data->grid_mode == MBV_GRID_VIEW_PRIMARYSLOPE
-				&& data->primaryslope_histogram == MB_YES)
-				{
-				use_histogram = MB_YES;
-				histogram = view->primaryslope_histogram;
-				}
-			else if (data->grid_mode == MBV_GRID_VIEW_SECONDARY
-				&& data->secondary_histogram == MB_YES)
-				{
-				use_histogram = MB_YES;
-				histogram = view->secondary_histogram;
-				}
-
-			/* recalculate color for MBV_NUMBACKGROUNDCALC cells */
-			ncalc = 0;
-			for (k = view->colordonecount; k < data->primary_nxy && ncalc < MBV_NUMBACKGROUNDCALC; k++)
-				{
-				if (!(data->primary_stat_color[k/8] & statmask[k%8]))
-					{
-					i = k / data->primary_ny;
-					j = k % data->primary_ny;
-					if (use_histogram == MB_NO)
-						mbview_colorpoint(view, data, i, j, k);
-					else
-						mbview_colorpoint_histogram(view, data, histogram, i, j, k);
-					ncalc++;
-					}
-				view->colordonecount = k;
-				}
-			}
-
-		/* finally do the full rez plot */
-		else if (mode == MBV_BACKGROUND_FULLPLOT)
-			{
-/*fprintf(stderr,"do_mbview_workfunction: plotting instance %d full resolution on timeout...\n", instance);*/
-			/* do full rez plot */
-			mbview_plotfull(instance);
-			}
-		}
-
-	/* reset the work function as either background or timed */
-	work_function_set = MB_NO;
-	if (found == MB_YES)
-		{
-		do_mbview_setbackgroundwork(instance);
-		timer_count = 0;
-		}
-	else
-		{
-		do_mbview_settimer();
-		if (plotting == MB_YES)
-			timer_count = 0;
-		else
-			timer_count++;
-		}
-
-	return(status);
-
-}
-
-/*------------------------------------------------------------------------------*/
diff --git a/src/mbview/mbview_nav.c b/src/mbview/mbview_nav.c
deleted file mode 100644
index e25eac1..0000000
--- a/src/mbview/mbview_nav.c
+++ /dev/null
@@ -1,2404 +0,0 @@
-/*------------------------------------------------------------------------------
- *    The MB-system:	mbview_nav.c	10/28/2003
- *    $Id: mbview_nav.c 2239 2015-05-07 00:51:42Z caress $
- *
- *    Copyright (c) 2003-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *------------------------------------------------------------------------------*/
-/*
- *
- * Author:	D. W. Caress
- * Date:	October 28, 2003
- *
- *
- */
-/*------------------------------------------------------------------------------*/
-
-/* Standard includes for builtins. */
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include <math.h>
-
-/* Motif required Headers */
-#include <X11/StringDefs.h>
-#include <X11/cursorfont.h>
-#include <Xm/Xm.h>
-#include <Xm/MainW.h>
-#include <Xm/DialogS.h>
-#include <Xm/RepType.h>
-#include <Xm/MwmUtil.h>
-#include <Xm/BulletinB.h>
-#include <Xm/RowColumn.h>
-#include <Xm/CascadeB.h>
-#include <Xm/PushB.h>
-#include <Xm/Separator.h>
-#include <Xm/List.h>
-#include "MB3DView.h"
-#include "MB3DSiteList.h"
-#include "MB3DRouteList.h"
-#include "MB3DNavList.h"
-
-/* OpenGL include files */
-#ifdef WIN32
-#undef BOOL		/* It was defined by a chain of inclusions in the (patched) X11/Xmd.h */
-#include <windows.h>
-#endif
-
-#include <GL/gl.h>
-#include <GL/glu.h>
-#ifndef WIN32
-#	include <GL/glx.h>
-#endif
-#include "mb_glwdrawa.h"
-
-/* MBIO include files */
-#include "mb_status.h"
-#include "mb_define.h"
-
-/* mbview include */
-#include "mbview.h"
-#include "mbviewprivate.h"
-
-/*------------------------------------------------------------------------------*/
-
-/* local variables */
-static char		value_string[MB_PATH_MAXLINE];
-
-static char rcs_id[]="$Id: mbview_nav.c 2239 2015-05-07 00:51:42Z caress $";
-
-/*------------------------------------------------------------------------------*/
-int mbview_getnavcount(int verbose, size_t instance,
-			int *nnav,
-			int *error)
-{
-	/* local variables */
-	char	*function_name = "mbview_getnavcount";
-	int	status = MB_SUCCESS;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-
-	/* print starting debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:                   %d\n", verbose);
-		fprintf(stderr,"dbg2       instance:                  %zu\n", instance);
-		}
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* get number of navs */
-	*nnav = shared.shareddata.nnav;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       nnav:                      %d\n", *nnav);
-		fprintf(stderr,"dbg2       error:                     %d\n", *error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:                    %d\n", status);
-		}
-
-	/* return */
-	return(status);
-}
-
-/*------------------------------------------------------------------------------*/
-int mbview_getnavpointcount(int verbose, size_t instance,
-			int	nav,
-			int	*npoint,
-			int	*nintpoint,
-			int *error)
-{
-	/* local variables */
-	char	*function_name = "mbview_getnavpointcount";
-	int	status = MB_SUCCESS;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-	int	i;
-
-	/* print starting debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:                   %d\n", verbose);
-		fprintf(stderr,"dbg2       instance:                  %zu\n", instance);
-		fprintf(stderr,"dbg2       nav:                     %d\n", nav);
-		}
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* get number of points in specified nav */
-	*npoint = 0;
-	*nintpoint = 0;
-	if (nav >= 0 && nav < shared.shareddata.nnav)
-		{
-		*npoint = shared.shareddata.navs[nav].npoints;
-		for (i=0;i<*npoint-1;i++)
-			{
-			if (shared.shareddata.navs[nav].segments[i].nls > 2)
-				*nintpoint += shared.shareddata.navs[nav].segments[i].nls - 2;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       npoint:                    %d\n", *npoint);
-		fprintf(stderr,"dbg2       nintpoint:                 %d\n", *nintpoint);
-		fprintf(stderr,"dbg2       error:                     %d\n", *error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:                    %d\n", status);
-		}
-
-	/* return */
-	return(status);
-
-}
-
-/*------------------------------------------------------------------------------*/
-int mbview_allocnavarrays(int verbose,
-			int	npointtotal,
-			double	**time_d,
-			double	**navlon,
-			double	**navlat,
-			double	**navz,
-			double	**heading,
-			double	**speed,
-			double	**navportlon,
-			double	**navportlat,
-			double	**navstbdlon,
-			double	**navstbdlat,
-			int	**line,
-			int	**shot,
-			int	**cdp,
-			int 	*error)
-{
-	/* local variables */
-	char	*function_name = "mbview_allocnavarrays";
-	int	status = MB_SUCCESS;
-fprintf(stderr,"mbview_allocnavarrays: %d points\n",npointtotal);
-
-	/* print starting debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:                   %d\n", verbose);
-		fprintf(stderr,"dbg2       npointtotal:               %d\n", npointtotal);
-		fprintf(stderr,"dbg2       time_d:                    %p\n", *time_d);
-		fprintf(stderr,"dbg2       navlon:                    %p\n", *navlon);
-		fprintf(stderr,"dbg2       navlat:                    %p\n", *navlat);
-		fprintf(stderr,"dbg2       navz:                      %p\n", *navz);
-		fprintf(stderr,"dbg2       heading:                   %p\n", *heading);
-		fprintf(stderr,"dbg2       speed:                     %p\n", *speed);
-		if (navportlon != NULL)
-		fprintf(stderr,"dbg2       navportlon:                %p\n", *navportlon);
-		if (navportlat != NULL)
-		fprintf(stderr,"dbg2       navportlat:                %p\n", *navportlat);
-		if (navstbdlon != NULL)
-		fprintf(stderr,"dbg2       navstbdlon:                %p\n", *navstbdlon);
-		if (navstbdlat != NULL)
-		fprintf(stderr,"dbg2       navstbdlat:                %p\n", *navstbdlat);
-		if (line != NULL)
-		fprintf(stderr,"dbg2       line:                      %p\n", *line);
-		if (shot != NULL)
-		fprintf(stderr,"dbg2       shot:                      %p\n", *shot);
-		if (cdp != NULL)
-		fprintf(stderr,"dbg2       cdp:                       %p\n", *cdp);
-		}
-
-	/* allocate the arrays using mb_realloc */
-	status = mb_reallocd(verbose,__FILE__,__LINE__,npointtotal*sizeof(double),(void **)time_d,error);
-	if (status == MB_SUCCESS)
-		status = mb_reallocd(verbose,__FILE__,__LINE__,npointtotal*sizeof(double),(void **)navlon,error);
-	if (status == MB_SUCCESS)
-		status = mb_reallocd(verbose,__FILE__,__LINE__,npointtotal*sizeof(double),(void **)navlat,error);
-	if (status == MB_SUCCESS)
-		status = mb_reallocd(verbose,__FILE__,__LINE__,npointtotal*sizeof(double),(void **)navz,error);
-	if (status == MB_SUCCESS)
-		status = mb_reallocd(verbose,__FILE__,__LINE__,npointtotal*sizeof(double),(void **)heading,error);
-	if (status == MB_SUCCESS)
-		status = mb_reallocd(verbose,__FILE__,__LINE__,npointtotal*sizeof(double),(void **)speed,error);
-	if (status == MB_SUCCESS && navportlon != NULL)
-		status = mb_reallocd(verbose,__FILE__,__LINE__,npointtotal*sizeof(double),(void **)navportlon,error);
-	if (status == MB_SUCCESS && navportlat != NULL)
-		status = mb_reallocd(verbose,__FILE__,__LINE__,npointtotal*sizeof(double),(void **)navportlat,error);
-	if (status == MB_SUCCESS && navstbdlon != NULL)
-		status = mb_reallocd(verbose,__FILE__,__LINE__,npointtotal*sizeof(double),(void **)navstbdlon,error);
-	if (status == MB_SUCCESS && navstbdlat != NULL)
-		status = mb_reallocd(verbose,__FILE__,__LINE__,npointtotal*sizeof(double),(void **)navstbdlat,error);
-	if (status == MB_SUCCESS && line != NULL)
-		status = mb_reallocd(verbose,__FILE__,__LINE__,npointtotal*sizeof(int),(void **)line,error);
-	if (status == MB_SUCCESS && shot != NULL)
-		status = mb_reallocd(verbose,__FILE__,__LINE__,npointtotal*sizeof(int),(void **)shot,error);
-	if (status == MB_SUCCESS && cdp != NULL)
-		status = mb_reallocd(verbose,__FILE__,__LINE__,npointtotal*sizeof(int),(void **)cdp,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       time_d:                    %p\n", *time_d);
-		fprintf(stderr,"dbg2       navlon:                    %p\n", *navlon);
-		fprintf(stderr,"dbg2       navlat:                    %p\n", *navlat);
-		fprintf(stderr,"dbg2       navz:                      %p\n", *navz);
-		fprintf(stderr,"dbg2       heading:                   %p\n", *heading);
-		fprintf(stderr,"dbg2       speed:                     %p\n", *speed);
-		if (navportlon != NULL)
-		fprintf(stderr,"dbg2       navportlon:                %p\n", *navportlon);
-		if (navportlat != NULL)
-		fprintf(stderr,"dbg2       navportlat:                %p\n", *navportlat);
-		if (navstbdlon != NULL)
-		fprintf(stderr,"dbg2       navstbdlon:                %p\n", *navstbdlon);
-		if (navstbdlat != NULL)
-		fprintf(stderr,"dbg2       navstbdlat:                %p\n", *navstbdlat);
-		if (line != NULL)
-		fprintf(stderr,"dbg2       line:                      %p\n", *line);
-		if (shot != NULL)
-		fprintf(stderr,"dbg2       shot:                      %p\n", *shot);
-		if (cdp != NULL)
-		fprintf(stderr,"dbg2       cdp:                       %p\n", *cdp);
-		fprintf(stderr,"dbg2       error:                     %d\n", *error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:                    %d\n", status);
-		}
-
-	/* return */
-	return(status);
-}
-
-
-/*------------------------------------------------------------------------------*/
-int mbview_freenavarrays(int verbose,
-			double	**time_d,
-			double	**navlon,
-			double	**navlat,
-			double	**navz,
-			double	**heading,
-			double	**speed,
-			double	**navportlon,
-			double	**navportlat,
-			double	**navstbdlon,
-			double	**navstbdlat,
-			int	**line,
-			int	**shot,
-			int	**cdp,
-			int *error)
-{
-	/* local variables */
-	char	*function_name = "mbview_freenavarrays";
-	int	status = MB_SUCCESS;
-
-	/* print starting debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:                   %d\n", verbose);
-		fprintf(stderr,"dbg2       time_d:                    %p\n", *time_d);
-		fprintf(stderr,"dbg2       navlon:                    %p\n", *navlon);
-		fprintf(stderr,"dbg2       navlat:                    %p\n", *navlat);
-		fprintf(stderr,"dbg2       navz:                      %p\n", *navz);
-		fprintf(stderr,"dbg2       heading:                   %p\n", *heading);
-		fprintf(stderr,"dbg2       speed:                     %p\n", *speed);
-		if (navportlon != NULL)
-		fprintf(stderr,"dbg2       navportlon:                %p\n", *navportlon);
-		if (navportlat != NULL)
-		fprintf(stderr,"dbg2       navportlat:                %p\n", *navportlat);
-		if (navstbdlon != NULL)
-		fprintf(stderr,"dbg2       navstbdlon:                %p\n", *navstbdlon);
-		if (navstbdlat != NULL)
-		fprintf(stderr,"dbg2       navstbdlat:                %p\n", *navstbdlat);
-		if (line != NULL)
-		fprintf(stderr,"dbg2       line:                      %p\n", *line);
-		if (shot != NULL)
-		fprintf(stderr,"dbg2       shot:                      %p\n", *shot);
-		if (cdp != NULL)
-		fprintf(stderr,"dbg2       cdp:                       %p\n", *cdp);
-		}
-
-	/* free the arrays using mb_free */
-	status = mb_freed(verbose,__FILE__,__LINE__,(void **)time_d,error);
-	status = mb_freed(verbose,__FILE__,__LINE__,(void **)navlon,error);
-	status = mb_freed(verbose,__FILE__,__LINE__,(void **)navlat,error);
-	status = mb_freed(verbose,__FILE__,__LINE__,(void **)navz,error);
-	status = mb_freed(verbose,__FILE__,__LINE__,(void **)heading,error);
-	status = mb_freed(verbose,__FILE__,__LINE__,(void **)speed,error);
-	if (navportlon != NULL)
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)navportlon,error);
-	if (navportlat != NULL)
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)navportlat,error);
-	if (navstbdlon != NULL)
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)navstbdlon,error);
-	if (navstbdlat != NULL)
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)navstbdlat,error);
-	if (line != NULL)
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)line,error);
-	if (shot != NULL)
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)shot,error);
-	if (cdp != NULL)
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)cdp,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       time_d:                    %p\n", *time_d);
-		fprintf(stderr,"dbg2       navlon:                    %p\n", *navlon);
-		fprintf(stderr,"dbg2       navlat:                    %p\n", *navlat);
-		fprintf(stderr,"dbg2       navz:                      %p\n", *navz);
-		fprintf(stderr,"dbg2       heading:                   %p\n", *heading);
-		fprintf(stderr,"dbg2       speed:                     %p\n", *speed);
-		if (navportlon != NULL)
-		fprintf(stderr,"dbg2       navportlon:                %p\n", *navportlon);
-		if (navportlat != NULL)
-		fprintf(stderr,"dbg2       navportlat:                %p\n", *navportlat);
-		if (navstbdlon != NULL)
-		fprintf(stderr,"dbg2       navstbdlon:                %p\n", *navstbdlon);
-		if (navstbdlat != NULL)
-		fprintf(stderr,"dbg2       navstbdlat:                %p\n", *navstbdlat);
-		if (line != NULL)
-		fprintf(stderr,"dbg2       line:                      %p\n", *line);
-		if (shot != NULL)
-		fprintf(stderr,"dbg2       shot:                      %p\n", *shot);
-		if (cdp != NULL)
-		fprintf(stderr,"dbg2       cdp:                       %p\n", *cdp);
-		fprintf(stderr,"dbg2       error:                     %d\n", *error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:                    %d\n", status);
-		}
-
-	/* return */
-	return(status);
-}
-
-/*------------------------------------------------------------------------------*/
-int mbview_addnav(int verbose, size_t instance,
-			int	npoint,
-			double	*time_d,
-			double	*navlon,
-			double	*navlat,
-			double	*navz,
-			double	*heading,
-			double	*speed,
-			double	*navportlon,
-			double	*navportlat,
-			double	*navstbdlon,
-			double	*navstbdlat,
-			int	*line,
-			int	*shot,
-			int	*cdp,
-			int	navcolor,
-			int	navsize,
-			mb_path	navname,
-			int	navpathstatus,
-			mb_path	navpathraw,
-			mb_path	navpathprocessed,
-			int	navformat,
-			int	navswathbounds,
-			int	navline,
-			int	navshot,
-			int	navcdp,
-			int	decimation,
-			int *error)
-{
-	/* local variables */
-	char	*function_name = "mbview_addnav";
-	int	status = MB_SUCCESS;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-	int	inav;
-	int	i, j;
-
-	/* print starting debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:                   %d\n", verbose);
-		fprintf(stderr,"dbg2       instance:                  %zu\n", instance);
-		fprintf(stderr,"dbg2       npoint:                    %d\n", npoint);
-		for (i=0;i<npoint;i++)
-			{
-			fprintf(stderr,"dbg2       point:%d time_d:%f lon:%f lat:%f z:%f heading:%f zpeed:%f\n",
-					i, time_d[i], navlon[i], navlat[i], navz[i],
-					heading[i], speed[i]);
-			}
-		if (navswathbounds == MB_YES)
-		for (i=0;i<npoint;i++)
-			{
-			fprintf(stderr,"dbg2       point:%d port: lon:%f lat:%f  stbd: lon:%f lat:%f\n",
-					i, navportlon[i], navportlat[i], navstbdlon[i], navstbdlat[i]);
-			}
-		if (navline == MB_YES)
-		for (i=0;i<npoint;i++)
-			{
-			fprintf(stderr,"dbg2       point:%d line:%d\n", i, line[i]);
-			}
-		if (navshot == MB_YES)
-		for (i=0;i<npoint;i++)
-			{
-			fprintf(stderr,"dbg2       point:%d shot:%d\n", i, shot[i]);
-			}
-		if (navcdp == MB_YES)
-		for (i=0;i<npoint;i++)
-			{
-			fprintf(stderr,"dbg2       point:%d cdp: %d\n", i, cdp[i]);
-			}
-		fprintf(stderr,"dbg2       navcolor:                  %d\n", navcolor);
-		fprintf(stderr,"dbg2       navsize:                   %d\n", navsize);
-		fprintf(stderr,"dbg2       navname:                   %s\n", navname);
-		fprintf(stderr,"dbg2       navpathstatus:             %d\n", navpathstatus);
-		fprintf(stderr,"dbg2       navpathraw:                %s\n", navpathraw);
-		fprintf(stderr,"dbg2       navpathprocessed:          %s\n", navpathprocessed);
-		fprintf(stderr,"dbg2       navformat:                 %d\n", navformat);
-		fprintf(stderr,"dbg2       navswathbounds:            %d\n", navswathbounds);
-		fprintf(stderr,"dbg2       navline:                   %d\n", navline);
-		fprintf(stderr,"dbg2       navshot:                   %d\n", navshot);
-		fprintf(stderr,"dbg2       navcdp:                    %d\n", navcdp);
-		fprintf(stderr,"dbg2       decimation:                %d\n", decimation);
-		}
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* make sure no nav is selected */
-	shared.shareddata.nav_selected[0] = MBV_SELECT_NONE;
-	shared.shareddata.nav_selected[1] = MBV_SELECT_NONE;
-
-	/* set nav id so that new nav is created */
-	inav = shared.shareddata.nnav;
-
-	/* allocate memory for a new nav if required */
-	if (shared.shareddata.nnav_alloc < shared.shareddata.nnav + 1)
-		{
-		shared.shareddata.nnav_alloc = shared.shareddata.nnav + 1;
-		status = mb_realloc(mbv_verbose,
-			    	shared.shareddata.nnav_alloc * sizeof(struct mbview_nav_struct),
-			    	(void **)&(shared.shareddata.navs), error);
-		if (status == MB_FAILURE)
-			{
-			shared.shareddata.nnav_alloc = 0;
-			}
-		else
-			{
-			for (i=shared.shareddata.nnav;i<shared.shareddata.nnav_alloc;i++)
-				{
-				shared.shareddata.navs[i].color = MBV_COLOR_RED;
-				shared.shareddata.navs[i].size = 4;
-				shared.shareddata.navs[i].name[0] = '\0';
-				shared.shareddata.navs[i].pathstatus = MB_PROCESSED_NONE;
-				shared.shareddata.navs[i].pathraw[0] = '\0';
-				shared.shareddata.navs[i].pathprocessed[0] = '\0';
-				shared.shareddata.navs[i].format = 0;
-				shared.shareddata.navs[i].swathbounds = MB_NO;
-				shared.shareddata.navs[i].line = MB_NO;
-				shared.shareddata.navs[i].shot = MB_NO;
-				shared.shareddata.navs[i].cdp = MB_NO;
-				shared.shareddata.navs[i].decimation = MB_NO;
-				shared.shareddata.navs[i].npoints = 0;
-				shared.shareddata.navs[i].npoints_alloc = 0;
-				shared.shareddata.navs[i].nselected = 0;
-				shared.shareddata.navs[i].navpts = NULL;
-				shared.shareddata.navs[i].segments = NULL;
-				}
-			}
-		}
-
-	/* allocate memory to for nav arrays */
-	if (shared.shareddata.navs[inav].npoints_alloc < npoint)
-		{
-		shared.shareddata.navs[inav].npoints_alloc = npoint;
-		status = mb_reallocd(mbv_verbose, __FILE__, __LINE__,
-			    	shared.shareddata.navs[inav].npoints_alloc * sizeof(struct mbview_navpointw_struct),
-			    	(void **)&(shared.shareddata.navs[inav].navpts), error);
-		status = mb_reallocd(mbv_verbose, __FILE__, __LINE__,
-			    	shared.shareddata.navs[inav].npoints_alloc * sizeof(struct mbview_linesegmentw_struct),
-			    	(void **)&(shared.shareddata.navs[inav].segments), error);
-		for (j=0;j<shared.shareddata.navs[inav].npoints_alloc-1;j++)
-			{
-			shared.shareddata.navs[inav].segments[j].nls = 0;
-			shared.shareddata.navs[inav].segments[j].nls_alloc = 0;
-			shared.shareddata.navs[inav].segments[j].lspoints = NULL;
-			shared.shareddata.navs[inav].segments[j].endpoints[0] = shared.shareddata.navs[inav].navpts[j].pointcntr;
-			shared.shareddata.navs[inav].segments[j].endpoints[1] = shared.shareddata.navs[inav].navpts[j+1].pointcntr;
-			}
-		}
-
-	/* add the new nav */
-	if (status == MB_SUCCESS)
-		{
-		/* set nnav */
-		shared.shareddata.nnav++;
-
-		/* set color size and name for new nav */
-		shared.shareddata.navs[inav].color = navcolor;
-		shared.shareddata.navs[inav].size = navsize;
-		strcpy(shared.shareddata.navs[inav].name,navname);
-		shared.shareddata.navs[inav].pathstatus = navpathstatus;
-		strcpy(shared.shareddata.navs[inav].pathraw,navpathraw);
-		strcpy(shared.shareddata.navs[inav].pathprocessed,navpathprocessed);
-		shared.shareddata.navs[inav].format = navformat;
-		shared.shareddata.navs[inav].swathbounds = navswathbounds;
-		shared.shareddata.navs[inav].line = navline;
-		shared.shareddata.navs[inav].shot = navshot;
-		shared.shareddata.navs[inav].cdp = navcdp;
-		shared.shareddata.navs[inav].decimation = decimation;
-
-		/* loop over the points in the new nav */
-		shared.shareddata.navs[inav].npoints = npoint;
-		for (i=0;i<npoint;i++)
-			{
-			/* set status values */
-			shared.shareddata.navs[inav].navpts[i].draped = MB_NO;
-			shared.shareddata.navs[inav].navpts[i].selected = MB_NO;
-
-			/* set time and shot info */
-			shared.shareddata.navs[inav].navpts[i].time_d = time_d[i];
-			shared.shareddata.navs[inav].navpts[i].heading = heading[i];
-			shared.shareddata.navs[inav].navpts[i].speed = speed[i];
-			if (shared.shareddata.navs[inav].line == MB_YES)
-				shared.shareddata.navs[inav].navpts[i].line = line[i];
-			if (shared.shareddata.navs[inav].shot == MB_YES)
-				shared.shareddata.navs[inav].navpts[i].shot = shot[i];
-			if (shared.shareddata.navs[inav].cdp == MB_YES)
-				shared.shareddata.navs[inav].navpts[i].cdp = cdp[i];
-
-			/* ************************************************* */
-			/* get nav positions in grid and display coordinates */
-			shared.shareddata.navs[inav].navpts[i].point.xlon = navlon[i];
-			shared.shareddata.navs[inav].navpts[i].point.ylat = navlat[i];
-			shared.shareddata.navs[inav].navpts[i].point.zdata = navz[i];
-			status = mbview_projectfromlonlat(instance,
-					shared.shareddata.navs[inav].navpts[i].point.xlon,
-					shared.shareddata.navs[inav].navpts[i].point.ylat,
-					shared.shareddata.navs[inav].navpts[i].point.zdata,
-					&(shared.shareddata.navs[inav].navpts[i].point.xgrid[instance]),
-					&(shared.shareddata.navs[inav].navpts[i].point.ygrid[instance]),
-					&(shared.shareddata.navs[inav].navpts[i].point.xdisplay[instance]),
-					&(shared.shareddata.navs[inav].navpts[i].point.ydisplay[instance]),
-					&(shared.shareddata.navs[inav].navpts[i].point.zdisplay[instance]));
-			mbview_updatepointw(instance, &(shared.shareddata.navs[inav].navpts[i].point));
-
-/* fprintf(stderr,"Depth: llz:%.10f %.10f %.10f   grid:%.10f %.10f   dpy:%.10f %.10f %.10f\n",
-shared.shareddata.navs[inav].navpts[i].point.xlon,
-shared.shareddata.navs[inav].navpts[i].point.ylat,
-shared.shareddata.navs[inav].navpts[i].point.zdata,
-shared.shareddata.navs[inav].navpts[i].point.xgrid[instance],
-shared.shareddata.navs[inav].navpts[i].point.ygrid[instance],
-shared.shareddata.navs[inav].navpts[i].point.xdisplay[instance],
-shared.shareddata.navs[inav].navpts[i].point.ydisplay[instance],
-shared.shareddata.navs[inav].navpts[i].point.zdisplay[instance]); */
-
-			/* ************************************************* */
-			/* get center on-bottom nav positions in grid coordinates */
-			shared.shareddata.navs[inav].navpts[i].pointcntr.xlon = navlon[i];
-			shared.shareddata.navs[inav].navpts[i].pointcntr.ylat = navlat[i];
-			status = mbview_projectll2xyzgrid(instance,
-					shared.shareddata.navs[inav].navpts[i].pointcntr.xlon,
-					shared.shareddata.navs[inav].navpts[i].pointcntr.ylat,
-					&(shared.shareddata.navs[inav].navpts[i].pointcntr.xgrid[instance]),
-					&(shared.shareddata.navs[inav].navpts[i].pointcntr.ygrid[instance]),
-					&(shared.shareddata.navs[inav].navpts[i].pointcntr.zdata));
-
-			/* get center on-bottom nav positions in display coordinates */
-			status = mbview_projectll2display(instance,
-					shared.shareddata.navs[inav].navpts[i].pointcntr.xlon,
-					shared.shareddata.navs[inav].navpts[i].pointcntr.ylat,
-					shared.shareddata.navs[inav].navpts[i].pointcntr.zdata,
-					&(shared.shareddata.navs[inav].navpts[i].pointcntr.xdisplay[instance]),
-					&(shared.shareddata.navs[inav].navpts[i].pointcntr.ydisplay[instance]),
-					&(shared.shareddata.navs[inav].navpts[i].pointcntr.zdisplay[instance]));
-
-			/* get center on-bottom nav positions for all active instances */
-			mbview_updatepointw(instance, &(shared.shareddata.navs[inav].navpts[i].pointcntr));
-
-			/* ************************************************* */
-			/* get port swathbound nav positions in grid and display coordinates */
-			shared.shareddata.navs[inav].navpts[i].pointport.xlon = navportlon[i];
-			shared.shareddata.navs[inav].navpts[i].pointport.ylat = navportlat[i];
-			status = mbview_projectll2xyzgrid(instance,
-					shared.shareddata.navs[inav].navpts[i].pointport.xlon,
-					shared.shareddata.navs[inav].navpts[i].pointport.ylat,
-					&(shared.shareddata.navs[inav].navpts[i].pointport.xgrid[instance]),
-					&(shared.shareddata.navs[inav].navpts[i].pointport.ygrid[instance]),
-					&(shared.shareddata.navs[inav].navpts[i].pointport.zdata));
-
-			/* get port on-bottom nav positions in display coordinates */
-			status = mbview_projectll2display(instance,
-					shared.shareddata.navs[inav].navpts[i].pointport.xlon,
-					shared.shareddata.navs[inav].navpts[i].pointport.ylat,
-					shared.shareddata.navs[inav].navpts[i].pointport.zdata,
-					&(shared.shareddata.navs[inav].navpts[i].pointport.xdisplay[instance]),
-					&(shared.shareddata.navs[inav].navpts[i].pointport.ydisplay[instance]),
-					&(shared.shareddata.navs[inav].navpts[i].pointport.zdisplay[instance]));
-
-			/* get port on-bottom nav positions for all active instances */
-			mbview_updatepointw(instance, &(shared.shareddata.navs[inav].navpts[i].pointport));
-
-			/* ************************************************* */
-			/* get starboard swathbound nav positions in grid coordinates */
-			shared.shareddata.navs[inav].navpts[i].pointstbd.xlon = navstbdlon[i];
-			shared.shareddata.navs[inav].navpts[i].pointstbd.ylat = navstbdlat[i];
-			status = mbview_projectll2xyzgrid(instance,
-					shared.shareddata.navs[inav].navpts[i].pointstbd.xlon,
-					shared.shareddata.navs[inav].navpts[i].pointstbd.ylat,
-					&(shared.shareddata.navs[inav].navpts[i].pointstbd.xgrid[instance]),
-					&(shared.shareddata.navs[inav].navpts[i].pointstbd.ygrid[instance]),
-					&(shared.shareddata.navs[inav].navpts[i].pointstbd.zdata));
-
-			/* get starboard on-bottom nav positions in display coordinates */
-			status = mbview_projectll2display(instance,
-					shared.shareddata.navs[inav].navpts[i].pointstbd.xlon,
-					shared.shareddata.navs[inav].navpts[i].pointstbd.ylat,
-					shared.shareddata.navs[inav].navpts[i].pointstbd.zdata,
-					&(shared.shareddata.navs[inav].navpts[i].pointstbd.xdisplay[instance]),
-					&(shared.shareddata.navs[inav].navpts[i].pointstbd.ydisplay[instance]),
-					&(shared.shareddata.navs[inav].navpts[i].pointstbd.zdisplay[instance]));
-
-			/* get starboard on-bottom nav positions for all active instances */
-			mbview_updatepointw(instance, &(shared.shareddata.navs[inav].navpts[i].pointstbd));
-
-			/* ************************************************* */
-			}
-
-		/* drape the segments */
-		for (i=0;i<shared.shareddata.navs[inav].npoints-1;i++)
-			{
-			/* drape the segment */
-			mbview_drapesegmentw(instance, &(shared.shareddata.navs[inav].segments[i]));
-
-			/* update the segment for all active instances */
-			mbview_updatesegmentw(instance, &(shared.shareddata.navs[inav].segments[i]));
-			}
-
-
-		/* make navs viewable */
-		data->nav_view_mode = MBV_VIEW_ON;
-
-		/* update nav data list */
-		mbview_updatenavlist();
-
-		}
-
-	/* print nav debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  Nav data altered in function <%s>\n",
-			function_name);
-		fprintf(stderr,"dbg2  Nav values:\n");
-		fprintf(stderr,"dbg2       nav_mode:           %d\n",shared.shareddata.nav_mode);
-		fprintf(stderr,"dbg2       nav_view_mode:      %d\n",data->nav_view_mode);
-		fprintf(stderr,"dbg2       navdrape_view_mode: %d\n",data->navdrape_view_mode);
-		fprintf(stderr,"dbg2       nnav:               %d\n",shared.shareddata.nnav);
-		fprintf(stderr,"dbg2       nnav_alloc:         %d\n",shared.shareddata.nnav_alloc);
-		fprintf(stderr,"dbg2       nav_selected[0]:    %d\n",shared.shareddata.nav_selected[0]);
-		fprintf(stderr,"dbg2       nav_selected[1]:    %d\n",shared.shareddata.nav_selected[1]);
-		fprintf(stderr,"dbg2       nav_point_selected: %p\n",shared.shareddata.nav_point_selected);
-		for (i=0;i<shared.shareddata.nnav;i++)
-			{
-			fprintf(stderr,"dbg2       nav %d color:         %d\n",i,shared.shareddata.navs[i].color);
-			fprintf(stderr,"dbg2       nav %d size:          %d\n",i,shared.shareddata.navs[i].size);
-			fprintf(stderr,"dbg2       nav %d name:          %s\n",i,shared.shareddata.navs[i].name);
-			fprintf(stderr,"dbg2       nav %d pathstatus:    %d\n",i,shared.shareddata.navs[i].pathstatus);
-			fprintf(stderr,"dbg2       nav %d pathraw:       %s\n",i,shared.shareddata.navs[i].pathraw);
-			fprintf(stderr,"dbg2       nav %d pathprocessed: %s\n",i,shared.shareddata.navs[i].pathprocessed);
-			fprintf(stderr,"dbg2       nav %d swathbounds:   %d\n",i,shared.shareddata.navs[i].swathbounds);
-			fprintf(stderr,"dbg2       nav %d line:          %d\n",i,shared.shareddata.navs[i].line);
-			fprintf(stderr,"dbg2       nav %d shot:          %d\n",i,shared.shareddata.navs[i].shot);
-			fprintf(stderr,"dbg2       nav %d cdp:           %d\n",i,shared.shareddata.navs[i].cdp);
-			fprintf(stderr,"dbg2       nav %d decimation:    %d\n",i,shared.shareddata.navs[i].decimation);
-			fprintf(stderr,"dbg2       nav %d npoints:       %d\n",i,shared.shareddata.navs[i].npoints);
-			fprintf(stderr,"dbg2       nav %d npoints_alloc: %d\n",i,shared.shareddata.navs[i].npoints_alloc);
-			fprintf(stderr,"dbg2       nav %d nselected:     %d\n",i,shared.shareddata.navs[i].nselected);
-			for (j=0;j<shared.shareddata.navs[i].npoints;j++)
-				{
-				fprintf(stderr,"dbg2       nav %d %d draped:   %d\n",i,j,shared.shareddata.navs[i].navpts[j].draped);
-				fprintf(stderr,"dbg2       nav %d %d selected: %d\n",i,j,shared.shareddata.navs[i].navpts[j].selected);
-				fprintf(stderr,"dbg2       nav %d %d time_d:   %f\n",i,j,shared.shareddata.navs[i].navpts[j].time_d);
-				fprintf(stderr,"dbg2       nav %d %d heading:  %f\n",i,j,shared.shareddata.navs[i].navpts[j].heading);
-				fprintf(stderr,"dbg2       nav %d %d speed:    %f\n",i,j,shared.shareddata.navs[i].navpts[j].speed);
-				fprintf(stderr,"dbg2       nav %d %d line:     %d\n",i,j,shared.shareddata.navs[i].navpts[j].line);
-				fprintf(stderr,"dbg2       nav %d %d shot:     %d\n",i,j,shared.shareddata.navs[i].navpts[j].shot);
-				fprintf(stderr,"dbg2       nav %d %d cdp:      %d\n",i,j,shared.shareddata.navs[i].navpts[j].cdp);
-
-				fprintf(stderr,"dbg2       nav %d %d xgrid:    %f\n",i,j,shared.shareddata.navs[i].navpts[j].point.xgrid[instance]);
-				fprintf(stderr,"dbg2       nav %d %d ygrid:    %f\n",i,j,shared.shareddata.navs[i].navpts[j].point.ygrid[instance]);
-				fprintf(stderr,"dbg2       nav %d %d xlon:     %f\n",i,j,shared.shareddata.navs[i].navpts[j].point.xlon);
-				fprintf(stderr,"dbg2       nav %d %d ylat:     %f\n",i,j,shared.shareddata.navs[i].navpts[j].point.ylat);
-				fprintf(stderr,"dbg2       nav %d %d zdata:    %f\n",i,j,shared.shareddata.navs[i].navpts[j].point.zdata);
-				fprintf(stderr,"dbg2       nav %d %d xdisplay: %f\n",i,j,shared.shareddata.navs[i].navpts[j].point.xdisplay[instance]);
-				fprintf(stderr,"dbg2       nav %d %d ydisplay: %f\n",i,j,shared.shareddata.navs[i].navpts[j].point.ydisplay[instance]);
-				fprintf(stderr,"dbg2       nav %d %d zdisplay: %f\n",i,j,shared.shareddata.navs[i].navpts[j].point.zdisplay[instance]);
-
-				fprintf(stderr,"dbg2       nav %d %d stbd xgrid:    %f\n",i,j,shared.shareddata.navs[i].navpts[j].pointport.xgrid[instance]);
-				fprintf(stderr,"dbg2       nav %d %d stbd ygrid:    %f\n",i,j,shared.shareddata.navs[i].navpts[j].pointport.ygrid[instance]);
-				fprintf(stderr,"dbg2       nav %d %d stbd xlon:     %f\n",i,j,shared.shareddata.navs[i].navpts[j].pointport.xlon);
-				fprintf(stderr,"dbg2       nav %d %d stbd ylat:     %f\n",i,j,shared.shareddata.navs[i].navpts[j].pointport.ylat);
-				fprintf(stderr,"dbg2       nav %d %d stbd zdata:    %f\n",i,j,shared.shareddata.navs[i].navpts[j].pointport.zdata);
-				fprintf(stderr,"dbg2       nav %d %d stbd xdisplay: %f\n",i,j,shared.shareddata.navs[i].navpts[j].pointport.xdisplay[instance]);
-				fprintf(stderr,"dbg2       nav %d %d stbd ydisplay: %f\n",i,j,shared.shareddata.navs[i].navpts[j].pointport.ydisplay[instance]);
-				fprintf(stderr,"dbg2       nav %d %d stbd zdisplay: %f\n",i,j,shared.shareddata.navs[i].navpts[j].pointport.zdisplay[instance]);
-
-				fprintf(stderr,"dbg2       nav %d %d cntr xgrid:    %f\n",i,j,shared.shareddata.navs[i].navpts[j].pointcntr.xgrid[instance]);
-				fprintf(stderr,"dbg2       nav %d %d cntr ygrid:    %f\n",i,j,shared.shareddata.navs[i].navpts[j].pointcntr.ygrid[instance]);
-				fprintf(stderr,"dbg2       nav %d %d cntr xlon:     %f\n",i,j,shared.shareddata.navs[i].navpts[j].pointcntr.xlon);
-				fprintf(stderr,"dbg2       nav %d %d cntr ylat:     %f\n",i,j,shared.shareddata.navs[i].navpts[j].pointcntr.ylat);
-				fprintf(stderr,"dbg2       nav %d %d cntr zdata:    %f\n",i,j,shared.shareddata.navs[i].navpts[j].pointcntr.zdata);
-				fprintf(stderr,"dbg2       nav %d %d cntr xdisplay: %f\n",i,j,shared.shareddata.navs[i].navpts[j].pointcntr.xdisplay[instance]);
-				fprintf(stderr,"dbg2       nav %d %d cntr ydisplay: %f\n",i,j,shared.shareddata.navs[i].navpts[j].pointcntr.ydisplay[instance]);
-				fprintf(stderr,"dbg2       nav %d %d cntr zdisplay: %f\n",i,j,shared.shareddata.navs[i].navpts[j].pointcntr.zdisplay[instance]);
-
-				fprintf(stderr,"dbg2       nav %d %d port xgrid:    %f\n",i,j,shared.shareddata.navs[i].navpts[j].pointstbd.xgrid[instance]);
-				fprintf(stderr,"dbg2       nav %d %d port ygrid:    %f\n",i,j,shared.shareddata.navs[i].navpts[j].pointstbd.ygrid[instance]);
-				fprintf(stderr,"dbg2       nav %d %d port xlon:     %f\n",i,j,shared.shareddata.navs[i].navpts[j].pointstbd.xlon);
-				fprintf(stderr,"dbg2       nav %d %d port ylat:     %f\n",i,j,shared.shareddata.navs[i].navpts[j].pointstbd.ylat);
-				fprintf(stderr,"dbg2       nav %d %d port zdata:    %f\n",i,j,shared.shareddata.navs[i].navpts[j].pointstbd.zdata);
-				fprintf(stderr,"dbg2       nav %d %d port xdisplay: %f\n",i,j,shared.shareddata.navs[i].navpts[j].pointstbd.xdisplay[instance]);
-				fprintf(stderr,"dbg2       nav %d %d port ydisplay: %f\n",i,j,shared.shareddata.navs[i].navpts[j].pointstbd.ydisplay[instance]);
-				fprintf(stderr,"dbg2       nav %d %d port zdisplay: %f\n",i,j,shared.shareddata.navs[i].navpts[j].pointstbd.zdisplay[instance]);
-				}
-			for (j=0;j<shared.shareddata.navs[i].npoints-1;j++)
-				{
-				fprintf(stderr,"dbg2       nav %d %d nls:          %d\n",i,j,shared.shareddata.navs[i].segments[j].nls);
-				fprintf(stderr,"dbg2       nav %d %d nls_alloc:    %d\n",i,j,shared.shareddata.navs[i].segments[j].nls_alloc);
-				fprintf(stderr,"dbg2       nav %d %d endpoints[0]: %p\n",i,j,&shared.shareddata.navs[i].segments[j].endpoints[0]);
-				fprintf(stderr,"dbg2       nav %d %d endpoints[1]: %p\n",i,j,&shared.shareddata.navs[i].segments[j].endpoints[1]);
-				}
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:                     %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:                    %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-
-
-/*------------------------------------------------------------------------------*/
-int mbview_enableviewnavs(int verbose, size_t instance,
-			int *error)
-
-{
-	/* local variables */
-	char	*function_name = "mbview_enableviewnavs";
-	int	status = MB_SUCCESS;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-
-	/* print starting debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:                   %d\n", verbose);
-		fprintf(stderr,"dbg2       instance:                  %zu\n", instance);
-		}
-
-	/* set values */
-        shared.shareddata.nav_mode = MBV_NAV_VIEW;
-
-	/* set widget sensitivity on all active instances */
-	for (instance=0;instance<MBV_MAX_WINDOWS;instance++)
-		{
-		/* get view */
-		view = &(mbviews[instance]);
-		data = &(view->data);
-
-		/* if instance active reset action sensitivity */
-		if (data->active == MB_YES)
-			mbview_update_sensitivity(verbose, instance, error);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:                     %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:                    %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-
-/*------------------------------------------------------------------------------*/
-int mbview_pick_nav_select(size_t instance, int select, int which, int xpixel, int ypixel)
-{
-
-	/* local variables */
-	char	*function_name = "mbview_pick_nav_select";
-	int	status = MB_SUCCESS;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-	int	found;
-	double	xgrid, ygrid;
-	double	xlon, ylat, zdata;
-	double	xdisplay, ydisplay, zdisplay;
-	double	xx, yy, rr, rrmin;
-	int	inav0, inav1, jpt0, jpt1;
-	int	jj0, jj1;
-	int	inav, jpt;
-	int	i, j;
-
-	/* print starting debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       instance:         %zu\n",instance);
-		fprintf(stderr,"dbg2       select:           %d\n",select);
-		fprintf(stderr,"dbg2       which:            %d\n",which);
-		fprintf(stderr,"dbg2       xpixel:           %d\n",xpixel);
-		fprintf(stderr,"dbg2       ypixel:           %d\n",ypixel);
-		}
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* only select one nav point if enabled and not in move mode */
-	if (shared.shareddata.nav_mode != MBV_NAV_OFF
-		&& shared.shareddata.nnav > 0
-		&& (which == MBV_PICK_DOWN
-			|| shared.shareddata.nav_selected[0] == MBV_SELECT_NONE))
-		{
-		/* look for point */
-		mbview_findpoint(instance, xpixel, ypixel,
-				&found,
-				&xgrid, &ygrid,
-				&xlon, &ylat, &zdata,
-				&xdisplay, &ydisplay, &zdisplay);
-
-		/* look for nearest nav point */
-		if (found)
-			{
-			rrmin = 1000000000.0;
-			shared.shareddata.nav_selected[0] = MBV_SELECT_NONE;
-			shared.shareddata.nav_point_selected[0] = MBV_SELECT_NONE;
-			shared.shareddata.nav_selected[1] = MBV_SELECT_NONE;
-			shared.shareddata.nav_point_selected[1] = MBV_SELECT_NONE;
-
-			for (i=0;i<shared.shareddata.nnav;i++)
-				{
-				for (j=0;j<shared.shareddata.navs[i].npoints;j++)
-					{
-					xx = xgrid - shared.shareddata.navs[i].navpts[j].point.xgrid[instance];
-					yy = ygrid - shared.shareddata.navs[i].navpts[j].point.ygrid[instance];
-					rr = sqrt(xx * xx + yy * yy);
-					if (rr < rrmin)
-						{
-						rrmin = rr;
-						shared.shareddata.nav_selected[0] = i;
-						shared.shareddata.nav_point_selected[0] = j;
-						}
-					}
-				}
-
-			/* set pick location */
-			data->pickinfo_mode = MBV_PICK_NAV;
-			shared.shareddata.navpick_type = MBV_PICK_ONEPOINT;
-			shared.shareddata.navpick.endpoints[0].xgrid[instance]
-				= shared.shareddata.navs[shared.shareddata.nav_selected[0]].navpts[shared.shareddata.nav_point_selected[0]].point.xgrid[instance];
-			shared.shareddata.navpick.endpoints[0].ygrid[instance]
-				= shared.shareddata.navs[shared.shareddata.nav_selected[0]].navpts[shared.shareddata.nav_point_selected[0]].point.ygrid[instance];
-			shared.shareddata.navpick.endpoints[0].xlon
-				= shared.shareddata.navs[shared.shareddata.nav_selected[0]].navpts[shared.shareddata.nav_point_selected[0]].point.xlon;
-			shared.shareddata.navpick.endpoints[0].ylat
-				= shared.shareddata.navs[shared.shareddata.nav_selected[0]].navpts[shared.shareddata.nav_point_selected[0]].point.ylat;
-			shared.shareddata.navpick.endpoints[0].zdata
-				= shared.shareddata.navs[shared.shareddata.nav_selected[0]].navpts[shared.shareddata.nav_point_selected[0]].point.zdata;
-			shared.shareddata.navpick.endpoints[0].xdisplay[instance]
-				= shared.shareddata.navs[shared.shareddata.nav_selected[0]].navpts[shared.shareddata.nav_point_selected[0]].point.xdisplay[instance];
-			shared.shareddata.navpick.endpoints[0].ydisplay[instance]
-				= shared.shareddata.navs[shared.shareddata.nav_selected[0]].navpts[shared.shareddata.nav_point_selected[0]].point.ydisplay[instance];
-			shared.shareddata.navpick.endpoints[0].zdisplay[instance]
-				= shared.shareddata.navs[shared.shareddata.nav_selected[0]].navpts[shared.shareddata.nav_point_selected[0]].point.zdisplay[instance];
-
-			/* get pick positions for all active instances */
-			mbview_updatepointw(instance, &(shared.shareddata.navpick.endpoints[0]));
-
-			/* generate 3D drape of pick marks  */
-			mbview_navpicksize(instance);
-			}
-		else
-			{
-			/* unselect nav pick */
-			data->pickinfo_mode = data->pick_type;
-			shared.shareddata.navpick_type = MBV_PICK_NONE;
-			shared.shareddata.nav_selected[0] = MBV_SELECT_NONE;
-			shared.shareddata.nav_point_selected[0] = MBV_SELECT_NONE;
-			XBell(view->dpy,100);
-			}
-		}
-
-	/* only select two nav points if enabled */
-	else if (shared.shareddata.nav_mode != MBV_NAV_OFF
-		&& shared.shareddata.nnav > 0
-		&& (which == MBV_PICK_MOVE
-			&& shared.shareddata.nav_selected[0] != MBV_SELECT_NONE))
-		{
-		/* look for point */
-		mbview_findpoint(instance, xpixel, ypixel,
-				&found,
-				&xgrid, &ygrid,
-				&xlon, &ylat, &zdata,
-				&xdisplay, &ydisplay, &zdisplay);
-
-		/* look for nearest nav point */
-		if (found)
-			{
-			rrmin = 1000000000.0;
-			shared.shareddata.nav_selected[1] = MBV_SELECT_NONE;
-			shared.shareddata.nav_point_selected[1] = MBV_SELECT_NONE;
-
-			for (i=0;i<shared.shareddata.nnav;i++)
-				{
-				for (j=0;j<shared.shareddata.navs[i].npoints;j++)
-					{
-					xx = xgrid - shared.shareddata.navs[i].navpts[j].point.xgrid[instance];
-					yy = ygrid - shared.shareddata.navs[i].navpts[j].point.ygrid[instance];
-					rr = sqrt(xx * xx + yy * yy);
-					if (rr < rrmin)
-						{
-						rrmin = rr;
-						shared.shareddata.nav_selected[1] = i;
-						shared.shareddata.nav_point_selected[1] = j;
-						}
-					}
-				}
-
-			/* set pick location */
-			data->pickinfo_mode = MBV_PICK_NAV;
-			shared.shareddata.navpick_type = MBV_PICK_TWOPOINT;
-			shared.shareddata.navpick.endpoints[1].xgrid[instance]
-				= shared.shareddata.navs[shared.shareddata.nav_selected[1]].navpts[shared.shareddata.nav_point_selected[1]].point.xgrid[instance];
-			shared.shareddata.navpick.endpoints[1].ygrid[instance]
-				= shared.shareddata.navs[shared.shareddata.nav_selected[1]].navpts[shared.shareddata.nav_point_selected[1]].point.ygrid[instance];
-			shared.shareddata.navpick.endpoints[1].xlon
-				= shared.shareddata.navs[shared.shareddata.nav_selected[1]].navpts[shared.shareddata.nav_point_selected[1]].point.xlon;
-			shared.shareddata.navpick.endpoints[1].ylat
-				= shared.shareddata.navs[shared.shareddata.nav_selected[1]].navpts[shared.shareddata.nav_point_selected[1]].point.ylat;
-			shared.shareddata.navpick.endpoints[1].zdata
-				= shared.shareddata.navs[shared.shareddata.nav_selected[1]].navpts[shared.shareddata.nav_point_selected[1]].point.zdata;
-			shared.shareddata.navpick.endpoints[1].xdisplay[instance]
-				= shared.shareddata.navs[shared.shareddata.nav_selected[1]].navpts[shared.shareddata.nav_point_selected[1]].point.xdisplay[instance];
-			shared.shareddata.navpick.endpoints[1].ydisplay[instance]
-				= shared.shareddata.navs[shared.shareddata.nav_selected[1]].navpts[shared.shareddata.nav_point_selected[1]].point.ydisplay[instance];
-			shared.shareddata.navpick.endpoints[1].zdisplay[instance]
-				= shared.shareddata.navs[shared.shareddata.nav_selected[1]].navpts[shared.shareddata.nav_point_selected[1]].point.zdisplay[instance];
-
-			/* get pick positions for all active instances */
-			mbview_updatepointw(instance, &(shared.shareddata.navpick.endpoints[1]));
-
-			/* generate 3D drape of pick marks */
-			mbview_navpicksize(instance);
-			}
-		}
-
-	/* if data->mouse_mode == MBV_MOUSE_NAV only select or deselect range of nav points if enabled and two different points selected */
-	else if (shared.shareddata.nav_mode != MBV_NAV_OFF
-		&& shared.shareddata.nnav > 0
-		&& which == MBV_PICK_UP
-		&& data->mouse_mode == MBV_MOUSE_NAV)
-		{
-		/* select range of nav if two different points have been selected */
-		if (shared.shareddata.nav_selected[0] != MBV_SELECT_NONE
-			&& shared.shareddata.nav_selected[1] != MBV_SELECT_NONE)
-			{
-			/* get order of selected nav points */
-			inav0 = MIN(shared.shareddata.nav_selected[0], shared.shareddata.nav_selected[1]);
-			inav1 = MAX(shared.shareddata.nav_selected[0], shared.shareddata.nav_selected[1]);
-			if (inav0 == inav1)
-				{
-				jpt0 = MIN(shared.shareddata.nav_point_selected[0], shared.shareddata.nav_point_selected[1]);
-				jpt1 = MAX(shared.shareddata.nav_point_selected[0], shared.shareddata.nav_point_selected[1]);
-				}
-			else if (shared.shareddata.nav_selected[0] <= shared.shareddata.nav_selected[1])
-				{
-				jpt0 = shared.shareddata.nav_point_selected[0];
-				jpt1 = shared.shareddata.nav_point_selected[1];
-				}
-			else
-				{
-				jpt0 = shared.shareddata.nav_point_selected[1];
-				jpt1 = shared.shareddata.nav_point_selected[0];
-				}
-
-			/* loop over the affected nav */
-			for (inav=inav0;inav<=inav1;inav++)
-				{
-				if (inav == inav0)
-					jj0 = MIN(jpt0, shared.shareddata.navs[inav].npoints - 1);
-				else
-					jj0 = 0;
-				if (inav == inav1)
-					jj1 = MAX(jpt1, 0);
-				else
-					jj1 = shared.shareddata.navs[inav].npoints;
-				for (jpt=jj0;jpt<=jj1;jpt++)
-					{
-					shared.shareddata.navs[inav].navpts[jpt].selected = select;
-					}
-				shared.shareddata.navs[inav].nselected = 0;
-				for (jpt=0;jpt<shared.shareddata.navs[inav].npoints;jpt++)
-					{
-					if (shared.shareddata.navs[inav].navpts[jpt].selected == MB_YES)
-						shared.shareddata.navs[inav].nselected++;
-					}
-				}
-			}
-
-		/* else select single nav point */
-		else if (shared.shareddata.nav_selected[0] != MBV_SELECT_NONE)
-			{
-			inav = shared.shareddata.nav_selected[0];
-			jpt = shared.shareddata.nav_point_selected[0];
-			shared.shareddata.navs[inav].navpts[jpt].selected = select;
-			shared.shareddata.navs[inav].nselected = 0;
-			for (jpt=0;jpt<shared.shareddata.navs[inav].npoints;jpt++)
-				{
-				if (shared.shareddata.navs[inav].navpts[jpt].selected == MB_YES)
-					shared.shareddata.navs[inav].nselected++;
-				}
-			}
-		}
-
-	/* if data->mouse_mode == MBV_MOUSE_NAVFILE select or deselect all affected files */
-	else if (shared.shareddata.nav_mode != MBV_NAV_OFF
-		&& shared.shareddata.nnav > 0
-		&& which == MBV_PICK_UP
-		&& data->mouse_mode == MBV_MOUSE_NAVFILE)
-		{
-/* fprintf(stderr,"nav selected: %d %d select:%d\n",
-shared.shareddata.nav_selected[0],shared.shareddata.nav_selected[1],select);*/
-		/* select range of nav files if one or two different points have been selected */
-		if (shared.shareddata.nav_selected[0] != MBV_SELECT_NONE)
-			{
-			/* get order of selected nav points */
-			if (shared.shareddata.nav_selected[1] != MBV_SELECT_NONE)
-				{
-				inav0 = MIN(shared.shareddata.nav_selected[0], shared.shareddata.nav_selected[1]);
-				inav1 = MAX(shared.shareddata.nav_selected[0], shared.shareddata.nav_selected[1]);
-				}
-			else
-				{
-				inav0 = shared.shareddata.nav_selected[0];
-				inav1 = shared.shareddata.nav_selected[0];
-				}
-
-			/* loop over the affected nav */
-			for (inav=inav0;inav<=inav1;inav++)
-				{
-				for (jpt=0;jpt<shared.shareddata.navs[inav].npoints;jpt++)
-					{
-					shared.shareddata.navs[inav].navpts[jpt].selected = select;
-					}
-				shared.shareddata.navs[inav].nselected = 0;
-				for (jpt=0;jpt<shared.shareddata.navs[inav].npoints;jpt++)
-					{
-					if (shared.shareddata.navs[inav].navpts[jpt].selected == MB_YES)
-						shared.shareddata.navs[inav].nselected++;
-					}
-				}
-			}
-		}
-
-	/* else beep */
-	else
-		{
-		shared.shareddata.nav_selected[0] = MBV_SELECT_NONE;
-		shared.shareddata.nav_point_selected[0] = MBV_SELECT_NONE;
-		shared.shareddata.nav_selected[1] = MBV_SELECT_NONE;
-		shared.shareddata.nav_point_selected[1] = MBV_SELECT_NONE;
-		XBell(view->dpy,100);
-		for (i=0;i<shared.shareddata.nnav;i++)
-			{
-			for (j=0;j<shared.shareddata.navs[i].npoints;j++)
-				{
-				shared.shareddata.navs[i].navpts[j].selected = MB_NO;
-				}
-			}
-		}
-
-	/* set what kind of pick to annotate */
-	if (shared.shareddata.nav_selected[0] != MBV_SELECT_NONE)
-		{
-		data->pickinfo_mode = MBV_PICK_NAV;
-		}
-	else
-		{
-		data->pickinfo_mode = data->pick_type;
-		}
-
-	/* update nav data list */
-	mbview_updatenavlist();
-
-	/* set pick annotation */
-	mbview_pick_text(instance);
-
-	/* call pick notify if defined */
-	if (which == MBV_PICK_UP && shared.shareddata.nav_selected[0] != MBV_SELECT_NONE
-		&& data->mbview_picknav_notify != NULL)
-		{
-		(data->mbview_picknav_notify)(instance);
-		}
-
-	/* print nav debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  Nav data altered in function <%s>\n",
-			function_name);
-		fprintf(stderr,"dbg2  Nav values:\n");
-		fprintf(stderr,"dbg2       nav_mode:              %d\n",shared.shareddata.nav_mode);
-		fprintf(stderr,"dbg2       nav_view_mode:         %d\n",data->nav_view_mode);
-		fprintf(stderr,"dbg2       navdrape_view_mode:    %d\n",data->navdrape_view_mode);
-		fprintf(stderr,"dbg2       nnav:                  %d\n",shared.shareddata.nnav);
-		fprintf(stderr,"dbg2       nnav_alloc:            %d\n",shared.shareddata.nnav_alloc);
-		fprintf(stderr,"dbg2       nav_selected[0]:       %d\n",shared.shareddata.nav_selected[0]);
-		fprintf(stderr,"dbg2       nav_point_selected[0]: %d\n",shared.shareddata.nav_point_selected[0]);
-		fprintf(stderr,"dbg2       nav_selected[1]:       %d\n",shared.shareddata.nav_selected[1]);
-		fprintf(stderr,"dbg2       nav_point_selected[1]: %d\n",shared.shareddata.nav_point_selected[1]);
-		for (i=0;i<shared.shareddata.nnav;i++)
-			{
-			fprintf(stderr,"dbg2       nav %d color:         %d\n",i,shared.shareddata.navs[i].color);
-			fprintf(stderr,"dbg2       nav %d size:          %d\n",i,shared.shareddata.navs[i].size);
-			fprintf(stderr,"dbg2       nav %d name:          %s\n",i,shared.shareddata.navs[i].name);
-			fprintf(stderr,"dbg2       nav %d swathbounds:   %d\n",i,shared.shareddata.navs[i].swathbounds);
-			fprintf(stderr,"dbg2       nav %d line:          %d\n",i,shared.shareddata.navs[i].line);
-			fprintf(stderr,"dbg2       nav %d shot:          %d\n",i,shared.shareddata.navs[i].shot);
-			fprintf(stderr,"dbg2       nav %d cdp:           %d\n",i,shared.shareddata.navs[i].cdp);
-			fprintf(stderr,"dbg2       nav %d decimation:    %d\n",i,shared.shareddata.navs[i].decimation);
-			fprintf(stderr,"dbg2       nav %d npoints:       %d\n",i,shared.shareddata.navs[i].npoints);
-			fprintf(stderr,"dbg2       nav %d npoints_alloc: %d\n",i,shared.shareddata.navs[i].npoints_alloc);
-			fprintf(stderr,"dbg2       nav %d nselected:     %d\n",i,shared.shareddata.navs[i].nselected);
-			for (j=0;j<shared.shareddata.navs[i].npoints;j++)
-				{
-				fprintf(stderr,"dbg2       nav %d %d draped:   %d\n",i,j,shared.shareddata.navs[i].navpts[j].draped);
-				fprintf(stderr,"dbg2       nav %d %d selected: %d\n",i,j,shared.shareddata.navs[i].navpts[j].selected);
-				fprintf(stderr,"dbg2       nav %d %d time_d:   %f\n",i,j,shared.shareddata.navs[i].navpts[j].time_d);
-				fprintf(stderr,"dbg2       nav %d %d heading:  %f\n",i,j,shared.shareddata.navs[i].navpts[j].heading);
-				fprintf(stderr,"dbg2       nav %d %d speed:    %f\n",i,j,shared.shareddata.navs[i].navpts[j].speed);
-				fprintf(stderr,"dbg2       nav %d %d line:     %d\n",i,j,shared.shareddata.navs[i].navpts[j].line);
-				fprintf(stderr,"dbg2       nav %d %d shot:     %d\n",i,j,shared.shareddata.navs[i].navpts[j].shot);
-				fprintf(stderr,"dbg2       nav %d %d cdp:      %d\n",i,j,shared.shareddata.navs[i].navpts[j].cdp);
-
-				fprintf(stderr,"dbg2       nav %d %d xgrid:    %f\n",i,j,shared.shareddata.navs[i].navpts[j].point.xgrid[instance]);
-				fprintf(stderr,"dbg2       nav %d %d ygrid:    %f\n",i,j,shared.shareddata.navs[i].navpts[j].point.ygrid[instance]);
-				fprintf(stderr,"dbg2       nav %d %d xlon:     %f\n",i,j,shared.shareddata.navs[i].navpts[j].point.xlon);
-				fprintf(stderr,"dbg2       nav %d %d ylat:     %f\n",i,j,shared.shareddata.navs[i].navpts[j].point.ylat);
-				fprintf(stderr,"dbg2       nav %d %d zdata:    %f\n",i,j,shared.shareddata.navs[i].navpts[j].point.zdata);
-				fprintf(stderr,"dbg2       nav %d %d xdisplay: %f\n",i,j,shared.shareddata.navs[i].navpts[j].point.xdisplay[instance]);
-				fprintf(stderr,"dbg2       nav %d %d ydisplay: %f\n",i,j,shared.shareddata.navs[i].navpts[j].point.ydisplay[instance]);
-				fprintf(stderr,"dbg2       nav %d %d zdisplay: %f\n",i,j,shared.shareddata.navs[i].navpts[j].point.zdisplay[instance]);
-
-				fprintf(stderr,"dbg2       nav %d %d stbd xgrid:    %f\n",i,j,shared.shareddata.navs[i].navpts[j].pointport.xgrid[instance]);
-				fprintf(stderr,"dbg2       nav %d %d stbd ygrid:    %f\n",i,j,shared.shareddata.navs[i].navpts[j].pointport.ygrid[instance]);
-				fprintf(stderr,"dbg2       nav %d %d stbd xlon:     %f\n",i,j,shared.shareddata.navs[i].navpts[j].pointport.xlon);
-				fprintf(stderr,"dbg2       nav %d %d stbd ylat:     %f\n",i,j,shared.shareddata.navs[i].navpts[j].pointport.ylat);
-				fprintf(stderr,"dbg2       nav %d %d stbd zdata:    %f\n",i,j,shared.shareddata.navs[i].navpts[j].pointport.zdata);
-				fprintf(stderr,"dbg2       nav %d %d stbd xdisplay: %f\n",i,j,shared.shareddata.navs[i].navpts[j].pointport.xdisplay[instance]);
-				fprintf(stderr,"dbg2       nav %d %d stbd ydisplay: %f\n",i,j,shared.shareddata.navs[i].navpts[j].pointport.ydisplay[instance]);
-				fprintf(stderr,"dbg2       nav %d %d stbd zdisplay: %f\n",i,j,shared.shareddata.navs[i].navpts[j].pointport.zdisplay[instance]);
-
-				fprintf(stderr,"dbg2       nav %d %d cntr xgrid:    %f\n",i,j,shared.shareddata.navs[i].navpts[j].pointcntr.xgrid[instance]);
-				fprintf(stderr,"dbg2       nav %d %d cntr ygrid:    %f\n",i,j,shared.shareddata.navs[i].navpts[j].pointcntr.ygrid[instance]);
-				fprintf(stderr,"dbg2       nav %d %d cntr xlon:     %f\n",i,j,shared.shareddata.navs[i].navpts[j].pointcntr.xlon);
-				fprintf(stderr,"dbg2       nav %d %d cntr ylat:     %f\n",i,j,shared.shareddata.navs[i].navpts[j].pointcntr.ylat);
-				fprintf(stderr,"dbg2       nav %d %d cntr zdata:    %f\n",i,j,shared.shareddata.navs[i].navpts[j].pointcntr.zdata);
-				fprintf(stderr,"dbg2       nav %d %d cntr xdisplay: %f\n",i,j,shared.shareddata.navs[i].navpts[j].pointcntr.xdisplay[instance]);
-				fprintf(stderr,"dbg2       nav %d %d cntr ydisplay: %f\n",i,j,shared.shareddata.navs[i].navpts[j].pointcntr.ydisplay[instance]);
-				fprintf(stderr,"dbg2       nav %d %d cntr zdisplay: %f\n",i,j,shared.shareddata.navs[i].navpts[j].pointcntr.zdisplay[instance]);
-
-				fprintf(stderr,"dbg2       nav %d %d port xgrid:    %f\n",i,j,shared.shareddata.navs[i].navpts[j].pointstbd.xgrid[instance]);
-				fprintf(stderr,"dbg2       nav %d %d port ygrid:    %f\n",i,j,shared.shareddata.navs[i].navpts[j].pointstbd.ygrid[instance]);
-				fprintf(stderr,"dbg2       nav %d %d port xlon:     %f\n",i,j,shared.shareddata.navs[i].navpts[j].pointstbd.xlon);
-				fprintf(stderr,"dbg2       nav %d %d port ylat:     %f\n",i,j,shared.shareddata.navs[i].navpts[j].pointstbd.ylat);
-				fprintf(stderr,"dbg2       nav %d %d port zdata:    %f\n",i,j,shared.shareddata.navs[i].navpts[j].pointstbd.zdata);
-				fprintf(stderr,"dbg2       nav %d %d port xdisplay: %f\n",i,j,shared.shareddata.navs[i].navpts[j].pointstbd.xdisplay[instance]);
-				fprintf(stderr,"dbg2       nav %d %d port ydisplay: %f\n",i,j,shared.shareddata.navs[i].navpts[j].pointstbd.ydisplay[instance]);
-				fprintf(stderr,"dbg2       nav %d %d port zdisplay: %f\n",i,j,shared.shareddata.navs[i].navpts[j].pointstbd.zdisplay[instance]);
-				}
-			for (j=0;j<shared.shareddata.navs[i].npoints-1;j++)
-				{
-				fprintf(stderr,"dbg2       nav %d %d nls:          %d\n",i,j,shared.shareddata.navs[i].segments[j].nls);
-				fprintf(stderr,"dbg2       nav %d %d nls_alloc:    %d\n",i,j,shared.shareddata.navs[i].segments[j].nls_alloc);
-				fprintf(stderr,"dbg2       nav %d %d endpoints[0]: %p\n",i,j,&shared.shareddata.navs[i].segments[j].endpoints[0]);
-				fprintf(stderr,"dbg2       nav %d %d endpoints[1]: %p\n",i,j,&shared.shareddata.navs[i].segments[j].endpoints[1]);
-				}
-			}
-		}
-
-	/* print output debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:          %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-/*------------------------------------------------------------------------------*/
-int mbview_extract_nav_profile(size_t instance)
-{
-
-	/* local variables */
-	char	*function_name = "mbview_extract_nav_profile";
-	int	status = MB_SUCCESS;
-	int	error = MB_ERROR_NO_ERROR;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-	int	nprpoints;
-	double	dx, dy;
-	int	lasti, lastj, firstj;
-	int	i, j;
-
-	/* print starting debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       instance:         %zu\n",instance);
-		}
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* if any nav exists, check if any are selected then extract the profile */
-	if (shared.shareddata.nnav > 0)
-		{
-		data->profile.source = MBV_PROFILE_NAV;
-		strcpy(data->profile.source_name, "Navigation");
-		data->profile.length = 0.0;
-
-		/* make sure enough memory is allocated for the profile */
-		nprpoints = 0;
-		for (i=0;i<shared.shareddata.nnav;i++)
-			{
-			for (j=0;j<shared.shareddata.navs[i].npoints;j++)
-				{
-				if (shared.shareddata.navs[i].navpts[j].selected == MB_YES)
-					{
-					nprpoints ++;
-					}
-				}
-			}
-		if (data->profile.npoints_alloc < nprpoints)
-			{
-			status = mbview_allocprofilepoints(mbv_verbose,
-					nprpoints, &(data->profile.points), &error);
-			if (status == MB_SUCCESS)
-				{
-				data->profile.npoints_alloc = nprpoints;
-				}
-			else
-				{
-				data->profile.npoints_alloc = 0;
-				}
-			}
-
-		/* extract the profile */
-		if (nprpoints > 2 && data->profile.npoints_alloc >= nprpoints)
-			{
-			data->profile.npoints = 0;
-			lasti = 0;
-			lastj = 0;
-			for (i=0;i<shared.shareddata.nnav;i++)
-				{
-				firstj = -1;
-				for (j=0;j<shared.shareddata.navs[i].npoints;j++)
-					{
-					if (shared.shareddata.navs[i].navpts[j].selected == MB_YES)
-						{
-						data->profile.points[data->profile.npoints].boundary = MB_YES;
-						if (data->profile.npoints > 0
-							&& i == lasti && j > 1 && lastj == j-1
-							&& j > 0 && firstj != j-1)
-							data->profile.points[data->profile.npoints-1].boundary = MB_NO;
-						lasti = i;
-						lastj = j;
-						if (firstj == -1)
-							firstj = j;
-
-						data->profile.points[data->profile.npoints].xgrid = shared.shareddata.navs[i].navpts[j].pointcntr.xgrid[instance];
-						data->profile.points[data->profile.npoints].ygrid = shared.shareddata.navs[i].navpts[j].pointcntr.ygrid[instance];
-						data->profile.points[data->profile.npoints].xlon = shared.shareddata.navs[i].navpts[j].pointcntr.xlon;
-						data->profile.points[data->profile.npoints].ylat = shared.shareddata.navs[i].navpts[j].pointcntr.ylat;
-						data->profile.points[data->profile.npoints].zdata = shared.shareddata.navs[i].navpts[j].pointcntr.zdata;
-						data->profile.points[data->profile.npoints].xdisplay = shared.shareddata.navs[i].navpts[j].pointcntr.xdisplay[instance];
-						data->profile.points[data->profile.npoints].ydisplay = shared.shareddata.navs[i].navpts[j].pointcntr.ydisplay[instance];
-						if (data->profile.npoints == 0)
-							{
-							data->profile.zmin = data->profile.points[data->profile.npoints].zdata;
-							data->profile.zmax = data->profile.points[data->profile.npoints].zdata;
-							data->profile.points[data->profile.npoints].distance = 0.0;
-							data->profile.points[data->profile.npoints].distovertopo = 0.0;
-							data->profile.points[data->profile.npoints].bearing = 0.0;
-							}
-						else
-							{
-							data->profile.zmin = MIN(data->profile.zmin, data->profile.points[data->profile.npoints].zdata);
-							data->profile.zmax = MAX(data->profile.zmax, data->profile.points[data->profile.npoints].zdata);
-							if (data->display_projection_mode != MBV_PROJECTION_SPHEROID)
-								{
-								dx = data->profile.points[data->profile.npoints].xdisplay
-										- data->profile.points[data->profile.npoints-1].xdisplay;
-								dy = data->profile.points[data->profile.npoints].ydisplay
-										- data->profile.points[data->profile.npoints-1].ydisplay;
-								data->profile.points[data->profile.npoints].distance = sqrt(dx * dx + dy * dy) / view->scale
-									+ data->profile.points[data->profile.npoints-1].distance;
-								data->profile.points[data->profile.npoints].bearing = RTD * atan2(dx, dy);
-								}
-							else
-								{
-								mbview_greatcircle_distbearing(instance,
-									data->profile.points[data->profile.npoints-1].xlon,
-									data->profile.points[data->profile.npoints-1].ylat,
-									data->profile.points[data->profile.npoints].xlon,
-									data->profile.points[data->profile.npoints].ylat,
-									&(data->profile.points[data->profile.npoints].bearing),
-									&(data->profile.points[data->profile.npoints].distance));
-								mbview_greatcircle_dist(instance,
-									data->profile.points[0].xlon,
-									data->profile.points[0].ylat,
-									data->profile.points[data->profile.npoints].xlon,
-									data->profile.points[data->profile.npoints].ylat,
-									&(data->profile.points[data->profile.npoints].distance));
-								}
-							dy = (data->profile.points[data->profile.npoints].zdata
-								- data->profile.points[data->profile.npoints-1].zdata);
-							dx = (data->profile.points[data->profile.npoints].distance
-								- data->profile.points[data->profile.npoints-1].distance);
-							data->profile.points[data->profile.npoints].distovertopo = data->profile.points[data->profile.npoints-1].distovertopo
-												+ sqrt(dy * dy + dx * dx);
-							if (dx > 0.0)
-								data->profile.points[data->profile.npoints].slope = fabs(dy / dx);
-							else
-								data->profile.points[data->profile.npoints].slope = 0.0;
-							}
-						if (data->profile.points[data->profile.npoints].bearing < 0.0)
-							data->profile.points[data->profile.npoints].bearing += 360.0;
-						if (data->profile.npoints == 1)
-							data->profile.points[0].bearing = data->profile.points[data->profile.npoints].bearing;
-						if (data->profile.npoints > 1)
-							{
-							dy = (data->profile.points[data->profile.npoints].zdata
-								- data->profile.points[data->profile.npoints-2].zdata);
-							dx = (data->profile.points[data->profile.npoints].distance
-								- data->profile.points[data->profile.npoints-2].distance);
-							if (dx > 0.0)
-								data->profile.points[data->profile.npoints-1].slope = fabs(dy / dx);
-							else
-								data->profile.points[data->profile.npoints-1].slope = 0.0;
-							}
-						data->profile.points[data->profile.npoints].navzdata = shared.shareddata.navs[i].navpts[j].point.zdata;;
-						data->profile.points[data->profile.npoints].navtime_d = shared.shareddata.navs[i].navpts[j].time_d;
-						data->profile.npoints++;
-						}
-					else
-						{
-						firstj = -1;
-						}
-					}
-				}
-			data->profile.length = data->profile.points[data->profile.npoints-1].distance;
-
-			/* calculate slope */
-			for (i=0;i<data->profile.npoints;i++)
-				{
-				if (i == 0)
-					{
-					dy = (data->profile.points[i+1].zdata
-						- data->profile.points[i].zdata);
-					dx = (data->profile.points[i+1].distance
-						- data->profile.points[i].distance);
-					}
-				else if (i == data->profile.npoints - 1)
-					{
-					dy = (data->profile.points[i].zdata
-						- data->profile.points[i-1].zdata);
-					dx = (data->profile.points[i].distance
-						- data->profile.points[i-1].distance);
-					}
-				else
-					{
-					dy = (data->profile.points[i+1].zdata
-						- data->profile.points[i-1].zdata);
-					dx = (data->profile.points[i+1].distance
-						- data->profile.points[i-1].distance);
-					}
-				if (dx > 0.0)
-					data->profile.points[i].slope = fabs(dy / dx);
-				else
-					data->profile.points[i].slope = 0.0;
-				}
-			}
-		}
-
-	/* print output debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:          %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-
-
-/*------------------------------------------------------------------------------*/
-int mbview_nav_delete(size_t instance, int inav)
-{
-
-	/* local variables */
-	char	*function_name = "mbview_nav_delete";
-	int	error = MB_ERROR_NO_ERROR;
-	int	status = MB_SUCCESS;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-	int	i;
-
-	/* print starting debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       inav:            %d\n",inav);
-		fprintf(stderr,"dbg2       instance:         %zu\n",instance);
-		}
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* delete nav if its the same as previously selected */
-	if (inav >= 0 && inav < shared.shareddata.nnav)
-		{
-		/* free memory for deleted nav */
-		mb_freed(mbv_verbose,__FILE__,__LINE__,
-				(void **)&(shared.shareddata.navs[inav].navpts), &error);
-		mb_freed(mbv_verbose,__FILE__,__LINE__,
-				(void **)&(shared.shareddata.navs[inav].segments), &error);
-
-		/* move nav data if necessary */
-		for (i=inav;i<shared.shareddata.nnav-1;i++)
-			{
-			shared.shareddata.navs[i] = shared.shareddata.navs[i+1];
-			}
-
-		/* rest last nav */
-		shared.shareddata.navs[shared.shareddata.nnav-1].color = MBV_COLOR_RED;
-		shared.shareddata.navs[shared.shareddata.nnav-1].size = 4;
-		shared.shareddata.navs[shared.shareddata.nnav-1].name[0] = '\0';
-		shared.shareddata.navs[shared.shareddata.nnav-1].pathstatus = MB_PROCESSED_NONE;
-		shared.shareddata.navs[shared.shareddata.nnav-1].pathraw[0] = '\0';
-		shared.shareddata.navs[shared.shareddata.nnav-1].pathprocessed[0] = '\0';
-		shared.shareddata.navs[shared.shareddata.nnav-1].format = 0;
-		shared.shareddata.navs[shared.shareddata.nnav-1].swathbounds = MB_NO;
-		shared.shareddata.navs[shared.shareddata.nnav-1].line = MB_NO;
-		shared.shareddata.navs[shared.shareddata.nnav-1].shot = MB_NO;
-		shared.shareddata.navs[shared.shareddata.nnav-1].cdp = MB_NO;
-		shared.shareddata.navs[shared.shareddata.nnav-1].decimation = 1;
-		shared.shareddata.navs[shared.shareddata.nnav-1].npoints = 0;
-		shared.shareddata.navs[shared.shareddata.nnav-1].npoints_alloc = 0;
-		shared.shareddata.navs[shared.shareddata.nnav-1].navpts = NULL;
-		shared.shareddata.navs[shared.shareddata.nnav-1].segments = NULL;
-
-		/* set nnav */
-		shared.shareddata.nnav--;
-
-		/* no selection */
-		shared.shareddata.navpick_type = MBV_PICK_NONE;
-		shared.shareddata.nav_selected[0] = MBV_SELECT_NONE;
-		shared.shareddata.nav_selected[1] = MBV_SELECT_NONE;
-		}
-	else
-		{
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:          %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-
-
-/*------------------------------------------------------------------------------*/
-int mbview_navpicksize(size_t instance)
-{
-
-	/* local variables */
-	char	*function_name = "mbview_navpicksize";
-	int	status = MB_SUCCESS;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-	double	xlength;
-	double	headingx, headingy;
-	int	found;
-	int	i, j;
-
-	/* print starting debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       instance:         %zu\n",instance);
-		}
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* resize and redrape navpick marks if required */
-	if (shared.shareddata.navpick_type != MBV_PICK_NONE)
-		{
-		/* set size of 'V' marks in gl units for 3D case */
-		xlength = 0.05;
-		headingx = sin(shared.shareddata.navs[shared.shareddata.nav_selected[0]].navpts[shared.shareddata.nav_point_selected[0]].heading * DTR);
-		headingy = cos(shared.shareddata.navs[shared.shareddata.nav_selected[0]].navpts[shared.shareddata.nav_point_selected[0]].heading * DTR);
-
-		/* set navpick location V marker */
-		shared.shareddata.navpick.xpoints[0].xdisplay[instance] = shared.shareddata.navpick.endpoints[0].xdisplay[instance]
-							+ xlength * (headingy - headingx);
-		shared.shareddata.navpick.xpoints[0].ydisplay[instance] = shared.shareddata.navpick.endpoints[0].ydisplay[instance]
-							- xlength * (headingx + headingy);
-		shared.shareddata.navpick.xpoints[1].xdisplay[instance] = shared.shareddata.navpick.endpoints[0].xdisplay[instance];
-		shared.shareddata.navpick.xpoints[1].ydisplay[instance] = shared.shareddata.navpick.endpoints[0].ydisplay[instance];
-		shared.shareddata.navpick.xpoints[2].xdisplay[instance] = shared.shareddata.navpick.endpoints[0].xdisplay[instance];
-		shared.shareddata.navpick.xpoints[2].ydisplay[instance] = shared.shareddata.navpick.endpoints[0].ydisplay[instance];
-		shared.shareddata.navpick.xpoints[3].xdisplay[instance] = shared.shareddata.navpick.endpoints[0].xdisplay[instance]
-							- xlength * (headingx + headingy);
-		shared.shareddata.navpick.xpoints[3].ydisplay[instance] = shared.shareddata.navpick.endpoints[0].ydisplay[instance]
-							+ xlength * (headingx - headingy);
-		for (i=0;i<4;i++)
-			{
-			mbview_projectinverse(instance, MB_YES,
-				shared.shareddata.navpick.xpoints[i].xdisplay[instance],
-				shared.shareddata.navpick.xpoints[i].ydisplay[instance],
-				shared.shareddata.navpick.xpoints[i].zdisplay[instance],
-				&shared.shareddata.navpick.xpoints[i].xlon,
-				&shared.shareddata.navpick.xpoints[i].ylat,
-				&shared.shareddata.navpick.xpoints[i].xgrid[instance],
-				&shared.shareddata.navpick.xpoints[i].ygrid[instance]);
-			mbview_getzdata(instance,
-				shared.shareddata.navpick.xpoints[i].xgrid[instance],
-				shared.shareddata.navpick.xpoints[i].ygrid[instance],
-				&found, &shared.shareddata.navpick.xpoints[i].zdata);
-			if (found == MB_NO)
-				shared.shareddata.navpick.xpoints[i].zdata
-					= shared.shareddata.navpick.endpoints[0].zdata;
-			mbview_projectll2display(instance,
-				shared.shareddata.navpick.xpoints[i].xlon,
-				shared.shareddata.navpick.xpoints[i].ylat,
-				shared.shareddata.navpick.xpoints[i].zdata ,
-				&shared.shareddata.navpick.xpoints[i].xdisplay[instance],
-				&shared.shareddata.navpick.xpoints[i].ydisplay[instance],
-				&shared.shareddata.navpick.xpoints[i].zdisplay[instance]);
-			mbview_updatepointw(instance, &(shared.shareddata.navpick.xpoints[i]));
-			}
-
-		/* drape the V marker line segments */
-		for (j=0;j<2;j++)
-			{
-			mbview_drapesegmentw(instance, &(shared.shareddata.navpick.xsegments[j]));
-			mbview_updatesegmentw(instance, &(shared.shareddata.navpick.xsegments[j]));
-			}
-		}
-	if (shared.shareddata.navpick_type == MBV_PICK_TWOPOINT)
-		{
-		headingx = sin(shared.shareddata.navs[shared.shareddata.nav_selected[1]].navpts[shared.shareddata.nav_point_selected[1]].heading * DTR);
-		headingy = cos(shared.shareddata.navs[shared.shareddata.nav_selected[1]].navpts[shared.shareddata.nav_point_selected[1]].heading * DTR);
-
-		/* set navpick location V marker */
-		shared.shareddata.navpick.xpoints[4].xdisplay[instance] = shared.shareddata.navpick.endpoints[1].xdisplay[instance]
-							+ xlength * (headingy - headingx);
-		shared.shareddata.navpick.xpoints[4].ydisplay[instance] = shared.shareddata.navpick.endpoints[1].ydisplay[instance]
-							- xlength * (headingx + headingy);
-		shared.shareddata.navpick.xpoints[5].xdisplay[instance] = shared.shareddata.navpick.endpoints[1].xdisplay[instance];
-		shared.shareddata.navpick.xpoints[5].ydisplay[instance] = shared.shareddata.navpick.endpoints[1].ydisplay[instance];
-		shared.shareddata.navpick.xpoints[6].xdisplay[instance] = shared.shareddata.navpick.endpoints[1].xdisplay[instance];
-		shared.shareddata.navpick.xpoints[6].ydisplay[instance] = shared.shareddata.navpick.endpoints[1].ydisplay[instance];
-		shared.shareddata.navpick.xpoints[7].xdisplay[instance] = shared.shareddata.navpick.endpoints[1].xdisplay[instance]
-							- xlength * (headingx + headingy);
-		shared.shareddata.navpick.xpoints[7].ydisplay[instance] = shared.shareddata.navpick.endpoints[1].ydisplay[instance]
-							+ xlength * (headingx - headingy);
-		for (i=4;i<8;i++)
-			{
-			mbview_projectinverse(instance, MB_YES,
-				shared.shareddata.navpick.xpoints[i].xdisplay[instance],
-				shared.shareddata.navpick.xpoints[i].ydisplay[instance],
-				shared.shareddata.navpick.xpoints[i].zdisplay[instance],
-				&shared.shareddata.navpick.xpoints[i].xlon,
-				&shared.shareddata.navpick.xpoints[i].ylat,
-				&shared.shareddata.navpick.xpoints[i].xgrid[instance],
-				&shared.shareddata.navpick.xpoints[i].ygrid[instance]);
-			mbview_getzdata(instance,
-				shared.shareddata.navpick.xpoints[i].xgrid[instance],
-				shared.shareddata.navpick.xpoints[i].ygrid[instance],
-				&found, &shared.shareddata.navpick.xpoints[i].zdata);
-			if (found == MB_NO)
-				shared.shareddata.navpick.xpoints[i].zdata
-					= shared.shareddata.navpick.endpoints[1].zdata;
-			shared.shareddata.navpick.xpoints[i].zdisplay[instance] = view->scale
-				* (data->exageration * shared.shareddata.navpick.xpoints[i].zdata - view->zorigin);
-			mbview_projectll2display(instance,
-				shared.shareddata.navpick.xpoints[i].xlon,
-				shared.shareddata.navpick.xpoints[i].ylat,
-				shared.shareddata.navpick.xpoints[i].zdata ,
-				&shared.shareddata.navpick.xpoints[i].xdisplay[instance],
-				&shared.shareddata.navpick.xpoints[i].ydisplay[instance],
-				&shared.shareddata.navpick.xpoints[i].zdisplay[instance]);
-			mbview_updatepointw(instance, &(shared.shareddata.navpick.xpoints[i]));
-			}
-
-		/* drape the V marker line segments */
-		for (j=2;j<4;j++)
-			{
-			mbview_drapesegmentw(instance, &(shared.shareddata.navpick.xsegments[j]));
-			mbview_updatesegmentw(instance, &(shared.shareddata.navpick.xsegments[j]));
-			}
-		}
-
-	/* print output debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:          %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-/*------------------------------------------------------------------------------*/
-int mbview_drawnavpick(size_t instance)
-{
-	/* local variables */
-	char	*function_name = "mbview_drawnavpick";
-	int	status = MB_SUCCESS;
-	int	i;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-	double	xlength;
-	float	zdisplay;
-	int	inav, jpt;
-
-	/* print starting debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       instance:         %zu\n",instance);
-		}
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* draw current navpick */
-	if (shared.shareddata.navpick_type != MBV_PICK_NONE
-		&& (data->nav_view_mode == MBV_VIEW_ON
-			|| data->navdrape_view_mode == MBV_VIEW_ON))
-		{
-		/* set size of X mark for 2D case */
-		if (data->display_mode == MBV_DISPLAY_2D)
-			xlength = 0.05 / view->size2d;
-
-		/* set color and linewidth */
-		glColor3f(1.0, 0.0, 0.0);
-		glLineWidth(3.0);
-
-		/* plot first navpick point draped */
-		if (data->display_mode == MBV_DISPLAY_3D
-			&& shared.shareddata.navpick.xsegments[0].nls > 0
-			&& shared.shareddata.navpick.xsegments[1].nls > 0)
-			{
-			glBegin(GL_LINE_STRIP);
-			for (i=0;i<shared.shareddata.navpick.xsegments[0].nls;i++)
-				{
-				glVertex3f((float)(shared.shareddata.navpick.xsegments[0].lspoints[i].xdisplay[instance]),
-						(float)(shared.shareddata.navpick.xsegments[0].lspoints[i].ydisplay[instance]),
-						(float)(shared.shareddata.navpick.xsegments[0].lspoints[i].zdisplay[instance]));
-				}
-			glEnd();
-			glBegin(GL_LINE_STRIP);
-			for (i=0;i<shared.shareddata.navpick.xsegments[1].nls;i++)
-				{
-				glVertex3f((float)(shared.shareddata.navpick.xsegments[1].lspoints[i].xdisplay[instance]),
-						(float)(shared.shareddata.navpick.xsegments[1].lspoints[i].ydisplay[instance]),
-						(float)(shared.shareddata.navpick.xsegments[1].lspoints[i].zdisplay[instance]));
-				}
-			glEnd();
-			}
-		else if (data->display_mode == MBV_DISPLAY_3D)
-			{
-			glBegin(GL_LINES);
-			for (i=0;i<4;i++)
-				{
-				glVertex3f((float)(shared.shareddata.navpick.xpoints[i].xdisplay[instance]),
-					(float)(shared.shareddata.navpick.xpoints[i].ydisplay[instance]),
-					(float)(shared.shareddata.navpick.xpoints[i].zdisplay[instance]));
-				}
-			glEnd();
-			}
-		else
-			{
-			glBegin(GL_LINES);
-			glVertex3f((float)(shared.shareddata.navpick.xpoints[0].xdisplay[instance]),
-				(float)(shared.shareddata.navpick.xpoints[0].ydisplay[instance]),
-				(float)(shared.shareddata.navpick.xpoints[0].zdisplay[instance]));
-			glVertex3f((float)(shared.shareddata.navpick.xpoints[1].xdisplay[instance]),
-				(float)(shared.shareddata.navpick.xpoints[1].ydisplay[instance]),
-				(float)(shared.shareddata.navpick.xpoints[1].zdisplay[instance]));
-			glVertex3f((float)(shared.shareddata.navpick.xpoints[2].xdisplay[instance]),
-				(float)(shared.shareddata.navpick.xpoints[2].ydisplay[instance]),
-				(float)(shared.shareddata.navpick.xpoints[2].zdisplay[instance]));
-			glVertex3f((float)(shared.shareddata.navpick.xpoints[3].xdisplay[instance]),
-				(float)(shared.shareddata.navpick.xpoints[3].ydisplay[instance]),
-				(float)(shared.shareddata.navpick.xpoints[3].zdisplay[instance]));
-			glEnd();
-			}
-
-		/* draw first navpick point undraped */
-		if (data->display_mode == MBV_DISPLAY_3D
-			&& data->nav_view_mode == MBV_VIEW_ON)
-			{
-			inav = shared.shareddata.nav_selected[0];
-			jpt = shared.shareddata.nav_point_selected[0];
-			zdisplay = shared.shareddata.navs[inav].navpts[jpt].point.zdisplay[instance];
-			glColor3f(1.0, 0.0, 0.0);
-			glBegin(GL_LINES);
-			for (i=0;i<4;i++)
-				{
-				glVertex3f((float)(shared.shareddata.navpick.xpoints[i].xdisplay[instance]),
-					(float)(shared.shareddata.navpick.xpoints[i].ydisplay[instance]),
-					zdisplay);
-				}
-			glEnd();
-			}
-
-		if (shared.shareddata.navpick_type == MBV_PICK_TWOPOINT)
-			{
-			/* plot second navpick point draped */
-			if (data->display_mode == MBV_DISPLAY_3D
-				&& shared.shareddata.navpick.xsegments[2].nls > 0
-				&& shared.shareddata.navpick.xsegments[3].nls > 0)
-				{
-				glBegin(GL_LINE_STRIP);
-				for (i=0;i<shared.shareddata.navpick.xsegments[2].nls;i++)
-					{
-					glVertex3f((float)(shared.shareddata.navpick.xsegments[2].lspoints[i].xdisplay[instance]),
-							(float)(shared.shareddata.navpick.xsegments[2].lspoints[i].ydisplay[instance]),
-							(float)(shared.shareddata.navpick.xsegments[2].lspoints[i].zdisplay[instance]));
-					}
-				glEnd();
-				glBegin(GL_LINE_STRIP);
-				for (i=0;i<shared.shareddata.navpick.xsegments[3].nls;i++)
-					{
-					glVertex3f((float)(shared.shareddata.navpick.xsegments[3].lspoints[i].xdisplay[instance]),
-							(float)(shared.shareddata.navpick.xsegments[3].lspoints[i].ydisplay[instance]),
-							(float)(shared.shareddata.navpick.xsegments[3].lspoints[i].zdisplay[instance]));
-					}
-				glEnd();
-				}
-			else if (data->display_mode == MBV_DISPLAY_3D)
-				{
-				glBegin(GL_LINES);
-				for (i=4;i<8;i++)
-					{
-					glVertex3f((float)(shared.shareddata.navpick.xpoints[i].xdisplay[instance]),
-						(float)(shared.shareddata.navpick.xpoints[i].ydisplay[instance]),
-						(float)(shared.shareddata.navpick.xpoints[i].zdisplay[instance]));
-					}
-				glEnd();
-				}
-			else
-				{
-				glBegin(GL_LINES);
-				glVertex3f((float)(shared.shareddata.navpick.xpoints[4].xdisplay[instance]),
-					(float)(shared.shareddata.navpick.xpoints[4].ydisplay[instance]),
-					(float)(shared.shareddata.navpick.xpoints[4].zdisplay[instance]));
-				glVertex3f((float)(shared.shareddata.navpick.xpoints[5].xdisplay[instance]),
-					(float)(shared.shareddata.navpick.xpoints[5].ydisplay[instance]),
-					(float)(shared.shareddata.navpick.xpoints[5].zdisplay[instance]));
-				glVertex3f((float)(shared.shareddata.navpick.xpoints[6].xdisplay[instance]),
-					(float)(shared.shareddata.navpick.xpoints[6].ydisplay[instance]),
-					(float)(shared.shareddata.navpick.xpoints[6].zdisplay[instance]));
-				glVertex3f((float)(shared.shareddata.navpick.xpoints[7].xdisplay[instance]),
-					(float)(shared.shareddata.navpick.xpoints[7].ydisplay[instance]),
-					(float)(shared.shareddata.navpick.xpoints[7].zdisplay[instance]));
-				glEnd();
-				}
-
-			/* draw second navpick point undraped */
-			if (data->display_mode == MBV_DISPLAY_3D
-				&& data->nav_view_mode == MBV_VIEW_ON)
-				{
-				inav = shared.shareddata.nav_selected[1];
-				jpt = shared.shareddata.nav_point_selected[1];
-				zdisplay = shared.shareddata.navs[inav].navpts[jpt].point.zdisplay[instance];
-				glBegin(GL_LINES);
-				for (i=4;i<8;i++)
-					{
-					glVertex3f((float)(shared.shareddata.navpick.xpoints[i].xdisplay[instance]),
-						(float)(shared.shareddata.navpick.xpoints[i].ydisplay[instance]),
-						zdisplay);
-					}
-				glEnd();
-				}
-			}
-		}
-#ifdef MBV_GETERRORS
-mbview_glerrorcheck(instance, 1, function_name);
-#endif
-
-	/* print output debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-
-
-/*------------------------------------------------------------------------------*/
-int mbview_drawnav(size_t instance, int rez)
-{
-	/* local variables */
-	char	*function_name = "mbview_drawnav";
-	int	status = MB_SUCCESS;
-	int	error = MB_ERROR_NO_ERROR;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-	int	stride;
-	int	icolor;
-	int	inav, jpoint;
-	int	swathbounds_on;
-	double	timegapuse;
-	struct mbview_linesegmentw_struct segment;
-	int	i, k;
-
-	/* print starting debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       instance:         %zu\n",instance);
-		fprintf(stderr,"dbg2       rez:              %d\n",rez);
-		}
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* set decimation */
-	if (rez == MBV_REZ_FULL)
-	    stride = 1;
-	else if (rez == MBV_REZ_HIGH)
-	    stride = data->hirez_navdecimate;
-	else
-	    stride = data->lorez_navdecimate;
-
-	/* draw navigation */
-	if (shared.shareddata.nav_mode != MBV_NAV_OFF
-		&& data->nav_view_mode == MBV_VIEW_ON
-		&& shared.shareddata.nnav > 0)
-		{
-		/* loop over the navs plotting xyz navigation */
-		for (inav=0;inav<shared.shareddata.nnav;inav++)
-			{
-			icolor = shared.shareddata.navs[inav].color;
-			glLineWidth((float)(shared.shareddata.navs[inav].size));
-			glBegin(GL_LINE_STRIP);
-			for (jpoint=0;jpoint<shared.shareddata.navs[inav].npoints;jpoint+=stride)
-				{
-				/* set size and color */
-				if (shared.shareddata.navs[inav].navpts[jpoint].selected == MB_YES
-					|| (jpoint < shared.shareddata.navs[inav].npoints - 1
-						&& shared.shareddata.navs[inav].navpts[jpoint+1].selected == MB_YES))
-					{
-					glColor3f(colortable_object_red[MBV_COLOR_RED],
-						colortable_object_green[MBV_COLOR_RED],
-						colortable_object_blue[MBV_COLOR_RED]);
-					}
-				else
-					{
-					glColor3f(colortable_object_red[icolor],
-						colortable_object_green[icolor],
-						colortable_object_blue[icolor]);
-					}
-
-				/* draw points */
-				glVertex3f((float)(shared.shareddata.navs[inav].navpts[jpoint].point.xdisplay[instance]),
-						(float)(shared.shareddata.navs[inav].navpts[jpoint].point.ydisplay[instance]),
-						(float)(shared.shareddata.navs[inav].navpts[jpoint].point.zdisplay[instance]));
-				}
-			glEnd();
-			}
-		}
-
-	/* draw draped navigation */
-	if (shared.shareddata.nav_mode != MBV_NAV_OFF
-		&& data->navdrape_view_mode == MBV_VIEW_ON
-		&& shared.shareddata.nnav > 0)
-		{
-		/* loop over the navs plotting draped navigation */
-		for (inav=0;inav<shared.shareddata.nnav;inav++)
-			{
-			icolor = shared.shareddata.navs[inav].color;
-			glLineWidth((float)(shared.shareddata.navs[inav].size));
-			glBegin(GL_LINE_STRIP);
-			for (jpoint=0;jpoint<shared.shareddata.navs[inav].npoints-stride;jpoint+=stride)
-				{
-				/* set size and color */
-				if (shared.shareddata.navs[inav].navpts[jpoint].selected == MB_YES
-					|| shared.shareddata.navs[inav].navpts[jpoint+stride].selected == MB_YES)
-					{
-					glColor3f(colortable_object_red[MBV_COLOR_RED],
-						colortable_object_green[MBV_COLOR_RED],
-						colortable_object_blue[MBV_COLOR_RED]);
-					}
-				else
-					{
-					glColor3f(colortable_object_red[icolor],
-						colortable_object_green[icolor],
-						colortable_object_blue[icolor]);
-					}
-
-/*fprintf(stderr,"inav:%d npoints:%d jpoint:%d nls:%d\n",
-inav, shared.shareddata.navs[inav].npoints, jpoint, shared.shareddata.navs[inav].segments[jpoint].nls);*/
-				/* draw draped segment if stride == 1 */
-				if (stride == 1)
-				for (k=0;k<shared.shareddata.navs[inav].segments[jpoint].nls;k++)
-					{
-					/* draw points */
-					glVertex3f((float)(shared.shareddata.navs[inav].segments[jpoint].lspoints[k].xdisplay[instance]),
-							(float)(shared.shareddata.navs[inav].segments[jpoint].lspoints[k].ydisplay[instance]),
-							(float)(shared.shareddata.navs[inav].segments[jpoint].lspoints[k].zdisplay[instance]));
-/*fprintf(stderr,"inav:%d jpoint:%d k:%d zdata:%f zdisplay:%f\n",
-inav,jpoint,k,
-shared.shareddata.navs[inav].segments[jpoint].lspoints[k].zdata,
-shared.shareddata.navs[inav].segments[jpoint].lspoints[k].zdisplay[instance]);*/
-
-					}
-
-				/* else draw decimated draped nav */
-				else if (shared.shareddata.navs[inav].segments[jpoint].nls > 0)
-					{
-					/* draw points */
-					glVertex3f((float)(shared.shareddata.navs[inav].segments[jpoint].lspoints[0].xdisplay[instance]),
-							(float)(shared.shareddata.navs[inav].segments[jpoint].lspoints[0].ydisplay[instance]),
-							(float)(shared.shareddata.navs[inav].segments[jpoint].lspoints[0].zdisplay[instance]));
-					}
-				}
-			glEnd();
-			}
-		}
-
-	/* draw swathbounds */
-	if (shared.shareddata.nav_mode != MBV_NAV_OFF
-		&& (data->nav_view_mode == MBV_VIEW_ON
-			|| data->navdrape_view_mode == MBV_VIEW_ON)
-		&& shared.shareddata.nnav > 0)
-		{
-		/* initialize on the fly draping segment */
-		segment.nls = 0;
-		segment.nls_alloc = 0;
-		segment.lspoints = NULL;
-
-		/* loop over the navs plotting swathbounds */
-		for (inav=0;inav<shared.shareddata.nnav;inav++)
-			{
-			timegapuse = 60.0 * shared.shareddata.navs[inav].decimation * view->timegap;
-			if (shared.shareddata.navs[inav].swathbounds == MB_YES
-				&& shared.shareddata.navs[inav].nselected > 0)
-				{
-				glColor3f(colortable_object_red[MBV_COLOR_YELLOW],
-					colortable_object_green[MBV_COLOR_YELLOW],
-					colortable_object_blue[MBV_COLOR_YELLOW]);
-				glLineWidth((float)(shared.shareddata.navs[inav].size));
-
-				/* draw port side of swath */
-				swathbounds_on = MB_NO;
-				for (jpoint=0;jpoint<shared.shareddata.navs[inav].npoints;jpoint++)
-					{
-					/* draw from center at start of selected data */
-					if (swathbounds_on == MB_NO
-						&& shared.shareddata.navs[inav].navpts[jpoint].selected == MB_YES)
-						{
-						swathbounds_on = MB_YES;
-						glBegin(GL_LINE_STRIP);
-
-						if (data->display_mode == MBV_DISPLAY_3D && stride == 1)
-							{
-							/* drape segment on the fly */
-							segment.endpoints[0] = shared.shareddata.navs[inav].navpts[jpoint].pointcntr;
-							segment.endpoints[1] = shared.shareddata.navs[inav].navpts[jpoint].pointport;
-							mbview_drapesegmentw(instance, &(segment));
-
-							/* draw the segment */
-							for (i=0;i<segment.nls;i++)
-								{
-								glVertex3f((float)(segment.lspoints[i].xdisplay[instance]),
-										(float)(segment.lspoints[i].ydisplay[instance]),
-										(float)(segment.lspoints[i].zdisplay[instance]));
-								}
-							}
-						else
-							{
-							glVertex3f((float)(shared.shareddata.navs[inav].navpts[jpoint].pointcntr.xdisplay[instance]),
-									(float)(shared.shareddata.navs[inav].navpts[jpoint].pointcntr.ydisplay[instance]),
-									(float)(shared.shareddata.navs[inav].navpts[jpoint].pointcntr.zdisplay[instance]));
-							}
-						}
-
-					/* draw during selected data */
-					if (shared.shareddata.navs[inav].navpts[jpoint].selected == MB_YES)
-						{
-						glVertex3f((float)(shared.shareddata.navs[inav].navpts[jpoint].pointport.xdisplay[instance]),
-							(float)(shared.shareddata.navs[inav].navpts[jpoint].pointport.ydisplay[instance]),
-							(float)(shared.shareddata.navs[inav].navpts[jpoint].pointport.zdisplay[instance]));
-						}
-
-					/* draw to center at end of selected data */
-					if (swathbounds_on == MB_YES
-						&& (shared.shareddata.navs[inav].navpts[jpoint].selected == MB_NO
-							|| jpoint >= shared.shareddata.navs[inav].npoints - 1
-							|| (jpoint > 0
-								&& (shared.shareddata.navs[inav].navpts[jpoint].time_d
-									- shared.shareddata.navs[inav].navpts[jpoint-1].time_d)
-									> timegapuse)))
-						{
-						if (data->display_mode == MBV_DISPLAY_3D && stride == 1)
-							{
-							/* drape segment on the fly */
-							segment.endpoints[0] = shared.shareddata.navs[inav].navpts[jpoint].pointport;
-							segment.endpoints[1] = shared.shareddata.navs[inav].navpts[jpoint].pointcntr;
-							mbview_drapesegmentw(instance, &(segment));
-
-							/* draw the segment */
-							for (i=0;i<segment.nls;i++)
-								{
-								glVertex3f((float)(segment.lspoints[i].xdisplay[instance]),
-										(float)(segment.lspoints[i].ydisplay[instance]),
-										(float)(segment.lspoints[i].zdisplay[instance]));
-								}
-							}
-						else
-							{
-							glVertex3f((float)(shared.shareddata.navs[inav].navpts[jpoint].pointcntr.xdisplay[instance]),
-									(float)(shared.shareddata.navs[inav].navpts[jpoint].pointcntr.ydisplay[instance]),
-									(float)(shared.shareddata.navs[inav].navpts[jpoint].pointcntr.zdisplay[instance]));
-							}
-
-						swathbounds_on = MB_NO;
-						glEnd();
-						}
-					}
-
-				/* draw starboard side of swath */
-				swathbounds_on = MB_NO;
-				for (jpoint=0;jpoint<shared.shareddata.navs[inav].npoints;jpoint++)
-					{
-					/* draw from center at start of selected data */
-					if (swathbounds_on == MB_NO
-						&& shared.shareddata.navs[inav].navpts[jpoint].selected == MB_YES)
-						{
-						swathbounds_on = MB_YES;
-						glBegin(GL_LINE_STRIP);
-
-						if (data->display_mode == MBV_DISPLAY_3D && stride == 1)
-							{
-							/* drape segment on the fly */
-							segment.endpoints[0] = shared.shareddata.navs[inav].navpts[jpoint].pointcntr;
-							segment.endpoints[1] = shared.shareddata.navs[inav].navpts[jpoint].pointstbd;
-							mbview_drapesegmentw(instance, &(segment));
-
-							/* draw the segment */
-							for (i=0;i<segment.nls;i++)
-								{
-								glVertex3f((float)(segment.lspoints[i].xdisplay[instance]),
-										(float)(segment.lspoints[i].ydisplay[instance]),
-										(float)(segment.lspoints[i].zdisplay[instance]));
-								}
-							}
-						else
-							{
-							glVertex3f((float)(shared.shareddata.navs[inav].navpts[jpoint].pointcntr.xdisplay[instance]),
-									(float)(shared.shareddata.navs[inav].navpts[jpoint].pointcntr.ydisplay[instance]),
-									(float)(shared.shareddata.navs[inav].navpts[jpoint].pointcntr.zdisplay[instance]));
-							}
-						}
-
-					/* draw during selected data */
-					if (shared.shareddata.navs[inav].navpts[jpoint].selected == MB_YES)
-						{
-						glVertex3f((float)(shared.shareddata.navs[inav].navpts[jpoint].pointstbd.xdisplay[instance]),
-							(float)(shared.shareddata.navs[inav].navpts[jpoint].pointstbd.ydisplay[instance]),
-							(float)(shared.shareddata.navs[inav].navpts[jpoint].pointstbd.zdisplay[instance]));
-						}
-
-					/* draw to center at end of selected data */
-					if (swathbounds_on == MB_YES
-						&& (shared.shareddata.navs[inav].navpts[jpoint].selected == MB_NO
-							|| jpoint >= shared.shareddata.navs[inav].npoints - 1
-							|| (jpoint > 0
-								&& (shared.shareddata.navs[inav].navpts[jpoint].time_d
-									- shared.shareddata.navs[inav].navpts[jpoint-1].time_d)
-									> timegapuse)))
-						{
-						if (data->display_mode == MBV_DISPLAY_3D && stride == 1)
-							{
-							/* drape segment on the fly */
-							segment.endpoints[0] = shared.shareddata.navs[inav].navpts[jpoint].pointstbd;
-							segment.endpoints[1] = shared.shareddata.navs[inav].navpts[jpoint].pointcntr;
-							mbview_drapesegmentw(instance, &(segment));
-
-							/* draw the segment */
-							for (i=0;i<segment.nls;i++)
-								{
-								glVertex3f((float)(segment.lspoints[i].xdisplay[instance]),
-										(float)(segment.lspoints[i].ydisplay[instance]),
-										(float)(segment.lspoints[i].zdisplay[instance]));
-								}
-							}
-						else
-							{
-							glVertex3f((float)(shared.shareddata.navs[inav].navpts[jpoint].pointcntr.xdisplay[instance]),
-									(float)(shared.shareddata.navs[inav].navpts[jpoint].pointcntr.ydisplay[instance]),
-									(float)(shared.shareddata.navs[inav].navpts[jpoint].pointcntr.zdisplay[instance]));
-							}
-
-						swathbounds_on = MB_NO;
-						glEnd();
-						}
-					}
-				}
-			}
-
-		/* deallocate on the fly draping segment */
-		if (segment.nls_alloc > 0
-			&& segment.lspoints != NULL)
-			{
-			status = mb_freed(mbv_verbose, __FILE__, __LINE__, (void **)&segment.lspoints, &error);
-			segment.nls_alloc = 0;
-			}
-
-		}
-#ifdef MBV_GETERRORS
-mbview_glerrorcheck(instance, 1, function_name);
-#endif
-
-	/* print output debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-/*------------------------------------------------------------------------------*/
-int mbview_updatenavlist()
-{
-	/* local variables */
-	char	*function_name = "mbview_updatenavlist";
-	int	status = MB_SUCCESS;
-   	XmString *xstr;
-	int	inav;
-	int	nitems;
-	int	iitem;
-	int	inavselect;
-
-	/* print starting debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		}
-
-	/* update nav list */
-	if (shared.init_navlist == MBV_WINDOW_VISIBLE)
-		{
-		/* remove all existing items */
-		XmListDeleteAllItems(shared.mb3d_navlist.mbview_list_navlist);
-
-		if (shared.shareddata.nnav > 0)
-			{
-			/* get number of items */
-			nitems = 0;
-			for (inav=0;inav<shared.shareddata.nnav;inav++)
-				{
-				nitems += 1 + shared.shareddata.navs[inav].npoints;
-				}
-
-			/* allocate array of label XmStrings */
-			xstr = (XmString *) malloc(nitems * sizeof(XmString));
-
-			/* loop over the navs */
-			nitems = 0;
-			for (inav=0;inav<shared.shareddata.nnav;inav++)
-				{
-				/* add list item for each nav */
-				sprintf(value_string,"%3d | %3d | %s | %d | %s",
-					inav, shared.shareddata.navs[inav].npoints,
-					mbview_colorname[shared.shareddata.navs[inav].color],
-					shared.shareddata.navs[inav].size,
-					shared.shareddata.navs[inav].name);
-    				xstr[nitems] = XmStringCreateLocalized(value_string);
-				nitems++;
-				}
-
-			/* add list items */
-    			XmListAddItems(shared.mb3d_navlist.mbview_list_navlist,
-					xstr, nitems, 0);
-
-			/* deallocate memory no longer needed */
-			for (iitem=0;iitem<nitems;iitem++)
-				{
-    				XmStringFree(xstr[iitem]);
-    				}
-    			free(xstr);
-
-			/* check for completely selected navs */
-			inavselect = MBV_SELECT_NONE;
-			for (inav=0;inav<shared.shareddata.nnav;inav++)
-				{
-				if (inavselect == MBV_SELECT_NONE
-					&& shared.shareddata.navs[inav].npoints > 1
-					&& shared.shareddata.navs[inav].nselected
-						== shared.shareddata.navs[inav].npoints)
-					{
-					inavselect = inav;
-					}
-				}
-
-			/* select first item with fully selected nav */
-			if (inavselect != MBV_SELECT_NONE)
-				{
-				iitem = inavselect + 1;
-				XmListSelectPos(shared.mb3d_navlist.mbview_list_navlist,
-						iitem,0);
-				XmListSetPos(shared.mb3d_navlist.mbview_list_navlist,
-					MAX(iitem-5, 1));
-				}
-			}
-		}
-
-	/* print output debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-
-
-/*------------------------------------------------------------------------------*/
diff --git a/src/mbview/mbview_pick.c b/src/mbview/mbview_pick.c
deleted file mode 100644
index 348daf2..0000000
--- a/src/mbview/mbview_pick.c
+++ /dev/null
@@ -1,2556 +0,0 @@
-/*------------------------------------------------------------------------------
- *    The MB-system:	mbview_pick.c	9/29/2003
- *    $Id: mbview_pick.c 2239 2015-05-07 00:51:42Z caress $
- *
- *    Copyright (c) 2003-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *------------------------------------------------------------------------------*/
-/*
- *
- * Author:	D. W. Caress
- * Date:	September 29, 2003
- *
- * Note:	This code was broken out of mbview_callbacks.c, which was
- *		begun on October 7, 2002
- *
- * $Log: mbview_pick.c,v $
- * Revision 5.17  2008/09/11 20:17:33  caress
- * Checking in updates made during cruise AT15-36.
- *
- * Revision 5.16  2008/05/16 22:59:42  caress
- * Release 5.1.1beta18.
- *
- * Revision 5.15  2008/03/14 19:04:32  caress
- * Fixed memory problems with route editing.
- *
- * Revision 5.14  2007/06/17 23:27:30  caress
- * Added NBeditviz.
- *
- * Revision 5.13  2006/09/11 18:55:53  caress
- * Changes during Western Flyer and Thomas Thompson cruises, August-September
- * 2006.
- *
- * Revision 5.12  2006/06/16 19:30:58  caress
- * Check in after the Santa Monica Basin Mapping AUV Expedition.
- *
- * Revision 5.11  2006/04/26 22:06:39  caress
- * Improved profile view feature and enabled export of profile data.
- *
- * Revision 5.10  2006/04/11 19:17:04  caress
- * Added a profile capability.
- *
- * Revision 5.9  2006/01/24 19:21:32  caress
- * Version 5.0.8 beta.
- *
- * Revision 5.8  2005/11/05 01:11:47  caress
- * Much work over the past two months.
- *
- * Revision 5.7  2005/02/18 07:32:55  caress
- * Fixed nav display and button sensitivity.
- *
- * Revision 5.6  2005/02/08 22:37:42  caress
- * Heading towards 5.0.6 release.
- *
- * Revision 5.4  2004/07/27 19:50:28  caress
- * Improving route planning capability.
- *
- * Revision 5.3  2004/06/18 04:26:06  caress
- * June 17, 2004 update.
- *
- * Revision 5.2  2004/02/24 22:52:27  caress
- * Added spherical projection to MBview.
- *
- * Revision 5.1  2004/01/06 21:11:03  caress
- * Added pick region capability.
- *
- * Revision 5.0  2003/12/02 20:38:31  caress
- * Making version number 5.0
- *
- * Revision 1.2  2003/11/25 01:43:18  caress
- * MBview version generated during EW0310.
- *
- *
- */
-/*------------------------------------------------------------------------------*/
-
-/* Standard includes for builtins. */
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include <math.h>
-
-/* Motif required Headers */
-#include <X11/StringDefs.h>
-#include <X11/cursorfont.h>
-#include <Xm/Xm.h>
-#include <Xm/MainW.h>
-#include <Xm/DialogS.h>
-#include <Xm/RepType.h>
-#include <Xm/MwmUtil.h>
-#include <Xm/BulletinB.h>
-#include <Xm/RowColumn.h>
-#include <Xm/CascadeB.h>
-#include <Xm/PushB.h>
-#include <Xm/Separator.h>
-#include "MB3DView.h"
-#include "MB3DSiteList.h"
-#include "MB3DRouteList.h"
-#include "MB3DNavList.h"
-
-/* OpenGL include files */
-#ifdef WIN32
-#undef BOOL		/* It was defined by a chain of inclusions in the (patched) X11/Xmd.h */
-#include <windows.h>
-#endif
-
-#include <GL/gl.h>
-#include <GL/glu.h>
-#ifndef WIN32
-#	include <GL/glx.h>
-#endif
-#include "mb_glwdrawa.h"
-
-/* MBIO include files */
-#include "mb_status.h"
-#include "mb_define.h"
-
-/* mbview include */
-#include "mbview.h"
-#include "mbviewprivate.h"
-
-/*------------------------------------------------------------------------------*/
-
-/* local variables */
-static char		value_text[MB_PATH_MAXLINE];
-static char		value_list[MB_PATH_MAXLINE];
-
-static char rcs_id[]="$Id: mbview_pick.c 2239 2015-05-07 00:51:42Z caress $";
-
-
-/*------------------------------------------------------------------------------*/
-int mbview_pick(size_t instance, int which, int xpixel, int ypixel)
-{
-
-	/* local variables */
-	char	*function_name = "mbview_pick";
-	int	status = MB_SUCCESS;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-	int	found;
-	double	xgrid, ygrid;
-	double	xlon, ylat, zdata;
-	double	xdisplay, ydisplay, zdisplay;
-	double	dx, dy;
-
-	/* print starting debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       instance:         %zu\n",instance);
-		fprintf(stderr,"dbg2       which:            %d\n",which);
-		fprintf(stderr,"dbg2       xpixel:           %d\n",xpixel);
-		fprintf(stderr,"dbg2       ypixel:           %d\n",ypixel);
-		}
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* look for point */
-	mbview_findpoint(instance, xpixel, ypixel,
-			&found,
-			&xgrid, &ygrid,
-			&xlon, &ylat, &zdata,
-			&xdisplay, &ydisplay, &zdisplay);
-
-	/* use any good pick */
-	if (found == MB_YES)
-		{
-		if ((which == MBV_PICK_DOWN)
-			|| (which == MBV_PICK_MOVE
-				&& data->pick_type == MBV_PICK_NONE))
-			{
-			/* set pick location */
-			data->pickinfo_mode = MBV_PICK_ONEPOINT;
-			data->pick_type = MBV_PICK_ONEPOINT;
-			data->pick.endpoints[0].xgrid = xgrid;
-			data->pick.endpoints[0].ygrid = ygrid;
-			data->pick.endpoints[0].xlon = xlon;
-			data->pick.endpoints[0].ylat = ylat;
-			data->pick.endpoints[0].zdata = zdata;
-			data->pick.endpoints[0].xdisplay = xdisplay;
-			data->pick.endpoints[0].ydisplay = ydisplay;
-			data->pick.endpoints[0].zdisplay = zdisplay;
-			}
-		else if (which == MBV_PICK_MOVE)
-			{
-			/* set pick location */
-			data->pickinfo_mode = MBV_PICK_TWOPOINT;
-			data->pick_type = MBV_PICK_TWOPOINT;
-			data->pick.endpoints[1].xgrid = xgrid;
-			data->pick.endpoints[1].ygrid = ygrid;
-			data->pick.endpoints[1].xlon = xlon;
-			data->pick.endpoints[1].ylat = ylat;
-			data->pick.endpoints[1].zdata = zdata;
-			data->pick.endpoints[1].xdisplay = xdisplay;
-			data->pick.endpoints[1].ydisplay = ydisplay;
-			data->pick.endpoints[1].zdisplay = zdisplay;
-			}
-
-		/* calculate range and bearing */
-		if (data->display_projection_mode != MBV_PROJECTION_SPHEROID)
-			{
-			dx = data->pick.endpoints[1].xdisplay
-					- data->pick.endpoints[0].xdisplay;
-			dy = data->pick.endpoints[1].ydisplay
-					- data->pick.endpoints[0].ydisplay;
-			data->pick.range = sqrt(dx * dx + dy * dy) / view->scale ;
-			data->pick.bearing = RTD * atan2(dx, dy);
-			}
-		else
-			{
-			mbview_greatcircle_distbearing(instance,
-				data->pick.endpoints[0].xlon,
-				data->pick.endpoints[0].ylat,
-				data->pick.endpoints[1].xlon,
-				data->pick.endpoints[1].ylat,
-				&(data->pick.bearing), &(data->pick.range));
-			}
-		if (data->pick.bearing < 0.0)
-			data->pick.bearing += 360.0;
-
-		/* generate 3D drape of pick marks if either 3D display
-			or the pick move is final */
-		if (data->pick_type != MBV_PICK_NONE
-			&& (data->display_mode == MBV_DISPLAY_3D
-				|| which == MBV_PICK_UP))
-			{
-			mbview_picksize(instance);
-			}
-
-		/* if a two point pick has been made generate 3D drape
-			if either 3D display, the pick move is final
-			or the profile display is on */
-		if (data->pick_type == MBV_PICK_TWOPOINT
-			&& (data->display_mode == MBV_DISPLAY_3D
-				|| data->profile_view_mode == MBV_VIEW_ON
-				|| which == MBV_PICK_UP))
-			{
-			data->pick.segment.endpoints[0] = data->pick.endpoints[0];
-			data->pick.segment.endpoints[1] = data->pick.endpoints[1];
-			mbview_drapesegment(instance, &(data->pick.segment));
-			}
-		}
-	else
-		{
-		if (which == MBV_PICK_DOWN)
-			{
-			data->pickinfo_mode = MBV_PICK_NONE;
-			data->pick_type = MBV_PICK_NONE;
-			XBell(view->dpy,100);
-			}
-		else if (which == MBV_PICK_MOVE)
-			{
-			XBell(view->dpy,100);
-			}
-		}
-
-	/* set pick annotation */
-	mbview_pick_text(instance);
-
-	/* call pick notify if defined */
-	if (which == MBV_PICK_UP && data->pick_type == MBV_PICK_ONEPOINT
-		&& data->mbview_pickonepoint_notify != NULL)
-		{
-		(data->mbview_pickonepoint_notify)(instance);
-		}
-	else if (which == MBV_PICK_UP && data->pick_type == MBV_PICK_TWOPOINT
-		&& data->mbview_picktwopoint_notify != NULL)
-		{
-		(data->mbview_picktwopoint_notify)(instance);
-		}
-
-	/* print output debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:          %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-
-/*------------------------------------------------------------------------------*/
-int mbview_extract_pick_profile(size_t instance)
-{
-
-	/* local variables */
-	char	*function_name = "mbview_extract_pick_profile";
-	int	status = MB_SUCCESS;
-	int	error = MB_ERROR_NO_ERROR;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-	double	dx, dy;
-	int	npoints;
-	int	i;
-
-	/* print starting debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       instance:         %zu\n",instance);
-		}
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* if a two point pick has been made and the profile display
-		is on or the pick is final, insert the draped
-		segment into the profile data */
-	if (data->pick_type == MBV_PICK_TWOPOINT)
-		{
-		data->profile.source = MBV_PROFILE_TWOPOINT;
-		strcpy(data->profile.source_name, "Two point pick");
-		data->profile.length = data->pick.range;
-		npoints = MAX(2, data->pick.segment.nls);
-		if (data->profile.npoints_alloc < npoints)
-			{
-			status = mbview_allocprofilepoints(mbv_verbose,
-					npoints, &(data->profile.points), &error);
-			if (status == MB_SUCCESS)
-				{
-				data->profile.npoints_alloc = npoints;
-				}
-			else
-				{
-				data->profile.npoints_alloc = 0;
-				}
-			}
-		if (npoints > 2 && data->profile.npoints_alloc >= npoints)
-			{
-			/* get the profile data */
-			for (i=0;i<npoints;i++)
-				{
-				data->profile.points[i].boundary = MB_NO;
-				data->profile.points[i].xgrid = data->pick.segment.lspoints[i].xgrid;
-				data->profile.points[i].ygrid = data->pick.segment.lspoints[i].ygrid;
-				data->profile.points[i].xlon = data->pick.segment.lspoints[i].xlon;
-				data->profile.points[i].ylat = data->pick.segment.lspoints[i].ylat;
-				data->profile.points[i].zdata = data->pick.segment.lspoints[i].zdata;
-				data->profile.points[i].xdisplay = data->pick.segment.lspoints[i].xdisplay;
-				data->profile.points[i].ydisplay = data->pick.segment.lspoints[i].ydisplay;
-				if (i == 0)
-					{
-					data->profile.zmin = data->profile.points[i].zdata;
-					data->profile.zmax = data->profile.points[i].zdata;
-					data->profile.points[i].distance = 0.0;
-					data->profile.points[i].distovertopo = 0.0;
-					}
-				else
-					{
-					data->profile.zmin = MIN(data->profile.zmin, data->profile.points[i].zdata);
-					data->profile.zmax = MAX(data->profile.zmax, data->profile.points[i].zdata);
-					if (data->display_projection_mode != MBV_PROJECTION_SPHEROID)
-						{
-						dx = data->profile.points[i].xdisplay
-								- data->profile.points[i-1].xdisplay;
-						dy = data->profile.points[i].ydisplay
-								- data->profile.points[i-1].ydisplay;
-						data->profile.points[i].distance = sqrt(dx * dx + dy * dy) / view->scale
-							+ data->profile.points[i-1].distance;
-						}
-					else
-						{
-						mbview_greatcircle_dist(instance,
-							data->profile.points[0].xlon,
-							data->profile.points[0].ylat,
-							data->profile.points[i].xlon,
-							data->profile.points[i].ylat,
-							&(data->profile.points[i].distance));
-						}
-					dy = (data->profile.points[i].zdata
-						- data->profile.points[i-1].zdata);
-					dx = (data->profile.points[i].distance
-						- data->profile.points[i-1].distance);
-					data->profile.points[i].distovertopo = data->profile.points[i-1].distovertopo
-										+ sqrt(dy * dy + dx * dx);
-					if (dx > 0.0)
-						data->profile.points[i].slope = fabs(dy / dx);
-					else
-						data->profile.points[i].slope = 0.0;
-					}
-				data->profile.points[i].bearing = data->pick.bearing;
-				if (i > 1)
-					{
-					dy = (data->profile.points[i].zdata
-						- data->profile.points[i-2].zdata);
-					dx = (data->profile.points[i].distance
-						- data->profile.points[i-2].distance);
-					if (dx > 0.0)
-						data->profile.points[i-1].slope = fabs(dy / dx);
-					else
-						data->profile.points[i-1].slope = 0.0;
-					}
-				data->profile.points[i].navzdata = 0.0;
-				data->profile.points[i].navtime_d = 0.0;
-				}
-			data->profile.points[0].boundary = MB_YES;
-			data->profile.points[npoints-1].boundary = MB_YES;
-			data->profile.npoints = npoints;
-			}
-		}
-
-	/* print output debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:          %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-
-/*------------------------------------------------------------------------------*/
-int mbview_picksize(size_t instance)
-{
-
-	/* local variables */
-	char	*function_name = "mbview_picksize";
-	int	status = MB_SUCCESS;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-	double	scalefactor;
-	double	xlength;
-	int	found;
-	int	i;
-
-	/* print starting debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       instance:         %zu\n",instance);
-		}
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* resize and redrape pick marks if required */
-	if (data->pickinfo_mode == MBV_PICK_ONEPOINT
-		|| data->pickinfo_mode == MBV_PICK_TWOPOINT)
-		{
-		/* set size of 'X' marks in gl units for 3D case */
-		scalefactor = MIN( ((double)(data->viewbounds[1] - data->viewbounds[0]))
-					/ ((double)data->primary_nx),
-				   ((double)(data->viewbounds[3] - data->viewbounds[2]))
-					/ ((double)data->primary_ny) );
-		xlength = 0.05 * scalefactor;
-
-		/* set pick location x marker */
-		data->pick.xpoints[0].xdisplay = data->pick.endpoints[0].xdisplay - xlength;
-		data->pick.xpoints[0].ydisplay = data->pick.endpoints[0].ydisplay - xlength;
-		data->pick.xpoints[0].zdisplay = data->pick.endpoints[0].zdisplay;
-		data->pick.xpoints[1].xdisplay = data->pick.endpoints[0].xdisplay + xlength;
-		data->pick.xpoints[1].ydisplay = data->pick.endpoints[0].ydisplay + xlength;
-		data->pick.xpoints[1].zdisplay = data->pick.endpoints[0].zdisplay;
-		data->pick.xpoints[2].xdisplay = data->pick.endpoints[0].xdisplay - xlength;
-		data->pick.xpoints[2].ydisplay = data->pick.endpoints[0].ydisplay + xlength;
-		data->pick.xpoints[2].zdisplay = data->pick.endpoints[0].zdisplay;
-		data->pick.xpoints[3].xdisplay = data->pick.endpoints[0].xdisplay + xlength;
-		data->pick.xpoints[3].ydisplay = data->pick.endpoints[0].ydisplay - xlength;
-		data->pick.xpoints[3].zdisplay = data->pick.endpoints[0].zdisplay;
-		for (i=0;i<4;i++)
-			{
-			mbview_projectinverse(instance, MB_YES,
-				data->pick.xpoints[i].xdisplay,
-				data->pick.xpoints[i].ydisplay,
-				data->pick.xpoints[i].zdisplay,
-				&data->pick.xpoints[i].xlon,
-				&data->pick.xpoints[i].ylat,
-				&data->pick.xpoints[i].xgrid,
-				&data->pick.xpoints[i].ygrid);
-			mbview_getzdata(instance,
-				data->pick.xpoints[i].xgrid,
-				data->pick.xpoints[i].ygrid,
-				&found, &data->pick.xpoints[i].zdata);
-			if (found == MB_NO)
-				data->pick.xpoints[i].zdata
-					= data->pick.endpoints[0].zdata;
-			mbview_projectforward(instance, MB_YES,
-				data->pick.xpoints[i].xgrid,
-				data->pick.xpoints[i].ygrid,
-				data->pick.xpoints[i].zdata,
-				&(data->pick.xpoints[i].xlon),
-				&(data->pick.xpoints[i].ylat),
-				&(data->pick.xpoints[i].xdisplay),
-				&(data->pick.xpoints[i].ydisplay),
-				&(data->pick.xpoints[i].zdisplay));
-			}
-
-		/* drape the x marker line segments */
-		for (i=0;i<2;i++)
-			{
-			data->pick.xsegments[i].endpoints[0] = data->pick.xpoints[2*i];
-			data->pick.xsegments[i].endpoints[1] = data->pick.xpoints[2*i+1];
-			mbview_drapesegment(instance, &(data->pick.xsegments[i]));
-			}
-		}
-	if (data->pickinfo_mode == MBV_PICK_TWOPOINT)
-		{
-		/* set pick location x marker */
-		data->pick.xpoints[4].xdisplay = data->pick.endpoints[1].xdisplay - xlength;
-		data->pick.xpoints[4].ydisplay = data->pick.endpoints[1].ydisplay - xlength;
-		data->pick.xpoints[4].zdisplay = data->pick.endpoints[1].zdisplay;
-		data->pick.xpoints[5].xdisplay = data->pick.endpoints[1].xdisplay + xlength;
-		data->pick.xpoints[5].ydisplay = data->pick.endpoints[1].ydisplay + xlength;
-		data->pick.xpoints[5].zdisplay = data->pick.endpoints[1].zdisplay;
-		data->pick.xpoints[6].xdisplay = data->pick.endpoints[1].xdisplay - xlength;
-		data->pick.xpoints[6].ydisplay = data->pick.endpoints[1].ydisplay + xlength;
-		data->pick.xpoints[6].zdisplay = data->pick.endpoints[1].zdisplay;
-		data->pick.xpoints[7].xdisplay = data->pick.endpoints[1].xdisplay + xlength;
-		data->pick.xpoints[7].ydisplay = data->pick.endpoints[1].ydisplay - xlength;
-		data->pick.xpoints[7].zdisplay = data->pick.endpoints[1].zdisplay;
-		for (i=0;i<4;i++)
-			{
-			mbview_projectinverse(instance, MB_YES,
-				data->pick.xpoints[i+4].xdisplay,
-				data->pick.xpoints[i+4].ydisplay,
-				data->pick.xpoints[i+4].zdisplay,
-				&data->pick.xpoints[i+4].xlon,
-				&data->pick.xpoints[i+4].ylat,
-				&data->pick.xpoints[i+4].xgrid,
-				&data->pick.xpoints[i+4].ygrid);
-			mbview_getzdata(instance,
-				data->pick.xpoints[i+4].xgrid,
-				data->pick.xpoints[i+4].ygrid,
-				&found, &data->pick.xpoints[i+4].zdata);
-			if (found == MB_NO)
-				data->pick.xpoints[i+4].zdata
-					= data->pick.endpoints[1].zdata;
-			mbview_projectforward(instance, MB_YES,
-				data->pick.xpoints[i+4].xgrid,
-				data->pick.xpoints[i+4].ygrid,
-				data->pick.xpoints[i+4].zdata,
-				&(data->pick.xpoints[i+4].xlon),
-				&(data->pick.xpoints[i+4].ylat),
-				&(data->pick.xpoints[i+4].xdisplay),
-				&(data->pick.xpoints[i+4].ydisplay),
-				&(data->pick.xpoints[i+4].zdisplay));
-			}
-
-		/* drape the x marker line segments */
-		for (i=0;i<2;i++)
-			{
-			data->pick.xsegments[i+2].endpoints[0] = data->pick.xpoints[2*i+4];
-			data->pick.xsegments[i+2].endpoints[1] = data->pick.xpoints[2*i+5];
-			mbview_drapesegment(instance, &(data->pick.xsegments[i+2]));
-			}
-		}
-
-	/* print output debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:          %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-/*------------------------------------------------------------------------------*/
-int mbview_pick_text(size_t instance)
-{
-
-	/* local variables */
-	char	*function_name = "mbview_pick_text";
-	int	status = MB_SUCCESS;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-	int	time_i[7];
-	char	lonstr0[24], lonstr1[24];
-	char	latstr0[24], latstr1[24];
-	char	date0[24], date1[24];
-	char	shot0[48], shot1[48];
-	double	lonmin, lonmax, latmin, latmax;
-	int	i;
-
-	/* print starting debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       instance:         %zu\n",instance);
-		}
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* update pick info */
-	if (data->pickinfo_mode == MBV_PICK_ONEPOINT)
-		{
-		mbview_setlonlatstrings(shared.lonlatstyle,
-					data->pick.endpoints[0].xlon, data->pick.endpoints[0].ylat,
-					lonstr0, latstr0);
-		sprintf(value_text,":::t\"Pick Info:\":t\" Lon: %s\":t\" Lat: %s\":t\" Depth: %.3f m\"",
-			lonstr0, latstr0, data->pick.endpoints[0].zdata);
-		sprintf(value_list,"Pick Info: Lon: %s Lat: %s Depth: %.3f m",
-			lonstr0, latstr0, data->pick.endpoints[0].zdata);
-		}
-	else if (data->pickinfo_mode == MBV_PICK_TWOPOINT)
-		{
-		mbview_setlonlatstrings(shared.lonlatstyle,
-					data->pick.endpoints[0].xlon, data->pick.endpoints[0].ylat,
-					lonstr0, latstr0);
-		mbview_setlonlatstrings(shared.lonlatstyle,
-					data->pick.endpoints[1].xlon, data->pick.endpoints[1].ylat,
-					lonstr1, latstr1);
-		sprintf(value_text,
-		":::t\"Pick Info:\":t\" Lon 1: %s\":t\" Lat 1: %s\":t\" Depth 1: %.3f m\":t\" Lon 2: %s\":t\" Lat 2: %s\":t\" Depth 2: %.3f m\":t\" Bearing: %.1f deg\":t\" Distance: %.3f m\"",
-			lonstr0, latstr0,
-			data->pick.endpoints[0].zdata,
-			lonstr1, latstr1,
-			data->pick.endpoints[1].zdata,
-			data->pick.bearing, data->pick.range);
-		sprintf(value_list,
-		"Pick Info: Lon 1: %s Lat 1: %s Depth 1: %.3f m Lon 2: %s Lat 2: %s Depth 2: %.3f m Bearing: %.1f deg Distance: %.3f m",
-			lonstr0, latstr0,
-			data->pick.endpoints[0].zdata,
-			lonstr1, latstr1,
-			data->pick.endpoints[1].zdata,
-			data->pick.bearing, data->pick.range);
-		}
-	else if (data->pickinfo_mode == MBV_PICK_AREA)
-		{
-		sprintf(value_text,
-		":::t\"Area Info:\":t\" Length: %.3f m\":t\" Width: %.3f m\":t\" Bearing: %.1f deg\"",
-			data->area.length,
-			data->area.width,
-			data->area.bearing);
-		sprintf(value_list,
-		"Area Info: Length: %.3f m Width: %.3f m Bearing: %.1f deg",
-			data->area.length,
-			data->area.width,
-			data->area.bearing);
-		}
-	else if (data->pickinfo_mode == MBV_PICK_REGION)
-		{
-		lonmin = data->region.cornerpoints[0].xlon;
-		lonmax = data->region.cornerpoints[0].xlon;
-		latmin = data->region.cornerpoints[0].ylat;
-		latmax = data->region.cornerpoints[0].ylat;
-		for (i=1;i<4;i++)
-			{
-			lonmin = MIN(lonmin, data->region.cornerpoints[i].xlon);
-			lonmax = MAX(lonmax, data->region.cornerpoints[i].xlon);
-			latmin = MIN(latmin, data->region.cornerpoints[i].ylat);
-			latmax = MAX(latmax, data->region.cornerpoints[i].ylat);
-			}
-		if (view->lonflip < 0)
-			{
-			if (lonmin > 0.)
-				lonmin = lonmin - 360.;
-			else if (lonmin < -360.)
-				lonmin = lonmin + 360.;
-			if (lonmax > 0.)
-				lonmax = lonmax - 360.;
-			else if (lonmax < -360.)
-				lonmax = lonmax + 360.;
-			}
-		else if (view->lonflip == 0)
-			{
-			if (lonmin > 180.)
-				lonmin = lonmin - 360.;
-			else if (lonmin < -180.)
-				lonmin = lonmin + 360.;
-			if (lonmax > 180.)
-				lonmax = lonmax - 360.;
-			else if (lonmax < -180.)
-				lonmax = lonmax + 360.;
-			}
-		else
-			{
-			if (lonmin > 360.)
-				lonmin = lonmin - 360.;
-			else if (lonmin < 0.)
-				lonmin = lonmin + 360.;
-			if (lonmax > 360.)
-				lonmax = lonmax - 360.;
-			else if (lonmax < 0.)
-				lonmax = lonmax + 360.;
-			}
-		mbview_setlonlatstrings(shared.lonlatstyle, lonmin,latmin, lonstr0, latstr0);
-		mbview_setlonlatstrings(shared.lonlatstyle, lonmax,latmax, lonstr1, latstr1);
-		sprintf(value_text,
-		":::t\"Region Info:\":t\" West: %s\":t\" East: %s\":t\" South: %s\":t\" North: %s\":t\" Width: %.3f m\":t\" Height: %.3f m\"",
-			lonstr0, lonstr1, latstr0, latstr1,
-			data->region.width,
-			data->region.height);
-		sprintf(value_list,
-		"Region Info: Bounds: %.6f/%.6f/%.6f/%.6f  Width: %.3f m Height: %.3f m",
-			lonmin, lonmax, latmin, latmax,
-			data->region.width,
-			data->region.height);
-		}
-	else if (data->pickinfo_mode == MBV_PICK_SITE
-		&& shared.shareddata.site_selected != MBV_SELECT_NONE)
-		{
-		mbview_setlonlatstrings(shared.lonlatstyle,
-					shared.shareddata.sites[shared.shareddata.site_selected].point.xlon,
-					shared.shareddata.sites[shared.shareddata.site_selected].point.ylat,
-					lonstr0, latstr0);
-		sprintf(value_text,":::t\"Site %d Pick Info:\":t\" Lon: %s\":t\" Lat: %s\":t\" Depth: %.3f m\":t\" Color: %d\":t\" Size: %d\":t\" Name: %s\"",
-			shared.shareddata.site_selected, lonstr0, latstr0,
-			shared.shareddata.sites[shared.shareddata.site_selected].point.zdata,
-			shared.shareddata.sites[shared.shareddata.site_selected].color,
-			shared.shareddata.sites[shared.shareddata.site_selected].size,
-			shared.shareddata.sites[shared.shareddata.site_selected].name);
-		sprintf(value_list,"Site %d Pick Info: Lon: %s Lat: %s Depth: %.3f m Color: %d Size: %d Name: %s",
-			shared.shareddata.site_selected, lonstr0, latstr0,
-			shared.shareddata.sites[shared.shareddata.site_selected].point.zdata,
-			shared.shareddata.sites[shared.shareddata.site_selected].color,
-			shared.shareddata.sites[shared.shareddata.site_selected].size,
-			shared.shareddata.sites[shared.shareddata.site_selected].name);
-		}
-	else if (data->pickinfo_mode == MBV_PICK_ROUTE
-		&& shared.shareddata.route_selected != MBV_SELECT_NONE
-		&& shared.shareddata.route_point_selected == MBV_SELECT_ALL)
-		{
-		sprintf(value_text,":::t\"Route %d Pick Info:\":t\" Points: %d\":t\" Length: %.3f m\":t\" LOB: %.3f m\":t\" Name: %s\"",
-			shared.shareddata.route_selected,shared.shareddata.routes[shared.shareddata.route_selected].npoints,
-			shared.shareddata.routes[shared.shareddata.route_selected].distancelateral,
-			shared.shareddata.routes[shared.shareddata.route_selected].distancetopo,
-			shared.shareddata.routes[shared.shareddata.route_selected].name);
-		sprintf(value_list,"Route %d Pick Info: Points: %d Length: %.3f m LOB: %.3f m Name: %s",
-			shared.shareddata.route_selected,shared.shareddata.routes[shared.shareddata.route_selected].npoints,
-			shared.shareddata.routes[shared.shareddata.route_selected].distancelateral,
-			shared.shareddata.routes[shared.shareddata.route_selected].distancetopo,
-			shared.shareddata.routes[shared.shareddata.route_selected].name);
-		}
-	else if (data->pickinfo_mode == MBV_PICK_ROUTE
-		&& shared.shareddata.route_selected != MBV_SELECT_NONE
-		&& shared.shareddata.route_point_selected != MBV_SELECT_NONE)
-		{
-		mbview_setlonlatstrings(shared.lonlatstyle,
-					shared.shareddata.routes[shared.shareddata.route_selected].points[shared.shareddata.route_point_selected].xlon,
-					shared.shareddata.routes[shared.shareddata.route_selected].points[shared.shareddata.route_point_selected].ylat,
-					lonstr0, latstr0);
-		sprintf(value_text,":::t\"Route %d Pick Info:\":t\" Point: %d\":t\" Lon: %s\":t\" Lat: %s\":t\" Depth: %.3f m\":t\" Length: %.3f m\":t\" LOB: %.3f m\":t\" Name: %s\"",
-			shared.shareddata.route_selected,shared.shareddata.route_point_selected,
-			lonstr0, latstr0,
-			shared.shareddata.routes[shared.shareddata.route_selected].points[shared.shareddata.route_point_selected].zdata,
-			shared.shareddata.routes[shared.shareddata.route_selected].distlateral[shared.shareddata.route_point_selected],
-			shared.shareddata.routes[shared.shareddata.route_selected].disttopo[shared.shareddata.route_point_selected],
-			shared.shareddata.routes[shared.shareddata.route_selected].name);
-		sprintf(value_list,"Route %d Pick Info: Point: %d Lon: %s Lat: %s Depth: %.3f m Length: %.3f m LOB: %.3f m Name: %s",
-			shared.shareddata.route_selected,shared.shareddata.route_point_selected,
-			lonstr0, latstr0,
-			shared.shareddata.routes[shared.shareddata.route_selected].points[shared.shareddata.route_point_selected].zdata,
-			shared.shareddata.routes[shared.shareddata.route_selected].distlateral[shared.shareddata.route_point_selected],
-			shared.shareddata.routes[shared.shareddata.route_selected].disttopo[shared.shareddata.route_point_selected],
-			shared.shareddata.routes[shared.shareddata.route_selected].name);
-		}
-	else if (data->pickinfo_mode == MBV_PICK_NAV
-		&& shared.shareddata.navpick_type == MBV_PICK_ONEPOINT
-		&& shared.shareddata.nav_selected[0] != MBV_SELECT_NONE)
-		{
-		mb_get_date(mbv_verbose,
-				shared.shareddata.navs[shared.shareddata.nav_selected[0]].navpts[shared.shareddata.nav_point_selected[0]].time_d,
-				time_i);
-		sprintf(date0, "%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%3.3d",
-			time_i[0], time_i[1], time_i[2],
-			time_i[3], time_i[4], time_i[5],
-			(time_i[6] / 1000));
-		mbview_setlonlatstrings(shared.lonlatstyle,
-					shared.shareddata.navs[shared.shareddata.nav_selected[0]].navpts[shared.shareddata.nav_point_selected[0]].point.xlon,
-					shared.shareddata.navs[shared.shareddata.nav_selected[0]].navpts[shared.shareddata.nav_point_selected[0]].point.ylat,
-					lonstr0, latstr0);
-		sprintf(shot0, "#:%d:%d/%d",
-			shared.shareddata.navs[shared.shareddata.nav_selected[0]].navpts[shared.shareddata.nav_point_selected[0]].line,
-			shared.shareddata.navs[shared.shareddata.nav_selected[0]].navpts[shared.shareddata.nav_point_selected[0]].shot,
-			shared.shareddata.navs[shared.shareddata.nav_selected[0]].navpts[shared.shareddata.nav_point_selected[0]].cdp);
-		sprintf(value_text,":::t\"Navigation Pick Info:\":t\" %s\":t\" %s\":t\" Lon: %s\":t\" Lat: %s\":t\" Vertical: %.3f m\":t\" Heading: %.1f deg\":t\" Speed: %.1f km/hr\":t\" %s\"",
-			shared.shareddata.navs[shared.shareddata.nav_selected[0]].name,
-			date0, lonstr0, latstr0,
-			shared.shareddata.navs[shared.shareddata.nav_selected[0]].navpts[shared.shareddata.nav_point_selected[0]].point.zdata,
-			shared.shareddata.navs[shared.shareddata.nav_selected[0]].navpts[shared.shareddata.nav_point_selected[0]].heading,
-			shared.shareddata.navs[shared.shareddata.nav_selected[0]].navpts[shared.shareddata.nav_point_selected[0]].speed,
-			shot0);
-		sprintf(value_list,"Navigation Pick Info: %s %s Lon: %s Lat: %s Vehicle Depth: %.3f m Heading: %.1f deg Speed: %.1f km/hr %s",
-			shared.shareddata.navs[shared.shareddata.nav_selected[0]].name,
-			date0, lonstr0, latstr0,
-			shared.shareddata.navs[shared.shareddata.nav_selected[0]].navpts[shared.shareddata.nav_point_selected[0]].point.zdata,
-			shared.shareddata.navs[shared.shareddata.nav_selected[0]].navpts[shared.shareddata.nav_point_selected[0]].heading,
-			shared.shareddata.navs[shared.shareddata.nav_selected[0]].navpts[shared.shareddata.nav_point_selected[0]].speed,
-			shot0);
-		}
-	else if (data->pickinfo_mode == MBV_PICK_NAV
-		&& shared.shareddata.navpick_type == MBV_PICK_TWOPOINT
-		&& shared.shareddata.nav_selected[0] != MBV_SELECT_NONE
-		&& shared.shareddata.nav_selected[1] != MBV_SELECT_NONE)
-		{
-		mb_get_date(mbv_verbose,
-				shared.shareddata.navs[shared.shareddata.nav_selected[0]].navpts[shared.shareddata.nav_point_selected[0]].time_d,
-				time_i);
-		sprintf(date0, "%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%3.3d",
-			time_i[0], time_i[1], time_i[2],
-			time_i[3], time_i[4], time_i[5],
-			(time_i[6] / 1000));
-		mbview_setlonlatstrings(shared.lonlatstyle,
-					shared.shareddata.navs[shared.shareddata.nav_selected[0]].navpts[shared.shareddata.nav_point_selected[0]].point.xlon,
-					shared.shareddata.navs[shared.shareddata.nav_selected[0]].navpts[shared.shareddata.nav_point_selected[0]].point.ylat,
-					lonstr0, latstr0);
-		sprintf(shot0, "#:%d:%d/%d",
-			shared.shareddata.navs[shared.shareddata.nav_selected[0]].navpts[shared.shareddata.nav_point_selected[0]].line,
-			shared.shareddata.navs[shared.shareddata.nav_selected[0]].navpts[shared.shareddata.nav_point_selected[0]].shot,
-			shared.shareddata.navs[shared.shareddata.nav_selected[0]].navpts[shared.shareddata.nav_point_selected[0]].cdp);
-		mb_get_date(mbv_verbose,
-				shared.shareddata.navs[shared.shareddata.nav_selected[1]].navpts[shared.shareddata.nav_point_selected[1]].time_d,
-				time_i);
-		sprintf(date1, "%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%3.3d",
-			time_i[0], time_i[1], time_i[2],
-			time_i[3], time_i[4], time_i[5],
-			(time_i[6] / 1000));
-		mbview_setlonlatstrings(shared.lonlatstyle,
-					shared.shareddata.navs[shared.shareddata.nav_selected[1]].navpts[shared.shareddata.nav_point_selected[1]].point.xlon,
-					shared.shareddata.navs[shared.shareddata.nav_selected[1]].navpts[shared.shareddata.nav_point_selected[1]].point.ylat,
-					lonstr1, latstr1);
-		sprintf(shot1, "#:%d:%d/%d",
-			shared.shareddata.navs[shared.shareddata.nav_selected[1]].navpts[shared.shareddata.nav_point_selected[1]].line,
-			shared.shareddata.navs[shared.shareddata.nav_selected[1]].navpts[shared.shareddata.nav_point_selected[1]].shot,
-			shared.shareddata.navs[shared.shareddata.nav_selected[1]].navpts[shared.shareddata.nav_point_selected[1]].cdp);
-		sprintf(value_text,":::t\"Navigation Picks Info:\":t\" %s\":t\" %s\":t\" Lon: %s\":t\" Lat: %s\":t\" %s\":t\" %s\":t\" %s\":t\" Lon: %s\":t\" Lat: %s\":t\" %s\"",
-			shared.shareddata.navs[shared.shareddata.nav_selected[0]].name, date0, lonstr0, latstr0, shot0,
-			shared.shareddata.navs[shared.shareddata.nav_selected[1]].name, date1, lonstr1, latstr1, shot1);
-		sprintf(value_list,"Navigation Picks Info: %s %s Lon: %s Lat: %s %s %s %s Lon: %s Lat: %s %s",
-			shared.shareddata.navs[shared.shareddata.nav_selected[0]].name, date0, lonstr0, latstr0, shot0,
-			shared.shareddata.navs[shared.shareddata.nav_selected[1]].name, date1, lonstr1, latstr1, shot1);
-		}
-/*	else
-		{
-		sprintf(value_text, ":::t\"Pick Info:\":t\"No Pick\"");
-		sprintf(value_list, "Pick Info: No Pick\n");
-		}*/
-	set_mbview_label_multiline_string(view->mb3dview.mbview_label_pickinfo, value_text);
-	fprintf(stderr,"%s\n", value_list);
-
-	/* print output debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:          %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-
-/*------------------------------------------------------------------------------*/
-int mbview_setlonlatstrings(int style, double lon, double lat, char *lonstring, char *latstring)
-{
-	/* local variables */
-	char	*function_name = "mbview_setlonlatstrings";
-	int	status = MB_SUCCESS;
-	int	degree;
-	double	minute;
-
-	/* print starting debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       style:            %d\n",style);
-		fprintf(stderr,"dbg2       lon:              %f\n",lon);
-		fprintf(stderr,"dbg2       lat:              %f\n",lat);
-		}
-
-	/* set the strings */
-	if (lon > 180.0)
-		{
-		lon -= 360.0;
-		}
-	if (lon < -180.0)
-		{
-		lon += 360.0;
-		}
-
-	if (style == MBV_LONLAT_DECIMAL)
-		{
-		if (lon < 0.0)
-			sprintf(lonstring, "%9.5f W", fabs(lon));
-		else
-			sprintf(lonstring, "%9.5f E", fabs(lon));
-		if (lat < 0.0)
-			sprintf(latstring, "%8.5f S", fabs(lat));
-		else
-			sprintf(latstring, "%8.5f N", fabs(lat));
-		}
-	else
-		{
-		degree = (int)fabs(lon);
-		minute = 60.0 * (fabs(lon) - (double)degree);
-		if (lon < 0.0)
-			sprintf(lonstring, "%3d W %6.3f", degree, minute);
-		else
-			sprintf(lonstring, "%3d E %6.3f", degree, minute);
-		degree = (int)fabs(lat);
-		minute = 60.0 * (fabs(lat) - (double)degree);
-		if (lat < 0.0)
-			sprintf(latstring, "%3d S %6.3f", degree, minute);
-		else
-			sprintf(latstring, "%3d N %6.3f", degree, minute);
-		}
-
-	/* print output debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       lonstring:       %s\n",lonstring);
-		fprintf(stderr,"dbg2       latstring:       %s\n",latstring);
-		fprintf(stderr,"dbg2       status:          %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-
-/*------------------------------------------------------------------------------*/
-int mbview_region(size_t instance, int which, int xpixel, int ypixel)
-{
-
-	/* local variables */
-	char	*function_name = "mbview_region";
-	int	status = MB_SUCCESS;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-	int	found;
-	double	xgrid, ygrid;
-	double	xlon, ylat, zdata;
-	double	xdisplay, ydisplay, zdisplay;
-	double	dx, dy;
-	double	dd;
-	int	ok;
-	double	bearing;
-	int	match, match0, match1, match2, match3;
-	int	i, k;
-
-	/* print starting debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       instance:         %zu\n",instance);
-		fprintf(stderr,"dbg2       which:            %d\n",which);
-		fprintf(stderr,"dbg2       xpixel:           %d\n",xpixel);
-		fprintf(stderr,"dbg2       ypixel:           %d\n",ypixel);
-		}
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* check to see if pick is at existing corner points */
-	if (which == MBV_REGION_DOWN
-		&& data->region_type == MBV_REGION_QUAD)
-		{
-		/* look for match to existing corner points in neighborhood of pick */
-		match = MB_NO;
-		match0 = MB_NO;
-		match1 = MB_NO;
-		match2 = MB_NO;
-		match3 = MB_NO;
-
-		/* look for point */
-		mbview_findpoint(instance, xpixel, ypixel,
-				&found,
-				&xgrid, &ygrid,
-				&xlon, &ylat, &zdata,
-				&xdisplay, &ydisplay, &zdisplay);
-
-		dx = 0.10 * (data->region.cornerpoints[3].xdisplay - data->region.cornerpoints[0].xdisplay);
-		dy = 0.10 * (data->region.cornerpoints[3].ydisplay - data->region.cornerpoints[0].ydisplay);
-		dd = MAX(dx, dy);
-		if (found == MB_YES)
-			{
-			if (fabs(xdisplay - data->region.cornerpoints[0].xdisplay) < dd
-				&& fabs(ydisplay - data->region.cornerpoints[0].ydisplay) < dd)
-				{
-				match = MB_YES;
-				match0 = MB_YES;
-				}
-			else if (fabs(xdisplay - data->region.cornerpoints[1].xdisplay) < dd
-				&& fabs(ydisplay - data->region.cornerpoints[1].ydisplay) < dd)
-				{
-				match = MB_YES;
-				match1 = MB_YES;
-				}
-			else if (fabs(xdisplay - data->region.cornerpoints[2].xdisplay) < dd
-				&& fabs(ydisplay - data->region.cornerpoints[2].ydisplay) < dd)
-				{
-				match = MB_YES;
-				match2 = MB_YES;
-				}
-			else if (fabs(xdisplay - data->region.cornerpoints[3].xdisplay) < dd
-				&& fabs(ydisplay - data->region.cornerpoints[3].ydisplay) < dd)
-				{
-				match = MB_YES;
-				match3 = MB_YES;
-				}
-			}
-
-		/* if no match then start new region */
-		if (match == MB_NO)
-			{
-			/* look for point */
-			mbview_findpoint(instance, xpixel, ypixel,
-					&found,
-					&xgrid, &ygrid,
-					&xlon, &ylat, &zdata,
-					&xdisplay, &ydisplay, &zdisplay);
-
-			/* use any good point */
-			if (found == MB_YES)
-				{
-				/* set the first endpoint */
-				data->region_type = MBV_REGION_ONEPOINT;
-				data->region_pickcorner = MBV_REGION_PICKCORNER3;
-				data->region.cornerpoints[0].xgrid = xgrid;
-				data->region.cornerpoints[0].ygrid = ygrid;
-				data->region.cornerpoints[0].xlon = xlon;
-				data->region.cornerpoints[0].ylat = ylat;
-				data->region.cornerpoints[0].zdata = zdata;
-				data->region.cornerpoints[0].xdisplay = xdisplay;
-				data->region.cornerpoints[0].ydisplay = ydisplay;
-				data->region.cornerpoints[0].zdisplay = zdisplay;
-/*fprintf(stderr,"PICK NEW REGION: corner0: xgrid:%f ygrid:%f xlon:%f ylat:%f zdata:%f display: %f %f %f\n",
-xgrid,ygrid,xlon,ylat,zdata,xdisplay,ydisplay,zdisplay);*/
-				}
-			}
-
-		/* else if match 0 then reset corner point 0 */
-		else if (match0 == MB_YES)
-			{
-			/* look for point */
-			mbview_findpoint(instance, xpixel, ypixel,
-					&found,
-					&xgrid, &ygrid,
-					&xlon, &ylat, &zdata,
-					&xdisplay, &ydisplay, &zdisplay);
-
-			/* use any good point */
-			if (found == MB_YES)
-				{
-				/* set corner point 0 */
-				data->region_type = MBV_REGION_QUAD;
-				data->region_pickcorner = MBV_REGION_PICKCORNER0;
-				data->region.cornerpoints[0].xgrid = xgrid;
-				data->region.cornerpoints[0].ygrid = ygrid;
-				data->region.cornerpoints[0].xlon = xlon;
-				data->region.cornerpoints[0].ylat = ylat;
-				data->region.cornerpoints[0].zdata = zdata;
-				data->region.cornerpoints[0].xdisplay = xdisplay;
-				data->region.cornerpoints[0].ydisplay = ydisplay;
-				data->region.cornerpoints[0].zdisplay = zdisplay;
-/*fprintf(stderr,"PICK EXISTING REGION: corner0: xgrid:%f ygrid:%f xlon:%f ylat:%f zdata:%f display: %f %f %f\n",
-xgrid,ygrid,xlon,ylat,zdata,xdisplay,ydisplay,zdisplay);*/
-				}
-			}
-
-		/* else if match 1 then reset corner point 1 */
-		else if (match1 == MB_YES)
-			{
-			/* look for point */
-			mbview_findpoint(instance, xpixel, ypixel,
-					&found,
-					&xgrid, &ygrid,
-					&xlon, &ylat, &zdata,
-					&xdisplay, &ydisplay, &zdisplay);
-
-			/* use any good point */
-			if (found == MB_YES)
-				{
-				/* set corner point 1 */
-				data->region_type = MBV_REGION_QUAD;
-				data->region_pickcorner = MBV_REGION_PICKCORNER1;
-				data->region.cornerpoints[1].xgrid = xgrid;
-				data->region.cornerpoints[1].ygrid = ygrid;
-				data->region.cornerpoints[1].xlon = xlon;
-				data->region.cornerpoints[1].ylat = ylat;
-				data->region.cornerpoints[1].zdata = zdata;
-				data->region.cornerpoints[1].xdisplay = xdisplay;
-				data->region.cornerpoints[1].ydisplay = ydisplay;
-				data->region.cornerpoints[1].zdisplay = zdisplay;
-/*fprintf(stderr,"PICK EXISTING REGION: corner1: xgrid:%f ygrid:%f xlon:%f ylat:%f zdata:%f display: %f %f %f\n",
-xgrid,ygrid,xlon,ylat,zdata,xdisplay,ydisplay,zdisplay);*/
-				}
-			}
-
-		/* else if match 2 then reset corner point 2 */
-		else if (match2 == MB_YES)
-			{
-			/* look for point */
-			mbview_findpoint(instance, xpixel, ypixel,
-					&found,
-					&xgrid, &ygrid,
-					&xlon, &ylat, &zdata,
-					&xdisplay, &ydisplay, &zdisplay);
-
-			/* use any good point */
-			if (found == MB_YES)
-				{
-				/* set corner point 2 */
-				data->region_type = MBV_REGION_QUAD;
-				data->region_pickcorner = MBV_REGION_PICKCORNER2;
-				data->region.cornerpoints[2].xgrid = xgrid;
-				data->region.cornerpoints[2].ygrid = ygrid;
-				data->region.cornerpoints[2].xlon = xlon;
-				data->region.cornerpoints[2].ylat = ylat;
-				data->region.cornerpoints[2].zdata = zdata;
-				data->region.cornerpoints[2].xdisplay = xdisplay;
-				data->region.cornerpoints[2].ydisplay = ydisplay;
-				data->region.cornerpoints[2].zdisplay = zdisplay;
-/*fprintf(stderr,"PICK EXISTING REGION: corner2: xgrid:%f ygrid:%f xlon:%f ylat:%f zdata:%f display: %f %f %f\n",
-xgrid,ygrid,xlon,ylat,zdata,xdisplay,ydisplay,zdisplay);*/
-				}
-			}
-
-		/* else if match 3 then reset corner point 3 */
-		else if (match3 == MB_YES)
-			{
-			/* look for point */
-			mbview_findpoint(instance, xpixel, ypixel,
-					&found,
-					&xgrid, &ygrid,
-					&xlon, &ylat, &zdata,
-					&xdisplay, &ydisplay, &zdisplay);
-
-			/* use any good point */
-			if (found == MB_YES)
-				{
-				/* set corner point 3 */
-				data->region_type = MBV_REGION_QUAD;
-				data->region_pickcorner = MBV_REGION_PICKCORNER3;
-				data->region.cornerpoints[3].xgrid = xgrid;
-				data->region.cornerpoints[3].ygrid = ygrid;
-				data->region.cornerpoints[3].xlon = xlon;
-				data->region.cornerpoints[3].ylat = ylat;
-				data->region.cornerpoints[3].zdata = zdata;
-				data->region.cornerpoints[3].xdisplay = xdisplay;
-				data->region.cornerpoints[3].ydisplay = ydisplay;
-				data->region.cornerpoints[3].zdisplay = zdisplay;
-/*fprintf(stderr,"PICK EXISTING REGION: corner3: xgrid:%f ygrid:%f xlon:%f ylat:%f zdata:%f display: %f %f %f\n",
-xgrid,ygrid,xlon,ylat,zdata,xdisplay,ydisplay,zdisplay);*/
-				}
-			}
-		}
-
-	/* deal with start of new region */
-	else if ((which == MBV_REGION_DOWN
-			|| which == MBV_REGION_MOVE)
-			&& data->region_type == MBV_REGION_NONE)
-		{
-		/* look for point */
-		mbview_findpoint(instance, xpixel, ypixel,
-				&found,
-				&xgrid, &ygrid,
-				&xlon, &ylat, &zdata,
-				&xdisplay, &ydisplay, &zdisplay);
-/*fprintf(stderr,"NEW REGION: corner0: xgrid:%f ygrid:%f xlon:%f ylat:%f zdata:%f display: %f %f %f\n",
-xgrid,ygrid,xlon,ylat,zdata,xdisplay,ydisplay,zdisplay);*/
-
-		/* use any good point */
-		if (found == MB_YES)
-			{
-			/* set the first endpoint */
-			data->region_type = MBV_REGION_ONEPOINT;
-			data->region_pickcorner = MBV_REGION_PICKCORNER3;
-			data->region.cornerpoints[0].xgrid = xgrid;
-			data->region.cornerpoints[0].ygrid = ygrid;
-			data->region.cornerpoints[0].xlon = xlon;
-			data->region.cornerpoints[0].ylat = ylat;
-			data->region.cornerpoints[0].zdata = zdata;
-			data->region.cornerpoints[0].xdisplay = xdisplay;
-			data->region.cornerpoints[0].ydisplay = ydisplay;
-			data->region.cornerpoints[0].zdisplay = zdisplay;
-			}
-		}
-
-	/* deal with definition or change of cornerpoint 0 */
-	else if (which == MBV_REGION_MOVE
-		&& data->region_pickcorner == MBV_REGION_PICKCORNER0)
-		{
-		/* look for point */
-		mbview_findpoint(instance, xpixel, ypixel,
-				&found,
-				&xgrid, &ygrid,
-				&xlon, &ylat, &zdata,
-				&xdisplay, &ydisplay, &zdisplay);
-/*fprintf(stderr,"CHANGE REGION: corner0: xgrid:%f ygrid:%f xlon:%f ylat:%f zdata:%f display: %f %f %f\n",
-xgrid,ygrid,xlon,ylat,zdata,xdisplay,ydisplay,zdisplay);*/
-
-		/* ignore an identical pair of points */
-		if (found == MB_YES
-			&& data->region.cornerpoints[3].xgrid
-				== xgrid
-			&& data->region.cornerpoints[3].ygrid
-				== ygrid)
-			{
-			data->region_type = MBV_REGION_ONEPOINT;
-			XBell(view->dpy,100);
-			}
-
-		/* use any good pair of points */
-		else if (found == MB_YES)
-			{
-			/* set the second endpoint */
-			data->region_type = MBV_REGION_QUAD;
-			data->region_pickcorner = MBV_REGION_PICKCORNER0;
-			data->region.cornerpoints[0].xgrid = xgrid;
-			data->region.cornerpoints[0].ygrid = ygrid;
-			data->region.cornerpoints[0].xlon = xlon;
-			data->region.cornerpoints[0].ylat = ylat;
-			data->region.cornerpoints[0].zdata = zdata;
-			data->region.cornerpoints[0].xdisplay = xdisplay;
-			data->region.cornerpoints[0].ydisplay = ydisplay;
-			data->region.cornerpoints[0].zdisplay = zdisplay;
-			}
-
-		/* ignore a bad point */
-		else if (found == MB_NO)
-			{
-			XBell(view->dpy,100);
-			}
-		}
-
-	/* deal with definition or change of cornerpoint 1 */
-	else if (which == MBV_REGION_MOVE
-		&& data->region_pickcorner == MBV_REGION_PICKCORNER1)
-		{
-		/* look for point */
-		mbview_findpoint(instance, xpixel, ypixel,
-				&found,
-				&xgrid, &ygrid,
-				&xlon, &ylat, &zdata,
-				&xdisplay, &ydisplay, &zdisplay);
-/*fprintf(stderr,"CHANGE REGION: corner1: xgrid:%f ygrid:%f xlon:%f ylat:%f zdata:%f display: %f %f %f\n",
-xgrid,ygrid,xlon,ylat,zdata,xdisplay,ydisplay,zdisplay);*/
-
-		/* ignore an identical pair of points */
-		if (found == MB_YES
-			&& data->region.cornerpoints[2].xgrid
-				== xgrid
-			&& data->region.cornerpoints[2].ygrid
-				== ygrid)
-			{
-			data->region_type = MBV_REGION_ONEPOINT;
-			XBell(view->dpy,100);
-			}
-
-		/* use any good pair of points */
-		else if (found == MB_YES)
-			{
-			/* set the second endpoint */
-			data->region_type = MBV_REGION_QUAD;
-			data->region_pickcorner = MBV_REGION_PICKCORNER1;
-			data->region.cornerpoints[1].xgrid = xgrid;
-			data->region.cornerpoints[1].ygrid = ygrid;
-			data->region.cornerpoints[1].xlon = xlon;
-			data->region.cornerpoints[1].ylat = ylat;
-			data->region.cornerpoints[1].zdata = zdata;
-			data->region.cornerpoints[1].xdisplay = xdisplay;
-			data->region.cornerpoints[1].ydisplay = ydisplay;
-			data->region.cornerpoints[1].zdisplay = zdisplay;
-			}
-
-		/* ignore a bad point */
-		else if (found == MB_NO)
-			{
-			XBell(view->dpy,100);
-			}
-		}
-
-	/* deal with definition or change of cornerpoint 2 */
-	else if (which == MBV_REGION_MOVE
-		&& data->region_pickcorner == MBV_REGION_PICKCORNER2)
-		{
-		/* look for point */
-		mbview_findpoint(instance, xpixel, ypixel,
-				&found,
-				&xgrid, &ygrid,
-				&xlon, &ylat, &zdata,
-				&xdisplay, &ydisplay, &zdisplay);
-/*fprintf(stderr,"CHANGE REGION: corner2: xgrid:%f ygrid:%f xlon:%f ylat:%f zdata:%f display: %f %f %f\n",
-xgrid,ygrid,xlon,ylat,zdata,xdisplay,ydisplay,zdisplay);*/
-
-		/* ignore an identical pair of points */
-		if (found == MB_YES
-			&& data->region.cornerpoints[1].xgrid
-				== xgrid
-			&& data->region.cornerpoints[1].ygrid
-				== ygrid)
-			{
-			data->region_type = MBV_REGION_ONEPOINT;
-			XBell(view->dpy,100);
-			}
-
-		/* use any good pair of points */
-		else if (found == MB_YES)
-			{
-			/* set the second endpoint */
-			data->region_type = MBV_REGION_QUAD;
-			data->region_pickcorner = MBV_REGION_PICKCORNER2;
-			data->region.cornerpoints[2].xgrid = xgrid;
-			data->region.cornerpoints[2].ygrid = ygrid;
-			data->region.cornerpoints[2].xlon = xlon;
-			data->region.cornerpoints[2].ylat = ylat;
-			data->region.cornerpoints[2].zdata = zdata;
-			data->region.cornerpoints[2].xdisplay = xdisplay;
-			data->region.cornerpoints[2].ydisplay = ydisplay;
-			data->region.cornerpoints[2].zdisplay = zdisplay;
-			}
-
-		/* ignore a bad point */
-		else if (found == MB_NO)
-			{
-			XBell(view->dpy,100);
-			}
-		}
-
-	/* deal with definition or change of cornerpoint 3 */
-	else if (which == MBV_REGION_MOVE
-		&& data->region_pickcorner == MBV_REGION_PICKCORNER3)
-		{
-		/* look for point */
-		mbview_findpoint(instance, xpixel, ypixel,
-				&found,
-				&xgrid, &ygrid,
-				&xlon, &ylat, &zdata,
-				&xdisplay, &ydisplay, &zdisplay);
-/*fprintf(stderr,"CHANGE REGION: corner3: xgrid:%f ygrid:%f xlon:%f ylat:%f zdata:%f display: %f %f %f\n",
-xgrid,ygrid,xlon,ylat,zdata,xdisplay,ydisplay,zdisplay);*/
-
-		/* ignore an identical pair of points */
-		if (found == MB_YES
-			&& data->region.cornerpoints[0].xgrid
-				== xgrid
-			&& data->region.cornerpoints[0].ygrid
-				== ygrid)
-			{
-			data->region_type = MBV_REGION_ONEPOINT;
-			XBell(view->dpy,100);
-			}
-
-		/* use any good pair of points */
-		else if (found == MB_YES)
-			{
-			/* set corner point 3 */
-			data->region_type = MBV_REGION_QUAD;
-			data->region_pickcorner = MBV_REGION_PICKCORNER3;
-			data->region.cornerpoints[3].xgrid = xgrid;
-			data->region.cornerpoints[3].ygrid = ygrid;
-			data->region.cornerpoints[3].xlon = xlon;
-			data->region.cornerpoints[3].ylat = ylat;
-			data->region.cornerpoints[3].zdata = zdata;
-			data->region.cornerpoints[3].xdisplay = xdisplay;
-			data->region.cornerpoints[3].ydisplay = ydisplay;
-			data->region.cornerpoints[3].zdisplay = zdisplay;
-			}
-
-		/* ignore a bad point */
-		else if (found == MB_NO)
-			{
-			XBell(view->dpy,100);
-			}
-		}
-
-	/* recalculate any good quad region */
-	if (data->region_type == MBV_REGION_QUAD
-		&& which != MBV_REGION_UP)
-		{
-		/* if needed define corners 1 and 2 in grid coordinates */
-		if (data->region_pickcorner == MBV_REGION_PICKCORNER0
-			|| data->region_pickcorner == MBV_REGION_PICKCORNER3)
-			{
-			data->region.cornerpoints[1].xgrid
-				= data->region.cornerpoints[0].xgrid;
-			data->region.cornerpoints[1].ygrid
-				= data->region.cornerpoints[3].ygrid;
-			mbview_getzdata(instance,
-					data->region.cornerpoints[1].xgrid,
-					data->region.cornerpoints[1].ygrid,
-					&ok,
-					&(data->region.cornerpoints[1].zdata));
-			if (ok == MB_NO)
-				data->region.cornerpoints[1].zdata
-					= 0.5 * (data->region.cornerpoints[0].zdata
-							+ data->region.cornerpoints[3].zdata);
-			mbview_projectforward(instance, MB_YES,
-					data->region.cornerpoints[1].xgrid,
-					data->region.cornerpoints[1].ygrid,
-					data->region.cornerpoints[1].zdata,
-					&(data->region.cornerpoints[1].xlon),
-					&(data->region.cornerpoints[1].ylat),
-					&(data->region.cornerpoints[1].xdisplay),
-					&(data->region.cornerpoints[1].ydisplay),
-					&(data->region.cornerpoints[1].zdisplay));
-
-			data->region.cornerpoints[2].xgrid
-				= data->region.cornerpoints[3].xgrid;
-			data->region.cornerpoints[2].ygrid
-				= data->region.cornerpoints[0].ygrid;
-			mbview_getzdata(instance,
-					data->region.cornerpoints[2].xgrid,
-					data->region.cornerpoints[2].ygrid,
-					&ok,
-					&(data->region.cornerpoints[2].zdata));
-			if (ok == MB_NO)
-				data->region.cornerpoints[2].zdata
-					= 0.5 * (data->region.cornerpoints[0].zdata
-							+ data->region.cornerpoints[3].zdata);
-			mbview_projectforward(instance, MB_YES,
-					data->region.cornerpoints[2].xgrid,
-					data->region.cornerpoints[2].ygrid,
-					data->region.cornerpoints[2].zdata,
-					&(data->region.cornerpoints[2].xlon),
-					&(data->region.cornerpoints[2].ylat),
-					&(data->region.cornerpoints[2].xdisplay),
-					&(data->region.cornerpoints[2].ydisplay),
-					&(data->region.cornerpoints[2].zdisplay));
-			}
-
-		/* if needed define corners 0 and 3 in grid coordinates */
-		if (data->region_pickcorner == MBV_REGION_PICKCORNER1
-			|| data->region_pickcorner == MBV_REGION_PICKCORNER2)
-			{
-			data->region.cornerpoints[0].xgrid
-				= data->region.cornerpoints[2].xgrid;
-			data->region.cornerpoints[0].ygrid
-				= data->region.cornerpoints[1].ygrid;
-			mbview_getzdata(instance,
-					data->region.cornerpoints[0].xgrid,
-					data->region.cornerpoints[0].ygrid,
-					&ok,
-					&(data->region.cornerpoints[0].zdata));
-			if (ok == MB_NO)
-				data->region.cornerpoints[0].zdata
-					= 0.5 * (data->region.cornerpoints[1].zdata
-							+ data->region.cornerpoints[2].zdata);
-			mbview_projectforward(instance, MB_YES,
-					data->region.cornerpoints[0].xgrid,
-					data->region.cornerpoints[0].ygrid,
-					data->region.cornerpoints[0].zdata,
-					&(data->region.cornerpoints[0].xlon),
-					&(data->region.cornerpoints[0].ylat),
-					&(data->region.cornerpoints[0].xdisplay),
-					&(data->region.cornerpoints[0].ydisplay),
-					&(data->region.cornerpoints[0].zdisplay));
-
-			data->region.cornerpoints[3].xgrid
-				= data->region.cornerpoints[1].xgrid;
-			data->region.cornerpoints[3].ygrid
-				= data->region.cornerpoints[2].ygrid;
-			mbview_getzdata(instance,
-					data->region.cornerpoints[3].xgrid,
-					data->region.cornerpoints[3].ygrid,
-					&ok,
-					&(data->region.cornerpoints[3].zdata));
-			if (ok == MB_NO)
-				data->region.cornerpoints[3].zdata
-					= 0.5 * (data->region.cornerpoints[1].zdata
-							+ data->region.cornerpoints[2].zdata);
-			mbview_projectforward(instance, MB_YES,
-					data->region.cornerpoints[3].xgrid,
-					data->region.cornerpoints[3].ygrid,
-					data->region.cornerpoints[3].zdata,
-					&(data->region.cornerpoints[3].xlon),
-					&(data->region.cornerpoints[3].ylat),
-					&(data->region.cornerpoints[3].xdisplay),
-					&(data->region.cornerpoints[3].ydisplay),
-					&(data->region.cornerpoints[3].zdisplay));
-			}
-
-		/* calculate width and length */
-		if (data->display_projection_mode != MBV_PROJECTION_SPHEROID)
-			{
-			data->region.width = fabs(data->region.cornerpoints[3].xdisplay
-						- data->region.cornerpoints[0].xdisplay) / view->scale;
-			data->region.height = fabs(data->region.cornerpoints[3].ydisplay
-						- data->region.cornerpoints[0].ydisplay) / view->scale;
-			}
-		else
-			{
-			mbview_greatcircle_distbearing(instance,
-				data->region.cornerpoints[0].xlon,
-				data->region.cornerpoints[0].ylat,
-				data->region.cornerpoints[2].xlon,
-				data->region.cornerpoints[2].ylat,
-				&bearing, &data->region.width);
-			mbview_greatcircle_distbearing(instance,
-				data->region.cornerpoints[0].xlon,
-				data->region.cornerpoints[0].ylat,
-				data->region.cornerpoints[1].xlon,
-				data->region.cornerpoints[1].ylat,
-				&bearing, &data->region.height);
-			}
-
-		/* reset segment endpoints */
-		for (i=0;i<4;i++)
-			{
-			if (i == 0)
-				k = 1;
-			else if (i == 1)
-				k = 3;
-			else if (i == 2)
-				k = 0;
-			else if (i == 3)
-				k = 2;
-			data->region.segments[i].endpoints[0] = data->region.cornerpoints[i];
-			data->region.segments[i].endpoints[1] = data->region.cornerpoints[k];
-			}
-
-		/* set pick info */
-		data->pickinfo_mode = MBV_PICK_REGION;
-
-		/* set pick annotation */
-		mbview_pick_text(instance);
-		}
-
-	/* now set and drape the segments
-		if either 3D display
-		or the pick move is final  */
-	if (data->region_type == MBV_REGION_QUAD
-		&& (data->display_mode == MBV_DISPLAY_3D
-			|| which == MBV_REGION_UP))
-		{
-		for (i=0;i<4;i++)
-			{
-			/* drape the segment */
-			mbview_drapesegment(instance, &(data->region.segments[i]));
-			}
-		}
-
-	/* call pick notify if defined */
-	if (which == MBV_REGION_UP && data->region_type == MBV_REGION_QUAD
-		&& data->mbview_pickregion_notify != NULL)
-		{
-		(data->mbview_pickregion_notify)(instance);
-		}
-
-	/* print output debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:          %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-/*------------------------------------------------------------------------------*/
-int mbview_area(size_t instance, int which, int xpixel, int ypixel)
-{
-
-	/* local variables */
-	char	*function_name = "mbview_area";
-	int	status = MB_SUCCESS;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-	int	found;
-	double	xgrid, ygrid;
-	double	xlon, ylat, zdata;
-	double	xdisplay, ydisplay, zdisplay;
-	double	dx, dy, dxuse, dyuse, bearing;
-	double	dd;
-	int	ok;
-	int	match, match0, match1;
-	int	i, j, k;
-
-	/* print starting debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       instance:         %zu\n",instance);
-		fprintf(stderr,"dbg2       which:            %d\n",which);
-		fprintf(stderr,"dbg2       xpixel:           %d\n",xpixel);
-		fprintf(stderr,"dbg2       ypixel:           %d\n",ypixel);
-		}
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* check to see if pick is at existing end points */
-	if (which == MBV_AREALENGTH_DOWN
-		&& data->area_type == MBV_AREA_QUAD)
-		{
-		/* look for match to existing endpoints in neighborhood of pick */
-		match = MB_NO;
-		match0 = MB_NO;
-		match1 = MB_NO;
-
-		/* look for point */
-		mbview_findpoint(instance, xpixel, ypixel,
-				&found,
-				&xgrid, &ygrid,
-				&xlon, &ylat, &zdata,
-				&xdisplay, &ydisplay, &zdisplay);
-
-		dx = 0.10 * (data->area.endpoints[1].xdisplay - data->area.endpoints[0].xdisplay);
-		dy = 0.10 * (data->area.endpoints[1].ydisplay - data->area.endpoints[0].ydisplay);
-		dd = MAX(dx, dy);
-		if (found == MB_YES)
-			{
-			if (fabs(xdisplay - data->area.endpoints[0].xdisplay) < dd
-				&& fabs(ydisplay - data->area.endpoints[0].ydisplay) < dd)
-				{
-				match = MB_YES;
-				match0 = MB_YES;
-				}
-			else if (fabs(xdisplay - data->area.endpoints[1].xdisplay) < dd
-				&& fabs(ydisplay - data->area.endpoints[1].ydisplay) < dd)
-				{
-				match = MB_YES;
-				match1 = MB_YES;
-				}
-			}
-
-		/* if no match then start new area */
-		if (match == MB_NO)
-			{
-			/* look for point */
-			mbview_findpoint(instance, xpixel, ypixel,
-					&found,
-					&xgrid, &ygrid,
-					&xlon, &ylat, &zdata,
-					&xdisplay, &ydisplay, &zdisplay);
-
-			/* use any good point */
-			if (found == MB_YES)
-				{
-				/* set the first endpoint */
-				data->area_type = MBV_AREA_ONEPOINT;
-				data->area_pickendpoint = MBV_AREA_PICKENDPOINT1;
-				data->area.endpoints[0].xgrid = xgrid;
-				data->area.endpoints[0].ygrid = ygrid;
-				data->area.endpoints[0].xlon = xlon;
-				data->area.endpoints[0].ylat = ylat;
-				data->area.endpoints[0].zdata = zdata;
-				data->area.endpoints[0].xdisplay = xdisplay;
-				data->area.endpoints[0].ydisplay = ydisplay;
-				data->area.endpoints[0].zdisplay = zdisplay;
-				}
-			}
-
-		/* else if match 0 then reset endpoint 0 */
-		else if (match0 == MB_YES)
-			{
-			/* look for point */
-			mbview_findpoint(instance, xpixel, ypixel,
-					&found,
-					&xgrid, &ygrid,
-					&xlon, &ylat, &zdata,
-					&xdisplay, &ydisplay, &zdisplay);
-
-			/* use any good point */
-			if (found == MB_YES)
-				{
-				/* set the first endpoint */
-				data->area_type = MBV_AREA_QUAD;
-				data->area_pickendpoint = MBV_AREA_PICKENDPOINT0;
-				data->area.endpoints[0].xgrid = xgrid;
-				data->area.endpoints[0].ygrid = ygrid;
-				data->area.endpoints[0].xlon = xlon;
-				data->area.endpoints[0].ylat = ylat;
-				data->area.endpoints[0].zdata = zdata;
-				data->area.endpoints[0].xdisplay = xdisplay;
-				data->area.endpoints[0].ydisplay = ydisplay;
-				data->area.endpoints[0].zdisplay = zdisplay;
-				}
-			}
-
-		/* else if match 1 then reset endpoint 1 */
-		else if (match1 == MB_YES)
-			{
-			/* look for point */
-			mbview_findpoint(instance, xpixel, ypixel,
-					&found,
-					&xgrid, &ygrid,
-					&xlon, &ylat, &zdata,
-					&xdisplay, &ydisplay, &zdisplay);
-
-			/* use any good point */
-			if (found == MB_YES)
-				{
-				/* set the first endpoint */
-				data->area_type = MBV_AREA_QUAD;
-				data->area_pickendpoint = MBV_AREA_PICKENDPOINT1;
-				data->area.endpoints[1].xgrid = xgrid;
-				data->area.endpoints[1].ygrid = ygrid;
-				data->area.endpoints[1].xlon = xlon;
-				data->area.endpoints[1].ylat = ylat;
-				data->area.endpoints[1].zdata = zdata;
-				data->area.endpoints[1].xdisplay = xdisplay;
-				data->area.endpoints[1].ydisplay = ydisplay;
-				data->area.endpoints[1].zdisplay = zdisplay;
-				}
-			}
-		}
-
-	/* deal with start of new area */
-	else if ((which == MBV_AREALENGTH_DOWN
-			|| which == MBV_AREALENGTH_MOVE)
-			&& data->area_type == MBV_AREA_NONE)
-		{
-		/* look for point */
-		mbview_findpoint(instance, xpixel, ypixel,
-				&found,
-				&xgrid, &ygrid,
-				&xlon, &ylat, &zdata,
-				&xdisplay, &ydisplay, &zdisplay);
-
-		/* use any good point */
-		if (found == MB_YES)
-			{
-			/* set the first endpoint */
-			data->area_type = MBV_AREA_ONEPOINT;
-			data->area_pickendpoint = MBV_AREA_PICKENDPOINT1;
-			data->area.endpoints[0].xgrid = xgrid;
-			data->area.endpoints[0].ygrid = ygrid;
-			data->area.endpoints[0].xlon = xlon;
-			data->area.endpoints[0].ylat = ylat;
-			data->area.endpoints[0].zdata = zdata;
-			data->area.endpoints[0].xdisplay = xdisplay;
-			data->area.endpoints[0].ydisplay = ydisplay;
-			data->area.endpoints[0].zdisplay = zdisplay;
-			}
-		}
-
-	/* deal with definition or change of first endpoint */
-	else if (which == MBV_AREALENGTH_MOVE
-		&& data->area_pickendpoint == MBV_AREA_PICKENDPOINT0)
-		{
-		/* look for point */
-		mbview_findpoint(instance, xpixel, ypixel,
-				&found,
-				&xgrid, &ygrid,
-				&xlon, &ylat, &zdata,
-				&xdisplay, &ydisplay, &zdisplay);
-
-		/* ignore an identical pair of points */
-		if (found == MB_YES
-			&& data->area.endpoints[1].xgrid == xgrid
-			&& data->area.endpoints[1].ygrid == ygrid)
-			{
-			data->area_type = MBV_AREA_ONEPOINT;
-			data->area_pickendpoint = MBV_AREA_PICKENDPOINT0;
-			XBell(view->dpy,100);
-			}
-
-		/* use any good pair of points */
-		else if (found == MB_YES)
-			{
-			/* set the second endpoint */
-			data->area_type = MBV_AREA_QUAD;
-			data->area_pickendpoint = MBV_AREA_PICKENDPOINT0;
-			data->area.endpoints[0].xgrid = xgrid;
-			data->area.endpoints[0].ygrid = ygrid;
-			data->area.endpoints[0].xlon = xlon;
-			data->area.endpoints[0].ylat = ylat;
-			data->area.endpoints[0].zdata = zdata;
-			data->area.endpoints[0].xdisplay = xdisplay;
-			data->area.endpoints[0].ydisplay = ydisplay;
-			data->area.endpoints[0].zdisplay = zdisplay;
-
-			}
-
-		/* ignore a bad point */
-		else if (found == MB_NO)
-			{
-			XBell(view->dpy,100);
-			}
-		}
-
-
-	/* deal with definition or change of second endpoint */
-	else if (which == MBV_AREALENGTH_MOVE
-		&& data->area_pickendpoint == MBV_AREA_PICKENDPOINT1)
-		{
-		/* look for point */
-		mbview_findpoint(instance, xpixel, ypixel,
-				&found,
-				&xgrid, &ygrid,
-				&xlon, &ylat, &zdata,
-				&xdisplay, &ydisplay, &zdisplay);
-
-		/* ignore an identical pair of points */
-		if (found == MB_YES
-			&& data->area.endpoints[0].xgrid == xgrid
-			&& data->area.endpoints[0].ygrid == ygrid)
-			{
-			data->area_type = MBV_AREA_ONEPOINT;
-			data->area_pickendpoint = MBV_AREA_PICKENDPOINT1;
-			XBell(view->dpy,100);
-			}
-
-		/* use any good pair of points */
-		else if (found == MB_YES)
-			{
-			/* set the second endpoint */
-			data->area_type = MBV_AREA_QUAD;
-			data->area_pickendpoint = MBV_AREA_PICKENDPOINT1;
-			data->area.endpoints[1].xgrid = xgrid;
-			data->area.endpoints[1].ygrid = ygrid;
-			data->area.endpoints[1].xlon = xlon;
-			data->area.endpoints[1].ylat = ylat;
-			data->area.endpoints[1].zdata = zdata;
-			data->area.endpoints[1].xdisplay = xdisplay;
-			data->area.endpoints[1].ydisplay = ydisplay;
-			data->area.endpoints[1].zdisplay = zdisplay;
-
-			}
-
-		/* ignore a bad point */
-		else if (found == MB_NO)
-			{
-			XBell(view->dpy,100);
-			}
-		}
-	/* recalculate any good quad area whether defined this time or previously
-		this catches which == MBV_AREAASPECT_CHANGE calls */
-	if (data->area_type == MBV_AREA_QUAD
-		&& which != MBV_AREALENGTH_UP
-		&& which != MBV_AREAASPECT_UP)
-		{
-		/* deal with non-spheroid case */
-		if (data->display_projection_mode != MBV_PROJECTION_SPHEROID)
-			{
-			/* now define the quad corners in display coordinates */
-			dx = data->area.endpoints[1].xdisplay
-				- data->area.endpoints[0].xdisplay;
-			dy = data->area.endpoints[1].ydisplay
-				- data->area.endpoints[0].ydisplay;
-			dxuse = 0.5 * view->areaaspect * dy;
-			dyuse = 0.5 * view->areaaspect * dx;
-
-			data->area.cornerpoints[0].xdisplay
-				= data->area.endpoints[0].xdisplay
-					- dxuse;
-			data->area.cornerpoints[0].ydisplay
-				= data->area.endpoints[0].ydisplay
-					+ dyuse;
-			data->area.cornerpoints[1].xdisplay
-				= data->area.endpoints[0].xdisplay
-					+ dxuse;
-			data->area.cornerpoints[1].ydisplay
-				= data->area.endpoints[0].ydisplay
-					- dyuse;
-			data->area.cornerpoints[2].xdisplay
-				= data->area.endpoints[1].xdisplay
-					+ dxuse;
-			data->area.cornerpoints[2].ydisplay
-				= data->area.endpoints[1].ydisplay
-					- dyuse;
-			data->area.cornerpoints[3].xdisplay
-				= data->area.endpoints[1].xdisplay
-					- dxuse;
-			data->area.cornerpoints[3].ydisplay
-				= data->area.endpoints[1].ydisplay
-					+ dyuse;
-
-			/* calculate width and length */
-			data->area.length = sqrt(dx * dx + dy * dy) / view->scale;
-			data->area.width = view->areaaspect * data->area.length;
-			data->area.bearing = RTD * atan2(dx, dy);
-			if (data->area.bearing < 0.0)
-				data->area.bearing += 360.0;
-			if (data->area.bearing > 360.0)
-				data->area.bearing -= 360.0;
-
-			/* set pick info */
-			data->pickinfo_mode = MBV_PICK_AREA;
-
-			/* reset segment endpoints */
-			for (i=0;i<2;i++)
-				{
-				data->area.segment.endpoints[i] = data->area.endpoints[i];
-				}
-			for (i=0;i<4;i++)
-				{
-				k = i + 1;
-				if (k > 3) k = 0;
-				data->area.segments[i].endpoints[0] = data->area.cornerpoints[i];
-				data->area.segments[i].endpoints[1] = data->area.cornerpoints[k];
-				}
-
-			/* now project the segment endpoints */
-			for (i=0;i<4;i++)
-				{
-				for (j=0;j<2;j++)
-					{
-					mbview_projectinverse(instance, MB_YES,
-							data->area.segments[i].endpoints[j].xdisplay,
-							data->area.segments[i].endpoints[j].ydisplay,
-							data->area.segments[i].endpoints[j].zdisplay,
-							&(data->area.segments[i].endpoints[j].xlon),
-							&(data->area.segments[i].endpoints[j].ylat),
-							&(data->area.segments[i].endpoints[j].xgrid),
-							&(data->area.segments[i].endpoints[j].ygrid));
-					mbview_getzdata(instance,
-							data->area.segments[i].endpoints[j].xgrid,
-							data->area.segments[i].endpoints[j].ygrid,
-							&ok,
-							&(data->area.segments[i].endpoints[j].zdata));
-					if (ok == MB_NO &&
-						(   (i == 0)
-						 || (i == 1 && j == 0)
-						 || (i == 3 && j == 1)))
-						data->area.segments[i].endpoints[j].zdata
-							= data->area.endpoints[0].zdata;
-					else if (ok == MB_NO)
-						data->area.segments[i].endpoints[j].zdata
-							= data->area.endpoints[1].zdata;
-					mbview_projectll2display(instance,
-						data->area.segments[i].endpoints[j].xlon,
-						data->area.segments[i].endpoints[j].ylat,
-						data->area.segments[i].endpoints[j].zdata ,
-						&data->area.segments[i].endpoints[j].xdisplay,
-						&data->area.segments[i].endpoints[j].ydisplay,
-						&data->area.segments[i].endpoints[j].zdisplay);
-					}
-				}
-			}
-
-		/* else deal with spheroid case */
-		else
-			{
-			/* now get length and bearing of center line */
-			mbview_greatcircle_distbearing(instance,
-				data->area.endpoints[0].xlon,
-				data->area.endpoints[0].ylat,
-				data->area.endpoints[1].xlon,
-				data->area.endpoints[1].ylat,
-				&data->area.bearing, &data->area.length);
-			data->area.width = view->areaaspect * data->area.length;
-
-			/* the corners of the area are defined by great
-				circle arcs perpendicular to the center line */
-
-			bearing = data->area.bearing - 90.0;
-			if (bearing < 0.0)
-				bearing += 360.0;
-			if (bearing > 360.0)
-				bearing -= 360.0;
-			mbview_greatcircle_endposition(instance,
-							data->area.endpoints[0].xlon,
-							data->area.endpoints[0].ylat,
-							bearing,
-							(0.5 * data->area.width),
-							&(data->area.cornerpoints[0].xlon),
-							&(data->area.cornerpoints[0].ylat)),
-			status = mbview_projectll2xyzgrid(instance,
-							data->area.cornerpoints[0].xlon,
-							data->area.cornerpoints[0].ylat,
-							&(data->area.cornerpoints[0].xgrid),
-							&(data->area.cornerpoints[0].ygrid),
-							&(data->area.cornerpoints[0].zdata));
-			status = mbview_projectll2display(instance,
-							data->area.cornerpoints[0].xlon,
-							data->area.cornerpoints[0].ylat,
-							data->area.cornerpoints[0].zdata ,
-							&data->area.cornerpoints[0].xdisplay,
-							&data->area.cornerpoints[0].ydisplay,
-							&data->area.cornerpoints[0].zdisplay);
-
-			bearing = data->area.bearing + 90.0;
-			if (bearing < 0.0)
-				bearing += 360.0;
-			if (bearing > 360.0)
-				bearing -= 360.0;
-			mbview_greatcircle_endposition(instance,
-							data->area.endpoints[0].xlon,
-							data->area.endpoints[0].ylat,
-							bearing,
-							(0.5 * data->area.width),
-							&(data->area.cornerpoints[1].xlon),
-							&(data->area.cornerpoints[1].ylat)),
-			status = mbview_projectll2xyzgrid(instance,
-							data->area.cornerpoints[1].xlon,
-							data->area.cornerpoints[1].ylat,
-							&(data->area.cornerpoints[1].xgrid),
-							&(data->area.cornerpoints[1].ygrid),
-							&(data->area.cornerpoints[1].zdata));
-			status = mbview_projectll2display(instance,
-							data->area.cornerpoints[1].xlon,
-							data->area.cornerpoints[1].ylat,
-							data->area.cornerpoints[1].zdata ,
-							&data->area.cornerpoints[1].xdisplay,
-							&data->area.cornerpoints[1].ydisplay,
-							&data->area.cornerpoints[1].zdisplay);
-
-			bearing = data->area.bearing + 90.0;
-			if (bearing < 0.0)
-				bearing += 360.0;
-			if (bearing > 360.0)
-				bearing -= 360.0;
-			mbview_greatcircle_endposition(instance,
-							data->area.endpoints[1].xlon,
-							data->area.endpoints[1].ylat,
-							bearing,
-							(0.5 * data->area.width),
-							&(data->area.cornerpoints[2].xlon),
-							&(data->area.cornerpoints[2].ylat)),
-			status = mbview_projectll2xyzgrid(instance,
-							data->area.cornerpoints[2].xlon,
-							data->area.cornerpoints[2].ylat,
-							&(data->area.cornerpoints[2].xgrid),
-							&(data->area.cornerpoints[2].ygrid),
-							&(data->area.cornerpoints[2].zdata));
-			status = mbview_projectll2display(instance,
-							data->area.cornerpoints[2].xlon,
-							data->area.cornerpoints[2].ylat,
-							data->area.cornerpoints[2].zdata ,
-							&data->area.cornerpoints[2].xdisplay,
-							&data->area.cornerpoints[2].ydisplay,
-							&data->area.cornerpoints[2].zdisplay);
-
-			bearing = data->area.bearing - 90.0;
-			if (bearing < 0.0)
-				bearing += 360.0;
-			if (bearing > 360.0)
-				bearing -= 360.0;
-			mbview_greatcircle_endposition(instance,
-							data->area.endpoints[1].xlon,
-							data->area.endpoints[1].ylat,
-							bearing,
-							(0.5 * data->area.width),
-							&(data->area.cornerpoints[3].xlon),
-							&(data->area.cornerpoints[3].ylat)),
-			status = mbview_projectll2xyzgrid(instance,
-							data->area.cornerpoints[3].xlon,
-							data->area.cornerpoints[3].ylat,
-							&(data->area.cornerpoints[3].xgrid),
-							&(data->area.cornerpoints[3].ygrid),
-							&(data->area.cornerpoints[3].zdata));
-			status = mbview_projectll2display(instance,
-							data->area.cornerpoints[3].xlon,
-							data->area.cornerpoints[3].ylat,
-							data->area.cornerpoints[3].zdata ,
-							&data->area.cornerpoints[3].xdisplay,
-							&data->area.cornerpoints[3].ydisplay,
-							&data->area.cornerpoints[3].zdisplay);
-
-			/* set pick info */
-			data->pickinfo_mode = MBV_PICK_AREA;
-
-			/* reset segment endpoints */
-			for (i=0;i<2;i++)
-				{
-				data->area.segment.endpoints[i] = data->area.endpoints[i];
-				}
-			for (i=0;i<4;i++)
-				{
-				k = i + 1;
-				if (k > 3) k = 0;
-				data->area.segments[i].endpoints[0] = data->area.cornerpoints[i];
-				data->area.segments[i].endpoints[1] = data->area.cornerpoints[k];
-				}
-
-			/* now project the segment endpoints */
-			for (i=0;i<4;i++)
-				{
-				for (j=0;j<2;j++)
-					{
-					mbview_getzdata(instance,
-							data->area.segments[i].endpoints[j].xgrid,
-							data->area.segments[i].endpoints[j].ygrid,
-							&ok,
-							&(data->area.segments[i].endpoints[j].zdata));
-					if (ok == MB_NO &&
-						(   (i == 0)
-						 || (i == 1 && j == 0)
-						 || (i == 3 && j == 1)))
-						data->area.segments[i].endpoints[j].zdata
-							= data->area.endpoints[0].zdata;
-					else if (ok == MB_NO)
-						data->area.segments[i].endpoints[j].zdata
-							= data->area.endpoints[1].zdata;
-					mbview_projectll2display(instance,
-						data->area.segments[i].endpoints[j].xlon,
-						data->area.segments[i].endpoints[j].ylat,
-						data->area.segments[i].endpoints[j].zdata ,
-						&data->area.segments[i].endpoints[j].xdisplay,
-						&data->area.segments[i].endpoints[j].ydisplay,
-						&data->area.segments[i].endpoints[j].zdisplay);
-					}
-				}
-			}
-
-		/* set pick annotation */
-		mbview_pick_text(instance);
-		}
-
-	/* now set and drape the segments
-		if either 3D display
-		or the pick move is final  */
-	if (data->area_type == MBV_AREA_QUAD
-		&& (data->display_mode == MBV_DISPLAY_3D
-			|| which == MBV_AREALENGTH_UP
-			|| which == MBV_AREAASPECT_UP))
-		{
-		mbview_drapesegment(instance, &(data->area.segment));
-		for (i=0;i<4;i++)
-			{
-			/* drape the segment */
-			mbview_drapesegment(instance, &(data->area.segments[i]));
-			}
-		}
-
-	/* call pick notify if defined */
-	if ((which == MBV_AREALENGTH_UP || which == MBV_AREAASPECT_UP)
-		&& data->area_type == MBV_AREA_QUAD
-		&& data->mbview_pickarea_notify != NULL)
-		{
-		(data->mbview_pickarea_notify)(instance);
-		}
-
-	/* print output debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:          %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-/*------------------------------------------------------------------------------*/
-int mbview_drawpick(size_t instance)
-{
-	/* local variables */
-	char	*function_name = "mbview_drawpick";
-	int	status = MB_SUCCESS;
-	int	i;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-	double	xlength;
-
-	/* print starting debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       instance:         %zu\n",instance);
-		}
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* draw current pick */
-	if (data->pick_type != MBV_PICK_NONE)
-		{
-		/* set size of X mark for 2D case */
-		if (data->display_mode == MBV_DISPLAY_2D)
-			xlength = 0.05 / view->size2d;
-
-		/* set color and linewidth */
-		glColor3f(1.0, 0.0, 0.0);
-		glLineWidth(3.0);
-
-		/* plot first pick point */
-		if (data->display_mode == MBV_DISPLAY_3D
-			&& data->pick.xsegments[0].nls > 0
-			&& data->pick.xsegments[1].nls > 0)
-			{
-			glBegin(GL_LINE_STRIP);
-			for (i=0;i<data->pick.xsegments[0].nls;i++)
-				{
-				glVertex3f((float)(data->pick.xsegments[0].lspoints[i].xdisplay),
-						(float)(data->pick.xsegments[0].lspoints[i].ydisplay),
-						(float)(data->pick.xsegments[0].lspoints[i].zdisplay));
-				}
-			glEnd();
-			glBegin(GL_LINE_STRIP);
-			for (i=0;i<data->pick.xsegments[1].nls;i++)
-				{
-				glVertex3f((float)(data->pick.xsegments[1].lspoints[i].xdisplay),
-						(float)(data->pick.xsegments[1].lspoints[i].ydisplay),
-						(float)(data->pick.xsegments[1].lspoints[i].zdisplay));
-				}
-			glEnd();
-			}
-		else if (data->display_mode == MBV_DISPLAY_3D)
-			{
-			glBegin(GL_LINES);
-			for (i=0;i<4;i++)
-				{
-				glVertex3f((float)(data->pick.xpoints[i].xdisplay),
-					(float)(data->pick.xpoints[i].ydisplay),
-					(float)(data->pick.xpoints[i].zdisplay));
-				}
-			glEnd();
-			}
-		else
-			{
-			glBegin(GL_LINES);
-			glVertex3f((float)(data->pick.endpoints[0].xdisplay - xlength),
-				(float)(data->pick.endpoints[0].ydisplay - xlength),
-				(float)(data->pick.endpoints[0].zdisplay));
-			glVertex3f((float)(data->pick.endpoints[0].xdisplay + xlength),
-				(float)(data->pick.endpoints[0].ydisplay + xlength),
-				(float)(data->pick.endpoints[0].zdisplay));
-			glVertex3f((float)(data->pick.endpoints[0].xdisplay + xlength),
-				(float)(data->pick.endpoints[0].ydisplay - xlength),
-				(float)(data->pick.endpoints[0].zdisplay));
-			glVertex3f((float)(data->pick.endpoints[0].xdisplay - xlength),
-				(float)(data->pick.endpoints[0].ydisplay + xlength),
-				(float)(data->pick.endpoints[0].zdisplay));
-			glEnd();
-			}
-
-		if (data->pick_type == MBV_PICK_TWOPOINT)
-			{
-			/* plot second pick point */
-			if (data->display_mode == MBV_DISPLAY_3D
-				&& data->pick.xsegments[2].nls > 0
-				&& data->pick.xsegments[3].nls > 0)
-				{
-				glBegin(GL_LINE_STRIP);
-				for (i=0;i<data->pick.xsegments[2].nls;i++)
-					{
-					glVertex3f((float)(data->pick.xsegments[2].lspoints[i].xdisplay),
-							(float)(data->pick.xsegments[2].lspoints[i].ydisplay),
-							(float)(data->pick.xsegments[2].lspoints[i].zdisplay));
-					}
-				glEnd();
-				glBegin(GL_LINE_STRIP);
-				for (i=0;i<data->pick.xsegments[3].nls;i++)
-					{
-					glVertex3f((float)(data->pick.xsegments[3].lspoints[i].xdisplay),
-							(float)(data->pick.xsegments[3].lspoints[i].ydisplay),
-							(float)(data->pick.xsegments[3].lspoints[i].zdisplay));
-					}
-				glEnd();
-				}
-			else if (data->display_mode == MBV_DISPLAY_3D)
-				{
-				glBegin(GL_LINES);
-				for (i=4;i<8;i++)
-					{
-					glVertex3f((float)(data->pick.xpoints[i].xdisplay),
-						(float)(data->pick.xpoints[i].ydisplay),
-						(float)(data->pick.xpoints[i].zdisplay));
-					}
-				glEnd();
-				}
-			else
-				{
-				glBegin(GL_LINES);
-				glVertex3f((float)(data->pick.endpoints[1].xdisplay - xlength),
-					(float)(data->pick.endpoints[1].ydisplay - xlength),
-					(float)(data->pick.endpoints[1].zdisplay));
-				glVertex3f((float)(data->pick.endpoints[1].xdisplay + xlength),
-					(float)(data->pick.endpoints[1].ydisplay + xlength),
-					(float)(data->pick.endpoints[1].zdisplay));
-				glVertex3f((float)(data->pick.endpoints[1].xdisplay + xlength),
-					(float)(data->pick.endpoints[1].ydisplay - xlength),
-					(float)(data->pick.endpoints[1].zdisplay));
-				glVertex3f((float)(data->pick.endpoints[1].xdisplay - xlength),
-					(float)(data->pick.endpoints[1].ydisplay + xlength),
-					(float)(data->pick.endpoints[1].zdisplay));
-				glEnd();
-				}
-
-			/* plot line segment between pick points */
-			if (data->display_mode == MBV_DISPLAY_3D
-				&& data->pick.segment.nls > 0)
-				{
-				glBegin(GL_LINE_STRIP);
-				for (i=0;i<data->pick.segment.nls;i++)
-					{
-					glVertex3f((float)(data->pick.segment.lspoints[i].xdisplay),
-							(float)(data->pick.segment.lspoints[i].ydisplay),
-							(float)(data->pick.segment.lspoints[i].zdisplay));
-					}
-				glEnd();
-				}
-			else
-				{
-				glBegin(GL_LINES);
-				glVertex3f((float)(data->pick.endpoints[0].xdisplay),
-						(float)(data->pick.endpoints[0].ydisplay),
-						(float)(data->pick.endpoints[0].zdisplay));
-				glVertex3f((float)(data->pick.endpoints[1].xdisplay),
-						(float)(data->pick.endpoints[1].ydisplay),
-						(float)(data->pick.endpoints[1].zdisplay));
-				glEnd();
-				}
-			}
-		}
-#ifdef MBV_GETERRORS
-mbview_glerrorcheck(instance, 1, function_name);
-#endif
-
-	/* print output debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-
-/*------------------------------------------------------------------------------*/
-int mbview_drawregion(size_t instance)
-{
-	/* local variables */
-	char	*function_name = "mbview_drawregion";
-	int	status = MB_SUCCESS;
-	int	i, j;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-
-	/* print starting debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       instance:         %zu\n",instance);
-		}
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* draw current area */
-	if (data->region_type == MBV_REGION_QUAD)
-		{
-		/* set color and linewidth */
-		glColor3f(colortable_object_red[MBV_COLOR_YELLOW],
-				colortable_object_green[MBV_COLOR_YELLOW],
-				colortable_object_blue[MBV_COLOR_YELLOW]);
-		glLineWidth(3.0);
-
-		/* plot quad segments */
-		for (i=0;i<4;i++)
-			{
-			if (data->display_mode == MBV_DISPLAY_3D
-				&& data->region.segments[i].nls > 2)
-				{
-				glBegin(GL_LINE_STRIP);
-				for (j=0;j<data->region.segments[i].nls-1;j++)
-					{
-					glVertex3f((float)(data->region.segments[i].lspoints[j].xdisplay),
-							(float)(data->region.segments[i].lspoints[j].ydisplay),
-							(float)(data->region.segments[i].lspoints[j].zdisplay));
-					}
-				glEnd();
-				}
-			else
-				{
-				glBegin(GL_LINES);
-				glVertex3f((float)(data->region.segments[i].endpoints[0].xdisplay),
-						(float)(data->region.segments[i].endpoints[0].ydisplay),
-						(float)(data->region.segments[i].endpoints[0].zdisplay));
-				glVertex3f((float)(data->region.segments[i].endpoints[1].xdisplay),
-						(float)(data->region.segments[i].endpoints[1].ydisplay),
-						(float)(data->region.segments[i].endpoints[1].zdisplay));
-				glEnd();
-#ifdef MBV_GETERRORS
-mbview_glerrorcheck(instance, 1, function_name);
-#endif
-				}
-			}
-		}
-
-	/* print output debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-
-
-/*------------------------------------------------------------------------------*/
-int mbview_drawarea(size_t instance)
-{
-	/* local variables */
-	char	*function_name = "mbview_drawarea";
-	int	status = MB_SUCCESS;
-	int	i, j;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-
-	/* print starting debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       instance:         %zu\n",instance);
-		}
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* draw current area */
-	if (data->area_type == MBV_AREA_QUAD)
-		{
-		/* set color and linewidth */
-		glColor3f(colortable_object_red[MBV_COLOR_YELLOW],
-				colortable_object_green[MBV_COLOR_YELLOW],
-				colortable_object_blue[MBV_COLOR_YELLOW]);
-		glLineWidth(3.0);
-
-		/* plot center segment */
-		if (data->display_mode == MBV_DISPLAY_3D
-				&& data->area.segment.nls > 2)
-			{
-			glBegin(GL_LINE_STRIP);
-			for (j=0;j<data->area.segment.nls;j++)
-				{
-				glVertex3f((float)(data->area.segment.lspoints[j].xdisplay),
-						(float)(data->area.segment.lspoints[j].ydisplay),
-						(float)(data->area.segment.lspoints[j].zdisplay));
-				}
-			glEnd();
-#ifdef MBV_GETERRORS
-mbview_glerrorcheck(instance, 1, function_name);
-#endif
-			}
-		else
-			{
-			glBegin(GL_LINES);
-			glVertex3f((float)(data->area.segment.endpoints[0].xdisplay),
-					(float)(data->area.segment.endpoints[0].ydisplay),
-					(float)(data->area.segment.endpoints[0].zdisplay));
-			glVertex3f((float)(data->area.segment.endpoints[1].xdisplay),
-					(float)(data->area.segment.endpoints[1].ydisplay),
-					(float)(data->area.segment.endpoints[1].zdisplay));
-			glEnd();
-#ifdef MBV_GETERRORS
-mbview_glerrorcheck(instance, 1, function_name);
-#endif
-			}
-
-		/* plot quad segments */
-		for (i=0;i<4;i++)
-			{
-			if (data->display_mode == MBV_DISPLAY_3D
-				&& data->area.segments[i].nls > 2)
-				{
-				glBegin(GL_LINE_STRIP);
-				for (j=0;j<data->area.segments[i].nls-1;j++)
-					{
-					glVertex3f((float)(data->area.segments[i].lspoints[j].xdisplay),
-							(float)(data->area.segments[i].lspoints[j].ydisplay),
-							(float)(data->area.segments[i].lspoints[j].zdisplay));
-					}
-				glEnd();
-#ifdef MBV_GETERRORS
-mbview_glerrorcheck(instance, 1, function_name);
-#endif
-				}
-			else
-				{
-				glBegin(GL_LINES);
-				glVertex3f((float)(data->area.segments[i].endpoints[0].xdisplay),
-						(float)(data->area.segments[i].endpoints[0].ydisplay),
-						(float)(data->area.segments[i].endpoints[0].zdisplay));
-				glVertex3f((float)(data->area.segments[i].endpoints[1].xdisplay),
-						(float)(data->area.segments[i].endpoints[1].ydisplay),
-						(float)(data->area.segments[i].endpoints[1].zdisplay));
-				glEnd();
-#ifdef MBV_GETERRORS
-mbview_glerrorcheck(instance, 1, function_name);
-#endif
-				}
-			}
-		}
-#ifdef MBV_GETERRORS
-mbview_glerrorcheck(instance, 1, function_name);
-#endif
-
-	/* print output debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-
-/*------------------------------------------------------------------------------*/
diff --git a/src/mbview/mbview_plot.c b/src/mbview/mbview_plot.c
deleted file mode 100644
index 193ad3b..0000000
--- a/src/mbview/mbview_plot.c
+++ /dev/null
@@ -1,3530 +0,0 @@
-/*------------------------------------------------------------------------------
- *    The MB-system:	mbview_plot.c	9/26/2003
- *    $Id: mbview_plot.c 2239 2015-05-07 00:51:42Z caress $
- *
- *    Copyright (c) 2003-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *------------------------------------------------------------------------------*/
-/*
- *
- * Author:	D. W. Caress
- * Date:	September 25, 2003
- *
- * Note:	This code was broken out of mbview_callbacks.c, which was
- *		begun on October 7, 2002
- *
- * $Log: mbview_plot.c,v $
- * Revision 5.14  2008/05/16 22:59:42  caress
- * Release 5.1.1beta18.
- *
- * Revision 5.13  2008/03/14 19:04:32  caress
- * Fixed memory problems with route editing.
- *
- * Revision 5.12  2007/10/08 16:32:08  caress
- * Code status as of 8 October 2007.
- *
- * Revision 5.11  2007/06/17 23:27:30  caress
- * Added NBeditviz.
- *
- * Revision 5.10  2006/10/05 18:58:29  caress
- * Changes for 5.1.0beta4
- *
- * Revision 5.9  2006/07/05 19:50:21  caress
- * Working towards 5.1.0beta
- *
- * Revision 5.8  2006/06/16 19:30:58  caress
- * Check in after the Santa Monica Basin Mapping AUV Expedition.
- *
- * Revision 5.7  2006/01/24 19:21:32  caress
- * Version 5.0.8 beta.
- *
- * Revision 5.6  2005/11/05 01:11:47  caress
- * Much work over the past two months.
- *
- * Revision 5.5  2005/02/18 07:32:55  caress
- * Fixed nav display and button sensitivity.
- *
- * Revision 5.4  2005/02/08 22:37:42  caress
- * Heading towards 5.0.6 release.
- *
- * Revision 5.2  2004/02/24 22:52:29  caress
- * Added spherical projection to MBview.
- *
- * Revision 5.1  2004/01/06 21:11:04  caress
- * Added pick region capability.
- *
- * Revision 5.0  2003/12/02 20:38:33  caress
- * Making version number 5.0
- *
- * Revision 1.2  2003/11/25 01:43:18  caress
- * MBview version generated during EW0310.
- *
- *
- */
-/*------------------------------------------------------------------------------*/
-
-/* Standard includes for builtins. */
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include <math.h>
-
-/* Motif required Headers */
-#include <X11/StringDefs.h>
-#include <X11/cursorfont.h>
-#include <Xm/Xm.h>
-#include <Xm/MainW.h>
-#include <Xm/DialogS.h>
-#include <Xm/RepType.h>
-#include <Xm/MwmUtil.h>
-#include <Xm/BulletinB.h>
-#include <Xm/RowColumn.h>
-#include <Xm/CascadeB.h>
-#include <Xm/PushB.h>
-#include <Xm/Separator.h>
-#include "MB3DView.h"
-#include "MB3DSiteList.h"
-#include "MB3DRouteList.h"
-#include "MB3DNavList.h"
-
-/* OpenGL include files */
-#ifdef WIN32
-#undef BOOL		/* It was defined by a chain of inclusions in the (patched) X11/Xmd.h */
-#include <windows.h>
-#endif
-
-#include <GL/gl.h>
-#include <GL/glu.h>
-#ifndef WIN32
-#	include <GL/glx.h>
-#endif
-#include "mb_glwdrawa.h"
-
-/* MBIO include files */
-#include "mb_status.h"
-#include "mb_define.h"
-
-/* mbview include */
-#include "mbview.h"
-#include "mbviewprivate.h"
-
-/*------------------------------------------------------------------------------*/
-
-/* local variables */
-static Cardinal 	ac;
-static Arg      	args[256];
-
-static char rcs_id[]="$Id: mbview_plot.c 2239 2015-05-07 00:51:42Z caress $";
-
-/*------------------------------------------------------------------------------*/
-int mbview_reset_glx(size_t instance)
-{
-	/* local variables */
-	char	*function_name = "mbview_reset_glx";
-	int	status = MB_SUCCESS;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-
-	/* print starting debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       instance:         %zu\n",instance);
-		}
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* delete old glx_context if it exists */
-	if (view->glx_init == MB_YES)
-		{
-#ifdef MBV_DEBUG_GLX
-fprintf(stderr,"%s:%d:%s instance:%zu glXMakeCurrent(%p,%p,%p)\n",
-__FILE__,__LINE__,function_name,instance,view->dpy,XtWindow(view->glwmda),view->glx_context);
-#endif
-		glXMakeCurrent(view->dpy,XtWindow(view->glwmda),view->glx_context);
-#ifdef MBV_DEBUG_GLX
-fprintf(stderr,"%s:%d:%s instance:%zu glXDestroyContext(%p,%p,%p)\n",
-__FILE__,__LINE__,function_name,instance,view->dpy,XtWindow(view->glwmda),view->glx_context);
-#endif
-		glXDestroyContext(view->dpy, view->glx_context);
-		view->glx_init = MB_NO;
-
-#ifdef MBV_GET_GLX_ERRORS
-mbview_glerrorcheck(instance, __FILE__, __LINE__, function_name);
-#endif
-		}
-
-	/* set up a new opengl context */
-	ac = 0;
-	XtSetArg(args[ac], mbGLwNvisualInfo, &(view->vi));
-	ac++;
-	XtGetValues(view->glwmda, args, ac);
-#ifdef MBV_DEBUG_GLX
-fprintf(stderr,"%s:%d:%s instance:%zu glXCreateContext(%p,%p)\n",
-__FILE__,__LINE__,function_name,instance,view->dpy,view->vi);
-#endif
-	view->glx_context = glXCreateContext(view->dpy, view->vi,
-                	     NULL, GL_TRUE);
-#ifdef MBV_DEBUG_GLX
-fprintf(stderr,"%s:%d:%s instance:%zu glXMakeCurrent(%p,%p,%p)\n",
-__FILE__,__LINE__,function_name,instance,view->dpy,XtWindow(view->glwmda),view->glx_context);
-#endif
-	glXMakeCurrent(view->dpy,XtWindow(view->glwmda),view->glx_context);
-	view->glx_init = MB_YES;
-        glViewport(0, 0, data->width, data->height);
-	view->aspect_ratio = ((float)data->width) / ((float)data->height);
-	view->lastdrawrez = MBV_REZ_NONE;
-	view->contourlorez = MB_NO;
-	view->contourhirez = MB_NO;
-	view->contourfullrez = MB_NO;
-
-#ifdef MBV_GET_GLX_ERRORS
-mbview_glerrorcheck(instance, __FILE__, __LINE__, function_name);
-#endif
-
-	/* print output debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		fprintf(stderr,"dbg2       view->dpy:             %p\n", view->dpy);
-		fprintf(stderr,"dbg2       view->vi:              %p\n", view->vi);
-		fprintf(stderr,"dbg2       view->glwmda:          %p\n", view->glwmda);
-		fprintf(stderr,"dbg2       view->glx_context:     %p\n", view->glx_context);
-		fprintf(stderr,"dbg2       view->glx_init:        %d\n", view->glx_init);
-		fprintf(stderr,"dbg2       view->lastdrawrez:     %d\n", view->lastdrawrez);
-		fprintf(stderr,"dbg2       view->contourlorez:    %d\n", view->contourlorez);
-		fprintf(stderr,"dbg2       view->contourhirez:    %d\n", view->contourhirez);
-		fprintf(stderr,"dbg2       view->contourfullrez:  %d\n", view->contourfullrez);
-		}
-
-	/* return */
-	return(status);
-}
-
-
-/*------------------------------------------------------------------------------*/
-int mbview_drawdata(size_t instance, int rez)
-{
-	/* local variables */
-	char	*function_name = "mbview_drawdata";
-	int	status = MB_SUCCESS;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-	int	on, flip;
-	int	nxrange, nyrange;
-	int	stride;
-	int	use_histogram;
-	int	make_histogram;
-	float	*histogram;
-	int	which_data;
-	int	i, j, k, l, ikk, ill, kk, ll;
-
-	/* print starting debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       instance:         %zu\n",instance);
-		fprintf(stderr,"dbg2       rez:              %d\n",rez);
-		}
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* get size of grid in view */
-	nxrange = data->viewbounds[1] - data->viewbounds[0] + 1;
-	nyrange = data->viewbounds[3] - data->viewbounds[2] + 1;
-
-	/* set stride for looping over data */
-	if (rez == MBV_REZ_FULL)
-	    stride = 1;
-	else if (rez == MBV_REZ_HIGH)
-	    stride = MAX((int)ceil(((double)nxrange)
-				/ ((double)data->hirez_dimension)),
-			(int)ceil(((double)nyrange)
-				/ ((double)data->hirez_dimension)));
-	else
-	    stride = MAX((int)ceil(((double)nxrange)
-				/ ((double)data->lorez_dimension)),
-			(int)ceil(((double)nyrange)
-				/ ((double)data->lorez_dimension)));
-
-	/* enable depth test for 3D plots */
-	if (data->display_mode == MBV_DISPLAY_3D
-		|| data->display_projection_mode == MBV_PROJECTION_SPHEROID)
-		glEnable(GL_DEPTH_TEST);
-#ifdef MBV_GET_GLX_ERRORS
-mbview_glerrorcheck(instance, __FILE__, __LINE__, function_name);
-#endif
-
-	/* set color parameters */
-	mbview_setcolorparms(instance);
-
-	/* calculate histogram equalization if needed */
-	make_histogram = MB_NO;
-	use_histogram = MB_NO;
-	if (data->grid_mode == MBV_GRID_VIEW_PRIMARY
-		&& data->primary_histogram == MB_YES)
-		{
-		use_histogram = MB_YES;
-		if (view->primary_histogram_set == MB_NO)
-			{
-			make_histogram = MB_YES;
-			which_data = MBV_DATA_PRIMARY;
-			}
-		histogram = view->primary_histogram;
-		}
-	else if (data->grid_mode == MBV_GRID_VIEW_PRIMARYSLOPE
-		&& data->primaryslope_histogram == MB_YES)
-		{
-		use_histogram = MB_YES;
-		if (view->primaryslope_histogram_set == MB_NO)
-			{
-			make_histogram = MB_YES;
-			which_data = MBV_DATA_PRIMARYSLOPE;
-			}
-		histogram = view->primaryslope_histogram;
-		}
-	else if (data->grid_mode == MBV_GRID_VIEW_SECONDARY
-		&& data->secondary_histogram == MB_YES)
-		{
-		use_histogram = MB_YES;
-		if (view->secondary_histogram_set == MB_NO)
-			{
-			make_histogram = MB_YES;
-			which_data = MBV_DATA_SECONDARY;
-			}
-		histogram = view->secondary_histogram;
-		}
-	if (make_histogram == MB_YES)
-		mbview_make_histogram(view, data, which_data);
-	if (view->shade_mode == MBV_SHADE_VIEW_OVERLAY
-		&& data->secondary_histogram == MB_YES
-		&& view->secondary_histogram_set == MB_NO)
-		mbview_make_histogram(view, data, MBV_DATA_SECONDARY);
-
-/*fprintf(stderr,"mbview_drawdata: %d %d stride:%d\n", instance,rez,stride);*/
-
-	/* draw the triangle outlines */
-	/*
-	glColor3f(1.0, 0.0, 0.0);
-	for (i=0;i<data->primary_nx-1;i++)
-	{
-	for (j=0;j<data->primary_ny-1;j++)
-		{
-		k = i * data->primary_ny + j;
-		l = (i + 1) * data->primary_ny + j;
-		m = i * data->primary_ny + j + 1;
-		n = (i + 1) * data->primary_ny + j + 1;
-		if (data->primary_data[k] != data->primary_nodatavalue
-			&& data->primary_data[l] != data->primary_nodatavalue
-			&& data->primary_data[m] != data->primary_nodatavalue)
-			{
-			glBegin(GL_LINE_LOOP);
-			glVertex3f(data->primary_x[k],
-				data->primary_y[k],
-				data->primary_z[k]);
-			glVertex3f(data->primary_x[l],
-				data->primary_y[l],
-				data->primary_z[l]);
-			glVertex3f(data->primary_x[m],
-				data->primary_y[m],
-				data->primary_z[m]);
-			glEnd();
-			}
-		if (data->primary_data[l] != data->primary_nodatavalue
-			&& data->primary_data[m] != data->primary_nodatavalue
-			&& data->primary_data[n] != data->primary_nodatavalue)
-			{
-			glBegin(GL_LINE_LOOP);
-			glVertex3f(data->primary_x[l],
-				data->primary_y[l],
-				data->primary_z[l]);
-			glVertex3f(data->primary_x[n],
-				data->primary_y[n],
-				data->primary_z[n]);
-			glVertex3f(data->primary_x[m],
-				data->primary_y[m],
-				data->primary_z[m]);
-			glEnd();
-			}
-		}
-	}
-	*/
-
-	/* draw the triangles */
-	/*glBegin(GL_TRIANGLES);
-	for (i=0;i<data->primary_nx-stride;i+=stride)
-	{
-	for (j=0;j<data->primary_ny-stride;j+=stride)
-		{
-		k = i * data->primary_ny + j;
-		l = (i + stride) * data->primary_ny + j;
-		m = i * data->primary_ny + j + stride;
-		n = (i + stride) * data->primary_ny + j + stride;
-		if (data->primary_data[k] != data->primary_nodatavalue
-			&& data->primary_data[l] != data->primary_nodatavalue
-			&& data->primary_data[m] != data->primary_nodatavalue)
-			{
-			glColor3f(data->primary_r[k],
-				data->primary_g[k],
-				data->primary_b[k]);
-			glVertex3f(data->primary_x[k],
-				data->primary_y[k],
-				data->primary_z[k]);
-			glColor3f(data->primary_r[l],
-				data->primary_g[l],
-				data->primary_b[l]);
-			glVertex3f(data->primary_x[l],
-				data->primary_y[l],
-				data->primary_z[l]);
-			glColor3f(data->primary_r[m],
-				data->primary_g[m],
-				data->primary_b[m]);
-			glVertex3f(data->primary_x[m],
-				data->primary_y[m],
-				data->primary_z[m]);
-			}
-		if (data->primary_data[l] != data->primary_nodatavalue
-			&& data->primary_data[m] != data->primary_nodatavalue
-			&& data->primary_data[n] != data->primary_nodatavalue)
-			{
-			glColor3f(data->primary_r[l],
-				data->primary_g[l],
-				data->primary_b[l]);
-			glVertex3f(data->primary_x[l],
-				data->primary_y[l],
-				data->primary_z[l]);
-			glColor3f(data->primary_r[n],
-				data->primary_g[n],
-				data->primary_b[n]);
-			glVertex3f(data->primary_x[n],
-				data->primary_y[n],
-				data->primary_z[n]);
-			glColor3f(data->primary_r[m],
-				data->primary_g[m],
-				data->primary_b[m]);
-			glVertex3f(data->primary_x[m],
-				data->primary_y[m],
-				data->primary_z[m]);
-			}
-		} */
-
-	/* check for pending event */
-
-	/*if (view->plot_done == MB_NO
-		&& view->plot_interrupt_allowed == MB_YES
-		&& i % MBV_EVENTCHECKCOARSENESS == 0)
-		do_mbview_xevents();*/
-
-	/* dump out of loop if plotting already done at a higher recursion */
-
-	/*if (view->plot_done == MB_YES)
-		i = data->primary_nx;
-	}
-	glEnd();*/
-
-	/* draw the data as triangle strips */
-	for (i=data->viewbounds[0];i<data->viewbounds[1]-stride;i+=stride)
-	{
-	on = MB_NO;
-	flip = MB_NO;
-	for (j=data->viewbounds[2];j<data->viewbounds[3];j+=stride)
-		{
-		k = i * data->primary_ny + j;
-		l = (i + stride) * data->primary_ny + j;
-		if (flip == MB_NO)
-			{
-			ikk = i;
-			kk = k;
-			ill = i + stride;
-			ll = l;
-			}
-		else
-			{
-			ikk = i + stride;
-			kk = l;
-			ill = i;
-			ll = k;
-			}
-		if (data->primary_data[kk] != data->primary_nodatavalue)
-			{
-			if (on == MB_NO)
-				{
-				glBegin(GL_TRIANGLE_STRIP);
-				on = MB_YES;
-				if (kk == k)
-					flip = MB_NO;
-				else
-					flip = MB_YES;
-				}
-			if (!(data->primary_stat_z[kk/8] & statmask[kk%8]))
-				mbview_zscalegridpoint(instance,kk);
-			if (!(data->primary_stat_color[kk/8] & statmask[kk%8]))
-				{
-				if (use_histogram == MB_NO)
-					mbview_colorpoint(view, data, ikk, j, kk);
-				else
-					mbview_colorpoint_histogram(view, data, histogram, ikk, j, kk);
-				}
-			glColor3f(data->primary_r[kk],
-				data->primary_g[kk],
-				data->primary_b[kk]);
-			glVertex3f(data->primary_x[kk],
-				data->primary_y[kk],
-				data->primary_z[kk]);
-/*fprintf(stderr,"Drawing triangles: origin: %f %f %f  pt:%f %f %f\n",
-view->xorigin,view->yorigin,view->zorigin,
-data->primary_x[kk],data->primary_y[kk],data->primary_z[kk]);*/
-			}
-		else
-			{
-			 if (on == MB_YES)
-			 	{
-			 	glEnd();
-#ifdef MBV_GET_GLX_ERRORS
-mbview_glerrorcheck(instance, __FILE__, __LINE__, function_name);
-#endif
-				on = MB_NO;
-				}
-			flip = MB_NO;
-			}
-		if (data->primary_data[ll] != data->primary_nodatavalue)
-			{
-			if (on == MB_NO)
-				{
-				glBegin(GL_TRIANGLE_STRIP);
-				on = MB_YES;
-				if (ll == l)
-					flip = MB_NO;
-				else
-					flip = MB_YES;
-				}
-			if (!(data->primary_stat_z[ll/8] & statmask[ll%8]))
-				mbview_zscalegridpoint(instance,ll);
-			if (!(data->primary_stat_color[ll/8] & statmask[ll%8]))
-				{
-				if (use_histogram == MB_NO)
-					mbview_colorpoint(view, data, ill, j, ll);
-				else
-					mbview_colorpoint_histogram(view, data, histogram, ill, j, ll);
-				}
-			glColor3f(data->primary_r[ll],
-				data->primary_g[ll],
-				data->primary_b[ll]);
-			glVertex3f(data->primary_x[ll],
-				data->primary_y[ll],
-				data->primary_z[ll]);
-			}
-		else
-			{
-			if (on == MB_YES)
-				{
-				glEnd();
-#ifdef MBV_GET_GLX_ERRORS
-mbview_glerrorcheck(instance, __FILE__, __LINE__, function_name);
-#endif
-				on = MB_NO;
-				}
-			flip = MB_NO;
-			}
-		}
-	if (on == MB_YES)
-		{
-		glEnd();
-#ifdef MBV_GET_GLX_ERRORS
-mbview_glerrorcheck(instance, __FILE__, __LINE__, function_name);
-#endif
-		on = MB_NO;
-		flip = MB_NO;
-		}
-
-	/* check for pending event */
-	if (view->plot_done == MB_NO
-		&& view->plot_interrupt_allowed == MB_YES
-		&& i % MBV_EVENTCHECKCOARSENESS == 0)
-		{
-		do_mbview_xevents();
-		}
-
-	/* dump out of loop if plotting already done at a higher recursion */
-	if (view->plot_done == MB_YES)
-		i = data->primary_nx;
-	}
-#ifdef MBV_GET_GLX_ERRORS
-mbview_glerrorcheck(instance, __FILE__, __LINE__, function_name);
-#endif
-
-	/* draw contours */
-	if (data->grid_contour_mode == MBV_VIEW_ON)
-		{
-		if (rez == MBV_REZ_FULL && view->contourfullrez == MB_YES)
-	    		glCallList((GLuint)(3*instance+3));
-		else if (rez == MBV_REZ_HIGH && view->contourhirez == MB_YES)
-	    		glCallList((GLuint)(3*instance+2));
-		else if (rez == MBV_REZ_LOW && view->contourlorez == MB_YES)
-	    		glCallList((GLuint)(3*instance+1));
-		}
-
-#ifdef MBV_GET_GLX_ERRORS
-mbview_glerrorcheck(instance, __FILE__, __LINE__, function_name);
-#endif
-
-	/* draw current pick */
-	mbview_drawpick(instance);
-
-	/* draw current area */
-	mbview_drawarea(instance);
-
-	/* draw current region */
-	mbview_drawregion(instance);
-
-	/* draw current navpick */
-	mbview_drawnavpick(instance);
-
-	/* draw sites */
-	mbview_drawsite(instance, rez);
-
-	/* draw routes */
-	mbview_drawroute(instance, rez);
-
-	/* draw nav */
-	mbview_drawnav(instance, rez);
-
-	/* draw vectors */
-	mbview_drawvector(instance, rez);
-
-	/* make sure depth test is off */
-	glDisable(GL_DEPTH_TEST);
-
-	/* set lastdrawrez flag */
-	view->lastdrawrez = rez;
-
-	/* print output debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-/*------------------------------------------------------------------------------*/
-int mbview_plotlowall(size_t instance)
-{
-	/* local variables */
-	char	*function_name = "mbview_plotlowall";
-	int	status = MB_SUCCESS;
-	int	i;
-
-	/* print starting debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       instance:         %zu\n",instance);
-		}
-
-	/* replot all active instances except for instance
-	  	which should already be replotted */
-	for (i=0;i<MBV_MAX_WINDOWS;i++)
-		{
-		if (i != instance && mbviews[i].data.active == MB_YES)
-			mbview_plotlow(i);
-		}
-
-	/* print output debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-/*------------------------------------------------------------------------------*/
-int mbview_plotlowhighall(size_t instance)
-{
-	/* local variables */
-	char	*function_name = "mbview_plotlowhighall";
-	int	status = MB_SUCCESS;
-
-	/* print starting debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       instance:         %zu\n",instance);
-		}
-
-	/* replot all active instances except for instance
-	  	which should already be replotted */
-	mbview_plotlowall(instance);
-	mbview_plothighall(instance);
-
-	/* print output debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-
-/*------------------------------------------------------------------------------*/
-int mbview_plothighall(size_t instance)
-{
-	/* local variables */
-	char	*function_name = "mbview_plothighall";
-	int	status = MB_SUCCESS;
-	int	i;
-
-	/* print starting debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       instance:         %zu\n",instance);
-		}
-
-	/* replot all active instances except for instance
-	  	which should already be replotted */
-	for (i=0;i<MBV_MAX_WINDOWS;i++)
-		{
-		if (i != instance && mbviews[i].data.active == MB_YES)
-			mbview_plothigh(i);
-		}
-
-	/* print output debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-
-/*------------------------------------------------------------------------------*/
-int mbview_plotlow(size_t instance)
-{
-	/* local variables */
-	char	*function_name = "mbview_plotlow";
-	int	status = MB_SUCCESS;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-
-	/* print starting debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       instance:         %zu\n",instance);
-		}
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* only plot if mbview active for this instance */
-	if (data->active == MB_YES)
-	    {
-	    /* set plot_done to MB_NO and increment the plot recursion level */
-	    view->plot_done = MB_NO;
-	    view->plot_recursion++;
-
-	    status = mbview_plot(instance, MBV_REZ_LOW);
-
-	    /* the plot_done flag will still be MB_NO if this
-	       is the highest recursion level to be reached - finish the plot
-	       only in this case */
-	    if (view->plot_done == MB_NO)
-		    {
-		    /* set plot_done to MB_YES */
-		    view->plot_done = MB_YES;
-if (mbv_verbose >= 2)
-fprintf(stderr, "Plot finished! instance:%zu recursion:%d\n", instance, view->plot_recursion);
-		    }
-
-	    /* decrement the plot recursion level */
-	    view->plot_recursion--;
-
-	    if (view->message_on == MB_YES && view->plot_recursion == 0)
-		    do_mbview_status("Done.", instance);
-if (mbv_verbose >= 2)
-fprintf(stderr,"Done with mbview_plotlow %ld  recursion:%d\n\n",instance,view->plot_recursion);
-	    }
-
-	/* print output debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-
-/*------------------------------------------------------------------------------*/
-int mbview_plotlowhigh(size_t instance)
-{
-	/* local variables */
-	char	*function_name = "mbview_plotlowhigh";
-	int	status = MB_SUCCESS;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-
-	/* print starting debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       instance:         %zu\n",instance);
-		}
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* only plot if mbview active for this instance */
-	if (data->active == MB_YES)
-	    {
-
-	    /* set plot_done to MB_NO and increment the plot recursion level */
-	    view->plot_done = MB_NO;
-	    view->plot_recursion++;
-
-	    status = mbview_plot(instance, MBV_REZ_LOW);
-
-	    status = mbview_plot(instance, MBV_REZ_HIGH);
-
-	    /* the plot_done flag will still be MB_NO if this
-	       is the highest recursion level to be reached - finish the plot
-	       only in this case */
-	    if (view->plot_done == MB_NO)
-		    {
-		    /* set plot_done to MB_YES */
-		    view->plot_done = MB_YES;
-if (mbv_verbose >= 2)
-fprintf(stderr, "Plot finished! instance:%zu recursion:%d\n", instance, view->plot_recursion);
-		    }
-
-	    /* decrement the plot recursion level */
-	    view->plot_recursion--;
-
-	    if (view->message_on == MB_YES && view->plot_recursion == 0)
-		    do_mbview_status("Done.", instance);
-if (mbv_verbose >= 2)
-fprintf(stderr,"Done with mbview_plotlowhigh %ld  recursion:%d\n\n",instance,view->plot_recursion);
-	    }
-
-	/* print output debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-/*------------------------------------------------------------------------------*/
-int mbview_plothigh(size_t instance)
-{
-	/* local variables */
-	char	*function_name = "mbview_plothigh";
-	int	status = MB_SUCCESS;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-
-	/* print starting debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       instance:         %zu\n",instance);
-		}
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* only plot if mbview active for this instance */
-	if (data->active == MB_YES)
-	    {
-
-	    /* set plot_done to MB_NO and increment the plot recursion level */
-	    view->plot_done = MB_NO;
-	    view->plot_recursion++;
-
-	    status = mbview_plot(instance, MBV_REZ_HIGH);
-
-	    /* the plot_done flag will still be MB_NO if this
-	       is the highest recursion level to be reached - finish the plot
-	       only in this case */
-	    if (view->plot_done == MB_NO)
-		    {
-		    /* set plot_done to MB_YES */
-		    view->plot_done = MB_YES;
-if (mbv_verbose >= 2)
-fprintf(stderr, "Plot finished! instance:%zu recursion:%d\n", instance, view->plot_recursion);
-		    }
-
-	    /* decrement the plot recursion level */
-	    view->plot_recursion--;
-
-	    if (view->message_on == MB_YES && view->plot_recursion == 0)
-		    do_mbview_status("Done.", instance);
-if (mbv_verbose >= 2)
-fprintf(stderr,"Done with mbview_plothigh %ld  recursion:%d\n\n",instance,view->plot_recursion);
-	    }
-
-	/* print output debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-/*------------------------------------------------------------------------------*/
-int mbview_plotfull(size_t instance)
-{
-	/* local variables */
-	char	*function_name = "mbview_plotfull";
-	int	status = MB_SUCCESS;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-
-	/* print starting debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       instance:         %zu\n",instance);
-		}
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* only plot if mbview active for this instance */
-	if (data->active == MB_YES)
-	    {
-
-	    /* set plot_done to MB_NO and increment the plot recursion level */
-	    view->plot_done = MB_NO;
-	    view->plot_recursion++;
-
-	    status = mbview_plot(instance, MBV_REZ_FULL);
-
-	    /* the plot_done flag will still be MB_NO if this
-	       is the highest recursion level to be reached - finish the plot
-	       only in this case */
-	    if (view->plot_done == MB_NO)
-		    {
-		    /* set plot_done to MB_YES */
-		    view->plot_done = MB_YES;
-if (mbv_verbose >= 2)
-fprintf(stderr, "Plot finished! instance:%zu recursion:%d\n", instance, view->plot_recursion);
-		    }
-
-	    /* decrement the plot recursion level */
-	    view->plot_recursion--;
-
-	    if (view->message_on == MB_YES && view->plot_recursion == 0)
-		    do_mbview_status("Done.", instance);
-if (mbv_verbose >= 2)
-fprintf(stderr,"Done with mbview_plotfull %ld  recursion:%d\n\n",instance,view->plot_recursion);
-	    }
-
-	/* print output debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-/*------------------------------------------------------------------------------*/
-int mbview_plot(size_t instance, int rez)
-{
-	/* local variables */
-	char	*function_name = "mbview_plot";
-	int	status = MB_SUCCESS;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-	float	viewdistance;
-
-	/* print starting debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       instance:         %zu\n",instance);
-		fprintf(stderr,"dbg2       rez:              %d\n",rez);
-		}
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* only plot if this view is still active */
-	if (view->glx_init == MB_YES)
-		{
-
-		/* make correct window current for OpenGL */
-#ifdef MBV_DEBUG_GLX
-fprintf(stderr,"%s:%d:%s instance:%zu glXMakeCurrent(%p,%p,%p)\n",
-__FILE__,__LINE__,function_name,instance,view->dpy,XtWindow(view->glwmda),view->glx_context);
-#endif
-		glXMakeCurrent(view->dpy,XtWindow(view->glwmda),view->glx_context);
-
-#ifdef MBV_GET_GLX_ERRORS
-mbview_glerrorcheck(instance, __FILE__, __LINE__, function_name);
-#endif
-
-/*fprintf(stderr,"\nmbview_plot: instance:%zu rez:%d recursion:%zu\n",instance,rez,view->plot_recursion);
-fprintf(stderr,"     view->plot_done:        %d\n",view->plot_done);
-fprintf(stderr,"     view->plot_recursion:   %d\n",view->plot_recursion);
-fprintf(stderr,"     view->projected:        %d\n",view->projected);
-fprintf(stderr,"     view->contourlorez:     %d\n",view->contourlorez);
-fprintf(stderr,"     view->contourhirez:     %d\n",view->contourhirez);
-fprintf(stderr,"     view->contourfullrez:   %d\n",view->contourfullrez);
-fprintf(stderr,"     data->pick_type:  %d\n",data->pick_type);*/
-
-		/* apply projection if needed */
-		if (view->plot_done == MB_NO
-			&& view->projected == MB_NO)
-			{
-			do_mbview_status("Projecting data...", instance);
-			mbview_projectdata(instance);
-			}
-
-		/* apply projection to global data if needed */
-		if (view->plot_done == MB_NO
-			&& view->globalprojected == MB_NO)
-			{
-			do_mbview_status("Projecting global data...", instance);
-			mbview_projectglobaldata(instance);
-			}
-
-		/* contour if needed */
-		if (view->plot_done == MB_NO
-			&& (data->grid_contour_mode == MBV_VIEW_ON)
-			&& ((rez == MBV_REZ_FULL && view->contourfullrez == MB_NO)
-				|| (rez == MBV_REZ_HIGH && view->contourhirez == MB_NO)
-				|| (rez == MBV_REZ_LOW && view->contourlorez == MB_NO)))
-			{
-			if (rez == MBV_REZ_FULL)
-				do_mbview_status("Contouring data...", instance);
-	    		mbview_contour(instance, rez);
-			}
-
-
-		/* get bounds of grid seen in current view */
-		if (rez == MBV_REZ_FULL
-			&& data->display_mode == MBV_DISPLAY_3D)
-			{
-			data->viewbounds[0] = 0;
-			data->viewbounds[1] = data->primary_nx - 1;
-			data->viewbounds[2] = 0;
-			data->viewbounds[3] = data->primary_ny - 1;
-			}
-		else if (view->viewboundscount >= MBV_BOUNDSFREQUENCY)
-			{
-			mbview_viewbounds(instance);
-			view->viewboundscount = 0;
-
-			/* regenerate 3D drape of pick marks if either 3D display
-				or the pick move is final */
-			if (data->pick_type != MBV_PICK_NONE
-				&& data->display_mode == MBV_DISPLAY_3D)
-				{
-				mbview_picksize(instance);
-				}
-			}
-
-		/* do the actual openGL plotting */
-		if (view->plot_done == MB_NO)
-			{
-			/* set projection to 2D or 3D */
-			glMatrixMode(GL_PROJECTION);
-			glLoadIdentity();
-			view->right = MBV_OPENGL_WIDTH / view->size2d;
-			view->left = -MBV_OPENGL_WIDTH / view->size2d;
-			view->top = MBV_OPENGL_WIDTH / view->aspect_ratio / view->size2d;
-			view->bottom = -MBV_OPENGL_WIDTH / view->aspect_ratio / view->size2d;
-			if (data->display_mode == MBV_DISPLAY_2D)
-				{
-				glOrtho(view->left,
-					view->right,
-					view->bottom,
-					view->top,
-					MBV_OPENGL_ZMIN2D, MBV_OPENGL_ZMAX2D);
-				}
-			else
-				{
-				gluPerspective(40.0,
-					view->aspect_ratio,
-					0.01 * MBV_OPENGL_WIDTH,
-					1000 * MBV_OPENGL_WIDTH);
-				}
-
-			/* set up translations */
-			glMatrixMode(GL_MODELVIEW);
-			glLoadIdentity();
-			if (data->display_mode == MBV_DISPLAY_2D)
-				{
-				glTranslated (view->offset2d_x,
-						view->offset2d_y,
-						MBV_OPENGL_ZMIN2D);
-				}
-			else if (data->display_mode == MBV_DISPLAY_3D)
-				{
-				viewdistance = 0.48 * MBV_OPENGL_WIDTH * MBV_OPENGL_WIDTH
-						/ view->aspect_ratio;
-				glTranslated (0.0, 0.0,
-						-viewdistance + view->viewoffset3d_z);
-				glRotated ((float)(data->viewelevation3d - 90.0), 1.0, 0.0, 0.0);
-				glRotated ((float)(data->viewazimuth3d), 0.0, 1.0, 1.0);
-				glTranslated (view->offset3d_x,
-						view->offset3d_y,
-						-viewdistance + view->offset3d_z);
-				glRotated ((float)(data->modelelevation3d - 90.0), 1.0, 0.0, 0.0);
-				glRotated ((float)(data->modelazimuth3d), 0.0, 0.0, 1.0);
-				}
-
-			/* set background color */
-			glClearColor(1.0, 1.0, 1.0, 0.0);
-			glClearDepth((GLclampd)(2000 * MBV_OPENGL_WIDTH));
-			glDepthFunc(GL_LESS);
-			glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
-
-			/* draw data */
-			if (view->plot_done == MB_NO)
-				{
-				if (rez == MBV_REZ_FULL)
-					do_mbview_status("Drawing full rez...", instance);
-				else if (rez == MBV_REZ_HIGH)
-					do_mbview_status("Drawing high rez...", instance);
-				mbview_drawdata(instance, rez);
-				}
-			}
-
-		/* the plot_done flag will still be MB_NO if this
-		   is the highest recursion level to be reached - finish the plot
-		   only in this case */
-		if (view->plot_done == MB_NO)
-			{
-			/* flush opengl buffers */
-			glFlush();
-
-			/* make correct window current for OpenGL (may have changed due to recursion) */
-#ifdef MBV_DEBUG_GLX
-fprintf(stderr,"%s:%d:%s instance:%zu glXMakeCurrent(%p,%p,%p)\n",
-__FILE__,__LINE__,function_name,instance,view->dpy,XtWindow(view->glwmda),view->glx_context);
-#endif
-			glXMakeCurrent(view->dpy,XtWindow(view->glwmda),view->glx_context);
-
-#ifdef MBV_GET_GLX_ERRORS
-mbview_glerrorcheck(instance, __FILE__, __LINE__, function_name);
-#endif
-
-			/* swap opengl buffers */
-#ifdef MBV_DEBUG_GLX
-fprintf(stderr,"%s:%d:%s instance:%zu glXSwapBuffers(%p,%p)\n",
-__FILE__,__LINE__,function_name,instance,view->dpy,XtWindow(view->glwmda));
-#endif
-			glXSwapBuffers (view->dpy, XtWindow(view->glwmda));
-#ifdef MBV_GET_GLX_ERRORS
-mbview_glerrorcheck(instance, __FILE__, __LINE__, function_name);
-#endif
-			}
-		}
-
-	/* print output debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-
-
-/*------------------------------------------------------------------------------*/
-int mbview_findpoint(size_t instance, int xpixel, int ypixel,
-			int *found,
-			double *xgrid, double *ygrid,
-			double *xlon, double *ylat, double *zdata,
-			double *xdisplay, double *ydisplay, double *zdisplay)
-{
-
-	/* local variables */
-	char	*function_name = "mbview_findpoint";
-	int	status = MB_SUCCESS;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-	int	rez;
-	int	ijbounds[4];
-	int	foundsave;
-	double	xgridsave, ygridsave;
-	double	xlonsave, ylatsave, zdatasave;
-	double	xdisplaysave, ydisplaysave, zdisplaysave;
-
-	/* print starting debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       instance:         %zu\n",instance);
-		fprintf(stderr,"dbg2       xpixel:           %d\n",xpixel);
-		fprintf(stderr,"dbg2       ypixel:           %d\n",ypixel);
-		}
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* only plot if this view is still active */
-	if (view->glx_init == MB_YES)
-		{
-
-		/* look for point at low resolution */
-		*found = MB_NO;
-		foundsave = MB_NO;
-		ijbounds[0] = 0;
-		ijbounds[1] = data->primary_nx;
-		ijbounds[2] = 0;
-		ijbounds[3] = data->primary_ny;
-		rez = MBV_REZ_LOW;
-		mbview_findpointrez(instance, rez, xpixel, ypixel,
-				ijbounds, found,
-				xgrid, ygrid,
-				xlon, ylat, zdata,
-				xdisplay, ydisplay, zdisplay);
-/*fprintf(stderr,"First findpointrez: rez:%d pixels:%d %d found:%d xlon:%f ylat:%f zdata:%f\n",
-rez,xpixel,ypixel,found,xlon,ylat,zdata);*/
-		if (*found == MB_YES)
-			{
-			/* save last good results */
-			foundsave = *found;
-			xgridsave = *xgrid;
-			ygridsave = *ygrid;
-			xlonsave = *xlon;
-			ylatsave = *ylat;
-			zdatasave = *zdata;
-			xdisplaysave = *xdisplay;
-			ydisplaysave = *ydisplay;
-			zdisplaysave = *zdisplay;
-			}
-
-		/* now check high rez */
-		rez = MBV_REZ_HIGH;
-		mbview_findpointrez(instance, rez, xpixel, ypixel,
-				ijbounds, found,
-				xgrid, ygrid,
-				xlon, ylat, zdata,
-				xdisplay, ydisplay, zdisplay);
-		if (*found == MB_NO && foundsave == MB_YES)
-			{
-			rez = MBV_REZ_LOW;
-			*found = foundsave;
-			*xgrid = xgridsave;
-			*ygrid = ygridsave;
-			*xlon = xlonsave;
-			*ylat = ylatsave;
-			*xdisplay = xdisplaysave;
-			*ydisplay = ydisplaysave;
-			*zdisplay = zdisplaysave;
-			}
-
-		/* repeat until found at highest resolution possible */
-		while (*found == MB_YES
-			&& ijbounds[1] > ijbounds[0]
-			&& ijbounds[3] > ijbounds[2])
-			{
-			/* save last good results */
-			foundsave = *found;
-			xgridsave = *xgrid;
-			ygridsave = *ygrid;
-			xlonsave = *xlon;
-			ylatsave = *ylat;
-			zdatasave = *zdata;
-			xdisplaysave = *xdisplay;
-			ydisplaysave = *ydisplay;
-			zdisplaysave = *zdisplay;
-
-			/* choose resolution */
-			if ((ijbounds[1] - ijbounds[0])
-					> data->hirez_dimension
-				|| (ijbounds[3] - ijbounds[2])
-					> data->hirez_dimension)
-				rez = MBV_REZ_HIGH;
-			else
-				rez = MBV_REZ_FULL;
-
-			/* try again */
-			mbview_findpointrez(instance, rez, xpixel, ypixel,
-				ijbounds, found,
-				xgrid, ygrid,
-				xlon, ylat, zdata,
-				xdisplay, ydisplay, zdisplay);
-			}
-
-		/* if not found and 2D get position directly from pixels */
-		if (*found == MB_NO && data->display_mode == MBV_DISPLAY_2D)
-			{
-			*xdisplay = view->left - view->offset2d_x
-				+ 2.0 * MBV_OPENGL_WIDTH / view->size2d
-				* ((double)xpixel) / ((double)data->width);
-			*ydisplay = view->bottom - view->offset2d_y
-				+ 2.0 * MBV_OPENGL_WIDTH / view->aspect_ratio / view->size2d
-				* ((double)ypixel) / ((double)data->height);
-			*zdisplay = 0.0;
-			mbview_projectdisplay2ll(instance,
-				*xdisplay, *ydisplay, *zdisplay,
-				xlon, ylat);
-			mbview_projectll2xyzgrid(instance,
-				*xlon, *ylat,
-				xgrid, ygrid, zdata);
-			*found = MB_YES;
-			}
-
-		/* if not found and 3D use the best pick location found */
-		if (*found == MB_NO && foundsave == MB_YES)
-			{
-			*found = foundsave;
-			*xgrid = xgridsave;
-			*ygrid = ygridsave;
-			*xlon = xlonsave;
-			*ylat = ylatsave;
-			*zdata = zdatasave;
-			*xdisplay = xdisplaysave;
-			*ydisplay = ydisplaysave;
-			*zdisplay = zdisplaysave;
-			}
-		}
-
-	/* print output debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       found:           %d\n",*found);
-		fprintf(stderr,"dbg2       xgrid:           %f\n",*xgrid);
-		fprintf(stderr,"dbg2       ygrid:           %f\n",*ygrid);
-		fprintf(stderr,"dbg2       xlon:            %f\n",*xlon);
-		fprintf(stderr,"dbg2       ylat:            %f\n",*ylat);
-		fprintf(stderr,"dbg2       zdata:           %f\n",*zdata);
-		fprintf(stderr,"dbg2       status:          %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-
-/*------------------------------------------------------------------------------*/
-int mbview_findpointrez(size_t instance, int rez, int xpixel, int ypixel,
-			int ijbounds[4], int *found,
-			double *xgrid, double *ygrid,
-			double *xlon, double *ylat, double *zdata,
-			double *xdisplay, double *ydisplay, double *zdisplay)
-{
-
-	/* local variables */
-	char	*function_name = "mbview_findpointrez";
-	int	status = MB_SUCCESS;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-	float	viewdistance;
-	int	stride, ipickstride, jpickstride;
-	int	i, j, k, l, m, n;
-	float	rgba[4];
-	int	ni, imin, imax, nj, jmin, jmax;
-	int	npickx, npicky;
-	float	rgb[3];
-
-	/* print starting debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       instance:         %zu\n",instance);
-		fprintf(stderr,"dbg2       rez:              %d\n",rez);
-		fprintf(stderr,"dbg2       xpixel:           %d\n",xpixel);
-		fprintf(stderr,"dbg2       ypixel:           %d\n",ypixel);
-		fprintf(stderr,"dbg2       ijbounds[0]:     %d\n",ijbounds[0]);
-		fprintf(stderr,"dbg2       ijbounds[1]:     %d\n",ijbounds[1]);
-		fprintf(stderr,"dbg2       ijbounds[2]:     %d\n",ijbounds[2]);
-		fprintf(stderr,"dbg2       ijbounds[3]:     %d\n",ijbounds[3]);
-		}
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* only plot if this view is still active */
-	if (view->glx_init == MB_YES)
-		{
-
-		/* make correct window current for OpenGL */
-#ifdef MBV_DEBUG_GLX
-fprintf(stderr,"%s:%d:%s instance:%zu glXMakeCurrent(%p,%p,%p)\n",
-__FILE__,__LINE__,function_name,instance,view->dpy,XtWindow(view->glwmda),view->glx_context);
-#endif
-	glXMakeCurrent(view->dpy,XtWindow(view->glwmda),view->glx_context);
-/*fprintf(stderr,"\nmbview_findpointrez: instance:%zu point:%d %d  bounds:%d %d %d %d\n",
-instance,xpixel,ypixel,ijbounds[0],ijbounds[1],ijbounds[2],ijbounds[3]);*/
-
-#ifdef MBV_GET_GLX_ERRORS
-mbview_glerrorcheck(instance, __FILE__, __LINE__, function_name);
-#endif
-
-		/* apply projection if needed */
-		if (view->projected == MB_NO)
-			{
-			do_mbview_status("Projecting data...", instance);
-			mbview_projectdata(instance);
-			}
-
-		/* set projection to 2D or 3D */
-		glMatrixMode(GL_PROJECTION);
-		glLoadIdentity();
-		view->right = MBV_OPENGL_WIDTH / view->size2d;
-		view->left = -MBV_OPENGL_WIDTH / view->size2d;
-		view->top = MBV_OPENGL_WIDTH / view->aspect_ratio / view->size2d;
-		view->bottom = -MBV_OPENGL_WIDTH / view->aspect_ratio / view->size2d;
-		if (data->display_mode == MBV_DISPLAY_2D)
-			{
-			glOrtho(view->left,
-				view->right,
-				view->bottom,
-				view->top,
-				MBV_OPENGL_ZMIN2D, MBV_OPENGL_ZMAX2D);
-			}
-		else
-			{
-			gluPerspective(40.0,
-				view->aspect_ratio,
-				0.01 * MBV_OPENGL_WIDTH,
-				1000 * MBV_OPENGL_WIDTH);
-			}
-
-		/* set up translations */
-		glMatrixMode(GL_MODELVIEW);
-		glLoadIdentity();
-		if (data->display_mode == MBV_DISPLAY_2D)
-			{
-			glTranslated (view->offset2d_x,
-					view->offset2d_y,
-					MBV_OPENGL_ZMIN2D);
-			}
-		else if (data->display_mode == MBV_DISPLAY_3D)
-			{
-			viewdistance = 0.48 * MBV_OPENGL_WIDTH * MBV_OPENGL_WIDTH
-					/ view->aspect_ratio;
-			glTranslated (0.0, 0.0,
-					-viewdistance + view->viewoffset3d_z);
-			glRotated ((float)(data->viewelevation3d - 90.0), 1.0, 0.0, 0.0);
-			glRotated ((float)(data->viewazimuth3d), 0.0, 1.0, 1.0);
-			glTranslated (view->offset3d_x,
-					view->offset3d_y,
-					-viewdistance + view->offset3d_z);
-			glRotated ((float)(data->modelelevation3d - 90.0), 1.0, 0.0, 0.0);
-			glRotated ((float)(data->modelazimuth3d), 0.0, 0.0, 1.0);
-			}
-
-		/* set background color */
-		glClearColor(1.0, 1.0, 1.0, 1.0);
-		glClearDepth((GLclampd)(2000 * MBV_OPENGL_WIDTH));
-		glDepthFunc(GL_LESS);
-		glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
-
-		/* enable depth test for 3D plots */
-		if (data->display_mode == MBV_DISPLAY_3D)
-			glEnable(GL_DEPTH_TEST);
-
-		/* get bounds of interest in grid */
-		imin = ijbounds[0];
-		imax = ijbounds[1];
-		ni = imax - imin + 1;
-		jmin = ijbounds[2];
-		jmax = ijbounds[3];
-		nj = jmax - jmin + 1;
-
-		/* set stride for looping over data */
-		if (rez == MBV_REZ_FULL)
-		    stride = 1;
-		else if (rez == MBV_REZ_HIGH)
-		    stride = MAX((int)ceil(((double)data->primary_nx)
-					/ ((double)data->hirez_dimension)),
-				(int)ceil(((double)data->primary_ny)
-					/ ((double)data->hirez_dimension)));
-		else
-		    stride = MAX((int)ceil(((double)data->primary_nx)
-					/ ((double)data->lorez_dimension)),
-				(int)ceil(((double)data->primary_ny)
-					/ ((double)data->lorez_dimension)));
-
-		/* get number of grid cells used in picking */
-		npickx = (ni / stride);
-		ipickstride = stride * (int)floor((npickx / MBV_PICK_DIVISION) + 1);
-		npicky = (nj / stride);
-		jpickstride = stride * (int)floor((npicky / MBV_PICK_DIVISION) + 1);
-
-/*fprintf(stderr,"mbview_findpointrez: stride:%d npickx:%d npicky:%d ipickstride:%d jpickstride:%d\n",
-stride, npickx, npicky, ipickstride, jpickstride);*/
-
-		/* draw the triangles */
-		glBegin(GL_TRIANGLES);
-		for (i=imin;i<imax-stride;i+=stride)
-		{
-		for (j=jmin;j<jmax-stride;j+=stride)
-			{
-			k = i * data->primary_ny + j;
-			l = (i + stride) * data->primary_ny + j;
-			m = i * data->primary_ny + j + stride;
-			n = (i + stride) * data->primary_ny + j + stride;
-
-			rgb[0] = (float)floor(((double)((i - imin) / ipickstride)))
-					/ (MBV_PICK_DIVISION + 1.0);
-			rgb[1] = (float)floor(((double)((j - jmin) / jpickstride)))
-					/ (MBV_PICK_DIVISION + 1.0);
-			if (data->primary_data[k] != data->primary_nodatavalue
-				&& data->primary_data[l] != data->primary_nodatavalue
-				&& data->primary_data[m] != data->primary_nodatavalue)
-				{
-				if (!(data->primary_stat_z[k/8] & statmask[k%8]))
-					mbview_zscalegridpoint(instance,k);
-				if (!(data->primary_stat_z[l/8] & statmask[l%8]))
-					mbview_zscalegridpoint(instance,l);
-				if (!(data->primary_stat_z[m/8] & statmask[m%8]))
-					mbview_zscalegridpoint(instance,m);
-				rgb[2] = 0.25;
-/*fprintf(stderr,"triangle:%d %d   rgb: %f %f %f\n",
-i,j, rgb[0], rgb[1], rgb[2]);*/
-				glColor3f(rgb[0], rgb[1], rgb[2]);
-				glVertex3f(data->primary_x[k],
-					data->primary_y[k],
-					data->primary_z[k]);
-				glColor3f(rgb[0], rgb[1], rgb[2]);
-				glVertex3f(data->primary_x[l],
-					data->primary_y[l],
-					data->primary_z[l]);
-				glColor3f(rgb[0], rgb[1], rgb[2]);
-				glVertex3f(data->primary_x[m],
-					data->primary_y[m],
-					data->primary_z[m]);
-				}
-			if (data->primary_data[l] != data->primary_nodatavalue
-				&& data->primary_data[m] != data->primary_nodatavalue
-				&& data->primary_data[n] != data->primary_nodatavalue)
-				{
-				if (!(data->primary_stat_z[l/8] & statmask[l%8]))
-					mbview_zscalegridpoint(instance,l);
-				if (!(data->primary_stat_z[m/8] & statmask[m%8]))
-					mbview_zscalegridpoint(instance,m);
-				if (!(data->primary_stat_z[n/8] & statmask[n%8]))
-					mbview_zscalegridpoint(instance,n);
-				rgb[2] = 0.75;
-/*fprintf(stderr,"triangle:%d %d   rgb: %f %f %f\n",
-i,j, rgb[0], rgb[1], rgb[2]);*/
-				glColor3f(rgb[0], rgb[1], rgb[2]);
-				glVertex3f(data->primary_x[l],
-					data->primary_y[l],
-					data->primary_z[l]);
-				glColor3f(rgb[0], rgb[1], rgb[2]);
-				glVertex3f(data->primary_x[n],
-					data->primary_y[n],
-					data->primary_z[n]);
-				glColor3f(rgb[0], rgb[1], rgb[2]);
-				glVertex3f(data->primary_x[m],
-					data->primary_y[m],
-					data->primary_z[m]);
-				}
-			}
-		}
-		glEnd();
-
-		/* flush opengl buffers */
-		glFlush();
-
-		/* make sure depth test is off */
-		glDisable(GL_DEPTH_TEST);
-
-		/* now read the color at the pick point */
-		glReadBuffer(GL_BACK);
-		glReadPixels(xpixel, ypixel, 1, 1, GL_RGBA, GL_FLOAT, rgba);
-		glReadBuffer(GL_FRONT);
-
-		/* calculate pick location */
-		if (rgba[0] != 1.0
-			&& rgba[1] != 1.0
-			&& (rgba[2] > 0.2 && rgba[2] < 0.8))
-			{
-			*found = MB_YES;
-
-			i = imin + ipickstride
-					* ((int)rint((MBV_PICK_DIVISION + 1.0) * rgba[0]));
-			j = jmin + jpickstride
-					* ((int)rint((MBV_PICK_DIVISION + 1.0) * rgba[1]));
-			k = i * data->primary_ny + j;
-			l = (i + stride) * data->primary_ny + j;
-			m = i * data->primary_ny + j + stride;
-			n = (i + stride) * data->primary_ny + j + stride;
-			if (rint((MBV_PICK_DIVISION + 1.0) * rgba[2])
-				== (MBV_PICK_DIVISION + 1.0) / 4.0)
-				{
-				*xgrid = data->primary_xmin
-						+ (3 * i + stride) * data->primary_dx / 3.0;
-				*ygrid = data->primary_ymin
-						+ (3 * j + stride) * data->primary_dy / 3.0;
-				*zdata = (data->primary_data[k]
-						+ data->primary_data[l]
-						+ data->primary_data[m]) / 3.0;
-				}
-			else
-				{
-				*xgrid = data->primary_xmin
-						+ (3 * i + 2 * stride) * data->primary_dx / 3.0;
-				*ygrid = data->primary_ymin
-						+ (3 * j + 2 * stride) * data->primary_dy / 3.0;
-				*zdata = (data->primary_data[l]
-						+ data->primary_data[n]
-						+ data->primary_data[m]) / 3.0;
-				}
-/*fprintf(stderr,"pickrez:%d %d   rgb: %f %f %f %f   i:%d j:%d\n",
-xpixel,ypixel, rgba[0], rgba[1], rgba[2], rgba[3], i, j);*/
-
-			/* project grid positions to geographic and display coordinates */
-			mbview_projectforward(instance, MB_YES,
-						*xgrid, *ygrid, *zdata,
-						xlon, ylat,
-						xdisplay, ydisplay,zdisplay);
-
-/*fprintf(stderr," pickrez: grid: %f %f %f     lonlat: %f %f display: %f %f %f\n",
-*xgrid, *ygrid, *zdata, *xlon, *ylat, *xdisplay, *ydisplay, *zdisplay);*/
-
-
-			/* reset ijbounds */
-			ijbounds[0] = i;
-			ijbounds[2] = j;
-			if (ipickstride == 1)
-				{
-				ijbounds[1] = i;
-				ijbounds[3] = j;
-				}
-			else
-				{
-				ijbounds[1] = MIN(i + 2 * ipickstride - 1, data->primary_nx - 1);
-				ijbounds[3] = MIN(j + 2 * jpickstride - 1, data->primary_ny - 1);
-				}
-			}
-
-		else
-			{
-			*found = MB_NO;
-/*fprintf(stderr,"pickrez bad pick!!:%d %d   rgba: %f %f %f %f\n",
-xpixel,ypixel, rgba[0], rgba[1], rgba[2], rgba[3]);*/
-			}
-
-#ifdef MBV_GET_GLX_ERRORS
-mbview_glerrorcheck(instance, __FILE__, __LINE__, function_name);
-#endif
-		}
-
-	/* print output debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       ijbounds[0]:     %d\n",ijbounds[0]);
-		fprintf(stderr,"dbg2       ijbounds[1]:     %d\n",ijbounds[1]);
-		fprintf(stderr,"dbg2       ijbounds[2]:     %d\n",ijbounds[2]);
-		fprintf(stderr,"dbg2       ijbounds[3]:     %d\n",ijbounds[3]);
-		fprintf(stderr,"dbg2       found:           %d\n",*found);
-		fprintf(stderr,"dbg2       xgrid:           %f\n",*xgrid);
-		fprintf(stderr,"dbg2       ygrid:           %f\n",*ygrid);
-		fprintf(stderr,"dbg2       xlon:            %f\n",*xlon);
-		fprintf(stderr,"dbg2       ylat:            %f\n",*ylat);
-		fprintf(stderr,"dbg2       zdata:           %f\n",*zdata);
-		fprintf(stderr,"dbg2       status:          %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-
-
-/*------------------------------------------------------------------------------*/
-int mbview_viewbounds(size_t instance)
-{
-
-	/* local variables */
-	char	*function_name = "mbview_viewbounds";
-	int	status = MB_SUCCESS;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-	float	left2d, right2d, bottom2d, top2d;
-	float	viewdistance;
-	int	stride, ipickstride, jpickstride;
-	int	iscreenstride, jscreenstride;
-	int	xpixel, ypixel;
-	int	found;
-	float	rgba[4];
-	int	npickx, npicky;
-	float	rgb[3];
-	int	ijbounds[4];
-	int	i, j, k, l, m, n;
-
-	/* print starting debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       instance:         %zu\n",instance);
-		}
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* only plot if this view is still active */
-	if (view->glx_init == MB_YES)
-		{
-
-	/* make correct window current for OpenGL */
-#ifdef MBV_DEBUG_GLX
-fprintf(stderr,"%s:%d:%s instance:%zu glXMakeCurrent(%p,%p,%p)\n",
-__FILE__,__LINE__,function_name,instance,view->dpy,XtWindow(view->glwmda),view->glx_context);
-#endif
-		glXMakeCurrent(view->dpy,XtWindow(view->glwmda),view->glx_context);
-
-#ifdef MBV_GET_GLX_ERRORS
-mbview_glerrorcheck(instance, __FILE__, __LINE__, function_name);
-#endif
-
-		/* apply projection if needed */
-		if (view->projected == MB_NO)
-			{
-			do_mbview_status("Projecting data...", instance);
-			mbview_projectdata(instance);
-			}
-
-		/* 2D case doesn't require plotting */
-		if (data->display_mode == MBV_DISPLAY_2D)
-			{
-/*fprintf(stderr,"2D GL bounds: %f %f %f %f\n",
-view->left, view->right, view->bottom, view->top);
-fprintf(stderr,"2D GL offsets: %f %f\n",
-view->offset2d_x, view->offset2d_y);
-fprintf(stderr,"2D primary grid corners: \n");
-i = 0; j = 0; k = i * data->primary_ny + j;
-fprintf(stderr,"LL:%f %f\n",
-data->primary_x[k],data->primary_y[k]);
-i = data->primary_nx - 1; j = data->primary_ny - 1; k = i * data->primary_ny + j;
-fprintf(stderr,"LR:%f %f\n",
-data->primary_x[k],data->primary_y[k]);
-i = 0; j = 0; k = i * data->primary_ny + j;
-fprintf(stderr,"UL:%f %f\n",
-data->primary_x[k],data->primary_y[k]);
-i = data->primary_nx - 1; j = data->primary_ny - 1; k = i * data->primary_ny + j;
-fprintf(stderr,"UR:%f %f\n",
-data->primary_x[k],data->primary_y[k]);*/
-
-			/* set stride for looping over data using rule for low rez plotting */
-			stride = MAX((int)ceil(((double)data->primary_nx)
-						/ ((double)data->lorez_dimension)),
-					(int)ceil(((double)data->primary_ny)
-						/ ((double)data->lorez_dimension)));
-
-			/* get 2D view bounds */
-			left2d = view->left - view->offset2d_x;
-			right2d = view->right - view->offset2d_x;
-			bottom2d = view->bottom - view->offset2d_y;
-			top2d = view->top - view->offset2d_y;
-			found = MB_NO;
-			data->viewbounds[0] = 0;
-			data->viewbounds[1] = data->primary_nx - 1;
-			data->viewbounds[2] = 0;
-			data->viewbounds[3] = data->primary_ny - 1;
-			for (i=0;i<data->primary_nx;i+=stride)
-				{
-				for (j=0;j<data->primary_ny;j+=stride)
-					{
-					k = i * data->primary_ny + j;
-					if (data->primary_data[k] != data->primary_nodatavalue
-						&& data->primary_x[k] >= left2d
-						&& data->primary_x[k] <= right2d
-						&& data->primary_y[k] >= bottom2d
-						&& data->primary_y[k] <= top2d)
-						{
-						if (found == MB_NO)
-							{
-							data->viewbounds[0] = i;
-							data->viewbounds[1] = i + stride;
-							data->viewbounds[2] = j;
-							data->viewbounds[3] = j + stride;
-							found = MB_YES;
-							}
-						else
-							{
-							data->viewbounds[0] = MIN(i, data->viewbounds[0]);
-							data->viewbounds[1] = MAX(i + stride, data->viewbounds[1]);
-							data->viewbounds[2] = MIN(j, data->viewbounds[2]);
-							data->viewbounds[3] = MAX(j + stride, data->viewbounds[3]);
-							}
-						}
-					}
-				}
-			for (i=0;i<data->primary_nx;i+=data->primary_nx-1)
-				{
-				for (j=0;j<data->primary_ny;j+=data->primary_ny-1)
-					{
-					k = i * data->primary_ny + j;
-					if (data->primary_data[k] != data->primary_nodatavalue
-						&& data->primary_x[k] >= left2d
-						&& data->primary_x[k] <= right2d
-						&& data->primary_y[k] >= bottom2d
-						&& data->primary_y[k] <= top2d)
-						{
-						if (found == MB_NO)
-							{
-							data->viewbounds[0] = i;
-							data->viewbounds[1] = i + stride;
-							data->viewbounds[2] = j;
-							data->viewbounds[3] = j + stride;
-							found = MB_YES;
-							}
-						else
-							{
-							data->viewbounds[0] = MIN(i, data->viewbounds[0]);
-							data->viewbounds[1] = MAX(i + stride, data->viewbounds[1]);
-							data->viewbounds[2] = MIN(j, data->viewbounds[2]);
-							data->viewbounds[3] = MAX(j + stride, data->viewbounds[3]);
-							}
-						}
-					}
-				}
-			data->viewbounds[0] = MAX(data->viewbounds[0] - stride, 0);
-			data->viewbounds[1] = MIN(data->viewbounds[1] + stride, data->primary_nx - 1);
-			data->viewbounds[2] = MAX(data->viewbounds[2] - stride, 0);
-			data->viewbounds[3] = MIN(data->viewbounds[3] + stride, data->primary_ny - 1);
-
-			}
-
-		/* 3D case requires plotting */
-		else
-			{
-			/* set projection to 2D or 3D */
-			glMatrixMode(GL_PROJECTION);
-			glLoadIdentity();
-			view->right = MBV_OPENGL_WIDTH / view->size2d;
-			view->left = -MBV_OPENGL_WIDTH / view->size2d;
-			view->top = MBV_OPENGL_WIDTH / view->aspect_ratio / view->size2d;
-			view->bottom = -MBV_OPENGL_WIDTH / view->aspect_ratio / view->size2d;
-			if (data->display_mode == MBV_DISPLAY_2D)
-				{
-				glOrtho(view->left,
-					view->right,
-					view->bottom,
-					view->top,
-					MBV_OPENGL_ZMIN2D, MBV_OPENGL_ZMAX2D);
-				}
-			else
-				{
-				gluPerspective(40.0,
-					view->aspect_ratio,
-					0.01 * MBV_OPENGL_WIDTH,
-					1000 * MBV_OPENGL_WIDTH);
-				}
-
-			/* set up translations */
-			glMatrixMode(GL_MODELVIEW);
-			glLoadIdentity();
-			if (data->display_mode == MBV_DISPLAY_2D)
-				{
-				glTranslated (view->offset2d_x,
-						view->offset2d_y,
-						MBV_OPENGL_ZMIN2D);
-				}
-			else if (data->display_mode == MBV_DISPLAY_3D)
-				{
-				viewdistance = 0.48 * MBV_OPENGL_WIDTH * MBV_OPENGL_WIDTH
-						/ view->aspect_ratio;
-				glTranslated (0.0, 0.0,
-						-viewdistance + view->viewoffset3d_z);
-				glRotated ((float)(data->viewelevation3d - 90.0), 1.0, 0.0, 0.0);
-				glRotated ((float)(data->viewazimuth3d), 0.0, 1.0, 1.0);
-				glTranslated (view->offset3d_x,
-						view->offset3d_y,
-						-viewdistance + view->offset3d_z);
-				glRotated ((float)(data->modelelevation3d - 90.0), 1.0, 0.0, 0.0);
-				glRotated ((float)(data->modelazimuth3d), 0.0, 0.0, 1.0);
-				}
-
-			/* set background color */
-			glClearColor(1.0, 1.0, 1.0, 1.0);
-			glClearDepth((GLclampd)(2000 * MBV_OPENGL_WIDTH));
-			glDepthFunc(GL_LESS);
-			glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
-
-			/* enable depth test for 3D plots */
-			if (data->display_mode == MBV_DISPLAY_3D)
-				glEnable(GL_DEPTH_TEST);
-
-			/* set stride for looping over data using rule for low rez plotting */
-			stride = MAX((int)ceil(((double)data->primary_nx)
-						/ ((double)data->lorez_dimension)),
-					(int)ceil(((double)data->primary_ny)
-						/ ((double)data->lorez_dimension)));
-
-			/* get number of grid cells used in picking */
-			npickx = (data->primary_nx / stride);
-			ipickstride = stride * (int)floor((npickx / MBV_PICK_DIVISION) + 1);
-			npicky = (data->primary_ny / stride);
-			jpickstride = stride * (int)floor((npicky / MBV_PICK_DIVISION) + 1);
-
-/*fprintf(stderr,"mbview_viewbounds: stride:%d npickx:%d npicky:%d ipickstride:%d jpickstride:%d\n",
-stride, npickx, npicky, ipickstride, jpickstride);*/
-
-			/* draw the triangles */
-			glBegin(GL_TRIANGLES);
-			for (i=0;i<data->primary_nx-stride;i+=stride)
-				{
-				for (j=0;j<data->primary_ny-stride;j+=stride)
-					{
-					k = i * data->primary_ny + j;
-					l = (i + stride) * data->primary_ny + j;
-					m = i * data->primary_ny + j + stride;
-					n = (i + stride) * data->primary_ny + j + stride;
-
-					rgb[0] = (float)floor(((double)(i / ipickstride)))
-							/ (MBV_PICK_DIVISION + 1.0);
-					rgb[1] = (float)floor(((double)(j / jpickstride)))
-							/ (MBV_PICK_DIVISION + 1.0);
-					if (data->primary_data[k] != data->primary_nodatavalue
-						&& data->primary_data[l] != data->primary_nodatavalue
-						&& data->primary_data[m] != data->primary_nodatavalue)
-						{
-						rgb[2] = 0.25;
-/*fprintf(stderr,"triangle:%d %d   rgb: %f %f %f\n",
-i,j, rgb[0], rgb[1], rgb[2]);*/
-						glColor3f(rgb[0], rgb[1], rgb[2]);
-						glVertex3f(data->primary_x[k],
-							data->primary_y[k],
-							data->primary_z[k]);
-						glColor3f(rgb[0], rgb[1], rgb[2]);
-						glVertex3f(data->primary_x[l],
-							data->primary_y[l],
-							data->primary_z[l]);
-						glColor3f(rgb[0], rgb[1], rgb[2]);
-						glVertex3f(data->primary_x[m],
-							data->primary_y[m],
-							data->primary_z[m]);
-						}
-					if (data->primary_data[l] != data->primary_nodatavalue
-						&& data->primary_data[m] != data->primary_nodatavalue
-						&& data->primary_data[n] != data->primary_nodatavalue)
-						{
-						rgb[2] = 0.75;
-/*fprintf(stderr,"triangle:%d %d   rgb: %f %f %f\n",
-i,j, rgb[0], rgb[1], rgb[2]);*/
-						glColor3f(rgb[0], rgb[1], rgb[2]);
-						glVertex3f(data->primary_x[l],
-							data->primary_y[l],
-							data->primary_z[l]);
-						glColor3f(rgb[0], rgb[1], rgb[2]);
-						glVertex3f(data->primary_x[n],
-							data->primary_y[n],
-							data->primary_z[n]);
-						glColor3f(rgb[0], rgb[1], rgb[2]);
-						glVertex3f(data->primary_x[m],
-							data->primary_y[m],
-							data->primary_z[m]);
-						}
-					}
-				}
-			glEnd();
-
-			/* flush opengl buffers */
-			glFlush();
-
-			/* make sure depth test is off */
-			glDisable(GL_DEPTH_TEST);
-
-			/* now read the color at a number of points in the screen */
-			glReadBuffer(GL_BACK);
-			found = MB_NO;
-			data->viewbounds[0] = 0;
-			data->viewbounds[1] = data->primary_nx - 1;
-			data->viewbounds[2] = 0;
-			data->viewbounds[3] = data->primary_ny - 1;
-			iscreenstride = data->width / 20;
-			jscreenstride = data->height / 20;
-			for (xpixel = 0; xpixel < data->width; xpixel += iscreenstride)
-				{
-				for (ypixel = 0; ypixel < data->height; ypixel += jscreenstride)
-					{
-					glReadPixels(xpixel, ypixel, 1, 1, GL_RGBA, GL_FLOAT, rgba);
-/*fprintf(stderr,"xpixel:%d ypixel:%d rgba: %f %f %f %f\n",
-xpixel,ypixel, rgba[0], rgba[1], rgba[2], rgba[3]);*/
-					if (rgba[0] != 1.0 && rgba[1] != 1.0)
-						{
-						i = ipickstride * ((int)rint((MBV_PICK_DIVISION + 1.0) * rgba[0]));
-						j = jpickstride * ((int)rint((MBV_PICK_DIVISION + 1.0) * rgba[1]));
-						if (found == MB_NO)
-							{
-							data->viewbounds[0] = i;
-							data->viewbounds[1] = i + stride;
-							data->viewbounds[2] = j;
-							data->viewbounds[3] = j + stride;
-							found = MB_YES;
-							}
-						else
-							{
-							data->viewbounds[0] = MIN(i, data->viewbounds[0]);
-							data->viewbounds[1] = MAX(i + stride, data->viewbounds[1]);
-							data->viewbounds[2] = MIN(j, data->viewbounds[2]);
-							data->viewbounds[3] = MAX(j + stride, data->viewbounds[3]);
-							}
-/*fprintf(stderr,"i:%d j:%d data->viewbounds: %d %d %d %d\n",
-i,j,data->viewbounds[0],
-data->viewbounds[1],
-data->viewbounds[2],
-data->viewbounds[3]);*/
-						}
-					}
-				}
-			for (xpixel = 0; xpixel < data->width; xpixel += data->width - 1)
-				{
-				for (ypixel = 0; ypixel < data->height; ypixel += data->height - 1)
-					{
-					glReadPixels(xpixel, ypixel, 1, 1, GL_RGBA, GL_FLOAT, rgba);
-/*fprintf(stderr,"xpixel:%d ypixel:%d rgba: %f %f %f %f\n",
-	xpixel,ypixel, rgba[0], rgba[1], rgba[2], rgba[3]);*/
-					if (rgba[0] != 1.0 && rgba[1] != 1.0)
-						{
-						i = ipickstride * ((int)rint((MBV_PICK_DIVISION + 1.0) * rgba[0]));
-						j = jpickstride * ((int)rint((MBV_PICK_DIVISION + 1.0) * rgba[1]));
-						ijbounds[0] = i;
-						ijbounds[2] = j;
-						if (ipickstride == 1)
-							{
-							ijbounds[1] = i;
-							ijbounds[3] = j;
-							}
-						else
-							{
-							ijbounds[1] = MIN(i + 2 * ipickstride - 1, data->primary_nx - 1);
-							ijbounds[3] = MIN(j + 2 * jpickstride - 1, data->primary_ny - 1);
-							}
-						if (found == MB_NO)
-							{
-							data->viewbounds[0] = ijbounds[0];
-							data->viewbounds[1] = ijbounds[1];
-							data->viewbounds[2] = ijbounds[2];
-							data->viewbounds[3] = ijbounds[3];
-							found = MB_YES;
-							}
-						else
-							{
-							data->viewbounds[0] = MIN(ijbounds[0], data->viewbounds[0]);
-							data->viewbounds[1] = MAX(ijbounds[1], data->viewbounds[1]);
-							data->viewbounds[2] = MIN(ijbounds[2], data->viewbounds[2]);
-							data->viewbounds[3] = MAX(ijbounds[3], data->viewbounds[3]);
-							}
-/*fprintf(stderr,"CORNERS: i:%d j:%d data->viewbounds: %d %d %d %d\n",
-i,j,data->viewbounds[0],
-data->viewbounds[1],
-data->viewbounds[2],
-data->viewbounds[3]);*/
-						}
-					}
-				}
-			data->viewbounds[0] = MAX(data->viewbounds[0] - stride, 0);
-			data->viewbounds[1] = MIN(data->viewbounds[1] + stride, data->primary_nx - 1);
-			data->viewbounds[2] = MAX(data->viewbounds[2] - stride, 0);
-			data->viewbounds[3] = MIN(data->viewbounds[3] + stride, data->primary_ny - 1);
-
-			/* reset buffer mode */
-			glReadBuffer(GL_FRONT);
-			}
-/*fprintf(stderr,"data->viewbounds: %d %d %d %d\n",
-data->viewbounds[0], data->viewbounds[1], data->viewbounds[2], data->viewbounds[3]);*/
-
-#ifdef MBV_GET_GLX_ERRORS
-mbview_glerrorcheck(instance, __FILE__, __LINE__, function_name);
-#endif
-		}
-
-	/* print output debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       viewbounds[0]:   %d\n",data->viewbounds[0]);
-		fprintf(stderr,"dbg2       viewbounds[1]:   %d\n",data->viewbounds[1]);
-		fprintf(stderr,"dbg2       viewbounds[2]:   %d\n",data->viewbounds[2]);
-		fprintf(stderr,"dbg2       viewbounds[3]:   %d\n",data->viewbounds[3]);
-		fprintf(stderr,"dbg2       status:          %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-/*------------------------------------------------------------------------------*/
-int mbview_drapesegment(size_t instance, struct mbview_linesegment_struct *seg)
-{
-
-	/* local variables */
-	char	*function_name = "mbview_drapesegment";
-	int	status = MB_SUCCESS;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-	int	i;
-
-	/* print starting debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       instance:         %zu\n",instance);
-		fprintf(stderr,"dbg2       seg:              %p\n", seg);
-		fprintf(stderr,"dbg2       seg->endpoints:\n");
-		fprintf(stderr,"dbg2            xgrid[0]:    %f\n",seg->endpoints[0].xgrid);
-		fprintf(stderr,"dbg2            ygrid[0]:    %f\n",seg->endpoints[0].ygrid);
-		fprintf(stderr,"dbg2            xlon[0]:     %f\n",seg->endpoints[0].xlon);
-		fprintf(stderr,"dbg2            ylat[0]:     %f\n",seg->endpoints[0].ylat);
-		fprintf(stderr,"dbg2            xgrid[1]:    %f\n",seg->endpoints[1].xgrid);
-		fprintf(stderr,"dbg2            ygrid[1]:    %f\n",seg->endpoints[1].ygrid);
-		fprintf(stderr,"dbg2            xlon[1]:     %f\n",seg->endpoints[1].xlon);
-		fprintf(stderr,"dbg2            ylat[1]:     %f\n",seg->endpoints[1].ylat);
-		}
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* only plot if this view is still active */
-	if (view->glx_init == MB_YES)
-		{
-
-		/* if spheroid dipslay project on great circle arc */
-		if (data->display_projection_mode == MBV_PROJECTION_SPHEROID)
-			{
-			status = mbview_drapesegment_gc(instance, seg);
-			}
-
-		/* else project on straight lines in grid projection */
-		else
-			{
-			status = mbview_drapesegment_grid(instance, seg);
-			}
-		}
-
-	/* print output debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:          %d\n",status);
-		fprintf(stderr,"dbg2       seg->endpoints:\n");
-		fprintf(stderr,"dbg2            xgrid[0]:    %f\n",seg->endpoints[0].xgrid);
-		fprintf(stderr,"dbg2            ygrid[0]:    %f\n",seg->endpoints[0].ygrid);
-		fprintf(stderr,"dbg2            xlon[0]:     %f\n",seg->endpoints[0].xlon);
-		fprintf(stderr,"dbg2            ylat[0]:     %f\n",seg->endpoints[0].ylat);
-		fprintf(stderr,"dbg2            xgrid[1]:    %f\n",seg->endpoints[1].xgrid);
-		fprintf(stderr,"dbg2            ygrid[1]:    %f\n",seg->endpoints[1].ygrid);
-		fprintf(stderr,"dbg2            xlon[1]:     %f\n",seg->endpoints[1].xlon);
-		fprintf(stderr,"dbg2            ylat[1]:     %f\n",seg->endpoints[1].ylat);
-		fprintf(stderr,"dbg2       seg->nls:        %d\n",seg->nls);
-		fprintf(stderr,"dbg2       seg->nls_alloc:  %d\n",seg->nls_alloc);
-		fprintf(stderr,"dbg2       seg->lspoints:\n");
-		for (i=0;i<seg->nls;i++)
-			{
-			fprintf(stderr,"dbg2         point[%4d]:    %f %f %f  %f %f  %f %f %f\n",
-				i, seg->lspoints[i].xgrid, seg->lspoints[i].ygrid,  seg->lspoints[i].zdata,
-				 seg->lspoints[i].xlon, seg->lspoints[i].ylat,
-				 seg->lspoints[i].xdisplay, seg->lspoints[i].ydisplay,
-				 seg->lspoints[i].zdisplay);
-			}
-		}
-
-	/* return */
-	return(status);
-}
-
-
-/*------------------------------------------------------------------------------*/
-int mbview_drapesegment_gc(size_t instance, struct mbview_linesegment_struct *seg)
-{
-
-	/* local variables */
-	char	*function_name = "mbview_drapesegment_gc";
-	int	status = MB_SUCCESS;
-	int	error = MB_ERROR_NO_ERROR;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-	int	global;
-	double	offset_factor;
-	int	nsegpoint;
-	double	xlon1, ylat1, xlon2, ylat2;
-	double	segbearing, dsegbearing, segdist, dsegdist;
-	int	done;
-	int	i, j, icnt;
-
-
-	/* print starting debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       instance:         %zu\n",instance);
-		fprintf(stderr,"dbg2       seg:              %p\n", seg);
-		fprintf(stderr,"dbg2       seg->endpoints:\n");
-		fprintf(stderr,"dbg2            xgrid[0]:    %f\n",seg->endpoints[0].xgrid);
-		fprintf(stderr,"dbg2            ygrid[0]:    %f\n",seg->endpoints[0].ygrid);
-		fprintf(stderr,"dbg2            xlon[0]:     %f\n",seg->endpoints[0].xlon);
-		fprintf(stderr,"dbg2            ylat[0]:     %f\n",seg->endpoints[0].ylat);
-		fprintf(stderr,"dbg2            xgrid[1]:    %f\n",seg->endpoints[1].xgrid);
-		fprintf(stderr,"dbg2            ygrid[1]:    %f\n",seg->endpoints[1].ygrid);
-		fprintf(stderr,"dbg2            xlon[1]:     %f\n",seg->endpoints[1].xlon);
-		fprintf(stderr,"dbg2            ylat[1]:     %f\n",seg->endpoints[1].ylat);
-		}
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* reset done flag */
-	done = MB_NO;
-
-	/* check if the contour offset needs to be applied in a global spherical direction or just up */
-	if (data->display_projection_mode == MBV_PROJECTION_SPHEROID
-		&& view->sphere_refx == 0.0
-		&& view->sphere_refy == 0.0
-		&& view->sphere_refz == 0.0)
-		{
-		global = MB_YES;
-		offset_factor = 10.0 * MBV_OPENGL_3D_CONTOUR_OFFSET / (view->scale * MBV_SPHEROID_RADIUS);
-		}
-	else
-		{
-		global = MB_NO;
-		offset_factor = 10.0 * MBV_OPENGL_3D_CONTOUR_OFFSET;
-		}
-
-	/* get half characteristic distance between grid points
-		from center of primary grid */
-	i = data->primary_nx / 2;
-	j = data->primary_ny / 2;
-	mbview_projectgrid2ll(instance,
-				(double)(data->primary_xmin + i * data->primary_dx),
-				(double)(data->primary_ymin + j * data->primary_dy),
-				&xlon1, &ylat1);
-	mbview_projectgrid2ll(instance,
- 				(double)(data->primary_xmin + (i + 1) * data->primary_dx),
-				(double)(data->primary_ymin + (j + 1) * data->primary_dy),
-				&xlon2, &ylat2);
-	mbview_greatcircle_distbearing(instance,
-			xlon1, ylat1, xlon2, ylat2,
-			&dsegbearing, &dsegdist);
-
-	/* get number of preliminary points along the segment */
-	mbview_greatcircle_distbearing(instance,
-			seg->endpoints[0].xlon, seg->endpoints[0].ylat,
-			seg->endpoints[1].xlon, seg->endpoints[1].ylat,
-			&segbearing, &segdist);
-	nsegpoint = MAX(((int)((segdist / dsegdist) + 1)), 2);
-
-	/* no need to fill in if the segment doesn't cross grid boundaries */
-	if (nsegpoint <= 2)
-		{
-		done = MB_YES;
-		seg->nls = 0;
-		seg->nls_alloc = 0;
-		}
-
-	/* get the points along the great circle arc */
-	else
-		{
-		/* get effective distance between points along great circle */
-		dsegdist = segdist / (nsegpoint - 1);
-
-		/* allocate segment points */
-		seg->nls_alloc = nsegpoint;
-		status = mb_reallocd(mbv_verbose, __FILE__, __LINE__,
-				seg->nls_alloc * sizeof(struct mbview_point_struct),
-				(void **)&(seg->lspoints), &error);
-		if (status == MB_FAILURE)
-			{
-			done = MB_YES;
-			seg->nls_alloc = 0;
-			seg->nls = 0;
-			}
-		}
-
-	/* now calculate points along great circle arc */
-	if (seg->nls_alloc > 1 && done == MB_NO)
-		{
-		/* put begin point in list */
-		seg->nls = 0;
-		seg->lspoints[seg->nls].xgrid = seg->endpoints[0].xgrid;
-		seg->lspoints[seg->nls].ygrid = seg->endpoints[0].ygrid;
-		seg->lspoints[seg->nls].zdata = seg->endpoints[0].zdata;
-		seg->lspoints[seg->nls].xlon = seg->endpoints[0].xlon;
-		seg->lspoints[seg->nls].ylat = seg->endpoints[0].ylat;
-		seg->nls++;
-
-		for (i=1;i<nsegpoint-1;i++)
-			{
-			mbview_greatcircle_endposition(instance,
-							seg->lspoints[0].xlon,
-							seg->lspoints[0].ylat,
-							segbearing,
-							(double)(i * dsegdist),
-							&(seg->lspoints[seg->nls].xlon),
-							&(seg->lspoints[seg->nls].ylat)),
-			status = mbview_projectll2xyzgrid(instance,
-							seg->lspoints[seg->nls].xlon,
-							seg->lspoints[seg->nls].ylat,
-							&(seg->lspoints[seg->nls].xgrid),
-							&(seg->lspoints[seg->nls].ygrid),
-							&(seg->lspoints[seg->nls].zdata));
-			if (status == MB_SUCCESS)
-				{
-				seg->nls++;
-				}
-			}
-
-		/* put end point in list */
-		seg->lspoints[seg->nls].xgrid = seg->endpoints[1].xgrid;
-		seg->lspoints[seg->nls].ygrid = seg->endpoints[1].ygrid;
-		seg->lspoints[seg->nls].zdata = seg->endpoints[1].zdata;
-		seg->lspoints[seg->nls].xlon = seg->endpoints[1].xlon;
-		seg->lspoints[seg->nls].ylat = seg->endpoints[1].ylat;
-		seg->nls++;
-
-		/* now calculate rest of point values */
-		for (icnt=0;icnt<seg->nls;icnt++)
-			{
-			mbview_projectll2display(instance,
-				seg->lspoints[icnt].xlon,
-				seg->lspoints[icnt].ylat,
-				seg->lspoints[icnt].zdata,
-				&(seg->lspoints[icnt].xdisplay),
-				&(seg->lspoints[icnt].ydisplay),
-				&(seg->lspoints[icnt].zdisplay));
-			if (data->display_projection_mode != MBV_PROJECTION_SPHEROID)
-				{
-				seg->lspoints[icnt].zdisplay += offset_factor;
-				}
-			else if (global == MB_YES)
-				{
-				seg->lspoints[icnt].xdisplay
-					+= seg->lspoints[icnt].xdisplay
-						* offset_factor;
-				seg->lspoints[icnt].ydisplay
-					+= seg->lspoints[icnt].ydisplay
-						* offset_factor;
-				seg->lspoints[icnt].zdisplay
-					+= seg->lspoints[icnt].zdisplay
-						* offset_factor;
-				}
-			else
-				{
-				seg->lspoints[icnt].zdisplay += offset_factor;
-				}
-			}
-		}
-
-	/* print output debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:          %d\n",status);
-		fprintf(stderr,"dbg2       seg->endpoints:\n");
-		fprintf(stderr,"dbg2            xgrid[0]:    %f\n",seg->endpoints[0].xgrid);
-		fprintf(stderr,"dbg2            ygrid[0]:    %f\n",seg->endpoints[0].ygrid);
-		fprintf(stderr,"dbg2            xlon[0]:     %f\n",seg->endpoints[0].xlon);
-		fprintf(stderr,"dbg2            ylat[0]:     %f\n",seg->endpoints[0].ylat);
-		fprintf(stderr,"dbg2            xgrid[1]:    %f\n",seg->endpoints[1].xgrid);
-		fprintf(stderr,"dbg2            ygrid[1]:    %f\n",seg->endpoints[1].ygrid);
-		fprintf(stderr,"dbg2            xlon[1]:     %f\n",seg->endpoints[1].xlon);
-		fprintf(stderr,"dbg2            ylat[1]:     %f\n",seg->endpoints[1].ylat);
-		fprintf(stderr,"dbg2       seg->nls:        %d\n",seg->nls);
-		fprintf(stderr,"dbg2       seg->nls_alloc:  %d\n",seg->nls_alloc);
-		fprintf(stderr,"dbg2       seg->lspoints:\n");
-		for (i=0;i<seg->nls;i++)
-			{
-			fprintf(stderr,"dbg2         point[%4d]:    %f %f %f  %f %f  %f %f %f\n",
-				i, seg->lspoints[i].xgrid, seg->lspoints[i].ygrid,  seg->lspoints[i].zdata,
-				 seg->lspoints[i].xlon, seg->lspoints[i].ylat,
-				 seg->lspoints[i].xdisplay, seg->lspoints[i].ydisplay,
-				 seg->lspoints[i].zdisplay);
-			}
-		}
-
-	/* return */
-	return(status);
-}
-
-/*------------------------------------------------------------------------------*/
-int mbview_drapesegment_grid(size_t instance, struct mbview_linesegment_struct *seg)
-{
-
-	/* local variables */
-	char	*function_name = "mbview_drapesegment_grid";
-	int	status = MB_SUCCESS;
-	int	error = MB_ERROR_NO_ERROR;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-	int	istart, iend, iadd, jstart, jend, jadd;
-	int	ni, nj;
-	double	mm, bb;
-	int	found, done, insert;
-	double	xgrid, ygrid, zdata;
-	int	global;
-	double	offset_factor;
-	int	i, j, k, l, ii, icnt, jcnt;
-
-	/* print starting debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       instance:         %zu\n",instance);
-		fprintf(stderr,"dbg2       seg:              %p\n", seg);
-		fprintf(stderr,"dbg2       seg->endpoints:\n");
-		fprintf(stderr,"dbg2            xgrid[0]:    %f\n",seg->endpoints[0].xgrid);
-		fprintf(stderr,"dbg2            ygrid[0]:    %f\n",seg->endpoints[0].ygrid);
-		fprintf(stderr,"dbg2            xgrid[1]:    %f\n",seg->endpoints[1].xgrid);
-		fprintf(stderr,"dbg2            ygrid[1]:    %f\n",seg->endpoints[1].ygrid);
-		}
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* reset done flag */
-	done = MB_NO;
-
-	/* check if the contour offset needs to be applied in a global spherical direction or just up */
-	if (data->display_projection_mode == MBV_PROJECTION_SPHEROID
-		&& view->sphere_refx == 0.0
-		&& view->sphere_refy == 0.0
-		&& view->sphere_refz == 0.0)
-		{
-		global = MB_YES;
-		offset_factor = 10.0 * MBV_OPENGL_3D_CONTOUR_OFFSET / (view->scale * MBV_SPHEROID_RADIUS);
-		}
-	else
-		{
-		global = MB_NO;
-		offset_factor = 10.0 * MBV_OPENGL_3D_CONTOUR_OFFSET;
-		}
-
-	/* figure out how many points to calculate along the segment */
-	istart = (int)((seg->endpoints[0].xgrid - data->primary_xmin)
-			/ data->primary_dx);
-	iend = (int)((seg->endpoints[1].xgrid - data->primary_xmin)
-			/ data->primary_dx);
-	jstart = (int)((seg->endpoints[0].ygrid - data->primary_ymin)
-			/ data->primary_dy);
-	jend = (int)((seg->endpoints[1].ygrid - data->primary_ymin)
-			/ data->primary_dy);
-
-	/* no need to fill in if the segment doesn't cross grid boundaries */
-	if (istart == iend && jstart == jend)
-		{
-		done = MB_YES;
-		seg->nls = 0;
-		}
-
-	/* else allocate space for the array of points */
-	else
-		{
-		/* allocate space for the array of points */
-		if (iend > istart)
-			{
-			ni = iend - istart;
-			iadd = 1;
-			istart++;
-			iend++;
-			}
-		else
-			{
-			ni = istart - iend;
-			iadd = -1;
-			}
-		if (jend > jstart)
-			{
-			nj = jend - jstart;
-			jadd = 1;
-			jstart++;
-			jend++;
-			}
-		else
-			{
-			nj = jstart - jend;
-			jadd = -1;
-			}
-		if ((ni + nj + 2) > seg->nls_alloc)
-			{
-			seg->nls_alloc = (ni + nj + 2);
-			status = mb_reallocd(mbv_verbose, __FILE__, __LINE__,
-			    		seg->nls_alloc * sizeof(struct mbview_point_struct),
-			    		(void **)&(seg->lspoints), &error);
-			if (status == MB_FAILURE)
-				{
-				done = MB_YES;
-				seg->nls_alloc = 0;
-				}
-			}
-		}
-
-	/* if points needed and space allocated do it */
-	if (done == MB_NO && ni + nj > 0)
-		{
-		/* put begin point in list */
-		seg->nls = 0;
-		seg->lspoints[seg->nls].xgrid = seg->endpoints[0].xgrid;
-		seg->lspoints[seg->nls].ygrid = seg->endpoints[0].ygrid;
-		seg->lspoints[seg->nls].zdata = seg->endpoints[0].zdata;
-		seg->nls++;
-
-		/* get line equation */
-		if (ni > 0 && seg->endpoints[1].xgrid != seg->endpoints[0].xgrid)
-			{
-			mm = (seg->endpoints[1].ygrid - seg->endpoints[0].ygrid)
-				/ (seg->endpoints[1].xgrid - seg->endpoints[0].xgrid);
-			bb = seg->endpoints[0].ygrid - mm * seg->endpoints[0].xgrid;
-			}
-
-		/* loop over xgrid */
-		insert = 1;
-		for (icnt=0;icnt<ni;icnt++)
-			{
-			i = istart + icnt * iadd;
-			xgrid = data->primary_xmin + i * data->primary_dx;
-			ygrid = mm * xgrid + bb;
-			j = (int)((ygrid - data->primary_ymin)
-					/ data->primary_dy);
-			k = i * data->primary_ny + j;
-			l = i * data->primary_ny + j + 1;
-			if (i >= 0 && i < data->primary_nx - 1
-				&& j >= 0 && j < data->primary_ny - 1
-				&& data->primary_data[k] != data->primary_nodatavalue
-				&& data->primary_data[l] != data->primary_nodatavalue)
-				{
-				/* interpolate zdata */
-				zdata = data->primary_data[k]
-					+ (ygrid - data->primary_ymin
-							- j * data->primary_dy)
-						/ data->primary_dy
-						* (data->primary_data[l]
-							- data->primary_data[k]);
-
-				/* add point to list */
-				seg->lspoints[seg->nls].xgrid = xgrid;
-				seg->lspoints[seg->nls].ygrid = ygrid;
-				seg->lspoints[seg->nls].zdata = zdata;
-				seg->nls++;
-				}
-			}
-
-		/* put end point in list */
-		seg->lspoints[seg->nls].xgrid = seg->endpoints[1].xgrid;
-		seg->lspoints[seg->nls].ygrid = seg->endpoints[1].ygrid;
-		seg->lspoints[seg->nls].zdata = seg->endpoints[1].zdata;
-		seg->nls++;
-
-		/* get line equation */
-		if (nj > 0 && seg->endpoints[1].ygrid != seg->endpoints[0].ygrid)
-			{
-			mm = (seg->endpoints[1].xgrid - seg->endpoints[0].xgrid)
-				/ (seg->endpoints[1].ygrid - seg->endpoints[0].ygrid);
-			bb = seg->endpoints[0].xgrid - mm * seg->endpoints[0].ygrid;
-			}
-
-		/* loop over ygrid */
-		insert = 1;
-		for (jcnt=0;jcnt<nj;jcnt++)
-			{
-			j = jstart + jcnt * jadd;
-			ygrid = data->primary_ymin + j * data->primary_dy;
-			xgrid = mm * ygrid + bb;
-			i = (int)((xgrid - data->primary_xmin)
-					/ data->primary_dx);
-			k = i * data->primary_ny + j;
-			l = (i + 1) * data->primary_ny + j;
-			if (i >= 0 && i < data->primary_nx - 1
-				&& j >= 0 && j < data->primary_ny - 1
-				&& data->primary_data[k] != data->primary_nodatavalue
-				&& data->primary_data[l] != data->primary_nodatavalue)
-				{
-				/* interpolate zdata */
-				zdata = data->primary_data[k]
-					+ (xgrid - data->primary_xmin
-							- i * data->primary_dx)
-						/ data->primary_dx
-						* (data->primary_data[l]
-							- data->primary_data[k]);
-
-				/* insert point into list */
-				found = MB_NO;
-				done = MB_NO;
-				if (jadd > 0) while (done == MB_NO)
-					{
-					if (ygrid > seg->lspoints[insert-1].ygrid
-						&& ygrid < seg->lspoints[insert].ygrid)
-						{
-						found = MB_YES;
-						done = MB_YES;
-						}
-					else if (ygrid == seg->lspoints[insert-1].ygrid
-						|| ygrid == seg->lspoints[insert].ygrid)
-						{
-						done = MB_YES;
-						}
-					else if (ygrid < seg->lspoints[insert-1].ygrid)
-						{
-						insert--;
-						}
-					else if (ygrid > seg->lspoints[insert].ygrid)
-						{
-						insert++;
-						}
-					if (insert <= 0 || insert >= seg->nls)
-						{
-						done = MB_YES;
-						}
-					}
-				else if (jadd < 0) while (done == MB_NO)
-					{
-					if (ygrid > seg->lspoints[insert].ygrid
-						&& ygrid < seg->lspoints[insert-1].ygrid)
-						{
-						found = MB_YES;
-						done = MB_YES;
-						}
-					else if (ygrid == seg->lspoints[insert].ygrid
-						|| ygrid == seg->lspoints[insert-1].ygrid)
-						{
-						done = MB_YES;
-						}
-					else if (ygrid > seg->lspoints[insert-1].ygrid)
-						{
-						insert--;
-						}
-					else if (ygrid < seg->lspoints[insert].ygrid)
-						{
-						insert++;
-						}
-					if (insert <= 0 || insert >= seg->nls)
-						{
-						done = MB_YES;
-						}
-					}
-				if (found == MB_YES)
-					{
-					for (ii=seg->nls;ii>insert;ii--)
-						{
-						seg->lspoints[ii].xgrid = seg->lspoints[ii-1].xgrid;
-						seg->lspoints[ii].ygrid = seg->lspoints[ii-1].ygrid;
-						seg->lspoints[ii].zdata = seg->lspoints[ii-1].zdata;
-						}
-					seg->lspoints[insert].xgrid = xgrid;
-					seg->lspoints[insert].ygrid = ygrid;
-					seg->lspoints[insert].zdata = zdata;
-					seg->nls++;
-					}
-				}
-			}
-
-		/* now calculate rest of point values */
-		for (icnt=0;icnt<seg->nls;icnt++)
-			{
-			mbview_projectforward(instance, MB_YES,
-				seg->lspoints[icnt].xgrid,
-				seg->lspoints[icnt].ygrid,
-				seg->lspoints[icnt].zdata,
-				&(seg->lspoints[icnt].xlon),
-				&(seg->lspoints[icnt].ylat),
-				&(seg->lspoints[icnt].xdisplay),
-				&(seg->lspoints[icnt].ydisplay),
-				&(seg->lspoints[icnt].zdisplay));
-			if (data->display_projection_mode != MBV_PROJECTION_SPHEROID)
-				{
-				seg->lspoints[icnt].zdisplay += offset_factor;
-				}
-			else if (global == MB_YES)
-				{
-				seg->lspoints[icnt].xdisplay
-					+= seg->lspoints[icnt].xdisplay
-						* offset_factor;
-				seg->lspoints[icnt].ydisplay
-					+= seg->lspoints[icnt].ydisplay
-						* offset_factor;
-				seg->lspoints[icnt].zdisplay
-					+= seg->lspoints[icnt].zdisplay
-						* offset_factor;
-				}
-			else
-				{
-				seg->lspoints[icnt].zdisplay += offset_factor;
-				}
-			}
-		}
-
-	/* print output debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:          %d\n",status);
-		fprintf(stderr,"dbg2       seg->nls:        %d\n",seg->nls);
-		fprintf(stderr,"dbg2       seg->nls_alloc:  %d\n",seg->nls_alloc);
-		fprintf(stderr,"dbg2       seg->lspoints:\n");
-		for (i=0;i<seg->nls;i++)
-			{
-			fprintf(stderr,"dbg2         point[%4d]:    %f %f %f  %f %f  %f %f %f\n",
-				i, seg->lspoints[i].xgrid, seg->lspoints[i].ygrid,  seg->lspoints[i].zdata,
-				 seg->lspoints[i].xlon, seg->lspoints[i].ylat,
-				 seg->lspoints[i].xdisplay, seg->lspoints[i].ydisplay,
-				 seg->lspoints[i].zdisplay);
-			}
-		}
-
-	/* return */
-	return(status);
-}
-
-/*------------------------------------------------------------------------------*/
-int mbview_drapesegmentw(size_t instance, struct mbview_linesegmentw_struct *seg)
-{
-
-	/* local variables */
-	char	*function_name = "mbview_drapesegmentw";
-	int	status = MB_SUCCESS;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-	int	i;
-
-	/* print starting debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       instance:         %zu\n",instance);
-		fprintf(stderr,"dbg2       seg:              %p\n", seg);
-		fprintf(stderr,"dbg2       seg->endpoints:\n");
-		fprintf(stderr,"dbg2            xgrid[0]:    %f\n",seg->endpoints[0].xgrid[instance]);
-		fprintf(stderr,"dbg2            ygrid[0]:    %f\n",seg->endpoints[0].ygrid[instance]);
-		fprintf(stderr,"dbg2            xlon[0]:     %f\n",seg->endpoints[0].xlon);
-		fprintf(stderr,"dbg2            ylat[0]:     %f\n",seg->endpoints[0].ylat);
-		fprintf(stderr,"dbg2            xgrid[1]:    %f\n",seg->endpoints[1].xgrid[instance]);
-		fprintf(stderr,"dbg2            ygrid[1]:    %f\n",seg->endpoints[1].ygrid[instance]);
-		fprintf(stderr,"dbg2            xlon[1]:     %f\n",seg->endpoints[1].xlon);
-		fprintf(stderr,"dbg2            ylat[1]:     %f\n",seg->endpoints[1].ylat);
-		}
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* if spheroid dipslay project on great circle arc */
-	if (data->display_projection_mode == MBV_PROJECTION_SPHEROID)
-		{
-		status = mbview_drapesegmentw_gc(instance, seg);
-		}
-
-	/* else project on straight lines in grid projection */
-	else
-		{
-		status = mbview_drapesegmentw_grid(instance, seg);
-		}
-
-	/* print output debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:          %d\n",status);
-		fprintf(stderr,"dbg2       seg->endpoints:\n");
-		fprintf(stderr,"dbg2            xgrid[0]:    %f\n",seg->endpoints[0].xgrid[instance]);
-		fprintf(stderr,"dbg2            ygrid[0]:    %f\n",seg->endpoints[0].ygrid[instance]);
-		fprintf(stderr,"dbg2            xlon[0]:     %f\n",seg->endpoints[0].xlon);
-		fprintf(stderr,"dbg2            ylat[0]:     %f\n",seg->endpoints[0].ylat);
-		fprintf(stderr,"dbg2            xgrid[1]:    %f\n",seg->endpoints[1].xgrid[instance]);
-		fprintf(stderr,"dbg2            ygrid[1]:    %f\n",seg->endpoints[1].ygrid[instance]);
-		fprintf(stderr,"dbg2            xlon[1]:     %f\n",seg->endpoints[1].xlon);
-		fprintf(stderr,"dbg2            ylat[1]:     %f\n",seg->endpoints[1].ylat);
-		fprintf(stderr,"dbg2       seg->nls:        %d\n",seg->nls);
-		fprintf(stderr,"dbg2       seg->nls_alloc:  %d\n",seg->nls_alloc);
-		fprintf(stderr,"dbg2       seg->lspoints:\n");
-		for (i=0;i<seg->nls;i++)
-			{
-			fprintf(stderr,"dbg2         point[%4d]:    %f %f %f  %f %f  %f %f %f\n",
-				i, seg->lspoints[i].xgrid[instance],
-				seg->lspoints[i].ygrid[instance],
-				seg->lspoints[i].zdata,
-				seg->lspoints[i].xlon,
-				seg->lspoints[i].ylat,
-				seg->lspoints[i].xdisplay[instance],
-				seg->lspoints[i].ydisplay[instance],
-				seg->lspoints[i].zdisplay[instance]);
-			}
-		}
-
-	/* return */
-	return(status);
-}
-
-
-/*------------------------------------------------------------------------------*/
-int mbview_drapesegmentw_gc(size_t instance, struct mbview_linesegmentw_struct *seg)
-{
-
-	/* local variables */
-	char	*function_name = "mbview_drapesegmentw_gc";
-	int	status = MB_SUCCESS;
-	int	error = MB_ERROR_NO_ERROR;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-	int	global;
-	double	offset_factor;
-	int	nsegpoint;
-	double	xlon1, ylat1, xlon2, ylat2;
-	double	segbearing, dsegbearing, segdist, dsegdist;
-	int	done;
-	int	i, j, icnt;
-
-
-	/* print starting debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       instance:         %zu\n",instance);
-		fprintf(stderr,"dbg2       seg:              %p\n", seg);
-		fprintf(stderr,"dbg2       seg->endpoints:\n");
-		fprintf(stderr,"dbg2            xgrid[0]:    %f\n",seg->endpoints[0].xgrid[instance]);
-		fprintf(stderr,"dbg2            ygrid[0]:    %f\n",seg->endpoints[0].ygrid[instance]);
-		fprintf(stderr,"dbg2            xlon[0]:     %f\n",seg->endpoints[0].xlon);
-		fprintf(stderr,"dbg2            ylat[0]:     %f\n",seg->endpoints[0].ylat);
-		fprintf(stderr,"dbg2            xgrid[1]:    %f\n",seg->endpoints[1].xgrid[instance]);
-		fprintf(stderr,"dbg2            ygrid[1]:    %f\n",seg->endpoints[1].ygrid[instance]);
-		fprintf(stderr,"dbg2            xlon[1]:     %f\n",seg->endpoints[1].xlon);
-		fprintf(stderr,"dbg2            ylat[1]:     %f\n",seg->endpoints[1].ylat);
-		}
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* reset done flag */
-	done = MB_NO;
-
-	/* check if the contour offset needs to be applied in a global spherical direction or just up */
-	if (data->display_projection_mode == MBV_PROJECTION_SPHEROID
-		&& view->sphere_refx == 0.0
-		&& view->sphere_refy == 0.0
-		&& view->sphere_refz == 0.0)
-		{
-		global = MB_YES;
-		offset_factor = 10.0 * MBV_OPENGL_3D_CONTOUR_OFFSET / (view->scale * MBV_SPHEROID_RADIUS);
-		}
-	else
-		{
-		global = MB_NO;
-		offset_factor = 10.0 * MBV_OPENGL_3D_CONTOUR_OFFSET;
-		}
-
-	/* get half characteristic distance between grid points
-		from center of primary grid */
-	i = data->primary_nx / 2;
-	j = data->primary_ny / 2;
-	mbview_projectgrid2ll(instance,
-				(double)(data->primary_xmin + i * data->primary_dx),
-				(double)(data->primary_ymin + j * data->primary_dy),
-				&xlon1, &ylat1);
-	mbview_projectgrid2ll(instance,
- 				(double)(data->primary_xmin + (i + 1) * data->primary_dx),
-				(double)(data->primary_ymin + (j + 1) * data->primary_dy),
-				&xlon2, &ylat2);
-	mbview_greatcircle_distbearing(instance,
-			xlon1, ylat1, xlon2, ylat2,
-			&dsegbearing, &dsegdist);
-
-	/* get number of preliminary points along the segment */
-	mbview_greatcircle_distbearing(instance,
-			seg->endpoints[0].xlon, seg->endpoints[0].ylat,
-			seg->endpoints[1].xlon, seg->endpoints[1].ylat,
-			&segbearing, &segdist);
-	nsegpoint = MAX(((int)((segdist / dsegdist) + 1)), 2);
-
-	/* no need to fill in if the segment doesn't cross grid boundaries */
-	if (nsegpoint <= 2)
-		{
-		done = MB_YES;
-		seg->nls = 0;
-		seg->nls_alloc = 0;
-		}
-
-	/* get the points along the great circle arc */
-	else
-		{
-		/* get effective distance between points along great circle */
-		dsegdist = segdist / (nsegpoint - 1);
-
-		/* allocate segment points */
-		seg->nls_alloc = nsegpoint;
-		status = mb_reallocd(mbv_verbose, __FILE__, __LINE__,
-				seg->nls_alloc * sizeof(struct mbview_pointw_struct),
-				(void **)&(seg->lspoints), &error);
-		if (status == MB_FAILURE)
-			{
-			done = MB_YES;
-			seg->nls_alloc = 0;
-			seg->nls = 0;
-			}
-		}
-
-	/* now calculate points along great circle arc */
-	if (seg->nls_alloc > 1 && done == MB_NO)
-		{
-		/* put begin point in list */
-		seg->nls = 0;
-		seg->lspoints[seg->nls].xgrid[instance] = seg->endpoints[0].xgrid[instance];
-		seg->lspoints[seg->nls].ygrid[instance] = seg->endpoints[0].ygrid[instance];
-		seg->lspoints[seg->nls].zdata = seg->endpoints[0].zdata;
-		seg->lspoints[seg->nls].xlon = seg->endpoints[0].xlon;
-		seg->lspoints[seg->nls].ylat = seg->endpoints[0].ylat;
-		seg->nls++;
-
-		for (i=1;i<nsegpoint-1;i++)
-			{
-			mbview_greatcircle_endposition(instance,
-							seg->lspoints[0].xlon,
-							seg->lspoints[0].ylat,
-							segbearing,
-							(double)(i * dsegdist),
-							&(seg->lspoints[seg->nls].xlon),
-							&(seg->lspoints[seg->nls].ylat)),
-			status = mbview_projectll2xyzgrid(instance,
-							seg->lspoints[seg->nls].xlon,
-							seg->lspoints[seg->nls].ylat,
-							&(seg->lspoints[seg->nls].xgrid[instance]),
-							&(seg->lspoints[seg->nls].ygrid[instance]),
-							&(seg->lspoints[seg->nls].zdata));
-			if (status == MB_SUCCESS)
-				{
-				seg->nls++;
-				}
-			}
-
-		/* put end point in list */
-		seg->lspoints[seg->nls].xgrid[instance] = seg->endpoints[1].xgrid[instance];
-		seg->lspoints[seg->nls].ygrid[instance] = seg->endpoints[1].ygrid[instance];
-		seg->lspoints[seg->nls].zdata = seg->endpoints[1].zdata;
-		seg->lspoints[seg->nls].xlon = seg->endpoints[1].xlon;
-		seg->lspoints[seg->nls].ylat = seg->endpoints[1].ylat;
-		seg->nls++;
-
-		/* now calculate rest of point values */
-		for (icnt=0;icnt<seg->nls;icnt++)
-			{
-			mbview_projectll2display(instance,
-				seg->lspoints[icnt].xlon,
-				seg->lspoints[icnt].ylat,
-				seg->lspoints[icnt].zdata,
-				&(seg->lspoints[icnt].xdisplay[instance]),
-				&(seg->lspoints[icnt].ydisplay[instance]),
-				&(seg->lspoints[icnt].zdisplay[instance]));
-			if (data->display_projection_mode != MBV_PROJECTION_SPHEROID)
-				{
-				seg->lspoints[icnt].zdisplay[instance] += offset_factor;
-				}
-			else if (global == MB_YES)
-				{
-				seg->lspoints[icnt].xdisplay[instance]
-					+= seg->lspoints[icnt].xdisplay[instance]
-						* offset_factor;
-				seg->lspoints[icnt].ydisplay[instance]
-					+= seg->lspoints[icnt].ydisplay[instance]
-						* offset_factor;
-				seg->lspoints[icnt].zdisplay[instance]
-					+= seg->lspoints[icnt].zdisplay[instance]
-						* offset_factor;
-				}
-			else
-				{
-				seg->lspoints[icnt].zdisplay[instance] += offset_factor;
-				}
-			}
-		}
-
-	/* print output debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:          %d\n",status);
-		fprintf(stderr,"dbg2       seg->endpoints:\n");
-		fprintf(stderr,"dbg2            xgrid[0]:    %f\n",seg->endpoints[0].xgrid[instance]);
-		fprintf(stderr,"dbg2            ygrid[0]:    %f\n",seg->endpoints[0].ygrid[instance]);
-		fprintf(stderr,"dbg2            xlon[0]:     %f\n",seg->endpoints[0].xlon);
-		fprintf(stderr,"dbg2            ylat[0]:     %f\n",seg->endpoints[0].ylat);
-		fprintf(stderr,"dbg2            xgrid[1]:    %f\n",seg->endpoints[1].xgrid[instance]);
-		fprintf(stderr,"dbg2            ygrid[1]:    %f\n",seg->endpoints[1].ygrid[instance]);
-		fprintf(stderr,"dbg2            xlon[1]:     %f\n",seg->endpoints[1].xlon);
-		fprintf(stderr,"dbg2            ylat[1]:     %f\n",seg->endpoints[1].ylat);
-		fprintf(stderr,"dbg2       seg->nls:        %d\n",seg->nls);
-		fprintf(stderr,"dbg2       seg->nls_alloc:  %d\n",seg->nls_alloc);
-		fprintf(stderr,"dbg2       seg->lspoints:\n");
-		for (i=0;i<seg->nls;i++)
-			{
-			fprintf(stderr,"dbg2         point[%4d]:    %f %f %f  %f %f  %f %f %f\n",
-				i, seg->lspoints[i].xgrid[instance],
-				seg->lspoints[i].ygrid[instance],
-				seg->lspoints[i].zdata,
-				seg->lspoints[i].xlon,
-				seg->lspoints[i].ylat,
-				seg->lspoints[i].xdisplay[instance],
-				seg->lspoints[i].ydisplay[instance],
-				seg->lspoints[i].zdisplay[instance]);
-			}
-		}
-
-	/* return */
-	return(status);
-}
-
-/*------------------------------------------------------------------------------*/
-int mbview_drapesegmentw_grid(size_t instance, struct mbview_linesegmentw_struct *seg)
-{
-
-	/* local variables */
-	char	*function_name = "mbview_drapesegmentw_grid";
-	int	status = MB_SUCCESS;
-	int	error = MB_ERROR_NO_ERROR;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-	int	istart, iend, iadd, jstart, jend, jadd;
-	int	ni, nj;
-	double	mm, bb;
-	int	found, done, insert;
-	double	xgrid, ygrid, zdata;
-	double	xgridstart, xgridend, ygridstart, ygridend;
-	int	global;
-	double	offset_factor;
-	int	i, j, k, l, ii, icnt, jcnt;
-
-	/* print starting debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       instance:         %zu\n",instance);
-		fprintf(stderr,"dbg2       seg:              %p\n", seg);
-		fprintf(stderr,"dbg2       seg->endpoints:\n");
-		fprintf(stderr,"dbg2            xgrid[0]:    %f\n",seg->endpoints[0].xgrid[instance]);
-		fprintf(stderr,"dbg2            ygrid[0]:    %f\n",seg->endpoints[0].ygrid[instance]);
-		fprintf(stderr,"dbg2            xgrid[1]:    %f\n",seg->endpoints[1].xgrid[instance]);
-		fprintf(stderr,"dbg2            ygrid[1]:    %f\n",seg->endpoints[1].ygrid[instance]);
-		}
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* reset done flag */
-	done = MB_NO;
-
-	/* check if the contour offset needs to be applied in a global spherical direction or just up */
-	if (data->display_projection_mode == MBV_PROJECTION_SPHEROID
-		&& view->sphere_refx == 0.0
-		&& view->sphere_refy == 0.0
-		&& view->sphere_refz == 0.0)
-		{
-		global = MB_YES;
-		offset_factor = 10.0 * MBV_OPENGL_3D_CONTOUR_OFFSET / (view->scale * MBV_SPHEROID_RADIUS);
-		}
-	else
-		{
-		global = MB_NO;
-		offset_factor = 10.0 * MBV_OPENGL_3D_CONTOUR_OFFSET;
-		}
-
-	/* figure out how many points to calculate along the segment */
-	xgridstart = seg->endpoints[0].xgrid[instance];
-	xgridend = seg->endpoints[1].xgrid[instance];
-	ygridstart = seg->endpoints[0].ygrid[instance];
-	ygridend = seg->endpoints[1].ygrid[instance];
-	istart = (int)((xgridstart - data->primary_xmin)
-			/ data->primary_dx);
-	iend = (int)((xgridend - data->primary_xmin)
-			/ data->primary_dx);
-	jstart = (int)((ygridstart - data->primary_ymin)
-			/ data->primary_dy);
-	jend = (int)((ygridend - data->primary_ymin)
-			/ data->primary_dy);
-	if (istart < 0) istart = 0;
-	if (istart >= data->primary_nx) istart = data->primary_nx -1;
-	if (iend < 0) iend = 0;
-	if (iend >= data->primary_nx) iend = data->primary_nx -1;
-	if (jstart < 0) jstart = 0;
-	if (jstart >= data->primary_nx) jstart = data->primary_ny -1;
-	if (jend < 0) jend = 0;
-	if (jend >= data->primary_nx) jend = data->primary_ny -1;
-/* fprintf(stderr,"mbview_drapesegmentw_grid: xgridstart:%f xgridend:%f ygridstart:%f ygridend:%f\n",
-xgridstart,xgridend,ygridstart,ygridend);
-fprintf(stderr,"mbview_drapesegmentw_grid: istart:%d iend:%d jstart:%d jend:%d\n",istart,iend,jstart,jend);*/
-
-	/* no need to fill in if the segment doesn't cross grid boundaries */
-	if (istart == iend && jstart == jend)
-		{
-		done = MB_YES;
-		seg->nls = 0;
-		}
-
-	/* else allocate space for the array of points */
-	else
-		{
-		/* allocate space for the array of points */
-		if (iend > istart)
-			{
-			ni = iend - istart;
-			iadd = 1;
-			istart++;
-			iend++;
-			}
-		else
-			{
-			ni = istart - iend;
-			iadd = -1;
-			}
-		if (jend > jstart)
-			{
-			nj = jend - jstart;
-			jadd = 1;
-			jstart++;
-			jend++;
-			}
-		else
-			{
-			nj = jstart - jend;
-			jadd = -1;
-			}
-		if ((ni + nj + 2) > seg->nls_alloc)
-			{
-			seg->nls_alloc = (ni + nj + 2);
-			status = mb_reallocd(mbv_verbose, __FILE__, __LINE__,
-			    		seg->nls_alloc * sizeof(struct mbview_pointw_struct),
-			    		(void **)&(seg->lspoints), &error);
-			if (status == MB_FAILURE)
-				{
-				done = MB_YES;
-				seg->nls_alloc = 0;
-				}
-			}
-		}
-/*fprintf(stderr,"mbview_drapesegmentw_grid: ni:%d nj:%d iadd:%d istart:%d iend:%d jadd:%d jstart:%d jend:%d\n",
-ni,nj,iadd,istart,iend,jadd,jstart,jend);*/
-
-	/* if points needed and space allocated do it */
-	if (done == MB_NO && ni + nj > 0)
-		{
-		/* put begin point in list */
-		seg->nls = 0;
-		seg->lspoints[seg->nls].xgrid[instance] = seg->endpoints[0].xgrid[instance];
-		seg->lspoints[seg->nls].ygrid[instance] = seg->endpoints[0].ygrid[instance];
-		seg->lspoints[seg->nls].zdata = seg->endpoints[0].zdata;
-		seg->nls++;
-
-		/* get line equation */
-		if (ni > 0 && seg->endpoints[1].xgrid[instance] != seg->endpoints[0].xgrid[instance])
-			{
-			mm = (seg->endpoints[1].ygrid[instance] - seg->endpoints[0].ygrid[instance])
-				/ (seg->endpoints[1].xgrid[instance] - seg->endpoints[0].xgrid[instance]);
-			bb = seg->endpoints[0].ygrid[instance] - mm * seg->endpoints[0].xgrid[instance];
-			}
-
-		/* loop over xgrid */
-		for (icnt=0;icnt<ni;icnt++)
-			{
-			i = istart + icnt * iadd;
-			xgrid = data->primary_xmin + i * data->primary_dx;
-			ygrid = mm * xgrid + bb;
-			j = (int)((ygrid - data->primary_ymin)
-					/ data->primary_dy);
-			k = i * data->primary_ny + j;
-			l = i * data->primary_ny + j + 1;
-			if (i >= 0 && i < data->primary_nx - 1
-				&& j >= 0 && j < data->primary_ny - 1
-				&& data->primary_data[k] != data->primary_nodatavalue
-				&& data->primary_data[l] != data->primary_nodatavalue)
-				{
-				/* interpolate zdata */
-				zdata = data->primary_data[k]
-					+ (ygrid - data->primary_ymin
-							- j * data->primary_dy)
-						/ data->primary_dy
-						* (data->primary_data[l]
-							- data->primary_data[k]);
-
-				/* add point to list */
-				seg->lspoints[seg->nls].xgrid[instance] = xgrid;
-				seg->lspoints[seg->nls].ygrid[instance] = ygrid;
-				seg->lspoints[seg->nls].zdata = zdata;
-				seg->nls++;
-/*fprintf(stderr,"new ni point: nls:%d icnt:%d i:%d j:%d k:%d l:%d xgrid:%f ygrid:%f zdata:%f\n",
-seg->nls,icnt,i,j,k,l,xgrid,ygrid,zdata);*/
-				}
-			}
-
-		/* put end point in list */
-		seg->lspoints[seg->nls].xgrid[instance] = seg->endpoints[1].xgrid[instance];
-		seg->lspoints[seg->nls].ygrid[instance] = seg->endpoints[1].ygrid[instance];
-		seg->lspoints[seg->nls].zdata = seg->endpoints[1].zdata;
-		seg->nls++;
-
-		/* get line equation */
-		if (nj > 0 && seg->endpoints[1].ygrid[instance] != seg->endpoints[0].ygrid[instance])
-			{
-			mm = (seg->endpoints[1].xgrid[instance] - seg->endpoints[0].xgrid[instance])
-				/ (seg->endpoints[1].ygrid[instance] - seg->endpoints[0].ygrid[instance]);
-			bb = seg->endpoints[0].xgrid[instance] - mm * seg->endpoints[0].ygrid[instance];
-			}
-
-		/* loop over ygrid */
-		insert = 1;
-		for (jcnt=0;jcnt<nj;jcnt++)
-			{
-			j = jstart + jcnt * jadd;
-			ygrid = data->primary_ymin + j * data->primary_dy;
-			xgrid = mm * ygrid + bb;
-			i = (int)((xgrid - data->primary_xmin)
-					/ data->primary_dx);
-			k = i * data->primary_ny + j;
-			l = (i + 1) * data->primary_ny + j;
-			if (i >= 0 && i < data->primary_nx - 1
-				&& j >= 0 && j < data->primary_ny - 1
-				&& data->primary_data[k] != data->primary_nodatavalue
-				&& data->primary_data[l] != data->primary_nodatavalue)
-				{
-				/* interpolate zdata */
-				zdata = data->primary_data[k]
-					+ (xgrid - data->primary_xmin
-							- i * data->primary_dx)
-						/ data->primary_dx
-						* (data->primary_data[l]
-							- data->primary_data[k]);
-
-				/* insert point into list */
-				found = MB_NO;
-				done = MB_NO;
-				if (jadd > 0) while (done == MB_NO)
-					{
-					if (ygrid > seg->lspoints[insert-1].ygrid[instance]
-						&& ygrid < seg->lspoints[insert].ygrid[instance])
-						{
-						found = MB_YES;
-						done = MB_YES;
-						}
-					else if (ygrid == seg->lspoints[insert-1].ygrid[instance]
-						|| ygrid == seg->lspoints[insert].ygrid[instance])
-						{
-						done = MB_YES;
-						}
-					else if (ygrid < seg->lspoints[insert-1].ygrid[instance])
-						{
-						insert--;
-						}
-					else if (ygrid > seg->lspoints[insert].ygrid[instance])
-						{
-						insert++;
-						}
-					if (insert <= 0 || insert >= seg->nls)
-						{
-						done = MB_YES;
-						}
-/*fprintf(stderr,"jadd>0: insert:%d found:%d done:%d\n",insert,found,done);*/
-					}
-				else if (jadd < 0) while (done == MB_NO)
-					{
-					if (ygrid > seg->lspoints[insert].ygrid[instance]
-						&& ygrid < seg->lspoints[insert-1].ygrid[instance])
-						{
-						found = MB_YES;
-						done = MB_YES;
-						}
-					else if (ygrid == seg->lspoints[insert].ygrid[instance]
-						|| ygrid == seg->lspoints[insert-1].ygrid[instance])
-						{
-						done = MB_YES;
-						}
-					else if (ygrid > seg->lspoints[insert-1].ygrid[instance])
-						{
-						insert--;
-						}
-					else if (ygrid < seg->lspoints[insert].ygrid[instance])
-						{
-						insert++;
-						}
-					if (insert <= 0 || insert >= seg->nls)
-						{
-						done = MB_YES;
-						}
-/*fprintf(stderr,"jadd<0: insert:%d found:%d done:%d\n",insert,found,done);*/
-					}
-				if (insert < 0)
-					insert = 0;
-				else if (insert > seg->nls)
-					insert = seg->nls;
-				if (found == MB_YES)
-					{
-					for (ii=seg->nls;ii>insert;ii--)
-						{
-						seg->lspoints[ii].xgrid[instance] = seg->lspoints[ii-1].xgrid[instance];
-						seg->lspoints[ii].ygrid[instance] = seg->lspoints[ii-1].ygrid[instance];
-						seg->lspoints[ii].zdata = seg->lspoints[ii-1].zdata;
-						}
-					seg->lspoints[insert].xgrid[instance] = xgrid;
-					seg->lspoints[insert].ygrid[instance] = ygrid;
-					seg->lspoints[insert].zdata = zdata;
-					seg->nls++;
-/*fprintf(stderr,"new nj point: nls:%d jcnt:%d insert:%d jadd:%d i:%d j:%d k:%d l:%d xgrid:%f ygrid:%f zdata:%f\n",
-seg->nls,jcnt,insert,jadd,i,j,k,l,xgrid,ygrid,zdata);*/
-					}
-				if (insert <= 0)
-					insert = 1;
-				else if (insert >= seg->nls)
-					insert = seg->nls - 1;
-				}
-			}
-
-		/* now calculate rest of point values */
-		for (icnt=0;icnt<seg->nls;icnt++)
-			{
-			mbview_projectforward(instance, MB_YES,
-				seg->lspoints[icnt].xgrid[instance],
-				seg->lspoints[icnt].ygrid[instance],
-				seg->lspoints[icnt].zdata,
-				&(seg->lspoints[icnt].xlon),
-				&(seg->lspoints[icnt].ylat),
-				&(seg->lspoints[icnt].xdisplay[instance]),
-				&(seg->lspoints[icnt].ydisplay[instance]),
-				&(seg->lspoints[icnt].zdisplay[instance]));
-			if (data->display_projection_mode != MBV_PROJECTION_SPHEROID)
-				{
-				seg->lspoints[icnt].zdisplay[instance] += offset_factor;
-				}
-			else if (global == MB_YES)
-				{
-				seg->lspoints[icnt].xdisplay[instance]
-					+= seg->lspoints[icnt].xdisplay[instance]
-						* offset_factor;
-				seg->lspoints[icnt].ydisplay[instance]
-					+= seg->lspoints[icnt].ydisplay[instance]
-						* offset_factor;
-				seg->lspoints[icnt].zdisplay[instance]
-					+= seg->lspoints[icnt].zdisplay[instance]
-						* offset_factor;
-				}
-			else
-				{
-				seg->lspoints[icnt].zdisplay[instance] += offset_factor;
-				}
-			}
-		}
-
-	/* print output debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:          %d\n",status);
-		fprintf(stderr,"dbg2       seg->nls:        %d\n",seg->nls);
-		fprintf(stderr,"dbg2       seg->nls_alloc:  %d\n",seg->nls_alloc);
-		fprintf(stderr,"dbg2       seg->lspoints:\n");
-		for (i=0;i<seg->nls;i++)
-			{
-			fprintf(stderr,"dbg2         point[%4d]:    %f %f %f  %f %f  %f %f %f\n",
-				i, seg->lspoints[i].xgrid[instance],
-				seg->lspoints[i].ygrid[instance],
-				seg->lspoints[i].zdata,
-				seg->lspoints[i].xlon,
-				seg->lspoints[i].ylat,
-				seg->lspoints[i].xdisplay[instance],
-				seg->lspoints[i].ydisplay[instance],
-				seg->lspoints[i].zdisplay[instance]);
-			}
-		}
-
-	/* return */
-	return(status);
-}
-
-/*------------------------------------------------------------------------------*/
-int mbview_glerrorcheck(size_t instance, char *sourcefile, int line, char *sourcefunction)
-{
-
-	/* local variables */
-	char	*function_name = "mbview_glerrorcheck";
-	int	status = MB_SUCCESS;
-	GLenum	gl_error;
-	GLubyte *gl_error_msg;
-
-	/* print starting debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       instance:         %zu\n",instance);
-		fprintf(stderr,"dbg2       sourcefile:       %s\n",sourcefile);
-		fprintf(stderr,"dbg2       line:             %d\n",line);
-		fprintf(stderr,"dbg2       sourcefunction:   %s\n",sourcefunction);
-		}
-
-	/* check for OpenGL error if MBV_GET_GLX_ERRORS set */
-	gl_error = (GLenum)glGetError();
-	gl_error_msg = (GLubyte *)gluErrorString(gl_error);
-	if (gl_error != GL_NO_ERROR)
-		fprintf(stderr,"GLerror: Instance:%zu %s:%d Function %s: OpenGL error: %s\n",
-			instance, sourcefile, line, sourcefunction, gl_error_msg);
-
-	/* print output debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:          %d\n",status);
-		fprintf(stderr,"dbg2       gl_error:        %d\n",gl_error);
-		fprintf(stderr,"dbg2       gl_error_msg:    %s\n",gl_error_msg);
-		}
-
-	/* return */
-	return(status);
-}
-/*------------------------------------------------------------------------------*/
diff --git a/src/mbview/mbview_primary.c b/src/mbview/mbview_primary.c
deleted file mode 100644
index 1879d9b..0000000
--- a/src/mbview/mbview_primary.c
+++ /dev/null
@@ -1,494 +0,0 @@
-/*------------------------------------------------------------------------------
- *    The MB-system:	mbview_primary.c	9/25/2003
- *    $Id: mbview_primary.c 2239 2015-05-07 00:51:42Z caress $
- *
- *    Copyright (c) 2003-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *------------------------------------------------------------------------------*/
-/*
- *
- * Author:	D. W. Caress
- * Date:	September 25, 2003
- *
- * Note:	This code was broken out of mbview_callbacks.c, which was
- *		begun on October 7, 2002
- *
- */
-/*------------------------------------------------------------------------------*/
-
-/* Standard includes for builtins. */
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include <math.h>
-
-/* Motif required Headers */
-#include <X11/StringDefs.h>
-#include <X11/cursorfont.h>
-#include <Xm/Xm.h>
-#include <Xm/MainW.h>
-#include <Xm/DialogS.h>
-#include <Xm/RepType.h>
-#include <Xm/MwmUtil.h>
-#include <Xm/BulletinB.h>
-#include <Xm/RowColumn.h>
-#include <Xm/CascadeB.h>
-#include <Xm/PushB.h>
-#include <Xm/Separator.h>
-#include "MB3DView.h"
-#include "MB3DSiteList.h"
-#include "MB3DRouteList.h"
-#include "MB3DNavList.h"
-
-/* OpenGL include files */
-#ifdef WIN32
-#undef BOOL		/* It was defined by a chain of inclusions in the (patched) X11/Xmd.h */
-#include <windows.h>
-#endif
-
-#include <GL/gl.h>
-#include <GL/glu.h>
-#ifndef WIN32
-#	include <GL/glx.h>
-#endif
-#include "mb_glwdrawa.h"
-
-/* MBIO include files */
-#include "mb_status.h"
-#include "mb_define.h"
-
-/* mbview include */
-#include "mbview.h"
-#include "mbviewprivate.h"
-
-/*------------------------------------------------------------------------------*/
-
-/* local variables */
-static char rcs_id[]="$Id: mbview_primary.c 2239 2015-05-07 00:51:42Z caress $";
-
-/*------------------------------------------------------------------------------*/
-int mbview_setprimarygrid(int verbose, size_t instance,
-			int	primary_grid_projection_mode,
-			char	*primary_grid_projection_id,
-			float	primary_nodatavalue,
-			int	primary_nx,
-			int	primary_ny,
-			double	primary_min,
-			double	primary_max,
-			double	primary_xmin,
-			double	primary_xmax,
-			double	primary_ymin,
-			double	primary_ymax,
-			double	primary_dx,
-			double	primary_dy,
-			float	*primary_data,
-			int *error)
-
-{
-	/* local variables */
-	char	*function_name = "mbview_setprimarygrid";
-	int	status = MB_SUCCESS;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-
-	/* print starting debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:                      %d\n", verbose);
-		fprintf(stderr,"dbg2       instance:                     %zu\n", instance);
-		fprintf(stderr,"dbg2       primary_grid_projection_mode: %d\n", primary_grid_projection_mode);
-		fprintf(stderr,"dbg2       primary_grid_projection_id:   %s\n", primary_grid_projection_id);
-		fprintf(stderr,"dbg2       primary_nodatavalue:          %f\n", primary_nodatavalue);
-		fprintf(stderr,"dbg2       primary_nx:                   %d\n", primary_nx);
-		fprintf(stderr,"dbg2       primary_ny:                   %d\n", primary_ny);
-		fprintf(stderr,"dbg2       primary_min:                  %f\n", primary_min);
-		fprintf(stderr,"dbg2       primary_max:                  %f\n", primary_max);
-		fprintf(stderr,"dbg2       primary_xmin:                 %f\n", primary_xmin);
-		fprintf(stderr,"dbg2       primary_xmax:                 %f\n", primary_xmax);
-		fprintf(stderr,"dbg2       primary_ymin:                 %f\n", primary_ymin);
-		fprintf(stderr,"dbg2       primary_ymax:                 %f\n", primary_ymax);
-		fprintf(stderr,"dbg2       primary_dx:                   %f\n", primary_dx);
-		fprintf(stderr,"dbg2       primary_dy:                   %f\n", primary_dy);
-		fprintf(stderr,"dbg2       primary_data:                 %p\n", primary_data);
-		}
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* set values */
-        data->primary_grid_projection_mode = primary_grid_projection_mode;
-        strcpy(data->primary_grid_projection_id, primary_grid_projection_id);
-        data->primary_nodatavalue = primary_nodatavalue;
-        data->primary_nxy = primary_nx * primary_ny;
-        data->primary_nx = primary_nx;
-        data->primary_ny = primary_ny;
-        data->primary_min = primary_min;
-        data->primary_max = primary_max;
-        data->primary_xmin = primary_xmin;
-        data->primary_xmax = primary_xmax;
-        data->primary_ymin = primary_ymin;
-        data->primary_ymax = primary_ymax;
-        data->primary_dx = primary_dx;
-        data->primary_dy = primary_dy;
-	data->viewbounds[0] = 0;
-	data->viewbounds[1] = data->primary_nx;
-	data->viewbounds[2] = 0;
-	data->viewbounds[3] = data->primary_ny;
-
-	/* allocate required arrays */
-    	status = mb_mallocd(verbose, __FILE__, __LINE__, sizeof(float) * data->primary_nxy,
-    				(void **)&data->primary_data, error);
-    	if (status == MB_SUCCESS)
-	status = mb_mallocd(verbose, __FILE__, __LINE__, sizeof(float) * data->primary_nxy,
-    				(void **)&data->primary_x, error);
-    	if (status == MB_SUCCESS)
-    	status = mb_mallocd(verbose, __FILE__, __LINE__, sizeof(float) * data->primary_nxy,
-    				(void **)&data->primary_y, error);
-    	if (status == MB_SUCCESS)
-    	status = mb_mallocd(verbose, __FILE__, __LINE__, sizeof(float) * data->primary_nxy,
-    				(void **)&data->primary_z, error);
-    	if (status == MB_SUCCESS)
-    	status = mb_mallocd(verbose, __FILE__, __LINE__, sizeof(float) * data->primary_nxy,
-    				(void **)&data->primary_dzdx, error);
-    	if (status == MB_SUCCESS)
-    	status = mb_mallocd(verbose, __FILE__, __LINE__, sizeof(float) * data->primary_nxy,
-    				(void **)&data->primary_dzdy, error);
-    	if (status == MB_SUCCESS)
-    	status = mb_mallocd(verbose, __FILE__, __LINE__, sizeof(float) * data->primary_nxy,
-    				(void **)&data->primary_r, error);
-    	if (status == MB_SUCCESS)
-    	status = mb_mallocd(verbose, __FILE__, __LINE__, sizeof(float) * data->primary_nxy,
-    				(void **)&data->primary_g, error);
-     	if (status == MB_SUCCESS)
-   	status = mb_mallocd(verbose, __FILE__, __LINE__, sizeof(float) * data->primary_nxy,
-    				(void **)&data->primary_b, error);
-     	if (status == MB_SUCCESS)
-   	status = mb_mallocd(verbose, __FILE__, __LINE__, (data->primary_nxy / 8) + 1,
-    				(void **)&data->primary_stat_color, error);
-     	if (status == MB_SUCCESS)
-   	status = mb_mallocd(verbose, __FILE__, __LINE__, (data->primary_nxy / 8) + 1,
-    				(void **)&data->primary_stat_z, error);
-	if (status != MB_SUCCESS)
-	    {
-	    fprintf(stderr,"\nUnable to allocate memory to store primary grid data\n");
-	    fprintf(stderr,"\nProgram terminated in function <%s>.\n",
-		    function_name);
-	    exit(*error);
-	    }
-
-	/* copy grid */
-	memcpy(data->primary_data, primary_data, data->primary_nxy * sizeof(float));
-
-	/* reset contours and histograms */
-	view->contourlorez = MB_NO;
-	view->contourhirez = MB_NO;
-	view->contourfullrez = MB_NO;
-	view->primary_histogram_set = MB_NO;
-	view->primaryslope_histogram_set = MB_NO;
-
-	/* set status bit arrays */
-	mbview_setcolorparms(instance);
-	mbview_colorclear(instance);
-	mbview_zscaleclear(instance);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:                     %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:                    %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-
-/*------------------------------------------------------------------------------*/
-int mbview_updateprimarygrid(int verbose, size_t instance,
-			int	primary_nx,
-			int	primary_ny,
-			float	*primary_data,
-			int *error)
-
-{
-	/* local variables */
-	char	*function_name = "mbview_updateprimarygrid";
-	int	status = MB_SUCCESS;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-	int	first;
-	int	i, j, k;
-
-	/* print starting debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:                      %d\n", verbose);
-		fprintf(stderr,"dbg2       instance:                     %zu\n", instance);
-		fprintf(stderr,"dbg2       primary_nx:                   %d\n", primary_nx);
-		fprintf(stderr,"dbg2       primary_ny:                   %d\n", primary_ny);
-		fprintf(stderr,"dbg2       primary_data:                 %p\n", primary_data);
-		}
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* set value and calculate derivative */
-	if (primary_nx == data->primary_nx
-		&& primary_ny == data->primary_ny)
-		{
-		first = MB_YES;
-		for (k=0;k<data->primary_nx*data->primary_ny;k++)
-			{
-			data->primary_data[k] = primary_data[k];
-			if (first == MB_YES && primary_data[k] != data->primary_nodatavalue)
-				{
-				data->primary_min = data->primary_data[k];
-				data->primary_max = data->primary_data[k];
-				first = MB_NO;
-				}
-			else if (primary_data[k] != data->primary_nodatavalue)
-				{
-				data->primary_min = MIN(data->primary_min, data->primary_data[k]);
-				data->primary_max = MAX(data->primary_max, data->primary_data[k]);
-				}
-			}
-		for (i=0;i<data->primary_nx;i++)
-			{
-			for (j=0;j<data->primary_ny;j++)
-				{
-				mbview_derivative(instance, i, j);
-				}
-			}
-		}
-
-	/* reset plotting and colors */
-	view->lastdrawrez = MBV_REZ_NONE;
-	mbview_setcolorparms(instance);
-	mbview_colorclear(instance);
-
-	/* reset contour and histogram flags */
-	view->contourlorez = MB_NO;
-	view->contourhirez = MB_NO;
-	view->contourfullrez = MB_NO;
-	view->primary_histogram_set = MB_NO;
-	view->primaryslope_histogram_set = MB_NO;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:                     %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:                    %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-
-/*------------------------------------------------------------------------------*/
-int mbview_updateprimarygridcell(int verbose, size_t instance,
-			int	primary_ix,
-			int	primary_jy,
-			float	value,
-			int *error)
-
-{
-	/* local variables */
-	char	*function_name = "mbview_updateprimarygridcell";
-	int	status = MB_SUCCESS;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-	int	k;
-
-	/* print starting debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:                      %d\n", verbose);
-		fprintf(stderr,"dbg2       instance:                     %zu\n", instance);
-		fprintf(stderr,"dbg2       primary_ix:                   %d\n", primary_ix);
-		fprintf(stderr,"dbg2       primary_jy:                   %d\n", primary_jy);
-		fprintf(stderr,"dbg2       value:                        %f\n", value);
-		}
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* set value */
-	if (primary_ix >= 0 && primary_ix < data->primary_nx
-		&& primary_jy >= 0 && primary_jy < data->primary_ny)
-		{
-		/* update the cell value */
-		k = primary_ix * data->primary_ny + primary_jy;
-		data->primary_data[k] = value;
-		data->primary_stat_z[k/8] = data->primary_stat_z[k/8] & (255 - statmask[k%8]);
-		data->primary_stat_color[k/8] = data->primary_stat_color[k/8] & (255 - statmask[k%8]);
-
-		/* calculate new derivative */
-		mbview_derivative(instance, primary_ix, primary_jy);
-
-		/* reset contour flags */
-		view->contourlorez = MB_NO;
-		view->contourhirez = MB_NO;
-		view->contourfullrez = MB_NO;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:                     %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:                    %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-
-/*------------------------------------------------------------------------------*/
-int mbview_setprimarycolortable(int verbose, size_t instance,
-			int	primary_colortable,
-			int	primary_colortable_mode,
-			double	primary_colortable_min,
-			double	primary_colortable_max,
-			int *error)
-
-{
-	/* local variables */
-	char	*function_name = "mbview_setprimarycolortable";
-	int	status = MB_SUCCESS;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-
-	/* print starting debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:                   %d\n", verbose);
-		fprintf(stderr,"dbg2       instance:                  %zu\n", instance);
-		fprintf(stderr,"dbg2       primary_colortable:        %d\n", primary_colortable);
-		fprintf(stderr,"dbg2       primary_colortable_mode:   %d\n", primary_colortable_mode);
-		fprintf(stderr,"dbg2       primary_colortable_min:    %f\n", primary_colortable_min);
-		fprintf(stderr,"dbg2       primary_colortable_max:    %f\n", primary_colortable_max);
-		}
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* set values */
-        data->primary_colortable = primary_colortable;
-        data->primary_colortable_mode = primary_colortable_mode;
-        data->primary_colortable_min = primary_colortable_min;
-        data->primary_colortable_max = primary_colortable_max;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:                     %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:                    %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-
-/*------------------------------------------------------------------------------*/
-int mbview_setslopecolortable(int verbose, size_t instance,
-			int	slope_colortable,
-			int	slope_colortable_mode,
-			double	slope_colortable_min,
-			double	slope_colortable_max,
-			int *error)
-
-{
-	/* local variables */
-	char	*function_name = "mbview_setslopecolortable";
-	int	status = MB_SUCCESS;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-
-	/* print starting debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:                   %d\n", verbose);
-		fprintf(stderr,"dbg2       instance:                  %zu\n", instance);
-		fprintf(stderr,"dbg2       slope_colortable:          %d\n", slope_colortable);
-		fprintf(stderr,"dbg2       slope_colortable_mode:     %d\n", slope_colortable_mode);
-		fprintf(stderr,"dbg2       slope_colortable_min:      %f\n", slope_colortable_min);
-		fprintf(stderr,"dbg2       slope_colortable_max:      %f\n", slope_colortable_max);
-		}
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* set values */
-        data->slope_colortable = slope_colortable;
-        data->slope_colortable_mode = slope_colortable_mode;
-        data->slope_colortable_min = slope_colortable_min;
-        data->slope_colortable_max = slope_colortable_max;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:                     %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:                    %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-
-/*------------------------------------------------------------------------------*/
diff --git a/src/mbview/mbview_process.c b/src/mbview/mbview_process.c
deleted file mode 100644
index edffb65..0000000
--- a/src/mbview/mbview_process.c
+++ /dev/null
@@ -1,4885 +0,0 @@
-/*------------------------------------------------------------------------------
- *    The MB-system:	mbview_process.c	9/25/2003
- *    $Id: mbview_process.c 2239 2015-05-07 00:51:42Z caress $
- *
- *    Copyright (c) 2003-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *------------------------------------------------------------------------------*/
-/*
- *
- * Author:	D. W. Caress
- * Date:	September 25, 2003
- *
- * Note:	This code was broken out of mbview_callbacks.c, which was
- *		begun on October 7, 2002
- *
- * $Log: mbview_process.c,v $
- * Revision 5.16  2008/05/16 22:59:42  caress
- * Release 5.1.1beta18.
- *
- * Revision 5.15  2008/03/14 19:04:32  caress
- * Fixed memory problems with route editing.
- *
- * Revision 5.14  2007/10/08 16:32:08  caress
- * Code status as of 8 October 2007.
- *
- * Revision 5.13  2007/06/17 23:27:31  caress
- * Added NBeditviz.
- *
- * Revision 5.12  2006/06/16 19:30:58  caress
- * Check in after the Santa Monica Basin Mapping AUV Expedition.
- *
- * Revision 5.11  2006/04/11 19:17:04  caress
- * Added a profile capability.
- *
- * Revision 5.10  2006/01/24 19:21:32  caress
- * Version 5.0.8 beta.
- *
- * Revision 5.9  2005/11/05 01:11:47  caress
- * Much work over the past two months.
- *
- * Revision 5.8  2005/02/18 07:32:56  caress
- * Fixed nav display and button sensitivity.
- *
- * Revision 5.7  2005/02/08 22:37:42  caress
- * Heading towards 5.0.6 release.
- *
- * Revision 5.5  2004/09/16 21:44:40  caress
- * Many changes over the summer.
- *
- * Revision 5.4  2004/07/15 19:26:44  caress
- * Improvements to survey planning.
- *
- * Revision 5.3  2004/05/21 23:40:40  caress
- * Moved to new version of BX GUI builder
- *
- * Revision 5.2  2004/02/24 22:52:29  caress
- * Added spherical projection to MBview.
- *
- * Revision 5.1  2004/01/06 21:11:04  caress
- * Added pick region capability.
- *
- * Revision 5.0  2003/12/02 20:38:34  caress
- * Making version number 5.0
- *
- * Revision 1.3  2003/12/01 20:55:48  caress
- * Changed debug output.
- *
- * Revision 1.2  2003/11/25 01:43:19  caress
- * MBview version generated during EW0310.
- *
- *
- */
-/*------------------------------------------------------------------------------*/
-
-/* Standard includes for builtins. */
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include <math.h>
-
-/* Motif required Headers */
-#include <X11/StringDefs.h>
-#include <X11/cursorfont.h>
-#include <Xm/Xm.h>
-#include <Xm/MainW.h>
-#include <Xm/DialogS.h>
-#include <Xm/RepType.h>
-#include <Xm/MwmUtil.h>
-#include <Xm/BulletinB.h>
-#include <Xm/RowColumn.h>
-#include <Xm/CascadeB.h>
-#include <Xm/PushB.h>
-#include <Xm/Separator.h>
-#include "MB3DView.h"
-#include "MB3DSiteList.h"
-#include "MB3DRouteList.h"
-#include "MB3DNavList.h"
-
-/* OpenGL include files */
-#ifdef WIN32
-#undef BOOL		/* It was defined by a chain of inclusions in the (patched) X11/Xmd.h */
-#include <windows.h>
-#endif
-
-#include <GL/gl.h>
-#include <GL/glu.h>
-#ifndef WIN32
-#	include <GL/glx.h>
-#endif
-#include "mb_glwdrawa.h"
-
-/* MBIO include files */
-#include "mb_status.h"
-#include "mb_define.h"
-
-/* mbview include */
-#include "mbview.h"
-#include "mbviewprivate.h"
-
-/*------------------------------------------------------------------------------*/
-
-/* local variables */
-static char rcs_id[]="$Id: mbview_process.c 2239 2015-05-07 00:51:42Z caress $";
-
-/*------------------------------------------------------------------------------*/
-int mbview_projectdata(size_t instance)
-{
-	/* local variables */
-	char	*function_name = "mbview_projectdata";
-	int	status = MB_SUCCESS;
-	int	error = MB_ERROR_NO_ERROR;
-	int	proj_status = MB_SUCCESS;
-	double	xgrid, ygrid, xlon, ylat, xdisplay, ydisplay, zdisplay;
-	double	xlonmin, xlonmax, ylatmin, ylatmax;
-	int	i, j, k;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-	char	*message;
-
-	/* print starting debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       instance:         %zu\n",instance);
-		}
-if (mbv_verbose >= 2)
-fprintf(stderr,"mbview_projectdata: %zu\n", instance);
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* delete old projections if necessary */
-	if (view->primary_pj_init == MB_YES
-		&& view->primary_pjptr != NULL)
-		{
-		mb_proj_free(mbv_verbose, &(view->primary_pjptr), &error);
-		view->primary_pj_init = MB_NO;
-		}
-	if (view->secondary_pj_init == MB_YES
-		&& view->secondary_pjptr != NULL)
-		{
-		mb_proj_free(mbv_verbose, &(view->secondary_pjptr), &error);
-		view->secondary_pj_init = MB_NO;
-		}
-	if (view->display_pj_init == MB_YES
-		&& view->display_pjptr != NULL)
-		{
-		mb_proj_free(mbv_verbose, &(view->display_pjptr), &error);
-		view->display_pj_init = MB_NO;
-		}
-	if (data->primary_grid_projection_mode == MBV_PROJECTION_ALREADYPROJECTED)
-		data->primary_grid_projection_mode = MBV_PROJECTION_PROJECTED;
-	if (data->secondary_grid_projection_mode == MBV_PROJECTION_ALREADYPROJECTED)
-		data->secondary_grid_projection_mode = MBV_PROJECTION_PROJECTED;
-	if (data->display_projection_mode == MBV_PROJECTION_ALREADYPROJECTED)
-		data->display_projection_mode = MBV_PROJECTION_PROJECTED;
-
-	/* check for case where primary grid is already projected but displayed
-	   in that same projection
-	   - use same bounds info */
-	if (data->primary_grid_projection_mode == MBV_PROJECTION_PROJECTED
-		&& data->display_projection_mode == MBV_PROJECTION_PROJECTED
-		&& strcmp(data->primary_grid_projection_id,
-				data->display_projection_id) == 0)
-		{
-		/* reset modes */
-		data->primary_grid_projection_mode = MBV_PROJECTION_ALREADYPROJECTED;
-		data->display_projection_mode = MBV_PROJECTION_ALREADYPROJECTED;
-
-		/* get bounds */
-		view->xmin = data->primary_xmin;
-		view->xmax = data->primary_xmax;
-		view->ymin = data->primary_ymin;
-		view->ymax = data->primary_ymax;
-
-		/* get origin */
-		view->xorigin = 0.5 * (view->xmin + view->xmax);
-		view->yorigin = 0.5 * (view->ymin + view->ymax);
-		view->zorigin = data->exageration * 0.5 * (data->primary_min + data->primary_max);
-
-		/* set projection for getting lon lat */
-		proj_status = mb_proj_init(mbv_verbose,
-					data->primary_grid_projection_id,
-					&(view->primary_pjptr),
-					&error);
-		if (proj_status == MB_SUCCESS)
-			{
-			view->primary_pj_init = MB_YES;
-			proj_status = mb_proj_init(mbv_verbose,
-						data->display_projection_id,
-						&(view->display_pjptr),
-						&error);
-			if (proj_status == MB_SUCCESS)
-				view->display_pj_init = MB_YES;
-			}
-
-		/* quit if projection fails */
-		if (proj_status != MB_SUCCESS)
-			{
-			mb_error(mbv_verbose,error,&message);
-			fprintf(stderr,"\nMBIO Error initializing projection:\n%s\n",
-				message);
-			fprintf(stderr,"\nProgram terminated in <%s>\n",
-					function_name);
-			mb_memory_clear(mbv_verbose, &error);
-			exit(error);
-			}
-		}
-
-	/* else set up projections as needed */
-	else
-		{
-		/* first go from grid coordinates to lon lat */
-		if (data->primary_grid_projection_mode == MBV_PROJECTION_PROJECTED)
-			{
-			/* set projection */
-			proj_status = mb_proj_init(mbv_verbose,
-						data->primary_grid_projection_id,
-						&(view->primary_pjptr),
-						&error);
-			if (proj_status == MB_SUCCESS)
-				view->primary_pj_init = MB_YES;
-
-			/* quit if projection fails */
-			if (proj_status != MB_SUCCESS)
-				{
-				mb_error(mbv_verbose,error,&message);
-				fprintf(stderr,"\nMBIO Error initializing projection:\n%s\n",
-					message);
-				fprintf(stderr,"\nProgram terminated in <%s>\n",
-					function_name);
-				mb_memory_clear(mbv_verbose, &error);
-				exit(error);
-				}
-
-			/* get initial bounds */
-			proj_status = mb_proj_inverse(mbv_verbose,
-						view->primary_pjptr,
-						data->primary_xmin,
-						data->primary_ymin,
-						&xlonmin, &ylatmin,
-						&error);
-			proj_status = mb_proj_inverse(mbv_verbose,
-						view->primary_pjptr,
-						data->primary_xmax,
-						data->primary_ymax,
-						&xlonmax, &ylatmax,
-						&error);
-			}
-		else
-			{
-			/* already lon lat - just copy initial bounds */
-			xlonmin = data->primary_xmin;
-			xlonmax = data->primary_xmax;
-			ylatmin = data->primary_ymin;
-			ylatmax = data->primary_ymax;
-			}
-
-		/* now go from lon lat to display coordinates */
-		if (data->display_projection_mode == MBV_PROJECTION_PROJECTED)
-			{
-			/* set projection */
-			proj_status = mb_proj_init(mbv_verbose,
-						data->display_projection_id,
-						&(view->display_pjptr),
-						&error);
-			if (proj_status == MB_SUCCESS)
-				view->display_pj_init = MB_YES;
-
-			/* quit if projection fails */
-			if (proj_status != MB_SUCCESS)
-				{
-				mb_error(mbv_verbose,error,&message);
-				fprintf(stderr,"\nMBIO Error initializing projection:\n%s\n",
-					message);
-				fprintf(stderr,"\nProgram terminated in <%s>\n",
-					function_name);
-				mb_memory_clear(mbv_verbose, &error);
-				exit(error);
-				}
-
-			/* get bounds */
-			proj_status = mb_proj_forward(mbv_verbose,
-						view->display_pjptr,
-						xlonmin, ylatmin,
-						&view->xmin,
-						&view->ymin,
-						&error);
-			proj_status = mb_proj_forward(mbv_verbose,
-						view->display_pjptr,
-						xlonmax, ylatmax,
-						&view->xmax,
-						&view->ymax,
-						&error);
-
-			/* get origin */
-			view->xorigin = 0.5 * (view->xmin + view->xmax);
-			view->yorigin = 0.5 * (view->ymin + view->ymax);
-			view->zorigin = data->exageration * 0.5 * (data->primary_min + data->primary_max);
-			}
-		else if (data->display_projection_mode == MBV_PROJECTION_GEOGRAPHIC)
-			{
-			/* set up geographic pseduo-projection */
-			mb_coor_scale(mbv_verbose,
-	 			0.5*(ylatmin + ylatmax),
-	 			&(view->mtodeglon), &(view->mtodeglat));
-
-			/* get bounds */
-			view->xmin = xlonmin / view->mtodeglon;
-			view->xmax = xlonmax / view->mtodeglon;
-			view->ymin = ylatmin / view->mtodeglat;
-			view->ymax = ylatmax / view->mtodeglat;
-
-			/* get origin */
-			view->xorigin = 0.5 * (view->xmin + view->xmax);
-			view->yorigin = 0.5 * (view->ymin + view->ymax);
-			view->zorigin = data->exageration * 0.5 * (data->primary_min + data->primary_max);
-			}
-		else if (data->display_projection_mode == MBV_PROJECTION_SPHEROID)
-			{
-			/* get bounds */
-			if (xlonmax - xlonmin >= 180.0
-				|| ylatmax - ylatmin >= 90.0)
-				{
-				/* setup spheroid 3D projection with view towards the center of the grid */
-				mbview_sphere_setup(instance, MB_YES,
-							0.5 * (xlonmin + xlonmax),
-							0.5 * (ylatmin + ylatmax));
-
-				view->xmin = -MBV_SPHEROID_RADIUS;
-				view->xmax = MBV_SPHEROID_RADIUS;
-				view->ymin = -MBV_SPHEROID_RADIUS;
-				view->ymax = MBV_SPHEROID_RADIUS;
-
-				/* get reference */
-				view->sphere_refx = 0.0;
-				view->sphere_refy = 0.0;
-				view->sphere_refz = 0.0;
-
-				/* get origin */
-				view->xorigin = 0.0;
-				view->yorigin = 0.0;
-				view->zorigin = 0.0;
-				}
-			else
-				{
-				/* setup spheroid 3D projection with view towards the center of the grid */
-				mbview_sphere_setup(instance, MB_NO,
-							0.5 * (xlonmin + xlonmax),
-							0.5 * (ylatmin + ylatmax));
-
-				/* get origin */
-				mbview_sphere_forward(instance,
-							0.5 * (xlonmin + xlonmax),
-							0.5 * (ylatmin + ylatmax),
-							&view->sphere_refx,
-							&view->sphere_refy,
-							&view->sphere_refz);
-
-				mbview_sphere_forward(instance,
-							xlonmin,
-							ylatmin,
-							&view->xmin,
-							&view->ymin,
-							&zdisplay);
-				mbview_sphere_forward(instance,
-							xlonmax,
-							ylatmax,
-							&view->xmax,
-							&view->ymax,
-							&zdisplay);
-				view->xmin -= view->sphere_refx;
-				view->xmax -= view->sphere_refx;
-				view->ymin -= view->sphere_refy;
-				view->ymax -= view->sphere_refy;
-
-				/* get origin */
-				mbview_sphere_forward(instance,
-							0.5 * (xlonmin + xlonmax),
-							0.5 * (ylatmin + ylatmax),
-							&view->xorigin,
-							&view->yorigin,
-							&view->zorigin);
-
-				view->xorigin -= view->sphere_refx;
-				view->yorigin -= view->sphere_refy;
-				view->zorigin += 0.5 * (data->primary_min + data->primary_max)
-						- view->sphere_refz;
-				}
-			}
-		}
-
-	/* get origin and scaling */
-	view->scale = MIN((1.75 * MBV_OPENGL_WIDTH
-					/ (view->xmax - view->xmin)),
-				(1.75 * MBV_OPENGL_WIDTH
-					/ view->aspect_ratio
-					/ (view->ymax - view->ymin)));
-	view->size2d = 1.0;
-
-/*fprintf(stderr,"Projections:\n");
-fprintf(stderr,"  Grid: mode:%d id:%s\n",
-data->primary_grid_projection_mode, data->primary_grid_projection_id);
-fprintf(stderr,"  Display: mode:%d id:%s\n",
-data->display_projection_mode, data->display_projection_id);
-fprintf(stderr,"  Display min max: %f %f %f %f\n",
-view->xmin, view->xmax, view->ymin, view->ymax);
-fprintf(stderr,"  Display origin: %f %f %f\n", view->xorigin, view->yorigin, view->zorigin);
-fprintf(stderr,"  Display scale: %f\n", view->scale);*/
-
-	/* set x and y arrays */
-	for (i=0;i<data->primary_nx;i++)
-	{
-	for (j=0;j<data->primary_ny;j++)
-		{
-		/* get raw values in grid */
-		k = i * data->primary_ny + j;
-		xgrid = data->primary_xmin + i * data->primary_dx;
-		ygrid = data->primary_ymin + j * data->primary_dy;
-
-		/* reproject positions into display coordinates */
-		mbview_projectforward(instance, MB_NO,
-					xgrid, ygrid, data->primary_data[k],
-					&xlon, &ylat,
-					&xdisplay, &ydisplay, &zdisplay);
-
-		/* insert into plotting arrays */
-		data->primary_x[k] = (float)xdisplay;
-		data->primary_y[k] = (float)ydisplay;
-		data->primary_z[k] = (float)zdisplay;
-		}
-
-	/* set projection for secondary grid if needed */
-	if (data->secondary_nxy > 0
-		&& data->secondary_grid_projection_mode == MBV_PROJECTION_PROJECTED)
-		{
-		/* set projection for getting lon lat */
-		proj_status = mb_proj_init(mbv_verbose,
-					data->secondary_grid_projection_id,
-					&(view->secondary_pjptr),
-					&error);
-		if (proj_status == MB_SUCCESS)
-			view->secondary_pj_init = MB_YES;
-
-		/* quit if projection fails */
-		if (proj_status != MB_SUCCESS)
-			{
-			mb_error(mbv_verbose,error,&message);
-			fprintf(stderr,"\nMBIO Error initializing projection:\n%s\n",
-				message);
-			fprintf(stderr,"\nProgram terminated in <%s>\n",
-					function_name);
-			mb_memory_clear(mbv_verbose, &error);
-			exit(error);
-			}
-		}
-
-	/* check for pending event */
-	if (view->plot_done == MB_NO
-		&& view->plot_interrupt_allowed == MB_YES
-		&& i % MBV_EVENTCHECKCOARSENESS == 0)
-		do_mbview_xevents();
-
-	/* dump out of loop if plotting already done at a higher recursion */
-	if (view->plot_done == MB_YES)
-		i = data->primary_nx;
-	}
-
-	/* calculate derivatives of primary data */
-	for (i=0;i<data->primary_nx;i++)
-		{
-		for (j=0;j<data->primary_ny;j++)
-			{
-			mbview_derivative(instance, i, j);
-			}
-
-		/* check for pending event */
-		if (view->plot_done == MB_NO
-			&& view->plot_interrupt_allowed == MB_YES
-			&& i % MBV_EVENTCHECKCOARSENESS == 0)
-			do_mbview_xevents();
-
-		/* dump out of loop if plotting already done at a higher recursion */
-		if (view->plot_done == MB_YES)
-			i = data->primary_nx;
-		}
-
-	/* clear zscale for grid */
-	mbview_zscaleclear(instance);
-
-	/* project and scale data other than the grid */
-	mbview_zscale(instance);
-
-	/* set projected flag only if plotting not done */
-	if (view->plot_done == MB_NO)
-		{
-		view->projected = MB_YES;
-		}
-
-	/* print output debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-/*------------------------------------------------------------------------------*/
-int mbview_derivative(size_t instance, int i, int j)
-{
-	/* local variables */
-	char	*function_name = "mbview_derivative";
-	int	status = MB_SUCCESS;
-	int	derivative_ok;
-	double	dx, dy;
-	int	k, k1, k2;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-
-	/* print starting debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       instance:         %zu\n",instance);
-		fprintf(stderr,"dbg2       i:                %d\n",i);
-		fprintf(stderr,"dbg2       j:                %d\n",j);
-		}
-if (mbv_verbose >= 2)
-fprintf(stderr,"mbview_derivative: %zu\n", instance);
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* figure if x derivative can be calculated */
-	derivative_ok = MB_NO;
-	k = i * data->primary_ny + j;
-	if (i == 0)
-	    {
-	    k1 = i * data->primary_ny + j;
-	    k2 = (i + 1) * data->primary_ny + j;
-	    if (data->primary_data[k1] != data->primary_nodatavalue
-		&& data->primary_data[k2] != data->primary_nodatavalue)
-		derivative_ok = MB_YES;
-	    }
-	else if (i == data->primary_nx - 1)
-	    {
-	    k1 = (i - 1) * data->primary_ny + j;
-	    k2 = i * data->primary_ny + j;
-	    if (data->primary_data[k1] != data->primary_nodatavalue
-		&& data->primary_data[k2] != data->primary_nodatavalue)
-		derivative_ok = MB_YES;
-	    }
-	else
-	    {
-	    k1 = (i - 1) * data->primary_ny + j;
-	    k2 = (i + 1) * data->primary_ny + j;
-	    if (data->primary_data[k1] != data->primary_nodatavalue
-		&& data->primary_data[k2] != data->primary_nodatavalue)
-		derivative_ok = MB_YES;
-	    else if (data->primary_data[k1] != data->primary_nodatavalue
-		&& data->primary_data[k] != data->primary_nodatavalue)
-		{
-		derivative_ok = MB_YES;
-		k2 = k;
-		}
-	    else if (data->primary_data[k] != data->primary_nodatavalue
-		&& data->primary_data[k2] != data->primary_nodatavalue)
-		{
-		derivative_ok = MB_YES;
-		k1 = k;
-		}
-	    }
-
-	/* calculate x derivative */
-	if (derivative_ok == MB_YES)
-		{
-		dx = (data->primary_x[k2]
-			- data->primary_x[k1]);
-		if (dx != 0.0)
-		data->primary_dzdx[k]
-			= view->scale *
-				(data->primary_data[k2]
-					- data->primary_data[k1])
-				/ dx;
-		else
-		data->primary_dzdx[k] = 0.0;
-		}
-	else
-		data->primary_dzdx[k] = 0.0;
-
-	/* figure if y derivative can be calculated */
-	derivative_ok = MB_NO;
-	if (j == 0)
-	    {
-	    k1 = i * data->primary_ny + j;
-	    k2 = i * data->primary_ny + (j + 1);
-	    if (data->primary_data[k1] != data->primary_nodatavalue
-		&& data->primary_data[k2] != data->primary_nodatavalue)
-		derivative_ok = MB_YES;
-	    }
-	else if (i == data->primary_ny - 1)
-	    {
-	    k1 = i * data->primary_ny + (j - 1);
-	    k2 = i * data->primary_ny + j;
-	    if (data->primary_data[k1] != data->primary_nodatavalue
-		&& data->primary_data[k2] != data->primary_nodatavalue)
-		derivative_ok = MB_YES;
-	    }
-	else
-	    {
-	    k1 = i * data->primary_ny + (j - 1);
-	    k = i * data->primary_ny + j;
-	    k2 = i * data->primary_ny + (j + 1);
-	    if (data->primary_data[k1] != data->primary_nodatavalue
-		&& data->primary_data[k2] != data->primary_nodatavalue)
-		derivative_ok = MB_YES;
-	    else if (data->primary_data[k1] != data->primary_nodatavalue
-		&& data->primary_data[k] != data->primary_nodatavalue)
-		{
-		derivative_ok = MB_YES;
-		k2 = k;
-		}
-	    else if (data->primary_data[k] != data->primary_nodatavalue
-		&& data->primary_data[k2] != data->primary_nodatavalue)
-		{
-		derivative_ok = MB_YES;
-		k1 = k;
-		}
-	    }
-
-	/* calculate y derivative */
-	if (derivative_ok == MB_YES)
-		{
-		dy = (data->primary_y[k2]
-			- data->primary_y[k1]);
-		if (dy != 0.0)
-		data->primary_dzdy[k]
-			= view->scale *
-				(data->primary_data[k2]
-					- data->primary_data[k1])
-				/ (data->primary_y[k2]
-					- data->primary_y[k1]);
-		else
-		data->primary_dzdy[k] = 0.0;
-		}
-	else
-		data->primary_dzdy[k] = 0.0;
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-
-	/* print output debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-/*------------------------------------------------------------------------------*/
-int mbview_projectglobaldata(size_t instance)
-{
-	/* local variables */
-	char	*function_name = "mbview_projectglobaldata";
-	int	status = MB_SUCCESS;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-	struct mbview_pointw_struct *pointw;
-	int	i, j, k;
-
-	/* print starting debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       instance:         %zu\n",instance);
-		}
-if (mbv_verbose >= 2)
-fprintf(stderr,"mbview_projectglobaldata: %zu\n", instance);
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* can only project if projections are set up */
-	if (view->projected == MB_YES)
-		{
-		/* handle navpicks */
-		if (shared.shareddata.navpick_type != MBV_PICK_NONE)
-			{
-			pointw = &(shared.shareddata.navpick.endpoints[0]);
-			status = mbview_projectfromlonlat(instance,
-					pointw->xlon, pointw->ylat, pointw->zdata,
-					&(pointw->xgrid[instance]),
-					&(pointw->ygrid[instance]),
-					&(pointw->xdisplay[instance]),
-					&(pointw->ydisplay[instance]),
-					&(pointw->zdisplay[instance]));
-			for (i=0;i<4;i++)
-				{
-				pointw = &(shared.shareddata.navpick.xpoints[i]);
-				status = mbview_projectfromlonlat(instance,
-						pointw->xlon, pointw->ylat, pointw->zdata,
-						&(pointw->xgrid[instance]),
-						&(pointw->ygrid[instance]),
-						&(pointw->xdisplay[instance]),
-						&(pointw->ydisplay[instance]),
-						&(pointw->zdisplay[instance]));
-				}
-			for(i=0;i<2;i++)
-				{
-				if (shared.shareddata.navpick.xsegments[i].nls > 0)
-					{
-					for (j=0;j<shared.shareddata.navpick.xsegments[i].nls;j++)
-						{
-						pointw = &(shared.shareddata.navpick.xsegments[i].lspoints[j]);
-						status = mbview_projectfromlonlat(instance,
-								pointw->xlon, pointw->ylat, pointw->zdata,
-								&(pointw->xgrid[instance]),
-								&(pointw->ygrid[instance]),
-								&(pointw->xdisplay[instance]),
-								&(pointw->ydisplay[instance]),
-								&(pointw->zdisplay[instance]));
-						}
-					}
-				}
-			}
-		if (shared.shareddata.navpick_type == MBV_PICK_TWOPOINT)
-			{
-			pointw = &(shared.shareddata.navpick.endpoints[1]);
-			status = mbview_projectfromlonlat(instance,
-					pointw->xlon, pointw->ylat, pointw->zdata,
-					&(pointw->xgrid[instance]),
-					&(pointw->ygrid[instance]),
-					&(pointw->xdisplay[instance]),
-					&(pointw->ydisplay[instance]),
-					&(pointw->zdisplay[instance]));
-			for (i=4;i<8;i++)
-				{
-				pointw = &(shared.shareddata.navpick.xpoints[i]);
-				status = mbview_projectfromlonlat(instance,
-						pointw->xlon, pointw->ylat, pointw->zdata,
-						&(pointw->xgrid[instance]),
-						&(pointw->ygrid[instance]),
-						&(pointw->xdisplay[instance]),
-						&(pointw->ydisplay[instance]),
-						&(pointw->zdisplay[instance]));
-				}
-			for(i=2;i<4;i++)
-				{
-				if (shared.shareddata.navpick.xsegments[i].nls > 0)
-					{
-					for (j=0;j<shared.shareddata.navpick.xsegments[i].nls;j++)
-						{
-						pointw = &(shared.shareddata.navpick.xsegments[i].lspoints[j]);
-						status = mbview_projectfromlonlat(instance,
-								pointw->xlon, pointw->ylat, pointw->zdata,
-								&(pointw->xgrid[instance]),
-								&(pointw->ygrid[instance]),
-								&(pointw->xdisplay[instance]),
-								&(pointw->ydisplay[instance]),
-								&(pointw->zdisplay[instance]));
-						}
-					}
-				}
-			}
-
-		/* handle sites */
-		if (shared.shareddata.nsite > 0)
-			{
-			for (i=0;i<shared.shareddata.nsite;i++)
-				{
-				pointw = &(shared.shareddata.sites[i].point);
-				status = mbview_projectfromlonlat(instance,
-						pointw->xlon, pointw->ylat, pointw->zdata,
-						&(pointw->xgrid[instance]),
-						&(pointw->ygrid[instance]),
-						&(pointw->xdisplay[instance]),
-						&(pointw->ydisplay[instance]),
-						&(pointw->zdisplay[instance]));
-				}
-			}
-
-		/* handle routes */
-		if (shared.shareddata.nroute > 0)
-			{
-			for (i=0;i<shared.shareddata.nroute;i++)
-			    {
-			    for (j=0;j<shared.shareddata.routes[i].npoints;j++)
-				{
-				pointw = &(shared.shareddata.routes[i].points[j]);
-				status = mbview_projectfromlonlat(instance,
-						pointw->xlon, pointw->ylat, pointw->zdata,
-						&(pointw->xgrid[instance]),
-						&(pointw->ygrid[instance]),
-						&(pointw->xdisplay[instance]),
-						&(pointw->ydisplay[instance]),
-						&(pointw->zdisplay[instance]));
-				}
-			    for (j=0;j<shared.shareddata.routes[i].npoints-1;j++)
-				{
-				for (k=0;k<shared.shareddata.routes[i].segments[j].nls;k++)
-					{
-					pointw = &(shared.shareddata.routes[i].segments[j].lspoints[k]);
-					status = mbview_projectfromlonlat(instance,
-							pointw->xlon, pointw->ylat, pointw->zdata,
-							&(pointw->xgrid[instance]),
-							&(pointw->ygrid[instance]),
-							&(pointw->xdisplay[instance]),
-							&(pointw->ydisplay[instance]),
-							&(pointw->zdisplay[instance]));
-					}
-				}
-			    }
-			}
-
-		/* handle nav */
-		if (shared.shareddata.nnav > 0)
-			{
-			for (i=0;i<shared.shareddata.nnav;i++)
-			    {
-			    for (j=0;j<shared.shareddata.navs[i].npoints;j++)
-				{
-				pointw = &(shared.shareddata.navs[i].navpts[j].point);
-				status = mbview_projectfromlonlat(instance,
-						pointw->xlon, pointw->ylat, pointw->zdata,
-						&(pointw->xgrid[instance]),
-						&(pointw->ygrid[instance]),
-						&(pointw->xdisplay[instance]),
-						&(pointw->ydisplay[instance]),
-						&(pointw->zdisplay[instance]));
-				pointw = &(shared.shareddata.navs[i].navpts[j].pointport);
-				status = mbview_projectfromlonlat(instance,
-						pointw->xlon, pointw->ylat, pointw->zdata,
-						&(pointw->xgrid[instance]),
-						&(pointw->ygrid[instance]),
-						&(pointw->xdisplay[instance]),
-						&(pointw->ydisplay[instance]),
-						&(pointw->zdisplay[instance]));
-				pointw = &(shared.shareddata.navs[i].navpts[j].pointcntr);
-				status = mbview_projectfromlonlat(instance,
-						pointw->xlon, pointw->ylat, pointw->zdata,
-						&(pointw->xgrid[instance]),
-						&(pointw->ygrid[instance]),
-						&(pointw->xdisplay[instance]),
-						&(pointw->ydisplay[instance]),
-						&(pointw->zdisplay[instance]));
-				pointw = &(shared.shareddata.navs[i].navpts[j].pointstbd);
-				status = mbview_projectfromlonlat(instance,
-						pointw->xlon, pointw->ylat, pointw->zdata,
-						&(pointw->xgrid[instance]),
-						&(pointw->ygrid[instance]),
-						&(pointw->xdisplay[instance]),
-						&(pointw->ydisplay[instance]),
-						&(pointw->zdisplay[instance]));
-				}
-			    for (j=0;j<shared.shareddata.navs[i].npoints-1;j++)
-				{
-				for (k=0;k<shared.shareddata.navs[i].segments[j].nls;k++)
-					{
-					pointw = &(shared.shareddata.navs[i].segments[j].lspoints[k]);
-					status = mbview_projectfromlonlat(instance,
-							pointw->xlon, pointw->ylat, pointw->zdata,
-							&(pointw->xgrid[instance]),
-							&(pointw->ygrid[instance]),
-							&(pointw->xdisplay[instance]),
-							&(pointw->ydisplay[instance]),
-							&(pointw->zdisplay[instance]));
-					}
-				}
-			    }
-			}
-
-		/* handle vectors */
-		if (shared.shareddata.nvector > 0)
-			{
-			for (i=0;i<shared.shareddata.nvector;i++)
-			    {
-			    for (j=0;j<shared.shareddata.vectors[i].npoints;j++)
-				{
-				pointw = &(shared.shareddata.vectors[i].vectorpts[j].point);
-				status = mbview_projectfromlonlat(instance,
-						pointw->xlon, pointw->ylat, pointw->zdata,
-						&(pointw->xgrid[instance]),
-						&(pointw->ygrid[instance]),
-						&(pointw->xdisplay[instance]),
-						&(pointw->ydisplay[instance]),
-						&(pointw->zdisplay[instance]));
-				}
-			    for (j=0;j<shared.shareddata.navs[i].npoints-1;j++)
-				{
-				for (k=0;k<shared.shareddata.navs[i].segments[j].nls;k++)
-					{
-					pointw = &(shared.shareddata.navs[i].segments[j].lspoints[k]);
-					status = mbview_projectfromlonlat(instance,
-							pointw->xlon, pointw->ylat, pointw->zdata,
-							&(pointw->xgrid[instance]),
-							&(pointw->ygrid[instance]),
-							&(pointw->xdisplay[instance]),
-							&(pointw->ydisplay[instance]),
-							&(pointw->zdisplay[instance]));
-					}
-				}
-			    }
-			}
-
-		/* set globalprojected flag */
-		view->globalprojected = MB_YES;
-		}
-
-
-	/* print output debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-/*------------------------------------------------------------------------------*/
-int mbview_zscalegridpoint(size_t instance, int k)
-{
-	/* local variables */
-	char	*function_name = "mbview_zscalegridpoint";
-	int	status = MB_SUCCESS;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-	double	xgrid, ygrid;
-	double	xlon, ylat;
-	double	xdisplay, ydisplay, zdisplay;
-	int	i, j;
-
-	/* print starting debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       instance:         %zu\n",instance);
-		fprintf(stderr,"dbg2       k:                %d\n",k);
-		}
-if (mbv_verbose >= 2)
-fprintf(stderr,"mbview_zscalegridpoint: %d\n", k);
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* scale z value */
-	if (data->display_projection_mode == MBV_PROJECTION_PROJECTED
-		|| data->display_projection_mode == MBV_PROJECTION_ALREADYPROJECTED
-		|| data->display_projection_mode == MBV_PROJECTION_GEOGRAPHIC)
-		{
-		/* scale z value alone */
-		data->primary_z[k]
-			= (float)(view->scale
-				* (data->exageration * data->primary_data[k] - view->zorigin));
-		}
-	else if (data->display_projection_mode == MBV_PROJECTION_SPHEROID)
-		{
-		/* must reproject everything in this case */
-		i = k / data->primary_ny;
-		j = k % data->primary_ny;
-		xgrid = data->primary_xmin + i * data->primary_dx;
-		ygrid = data->primary_ymin + j * data->primary_dy;
-
-		/* reproject positions into display coordinates */
-		mbview_projectforward(instance, MB_NO,
-					xgrid, ygrid, data->primary_data[k],
-					&xlon, &ylat,
-					&xdisplay, &ydisplay, &zdisplay);
-
-		/* insert into plotting arrays */
-		data->primary_x[k] = (float)xdisplay;
-		data->primary_y[k] = (float)ydisplay;
-		data->primary_z[k] = (float)zdisplay;
-		}
-
-	/* set zscale status bit */
-	data->primary_stat_z[k/8]
-		= data->primary_stat_z[k/8] | statmask[k%8];
-
-	/* print output debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-
-/*------------------------------------------------------------------------------*/
-int mbview_zscalepoint(size_t instance, int globalview, double offset_factor,
-			struct mbview_point_struct *point)
-{
-	/* local variables */
-	char	*function_name = "mbview_zscale";
-	int	status = MB_SUCCESS;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-
-	/* print starting debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       instance:         %zu\n",instance);
-		fprintf(stderr,"dbg2       globalview:       %d\n",globalview);
-		fprintf(stderr,"dbg2       offset_factor:    %f\n",offset_factor);
-		}
-if (mbv_verbose >= 2)
-fprintf(stderr,"mbview_zscalepoint: %zu\n", instance);
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* scale z value */
-	if (data->display_projection_mode != MBV_PROJECTION_SPHEROID)
-		{
-		/* scale z value alone */
-		point->zdisplay = view->scale * (data->exageration * point->zdata - view->zorigin)
-					+ offset_factor;
-		}
-	else
-		{
-		/* reproject positions into display coordinates */
-		mbview_projectforward(instance, MB_NO,
-					point->xgrid, point->ygrid, point->zdata,
-					&point->xlon, &point->ylat,
-					&point->xdisplay, &point->ydisplay, &point->zdisplay);
-
-		if (globalview == MB_NO)
-			{
-			point->zdisplay += offset_factor;
-			}
-		else
-			{
-			point->xdisplay += point->xdisplay * offset_factor;
-			point->ydisplay += point->ydisplay * offset_factor;
-			point->zdisplay += point->zdisplay * offset_factor;
-			}
-		}
-
-	/* print output debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-
-/*------------------------------------------------------------------------------*/
-int mbview_zscalepointw(size_t instance, int globalview, double offset_factor,
-			struct mbview_pointw_struct *pointw)
-{
-	/* local variables */
-	char	*function_name = "mbview_zscale";
-	int	status = MB_SUCCESS;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-
-	/* print starting debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       instance:         %zu\n",instance);
-		fprintf(stderr,"dbg2       globalview:       %d\n",globalview);
-		fprintf(stderr,"dbg2       offset_factor:    %f\n",offset_factor);
-		}
-if (mbv_verbose >= 2)
-fprintf(stderr,"mbview_zscalepointw: %zu\n", instance);
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* scale z value */
-	if (data->display_projection_mode != MBV_PROJECTION_SPHEROID)
-		{
-		/* scale z value alone */
-		pointw->zdisplay[instance] = view->scale * (data->exageration * pointw->zdata - view->zorigin)
-					+ offset_factor;
-		}
-	else
-		{
-		/* reproject positions into display coordinates */
-		mbview_projectforward(instance, MB_NO,
-					pointw->xgrid[instance], pointw->ygrid[instance], pointw->zdata,
-					&(pointw->xlon), &(pointw->ylat),
-					&(pointw->xdisplay[instance]),
-					&(pointw->ydisplay[instance]),
-					&(pointw->zdisplay[instance]));
-
-		if (globalview == MB_NO)
-			{
-			pointw->zdisplay[instance] += offset_factor;
-			}
-		else
-			{
-			pointw->xdisplay[instance] += pointw->xdisplay[instance] * offset_factor;
-			pointw->ydisplay[instance] += pointw->ydisplay[instance] * offset_factor;
-			pointw->zdisplay[instance] += pointw->zdisplay[instance] * offset_factor;
-			}
-		}
-
-	/* print output debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-/*------------------------------------------------------------------------------*/
-int mbview_updatepointw(size_t instance, struct mbview_pointw_struct *pointw)
-{
-	/* local variables */
-	char	*function_name = "mbview_updatepointw";
-	int	status = MB_SUCCESS;
-	int	i;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-
-	/* print starting debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       instance:         %zu\n",instance);
-		}
-if (mbv_verbose >= 2)
-fprintf(stderr,"mbview_updatepointw: %zu\n", instance);
-
-	/* update grid and display coordinates for pointw for all
-		active instances other than instance, which has
-		already been set */
-	for (i=0;i<MBV_MAX_WINDOWS;i++)
-		{
-		view = &(mbviews[i]);
-		if (i != instance && view->init != MBV_WINDOW_NULL)
-			{
-			data = &(view->data);
-
-			/* get positions in grid coordinates */
-			status = mbview_projectll2xygrid(i,
-					pointw->xlon, pointw->ylat,
-					&(pointw->xgrid[i]),
-					&(pointw->ygrid[i]));
-
-			/* get positions in display coordinates */
-			status = mbview_projectll2display(i,
-					pointw->xlon, pointw->ylat, pointw->zdata,
-					&(pointw->xdisplay[i]),
-					&(pointw->ydisplay[i]),
-					&(pointw->zdisplay[i]));
-			}
-		}
-
-	/* print output debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-/*------------------------------------------------------------------------------*/
-int mbview_updatesegmentw(size_t instance, struct mbview_linesegmentw_struct *segmentw)
-{
-	/* local variables */
-	char	*function_name = "mbview_updatesegmentw";
-	int	status = MB_SUCCESS;
-	int	i;
-
-	/* print starting debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       instance:         %zu\n",instance);
-		}
-if (mbv_verbose >= 2)
-fprintf(stderr,"mbview_updatesegmentw: %zu\n", instance);
-
-	/* update grid and display coordinates for segmentw for all
-		active instances other than instance, which has
-		already been set */
-	for (i=0;i<segmentw->nls;i++)
-		{
-		mbview_updatepointw(instance, &(segmentw->lspoints[i]));
-		}
-
-	/* print output debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-/*------------------------------------------------------------------------------*/
-int mbview_zscale(size_t instance)
-{
-	/* local variables */
-	char	*function_name = "mbview_zscale";
-	int	status = MB_SUCCESS;
-	int	i, j, k;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-	int	globalview;
-	double	offset_factor;
-
-	/* print starting debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       instance:         %zu\n",instance);
-		}
-if (mbv_verbose >= 2)
-fprintf(stderr,"mbview_zscale: %zu\n", instance);
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* check if the contour offset needs to be applied in a global spherical direction or just up */
-	if (data->display_projection_mode == MBV_PROJECTION_SPHEROID
-		&& view->sphere_refx == 0.0
-		&& view->sphere_refy == 0.0
-		&& view->sphere_refz == 0.0)
-		{
-		globalview = MB_YES;
-		offset_factor = 10.0 * MBV_OPENGL_3D_CONTOUR_OFFSET / (view->scale * MBV_SPHEROID_RADIUS);
-		}
-	else
-		{
-		globalview = MB_NO;
-		offset_factor = MBV_OPENGL_3D_CONTOUR_OFFSET;
-		}
-
-	/* handle picks */
-	if (data->pick_type != MBV_PICK_NONE)
-		{
-		mbview_zscalepoint(instance, globalview, offset_factor, &(data->pick.endpoints[0]));
-		for (i=0;i<4;i++)
-			{
-			mbview_zscalepoint(instance, globalview, offset_factor, &(data->pick.xpoints[i]));
-			}
-		for (i=0;i<2;i++)
-			{
-			for (j=0;j<data->pick.xsegments[i].nls;j++)
-				{
-				mbview_zscalepoint(instance, globalview, offset_factor, &(data->pick.xsegments[i].lspoints[j]));
-				}
-			}
-		}
-	if (data->pick_type == MBV_PICK_TWOPOINT)
-		{
-		mbview_zscalepoint(instance, globalview, offset_factor, &(data->pick.endpoints[1]));
-		for (i=4;i<8;i++)
-			{
-			mbview_zscalepoint(instance, globalview, offset_factor, &(data->pick.xpoints[i]));
-			}
-		for (i=2;i<4;i++)
-			{
-			for (j=0;j<data->pick.xsegments[i].nls;j++)
-				{
-				mbview_zscalepoint(instance, globalview, offset_factor, &(data->pick.xsegments[i].lspoints[j]));
-				}
-			}
-		if (data->pick.segment.nls > 0)
-			{
-			for (j=0;j<data->pick.segment.nls;j++)
-				{
-				mbview_zscalepoint(instance, globalview, offset_factor, &(data->pick.segment.lspoints[j]));
-				}
-			}
-		}
-
-	/* handle area */
-	if (data->area_type == MBV_AREA_QUAD)
-		{
-		for (i=0;i<2;i++)
-			{
-			mbview_zscalepoint(instance, globalview, offset_factor, &(data->area.endpoints[i]));
-			}
-		for (j=0;j<data->area.segment.nls;j++)
-			{
-			mbview_zscalepoint(instance, globalview, offset_factor, &(data->area.segment.lspoints[j]));
-			}
-		for (i=0;i<4;i++)
-			{
-			for (j=0;j<2;j++)
-				{
-				mbview_zscalepoint(instance, globalview, offset_factor, &(data->area.segments[i].endpoints[j]));
-				}
-			for (j=0;j<data->area.segments[i].nls;j++)
-				{
-				mbview_zscalepoint(instance, globalview, offset_factor, &(data->area.segments[i].lspoints[j]));
-				}
-			}
-		}
-
-	/* handle region */
-	if (data->region_type == MBV_REGION_QUAD)
-		{
-		for (i=0;i<4;i++)
-			{
-			mbview_zscalepoint(instance, globalview, offset_factor, &(data->region.cornerpoints[i]));
-			for (j=0;j<data->region.segments[i].nls;j++)
-				{
-				mbview_zscalepoint(instance, globalview, offset_factor, &(data->region.segments[i].lspoints[j]));
-				}
-			}
-		}
-
-	/* handle navpicks */
-	if (shared.shareddata.navpick_type != MBV_PICK_NONE)
-		{
-		mbview_zscalepointw(instance, globalview, offset_factor, &(shared.shareddata.navpick.endpoints[0]));
-		for (i=0;i<4;i++)
-			{
-			mbview_zscalepointw(instance, globalview, offset_factor, &(shared.shareddata.navpick.xpoints[i]));
-			}
-		for(i=0;i<2;i++)
-			{
-			if (shared.shareddata.navpick.xsegments[i].nls > 0)
-				{
-				for (j=0;j<shared.shareddata.navpick.xsegments[i].nls;j++)
-					{
-					mbview_zscalepointw(instance, globalview, offset_factor,
-								&(shared.shareddata.navpick.xsegments[i].lspoints[j]));
-					}
-				}
-			}
-		}
-	if (shared.shareddata.navpick_type == MBV_PICK_TWOPOINT)
-		{
-		mbview_zscalepointw(instance, globalview, offset_factor, &(shared.shareddata.navpick.endpoints[1]));
-		for (i=4;i<8;i++)
-			{
-			mbview_zscalepointw(instance, globalview, offset_factor, &(shared.shareddata.navpick.xpoints[i]));
-			}
-		for(i=2;i<4;i++)
-			{
-			if (shared.shareddata.navpick.xsegments[i].nls > 0)
-				{
-				for (j=0;j<shared.shareddata.navpick.xsegments[i].nls;j++)
-					{
-					mbview_zscalepointw(instance, globalview, offset_factor,
-								&(shared.shareddata.navpick.xsegments[i].lspoints[j]));
-					}
-				}
-			}
-		}
-
-	/* handle sites */
-	if (shared.shareddata.nsite > 0)
-		{
-		for (i=0;i<shared.shareddata.nsite;i++)
-			{
-			mbview_zscalepointw(instance, globalview, offset_factor, &(shared.shareddata.sites[i].point));
-			}
-		}
-
-	/* handle routes */
-	if (shared.shareddata.nroute > 0)
-		{
-		for (i=0;i<shared.shareddata.nroute;i++)
-		    {
-		    for (j=0;j<shared.shareddata.routes[i].npoints;j++)
-			{
-			mbview_zscalepointw(instance, globalview, offset_factor, &(shared.shareddata.routes[i].points[j]));
-			}
-		    for (j=0;j<shared.shareddata.routes[i].npoints-1;j++)
-			{
-			for (k=0;k<shared.shareddata.routes[i].segments[j].nls;k++)
-				{
-				mbview_zscalepointw(instance, globalview, offset_factor, &(shared.shareddata.routes[i].segments[j].lspoints[k]));
-				}
-			}
-		    }
-		}
-
-	/* handle nav */
-	if (shared.shareddata.nnav > 0)
-		{
-		for (i=0;i<shared.shareddata.nnav;i++)
-		    {
-		    for (j=0;j<shared.shareddata.navs[i].npoints;j++)
-			{
-			mbview_zscalepointw(instance, globalview, offset_factor, &(shared.shareddata.navs[i].navpts[j].point));
-			mbview_zscalepointw(instance, globalview, offset_factor, &(shared.shareddata.navs[i].navpts[j].pointport));
-			mbview_zscalepointw(instance, globalview, offset_factor, &(shared.shareddata.navs[i].navpts[j].pointcntr));
-			mbview_zscalepointw(instance, globalview, offset_factor, &(shared.shareddata.navs[i].navpts[j].pointstbd));
-			}
-		    for (j=0;j<shared.shareddata.navs[i].npoints-1;j++)
-			{
-			for (k=0;k<shared.shareddata.navs[i].segments[j].nls;k++)
-				{
-				mbview_zscalepointw(instance, globalview, offset_factor, &(shared.shareddata.navs[i].segments[j].lspoints[k]));
-				}
-			}
-		    }
-		}
-
-	/* handle vector */
-	if (shared.shareddata.nvector > 0)
-		{
-		for (i=0;i<shared.shareddata.nvector;i++)
-		    {
-		    for (j=0;j<shared.shareddata.vectors[i].npoints;j++)
-			{
-			mbview_zscalepointw(instance, globalview, offset_factor, &(shared.shareddata.vectors[i].vectorpts[j].point));
-			}
-		    for (j=0;j<shared.shareddata.vectors[i].npoints-1;j++)
-			{
-			for (k=0;k<shared.shareddata.vectors[i].segments[j].nls;k++)
-				{
-				mbview_zscalepointw(instance, globalview, offset_factor, &(shared.shareddata.vectors[i].segments[j].lspoints[k]));
-				}
-			}
-		    }
-		}
-
-	/* set rez flags only if plotting not done */
-	if (view->plot_done == MB_NO)
-		{
-        	view->contourlorez = MB_NO;
-        	view->contourhirez = MB_NO;
-        	view->contourfullrez = MB_NO;
-		}
-
-	/* print output debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-
-/*------------------------------------------------------------------------------*/
-int mbview_projectforward(size_t instance, int needlonlat,
-				double xgrid, double ygrid, double zdata,
-				double *xlon, double *ylat,
-				double *xdisplay, double *ydisplay, double *zdisplay)
-{
-	/* local variables */
-	char	*function_name = "mbview_projectforward";
-	int	status = MB_SUCCESS;
-	double	xx, yy, zz;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-
-	/* print starting debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       instance:         %zu\n",instance);
-		fprintf(stderr,"dbg2       needlonlat:       %d\n",needlonlat);
-		fprintf(stderr,"dbg2       xgrid:            %f\n",xgrid);
-		fprintf(stderr,"dbg2       ygrid:            %f\n",ygrid);
-		fprintf(stderr,"dbg2       zdata:            %f\n",zdata);
-		}
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* get positions into geographic coordinates if necessary */
-	if (needlonlat == MB_YES
-		|| data->primary_grid_projection_mode != MBV_PROJECTION_ALREADYPROJECTED)
-		{
-		status = mbview_projectgrid2ll(instance,
-						xgrid, ygrid,
-						xlon, ylat);
-		}
-
-	/* get positions in the display projection */
-	if (data->primary_grid_projection_mode == MBV_PROJECTION_ALREADYPROJECTED)
-		{
-		xx = xgrid;
-		yy = ygrid;
-		zz = data->exageration * zdata;
-		*xdisplay = view->scale * (xx - view->xorigin);
-		*ydisplay = view->scale * (yy - view->yorigin);
-		*zdisplay = view->scale * (zz - view->zorigin);
-		}
-	else
-		{
-		status = mbview_projectll2display(instance,
-				*xlon, *ylat, zdata,
-				xdisplay, ydisplay, zdisplay);
-		}
-
-	/* print output debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       xlon:        %f\n",*xlon);
-		fprintf(stderr,"dbg2       ylat:        %f\n",*ylat);
-		fprintf(stderr,"dbg2       xdisplay:    %f\n",*xdisplay);
-		fprintf(stderr,"dbg2       ydisplay:    %f\n",*ydisplay);
-		fprintf(stderr,"dbg2       zdisplay:    %f\n",*zdisplay);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-
-/*------------------------------------------------------------------------------*/
-int mbview_projectinverse(size_t instance, int needlonlat,
-				double xdisplay, double ydisplay,double zdisplay,
-				double *xlon, double *ylat,
-				double *xgrid, double *ygrid)
-{
-	/* local variables */
-	char	*function_name = "mbview_projectinverse";
-	int	status = MB_SUCCESS;
-	double	xx, yy;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-
-	/* print starting debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       instance:         %zu\n",instance);
-		fprintf(stderr,"dbg2       needlonlat:       %d\n",needlonlat);
-		fprintf(stderr,"dbg2       xdisplay:         %f\n",xdisplay);
-		fprintf(stderr,"dbg2       ydisplay:         %f\n",ydisplay);
-		fprintf(stderr,"dbg2       zdisplay:         %f\n",zdisplay);
-		}
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* get positions in geographic coordinates */
-	if (needlonlat == MB_YES
-		|| data->primary_grid_projection_mode != MBV_PROJECTION_ALREADYPROJECTED)
-		{
-		status = mbview_projectdisplay2ll(instance,
-						xdisplay, ydisplay, zdisplay,
-						xlon, ylat);
-		}
-
-	/* get positions into grid coordinates */
-	if (data->primary_grid_projection_mode == MBV_PROJECTION_ALREADYPROJECTED)
-		{
-		xx = xdisplay / view->scale + view->xorigin;
-		yy = ydisplay / view->scale + view->yorigin;
-		*xgrid = xx;
-		*ygrid = yy;
-		}
-	else
-		{
-		status = mbview_projectll2xygrid(instance,
-						*xlon,  *ylat,
-						xgrid, ygrid);
-		}
-
-	/* print output debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       xlon:         %f\n",*xlon);
-		fprintf(stderr,"dbg2       ylat:         %f\n",*ylat);
-		fprintf(stderr,"dbg2       xgrid:        %f\n",*xgrid);
-		fprintf(stderr,"dbg2       ygrid:        %f\n",*ygrid);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:       %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-
-/*------------------------------------------------------------------------------*/
-int mbview_projectfromlonlat(size_t instance,
-				double xlon, double ylat, double zdata,
-				double *xgrid, double *ygrid,
-				double *xdisplay, double *ydisplay, double *zdisplay)
-{
-	/* local variables */
-	char	*function_name = "mbview_projectfromlonlat";
-	int	status = MB_SUCCESS;
-
-	/* print starting debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       instance:         %zu\n",instance);
-		fprintf(stderr,"dbg2       xlon:             %f\n",xlon);
-		fprintf(stderr,"dbg2       ylat:             %f\n",ylat);
-		fprintf(stderr,"dbg2       zdata:            %f\n",zdata);
-		}
-
-	/* get positions into grid coordinates */
-	status = mbview_projectll2xygrid(instance,
-					xlon, ylat,
-			 		xgrid, ygrid);
-
-	/* get positions in the display projection */
-	status = mbview_projectll2display(instance,
-				xlon, ylat, zdata,
-				xdisplay, ydisplay, zdisplay);
-
-	/* print output debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       xgrid:       %f\n",*xgrid);
-		fprintf(stderr,"dbg2       ygrid:       %f\n",*ygrid);
-		fprintf(stderr,"dbg2       xdisplay:    %f\n",*xdisplay);
-		fprintf(stderr,"dbg2       ydisplay:    %f\n",*ydisplay);
-		fprintf(stderr,"dbg2       zdisplay:    %f\n",*zdisplay);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-
-
-/*------------------------------------------------------------------------------*/
-int mbview_projectgrid2ll(size_t instance,
-				double xgrid, double ygrid,
-				double *xlon, double *ylat)
-{
-	/* local variables */
-	char	*function_name = "mbview_projectgrid2ll";
-	int	status = MB_SUCCESS;
-	int	error = MB_ERROR_NO_ERROR;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-
-	/* print starting debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       instance:         %zu\n",instance);
-		fprintf(stderr,"dbg2       xgrid:            %f\n",xgrid);
-		fprintf(stderr,"dbg2       ygrid:            %f\n",ygrid);
-		}
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* get positions into geographic coordinates */
-	if (data->primary_grid_projection_mode == MBV_PROJECTION_PROJECTED
-		|| data->primary_grid_projection_mode == MBV_PROJECTION_ALREADYPROJECTED)
-		{
-		mb_proj_inverse(mbv_verbose, view->primary_pjptr,
-					xgrid, ygrid, xlon, ylat, &error);
-		}
-	else if (data->primary_grid_projection_mode == MBV_PROJECTION_GEOGRAPHIC)
-		{
-		*xlon = xgrid;
-		*ylat = ygrid;
-		}
-
-	/* print output debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       xlon:             %f\n",*xlon);
-		fprintf(stderr,"dbg2       ylat:             %f\n",*ylat);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-
-/*------------------------------------------------------------------------------*/
-int mbview_projectll2xygrid(size_t instance,
-				double xlon, double ylat,
-				double *xgrid, double *ygrid)
-{
-	/* local variables */
-	char	*function_name = "mbview_projectll2xygrid";
-	int	status = MB_SUCCESS;
-	int	error = MB_ERROR_NO_ERROR;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-
-	/* print starting debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       instance:         %zu\n",instance);
-		fprintf(stderr,"dbg2       xlon:             %f\n",xlon);
-		fprintf(stderr,"dbg2       ylat:             %f\n",ylat);
-		}
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* get positions into grid coordinates */
-	if (data->primary_grid_projection_mode == MBV_PROJECTION_PROJECTED
-		|| data->primary_grid_projection_mode == MBV_PROJECTION_ALREADYPROJECTED)
-		{
-		mb_proj_forward(mbv_verbose, view->primary_pjptr,
-				xlon, ylat, xgrid, ygrid, &error);
-		}
-	else
-		{
-		if (data->primary_grid_projection_mode == MBV_PROJECTION_GEOGRAPHIC)
-			{
-			if (data->primary_xmin < -180.0 && xlon > 0.0)
-				xlon -= 360.0;
-			if (data->primary_xmax > 180.0 && xlon < 0.0)
-				xlon += 360.0;
-			}
-		*xgrid = xlon;
-		*ygrid = ylat;
-		}
-
-	/* print output debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       xgrid:       %f\n",*xgrid);
-		fprintf(stderr,"dbg2       ygrid:       %f\n",*ygrid);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-
-/*------------------------------------------------------------------------------*/
-int mbview_projectll2xyzgrid(size_t instance,
-				double xlon, double ylat,
-				double *xgrid, double *ygrid, double *zdata)
-{
-	/* local variables */
-	char	*function_name = "mbview_projectll2xyzgrid";
-	int	status = MB_SUCCESS;
-	int	error = MB_ERROR_NO_ERROR;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-	int	nfound;
-	int	i, j, k, ii, jj;
-
-	/* print starting debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       instance:         %zu\n",instance);
-		fprintf(stderr,"dbg2       xlon:             %f\n",xlon);
-		fprintf(stderr,"dbg2       ylat:             %f\n",ylat);
-		fprintf(stderr,"dbg2       zdata:            %p\n",zdata);
-		}
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* get positions into grid coordinates */
-	if (data->primary_grid_projection_mode == MBV_PROJECTION_PROJECTED
-		|| data->primary_grid_projection_mode == MBV_PROJECTION_ALREADYPROJECTED)
-		{
-		mb_proj_forward(mbv_verbose, view->primary_pjptr,
-				xlon, ylat, xgrid, ygrid, &error);
-		}
-	else
-		{
-		if (data->primary_grid_projection_mode == MBV_PROJECTION_GEOGRAPHIC)
-			{
-			if (data->primary_xmin < -180.0 && xlon > 0.0)
-				xlon -= 360.0;
-			if (data->primary_xmax > 180.0 && xlon < 0.0)
-				xlon += 360.0;
-			}
-		*xgrid = xlon;
-		*ygrid = ylat;
-		}
-
-	/* now get zdata  from primary grid */
-	nfound = 0;
-	*zdata = 0.0;
-	i = (int)((*xgrid - data->primary_xmin) / data->primary_dx);
-	j = (int)((*ygrid - data->primary_ymin) / data->primary_dy);
-	if (i >= 0 && i < data->primary_nx - 1
-	    && j >= 0 && j < data->primary_ny - 1)
-		{
-		for (ii=i;ii<=i+1;ii++)
-		for (jj=j;jj<=j+1;jj++)
-		    {
-		    k = ii * data->primary_ny + jj;
-		    if (data->primary_data[k] != data->primary_nodatavalue)
-			{
-			nfound++;
-			*zdata += data->primary_data[k];
-			}
-		    }
-		}
-	if (nfound > 0)
-		{
-		*zdata /= (double)nfound;
-		status = MB_SUCCESS;
-		}
-	else
-		{
-		*zdata = 0.0;
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       xgrid:       %f\n",*xgrid);
-		fprintf(stderr,"dbg2       ygrid:       %f\n",*ygrid);
-		fprintf(stderr,"dbg2       zdata:       %f\n",*zdata);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-
-/*------------------------------------------------------------------------------*/
-int mbview_projectll2display(size_t instance,
-				double xlon, double ylat, double zdata,
-				double *xdisplay, double *ydisplay, double *zdisplay)
-{
-	/* local variables */
-	char	*function_name = "mbview_projectll2display";
-	int	status = MB_SUCCESS;
-	int	error = MB_ERROR_NO_ERROR;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-	double	xx, yy, zz;
-	double	effective_topography;
-
-	/* print starting debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       instance:         %zu\n",instance);
-		fprintf(stderr,"dbg2       xlon:             %f\n",xlon);
-		fprintf(stderr,"dbg2       ylat:             %f\n",ylat);
-		fprintf(stderr,"dbg2       zdata:            %f\n",zdata);
-		}
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* get positions in the display projection */
-	if (data->display_projection_mode == MBV_PROJECTION_PROJECTED
-		|| data->display_projection_mode == MBV_PROJECTION_ALREADYPROJECTED)
-		{
-		mb_proj_forward(mbv_verbose, view->display_pjptr,
-				xlon,
-				ylat,
-				&xx,
-				&yy,
-				&error);
-		zz = data->exageration * zdata;
-/* fprintf(stderr,"pos: %f %f %f   raw: %f %f %f ",
-xlon, ylat, zdata, xx, yy, zz); */
-		}
-	else if (data->display_projection_mode == MBV_PROJECTION_GEOGRAPHIC)
-		{
-		xx = xlon / view->mtodeglon;
-		yy = ylat / view->mtodeglat;
-		zz = data->exageration * zdata;
-		}
-	else /*if (data->display_projection_mode == MBV_PROJECTION_SPHEROID) */
-		{
-		mbview_sphere_forward(instance, xlon, ylat, &xx, &yy, &zz);
-		effective_topography = data->exageration * (zdata - 0.5 * (data->primary_min + data->primary_max))
-					+ 0.5 * (data->primary_min + data->primary_max);
-/* fprintf(stderr,"pos: %f %f %f   raw: %f %f %f  topo:%f ",
-xlon, ylat, zdata, xx, yy, zz, effective_topography); */
-
-		xx += (effective_topography * xx / MBV_SPHEROID_RADIUS) - view->sphere_refx;
-		yy += (effective_topography * yy / MBV_SPHEROID_RADIUS) - view->sphere_refy;
-		zz += (effective_topography * zz / MBV_SPHEROID_RADIUS) - view->sphere_refz;
-/* fprintf(stderr,"unscaled: %f %f %f",
-xx, yy, zz); */
-		}
-
-	/* get final positions in display coordinates */
-	*xdisplay = view->scale * (xx - view->xorigin);
-	*ydisplay = view->scale * (yy - view->yorigin);
-	*zdisplay = view->scale * (zz - view->zorigin);
-/* fprintf(stderr,"   scale:%f   scaled: %f %f %f\n",
-view->scale, *xdisplay, *ydisplay, *zdisplay); */
-
-	/* print output debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       xdisplay:    %f\n",*xdisplay);
-		fprintf(stderr,"dbg2       ydisplay:    %f\n",*ydisplay);
-		fprintf(stderr,"dbg2       zdisplay:    %f\n",*zdisplay);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-
-/*------------------------------------------------------------------------------*/
-int mbview_projectdisplay2ll(size_t instance,
-				double xdisplay, double ydisplay, double zdisplay,
-				double *xlon, double *ylat)
-{
-	/* local variables */
-	char	*function_name = "mbview_projectdisplay2ll";
-	int	status = MB_SUCCESS;
-	int	error = MB_ERROR_NO_ERROR;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-	double	xx, yy, zz;
-
-	/* print starting debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       instance:         %zu\n",instance);
-		fprintf(stderr,"dbg2       xdisplay:         %f\n",xdisplay);
-		fprintf(stderr,"dbg2       ydisplay:         %f\n",ydisplay);
-		fprintf(stderr,"dbg2       zdisplay:         %f\n",zdisplay);
-		}
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* get positions in display projection */
-	xx = xdisplay / view->scale + view->xorigin;
-	yy = ydisplay / view->scale + view->yorigin;
-	zz = zdisplay / view->scale + view->zorigin;
-
-	/* get positions in geographic coordinates */
-	if (data->display_projection_mode == MBV_PROJECTION_PROJECTED
-		|| data->display_projection_mode == MBV_PROJECTION_ALREADYPROJECTED)
-		{
-		mb_proj_inverse(mbv_verbose, view->display_pjptr,
-				xx, yy, xlon, ylat, &error);
-		}
-	else if (data->display_projection_mode == MBV_PROJECTION_GEOGRAPHIC)
-		{
-		*xlon = xx * view->mtodeglon;
-		*ylat = yy * view->mtodeglat;
-		}
-	else if (data->display_projection_mode == MBV_PROJECTION_SPHEROID)
-		{
-		xx += view->sphere_refx;
-		yy += view->sphere_refy;
-		zz += view->sphere_refz;
-		mbview_sphere_inverse(instance, xx, yy, zz, xlon, ylat);
-		}
-
-	/* print output debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       xlon:             %f\n",*xlon);
-		fprintf(stderr,"dbg2       ylat:             %f\n",*ylat);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-/*------------------------------------------------------------------------------*/
-int mbview_projectdistance(size_t instance,
-				double xlon1, double ylat1, double zdata1,
-				double xlon2, double ylat2, double zdata2,
-				double *distancelateral,
-				double *distanceoverground,
-				double *slope)
-{
-	/* local variables */
-	char	*function_name = "mbview_projectdistance";
-	int	status = MB_SUCCESS;
-	int	error = MB_ERROR_NO_ERROR;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-	double	xx1, yy1, zz1;
-	double	xx2, yy2, zz2;
-	double	dx, dy, dz;
-	double	bearing;
-
-	/* print starting debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       instance:         %zu\n",instance);
-		fprintf(stderr,"dbg2       xlon1:            %f\n",xlon1);
-		fprintf(stderr,"dbg2       ylat1:            %f\n",ylat1);
-		fprintf(stderr,"dbg2       zdata1:           %f\n",zdata1);
-		fprintf(stderr,"dbg2       xlon2:            %f\n",xlon2);
-		fprintf(stderr,"dbg2       ylat2:            %f\n",ylat2);
-		fprintf(stderr,"dbg2       zdata2:           %f\n",zdata2);
-		}
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* get positions in display projection without scaling or exageration */
-	if (data->display_projection_mode == MBV_PROJECTION_PROJECTED
-		|| data->display_projection_mode == MBV_PROJECTION_ALREADYPROJECTED)
-		{
-		/* point 1 */
-		mb_proj_forward(mbv_verbose, view->display_pjptr,
-				xlon1,
-				ylat1,
-				&xx1,
-				&yy1,
-				&error);
-		zz1 = zdata1;
-
-		/* point 2 */
-		mb_proj_forward(mbv_verbose, view->display_pjptr,
-				xlon2,
-				ylat2,
-				&xx2,
-				&yy2,
-				&error);
-		zz2 = zdata2;
-
-		/* distance and slope */
-		dx = xx2 - xx1;
-		dy = yy2 - yy1;
-		dz = zz2 - zz1;
-		*distancelateral = sqrt(dx * dx + dy * dy);
-		*distanceoverground = sqrt(dx * dx + dy * dy + dz * dz);
-		if (*distancelateral > 0.0)
-			*slope = dz / (*distancelateral);
-		else
-			*slope = 0.0;
-		}
-	else if (data->display_projection_mode == MBV_PROJECTION_GEOGRAPHIC)
-		{
-		/* point 1 */
-		xx1 = xlon1 / view->mtodeglon;
-		yy1 = ylat1 / view->mtodeglat;
-		zz1 = zdata1;
-
-		/* point 2 */
-		xx2 = xlon2 / view->mtodeglon;
-		yy2 = ylat2 / view->mtodeglat;
-		zz2 = zdata2;
-
-		/* distance and slope */
-		dx = xx2 - xx1;
-		dy = yy2 - yy1;
-		dz = zz2 - zz1;
-		*distancelateral = sqrt(dx * dx + dy * dy);
-		*distanceoverground = sqrt(dx * dx + dy * dy + dz * dz);
-		if (*distancelateral > 0.0)
-			*slope = dz / (*distancelateral);
-		else
-			*slope = 0.0;
-		}
-	else if (data->display_projection_mode == MBV_PROJECTION_SPHEROID)
-		{
-		/* point 1 */
-		mbview_sphere_forward(instance, xlon1, ylat1, &xx1, &yy1, &zz1);
-
-		/* point 2 */
-		mbview_sphere_forward(instance, xlon2, ylat2, &xx2, &yy2, &zz2);
-
-		/* lateral distance */
-		mbview_greatcircle_distbearing(instance,
-			xlon1, ylat1, xlon2, ylat2,
-			&bearing, distancelateral);
-
-		/* distance over ground */
-		xx1 += zdata1 * xx1 / MBV_SPHEROID_RADIUS;
-		yy1 += zdata1 * yy1 / MBV_SPHEROID_RADIUS;
-		zz1 += zdata1 * zz1 / MBV_SPHEROID_RADIUS;
-		xx2 += zdata2 * xx2 / MBV_SPHEROID_RADIUS;
-		yy2 += zdata2 * yy2 / MBV_SPHEROID_RADIUS;
-		zz2 += zdata2 * zz2 / MBV_SPHEROID_RADIUS;
-		dx = xx2 - xx1;
-		dy = yy2 - yy1;
-		dz = zz2 - zz1;
-		*distanceoverground = sqrt(dx * dx + dy * dy + dz * dz);
-
-		/* slope */
-		if (*distancelateral > 0.0)
-			*slope = (zdata2 - zdata1) / (*distancelateral);
-		else
-			*slope = 0.0;
-		}
-
-	/* print output debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       distancelateral:     %f\n",*distancelateral);
-		fprintf(stderr,"dbg2       distanceoverground:  %f\n",*distanceoverground);
-		fprintf(stderr,"dbg2       slope:               %f\n",*slope);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-/*------------------------------------------------------------------------------*/
-int mbview_sphere_setup(size_t instance, int earthcentered, double xlon, double ylat)
-{
-	/* local variables */
-	char	*function_name = "mbview_sphere_setup";
-	int	status = MB_SUCCESS;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-	double	phi, theta, psi;
-	int	j;
-
-	/* print starting debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       instance:         %zu\n",instance);
-		fprintf(stderr,"dbg2       earthcentered:    %d\n",earthcentered);
-		fprintf(stderr,"dbg2       xlon:             %f\n",xlon);
-		fprintf(stderr,"dbg2       ylat:             %f\n",ylat);
-		}
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* The initial spherical coordinate system is defined as:
-			x = r * cos(longitude) * cos(latitude)
-			y = r * sin(longitude) * cos(latitude)
-			z = r * sin(latitude)
-	   which is equivalent to:
-			x = r * cos(longitude) * sin(colatitude)
-			y = r * sin(longitude) * sin(colatitude)
-			z = r * cos(colatitude)
-	   where:
-	   		colatitude = PI/2 - latitude
-
-	   Euler's rotation theorem proves than any general rotation may be
-	   described by three successive rotations about the axes. One convention
-	   is to use first a rotation about the z-axis (angle phi), then a
-	   rotation about the x'-axis (angle theta), and finally a rotation
-	   about the z''-axis (angle psi).
-
-	   The euler rotation matrix becomes:
-	   		|	a11	a12	a13	|
-	   		|	a21	a22	a23	|
-	   		|	a31	a32	a33	|
-	   where:
-			a11 = cos(phi) * cos(psi) - sin(phi) * cos(theta) * sin(psi)
-			a12 = sin(phi) * cos(psi) + cos(phi) * cos(theta) * sin(psi)
-			a13 = sin(theta) * sin (psi)
-			a21 = -cos(phi) * sin(psi) - sin(phi) * cos(theta) * cos(psi)
-			a22 = -sin(phi) * sin(psi) + cos(phi) * cos(theta) * cos(psi)
-			a23 = sin(theta) * cos(psi)
-			a31 = sin(phi) * sin(theta)
-			a32 = -cos(phi) * sin(theta)
-			a33 = cos(theta)
-
-	   We wish to rotate the coordinate system so that the reference position
-	   defined by xlon and ylat are located on the positive z-axis. The forward
-	   rotation is accomplished using:
-	   		phi = -PI/2 + xlon
-			theta = -ycolat = ylat - PI/2
-			psi = PI
-	   The reverse rotation is accomplished using:
-	   		phi = -PI
-			theta = ycolat = PI/2 - ylat
-			psi = xlon - PI/2
-
-	  The relevant equations derived in part from:
-		http://mathworld.wolfram.com/EulerAngles.html
-	  which were viewed on January 19, 2004
-		*/
-
-	/* create forward rotation matrix */
-	phi = DTR * xlon - 0.5 * M_PI;
-	theta = DTR * ylat - 0.5 * M_PI;
-	psi = M_PI;
-	mbview_sphere_matrix(phi, theta, psi, view->sphere_eulerforward);
-
-	/* create reverse rotation matrix */
-	phi = -M_PI;
-	theta = 0.5 * M_PI - DTR * ylat;
-	psi = 0.5 * M_PI - DTR * xlon;
-	mbview_sphere_matrix(phi, theta, psi, view->sphere_eulerreverse);
-
-	/* now get reference location in rotated coordinates */
-	view->sphere_reflon = xlon;
-	view->sphere_reflat = ylat;
-	view->sphere_refx = 0.0;
-	view->sphere_refy = 0.0;
-	view->sphere_refz = 0.0;
-	if (earthcentered == MB_NO)
-		{
-		mbview_sphere_forward(instance, xlon, ylat,
-				&view->sphere_refx,&view->sphere_refy, &view->sphere_refz);
-		}
-
-	/* print output debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Internal results:\n");
-		fprintf(stderr,"dbg2       view->sphere_reflon:      %f\n",view->sphere_reflon);
-		fprintf(stderr,"dbg2       view->sphere_reflat:      %f\n",view->sphere_reflat);
-		fprintf(stderr,"dbg2       view->sphere_refx:        %f\n",view->sphere_refx);
-		fprintf(stderr,"dbg2       view->sphere_refy:        %f\n",view->sphere_refy);
-		fprintf(stderr,"dbg2       view->sphere_refz:        %f\n",view->sphere_refz);
-		fprintf(stderr,"dbg2       view->sphere_eulerforward:\n");
-		for (j=0;j<3;j++)
-			{
-			fprintf(stderr,"dbg2                         %f %f %f\n",
-					 view->sphere_eulerforward[0 + 3 * j],
-					 view->sphere_eulerforward[1 + 3 * j],
-					 view->sphere_eulerforward[2 + 3 * j]);
-			}
-		fprintf(stderr,"dbg2       view->sphere_eulerreverse:\n");
-		for (j=0;j<3;j++)
-			{
-			fprintf(stderr,"dbg2                         %f %f %f\n",
-					 view->sphere_eulerreverse[0 + 3 * j],
-					 view->sphere_eulerreverse[1 + 3 * j],
-					 view->sphere_eulerreverse[2 + 3 * j]);
-			}
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-/*------------------------------------------------------------------------------*/
-int mbview_sphere_forward(size_t instance, double xlon, double ylat,
-			double *xx, double *yy, double *zz)
-{
-	/* local variables */
-	char	*function_name = "mbview_sphere_forward";
-	int	status = MB_SUCCESS;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-	double	sinlon, coslon, sinlat, coslat;
-	double	posu[3], posr[3];
-
-	/* print starting debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       instance:         %zu\n",instance);
-		fprintf(stderr,"dbg2       xlon:             %f\n",xlon);
-		fprintf(stderr,"dbg2       ylat:             %f\n",ylat);
-		}
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* get position in initial cartesian coordinates */
-	sinlon = sin(DTR * xlon);
-	coslon = cos(DTR * xlon);
-	sinlat = sin(DTR * ylat);
-	coslat = cos(DTR * ylat);
-	posu[0] = MBV_SPHEROID_RADIUS * coslon * coslat;
-	posu[1] = MBV_SPHEROID_RADIUS * sinlon * coslat;
-	posu[2] = MBV_SPHEROID_RADIUS * sinlat;
-
-	/* apply rotation to coordinates with the reference location
-		at the center of the view, on the positive z-axis. */
-	mbview_sphere_rotate(view->sphere_eulerforward,posu,posr);
-
-	/* make relative to reference location */
-	*xx = posr[0];
-	*yy = posr[1];
-	*zz = posr[2];
-
-	/* print output debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       posu[0]:     %f\n",posu[0]);
-		fprintf(stderr,"dbg2       posu[1]:     %f\n",posu[1]);
-		fprintf(stderr,"dbg2       posu[2]:     %f\n",posu[2]);
-		fprintf(stderr,"dbg2       posr[0]:     %f\n",posr[0]);
-		fprintf(stderr,"dbg2       posr[1]:     %f\n",posr[1]);
-		fprintf(stderr,"dbg2       posr[2]:     %f\n",posr[2]);
-		fprintf(stderr,"dbg2       xx:          %f\n",*xx);
-		fprintf(stderr,"dbg2       yy:          %f\n",*yy);
-		fprintf(stderr,"dbg2       zz:          %f\n",*zz);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-
-/*------------------------------------------------------------------------------*/
-int mbview_sphere_inverse(size_t instance, double xx, double yy, double zz,
-			double *xlon, double *ylat)
-{
-	/* local variables */
-	char	*function_name = "mbview_sphere_inverse";
-	int	status = MB_SUCCESS;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-	double	posu[3], posr[3];
-
-	/* print starting debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       instance:         %zu\n",instance);
-		fprintf(stderr,"dbg2       xx:               %f\n",xx);
-		fprintf(stderr,"dbg2       yy:               %f\n",yy);
-		fprintf(stderr,"dbg2       zz:               %f\n",zz);
-		}
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* get position in cartesian spheroid coordinates */
-	posr[0] = xx;
-	posr[1] = yy;
-	posr[2] = zz;
-
-	/* unrotate position */
-	mbview_sphere_rotate(view->sphere_eulerreverse,posr,posu);
-
-	/* get longitude and latitude */
-	*xlon = RTD * atan2(posu[1], posu[0]);
-	*ylat = 90.0 - RTD * (atan2(sqrt(posu[0] * posu[0] + posu[1] * posu[1]), posu[2]));
-
-	/* print output debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       posr[0]:     %f\n",posr[0]);
-		fprintf(stderr,"dbg2       posr[1]:     %f\n",posr[1]);
-		fprintf(stderr,"dbg2       posr[2]:     %f\n",posr[2]);
-		fprintf(stderr,"dbg2       posu[0]:     %f\n",posu[0]);
-		fprintf(stderr,"dbg2       posu[1]:     %f\n",posu[1]);
-		fprintf(stderr,"dbg2       posu[2]:     %f\n",posu[2]);
-		fprintf(stderr,"dbg2       xlon:        %f\n",*xlon);
-		fprintf(stderr,"dbg2       ylat:        %f\n",*ylat);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-
-/*------------------------------------------------------------------------------*/
-int mbview_sphere_matrix(double phi, double theta, double psi,double *eulermatrix)
-{
-	/* local variables */
-	char	*function_name = "mbview_sphere_rotate";
-	int	status = MB_SUCCESS;
-
-	/* print starting debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       phi:              %f\n",phi);
-		fprintf(stderr,"dbg2       theta:            %f\n",theta);
-		fprintf(stderr,"dbg2       psi:              %f\n",psi);
-		}
-
-	/* The initial spherical coordinate system is defined as:
-			x = r * cos(longitude) * cos(latitude)
-			y = r * sin(longitude) * cos(latitude)
-			z = r * sin(latitude)
-	   which is equivalent to:
-			x = r * cos(longitude) * sin(colatitude)
-			y = r * sin(longitude) * sin(colatitude)
-			z = r * cos(colatitude)
-	   where:
-	   		colatitude = PI/2 - latitude
-
-	   Euler's rotation theorem proves than any general rotation may be
-	   described by three successive rotations about the axes. One convention
-	   is to use first a rotation about the z-axis (angle phi), then a
-	   rotation about the x'-axis (angle theta), and finally a rotation
-	   about the z''-axis (angle psi).
-
-	   The euler rotation matrix becomes:
-	   		|	a11	a12	a13	|
-	   		|	a21	a22	a23	|
-	   		|	a31	a32	a33	|
-	   where:
-			a11 = cos(phi) * cos(psi) - sin(phi) * cos(theta) * sin(psi)
-			a12 = sin(phi) * cos(psi) + cos(phi) * cos(theta) * sin(psi)
-			a13 = sin(theta) * sin (psi)
-			a21 = -cos(phi) * sin(psi) - sin(phi) * cos(theta) * cos(psi)
-			a22 = -sin(phi) * sin(psi) + cos(phi) * cos(theta) * cos(psi)
-			a23 = sin(theta) * cos(psi)
-			a31 = sin(phi) * sin(theta)
-			a32 = -cos(phi) * sin(theta)
-			a33 = cos(theta)
-
-	   We wish to rotate the coordinate system so that the reference position
-	   defined by xlon and ylat are located on the positive z-axis. The forward
-	   rotation is accomplished using:
-	   		phi = -PI/2 + xlon
-			theta = -ycolat = ylat - PI/2
-			psi = PI
-	   The reverse rotation is accomplished using:
-	   		phi = -PI
-			theta = ycolat = PI/2 - ylat
-			psi = xlon - PI/2
-
-	  The relevant equations derived in part from:
-		http://mathworld.wolfram.com/EulerAngles.html
-	  which were viewed on January 19, 2004
-		*/
-
-	/* create forward rotation matrix */
-	eulermatrix[0] = cos(phi) * cos(psi) - sin(phi) * cos(theta) * sin(psi);
-	eulermatrix[1] = sin(phi) * cos(psi) + cos(phi) * cos(theta) * sin(psi);
-	eulermatrix[2] = sin(theta) * sin (psi);
-	eulermatrix[3] = -cos(phi) * sin(psi) - sin(phi) * cos(theta) * cos(psi);
-	eulermatrix[4] = -sin(phi) * sin(psi) + cos(phi) * cos(theta) * cos(psi);
-	eulermatrix[5] = sin(theta) * cos(psi);
-	eulermatrix[6] = sin(phi) * sin(theta);
-	eulermatrix[7] = -cos(phi) * sin(theta);
-	eulermatrix[8] = cos(theta);
-
-	/* print output debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       eulermatrix       %f %f %f\n",eulermatrix[0],eulermatrix[1],eulermatrix[2]);
-		fprintf(stderr,"dbg2       eulermatrix       %f %f %f\n",eulermatrix[3],eulermatrix[4],eulermatrix[5]);
-		fprintf(stderr,"dbg2       eulermatrix       %f %f %f\n",eulermatrix[6],eulermatrix[7],eulermatrix[8]);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-
-/*------------------------------------------------------------------------------*/
-int mbview_sphere_rotate(double *eulermatrix,
-			double *v, double *vr)
-{
-	/* local variables */
-	char	*function_name = "mbview_sphere_rotate";
-	int	status = MB_SUCCESS;
-	int	i,j;
-
-	/* print starting debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       eulermatrix       %f %f %f\n",eulermatrix[0],eulermatrix[1],eulermatrix[2]);
-		fprintf(stderr,"dbg2       eulermatrix       %f %f %f\n",eulermatrix[3],eulermatrix[4],eulermatrix[5]);
-		fprintf(stderr,"dbg2       eulermatrix       %f %f %f\n",eulermatrix[6],eulermatrix[7],eulermatrix[8]);
-		fprintf(stderr,"dbg2       -----------\n");
-		fprintf(stderr,"dbg2       v:                %f %f %f\n",v[0],v[1],v[3]);
-		}
-
-	/* get original view direction in cartesian coordinates */
-	for(i=0;i<3;i++)
-		vr[i] = 0.0;
-	for (j=0;j<3;j++)
-		{
-		for (i=0;i<3;i++)
-			{
-			vr[j] += v[i] * eulermatrix[i + 3 * j];
-			}
-		}
-
-	/* print output debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       vr:               %f %f %f\n",vr[0],vr[1],vr[3]);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-
-/*------------------------------------------------------------------------------*/
-int mbview_greatcircle_distbearing(size_t instance,
-			double lon1, double lat1, double lon2,  double lat2,
-			double *bearing, double *distance)
-{
-	/* local variables */
-	char	*function_name = "mbview_greatcircle_distbearing";
-	int	status = MB_SUCCESS;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-	double	rlon1, rlat1, rlon2, rlat2, rbearing;
-	double	t1, t2, t3, dd;
-
-	/* print starting debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       instance:         %zu\n",instance);
-		fprintf(stderr,"dbg2       lon1:             %f\n",lon1);
-		fprintf(stderr,"dbg2       lat1:             %f\n",lat1);
-		fprintf(stderr,"dbg2       lon2:             %f\n",lon2);
-		fprintf(stderr,"dbg2       lat2:             %f\n",lat2);
-		}
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* note: these equations derive in part from source code read at:
-		http://simgear.org/doxygen/polar3d_8hxx-source.html
-		on 17 February 2004 by D.W. Caress
-		The source code found at this location is licensed under the LGPL */
-
-	/* get great circle distance */
-	rlon1 = DTR * lon1;
-	rlat1 = DTR * lat1;
-	rlon2 = DTR * lon2;
-	rlat2 = DTR * lat2;
-	t1 = sin(0.5 * (rlon1 - rlon2));
-	t2 = sin(0.5 * (rlat1 - rlat2));
-	dd = 2.0 * asin(sqrt(t2 * t2 + cos(rlat1) * cos(rlat2) * t1 * t1));
-	*distance = MBV_SPHEROID_RADIUS * dd;
-
-	/* get great circle bearing */
-
-	/* first check if at poles */
-	if (fabs(1.0 - sin(rlat1)) < 0.000001)
-		{
-		/* at north pole therefore heading south */
-		if (lat1 > 0.0)
-			{
-			*bearing = 180.0;
-			}
-
-		/* at south pole therefore heading north */
-		else
-			{
-			*bearing = 0.0;
-			}
-		}
-
-	/* handle position away from poles */
-	else
-		{
-		t3 = (sin(rlat2) - sin(rlat1) * cos(dd))
-				/ (sin(dd) * cos(rlat1));
-		rbearing = acos( MAX(MIN(t3, 1.0), -1.0));
-		if (t1 <= 0.0)
-			{
-			*bearing = RTD * rbearing;
-			}
-		else
-			{
-			*bearing = 360.0 - RTD * rbearing;
-			}
-		if (*bearing < 0.0)
-			*bearing += 360.0;
-		}
-
-	/* print output debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       t3:          %f\n",t3);
-		fprintf(stderr,"dbg2       bearing:     %f\n",*bearing);
-		fprintf(stderr,"dbg2       distance:    %f\n",*distance);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-/*------------------------------------------------------------------------------*/
-int mbview_greatcircle_dist(size_t instance,
-			double lon1, double lat1, double lon2,  double lat2,
-			double *distance)
-{
-	/* local variables */
-	char	*function_name = "mbview_greatcircle_dist";
-	int	status = MB_SUCCESS;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-	double	rlon1, rlat1, rlon2, rlat2;
-	double	t1, t2, dd;
-
-	/* print starting debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       instance:         %zu\n",instance);
-		fprintf(stderr,"dbg2       lon1:             %f\n",lon1);
-		fprintf(stderr,"dbg2       lat1:             %f\n",lat1);
-		fprintf(stderr,"dbg2       lon2:             %f\n",lon2);
-		fprintf(stderr,"dbg2       lat2:             %f\n",lat2);
-		}
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* note: these equations derive in part from source code read at:
-		http://simgear.org/doxygen/polar3d_8hxx-source.html
-		on 17 February 2004 by D.W. Caress
-		The source code found at this location is licensed under the LGPL */
-
-	/* get great circle distance */
-	rlon1 = DTR * lon1;
-	rlat1 = DTR * lat1;
-	rlon2 = DTR * lon2;
-	rlat2 = DTR * lat2;
-	t1 = sin(0.5 * (rlon1 - rlon2));
-	t2 = sin(0.5 * (rlat1 - rlat2));
-	dd = 2.0 * asin(sqrt(t2 * t2 + cos(rlat1) * cos(rlat2) * t1 * t1));
-	*distance = MBV_SPHEROID_RADIUS * dd;
-
-	/* print output debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       distance:    %f\n",*distance);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-/*------------------------------------------------------------------------------*/
-int mbview_greatcircle_endposition(size_t instance,
-			double lon1, double lat1, double bearing, double distance,
-			double *lon2, double *lat2)
-{
-	/* local variables */
-	char	*function_name = "mbview_greatcircle_endposition";
-	int	status = MB_SUCCESS;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-	double	rd, rbearing, rlon1, rlat1, rlat2;
-
-	/* print starting debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       instance:         %zu\n",instance);
-		fprintf(stderr,"dbg2       lon1:             %f\n",lon1);
-		fprintf(stderr,"dbg2       lat1:             %f\n",lat1);
-		fprintf(stderr,"dbg2       bearing:          %f\n",bearing);
-		fprintf(stderr,"dbg2       distance:         %f\n",distance);
-		}
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* note: these equations derive in part from source code read at:
-		http://simgear.org/doxygen/polar3d_8hxx-source.html
-		on 17 February 2004 by D.W. Caress
-		The source code found at this location is licensed under the LGPL */
-
-	/* scale angles to radians */
-	rd = distance / MBV_SPHEROID_RADIUS;
-	rbearing = DTR * (360.0 - bearing);
-	rlon1 = DTR * lon1;
-	rlat1 = DTR * lat1;
-
-	/* calculate latitude */
-	rlat2 = asin(sin(rlat1) * cos(rd) + cos(rlat1) * sin(rd) * cos(rbearing));
-	*lat2 = RTD * rlat2;
-
-	/* calculate longitude */
-	if (cos(rlat2) < 0.000001)
-		{
-		*lon2 = lon1;
-		}
-	else
-		{
-		*lon2 = RTD * (fmod(rlon1 - asin( sin(rbearing) * sin(rd) /
-                                   cos(rlat2) ) + M_PI, 2.0 * M_PI) - M_PI);
-		}
-
-	/* print output debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       lon2:             %f\n",*lon2);
-		fprintf(stderr,"dbg2       lat2:             %f\n",*lat2);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-/*------------------------------------------------------------------------------*/
-int mbview_colorclear(size_t instance)
-{
-	/* local variables */
-	char	*function_name = "mbview_colorclear";
-	int	status = MB_SUCCESS;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-
-	/* print starting debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       instance:         %zu\n",instance);
-		}
-
-if (mbv_verbose >= 2)
-fprintf(stderr,"mbview_colorclear: %zu\n", instance);
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* set status bit arrays */
-	view->colordonecount = 0;
-	if (data->primary_stat_color != NULL)
-		memset(data->primary_stat_color, 0, (data->primary_nxy / 8) + 1);
-
-	/* print output debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-
-/*------------------------------------------------------------------------------*/
-int mbview_zscaleclear(size_t instance)
-{
-	/* local variables */
-	char	*function_name = "mbview_zscaleclear";
-	int	status = MB_SUCCESS;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-
-	/* print starting debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       instance:         %zu\n",instance);
-		}
-
-if (mbv_verbose >= 2)
-fprintf(stderr,"mbview_zscaleclear: %zu\n", instance);
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* set status bit arrays */
-	view->zscaledonecount = 0;
-	if (data->primary_stat_z != NULL)
-		memset(data->primary_stat_z, 0, (data->primary_nxy / 8) + 1);
-
-	/* print output debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-
-/*------------------------------------------------------------------------------*/
-int mbview_setcolorparms(size_t instance)
-{
-	/* local variables */
-	char	*function_name = "mbview_setcolorparms";
-	int	status = MB_SUCCESS;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-
-	/* print starting debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       instance:         %zu\n",instance);
-		}
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* get min max values for coloring */
-	if (data->grid_mode == MBV_GRID_VIEW_PRIMARY)
-		{
-		view->colortable = data->primary_colortable;
-		view->colortable_mode = data->primary_colortable_mode;
-		view->min = data->primary_colortable_min;
-		view->max = data->primary_colortable_max;
-		}
-	else if (data->grid_mode == MBV_GRID_VIEW_PRIMARYSLOPE)
-		{
-		view->colortable = data->slope_colortable;
-		view->colortable_mode = data->slope_colortable_mode;
-		view->min = data->slope_colortable_min;
-		view->max = data->slope_colortable_max;
-		}
-	else if (data->grid_mode == MBV_GRID_VIEW_SECONDARY)
-		{
-		view->colortable = data->secondary_colortable;
-		view->colortable_mode = data->secondary_colortable_mode;
-		view->min = data->secondary_colortable_min;
-		view->max = data->secondary_colortable_max;
-		}
-
-	/* get illumination vector if necessary */
-	if (data->grid_mode == MBV_GRID_VIEW_PRIMARY)
-	    view->shade_mode = data->primary_shade_mode;
-	else if (data->grid_mode == MBV_GRID_VIEW_PRIMARYSLOPE)
-	    view->shade_mode = data->slope_shade_mode;
-	else if (data->grid_mode == MBV_GRID_VIEW_SECONDARY)
-	    view->shade_mode = data->secondary_shade_mode;
-	view->illum_x = 0.0;
-	view->illum_y = 0.0;
-	view->illum_z = 0.0;
-	view->mag2 = 0.0;
-	if (view->shade_mode == MBV_SHADE_VIEW_ILLUMINATION)
-		{
-        	view->illum_x = sin(DTR * data->illuminate_azimuth)
-				* cos(DTR * data->illuminate_elevation);
-       	 	view->illum_y = cos(DTR * data->illuminate_azimuth)
-				* cos(DTR * data->illuminate_elevation);
-        	view->illum_z = sin(DTR * data->illuminate_elevation);
-		view->mag2 = data->illuminate_magnitude
-			* data->illuminate_magnitude;
-/*fprintf(stderr,"ILLUMRAW: %f %f %f\n",
-data->illuminate_azimuth, data->illuminate_elevation, data->illuminate_magnitude);
-fprintf(stderr,"ILLUMLGT: %f %f %f %f\n",view->illum_x, view->illum_y, view->illum_z, view->mag2);*/
-		}
-
-	/* get sign of overlay shading if necessary */
-	view->sign = 1.0;
-	if (view->shade_mode == MBV_SHADE_VIEW_OVERLAY)
-		{
-		if (data->overlay_shade_mode == MBV_COLORTABLE_NORMAL)
-			view->sign = 1.0;
-		else
-			view->sign = -1.0;
-		}
-
-	/* get colortable */
-	if (view->colortable == MBV_COLORTABLE_HAXBY)
-		{
-		view->colortable_red = colortable_haxby_red;
-		view->colortable_blue = colortable_haxby_blue;
-		view->colortable_green = colortable_haxby_green;
-		}
-	else if (view->colortable == MBV_COLORTABLE_BRIGHT)
-		{
-		view->colortable_red = colortable_bright_red;
-		view->colortable_blue = colortable_bright_blue;
-		view->colortable_green = colortable_bright_green;
-		}
-	else if (view->colortable == MBV_COLORTABLE_MUTED)
-		{
-		view->colortable_red = colortable_muted_red;
-		view->colortable_blue = colortable_muted_blue;
-		view->colortable_green = colortable_muted_green;
-		}
-	else if (view->colortable == MBV_COLORTABLE_GRAY)
-		{
-		view->colortable_red = colortable_gray_red;
-		view->colortable_blue = colortable_gray_blue;
-		view->colortable_green = colortable_gray_green;
-		}
-	else if (view->colortable == MBV_COLORTABLE_FLAT)
-		{
-		view->colortable_red = colortable_flat_red;
-		view->colortable_blue = colortable_flat_blue;
-		view->colortable_green = colortable_flat_green;
-		}
-	else if (view->colortable == MBV_COLORTABLE_SEALEVEL1)
-		{
-		view->colortable_red = colortable_haxby_red;
-		view->colortable_blue = colortable_haxby_blue;
-		view->colortable_green = colortable_haxby_green;
-		}
-	else if (view->colortable == MBV_COLORTABLE_SEALEVEL2)
-		{
-		view->colortable_red = colortable_haxby_red;
-		view->colortable_blue = colortable_haxby_blue;
-		view->colortable_green = colortable_haxby_green;
-		}
-
-	/* print output debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-/*------------------------------------------------------------------------------*/
-int mbview_make_histogram(
-	struct mbview_world_struct *view,
-	struct mbview_struct *data,
-	int	which_data)
-{
-	/* local variables */
-	char	*function_name = "mbview_make_histogram";
-	int	status = MB_SUCCESS;
-	int	binned_counts[MBV_RAW_HISTOGRAM_DIM];
-	int	nbinned, nbinnedneg, nbinnedpos;
-	int	bindimminusone;
-	float	min, max, dhist;
-	float	slope;
-	float	*histogram;
-	int	binnedsum, target, jbinzero;
-	int	i, jbin, khist;
-
-	/* print starting debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       view:             %p\n",view);
-		fprintf(stderr,"dbg2       data:             %p\n",data);
-		fprintf(stderr,"dbg2       which_data:       %d\n",which_data);
-		}
-
-	/* get ranges for histogram */
-	if (which_data == MBV_DATA_PRIMARY)
-		{
-		histogram = view->primary_histogram;
-		min = data->primary_colortable_min;
-		max = data->primary_colortable_max;
-		view->primary_histogram_set = MB_YES;
-		}
-	else if (which_data == MBV_DATA_PRIMARYSLOPE)
-		{
-		histogram = view->primaryslope_histogram;
-		min = data->slope_colortable_min;
-		max = data->slope_colortable_max;
-		view->primaryslope_histogram_set = MB_YES;
-		}
-	else /* if (which_data == MBV_DATA_SECONDARY) */
-		{
-		histogram = view->secondary_histogram;
-		min = data->secondary_colortable_min;
-		max = data->secondary_colortable_max;
-		view->secondary_histogram_set = MB_YES;
-		}
-	dhist = (max - min) / (MBV_RAW_HISTOGRAM_DIM - 1);
-
-	/* initialize histograms */
-	for (i=0;i<3*MBV_NUM_COLORS;i++)
-		histogram[i] = 0.0;
-
-	/* initialize bins */
-	for (i=0;i<MBV_RAW_HISTOGRAM_DIM;i++)
-		binned_counts[i] = 0;
-
-	/* loop over all values binning quantities */
-	bindimminusone = MBV_RAW_HISTOGRAM_DIM - 1;
-	nbinned = 0;
-	nbinnedneg = 0;
-	nbinnedpos = 0;
-	if (which_data == MBV_DATA_PRIMARY)
-		{
-		for (i=0;i<data->primary_nxy;i++)
-			{
-			if (data->primary_data[i] != data->primary_nodatavalue)
-				{
-				jbin = (data->primary_data[i] - min) / dhist;
-				if (jbin >= 0 && jbin <= bindimminusone)
-					{
-					binned_counts[jbin]++;
-					nbinned++;
-					if (data->primary_data[i] < 0.0)
-						nbinnedneg++;
-					else
-						nbinnedpos++;
-					}
-				}
-			}
-		}
-	else if (which_data == MBV_DATA_PRIMARYSLOPE)
-		{
-		for (i=0;i<data->primary_nxy;i++)
-			{
-			if (data->primary_data[i] != data->primary_nodatavalue)
-				{
-				slope = sqrt(data->primary_dzdx[i]
-							* data->primary_dzdx[i]
-						+ data->primary_dzdy[i]
-							* data->primary_dzdy[i]);
-				jbin = (slope - min) / dhist;
-				if (jbin >= 0 && jbin <= bindimminusone)
-					{
-					binned_counts[jbin]++;
-					nbinned++;
-					nbinnedpos++;
-					}
-				}
-			}
-		}
-	else if (which_data == MBV_DATA_SECONDARY)
-		{
-		for (i=0;i<data->secondary_nxy;i++)
-			{
-			if (data->secondary_data[i] != data->secondary_nodatavalue)
-				{
-				jbin = (data->secondary_data[i] - min) / dhist;
-				if (jbin >= 0 && jbin <= bindimminusone)
-					{
-					binned_counts[jbin]++;
-					nbinned++;
-					if (data->secondary_data[i] < 0.0)
-						nbinnedneg++;
-					else
-						nbinnedpos++;
-					}
-				}
-			}
-		}
-
-	/* construct histogram equalization for full data range */
-	histogram[0] = min;
-	histogram[MBV_NUM_COLORS-1] = max;
-	binnedsum = 0;
-	khist = 1;
-	for (jbin=0;jbin<MBV_RAW_HISTOGRAM_DIM;jbin++)
-		{
-		target = (khist * nbinned) / (MBV_NUM_COLORS-1);
-		binnedsum += binned_counts[jbin];
-		if (binnedsum >= target && khist < MBV_NUM_COLORS - 1)
-			{
-			histogram[khist] = min + jbin * dhist;
-			khist++;
-			}
-		}
-
-	/* construct histogram equalization for data < 0.0 */
-	if (nbinnedneg > MBV_NUM_COLORS)
-		{
-		jbinzero = MIN(-min / dhist, MBV_RAW_HISTOGRAM_DIM - 1);
-		histogram[MBV_NUM_COLORS] = MIN(0.0, min);
-		histogram[2*MBV_NUM_COLORS-1] = MIN(0.0, max);
-		binnedsum = 0;
-		khist = 1;
-		for (jbin=0;jbin<jbinzero;jbin++)
-			{
-			target = (khist * nbinnedneg) / (MBV_NUM_COLORS-1);
-			binnedsum += binned_counts[jbin];
-			if (binnedsum >= target && khist < MBV_NUM_COLORS - 1)
-				{
-				histogram[MBV_NUM_COLORS+khist] = min + jbin * dhist;
-				khist++;
-				}
-			}
-		}
-
-	/* construct histogram equalization for data >= 0.0 */
-	if (nbinnedpos > MBV_NUM_COLORS)
-		{
-		jbinzero = -min / dhist;
-		histogram[2*MBV_NUM_COLORS] = MAX(0.0, min);
-		histogram[3*MBV_NUM_COLORS-1] = MAX(0.0, max);
-		binnedsum = 0;
-		khist = 1;
-		for (jbin=jbinzero;jbin<MBV_RAW_HISTOGRAM_DIM;jbin++)
-			{
-			target = (khist * nbinnedpos) / (MBV_NUM_COLORS-1);
-			binnedsum += binned_counts[jbin];
-			if (binnedsum >= target && khist < MBV_NUM_COLORS - 1)
-				{
-				histogram[2*MBV_NUM_COLORS+khist] = min + jbin * dhist;
-				khist++;
-				}
-			}
-		}
-
-	/* print output debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       Primary histogram:\n");
-		for (i=0;i<MBV_NUM_COLORS;i++)
-			fprintf(stderr,"dbg2       value[%d]:   %f\n", i, histogram[i]);
-		fprintf(stderr,"dbg2       Negative histogram for sea level colortable:\n");
-		for (i=0;i<MBV_NUM_COLORS;i++)
-			fprintf(stderr,"dbg2       value[%d]:   %f\n", i, histogram[MBV_NUM_COLORS+i]);
-		fprintf(stderr,"dbg2       Postive histogram for sea level colortable:\n");
-		for (i=0;i<MBV_NUM_COLORS;i++)
-			fprintf(stderr,"dbg2       value[%d]:   %f\n", i, histogram[2*MBV_NUM_COLORS+i]);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-
-/*------------------------------------------------------------------------------*/
-int mbview_colorpoint(
-	struct mbview_world_struct *view,
-	struct mbview_struct *data,
-	int i, int j, int k)
-{
-	/* local variables */
-	char	*function_name = "mbview_colorpoint";
-	int	status = MB_SUCCESS;
-	double	value, svalue, dd;
-	double	intensity;
-
-	/* print starting debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       view:             %p\n",view);
-		fprintf(stderr,"dbg2       data:             %p\n",data);
-		fprintf(stderr,"dbg2       i:                %d\n",i);
-		fprintf(stderr,"dbg2       j:                %d\n",j);
-		fprintf(stderr,"dbg2       k:                %d\n",k);
-		}
-
-	/* get values for coloring */
-	if (data->grid_mode == MBV_GRID_VIEW_PRIMARY)
-		{
-		value = data->primary_data[k];
-		}
-	else if (data->grid_mode == MBV_GRID_VIEW_PRIMARYSLOPE)
-		{
-		value = sqrt(data->primary_dzdx[k]
-					* data->primary_dzdx[k]
-				+ data->primary_dzdy[k]
-					* data->primary_dzdy[k]);
-		}
-	else if (data->grid_mode == MBV_GRID_VIEW_SECONDARY)
-		{
-		if (data->secondary_sameas_primary == MB_YES)
-			value = data->secondary_data[k];
-		else
-			mbview_getsecondaryvalue(view, data, i, j, &value);
-		}
-
-	/* get color */
-	if (data->grid_mode == MBV_GRID_VIEW_PRIMARYSLOPE
-		&& view->colortable < MBV_COLORTABLE_SEALEVEL1)
-	    {
-	    mbview_getcolor(value, view->min, view->max, view->colortable_mode,
-	    		(float) 0.0, (float) 0.0, (float) 1.0,
-	    		(float) 1.0, (float) 0.0, (float) 0.0,
-			view->colortable_red,
-			view->colortable_green,
-			view->colortable_blue,
-			&data->primary_r[k],
-			&data->primary_g[k],
-			&data->primary_b[k]);
-	    }
-	else if (view->colortable < MBV_COLORTABLE_SEALEVEL1)
-	    {
-	    mbview_getcolor(value, view->min, view->max, view->colortable_mode,
-			view->colortable_red[0],
-			view->colortable_green[0],
-			view->colortable_blue[0],
-			view->colortable_red[MBV_NUM_COLORS-1],
-			view->colortable_green[MBV_NUM_COLORS-1],
-			view->colortable_blue[MBV_NUM_COLORS-1],
-			view->colortable_red,
-			view->colortable_green,
-			view->colortable_blue,
-			&data->primary_r[k],
-			&data->primary_g[k],
-			&data->primary_b[k]);
-	    }
-	else if (view->colortable == MBV_COLORTABLE_SEALEVEL1)
-	    {
-	    if (value > 0.0)
-		{
-		if (view->colortable_mode == MBV_COLORTABLE_NORMAL)
-		    {
-		    mbview_getcolor(value, 0.0, view->max, view->colortable_mode,
-			colortable_abovesealevel1_red[0],
-			colortable_abovesealevel1_green[0],
-			colortable_abovesealevel1_blue[0],
-			colortable_abovesealevel1_red[MBV_NUM_COLORS-1],
-			colortable_abovesealevel1_green[MBV_NUM_COLORS-1],
-			colortable_abovesealevel1_blue[MBV_NUM_COLORS-1],
-			colortable_abovesealevel1_red,
-			colortable_abovesealevel1_green,
-			colortable_abovesealevel1_blue,
-			&data->primary_r[k],
-			&data->primary_g[k],
-			&data->primary_b[k]);
-		    }
-		else
-		    {
-		    mbview_getcolor(value, -view->max / 11.0, view->max, view->colortable_mode,
-			colortable_haxby_red[0],
-			colortable_haxby_green[0],
-			colortable_haxby_blue[0],
-			colortable_haxby_red[MBV_NUM_COLORS-1],
-			colortable_haxby_green[MBV_NUM_COLORS-1],
-			colortable_haxby_blue[MBV_NUM_COLORS-1],
-			colortable_haxby_red,
-			colortable_haxby_green,
-			colortable_haxby_blue,
-			&data->primary_r[k],
-			&data->primary_g[k],
-			&data->primary_b[k]);
-		    }
-		}
-	    else
-		{
-		if (view->colortable_mode == MBV_COLORTABLE_REVERSED)
-		    {
-		    mbview_getcolor(value, view->min, 0.0, view->colortable_mode,
-			colortable_abovesealevel1_red[0],
-			colortable_abovesealevel1_green[0],
-			colortable_abovesealevel1_blue[0],
-			colortable_abovesealevel1_red[MBV_NUM_COLORS-1],
-			colortable_abovesealevel1_green[MBV_NUM_COLORS-1],
-			colortable_abovesealevel1_blue[MBV_NUM_COLORS-1],
-			colortable_abovesealevel1_red,
-			colortable_abovesealevel1_green,
-			colortable_abovesealevel1_blue,
-			&data->primary_r[k],
-			&data->primary_g[k],
-			&data->primary_b[k]);
-		    }
-		else
-		    {
-		    mbview_getcolor(value, view->min, -view->min / 11.0, view->colortable_mode,
-			colortable_haxby_red[0],
-			colortable_haxby_green[0],
-			colortable_haxby_blue[0],
-			colortable_haxby_red[MBV_NUM_COLORS-1],
-			colortable_haxby_green[MBV_NUM_COLORS-1],
-			colortable_haxby_blue[MBV_NUM_COLORS-1],
-			colortable_haxby_red,
-			colortable_haxby_green,
-			colortable_haxby_blue,
-			&data->primary_r[k],
-			&data->primary_g[k],
-			&data->primary_b[k]);
-		    }
-		}
-	    }
-	else if (view->colortable == MBV_COLORTABLE_SEALEVEL2)
-	    {
-	    if (value > 0.0)
-		{
-		if (view->colortable_mode == MBV_COLORTABLE_NORMAL)
-		    {
-		    mbview_getcolor(value, 0.0, view->max, view->colortable_mode,
-			colortable_abovesealevel2_red[0],
-			colortable_abovesealevel2_green[0],
-			colortable_abovesealevel2_blue[0],
-			colortable_abovesealevel2_red[MBV_NUM_COLORS-1],
-			colortable_abovesealevel2_green[MBV_NUM_COLORS-1],
-			colortable_abovesealevel2_blue[MBV_NUM_COLORS-1],
-			colortable_abovesealevel2_red,
-			colortable_abovesealevel2_green,
-			colortable_abovesealevel2_blue,
-			&data->primary_r[k],
-			&data->primary_g[k],
-			&data->primary_b[k]);
-		    }
-		else
-		    {
-		    mbview_getcolor(value, -view->max / 11.0, view->max, view->colortable_mode,
-			colortable_haxby_red[0],
-			colortable_haxby_green[0],
-			colortable_haxby_blue[0],
-			colortable_haxby_red[MBV_NUM_COLORS-1],
-			colortable_haxby_green[MBV_NUM_COLORS-1],
-			colortable_haxby_blue[MBV_NUM_COLORS-1],
-			colortable_haxby_red,
-			colortable_haxby_green,
-			colortable_haxby_blue,
-			&data->primary_r[k],
-			&data->primary_g[k],
-			&data->primary_b[k]);
-		    }
-		}
-	    else
-		{
-		if (view->colortable_mode == MBV_COLORTABLE_REVERSED)
-		    {
-		    mbview_getcolor(value, view->min, 0.0, view->colortable_mode,
-			colortable_abovesealevel2_red[0],
-			colortable_abovesealevel2_green[0],
-			colortable_abovesealevel2_blue[0],
-			colortable_abovesealevel2_red[MBV_NUM_COLORS-1],
-			colortable_abovesealevel2_green[MBV_NUM_COLORS-1],
-			colortable_abovesealevel2_blue[MBV_NUM_COLORS-1],
-			colortable_abovesealevel2_red,
-			colortable_abovesealevel2_green,
-			colortable_abovesealevel2_blue,
-			&data->primary_r[k],
-			&data->primary_g[k],
-			&data->primary_b[k]);
-		    }
-		else
-		    {
-		    mbview_getcolor(value, view->min, -view->min / 11.0, view->colortable_mode,
-			colortable_haxby_red[0],
-			colortable_haxby_green[0],
-			colortable_haxby_blue[0],
-			colortable_haxby_red[MBV_NUM_COLORS-1],
-			colortable_haxby_green[MBV_NUM_COLORS-1],
-			colortable_haxby_blue[MBV_NUM_COLORS-1],
-			colortable_haxby_red,
-			colortable_haxby_green,
-			colortable_haxby_blue,
-			&data->primary_r[k],
-			&data->primary_g[k],
-			&data->primary_b[k]);
-		    }
-		}
-	    }
-
-	/* get values for shading */
-	if (view->shade_mode != MBV_SHADE_VIEW_NONE)
-	    {
-	    if (view->shade_mode == MBV_SHADE_VIEW_ILLUMINATION)
-		{
-		dd = sqrt(view->mag2 * data->primary_dzdx[k]
-				* data->primary_dzdx[k]
-			+ view->mag2 * data->primary_dzdy[k]
-				* data->primary_dzdy[k]
-				+ 1.0);
-		intensity = data->illuminate_magnitude
-			    * view->illum_x * data->primary_dzdx[k] / dd
-			+ data->illuminate_magnitude
-			    * view->illum_y * data->primary_dzdy[k] / dd
-			+ view->illum_z / dd
-			- 0.5;
-/*if (j==25)
-fprintf(stderr,"intensity:%f  dzdx:%f  dzdy:%f\n",
-intensity,data->primary_dzdx[k], data->primary_dzdy[k]);
-*/
-
-		mbview_applyshade(intensity,
-			&data->primary_r[k],
-			&data->primary_g[k],
-			&data->primary_b[k]);
-		}
-	    else if (view->shade_mode == MBV_SHADE_VIEW_SLOPE)
-		{
-		intensity = -data->slope_magnitude
-			* sqrt(data->primary_dzdx[k]
-					* data->primary_dzdx[k]
-				+ data->primary_dzdy[k]
-					* data->primary_dzdy[k]);
-		intensity = MAX(intensity, -1.0);
-		mbview_applyshade(intensity,
-			&data->primary_r[k],
-			&data->primary_g[k],
-			&data->primary_b[k]);
-		}
-	    else if (view->shade_mode == MBV_SHADE_VIEW_OVERLAY)
-		{
-		if (data->secondary_sameas_primary == MB_YES)
-			svalue = data->secondary_data[k];
-		else
-			mbview_getsecondaryvalue(view, data, i, j, &svalue);
-		if (svalue != data->secondary_nodatavalue)
-			{
-			intensity = view->sign * data->overlay_shade_magnitude
-				* (svalue - data->overlay_shade_center)
-				/ (data->secondary_max - data->secondary_min);
-			mbview_applyshade(intensity,
-				&data->primary_r[k],
-				&data->primary_g[k],
-				&data->primary_b[k]);
-			}
-		}
-	    }
-
-	/* set color status bit */
-	data->primary_stat_color[k/8]
-		= data->primary_stat_color[k/8] | statmask[k%8];
-
-	/* print output debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-/*------------------------------------------------------------------------------*/
-int mbview_colorpoint_histogram(
-	struct mbview_world_struct *view,
-	struct mbview_struct *data,
-	float *histogram,
-	int i, int j, int k)
-{
-	/* local variables */
-	char	*function_name = "mbview_colorpoint_histogram";
-	int	status = MB_SUCCESS;
-	double	value, svalue, dd;
-	double	intensity;
-
-	/* print starting debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       view:             %p\n",view);
-		fprintf(stderr,"dbg2       data:             %p\n",data);
-		fprintf(stderr,"dbg2       histogram:        %p\n",histogram);
-		fprintf(stderr,"dbg2       i:                %d\n",i);
-		fprintf(stderr,"dbg2       j:                %d\n",j);
-		fprintf(stderr,"dbg2       k:                %d\n",k);
-		}
-
-	/* get values for coloring */
-	if (data->grid_mode == MBV_GRID_VIEW_PRIMARY)
-		{
-		value = data->primary_data[k];
-		}
-	else if (data->grid_mode == MBV_GRID_VIEW_PRIMARYSLOPE)
-		{
-		value = sqrt(data->primary_dzdx[k]
-					* data->primary_dzdx[k]
-				+ data->primary_dzdy[k]
-					* data->primary_dzdy[k]);
-		}
-	else if (data->grid_mode == MBV_GRID_VIEW_SECONDARY)
-		{
-		if (data->secondary_sameas_primary == MB_YES)
-			value = data->secondary_data[k];
-		else
-			mbview_getsecondaryvalue(view, data, i, j, &value);
-		}
-
-	/* get color */
-	if (data->grid_mode == MBV_GRID_VIEW_PRIMARYSLOPE
-		&& view->colortable < MBV_COLORTABLE_SEALEVEL1)
-	    {
-	    mbview_getcolor_histogram(value, view->min, view->max, view->colortable_mode,
-	    		(float) 0.0, (float) 0.0, (float) 1.0,
-	    		(float) 1.0, (float) 0.0, (float) 0.0,
-			view->colortable_red,
-			view->colortable_green,
-			view->colortable_blue,
-			histogram,
-			&data->primary_r[k],
-			&data->primary_g[k],
-			&data->primary_b[k]);
-	    }
-	else if (view->colortable < MBV_COLORTABLE_SEALEVEL1)
-	    {
-	    mbview_getcolor_histogram(value, view->min, view->max, view->colortable_mode,
-			view->colortable_red[0],
-			view->colortable_green[0],
-			view->colortable_blue[0],
-			view->colortable_red[MBV_NUM_COLORS-1],
-			view->colortable_green[MBV_NUM_COLORS-1],
-			view->colortable_blue[MBV_NUM_COLORS-1],
-			view->colortable_red,
-			view->colortable_green,
-			view->colortable_blue,
-			histogram,
-			&data->primary_r[k],
-			&data->primary_g[k],
-			&data->primary_b[k]);
-	    }
-	else if (view->colortable == MBV_COLORTABLE_SEALEVEL1)
-	    {
-	    if (value > 0.0)
-		{
-		if (view->colortable_mode == MBV_COLORTABLE_NORMAL)
-		    {
-		    mbview_getcolor_histogram(value, 0.0, view->max, view->colortable_mode,
-			colortable_abovesealevel1_red[0],
-			colortable_abovesealevel1_green[0],
-			colortable_abovesealevel1_blue[0],
-			colortable_abovesealevel1_red[MBV_NUM_COLORS-1],
-			colortable_abovesealevel1_green[MBV_NUM_COLORS-1],
-			colortable_abovesealevel1_blue[MBV_NUM_COLORS-1],
-			colortable_abovesealevel1_red,
-			colortable_abovesealevel1_green,
-			colortable_abovesealevel1_blue,
-			&(histogram[2*MBV_NUM_COLORS]),
-			&data->primary_r[k],
-			&data->primary_g[k],
-			&data->primary_b[k]);
-		    }
-		else
-		    {
-		    mbview_getcolor_histogram(value, -view->max / 11.0, view->max, view->colortable_mode,
-			colortable_haxby_red[0],
-			colortable_haxby_green[0],
-			colortable_haxby_blue[0],
-			colortable_haxby_red[MBV_NUM_COLORS-1],
-			colortable_haxby_green[MBV_NUM_COLORS-1],
-			colortable_haxby_blue[MBV_NUM_COLORS-1],
-			colortable_haxby_red,
-			colortable_haxby_green,
-			colortable_haxby_blue,
-			&(histogram[2*MBV_NUM_COLORS]),
-			&data->primary_r[k],
-			&data->primary_g[k],
-			&data->primary_b[k]);
-		    }
-		}
-	    else
-		{
-		if (view->colortable_mode == MBV_COLORTABLE_REVERSED)
-		    {
-		    mbview_getcolor_histogram(value, view->min, 0.0, view->colortable_mode,
-			colortable_abovesealevel1_red[0],
-			colortable_abovesealevel1_green[0],
-			colortable_abovesealevel1_blue[0],
-			colortable_abovesealevel1_red[MBV_NUM_COLORS-1],
-			colortable_abovesealevel1_green[MBV_NUM_COLORS-1],
-			colortable_abovesealevel1_blue[MBV_NUM_COLORS-1],
-			colortable_abovesealevel1_red,
-			colortable_abovesealevel1_green,
-			colortable_abovesealevel1_blue,
-			&(histogram[MBV_NUM_COLORS]),
-			&data->primary_r[k],
-			&data->primary_g[k],
-			&data->primary_b[k]);
-		    }
-		else
-		    {
-		    mbview_getcolor_histogram(value, view->min, -view->min / 11.0, view->colortable_mode,
-			colortable_haxby_red[0],
-			colortable_haxby_green[0],
-			colortable_haxby_blue[0],
-			colortable_haxby_red[MBV_NUM_COLORS-1],
-			colortable_haxby_green[MBV_NUM_COLORS-1],
-			colortable_haxby_blue[MBV_NUM_COLORS-1],
-			colortable_haxby_red,
-			colortable_haxby_green,
-			colortable_haxby_blue,
-			&(histogram[MBV_NUM_COLORS]),
-			&data->primary_r[k],
-			&data->primary_g[k],
-			&data->primary_b[k]);
-		    }
-		}
-	    }
-	else if (view->colortable == MBV_COLORTABLE_SEALEVEL2)
-	    {
-	    if (value > 0.0)
-		{
-		if (view->colortable_mode == MBV_COLORTABLE_NORMAL)
-		    {
-		    mbview_getcolor_histogram(value, 0.0, view->max, view->colortable_mode,
-			colortable_abovesealevel2_red[0],
-			colortable_abovesealevel2_green[0],
-			colortable_abovesealevel2_blue[0],
-			colortable_abovesealevel2_red[MBV_NUM_COLORS-1],
-			colortable_abovesealevel2_green[MBV_NUM_COLORS-1],
-			colortable_abovesealevel2_blue[MBV_NUM_COLORS-1],
-			colortable_abovesealevel2_red,
-			colortable_abovesealevel2_green,
-			colortable_abovesealevel2_blue,
-			&(histogram[2*MBV_NUM_COLORS]),
-			&data->primary_r[k],
-			&data->primary_g[k],
-			&data->primary_b[k]);
-		    }
-		else
-		    {
-		    mbview_getcolor_histogram(value, -view->max / 11.0, view->max, view->colortable_mode,
-			colortable_haxby_red[0],
-			colortable_haxby_green[0],
-			colortable_haxby_blue[0],
-			colortable_haxby_red[MBV_NUM_COLORS-1],
-			colortable_haxby_green[MBV_NUM_COLORS-1],
-			colortable_haxby_blue[MBV_NUM_COLORS-1],
-			colortable_haxby_red,
-			colortable_haxby_green,
-			colortable_haxby_blue,
-			&(histogram[2*MBV_NUM_COLORS]),
-			&data->primary_r[k],
-			&data->primary_g[k],
-			&data->primary_b[k]);
-		    }
-		}
-	    else
-		{
-		if (view->colortable_mode == MBV_COLORTABLE_REVERSED)
-		    {
-		    mbview_getcolor_histogram(value, view->min, 0.0, view->colortable_mode,
-			colortable_abovesealevel2_red[0],
-			colortable_abovesealevel2_green[0],
-			colortable_abovesealevel2_blue[0],
-			colortable_abovesealevel2_red[MBV_NUM_COLORS-1],
-			colortable_abovesealevel2_green[MBV_NUM_COLORS-1],
-			colortable_abovesealevel2_blue[MBV_NUM_COLORS-1],
-			colortable_abovesealevel2_red,
-			colortable_abovesealevel2_green,
-			colortable_abovesealevel2_blue,
-			&(histogram[MBV_NUM_COLORS]),
-			&data->primary_r[k],
-			&data->primary_g[k],
-			&data->primary_b[k]);
-		    }
-		else
-		    {
-		    mbview_getcolor_histogram(value, view->min, -view->min / 11.0, view->colortable_mode,
-			colortable_haxby_red[0],
-			colortable_haxby_green[0],
-			colortable_haxby_blue[0],
-			colortable_haxby_red[MBV_NUM_COLORS-1],
-			colortable_haxby_green[MBV_NUM_COLORS-1],
-			colortable_haxby_blue[MBV_NUM_COLORS-1],
-			colortable_haxby_red,
-			colortable_haxby_green,
-			colortable_haxby_blue,
-			&(histogram[MBV_NUM_COLORS]),
-			&data->primary_r[k],
-			&data->primary_g[k],
-			&data->primary_b[k]);
-		    }
-		}
-	    }
-
-	/* get values for shading */
-	if (view->shade_mode != MBV_SHADE_VIEW_NONE)
-	    {
-	    if (view->shade_mode == MBV_SHADE_VIEW_ILLUMINATION)
-		{
-		dd = sqrt(view->mag2 * data->primary_dzdx[k]
-				* data->primary_dzdx[k]
-			+ view->mag2 * data->primary_dzdy[k]
-				* data->primary_dzdy[k]
-				+ 1.0);
-		intensity = data->illuminate_magnitude
-			    * view->illum_x * data->primary_dzdx[k] / dd
-			+ data->illuminate_magnitude
-			    * view->illum_y * data->primary_dzdy[k] / dd
-			+ view->illum_z / dd
-			- 0.5;
-/*if (j==25)
-fprintf(stderr,"intensity:%f  dzdx:%f  dzdy:%f\n",
-intensity,data->primary_dzdx[k], data->primary_dzdy[k]);
-*/
-
-		mbview_applyshade(intensity,
-			&data->primary_r[k],
-			&data->primary_g[k],
-			&data->primary_b[k]);
-		}
-	    else if (view->shade_mode == MBV_SHADE_VIEW_SLOPE)
-		{
-		intensity = -data->slope_magnitude
-			* sqrt(data->primary_dzdx[k]
-					* data->primary_dzdx[k]
-				+ data->primary_dzdy[k]
-					* data->primary_dzdy[k]);
-		intensity = MAX(intensity, -1.0);
-		mbview_applyshade(intensity,
-			&data->primary_r[k],
-			&data->primary_g[k],
-			&data->primary_b[k]);
-		}
-	    else if (view->shade_mode == MBV_SHADE_VIEW_OVERLAY)
-		{
-		if (data->secondary_sameas_primary == MB_YES)
-			svalue = data->secondary_data[k];
-		else
-			mbview_getsecondaryvalue(view, data, i, j, &svalue);
-		if (svalue != data->secondary_nodatavalue)
-			{
-			intensity = view->sign * data->overlay_shade_magnitude
-				* (svalue - data->overlay_shade_center)
-				/ (data->secondary_max - data->secondary_min);
-			mbview_applyshade(intensity,
-				&data->primary_r[k],
-				&data->primary_g[k],
-				&data->primary_b[k]);
-			}
-		}
-	    }
-
-	/* set color status bit */
-	data->primary_stat_color[k/8]
-		= data->primary_stat_color[k/8] | statmask[k%8];
-
-	/* print output debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-
-/*------------------------------------------------------------------------------*/
-int mbview_getcolor(double value, double min, double max,
-			int colortablemode,
-			float below_red,
-			float below_green,
-			float below_blue,
-			float above_red,
-			float above_green,
-			float above_blue,
-			float *colortable_red,
-			float *colortable_green,
-			float *colortable_blue,
-			float *red, float *green, float *blue)
-{
-	/* local variables */
-	char	*function_name = "mbview_getcolor";
-	int	status = MB_SUCCESS;
-	int	i;
-	double	ff, factor;
-
-	/* print starting debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       value:            %f\n",value);
-		fprintf(stderr,"dbg2       min:              %f\n",min);
-		fprintf(stderr,"dbg2       max:              %f\n",max);
-		fprintf(stderr,"dbg2       colortablemode:   %d\n",colortablemode);
-		fprintf(stderr,"dbg2       below_red:        %f\n",below_red);
-		fprintf(stderr,"dbg2       below_green:      %f\n",below_green);
-		fprintf(stderr,"dbg2       below_blue:       %f\n",below_blue);
-		fprintf(stderr,"dbg2       above_red:        %f\n",above_red);
-		fprintf(stderr,"dbg2       above_green:      %f\n",above_green);
-		fprintf(stderr,"dbg2       above_blue:       %f\n",above_blue);
-		for (i=0;i<MBV_NUM_COLORS;i++)
-			fprintf(stderr,"dbg2       colortable_red[%d]:   %f\n",i,colortable_red[i]);
-		for (i=0;i<MBV_NUM_COLORS;i++)
-			fprintf(stderr,"dbg2       colortable_green[%d]: %f\n",i,colortable_green[i]);
-		for (i=0;i<MBV_NUM_COLORS;i++)
-			fprintf(stderr,"dbg2       colortable_blue[%d]:  %f\n",i,colortable_blue[i]);
-		}
-
-	/* get color */
-	if (colortablemode == MBV_COLORTABLE_NORMAL)
-		factor = (max - value) / (max - min);
-	else
-		factor = (value -  min) / (max - min);
-	/* factor = MAX(factor, 0.000001);
-	factor = MIN(factor, 0.999999);*/
-	if (factor <= 0.0)
-		{
-		*red = below_red;
-		*green = below_green;
-		*blue = below_blue;
-		}
-	else if (factor >= 1.0)
-		{
-		*red = above_red;
-		*green = above_green;
-		*blue = above_blue;
-		}
-	else
-		{
-		i = (int) (factor * (MBV_NUM_COLORS - 1));
-		ff = factor * (MBV_NUM_COLORS - 1) - i;
-		*red = colortable_red[i]
-			+ ff * (colortable_red[i+1] - colortable_red[i]);
-		*green = colortable_green[i]
-			+ ff * (colortable_green[i+1] - colortable_green[i]);
-		*blue = colortable_blue[i]
-			+ ff * (colortable_blue[i+1] - colortable_blue[i]);
-		}
-
-	/* print output debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       red:     %f\n",*red);
-		fprintf(stderr,"dbg2       green:   %f\n",*green);
-		fprintf(stderr,"dbg2       blue:    %f\n",*blue);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-
-/*------------------------------------------------------------------------------*/
-int mbview_getcolor_histogram(double value, double min, double max,
-			int colortablemode,
-			float below_red,
-			float below_green,
-			float below_blue,
-			float above_red,
-			float above_green,
-			float above_blue,
-			float *colortable_red,
-			float *colortable_green,
-			float *colortable_blue,
-			float *histogram,
-			float *red, float *green, float *blue)
-{
-	/* local variables */
-	char	*function_name = "mbview_getcolor_histogram";
-	int	status = MB_SUCCESS;
-	double	ff, factor;
-	int	found;
-	int	i, ii;
-
-	/* print starting debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       value:            %f\n",value);
-		fprintf(stderr,"dbg2       min:              %f\n",min);
-		fprintf(stderr,"dbg2       max:              %f\n",max);
-		fprintf(stderr,"dbg2       colortablemode:   %d\n",colortablemode);
-		fprintf(stderr,"dbg2       below_red:        %f\n",below_red);
-		fprintf(stderr,"dbg2       below_green:      %f\n",below_green);
-		fprintf(stderr,"dbg2       below_blue:       %f\n",below_blue);
-		fprintf(stderr,"dbg2       above_red:        %f\n",above_red);
-		fprintf(stderr,"dbg2       above_green:      %f\n",above_green);
-		fprintf(stderr,"dbg2       above_blue:       %f\n",above_blue);
-		for (i=0;i<MBV_NUM_COLORS;i++)
-			{
-			fprintf(stderr,"dbg2       colortable:       r:%f g:%f b:%f histogram: %f\n",
-				colortable_red[i], colortable_green[i], colortable_blue[i], histogram[i]);
-			}
-		}
-
-	/* get color */
-	if (colortablemode == MBV_COLORTABLE_NORMAL)
-		factor = (max - value) / (max - min);
-	else
-		factor = (value -  min) / (max - min);
-	/* factor = MAX(factor, 0.000001);
-	factor = MIN(factor, 0.999999);*/
-	if (factor <= 0.0)
-		{
-		*red = below_red;
-		*green = below_green;
-		*blue = below_blue;
-		}
-	else if (factor >= 1.0)
-		{
-		*red = above_red;
-		*green = above_green;
-		*blue = above_blue;
-		}
-	else
-		{
-		/* find place in histogram */
-		found = MB_NO;
-		for (i=0;i<MBV_NUM_COLORS-1 && found == MB_NO;i++)
-			{
-			if (value >= histogram[i] && value <= histogram[i+1])
-				{
-				ii = i;
-				found = MB_YES;
-				}
-			}
-
-		/* get color */
-		if (colortablemode == MBV_COLORTABLE_NORMAL)
-			{
-			ff = (histogram[ii+1] - value) / (histogram[ii+1] - histogram[ii]);
-			ii = MBV_NUM_COLORS - 2 - ii;
-			}
-		else
-			{
-			ff = (value - histogram[ii]) / (histogram[ii+1] - histogram[ii]);
-			}
-		*red = colortable_red[ii]
-			+ ff * (colortable_red[ii+1] - colortable_red[ii]);
-		*green = colortable_green[ii]
-			+ ff * (colortable_green[ii+1] - colortable_green[ii]);
-		*blue = colortable_blue[ii]
-			+ ff * (colortable_blue[ii+1] - colortable_blue[ii]);
-		}
-
-	/* print output debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       red:     %f\n",*red);
-		fprintf(stderr,"dbg2       green:   %f\n",*green);
-		fprintf(stderr,"dbg2       blue:    %f\n",*blue);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-
-/*------------------------------------------------------------------------------*/
-int mbview_applyshade(double intensity, float *r, float *g, float *b)
-{
-	/* note - this correction algorithm is taken from the GMT Technical
-	   Reference and Cookbook by Wessel and Smith - you can find it in
-	   Appendix I: Color Space - The final frontier */
-
-	/* local variables */
-	char	*function_name = "mbview_applyshade";
-	int	status = MB_SUCCESS;
-	double	h, s, v;
-	double	vmax, vmin, dv, idv;
-	double	rmod, gmod, bmod;
-	double	f, p, q, t;
-
-	/* print starting debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       intensity:           %f\n",intensity);
-		}
-
-	/* change the initial rgb into hsv space */
-	vmax = MAX (MAX (*r, *g), *b);
-	vmin = MIN (MIN (*r, *g), *b);
-	dv = vmax - vmin;
-	v = vmax;
-	if (vmax == 0.0)
-		s = 0.0;
-	else
-		s = dv / vmax;
-	h = 0.0;
-	if (s > 0.0)
-		{
-		idv = 1.0 / dv;
-		rmod = (vmax - *r) * idv;
-		gmod = (vmax - *g) * idv;
-		bmod = (vmax - *b) * idv;
-		if (*r == vmax)
-			h = bmod - gmod;
-		else if (*g == vmax)
-			h = 2.0 + rmod - bmod;
-		else
-			h = 4.0 + gmod - rmod;
-		h *= 60.0;
-		if (h < 0.0)
-			h += 360.0;
-		}
-
-	/* apply the shade to the color */
-	if (intensity > 0)
-		{
-		if (s != 0.0)
-			s = (1.0 - intensity) * s
-				+ intensity * 0.1;
-		v = (1.0 - intensity) * v
-			+ intensity;
-		}
-	else
-		{
-		if (s != 0.0)
-			s = (1.0 + intensity) * s
-				- intensity;
-		v = (1.0 + intensity) * v
-			- intensity * 0.3;
-		}
-	if (v < 0.0)
-		v = 0.0;
-	if (s < 0.0)
-		s = 0.0;
-	if (v > 1.0)
-		v = 1.0;
-	if (s > 1.0)
-		s = 1.0;
-
-	/* change the corrected hsv values back into rgb */
-	if (s == 0.0)
-		{
-		*r = v;
-		*g = v;
-		*b = v;
-		}
-	else
-		{
-		while (h >= 360.0)
-			h -= 360.0;
-		h /= 60.0;
-		f = h - ((int)h);
-		p = v * (1.0 - s);
-		q = v * (1.0 - (s * f));
-		t = v * (1.0 - (s * (1.0 - f)));
-		switch (((int)h))
-			{
-			case 0:
-				*r = v;
-				*g = t;
-				*b = p;
-				break;
-			case 1:
-				*r = q;
-				*g = v;
-				*b = p;
-				break;
-			case 2:
-				*r = p;
-				*g = v;
-				*b = t;
-				break;
-			case 3:
-				*r = p;
-				*g = q;
-				*b = v;
-				break;
-			case 4:
-				*r = t;
-				*g = p;
-				*b = v;
-				break;
-			case 5:
-				*r = v;
-				*g = p;
-				*b = q;
-				break;
-			}
-		}
-
-	/* print output debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       red:     %f\n",*r);
-		fprintf(stderr,"dbg2       green:   %f\n",*g);
-		fprintf(stderr,"dbg2       blue:    %f\n",*b);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-
-/*------------------------------------------------------------------------------*/
-int mbview_getsecondaryvalue(struct mbview_world_struct *view,
-				struct mbview_struct *data,
-				int i, int j,
-				double *secondary_value)
-{
-	/* local variables */
-	char	*function_name = "mbview_getsecondaryvalue";
-	int	status = MB_SUCCESS;
-	int	error = MB_ERROR_NO_ERROR;
-	double	xlon, ylat;
-	double	xgrid, ygrid;
-	double	xsgrid, ysgrid;
-	int	ii, jj, kk;
-
-	/* print starting debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       view:             %p\n",view);
-		fprintf(stderr,"dbg2       data:             %p\n",data);
-		fprintf(stderr,"dbg2       i:                %d\n",i);
-		fprintf(stderr,"dbg2       j:                %d\n",j);
-		}
-
-	/* get position in primary grid */
-	xgrid = data->primary_xmin + i * data->primary_dx;
-	ygrid = data->primary_ymin + j * data->primary_dy;
-
-	/* get lon and lat of desired position */
-	if (data->primary_grid_projection_mode == MBV_PROJECTION_PROJECTED
-		|| data->primary_grid_projection_mode == MBV_PROJECTION_ALREADYPROJECTED)
-		{
-		mb_proj_inverse(mbv_verbose, view->primary_pjptr,
-				xgrid, ygrid, &xlon, &ylat, &error);
-		}
-	else
-		{
-		xlon = xgrid;
-		ylat = ygrid;
-		}
-
-	/* get position in secondary grid coordinates */
-	if (data->secondary_grid_projection_mode == MBV_PROJECTION_PROJECTED
-		|| data->secondary_grid_projection_mode == MBV_PROJECTION_ALREADYPROJECTED)
-		{
-		mb_proj_forward(mbv_verbose, view->secondary_pjptr,
-				xlon, ylat, &xsgrid, &ysgrid, &error);
-		}
-	else
-		{
-		xsgrid = xlon;
-		ysgrid = ylat;
-		}
-
-	/* get rounded location in secondary grid */
-	ii = (xsgrid - data->secondary_xmin) / data->secondary_dx;
-	jj = (ysgrid - data->secondary_ymin) / data->secondary_dy;
-
-	/* answer only defined within grid bounds */
-	if (ii < 0 || ii >= data->secondary_nx
-		|| jj < 0 || jj > data->secondary_ny)
-		{
-		*secondary_value = data->secondary_nodatavalue;
-		}
-	else
-		{
-		kk = ii * data->secondary_ny + jj;
-		*secondary_value = data->secondary_data[kk];
-		}
-
-	/* print output debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       secondary_value:  %f\n",*secondary_value);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-/*------------------------------------------------------------------------------*/
-int mbview_contour(size_t instance, int rez)
-{
-	/* local variables */
-	char	*function_name = "mbview_contour";
-	int	status = MB_SUCCESS;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-	int	i, j, k, l, kk;
-	int	stride;
-	int	vertex[4];
-	int	triangleA, triangleB;
-	int	nlevel, level_min, level_max;
-	int	nvertex, nside;
-	float	level_value, datamin, datamax;
-	float	factor;
-	float	xx[2], yy[2], zz[2];
-	int	global;
-	double	contour_offset_factor;
-
-	/* print starting debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       instance:         %zu\n",instance);
-		fprintf(stderr,"dbg2       rez:              %d\n",rez);
-		}
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* set stride for looping over data */
-	if (rez == MBV_REZ_FULL)
-	    	stride = 1;
-	else if (rez == MBV_REZ_HIGH)
-	    	stride = MAX((int)ceil(((double)data->primary_nx)
-				/ ((double)data->hirez_dimension)),
-			(int)ceil(((double)data->primary_ny)
-				/ ((double)data->hirez_dimension)));
-	else
-	    	stride = MAX((int)ceil(((double)data->primary_nx)
-				/ ((double)data->lorez_dimension)),
-			(int)ceil(((double)data->primary_ny)
-				/ ((double)data->lorez_dimension)));
-
-	/* start openGL list */
-	if (rez == MBV_REZ_FULL)
-		{
-	    	glNewList((GLuint)(3*instance+3), GL_COMPILE);
-		}
-	else if (rez == MBV_REZ_HIGH)
-		{
-	    	glNewList((GLuint)(3*instance+2), GL_COMPILE);
-		}
-	else
-		{
-	    	glNewList((GLuint)(3*instance+1), GL_COMPILE);
-		}
-	glColor3f(0.0, 0.0, 0.0);
-	glLineWidth(1.0);
-	glBegin(GL_LINES);
-
-if (mbv_verbose >= 2)
-fprintf(stderr,"mbview_contour: instance:%zu rez:%d stride:%d contour interval:%f\n",
-instance, rez, stride, data->contour_interval);
-
-	/* check if the contour offset needs to be applied in a global spherical direction or just up */
-	if (data->display_projection_mode == MBV_PROJECTION_SPHEROID
-		&& view->sphere_refx == 0.0
-		&& view->sphere_refy == 0.0
-		&& view->sphere_refz == 0.0)
-		{
-		global = MB_YES;
-		contour_offset_factor = MBV_OPENGL_3D_CONTOUR_OFFSET / (view->scale * MBV_SPHEROID_RADIUS);
-		}
-	else
-		{
-		global = MB_NO;
-		contour_offset_factor = MBV_OPENGL_3D_CONTOUR_OFFSET;
-		}
-
-	/* construct the contour segments in each triangle */
-	for (i=0;i<data->primary_nx-stride;i+=stride)
-	{
-	for (j=0;j<data->primary_ny-stride;j+=stride)
-		{
-		/* get vertex id's */
-		vertex[0] = i * data->primary_ny + j;
-		vertex[1] = (i + stride) * data->primary_ny + j;
-	        vertex[2] = i * data->primary_ny + j + stride;
-		vertex[3] = (i + stride) * data->primary_ny + j + stride;
-
-		/* check if either triangle can be contoured */
-		triangleA = MB_NO;
-		triangleB = MB_NO;
-		if (data->primary_data[vertex[0]] != data->primary_nodatavalue
-			&& data->primary_data[vertex[1]] != data->primary_nodatavalue
-			&& data->primary_data[vertex[2]] != data->primary_nodatavalue)
-			triangleA = MB_YES;
-		if (data->primary_data[vertex[1]] != data->primary_nodatavalue
-			&& data->primary_data[vertex[3]] != data->primary_nodatavalue
-			&& data->primary_data[vertex[2]] != data->primary_nodatavalue)
-			triangleB = MB_YES;
-
-		/* if at least one triangle is valid, contour it */
-		if (triangleA == MB_YES || triangleB == MB_YES)
-			{
-			/* get min max values and number of contours */
-			nvertex = 0;
-			datamin = 0.0;
-			datamax = 0.0;
-			for (kk=0;kk<4;kk++)
-				{
-				k = vertex[kk];
-				if (data->primary_data[k] != data->primary_nodatavalue)
-					{
-					if (!(data->primary_stat_z[k/8] & statmask[k%8]))
-						mbview_zscalegridpoint(instance,k);
-					if (nvertex == 0)
-						{
-						datamin = data->primary_data[k];
-						datamax = data->primary_data[k];
-						}
-					else
-						{
-						datamin = MIN(datamin, data->primary_data[k]);
-						datamax = MAX(datamax, data->primary_data[k]);
-						}
-					nvertex++;
-					}
-				}
-
-			/* get start, end, and number of contour levels in contour_interval units */
-			level_min = (int)ceil(datamin / data->contour_interval);
-			level_max = (int)floor(datamax / data->contour_interval);
-			nlevel = level_max - level_min + 1;
-
-			/* now if contours are needed loop over the contour levels */
-			if (nlevel > 0)
-				{
-				for (l=level_min;l<=level_max;l++)
-					{
-					level_value = l * data->contour_interval;
-
-					/* deal with triangle A - vertexes 0, 1, and 2 */
-					if (triangleA == MB_YES)
-					{
-					nside = 0;
-					if ((data->primary_data[vertex[0]] > level_value
-							&& data->primary_data[vertex[1]] < level_value)
-						|| (data->primary_data[vertex[0]] < level_value
-							&& data->primary_data[vertex[1]] > level_value))
-						{
-						factor = (level_value - data->primary_data[vertex[0]])
-										/ (data->primary_data[vertex[1]]
-											- data->primary_data[vertex[0]]);
-						xx[nside] = data->primary_x[vertex[0]]
-									+ factor * (data->primary_x[vertex[1]]
-											- data->primary_x[vertex[0]]);
-						yy[nside] = data->primary_y[vertex[0]]
-									+ factor * (data->primary_y[vertex[1]]
-											- data->primary_y[vertex[0]]);
-						zz[nside] = data->primary_z[vertex[0]]
-									+ factor * (data->primary_z[vertex[1]]
-											- data->primary_z[vertex[0]]);
-						nside++;
-						}
-					if ((data->primary_data[vertex[1]] > level_value
-							&& data->primary_data[vertex[2]] < level_value)
-						|| (data->primary_data[vertex[1]] < level_value
-							&& data->primary_data[vertex[2]] > level_value))
-						{
-						factor = (level_value - data->primary_data[vertex[1]])
-										/ (data->primary_data[vertex[2]]
-											- data->primary_data[vertex[1]]);
-						xx[nside] = data->primary_x[vertex[1]]
-									+ factor * (data->primary_x[vertex[2]]
-											- data->primary_x[vertex[1]]);
-						yy[nside] = data->primary_y[vertex[1]]
-									+ factor * (data->primary_y[vertex[2]]
-											- data->primary_y[vertex[1]]);
-						zz[nside] = data->primary_z[vertex[1]]
-									+ factor * (data->primary_z[vertex[2]]
-											- data->primary_z[vertex[1]]);
-						nside++;
-						}
-					if (nside < 2 &&
-						((data->primary_data[vertex[2]] > level_value
-							&& data->primary_data[vertex[0]] < level_value)
-						|| (data->primary_data[vertex[2]] < level_value
-							&& data->primary_data[vertex[0]] > level_value)))
-						{
-						factor = (level_value - data->primary_data[vertex[2]])
-										/ (data->primary_data[vertex[0]]
-											- data->primary_data[vertex[2]]);
-						xx[nside] = data->primary_x[vertex[2]]
-									+ factor * (data->primary_x[vertex[0]]
-											- data->primary_x[vertex[2]]);
-						yy[nside] = data->primary_y[vertex[2]]
-									+ factor * (data->primary_y[vertex[0]]
-											- data->primary_y[vertex[2]]);
-						zz[nside] = data->primary_z[vertex[2]]
-									+ factor * (data->primary_z[vertex[0]]
-											- data->primary_z[vertex[2]]);
-						nside++;
-						}
-					if (nside == 2)
-						{
-						if (data->display_projection_mode != MBV_PROJECTION_SPHEROID)
-							{
-							zz[0] += contour_offset_factor;
-							zz[1] += contour_offset_factor;
-							}
-						else if (global == MB_YES)
-							{
-							xx[0] += xx[0] * contour_offset_factor;
-							yy[0] += yy[0] * contour_offset_factor;
-							zz[0] += zz[0] * contour_offset_factor;
-							xx[1] += xx[1] * contour_offset_factor;
-							yy[1] += yy[1] * contour_offset_factor;
-							zz[1] += zz[1] * contour_offset_factor;
-							}
-						else
-							{
-							zz[0] += contour_offset_factor;
-							zz[1] += contour_offset_factor;
-							}
-						glVertex3f(xx[0], yy[0], zz[0]);
-						glVertex3f(xx[1], yy[1], zz[1]);
-						}
-					}
-
-					/* deal with triangle B - vertexes 1, 3, and 2 */
-					if (triangleB == MB_YES)
-					{
-					nside = 0;
-					if ((data->primary_data[vertex[1]] > level_value
-							&& data->primary_data[vertex[3]] < level_value)
-						|| (data->primary_data[vertex[1]] < level_value
-							&& data->primary_data[vertex[3]] > level_value))
-						{
-						factor = (level_value - data->primary_data[vertex[1]])
-										/ (data->primary_data[vertex[3]]
-											- data->primary_data[vertex[1]]);
-						xx[nside] = data->primary_x[vertex[1]]
-									+ factor * (data->primary_x[vertex[3]]
-											- data->primary_x[vertex[1]]);
-						yy[nside] = data->primary_y[vertex[1]]
-									+ factor * (data->primary_y[vertex[3]]
-											- data->primary_y[vertex[1]]);
-						zz[nside] = data->primary_z[vertex[1]]
-									+ factor * (data->primary_z[vertex[3]]
-											- data->primary_z[vertex[1]]);
-						nside++;
-						}
-					if ((data->primary_data[vertex[3]] > level_value
-							&& data->primary_data[vertex[2]] < level_value)
-						|| (data->primary_data[vertex[3]] < level_value
-							&& data->primary_data[vertex[2]] > level_value))
-						{
-						factor = (level_value - data->primary_data[vertex[3]])
-										/ (data->primary_data[vertex[2]]
-											- data->primary_data[vertex[3]]);
-						xx[nside] = data->primary_x[vertex[3]]
-									+ factor * (data->primary_x[vertex[2]]
-											- data->primary_x[vertex[3]]);
-						yy[nside] = data->primary_y[vertex[3]]
-									+ factor * (data->primary_y[vertex[2]]
-											- data->primary_y[vertex[3]]);
-						zz[nside] = data->primary_z[vertex[3]]
-									+ factor * (data->primary_z[vertex[2]]
-											- data->primary_z[vertex[3]]);
-						nside++;
-						}
-					if (nside < 2 &&
-						((data->primary_data[vertex[2]] > level_value
-							&& data->primary_data[vertex[1]] < level_value)
-						|| (data->primary_data[vertex[2]] < level_value
-							&& data->primary_data[vertex[1]] > level_value)))
-						{
-						factor = (level_value - data->primary_data[vertex[2]])
-										/ (data->primary_data[vertex[1]]
-											- data->primary_data[vertex[2]]);
-						xx[nside] = data->primary_x[vertex[2]]
-									+ factor * (data->primary_x[vertex[1]]
-											- data->primary_x[vertex[2]]);
-						yy[nside] = data->primary_y[vertex[2]]
-									+ factor * (data->primary_y[vertex[1]]
-											- data->primary_y[vertex[2]]);
-						zz[nside] = data->primary_z[vertex[2]]
-									+ factor * (data->primary_z[vertex[1]]
-											- data->primary_z[vertex[2]]);
-						nside++;
-						}
-					if (nside == 2)
-						{
-						if (data->display_projection_mode != MBV_PROJECTION_SPHEROID)
-							{
-							zz[0] += contour_offset_factor;
-							zz[1] += contour_offset_factor;
-							}
-						else if (global == MB_YES)
-							{
-							xx[0] += xx[0] * contour_offset_factor;
-							yy[0] += yy[0] * contour_offset_factor;
-							zz[0] += zz[0] * contour_offset_factor;
-							xx[1] += xx[1] * contour_offset_factor;
-							yy[1] += yy[1] * contour_offset_factor;
-							zz[1] += zz[1] * contour_offset_factor;
-							}
-						else
-							{
-							zz[0] += contour_offset_factor;
-							zz[1] += contour_offset_factor;
-							}
-						glVertex3f(xx[0], yy[0], zz[0]);
-						glVertex3f(xx[1], yy[1], zz[1]);
-						}
-					}
-
-					}
-				}
-			}
-
-		}
-
-	/* check for pending event */
-	if (view->plot_done == MB_NO
-		&& view->plot_interrupt_allowed == MB_YES
-		&& i % MBV_EVENTCHECKCOARSENESS == 0)
-		do_mbview_xevents();
-
-	/* dump out of loop if plotting already done at a higher recursion */
-	if (view->plot_done == MB_YES)
-		i = data->primary_nx;
-	}
-
-	/* end openGL list */
-	glEnd();
-	glEndList();
-
-	/* set rez flag only if plotting not done */
-	if (view->plot_done == MB_NO)
-		{
-		if (rez == MBV_REZ_FULL)
-			{
-			view->contourfullrez = MB_YES;
-			}
-		else if (rez == MBV_REZ_HIGH)
-			{
-			view->contourhirez = MB_YES;
-			}
-		else
-			{
-			view->contourlorez = MB_YES;
-			}
-		}
-
-	/* print output debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-/*------------------------------------------------------------------------------*/
-int mbview_getzdata(size_t instance,
-			double xgrid, double ygrid,
-			int *found, double *zdata)
-{
-
-	/* local variables */
-	char	*function_name = "mbview_getzdata";
-	int	status = MB_SUCCESS;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-	int	nsum;
-	double	zdatasum;
-	int	i,j, k, l, m, n;
-
-	/* print starting debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       instance:         %zu\n",instance);
-		fprintf(stderr,"dbg2       xgrid:            %f\n",xgrid);
-		fprintf(stderr,"dbg2       ygrid:            %f\n",ygrid);
-		}
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* get location in grid */
-	i = (int)((xgrid - data->primary_xmin) / data->primary_dx);
-	j = (int)((ygrid - data->primary_ymin) / data->primary_dy);
-
-	/* fail if outside grid */
-	if (i < 0 || i >= data->primary_nx - 1
-		|| j < 0 || j >= data->primary_ny - 1)
-		{
-		*found = MB_NO;
-		*zdata = 0.0;
-		}
-
-	/* check all four points and average the good ones */
-	else
-		{
-		k = i * data->primary_ny + j;
-		l = (i + 1) * data->primary_ny + j;
-		m = i * data->primary_ny + j + 1;
-		n = (i + 1) * data->primary_ny + j + 1;
-		nsum = 0;
-		zdatasum = 0.0;
-		if (data->primary_data[k] != data->primary_nodatavalue)
-			{
-			zdatasum += data->primary_data[k];
-			nsum++;
-			}
-		if (data->primary_data[l] != data->primary_nodatavalue)
-			{
-			zdatasum += data->primary_data[l];
-			nsum++;
-			}
-		if (data->primary_data[m] != data->primary_nodatavalue)
-			{
-			zdatasum += data->primary_data[m];
-			nsum++;
-			}
-		if (data->primary_data[n] != data->primary_nodatavalue)
-			{
-			zdatasum += data->primary_data[n];
-			nsum++;
-			}
-		if (nsum > 0)
-			{
-			*zdata = zdatasum / nsum;
-			*found = MB_YES;
-			}
-		else
-			{
-			*zdata = 0.0;
-			*found = MB_NO;
-			}
-		}
-
-	/* print output debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       found:           %d\n",*found);
-		fprintf(stderr,"dbg2       zdata:           %f\n",*zdata);
-		fprintf(stderr,"dbg2       status:          %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-
-
-/*------------------------------------------------------------------------------*/
diff --git a/src/mbview/mbview_profile.c b/src/mbview/mbview_profile.c
deleted file mode 100644
index 853c50c..0000000
--- a/src/mbview/mbview_profile.c
+++ /dev/null
@@ -1,872 +0,0 @@
-/*------------------------------------------------------------------------------
- *    The MB-system:	mbview_profile.c	3/8/2006
- *    $Id: mbview_profile.c 2239 2015-05-07 00:51:42Z caress $
- *
- *    Copyright (c) 2006-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *------------------------------------------------------------------------------*/
-/*
- *
- * Author:	D. W. Caress
- * Date:	March 8, 2006
- *
- * $Log: mbview_profile.c,v $
- * Revision 5.1  2008/05/16 22:59:42  caress
- * Release 5.1.1beta18.
- *
- * Revision 5.0  2007/06/17 23:16:58  caress
- * Added profiling to mbview.
- *
- *
- *
- */
-/*------------------------------------------------------------------------------*/
-
-/* Standard includes for builtins. */
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include <math.h>
-
-/* Motif required Headers */
-#include <X11/StringDefs.h>
-#include <X11/cursorfont.h>
-#include <Xm/Xm.h>
-#include <Xm/MainW.h>
-#include <Xm/DialogS.h>
-#include <Xm/RepType.h>
-#include <Xm/MwmUtil.h>
-#include <Xm/BulletinB.h>
-#include <Xm/RowColumn.h>
-#include <Xm/CascadeB.h>
-#include <Xm/PushB.h>
-#include <Xm/Separator.h>
-#include "MB3DView.h"
-#include "MB3DSiteList.h"
-#include "MB3DRouteList.h"
-#include "MB3DNavList.h"
-
-/* OpenGL include files */
-#ifdef WIN32
-#undef BOOL		/* It was defined by a chain of inclusions in the (patched) X11/Xmd.h */
-#include <windows.h>
-#endif
-
-#include <GL/gl.h>
-#include <GL/glu.h>
-#ifndef WIN32
-#	include <GL/glx.h>
-#endif
-#include "mb_glwdrawa.h"
-
-/* MBIO include files */
-#include "mb_status.h"
-#include "mb_define.h"
-
-/* mbview include */
-#include "mbview.h"
-#include "mbviewprivate.h"
-
-/*------------------------------------------------------------------------------*/
-
-/* library variables */
-extern int	mbv_verbose;
-extern int	mbv_ninstance;
-extern Widget	parent_widget;
-extern XtAppContext	app_context;
-extern struct mbview_world_struct mbviews[MBV_MAX_WINDOWS];
-extern char	*mbsystem_library_name;
-
-/* local variables */
-static Cardinal 	ac = 0;
-static Arg      	args[256];
-static char		value_text[MB_PATH_MAXLINE];
-
-static char rcs_id[]="$Id: mbview_profile.c 2239 2015-05-07 00:51:42Z caress $";
-
-/*------------------------------------------------------------------------------*/
-int mbview_getprofilecount(int verbose, size_t instance,
-			int *npoints,
-			int *error)
-
-{
-	/* local variables */
-	char	*function_name = "mbview_getprofilecount";
-	int	status = MB_SUCCESS;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-
-	/* print starting debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:                   %d\n", verbose);
-		fprintf(stderr,"dbg2       instance:                  %zu\n", instance);
-		}
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* get number of profiles */
-	*npoints = data->profile.npoints;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       npoints:                   %d\n", *npoints);
-		fprintf(stderr,"dbg2       error:                     %d\n", *error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:                    %d\n", status);
-		}
-
-	/* return */
-	return(status);
-}
-
-/*------------------------------------------------------------------------------*/
-int mbview_allocprofilepoints(int verbose,
-			int	npoints,
-			struct mbview_profilepoint_struct **points,
-			int 	*error)
-
-{
-	/* local variables */
-	char	*function_name = "mbview_allocprofilepoints";
-	int	status = MB_SUCCESS;
-
-	/* print starting debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:                   %d\n", verbose);
-		fprintf(stderr,"dbg2       npoints:                   %d\n", npoints);
-		fprintf(stderr,"dbg2       points:                    %p\n", *points);
-		}
-
-	/* allocate the arrays using mb_realloc */
-	status = mb_reallocd(verbose, __FILE__, __LINE__,
-				npoints * sizeof(struct mbview_profilepoint_struct),
-				(void **)points,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       points:                    %p\n", *points);
-		fprintf(stderr,"dbg2       error:                     %d\n", *error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:                    %d\n", status);
-		}
-
-	/* return */
-	return(status);
-}
-
-
-/*------------------------------------------------------------------------------*/
-int mbview_freeprofilepoints(int verbose,
-			double	**points,
-			int *error)
-
-{
-	/* local variables */
-	char	*function_name = "mbview_freeprofilepoints";
-	int	status = MB_SUCCESS;
-
-	/* print starting debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:                   %d\n", verbose);
-		fprintf(stderr,"dbg2       points:                    %p\n", *points);
-		}
-
-	/* free the arrays using mb_free */
-	status = mb_freed(verbose,__FILE__,__LINE__,(void **)points,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       points:                    %p\n", *points);
-		fprintf(stderr,"dbg2       error:                     %d\n", *error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:                    %d\n", status);
-		}
-
-	/* return */
-	return(status);
-}
-
-
-/*------------------------------------------------------------------------------*/
-int mbview_allocprofilearrays(int verbose,
-			int	npoints,
-			double	**distance,
-			double	**zdata,
-			int	**boundary,
-			double	**xlon,
-			double	**ylat,
-			double	**distovertopo,
-			double	**bearing,
-			double	**slope,
-			int 	*error)
-
-{
-	/* local variables */
-	char	*function_name = "mbview_allocprofilearrays";
-	int	status = MB_SUCCESS;
-
-	/* print starting debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:                   %d\n", verbose);
-		fprintf(stderr,"dbg2       npoints:                   %d\n", npoints);
-		fprintf(stderr,"dbg2       distance:                  %p\n", *distance);
-		fprintf(stderr,"dbg2       zdata:                     %p\n", *zdata);
-		fprintf(stderr,"dbg2       boundary:                  %p\n", *boundary);
-		fprintf(stderr,"dbg2       xlon:                      %p\n", *xlon);
-		fprintf(stderr,"dbg2       ylat:                      %p\n", *ylat);
-		fprintf(stderr,"dbg2       distovertopo:              %p\n", *distovertopo);
-		fprintf(stderr,"dbg2       bearing:                   %p\n", *bearing);
-		fprintf(stderr,"dbg2       slope:                     %p\n", *slope);
-		}
-
-	/* allocate the arrays using mb_realloc */
-	status = mb_reallocd(verbose, __FILE__, __LINE__, npoints * sizeof(double), (void **)distance,error);
-	status = mb_reallocd(verbose, __FILE__, __LINE__, npoints * sizeof(double), (void **)zdata,error);
-	status = mb_reallocd(verbose, __FILE__, __LINE__, npoints * sizeof(double), (void **)boundary,error);
-	status = mb_reallocd(verbose, __FILE__, __LINE__, npoints * sizeof(double), (void **)xlon,error);
-	status = mb_reallocd(verbose, __FILE__, __LINE__, npoints * sizeof(double), (void **)ylat,error);
-	status = mb_reallocd(verbose, __FILE__, __LINE__, npoints * sizeof(double), (void **)distovertopo,error);
-	status = mb_reallocd(verbose, __FILE__, __LINE__, npoints * sizeof(double), (void **)bearing,error);
-	status = mb_reallocd(verbose, __FILE__, __LINE__, npoints * sizeof(double), (void **)slope,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       distance:                  %p\n", *distance);
-		fprintf(stderr,"dbg2       zdata:                     %p\n", *zdata);
-		fprintf(stderr,"dbg2       boundary:                  %p\n", *boundary);
-		fprintf(stderr,"dbg2       xlon:                      %p\n", *xlon);
-		fprintf(stderr,"dbg2       ylat:                      %p\n", *ylat);
-		fprintf(stderr,"dbg2       distovertopo:              %p\n", *distovertopo);
-		fprintf(stderr,"dbg2       bearing:                   %p\n", *bearing);
-		fprintf(stderr,"dbg2       slope:                     %p\n", *slope);
-		fprintf(stderr,"dbg2       error:                     %d\n", *error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:                    %d\n", status);
-		}
-
-	/* return */
-	return(status);
-}
-
-
-/*------------------------------------------------------------------------------*/
-int mbview_freeprofilearrays(int verbose,
-			double	**distance,
-			double	**zdata,
-			int	**boundary,
-			double	**xlon,
-			double	**ylat,
-			double	**distovertopo,
-			double	**bearing,
-			double	**slope,
-			int *error)
-
-{
-	/* local variables */
-	char	*function_name = "mbview_freeprofilearrays";
-	int	status = MB_SUCCESS;
-
-	/* print starting debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:                   %d\n", verbose);
-		fprintf(stderr,"dbg2       distance:                  %p\n", *distance);
-		fprintf(stderr,"dbg2       zdata:                     %p\n", *zdata);
-		fprintf(stderr,"dbg2       boundary:                  %p\n", *boundary);
-		fprintf(stderr,"dbg2       xlon:                      %p\n", *xlon);
-		fprintf(stderr,"dbg2       ylat:                      %p\n", *ylat);
-		fprintf(stderr,"dbg2       distovertopo:              %p\n", *distovertopo);
-		fprintf(stderr,"dbg2       bearing:                   %p\n", *bearing);
-		fprintf(stderr,"dbg2       slope:                     %p\n", *slope);
-		}
-
-	/* free the arrays using mb_free */
-	status = mb_freed(verbose,__FILE__,__LINE__,(void **)distance,error);
-	status = mb_freed(verbose,__FILE__,__LINE__,(void **)zdata,error);
-	status = mb_freed(verbose,__FILE__,__LINE__,(void **)boundary,error);
-	status = mb_freed(verbose,__FILE__,__LINE__,(void **)xlon,error);
-	status = mb_freed(verbose,__FILE__,__LINE__,(void **)ylat,error);
-	status = mb_freed(verbose,__FILE__,__LINE__,(void **)distovertopo,error);
-	status = mb_freed(verbose,__FILE__,__LINE__,(void **)bearing,error);
-	status = mb_freed(verbose,__FILE__,__LINE__,(void **)slope,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       distance:                  %p\n", *distance);
-		fprintf(stderr,"dbg2       zdata:                     %p\n", *zdata);
-		fprintf(stderr,"dbg2       boundary:                  %p\n", *boundary);
-		fprintf(stderr,"dbg2       xlon:                      %p\n", *xlon);
-		fprintf(stderr,"dbg2       ylat:                      %p\n", *ylat);
-		fprintf(stderr,"dbg2       distovertopo:              %p\n", *distovertopo);
-		fprintf(stderr,"dbg2       bearing:                   %p\n", *bearing);
-		fprintf(stderr,"dbg2       slope:                     %p\n", *slope);
-		fprintf(stderr,"dbg2       error:                     %d\n", *error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:                    %d\n", status);
-		}
-
-	/* return */
-	return(status);
-}
-
-/*------------------------------------------------------------------------------*/
-int mbview_getprofile(int verbose, size_t instance,
-			mb_path	source_name,
-			double	*length,
-			double	*zmin,
-			double	*zmax,
-			int	*npoints,
-			double	*distance,
-			double	*zdata,
-			int	*boundary,
-			double	*xlon,
-			double	*ylat,
-			double	*distovertopo,
-			double	*bearing,
-			double	*slope,
-			int *error)
-
-{
-	/* local variables */
-	char	*function_name = "mbview_getprofile";
-	int	status = MB_SUCCESS;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-	int	i;
-
-	/* print starting debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:                   %d\n", verbose);
-		fprintf(stderr,"dbg2       instance:                  %zu\n", instance);
-		}
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* check that the array pointers are not NULL */
-	if (distance == NULL || zdata == NULL || boundary == NULL
-		|| xlon == NULL || ylat == NULL || distovertopo == NULL
-		|| slope == NULL || bearing == NULL)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_DATA_NOT_INSERTED;
-		}
-
-	/* otherwise go get the profile data */
-	else
-		{
-		/* loop over the profiles */
-		strcpy(source_name, data->profile.source_name);
-		*length = data->profile.length;
-		*zmin = data->profile.zmin;
-		*zmax = data->profile.npoints;
-		*npoints = data->profile.npoints;
-		for (i=0;i<data->profile.npoints;i++)
-			{
-			distance[i] = data->profile.points[i].distance;
-			zdata[i] = data->profile.points[i].zdata;
-			boundary[i] = data->profile.points[i].boundary;
-			xlon[i] = data->profile.points[i].xlon;
-			ylat[i] = data->profile.points[i].ylat;
-			distovertopo[i] = data->profile.points[i].distovertopo;
-			bearing[i] = data->profile.points[i].bearing;
-			slope[i] = data->profile.points[i].slope;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       source_name:                %s\n", source_name);
-		fprintf(stderr,"dbg2       length:                     %f\n", *length);
-		fprintf(stderr,"dbg2       zmin:                       %f\n", *zmin);
-		fprintf(stderr,"dbg2       zmax:                       %f\n", *zmax);
-		fprintf(stderr,"dbg2       npoints:                    %d\n", *npoints);
-		for (i=0;i<*npoints;i++)
-			{
-			fprintf(stderr,"dbg2       %d distance:%f zdata:%f boundary:%d xlon:%f ylat:%f distovertopo:%f bearing:%f slope:%f\n",
-					i, distance[i], zdata[i], boundary[i],
-				        xlon[i], ylat[i], distovertopo[i],
-				        bearing[i], slope[i]);
-			}
-		fprintf(stderr,"dbg2       error:                     %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:                    %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-
-/*------------------------------------------------------------------------------*/
-int mbview_reset_prglx(size_t instance)
-{
-	/* local variables */
-	char	*function_name = "mbview_reset_prglx";
-	int	status = MB_SUCCESS;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-	Dimension	scrolledWindow_width;
-	Dimension	scrolledWindow_height;
-
-	/* print starting debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       instance:         %zu\n", instance);
-		}
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* If profile view enabled update opengl plotting widget */
-	if (data->profile_view_mode == MBV_VIEW_ON)
-		{
-		/* delete old glx_context if it exists */
-		if (view->prglx_init == MB_YES)
-			{
-			glXDestroyContext(view->dpy, view->prglx_context);
-			view->prglx_init = MB_NO;
-			}
-
-		/* get and set sizes of the drawingArea */
-		XtVaGetValues(view->mb3dview.mbview_scrolledWindow_profile,
-			XmNwidth, &scrolledWindow_width,
-			XmNheight, &scrolledWindow_height,
-			NULL);
-		data->prheight = scrolledWindow_height - 35;
-		data->prwidth = data->profile_widthfactor
-					* (scrolledWindow_width -20);
-
-		/* set drawing area size */
-		ac = 0;
-		XtSetArg(args[ac], XmNwidth, data->prwidth); ac++;
-		XtSetArg(args[ac], XmNheight, data->prheight); ac++;
-		XtSetValues(view->mb3dview.mbview_drawingArea_profile, args, ac);
-		ac = 0;
-
-		/* set prglwda size */
-		XtSetArg(args[ac], XmNwidth, data->prwidth); ac++;
-		XtSetArg(args[ac], XmNheight, data->prheight); ac++;
-		XtSetValues(view->prglwmda, args, ac);
-
-		/* set up a new opengl context */
-		ac = 0;
-		XtSetArg(args[ac], mbGLwNvisualInfo, &(view->prvi));
-		ac++;
-		XtGetValues(view->prglwmda, args, ac);
-#ifdef MBV_DEBUG_GLX
-fprintf(stderr,"%s:%d:%s instance:%zu glXCreateContext(%p,%p)\n",
-__FILE__,__LINE__,function_name,instance,view->dpy,view->prvi);
-#endif
-		view->prglx_context = glXCreateContext(view->dpy, view->prvi,
-                		     NULL, GL_TRUE);
-#ifdef MBV_DEBUG_GLX
-fprintf(stderr,"%s:%d:%s instance:%zu glXMakeCurrent(%p,%p,%p)\n",
-__FILE__,__LINE__,function_name,instance,view->dpy,XtWindow(view->prglwmda),view->prglx_context);
-#endif
-		glXMakeCurrent(view->dpy,XtWindow(view->prglwmda),view->prglx_context);
-
-#ifdef MBV_GET_GLX_ERRORS
-mbview_glerrorcheck(instance, __FILE__, __LINE__, function_name);
-#endif
-		view->prglx_init = MB_YES;
-        	glViewport(0, 0, data->prwidth, data->prheight);
-		view->praspect_ratio = ((float)data->prheight) / ((float)data->prwidth);
-		}
-
-	/* print output debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:                %d\n",status);
-		fprintf(stderr,"dbg2       view->dpy:             %p\n", view->dpy);
-		fprintf(stderr,"dbg2       view->prvi:            %p\n", view->prvi);
-		fprintf(stderr,"dbg2       view->prglwmda:        %p\n", view->prglwmda);
-		fprintf(stderr,"dbg2       view->prglx_context:   %p\n", view->prglx_context);
-		fprintf(stderr,"dbg2       view->prglx_init:      %d\n", view->prglx_init);
-		}
-
-	/* return */
-	return(status);
-}
-
-/*------------------------------------------------------------------------------*/
-int mbview_destroy_prglx(size_t instance)
-{
-	/* local variables */
-	char	*function_name = "mbview_destroy_prglx";
-	int	status = MB_SUCCESS;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-
-	/* print starting debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       instance:         %zu\n", instance);
-		}
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* If profile view enabled update opengl plotting widget */
-	if (data->profile_view_mode == MBV_VIEW_ON)
-		{
-		/* delete old glx_context if it exists */
-		if (view->prglx_init == MB_YES)
-			{
-			glXDestroyContext(view->dpy, view->prglx_context);
-			view->prglx_init = MB_NO;
-			}
-		}
-
-	/* print output debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:                %d\n",status);
-		fprintf(stderr,"dbg2       view->dpy:             %p\n", view->dpy);
-		fprintf(stderr,"dbg2       view->prvi:            %p\n", view->prvi);
-		fprintf(stderr,"dbg2       view->prglwmda:        %p\n", view->prglwmda);
-		fprintf(stderr,"dbg2       view->prglx_context:   %p\n", view->prglx_context);
-		fprintf(stderr,"dbg2       view->prglx_init:      %d\n", view->prglx_init);
-		}
-
-	/* return */
-	return(status);
-}
-
-
-
-/*------------------------------------------------------------------------------*/
-int mbview_plotprofile(size_t instance)
-{
-	/* local variables */
-	char	*function_name = "mbview_plotprofile";
-	int	status = MB_SUCCESS;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-	float	left, right, top, bottom;
-	double	zcenter, zmin, zmax;
-	double	scale;
-	float	yzmin, yzmax;
-	float	x, y;
-	int	clip;
-	int	i;
-
-	/* print starting debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       instance:         %zu\n", instance);
-		}
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* If there is a profile plot it */
-	if (data->profile_view_mode == MBV_VIEW_ON)
-		{
-
-		/* get scaling */
-		scale = MBV_OPENGL_WIDTH / data->profile.length;
-		left = -0.1 * MBV_OPENGL_WIDTH;
-		right = 1.1 * MBV_OPENGL_WIDTH;
-		zcenter = 0.5 * (data->profile.zmax + data->profile.zmin);
-		top = 0.5 * (right - left) * view->praspect_ratio;
-		bottom = -top;
-		zmin = zcenter - 0.5 * view->praspect_ratio * data->profile.length / data->profile_exageration;
-		zmax = zcenter + 0.5 * view->praspect_ratio * data->profile.length / data->profile_exageration;
-		yzmin = scale * data->profile_exageration * (zmin - zcenter);
-		yzmax = scale * data->profile_exageration * (zmax - zcenter);
-		clip = MB_NO;
-
-		/* set projection to 2D */
-#ifdef MBV_DEBUG_GLX
-fprintf(stderr,"%s:%d:%s instance:%zu glXMakeCurrent(%p,%p,%p)\n",
-__FILE__,__LINE__,function_name,instance,view->dpy,XtWindow(view->prglwmda),view->prglx_context);
-#endif
-		glXMakeCurrent(view->dpy,XtWindow(view->prglwmda),view->prglx_context);
-
-#ifdef MBV_GET_GLX_ERRORS
-mbview_glerrorcheck(instance, __FILE__, __LINE__, function_name);
-#endif
-		glMatrixMode(GL_PROJECTION);
-		glLoadIdentity();
-		glOrtho(left, right, bottom, top,
-				MBV_OPENGL_ZMIN2D, MBV_OPENGL_ZMAX2D);
-
-		/* set up translations */
-		glMatrixMode(GL_MODELVIEW);
-		glLoadIdentity();
-		glTranslated (0.0, 0.0, MBV_OPENGL_ZMIN2D);
-
-		/* set background color */
-		glClearColor(1.0, 1.0, 1.0, 0.0);
-		glClear(GL_COLOR_BUFFER_BIT);
-
-		/* draw profile */
-		glLineWidth(1.0);
-		glBegin(GL_QUADS);
-		for (i=0;i<data->profile.npoints-1;i++)
-			{
-			if (data->profile.points[i].boundary == MB_NO
-				|| data->profile.points[i+1].boundary == MB_NO)
-				{
-				if (data->profile.points[i].slope < data->profile_slopethreshold)
-					{
-					glColor3f(colortable_object_red[MBV_COLOR_BLACK],
-						colortable_object_green[MBV_COLOR_BLACK],
-						colortable_object_blue[MBV_COLOR_BLACK]);
-					}
-				else
-					{
-					glColor3f(colortable_object_red[MBV_COLOR_RED],
-						colortable_object_green[MBV_COLOR_RED],
-						colortable_object_blue[MBV_COLOR_RED]);
-					}
-				x = scale * data->profile.points[i].distance;
-				y = scale * data->profile_exageration * (data->profile.points[i].zdata - zcenter);
-				if (y < yzmin)
-					{
-					clip = MB_YES;
-					y = yzmin;
-					}
-				if (y > yzmax)
-					{
-					clip = MB_YES;
-					y = yzmax;
-					}
-				glVertex3f(x, yzmin, MBV_OPENGL_ZPROFILE1);
-				glVertex3f(x, y, MBV_OPENGL_ZPROFILE1);
-				x = scale * data->profile.points[i+1].distance;
-				y = scale * data->profile_exageration * (data->profile.points[i+1].zdata - zcenter);
-				if (y < yzmin)
-					{
-					clip = MB_YES;
-					y = yzmin;
-					}
-				if (y > yzmax)
-					{
-					clip = MB_YES;
-					y = yzmax;
-					}
-				glVertex3f(x, y, MBV_OPENGL_ZPROFILE1);
-				glVertex3f(x, yzmin, MBV_OPENGL_ZPROFILE1);
-				}
-			}
-		glEnd();
-
-		/* draw boundaries */
-		glColor3f(colortable_object_red[MBV_COLOR_GREEN],
-			colortable_object_green[MBV_COLOR_GREEN],
-			colortable_object_blue[MBV_COLOR_GREEN]);
-		glLineWidth(2.0);
-		glBegin(GL_LINES);
-		for (i=0;i<data->profile.npoints;i++)
-			{
-			if (data->profile.points[i].boundary == MB_YES)
-				{
-				x = scale * data->profile.points[i].distance;
-				glVertex3f(x, yzmin, MBV_OPENGL_ZPROFILE1);
-				glVertex3f(x, yzmax, MBV_OPENGL_ZPROFILE1);
-				}
-			}
-		glEnd();
-
-		/* draw box */
-		if (clip == MB_NO)
-			glColor3f(colortable_object_red[MBV_COLOR_BLACK],
-				colortable_object_green[MBV_COLOR_BLACK],
-				colortable_object_blue[MBV_COLOR_BLACK]);
-		else
-			glColor3f(colortable_object_red[MBV_COLOR_RED],
-				colortable_object_green[MBV_COLOR_RED],
-				colortable_object_blue[MBV_COLOR_RED]);
-		glLineWidth(2.0);
-		glBegin(GL_LINE_LOOP);
-		glVertex3f((float)(0.0), yzmin, (float)(MBV_OPENGL_ZPROFILE1));
-		glVertex3f((float)(MBV_OPENGL_WIDTH), yzmin, (float)(MBV_OPENGL_ZPROFILE1));
-		glVertex3f((float)(MBV_OPENGL_WIDTH), yzmax, (float)(MBV_OPENGL_ZPROFILE1));
-		glVertex3f((float)(0.0), yzmax, (float)(MBV_OPENGL_ZPROFILE1));
-		glEnd();
-#ifdef MBV_GETERRORS
-mbview_glerrorcheck(instance, __FILE__, __LINE__, function_name);
-#endif
-
-		/* flush opengl buffers */
-		glFlush();
-#ifdef MBV_GETERRORS
-mbview_glerrorcheck(instance, 2, function_name);
-#endif
-
-		/* swap opengl buffers */
-		glXSwapBuffers (XtDisplay(view->prglwmda),
-				XtWindow(view->prglwmda));
-#ifdef MBV_GETERRORS
-mbview_glerrorcheck(instance, 3, function_name);
-#endif
-
-
-		/* update info label */
-		mbview_profile_text(instance);
-		}
-
-	/* print output debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-
-
-
-/*------------------------------------------------------------------------------*/
-int mbview_profile_text(size_t instance)
-{
-
-	/* local variables */
-	char	*function_name = "mbview_profile_text";
-	int	status = MB_SUCCESS;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-
-	/* print starting debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       instance:         %zu\n", instance);
-		}
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* update profile info */
-	if (data->profile.npoints > 0 && data->profile.source != MBV_PROFILE_NONE)
-		{
-		sprintf(value_text,
-		":::t\"Profile Source: %s\":t\" Length: %.2f m\":t\" Vertical Range: \":t\" %.2f to %.2f m\"",
-			data->profile.source_name,
-			data->profile.points[data->profile.npoints-1].distance,
-			data->profile.zmin,data->profile.zmax);
-		}
-	else
-		{
-		sprintf(value_text, ":::t\"Profile Source: None\":t\"No Profile\"");
-		}
-	set_mbview_label_multiline_string(view->mb3dview.mbview_profile_label_info, value_text);
-
-	/* print output debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:          %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-
-/*------------------------------------------------------------------------------*/
diff --git a/src/mbview/mbview_route.c b/src/mbview/mbview_route.c
deleted file mode 100644
index 96e0c89..0000000
--- a/src/mbview/mbview_route.c
+++ /dev/null
@@ -1,2780 +0,0 @@
-/*------------------------------------------------------------------------------
- *    The MB-system:	mbview_route.c	9/25/2003
- *    $Id: mbview_route.c 2239 2015-05-07 00:51:42Z caress $
- *
- *    Copyright (c) 2003-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *------------------------------------------------------------------------------*/
-/*
- *
- * Author:	D. W. Caress
- * Date:	September 25, 2003
- *
- * Note:	This code was broken out of mbview_callbacks.c, which was
- *		begun on October 7, 2002
- *
- * $Log: mbview_route.c,v $
- * Revision 5.20  2008/09/11 20:17:33  caress
- * Checking in updates made during cruise AT15-36.
- *
- * Revision 5.19  2008/05/16 22:59:42  caress
- * Release 5.1.1beta18.
- *
- * Revision 5.18  2008/03/14 19:04:32  caress
- * Fixed memory problems with route editing.
- *
- * Revision 5.17  2007/06/17 23:27:30  caress
- * Added NBeditviz.
- *
- * Revision 5.16  2006/10/05 18:58:29  caress
- * Changes for 5.1.0beta4
- *
- * Revision 5.15  2006/09/11 18:55:53  caress
- * Changes during Western Flyer and Thomas Thompson cruises, August-September
- * 2006.
- *
- * Revision 5.14  2006/06/16 19:30:58  caress
- * Check in after the Santa Monica Basin Mapping AUV Expedition.
- *
- * Revision 5.13  2006/04/26 22:06:40  caress
- * Improved profile view feature and enabled export of profile data.
- *
- * Revision 5.12  2006/04/11 19:17:04  caress
- * Added a profile capability.
- *
- * Revision 5.11  2006/01/24 19:21:32  caress
- * Version 5.0.8 beta.
- *
- * Revision 5.10  2005/11/05 01:11:47  caress
- * Much work over the past two months.
- *
- * Revision 5.9  2005/04/07 04:16:31  caress
- * Fixed a route handling problem.
- *
- * Revision 5.8  2005/03/25 04:46:15  caress
- * Fixed MBgrdviz crashes related to route data by fixing problem with allocation and deallocation of route arrays in the mbview library.
- *
- * Revision 5.7  2005/02/08 22:37:43  caress
- * Heading towards 5.0.6 release.
- *
- * Revision 5.5  2004/09/16 21:44:38  caress
- * Many changes over the summer.
- *
- * Revision 5.4  2004/07/27 19:50:28  caress
- * Improving route planning capability.
- *
- * Revision 5.3  2004/07/15 19:26:44  caress
- * Improvements to survey planning.
- *
- * Revision 5.2  2004/06/18 04:26:06  caress
- * June 17, 2004 update.
- *
- * Revision 5.1  2004/02/24 22:52:29  caress
- * Added spherical projection to MBview.
- *
- * Revision 5.0  2003/12/02 20:38:34  caress
- * Making version number 5.0
- *
- * Revision 1.2  2003/11/25 01:43:19  caress
- * MBview version generated during EW0310.
- *
- *
- */
-/*------------------------------------------------------------------------------*/
-
-/* Standard includes for builtins. */
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include <math.h>
-
-/* Motif required Headers */
-#include <X11/StringDefs.h>
-#include <X11/cursorfont.h>
-#include <Xm/Xm.h>
-#include <Xm/MainW.h>
-#include <Xm/DialogS.h>
-#include <Xm/RepType.h>
-#include <Xm/MwmUtil.h>
-#include <Xm/BulletinB.h>
-#include <Xm/RowColumn.h>
-#include <Xm/CascadeB.h>
-#include <Xm/PushB.h>
-#include <Xm/Separator.h>
-#include <Xm/List.h>
-#include "MB3DView.h"
-#include "MB3DSiteList.h"
-#include "MB3DRouteList.h"
-#include "MB3DNavList.h"
-
-/* OpenGL include files */
-#ifdef WIN32
-#undef BOOL		/* It was defined by a chain of inclusions in the (patched) X11/Xmd.h */
-#include <windows.h>
-#endif
-
-#include <GL/gl.h>
-#include <GL/glu.h>
-#ifndef WIN32
-#	include <GL/glx.h>
-#endif
-#include "mb_glwdrawa.h"
-
-/* MBIO include files */
-#include "mb_status.h"
-#include "mb_define.h"
-
-/* mbview include */
-#include "mbview.h"
-#include "mbviewprivate.h"
-
-/*------------------------------------------------------------------------------*/
-
-/* local variables */
-static char		value_string[MB_PATH_MAXLINE];
-
-static char rcs_id[]="$Id: mbview_route.c 2239 2015-05-07 00:51:42Z caress $";
-
-/*------------------------------------------------------------------------------*/
-int mbview_getroutecount(int verbose, size_t instance,
-			int *nroute,
-			int *error)
-{
-	/* local variables */
-	char	*function_name = "mbview_getroutecount";
-	int	status = MB_SUCCESS;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-
-	/* print starting debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:                   %d\n", verbose);
-		fprintf(stderr,"dbg2       instance:                  %zu\n", instance);
-		}
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* get number of routes */
-	*nroute = shared.shareddata.nroute;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       nroute:                    %d\n", *nroute);
-		fprintf(stderr,"dbg2       error:                     %d\n", *error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:                    %d\n", status);
-		}
-
-	/* return */
-	return(status);
-}
-
-/*------------------------------------------------------------------------------*/
-int mbview_getroutepointcount(int verbose, size_t instance,
-			int	route,
-			int	*npoint,
-			int	*nintpoint,
-			int *error)
-{
-	/* local variables */
-	char	*function_name = "mbview_getroutepointcount";
-	int	status = MB_SUCCESS;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-	int	i;
-
-	/* print starting debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:                   %d\n", verbose);
-		fprintf(stderr,"dbg2       instance:                  %zu\n", instance);
-		fprintf(stderr,"dbg2       route:                     %d\n", route);
-		}
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* get number of points in specified route */
-	*npoint = 0;
-	*nintpoint = 0;
-	if (route >= 0 && route < shared.shareddata.nroute)
-		{
-		*npoint = shared.shareddata.routes[route].npoints;
-		for (i=0;i<*npoint-1;i++)
-			{
-			if (shared.shareddata.routes[route].segments[i].nls > 2)
-				*nintpoint += shared.shareddata.routes[route].segments[i].nls - 2;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       npoint:                    %d\n", *npoint);
-		fprintf(stderr,"dbg2       nintpoint:                 %d\n", *nintpoint);
-		fprintf(stderr,"dbg2       error:                     %d\n", *error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:                    %d\n", status);
-		}
-
-	/* return */
-	return(status);
-
-}
-/*------------------------------------------------------------------------------*/
-int mbview_getrouteselected(int verbose, size_t instance,
-			int	route,
-			int	*selected,
-			int *error)
-{
-	/* local variables */
-	char	*function_name = "mbview_getrouteselected";
-	int	status = MB_SUCCESS;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-
-	/* print starting debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:                   %d\n", verbose);
-		fprintf(stderr,"dbg2       instance:                  %zu\n", instance);
-		fprintf(stderr,"dbg2       route:                     %d\n", route);
-		}
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* check if the specified route is currently selected in totality */
-	if (route == shared.shareddata.route_selected
-		&& shared.shareddata.route_point_selected == MBV_SELECT_ALL)
-		*selected = MB_YES;
-	else
-		*selected = MB_NO;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       selected:                  %d\n", *selected);
-		fprintf(stderr,"dbg2       error:                     %d\n", *error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:                    %d\n", status);
-		}
-
-	/* return */
-	return(status);
-
-}
-/*------------------------------------------------------------------------------*/
-int mbview_getrouteinfo(int verbose, size_t instance,
-			int working_route,
-			int *nroutewaypoint,
-			int *nroutpoint,
-			char *routename,
-			int *routecolor,
-			int *routesize,
-			double *routedistancelateral,
-			double *routedistancetopo,
-			int *error)
-{
-	/* local variables */
-	char	*function_name = "mbview_getrouteinfo";
-	int	status = MB_SUCCESS;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-	struct mbview_route_struct *route;
-
-	/* print starting debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:                   %d\n", verbose);
-		fprintf(stderr,"dbg2       instance:                  %zu\n", instance);
-		fprintf(stderr,"dbg2       working_route:             %d\n", working_route);
-		}
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* check that the route is valid */
-	if (working_route < 0 && working_route >= shared.shareddata.nroute)
-		{
-		*nroutewaypoint = 0;
-		*nroutpoint = 0;
-		routename[0] = '\0';
-		*routecolor = 0;
-		*routesize = 0;
-		*routedistancelateral = 0.0;
-		*routedistancetopo = 0.0;
-		status = MB_FAILURE;
-		*error = MB_ERROR_DATA_NOT_INSERTED;
-		}
-
-	/* otherwise go get the route data */
-	else
-		{
-		/* get basic info */
-		route = &(shared.shareddata.routes[working_route]);
-		*nroutewaypoint = route->npoints;
-		*nroutpoint = route->nroutepoint;
-		strcpy(routename, route->name);
-		*routecolor = route->color;
-		*routesize = route->size;
-		*routedistancelateral = route->distancelateral;
-		*routedistancetopo = route->distancetopo;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       nroutewaypoint:            %d\n", *nroutewaypoint);
-		fprintf(stderr,"dbg2       nroutpoint:                %d\n", *nroutpoint);
-		fprintf(stderr,"dbg2       routename:                 %d\n", *routename);
-		fprintf(stderr,"dbg2       routecolor:                %d\n", *routecolor);
-		fprintf(stderr,"dbg2       routesize:                 %d\n", *routesize);
-		fprintf(stderr,"dbg2       routedistancelateral:      %f\n", *routedistancelateral);
-		fprintf(stderr,"dbg2       routedistancetopo:         %f\n", *routedistancetopo);
-		fprintf(stderr,"dbg2       error:                     %d\n", *error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:                    %d\n", status);
-		}
-
-	/* return */
-	return(status);
-
-}
-
-/*------------------------------------------------------------------------------*/
-int mbview_allocroutearrays(int verbose,
-			int	npointtotal,
-			double	**routelon,
-			double	**routelat,
-			int	**waypoint,
-			double	**routetopo,
-			double	**routebearing,
-			double	**distlateral,
-			double	**distovertopo,
-			double	**slope,
-			int *error)
-{
-	/* local variables */
-	char	*function_name = "mbview_allocroutearrays";
-	int	status = MB_SUCCESS;
-
-	/* print starting debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:                   %d\n", verbose);
-		fprintf(stderr,"dbg2       npointtotal:               %d\n", npointtotal);
-		fprintf(stderr,"dbg2       routelon:                  %p\n", *routelon);
-		fprintf(stderr,"dbg2       routelat:                  %p\n", *routelat);
-		if (waypoint != NULL)
-		fprintf(stderr,"dbg2       waypoint:                  %p\n", *waypoint);
-		if (routetopo != NULL)
-		fprintf(stderr,"dbg2       routetopo:                 %p\n", *routetopo);
-		if (routebearing != NULL)
-		fprintf(stderr,"dbg2       routebearing:              %p\n", *routebearing);
-		if (distlateral != NULL)
-		fprintf(stderr,"dbg2       distlateral:               %p\n", *distlateral);
-		if (distovertopo != NULL)
-		fprintf(stderr,"dbg2       distovertopo:              %p\n", *distovertopo);
-		if (slope != NULL)
-		fprintf(stderr,"dbg2       slope:                     %p\n", *slope);
-		}
-
-	/* allocate the arrays using mb_realloc */
-	status = mb_reallocd(verbose,__FILE__,__LINE__,npointtotal*sizeof(double),(void **)routelon,error);
-	if (status == MB_SUCCESS)
-		status = mb_reallocd(verbose,__FILE__,__LINE__,npointtotal*sizeof(double),(void **)routelat,error);
-	if (status == MB_SUCCESS && waypoint != NULL)
-		status = mb_reallocd(verbose,__FILE__,__LINE__,npointtotal*sizeof(int),(void **)waypoint,error);
-	if (status == MB_SUCCESS && routetopo != NULL)
-		status = mb_reallocd(verbose,__FILE__,__LINE__,npointtotal*sizeof(double),(void **)routetopo,error);
-	if (status == MB_SUCCESS && routebearing != NULL)
-		status = mb_reallocd(verbose,__FILE__,__LINE__,npointtotal*sizeof(double),(void **)routebearing,error);
-	if (status == MB_SUCCESS && distlateral != NULL)
-		status = mb_reallocd(verbose,__FILE__,__LINE__,npointtotal*sizeof(double),(void **)distlateral,error);
-	if (status == MB_SUCCESS && distovertopo != NULL)
-		status = mb_reallocd(verbose,__FILE__,__LINE__,npointtotal*sizeof(double),(void **)distovertopo,error);
-	if (status == MB_SUCCESS && slope != NULL)
-		status = mb_reallocd(verbose,__FILE__,__LINE__,npointtotal*sizeof(double),(void **)slope,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       routelon:                  %p\n", *routelon);
-		fprintf(stderr,"dbg2       routelat:                  %p\n", *routelat);
-		if (waypoint != NULL)
-		fprintf(stderr,"dbg2       waypoint:                  %p\n", *waypoint);
-		if (routetopo != NULL)
-		fprintf(stderr,"dbg2       routetopo:                 %p\n", *routetopo);
-		if (routebearing != NULL)
-		fprintf(stderr,"dbg2       routebearing:              %p\n", *routebearing);
-		if (distlateral != NULL)
-		fprintf(stderr,"dbg2       distlateral:               %p\n", *distlateral);
-		if (distovertopo != NULL)
-		fprintf(stderr,"dbg2       distovertopo:              %p\n", *distovertopo);
-		if (slope != NULL)
-		fprintf(stderr,"dbg2       slope:                     %p\n", *slope);
-		fprintf(stderr,"dbg2       error:                     %d\n", *error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:                    %d\n", status);
-		}
-
-	/* return */
-	return(status);
-}
-
-
-/*------------------------------------------------------------------------------*/
-int mbview_freeroutearrays(int verbose,
-			double	**routelon,
-			double	**routelat,
-			int	**waypoint,
-			double	**routetopo,
-			double	**routebearing,
-			double	**distlateral,
-			double	**distovertopo,
-			double	**slope,
-			int *error)
-{
-	/* local variables */
-	char	*function_name = "mbview_freeroutearrays";
-	int	status = MB_SUCCESS;
-
-	/* print starting debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:                   %d\n", verbose);
-		fprintf(stderr,"dbg2       routelon:                  %p\n", *routelon);
-		fprintf(stderr,"dbg2       routelat:                  %p\n", *routelat);
-		if (waypoint != NULL)
-		fprintf(stderr,"dbg2       waypoint:                  %p\n", *waypoint);
-		if (routetopo != NULL)
-		fprintf(stderr,"dbg2       routetopo:                 %p\n", *routetopo);
-		if (routebearing != NULL)
-		fprintf(stderr,"dbg2       routebearing:              %p\n", *routebearing);
-		if (distlateral != NULL)
-		fprintf(stderr,"dbg2       distlateral:               %p\n", *distlateral);
-		if (distovertopo != NULL)
-		fprintf(stderr,"dbg2       distovertopo:              %p\n", *distovertopo);
-		if (slope != NULL)
-		fprintf(stderr,"dbg2       slope:                     %p\n", *slope);
-		}
-
-	/* free the arrays using mb_free */
-	status = mb_freed(verbose,__FILE__,__LINE__,(void **)routelon,error);
-	status = mb_freed(verbose,__FILE__,__LINE__,(void **)routelat,error);
-	if (waypoint != NULL)
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)waypoint,error);
-	if (routetopo != NULL)
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)routetopo,error);
-	if (routebearing != NULL)
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)routebearing,error);
-	if (distlateral != NULL)
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)distlateral,error);
-	if (distovertopo != NULL)
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)distovertopo,error);
-	if (slope != NULL)
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)slope,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       routelon:                  %p\n", *routelon);
-		fprintf(stderr,"dbg2       routelat:                  %p\n", *routelat);
-		if (waypoint != NULL)
-		fprintf(stderr,"dbg2       waypoint:                  %p\n", *waypoint);
-		if (routetopo != NULL)
-		fprintf(stderr,"dbg2       routetopo:                 %p\n", *routetopo);
-		if (routebearing != NULL)
-		fprintf(stderr,"dbg2       routebearing:              %p\n", *routebearing);
-		if (distlateral != NULL)
-		fprintf(stderr,"dbg2       distlateral:               %p\n", *distlateral);
-		if (distovertopo != NULL)
-		fprintf(stderr,"dbg2       distovertopo:              %p\n", *distovertopo);
-		if (slope != NULL)
-		fprintf(stderr,"dbg2       slope:                     %p\n", *slope);
-		fprintf(stderr,"dbg2       error:                     %d\n", *error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:                    %d\n", status);
-		}
-
-	/* return */
-	return(status);
-}
-
-
-/*------------------------------------------------------------------------------*/
-int mbview_addroute(int verbose, size_t instance,
-			int	npoint,
-			double	*routelon,
-			double	*routelat,
-			int	*waypoint,
-			int	routecolor,
-			int	routesize,
-			int	routeeditmode,
-			mb_path	routename,
-			int	*iroute,
-			int *error)
-{
-	/* local variables */
-	char	*function_name = "mbview_addroute";
-	int	status = MB_SUCCESS;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-	double	xgrid, ygrid, zdata;
-	double	xdisplay, ydisplay, zdisplay;
-	int	i;
-
-	/* print starting debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:                   %d\n", verbose);
-		fprintf(stderr,"dbg2       instance:                  %zu\n", instance);
-		fprintf(stderr,"dbg2       npoint:                    %d\n", npoint);
-		fprintf(stderr,"dbg2       routelon:                  %p\n", routelon);
-		fprintf(stderr,"dbg2       routelat:                  %p\n", routelat);
-		fprintf(stderr,"dbg2       waypoint:                  %p\n", waypoint);
-		for (i=0;i<npoint;i++)
-			{
-			fprintf(stderr,"dbg2       point:%d lon:%f lat:%f waypoint:%d\n",
-					i, routelon[i], routelat[i], waypoint[i]);
-			}
-		fprintf(stderr,"dbg2       routecolor:                %d\n", routecolor);
-		fprintf(stderr,"dbg2       routesize:                 %d\n", routesize);
-		fprintf(stderr,"dbg2       routeeditmode:             %d\n", routeeditmode);
-		fprintf(stderr,"dbg2       routename:                 %s\n", routename);
-		}
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* make sure no route is selected */
-	shared.shareddata.route_selected = MBV_SELECT_NONE;
-	shared.shareddata.route_point_selected = MBV_SELECT_NONE;
-
-	/* set route id so that new route is created */
-	*iroute = shared.shareddata.nroute;
-
-	/* loop over the points in the new route */
-	for (i=0;i<npoint;i++)
-		{
-		/* check waypoint flag correct */
-		if (waypoint[i] <= MBV_ROUTE_WAYPOINT_NONE
-			|| waypoint[i] > MBV_ROUTE_WAYPOINT_ENDLINE4)
-			waypoint[i] = MBV_ROUTE_WAYPOINT_SIMPLE;
-
-		/* get route positions in grid coordinates */
-		status = mbview_projectll2xyzgrid(instance,
-				routelon[i], routelat[i],
-				&xgrid, &ygrid, &zdata);
-
-		/* get route positions in display coordinates */
-		status = mbview_projectll2display(instance,
-				routelon[i], routelat[i], zdata,
-				&xdisplay, &ydisplay, &zdisplay);
-
-		/* check for reasonable coordinates */
-		if (fabs(xdisplay) < 1000.0 && fabs(ydisplay) < 1000.0 && fabs(zdisplay) < 1000.0)
-			{
-
-			/* add the route point */
-			mbview_route_add(instance, *iroute, i, waypoint[i],
-				xgrid, ygrid,
-				routelon[i], routelat[i], zdata,
-				xdisplay, ydisplay, zdisplay);
-			}
-
-		/* report failure due to unreasonable coordinates */
-		else
-			{
-fprintf(stderr,"Failed to add route point at position lon:%f lat:%f due to display coordinate projection (%f %f %f) far outside view...\n",
-routelon[i],routelat[i],xdisplay,ydisplay,zdisplay);
-			XBell(view->dpy,100);
-			}
-		}
-
-	/* set color size and name for new route */
-	shared.shareddata.routes[*iroute].color = routecolor;
-	shared.shareddata.routes[*iroute].size = routesize;
-	shared.shareddata.routes[*iroute].editmode = routeeditmode;
-	strcpy(shared.shareddata.routes[*iroute].name,routename);
-
-	/* set distance values */
-	mbview_route_setdistance(instance, *iroute);
-
-	/* make routes viewable */
-	if (data->route_view_mode != MBV_VIEW_ON)
-		{
-		data->route_view_mode = MBV_VIEW_ON;
-		set_mbview_route_view_mode(instance, MBV_VIEW_ON);
-		}
-
-	/* update route list */
-	mbview_updateroutelist();
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       iroute:                    %d\n",*iroute);
-		fprintf(stderr,"dbg2       error:                     %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:                    %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-
-
-/*------------------------------------------------------------------------------*/
-int mbview_deleteroute(int verbose, size_t instance,
-			int iroute,
-			int *error)
-{
-	/* local variables */
-	char	*function_name = "mbview_deleteroute";
-	int	status = MB_SUCCESS;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-	int	jpoint;
-
-	/* print starting debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:                   %d\n", verbose);
-		fprintf(stderr,"dbg2       instance:                  %zu\n", instance);
-		fprintf(stderr,"dbg2       iroute:                    %d\n", iroute);
-		}
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* delete the points in the route backwards */
-	for (jpoint=shared.shareddata.routes[iroute].npoints-1;jpoint>=0;jpoint--)
-		{
-		/* delete the route point */
-		mbview_route_delete(instance, iroute, jpoint);
-		}
-
-	/* set pick annotation */
-	mbview_pick_text(instance);
-
-	/* update route list */
-	mbview_updateroutelist();
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:                     %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:                    %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-
-
-/*------------------------------------------------------------------------------*/
-int mbview_getroute(int verbose, size_t instance,
-			int	route,
-			int	*npointtotal,
-			double	*routelon,
-			double	*routelat,
-			int	*waypoint,
-			double	*routetopo,
-			double	*routebearing,
-			double	*distlateral,
-			double	*distovertopo,
-			double	*slope,
-			int	*routecolor,
-			int	*routesize,
-			mb_path	routename,
-			int *error)
-{
-	/* local variables */
-	char	*function_name = "mbview_getroute";
-	int	status = MB_SUCCESS;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-	double	dx, dy, range, bearing;
-	double	xx1, yy1, xx2, yy2;
-	int	i, j;
-
-	/* print starting debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:                   %d\n", verbose);
-		fprintf(stderr,"dbg2       instance:                  %zu\n", instance);
-		fprintf(stderr,"dbg2       route:                     %d\n", route);
-		fprintf(stderr,"dbg2       npointtotal:               %p\n", npointtotal);
-		fprintf(stderr,"dbg2       routelon:                  %p\n", routelon);
-		fprintf(stderr,"dbg2       routelat:                  %p\n", routelat);
-		fprintf(stderr,"dbg2       waypoint:                  %p\n", waypoint);
-		fprintf(stderr,"dbg2       routetopo:                 %p\n", routetopo);
-		fprintf(stderr,"dbg2       routebearing:              %p\n", routebearing);
-		fprintf(stderr,"dbg2       distlateral:               %p\n", distlateral);
-		fprintf(stderr,"dbg2       distovertopo:              %p\n", distovertopo);
-		fprintf(stderr,"dbg2       slope:                     %p\n", slope);
-		fprintf(stderr,"dbg2       routecolor:                %p\n", routecolor);
-		fprintf(stderr,"dbg2       routesize:                 %p\n", routesize);
-		fprintf(stderr,"dbg2       routename:                 %p\n", routename);
-		}
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* zero the points returned */
-	*npointtotal = 0;
-
-	/* check that the array pointers are not NULL */
-	if (routelon == NULL || routelat == NULL || waypoint == NULL || routetopo == NULL
-		|| distlateral == NULL || distovertopo == NULL || slope == NULL)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_DATA_NOT_INSERTED;
-		}
-
-	/* otherwise go get the route data */
-	else
-		{
-		/* loop over the route segments */
-		for (i=0;i<shared.shareddata.routes[route].npoints-1;i++)
-			{
-			/* get bearing of segment */
-			if (data->display_projection_mode != MBV_PROJECTION_SPHEROID)
-				{
-				xx1 = shared.shareddata.routes[route].points[i].xdisplay[instance];
-				yy1 = shared.shareddata.routes[route].points[i].ydisplay[instance];
-				xx2 = shared.shareddata.routes[route].points[i+1].xdisplay[instance];
-				yy2 = shared.shareddata.routes[route].points[i+1].ydisplay[instance];
-				dx = (double)(shared.shareddata.routes[route].points[i+1].xdisplay[instance]
-						- shared.shareddata.routes[route].points[i].xdisplay[instance]);
-				dy = (double)(shared.shareddata.routes[route].points[i+1].ydisplay[instance]
-						- shared.shareddata.routes[route].points[i].ydisplay[instance]);
-				dx = xx2 - xx1;
-				dy = yy2 - yy1;
-				range = sqrt(dx * dx + dy * dy) / view->scale ;
-				bearing = RTD * atan2(dx, dy);
-				}
-			else
-				{
-				mbview_greatcircle_distbearing(instance,
-					shared.shareddata.routes[route].points[i].xlon,
-					shared.shareddata.routes[route].points[i].ylat,
-					shared.shareddata.routes[route].points[i+1].xlon,
-					shared.shareddata.routes[route].points[i+1].ylat,
-					&bearing, &range);
-				}
-			if (bearing < 0.0)
-				bearing += 360.0;
-
-			/* add first point */
-			routelon[*npointtotal] = shared.shareddata.routes[route].points[i].xlon;
-			if (routelon[*npointtotal] < -180.0)
-				routelon[*npointtotal] += 360.0;
-			else if (routelon[*npointtotal] > 180.0)
-				routelon[*npointtotal] -= 360.0;
-			routelat[*npointtotal] = shared.shareddata.routes[route].points[i].ylat ;
-			waypoint[*npointtotal] = shared.shareddata.routes[route].waypoint[i];
-			routetopo[*npointtotal] = shared.shareddata.routes[route].points[i].zdata;
-			routebearing[*npointtotal] = bearing;
-			if (*npointtotal == 0)
-				{
-				distlateral[*npointtotal] = 0.0;
-				distovertopo[*npointtotal] = 0.0;
-				slope[*npointtotal] = 0.0;
-				}
-			else
-				{
-				mbview_projectdistance(instance,
-					routelon[*npointtotal-1], routelat[*npointtotal-1], routetopo[*npointtotal-1],
-					routelon[*npointtotal], routelat[*npointtotal], routetopo[*npointtotal],
-					&distlateral[*npointtotal],
-					&distovertopo[*npointtotal],
-					&slope[*npointtotal]);
-				distlateral[*npointtotal] += distlateral[*npointtotal-1];
-				distovertopo[*npointtotal] += distovertopo[*npointtotal-1];
-				}
-			(*npointtotal)++;
-
-			/* loop over interior of segment */
-			for (j=1;j<shared.shareddata.routes[route].segments[i].nls-1;j++)
-				{
-				routelon[*npointtotal] = shared.shareddata.routes[route].segments[i].lspoints[j].xlon;
-				if (routelon[*npointtotal] < -180.0)
-					routelon[*npointtotal] += 360.0;
-				else if (routelon[*npointtotal] > 180.0)
-					routelon[*npointtotal] -= 360.0;
-				routelat[*npointtotal] = shared.shareddata.routes[route].segments[i].lspoints[j].ylat;
-				waypoint[*npointtotal] = MBV_ROUTE_WAYPOINT_NONE;
-				routetopo[*npointtotal] = shared.shareddata.routes[route].segments[i].lspoints[j].zdata;
-				routebearing[*npointtotal] = bearing;
-				mbview_projectdistance(instance,
-					routelon[*npointtotal-1], routelat[*npointtotal-1], routetopo[*npointtotal-1],
-					routelon[*npointtotal], routelat[*npointtotal], routetopo[*npointtotal],
-					&distlateral[*npointtotal],
-					&distovertopo[*npointtotal],
-					&slope[*npointtotal]);
-				distlateral[*npointtotal] += distlateral[*npointtotal-1];
-				distovertopo[*npointtotal] += distovertopo[*npointtotal-1];
-				(*npointtotal)++;
-				}
-			}
-
-		/* add last point */
-		j = shared.shareddata.routes[route].npoints - 1;
-		routelon[*npointtotal] = shared.shareddata.routes[route].points[j].xlon;
-		if (routelon[*npointtotal] < -180.0)
-			routelon[*npointtotal] += 360.0;
-		else if (routelon[*npointtotal] > 180.0)
-			routelon[*npointtotal] -= 360.0;
-		routelat[*npointtotal] = shared.shareddata.routes[route].points[j].ylat ;
-		waypoint[*npointtotal] = shared.shareddata.routes[route].waypoint[j];;
-		routetopo[*npointtotal] = shared.shareddata.routes[route].points[j].zdata;
-		routebearing[*npointtotal] = bearing;
-		mbview_projectdistance(instance,
-			routelon[*npointtotal-1], routelat[*npointtotal-1], routetopo[*npointtotal-1],
-			routelon[*npointtotal], routelat[*npointtotal], routetopo[*npointtotal],
-			&distlateral[*npointtotal],
-			&distovertopo[*npointtotal],
-			&slope[*npointtotal]);
-		distlateral[*npointtotal] += distlateral[*npointtotal-1];
-		distovertopo[*npointtotal] += distovertopo[*npointtotal-1];
-		(*npointtotal)++;
-
-		/* get color size and name */
-		*routecolor = shared.shareddata.routes[route].color;
-		*routesize = shared.shareddata.routes[route].size;
-		strcpy(routename, shared.shareddata.routes[route].name);
-
-		/* recalculate slope */
-		for (j=0;j<*npointtotal;j++)
-			{
-			if (j == 0 && *npointtotal == 1)
-				{
-				slope[j] = 0.0;
-				}
-			else if (j == 0)
-				{
-				if (distlateral[j+1] > 0.0)
-					slope[j] = (routetopo[j+1] - routetopo[j]) / distlateral[j+1];
-				else
-					slope[j] = 0.0;
-				}
-			else if (j == *npointtotal - 1)
-				{
-				if ((distlateral[j] - distlateral[j-1]) > 0.0)
-					slope[j] = (routetopo[j] - routetopo[j-1])
-							/ (distlateral[j] - distlateral[j-1]);
-				else
-					slope[j] = 0.0;
-				}
-			else
-				{
-				if ((distlateral[j+1] - distlateral[j-1]) > 0.0)
-					slope[j] = (routetopo[j+1] - routetopo[j-1])
-							/ (distlateral[j+1] - distlateral[j-1]);
-				else
-					slope[j] = 0.0;
-				}
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       npointtotal:               %d\n", *npointtotal);
-		fprintf(stderr,"dbg2       routecolor:                %d\n", *routecolor);
-		fprintf(stderr,"dbg2       routesize:                 %d\n", *routesize);
-		fprintf(stderr,"dbg2       routename:                 %s\n", routename);
-		for (i=0;i<*npointtotal;i++)
-			{
-			fprintf(stderr,"dbg2       route:%d lon:%f lat:%f waypoint:%d topo:%f bearing:%f dist:%f distbot:%f color:%d size:%d name:%s\n",
-					i, routelon[i], routelat[i], waypoint[i], routetopo[i],
-					routebearing[i], distlateral[i], distovertopo[i],
-					*routecolor, *routesize, routename);
-			}
-		fprintf(stderr,"dbg2       error:                     %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:                    %d\n",status);
-		}
-
-	/* return */
-	return(status);
-
-}
-
-/*------------------------------------------------------------------------------*/
-int mbview_enableviewroutes(int verbose, size_t instance,
-			int *error)
-
-{
-	/* local variables */
-	char	*function_name = "mbview_enableviewroutes";
-	int	status = MB_SUCCESS;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-
-	/* print starting debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:                   %d\n", verbose);
-		fprintf(stderr,"dbg2       instance:                  %zu\n", instance);
-		}
-
-	/* set values */
-        shared.shareddata.route_mode = MBV_ROUTE_VIEW;
-
-	/* set widget sensitivity on all active instances */
-	for (instance=0;instance<MBV_MAX_WINDOWS;instance++)
-		{
-		/* get view */
-		view = &(mbviews[instance]);
-		data = &(view->data);
-
-		/* if instance active reset action sensitivity */
-		if (data->active == MB_YES)
-			mbview_update_sensitivity(verbose, instance, error);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:                     %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:                    %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-
-/*------------------------------------------------------------------------------*/
-int mbview_enableeditroutes(int verbose, size_t instance,
-			int *error)
-
-{
-	/* local variables */
-	char	*function_name = "mbview_enableeditroutes";
-	int	status = MB_SUCCESS;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-
-	/* print starting debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:                   %d\n", verbose);
-		fprintf(stderr,"dbg2       instance:                  %zu\n", instance);
-		}
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* set values */
-        shared.shareddata.route_mode = MBV_ROUTE_EDIT;
-
-	/* set widget sensitivity */
-	if (data->active == MB_YES)
-		mbview_update_sensitivity(verbose, instance, error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:                     %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:                    %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-/*------------------------------------------------------------------------------*/
-int mbview_pick_route_select(size_t instance, int which, int xpixel, int ypixel)
-{
-
-	/* local variables */
-	char	*function_name = "mbview_pick_route_select";
-	int	status = MB_SUCCESS;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-	int	found;
-	double	xgrid, ygrid;
-	double	xlon, ylat, zdata;
-	double	xdisplay, ydisplay, zdisplay;
-	double	xx, yy, rr, rrmin;
-	int	iroute;
-	int	jpoint;
-	int	i, j;
-
-	/* print starting debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       instance:         %zu\n",instance);
-		fprintf(stderr,"dbg2       which:            %d\n",which);
-		fprintf(stderr,"dbg2       xpixel:           %d\n",xpixel);
-		fprintf(stderr,"dbg2       ypixel:           %d\n",ypixel);
-		}
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* only select route points if enabled and not in move mode */
-	if (shared.shareddata.route_mode != MBV_ROUTE_OFF
-		&& shared.shareddata.nroute > 0
-		&& (which == MBV_PICK_DOWN
-			|| shared.shareddata.route_selected == MBV_SELECT_NONE))
-		{
-		/* look for point */
-		mbview_findpoint(instance, xpixel, ypixel,
-				&found,
-				&xgrid, &ygrid,
-				&xlon, &ylat, &zdata,
-				&xdisplay, &ydisplay, &zdisplay);
-
-		/* look for nearest route point */
-		if (found)
-			{
-			rrmin = 1000000000.0;
-			shared.shareddata.route_selected = MBV_SELECT_NONE;
-			shared.shareddata.route_point_selected = MBV_SELECT_NONE;
-			for (i=0;i<shared.shareddata.nroute;i++)
-			for (j=0;j<shared.shareddata.routes[i].npoints;j++)
-				{
-				xx = xgrid - shared.shareddata.routes[i].points[j].xgrid[instance];
-				yy = ygrid - shared.shareddata.routes[i].points[j].ygrid[instance];
-				rr = sqrt(xx * xx + yy * yy);
-				if (rr < rrmin)
-					{
-					rrmin = rr;
-					shared.shareddata.route_selected = i;
-					shared.shareddata.route_point_selected = j;
-					}
-				}
-			}
-		else
-			{
-			shared.shareddata.route_selected = MBV_SELECT_NONE;
-			XBell(view->dpy,100);
-			}
-		}
-
-	/* only move selected route points if enabled */
-	else if (shared.shareddata.route_mode != MBV_ROUTE_OFF
-		&& shared.shareddata.nroute > 0
-		&& (which == MBV_PICK_MOVE
-			&& shared.shareddata.route_selected != MBV_SELECT_NONE))
-		{
-		/* look for point */
-		mbview_findpoint(instance, xpixel, ypixel,
-				&found,
-				&xgrid, &ygrid,
-				&xlon, &ylat, &zdata,
-				&xdisplay, &ydisplay, &zdisplay);
-
-		/* reset selected route position */
-		iroute = shared.shareddata.route_selected;
-		if (found && shared.shareddata.routes[iroute].editmode == MB_YES)
-			{
-			jpoint = shared.shareddata.route_point_selected;
-			shared.shareddata.routes[iroute].points[jpoint].xgrid[instance] = xgrid;
-			shared.shareddata.routes[iroute].points[jpoint].ygrid[instance] = ygrid;
-			shared.shareddata.routes[iroute].points[jpoint].xlon = xlon;
-			shared.shareddata.routes[iroute].points[jpoint].ylat = ylat;
-			shared.shareddata.routes[iroute].points[jpoint].zdata = zdata;
-			shared.shareddata.routes[iroute].points[jpoint].xdisplay[instance] = xdisplay;
-			shared.shareddata.routes[iroute].points[jpoint].ydisplay[instance] = ydisplay;
-			shared.shareddata.routes[iroute].points[jpoint].zdisplay[instance] = zdisplay;
-			mbview_updatepointw(instance, &(shared.shareddata.routes[iroute].points[jpoint]));
-fprintf(stderr,"mbview_pick_route_select: Point Select Move: iroute:%d jpoint:%d of %d\n",
-iroute,jpoint,shared.shareddata.routes[iroute].npoints);
-
-			/* drape the affected segments */
-			if (jpoint > 0)
-				{
-				/* drape the segment */
-				shared.shareddata.routes[iroute].segments[jpoint-1].endpoints[1] = shared.shareddata.routes[iroute].points[jpoint];
-				mbview_drapesegmentw(instance, &(shared.shareddata.routes[iroute].segments[jpoint-1]));
-
-				/* update the segment for all active instances */
-				mbview_updatesegmentw(instance, &(shared.shareddata.routes[iroute].segments[jpoint-1]));
-				}
-			if (jpoint < shared.shareddata.routes[iroute].npoints - 1)
-				{
-				/* drape the segment */
-				shared.shareddata.routes[iroute].segments[jpoint].endpoints[0] = shared.shareddata.routes[iroute].points[jpoint];
-				mbview_drapesegmentw(instance, &(shared.shareddata.routes[iroute].segments[jpoint]));
-
-				/* update the segment for all active instances */
-				mbview_updatesegmentw(instance, &(shared.shareddata.routes[iroute].segments[jpoint]));
-				}
-
-			/* set distance values */
-			mbview_route_setdistance(instance, iroute);
-			}
-
-		/* else beep */
-		else
-			{
-			shared.shareddata.route_selected = MBV_SELECT_NONE;
-			XBell(view->dpy,100);
-			}
-		}
-
-	/* else beep */
-	else
-		{
-		shared.shareddata.route_selected = MBV_SELECT_NONE;
-		XBell(view->dpy,100);
-		}
-
-	/* set what kind of pick to annotate */
-	if (shared.shareddata.route_selected != MBV_SELECT_NONE)
-		{
-		data->pickinfo_mode = MBV_PICK_ROUTE;
-		}
-	else
-		{
-		data->pickinfo_mode = data->pick_type;
-		}
-
-	/* set pick annotation */
-	mbview_pick_text(instance);
-
-	/* update route list */
-	mbview_updateroutelist();
-
-	/* call pick notify if defined */
-	if (which == MBV_PICK_UP && shared.shareddata.route_selected != MBV_SELECT_NONE
-		&& data->mbview_pickroute_notify != NULL)
-		{
-		(data->mbview_pickroute_notify)(instance);
-		}
-
-	/* print route debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  Route data altered in function <%s>\n",
-			function_name);
-		fprintf(stderr,"dbg2  Route values:\n");
-		fprintf(stderr,"dbg2       route_view_mode:      %d\n",data->route_view_mode);
-		fprintf(stderr,"dbg2       route_mode:           %d\n",shared.shareddata.route_mode);
-		fprintf(stderr,"dbg2       nroute:               %d\n",shared.shareddata.nroute);
-		fprintf(stderr,"dbg2       nroute_alloc:         %d\n",shared.shareddata.nroute_alloc);
-		fprintf(stderr,"dbg2       route_selected:       %d\n",shared.shareddata.route_selected);
-		fprintf(stderr,"dbg2       route_point_selected: %d\n",shared.shareddata.route_point_selected);
-		for (i=0;i<shared.shareddata.nroute;i++)
-			{
-			fprintf(stderr,"dbg2       route %d color:         %d\n",i,shared.shareddata.routes[i].color);
-			fprintf(stderr,"dbg2       route %d size:          %d\n",i,shared.shareddata.routes[i].size);
-			fprintf(stderr,"dbg2       route %d name:          %s\n",i,shared.shareddata.routes[i].name);
-			fprintf(stderr,"dbg2       route %d npoints:       %d\n",i,shared.shareddata.routes[i].npoints);
-			fprintf(stderr,"dbg2       route %d npoints_alloc: %d\n",i,shared.shareddata.routes[i].npoints_alloc);
-			for (j=0;j<shared.shareddata.routes[i].npoints;j++)
-				{
-				fprintf(stderr,"dbg2       route %d %d waypoint: %d\n",i,j,shared.shareddata.routes[i].waypoint[j]);
-				fprintf(stderr,"dbg2       route %d %d xgrid:    %f\n",i,j,shared.shareddata.routes[i].points[j].xgrid[instance]);
-				fprintf(stderr,"dbg2       route %d %d ygrid:    %f\n",i,j,shared.shareddata.routes[i].points[j].ygrid[instance]);
-				fprintf(stderr,"dbg2       route %d %d xlon:     %f\n",i,j,shared.shareddata.routes[i].points[j].xlon);
-				fprintf(stderr,"dbg2       route %d %d ylat:     %f\n",i,j,shared.shareddata.routes[i].points[j].ylat);
-				fprintf(stderr,"dbg2       route %d %d zdata:    %f\n",i,j,shared.shareddata.routes[i].points[j].zdata);
-				fprintf(stderr,"dbg2       route %d %d xdisplay: %f\n",i,j,shared.shareddata.routes[i].points[j].xdisplay[instance]);
-				fprintf(stderr,"dbg2       route %d %d ydisplay: %f\n",i,j,shared.shareddata.routes[i].points[j].ydisplay[instance]);
-				fprintf(stderr,"dbg2       route %d %d zdisplay: %f\n",i,j,shared.shareddata.routes[i].points[j].zdisplay[instance]);
-				}
-			for (j=0;j<shared.shareddata.routes[i].npoints-1;j++)
-				{
-				fprintf(stderr,"dbg2       route %d %d nls:          %d\n",i,j,shared.shareddata.routes[i].segments[j].nls);
-				fprintf(stderr,"dbg2       route %d %d nls_alloc:    %d\n",i,j,shared.shareddata.routes[i].segments[j].nls_alloc);
-				fprintf(stderr,"dbg2       route %d %d endpoints[0]: %p\n",i,j,&shared.shareddata.routes[i].segments[j].endpoints[0]);
-				fprintf(stderr,"dbg2       route %d %d endpoints[1]: %p\n",i,j,&shared.shareddata.routes[i].segments[j].endpoints[1]);
-				}
-			}
-		}
-
-	/* print output debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:          %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-
-/*------------------------------------------------------------------------------*/
-int mbview_extract_route_profile(size_t instance)
-{
-
-	/* local variables */
-	char	*function_name = "mbview_extract_route_profile";
-	int	status = MB_SUCCESS;
-	int	error = MB_ERROR_NO_ERROR;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-	int	iroute, jstart;
-	int	nprpoints;
-	double	dx, dy;
-	int	i, j;
-
-	/* print starting debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       instance:         %zu\n",instance);
-		}
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* if a route is selected, extract the profile */
-	if (shared.shareddata.route_selected != MBV_SELECT_NONE
-		&& shared.shareddata.routes[shared.shareddata.route_selected].npoints > 1)
-		{
-		data->profile.source = MBV_PROFILE_ROUTE;
-		strcpy(data->profile.source_name, "Route");
-		data->profile.length = 0.0;
-		iroute = shared.shareddata.route_selected;
-
-		/* make sure enough memory is allocated for the profile */
-		nprpoints = 0;
-		for (i=0;i<shared.shareddata.routes[iroute].npoints-1;i++)
-			{
-			nprpoints += shared.shareddata.routes[iroute].segments[i].nls;
-			}
-		if (data->profile.npoints_alloc < nprpoints)
-			{
-			status = mbview_allocprofilepoints(mbv_verbose,
-					nprpoints, &(data->profile.points), &error);
-			if (status == MB_SUCCESS)
-				{
-				data->profile.npoints_alloc = nprpoints;
-				}
-			else
-				{
-				data->profile.npoints_alloc = 0;
-				}
-			}
-
-		/* extract the profile */
-		if (nprpoints > 2 && data->profile.npoints_alloc >= nprpoints)
-			{
-			data->profile.npoints = 0;
-			for (i=0;i<shared.shareddata.routes[iroute].npoints-1;i++)
-				{
-				if (i == 0)
-					jstart = 0;
-				else
-					jstart = 1;
-				for (j=jstart;j<shared.shareddata.routes[iroute].segments[i].nls;j++)
-					{
-					if (j == 0 || j == shared.shareddata.routes[iroute].segments[i].nls - 1)
-						data->profile.points[data->profile.npoints].boundary = MB_YES;
-					else
-						data->profile.points[data->profile.npoints].boundary = MB_NO;
-					data->profile.points[data->profile.npoints].xgrid = shared.shareddata.routes[iroute].segments[i].lspoints[j].xgrid[instance];
-					data->profile.points[data->profile.npoints].ygrid = shared.shareddata.routes[iroute].segments[i].lspoints[j].ygrid[instance];
-					data->profile.points[data->profile.npoints].xlon = shared.shareddata.routes[iroute].segments[i].lspoints[j].xlon;
-					data->profile.points[data->profile.npoints].ylat = shared.shareddata.routes[iroute].segments[i].lspoints[j].ylat;
-					data->profile.points[data->profile.npoints].zdata = shared.shareddata.routes[iroute].segments[i].lspoints[j].zdata;
-					data->profile.points[data->profile.npoints].xdisplay = shared.shareddata.routes[iroute].segments[i].lspoints[j].xdisplay[instance];
-					data->profile.points[data->profile.npoints].ydisplay = shared.shareddata.routes[iroute].segments[i].lspoints[j].ydisplay[instance];
-					if (data->profile.npoints == 0)
-						{
-						data->profile.zmin = data->profile.points[data->profile.npoints].zdata;
-						data->profile.zmax = data->profile.points[data->profile.npoints].zdata;
-						data->profile.points[data->profile.npoints].distance = 0.0;
-						data->profile.points[data->profile.npoints].distovertopo = 0.0;
-						data->profile.points[data->profile.npoints].bearing = 0.0;
-						}
-					else
-						{
-						data->profile.zmin = MIN(data->profile.zmin, data->profile.points[data->profile.npoints].zdata);
-						data->profile.zmax = MAX(data->profile.zmax, data->profile.points[data->profile.npoints].zdata);
-						if (data->display_projection_mode != MBV_PROJECTION_SPHEROID)
-							{
-							dx = data->profile.points[data->profile.npoints].xdisplay
-									- data->profile.points[data->profile.npoints-1].xdisplay;
-							dy = data->profile.points[data->profile.npoints].ydisplay
-									- data->profile.points[data->profile.npoints-1].ydisplay;
-							data->profile.points[data->profile.npoints].distance = sqrt(dx * dx + dy * dy) / view->scale
-								+ data->profile.points[data->profile.npoints-1].distance;
-							data->profile.points[data->profile.npoints].bearing = RTD * atan2(dx, dy);
-							}
-						else
-							{
-							mbview_greatcircle_distbearing(instance,
-								data->profile.points[data->profile.npoints-1].xlon,
-								data->profile.points[data->profile.npoints-1].ylat,
-								data->profile.points[data->profile.npoints].xlon,
-								data->profile.points[data->profile.npoints].ylat,
-								&(data->profile.points[data->profile.npoints].bearing),
-								&(data->profile.points[data->profile.npoints].distance));
-							mbview_greatcircle_dist(instance,
-								data->profile.points[0].xlon,
-								data->profile.points[0].ylat,
-								data->profile.points[data->profile.npoints].xlon,
-								data->profile.points[data->profile.npoints].ylat,
-								&(data->profile.points[data->profile.npoints].distance));
-							}
-						dy = (data->profile.points[data->profile.npoints].zdata
-							- data->profile.points[data->profile.npoints-1].zdata);
-						dx = (data->profile.points[data->profile.npoints].distance
-							- data->profile.points[data->profile.npoints-1].distance);
-						data->profile.points[data->profile.npoints].distovertopo
-							= data->profile.points[data->profile.npoints-1].distovertopo
-											+ sqrt(dy * dy + dx * dx);
-						if (dx > 0.0)
-							data->profile.points[data->profile.npoints].slope = fabs(dy / dx);
-						else
-							data->profile.points[data->profile.npoints].slope = 0.0;
-						}
-					if (data->profile.points[data->profile.npoints].bearing < 0.0)
-						data->profile.points[data->profile.npoints].bearing += 360.0;
-					if (data->profile.npoints == 1)
-						data->profile.points[0].bearing = data->profile.points[data->profile.npoints].bearing;
-					if (data->profile.npoints > 1)
-						{
-						dy = (data->profile.points[data->profile.npoints].zdata
-							- data->profile.points[data->profile.npoints-2].zdata);
-						dx = (data->profile.points[data->profile.npoints].distance
-							- data->profile.points[data->profile.npoints-2].distance);
-						if (dx > 0.0)
-							data->profile.points[data->profile.npoints-1].slope = fabs(dy / dx);
-						else
-							data->profile.points[data->profile.npoints-1].slope = 0.0;
-						}
-					data->profile.points[data->profile.npoints].navzdata = 0.0;
-					data->profile.points[data->profile.npoints].navtime_d = 0.0;
-					data->profile.npoints++;
-					}
-				}
-			data->profile.length = data->profile.points[data->profile.npoints-1].distance;
-			}
-		}
-
-	/* print output debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:          %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-
-
-/*------------------------------------------------------------------------------*/
-int mbview_pick_route_add(size_t instance, int which, int xpixel, int ypixel)
-{
-
-	/* local variables */
-	char	*function_name = "mbview_pick_route_add";
-	int	status = MB_SUCCESS;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-	int	found;
-	double	xgrid, ygrid;
-	double	xlon, ylat, zdata;
-	double	xdisplay, ydisplay, zdisplay;
-	int	i, j, inew, jnew;
-
-	/* print starting debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       instance:         %zu\n",instance);
-		fprintf(stderr,"dbg2       which:            %d\n",which);
-		fprintf(stderr,"dbg2       xpixel:           %d\n",xpixel);
-		fprintf(stderr,"dbg2       ypixel:           %d\n",ypixel);
-		}
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* only add route points if enabled and not in move mode */
-	if (shared.shareddata.route_mode == MBV_ROUTE_EDIT
-		&& (which == MBV_PICK_DOWN
-			|| (which == MBV_PICK_MOVE
-				&& shared.shareddata.route_selected == MBV_SELECT_NONE)))
-		{
-		/* look for point */
-		mbview_findpoint(instance, xpixel, ypixel,
-				&found,
-				&xgrid, &ygrid,
-				&xlon, &ylat, &zdata,
-				&xdisplay, &ydisplay, &zdisplay);
-
-		/* add route if necessary */
-		if (found && shared.shareddata.route_selected == MBV_SELECT_NONE)
-			{
-			/* add route point after currently selected route point if any */
-			inew = shared.shareddata.nroute;
-			jnew = 0;
-
-			/* add the route point */
-			mbview_route_add(instance, inew, jnew, MBV_ROUTE_WAYPOINT_SIMPLE,
-				xgrid, ygrid,
-				xlon, ylat, zdata,
-				xdisplay, ydisplay, zdisplay);
-
-			/* select the new route */
-			shared.shareddata.route_selected = inew;
-			shared.shareddata.route_point_selected = jnew;
-			}
-
-		/* else just add point to currently selected route and point */
-		else if (found && shared.shareddata.route_selected != MBV_SELECT_NONE
-				&& shared.shareddata.routes[shared.shareddata.route_selected].editmode == MB_YES)
-			{
-			/* add route point after currently selected route point if any */
-			inew = shared.shareddata.route_selected;
-			jnew = shared.shareddata.route_point_selected + 1;
-
-			/* add the route point */
-			mbview_route_add(instance, inew, jnew, MBV_ROUTE_WAYPOINT_SIMPLE,
-				xgrid, ygrid,
-				xlon, ylat, zdata,
-				xdisplay, ydisplay, zdisplay);
-
-
-			/* select the new route */
-			shared.shareddata.route_selected = inew;
-			shared.shareddata.route_point_selected = jnew;
-			}
-
-		/* if selected route not editable then complain */
-		else if (found)
-			{
-			XBell(view->dpy,100);
-			}
-			
-		/* if not found then deselect the new route */
-		else
-			{
-			shared.shareddata.route_selected = MBV_SELECT_NONE;
-			shared.shareddata.route_point_selected = MBV_SELECT_NONE;
-			XBell(view->dpy,100);
-			}
-		}
-
-	/* only move selected routes if enabled */
-	else if (shared.shareddata.route_mode != MBV_ROUTE_OFF
-		&& shared.shareddata.nroute > 0
-		&& (which == MBV_PICK_MOVE
-			&& shared.shareddata.route_selected != MBV_SELECT_NONE))
-		{
-		/* look for point */
-		mbview_findpoint(instance, xpixel, ypixel,
-				&found,
-				&xgrid, &ygrid,
-				&xlon, &ylat, &zdata,
-				&xdisplay, &ydisplay, &zdisplay);
-
-		/* reset selected route position */
-		if (found)
-			{
-			/* move the point */
-			shared.shareddata.routes[shared.shareddata.route_selected].points[shared.shareddata.route_point_selected].xgrid[instance] = xgrid;
-			shared.shareddata.routes[shared.shareddata.route_selected].points[shared.shareddata.route_point_selected].ygrid[instance] = ygrid;
-			shared.shareddata.routes[shared.shareddata.route_selected].points[shared.shareddata.route_point_selected].xlon = xlon;
-			shared.shareddata.routes[shared.shareddata.route_selected].points[shared.shareddata.route_point_selected].ylat = ylat;
-			shared.shareddata.routes[shared.shareddata.route_selected].points[shared.shareddata.route_point_selected].zdata = zdata;
-			shared.shareddata.routes[shared.shareddata.route_selected].points[shared.shareddata.route_point_selected].xdisplay[instance] = xdisplay;
-			shared.shareddata.routes[shared.shareddata.route_selected].points[shared.shareddata.route_point_selected].ydisplay[instance] = ydisplay;
-			shared.shareddata.routes[shared.shareddata.route_selected].points[shared.shareddata.route_point_selected].zdisplay[instance] = zdisplay;
-			mbview_updatepointw(instance, &(shared.shareddata.routes[shared.shareddata.route_selected].points[shared.shareddata.route_point_selected]));
-
-			/* drape the affected segments */
-			if (shared.shareddata.route_point_selected > 0)
-				{
-				/* drape the segment */
-				shared.shareddata.routes[shared.shareddata.route_selected].segments[shared.shareddata.route_point_selected-1].endpoints[1]
-					= shared.shareddata.routes[shared.shareddata.route_selected].points[shared.shareddata.route_point_selected];
-				mbview_drapesegmentw(instance,
-					&(shared.shareddata.routes[shared.shareddata.route_selected].segments[shared.shareddata.route_point_selected-1]));
-
-				/* update the segment for all active instances */
-				mbview_updatesegmentw(instance, &(shared.shareddata.routes[shared.shareddata.route_selected].segments[shared.shareddata.route_point_selected-1]));
-				}
-			if (shared.shareddata.route_point_selected < shared.shareddata.routes[shared.shareddata.route_selected].npoints - 1)
-				{
-				/* drape the segment */
-				shared.shareddata.routes[shared.shareddata.route_selected].segments[shared.shareddata.route_point_selected].endpoints[0]
-					= shared.shareddata.routes[shared.shareddata.route_selected].points[shared.shareddata.route_point_selected];
-				mbview_drapesegmentw(instance,
-					&(shared.shareddata.routes[shared.shareddata.route_selected].segments[shared.shareddata.route_point_selected]));
-
-				/* update the segment for all active instances */
-				mbview_updatesegmentw(instance, &(shared.shareddata.routes[shared.shareddata.route_selected].segments[shared.shareddata.route_point_selected]));
-				}
-
-			/* set distance values */
-			mbview_route_setdistance(instance, shared.shareddata.route_selected);
-			}
-		}
-
-	/* else beep */
-	else
-		{
-		shared.shareddata.route_selected = MBV_SELECT_NONE;
-		shared.shareddata.route_point_selected = MBV_SELECT_NONE;
-		XBell(view->dpy,100);
-		}
-
-	/* set what kind of pick to annotate */
-	if (shared.shareddata.route_selected != MBV_SELECT_NONE)
-		{
-		data->pickinfo_mode = MBV_PICK_ROUTE;
-		}
-	else
-		{
-		data->pickinfo_mode = data->pick_type;
-		}
-
-	/* set pick annotation */
-	mbview_pick_text(instance);
-
-	/* update route list */
-	mbview_updateroutelist();
-
-	/* print route debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  Route data altered in function <%s>\n",
-			function_name);
-		fprintf(stderr,"dbg2  Route values:\n");
-		fprintf(stderr,"dbg2       route_view_mode:      %d\n",data->route_view_mode);
-		fprintf(stderr,"dbg2       route_mode:           %d\n",shared.shareddata.route_mode);
-		fprintf(stderr,"dbg2       nroute:               %d\n",shared.shareddata.nroute);
-		fprintf(stderr,"dbg2       nroute_alloc:         %d\n",shared.shareddata.nroute_alloc);
-		fprintf(stderr,"dbg2       route_selected:       %d\n",shared.shareddata.route_selected);
-		fprintf(stderr,"dbg2       route_point_selected: %d\n",shared.shareddata.route_point_selected);
-		for (i=0;i<shared.shareddata.nroute;i++)
-			{
-			fprintf(stderr,"dbg2       route %d color:         %d\n",i,shared.shareddata.routes[i].color);
-			fprintf(stderr,"dbg2       route %d size:          %d\n",i,shared.shareddata.routes[i].size);
-			fprintf(stderr,"dbg2       route %d name:          %s\n",i,shared.shareddata.routes[i].name);
-			fprintf(stderr,"dbg2       route %d npoints:       %d\n",i,shared.shareddata.routes[i].npoints);
-			fprintf(stderr,"dbg2       route %d npoints_alloc: %d\n",i,shared.shareddata.routes[i].npoints_alloc);
-			for (j=0;j<shared.shareddata.routes[i].npoints;j++)
-				{
-				fprintf(stderr,"dbg2       route %d %d xgrid:    %f\n",i,j,shared.shareddata.routes[i].points[j].xgrid[instance]);
-				fprintf(stderr,"dbg2       route %d %d ygrid:    %f\n",i,j,shared.shareddata.routes[i].points[j].ygrid[instance]);
-				fprintf(stderr,"dbg2       route %d %d xlon:     %f\n",i,j,shared.shareddata.routes[i].points[j].xlon);
-				fprintf(stderr,"dbg2       route %d %d ylat:     %f\n",i,j,shared.shareddata.routes[i].points[j].ylat);
-				fprintf(stderr,"dbg2       route %d %d zdata:    %f\n",i,j,shared.shareddata.routes[i].points[j].zdata);
-				fprintf(stderr,"dbg2       route %d %d xdisplay: %f\n",i,j,shared.shareddata.routes[i].points[j].xdisplay[instance]);
-				fprintf(stderr,"dbg2       route %d %d ydisplay: %f\n",i,j,shared.shareddata.routes[i].points[j].ydisplay[instance]);
-				fprintf(stderr,"dbg2       route %d %d zdisplay: %f\n",i,j,shared.shareddata.routes[i].points[j].zdisplay[instance]);
-				}
-			for (j=0;j<shared.shareddata.routes[i].npoints-1;j++)
-				{
-				fprintf(stderr,"dbg2       route %d %d nls:          %d\n",i,j,shared.shareddata.routes[i].segments[j].nls);
-				fprintf(stderr,"dbg2       route %d %d nls_alloc:    %d\n",i,j,shared.shareddata.routes[i].segments[j].nls_alloc);
-				fprintf(stderr,"dbg2       route %d %d endpoints[0]: %p\n",i,j,&shared.shareddata.routes[i].segments[j].endpoints[0]);
-				fprintf(stderr,"dbg2       route %d %d endpoints[1]: %p\n",i,j,&shared.shareddata.routes[i].segments[j].endpoints[1]);
-				}
-			}
-		}
-
-	/* print output debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:          %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-
-
-/*------------------------------------------------------------------------------*/
-int mbview_pick_route_delete(size_t instance, int xpixel, int ypixel)
-{
-
-	/* local variables */
-	char	*function_name = "mbview_pick_route_delete";
-	int	status = MB_SUCCESS;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-	int	found;
-	double	xgrid, ygrid;
-	double	xlon, ylat, zdata;
-	double	xdisplay, ydisplay, zdisplay;
-	double	xx, yy, rr, rrmin;
-	int	i, j, idelete, jdelete;
-
-	/* print starting debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       instance:         %zu\n",instance);
-		fprintf(stderr,"dbg2       xpixel:           %d\n",xpixel);
-		fprintf(stderr,"dbg2       ypixel:           %d\n",ypixel);
-		}
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* only delete a selected route if enabled */
-	if (shared.shareddata.route_mode == MBV_ROUTE_EDIT
-		&& shared.shareddata.route_selected != MBV_SELECT_NONE)
-		{
-		/* look for point */
-		mbview_findpoint(instance, xpixel, ypixel,
-				&found,
-				&xgrid, &ygrid,
-				&xlon, &ylat, &zdata,
-				&xdisplay, &ydisplay, &zdisplay);
-
-		/* find closest route to pick point */
-		if (found)
-			{
-			rrmin = 1000000000.0;
-			idelete = MBV_SELECT_NONE;
-			jdelete = MBV_SELECT_NONE;
-			for (i=0;i<shared.shareddata.nroute;i++)
-				{
-				for (j=0;j<shared.shareddata.routes[i].npoints;j++)
-					{
-					xx = xgrid - shared.shareddata.routes[i].points[j].xgrid[instance];
-					yy = ygrid - shared.shareddata.routes[i].points[j].ygrid[instance];
-					rr = sqrt(xx * xx + yy * yy);
-					if (rr < rrmin)
-						{
-						rrmin = rr;
-						idelete = i;
-						jdelete = j;
-						}
-					}
-				}
-			}
-
-		/* delete route point if its the same as previously selected */
-		if (found && shared.shareddata.route_selected == idelete
-			&& shared.shareddata.route_point_selected == jdelete)
-			{
-			mbview_route_delete(instance, idelete, jdelete);
-			}
-
-		/* else beep */
-		else
-			{
-			XBell(view->dpy,100);
-			}
-		}
-
-	/* else beep */
-	else
-		{
-		XBell(view->dpy,100);
-		}
-
-	/* set pick annotation */
-	mbview_pick_text(instance);
-
-	/* update route list */
-	mbview_updateroutelist();
-
-	/* print output debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:          %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-/*------------------------------------------------------------------------------*/
-int mbview_route_add(size_t instance, int inew, int jnew, int waypoint,
-				double xgrid, double ygrid,
-				double xlon, double ylat, double zdata,
-				double xdisplay, double ydisplay, double zdisplay)
-{
-
-	/* local variables */
-	char	*function_name = "mbview_route_add";
-	int	status = MB_SUCCESS;
-	int	error = MB_ERROR_NO_ERROR;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-	struct mbview_linesegmentw_struct *seg;
-	int	i, j, k;
-
-	/* print starting debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       instance:         %zu\n",instance);
-		fprintf(stderr,"dbg2       inew:             %d\n",inew);
-		fprintf(stderr,"dbg2       jnew:             %d\n",jnew);
-		fprintf(stderr,"dbg2       waypoint:         %d\n",waypoint);
-		fprintf(stderr,"dbg2       xgrid:            %f\n",xgrid);
-		fprintf(stderr,"dbg2       ygrid:            %f\n",ygrid);
-		fprintf(stderr,"dbg2       xlon:             %f\n",xlon);
-		fprintf(stderr,"dbg2       ylat:             %f\n",ylat);
-		fprintf(stderr,"dbg2       zdata:            %f\n",zdata);
-		fprintf(stderr,"dbg2       xdisplay:         %f\n",xdisplay);
-		fprintf(stderr,"dbg2       ydisplay:         %f\n",ydisplay);
-		fprintf(stderr,"dbg2       zdisplay:         %f\n",zdisplay);
-		}
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* add route if required */
-	if (inew == shared.shareddata.nroute)
-		{
-		/* allocate memory for a new route if required */
-		if (shared.shareddata.nroute_alloc < shared.shareddata.nroute + 1)
-			{
-			shared.shareddata.nroute_alloc += MBV_ALLOC_NUM;
-			status = mb_reallocd(mbv_verbose, __FILE__, __LINE__,
-			    		shared.shareddata.nroute_alloc * sizeof(struct mbview_route_struct),
-			    		(void **)&(shared.shareddata.routes), &error);
-			if (status == MB_FAILURE)
-				{
-				shared.shareddata.nroute_alloc = 0;
-				}
-			else
-				{
-				for (i=shared.shareddata.nroute;i<shared.shareddata.nroute_alloc;i++)
-					{
-					shared.shareddata.routes[i].color = MBV_COLOR_RED;
-					shared.shareddata.routes[i].size = 1;
-					shared.shareddata.routes[i].editmode = MB_YES;
-					shared.shareddata.routes[i].name[0] = '\0';
-					shared.shareddata.routes[i].npoints = 0;
-					shared.shareddata.routes[i].npoints_alloc = MBV_ALLOC_NUM;
-					shared.shareddata.routes[i].waypoint = NULL;
-					shared.shareddata.routes[i].distlateral = NULL;
-					shared.shareddata.routes[i].disttopo = NULL;
-					shared.shareddata.routes[i].points = NULL;
-					shared.shareddata.routes[i].segments = NULL;
-					status = mb_reallocd(mbv_verbose,  __FILE__, __LINE__,
-			    				shared.shareddata.routes[i].npoints_alloc * sizeof(int),
-			    				(void **)&(shared.shareddata.routes[i].waypoint), &error);
-					status = mb_reallocd(mbv_verbose,  __FILE__, __LINE__,
-			    				shared.shareddata.routes[i].npoints_alloc * sizeof(double),
-			    				(void **)&(shared.shareddata.routes[i].distlateral), &error);
-					status = mb_reallocd(mbv_verbose,  __FILE__, __LINE__,
-			    				shared.shareddata.routes[i].npoints_alloc * sizeof(double),
-			    				(void **)&(shared.shareddata.routes[i].disttopo), &error);
-					status = mb_reallocd(mbv_verbose,  __FILE__, __LINE__,
-			    				shared.shareddata.routes[i].npoints_alloc * sizeof(struct mbview_pointw_struct),
-			    				(void **)&(shared.shareddata.routes[i].points), &error);
-					status = mb_reallocd(mbv_verbose,  __FILE__, __LINE__,
-			    				shared.shareddata.routes[i].npoints_alloc * sizeof(struct mbview_linesegmentw_struct),
-			    				(void **)&(shared.shareddata.routes[i].segments), &error);
-					for (j=0;j<shared.shareddata.routes[i].npoints_alloc-1;j++)
-						{
-						shared.shareddata.routes[i].segments[j].nls = 0;
-						shared.shareddata.routes[i].segments[j].nls_alloc = 0;
-						shared.shareddata.routes[i].segments[j].lspoints = NULL;
-						shared.shareddata.routes[i].segments[j].endpoints[0] = shared.shareddata.routes[i].points[j];
-						shared.shareddata.routes[i].segments[j].endpoints[1] = shared.shareddata.routes[i].points[j+1];
-						}
-					}
-				}
-			}
-
-		/* set nroute */
-		shared.shareddata.nroute++;
-
-		/* add the new route */
-		shared.shareddata.routes[inew].color = MBV_COLOR_BLACK;
-		shared.shareddata.routes[inew].size = 1;
-		shared.shareddata.routes[inew].editmode = MB_YES;
-		sprintf(shared.shareddata.routes[inew].name, "Route:%d", shared.shareddata.nroute);
-		}
-
-	/* allocate memory for point if required */
-	if (status == MB_SUCCESS
-		&& shared.shareddata.routes[inew].npoints_alloc < shared.shareddata.routes[inew].npoints + 1)
-		{
-		shared.shareddata.routes[inew].npoints_alloc += MBV_ALLOC_NUM;
-		status = mb_reallocd(mbv_verbose,  __FILE__, __LINE__,
-			    	shared.shareddata.routes[inew].npoints_alloc * sizeof(int),
-			    	(void **)&(shared.shareddata.routes[inew].waypoint), &error);
-		status = mb_reallocd(mbv_verbose,  __FILE__, __LINE__,
-			    	shared.shareddata.routes[inew].npoints_alloc * sizeof(double),
-			    	(void **)&(shared.shareddata.routes[inew].distlateral), &error);
-		status = mb_reallocd(mbv_verbose,  __FILE__, __LINE__,
-			    	shared.shareddata.routes[inew].npoints_alloc * sizeof(double),
-			    	(void **)&(shared.shareddata.routes[inew].disttopo), &error);
-		status = mb_reallocd(mbv_verbose,  __FILE__, __LINE__,
-			    	shared.shareddata.routes[inew].npoints_alloc * sizeof(struct mbview_pointw_struct),
-			    	(void **)&(shared.shareddata.routes[inew].points), &error);
-		status = mb_reallocd(mbv_verbose,  __FILE__, __LINE__,
-			    	shared.shareddata.routes[inew].npoints_alloc * sizeof(struct mbview_linesegmentw_struct),
-			    	(void **)&(shared.shareddata.routes[inew].segments), &error);
-		if (status == MB_FAILURE)
-			{
-			shared.shareddata.routes[inew].npoints = 0;
-			shared.shareddata.routes[inew].npoints_alloc = 0;
-			}
-		}
-
-	/* add the new route point */
-fprintf(stderr,"mbview_route_add: inew:%d jnew:%d waypoint:%d editmode:%d\n",inew,jnew,waypoint,shared.shareddata.routes[inew].editmode);
-	if (status == MB_SUCCESS)
-		{
-		/* move points after jnew if necessary */
-		for (j=shared.shareddata.routes[inew].npoints;j>jnew;j--)
-			{
-			shared.shareddata.routes[inew].waypoint[j] = shared.shareddata.routes[inew].waypoint[j-1];
-			shared.shareddata.routes[inew].points[j] = shared.shareddata.routes[inew].points[j-1];
-			}
-
-		/* move segments after jnew if necessary */
-		for (j=shared.shareddata.routes[inew].npoints-1;j>jnew;j--)
-			{
-			shared.shareddata.routes[inew].segments[j] = shared.shareddata.routes[inew].segments[j-1];
-			shared.shareddata.routes[inew].segments[j].endpoints[0] = shared.shareddata.routes[inew].points[j];
-			shared.shareddata.routes[inew].segments[j].endpoints[1] = shared.shareddata.routes[inew].points[j+1];
-			}
-
-		/* add the new point */
-		shared.shareddata.routes[inew].waypoint[jnew] = waypoint;
-		shared.shareddata.routes[inew].points[jnew].xgrid[instance] = xgrid;
-		shared.shareddata.routes[inew].points[jnew].ygrid[instance] = ygrid;
-		shared.shareddata.routes[inew].points[jnew].xlon = xlon;
-		shared.shareddata.routes[inew].points[jnew].ylat = ylat;
-		shared.shareddata.routes[inew].points[jnew].zdata = zdata;
-		shared.shareddata.routes[inew].points[jnew].xdisplay[instance] = xdisplay;
-		shared.shareddata.routes[inew].points[jnew].ydisplay[instance] = ydisplay;
-		shared.shareddata.routes[inew].points[jnew].zdisplay[instance] = zdisplay;
-		mbview_updatepointw(instance, &(shared.shareddata.routes[inew].points[jnew]));
-
-		/* initialize the new segment */
-		shared.shareddata.routes[inew].segments[jnew].nls = 0;
-		shared.shareddata.routes[inew].segments[jnew].nls_alloc = 0;
-		shared.shareddata.routes[inew].segments[jnew].lspoints = NULL;
-		shared.shareddata.routes[inew].segments[jnew].endpoints[0] = shared.shareddata.routes[inew].points[jnew];
-		shared.shareddata.routes[inew].segments[jnew].endpoints[1] = shared.shareddata.routes[inew].points[jnew+1];
-		if (jnew > 0)
-			{
-			shared.shareddata.routes[inew].segments[jnew-1].endpoints[0] = shared.shareddata.routes[inew].points[jnew-1];
-			shared.shareddata.routes[inew].segments[jnew-1].endpoints[1] = shared.shareddata.routes[inew].points[jnew];
-			}
-
-		/* set npoints */
-		shared.shareddata.routes[inew].npoints++;
-
-		/* reset affected segment endpoints */
-		if (shared.shareddata.routes[inew].npoints > 0)
-			{
-			for (j=MAX(0,jnew-1);j<MIN(shared.shareddata.routes[inew].npoints-1,jnew+1);j++)
-				{
-				shared.shareddata.routes[inew].segments[j].endpoints[0] = shared.shareddata.routes[inew].points[j];
-				shared.shareddata.routes[inew].segments[j].endpoints[1] = shared.shareddata.routes[inew].points[j+1];
-
-				/* drape the segment */
-				mbview_drapesegmentw(instance, &(shared.shareddata.routes[inew].segments[j]));
-
-				/* update the segment for all active instances */
-				mbview_updatesegmentw(instance, &(shared.shareddata.routes[inew].segments[j]));
-				}
-			}
-
-		/* set distance values */
-		mbview_route_setdistance(instance, inew);
-
-		/* make routes viewable */
-		if (data->route_view_mode != MBV_VIEW_ON)
-			{
-			data->route_view_mode = MBV_VIEW_ON;
-			set_mbview_route_view_mode(instance, MBV_VIEW_ON);
-			}
-		}
-
-	/* else beep */
-	else
-		{
-		XBell(view->dpy,100);
-		}
-
-
-	/* print route debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  Route data altered in function <%s>\n",
-			function_name);
-		fprintf(stderr,"dbg2  Route values:\n");
-		fprintf(stderr,"dbg2       route_view_mode:      %d\n",data->route_view_mode);
-		fprintf(stderr,"dbg2       route_mode:           %d\n",shared.shareddata.route_mode);
-		fprintf(stderr,"dbg2       nroute:               %d\n",shared.shareddata.nroute);
-		fprintf(stderr,"dbg2       nroute_alloc:         %d\n",shared.shareddata.nroute_alloc);
-		fprintf(stderr,"dbg2       route_selected:       %d\n",shared.shareddata.route_selected);
-		fprintf(stderr,"dbg2       route_point_selected: %d\n",shared.shareddata.route_point_selected);
-		for (i=0;i<shared.shareddata.nroute;i++)
-			{
-			fprintf(stderr,"dbg2       route %d color:         %d\n",i,shared.shareddata.routes[i].color);
-			fprintf(stderr,"dbg2       route %d size:          %d\n",i,shared.shareddata.routes[i].size);
-			fprintf(stderr,"dbg2       route %d name:          %s\n",i,shared.shareddata.routes[i].name);
-			fprintf(stderr,"dbg2       route %d npoints:       %d\n",i,shared.shareddata.routes[i].npoints);
-			fprintf(stderr,"dbg2       route %d npoints_alloc: %d\n",i,shared.shareddata.routes[i].npoints_alloc);
-			fprintf(stderr,"dbg2       route points: iroute jpoint xgrid[instance] ygrid[instance] xlon ylat zdata xdisplay[instance] ydisplay[instance] zdisplay[instance]\n");
-			for (j=0;j<shared.shareddata.routes[i].npoints;j++)
-				{
-				fprintf(stderr,"dbg2       %d %d %f %f %f %f %f %f %f %f\n",
-					i,j,shared.shareddata.routes[i].points[j].xgrid[instance],
-					shared.shareddata.routes[i].points[j].ygrid[instance],
-					shared.shareddata.routes[i].points[j].xlon,
-					shared.shareddata.routes[i].points[j].ylat,
-					shared.shareddata.routes[i].points[j].zdata,
-					shared.shareddata.routes[i].points[j].xdisplay[instance],
-					shared.shareddata.routes[i].points[j].ydisplay[instance],
-					shared.shareddata.routes[i].points[j].zdisplay[instance]);
-				}
-			for (j=0;j<shared.shareddata.routes[i].npoints-1;j++)
-				{
-				fprintf(stderr,"dbg2       route %d %d nls:          %d\n",i,j,shared.shareddata.routes[i].segments[j].nls);
-				fprintf(stderr,"dbg2       route %d %d nls_alloc:    %d\n",i,j,shared.shareddata.routes[i].segments[j].nls_alloc);
-				fprintf(stderr,"dbg2       route %d %d endpoints[0]: %f %f %f %f %f %f %f %f\n",
-					i,j,shared.shareddata.routes[i].segments[j].endpoints[0].xgrid[instance],
-					shared.shareddata.routes[i].segments[j].endpoints[0].ygrid[instance],
-					shared.shareddata.routes[i].segments[j].endpoints[0].xlon,
-					shared.shareddata.routes[i].segments[j].endpoints[0].ylat,
-					shared.shareddata.routes[i].segments[j].endpoints[0].zdata,
-					shared.shareddata.routes[i].segments[j].endpoints[0].xdisplay[instance],
-					shared.shareddata.routes[i].segments[j].endpoints[0].ydisplay[instance],
-					shared.shareddata.routes[i].segments[j].endpoints[0].zdisplay[instance]);
-				fprintf(stderr,"dbg2       route %d %d endpoints[1]: %f %f %f %f %f %f %f %f\n",
-					i,j,shared.shareddata.routes[i].segments[j].endpoints[1].xgrid[instance],
-					shared.shareddata.routes[i].segments[j].endpoints[1].ygrid[instance],
-					shared.shareddata.routes[i].segments[j].endpoints[1].xlon,
-					shared.shareddata.routes[i].segments[j].endpoints[1].ylat,
-					shared.shareddata.routes[i].segments[j].endpoints[1].zdata,
-					shared.shareddata.routes[i].segments[j].endpoints[1].xdisplay[instance],
-					shared.shareddata.routes[i].segments[j].endpoints[1].ydisplay[instance],
-					shared.shareddata.routes[i].segments[j].endpoints[1].zdisplay[instance]);
-				fprintf(stderr,"dbg2       segment points: kpoint xgrid[instance] ygrid[instance] xlon ylat zdata xdisplay[instance] ydisplay[instance] zdisplay[instance]\n");
-				seg = (struct mbview_linesegmentw_struct *) &(shared.shareddata.routes[inew].segments[j]);
-				for (k=0;k<seg->nls;k++)
-					{
-					fprintf(stderr,"dbg2         %d %f %f %f  %f %f  %f %f %f\n",
-						k, seg->lspoints[k].xgrid[instance],
-						seg->lspoints[k].ygrid[instance],
-						seg->lspoints[k].zdata,
-						seg->lspoints[k].xlon,
-						seg->lspoints[k].ylat,
-						seg->lspoints[k].xdisplay[instance],
-						seg->lspoints[k].ydisplay[instance],
-						seg->lspoints[k].zdisplay[instance]);
-					}
-				}
-			}
-		}
-
-	/* print output debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:          %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-
-/*------------------------------------------------------------------------------*/
-int mbview_route_delete(size_t instance, int iroute, int ipoint)
-{
-
-	/* local variables */
-	char	*function_name = "mbview_route_delete";
-	int	status = MB_SUCCESS;
-	int	error = MB_ERROR_NO_ERROR;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-	int	i, j;
-
-	/* print starting debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       instance:         %zu\n",instance);
-		fprintf(stderr,"dbg2       iroute:          %d\n",iroute);
-		fprintf(stderr,"dbg2       ipoint:          %d\n",ipoint);
-		}
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-fprintf(stderr,"mbview_route_delete: iroute:%d ipoint:%d editmode:%d\n",iroute,ipoint,shared.shareddata.routes[iroute].editmode);
-	/* delete route point if its valid */
-	if (iroute >= 0 && iroute < shared.shareddata.nroute
-		&& ipoint >= 0 && ipoint < shared.shareddata.routes[iroute].npoints
-		&& shared.shareddata.routes[iroute].editmode == MB_YES)
-		{
-		/* free segment immediately after deleted point */
-		if (shared.shareddata.routes[iroute].npoints > 1)
-			{
-			if (ipoint < shared.shareddata.routes[iroute].npoints - 1)
-				{
-				mb_freed(mbv_verbose,__FILE__,__LINE__,(void **)&(shared.shareddata.routes[iroute].segments[ipoint].lspoints),&error);
-				shared.shareddata.routes[iroute].segments[ipoint].nls = 0;
-				shared.shareddata.routes[iroute].segments[ipoint].nls_alloc = 0;
-				}
-			}
-
-		/* move route point data if necessary */
-		for (j=ipoint;j<shared.shareddata.routes[iroute].npoints-1;j++)
-			{
-			shared.shareddata.routes[iroute].waypoint[j] = shared.shareddata.routes[iroute].waypoint[j+1];
-			shared.shareddata.routes[iroute].points[j] = shared.shareddata.routes[iroute].points[j+1];
-			}
-
-		/* move route segment data if necessary */
-		for (j=ipoint;j<shared.shareddata.routes[iroute].npoints-2;j++)
-			{
-			shared.shareddata.routes[iroute].segments[j] = shared.shareddata.routes[iroute].segments[j+1];
-			}
-
-		/* decrement npoints */
-		shared.shareddata.routes[iroute].npoints--;
-
-		/* if route still has points then reset affected segment endpoints */
-		if (shared.shareddata.routes[iroute].npoints > 0)
-			{
-			for (j=MAX(0,ipoint-1);j<shared.shareddata.routes[iroute].npoints-1;j++)
-				{
-				shared.shareddata.routes[iroute].segments[j].endpoints[0] = shared.shareddata.routes[iroute].points[j];
-				shared.shareddata.routes[iroute].segments[j].endpoints[1] = shared.shareddata.routes[iroute].points[j+1];
-
-				/* drape the segment */
-				mbview_drapesegmentw(instance, &(shared.shareddata.routes[iroute].segments[j]));
-
-				/* update the segment for all active instances */
-				mbview_updatesegmentw(instance, &(shared.shareddata.routes[iroute].segments[j]));
-				}
-			}
-
-		/* if route still has points then reset distance values */
-		if (shared.shareddata.routes[iroute].npoints > 0)
-			{
-			mbview_route_setdistance(instance, iroute);
-			}
-
-		/* if last point deleted then move remaining routes if necessary */
-		if (shared.shareddata.routes[iroute].npoints <= 0)
-			{
-			/* move route data if necessary */
-			for (i=iroute;i<shared.shareddata.nroute-1;i++)
-				{
-				shared.shareddata.routes[i] = shared.shareddata.routes[i+1];
-				}
-
-			/* decrement nroute */
-			shared.shareddata.nroute--;
-			}
-
-		/* no route selection now */
-		if (shared.shareddata.route_selected != MBV_SELECT_NONE)
-			{
-			shared.shareddata.route_selected = MBV_SELECT_NONE;
-			shared.shareddata.route_point_selected = MBV_SELECT_NONE;
-			data->pickinfo_mode = data->pick_type;
-			}
-		}
-
-	/* else beep */
-	else
-		{
-		XBell(view->dpy,100);
-		}
-
-	/* print route debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  Route data altered in function <%s>\n",
-			function_name);
-		fprintf(stderr,"dbg2  Route values:\n");
-		fprintf(stderr,"dbg2       route_view_mode:      %d\n",data->route_view_mode);
-		fprintf(stderr,"dbg2       route_mode:           %d\n",shared.shareddata.route_mode);
-		fprintf(stderr,"dbg2       nroute:               %d\n",shared.shareddata.nroute);
-		fprintf(stderr,"dbg2       nroute_alloc:         %d\n",shared.shareddata.nroute_alloc);
-		fprintf(stderr,"dbg2       route_selected:       %d\n",shared.shareddata.route_selected);
-		fprintf(stderr,"dbg2       route_point_selected: %d\n",shared.shareddata.route_point_selected);
-		for (i=0;i<shared.shareddata.nroute;i++)
-			{
-			fprintf(stderr,"dbg2       route %d color:         %d\n",i,shared.shareddata.routes[i].color);
-			fprintf(stderr,"dbg2       route %d size:          %d\n",i,shared.shareddata.routes[i].size);
-			fprintf(stderr,"dbg2       route %d name:          %s\n",i,shared.shareddata.routes[i].name);
-			fprintf(stderr,"dbg2       route %d npoints:       %d\n",i,shared.shareddata.routes[i].npoints);
-			fprintf(stderr,"dbg2       route %d npoints_alloc: %d\n",i,shared.shareddata.routes[i].npoints_alloc);
-			for (j=0;j<shared.shareddata.routes[i].npoints;j++)
-				{
-				fprintf(stderr,"dbg2       route %d %d xgrid:    %f\n",i,j,shared.shareddata.routes[i].points[j].xgrid[instance]);
-				fprintf(stderr,"dbg2       route %d %d ygrid:    %f\n",i,j,shared.shareddata.routes[i].points[j].ygrid[instance]);
-				fprintf(stderr,"dbg2       route %d %d xlon:     %f\n",i,j,shared.shareddata.routes[i].points[j].xlon);
-				fprintf(stderr,"dbg2       route %d %d ylat:     %f\n",i,j,shared.shareddata.routes[i].points[j].ylat);
-				fprintf(stderr,"dbg2       route %d %d zdata:    %f\n",i,j,shared.shareddata.routes[i].points[j].zdata);
-				fprintf(stderr,"dbg2       route %d %d xdisplay: %f\n",i,j,shared.shareddata.routes[i].points[j].xdisplay[instance]);
-				fprintf(stderr,"dbg2       route %d %d ydisplay: %f\n",i,j,shared.shareddata.routes[i].points[j].ydisplay[instance]);
-				fprintf(stderr,"dbg2       route %d %d zdisplay: %f\n",i,j,shared.shareddata.routes[i].points[j].zdisplay[instance]);
-				}
-			for (j=0;j<shared.shareddata.routes[i].npoints-1;j++)
-				{
-				fprintf(stderr,"dbg2       route %d %d nls:          %d\n",i,j,shared.shareddata.routes[i].segments[j].nls);
-				fprintf(stderr,"dbg2       route %d %d nls_alloc:    %d\n",i,j,shared.shareddata.routes[i].segments[j].nls_alloc);
-				fprintf(stderr,"dbg2       route %d %d endpoints[0]: %p\n",i,j,&shared.shareddata.routes[i].segments[j].endpoints[0]);
-				fprintf(stderr,"dbg2       route %d %d endpoints[1]: %p\n",i,j,&shared.shareddata.routes[i].segments[j].endpoints[1]);
-				}
-			}
-		}
-
-	/* print output debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:          %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-
-
-/*------------------------------------------------------------------------------*/
-int mbview_route_setdistance(size_t instance, int working_route)
-{
-	/* local variables */
-	char	*function_name = "mbview_route_setdistance";
-	int	status = MB_SUCCESS;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-	struct mbview_route_struct *route;
-	double	distlateral, distovertopo;
-	double	routelon0, routelon1;
-	double	routelat0, routelat1;
-	double	routetopo0, routetopo1;
-	double	routeslope;
-	int	i, j;
-
-	/* print starting debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:                   %d\n", mbv_verbose);
-		fprintf(stderr,"dbg2       instance:                  %zu\n", instance);
-		fprintf(stderr,"dbg2       working_route:             %d\n", working_route);
-		}
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* check that the route is valid */
-	if (working_route >= 0 && working_route < shared.shareddata.nroute && shared.shareddata.routes[working_route].npoints > 0)
-		{
-		/* get route pointer */
-		route = &(shared.shareddata.routes[working_route]);
-
-		/* loop over the route segments */
-		route->distancelateral = 0.0;
-		route->distancetopo = 0.0;
-		route->nroutepoint = 0;
-		for (i=0;i<route->npoints-1;i++)
-			{
-			/* do first point */
-			routelon1 = route->points[i].xlon;
-			if (routelon1 < -180.0)
-				routelon1 += 360.0;
-			else if (routelon1 > 180.0)
-				routelon1 -= 360.0;
-			routelat1 = route->points[i].ylat ;
-			routetopo1 = route->points[i].zdata;
-			if (route->nroutepoint == 0)
-				{
-				distlateral = 0.0;
-				distovertopo = 0.0;
-				}
-			else
-				{
-				mbview_projectdistance(instance,
-					routelon0, routelat0, routetopo0,
-					routelon1, routelat1, routetopo1,
-					&distlateral,
-					&distovertopo,
-					&routeslope);
-				}
-			route->distancelateral += distlateral;
-			route->distancetopo += distovertopo;
-			routelon0 = routelon1;
-			routelat0 = routelat1;
-			routetopo0 = routetopo1;
-			route->nroutepoint++;
-
-			/* set distances for route waypoint */
-			route->distlateral[i] = route->distancelateral;
-			route->disttopo[i] = route->distancetopo;
-
-			/* loop over interior of segment */
-			for (j=1;j<route->segments[i].nls-1;j++)
-				{
-				routelon1 = route->segments[i].lspoints[j].xlon;
-				if (routelon1 < -180.0)
-					routelon1 += 360.0;
-				else if (routelon1 > 180.0)
-					routelon1 -= 360.0;
-				routelat1 = route->segments[i].lspoints[j].ylat;
-				routetopo1 = route->segments[i].lspoints[j].zdata;
-				mbview_projectdistance(instance,
-					routelon0, routelat0, routetopo0,
-					routelon1, routelat1, routetopo1,
-					&distlateral,
-					&distovertopo,
-					&routeslope);
-				route->distancelateral += distlateral;
-				route->distancetopo += distovertopo;
-				routelon0 = routelon1;
-				routelat0 = routelat1;
-				routetopo0 = routetopo1;
-				route->nroutepoint++;
-				}
-			}
-
-		/* do last point */
-		j = route->npoints - 1;
-		routelon1 = route->points[j].xlon;
-		if (routelon1 < -180.0)
-			routelon1 += 360.0;
-		else if (routelon1 > 180.0)
-			routelon1 -= 360.0;
-		routelat1 = route->points[j].ylat ;
-		routetopo1 = route->points[j].zdata;
-		mbview_projectdistance(instance,
-			routelon0, routelat0, routetopo0,
-			routelon1, routelat1, routetopo1,
-			&distlateral,
-			&distovertopo,
-			&routeslope);
-		route->distancelateral += distlateral;
-		route->distancetopo += distovertopo;
-		routelon0 = routelon1;
-		routelat0 = routelat1;
-		routetopo0 = routetopo1;
-		route->nroutepoint++;
-
-		/* set distances for route waypoint */
-		route->distlateral[j] = route->distancelateral;
-		route->disttopo[j] = route->distancetopo;
-		}
-
-	/* print output debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       routedistancelateral:      %f\n", route->distancelateral);
-		fprintf(stderr,"dbg2       routedistancetopo:         %f\n", route->distancetopo);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:                    %d\n", status);
-		}
-
-	/* return */
-	return(status);
-
-}
-
-/*------------------------------------------------------------------------------*/
-int mbview_drawroute(size_t instance, int rez)
-{
-	/* local variables */
-	char	*function_name = "mbview_drawroute";
-	int	status = MB_SUCCESS;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-	GLUquadricObj *globj;
-	double	routesizesmall, routesizelarge;
-	double	xx, yy;
-	int	iroute, jpoint;
-	int	icolor;
-	int	k, k0, k1;
-
-	/* print starting debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       instance:         %zu\n",instance);
-		fprintf(stderr,"dbg2       rez:              %d\n",rez);
-		}
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* Generate GL lists to be plotted */
-	if (shared.shareddata.route_mode != MBV_ROUTE_OFF
-		&& data->route_view_mode == MBV_VIEW_ON
-		&& shared.shareddata.nroute > 0)
-		{
-		/* get size according to viewbounds */
-		k0 = data->viewbounds[0] * data->primary_ny + data->viewbounds[2];
-		k1 = data->viewbounds[1] * data->primary_ny + data->viewbounds[3];
-		xx = data->primary_x[k1] - data->primary_x[k0];
-		yy = data->primary_y[k1] - data->primary_y[k0];
-		routesizesmall = 0.004 * sqrt(xx * xx + yy * yy);
-		routesizelarge = 1.4 * routesizesmall;
-
-		/* Use disks for 2D plotting */
-		if (data->display_mode == MBV_DISPLAY_2D)
-			{
-			/* make list for small route */
-	    		glNewList((GLuint)MBV_GLLIST_ROUTESMALL, GL_COMPILE);
-			globj = gluNewQuadric();
-			gluDisk(globj, 0.0, routesizesmall, 4, 1);
-			gluDeleteQuadric(globj);
-			icolor = MBV_COLOR_BLACK;
-			glColor3f(colortable_object_red[icolor],
-				colortable_object_green[icolor],
-				colortable_object_blue[icolor]);
-			globj = gluNewQuadric();
-			gluDisk(globj, 0.8 * routesizesmall, routesizesmall, 10, 1);
-			gluDeleteQuadric(globj);
-			glEndList();
-
-			/* make list for large route */
-	    		glNewList((GLuint)MBV_GLLIST_ROUTELARGE, GL_COMPILE);
-			globj = gluNewQuadric();
-			gluDisk(globj, 0.0, routesizelarge, 4, 1);
-			gluDeleteQuadric(globj);
-			icolor = MBV_COLOR_BLACK;
-			glColor3f(colortable_object_red[icolor],
-				colortable_object_green[icolor],
-				colortable_object_blue[icolor]);
-			globj = gluNewQuadric();
-			gluDisk(globj, 0.8 * routesizelarge, routesizelarge, 10, 1);
-			gluDeleteQuadric(globj);
-			glEndList();
-			}
-
-		/* Use spheres for 3D plotting */
-		else if (data->display_mode == MBV_DISPLAY_3D)
-			{
-			/* make list for small route */
-	    		glNewList((GLuint)MBV_GLLIST_ROUTESMALL, GL_COMPILE);
-			globj = gluNewQuadric();
-			gluSphere(globj, routesizesmall, 4, 3);
-			gluDeleteQuadric(globj);
-			glEndList();
-
-			/* make list for large route */
-	    		glNewList((GLuint)MBV_GLLIST_ROUTELARGE, GL_COMPILE);
-			globj = gluNewQuadric();
-			gluSphere(globj, routesizelarge, 4, 3);
-			gluDeleteQuadric(globj);
-			glEndList();
-			}
-
-		/* loop over the route points */
-		for (iroute=0;iroute<shared.shareddata.nroute;iroute++)
-			{
-			for (jpoint=0;jpoint<shared.shareddata.routes[iroute].npoints;jpoint++)
-				{
-
-				/* set the color for this route */
-				if (iroute == shared.shareddata.route_selected
-					&& (jpoint == shared.shareddata.route_point_selected
-						|| shared.shareddata.route_point_selected == MBV_SELECT_ALL))
-					icolor = MBV_COLOR_RED;
-				else
-					icolor = shared.shareddata.routes[iroute].color;
-				glColor3f(colortable_object_red[icolor],
-					colortable_object_green[icolor],
-					colortable_object_blue[icolor]);
-
-				/* draw the route point as a disk or sphere using GLUT */
-
-				glTranslatef(shared.shareddata.routes[iroute].points[jpoint].xdisplay[instance],
-						shared.shareddata.routes[iroute].points[jpoint].ydisplay[instance],
-						shared.shareddata.routes[iroute].points[jpoint].zdisplay[instance]);
-				if (iroute == shared.shareddata.route_selected
-					&& (jpoint == shared.shareddata.route_point_selected
-						|| shared.shareddata.route_point_selected == MBV_SELECT_ALL))
-	    				glCallList((GLuint)MBV_GLLIST_ROUTELARGE);
-				else
-	    				glCallList((GLuint)MBV_GLLIST_ROUTESMALL);
-				glTranslatef(-shared.shareddata.routes[iroute].points[jpoint].xdisplay[instance],
-						-shared.shareddata.routes[iroute].points[jpoint].ydisplay[instance],
-						-shared.shareddata.routes[iroute].points[jpoint].zdisplay[instance]);
-
-
-				}
-
-			/* draw draped route line segments */
-			glColor3f(0.0, 0.0, 0.0);
-			glLineWidth((float)(2.0));
-			glBegin(GL_LINE_STRIP);
-			for (jpoint=0;jpoint<shared.shareddata.routes[iroute].npoints-1;jpoint++)
-				{
-				/* set size and color */
-				if (iroute == shared.shareddata.route_selected
-					&& (jpoint == shared.shareddata.route_point_selected
-						|| jpoint == shared.shareddata.route_point_selected - 1))
-					{
-					icolor = MBV_COLOR_RED;
-					}
-				else
-					{
-					icolor = shared.shareddata.routes[iroute].color;
-					}
-				glColor3f(colortable_object_red[icolor],
-					colortable_object_green[icolor],
-					colortable_object_blue[icolor]);
-
-				/* draw draped segment */
-				for (k=0;k<shared.shareddata.routes[iroute].segments[jpoint].nls;k++)
-					{
-					/* draw points */
-					glVertex3f((float)(shared.shareddata.routes[iroute].segments[jpoint].lspoints[k].xdisplay[instance]),
-							(float)(shared.shareddata.routes[iroute].segments[jpoint].lspoints[k].ydisplay[instance]),
-							(float)(shared.shareddata.routes[iroute].segments[jpoint].lspoints[k].zdisplay[instance]));
-					}
-				}
-			glEnd();
-			}
-		}
-#ifdef MBV_GETERRORS
-mbview_glerrorcheck(instance, 1, function_name);
-#endif
-
-	/* print output debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-
-/*------------------------------------------------------------------------------*/
-int mbview_updateroutelist()
-{
-	/* local variables */
-	char	*function_name = "mbview_updateroutelist";
-	int	status = MB_SUCCESS;
-   	XmString *xstr;
-	int	jpoint;
-	int	nitems;
-	int	iitem;
-	char	lonstr0[24];
-	char	latstr0[24];
-	char	waypointstr[10];
-	int	iroute, jwaypoint;
-
-	/* print starting debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		}
-
-	/* update route list */
-	if (shared.init_routelist == MBV_WINDOW_VISIBLE)
-		{
-		/* remove all existing items */
-		XmListDeleteAllItems(shared.mb3d_routelist.mbview_list_routelist);
-
-		if (shared.shareddata.nroute > 0)
-			{
-			/* get number of items */
-			nitems = shared.shareddata.nroute;
-			for (iroute=0;iroute<shared.shareddata.nroute;iroute++)
-				{
-				nitems += 1 + shared.shareddata.routes[iroute].npoints;
-				}
-
-			/* allocate array of label XmStrings */
-			xstr = (XmString *) malloc(nitems * sizeof(XmString));
-
-			/* loop over the routes */
-			nitems = 0;
-			for (iroute=0;iroute<shared.shareddata.nroute;iroute++)
-				{
-				if (shared.shareddata.routes[iroute].editmode == MB_YES)
-				sprintf(value_string,"Editable Route %3d | Waypoints:%3d | Length:%.2f %.2f m | %s | Name: %s",
-					iroute, shared.shareddata.routes[iroute].npoints,
-					shared.shareddata.routes[iroute].distancelateral,
-					shared.shareddata.routes[iroute].distancetopo,
-					mbview_colorname[shared.shareddata.routes[iroute].color],
-					shared.shareddata.routes[iroute].name);
-				else
-				sprintf(value_string,"Static Route %3d | Waypoints:%3d | Length:%.2f %.2f m | %s | Name: %s",
-					iroute, shared.shareddata.routes[iroute].npoints,
-					shared.shareddata.routes[iroute].distancelateral,
-					shared.shareddata.routes[iroute].distancetopo,
-					mbview_colorname[shared.shareddata.routes[iroute].color],
-					shared.shareddata.routes[iroute].name);
-      				xstr[nitems] = XmStringCreateLocalized(value_string);
-				nitems++;
-
-				/* add list item for each waypoint */
-				for (jpoint=0;jpoint<shared.shareddata.routes[iroute].npoints;jpoint++)
-					{
-					/* add list item for each route */
-					mbview_setlonlatstrings(shared.lonlatstyle,
-								shared.shareddata.routes[iroute].points[jpoint].xlon,
-								shared.shareddata.routes[iroute].points[jpoint].ylat,
-								lonstr0, latstr0);
-
-					if (shared.shareddata.routes[iroute].waypoint[jpoint] == MBV_ROUTE_WAYPOINT_SIMPLE)
-						strcpy(waypointstr, "---------");
-					else if (shared.shareddata.routes[iroute].waypoint[jpoint] == MBV_ROUTE_WAYPOINT_TRANSIT)
-						strcpy(waypointstr, "-TRANSIT-");
-					else if (shared.shareddata.routes[iroute].waypoint[jpoint] == MBV_ROUTE_WAYPOINT_STARTLINE)
-						strcpy(waypointstr, "--START--");
-					else if (shared.shareddata.routes[iroute].waypoint[jpoint] == MBV_ROUTE_WAYPOINT_ENDLINE)
-						strcpy(waypointstr, "---END---");
-					else if (shared.shareddata.routes[iroute].waypoint[jpoint] == MBV_ROUTE_WAYPOINT_STARTLINE2)
-						strcpy(waypointstr, "--START2-");
-					else if (shared.shareddata.routes[iroute].waypoint[jpoint] == MBV_ROUTE_WAYPOINT_ENDLINE2)
-						strcpy(waypointstr, "---END2--");
-					else if (shared.shareddata.routes[iroute].waypoint[jpoint] == MBV_ROUTE_WAYPOINT_STARTLINE3)
-						strcpy(waypointstr, "--START3-");
-					else if (shared.shareddata.routes[iroute].waypoint[jpoint] == MBV_ROUTE_WAYPOINT_ENDLINE3)
-						strcpy(waypointstr, "---END3--");
-					else if (shared.shareddata.routes[iroute].waypoint[jpoint] == MBV_ROUTE_WAYPOINT_STARTLINE4)
-						strcpy(waypointstr, "--START4-");
-					else if (shared.shareddata.routes[iroute].waypoint[jpoint] == MBV_ROUTE_WAYPOINT_ENDLINE4)
-						strcpy(waypointstr, "---END4--");
-					else
-						strcpy(waypointstr, "-------");
-					sprintf(value_string,"%3d | %3d | %s | %s | %.2f | %.2f | %.2f | %s",
-						iroute, jpoint, lonstr0, latstr0,
-						shared.shareddata.routes[iroute].points[jpoint].zdata,
-						shared.shareddata.routes[iroute].distlateral[jpoint],
-						shared.shareddata.routes[iroute].disttopo[jpoint],
-						waypointstr);
-      					xstr[nitems] = XmStringCreateLocalized(value_string);
-					nitems++;
-					}
-				}
-
-			/* add list items */
-    			XmListAddItems(shared.mb3d_routelist.mbview_list_routelist,
-					xstr, nitems, 0);
-
-			/* select list item for selected route */
-			if (shared.shareddata.route_selected != MBV_SELECT_NONE)
-				{
-				/* get item number */
-				iitem = 0;
-				for (iroute=0;iroute<shared.shareddata.nroute;iroute++)
-					{
-					iitem++;
-					if (iroute == shared.shareddata.route_selected
-						&& shared.shareddata.route_point_selected == MBV_SELECT_ALL)
-						{
-						XmListSelectPos(shared.mb3d_routelist.mbview_list_routelist,iitem,0);
-						XmListSetPos(shared.mb3d_routelist.mbview_list_routelist,MAX(iitem-5, 1));
-						}
-					for (jwaypoint=0;jwaypoint<shared.shareddata.routes[iroute].npoints;jwaypoint++)
-						{
-						iitem++;
-						if (iroute == shared.shareddata.route_selected
-							&& shared.shareddata.route_point_selected == jwaypoint)
-							{
-							XmListSelectPos(shared.mb3d_routelist.mbview_list_routelist,iitem,0);
-							XmListSetPos(shared.mb3d_routelist.mbview_list_routelist,MAX(iitem-5, 1));
-							}
-						}
-					}
-				}
-
-			/* deallocate memory no longer needed */
-			for (iitem=0;iitem<nitems;iitem++)
-				{
-    				XmStringFree(xstr[iitem]);
-    				}
-    			free(xstr);
-			}
-		}
-
-	/* print output debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-
-/*------------------------------------------------------------------------------*/
diff --git a/src/mbview/mbview_secondary.c b/src/mbview/mbview_secondary.c
deleted file mode 100644
index 2ad6406..0000000
--- a/src/mbview/mbview_secondary.c
+++ /dev/null
@@ -1,568 +0,0 @@
-/*------------------------------------------------------------------------------
- *    The MB-system:	mbview_secondary.c	9/25/2003
- *    $Id: mbview_secondary.c 2239 2015-05-07 00:51:42Z caress $
- *
- *    Copyright (c) 2003-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *------------------------------------------------------------------------------*/
-/*
- *
- * Author:	D. W. Caress
- * Date:	September 25, 2003
- *
- * Note:	This code was broken out of mbview_callbacks.c, which was
- *		begun on October 7, 2002
- *
- * $Log: mbview_secondary.c,v $
- * Revision 5.10  2008/05/16 22:59:42  caress
- * Release 5.1.1beta18.
- *
- * Revision 5.9  2007/10/08 16:32:08  caress
- * Code status as of 8 October 2007.
- *
- * Revision 5.8  2007/06/17 23:27:30  caress
- * Added NBeditviz.
- *
- * Revision 5.7  2006/06/22 04:45:43  caress
- * Working towards 5.1.0
- *
- * Revision 5.6  2006/06/16 19:30:58  caress
- * Check in after the Santa Monica Basin Mapping AUV Expedition.
- *
- * Revision 5.5  2006/01/24 19:21:32  caress
- * Version 5.0.8 beta.
- *
- * Revision 5.4  2005/11/05 01:11:47  caress
- * Much work over the past two months.
- *
- * Revision 5.3  2005/02/18 07:32:56  caress
- * Fixed nav display and button sensitivity.
- *
- * Revision 5.2  2005/02/08 22:37:43  caress
- * Heading towards 5.0.6 release.
- *
- * Revision 5.0  2003/12/02 20:38:32  caress
- * Making version number 5.0
- *
- * Revision 1.2  2003/11/25 01:43:19  caress
- * MBview version generated during EW0310.
- *
- *
- */
-/*------------------------------------------------------------------------------*/
-
-/* Standard includes for builtins. */
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include <math.h>
-
-/* Motif required Headers */
-#include <X11/StringDefs.h>
-#include <X11/cursorfont.h>
-#include <Xm/Xm.h>
-#include <Xm/MainW.h>
-#include <Xm/DialogS.h>
-#include <Xm/RepType.h>
-#include <Xm/MwmUtil.h>
-#include <Xm/BulletinB.h>
-#include <Xm/RowColumn.h>
-#include <Xm/CascadeB.h>
-#include <Xm/PushB.h>
-#include <Xm/TextF.h>
-#include <Xm/Separator.h>
-#include <Xm/ToggleB.h>
-#include "MB3DView.h"
-#include "MB3DSiteList.h"
-#include "MB3DRouteList.h"
-#include "MB3DNavList.h"
-
-/* OpenGL include files */
-#ifdef WIN32
-#undef BOOL		/* It was defined by a chain of inclusions in the (patched) X11/Xmd.h */
-#include <windows.h>
-#endif
-
-#include <GL/gl.h>
-#include <GL/glu.h>
-#ifndef WIN32
-#	include <GL/glx.h>
-#endif
-#include "mb_glwdrawa.h"
-
-/* MBIO include files */
-#include "mb_status.h"
-#include "mb_define.h"
-
-/* mbview include */
-#include "mbview.h"
-#include "mbviewprivate.h"
-
-/*------------------------------------------------------------------------------*/
-
-/* local variables */
-static char		value_text[MB_PATH_MAXLINE];
-static char rcs_id[]="$Id: mbview_secondary.c 2239 2015-05-07 00:51:42Z caress $";
-
-/*------------------------------------------------------------------------------*/
-int mbview_setsecondarygrid(int verbose, size_t instance,
-			int	secondary_grid_projection_mode,
-			char	*secondary_grid_projection_id,
-			float	secondary_nodatavalue,
-			int	secondary_nx,
-			int	secondary_ny,
-			double	secondary_min,
-			double	secondary_max,
-			double	secondary_xmin,
-			double	secondary_xmax,
-			double	secondary_ymin,
-			double	secondary_ymax,
-			double	secondary_dx,
-			double	secondary_dy,
-			float	*secondary_data,
-			int *error)
-
-{
-	/* local variables */
-	char	*function_name = "mbview_setsecondarygrid";
-	int	status = MB_SUCCESS;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-	int	proj_status;
-	char	*message;
-
-	/* print starting debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:                   %d\n", verbose);
-		fprintf(stderr,"dbg2       instance:                  %zu\n", instance);
-		fprintf(stderr,"dbg2       secondary_grid_projection_mode:   %d\n", secondary_grid_projection_mode);
-		fprintf(stderr,"dbg2       secondary_grid_projection_id:     %s\n", secondary_grid_projection_id);
-		fprintf(stderr,"dbg2       secondary_nodatavalue:       %f\n", secondary_nodatavalue);
-		fprintf(stderr,"dbg2       secondary_nx:                %d\n", secondary_nx);
-		fprintf(stderr,"dbg2       secondary_ny:                %d\n", secondary_ny);
-		fprintf(stderr,"dbg2       secondary_min:               %f\n", secondary_min);
-		fprintf(stderr,"dbg2       secondary_max:               %f\n", secondary_max);
-		fprintf(stderr,"dbg2       secondary_xmin:              %f\n", secondary_xmin);
-		fprintf(stderr,"dbg2       secondary_xmax:              %f\n", secondary_xmax);
-		fprintf(stderr,"dbg2       secondary_ymin:              %f\n", secondary_ymin);
-		fprintf(stderr,"dbg2       secondary_ymax:              %f\n", secondary_ymax);
-		fprintf(stderr,"dbg2       secondary_dx:                %f\n", secondary_dx);
-		fprintf(stderr,"dbg2       secondary_dy:                %f\n", secondary_dy);
-		fprintf(stderr,"dbg2       secondary_data:              %p\n", secondary_data);
-		}
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* set values */
-        data->secondary_grid_projection_mode = secondary_grid_projection_mode;
-        strcpy(data->secondary_grid_projection_id, secondary_grid_projection_id);
-        data->secondary_nodatavalue = secondary_nodatavalue;
-        data->secondary_nxy = secondary_nx * secondary_ny;
-        data->secondary_nx = secondary_nx;
-        data->secondary_ny = secondary_ny;
-        data->secondary_min = secondary_min;
-        data->secondary_max = secondary_max;
-        data->secondary_xmin = secondary_xmin;
-        data->secondary_xmax = secondary_xmax;
-        data->secondary_ymin = secondary_ymin;
-        data->secondary_ymax = secondary_ymax;
-        data->secondary_dx = secondary_dx;
-        data->secondary_dy = secondary_dy;
-
-	/* allocate required arrays */
-    	status = mb_mallocd(verbose, __FILE__, __LINE__, sizeof(float) * data->secondary_nxy,
-    				(void **)&data->secondary_data, error);
-	if (status != MB_SUCCESS)
-	    {
-	    fprintf(stderr,"\nUnable to allocate memory to store secondary grid data\n");
-	    fprintf(stderr,"\nProgram terminated in function <%s>.\n",
-		    function_name);
-	    exit(*error);
-	    }
-
-	/* copy grid */
-	memcpy(data->secondary_data, secondary_data, data->secondary_nxy * sizeof(float));
-
-	/* check if secondary grid has same bounds and dimensions as primary grid so
-		that overlay calculations are trivial */
-	if (data->secondary_nx == data->primary_nx
-		&& data->secondary_ny == data->primary_ny
-		&& (fabs(data->secondary_xmin - data->primary_xmin) < 0.1 * data->primary_dx)
-		&& (fabs(data->secondary_xmax - data->primary_xmax) < 0.1 * data->primary_dx)
-		&& (fabs(data->secondary_ymin - data->primary_ymin) < 0.1 * data->primary_dy)
-		&& (fabs(data->secondary_ymax - data->primary_ymax) < 0.1 * data->primary_dy))
-		data->secondary_sameas_primary = MB_YES;
-	else
-		data->secondary_sameas_primary = MB_NO;
-
-	/* set projection for secondary grid if needed */
-	if (data->secondary_nxy > 0
-		&& data->secondary_grid_projection_mode == MBV_PROJECTION_PROJECTED)
-		{
-		/* set projection for getting lon lat */
-		proj_status = mb_proj_init(mbv_verbose,
-					data->secondary_grid_projection_id,
-					&(view->secondary_pjptr),
-					error);
-		if (proj_status == MB_SUCCESS)
-			view->secondary_pj_init = MB_YES;
-/*fprintf(stderr,"SECONDARY GRID PROJECTION:%d %p %s\n",
-view->secondary_pj_init,view->secondary_pjptr,data->secondary_grid_projection_id);*/
-
-		/* quit if projection fails */
-		if (proj_status != MB_SUCCESS)
-			{
-			mb_error(verbose,*error,&message);
-			fprintf(stderr,"\nMBIO Error initializing projection:\n%s\n",
-				message);
-			fprintf(stderr,"\nProgram terminated in <%s>\n",
-				function_name);
-			mb_memory_clear(mbv_verbose, error);
-			exit(*error);
-			}
-		}
-
-	/* reset histogram flag */
-	view->secondary_histogram_set = MB_NO;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:                     %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:                    %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-/*------------------------------------------------------------------------------*/
-int mbview_updatesecondarygrid(int verbose, size_t instance,
-			int	secondary_nx,
-			int	secondary_ny,
-			float	*secondary_data,
-			int *error)
-
-{
-	/* local variables */
-	char	*function_name = "mbview_updatesecondarygrid";
-	int	status = MB_SUCCESS;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-	int	first;
-	int	k;
-
-	/* print starting debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:                      %d\n", verbose);
-		fprintf(stderr,"dbg2       instance:                     %zu\n", instance);
-		fprintf(stderr,"dbg2       secondary_nx:                 %d\n", secondary_nx);
-		fprintf(stderr,"dbg2       secondary_ny:                 %d\n", secondary_ny);
-		fprintf(stderr,"dbg2       secondary_data:               %p\n", secondary_data);
-		}
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* set value */
-	if (secondary_nx == data->secondary_nx
-		&& secondary_ny == data->secondary_ny)
-		{
-		first = MB_YES;
-		for (k=0;k<data->secondary_nx*data->secondary_ny;k++)
-			{
-			data->secondary_data[k] = secondary_data[k];
-			if (first == MB_YES && secondary_data[k] != data->secondary_nodatavalue)
-				{
-				data->secondary_min = data->secondary_data[k];
-				data->secondary_max = data->secondary_data[k];
-				first = MB_NO;
-				}
-			else if (secondary_data[k] != data->secondary_nodatavalue)
-				{
-				data->secondary_min = MIN(data->secondary_min, data->secondary_data[k]);
-				data->secondary_max = MAX(data->secondary_max, data->secondary_data[k]);
-				}
-			}
-		}
-
-	/* reset plotting and colors */
-	view->lastdrawrez = MBV_REZ_NONE;
-	mbview_setcolorparms(instance);
-	mbview_colorclear(instance);
-
-	/* reset histogram flag */
-	view->secondary_histogram_set = MB_NO;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:                     %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:                    %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-
-/*------------------------------------------------------------------------------*/
-int mbview_updatesecondarygridcell(int verbose, size_t instance,
-			int	secondary_ix,
-			int	secondary_jy,
-			float	value,
-			int *error)
-
-{
-	/* local variables */
-	char	*function_name = "mbview_setsecondarygrid";
-	int	status = MB_SUCCESS;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-	int	k;
-
-	/* print starting debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:                      %d\n", verbose);
-		fprintf(stderr,"dbg2       instance:                     %zu\n", instance);
-		fprintf(stderr,"dbg2       secondary_ix:                 %d\n", secondary_ix);
-		fprintf(stderr,"dbg2       secondary_jy:                 %d\n", secondary_jy);
-		fprintf(stderr,"dbg2       value:                        %f\n", value);
-		}
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* set value */
-	if (secondary_ix >= 0 && secondary_ix < data->secondary_nx
-		&& secondary_jy >= 0 && secondary_jy < data->secondary_ny)
-		{
-		/* update the cell value */
-		k = secondary_ix * data->secondary_ny + secondary_jy;
-		data->secondary_data[k] = value;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:                     %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:                    %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-
-/*------------------------------------------------------------------------------*/
-int mbview_setsecondarycolortable(int verbose, size_t instance,
-			int	secondary_colortable,
-			int	secondary_colortable_mode,
-			double	secondary_colortable_min,
-			double	secondary_colortable_max,
-			double	overlay_shade_magnitude,
-			double	overlay_shade_center,
-			int	overlay_shade_mode,
-			int *error)
-
-{
-	/* local variables */
-	char	*function_name = "mbview_setsecondarycolortable";
-	int	status = MB_SUCCESS;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-
-	/* print starting debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:                   %d\n", verbose);
-		fprintf(stderr,"dbg2       instance:                  %zu\n", instance);
-		fprintf(stderr,"dbg2       secondary_colortable:      %d\n", secondary_colortable);
-		fprintf(stderr,"dbg2       secondary_colortable_mode: %d\n", secondary_colortable_mode);
-		fprintf(stderr,"dbg2       secondary_colortable_min:  %f\n", secondary_colortable_min);
-		fprintf(stderr,"dbg2       secondary_colortable_max:  %f\n", secondary_colortable_max);
-		fprintf(stderr,"dbg2       overlay_shade_magnitude:   %f\n", overlay_shade_magnitude);
-		fprintf(stderr,"dbg2       overlay_shade_center:      %f\n", overlay_shade_center);
-		fprintf(stderr,"dbg2       overlay_shade_mode:        %d\n", overlay_shade_mode);
-		}
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* set values */
-        data->secondary_colortable = secondary_colortable;
-        data->secondary_colortable_mode = secondary_colortable_mode;
-        data->secondary_colortable_min = secondary_colortable_min;
-        data->secondary_colortable_max = secondary_colortable_max;
-        data->overlay_shade_magnitude = overlay_shade_magnitude;
-        data->overlay_shade_center = overlay_shade_center;
-        data->overlay_shade_mode = overlay_shade_mode;
-
-	/* set secondary color control widgets if managed */
-	if (XtIsManaged(view->mb3dview.mbview_textField_overlaymin))
-		{
-		sprintf(value_text,"%g", data->secondary_colortable_min);
-		XmTextFieldSetString(view->mb3dview.mbview_textField_overlaymin,
-				value_text);
-		sprintf(value_text,"%g", data->secondary_colortable_max);
-		XmTextFieldSetString(view->mb3dview.mbview_textField_overlaymax,
-				value_text);
-		if (data->secondary_colortable_mode == MBV_COLORTABLE_NORMAL)
-			{
-	    		XmToggleButtonSetState(view->mb3dview.mbview_toggleButton_overlay_ctoh,
-				TRUE, TRUE);
-			}
-		else
-			{
-	    		XmToggleButtonSetState(view->mb3dview.mbview_toggleButton_overlay_htoc,
-				TRUE, TRUE);
-			}
-		}
-	if (XtIsManaged(view->mb3dview.mbview_textField_overlay_amp))
-		{
-		sprintf(value_text,"%g", data->overlay_shade_magnitude);
-		XmTextFieldSetString(view->mb3dview.mbview_textField_overlay_amp,
-				value_text);
-		sprintf(value_text,"%g", data->overlay_shade_center);
-		XmTextFieldSetString(view->mb3dview.mbview_textField_overlay_center,
-				value_text);
-		if (data->overlay_shade_mode == MBV_COLORTABLE_NORMAL)
-			{
-	    		XmToggleButtonSetState(view->mb3dview.mbview_toggleButton_overlay_shade_ctoh,
-				TRUE, TRUE);
-			}
-		else
-			{
-	    		XmToggleButtonSetState(view->mb3dview.mbview_toggleButton_overlay_shade_htoc,
-				TRUE, TRUE);
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:                     %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:                    %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-
-/*------------------------------------------------------------------------------*/
-
-int mbview_setsecondaryname(int verbose, size_t instance,
-				char *name, int *error)
-
-{
-	/* local variables */
-	char	*function_name = "mbview_setsecondaryname";
-	int	status = MB_SUCCESS;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-        XmString    tmp0;
-	Cardinal ac = 0;
-	Arg      args[256];
-	Boolean  argok = False;
-
-	/* print starting debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:                   %d\n", verbose);
-		fprintf(stderr,"dbg2       instance:                  %zu\n", instance);
-		fprintf(stderr,"dbg2       name:                      %s\n", name);
-		}
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* set secondary grid labels */
- 	if (XtIsManaged(view->mb3dview.mbview_toggleButton_data_secondary))
-		{
-		ac = 0;
-        	tmp0 = (XmString) BX_CONVERT(view->mb3dview.mbview_toggleButton_data_secondary, (char *)name,
-                	XmRXmString, 0, &argok);
-        	XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-		XtSetValues(view->mb3dview.mbview_toggleButton_data_secondary, args, ac);
-        	XmStringFree((XmString)tmp0);
-
-		ac = 0;
-		sprintf(value_text, "Shading by %s", name);
-        	tmp0 = (XmString) BX_CONVERT(view->mb3dview.mbview_toggleButton_overlay_secondary, (char *)value_text,
-                	XmRXmString, 0, &argok);
-        	XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
-		XtSetValues(view->mb3dview.mbview_toggleButton_overlay_secondary, args, ac);
-        	XmStringFree((XmString)tmp0);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:                     %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:                    %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-
-/*------------------------------------------------------------------------------*/
diff --git a/src/mbview/mbview_site.c b/src/mbview/mbview_site.c
deleted file mode 100644
index e672265..0000000
--- a/src/mbview/mbview_site.c
+++ /dev/null
@@ -1,1476 +0,0 @@
-/*------------------------------------------------------------------------------
- *    The MB-system:	mbview_site.c	9/25/2003
- *    $Id: mbview_site.c 2239 2015-05-07 00:51:42Z caress $
- *
- *    Copyright (c) 2003-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *------------------------------------------------------------------------------*/
-/*
- *
- * Author:	D. W. Caress
- * Date:	September 25, 2003
- *
- * Note:	This code was broken out of mbview_callbacks.c, which was
- *		begun on October 7, 2002
- *
- * $Log: mbview_site.c,v $
- * Revision 5.10  2008/09/11 20:17:33  caress
- * Checking in updates made during cruise AT15-36.
- *
- * Revision 5.9  2008/05/16 22:59:42  caress
- * Release 5.1.1beta18.
- *
- * Revision 5.8  2007/06/17 23:27:30  caress
- * Added NBeditviz.
- *
- * Revision 5.7  2006/06/16 19:30:58  caress
- * Check in after the Santa Monica Basin Mapping AUV Expedition.
- *
- * Revision 5.6  2006/01/24 19:21:32  caress
- * Version 5.0.8 beta.
- *
- * Revision 5.5  2005/11/05 01:11:47  caress
- * Much work over the past two months.
- *
- * Revision 5.4  2005/02/18 07:32:55  caress
- * Fixed nav display and button sensitivity.
- *
- * Revision 5.3  2005/02/08 22:37:43  caress
- * Heading towards 5.0.6 release.
- *
- * Revision 5.1  2004/02/24 22:52:28  caress
- * Added spherical projection to MBview.
- *
- * Revision 5.0  2003/12/02 20:38:32  caress
- * Making version number 5.0
- *
- * Revision 1.2  2003/11/25 01:43:19  caress
- * MBview version generated during EW0310.
- *
- *
- */
-/*------------------------------------------------------------------------------*/
-
-/* Standard includes for builtins. */
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include <math.h>
-
-/* Motif required Headers */
-#include <X11/StringDefs.h>
-#include <X11/cursorfont.h>
-#include <Xm/Xm.h>
-#include <Xm/MainW.h>
-#include <Xm/DialogS.h>
-#include <Xm/RepType.h>
-#include <Xm/MwmUtil.h>
-#include <Xm/BulletinB.h>
-#include <Xm/RowColumn.h>
-#include <Xm/CascadeB.h>
-#include <Xm/PushB.h>
-#include <Xm/Separator.h>
-#include <Xm/List.h>
-#include "MB3DView.h"
-#include "MB3DSiteList.h"
-#include "MB3DRouteList.h"
-#include "MB3DNavList.h"
-
-/* OpenGL include files */
-#ifdef WIN32
-#undef BOOL		/* It was defined by a chain of inclusions in the (patched) X11/Xmd.h */
-#include <windows.h>
-#endif
-
-#include <GL/gl.h>
-#include <GL/glu.h>
-#ifndef WIN32
-#	include <GL/glx.h>
-#endif
-#include "mb_glwdrawa.h"
-
-/* MBIO include files */
-#include "mb_status.h"
-#include "mb_define.h"
-
-/* mbview include */
-#include "mbview.h"
-#include "mbviewprivate.h"
-
-/*------------------------------------------------------------------------------*/
-
-/* library variables */
-extern int	mbv_verbose;
-extern Widget	parent_widget;
-extern XtAppContext	app_context;
-extern struct mbview_world_struct mbviews[MBV_MAX_WINDOWS];
-extern char	*mbsystem_library_name;
-
-/* local variables */
-static char	value_string[MB_PATH_MAXLINE];
-
-static char rcs_id[]="$Id: mbview_site.c 2239 2015-05-07 00:51:42Z caress $";
-
-/*------------------------------------------------------------------------------*/
-int mbview_getsitecount(int verbose, size_t instance,
-			int *nsite,
-			int *error)
-
-{
-	/* local variables */
-	char	*function_name = "mbview_getsitecount";
-	int	status = MB_SUCCESS;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-
-	/* print starting debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:                   %d\n", verbose);
-		fprintf(stderr,"dbg2       instance:                  %zu\n", instance);
-		}
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* get number of sites */
-	*nsite = shared.shareddata.nsite;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       nsite:                     %d\n", *nsite);
-		fprintf(stderr,"dbg2       error:                     %d\n", *error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:                    %d\n", status);
-		}
-
-	/* return */
-	return(status);
-}
-
-/*------------------------------------------------------------------------------*/
-int mbview_allocsitearrays(int verbose,
-			int	nsite,
-			double	**sitelon,
-			double	**sitelat,
-			double	**sitetopo,
-			int	**sitecolor,
-			int	**sitesize,
-			mb_path	**sitename,
-			int 	*error)
-
-{
-	/* local variables */
-	char	*function_name = "mbview_allocsitearrays";
-	int	status = MB_SUCCESS;
-
-	/* print starting debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:                   %d\n", verbose);
-		fprintf(stderr,"dbg2       nsite:                     %d\n", nsite);
-		fprintf(stderr,"dbg2       sitelon:                   %p\n", *sitelon);
-		fprintf(stderr,"dbg2       sitelat:                   %p\n", *sitelat);
-		fprintf(stderr,"dbg2       sitetopo:                  %p\n", *sitetopo);
-		fprintf(stderr,"dbg2       sitecolor:                 %p\n", *sitecolor);
-		fprintf(stderr,"dbg2       sitesize:                  %p\n", *sitesize);
-		fprintf(stderr,"dbg2       sitename:                  %p\n", *sitename);
-		}
-
-	/* allocate the arrays using mb_realloc */
-	status = mb_reallocd(verbose,__FILE__,__LINE__,nsite*sizeof(double),(void **)sitelon,error);
-	if (status == MB_SUCCESS)
-		status = mb_reallocd(verbose,__FILE__,__LINE__,nsite*sizeof(double),(void **)sitelat,error);
-	if (status == MB_SUCCESS)
-		status = mb_reallocd(verbose,__FILE__,__LINE__,nsite*sizeof(double),(void **)sitetopo,error);
-	if (status == MB_SUCCESS)
-		status = mb_reallocd(verbose,__FILE__,__LINE__,nsite*sizeof(int),(void **)sitecolor,error);
-	if (status == MB_SUCCESS)
-		status = mb_reallocd(verbose,__FILE__,__LINE__,nsite*sizeof(int),(void **)sitesize,error);
-	if (status == MB_SUCCESS)
-		status = mb_reallocd(verbose,__FILE__,__LINE__,nsite*sizeof(mb_path),(void **)sitename,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       sitelon:                   %p\n", *sitelon);
-		fprintf(stderr,"dbg2       sitelat:                   %p\n", *sitelat);
-		fprintf(stderr,"dbg2       sitetopo:                  %p\n", *sitetopo);
-		fprintf(stderr,"dbg2       sitecolor:                 %p\n", *sitecolor);
-		fprintf(stderr,"dbg2       sitesize:                  %p\n", *sitesize);
-		fprintf(stderr,"dbg2       sitename:                  %p\n", *sitename);
-		fprintf(stderr,"dbg2       error:                     %d\n", *error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:                    %d\n", status);
-		}
-
-	/* return */
-	return(status);
-}
-
-
-/*------------------------------------------------------------------------------*/
-int mbview_freesitearrays(int verbose,
-			double	**sitelon,
-			double	**sitelat,
-			double	**sitetopo,
-			int	**sitecolor,
-			int	**sitesize,
-			mb_path	**sitename,
-			int *error)
-
-{
-	/* local variables */
-	char	*function_name = "mbview_freesitearrays";
-	int	status = MB_SUCCESS;
-
-	/* print starting debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:                   %d\n", verbose);
-		fprintf(stderr,"dbg2       sitelon:                   %p\n", *sitelon);
-		fprintf(stderr,"dbg2       sitelat:                   %p\n", *sitelat);
-		fprintf(stderr,"dbg2       sitetopo:                  %p\n", *sitetopo);
-		fprintf(stderr,"dbg2       sitecolor:                 %p\n", *sitecolor);
-		fprintf(stderr,"dbg2       sitesize:                  %p\n", *sitesize);
-		fprintf(stderr,"dbg2       sitename:                  %p\n", *sitename);
-		}
-
-	/* free the arrays using mb_free */
-	status = mb_freed(verbose,__FILE__,__LINE__,(void **)sitelon,error);
-	status = mb_freed(verbose,__FILE__,__LINE__,(void **)sitelat,error);
-	status = mb_freed(verbose,__FILE__,__LINE__,(void **)sitetopo,error);
-	status = mb_freed(verbose,__FILE__,__LINE__,(void **)sitecolor,error);
-	status = mb_freed(verbose,__FILE__,__LINE__,(void **)sitesize,error);
-	status = mb_freed(verbose,__FILE__,__LINE__,(void **)sitename,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       sitelon:                   %p\n", *sitelon);
-		fprintf(stderr,"dbg2       sitelat:                   %p\n", *sitelat);
-		fprintf(stderr,"dbg2       sitetopo:                  %p\n", *sitetopo);
-		fprintf(stderr,"dbg2       sitecolor:                 %p\n", *sitecolor);
-		fprintf(stderr,"dbg2       sitesize:                  %p\n", *sitesize);
-		fprintf(stderr,"dbg2       sitename:                  %p\n", *sitename);
-		fprintf(stderr,"dbg2       error:                     %d\n", *error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:                    %d\n", status);
-		}
-
-	/* return */
-	return(status);
-}
-
-
-/*------------------------------------------------------------------------------*/
-int mbview_addsites(int verbose, size_t instance,
-			int	nsite,
-			double	*sitelon,
-			double	*sitelat,
-			double	*sitetopo,
-			int	*sitecolor,
-			int	*sitesize,
-			mb_path	*sitename,
-			int *error)
-
-{
-	/* local variables */
-	char	*function_name = "mbview_addsites";
-	int	status = MB_SUCCESS;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-	double	xgrid, ygrid, zdata;
-	double	xdisplay, ydisplay, zdisplay;
-	int	nadded;
-	int	i;
-
-	/* print starting debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:                   %d\n", verbose);
-		fprintf(stderr,"dbg2       instance:                  %zu\n", instance);
-		fprintf(stderr,"dbg2       nsite:                     %d\n", nsite);
-		fprintf(stderr,"dbg2       sitelon:                   %p\n", sitelon);
-		fprintf(stderr,"dbg2       sitelat:                   %p\n", sitelat);
-		fprintf(stderr,"dbg2       sitetopo:                  %p\n", sitetopo);
-		fprintf(stderr,"dbg2       sitecolor:                 %p\n", sitecolor);
-		fprintf(stderr,"dbg2       sitesize:                  %p\n", sitesize);
-		fprintf(stderr,"dbg2       sitename:                  %p\n", sitename);
-		for (i=0;i<nsite;i++)
-			{
-			fprintf(stderr,"dbg2       site:%d lon:%f lat:%f topo:%f color:%d size:%d name:%s\n",
-					i, sitelon[i], sitelat[i], sitetopo[i],
-					sitecolor[i], sitesize[i], sitename[i]);
-			}
-		}
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* make sure no site is selected */
-	shared.shareddata.site_selected = MBV_SELECT_NONE;
-
-	/* allocate memory if required */
-	if (shared.shareddata.nsite_alloc < shared.shareddata.nsite + nsite)
-		{
-fprintf(stderr,"Have %d sites allocated but need %d + %d = %d\n",
-shared.shareddata.nsite_alloc, shared.shareddata.nsite, nsite, shared.shareddata.nsite + nsite);
-		shared.shareddata.nsite_alloc = shared.shareddata.nsite + nsite;
-		status = mb_reallocd(mbv_verbose, __FILE__, __LINE__,
-			    	shared.shareddata.nsite_alloc * sizeof(struct mbview_site_struct),
-			    	(void **)&(shared.shareddata.sites), error);
-		if (status == MB_FAILURE)
-			{
-			shared.shareddata.nsite_alloc = 0;
-			}
-		else
-			{
-			for (i=shared.shareddata.nsite;i<shared.shareddata.nsite_alloc;i++)
-				{
-				shared.shareddata.sites[i].color = MBV_COLOR_GREEN;
-				shared.shareddata.sites[i].size = 1;
-				shared.shareddata.sites[i].name[0] = '\0';
-				}
-			}
-		}
-
-	/* loop over the sites */
-	nadded = 0;
-	for (i=0;i<nsite;i++)
-		{
-		/* get site positions in grid coordinates */
-		status = mbview_projectll2xyzgrid(instance,
-				sitelon[i], sitelat[i],
-				&xgrid, &ygrid, &zdata);
-
-		/* use provided topo */
-		if (sitetopo[i] != MBV_DEFAULT_NODATA)
-		    {
-		    zdata = sitetopo[i];
-		    }
-
-		/* get site positions in display coordinates */
-		status = mbview_projectll2display(instance,
-				sitelon[i], sitelat[i], zdata,
-				&xdisplay, &ydisplay, &zdisplay);
-
-		/* check for reasonable coordinates */
-		if (fabs(xdisplay) < 1000.0 && fabs(ydisplay) < 1000.0 && fabs(zdisplay) < 1000.0)
-			{
-
-			/* add the new site */
-			shared.shareddata.sites[shared.shareddata.nsite].point.xgrid[instance] = xgrid;
-			shared.shareddata.sites[shared.shareddata.nsite].point.ygrid[instance] = ygrid;
-			shared.shareddata.sites[shared.shareddata.nsite].point.xlon = sitelon[i];
-			shared.shareddata.sites[shared.shareddata.nsite].point.ylat = sitelat[i];
-			shared.shareddata.sites[shared.shareddata.nsite].point.zdata = zdata;
-			shared.shareddata.sites[shared.shareddata.nsite].point.xdisplay[instance] = xdisplay;
-			shared.shareddata.sites[shared.shareddata.nsite].point.ydisplay[instance] = ydisplay;
-			shared.shareddata.sites[shared.shareddata.nsite].point.zdisplay[instance] = zdisplay;
-			shared.shareddata.sites[shared.shareddata.nsite].color = sitecolor[i];
-			shared.shareddata.sites[shared.shareddata.nsite].size = sitesize[i];
-			strcpy(shared.shareddata.sites[shared.shareddata.nsite].name, sitename[i]);
-
-			/* set grid and display coordinates for all instances */
-			mbview_updatepointw(instance, &(shared.shareddata.sites[shared.shareddata.nsite].point));
-
-			/* set nsite */
-			shared.shareddata.nsite++;
-			nadded++;
-/* fprintf(stderr,"Added site %d added so far:%d total:%d\n",
-shared.shareddata.nsite-1, nadded, shared.shareddata.nsite);*/
-			}
-
-		/* report failure due to unreasonable coordinates */
-		else
-			{
-fprintf(stderr,"Failed to add site at position lon:%f lat:%f due to display coordinate projection (%f %f %f) far outside view...\n",
-sitelon[i],sitelat[i],xdisplay,ydisplay,zdisplay);
-			XBell(view->dpy,100);
-			}
-		}
-
-	/* make sites viewable */
-	if (nadded > 0)
-		{
-		data->site_view_mode = MBV_VIEW_ON;
-		}
-
-	/* update site list */
-	mbview_updatesitelist();
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:                     %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:                    %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-/*------------------------------------------------------------------------------*/
-int mbview_getsites(int verbose, size_t instance,
-			int	*nsite,
-			double	*sitelon,
-			double	*sitelat,
-			double	*sitetopo,
-			int	*sitecolor,
-			int	*sitesize,
-			mb_path	*sitename,
-			int *error)
-
-{
-	/* local variables */
-	char	*function_name = "mbview_getsites";
-	int	status = MB_SUCCESS;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-	int	i;
-
-	/* print starting debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:                   %d\n", verbose);
-		fprintf(stderr,"dbg2       instance:                  %zu\n", instance);
-		fprintf(stderr,"dbg2       nsite:                     %p\n", nsite);
-		fprintf(stderr,"dbg2       sitelon:                   %p\n", sitelon);
-		fprintf(stderr,"dbg2       sitelat:                   %p\n", sitelat);
-		fprintf(stderr,"dbg2       sitetopo:                  %p\n", sitetopo);
-		fprintf(stderr,"dbg2       sitecolor:                 %p\n", sitecolor);
-		fprintf(stderr,"dbg2       sitesize:                  %p\n", sitesize);
-		fprintf(stderr,"dbg2       sitename:                  %p\n", sitename);
-		}
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* check that the array pointers are not NULL */
-	if (sitelon == NULL || sitelat == NULL || sitetopo == NULL
-		|| sitecolor == NULL || sitesize == NULL || sitename == NULL)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_DATA_NOT_INSERTED;
-		}
-
-	/* otherwise go get the site data */
-	else
-		{
-		/* loop over the sites */
-		*nsite = shared.shareddata.nsite;
-		for (i=0;i<*nsite;i++)
-			{
-			sitelon[i] = shared.shareddata.sites[i].point.xlon;
-			sitelat[i] = shared.shareddata.sites[i].point.ylat ;
-			sitetopo[i] = shared.shareddata.sites[i].point.zdata;
-			sitecolor[i] = shared.shareddata.sites[i].color;
-			sitesize[i] = shared.shareddata.sites[i].size;
-			strcpy(sitename[i], shared.shareddata.sites[i].name);
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       nsite:                     %d\n", *nsite);
-		for (i=0;i<*nsite;i++)
-			{
-			fprintf(stderr,"dbg2       site:%d lon:%f lat:%f topo:%f color:%d size:%d name:%s\n",
-					i, sitelon[i], sitelat[i], sitetopo[i],
-					sitecolor[i], sitesize[i],
-					sitename[i]);
-			}
-		fprintf(stderr,"dbg2       error:                     %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:                    %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbview_enableviewsites(int verbose, size_t instance,
-			int *error)
-
-{
-	/* local variables */
-	char	*function_name = "mbview_enableviewsites";
-	int	status = MB_SUCCESS;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-
-	/* print starting debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:                   %d\n", verbose);
-		fprintf(stderr,"dbg2       instance:                  %zu\n", instance);
-		}
-
-	/* set values */
-        shared.shareddata.site_mode = MBV_SITE_VIEW;
-
-	/* set widget sensitivity on all active instances */
-	for (instance=0;instance<MBV_MAX_WINDOWS;instance++)
-		{
-		/* get view */
-		view = &(mbviews[instance]);
-		data = &(view->data);
-
-		/* if instance active reset action sensitivity */
-		if (data->active == MB_YES)
-			mbview_update_sensitivity(verbose, instance, error);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:                     %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:                    %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int mbview_enableeditsites(int verbose, size_t instance,
-			int *error)
-
-{
-	/* local variables */
-	char	*function_name = "mbview_enableeditsites";
-	int	status = MB_SUCCESS;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-
-	/* print starting debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:                   %d\n", verbose);
-		fprintf(stderr,"dbg2       instance:                  %zu\n", instance);
-		}
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* set values */
-        shared.shareddata.site_mode = MBV_SITE_EDIT;
-
-	/* set widget sensitivity */
-	if (data->active == MB_YES)
-		mbview_update_sensitivity(mbv_verbose, instance, error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:                     %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:                    %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-
-/*------------------------------------------------------------------------------*/
-int mbview_pick_site_select(size_t instance, int which, int xpixel, int ypixel)
-{
-
-	/* local variables */
-	char	*function_name = "mbview_pick_site_select";
-	int	status = MB_SUCCESS;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-	int	found;
-	double	xgrid, ygrid;
-	double	xlon, ylat, zdata;
-	double	xdisplay, ydisplay, zdisplay;
-	double	xx, yy, rr, rrmin;
-	int	i;
-
-	/* print starting debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       instance:         %zu\n",instance);
-		fprintf(stderr,"dbg2       which:            %d\n",which);
-		fprintf(stderr,"dbg2       xpixel:           %d\n",xpixel);
-		fprintf(stderr,"dbg2       ypixel:           %d\n",ypixel);
-		}
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* only select sites if enabled and not in move mode */
-	if (shared.shareddata.site_mode != MBV_SITE_OFF
-		&& shared.shareddata.nsite > 0
-		&& (which == MBV_PICK_DOWN
-			|| shared.shareddata.site_selected == MBV_SELECT_NONE))
-		{
-		/* look for point */
-		mbview_findpoint(instance, xpixel, ypixel,
-				&found,
-				&xgrid, &ygrid,
-				&xlon, &ylat, &zdata,
-				&xdisplay, &ydisplay, &zdisplay);
-
-		/* look for nearest site */
-		if (found == MB_YES)
-			{
-			/* first deselect previously selected site */
-			shared.shareddata.site_selected = MBV_SELECT_NONE;
-
-			/* now figure out which site will be selected next */
-			rrmin = 1000000000.0;
-			for (i=0;i<shared.shareddata.nsite;i++)
-				{
-				xx = xgrid - shared.shareddata.sites[i].point.xgrid[instance];
-				yy = ygrid - shared.shareddata.sites[i].point.ygrid[instance];
-				rr = sqrt(xx * xx + yy * yy);
-				if (rr < rrmin)
-					{
-					rrmin = rr;
-					shared.shareddata.site_selected = i;
-					}
-				}
-			}
-		else if (shared.shareddata.site_selected == MBV_SELECT_NONE)
-			{
-			XBell(view->dpy,100);
-			}
-		else
-			{
-			/* deselect previously selected site */
-			shared.shareddata.site_selected = MBV_SELECT_NONE;
-			}
-		}
-
-	/* only move selected sites if enabled */
-	else if (shared.shareddata.site_mode != MBV_SITE_OFF
-		&& shared.shareddata.nsite > 0
-		&& (which == MBV_PICK_MOVE
-			&& shared.shareddata.site_selected != MBV_SELECT_NONE))
-		{
-		/* look for point */
-		mbview_findpoint(instance, xpixel, ypixel,
-				&found,
-				&xgrid, &ygrid,
-				&xlon, &ylat, &zdata,
-				&xdisplay, &ydisplay, &zdisplay);
-
-		/* reset selected site position */
-		if (found)
-			{
-			shared.shareddata.sites[shared.shareddata.site_selected].point.xgrid[instance] = xgrid;
-			shared.shareddata.sites[shared.shareddata.site_selected].point.ygrid[instance] = ygrid;
-			shared.shareddata.sites[shared.shareddata.site_selected].point.xlon = xlon;
-			shared.shareddata.sites[shared.shareddata.site_selected].point.ylat = ylat;
-			shared.shareddata.sites[shared.shareddata.site_selected].point.zdata = zdata;
-			shared.shareddata.sites[shared.shareddata.site_selected].point.xdisplay[instance] = xdisplay;
-			shared.shareddata.sites[shared.shareddata.site_selected].point.ydisplay[instance] = ydisplay;
-			shared.shareddata.sites[shared.shareddata.site_selected].point.zdisplay[instance] = zdisplay;
-
-			/* set grid and display coordinates for all instances */
-			mbview_updatepointw(instance, &(shared.shareddata.sites[shared.shareddata.site_selected].point));
-			}
-		}
-
-	/* else beep */
-	else
-		{
-		if (shared.shareddata.site_selected != MBV_SELECT_NONE)
-			{
-			/* deselect previously selected site */
-			shared.shareddata.site_selected = MBV_SELECT_NONE;
-			}
-
-		XBell(view->dpy,100);
-		}
-
-	/* set what kind of pick to annotate */
-	if (shared.shareddata.site_selected != MBV_SELECT_NONE)
-		{
-		data->pickinfo_mode = MBV_PICK_SITE;
-		}
-	else
-		{
-		data->pickinfo_mode = data->pick_type;
-		}
-
-	/* set pick annotation */
-	mbview_pick_text(instance);
-
-	/* update site list */
-	mbview_updatesitelist();
-
-	/* call pick notify if defined */
-	if (which == MBV_PICK_UP && shared.shareddata.site_selected != MBV_SELECT_NONE
-		&& data->mbview_picksite_notify != NULL)
-		{
-		(data->mbview_picksite_notify)(instance);
-		}
-
-	/* print site debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  Site data altered in function <%s>\n",
-			function_name);
-		fprintf(stderr,"dbg2  Site values:\n");
-		fprintf(stderr,"dbg2       site_view_mode:      %d\n",data->site_view_mode);
-		fprintf(stderr,"dbg2       site_mode:           %d\n",shared.shareddata.site_mode);
-		fprintf(stderr,"dbg2       nsite:               %d\n",shared.shareddata.nsite);
-		fprintf(stderr,"dbg2       nsite_alloc:         %d\n",shared.shareddata.nsite_alloc);
-		fprintf(stderr,"dbg2       site_selected:       %d\n",shared.shareddata.site_selected);
-		for (i=0;i<shared.shareddata.nsite;i++)
-			{
-			fprintf(stderr,"dbg2       site %d xgrid:       %f\n",i,shared.shareddata.sites[i].point.xgrid[instance]);
-			fprintf(stderr,"dbg2       site %d ygrid:       %f\n",i,shared.shareddata.sites[i].point.ygrid[instance]);
-			fprintf(stderr,"dbg2       site %d xlon:        %f\n",i,shared.shareddata.sites[i].point.xlon);
-			fprintf(stderr,"dbg2       site %d ylat:        %f\n",i,shared.shareddata.sites[i].point.ylat);
-			fprintf(stderr,"dbg2       site %d zdata:       %f\n",i,shared.shareddata.sites[i].point.zdata);
-			fprintf(stderr,"dbg2       site %d xdisplay:    %f\n",i,shared.shareddata.sites[i].point.xdisplay[instance]);
-			fprintf(stderr,"dbg2       site %d ydisplay:    %f\n",i,shared.shareddata.sites[i].point.ydisplay[instance]);
-			fprintf(stderr,"dbg2       site %d zdisplay:    %f\n",i,shared.shareddata.sites[i].point.zdisplay[instance]);
-			fprintf(stderr,"dbg2       site %d color:       %d\n",i,shared.shareddata.sites[i].color);
-			fprintf(stderr,"dbg2       site %d size:        %d\n",i,shared.shareddata.sites[i].size);
-			fprintf(stderr,"dbg2       site %d name:        %s\n",i,shared.shareddata.sites[i].name);
-			}
-		}
-
-	/* print output debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:          %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-
-
-/*------------------------------------------------------------------------------*/
-int mbview_pick_site_add(size_t instance, int which, int xpixel, int ypixel)
-{
-
-	/* local variables */
-	char	*function_name = "mbview_pick_site_add";
-	int	status = MB_SUCCESS;
-	int	error = MB_ERROR_NO_ERROR;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-	int	found;
-	double	xgrid, ygrid;
-	double	xlon, ylat, zdata;
-	double	xdisplay, ydisplay, zdisplay;
-	int	i, inew;
-
-	/* print starting debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       instance:         %zu\n",instance);
-		fprintf(stderr,"dbg2       which:            %d\n",which);
-		fprintf(stderr,"dbg2       xpixel:           %d\n",xpixel);
-		fprintf(stderr,"dbg2       ypixel:           %d\n",ypixel);
-		}
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* only add sites if enabled and not in move mode */
-	if (shared.shareddata.site_mode == MBV_SITE_EDIT
-		&& (which == MBV_PICK_DOWN
-			|| shared.shareddata.site_selected == MBV_SELECT_NONE))
-		{
-		/* look for point */
-		mbview_findpoint(instance, xpixel, ypixel,
-				&found,
-				&xgrid, &ygrid,
-				&xlon, &ylat, &zdata,
-				&xdisplay, &ydisplay, &zdisplay);
-
-		/* add site */
-		if (found)
-			{
-			/* add site after currently selected site if any */
-			if (shared.shareddata.site_selected == MBV_SELECT_NONE)
-				inew = shared.shareddata.nsite;
-			else
-				{
-				inew = shared.shareddata.site_selected + 1;
-				shared.shareddata.site_selected = MBV_SELECT_NONE;
-				}
-
-			/* now figure out which site will be selected next */
-
-			/* allocate memory if required */
-			if (shared.shareddata.nsite_alloc < shared.shareddata.nsite + 1)
-				{
-				shared.shareddata.nsite_alloc += MBV_ALLOC_NUM;
-				status = mb_reallocd(mbv_verbose, __FILE__, __LINE__,
-			    			shared.shareddata.nsite_alloc * sizeof(struct mbview_site_struct),
-			    			(void **)&(shared.shareddata.sites), &error);
-				if (status == MB_FAILURE)
-					{
-					shared.shareddata.nsite_alloc = 0;
-					}
-				else
-					{
-					for (i=shared.shareddata.nsite;i<shared.shareddata.nsite_alloc;i++)
-						{
-						shared.shareddata.sites[i].color = MBV_COLOR_GREEN;
-						shared.shareddata.sites[i].size = 1;
-						shared.shareddata.sites[i].name[0] = '\0';
-						}
-					}
-				}
-
-			/* move old sites if necessary */
-			for (i=shared.shareddata.nsite;i>inew;i--)
-				{
-				shared.shareddata.sites[i] = shared.shareddata.sites[i-1];
-				}
-
-			/* add the new site */
-			shared.shareddata.sites[inew].point.xgrid[instance] = xgrid;
-			shared.shareddata.sites[inew].point.ygrid[instance] = ygrid;
-			shared.shareddata.sites[inew].point.xlon = xlon;
-			shared.shareddata.sites[inew].point.ylat = ylat;
-			shared.shareddata.sites[inew].point.zdata = zdata;
-			shared.shareddata.sites[inew].point.xdisplay[instance] = xdisplay;
-			shared.shareddata.sites[inew].point.ydisplay[instance] = ydisplay;
-			shared.shareddata.sites[inew].point.zdisplay[instance] = zdisplay;
-			shared.shareddata.sites[inew].color = MBV_COLOR_GREEN;
-			shared.shareddata.sites[inew].size = 1;
-			sprintf(shared.shareddata.sites[inew].name,"Site %d", shared.shareddata.nsite);
-
-			/* set grid and display coordinates for all instances */
-			mbview_updatepointw(instance, &(shared.shareddata.sites[inew].point));
-
-			/* set nsite */
-			shared.shareddata.nsite++;
-
-			/* select the new site */
-			shared.shareddata.site_selected = inew;
-			}
-		else if (shared.shareddata.site_selected == MBV_SELECT_NONE)
-			{
-			XBell(view->dpy,100);
-			}
-		}
-
-	/* only move selected sites if enabled */
-	else if (shared.shareddata.site_mode != MBV_SITE_OFF
-		&& shared.shareddata.nsite > 0
-		&& (which == MBV_PICK_MOVE
-			&& shared.shareddata.site_selected != MBV_SELECT_NONE))
-		{
-		/* look for point */
-		mbview_findpoint(instance, xpixel, ypixel,
-				&found,
-				&xgrid, &ygrid,
-				&xlon, &ylat, &zdata,
-				&xdisplay, &ydisplay, &zdisplay);
-
-		/* reset selected site position */
-		if (found)
-			{
-			shared.shareddata.sites[shared.shareddata.site_selected].point.xgrid[instance] = xgrid;
-			shared.shareddata.sites[shared.shareddata.site_selected].point.ygrid[instance] = ygrid;
-			shared.shareddata.sites[shared.shareddata.site_selected].point.xlon = xlon;
-			shared.shareddata.sites[shared.shareddata.site_selected].point.ylat = ylat;
-			shared.shareddata.sites[shared.shareddata.site_selected].point.zdata = zdata;
-			shared.shareddata.sites[shared.shareddata.site_selected].point.xdisplay[instance] = xdisplay;
-			shared.shareddata.sites[shared.shareddata.site_selected].point.ydisplay[instance] = ydisplay;
-			shared.shareddata.sites[shared.shareddata.site_selected].point.zdisplay[instance] = zdisplay;
-
-			/* set grid and display coordinates for all instances */
-			mbview_updatepointw(instance, &(shared.shareddata.sites[shared.shareddata.site_selected].point));
-			}
-		}
-
-	/* else beep */
-	else
-		{
-		if (shared.shareddata.site_selected != MBV_SELECT_NONE)
-			{
-			/* deselect previously selected site */
-			shared.shareddata.site_selected = MBV_SELECT_NONE;
-			}
-		XBell(view->dpy,100);
-		}
-
-	/* set what kind of pick to annotate */
-	if (shared.shareddata.site_selected != MBV_SELECT_NONE)
-		{
-		data->pickinfo_mode = MBV_PICK_SITE;
-		}
-	else
-		{
-		data->pickinfo_mode = data->pick_type;
-		}
-
-	/* set pick annotation */
-	mbview_pick_text(instance);
-
-	/* update site list */
-	mbview_updatesitelist();
-
-	/* print site debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  Site data altered in function <%s>\n",
-			function_name);
-		fprintf(stderr,"dbg2  Site values:\n");
-		fprintf(stderr,"dbg2       site_view_mode:      %d\n",data->site_view_mode);
-		fprintf(stderr,"dbg2       site_mode:           %d\n",shared.shareddata.site_mode);
-		fprintf(stderr,"dbg2       nsite:               %d\n",shared.shareddata.nsite);
-		fprintf(stderr,"dbg2       nsite_alloc:         %d\n",shared.shareddata.nsite_alloc);
-		fprintf(stderr,"dbg2       site_selected:       %d\n",shared.shareddata.site_selected);
-		for (i=0;i<shared.shareddata.nsite;i++)
-			{
-			fprintf(stderr,"dbg2       site %d xgrid:       %f\n",i,shared.shareddata.sites[i].point.xgrid[instance]);
-			fprintf(stderr,"dbg2       site %d ygrid:       %f\n",i,shared.shareddata.sites[i].point.ygrid[instance]);
-			fprintf(stderr,"dbg2       site %d xlon:        %f\n",i,shared.shareddata.sites[i].point.xlon);
-			fprintf(stderr,"dbg2       site %d ylat:        %f\n",i,shared.shareddata.sites[i].point.ylat);
-			fprintf(stderr,"dbg2       site %d zdata:       %f\n",i,shared.shareddata.sites[i].point.zdata);
-			fprintf(stderr,"dbg2       site %d xdisplay:    %f\n",i,shared.shareddata.sites[i].point.xdisplay[instance]);
-			fprintf(stderr,"dbg2       site %d ydisplay:    %f\n",i,shared.shareddata.sites[i].point.ydisplay[instance]);
-			fprintf(stderr,"dbg2       site %d zdisplay:    %f\n",i,shared.shareddata.sites[i].point.zdisplay[instance]);
-			fprintf(stderr,"dbg2       site %d color:       %d\n",i,shared.shareddata.sites[i].color);
-			fprintf(stderr,"dbg2       site %d size:        %d\n",i,shared.shareddata.sites[i].size);
-			fprintf(stderr,"dbg2       site %d name:        %s\n",i,shared.shareddata.sites[i].name);
-			}
-		}
-
-	/* print output debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:          %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-
-
-/*------------------------------------------------------------------------------*/
-int mbview_pick_site_delete(size_t instance, int xpixel, int ypixel)
-{
-
-	/* local variables */
-	char	*function_name = "mbview_pick_site_delete";
-	int	status = MB_SUCCESS;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-	int	found;
-	double	xgrid, ygrid;
-	double	xlon, ylat, zdata;
-	double	xdisplay, ydisplay, zdisplay;
-	double	xx, yy, rr, rrmin;
-	int	i, isite;
-
-	/* print starting debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       instance:         %zu\n",instance);
-		fprintf(stderr,"dbg2       xpixel:           %d\n",xpixel);
-		fprintf(stderr,"dbg2       ypixel:           %d\n",ypixel);
-		}
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* only delete a selected site if enabled */
-	if (shared.shareddata.site_mode == MBV_SITE_EDIT
-		&& shared.shareddata.site_selected != MBV_SELECT_NONE)
-		{
-		/* look for point */
-		mbview_findpoint(instance, xpixel, ypixel,
-				&found,
-				&xgrid, &ygrid,
-				&xlon, &ylat, &zdata,
-				&xdisplay, &ydisplay, &zdisplay);
-
-		/* find closest site to pick point */
-		if (found)
-			{
-			rrmin = 1000000000.0;
-			isite = MBV_SELECT_NONE;
-			for (i=0;i<shared.shareddata.nsite;i++)
-				{
-				xx = xgrid - shared.shareddata.sites[i].point.xgrid[instance];
-				yy = ygrid - shared.shareddata.sites[i].point.ygrid[instance];
-				rr = sqrt(xx * xx + yy * yy);
-				if (rr < rrmin)
-					{
-					rrmin = rr;
-					isite = i;
-					}
-				}
-			}
-
-		/* delete site if its the same as previously selected */
-		if (found && shared.shareddata.site_selected == isite)
-			{
-			mbview_site_delete(instance, isite);
-			}
-		else
-			{
-			status = MB_FAILURE;
-			}
-		}
-
-	/* else beep */
-	else
-		{
-		status = MB_FAILURE;
-		}
-
-	/* beep for failure */
-	if (status == MB_FAILURE)
-		{
-		XBell(view->dpy,100);
-		}
-
-	/* set what kind of pick to annotate */
-	if (shared.shareddata.site_selected != MBV_SELECT_NONE)
-		{
-		data->pickinfo_mode = MBV_PICK_SITE;
-		}
-	else
-		{
-		data->pickinfo_mode = data->pick_type;
-		}
-
-	/* set pick annotation */
-	mbview_pick_text(instance);
-
-	/* update site list */
-	mbview_updatesitelist();
-
-	/* print site debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  Site data altered in function <%s>\n",
-			function_name);
-		fprintf(stderr,"dbg2  Site values:\n");
-		fprintf(stderr,"dbg2       site_view_mode:      %d\n",data->site_view_mode);
-		fprintf(stderr,"dbg2       site_mode:           %d\n",shared.shareddata.site_mode);
-		fprintf(stderr,"dbg2       nsite:               %d\n",shared.shareddata.nsite);
-		fprintf(stderr,"dbg2       nsite_alloc:         %d\n",shared.shareddata.nsite_alloc);
-		fprintf(stderr,"dbg2       site_selected:       %d\n",shared.shareddata.site_selected);
-		for (i=0;i<shared.shareddata.nsite;i++)
-			{
-			fprintf(stderr,"dbg2       site %d xgrid:       %f\n",i,shared.shareddata.sites[i].point.xgrid[instance]);
-			fprintf(stderr,"dbg2       site %d ygrid:       %f\n",i,shared.shareddata.sites[i].point.ygrid[instance]);
-			fprintf(stderr,"dbg2       site %d xlon:        %f\n",i,shared.shareddata.sites[i].point.xlon);
-			fprintf(stderr,"dbg2       site %d ylat:        %f\n",i,shared.shareddata.sites[i].point.ylat);
-			fprintf(stderr,"dbg2       site %d zdata:       %f\n",i,shared.shareddata.sites[i].point.zdata);
-			fprintf(stderr,"dbg2       site %d xdisplay:    %f\n",i,shared.shareddata.sites[i].point.xdisplay[instance]);
-			fprintf(stderr,"dbg2       site %d ydisplay:    %f\n",i,shared.shareddata.sites[i].point.ydisplay[instance]);
-			fprintf(stderr,"dbg2       site %d zdisplay:    %f\n",i,shared.shareddata.sites[i].point.zdisplay[instance]);
-			fprintf(stderr,"dbg2       site %d color:       %d\n",i,shared.shareddata.sites[i].color);
-			fprintf(stderr,"dbg2       site %d size:        %d\n",i,shared.shareddata.sites[i].size);
-			fprintf(stderr,"dbg2       site %d name:        %s\n",i,shared.shareddata.sites[i].name);
-			}
-		}
-
-	/* print output debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:          %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-
-/*------------------------------------------------------------------------------*/
-int mbview_site_delete(size_t instance, int isite)
-{
-
-	/* local variables */
-	char	*function_name = "mbview_site_delete";
-	int	status = MB_SUCCESS;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-	int	i;
-
-	/* print starting debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       isite:            %d\n",isite);
-		fprintf(stderr,"dbg2       instance:         %zu\n",instance);
-		}
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* delete site if its the same as previously selected */
-	if (isite >= 0 && isite < shared.shareddata.nsite)
-		{
-		/* move site data if necessary */
-		for (i=isite;i<shared.shareddata.nsite-1;i++)
-			{
-			shared.shareddata.sites[i] = shared.shareddata.sites[i+1];
-			}
-
-		/* set nsite */
-		shared.shareddata.nsite--;
-
-		/* no selection */
-		shared.shareddata.site_selected = MBV_SELECT_NONE;
-		}
-	else
-		{
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:          %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-
-/*------------------------------------------------------------------------------*/
-int mbview_drawsite(size_t instance, int rez)
-{
-	/* local variables */
-	char	*function_name = "mbview_drawsite";
-	int	status = MB_SUCCESS;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-	GLUquadricObj *globj;
-	double	sitesizesmall, sitesizelarge;
-	double	xx, yy;
-	int	isite;
-	int	icolor;
-	int	k0, k1;
-
-
-	/* print starting debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       instance:         %zu\n",instance);
-		fprintf(stderr,"dbg2       rez:              %d\n",rez);
-		}
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* Generate GL lists to be plotted */
-	if (shared.shareddata.site_mode != MBV_SITE_OFF
-		&& data->site_view_mode == MBV_VIEW_ON
-		&& shared.shareddata.nsite > 0)
-		{
-		/* get size according to viewbounds */
-		k0 = data->viewbounds[0] * data->primary_ny + data->viewbounds[2];
-		k1 = data->viewbounds[1] * data->primary_ny + data->viewbounds[3];
-		xx = data->primary_x[k1] - data->primary_x[k0];
-		yy = data->primary_y[k1] - data->primary_y[k0];
-		sitesizesmall = 0.004 * sqrt(xx * xx + yy * yy);
-		sitesizelarge = 1.4 * sitesizesmall;
-
-		/* Use disks for 2D plotting */
-		if (data->display_mode == MBV_DISPLAY_2D)
-			{
-			/* make list for small site */
-	    		glNewList((GLuint)MBV_GLLIST_SITESMALL, GL_COMPILE);
-			globj = gluNewQuadric();
-			gluDisk(globj, 0.0, sitesizesmall, 10, 1);
-			gluDeleteQuadric(globj);
-			icolor = MBV_COLOR_BLACK;
-			glColor3f(colortable_object_red[icolor],
-				colortable_object_green[icolor],
-				colortable_object_blue[icolor]);
-			globj = gluNewQuadric();
-			gluDisk(globj, 0.8 * sitesizesmall, sitesizesmall, 10, 1);
-			gluDeleteQuadric(globj);
-			glEndList();
-
-			/* make list for large site */
-	    		glNewList((GLuint)MBV_GLLIST_SITELARGE, GL_COMPILE);
-			globj = gluNewQuadric();
-			gluDisk(globj, 0.0, sitesizelarge, 10, 1);
-			gluDeleteQuadric(globj);
-			icolor = MBV_COLOR_BLACK;
-			glColor3f(colortable_object_red[icolor],
-				colortable_object_green[icolor],
-				colortable_object_blue[icolor]);
-			globj = gluNewQuadric();
-			gluDisk(globj, 0.8 * sitesizelarge, sitesizelarge, 10, 1);
-			gluDeleteQuadric(globj);
-			glEndList();
-			}
-
-		/* Use spheres for 3D plotting */
-		else if (data->display_mode == MBV_DISPLAY_3D)
-			{
-			/* make list for small site */
-	    		glNewList((GLuint)MBV_GLLIST_SITESMALL, GL_COMPILE);
-			globj = gluNewQuadric();
-			gluSphere(globj, sitesizesmall, 10, 10);
-			gluDeleteQuadric(globj);
-			glEndList();
-
-			/* make list for large site */
-	    		glNewList((GLuint)MBV_GLLIST_SITELARGE, GL_COMPILE);
-			globj = gluNewQuadric();
-			gluSphere(globj, sitesizelarge, 10, 10);
-			gluDeleteQuadric(globj);
-			glEndList();
-			}
-
-		/* loop over the sites */
-		for (isite=0;isite<shared.shareddata.nsite;isite++)
-			{
-
-			/* set the color for this site */
-			if (isite == shared.shareddata.site_selected)
-				icolor = MBV_COLOR_RED;
-			else
-				icolor = shared.shareddata.sites[isite].color;
-			glColor3f(colortable_object_red[icolor],
-				colortable_object_green[icolor],
-				colortable_object_blue[icolor]);
-
-			/* draw the site as a disk or sphere using GLUT */
-			glTranslatef(shared.shareddata.sites[isite].point.xdisplay[instance],
-					shared.shareddata.sites[isite].point.ydisplay[instance],
-					shared.shareddata.sites[isite].point.zdisplay[instance]);
-/*fprintf(stderr,"site:%d position: %f %f %f\n",
-isite,shared.shareddata.sites[isite].point.xdisplay[instance],
-shared.shareddata.sites[isite].point.ydisplay[instance],
-shared.shareddata.sites[isite].point.zdisplay[instance]);*/
-			if (isite == shared.shareddata.site_selected)
-	    			glCallList((GLuint)MBV_GLLIST_SITELARGE);
-			else
-	    			glCallList((GLuint)MBV_GLLIST_SITESMALL);
-			glTranslatef(-shared.shareddata.sites[isite].point.xdisplay[instance],
-					-shared.shareddata.sites[isite].point.ydisplay[instance],
-					-shared.shareddata.sites[isite].point.zdisplay[instance]);
-			}
-
-		}
-#ifdef MBV_GETERRORS
-mbview_glerrorcheck(instance, 1, function_name);
-#endif
-
-	/* print output debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-
-
-/*------------------------------------------------------------------------------*/
-int mbview_updatesitelist()
-{
-	/* local variables */
-	char	*function_name = "mbview_updatesitelist";
-	int	status = MB_SUCCESS;
-   	XmString *xstr;
-	int	isite;
-	char	lonstr0[24];
-	char	latstr0[24];
-
-
-	/* print starting debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		}
-
-	/* update site list */
-	if (shared.init_sitelist == MBV_WINDOW_VISIBLE)
-		{
-		/* remove all existing items */
-		XmListDeleteAllItems(shared.mb3d_sitelist.mbview_list_sitelist);
-
-		if (shared.shareddata.nsite > 0)
-			{
-			/* allocate array of label XmStrings */
-			xstr = (XmString *) malloc(shared.shareddata.nsite * sizeof(XmString));
-
-			/* loop over the sites */
-			for (isite=0;isite<shared.shareddata.nsite;isite++)
-				{
-				/* add list item for each site */
-				mbview_setlonlatstrings(shared.lonlatstyle,
-							shared.shareddata.sites[isite].point.xlon,
-							shared.shareddata.sites[isite].point.ylat,
-							lonstr0, latstr0);
-				sprintf(value_string,"%3d | %s | %s | %.3f | %s | %d | %s",
-					isite, lonstr0, latstr0,
-					shared.shareddata.sites[isite].point.zdata,
-					mbview_colorname[shared.shareddata.sites[isite].color],
-					shared.shareddata.sites[isite].size,
-					shared.shareddata.sites[isite].name);
-    				xstr[isite] = XmStringCreateLocalized(value_string);
-				}
-
-			/* add list items */
-    			XmListAddItems(shared.mb3d_sitelist.mbview_list_sitelist,
-					xstr, shared.shareddata.nsite,0);
-
-			/* select list item for selected site */
-			if (shared.shareddata.site_selected != MBV_SELECT_NONE)
-				{
-				XmListSelectPos(shared.mb3d_sitelist.mbview_list_sitelist,
-						shared.shareddata.site_selected+1,0);
-				XmListSetPos(shared.mb3d_sitelist.mbview_list_sitelist,
-					MAX(shared.shareddata.site_selected+1-5, 1));
-				}
-
-			/* deallocate memory no longer needed */
-			for (isite=0;isite<shared.shareddata.nsite;isite++)
-				{
-    				XmStringFree(xstr[isite]);
-    				}
-    			free(xstr);
-			}
-		}
-
-	/* print output debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-
-/*------------------------------------------------------------------------------*/
diff --git a/src/mbview/mbview_vector.c b/src/mbview/mbview_vector.c
deleted file mode 100644
index a08e8da..0000000
--- a/src/mbview/mbview_vector.c
+++ /dev/null
@@ -1,972 +0,0 @@
-/*------------------------------------------------------------------------------
- *    The MB-system:	mbview_vector.c	1/11/2012
- *    $Id: mbview_vector.c 2239 2015-05-07 00:51:42Z caress $
- *
- *    Copyright (c) 2012-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *------------------------------------------------------------------------------*/
-/*
- *
- * Author:	D. W. Caress
- * Date:	October 28, 2003
- *
- * $Log: mbview_vector.c,v $
- *
- */
-/*------------------------------------------------------------------------------*/
-
-/* Standard includes for builtins. */
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include <math.h>
-
-/* Motif required Headers */
-#include <X11/StringDefs.h>
-#include <X11/cursorfont.h>
-#include <Xm/Xm.h>
-#include <Xm/MainW.h>
-#include <Xm/DialogS.h>
-#include <Xm/RepType.h>
-#include <Xm/MwmUtil.h>
-#include <Xm/BulletinB.h>
-#include <Xm/RowColumn.h>
-#include <Xm/CascadeB.h>
-#include <Xm/PushB.h>
-#include <Xm/Separator.h>
-#include <Xm/List.h>
-#include "MB3DView.h"
-#include "MB3DSiteList.h"
-#include "MB3DRouteList.h"
-#include "MB3DNavList.h"
-
-/* OpenGL include files */
-#ifdef WIN32
-#undef BOOL		/* It was defined by a chain of inclusions in the (patched) X11/Xmd.h */
-#include <windows.h>
-#endif
-
-#include <GL/gl.h>
-#include <GL/glu.h>
-#ifndef WIN32
-#	include <GL/glx.h>
-#endif
-#include "mb_glwdrawa.h"
-
-/* MBIO include files */
-#include "mb_status.h"
-#include "mb_define.h"
-
-/* mbview include */
-#include "mbview.h"
-#include "mbviewprivate.h"
-
-/*------------------------------------------------------------------------------*/
-
-/* local variables */
-static char rcs_id[]="$Id: mbview_vector.c 2239 2015-05-07 00:51:42Z caress $";
-
-/*------------------------------------------------------------------------------*/
-int mbview_getvectorcount(int verbose, size_t instance,
-			int *nvector,
-			int *error)
-{
-	/* local variables */
-	char	*function_name = "mbview_getvectorcount";
-	int	status = MB_SUCCESS;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-
-	/* print starting debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:                   %d\n", verbose);
-		fprintf(stderr,"dbg2       instance:                  %zu\n", instance);
-		}
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* get number of vecs */
-	*nvector = shared.shareddata.nvector;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       nvector:                      %d\n", *nvector);
-		fprintf(stderr,"dbg2       error:                     %d\n", *error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:                    %d\n", status);
-		}
-
-	/* return */
-	return(status);
-}
-
-/*------------------------------------------------------------------------------*/
-int mbview_getvectorpointcount(int verbose, size_t instance,
-			int	vec,
-			int	*npoint,
-			int	*nintpoint,
-			int *error)
-{
-	/* local variables */
-	char	*function_name = "mbview_getvectorpointcount";
-	int	status = MB_SUCCESS;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-	int	i;
-
-	/* print starting debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:                   %d\n", verbose);
-		fprintf(stderr,"dbg2       instance:                  %zu\n", instance);
-		fprintf(stderr,"dbg2       vec:                     %d\n", vec);
-		}
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* get number of points in specified vec */
-	*npoint = 0;
-	*nintpoint = 0;
-	if (vec >= 0 && vec < shared.shareddata.nvector)
-		{
-		*npoint = shared.shareddata.vectors[vec].npoints;
-		for (i=0;i<*npoint-1;i++)
-			{
-			if (shared.shareddata.vectors[vec].segments[i].nls > 2)
-				*nintpoint += shared.shareddata.vectors[vec].segments[i].nls - 2;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       npoint:                    %d\n", *npoint);
-		fprintf(stderr,"dbg2       nintpoint:                 %d\n", *nintpoint);
-		fprintf(stderr,"dbg2       error:                     %d\n", *error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:                    %d\n", status);
-		}
-
-	/* return */
-	return(status);
-
-}
-
-/*------------------------------------------------------------------------------*/
-int mbview_allocvectorarrays(int verbose,
-			int	npointtotal,
-			double	**veclon,
-			double	**veclat,
-			double	**vecz,
-			double	**vecdata,
-			int 	*error)
-{
-	/* local variables */
-	char	*function_name = "mbview_allocvectorarrays";
-	int	status = MB_SUCCESS;
-
-	/* print starting debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:                   %d\n", verbose);
-		fprintf(stderr,"dbg2       npointtotal:               %d\n", npointtotal);
-		fprintf(stderr,"dbg2       veclon:                    %p\n", *veclon);
-		fprintf(stderr,"dbg2       veclat:                    %p\n", *veclat);
-		fprintf(stderr,"dbg2       vecz:                      %p\n", *vecz);
-		fprintf(stderr,"dbg2       vecdata:                   %p\n", *vecdata);
-		}
-
-	/* allocate the arrays using mb_realloc */
-	status = mb_reallocd(verbose,__FILE__,__LINE__,npointtotal*sizeof(double),(void **)veclon,error);
-	if (status == MB_SUCCESS)
-		status = mb_reallocd(verbose,__FILE__,__LINE__,npointtotal*sizeof(double),(void **)veclat,error);
-	if (status == MB_SUCCESS)
-		status = mb_reallocd(verbose,__FILE__,__LINE__,npointtotal*sizeof(double),(void **)vecz,error);
-	if (status == MB_SUCCESS)
-		status = mb_reallocd(verbose,__FILE__,__LINE__,npointtotal*sizeof(double),(void **)vecdata,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       veclon:                    %p\n", *veclon);
-		fprintf(stderr,"dbg2       veclat:                    %p\n", *veclat);
-		fprintf(stderr,"dbg2       vecz:                      %p\n", *vecz);
-		fprintf(stderr,"dbg2       vecdata:                   %p\n", *vecdata);
-		fprintf(stderr,"dbg2       error:                     %d\n", *error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:                    %d\n", status);
-		}
-
-	/* return */
-	return(status);
-}
-
-
-/*------------------------------------------------------------------------------*/
-int mbview_freevectorarrays(int verbose,
-			double	**veclon,
-			double	**veclat,
-			double	**vecz,
-			double	**vecdata,
-			int *error)
-{
-	/* local variables */
-	char	*function_name = "mbview_freevectorarrays";
-	int	status = MB_SUCCESS;
-
-	/* print starting debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:                   %d\n", verbose);
-		fprintf(stderr,"dbg2       veclon:                    %p\n", *veclon);
-		fprintf(stderr,"dbg2       veclat:                    %p\n", *veclat);
-		fprintf(stderr,"dbg2       vecz:                      %p\n", *vecz);
-		fprintf(stderr,"dbg2       vecdata:                   %p\n", *vecdata);
-		}
-
-	/* free the arrays using mb_free */
-	status = mb_freed(verbose,__FILE__,__LINE__,(void **)veclon,error);
-	status = mb_freed(verbose,__FILE__,__LINE__,(void **)veclat,error);
-	status = mb_freed(verbose,__FILE__,__LINE__,(void **)vecz,error);
-	status = mb_freed(verbose,__FILE__,__LINE__,(void **)vecdata,error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       veclon:                    %p\n", *veclon);
-		fprintf(stderr,"dbg2       veclat:                    %p\n", *veclat);
-		fprintf(stderr,"dbg2       vecz:                      %p\n", *vecz);
-		fprintf(stderr,"dbg2       vecdata:                   %p\n", *vecdata);
-		fprintf(stderr,"dbg2       error:                     %d\n", *error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:                    %d\n", status);
-		}
-
-	/* return */
-	return(status);
-}
-
-/*------------------------------------------------------------------------------*/
-int mbview_addvector(int verbose, size_t instance,
-			int	npoint,
-			double	*veclon,
-			double	*veclat,
-			double	*vecz,
-			double	*vecdata,
-			int	veccolor,
-			int	vecsize,
-			mb_path	vecname,
-			double	vecdatamin,
-			double	vecdatamax,
-			int *error)
-{
-	/* local variables */
-	char	*function_name = "mbview_addvector";
-	int	status = MB_SUCCESS;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-	int	ivec;
-	int	recalculate_minmax = MB_NO;
-	int	i, j;
-
-	/* print starting debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:                   %d\n", verbose);
-		fprintf(stderr,"dbg2       instance:                  %zu\n", instance);
-		fprintf(stderr,"dbg2       npoint:                    %d\n", npoint);
-		for (i=0;i<npoint;i++)
-			{
-			fprintf(stderr,"dbg2       point:%d lon:%f lat:%f z:%f data:%f\n",
-					i, veclon[i], veclat[i], vecz[i], vecdata[i]);
-			}
-		fprintf(stderr,"dbg2       veccolor:                  %d\n", veccolor);
-		fprintf(stderr,"dbg2       vecsize:                   %d\n", vecsize);
-		fprintf(stderr,"dbg2       vecname:                   %s\n", vecname);
-		fprintf(stderr,"dbg2       vecdatamin:                %f\n", vecdatamin);
-		fprintf(stderr,"dbg2       vecdatamax:                %f\n", vecdatamax);
-		}
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* make sure no vec is selected */
-	shared.shareddata.vector_selected = MBV_SELECT_NONE;
-	shared.shareddata.vector_point_selected = MBV_SELECT_NONE;
-
-	/* set vec id so that new vec is created */
-	ivec = shared.shareddata.nvector;
-
-	/* allocate memory for a new vec if required */
-	if (shared.shareddata.nvector_alloc < shared.shareddata.nvector + 1)
-		{
-		shared.shareddata.nvector_alloc = shared.shareddata.nvector + 1;
-		status = mb_realloc(mbv_verbose,
-			    	shared.shareddata.nvector_alloc * sizeof(struct mbview_vector_struct),
-			    	(void **)&(shared.shareddata.vectors), error);
-		if (status == MB_FAILURE)
-			{
-			shared.shareddata.nvector_alloc = 0;
-			}
-		else
-			{
-			for (i=shared.shareddata.nvector;i<shared.shareddata.nvector_alloc;i++)
-				{
-				shared.shareddata.vectors[i].color = MBV_COLOR_RED;
-				shared.shareddata.vectors[i].size = 4;
-				shared.shareddata.vectors[i].name[0] = '\0';
-				shared.shareddata.vectors[i].npoints = 0;
-				shared.shareddata.vectors[i].npoints_alloc = 0;
-				shared.shareddata.vectors[i].nselected = 0;
-				shared.shareddata.vectors[i].vectorpts = NULL;
-				shared.shareddata.vectors[i].segments = NULL;
-				}
-			}
-		}
-
-	/* allocate memory to for vec arrays */
-	if (shared.shareddata.vectors[ivec].npoints_alloc < npoint)
-		{
-		shared.shareddata.vectors[ivec].npoints_alloc = npoint;
-		status = mb_reallocd(mbv_verbose, __FILE__, __LINE__,
-			    	shared.shareddata.vectors[ivec].npoints_alloc * sizeof(struct mbview_vectorpointw_struct),
-			    	(void **)&(shared.shareddata.vectors[ivec].vectorpts), error);
-		status = mb_reallocd(mbv_verbose, __FILE__, __LINE__,
-			    	shared.shareddata.vectors[ivec].npoints_alloc * sizeof(struct mbview_linesegmentw_struct),
-			    	(void **)&(shared.shareddata.vectors[ivec].segments), error);
-		for (j=0;j<shared.shareddata.vectors[ivec].npoints_alloc-1;j++)
-			{
-			shared.shareddata.vectors[ivec].segments[j].nls = 0;
-			shared.shareddata.vectors[ivec].segments[j].nls_alloc = 0;
-			shared.shareddata.vectors[ivec].segments[j].lspoints = NULL;
-			shared.shareddata.vectors[ivec].segments[j].endpoints[0] = shared.shareddata.vectors[ivec].vectorpts[j].point;
-			shared.shareddata.vectors[ivec].segments[j].endpoints[1] = shared.shareddata.vectors[ivec].vectorpts[j+1].point;
-			}
-		}
-
-	/* add the new vec */
-	if (status == MB_SUCCESS)
-		{
-		/* set nvector */
-		shared.shareddata.nvector++;
-
-		/* set color size and name for new vec */
-		shared.shareddata.vectors[ivec].color = veccolor;
-		shared.shareddata.vectors[ivec].size = vecsize;
-		strcpy(shared.shareddata.vectors[ivec].name,vecname);
-		shared.shareddata.vectors[ivec].datamin = vecdatamin;
-		shared.shareddata.vectors[ivec].datamax = vecdatamax;
-		if (vecdatamin == vecdatamax)
-			recalculate_minmax = MB_YES;
-
-		/* loop over the points in the new vec */
-		shared.shareddata.vectors[ivec].npoints = npoint;
-		for (i=0;i<npoint;i++)
-			{
-			/* set status values */
-			shared.shareddata.vectors[ivec].vectorpts[i].selected = MB_NO;
-
-			/* set data */
-			shared.shareddata.vectors[ivec].vectorpts[i].data = vecdata[i];
-
-			/* get min max of data if necessary */
-			if (recalculate_minmax == MB_YES)
-				{
-				if (i == 0)
-					{
-					shared.shareddata.vectors[ivec].datamin = vecdata[i];
-					shared.shareddata.vectors[ivec].datamax = vecdata[i];
-					}
-				else
-					{
-					shared.shareddata.vectors[ivec].datamin = MIN(vecdata[i], shared.shareddata.vectors[ivec].datamin);
-					shared.shareddata.vectors[ivec].datamax = MAX(vecdata[i], shared.shareddata.vectors[ivec].datamax);
-					}
-				}
-
-			/* ************************************************* */
-			/* get vec positions in grid and display coordinates */
-			shared.shareddata.vectors[ivec].vectorpts[i].point.xlon = veclon[i];
-			shared.shareddata.vectors[ivec].vectorpts[i].point.ylat = veclat[i];
-			shared.shareddata.vectors[ivec].vectorpts[i].point.zdata = vecz[i];
-			status = mbview_projectfromlonlat(instance,
-					shared.shareddata.vectors[ivec].vectorpts[i].point.xlon,
-					shared.shareddata.vectors[ivec].vectorpts[i].point.ylat,
-					shared.shareddata.vectors[ivec].vectorpts[i].point.zdata,
-					&(shared.shareddata.vectors[ivec].vectorpts[i].point.xgrid[instance]),
-					&(shared.shareddata.vectors[ivec].vectorpts[i].point.ygrid[instance]),
-					&(shared.shareddata.vectors[ivec].vectorpts[i].point.xdisplay[instance]),
-					&(shared.shareddata.vectors[ivec].vectorpts[i].point.ydisplay[instance]),
-					&(shared.shareddata.vectors[ivec].vectorpts[i].point.zdisplay[instance]));
-			mbview_updatepointw(instance, &(shared.shareddata.vectors[ivec].vectorpts[i].point));
-
-/*fprintf(stderr,"Depth: llz:%f %f %f   grid:%f %f   dpy:%f %f %f\n",
-shared.shareddata.vectors[ivec].vectorpts[i].point.xlon,
-shared.shareddata.vectors[ivec].vectorpts[i].point.ylat,
-shared.shareddata.vectors[ivec].vectorpts[i].point.zdata,
-shared.shareddata.vectors[ivec].vectorpts[i].point.xgrid[instance],
-shared.shareddata.vectors[ivec].vectorpts[i].point.ygrid[instance],
-shared.shareddata.vectors[ivec].vectorpts[i].point.xdisplay[instance],
-shared.shareddata.vectors[ivec].vectorpts[i].point.ydisplay[instance],
-shared.shareddata.vectors[ivec].vectorpts[i].point.zdisplay[instance]);*/
-
-			/* ************************************************* */
-			}
-
-		/* make vecs viewable */
-		data->vector_view_mode = MBV_VIEW_ON;
-
-		/* some info to terminal */
-		fprintf(stderr,"Added %d point vector with data bounds: min:%f max:%f\n",
-			shared.shareddata.vectors[ivec].npoints,
-			shared.shareddata.vectors[ivec].datamin,
-			shared.shareddata.vectors[ivec].datamax);
-		}
-
-	/* print vec debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  vec data altered in function <%s>\n",
-			function_name);
-		fprintf(stderr,"dbg2  vec values:\n");
-		fprintf(stderr,"dbg2       vector_mode:        %d\n",shared.shareddata.vector_mode);
-		fprintf(stderr,"dbg2       vector_view_mode:      %d\n",data->vector_view_mode);
-		fprintf(stderr,"dbg2       nvector:               %d\n",shared.shareddata.nvector);
-		fprintf(stderr,"dbg2       nvector_alloc:         %d\n",shared.shareddata.nvector_alloc);
-		fprintf(stderr,"dbg2       vector_selected:       %d\n",shared.shareddata.vector_selected);
-		fprintf(stderr,"dbg2       vector_point_selected: %d\n",shared.shareddata.vector_point_selected);
-		for (i=0;i<shared.shareddata.nvector;i++)
-			{
-			fprintf(stderr,"dbg2       vec %d color:         %d\n",i,shared.shareddata.vectors[i].color);
-			fprintf(stderr,"dbg2       vec %d size:          %d\n",i,shared.shareddata.vectors[i].size);
-			fprintf(stderr,"dbg2       vec %d name:          %s\n",i,shared.shareddata.vectors[i].name);
-			fprintf(stderr,"dbg2       vec %d npoints:       %d\n",i,shared.shareddata.vectors[i].npoints);
-			fprintf(stderr,"dbg2       vec %d npoints_alloc: %d\n",i,shared.shareddata.vectors[i].npoints_alloc);
-			fprintf(stderr,"dbg2       vec %d nselected:     %d\n",i,shared.shareddata.vectors[i].nselected);
-			for (j=0;j<shared.shareddata.vectors[i].npoints;j++)
-				{
-				fprintf(stderr,"dbg2       vec %d %d selected: %d\n",i,j,shared.shareddata.vectors[i].vectorpts[j].selected);
-				fprintf(stderr,"dbg2       vec %d %d data:     %f\n",i,j,shared.shareddata.vectors[i].vectorpts[j].data);
-
-				fprintf(stderr,"dbg2       vec %d %d xgrid:    %f\n",i,j,shared.shareddata.vectors[i].vectorpts[j].point.xgrid[instance]);
-				fprintf(stderr,"dbg2       vec %d %d ygrid:    %f\n",i,j,shared.shareddata.vectors[i].vectorpts[j].point.ygrid[instance]);
-				fprintf(stderr,"dbg2       vec %d %d xlon:     %f\n",i,j,shared.shareddata.vectors[i].vectorpts[j].point.xlon);
-				fprintf(stderr,"dbg2       vec %d %d ylat:     %f\n",i,j,shared.shareddata.vectors[i].vectorpts[j].point.ylat);
-				fprintf(stderr,"dbg2       vec %d %d zdata:    %f\n",i,j,shared.shareddata.vectors[i].vectorpts[j].point.zdata);
-				fprintf(stderr,"dbg2       vec %d %d xdisplay: %f\n",i,j,shared.shareddata.vectors[i].vectorpts[j].point.xdisplay[instance]);
-				fprintf(stderr,"dbg2       vec %d %d ydisplay: %f\n",i,j,shared.shareddata.vectors[i].vectorpts[j].point.ydisplay[instance]);
-				fprintf(stderr,"dbg2       vec %d %d zdisplay: %f\n",i,j,shared.shareddata.vectors[i].vectorpts[j].point.zdisplay[instance]);
-				}
-			for (j=0;j<shared.shareddata.vectors[i].npoints-1;j++)
-				{
-				fprintf(stderr,"dbg2       vec %d %d nls:          %d\n",i,j,shared.shareddata.vectors[i].segments[j].nls);
-				fprintf(stderr,"dbg2       vec %d %d nls_alloc:    %d\n",i,j,shared.shareddata.vectors[i].segments[j].nls_alloc);
-				fprintf(stderr,"dbg2       vec %d %d endpoints[0]: %p\n",i,j,&shared.shareddata.vectors[i].segments[j].endpoints[0]);
-				fprintf(stderr,"dbg2       vec %d %d endpoints[1]: %p\n",i,j,&shared.shareddata.vectors[i].segments[j].endpoints[1]);
-				}
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:                     %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:                    %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-
-
-/*------------------------------------------------------------------------------*/
-int mbview_enableviewvectors(int verbose, size_t instance,
-			int *error)
-
-{
-	/* local variables */
-	char	*function_name = "mbview_enableviewvectors";
-	int	status = MB_SUCCESS;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-
-	/* print starting debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:                   %d\n", verbose);
-		fprintf(stderr,"dbg2       instance:                  %zu\n", instance);
-		}
-
-	/* set values */
-        shared.shareddata.vector_mode = MBV_VECTOR_VIEW;
-
-	/* set widget sensitivity on all active instances */
-	for (instance=0;instance<MBV_MAX_WINDOWS;instance++)
-		{
-		/* get view */
-		view = &(mbviews[instance]);
-		data = &(view->data);
-
-		/* if instance active reset action sensitivity */
-		if (data->active == MB_YES)
-			mbview_update_sensitivity(verbose, instance, error);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:                     %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:                    %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-
-/*------------------------------------------------------------------------------*/
-int mbview_pick_vector_select(size_t instance, int select, int which, int xpixel, int ypixel)
-{
-
-	/* local variables */
-	char	*function_name = "mbview_pick_vector_select";
-	int	status = MB_SUCCESS;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-	int	found;
-	double	xgrid, ygrid;
-	double	xlon, ylat, zdata;
-	double	xdisplay, ydisplay, zdisplay;
-	double	xx, yy, rr, rrmin;
-	int	i, j;
-
-	/* print starting debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       instance:         %zu\n",instance);
-		fprintf(stderr,"dbg2       select:           %d\n",select);
-		fprintf(stderr,"dbg2       which:            %d\n",which);
-		fprintf(stderr,"dbg2       xpixel:           %d\n",xpixel);
-		fprintf(stderr,"dbg2       ypixel:           %d\n",ypixel);
-		}
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* only select one vector point if enabled and not in move mode */
-	if (shared.shareddata.vector_mode != MBV_VECTOR_OFF
-		&& shared.shareddata.nvector > 0
-		&& (which == MBV_PICK_DOWN
-			|| shared.shareddata.vector_selected == MBV_SELECT_NONE))
-		{
-		/* look for point */
-		mbview_findpoint(instance, xpixel, ypixel,
-				&found,
-				&xgrid, &ygrid,
-				&xlon, &ylat, &zdata,
-				&xdisplay, &ydisplay, &zdisplay);
-
-		/* look for nearest vec point */
-		if (found)
-			{
-			rrmin = 1000000000.0;
-			shared.shareddata.vector_selected = MBV_SELECT_NONE;
-			shared.shareddata.vector_point_selected = MBV_SELECT_NONE;
-
-			for (i=0;i<shared.shareddata.nvector;i++)
-				{
-				for (j=0;j<shared.shareddata.vectors[i].npoints;j++)
-					{
-					xx = xgrid - shared.shareddata.vectors[i].vectorpts[j].point.xgrid[instance];
-					yy = ygrid - shared.shareddata.vectors[i].vectorpts[j].point.ygrid[instance];
-					rr = sqrt(xx * xx + yy * yy);
-					if (rr < rrmin)
-						{
-						rrmin = rr;
-						shared.shareddata.vector_selected = i;
-						shared.shareddata.vector_point_selected = j;
-						}
-					}
-				}
-			}
-		else
-			{
-			/* unselect vec pick */
-			data->pickinfo_mode = data->pick_type;
-			shared.shareddata.vector_selected = MBV_SELECT_NONE;
-			shared.shareddata.vector_point_selected = MBV_SELECT_NONE;
-			XBell(view->dpy,100);
-			}
-		}
-
-	/* else beep */
-	else
-		{
-		shared.shareddata.vector_selected = MBV_SELECT_NONE;
-		shared.shareddata.vector_point_selected = MBV_SELECT_NONE;
-		XBell(view->dpy,100);
-		for (i=0;i<shared.shareddata.nvector;i++)
-			{
-			for (j=0;j<shared.shareddata.vectors[i].npoints;j++)
-				{
-				shared.shareddata.vectors[i].vectorpts[j].selected = MB_NO;
-				}
-			}
-		}
-
-	/* set what kind of pick to annotate */
-	if (shared.shareddata.vector_selected != MBV_SELECT_NONE)
-		{
-		data->pickinfo_mode = MBV_PICK_VECTOR;
-		}
-	else
-		{
-		data->pickinfo_mode = data->pick_type;
-		}
-
-	/* set pick annotation */
-	mbview_pick_text(instance);
-
-	/* call pick notify if defined */
-	if (which == MBV_PICK_UP && shared.shareddata.vector_selected != MBV_SELECT_NONE
-		&& data->mbview_pickvector_notify != NULL)
-		{
-		(data->mbview_pickvector_notify)(instance);
-		}
-
-	/* print vec debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  vec data altered in function <%s>\n",
-			function_name);
-		fprintf(stderr,"dbg2  vec values:\n");
-		fprintf(stderr,"dbg2       vector_mode:           %d\n",shared.shareddata.vector_mode);
-		fprintf(stderr,"dbg2       vector_view_mode:         %d\n",data->vector_view_mode);
-		fprintf(stderr,"dbg2       nvector:                  %d\n",shared.shareddata.nvector);
-		fprintf(stderr,"dbg2       nvector_alloc:            %d\n",shared.shareddata.nvector_alloc);
-		fprintf(stderr,"dbg2       vector_selected:       %d\n",shared.shareddata.vector_selected);
-		fprintf(stderr,"dbg2       vector_point_selected: %d\n",shared.shareddata.vector_point_selected);
-		for (i=0;i<shared.shareddata.nvector;i++)
-			{
-			fprintf(stderr,"dbg2       vec %d color:         %d\n",i,shared.shareddata.vectors[i].color);
-			fprintf(stderr,"dbg2       vec %d size:          %d\n",i,shared.shareddata.vectors[i].size);
-			fprintf(stderr,"dbg2       vec %d name:          %s\n",i,shared.shareddata.vectors[i].name);
-			fprintf(stderr,"dbg2       vec %d npoints:       %d\n",i,shared.shareddata.vectors[i].npoints);
-			fprintf(stderr,"dbg2       vec %d npoints_alloc: %d\n",i,shared.shareddata.vectors[i].npoints_alloc);
-			fprintf(stderr,"dbg2       vec %d nselected:     %d\n",i,shared.shareddata.vectors[i].nselected);
-			for (j=0;j<shared.shareddata.vectors[i].npoints;j++)
-				{
-				fprintf(stderr,"dbg2       vec %d %d selected: %d\n",i,j,shared.shareddata.vectors[i].vectorpts[j].selected);
-				fprintf(stderr,"dbg2       vec %d %d data:     %f\n",i,j,shared.shareddata.vectors[i].vectorpts[j].data);
-
-				fprintf(stderr,"dbg2       vec %d %d xgrid:    %f\n",i,j,shared.shareddata.vectors[i].vectorpts[j].point.xgrid[instance]);
-				fprintf(stderr,"dbg2       vec %d %d ygrid:    %f\n",i,j,shared.shareddata.vectors[i].vectorpts[j].point.ygrid[instance]);
-				fprintf(stderr,"dbg2       vec %d %d xlon:     %f\n",i,j,shared.shareddata.vectors[i].vectorpts[j].point.xlon);
-				fprintf(stderr,"dbg2       vec %d %d ylat:     %f\n",i,j,shared.shareddata.vectors[i].vectorpts[j].point.ylat);
-				fprintf(stderr,"dbg2       vec %d %d zdata:    %f\n",i,j,shared.shareddata.vectors[i].vectorpts[j].point.zdata);
-				fprintf(stderr,"dbg2       vec %d %d xdisplay: %f\n",i,j,shared.shareddata.vectors[i].vectorpts[j].point.xdisplay[instance]);
-				fprintf(stderr,"dbg2       vec %d %d ydisplay: %f\n",i,j,shared.shareddata.vectors[i].vectorpts[j].point.ydisplay[instance]);
-				fprintf(stderr,"dbg2       vec %d %d zdisplay: %f\n",i,j,shared.shareddata.vectors[i].vectorpts[j].point.zdisplay[instance]);
-
-				}
-			for (j=0;j<shared.shareddata.vectors[i].npoints-1;j++)
-				{
-				fprintf(stderr,"dbg2       vec %d %d nls:          %d\n",i,j,shared.shareddata.vectors[i].segments[j].nls);
-				fprintf(stderr,"dbg2       vec %d %d nls_alloc:    %d\n",i,j,shared.shareddata.vectors[i].segments[j].nls_alloc);
-				fprintf(stderr,"dbg2       vec %d %d endpoints[0]: %p\n",i,j,&shared.shareddata.vectors[i].segments[j].endpoints[0]);
-				fprintf(stderr,"dbg2       vec %d %d endpoints[1]: %p\n",i,j,&shared.shareddata.vectors[i].segments[j].endpoints[1]);
-				}
-			}
-		}
-
-	/* print output debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:          %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-
-/*------------------------------------------------------------------------------*/
-int mbview_vector_delete(size_t instance, int ivec)
-{
-
-	/* local variables */
-	char	*function_name = "mbview_vector_delete";
-	int	error = MB_ERROR_NO_ERROR;
-	int	status = MB_SUCCESS;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-	int	i;
-
-	/* print starting debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       ivec:            %d\n",ivec);
-		fprintf(stderr,"dbg2       instance:         %zu\n",instance);
-		}
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* delete vec if its the same as previously selected */
-	if (ivec >= 0 && ivec < shared.shareddata.nvector)
-		{
-		/* free memory for deleted vec */
-		mb_freed(mbv_verbose,__FILE__,__LINE__,
-				(void **)&(shared.shareddata.vectors[ivec].vectorpts), &error);
-		mb_freed(mbv_verbose,__FILE__,__LINE__,
-				(void **)&(shared.shareddata.vectors[ivec].segments), &error);
-
-		/* move vec data if necessary */
-		for (i=ivec;i<shared.shareddata.nvector-1;i++)
-			{
-			shared.shareddata.vectors[i] = shared.shareddata.vectors[i+1];
-			}
-
-		/* rest last vec */
-		shared.shareddata.vectors[shared.shareddata.nvector-1].color = MBV_COLOR_RED;
-		shared.shareddata.vectors[shared.shareddata.nvector-1].size = 4;
-		shared.shareddata.vectors[shared.shareddata.nvector-1].name[0] = '\0';
-		shared.shareddata.vectors[shared.shareddata.nvector-1].npoints = 0;
-		shared.shareddata.vectors[shared.shareddata.nvector-1].npoints_alloc = 0;
-		shared.shareddata.vectors[shared.shareddata.nvector-1].vectorpts = NULL;
-		shared.shareddata.vectors[shared.shareddata.nvector-1].segments = NULL;
-
-		/* set nvector */
-		shared.shareddata.nvector--;
-
-		/* no selection */
-		shared.shareddata.vector_selected = MBV_SELECT_NONE;
-		}
-	else
-		{
-		status = MB_FAILURE;
-		}
-
-	/* print output debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:          %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-
-
-/*------------------------------------------------------------------------------*/
-int mbview_drawvector(size_t instance, int rez)
-{
-	/* local variables */
-	char	*function_name = "mbview_drawvector";
-	int	status = MB_SUCCESS;
-	struct mbview_world_struct *view;
-	struct mbview_struct *data;
-	GLUquadricObj *globj;
-	int	stride;
-	int	icolor;
-	int	ivec, jpoint;
-	float	red, green, blue;
-	double	xx, yy;
-	double	ballsize;
-	int	k0, k1;
-
-	/* print starting debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       instance:         %zu\n",instance);
-		fprintf(stderr,"dbg2       rez:              %d\n",rez);
-		}
-
-	/* get view */
-	view = &(mbviews[instance]);
-	data = &(view->data);
-
-	/* set decimation */
-	if (rez == MBV_REZ_FULL)
-	    stride = 1;
-	else if (rez == MBV_REZ_HIGH)
-	    stride = data->hirez_navdecimate;
-	else
-	    stride = data->lorez_navdecimate;
-
-	/* draw vectors */
-	if (shared.shareddata.vector_mode != MBV_VECTOR_OFF
-		&& data->vector_view_mode == MBV_VIEW_ON
-		&& shared.shareddata.nvector > 0)
-		{
-		/* get size according to viewbounds */
-		k0 = data->viewbounds[0] * data->primary_ny + data->viewbounds[2];
-		k1 = data->viewbounds[1] * data->primary_ny + data->viewbounds[3];
-		xx = data->primary_x[k1] - data->primary_x[k0];
-		yy = data->primary_y[k1] - data->primary_y[k0];
-		ballsize = 0.001 * sqrt(xx * xx + yy * yy);
-
-		/* make list for ball */
-	    	glNewList((GLuint)MBV_GLLIST_VECTORBALL, GL_COMPILE);
-		globj = gluNewQuadric();
-		gluSphere(globj, ballsize, 10, 10);
-		gluDeleteQuadric(globj);
-		glEndList();
-
-		/* loop over the vecs plotting xyz vectors */
-		for (ivec=0;ivec<shared.shareddata.nvector;ivec++)
-			{
-			icolor = shared.shareddata.vectors[ivec].color;
-
-			/* plot lines */
-			/* glLineWidth((float)(shared.shareddata.vectors[ivec].size));
-			glBegin(GL_LINE_STRIP); */
-
-			/* plot balls */
-			for (jpoint=0;jpoint<shared.shareddata.vectors[ivec].npoints;jpoint+=stride)
-				{
-				/* set color */
-				mbview_getcolor(shared.shareddata.vectors[ivec].vectorpts[jpoint].data,
-						shared.shareddata.vectors[ivec].datamax,
-						shared.shareddata.vectors[ivec].datamin,
-						MBV_COLORTABLE_NORMAL,
-	    				    (float) 0.0, (float) 0.0, (float) 1.0,
-	    				    (float) 0.0, (float) 0.0, (float) 0.0,
-					    colortable_bright_red,
-					    colortable_bright_green,
-					    colortable_bright_blue,
-					    &red, &green, &blue);
-				if (shared.shareddata.vectors[ivec].vectorpts[jpoint].selected == MB_YES
-					|| (jpoint < shared.shareddata.vectors[ivec].npoints - 1
-						&& shared.shareddata.vectors[ivec].vectorpts[jpoint+1].selected == MB_YES))
-					{
-					glColor3f(colortable_object_red[MBV_COLOR_RED],
-						colortable_object_green[MBV_COLOR_RED],
-						colortable_object_blue[MBV_COLOR_RED]);
-					}
-				else
-					{
-					glColor3f(red, green, blue);
-					}
-
-				/* draw points in line */
-				/* glVertex3f((float)(shared.shareddata.vectors[ivec].vectorpts[jpoint].point.xdisplay[instance]),
-						(float)(shared.shareddata.vectors[ivec].vectorpts[jpoint].point.ydisplay[instance]),
-						(float)(shared.shareddata.vectors[ivec].vectorpts[jpoint].point.zdisplay[instance])); */
-
-				/* draw points as balls */
-				glTranslatef((float)(shared.shareddata.vectors[ivec].vectorpts[jpoint].point.xdisplay[instance]),
-						(float)(shared.shareddata.vectors[ivec].vectorpts[jpoint].point.ydisplay[instance]),
-						(float)(shared.shareddata.vectors[ivec].vectorpts[jpoint].point.zdisplay[instance]));
-	    			glCallList((GLuint)MBV_GLLIST_VECTORBALL);
-				glTranslatef((float)(-shared.shareddata.vectors[ivec].vectorpts[jpoint].point.xdisplay[instance]),
-						(float)(-shared.shareddata.vectors[ivec].vectorpts[jpoint].point.ydisplay[instance]),
-						(float)(-shared.shareddata.vectors[ivec].vectorpts[jpoint].point.zdisplay[instance]));
-				}
-			/* glEnd();*/
-			}
-		}
-
-#ifdef MBV_GETERRORS
-mbview_glerrorcheck(instance, 1, function_name);
-#endif
-
-	/* print output debug statements */
-	if (mbv_verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-/*------------------------------------------------------------------------------*/
diff --git a/src/mbview/mbviewprivate.h b/src/mbview/mbviewprivate.h
deleted file mode 100644
index 59b7b76..0000000
--- a/src/mbview/mbviewprivate.h
+++ /dev/null
@@ -1,1127 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbviewprivate.h	9/24/2003
- *    $Id: mbviewprivate.h 2247 2015-05-29 21:28:28Z caress $
- *
- *    Copyright (c) 2003-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- *
- * Author:	D. W. Caress
- * Date:	September 24,  2003
- *
- *
- */
-
-/*--------------------------------------------------------------------*/
-
-/* OpenGL Error checking */
-/* #define MBV_GET_GLX_ERRORS	1 */
-/* #define MBV_DEBUG_GLX		1 */
-
-/* OpenGL plotting parameters */
-#define LEFT_WIDTH 200
-#define LEFT_HEIGHT 30
-#define MBV_OPENGL_WIDTH 3.0
-#define MBV_OPENGL_ZMIN2D -5.0
-#define MBV_OPENGL_ZMAX2D 1000.0
-#define MBV_OPENGL_ZMIN3D 100000.0
-#define MBV_OPENGL_ZMAX3D 100000000.0
-#define MBV_OPENGL_3D_CONTOUR_OFFSET 0.001
-#define MBV_OPENGL_3D_LINE_OFFSET 0.005
-#define MBV_OPENGL_ZPROFILE1 -100.0
-#define MBV_OPENGL_ZPROFILE2 -200.0
-
-/* OpenGL list IDs */
-#define MBV_GLLIST_SITESMALL  (3 * MBV_MAX_WINDOWS + 0)
-#define MBV_GLLIST_SITELARGE  (3 * MBV_MAX_WINDOWS + 1)
-#define MBV_GLLIST_ROUTESMALL (3 * MBV_MAX_WINDOWS + 2)
-#define MBV_GLLIST_ROUTELARGE (3 * MBV_MAX_WINDOWS + 3)
-#define MBV_GLLIST_VECTORBALL (3 * MBV_MAX_WINDOWS + 4)
-
-#define MBV_REZ_NONE 	0
-#define MBV_REZ_LOW 	1
-#define MBV_REZ_HIGH 	2
-#define MBV_REZ_FULL 	3
-#define MBV_BOUNDSFREQUENCY 25
-#define MBV_EVENTCHECKCOARSENESS	5
-
-#define	MBV_NUMBACKGROUNDCALC	500
-#define	MBV_BACKGROUND_NONE	0
-#define	MBV_BACKGROUND_ZSCALE	1
-#define	MBV_BACKGROUND_COLOR	2
-#define	MBV_BACKGROUND_FULLPLOT	3
-
-#define MBV_PICK_IDIVISION 15
-#define MBV_PICK_DIVISION ((double)MBV_PICK_IDIVISION)
-#define MBV_PICK_DOWN	1
-#define MBV_PICK_MOVE	2
-#define MBV_PICK_UP	3
-#define MBV_AREALENGTH_DOWN	1
-#define MBV_AREALENGTH_MOVE	2
-#define MBV_AREALENGTH_UP	3
-#define MBV_AREAASPECT_CHANGE	4
-#define MBV_AREAASPECT_UP	5
-#define MBV_REGION_DOWN	1
-#define MBV_REGION_MOVE	2
-#define MBV_REGION_UP	3
-
-#define MBV_WINDOW_NULL 	0
-#define MBV_WINDOW_HIDDEN 	1
-#define MBV_WINDOW_VISIBLE 	2
-
-#define MBV_RAW_HISTOGRAM_DIM 	1000
-
-#define MBV_WINDOW_HEIGHT_THRESHOLD 	700
-
-#define	MBV_NUM_COLORS   11
-
-#define	MBV_NUM_ACTIONS   20
-
-/* Spheroid parameters */
-#define	MBV_SPHEROID_RADIUS   6371000.0
-
-/* structure to hold single mbview windows */
-struct mbview_shared_struct
-    {
-    /* flags if list windows are initialized */
-    int			init_sitelist;
-    int			init_routelist;
-    int			init_navlist;
-
-    /* global lon lat print style */
-    int	lonlatstyle;
-
-    /* pointer to structure holding global data */
-    struct mbview_shareddata_struct shareddata;
-
-    /* widgets and other Xwindows stuff of interest */
-    Widget		topLevelShell_sitelist;
-    Widget		mainWindow_sitelist;
-    MB3DSiteListData	mb3d_sitelist;
-    Widget		topLevelShell_routelist;
-    Widget		mainWindow_routelist;
-    MB3DRouteListData	mb3d_routelist;
-    Widget		topLevelShell_navlist;
-    Widget		mainWindow_navlist;
-    MB3DNavListData	mb3d_navlist;
-    };
-
-
-/* structure to hold instances of mbview windows */
-struct mbview_world_struct
-    {
-    /* flag if this instance is initialized */
-    int			init;
-
-    /* pointer to structure holding data to be rendered */
-    struct mbview_struct data;
-
-    /* widgets and other Xwindows stuff of interest */
-    Widget		topLevelShell;
-    Widget		mainWindow;
-    Widget		glwmda;
-    MB3DViewData	mb3dview;
-    Display		*dpy;
-    Window		xid;
-    XVisualInfo 	*vi;
-    int			glx_init;
-#ifdef WIN32
-    HGLRC		glx_context;
-#else
-    GLXContext		glx_context;
-#endif
-    int			message_on;
-    int			plot_recursion;
-    int			plot_done;
-    int			plot_interrupt_allowed;
-    int			naction;
-    int			actionsensitive[MBV_NUM_ACTIONS];
-    Widget		pushButton_action[MBV_NUM_ACTIONS];
-    Widget		prglwmda;
-    XVisualInfo 	*prvi;
-    int			prglx_init;
-#ifdef WIN32
-    HGLRC		prglx_context;
-#else
-    GLXContext		prglx_context;
-#endif
-    float 		praspect_ratio;
-
-    /* cursors */
-    Cursor TargetBlackCursor;
-    Cursor TargetGreenCursor;
-    Cursor TargetRedCursor;
-    Cursor FleurBlackCursor;
-    Cursor FleurRedCursor;
-    Cursor SizingBlackCursor;
-    Cursor SizingRedCursor;
-    Cursor BoatBlackCursor;
-    Cursor BoatRedCursor;
-    Cursor WatchBlackCursor;
-    Cursor WatchRedCursor;
-
-    /* projections */
-    int primary_pj_init;
-    void *primary_pjptr;
-    int secondary_pj_init;
-    void *secondary_pjptr;
-    int display_pj_init;
-    void *display_pjptr;
-    double mtodeglon;
-    double mtodeglat;
-    double sphere_reflon;
-    double sphere_reflat;
-    double sphere_refx;
-    double sphere_refy;
-    double sphere_refz;
-    double sphere_eulerforward[9];
-    double sphere_eulerreverse[9];
-
-    /* drawing variables */
-    Dimension gl_width;
-    Dimension gl_height;
-    float gl_xmin;
-    float right;
-    float left;
-    float top;
-    float bottom;
-    float aspect_ratio;
-    int projected;
-    int	globalprojected;
-    int lastdrawrez;
-    int	viewboundscount;
-    int	zscaledonecount;
-    int	colordonecount;
-    int contourlorez;
-    int contourhirez;
-    int contourfullrez;
-
-    /* color and shade variables */
-    double min;
-    double max;
-    double minuse;
-    double maxuse;
-    double mag2;
-    double illum_x;
-    double illum_y;
-    double illum_z;
-    double intensity;
-    int colortable;
-    int colortable_mode;
-    float *colortable_red;
-    float *colortable_blue;
-    float *colortable_green;
-    int	shade_mode;
-    double sign;
-    int	primary_histogram_set;
-    int	primaryslope_histogram_set;
-    int	secondary_histogram_set;
-    float primary_histogram[3*MBV_NUM_COLORS];
-    float primaryslope_histogram[3*MBV_NUM_COLORS];
-    float secondary_histogram[3*MBV_NUM_COLORS];
-
-    /* grid display bounds */
-    double xmin;
-    double xmax;
-    double ymin;
-    double ymax;
-    double xorigin;
-    double yorigin;
-    double zorigin;
-    double scale;
-
-    /* relevant mbio defaults */
-    int lonflip;
-    double timegap;
-
-    float offset2d_x;
-    float offset2d_y;
-    float offset2d_x_save;
-    float offset2d_y_save;
-    float size2d;
-    float size2d_save;
-    float offset3d_x;
-    float offset3d_y;
-    float offset3d_z;
-    float viewoffset3d_z;
-    float offset3d_x_save;
-    float offset3d_y_save;
-    float offset3d_z_save;
-    float viewoffset3d_z_save;
-    float areaaspect;
-    float areaaspect_save;
-    double exageration_save;
-    double modelelevation3d_save;
-    double modelazimuth3d_save;
-    double viewelevation3d_save;
-    double viewazimuth3d_save;
-    double illuminate_magnitude_save;
-    double illuminate_elevation_save;
-    double illuminate_azimuth_save;
-    double slope_magnitude_save;
-    double overlay_shade_magnitude_save;
-
-    /* button parameters */
-    int button1down;
-    int button2down;
-    int button3down;
-    int button_down_x;
-    int button_down_y;
-    int button_move_x;
-    int button_move_y;
-    int button_up_x;
-    int button_up_y;
-    };
-
-/* library variables */
-/*   note that global mbview variables will only be defined when
-     this code is included in mbview_callbacks.c where the
-     MBVIEWGLOBAL flag is defined - other blocks of code will
-     have these variables declared as extern  */
-#ifdef MBVIEWGLOBAL
-#define MBVIEW_EXTERNAL
-#else
-#define MBVIEW_EXTERNAL extern
-#endif
-
-/* general library global variables */
-MBVIEW_EXTERNAL int	mbv_verbose;
-MBVIEW_EXTERNAL int	mbv_ninstance;
-MBVIEW_EXTERNAL Widget	parent_widget;
-MBVIEW_EXTERNAL XtAppContext	app_context;
-MBVIEW_EXTERNAL int	work_function_enabled;
-MBVIEW_EXTERNAL int	work_function_set;
-MBVIEW_EXTERNAL unsigned long	timer_timeout_time;
-MBVIEW_EXTERNAL int	timer_timeout_count;
-MBVIEW_EXTERNAL int	timer_count;
-MBVIEW_EXTERNAL struct mbview_world_struct mbviews[MBV_MAX_WINDOWS];
-MBVIEW_EXTERNAL struct mbview_shared_struct shared;
-MBVIEW_EXTERNAL char	*mbsystem_library_name;
-
-/* global declarations */
-#ifdef MBVIEWGLOBAL
-
-/* library colortables */
-float	colortable_haxby_red[MBV_NUM_COLORS] =
-                { 0.950, 1.000, 1.000, 1.000, 0.941, 0.804,
-                  0.541, 0.416, 0.196, 0.157, 0.145 };
-float	colortable_haxby_green[MBV_NUM_COLORS] =
-                { 0.950, 0.729, 0.631, 0.741, 0.925, 1.000,
-                  0.925, 0.922, 0.745, 0.498, 0.224 };
-float	colortable_haxby_blue[MBV_NUM_COLORS] =
-                { 0.950, 0.522, 0.267, 0.341, 0.475, 0.635,
-                  0.682, 1.000, 1.000, 0.984, 0.686 };
-float	colortable_bright_red[MBV_NUM_COLORS] =
-                { 1.000, 1.000, 1.000, 1.000, 0.500, 0.000,
-                  0.000, 0.000, 0.000, 0.500, 1.000 };
-float	colortable_bright_green[MBV_NUM_COLORS] =
-                { 0.000, 0.250, 0.500, 1.000, 1.000, 1.000,
-                  1.000, 0.500, 0.000, 0.000, 0.000 };
-float	colortable_bright_blue[MBV_NUM_COLORS] =
-                { 0.000, 0.000, 0.000, 0.000, 0.000, 0.000,
-                  1.000, 1.000, 1.000, 1.000, 1.000 };
-float	colortable_muted_red[MBV_NUM_COLORS] =
-                { 0.784, 0.761, 0.702, 0.553, 0.353, 0.000,
-                  0.000, 0.000, 0.000, 0.353, 0.553 };
-float	colortable_muted_green[MBV_NUM_COLORS] =
-                { 0.000, 0.192, 0.353, 0.553, 0.702, 0.784,
-                  0.553, 0.353, 0.000, 0.000, 0.000 };
-float	colortable_muted_blue[MBV_NUM_COLORS] =
-                { 0.000, 0.000, 0.000, 0.000, 0.000, 0.000,
-                  0.553, 0.702, 0.784, 0.702, 0.553 };
-float	colortable_gray_red[MBV_NUM_COLORS] =
-                { 0.000, 0.100, 0.200, 0.300, 0.400, 0.500,
-                  0.600, 0.700, 0.800, 0.900, 1.000 };
-float	colortable_gray_green[MBV_NUM_COLORS] =
-                { 0.000, 0.100, 0.200, 0.300, 0.400, 0.500,
-                  0.600, 0.700, 0.800, 0.900, 1.000 };
-float	colortable_gray_blue[MBV_NUM_COLORS] =
-                { 0.000, 0.100, 0.200, 0.300, 0.400, 0.500,
-                  0.600, 0.700, 0.800, 0.900, 1.000 };
-float	colortable_flat_red[MBV_NUM_COLORS] =
-                { 0.500, 0.500, 0.500, 0.500, 0.500, 0.500,
-                  0.500, 0.500, 0.500, 0.500, 0.500 };
-float	colortable_flat_green[MBV_NUM_COLORS] =
-                { 0.500, 0.500, 0.500, 0.500, 0.500, 0.500,
-                  0.500, 0.500, 0.500, 0.500, 0.500 };
-float	colortable_flat_blue[MBV_NUM_COLORS] =
-                { 0.500, 0.500, 0.500, 0.500, 0.500, 0.500,
-                  0.500, 0.500, 0.500, 0.500, 0.500 };
-float	colortable_abovesealevel1_red[MBV_NUM_COLORS+1] =
-                { 0.980, 0.960, 0.941, 0.921, 0.902, 0.882,
-		  0.862, 0.843, 0.823, 0.804, 0.784};
-float	colortable_abovesealevel1_green[MBV_NUM_COLORS+1] =
-                { 0.980, 0.940, 0.901, 0.862, 0.823, 0.784,
-		  0.744, 0.705, 0.666, 0.627, 0.588};
-float	colortable_abovesealevel1_blue[MBV_NUM_COLORS+1] =
-                { 0.471, 0.440, 0.408, 0.376, 0.345, 0.314,
-		  0.282, 0.250, 0.219, 0.188, 0.157};
-float	colortable_abovesealevel2_red[MBV_NUM_COLORS+1] =
-                { 1.000, 0.824, 0.667, 0.569, 0.471, 0.471,
-		  0.408, 0.263, 0.129, 0.000, 0.000};
-float	colortable_abovesealevel2_green[MBV_NUM_COLORS+1] =
-                { 1.000, 0.784, 0.627, 0.569, 0.510, 0.392,
-		  0.420, 0.482, 0.549, 0.627, 0.902};
-float	colortable_abovesealevel2_blue[MBV_NUM_COLORS+1] =
-                { 0.392, 0.294, 0.196, 0.176, 0.157, 0.118,
-		  0.094, 0.027, 0.000, 0.000, 0.000};
-
-float	colortable_object_red[MBV_NUM_COLORS] =
-                { 0.000, 1.000, 1.000, 1.000, 0.000, 0.000,
-                  0.000, 1.000, 0.000, 0.000, 0.000 };
-float	colortable_object_green[MBV_NUM_COLORS] =
-                { 0.000, 1.000, 0.000, 1.000, 1.000, 1.000,
-                  0.000, 0.000, 0.000, 0.000, 0.000 };
-float	colortable_object_blue[MBV_NUM_COLORS] =
-                { 0.000, 1.000, 0.000, 0.000, 0.000, 1.000,
-                  1.000, 1.000, 0.000, 0.000, 0.000 };
-
-char	*mbview_colorname[MBV_NUM_COLORS] =
-		{ "Black",
-		  "White",
-		  "Red",
-		  "Yellow",
-		  "Green",
-		  "Blue-Green",
-		  "Blue",
-		  "Purple" };
-
-/* status mask arrays */
-char	statmask[8] = { MBV_STATMASK0,
-			MBV_STATMASK1,
-			MBV_STATMASK2,
-			MBV_STATMASK3,
-			MBV_STATMASK4,
-			MBV_STATMASK5,
-			MBV_STATMASK6,
-			MBV_STATMASK7};
-
-/* extern declarations */
-#else
-
-/* library colortables */
-extern float	colortable_haxby_red[MBV_NUM_COLORS];
-extern float	colortable_haxby_green[MBV_NUM_COLORS];
-extern float	colortable_haxby_blue[MBV_NUM_COLORS];
-extern float	colortable_bright_red[MBV_NUM_COLORS];
-extern float	colortable_bright_green[MBV_NUM_COLORS];
-extern float	colortable_bright_blue[MBV_NUM_COLORS];
-extern float	colortable_muted_red[MBV_NUM_COLORS];
-extern float	colortable_muted_green[MBV_NUM_COLORS];
-extern float	colortable_muted_blue[MBV_NUM_COLORS];
-extern float	colortable_gray_red[MBV_NUM_COLORS];
-extern float	colortable_gray_green[MBV_NUM_COLORS];
-extern float	colortable_gray_blue[MBV_NUM_COLORS];
-extern float	colortable_flat_red[MBV_NUM_COLORS];
-extern float	colortable_flat_green[MBV_NUM_COLORS];
-extern float	colortable_flat_blue[MBV_NUM_COLORS];
-extern float	colortable_abovesealevel1_red[MBV_NUM_COLORS+1];
-extern float	colortable_abovesealevel1_green[MBV_NUM_COLORS+1];
-extern float	colortable_abovesealevel1_blue[MBV_NUM_COLORS+1];
-extern float	colortable_abovesealevel2_red[MBV_NUM_COLORS+1];
-extern float	colortable_abovesealevel2_green[MBV_NUM_COLORS+1];
-extern float	colortable_abovesealevel2_blue[MBV_NUM_COLORS+1];
-extern float	colortable_object_red[MBV_NUM_COLORS+1];
-extern float	colortable_object_green[MBV_NUM_COLORS+1];
-extern float	colortable_object_blue[MBV_NUM_COLORS+1];
-extern char	*mbview_colorname[MBV_NUM_COLORS];
-
-/* status mask arrays */
-extern char	statmask[8];
-#endif
-
-/*--------------------------------------------------------------------*/
-
-/* mbview_callbacks.c function prototypes */
-int mbview_startup(int verbose, Widget parent, XtAppContext app, int *error);
-int mbview_reset_shared(int mode);
-int mbview_reset(size_t instance);
-int mbview_init(int verbose, size_t *instance, int *error);
-int mbview_quit(int verbose, int *error);
-int mbview_getdataptr(int verbose, size_t instance, struct mbview_struct **datahandle, int *error);
-int mbview_getsharedptr(int verbose, struct mbview_shareddata_struct **sharedhandle, int *error);
-int mbview_setwindowparms(int verbose, size_t instance,
-			int	(*mbview_dismiss_notify)(size_t),
-			char	*title,
-			int	xo,
-			int	yo,
-			int	width,
-			int	height,
-			int	lorez_dimension,
-			int	hirez_dimension,
-			int	lorez_navdecimate,
-			int	hirez_navdecimate,
-			int	*error);
-int mbview_setviewcontrols(int verbose, size_t instance,
-			int	display_mode,
-			int	mouse_mode,
-			int	grid_mode,
-			int	primary_histogram,
-			int	primaryslope_histogram,
-			int	secondary_histogram,
-			int	primary_shade_mode,
-			int	slope_shade_mode,
-			int	secondary_shade_mode,
-			int	grid_contour_mode,
-			int	site_view_mode,
-			int	route_view_mode,
-			int	nav_view_mode,
-			int	navdrape_view_mode,
-			int	vector_view_mode,
-			double	exageration,
-			double	modelelevation3d,
-			double	modelazimuth3d,
-			double	viewelevation3d,
-			double	viewazimuth3d,
-			double	illuminate_magnitude,
-			double	illuminate_elevation,
-			double	illuminate_azimuth,
-			double	slope_magnitude,
-			double	overlay_shade_magnitude,
-			double	overlay_shade_center,
-			int	overlay_shade_mode,
-			double	contour_interval,
-			int	display_projection_mode,
-			char	*display_projection_id,
-			int *error);
-int mbview_open(int verbose, size_t instance, int *error);
-int mbview_update(int verbose, size_t instance, int *error);
-int mbview_update_sensitivity(int verbose, size_t instance, int *error);
-int mbview_action_sensitivityall(void);
-int mbview_action_sensitivity(size_t instance);
-int mbview_set_widgets(int verbose, size_t instance, int *error);
-int mbview_addaction(int verbose, size_t instance,
-			void	(mbview_action_notify)(Widget, XtPointer, XtPointer),
-			char	*label,
-			int	sensitive,
-			int *error);
-int mbview_addpicknotify(int verbose, size_t instance,
-			int	picktype,
-			void	(mbview_pick_notify)(size_t),
-			int *error);
-int mbview_setsensitivitynotify(int verbose, size_t instance,
-			void	(mbview_sensitivity_notify)(),
-			int *error);
-void mbview_resize( Widget w, XtPointer client_data, XEvent *event, Boolean *unused);
-void do_mbview_projection_popup( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbview_set_projection_label(size_t instance);
-void do_mbview_projection_popdown( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbview_display_spheroid( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbview_display_geographic( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbview_display_utm( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbview_glwda_expose( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbview_glwda_resize( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbview_glwda_input( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbview_dismiss( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbview_goaway( Widget w, XtPointer client_data, XtPointer call_data);
-int mbview_destroy(int verbose, size_t instance, int destroywidgets, int *error);
-int mbview_quit(int verbose, int *error);
-void do_mbview_display_2D( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbview_display_3D( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbview_data_primary( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbview_data_primaryslope( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbview_data_secondary( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbview_histogram( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbview_overlay_none( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbview_overlay_slope( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbview_overlay_illumination( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbview_overlay_secondary( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbview_overlay_contour( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbview_site( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbview_route( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbview_nav( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbview_navdrape( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbview_vector( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbview_colortable_haxby( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbview_colortable_bright( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbview_colortable_muted( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbview_colortable_gray( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbview_colortable_flat( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbview_colortable_sealevel1( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbview_colortable_sealevel2( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbview_mouse_rmode( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbview_mouse_mode( Widget w, XtPointer client_data, XtPointer call_data);
-void set_mbview_mouse_mode(size_t instance, int mode);
-void set_mbview_grid_mode(size_t instance, int mode);
-void set_mbview_histogram_mode(size_t instance, int mode);
-void set_mbview_shade_mode(size_t instance, int mode);
-void set_mbview_contour_mode(size_t instance, int mode);
-void set_mbview_site_view_mode(size_t instance, int mode);
-void set_mbview_route_view_mode(size_t instance, int mode);
-void set_mbview_nav_view_mode(size_t instance, int mode);
-void set_mbview_navdrape_view_mode(size_t instance, int mode);
-void set_mbview_vector_view_mode(size_t instance, int mode);
-void set_mbview_display_mode(size_t instance, int mode);
-void set_mbview_colortable(size_t instance, int mode);
-void set_mbview_colortable_mode(size_t instance, int mode);
-void do_mbview_aboutpopdown( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbview_aboutpopup( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbview_colorboundspopup( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbview_colorboundspopdown( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbview_colorboundsapply( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbview_shadeparmspopup( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbview_shadeparmspopdown( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbview_shadeparmsapply( Widget w, XtPointer client_data, XtPointer call_data);
-int do_mbview_3dparmstext(size_t instance);
-void do_mbview_3dparmspopup( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbview_3dparmspopdown( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbview_3dparmsapply( Widget w, XtPointer client_data, XtPointer call_data);
-int do_mbview_2dparmstext(size_t instance);
-void do_mbview_2dparmspopup( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbview_2dparmspopdown( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbview_2dparmsapply( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbview_resolutionpopup( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbview_resolutionpopdown( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbview_resolutionchange( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbview_sitelistpopup( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbview_routelistpopup( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbview_navlistpopup( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbview_sitelistselect( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbview_routelistselect( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbview_navlistselect( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbview_sitelist_delete( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbview_routelist_delete( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbview_navlist_delete( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbview_sitelist_popdown( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbview_routelist_popdown( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbview_navlist_popdown( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbview_full_render( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbview_reset_view( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbview_clearpicks( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbview_profile_dismiss( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbview_view_profile( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbview_profile_resize( Widget w, XtPointer client_data, XEvent *event, Boolean *unused);
-void do_mbview_profile_exager( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbview_profile_width( Widget w, XtPointer client_data, XtPointer call_data);
-void do_mbview_profile_slope( Widget w, XtPointer client_data, XtPointer call_data);
-int do_mbview_status(char *message, size_t instance);
-int do_mbview_message_on(char *message, size_t instance);
-int do_mbview_message_off(size_t instance);
-void set_mbview_label_string(Widget w, String str);
-void set_mbview_label_multiline_string(Widget w, String str);
-void get_mbview_text_string(Widget w, String str);
-void do_mbview_xevents(void);
-int do_mbview_setbackgroundwork(size_t instance);
-int do_mbview_settimer(void);
-int do_mbview_workfunction(XtPointer client_data);
-
-/* mbview_primary.c function prototypes */
-int mbview_setprimarygrid(int verbose, size_t instance,
-			int	primary_grid_projection_mode,
-			char	*primary_grid_projection_id,
-			float	primary_nodatavalue,
-			int	primary_nx,
-			int	primary_ny,
-			double	primary_min,
-			double	primary_max,
-			double	primary_xmin,
-			double	primary_xmax,
-			double	primary_ymin,
-			double	primary_ymax,
-			double	primary_dx,
-			double	primary_dy,
-			float	*primary_data,
-			int *error);
-int mbview_updateprimarygrid(int verbose, size_t instance,
-			int	primary_nx,
-			int	primary_ny,
-			float	*primary_data,
-			int *error);
-int mbview_updateprimarygridcell(int verbose, size_t instance,
-			int	primary_ix,
-			int	primary_jy,
-			float	value,
-			int *error);
-int mbview_setprimarycolortable(int verbose, size_t instance,
-			int	primary_colortable,
-			int	primary_colortable_mode,
-			double	primary_colortable_min,
-			double	primary_colortable_max,
-			int *error);
-int mbview_setslopecolortable(int verbose, size_t instance,
-			int	slope_colortable,
-			int	slope_colortable_mode,
-			double	slope_colortable_min,
-			double	slope_colortable_max,
-			int *error);
-
-/* mbview_secondary.c function prototypes */
-int mbview_setsecondarygrid(int verbose, size_t instance,
-			int	secondary_grid_projection_mode,
-			char	*secondary_grid_projection_id,
-			float	secondary_nodatavalue,
-			int	secondary_nx,
-			int	secondary_ny,
-			double	secondary_min,
-			double	secondary_max,
-			double	secondary_xmin,
-			double	secondary_xmax,
-			double	secondary_ymin,
-			double	secondary_ymax,
-			double	secondary_dx,
-			double	secondary_dy,
-			float	*secondary_data,
-			int *error);
-int mbview_updatesecondarygrid(int verbose, size_t instance,
-			int	secondary_nx,
-			int	secondary_ny,
-			float	*secondary_data,
-			int *error);
-int mbview_updatesecondarygridcell(int verbose, size_t instance,
-			int	primary_ix,
-			int	primary_jy,
-			float	value,
-			int *error);
-int mbview_setsecondarycolortable(int verbose, size_t instance,
-			int	secondary_colortable,
-			int	secondary_colortable_mode,
-			double	secondary_colortable_min,
-			double	secondary_colortable_max,
-			double	overlay_shade_magnitude,
-			double	overlay_shade_center,
-			int	overlay_shade_mode,
-			int *error);
-int mbview_setsecondaryname(int verbose, size_t instance,
-			char *name, int *error);
-
-/* mbview_process.c function prototypes */
-int mbview_projectdata(size_t instance);
-int mbview_derivative(size_t instance, int i, int j);
-int mbview_projectglobaldata(size_t instance);
-int mbview_zscalegridpoint(size_t instance, int k);
-int mbview_zscalepoint(size_t instance, int globalview, double offset_factor,
-			struct mbview_point_struct *point);
-int mbview_zscalepointw(size_t instance, int globalview, double offset_factor,
-			struct mbview_pointw_struct *pointw);
-int mbview_updatepointw(size_t instance, struct mbview_pointw_struct *pointw);
-int mbview_updatesegmentw(size_t instance, struct mbview_linesegmentw_struct *segmentw);
-int mbview_zscale(size_t instance);
-int mbview_projectforward(size_t instance, int needlonlat,
-				double xgrid, double ygrid, double zdata,
-				double *xlon, double *ylat,
-				double *xdisplay, double *ydisplay, double *zdisplay);
-int mbview_projectinverse(size_t instance, int needlonlat,
-				double xdisplay, double ydisplay,double zdisplay,
-				double *xlon, double *ylat,
-				double *xgrid, double *ygrid);
-int mbview_projectfromlonlat(size_t instance,
-				double xlon, double ylat, double zdata,
-				double *xgrid, double *ygrid,
-				double *xdisplay, double *ydisplay, double *zdisplay);
-int mbview_projectgrid2ll(size_t instance,
-				double xgrid, double ygrid,
-				double *xlon, double *ylat);
-int mbview_projectll2xygrid(size_t instance,
-				double xlon, double ylat,
-				double *xgrid, double *ygrid);
-int mbview_projectll2xyzgrid(size_t instance,
-				double xlon, double ylat,
-				double *xgrid, double *ygrid, double *zdata);
-int mbview_projectll2display(size_t instance,
-				double xlon, double ylat, double zdata,
-				double *xdisplay, double *ydisplay, double *zdisplay);
-int mbview_projectdisplay2ll(size_t instance,
-				double xdisplay, double ydisplay, double zdisplay,
-				double *xlon, double *ylat);
-int mbview_projectdistance(size_t instance,
-				double xlon1, double ylat1, double zdata1,
-				double xlon2, double ylat2, double zdata2,
-				double *distancelateral,
-				double *distanceoverground,
-				double *slope);
-int mbview_sphere_setup(size_t instance, int earthcentered, double xlon, double ylat);
-int mbview_sphere_forward(size_t instance, double xlon, double ylat,
-			double *xx, double *yy, double *zz);
-int mbview_sphere_inverse(size_t instance, double xx, double yy, double zz,
-			double *xlon, double *ylat);
-int mbview_sphere_matrix(double phi, double theta, double psi,double *eulermatrix);
-int mbview_sphere_rotate(double *eulermatrix,
-			double *v, double *vr);
-int mbview_greatcircle_distbearing(size_t instance,
-			double lon1, double lat1, double lon2,  double lat2,
-			double *bearing, double *distance);
-int mbview_greatcircle_dist(size_t instance,
-			double lon1, double lat1, double lon2,  double lat2,
-			double *distance);
-int mbview_greatcircle_endposition(size_t instance,
-			double lon1, double lat1, double bearing, double distance,
-			double *lon2, double *lat2);
-int mbview_colorclear(size_t instance);
-int mbview_zscaleclear(size_t instance);
-int mbview_setcolorparms(size_t instance);
-int mbview_make_histogram(
-	struct mbview_world_struct *view,
-	struct mbview_struct *data,
-	int	which_data);
-int mbview_colorpoint(
-	struct mbview_world_struct *view,
-	struct mbview_struct *data,
-	int i, int j, int k);
-int mbview_colorpoint_histogram(
-	struct mbview_world_struct *view,
-	struct mbview_struct *data,
-	float *histogram,
-	int i, int j, int k);
-int mbview_getcolor(double value, double min, double max,
-			int colortablemode,
-			float below_red,
-			float below_green,
-			float below_blue,
-			float above_red,
-			float above_green,
-			float above_blue,
-			float *colortable_red,
-			float *colortable_green,
-			float *colortable_blue,
-			float *red, float *green, float *blue);
-int mbview_getcolor_histogram(double value, double min, double max,
-			int colortablemode,
-			float below_red,
-			float below_green,
-			float below_blue,
-			float above_red,
-			float above_green,
-			float above_blue,
-			float *colortable_red,
-			float *colortable_green,
-			float *colortable_blue,
-			float *histogram,
-			float *red, float *green, float *blue);
-int mbview_applyshade(double intensity, float *r, float *g, float *b);
-int mbview_getsecondaryvalue(struct mbview_world_struct *view,
-				struct mbview_struct *data,
-				int i, int j,
-				double *secondary_value);
-int mbview_contour(size_t instance, int rez);
-int mbview_getzdata(size_t instance,
-			double xgrid, double ygrid,
-			int *found, double *zdata);
-
-/* mbview_plot.c function prototypes */
-int mbview_reset_glx(size_t instance);
-int mbview_drawdata(size_t instance, int rez);
-int mbview_plotlowall(size_t instance);
-int mbview_plotlowhighall(size_t instance);
-int mbview_plothighall(size_t instance);
-int mbview_plotlow(size_t instance);
-int mbview_plotlowhigh(size_t instance);
-int mbview_plothigh(size_t instance);
-int mbview_plotfull(size_t instance);
-int mbview_plot(size_t instance, int rez);
-int mbview_findpoint(size_t instance, int xpixel, int ypixel,
-			int *found,
-			double *xgrid, double *ygrid,
-			double *xlon, double *ylat, double *zdata,
-			double *xdisplay, double *ydisplay, double *zdisplay);
-int mbview_findpointrez(size_t instance, int rez, int xpixel, int ypixel,
-			int ijbounds[4], int *found,
-			double *xgrid, double *ygrid,
-			double *xlon, double *ylat, double *zdata,
-			double *xdisplay, double *ydisplay, double *zdisplay);
-int mbview_viewbounds(size_t instance);
-int mbview_drapesegment(size_t instance, struct mbview_linesegment_struct *seg);
-int mbview_drapesegment_gc(size_t instance, struct mbview_linesegment_struct *seg);
-int mbview_drapesegment_grid(size_t instance, struct mbview_linesegment_struct *seg);
-int mbview_drapesegmentw(size_t instance, struct mbview_linesegmentw_struct *seg);
-int mbview_drapesegmentw_gc(size_t instance, struct mbview_linesegmentw_struct *seg);
-int mbview_drapesegmentw_grid(size_t instance, struct mbview_linesegmentw_struct *seg);
-int mbview_glerrorcheck(size_t instance, char *sourcefile, int line, char *sourcefunction);
-
-/* mbview_pick.c function prototypes */
-int mbview_pick(size_t instance, int which, int xpixel, int ypixel);
-int mbview_extract_pick_profile(size_t instance);
-int mbview_picksize(size_t instance);
-int mbview_pick_text(size_t instance);
-int mbview_setlonlatstrings(int style, double lon, double lat, char *lonstring, char *latstring);
-int mbview_region(size_t instance, int which, int xpixel, int ypixel);
-int mbview_area(size_t instance, int which, int xpixel, int ypixel);
-int mbview_drawpick(size_t instance);
-int mbview_drawregion(size_t instance);
-int mbview_drawarea(size_t instance);
-
-/* mbview_nav.c function prototypes */
-int mbview_getnavcount(int verbose, size_t instance,
-			int *nnav,
-			int *error);
-int mbview_getnavpointcount(int verbose, size_t instance,
-			int	nav,
-			int	*npoint,
-			int	*nintpoint,
-			int *error);
-int mbview_allocnavarrays(int verbose,
-			int	npointtotal,
-			double	**time_d,
-			double	**navlon,
-			double	**navlat,
-			double	**navz,
-			double	**heading,
-			double	**speed,
-			double	**navportlon,
-			double	**navportlat,
-			double	**navstbdlon,
-			double	**navstbdlat,
-			int	**line,
-			int	**shot,
-			int	**cdp,
-			int 	*error);
-int mbview_freenavarrays(int verbose,
-			double	**time_d,
-			double	**navlon,
-			double	**navlat,
-			double	**navz,
-			double	**heading,
-			double	**speed,
-			double	**navportlon,
-			double	**navportlat,
-			double	**navstbdlon,
-			double	**navstbdlat,
-			int	**line,
-			int	**shot,
-			int	**cdp,
-			int *error);
-int mbview_addnav(int verbose, size_t instance,
-			int	npoint,
-			double	*time_d,
-			double	*navlon,
-			double	*navlat,
-			double	*navz,
-			double	*heading,
-			double	*speed,
-			double	*navportlon,
-			double	*navportlat,
-			double	*navstbdlon,
-			double	*navstbdlat,
-			int	*line,
-			int	*shot,
-			int	*cdp,
-			int	navcolor,
-			int	navsize,
-			mb_path	navname,
-			int	navpathstatus,
-			mb_path	navpathraw,
-			mb_path	navpathprocessed,
-			int	navformat,
-			int	navswathbounds,
-			int	navline,
-			int	navshot,
-			int	navcdp,
-			int	decimation,
-			int *error);
-int mbview_enableviewnavs(int verbose, size_t instance,
-			int *error);
-int mbview_pick_nav_select(size_t instance, int select, int which, int xpixel, int ypixel);
-int mbview_extract_nav_profile(size_t instance);
-int mbview_nav_delete(size_t instance, int inav);
-int mbview_navpicksize(size_t instance);
-int mbview_drawnavpick(size_t instance);
-int mbview_drawnav(size_t instance, int rez);
-int mbview_updatenavlist(void);
-
-/* mbview_route.c function prototypes */
-int mbview_getroutecount(int verbose, size_t instance,
-			int	*nroute,
-			int *error);
-int mbview_getroutepointcount(int verbose, size_t instance,
-			int	route,
-			int	*npoint,
-			int	*nintpoint,
-			int *error);
-int mbview_getrouteselected(int verbose, size_t instance,
-			int	route,
-			int	*selected,
-			int *error);
-int mbview_getrouteinfo(int verbose, size_t instance,
-			int working_route,
-			int *nroutewaypoint,
-			int *nroutpoint,
-			char *routename,
-			int *routecolor,
-			int *routesize,
-			double *routedistancelateral,
-			double *routedistancetopo,
-			int *error);
-int mbview_allocroutearrays(int verbose,
-			int	npointtotal,
-			double	**routelon,
-			double	**routelat,
-			int	**waypoint,
-			double	**routetopo,
-			double	**routebearing,
-			double	**distlateral,
-			double	**distovertopo,
-			double	**slope,
-			int *error);
-int mbview_freeroutearrays(int verbose,
-			double	**routelon,
-			double	**routelat,
-			int	**waypoint,
-			double	**routetopo,
-			double	**routebearing,
-			double	**distlateral,
-			double	**distovertopo,
-			double	**slope,
-			int *error);
-int mbview_addroute(int verbose, size_t instance,
-			int	npoint,
-			double	*routelon,
-			double	*routelat,
-			int	*waypoint,
-			int	routecolor,
-			int	routesize,
-                        int     routeeditmode,
-			mb_path	routename,
-			int 	*iroute,
-			int *error);
-int mbview_deleteroute(int verbose, size_t instance,
-			int	iroute,
-			int *error);
-int mbview_getroute(int verbose, size_t instance,
-			int	route,
-			int	*npointtotal,
-			double	*routelon,
-			double	*routelat,
-			int	*waypoint,
-			double	*routetopo,
-			double	*routebearing,
-			double	*distlateral,
-			double	*distovertopo,
-			double	*slope,
-			int	*routecolor,
-			int	*routesize,
-			mb_path	routename,
-			int *error);
-int mbview_enableviewroutes(int verbose, size_t instance,
-			int *error);
-int mbview_enableeditroutes(int verbose, size_t instance,
-			int *error);
-int mbview_pick_route_select(size_t instance, int which, int xpixel, int ypixel);
-int mbview_extract_route_profile(size_t instance);
-int mbview_pick_route_add(size_t instance, int which, int xpixel, int ypixel);
-int mbview_pick_route_delete(size_t instance, int xpixel, int ypixel);
-int mbview_route_add(size_t instance, int inew, int jnew, int waypoint,
-				double xgrid, double ygrid,
-				double xlon, double ylat, double zdata,
-				double xdisplay, double ydisplay, double zdisplay);
-int mbview_route_delete(size_t instance, int iroute, int ipoint);
-int mbview_route_setdistance(size_t instance, int working_route);
-int mbview_drawroute(size_t instance, int rez);
-int mbview_updateroutelist(void);
-
-/* mbview_site.c function prototypes */
-int mbview_getsitecount(int verbose, size_t instance,
-			int	*nsite,
-			int *error);
-int mbview_allocsitearrays(int verbose,
-			int	nsite,
-			double	**sitelon,
-			double	**sitelat,
-			double	**sitetopo,
-			int	**sitecolor,
-			int	**sitesize,
-			mb_path	**sitename,
-			int *error);
-int mbview_freesitearrays(int verbose,
-			double	**sitelon,
-			double	**sitelat,
-			double	**sitetopo,
-			int	**sitecolor,
-			int	**sitesize,
-			mb_path	**sitename,
-			int *error);
-int mbview_addsites(int verbose, size_t instance,
-			int	nsite,
-			double	*sitelon,
-			double	*sitelat,
-			double	*sitetopo,
-			int	*sitecolor,
-			int	*sitesize,
-			mb_path	*sitename,
-			int *error);
-int mbview_getsites(int verbose, size_t instance,
-			int	*nsite,
-			double	*sitelon,
-			double	*sitelat,
-			double	*sitetopo,
-			int	*sitecolor,
-			int	*sitesize,
-			mb_path	*sitename,
-			int *error);
-int mbview_enableviewsites(int verbose, size_t instance,
-			int *error);
-int mbview_enableeditsites(int verbose, size_t instance,
-			int *error);
-int mbview_pick_site_select(size_t instance, int which, int xpixel, int ypixel);
-int mbview_pick_site_add(size_t instance, int which, int xpixel, int ypixel);
-int mbview_pick_site_delete(size_t instance, int xpixel, int ypixel);
-int mbview_site_delete(size_t instance, int isite);
-int mbview_drawsite(size_t instance, int rez);
-int mbview_updatesitelist(void);
-
-/* mbview_profile.c function prototypes */
-int mbview_getprofilecount(int verbose, size_t instance,
-			int *npoints,
-			int *error);
-int mbview_allocprofilepoints(int verbose,
-			int	npoints,
-			struct mbview_profilepoint_struct **points,
-			int 	*error);
-int mbview_freeprofilepoints(int verbose,
-			double	**points,
-			int *error);
-int mbview_allocprofilearrays(int verbose,
-			int	npoints,
-			double	**distance,
-			double	**zdata,
-			int	**boundary,
-			double	**xlon,
-			double	**ylat,
-			double	**distovertopo,
-			double	**bearing,
-			double	**slope,
-			int 	*error);
-int mbview_freeprofilearrays(int verbose,
-			double	**distance,
-			double	**zdata,
-			int	**boundary,
-			double	**xlon,
-			double	**ylat,
-			double	**distovertopo,
-			double	**bearing,
-			double	**slope,
-			int *error);
-int mbview_getprofile(int verbose, size_t instance,
-			mb_path	source_name,
-			double	*length,
-			double	*zmin,
-			double	*zmax,
-			int	*npoints,
-			double	*distance,
-			double	*zdata,
-			int	*boundary,
-			double	*xlon,
-			double	*ylat,
-			double	*distovertopo,
-			double	*bearing,
-			double	*slope,
-			int *error);
-int mbview_reset_prglx(size_t instance);
-int mbview_destroy_prglx(size_t instance);
-int mbview_plotprofile(size_t instance);
-int mbview_profile_text(size_t instance);
-
-void BxUnmanageCB(Widget w, XtPointer client, XtPointer call);
-void BxManageCB(Widget w, XtPointer client, XtPointer call);
-void BxPopupCB(Widget w, XtPointer client, XtPointer call);
-XtPointer BX_CONVERT(Widget w, char *from_string, char *to_type, int to_size, Boolean *success);
-void BxExitCB(Widget w, XtPointer client, XtPointer call);
-void BxSetValuesCB(Widget w, XtPointer client, XtPointer call);
-
-/*--------------------------------------------------------------------*/
diff --git a/src/otps/Makefile.am b/src/otps/Makefile.am
deleted file mode 100644
index cca69fa..0000000
--- a/src/otps/Makefile.am
+++ /dev/null
@@ -1,25 +0,0 @@
-bin_PROGRAMS = mbotps
-
-AM_CFLAGS = ${libnetcdf_CFLAGS}
-
-AM_CPPFLAGS = -I${top_srcdir}/src/mbio \
-		-I${top_srcdir}/src/gsf \
-		${libnetcdf_CPPFLAGS}
-
-AM_LDFLAGS = 
-
-LIBS = ${top_builddir}/src/mbio/libmbio.la \
-	${libgmt_LIBS} ${libnetcdf_LIBS} ${libproj_LIBS} \
-	$(LIBM)
-
-mbotps_SOURCES = mbotps.c
-
-nodist_mbotps_SOURCES = otps.h
-
-BUILT_SOURCES = otps.h
-
-CLEANFILES = otps.h
-DISTCLEANFILES = otps.h
-
-otps.h: Makefile
-	echo 'char *otps_location = "$(OTPS_DIR)";' >$@
diff --git a/src/otps/Makefile.in b/src/otps/Makefile.in
deleted file mode 100644
index 22da09c..0000000
--- a/src/otps/Makefile.in
+++ /dev/null
@@ -1,674 +0,0 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
-
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-
-VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
-am__make_running_with_option = \
-  case $${target_option-} in \
-      ?) ;; \
-      *) echo "am__make_running_with_option: internal error: invalid" \
-              "target option '$${target_option-}' specified" >&2; \
-         exit 1;; \
-  esac; \
-  has_opt=no; \
-  sane_makeflags=$$MAKEFLAGS; \
-  if $(am__is_gnu_make); then \
-    sane_makeflags=$$MFLAGS; \
-  else \
-    case $$MAKEFLAGS in \
-      *\\[\ \	]*) \
-        bs=\\; \
-        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
-          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
-    esac; \
-  fi; \
-  skip_next=no; \
-  strip_trailopt () \
-  { \
-    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
-  }; \
-  for flg in $$sane_makeflags; do \
-    test $$skip_next = yes && { skip_next=no; continue; }; \
-    case $$flg in \
-      *=*|--*) continue;; \
-        -*I) strip_trailopt 'I'; skip_next=yes;; \
-      -*I?*) strip_trailopt 'I';; \
-        -*O) strip_trailopt 'O'; skip_next=yes;; \
-      -*O?*) strip_trailopt 'O';; \
-        -*l) strip_trailopt 'l'; skip_next=yes;; \
-      -*l?*) strip_trailopt 'l';; \
-      -[dEDm]) skip_next=yes;; \
-      -[JT]) skip_next=yes;; \
-    esac; \
-    case $$flg in \
-      *$$target_option*) has_opt=yes; break;; \
-    esac; \
-  done; \
-  test $$has_opt = yes
-am__make_dryrun = (target_option=n; $(am__make_running_with_option))
-am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-bin_PROGRAMS = mbotps$(EXEEXT)
-subdir = src/otps
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/depcomp
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
-	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
-	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
-	$(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-	$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/src/mbio/mb_config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-am__installdirs = "$(DESTDIR)$(bindir)"
-PROGRAMS = $(bin_PROGRAMS)
-am_mbotps_OBJECTS = mbotps.$(OBJEXT)
-nodist_mbotps_OBJECTS =
-mbotps_OBJECTS = $(am_mbotps_OBJECTS) $(nodist_mbotps_OBJECTS)
-mbotps_LDADD = $(LDADD)
-AM_V_lt = $(am__v_lt_ at AM_V@)
-am__v_lt_ = $(am__v_lt_ at AM_DEFAULT_V@)
-am__v_lt_0 = --silent
-am__v_lt_1 = 
-AM_V_P = $(am__v_P_ at AM_V@)
-am__v_P_ = $(am__v_P_ at AM_DEFAULT_V@)
-am__v_P_0 = false
-am__v_P_1 = :
-AM_V_GEN = $(am__v_GEN_ at AM_V@)
-am__v_GEN_ = $(am__v_GEN_ at AM_DEFAULT_V@)
-am__v_GEN_0 = @echo "  GEN     " $@;
-am__v_GEN_1 = 
-AM_V_at = $(am__v_at_ at AM_V@)
-am__v_at_ = $(am__v_at_ at AM_DEFAULT_V@)
-am__v_at_0 = @
-am__v_at_1 = 
-DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)/src/mbio
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
-am__mv = mv -f
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
-	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
-	$(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
-	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
-	$(AM_CFLAGS) $(CFLAGS)
-AM_V_CC = $(am__v_CC_ at AM_V@)
-am__v_CC_ = $(am__v_CC_ at AM_DEFAULT_V@)
-am__v_CC_0 = @echo "  CC      " $@;
-am__v_CC_1 = 
-CCLD = $(CC)
-LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
-	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
-	$(AM_LDFLAGS) $(LDFLAGS) -o $@
-AM_V_CCLD = $(am__v_CCLD_ at AM_V@)
-am__v_CCLD_ = $(am__v_CCLD_ at AM_DEFAULT_V@)
-am__v_CCLD_0 = @echo "  CCLD    " $@;
-am__v_CCLD_1 = 
-SOURCES = $(mbotps_SOURCES) $(nodist_mbotps_SOURCES)
-DIST_SOURCES = $(mbotps_SOURCES)
-am__can_run_installinfo = \
-  case $$AM_UPDATE_INFO_DIR in \
-    n|no|NO) false;; \
-    *) (install-info --version) >/dev/null 2>&1;; \
-  esac
-am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
-# Read a list of newline-separated strings from the standard input,
-# and print each of them once, without duplicates.  Input order is
-# *not* preserved.
-am__uniquify_input = $(AWK) '\
-  BEGIN { nonempty = 0; } \
-  { items[$$0] = 1; nonempty = 1; } \
-  END { if (nonempty) { for (i in items) print i; }; } \
-'
-# Make sure the list of sources is unique.  This is necessary because,
-# e.g., the same source file might be shared among _SOURCES variables
-# for different programs/libraries.
-am__define_uniq_tagged_files = \
-  list='$(am__tagged_files)'; \
-  unique=`for i in $$list; do \
-    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-  done | $(am__uniquify_input)`
-ETAGS = etags
-CTAGS = ctags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-CC = @CC@
-CCAS = @CCAS@
-CCASDEPMODE = @CCASDEPMODE@
-CCASFLAGS = @CCASFLAGS@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DLLTOOL = @DLLTOOL@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GREP = @GREP@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBM = @LIBM@
-LIBOBJS = @LIBOBJS@
-LIBS = ${top_builddir}/src/mbio/libmbio.la \
-	${libgmt_LIBS} ${libnetcdf_LIBS} ${libproj_LIBS} \
-	$(LIBM)
-
-LIBTOOL = @LIBTOOL@
-LIBTOOL_DEPS = @LIBTOOL_DEPS@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LTLIBOBJS = @LTLIBOBJS@
-LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
-MAINT = @MAINT@
-MAKEINFO = @MAKEINFO@
-MANIFEST_TOOL = @MANIFEST_TOOL@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-OTPS_DIR = @OTPS_DIR@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_URL = @PACKAGE_URL@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PKG_CONFIG = @PKG_CONFIG@
-PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
-PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-VERSION = @VERSION@
-XDR_LIB = @XDR_LIB@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_AR = @ac_ct_AR@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-fftw_app = @fftw_app@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libGLU_CFLAGS = @libGLU_CFLAGS@
-libGLU_LIBS = @libGLU_LIBS@
-libXm_CFLAGS = @libXm_CFLAGS@
-libXm_LIBS = @libXm_LIBS@
-libdir = @libdir@
-libexecdir = @libexecdir@
-libfftw3_CFLAGS = @libfftw3_CFLAGS@
-libfftw3_LIBS = @libfftw3_LIBS@
-libfftw_CPPFLAGS = @libfftw_CPPFLAGS@
-libfftw_LIBS = @libfftw_LIBS@
-libgmt_CFLAGS = @libgmt_CFLAGS@
-libgmt_CPPFLAGS = @libgmt_CPPFLAGS@
-libgmt_LIBS = @libgmt_LIBS@
-libmotif_CPPFLAGS = @libmotif_CPPFLAGS@
-libmotif_LIBS = @libmotif_LIBS@
-libnetcdf_CFLAGS = @libnetcdf_CFLAGS@
-libnetcdf_CPPFLAGS = @libnetcdf_CPPFLAGS@
-libnetcdf_LIBS = @libnetcdf_LIBS@
-libopengl_CPPFLAGS = @libopengl_CPPFLAGS@
-libopengl_LIBS = @libopengl_LIBS@
-libproj_CFLAGS = @libproj_CFLAGS@
-libproj_CPPFLAGS = @libproj_CPPFLAGS@
-libproj_LIBS = @libproj_LIBS@
-libpsl_CFLAGS = @libpsl_CFLAGS@
-libpsl_LIBS = @libpsl_LIBS@
-localedir = @localedir@
-localstatedir = @localstatedir@
-mandir = @mandir@
-mbsystemdatadir = @mbsystemdatadir@
-mbsystemhtmldir = @mbsystemhtmldir@
-mbsystempsdir = @mbsystempsdir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-AM_CFLAGS = ${libnetcdf_CFLAGS}
-AM_CPPFLAGS = -I${top_srcdir}/src/mbio \
-		-I${top_srcdir}/src/gsf \
-		${libnetcdf_CPPFLAGS}
-
-AM_LDFLAGS = 
-mbotps_SOURCES = mbotps.c
-nodist_mbotps_SOURCES = otps.h
-BUILT_SOURCES = otps.h
-CLEANFILES = otps.h
-DISTCLEANFILES = otps.h
-all: $(BUILT_SOURCES)
-	$(MAKE) $(AM_MAKEFLAGS) all-am
-
-.SUFFIXES:
-.SUFFIXES: .c .lo .o .obj
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
-	@for dep in $?; do \
-	  case '$(am__configure_deps)' in \
-	    *$$dep*) \
-	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-	        && { if test -f $@; then exit 0; else break; fi; }; \
-	      exit 1;; \
-	  esac; \
-	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/otps/Makefile'; \
-	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --gnu src/otps/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	@case '$?' in \
-	  *config.status*) \
-	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-	esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-install-binPROGRAMS: $(bin_PROGRAMS)
-	@$(NORMAL_INSTALL)
-	@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
-	if test -n "$$list"; then \
-	  echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
-	  $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
-	fi; \
-	for p in $$list; do echo "$$p $$p"; done | \
-	sed 's/$(EXEEXT)$$//' | \
-	while read p p1; do if test -f $$p \
-	 || test -f $$p1 \
-	  ; then echo "$$p"; echo "$$p"; else :; fi; \
-	done | \
-	sed -e 'p;s,.*/,,;n;h' \
-	    -e 's|.*|.|' \
-	    -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
-	sed 'N;N;N;s,\n, ,g' | \
-	$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
-	  { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
-	    if ($$2 == $$4) files[d] = files[d] " " $$1; \
-	    else { print "f", $$3 "/" $$4, $$1; } } \
-	  END { for (d in files) print "f", d, files[d] }' | \
-	while read type dir files; do \
-	    if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
-	    test -z "$$files" || { \
-	    echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
-	    $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
-	    } \
-	; done
-
-uninstall-binPROGRAMS:
-	@$(NORMAL_UNINSTALL)
-	@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
-	files=`for p in $$list; do echo "$$p"; done | \
-	  sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
-	      -e 's/$$/$(EXEEXT)/' \
-	`; \
-	test -n "$$list" || exit 0; \
-	echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
-	cd "$(DESTDIR)$(bindir)" && rm -f $$files
-
-clean-binPROGRAMS:
-	@list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \
-	echo " rm -f" $$list; \
-	rm -f $$list || exit $$?; \
-	test -n "$(EXEEXT)" || exit 0; \
-	list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
-	echo " rm -f" $$list; \
-	rm -f $$list
-
-mbotps$(EXEEXT): $(mbotps_OBJECTS) $(mbotps_DEPENDENCIES) $(EXTRA_mbotps_DEPENDENCIES) 
-	@rm -f mbotps$(EXEEXT)
-	$(AM_V_CCLD)$(LINK) $(mbotps_OBJECTS) $(mbotps_LDADD) $(LIBS)
-
-mostlyclean-compile:
-	-rm -f *.$(OBJEXT)
-
-distclean-compile:
-	-rm -f *.tab.c
-
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbotps.Po at am__quote@
-
-.c.o:
- at am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(COMPILE) -c -o $@ $<
-
-.c.obj:
- at am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
- at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-
-.c.lo:
- at am__fastdepCC_TRUE@	$(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(LTCOMPILE) -c -o $@ $<
-
-mostlyclean-libtool:
-	-rm -f *.lo
-
-clean-libtool:
-	-rm -rf .libs _libs
-
-ID: $(am__tagged_files)
-	$(am__define_uniq_tagged_files); mkid -fID $$unique
-tags: tags-am
-TAGS: tags
-
-tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
-	set x; \
-	here=`pwd`; \
-	$(am__define_uniq_tagged_files); \
-	shift; \
-	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
-	  test -n "$$unique" || unique=$$empty_fix; \
-	  if test $$# -gt 0; then \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      "$$@" $$unique; \
-	  else \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      $$unique; \
-	  fi; \
-	fi
-ctags: ctags-am
-
-CTAGS: ctags
-ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
-	$(am__define_uniq_tagged_files); \
-	test -z "$(CTAGS_ARGS)$$unique" \
-	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$unique
-
-GTAGS:
-	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && $(am__cd) $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) "$$here"
-cscopelist: cscopelist-am
-
-cscopelist-am: $(am__tagged_files)
-	list='$(am__tagged_files)'; \
-	case "$(srcdir)" in \
-	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
-	  *) sdir=$(subdir)/$(srcdir) ;; \
-	esac; \
-	for i in $$list; do \
-	  if test -f "$$i"; then \
-	    echo "$(subdir)/$$i"; \
-	  else \
-	    echo "$$sdir/$$i"; \
-	  fi; \
-	done >> $(top_builddir)/cscope.files
-
-distclean-tags:
-	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	list='$(DISTFILES)'; \
-	  dist_files=`for file in $$list; do echo $$file; done | \
-	  sed -e "s|^$$srcdirstrip/||;t" \
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
-	case $$dist_files in \
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
-			   sort -u` ;; \
-	esac; \
-	for file in $$dist_files; do \
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  if test -d $$d/$$file; then \
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
-	    if test -d "$(distdir)/$$file"; then \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
-	  else \
-	    test -f "$(distdir)/$$file" \
-	    || cp -p $$d/$$file "$(distdir)/$$file" \
-	    || exit 1; \
-	  fi; \
-	done
-check-am: all-am
-check: $(BUILT_SOURCES)
-	$(MAKE) $(AM_MAKEFLAGS) check-am
-all-am: Makefile $(PROGRAMS)
-installdirs:
-	for dir in "$(DESTDIR)$(bindir)"; do \
-	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
-	done
-install: $(BUILT_SOURCES)
-	$(MAKE) $(AM_MAKEFLAGS) install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
-	if test -z '$(STRIP)'; then \
-	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	      install; \
-	else \
-	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
-	fi
-mostlyclean-generic:
-
-clean-generic:
-	-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
-
-distclean-generic:
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-	-test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
-
-maintainer-clean-generic:
-	@echo "This command is intended for maintainers to use"
-	@echo "it deletes files that may require special tools to rebuild."
-	-test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
-clean: clean-am
-
-clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am
-
-distclean: distclean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
-	distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am: install-binPROGRAMS
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic \
-	mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am: uninstall-binPROGRAMS
-
-.MAKE: all check install install-am install-strip
-
-.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \
-	clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \
-	ctags ctags-am distclean distclean-compile distclean-generic \
-	distclean-libtool distclean-tags distdir dvi dvi-am html \
-	html-am info info-am install install-am install-binPROGRAMS \
-	install-data install-data-am install-dvi install-dvi-am \
-	install-exec install-exec-am install-html install-html-am \
-	install-info install-info-am install-man install-pdf \
-	install-pdf-am install-ps install-ps-am install-strip \
-	installcheck installcheck-am installdirs maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-compile \
-	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-	tags tags-am uninstall uninstall-am uninstall-binPROGRAMS
-
-
-otps.h: Makefile
-	echo 'char *otps_location = "$(OTPS_DIR)";' >$@
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/otps/mbotps.c b/src/otps/mbotps.c
deleted file mode 100644
index 448ce93..0000000
--- a/src/otps/mbotps.c
+++ /dev/null
@@ -1,908 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbotps.c	7/30/2009
- *    $Id: mbotps.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 2009-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * MBotps predicts tides using methods and data derived
- * from the OSU Tidal Prediction Software (OTPS) distributions
- * distributed from:
- *      http://www.coas.oregonstate.edu/research/po/research/tide/
- * The OTPS distributions include programs written in Fortran 90 that
- * operate in batch mode with specified control files. This program is
- * intended to provide the same tidal prediction capability through a
- * command line interface more consistent with MB-System.
- *
- * The mbotps usage is:
- *      mbotps -Rlon/lat -Byear/month/day/hour/minute/second
- *             -Eyear/month/day/hour/minute/second -Dinterval -Otidefile
- *             [-Idatalist.mb-1 -Fformat -V]
- *
- * This program can be used in two modes. In the first, the user
- * specifies a location (-Rlon/lat), start and end times (-B and -E),
- * and a tidal sampling interval (-D). The program then writes a two
- * column tide time series consisting of epoch time values in seconds followed
- * by tide values in meters for the specified location and times. The
- * output is to a file specified with -Otidefile.
- *
- * In the second mode, the user specifies one or more swath data files using
- * -Idatalist.mb-1. A tide file is generated for each swath file by
- * outputing the time and tide value for the sonar navigation sampled
- * according to -Dinterval. MBotps also sets the parameter file for each
- * swath file so that mbprocess applies the tide model during processing.
- *
- * Author:	D. W. Caress
- * Date:	July 30,  2009
- *
- * $Log: mbotps.c,v $
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <math.h>
-#include <string.h>
-#include <time.h>
-#include <sys/stat.h>
-
-/* MBIO include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_define.h"
-#include "mb_process.h"
-
-/* OTPS installation location include */
-#include "otps.h"
-
-/* local defines */
-#define MBOTPS_MODE_POSITION	0
-#define MBOTPS_MODE_NAVIGATION 	1
-
-/* system function declarations */
-char	*ctime();
-char	*getenv();
-
-/*--------------------------------------------------------------------*/
-
-int main (int argc, char **argv)
-{
-	static char rcs_id[] = "$Id: mbotps.c 2227 2015-02-05 21:12:31Z caress $";
-	static char program_name[] = "mbotps";
-	static char help_message[] =  "MBotps predicts tides using methods and data derived from the OSU Tidal Prediction Software (OTPS) distributions.";
-	static char usage_message[] = "mbotps [-Atideformat -Byear/month/day/hour/minute/second -Dinterval\n\t-Eyear/month/day/hour/minute/second -Fformat\n"
-					"\t-Idatalist.mb-1 -Lopts_path -Ooutput -Potps_location -Rlon/lat -Tmodel -V]";
-	extern char *optarg;
-	int	errflg = 0;
-	int	c;
-	int	help = 0;
-	int	flag = 0;
-
-	/* MBIO status variables */
-	int	status = MB_SUCCESS;
-	int	verbose = 0;
-	int	error = MB_ERROR_NO_ERROR;
-	char	*message;
-
-	/* MBIO read control parameters */
-	int	read_datalist = MB_NO;
-	mb_path	read_file;
-	void	*datalist;
-	int	look_processed = MB_DATALIST_LOOK_UNSET;
-	double	file_weight;
-	mb_path	swath_file;
-	mb_path	file;
-	int	format;
-	int	pings;
-	int	lonflip;
-	double	bounds[4];
-	double	speedmin;
-	double	timegap;
-	int	beams_bath;
-	int	beams_amp;
-	int	pixels_ss;
-
-	/* MBIO read values */
-	void	*mbio_ptr = NULL;
-	void	*store_ptr = NULL;
-	int	kind;
-	int	time_i[7];
-	double	time_d;
-	double	navlon;
-	double	navlat;
-	double	speed;
-	double	heading;
-	double	distance;
-	double	altitude;
-	double	sonardepth;
-	char	*beamflag = NULL;
-	double	*bath = NULL;
-	double	*bathacrosstrack = NULL;
-	double	*bathalongtrack = NULL;
-	double	*amp = NULL;
-	double	*ss = NULL;
-	double	*ssacrosstrack = NULL;
-	double	*ssalongtrack = NULL;
-	char	comment[MB_COMMENT_MAXLINE];
-
-	/* mbotps control parameters */
-	mb_path	otps_location_use;
-	int	notpsmodels = 0;
-	int	nmodeldatafiles = 0;
-	int	mbotps_mode = MBOTPS_MODE_POSITION;
-	double	tidelon;
-	double	tidelat;
-	double	btime_d;
-	double	etime_d;
-	int	btime_i[7];
-	int	etime_i[7];
-	double	interval = 300.0;
-	mb_path	tidefile;
-	int	mbprocess_update = MB_NO;
-	int	tideformat = 2;
-	int	ngood;
-
-	/* time parameters */
-	time_t	right_now;
-	char	date[32], user[MB_PATH_MAXLINE], *user_ptr, host[MB_PATH_MAXLINE];
-	int	pid;
-
-	FILE	*tfp, *mfp, *ofp;
-	struct stat file_status;
-	int	fstat;
-	mb_path	lltfile;
-	mb_path	otpsfile;
-	mb_path	line;
-	mb_path	predict_tide;
-	int	otps_model_set = MB_NO;
-	mb_path	otps_model;
-	mb_path	modelname;
-	mb_path	modelfile;
-	mb_path	modeldatafile;
-	int	read_data;
-	int	ntime;
-	int	nread;
-	int	nline;
-	int	nget;
-	int	output;
-	double	savetime_d;
-	double	lasttime_d;
-	double	lastlon;
-	double	lastlat;
-	double	lon;
-	double	lat;
-	double	tide;
-	double	depth;
-	char	*result;
-	int	i;
-
-	/* get current default values */
-	status = mb_defaults(verbose,&format,&pings,&lonflip,bounds,
-		btime_i,etime_i,&speedmin,&timegap);
-
-	/* set default input to datalist.mb-1 */
-	strcpy (read_file, "datalist.mb-1");
-
-	/* set default location of the OTPS package */
-	strcpy(otps_location_use, otps_location);
-
-	/* set defaults for the AUV survey we were running on Coaxial Segment, Juan de Fuca Ridge
-		while I wrote this code */
-	sprintf(otps_model, "tpxo7.2");
-	sprintf(tidefile, "tide_model.txt");
-	tidelon = -129.588618;
-	tidelat = 46.50459;
-	interval = 60.0;
-	btime_i[0] = 2009;
-	btime_i[1] = 7;
-	btime_i[2] = 31;
-	btime_i[3] = 0;
-	btime_i[4] = 0;
-	btime_i[5] = 0;
-	btime_i[6] = 0;
-	etime_i[0] = 2009;
-	etime_i[1] = 8;
-	etime_i[2] = 2;
-	etime_i[3] = 1;
-	etime_i[4] = 0;
-	etime_i[5] = 0;
-	etime_i[6] = 0;
-
-	/* process argument list */
-	while ((c = getopt(argc, argv, "A:a:B:b:D:d:E:e:F:f:I:i:MmO:o:P:p:R:r:T:t:VvHh")) != -1)
-	  switch (c)
-		{
-		case 'H':
-		case 'h':
-			help++;
-			break;
-		case 'V':
-		case 'v':
-			verbose++;
-			break;
-		case 'A':
-		case 'a':
-			sscanf (optarg,"%d", &tideformat);
-			if (tideformat != 2)
-				tideformat = 1;
-			break;
-		case 'B':
-		case 'b':
-			sscanf (optarg,"%d/%d/%d/%d/%d/%d",
-				&btime_i[0],&btime_i[1],&btime_i[2],
-				&btime_i[3],&btime_i[4],&btime_i[5]);
-			btime_i[6] = 0;
-			flag++;
-			break;
-		case 'D':
-		case 'd':
-			sscanf (optarg,"%lf", &interval);
-			break;
-		case 'E':
-		case 'e':
-			sscanf (optarg,"%d/%d/%d/%d/%d/%d",
-				&etime_i[0],&etime_i[1],&etime_i[2],
-				&etime_i[3],&etime_i[4],&etime_i[5]);
-			etime_i[6] = 0;
-			flag++;
-			break;
-		case 'F':
-		case 'f':
-			sscanf (optarg,"%d", &format);
-			flag++;
-			break;
-		case 'I':
-		case 'i':
-			sscanf (optarg,"%s", read_file);
-			mbotps_mode = MBOTPS_MODE_NAVIGATION;
-			flag++;
-			break;
-		case 'M':
-		case 'm':
-			mbprocess_update = MB_YES;
-			break;
-		case 'O':
-		case 'o':
-			sscanf (optarg,"%s", tidefile);
-			break;
-		case 'P':
-		case 'p':
-			sscanf (optarg,"%s", otps_location_use);
-			break;
-		case 'R':
-		case 'r':
-			sscanf (optarg,"%lf/%lf", &tidelon, &tidelat);
-			break;
-		case 'T':
-		case 't':
-			sscanf (optarg,"%s", otps_model);
-			otps_model_set = MB_YES;
-			break;
-		case '?':
-			errflg++;
-		}
-
-	/* if error flagged then print it and exit */
-	if (errflg)
-		{
-		fprintf(stderr,"usage: %s\n", usage_message);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		error = MB_ERROR_BAD_USAGE;
-		exit(error);
-		}
-
-	/* print starting message */
-	if (verbose == 1 || help)
-		{
-		fprintf(stderr,"\nProgram %s\n",program_name);
-		fprintf(stderr,"Version %s\n",rcs_id);
-		fprintf(stderr,"MB-system Version %s\n",MB_VERSION);
-		}
-
-	/* if help desired then print it and exit */
-	if (help)
-		{
-		fprintf(stderr,"\n%s\n",help_message);
-		fprintf(stderr,"\nusage: %s\n", usage_message);
-		}
-
-	/* Check for available tide models */
-	if (help || verbose > 0)
-		{
-		fprintf(stderr,"\nChecking for available OTPS tide models\n");
-		fprintf(stderr,"OTPS location: %s\nValid OTPS tidal models:\n", otps_location_use);
-		}
-	notpsmodels = 0;
-	sprintf(line, "/bin/ls -1 %s/DATA | grep Model_ | sed \"s/^Model_//\"", otps_location_use);
-	if ((tfp = popen(line, "r")) != NULL)
-		{
-		/* send relevant input to predict_tide through its stdin stream */
-		while (fgets(line, sizeof(line), tfp))
-			{
-			sscanf(line, "%s", modelname);
-			sprintf(modelfile, "%s/DATA/Model_%s", otps_location_use, modelname);
-			nmodeldatafiles = 0;
-
-			/* check the files referenced in the model file */
-			if ((mfp = fopen(modelfile, "r")) != NULL)
-				{
-				/* stat the file referenced in each line */
-				while (fgets(modeldatafile, MB_PATH_MAXLINE, mfp) != NULL)
-					{
-					if (strlen(modeldatafile) > 0)
-						modeldatafile[strlen(modeldatafile)-1] = '\0';
-					if ((fstat = stat(modeldatafile, &file_status)) == 0
-						&& (file_status.st_mode & S_IFMT) != S_IFDIR)
-						{
-						nmodeldatafiles++;
-						}
-					}
-				fclose(mfp);
-				}
-			if (nmodeldatafiles >= 3)
-				{
-				if (help || verbose > 0)
-					fprintf(stderr,"     %s\n", modelname);
-				if (otps_model_set == MB_NO)
-					{
-					if (notpsmodels == 0 || strcmp(modelname, "tpxo7.2") == 0)
-						strcpy(otps_model, modelname);
-					}
-				notpsmodels++;
-				}
-			}
-
-		/* close the process */
-		pclose(tfp);
-		}
-	else
-		{
-		error = MB_ERROR_OPEN_FAIL;
-		fprintf(stderr,"\nUnable to open ls using popen()\n");
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(MB_FAILURE);
-		}
-	if (help || verbose > 0)
-		{
-		fprintf(stderr,"Number of available OTPS tide models: %d\n", notpsmodels);
-		fprintf(stderr,"\nUsing OTPS tide model:            %s\n", otps_model);
-		}
-
-	/* print starting debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  Program <%s>\n",program_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Control Parameters:\n");
-		fprintf(stderr,"dbg2       verbose:          %d\n",verbose);
-		fprintf(stderr,"dbg2       help:             %d\n",help);
-		fprintf(stderr,"dbg2       otps_location:    %s\n",otps_location);
-		fprintf(stderr,"dbg2       otps_location_use:%s\n",otps_location_use);
-		fprintf(stderr,"dbg2       otps_model_set:   %d\n",otps_model_set);
-		fprintf(stderr,"dbg2       otps_model:       %s\n",otps_model);
-		fprintf(stderr,"dbg2       mbotps_mode:      %d\n",mbotps_mode);
-		fprintf(stderr,"dbg2       tidelon:          %f\n",tidelon);
-		fprintf(stderr,"dbg2       tidelat:          %f\n",tidelat);
-		fprintf(stderr,"dbg2       btime_i[0]:       %d\n",btime_i[0]);
-		fprintf(stderr,"dbg2       btime_i[1]:       %d\n",btime_i[1]);
-		fprintf(stderr,"dbg2       btime_i[2]:       %d\n",btime_i[2]);
-		fprintf(stderr,"dbg2       btime_i[3]:       %d\n",btime_i[3]);
-		fprintf(stderr,"dbg2       btime_i[4]:       %d\n",btime_i[4]);
-		fprintf(stderr,"dbg2       btime_i[5]:       %d\n",btime_i[5]);
-		fprintf(stderr,"dbg2       btime_i[6]:       %d\n",btime_i[6]);
-		fprintf(stderr,"dbg2       etime_i[0]:       %d\n",etime_i[0]);
-		fprintf(stderr,"dbg2       etime_i[1]:       %d\n",etime_i[1]);
-		fprintf(stderr,"dbg2       etime_i[2]:       %d\n",etime_i[2]);
-		fprintf(stderr,"dbg2       etime_i[3]:       %d\n",etime_i[3]);
-		fprintf(stderr,"dbg2       etime_i[4]:       %d\n",etime_i[4]);
-		fprintf(stderr,"dbg2       etime_i[5]:       %d\n",etime_i[5]);
-		fprintf(stderr,"dbg2       etime_i[6]:       %d\n",etime_i[6]);
-		fprintf(stderr,"dbg2       interval:         %f\n",interval);
-		fprintf(stderr,"dbg2       tidefile:         %s\n",tidefile);
-		fprintf(stderr,"dbg2       mbprocess_update: %d\n",mbprocess_update);
-		fprintf(stderr,"dbg2       tideformat:       %d\n",tideformat);
-		fprintf(stderr,"dbg2       format:           %d\n",format);
-		fprintf(stderr,"dbg2       read_file:        %s\n",read_file);
-		}
-
-	/* exit if no valid OTPS models can be found */
-	if (notpsmodels <= 0)
-		{
-		error = MB_ERROR_OPEN_FAIL;
-		fprintf(stderr,"\nUnable to find a valid OTPS tidal model\n");
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(MB_FAILURE);
-		}
-
-	/* if help was all that was desired then exit */
-	if (help)
-		{
-		exit(error);
-		}
-
-	/* get tides for a single position and time range */
-	if (mbotps_mode == MBOTPS_MODE_POSITION)
-		{
-		/* first open temporary file of lat lon time */
-		pid = getpid();
-		sprintf(lltfile, "tmp_mbotps_llt_%d.txt", pid);
-		sprintf(otpsfile, "tmp_mbotps_llttd_%d.txt", pid);
-		if ((tfp = fopen(lltfile,"w")) == NULL)
-			{
-			error = MB_ERROR_OPEN_FAIL;
-			fprintf(stderr,"\nUnable to open temporary lat-lon-time file <%s> for writing\n",lltfile);
-			fprintf(stderr,"\nProgram <%s> Terminated\n",
-				program_name);
-			exit(MB_FAILURE);
-			}
-
-		/* make sure longitude is positive */
-		if (tidelon < 0.0)
-			tidelon += 360.0;
-
-		/* loop over the time of interest generating the lat-lon-time values */
-		mb_get_time(verbose, btime_i, &btime_d);
-		mb_get_time(verbose, etime_i, &etime_d);
-		ntime = 1 + (int)floor((etime_d - btime_d) / interval);
-		for (i=0;i<ntime;i++)
-			{
-			time_d = btime_d + i * interval;
-			mb_get_date(verbose, time_d, time_i);
-			fprintf(tfp, "%.6f %.6f %4.4d %2.2d %2.2d %2.2d %2.2d %2.2d\n",
-				tidelat, tidelon, time_i[0], time_i[1], time_i[2], time_i[3], time_i[4], time_i[5]);
-			}
-
-		/* close the llt file */
-		fclose(tfp);
-
-		/* call predict_tide with popen */
-		sprintf(predict_tide, "%s/predict_tide", otps_location_use);
-		if ((tfp = popen(predict_tide, "w")) == NULL)
-			{
-			error = MB_ERROR_OPEN_FAIL;
-			fprintf(stderr,"\nUnable to open predict_time program using popen()\n");
-			fprintf(stderr,"\nProgram <%s> Terminated\n",
-				program_name);
-			exit(MB_FAILURE);
-			}
-
-		/* send relevant input to predict_tide through its stdin stream */
-		fprintf(tfp, "%s/DATA/Model_%s\n", otps_location_use,otps_model);
-		fprintf(tfp, "%s\n", lltfile);
-		fprintf(tfp, "z\n\nAP\noce\n1\n");
-		/*fprintf(tfp, "z\nm2,s2,n2,k2,k1,o1,p1,q1\nAP\noce\n1\n");*/
-		fprintf(tfp, "%s\n", otpsfile);
-
-		/* close the process */
-		pclose(tfp);
-
-		/* now read results from predict_tide and rewrite them in a useful form */
-		if ((tfp = fopen(otpsfile, "r")) == NULL)
-			{
-			error = MB_ERROR_OPEN_FAIL;
-			fprintf(stderr,"\nUnable to open predict_time results temporary file <%s>\n", otpsfile);
-			fprintf(stderr,"\nProgram <%s> Terminated\n",
-				program_name);
-			exit(MB_FAILURE);
-			}
-		if ((ofp = fopen(tidefile, "w")) == NULL)
-			{
-			error = MB_ERROR_OPEN_FAIL;
-			fprintf(stderr,"\nUnable to open tide output file <%s>\n", tidefile);
-			fprintf(stderr,"\nProgram <%s> Terminated\n",
-				program_name);
-			exit(MB_FAILURE);
-			}
-		fprintf(ofp, "# Tide model generated by program %s\n", program_name);
-		fprintf(ofp, "# Version: %s\n", rcs_id);
-		fprintf(ofp, "# MB-System Version: %s\n", MB_VERSION);
-		fprintf(ofp, "# Tide model generated by program %s\n", program_name);
-		fprintf(ofp, "# which in turn calls OTPS program predict_tide obtained from:\n");
-		fprintf(ofp, "#     http://www.coas.oregonstate.edu/research/po/research/tide/\n");
-		fprintf(ofp, "#\n");
-		fprintf(ofp, "# OTPSnc tide model: \n");
-		fprintf(ofp, "#      %s\n",otps_model);
-		if (tideformat == 2)
-			{
-			fprintf(ofp, "# Output format:\n");
-			fprintf(ofp, "#      year month day hour minute second tide\n");
-			fprintf(ofp, "# where tide is in meters\n");
-			}
-		else
-			{
-			fprintf(ofp, "# Output format:\n");
-			fprintf(ofp, "#      time_d tide\n");
-			fprintf(ofp, "# where time_d is in seconds since January 1, 1970\n");
-			fprintf(ofp, "# and tide is in meters\n");
-			}
-		right_now = time((time_t *)0);
-		strcpy(date,ctime(&right_now));
-                date[strlen(date)-1] = '\0';
-		if ((user_ptr = getenv("USER")) == NULL)
-			user_ptr = getenv("LOGNAME");
-		if (user_ptr != NULL)
-			strcpy(user,user_ptr);
-		else
-			strcpy(user, "unknown");
-		gethostname(host,MBP_FILENAMESIZE);
-		fprintf(ofp,"# Run by user <%s> on cpu <%s> at <%s>\n", user,host,date);
-
-		nline = 0;
-		ngood = 0;
-		while ((result = fgets(line,MB_PATH_MAXLINE,tfp)) == line)
-			{
-			nline++;
-			if (nline == 2 || nline == 3)
-				{
-				fprintf(ofp, "#%s", line);
-				}
-			else if (nline > 6)
-				{
-				nget = sscanf(line,"%lf %lf %d.%d.%d %d:%d:%d %lf %lf",
-					&lat, &lon, &time_i[1], &time_i[2], &time_i[0],
-					&time_i[3], &time_i[4], &time_i[5], &tide, &depth);
-				if (nget == 10)
-					{
-					ngood++;
-					if (tideformat ==2)
-						{
-						fprintf(ofp, "%4.4d %2.2d %2.2d %2.2d %2.2d %2.2d %9.4f\n",
-							time_i[0], time_i[1],  time_i[2],
-							time_i[3], time_i[4],  time_i[5], tide);
-						}
-					else
-						{
-						mb_get_time(verbose,time_i,&time_d);
-						fprintf(ofp, "%.3f %9.4f\n",time_d, tide);
-						}
-					}
-				}
-			}
-		fclose(tfp);
-		fclose(ofp);
-
-		/* remove the temporary files */
-		unlink("lltfile");
-		unlink("otpsfile");
-
-		/* some helpful output */
-		fprintf(stderr, "\nResults are really in %s\n", tidefile);
-		} /* end single position mode */
-
-	/* else get tides along the navigation contained in a set of swath files */
-	else if (mbotps_mode == MBOTPS_MODE_NAVIGATION)
-		{
-		/* get format if required */
-		if (format == 0)
-			mb_get_format(verbose,read_file,NULL,&format,&error);
-
-		/* determine whether to read one file or a list of files */
-		if (format < 0)
-			read_datalist = MB_YES;
-
-		/* open file list */
-		if (read_datalist == MB_YES)
-		    {
-		    if ((status = mb_datalist_open(verbose,&datalist,
-						    read_file,look_processed,&error)) != MB_SUCCESS)
-			{
-			error = MB_ERROR_OPEN_FAIL;
-			fprintf(stderr,"\nUnable to open data list file: %s\n",
-				read_file);
-			fprintf(stderr,"\nProgram <%s> Terminated\n",
-				program_name);
-			exit(error);
-			}
-		    if ((status = mb_datalist_read(verbose,datalist,
-				    file,&format,&file_weight,&error))
-				    == MB_SUCCESS)
-			read_data = MB_YES;
-		    else
-			read_data = MB_NO;
-		    }
-		/* else copy single filename to be read */
-		else
-		    {
-		    strcpy(file, read_file);
-		    read_data = MB_YES;
-		    }
-
-		/* loop over all files to be read */
-		while (read_data == MB_YES)
-			{
-			/* some helpful output */
-			fprintf(stderr, "\n---------------------------------------\n\nProcessing tides for %s\n\n", file);
-
-			/* first open temporary file of lat lon time */
-			pid = getpid();
-			strcpy(swath_file, file);
-			sprintf(lltfile, "tmp_mbotps_llt_%d.txt", pid);
-			sprintf(otpsfile, "tmp_mbotps_llttd_%d.txt", pid);
-			sprintf(tidefile, "%s.tde", file);
-			if ((tfp = fopen(lltfile,"w")) == NULL)
-				{
-				error = MB_ERROR_OPEN_FAIL;
-				fprintf(stderr,"\nUnable to open temporary lat-lon-time file <%s> for writing\n",lltfile);
-				fprintf(stderr,"\nProgram <%s> Terminated\n",
-					program_name);
-				exit(MB_FAILURE);
-				}
-
-			/* read fnv file if possible */
-			mb_get_fnv(verbose, file, &format, &error);
-
-			/* initialize reading the swath file */
-			if ((status = mb_read_init(
-				verbose,file,format,pings,lonflip,bounds,
-				btime_i,etime_i,speedmin,timegap,
-				&mbio_ptr,&btime_d,&etime_d,
-				&beams_bath,&beams_amp,&pixels_ss,&error)) != MB_SUCCESS)
-				{
-				mb_error(verbose,error,&message);
-				fprintf(stderr,"\nMBIO Error returned from function <mb_read_init>:\n%s\n",message);
-				fprintf(stderr,"\nMultibeam File <%s> not initialized for reading\n",file);
-				fprintf(stderr,"\nProgram <%s> Terminated\n",
-					program_name);
-				exit(error);
-				}
-
-			/* allocate memory for data arrays */
-			if (error == MB_ERROR_NO_ERROR)
-				status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-								sizeof(char), (void **)&beamflag, &error);
-			if (error == MB_ERROR_NO_ERROR)
-				status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-								sizeof(double), (void **)&bath, &error);
-			if (error == MB_ERROR_NO_ERROR)
-				status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_AMPLITUDE,
-								sizeof(double), (void **)&amp, &error);
-			if (error == MB_ERROR_NO_ERROR)
-				status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-								sizeof(double), (void **)&bathacrosstrack, &error);
-			if (error == MB_ERROR_NO_ERROR)
-				status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-								sizeof(double), (void **)&bathalongtrack, &error);
-			if (error == MB_ERROR_NO_ERROR)
-				status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_SIDESCAN,
-								sizeof(double), (void **)&ss, &error);
-			if (error == MB_ERROR_NO_ERROR)
-				status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_SIDESCAN,
-								sizeof(double), (void **)&ssacrosstrack, &error);
-			if (error == MB_ERROR_NO_ERROR)
-				status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_SIDESCAN,
-								sizeof(double), (void **)&ssalongtrack, &error);
-
-			/* if error initializing memory then quit */
-			if (error != MB_ERROR_NO_ERROR)
-				{
-				mb_error(verbose,error,&message);
-				fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",
-					message);
-				fprintf(stderr,"\nProgram <%s> Terminated\n",
-					program_name);
-				exit(error);
-				}
-
-			/* read and use data */
-			nread = 0;
-			while (error <= MB_ERROR_NO_ERROR)
-				{
-				/* reset error */
-				error = MB_ERROR_NO_ERROR;
-				output = MB_NO;
-
-				/* read next data record */
-				status = mb_get_all(verbose,mbio_ptr,&store_ptr,&kind,
-				    time_i,&time_d,&navlon,&navlat,
-				    &speed,&heading,
-				    &distance,&altitude,&sonardepth,
-				    &beams_bath,&beams_amp,&pixels_ss,
-				    beamflag,bath,amp,bathacrosstrack,bathalongtrack,
-				    ss,ssacrosstrack,ssalongtrack,
-				    comment,&error);
-
-				/* print debug statements */
-				if (verbose >= 2)
-					{
-					fprintf(stderr,"\ndbg2  Ping read in program <%s>\n",
-						program_name);
-					fprintf(stderr,"dbg2       kind:           %d\n",kind);
-					fprintf(stderr,"dbg2       error:          %d\n",error);
-					fprintf(stderr,"dbg2       status:         %d\n",status);
-					}
-
-				/* deal with nav and time from survey data only - not nav, sidescan, or subbottom */
-				if (error <= MB_ERROR_NO_ERROR && kind == MB_DATA_DATA)
-					{
-					/* flag positions and times for output at specified interval */
-					if (nread == 0 || time_d - savetime_d >= interval)
-						{
-						savetime_d = time_d;
-						output = MB_YES;
-						}
-					lasttime_d = time_d;
-					lastlon = navlon;
-					lastlat = navlat;
-
-					/* increment counter */
-					nread++;
-					}
-
-				/* output position and time if flagged or end of file */
-				if (output == MB_YES || error == MB_ERROR_EOF)
-					{
-					if (lastlon < 0.0)
-						lastlon += 360.0;
-					mb_get_date(verbose, lasttime_d, time_i);
-					fprintf(tfp, "%.6f %.6f %4.4d %2.2d %2.2d %2.2d %2.2d %2.2d\n",
-							lastlat, lastlon, time_i[0], time_i[1], time_i[2],
-							time_i[3], time_i[4], time_i[5]);
-					}
-				}
-
-			/* close the swath file */
-			status = mb_close(verbose,&mbio_ptr,&error);
-
-			/* output read statistics */
-			fprintf(stderr,"%d records read from %s\n", nread, file);
-
-			/* close the llt file */
-			fclose(tfp);
-
-			/* call predict_tide with popen */
-			sprintf(predict_tide, "%s/predict_tide", otps_location_use);
-			if ((tfp = popen(predict_tide, "w")) == NULL)
-				{
-				error = MB_ERROR_OPEN_FAIL;
-				fprintf(stderr,"\nUnable to open predict_time program using popen()\n");
-				fprintf(stderr,"\nProgram <%s> Terminated\n",
-					program_name);
-				exit(MB_FAILURE);
-				}
-
-			/* send relevant input to predict_tide through its stdin stream */
-			fprintf(tfp, "%s/DATA/Model_%s\n", otps_location_use,otps_model);
-			fprintf(tfp, "%s\n", lltfile);
-			fprintf(tfp, "z\n\nAP\noce\n1\n");
-			/*fprintf(tfp, "z\nm2,s2,n2,k2,k1,o1,p1,q1\nAP\noce\n1\n");*/
-			fprintf(tfp, "%s\n", otpsfile);
-
-			/* close the process */
-			pclose(tfp);
-
-			/* now read results from predict_tide and rewrite them in a useful form */
-			if ((tfp = fopen(otpsfile, "r")) == NULL)
-				{
-				error = MB_ERROR_OPEN_FAIL;
-				fprintf(stderr,"\nUnable to open predict_time results temporary file <%s>\n", otpsfile);
-				fprintf(stderr,"\nProgram <%s> Terminated\n",
-					program_name);
-				exit(MB_FAILURE);
-				}
-			if ((ofp = fopen(tidefile, "w")) == NULL)
-				{
-				error = MB_ERROR_OPEN_FAIL;
-				fprintf(stderr,"\nUnable to open tide output file <%s>\n", tidefile);
-				fprintf(stderr,"\nProgram <%s> Terminated\n",
-					program_name);
-				exit(MB_FAILURE);
-				}
-			fprintf(ofp, "# Tide model generated by program %s\n", program_name);
-			fprintf(ofp, "# Version: %s\n", rcs_id);
-			fprintf(ofp, "# MB-System Version: %s\n", MB_VERSION);
-			fprintf(ofp, "# Tide model generated by program %s\n", program_name);
-			fprintf(ofp, "# which in turn calls OTPS program predict_tide obtained from:\n");
-			fprintf(ofp, "#     http://www.coas.oregonstate.edu/research/po/research/tide/\n");
-			right_now = time((time_t *)0);
-			strcpy(date,ctime(&right_now));
-			date[strlen(date)-1] = '\0';
-			if ((user_ptr = getenv("USER")) == NULL)
-				user_ptr = getenv("LOGNAME");
-			if (user_ptr != NULL)
-				strcpy(user,user_ptr);
-			else
-				strcpy(user, "unknown");
-			gethostname(host,MBP_FILENAMESIZE);
-			fprintf(ofp,"# Run by user <%s> on cpu <%s> at <%s>\n", user,host,date);
-
-			nline = 0;
-			ngood = 0;
-			while ((result = fgets(line,MB_PATH_MAXLINE,tfp)) == line)
-				{
-				nline++;
-				if (nline == 2 || nline == 3)
-					{
-					fprintf(ofp, "#%s", line);
-					}
-				else if (nline > 6)
-					{
-					nget = sscanf(line,"%lf %lf %d.%d.%d %d:%d:%d %lf %lf",
-						&lat, &lon, &time_i[1], &time_i[2], &time_i[0],
-						&time_i[3], &time_i[4], &time_i[5], &tide, &depth);
-					if (nget == 10)
-						{
-						ngood++;
-						if (tideformat == 2)
-							{
-							fprintf(ofp, "%4.4d %2.2d %2.2d %2.2d %2.2d %2.2d %9.4f\n",
-								time_i[0], time_i[1],  time_i[2],
-								time_i[3], time_i[4],  time_i[5], tide);
-							}
-						else
-							{
-							mb_get_time(verbose,time_i,&time_d);
-							fprintf(ofp, "%.3f %9.4f\n",time_d, tide);
-							}
-						}
-					}
-				}
-			fclose(tfp);
-			fclose(ofp);
-
-			/* remove the temporary files */
-			unlink(lltfile);
-			unlink(otpsfile);
-
-			/* some helpful output */
-			fprintf(stderr, "\nResults are really in %s\n", tidefile);
-
-			/* set mbprocess usage of tide file */
-			if (mbprocess_update == MB_YES && ngood > 0)
-				{
-				status = mb_pr_update_tide(verbose, swath_file,
-							MBP_TIDE_ON, tidefile, tideformat, &error);
-				fprintf(stderr, "MBprocess set to apply tide correction to %s\n", swath_file);
-				}
-
-			/* figure out whether and what to read next */
-        		if (read_datalist == MB_YES)
-                		{
-				if ((status = mb_datalist_read(verbose,datalist,
-					    file,&format,&file_weight,&error))
-					    == MB_SUCCESS)
-                        		read_data = MB_YES;
-                		else
-                        		read_data = MB_NO;
-                		}
-        		else
-                		{
-                		read_data = MB_NO;
-                		}
-
-			/* end loop over files in list */
-			}
-		if (read_datalist == MB_YES)
-			mb_datalist_close(verbose,&datalist,&error);
-		}
-
-	/* check memory */
-	if (verbose >= 4)
-		status = mb_memory_list(verbose,&error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  Program <%s> completed\n",
-			program_name);
-		fprintf(stderr,"dbg2  Ending status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* end it all */
-	exit(error);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/proj/Makefile.am b/src/proj/Makefile.am
deleted file mode 100644
index 1ed76ae..0000000
--- a/src/proj/Makefile.am
+++ /dev/null
@@ -1,166 +0,0 @@
-bin_PROGRAMS = proj geod
-
-AM_CPPFLAGS = -I${top_srcdir}/src/mbio
-
-include_HEADERS = proj_api.h
-
-proj_SOURCES = proj.c gen_cheb.c p_series.c
-geod_SOURCES = geod.c geod_set.c geod_for.c geod_inv.c geodesic.h
-
-proj_LDADD = libproj.la
-geod_LDADD = libproj.la
-
-lib_LTLIBRARIES = libproj.la
-
-libproj_la_LDFLAGS = -no-undefined -version-info 0:0:0
-
-libproj_la_SOURCES = \
-      projects.h pj_list.h \
-PJ_aea.c \
-PJ_aeqd.c \
-PJ_airy.c \
-PJ_aitoff.c \
-PJ_august.c \
-PJ_bacon.c \
-PJ_bipc.c \
-PJ_boggs.c \
-PJ_bonne.c \
-PJ_cass.c \
-PJ_cc.c \
-PJ_cea.c \
-PJ_chamb.c \
-PJ_collg.c \
-PJ_crast.c \
-PJ_denoy.c \
-PJ_eck1.c \
-PJ_eck2.c \
-PJ_eck3.c \
-PJ_eck4.c \
-PJ_eck5.c \
-PJ_eqc.c \
-PJ_eqdc.c \
-PJ_fahey.c \
-PJ_fouc_s.c \
-PJ_gall.c \
-PJ_geos.c \
-PJ_gins8.c \
-PJ_gn_sinu.c \
-PJ_gnom.c \
-PJ_goode.c \
-PJ_gstmerc.c \
-PJ_hammer.c \
-PJ_hatano.c \
-PJ_healpix.c \
-PJ_igh.c \
-PJ_imw_p.c \
-PJ_isea.c \
-PJ_krovak.c \
-PJ_labrd.c \
-PJ_laea.c \
-PJ_lagrng.c \
-PJ_larr.c \
-PJ_lask.c \
-PJ_lcc.c \
-PJ_lcca.c \
-PJ_loxim.c \
-PJ_lsat.c \
-PJ_mbt_fps.c \
-PJ_mbtfpp.c \
-PJ_mbtfpq.c \
-PJ_merc.c \
-PJ_mill.c \
-PJ_mod_ster.c \
-PJ_moll.c \
-PJ_natearth.c \
-PJ_nell.c \
-PJ_nell_h.c \
-PJ_nocol.c \
-PJ_nsper.c \
-PJ_nzmg.c \
-PJ_ob_tran.c \
-PJ_ocea.c \
-PJ_oea.c \
-PJ_omerc.c \
-PJ_ortho.c \
-PJ_poly.c \
-PJ_putp2.c \
-PJ_putp3.c \
-PJ_putp4p.c \
-PJ_putp5.c \
-PJ_putp6.c \
-PJ_robin.c \
-PJ_rpoly.c \
-PJ_sconics.c \
-PJ_somerc.c \
-PJ_stere.c \
-PJ_sterea.c \
-PJ_sts.c \
-PJ_tcc.c \
-PJ_tcea.c \
-PJ_tmerc.c \
-PJ_tpeqd.c \
-PJ_urm5.c \
-PJ_urmfps.c \
-PJ_vandg.c \
-PJ_vandg2.c \
-PJ_vandg4.c \
-PJ_wag2.c \
-PJ_wag3.c \
-PJ_wag7.c \
-PJ_wink1.c \
-PJ_wink2.c \
-aasincos.c \
-adjlon.c \
-bch2bps.c \
-bchgen.c \
-biveval.c \
-dmstor.c \
-emess.c \
-geocent.c \
-mk_cheby.c \
-nad_cvt.c \
-nad_init.c \
-nad_intr.c \
-pj_apply_gridshift.c \
-pj_apply_vgridshift.c \
-pj_auth.c \
-pj_ctx.c \
-pj_datum_set.c \
-pj_datums.c \
-pj_deriv.c \
-pj_ell_set.c \
-pj_ellps.c \
-pj_errno.c \
-pj_factors.c \
-pj_fwd.c \
-pj_gauss.c \
-pj_geocent.c \
-pj_gridinfo.c \
-pj_gridlist.c \
-pj_init.c \
-pj_initcache.c \
-pj_inv.c \
-pj_latlong.c \
-pj_list.c \
-pj_log.c \
-pj_malloc.c \
-pj_mlfn.c \
-pj_msfn.c \
-pj_mutex.c \
-pj_open_lib.c \
-pj_param.c \
-pj_phi2.c \
-pj_pr_list.c \
-pj_qsfn.c \
-pj_release.c \
-pj_strerrno.c \
-pj_transform.c \
-pj_tsfn.c \
-pj_units.c \
-pj_utils.c \
-pj_zpoly1.c \
-proj_etmerc.c \
-proj_mdist.c \
-proj_rouss.c \
-rtodms.c \
-vector1.c
diff --git a/src/proj/Makefile.in b/src/proj/Makefile.in
deleted file mode 100644
index 6111785..0000000
--- a/src/proj/Makefile.in
+++ /dev/null
@@ -1,1105 +0,0 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
-
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-
-
-
-VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
-am__make_running_with_option = \
-  case $${target_option-} in \
-      ?) ;; \
-      *) echo "am__make_running_with_option: internal error: invalid" \
-              "target option '$${target_option-}' specified" >&2; \
-         exit 1;; \
-  esac; \
-  has_opt=no; \
-  sane_makeflags=$$MAKEFLAGS; \
-  if $(am__is_gnu_make); then \
-    sane_makeflags=$$MFLAGS; \
-  else \
-    case $$MAKEFLAGS in \
-      *\\[\ \	]*) \
-        bs=\\; \
-        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
-          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
-    esac; \
-  fi; \
-  skip_next=no; \
-  strip_trailopt () \
-  { \
-    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
-  }; \
-  for flg in $$sane_makeflags; do \
-    test $$skip_next = yes && { skip_next=no; continue; }; \
-    case $$flg in \
-      *=*|--*) continue;; \
-        -*I) strip_trailopt 'I'; skip_next=yes;; \
-      -*I?*) strip_trailopt 'I';; \
-        -*O) strip_trailopt 'O'; skip_next=yes;; \
-      -*O?*) strip_trailopt 'O';; \
-        -*l) strip_trailopt 'l'; skip_next=yes;; \
-      -*l?*) strip_trailopt 'l';; \
-      -[dEDm]) skip_next=yes;; \
-      -[JT]) skip_next=yes;; \
-    esac; \
-    case $$flg in \
-      *$$target_option*) has_opt=yes; break;; \
-    esac; \
-  done; \
-  test $$has_opt = yes
-am__make_dryrun = (target_option=n; $(am__make_running_with_option))
-am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-bin_PROGRAMS = proj$(EXEEXT) geod$(EXEEXT)
-subdir = src/proj
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/depcomp $(include_HEADERS)
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
-	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
-	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
-	$(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-	$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/src/mbio/mb_config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
-am__vpath_adj = case $$p in \
-    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
-    *) f=$$p;; \
-  esac;
-am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
-am__install_max = 40
-am__nobase_strip_setup = \
-  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
-am__nobase_strip = \
-  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
-am__nobase_list = $(am__nobase_strip_setup); \
-  for p in $$list; do echo "$$p $$p"; done | \
-  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
-  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
-    if (++n[$$2] == $(am__install_max)) \
-      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
-    END { for (dir in files) print dir, files[dir] }'
-am__base_list = \
-  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
-  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
-am__uninstall_files_from_dir = { \
-  test -z "$$files" \
-    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
-    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
-         $(am__cd) "$$dir" && rm -f $$files; }; \
-  }
-am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" \
-	"$(DESTDIR)$(includedir)"
-LTLIBRARIES = $(lib_LTLIBRARIES)
-libproj_la_LIBADD =
-am_libproj_la_OBJECTS = PJ_aea.lo PJ_aeqd.lo PJ_airy.lo PJ_aitoff.lo \
-	PJ_august.lo PJ_bacon.lo PJ_bipc.lo PJ_boggs.lo PJ_bonne.lo \
-	PJ_cass.lo PJ_cc.lo PJ_cea.lo PJ_chamb.lo PJ_collg.lo \
-	PJ_crast.lo PJ_denoy.lo PJ_eck1.lo PJ_eck2.lo PJ_eck3.lo \
-	PJ_eck4.lo PJ_eck5.lo PJ_eqc.lo PJ_eqdc.lo PJ_fahey.lo \
-	PJ_fouc_s.lo PJ_gall.lo PJ_geos.lo PJ_gins8.lo PJ_gn_sinu.lo \
-	PJ_gnom.lo PJ_goode.lo PJ_gstmerc.lo PJ_hammer.lo PJ_hatano.lo \
-	PJ_healpix.lo PJ_igh.lo PJ_imw_p.lo PJ_isea.lo PJ_krovak.lo \
-	PJ_labrd.lo PJ_laea.lo PJ_lagrng.lo PJ_larr.lo PJ_lask.lo \
-	PJ_lcc.lo PJ_lcca.lo PJ_loxim.lo PJ_lsat.lo PJ_mbt_fps.lo \
-	PJ_mbtfpp.lo PJ_mbtfpq.lo PJ_merc.lo PJ_mill.lo PJ_mod_ster.lo \
-	PJ_moll.lo PJ_natearth.lo PJ_nell.lo PJ_nell_h.lo PJ_nocol.lo \
-	PJ_nsper.lo PJ_nzmg.lo PJ_ob_tran.lo PJ_ocea.lo PJ_oea.lo \
-	PJ_omerc.lo PJ_ortho.lo PJ_poly.lo PJ_putp2.lo PJ_putp3.lo \
-	PJ_putp4p.lo PJ_putp5.lo PJ_putp6.lo PJ_robin.lo PJ_rpoly.lo \
-	PJ_sconics.lo PJ_somerc.lo PJ_stere.lo PJ_sterea.lo PJ_sts.lo \
-	PJ_tcc.lo PJ_tcea.lo PJ_tmerc.lo PJ_tpeqd.lo PJ_urm5.lo \
-	PJ_urmfps.lo PJ_vandg.lo PJ_vandg2.lo PJ_vandg4.lo PJ_wag2.lo \
-	PJ_wag3.lo PJ_wag7.lo PJ_wink1.lo PJ_wink2.lo aasincos.lo \
-	adjlon.lo bch2bps.lo bchgen.lo biveval.lo dmstor.lo emess.lo \
-	geocent.lo mk_cheby.lo nad_cvt.lo nad_init.lo nad_intr.lo \
-	pj_apply_gridshift.lo pj_apply_vgridshift.lo pj_auth.lo \
-	pj_ctx.lo pj_datum_set.lo pj_datums.lo pj_deriv.lo \
-	pj_ell_set.lo pj_ellps.lo pj_errno.lo pj_factors.lo pj_fwd.lo \
-	pj_gauss.lo pj_geocent.lo pj_gridinfo.lo pj_gridlist.lo \
-	pj_init.lo pj_initcache.lo pj_inv.lo pj_latlong.lo pj_list.lo \
-	pj_log.lo pj_malloc.lo pj_mlfn.lo pj_msfn.lo pj_mutex.lo \
-	pj_open_lib.lo pj_param.lo pj_phi2.lo pj_pr_list.lo pj_qsfn.lo \
-	pj_release.lo pj_strerrno.lo pj_transform.lo pj_tsfn.lo \
-	pj_units.lo pj_utils.lo pj_zpoly1.lo proj_etmerc.lo \
-	proj_mdist.lo proj_rouss.lo rtodms.lo vector1.lo
-libproj_la_OBJECTS = $(am_libproj_la_OBJECTS)
-AM_V_lt = $(am__v_lt_ at AM_V@)
-am__v_lt_ = $(am__v_lt_ at AM_DEFAULT_V@)
-am__v_lt_0 = --silent
-am__v_lt_1 = 
-libproj_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
-	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
-	$(libproj_la_LDFLAGS) $(LDFLAGS) -o $@
-PROGRAMS = $(bin_PROGRAMS)
-am_geod_OBJECTS = geod.$(OBJEXT) geod_set.$(OBJEXT) geod_for.$(OBJEXT) \
-	geod_inv.$(OBJEXT)
-geod_OBJECTS = $(am_geod_OBJECTS)
-geod_DEPENDENCIES = libproj.la
-am_proj_OBJECTS = proj.$(OBJEXT) gen_cheb.$(OBJEXT) p_series.$(OBJEXT)
-proj_OBJECTS = $(am_proj_OBJECTS)
-proj_DEPENDENCIES = libproj.la
-AM_V_P = $(am__v_P_ at AM_V@)
-am__v_P_ = $(am__v_P_ at AM_DEFAULT_V@)
-am__v_P_0 = false
-am__v_P_1 = :
-AM_V_GEN = $(am__v_GEN_ at AM_V@)
-am__v_GEN_ = $(am__v_GEN_ at AM_DEFAULT_V@)
-am__v_GEN_0 = @echo "  GEN     " $@;
-am__v_GEN_1 = 
-AM_V_at = $(am__v_at_ at AM_V@)
-am__v_at_ = $(am__v_at_ at AM_DEFAULT_V@)
-am__v_at_0 = @
-am__v_at_1 = 
-DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)/src/mbio
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
-am__mv = mv -f
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
-	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
-	$(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
-	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
-	$(AM_CFLAGS) $(CFLAGS)
-AM_V_CC = $(am__v_CC_ at AM_V@)
-am__v_CC_ = $(am__v_CC_ at AM_DEFAULT_V@)
-am__v_CC_0 = @echo "  CC      " $@;
-am__v_CC_1 = 
-CCLD = $(CC)
-LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
-	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
-	$(AM_LDFLAGS) $(LDFLAGS) -o $@
-AM_V_CCLD = $(am__v_CCLD_ at AM_V@)
-am__v_CCLD_ = $(am__v_CCLD_ at AM_DEFAULT_V@)
-am__v_CCLD_0 = @echo "  CCLD    " $@;
-am__v_CCLD_1 = 
-SOURCES = $(libproj_la_SOURCES) $(geod_SOURCES) $(proj_SOURCES)
-DIST_SOURCES = $(libproj_la_SOURCES) $(geod_SOURCES) $(proj_SOURCES)
-am__can_run_installinfo = \
-  case $$AM_UPDATE_INFO_DIR in \
-    n|no|NO) false;; \
-    *) (install-info --version) >/dev/null 2>&1;; \
-  esac
-HEADERS = $(include_HEADERS)
-am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
-# Read a list of newline-separated strings from the standard input,
-# and print each of them once, without duplicates.  Input order is
-# *not* preserved.
-am__uniquify_input = $(AWK) '\
-  BEGIN { nonempty = 0; } \
-  { items[$$0] = 1; nonempty = 1; } \
-  END { if (nonempty) { for (i in items) print i; }; } \
-'
-# Make sure the list of sources is unique.  This is necessary because,
-# e.g., the same source file might be shared among _SOURCES variables
-# for different programs/libraries.
-am__define_uniq_tagged_files = \
-  list='$(am__tagged_files)'; \
-  unique=`for i in $$list; do \
-    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-  done | $(am__uniquify_input)`
-ETAGS = etags
-CTAGS = ctags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-CC = @CC@
-CCAS = @CCAS@
-CCASDEPMODE = @CCASDEPMODE@
-CCASFLAGS = @CCASFLAGS@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DLLTOOL = @DLLTOOL@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GREP = @GREP@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBM = @LIBM@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIBTOOL_DEPS = @LIBTOOL_DEPS@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LTLIBOBJS = @LTLIBOBJS@
-LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
-MAINT = @MAINT@
-MAKEINFO = @MAKEINFO@
-MANIFEST_TOOL = @MANIFEST_TOOL@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-OTPS_DIR = @OTPS_DIR@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_URL = @PACKAGE_URL@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PKG_CONFIG = @PKG_CONFIG@
-PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
-PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-VERSION = @VERSION@
-XDR_LIB = @XDR_LIB@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_AR = @ac_ct_AR@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-fftw_app = @fftw_app@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libGLU_CFLAGS = @libGLU_CFLAGS@
-libGLU_LIBS = @libGLU_LIBS@
-libXm_CFLAGS = @libXm_CFLAGS@
-libXm_LIBS = @libXm_LIBS@
-libdir = @libdir@
-libexecdir = @libexecdir@
-libfftw3_CFLAGS = @libfftw3_CFLAGS@
-libfftw3_LIBS = @libfftw3_LIBS@
-libfftw_CPPFLAGS = @libfftw_CPPFLAGS@
-libfftw_LIBS = @libfftw_LIBS@
-libgmt_CFLAGS = @libgmt_CFLAGS@
-libgmt_CPPFLAGS = @libgmt_CPPFLAGS@
-libgmt_LIBS = @libgmt_LIBS@
-libmotif_CPPFLAGS = @libmotif_CPPFLAGS@
-libmotif_LIBS = @libmotif_LIBS@
-libnetcdf_CFLAGS = @libnetcdf_CFLAGS@
-libnetcdf_CPPFLAGS = @libnetcdf_CPPFLAGS@
-libnetcdf_LIBS = @libnetcdf_LIBS@
-libopengl_CPPFLAGS = @libopengl_CPPFLAGS@
-libopengl_LIBS = @libopengl_LIBS@
-libproj_CFLAGS = @libproj_CFLAGS@
-libproj_CPPFLAGS = @libproj_CPPFLAGS@
-libproj_LIBS = @libproj_LIBS@
-libpsl_CFLAGS = @libpsl_CFLAGS@
-libpsl_LIBS = @libpsl_LIBS@
-localedir = @localedir@
-localstatedir = @localstatedir@
-mandir = @mandir@
-mbsystemdatadir = @mbsystemdatadir@
-mbsystemhtmldir = @mbsystemhtmldir@
-mbsystempsdir = @mbsystempsdir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-AM_CPPFLAGS = -I${top_srcdir}/src/mbio
-include_HEADERS = proj_api.h
-proj_SOURCES = proj.c gen_cheb.c p_series.c
-geod_SOURCES = geod.c geod_set.c geod_for.c geod_inv.c geodesic.h
-proj_LDADD = libproj.la
-geod_LDADD = libproj.la
-lib_LTLIBRARIES = libproj.la
-libproj_la_LDFLAGS = -no-undefined -version-info 0:0:0
-libproj_la_SOURCES = \
-      projects.h pj_list.h \
-PJ_aea.c \
-PJ_aeqd.c \
-PJ_airy.c \
-PJ_aitoff.c \
-PJ_august.c \
-PJ_bacon.c \
-PJ_bipc.c \
-PJ_boggs.c \
-PJ_bonne.c \
-PJ_cass.c \
-PJ_cc.c \
-PJ_cea.c \
-PJ_chamb.c \
-PJ_collg.c \
-PJ_crast.c \
-PJ_denoy.c \
-PJ_eck1.c \
-PJ_eck2.c \
-PJ_eck3.c \
-PJ_eck4.c \
-PJ_eck5.c \
-PJ_eqc.c \
-PJ_eqdc.c \
-PJ_fahey.c \
-PJ_fouc_s.c \
-PJ_gall.c \
-PJ_geos.c \
-PJ_gins8.c \
-PJ_gn_sinu.c \
-PJ_gnom.c \
-PJ_goode.c \
-PJ_gstmerc.c \
-PJ_hammer.c \
-PJ_hatano.c \
-PJ_healpix.c \
-PJ_igh.c \
-PJ_imw_p.c \
-PJ_isea.c \
-PJ_krovak.c \
-PJ_labrd.c \
-PJ_laea.c \
-PJ_lagrng.c \
-PJ_larr.c \
-PJ_lask.c \
-PJ_lcc.c \
-PJ_lcca.c \
-PJ_loxim.c \
-PJ_lsat.c \
-PJ_mbt_fps.c \
-PJ_mbtfpp.c \
-PJ_mbtfpq.c \
-PJ_merc.c \
-PJ_mill.c \
-PJ_mod_ster.c \
-PJ_moll.c \
-PJ_natearth.c \
-PJ_nell.c \
-PJ_nell_h.c \
-PJ_nocol.c \
-PJ_nsper.c \
-PJ_nzmg.c \
-PJ_ob_tran.c \
-PJ_ocea.c \
-PJ_oea.c \
-PJ_omerc.c \
-PJ_ortho.c \
-PJ_poly.c \
-PJ_putp2.c \
-PJ_putp3.c \
-PJ_putp4p.c \
-PJ_putp5.c \
-PJ_putp6.c \
-PJ_robin.c \
-PJ_rpoly.c \
-PJ_sconics.c \
-PJ_somerc.c \
-PJ_stere.c \
-PJ_sterea.c \
-PJ_sts.c \
-PJ_tcc.c \
-PJ_tcea.c \
-PJ_tmerc.c \
-PJ_tpeqd.c \
-PJ_urm5.c \
-PJ_urmfps.c \
-PJ_vandg.c \
-PJ_vandg2.c \
-PJ_vandg4.c \
-PJ_wag2.c \
-PJ_wag3.c \
-PJ_wag7.c \
-PJ_wink1.c \
-PJ_wink2.c \
-aasincos.c \
-adjlon.c \
-bch2bps.c \
-bchgen.c \
-biveval.c \
-dmstor.c \
-emess.c \
-geocent.c \
-mk_cheby.c \
-nad_cvt.c \
-nad_init.c \
-nad_intr.c \
-pj_apply_gridshift.c \
-pj_apply_vgridshift.c \
-pj_auth.c \
-pj_ctx.c \
-pj_datum_set.c \
-pj_datums.c \
-pj_deriv.c \
-pj_ell_set.c \
-pj_ellps.c \
-pj_errno.c \
-pj_factors.c \
-pj_fwd.c \
-pj_gauss.c \
-pj_geocent.c \
-pj_gridinfo.c \
-pj_gridlist.c \
-pj_init.c \
-pj_initcache.c \
-pj_inv.c \
-pj_latlong.c \
-pj_list.c \
-pj_log.c \
-pj_malloc.c \
-pj_mlfn.c \
-pj_msfn.c \
-pj_mutex.c \
-pj_open_lib.c \
-pj_param.c \
-pj_phi2.c \
-pj_pr_list.c \
-pj_qsfn.c \
-pj_release.c \
-pj_strerrno.c \
-pj_transform.c \
-pj_tsfn.c \
-pj_units.c \
-pj_utils.c \
-pj_zpoly1.c \
-proj_etmerc.c \
-proj_mdist.c \
-proj_rouss.c \
-rtodms.c \
-vector1.c
-
-all: all-am
-
-.SUFFIXES:
-.SUFFIXES: .c .lo .o .obj
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
-	@for dep in $?; do \
-	  case '$(am__configure_deps)' in \
-	    *$$dep*) \
-	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-	        && { if test -f $@; then exit 0; else break; fi; }; \
-	      exit 1;; \
-	  esac; \
-	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/proj/Makefile'; \
-	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --gnu src/proj/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	@case '$?' in \
-	  *config.status*) \
-	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-	esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-
-install-libLTLIBRARIES: $(lib_LTLIBRARIES)
-	@$(NORMAL_INSTALL)
-	@list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
-	list2=; for p in $$list; do \
-	  if test -f $$p; then \
-	    list2="$$list2 $$p"; \
-	  else :; fi; \
-	done; \
-	test -z "$$list2" || { \
-	  echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \
-	  $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \
-	}
-
-uninstall-libLTLIBRARIES:
-	@$(NORMAL_UNINSTALL)
-	@list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
-	for p in $$list; do \
-	  $(am__strip_dir) \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \
-	done
-
-clean-libLTLIBRARIES:
-	-test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
-	@list='$(lib_LTLIBRARIES)'; \
-	locs=`for p in $$list; do echo $$p; done | \
-	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
-	      sort -u`; \
-	test -z "$$locs" || { \
-	  echo rm -f $${locs}; \
-	  rm -f $${locs}; \
-	}
-
-libproj.la: $(libproj_la_OBJECTS) $(libproj_la_DEPENDENCIES) $(EXTRA_libproj_la_DEPENDENCIES) 
-	$(AM_V_CCLD)$(libproj_la_LINK) -rpath $(libdir) $(libproj_la_OBJECTS) $(libproj_la_LIBADD) $(LIBS)
-install-binPROGRAMS: $(bin_PROGRAMS)
-	@$(NORMAL_INSTALL)
-	@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
-	if test -n "$$list"; then \
-	  echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
-	  $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
-	fi; \
-	for p in $$list; do echo "$$p $$p"; done | \
-	sed 's/$(EXEEXT)$$//' | \
-	while read p p1; do if test -f $$p \
-	 || test -f $$p1 \
-	  ; then echo "$$p"; echo "$$p"; else :; fi; \
-	done | \
-	sed -e 'p;s,.*/,,;n;h' \
-	    -e 's|.*|.|' \
-	    -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
-	sed 'N;N;N;s,\n, ,g' | \
-	$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
-	  { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
-	    if ($$2 == $$4) files[d] = files[d] " " $$1; \
-	    else { print "f", $$3 "/" $$4, $$1; } } \
-	  END { for (d in files) print "f", d, files[d] }' | \
-	while read type dir files; do \
-	    if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
-	    test -z "$$files" || { \
-	    echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
-	    $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
-	    } \
-	; done
-
-uninstall-binPROGRAMS:
-	@$(NORMAL_UNINSTALL)
-	@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
-	files=`for p in $$list; do echo "$$p"; done | \
-	  sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
-	      -e 's/$$/$(EXEEXT)/' \
-	`; \
-	test -n "$$list" || exit 0; \
-	echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
-	cd "$(DESTDIR)$(bindir)" && rm -f $$files
-
-clean-binPROGRAMS:
-	@list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \
-	echo " rm -f" $$list; \
-	rm -f $$list || exit $$?; \
-	test -n "$(EXEEXT)" || exit 0; \
-	list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
-	echo " rm -f" $$list; \
-	rm -f $$list
-
-geod$(EXEEXT): $(geod_OBJECTS) $(geod_DEPENDENCIES) $(EXTRA_geod_DEPENDENCIES) 
-	@rm -f geod$(EXEEXT)
-	$(AM_V_CCLD)$(LINK) $(geod_OBJECTS) $(geod_LDADD) $(LIBS)
-
-proj$(EXEEXT): $(proj_OBJECTS) $(proj_DEPENDENCIES) $(EXTRA_proj_DEPENDENCIES) 
-	@rm -f proj$(EXEEXT)
-	$(AM_V_CCLD)$(LINK) $(proj_OBJECTS) $(proj_LDADD) $(LIBS)
-
-mostlyclean-compile:
-	-rm -f *.$(OBJEXT)
-
-distclean-compile:
-	-rm -f *.tab.c
-
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/PJ_aea.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/PJ_aeqd.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/PJ_airy.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/PJ_aitoff.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/PJ_august.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/PJ_bacon.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/PJ_bipc.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/PJ_boggs.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/PJ_bonne.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/PJ_cass.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/PJ_cc.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/PJ_cea.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/PJ_chamb.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/PJ_collg.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/PJ_crast.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/PJ_denoy.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/PJ_eck1.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/PJ_eck2.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/PJ_eck3.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/PJ_eck4.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/PJ_eck5.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/PJ_eqc.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/PJ_eqdc.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/PJ_fahey.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/PJ_fouc_s.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/PJ_gall.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/PJ_geos.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/PJ_gins8.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/PJ_gn_sinu.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/PJ_gnom.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/PJ_goode.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/PJ_gstmerc.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/PJ_hammer.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/PJ_hatano.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/PJ_healpix.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/PJ_igh.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/PJ_imw_p.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/PJ_isea.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/PJ_krovak.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/PJ_labrd.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/PJ_laea.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/PJ_lagrng.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/PJ_larr.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/PJ_lask.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/PJ_lcc.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/PJ_lcca.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/PJ_loxim.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/PJ_lsat.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/PJ_mbt_fps.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/PJ_mbtfpp.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/PJ_mbtfpq.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/PJ_merc.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/PJ_mill.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/PJ_mod_ster.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/PJ_moll.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/PJ_natearth.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/PJ_nell.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/PJ_nell_h.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/PJ_nocol.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/PJ_nsper.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/PJ_nzmg.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/PJ_ob_tran.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/PJ_ocea.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/PJ_oea.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/PJ_omerc.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/PJ_ortho.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/PJ_poly.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/PJ_putp2.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/PJ_putp3.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/PJ_putp4p.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/PJ_putp5.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/PJ_putp6.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/PJ_robin.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/PJ_rpoly.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/PJ_sconics.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/PJ_somerc.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/PJ_stere.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/PJ_sterea.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/PJ_sts.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/PJ_tcc.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/PJ_tcea.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/PJ_tmerc.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/PJ_tpeqd.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/PJ_urm5.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/PJ_urmfps.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/PJ_vandg.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/PJ_vandg2.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/PJ_vandg4.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/PJ_wag2.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/PJ_wag3.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/PJ_wag7.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/PJ_wink1.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/PJ_wink2.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/aasincos.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/adjlon.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/bch2bps.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/bchgen.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/biveval.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/dmstor.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/emess.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gen_cheb.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/geocent.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/geod.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/geod_for.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/geod_inv.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/geod_set.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mk_cheby.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/nad_cvt.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/nad_init.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/nad_intr.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/p_series.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/pj_apply_gridshift.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/pj_apply_vgridshift.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/pj_auth.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/pj_ctx.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/pj_datum_set.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/pj_datums.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/pj_deriv.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/pj_ell_set.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/pj_ellps.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/pj_errno.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/pj_factors.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/pj_fwd.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/pj_gauss.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/pj_geocent.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/pj_gridinfo.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/pj_gridlist.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/pj_init.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/pj_initcache.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/pj_inv.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/pj_latlong.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/pj_list.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/pj_log.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/pj_malloc.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/pj_mlfn.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/pj_msfn.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/pj_mutex.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/pj_open_lib.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/pj_param.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/pj_phi2.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/pj_pr_list.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/pj_qsfn.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/pj_release.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/pj_strerrno.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/pj_transform.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/pj_tsfn.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/pj_units.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/pj_utils.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/pj_zpoly1.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/proj.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/proj_etmerc.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/proj_mdist.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/proj_rouss.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/rtodms.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/vector1.Plo at am__quote@
-
-.c.o:
- at am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(COMPILE) -c -o $@ $<
-
-.c.obj:
- at am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
- at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-
-.c.lo:
- at am__fastdepCC_TRUE@	$(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(LTCOMPILE) -c -o $@ $<
-
-mostlyclean-libtool:
-	-rm -f *.lo
-
-clean-libtool:
-	-rm -rf .libs _libs
-install-includeHEADERS: $(include_HEADERS)
-	@$(NORMAL_INSTALL)
-	@list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \
-	if test -n "$$list"; then \
-	  echo " $(MKDIR_P) '$(DESTDIR)$(includedir)'"; \
-	  $(MKDIR_P) "$(DESTDIR)$(includedir)" || exit 1; \
-	fi; \
-	for p in $$list; do \
-	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
-	  echo "$$d$$p"; \
-	done | $(am__base_list) | \
-	while read files; do \
-	  echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includedir)'"; \
-	  $(INSTALL_HEADER) $$files "$(DESTDIR)$(includedir)" || exit $$?; \
-	done
-
-uninstall-includeHEADERS:
-	@$(NORMAL_UNINSTALL)
-	@list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \
-	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
-	dir='$(DESTDIR)$(includedir)'; $(am__uninstall_files_from_dir)
-
-ID: $(am__tagged_files)
-	$(am__define_uniq_tagged_files); mkid -fID $$unique
-tags: tags-am
-TAGS: tags
-
-tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
-	set x; \
-	here=`pwd`; \
-	$(am__define_uniq_tagged_files); \
-	shift; \
-	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
-	  test -n "$$unique" || unique=$$empty_fix; \
-	  if test $$# -gt 0; then \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      "$$@" $$unique; \
-	  else \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      $$unique; \
-	  fi; \
-	fi
-ctags: ctags-am
-
-CTAGS: ctags
-ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
-	$(am__define_uniq_tagged_files); \
-	test -z "$(CTAGS_ARGS)$$unique" \
-	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$unique
-
-GTAGS:
-	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && $(am__cd) $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) "$$here"
-cscopelist: cscopelist-am
-
-cscopelist-am: $(am__tagged_files)
-	list='$(am__tagged_files)'; \
-	case "$(srcdir)" in \
-	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
-	  *) sdir=$(subdir)/$(srcdir) ;; \
-	esac; \
-	for i in $$list; do \
-	  if test -f "$$i"; then \
-	    echo "$(subdir)/$$i"; \
-	  else \
-	    echo "$$sdir/$$i"; \
-	  fi; \
-	done >> $(top_builddir)/cscope.files
-
-distclean-tags:
-	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	list='$(DISTFILES)'; \
-	  dist_files=`for file in $$list; do echo $$file; done | \
-	  sed -e "s|^$$srcdirstrip/||;t" \
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
-	case $$dist_files in \
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
-			   sort -u` ;; \
-	esac; \
-	for file in $$dist_files; do \
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  if test -d $$d/$$file; then \
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
-	    if test -d "$(distdir)/$$file"; then \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
-	  else \
-	    test -f "$(distdir)/$$file" \
-	    || cp -p $$d/$$file "$(distdir)/$$file" \
-	    || exit 1; \
-	  fi; \
-	done
-check-am: all-am
-check: check-am
-all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(HEADERS)
-install-binPROGRAMS: install-libLTLIBRARIES
-
-installdirs:
-	for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(includedir)"; do \
-	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
-	done
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
-	if test -z '$(STRIP)'; then \
-	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	      install; \
-	else \
-	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
-	fi
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
-	@echo "This command is intended for maintainers to use"
-	@echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-binPROGRAMS clean-generic clean-libLTLIBRARIES \
-	clean-libtool mostlyclean-am
-
-distclean: distclean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
-	distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am: install-includeHEADERS
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am: install-binPROGRAMS install-libLTLIBRARIES
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic \
-	mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am: uninstall-binPROGRAMS uninstall-includeHEADERS \
-	uninstall-libLTLIBRARIES
-
-.MAKE: install-am install-strip
-
-.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \
-	clean-binPROGRAMS clean-generic clean-libLTLIBRARIES \
-	clean-libtool cscopelist-am ctags ctags-am distclean \
-	distclean-compile distclean-generic distclean-libtool \
-	distclean-tags distdir dvi dvi-am html html-am info info-am \
-	install install-am install-binPROGRAMS install-data \
-	install-data-am install-dvi install-dvi-am install-exec \
-	install-exec-am install-html install-html-am \
-	install-includeHEADERS install-info install-info-am \
-	install-libLTLIBRARIES install-man install-pdf install-pdf-am \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-compile \
-	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-	tags tags-am uninstall uninstall-am uninstall-binPROGRAMS \
-	uninstall-includeHEADERS uninstall-libLTLIBRARIES
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/proj/PJ_aea.c b/src/proj/PJ_aea.c
deleted file mode 100644
index 1160198..0000000
--- a/src/proj/PJ_aea.c
+++ /dev/null
@@ -1,162 +0,0 @@
-/******************************************************************************
- * $Id: PJ_aea.c 1950 2012-05-10 16:51:51Z caress $
- *
- * Project:  PROJ.4
- * Purpose:  Implementation of the aea (Albers Equal Area) projection.
- * Author:   Gerald Evenden
- *
- ******************************************************************************
- * Copyright (c) 1995, Gerald Evenden
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *****************************************************************************/
-
-#define PROJ_PARMS__ \
-	double	ec; \
-	double	n; \
-	double	c; \
-	double	dd; \
-	double	n2; \
-	double	rho0; \
-	double	rho; \
-	double	phi1; \
-	double	phi2; \
-	double	*en; \
-	int		ellips;
-
-#define PJ_LIB__
-#include <projects.h>
-
-PJ_CVSID("$Id: PJ_aea.c 1950 2012-05-10 16:51:51Z caress $");
-
-# define EPS10	1.e-10
-# define TOL7	1.e-7
-
-PROJ_HEAD(aea, "Albers Equal Area")
-	"\n\tConic Sph&Ell\n\tlat_1= lat_2=";
-PROJ_HEAD(leac, "Lambert Equal Area Conic")
-	"\n\tConic, Sph&Ell\n\tlat_1= south";
-/* determine latitude angle phi-1 */
-# define N_ITER 15
-# define EPSILON 1.0e-7
-# define TOL 1.0e-10
-	static double
-phi1_(double qs, double Te, double Tone_es) {
-	int i;
-	double Phi, sinpi, cospi, con, com, dphi;
-
-	Phi = asin (.5 * qs);
-	if (Te < EPSILON)
-		return( Phi );
-	i = N_ITER;
-	do {
-		sinpi = sin (Phi);
-		cospi = cos (Phi);
-		con = Te * sinpi;
-		com = 1. - con * con;
-		dphi = .5 * com * com / cospi * (qs / Tone_es -
-		   sinpi / com + .5 / Te * log ((1. - con) /
-		   (1. + con)));
-		Phi += dphi;
-	} while (fabs(dphi) > TOL && --i);
-	return( i ? Phi : HUGE_VAL );
-}
-FORWARD(e_forward); /* ellipsoid & spheroid */
-	if ((P->rho = P->c - (P->ellips ? P->n * pj_qsfn(sin(lp.phi),
-		P->e, P->one_es) : P->n2 * sin(lp.phi))) < 0.) F_ERROR
-	P->rho = P->dd * sqrt(P->rho);
-	xy.x = P->rho * sin( lp.lam *= P->n );
-	xy.y = P->rho0 - P->rho * cos(lp.lam);
-	return (xy);
-}
-INVERSE(e_inverse) /* ellipsoid & spheroid */;
-	if( (P->rho = hypot(xy.x, xy.y = P->rho0 - xy.y)) != 0.0 ) {
-		if (P->n < 0.) {
-			P->rho = -P->rho;
-			xy.x = -xy.x;
-			xy.y = -xy.y;
-		}
-		lp.phi =  P->rho / P->dd;
-		if (P->ellips) {
-			lp.phi = (P->c - lp.phi * lp.phi) / P->n;
-			if (fabs(P->ec - fabs(lp.phi)) > TOL7) {
-				if ((lp.phi = phi1_(lp.phi, P->e, P->one_es)) == HUGE_VAL)
-					I_ERROR
-			} else
-				lp.phi = lp.phi < 0. ? -HALFPI : HALFPI;
-		} else if (fabs(lp.phi = (P->c - lp.phi * lp.phi) / P->n2) <= 1.)
-			lp.phi = asin(lp.phi);
-		else
-			lp.phi = lp.phi < 0. ? -HALFPI : HALFPI;
-		lp.lam = atan2(xy.x, xy.y) / P->n;
-	} else {
-		lp.lam = 0.;
-		lp.phi = P->n > 0. ? HALFPI : - HALFPI;
-	}
-	return (lp);
-}
-FREEUP; if (P) { if (P->en) pj_dalloc(P->en); pj_dalloc(P); } }
-	static PJ *
-setup(PJ *P) {
-	double cosphi, sinphi;
-	int secant;
-
-	if (fabs(P->phi1 + P->phi2) < EPS10) E_ERROR(-21);
-	P->n = sinphi = sin(P->phi1);
-	cosphi = cos(P->phi1);
-	secant = fabs(P->phi1 - P->phi2) >= EPS10;
-	if( (P->ellips = (P->es > 0.))) {
-		double ml1, m1;
-
-		if (!(P->en = pj_enfn(P->es))) E_ERROR_0;
-		m1 = pj_msfn(sinphi, cosphi, P->es);
-		ml1 = pj_qsfn(sinphi, P->e, P->one_es);
-		if (secant) { /* secant cone */
-			double ml2, m2;
-
-			sinphi = sin(P->phi2);
-			cosphi = cos(P->phi2);
-			m2 = pj_msfn(sinphi, cosphi, P->es);
-			ml2 = pj_qsfn(sinphi, P->e, P->one_es);
-			P->n = (m1 * m1 - m2 * m2) / (ml2 - ml1);
-		}
-		P->ec = 1. - .5 * P->one_es * log((1. - P->e) /
-			(1. + P->e)) / P->e;
-		P->c = m1 * m1 + P->n * ml1;
-		P->dd = 1. / P->n;
-		P->rho0 = P->dd * sqrt(P->c - P->n * pj_qsfn(sin(P->phi0),
-			P->e, P->one_es));
-	} else {
-		if (secant) P->n = .5 * (P->n + sin(P->phi2));
-		P->n2 = P->n + P->n;
-		P->c = cosphi * cosphi + P->n2 * sinphi;
-		P->dd = 1. / P->n;
-		P->rho0 = P->dd * sqrt(P->c - P->n2 * sin(P->phi0));
-	}
-	P->inv = e_inverse; P->fwd = e_forward;
-	return P;
-}
-ENTRY1(aea,en)
-	P->phi1 = pj_param(P->ctx, P->params, "rlat_1").f;
-	P->phi2 = pj_param(P->ctx, P->params, "rlat_2").f;
-ENDENTRY(setup(P))
-ENTRY1(leac,en)
-	P->phi2 = pj_param(P->ctx, P->params, "rlat_1").f;
-	P->phi1 = pj_param(P->ctx, P->params, "bsouth").i ? - HALFPI: HALFPI;
-ENDENTRY(setup(P))
diff --git a/src/proj/PJ_aeqd.c b/src/proj/PJ_aeqd.c
deleted file mode 100644
index 928ea0e..0000000
--- a/src/proj/PJ_aeqd.c
+++ /dev/null
@@ -1,271 +0,0 @@
-/******************************************************************************
- * $Id: PJ_aeqd.c 1950 2012-05-10 16:51:51Z caress $
- *
- * Project:  PROJ.4
- * Purpose:  Implementation of the aeqd (Azimuthal Equidistant) projection.
- * Author:   Gerald Evenden
- *
- ******************************************************************************
- * Copyright (c) 1995, Gerald Evenden
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *****************************************************************************/
-
-#define PROJ_PARMS__ \
-	double	sinph0; \
-	double	cosph0; \
-	double	*en; \
-	double	M1; \
-	double	N1; \
-	double	Mp; \
-	double	He; \
-	double	G; \
-	int		mode;
-#define PJ_LIB__
-#include	<projects.h>
-
-PJ_CVSID("$Id: PJ_aeqd.c 1950 2012-05-10 16:51:51Z caress $");
-
-PROJ_HEAD(aeqd, "Azimuthal Equidistant") "\n\tAzi, Sph&Ell\n\tlat_0 guam";
-
-#define EPS10 1.e-10
-#define TOL 1.e-14
-
-#define N_POLE	0
-#define S_POLE 1
-#define EQUIT	2
-#define OBLIQ	3
-FORWARD(e_guam_fwd); /* Guam elliptical */
-	double  cosphi, sinphi, t;
-
-	cosphi = cos(lp.phi);
-	sinphi = sin(lp.phi);
-	t = 1. / sqrt(1. - P->es * sinphi * sinphi);
-	xy.x = lp.lam * cosphi * t;
-	xy.y = pj_mlfn(lp.phi, sinphi, cosphi, P->en) - P->M1 +
-		.5 * lp.lam * lp.lam * cosphi * sinphi * t;
-	return (xy);
-}
-FORWARD(e_forward); /* elliptical */
-	double  coslam, cosphi, sinphi, rho, s, H, H2, c, Az, t, ct, st, cA, sA;
-
-	coslam = cos(lp.lam);
-	cosphi = cos(lp.phi);
-	sinphi = sin(lp.phi);
-	switch (P->mode) {
-	case N_POLE:
-		coslam = - coslam;
-	case S_POLE:
-		xy.x = (rho = fabs(P->Mp - pj_mlfn(lp.phi, sinphi, cosphi, P->en))) *
-			sin(lp.lam);
-		xy.y = rho * coslam;
-		break;
-	case EQUIT:
-	case OBLIQ:
-		if (fabs(lp.lam) < EPS10 && fabs(lp.phi - P->phi0) < EPS10) {
-			xy.x = xy.y = 0.;
-			break;
-		}
-		t = atan2(P->one_es * sinphi + P->es * P->N1 * P->sinph0 *
-			sqrt(1. - P->es * sinphi * sinphi), cosphi);
-		ct = cos(t); st = sin(t);
-		Az = atan2(sin(lp.lam) * ct, P->cosph0 * st - P->sinph0 * coslam * ct);
-		cA = cos(Az); sA = sin(Az);
-		s = aasin( P->ctx, fabs(sA) < TOL ?
-			(P->cosph0 * st - P->sinph0 * coslam * ct) / cA :
-			sin(lp.lam) * ct / sA );
-		H = P->He * cA;
-		H2 = H * H;
-		c = P->N1 * s * (1. + s * s * (- H2 * (1. - H2)/6. +
-			s * ( P->G * H * (1. - 2. * H2 * H2) / 8. +
-			s * ((H2 * (4. - 7. * H2) - 3. * P->G * P->G * (1. - 7. * H2)) /
-			120. - s * P->G * H / 48.))));
-		xy.x = c * sA;
-		xy.y = c * cA;
-		break;
-	}
-	return (xy);
-}
-FORWARD(s_forward); /* spherical */
-	double  coslam, cosphi, sinphi;
-
-	sinphi = sin(lp.phi);
-	cosphi = cos(lp.phi);
-	coslam = cos(lp.lam);
-	switch (P->mode) {
-	case EQUIT:
-		xy.y = cosphi * coslam;
-		goto oblcon;
-	case OBLIQ:
-		xy.y = P->sinph0 * sinphi + P->cosph0 * cosphi * coslam;
-oblcon:
-		if (fabs(fabs(xy.y) - 1.) < TOL)
-			if (xy.y < 0.)
-				F_ERROR 
-			else
-				xy.x = xy.y = 0.;
-		else {
-			xy.y = acos(xy.y);
-			xy.y /= sin(xy.y);
-			xy.x = xy.y * cosphi * sin(lp.lam);
-			xy.y *= (P->mode == EQUIT) ? sinphi :
-		   		P->cosph0 * sinphi - P->sinph0 * cosphi * coslam;
-		}
-		break;
-	case N_POLE:
-		lp.phi = -lp.phi;
-		coslam = -coslam;
-	case S_POLE:
-		if (fabs(lp.phi - HALFPI) < EPS10) F_ERROR;
-		xy.x = (xy.y = (HALFPI + lp.phi)) * sin(lp.lam);
-		xy.y *= coslam;
-		break;
-	}
-	return (xy);
-}
-INVERSE(e_guam_inv); /* Guam elliptical */
-	double x2, t;
-	int i;
-
-	x2 = 0.5 * xy.x * xy.x;
-	lp.phi = P->phi0;
-	for (i = 0; i < 3; ++i) {
-		t = P->e * sin(lp.phi);
-		lp.phi = pj_inv_mlfn(P->ctx, P->M1 + xy.y -
-			x2 * tan(lp.phi) * (t = sqrt(1. - t * t)), P->es, P->en);
-	}
-	lp.lam = xy.x * t / cos(lp.phi);
-	return (lp);
-}
-INVERSE(e_inverse); /* elliptical */
-	double c, Az, cosAz, A, B, D, E, F, psi, t;
-
-	if ((c = hypot(xy.x, xy.y)) < EPS10) {
-		lp.phi = P->phi0;
-		lp.lam = 0.;
-		return (lp);
-	}
-	if (P->mode == OBLIQ || P->mode == EQUIT) {
-		cosAz = cos(Az = atan2(xy.x, xy.y));
-		t = P->cosph0 * cosAz;
-		B = P->es * t / P->one_es;
-		A = - B * t;
-		B *= 3. * (1. - A) * P->sinph0;
-		D = c / P->N1;
-		E = D * (1. - D * D * (A * (1. + A) / 6. + B * (1. + 3.*A) * D / 24.));
-		F = 1. - E * E * (A / 2. + B * E / 6.);
-		psi = aasin(P->ctx, P->sinph0 * cos(E) + t * sin(E));
-		lp.lam = aasin(P->ctx, sin(Az) * sin(E) / cos(psi));
-		if ((t = fabs(psi)) < EPS10)
-			lp.phi = 0.;
-		else if (fabs(t - HALFPI) < 0.)
-			lp.phi = HALFPI;
-		else
-			lp.phi = atan((1. - P->es * F * P->sinph0 / sin(psi)) * tan(psi) /
-				P->one_es);
-	} else { /* Polar */
-		lp.phi = pj_inv_mlfn(P->ctx, P->mode == N_POLE ? P->Mp - c : P->Mp + c,
-			P->es, P->en);
-		lp.lam = atan2(xy.x, P->mode == N_POLE ? -xy.y : xy.y);
-	}
-	return (lp);
-}
-INVERSE(s_inverse); /* spherical */
-	double cosc, c_rh, sinc;
-
-	if ((c_rh = hypot(xy.x, xy.y)) > PI) {
-		if (c_rh - EPS10 > PI) I_ERROR;
-		c_rh = PI;
-	} else if (c_rh < EPS10) {
-		lp.phi = P->phi0;
-		lp.lam = 0.;
-		return (lp);
-	}
-	if (P->mode == OBLIQ || P->mode == EQUIT) {
-		sinc = sin(c_rh);
-		cosc = cos(c_rh);
-		if (P->mode == EQUIT) {
-                        lp.phi = aasin(P->ctx, xy.y * sinc / c_rh);
-			xy.x *= sinc;
-			xy.y = cosc * c_rh;
-		} else {
-			lp.phi = aasin(P->ctx,cosc * P->sinph0 + xy.y * sinc * P->cosph0 /
-				c_rh);
-			xy.y = (cosc - P->sinph0 * sin(lp.phi)) * c_rh;
-			xy.x *= sinc * P->cosph0;
-		}
-		lp.lam = xy.y == 0. ? 0. : atan2(xy.x, xy.y);
-	} else if (P->mode == N_POLE) {
-		lp.phi = HALFPI - c_rh;
-		lp.lam = atan2(xy.x, -xy.y);
-	} else {
-		lp.phi = c_rh - HALFPI;
-		lp.lam = atan2(xy.x, xy.y);
-	}
-	return (lp);
-}
-FREEUP;
-    if (P) {
-		if (P->en)
-			pj_dalloc(P->en);
-		pj_dalloc(P);
-	}
-}
-ENTRY1(aeqd, en)
-	P->phi0 = pj_param(P->ctx, P->params, "rlat_0").f;
-	if (fabs(fabs(P->phi0) - HALFPI) < EPS10) {
-		P->mode = P->phi0 < 0. ? S_POLE : N_POLE;
-		P->sinph0 = P->phi0 < 0. ? -1. : 1.;
-		P->cosph0 = 0.;
-	} else if (fabs(P->phi0) < EPS10) {
-		P->mode = EQUIT;
-		P->sinph0 = 0.;
-		P->cosph0 = 1.;
-	} else {
-		P->mode = OBLIQ;
-		P->sinph0 = sin(P->phi0);
-		P->cosph0 = cos(P->phi0);
-	}
-	if (! P->es) {
-		P->inv = s_inverse; P->fwd = s_forward;
-	} else {
-		if (!(P->en = pj_enfn(P->es))) E_ERROR_0;
-		if (pj_param(P->ctx, P->params, "bguam").i) {
-			P->M1 = pj_mlfn(P->phi0, P->sinph0, P->cosph0, P->en);
-			P->inv = e_guam_inv; P->fwd = e_guam_fwd;
-		} else {
-			switch (P->mode) {
-			case N_POLE:
-				P->Mp = pj_mlfn(HALFPI, 1., 0., P->en);
-				break;
-			case S_POLE:
-				P->Mp = pj_mlfn(-HALFPI, -1., 0., P->en);
-				break;
-			case EQUIT:
-			case OBLIQ:
-				P->inv = e_inverse; P->fwd = e_forward;
-				P->N1 = 1. / sqrt(1. - P->es * P->sinph0 * P->sinph0);
-				P->G = P->sinph0 * (P->He = P->e / sqrt(P->one_es));
-				P->He *= P->cosph0;
-				break;
-			}
-			P->inv = e_inverse; P->fwd = e_forward;
-		}
-	}
-ENDENTRY(P)
diff --git a/src/proj/PJ_airy.c b/src/proj/PJ_airy.c
deleted file mode 100644
index 9219302..0000000
--- a/src/proj/PJ_airy.c
+++ /dev/null
@@ -1,124 +0,0 @@
-/******************************************************************************
- * $Id: PJ_airy.c 1950 2012-05-10 16:51:51Z caress $
- *
- * Project:  PROJ.4
- * Purpose:  Implementation of the airy (Airy) projection.
- * Author:   Gerald Evenden
- *
- ******************************************************************************
- * Copyright (c) 1995, Gerald Evenden
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *****************************************************************************/
-
-#define PROJ_PARMS__ \
-	double	p_halfpi; \
-	double	sinph0; \
-	double	cosph0; \
-	double	Cb; \
-	int		mode; \
-	int		no_cut;	/* do not cut at hemisphere limit */
-#define PJ_LIB__
-#include <projects.h>
-
-PJ_CVSID("$Id: PJ_airy.c 1950 2012-05-10 16:51:51Z caress $");
-
-PROJ_HEAD(airy, "Airy") "\n\tMisc Sph, no inv.\n\tno_cut lat_b=";
-
-# define EPS 1.e-10
-# define N_POLE	0
-# define S_POLE 1
-# define EQUIT	2
-# define OBLIQ	3
-FORWARD(s_forward); /* spheroid */
-	double  sinlam, coslam, cosphi, sinphi, t, s, Krho, cosz;
-
-	sinlam = sin(lp.lam);
-	coslam = cos(lp.lam);
-	switch (P->mode) {
-	case EQUIT:
-	case OBLIQ:
-		sinphi = sin(lp.phi);
-		cosphi = cos(lp.phi);
-		cosz = cosphi * coslam;
-		if (P->mode == OBLIQ)
-			cosz = P->sinph0 * sinphi + P->cosph0 * cosz;
-		if (!P->no_cut && cosz < -EPS)
-			F_ERROR;
-		if (fabs(s = 1. - cosz) > EPS) {
-			t = 0.5 * (1. + cosz);
-			Krho = -log(t)/s - P->Cb / t;
-		} else
-			Krho = 0.5 - P->Cb;
-		xy.x = Krho * cosphi * sinlam;
-		if (P->mode == OBLIQ)
-			xy.y = Krho * (P->cosph0 * sinphi -
-				P->sinph0 * cosphi * coslam);
-		else
-			xy.y = Krho * sinphi;
-		break;
-	case S_POLE:
-	case N_POLE:
-		lp.phi = fabs(P->p_halfpi - lp.phi);
-		if (!P->no_cut && (lp.phi - EPS) > HALFPI)
-			F_ERROR;
-		if ((lp.phi *= 0.5) > EPS) {
-			t = tan(lp.phi);
-			Krho = -2.*(log(cos(lp.phi)) / t + t * P->Cb);
-			xy.x = Krho * sinlam;
-			xy.y = Krho * coslam;
-			if (P->mode == N_POLE)
-				xy.y = -xy.y;
-		} else
-			xy.x = xy.y = 0.;
-	}
-	return (xy);
-}
-FREEUP; if (P) pj_dalloc(P); }
-ENTRY0(airy)
-	double beta;
-
-	P->no_cut = pj_param(P->ctx, P->params, "bno_cut").i;
-	beta = 0.5 * (HALFPI - pj_param(P->ctx, P->params, "rlat_b").f);
-	if (fabs(beta) < EPS)
-		P->Cb = -0.5;
-	else {
-		P->Cb = 1./tan(beta);
-		P->Cb *= P->Cb * log(cos(beta));
-	}
-	if (fabs(fabs(P->phi0) - HALFPI) < EPS)
-		if (P->phi0 < 0.) {
-			P->p_halfpi = -HALFPI;
-			P->mode = S_POLE;
-		} else {
-			P->p_halfpi =  HALFPI;
-			P->mode = N_POLE;
-		}
-	else {
-		if (fabs(P->phi0) < EPS)
-			P->mode = EQUIT;
-		else {
-			P->mode = OBLIQ;
-			P->sinph0 = sin(P->phi0);
-			P->cosph0 = cos(P->phi0);
-		}
-	}
-	P->fwd = s_forward;
-	P->es = 0.;
-ENDENTRY(P)
diff --git a/src/proj/PJ_aitoff.c b/src/proj/PJ_aitoff.c
deleted file mode 100644
index 6154d17..0000000
--- a/src/proj/PJ_aitoff.c
+++ /dev/null
@@ -1,76 +0,0 @@
-/******************************************************************************
- * $Id: PJ_aitoff.c 1950 2012-05-10 16:51:51Z caress $
- *
- * Project:  PROJ.4
- * Purpose:  Implementation of the aitoff (Aitoff) and wintri (Winkel Tripel)
- *           projections.
- * Author:   Gerald Evenden
- *
- ******************************************************************************
- * Copyright (c) 1995, Gerald Evenden
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *****************************************************************************/
-
-#define PROJ_PARMS__ \
-	double	cosphi1; \
-	int		mode;
-#define PJ_LIB__
-#include <projects.h>
-
-PJ_CVSID("$Id: PJ_aitoff.c 1950 2012-05-10 16:51:51Z caress $");
-
-PROJ_HEAD(aitoff, "Aitoff") "\n\tMisc Sph";
-PROJ_HEAD(wintri, "Winkel Tripel") "\n\tMisc Sph\n\tlat_1";
-
-FORWARD(s_forward); /* spheroid */
-	double c, d;
-
-	if((d = acos(cos(lp.phi) * cos(c = 0.5 * lp.lam)))) {/* basic Aitoff */
-		xy.x = 2. * d * cos(lp.phi) * sin(c) * (xy.y = 1. / sin(d));
-		xy.y *= d * sin(lp.phi);
-	} else
-		xy.x = xy.y = 0.;
-	if (P->mode) { /* Winkel Tripel */
-		xy.x = (xy.x + lp.lam * P->cosphi1) * 0.5;
-		xy.y = (xy.y + lp.phi) * 0.5;
-	}
-	return (xy);
-}
-FREEUP; if (P) pj_dalloc(P); }
-	static PJ *
-setup(PJ *P) {
-	P->inv = 0;
-	P->fwd = s_forward;
-	P->es = 0.;
-	return P;
-}
-ENTRY0(aitoff)
-	P->mode = 0;
-ENDENTRY(setup(P))
-ENTRY0(wintri)
-	P->mode = 1;
-	if (pj_param(P->ctx, P->params, "tlat_1").i)
-        {
-		if ((P->cosphi1 = cos(pj_param(P->ctx, P->params, "rlat_1").f)) == 0.)
-			E_ERROR(-22)
-        }
-	else /* 50d28' or acos(2/pi) */
-		P->cosphi1 = 0.636619772367581343;
-ENDENTRY(setup(P))
diff --git a/src/proj/PJ_august.c b/src/proj/PJ_august.c
deleted file mode 100644
index 4e6dab9..0000000
--- a/src/proj/PJ_august.c
+++ /dev/null
@@ -1,18 +0,0 @@
-#define PJ_LIB__
-#include	<projects.h>
-PROJ_HEAD(august, "August Epicycloidal") "\n\tMisc Sph, no inv.";
-#define M 1.333333333333333
-FORWARD(s_forward); /* spheroid */
-	double t, c1, c, x1, x12, y1, y12;
-
-	t = tan(.5 * lp.phi);
-	c1 = sqrt(1. - t * t);
-	c = 1. + c1 * cos(lp.lam *= .5);
-	x1 = sin(lp.lam) *  c1 / c;
-	y1 =  t / c;
-	xy.x = M * x1 * (3. + (x12 = x1 * x1) - 3. * (y12 = y1 *  y1));
-	xy.y = M * y1 * (3. + 3. * x12 - y12);
-	return (xy);
-}
-FREEUP; if (P) pj_dalloc(P); }
-ENTRY0(august) P->inv = 0; P->fwd = s_forward; P->es = 0.; ENDENTRY(P)
diff --git a/src/proj/PJ_bacon.c b/src/proj/PJ_bacon.c
deleted file mode 100644
index dfc559b..0000000
--- a/src/proj/PJ_bacon.c
+++ /dev/null
@@ -1,41 +0,0 @@
-# define HLFPI2	2.46740110027233965467
-# define EPS	1e-10
-#define PROJ_PARMS__ \
-	int bacn; \
-	int ortl;
-#define PJ_LIB__
-#include	<projects.h>
-PROJ_HEAD(apian, "Apian Globular I") "\n\tMisc Sph, no inv.";
-PROJ_HEAD(ortel, "Ortelius Oval") "\n\tMisc Sph, no inv.";
-PROJ_HEAD(bacon, "Bacon Globular") "\n\tMisc Sph, no inv.";
-FORWARD(s_forward); /* spheroid */
-	double ax, f;
-
-	xy.y = P->bacn ? HALFPI * sin(lp.phi) : lp.phi;
-	if ((ax = fabs(lp.lam)) >= EPS) {
-		if (P->ortl && ax >= HALFPI)
-			xy.x = sqrt(HLFPI2 - lp.phi * lp.phi + EPS) + ax - HALFPI;
-		else {
-			f = 0.5 * (HLFPI2 / ax + ax);
-			xy.x = ax - f + sqrt(f * f - xy.y * xy.y);
-		}
-		if (lp.lam < 0.) xy.x = - xy.x;
-	} else
-		xy.x = 0.;
-	return (xy);
-}
-FREEUP; if (P) pj_dalloc(P); }
-ENTRY0(bacon)
-	P->bacn = 1;
-	P->ortl = 0;
-	P->es = 0.; P->fwd = s_forward;
-ENDENTRY(P)
-ENTRY0(apian)
-	P->bacn = P->ortl = 0;
-	P->es = 0.; P->fwd = s_forward;
-ENDENTRY(P)
-ENTRY0(ortel)
-	P->bacn = 0;
-	P->ortl = 1;
-	P->es = 0.; P->fwd = s_forward;
-ENDENTRY(P)
diff --git a/src/proj/PJ_bipc.c b/src/proj/PJ_bipc.c
deleted file mode 100644
index 471e726..0000000
--- a/src/proj/PJ_bipc.c
+++ /dev/null
@@ -1,132 +0,0 @@
-#define PROJ_PARMS__ \
-	int	noskew;
-#define PJ_LIB__
-# include	<projects.h>
-PROJ_HEAD(bipc, "Bipolar conic of western hemisphere")
-	"\n\tConic Sph.";
-# define EPS	1e-10
-# define EPS10	1e-10
-# define ONEEPS 1.000000001
-# define NITER	10
-# define lamB	-.34894976726250681539
-# define n	.63055844881274687180
-# define F	1.89724742567461030582
-# define Azab	.81650043674686363166
-# define Azba	1.82261843856185925133
-# define T	1.27246578267089012270
-# define rhoc	1.20709121521568721927
-# define cAzc	.69691523038678375519
-# define sAzc	.71715351331143607555
-# define C45	.70710678118654752469
-# define S45	.70710678118654752410
-# define C20	.93969262078590838411
-# define S20	-.34202014332566873287
-# define R110	1.91986217719376253360
-# define R104	1.81514242207410275904
-FORWARD(s_forward); /* spheroid */
-	double cphi, sphi, tphi, t, al, Az, z, Av, cdlam, sdlam, r;
-	int tag;
-
-	cphi = cos(lp.phi);
-	sphi = sin(lp.phi);
-	cdlam = cos(sdlam = lamB - lp.lam);
-	sdlam = sin(sdlam);
-	if (fabs(fabs(lp.phi) - HALFPI) < EPS10) {
-		Az = lp.phi < 0. ? PI : 0.;
-		tphi = HUGE_VAL;
-	} else {
-		tphi = sphi / cphi;
-		Az = atan2(sdlam , C45 * (tphi - cdlam));
-	}
-	if( (tag = (Az > Azba)) ) {
-		cdlam = cos(sdlam = lp.lam + R110);
-		sdlam = sin(sdlam);
-		z = S20 * sphi + C20 * cphi * cdlam;
-		if (fabs(z) > 1.) {
-			if (fabs(z) > ONEEPS) F_ERROR
-			else z = z < 0. ? -1. : 1.;
-		} else
-			z = acos(z);
-		if (tphi != HUGE_VAL)
-			Az = atan2(sdlam, (C20 * tphi - S20 * cdlam));
-		Av = Azab;
-		xy.y = rhoc;
-	} else {
-		z = S45 * (sphi + cphi * cdlam);
-		if (fabs(z) > 1.) {
-			if (fabs(z) > ONEEPS) F_ERROR
-			else z = z < 0. ? -1. : 1.;
-		} else
-			z = acos(z);
-		Av = Azba;
-		xy.y = -rhoc;
-	}
-	if (z < 0.) F_ERROR;
-	r = F * (t = pow(tan(.5 * z), n));
-	if ((al = .5 * (R104 - z)) < 0.) F_ERROR;
-	al = (t + pow(al, n)) / T;
-	if (fabs(al) > 1.) {
-		if (fabs(al) > ONEEPS) F_ERROR
-		else al = al < 0. ? -1. : 1.;
-	} else
-		al = acos(al);
-	if (fabs(t = n * (Av - Az)) < al)
-		r /= cos(al + (tag ? t : -t));
-	xy.x = r * sin(t);
-	xy.y += (tag ? -r : r) * cos(t);
-	if (P->noskew) {
-		t = xy.x;
-		xy.x = -xy.x * cAzc - xy.y * sAzc; 
-		xy.y = -xy.y * cAzc + t * sAzc; 
-	}
-	return (xy);
-}
-INVERSE(s_inverse); /* spheroid */
-	double t, r, rp, rl, al, z, fAz, Az, s, c, Av;
-	int neg, i;
-
-	if (P->noskew) {
-		t = xy.x;
-		xy.x = -xy.x * cAzc + xy.y * sAzc; 
-		xy.y = -xy.y * cAzc - t * sAzc; 
-	}
-	if( (neg = (xy.x < 0.)) ) {
-		xy.y = rhoc - xy.y;
-		s = S20;
-		c = C20;
-		Av = Azab;
-	} else {
-		xy.y += rhoc;
-		s = S45;
-		c = C45;
-		Av = Azba;
-	}
-	rl = rp = r = hypot(xy.x, xy.y);
-	fAz = fabs(Az = atan2(xy.x, xy.y));
-	for (i = NITER; i ; --i) {
-		z = 2. * atan(pow(r / F,1 / n));
-		al = acos((pow(tan(.5 * z), n) +
-		   pow(tan(.5 * (R104 - z)), n)) / T);
-		if (fAz < al)
-			r = rp * cos(al + (neg ? Az : -Az));
-		if (fabs(rl - r) < EPS)
-			break;
-		rl = r;
-	}
-	if (! i) I_ERROR;
-	Az = Av - Az / n;
-	lp.phi = asin(s * cos(z) + c * sin(z) * cos(Az));
-	lp.lam = atan2(sin(Az), c / tan(z) - s * cos(Az));
-	if (neg)
-		lp.lam -= R110;
-	else
-		lp.lam = lamB - lp.lam;
-	return (lp);
-}
-FREEUP; if (P) pj_dalloc(P); }
-ENTRY0(bipc)
-	P->noskew = pj_param(P->ctx, P->params, "bns").i;
-	P->inv = s_inverse;
-	P->fwd = s_forward;
-	P->es = 0.;
-ENDENTRY(P)
diff --git a/src/proj/PJ_boggs.c b/src/proj/PJ_boggs.c
deleted file mode 100644
index 48fdc9a..0000000
--- a/src/proj/PJ_boggs.c
+++ /dev/null
@@ -1,32 +0,0 @@
-#define PJ_LIB__
-# include	<projects.h>
-PROJ_HEAD(boggs, "Boggs Eumorphic") "\n\tPCyl., no inv., Sph.";
-# define NITER	20
-# define EPS	1e-7
-# define ONETOL 1.000001
-# define FXC	2.00276
-# define FXC2	1.11072
-# define FYC	0.49931
-# define FYC2	1.41421356237309504880
-FORWARD(s_forward); /* spheroid */
-	double theta, th1, c;
-	int i;
-
-	theta = lp.phi;
-	if (fabs(fabs(lp.phi) - HALFPI) < EPS)
-		xy.x = 0.;
-	else {
-		c = sin(theta) * PI;
-		for (i = NITER; i; --i) {
-			theta -= th1 = (theta + sin(theta) - c) /
-				(1. + cos(theta));
-			if (fabs(th1) < EPS) break;
-		}
-		theta *= 0.5;
-		xy.x = FXC * lp.lam / (1. / cos(lp.phi) + FXC2 / cos(theta));
-	}
-	xy.y = FYC * (lp.phi + FYC2 * sin(theta));
-	return (xy);
-}
-FREEUP; if (P) pj_dalloc(P); }
-ENTRY0(boggs) P->es = 0.; P->fwd = s_forward; ENDENTRY(P)
diff --git a/src/proj/PJ_bonne.c b/src/proj/PJ_bonne.c
deleted file mode 100644
index 4b1e786..0000000
--- a/src/proj/PJ_bonne.c
+++ /dev/null
@@ -1,85 +0,0 @@
-#define PROJ_PARMS__ \
-	double phi1; \
-	double cphi1; \
-	double am1; \
-	double m1; \
-	double *en;
-#define PJ_LIB__
-#include	<projects.h>
-PROJ_HEAD(bonne, "Bonne (Werner lat_1=90)")
-	"\n\tConic Sph&Ell\n\tlat_1=";
-#define EPS10	1e-10
-FORWARD(e_forward); /* ellipsoid */
-	double rh, E, c;
-
-	rh = P->am1 + P->m1 - pj_mlfn(lp.phi, E = sin(lp.phi), c = cos(lp.phi), P->en);
-	E = c * lp.lam / (rh * sqrt(1. - P->es * E * E));
-	xy.x = rh * sin(E);
-	xy.y = P->am1 - rh * cos(E);
-	return (xy);
-}
-FORWARD(s_forward); /* spheroid */
-	double E, rh;
-
-	rh = P->cphi1 + P->phi1 - lp.phi;
-	if (fabs(rh) > EPS10) {
-		xy.x = rh * sin(E = lp.lam * cos(lp.phi) / rh);
-		xy.y = P->cphi1 - rh * cos(E);
-	} else
-		xy.x = xy.y = 0.;
-	return (xy);
-}
-INVERSE(s_inverse); /* spheroid */
-	double rh;
-
-	rh = hypot(xy.x, xy.y = P->cphi1 - xy.y);
-	lp.phi = P->cphi1 + P->phi1 - rh;
-	if (fabs(lp.phi) > HALFPI) I_ERROR;
-	if (fabs(fabs(lp.phi) - HALFPI) <= EPS10)
-		lp.lam = 0.;
-	else
-		lp.lam = rh * atan2(xy.x, xy.y) / cos(lp.phi);
-	return (lp);
-}
-INVERSE(e_inverse); /* ellipsoid */
-	double s, rh;
-
-	rh = hypot(xy.x, xy.y = P->am1 - xy.y);
-	lp.phi = pj_inv_mlfn(P->ctx, P->am1 + P->m1 - rh, P->es, P->en);
-	if ((s = fabs(lp.phi)) < HALFPI) {
-		s = sin(lp.phi);
-		lp.lam = rh * atan2(xy.x, xy.y) *
-		   sqrt(1. - P->es * s * s) / cos(lp.phi);
-	} else if (fabs(s - HALFPI) <= EPS10)
-		lp.lam = 0.;
-	else I_ERROR;
-	return (lp);
-}
-FREEUP;
-	if (P) {
-		if (P->en)
-			pj_dalloc(P->en);
-		pj_dalloc(P);
-	}
-}
-ENTRY1(bonne, en)
-	double c;
-
-	P->phi1 = pj_param(P->ctx, P->params, "rlat_1").f;
-	if (fabs(P->phi1) < EPS10) E_ERROR(-23);
-	if (P->es) {
-		P->en = pj_enfn(P->es);
-		P->m1 = pj_mlfn(P->phi1, P->am1 = sin(P->phi1),
-			c = cos(P->phi1), P->en);
-		P->am1 = c / (sqrt(1. - P->es * P->am1 * P->am1) * P->am1);
-		P->inv = e_inverse;
-		P->fwd = e_forward;
-	} else {
-		if (fabs(P->phi1) + EPS10 >= HALFPI)
-			P->cphi1 = 0.;
-		else
-			P->cphi1 = 1. / tan(P->phi1);
-		P->inv = s_inverse;
-		P->fwd = s_forward;
-	}
-ENDENTRY(P)
diff --git a/src/proj/PJ_cass.c b/src/proj/PJ_cass.c
deleted file mode 100644
index 38fa9db..0000000
--- a/src/proj/PJ_cass.c
+++ /dev/null
@@ -1,79 +0,0 @@
-#define PROJ_PARMS__ \
-	double m0; \
-	double n; \
-	double t; \
-	double a1; \
-	double c; \
-	double r; \
-	double dd; \
-	double d2; \
-	double a2; \
-	double tn; \
-	double *en;
-#define PJ_LIB__
-# include	<projects.h>
-PROJ_HEAD(cass, "Cassini") "\n\tCyl, Sph&Ell";
-# define EPS10	1e-10
-# define C1	.16666666666666666666
-# define C2	.00833333333333333333
-# define C3	.04166666666666666666
-# define C4	.33333333333333333333
-# define C5	.06666666666666666666
-FORWARD(e_forward); /* ellipsoid */
-	xy.y = pj_mlfn(lp.phi, P->n = sin(lp.phi), P->c = cos(lp.phi), P->en);
-	P->n = 1./sqrt(1. - P->es * P->n * P->n);
-	P->tn = tan(lp.phi); P->t = P->tn * P->tn;
-	P->a1 = lp.lam * P->c;
-	P->c *= P->es * P->c / (1 - P->es);
-	P->a2 = P->a1 * P->a1;
-	xy.x = P->n * P->a1 * (1. - P->a2 * P->t *
-		(C1 - (8. - P->t + 8. * P->c) * P->a2 * C2));
-	xy.y -= P->m0 - P->n * P->tn * P->a2 *
-		(.5 + (5. - P->t + 6. * P->c) * P->a2 * C3);
-	return (xy);
-}
-FORWARD(s_forward); /* spheroid */
-	xy.x = asin(cos(lp.phi) * sin(lp.lam));
-	xy.y = atan2(tan(lp.phi) , cos(lp.lam)) - P->phi0;
-	return (xy);
-}
-INVERSE(e_inverse); /* ellipsoid */
-	double ph1;
-
-	ph1 = pj_inv_mlfn(P->ctx, P->m0 + xy.y, P->es, P->en);
-	P->tn = tan(ph1); P->t = P->tn * P->tn;
-	P->n = sin(ph1);
-	P->r = 1. / (1. - P->es * P->n * P->n);
-	P->n = sqrt(P->r);
-	P->r *= (1. - P->es) * P->n;
-	P->dd = xy.x / P->n;
-	P->d2 = P->dd * P->dd;
-	lp.phi = ph1 - (P->n * P->tn / P->r) * P->d2 *
-		(.5 - (1. + 3. * P->t) * P->d2 * C3);
-	lp.lam = P->dd * (1. + P->t * P->d2 *
-		(-C4 + (1. + 3. * P->t) * P->d2 * C5)) / cos(ph1);
-	return (lp);
-}
-INVERSE(s_inverse); /* spheroid */
-	lp.phi = asin(sin(P->dd = xy.y + P->phi0) * cos(xy.x));
-	lp.lam = atan2(tan(xy.x), cos(P->dd));
-	return (lp);
-}
-FREEUP;
-	if (P) {
-		if (P->en)
-			pj_dalloc(P->en);
-		pj_dalloc(P);
-	}
-}
-ENTRY1(cass, en)
-	if (P->es) {
-		if (!(P->en = pj_enfn(P->es))) E_ERROR_0;
-		P->m0 = pj_mlfn(P->phi0, sin(P->phi0), cos(P->phi0), P->en);
-		P->inv = e_inverse;
-		P->fwd = e_forward;
-	} else {
-		P->inv = s_inverse;
-		P->fwd = s_forward;
-	}
-ENDENTRY(P)
diff --git a/src/proj/PJ_cc.c b/src/proj/PJ_cc.c
deleted file mode 100644
index be1191b..0000000
--- a/src/proj/PJ_cc.c
+++ /dev/null
@@ -1,19 +0,0 @@
-#define PROJ_PARMS__ \
-	double ap;
-#define PJ_LIB__
-#include	<projects.h>
-PROJ_HEAD(cc, "Central Cylindrical") "\n\tCyl, Sph";
-#define EPS10 1.e-10
-FORWARD(s_forward); /* spheroid */
-	if (fabs(fabs(lp.phi) - HALFPI) <= EPS10) F_ERROR;
-	xy.x = lp.lam;
-	xy.y = tan(lp.phi);
-	return (xy);
-}
-INVERSE(s_inverse); /* spheroid */
-	lp.phi = atan(xy.y);
-	lp.lam = xy.x;
-	return (lp);
-}
-FREEUP; if (P) pj_dalloc(P); }
-ENTRY0(cc) P->es = 0.; P->inv = s_inverse; P->fwd = s_forward; ENDENTRY(P)
diff --git a/src/proj/PJ_cea.c b/src/proj/PJ_cea.c
deleted file mode 100644
index f5b7883..0000000
--- a/src/proj/PJ_cea.c
+++ /dev/null
@@ -1,60 +0,0 @@
-#define PROJ_PARMS__ \
-	double qp; \
-	double *apa;
-#define PJ_LIB__
-# include	<projects.h>
-PROJ_HEAD(cea, "Equal Area Cylindrical") "\n\tCyl, Sph&Ell\n\tlat_ts=";
-# define EPS	1e-10
-FORWARD(e_forward); /* spheroid */
-	xy.x = P->k0 * lp.lam;
-	xy.y = .5 * pj_qsfn(sin(lp.phi), P->e, P->one_es) / P->k0;
-	return (xy);
-}
-FORWARD(s_forward); /* spheroid */
-	xy.x = P->k0 * lp.lam;
-	xy.y = sin(lp.phi) / P->k0;
-	return (xy);
-}
-INVERSE(e_inverse); /* spheroid */
-	lp.phi = pj_authlat(asin( 2. * xy.y * P->k0 / P->qp), P->apa);
-	lp.lam = xy.x / P->k0;
-	return (lp);
-}
-INVERSE(s_inverse); /* spheroid */
-	double t;
-
-	if ((t = fabs(xy.y *= P->k0)) - EPS <= 1.) {
-		if (t >= 1.)
-			lp.phi = xy.y < 0. ? -HALFPI : HALFPI;
-		else
-			lp.phi = asin(xy.y);
-		lp.lam = xy.x / P->k0;
-	} else I_ERROR;
-	return (lp);
-}
-FREEUP;
-	if (P) {
-		if (P->apa)
-			pj_dalloc(P->apa);
-		pj_dalloc(P);
-	}
-}
-ENTRY1(cea, apa)
-	double t;
-
-	if (pj_param(P->ctx, P->params, "tlat_ts").i &&
-	    (P->k0 = cos(t = pj_param(P->ctx, P->params, "rlat_ts").f)) < 0.)
-	  E_ERROR(-24);
-	if (P->es) {
-		t = sin(t);
-		P->k0 /= sqrt(1. - P->es * t * t);
-		P->e = sqrt(P->es);
-		if (!(P->apa = pj_authset(P->es))) E_ERROR_0;
-		P->qp = pj_qsfn(1., P->e, P->one_es);
-		P->inv = e_inverse;
-		P->fwd = e_forward;
-	} else {
-		P->inv = s_inverse;
-		P->fwd = s_forward;
-	}
-ENDENTRY(P)
diff --git a/src/proj/PJ_chamb.c b/src/proj/PJ_chamb.c
deleted file mode 100644
index 65f2112..0000000
--- a/src/proj/PJ_chamb.c
+++ /dev/null
@@ -1,112 +0,0 @@
-typedef struct { double r, Az; } VECT;
-#define PROJ_PARMS__ \
-	struct { /* control point data */ \
-		double phi, lam; \
-		double cosphi, sinphi; \
-		VECT v; \
-		XY	p; \
-		double Az; \
-	} c[3]; \
-	XY p; \
-	double beta_0, beta_1, beta_2;
-#define PJ_LIB__
-#include	<projects.h>
-PROJ_HEAD(chamb, "Chamberlin Trimetric") "\n\tMisc Sph, no inv."
-"\n\tlat_1= lon_1= lat_2= lon_2= lat_3= lon_3=";
-#include	<stdio.h>
-#define THIRD 0.333333333333333333
-#define TOL 1e-9
-	static VECT /* distance and azimuth from point 1 to point 2 */
-vect(projCtx ctx, double dphi, double c1, double s1, double c2, double s2, double dlam) {
-	VECT v;
-	double cdl, dp, dl;
-
-	cdl = cos(dlam);
-	if (fabs(dphi) > 1. || fabs(dlam) > 1.)
-		v.r = aacos(ctx, s1 * s2 + c1 * c2 * cdl);
-	else { /* more accurate for smaller distances */
-		dp = sin(.5 * dphi);
-		dl = sin(.5 * dlam);
-		v.r = 2. * aasin(ctx,sqrt(dp * dp + c1 * c2 * dl * dl));
-	}
-	if (fabs(v.r) > TOL)
-		v.Az = atan2(c2 * sin(dlam), c1 * s2 - s1 * c2 * cdl);
-	else
-		v.r = v.Az = 0.;
-	return v;
-}
-	static double /* law of cosines */
-lc(projCtx ctx, double b,double c,double a) {
-	return aacos(ctx, .5 * (b * b + c * c - a * a) / (b * c));
-}
-FORWARD(s_forward); /* spheroid */
-	double sinphi, cosphi, a;
-	VECT v[3];
-	int i, j;
-
-	sinphi = sin(lp.phi);
-	cosphi = cos(lp.phi);
-	for (i = 0; i < 3; ++i) { /* dist/azimiths from control */
-		v[i] = vect(P->ctx, lp.phi - P->c[i].phi, P->c[i].cosphi, P->c[i].sinphi,
-			cosphi, sinphi, lp.lam - P->c[i].lam);
-		if ( ! v[i].r)
-			break;
-		v[i].Az = adjlon(v[i].Az - P->c[i].v.Az);
-	}
-	if (i < 3) /* current point at control point */
-		xy = P->c[i].p;
-	else { /* point mean of intersepts */
-		xy = P->p;
-		for (i = 0; i < 3; ++i) {
-			j = i == 2 ? 0 : i + 1;
-			a = lc(P->ctx,P->c[i].v.r, v[i].r, v[j].r);
-			if (v[i].Az < 0.)
-				a = -a;
-			if (! i) { /* coord comp unique to each arc */
-				xy.x += v[i].r * cos(a);
-				xy.y -= v[i].r * sin(a);
-			} else if (i == 1) {
-				a = P->beta_1 - a;
-				xy.x -= v[i].r * cos(a);
-				xy.y -= v[i].r * sin(a);
-			} else {
-				a = P->beta_2 - a;
-				xy.x += v[i].r * cos(a);
-				xy.y += v[i].r * sin(a);
-			}
-		}
-		xy.x *= THIRD; /* mean of arc intercepts */
-		xy.y *= THIRD;
-	}
-	return xy;
-}
-FREEUP; if (P) pj_dalloc(P); }
-ENTRY0(chamb)
-	int i, j;
-	char line[10];
-
-	for (i = 0; i < 3; ++i) { /* get control point locations */
-		(void)sprintf(line, "rlat_%d", i+1);
-		P->c[i].phi = pj_param(P->ctx, P->params, line).f;
-		(void)sprintf(line, "rlon_%d", i+1);
-		P->c[i].lam = pj_param(P->ctx, P->params, line).f;
-		P->c[i].lam = adjlon(P->c[i].lam - P->lam0);
-		P->c[i].cosphi = cos(P->c[i].phi);
-		P->c[i].sinphi = sin(P->c[i].phi);
-	}
-	for (i = 0; i < 3; ++i) { /* inter ctl pt. distances and azimuths */
-		j = i == 2 ? 0 : i + 1;
-		P->c[i].v = vect(P->ctx,P->c[j].phi - P->c[i].phi, P->c[i].cosphi, P->c[i].sinphi,
-			P->c[j].cosphi, P->c[j].sinphi, P->c[j].lam - P->c[i].lam);
-		if (! P->c[i].v.r) E_ERROR(-25);
-		/* co-linearity problem ignored for now */
-	}
-	P->beta_0 = lc(P->ctx,P->c[0].v.r, P->c[2].v.r, P->c[1].v.r);
-	P->beta_1 = lc(P->ctx,P->c[0].v.r, P->c[1].v.r, P->c[2].v.r);
-	P->beta_2 = PI - P->beta_0;
-	P->p.y = 2. * (P->c[0].p.y = P->c[1].p.y = P->c[2].v.r * sin(P->beta_0));
-	P->c[2].p.y = 0.;
-	P->c[0].p.x = - (P->c[1].p.x = 0.5 * P->c[0].v.r);
-	P->p.x = P->c[2].p.x = P->c[0].p.x + P->c[2].v.r * cos(P->beta_0);
-	P->es = 0.; P->fwd = s_forward;
-ENDENTRY(P)
diff --git a/src/proj/PJ_collg.c b/src/proj/PJ_collg.c
deleted file mode 100644
index ca389a6..0000000
--- a/src/proj/PJ_collg.c
+++ /dev/null
@@ -1,29 +0,0 @@
-#define PJ_LIB__
-# include	<projects.h>
-PROJ_HEAD(collg, "Collignon") "\n\tPCyl, Sph.";
-#define FXC	1.12837916709551257390
-#define FYC	1.77245385090551602729
-#define ONEEPS	1.0000001
-FORWARD(s_forward); /* spheroid */
-	if ((xy.y = 1. - sin(lp.phi)) <= 0.)
-		xy.y = 0.;
-	else
-		xy.y = sqrt(xy.y);
-	xy.x = FXC * lp.lam * xy.y;
-	xy.y = FYC * (1. - xy.y);
-	return (xy);
-}
-INVERSE(s_inverse); /* spheroid */
-	lp.phi = xy.y / FYC - 1.;
-	if (fabs(lp.phi = 1. - lp.phi * lp.phi) < 1.)
-		lp.phi = asin(lp.phi);
-	else if (fabs(lp.phi) > ONEEPS) I_ERROR
-	else	lp.phi = lp.phi < 0. ? -HALFPI : HALFPI;
-	if ((lp.lam = 1. - sin(lp.phi)) <= 0.)
-		lp.lam = 0.;
-	else
-		lp.lam = xy.x / (FXC * sqrt(lp.lam));
-	return (lp);
-}
-FREEUP; if (P) pj_dalloc(P); }
-ENTRY0(collg) P->es = 0.; P->inv = s_inverse; P->fwd = s_forward; ENDENTRY(P)
diff --git a/src/proj/PJ_crast.c b/src/proj/PJ_crast.c
deleted file mode 100644
index 5351a39..0000000
--- a/src/proj/PJ_crast.c
+++ /dev/null
@@ -1,22 +0,0 @@
-#define PJ_LIB__
-# include	<projects.h>
-PROJ_HEAD(crast, "Craster Parabolic (Putnins P4)")
-"\n\tPCyl., Sph.";
-#define XM	0.97720502380583984317
-#define RXM	1.02332670794648848847
-#define YM	3.06998012383946546542
-#define RYM	0.32573500793527994772
-#define THIRD	0.333333333333333333
-FORWARD(s_forward); /* spheroid */
-	lp.phi *= THIRD;
-	xy.x = XM * lp.lam * (2. * cos(lp.phi + lp.phi) - 1.);
-	xy.y = YM * sin(lp.phi);
-	return (xy);
-}
-INVERSE(s_inverse); /* spheroid */
-	lp.phi = 3. * asin(xy.y * RYM);
-	lp.lam = xy.x * RXM / (2. * cos((lp.phi + lp.phi) * THIRD) - 1);
-	return (lp);
-}
-FREEUP; if (P) pj_dalloc(P); }
-ENTRY0(crast) P->es = 0.; P->inv = s_inverse; P->fwd = s_forward; ENDENTRY(P)
diff --git a/src/proj/PJ_denoy.c b/src/proj/PJ_denoy.c
deleted file mode 100644
index 8b80031..0000000
--- a/src/proj/PJ_denoy.c
+++ /dev/null
@@ -1,18 +0,0 @@
-#define PJ_LIB__
-#include	<projects.h>
-PROJ_HEAD(denoy, "Denoyer Semi-Elliptical") "\n\tPCyl., no inv., Sph.";
-#define C0	0.95
-#define C1	-.08333333333333333333
-#define C3	.00166666666666666666
-#define D1	0.9
-#define D5	0.03
-FORWARD(s_forward); /* spheroid */
-	xy.y = lp.phi;
-	xy.x = lp.lam;
-	lp.lam = fabs(lp.lam);
-	xy.x *= cos((C0 + lp.lam * (C1 + lp.lam * lp.lam * C3)) *
-		(lp.phi * (D1 + D5 * lp.phi * lp.phi * lp.phi * lp.phi)));
-	return (xy);
-}
-FREEUP; if (P) pj_dalloc(P); }
-ENTRY0(denoy) P->es = 0.; P->fwd = s_forward; ENDENTRY(P)
diff --git a/src/proj/PJ_eck1.c b/src/proj/PJ_eck1.c
deleted file mode 100644
index 9b31b09..0000000
--- a/src/proj/PJ_eck1.c
+++ /dev/null
@@ -1,19 +0,0 @@
-#define PJ_LIB__
-#include	<projects.h>
-PROJ_HEAD(eck1, "Eckert I") "\n\tPCyl., Sph.";
-#define FC	.92131773192356127802
-#define RP	.31830988618379067154
-FORWARD(s_forward); /* spheroid */
-	xy.x = FC * lp.lam * (1. - RP * fabs(lp.phi));
-	xy.y = FC * lp.phi;
-	return (xy);
-}
-INVERSE(s_inverse); /* spheroid */
-	lp.phi = xy.y / FC;
-	lp.lam = xy.x / (FC * (1. - RP * fabs(lp.phi)));
-	return (lp);
-}
-FREEUP; if (P) pj_dalloc(P); }
-ENTRY0(eck1)
-	P->es = 0.; P->inv = s_inverse; P->fwd = s_forward;
-ENDENTRY(P)
diff --git a/src/proj/PJ_eck2.c b/src/proj/PJ_eck2.c
deleted file mode 100644
index f8e0154..0000000
--- a/src/proj/PJ_eck2.c
+++ /dev/null
@@ -1,28 +0,0 @@
-#define PJ_LIB__
-# include	<projects.h>
-PROJ_HEAD(eck2, "Eckert II") "\n\tPCyl. Sph.";
-#define FXC	0.46065886596178063902
-#define FYC	1.44720250911653531871
-#define C13	0.33333333333333333333
-#define ONEEPS	1.0000001
-FORWARD(s_forward); /* spheroid */
-	xy.x = FXC * lp.lam * (xy.y = sqrt(4. - 3. * sin(fabs(lp.phi))));
-	xy.y = FYC * (2. - xy.y);
-	if ( lp.phi < 0.) xy.y = -xy.y;
-	return (xy);
-}
-INVERSE(s_inverse); /* spheroid */
-	lp.lam = xy.x / (FXC * ( lp.phi = 2. - fabs(xy.y) / FYC) );
-	lp.phi = (4. - lp.phi * lp.phi) * C13;
-	if (fabs(lp.phi) >= 1.) {
-		if (fabs(lp.phi) > ONEEPS)	I_ERROR
-		else
-			lp.phi = lp.phi < 0. ? -HALFPI : HALFPI;
-	} else
-		lp.phi = asin(lp.phi);
-	if (xy.y < 0)
-		lp.phi = -lp.phi;
-	return (lp);
-}
-FREEUP; if (P) pj_dalloc(P); }
-ENTRY0(eck2); P->es = 0.; P->inv = s_inverse; P->fwd = s_forward; ENDENTRY(P)
diff --git a/src/proj/PJ_eck3.c b/src/proj/PJ_eck3.c
deleted file mode 100644
index d7755f0..0000000
--- a/src/proj/PJ_eck3.c
+++ /dev/null
@@ -1,50 +0,0 @@
-#define PROJ_PARMS__ \
-	double C_x, C_y, A, B;
-#define PJ_LIB__
-#include	<projects.h>
-PROJ_HEAD(eck3, "Eckert III") "\n\tPCyl, Sph.";
-PROJ_HEAD(putp1, "Putnins P1") "\n\tPCyl, Sph.";
-PROJ_HEAD(wag6, "Wagner VI") "\n\tPCyl, Sph.";
-PROJ_HEAD(kav7, "Kavraisky VII") "\n\tPCyl, Sph.";
-FORWARD(s_forward); /* spheroid */
-	xy.y = P->C_y * lp.phi;
-	xy.x = P->C_x * lp.lam * (P->A + asqrt(1. - P->B * lp.phi * lp.phi));
-	return (xy);
-}
-INVERSE(s_inverse); /* spheroid */
-	lp.phi = xy.y / P->C_y;
-	lp.lam = xy.x / (P->C_x * (P->A + asqrt(1. - P->B * lp.phi * lp.phi)));
-	return (lp);
-}
-FREEUP; if (P) pj_dalloc(P); }
-	static PJ *
-setup(PJ *P) {
-	P->es = 0.;
-	P->inv = s_inverse;
-	P->fwd = s_forward;
-	return P;
-}
-ENTRY0(eck3)
-	P->C_x = .42223820031577120149;
-	P->C_y = .84447640063154240298;
-	P->A = 1.;
-	P->B = 0.4052847345693510857755;
-ENDENTRY(setup(P))
-ENTRY0(kav7)
-	P->C_x = 0.2632401569273184856851;
-	P->C_x = 0.8660254037844;
-	P->C_y = 1.;
-	P->A = 0.;
-	P->B = 0.30396355092701331433;
-ENDENTRY(setup(P))
-ENTRY0(wag6);
-	P->C_x = P->C_y = 0.94745;
-	P->A = 0.;
-	P->B = 0.30396355092701331433;
-ENDENTRY(setup(P))
-ENTRY0(putp1);
-	P->C_x = 1.89490;
-	P->C_y = 0.94745;
-	P->A = -0.5;
-	P->B = 0.30396355092701331433;
-ENDENTRY(setup(P))
diff --git a/src/proj/PJ_eck4.c b/src/proj/PJ_eck4.c
deleted file mode 100644
index f90267d..0000000
--- a/src/proj/PJ_eck4.c
+++ /dev/null
@@ -1,44 +0,0 @@
-#define PJ_LIB__
-#include	<projects.h>
-PROJ_HEAD(eck4, "Eckert IV") "\n\tPCyl, Sph.";
-#define C_x	.42223820031577120149
-#define C_y	1.32650042817700232218
-#define RC_y	.75386330736002178205
-#define C_p	3.57079632679489661922
-#define RC_p	.28004957675577868795
-#define EPS	1e-7
-#define NITER	6
-FORWARD(s_forward); /* spheroid */
-	double p, V, s, c;
-	int i;
-
-	p = C_p * sin(lp.phi);
-	V = lp.phi * lp.phi;
-	lp.phi *= 0.895168 + V * ( 0.0218849 + V * 0.00826809 );
-	for (i = NITER; i ; --i) {
-		c = cos(lp.phi);
-		s = sin(lp.phi);
-		lp.phi -= V = (lp.phi + s * (c + 2.) - p) /
-			(1. + c * (c + 2.) - s * s);
-		if (fabs(V) < EPS)
-			break;
-	}
-	if (!i) {
-		xy.x = C_x * lp.lam;
-		xy.y = lp.phi < 0. ? -C_y : C_y;
-	} else {
-		xy.x = C_x * lp.lam * (1. + cos(lp.phi));
-		xy.y = C_y * sin(lp.phi);
-	}
-	return (xy);
-}
-INVERSE(s_inverse); /* spheroid */
-	double c;
-
-	lp.phi = aasin(P->ctx,xy.y / C_y);
-	lp.lam = xy.x / (C_x * (1. + (c = cos(lp.phi))));
-	lp.phi = aasin(P->ctx,(lp.phi + sin(lp.phi) * (c + 2.)) / C_p);
-	return (lp);
-}
-FREEUP; if (P) pj_dalloc(P); }
-ENTRY0(eck4); P->es = 0.; P->inv = s_inverse; P->fwd = s_forward; ENDENTRY(P)
diff --git a/src/proj/PJ_eck5.c b/src/proj/PJ_eck5.c
deleted file mode 100644
index 3eeb332..0000000
--- a/src/proj/PJ_eck5.c
+++ /dev/null
@@ -1,18 +0,0 @@
-#define PJ_LIB__
-# include	<projects.h>
-PROJ_HEAD(eck5, "Eckert V") "\n\tPCyl, Sph.";
-#define XF	0.44101277172455148219
-#define RXF	2.26750802723822639137
-#define YF	0.88202554344910296438
-#define RYF	1.13375401361911319568
-FORWARD(s_forward); /* spheroid */
-	xy.x = XF * (1. + cos(lp.phi)) * lp.lam;
-	xy.y = YF * lp.phi;
-	return (xy);
-}
-INVERSE(s_inverse); /* spheroid */
-	lp.lam = RXF * xy.x / (1. + cos( lp.phi = RYF * xy.y));
-	return (lp);
-}
-FREEUP; if (P) pj_dalloc(P); }
-ENTRY0(eck5); P->es = 0.; P->inv = s_inverse; P->fwd = s_forward; ENDENTRY(P)
diff --git a/src/proj/PJ_eqc.c b/src/proj/PJ_eqc.c
deleted file mode 100644
index c69a6ba..0000000
--- a/src/proj/PJ_eqc.c
+++ /dev/null
@@ -1,23 +0,0 @@
-#define PROJ_PARMS__ \
-	double rc;
-#define PJ_LIB__
-# include	<projects.h>
-PROJ_HEAD(eqc, "Equidistant Cylindrical (Plate Caree)")
-	"\n\tCyl, Sph\n\tlat_ts=[, lat_0=0]";
-FORWARD(s_forward); /* spheroid */
-	xy.x = P->rc * lp.lam;
-	xy.y = lp.phi - P->phi0;
-	return (xy);
-}
-INVERSE(s_inverse); /* spheroid */
-	lp.lam = xy.x / P->rc;
-	lp.phi = xy.y + P->phi0;
-	return (lp);
-}
-FREEUP; if (P) pj_dalloc(P); }
-ENTRY0(eqc)
-	if ((P->rc = cos(pj_param(P->ctx, P->params, "rlat_ts").f)) <= 0.) E_ERROR(-24);
-	P->inv = s_inverse;
-	P->fwd = s_forward;
-	P->es = 0.;
-ENDENTRY(P)
diff --git a/src/proj/PJ_eqdc.c b/src/proj/PJ_eqdc.c
deleted file mode 100644
index 01a0f03..0000000
--- a/src/proj/PJ_eqdc.c
+++ /dev/null
@@ -1,85 +0,0 @@
-#define PROJ_PARMS__ \
-	double phi1; \
-	double phi2; \
-	double n; \
-	double rho; \
-	double rho0; \
-	double c; \
-	double *en; \
-	int		ellips;
-#define PJ_LIB__
-#include	<projects.h>
-PROJ_HEAD(eqdc, "Equidistant Conic")
-	"\n\tConic, Sph&Ell\n\tlat_1= lat_2=";
-# define EPS10	1.e-10
-FORWARD(e_forward); /* sphere & ellipsoid */
-	P->rho = P->c - (P->ellips ? pj_mlfn(lp.phi, sin(lp.phi),
-		cos(lp.phi), P->en) : lp.phi);
-	xy.x = P->rho * sin( lp.lam *= P->n );
-	xy.y = P->rho0 - P->rho * cos(lp.lam);
-	return (xy);
-}
-INVERSE(e_inverse); /* sphere & ellipsoid */
-	if ((P->rho = hypot(xy.x, xy.y = P->rho0 - xy.y)) != 0.0 ) {
-		if (P->n < 0.) {
-			P->rho = -P->rho;
-			xy.x = -xy.x;
-			xy.y = -xy.y;
-		}
-		lp.phi = P->c - P->rho;
-		if (P->ellips)
-			lp.phi = pj_inv_mlfn(P->ctx, lp.phi, P->es, P->en);
-		lp.lam = atan2(xy.x, xy.y) / P->n;
-	} else {
-		lp.lam = 0.;
-		lp.phi = P->n > 0. ? HALFPI : - HALFPI;
-	}
-	return (lp);
-}
-SPECIAL(fac) {
-	double sinphi, cosphi;
-
-	sinphi = sin(lp.phi);
-	cosphi = cos(lp.phi);
-	fac->code |= IS_ANAL_HK;
-	fac->h = 1.;
-	fac->k = P->n * (P->c - (P->ellips ? pj_mlfn(lp.phi, sinphi,
-		cosphi, P->en) : lp.phi)) / pj_msfn(sinphi, cosphi, P->es);
-}
-FREEUP; if (P) { if (P->en) pj_dalloc(P->en); pj_dalloc(P); } }
-ENTRY1(eqdc, en)
-	double cosphi, sinphi;
-	int secant;
-
-	P->phi1 = pj_param(P->ctx, P->params, "rlat_1").f;
-	P->phi2 = pj_param(P->ctx, P->params, "rlat_2").f;
-	if (fabs(P->phi1 + P->phi2) < EPS10) E_ERROR(-21);
-	if (!(P->en = pj_enfn(P->es)))
-		E_ERROR_0;
-	P->n = sinphi = sin(P->phi1);
-	cosphi = cos(P->phi1);
-	secant = fabs(P->phi1 - P->phi2) >= EPS10;
-	if( (P->ellips = (P->es > 0.)) ) {
-		double ml1, m1;
-
-		m1 = pj_msfn(sinphi, cosphi, P->es);
-		ml1 = pj_mlfn(P->phi1, sinphi, cosphi, P->en);
-		if (secant) { /* secant cone */
-			sinphi = sin(P->phi2);
-			cosphi = cos(P->phi2);
-			P->n = (m1 - pj_msfn(sinphi, cosphi, P->es)) /
-				(pj_mlfn(P->phi2, sinphi, cosphi, P->en) - ml1);
-		}
-		P->c = ml1 + m1 / P->n;
-		P->rho0 = P->c - pj_mlfn(P->phi0, sin(P->phi0),
-			cos(P->phi0), P->en);
-	} else {
-		if (secant)
-			P->n = (cosphi - cos(P->phi2)) / (P->phi2 - P->phi1);
-		P->c = P->phi1 + cos(P->phi1) / P->n;
-		P->rho0 = P->c - P->phi0;
-	}
-	P->inv = e_inverse;
-	P->fwd = e_forward;
-	P->spc = fac;
-ENDENTRY(P)
diff --git a/src/proj/PJ_fahey.c b/src/proj/PJ_fahey.c
deleted file mode 100644
index 93e9b38..0000000
--- a/src/proj/PJ_fahey.c
+++ /dev/null
@@ -1,17 +0,0 @@
-#define PJ_LIB__
-# include	<projects.h>
-PROJ_HEAD(fahey, "Fahey") "\n\tPcyl, Sph.";
-#define TOL 1e-6
-FORWARD(s_forward); /* spheroid */
-	xy.y = 1.819152 * ( xy.x = tan(0.5 * lp.phi) );
-	xy.x = 0.819152 * lp.lam * asqrt(1 - xy.x * xy.x);
-	return (xy);
-}
-INVERSE(s_inverse); /* spheroid */
-	lp.phi = 2. * atan(xy.y /= 1.819152);
-	lp.lam = fabs(xy.y = 1. - xy.y * xy.y) < TOL ? 0. :
-		xy.x / (0.819152 * sqrt(xy.y));
-	return (lp);
-}
-FREEUP; if (P) pj_dalloc(P); }
-ENTRY0(fahey) P->es = 0.; P->inv = s_inverse; P->fwd = s_forward; ENDENTRY(P)
diff --git a/src/proj/PJ_fouc_s.c b/src/proj/PJ_fouc_s.c
deleted file mode 100644
index b84b3f8..0000000
--- a/src/proj/PJ_fouc_s.c
+++ /dev/null
@@ -1,45 +0,0 @@
-#define PROJ_PARMS__ \
-	double n, n1;
-#define PJ_LIB__
-#include	<projects.h>
-PROJ_HEAD(fouc_s, "Foucaut Sinusoidal") "\n\tPCyl., Sph.";
-#define MAX_ITER    10
-#define LOOP_TOL    1e-7
-FORWARD(s_forward); /* spheroid */
-	double t;
-
-	t = cos(lp.phi);
-	xy.x = lp.lam * t / (P->n + P->n1 * t);
-	xy.y = P->n * lp.phi + P->n1 * sin(lp.phi);
-	return (xy);
-}
-INVERSE(s_inverse); /* spheroid */
-	double V;
-	int i;
-
-	if (P->n) {
-		lp.phi = xy.y;
-		for (i = MAX_ITER; i ; --i) {
-			lp.phi -= V = (P->n * lp.phi + P->n1 * sin(lp.phi) - xy.y ) /
-				(P->n + P->n1 * cos(lp.phi));
-			if (fabs(V) < LOOP_TOL)
-				break;
-		}
-		if (!i)
-			lp.phi = xy.y < 0. ? -HALFPI : HALFPI;
-	} else
-		lp.phi = aasin(P->ctx,xy.y);
-	V = cos(lp.phi);
-	lp.lam = xy.x * (P->n + P->n1 * V) / V;
-	return (lp);
-}
-FREEUP; if (P) pj_dalloc(P); }
-ENTRY0(fouc_s)
-	P->n = pj_param(P->ctx, P->params, "dn").f;
-	if (P->n < 0. || P->n > 1.)
-		E_ERROR(-99)
-	P->n1 = 1. - P->n;
-	P->es = 0;
-	P->inv = s_inverse;
-	P->fwd = s_forward;
-ENDENTRY(P)
diff --git a/src/proj/PJ_gall.c b/src/proj/PJ_gall.c
deleted file mode 100644
index 3c507bd..0000000
--- a/src/proj/PJ_gall.c
+++ /dev/null
@@ -1,19 +0,0 @@
-#define PJ_LIB__
-#include	<projects.h>
-PROJ_HEAD(gall, "Gall (Gall Stereographic)") "\n\tCyl, Sph";
-#define YF	1.70710678118654752440
-#define XF	0.70710678118654752440
-#define RYF	0.58578643762690495119
-#define RXF	1.41421356237309504880
-FORWARD(s_forward); /* spheroid */
-	xy.x = XF * lp.lam;
-	xy.y = YF * tan(.5 * lp.phi);
-	return (xy);
-}
-INVERSE(s_inverse); /* spheroid */
-	lp.lam = RXF * xy.x;
-	lp.phi = 2. * atan(xy.y * RYF);
-	return (lp);
-}
-FREEUP; if (P) pj_dalloc(P); }
-ENTRY0(gall) P->es = 0.; P->inv = s_inverse; P->fwd = s_forward; ENDENTRY(P)
diff --git a/src/proj/PJ_geos.c b/src/proj/PJ_geos.c
deleted file mode 100644
index aaaf622..0000000
--- a/src/proj/PJ_geos.c
+++ /dev/null
@@ -1,192 +0,0 @@
-/*
-** libproj -- library of cartographic projections
-**
-** Copyright (c) 2004   Gerald I. Evenden
-** Copyright (c) 2012   Martin Raspaud
-*/
-static const char
-LIBPROJ_ID[] = "$Id: PJ_geos.c 1950 2012-05-10 16:51:51Z caress $";
-/*
-** See also (section 4.4.3.2):
-**   http://www.eumetsat.int/en/area4/msg/news/us_doc/cgms_03_26.pdf
-**
-** Permission is hereby granted, free of charge, to any person obtaining
-** a copy of this software and associated documentation files (the
-** "Software"), to deal in the Software without restriction, including
-** without limitation the rights to use, copy, modify, merge, publish,
-** distribute, sublicense, and/or sell copies of the Software, and to
-** permit persons to whom the Software is furnished to do so, subject to
-** the following conditions:
-**
-** The above copyright notice and this permission notice shall be
-** included in all copies or substantial portions of the Software.
-**
-** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
-** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-** SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-*/
-#define PROJ_PARMS__ \
-	double	h; \
-	double  radius_p; \
-	double  radius_p2; \
-	double  radius_p_inv2; \
-	double  radius_g; \
-	double  radius_g_1; \
-	double  C; \
-        char *  sweep_axis; \
-        int     flip_axis;
-#define PJ_LIB__
-#include	<projects.h>
-
-PROJ_HEAD(geos, "Geostationary Satellite View") "\n\tAzi, Sph&Ell\n\th=";
-
-FORWARD(s_forward); /* spheroid */
-	double Vx, Vy, Vz, tmp;
-
-/* Calculation of the three components of the vector from satellite to
-** position on earth surface (lon,lat).*/
-	tmp = cos(lp.phi);
-	Vx = cos (lp.lam) * tmp;
-	Vy = sin (lp.lam) * tmp;
-	Vz = sin (lp.phi);
-/* Check visibility.*/
-	if (((P->radius_g - Vx) * Vx - Vy * Vy - Vz * Vz) < 0.) F_ERROR;
-/* Calculation based on view angles from satellite.*/
-	tmp = P->radius_g - Vx;
-        if(P->flip_axis)
-          {
-            xy.x = P->radius_g_1 * atan(Vy / hypot(Vz, tmp));
-            xy.y = P->radius_g_1 * atan(Vz / tmp);
-          }
-        else
-          {
-            xy.x = P->radius_g_1 * atan(Vy / tmp);
-            xy.y = P->radius_g_1 * atan(Vz / hypot(Vy, tmp));
-          }
-	return (xy);
-}
-FORWARD(e_forward); /* ellipsoid */
-	double r, Vx, Vy, Vz, tmp;
-
-/* Calculation of geocentric latitude. */
-	lp.phi = atan (P->radius_p2 * tan (lp.phi));
-/* Calculation of the three components of the vector from satellite to
-** position on earth surface (lon,lat).*/
-	r = (P->radius_p) / hypot(P->radius_p * cos (lp.phi), sin (lp.phi));
-	Vx = r * cos (lp.lam) * cos (lp.phi);
-	Vy = r * sin (lp.lam) * cos (lp.phi);
-	Vz = r * sin (lp.phi);
-/* Check visibility. */
-	if (((P->radius_g - Vx) * Vx - Vy * Vy - Vz * Vz * P->radius_p_inv2) < 0.)
-		F_ERROR;
-/* Calculation based on view angles from satellite. */
-	tmp = P->radius_g - Vx;
-        if(P->flip_axis)
-          {
-            xy.x = P->radius_g_1 * atan (Vy / hypot (Vz, tmp));
-            xy.y = P->radius_g_1 * atan (Vz / tmp);
-          }
-        else
-          {
-            xy.x = P->radius_g_1 * atan (Vy / tmp);
-            xy.y = P->radius_g_1 * atan (Vz / hypot (Vy, tmp));
-          }
-	return (xy);
-}
-INVERSE(s_inverse); /* spheroid */
-	double Vx, Vy, Vz, a, b, det, k;
-
-/* Setting three components of vector from satellite to position.*/
-	Vx = -1.0;
-	if(P->flip_axis)
-          {
-            Vz = tan (xy.y / (P->radius_g - 1.0));
-            Vy = tan (xy.x / (P->radius_g - 1.0)) * sqrt (1.0 + Vz * Vz);
-          }
-        else
-          {
-            Vy = tan (xy.x / (P->radius_g - 1.0));
-            Vz = tan (xy.y / (P->radius_g - 1.0)) * sqrt (1.0 + Vy * Vy);
-          }
-/* Calculation of terms in cubic equation and determinant.*/
-	a   = Vy * Vy + Vz * Vz + Vx * Vx;
-	b   = 2 * P->radius_g * Vx;
-	if ((det = (b * b) - 4 * a * P->C) < 0.) I_ERROR;
-/* Calculation of three components of vector from satellite to position.*/
-	k  = (-b - sqrt(det)) / (2 * a);
-	Vx = P->radius_g + k * Vx;
-	Vy *= k;
-	Vz *= k;
-/* Calculation of longitude and latitude.*/
-	lp.lam = atan2 (Vy, Vx);
-	lp.phi = atan (Vz * cos (lp.lam) / Vx);
-	return (lp);
-}
-INVERSE(e_inverse); /* ellipsoid */
-	double Vx, Vy, Vz, a, b, det, k;
-
-/* Setting three components of vector from satellite to position.*/
-	Vx = -1.0;
-        if(P->flip_axis)
-          {
-            Vz = tan (xy.y / P->radius_g_1);
-            Vy = tan (xy.x / P->radius_g_1) * hypot(1.0, Vz);
-          }
-        else
-          {
-            Vy = tan (xy.x / P->radius_g_1);
-            Vz = tan (xy.y / P->radius_g_1) * hypot(1.0, Vy);
-          }
-/* Calculation of terms in cubic equation and determinant.*/
-	a = Vz / P->radius_p;
-	a   = Vy * Vy + a * a + Vx * Vx;
-	b   = 2 * P->radius_g * Vx;
-	if ((det = (b * b) - 4 * a * P->C) < 0.) I_ERROR;
-/* Calculation of three components of vector from satellite to position.*/
-	k  = (-b - sqrt(det)) / (2. * a);
-	Vx = P->radius_g + k * Vx;
-	Vy *= k;
-	Vz *= k;
-/* Calculation of longitude and latitude.*/
-	lp.lam  = atan2 (Vy, Vx);
-	lp.phi = atan (Vz * cos (lp.lam) / Vx);
-	lp.phi = atan (P->radius_p_inv2 * tan (lp.phi));
-	return (lp);
-}
-FREEUP; if (P) free(P); }
-ENTRY0(geos)
-	if ((P->h = pj_param(P->ctx, P->params, "dh").f) <= 0.) E_ERROR(-30);
-	if (P->phi0) E_ERROR(-46);
-        P->sweep_axis = pj_param(P->ctx, P->params, "ssweep").s;
-        if (P->sweep_axis == NULL)
-          P->flip_axis = 0;
-        else
-          {
-            if (P->sweep_axis[1] != '\0' ||
-                (P->sweep_axis[0] != 'x' &&
-                 P->sweep_axis[0] != 'y'))
-              E_ERROR(-49);
-            if (P->sweep_axis[0] == 'y')
-              P->flip_axis = 1;
-            else
-              P->flip_axis = 0;
-          }
-        P->radius_g_1 = P->h / P->a;
-	P->radius_g = 1. + P->radius_g_1;
-	P->C  = P->radius_g * P->radius_g - 1.0;
-	if (P->es) {
-		P->radius_p      = sqrt (P->one_es);
-		P->radius_p2     = P->one_es;
-		P->radius_p_inv2 = P->rone_es;
-		P->inv = e_inverse;
-		P->fwd = e_forward;
-	} else {
-		P->radius_p = P->radius_p2 = P->radius_p_inv2 = 1.0;
-		P->inv = s_inverse;
-		P->fwd = s_forward;
-	}
-ENDENTRY(P)
diff --git a/src/proj/PJ_gins8.c b/src/proj/PJ_gins8.c
deleted file mode 100644
index 0747d76..0000000
--- a/src/proj/PJ_gins8.c
+++ /dev/null
@@ -1,17 +0,0 @@
-#define PJ_LIB__
-# include	<projects.h>
-PROJ_HEAD(gins8, "Ginsburg VIII (TsNIIGAiK)") "\n\tPCyl, Sph., no inv.";
-#define	Cl 0.000952426
-#define	Cp 0.162388
-#define	C12 0.08333333333333333
-FORWARD(s_forward); /* spheroid */
-	double t = lp.phi * lp.phi;
-
-	xy.y = lp.phi * (1. + t * C12);
-	xy.x = lp.lam * (1. - Cp * t);
-	t = lp.lam * lp.lam;
-	xy.x *= (0.87 - Cl * t * t);
-	return (xy);
-}
-FREEUP; if (P) pj_dalloc(P); }
-ENTRY0(gins8) P->es = 0.; P->inv = 0; P->fwd = s_forward; ENDENTRY(P)
diff --git a/src/proj/PJ_gn_sinu.c b/src/proj/PJ_gn_sinu.c
deleted file mode 100644
index bfd8bc2..0000000
--- a/src/proj/PJ_gn_sinu.c
+++ /dev/null
@@ -1,98 +0,0 @@
-#define PROJ_PARMS__ \
-	double	*en; \
-	double	m, n, C_x, C_y;
-#define PJ_LIB__
-#include	<projects.h>
-PROJ_HEAD(gn_sinu, "General Sinusoidal Series") "\n\tPCyl, Sph.\n\tm= n=";
-PROJ_HEAD(sinu, "Sinusoidal (Sanson-Flamsteed)") "\n\tPCyl, Sph&Ell";
-PROJ_HEAD(eck6, "Eckert VI") "\n\tPCyl, Sph.";
-PROJ_HEAD(mbtfps, "McBryde-Thomas Flat-Polar Sinusoidal") "\n\tPCyl, Sph.";
-#define EPS10	1e-10
-#define MAX_ITER 8
-#define LOOP_TOL 1e-7
-/* Ellipsoidal Sinusoidal only */
-FORWARD(e_forward); /* ellipsoid */
-	double s, c;
-
-	xy.y = pj_mlfn(lp.phi, s = sin(lp.phi), c = cos(lp.phi), P->en);
-	xy.x = lp.lam * c / sqrt(1. - P->es * s * s);
-	return (xy);
-}
-INVERSE(e_inverse); /* ellipsoid */
-	double s;
-
-	if ((s = fabs(lp.phi = pj_inv_mlfn(P->ctx, xy.y, P->es, P->en))) < HALFPI) {
-		s = sin(lp.phi);
-		lp.lam = xy.x * sqrt(1. - P->es * s * s) / cos(lp.phi);
-	} else if ((s - EPS10) < HALFPI)
-		lp.lam = 0.;
-	else I_ERROR;
-	return (lp);
-}
-/* General spherical sinusoidals */
-FORWARD(s_forward); /* sphere */
-	if (!P->m)
-		lp.phi = P->n != 1. ? aasin(P->ctx,P->n * sin(lp.phi)): lp.phi;
-	else {
-		double k, V;
-		int i;
-
-		k = P->n * sin(lp.phi);
-		for (i = MAX_ITER; i ; --i) {
-			lp.phi -= V = (P->m * lp.phi + sin(lp.phi) - k) /
-				(P->m + cos(lp.phi));
-			if (fabs(V) < LOOP_TOL)
-				break;
-		}
-		if (!i)
-			F_ERROR
-	}
-	xy.x = P->C_x * lp.lam * (P->m + cos(lp.phi));
-	xy.y = P->C_y * lp.phi;
-	return (xy);
-}
-INVERSE(s_inverse); /* sphere */
-	xy.y /= P->C_y;
-	lp.phi = P->m ? aasin(P->ctx,(P->m * xy.y + sin(xy.y)) / P->n) :
-		( P->n != 1. ? aasin(P->ctx,sin(xy.y) / P->n) : xy.y );
-	lp.lam = xy.x / (P->C_x * (P->m + cos(xy.y)));
-	return (lp);
-}
-FREEUP; if (P) { if (P->en) pj_dalloc(P->en); pj_dalloc(P); } }
-	static void /* for spheres, only */
-setup(PJ *P) {
-	P->es = 0;
-	P->C_x = (P->C_y = sqrt((P->m + 1.) / P->n))/(P->m + 1.);
-	P->inv = s_inverse;
-	P->fwd = s_forward;
-}
-ENTRY1(sinu, en)
-	if (!(P->en = pj_enfn(P->es)))
-		E_ERROR_0;
-	if (P->es) {
-		P->inv = e_inverse;
-		P->fwd = e_forward;
-	} else {
-		P->n = 1.;
-		P->m = 0.;
-		setup(P);
-	}
-ENDENTRY(P)
-ENTRY1(eck6, en)
-	P->m = 1.;
-	P->n = 2.570796326794896619231321691;
-	setup(P);
-ENDENTRY(P)
-ENTRY1(mbtfps, en)
-	P->m = 0.5;
-	P->n = 1.785398163397448309615660845;
-	setup(P);
-ENDENTRY(P)
-ENTRY1(gn_sinu, en)
-	if (pj_param(P->ctx, P->params, "tn").i && pj_param(P->ctx, P->params, "tm").i) {
-		P->n = pj_param(P->ctx, P->params, "dn").f;
-		P->m = pj_param(P->ctx, P->params, "dm").f;
-	} else
-		E_ERROR(-99)
-	setup(P);
-ENDENTRY(P)
diff --git a/src/proj/PJ_gnom.c b/src/proj/PJ_gnom.c
deleted file mode 100644
index 11deb86..0000000
--- a/src/proj/PJ_gnom.c
+++ /dev/null
@@ -1,105 +0,0 @@
-#define PROJ_PARMS__ \
-	double	sinph0; \
-	double	cosph0; \
-	int		mode;
-#define PJ_LIB__
-#include	<projects.h>
-PROJ_HEAD(gnom, "Gnomonic") "\n\tAzi, Sph.";
-#define EPS10 1.e-10
-#define N_POLE	0
-#define S_POLE 1
-#define EQUIT	2
-#define OBLIQ	3
-FORWARD(s_forward); /* spheroid */
-	double  coslam, cosphi, sinphi;
-
-	sinphi = sin(lp.phi);
-	cosphi = cos(lp.phi);
-	coslam = cos(lp.lam);
-	switch (P->mode) {
-	case EQUIT:
-		xy.y = cosphi * coslam;
-		break;
-	case OBLIQ:
-		xy.y = P->sinph0 * sinphi + P->cosph0 * cosphi * coslam;
-		break;
-	case S_POLE:
-		xy.y = - sinphi;
-		break;
-	case N_POLE:
-		xy.y = sinphi;
-		break;
-	}
-	if (xy.y <= EPS10) F_ERROR;
-	xy.x = (xy.y = 1. / xy.y) * cosphi * sin(lp.lam);
-	switch (P->mode) {
-	case EQUIT:
-		xy.y *= sinphi;
-		break;
-	case OBLIQ:
-		xy.y *= P->cosph0 * sinphi - P->sinph0 * cosphi * coslam;
-		break;
-	case N_POLE:
-		coslam = - coslam;
-	case S_POLE:
-		xy.y *= cosphi * coslam;
-		break;
-	}
-	return (xy);
-}
-INVERSE(s_inverse); /* spheroid */
-	double  rh, cosz, sinz;
-
-	rh = hypot(xy.x, xy.y);
-	sinz = sin(lp.phi = atan(rh));
-	cosz = sqrt(1. - sinz * sinz);
-	if (fabs(rh) <= EPS10) {
-		lp.phi = P->phi0;
-		lp.lam = 0.;
-	} else {
-		switch (P->mode) {
-		case OBLIQ:
-			lp.phi = cosz * P->sinph0 + xy.y * sinz * P->cosph0 / rh;
-			if (fabs(lp.phi) >= 1.)
-				lp.phi = lp.phi > 0. ? HALFPI : - HALFPI;
-			else
-				lp.phi = asin(lp.phi);
-			xy.y = (cosz - P->sinph0 * sin(lp.phi)) * rh;
-			xy.x *= sinz * P->cosph0;
-			break;
-		case EQUIT:
-			lp.phi = xy.y * sinz / rh;
-			if (fabs(lp.phi) >= 1.)
-				lp.phi = lp.phi > 0. ? HALFPI : - HALFPI;
-			else
-				lp.phi = asin(lp.phi);
-			xy.y = cosz * rh;
-			xy.x *= sinz;
-			break;
-		case S_POLE:
-			lp.phi -= HALFPI;
-			break;
-		case N_POLE:
-			lp.phi = HALFPI - lp.phi;
-			xy.y = -xy.y;
-			break;
-		}
-		lp.lam = atan2(xy.x, xy.y);
-	}
-	return (lp);
-}
-FREEUP; if (P) pj_dalloc(P); }
-ENTRY0(gnom)
-	if (fabs(fabs(P->phi0) - HALFPI) < EPS10)
-		P->mode = P->phi0 < 0. ? S_POLE : N_POLE;
-	else if (fabs(P->phi0) < EPS10)
-		P->mode = EQUIT;
-	else {
-		P->mode = OBLIQ;
-		P->sinph0 = sin(P->phi0);
-		P->cosph0 = cos(P->phi0);
-	}
-	P->inv = s_inverse;
-	P->fwd = s_forward;
-	P->es = 0.;
-ENDENTRY(P)
diff --git a/src/proj/PJ_goode.c b/src/proj/PJ_goode.c
deleted file mode 100644
index 387557e..0000000
--- a/src/proj/PJ_goode.c
+++ /dev/null
@@ -1,49 +0,0 @@
-#define PROJ_PARMS__ \
-	struct PJconsts	*sinu; \
-	struct PJconsts	*moll;
-#define PJ_LIB__
-#include	<projects.h>
-PROJ_HEAD(goode, "Goode Homolosine") "\n\tPCyl, Sph.";
-	C_NAMESPACE PJ
-*pj_sinu(PJ *), *pj_moll(PJ *);
-#define Y_COR		0.05280
-#define PHI_LIM	.71093078197902358062
-FORWARD(s_forward); /* spheroid */
-	if (fabs(lp.phi) <= PHI_LIM)
-		xy = P->sinu->fwd(lp, P->sinu);
-	else {
-		xy = P->moll->fwd(lp, P->moll);
-		xy.y -= lp.phi >= 0.0 ? Y_COR : -Y_COR;
-	}
-	return (xy);
-}
-INVERSE(s_inverse); /* spheroid */
-	if (fabs(xy.y) <= PHI_LIM)
-		lp = P->sinu->inv(xy, P->sinu);
-	else {
-		xy.y += xy.y >= 0.0 ? Y_COR : -Y_COR;
-		lp = P->moll->inv(xy, P->moll);
-	}
-	return (lp);
-}
-FREEUP;
-	if (P) {
-		if (P->sinu)
-			(*(P->sinu->pfree))(P->sinu);
-		if (P->moll)
-			(*(P->moll->pfree))(P->moll);
-		pj_dalloc(P);
-	}
-}
-ENTRY2(goode, sinu, moll)
-	P->es = 0.;
-	if (!(P->sinu = pj_sinu(0)) || !(P->moll = pj_moll(0)))
-		E_ERROR_0;
-	P->sinu->es = 0.;
-        P->sinu->ctx = P->ctx;
-        P->moll->ctx = P->ctx;
-	if (!(P->sinu = pj_sinu(P->sinu)) || !(P->moll = pj_moll(P->moll)))
-		E_ERROR_0;
-	P->fwd = s_forward;
-	P->inv = s_inverse;
-ENDENTRY(P)
diff --git a/src/proj/PJ_gstmerc.c b/src/proj/PJ_gstmerc.c
deleted file mode 100644
index bffe0b2..0000000
--- a/src/proj/PJ_gstmerc.c
+++ /dev/null
@@ -1,48 +0,0 @@
-#define PROJ_PARMS__ \
-	double lamc;\
-	double phic;\
-	double c;\
-	double n1;\
-	double n2;\
-    double XS;\
-    double YS;
-
-#define PJ_LIB__
-# include	<projects.h>
-PROJ_HEAD(gstmerc, "Gauss-Schreiber Transverse Mercator (aka Gauss-Laborde Reunion)")
-	"\n\tCyl, Sph&Ell\n\tlat_0= lon_0= k_0=";
-FORWARD(s_forward); /* spheroid */
-	double L, Ls, sinLs1, Ls1;
-	L= P->n1*lp.lam;
-    Ls= P->c+P->n1*log(pj_tsfn(-1.0*lp.phi,-1.0*sin(lp.phi),P->e));
-    sinLs1= sin(L)/cosh(Ls);
-    Ls1= log(pj_tsfn(-1.0*asin(sinLs1),0.0,0.0));
-    xy.x= (P->XS + P->n2*Ls1)*P->ra;
-    xy.y= (P->YS + P->n2*atan(sinh(Ls)/cos(L)))*P->ra;
-    /*fprintf(stderr,"fwd:\nL      =%16.13f\nLs     =%16.13f\nLs1    =%16.13f\nLP(%16.13f,%16.13f)=XY(%16.4f,%16.4f)\n",L,Ls,Ls1,lp.lam+P->lam0,lp.phi,(xy.x*P->a + P->x0)*P->to_meter,(xy.y*P->a + P->y0)*P->to_meter);*/
-	return (xy);
-}
-INVERSE(s_inverse); /* spheroid */
-	double L, LC, sinC;
-	L= atan(sinh((xy.x*P->a - P->XS)/P->n2)/cos((xy.y*P->a - P->YS)/P->n2));
-    sinC= sin((xy.y*P->a - P->YS)/P->n2)/cosh((xy.x*P->a - P->XS)/P->n2);
-    LC= log(pj_tsfn(-1.0*asin(sinC),0.0,0.0));
-    lp.lam= L/P->n1;
-    lp.phi= -1.0*pj_phi2(P->ctx, exp((LC-P->c)/P->n1),P->e);
-    /*fprintf(stderr,"inv:\nL      =%16.13f\nsinC   =%16.13f\nLC     =%16.13f\nXY(%16.4f,%16.4f)=LP(%16.13f,%16.13f)\n",L,sinC,LC,((xy.x/P->ra)+P->x0)/P->to_meter,((xy.y/P->ra)+P->y0)/P->to_meter,lp.lam+P->lam0,lp.phi);*/
-	return (lp);
-}
-FREEUP; if (P) pj_dalloc(P); }
-ENTRY0(gstmerc)
-    P->lamc= P->lam0;
-    P->n1= sqrt(1.0+P->es*pow(cos(P->phi0),4.0)/(1.0-P->es));
-    P->phic= asin(sin(P->phi0)/P->n1);
-    P->c=       log(pj_tsfn(-1.0*P->phic,0.0,0.0))
-         -P->n1*log(pj_tsfn(-1.0*P->phi0,-1.0*sin(P->phi0),P->e));
-    P->n2= P->k0*P->a*sqrt(1.0-P->es)/(1.0-P->es*sin(P->phi0)*sin(P->phi0));
-    P->XS= 0;/* -P->x0 */
-    P->YS= -1.0*P->n2*P->phic;/* -P->y0 */
-	P->inv= s_inverse;
-	P->fwd= s_forward;
-    /*fprintf(stderr,"a  (m) =%16.4f\ne      =%16.13f\nl0(rad)=%16.13f\np0(rad)=%16.13f\nk0     =%16.4f\nX0  (m)=%16.4f\nY0  (m)=%16.4f\n\nlC(rad)=%16.13f\npC(rad)=%16.13f\nc      =%16.13f\nn1     =%16.13f\nn2 (m) =%16.4f\nXS (m) =%16.4f\nYS (m) =%16.4f\n", P->a, P->e, P->lam0, P->phi0, P->k0, P->x0, P->y0, P->lamc, P->phic, P->c, P->n1, P->n2, P->XS +P->x0, P->YS + P->y0);*/
-ENDENTRY(P)
diff --git a/src/proj/PJ_hammer.c b/src/proj/PJ_hammer.c
deleted file mode 100644
index 719a2ce..0000000
--- a/src/proj/PJ_hammer.c
+++ /dev/null
@@ -1,29 +0,0 @@
-#define PROJ_PARMS__ \
-	double w; \
-	double m, rm;
-#define PJ_LIB__
-# include	<projects.h>
-PROJ_HEAD(hammer, "Hammer & Eckert-Greifendorff")
-	"\n\tMisc Sph, no inv.\n\tW= M=";
-FORWARD(s_forward); /* spheroid */
-	double cosphi, d;
-
-	d = sqrt(2./(1. + (cosphi = cos(lp.phi)) * cos(lp.lam *= P->w)));
-	xy.x = P->m * d * cosphi * sin(lp.lam);
-	xy.y = P->rm * d * sin(lp.phi);
-	return (xy);
-}
-FREEUP; if (P) pj_dalloc(P); }
-ENTRY0(hammer)
-	if (pj_param(P->ctx, P->params, "tW").i) {
-		if ((P->w = fabs(pj_param(P->ctx, P->params, "dW").f)) <= 0.) E_ERROR(-27);
-	} else
-		P->w = .5;
-	if (pj_param(P->ctx, P->params, "tM").i) {
-		if ((P->m = fabs(pj_param(P->ctx, P->params, "dM").f)) <= 0.) E_ERROR(-27);
-	} else
-		P->m = 1.;
-	P->rm = 1. / P->m;
-	P->m /= P->w;
-	P->es = 0.; P->fwd = s_forward;
-ENDENTRY(P)
diff --git a/src/proj/PJ_hatano.c b/src/proj/PJ_hatano.c
deleted file mode 100644
index 8e0ff5c..0000000
--- a/src/proj/PJ_hatano.c
+++ /dev/null
@@ -1,50 +0,0 @@
-#define PJ_LIB__
-#include	<projects.h>
-PROJ_HEAD(hatano, "Hatano Asymmetrical Equal Area") "\n\tPCyl, Sph.";
-#define NITER	20
-#define EPS	1e-7
-#define ONETOL 1.000001
-#define CN	2.67595
-#define CS	2.43763
-#define RCN	0.37369906014686373063
-#define RCS	0.41023453108141924738
-#define FYCN	1.75859
-#define FYCS	1.93052
-#define RYCN	0.56863737426006061674
-#define RYCS	0.51799515156538134803
-#define FXC	0.85
-#define RXC	1.17647058823529411764
-FORWARD(s_forward); /* spheroid */
-	double th1, c;
-	int i;
-
-	c = sin(lp.phi) * (lp.phi < 0. ? CS : CN);
-	for (i = NITER; i; --i) {
-		lp.phi -= th1 = (lp.phi + sin(lp.phi) - c) / (1. + cos(lp.phi));
-		if (fabs(th1) < EPS) break;
-	}
-	xy.x = FXC * lp.lam * cos(lp.phi *= .5);
-	xy.y = sin(lp.phi) * (lp.phi < 0. ? FYCS : FYCN);
-	return (xy);
-}
-INVERSE(s_inverse); /* spheroid */
-	double th;
-
-	th = xy.y * ( xy.y < 0. ? RYCS : RYCN);
-	if (fabs(th) > 1.)
-		if (fabs(th) > ONETOL)	I_ERROR
-		else			th = th > 0. ? HALFPI : - HALFPI;
-	else
-		th = asin(th);
-	lp.lam = RXC * xy.x / cos(th);
-	th += th;
-	lp.phi = (th + sin(th)) * (xy.y < 0. ? RCS : RCN);
-	if (fabs(lp.phi) > 1.)
-		if (fabs(lp.phi) > ONETOL)	I_ERROR
-		else			lp.phi = lp.phi > 0. ? HALFPI : - HALFPI;
-	else
-		lp.phi = asin(lp.phi);
-	return (lp);
-}
-FREEUP; if (P) pj_dalloc(P); }
-ENTRY0(hatano) P->es = 0.; P->inv = s_inverse; P->fwd = s_forward; ENDENTRY(P)
diff --git a/src/proj/PJ_healpix.c b/src/proj/PJ_healpix.c
deleted file mode 100644
index da2632a..0000000
--- a/src/proj/PJ_healpix.c
+++ /dev/null
@@ -1,675 +0,0 @@
-/******************************************************************************
- * $Id: PJ_healpix.c 1960 2012-06-07 00:15:58Z caress $
- *
- * Project:  PROJ.4
- * Purpose:  Implementation of the healpix projection.
- *           Definition: http://code.scenzgrid.org/index.php/p/scenzgrid-py/source/tree/master/docs/scenzgrid.pdf
- * Author:   Alex Raichev & Michael Speth , spethm at landcareresearch.co.nz
- *
- ******************************************************************************
- * Copyright (c) 2001, Thomas Flemming, tf at ttqv.com
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
- * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
- * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *****************************************************************************/
-
-#define PROJ_PARMS__ \
-    int npole;\
-    int spole;
-
-#define PJ_LIB__
-# include	<projects.h>
-PROJ_HEAD(healpix, "HEALPix") "\n\tSph., Ellps.";
-PROJ_HEAD(rhealpix, "rHEALPix") "\n\tSph., Ellps.\n\tnpole= spole=";
-# include	<stdio.h>
-# define R1 {{ 0,-1},{ 1, 0}}	/** Matrix for anticlockwise rotation by pi/2 **/
-# define R2 {{-1, 0},{ 0,-1}}	/** Matrix for anticlockwise rotation by pi (R1 X R1) X = dot product **/
-# define R3 {{ 0, 1},{-1, 0}}	/** Matrix for anticlockwise rotation by 3*pi/2 (R2 X R1) **/
-# define IDENT {{1,0},{0,1}}
-/**
- * 0 - Identity matrix<br>
- * 1 - Counter-clockwise rotation by PI/2<br>
- * 2 - Counter-clockwise rotation by PI<br>
- * 3 - Counter-clockwise rotation by 3*PI/2<br>
- * 4 - Counter-clockwise rotation by 3*PI/2<br>
- * 5 - Counter-clockwise rotation by PI<br>
- * 6 - Counter-clockwise rotation by PI/2<br>
- **/
-# define ROT { IDENT, R1, R2, R3, R3, R2, R1}
-# define RFACTOR 3 /** Used for returning the rotation matrix **/
-/** Used for calculating if a point is within the HEALPix projection for sphere. **/
-# define EPS 1e-12
-typedef struct {
-    int cn; // the number 0 -> 4 indicating the position of the polar cap.
-    double x,y;  // the coordinates of the pole points (point of most extreme latitude on the polar caps).
-    enum Region { north, south, equatorial } region;
-} CapMap;
-typedef struct {
-    double x,y;
-} Point;
-double rot[7][2][2] = ROT;
-
-/**
-    NOTES:  Alex Raichev implemented the math in python and this is a port of his work.
-	    The healpix projection is a Lambert cylindrical equal-area projection for
-	    equaltorial latitudes and an interrupted Colignon projection for polar  
-	    latitudes.
- **/
-
-/**
- * Returns the sign of the double.
- * @param v the parameter whose sign is returned.
- * @return 1 for positive number, -1 for negative, and 0 for zero.
- **/
-double sign (double v) {
-    return v > 0 ? 1 : (v < 0 ? -1 : 0);
-}
-/**
- * Scales the number by a factor.
- * @param num the number to be scaled.
- * @param factor the factor to scale the number by.
- * @param isInverse 1 for scaling the number by 1 / factor and 0 for scaling by the factor.
- * @return the scaled number.
- **/
-double scale_number(double num, double factor, int isInverse){
-    if(isInverse == 1){
-	return num * 1.0/factor;
-    }
-    return num * factor;
-}
-/**
- * Scales all the items of the array by a factor.
- * @param xy
- **/
-void scale_array(XY *array, double k, int inverse){
-    double c = 0;
-    if (inverse == 1) {
-	c = 1.0/k;
-    }else{
-	c = k;
-    }
-    array->x *= c;
-    array->y *= c;
-}
-/**
- * Given an angle return its equivalent angle.
- * @param x the angle to convert
- * @return the equivalent angle such that -PI <= the angle returend <= PI
- **/
-double standardize_lon(double x){
-    if(x < -1*PI || x >= PI){
-	x = x - 2*PI*floor(x/(2*PI));	
-	if(x >= PI){
-	    x = x - 2*PI;
-	}
-    }
-    return x;
-}
-/**
- * Given an angle, return its unit-circle equivalent angle.
- * @param x the angel to convert.
- * @return the equivalent angle such that -PI/2 <= the angle returned <= PI/2.
- **/
-double standardize_lat(double x){
-    if( x < -PI/2.0 || x > PI/2){
-	x = x-2.0*PI*floor(x/(2.0*PI));
-	if(x > PI/2.0 && x <= 3.0*PI/2){
-	    x = PI - x;
-	}else{
-	    x = x - 2*PI;
-	}
-    }
-    return x;
-}
-/**
- * Calculates if the point lies on or within the polygon.
- * Very good explination of how this works: http://paulbourke.net/geometry/insidepoly/
- * @param nvert the number of vertices in the polygon.
- * @param vert the x,y-coordinates of the polygon's vertices
- * @param testx the x-coordinate of the test point.
- * @param testy the y-coordinate of the test point.
- * @return 1 if on or within the bounds of the polygon, and 0 otherwise.
- **/
-static
-int pnpoly(int nvert, double vert[][2], double testx, double testy){
-    
-    int i,j,c = 0;
-    int counter = 0;
-    double xinters;
-    Point p1,p2;
-
-    // check for boundrary cases
-    for(i = 0; i < nvert; i++){
-	if(testx == vert[i][0] && testy == vert[i][1]){
-	    return 1;
-	}
-    }
-
-    // initialize p1
-    p1.x = vert[0][0];
-    p1.y = vert[0][1];
-    
-    for(i = 1; i < nvert; i++){
-	p2.x = vert[i % nvert][0];
-	p2.y = vert[i % nvert][1];
-
-	if(testy > MIN(p1.y,p2.y)){
-	    if (testy <= MAX(p1.y,p2.y)) {
-		if (testx <= MAX(p1.x,p2.x)) {
-		    if (p1.y != p2.y) {
-			xinters = (testy-p1.y)*(p2.x-p1.x)/(p2.y-p1.y)+p1.x;
-			if (p1.x == p2.x || testx <= xinters){
-			    counter++;
-			}
-		    }
-		}
-	    }
-	}
-	p1 = p2;
-    }
-    if(counter % 2 == 0){
-	return 0;
-    }else{
-	return 1;
-    }
-    return c;
-}
-/**
- * Calculates if the coordinates are within the image of projection.
- * @param x the x-coordinate to check.
- * @param y the y-coordinate to check.
- * @param proj 0 for healpix and 1 for rhealpix.
- * @param npole the positions of the polar squares, only used for rhealpix.
- * @param spole the positions of the polar squares, only used for rhealpix.
- * @return 1 if the coordinate is within the projection and 0 otherwise.
- **/
-int in_image(double x, double y, int proj, int npole, int spole){
-    if(proj == 0){
-	double healpixVertsJit[][2] = {
-	    {-1.0*PI-EPS    ,PI/4.0},
-	    {-3.0*PI/4.0    ,PI/2.0+EPS},
-	    {-1.0*PI/2.0    ,PI/4.0+EPS},
-	    {-1.0*PI/4.0    ,PI/2.0+EPS},
-	    {0.0	    ,PI/4.0+EPS},
-	    {PI/4.0	    ,PI/2.0+EPS},
-	    {PI/2.0	    ,PI/4.0+EPS},
-	    {3.0*PI/4.0	    ,PI/2.0+EPS},
-	    {PI+EPS	    ,PI/4.0},
-	    {PI+EPS	    ,-1.0*PI/4.0},
-	    {3.0*PI/4.0	    ,-1.0*PI/2.0-EPS},
-	    {PI/2.0	    ,-1.0*PI/4.0-EPS},
-	    {PI/4.0	    ,-1.0*PI/2.0-EPS},
-	    {0.0	    ,-1.0*PI/4.0-EPS},
-	    {-1.0*PI/4.0    ,-1.0*PI/2.0-EPS},
-	    {-1.0*PI/2.0    ,-1.0*PI/4.0-EPS},
-	    {-3.0*PI/4.0    ,-1.0*PI/2.0-EPS},
-	    {-1.0*PI-EPS    ,-1.0*PI/4.0}};
-	return pnpoly((int)sizeof(healpixVertsJit)/sizeof(healpixVertsJit[0]),
-                  healpixVertsJit,x,y);
-    }else{
-	// Used for calculating if a point is within the rHEALPix projection for sphere.
-	double rhealpixVertsJit[][2] = {
-	    {-1.0*PI-EPS			,PI/4.0+EPS},
-	    {-1.0*PI + npole*PI/2.0-EPS		,PI/4.0+EPS},
-	    {-1.0*PI + npole*PI/2.0-EPS		,3*PI/4.0+EPS},
-	    {-1.0*PI + (npole + 1.0)*PI/2.0+EPS ,3*PI/4.0+EPS},
-	    {-1.0*PI + (npole + 1.0)*PI/2.0+EPS ,PI/4.0+EPS},
-	    {PI+EPS				,PI/4.0+EPS},
-	    {PI+EPS				,-1.0*PI/4.0-EPS},
-	    {-1.0*PI + (spole + 1.0)*PI/2.0+EPS ,-1.0*PI/4.0-EPS},
-	    {-1.0*PI + (spole + 1.0)*PI/2.0+EPS ,-3.0*PI/4.0-EPS},
-	    {-1.0*PI + spole*PI/2.0-EPS		,-3.0*PI/4.0-EPS},
-	    {-1.0*PI + spole*PI/2.0-EPS		,-1.0*PI/4.0-EPS},
-	    {-1.0*PI-EPS			,-1.0*PI/4.0-EPS}};
-	return pnpoly((int)sizeof(rhealpixVertsJit)/sizeof(rhealpixVertsJit[0]),
-                  rhealpixVertsJit,x,y);
-    }
-}
-/**
- * Returns an authalic latitude of the point given a point of geographic 
- * latitude phi on an ellipse of eccentricity e.
- * pj_authlat is the inverse of the alex's auth_lat.
- * @param phi
- * @param e
- * @param inverse 1 for inverse or 0 otherwise.
- * @return the authalic latitude of the point.
- **/
-double auth_lat(double phi, double e, int inverse){
-    if(inverse == 0){
-	double q_numerator = ((1.0 - pow(e,2.0)) * sin(phi));
-	double q_demonitor =  (1.0 - (pow(e*sin(phi),2.0)));
-	double q_subtractor =  - (1.0 - pow(e,2.0)) / (2.0*e) * log((1.0 - e*sin(phi)) / (1.0+e*sin(phi)));
-	double q = ((1.0 - pow(e,2.0)) * sin(phi)) / (1.0 - (pow(e*sin(phi),2.0))) - 
-	(1.0 - pow(e,2.0)) / (2.0*e) * log((1.0 - e*sin(phi)) / (1.0+e*sin(phi)));
-
-	double qp = 1.0 - (1.0-pow(e,2.0)) / (2.0*e)*log((1.0 - e) / (1.0 + e));
-	double ratio = q/qp;
-	// Rounding errors
-	if( fabsl(ratio) > 1){
-	    ratio = sign(ratio);
-	}
-	return asin(ratio);
-    }
-    return phi + (pow(e,2) / 3.0 + 31*pow(e,4) / 180.0 + 517.0*pow(e,6)/5040.0) * sin(2.0*phi)
-    + (23.0*pow(e,4)/360.0 + 251.0*pow(e,6)/3780.0)*sin(4.0*phi)
-    + 761.0*pow(e,6)/45360.0 * sin(6.0*phi);
-}
-/**
- * Compute the forward signature functions of the HEALPix 
- * projection of a sphere with radius `R` and central meridian `lon0`. 
-**/
-XY healpix_sphere(LP lp, PJ *P){
-    double lam = standardize_lon(lp.lam);
-    double phi = standardize_lat(lp.phi);
-    double phi0 = aasin(P->ctx, 2.0/3.0);
-    XY xy;
-    // equatorial region
-    if( fabsl(phi) <= phi0) {
-	xy.x = lam;
-	xy.y = 3.0*PI/8.0*sin(phi);
-    } else {
-	double lamc;
-	double sigma = sqrt(3.0 * (1 - fabsl(sin(phi))));
-	double cn = floor(2 * lam / PI + 2);
-	if (cn >= 4) {
-	    cn = 3;
-	}
-	lamc = -3*PI/4 + (PI/2)*cn;
-	xy.x = lamc + (lam - lamc) * sigma;
-	xy.y = sign(phi)*PI/4 * (2 - sigma);
-    }
-    xy.x = scale_number(xy.x,P->a,0);
-    xy.y = scale_number(xy.y,P->a,0);
-    return xy;
-}
-/**
- * Compute the inverse signature functions of the HEALPix 
- * projection of a sphere with radius `R` and central meridian `lon0`. 
-**/
-LP healpix_sphere_inv(XY xy, PJ *P){
-    double x,y,y0;
-    double cn;
-    double xc;
-    double tau;
-    LP lp; 
-    // Scale down to radius 1 sphere
-    x = scale_number(xy.x,P->a,1);
-    y = scale_number(xy.y,P->a,1);
-    y0 = PI/4.0;
-    // Equatorial region.
-    if(fabsl(y) <= y0){
-	lp.lam = x;
-	lp.phi = asin(8.0*y/(3.0*PI));	
-    } else if(fabsl(y) < PI/2.0){
-	cn = floor(2.0 * x/PI + 2.0);
-	if(cn >= 4){
-	    cn = 3;
-	}
-	xc = -3.0 * PI/4.0 + (PI/2.0)*cn;
-	tau = 2.0 - 4.0*fabsl(y)/PI;
-	lp.lam = xc + (x - xc)/tau;	
-	lp.phi = sign(y)*asin(1.0 - pow(tau , 2.0)/3.0);
-    } else {
-	lp.lam = -1.0*PI - P->lam0;
-	lp.phi = sign(y)*PI/2.0;
-    }
-    return (lp);
-}
-/**
- * Adds one vector to another of length 2.
- * @param a the first term.
- * @param b the second term.
- * @param ret holds the summation of the vectors.
- **/
-static void vector_add(double a[], double b[],double * ret){
-    int i;
-    for(i = 0; i < 2; i++){
-	ret[i] = a[i] + b[i];
-    }
-}
-/**
- * Subs tracts one vector from another of length 2.
- * @param a the minuend.
- * @param b the subtrahend.
- * @param ret the difference of the vectors where the difference is the result of a minus b.
- **/
-static void vector_sub(double a[], double b[], double * ret){
-    int i;
-    for(i = 0; i < 2; i++){
-	ret[i] = a[i] - b[i];
-    }
-}
-/**
- * Calculates the dot product of the arrays.
- * @param a the array that will be used to calculate the dot product.
- *  Must contain the same number of columns as b's rows.  Must be a matrix with equal lengthed rows and columns.
- * @param b the array that will be used to calculate the dot product; must contain the same number of rows as a's columns.
- * @param length the size of the b array.  Note, a's column size must equal b's length.
- * @param ret the dot product of a and b.
- **/
-static void dot_product(double a[2][2], double b[], double * ret){
-    int i,j;
-    int length = 2;
-    for(i = 0; i < length; i++){
-	ret[i] = 0;
-	for(j = 0; j < length; j++){
-	    ret[i] += a[i][j]*b[i];
-	}
-    }
-}
-/**
- * Returns the polar cap number, pole point coordinates, and region
- * for x,y in the HEALPix projection of the sphere of radius R.
- * @param x coordinate in the HEALPix or rHEALPix.
- * @param y coordinate in the HEALPix or rHEALPix.
- * @param npole integer between 0 and 3 indicating the position of the north pole.
- * @param spole integer between 0 and 3 indicating teh position of the south pole.
- * @param inverse 1 computes the rHEALPix projection and 0 computes forward.
- * @return a structure containing the cap poles.
- **/
-static CapMap get_cap(double x, double y, double R, int npole, int spole, int inverse){
-    CapMap capmap;
-    double c;
-
-    capmap.x = x;
-    capmap.y = y;
-
-    if(inverse == 0){
-	if(y > R*PI/4.0){
-	    capmap.region = north;
-	    c = R*PI/2.0; 
-	}else if(y < -1*R*PI/4.0){
-	    capmap.region = south;
-	    c = -1*R*PI/2.0;
-	}else{
-	    capmap.region = equatorial;
-	    capmap.cn = 0;
-	    return capmap;
-	}
-	// polar region
-	if(x < -1*R*PI/2.0){
-	    capmap.cn = 0;
-	    capmap.x = (-1*R*3.0*PI/4.0);
-	    capmap.y = c;
-	}else if(x >= -1*R*PI/2.0 && x < 0){
-	    capmap.cn = 1;
-	    capmap.x = -1*R*PI/4.0;
-	    capmap.y = c;
-	}else if(x >= 0 && x < R*PI/2.0){
-	    capmap.cn = 2;
-	    capmap.x = R*PI/4.0;
-	    capmap.y = c;
-	}else{
-	    capmap.cn = 3;
-	    capmap.x = R*3.0*PI/4.0;
-	    capmap.y = c;
-	}
-	return capmap;
-    }else{
-	double c;
-	double eps;
-	if(y > R*PI/4.0){
-	    capmap.region = north;
-	    capmap.x = -1*R*3.0*PI/4.0 + npole*R*PI/2.0; 
-	    capmap.y = R*PI/2.0;
-	    x = x - npole*R*PI/2.0;
-	}else if(y < -1*R*PI/4.0){
-	    capmap.region = south;
-	    capmap.x = -1*R*3.0*PI/4.0 + spole*R*PI/2; 
-	    capmap.y = -1*R*PI/2.0;
-	    x = x - spole*R*PI/2.0;
-	}else{
-	    capmap.region = equatorial;
-	    capmap.cn = 0;
-	    return capmap;
-	}
-	// Polar Region, find # of HEALPix polar cap number that
-	// x,y moves to when rHEALPix polar square is disassembled.
-	eps = R*1e-15; // Kludge.  Fuzz to avoid some rounding errors.
-	if(capmap.region == north){
-	    if(y >= -1*x - R*PI/4.0 - eps && y < x + R*5.0*PI/4.0 - eps){
-		capmap.cn = 1;
-	    }else if(y > -1*x -1*R*PI/4.0 + eps && y >= x + R*5.0*PI/4.0 - eps){
-		capmap.cn = 2;
-	    }else if(y <= -1*x -1*R*PI/4.0 + eps && y > x + R*5.0*PI/4.0 + eps){
-		capmap.cn = 3;
-	    }else{
-		capmap.cn = 0;
-	    }
-	}else if(capmap.region == south){
-	    if(y <= x + R*PI/4.0 + eps && y > -1*x - R*5.0*PI/4 + eps){
-		capmap.cn = 1;
-	    }else if(y < x + R*PI/4.0 - eps && y <= -1*x - R*5.0*PI/4.0 + eps){
-		capmap.cn = 2;
-	    }else if(y >= x + R*PI/4.0 - eps && y < -1*x - R*5.0*PI/4.0 - eps){
-		capmap.cn = 3;
-	    }else {
-		capmap.cn = 0;
-	    }
-	}
-	return capmap;
-    }
-}
-/**
- * Rearrange point x,y in the HEALPix projection by
- * combining the polar caps into two polar squares.
- * Put the north polar square in position npole and
- * the south polar square in position spole.
- * @param x coordinate in the HEALPix projection of the sphere.
- * @param y coordinate in the HEALPix projection of the sphere.
- * @param R - the Sphere's radius.
- * @param npole integer between 0 and 3 indicating the position
- * of the north polar square.
- * @param spole integer between 0 and 3 indicating the position
- * of the south polar square.
- * @param inverse 1 to uncombine the polar caps and 0 to combine.
- **/
-static XY combine_caps(double x, double y, double R, int npole, int spole, int inverse){
-    XY xy;
-    double v[2];
-    double a[2];
-    double vector[2];
-    double tmpVect[2];
-    double v_min_c[2];
-    double ret_dot[2];
-    double ret_add[2];
-    CapMap capmap = get_cap(x,y,R,npole,spole,inverse);
-
-    if(capmap.region == equatorial){
-	xy.x = capmap.x;
-	xy.y = capmap.y;
-	return xy;
-    }
-    v[0] = x;
-    v[1] = y;
-    if(inverse == 0){
-	// compute forward function by rotating, translating, and shifting xy.
-	int pole = 0;
-	double (*tmpRot)[2];
-	double c[2] = {capmap.x,capmap.y};
-	if(capmap.region == north){
-	    pole = npole;
-	    tmpRot = rot[capmap.cn];
-	    a[0] = R*-3.0*PI/4.0;
-	    a[1] = PI/2.0;
-	}else {
-	    pole = spole;
-	    tmpRot = rot[capmap.cn+RFACTOR];
-	    a[0] = R*-3.0*PI/4.0;
-	    a[1] = PI/-2.0;
-	}
-
-	tmpVect[0] = R*pole*PI/2.0;
-	tmpVect[1] = 0;
-	// translate, rotate, then shift
-	vector_sub(v,c,v_min_c);	
-	dot_product(tmpRot,v_min_c,ret_dot);
-	vector_add(a,tmpVect,ret_add);
-	vector_add(ret_dot, ret_add, vector);
-	xy.x = vector[0];
-	xy.y = vector[1];
-	return xy;
-    }else{
-	// compute inverse function.
-	// get the current position of rHEALPix polar squares
-	int pole = floor( (capmap.x + R*3.0*PI/4.0) / (R*PI/2.0));
-	double tmpVect[2] = {R*pole*PI/2.0,0};
-	double coord[2] = {x,y};
-	double (*tmpRot)[2];
-	int cn;
-	// translate polar square to position 0
-	vector_sub(coord,tmpVect,v);
-	// disassemble
-	if(capmap.region == north){
-	    cn = capmap.cn + RFACTOR;
-	    a[0] = R*-3*PI/4.0;
-	    a[1] = PI/2.0;
-	}else{
-	    cn = capmap.cn;
-	    a[0] = R*-3*PI/4.0;
-	    a[1] = PI/-2.0;
-	}
-	tmpVect[0] = R*capmap.cn*PI/2.0;
-	tmpVect[1] = 0;
-	// Math: Rotate Matrix * v-a + a + R*CN*{PI/2,0}
-	vector_sub(v,a,v_min_c);
-	dot_product(rot[cn],v_min_c,ret_dot);
-	vector_add(ret_dot,a,ret_add); 
-	vector_add(ret_add,tmpVect,vector);
-	xy.x = vector[0];
-	xy.y = vector[1];
-	return xy;
-    }
-}
-FORWARD(e_healpix_forward); /* ellipsoidal */
-    //int r1[][2] = R1;
-    double bet = auth_lat(lp.phi, P->e, 0);
-    lp.phi = bet;
-    P->a = P->ra;
-    return healpix_sphere(lp,P);
-}
-FORWARD(s_healpix_forward); /* spheroid */
-    return healpix_sphere(lp, P);
-}
-INVERSE(e_healpix_inverse); /* ellipsoidal */
-    double bet, x, y;
-    P->a = P->ra;
-
-    // Scale down to radius 1 sphere before checking x,y
-    x = scale_number(xy.x,P->a,1);
-    y = scale_number(xy.y,P->a,1);
-    // check if the point is in the image
-    if(in_image(x,y,0,0,0) == 0){
-	lp.lam = HUGE_VAL;
-	lp.phi = HUGE_VAL;
-	pj_ctx_set_errno( P->ctx, -15);
-	return lp;
-    }
-
-    lp = healpix_sphere_inv(xy, P);
-
-    lp.phi = auth_lat(lp.phi,P->e,1);
-    
-    return (lp);
-}
-INVERSE(s_healpix_inverse); /* spheroid */
-    double x = xy.x;
-    double y = xy.y;
-    // Scale down to radius 1 sphere before checking x,y
-    x = scale_number(x,P->a,1);
-    y = scale_number(y,P->a,1);
-    // check if the point is in the image
-    if(in_image(x,y,0,0,0) == 0){
-	lp.lam = HUGE_VAL;
-	lp.phi = HUGE_VAL;
-	pj_ctx_set_errno( P->ctx, -15);
-	return lp;
-    }
-    return healpix_sphere_inv(xy, P);
-}
-FORWARD(e_rhealpix_forward); /* ellipsoidal */
-    double bet = auth_lat(lp.phi,P->e,0);
-    lp.phi = bet;
-    xy = healpix_sphere(lp,P);
-    return combine_caps(xy.x, xy.y, P->a, P->npole, P->spole, 0);
-}
-FORWARD(s_rhealpix_forward); /* spheroid */
-    // Compute forward function.
-    xy = healpix_sphere(lp,P);
-    return combine_caps(xy.x, xy.y, P->a, P->npole, P->spole, 0);
-}
-INVERSE(e_rhealpix_inverse); /* ellipsoidal */
-    double x = scale_number(xy.x,P->a,1);
-    double y = scale_number(xy.y,P->a,1);
-    // check for out of bounds coordinates
-    if(in_image(x,y,1,P->npole,P->spole) == 0){
-	lp.lam = HUGE_VAL;
-	lp.phi = HUGE_VAL;
-	pj_ctx_set_errno( P->ctx, -15);
-	return lp;
-    }
-
-    xy = combine_caps(xy.x,xy.y,P->a,P->npole,P->spole,1);
-    lp = healpix_sphere_inv(xy, P);
-    lp.phi = auth_lat(lp.phi,P->e,1);
-    return lp;
-}
-INVERSE(s_rhealpix_inverse); /* spheroid */
-    double x = scale_number(xy.x,P->a,1);
-    double y = scale_number(xy.y,P->a,1);
-    // check for out of bounds coordinates
-    if(in_image(x,y,1,P->npole,P->spole) == 0){
-	lp.lam = HUGE_VAL;
-	lp.phi = HUGE_VAL;
-	pj_ctx_set_errno( P->ctx, -15);
-	return lp;
-    }
-    xy = combine_caps(xy.x,xy.y,P->a,P->npole,P->spole,1);
-    return healpix_sphere_inv(xy, P);
-}
-FREEUP;
-    if (P) {
-	pj_dalloc(P);
-    }
-}
-ENTRY0(healpix)
-    if(P->es){
-	P->inv = e_healpix_inverse; P->fwd = e_healpix_forward;
-    }else{
-	P->inv = s_healpix_inverse; P->fwd = s_healpix_forward;
-    }
-ENDENTRY(P)
-ENTRY0(rhealpix)
-    P->npole = pj_param(P->ctx, P->params,"inpole").i;
-    P->spole = pj_param(P->ctx,P->params,"ispole").i;
-    
-    // check for valid npole and spole inputs
-    if(P->npole < 0 || P->npole > 3){
-	E_ERROR(-47);
-    }
-    if(P->spole < 0 || P->spole > 3){
-	E_ERROR(-47);
-    }
-
-    if(P->es){
-	P->inv = e_rhealpix_inverse; P->fwd = e_rhealpix_forward;
-    }else{
-	P->inv = s_rhealpix_inverse; P->fwd = s_rhealpix_forward;
-    }
-ENDENTRY(P)
diff --git a/src/proj/PJ_igh.c b/src/proj/PJ_igh.c
deleted file mode 100644
index 4155c85..0000000
--- a/src/proj/PJ_igh.c
+++ /dev/null
@@ -1,190 +0,0 @@
-#define PROJ_PARMS__ \
-        struct PJconsts* pj[12]; \
-        double dy0;
-#define PJ_LIB__
-#include	<projects.h>
-PROJ_HEAD(igh, "Interrupted Goode Homolosine") "\n\tPCyl, Sph.";
-	C_NAMESPACE PJ
-*pj_sinu(PJ *), *pj_moll(PJ *);
-
-static const double d4044118 = (40 + 44/60. + 11.8/3600.) * DEG_TO_RAD; // 40d 44' 11.8" [degrees]
-
-static const double d10  =  10 * DEG_TO_RAD;
-static const double d20  =  20 * DEG_TO_RAD;
-static const double d30  =  30 * DEG_TO_RAD;
-static const double d40  =  40 * DEG_TO_RAD;
-static const double d50  =  50 * DEG_TO_RAD;
-static const double d60  =  60 * DEG_TO_RAD;
-static const double d80  =  80 * DEG_TO_RAD;
-static const double d90  =  90 * DEG_TO_RAD;
-static const double d100 = 100 * DEG_TO_RAD;
-static const double d140 = 140 * DEG_TO_RAD;
-static const double d160 = 160 * DEG_TO_RAD;
-static const double d180 = 180 * DEG_TO_RAD;
-
-static const double EPSLN = 1.e-10; // allow a little 'slack' on zone edge positions
-
-FORWARD(s_forward); /* spheroid */
-        int z;
-        if (lp.phi >=  d4044118) {          // 1|2
-          z = (lp.lam <= -d40 ? 1: 2);
-        }
-        else if (lp.phi >=  0) {            // 3|4
-          z = (lp.lam <= -d40 ? 3: 4);
-        }
-        else if (lp.phi >= -d4044118) {     // 5|6|7|8
-               if (lp.lam <= -d100) z =  5; // 5
-          else if (lp.lam <=  -d20) z =  6; // 6
-          else if (lp.lam <=   d80) z =  7; // 7
-          else z = 8;                       // 8
-        }
-        else {                              // 9|10|11|12
-               if (lp.lam <= -d100) z =  9; // 9
-          else if (lp.lam <=  -d20) z = 10; // 10
-          else if (lp.lam <=   d80) z = 11; // 11
-          else z = 12;                      // 12
-        }
-
-        lp.lam -= P->pj[z-1]->lam0;
-        xy = P->pj[z-1]->fwd(lp, P->pj[z-1]);
-        xy.x += P->pj[z-1]->x0;
-        xy.y += P->pj[z-1]->y0;
-
-        return (xy);
-}
-INVERSE(s_inverse); /* spheroid */
-        const double y90 = P->dy0 + sqrt(2); // lt=90 corresponds to y=y0+sqrt(2)
-
-        int z = 0;
-        if (xy.y > y90+EPSLN || xy.y < -y90+EPSLN) // 0
-          z = 0;
-        else if (xy.y >=  d4044118)       // 1|2
-          z = (xy.x <= -d40? 1: 2);
-        else if (xy.y >=  0)              // 3|4
-          z = (xy.x <= -d40? 3: 4);
-        else if (xy.y >= -d4044118) {     // 5|6|7|8
-               if (xy.x <= -d100) z =  5; // 5
-          else if (xy.x <=  -d20) z =  6; // 6
-          else if (xy.x <=   d80) z =  7; // 7
-          else z = 8;                     // 8
-        }
-        else {                            // 9|10|11|12
-               if (xy.x <= -d100) z =  9; // 9
-          else if (xy.x <=  -d20) z = 10; // 10
-          else if (xy.x <=   d80) z = 11; // 11
-          else z = 12;                    // 12
-        }
-
-        if (z)
-        {
-          int ok = 0;
-
-          xy.x -= P->pj[z-1]->x0;
-          xy.y -= P->pj[z-1]->y0;
-          lp = P->pj[z-1]->inv(xy, P->pj[z-1]);
-          lp.lam += P->pj[z-1]->lam0;
-
-          switch (z) {
-            case  1: ok = (lp.lam >= -d180-EPSLN && lp.lam <=  -d40+EPSLN) ||
-                         ((lp.lam >=  -d40-EPSLN && lp.lam <=  -d10+EPSLN) &&
-                          (lp.phi >=   d60-EPSLN && lp.phi <=   d90+EPSLN)); break;
-            case  2: ok = (lp.lam >=  -d40-EPSLN && lp.lam <=  d180+EPSLN) ||
-                         ((lp.lam >= -d180-EPSLN && lp.lam <= -d160+EPSLN) &&
-                          (lp.phi >=   d50-EPSLN && lp.phi <=   d90+EPSLN)) ||
-                         ((lp.lam >=  -d50-EPSLN && lp.lam <=  -d40+EPSLN) &&
-                          (lp.phi >=   d60-EPSLN && lp.phi <=   d90+EPSLN)); break;
-            case  3: ok = (lp.lam >= -d180-EPSLN && lp.lam <=  -d40+EPSLN); break;
-            case  4: ok = (lp.lam >=  -d40-EPSLN && lp.lam <=  d180+EPSLN); break;
-            case  5: ok = (lp.lam >= -d180-EPSLN && lp.lam <= -d100+EPSLN); break;
-            case  6: ok = (lp.lam >= -d100-EPSLN && lp.lam <=  -d20+EPSLN); break;
-            case  7: ok = (lp.lam >=  -d20-EPSLN && lp.lam <=   d80+EPSLN); break;
-            case  8: ok = (lp.lam >=   d80-EPSLN && lp.lam <=  d180+EPSLN); break;
-            case  9: ok = (lp.lam >= -d180-EPSLN && lp.lam <= -d100+EPSLN); break;
-            case 10: ok = (lp.lam >= -d100-EPSLN && lp.lam <=  -d20+EPSLN); break;
-            case 11: ok = (lp.lam >=  -d20-EPSLN && lp.lam <=   d80+EPSLN); break;
-            case 12: ok = (lp.lam >=   d80-EPSLN && lp.lam <=  d180+EPSLN); break;
-          }
-
-          z = (!ok? 0: z); // projectable?
-        }
-     // if (!z) pj_errno = -15; // invalid x or y
-        if (!z) lp.lam = HUGE_VAL;
-        if (!z) lp.phi = HUGE_VAL;
-        return (lp);
-}
-FREEUP;
-        if (P) {
-                int i;
-                for (i = 0; i < 12; ++i)
-		{
-			if (P->pj[i]) 
-				(*(P->pj[i]->pfree))(P->pj[i]); 
-                }
-                pj_dalloc(P);
-        }
-}
-ENTRY0(igh)
-/*
-  Zones:
-
-    -180            -40                       180
-      +--------------+-------------------------+    Zones 1,2,9,10,11 & 12:
-      |1             |2                        |      Mollweide projection
-      |              |                         |
-      +--------------+-------------------------+    Zones 3,4,5,6,7 & 8:
-      |3             |4                        |      Sinusoidal projection
-      |              |                         |
-    0 +-------+------+-+-----------+-----------+
-      |5      |6       |7          |8          |
-      |       |        |           |           |
-      +-------+--------+-----------+-----------+
-      |9      |10      |11         |12         |
-      |       |        |           |           |
-      +-------+--------+-----------+-----------+
-    -180    -100      -20         80          180
-*/
-
-#define SETUP(n, proj, x_0, y_0, lon_0) \
-    if (!(P->pj[n-1] = pj_##proj(0))) E_ERROR_0; \
-    if (!(P->pj[n-1] = pj_##proj(P->pj[n-1]))) E_ERROR_0; \
-    P->pj[n-1]->x0 = x_0; \
-    P->pj[n-1]->y0 = y_0; \
-    P->pj[n-1]->lam0 = lon_0; 
-
-        LP lp = { 0, d4044118 };
-        XY xy1;
-        XY xy3;
-
-        // sinusoidal zones
-        SETUP(3, sinu, -d100, 0, -d100);
-        SETUP(4, sinu,   d30, 0,   d30);
-        SETUP(5, sinu, -d160, 0, -d160);
-        SETUP(6, sinu,  -d60, 0,  -d60);
-        SETUP(7, sinu,   d20, 0,   d20);
-        SETUP(8, sinu,  d140, 0,  d140);
-
-        // mollweide zones
-        SETUP(1, moll, -d100, 0, -d100);
-
-        // y0 ?
-        xy1 = P->pj[0]->fwd(lp, P->pj[0]); // zone 1
-        xy3 = P->pj[2]->fwd(lp, P->pj[2]); // zone 3
-        // y0 + xy1.y = xy3.y for lt = 40d44'11.8"
-        P->dy0 = xy3.y - xy1.y;
-
-        P->pj[0]->y0 = P->dy0;
-
-        // mollweide zones (cont'd)
-        SETUP( 2, moll,   d30,  P->dy0,   d30);
-        SETUP( 9, moll, -d160, -P->dy0, -d160);
-        SETUP(10, moll,  -d60, -P->dy0,  -d60);
-        SETUP(11, moll,   d20, -P->dy0,   d20);
-        SETUP(12, moll,  d140, -P->dy0,  d140);
-
-        P->inv = s_inverse;
-        P->fwd = s_forward;
-        P->es = 0.;
-ENDENTRY(P)
-
-
-
diff --git a/src/proj/PJ_imw_p.c b/src/proj/PJ_imw_p.c
deleted file mode 100644
index ae41111..0000000
--- a/src/proj/PJ_imw_p.c
+++ /dev/null
@@ -1,151 +0,0 @@
-#define PROJ_PARMS__ \
-	double	P, Pp, Q, Qp, R_1, R_2, sphi_1, sphi_2, C2; \
-	double	phi_1, phi_2, lam_1; \
-	double	*en; \
-	int	mode; /* = 0, phi_1 and phi_2 != 0, = 1, phi_1 = 0, = -1 phi_2 = 0 */
-#define PJ_LIB__
-#include	<projects.h>
-PROJ_HEAD(imw_p, "International Map of the World Polyconic")
-	"\n\tMod. Polyconic, Ell\n\tlat_1= and lat_2= [lon_1=]";
-#define TOL 1e-10
-#define EPS 1e-10
-	static int
-phi12(PJ *P, double *del, double *sig) {
-	int err = 0;
-
-	if (!pj_param(P->ctx, P->params, "tlat_1").i ||
-		!pj_param(P->ctx, P->params, "tlat_2").i) {
-		err = -41;
-	} else {
-		P->phi_1 = pj_param(P->ctx, P->params, "rlat_1").f;
-		P->phi_2 = pj_param(P->ctx, P->params, "rlat_2").f;
-		*del = 0.5 * (P->phi_2 - P->phi_1);
-		*sig = 0.5 * (P->phi_2 + P->phi_1);
-		err = (fabs(*del) < EPS || fabs(*sig) < EPS) ? -42 : 0;
-	}
-	return err;
-}
-	static XY
-loc_for(LP lp, PJ *P, double *yc) {
-	XY xy;
-
-	if (! lp.phi) {
-		xy.x = lp.lam;
-		xy.y = 0.;
-	} else {
-		double xa, ya, xb, yb, xc, D, B, m, sp, t, R, C;
-
-		sp = sin(lp.phi);
-		m = pj_mlfn(lp.phi, sp, cos(lp.phi), P->en);
-		xa = P->Pp + P->Qp * m;
-		ya = P->P + P->Q * m;
-		R = 1. / (tan(lp.phi) * sqrt(1. - P->es * sp * sp));
-		C = sqrt(R * R - xa * xa);
-		if (lp.phi < 0.) C = - C;
-		C += ya - R;
-		if (P->mode < 0) {
-			xb = lp.lam;
-			yb = P->C2;
-		} else {
-			t = lp.lam * P->sphi_2;
-			xb = P->R_2 * sin(t);
-			yb = P->C2 + P->R_2 * (1. - cos(t));
-		}
-		if (P->mode > 0) {
-			xc = lp.lam;
-			*yc = 0.;
-		} else {
-			t = lp.lam * P->sphi_1;
-			xc = P->R_1 * sin(t);
-			*yc = P->R_1 * (1. - cos(t));
-		}
-		D = (xb - xc)/(yb - *yc);
-		B = xc + D * (C + R - *yc);
-		xy.x = D * sqrt(R * R * (1 + D * D) - B * B);
-		if (lp.phi > 0)
-			xy.x = - xy.x;
-		xy.x = (B + xy.x) / (1. + D * D);
-		xy.y = sqrt(R * R - xy.x * xy.x);
-		if (lp.phi > 0)
-			xy.y = - xy.y;
-		xy.y += C + R;
-	}
-	return (xy);
-}
-FORWARD(e_forward); /* ellipsoid */
-	double yc;
-	xy = loc_for(lp, P, &yc);
-	return (xy);
-}
-INVERSE(e_inverse); /* ellipsoid */
-	XY t;
-	double yc;
-
-	lp.phi = P->phi_2;
-	lp.lam = xy.x / cos(lp.phi);
-	do {
-		t = loc_for(lp, P, &yc);
-		lp.phi = ((lp.phi - P->phi_1) * (xy.y - yc) / (t.y - yc)) + P->phi_1;
-		lp.lam = lp.lam * xy.x / t.x;
-	} while (fabs(t.x - xy.x) > TOL || fabs(t.y - xy.y) > TOL);
-	return (lp);
-}
-	static void
-xy(PJ *P, double phi, double *x, double *y, double *sp, double *R) {
-	double F;
-
-	*sp = sin(phi);
-	*R = 1./(tan(phi) * sqrt(1. - P->es * *sp * *sp ));
-	F = P->lam_1 * *sp;
-	*y = *R * (1 - cos(F));
-	*x = *R * sin(F);
-}
-FREEUP; if (P) { if (P->en) pj_dalloc(P->en); pj_dalloc(P); } }
-ENTRY1(imw_p, en)
-	double del, sig, s, t, x1, x2, T2, y1, m1, m2, y2;
-	int i;
-
-	if (!(P->en = pj_enfn(P->es))) E_ERROR_0;
-	if( (i = phi12(P, &del, &sig)) != 0)
-		E_ERROR(i);
-	if (P->phi_2 < P->phi_1) { /* make sure P->phi_1 most southerly */
-		del = P->phi_1;
-		P->phi_1 = P->phi_2;
-		P->phi_2 = del;
-	}
-	if (pj_param(P->ctx, P->params, "tlon_1").i)
-		P->lam_1 = pj_param(P->ctx, P->params, "rlon_1").f;
-	else { /* use predefined based upon latitude */
-		sig = fabs(sig * RAD_TO_DEG);
-		if (sig <= 60)		sig = 2.;
-		else if (sig <= 76) sig = 4.;
-		else				sig = 8.;
-		P->lam_1 = sig * DEG_TO_RAD;
-	}
-	P->mode = 0;
-	if (P->phi_1) xy(P, P->phi_1, &x1, &y1, &P->sphi_1, &P->R_1);
-	else {
-		P->mode = 1;
-		y1 = 0.;
-		x1 = P->lam_1;
-	}
-	if (P->phi_2) xy(P, P->phi_2, &x2, &T2, &P->sphi_2, &P->R_2);
-	else {
-		P->mode = -1;
-		T2 = 0.;
-		x2 = P->lam_1;
-	}
-	m1 = pj_mlfn(P->phi_1, P->sphi_1, cos(P->phi_1), P->en);
-	m2 = pj_mlfn(P->phi_2, P->sphi_2, cos(P->phi_2), P->en);
-	t = m2 - m1;
-	s = x2 - x1;
-	y2 = sqrt(t * t - s * s) + y1;
-	P->C2 = y2 - T2;
-	t = 1. / t;
-	P->P = (m2 * y1 - m1 * y2) * t;
-	P->Q = (y2 - y1) * t;
-	P->Pp = (m2 * x1 - m1 * x2) * t;
-	P->Qp = (x2 - x1) * t;
-	P->fwd = e_forward;
-	P->inv = e_inverse;
-ENDENTRY(P)
diff --git a/src/proj/PJ_isea.c b/src/proj/PJ_isea.c
deleted file mode 100644
index fb38aff..0000000
--- a/src/proj/PJ_isea.c
+++ /dev/null
@@ -1,1134 +0,0 @@
-/*
- * This code was entirely written by Nathan Wagner
- * and is in the public domain.
- */
-
-#include <math.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <float.h>
-
-#ifndef M_PI
-#  define M_PI 3.14159265358979323846
-#endif
-
-/*
- * Proj 4 provides its own entry points into
- * the code, so none of the library functions
- * need to be global
- */
-#define ISEA_STATIC static
-#ifndef ISEA_STATIC
-#define ISEA_STATIC
-#endif
-
-struct hex {
-        int iso;
-        int x, y, z;
-};
-
-/* y *must* be positive down as the xy /iso conversion assumes this */
-ISEA_STATIC
-int hex_xy(struct hex *h) {
-	if (!h->iso) return 1;
-	if (h->x >= 0) {
-		h->y = -h->y - (h->x+1)/2;
-	} else {
-		/* need to round toward -inf, not toward zero, so x-1 */
-		h->y = -h->y - h->x/2;
-	}
-	h->iso = 0;
-
-	return 1;
-}
-
-ISEA_STATIC
-int hex_iso(struct hex *h) {
-	if (h->iso) return 1;
-
-	if (h->x >= 0) {
-		h->y = (-h->y - (h->x+1)/2);
-	} else {
-		/* need to round toward -inf, not toward zero, so x-1 */
-		h->y = (-h->y - (h->x)/2);
-	}
-
-	h->z = -h->x - h->y;
-	h->iso = 1;
-	return 1;
-}
-
-ISEA_STATIC
-int hexbin2(int horizontal, double width, double x, double y,
-                int *i, int *j) {
-	double z, rx, ry, rz;
-	double abs_dx, abs_dy, abs_dz;
-	int ix, iy, iz, s;
-	struct hex h;
-
-	x = x / cos(30 * M_PI / 180.0); /* rotated X coord */
-	y = y - x / 2.0; /* adjustment for rotated X */
-
-	/* adjust for actual hexwidth */
-	x /= width;
-	y /= width;
-
-	z = -x - y;
-
-	ix = rx = floor(x + 0.5);
-	iy = ry = floor(y + 0.5);
-	iz = rz = floor(z + 0.5);
-
-	s = ix + iy + iz;
-
-	if (s) {
-		abs_dx = fabs(rx - x);
-		abs_dy = fabs(ry - y);
-		abs_dz = fabs(rz - z);
-
-		if (abs_dx >= abs_dy && abs_dx >= abs_dz) {
-			ix -= s;
-		} else if (abs_dy >= abs_dx && abs_dy >= abs_dz) {
-			iy -= s;
-		} else {
-			iz -= s;
-		}
-	}
-	h.x = ix;
-	h.y = iy;
-	h.z = iz;
-	h.iso = 1;
-
-	hex_xy(&h);
-	*i = h.x;
-	*j = h.y;
-        return ix * 100 + iy;
-}
-#ifndef ISEA_STATIC
-#define ISEA_STATIC
-#endif
-
-enum isea_poly { ISEA_NONE, ISEA_ICOSAHEDRON = 20 };
-enum isea_topology { ISEA_HEXAGON=6, ISEA_TRIANGLE=3, ISEA_DIAMOND=4 };
-enum isea_address_form { ISEA_GEO, ISEA_Q2DI, ISEA_SEQNUM, ISEA_INTERLEAVE,
-	ISEA_PLANE, ISEA_Q2DD, ISEA_PROJTRI, ISEA_VERTEX2DD, ISEA_HEX
-};
-
-struct isea_dgg {
-	int	polyhedron; /* ignored, icosahedron */
-	double	o_lat, o_lon, o_az; /* orientation, radians */
-	int	pole; /* true if standard snyder */
-	int	topology; /* ignored, hexagon */
-	int	aperture; /* valid values depend on partitioning method */
-	int	resolution;
-	double	radius; /* radius of the earth in meters, ignored 1.0 */
-	int	output; /* an isea_address_form */
-	int	triangle; /* triangle of last transformed point */
-	int	quad; /* quad of last transformed point */
-	unsigned long serial;
-};
-
-struct isea_pt {
-	double x, y;
-};
-
-struct isea_geo {
-	double lon, lat;
-};
-
-struct isea_address {
-	int	type; /* enum isea_address_form */
-	int	number;
-	double	x,y; /* or i,j or lon,lat depending on type */
-};
-
-/* ENDINC */
-
-enum snyder_polyhedron {
-	SNYDER_POLY_HEXAGON, SNYDER_POLY_PENTAGON,
-	SNYDER_POLY_TETRAHEDRON, SNYDER_POLY_CUBE,
-	SNYDER_POLY_OCTAHEDRON, SNYDER_POLY_DODECAHEDRON,
-	SNYDER_POLY_ICOSAHEDRON
-};
-
-struct snyder_constants {
-	double          g, G, theta, ea_w, ea_a, ea_b, g_w, g_a, g_b;
-};
-
-/* TODO put these in radians to avoid a later conversion */
-ISEA_STATIC
-struct snyder_constants constants[] = {
-	{23.80018260, 62.15458023, 60.0, 3.75, 1.033, 0.968, 5.09, 1.195, 1.0},
-	{20.07675127, 55.69063953, 54.0, 2.65, 1.030, 0.983, 3.59, 1.141, 1.027},
-	{0.0},
-	{0.0},
-	{0.0},
-	{0.0},
-	{37.37736814, 36.0, 30.0, 17.27, 1.163, 0.860, 13.14, 1.584, 1.0},
-};
-
-#define E 52.62263186
-#define F 10.81231696
-
-#define DEG60 1.04719755119659774614
-#define DEG120 2.09439510239319549229
-#define DEG72 1.25663706143591729537
-#define DEG90 1.57079632679489661922
-#define DEG144 2.51327412287183459075
-#define DEG36 0.62831853071795864768
-#define DEG108 1.88495559215387594306
-#define DEG180 M_PI
-/* sqrt(5)/M_PI */
-#define ISEA_SCALE 0.8301572857837594396028083
-
-/* 26.565051177 degrees */
-#define V_LAT 0.46364760899944494524
-
-#define RAD2DEG (180.0/M_PI)
-#define DEG2RAD (M_PI/180.0)
-
-ISEA_STATIC
-struct isea_geo vertex[] = {
-	{0.0, DEG90},
-	{DEG180, V_LAT},
-	{-DEG108, V_LAT},
-	{-DEG36, V_LAT},
-	{DEG36, V_LAT},
-	{DEG108, V_LAT},
-	{-DEG144, -V_LAT},
-	{-DEG72, -V_LAT},
-	{0.0, -V_LAT},
-	{DEG72, -V_LAT},
-	{DEG144, -V_LAT},
-	{0.0, -DEG90}
-};
-
-/* TODO make an isea_pt array of the vertices as well */
-
-static int      tri_v1[] = {0, 0, 0, 0, 0, 0, 6, 7, 8, 9, 10, 2, 3, 4, 5, 1, 11, 11, 11, 11, 11};
-
-/* 52.62263186 */
-#define E_RAD 0.91843818702186776133
-
-/* 10.81231696 */
-#define F_RAD 0.18871053072122403508
-
-/* triangle Centers */
-struct isea_geo icostriangles[] = {
-	{0.0, 0.0},
-	{-DEG144, E_RAD},
-	{-DEG72, E_RAD},
-	{0.0, E_RAD},
-	{DEG72, E_RAD},
-	{DEG144, E_RAD},
-	{-DEG144, F_RAD},
-	{-DEG72, F_RAD},
-	{0.0, F_RAD},
-	{DEG72, F_RAD},
-	{DEG144, F_RAD},
-	{-DEG108, -F_RAD},
-	{-DEG36, -F_RAD},
-	{DEG36, -F_RAD},
-	{DEG108, -F_RAD},
-	{DEG180, -F_RAD},
-	{-DEG108, -E_RAD},
-	{-DEG36, -E_RAD},
-	{DEG36, -E_RAD},
-	{DEG108, -E_RAD},
-	{DEG180, -E_RAD},
-};
-
-static double
-az_adjustment(int triangle)
-{
-	double          adj;
-
-	struct isea_geo v;
-	struct isea_geo c;
-
-	v = vertex[tri_v1[triangle]];
-	c = icostriangles[triangle];
-
-	/* TODO looks like the adjustment is always either 0 or 180 */
-	/* at least if you pick your vertex carefully */
-	adj = atan2(cos(v.lat) * sin(v.lon - c.lon),
-		    cos(c.lat) * sin(v.lat)
-		    - sin(c.lat) * cos(v.lat) * cos(v.lon - c.lon));
-	return adj;
-}
-
-/* R tan(g) sin(60) */
-#define TABLE_G 0.6615845383
-
-/* H = 0.25 R tan g = */
-#define TABLE_H 0.1909830056
-
-#define RPRIME 0.91038328153090290025
-
-ISEA_STATIC
-struct isea_pt
-isea_triangle_xy(int triangle)
-{
-	struct isea_pt  c;
-	double Rprime = 0.91038328153090290025;
-
-	triangle = (triangle - 1) % 20;
-
-	c.x = TABLE_G * ((triangle % 5) - 2) * 2.0;
-	if (triangle > 9) {
-		c.x += TABLE_G;
-	}
-	switch (triangle / 5) {
-	case 0:
-		c.y = 5.0 * TABLE_H;
-		break;
-	case 1:
-		c.y = TABLE_H;
-		break;
-	case 2:
-		c.y = -TABLE_H;
-		break;
-	case 3:
-		c.y = -5.0 * TABLE_H;
-		break;
-	default:
-		/* should be impossible */
-		exit(EXIT_FAILURE);
-	};
-	c.x *= Rprime;
-	c.y *= Rprime;
-
-	return c;
-}
-
-/* snyder eq 14 */
-static double
-sph_azimuth(double f_lon, double f_lat, double t_lon, double t_lat)
-{
-	double          az;
-
-	az = atan2(cos(t_lat) * sin(t_lon - f_lon),
-		   cos(f_lat) * sin(t_lat)
-		   - sin(f_lat) * cos(t_lat) * cos(t_lon - f_lon)
-		);
-	return az;
-}
-
-/* coord needs to be in radians */
-ISEA_STATIC
-int
-isea_snyder_forward(struct isea_geo * ll, struct isea_pt * out)
-{
-	int             i;
-
-	/*
-	 * spherical distance from center of polygon face to any of its
-	 * vertexes on the globe
-	 */
-	double          g;
-
-	/*
-	 * spherical angle between radius vector to center and adjacent edge
-	 * of spherical polygon on the globe
-	 */
-	double          G;
-
-	/*
-	 * plane angle between radius vector to center and adjacent edge of
-	 * plane polygon
-	 */
-	double          theta;
-
-	/* additional variables from snyder */
-	double          q, Rprime, H, Ag, Azprime, Az, dprime, f, rho,
-	                x, y;
-
-	/* variables used to store intermediate results */
-	double          cot_theta, tan_g, az_offset;
-
-	/* how many multiples of 60 degrees we adjust the azimuth */
-	int             Az_adjust_multiples;
-
-	struct snyder_constants c;
-
-	/*
-	 * TODO by locality of reference, start by trying the same triangle
-	 * as last time
-	 */
-
-	/* TODO put these constants in as radians to begin with */
-	c = constants[SNYDER_POLY_ICOSAHEDRON];
-	theta = c.theta * DEG2RAD;
-	g = c.g * DEG2RAD;
-	G = c.G * DEG2RAD;
-
-	for (i = 1; i <= 20; i++) {
-		double          z;
-		struct isea_geo center;
-
-		center = icostriangles[i];
-
-		/* step 1 */
-#if 0
-		z = sph_distance(center.lon, center.lat, ll->lon, ll->lat);
-#else
-		z = acos(sin(center.lat) * sin(ll->lat)
-			 + cos(center.lat) * cos(ll->lat) * cos(ll->lon - center.lon));
-#endif
-
-		/* not on this triangle */
-		if (z > g + 0.000005) { /* TODO DBL_EPSILON */
-			continue;
-		}
-		Az = sph_azimuth(ll->lon, ll->lat, center.lon, center.lat);
-
-		Az = atan2(cos(ll->lat) * sin(ll->lon - center.lon),
-			   cos(center.lat) * sin(ll->lat)
-		- sin(center.lat) * cos(ll->lat) * cos(ll->lon - center.lon)
-			);
-
-		/* step 2 */
-
-		/* This calculates "some" vertex coordinate */
-		az_offset = az_adjustment(i);
-
-		Az -= az_offset;
-
-		/* TODO I don't know why we do this.  It's not in snyder */
-		/* maybe because we should have picked a better vertex */
-		if (Az < 0.0) {
-			Az += 2.0 * M_PI;
-		}
-		/*
-		 * adjust Az for the point to fall within the range of 0 to
-		 * 2(90 - theta) or 60 degrees for the hexagon, by
-		 * and therefore 120 degrees for the triangle
-		 * of the icosahedron
-		 * subtracting or adding multiples of 60 degrees to Az and
-		 * recording the amount of adjustment
-		 */
-
-		Az_adjust_multiples = 0;
-		while (Az < 0.0) {
-			Az += DEG120;
-			Az_adjust_multiples--;
-		}
-		while (Az > DEG120 + DBL_EPSILON) {
-			Az -= DEG120;
-			Az_adjust_multiples++;
-		}
-
-		/* step 3 */
-		cot_theta = 1.0 / tan(theta);
-		tan_g = tan(g);	/* TODO this is a constant */
-
-		/* Calculate q from eq 9. */
-		/* TODO cot_theta is cot(30) */
-		q = atan2(tan_g, cos(Az) + sin(Az) * cot_theta);
-
-		/* not in this triangle */
-		if (z > q + 0.000005) {
-			continue;
-		}
-		/* step 4 */
-
-		/* Apply equations 5-8 and 10-12 in order */
-
-		/* eq 5 */
-		/* Rprime = 0.9449322893 * R; */
-		/* R' in the paper is for the truncated */
-		Rprime = 0.91038328153090290025;
-
-		/* eq 6 */
-		H = acos(sin(Az) * sin(G) * cos(g) - cos(Az) * cos(G));
-
-		/* eq 7 */
-		/* Ag = (Az + G + H - DEG180) * M_PI * R * R / DEG180; */
-		Ag = Az + G + H - DEG180;
-
-		/* eq 8 */
-		Azprime = atan2(2.0 * Ag, Rprime * Rprime * tan_g * tan_g - 2.0 * Ag * cot_theta);
-
-		/* eq 10 */
-		/* cot(theta) = 1.73205080756887729355 */
-		dprime = Rprime * tan_g / (cos(Azprime) + sin(Azprime) * cot_theta);
-
-		/* eq 11 */
-		f = dprime / (2.0 * Rprime * sin(q / 2.0));
-
-		/* eq 12 */
-		rho = 2.0 * Rprime * f * sin(z / 2.0);
-
-		/*
-		 * add back the same 60 degree multiple adjustment from step
-		 * 2 to Azprime
-		 */
-
-		Azprime += DEG120 * Az_adjust_multiples;
-
-		/* calculate rectangular coordinates */
-
-		x = rho * sin(Azprime);
-		y = rho * cos(Azprime);
-
-		/*
-		 * TODO
-		 * translate coordinates to the origin for the particular
-		 * hexagon on the flattened polyhedral map plot
-		 */
-
-		out->x = x;
-		out->y = y;
-
-		return i;
-	}
-
-	/*
-	 * should be impossible, this implies that the coordinate is not on
-	 * any triangle
-	 */
-
-	fprintf(stderr, "impossible transform: %f %f is not on any triangle\n",
-		ll->lon * RAD2DEG, ll->lat * RAD2DEG);
-
-	exit(EXIT_FAILURE);
-
-	/* not reached */
-	return 0;		/* supresses a warning */
-}
-
-/*
- * return the new coordinates of any point in orginal coordinate system.
- * Define a point (newNPold) in orginal coordinate system as the North Pole in
- * new coordinate system, and the great circle connect the original and new
- * North Pole as the lon0 longitude in new coordinate system, given any point
- * in orginal coordinate system, this function return the new coordinates.
- */
-
-#define PRECISION 0.0000000000005
-
-/* formula from Snyder, Map Projections: A working manual, p31 */
-/*
- * old north pole at np in new coordinates
- * could be simplified a bit with fewer intermediates
- *
- * TODO take a result pointer
- */
-ISEA_STATIC
-struct isea_geo
-snyder_ctran(struct isea_geo * np, struct isea_geo * pt)
-{
-	struct isea_geo npt;
-	double          alpha, phi, lambda, lambda0, beta, lambdap, phip;
-	double          sin_phip;
-	double          lp_b;	/* lambda prime minus beta */
-	double          cos_p, sin_a;
-
-	phi = pt->lat;
-	lambda = pt->lon;
-	alpha = np->lat;
-	beta = np->lon;
-	lambda0 = beta;
-
-	cos_p = cos(phi);
-	sin_a = sin(alpha);
-
-	/* mpawm 5-7 */
-	sin_phip = sin_a * sin(phi) - cos(alpha) * cos_p * cos(lambda - lambda0);
-
-	/* mpawm 5-8b */
-
-	/* use the two argument form so we end up in the right quadrant */
-	lp_b = atan2(cos_p * sin(lambda - lambda0),
-	   (sin_a * cos_p * cos(lambda - lambda0) + cos(alpha) * sin(phi)));
-
-	lambdap = lp_b + beta;
-
-	/* normalize longitude */
-	/* TODO can we just do a modulus ? */
-	lambdap = fmod(lambdap, 2 * M_PI);
-	while (lambdap > M_PI)
-		lambdap -= 2 * M_PI;
-	while (lambdap < -M_PI)
-		lambdap += 2 * M_PI;
-
-	phip = asin(sin_phip);
-
-	npt.lat = phip;
-	npt.lon = lambdap;
-
-	return npt;
-}
-
-ISEA_STATIC
-struct isea_geo
-isea_ctran(struct isea_geo * np, struct isea_geo * pt, double lon0)
-{
-	struct isea_geo npt;
-
-	np->lon += M_PI;
-	npt = snyder_ctran(np, pt);
-	np->lon -= M_PI;
-
-	npt.lon -= (M_PI - lon0 + np->lon);
-
-	/*
-	 * snyder is down tri 3, isea is along side of tri1 from vertex 0 to
-	 * vertex 1 these are 180 degrees apart
-	 */
-	npt.lon += M_PI;
-	/* normalize longitude */
-	npt.lon = fmod(npt.lon, 2 * M_PI);
-	while (npt.lon > M_PI)
-		npt.lon -= 2 * M_PI;
-	while (npt.lon < -M_PI)
-		npt.lon += 2 * M_PI;
-
-	return npt;
-}
-
-/* in radians */
-#define ISEA_STD_LAT 1.01722196792335072101
-#define ISEA_STD_LON .19634954084936207740
-
-/* fuller's at 5.2454 west, 2.3009 N, adjacent at 7.46658 deg */
-
-ISEA_STATIC
-int
-isea_grid_init(struct isea_dgg * g)
-{
-	if (!g)
-		return 0;
-
-	g->polyhedron = 20;
-	g->o_lat = ISEA_STD_LAT;
-	g->o_lon = ISEA_STD_LON;
-	g->o_az = 0.0;
-	g->aperture = 4;
-	g->resolution = 6;
-	g->radius = 1.0;
-	g->topology = 6;
-
-	return 1;
-}
-
-ISEA_STATIC
-int
-isea_orient_isea(struct isea_dgg * g)
-{
-	if (!g)
-		return 0;
-	g->o_lat = ISEA_STD_LAT;
-	g->o_lon = ISEA_STD_LON;
-	g->o_az = 0.0;
-	return 1;
-}
-
-ISEA_STATIC
-int
-isea_orient_pole(struct isea_dgg * g)
-{
-	if (!g)
-		return 0;
-	g->o_lat = M_PI / 2.0;
-	g->o_lon = 0.0;
-	g->o_az = 0;
-	return 1;
-}
-
-ISEA_STATIC
-int
-isea_transform(struct isea_dgg * g, struct isea_geo * in,
-	       struct isea_pt * out)
-{
-	struct isea_geo i, pole;
-	int             tri;
-
-	pole.lat = g->o_lat;
-	pole.lon = g->o_lon;
-
-	i = isea_ctran(&pole, in, g->o_az);
-
-	tri = isea_snyder_forward(&i, out);
-	out->x *= g->radius;
-	out->y *= g->radius;
-	g->triangle = tri;
-
-	return tri;
-}
-
-#define DOWNTRI(tri) (((tri - 1) / 5) % 2 == 1)
-
-ISEA_STATIC
-void
-isea_rotate(struct isea_pt * pt, double degrees)
-{
-	double          rad;
-
-	double          x, y;
-
-	rad = -degrees * M_PI / 180.0;
-	while (rad >= 2.0 * M_PI) rad -= 2.0 * M_PI;
-	while (rad <= -2.0 * M_PI) rad += 2.0 * M_PI;
-
-	x = pt->x * cos(rad) + pt->y * sin(rad);
-	y = -pt->x * sin(rad) + pt->y * cos(rad);
-
-	pt->x = x;
-	pt->y = y;
-}
-
-ISEA_STATIC
-int isea_tri_plane(int tri, struct isea_pt *pt, double radius) {
-	struct isea_pt tc; /* center of triangle */
-
-	if (DOWNTRI(tri)) {
-		isea_rotate(pt, 180.0);
-	}
-	tc = isea_triangle_xy(tri);
-	tc.x *= radius;
-	tc.y *= radius;
-	pt->x += tc.x;
-	pt->y += tc.y;
-
-	return tri;
-}
-
-/* convert projected triangle coords to quad xy coords, return quad number */
-ISEA_STATIC
-int
-isea_ptdd(int tri, struct isea_pt *pt) {
-	int             downtri, quad;
-
-	downtri = (((tri - 1) / 5) % 2 == 1);
-	quad = ((tri - 1) % 5) + ((tri - 1) / 10) * 5 + 1;
-
-	isea_rotate(pt, downtri ? 240.0 : 60.0);
-	if (downtri) {
-		pt->x += 0.5;
-		/* pt->y += cos(30.0 * M_PI / 180.0); */
-		pt->y += .86602540378443864672;
-	}
-	return quad;
-}
-
-ISEA_STATIC
-int
-isea_dddi_ap3odd(struct isea_dgg *g, int quad, struct isea_pt *pt, struct isea_pt *di)
-{
-	struct isea_pt  v;
-	double          hexwidth;
-	double          sidelength;	/* in hexes */
-	int             d, i;
-	int             maxcoord;
-	struct hex      h;
-
-	/* This is the number of hexes from apex to base of a triangle */
-	sidelength = (pow(2.0, g->resolution) + 1.0) / 2.0;
-
-	/* apex to base is cos(30deg) */
-	hexwidth = cos(M_PI / 6.0) / sidelength;
-
-	/* TODO I think sidelength is always x.5, so
-	 * (int)sidelength * 2 + 1 might be just as good
-	 */
-	maxcoord = (int) (sidelength * 2.0 + 0.5);
-
-	v = *pt;
-	hexbin2(0, hexwidth, v.x, v.y, &h.x, &h.y);
-	h.iso = 0;
-	hex_iso(&h);
-
-	d = h.x - h.z;
-	i = h.x + h.y + h.y;
-	
-	/*
-	 * you want to test for max coords for the next quad in the same
-	 * "row" first to get the case where both are max
-	 */
-	if (quad <= 5) {
-		if (d == 0 && i == maxcoord) {
-			/* north pole */
-			quad = 0;
-			d = 0;
-			i = 0;
-		} else if (i == maxcoord) {
-			/* upper right in next quad */
-			quad += 1;
-			if (quad == 6)
-				quad = 1;
-			i = maxcoord - d;
-			d = 0;
-		} else if (d == maxcoord) {
-			/* lower right in quad to lower right */
-			quad += 5;
-			d = 0;
-		}
-	} else if (quad >= 6) {
-		if (i == 0 && d == maxcoord) {
-			/* south pole */
-			quad = 11;
-			d = 0;
-			i = 0;
-		} else if (d == maxcoord) {
-			/* lower right in next quad */
-			quad += 1;
-			if (quad == 11)
-				quad = 6;
-			d = maxcoord - i;
-			i = 0;
-		} else if (i == maxcoord) {
-			/* upper right in quad to upper right */
-			quad = (quad - 4) % 5;
-			i = 0;
-		}
-	}
-
-	di->x = d;
-	di->y = i;
-
-	g->quad = quad;
-	return quad;
-}
-
-ISEA_STATIC
-int
-isea_dddi(struct isea_dgg *g, int quad, struct isea_pt *pt, struct isea_pt *di) {
-	struct isea_pt  v;
-	double          hexwidth;
-	int             sidelength;	/* in hexes */
-	struct hex      h;
-
-	if (g->aperture == 3 && g->resolution % 2 != 0) {
-		return isea_dddi_ap3odd(g, quad, pt, di);
-	}
-	/* todo might want to do this as an iterated loop */
-	if (g->aperture >0) {
-		sidelength = (int) (pow(g->aperture, g->resolution / 2.0) + 0.5);
-	} else {
-		sidelength = g->resolution;
-	}
-
-	hexwidth = 1.0 / sidelength;
-
-	v = *pt;
-	isea_rotate(&v, -30.0);
-	hexbin2(0, hexwidth, v.x, v.y, &h.x, &h.y);
-	h.iso = 0;
-	hex_iso(&h);
-
-	/* we may actually be on another quad */
-	if (quad <= 5) {
-		if (h.x == 0 && h.z == -sidelength) {
-			/* north pole */
-			quad = 0;
-			h.z = 0;
-			h.y = 0;
-			h.x = 0;
-		} else if (h.z == -sidelength) {
-			quad = quad + 1;
-			if (quad == 6)
-				quad = 1;
-			h.y = sidelength - h.x;
-			h.z = h.x - sidelength;
-			h.x = 0;
-		} else if (h.x == sidelength) {
-			quad += 5;
-			h.y = -h.z;
-			h.x = 0;
-		}
-	} else if (quad >= 6) {
-		if (h.z == 0 && h.x == sidelength) {
-			/* south pole */
-			quad = 11;
-			h.x = 0;
-			h.y = 0;
-			h.z = 0;
-		} else if (h.x == sidelength) {
-			quad = quad + 1;
-			if (quad == 11)
-				quad = 6;
-			h.x = h.y + sidelength;
-			h.y = 0;
-			h.z = -h.x;
-		} else if (h.y == -sidelength) {
-			quad -= 4;
-			h.y = 0;
-			h.z = -h.x;
-		}
-	}
-	di->x = h.x;
-	di->y = -h.z;
-
-	g->quad = quad;
-	return quad;
-}
-
-ISEA_STATIC
-int isea_ptdi(struct isea_dgg *g, int tri, struct isea_pt *pt,
-	       	struct isea_pt *di) {
-	struct isea_pt  v;
-	int             quad;
-
-	v = *pt;
-	quad = isea_ptdd(tri, &v);
-	quad = isea_dddi(g, quad, &v, di);
-	return quad;
-}
-
-/* q2di to seqnum */
-ISEA_STATIC
-int isea_disn(struct isea_dgg *g, int quad, struct isea_pt *di) {
-	int             sidelength;
-	int             sn, height;
-	int             hexes;
-
-	if (quad == 0) {
-		g->serial = 1;
-		return g->serial;
-	}
-	/* hexes in a quad */
-	hexes = (int) (pow(g->aperture, g->resolution) + 0.5);
-	if (quad == 11) {
-		g->serial = 1 + 10 * hexes + 1;
-		return g->serial;
-	}
-	if (g->aperture == 3 && g->resolution % 2 == 1) {
-		height = (int) (pow(g->aperture, (g->resolution - 1) / 2.0));
-		sn = ((int) di->x) * height;
-		sn += ((int) di->y) / height;
-		sn += (quad - 1) * hexes;
-		sn += 2;
-	} else {
-		sidelength = (int) (pow(g->aperture, g->resolution / 2.0) + 0.5);
-		sn = (quad - 1) * hexes + sidelength * di->x + di->y + 2;
-	}
-
-	g->serial = sn;
-	return sn;
-}
-
-/* TODO just encode the quad in the d or i coordinate
- * quad is 0-11, which can be four bits.
- * d' = d << 4 + q, d = d' >> 4, q = d' & 0xf
- */
-/* convert a q2di to global hex coord */
-ISEA_STATIC
-int isea_hex(struct isea_dgg *g, int tri,
-		struct isea_pt *pt, struct isea_pt *hex) {
-	struct isea_pt v;
-	int sidelength;
-	int d, i, x, y, quad;
-	double oddsl;
-
-	quad = isea_ptdi(g, tri, pt, &v);
-
-	hex->x = ((int)v.x << 4) + quad;
-	hex->y = v.y;
-
-	return 1;
-
-	d = v.x;
-	i = v.y;
-
-	/* Aperture 3 odd resolutions */
-	if (g->aperture == 3 && g->resolution % 2 != 0) {
-		int offset = (int)(pow(3.0, g->resolution - 1) + 0.5);
-
-		oddsl = (pow(2.0, g->resolution) + 1.0) / 2.0;
-
-		d += offset * ((g->quad-1) % 5);
-		i += offset * ((g->quad-1) % 5);
-
-		if (quad == 0) {
-			d = 0;
-			i = offset;
-		} else if (quad == 11) {
-			d = 2 * offset;
-			i = 0;
-		} else if (quad > 5) {
-			d += offset;
-		}
-
-		x = (2*d - i) /3;
-		y = (2*i - d) /3;
-
-		hex->x = x + offset / 3;
-		hex->y = y + 2 * offset / 3;
-		return 1;
-	}
-
-	/* aperture 3 even resolutions and aperture 4 */
-	sidelength = (int) (pow(g->aperture, g->resolution / 2.0) + 0.5);
-	if (g->quad == 0) {
-		hex->x = 0;
-		hex->y = sidelength;
-	} else if (g->quad == 11) {
-		hex->x = sidelength * 2;
-		hex->y = 0;
-	} else {
-		hex->x = d + sidelength * ((g->quad-1) % 5);
-		if (g->quad > 5) hex->x += sidelength;
-		hex->y = i + sidelength * ((g->quad-1) % 5);
-	}
-
-	return 1;
-}
-
-ISEA_STATIC
-struct isea_pt
-isea_forward(struct isea_dgg *g, struct isea_geo *in)
-{
-	int             tri, downtri, quad;
-	struct isea_pt  out, coord;
-
-	tri = isea_transform(g, in, &out);
-
-	downtri = (((tri - 1) / 5) % 2 == 1);
-	quad = ((tri - 1) % 5) + ((tri - 1) / 10) * 5 + 1;
-
-	if (g->output == ISEA_PLANE) {
-		isea_tri_plane(tri, &out, g->radius);
-		return out;
-	}
-
-	/* convert to isea standard triangle size */
-	out.x = out.x / g->radius * ISEA_SCALE;
-	out.y = out.y / g->radius * ISEA_SCALE;
-	out.x += 0.5;
-	out.y += 2.0 * .14433756729740644112;
-
-	switch (g->output) {
-	case ISEA_PROJTRI:
-		/* nothing to do, already in projected triangle */
-		break;
-	case ISEA_VERTEX2DD:
-		g->quad = isea_ptdd(tri, &out);
-		break;
-	case ISEA_Q2DD:
-		/* Same as above, we just don't print as much */
-		g->quad = isea_ptdd(tri, &out);
-		break;
-	case ISEA_Q2DI:
-		g->quad = isea_ptdi(g, tri, &out, &coord);
-		return coord;
-		break;
-	case ISEA_SEQNUM:
-		isea_ptdi(g, tri, &out, &coord);
-		/* disn will set g->serial */
-		isea_disn(g, g->quad, &coord);
-		return coord;
-		break;
-	case ISEA_HEX:
-		isea_hex(g, tri, &out, &coord);
-		return coord;
-		break;
-	}
-
-	return out;
-}
-/*
- * Proj 4 integration code follows
- */
-
-#define PROJ_PARMS__ \
-	struct isea_dgg dgg;
-
-#define PJ_LIB__
-#include <projects.h>
-
-PROJ_HEAD(isea, "Icosahedral Snyder Equal Area") "\n\tSph";
-
-FORWARD(s_forward);
-	struct isea_pt out;
-	struct isea_geo in;
-
-	in.lon = lp.lam;
-	in.lat = lp.phi;
-
-	out = isea_forward(&P->dgg, &in);
-	
-	xy.x = out.x;
-	xy.y = out.y;
-
-	return xy;
-}
-FREEUP; if (P) pj_dalloc(P); }
-
-ENTRY0(isea)
-	char *opt;
-
-        P->fwd = s_forward;
-        isea_grid_init(&P->dgg);
-
-        P->dgg.output = ISEA_PLANE;
-/*		P->dgg.radius = P->a; / * otherwise defaults to 1 */
-	/* calling library will scale, I think */
-
-	opt = pj_param(P->ctx,P->params, "sorient").s;
-	if (opt) {
-		if (!strcmp(opt, "isea")) {
-			isea_orient_isea(&P->dgg);
-		} else if (!strcmp(opt, "pole")) {
-			isea_orient_pole(&P->dgg);
-		} else {
-			E_ERROR(-34);
-		}
-	}
-
-	if (pj_param(P->ctx,P->params, "tazi").i) {
-		P->dgg.o_az = pj_param(P->ctx,P->params, "razi").f;
-	}
-
-	if (pj_param(P->ctx,P->params, "tlon_0").i) {
-		P->dgg.o_lon = pj_param(P->ctx,P->params, "rlon_0").f;
-	}
-
-	if (pj_param(P->ctx,P->params, "tlat_0").i) {
-		P->dgg.o_lat = pj_param(P->ctx,P->params, "rlat_0").f;
-	}
-
-	if (pj_param(P->ctx,P->params, "taperture").i) {
-		P->dgg.aperture = pj_param(P->ctx,P->params, "iaperture").i;
-	}
-
-	if (pj_param(P->ctx,P->params, "tresolution").i) {
-		P->dgg.resolution = pj_param(P->ctx,P->params, "iresolution").i;
-	}
-
-	opt = pj_param(P->ctx,P->params, "smode").s;
-	if (opt) {
-		if (!strcmp(opt, "plane")) {
-			P->dgg.output = ISEA_PLANE;
-		} else if (!strcmp(opt, "di")) {
-			P->dgg.output = ISEA_Q2DI;
-		}
-		else if (!strcmp(opt, "dd")) {
-			P->dgg.output = ISEA_Q2DD;
-		}
-		else if (!strcmp(opt, "hex")) {
-			P->dgg.output = ISEA_HEX;
-		}
-		else {
-			/* TODO verify error code.  Possibly eliminate magic */
-			E_ERROR(-34);
-		}
-	}
-
-	if (pj_param(P->ctx,P->params, "trescale").i) {
-		P->dgg.radius = ISEA_SCALE;
-	}
-
-	if (pj_param(P->ctx,P->params, "tresolution").i) {
-		P->dgg.resolution = pj_param(P->ctx,P->params, "iresolution").i;
-	} else {
-		P->dgg.resolution = 4;
-	}
-
-	if (pj_param(P->ctx,P->params, "taperture").i) {
-		P->dgg.aperture = pj_param(P->ctx,P->params, "iaperture").i;
-	} else {
-		P->dgg.aperture = 3;
-	}
-
-ENDENTRY(P)
diff --git a/src/proj/PJ_krovak.c b/src/proj/PJ_krovak.c
deleted file mode 100644
index 9a85262..0000000
--- a/src/proj/PJ_krovak.c
+++ /dev/null
@@ -1,250 +0,0 @@
-/******************************************************************************
- * $Id: PJ_krovak.c 1950 2012-05-10 16:51:51Z caress $
- *
- * Project:  PROJ.4
- * Purpose:  Implementation of the krovak (Krovak) projection.
- *           Definition: http://www.ihsenergy.com/epsg/guid7.html#1.4.3
- * Author:   Thomas Flemming, tf at ttqv.com
- *
- ******************************************************************************
- * Copyright (c) 2001, Thomas Flemming, tf at ttqv.com
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
- * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
- * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *****************************************************************************/
-
-#define PROJ_PARMS__ \
-	double	C_x;
-#define PJ_LIB__
-
-#include <projects.h>
-#include <string.h>
-#include <stdio.h>
-
-PJ_CVSID("$Id: PJ_krovak.c 1950 2012-05-10 16:51:51Z caress $");	
-
-PROJ_HEAD(krovak, "Krovak") "\n\tPCyl., Ellps.";
-
-/**
-   NOTES: According to EPSG the full Krovak projection method should have
-          the following parameters.  Within PROJ.4 the azimuth, and pseudo
-          standard parallel are hardcoded in the algorithm and can't be 
-          altered from outside.  The others all have defaults to match the
-          common usage with Krovak projection.
-
-  lat_0 = latitude of centre of the projection
-         
-  lon_0 = longitude of centre of the projection
-  
-  ** = azimuth (true) of the centre line passing through the centre of the projection
-
-  ** = latitude of pseudo standard parallel
-   
-  k  = scale factor on the pseudo standard parallel
-  
-  x_0 = False Easting of the centre of the projection at the apex of the cone
-  
-  y_0 = False Northing of the centre of the projection at the apex of the cone
-
- **/
-
-
-
-FORWARD(e_forward); /* ellipsoid */
-/* calculate xy from lat/lon */
-
-/* Constants, identical to inverse transform function */
-	double s45, s90, e2, e, alfa, uq, u0, g, k, k1, n0, ro0, ad, a, s0, n;
-	double gfi, u, fi0, deltav, s, d, eps, ro;
-
-
-	s45 = 0.785398163397448;    /* 45� */
-	s90 = 2 * s45;
-	fi0 = P->phi0;    /* Latitude of projection centre 49� 30' */
-
-   /* Ellipsoid is used as Parameter in for.c and inv.c, therefore a must 
-      be set to 1 here.
-      Ellipsoid Bessel 1841 a = 6377397.155m 1/f = 299.1528128,
-      e2=0.006674372230614;
-   */
-	a =  1; /* 6377397.155; */
-	/* e2 = P->es;*/       /* 0.006674372230614; */
-	e2 = 0.006674372230614;
-	e = sqrt(e2);
-
-	alfa = sqrt(1. + (e2 * pow(cos(fi0), 4)) / (1. - e2));
-
-	uq = 1.04216856380474;      /* DU(2, 59, 42, 42.69689) */
-	u0 = asin(sin(fi0) / alfa);
-	g = pow(   (1. + e * sin(fi0)) / (1. - e * sin(fi0)) , alfa * e / 2.  );
-
-	k = tan( u0 / 2. + s45) / pow  (tan(fi0 / 2. + s45) , alfa) * g;
-
-	k1 = P->k0;
-	n0 = a * sqrt(1. - e2) / (1. - e2 * pow(sin(fi0), 2));
-	s0 = 1.37008346281555;       /* Latitude of pseudo standard parallel 78� 30'00" N */
-	n = sin(s0);
-	ro0 = k1 * n0 / tan(s0);
-	ad = s90 - uq;
-
-/* Transformation */
-
-	gfi =pow ( ((1. + e * sin(lp.phi)) /
-               (1. - e * sin(lp.phi))) , (alfa * e / 2.));
-
-	u= 2. * (atan(k * pow( tan(lp.phi / 2. + s45), alfa) / gfi)-s45);
-
-	deltav = - lp.lam * alfa;
-
-	s = asin(cos(ad) * sin(u) + sin(ad) * cos(u) * cos(deltav));
-	d = asin(cos(u) * sin(deltav) / cos(s));
-	eps = n * d;
-	ro = ro0 * pow(tan(s0 / 2. + s45) , n) / pow(tan(s / 2. + s45) , n)   ;
-
-   /* x and y are reverted! */
-	xy.y = ro * cos(eps) / a;
-	xy.x = ro * sin(eps) / a;
-
-        if( !pj_param(P->ctx, P->params, "tczech").i )
-	  {
-	    xy.y *= -1.0;
-	    xy.x *= -1.0;
-	  }
-
-	return (xy);
-}
-
-
-
-INVERSE(e_inverse); /* ellipsoid */
-	/* calculate lat/lon from xy */
-
-/* Constants, identisch wie in der Umkehrfunktion */
-	double s45, s90, fi0, e2, e, alfa, uq, u0, g, k, k1, n0, ro0, ad, a, s0, n;
-	double u, deltav, s, d, eps, ro, fi1, xy0;
-	int ok;
-
-	s45 = 0.785398163397448;    /* 45� */
-	s90 = 2 * s45;
-	fi0 = P->phi0;    /* Latitude of projection centre 49� 30' */
-
-
-   /* Ellipsoid is used as Parameter in for.c and inv.c, therefore a must 
-      be set to 1 here.
-      Ellipsoid Bessel 1841 a = 6377397.155m 1/f = 299.1528128,
-      e2=0.006674372230614;
-   */
-	a = 1; /* 6377397.155; */
-	/* e2 = P->es; */      /* 0.006674372230614; */
-	e2 = 0.006674372230614;
-	e = sqrt(e2);
-
-	alfa = sqrt(1. + (e2 * pow(cos(fi0), 4)) / (1. - e2));
-	uq = 1.04216856380474;      /* DU(2, 59, 42, 42.69689) */
-	u0 = asin(sin(fi0) / alfa);
-	g = pow(   (1. + e * sin(fi0)) / (1. - e * sin(fi0)) , alfa * e / 2.  );
-
-	k = tan( u0 / 2. + s45) / pow  (tan(fi0 / 2. + s45) , alfa) * g;
-
-	k1 = P->k0;
-	n0 = a * sqrt(1. - e2) / (1. - e2 * pow(sin(fi0), 2));
-	s0 = 1.37008346281555;       /* Latitude of pseudo standard parallel 78� 30'00" N */
-	n = sin(s0);
-	ro0 = k1 * n0 / tan(s0);
-	ad = s90 - uq;
-
-
-/* Transformation */
-   /* revert y, x*/
-	xy0=xy.x;
-	xy.x=xy.y;
-	xy.y=xy0;
-
-        if( !pj_param(P->ctx, P->params, "tczech").i )
-	  {
-	    xy.x *= -1.0;
-	    xy.y *= -1.0;
-	  }
-
-	ro = sqrt(xy.x * xy.x + xy.y * xy.y);
-	eps = atan2(xy.y, xy.x);
-	d = eps / sin(s0);
-	s = 2. * (atan(  pow(ro0 / ro, 1. / n) * tan(s0 / 2. + s45)) - s45);
-
-	u = asin(cos(ad) * sin(s) - sin(ad) * cos(s) * cos(d));
-	deltav = asin(cos(s) * sin(d) / cos(u));
-
-	lp.lam = P->lam0 - deltav / alfa;
-
-/* ITERATION FOR lp.phi */
-   fi1 = u;
-
-   ok = 0;
-   do
-   {
-   	lp.phi = 2. * ( atan( pow( k, -1. / alfa)  *
-                            pow( tan(u / 2. + s45) , 1. / alfa)  *
-                            pow( (1. + e * sin(fi1)) / (1. - e * sin(fi1)) , e / 2.)
-                           )  - s45);
-
-      if (fabs(fi1 - lp.phi) < 0.000000000000001) ok=1;
-      fi1 = lp.phi;
-
-   }
-   while (ok==0);
-
-   lp.lam -= P->lam0;
-
-   return (lp);
-}
-
-FREEUP; if (P) pj_dalloc(P); }
-
-ENTRY0(krovak)
-	double ts;
-	/* read some Parameters,
-	 * here Latitude Truescale */
-
-	ts = pj_param(P->ctx, P->params, "rlat_ts").f;
-	P->C_x = ts;
-	
-	/* we want Bessel as fixed ellipsoid */
-	P->a = 6377397.155;
-	P->e = sqrt(P->es = 0.006674372230614);
-
-        /* if latitude of projection center is not set, use 49d30'N */
-	if (!pj_param(P->ctx, P->params, "tlat_0").i)
-            P->phi0 = 0.863937979737193; 
-
-        /* if center long is not set use 42d30'E of Ferro - 17d40' for Ferro */
-        /* that will correspond to using longitudes relative to greenwich    */
-        /* as input and output, instead of lat/long relative to Ferro */
-	if (!pj_param(P->ctx, P->params, "tlon_0").i)
-            P->lam0 = 0.7417649320975901 - 0.308341501185665;
-
-        /* if scale not set default to 0.9999 */
-	if (!pj_param(P->ctx, P->params, "tk").i)
-            P->k0 = 0.9999;
-
-	/* always the same */
-        P->inv = e_inverse; 
-	P->fwd = e_forward;
-
-ENDENTRY(P)
-
diff --git a/src/proj/PJ_labrd.c b/src/proj/PJ_labrd.c
deleted file mode 100644
index 4cb39ec..0000000
--- a/src/proj/PJ_labrd.c
+++ /dev/null
@@ -1,109 +0,0 @@
-#define PROJ_PARMS__ \
-	double	Az, kRg, p0s, A, C, Ca, Cb, Cc, Cd; \
-	int		rot;
-#define PJ_LIB__
-#include	<projects.h>
-PROJ_HEAD(labrd, "Laborde") "\n\tCyl, Sph\n\tSpecial for Madagascar";
-#define EPS	1.e-10
-FORWARD(e_forward);
-	double V1, V2, ps, sinps, cosps, sinps2, cosps2, I1, I2, I3, I4, I5, I6,
-		x2, y2, t;
-
-	V1 = P->A * log( tan(FORTPI + .5 * lp.phi) );
-	t = P->e * sin(lp.phi);
-	V2 = .5 * P->e * P->A * log ((1. + t)/(1. - t));
-	ps = 2. * (atan(exp(V1 - V2 + P->C)) - FORTPI);
-	I1 = ps - P->p0s;
-	cosps = cos(ps);	cosps2 = cosps * cosps;
-	sinps = sin(ps);	sinps2 = sinps * sinps;
-	I4 = P->A * cosps;
-	I2 = .5 * P->A * I4 * sinps;
-	I3 = I2 * P->A * P->A * (5. * cosps2 - sinps2) / 12.;
-	I6 = I4 * P->A * P->A;
-	I5 = I6 * (cosps2 - sinps2) / 6.;
-	I6 *= P->A * P->A *
-		(5. * cosps2 * cosps2 + sinps2 * (sinps2 - 18. * cosps2)) / 120.;
-	t = lp.lam * lp.lam;
-	xy.x = P->kRg * lp.lam * (I4 + t * (I5 + t * I6));
-	xy.y = P->kRg * (I1 + t * (I2 + t * I3));
-	x2 = xy.x * xy.x;
-	y2 = xy.y * xy.y;
-	V1 = 3. * xy.x * y2 - xy.x * x2;
-	V2 = xy.y * y2 - 3. * x2 * xy.y;
-	xy.x += P->Ca * V1 + P->Cb * V2;
-	xy.y += P->Ca * V2 - P->Cb * V1;
-	return (xy);
-}
-INVERSE(e_inverse); /* ellipsoid & spheroid */
-	double x2, y2, V1, V2, V3, V4, t, t2, ps, pe, tpe, s,
-		I7, I8, I9, I10, I11, d, Re;
-	int i;
-
-	x2 = xy.x * xy.x;
-	y2 = xy.y * xy.y;
-	V1 = 3. * xy.x * y2 - xy.x * x2;
-	V2 = xy.y * y2 - 3. * x2 * xy.y;
-	V3 = xy.x * (5. * y2 * y2 + x2 * (-10. * y2 + x2 ));
-	V4 = xy.y * (5. * x2 * x2 + y2 * (-10. * x2 + y2 ));
-	xy.x += - P->Ca * V1 - P->Cb * V2 + P->Cc * V3 + P->Cd * V4;
-	xy.y +=   P->Cb * V1 - P->Ca * V2 - P->Cd * V3 + P->Cc * V4;
-	ps = P->p0s + xy.y / P->kRg;
-	pe = ps + P->phi0 - P->p0s;
-	for ( i = 20; i; --i) {
-		V1 = P->A * log(tan(FORTPI + .5 * pe));
-		tpe = P->e * sin(pe);
-		V2 = .5 * P->e * P->A * log((1. + tpe)/(1. - tpe));
-		t = ps - 2. * (atan(exp(V1 - V2 + P->C)) - FORTPI);
-		pe += t;
-		if (fabs(t) < EPS)
-			break;
-	}
-/*
-	if (!i) {
-	} else {
-	}
-*/
-	t = P->e * sin(pe);
-	t = 1. - t * t;
-	Re = P->one_es / ( t * sqrt(t) );
-	t = tan(ps);
-	t2 = t * t;
-	s = P->kRg * P->kRg;
-	d = Re * P->k0 * P->kRg;
-	I7 = t / (2. * d);
-	I8 = t * (5. + 3. * t2) / (24. * d * s);
-	d = cos(ps) * P->kRg * P->A;
-	I9 = 1. / d;
-	d *= s;
-	I10 = (1. + 2. * t2) / (6. * d);
-	I11 = (5. + t2 * (28. + 24. * t2)) / (120. * d * s);
-	x2 = xy.x * xy.x;
-	lp.phi = pe + x2 * (-I7 + I8 * x2);
-	lp.lam = xy.x * (I9 + x2 * (-I10 + x2 * I11));
-	return (lp);
-}
-FREEUP; if (P) pj_dalloc(P); }
-ENTRY0(labrd)
-	double Az, sinp, R, N, t;
-
-	P->rot	= pj_param(P->ctx, P->params, "bno_rot").i == 0;
-	Az = pj_param(P->ctx, P->params, "razi").f;
-	sinp = sin(P->phi0);
-	t = 1. - P->es * sinp * sinp;
-	N = 1. / sqrt(t);
-	R = P->one_es * N / t;
-	P->kRg = P->k0 * sqrt( N * R );
-	P->p0s = atan( sqrt(R / N) * tan(P->phi0) );
-	P->A = sinp / sin(P->p0s);
-	t = P->e * sinp;
-	P->C = .5 * P->e * P->A * log((1. + t)/(1. - t)) +
-		- P->A * log( tan(FORTPI + .5 * P->phi0))
-		+ log( tan(FORTPI + .5 * P->p0s));
-	t = Az + Az;
-	P->Ca = (1. - cos(t)) * ( P->Cb = 1. / (12. * P->kRg * P->kRg) );
-	P->Cb *= sin(t);
-	P->Cc = 3. * (P->Ca * P->Ca - P->Cb * P->Cb);
-	P->Cd = 6. * P->Ca * P->Cb;
-	P->inv = e_inverse;
-	P->fwd = e_forward;
-ENDENTRY(P)
diff --git a/src/proj/PJ_laea.c b/src/proj/PJ_laea.c
deleted file mode 100644
index d32bb0b..0000000
--- a/src/proj/PJ_laea.c
+++ /dev/null
@@ -1,233 +0,0 @@
-#define PROJ_PARMS__ \
-	double	sinb1; \
-	double	cosb1; \
-	double	xmf; \
-	double	ymf; \
-	double	mmf; \
-	double	qp; \
-	double	dd; \
-	double	rq; \
-	double	*apa; \
-	int		mode;
-#define PJ_LIB__
-#include	<projects.h>
-PROJ_HEAD(laea, "Lambert Azimuthal Equal Area") "\n\tAzi, Sph&Ell";
-#define sinph0	P->sinb1
-#define cosph0	P->cosb1
-#define EPS10	1.e-10
-#define NITER	20
-#define CONV	1.e-10
-#define N_POLE	0
-#define S_POLE	1
-#define EQUIT	2
-#define OBLIQ	3
-FORWARD(e_forward); /* ellipsoid */
-	double coslam, sinlam, sinphi, q, sinb=0.0, cosb=0.0, b=0.0;
-
-	coslam = cos(lp.lam);
-	sinlam = sin(lp.lam);
-	sinphi = sin(lp.phi);
-	q = pj_qsfn(sinphi, P->e, P->one_es);
-	if (P->mode == OBLIQ || P->mode == EQUIT) {
-		sinb = q / P->qp;
-		cosb = sqrt(1. - sinb * sinb);
-	}
-	switch (P->mode) {
-	case OBLIQ:
-		b = 1. + P->sinb1 * sinb + P->cosb1 * cosb * coslam;
-		break;
-	case EQUIT:
-		b = 1. + cosb * coslam;
-		break;
-	case N_POLE:
-		b = HALFPI + lp.phi;
-		q = P->qp - q;
-		break;
-	case S_POLE:
-		b = lp.phi - HALFPI;
-		q = P->qp + q;
-		break;
-	}
-	if (fabs(b) < EPS10) F_ERROR;
-	switch (P->mode) {
-	case OBLIQ:
-		xy.y = P->ymf * ( b = sqrt(2. / b) )
-		   * (P->cosb1 * sinb - P->sinb1 * cosb * coslam);
-		goto eqcon;
-		break;
-	case EQUIT:
-		xy.y = (b = sqrt(2. / (1. + cosb * coslam))) * sinb * P->ymf; 
-eqcon:
-		xy.x = P->xmf * b * cosb * sinlam;
-		break;
-	case N_POLE:
-	case S_POLE:
-		if (q >= 0.) {
-			xy.x = (b = sqrt(q)) * sinlam;
-			xy.y = coslam * (P->mode == S_POLE ? b : -b);
-		} else
-			xy.x = xy.y = 0.;
-		break;
-	}
-	return (xy);
-}
-FORWARD(s_forward); /* spheroid */
-	double  coslam, cosphi, sinphi;
-
-	sinphi = sin(lp.phi);
-	cosphi = cos(lp.phi);
-	coslam = cos(lp.lam);
-	switch (P->mode) {
-	case EQUIT:
-		xy.y = 1. + cosphi * coslam;
-		goto oblcon;
-	case OBLIQ:
-		xy.y = 1. + sinph0 * sinphi + cosph0 * cosphi * coslam;
-oblcon:
-		if (xy.y <= EPS10) F_ERROR;
-		xy.x = (xy.y = sqrt(2. / xy.y)) * cosphi * sin(lp.lam);
-		xy.y *= P->mode == EQUIT ? sinphi :
-		   cosph0 * sinphi - sinph0 * cosphi * coslam;
-		break;
-	case N_POLE:
-		coslam = -coslam;
-	case S_POLE:
-		if (fabs(lp.phi + P->phi0) < EPS10) F_ERROR;
-		xy.y = FORTPI - lp.phi * .5;
-		xy.y = 2. * (P->mode == S_POLE ? cos(xy.y) : sin(xy.y));
-		xy.x = xy.y * sin(lp.lam);
-		xy.y *= coslam;
-		break;
-	}
-	return (xy);
-}
-INVERSE(e_inverse); /* ellipsoid */
-	double cCe, sCe, q, rho, ab=0.0;
-
-	switch (P->mode) {
-	case EQUIT:
-	case OBLIQ:
-		if ((rho = hypot(xy.x /= P->dd, xy.y *=  P->dd)) < EPS10) {
-			lp.lam = 0.;
-			lp.phi = P->phi0;
-			return (lp);
-		}
-		cCe = cos(sCe = 2. * asin(.5 * rho / P->rq));
-		xy.x *= (sCe = sin(sCe));
-		if (P->mode == OBLIQ) {
-			q = P->qp * (ab = cCe * P->sinb1 + xy.y * sCe * P->cosb1 / rho);
-			xy.y = rho * P->cosb1 * cCe - xy.y * P->sinb1 * sCe;
-		} else {
-			q = P->qp * (ab = xy.y * sCe / rho);
-			xy.y = rho * cCe;
-		}
-		break;
-	case N_POLE:
-		xy.y = -xy.y;
-	case S_POLE:
-		if (!(q = (xy.x * xy.x + xy.y * xy.y)) ) {
-			lp.lam = 0.;
-			lp.phi = P->phi0;
-			return (lp);
-		}
-		/*
-		q = P->qp - q;
-		*/
-		ab = 1. - q / P->qp;
-		if (P->mode == S_POLE)
-			ab = - ab;
-		break;
-	}
-	lp.lam = atan2(xy.x, xy.y);
-	lp.phi = pj_authlat(asin(ab), P->apa);
-	return (lp);
-}
-INVERSE(s_inverse); /* spheroid */
-	double  cosz=0.0, rh, sinz=0.0;
-
-	rh = hypot(xy.x, xy.y);
-	if ((lp.phi = rh * .5 ) > 1.) I_ERROR;
-	lp.phi = 2. * asin(lp.phi);
-	if (P->mode == OBLIQ || P->mode == EQUIT) {
-		sinz = sin(lp.phi);
-		cosz = cos(lp.phi);
-	}
-	switch (P->mode) {
-	case EQUIT:
-		lp.phi = fabs(rh) <= EPS10 ? 0. : asin(xy.y * sinz / rh);
-		xy.x *= sinz;
-		xy.y = cosz * rh;
-		break;
-	case OBLIQ:
-		lp.phi = fabs(rh) <= EPS10 ? P->phi0 :
-		   asin(cosz * sinph0 + xy.y * sinz * cosph0 / rh);
-		xy.x *= sinz * cosph0;
-		xy.y = (cosz - sin(lp.phi) * sinph0) * rh;
-		break;
-	case N_POLE:
-		xy.y = -xy.y;
-		lp.phi = HALFPI - lp.phi;
-		break;
-	case S_POLE:
-		lp.phi -= HALFPI;
-		break;
-	}
-	lp.lam = (xy.y == 0. && (P->mode == EQUIT || P->mode == OBLIQ)) ?
-		0. : atan2(xy.x, xy.y);
-	return (lp);
-}
-FREEUP;
-    if (P) {
-		if (P->apa)
-			pj_dalloc(P->apa);
-		pj_dalloc(P);
-	}
-}
-ENTRY1(laea,apa)
-	double t;
-
-	if (fabs((t = fabs(P->phi0)) - HALFPI) < EPS10)
-		P->mode = P->phi0 < 0. ? S_POLE : N_POLE;
-	else if (fabs(t) < EPS10)
-		P->mode = EQUIT;
-	else
-		P->mode = OBLIQ;
-	if (P->es) {
-		double sinphi;
-
-		P->e = sqrt(P->es);
-		P->qp = pj_qsfn(1., P->e, P->one_es);
-		P->mmf = .5 / (1. - P->es);
-		P->apa = pj_authset(P->es);
-		switch (P->mode) {
-		case N_POLE:
-		case S_POLE:
-			P->dd = 1.;
-			break;
-		case EQUIT:
-			P->dd = 1. / (P->rq = sqrt(.5 * P->qp));
-			P->xmf = 1.;
-			P->ymf = .5 * P->qp;
-			break;
-		case OBLIQ:
-			P->rq = sqrt(.5 * P->qp);
-			sinphi = sin(P->phi0);
-			P->sinb1 = pj_qsfn(sinphi, P->e, P->one_es) / P->qp;
-			P->cosb1 = sqrt(1. - P->sinb1 * P->sinb1);
-			P->dd = cos(P->phi0) / (sqrt(1. - P->es * sinphi * sinphi) *
-			   P->rq * P->cosb1);
-			P->ymf = (P->xmf = P->rq) / P->dd;
-			P->xmf *= P->dd;
-			break;
-		}
-		P->inv = e_inverse;
-		P->fwd = e_forward;
-	} else {
-		if (P->mode == OBLIQ) {
-			sinph0 = sin(P->phi0);
-			cosph0 = cos(P->phi0);
-		}
-		P->inv = s_inverse;
-		P->fwd = s_forward;
-	}
-ENDENTRY(P)
diff --git a/src/proj/PJ_lagrng.c b/src/proj/PJ_lagrng.c
deleted file mode 100644
index 8a13b3d..0000000
--- a/src/proj/PJ_lagrng.c
+++ /dev/null
@@ -1,35 +0,0 @@
-#define PROJ_PARMS__ \
-	double	hrw; \
-	double	rw; \
-	double	a1;
-#define TOL	1e-10
-#define PJ_LIB__
-#include	<projects.h>
-PROJ_HEAD(lagrng, "Lagrange") "\n\tMisc Sph, no inv.\n\tW=";
-FORWARD(s_forward); /* spheroid */
-	double v, c;
-
-	if (fabs(fabs(lp.phi) - HALFPI) < TOL) {
-		xy.x = 0;
-		xy.y = lp.phi < 0 ? -2. : 2.;
-	} else {
-		lp.phi = sin(lp.phi);
-		v = P->a1 * pow((1. + lp.phi)/(1. - lp.phi), P->hrw);
-		if ((c = 0.5 * (v + 1./v) + cos(lp.lam *= P->rw)) < TOL)
-			F_ERROR;
-		xy.x = 2. * sin(lp.lam) / c;
-		xy.y = (v - 1./v) / c;
-	}
-	return (xy);
-}
-FREEUP; if (P) pj_dalloc(P); }
-ENTRY0(lagrng)
-	double phi1;
-
-	if ((P->rw = pj_param(P->ctx, P->params, "dW").f) <= 0) E_ERROR(-27);
-	P->hrw = 0.5 * (P->rw = 1. / P->rw);
-	phi1 = pj_param(P->ctx, P->params, "rlat_1").f;
-	if (fabs(fabs(phi1 = sin(phi1)) - 1.) < TOL) E_ERROR(-22);
-	P->a1 = pow((1. - phi1)/(1. + phi1), P->hrw);
-	P->es = 0.; P->fwd = s_forward;
-ENDENTRY(P)
diff --git a/src/proj/PJ_larr.c b/src/proj/PJ_larr.c
deleted file mode 100644
index 5bab2b0..0000000
--- a/src/proj/PJ_larr.c
+++ /dev/null
@@ -1,12 +0,0 @@
-#define PROJ_PARMS__
-#define PJ_LIB__
-#include	<projects.h>
-PROJ_HEAD(larr, "Larrivee") "\n\tMisc Sph, no inv.";
-#define SIXTH .16666666666666666
-FORWARD(s_forward); /* sphere */
-	xy.x = 0.5 * lp.lam * (1. + sqrt(cos(lp.phi)));
-	xy.y = lp.phi / (cos(0.5 * lp.phi) * cos(SIXTH * lp.lam));
-	return (xy);
-}
-FREEUP; if (P) pj_dalloc(P); }
-ENTRY0(larr) P->fwd = s_forward; P->inv = 0; P->es = 0.; ENDENTRY(P)
diff --git a/src/proj/PJ_lask.c b/src/proj/PJ_lask.c
deleted file mode 100644
index 05e80a1..0000000
--- a/src/proj/PJ_lask.c
+++ /dev/null
@@ -1,26 +0,0 @@
-#define PROJ_PARMS__
-#define PJ_LIB__
-#include	<projects.h>
-PROJ_HEAD(lask, "Laskowski") "\n\tMisc Sph, no inv.";
-#define	a10	 0.975534
-#define	a12	-0.119161
-#define	a32	-0.0143059
-#define	a14	-0.0547009
-#define	b01	 1.00384
-#define	b21	 0.0802894
-#define	b03	 0.0998909
-#define	b41	 0.000199025
-#define	b23	-0.0285500
-#define	b05	-0.0491032
-FORWARD(s_forward); /* sphere */
-	double l2, p2;
-
-	l2 = lp.lam * lp.lam;
-	p2 = lp.phi * lp.phi;
-	xy.x = lp.lam * (a10 + p2 * (a12 + l2 * a32 + p2 * a14));
-	xy.y = lp.phi * (b01 + l2 * (b21 + p2 * b23 + l2 * b41) +
-		p2 * (b03 + p2 * b05));
-	return (xy);
-}
-FREEUP; if (P) pj_dalloc(P); }
-ENTRY0(lask) P->fwd = s_forward; P->inv = 0; P->es = 0.; ENDENTRY(P)
diff --git a/src/proj/PJ_lcc.c b/src/proj/PJ_lcc.c
deleted file mode 100644
index 9d3494b..0000000
--- a/src/proj/PJ_lcc.c
+++ /dev/null
@@ -1,105 +0,0 @@
-#define PROJ_PARMS__ \
-	double	phi1; \
-	double	phi2; \
-	double	n; \
-	double	rho0; \
-	double	c; \
-	int		ellips;
-#define PJ_LIB__
-#include	<projects.h>
-PROJ_HEAD(lcc, "Lambert Conformal Conic")
-	"\n\tConic, Sph&Ell\n\tlat_1= and lat_2= or lat_0";
-# define EPS10	1.e-10
-FORWARD(e_forward); /* ellipsoid & spheroid */
-        double rho;
-	if (fabs(fabs(lp.phi) - HALFPI) < EPS10) {
-		if ((lp.phi * P->n) <= 0.) F_ERROR;
-		rho = 0.;
-		}
-	else
-		rho = P->c * (P->ellips ? pow(pj_tsfn(lp.phi, sin(lp.phi),
-			P->e), P->n) : pow(tan(FORTPI + .5 * lp.phi), -P->n));
-	xy.x = P->k0 * (rho * sin( lp.lam *= P->n ) );
-	xy.y = P->k0 * (P->rho0 - rho * cos(lp.lam) );
-	return (xy);
-}
-INVERSE(e_inverse); /* ellipsoid & spheroid */
-        double rho;
-	xy.x /= P->k0;
-	xy.y /= P->k0;
-	if( (rho = hypot(xy.x, xy.y = P->rho0 - xy.y)) != 0.0) {
-		if (P->n < 0.) {
-			rho = -rho;
-			xy.x = -xy.x;
-			xy.y = -xy.y;
-		}
-		if (P->ellips) {
-			if ((lp.phi = pj_phi2(P->ctx, pow(rho / P->c, 1./P->n), P->e))
-				== HUGE_VAL)
-				I_ERROR;
-		} else
-			lp.phi = 2. * atan(pow(P->c / rho, 1./P->n)) - HALFPI;
-		lp.lam = atan2(xy.x, xy.y) / P->n;
-	} else {
-		lp.lam = 0.;
-		lp.phi = P->n > 0. ? HALFPI : - HALFPI;
-	}
-	return (lp);
-}
-SPECIAL(fac) {
-        double rho;
-	if (fabs(fabs(lp.phi) - HALFPI) < EPS10) {
-		if ((lp.phi * P->n) <= 0.) return;
-		rho = 0.;
-	} else
-		rho = P->c * (P->ellips ? pow(pj_tsfn(lp.phi, sin(lp.phi),
-			P->e), P->n) : pow(tan(FORTPI + .5 * lp.phi), -P->n));
-	fac->code |= IS_ANAL_HK + IS_ANAL_CONV;
-	fac->k = fac->h = P->k0 * P->n * rho /
-		pj_msfn(sin(lp.phi), cos(lp.phi), P->es);
-	fac->conv = - P->n * lp.lam;
-}
-FREEUP; if (P) pj_dalloc(P); }
-ENTRY0(lcc)
-	double cosphi, sinphi;
-	int secant;
-
-	P->phi1 = pj_param(P->ctx, P->params, "rlat_1").f;
-	if (pj_param(P->ctx, P->params, "tlat_2").i)
-		P->phi2 = pj_param(P->ctx, P->params, "rlat_2").f;
-	else {
-		P->phi2 = P->phi1;
-		if (!pj_param(P->ctx, P->params, "tlat_0").i)
-			P->phi0 = P->phi1;
-	}
-	if (fabs(P->phi1 + P->phi2) < EPS10) E_ERROR(-21);
-	P->n = sinphi = sin(P->phi1);
-	cosphi = cos(P->phi1);
-	secant = fabs(P->phi1 - P->phi2) >= EPS10;
-	if( (P->ellips = (P->es != 0.)) ) {
-		double ml1, m1;
-
-		P->e = sqrt(P->es);
-		m1 = pj_msfn(sinphi, cosphi, P->es);
-		ml1 = pj_tsfn(P->phi1, sinphi, P->e);
-		if (secant) { /* secant cone */
-			P->n = log(m1 /
-			   pj_msfn(sinphi = sin(P->phi2), cos(P->phi2), P->es));
-			P->n /= log(ml1 / pj_tsfn(P->phi2, sinphi, P->e));
-		}
-		P->c = (P->rho0 = m1 * pow(ml1, -P->n) / P->n);
-		P->rho0 *= (fabs(fabs(P->phi0) - HALFPI) < EPS10) ? 0. :
-			pow(pj_tsfn(P->phi0, sin(P->phi0), P->e), P->n);
-	} else {
-		if (secant)
-			P->n = log(cosphi / cos(P->phi2)) /
-			   log(tan(FORTPI + .5 * P->phi2) /
-			   tan(FORTPI + .5 * P->phi1));
-		P->c = cosphi * pow(tan(FORTPI + .5 * P->phi1), P->n) / P->n;
-		P->rho0 = (fabs(fabs(P->phi0) - HALFPI) < EPS10) ? 0. :
-			P->c * pow(tan(FORTPI + .5 * P->phi0), -P->n);
-	}
-	P->inv = e_inverse;
-	P->fwd = e_forward;
-	P->spc = fac;
-ENDENTRY(P)
diff --git a/src/proj/PJ_lcca.c b/src/proj/PJ_lcca.c
deleted file mode 100644
index 98749ad..0000000
--- a/src/proj/PJ_lcca.c
+++ /dev/null
@@ -1,72 +0,0 @@
-static const char RCS_ID[] = "$Id: PJ_lcca.c 1950 2012-05-10 16:51:51Z caress $";
-/* PROJ.4 Cartographic Projection System 
-*/
-#define MAX_ITER 10
-#define DEL_TOL 1e-12
-#define PROJ_PARMS__ \
-	double	*en; \
-	double	r0, l, M0; \
-	double	C;
-#define PJ_LIB__
-#include	<projects.h>
-
-PROJ_HEAD(lcca, "Lambert Conformal Conic Alternative")
-	"\n\tConic, Sph&Ell\n\tlat_0=";
-
-	static double /* func to compute dr */
-fS(double S, double C) {
-		return(S * ( 1. + S * S * C));
-}
-	static double /* deriv of fs */
-fSp(double S, double C) {
-	return(1. + 3.* S * S * C);
-}
-FORWARD(e_forward); /* ellipsoid */
-	double S, r, dr;
-	
-	S = pj_mlfn(lp.phi, sin(lp.phi), cos(lp.phi), P->en) - P->M0;
-	dr = fS(S, P->C);
-	r = P->r0 - dr;
-	xy.x = P->k0 * (r * sin( lp.lam *= P->l ) );
-	xy.y = P->k0 * (P->r0 - r * cos(lp.lam) );
-	return (xy);
-}
-INVERSE(e_inverse); /* ellipsoid & spheroid */
-	double theta, dr, S, dif;
-	int i;
-
-	xy.x /= P->k0;
-	xy.y /= P->k0;
-	theta = atan2(xy.x , P->r0 - xy.y);
-	dr = xy.y - xy.x * tan(0.5 * theta);
-	lp.lam = theta / P->l;
-	S = dr;
-	for (i = MAX_ITER; i ; --i) {
-		S -= (dif = (fS(S, P->C) - dr) / fSp(S, P->C));
-		if (fabs(dif) < DEL_TOL) break;
-	}
-	if (!i) I_ERROR
-	lp.phi = pj_inv_mlfn(P->ctx, S + P->M0, P->es, P->en);
-	return (lp);
-}
-FREEUP; if (P) { if (P->en) pj_dalloc(P->en); pj_dalloc(P); } }
-ENTRY0(lcca)
-	double s2p0, N0, R0, tan0, tan20;
-
-	if (!(P->en = pj_enfn(P->es))) E_ERROR_0;
-	if (!pj_param(P->ctx, P->params, "tlat_0").i) E_ERROR(50);
-	if (P->phi0 == 0.) E_ERROR(51);
-	P->l = sin(P->phi0);
-	P->M0 = pj_mlfn(P->phi0, P->l, cos(P->phi0), P->en);
-	s2p0 = P->l * P->l;
-	R0 = 1. / (1. - P->es * s2p0);
-	N0 = sqrt(R0);
-	R0 *= P->one_es * N0;
-	tan0 = tan(P->phi0);
-	tan20 = tan0 * tan0;
-	P->r0 = N0 / tan0;
-	P->C = 1. / (6. * R0 * N0);
-	P->inv = e_inverse;
-	P->fwd = e_forward;
-ENDENTRY(P)
-
diff --git a/src/proj/PJ_loxim.c b/src/proj/PJ_loxim.c
deleted file mode 100644
index 595423f..0000000
--- a/src/proj/PJ_loxim.c
+++ /dev/null
@@ -1,41 +0,0 @@
-#define PROJ_PARMS__ \
-	double phi1; \
-	double cosphi1; \
-	double tanphi1;
-#define PJ_LIB__
-#include	<projects.h>
-PROJ_HEAD(loxim, "Loximuthal") "\n\tPCyl Sph";
-#define EPS	1e-8
-FORWARD(s_forward); /* spheroid */
-	xy.y = lp.phi - P->phi1;
-	if (fabs(xy.y) < EPS)
-		xy.x = lp.lam * P->cosphi1;
-	else {
-		xy.x = FORTPI + 0.5 * lp.phi;
-		if (fabs(xy.x) < EPS || fabs(fabs(xy.x) - HALFPI) < EPS)
-			xy.x = 0.;
-		else
-			xy.x = lp.lam * xy.y / log( tan(xy.x) / P->tanphi1 );
-	}
-	return (xy);
-}
-INVERSE(s_inverse); /* spheroid */
-	lp.phi = xy.y + P->phi1;
-	if (fabs(xy.y) < EPS)
-		lp.lam = xy.x / P->cosphi1;
-	else
-		if (fabs( lp.lam = FORTPI + 0.5 * lp.phi ) < EPS ||
-			fabs(fabs(lp.lam) - HALFPI) < EPS)
-			lp.lam = 0.;
-		else
-			lp.lam = xy.x * log( tan(lp.lam) / P->tanphi1 ) / xy.y ;
-	return (lp);
-}
-FREEUP; if (P) pj_dalloc(P); }
-ENTRY0(loxim);
-	P->phi1 = pj_param(P->ctx, P->params, "rlat_1").f;
-	if ((P->cosphi1 = cos(P->phi1)) < EPS) E_ERROR(-22);
-	P->tanphi1 = tan(FORTPI + 0.5 * P->phi1);
-	P->inv = s_inverse; P->fwd = s_forward;
-	P->es = 0.;
-ENDENTRY(P)
diff --git a/src/proj/PJ_lsat.c b/src/proj/PJ_lsat.c
deleted file mode 100644
index d11a5c1..0000000
--- a/src/proj/PJ_lsat.c
+++ /dev/null
@@ -1,171 +0,0 @@
-/* based upon Snyder and Linck, USGS-NMD */
-#define PROJ_PARMS__ \
-    double a2, a4, b, c1, c3; \
-    double q, t, u, w, p22, sa, ca, xj, rlm, rlm2;
-#define PJ_LIB__
-#include	<projects.h>
-PROJ_HEAD(lsat, "Space oblique for LANDSAT")
-	"\n\tCyl, Sph&Ell\n\tlsat= path=";
-#define TOL 1e-7
-#define PI_HALFPI 4.71238898038468985766
-#define TWOPI_HALFPI 7.85398163397448309610
-	static void
-seraz0(double lam, double mult, PJ *P) {
-    double sdsq, h, s, fc, sd, sq, d__1;
-
-    lam *= DEG_TO_RAD;
-    sd = sin(lam);
-    sdsq = sd * sd;
-    s = P->p22 * P->sa * cos(lam) * sqrt((1. + P->t * sdsq) / ((
-	    1. + P->w * sdsq) * (1. + P->q * sdsq)));
-    d__1 = 1. + P->q * sdsq;
-    h = sqrt((1. + P->q * sdsq) / (1. + P->w * sdsq)) * ((1. + 
-	    P->w * sdsq) / (d__1 * d__1) - P->p22 * P->ca);
-    sq = sqrt(P->xj * P->xj + s * s);
-    P->b += fc = mult * (h * P->xj - s * s) / sq;
-    P->a2 += fc * cos(lam + lam);
-    P->a4 += fc * cos(lam * 4.);
-    fc = mult * s * (h + P->xj) / sq;
-    P->c1 += fc * cos(lam);
-    P->c3 += fc * cos(lam * 3.);
-}
-FORWARD(e_forward); /* ellipsoid */
-    int l, nn;
-    double lamt, xlam, sdsq, c, d, s, lamdp, phidp, lampp, tanph,
-		lamtp, cl, sd, sp, fac, sav, tanphi;
-
-	if (lp.phi > HALFPI)
-	    lp.phi = HALFPI;
-	else if (lp.phi < -HALFPI)
-	    lp.phi = -HALFPI;
-	lampp = lp.phi >= 0. ? HALFPI : PI_HALFPI;
-	tanphi = tan(lp.phi);
-	for (nn = 0;;) {
-		sav = lampp;
-		lamtp = lp.lam + P->p22 * lampp;
-		cl = cos(lamtp);
-		if (fabs(cl) < TOL)
-		    lamtp -= TOL;
-		fac = lampp - sin(lampp) * (cl < 0. ? -HALFPI : HALFPI);
-		for (l = 50; l; --l) {
-			lamt = lp.lam + P->p22 * sav;
-			if (fabs(c = cos(lamt)) < TOL)
-			    lamt -= TOL;
-			xlam = (P->one_es * tanphi * P->sa + sin(lamt) * P->ca) / c;
-			lamdp = atan(xlam) + fac;
-			if (fabs(fabs(sav) - fabs(lamdp)) < TOL)
-			    break;
-			sav = lamdp;
-		}
-		if (!l || ++nn >= 3 || (lamdp > P->rlm && lamdp < P->rlm2))
-			break;
-		if (lamdp <= P->rlm)
-		    lampp = TWOPI_HALFPI;
-		else if (lamdp >= P->rlm2)
-		    lampp = HALFPI;
-	}
-	if (l) {
-		sp = sin(lp.phi);
-		phidp = aasin(P->ctx,(P->one_es * P->ca * sp - P->sa * cos(lp.phi) * 
-			sin(lamt)) / sqrt(1. - P->es * sp * sp));
-		tanph = log(tan(FORTPI + .5 * phidp));
-		sd = sin(lamdp);
-		sdsq = sd * sd;
-		s = P->p22 * P->sa * cos(lamdp) * sqrt((1. + P->t * sdsq)
-			 / ((1. + P->w * sdsq) * (1. + P->q * sdsq)));
-		d = sqrt(P->xj * P->xj + s * s);
-		xy.x = P->b * lamdp + P->a2 * sin(2. * lamdp) + P->a4 *
-			sin(lamdp * 4.) - tanph * s / d;
-		xy.y = P->c1 * sd + P->c3 * sin(lamdp * 3.) + tanph * P->xj / d;
-	} else
-		xy.x = xy.y = HUGE_VAL;
-	return xy;
-}
-INVERSE(e_inverse); /* ellipsoid */
-    int nn;
-    double lamt, sdsq, s, lamdp, phidp, sppsq, dd, sd, sl, fac, scl, sav, spp;
-
-	lamdp = xy.x / P->b;
-	nn = 50;
-	do {
-		sav = lamdp;
-		sd = sin(lamdp);
-		sdsq = sd * sd;
-		s = P->p22 * P->sa * cos(lamdp) * sqrt((1. + P->t * sdsq)
-			 / ((1. + P->w * sdsq) * (1. + P->q * sdsq)));
-		lamdp = xy.x + xy.y * s / P->xj - P->a2 * sin(
-			2. * lamdp) - P->a4 * sin(lamdp * 4.) - s / P->xj * (
-			P->c1 * sin(lamdp) + P->c3 * sin(lamdp * 3.));
-		lamdp /= P->b;
-	} while (fabs(lamdp - sav) >= TOL && --nn);
-	sl = sin(lamdp);
-	fac = exp(sqrt(1. + s * s / P->xj / P->xj) * (xy.y - 
-		P->c1 * sl - P->c3 * sin(lamdp * 3.)));
-	phidp = 2. * (atan(fac) - FORTPI);
-	dd = sl * sl;
-	if (fabs(cos(lamdp)) < TOL)
-	    lamdp -= TOL;
-	spp = sin(phidp);
-	sppsq = spp * spp;
-	lamt = atan(((1. - sppsq * P->rone_es) * tan(lamdp) * 
-		P->ca - spp * P->sa * sqrt((1. + P->q * dd) * (
-		1. - sppsq) - sppsq * P->u) / cos(lamdp)) / (1. - sppsq 
-		* (1. + P->u)));
-	sl = lamt >= 0. ? 1. : -1.;
-	scl = cos(lamdp) >= 0. ? 1. : -1;
-	lamt -= HALFPI * (1. - scl) * sl;
-	lp.lam = lamt - P->p22 * lamdp;
-	if (fabs(P->sa) < TOL)
-	    lp.phi = aasin(P->ctx,spp / sqrt(P->one_es * P->one_es + P->es * sppsq));
-	else
-		lp.phi = atan((tan(lamdp) * cos(lamt) - P->ca * sin(lamt)) /
-			(P->one_es * P->sa));
-	return lp;
-}
-FREEUP; if (P) pj_dalloc(P); }
-ENTRY0(lsat)
-    int land, path;
-    double lam, alf, esc, ess;
-
-	land = pj_param(P->ctx, P->params, "ilsat").i;
-	if (land <= 0 || land > 5) E_ERROR(-28);
-	path = pj_param(P->ctx, P->params, "ipath").i;
-	if (path <= 0 || path > (land <= 3 ? 251 : 233)) E_ERROR(-29);
-	if (land <= 3) {
-		P->lam0 = DEG_TO_RAD * 128.87 - TWOPI / 251. * path;
-	    P->p22 = 103.2669323;
-	    alf = DEG_TO_RAD * 99.092;
-	} else {
-		P->lam0 = DEG_TO_RAD * 129.3 - TWOPI / 233. * path;
-	    P->p22 = 98.8841202;
-	    alf = DEG_TO_RAD * 98.2;
-	}
-	P->p22 /= 1440.;
-	P->sa = sin(alf);
-	P->ca = cos(alf);
-	if (fabs(P->ca) < 1e-9)
-	    P->ca = 1e-9;
-	esc = P->es * P->ca * P->ca;
-	ess = P->es * P->sa * P->sa;
-	P->w = (1. - esc) * P->rone_es;
-	P->w = P->w * P->w - 1.;
-	P->q = ess * P->rone_es;
-	P->t = ess * (2. - P->es) * P->rone_es * P->rone_es;
-	P->u = esc * P->rone_es;
-	P->xj = P->one_es * P->one_es * P->one_es;
-	P->rlm = PI * (1. / 248. + .5161290322580645);
-	P->rlm2 = P->rlm + TWOPI;
-    P->a2 = P->a4 = P->b = P->c1 = P->c3 = 0.;
-	seraz0(0., 1., P);
-	for (lam = 9.; lam <= 81.0001; lam += 18.)
-	    seraz0(lam, 4., P);
-	for (lam = 18; lam <= 72.0001; lam += 18.)
-	    seraz0(lam, 2., P);
-	seraz0(90., 1., P);
-	P->a2 /= 30.;
-	P->a4 /= 60.;
-	P->b /= 30.;
-	P->c1 /= 15.;
-	P->c3 /= 45.;
-	P->inv = e_inverse; P->fwd = e_forward;
-ENDENTRY(P)
diff --git a/src/proj/PJ_mbt_fps.c b/src/proj/PJ_mbt_fps.c
deleted file mode 100644
index 57a96e7..0000000
--- a/src/proj/PJ_mbt_fps.c
+++ /dev/null
@@ -1,38 +0,0 @@
-#define PJ_LIB__
-#include	<projects.h>
-PROJ_HEAD(mbt_fps, "McBryde-Thomas Flat-Pole Sine (No. 2)") "\n\tCyl., Sph.";
-#define MAX_ITER	10
-#define LOOP_TOL	1e-7
-#define C1 0.45503
-#define C2 1.36509
-#define C3 1.41546
-#define C_x 0.22248
-#define C_y 1.44492
-#define C1_2 0.33333333333333333333333333
-FORWARD(s_forward); /* spheroid */
-	double k, V, t;
-	int i;
-
-	k = C3 * sin(lp.phi);
-	for (i = MAX_ITER; i ; --i) {
-		t = lp.phi / C2;
-		lp.phi -= V = (C1 * sin(t) + sin(lp.phi) - k) /
-			(C1_2 * cos(t) + cos(lp.phi));
-		if (fabs(V) < LOOP_TOL)
-			break;
-	}
-	t = lp.phi / C2;
-	xy.x = C_x * lp.lam * (1. + 3. * cos(lp.phi)/cos(t) );
-	xy.y = C_y * sin(t);
-	return (xy);
-}
-INVERSE(s_inverse); /* spheroid */
-	double t;
-
-	lp.phi = C2 * (t = aasin(P->ctx,xy.y / C_y));
-	lp.lam = xy.x / (C_x * (1. + 3. * cos(lp.phi)/cos(t)));
-	lp.phi = aasin(P->ctx,(C1 * sin(t) + sin(lp.phi)) / C3);
-	return (lp);
-}
-FREEUP; if (P) pj_dalloc(P); }
-ENTRY0(mbt_fps) P->es = 0; P->inv = s_inverse; P->fwd = s_forward; ENDENTRY(P)
diff --git a/src/proj/PJ_mbtfpp.c b/src/proj/PJ_mbtfpp.c
deleted file mode 100644
index 9549a23..0000000
--- a/src/proj/PJ_mbtfpp.c
+++ /dev/null
@@ -1,32 +0,0 @@
-#define PJ_LIB__
-#include	<projects.h>
-PROJ_HEAD(mbtfpp, "McBride-Thomas Flat-Polar Parabolic") "\n\tCyl., Sph.";
-#define CS	.95257934441568037152
-#define FXC	.92582009977255146156
-#define FYC	3.40168025708304504493
-#define C23	.66666666666666666666
-#define C13	.33333333333333333333
-#define ONEEPS	1.0000001
-FORWARD(s_forward); /* spheroid */
-	lp.phi = asin(CS * sin(lp.phi));
-	xy.x = FXC * lp.lam * (2. * cos(C23 * lp.phi) - 1.);
-	xy.y = FYC * sin(C13 * lp.phi);
-	return (xy);
-}
-INVERSE(s_inverse); /* spheroid */
-	lp.phi = xy.y / FYC;
-	if (fabs(lp.phi) >= 1.) {
-		if (fabs(lp.phi) > ONEEPS)	I_ERROR
-		else	lp.phi = (lp.phi < 0.) ? -HALFPI : HALFPI;
-	} else
-		lp.phi = asin(lp.phi);
-	lp.lam = xy.x / ( FXC * (2. * cos(C23 * (lp.phi *= 3.)) - 1.) );
-	if (fabs(lp.phi = sin(lp.phi) / CS) >= 1.) {
-		if (fabs(lp.phi) > ONEEPS)	I_ERROR
-		else	lp.phi = (lp.phi < 0.) ? -HALFPI : HALFPI;
-	} else
-		lp.phi = asin(lp.phi);
-	return (lp);
-}
-FREEUP; if (P) pj_dalloc(P); }
-ENTRY0(mbtfpp) P->es = 0.; P->inv = s_inverse; P->fwd = s_forward; ENDENTRY(P)
diff --git a/src/proj/PJ_mbtfpq.c b/src/proj/PJ_mbtfpq.c
deleted file mode 100644
index 3298db4..0000000
--- a/src/proj/PJ_mbtfpq.c
+++ /dev/null
@@ -1,47 +0,0 @@
-#define PJ_LIB__
-#include	<projects.h>
-PROJ_HEAD(mbtfpq, "McBryde-Thomas Flat-Polar Quartic") "\n\tCyl., Sph.";
-#define NITER	20
-#define EPS	1e-7
-#define ONETOL 1.000001
-#define C	1.70710678118654752440
-#define RC	0.58578643762690495119
-#define FYC	1.87475828462269495505
-#define RYC	0.53340209679417701685
-#define FXC	0.31245971410378249250
-#define RXC	3.20041258076506210122
-FORWARD(s_forward); /* spheroid */
-	double th1, c;
-	int i;
-
-	c = C * sin(lp.phi);
-	for (i = NITER; i; --i) {
-		lp.phi -= th1 = (sin(.5*lp.phi) + sin(lp.phi) - c) /
-			(.5*cos(.5*lp.phi)  + cos(lp.phi));
-		if (fabs(th1) < EPS) break;
-	}
-	xy.x = FXC * lp.lam * (1.0 + 2. * cos(lp.phi)/cos(0.5 * lp.phi));
-	xy.y = FYC * sin(0.5 * lp.phi);
-	return (xy);
-}
-INVERSE(s_inverse); /* spheroid */
-	double t;
-
-	lp.phi = RYC * xy.y;
-	if (fabs(lp.phi) > 1.) {
-		if (fabs(lp.phi) > ONETOL)	I_ERROR
-		else if (lp.phi < 0.) { t = -1.; lp.phi = -PI; }
-		else { t = 1.; lp.phi = PI; }
-	} else
-		lp.phi = 2. * asin(t = lp.phi);
-	lp.lam = RXC * xy.x / (1. + 2. * cos(lp.phi)/cos(0.5 * lp.phi));
-	lp.phi = RC * (t + sin(lp.phi));
-	if (fabs(lp.phi) > 1.)
-		if (fabs(lp.phi) > ONETOL)	I_ERROR
-		else			lp.phi = lp.phi < 0. ? -HALFPI : HALFPI;
-	else
-		lp.phi = asin(lp.phi);
-	return (lp);
-}
-FREEUP; if (P) pj_dalloc(P); }
-ENTRY0(mbtfpq) P->es = 0.; P->inv = s_inverse; P->fwd = s_forward; ENDENTRY(P)
diff --git a/src/proj/PJ_merc.c b/src/proj/PJ_merc.c
deleted file mode 100644
index 4b991c1..0000000
--- a/src/proj/PJ_merc.c
+++ /dev/null
@@ -1,47 +0,0 @@
-#define PJ_LIB__
-#include	<projects.h>
-PROJ_HEAD(merc, "Mercator") "\n\tCyl, Sph&Ell\n\tlat_ts=";
-#define EPS10 1.e-10
-FORWARD(e_forward); /* ellipsoid */
-	if (fabs(fabs(lp.phi) - HALFPI) <= EPS10) F_ERROR;
-	xy.x = P->k0 * lp.lam;
-	xy.y = - P->k0 * log(pj_tsfn(lp.phi, sin(lp.phi), P->e));
-	return (xy);
-}
-FORWARD(s_forward); /* spheroid */
-	if (fabs(fabs(lp.phi) - HALFPI) <= EPS10) F_ERROR;
-	xy.x = P->k0 * lp.lam;
-	xy.y = P->k0 * log(tan(FORTPI + .5 * lp.phi));
-	return (xy);
-}
-INVERSE(e_inverse); /* ellipsoid */
-	if ((lp.phi = pj_phi2(P->ctx, exp(- xy.y / P->k0), P->e)) == HUGE_VAL) I_ERROR;
-	lp.lam = xy.x / P->k0;
-	return (lp);
-}
-INVERSE(s_inverse); /* spheroid */
-	lp.phi = HALFPI - 2. * atan(exp(-xy.y / P->k0));
-	lp.lam = xy.x / P->k0;
-	return (lp);
-}
-FREEUP; if (P) pj_dalloc(P); }
-ENTRY0(merc)
-	double phits=0.0;
-	int is_phits;
-
-	if( (is_phits = pj_param(P->ctx, P->params, "tlat_ts").i) ) {
-		phits = fabs(pj_param(P->ctx, P->params, "rlat_ts").f);
-		if (phits >= HALFPI) E_ERROR(-24);
-	}
-	if (P->es) { /* ellipsoid */
-		if (is_phits)
-			P->k0 = pj_msfn(sin(phits), cos(phits), P->es);
-		P->inv = e_inverse;
-		P->fwd = e_forward;
-	} else { /* sphere */
-		if (is_phits)
-			P->k0 = cos(phits);
-		P->inv = s_inverse;
-		P->fwd = s_forward;
-	}
-ENDENTRY(P)
diff --git a/src/proj/PJ_mill.c b/src/proj/PJ_mill.c
deleted file mode 100644
index 03c3559..0000000
--- a/src/proj/PJ_mill.c
+++ /dev/null
@@ -1,15 +0,0 @@
-#define PJ_LIB__
-# include	<projects.h>
-PROJ_HEAD(mill, "Miller Cylindrical") "\n\tCyl, Sph";
-FORWARD(s_forward); /* spheroid */
-	xy.x = lp.lam;
-	xy.y = log(tan(FORTPI + lp.phi * .4)) * 1.25;
-	return (xy);
-}
-INVERSE(s_inverse); /* spheroid */
-	lp.lam = xy.x;
-	lp.phi = 2.5 * (atan(exp(.8 * xy.y)) - FORTPI);
-	return (lp);
-}
-FREEUP; if (P) pj_dalloc(P); }
-ENTRY0(mill) P->es = 0.; P->inv = s_inverse; P->fwd = s_forward; ENDENTRY(P)
diff --git a/src/proj/PJ_mod_ster.c b/src/proj/PJ_mod_ster.c
deleted file mode 100644
index 185e95e..0000000
--- a/src/proj/PJ_mod_ster.c
+++ /dev/null
@@ -1,211 +0,0 @@
-/* based upon Snyder and Linck, USGS-NMD */
-#define PROJ_PARMS__ \
-    COMPLEX	*zcoeff; \
-	double	cchio, schio; \
-	int		n;
-#define PJ_LIB__
-#include	<projects.h>
-PROJ_HEAD(mil_os, "Miller Oblated Stereographic") "\n\tAzi(mod)";
-PROJ_HEAD(lee_os, "Lee Oblated Stereographic") "\n\tAzi(mod)";
-PROJ_HEAD(gs48, "Mod. Stererographics of 48 U.S.") "\n\tAzi(mod)";
-PROJ_HEAD(alsk, "Mod. Stererographics of Alaska") "\n\tAzi(mod)";
-PROJ_HEAD(gs50, "Mod. Stererographics of 50 U.S.") "\n\tAzi(mod)";
-#define EPSLN 1e-10
-
-FORWARD(e_forward); /* ellipsoid */
-	double sinlon, coslon, esphi, chi, schi, cchi, s;
-	COMPLEX p;
-
-	sinlon = sin(lp.lam);
-	coslon = cos(lp.lam);
-	esphi = P->e * sin(lp.phi);
-	chi = 2. * atan(tan((HALFPI + lp.phi) * .5) *
-		pow((1. - esphi) / (1. + esphi), P->e * .5)) - HALFPI;
-	schi = sin(chi);
-	cchi = cos(chi);
-	s = 2. / (1. + P->schio * schi + P->cchio * cchi * coslon);
-	p.r = s * cchi * sinlon;
-	p.i = s * (P->cchio * schi - P->schio * cchi * coslon);
-	p = pj_zpoly1(p, P->zcoeff, P->n);
-	xy.x = p.r;
-	xy.y = p.i;
-	return xy;
-}
-INVERSE(e_inverse); /* ellipsoid */
-	int nn;
-	COMPLEX p, fxy, fpxy, dp;
-	double den, rh, z, sinz, cosz, chi, phi, dphi, esphi;
-
-	p.r = xy.x;
-	p.i = xy.y;
-	for (nn = 20; nn ;--nn) {
-		fxy = pj_zpolyd1(p, P->zcoeff, P->n, &fpxy);
-		fxy.r -= xy.x;
-		fxy.i -= xy.y;
-		den = fpxy.r * fpxy.r + fpxy.i * fpxy.i;
-		dp.r = -(fxy.r * fpxy.r + fxy.i * fpxy.i) / den;
-		dp.i = -(fxy.i * fpxy.r - fxy.r * fpxy.i) / den;
-		p.r += dp.r;
-		p.i += dp.i;
-		if ((fabs(dp.r) + fabs(dp.i)) <= EPSLN)
-			break;
-	}
-	if (nn) {
-		rh = hypot(p.r, p.i);
-		z = 2. * atan(.5 * rh);
-		sinz = sin(z);
-		cosz = cos(z);
-		lp.lam = P->lam0;
-		if (fabs(rh) <= EPSLN) {
-			lp.phi = P->phi0;
-			return lp;
-		}
-		chi = aasin(P->ctx, cosz * P->schio + p.i * sinz * P->cchio / rh);
-		phi = chi;
-		for (nn = 20; nn ;--nn) {
-			esphi = P->e * sin(phi);
-			dphi = 2. * atan(tan((HALFPI + chi) * .5) *
-				pow((1. + esphi) / (1. - esphi), P->e * .5)) - HALFPI - phi;
-			phi += dphi;
-			if (fabs(dphi) <= EPSLN)
-				break;
-		}
-	}
-	if (nn) {
-		lp.phi = phi;
-		lp.lam = atan2(p.r * sinz, rh * P->cchio * cosz - p.i * 
-			P->schio * sinz);
-    } else
-		lp.lam = lp.phi = HUGE_VAL;
-	return lp;
-}
-FREEUP; if (P) pj_dalloc(P); }
-	static PJ *
-setup(PJ *P) { /* general initialization */
-	double esphi, chio;
-
-	if (P->es) {
-		esphi = P->e * sin(P->phi0);
-		chio = 2. * atan(tan((HALFPI + P->phi0) * .5) *
-			pow((1. - esphi) / (1. + esphi), P->e * .5)) - HALFPI;
-	} else
-		chio = P->phi0;
-	P->schio = sin(chio);
-	P->cchio = cos(chio);
-	P->inv = e_inverse; P->fwd = e_forward;
-	return P;
-}
-ENTRY0(mil_os)
-	static COMPLEX /* Miller Oblated Stereographic */
-AB[] = {
-	{0.924500,	0.},
-	{0.,			0.},
-	{0.019430,	0.}
-};
-
-	P->n = 2;
-	P->lam0 = DEG_TO_RAD * 20.;
-	P->phi0 = DEG_TO_RAD * 18.;
-	P->zcoeff = AB;
-	P->es = 0.;
-ENDENTRY(setup(P))
-ENTRY0(lee_os)
-	static COMPLEX /* Lee Oblated Stereographic */
-AB[] = {
-	{0.721316,	0.},
-	{0.,			0.},
-        {-0.0088162,	 -0.00617325}
-};
-
-	P->n = 2;
-	P->lam0 = DEG_TO_RAD * -165.;
-	P->phi0 = DEG_TO_RAD * -10.;
-	P->zcoeff = AB;
-	P->es = 0.;
-ENDENTRY(setup(P))
-ENTRY0(gs48)
-	static COMPLEX /* 48 United States */
-AB[] = {
-	{0.98879,	0.},
-	{0.,		0.},
-	{-0.050909,	0.},
-	{0.,		0.},
-        {0.075528,	0.}
-};
-
-	P->n = 4;
-	P->lam0 = DEG_TO_RAD * -96.;
-	P->phi0 = DEG_TO_RAD * -39.;
-	P->zcoeff = AB;
-	P->es = 0.;
-	P->a = 6370997.;
-ENDENTRY(setup(P))
-ENTRY0(alsk)
-	static COMPLEX
-ABe[] = { /* Alaska ellipsoid */
-	{.9945303,	0.},
-	{.0052083,	-.0027404},
-	{.0072721,	.0048181},
-	{-.0151089,	-.1932526},
-	{.0642675,	-.1381226},
-	{.3582802,	-.2884586}},
-ABs[] = { /* Alaska sphere */
-	{.9972523,	0.},
-	{.0052513,	-.0041175},
-	{.0074606,	.0048125},
-	{-.0153783,	-.1968253},
-	{.0636871,	-.1408027},
-        {.3660976,	-.2937382}
-};
-
-	P->n = 5;
-	P->lam0 = DEG_TO_RAD * -152.;
-	P->phi0 = DEG_TO_RAD * 64.;
-	if (P->es) { /* fixed ellipsoid/sphere */
-		P->zcoeff = ABe;
-		P->a = 6378206.4;
-		P->e = sqrt(P->es = 0.00676866);
-	} else {
-		P->zcoeff = ABs;
-		P->a = 6370997.;
-	}
-ENDENTRY(setup(P))
-ENTRY0(gs50)
-	static COMPLEX
-ABe[] = { /* GS50 ellipsoid */
-	{.9827497,	0.},
-	{.0210669,	.0053804},
-	{-.1031415,	-.0571664},
-	{-.0323337,	-.0322847},
-	{.0502303,	.1211983},
-	{.0251805,	.0895678},
-	{-.0012315,	-.1416121},
-	{.0072202,	-.1317091},
-	{-.0194029,	.0759677},
-        {-.0210072,	.0834037}
-},
-ABs[] = { /* GS50 sphere */
-	{.9842990,	0.},
-	{.0211642,	.0037608},
-	{-.1036018,	-.0575102},
-	{-.0329095,	-.0320119},
-	{.0499471,	.1223335},
-	{.0260460,	.0899805},
-	{.0007388,	-.1435792},
-	{.0075848,	-.1334108},
-	{-.0216473,	.0776645},
-        {-.0225161,	.0853673}
-};
-
-	P->n = 9;
-	P->lam0 = DEG_TO_RAD * -120.;
-	P->phi0 = DEG_TO_RAD * 45.;
-	if (P->es) { /* fixed ellipsoid/sphere */
-		P->zcoeff = ABe;
-		P->a = 6378206.4;
-		P->e = sqrt(P->es = 0.00676866);
-	} else {
-		P->zcoeff = ABs;
-		P->a = 6370997.;
-	}
-ENDENTRY(setup(P))
diff --git a/src/proj/PJ_moll.c b/src/proj/PJ_moll.c
deleted file mode 100644
index 98f0457..0000000
--- a/src/proj/PJ_moll.c
+++ /dev/null
@@ -1,60 +0,0 @@
-#define PROJ_PARMS__ \
-	double	C_x, C_y, C_p;
-#define PJ_LIB__
-#include	<projects.h>
-PROJ_HEAD(moll, "Mollweide") "\n\tPCyl., Sph.";
-PROJ_HEAD(wag4, "Wagner IV") "\n\tPCyl., Sph.";
-PROJ_HEAD(wag5, "Wagner V") "\n\tPCyl., Sph.";
-#define MAX_ITER	10
-#define LOOP_TOL	1e-7
-FORWARD(s_forward); /* spheroid */
-	double k, V;
-	int i;
-
-	k = P->C_p * sin(lp.phi);
-	for (i = MAX_ITER; i ; --i) {
-		lp.phi -= V = (lp.phi + sin(lp.phi) - k) /
-			(1. + cos(lp.phi));
-		if (fabs(V) < LOOP_TOL)
-			break;
-	}
-	if (!i)
-		lp.phi = (lp.phi < 0.) ? -HALFPI : HALFPI;
-	else
-		lp.phi *= 0.5;
-	xy.x = P->C_x * lp.lam * cos(lp.phi);
-	xy.y = P->C_y * sin(lp.phi);
-	return (xy);
-}
-INVERSE(s_inverse); /* spheroid */
-	lp.phi = aasin(P->ctx, xy.y / P->C_y);
-	lp.lam = xy.x / (P->C_x * cos(lp.phi));
-	lp.phi += lp.phi;
-	lp.phi = aasin(P->ctx, (lp.phi + sin(lp.phi)) / P->C_p);
-	return (lp);
-}
-FREEUP; if (P) pj_dalloc(P); }
-	static PJ *
-setup(PJ *P, double p) {
-	double r, sp, p2 = p + p;
-
-	P->es = 0;
-	sp = sin(p);
-	r = sqrt(TWOPI * sp / (p2 + sin(p2)));
-	P->C_x = 2. * r / PI;
-	P->C_y = r / sp;
-	P->C_p = p2 + sin(p2);
-	P->inv = s_inverse;
-	P->fwd = s_forward;
-	return P;
-}
-ENTRY0(moll) ENDENTRY(setup(P, HALFPI))
-ENTRY0(wag4) ENDENTRY(setup(P, PI/3.))
-ENTRY0(wag5)
-	P->es = 0;
-	P->C_x = 0.90977;
-	P->C_y = 1.65014;
-	P->C_p = 3.00896;
-	P->inv = s_inverse;
-	P->fwd = s_forward;
-ENDENTRY(P)
diff --git a/src/proj/PJ_natearth.c b/src/proj/PJ_natearth.c
deleted file mode 100644
index f83a3ff..0000000
--- a/src/proj/PJ_natearth.c
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
-The Natural Earth projection was designed by Tom Patterson, US National Park
-Service, in 2007, using Flex Projector. The shape of the original projection
-was defined at every 5 degrees and piece-wise cubic spline interpolation was
-used to compute the complete graticule.
-The code here uses polynomial functions instead of cubic splines and
-is therefore much simpler to program. The polynomial approximation was
-developed by Bojan Savric, in collaboration with Tom Patterson and Bernhard
-Jenny, Institute of Cartography, ETH Zurich. It slightly deviates from
-Patterson's original projection by adding additional curvature to meridians
-where they meet the horizontal pole line. This improvement is by intention
-and designed in collaboration with Tom Patterson.
-Port to PROJ.4 by Bernhard Jenny, 6 June 2011
-*/
-
-#define PJ_LIB__
-#include	<projects.h>
-PROJ_HEAD(natearth, "Natural Earth") "\n\tPCyl., Sph.";
-#define A0 0.8707
-#define A1 -0.131979
-#define A2 -0.013791
-#define A3 0.003971
-#define A4 -0.001529
-#define B0 1.007226
-#define B1 0.015085
-#define B2 -0.044475
-#define B3 0.028874
-#define B4 -0.005916
-#define C0 B0
-#define C1 (3 * B1)
-#define C2 (7 * B2)
-#define C3 (9 * B3)
-#define C4 (11 * B4)
-#define EPS 1e-11
-#define MAX_Y (0.8707 * 0.52 * PI)
-
-FORWARD(s_forward); /* spheroid */
-	double phi2, phi4;
-
-	phi2 = lp.phi * lp.phi;
-	phi4 = phi2 * phi2;
-	xy.x = lp.lam * (A0 + phi2 * (A1 + phi2 * (A2 + phi4 * phi2 * (A3 + phi2 * A4))));
-	xy.y = lp.phi * (B0 + phi2 * (B1 + phi4 * (B2 + B3 * phi2 + B4 * phi4)));
-	return (xy);
-}
-INVERSE(s_inverse); /* spheroid */
-	double yc, tol, y2, y4, f, fder;
-
-        /* make sure y is inside valid range */
-	if (xy.y > MAX_Y) {
-		xy.y = MAX_Y;
-	} else if (xy.y < -MAX_Y) {
-		xy.y = -MAX_Y;
-	}
-
-        /* latitude */
-	yc = xy.y;
-        for (;;) { /* Newton-Raphson */
-		y2 = yc * yc;
-		y4 = y2 * y2;
-		f = (yc * (B0 + y2 * (B1 + y4 * (B2 + B3 * y2 + B4 * y4)))) - xy.y;
-		fder = C0 + y2 * (C1 + y4 * (C2 + C3 * y2 + C4 * y4));
-		yc -= tol = f / fder;
-		if (fabs(tol) < EPS) {
-			break;
-		}
-	}
-	lp.phi = yc;
-
-        /* longitude */
-	y2 = yc * yc;
-	lp.lam = xy.x / (A0 + y2 * (A1 + y2 * (A2 + y2 * y2 * y2 * (A3 + y2 * A4))));
-
-	return (lp);
-}
-FREEUP; if (P) pj_dalloc(P); }
-ENTRY0(natearth) P->es = 0; P->inv = s_inverse; P->fwd = s_forward; ENDENTRY(P)
diff --git a/src/proj/PJ_nell.c b/src/proj/PJ_nell.c
deleted file mode 100644
index dd41b46..0000000
--- a/src/proj/PJ_nell.c
+++ /dev/null
@@ -1,29 +0,0 @@
-#define PJ_LIB__
-#include	<projects.h>
-PROJ_HEAD(nell, "Nell") "\n\tPCyl., Sph.";
-#define MAX_ITER	10
-#define LOOP_TOL	1e-7
-FORWARD(s_forward); /* spheroid */
-	double k, V;
-	int i;
-
-	k = 2. * sin(lp.phi);
-	V = lp.phi * lp.phi;
-	lp.phi *= 1.00371 + V * (-0.0935382 + V * -0.011412);
-	for (i = MAX_ITER; i ; --i) {
-		lp.phi -= V = (lp.phi + sin(lp.phi) - k) /
-			(1. + cos(lp.phi));
-		if (fabs(V) < LOOP_TOL)
-			break;
-	}
-	xy.x = 0.5 * lp.lam * (1. + cos(lp.phi));
-	xy.y = lp.phi;
-	return (xy);
-}
-INVERSE(s_inverse); /* spheroid */
-	lp.lam = 2. * xy.x / (1. + cos(xy.y));
-	lp.phi = aasin(P->ctx,0.5 * (xy.y + sin(xy.y)));
-	return (lp);
-}
-FREEUP; if (P) pj_dalloc(P); }
-ENTRY0(nell) P->es = 0; P->inv = s_inverse; P->fwd = s_forward; ENDENTRY(P)
diff --git a/src/proj/PJ_nell_h.c b/src/proj/PJ_nell_h.c
deleted file mode 100644
index 670dea8..0000000
--- a/src/proj/PJ_nell_h.c
+++ /dev/null
@@ -1,30 +0,0 @@
-#define PJ_LIB__
-# include	<projects.h>
-PROJ_HEAD(nell_h, "Nell-Hammer") "\n\tPCyl., Sph.";
-#define NITER 9
-#define EPS 1e-7
-FORWARD(s_forward); /* spheroid */
-	xy.x = 0.5 * lp.lam * (1. + cos(lp.phi));
-	xy.y = 2.0 * (lp.phi - tan(0.5 *lp.phi));
-	return (xy);
-}
-INVERSE(s_inverse); /* spheroid */
-	double V, c, p;
-	int i;
-
-	p = 0.5 * xy.y;
-	for (i = NITER; i ; --i) {
-		c = cos(0.5 * lp.phi);
-		lp.phi -= V = (lp.phi - tan(lp.phi/2) - p)/(1. - 0.5/(c*c));
-		if (fabs(V) < EPS)
-			break;
-	}
-	if (!i) {
-		lp.phi = p < 0. ? -HALFPI : HALFPI;
-		lp.lam = 2. * xy.x;
-	} else
-		lp.lam = 2. * xy.x / (1. + cos(lp.phi));
-	return (lp);
-}
-FREEUP; if (P) pj_dalloc(P); }
-ENTRY0(nell_h) P->es = 0.; P->inv = s_inverse; P->fwd = s_forward; ENDENTRY(P)
diff --git a/src/proj/PJ_nocol.c b/src/proj/PJ_nocol.c
deleted file mode 100644
index f129eb2..0000000
--- a/src/proj/PJ_nocol.c
+++ /dev/null
@@ -1,38 +0,0 @@
-#define PJ_LIB__
-#include	<projects.h>
-PROJ_HEAD(nicol, "Nicolosi Globular") "\n\tMisc Sph, no inv.";
-#define EPS	1e-10
-FORWARD(s_forward); /* spheroid */
-	if (fabs(lp.lam) < EPS) {
-		xy.x = 0;
-		xy.y = lp.phi;
-	} else if (fabs(lp.phi) < EPS) {
-		xy.x = lp.lam;
-		xy.y = 0.;
-	} else if (fabs(fabs(lp.lam) - HALFPI) < EPS) {
-		xy.x = lp.lam * cos(lp.phi);
-		xy.y = HALFPI * sin(lp.phi);
-	} else if (fabs(fabs(lp.phi) - HALFPI) < EPS) {
-		xy.x = 0;
-		xy.y = lp.phi;
-	} else {
-		double tb, c, d, m, n, r2, sp;
-
-		tb = HALFPI / lp.lam - lp.lam / HALFPI;
-		c = lp.phi / HALFPI;
-		d = (1 - c * c)/((sp = sin(lp.phi)) - c);
-		r2 = tb / d;
-		r2 *= r2;
-		m = (tb * sp / d - 0.5 * tb)/(1. + r2);
-		n = (sp / r2 + 0.5 * d)/(1. + 1./r2);
-		xy.x = cos(lp.phi);
-		xy.x = sqrt(m * m + xy.x * xy.x / (1. + r2));
-		xy.x = HALFPI * ( m + (lp.lam < 0. ? -xy.x : xy.x));
-		xy.y = sqrt(n * n - (sp * sp / r2 + d * sp - 1.) /
-			(1. + 1./r2));
-		xy.y = HALFPI * ( n + (lp.phi < 0. ? xy.y : -xy.y ));
-	}
-	return (xy);
-}
-FREEUP; if (P) pj_dalloc(P); }
-ENTRY0(nicol) P->es = 0.; P->fwd = s_forward; ENDENTRY(P)
diff --git a/src/proj/PJ_nsper.c b/src/proj/PJ_nsper.c
deleted file mode 100644
index 0f355b9..0000000
--- a/src/proj/PJ_nsper.c
+++ /dev/null
@@ -1,149 +0,0 @@
-#define PROJ_PARMS__ \
-	double	height; \
-	double	sinph0; \
-	double	cosph0; \
-	double	p; \
-	double	rp; \
-	double	pn1; \
-	double	pfact; \
-	double	h; \
-	double	cg; \
-	double	sg; \
-	double	sw; \
-	double	cw; \
-	int		mode; \
-	int		tilt;
-#define PJ_LIB__
-#include	<projects.h>
-PROJ_HEAD(nsper, "Near-sided perspective") "\n\tAzi, Sph\n\th=";
-PROJ_HEAD(tpers, "Tilted perspective") "\n\tAzi, Sph\n\ttilt= azi= h=";
-# define EPS10 1.e-10
-# define N_POLE	0
-# define S_POLE 1
-# define EQUIT	2
-# define OBLIQ	3
-FORWARD(s_forward); /* spheroid */
-	double  coslam, cosphi, sinphi;
-
-	sinphi = sin(lp.phi);
-	cosphi = cos(lp.phi);
-	coslam = cos(lp.lam);
-	switch (P->mode) {
-	case OBLIQ:
-		xy.y = P->sinph0 * sinphi + P->cosph0 * cosphi * coslam;
-		break;
-	case EQUIT:
-		xy.y = cosphi * coslam;
-		break;
-	case S_POLE:
-		xy.y = - sinphi;
-		break;
-	case N_POLE:
-		xy.y = sinphi;
-		break;
-	}
-	if (xy.y < P->rp) F_ERROR;
-	xy.y = P->pn1 / (P->p - xy.y);
-	xy.x = xy.y * cosphi * sin(lp.lam);
-	switch (P->mode) {
-	case OBLIQ:
-		xy.y *= (P->cosph0 * sinphi -
-		   P->sinph0 * cosphi * coslam);
-		break;
-	case EQUIT:
-		xy.y *= sinphi;
-		break;
-	case N_POLE:
-		coslam = - coslam;
-	case S_POLE:
-		xy.y *= cosphi * coslam;
-		break;
-	}
-	if (P->tilt) {
-		double yt, ba;
-
-		yt = xy.y * P->cg + xy.x * P->sg;
-		ba = 1. / (yt * P->sw * P->h + P->cw);
-		xy.x = (xy.x * P->cg - xy.y * P->sg) * P->cw * ba;
-		xy.y = yt * ba;
-	}
-	return (xy);
-}
-INVERSE(s_inverse); /* spheroid */
-	double  rh, cosz, sinz;
-
-	if (P->tilt) {
-		double bm, bq, yt;
-
-		yt = 1./(P->pn1 - xy.y * P->sw);
-		bm = P->pn1 * xy.x * yt;
-		bq = P->pn1 * xy.y * P->cw * yt;
-		xy.x = bm * P->cg + bq * P->sg;
-		xy.y = bq * P->cg - bm * P->sg;
-	}
-	rh = hypot(xy.x, xy.y);
-	if ((sinz = 1. - rh * rh * P->pfact) < 0.) I_ERROR;
-	sinz = (P->p - sqrt(sinz)) / (P->pn1 / rh + rh / P->pn1);
-	cosz = sqrt(1. - sinz * sinz);
-	if (fabs(rh) <= EPS10) {
-		lp.lam = 0.;
-		lp.phi = P->phi0;
-	} else {
-		switch (P->mode) {
-		case OBLIQ:
-			lp.phi = asin(cosz * P->sinph0 + xy.y * sinz * P->cosph0 / rh);
-			xy.y = (cosz - P->sinph0 * sin(lp.phi)) * rh;
-			xy.x *= sinz * P->cosph0;
-			break;
-		case EQUIT:
-			lp.phi = asin(xy.y * sinz / rh);
-			xy.y = cosz * rh;
-			xy.x *= sinz;
-			break;
-		case N_POLE:
-			lp.phi = asin(cosz);
-			xy.y = -xy.y;
-			break;
-		case S_POLE:
-			lp.phi = - asin(cosz);
-			break;
-		}
-		lp.lam = atan2(xy.x, xy.y);
-	}
-	return (lp);
-}
-FREEUP; if (P) pj_dalloc(P); }
-	static PJ *
-setup(PJ *P) {
-	if ((P->height = pj_param(P->ctx, P->params, "dh").f) <= 0.) E_ERROR(-30);
-	if (fabs(fabs(P->phi0) - HALFPI) < EPS10)
-		P->mode = P->phi0 < 0. ? S_POLE : N_POLE;
-	else if (fabs(P->phi0) < EPS10)
-		P->mode = EQUIT;
-	else {
-		P->mode = OBLIQ;
-		P->sinph0 = sin(P->phi0);
-		P->cosph0 = cos(P->phi0);
-	}
-	P->pn1 = P->height / P->a; /* normalize by radius */
-	P->p = 1. + P->pn1;
-	P->rp = 1. / P->p;
-	P->h = 1. / P->pn1;
-	P->pfact = (P->p + 1.) * P->h;
-	P->inv = s_inverse;
-	P->fwd = s_forward;
-	P->es = 0.;
-	return P;
-}
-ENTRY0(nsper)
-	P->tilt = 0;
-ENDENTRY(setup(P))
-ENTRY0(tpers)
-	double omega, gamma;
-
-	omega = pj_param(P->ctx, P->params, "dtilt").f * DEG_TO_RAD;
-	gamma = pj_param(P->ctx, P->params, "dazi").f * DEG_TO_RAD;
-	P->tilt = 1;
-	P->cg = cos(gamma); P->sg = sin(gamma);
-	P->cw = cos(omega); P->sw = sin(omega);
-ENDENTRY(setup(P))
diff --git a/src/proj/PJ_nzmg.c b/src/proj/PJ_nzmg.c
deleted file mode 100644
index 29ba97e..0000000
--- a/src/proj/PJ_nzmg.c
+++ /dev/null
@@ -1,107 +0,0 @@
-/******************************************************************************
- * $Id: PJ_nzmg.c 1770 2009-10-19 17:16:39Z caress $
- *
- * Project:  PROJ.4
- * Purpose:  Implementation of the nzmg (New Zealand Map Grid) projection.
- *           Very loosely based upon DMA code by Bradford W. Drew
- * Author:   Gerald Evenden
- *
- ******************************************************************************
- * Copyright (c) 1995, Gerald Evenden
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *****************************************************************************/
-
-#define PJ_LIB__
-#include	<projects.h>
-
-PJ_CVSID("$Id: PJ_nzmg.c 1770 2009-10-19 17:16:39Z caress $");
-
-PROJ_HEAD(nzmg, "New Zealand Map Grid") "\n\tfixed Earth";
-
-#define EPSLN 1e-10
-#define SEC5_TO_RAD 0.4848136811095359935899141023
-#define RAD_TO_SEC5 2.062648062470963551564733573
-	static COMPLEX
-bf[] = {
-	{.7557853228,	0.0},
-	{.249204646,	.003371507},
-	{-.001541739,	.041058560},
-	{-.10162907,	.01727609},
-	{-.26623489,	-.36249218},
-	{-.6870983,	-1.1651967} };
-	static double
-tphi[] = { 1.5627014243, .5185406398, -.03333098, -.1052906, -.0368594,
-	.007317, .01220, .00394, -.0013 },
-tpsi[] = { .6399175073, -.1358797613, .063294409, -.02526853, .0117879,
-	-.0055161, .0026906, -.001333, .00067, -.00034 };
-#define Nbf 5
-#define Ntpsi 9
-#define Ntphi 8
-FORWARD(e_forward); /* ellipsoid */
-	COMPLEX p;
-	double *C;
-	int i;
-
-	lp.phi = (lp.phi - P->phi0) * RAD_TO_SEC5;
-	for (p.r = *(C = tpsi + (i = Ntpsi)); i ; --i)
-		p.r = *--C + lp.phi * p.r;
-	p.r *= lp.phi;
-	p.i = lp.lam;
-	p = pj_zpoly1(p, bf, Nbf);
-	xy.x = p.i;
-	xy.y = p.r;
-	return xy;
-}
-INVERSE(e_inverse); /* ellipsoid */
-	int nn, i;
-	COMPLEX p, f, fp, dp;
-	double den, *C;
-
-	p.r = xy.y;
-	p.i = xy.x;
-	for (nn = 20; nn ;--nn) {
-		f = pj_zpolyd1(p, bf, Nbf, &fp);
-		f.r -= xy.y;
-		f.i -= xy.x;
-		den = fp.r * fp.r + fp.i * fp.i;
-		p.r += dp.r = -(f.r * fp.r + f.i * fp.i) / den;
-		p.i += dp.i = -(f.i * fp.r - f.r * fp.i) / den;
-		if ((fabs(dp.r) + fabs(dp.i)) <= EPSLN)
-			break;
-	}
-	if (nn) {
-		lp.lam = p.i;
-		for (lp.phi = *(C = tphi + (i = Ntphi)); i ; --i)
-			lp.phi = *--C + p.r * lp.phi;
-		lp.phi = P->phi0 + p.r * lp.phi * SEC5_TO_RAD;
-	} else
-		lp.lam = lp.phi = HUGE_VAL;
-	return lp;
-}
-FREEUP; if (P) pj_dalloc(P); }
-ENTRY0(nzmg)
-	/* force to International major axis */
-	P->ra = 1. / (P->a = 6378388.0);
-	P->lam0 = DEG_TO_RAD * 173.;
-	P->phi0 = DEG_TO_RAD * -41.;
-	P->x0 = 2510000.;
-	P->y0 = 6023150.;
-	P->inv = e_inverse; P->fwd = e_forward;
-ENDENTRY(P)
diff --git a/src/proj/PJ_ob_tran.c b/src/proj/PJ_ob_tran.c
deleted file mode 100644
index 34e0f6b..0000000
--- a/src/proj/PJ_ob_tran.c
+++ /dev/null
@@ -1,144 +0,0 @@
-#define PROJ_PARMS__ \
-	struct PJconsts *link; \
-	double	lamp; \
-	double	cphip, sphip;
-#define PJ_LIB__
-#include <projects.h>
-#include <string.h>
-PROJ_HEAD(ob_tran, "General Oblique Transformation") "\n\tMisc Sph"
-"\n\to_proj= plus parameters for projection"
-"\n\to_lat_p= o_lon_p= (new pole) or"
-"\n\to_alpha= o_lon_c= o_lat_c= or"
-"\n\to_lon_1= o_lat_1= o_lon_2= o_lat_2=";
-#define TOL 1e-10
-FORWARD(o_forward); /* spheroid */
-	double coslam, sinphi, cosphi;
-
-        (void) xy;
-
-	coslam = cos(lp.lam);
-	sinphi = sin(lp.phi);
-	cosphi = cos(lp.phi);
-	lp.lam = adjlon(aatan2(cosphi * sin(lp.lam), P->sphip * cosphi * coslam +
-		P->cphip * sinphi) + P->lamp);
-	lp.phi = aasin(P->ctx,P->sphip * sinphi - P->cphip * cosphi * coslam);
-	return (P->link->fwd(lp, P->link));
-}
-FORWARD(t_forward); /* spheroid */
-	double cosphi, coslam;
-
-        (void) xy;
-
-	cosphi = cos(lp.phi);
-	coslam = cos(lp.lam);
-	lp.lam = adjlon(aatan2(cosphi * sin(lp.lam), sin(lp.phi)) + P->lamp);
-	lp.phi = aasin(P->ctx, - cosphi * coslam);
-	return (P->link->fwd(lp, P->link));
-}
-INVERSE(o_inverse); /* spheroid */
-	double coslam, sinphi, cosphi;
-
-	lp = P->link->inv(xy, P->link);
-	if (lp.lam != HUGE_VAL) {
-		coslam = cos(lp.lam -= P->lamp);
-		sinphi = sin(lp.phi);
-		cosphi = cos(lp.phi);
-		lp.phi = aasin(P->ctx,P->sphip * sinphi + P->cphip * cosphi * coslam);
-		lp.lam = aatan2(cosphi * sin(lp.lam), P->sphip * cosphi * coslam -
-			P->cphip * sinphi);
-	}
-	return (lp);
-}
-INVERSE(t_inverse); /* spheroid */
-	double cosphi, t;
-
-	lp = P->link->inv(xy, P->link);
-	if (lp.lam != HUGE_VAL) {
-		cosphi = cos(lp.phi);
-		t = lp.lam - P->lamp;
-		lp.lam = aatan2(cosphi * sin(t), - sin(lp.phi));
-		lp.phi = aasin(P->ctx,cosphi * cos(t));
-	}
-	return (lp);
-}
-FREEUP;
-	if (P) {
-		if (P->link)
-			(*(P->link->pfree))(P->link);
-		pj_dalloc(P);
-	}
-}
-ENTRY1(ob_tran, link)
-	int i;
-	double phip;
-	char *name, *s;
-
-	/* get name of projection to be translated */
-	if (!(name = pj_param(P->ctx, P->params, "so_proj").s)) E_ERROR(-26);
-	for (i = 0; (s = pj_list[i].id) && strcmp(name, s) ; ++i) ;
-	if (!s || !(P->link = (*pj_list[i].proj)(0))) E_ERROR(-37);
-	/* copy existing header into new */
-	P->es = 0.; /* force to spherical */
-	P->link->params = P->params;
-	P->link->over = P->over;
-	P->link->geoc = P->geoc;
-	P->link->a = P->a;
-	P->link->es = P->es;
-	P->link->ra = P->ra;
-	P->link->lam0 = P->lam0;
-	P->link->phi0 = P->phi0;
-	P->link->x0 = P->x0;
-	P->link->y0 = P->y0;
-	P->link->k0 = P->k0;
-	/* force spherical earth */
-	P->link->one_es = P->link->rone_es = 1.;
-	P->link->es = P->link->e = 0.;
-	if (!(P->link = pj_list[i].proj(P->link))) {
-		freeup(P);
-		return 0;
-	}
-	if (pj_param(P->ctx, P->params, "to_alpha").i) {
-		double lamc, phic, alpha;
-
-		lamc	= pj_param(P->ctx, P->params, "ro_lon_c").f;
-		phic	= pj_param(P->ctx, P->params, "ro_lat_c").f;
-		alpha	= pj_param(P->ctx, P->params, "ro_alpha").f;
-/*
-		if (fabs(phic) <= TOL ||
-			fabs(fabs(phic) - HALFPI) <= TOL ||
-			fabs(fabs(alpha) - HALFPI) <= TOL)
-*/
-		if (fabs(fabs(phic) - HALFPI) <= TOL)
-			E_ERROR(-32);
-		P->lamp = lamc + aatan2(-cos(alpha), -sin(alpha) * sin(phic));
-		phip = aasin(P->ctx,cos(phic) * sin(alpha));
-	} else if (pj_param(P->ctx, P->params, "to_lat_p").i) { /* specified new pole */
-		P->lamp = pj_param(P->ctx, P->params, "ro_lon_p").f;
-		phip = pj_param(P->ctx, P->params, "ro_lat_p").f;
-	} else { /* specified new "equator" points */
-		double lam1, lam2, phi1, phi2, con;
-
-		lam1 = pj_param(P->ctx, P->params, "ro_lon_1").f;
-		phi1 = pj_param(P->ctx, P->params, "ro_lat_1").f;
-		lam2 = pj_param(P->ctx, P->params, "ro_lon_2").f;
-		phi2 = pj_param(P->ctx, P->params, "ro_lat_2").f;
-		if (fabs(phi1 - phi2) <= TOL ||
-			(con = fabs(phi1)) <= TOL ||
-			fabs(con - HALFPI) <= TOL ||
-			fabs(fabs(phi2) - HALFPI) <= TOL) E_ERROR(-33);
-		P->lamp = atan2(cos(phi1) * sin(phi2) * cos(lam1) -
-			sin(phi1) * cos(phi2) * cos(lam2),
-			sin(phi1) * cos(phi2) * sin(lam2) -
-			cos(phi1) * sin(phi2) * sin(lam1));
-		phip = atan(-cos(P->lamp - lam1) / tan(phi1));
-	}
-	if (fabs(phip) > TOL) { /* oblique */
-		P->cphip = cos(phip);
-		P->sphip = sin(phip);
-		P->fwd = o_forward;
-		P->inv = P->link->inv ? o_inverse : 0;
-	} else { /* transverse */
-		P->fwd = t_forward;
-		P->inv = P->link->inv ? t_inverse : 0;
-	}
-ENDENTRY(P)
diff --git a/src/proj/PJ_ocea.c b/src/proj/PJ_ocea.c
deleted file mode 100644
index 8c7bd16..0000000
--- a/src/proj/PJ_ocea.c
+++ /dev/null
@@ -1,68 +0,0 @@
-#define PROJ_PARMS__ \
-	double	rok; \
-	double	rtk; \
-	double	sinphi; \
-	double	cosphi; \
-	double	singam; \
-	double	cosgam;
-#define PJ_LIB__
-#include	<projects.h>
-PROJ_HEAD(ocea, "Oblique Cylindrical Equal Area") "\n\tCyl, Sph"
-	"lonc= alpha= or\n\tlat_1= lat_2= lon_1= lon_2=";
-FORWARD(s_forward); /* spheroid */
-	double t;
-
-	xy.y = sin(lp.lam);
-/*
-	xy.x = atan2((tan(lp.phi) * P->cosphi + P->sinphi * xy.y) , cos(lp.lam));
-*/
-	t = cos(lp.lam);
-	xy.x = atan((tan(lp.phi) * P->cosphi + P->sinphi * xy.y) / t);
-	if (t < 0.)
-		xy.x += PI;
-	xy.x *= P->rtk;
-	xy.y = P->rok * (P->sinphi * sin(lp.phi) - P->cosphi * cos(lp.phi) * xy.y);
-	return (xy);
-}
-INVERSE(s_inverse); /* spheroid */
-	double t, s;
-
-	xy.y /= P->rok;
-	xy.x /= P->rtk;
-	t = sqrt(1. - xy.y * xy.y);
-	lp.phi = asin(xy.y * P->sinphi + t * P->cosphi * (s = sin(xy.x)));
-	lp.lam = atan2(t * P->sinphi * s - xy.y * P->cosphi,
-		t * cos(xy.x));
-	return (lp);
-}
-FREEUP; if (P) pj_dalloc(P); }
-ENTRY0(ocea)
-	double phi_0=0.0, phi_1, phi_2, lam_1, lam_2, lonz, alpha;
-
-	P->rok = P->a / P->k0;
-	P->rtk = P->a * P->k0;
-	if ( pj_param(P->ctx, P->params, "talpha").i) {
-		alpha	= pj_param(P->ctx, P->params, "ralpha").f;
-		lonz = pj_param(P->ctx, P->params, "rlonc").f;
-		P->singam = atan(-cos(alpha)/(-sin(phi_0) * sin(alpha))) + lonz;
-		P->sinphi = asin(cos(phi_0) * sin(alpha));
-	} else {
-		phi_1 = pj_param(P->ctx, P->params, "rlat_1").f;
-		phi_2 = pj_param(P->ctx, P->params, "rlat_2").f;
-		lam_1 = pj_param(P->ctx, P->params, "rlon_1").f;
-		lam_2 = pj_param(P->ctx, P->params, "rlon_2").f;
-		P->singam = atan2(cos(phi_1) * sin(phi_2) * cos(lam_1) -
-			sin(phi_1) * cos(phi_2) * cos(lam_2),
-			sin(phi_1) * cos(phi_2) * sin(lam_2) -
-			cos(phi_1) * sin(phi_2) * sin(lam_1) );
-		P->sinphi = atan(-cos(P->singam - lam_1) / tan(phi_1));
-	}
-	P->lam0 = P->singam + HALFPI;
-	P->cosphi = cos(P->sinphi);
-	P->sinphi = sin(P->sinphi);
-	P->cosgam = cos(P->singam);
-	P->singam = sin(P->singam);
-	P->inv = s_inverse;
-	P->fwd = s_forward;
-	P->es = 0.;
-ENDENTRY(P)
diff --git a/src/proj/PJ_oea.c b/src/proj/PJ_oea.c
deleted file mode 100644
index b84a7ea..0000000
--- a/src/proj/PJ_oea.c
+++ /dev/null
@@ -1,58 +0,0 @@
-#define PROJ_PARMS__ \
-	double	theta; \
-	double	m, n; \
-	double	two_r_m, two_r_n, rm, rn, hm, hn; \
-	double	cp0, sp0;
-#define PJ_LIB__
-#include	<projects.h>
-PROJ_HEAD(oea, "Oblated Equal Area") "\n\tMisc Sph\n\tn= m= theta=";
-FORWARD(s_forward); /* sphere */
-	double Az, M, N, cp, sp, cl, shz;
-
-	cp = cos(lp.phi);
-	sp = sin(lp.phi);
-	cl = cos(lp.lam);
-	Az = aatan2(cp * sin(lp.lam), P->cp0 * sp - P->sp0 * cp * cl) + P->theta;
-	shz = sin(0.5 * aacos(P->ctx, P->sp0 * sp + P->cp0 * cp * cl));
-	M = aasin(P->ctx, shz * sin(Az));
-	N = aasin(P->ctx, shz * cos(Az) * cos(M) / cos(M * P->two_r_m));
-	xy.y = P->n * sin(N * P->two_r_n);
-	xy.x = P->m * sin(M * P->two_r_m) * cos(N) / cos(N * P->two_r_n);
-	return (xy);
-}
-INVERSE(s_inverse); /* sphere */
-	double N, M, xp, yp, z, Az, cz, sz, cAz;
-
-	N = P->hn * aasin(P->ctx,xy.y * P->rn);
-	M = P->hm * aasin(P->ctx,xy.x * P->rm * cos(N * P->two_r_n) / cos(N));
-	xp = 2. * sin(M);
-	yp = 2. * sin(N) * cos(M * P->two_r_m) / cos(M);
-	cAz = cos(Az = aatan2(xp, yp) - P->theta);
-	z = 2. * aasin(P->ctx, 0.5 * hypot(xp, yp));
-	sz = sin(z);
-	cz = cos(z);
-	lp.phi = aasin(P->ctx, P->sp0 * cz + P->cp0 * sz * cAz);
-	lp.lam = aatan2(sz * sin(Az),
-		P->cp0 * cz - P->sp0 * sz * cAz);
-	return (lp);
-}
-FREEUP; if (P) pj_dalloc(P); }
-ENTRY0(oea)
-	if (((P->n = pj_param(P->ctx, P->params, "dn").f) <= 0.) ||
-		((P->m = pj_param(P->ctx, P->params, "dm").f) <= 0.))
-		E_ERROR(-39)
-	else {
-		P->theta = pj_param(P->ctx, P->params, "rtheta").f;
-		P->sp0 = sin(P->phi0);
-		P->cp0 = cos(P->phi0);
-		P->rn = 1./ P->n;
-		P->rm = 1./ P->m;
-		P->two_r_n = 2. * P->rn;
-		P->two_r_m = 2. * P->rm;
-		P->hm = 0.5 * P->m;
-		P->hn = 0.5 * P->n;
-		P->fwd = s_forward;
-		P->inv = s_inverse;
-		P->es = 0.;
-	}
-ENDENTRY(P)
diff --git a/src/proj/PJ_omerc.c b/src/proj/PJ_omerc.c
deleted file mode 100644
index c8888a8..0000000
--- a/src/proj/PJ_omerc.c
+++ /dev/null
@@ -1,194 +0,0 @@
-/*
-** Copyright (c) 2003, 2006   Gerald I. Evenden
-*/
-/*
-** Permission is hereby granted, free of charge, to any person obtaining
-** a copy of this software and associated documentation files (the
-** "Software"), to deal in the Software without restriction, including
-** without limitation the rights to use, copy, modify, merge, publish,
-** distribute, sublicense, and/or sell copies of the Software, and to
-** permit persons to whom the Software is furnished to do so, subject to
-** the following conditions:
-**
-** The above copyright notice and this permission notice shall be
-** included in all copies or substantial portions of the Software.
-**
-** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
-** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-** SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-*/
-#define PROJ_PARMS__ \
-	double	A, B, E, AB, ArB, BrA, rB, singam, cosgam, sinrot, cosrot; \
-	double  v_pole_n, v_pole_s, u_0; \
-	int no_rot;
-#define PJ_LIB__
-#include <projects.h>
-
-PROJ_HEAD(omerc, "Oblique Mercator")
-	"\n\tCyl, Sph&Ell no_rot\n\t"
-"alpha= [gamma=] [no_off] lonc= or\n\t lon_1= lat_1= lon_2= lat_2=";
-#define TOL	1.e-7
-#define EPS	1.e-10
-
-FORWARD(e_forward); /* ellipsoid */
-	double  Q, S, T, U, V, temp, u, v;
-
-	if (fabs(fabs(lp.phi) - HALFPI) > EPS) {
-		Q = P->E / pow(pj_tsfn(lp.phi, sin(lp.phi), P->e), P->B);
-		temp = 1. / Q;
-		S = .5 * (Q - temp);
-		T = .5 * (Q + temp);
-		V = sin(P->B * lp.lam);
-		U = (S * P->singam - V * P->cosgam) / T;
-		if (fabs(fabs(U) - 1.0) < EPS)
-			F_ERROR;
-		v = 0.5 * P->ArB * log((1. - U)/(1. + U));
-		temp = cos(P->B * lp.lam);
-		u = (fabs(temp) < TOL) ? P->AB * lp.lam :
-			P->ArB * atan2((S * P->cosgam + V * P->singam) , temp); 
-	} else {
-		v = lp.phi > 0 ? P->v_pole_n : P->v_pole_s;
-		u = P->ArB * lp.phi;
-	}
-	if (P->no_rot) {
-		xy.x = u;
-		xy.y = v;
-	} else {
-		u -= P->u_0;
-		xy.x = v * P->cosrot + u * P->sinrot;
-		xy.y = u * P->cosrot - v * P->sinrot;
-	}
-	return (xy);
-}
-INVERSE(e_inverse); /* ellipsoid */
-	double  u, v, Qp, Sp, Tp, Vp, Up;
-
-	if (P->no_rot) {
-		v = xy.y;
-		u = xy.x;
-	} else {
-		v = xy.x * P->cosrot - xy.y * P->sinrot;
-		u = xy.y * P->cosrot + xy.x * P->sinrot + P->u_0;
-	}
-	Qp = exp(- P->BrA * v);
-	Sp = .5 * (Qp - 1. / Qp);
-	Tp = .5 * (Qp + 1. / Qp);
-	Vp = sin(P->BrA * u);
-	Up = (Vp * P->cosgam + Sp * P->singam) / Tp;
-	if (fabs(fabs(Up) - 1.) < EPS) {
-		lp.lam = 0.;
-		lp.phi = Up < 0. ? -HALFPI : HALFPI;
-	} else {
-		lp.phi = P->E / sqrt((1. + Up) / (1. - Up));
-		if ((lp.phi = pj_phi2(P->ctx, pow(lp.phi, 1. / P->B), P->e)) == HUGE_VAL)
-			I_ERROR;
-		lp.lam = - P->rB * atan2((Sp * P->cosgam -
-			Vp * P->singam), cos(P->BrA * u));
-	}
-	return (lp);
-}
-FREEUP; if (P) pj_dalloc(P); }
-ENTRY0(omerc)
-	double con, com, cosph0, D, F, H, L, sinph0, p, J, gamma,
-		gamma0, lamc, lam1, lam2, phi1, phi2, alpha_c;
-	int alp, gam, no_off = 0;
-
-	P->no_rot = pj_param(P->ctx, P->params, "tno_rot").i;
-        if ((alp = pj_param(P->ctx, P->params, "talpha").i) != 0)
-		alpha_c = pj_param(P->ctx, P->params, "ralpha").f;
-        if ((gam = pj_param(P->ctx, P->params, "tgamma").i) != 0)
-		gamma = pj_param(P->ctx, P->params, "rgamma").f;
-	if (alp || gam) {
-		lamc	= pj_param(P->ctx, P->params, "rlonc").f;
-		no_off = 
-                    /* For libproj4 compatability */
-                    pj_param(P->ctx, P->params, "tno_off").i
-                    /* for backward compatibility */
-                    || pj_param(P->ctx, P->params, "tno_uoff").i;
-	} else {
-		lam1 = pj_param(P->ctx, P->params, "rlon_1").f;
-		phi1 = pj_param(P->ctx, P->params, "rlat_1").f;
-		lam2 = pj_param(P->ctx, P->params, "rlon_2").f;
-		phi2 = pj_param(P->ctx, P->params, "rlat_2").f;
-		if (fabs(phi1 - phi2) <= TOL ||
-			(con = fabs(phi1)) <= TOL ||
-			fabs(con - HALFPI) <= TOL ||
-			fabs(fabs(P->phi0) - HALFPI) <= TOL ||
-			fabs(fabs(phi2) - HALFPI) <= TOL) E_ERROR(-33);
-	}
-	com = sqrt(P->one_es);
-	if (fabs(P->phi0) > EPS) {
-		sinph0 = sin(P->phi0);
-		cosph0 = cos(P->phi0);
-		con = 1. - P->es * sinph0 * sinph0;
-		P->B = cosph0 * cosph0;
-		P->B = sqrt(1. + P->es * P->B * P->B / P->one_es);
-		P->A = P->B * P->k0 * com / con;
-		D = P->B * com / (cosph0 * sqrt(con));
-		if ((F = D * D - 1.) <= 0.)
-			F = 0.;
-		else {
-			F = sqrt(F);
-			if (P->phi0 < 0.)
-				F = -F;
-		}
-		P->E = F += D;
-		P->E *= pow(pj_tsfn(P->phi0, sinph0, P->e), P->B);
-	} else {
-		P->B = 1. / com;
-		P->A = P->k0;
-		P->E = D = F = 1.;
-	}
-	if (alp || gam) {
-		if (alp) {
-			gamma0 = asin(sin(alpha_c) / D);
-			if (!gam)
-				gamma = alpha_c;
-		} else
-			alpha_c = asin(D*sin(gamma0 = gamma));
-		if ((con = fabs(alpha_c)) <= TOL ||
-			fabs(con - PI) <= TOL ||
-			fabs(fabs(P->phi0) - HALFPI) <= TOL)
-			E_ERROR(-32);
-		P->lam0 = lamc - asin(.5 * (F - 1. / F) *
-		   tan(gamma0)) / P->B;
-	} else {
-		H = pow(pj_tsfn(phi1, sin(phi1), P->e), P->B);
-		L = pow(pj_tsfn(phi2, sin(phi2), P->e), P->B);
-		F = P->E / H;
-		p = (L - H) / (L + H);
-		J = P->E * P->E;
-		J = (J - L * H) / (J + L * H);
-		if ((con = lam1 - lam2) < -PI)
-			lam2 -= TWOPI;
-		else if (con > PI)
-			lam2 += TWOPI;
-		P->lam0 = adjlon(.5 * (lam1 + lam2) - atan(
-		   J * tan(.5 * P->B * (lam1 - lam2)) / p) / P->B);
-		gamma0 = atan(2. * sin(P->B * adjlon(lam1 - P->lam0)) /
-		   (F - 1. / F));
-		gamma = alpha_c = asin(D * sin(gamma0));
-	}
-	P->singam = sin(gamma0);
-	P->cosgam = cos(gamma0);
-	P->sinrot = sin(gamma);
-	P->cosrot = cos(gamma);
-	P->BrA = 1. / (P->ArB = P->A * (P->rB = 1. / P->B));
-	P->AB = P->A * P->B;
-	if (no_off)
-		P->u_0 = 0;
-	else {
-		P->u_0 = fabs(P->ArB * atan2(sqrt(D * D - 1.), cos(alpha_c)));
-		if (P->phi0 < 0.)
-			P->u_0 = - P->u_0;
-	}
-	F = 0.5 * gamma0;
-	P->v_pole_n = P->ArB * log(tan(FORTPI - F));
-	P->v_pole_s = P->ArB * log(tan(FORTPI + F));
-	P->inv = e_inverse;
-	P->fwd = e_forward;
-ENDENTRY(P)
diff --git a/src/proj/PJ_ortho.c b/src/proj/PJ_ortho.c
deleted file mode 100644
index 202b017..0000000
--- a/src/proj/PJ_ortho.c
+++ /dev/null
@@ -1,95 +0,0 @@
-#define PROJ_PARMS__ \
-	double	sinph0; \
-	double	cosph0; \
-	int		mode;
-#define PJ_LIB__
-#include	<projects.h>
-PROJ_HEAD(ortho, "Orthographic") "\n\tAzi, Sph.";
-#define EPS10 1.e-10
-#define N_POLE	0
-#define S_POLE 1
-#define EQUIT	2
-#define OBLIQ	3
-FORWARD(s_forward); /* spheroid */
-	double  coslam, cosphi, sinphi;
-
-	cosphi = cos(lp.phi);
-	coslam = cos(lp.lam);
-	switch (P->mode) {
-	case EQUIT:
-		if (cosphi * coslam < - EPS10) F_ERROR;
-		xy.y = sin(lp.phi);
-		break;
-	case OBLIQ:
-		if (P->sinph0 * (sinphi = sin(lp.phi)) +
-		   P->cosph0 * cosphi * coslam < - EPS10) F_ERROR;
-		xy.y = P->cosph0 * sinphi - P->sinph0 * cosphi * coslam;
-		break;
-	case N_POLE:
-		coslam = - coslam;
-	case S_POLE:
-		if (fabs(lp.phi - P->phi0) - EPS10 > HALFPI) F_ERROR;
-		xy.y = cosphi * coslam;
-		break;
-	}
-	xy.x = cosphi * sin(lp.lam);
-	return (xy);
-}
-
-INVERSE(s_inverse); /* spheroid */
-    double  rh, cosc, sinc;
-
-    if ((sinc = (rh = hypot(xy.x, xy.y))) > 1.) {
-        if ((sinc - 1.) > EPS10) I_ERROR;
-        sinc = 1.;
-    }
-    cosc = sqrt(1. - sinc * sinc); /* in this range OK */
-    if (fabs(rh) <= EPS10) {
-        lp.phi = P->phi0;
-        lp.lam = 0.0;
-    } else {
-        switch (P->mode) {
-        case N_POLE:
-            xy.y = -xy.y;
-            lp.phi = acos(sinc);
-            break;
-        case S_POLE:
-            lp.phi = - acos(sinc);
-            break;
-        case EQUIT:
-            lp.phi = xy.y * sinc / rh;
-            xy.x *= sinc;
-            xy.y = cosc * rh;
-            goto sinchk;
-        case OBLIQ:
-            lp.phi = cosc * P->sinph0 + xy.y * sinc * P->cosph0 /rh;
-            xy.y = (cosc - P->sinph0 * lp.phi) * rh;
-            xy.x *= sinc * P->cosph0;
-        sinchk:
-            if (fabs(lp.phi) >= 1.)
-                lp.phi = lp.phi < 0. ? -HALFPI : HALFPI;
-            else
-                lp.phi = asin(lp.phi);
-            break;
-        }
-        lp.lam = (xy.y == 0. && (P->mode == OBLIQ || P->mode == EQUIT))
-             ? (xy.x == 0. ? 0. : xy.x < 0. ? -HALFPI : HALFPI)
-                           : atan2(xy.x, xy.y);
-    }
-    return (lp);
-}
-
-FREEUP; if (P) pj_dalloc(P); }
-ENTRY0(ortho)
-	if (fabs(fabs(P->phi0) - HALFPI) <= EPS10)
-		P->mode = P->phi0 < 0. ? S_POLE : N_POLE;
-	else if (fabs(P->phi0) > EPS10) {
-		P->mode = OBLIQ;
-		P->sinph0 = sin(P->phi0);
-		P->cosph0 = cos(P->phi0);
-	} else
-		P->mode = EQUIT;
-	P->inv = s_inverse;
-	P->fwd = s_forward;
-	P->es = 0.;
-ENDENTRY(P)
diff --git a/src/proj/PJ_poly.c b/src/proj/PJ_poly.c
deleted file mode 100644
index ef5b890..0000000
--- a/src/proj/PJ_poly.c
+++ /dev/null
@@ -1,99 +0,0 @@
-#define PROJ_PARMS__ \
-	double ml0; \
-	double *en;
-#define PJ_LIB__
-#include <projects.h>
-PROJ_HEAD(poly, "Polyconic (American)")
-	"\n\tConic, Sph&Ell";
-#define TOL	1e-10
-#define CONV	1e-10
-#define N_ITER	10
-#define I_ITER 20
-#define ITOL 1.e-12
-FORWARD(e_forward); /* ellipsoid */
-	double  ms, sp, cp;
-
-	if (fabs(lp.phi) <= TOL) { xy.x = lp.lam; xy.y = -P->ml0; }
-	else {
-		sp = sin(lp.phi);
-		ms = fabs(cp = cos(lp.phi)) > TOL ? pj_msfn(sp, cp, P->es) / sp : 0.;
-		xy.x = ms * sin(lp.lam *= sp);
-		xy.y = (pj_mlfn(lp.phi, sp, cp, P->en) - P->ml0) + ms * (1. - cos(lp.lam));
-	}
-	return (xy);
-}
-FORWARD(s_forward); /* spheroid */
-	double  cot, E;
-
-	if (fabs(lp.phi) <= TOL) { xy.x = lp.lam; xy.y = P->ml0; }
-	else {
-		cot = 1. / tan(lp.phi);
-		xy.x = sin(E = lp.lam * sin(lp.phi)) * cot;
-		xy.y = lp.phi - P->phi0 + cot * (1. - cos(E));
-	}
-	return (xy);
-}
-INVERSE(e_inverse); /* ellipsoid */
-	xy.y += P->ml0;
-	if (fabs(xy.y) <= TOL) { lp.lam = xy.x; lp.phi = 0.; }
-	else {
-		double r, c, sp, cp, s2ph, ml, mlb, mlp, dPhi;
-		int i;
-
-		r = xy.y * xy.y + xy.x * xy.x;
-		for (lp.phi = xy.y, i = I_ITER; i ; --i) {
-			sp = sin(lp.phi);
-			s2ph = sp * ( cp = cos(lp.phi));
-			if (fabs(cp) < ITOL)
-				I_ERROR;
-			c = sp * (mlp = sqrt(1. - P->es * sp * sp)) / cp;
-			ml = pj_mlfn(lp.phi, sp, cp, P->en);
-			mlb = ml * ml + r;
-			mlp = P->one_es / (mlp * mlp * mlp);
-			lp.phi += ( dPhi =
-				( ml + ml + c * mlb - 2. * xy.y * (c * ml + 1.) ) / (
-				P->es * s2ph * (mlb - 2. * xy.y * ml) / c +
-				2.* (xy.y - ml) * (c * mlp - 1. / s2ph) - mlp - mlp ));
-			if (fabs(dPhi) <= ITOL)
-				break;
-		}
-		if (!i)
-			I_ERROR;
-		c = sin(lp.phi);
-		lp.lam = asin(xy.x * tan(lp.phi) * sqrt(1. - P->es * c * c)) / sin(lp.phi);
-	}
-	return (lp);
-}
-INVERSE(s_inverse); /* spheroid */
-	double B, dphi, tp;
-	int i;
-
-	if (fabs(xy.y = P->phi0 + xy.y) <= TOL) { lp.lam = xy.x; lp.phi = 0.; }
-	else {
-		lp.phi = xy.y;
-		B = xy.x * xy.x + xy.y * xy.y;
-		i = N_ITER;
-		do {
-			tp = tan(lp.phi);
-			lp.phi -= (dphi = (xy.y * (lp.phi * tp + 1.) - lp.phi -
-				.5 * ( lp.phi * lp.phi + B) * tp) /
-				((lp.phi - xy.y) / tp - 1.));
-		} while (fabs(dphi) > CONV && --i);
-		if (! i) I_ERROR;
-		lp.lam = asin(xy.x * tan(lp.phi)) / sin(lp.phi);
-	}
-	return (lp);
-}
-FREEUP; if (P) { if (P->en) pj_dalloc(P->en); pj_dalloc(P); } }
-ENTRY1(poly, en)
-	if (P->es) {
-		if (!(P->en = pj_enfn(P->es))) E_ERROR_0;
-		P->ml0 = pj_mlfn(P->phi0, sin(P->phi0), cos(P->phi0), P->en);
-		P->inv = e_inverse;
-		P->fwd = e_forward;
-	} else {
-		P->ml0 = -P->phi0;
-		P->inv = s_inverse;
-		P->fwd = s_forward;
-	}
-ENDENTRY(P)
diff --git a/src/proj/PJ_putp2.c b/src/proj/PJ_putp2.c
deleted file mode 100644
index 33bc67a..0000000
--- a/src/proj/PJ_putp2.c
+++ /dev/null
@@ -1,40 +0,0 @@
-#define PJ_LIB__
-#include	<projects.h>
-PROJ_HEAD(putp2, "Putnins P2") "\n\tPCyl., Sph.";
-#define C_x	1.89490
-#define C_y	1.71848
-#define C_p 0.6141848493043784
-#define EPS	1e-10
-#define NITER	10
-#define PI_DIV_3	1.0471975511965977
-FORWARD(s_forward); /* spheroid */
-	double p, c, s, V;
-	int i;
-
-	p = C_p * sin(lp.phi);
-	s = lp.phi * lp.phi;
-	lp.phi *= 0.615709 + s * ( 0.00909953 + s * 0.0046292 );
-	for (i = NITER; i ; --i) {
-		c = cos(lp.phi);
-		s = sin(lp.phi);
-		lp.phi -= V = (lp.phi + s * (c - 1.) - p) /
-			(1. + c * (c - 1.) - s * s);
-		if (fabs(V) < EPS)
-			break;
-	}
-	if (!i)
-		lp.phi = lp.phi < 0 ? - PI_DIV_3 : PI_DIV_3;
-	xy.x = C_x * lp.lam * (cos(lp.phi) - 0.5);
-	xy.y = C_y * sin(lp.phi);
-	return (xy);
-}
-INVERSE(s_inverse); /* spheroid */
-	double c;
-
-	lp.phi = aasin(P->ctx,xy.y / C_y);
-	lp.lam = xy.x / (C_x * ((c = cos(lp.phi)) - 0.5));
-	lp.phi = aasin(P->ctx,(lp.phi + sin(lp.phi) * (c - 1.)) / C_p);
-	return (lp);
-}
-FREEUP; if (P) pj_dalloc(P); }
-ENTRY0(putp2) P->es = 0.; P->inv = s_inverse; P->fwd = s_forward; ENDENTRY(P)
diff --git a/src/proj/PJ_putp3.c b/src/proj/PJ_putp3.c
deleted file mode 100644
index 46e2500..0000000
--- a/src/proj/PJ_putp3.c
+++ /dev/null
@@ -1,26 +0,0 @@
-#define PROJ_PARMS__ \
-	double	A;
-#define PJ_LIB__
-# include	<projects.h>
-PROJ_HEAD(putp3, "Putnins P3") "\n\tPCyl., Sph.";
-PROJ_HEAD(putp3p, "Putnins P3'") "\n\tPCyl., no inv., Sph.";
-#define C	0.79788456
-#define RPISQ	0.1013211836
-FORWARD(s_forward); /* spheroid */
-	xy.x = C * lp.lam * (1. - P->A * lp.phi * lp.phi);
-	xy.y = C * lp.phi;
-	return (xy);
-}
-INVERSE(s_inverse); /* spheroid */
-	lp.phi = xy.y / C;
-	lp.lam = xy.x / (C * (1. - P->A * lp.phi * lp.phi));
-	return (lp);
-}
-FREEUP; if (P) pj_dalloc(P); }
-	static PJ *
-setup(PJ *P) {
-	P->es = 0.; P->inv = s_inverse; P->fwd = s_forward;
-	return P;
-}
-ENTRY0(putp3)  P->A = 4. * RPISQ; ENDENTRY(setup(P))
-ENTRY0(putp3p) P->A = 2. * RPISQ; ENDENTRY(setup(P))
diff --git a/src/proj/PJ_putp4p.c b/src/proj/PJ_putp4p.c
deleted file mode 100644
index 32036bb..0000000
--- a/src/proj/PJ_putp4p.c
+++ /dev/null
@@ -1,29 +0,0 @@
-#define PROJ_PARMS__ \
-	double	C_x, C_y;
-#define PJ_LIB__
-# include	<projects.h>
-PROJ_HEAD(putp4p, "Putnins P4'") "\n\tPCyl., Sph.";
-PROJ_HEAD(weren, "Werenskiold I") "\n\tPCyl., Sph.";
-FORWARD(s_forward); /* spheroid */
-	lp.phi = aasin(P->ctx,0.883883476 * sin(lp.phi));
-	xy.x = P->C_x * lp.lam * cos(lp.phi);
-	xy.x /= cos(lp.phi *= 0.333333333333333);
-	xy.y = P->C_y * sin(lp.phi);
-	return (xy);
-}
-INVERSE(s_inverse); /* spheroid */
-	lp.phi = aasin(P->ctx,xy.y / P->C_y);
-	lp.lam = xy.x * cos(lp.phi) / P->C_x;
-	lp.phi *= 3.;
-	lp.lam /= cos(lp.phi);
-	lp.phi = aasin(P->ctx,1.13137085 * sin(lp.phi));
-	return (lp);
-}
-FREEUP; if (P) pj_dalloc(P); }
-	static PJ *
-setup(PJ *P) {
-	P->es = 0.; P->inv = s_inverse; P->fwd = s_forward;
-	return P;
-}
-ENTRY0(putp4p) P->C_x = 0.874038744; P->C_y = 3.883251825; ENDENTRY(setup(P))
-ENTRY0(weren) P->C_x = 1.; P->C_y = 4.442882938; ENDENTRY(setup(P))
diff --git a/src/proj/PJ_putp5.c b/src/proj/PJ_putp5.c
deleted file mode 100644
index 8d3c59a..0000000
--- a/src/proj/PJ_putp5.c
+++ /dev/null
@@ -1,26 +0,0 @@
-#define PROJ_PARMS__ \
-	double	A, B;
-#define PJ_LIB__
-# include	<projects.h>
-PROJ_HEAD(putp5, "Putnins P5") "\n\tPCyl., Sph.";
-PROJ_HEAD(putp5p, "Putnins P5'") "\n\tPCyl., Sph.";
-#define C	1.01346
-#define D	1.2158542
-FORWARD(s_forward); /* spheroid */
-	xy.x = C * lp.lam * (P->A - P->B * sqrt(1. + D * lp.phi * lp.phi));
-	xy.y = C * lp.phi;
-	return (xy);
-}
-INVERSE(s_inverse); /* spheroid */
-	lp.phi = xy.y / C;
-	lp.lam = xy.x / (C * (P->A - P->B * sqrt(1. + D * lp.phi * lp.phi)));
-	return (lp);
-}
-FREEUP; if (P) pj_dalloc(P); }
-	static PJ *
-setup(PJ *P) {
-	P->es = 0.; P->inv = s_inverse; P->fwd = s_forward;
-	return P;
-}
-ENTRY0(putp5) P->A = 2.; P->B = 1.; ENDENTRY(setup(P))
-ENTRY0(putp5p) P->A = 1.5; P->B = 0.5; ENDENTRY(setup(P))
diff --git a/src/proj/PJ_putp6.c b/src/proj/PJ_putp6.c
deleted file mode 100644
index 5909dd4..0000000
--- a/src/proj/PJ_putp6.c
+++ /dev/null
@@ -1,59 +0,0 @@
-#define PROJ_PARMS__ \
-	double C_x, C_y, A, B, D;
-#define PJ_LIB__
-#include	<projects.h>
-PROJ_HEAD(putp6, "Putnins P6") "\n\tPCyl., Sph.";
-PROJ_HEAD(putp6p, "Putnins P6'") "\n\tPCyl., Sph.";
-#define EPS	1e-10
-#define NITER	10
-#define CON_POLE 1.732050807568877
-FORWARD(s_forward); /* spheroid */
-	double p, r, V;
-	int i;
-
-	p = P->B * sin(lp.phi);
-	lp.phi *=  1.10265779;
-	for (i = NITER; i ; --i) {
-		r = sqrt(1. + lp.phi * lp.phi);
-		lp.phi -= V = ( (P->A - r) * lp.phi - log(lp.phi + r) - p ) /
-			(P->A - 2. * r);
-		if (fabs(V) < EPS)
-			break;
-	}
-	if (!i)
-		lp.phi = p < 0. ? -CON_POLE : CON_POLE;
-	xy.x = P->C_x * lp.lam * (P->D - sqrt(1. + lp.phi * lp.phi));
-	xy.y = P->C_y * lp.phi;
-	return (xy);
-}
-INVERSE(s_inverse); /* spheroid */
-	double r;
-
-	lp.phi = xy.y / P->C_y;
-	r = sqrt(1. + lp.phi * lp.phi);
-	lp.lam = xy.x / (P->C_x * (P->D - r));
-	lp.phi = aasin( P->ctx, ( (P->A - r) * lp.phi - log(lp.phi + r) ) / P->B);
-	return (lp);
-}
-FREEUP; if (P) pj_dalloc(P); }
-	static PJ *
-setup(PJ *P) {
-	P->es = 0.;
-	P->inv = s_inverse;
-	P->fwd = s_forward;
-	return P;
-}
-ENTRY0(putp6)
-	P->C_x = 1.01346;
-	P->C_y = 0.91910;
-	P->A   = 4.;
-	P->B   = 2.1471437182129378784;
-	P->D   = 2.;
-ENDENTRY(setup(P))
-ENTRY0(putp6p)
-	P->C_x = 0.44329;
-	P->C_y = 0.80404;
-	P->A   = 6.;
-	P->B   = 5.61125;
-	P->D   = 3.;
-ENDENTRY(setup(P))
diff --git a/src/proj/PJ_robin.c b/src/proj/PJ_robin.c
deleted file mode 100644
index 71dac1e..0000000
--- a/src/proj/PJ_robin.c
+++ /dev/null
@@ -1,105 +0,0 @@
-#define PJ_LIB__
-#include	<projects.h>
-PROJ_HEAD(robin, "Robinson") "\n\tPCyl., Sph.";
-#define V(C,z) (C.c0 + z * (C.c1 + z * (C.c2 + z * C.c3)))
-#define DV(C,z) (C.c1 + z * (C.c2 + C.c2 + z * 3. * C.c3))
-/* note: following terms based upon 5 deg. intervals in degrees. */
-static struct COEFS {
-	float c0, c1, c2, c3;
-} X[] = {
-    {1,	-5.67239e-12,	-7.15511e-05,	3.11028e-06},
-    {0.9986,	-0.000482241,	-2.4897e-05,	-1.33094e-06},
-    {0.9954,	-0.000831031,	-4.4861e-05,	-9.86588e-07},
-    {0.99,	-0.00135363,	-5.96598e-05,	3.67749e-06},
-    {0.9822,	-0.00167442,	-4.4975e-06,	-5.72394e-06},
-    {0.973,	-0.00214869,	-9.03565e-05,	1.88767e-08},
-    {0.96,	-0.00305084,	-9.00732e-05,	1.64869e-06},
-    {0.9427,	-0.00382792,	-6.53428e-05,	-2.61493e-06},
-    {0.9216,	-0.00467747,	-0.000104566,	4.8122e-06},
-    {0.8962,	-0.00536222,	-3.23834e-05,	-5.43445e-06},
-    {0.8679,	-0.00609364,	-0.0001139,	3.32521e-06},
-    {0.835,	-0.00698325,	-6.40219e-05,	9.34582e-07},
-    {0.7986,	-0.00755337,	-5.00038e-05,	9.35532e-07},
-    {0.7597,	-0.00798325,	-3.59716e-05,	-2.27604e-06},
-    {0.7186,	-0.00851366,	-7.0112e-05,	-8.63072e-06},
-    {0.6732,	-0.00986209,	-0.000199572,	1.91978e-05},
-    {0.6213,	-0.010418,	8.83948e-05,	6.24031e-06},
-    {0.5722,	-0.00906601,	0.000181999,	6.24033e-06},
-    {0.5322, 0.,0.,0.}  },
-Y[] = {
-    {0,	0.0124,	3.72529e-10,	1.15484e-09},
-    {0.062,	0.0124001,	1.76951e-08,	-5.92321e-09},
-    {0.124,	0.0123998,	-7.09668e-08,	2.25753e-08},
-    {0.186,	0.0124008,	2.66917e-07,	-8.44523e-08},
-    {0.248,	0.0123971,	-9.99682e-07,	3.15569e-07},
-    {0.31,	0.0124108,	3.73349e-06,	-1.1779e-06},
-    {0.372,	0.0123598,	-1.3935e-05,	4.39588e-06},
-    {0.434,	0.0125501,	5.20034e-05,	-1.00051e-05},
-    {0.4958,	0.0123198,	-9.80735e-05,	9.22397e-06},
-    {0.5571,	0.0120308,	4.02857e-05,	-5.2901e-06},
-    {0.6176,	0.0120369,	-3.90662e-05,	7.36117e-07},
-    {0.6769,	0.0117015,	-2.80246e-05,	-8.54283e-07},
-    {0.7346,	0.0113572,	-4.08389e-05,	-5.18524e-07},
-    {0.7903,	0.0109099,	-4.86169e-05,	-1.0718e-06},
-    {0.8435,	0.0103433,	-6.46934e-05,	5.36384e-09},
-    {0.8936,	0.00969679,	-6.46129e-05,	-8.54894e-06},
-    {0.9394,	0.00840949,	-0.000192847,	-4.21023e-06},
-    {0.9761,	0.00616525,	-0.000256001,	-4.21021e-06},
-    {1., 0.,0.,0} };
-#define FXC	0.8487
-#define FYC	1.3523
-#define C1	11.45915590261646417544
-#define RC1	0.08726646259971647884
-#define NODES	18
-#define ONEEPS	1.000001
-#define EPS	1e-8
-FORWARD(s_forward); /* spheroid */
-	int i;
-	double dphi;
-
-	i = floor((dphi = fabs(lp.phi)) * C1);
-	if (i >= NODES) i = NODES - 1;
-	dphi = RAD_TO_DEG * (dphi - RC1 * i);
-	xy.x = V(X[i], dphi) * FXC * lp.lam;
-	xy.y = V(Y[i], dphi) * FYC;
-	if (lp.phi < 0.) xy.y = -xy.y;
-	return (xy);
-}
-INVERSE(s_inverse); /* spheroid */
-	int i;
-	double t, t1;
-	struct COEFS T;
-
-	lp.lam = xy.x / FXC;
-	lp.phi = fabs(xy.y / FYC);
-	if (lp.phi >= 1.) { /* simple pathologic cases */
-		if (lp.phi > ONEEPS) I_ERROR
-		else {
-			lp.phi = xy.y < 0. ? -HALFPI : HALFPI;
-			lp.lam /= X[NODES].c0;
-		}
-	} else { /* general problem */
-		/* in Y space, reduce to table interval */
-		for (i = floor(lp.phi * NODES);;) {
-			if (Y[i].c0 > lp.phi) --i;
-			else if (Y[i+1].c0 <= lp.phi) ++i;
-			else break;
-		}
-		T = Y[i];
-		/* first guess, linear interp */
-		t = 5. * (lp.phi - T.c0)/(Y[i+1].c0 - T.c0);
-		/* make into root */
-		T.c0 -= lp.phi;
-		for (;;) { /* Newton-Raphson reduction */
-			t -= t1 = V(T,t) / DV(T,t);
-			if (fabs(t1) < EPS)
-				break;
-		}
-		lp.phi = (5 * i + t) * DEG_TO_RAD;
-		if (xy.y < 0.) lp.phi = -lp.phi;
-		lp.lam /= V(X[i], t);
-	}
-	return (lp);
-}
-FREEUP; if (P) pj_dalloc(P); }
-ENTRY0(robin) P->es = 0.; P->inv = s_inverse; P->fwd = s_forward; ENDENTRY(P)
diff --git a/src/proj/PJ_rpoly.c b/src/proj/PJ_rpoly.c
deleted file mode 100644
index 7a7670e..0000000
--- a/src/proj/PJ_rpoly.c
+++ /dev/null
@@ -1,35 +0,0 @@
-#define PROJ_PARMS__ \
-	double	phi1; \
-	double	fxa; \
-	double	fxb; \
-	int		mode;
-#define EPS	1e-9
-#define PJ_LIB__
-#include	<projects.h>
-PROJ_HEAD(rpoly, "Rectangular Polyconic")
-	"\n\tConic, Sph., no inv.\n\tlat_ts=";
-FORWARD(s_forward); /* spheroid */
-	double fa;
-
-	if (P->mode)
-		fa = tan(lp.lam * P->fxb) * P->fxa;
-	else
-		fa = 0.5 * lp.lam;
-	if (fabs(lp.phi) < EPS) {
-		xy.x = fa + fa;
-		xy.y = - P->phi0;
-	} else {
-		xy.y = 1. / tan(lp.phi);
-		xy.x = sin(fa = 2. * atan(fa * sin(lp.phi))) * xy.y;
-		xy.y = lp.phi - P->phi0 + (1. - cos(fa)) * xy.y;
-	}
-	return (xy);
-}
-FREEUP; if (P) pj_dalloc(P); }
-ENTRY0(rpoly)
-	if ((P->mode = (P->phi1 = fabs(pj_param(P->ctx, P->params, "rlat_ts").f)) > EPS)) {
-		P->fxb = 0.5 * sin(P->phi1);
-		P->fxa = 0.5 / P->fxb;
-	}
-	P->es = 0.; P->fwd = s_forward;
-ENDENTRY(P)
diff --git a/src/proj/PJ_sconics.c b/src/proj/PJ_sconics.c
deleted file mode 100644
index 8c17533..0000000
--- a/src/proj/PJ_sconics.c
+++ /dev/null
@@ -1,154 +0,0 @@
-#define PROJ_PARMS__ \
-	double	n; \
-	double	rho_c; \
-	double	rho_0; \
-	double	sig; \
-	double	c1, c2; \
-	int		type;
-#define PJ_LIB__
-#include	<projects.h>
-#define EULER 0
-#define MURD1 1
-#define MURD2 2
-#define MURD3 3
-#define PCONIC 4
-#define TISSOT 5
-#define VITK1 6
-#define EPS10	1.e-10
-#define EPS 1e-10
-#define LINE2 "\n\tConic, Sph\n\tlat_1= and lat_2="
-PROJ_HEAD(tissot, "Tissot")
-	LINE2;
-PROJ_HEAD(murd1, "Murdoch I")
-	LINE2;
-PROJ_HEAD(murd2, "Murdoch II")
-	LINE2;
-PROJ_HEAD(murd3, "Murdoch III")
-	LINE2;
-PROJ_HEAD(euler, "Euler")
-	LINE2;
-PROJ_HEAD(pconic, "Perspective Conic")
-	LINE2;
-PROJ_HEAD(vitk1, "Vitkovsky I")
-	LINE2;
-/* get common factors for simple conics */
-	static int
-phi12(PJ *P, double *del) {
-	double p1, p2;
-	int err = 0;
-
-	if (!pj_param(P->ctx, P->params, "tlat_1").i ||
-		!pj_param(P->ctx, P->params, "tlat_2").i) {
-		err = -41;
-	} else {
-		p1 = pj_param(P->ctx, P->params, "rlat_1").f;
-		p2 = pj_param(P->ctx, P->params, "rlat_2").f;
-		*del = 0.5 * (p2 - p1);
-		P->sig = 0.5 * (p2 + p1);
-		err = (fabs(*del) < EPS || fabs(P->sig) < EPS) ? -42 : 0;
-		*del = *del;
-	}
-	return err;
-}
-FORWARD(s_forward); /* spheroid */
-	double rho;
-
-	switch (P->type) {
-	case MURD2:
-		rho = P->rho_c + tan(P->sig - lp.phi);
-		break;
-	case PCONIC:
-		rho = P->c2 * (P->c1 - tan(lp.phi - P->sig));
-		break;
-	default:
-		rho = P->rho_c - lp.phi;
-		break;
-	}
-	xy.x = rho * sin( lp.lam *= P->n );
-	xy.y = P->rho_0 - rho * cos(lp.lam);
-	return (xy);
-}
-INVERSE(s_inverse); /* ellipsoid & spheroid */
-	double rho;
-
-	rho = hypot(xy.x, xy.y = P->rho_0 - xy.y);
-	if (P->n < 0.) {
-		rho = - rho;
-		xy.x = - xy.x;
-		xy.y = - xy.y;
-	}
-	lp.lam = atan2(xy.x, xy.y) / P->n;
-	switch (P->type) {
-	case PCONIC:
-		lp.phi = atan(P->c1 - rho / P->c2) + P->sig;
-		break;
-	case MURD2:
-		lp.phi = P->sig - atan(rho - P->rho_c);
-		break;
-	default:
-		lp.phi = P->rho_c - rho;
-	}
-	return (lp);
-}
-FREEUP; if (P) pj_dalloc(P); }
-	static PJ *
-setup(PJ *P) {
-	double del, cs;
-	int i;
-
-	if( (i = phi12(P, &del)) )
-		E_ERROR(i);
-	switch (P->type) {
-	case TISSOT:
-		P->n = sin(P->sig);
-		cs = cos(del);
-		P->rho_c = P->n / cs + cs / P->n;
-		P->rho_0 = sqrt((P->rho_c - 2 * sin(P->phi0))/P->n);
-		break;
-	case MURD1:
-		P->rho_c = sin(del)/(del * tan(P->sig)) + P->sig;
-		P->rho_0 = P->rho_c - P->phi0;
-		P->n = sin(P->sig);
-		break;
-	case MURD2:
-		P->rho_c = (cs = sqrt(cos(del))) / tan(P->sig);
-		P->rho_0 = P->rho_c + tan(P->sig - P->phi0);
-		P->n = sin(P->sig) * cs;
-		break;
-	case MURD3:
-		P->rho_c = del / (tan(P->sig) * tan(del)) + P->sig;
-		P->rho_0 = P->rho_c - P->phi0;
-		P->n = sin(P->sig) * sin(del) * tan(del) / (del * del);
-		break;
-	case EULER:
-		P->n = sin(P->sig) * sin(del) / del;
-		del *= 0.5;
-		P->rho_c = del / (tan(del) * tan(P->sig)) + P->sig;	
-		P->rho_0 = P->rho_c - P->phi0;
-		break;
-	case PCONIC:
-		P->n = sin(P->sig);
-		P->c2 = cos(del);
-		P->c1 = 1./tan(P->sig);
-		if (fabs(del = P->phi0 - P->sig) - EPS10 >= HALFPI)
-			E_ERROR(-43);
-		P->rho_0 = P->c2 * (P->c1 - tan(del));
-		break;
-	case VITK1:
-		P->n = (cs = tan(del)) * sin(P->sig) / del;
-		P->rho_c = del / (cs * tan(P->sig)) + P->sig;
-		P->rho_0 = P->rho_c - P->phi0;
-		break;
-	}
-	P->inv = s_inverse;
-	P->fwd = s_forward;
-	P->es = 0;
-	return (P);
-}
-ENTRY0(euler) P->type = EULER; ENDENTRY(setup(P))
-ENTRY0(tissot) P->type = TISSOT; ENDENTRY(setup(P))
-ENTRY0(murd1) P->type = MURD1; ENDENTRY(setup(P))
-ENTRY0(murd2) P->type = MURD2; ENDENTRY(setup(P))
-ENTRY0(murd3) P->type = MURD3; ENDENTRY(setup(P))
-ENTRY0(pconic) P->type = PCONIC; ENDENTRY(setup(P))
-ENTRY0(vitk1) P->type = VITK1; ENDENTRY(setup(P))
diff --git a/src/proj/PJ_somerc.c b/src/proj/PJ_somerc.c
deleted file mode 100644
index f7d1f11..0000000
--- a/src/proj/PJ_somerc.c
+++ /dev/null
@@ -1,66 +0,0 @@
-#define PROJ_PARMS__ \
-	double	K, c, hlf_e, kR, cosp0, sinp0;
-#define PJ_LIB__
-#include	<projects.h>
-PROJ_HEAD(somerc, "Swiss. Obl. Mercator") "\n\tCyl, Ell\n\tFor CH1903";
-#define EPS	1.e-10
-#define NITER 6
-FORWARD(e_forward);
-	double phip, lamp, phipp, lampp, sp, cp;
-
-	sp = P->e * sin(lp.phi);
-	phip = 2.* atan( exp( P->c * (
-		log(tan(FORTPI + 0.5 * lp.phi)) - P->hlf_e * log((1. + sp)/(1. - sp)))
-		+ P->K)) - HALFPI;
-	lamp = P->c * lp.lam;
-	cp = cos(phip);
-	phipp = aasin(P->ctx,P->cosp0 * sin(phip) - P->sinp0 * cp * cos(lamp));
-	lampp = aasin(P->ctx,cp * sin(lamp) / cos(phipp));
-	xy.x = P->kR * lampp;
-	xy.y = P->kR * log(tan(FORTPI + 0.5 * phipp));
-	return (xy);
-}
-INVERSE(e_inverse); /* ellipsoid & spheroid */
-	double phip, lamp, phipp, lampp, cp, esp, con, delp;
-	int i;
-
-	phipp = 2. * (atan(exp(xy.y / P->kR)) - FORTPI);
-	lampp = xy.x / P->kR;
-	cp = cos(phipp);
-	phip = aasin(P->ctx,P->cosp0 * sin(phipp) + P->sinp0 * cp * cos(lampp));
-	lamp = aasin(P->ctx,cp * sin(lampp) / cos(phip));
-	con = (P->K - log(tan(FORTPI + 0.5 * phip)))/P->c;
-	for (i = NITER; i ; --i) {
-		esp = P->e * sin(phip);
-		delp = (con + log(tan(FORTPI + 0.5 * phip)) - P->hlf_e *
-			log((1. + esp)/(1. - esp)) ) *
-			(1. - esp * esp) * cos(phip) * P->rone_es;
-		phip -= delp;
-		if (fabs(delp) < EPS)
-			break;
-	}
-	if (i) {
-		lp.phi = phip;
-		lp.lam = lamp / P->c;
-	} else
-		I_ERROR
-	return (lp);
-}
-FREEUP; if (P) pj_dalloc(P); }
-ENTRY0(somerc)
-	double cp, phip0, sp;
-
-	P->hlf_e = 0.5 * P->e;
-	cp = cos(P->phi0);
-	cp *= cp;
-	P->c = sqrt(1 + P->es * cp * cp * P->rone_es);
-	sp = sin(P->phi0);
-	P->cosp0 = cos( phip0 = aasin(P->ctx, P->sinp0 = sp / P->c) );
-	sp *= P->e;
-	P->K = log(tan(FORTPI + 0.5 * phip0)) - P->c * (
-		log(tan(FORTPI + 0.5 * P->phi0)) - P->hlf_e *
-		log((1. + sp) / (1. - sp)));
-	P->kR = P->k0 * sqrt(P->one_es) / (1. - sp * sp);
-	P->inv = e_inverse;
-	P->fwd = e_forward;
-ENDENTRY(P)
diff --git a/src/proj/PJ_stere.c b/src/proj/PJ_stere.c
deleted file mode 100644
index 52ec1df..0000000
--- a/src/proj/PJ_stere.c
+++ /dev/null
@@ -1,241 +0,0 @@
-#define PROJ_PARMS__ \
-	double phits; \
-	double sinX1; \
-	double cosX1; \
-	double akm1; \
-	int	mode;
-#define PJ_LIB__
-#include	<projects.h>
-PROJ_HEAD(stere, "Stereographic") "\n\tAzi, Sph&Ell\n\tlat_ts=";
-PROJ_HEAD(ups, "Universal Polar Stereographic") "\n\tAzi, Sph&Ell\n\tsouth";
-#define sinph0	P->sinX1
-#define cosph0	P->cosX1
-#define EPS10	1.e-10
-#define TOL	1.e-8
-#define NITER	8
-#define CONV	1.e-10
-#define S_POLE	0
-#define N_POLE	1
-#define OBLIQ	2
-#define EQUIT	3
-	static double
-ssfn_(double phit, double sinphi, double eccen) {
-	sinphi *= eccen;
-	return (tan (.5 * (HALFPI + phit)) *
-	   pow((1. - sinphi) / (1. + sinphi), .5 * eccen));
-}
-FORWARD(e_forward); /* ellipsoid */
-	double coslam, sinlam, sinX=0.0, cosX=0.0, X, A, sinphi;
-
-	coslam = cos(lp.lam);
-	sinlam = sin(lp.lam);
-	sinphi = sin(lp.phi);
-	if (P->mode == OBLIQ || P->mode == EQUIT) {
-		sinX = sin(X = 2. * atan(ssfn_(lp.phi, sinphi, P->e)) - HALFPI);
-		cosX = cos(X);
-	}
-	switch (P->mode) {
-	case OBLIQ:
-		A = P->akm1 / (P->cosX1 * (1. + P->sinX1 * sinX +
-		   P->cosX1 * cosX * coslam));
-		xy.y = A * (P->cosX1 * sinX - P->sinX1 * cosX * coslam);
-		goto xmul;
-	case EQUIT:
-		A = 2. * P->akm1 / (1. + cosX * coslam);
-		xy.y = A * sinX;
-xmul:
-		xy.x = A * cosX;
-		break;
-	case S_POLE:
-		lp.phi = -lp.phi;
-		coslam = - coslam;
-		sinphi = -sinphi;
-	case N_POLE:
-		xy.x = P->akm1 * pj_tsfn(lp.phi, sinphi, P->e);
-		xy.y = - xy.x * coslam;
-		break;
-	}
-	xy.x = xy.x * sinlam;
-	return (xy);
-}
-FORWARD(s_forward); /* spheroid */
-	double  sinphi, cosphi, coslam, sinlam;
-
-	sinphi = sin(lp.phi);
-	cosphi = cos(lp.phi);
-	coslam = cos(lp.lam);
-	sinlam = sin(lp.lam);
-	switch (P->mode) {
-	case EQUIT:
-		xy.y = 1. + cosphi * coslam;
-		goto oblcon;
-	case OBLIQ:
-		xy.y = 1. + sinph0 * sinphi + cosph0 * cosphi * coslam;
-oblcon:
-		if (xy.y <= EPS10) F_ERROR;
-		xy.x = (xy.y = P->akm1 / xy.y) * cosphi * sinlam;
-		xy.y *= (P->mode == EQUIT) ? sinphi :
-		   cosph0 * sinphi - sinph0 * cosphi * coslam;
-		break;
-	case N_POLE:
-		coslam = - coslam;
-		lp.phi = - lp.phi;
-	case S_POLE:
-		if (fabs(lp.phi - HALFPI) < TOL) F_ERROR;
-		xy.x = sinlam * ( xy.y = P->akm1 * tan(FORTPI + .5 * lp.phi) );
-		xy.y *= coslam;
-		break;
-	}
-	return (xy);
-}
-INVERSE(e_inverse); /* ellipsoid */
-	double cosphi, sinphi, tp=0.0, phi_l=0.0, rho, halfe=0.0, halfpi=0.0;
-	int i;
-
-	rho = hypot(xy.x, xy.y);
-	switch (P->mode) {
-	case OBLIQ:
-	case EQUIT:
-		cosphi = cos( tp = 2. * atan2(rho * P->cosX1 , P->akm1) );
-		sinphi = sin(tp);
-                if( rho == 0.0 )
-		    phi_l = asin(cosphi * P->sinX1);
-                else
-		    phi_l = asin(cosphi * P->sinX1 + (xy.y * sinphi * P->cosX1 / rho));
-
-		tp = tan(.5 * (HALFPI + phi_l));
-		xy.x *= sinphi;
-		xy.y = rho * P->cosX1 * cosphi - xy.y * P->sinX1* sinphi;
-		halfpi = HALFPI;
-		halfe = .5 * P->e;
-		break;
-	case N_POLE:
-		xy.y = -xy.y;
-	case S_POLE:
-		phi_l = HALFPI - 2. * atan(tp = - rho / P->akm1);
-		halfpi = -HALFPI;
-		halfe = -.5 * P->e;
-		break;
-	}
-	for (i = NITER; i--; phi_l = lp.phi) {
-		sinphi = P->e * sin(phi_l);
-		lp.phi = 2. * atan(tp * pow((1.+sinphi)/(1.-sinphi),
-		   halfe)) - halfpi;
-		if (fabs(phi_l - lp.phi) < CONV) {
-			if (P->mode == S_POLE)
-				lp.phi = -lp.phi;
-			lp.lam = (xy.x == 0. && xy.y == 0.) ? 0. : atan2(xy.x, xy.y);
-			return (lp);
-		}
-	}
-	I_ERROR;
-}
-INVERSE(s_inverse); /* spheroid */
-	double  c, rh, sinc, cosc;
-
-	sinc = sin(c = 2. * atan((rh = hypot(xy.x, xy.y)) / P->akm1));
-	cosc = cos(c);
-	lp.lam = 0.;
-	switch (P->mode) {
-	case EQUIT:
-		if (fabs(rh) <= EPS10)
-			lp.phi = 0.;
-		else
-			lp.phi = asin(xy.y * sinc / rh);
-		if (cosc != 0. || xy.x != 0.)
-			lp.lam = atan2(xy.x * sinc, cosc * rh);
-		break;
-	case OBLIQ:
-		if (fabs(rh) <= EPS10)
-			lp.phi = P->phi0;
-		else
-			lp.phi = asin(cosc * sinph0 + xy.y * sinc * cosph0 / rh);
-		if ((c = cosc - sinph0 * sin(lp.phi)) != 0. || xy.x != 0.)
-			lp.lam = atan2(xy.x * sinc * cosph0, c * rh);
-		break;
-	case N_POLE:
-		xy.y = -xy.y;
-	case S_POLE:
-		if (fabs(rh) <= EPS10)
-			lp.phi = P->phi0;
-		else
-			lp.phi = asin(P->mode == S_POLE ? - cosc : cosc);
-		lp.lam = (xy.x == 0. && xy.y == 0.) ? 0. : atan2(xy.x, xy.y);
-		break;
-	}
-	return (lp);
-}
-FREEUP; if (P) pj_dalloc(P); }
-	static PJ *
-setup(PJ *P) { /* general initialization */
-	double t;
-
-	if (fabs((t = fabs(P->phi0)) - HALFPI) < EPS10)
-		P->mode = P->phi0 < 0. ? S_POLE : N_POLE;
-	else
-		P->mode = t > EPS10 ? OBLIQ : EQUIT;
-	P->phits = fabs(P->phits);
-	if (P->es) {
-		double X;
-
-		switch (P->mode) {
-		case N_POLE:
-		case S_POLE:
-			if (fabs(P->phits - HALFPI) < EPS10)
-				P->akm1 = 2. * P->k0 /
-				   sqrt(pow(1+P->e,1+P->e)*pow(1-P->e,1-P->e));
-			else {
-				P->akm1 = cos(P->phits) /
-				   pj_tsfn(P->phits, t = sin(P->phits), P->e);
-				t *= P->e;
-				P->akm1 /= sqrt(1. - t * t);
-			}
-			break;
-		case EQUIT:
-			P->akm1 = 2. * P->k0;
-			break;
-		case OBLIQ:
-			t = sin(P->phi0);
-			X = 2. * atan(ssfn_(P->phi0, t, P->e)) - HALFPI;
-			t *= P->e;
-			P->akm1 = 2. * P->k0 * cos(P->phi0) / sqrt(1. - t * t);
-			P->sinX1 = sin(X);
-			P->cosX1 = cos(X);
-			break;
-		}
-		P->inv = e_inverse;
-		P->fwd = e_forward;
-	} else {
-		switch (P->mode) {
-		case OBLIQ:
-			sinph0 = sin(P->phi0);
-			cosph0 = cos(P->phi0);
-		case EQUIT:
-			P->akm1 = 2. * P->k0;
-			break;
-		case S_POLE:
-		case N_POLE:
-			P->akm1 = fabs(P->phits - HALFPI) >= EPS10 ?
-			   cos(P->phits) / tan(FORTPI - .5 * P->phits) :
-			   2. * P->k0 ;
-			break;
-		}
-		P->inv = s_inverse;
-		P->fwd = s_forward;
-	}
-	return P;
-}
-ENTRY0(stere)
-	P->phits = pj_param(P->ctx, P->params, "tlat_ts").i ?
-            pj_param(P->ctx, P->params, "rlat_ts").f : HALFPI;
-ENDENTRY(setup(P))
-ENTRY0(ups)
-	/* International Ellipsoid */
-	P->phi0 = pj_param(P->ctx, P->params, "bsouth").i ? - HALFPI: HALFPI;
-	if (!P->es) E_ERROR(-34);
-	P->k0 = .994;
-	P->x0 = 2000000.;
-	P->y0 = 2000000.;
-	P->phits = HALFPI;
-	P->lam0 = 0.;
-ENDENTRY(setup(P))
diff --git a/src/proj/PJ_sterea.c b/src/proj/PJ_sterea.c
deleted file mode 100644
index 4e82c47..0000000
--- a/src/proj/PJ_sterea.c
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
-** libproj -- library of cartographic projections
-**
-** Copyright (c) 2003   Gerald I. Evenden
-*/
-static const char
-LIBPROJ_ID[] = "$Id: PJ_sterea.c 1950 2012-05-10 16:51:51Z caress $";
-/*
-** Permission is hereby granted, free of charge, to any person obtaining
-** a copy of this software and associated documentation files (the
-** "Software"), to deal in the Software without restriction, including
-** without limitation the rights to use, copy, modify, merge, publish,
-** distribute, sublicense, and/or sell copies of the Software, and to
-** permit persons to whom the Software is furnished to do so, subject to
-** the following conditions:
-**
-** The above copyright notice and this permission notice shall be
-** included in all copies or substantial portions of the Software.
-**
-** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
-** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-** SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-*/
-#define PROJ_PARMS__ \
-	double phic0; \
-	double cosc0, sinc0; \
-	double R2; \
-	void *en;
-
-#define PJ_LIB__
-#include	<projects.h>
-
-PROJ_HEAD(sterea, "Oblique Stereographic Alternative")
-	"\n\tAzimuthal, Sph&Ell";
-# define DEL_TOL	1.e-14
-# define MAX_ITER	10
-
-FORWARD(e_forward); /* ellipsoid */
-	double cosc, sinc, cosl, k;
-
-	lp = pj_gauss(P->ctx, lp, P->en);
-	sinc = sin(lp.phi);
-	cosc = cos(lp.phi);
-	cosl = cos(lp.lam);
-	k = P->k0 * P->R2 / (1. + P->sinc0 * sinc + P->cosc0 * cosc * cosl);
-	xy.x = k * cosc * sin(lp.lam);
-	xy.y = k * (P->cosc0 * sinc - P->sinc0 * cosc * cosl);
-	return (xy);
-}
-INVERSE(e_inverse); /* ellipsoid */
-	double rho, c, sinc, cosc;
-
-	xy.x /= P->k0;
-	xy.y /= P->k0;
-	if((rho = hypot(xy.x, xy.y))) {
-		c = 2. * atan2(rho, P->R2);
-		sinc = sin(c);
-		cosc = cos(c);
-		lp.phi = asin(cosc * P->sinc0 + xy.y * sinc * P->cosc0 / rho);
-		lp.lam = atan2(xy.x * sinc, rho * P->cosc0 * cosc -
-			xy.y * P->sinc0 * sinc);
-	} else {
-		lp.phi = P->phic0;
-		lp.lam = 0.;
-	}
-	return(pj_inv_gauss(P->ctx, lp, P->en));
-}
-FREEUP; if (P) { if (P->en) free(P->en); free(P); } }
-ENTRYA(sterea)
-
-        P->en=0; 
-ENTRYX
-	double R;
-
-	if (!(P->en = pj_gauss_ini(P->e, P->phi0, &(P->phic0), &R))) E_ERROR_0;
-	P->sinc0 = sin(P->phic0);
-	P->cosc0 = cos(P->phic0);
-	P->R2 = 2. * R;
-	P->inv = e_inverse;
-	P->fwd = e_forward;
-ENDENTRY(P)
diff --git a/src/proj/PJ_sts.c b/src/proj/PJ_sts.c
deleted file mode 100644
index c35d5cf..0000000
--- a/src/proj/PJ_sts.c
+++ /dev/null
@@ -1,54 +0,0 @@
-#define PROJ_PARMS__ \
-	double C_x, C_y, C_p; \
-	int tan_mode;
-#define PJ_LIB__
-# include	<projects.h>
-PROJ_HEAD(kav5, "Kavraisky V") "\n\tPCyl., Sph.";
-PROJ_HEAD(qua_aut, "Quartic Authalic") "\n\tPCyl., Sph.";
-PROJ_HEAD(mbt_s, "McBryde-Thomas Flat-Polar Sine (No. 1)") "\n\tPCyl., Sph.";
-PROJ_HEAD(fouc, "Foucaut") "\n\tPCyl., Sph.";
-FORWARD(s_forward); /* spheroid */
-	double c;
-
-	xy.x = P->C_x * lp.lam * cos(lp.phi);
-	xy.y = P->C_y;
-	lp.phi *= P->C_p;
-	c = cos(lp.phi);
-	if (P->tan_mode) {
-		xy.x *= c * c;
-		xy.y *= tan(lp.phi);
-	} else {
-		xy.x /= c;
-		xy.y *= sin(lp.phi);
-	}
-	return (xy);
-}
-INVERSE(s_inverse); /* spheroid */
-	double c;
-	
-	xy.y /= P->C_y;
-	c = cos(lp.phi = P->tan_mode ? atan(xy.y) : aasin(P->ctx,xy.y));
-	lp.phi /= P->C_p;
-	lp.lam = xy.x / (P->C_x * cos(lp.phi));
-	if (P->tan_mode)
-		lp.lam /= c * c;
-	else
-		lp.lam *= c;
-	return (lp);
-}
-FREEUP; if (P) pj_dalloc(P); }
-	static PJ *
-setup(PJ *P, double p, double q, int mode) {
-	P->es = 0.;
-	P->inv = s_inverse;
-	P->fwd = s_forward;
-	P->C_x = q / p;
-	P->C_y = p;
-	P->C_p = 1/ q;
-	P->tan_mode = mode;
-	return P;
-}
-ENTRY0(kav5) ENDENTRY(setup(P, 1.50488, 1.35439, 0))
-ENTRY0(qua_aut) ENDENTRY(setup(P, 2., 2., 0))
-ENTRY0(mbt_s) ENDENTRY(setup(P, 1.48875, 1.36509, 0))
-ENTRY0(fouc) ENDENTRY(setup(P, 2., 2., 1))
diff --git a/src/proj/PJ_tcc.c b/src/proj/PJ_tcc.c
deleted file mode 100644
index 00cdb55..0000000
--- a/src/proj/PJ_tcc.c
+++ /dev/null
@@ -1,17 +0,0 @@
-#define PROJ_PARMS__ \
-	double ap;
-#define EPS10 1.e-10
-#define PJ_LIB__
-#include	<projects.h>
-PROJ_HEAD(tcc, "Transverse Central Cylindrical") "\n\tCyl, Sph, no inv.";
-FORWARD(s_forward); /* spheroid */
-	double b, bt;
-
-	b = cos(lp.phi) * sin(lp.lam);
-	if ((bt = 1. - b * b) < EPS10) F_ERROR;
-	xy.x = b / sqrt(bt);
-	xy.y = atan2(tan(lp.phi) , cos(lp.lam));
-	return (xy);
-}
-FREEUP; if (P) pj_dalloc(P); }
-ENTRY0(tcc) P->es = 0.; P->fwd = s_forward; ENDENTRY(P)
diff --git a/src/proj/PJ_tcea.c b/src/proj/PJ_tcea.c
deleted file mode 100644
index 3626fa1..0000000
--- a/src/proj/PJ_tcea.c
+++ /dev/null
@@ -1,27 +0,0 @@
-#define PROJ_PARMS__ \
-	double rk0;
-#define PJ_LIB__
-#include	<projects.h>
-PROJ_HEAD(tcea, "Transverse Cylindrical Equal Area") "\n\tCyl, Sph";
-FORWARD(s_forward); /* spheroid */
-	xy.x = P->rk0 * cos(lp.phi) * sin(lp.lam);
-	xy.y = P->k0 * (atan2(tan(lp.phi), cos(lp.lam)) - P->phi0);
-	return (xy);
-}
-INVERSE(s_inverse); /* spheroid */
-	double t;
-
-	xy.y = xy.y * P->rk0 + P->phi0;
-	xy.x *= P->k0;
-	t = sqrt(1. - xy.x * xy.x);
-	lp.phi = asin(t * sin(xy.y));
-	lp.lam = atan2(xy.x, t * cos(xy.y));
-	return (lp);
-}
-FREEUP; if (P) pj_dalloc(P); }
-ENTRY0(tcea)
-	P->rk0 = 1 / P->k0;
-	P->inv = s_inverse;
-	P->fwd = s_forward;
-	P->es = 0.;
-ENDENTRY(P)
diff --git a/src/proj/PJ_tmerc.c b/src/proj/PJ_tmerc.c
deleted file mode 100644
index 3b1e0fb..0000000
--- a/src/proj/PJ_tmerc.c
+++ /dev/null
@@ -1,175 +0,0 @@
-#define PROJ_PARMS__ \
-	double	esp; \
-	double	ml0; \
-	double	*en;
-#define PJ_LIB__
-#include	<projects.h>
-PROJ_HEAD(tmerc, "Transverse Mercator") "\n\tCyl, Sph&Ell";
-PROJ_HEAD(utm, "Universal Transverse Mercator (UTM)")
-	"\n\tCyl, Sph\n\tzone= south";
-#define EPS10	1.e-10
-#define aks0	P->esp
-#define aks5	P->ml0
-#define FC1 1.
-#define FC2 .5
-#define FC3 .16666666666666666666
-#define FC4 .08333333333333333333
-#define FC5 .05
-#define FC6 .03333333333333333333
-#define FC7 .02380952380952380952
-#define FC8 .01785714285714285714
-FORWARD(e_forward); /* ellipse */
-	double al, als, n, cosphi, sinphi, t;
-
-        /*
-         * Fail if our longitude is more than 90 degrees from the 
-         * central meridian since the results are essentially garbage. 
-         * Is error -20 really an appropriate return value?
-         * 
-         *  http://trac.osgeo.org/proj/ticket/5
-         */
-        if( lp.lam < -HALFPI || lp.lam > HALFPI )
-        {
-            xy.x = HUGE_VAL;
-            xy.y = HUGE_VAL;
-            pj_ctx_set_errno( P->ctx, -14 );
-            return xy;
-        }
-
-	sinphi = sin(lp.phi); cosphi = cos(lp.phi);
-	t = fabs(cosphi) > 1e-10 ? sinphi/cosphi : 0.;
-	t *= t;
-	al = cosphi * lp.lam;
-	als = al * al;
-	al /= sqrt(1. - P->es * sinphi * sinphi);
-	n = P->esp * cosphi * cosphi;
-	xy.x = P->k0 * al * (FC1 +
-		FC3 * als * (1. - t + n +
-		FC5 * als * (5. + t * (t - 18.) + n * (14. - 58. * t)
-		+ FC7 * als * (61. + t * ( t * (179. - t) - 479. ) )
-		)));
-	xy.y = P->k0 * (pj_mlfn(lp.phi, sinphi, cosphi, P->en) - P->ml0 +
-		sinphi * al * lp.lam * FC2 * ( 1. +
-		FC4 * als * (5. - t + n * (9. + 4. * n) +
-		FC6 * als * (61. + t * (t - 58.) + n * (270. - 330 * t)
-		+ FC8 * als * (1385. + t * ( t * (543. - t) - 3111.) )
-		))));
-	return (xy);
-}
-FORWARD(s_forward); /* sphere */
-	double b, cosphi;
-
-        /*
-         * Fail if our longitude is more than 90 degrees from the 
-         * central meridian since the results are essentially garbage. 
-         * Is error -20 really an appropriate return value?
-         * 
-         *  http://trac.osgeo.org/proj/ticket/5
-         */
-        if( lp.lam < -HALFPI || lp.lam > HALFPI )
-        {
-            xy.x = HUGE_VAL;
-            xy.y = HUGE_VAL;
-            pj_ctx_set_errno( P->ctx, -14 );
-            return xy;
-        }
-
-	b = (cosphi = cos(lp.phi)) * sin(lp.lam);
-	if (fabs(fabs(b) - 1.) <= EPS10) F_ERROR;
-	xy.x = aks5 * log((1. + b) / (1. - b));
-	if ((b = fabs( xy.y = cosphi * cos(lp.lam) / sqrt(1. - b * b) )) >= 1.) {
-		if ((b - 1.) > EPS10) F_ERROR
-		else xy.y = 0.;
-	} else
-		xy.y = acos(xy.y);
-	if (lp.phi < 0.) xy.y = -xy.y;
-	xy.y = aks0 * (xy.y - P->phi0);
-	return (xy);
-}
-INVERSE(e_inverse); /* ellipsoid */
-	double n, con, cosphi, d, ds, sinphi, t;
-
-	lp.phi = pj_inv_mlfn(P->ctx, P->ml0 + xy.y / P->k0, P->es, P->en);
-	if (fabs(lp.phi) >= HALFPI) {
-		lp.phi = xy.y < 0. ? -HALFPI : HALFPI;
-		lp.lam = 0.;
-	} else {
-		sinphi = sin(lp.phi);
-		cosphi = cos(lp.phi);
-		t = fabs(cosphi) > 1e-10 ? sinphi/cosphi : 0.;
-		n = P->esp * cosphi * cosphi;
-		d = xy.x * sqrt(con = 1. - P->es * sinphi * sinphi) / P->k0;
-		con *= t;
-		t *= t;
-		ds = d * d;
-		lp.phi -= (con * ds / (1.-P->es)) * FC2 * (1. -
-			ds * FC4 * (5. + t * (3. - 9. *  n) + n * (1. - 4 * n) -
-			ds * FC6 * (61. + t * (90. - 252. * n +
-				45. * t) + 46. * n
-		   - ds * FC8 * (1385. + t * (3633. + t * (4095. + 1574. * t)) )
-			)));
-		lp.lam = d*(FC1 -
-			ds*FC3*( 1. + 2.*t + n -
-			ds*FC5*(5. + t*(28. + 24.*t + 8.*n) + 6.*n
-		   - ds * FC7 * (61. + t * (662. + t * (1320. + 720. * t)) )
-		))) / cosphi;
-	}
-	return (lp);
-}
-INVERSE(s_inverse); /* sphere */
-	double h, g;
-
-	h = exp(xy.x / aks0);
-	g = .5 * (h - 1. / h);
-	h = cos(P->phi0 + xy.y / aks0);
-	lp.phi = asin(sqrt((1. - h * h) / (1. + g * g)));
-	if (xy.y < 0.) lp.phi = -lp.phi;
-	lp.lam = (g || h) ? atan2(g, h) : 0.;
-	return (lp);
-}
-FREEUP;
-	if (P) {
-		if (P->en)
-			pj_dalloc(P->en);
-		pj_dalloc(P);
-	}
-}
-	static PJ *
-setup(PJ *P) { /* general initialization */
-	if (P->es) {
-		if (!(P->en = pj_enfn(P->es)))
-			E_ERROR_0;
-		P->ml0 = pj_mlfn(P->phi0, sin(P->phi0), cos(P->phi0), P->en);
-		P->esp = P->es / (1. - P->es);
-		P->inv = e_inverse;
-		P->fwd = e_forward;
-	} else {
-		aks0 = P->k0;
-		aks5 = .5 * aks0;
-		P->inv = s_inverse;
-		P->fwd = s_forward;
-	}
-	return P;
-}
-ENTRY1(tmerc, en)
-ENDENTRY(setup(P))
-ENTRY1(utm, en)
-	int zone;
-
-	if (!P->es) E_ERROR(-34);
-	P->y0 = pj_param(P->ctx, P->params, "bsouth").i ? 10000000. : 0.;
-	P->x0 = 500000.;
-	if (pj_param(P->ctx, P->params, "tzone").i) /* zone input ? */
-		if ((zone = pj_param(P->ctx, P->params, "izone").i) > 0 && zone <= 60)
-			--zone;
-		else
-			E_ERROR(-35)
-	else /* nearest central meridian input */
-		if ((zone = floor((adjlon(P->lam0) + PI) * 30. / PI)) < 0)
-			zone = 0;
-		else if (zone >= 60)
-			zone = 59;
-	P->lam0 = (zone + .5) * PI / 30. - PI;
-	P->k0 = 0.9996;
-	P->phi0 = 0.;
-ENDENTRY(setup(P))
diff --git a/src/proj/PJ_tpeqd.c b/src/proj/PJ_tpeqd.c
deleted file mode 100644
index 4ab5cf4..0000000
--- a/src/proj/PJ_tpeqd.c
+++ /dev/null
@@ -1,76 +0,0 @@
-#define PROJ_PARMS__ \
-	double cp1, sp1, cp2, sp2, ccs, cs, sc, r2z0, z02, dlam2; \
-	double hz0, thz0, rhshz0, ca, sa, lp, lamc;
-#define PJ_LIB__
-#include	<projects.h>
-PROJ_HEAD(tpeqd, "Two Point Equidistant")
-	"\n\tMisc Sph\n\tlat_1= lon_1= lat_2= lon_2=";
-FORWARD(s_forward); /* sphere */
-	double t, z1, z2, dl1, dl2, sp, cp;
-
-	sp = sin(lp.phi);
-	cp = cos(lp.phi);
-	z1 = aacos(P->ctx,P->sp1 * sp + P->cp1 * cp * cos(dl1 = lp.lam + P->dlam2));
-	z2 = aacos(P->ctx,P->sp2 * sp + P->cp2 * cp * cos(dl2 = lp.lam - P->dlam2));
-	z1 *= z1;
-	z2 *= z2;
-	xy.x = P->r2z0 * (t = z1 - z2);
-	t = P->z02 - t;
-	xy.y = P->r2z0 * asqrt(4. * P->z02 * z2 - t * t);
-	if ((P->ccs * sp - cp * (P->cs * sin(dl1) - P->sc * sin(dl2))) < 0.)
-		xy.y = -xy.y;
-	return xy;
-}
-INVERSE(s_inverse); /* sphere */
-	double cz1, cz2, s, d, cp, sp;
-
-	cz1 = cos(hypot(xy.y, xy.x + P->hz0));
-	cz2 = cos(hypot(xy.y, xy.x - P->hz0));
-	s = cz1 + cz2;
-	d = cz1 - cz2;
-	lp.lam = - atan2(d, (s * P->thz0));
-	lp.phi = aacos(P->ctx,hypot(P->thz0 * s, d) * P->rhshz0);
-	if ( xy.y < 0. )
-		lp.phi = - lp.phi;
-	/* lam--phi now in system relative to P1--P2 base equator */
-	sp = sin(lp.phi);
-	cp = cos(lp.phi);
-	lp.phi = aasin(P->ctx,P->sa * sp + P->ca * cp * (s = cos(lp.lam -= P->lp)));
-	lp.lam = atan2(cp * sin(lp.lam), P->sa * cp * s - P->ca * sp) + P->lamc;
-	return lp;
-}
-FREEUP; if (P) pj_dalloc(P); }
-ENTRY0(tpeqd)
-	double lam_1, lam_2, phi_1, phi_2, A12, pp;
-
-	/* get control point locations */
-	phi_1 = pj_param(P->ctx, P->params, "rlat_1").f;
-	lam_1 = pj_param(P->ctx, P->params, "rlon_1").f;
-	phi_2 = pj_param(P->ctx, P->params, "rlat_2").f;
-	lam_2 = pj_param(P->ctx, P->params, "rlon_2").f;
-	if (phi_1 == phi_2 && lam_1 == lam_2) E_ERROR(-25);
-	P->lam0 = adjlon(0.5 * (lam_1 + lam_2));
-	P->dlam2 = adjlon(lam_2 - lam_1);
-	P->cp1 = cos(phi_1);
-	P->cp2 = cos(phi_2);
-	P->sp1 = sin(phi_1);
-	P->sp2 = sin(phi_2);
-	P->cs = P->cp1 * P->sp2;
-	P->sc = P->sp1 * P->cp2;
-	P->ccs = P->cp1 * P->cp2 * sin(P->dlam2);
-	P->z02 = aacos(P->ctx,P->sp1 * P->sp2 + P->cp1 * P->cp2 * cos(P->dlam2));
-	P->hz0 = .5 * P->z02;
-	A12 = atan2(P->cp2 * sin(P->dlam2),
-		P->cp1 * P->sp2 - P->sp1 * P->cp2 * cos(P->dlam2));
-	P->ca = cos(pp = aasin(P->ctx,P->cp1 * sin(A12)));
-	P->sa = sin(pp);
-	P->lp = adjlon(atan2(P->cp1 * cos(A12), P->sp1) - P->hz0);
-	P->dlam2 *= .5;
-	P->lamc = HALFPI - atan2(sin(A12) * P->sp1, cos(A12)) - P->dlam2;
-	P->thz0 = tan(P->hz0);
-	P->rhshz0 = .5 / sin(P->hz0);
-	P->r2z0 = 0.5 / P->z02;
-	P->z02 *= P->z02;
-	P->inv = s_inverse; P->fwd = s_forward;
-	P->es = 0.;
-ENDENTRY(P)
diff --git a/src/proj/PJ_urm5.c b/src/proj/PJ_urm5.c
deleted file mode 100644
index 6928bb3..0000000
--- a/src/proj/PJ_urm5.c
+++ /dev/null
@@ -1,28 +0,0 @@
-#define PROJ_PARMS__ \
-	double m, rmn, q3, n;
-#define PJ_LIB__
-# include	<projects.h>
-PROJ_HEAD(urm5, "Urmaev V") "\n\tPCyl., Sph.\n\tn= q= alphi=";
-FORWARD(s_forward); /* spheroid */
-	double t;
-
-	t = lp.phi = aasin(P->ctx,P->n * sin(lp.phi));
-	xy.x = P->m * lp.lam * cos(lp.phi);
-	t *= t;
-	xy.y = lp.phi * (1. + t * P->q3) * P->rmn;
-	return xy;
-}
-FREEUP; if (P) pj_dalloc(P); }
-ENTRY0(urm5)
-	double alpha, t;
-
-	P->n = pj_param(P->ctx, P->params, "dn").f;
-	P->q3 = pj_param(P->ctx, P->params, "dq").f / 3.;
-	alpha = pj_param(P->ctx, P->params, "ralpha").f;
-	t = P->n * sin(alpha);
-	P->m = cos(alpha) / sqrt(1. - t * t);
-	P->rmn = 1. / (P->m * P->n);
-	P->es = 0.;
-	P->inv = 0;
-	P->fwd = s_forward;
-ENDENTRY(P)
diff --git a/src/proj/PJ_urmfps.c b/src/proj/PJ_urmfps.c
deleted file mode 100644
index 5c5918a..0000000
--- a/src/proj/PJ_urmfps.c
+++ /dev/null
@@ -1,40 +0,0 @@
-#define PROJ_PARMS__ \
-	double	n, C_y;
-#define PJ_LIB__
-#include	<projects.h>
-PROJ_HEAD(urmfps, "Urmaev Flat-Polar Sinusoidal") "\n\tPCyl, Sph.\n\tn=";
-PROJ_HEAD(wag1, "Wagner I (Kavraisky VI)") "\n\tPCyl, Sph.";
-#define C_x 0.8773826753
-#define Cy 1.139753528477
-FORWARD(s_forward); /* sphere */
-	lp.phi = aasin(P->ctx,P->n * sin(lp.phi));
-	xy.x = C_x * lp.lam * cos(lp.phi);
-	xy.y = P->C_y * lp.phi;
-	return (xy);
-}
-INVERSE(s_inverse); /* sphere */
-	xy.y /= P->C_y;
-	lp.phi = aasin(P->ctx,sin(xy.y) / P->n);
-	lp.lam = xy.x / (C_x * cos(xy.y));
-	return (lp);
-}
-FREEUP; if (P) pj_dalloc(P); }
-	static PJ *
-setup(PJ *P) {
-	P->C_y = Cy / P->n;
-	P->es = 0.;
-	P->inv = s_inverse;
-	P->fwd = s_forward;
-	return P;
-}
-ENTRY0(urmfps)
-	if (pj_param(P->ctx, P->params, "tn").i) {
-		P->n = pj_param(P->ctx, P->params, "dn").f;
-		if (P->n <= 0. || P->n > 1.)
-			E_ERROR(-40)
-	} else
-		E_ERROR(-40)
-ENDENTRY(setup(P))
-ENTRY0(wag1)
-	P->n = 0.8660254037844386467637231707;
-ENDENTRY(setup(P))
diff --git a/src/proj/PJ_vandg.c b/src/proj/PJ_vandg.c
deleted file mode 100644
index 784674b..0000000
--- a/src/proj/PJ_vandg.c
+++ /dev/null
@@ -1,78 +0,0 @@
-#define PJ_LIB__
-# include	<projects.h>
-PROJ_HEAD(vandg, "van der Grinten (I)") "\n\tMisc Sph";
-# define TOL		1.e-10
-# define THIRD		.33333333333333333333
-# define TWO_THRD	.66666666666666666666
-# define C2_27		.07407407407407407407
-# define PI4_3		4.18879020478639098458
-# define PISQ		9.86960440108935861869
-# define TPISQ		19.73920880217871723738
-# define HPISQ		4.93480220054467930934
-FORWARD(s_forward); /* spheroid */
-	double  al, al2, g, g2, p2;
-
-	p2 = fabs(lp.phi / HALFPI);
-	if ((p2 - TOL) > 1.) F_ERROR;
-	if (p2 > 1.)
-		p2 = 1.;
-	if (fabs(lp.phi) <= TOL) {
-		xy.x = lp.lam;
-		xy.y = 0.;
-	} else if (fabs(lp.lam) <= TOL || fabs(p2 - 1.) < TOL) {
-		xy.x = 0.;
-		xy.y = PI * tan(.5 * asin(p2));
-		if (lp.phi < 0.) xy.y = -xy.y;
-	} else {
-		al = .5 * fabs(PI / lp.lam - lp.lam / PI);
-		al2 = al * al;
-		g = sqrt(1. - p2 * p2);
-		g = g / (p2 + g - 1.);
-		g2 = g * g;
-		p2 = g * (2. / p2 - 1.);
-		p2 = p2 * p2;
-		xy.x = g - p2; g = p2 + al2;
-		xy.x = PI * (al * xy.x + sqrt(al2 * xy.x * xy.x - g * (g2 - p2))) / g;
-		if (lp.lam < 0.) xy.x = -xy.x;
-		xy.y = fabs(xy.x / PI);
-		xy.y = 1. - xy.y * (xy.y + 2. * al);
-		if (xy.y < -TOL) F_ERROR;
-		if (xy.y < 0.)	xy.y = 0.;
-		else		xy.y = sqrt(xy.y) * (lp.phi < 0. ? -PI : PI);
-	}
-	return (xy);
-}
-INVERSE(s_inverse); /* spheroid */
-	double t, c0, c1, c2, c3, al, r2, r, m, d, ay, x2, y2;
-
-	x2 = xy.x * xy.x;
-	if ((ay = fabs(xy.y)) < TOL) {
-		lp.phi = 0.;
-		t = x2 * x2 + TPISQ * (x2 + HPISQ);
-		lp.lam = fabs(xy.x) <= TOL ? 0. :
-		   .5 * (x2 - PISQ + sqrt(t)) / xy.x;
-		return (lp);
-	}
-	y2 = xy.y * xy.y;
-	r = x2 + y2;	r2 = r * r;
-	c1 = - PI * ay * (r + PISQ);
-	c3 = r2 + TWOPI * (ay * r + PI * (y2 + PI * (ay + HALFPI)));
-	c2 = c1 + PISQ * (r - 3. *  y2);
-	c0 = PI * ay;
-	c2 /= c3;
-	al = c1 / c3 - THIRD * c2 * c2;
-	m = 2. * sqrt(-THIRD * al);
-	d = C2_27 * c2 * c2 * c2 + (c0 * c0 - THIRD * c2 * c1) / c3;
-	if (((t = fabs(d = 3. * d / (al * m))) - TOL) <= 1.) {
-		d = t > 1. ? (d > 0. ? 0. : PI) : acos(d);
-		lp.phi = PI * (m * cos(d * THIRD + PI4_3) - THIRD * c2);
-		if (xy.y < 0.) lp.phi = -lp.phi;
-		t = r2 + TPISQ * (x2 - y2 + HPISQ);
-		lp.lam = fabs(xy.x) <= TOL ? 0. :
-		   .5 * (r - PISQ + (t <= 0. ? 0. : sqrt(t))) / xy.x;
-	} else
-		I_ERROR;
-	return (lp);
-}
-FREEUP; if (P) pj_dalloc(P); }
-ENTRY0(vandg) P->es = 0.; P->inv = s_inverse; P->fwd = s_forward; ENDENTRY(P)
diff --git a/src/proj/PJ_vandg2.c b/src/proj/PJ_vandg2.c
deleted file mode 100644
index 7bfa8f4..0000000
--- a/src/proj/PJ_vandg2.c
+++ /dev/null
@@ -1,45 +0,0 @@
-# define TOL	1e-10
-# define TWORPI	0.63661977236758134308
-#define PROJ_PARMS__ \
-	int	vdg3;
-#define PJ_LIB__
-#include	<projects.h>
-PROJ_HEAD(vandg2, "van der Grinten II") "\n\tMisc Sph, no inv.";
-PROJ_HEAD(vandg3, "van der Grinten III") "\n\tMisc Sph, no inv.";
-FORWARD(s_forward); /* spheroid */
-	double x1, at, bt, ct;
-
-	bt = fabs(TWORPI * lp.phi);
-	if ((ct = 1. - bt * bt) < 0.)
-		ct = 0.;
-	else
-		ct = sqrt(ct);
-	if (fabs(lp.lam) < TOL) {
-		xy.x = 0.;
-		xy.y = PI * (lp.phi < 0. ? -bt : bt) / (1. + ct);
-	} else {
-		at = 0.5 * fabs(PI / lp.lam - lp.lam / PI);
-		if (P->vdg3) {
-			x1 = bt / (1. + ct);
-			xy.x = PI * (sqrt(at * at + 1. - x1 * x1) - at);
-			xy.y = PI * x1;
-		} else {
-			x1 = (ct * sqrt(1. + at * at) - at * ct * ct) /
-				(1. + at * at * bt * bt);
-			xy.x = PI * x1;
-			xy.y = PI * sqrt(1. - x1 * (x1 + 2. * at) + TOL);
-		}
-		if ( lp.lam < 0.) xy.x = -xy.x;
-		if ( lp.phi < 0.) xy.y = -xy.y;
-	}
-	return (xy);
-}
-FREEUP; if (P) pj_dalloc(P); }
-ENTRY0(vandg2)
-	P->vdg3 = 0;
-	P->inv = 0; P->fwd = s_forward;
-ENDENTRY(P)
-ENTRY0(vandg3)
-	P->vdg3 = 1;
-	P->es = 0.; P->fwd = s_forward;
-ENDENTRY(P)
diff --git a/src/proj/PJ_vandg4.c b/src/proj/PJ_vandg4.c
deleted file mode 100644
index d670503..0000000
--- a/src/proj/PJ_vandg4.c
+++ /dev/null
@@ -1,41 +0,0 @@
-#define PJ_LIB__
-#include	<projects.h>
-PROJ_HEAD(vandg4, "van der Grinten IV") "\n\tMisc Sph, no inv.";
-#define TOL	1e-10
-#define TWORPI	0.63661977236758134308
-FORWARD(s_forward); /* spheroid */
-	double x1, t, bt, ct, ft, bt2, ct2, dt, dt2;
-
-	if (fabs(lp.phi) < TOL) {
-		xy.x = lp.lam;
-		xy.y = 0.;
-	} else if (fabs(lp.lam) < TOL || fabs(fabs(lp.phi) - HALFPI) < TOL) {
-		xy.x = 0.;
-		xy.y = lp.phi;
-	} else {
-		bt = fabs(TWORPI * lp.phi);
-		bt2 = bt * bt;
-		ct = 0.5 * (bt * (8. - bt * (2. + bt2)) - 5.)
-			/ (bt2 * (bt - 1.));
-		ct2 = ct * ct;
-		dt = TWORPI * lp.lam;
-		dt = dt + 1. / dt;
-		dt = sqrt(dt * dt - 4.);
-		if ((fabs(lp.lam) - HALFPI) < 0.) dt = -dt;
-		dt2 = dt * dt;
-		x1 = bt + ct; x1 *= x1;
-		t = bt + 3.*ct;
-		ft = x1 * (bt2 + ct2 * dt2 - 1.) + (1.-bt2) * (
-			bt2 * (t * t + 4. * ct2) +
-			ct2 * (12. * bt * ct + 4. * ct2) );
-		x1 = (dt*(x1 + ct2 - 1.) + 2.*sqrt(ft)) /
-			(4.* x1 + dt2);
-		xy.x = HALFPI * x1;
-		xy.y = HALFPI * sqrt(1. + dt * fabs(x1) - x1 * x1);
-		if (lp.lam < 0.) xy.x = -xy.x;
-		if (lp.phi < 0.) xy.y = -xy.y;
-	}
-	return (xy);
-}
-FREEUP; if (P) pj_dalloc(P); }
-ENTRY0(vandg4) P->es = 0.; P->fwd = s_forward; ENDENTRY(P)
diff --git a/src/proj/PJ_wag2.c b/src/proj/PJ_wag2.c
deleted file mode 100644
index f4942bb..0000000
--- a/src/proj/PJ_wag2.c
+++ /dev/null
@@ -1,21 +0,0 @@
-#define PJ_LIB__
-# include	<projects.h>
-PROJ_HEAD(wag2, "Wagner II") "\n\tPCyl., Sph.";
-#define C_x 0.92483
-#define C_y 1.38725
-#define C_p1 0.88022
-#define C_p2 0.88550
-FORWARD(s_forward); /* spheroid */
-	lp.phi = aasin(P->ctx,C_p1 * sin(C_p2 * lp.phi));
-	xy.x = C_x * lp.lam * cos(lp.phi);
-	xy.y = C_y * lp.phi;
-	return (xy);
-}
-INVERSE(s_inverse); /* spheroid */
-	lp.phi = xy.y / C_y;
-	lp.lam = xy.x / (C_x * cos(lp.phi));
-	lp.phi = aasin(P->ctx,sin(lp.phi) / C_p1) / C_p2;
-	return (lp);
-}
-FREEUP; if (P) pj_dalloc(P); }
-ENTRY0(wag2) P->es = 0.; P->inv = s_inverse; P->fwd = s_forward; ENDENTRY(P)
diff --git a/src/proj/PJ_wag3.c b/src/proj/PJ_wag3.c
deleted file mode 100644
index 482e389..0000000
--- a/src/proj/PJ_wag3.c
+++ /dev/null
@@ -1,24 +0,0 @@
-#define PROJ_PARMS__ \
-	double	C_x;
-#define PJ_LIB__
-# include	<projects.h>
-PROJ_HEAD(wag3, "Wagner III") "\n\tPCyl., Sph.\n\tlat_ts=";
-#define TWOTHIRD 0.6666666666666666666667
-FORWARD(s_forward); /* spheroid */
-	xy.x = P->C_x * lp.lam * cos(TWOTHIRD * lp.phi);
-	xy.y = lp.phi;
-	return (xy);
-}
-INVERSE(s_inverse); /* spheroid */
-	lp.phi = xy.y;
-	lp.lam = xy.x / (P->C_x * cos(TWOTHIRD * lp.phi));
-	return (lp);
-}
-FREEUP; if (P) pj_dalloc(P); }
-ENTRY0(wag3)
-	double ts;
-
-	ts = pj_param(P->ctx, P->params, "rlat_ts").f;
-	P->C_x = cos(ts) / cos(2.*ts/3.);
-	P->es = 0.; P->inv = s_inverse; P->fwd = s_forward;
-ENDENTRY(P)
diff --git a/src/proj/PJ_wag7.c b/src/proj/PJ_wag7.c
deleted file mode 100644
index 5f6f1bb..0000000
--- a/src/proj/PJ_wag7.c
+++ /dev/null
@@ -1,14 +0,0 @@
-#define PJ_LIB__
-#include	<projects.h>
-PROJ_HEAD(wag7, "Wagner VII") "\n\tMisc Sph, no inv.";
-FORWARD(s_forward); /* sphere */
-	double theta, ct, D;
-
-	theta = asin(xy.y = 0.90630778703664996 * sin(lp.phi));
-	xy.x = 2.66723 * (ct = cos(theta)) * sin(lp.lam /= 3.);
-	xy.y *= 1.24104 * (D = 1/(sqrt(0.5 * (1 + ct * cos(lp.lam)))));
-	xy.x *= D;
-	return (xy);
-}
-FREEUP; if (P) pj_dalloc(P); }
-ENTRY0(wag7) P->fwd = s_forward; P->inv = 0; P->es = 0.; ENDENTRY(P)
diff --git a/src/proj/PJ_wink1.c b/src/proj/PJ_wink1.c
deleted file mode 100644
index dfb455e..0000000
--- a/src/proj/PJ_wink1.c
+++ /dev/null
@@ -1,20 +0,0 @@
-#define PROJ_PARMS__ \
-	double	cosphi1;
-#define PJ_LIB__
-# include	<projects.h>
-PROJ_HEAD(wink1, "Winkel I") "\n\tPCyl., Sph.\n\tlat_ts=";
-FORWARD(s_forward); /* spheroid */
-	xy.x = .5 * lp.lam * (P->cosphi1 + cos(lp.phi));
-	xy.y = lp.phi;
-	return (xy);
-}
-INVERSE(s_inverse); /* spheroid */
-	lp.phi = xy.y;
-	lp.lam = 2. * xy.x / (P->cosphi1 + cos(lp.phi));
-	return (lp);
-}
-FREEUP; if (P) pj_dalloc(P); }
-ENTRY0(wink1)
-	P->cosphi1 = cos(pj_param(P->ctx, P->params, "rlat_ts").f);
-	P->es = 0.; P->inv = s_inverse; P->fwd = s_forward;
-ENDENTRY(P)
diff --git a/src/proj/PJ_wink2.c b/src/proj/PJ_wink2.c
deleted file mode 100644
index 388c790..0000000
--- a/src/proj/PJ_wink2.c
+++ /dev/null
@@ -1,34 +0,0 @@
-#define PROJ_PARMS__ \
-	double	cosphi1;
-#define PJ_LIB__
-# include	<projects.h>
-PROJ_HEAD(wink2, "Winkel II") "\n\tPCyl., Sph., no inv.\n\tlat_1=";
-#define MAX_ITER    10
-#define LOOP_TOL    1e-7
-#define TWO_D_PI 0.636619772367581343
-FORWARD(s_forward); /* spheroid */
-	double k, V;
-	int i;
-
-	xy.y = lp.phi * TWO_D_PI;
-	k = PI * sin(lp.phi);
-	lp.phi *= 1.8;
-	for (i = MAX_ITER; i ; --i) {
-		lp.phi -= V = (lp.phi + sin(lp.phi) - k) /
-			(1. + cos(lp.phi));
-		if (fabs(V) < LOOP_TOL)
-			break;
-	}
-	if (!i)
-		lp.phi = (lp.phi < 0.) ? -HALFPI : HALFPI;
-	else
-		lp.phi *= 0.5;
-	xy.x = 0.5 * lp.lam * (cos(lp.phi) + P->cosphi1);
-	xy.y = FORTPI * (sin(lp.phi) + xy.y);
-	return (xy);
-}
-FREEUP; if (P) pj_dalloc(P); }
-ENTRY0(wink2)
-	P->cosphi1 = cos(pj_param(P->ctx, P->params, "rlat_1").f);
-	P->es = 0.; P->inv = 0; P->fwd = s_forward;
-ENDENTRY(P)
diff --git a/src/proj/aasincos.c b/src/proj/aasincos.c
deleted file mode 100644
index 6f39478..0000000
--- a/src/proj/aasincos.c
+++ /dev/null
@@ -1,35 +0,0 @@
-/* arc sin, cosine, tan2 and sqrt that will NOT fail */
-#include <projects.h>
-#define ONE_TOL	 1.00000000000001
-#define TOL	0.000000001
-#define ATOL 1e-50
-
-	double
-aasin(projCtx ctx,double v) {
-	double av;
-        
-	if ((av = fabs(v)) >= 1.) {
-		if (av > ONE_TOL)
-                        pj_ctx_set_errno( ctx, -19 );
-		return (v < 0. ? -HALFPI : HALFPI);
-	}
-	return asin(v);
-}
-
-	double
-aacos(projCtx ctx, double v) {
-	double av;
-
-	if ((av = fabs(v)) >= 1.) {
-		if (av > ONE_TOL)
-                        pj_ctx_set_errno( ctx, -19 );
-		return (v < 0. ? PI : 0.);
-	}
-	return acos(v);
-}
-	double
-asqrt(double v) { return ((v <= 0) ? 0. : sqrt(v)); }
-	double
-aatan2(double n, double d) {
-	return ((fabs(n) < ATOL && fabs(d) < ATOL) ? 0. : atan2(n,d));
-}
diff --git a/src/proj/adjlon.c b/src/proj/adjlon.c
deleted file mode 100644
index 09b3b14..0000000
--- a/src/proj/adjlon.c
+++ /dev/null
@@ -1,15 +0,0 @@
-/* reduce argument to range +/- PI */
-#include <math.h>
-#include <projects.h>
-
-#define SPI     3.14159265359
-#define TWOPI   6.2831853071795864769
-#define ONEPI   3.14159265358979323846
-
-double adjlon (double lon) {
-    if (fabs(lon) <= SPI) return( lon );
-    lon += ONEPI;  /* adjust to 0..2pi rad */
-    lon -= TWOPI * floor(lon / TWOPI); /* remove integral # of 'revolutions'*/
-    lon -= ONEPI;  /* adjust back to -pi..pi rad */
-    return( lon );
-}
diff --git a/src/proj/bch2bps.c b/src/proj/bch2bps.c
deleted file mode 100644
index 68a4737..0000000
--- a/src/proj/bch2bps.c
+++ /dev/null
@@ -1,140 +0,0 @@
-/* convert bivariate w Chebyshev series to w Power series */
-#include <projects.h>
-/* basic support procedures */
-	static void /* clear vector to zero */
-clear(projUV *p, int n) { static const projUV c = {0., 0.}; while (n--) *p++ = c; }
-	static void /* clear matrix rows to zero */
-bclear(projUV **p, int n, int m) { while (n--) clear(*p++, m); }
-	static void /* move vector */
-bmove(projUV *a, projUV *b, int n) { while (n--) *a++ = *b++; }
-	static void /* a <- m * b - c */
-submop(projUV *a, double m, projUV *b, projUV *c, int n) {
-	while (n--) {
-		a->u = m * b->u - c->u;
-		a++->v = m * b++->v - c++->v;
-	}
-}
-	static void /* a <- b - c */
-subop(projUV *a, projUV *b, projUV *c, int n) {
-	while (n--) {
-		a->u = b->u - c->u;
-		a++->v = b++->v - c++->v;
-	}
-}
-	static void /* multiply vector a by scalar m */
-dmult(projUV *a, double m, int n) { while(n--) { a->u *= m; a->v *= m; ++a; } }
-	static void /* row adjust a[] <- a[] - m * b[] */
-dadd(projUV *a, projUV *b, double m, int n) {
-	while(n--) {
-		a->u -= m * b->u;
-		a++->v -= m * b++->v;
-	}
-}
-	static void /* convert row to pover series */
-rows(projUV *c, projUV *d, int n) {
-	projUV sv, *dd;
-	int j, k;
-
-	dd = (projUV *)vector1(n-1, sizeof(projUV));
-	sv.u = sv.v = 0.;
-	for (j = 0; j < n; ++j) d[j] = dd[j] = sv;
-	d[0] = c[n-1];
-	for (j = n-2; j >= 1; --j) {
-		for (k = n-j; k >= 1; --k) {
-			sv = d[k];
-			d[k].u = 2. * d[k-1].u - dd[k].u;
-			d[k].v = 2. * d[k-1].v - dd[k].v;
-			dd[k] = sv;
-		}
-		sv = d[0];
-		d[0].u = -dd[0].u + c[j].u;
-		d[0].v = -dd[0].v + c[j].v;
-		dd[0] = sv;
-	}
-	for (j = n-1; j >= 1; --j) {
-		d[j].u = d[j-1].u - dd[j].u;
-		d[j].v = d[j-1].v - dd[j].v;
-	}
-	d[0].u = -dd[0].u + .5 * c[0].u;
-	d[0].v = -dd[0].v + .5 * c[0].v;
-	pj_dalloc(dd);
-}
-	static void /* convert columns to power series */
-cols(projUV **c, projUV **d, int nu, int nv) {
-	projUV *sv, **dd;
-	int j, k;
-
-	dd = (projUV **)vector2(nu, nv, sizeof(projUV));
-	sv = (projUV *)vector1(nv, sizeof(projUV));
-	bclear(d, nu, nv);
-	bclear(dd, nu, nv);
-	bmove(d[0], c[nu-1], nv);
-	for (j = nu-2; j >= 1; --j) {
-		for (k = nu-j; k >= 1; --k) {
-			bmove(sv, d[k], nv);
-			submop(d[k], 2., d[k-1], dd[k], nv);
-			bmove(dd[k], sv, nv);
-		}
-		bmove(sv, d[0], nv);
-		subop(d[0], c[j], dd[0], nv);
-		bmove(dd[0], sv, nv);
-	}
-	for (j = nu-1; j >= 1; --j)
-		subop(d[j], d[j-1], dd[j], nv);
-	submop(d[0], .5, c[0], dd[0], nv);
-	freev2((void **) dd, nu);
-	pj_dalloc(sv);
-}
-	static void /* row adjust for range -1 to 1 to a to b */
-rowshft(double a, double b, projUV *d, int n) {
-	int k, j;
-	double fac, cnst;
-
-	cnst = 2. / (b - a);
-	fac = cnst;
-	for (j = 1; j < n; ++j) {
-		d[j].u *= fac;
-		d[j].v *= fac;
-		fac *= cnst;
-	}
-	cnst = .5 * (a + b);
-	for (j = 0; j <= n-2; ++j)
-		for (k = n - 2; k >= j; --k) {
-			d[k].u -= cnst * d[k+1].u;
-			d[k].v -= cnst * d[k+1].v;
-		}
-}
-	static void /* column adjust for range -1 to 1 to a to b */
-colshft(double a, double b, projUV **d, int n, int m) {
-	int k, j;
-	double fac, cnst;
-
-	cnst = 2. / (b - a);
-	fac = cnst;
-	for (j = 1; j < n; ++j) {
-		dmult(d[j], fac, m);
-		fac *= cnst;
-	}
-	cnst = .5 * (a + b);
-	for (j = 0; j <= n-2; ++j)
-		for (k = n - 2; k >= j; --k)
-			dadd(d[k], d[k+1], cnst, m);
-}
-	int /* entry point */
-bch2bps(projUV a, projUV b, projUV **c, int nu, int nv) {
-	projUV **d;
-	int i;
-
-	if (nu < 1 || nv < 1 || !(d = (projUV **)vector2(nu, nv, sizeof(projUV))))
-		return 0;
-	/* do rows to power series */
-	for (i = 0; i < nu; ++i) {
-		rows(c[i], d[i], nv);
-		rowshft(a.v, b.v, d[i], nv);
-	}
-	/* do columns to power series */
-	cols(d, c, nu, nv);
-	colshft(a.u, b.u, c, nu, nv);
-	freev2((void **) d, nu);
-	return 1;
-}
diff --git a/src/proj/bchgen.c b/src/proj/bchgen.c
deleted file mode 100644
index fe2ffe6..0000000
--- a/src/proj/bchgen.c
+++ /dev/null
@@ -1,58 +0,0 @@
-/* generate double bivariate Chebychev polynomial */
-#include <projects.h>
-	int
-bchgen(projUV a, projUV b, int nu, int nv, projUV **f, projUV(*func)(projUV)) {
-	int i, j, k;
-	projUV arg, *t, bma, bpa, *c;
-	double d, fac;
-
-	bma.u = 0.5 * (b.u - a.u); bma.v = 0.5 * (b.v - a.v);
-	bpa.u = 0.5 * (b.u + a.u); bpa.v = 0.5 * (b.v + a.v);
-	for ( i = 0; i < nu; ++i) {
-		arg.u = cos(PI * (i + 0.5) / nu) * bma.u + bpa.u;
-		for ( j = 0; j < nv; ++j) {
-			arg.v = cos(PI * (j + 0.5) / nv) * bma.v + bpa.v;
-			f[i][j] = (*func)(arg);
-			if ((f[i][j]).u == HUGE_VAL)
-				return(1);
-		}
-	}
-	if (!(c = (projUV *) vector1(nu, sizeof(projUV)))) return 1;
-	fac = 2. / nu;
-	for ( j = 0; j < nv ; ++j) {
-		for ( i = 0; i < nu; ++i) {
-			arg.u = arg.v = 0.;
-			for (k = 0; k < nu; ++k) {
-				d = cos(PI * i * (k + .5) / nu);
-				arg.u += f[k][j].u * d;
-				arg.v += f[k][j].v * d;
-			}
-			arg.u *= fac;
-			arg.v *= fac;
-			c[i] = arg;
-		}
-		for (i = 0; i < nu; ++i)
-			f[i][j] = c[i];
-	}
-	pj_dalloc(c);
-	if (!(c = (projUV*) vector1(nv, sizeof(projUV)))) return 1;
-	fac = 2. / nv;
-	for ( i = 0; i < nu; ++i) {
-		t = f[i];
-		for (j = 0; j < nv; ++j) {
-			arg.u = arg.v = 0.;
-			for (k = 0; k < nv; ++k) {
-				d = cos(PI * j * (k + .5) / nv);
-				arg.u += t[k].u * d;
-				arg.v += t[k].v * d;
-			}
-			arg.u *= fac;
-			arg.v *= fac;
-			c[j] = arg;
-		}
-		f[i] = c;
-		c = t;
-	}
-	pj_dalloc(c);
-	return(0);
-}
diff --git a/src/proj/biveval.c b/src/proj/biveval.c
deleted file mode 100644
index 59021ee..0000000
--- a/src/proj/biveval.c
+++ /dev/null
@@ -1,87 +0,0 @@
-/* procedures for evaluating Tseries */
-# include <projects.h>
-# define NEAR_ONE	1.00001
-static double ceval(struct PW_COEF *C, int n, projUV w, projUV w2) {
-    double d=0, dd=0, vd, vdd, tmp, *c;
-    int j;
-
-    for (C += n ; n-- ; --C ) {
-        if ( (j = C->m) != 0) {
-            vd = vdd = 0.;
-            for (c = C->c + --j; j ; --j ) {
-                vd = w2.v * (tmp = vd) - vdd + *c--;
-                vdd = tmp;
-            }
-            d = w2.u * (tmp = d) - dd + w.v * vd - vdd + 0.5 * *c;
-        } else
-            d = w2.u * (tmp = d) - dd;
-        dd = tmp;
-    }
-    if ( (j = C->m) != 0 ) {
-        vd = vdd = 0.;
-        for (c = C->c + --j; j ; --j ) {
-            vd = w2.v * (tmp = vd) - vdd + *c--;
-            vdd = tmp;
-        }
-        return (w.u * d - dd + 0.5 * ( w.v * vd - vdd + 0.5 * *c ));
-    } else
-        return (w.u * d - dd);
-}
-
-projUV /* bivariate Chebyshev polynomial entry point */
-bcheval(projUV in, Tseries *T) {
-    projUV w2, w;
-    projUV out;
-    /* scale to +-1 */
-    w.u = ( in.u + in.u - T->a.u ) * T->b.u;
-    w.v = ( in.v + in.v - T->a.v ) * T->b.v;
-    if (fabs(w.u) > NEAR_ONE || fabs(w.v) > NEAR_ONE) {
-        out.u = out.v = HUGE_VAL;
-        pj_errno = -36;
-    } else { /* double evaluation */
-        w2.u = w.u + w.u;
-        w2.v = w.v + w.v;
-        out.u = ceval(T->cu, T->mu, w, w2);
-        out.v = ceval(T->cv, T->mv, w, w2);
-    }
-    return out;
-}
-
-projUV /* bivariate power polynomial entry point */
-bpseval(projUV in, Tseries *T) {
-    projUV out;
-    double *c, row;
-    int i, m;
-
-    out.u = out.v = 0.;
-    for (i = T->mu; i >= 0; --i) {
-        row = 0.;
-        if ((m = T->cu[i].m) != 0) {
-            c = T->cu[i].c + m;
-            while (m--)
-                row = *--c + in.v * row;
-        }
-        out.u = row + in.u * out.u;
-    }
-    for (i = T->mv; i >= 0; --i) {
-        row = 0.;
-        if ((m = T->cv[i].m) != 0) {
-            c = T->cv[i].c + m;
-            while (m--)
-                row = *--c + in.v * row;
-        }
-        out.v = row + in.u * out.v;
-    }
-    return out;
-}
-
-projUV /* general entry point selecting evaluation mode */
-biveval(projUV in, Tseries *T) {
-
-    if (T->power) {
-        return bpseval(in, T);
-    } else {
-        return bcheval(in, T);
-    }
-}
-
diff --git a/src/proj/cs2cs.1 b/src/proj/cs2cs.1
deleted file mode 100644
index 899c17a..0000000
--- a/src/proj/cs2cs.1
+++ /dev/null
@@ -1,202 +0,0 @@
-.\" release 4
-.nr LL 5.5i
-.ad b
-.hy 1
-.TH PROJ 1 "2000/03/21 Rel. 4.4" 
-.SH NAME
-cs2cs \- cartographic coordinate system filter
-.SH SYNOPSIS
-.B cs2cs
-[
-.B \-eEfIlrstvwW
-[
-.I args
-] ] [
-.B +opts[=arg]
-]
-.br
-      [ \fB+to\fR [\fB+opts\fR[\fB=arg\fR]] ]
-file[s]
-.SH DESCRIPTION
-.I Cs2cs
-performs transformation between the source and destination cartographic
-coordinate system on a set of input points.  The coordinate system
-transformation can include translation between projected and geographic 
-coordinates as well as the application of datum shifts.
-.PP
-The following control parameters can appear in any order:
-.TP
-.BI \-I
-method to specify inverse translation, convert from \fB+to\fR coordinate
-system to the primary coordinate system defined.
-.TP
-.BI \-t "a"
-.I A
-specifies a character employed as the first character to denote
-a control line to be passed through without processing.
-This option applicable to ascii input only.
-(# is the default value).
-.TP
-.BI \-e " string"
-.I String
-is an arbitrary string to be output if an error is detected during
-data transformations.
-The default value is: *\et*.
-Note that if the
-.B \-b,
-.B \-i
-or
-.B \-o
-options are employed, an error is returned as HUGE_VAL
-value for both return values.
-.TP
-.BI \-E
-causes the input coordinates to be copied to the output line
-prior to printing the converted values.
-.TP
-.BI \-l "[p|P|=|e|u|d]" id
-List projection identifiers with
-.B \-l,
-.B \-lp
-or
-.B \-lP (expanded)
-that can be selected with
-.B +proj.
-.BI \-l= id
-gives expanded description of projection
-.I id.
-List ellipsoid identifiers with
-.B \-le,
-that can be selected with
-.B +ellps,
-.B \-lu
-list of cartesian to meter conversion factors
-that can be selected with
-.B +units
-or
-.B \-ld
-list of datums that can be selected with 
-.B +datum.
-.TP
-.BI \-r
-This options reverses the order of the
-expected input from longitude-latitude or x-y to latitude-longitude or y-x.
-.TP
-.BI \-s
-This options reverses the order of the
-output from x-y or longitude-latitude to y-x or latitude-longitude.
-.TP
-.BI \-f " format"
-.I Format
-is a
-.I printf
-format string to control the form of the output values.
-For inverse projections, the output will be in degrees when this option
-is employed.
-If a format is specified for inverse projection the
-output data will be in decimal degrees.
-The default format is "%.2f" for forward projection and DMS
-for inverse.
-.TP
-.BI \-[w|W] n
-.I N
-is the number of significant fractional digits to employ for
-seconds output (when the option is not specified,
-.B \-w3
-is assumed).
-When
-.B \-W
-is employed the fields will be constant width and with leading zeroes.
-.TP
-.B \-v
-causes a listing of cartographic control parameters tested for and
-used by the program to be printed prior to input data.
-.PP
-The
-.B +args
-run-line arguments are associated with cartographic parameters
-and usage varies with projection and for a complete description see
-.I "Cartographic Projection Procedures for the UNIX Environment\(emA User's Manual" )
-and supplementary documentation for Release 4.
-.PP
-The \fIcs2cs\fR program requires two coordinate system definitions.  The
-first (or primary is defined based on all projection parameters not
-appearing after the \fB+to\fR argument.  All projection parameters 
-appearing after the \fB+to\fR argument are considered the definition
-of the second coordinate system.  If there is no second coordinate system
-defined, a geographic coordinate system based on the datum and ellipsoid of
-the source coordinate system is assumed.  Note that the source and destination
-coordinate system can both be projections, both be geographic, or one of
-each and may have the same or different datums.  
-.PP
-Additional projection control parameters may be contained in two
-auxiliary control files:
-the first is optionally referenced with the
-.BI +init= file:id
-and the second is always processed after the name
-of the projection has been established from either the run-line
-or the contents of
-.B +init
-file.
-The environment parameter
-.B PROJ_LIB
-establishes the default directory for a file reference without
-an absolute path.  This is also used for supporting files like
-datum shift files.
-.PP
-One or more
-.I files
-(processed in left to right order)
-specify the source of data to be transformed.
-A \- will specify the location of processing standard input.
-If no files are specified, the input is assumed to be from
-.I stdin.
-For input data the two data values must be in the
-first two white space separated fields and
-when both input and output are ASCII all trailing portions
-of the input line are appended to the output line.
-.PP
-Input geographic data
-(longitude and latitude) must be in DMS format and input
-cartesian data must be in units consistent with the ellipsoid
-major axis or sphere radius units.
-Output geographic coordinates will be in DMS
-(if the
-.B \-w
-switch is not employed) and precise to 0.001"
-with trailing, zero-valued minute-second fields deleted.
-.SH EXAMPLE
-The following script
-.RS 5
- \f(CWcs2cs +proj=latlong +datum=NAD83 
-       +to +proj=utm +zone=10 +datum=NAD27 -r <<EOF
- 45d15'33.1"	111.5W
- 45d15.551666667N	-111d30
- +45.25919444444	111d30'000w
- EOF\fR
-.RE
-will transform the input NAD83 geographic coordinates into NAD27 coordinates
-in the UTM projection with zone 10 selected.
-The geographic values of this example are equivalent and meant
-as examples of various forms of DMS input.
-The x\-y output data will appear as three lines of:
-.RS 5
- \f(CW1402285.99      5076292.42 0.000
-.RE
-.SH SEE ALSO
-.B proj(1U),
-.br
-.I "Cartographic Projection Procedures for the UNIX Environment\(emA User's Manual,"
-(Evenden, 1990, Open-file report 90\-284).
-.br
-.I "Map Projections Used by the U. S. Geological Survey"
-(Snyder, 1984,
-USGS Bulletin 1532).
-.br
-.I "Map Projections\(emA Working Manual"
-(Snyder, 1988, USGS Prof. Paper 1395).
-.br
-.I "An Album of Map Projections"
-(Snyder & Voxland, 1989, USGS Prof. Paper 1453).
-.SH HOME PAGE
-http://www.remotesensing.org/proj
diff --git a/src/proj/cs2cs.c b/src/proj/cs2cs.c
deleted file mode 100644
index 7b7b979..0000000
--- a/src/proj/cs2cs.c
+++ /dev/null
@@ -1,422 +0,0 @@
-/******************************************************************************
- * $Id: cs2cs.c 1950 2012-05-10 16:51:51Z caress $
- *
- * Project:  PROJ.4
- * Purpose:  Mainline program sort of like ``proj'' for converting between
- *           two coordinate systems.
- * Author:   Frank Warmerdam, warmerda at home.com
- *
- ******************************************************************************
- * Copyright (c) 2000, Frank Warmerdam
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *****************************************************************************/
-
-#include "projects.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include <ctype.h>
-#include <string.h>
-#include <math.h>
-#include "emess.h"
-
-#define MAX_LINE 1000
-#define MAX_PARGS 100
-
-static projPJ   fromProj, toProj;
-
-static int
-reversein = 0,	/* != 0 reverse input arguments */
-reverseout = 0,	/* != 0 reverse output arguments */
-echoin = 0,	/* echo input data to output line */
-tag = '#';	/* beginning of line tag character */
-	static char
-*oform = (char *)0,	/* output format for x-y or decimal degrees */
-*oterr = "*\t*",	/* output line for unprojectable input */
-*usage =
-"%s\nusage: %s [ -eEfIlrstvwW [args] ] [ +opts[=arg] ]\n"
-"                   [+to [+opts[=arg] [ files ]\n";
-
-static struct FACTORS facs;
-static double (*informat)(const char *, 
-                          char **); /* input data deformatter function */
-
-
-/************************************************************************/
-/*                              process()                               */
-/*                                                                      */
-/*      File processing function.                                       */
-/************************************************************************/
-static void process(FILE *fid) 
-
-{
-    char line[MAX_LINE+3], *s, pline[40];
-    projUV data;
-
-    for (;;) {
-        double z;
-
-        ++emess_dat.File_line;
-        if (!(s = fgets(line, MAX_LINE, fid)))
-            break;
-        if (!strchr(s, '\n')) { /* overlong line */
-            int c;
-            (void)strcat(s, "\n");
-				/* gobble up to newline */
-            while ((c = fgetc(fid)) != EOF && c != '\n') ;
-        }
-        if (*s == tag) {
-            fputs(line, stdout);
-            continue;
-        }
-
-        if (reversein) {
-            data.v = (*informat)(s, &s);
-            data.u = (*informat)(s, &s);
-        } else {
-            data.u = (*informat)(s, &s);
-            data.v = (*informat)(s, &s);
-        }
-
-        z = strtod( s, &s );
-
-        if (data.v == HUGE_VAL)
-            data.u = HUGE_VAL;
-
-        if (!*s && (s > line)) --s; /* assumed we gobbled \n */
-
-        if ( echoin) {
-            int t;
-            t = *s;
-            *s = '\0';
-            (void)fputs(line, stdout);
-            *s = t;
-            putchar('\t');
-        }
-
-        if (data.u != HUGE_VAL) {
-            if( pj_transform( fromProj, toProj, 1, 0, 
-                              &(data.u), &(data.v), &z ) != 0 )
-            {
-                data.u = HUGE_VAL;
-                data.v = HUGE_VAL;
-                emess(-3,"pj_transform(): %s", pj_strerrno(pj_errno));
-            }
-        }
-
-        if (data.u == HUGE_VAL) /* error output */
-            fputs(oterr, stdout);
-
-        else if (pj_is_latlong(toProj) && !oform) {	/*ascii DMS output */
-            if (reverseout) {
-                fputs(rtodms(pline, data.v, 'N', 'S'), stdout);
-                putchar('\t');
-                fputs(rtodms(pline, data.u, 'E', 'W'), stdout);
-            } else {
-                fputs(rtodms(pline, data.u, 'E', 'W'), stdout);
-                putchar('\t');
-                fputs(rtodms(pline, data.v, 'N', 'S'), stdout);
-            }
-
-        } else {	/* x-y or decimal degree ascii output */
-            if ( pj_is_latlong(toProj) ) {
-                data.v *= RAD_TO_DEG;
-                data.u *= RAD_TO_DEG;
-            }
-            if (reverseout) {
-                printf(oform,data.v); putchar('\t');
-                printf(oform,data.u);
-            } else {
-                printf(oform,data.u); putchar('\t');
-                printf(oform,data.v);
-            }
-        }
-
-        putchar(' ');
-        if( oform != NULL )
-            printf( oform, z );
-        else
-            printf( "%.3f", z );
-        if( s )
-            printf( "%s", s );
-        else
-            printf( "\n" );
-    }
-}
-
-/************************************************************************/
-/*                                main()                                */
-/************************************************************************/
-
-int main(int argc, char **argv) 
-{
-    char *arg, **eargv = argv, *from_argv[MAX_PARGS], *to_argv[MAX_PARGS],
-        **iargv = argv;
-    FILE *fid;
-    int from_argc=0, to_argc=0, iargc = argc, eargc = 0, c, mon = 0;
-    int have_to_flag = 0, inverse = 0, i;
-
-    if ((emess_dat.Prog_name = strrchr(*argv,DIR_CHAR)) != NULL)
-        ++emess_dat.Prog_name;
-    else emess_dat.Prog_name = *argv;
-    inverse = ! strncmp(emess_dat.Prog_name, "inv", 3);
-    if (argc <= 1 ) {
-        (void)fprintf(stderr, usage, pj_get_release(), emess_dat.Prog_name);
-        exit (0);
-    }
-    /* process run line arguments */
-    while (--argc > 0) { /* collect run line arguments */
-        if(**++argv == '-') for(arg = *argv;;) {
-            switch(*++arg) {
-              case '\0': /* position of "stdin" */
-                if (arg[-1] == '-') eargv[eargc++] = "-";
-                break;
-              case 'v': /* monitor dump of initialization */
-                mon = 1;
-                continue;
-              case 'I': /* alt. method to spec inverse */
-                inverse = 1;
-                continue;
-              case 'E': /* echo ascii input to ascii output */
-                echoin = 1;
-                continue;
-              case 't': /* set col. one char */
-                if (arg[1]) tag = *++arg;
-                else emess(1,"missing -t col. 1 tag");
-                continue;
-              case 'l': /* list projections, ellipses or units */
-                if (!arg[1] || arg[1] == 'p' || arg[1] == 'P') {
-                    /* list projections */
-                    struct PJ_LIST *lp;
-                    int do_long = arg[1] == 'P', c;
-                    char *str;
-
-                    for (lp = pj_get_list_ref() ; lp->id ; ++lp) {
-                        (void)printf("%s : ", lp->id);
-                        if (do_long)  /* possibly multiline description */
-                            (void)puts(*lp->descr);
-                        else { /* first line, only */
-                            str = *lp->descr;
-                            while ((c = *str++) && c != '\n')
-                                putchar(c);
-                            putchar('\n');
-                        }
-                    }
-                } else if (arg[1] == '=') { /* list projection 'descr' */
-                    struct PJ_LIST *lp;
-
-                    arg += 2;
-                    for (lp = pj_get_list_ref() ; lp->id ; ++lp)
-                        if (!strcmp(lp->id, arg)) {
-                            (void)printf("%9s : %s\n", lp->id, *lp->descr);
-                            break;
-                        }
-                } else if (arg[1] == 'e') { /* list ellipses */
-                    struct PJ_ELLPS *le;
-
-                    for (le = pj_get_ellps_ref(); le->id ; ++le)
-                        (void)printf("%9s %-16s %-16s %s\n",
-                                     le->id, le->major, le->ell, le->name);
-                } else if (arg[1] == 'u') { /* list units */
-                    struct PJ_UNITS *lu;
-
-                    for (lu = pj_get_units_ref(); lu->id ; ++lu)
-                        (void)printf("%12s %-20s %s\n",
-                                     lu->id, lu->to_meter, lu->name);
-                } else if (arg[1] == 'd') { /* list datums */
-                    struct PJ_DATUMS *ld;
-
-                    printf("__datum_id__ __ellipse___ __definition/comments______________________________\n" );
-                    for (ld = pj_get_datums_ref(); ld->id ; ++ld)
-                    {
-                        printf("%12s %-12s %-30s\n",
-                               ld->id, ld->ellipse_id, ld->defn);
-                        if( ld->comments != NULL && strlen(ld->comments) > 0 )
-                            printf( "%25s %s\n", " ", ld->comments );
-                    }
-                } else if( arg[1] == 'm') { /* list prime meridians */
-                    struct PJ_PRIME_MERIDIANS *lpm;
-
-                    for (lpm = pj_get_prime_meridians_ref(); lpm->id ; ++lpm)
-                        (void)printf("%12s %-30s\n",
-                                     lpm->id, lpm->defn);
-                } else
-                    emess(1,"invalid list option: l%c",arg[1]);
-                exit(0);
-                continue; /* artificial */
-              case 'e': /* error line alternative */
-                if (--argc <= 0)
-                    noargument:			   
-                emess(1,"missing argument for -%c",*arg);
-                oterr = *++argv;
-                continue;
-              case 'W': /* specify seconds precision */
-              case 'w': /* -W for constant field width */
-                if ((c = arg[1]) != 0 && isdigit(c)) {
-                    set_rtodms(c - '0', *arg == 'W');
-                    ++arg;
-                } else
-                    emess(1,"-W argument missing or non-digit");
-                continue;
-              case 'f': /* alternate output format degrees or xy */
-                if (--argc <= 0) goto noargument;
-                oform = *++argv;
-                continue;
-              case 'r': /* reverse input */
-                reversein = 1;
-                continue;
-              case 's': /* reverse output */
-                reverseout = 1;
-                continue;
-              case 'd': /* set debug level */
-                if (--argc <= 0) goto noargument;
-                pj_ctx_set_debug( pj_get_default_ctx(), atoi(*++argv));
-                continue;
-              default:
-                emess(1, "invalid option: -%c",*arg);
-                break;
-            }
-            break;
-
-        } else if (strcmp(*argv,"+to") == 0 ) {
-            have_to_flag = 1;
-
-        } else if (**argv == '+') { /* + argument */
-            if( have_to_flag )
-            {
-                if( to_argc < MAX_PARGS )
-                    to_argv[to_argc++] = *argv + 1;
-                else
-                    emess(1,"overflowed + argument table");
-            }
-            else 
-            {
-                if (from_argc < MAX_PARGS)
-                    from_argv[from_argc++] = *argv + 1;
-                else
-                    emess(1,"overflowed + argument table");
-            }
-        } else /* assumed to be input file name(s) */
-            eargv[eargc++] = *argv;
-    }
-    if (eargc == 0 ) /* if no specific files force sysin */
-        eargv[eargc++] = "-";
-
-    /* 
-     * If the user has requested inverse, then just reverse the
-     * coordinate systems.
-     */
-    if( inverse )
-    {
-        int     argcount;
-        
-        for( i = 0; i < MAX_PARGS; i++ )
-        {
-            char *arg;
-
-            arg = from_argv[i];
-            from_argv[i] = to_argv[i];
-            to_argv[i] = arg;
-        }
-
-        argcount = from_argc;
-        from_argc = to_argc;
-        to_argc = argcount;
-    }
-
-    if (!(fromProj = pj_init(from_argc, from_argv)))
-    {
-        printf( "Using from definition: " );
-        for( i = 0; i < from_argc; i++ )
-            printf( "%s ", from_argv[i] );
-        printf( "\n" );
-
-        emess(3,"projection initialization failure\ncause: %s",
-              pj_strerrno(pj_errno));
-    }
-
-    if( to_argc == 0 )
-    {
-        if (!(toProj = pj_latlong_from_proj( fromProj )))
-        {
-            printf( "Using to definition: " );
-            for( i = 0; i < to_argc; i++ )
-                printf( "%s ", to_argv[i] );
-            printf( "\n" );
-            
-            emess(3,"projection initialization failure\ncause: %s",
-                  pj_strerrno(pj_errno));
-        }   
-    }
-    else if (!(toProj = pj_init(to_argc, to_argv)))
-    {
-        printf( "Using to definition: " );
-        for( i = 0; i < to_argc; i++ )
-            printf( "%s ", to_argv[i] );
-        printf( "\n" );
-
-        emess(3,"projection initialization failure\ncause: %s",
-              pj_strerrno(pj_errno));
-    }
-
-    if (mon) {
-        printf( "%c ---- From Coordinate System ----\n", tag );
-        pj_pr_list(fromProj);
-        printf( "%c ---- To Coordinate System ----\n", tag );
-        pj_pr_list(toProj);
-    }
-
-    /* set input formating control */
-    if( !fromProj->is_latlong )
-        informat = strtod;
-    else {
-        informat = dmstor;
-    }
-
-    if( !toProj->is_latlong && !oform )
-        oform = "%.2f";
-
-    /* process input file list */
-    for ( ; eargc-- ; ++eargv) {
-        if (**eargv == '-') {
-            fid = stdin;
-            emess_dat.File_name = "<stdin>";
-
-        } else {
-            if ((fid = fopen(*eargv, "rt")) == NULL) {
-                emess(-2, *eargv, "input file");
-                continue;
-            }
-            emess_dat.File_name = *eargv;
-        }
-        emess_dat.File_line = 0;
-        process(fid);
-        fclose(fid);
-        emess_dat.File_name = 0;
-    }
-
-    if( fromProj != NULL )
-        pj_free( fromProj );
-    if( toProj != NULL )
-        pj_free( toProj );
-
-    pj_deallocate_grids();
-
-    exit(0); /* normal completion */
-}
diff --git a/src/proj/dmstor.c b/src/proj/dmstor.c
deleted file mode 100644
index f1da537..0000000
--- a/src/proj/dmstor.c
+++ /dev/null
@@ -1,113 +0,0 @@
-/* Convert DMS string to radians */
-#include <projects.h>
-#include <string.h>
-#include <ctype.h>
-
-static double proj_strtod(char *nptr, char **endptr);
-
-/* following should be sufficient for all but the rediculous */
-#define MAX_WORK 64
-	static const char
-*sym = "NnEeSsWw";
-	static const double
-vm[] = {
-	.0174532925199433,
-	.0002908882086657216,
-	.0000048481368110953599
-};
-	double
-dmstor(const char *is, char **rs) {
-	return dmstor_ctx( pj_get_default_ctx(), is, rs );
-}
-
-	double
-dmstor_ctx(projCtx ctx, const char *is, char **rs) {
-	int sign, n, nl;
-	char *p, *s, work[MAX_WORK];
-	double v, tv;
-
-	if (rs)
-		*rs = (char *)is;
-	/* copy sting into work space */
-	while (isspace(sign = *is)) ++is;
-	for (n = MAX_WORK, s = work, p = (char *)is; isgraph(*p) && --n ; )
-		*s++ = *p++;
-	*s = '\0';
-	/* it is possible that a really odd input (like lots of leading
-		zeros) could be truncated in copying into work.  But ... */
-	sign = *(s = work);
-	if (sign == '+' || sign == '-') s++;
-	else sign = '+';
-	for (v = 0., nl = 0 ; nl < 3 ; nl = n + 1 ) {
-		if (!(isdigit(*s) || *s == '.')) break;
-		if ((tv = proj_strtod(s, &s)) == HUGE_VAL)
-			return tv;
-		switch (*s) {
-		case 'D': case 'd':
-			n = 0; break;
-		case '\'':
-			n = 1; break;
-		case '"':
-			n = 2; break;
-		case 'r': case 'R':
-			if (nl) {
-				pj_ctx_set_errno( ctx, -16 );
-				return HUGE_VAL;
-			}
-			++s;
-			v = tv;
-			goto skip;
-		default:
-			v += tv * vm[nl];
-		skip:	n = 4;
-			continue;
-		}
-		if (n < nl) {
-			pj_ctx_set_errno( ctx, -16 );
-			return HUGE_VAL;
-		}
-		v += tv * vm[n];
-		++s;
-	}
-		/* postfix sign */
-	if (*s && (p = strchr(sym, *s))) {
-		sign = (p - sym) >= 4 ? '-' : '+';
-		++s;
-	}
-	if (sign == '-')
-		v = -v;
-	if (rs) /* return point of next char after valid string */
-		*rs = (char *)is + (s - work);
-	return v;
-}
-
-static double
-proj_strtod(char *nptr, char **endptr) 
-
-{
-    char c, *cp = nptr;
-    double result;
-
-    /*
-     * Scan for characters which cause problems with VC++ strtod()
-     */
-    while ((c = *cp) != '\0') {
-        if (c == 'd' || c == 'D') {
-
-            /*
-             * Found one, so NUL it out, call strtod(),
-             * then restore it and return
-             */
-            *cp = '\0';
-            result = strtod(nptr, endptr);
-            *cp = c;
-            return result;
-        }
-        ++cp;
-    }
-
-    /* no offending characters, just handle normally */
-
-    return strtod(nptr, endptr);
-}
-
diff --git a/src/proj/emess.c b/src/proj/emess.c
deleted file mode 100644
index 0c7f6c9..0000000
--- a/src/proj/emess.c
+++ /dev/null
@@ -1,57 +0,0 @@
-/* Error message processing */
-
-#ifdef _MSC_VER
-#  ifndef _CRT_SECURE_NO_DEPRECATE
-#    define _CRT_SECURE_NO_DEPRECATE
-#  endif
-#  ifndef _CRT_NONSTDC_NO_DEPRECATE
-#    define _CRT_NONSTDC_NO_DEPRECATE
-#  endif
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdarg.h>
-#include <errno.h>
-#include <string.h>
-#include <proj_api.h>
-#define EMESS_ROUTINE
-#include "emess.h"
-	void
-emess(int code, char *fmt, ...) {
-	va_list args;
-
-	va_start(args, fmt);
-	/* prefix program name, if given */
-	if (fmt != NULL)
-		(void)fprintf(stderr,"%s\n<%s>: ",pj_get_release(),
-                              emess_dat.Prog_name);
-	/* print file name and line, if given */
-	if (emess_dat.File_name != NULL && *emess_dat.File_name) {
-		(void)fprintf(stderr,"while processing file: %s", emess_dat.File_name);
-		if (emess_dat.File_line > 0)
-			(void)fprintf(stderr,", line %d\n", emess_dat.File_line);
-		else
-			(void)fputc('\n', stderr);
-	} else
-		putc('\n', stderr);
-	/* if |code|==2, print errno code data */
-	if (code == 2 || code == -2)
-		(void)fprintf(stderr, "Sys errno: %d: %s\n",
-			errno,
-#ifdef HAVE_STRERROR
-			strerror(errno));
-#else
-			"<system mess. texts unavail.>");
-#endif
-	/* post remainder of call data */
-	(void)vfprintf(stderr,fmt,args);
-	va_end(args);
-	/* die if code positive */
-	if (code > 0) {
-		(void)fputs("\nprogram abnormally terminated\n", stderr);
-		exit(code);
-	}
-	else
-		putc('\n', stderr);
-}
diff --git a/src/proj/emess.h b/src/proj/emess.h
deleted file mode 100644
index 4106e11..0000000
--- a/src/proj/emess.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/* Error message processing header file */
-#ifndef EMESS_H
-#define EMESS_H
-
-struct EMESS {
-	char	*File_name,	/* input file name */
-			*Prog_name;	/* name of program */
-	int		File_line;	/* approximate line read
-							where error occured */
-};
-
-#ifdef EMESS_ROUTINE	/* use type */
-/* for emess procedure */
-struct EMESS emess_dat = { (char *)0, (char *)0, 0 };
-
-#ifdef sun /* Archaic SunOs 4.1.1, etc. */
-extern char *sys_errlist[];
-#define strerror(n) (sys_errlist[n])
-#endif
-
-#else	/* for for calling procedures */
-
-extern struct EMESS emess_dat;
-void emess(int, char *, ...);
-
-#endif /* use type */
-
-#endif /* end EMESS_H */
diff --git a/src/proj/gen_cheb.c b/src/proj/gen_cheb.c
deleted file mode 100644
index 82cd926..0000000
--- a/src/proj/gen_cheb.c
+++ /dev/null
@@ -1,71 +0,0 @@
-/* generates 'T' option output */
-#define PJ_LIB__
-#include "projects.h"
-#include <stdio.h>
-#include <string.h>
-#include <errno.h>
-#include "emess.h"
-#ifndef COEF_LINE_MAX
-#define COEF_LINE_MAX 60
-#endif
-	void
-gen_cheb(int inverse, projUV (*proj)(projUV), char *s, PJ *P, int iargc, char **iargv) {
-	int NU = 15, NV = 15, i, res = -1, errin = 0, pwr;
-	char *arg, fmt[15];
-	projUV low, upp, resid;
-	Tseries *F;
-	extern void p_series(Tseries *, FILE *, char *);
-	double (*input)(const char *, char **);
-
-	input = inverse ? strtod : dmstor;
-	if (*s) low.u = input(s, &s); else ++errin;
-	if (*s == ',') upp.u = input(s+1, &s); else ++errin;
-	if (*s == ',') low.v = input(s+1, &s); else ++errin;
-	if (*s == ',') upp.v = input(s+1, &s); else ++errin;
-	if (errin)
-		emess(16,"null or absent -T parameters");
-	if (*s == ',') if (*++s != ',') res = strtol(s, &s, 10);
-	if (*s == ',') if (*++s != ',') NU = strtol(s, &s, 10);
-	if (*s == ',') if (*++s != ',') NV = strtol(s, &s, 10);
-	pwr = s && *s && !strcmp(s, ",P");
-	(void)printf("#proj_%s\n#    run-line:\n",
-		pwr ? "Power" : "Chebyshev");
-	if (iargc > 0) { /* proj execution audit trail */
-		int n = 0, L;
-
-		for( i = 0 ; iargc ; --iargc) {
-			arg = *iargv++;
-			if (*arg != '+') {
-				if (!n) { putchar('#'); ++n; }
-				(void)printf(" %s%n",arg, &L);
-				if ((n += L) > 50) { putchar('\n'); n = 0; }
-			}
-		}
-		if (n) putchar('\n');
-	}
-	(void)printf("# projection parameters\n");
-	pj_pr_list(P);
-	if (low.u == upp.u || low.v >= upp.v)
-		emess(16,"approx. argument range error");
-	if (low.u > upp.u)
-		low.u -= TWOPI;
-	if (NU < 2 || NV < 2)
-		emess(16,"approx. work dimensions (%d %d) too small",NU,NV);
-	if (!(F = mk_cheby(low, upp, pow(10., (double)res)*.5, &resid, proj,
-		NU, NV, pwr)))
-		emess(16,"generation of approx failed\nreason: %s\n",
-			pj_strerrno(errno));
-	(void)printf("%c,%.12g,%.12g,%.12g,%.12g,%.12g\n",inverse?'I':'F',
-		P->lam0*RAD_TO_DEG,
-		low.u*(inverse?1.:RAD_TO_DEG),upp.u*(inverse?1.:RAD_TO_DEG),
-		low.v*(inverse?1.:RAD_TO_DEG),upp.v*(inverse?1.:RAD_TO_DEG));
-	if (pwr)
-		strcpy(fmt, "%.15g");
-	else if (res <= 0)
-		(void)sprintf(fmt,"%%.%df",-res+1);
-	else
-		(void)strcpy(fmt,"%.0f");
-	p_series(F, stdout, fmt);
-	(void)printf("# |u,v| sums %g %g\n#end_proj_%s\n",
-		resid.u, resid.v, pwr ? "Power" : "Chebyshev");
-}
diff --git a/src/proj/geocent.c b/src/proj/geocent.c
deleted file mode 100644
index d95a778..0000000
--- a/src/proj/geocent.c
+++ /dev/null
@@ -1,435 +0,0 @@
-/***************************************************************************/
-/* RSC IDENTIFIER:  GEOCENTRIC
- *
- * ABSTRACT
- *
- *    This component provides conversions between Geodetic coordinates (latitude,
- *    longitude in radians and height in meters) and Geocentric coordinates
- *    (X, Y, Z) in meters.
- *
- * ERROR HANDLING
- *
- *    This component checks parameters for valid values.  If an invalid value
- *    is found, the error code is combined with the current error code using 
- *    the bitwise or.  This combining allows multiple error codes to be
- *    returned. The possible error codes are:
- *
- *      GEOCENT_NO_ERROR        : No errors occurred in function
- *      GEOCENT_LAT_ERROR       : Latitude out of valid range
- *                                 (-90 to 90 degrees)
- *      GEOCENT_LON_ERROR       : Longitude out of valid range
- *                                 (-180 to 360 degrees)
- *      GEOCENT_A_ERROR         : Semi-major axis lessthan or equal to zero
- *      GEOCENT_B_ERROR         : Semi-minor axis lessthan or equal to zero
- *      GEOCENT_A_LESS_B_ERROR  : Semi-major axis less than semi-minor axis
- *
- *
- * REUSE NOTES
- *
- *    GEOCENTRIC is intended for reuse by any application that performs
- *    coordinate conversions between geodetic coordinates and geocentric
- *    coordinates.
- *    
- *
- * REFERENCES
- *    
- *    An Improved Algorithm for Geocentric to Geodetic Coordinate Conversion,
- *    Ralph Toms, February 1996  UCRL-JC-123138.
- *    
- *    Further information on GEOCENTRIC can be found in the Reuse Manual.
- *
- *    GEOCENTRIC originated from : U.S. Army Topographic Engineering Center
- *                                 Geospatial Information Division
- *                                 7701 Telegraph Road
- *                                 Alexandria, VA  22310-3864
- *
- * LICENSES
- *
- *    None apply to this component.
- *
- * RESTRICTIONS
- *
- *    GEOCENTRIC has no restrictions.
- *
- * ENVIRONMENT
- *
- *    GEOCENTRIC was tested and certified in the following environments:
- *
- *    1. Solaris 2.5 with GCC version 2.8.1
- *    2. Windows 95 with MS Visual C++ version 6
- *
- * MODIFICATIONS
- *
- *    Date              Description
- *    ----              -----------
- *    25-02-97          Original Code
- *
- */
-
-
-/***************************************************************************/
-/*
- *                               INCLUDES
- */
-#include <math.h>
-#include "geocent.h"
-/*
- *    math.h     - is needed for calls to sin, cos, tan and sqrt.
- *    geocent.h  - is needed for Error codes and prototype error checking.
- */
-
-
-/***************************************************************************/
-/*
- *                               DEFINES
- */
-#define PI         3.14159265358979323e0
-#define PI_OVER_2  (PI / 2.0e0)
-#define FALSE      0
-#define TRUE       1
-#define COS_67P5   0.38268343236508977  /* cosine of 67.5 degrees */
-#define AD_C       1.0026000            /* Toms region 1 constant */
-
-
-/***************************************************************************/
-/*
- *                              FUNCTIONS     
- */
-
-
-long pj_Set_Geocentric_Parameters (GeocentricInfo *gi, double a, double b) 
-
-{ /* BEGIN Set_Geocentric_Parameters */
-/*
- * The function Set_Geocentric_Parameters receives the ellipsoid parameters
- * as inputs and sets the corresponding state variables.
- *
- *    a  : Semi-major axis, in meters.          (input)
- *    b  : Semi-minor axis, in meters.          (input)
- */
-    long Error_Code = GEOCENT_NO_ERROR;
-
-    if (a <= 0.0)
-        Error_Code |= GEOCENT_A_ERROR;
-    if (b <= 0.0)
-        Error_Code |= GEOCENT_B_ERROR;
-    if (a < b)
-        Error_Code |= GEOCENT_A_LESS_B_ERROR;
-    if (!Error_Code)
-    {
-        gi->Geocent_a = a;
-        gi->Geocent_b = b;
-        gi->Geocent_a2 = a * a;
-        gi->Geocent_b2 = b * b;
-        gi->Geocent_e2 = (gi->Geocent_a2 - gi->Geocent_b2) / gi->Geocent_a2;
-        gi->Geocent_ep2 = (gi->Geocent_a2 - gi->Geocent_b2) / gi->Geocent_b2;
-    }
-    return (Error_Code);
-} /* END OF Set_Geocentric_Parameters */
-
-
-void pj_Get_Geocentric_Parameters (GeocentricInfo *gi,
-                                   double *a, 
-                                   double *b)
-{ /* BEGIN Get_Geocentric_Parameters */
-/*
- * The function Get_Geocentric_Parameters returns the ellipsoid parameters
- * to be used in geocentric coordinate conversions.
- *
- *    a  : Semi-major axis, in meters.          (output)
- *    b  : Semi-minor axis, in meters.          (output)
- */
-
-    *a = gi->Geocent_a;
-    *b = gi->Geocent_b;
-} /* END OF Get_Geocentric_Parameters */
-
-
-long pj_Convert_Geodetic_To_Geocentric (GeocentricInfo *gi,
-                                        double Latitude,
-                                        double Longitude,
-                                        double Height,
-                                        double *X,
-                                        double *Y,
-                                        double *Z) 
-{ /* BEGIN Convert_Geodetic_To_Geocentric */
-/*
- * The function Convert_Geodetic_To_Geocentric converts geodetic coordinates
- * (latitude, longitude, and height) to geocentric coordinates (X, Y, Z),
- * according to the current ellipsoid parameters.
- *
- *    Latitude  : Geodetic latitude in radians                     (input)
- *    Longitude : Geodetic longitude in radians                    (input)
- *    Height    : Geodetic height, in meters                       (input)
- *    X         : Calculated Geocentric X coordinate, in meters    (output)
- *    Y         : Calculated Geocentric Y coordinate, in meters    (output)
- *    Z         : Calculated Geocentric Z coordinate, in meters    (output)
- *
- */
-  long Error_Code = GEOCENT_NO_ERROR;
-  double Rn;            /*  Earth radius at location  */
-  double Sin_Lat;       /*  sin(Latitude)  */
-  double Sin2_Lat;      /*  Square of sin(Latitude)  */
-  double Cos_Lat;       /*  cos(Latitude)  */
-
-  /*
-  ** Don't blow up if Latitude is just a little out of the value
-  ** range as it may just be a rounding issue.  Also removed longitude
-  ** test, it should be wrapped by cos() and sin().  NFW for PROJ.4, Sep/2001.
-  */
-  if( Latitude < -PI_OVER_2 && Latitude > -1.001 * PI_OVER_2 )
-      Latitude = -PI_OVER_2;
-  else if( Latitude > PI_OVER_2 && Latitude < 1.001 * PI_OVER_2 )
-      Latitude = PI_OVER_2;
-  else if ((Latitude < -PI_OVER_2) || (Latitude > PI_OVER_2))
-  { /* Latitude out of range */
-    Error_Code |= GEOCENT_LAT_ERROR;
-  }
-
-  if (!Error_Code)
-  { /* no errors */
-    if (Longitude > PI)
-      Longitude -= (2*PI);
-    Sin_Lat = sin(Latitude);
-    Cos_Lat = cos(Latitude);
-    Sin2_Lat = Sin_Lat * Sin_Lat;
-    Rn = gi->Geocent_a / (sqrt(1.0e0 - gi->Geocent_e2 * Sin2_Lat));
-    *X = (Rn + Height) * Cos_Lat * cos(Longitude);
-    *Y = (Rn + Height) * Cos_Lat * sin(Longitude);
-    *Z = ((Rn * (1 - gi->Geocent_e2)) + Height) * Sin_Lat;
-
-  }
-  return (Error_Code);
-} /* END OF Convert_Geodetic_To_Geocentric */
-
-/*
- * The function Convert_Geocentric_To_Geodetic converts geocentric
- * coordinates (X, Y, Z) to geodetic coordinates (latitude, longitude, 
- * and height), according to the current ellipsoid parameters.
- *
- *    X         : Geocentric X coordinate, in meters.         (input)
- *    Y         : Geocentric Y coordinate, in meters.         (input)
- *    Z         : Geocentric Z coordinate, in meters.         (input)
- *    Latitude  : Calculated latitude value in radians.       (output)
- *    Longitude : Calculated longitude value in radians.      (output)
- *    Height    : Calculated height value, in meters.         (output)
- */
-
-#define USE_ITERATIVE_METHOD
-
-void pj_Convert_Geocentric_To_Geodetic (GeocentricInfo *gi,
-                                        double X,
-                                        double Y, 
-                                        double Z,
-                                        double *Latitude,
-                                        double *Longitude,
-                                        double *Height)
-{ /* BEGIN Convert_Geocentric_To_Geodetic */
-#if !defined(USE_ITERATIVE_METHOD)
-/*
- * The method used here is derived from 'An Improved Algorithm for
- * Geocentric to Geodetic Coordinate Conversion', by Ralph Toms, Feb 1996
- */
-
-/* Note: Variable names follow the notation used in Toms, Feb 1996 */
-
-    double W;        /* distance from Z axis */
-    double W2;       /* square of distance from Z axis */
-    double T0;       /* initial estimate of vertical component */
-    double T1;       /* corrected estimate of vertical component */
-    double S0;       /* initial estimate of horizontal component */
-    double S1;       /* corrected estimate of horizontal component */
-    double Sin_B0;   /* sin(B0), B0 is estimate of Bowring aux variable */
-    double Sin3_B0;  /* cube of sin(B0) */
-    double Cos_B0;   /* cos(B0) */
-    double Sin_p1;   /* sin(phi1), phi1 is estimated latitude */
-    double Cos_p1;   /* cos(phi1) */
-    double Rn;       /* Earth radius at location */
-    double Sum;      /* numerator of cos(phi1) */
-    int At_Pole;     /* indicates location is in polar region */
-
-    At_Pole = FALSE;
-    if (X != 0.0)
-    {
-        *Longitude = atan2(Y,X);
-    }
-    else
-    {
-        if (Y > 0)
-        {
-            *Longitude = PI_OVER_2;
-        }
-        else if (Y < 0)
-        {
-            *Longitude = -PI_OVER_2;
-        }
-        else
-        {
-            At_Pole = TRUE;
-            *Longitude = 0.0;
-            if (Z > 0.0)
-            {  /* north pole */
-                *Latitude = PI_OVER_2;
-            }
-            else if (Z < 0.0)
-            {  /* south pole */
-                *Latitude = -PI_OVER_2;
-            }
-            else
-            {  /* center of earth */
-                *Latitude = PI_OVER_2;
-                *Height = -Geocent_b;
-                return;
-            } 
-        }
-    }
-    W2 = X*X + Y*Y;
-    W = sqrt(W2);
-    T0 = Z * AD_C;
-    S0 = sqrt(T0 * T0 + W2);
-    Sin_B0 = T0 / S0;
-    Cos_B0 = W / S0;
-    Sin3_B0 = Sin_B0 * Sin_B0 * Sin_B0;
-    T1 = Z + gi->Geocent_b * gi->Geocent_ep2 * Sin3_B0;
-    Sum = W - gi->Geocent_a * gi->Geocent_e2 * Cos_B0 * Cos_B0 * Cos_B0;
-    S1 = sqrt(T1*T1 + Sum * Sum);
-    Sin_p1 = T1 / S1;
-    Cos_p1 = Sum / S1;
-    Rn = gi->Geocent_a / sqrt(1.0 - gi->Geocent_e2 * Sin_p1 * Sin_p1);
-    if (Cos_p1 >= COS_67P5)
-    {
-        *Height = W / Cos_p1 - Rn;
-    }
-    else if (Cos_p1 <= -COS_67P5)
-    {
-        *Height = W / -Cos_p1 - Rn;
-    }
-    else
-    {
-        *Height = Z / Sin_p1 + Rn * (gi->Geocent_e2 - 1.0);
-    }
-    if (At_Pole == FALSE)
-    {
-        *Latitude = atan(Sin_p1 / Cos_p1);
-    }
-#else /* defined(USE_ITERATIVE_METHOD) */
-/*
-* Reference...
-* ============
-* Wenzel, H.-G.(1985): Hochauflösende Kugelfunktionsmodelle für
-* das Gravitationspotential der Erde. Wiss. Arb. Univ. Hannover
-* Nr. 137, p. 130-131.
-
-* Programmed by GGA- Leibniz-Institue of Applied Geophysics
-*               Stilleweg 2
-*               D-30655 Hannover
-*               Federal Republic of Germany
-*               Internet: www.gga-hannover.de
-*
-*               Hannover, March 1999, April 2004.
-*               see also: comments in statements
-* remarks:
-* Mathematically exact and because of symmetry of rotation-ellipsoid,
-* each point (X,Y,Z) has at least two solutions (Latitude1,Longitude1,Height1) and
-* (Latitude2,Longitude2,Height2). Is point=(0.,0.,Z) (P=0.), so you get even
-* four solutions,	every two symmetrical to the semi-minor axis.
-* Here Height1 and Height2 have at least a difference in order of
-* radius of curvature (e.g. (0,0,b)=> (90.,0.,0.) or (-90.,0.,-2b);
-* (a+100.)*(sqrt(2.)/2.,sqrt(2.)/2.,0.) => (0.,45.,100.) or
-* (0.,225.,-(2a+100.))).
-* The algorithm always computes (Latitude,Longitude) with smallest |Height|.
-* For normal computations, that means |Height|<10000.m, algorithm normally
-* converges after to 2-3 steps!!!
-* But if |Height| has the amount of length of ellipsoid's axis
-* (e.g. -6300000.m),	algorithm needs about 15 steps.
-*/
-
-/* local defintions and variables */
-/* end-criterium of loop, accuracy of sin(Latitude) */
-#define genau   1.E-12
-#define genau2  (genau*genau)
-#define maxiter 30
-
-    double P;        /* distance between semi-minor axis and location */
-    double RR;       /* distance between center and location */
-    double CT;       /* sin of geocentric latitude */
-    double ST;       /* cos of geocentric latitude */
-    double RX;
-    double RK;
-    double RN;       /* Earth radius at location */
-    double CPHI0;    /* cos of start or old geodetic latitude in iterations */
-    double SPHI0;    /* sin of start or old geodetic latitude in iterations */
-    double CPHI;     /* cos of searched geodetic latitude */
-    double SPHI;     /* sin of searched geodetic latitude */
-    double SDPHI;    /* end-criterium: addition-theorem of sin(Latitude(iter)-Latitude(iter-1)) */
-    int At_Pole;     /* indicates location is in polar region */
-    int iter;        /* # of continous iteration, max. 30 is always enough (s.a.) */
-
-    At_Pole = FALSE;
-    P = sqrt(X*X+Y*Y);
-    RR = sqrt(X*X+Y*Y+Z*Z);
-
-/*	special cases for latitude and longitude */
-    if (P/gi->Geocent_a < genau) {
-
-/*  special case, if P=0. (X=0., Y=0.) */
-        At_Pole = TRUE;
-	*Longitude = 0.;
-
-/*  if (X,Y,Z)=(0.,0.,0.) then Height becomes semi-minor axis
- *  of ellipsoid (=center of mass), Latitude becomes PI/2 */
-        if (RR/gi->Geocent_a < genau) {
-            *Latitude = PI_OVER_2;
-            *Height   = -gi->Geocent_b;
-            return ;
-
-        }
-    }
-    else {
-/*  ellipsoidal (geodetic) longitude
- *  interval: -PI < Longitude <= +PI */
-        *Longitude=atan2(Y,X);
-    }
-
-/* --------------------------------------------------------------
- * Following iterative algorithm was developped by
- * "Institut für Erdmessung", University of Hannover, July 1988.
- * Internet: www.ife.uni-hannover.de
- * Iterative computation of CPHI,SPHI and Height.
- * Iteration of CPHI and SPHI to 10**-12 radian resp.
- * 2*10**-7 arcsec.
- * --------------------------------------------------------------
- */
-    CT = Z/RR;
-    ST = P/RR;
-    RX = 1.0/sqrt(1.0-gi->Geocent_e2*(2.0-gi->Geocent_e2)*ST*ST);
-    CPHI0 = ST*(1.0-gi->Geocent_e2)*RX;
-    SPHI0 = CT*RX;
-    iter = 0;
-
-/* loop to find sin(Latitude) resp. Latitude
- * until |sin(Latitude(iter)-Latitude(iter-1))| < genau */
-    do
-    {
-        iter++;
-        RN = gi->Geocent_a/sqrt(1.0-gi->Geocent_e2*SPHI0*SPHI0);
-
-/*  ellipsoidal (geodetic) height */
-        *Height = P*CPHI0+Z*SPHI0-RN*(1.0-gi->Geocent_e2*SPHI0*SPHI0);
-
-        RK = gi->Geocent_e2*RN/(RN+*Height);
-        RX = 1.0/sqrt(1.0-RK*(2.0-RK)*ST*ST);
-        CPHI = ST*(1.0-RK)*RX;
-        SPHI = CT*RX;
-        SDPHI = SPHI*CPHI0-CPHI*SPHI0;
-        CPHI0 = CPHI;
-        SPHI0 = SPHI;
-    }
-    while (SDPHI*SDPHI > genau2 && iter < maxiter);
-
-/*	ellipsoidal (geodetic) latitude */
-    *Latitude=atan(SPHI/fabs(CPHI));
-
-    return;
-#endif /* defined(USE_ITERATIVE_METHOD) */
-} /* END OF Convert_Geocentric_To_Geodetic */
diff --git a/src/proj/geocent.h b/src/proj/geocent.h
deleted file mode 100644
index d6e90d2..0000000
--- a/src/proj/geocent.h
+++ /dev/null
@@ -1,179 +0,0 @@
-#ifndef GEOCENT_H
-#define GEOCENT_H
-
-/***************************************************************************/
-/* RSC IDENTIFIER:  GEOCENTRIC
- *
- * ABSTRACT
- *
- *    This component provides conversions between Geodetic coordinates (latitude,
- *    longitude in radians and height in meters) and Geocentric coordinates
- *    (X, Y, Z) in meters.
- *
- * ERROR HANDLING
- *
- *    This component checks parameters for valid values.  If an invalid value
- *    is found, the error code is combined with the current error code using 
- *    the bitwise or.  This combining allows multiple error codes to be
- *    returned. The possible error codes are:
- *
- *      GEOCENT_NO_ERROR        : No errors occurred in function
- *      GEOCENT_LAT_ERROR       : Latitude out of valid range
- *                                 (-90 to 90 degrees)
- *      GEOCENT_LON_ERROR       : Longitude out of valid range
- *                                 (-180 to 360 degrees)
- *      GEOCENT_A_ERROR         : Semi-major axis less than or equal to zero
- *      GEOCENT_B_ERROR         : Semi-minor axis less than or equal to zero
- *      GEOCENT_A_LESS_B_ERROR  : Semi-major axis less than semi-minor axis
- *
- *
- * REUSE NOTES
- *
- *    GEOCENTRIC is intended for reuse by any application that performs
- *    coordinate conversions between geodetic coordinates and geocentric
- *    coordinates.
- *    
- *
- * REFERENCES
- *    
- *    An Improved Algorithm for Geocentric to Geodetic Coordinate Conversion,
- *    Ralph Toms, February 1996  UCRL-JC-123138.
- *    
- *    Further information on GEOCENTRIC can be found in the Reuse Manual.
- *
- *    GEOCENTRIC originated from : U.S. Army Topographic Engineering Center
- *                                 Geospatial Information Division
- *                                 7701 Telegraph Road
- *                                 Alexandria, VA  22310-3864
- *
- * LICENSES
- *
- *    None apply to this component.
- *
- * RESTRICTIONS
- *
- *    GEOCENTRIC has no restrictions.
- *
- * ENVIRONMENT
- *
- *    GEOCENTRIC was tested and certified in the following environments:
- *
- *    1. Solaris 2.5 with GCC version 2.8.1
- *    2. Windows 95 with MS Visual C++ version 6
- *
- * MODIFICATIONS
- *
- *    Date              Description
- *    ----              -----------
- *
- *
- */
-
-
-/***************************************************************************/
-/*
- *                              DEFINES
- */
-#define GEOCENT_NO_ERROR        0x0000
-#define GEOCENT_LAT_ERROR       0x0001
-#define GEOCENT_LON_ERROR       0x0002
-#define GEOCENT_A_ERROR         0x0004
-#define GEOCENT_B_ERROR         0x0008
-#define GEOCENT_A_LESS_B_ERROR  0x0010
-
-
-/***************************************************************************/
-/*
- *                              FUNCTION PROTOTYPES
- */
-
-/* ensure proper linkage to c++ programs */
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef struct 
-{
-    double Geocent_a;        /* Semi-major axis of ellipsoid in meters */
-    double Geocent_b;        /* Semi-minor axis of ellipsoid           */
-    double Geocent_a2;       /* Square of semi-major axis */
-    double Geocent_b2;       /* Square of semi-minor axis */
-    double Geocent_e2;       /* Eccentricity squared  */
-    double Geocent_ep2;      /* 2nd eccentricity squared */
-} GeocentricInfo;
-
-void pj_Init_Geocentric( GeocentricInfo *gi );
-long pj_Set_Geocentric_Parameters( GeocentricInfo *gi, 
-                                   double a, 
-                                   double b);
-
-/*
- * The function Set_Geocentric_Parameters receives the ellipsoid parameters
- * as inputs and sets the corresponding state variables.
- *
- *    a  : Semi-major axis, in meters.          (input)
- *    b  : Semi-minor axis, in meters.          (input)
- */
-
-
-void pj_Get_Geocentric_Parameters ( GeocentricInfo *gi,
-                                    double *a, 
-                                    double *b);
-
-/*
- * The function Get_Geocentric_Parameters returns the ellipsoid parameters
- * to be used in geocentric coordinate conversions.
- *
- *    a  : Semi-major axis, in meters.          (output)
- *    b  : Semi-minor axis, in meters.          (output)
- */
-
-
-long pj_Convert_Geodetic_To_Geocentric ( GeocentricInfo *gi,
-                                         double Latitude,
-                                         double Longitude,
-                                         double Height,
-                                         double *X,
-                                         double *Y,
-                                         double *Z);
-/*
- * The function Convert_Geodetic_To_Geocentric converts geodetic coordinates
- * (latitude, longitude, and height) to geocentric coordinates (X, Y, Z),
- * according to the current ellipsoid parameters.
- *
- *    Latitude  : Geodetic latitude in radians                     (input)
- *    Longitude : Geodetic longitude in radians                    (input)
- *    Height    : Geodetic height, in meters                       (input)
- *    X         : Calculated Geocentric X coordinate, in meters.   (output)
- *    Y         : Calculated Geocentric Y coordinate, in meters.   (output)
- *    Z         : Calculated Geocentric Z coordinate, in meters.   (output)
- *
- */
-
-
-void pj_Convert_Geocentric_To_Geodetic (GeocentricInfo *gi,
-                                        double X,
-                                        double Y, 
-                                        double Z,
-                                        double *Latitude,
-                                        double *Longitude,
-                                        double *Height);
-/*
- * The function Convert_Geocentric_To_Geodetic converts geocentric
- * coordinates (X, Y, Z) to geodetic coordinates (latitude, longitude, 
- * and height), according to the current ellipsoid parameters.
- *
- *    X         : Geocentric X coordinate, in meters.         (input)
- *    Y         : Geocentric Y coordinate, in meters.         (input)
- *    Z         : Geocentric Z coordinate, in meters.         (input)
- *    Latitude  : Calculated latitude value in radians.       (output)
- *    Longitude : Calculated longitude value in radians.      (output)
- *    Height    : Calculated height value, in meters.         (output)
- */
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* GEOCENT_H */
diff --git a/src/proj/geod.1 b/src/proj/geod.1
deleted file mode 100644
index 7077fd2..0000000
--- a/src/proj/geod.1
+++ /dev/null
@@ -1,206 +0,0 @@
-.\" @(#)geod.1 - 1.1
-.nr LL 5.5i
-.ad b
-.hy 1
-.TH GEOD 1 "2000/03/21 Rel. 4.4" 
-.SH NAME
-geod \- direct geodesic computations
-.br
-invgeod \- inverse geodesic computations
-.SH SYNOPSIS
-.B geod
-.B +ellps=<ellipse>
-[
-.B \-afFIlptwW
-[
-.I args
-] ] [
-.B +args
-]
-file[s]
-.br
-.B invgeod
-.B +ellps=<ellipse>
-[
-.B \-afFIlptwW
-[
-.I args
-] ] [
-.B +args
-]
-file[s]
-.SH DESCRIPTION
-.I Geod
-(direct) and
-.I invgeod
-(inverse)
-perform geodesic (\(``Great Circle\('') computations for determining
-latitude, longitude and back azimuth of a terminus point
-given a initial point latitude, longitude, azimuth and distance (direct) or
-the forward and back azimuths and distance between an initial and
-terminus point latitudes and longitudes (inverse).
-.PP
-The following runline control parameters can appear in any order:
-.TP
-.B \-I
-Specifies that the inverse geodesic computation is to be performed.
-May be used with execution of
-.B goed
-as an alternative to
-.B invgeod
-execution.
-.TP
-.B \-a
-Latitude and longitudes of the initial and terminal points,
-forward and back azimuths and distance are output.
-.TP
-.BI \-t "a"
-.I A
-specifies a character employed as the first character to denote
-a control line to be passed through without processing.
-.TP
-.BI \-le
-Gives a listing of all the ellipsoids that may be selected with the
-.B +ellps=
-option.
-.TP
-.BI \-lu
-Gives a listing of all the units that may be selected with the
-.B +units=
-option.
-.TP
-.BI \-[f|F] " format"
-.I Format
-is a
-.I printf
-format string to control the output form of the geographic coordinate values
-(\fBf\fR) or distance value (\fBF\fR).
-The default mode is DMS for geographic coordinates and "%.3f" for distance.
-.TP
-.BI \-[w|W] n
-.I N
-is the number of significant fractional digits to employ for
-seconds output (when the option is not specified,
-.B \-w3
-is assumed).
-When
-.B \-W
-is employed the fields will be constant width with leading zeroes.
-.TP
-.B \-p
-This option causes the azimuthal values to be output as unsigned
-DMS numbers between 0 and 360 degrees.  Also note -f.
-.PP
-The
-.B +args
-run-line arguments are associated with geodetic parameters
-for specifying the ellipsoidal or sphere to use.
-See
-.B proj
-documentation for full list of these parameters and controls.
-The options are processed in left to right order
-from the run line.
-Reentry of an option is ignored with the first occurrence assumed to
-be the desired value.
-.PP
-One or more
-.I files
-(processed in left to right order)
-specify the source of data to be transformed.
-A \- will specify the location of processing standard input.
-If no files are specified, the input is assumed to be from
-.I stdin.
-.PP
-For direct determinations input data must be in latitude,
-longitude, azimuth and distance order and output will be
-latitude, longitude and back azimuth of the terminus point.
-Latitude, longitude of the initial and terminus point are
-input for the inverse mode and respective forward and back
-azimuth from the initial and terminus points are output along
-with the distance between the points.
-.PP
-Input geographic coordinates
-(latitude and longitude) and azimuthal data must be in DMS format and input
-distance data must be in units consistent with the ellipsoid
-major axis or sphere radius units.
-Output geographic coordinates will be in DMS
-(if the
-.B \-f
-switch is not employed) to 0.001"
-with trailing, zero-valued minute-second fields deleted.
-Output distance data will be in the same units as the ellipsoid or
-sphere radius.
-.PP
-The Earth's ellipsoidal figure may be selected in the same
-manner as program
-.B proj
-by using
-.B "+ellps=, +a=, +es=,"
-etc.
-.PP
-.I Geod
-may also be used to determine intermediate points along either
-a geodesic line between two points or along an arc of specified distance
-from a geographic point.
-In both cases an initial point must be specified with
-.BI +lat_1= lat
-and
-.BI +lon_1= lon
-parameters and either a terminus point
-.BI +lat_2= lat
-and
-.BI +lon_2= lon
-or a distance and azimuth from the initial point with
-.BI +S= distance
-and
-.BI +A= azimuth
-must be specified.
-.PP
-If points along a geodesic are to be determined then either
-.BI +n_S= integer
-specifying the number of intermediate points and/or
-.BI +del_S= distance
-specifying the incremental distance between points must be specified.
-.PP
-To determine points along an arc equidistant from the initial point both
-.BI +del_A= angle
-and
-.BI +n_A= integer
-must be specified which determine the respective angular increments
-and number of points to be determined.
-.RE
-.SH EXAMPLE
-The following script determines the geodesic azimuths and distance in
-U.S. stature miles from Boston, MA, to Portland, OR:
-.RS 5
- \f(CWgeod +ellps=clrk66 <<EOF -I +units=us-mi
- 42d15'N 71d07'W 45d31'N 123d41'W
- EOF\fR
-.RE
-which gives the results:
-.RS 5
- \f(CW-66d31'50.141"   75d39'13.083"   2587.504
-.RE
-where the first two values are the
-azimuth from Boston to Portland, the back azimuth from Portland to
-Boston followed by the distance.
-.PP
-An example of forward geodesic use is to use the Boston location and determine
-Portland's location by azimuth and distance:
-.RS 5
- \f(CWgeod +ellps=clrk66 <<EOF +units=us-mi
- 42d15'N 71d07'W -66d31'50.141" 2587.504
- EOF\fR
-.RE
-which gives:
-.RS 5
- \f(CW45d31'0.003"N   123d40'59.985"W 75d39'13.094"\fR
-.RE
-Note: lack of precision in the distance value compromises
-the precision of the Portland location.
-.SH SEE ALSO
-Thomas, P.D., 1970,
-.I "Spheroidal Geodesics, Reference Systems & Local Geometry:"
-U.S. Naval Oceanographic  Office, S-138.
-.SH HOME PAGE
-http://www.remotesensing.org/proj
diff --git a/src/proj/geod.c b/src/proj/geod.c
deleted file mode 100644
index 87bb0d2..0000000
--- a/src/proj/geod.c
+++ /dev/null
@@ -1,237 +0,0 @@
-/* <<<< Geodesic filter program >>>> */
-# include "projects.h"
-# include "geodesic.h"
-# include "emess.h"
-# include <ctype.h>
-# include <stdio.h>
-# include <string.h>
-
-# define MAXLINE 200
-# define MAX_PARGS 50
-# define TAB putchar('\t')
-	static int
-fullout = 0,	/* output full set of geodesic values */
-tag = '#',	/* beginning of line tag character */
-pos_azi = 0,	/* output azimuths as positive values */
-inverse = 0;	/* != 0 then inverse geodesic */
-	static char
-*oform = (char *)0,	/* output format for decimal degrees */
-*osform = "%.3f",	/* output format for S */
-pline[50],		/* work string */
-*usage =
-"%s\nusage: %s [ -afFIptTwW [args] ] [ +opts[=arg] ] [ files ]\n";
-	static void
-printLL(double p, double l) {
-	if (oform) {
-		(void)printf(oform, p * RAD_TO_DEG); TAB;
-		(void)printf(oform, l * RAD_TO_DEG);
-	} else {
-		(void)fputs(rtodms(pline, p, 'N', 'S'),stdout); TAB;
-		(void)fputs(rtodms(pline, l, 'E', 'W'),stdout);
-	}
-}
-	static void
-do_arc(void) {
-	double az;
-
-	printLL(phi2, lam2); putchar('\n');
-	for (az = al12; n_alpha--; ) {
-		al12 = az = adjlon(az + del_alpha);
-		geod_pre();
-		geod_for();
-		printLL(phi2, lam2); putchar('\n');
-	}
-}
-	static void	/* generate intermediate geodesic coordinates */
-do_geod(void) {
-	double phil, laml, del_S;
-
-	phil = phi2;
-	laml = lam2;
-	printLL(phi1, lam1); putchar('\n');
-	for ( geod_S = del_S = geod_S / n_S; --n_S; geod_S += del_S) {
-		geod_for();
-		printLL(phi2, lam2); putchar('\n');
-	}
-	printLL(phil, laml); putchar('\n');
-}
-	void static	/* file processing function */
-process(FILE *fid) {
-	char line[MAXLINE+3], *s;
-
-	for (;;) {
-		++emess_dat.File_line;
-		if (!(s = fgets(line, MAXLINE, fid)))
-			break;
-		if (!strchr(s, '\n')) { /* overlong line */
-			int c;
-			strcat(s, "\n");
-			/* gobble up to newline */
-			while ((c = fgetc(fid)) != EOF && c != '\n') ;
-		}
-		if (*s == tag) {
-			fputs(line, stdout);
-			continue;
-		}
-		phi1 = dmstor(s, &s);
-		lam1 = dmstor(s, &s);
-		if (inverse) {
-			phi2 = dmstor(s, &s);
-			lam2 = dmstor(s, &s);
-			geod_inv();
-		} else {
-			al12 = dmstor(s, &s);
-			geod_S = strtod(s, &s) * to_meter;
-			geod_pre();
-			geod_for();
-		}
-		if (!*s && (s > line)) --s; /* assumed we gobbled \n */
-		if (pos_azi) {
-			if (al12 < 0.) al12 += TWOPI;
-			if (al21 < 0.) al21 += TWOPI;
-		}
-		if (fullout) {
-			printLL(phi1, lam1); TAB;
-			printLL(phi2, lam2); TAB;
-			if (oform) {
-				(void)printf(oform, al12 * RAD_TO_DEG); TAB;
-				(void)printf(oform, al21 * RAD_TO_DEG); TAB;
-				(void)printf(osform, geod_S * fr_meter);
-			}  else {
-				(void)fputs(rtodms(pline, al12, 0, 0), stdout); TAB;
-				(void)fputs(rtodms(pline, al21, 0, 0), stdout); TAB;
-				(void)printf(osform, geod_S * fr_meter);
-			}
-		} else if (inverse)
-			if (oform) {
-				(void)printf(oform, al12 * RAD_TO_DEG); TAB;
-				(void)printf(oform, al21 * RAD_TO_DEG); TAB;
-				(void)printf(osform, geod_S * fr_meter);
-			} else {
-				(void)fputs(rtodms(pline, al12, 0, 0), stdout); TAB;
-				(void)fputs(rtodms(pline, al21, 0, 0), stdout); TAB;
-				(void)printf(osform, geod_S * fr_meter);
-			}
-		else {
-			printLL(phi2, lam2); TAB;
-			if (oform)
-				(void)printf(oform, al21 * RAD_TO_DEG);
-			else
-				(void)fputs(rtodms(pline, al21, 0, 0), stdout);
-		}
-		(void)fputs(s, stdout);
-	}
-}
-
-static char *pargv[MAX_PARGS];
-static int   pargc = 0;
-
-int main(int argc, char **argv) {
-	char *arg, **eargv = argv, *strnchr();
-	FILE *fid;
-	static int eargc = 0, c;
-
-	if ((emess_dat.Prog_name = strrchr(*argv,'/')) != NULL) ++emess_dat.Prog_name;
-	else emess_dat.Prog_name = *argv;
-	inverse = ! strncmp(emess_dat.Prog_name, "inv", 3);
-	if (argc <= 1 ) {
-		(void)fprintf(stderr, usage, pj_get_release(),
-                              emess_dat.Prog_name);
-		exit (0);
-	}
-		/* process run line arguments */
-	while (--argc > 0) { /* collect run line arguments */
-		if(**++argv == '-') for(arg = *argv;;) {
-			switch(*++arg) {
-			case '\0': /* position of "stdin" */
-				if (arg[-1] == '-') eargv[eargc++] = "-";
-				break;
-			case 'a': /* output full set of values */
-				fullout = 1;
-				continue;
-			case 'I': /* alt. inverse spec. */
-				inverse = 1;
-				continue;
-			case 't': /* set col. one char */
-				if (arg[1]) tag = *++arg;
-				else emess(1,"missing -t col. 1 tag");
-				continue;
-			case 'W': /* specify seconds precision */
-			case 'w': /* -W for constant field width */
-				if ((c = arg[1]) && isdigit(c)) {
-					set_rtodms(c - '0', *arg == 'W');
-					++arg;
-				} else
-				    emess(1,"-W argument missing or non-digit");
-				continue;
-			case 'f': /* alternate output format degrees or xy */
-				if (--argc <= 0)
-noargument:		   emess(1,"missing argument for -%c",*arg);
-				oform = *++argv;
-				continue;
-			case 'F': /* alternate output format degrees or xy */
-				if (--argc <= 0) goto noargument;
-				osform = *++argv;
-				continue;
-			case 'l':
-				if (!arg[1] || arg[1] == 'e') { /* list of ellipsoids */
-                                    struct PJ_ELLPS *le;
-                                    
-                                    for (le=pj_get_ellps_ref(); le->id ; ++le)
-                                        (void)printf("%9s %-16s %-16s %s\n",
-                                                     le->id, le->major, le->ell, le->name);
-				} else if (arg[1] == 'u') { /* list of units */
-                                    struct PJ_UNITS *lu;
-                                    
-                                    for (lu = pj_get_units_ref();lu->id ; ++lu)
-                                        (void)printf("%12s %-20s %s\n",
-                                                     lu->id, lu->to_meter, lu->name);
-				} else
-                                    emess(1,"invalid list option: l%c",arg[1]);
-                                exit( 0 );
-			case 'p': /* output azimuths as positive */
-				pos_azi = 1;
-				continue;
-			default:
-				emess(1, "invalid option: -%c",*arg);
-				break;
-			}
-			break;
-		} else if (**argv == '+') /* + argument */
-			if (pargc < MAX_PARGS)
-				pargv[pargc++] = *argv + 1;
-			else
-				emess(1,"overflowed + argument table");
-		else /* assumed to be input file name(s) */
-			eargv[eargc++] = *argv;
-	}
-	/* done with parameter and control input */
-	geod_set(pargc, pargv); /* setup projection */
-	if ((n_alpha || n_S) && eargc)
-		emess(1,"files specified for arc/geodesic mode");
-	if (n_alpha)
-		do_arc();
-	else if (n_S)
-		do_geod();
-	else { /* process input file list */
-		if (eargc == 0) /* if no specific files force sysin */
-			eargv[eargc++] = "-";
-		for ( ; eargc-- ; ++eargv) {
-			if (**eargv == '-') {
-				fid = stdin;
-				emess_dat.File_name = "<stdin>";
-			} else {
-				if ((fid = fopen(*eargv, "r")) == NULL) {
-					emess(-2, *eargv, "input file");
-					continue;
-				}
-				emess_dat.File_name = *eargv;
-			}
-			emess_dat.File_line = 0;
-			process(fid);
-			(void)fclose(fid);
-			emess_dat.File_name = (char *)0;
-		}
-	}
-	exit(0); /* normal completion */
-}
diff --git a/src/proj/geod_for.c b/src/proj/geod_for.c
deleted file mode 100644
index fe7c90d..0000000
--- a/src/proj/geod_for.c
+++ /dev/null
@@ -1,103 +0,0 @@
-# include "projects.h"
-# include "geodesic.h"
-# define MERI_TOL 1e-9
-	static double
-th1,costh1,sinth1,sina12,cosa12,M,N,c1,c2,D,P,s1;
-	static int
-merid, signS;
-	void
-geod_pre(void) {
-	al12 = adjlon(al12); /* reduce to  +- 0-PI */
-	signS = fabs(al12) > HALFPI ? 1 : 0;
-	th1 = ellipse ? atan(onef * tan(phi1)) : phi1;
-	costh1 = cos(th1);
-	sinth1 = sin(th1);
-	if ((merid = fabs(sina12 = sin(al12)) < MERI_TOL)) {
-		sina12 = 0.;
-		cosa12 = fabs(al12) < HALFPI ? 1. : -1.;
-		M = 0.;
-	} else {
-		cosa12 = cos(al12);
-		M = costh1 * sina12;
-	}
-	N = costh1 * cosa12;
-	if (ellipse) {
-		if (merid) {
-			c1 = 0.;
-			c2 = f4;
-			D = 1. - c2;
-			D *= D;
-			P = c2 / D;
-		} else {
-			c1 = geod_f * M;
-			c2 = f4 * (1. - M * M);
-			D = (1. - c2)*(1. - c2 - c1 * M);
-			P = (1. + .5 * c1 * M) * c2 / D;
-		}
-	}
-	if (merid) s1 = HALFPI - th1;
-	else {
-		s1 = (fabs(M) >= 1.) ? 0. : acos(M);
-		s1 =  sinth1 / sin(s1);
-		s1 = (fabs(s1) >= 1.) ? 0. : acos(s1);
-	}
-}
-	void
-geod_for(void) {
-	double d,sind,u,V,X,ds,cosds,sinds,ss,de;
-
-	if (ellipse) {
-		d = geod_S / (D * geod_a);
-		if (signS) d = -d;
-		u = 2. * (s1 - d);
-		V = cos(u + d);
-		X = c2 * c2 * (sind = sin(d)) * cos(d) * (2. * V * V - 1.);
-		ds = d + X - 2. * P * V * (1. - 2. * P * cos(u)) * sind;
-		ss = s1 + s1 - ds;
-	} else {
-		ds = geod_S / geod_a;
-		if (signS) ds = - ds;
-	}
-	cosds = cos(ds);
-	sinds = sin(ds);
-	if (signS) sinds = - sinds;
-	al21 = N * cosds - sinth1 * sinds;
-	if (merid) {
-		phi2 = atan( tan(HALFPI + s1 - ds) / onef);
-		if (al21 > 0.) {
-			al21 = PI;
-			if (signS)
-				de = PI;
-			else {
-				phi2 = - phi2;
-				de = 0.;
-			}
-		} else {
-			al21 = 0.;
-			if (signS) {
-				phi2 = - phi2;
-				de = 0;
-			} else
-				de = PI;
-		}
-	} else {
-		al21 = atan(M / al21);
-		if (al21 > 0)
-			al21 += PI;
-		if (al12 < 0.)
-			al21 -= PI;
-		al21 = adjlon(al21);
-		phi2 = atan(-(sinth1 * cosds + N * sinds) * sin(al21) /
-			(ellipse ? onef * M : M));
-		de = atan2(sinds * sina12 ,
-			(costh1 * cosds - sinth1 * sinds * cosa12));
-		if (ellipse)
-			if (signS)
-				de += c1 * ((1. - c2) * ds +
-					c2 * sinds * cos(ss));
-			else
-				de -= c1 * ((1. - c2) * ds -
-					c2 * sinds * cos(ss));
-	}
-	lam2 = adjlon( lam1 + de );
-}
diff --git a/src/proj/geod_inv.c b/src/proj/geod_inv.c
deleted file mode 100644
index c0c8dbb..0000000
--- a/src/proj/geod_inv.c
+++ /dev/null
@@ -1,56 +0,0 @@
-# include "projects.h"
-# include "geodesic.h"
-# define DTOL	1e-12
-	void
-geod_inv(void) {
-	double	th1,th2,thm,dthm,dlamm,dlam,sindlamm,costhm,sinthm,cosdthm,
-		sindthm,L,E,cosd,d,X,Y,T,sind,tandlammp,u,v,D,A,B;
-
-	if (ellipse) {
-		th1 = atan(onef * tan(phi1));
-		th2 = atan(onef * tan(phi2));
-	} else {
-		th1 = phi1;
-		th2 = phi2;
-	}
-	thm = .5 * (th1 + th2);
-	dthm = .5 * (th2 - th1);
-	dlamm = .5 * ( dlam = adjlon(lam2 - lam1) );
-	if (fabs(dlam) < DTOL && fabs(dthm) < DTOL) {
-		al12 =  al21 = geod_S = 0.;
-		return;
-	}
-	sindlamm = sin(dlamm);
-	costhm = cos(thm);	sinthm = sin(thm);
-	cosdthm = cos(dthm);	sindthm = sin(dthm);
-	L = sindthm * sindthm + (cosdthm * cosdthm - sinthm * sinthm)
-		* sindlamm * sindlamm;
-	d = acos(cosd = 1 - L - L);
-	if (ellipse) {
-		E = cosd + cosd;
-		sind = sin( d );
-		Y = sinthm * cosdthm;
-		Y *= (Y + Y) / (1. - L);
-		T = sindthm * costhm;
-		T *= (T + T) / L;
-		X = Y + T;
-		Y -= T;
-		T = d / sind;
-		D = 4. * T * T;
-		A = D * E;
-		B = D + D;
-		geod_S = geod_a * sind * (T - f4 * (T * X - Y) +
-			f64 * (X * (A + (T - .5 * (A - E)) * X) -
-			Y * (B + E * Y) + D * X * Y));
-		tandlammp = tan(.5 * (dlam - .25 * (Y + Y - E * (4. - X)) *
-			(f2 * T + f64 * (32. * T - (20. * T - A)
-			* X - (B + 4.) * Y)) * tan(dlam)));
-	} else {
-		geod_S = geod_a * d;
-		tandlammp = tan(dlamm);
-	}
-	u = atan2(sindthm , (tandlammp * costhm));
-	v = atan2(cosdthm , (tandlammp * sinthm));
-	al12 = adjlon(TWOPI + v - u);
-	al21 = adjlon(TWOPI - v - u);
-}
diff --git a/src/proj/geod_set.c b/src/proj/geod_set.c
deleted file mode 100644
index 141091a..0000000
--- a/src/proj/geod_set.c
+++ /dev/null
@@ -1,74 +0,0 @@
-
-#define _IN_GEOD_SET
-
-#include <string.h>
-#include "projects.h"
-#include "geodesic.h"
-#include "emess.h"
-	void
-geod_set(int argc, char **argv) {
-	paralist *start = 0, *curr;
-	double es;
-	char *name;
-	int i;
-
-    /* put arguments into internal linked list */
-	if (argc <= 0)
-		emess(1, "no arguments in initialization list");
-	for (i = 0; i < argc; ++i)
-		if (i)
-			curr = curr->next = pj_mkparam(argv[i]);
-		else
-			start = curr = pj_mkparam(argv[i]);
-	/* set elliptical parameters */
-	if (pj_ell_set(pj_get_default_ctx(),start, &geod_a, &es)) emess(1,"ellipse setup failure");
-	/* set units */
-	if ((name = pj_param(NULL,start, "sunits").s) != NULL) {
-		char *s;
-                struct PJ_UNITS *unit_list = pj_get_units_ref();
-		for (i = 0; (s = unit_list[i].id) && strcmp(name, s) ; ++i) ;
-		if (!s)
-			emess(1,"%s unknown unit conversion id", name);
-		fr_meter = 1. / (to_meter = atof(unit_list[i].to_meter));
-	} else
-		to_meter = fr_meter = 1.;
-	if ((ellipse = es) != 0.) {
-		onef = sqrt(1. - es);
-		geod_f = 1 - onef;
-		f2 = geod_f/2;
-		f4 = geod_f/4;
-		f64 = geod_f*geod_f/64;
-	} else {
-		onef = 1.;
-		geod_f = f2 = f4 = f64 = 0.;
-	}
-	/* check if line or arc mode */
-	if (pj_param(NULL,start, "tlat_1").i) {
-		double del_S;
-#undef f
-		phi1 = pj_param(NULL,start, "rlat_1").f;
-		lam1 = pj_param(NULL,start, "rlon_1").f;
-		if (pj_param(NULL,start, "tlat_2").i) {
-			phi2 = pj_param(NULL,start, "rlat_2").f;
-			lam2 = pj_param(NULL,start, "rlon_2").f;
-			geod_inv();
-			geod_pre();
-		} else if ((geod_S = pj_param(NULL,start, "dS").f) != 0.) {
-			al12 = pj_param(NULL,start, "rA").f;
-			geod_pre();
-			geod_for();
-		} else emess(1,"incomplete geodesic/arc info");
-		if ((n_alpha = pj_param(NULL,start, "in_A").i) > 0) {
-			if (!(del_alpha = pj_param(NULL,start, "rdel_A").f))
-				emess(1,"del azimuth == 0");
-		} else if ((del_S = fabs(pj_param(NULL,start, "ddel_S").f)) != 0.) {
-			n_S = geod_S / del_S + .5;
-		} else if ((n_S = pj_param(NULL,start, "in_S").i) <= 0)
-			emess(1,"no interval divisor selected");
-	}
-	/* free up linked list */
-	for ( ; start; start = curr) {
-		curr = start->next;
-		pj_dalloc(start);
-	}
-}
diff --git a/src/proj/geodesic.h b/src/proj/geodesic.h
deleted file mode 100644
index 268cff5..0000000
--- a/src/proj/geodesic.h
+++ /dev/null
@@ -1,51 +0,0 @@
-#ifndef lint
-static char GEODESIC_H_ID[] = "@(#)geodesic.h	4.3	95/08/19	GIE	REL";
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifndef _IN_GEOD_SET
-#  define GEOD_EXTERN extern
-#else
-#  define GEOD_EXTERN
-#endif
-
-GEOD_EXTERN struct geodesic {
-	double	A;
-	double	LAM1, PHI1, ALPHA12;
-	double	LAM2, PHI2, ALPHA21;
-	double	DIST;
-	double	ONEF, FLAT, FLAT2, FLAT4, FLAT64;
-	int	ELLIPSE;
-} GEODESIC;
-
-# define geod_a	GEODESIC.A
-# define lam1	GEODESIC.LAM1
-# define phi1	GEODESIC.PHI1
-# define al12	GEODESIC.ALPHA12
-# define lam2	GEODESIC.LAM2
-# define phi2	GEODESIC.PHI2
-# define al21	GEODESIC.ALPHA21
-# define geod_S	GEODESIC.DIST
-# define geod_f	GEODESIC.FLAT
-# define onef	GEODESIC.ONEF
-# define f2	GEODESIC.FLAT2
-# define f4	GEODESIC.FLAT4
-# define ff2	GEODESIC.FLAT4
-# define f64	GEODESIC.FLAT64
-# define ellipse GEODESIC.ELLIPSE
-
-    
-GEOD_EXTERN int n_alpha, n_S;
-GEOD_EXTERN double to_meter, fr_meter, del_alpha;
-	
-void geod_set(int, char **);
-void geod_for(void);
-void geod_pre(void);
-void geod_inv(void);
-
-#ifdef __cplusplus
-}
-#endif
diff --git a/src/proj/jniproj.c b/src/proj/jniproj.c
deleted file mode 100644
index 931f85c..0000000
--- a/src/proj/jniproj.c
+++ /dev/null
@@ -1,631 +0,0 @@
-/******************************************************************************
- * $Id: jniproj.c 1950 2012-05-10 16:51:51Z caress $
- *
- * Project:  PROJ.4
- * Purpose:  Java/JNI wrappers for PROJ.4 API.
- * Author:   Antonello Andrea
- *           Martin Desruisseaux
- *
- ******************************************************************************
- * Copyright (c) 2005, Antonello Andrea
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *****************************************************************************/
-
-/*!
- * \file jniproj.c
- *
- * \brief
- * Functions used by the Java Native Interface (JNI) wrappers of Proj.4
- *
- *
- * \author Antonello Andrea
- * \date   Wed Oct 20 23:10:24 CEST 2004
- *
- * \author Martin Desruisseaux
- * \date   August 2011
- */
-
-#include "proj_config.h"
-
-#ifdef JNI_ENABLED
-
-#include <math.h>
-#include <string.h>
-#include "projects.h"
-#include "org_proj4_PJ.h"
-#include <jni.h>
-
-#define PJ_FIELD_NAME "ptr"
-#define PJ_FIELD_TYPE "J"
-#define PJ_MAX_DIMENSION 100
-/* The PJ_MAX_DIMENSION value appears also in quoted strings.
-   Please perform a search-and-replace if this value is changed. */
-
-PJ_CVSID("$Id: jniproj.c 1950 2012-05-10 16:51:51Z caress $");
-
-
-/*!
- * \brief
- * Internal method returning the address of the PJ structure wrapped by the given Java object.
- * This function looks for a field named "ptr" and of type "long" (Java signature "J") in the
- * given object.
- *
- * \param  env    - The JNI environment.
- * \param  object - The Java object wrapping the PJ structure (not allowed to be NULL).
- * \return The address of the PJ structure, or NULL if the operation fails (for example
- *         because the "ptr" field was not found).
- */
-PJ *getPJ(JNIEnv *env, jobject object)
-{
-    jfieldID id = (*env)->GetFieldID(env, (*env)->GetObjectClass(env, object), PJ_FIELD_NAME, PJ_FIELD_TYPE);
-    return (id) ? (PJ*) (*env)->GetLongField(env, object, id) : NULL;
-}
-
-/*!
- * \brief
- * Returns the Proj4 release number.
- *
- * \param  env   - The JNI environment.
- * \param  class - The class from which this method has been invoked.
- * \return The Proj4 release number, or NULL.
- */
-JNIEXPORT jstring JNICALL Java_org_proj4_PJ_getVersion
-  (JNIEnv *env, jclass class)
-{
-    const char *desc = pj_get_release();
-    return (desc) ? (*env)->NewStringUTF(env, desc) : NULL;
-}
-
-/*!
- * \brief
- * Allocates a new PJ structure from a definition string.
- *
- * \param  env        - The JNI environment.
- * \param  class      - The class from which this method has been invoked.
- * \param  definition - The string definition to be given to Proj4.
- * \return The address of the new PJ structure, or 0 in case of failure.
- */
-JNIEXPORT jlong JNICALL Java_org_proj4_PJ_allocatePJ
-  (JNIEnv *env, jclass class, jstring definition)
-{
-    const char *def_utf = (*env)->GetStringUTFChars(env, definition, NULL);
-    if (!def_utf) return 0; /* OutOfMemoryError already thrown. */
-    PJ *pj = pj_init_plus(def_utf);
-    (*env)->ReleaseStringUTFChars(env, definition, def_utf);
-    return (jlong) pj;
-}
-
-/*!
- * \brief
- * Allocates a new geographic PJ structure from an existing one.
- *
- * \param  env       - The JNI environment.
- * \param  class     - The class from which this method has been invoked.
- * \param  projected - The PJ object from which to derive a new one.
- * \return The address of the new PJ structure, or 0 in case of failure.
- */
-JNIEXPORT jlong JNICALL Java_org_proj4_PJ_allocateGeoPJ
-  (JNIEnv *env, jclass class, jobject projected)
-{
-    PJ *pj = getPJ(env, projected);
-    return (pj) ? (jlong) pj_latlong_from_proj(pj) : 0;
-}
-
-/*!
- * \brief
- * Returns the definition string.
- *
- * \param  env    - The JNI environment.
- * \param  object - The Java object wrapping the PJ structure (not allowed to be NULL).
- * \return The definition string.
- */
-JNIEXPORT jstring JNICALL Java_org_proj4_PJ_getDefinition
-  (JNIEnv *env, jobject object)
-{
-    PJ *pj = getPJ(env, object);
-    if (pj) {
-        char *desc = pj_get_def(pj, 0);
-        if (desc) {
-            jstring str = (*env)->NewStringUTF(env, desc);
-            pj_dalloc(desc);
-            return str;
-        }
-    }
-    return NULL;
-}
-
-/*!
- * \brief
- * Returns the description associated to the PJ structure.
- *
- * \param  env    - The JNI environment.
- * \param  object - The Java object wrapping the PJ structure (not allowed to be NULL).
- * \return The description associated to the PJ structure.
- */
-JNIEXPORT jstring JNICALL Java_org_proj4_PJ_toString
-  (JNIEnv *env, jobject object)
-{
-    PJ *pj = getPJ(env, object);
-    if (pj) {
-        const char *desc = pj->descr;
-        if (desc) {
-            return (*env)->NewStringUTF(env, desc);
-        }
-    }
-    return NULL;
-}
-
-/*!
- * \brief
- * Returns the CRS type as one of the PJ.Type enum: GEOGRAPHIC, GEOCENTRIC or PROJECTED.
- * This function should never return NULL, unless class or fields have been renamed in
- * such a way that we can not find anymore the expected enum values.
- *
- * \param  env    - The JNI environment.
- * \param  object - The Java object wrapping the PJ structure (not allowed to be NULL).
- * \return The CRS type as one of the PJ.Type enum.
- */
-JNIEXPORT jobject JNICALL Java_org_proj4_PJ_getType
-  (JNIEnv *env, jobject object)
-{
-    PJ *pj = getPJ(env, object);
-    if (pj) {
-        const char *type;
-        if (pj_is_latlong(pj)) {
-            type = "GEOGRAPHIC";
-        } else if (pj_is_geocent(pj)) {
-            type = "GEOCENTRIC";
-        } else {
-            type = "PROJECTED";
-        }
-        jclass c = (*env)->FindClass(env, "org/proj4/PJ$Type");
-        if (c) {
-            jfieldID id = (*env)->GetStaticFieldID(env, c, type, "Lorg/proj4/PJ$Type;");
-            if (id) {
-                return (*env)->GetStaticObjectField(env, c, id);
-            }
-        }
-    }
-    return NULL;
-}
-
-/*!
- * \brief
- * Returns the semi-major axis length.
- *
- * \param  env    - The JNI environment.
- * \param  object - The Java object wrapping the PJ structure (not allowed to be NULL).
- * \return The semi-major axis length.
- */
-JNIEXPORT jdouble JNICALL Java_org_proj4_PJ_getSemiMajorAxis
-  (JNIEnv *env, jobject object)
-{
-    PJ *pj = getPJ(env, object);
-    return pj ? pj->a_orig : NAN;
-}
-
-/*!
- * \brief
- * Computes the semi-minor axis length from the semi-major axis length and the eccentricity
- * squared.
- *
- * \param  env    - The JNI environment.
- * \param  object - The Java object wrapping the PJ structure (not allowed to be NULL).
- * \return The semi-minor axis length.
- */
-JNIEXPORT jdouble JNICALL Java_org_proj4_PJ_getSemiMinorAxis
-  (JNIEnv *env, jobject object)
-{
-    PJ *pj = getPJ(env, object);
-    if (!pj) return NAN;
-    double a = pj->a_orig;
-    return sqrt(a*a * (1.0 - pj->es_orig));
-}
-
-/*!
- * \brief
- * Returns the eccentricity squared.
- *
- * \param  env    - The JNI environment.
- * \param  object - The Java object wrapping the PJ structure (not allowed to be NULL).
- * \return The eccentricity.
- */
-JNIEXPORT jdouble JNICALL Java_org_proj4_PJ_getEccentricitySquared
-  (JNIEnv *env, jobject object)
-{
-    PJ *pj = getPJ(env, object);
-    return pj ? pj->es_orig : NAN;
-}
-
-/*!
- * \brief
- * Returns an array of character indicating the direction of each axis.
- *
- * \param  env    - The JNI environment.
- * \param  object - The Java object wrapping the PJ structure (not allowed to be NULL).
- * \return The axis directions.
- */
-JNIEXPORT jcharArray JNICALL Java_org_proj4_PJ_getAxisDirections
-  (JNIEnv *env, jobject object)
-{
-    PJ *pj = getPJ(env, object);
-    if (pj) {
-        int length = strlen(pj->axis);
-        jcharArray array = (*env)->NewCharArray(env, length);
-        if (array) {
-            jchar* axis = (*env)->GetCharArrayElements(env, array, NULL);
-            if (axis) {
-                /* Don't use memcp because the type may not be the same. */
-                int i;
-                for (i=0; i<length; i++) {
-                    axis[i] = pj->axis[i];
-                }
-                (*env)->ReleaseCharArrayElements(env, array, axis, 0);
-            }
-            return array;
-        }
-    }
-    return NULL;
-}
-
-/*!
- * \brief
- * Longitude of the prime meridian measured from the Greenwich meridian, positive eastward.
- *
- * \param env    - The JNI environment.
- * \param object - The Java object wrapping the PJ structure (not allowed to be NULL).
- * \return The prime meridian longitude, in degrees.
- */
-JNIEXPORT jdouble JNICALL Java_org_proj4_PJ_getGreenwichLongitude
-  (JNIEnv *env, jobject object)
-{
-    PJ *pj = getPJ(env, object);
-    return (pj) ? (pj->from_greenwich)*(180/M_PI) : NAN;
-}
-
-/*!
- * \brief
- * Returns the conversion factor from linear units to metres.
- *
- * \param env      - The JNI environment.
- * \param object   - The Java object wrapping the PJ structure (not allowed to be NULL).
- * \param vertical - JNI_FALSE for horizontal axes, or JNI_TRUE for the vertical axis.
- * \return The conversion factor to metres.
- */
-JNIEXPORT jdouble JNICALL Java_org_proj4_PJ_getLinearUnitToMetre
-  (JNIEnv *env, jobject object, jboolean vertical)
-{
-    PJ *pj = getPJ(env, object);
-    if (pj) {
-        return (vertical) ? pj->vto_meter : pj->to_meter;
-    }
-    return NAN;
-}
-
-/*!
- * \brief
- * Converts input values from degrees to radians before coordinate operation, or the output
- * values from radians to degrees after the coordinate operation.
- *
- * \param pj        - The Proj.4 PJ structure.
- * \param data      - The coordinate array to transform.
- * \param numPts    - Number of points to transform.
- * \param dimension - Dimension of points in the coordinate array.
- * \param factor    - The scale factor to apply: M_PI/180 for inputs or 180/M_PI for outputs.
- */
-void convertAngularOrdinates(PJ *pj, double* data, jint numPts, int dimension, double factor) {
-    int dimToSkip;
-    if (pj_is_latlong(pj)) {
-        /* Convert only the 2 first ordinates and skip all the other dimensions. */
-        dimToSkip = dimension - 2;
-    } else if (pj_is_geocent(pj)) {
-        /* Convert only the 3 first ordinates and skip all the other dimensions. */
-        dimToSkip = dimension - 3;
-    } else {
-        /* Not a geographic or geocentric CRS: nothing to convert. */
-        return;
-    }
-    double *stop = data + dimension*numPts;
-    if (dimToSkip > 0) {
-        while (data != stop) {
-            (*data++) *= factor;
-            (*data++) *= factor;
-            data += dimToSkip;
-        }
-    } else {
-        while (data != stop) {
-            (*data++) *= factor;
-        }
-    }
-}
-
-/*!
- * \brief
- * Transforms in-place the coordinates in the given array.
- *
- * \param env         - The JNI environment.
- * \param object      - The Java object wrapping the PJ structure (not allowed to be NULL).
- * \param target      - The target CRS.
- * \param dimension   - The dimension of each coordinate value. Must be equals or greater than 2.
- * \param coordinates - The coordinates to transform, as a sequence of (x,y,<z>,...) tuples.
- * \param offset      - Offset of the first coordinate in the given array.
- * \param numPts      - Number of points to transform.
- */
-JNIEXPORT void JNICALL Java_org_proj4_PJ_transform
-  (JNIEnv *env, jobject object, jobject target, jint dimension, jdoubleArray coordinates, jint offset, jint numPts)
-{
-    if (!target || !coordinates) {
-        jclass c = (*env)->FindClass(env, "java/lang/NullPointerException");
-        if (c) (*env)->ThrowNew(env, c, "The target CRS and the coordinates array can not be null.");
-        return;
-    }
-    if (dimension < 2 || dimension > PJ_MAX_DIMENSION) { /* Arbitrary upper value for catching potential misuse. */
-        jclass c = (*env)->FindClass(env, "java/lang/IllegalArgumentException");
-        if (c) (*env)->ThrowNew(env, c, "Illegal dimension. Must be in the [2-100] range.");
-        return;
-    }
-    if ((offset < 0) || (numPts < 0) || (offset + dimension*numPts) > (*env)->GetArrayLength(env, coordinates)) {
-        jclass c = (*env)->FindClass(env, "java/lang/ArrayIndexOutOfBoundsException");
-        if (c) (*env)->ThrowNew(env, c, "Illegal offset or illegal number of points.");
-        return;
-    }
-    PJ *src_pj = getPJ(env, object);
-    PJ *dst_pj = getPJ(env, target);
-    if (src_pj && dst_pj) {
-        /* Using GetPrimitiveArrayCritical/ReleasePrimitiveArrayCritical rather than
-           GetDoubleArrayElements/ReleaseDoubleArrayElements increase the chances that
-           the JVM returns direct reference to its internal array without copying data.
-           However we must promise to run the "critical" code fast, to not make any
-           system call that may wait for the JVM and to not invoke any other JNI method. */
-        double *data = (*env)->GetPrimitiveArrayCritical(env, coordinates, NULL);
-        if (data) {
-            double *x = data + offset;
-            double *y = x + 1;
-            double *z = (dimension >= 3) ? y+1 : NULL;
-            convertAngularOrdinates(src_pj, x, numPts, dimension, M_PI/180);
-            int err = pj_transform(src_pj, dst_pj, numPts, dimension, x, y, z);
-            convertAngularOrdinates(dst_pj, x, numPts, dimension, 180/M_PI);
-            (*env)->ReleasePrimitiveArrayCritical(env, coordinates, data, 0);
-            if (err) {
-                jclass c = (*env)->FindClass(env, "org/proj4/PJException");
-                if (c) (*env)->ThrowNew(env, c, pj_strerrno(err));
-            }
-        }
-    }
-}
-
-/*!
- * \brief
- * Returns a description of the last error that occurred, or NULL if none.
- *
- * \param  env    - The JNI environment.
- * \param  object - The Java object wrapping the PJ structure (not allowed to be NULL).
- * \return The last error, or NULL.
- */
-JNIEXPORT jstring JNICALL Java_org_proj4_PJ_getLastError
-  (JNIEnv *env, jobject object)
-{
-    PJ *pj = getPJ(env, object);
-    if (pj) {
-        int err = pj_ctx_get_errno(pj->ctx);
-        if (err) {
-            return (*env)->NewStringUTF(env, pj_strerrno(err));
-        }
-    }
-    return NULL;
-}
-
-/*!
- * \brief
- * Deallocate the PJ structure. This method is invoked by the garbage collector exactly once.
- * This method will also set the Java "ptr" final field to 0 as a safety. In theory we are not
- * supposed to change the value of a final field. But no Java code should use this field, and
- * the PJ object is being garbage collected anyway. We set the field to 0 as a safety in case
- * some user invoked the finalize() method explicitely despite our warning in the Javadoc to
- * never do such thing.
- *
- * \param env    - The JNI environment.
- * \param object - The Java object wrapping the PJ structure (not allowed to be NULL).
- */
-JNIEXPORT void JNICALL Java_org_proj4_PJ_finalize
-  (JNIEnv *env, jobject object)
-{
-    jfieldID id = (*env)->GetFieldID(env, (*env)->GetObjectClass(env, object), PJ_FIELD_NAME, PJ_FIELD_TYPE);
-    if (id) {
-        PJ *pj = (PJ*) (*env)->GetLongField(env, object, id);
-        if (pj) {
-            (*env)->SetLongField(env, object, id, (jlong) 0);
-            pj_free(pj);
-        }
-    }
-}
-
-
-
-
-/* ===============================================================================================
- *
- * Below this point are the previous JNI bindings that existed in the legacy org.proj4.Projections
- * class before the new bindings defined above. We keep those binding for now, but may remove them
- * in a future version. There is a few issues with the code below:
- *
- *  1) Every call to (*env)->GetStringUTFChars(...) shall have a corresponding call to
- *     (*env)->ReleaseStringUTFChars(...).
- *
- *  2) Every call to (*env)->GetFoo(...) shall check for NULL return value.  If the return
- *     value is NULL, than a java.lang.OutOfMemoryError has already been thrown in the JVM;
- *     we just need to return from the C method after releasing allocated objects (if any).
- *
- *  3) If a Proj.4 method fails to execute, we should invoke (*env)->ThrowNew(...) instead
- *     than exit(1) in order to throw an exception in the Java program instead than stopping
- *     the JVM.
- *
- *  4) We should check the user arguments for null values or index out of bounds, and
- *     throw the appropriate Java exception if an argument is invalid.
- */
-
-#include "org_proj4_Projections.h"
-
-#define arraysize 300
-
-/*!
- * \brief
- * executes reprojection
- *
- * JNI informations:
- * Class:     org_proj4_Projections
- * Method:    transform
- * Signature: ([D[D[DLjava/lang/String;Ljava/lang/String;JI)V
- *
- *
- * \param env - parameter used by jni (see JNI specification)
- * \param parent - parameter used by jni (see JNI specification)
- * \param firstcoord - array of x coordinates
- * \param secondcoord - array of y coordinates
- * \param values - array of z coordinates
- * \param src - definition of the source projection
- * \param dest - definition of the destination projection
- * \param pcount
- * \param poffset
-*/
-JNIEXPORT void JNICALL Java_org_proj4_Projections_transform
-  (JNIEnv * env, jobject parent, jdoubleArray firstcoord, jdoubleArray secondcoord, jdoubleArray values, jstring src, jstring dest, jlong pcount, jint poffset)
-{
-	int i;
-	projPJ src_pj, dst_pj;
-	char * srcproj_def = (char *) (*env)->GetStringUTFChars (env, src, 0);
-	char * destproj_def = (char *) (*env)->GetStringUTFChars (env, dest, 0);
-
-	if (!(src_pj = pj_init_plus(srcproj_def)))
-		exit(1);
-	if (!(dst_pj = pj_init_plus(destproj_def)))
-		exit(1);
-
-	double *xcoord = (* env)-> GetDoubleArrayElements(env, firstcoord, NULL);
-	double *ycoord = (* env) -> GetDoubleArrayElements(env, secondcoord, NULL);
-	double *zcoord = (* env) -> GetDoubleArrayElements(env, values, NULL);
-
-        pj_transform( src_pj, dst_pj, pcount,poffset, xcoord, ycoord, zcoord);
-
-	(* env)->ReleaseDoubleArrayElements(env,firstcoord,(jdouble *) xcoord, 0);
-	(* env)->ReleaseDoubleArrayElements(env,secondcoord,(jdouble *) ycoord, 0);
-	(* env)->ReleaseDoubleArrayElements(env,values,(jdouble *) zcoord, 0);
-
-	pj_free( src_pj );
-	pj_free( dst_pj );
-}
-
-/*!
- * \brief
- * retrieves projection parameters
- *
- * JNI informations:
- * Class:     org_proj4_Projections
- * Method:    getProjInfo
- * Signature: (Ljava/lang/String;)Ljava/lang/String;
- *
- *
- * \param env - parameter used by jni (see JNI specification)
- * \param parent - parameter used by jni (see JNI specification)
- * \param projdefinition - definition of the projection
-*/
-JNIEXPORT jstring JNICALL Java_org_proj4_Projections_getProjInfo
-  (JNIEnv * env, jobject parent, jstring projdefinition)
-{
-	PJ *pj;
-	char * pjdesc;
-	char info[arraysize];
-
-	char * proj_def = (char *) (*env)->GetStringUTFChars (env, projdefinition, 0);
-
-	if (!(pj = pj_init_plus(proj_def)))
-		exit(1);
-
-	/* put together all the info of the projection and free the pointer to pjdesc */
-	pjdesc = pj_get_def(pj, 0);
-	strcpy(info,pjdesc);
-	pj_dalloc(pjdesc);
-
-	return (*env)->NewStringUTF(env,info);
-}
-
-
-/*!
- * \brief
- * retrieves ellipsoid parameters
- *
- * JNI informations:
- * Class:     org_proj4_Projections
- * Method:    getEllipsInfo
- * Signature: (Ljava/lang/String;)Ljava/lang/String;
- *
- *
- * \param env - parameter used by jni (see JNI specification)
- * \param parent - parameter used by jni (see JNI specification)
- * \param projdefinition - definition of the projection
-*/
-JNIEXPORT jstring JNICALL Java_org_proj4_Projections_getEllipsInfo
-  (JNIEnv * env, jobject parent, jstring projdefinition)
-{
-	PJ *pj;
-	char * pjdesc;
-	char ellipseinfo[arraysize];
-	char temp[50];
-
-	char * proj_def = (char *) (*env)->GetStringUTFChars (env, projdefinition, 0);
-
-	if (!(pj = pj_init_plus(proj_def)))
-		exit(1);
-
-	/* put together all the info of the ellipsoid  */
-/* 	sprintf(temp,"name: %s;", pj->descr); */
-	sprintf(temp,"name: not available;");
-	strcpy(ellipseinfo,temp);
-	sprintf(temp,"a: %lf;", pj->a);
-	strcat(ellipseinfo,temp);
-	sprintf(temp,"e: %lf;", pj->e);
-	strcat(ellipseinfo,temp);
-	sprintf(temp,"es: %lf;", pj->es);
-	strcat(ellipseinfo,temp);
-	sprintf(temp,"ra: %lf;", pj->ra);
-	strcat(ellipseinfo,temp);
-	sprintf(temp,"one_es: %lf;", pj->one_es);
-	strcat(ellipseinfo,temp);
-	sprintf(temp,"rone_es: %lf;", pj->rone_es);
-	strcat(ellipseinfo,temp);
-	sprintf(temp,"lam0: %lf;", pj->lam0);
-	strcat(ellipseinfo,temp);
-	sprintf(temp,"phi0: %lf;", pj->phi0);
-	strcat(ellipseinfo,temp);
-	sprintf(temp,"x0: %lf;", pj->x0);
-	strcat(ellipseinfo,temp);
-	sprintf(temp,"y0: %lf;", pj->y0);
-	strcat(ellipseinfo,temp);
-	sprintf(temp,"k0: %lf;", pj->k0);
-	strcat(ellipseinfo,temp);
-	sprintf(temp,"to_meter: %lf;", pj->to_meter);
-	strcat(ellipseinfo,temp);
-	sprintf(temp,"fr_meter: %lf;", pj->fr_meter);
-	strcat(ellipseinfo,temp);
-
-	return (*env)->NewStringUTF(env,ellipseinfo);
-}
-
-#endif
diff --git a/src/proj/mk_cheby.c b/src/proj/mk_cheby.c
deleted file mode 100644
index 57ca092..0000000
--- a/src/proj/mk_cheby.c
+++ /dev/null
@@ -1,161 +0,0 @@
-#include <projects.h>
-	static void /* sum coefficients less than res */
-eval(projUV **w, int nu, int nv, double res, projUV *resid) {
-	int i, j;
-	double ab;
-	projUV *s;
-
-	resid->u = resid->v = 0.;
-	for (i = 0; i < nu; ++i)
-		for (s = w[i], j = 0; j < nv; ++j, ++s) {
-			if ((ab = fabs(s->u)) < res)
-				resid->u += ab;
-			if ((ab = fabs(s->v)) < res)
-				resid->v += ab;
-		}
-}
-	static Tseries * /* create power series structure */
-makeT(int nru, int nrv) {
-	Tseries *T;
-	int i;
-
-	if ((T = (Tseries *)pj_malloc(sizeof(Tseries))) &&
-		(T->cu = (struct PW_COEF *)pj_malloc(
-			sizeof(struct PW_COEF) * nru)) &&
-		(T->cv = (struct PW_COEF *)pj_malloc(
-			sizeof(struct PW_COEF) * nrv))) {
-		for (i = 0; i < nru; ++i)
-			T->cu[i].c = 0;
-		for (i = 0; i < nrv; ++i)
-			T->cv[i].c = 0;
-		return T;
-	} else
-		return 0;
-}
-	Tseries *
-mk_cheby(projUV a, projUV b, double res, projUV *resid, projUV (*func)(projUV), 
-	int nu, int nv, int power) {
-	int j, i, nru, nrv, *ncu, *ncv;
-	Tseries *T;
-	projUV **w;
-	double cutres;
-
-	if (!(w = (projUV **)vector2(nu, nv, sizeof(projUV))) ||
-		!(ncu = (int *)vector1(nu + nv, sizeof(int))))
-		return 0;
-	ncv = ncu + nu;
-	if (!bchgen(a, b, nu, nv, w, func)) {
-		projUV *s;
-		double ab, *p;
-
-		/* analyse coefficients and adjust until residual OK */
-		cutres = res;
-		for (i = 4; i ; --i) {
-			eval(w, nu, nv, cutres, resid);
-			if (resid->u < res && resid->v < res)
-				break;
-			cutres *= 0.5;
-		}
-		if (i <= 0) /* warn of too many tries */
-			resid->u = - resid->u;
-		/* apply cut resolution and set pointers */
-		nru = nrv = 0;
-		for (j = 0; j < nu; ++j) {
-			ncu[j] = ncv[j] = 0; /* clear column maxes */
-			for (s = w[j], i = 0; i < nv; ++i, ++s) {
-				if ((ab = fabs(s->u)) < cutres) /* < resolution ? */
-					s->u = 0.;		/* clear coefficient */
-				else
-					ncu[j] = i + 1;	/* update column max */
-				if ((ab = fabs(s->v)) < cutres) /* same for v coef's */
-					s->v = 0.;
-				else
-					ncv[j] = i + 1;
-			}
-			if (ncu[j]) nru = j + 1;	/* update row max */
-			if (ncv[j]) nrv = j + 1;
-		}
-		if (power) { /* convert to bivariate power series */
-			if (!bch2bps(a, b, w, nu, nv))
-				goto error;
-			/* possible change in some row counts, so readjust */
-			nru = nrv = 0;
-			for (j = 0; j < nu; ++j) {
-				ncu[j] = ncv[j] = 0; /* clear column maxes */
-				for (s = w[j], i = 0; i < nv; ++i, ++s) {
-					if (s->u)
-						ncu[j] = i + 1;	/* update column max */
-					if (s->v)
-						ncv[j] = i + 1;
-				}
-				if (ncu[j]) nru = j + 1;	/* update row max */
-				if (ncv[j]) nrv = j + 1;
-			}
-			if ((T = makeT(nru, nrv)) != NULL ) {
-				T->a = a;
-				T->b = b;
-				T->mu = nru - 1;
-				T->mv = nrv - 1;
-				T->power = 1;
-				for (i = 0; i < nru; ++i) /* store coefficient rows for u */
-                                    if ((T->cu[i].m = ncu[i]) != 0)
-						if ((p = T->cu[i].c =
-								(double *)pj_malloc(sizeof(double) * ncu[i])))
-							for (j = 0; j < ncu[i]; ++j)
-								*p++ = (w[i] + j)->u;
-						else
-							goto error;
-				for (i = 0; i < nrv; ++i) /* same for v */
-                                    if ((T->cv[i].m = ncv[i]) != 0)
-						if ((p = T->cv[i].c =
-								(double *)pj_malloc(sizeof(double) * ncv[i])))
-							for (j = 0; j < ncv[i]; ++j)
-								*p++ = (w[i] + j)->v;
-						else
-							goto error;
-			}
-		} else if ((T = makeT(nru, nrv)) != NULL) {
-			/* else make returned Chebyshev coefficient structure */
-			T->mu = nru - 1; /* save row degree */
-			T->mv = nrv - 1;
-			T->a.u = a.u + b.u; /* set argument scaling */
-			T->a.v = a.v + b.v;
-			T->b.u = 1. / (b.u - a.u);
-			T->b.v = 1. / (b.v - a.v);
-			T->power = 0;
-			for (i = 0; i < nru; ++i) /* store coefficient rows for u */
-                            if ((T->cu[i].m = ncu[i]) != 0) 
-					if ((p = T->cu[i].c =
-							(double *)pj_malloc(sizeof(double) * ncu[i])))
-						for (j = 0; j < ncu[i]; ++j)
-							*p++ = (w[i] + j)->u;
-					else
-						goto error;
-			for (i = 0; i < nrv; ++i) /* same for v */
-                            if ((T->cv[i].m = ncv[i]) != 0)
-					if ((p = T->cv[i].c =
-							(double *)pj_malloc(sizeof(double) * ncv[i])))
-						for (j = 0; j < ncv[i]; ++j)
-							*p++ = (w[i] + j)->v;
-					else
-						goto error;
-		} else
-			goto error;
-	}
-	goto gohome;
-error:
-	if (T) { /* pj_dalloc up possible allocations */
-		for (i = 0; i <= T->mu; ++i)
-			if (T->cu[i].c)
-				pj_dalloc(T->cu[i].c);
-		for (i = 0; i <= T->mv; ++i)
-			if (T->cv[i].c)
-				pj_dalloc(T->cv[i].c);
-		pj_dalloc(T);
-	}
-	T = 0;
-gohome:
-	freev2((void **) w, nu);
-	pj_dalloc(ncu);
-	return T;
-}
diff --git a/src/proj/multistresstest.c b/src/proj/multistresstest.c
deleted file mode 100644
index bb7dab2..0000000
--- a/src/proj/multistresstest.c
+++ /dev/null
@@ -1,317 +0,0 @@
-/******************************************************************************
- *
- * Project:  PROJ.4
- * Purpose:  Mainline program to stress test multithreaded PROJ.4 processing.
- * Author:   Frank Warmerdam, warmerdam at pobox.com
- *
- ******************************************************************************
- * Copyright (c) 2010, Frank Warmerdam
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *****************************************************************************/
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <pthread.h>
-#include <unistd.h>
-#include "proj_api.h"
-
-#define num_threads    10
-#define num_iterations 1000000
-#define reinit_every_iteration 0
-
-typedef struct {
-    const char *src_def;
-    const char *dst_def;
-
-    double  src_x, src_y, src_z;
-    double  dst_x, dst_y, dst_z;
-    
-    int     dst_error;
-    int     skip;
-    
-
-} TestItem; 
-
-TestItem test_list[] = {
-    {
-        "+proj=utm +zone=11 +datum=WGS84",
-        "+proj=latlong +datum=WGS84",
-        150000.0, 3000000.0, 0.0,
-    },
-    {
-        "+proj=utm +zone=11 +datum=NAD83",
-        "+proj=latlong +datum=NAD27",
-        150000.0, 3000000.0, 0.0,  
-    },
-    {
-        "+proj=utm +zone=11 +datum=NAD83",
-        "+proj=latlong +nadgrids=@null +ellps=WGS84",
-        150000.0, 3000000.0, 0.0,
-    },
-    {
-        "+proj=utm +zone=11 +datum=WGS84",
-        "+proj=merc +datum=potsdam",
-        150000.0, 3000000.0, 0.0,
-    },
-    {
-        "+proj=latlong +nadgrids=nzgd2kgrid0005.gsb",
-        "+proj=latlong +datum=WGS84",
-        150000.0, 3000000.0, 0.0,
-    },
-    {
-        "+proj=latlong +nadgrids=nzgd2kgrid0005.gsb",
-        "+proj=latlong +datum=WGS84",
-        170 * DEG_TO_RAD, -40 * DEG_TO_RAD, 0.0,
-    },
-    {
-        "+proj=latlong +ellps=GRS80 +towgs84=2,3,5",
-        "+proj=latlong +ellps=intl +towgs84=10,12,15",
-        170 * DEG_TO_RAD, -40 * DEG_TO_RAD, 0.0,
-    },
-    {
-        "+proj=eqc +lat_0=11 +lon_0=12 +x_0=100000 +y_0=200000 +datum=WGS84 ",
-        "+proj=stere +lat_0=11 +lon_0=12 +x_0=100000 +y_0=200000 +datum=WGS84 ",
-        150000.0, 250000.0, 0.0,
-    },
-    {
-        "+proj=cea +lat_ts=11 +lon_0=12 +y_0=200000 +datum=WGS84 ",
-        "+proj=merc +lon_0=12 +k=0.999 +x_0=100000 +y_0=200000 +datum=WGS84 ",
-        150000.0, 250000.0, 0.0,
-    },
-    {
-        "+proj=bonne +lat_1=11 +lon_0=12 +y_0=200000 +datum=WGS84 ",
-        "+proj=cass +lat_0=11 +lon_0=12 +x_0=100000 +y_0=200000 +datum=WGS84 ",
-        150000.0, 250000.0, 0.0,
-    },
-    {
-        "+proj=nzmg +lat_0=11 +lon_0=12 +y_0=200000 +datum=WGS84 ",
-        "+proj=gnom +lat_0=11 +lon_0=12 +x_0=100000 +y_0=200000 +datum=WGS84 ",
-        150000.0, 250000.0, 0.0,
-    },
-    {
-        "+proj=ortho +lat_0=11 +lon_0=12 +y_0=200000 +datum=WGS84 ",
-        "+proj=laea +lat_0=11 +lon_0=12 +x_0=100000 +y_0=200000 +datum=WGS84 ",
-        150000.0, 250000.0, 0.0,
-    },
-    {
-        "+proj=aeqd +lat_0=11 +lon_0=12 +y_0=200000 +datum=WGS84 ",
-        "+proj=eqdc +lat_1=20 +lat_2=5 +lat_0=11 +lon_0=12 +x_0=100000 +y_0=200000 +datum=WGS84 ",
-        150000.0, 250000.0, 0.0,
-    },
-    {
-        "+proj=mill +lat_0=11 +lon_0=12 +y_0=200000 +datum=WGS84 ",
-        "+proj=moll +lon_0=12 +x_0=100000 +y_0=200000 +datum=WGS84 ",
-        150000.0, 250000.0, 0.0,
-    },
-    {
-        "+init=epsg:3309",
-        "+init=epsg:4326",
-        150000.0, 30000.0, 0.0,
-    }
-};
-
-static volatile int active_thread_count = 0;
-
-/************************************************************************/
-/*                             TestThread()                             */
-/************************************************************************/
-
-static void *TestThread( void *pData )
-
-{
-    int i, test_count = sizeof(test_list) / sizeof(TestItem); 
-
-/* -------------------------------------------------------------------- */
-/*      Initialize coordinate system definitions.                       */
-/* -------------------------------------------------------------------- */
-    projPJ *src_pj_list, *dst_pj_list;
-    projCtx ctx = pj_ctx_alloc();
-//    projCtx ctx = pj_get_default_ctx();
-    
-    src_pj_list = (projPJ *) calloc(test_count,sizeof(projPJ));
-    dst_pj_list = (projPJ *) calloc(test_count,sizeof(projPJ));
-                                
-#if reinit_every_iteration == 0
-    for( i = 0; i < test_count; i++ )
-    {
-        TestItem *test = test_list + i;
-
-        src_pj_list[i] = pj_init_plus_ctx( ctx, test->src_def );
-        dst_pj_list[i] = pj_init_plus_ctx( ctx, test->dst_def );
-    }
-#endif
-    
-/* -------------------------------------------------------------------- */
-/*      Perform tests - over and over.                                  */
-/* -------------------------------------------------------------------- */
-    int repeat_count = num_iterations, i_iter;
-    
-    for( i_iter = 0; i_iter < repeat_count; i_iter++ )
-    {
-        for( i = 0; i < test_count; i++ )
-        {
-            TestItem *test = test_list + i;
-            double x, y, z;
-            int error;
-
-            if( test->skip )
-                continue;
-            
-            x = test->src_x;
-            y = test->src_y;
-            z = test->src_z;
-
-#if reinit_every_iteration == 1
-            src_pj_list[i] = pj_init_plus_ctx( ctx, test->src_def );
-            dst_pj_list[i] = pj_init_plus_ctx( ctx, test->dst_def );
-#endif
-
-            error = pj_transform( src_pj_list[i], dst_pj_list[i], 1, 0, 
-                                  &x, &y, &z );
-            
-
-            if( error != test->dst_error )
-            {
-                fprintf( stderr, "Got error %d, expected %d\n", 
-                         error, test->dst_error );
-            }
-
-            if( x != test->dst_x || y != test->dst_y || z != test->dst_z )
-            {
-                fprintf( stderr, 
-                         "Got %.15g,%.15g,%.15g\n"
-                         "Expected %.15g,%.15g,%.15g\n",
-                         x, y, z, 
-                         test->dst_x, test->dst_y, test->dst_z );
-            }
-
-#if reinit_every_iteration == 1
-            pj_free( src_pj_list[i] );
-            pj_free( dst_pj_list[i] );
-#endif
-        }
-    }
-
-/* -------------------------------------------------------------------- */
-/*      Cleanup                                                         */
-/* -------------------------------------------------------------------- */
-#if reinit_every_iteration == 0
-    for( i = 0; i < test_count; i++ )
-    {
-        pj_free( src_pj_list[i] );
-        pj_free( dst_pj_list[i] );
-    }
-#endif
-    
-    free( src_pj_list );
-    free( dst_pj_list );
-
-    pj_ctx_free( ctx );
-
-    printf( "%d iterations of the %d tests complete in thread X\n", 
-            repeat_count, test_count );
-
-    active_thread_count--;
-
-    return NULL;
-}
-
-/************************************************************************/
-/*                                main()                                */
-/************************************************************************/
-int main( int argc, char **argv )
-
-{
-/* -------------------------------------------------------------------- */
-/*      Our first pass is to establish the correct answers for all      */
-/*      the tests.                                                      */
-/* -------------------------------------------------------------------- */
-    int i, test_count = sizeof(test_list) / sizeof(TestItem); 
-
-    for( i = 0; i < test_count; i++ )
-    {
-        TestItem *test = test_list + i;
-
-        projPJ src_pj, dst_pj;
-
-        src_pj = pj_init_plus( test->src_def );
-        dst_pj = pj_init_plus( test->dst_def );
-
-        if( src_pj == NULL )
-        {
-            printf( "Unable to translate:\n%s\n", test->src_def );
-            test->skip = 1;
-            continue;
-        }
-
-        if( dst_pj == NULL )
-        {
-            printf( "Unable to translate:\n%s\n", test->dst_def );
-            test->skip = 1;
-            continue;
-        }
-        
-        test->dst_x = test->src_x;
-        test->dst_y = test->src_y;
-        test->dst_z = test->src_z;
-
-        test->dst_error = pj_transform( src_pj, dst_pj, 1, 0, 
-                                        &(test->dst_x), 
-                                        &(test->dst_y),
-                                        &(test->dst_z) );
-     
-        pj_free( src_pj );
-        pj_free( dst_pj );
-
-        test->skip = 0;
-
-#ifdef notdef
-        printf( "Test %d - output %.14g,%.14g,%g\n", i, test->dst_x, test->dst_y, test->dst_z );
-#endif
-    }
-
-    printf( "%d tests initialized.\n", test_count );
-
-/* -------------------------------------------------------------------- */
-/*      Now launch a bunch of threads to repeat the tests.              */
-/* -------------------------------------------------------------------- */
-    pthread_t ahThread[num_threads];
-    pthread_attr_t hThreadAttr;
-
-    pthread_attr_init( &hThreadAttr );
-    pthread_attr_setdetachstate( &hThreadAttr, PTHREAD_CREATE_DETACHED );
-
-    for( i = 0; i < num_threads; i++ )
-    {
-        active_thread_count++;
-        
-        pthread_create( &(ahThread[i]), &hThreadAttr, 
-                        TestThread, NULL );
-    }
-
-    printf( "%d test threads launched.\n", num_threads );
-            
-    while( active_thread_count > 0 )				       
-        sleep( 1 );
-
-    printf( "all tests complete.\n" );
-
-    return 0;
-}
diff --git a/src/proj/nad2bin.c b/src/proj/nad2bin.c
deleted file mode 100644
index 6de54f9..0000000
--- a/src/proj/nad2bin.c
+++ /dev/null
@@ -1,376 +0,0 @@
-/* Convert bivariate ASCII NAD27 to NAD83 tables to NTv2 binary structure */
-#include <stdio.h>
-#include <stdlib.h>
-#include <assert.h>
-
-#define PJ_LIB__
-#include <projects.h>
-#define U_SEC_TO_RAD 4.848136811095359935899141023e-12
-
-/************************************************************************/
-/*                             swap_words()                             */
-/*                                                                      */
-/*      Convert the byte order of the given word(s) in place.           */
-/************************************************************************/
-
-static int  byte_order_test = 1;
-#define IS_LSB	(((unsigned char *) (&byte_order_test))[0] == 1)
-
-static void swap_words( void *data_in, int word_size, int word_count )
-
-{
-    int	word;
-    unsigned char *data = (unsigned char *) data_in;
-
-    for( word = 0; word < word_count; word++ )
-    {
-        int	i;
-        
-        for( i = 0; i < word_size/2; i++ )
-        {
-            int	t;
-            
-            t = data[i];
-            data[i] = data[word_size-i-1];
-            data[word_size-i-1] = t;
-        }
-        
-        data += word_size;
-    }
-}
-
-/************************************************************************/
-/*                               Usage()                                */
-/************************************************************************/
-
-static void Usage()
-{
-    fprintf(stderr,
-            "usage: nad2bin [-f ctable/ctable2/ntv2] binary_output < ascii_source\n" );
-    exit(1);
-}
-
-/************************************************************************/
-/*                                main()                                */
-/************************************************************************/
-int main(int argc, char **argv) {
-    struct CTABLE ct;
-    FLP *p, t;
-    size_t tsize;
-    int i, j, ichk;
-    long lam, laml, phi, phil;
-    FILE *fp;
-
-    const char *output_file = NULL;
-
-    const char *format   = "ctable2";
-    const char *GS_TYPE  = "SECONDS";
-    const char *VERSION  = "";
-    const char *SYSTEM_F = "NAD27";
-    const char *SYSTEM_T = "NAD83";
-    const char *SUB_NAME = "";
-    const char *CREATED  = "";
-    const char *UPDATED  = "";
-
-/* ==================================================================== */
-/*      Process arguments.                                              */
-/* ==================================================================== */
-    for( i = 1; i < argc; i++ )
-    {
-        if( strcmp(argv[i],"-f") == 0 && i < argc-1 ) 
-        {
-            format = argv[++i];
-        }
-        else if( output_file == NULL )
-        {
-            output_file = argv[i];
-        }
-        else
-            Usage();
-    }
-
-    if( output_file == NULL )
-        Usage();
-
-    fprintf( stdout, "Output Binary File Format: %s\n", format );
-
-/* ==================================================================== */
-/*      Read the ASCII Table                                            */
-/* ==================================================================== */
-
-    if ( NULL == fgets(ct.id, MAX_TAB_ID, stdin) ) {
-        perror("fgets");
-        exit(1);
-    }
-    if ( EOF == scanf("%d %d %*d %lf %lf %lf %lf", &ct.lim.lam, &ct.lim.phi,
-          &ct.ll.lam, &ct.del.lam, &ct.ll.phi, &ct.del.phi) ) {
-        perror("scanf");
-        exit(1);
-    }
-    if (!(ct.cvs = (FLP *)malloc(tsize = ct.lim.lam * ct.lim.phi *
-                                 sizeof(FLP)))) {
-        perror("mem. alloc");
-        exit(1);
-    }
-    ct.ll.lam *= DEG_TO_RAD;
-    ct.ll.phi *= DEG_TO_RAD;
-    ct.del.lam *= DEG_TO_RAD;
-    ct.del.phi *= DEG_TO_RAD;
-    /* load table */
-    for (p = ct.cvs, i = 0; i < ct.lim.phi; ++i) {
-        if ( EOF == scanf("%d:%ld %ld", &ichk, &laml, &phil) ) {
-            perror("scanf on row");
-            exit(1);
-        }
-        if (ichk != i) {
-            fprintf(stderr,"format check on row\n");
-            exit(1);
-        }
-        t.lam = laml * U_SEC_TO_RAD;
-        t.phi = phil * U_SEC_TO_RAD;
-        *p++ = t;
-        for (j = 1; j < ct.lim.lam; ++j) {
-            if ( EOF == scanf("%ld %ld", &lam, &phi) ) {
-                perror("scanf on column");
-                exit(1);
-            }
-            t.lam = (laml += lam) * U_SEC_TO_RAD;
-            t.phi = (phil += phi) * U_SEC_TO_RAD;
-            *p++ = t;
-        }
-    }
-    if (feof(stdin)) {
-        fprintf(stderr, "premature EOF\n");
-        exit(1);
-    }
-
-/* ==================================================================== */
-/*      Write out the old ctable format - this is machine and byte      */
-/*      order specific.                                                 */
-/* ==================================================================== */
-    if( strcmp(format,"ctable") == 0 ) 
-    {
-	if (!(fp = fopen(output_file, "wb"))) {
-            perror(output_file);
-            exit(2);
-	}
-	if (fwrite(&ct, sizeof(ct), 1, fp) != 1 ||
-            fwrite(ct.cvs, tsize, 1, fp) != 1) {
-            fprintf(stderr, "output failure\n");
-            exit(2);
-	}
-        fclose( fp );
-	exit(0); /* normal completion */
-    }
-
-/* ==================================================================== */
-/*      Write out the old ctable format - this is machine and byte      */
-/*      order specific.                                                 */
-/* ==================================================================== */
-    if( strcmp(format,"ctable2") == 0 ) 
-    {
-        char header[160];
-
-	if (!(fp = fopen(output_file, "wb"))) {
-            perror(output_file);
-            exit(2);
-	}
-
-        assert( MAX_TAB_ID == 80 );
-        assert( sizeof(int) == 4 ); /* for ct.lim.lam/phi */
-
-        memset( header, 0, sizeof(header) );
-
-        memcpy( header +   0, "CTABLE V2.0     ", 16 );
-        memcpy( header +  16, ct.id, 80 );
-        memcpy( header +  96, &ct.ll.lam, 8 );
-        memcpy( header + 104, &ct.ll.phi, 8 );
-        memcpy( header + 112, &ct.del.lam, 8 );
-        memcpy( header + 120, &ct.del.phi, 8 );
-        memcpy( header + 128, &ct.lim.lam, 4 );
-        memcpy( header + 132, &ct.lim.phi, 4 );
-
-        /* force into LSB format */
-        if( !IS_LSB ) 
-        {
-            swap_words( header +  96, 8, 4 );
-            swap_words( header + 128, 4, 2 );
-            swap_words( ct.cvs, 4, ct.lim.lam * ct.lim.phi );
-        }
-
-        if( fwrite( header, sizeof(header), 1, fp ) != 1 ) {
-            perror( "fwrite" );
-            exit( 2 );
-        }
-
-	if (fwrite(ct.cvs, tsize, 1, fp) != 1) {
-            perror( "fwrite" );
-            exit(2);
-	}
-
-        fclose( fp );
-	exit(0); /* normal completion */
-    }
-
-/* ==================================================================== */
-/*      Write out the NTv2 format grid shift file.                      */
-/* ==================================================================== */
-    if( strcmp(format,"ntv2") == 0 ) 
-    {
-        if (!(fp = fopen(output_file, "wb"))) 
-        {
-            perror(output_file);
-            exit(2);
-        }
-        
-/* -------------------------------------------------------------------- */
-/*      Write the file header.                                          */
-/* -------------------------------------------------------------------- */
-        {    
-            char achHeader[11*16];
-
-            memset( achHeader, 0, sizeof(achHeader) );
-        
-            memcpy( achHeader +  0*16, "NUM_OREC", 8 );
-            achHeader[ 0*16 + 8] = 0xb;
-
-            memcpy( achHeader +  1*16, "NUM_SREC", 8 );
-            achHeader[ 1*16 + 8] = 0xb;
-
-            memcpy( achHeader +  2*16, "NUM_FILE", 8 );
-            achHeader[ 2*16 + 8] = 0x1;
-
-            memcpy( achHeader +  3*16, "GS_TYPE         ", 16 );
-            memcpy( achHeader +  3*16+8, GS_TYPE, MIN(16,strlen(GS_TYPE)) );
-
-            memcpy( achHeader +  4*16, "VERSION         ", 16 );
-            memcpy( achHeader +  4*16+8, VERSION, MIN(16,strlen(VERSION)) );
-
-            memcpy( achHeader +  5*16, "SYSTEM_F        ", 16 );
-            memcpy( achHeader +  5*16+8, SYSTEM_F, MIN(16,strlen(SYSTEM_F)) );
-
-            memcpy( achHeader +  6*16, "SYSTEM_T        ", 16 );
-            memcpy( achHeader +  6*16+8, SYSTEM_T, MIN(16,strlen(SYSTEM_T)) );
-
-            memcpy( achHeader +  7*16, "MAJOR_F ", 8);
-            memcpy( achHeader +  8*16, "MINOR_F ", 8 );
-            memcpy( achHeader +  9*16, "MAJOR_T ", 8 );
-            memcpy( achHeader + 10*16, "MINOR_T ", 8 );
-
-            fwrite( achHeader, 1, sizeof(achHeader), fp );
-        }
-        
-/* -------------------------------------------------------------------- */
-/*      Write the grid header.                                          */
-/* -------------------------------------------------------------------- */
-        {
-            unsigned char achHeader[11*16];
-            double dfValue;
-            int nGSCount = ct.lim.lam * ct.lim.phi;
-            LP ur;
-
-            ur.lam = ct.ll.lam + (ct.lim.lam-1) * ct.del.lam;
-            ur.phi = ct.ll.phi + (ct.lim.phi-1) * ct.del.phi;
-
-            assert( sizeof(nGSCount) == 4 );
-
-            memset( achHeader, 0, sizeof(achHeader) );
-
-            memcpy( achHeader +  0*16, "SUB_NAME        ", 16 );
-            memcpy( achHeader +  0*16+8, SUB_NAME, MIN(16,strlen(SUB_NAME)) );
-    
-            memcpy( achHeader +  1*16, "PARENT          ", 16 );
-            memcpy( achHeader +  1*16+8, "NONE", MIN(16,strlen("NONE")) );
-    
-            memcpy( achHeader +  2*16, "CREATED         ", 16 );
-            memcpy( achHeader +  2*16+8, CREATED, MIN(16,strlen(CREATED)) );
-    
-            memcpy( achHeader +  3*16, "UPDATED         ", 16 );
-            memcpy( achHeader +  3*16+8, UPDATED, MIN(16,strlen(UPDATED)) );
-
-            memcpy( achHeader +  4*16, "S_LAT   ", 8 );
-            dfValue = ct.ll.phi * 3600.0 / DEG_TO_RAD;
-            memcpy( achHeader +  4*16 + 8, &dfValue, 8 );
-
-            memcpy( achHeader +  5*16, "N_LAT   ", 8 );
-            dfValue = ur.phi * 3600.0 / DEG_TO_RAD;
-            memcpy( achHeader +  5*16 + 8, &dfValue, 8 );
-
-            memcpy( achHeader +  6*16, "E_LONG  ", 8 );
-            dfValue = -1 * ur.lam * 3600.0 / DEG_TO_RAD;
-            memcpy( achHeader +  6*16 + 8, &dfValue, 8 );
-
-            memcpy( achHeader +  7*16, "W_LONG  ", 8 );
-            dfValue = -1 * ct.ll.lam * 3600.0 / DEG_TO_RAD;
-            memcpy( achHeader +  7*16 + 8, &dfValue, 8 );
-
-            memcpy( achHeader +  8*16, "LAT_INC ", 8 );
-            dfValue = ct.del.phi * 3600.0 / DEG_TO_RAD;
-            memcpy( achHeader +  8*16 + 8, &dfValue, 8 );
-    
-            memcpy( achHeader +  9*16, "LONG_INC", 8 );
-            dfValue = ct.del.lam * 3600.0 / DEG_TO_RAD;
-            memcpy( achHeader +  9*16 + 8, &dfValue, 8 );
-    
-            memcpy( achHeader + 10*16, "GS_COUNT", 8 );
-            memcpy( achHeader + 10*16+8, &nGSCount, 4 );
-    
-            if( !IS_LSB ) 
-            {
-                swap_words( achHeader +  4*16 + 8, 8, 1 );
-                swap_words( achHeader +  5*16 + 8, 8, 1 );
-                swap_words( achHeader +  6*16 + 8, 8, 1 );
-                swap_words( achHeader +  7*16 + 8, 8, 1 );
-                swap_words( achHeader +  8*16 + 8, 8, 1 );
-                swap_words( achHeader +  9*16 + 8, 8, 1 );
-                swap_words( achHeader + 10*16 + 8, 4, 1 );
-            }
-
-            fwrite( achHeader, 1, sizeof(achHeader), fp );
-        }
-
-/* -------------------------------------------------------------------- */
-/*      Write the actual grid cells.                                    */
-/* -------------------------------------------------------------------- */
-        {
-            float *row_buf;
-            int row;
-
-            row_buf = (float *) pj_malloc(ct.lim.lam * sizeof(float) * 4);
-            memset( row_buf, 0, sizeof(float)*4 );
-
-            for( row = 0; row < ct.lim.phi; row++ )
-            {
-                int	    i;
-
-                for( i = 0; i < ct.lim.lam; i++ )
-                {
-                    FLP *cvs = ct.cvs + (row) * ct.lim.lam
-                        + (ct.lim.lam - i - 1);
-
-                    /* convert radians to seconds */
-                    row_buf[i*4+0] = cvs->phi * (3600.0 / (PI/180.0));
-                    row_buf[i*4+1] = cvs->lam * (3600.0 / (PI/180.0));
-
-                    /* We leave the accuracy values as zero */
-                }
-
-                if( !IS_LSB )
-                    swap_words( row_buf, 4, ct.lim.lam * 4 );
-
-                if( fwrite( row_buf, sizeof(float), ct.lim.lam*4, fp ) 
-                    != 4 * ct.lim.lam )
-                {
-                    perror( "write()" );
-                    exit( 2 );
-                }
-            }
-        }
-
-        fclose( fp );
-        exit(0); /* normal completion */
-    }
-
-    fprintf( stderr, "Unsupported format, nothing written.\n" );
-    exit( 3 );
-}
diff --git a/src/proj/nad_cvt.c b/src/proj/nad_cvt.c
deleted file mode 100644
index 36fe6cb..0000000
--- a/src/proj/nad_cvt.c
+++ /dev/null
@@ -1,68 +0,0 @@
-#define PJ_LIB__
-#include <projects.h>
-#define MAX_TRY 9
-#define TOL 1e-12
-	LP
-nad_cvt(LP in, int inverse, struct CTABLE *ct) {
-	LP t, tb;
-
-	if (in.lam == HUGE_VAL)
-		return in;
-	/* normalize input to ll origin */
-	tb = in;
-	tb.lam -= ct->ll.lam;
-	tb.phi -= ct->ll.phi;
-	tb.lam = adjlon(tb.lam - PI) + PI;
-	t = nad_intr(tb, ct);
-	if (inverse) {
-		LP del, dif;
-		int i = MAX_TRY;
-
-		if (t.lam == HUGE_VAL) return t;
-		t.lam = tb.lam + t.lam;
-		t.phi = tb.phi - t.phi;
-
-		do {
-			del = nad_intr(t, ct);
-
-                        /* This case used to return failure, but I have
-                           changed it to return the first order approximation
-                           of the inverse shift.  This avoids cases where the
-                           grid shift *into* this grid came from another grid.
-                           While we aren't returning optimally correct results
-                           I feel a close result in this case is better than
-                           no result.  NFW
-                           To demonstrate use -112.5839956 49.4914451 against
-                           the NTv2 grid shift file from Canada. */
-			if (del.lam == HUGE_VAL) 
-                        {
-                            if( getenv( "PROJ_DEBUG" ) != NULL )
-                                fprintf( stderr, 
-                                         "Inverse grid shift iteration failed, presumably at grid edge.\n"
-                                         "Using first approximation.\n" );
-                            /* return del */;
-                            break;
-                        }
-
-			t.lam -= dif.lam = t.lam - del.lam - tb.lam;
-			t.phi -= dif.phi = t.phi + del.phi - tb.phi;
-		} while (i-- && fabs(dif.lam) > TOL && fabs(dif.phi) > TOL);
-		if (i < 0) {
-                    if( getenv( "PROJ_DEBUG" ) != NULL )
-                        fprintf( stderr, 
-                                 "Inverse grid shift iterator failed to converge.\n" );
-                    t.lam = t.phi = HUGE_VAL;
-                    return t;
-		}
-		in.lam = adjlon(t.lam + ct->ll.lam);
-		in.phi = t.phi + ct->ll.phi;
-	} else {
-		if (t.lam == HUGE_VAL)
-			in = t;
-		else {
-			in.lam -= t.lam;
-			in.phi += t.phi;
-		}
-	}
-	return in;
-}
diff --git a/src/proj/nad_init.c b/src/proj/nad_init.c
deleted file mode 100644
index 373b700..0000000
--- a/src/proj/nad_init.c
+++ /dev/null
@@ -1,311 +0,0 @@
-/******************************************************************************
- * $Id: nad_init.c 1950 2012-05-10 16:51:51Z caress $
- *
- * Project:  PROJ.4
- * Purpose:  Load datum shift files into memory.
- * Author:   Frank Warmerdam, warmerdam at pobox.com
- *
- ******************************************************************************
- * Copyright (c) 2000, Frank Warmerdam
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *****************************************************************************/
-
-#define PJ_LIB__
-
-#include <projects.h>
-#include <stdio.h>
-#include <errno.h>
-#include <string.h>
-
-#ifdef _WIN32_WCE
-/* assert.h includes all Windows API headers and causes 'LP' name clash.
- * Here assert we disable assert() for Windows CE.
- * TODO - mloskot: re-implement porting friendly assert
- */
-# define assert(exp)	((void)0)
-#else
-# include <assert.h>
-#endif /* _WIN32_WCE */
-
-/************************************************************************/
-/*                             swap_words()                             */
-/*                                                                      */
-/*      Convert the byte order of the given word(s) in place.           */
-/************************************************************************/
-
-static int  byte_order_test = 1;
-#define IS_LSB	(((unsigned char *) (&byte_order_test))[0] == 1)
-
-static void swap_words( void *data_in, int word_size, int word_count )
-
-{
-    int	word;
-    unsigned char *data = (unsigned char *) data_in;
-
-    for( word = 0; word < word_count; word++ )
-    {
-        int	i;
-        
-        for( i = 0; i < word_size/2; i++ )
-        {
-            int	t;
-            
-            t = data[i];
-            data[i] = data[word_size-i-1];
-            data[word_size-i-1] = t;
-        }
-        
-        data += word_size;
-    }
-}
-
-/************************************************************************/
-/*                          nad_ctable_load()                           */
-/*                                                                      */
-/*      Load the data portion of a ctable formatted grid.               */
-/************************************************************************/
-
-int nad_ctable_load( projCtx ctx, struct CTABLE *ct, FILE *fid )
-
-{
-    int  a_size;
-
-    fseek( fid, sizeof(struct CTABLE), SEEK_SET );
-
-    /* read all the actual shift values */
-    a_size = ct->lim.lam * ct->lim.phi;
-    ct->cvs = (FLP *) pj_malloc(sizeof(FLP) * a_size);
-    if( ct->cvs == NULL 
-        || fread(ct->cvs, sizeof(FLP), a_size, fid) != a_size )
-    {
-        pj_dalloc( ct->cvs );
-        ct->cvs = NULL;
-
-        pj_log( ctx, PJ_LOG_ERROR, 
-                "ctable loading failed on fread() - binary incompatible?\n" );
-        pj_ctx_set_errno( ctx, -38 );
-        return 0;
-    }
-
-    return 1;
-} 
-
-/************************************************************************/
-/*                          nad_ctable_init()                           */
-/*                                                                      */
-/*      Read the header portion of a "ctable" format grid.              */
-/************************************************************************/
-
-struct CTABLE *nad_ctable_init( projCtx ctx, FILE * fid )
-{
-    struct CTABLE *ct;
-    int		id_end;
-
-    /* read the table header */
-    ct = (struct CTABLE *) pj_malloc(sizeof(struct CTABLE));
-    if( ct == NULL 
-        || fread( ct, sizeof(struct CTABLE), 1, fid ) != 1 )
-    {
-        pj_ctx_set_errno( ctx, -38 );
-        return NULL;
-    }
-
-    /* do some minimal validation to ensure the structure isn't corrupt */
-    if( ct->lim.lam < 1 || ct->lim.lam > 100000 
-        || ct->lim.phi < 1 || ct->lim.phi > 100000 )
-    {
-        pj_ctx_set_errno( ctx, -38 );
-        return NULL;
-    }
-    
-    /* trim white space and newlines off id */
-    for( id_end = strlen(ct->id)-1; id_end > 0; id_end-- )
-    {
-        if( ct->id[id_end] == '\n' || ct->id[id_end] == ' ' )
-            ct->id[id_end] = '\0';
-        else
-            break;
-    }
-
-    ct->cvs = NULL;
-
-    return ct;
-}
-
-/************************************************************************/
-/*                          nad_ctable2_load()                          */
-/*                                                                      */
-/*      Load the data portion of a ctable2 formatted grid.              */
-/************************************************************************/
-
-int nad_ctable2_load( projCtx ctx, struct CTABLE *ct, FILE *fid )
-
-{
-    int  a_size;
-
-    fseek( fid, 160, SEEK_SET );
-
-    /* read all the actual shift values */
-    a_size = ct->lim.lam * ct->lim.phi;
-    ct->cvs = (FLP *) pj_malloc(sizeof(FLP) * a_size);
-    if( ct->cvs == NULL 
-        || fread(ct->cvs, sizeof(FLP), a_size, fid) != a_size )
-    {
-        pj_dalloc( ct->cvs );
-        ct->cvs = NULL;
-
-        if( getenv("PROJ_DEBUG") != NULL )
-        {
-            fprintf( stderr,
-            "ctable2 loading failed on fread() - binary incompatible?\n" );
-        }
-
-        pj_ctx_set_errno( ctx, -38 );
-        return 0;
-    }
-
-    if( !IS_LSB )
-    {
-        swap_words( ct->cvs, 4, a_size * 2 );
-    }
-
-    return 1;
-} 
-
-/************************************************************************/
-/*                          nad_ctable2_init()                          */
-/*                                                                      */
-/*      Read the header portion of a "ctable2" format grid.             */
-/************************************************************************/
-
-struct CTABLE *nad_ctable2_init( projCtx ctx, FILE * fid )
-{
-    struct CTABLE *ct;
-    int		id_end;
-    char        header[160];
-
-    if( fread( header, sizeof(header), 1, fid ) != 1 )
-    {
-        pj_ctx_set_errno( ctx, -38 );
-        return NULL;
-    }
-
-    if( !IS_LSB )
-    {
-        swap_words( header +  96, 8, 4 );
-        swap_words( header + 128, 4, 2 );
-    }
-
-    if( strncmp(header,"CTABLE V2",9) != 0 )
-    {
-        pj_log( ctx, PJ_LOG_ERROR, "ctable2 - wrong header!" );
-        pj_ctx_set_errno( ctx, -38 );
-        return NULL;
-    }
-
-    /* read the table header */
-    ct = (struct CTABLE *) pj_malloc(sizeof(struct CTABLE));
-    if( ct == NULL )
-    {
-        pj_ctx_set_errno( ctx, -38 );
-        return NULL;
-    }
-
-    memcpy( ct->id,       header +  16, 80 );
-    memcpy( &ct->ll.lam,  header +  96, 8 );
-    memcpy( &ct->ll.phi,  header + 104, 8 );
-    memcpy( &ct->del.lam, header + 112, 8 );
-    memcpy( &ct->del.phi, header + 120, 8 );
-    memcpy( &ct->lim.lam, header + 128, 4 );
-    memcpy( &ct->lim.phi, header + 132, 4 );
-
-    /* do some minimal validation to ensure the structure isn't corrupt */
-    if( ct->lim.lam < 1 || ct->lim.lam > 100000 
-        || ct->lim.phi < 1 || ct->lim.phi > 100000 )
-    {
-        pj_ctx_set_errno( ctx, -38 );
-        return NULL;
-    }
-    
-    /* trim white space and newlines off id */
-    for( id_end = strlen(ct->id)-1; id_end > 0; id_end-- )
-    {
-        if( ct->id[id_end] == '\n' || ct->id[id_end] == ' ' )
-            ct->id[id_end] = '\0';
-        else
-            break;
-    }
-
-    ct->cvs = NULL;
-
-    return ct;
-}
-
-/************************************************************************/
-/*                              nad_init()                              */
-/*                                                                      */
-/*      Read a datum shift file in any of the supported binary formats. */
-/************************************************************************/
-
-struct CTABLE *nad_init(projCtx ctx, char *name) 
-{
-    char 	fname[MAX_PATH_FILENAME+1];
-    struct CTABLE *ct;
-    FILE 	*fid;
-
-    ctx->last_errno = 0;
-
-/* -------------------------------------------------------------------- */
-/*      Open the file using the usual search rules.                     */
-/* -------------------------------------------------------------------- */
-    strcpy(fname, name);
-    if (!(fid = pj_open_lib(ctx, fname, "rb"))) {
-        return 0;
-    }
-
-    ct = nad_ctable_init( ctx, fid );
-    if( ct != NULL )
-    {
-        if( !nad_ctable_load( ctx, ct, fid ) )
-        {
-            nad_free( ct );
-            ct = NULL;
-        }
-    }
-
-    fclose(fid);
-    return ct;
-}
-
-/************************************************************************/
-/*                              nad_free()                              */
-/*                                                                      */
-/*      Free a CTABLE grid shift structure produced by nad_init().      */
-/************************************************************************/
-
-void nad_free(struct CTABLE *ct) 
-{
-    if (ct) {
-        if( ct->cvs != NULL )
-            pj_dalloc(ct->cvs);
-
-        pj_dalloc(ct);
-    }
-}
diff --git a/src/proj/nad_intr.c b/src/proj/nad_intr.c
deleted file mode 100644
index 299f180..0000000
--- a/src/proj/nad_intr.c
+++ /dev/null
@@ -1,62 +0,0 @@
-/* Determine nad table correction value */
-#define PJ_LIB__
-#include <projects.h>
-	LP
-nad_intr(LP t, struct CTABLE *ct) {
-	LP val, frct;
-	ILP indx;
-	double m00, m10, m01, m11;
-	FLP *f00, *f10, *f01, *f11;
-	long index;
-	int in;
-
-	indx.lam = floor(t.lam /= ct->del.lam);
-	indx.phi = floor(t.phi /= ct->del.phi);
-	frct.lam = t.lam - indx.lam;
-	frct.phi = t.phi - indx.phi;
-	val.lam = val.phi = HUGE_VAL;
-	if (indx.lam < 0) {
-		if (indx.lam == -1 && frct.lam > 0.99999999999) {
-			++indx.lam;
-			frct.lam = 0.;
-		} else
-			return val;
-	} else if ((in = indx.lam + 1) >= ct->lim.lam) {
-		if (in == ct->lim.lam && frct.lam < 1e-11) {
-			--indx.lam;
-			frct.lam = 1.;
-		} else
-			return val;
-	}
-	if (indx.phi < 0) {
-		if (indx.phi == -1 && frct.phi > 0.99999999999) {
-			++indx.phi;
-			frct.phi = 0.;
-		} else
-			return val;
-	} else if ((in = indx.phi + 1) >= ct->lim.phi) {
-		if (in == ct->lim.phi && frct.phi < 1e-11) {
-			--indx.phi;
-			frct.phi = 1.;
-		} else
-			return val;
-	}
-	index = indx.phi * ct->lim.lam + indx.lam;
-	f00 = ct->cvs + index++;
-	f10 = ct->cvs + index;
-	index += ct->lim.lam;
-	f11 = ct->cvs + index--;
-	f01 = ct->cvs + index;
-	m11 = m10 = frct.lam;
-	m00 = m01 = 1. - frct.lam;
-	m11 *= frct.phi;
-	m01 *= frct.phi;
-	frct.phi = 1. - frct.phi;
-	m00 *= frct.phi;
-	m10 *= frct.phi;
-	val.lam = m00 * f00->lam + m10 * f10->lam +
-			  m01 * f01->lam + m11 * f11->lam;
-	val.phi = m00 * f00->phi + m10 * f10->phi +
-			  m01 * f01->phi + m11 * f11->phi;
-	return val;
-}
diff --git a/src/proj/org_proj4_Projections.h b/src/proj/org_proj4_Projections.h
deleted file mode 100644
index 3841e05..0000000
--- a/src/proj/org_proj4_Projections.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/* DO NOT EDIT THIS FILE - it is machine generated */
-#include <jni.h>
-/* Header for class org_proj4_Projections */
-
-#ifndef _Included_org_proj4_Projections
-#define _Included_org_proj4_Projections
-#ifdef __cplusplus
-extern "C" {
-#endif
-/*
- * Class:     org_proj4_Projections
- * Method:    getProjInfo
- * Signature: (Ljava/lang/String;)Ljava/lang/String;
- */
-JNIEXPORT jstring JNICALL Java_org_proj4_Projections_getProjInfo
-  (JNIEnv *, jobject, jstring);
-
-/*
- * Class:     org_proj4_Projections
- * Method:    getEllipsInfo
- * Signature: (Ljava/lang/String;)Ljava/lang/String;
- */
-JNIEXPORT jstring JNICALL Java_org_proj4_Projections_getEllipsInfo
-  (JNIEnv *, jobject, jstring);
-
-/*
- * Class:     org_proj4_Projections
- * Method:    transform
- * Signature: ([D[D[DLjava/lang/String;Ljava/lang/String;JI)V
- */
-JNIEXPORT void JNICALL Java_org_proj4_Projections_transform
-  (JNIEnv *, jobject, jdoubleArray, jdoubleArray, jdoubleArray, jstring, jstring, jlong, jint);
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/src/proj/p_series.c b/src/proj/p_series.c
deleted file mode 100644
index 7499ab4..0000000
--- a/src/proj/p_series.c
+++ /dev/null
@@ -1,39 +0,0 @@
-/* print row coefficients of Tseries structure */
-#include "projects.h"
-#include <stdio.h>
-#include <string.h>
-#define NF 20 /* length of final format string */
-#define CUT 60 /* check length of line */
-	void
-p_series(Tseries *T, FILE *file, char *fmt) {
-	int i, j, n, L;
-	char format[NF+1];
-
-	*format = ' ';
-	strncpy(format + 1, fmt, NF - 3);
-	strcat(format, "%n");
-	fprintf(file, "u: %d\n", T->mu+1);
-	for (i = 0; i <= T->mu; ++i)
-		if (T->cu[i].m) {
-			fprintf(file, "%d %d%n", i, T->cu[i].m, &L);
-			n = 0;
-			for (j = 0; j < T->cu[i].m; ++j) {
-				if ((L += n) > CUT)
-					fprintf(file, "\n %n", &L);
-				fprintf(file, format, T->cu[i].c[j], &n);
-			}
-			fputc('\n', file);
-		}
-	fprintf(file, "v: %d\n", T->mv+1);
-	for (i = 0; i <= T->mv; ++i)
-		if (T->cv[i].m) {
-			fprintf(file, "%d %d%n", i, T->cv[i].m, &L);
-			n = 0;
-			for (j = 0; j < T->cv[i].m; ++j) {
-				if ((L += n) > 60)
-					fprintf(file, "\n %n", &L);
-				fprintf(file, format, T->cv[i].c[j], &n);
-			}
-			fputc('\n', file);
-		}
-}
diff --git a/src/proj/pj_apply_gridshift.c b/src/proj/pj_apply_gridshift.c
deleted file mode 100644
index de564e1..0000000
--- a/src/proj/pj_apply_gridshift.c
+++ /dev/null
@@ -1,249 +0,0 @@
-/******************************************************************************
- * $Id: pj_apply_gridshift.c 1950 2012-05-10 16:51:51Z caress $
- *
- * Project:  PROJ.4
- * Purpose:  Apply datum shifts based on grid shift files (normally NAD27 to
- *           NAD83 or the reverse).  This module is responsible for keeping
- *           a list of loaded grids, and calling with each one that is 
- *           allowed for a given datum (expressed as the nadgrids= parameter).
- * Author:   Frank Warmerdam, warmerdam at pobox.com
- *
- ******************************************************************************
- * Copyright (c) 2000, Frank Warmerdam <warmerdam at pobox.com>
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *****************************************************************************/
-
-#define PJ_LIB__
-
-#include <projects.h>
-#include <string.h>
-#include <math.h>
-
-/************************************************************************/
-/*                         pj_apply_gridshift()                         */
-/*                                                                      */
-/*      This is the externally callable interface - part of the         */
-/*      public API - though it is not used internally any more and I    */
-/*      doubt it is used by any other applications.  But we preserve    */
-/*      it to honour our public api.                                    */
-/************************************************************************/
-
-int pj_apply_gridshift( projCtx ctx, const char *nadgrids, int inverse, 
-                        long point_count, int point_offset,
-                        double *x, double *y, double *z )
-
-{
-    PJ_GRIDINFO **gridlist;
-    int           grid_count;
-    int           ret;
-    
-    gridlist = pj_gridlist_from_nadgrids( ctx, nadgrids, &grid_count );
-
-    if( gridlist == NULL || grid_count == 0 )
-        return ctx->last_errno;
-
-    ret = pj_apply_gridshift_3( ctx, gridlist, grid_count, inverse, 
-                                point_count, point_offset, x, y, z );
-
-    /* 
-    ** Note this frees the array of grid list pointers, but not the grids
-    ** which is as intended.  The grids themselves live on.
-    */
-    pj_dalloc( gridlist );
-
-    return ret;
-}
-
-/************************************************************************/
-/*                        pj_apply_gridshift_2()                        */
-/*                                                                      */
-/*      This implmentation takes uses the gridlist from a coordinate    */
-/*      system definition.  If the gridlist has not yet been            */
-/*      populated in the coordinate system definition we set it up      */
-/*      now.                                                            */
-/************************************************************************/
-
-int pj_apply_gridshift_2( PJ *defn, int inverse, 
-                          long point_count, int point_offset,
-                          double *x, double *y, double *z )
-
-{
-    if( defn->gridlist == NULL )
-    {
-        defn->gridlist = 
-            pj_gridlist_from_nadgrids( pj_get_ctx( defn ),
-                                       pj_param(defn->ctx, defn->params,"snadgrids").s,
-                                       &(defn->gridlist_count) );
-
-        if( defn->gridlist == NULL || defn->gridlist_count == 0 )
-            return defn->ctx->last_errno;
-    }
-     
-    return pj_apply_gridshift_3( pj_get_ctx( defn ),
-                                 defn->gridlist, defn->gridlist_count, inverse, 
-                                 point_count, point_offset, x, y, z );
-}
-
-
-/************************************************************************/
-/*                        pj_apply_gridshift_3()                        */
-/*                                                                      */
-/*      This is the real workhorse, given a gridlist.                   */
-/************************************************************************/
-
-int pj_apply_gridshift_3( projCtx ctx, PJ_GRIDINFO **tables, int grid_count,
-                          int inverse, long point_count, int point_offset,
-                          double *x, double *y, double *z )
-
-{
-    int  i;
-    static int debug_count = 0;
-
-    if( tables == NULL || grid_count == 0 )
-    {
-        pj_ctx_set_errno( ctx, -38);
-        return -38;
-    }
-
-    ctx->last_errno = 0;
-
-    for( i = 0; i < point_count; i++ )
-    {
-        long io = i * point_offset;
-        LP   input, output;
-        int  itable;
-
-        input.phi = y[io];
-        input.lam = x[io];
-        output.phi = HUGE_VAL;
-        output.lam = HUGE_VAL;
-
-        /* keep trying till we find a table that works */
-        for( itable = 0; itable < grid_count; itable++ )
-        {
-            PJ_GRIDINFO *gi = tables[itable];
-            struct CTABLE *ct = gi->ct;
-            double epsilon = (fabs(ct->del.phi)+fabs(ct->del.lam))/10000.0;
-
-            /* skip tables that don't match our point at all.  */
-            if( ct->ll.phi - epsilon > input.phi 
-                || ct->ll.lam - epsilon > input.lam
-                || (ct->ll.phi + (ct->lim.phi-1) * ct->del.phi + epsilon 
-                    < input.phi)
-                || (ct->ll.lam + (ct->lim.lam-1) * ct->del.lam + epsilon 
-                    < input.lam) )
-                continue;
-
-            /* If we have child nodes, check to see if any of them apply. */
-            if( gi->child != NULL )
-            {
-                PJ_GRIDINFO *child;
-
-                for( child = gi->child; child != NULL; child = child->next )
-                {
-                    struct CTABLE *ct1 = child->ct;
-                    double epsilon = 
-                        (fabs(ct1->del.phi)+fabs(ct1->del.lam))/10000.0;
-
-                    if( ct1->ll.phi - epsilon > input.phi 
-                        || ct1->ll.lam - epsilon > input.lam
-                        || (ct1->ll.phi+(ct1->lim.phi-1)*ct1->del.phi + epsilon 
-                            < input.phi)
-                        || (ct1->ll.lam+(ct1->lim.lam-1)*ct1->del.lam + epsilon 
-                            < input.lam) )
-                        continue;
-
-                    break;
-                }
-
-                /* we found a more refined child node to use */
-                if( child != NULL )
-                {
-                    gi = child;
-                    ct = child->ct;
-                }
-            }
-
-            /* load the grid shift info if we don't have it. */
-            if( ct->cvs == NULL && !pj_gridinfo_load( ctx, gi ) )
-            {
-                pj_ctx_set_errno( ctx, -38 );
-                return -38;
-            }
-            
-            output = nad_cvt( input, inverse, ct );
-            if( output.lam != HUGE_VAL )
-            {
-                if( debug_count++ < 20 )
-                    pj_log( ctx, PJ_LOG_DEBUG_MINOR,
-                            "pj_apply_gridshift(): used %s", ct->id );
-                break;
-            }
-        }
-
-        if( output.lam == HUGE_VAL )
-        {
-            if( ctx->debug_level >= PJ_LOG_DEBUG_MAJOR )
-            {
-                pj_log( ctx, PJ_LOG_DEBUG_MAJOR,
-                    "pj_apply_gridshift(): failed to find a grid shift table for\n"
-                    "                      location (%.7fdW,%.7fdN)",
-                    x[io] * RAD_TO_DEG, 
-                    y[io] * RAD_TO_DEG );
-                for( itable = 0; itable < grid_count; itable++ )
-                {
-                    PJ_GRIDINFO *gi = tables[itable];
-                    if( itable == 0 )
-                        pj_log( ctx, PJ_LOG_DEBUG_MAJOR,
-                                "   tried: %s", gi->gridname );
-                    else
-                        pj_log( ctx, PJ_LOG_DEBUG_MAJOR,
-                                ",%s", gi->gridname );
-                }
-            }
-
-            /* 
-             * We don't actually have any machinery currently to set the 
-             * following macro, so this is mostly kept here to make it clear 
-             * how we ought to operate if we wanted to make it super clear 
-             * that an error has occured when points are outside our available
-             * datum shift areas.  But if this is on, we will find that "low 
-             * value" points on the fringes of some datasets will completely 
-             * fail causing lots of problems when it is more or less ok to 
-             * just not apply a datum shift.  So rather than deal with
-             * that we just fallback to no shift. (see also bug #45).
-             */
-#ifdef ERR_GRID_AREA_TRANSIENT_SEVERE
-            y[io] = HUGE_VAL;
-            x[io] = HUGE_VAL;
-#else
-            /* leave x/y unshifted. */
-#endif
-        }
-        else
-        {
-            y[io] = output.phi;
-            x[io] = output.lam;
-        }
-    }
-
-    return 0;
-}
-
diff --git a/src/proj/pj_apply_vgridshift.c b/src/proj/pj_apply_vgridshift.c
deleted file mode 100644
index 0b6faf6..0000000
--- a/src/proj/pj_apply_vgridshift.c
+++ /dev/null
@@ -1,208 +0,0 @@
-/******************************************************************************
- * $Id: pj_apply_vgridshift.c 1960 2012-06-07 00:15:58Z caress $
- *
- * Project:  PROJ.4
- * Purpose:  Apply vertical datum shifts based on grid shift files, normally
- *           geoid grids mapping WGS84 to NAVD88 or something similar.
- * Author:   Frank Warmerdam, warmerdam at pobox.com
- *
- ******************************************************************************
- * Copyright (c) 2010, Frank Warmerdam <warmerdam at pobox.com>
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *****************************************************************************/
-
-#define PJ_LIB__
-
-#include <projects.h>
-#include <string.h>
-#include <math.h>
-
-/************************************************************************/
-/*                        pj_apply_vgridshift()                         */
-/*                                                                      */
-/*      This implmentation takes uses the gridlist from a coordinate    */
-/*      system definition.  If the gridlist has not yet been            */
-/*      populated in the coordinate system definition we set it up      */
-/*      now.                                                            */
-/************************************************************************/
-
-int pj_apply_vgridshift( PJ *defn, const char *listname,
-                         PJ_GRIDINFO ***gridlist_p, 
-                         int *gridlist_count_p,
-                         int inverse, 
-                         long point_count, int point_offset,
-                         double *x, double *y, double *z )
-
-{
-    int  i;
-    static int debug_count = 0;
-    PJ_GRIDINFO **tables;
-
-    if( *gridlist_p == NULL )
-    {
-        *gridlist_p = 
-            pj_gridlist_from_nadgrids( pj_get_ctx(defn), 
-                                       pj_param(defn->ctx,defn->params,listname).s,
-                                       gridlist_count_p );
-
-        if( *gridlist_p == NULL || *gridlist_count_p == 0 )
-            return defn->ctx->last_errno;
-    }
-     
-    if( *gridlist_count_p == 0 )
-    {
-        pj_ctx_set_errno( defn->ctx, -38);
-        return -38;
-    }
-
-    tables = *gridlist_p;
-    defn->ctx->last_errno = 0;
-
-    for( i = 0; i < point_count; i++ )
-    {
-        long io = i * point_offset;
-        LP   input;
-        int  itable;
-        double value = HUGE_VAL;
-
-        input.phi = y[io];
-        input.lam = x[io];
-
-        /* keep trying till we find a table that works */
-        for( itable = 0; itable < *gridlist_count_p; itable++ )
-        {
-            PJ_GRIDINFO *gi = tables[itable];
-            struct CTABLE *ct = gi->ct;
-            double grid_x, grid_y;
-            int    grid_ix, grid_iy;
-            float  *cvs;
-
-            /* skip tables that don't match our point at all.  */
-            if( ct->ll.phi > input.phi || ct->ll.lam > input.lam
-                || ct->ll.phi + (ct->lim.phi-1) * ct->del.phi < input.phi
-                || ct->ll.lam + (ct->lim.lam-1) * ct->del.lam < input.lam )
-                continue;
-
-            /* If we have child nodes, check to see if any of them apply. */
-            if( gi->child != NULL )
-            {
-                PJ_GRIDINFO *child;
-
-                for( child = gi->child; child != NULL; child = child->next )
-                {
-                    struct CTABLE *ct1 = child->ct;
-
-                    if( ct1->ll.phi > input.phi || ct1->ll.lam > input.lam
-                      || ct1->ll.phi+(ct1->lim.phi-1)*ct1->del.phi < input.phi
-                      || ct1->ll.lam+(ct1->lim.lam-1)*ct1->del.lam < input.lam)
-                        continue;
-
-                    break;
-                }
-
-                /* we found a more refined child node to use */
-                if( child != NULL )
-                {
-                    gi = child;
-                    ct = child->ct;
-                }
-            }
-
-            /* load the grid shift info if we don't have it. */
-            if( ct->cvs == NULL && !pj_gridinfo_load( pj_get_ctx(defn), gi ) )
-            {
-                pj_ctx_set_errno( defn->ctx, -38 );
-                return -38;
-            }
-
-            /* Interpolation a location within the grid */
-            grid_x = (input.lam - ct->ll.lam) / ct->del.lam;
-            grid_y = (input.phi - ct->ll.phi) / ct->del.phi;
-            grid_ix = (int) floor(grid_x);
-            grid_iy = (int) floor(grid_y);
-            grid_x -= grid_ix;
-            grid_y -= grid_iy;
-
-            cvs = (float *) ct->cvs;
-            value = cvs[grid_ix + grid_iy * ct->lim.lam] 
-                * (1.0-grid_x) * (1.0-grid_y)
-                + cvs[grid_ix + 1 + grid_iy * ct->lim.lam] 
-                * (grid_x) * (1.0-grid_y)
-                + cvs[grid_ix + (grid_iy+1) * ct->lim.lam] 
-                * (1.0-grid_x) * (grid_y)
-                + cvs[grid_ix + 1 + (grid_iy+1) * ct->lim.lam] 
-                * (grid_x) * (grid_y);
-
-            if( value > 1000 || value < -1000 ) /* nodata? */
-                value = HUGE_VAL;
-            else
-            {
-                if( inverse )
-                    z[io] -= value;
-                else
-                    z[io] += value;
-            }
-                
-            if( value != HUGE_VAL )
-            {
-                if( debug_count++ < 20 )
-                    pj_log( defn->ctx, PJ_LOG_DEBUG_MINOR, 
-                            "pj_apply_gridshift(): used %s",
-                            ct->id );
-                break;
-            }
-        }
-
-        if( value == HUGE_VAL )
-        {
-            char gridlist[3000];
-
-            pj_log( defn->ctx, PJ_LOG_DEBUG_MAJOR,
-                    "pj_apply_vgridshift(): failed to find a grid shift table for\n"
-                    "                       location (%.7fdW,%.7fdN)",
-                    x[io] * RAD_TO_DEG, 
-                    y[io] * RAD_TO_DEG );
-
-            gridlist[0] = '\0';
-            for( itable = 0; itable < *gridlist_count_p; itable++ )
-            {
-                PJ_GRIDINFO *gi = tables[itable];
-                if( strlen(gridlist) + strlen(gi->gridname) > sizeof(gridlist)-100 )
-                {
-                    strcat( gridlist, "..." );
-                    break;
-                }
-
-                if( itable == 0 )
-                    sprintf( gridlist, "   tried: %s", gi->gridname );
-                else
-                    sprintf( gridlist+strlen(gridlist), ",%s", gi->gridname );
-            }
-            pj_log( defn->ctx, PJ_LOG_DEBUG_MAJOR,
-                    "%s", gridlist );
-                
-            pj_ctx_set_errno( defn->ctx, PJD_ERR_GRID_AREA );
-            return PJD_ERR_GRID_AREA;
-        }
-    }
-
-    return 0;
-}
-
diff --git a/src/proj/pj_auth.c b/src/proj/pj_auth.c
deleted file mode 100644
index 3517841..0000000
--- a/src/proj/pj_auth.c
+++ /dev/null
@@ -1,30 +0,0 @@
-/* determine latitude from authalic latitude */
-#include <projects.h>
-# define P00 .33333333333333333333 /*   1 /     3 */
-# define P01 .17222222222222222222 /*  31 /   180 */
-# define P02 .10257936507936507937 /* 517 /  5040 */
-# define P10 .06388888888888888888 /*  23 /   360 */
-# define P11 .06640211640211640212 /* 251 /  3780 */
-# define P20 .01677689594356261023 /* 761 / 45360 */
-#define APA_SIZE 3
-	double *
-pj_authset(double es) {
-	double t, *APA;
-
-	if ((APA = (double *)pj_malloc(APA_SIZE * sizeof(double))) != NULL) {
-		APA[0] = es * P00;
-		t = es * es;
-		APA[0] += t * P01;
-		APA[1] = t * P10;
-		t *= es;
-		APA[0] += t * P02;
-		APA[1] += t * P11;
-		APA[2] = t * P20;
-	}
-	return APA;
-}
-	double
-pj_authlat(double beta, double *APA) {
-	double t = beta+beta;
-	return(beta + APA[0] * sin(t) + APA[1] * sin(t+t) + APA[2] * sin(t+t+t));
-}
diff --git a/src/proj/pj_ctx.c b/src/proj/pj_ctx.c
deleted file mode 100644
index 7084a8e..0000000
--- a/src/proj/pj_ctx.c
+++ /dev/null
@@ -1,179 +0,0 @@
-/******************************************************************************
- * $Id: pj_ctx.c 1997 2012-10-29 19:17:41Z caress $
- *
- * Project:  PROJ.4
- * Purpose:  Implementation of the projCtx thread context object.
- * Author:   Frank Warmerdam, warmerdam at pobox.com
- *
- ******************************************************************************
- * Copyright (c) 2010, Frank Warmerdam
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *****************************************************************************/
-
-#include <projects.h>
-#include <string.h>
-
-PJ_CVSID("$Id: pj_ctx.c 1997 2012-10-29 19:17:41Z caress $");
-
-static projCtx_t default_context;
-static int       default_context_initialized = 0;
-
-/************************************************************************/
-/*                             pj_get_ctx()                             */
-/************************************************************************/
-
-projCtx pj_get_ctx( projPJ pj )
-
-{
-    return pj->ctx;
-}
-
-/************************************************************************/
-/*                             pj_set_ctx()                             */
-/*                                                                      */
-/*      Note we do not deallocate the old context!                      */
-/************************************************************************/
-
-void pj_set_ctx( projPJ pj, projCtx ctx )
-
-{
-    pj->ctx = ctx;
-}
-
-/************************************************************************/
-/*                         pj_get_default_ctx()                         */
-/************************************************************************/
-
-projCtx pj_get_default_ctx()
-
-{
-    pj_acquire_lock();
-
-    if( !default_context_initialized )
-    {
-        default_context_initialized = 1;
-        default_context.last_errno = 0;
-        default_context.debug_level = PJ_LOG_NONE;
-        default_context.logger = pj_stderr_logger;
-        default_context.app_data = NULL;
-
-        if( getenv("PROJ_DEBUG") != NULL )
-        {
-            if( atoi(getenv("PROJ_DEBUG")) > 0 )
-                default_context.debug_level = atoi(getenv("PROJ_DEBUG"));
-            else
-                default_context.debug_level = PJ_LOG_DEBUG_MINOR;
-        }
-    }
-
-    pj_release_lock();
-
-    return &default_context;
-}
-
-/************************************************************************/
-/*                            pj_ctx_alloc()                            */
-/************************************************************************/
-
-projCtx pj_ctx_alloc()
-
-{
-    projCtx ctx = (projCtx_t *) malloc(sizeof(projCtx_t));
-    memcpy( ctx, pj_get_default_ctx(), sizeof(projCtx_t) );
-    ctx->last_errno = 0;
-
-    return ctx;
-}
-
-/************************************************************************/
-/*                            pj_ctx_free()                             */
-/************************************************************************/
-
-void pj_ctx_free( projCtx ctx )
-
-{
-    free( ctx );
-}
-
-/************************************************************************/
-/*                          pj_ctx_get_errno()                          */
-/************************************************************************/
-
-int pj_ctx_get_errno( projCtx ctx )
-
-{
-    return ctx->last_errno;
-}
-
-/************************************************************************/
-/*                          pj_ctx_set_errno()                          */
-/*                                                                      */
-/*      Also sets the global errno.                                     */
-/************************************************************************/
-
-void pj_ctx_set_errno( projCtx ctx, int new_errno )
-
-{
-    ctx->last_errno = new_errno;
-    if( new_errno != 0 )
-        pj_errno = new_errno;
-}
-
-/************************************************************************/
-/*                          pj_ctx_set_debug()                          */
-/************************************************************************/
-
-void pj_ctx_set_debug( projCtx ctx, int new_debug )
-
-{
-    ctx->debug_level = new_debug;
-}
-
-/************************************************************************/
-/*                         pj_ctx_set_logger()                          */
-/************************************************************************/
-
-void pj_ctx_set_logger( projCtx ctx, void (*new_logger)(void*,int,const char*) )
-
-{
-    ctx->logger = new_logger;
-}
-
-/************************************************************************/
-/*                        pj_ctx_set_app_data()                         */
-/************************************************************************/
-
-void pj_ctx_set_app_data( projCtx ctx, void *new_app_data )
-
-{
-    ctx->app_data = new_app_data;
-}
-
-/************************************************************************/
-/*                        pj_ctx_get_app_data()                         */
-/************************************************************************/
-
-void *pj_ctx_get_app_data( projCtx ctx )
-
-{
-    return ctx->app_data;
-}
-
-
diff --git a/src/proj/pj_datum_set.c b/src/proj/pj_datum_set.c
deleted file mode 100644
index d1e4d3e..0000000
--- a/src/proj/pj_datum_set.c
+++ /dev/null
@@ -1,139 +0,0 @@
-/******************************************************************************
- * $Id: pj_datum_set.c 1950 2012-05-10 16:51:51Z caress $
- *
- * Project:  PROJ.4
- * Purpose:  Apply datum definition to PJ structure from initialization string.
- * Author:   Frank Warmerdam, warmerda at home.com
- *
- ******************************************************************************
- * Copyright (c) 2000, Frank Warmerdam
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *****************************************************************************/
-
-#include <projects.h>
-#include <string.h>
-
-/* SEC_TO_RAD = Pi/180/3600 */
-#define SEC_TO_RAD 4.84813681109535993589914102357e-6
-
-/************************************************************************/
-/*                            pj_datum_set()                            */
-/************************************************************************/
-
-int pj_datum_set(projCtx ctx, paralist *pl, PJ *projdef)
-
-{
-    const char *name, *towgs84, *nadgrids;
-
-    projdef->datum_type = PJD_UNKNOWN;
-
-/* -------------------------------------------------------------------- */
-/*      Is there a datum definition in the parameters list?  If so,     */
-/*      add the defining values to the parameter list.  Note that       */
-/*      this will append the ellipse definition as well as the          */
-/*      towgs84= and related parameters.  It should also be pointed     */
-/*      out that the addition is permanent rather than temporary        */
-/*      like most other keyword expansion so that the ellipse           */
-/*      definition will last into the pj_ell_set() function called      */
-/*      after this one.                                                 */
-/* -------------------------------------------------------------------- */
-    if( (name = pj_param(ctx, pl,"sdatum").s) != NULL )
-    {
-        paralist *curr;
-        const char *s;
-        int i;
-
-        /* find the end of the list, so we can add to it */
-        for (curr = pl; curr && curr->next ; curr = curr->next) {}
-        
-        /* find the datum definition */
-        for (i = 0; (s = pj_datums[i].id) && strcmp(name, s) ; ++i) {}
-
-        if (!s) { pj_ctx_set_errno(ctx, -9); return 1; }
-
-        if( pj_datums[i].ellipse_id && strlen(pj_datums[i].ellipse_id) > 0 )
-        {
-            char	entry[100];
-            
-            strcpy( entry, "ellps=" );
-            strncat( entry, pj_datums[i].ellipse_id, 80 );
-            curr = curr->next = pj_mkparam(entry);
-        }
-        
-        if( pj_datums[i].defn && strlen(pj_datums[i].defn) > 0 )
-            curr = curr->next = pj_mkparam(pj_datums[i].defn);
-    }
-
-/* -------------------------------------------------------------------- */
-/*      Check for nadgrids parameter.                                   */
-/* -------------------------------------------------------------------- */
-    if( (nadgrids = pj_param(ctx, pl,"snadgrids").s) != NULL )
-    {
-        /* We don't actually save the value separately.  It will continue
-           to exist int he param list for use in pj_apply_gridshift.c */
-
-        projdef->datum_type = PJD_GRIDSHIFT;
-    }
-
-/* -------------------------------------------------------------------- */
-/*      Check for towgs84 parameter.                                    */
-/* -------------------------------------------------------------------- */
-    else if( (towgs84 = pj_param(ctx, pl,"stowgs84").s) != NULL )
-    {
-        int    parm_count = 0;
-        const char *s;
-
-        memset( projdef->datum_params, 0, sizeof(double) * 7);
-
-        /* parse out the parameters */
-        s = towgs84;
-        for( s = towgs84; *s != '\0' && parm_count < 7; ) 
-        {
-            projdef->datum_params[parm_count++] = atof(s);
-            while( *s != '\0' && *s != ',' )
-                s++;
-            if( *s == ',' )
-                s++;
-        }
-
-        if( projdef->datum_params[3] != 0.0 
-            || projdef->datum_params[4] != 0.0 
-            || projdef->datum_params[5] != 0.0 
-            || projdef->datum_params[6] != 0.0 )
-        {
-            projdef->datum_type = PJD_7PARAM;
-
-            /* transform from arc seconds to radians */
-            projdef->datum_params[3] *= SEC_TO_RAD;
-            projdef->datum_params[4] *= SEC_TO_RAD;
-            projdef->datum_params[5] *= SEC_TO_RAD;
-            /* transform from parts per million to scaling factor */
-            projdef->datum_params[6] = 
-                (projdef->datum_params[6]/1000000.0) + 1;
-        }
-        else 
-            projdef->datum_type = PJD_3PARAM;
-
-        /* Note that pj_init() will later switch datum_type to 
-           PJD_WGS84 if shifts are all zero, and ellipsoid is WGS84 or GRS80 */
-    }
-
-    return 0;
-}
diff --git a/src/proj/pj_datums.c b/src/proj/pj_datums.c
deleted file mode 100644
index 11e32ec..0000000
--- a/src/proj/pj_datums.c
+++ /dev/null
@@ -1,90 +0,0 @@
-/******************************************************************************
- * $Id: pj_datums.c 1950 2012-05-10 16:51:51Z caress $
- *
- * Project:  PROJ.4
- * Purpose:  Built in datum list.
- * Author:   Frank Warmerdam, warmerda at home.com
- *
- ******************************************************************************
- * Copyright (c) 2000, Frank Warmerdam
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *****************************************************************************/
-
-#define PJ_DATUMS__
-
-#include <projects.h>
-
-/* 
- * The ellipse code must match one from pj_ellps.c.  The datum id should
- * be kept to 12 characters or less if possible.  Use the official OGC 
- * datum name for the comments if available. 
- */
-
-C_NAMESPACE_VAR struct PJ_DATUMS pj_datums[] = {
-/* id       definition                               ellipse  comments */
-/* --       ----------                               -------  -------- */
-"WGS84",    "towgs84=0,0,0", 		             "WGS84", "",
-"GGRS87",   "towgs84=-199.87,74.79,246.62",          "GRS80", 
-				"Greek_Geodetic_Reference_System_1987",
-"NAD83",    "towgs84=0,0,0",                         "GRS80", 
-				"North_American_Datum_1983",
-"NAD27",    "nadgrids=@conus, at alaska, at ntv2_0.gsb, at ntv1_can.dat",           
-                                                     "clrk66", 
-				"North_American_Datum_1927",
-"potsdam",  "towgs84=598.1,73.7,418.2,0.202,0.045,-2.455,6.7",  "bessel",  "Potsdam Rauenberg 1950 DHDN",
-"carthage",  "towgs84=-263.0,6.0,431.0",  "clark80",  "Carthage 1934 Tunisia",
-"hermannskogel", "towgs84=653.0,-212.0,449.0",  "bessel",  "Hermannskogel",
-"ire65",  "towgs84=482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",  "mod_airy",  "Ireland 1965",
-"nzgd49",    "towgs84=59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993", "intl", "New Zealand Geodetic Datum 1949",
-"OSGB36",    "towgs84=446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894", "airy", "Airy 1830",
-NULL,       NULL,                                    NULL,    NULL 
-};
-
-struct PJ_DATUMS *pj_get_datums_ref()
-
-{
-    return pj_datums;
-}
-
-C_NAMESPACE_VAR struct PJ_PRIME_MERIDIANS pj_prime_meridians[] = {
-    /* id        definition                         */
-    /* --        ----------                         */
-    "greenwich", "0dE",
-    "lisbon",    "9d07'54.862\"W",
-    "paris",     "2d20'14.025\"E",
-    "bogota",    "74d04'51.3\"W",
-    "madrid",    "3d41'16.58\"W",
-    "rome",      "12d27'8.4\"E",
-    "bern",      "7d26'22.5\"E",
-    "jakarta",   "106d48'27.79\"E",
-    "ferro",     "17d40'W",
-    "brussels",  "4d22'4.71\"E",
-    "stockholm", "18d3'29.8\"E",
-    "athens",    "23d42'58.815\"E",
-    "oslo",      "10d43'22.5\"E",
-    NULL,        NULL 
-};
-
-struct PJ_PRIME_MERIDIANS *pj_get_prime_meridians_ref()
-
-{
-    return pj_prime_meridians;
-}
-
diff --git a/src/proj/pj_deriv.c b/src/proj/pj_deriv.c
deleted file mode 100644
index 7b4ef62..0000000
--- a/src/proj/pj_deriv.c
+++ /dev/null
@@ -1,33 +0,0 @@
-/* dervative of (*P->fwd) projection */
-#define PJ_LIB__
-#include "projects.h"
-	int
-pj_deriv(LP lp, double h, PJ *P, struct DERIVS *der) {
-	XY t;
-
-	lp.lam += h;
-	lp.phi += h;
-	if (fabs(lp.phi) > HALFPI) return 1;
-	h += h;
-	t = (*P->fwd)(lp, P);
-	if (t.x == HUGE_VAL) return 1;
-	der->x_l = t.x; der->y_p = t.y; der->x_p = -t.x; der->y_l = -t.y;
-	lp.phi -= h;
-	if (fabs(lp.phi) > HALFPI) return 1;
-	t = (*P->fwd)(lp, P);
-	if (t.x == HUGE_VAL) return 1;
-	der->x_l += t.x; der->y_p -= t.y; der->x_p += t.x; der->y_l -= t.y;
-	lp.lam -= h;
-	t = (*P->fwd)(lp, P);
-	if (t.x == HUGE_VAL) return 1;
-	der->x_l -= t.x; der->y_p -= t.y; der->x_p += t.x; der->y_l += t.y;
-	lp.phi += h;
-	t = (*P->fwd)(lp, P);
-	if (t.x == HUGE_VAL) return 1;
-	der->x_l -= t.x; der->y_p += t.y; der->x_p -= t.x; der->y_l += t.y;
-	der->x_l /= (h += h);
-	der->y_p /= h;
-	der->x_p /= h;
-	der->y_l /= h;
-	return 0;
-}
diff --git a/src/proj/pj_ell_set.c b/src/proj/pj_ell_set.c
deleted file mode 100644
index c0d4adc..0000000
--- a/src/proj/pj_ell_set.c
+++ /dev/null
@@ -1,105 +0,0 @@
-/* set ellipsoid parameters a and es */
-#include <projects.h>
-#include <string.h>
-#define SIXTH .1666666666666666667 /* 1/6 */
-#define RA4 .04722222222222222222 /* 17/360 */
-#define RA6 .02215608465608465608 /* 67/3024 */
-#define RV4 .06944444444444444444 /* 5/72 */
-#define RV6 .04243827160493827160 /* 55/1296 */
-	int /* initialize geographic shape parameters */
-pj_ell_set(projCtx ctx, paralist *pl, double *a, double *es) {
-	int i;
-	double b=0.0, e;
-	char *name;
-	paralist *start = 0, *curr;
-
-        /* clear any previous error */
-        pj_ctx_set_errno(ctx,0);
-
-        /* check for varying forms of ellipsoid input */
-	*a = *es = 0.;
-	/* R takes precedence */
-	if (pj_param(NULL, pl, "tR").i)
-		*a = pj_param(NULL,pl, "dR").f;
-	else { /* probable elliptical figure */
-
-		/* check if ellps present and temporarily append its values to pl */
-                if ((name = pj_param(NULL,pl, "sellps").s) != NULL) {
-			char *s;
-
-			for (start = pl; start && start->next ; start = start->next) ;
-			curr = start;
-			for (i = 0; (s = pj_ellps[i].id) && strcmp(name, s) ; ++i) ;
-			if (!s) { pj_ctx_set_errno( ctx, -9); return 1; }
-			curr = curr->next = pj_mkparam(pj_ellps[i].major);
-			curr = curr->next = pj_mkparam(pj_ellps[i].ell);
-		}
-		*a = pj_param(NULL,pl, "da").f;
-		if (pj_param(NULL,pl, "tes").i) /* eccentricity squared */
-			*es = pj_param(NULL,pl, "des").f;
-		else if (pj_param(NULL,pl, "te").i) { /* eccentricity */
-			e = pj_param(NULL,pl, "de").f;
-			*es = e * e;
-		} else if (pj_param(NULL,pl, "trf").i) { /* recip flattening */
-			*es = pj_param(NULL,pl, "drf").f;
-			if (!*es) {
-				pj_ctx_set_errno( ctx, -10);
-				goto bomb;
-			}
-			*es = 1./ *es;
-			*es = *es * (2. - *es);
-		} else if (pj_param(NULL,pl, "tf").i) { /* flattening */
-			*es = pj_param(NULL,pl, "df").f;
-			*es = *es * (2. - *es);
-		} else if (pj_param(NULL,pl, "tb").i) { /* minor axis */
-			b = pj_param(NULL,pl, "db").f;
-			*es = 1. - (b * b) / (*a * *a);
-		}     /* else *es == 0. and sphere of radius *a */
-		if (!b)
-			b = *a * sqrt(1. - *es);
-		/* following options turn ellipsoid into equivalent sphere */
-		if (pj_param(NULL,pl, "bR_A").i) { /* sphere--area of ellipsoid */
-			*a *= 1. - *es * (SIXTH + *es * (RA4 + *es * RA6));
-			*es = 0.;
-		} else if (pj_param(NULL,pl, "bR_V").i) { /* sphere--vol. of ellipsoid */
-			*a *= 1. - *es * (SIXTH + *es * (RV4 + *es * RV6));
-			*es = 0.;
-		} else if (pj_param(NULL,pl, "bR_a").i) { /* sphere--arithmetic mean */
-			*a = .5 * (*a + b);
-			*es = 0.;
-		} else if (pj_param(NULL,pl, "bR_g").i) { /* sphere--geometric mean */
-			*a = sqrt(*a * b);
-			*es = 0.;
-		} else if (pj_param(NULL,pl, "bR_h").i) { /* sphere--harmonic mean */
-			*a = 2. * *a * b / (*a + b);
-			*es = 0.;
-		} else if ((i = pj_param(NULL,pl, "tR_lat_a").i) || /* sphere--arith. */
-			pj_param(NULL,pl, "tR_lat_g").i) { /* or geom. mean at latitude */
-			double tmp;
-
-			tmp = sin(pj_param(NULL,pl, i ? "rR_lat_a" : "rR_lat_g").f);
-			if (fabs(tmp) > HALFPI) {
-                                pj_ctx_set_errno(ctx,-11);
-				goto bomb;
-			}
-			tmp = 1. - *es * tmp * tmp;
-			*a *= i ? .5 * (1. - *es + tmp) / ( tmp * sqrt(tmp)) :
-				sqrt(1. - *es) / tmp;
-			*es = 0.;
-		}
-bomb:
-		if (start) { /* clean up temporary extension of list */
-			pj_dalloc(start->next->next);
-			pj_dalloc(start->next);
-			start->next = 0;
-		}
-		if (ctx->last_errno)
-			return 1;
-	}
-	/* some remaining checks */
-	if (*es < 0.)
-        	{ pj_ctx_set_errno( ctx, -12); return 1; }
-	if (*a <= 0.)
-        	{ pj_ctx_set_errno( ctx, -13); return 1; }
-	return 0;
-}
diff --git a/src/proj/pj_ellps.c b/src/proj/pj_ellps.c
deleted file mode 100644
index 6852192..0000000
--- a/src/proj/pj_ellps.c
+++ /dev/null
@@ -1,56 +0,0 @@
-/* definition of standard geoids */
-#define PJ_ELLPS__
-#include "projects.h"
-
-C_NAMESPACE_VAR struct PJ_ELLPS
-pj_ellps[] = {
-"MERIT",	"a=6378137.0", "rf=298.257", "MERIT 1983",
-"SGS85",	"a=6378136.0", "rf=298.257",  "Soviet Geodetic System 85",
-"GRS80",	"a=6378137.0", "rf=298.257222101", "GRS 1980(IUGG, 1980)",
-"IAU76",	"a=6378140.0", "rf=298.257", "IAU 1976",
-"airy",		"a=6377563.396", "b=6356256.910", "Airy 1830",
-"APL4.9",	"a=6378137.0.",  "rf=298.25", "Appl. Physics. 1965",
-"NWL9D",	"a=6378145.0.",  "rf=298.25", "Naval Weapons Lab., 1965",
-"mod_airy",	"a=6377340.189", "b=6356034.446", "Modified Airy",
-"andrae",	"a=6377104.43",  "rf=300.0", 	"Andrae 1876 (Den., Iclnd.)",
-"aust_SA",	"a=6378160.0", "rf=298.25", "Australian Natl & S. Amer. 1969",
-"GRS67",	"a=6378160.0", "rf=298.2471674270", "GRS 67(IUGG 1967)",
-"bessel",	"a=6377397.155", "rf=299.1528128", "Bessel 1841",
-"bess_nam",	"a=6377483.865", "rf=299.1528128", "Bessel 1841 (Namibia)",
-"clrk66",	"a=6378206.4", "b=6356583.8", "Clarke 1866",
-"clrk80",	"a=6378249.145", "rf=293.4663", "Clarke 1880 mod.",
-"CPM",  	"a=6375738.7", "rf=334.29", "Comm. des Poids et Mesures 1799",
-"delmbr",	"a=6376428.",  "rf=311.5", "Delambre 1810 (Belgium)",
-"engelis",	"a=6378136.05", "rf=298.2566", "Engelis 1985",
-"evrst30",  "a=6377276.345", "rf=300.8017",  "Everest 1830",
-"evrst48",  "a=6377304.063", "rf=300.8017",  "Everest 1948",
-"evrst56",  "a=6377301.243", "rf=300.8017",  "Everest 1956",
-"evrst69",  "a=6377295.664", "rf=300.8017",  "Everest 1969",
-"evrstSS",  "a=6377298.556", "rf=300.8017",  "Everest (Sabah & Sarawak)",
-"fschr60",  "a=6378166.",   "rf=298.3", "Fischer (Mercury Datum) 1960",
-"fschr60m", "a=6378155.",   "rf=298.3", "Modified Fischer 1960",
-"fschr68",  "a=6378150.",   "rf=298.3", "Fischer 1968",
-"helmert",  "a=6378200.",   "rf=298.3", "Helmert 1906",
-"hough",	"a=6378270.0", "rf=297.", "Hough",
-"intl",		"a=6378388.0", "rf=297.", "International 1909 (Hayford)",
-"krass",	"a=6378245.0", "rf=298.3", "Krassovsky, 1942",
-"kaula",	"a=6378163.",  "rf=298.24", "Kaula 1961",
-"lerch",	"a=6378139.",  "rf=298.257", "Lerch 1979",
-"mprts",	"a=6397300.",  "rf=191.", "Maupertius 1738",
-"new_intl",	"a=6378157.5", "b=6356772.2", "New International 1967",
-"plessis",	"a=6376523.",  "b=6355863.", "Plessis 1817 (France)",
-"SEasia",	"a=6378155.0", "b=6356773.3205", "Southeast Asia",
-"walbeck",	"a=6376896.0", "b=6355834.8467", "Walbeck",
-"WGS60",    "a=6378165.0",  "rf=298.3", "WGS 60",
-"WGS66",	"a=6378145.0", "rf=298.25", "WGS 66",
-"WGS72",	"a=6378135.0", "rf=298.26", "WGS 72",
-"WGS84",    "a=6378137.0",  "rf=298.257223563", "WGS 84",
-"sphere",   "a=6370997.0",  "b=6370997.0", "Normal Sphere (r=6370997)",
-0,0,0,0
-};
-
-struct PJ_ELLPS *pj_get_ellps_ref()
-
-{
-    return pj_ellps;
-}
diff --git a/src/proj/pj_errno.c b/src/proj/pj_errno.c
deleted file mode 100644
index 8b91ab2..0000000
--- a/src/proj/pj_errno.c
+++ /dev/null
@@ -1,17 +0,0 @@
-/* For full ANSI compliance of global variable */
-
-#include <projects.h>
-
-C_NAMESPACE_VAR int pj_errno = 0;
-
-/************************************************************************/
-/*                          pj_get_errno_ref()                          */
-/************************************************************************/
-
-int *pj_get_errno_ref()
-
-{
-    return &pj_errno;
-}
-
-/* end */
diff --git a/src/proj/pj_factors.c b/src/proj/pj_factors.c
deleted file mode 100644
index 6a4db92..0000000
--- a/src/proj/pj_factors.c
+++ /dev/null
@@ -1,86 +0,0 @@
-/* projection scale factors */
-#define PJ_LIB__
-#include <projects.h>
-#include <errno.h>
-#ifndef DEFAULT_H
-#define DEFAULT_H   1e-5    /* radian default for numeric h */
-#endif
-#define EPS 1.0e-12
-	int
-pj_factors(LP lp, PJ *P, double h, struct FACTORS *fac) {
-	struct DERIVS der;
-	double cosphi, t, n, r;
-
-	/* check for forward and latitude or longitude overange */
-	if ((t = fabs(lp.phi)-HALFPI) > EPS || fabs(lp.lam) > 10.) {
-                pj_ctx_set_errno( P->ctx, -14);
-		return 1;
-	} else { /* proceed */
-		errno = pj_errno = 0;
-                P->ctx->last_errno = 0;
-
-		if (h < EPS)
-			h = DEFAULT_H;
-		if (fabs(lp.phi) > (HALFPI - h)) 
-                /* adjust to value around pi/2 where derived still exists*/
-		        lp.phi = lp.phi < 0. ? (-HALFPI+h) : (HALFPI-h);
-		else if (P->geoc)
-			lp.phi = atan(P->rone_es * tan(lp.phi));
-		lp.lam -= P->lam0;	/* compute del lp.lam */
-		if (!P->over)
-			lp.lam = adjlon(lp.lam); /* adjust del longitude */
-		if (P->spc)	/* get what projection analytic values */
-			P->spc(lp, P, fac);
-		if (((fac->code & (IS_ANAL_XL_YL+IS_ANAL_XP_YP)) !=
-			  (IS_ANAL_XL_YL+IS_ANAL_XP_YP)) &&
-			  pj_deriv(lp, h, P, &der))
-			return 1;
-		if (!(fac->code & IS_ANAL_XL_YL)) {
-			fac->der.x_l = der.x_l;
-			fac->der.y_l = der.y_l;
-		}
-		if (!(fac->code & IS_ANAL_XP_YP)) {
-			fac->der.x_p = der.x_p;
-			fac->der.y_p = der.y_p;
-		}
-		cosphi = cos(lp.phi);
-		if (!(fac->code & IS_ANAL_HK)) {
-			fac->h = hypot(fac->der.x_p, fac->der.y_p);
-			fac->k = hypot(fac->der.x_l, fac->der.y_l) / cosphi;
-			if (P->es) {
-				t = sin(lp.phi);
-				t = 1. - P->es * t * t;
-				n = sqrt(t);
-				fac->h *= t * n / P->one_es;
-				fac->k *= n;
-				r = t * t / P->one_es;
-			} else
-				r = 1.;
-		} else if (P->es) {
-			r = sin(lp.phi);
-			r = 1. - P->es * r * r;
-			r = r * r / P->one_es;
-		} else
-			r = 1.;
-		/* convergence */
-		if (!(fac->code & IS_ANAL_CONV)) {
-			fac->conv = - atan2(fac->der.y_l, fac->der.x_l);
-			if (fac->code & IS_ANAL_XL_YL)
-				fac->code |= IS_ANAL_CONV;
-		}
-		/* areal scale factor */
-		fac->s = (fac->der.y_p * fac->der.x_l - fac->der.x_p * fac->der.y_l) *
-			r / cosphi;
-		/* meridian-parallel angle theta prime */
-		fac->thetap = aasin(P->ctx,fac->s / (fac->h * fac->k));
-		/* Tissot ellips axis */
-		t = fac->k * fac->k + fac->h * fac->h;
-		fac->a = sqrt(t + 2. * fac->s);
-		t = (t = t - 2. * fac->s) <= 0. ? 0. : sqrt(t);
-		fac->b = 0.5 * (fac->a - t);
-		fac->a = 0.5 * (fac->a + t);
-		/* omega */
-		fac->omega = 2. * aasin(P->ctx,(fac->a - fac->b)/(fac->a + fac->b));
-	}
-	return 0;
-}
diff --git a/src/proj/pj_fwd.c b/src/proj/pj_fwd.c
deleted file mode 100644
index b70b424..0000000
--- a/src/proj/pj_fwd.c
+++ /dev/null
@@ -1,37 +0,0 @@
-/* general forward projection */
-#define PJ_LIB__
-#include <projects.h>
-#include <errno.h>
-# define EPS 1.0e-12
-	XY /* forward projection entry */
-pj_fwd(LP lp, PJ *P) {
-	XY xy;
-	double t;
-
-	/* check for forward and latitude or longitude overange */
-	if ((t = fabs(lp.phi)-HALFPI) > EPS || fabs(lp.lam) > 10.) {
-		xy.x = xy.y = HUGE_VAL;
-		pj_ctx_set_errno( P->ctx, -14);
-	} else { /* proceed with projection */
-                P->ctx->last_errno = 0;
-                pj_errno = 0;
-                errno = 0;
-
-		if (fabs(t) <= EPS)
-			lp.phi = lp.phi < 0. ? -HALFPI : HALFPI;
-		else if (P->geoc)
-			lp.phi = atan(P->rone_es * tan(lp.phi));
-		lp.lam -= P->lam0;	/* compute del lp.lam */
-		if (!P->over)
-			lp.lam = adjlon(lp.lam); /* adjust del longitude */
-		xy = (*P->fwd)(lp, P); /* project */
-		if ( P->ctx->last_errno )
-			xy.x = xy.y = HUGE_VAL;
-		/* adjust for major axis and easting/northings */
-		else {
-			xy.x = P->fr_meter * (P->a * xy.x + P->x0);
-			xy.y = P->fr_meter * (P->a * xy.y + P->y0);
-		}
-	}
-	return xy;
-}
diff --git a/src/proj/pj_gauss.c b/src/proj/pj_gauss.c
deleted file mode 100644
index 51e7eb1..0000000
--- a/src/proj/pj_gauss.c
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
-** libproj -- library of cartographic projections
-**
-** Copyright (c) 2003   Gerald I. Evenden
-*/
-static const char
-LIBPROJ_ID[] = "$Id: pj_gauss.c 1950 2012-05-10 16:51:51Z caress $";
-/*
-** Permission is hereby granted, free of charge, to any person obtaining
-** a copy of this software and associated documentation files (the
-** "Software"), to deal in the Software without restriction, including
-** without limitation the rights to use, copy, modify, merge, publish,
-** distribute, sublicense, and/or sell copies of the Software, and to
-** permit persons to whom the Software is furnished to do so, subject to
-** the following conditions:
-**
-** The above copyright notice and this permission notice shall be
-** included in all copies or substantial portions of the Software.
-**
-** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
-** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-** SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-*/
-#define PJ_LIB__
-#include <projects.h>
-
-#define MAX_ITER 20
-
-struct GAUSS {
-	double C;
-	double K;
-	double e;
-	double ratexp;
-};
-#define EN ((struct GAUSS *)en)
-#define DEL_TOL 1e-14
-	static double
-srat(double esinp, double exp) {
-	return(pow((1.-esinp)/(1.+esinp), exp));
-}
-
-	void *
-pj_gauss_ini(double e, double phi0, double *chi, double *rc) {
-	double sphi, cphi, es;
-	struct GAUSS *en;
-
-	if ((en = (struct GAUSS *)malloc(sizeof(struct GAUSS))) == NULL)
-		return (NULL);
-	es = e * e;
-	EN->e = e;
-	sphi = sin(phi0);
-	cphi = cos(phi0);  cphi *= cphi;
-	*rc = sqrt(1. - es) / (1. - es * sphi * sphi);
-	EN->C = sqrt(1. + es * cphi * cphi / (1. - es));
-	*chi = asin(sphi / EN->C);
-	EN->ratexp = 0.5 * EN->C * e;
-	EN->K = tan(.5 * *chi + FORTPI) / (
-		pow(tan(.5 * phi0 + FORTPI), EN->C) *
-		srat(EN->e * sphi, EN->ratexp)  );
-	return ((void *)en);
-}
-	LP
-pj_gauss(projCtx ctx, LP elp, const void *en) {
-	LP slp;
-
-	slp.phi = 2. * atan( EN->K *
-		pow(tan(.5 * elp.phi + FORTPI), EN->C) *
-		srat(EN->e * sin(elp.phi), EN->ratexp) ) - HALFPI;
-	slp.lam = EN->C * (elp.lam);
-	return(slp);
-}
-	LP
-pj_inv_gauss(projCtx ctx, LP slp, const void *en) {
-	LP elp;
-	double num;
-	int i;
-
-	elp.lam = slp.lam / EN->C;
-	num = pow(tan(.5 * slp.phi + FORTPI)/EN->K, 1./EN->C);
-	for (i = MAX_ITER; i; --i) {
-		elp.phi = 2. * atan(num * srat(EN->e * sin(slp.phi), -.5 * EN->e))
-			- HALFPI;
-		if (fabs(elp.phi - slp.phi) < DEL_TOL) break;
-			slp.phi = elp.phi;
-	}	
-	/* convergence failed */
-	if (!i)
-		pj_ctx_set_errno( ctx, -17 );
-	return (elp);
-}
diff --git a/src/proj/pj_geocent.c b/src/proj/pj_geocent.c
deleted file mode 100644
index 3251355..0000000
--- a/src/proj/pj_geocent.c
+++ /dev/null
@@ -1,57 +0,0 @@
-/******************************************************************************
- * $Id: pj_geocent.c 1770 2009-10-19 17:16:39Z caress $
- *
- * Project:  PROJ.4
- * Purpose:  Stub projection for geocentric.  The transformation isn't
- *           really done here since this code is 2D.  The real transformation
- *           is handled by pj_transform.c.
- * Author:   Frank Warmerdam, warmerdam at pobox.com
- *
- ******************************************************************************
- * Copyright (c) 2002, Frank Warmerdam
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *****************************************************************************/
-
-#define PJ_LIB__
-#include <projects.h>
-
-PJ_CVSID("$Id: pj_geocent.c 1770 2009-10-19 17:16:39Z caress $");
-
-PROJ_HEAD(geocent, "Geocentric")  "\n\t";
-
-FORWARD(forward);
-        xy.x = lp.lam;
-        xy.y = lp.phi;
-        return xy;
-}
-INVERSE(inverse);
-        lp.phi = xy.y;
-        lp.lam = xy.x;
-        return lp;
-}
-FREEUP; if (P) pj_dalloc(P); }
-
-ENTRY0(geocent)
-    P->is_geocent = 1; 
-    P->x0 = 0.0;
-    P->y0 = 0.0;
-    P->inv = inverse; P->fwd = forward;
-ENDENTRY(P)
-
diff --git a/src/proj/pj_gridinfo.c b/src/proj/pj_gridinfo.c
deleted file mode 100644
index 2ac3360..0000000
--- a/src/proj/pj_gridinfo.c
+++ /dev/null
@@ -1,870 +0,0 @@
-/******************************************************************************
- * $Id: pj_gridinfo.c 1950 2012-05-10 16:51:51Z caress $
- *
- * Project:  PROJ.4
- * Purpose:  Functions for handling individual PJ_GRIDINFO's.  Includes
- *           loaders for all formats but CTABLE (in nad_init.c).
- * Author:   Frank Warmerdam, warmerdam at pobox.com
- *
- ******************************************************************************
- * Copyright (c) 2000, Frank Warmerdam <warmerdam at pobox.com>
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *****************************************************************************/
-
-#define PJ_LIB__
-
-#include <projects.h>
-#include <string.h>
-#include <math.h>
-#include <errno.h>
-
-#ifdef _WIN32_WCE
-/* assert.h includes all Windows API headers and causes 'LP' name clash.
- * Here assert we disable assert() for Windows CE.
- * TODO - mloskot: re-implement porting friendly assert
- */
-# define assert(exp)	((void)0)
-#else
-# include <assert.h>
-#endif /* _WIN32_WCE */
-
-/************************************************************************/
-/*                             swap_words()                             */
-/*                                                                      */
-/*      Convert the byte order of the given word(s) in place.           */
-/************************************************************************/
-
-static int  byte_order_test = 1;
-#define IS_LSB	(((unsigned char *) (&byte_order_test))[0] == 1)
-
-static void swap_words( unsigned char *data, int word_size, int word_count )
-
-{
-    int	word;
-
-    for( word = 0; word < word_count; word++ )
-    {
-        int	i;
-        
-        for( i = 0; i < word_size/2; i++ )
-        {
-            int	t;
-            
-            t = data[i];
-            data[i] = data[word_size-i-1];
-            data[word_size-i-1] = t;
-        }
-        
-        data += word_size;
-    }
-}
-
-/************************************************************************/
-/*                          pj_gridinfo_free()                          */
-/************************************************************************/
-
-void pj_gridinfo_free( projCtx ctx, PJ_GRIDINFO *gi )
-
-{
-    if( gi == NULL )
-        return;
-
-    if( gi->child != NULL )
-    {
-        PJ_GRIDINFO *child, *next;
-
-        for( child = gi->child; child != NULL; child=next)
-        {
-            next=child->next;
-            pj_gridinfo_free( ctx, child );
-        }
-    }
-
-    if( gi->ct != NULL )
-        nad_free( gi->ct );
-    
-    free( gi->gridname );
-    if( gi->filename != NULL )
-        free( gi->filename );
-
-    pj_dalloc( gi );
-}
-
-/************************************************************************/
-/*                          pj_gridinfo_load()                          */
-/*                                                                      */
-/*      This function is intended to implement delayed loading of       */
-/*      the data contents of a grid file.  The header and related       */
-/*      stuff are loaded by pj_gridinfo_init().                         */
-/************************************************************************/
-
-int pj_gridinfo_load( projCtx ctx, PJ_GRIDINFO *gi )
-
-{
-    if( gi == NULL || gi->ct == NULL )
-        return 0;
-
-/* -------------------------------------------------------------------- */
-/*      Original platform specific CTable format.                       */
-/* -------------------------------------------------------------------- */
-    if( strcmp(gi->format,"ctable") == 0 )
-    {
-        FILE *fid;
-        int result;
-
-        fid = pj_open_lib( ctx, gi->filename, "rb" );
-        
-        if( fid == NULL )
-        {
-            pj_ctx_set_errno( ctx, -38 );
-            return 0;
-        }
-
-        result = nad_ctable_load( ctx, gi->ct, fid );
-
-        fclose( fid );
-
-        return result;
-    }
-
-/* -------------------------------------------------------------------- */
-/*      CTable2 format.                                                 */
-/* -------------------------------------------------------------------- */
-    else if( strcmp(gi->format,"ctable2") == 0 )
-    {
-        FILE *fid;
-        int result;
-
-        fid = pj_open_lib( ctx, gi->filename, "rb" );
-        
-        if( fid == NULL )
-        {
-            pj_ctx_set_errno( ctx, -38 );
-            return 0;
-        }
-
-        result = nad_ctable2_load( ctx, gi->ct, fid );
-
-        fclose( fid );
-
-        return result;
-    }
-
-/* -------------------------------------------------------------------- */
-/*      NTv1 format.                                                    */
-/*      We process one line at a time.  Note that the array storage     */
-/*      direction (e-w) is different in the NTv1 file and what          */
-/*      the CTABLE is supposed to have.  The phi/lam are also           */
-/*      reversed, and we have to be aware of byte swapping.             */
-/* -------------------------------------------------------------------- */
-    else if( strcmp(gi->format,"ntv1") == 0 )
-    {
-        double	*row_buf;
-        int	row;
-        FILE *fid;
-
-        fid = pj_open_lib( ctx, gi->filename, "rb" );
-        
-        if( fid == NULL )
-        {
-            pj_ctx_set_errno( ctx, -38 );
-            return 0;
-        }
-
-        fseek( fid, gi->grid_offset, SEEK_SET );
-
-        row_buf = (double *) pj_malloc(gi->ct->lim.lam * sizeof(double) * 2);
-        gi->ct->cvs = (FLP *) pj_malloc(gi->ct->lim.lam*gi->ct->lim.phi*sizeof(FLP));
-        if( row_buf == NULL || gi->ct->cvs == NULL )
-        {
-            pj_ctx_set_errno( ctx, -38 );
-            return 0;
-        }
-        
-        for( row = 0; row < gi->ct->lim.phi; row++ )
-        {
-            int	    i;
-            FLP     *cvs;
-            double  *diff_seconds;
-
-            if( fread( row_buf, sizeof(double), gi->ct->lim.lam * 2, fid ) 
-                != 2 * gi->ct->lim.lam )
-            {
-                pj_dalloc( row_buf );
-                pj_dalloc( gi->ct->cvs );
-                pj_ctx_set_errno( ctx, -38 );
-                return 0;
-            }
-
-            if( IS_LSB )
-                swap_words( (unsigned char *) row_buf, 8, gi->ct->lim.lam*2 );
-
-            /* convert seconds to radians */
-            diff_seconds = row_buf;
-
-            for( i = 0; i < gi->ct->lim.lam; i++ )
-            {
-                cvs = gi->ct->cvs + (row) * gi->ct->lim.lam
-                    + (gi->ct->lim.lam - i - 1);
-
-                cvs->phi = *(diff_seconds++) * ((PI/180.0) / 3600.0);
-                cvs->lam = *(diff_seconds++) * ((PI/180.0) / 3600.0);
-            }
-        }
-
-        pj_dalloc( row_buf );
-
-        fclose( fid );
-
-        return 1;
-    }
-
-/* -------------------------------------------------------------------- */
-/*      NTv2 format.                                                    */
-/*      We process one line at a time.  Note that the array storage     */
-/*      direction (e-w) is different in the NTv2 file and what          */
-/*      the CTABLE is supposed to have.  The phi/lam are also           */
-/*      reversed, and we have to be aware of byte swapping.             */
-/* -------------------------------------------------------------------- */
-    else if( strcmp(gi->format,"ntv2") == 0 )
-    {
-        float	*row_buf;
-        int	row;
-        FILE *fid;
-
-        pj_log( ctx, PJ_LOG_DEBUG_MINOR, 
-                "NTv2 - loading grid %s", gi->ct->id );
-
-        fid = pj_open_lib( ctx, gi->filename, "rb" );
-        
-        if( fid == NULL )
-        {
-            pj_ctx_set_errno( ctx, -38 );
-            return 0;
-        }
-
-        fseek( fid, gi->grid_offset, SEEK_SET );
-
-        row_buf = (float *) pj_malloc(gi->ct->lim.lam * sizeof(float) * 4);
-        gi->ct->cvs = (FLP *) pj_malloc(gi->ct->lim.lam*gi->ct->lim.phi*sizeof(FLP));
-        if( row_buf == NULL || gi->ct->cvs == NULL )
-        {
-            pj_ctx_set_errno( ctx, -38 );
-            return 0;
-        }
-        
-        for( row = 0; row < gi->ct->lim.phi; row++ )
-        {
-            int	    i;
-            FLP     *cvs;
-            float   *diff_seconds;
-
-            if( fread( row_buf, sizeof(float), gi->ct->lim.lam*4, fid ) 
-                != 4 * gi->ct->lim.lam )
-            {
-                pj_dalloc( row_buf );
-                pj_dalloc( gi->ct->cvs );
-                gi->ct->cvs = NULL;
-                pj_ctx_set_errno( ctx, -38 );
-                return 0;
-            }
-
-            if( !IS_LSB )
-                swap_words( (unsigned char *) row_buf, 4, 
-                            gi->ct->lim.lam*4 );
-
-            /* convert seconds to radians */
-            diff_seconds = row_buf;
-
-            for( i = 0; i < gi->ct->lim.lam; i++ )
-            {
-                cvs = gi->ct->cvs + (row) * gi->ct->lim.lam
-                    + (gi->ct->lim.lam - i - 1);
-
-                cvs->phi = *(diff_seconds++) * ((PI/180.0) / 3600.0);
-                cvs->lam = *(diff_seconds++) * ((PI/180.0) / 3600.0);
-                diff_seconds += 2; /* skip accuracy values */
-            }
-        }
-
-        pj_dalloc( row_buf );
-
-        fclose( fid );
-
-        return 1;
-    }
-
-/* -------------------------------------------------------------------- */
-/*      GTX format.                                                     */
-/* -------------------------------------------------------------------- */
-    else if( strcmp(gi->format,"gtx") == 0 )
-    {
-        int   words = gi->ct->lim.lam * gi->ct->lim.phi;
-        FILE *fid;
-
-        fid = pj_open_lib( ctx, gi->filename, "rb" );
-        
-        if( fid == NULL )
-        {
-            pj_ctx_set_errno( ctx, -38 );
-            return 0;
-        }
-
-        fseek( fid, gi->grid_offset, SEEK_SET );
-
-        gi->ct->cvs = (FLP *) pj_malloc(words*sizeof(float));
-        if( gi->ct->cvs == NULL )
-        {
-            pj_ctx_set_errno( ctx, -38 );
-            return 0;
-        }
-        
-        if( fread( gi->ct->cvs, sizeof(float), words, fid ) != words )
-        {
-            pj_dalloc( gi->ct->cvs );
-            gi->ct->cvs = NULL;
-            return 0;
-        }
-
-        if( IS_LSB )
-            swap_words( (unsigned char *) gi->ct->cvs, 4, words );
-
-        fclose( fid );
-        return 1;
-    }
-
-    else
-    {
-        return 0;
-    }
-}
-
-/************************************************************************/
-/*                       pj_gridinfo_init_ntv2()                        */
-/*                                                                      */
-/*      Load a ntv2 (.gsb) file.                                        */
-/************************************************************************/
-
-static int pj_gridinfo_init_ntv2( projCtx ctx, FILE *fid, PJ_GRIDINFO *gilist )
-
-{
-    unsigned char header[11*16];
-    int num_subfiles, subfile;
-
-    assert( sizeof(int) == 4 );
-    assert( sizeof(double) == 8 );
-    if( sizeof(int) != 4 || sizeof(double) != 8 )
-    {
-        pj_log( ctx, PJ_LOG_ERROR,
-             "basic types of inappropraiate size in pj_gridinfo_init_ntv2()" );
-        pj_ctx_set_errno( ctx, -38 );
-        return 0;
-    }
-
-/* -------------------------------------------------------------------- */
-/*      Read the overview header.                                       */
-/* -------------------------------------------------------------------- */
-    if( fread( header, sizeof(header), 1, fid ) != 1 )
-    {
-        pj_ctx_set_errno( ctx, -38 );
-        return 0;
-    }
-
-/* -------------------------------------------------------------------- */
-/*      Byte swap interesting fields if needed.                         */
-/* -------------------------------------------------------------------- */
-    if( !IS_LSB )
-    {
-        swap_words( header+8, 4, 1 );
-        swap_words( header+8+16, 4, 1 );
-        swap_words( header+8+32, 4, 1 );
-        swap_words( header+8+7*16, 8, 1 );
-        swap_words( header+8+8*16, 8, 1 );
-        swap_words( header+8+9*16, 8, 1 );
-        swap_words( header+8+10*16, 8, 1 );
-    }
-
-/* -------------------------------------------------------------------- */
-/*      Get the subfile count out ... all we really use for now.        */
-/* -------------------------------------------------------------------- */
-    memcpy( &num_subfiles, header+8+32, 4 );
-
-/* ==================================================================== */
-/*      Step through the subfiles, creating a PJ_GRIDINFO for each.     */
-/* ==================================================================== */
-    for( subfile = 0; subfile < num_subfiles; subfile++ )
-    {
-        struct CTABLE *ct;
-        LP ur;
-        int gs_count;
-        PJ_GRIDINFO *gi;
-
-/* -------------------------------------------------------------------- */
-/*      Read header.                                                    */
-/* -------------------------------------------------------------------- */
-        if( fread( header, sizeof(header), 1, fid ) != 1 )
-        {
-            pj_ctx_set_errno( ctx, -38 );
-            return 0;
-        }
-
-        if( strncmp((const char *) header,"SUB_NAME",8) != 0 )
-        {
-            pj_ctx_set_errno( ctx, -38 );
-            return 0;
-        }
-        
-/* -------------------------------------------------------------------- */
-/*      Byte swap interesting fields if needed.                         */
-/* -------------------------------------------------------------------- */
-        if( !IS_LSB )
-        {
-            swap_words( header+8+16*4, 8, 1 );
-            swap_words( header+8+16*5, 8, 1 );
-            swap_words( header+8+16*6, 8, 1 );
-            swap_words( header+8+16*7, 8, 1 );
-            swap_words( header+8+16*8, 8, 1 );
-            swap_words( header+8+16*9, 8, 1 );
-            swap_words( header+8+16*10, 4, 1 );
-        }
-        
-/* -------------------------------------------------------------------- */
-/*      Initialize a corresponding "ct" structure.                      */
-/* -------------------------------------------------------------------- */
-        ct = (struct CTABLE *) pj_malloc(sizeof(struct CTABLE));
-        strncpy( ct->id, (const char *) header + 8, 8 );
-        ct->id[8] = '\0';
-
-        ct->ll.lam = - *((double *) (header+7*16+8)); /* W_LONG */
-        ct->ll.phi = *((double *) (header+4*16+8));   /* S_LAT */
-
-        ur.lam = - *((double *) (header+6*16+8));     /* E_LONG */
-        ur.phi = *((double *) (header+5*16+8));       /* N_LAT */
-
-        ct->del.lam = *((double *) (header+9*16+8));
-        ct->del.phi = *((double *) (header+8*16+8));
-
-        ct->lim.lam = (int) (fabs(ur.lam-ct->ll.lam)/ct->del.lam + 0.5) + 1;
-        ct->lim.phi = (int) (fabs(ur.phi-ct->ll.phi)/ct->del.phi + 0.5) + 1;
-
-        pj_log( ctx, PJ_LOG_DEBUG_MINOR,
-                "NTv2 %s %dx%d: LL=(%.9g,%.9g) UR=(%.9g,%.9g)\n",
-                ct->id, 
-                ct->lim.lam, ct->lim.phi,
-                ct->ll.lam/3600.0, ct->ll.phi/3600.0,
-                ur.lam/3600.0, ur.phi/3600.0 );
-        
-        ct->ll.lam *= DEG_TO_RAD/3600.0;
-        ct->ll.phi *= DEG_TO_RAD/3600.0;
-        ct->del.lam *= DEG_TO_RAD/3600.0;
-        ct->del.phi *= DEG_TO_RAD/3600.0;
-
-        memcpy( &gs_count, header + 8 + 16*10, 4 );
-        if( gs_count != ct->lim.lam * ct->lim.phi )
-        {
-            pj_log( ctx, PJ_LOG_ERROR,
-                    "GS_COUNT(%d) does not match expected cells (%dx%d=%d)\n",
-                    gs_count, ct->lim.lam, ct->lim.phi, 
-                    ct->lim.lam * ct->lim.phi );
-            pj_ctx_set_errno( ctx, -38 );
-            return 0;
-        }
-
-        ct->cvs = NULL;
-
-/* -------------------------------------------------------------------- */
-/*      Create a new gridinfo for this if we aren't processing the      */
-/*      1st subfile, and initialize our grid info.                      */
-/* -------------------------------------------------------------------- */
-        if( subfile == 0 )
-            gi = gilist;
-        else
-        {
-            gi = (PJ_GRIDINFO *) pj_malloc(sizeof(PJ_GRIDINFO));
-            memset( gi, 0, sizeof(PJ_GRIDINFO) );
-    
-            gi->gridname = strdup( gilist->gridname );
-            gi->filename = strdup( gilist->filename );
-            gi->next = NULL;
-        }
-
-        gi->ct = ct;
-        gi->format = "ntv2";
-        gi->grid_offset = ftell( fid );
-
-/* -------------------------------------------------------------------- */
-/*      Attach to the correct list or sublist.                          */
-/* -------------------------------------------------------------------- */
-        if( strncmp((const char *)header+24,"NONE",4) == 0 )
-        {
-            if( gi != gilist )
-            {
-                PJ_GRIDINFO *lnk;
-
-                for( lnk = gilist; lnk->next != NULL; lnk = lnk->next ) {}
-                lnk->next = gi;
-            }
-        }
-
-        else
-        {
-            PJ_GRIDINFO *lnk;
-            PJ_GRIDINFO *gp = gilist;
-            
-            while( gp != NULL 
-                   && strncmp(gp->ct->id,(const char*)header+24,8) != 0 )
-                gp = gp->next;
-
-            if( gp == NULL )
-            {
-                pj_log( ctx, PJ_LOG_ERROR,
-                        "pj_gridinfo_init_ntv2(): "
-                        "failed to find parent %8.8s for %s.\n", 
-                        (const char *) header+24, gi->ct->id );
-
-                for( lnk = gp; lnk->next != NULL; lnk = lnk->next ) {}
-                lnk->next = gi;
-            }
-            else if( gp->child == NULL )
-            {
-                gp->child = gi;
-            }
-            else
-            {
-                for( lnk = gp->child; lnk->next != NULL; lnk = lnk->next ) {}
-                lnk->next = gi;
-            }
-        }
-
-/* -------------------------------------------------------------------- */
-/*      Seek past the data.                                             */
-/* -------------------------------------------------------------------- */
-        fseek( fid, gs_count * 16, SEEK_CUR );
-    }
-
-    return 1;
-}
-
-/************************************************************************/
-/*                       pj_gridinfo_init_ntv1()                        */
-/*                                                                      */
-/*      Load an NTv1 style Canadian grid shift file.                    */
-/************************************************************************/
-
-static int pj_gridinfo_init_ntv1( projCtx ctx, FILE * fid, PJ_GRIDINFO *gi )
-
-{
-    unsigned char header[176];
-    struct CTABLE *ct;
-    LP		ur;
-    
-    assert( sizeof(int) == 4 );
-    assert( sizeof(double) == 8 );
-    if( sizeof(int) != 4 || sizeof(double) != 8 )
-    {
-        pj_log( ctx, PJ_LOG_ERROR,
-                 "basic types of inappropraiate size in nad_load_ntv1()" );
-        pj_ctx_set_errno( ctx, -38 );
-        return 0;
-    }
-
-/* -------------------------------------------------------------------- */
-/*      Read the header.                                                */
-/* -------------------------------------------------------------------- */
-    if( fread( header, sizeof(header), 1, fid ) != 1 )
-    {
-        pj_ctx_set_errno( ctx, -38 );
-        return 0;
-    }
-
-/* -------------------------------------------------------------------- */
-/*      Regularize fields of interest.                                  */
-/* -------------------------------------------------------------------- */
-    if( IS_LSB )
-    {
-        swap_words( header+8, 4, 1 );
-        swap_words( header+24, 8, 1 );
-        swap_words( header+40, 8, 1 );
-        swap_words( header+56, 8, 1 );
-        swap_words( header+72, 8, 1 );
-        swap_words( header+88, 8, 1 );
-        swap_words( header+104, 8, 1 );
-    }
-
-    if( *((int *) (header+8)) != 12 )
-    {
-        pj_log( ctx, PJ_LOG_ERROR, 
-                "NTv1 grid shift file has wrong record count, corrupt?" );
-        pj_ctx_set_errno( ctx, -38 );
-        return 0;
-    }
-
-/* -------------------------------------------------------------------- */
-/*      Fill in CTABLE structure.                                       */
-/* -------------------------------------------------------------------- */
-    ct = (struct CTABLE *) pj_malloc(sizeof(struct CTABLE));
-    strcpy( ct->id, "NTv1 Grid Shift File" );
-
-    ct->ll.lam = - *((double *) (header+72));
-    ct->ll.phi = *((double *) (header+24));
-    ur.lam = - *((double *) (header+56));
-    ur.phi = *((double *) (header+40));
-    ct->del.lam = *((double *) (header+104));
-    ct->del.phi = *((double *) (header+88));
-    ct->lim.lam = (int) (fabs(ur.lam-ct->ll.lam)/ct->del.lam + 0.5) + 1;
-    ct->lim.phi = (int) (fabs(ur.phi-ct->ll.phi)/ct->del.phi + 0.5) + 1;
-
-    pj_log( ctx, PJ_LOG_DEBUG_MINOR,
-            "NTv1 %dx%d: LL=(%.9g,%.9g) UR=(%.9g,%.9g)",
-            ct->lim.lam, ct->lim.phi,
-            ct->ll.lam, ct->ll.phi, ur.lam, ur.phi );
-
-    ct->ll.lam *= DEG_TO_RAD;
-    ct->ll.phi *= DEG_TO_RAD;
-    ct->del.lam *= DEG_TO_RAD;
-    ct->del.phi *= DEG_TO_RAD;
-    ct->cvs = NULL;
-
-    gi->ct = ct;
-    gi->grid_offset = ftell( fid );
-    gi->format = "ntv1";
-
-    return 1;
-}
-
-/************************************************************************/
-/*                       pj_gridinfo_init_gtx()                         */
-/*                                                                      */
-/*      Load a NOAA .gtx vertical datum shift file.                     */
-/************************************************************************/
-
-static int pj_gridinfo_init_gtx( projCtx ctx, FILE * fid, PJ_GRIDINFO *gi )
-
-{
-    unsigned char header[40];
-    struct CTABLE *ct;
-    double      xorigin,yorigin,xstep,ystep;
-    int         rows, columns;
-
-    assert( sizeof(int) == 4 );
-    assert( sizeof(double) == 8 );
-    if( sizeof(int) != 4 || sizeof(double) != 8 )
-    {
-        pj_log( ctx, PJ_LOG_ERROR,
-                "basic types of inappropraiate size in nad_load_gtx()" );
-        pj_ctx_set_errno( ctx, -38 );
-        return 0;
-    }
-
-/* -------------------------------------------------------------------- */
-/*      Read the header.                                                */
-/* -------------------------------------------------------------------- */
-    if( fread( header, sizeof(header), 1, fid ) != 1 )
-    {
-        pj_ctx_set_errno( ctx, -38 );
-        return 0;
-    }
-
-/* -------------------------------------------------------------------- */
-/*      Regularize fields of interest and extract.                      */
-/* -------------------------------------------------------------------- */
-    if( IS_LSB )
-    {
-        swap_words( header+0, 8, 4 );
-        swap_words( header+32, 4, 2 );
-    }
-
-    memcpy( &yorigin, header+0, 8 );
-    memcpy( &xorigin, header+8, 8 );
-    memcpy( &ystep, header+16, 8 );
-    memcpy( &xstep, header+24, 8 );
-
-    memcpy( &rows, header+32, 4 );
-    memcpy( &columns, header+36, 4 );
-
-    if( xorigin < -360 || xorigin > 360 
-        || yorigin < -90 || yorigin > 90 )
-    {
-        pj_log( ctx, PJ_LOG_ERROR, 
-                "gtx file header has invalid extents, corrupt?");
-        pj_ctx_set_errno( ctx, -38 );
-        return 0;
-    }
-
-/* -------------------------------------------------------------------- */
-/*      Fill in CTABLE structure.                                       */
-/* -------------------------------------------------------------------- */
-    ct = (struct CTABLE *) pj_malloc(sizeof(struct CTABLE));
-    strcpy( ct->id, "GTX Vertical Grid Shift File" );
-
-    ct->ll.lam = xorigin;
-    ct->ll.phi = yorigin;
-    ct->del.lam = xstep;
-    ct->del.phi = ystep;
-    ct->lim.lam = columns;
-    ct->lim.phi = rows;
-
-    /* some GTX files come in 0-360 and we shift them back into the
-       expected -180 to 180 range if possible.  This does not solve 
-       problems with grids spanning the dateline. */
-    if( ct->ll.lam >= 180.0 )
-        ct->ll.lam -= 360.0;
-
-    if( ct->ll.lam >= 0.0 && ct->ll.lam + ct->del.lam * ct->lim.lam > 180.0 )
-    {
-        pj_log( ctx, PJ_LOG_DEBUG_MAJOR,
-                "This GTX spans the dateline!  This will cause problems." );
-    }
-
-    pj_log( ctx, PJ_LOG_DEBUG_MINOR,
-            "GTX %dx%d: LL=(%.9g,%.9g) UR=(%.9g,%.9g)",
-            ct->lim.lam, ct->lim.phi,
-            ct->ll.lam, ct->ll.phi, 
-            ct->ll.lam + (columns-1)*xstep, ct->ll.phi + (rows-1)*ystep);
-    
-    ct->ll.lam *= DEG_TO_RAD;
-    ct->ll.phi *= DEG_TO_RAD;
-    ct->del.lam *= DEG_TO_RAD;
-    ct->del.phi *= DEG_TO_RAD;
-    ct->cvs = NULL;
-
-    gi->ct = ct;
-    gi->grid_offset = 40;
-    gi->format = "gtx";
-
-    return 1;
-}
-
-/************************************************************************/
-/*                          pj_gridinfo_init()                          */
-/*                                                                      */
-/*      Open and parse header details from a datum gridshift file       */
-/*      returning a list of PJ_GRIDINFOs for the grids in that          */
-/*      file.  This superceeds use of nad_init() for modern             */
-/*      applications.                                                   */
-/************************************************************************/
-
-PJ_GRIDINFO *pj_gridinfo_init( projCtx ctx, const char *gridname )
-
-{
-    char 	fname[MAX_PATH_FILENAME+1];
-    PJ_GRIDINFO *gilist;
-    FILE 	*fp;
-    char	header[160];
-
-    errno = pj_errno = 0;
-    ctx->last_errno = 0;
-
-/* -------------------------------------------------------------------- */
-/*      Initialize a GRIDINFO with stub info we would use if it         */
-/*      cannot be loaded.                                               */
-/* -------------------------------------------------------------------- */
-    gilist = (PJ_GRIDINFO *) pj_malloc(sizeof(PJ_GRIDINFO));
-    memset( gilist, 0, sizeof(PJ_GRIDINFO) );
-    
-    gilist->gridname = strdup( gridname );
-    gilist->filename = NULL;
-    gilist->format = "missing";
-    gilist->grid_offset = 0;
-    gilist->ct = NULL;
-    gilist->next = NULL;
-
-/* -------------------------------------------------------------------- */
-/*      Open the file using the usual search rules.                     */
-/* -------------------------------------------------------------------- */
-    strcpy(fname, gridname);
-    if (!(fp = pj_open_lib(ctx, fname, "rb"))) {
-        ctx->last_errno = 0; /* don't treat as a persistent error */
-        return gilist;
-    }
-
-    gilist->filename = strdup(fname);
-    
-/* -------------------------------------------------------------------- */
-/*      Load a header, to determine the file type.                      */
-/* -------------------------------------------------------------------- */
-    if( fread( header, sizeof(header), 1, fp ) != 1 )
-    {
-        fclose( fp );
-        pj_ctx_set_errno( ctx, -38 );
-        return gilist;
-    }
-
-    fseek( fp, SEEK_SET, 0 );
-
-/* -------------------------------------------------------------------- */
-/*      Determine file type.                                            */
-/* -------------------------------------------------------------------- */
-    if( strncmp(header + 0, "HEADER", 6) == 0 
-        && strncmp(header + 96, "W GRID", 6) == 0 
-        && strncmp(header + 144, "TO      NAD83   ", 16) == 0 )
-    {
-        pj_gridinfo_init_ntv1( ctx, fp, gilist );
-    }
-    
-    else if( strncmp(header + 0, "NUM_OREC", 8) == 0 
-             && strncmp(header + 48, "GS_TYPE", 7) == 0 )
-    {
-        pj_gridinfo_init_ntv2( ctx, fp, gilist );
-    }
-
-    else if( strlen(gridname) > 4 
-             && (strcmp(gridname+strlen(gridname)-3,"gtx") == 0 
-                 || strcmp(gridname+strlen(gridname)-3,"GTX") == 0) )
-    {
-        pj_gridinfo_init_gtx( ctx, fp, gilist );
-    }
-
-    else if( strncmp(header + 0,"CTABLE V2",9) == 0 )
-    {
-        struct CTABLE *ct = nad_ctable2_init( ctx, fp );
-
-        gilist->format = "ctable2";
-        gilist->ct = ct;
-
-        pj_log( ctx, PJ_LOG_DEBUG_MAJOR, 
-                "Ctable2 %s %dx%d: LL=(%.9g,%.9g) UR=(%.9g,%.9g)\n",
-                ct->id, 
-                ct->lim.lam, ct->lim.phi,
-                ct->ll.lam * RAD_TO_DEG, ct->ll.phi * RAD_TO_DEG,
-                (ct->ll.lam + (ct->lim.lam-1)*ct->del.lam) * RAD_TO_DEG, 
-                (ct->ll.phi + (ct->lim.phi-1)*ct->del.phi) * RAD_TO_DEG );
-    }
-
-    else
-    {
-        struct CTABLE *ct = nad_ctable_init( ctx, fp );
-
-        gilist->format = "ctable";
-        gilist->ct = ct;
-
-        pj_log( ctx, PJ_LOG_DEBUG_MAJOR, 
-                "Ctable %s %dx%d: LL=(%.9g,%.9g) UR=(%.9g,%.9g)\n",
-                ct->id, 
-                ct->lim.lam, ct->lim.phi,
-                ct->ll.lam * RAD_TO_DEG, ct->ll.phi * RAD_TO_DEG,
-                (ct->ll.lam + (ct->lim.lam-1)*ct->del.lam) * RAD_TO_DEG, 
-                (ct->ll.phi + (ct->lim.phi-1)*ct->del.phi) * RAD_TO_DEG );
-    }
-
-    fclose(fp);
-
-    return gilist;
-}
diff --git a/src/proj/pj_gridlist.c b/src/proj/pj_gridlist.c
deleted file mode 100644
index 3a88430..0000000
--- a/src/proj/pj_gridlist.c
+++ /dev/null
@@ -1,224 +0,0 @@
-/******************************************************************************
- * $Id: pj_gridlist.c 1950 2012-05-10 16:51:51Z caress $
- *
- * Project:  PROJ.4
- * Purpose:  Code to manage the list of currently loaded (cached) PJ_GRIDINFOs
- *           See pj_gridinfo.c for details of loading individual grids.
- * Author:   Frank Warmerdam, warmerdam at pobox.com
- *
- ******************************************************************************
- * Copyright (c) 2000, Frank Warmerdam <warmerdam at pobox.com>
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *****************************************************************************/
-
-#define PJ_LIB__
-
-#include <projects.h>
-#include <string.h>
-#include <math.h>
-
-#ifdef _WIN32_WCE
-/* assert.h includes all Windows API headers and causes 'LP' name clash.
- * Here assert we disable assert() for Windows CE.
- * TODO - mloskot: re-implement porting friendly assert
- */
-# define assert(exp)	((void)0)
-#else
-# include <assert.h>
-#endif /* _WIN32_WCE */
-
-static PJ_GRIDINFO *grid_list = NULL;
-
-/************************************************************************/
-/*                        pj_deallocate_grids()                         */
-/*                                                                      */
-/*      Deallocate all loaded grids.                                    */
-/************************************************************************/
-
-void pj_deallocate_grids()
-
-{
-    while( grid_list != NULL )
-    {
-        PJ_GRIDINFO *item = grid_list;
-        grid_list = grid_list->next;
-        item->next = NULL;
-
-        pj_gridinfo_free( pj_get_default_ctx(), item );
-    }
-}
-
-/************************************************************************/
-/*                       pj_gridlist_merge_grid()                       */
-/*                                                                      */
-/*      Find/load the named gridfile and merge it into the              */
-/*      last_nadgrids_list.                                             */
-/************************************************************************/
-
-static int pj_gridlist_merge_gridfile( projCtx ctx, 
-                                       const char *gridname,
-                                       PJ_GRIDINFO ***p_gridlist,
-                                       int *p_gridcount, 
-                                       int *p_gridmax )
-
-{
-    int got_match=0;
-    PJ_GRIDINFO *this_grid, *tail = NULL;
-
-/* -------------------------------------------------------------------- */
-/*      Try to find in the existing list of loaded grids.  Add all      */
-/*      matching grids as with NTv2 we can get many grids from one      */
-/*      file (one shared gridname).                                     */
-/* -------------------------------------------------------------------- */
-    for( this_grid = grid_list; this_grid != NULL; this_grid = this_grid->next)
-    {
-        if( strcmp(this_grid->gridname,gridname) == 0 )
-        {
-            got_match = 1;
-
-            /* dont add to the list if it is invalid. */
-            if( this_grid->ct == NULL )
-                return 0;
-
-            /* do we need to grow the list? */
-            if( *p_gridcount >= *p_gridmax - 2 )
-            {
-                PJ_GRIDINFO **new_list;
-                int new_max = *p_gridmax + 20;
-
-                new_list = (PJ_GRIDINFO **) pj_malloc(sizeof(void*) * new_max);
-                if( *p_gridlist != NULL )
-                {
-                    memcpy( new_list, *p_gridlist,
-                            sizeof(void*) * (*p_gridmax) );
-                    pj_dalloc( *p_gridlist );
-                }
-
-                *p_gridlist = new_list;
-                *p_gridmax = new_max;
-            }
-
-            /* add to the list */
-            (*p_gridlist)[(*p_gridcount)++] = this_grid;
-            (*p_gridlist)[*p_gridcount] = NULL;
-        }
-
-        tail = this_grid;
-    }
-
-    if( got_match )
-        return 1;
-
-/* -------------------------------------------------------------------- */
-/*      Try to load the named grid.                                     */
-/* -------------------------------------------------------------------- */
-    this_grid = pj_gridinfo_init( ctx, gridname );
-
-    if( this_grid == NULL )
-    {
-        /* we should get at least a stub grid with a missing "ct" member */
-        assert( FALSE );
-        return 0;
-    }
-    
-    if( tail != NULL )
-        tail->next = this_grid;
-    else
-        grid_list = this_grid;
-
-/* -------------------------------------------------------------------- */
-/*      Recurse to add the grid now that it is loaded.                  */
-/* -------------------------------------------------------------------- */
-    return pj_gridlist_merge_gridfile( ctx, gridname, p_gridlist, 
-                                       p_gridcount, p_gridmax );
-}
-
-/************************************************************************/
-/*                     pj_gridlist_from_nadgrids()                      */
-/*                                                                      */
-/*      This functions loads the list of grids corresponding to a       */
-/*      particular nadgrids string into a list, and returns it.  The    */
-/*      list is kept around till a request is made with a different     */
-/*      string in order to cut down on the string parsing cost, and     */
-/*      the cost of building the list of tables each time.              */
-/************************************************************************/
-
-PJ_GRIDINFO **pj_gridlist_from_nadgrids( projCtx ctx, const char *nadgrids, 
-                                         int *grid_count)
-
-{
-    const char *s;
-    PJ_GRIDINFO **gridlist = NULL;
-    int grid_max = 0;
-
-    pj_errno = 0;
-    *grid_count = 0;
-
-    pj_acquire_lock();
-
-/* -------------------------------------------------------------------- */
-/*      Loop processing names out of nadgrids one at a time.            */
-/* -------------------------------------------------------------------- */
-    for( s = nadgrids; *s != '\0'; )
-    {
-        int   end_char;
-        int   required = 1;
-        char  name[128];
-
-        if( *s == '@' )
-        {
-            required = 0;
-            s++;
-        }
-
-        for( end_char = 0; 
-             s[end_char] != '\0' && s[end_char] != ','; 
-             end_char++ ) {}
-
-        if( end_char >= sizeof(name) )
-        {
-            pj_ctx_set_errno( ctx, -38 );
-            pj_release_lock();
-            return NULL;
-        }
-        
-        strncpy( name, s, end_char );
-        name[end_char] = '\0';
-
-        s += end_char;
-        if( *s == ',' )
-            s++;
-
-        if( !pj_gridlist_merge_gridfile( ctx, name, &gridlist, grid_count, 
-                                         &grid_max) 
-            && required )
-        {
-            pj_ctx_set_errno( ctx, -38 );
-            pj_release_lock();
-            return NULL;
-        }
-        else
-            pj_errno = 0;
-    }
-
-    pj_release_lock();
-
-    return gridlist;
-}
diff --git a/src/proj/pj_init.3 b/src/proj/pj_init.3
deleted file mode 100644
index 7bc3fee..0000000
--- a/src/proj/pj_init.3
+++ /dev/null
@@ -1,112 +0,0 @@
-.\" @(#)pj_init.3 - 4.1
-.nr LL 5.5i
-.TH PJ_INIT 3U "2001/04/05 Rel. 4.4" 
-.ad b
-.hy 1
-.SH NAME
-pj_init \- initialize cartographic projection
-.br
-pj_init_plus \- initialize cartographic projection
-.br
-pj_fwd \- forward cartographic projection
-.br
-pj_inv \- inverse cartographic projection
-.br
-pj_transform \- transform between coordinate systems
-.br
-pj_free \- de-initialize projection
-.SH SYNOPSIS
-.nf
-#include <proj_api.h>
-
-projPJ pj_init(int argc, char **argv)
-
-projPJ pj_init_plus(const char *defn)
-
-projUV pj_fwd(projUV val, projPJ proj)
-
-projUV pj_inv(projUV val, projPJ proj)
-
-int pj_transform(projPJ src_cs, projPJ dst_cs, long point_count, 
-                 int point_offset, double *x, double *y, double *z)
-               
-void pj_free(projPJ proj)
-
-.SH DESCRIPTION
-Procedure \fBpj_init\fR selects and initializes a cartographic projection
-with its argument control parameters.
-\fBArgc\fR is the number of elements in the array of control strings
-\fBargv\fR that each contain individual cartographic control keyword
-assignments (\f(CW+\fR \fBproj\fR arguments).
-The list must contain at least the \fBproj=\fIprojection\fR and
-Earth's radius or elliptical parameters.
-If the initialization of the projection is successful a valid
-address is returned otherwise a NULL value.
-
-The \fBpj_init_plus\fR function operates similarly to \fBpj_init\fR but
-takes a single string containing the definition, with each parameter
-prefixed with a plus sign.  For example "+proj=utm +zone=11 +ellps=WGS84".
-
-Once initialization is performed either forward or inverse
-projections can be performed with the returned value of \fBpj_init\fR
-used as the argument \fBproj\fR.
-The argument structure \fBprojUV\fR values \fBu\fR and \fBv\fR contain
-respective longitude and latitude or x and y.
-Latitude and longitude are in radians.
-If a projection operation fails, both elements of \fBprojUV\fR are
-set to HUGE_VAL (defined in \fImath.h\fR).
-
-\fBNote:\fR all projections have a forward mode, but some do not have
-an inverse projection.
-If the projection does not have an inverse the projPJ structure element
-\fIinv\fR will be NULL.
-
-The \fBpj_transform\fR function may be used to transform points between
-the two provided coordinate systems.  In addition to converting between
-cartographic projection coordinates and geographic coordinates, this function
-also takes care of datum shifts if possible between the source and destination
-coordinate system.  Unlike \fBpj_fwd\fR and \fBpj_inv\fR it is also allowable
-for the coordinate system definitions (\fBPJ *\fR) to be geographic coordinate
-systems (defined as +proj=latlong).  The \fBx\fR, \fBy\fR and \fBz\fR arrays
-contain the input values of the points, and are replaced with the output
-values.  The \fBpoint_offset\fR should indicate the spacing the of \fBx,y,z\fR
-arrays, normally 1.  The function returns zero on success, or the error number (also in
-pj_errno) on failure.
-
-Memory associated with the projection may be freed with \fBpj_free\fR.
-.SH EXAMPLE
-The following program reads latitude and longitude values in decimal
-degrees, performs Mercator projection with a Clarke 1866 ellipsoid and
-a 33\(de latitude of true scale and prints the projected
-cartesian values in meters:
-.nf
-\f(CW
-#include <proj_api.h>
-
-main(int argc, char **argv) {
-	char *args[] = { "proj=merc", "ellps=clrk66", "lat_ts=33" };
-	projUV p;
-	projPJ pj;
-
-	if (!(pj = pj_init(3, args)))
-	   exit(1);
-	while (scanf("%lf %lf", &p.v, &p.u) == 2) {
-	   p.u *= DEG_TO_RAD;
-	   p.v *= DEG_TO_RAD;
-	   p = pj_fwd(p, pj);
-	   printf("%.2f\et%.2f\en", p.u, p.v);
-	}
-	exit(0);
-} \fR
-.br
-.fi
-.SH LIBRARY
-libproj.a \- library of projections and support procedures
-.SH SEE ALSO
-.B http://proj.osgeo.org/ProjAPI, proj(1U),
-.br
-.I "Cartographic Projection Procedures for the UNIX Environment\(emA User's Manual,"
-(Evenden, 1990, Open-file report 90\-284).
-.SH HOME PAGE
-http://proj.osgeo.org
-
diff --git a/src/proj/pj_init.c b/src/proj/pj_init.c
deleted file mode 100644
index 209d592..0000000
--- a/src/proj/pj_init.c
+++ /dev/null
@@ -1,508 +0,0 @@
-/******************************************************************************
- * $Id: pj_init.c 1950 2012-05-10 16:51:51Z caress $
- *
- * Project:  PROJ.4
- * Purpose:  Initialize projection object from string definition.  Includes
- *           pj_init(), pj_init_plus() and pj_free() function.
- * Author:   Gerald Evenden, Frank Warmerdam <warmerdam at pobox.com>
- *
- ******************************************************************************
- * Copyright (c) 1995, Gerald Evenden
- * Copyright (c) 2002, Frank Warmerdam <warmerdam at pobox.com>
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *****************************************************************************/
-
-#define PJ_LIB__
-#include <projects.h>
-#include <stdio.h>
-#include <string.h>
-#include <errno.h>
-#include <locale.h>
-
-PJ_CVSID("$Id: pj_init.c 1950 2012-05-10 16:51:51Z caress $");
-
-/************************************************************************/
-/*                              get_opt()                               */
-/************************************************************************/
-static paralist *
-get_opt(projCtx ctx, paralist **start, FILE *fid, char *name, paralist *next) {
-    char sword[302], *word = sword+1;
-    int first = 1, len, c;
-
-    len = strlen(name);
-    *sword = 't';
-    while (fscanf(fid, "%300s", word) == 1) {
-        if (*word == '#') /* skip comments */
-            while((c = fgetc(fid)) != EOF && c != '\n') ;
-        else if (*word == '<') { /* control name */
-            if (first && !strncmp(name, word + 1, len)
-                && word[len + 1] == '>')
-                first = 0;
-            else if (!first && *word == '<') {
-                while((c = fgetc(fid)) != EOF && c != '\n') ;
-                break;
-            }
-        } else if (!first && !pj_param(ctx, *start, sword).i) {
-            /* don't default ellipse if datum, ellps or any earth model
-               information is set. */
-            if( strncmp(word,"ellps=",6) != 0 
-                || (!pj_param(ctx, *start, "tdatum").i 
-                    && !pj_param(ctx, *start, "tellps").i 
-                    && !pj_param(ctx, *start, "ta").i 
-                    && !pj_param(ctx, *start, "tb").i 
-                    && !pj_param(ctx, *start, "trf").i 
-                    && !pj_param(ctx, *start, "tf").i) )
-            {
-                next = next->next = pj_mkparam(word);
-            }
-        }
-    }
-
-    if (errno == 25)
-        errno = 0;
-    return next;
-}
-
-/************************************************************************/
-/*                            get_defaults()                            */
-/************************************************************************/
-static paralist *
-get_defaults(projCtx ctx, paralist **start, paralist *next, char *name) {
-    FILE *fid;
-
-    if ( (fid = pj_open_lib(ctx,"proj_def.dat", "rt")) != NULL) {
-        next = get_opt(ctx, start, fid, "general", next);
-        rewind(fid);
-        next = get_opt(ctx, start, fid, name, next);
-        (void)fclose(fid);
-    }
-    if (errno)
-        errno = 0; /* don't care if can't open file */
-    ctx->last_errno = 0;
-    
-    return next;
-}
-
-/************************************************************************/
-/*                              get_init()                              */
-/************************************************************************/
-static paralist *
-get_init(projCtx ctx, paralist **start, paralist *next, char *name) {
-    char fname[MAX_PATH_FILENAME+ID_TAG_MAX+3], *opt;
-    FILE *fid;
-    paralist *init_items = NULL;
-    const paralist *orig_next = next;
-
-    (void)strncpy(fname, name, MAX_PATH_FILENAME + ID_TAG_MAX + 1);
-	
-    /* 
-    ** Search for file/key pair in cache 
-    */
-	
-    init_items = pj_search_initcache( name );
-    if( init_items != NULL )
-    {
-        next->next = init_items;
-        while( next->next != NULL )
-            next = next->next;
-        return next;
-    }
-
-    /*
-    ** Otherwise we try to open the file and search for it.
-    */
-    if ((opt = strrchr(fname, ':')) != NULL)
-        *opt++ = '\0';
-    else { pj_ctx_set_errno(ctx,-3); return NULL; }
-
-    if ( (fid = pj_open_lib(ctx,fname, "rt")) != NULL)
-        next = get_opt(ctx, start, fid, opt, next);
-    else
-        return NULL;
-    (void)fclose(fid);
-    if (errno == 25)
-        errno = 0; /* unknown problem with some sys errno<-25 */
-
-    /* 
-    ** If we seem to have gotten a result, insert it into the 
-    ** init file cache.
-    */
-    if( next != NULL && next != orig_next )
-        pj_insert_initcache( name, orig_next->next );
-
-    return next;
-}
-
-/************************************************************************/
-/*                            pj_init_plus()                            */
-/*                                                                      */
-/*      Same as pj_init() except it takes one argument string with      */
-/*      individual arguments preceeded by '+', such as "+proj=utm       */
-/*      +zone=11 +ellps=WGS84".                                         */
-/************************************************************************/
-
-PJ *
-pj_init_plus( const char *definition )
-
-{
-    return pj_init_plus_ctx( pj_get_default_ctx(), definition );
-}
-
-PJ *
-pj_init_plus_ctx( projCtx ctx, const char *definition )
-{
-#define MAX_ARG 200
-    char	*argv[MAX_ARG];
-    char	*defn_copy;
-    int		argc = 0, i, blank_count = 0;
-    PJ	    *result;
-    
-    /* make a copy that we can manipulate */
-    defn_copy = (char *) pj_malloc( strlen(definition)+1 );
-    strcpy( defn_copy, definition );
-
-    /* split into arguments based on '+' and trim white space */
-
-    for( i = 0; defn_copy[i] != '\0'; i++ )
-    {
-        switch( defn_copy[i] )
-        {
-          case '+':
-            if( i == 0 || defn_copy[i-1] == '\0' || blank_count > 0 )
-            {
-                /* trim trailing spaces from the previous param */
-                if( blank_count > 0 )
-                {
-                    defn_copy[i - blank_count] = '\0';
-                    blank_count = 0;
-                }
-                
-                if( argc+1 == MAX_ARG )
-                {
-                    pj_ctx_set_errno( ctx, -44 );
-                    return NULL;
-                }
-                
-                argv[argc++] = defn_copy + i + 1;
-            }
-            break;
-
-          case ' ':
-          case '\t':
-          case '\n':
-            /* trim leading spaces from the current param */
-            if( i == 0 || defn_copy[i-1] == '\0' || argc == 0 || argv[argc-1] == defn_copy + i )
-                defn_copy[i] = '\0';
-            else
-                blank_count++;
-            break;
-
-          default:
-            /* reset blank_count */
-            blank_count = 0;
-        }
-    }
-    /* trim trailing spaces from the last param */
-    defn_copy[i - blank_count] = '\0';
-
-    /* perform actual initialization */
-    result = pj_init_ctx( ctx, argc, argv );
-
-    pj_dalloc( defn_copy );
-
-    return result;
-}
-
-/************************************************************************/
-/*                              pj_init()                               */
-/*                                                                      */
-/*      Main entry point for initialing a PJ projections                */
-/*      definition.  Note that the projection specific function is      */
-/*      called to do the initial allocation so it can be created        */
-/*      large enough to hold projection specific parameters.            */
-/************************************************************************/
-
-PJ *
-pj_init(int argc, char **argv) {
-    return pj_init_ctx( pj_get_default_ctx(), argc, argv );
-}
-
-PJ *
-pj_init_ctx(projCtx ctx, int argc, char **argv) {
-    char *s, *name;
-    paralist *start = NULL;
-    PJ *(*proj)(PJ *);
-    paralist *curr;
-    int i;
-    PJ *PIN = 0;
-    char *old_locale;
-
-    ctx->last_errno = 0;
-    start = NULL;
-
-    old_locale = strdup(setlocale(LC_NUMERIC, NULL));
-    if( strcmp(old_locale,"C") != 0 )
-        setlocale(LC_NUMERIC,"C");
-
-    /* put arguments into internal linked list */
-    if (argc <= 0) { pj_ctx_set_errno( ctx, -1 ); goto bum_call; }
-    for (i = 0; i < argc; ++i)
-        if (i)
-            curr = curr->next = pj_mkparam(argv[i]);
-        else
-            start = curr = pj_mkparam(argv[i]);
-    if (ctx->last_errno) goto bum_call;
-
-    /* check if +init present */
-    if (pj_param(ctx, start, "tinit").i) {
-        paralist *last = curr;
-
-        if (!(curr = get_init(ctx,&start, curr, pj_param(ctx, start, "sinit").s)))
-            goto bum_call;
-        if (curr == last) { pj_ctx_set_errno( ctx, -2); goto bum_call; }
-    }
-
-    /* find projection selection */
-    if (!(name = pj_param(ctx, start, "sproj").s))
-    { pj_ctx_set_errno( ctx, -4 ); goto bum_call; }
-    for (i = 0; (s = pj_list[i].id) && strcmp(name, s) ; ++i) ;
-    if (!s) { pj_ctx_set_errno( ctx, -5 ); goto bum_call; }
-
-    /* set defaults, unless inhibited */
-    if (!pj_param(ctx, start, "bno_defs").i)
-        curr = get_defaults(ctx,&start, curr, name);
-    proj = (PJ *(*)(PJ *)) pj_list[i].proj;
-
-    /* allocate projection structure */
-    if (!(PIN = (*proj)(0))) goto bum_call;
-    PIN->ctx = ctx;
-    PIN->params = start;
-    PIN->is_latlong = 0;
-    PIN->is_geocent = 0;
-    PIN->is_long_wrap_set = 0;
-    PIN->long_wrap_center = 0.0;
-    strcpy( PIN->axis, "enu" );
-
-    PIN->gridlist = NULL;
-    PIN->gridlist_count = 0;
-
-    PIN->vgridlist_geoid = NULL;
-    PIN->vgridlist_geoid_count = 0;
-
-    /* set datum parameters */
-    if (pj_datum_set(ctx, start, PIN)) goto bum_call;
-
-    /* set ellipsoid/sphere parameters */
-    if (pj_ell_set(ctx, start, &PIN->a, &PIN->es)) goto bum_call;
-
-    PIN->a_orig = PIN->a;
-    PIN->es_orig = PIN->es;
-
-    PIN->e = sqrt(PIN->es);
-    PIN->ra = 1. / PIN->a;
-    PIN->one_es = 1. - PIN->es;
-    if (PIN->one_es == 0.) { pj_ctx_set_errno( ctx, -6 ); goto bum_call; }
-    PIN->rone_es = 1./PIN->one_es;
-
-    /* Now that we have ellipse information check for WGS84 datum */
-    if( PIN->datum_type == PJD_3PARAM 
-        && PIN->datum_params[0] == 0.0
-        && PIN->datum_params[1] == 0.0
-        && PIN->datum_params[2] == 0.0
-        && PIN->a == 6378137.0
-        && ABS(PIN->es - 0.006694379990) < 0.000000000050 )/*WGS84/GRS80*/
-    {
-        PIN->datum_type = PJD_WGS84;
-    }
-        
-    /* set PIN->geoc coordinate system */
-    PIN->geoc = (PIN->es && pj_param(ctx, start, "bgeoc").i);
-
-    /* over-ranging flag */
-    PIN->over = pj_param(ctx, start, "bover").i;
-
-    /* vertical datum geoid grids */
-    PIN->has_geoid_vgrids = pj_param(ctx, start, "tgeoidgrids").i;
-    if( PIN->has_geoid_vgrids ) /* we need to mark it as used. */
-        pj_param(ctx, start, "sgeoidgrids");
-
-    /* longitude center for wrapping */
-    PIN->is_long_wrap_set = pj_param(ctx, start, "tlon_wrap").i;
-    if (PIN->is_long_wrap_set)
-        PIN->long_wrap_center = pj_param(ctx, start, "rlon_wrap").f;
-
-    /* axis orientation */
-    if( (pj_param(ctx, start,"saxis").s) != NULL )
-    {
-        static const char *axis_legal = "ewnsud";
-        const char *axis_arg = pj_param(ctx, start,"saxis").s;
-        if( strlen(axis_arg) != 3 )
-        {
-            pj_ctx_set_errno( ctx, PJD_ERR_AXIS );
-            goto bum_call;
-        }
-
-        if( strchr( axis_legal, axis_arg[0] ) == NULL
-            || strchr( axis_legal, axis_arg[1] ) == NULL
-            || strchr( axis_legal, axis_arg[2] ) == NULL)
-        {
-            pj_ctx_set_errno( ctx, PJD_ERR_AXIS );
-            goto bum_call;
-        }
-
-        /* it would be nice to validate we don't have on axis repeated */
-        strcpy( PIN->axis, axis_arg );
-    }
-
-    PIN->is_long_wrap_set = pj_param(ctx, start, "tlon_wrap").i;
-    if (PIN->is_long_wrap_set)
-        PIN->long_wrap_center = pj_param(ctx, start, "rlon_wrap").f;
-
-    /* central meridian */
-    PIN->lam0=pj_param(ctx, start, "rlon_0").f;
-
-    /* central latitude */
-    PIN->phi0 = pj_param(ctx, start, "rlat_0").f;
-
-    /* false easting and northing */
-    PIN->x0 = pj_param(ctx, start, "dx_0").f;
-    PIN->y0 = pj_param(ctx, start, "dy_0").f;
-
-    /* general scaling factor */
-    if (pj_param(ctx, start, "tk_0").i)
-        PIN->k0 = pj_param(ctx, start, "dk_0").f;
-    else if (pj_param(ctx, start, "tk").i)
-        PIN->k0 = pj_param(ctx, start, "dk").f;
-    else
-        PIN->k0 = 1.;
-    if (PIN->k0 <= 0.) {
-        pj_ctx_set_errno( ctx, -31 );
-        goto bum_call;
-    }
-
-    /* set units */
-    s = 0;
-    if ((name = pj_param(ctx, start, "sunits").s) != NULL) { 
-        for (i = 0; (s = pj_units[i].id) && strcmp(name, s) ; ++i) ;
-        if (!s) { pj_ctx_set_errno( ctx, -7 ); goto bum_call; }
-        s = pj_units[i].to_meter;
-    }
-    if (s || (s = pj_param(ctx, start, "sto_meter").s)) {
-        PIN->to_meter = strtod(s, &s);
-        if (*s == '/') /* ratio number */
-            PIN->to_meter /= strtod(++s, 0);
-        PIN->fr_meter = 1. / PIN->to_meter;
-    } else
-        PIN->to_meter = PIN->fr_meter = 1.;
-
-    /* set vertical units */
-    s = 0;
-    if ((name = pj_param(ctx, start, "svunits").s) != NULL) { 
-        for (i = 0; (s = pj_units[i].id) && strcmp(name, s) ; ++i) ;
-        if (!s) { pj_ctx_set_errno( ctx, -7 ); goto bum_call; }
-        s = pj_units[i].to_meter;
-    }
-    if (s || (s = pj_param(ctx, start, "svto_meter").s)) {
-        PIN->vto_meter = strtod(s, &s);
-        if (*s == '/') /* ratio number */
-            PIN->vto_meter /= strtod(++s, 0);
-        PIN->vfr_meter = 1. / PIN->vto_meter;
-    } else {
-        PIN->vto_meter = PIN->to_meter;
-        PIN->vfr_meter = PIN->fr_meter;
-    }
-
-    /* prime meridian */
-    s = 0;
-    if ((name = pj_param(ctx, start, "spm").s) != NULL) { 
-        const char *value = NULL;
-        char *next_str = NULL;
-
-        for (i = 0; pj_prime_meridians[i].id != NULL; ++i )
-        {
-            if( strcmp(name,pj_prime_meridians[i].id) == 0 )
-            {
-                value = pj_prime_meridians[i].defn;
-                break;
-            }
-        }
-            
-        if( value == NULL 
-            && (dmstor_ctx(ctx,name,&next_str) != 0.0  || *name == '0')
-            && *next_str == '\0' )
-            value = name;
-
-        if (!value) { pj_ctx_set_errno( ctx, -46 ); goto bum_call; }
-        PIN->from_greenwich = dmstor_ctx(ctx,value,NULL);
-    }
-    else
-        PIN->from_greenwich = 0.0;
-
-    /* projection specific initialization */
-    if (!(PIN = (*proj)(PIN)) || ctx->last_errno) {
-      bum_call: /* cleanup error return */
-        if (PIN)
-            pj_free(PIN);
-        else
-            for ( ; start; start = curr) {
-                curr = start->next;
-                pj_dalloc(start);
-            }
-        PIN = 0;
-    }
-
-    if( strcmp(old_locale,"C") != 0 )
-        setlocale(LC_NUMERIC,old_locale);
-    free( (char*)old_locale );
-
-    return PIN;
-}
-
-/************************************************************************/
-/*                              pj_free()                               */
-/*                                                                      */
-/*      This is the application callable entry point for destroying     */
-/*      a projection definition.  It does work generic to all           */
-/*      projection types, and then calls the projection specific        */
-/*      free function (P->pfree()) to do local work.  This maps to      */
-/*      the FREEUP code in the individual projection source files.      */
-/************************************************************************/
-
-void
-pj_free(PJ *P) {
-    if (P) {
-        paralist *t = P->params, *n;
-
-        /* free parameter list elements */
-        for (t = P->params; t; t = n) {
-            n = t->next;
-            pj_dalloc(t);
-        }
-
-        /* free array of grid pointers if we have one */
-        if( P->gridlist != NULL )
-            pj_dalloc( P->gridlist );
-        
-        /* free projection parameters */
-        P->pfree(P);
-    }
-}
-
-
diff --git a/src/proj/pj_initcache.c b/src/proj/pj_initcache.c
deleted file mode 100644
index 9fd0b8b..0000000
--- a/src/proj/pj_initcache.c
+++ /dev/null
@@ -1,181 +0,0 @@
-/******************************************************************************
- * $Id: pj_initcache.c 1950 2012-05-10 16:51:51Z caress $
- *
- * Project:  PROJ.4
- * Purpose:  init file definition cache.
- * Author:   Frank Warmerdam, warmerdam at pobox.com
- *
- ******************************************************************************
- * Copyright (c) 2009, Frank Warmerdam
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *****************************************************************************/
-
-#include <projects.h>
-#include <string.h>
-
-PJ_CVSID("$Id: pj_initcache.c 1950 2012-05-10 16:51:51Z caress $");
-
-static int cache_count = 0;
-static int cache_alloc = 0;
-static char **cache_key = NULL;
-static paralist **cache_paralist = NULL;
-
-/************************************************************************/
-/*                            pj_clone_paralist()                       */
-/*                                                                      */
-/*     Allocate a copy of a parameter list.                             */
-/************************************************************************/
-
-paralist *pj_clone_paralist( const paralist *list)
-{
-  paralist *list_copy = NULL, *next_copy = NULL;
-
-  for( ; list != NULL; list = list->next )
-    {
-      paralist *newitem = (paralist *)
-	pj_malloc(sizeof(paralist) + strlen(list->param));
-
-      newitem->used = 0;
-      newitem->next = 0;
-      strcpy( newitem->param, list->param );
-      
-      if( list_copy == NULL )
-	list_copy = newitem;
-      else
-	next_copy->next = newitem;
-
-      next_copy = newitem;
-    }
-
-  return list_copy;
-}
-
-/************************************************************************/
-/*                            pj_clear_initcache()                      */
-/*                                                                      */
-/*      Clear out all memory held in the init file cache.               */
-/************************************************************************/
-
-void pj_clear_initcache()
-{
-    if( cache_alloc > 0 )
-    {
-        int i;
-
-        pj_acquire_lock();
-
-        for( i = 0; i < cache_count; i++ )
-        {
-            paralist *n, *t = cache_paralist[i];
-		
-            pj_dalloc( cache_key[i] );
-
-            /* free parameter list elements */
-            for (; t != NULL; t = n) {
-                n = t->next;
-                pj_dalloc(t);
-            }
-        }
-
-        pj_dalloc( cache_key );
-        pj_dalloc( cache_paralist );
-        cache_count = 0;
-        cache_alloc= 0;
-        cache_key = NULL;
-        cache_paralist = NULL;
-
-        pj_release_lock();
-    }
-}
-
-/************************************************************************/
-/*                            pj_search_initcache()                     */
-/*                                                                      */
-/*      Search for a matching definition in the init cache.             */
-/************************************************************************/
-
-paralist *pj_search_initcache( const char *filekey )
-
-{
-    int i;
-    paralist *result = NULL;
-
-    pj_acquire_lock();
-
-    for( i = 0; result == NULL && i < cache_count; i++)
-    {
-        if( strcmp(filekey,cache_key[i]) == 0 )
-	{
-            result = pj_clone_paralist( cache_paralist[i] );
-	}
-    }
-
-    pj_release_lock();
-
-    return result;
-}
-
-/************************************************************************/
-/*                            pj_insert_initcache()                     */
-/*                                                                      */
-/*      Insert a paralist definition in the init file cache.            */
-/************************************************************************/
-
-void pj_insert_initcache( const char *filekey, const paralist *list )
-
-{
-    pj_acquire_lock();
-
-    /* 
-    ** Grow list if required.
-    */
-    if( cache_count == cache_alloc )
-    {
-        char **cache_key_new;
-        paralist **cache_paralist_new;
-
-        cache_alloc = cache_alloc * 2 + 15;
-
-        cache_key_new = (char **) pj_malloc(sizeof(char*) * cache_alloc);
-        memcpy( cache_key_new, cache_key, sizeof(char*) * cache_count);
-        pj_dalloc( cache_key );
-        cache_key = cache_key_new;
-
-        cache_paralist_new = (paralist **) 
-            pj_malloc(sizeof(paralist*) * cache_alloc);
-        memcpy( cache_paralist_new, cache_paralist, 
-                sizeof(paralist*) * cache_count );
-        pj_dalloc( cache_paralist );
-        cache_paralist = cache_paralist_new;
-    }
-
-    /*
-    ** Duplicate the filekey and paralist, and insert in cache.
-    */
-    cache_key[cache_count] = (char *) pj_malloc(strlen(filekey)+1);
-    strcpy( cache_key[cache_count], filekey );
-
-    cache_paralist[cache_count] = pj_clone_paralist( list );
-
-    cache_count++;
-
-    pj_release_lock();
-}
-
diff --git a/src/proj/pj_inv.c b/src/proj/pj_inv.c
deleted file mode 100644
index a418ccd..0000000
--- a/src/proj/pj_inv.c
+++ /dev/null
@@ -1,33 +0,0 @@
-/* general inverse projection */
-#define PJ_LIB__
-#include <projects.h>
-#include <errno.h>
-# define EPS 1.0e-12
-	LP /* inverse projection entry */
-pj_inv(XY xy, PJ *P) {
-	LP lp;
-
-	/* can't do as much preliminary checking as with forward */
-	if (xy.x == HUGE_VAL || xy.y == HUGE_VAL) {
-		lp.lam = lp.phi = HUGE_VAL;
-		pj_ctx_set_errno( P->ctx, -15);
-                return lp;
-	}
-
-	errno = pj_errno = 0;
-        P->ctx->last_errno = 0;
-
-	xy.x = (xy.x * P->to_meter - P->x0) * P->ra; /* descale and de-offset */
-	xy.y = (xy.y * P->to_meter - P->y0) * P->ra;
-	lp = (*P->inv)(xy, P); /* inverse project */
-	if (P->ctx->last_errno )
-		lp.lam = lp.phi = HUGE_VAL;
-	else {
-		lp.lam += P->lam0; /* reduce from del lp.lam */
-		if (!P->over)
-			lp.lam = adjlon(lp.lam); /* adjust longitude to CM */
-		if (P->geoc && fabs(fabs(lp.phi)-HALFPI) > EPS)
-			lp.phi = atan(P->one_es * tan(lp.phi));
-	}
-	return lp;
-}
diff --git a/src/proj/pj_latlong.c b/src/proj/pj_latlong.c
deleted file mode 100644
index 091f2ae..0000000
--- a/src/proj/pj_latlong.c
+++ /dev/null
@@ -1,80 +0,0 @@
-/******************************************************************************
- * $Id: pj_latlong.c 1770 2009-10-19 17:16:39Z caress $
- *
- * Project:  PROJ.4
- * Purpose:  Stub projection implementation for lat/long coordinates. We 
- *           don't actually change the coordinates, but we want proj=latlong
- *           to act sort of like a projection.
- * Author:   Frank Warmerdam, warmerdam at pobox.com
- *
- ******************************************************************************
- * Copyright (c) 2000, Frank Warmerdam
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *****************************************************************************/
-
-/* very loosely based upon DMA code by Bradford W. Drew */
-#define PJ_LIB__
-#include	<projects.h>
-PROJ_HEAD(lonlat, "Lat/long (Geodetic)")  "\n\t";
-PROJ_HEAD(latlon, "Lat/long (Geodetic alias)")  "\n\t";
-PROJ_HEAD(latlong, "Lat/long (Geodetic alias)")  "\n\t";
-PROJ_HEAD(longlat, "Lat/long (Geodetic alias)")  "\n\t";
-
-FORWARD(forward);
-
-        xy.x = lp.lam / P->a;
-        xy.y = lp.phi / P->a;
-        return xy;
-}
-INVERSE(inverse);
-
-        lp.phi = xy.y * P->a;
-        lp.lam = xy.x * P->a;
-        return lp;
-}
-FREEUP; if (P) pj_dalloc(P); }
-
-ENTRY0(latlong)
-        P->is_latlong = 1;
-        P->x0 = 0.0;
-        P->y0 = 0.0;
-	P->inv = inverse; P->fwd = forward;
-ENDENTRY(P)
-
-ENTRY0(longlat)
-        P->is_latlong = 1;
-        P->x0 = 0.0;
-        P->y0 = 0.0;
-	P->inv = inverse; P->fwd = forward;
-ENDENTRY(P)
-
-ENTRY0(latlon)
-        P->is_latlong = 1;
-        P->x0 = 0.0;
-        P->y0 = 0.0;
-	P->inv = inverse; P->fwd = forward;
-ENDENTRY(P)
-
-ENTRY0(lonlat)
-        P->is_latlong = 1;
-        P->x0 = 0.0;
-        P->y0 = 0.0;
-	P->inv = inverse; P->fwd = forward;
-ENDENTRY(P)
diff --git a/src/proj/pj_list.c b/src/proj/pj_list.c
deleted file mode 100644
index 7d35811..0000000
--- a/src/proj/pj_list.c
+++ /dev/null
@@ -1,11 +0,0 @@
-/* Projection System: default list of projections
-** Use local definition of PJ_LIST_H for subset.
-*/
-#define PJ_LIST_H "pj_list.h"
-#include "projects.h"
-
-struct PJ_LIST  *pj_get_list_ref()
-
-{
-    return pj_list;
-}
diff --git a/src/proj/pj_list.h b/src/proj/pj_list.h
deleted file mode 100644
index 8230f92..0000000
--- a/src/proj/pj_list.h
+++ /dev/null
@@ -1,142 +0,0 @@
-#ifdef DO_PJ_LIST_ID
-static const char PJ_LIST_H_ID[] = "@(#)pj_list.h	4.5	95/08/09	GIE	REL";
-#endif
-/* Full list of current projections for Tue Jan 11 12:27:04 EST 1994
-**
-** Copy this file and retain only appropriate lines for subset list
-*/
-PROJ_HEAD(aea, "Albers Equal Area")
-PROJ_HEAD(aeqd, "Azimuthal Equidistant")
-PROJ_HEAD(airy, "Airy")
-PROJ_HEAD(aitoff, "Aitoff")
-PROJ_HEAD(alsk, "Mod. Stererographics of Alaska")
-PROJ_HEAD(apian, "Apian Globular I")
-PROJ_HEAD(august, "August Epicycloidal")
-PROJ_HEAD(bacon, "Bacon Globular")
-PROJ_HEAD(bipc, "Bipolar conic of western hemisphere")
-PROJ_HEAD(boggs, "Boggs Eumorphic")
-PROJ_HEAD(bonne, "Bonne (Werner lat_1=90)")
-PROJ_HEAD(cass, "Cassini")
-PROJ_HEAD(cc, "Central Cylindrical")
-PROJ_HEAD(cea, "Equal Area Cylindrical")
-PROJ_HEAD(chamb, "Chamberlin Trimetric")
-PROJ_HEAD(collg, "Collignon")
-PROJ_HEAD(crast, "Craster Parabolic (Putnins P4)")
-PROJ_HEAD(denoy, "Denoyer Semi-Elliptical")
-PROJ_HEAD(eck1, "Eckert I")
-PROJ_HEAD(eck2, "Eckert II")
-PROJ_HEAD(eck3, "Eckert III")
-PROJ_HEAD(eck4, "Eckert IV")
-PROJ_HEAD(eck5, "Eckert V")
-PROJ_HEAD(eck6, "Eckert VI")
-PROJ_HEAD(eqc, "Equidistant Cylindrical (Plate Caree)")
-PROJ_HEAD(eqdc, "Equidistant Conic")
-PROJ_HEAD(euler, "Euler")
-PROJ_HEAD(etmerc, "Extended Transverse Mercator" )
-PROJ_HEAD(fahey, "Fahey")
-PROJ_HEAD(fouc, "Foucaut")
-PROJ_HEAD(fouc_s, "Foucaut Sinusoidal")
-PROJ_HEAD(gall, "Gall (Gall Stereographic)")
-PROJ_HEAD(geocent, "Geocentric")
-PROJ_HEAD(geos, "Geostationary Satellite View")
-PROJ_HEAD(gins8, "Ginsburg VIII (TsNIIGAiK)")
-PROJ_HEAD(gn_sinu, "General Sinusoidal Series")
-PROJ_HEAD(gnom, "Gnomonic")
-PROJ_HEAD(goode, "Goode Homolosine")
-PROJ_HEAD(gs48, "Mod. Stererographics of 48 U.S.")
-PROJ_HEAD(gs50, "Mod. Stererographics of 50 U.S.")
-PROJ_HEAD(hammer, "Hammer & Eckert-Greifendorff")
-PROJ_HEAD(hatano, "Hatano Asymmetrical Equal Area")
-PROJ_HEAD(healpix, "HEALPix")
-PROJ_HEAD(rhealpix, "rHEALPix")
-PROJ_HEAD(igh,  "Interrupted Goode Homolosine")
-PROJ_HEAD(imw_p, "Internation Map of the World Polyconic")
-PROJ_HEAD(isea, "Icosahedral Snyder Equal Area")
-PROJ_HEAD(kav5, "Kavraisky V")
-PROJ_HEAD(kav7, "Kavraisky VII")
-PROJ_HEAD(krovak, "Krovak")
-PROJ_HEAD(labrd, "Laborde")
-PROJ_HEAD(laea, "Lambert Azimuthal Equal Area")
-PROJ_HEAD(lagrng, "Lagrange")
-PROJ_HEAD(larr, "Larrivee")
-PROJ_HEAD(lask, "Laskowski")
-PROJ_HEAD(lonlat, "Lat/long (Geodetic)")
-PROJ_HEAD(latlon, "Lat/long (Geodetic alias)")
-PROJ_HEAD(latlong, "Lat/long (Geodetic alias)")
-PROJ_HEAD(longlat, "Lat/long (Geodetic alias)")
-PROJ_HEAD(lcc, "Lambert Conformal Conic")
-PROJ_HEAD(lcca, "Lambert Conformal Conic Alternative")
-PROJ_HEAD(leac, "Lambert Equal Area Conic")
-PROJ_HEAD(lee_os, "Lee Oblated Stereographic")
-PROJ_HEAD(loxim, "Loximuthal")
-PROJ_HEAD(lsat, "Space oblique for LANDSAT")
-PROJ_HEAD(mbt_s, "McBryde-Thomas Flat-Polar Sine")
-PROJ_HEAD(mbt_fps, "McBryde-Thomas Flat-Pole Sine (No. 2)")
-PROJ_HEAD(mbtfpp, "McBride-Thomas Flat-Polar Parabolic")
-PROJ_HEAD(mbtfpq, "McBryde-Thomas Flat-Polar Quartic")
-PROJ_HEAD(mbtfps, "McBryde-Thomas Flat-Polar Sinusoidal")
-PROJ_HEAD(merc, "Mercator")
-PROJ_HEAD(mil_os, "Miller Oblated Stereographic")
-PROJ_HEAD(mill, "Miller Cylindrical")
-PROJ_HEAD(moll, "Mollweide")
-PROJ_HEAD(murd1, "Murdoch I")
-PROJ_HEAD(murd2, "Murdoch II")
-PROJ_HEAD(murd3, "Murdoch III")
-PROJ_HEAD(natearth, "Natural Earth")
-PROJ_HEAD(nell, "Nell")
-PROJ_HEAD(nell_h, "Nell-Hammer")
-PROJ_HEAD(nicol, "Nicolosi Globular")
-PROJ_HEAD(nsper, "Near-sided perspective")
-PROJ_HEAD(nzmg, "New Zealand Map Grid")
-PROJ_HEAD(ob_tran, "General Oblique Transformation")
-PROJ_HEAD(ocea, "Oblique Cylindrical Equal Area")
-PROJ_HEAD(oea, "Oblated Equal Area")
-PROJ_HEAD(omerc, "Oblique Mercator")
-PROJ_HEAD(ortel, "Ortelius Oval")
-PROJ_HEAD(ortho, "Orthographic")
-PROJ_HEAD(pconic, "Perspective Conic")
-PROJ_HEAD(poly, "Polyconic (American)")
-PROJ_HEAD(putp1, "Putnins P1")
-PROJ_HEAD(putp2, "Putnins P2")
-PROJ_HEAD(putp3, "Putnins P3")
-PROJ_HEAD(putp3p, "Putnins P3'")
-PROJ_HEAD(putp4p, "Putnins P4'")
-PROJ_HEAD(putp5, "Putnins P5")
-PROJ_HEAD(putp5p, "Putnins P5'")
-PROJ_HEAD(putp6, "Putnins P6")
-PROJ_HEAD(putp6p, "Putnins P6'")
-PROJ_HEAD(qua_aut, "Quartic Authalic")
-PROJ_HEAD(robin, "Robinson")
-PROJ_HEAD(rouss, "Roussilhe Stereographic")
-PROJ_HEAD(rpoly, "Rectangular Polyconic")
-PROJ_HEAD(sinu, "Sinusoidal (Sanson-Flamsteed)")
-PROJ_HEAD(somerc, "Swiss. Obl. Mercator")
-PROJ_HEAD(stere, "Stereographic")
-PROJ_HEAD(sterea, "Oblique Stereographic Alternative")
-PROJ_HEAD(gstmerc, "Gauss-Schreiber Transverse Mercator (aka Gauss-Laborde Reunion)")
-PROJ_HEAD(tcc, "Transverse Central Cylindrical")
-PROJ_HEAD(tcea, "Transverse Cylindrical Equal Area")
-PROJ_HEAD(tissot, "Tissot Conic")
-PROJ_HEAD(tmerc, "Transverse Mercator")
-PROJ_HEAD(tpeqd, "Two Point Equidistant")
-PROJ_HEAD(tpers, "Tilted perspective")
-PROJ_HEAD(ups, "Universal Polar Stereographic")
-PROJ_HEAD(urm5, "Urmaev V")
-PROJ_HEAD(urmfps, "Urmaev Flat-Polar Sinusoidal")
-PROJ_HEAD(utm, "Universal Transverse Mercator (UTM)")
-PROJ_HEAD(vandg, "van der Grinten (I)")
-PROJ_HEAD(vandg2, "van der Grinten II")
-PROJ_HEAD(vandg3, "van der Grinten III")
-PROJ_HEAD(vandg4, "van der Grinten IV")
-PROJ_HEAD(vitk1, "Vitkovsky I")
-PROJ_HEAD(wag1, "Wagner I (Kavraisky VI)")
-PROJ_HEAD(wag2, "Wagner II")
-PROJ_HEAD(wag3, "Wagner III")
-PROJ_HEAD(wag4, "Wagner IV")
-PROJ_HEAD(wag5, "Wagner V")
-PROJ_HEAD(wag6, "Wagner VI")
-PROJ_HEAD(wag7, "Wagner VII")
-PROJ_HEAD(weren, "Werenskiold I")
-PROJ_HEAD(wink1, "Winkel I")
-PROJ_HEAD(wink2, "Winkel II")
-PROJ_HEAD(wintri, "Winkel Tripel")
diff --git a/src/proj/pj_log.c b/src/proj/pj_log.c
deleted file mode 100644
index cb761fd..0000000
--- a/src/proj/pj_log.c
+++ /dev/null
@@ -1,73 +0,0 @@
-/******************************************************************************
- * $Id: pj_log.c 1997 2012-10-29 19:17:41Z caress $
- *
- * Project:  PROJ.4
- * Purpose:  Implementation of pj_log() function.
- * Author:   Frank Warmerdam, warmerdam at pobox.com
- *
- ******************************************************************************
- * Copyright (c) 2010, Frank Warmerdam
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *****************************************************************************/
-
-#include <projects.h>
-#include <string.h>
-#include <stdarg.h>
-
-PJ_CVSID("$Id: pj_log.c 1997 2012-10-29 19:17:41Z caress $");
-
-/************************************************************************/
-/*                          pj_stderr_logger()                          */
-/************************************************************************/
-
-void pj_stderr_logger( void *app_data, int level, const char *msg )
-
-{
-    fprintf( stderr, "%s\n", msg );
-}
-
-/************************************************************************/
-/*                               pj_log()                               */
-/************************************************************************/
-
-void pj_log( projCtx ctx, int level, const char *fmt, ... )
-
-{
-    va_list args;
-    char *msg_buf;
-
-    if( level > ctx->debug_level )
-        return;
-
-    msg_buf = (char *) malloc(100000);
-    if( msg_buf == NULL )
-        return;
-
-    va_start( args, fmt );
-
-    /* we should use vsnprintf where available once we add configure detect.*/
-    vsprintf( msg_buf, fmt, args );
-
-    va_end( args );
-
-    ctx->logger( ctx->app_data, level, msg_buf );
-    
-    free( msg_buf );
-}
diff --git a/src/proj/pj_malloc.c b/src/proj/pj_malloc.c
deleted file mode 100644
index 80443a2..0000000
--- a/src/proj/pj_malloc.c
+++ /dev/null
@@ -1,27 +0,0 @@
-/* allocate and deallocate memory */
-/* These routines are used so that applications can readily replace
-** projection system memory allocation/deallocation call with custom
-** application procedures.  */
-#include <projects.h>
-#include <errno.h>
-
-	void *
-pj_malloc(size_t size) {
-/*
-/ Currently, pj_malloc is a hack to solve an errno problem.
-/ The problem is described in more details at 
-/ https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=86420. 
-/ It seems, that pj_init and similar functions incorrectly 
-/ (under debian/glibs-2.3.2) assume that pj_malloc resets 
-/ errno after success. pj_malloc tries to mimic this.
-*/
-        int old_errno = errno;
-        void *res = malloc(size);       
-        if ( res && !old_errno )
-                errno = 0;        	 
-        return res;
-}
-	void
-pj_dalloc(void *ptr) {
-	free(ptr);
-}
diff --git a/src/proj/pj_mlfn.c b/src/proj/pj_mlfn.c
deleted file mode 100644
index aeab611..0000000
--- a/src/proj/pj_mlfn.c
+++ /dev/null
@@ -1,57 +0,0 @@
-#include <projects.h>
-/* meridinal distance for ellipsoid and inverse
-**	8th degree - accurate to < 1e-5 meters when used in conjuction
-**		with typical major axis values.
-**	Inverse determines phi to EPS (1e-11) radians, about 1e-6 seconds.
-*/
-#define C00 1.
-#define C02 .25
-#define C04 .046875
-#define C06 .01953125
-#define C08 .01068115234375
-#define C22 .75
-#define C44 .46875
-#define C46 .01302083333333333333
-#define C48 .00712076822916666666
-#define C66 .36458333333333333333
-#define C68 .00569661458333333333
-#define C88 .3076171875
-#define EPS 1e-11
-#define MAX_ITER 10
-#define EN_SIZE 5
-	double *
-pj_enfn(double es) {
-	double t, *en;
-
-	if ((en = (double *)pj_malloc(EN_SIZE * sizeof(double))) != NULL) {
-		en[0] = C00 - es * (C02 + es * (C04 + es * (C06 + es * C08)));
-		en[1] = es * (C22 - es * (C04 + es * (C06 + es * C08)));
-		en[2] = (t = es * es) * (C44 - es * (C46 + es * C48));
-		en[3] = (t *= es) * (C66 - es * C68);
-		en[4] = t * es * C88;
-	} /* else return NULL if unable to allocate memory */
-	return en;
-}
-	double
-pj_mlfn(double phi, double sphi, double cphi, double *en) {
-	cphi *= sphi;
-	sphi *= sphi;
-	return(en[0] * phi - cphi * (en[1] + sphi*(en[2]
-		+ sphi*(en[3] + sphi*en[4]))));
-}
-	double
-pj_inv_mlfn(projCtx ctx, double arg, double es, double *en) {
-	double s, t, phi, k = 1./(1.-es);
-	int i;
-
-	phi = arg;
-	for (i = MAX_ITER; i ; --i) { /* rarely goes over 2 iterations */
-		s = sin(phi);
-		t = 1. - es * s * s;
-		phi -= t = (pj_mlfn(phi, s, cos(phi), en) - arg) * (t * sqrt(t)) * k;
-		if (fabs(t) < EPS)
-			return phi;
-	}
-	pj_ctx_set_errno( ctx, -17 );
-	return phi;
-}
diff --git a/src/proj/pj_msfn.c b/src/proj/pj_msfn.c
deleted file mode 100644
index 5b49f41..0000000
--- a/src/proj/pj_msfn.c
+++ /dev/null
@@ -1,7 +0,0 @@
-/* determine constant small m */
-#include <math.h>
-#include <projects.h>
-	double
-pj_msfn(double sinphi, double cosphi, double es) {
-	return (cosphi / sqrt (1. - es * sinphi * sinphi));
-}
diff --git a/src/proj/pj_mutex.c b/src/proj/pj_mutex.c
deleted file mode 100644
index a2f0590..0000000
--- a/src/proj/pj_mutex.c
+++ /dev/null
@@ -1,196 +0,0 @@
-/******************************************************************************
- * $Id: pj_mutex.c 1950 2012-05-10 16:51:51Z caress $
- *
- * Project:  PROJ.4
- * Purpose:  Mutex (thread lock) functions.
- * Author:   Frank Warmerdam, warmerdam at pobox.com
- *
- ******************************************************************************
- * Copyright (c) 2009, Frank Warmerdam
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *****************************************************************************/
-
-
-/* projects.h and windows.h conflict - avoid this! */
-
-#ifndef _WIN32
-#include <projects.h>
-PJ_CVSID("$Id: pj_mutex.c 1950 2012-05-10 16:51:51Z caress $");
-#else
-#include <proj_api.h>
-#endif
-
-/* on win32 we always use win32 mutexes, even if pthreads are available */
-#if defined(_WIN32) && !defined(MUTEX_stub)
-#  define MUTEX_win32
-#  undef  MUTEX_pthread
-#endif
-
-#if !defined(MUTEX_stub) && !defined(MUTEX_pthread) && !defined(MUTEX_win32)
-#  define MUTEX_stub
-#endif
-
-static void pj_init_lock();
-
-/************************************************************************/
-/* ==================================================================== */
-/*                      stub mutex implementation                       */
-/* ==================================================================== */
-/************************************************************************/
-
-#ifdef MUTEX_stub
-
-/************************************************************************/
-/*                            pj_acquire_lock()                         */
-/*                                                                      */
-/*      Acquire the PROJ.4 lock.                                        */
-/************************************************************************/
-
-void pj_acquire_lock()
-{
-}
-
-/************************************************************************/
-/*                            pj_release_lock()                         */
-/*                                                                      */
-/*      Release the PROJ.4 lock.                                        */
-/************************************************************************/
-
-void pj_release_lock()
-{
-}
-
-/************************************************************************/
-/*                          pj_cleanup_lock()                           */
-/************************************************************************/
-void pj_cleanup_lock()
-{
-}
-
-#endif // def MUTEX_stub
-
-/************************************************************************/
-/* ==================================================================== */
-/*                    pthread mutex implementation                      */
-/* ==================================================================== */
-/************************************************************************/
-
-#ifdef MUTEX_pthread
-
-#include "pthread.h"
-
-static pthread_mutex_t pj_core_lock = PTHREAD_MUTEX_INITIALIZER;
-
-/************************************************************************/
-/*                          pj_acquire_lock()                           */
-/*                                                                      */
-/*      Acquire the PROJ.4 lock.                                        */
-/************************************************************************/
-
-void pj_acquire_lock()
-{
-    pthread_mutex_lock( &pj_core_lock);
-}
-
-/************************************************************************/
-/*                          pj_release_lock()                           */
-/*                                                                      */
-/*      Release the PROJ.4 lock.                                        */
-/************************************************************************/
-
-void pj_release_lock()
-{
-    pthread_mutex_unlock( &pj_core_lock );
-}
-
-/************************************************************************/
-/*                          pj_cleanup_lock()                           */
-/************************************************************************/
-void pj_cleanup_lock()
-{
-}
-
-#endif // def MUTEX_pthread
-
-/************************************************************************/
-/* ==================================================================== */
-/*                      win32 mutex implementation                      */
-/* ==================================================================== */
-/************************************************************************/
-
-#ifdef MUTEX_win32
-
-#include <windows.h>
-
-static HANDLE mutex_lock = NULL;
-
-/************************************************************************/
-/*                          pj_acquire_lock()                           */
-/*                                                                      */
-/*      Acquire the PROJ.4 lock.                                        */
-/************************************************************************/
-
-void pj_acquire_lock()
-{
-    if( mutex_lock == NULL )
-        pj_init_lock();
-
-    WaitForSingleObject( mutex_lock, INFINITE );
-}
-
-/************************************************************************/
-/*                          pj_release_lock()                           */
-/*                                                                      */
-/*      Release the PROJ.4 lock.                                        */
-/************************************************************************/
-
-void pj_release_lock()
-{
-    if( mutex_lock == NULL )
-        pj_init_lock();
-    else
-        ReleaseMutex( mutex_lock );
-}
-
-/************************************************************************/
-/*                          pj_cleanup_lock()                           */
-/************************************************************************/
-void pj_cleanup_lock()
-{
-    if( mutex_lock != NULL )
-    {
-        CloseHandle( mutex_lock );
-        mutex_lock = NULL;
-    }
-}
-
-/************************************************************************/
-/*                            pj_init_lock()                            */
-/************************************************************************/
-
-static void pj_init_lock()
-
-{
-    if( mutex_lock == NULL )
-        mutex_lock = CreateMutex( NULL, FALSE, NULL );
-}
-
-#endif // def MUTEX_win32
-
diff --git a/src/proj/pj_open_lib.c b/src/proj/pj_open_lib.c
deleted file mode 100644
index b4c88d1..0000000
--- a/src/proj/pj_open_lib.c
+++ /dev/null
@@ -1,176 +0,0 @@
-/******************************************************************************
- * $Id: pj_open_lib.c 1950 2012-05-10 16:51:51Z caress $
- *
- * Project:  PROJ.4
- * Purpose:  Implementation of pj_open_lib(), and pj_set_finder().  These
- *           provide a standard interface for opening projections support
- *           data files.
- * Author:   Gerald Evenden, Frank Warmerdam <warmerdam at pobox.com>
- *
- ******************************************************************************
- * Copyright (c) 1995, Gerald Evenden
- * Copyright (c) 2002, Frank Warmerdam <warmerdam at pobox.com>
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *****************************************************************************/
-
-#define PJ_LIB__
-#include <projects.h>
-#include <stdio.h>
-#include <string.h>
-#include <errno.h>
-
-PJ_CVSID("$Id: pj_open_lib.c 1950 2012-05-10 16:51:51Z caress $");
-
-static const char *(*pj_finder)(const char *) = NULL;
-static int path_count = 0;
-static char **search_path = NULL;
-static char * proj_lib_name =
-#ifdef PROJ_LIB
-PROJ_LIB;
-#else
-0;
-#endif
-
-/************************************************************************/
-/*                           pj_set_finder()                            */
-/************************************************************************/
-
-void pj_set_finder( const char *(*new_finder)(const char *) )
-
-{
-    pj_finder = new_finder;
-}
-
-/************************************************************************/
-/*                         pj_set_searchpath()                          */
-/*                                                                      */
-/*      Path control for callers that can't practically provide         */
-/*      pj_set_finder() style callbacks.  Call with (0,NULL) as args    */
-/*      to clear the searchpath set.                                    */
-/************************************************************************/
-
-void pj_set_searchpath ( int count, const char **path )
-{
-    int i;
-
-    if (path_count > 0 && search_path != NULL)
-    {
-        for (i = 0; i < path_count; i++)
-        {
-            pj_dalloc(search_path[i]);
-        }
-        pj_dalloc(search_path);
-        path_count = 0;
-        search_path = NULL;
-    }
-
-    if( count > 0 )
-    {
-        search_path = pj_malloc(sizeof *search_path * count);
-        for (i = 0; i < count; i++)
-        {
-            search_path[i] = pj_malloc(strlen(path[i]) + 1);
-            strcpy(search_path[i], path[i]);
-        }
-    }
-        
-    path_count = count;
-}
-
-/************************************************************************/
-/*                            pj_open_lib()                             */
-/************************************************************************/
-
-FILE *
-pj_open_lib(projCtx ctx, char *name, char *mode) {
-    char fname[MAX_PATH_FILENAME+1];
-    const char *sysname;
-    FILE *fid;
-    int n = 0;
-    int i;
-#ifdef WIN32
-    static const char dir_chars[] = "/\\";
-#else
-    static const char dir_chars[] = "/";
-#endif
-
-#ifndef _WIN32_WCE
-
-    /* check if ~/name */
-    if (*name == '~' && strchr(dir_chars,name[1]) )
-        if ((sysname = getenv("HOME")) != NULL) {
-            (void)strcpy(fname, sysname);
-            fname[n = strlen(fname)] = DIR_CHAR;
-            fname[++n] = '\0';
-            (void)strcpy(fname+n, name + 1);
-            sysname = fname;
-        } else
-            return NULL;
-
-    /* or fixed path: /name, ./name or ../name */
-    else if (strchr(dir_chars,*name)
-             || (*name == '.' && strchr(dir_chars,name[1])) 
-             || (!strncmp(name, "..", 2) && strchr(dir_chars,name[2]))
-             || (name[1] == ':' && strchr(dir_chars,name[2])) )
-        sysname = name;
-
-    /* or try to use application provided file finder */
-    else if( pj_finder != NULL && pj_finder( name ) != NULL )
-        sysname = pj_finder( name );
-
-    /* or is environment PROJ_LIB defined */
-    else if ((sysname = getenv("PROJ_LIB")) || (sysname = proj_lib_name)) {
-        (void)strcpy(fname, sysname);
-        fname[n = strlen(fname)] = DIR_CHAR;
-        fname[++n] = '\0';
-        (void)strcpy(fname+n, name);
-        sysname = fname;
-    } else /* just try it bare bones */
-        sysname = name;
-
-    if ((fid = fopen(sysname, mode)) != NULL)
-        errno = 0;
-
-    /* If none of those work and we have a search path, try it */
-    if (!fid && path_count > 0)
-    {
-        for (i = 0; fid == NULL && i < path_count; i++)
-        {
-            sprintf(fname, "%s%c%s", search_path[i], DIR_CHAR, name);
-            sysname = fname;
-            fid = fopen (sysname, mode);
-        }
-        if (fid)
-            errno = 0;
-    }
-
-    if( ctx->last_errno == 0 && errno != 0 )
-        pj_ctx_set_errno( ctx, errno );
-
-    pj_log( ctx, PJ_LOG_DEBUG_MAJOR, 
-            "pj_open_lib(%s): call fopen(%s) - %s\n",
-            name, sysname,
-            fid == NULL ? "failed" : "succeeded" );
-
-    return(fid);
-#else
-    return NULL;
-#endif /* _WIN32_WCE */
-}
diff --git a/src/proj/pj_param.c b/src/proj/pj_param.c
deleted file mode 100644
index 119006e..0000000
--- a/src/proj/pj_param.c
+++ /dev/null
@@ -1,108 +0,0 @@
-/* put parameters in linked list and retrieve */
-#include <projects.h>
-#include <stdio.h>
-#include <string.h>
-	paralist * /* create parameter list entry */
-pj_mkparam(char *str) {
-	paralist *newitem;
-
-	if((newitem = (paralist *)pj_malloc(sizeof(paralist) + strlen(str))) != NULL) {
-		newitem->used = 0;
-		newitem->next = 0;
-		if (*str == '+')
-			++str;
-		(void)strcpy(newitem->param, str);
-	}
-	return newitem;
-}
-
-/************************************************************************/
-/*                              pj_param()                              */
-/*                                                                      */
-/*      Test for presence or get parameter value.  The first            */
-/*      character in `opt' is a parameter type which can take the       */
-/*      values:                                                         */
-/*                                                                      */
-/*       `t' - test for presence, return TRUE/FALSE in PVALUE.i         */
-/*       `i' - integer value returned in PVALUE.i                       */
-/*       `d' - simple valued real input returned in PVALUE.f            */
-/*       `r' - degrees (DMS translation applied), returned as           */
-/*             radians in PVALUE.f                                      */
-/*       `s' - string returned in PVALUE.s                              */
-/*       `b' - test for t/T/f/F, return in PVALUE.i                     */
-/*                                                                      */
-/************************************************************************/
-
-	PVALUE /* test for presence or get parameter value */
-pj_param(projCtx ctx, paralist *pl, const char *opt) {
-
-	int type;
-	unsigned l;
-	PVALUE value;
-
-	if( ctx == NULL )
-		ctx = pj_get_default_ctx();
-
-	type = *opt++;
-	/* simple linear lookup */
-	l = strlen(opt);
-	while (pl && !(!strncmp(pl->param, opt, l) &&
-	  (!pl->param[l] || pl->param[l] == '=')))
-		pl = pl->next;
-	if (type == 't')
-		value.i = pl != 0;
-	else if (pl) {
-		pl->used |= 1;
-		opt = pl->param + l;
-		if (*opt == '=')
-			++opt;
-		switch (type) {
-		case 'i':	/* integer input */
-			value.i = atoi(opt);
-			break;
-		case 'd':	/* simple real input */
-			value.f = atof(opt);
-			break;
-		case 'r':	/* degrees input */
-			value.f = dmstor_ctx(ctx, opt, 0);
-			break;
-		case 's':	/* char string */
-                        value.s = (char *) opt;
-			break;
-		case 'b':	/* boolean */
-			switch (*opt) {
-			case 'F': case 'f':
-				value.i = 0;
-				break;
-			case '\0': case 'T': case 't':
-				value.i = 1;
-				break;
-			default:
-				pj_ctx_set_errno(ctx, -8);
-				value.i = 0;
-				break;
-			}
-			break;
-		default:
-bum_type:	/* note: this is an error in parameter, not a user error */
-			fprintf(stderr, "invalid request to pj_param, fatal\n");
-			exit(1);
-		}
-	} else /* not given */
-		switch (type) {
-		case 'b':
-		case 'i':
-			value.i = 0;
-			break;
-		case 'd':
-		case 'r':
-			value.f = 0.;
-			break;
-		case 's':
-			value.s = 0;
-			break;
-		default:
-			goto bum_type;
-		}
-	return value;
-}
diff --git a/src/proj/pj_phi2.c b/src/proj/pj_phi2.c
deleted file mode 100644
index 5c81da4..0000000
--- a/src/proj/pj_phi2.c
+++ /dev/null
@@ -1,25 +0,0 @@
-/* determine latitude angle phi-2 */
-#include <projects.h>
-
-#define HALFPI		1.5707963267948966
-#define TOL 1.0e-10
-#define N_ITER 15
-
-	double
-pj_phi2(projCtx ctx, double ts, double e) {
-	double eccnth, Phi, con, dphi;
-	int i;
-
-	eccnth = .5 * e;
-	Phi = HALFPI - 2. * atan (ts);
-	i = N_ITER;
-	do {
-		con = e * sin (Phi);
-		dphi = HALFPI - 2. * atan (ts * pow((1. - con) /
-		   (1. + con), eccnth)) - Phi;
-		Phi += dphi;
-	} while ( fabs(dphi) > TOL && --i);
-	if (i <= 0)
-		pj_ctx_set_errno( ctx, -18 );
-	return Phi;
-}
diff --git a/src/proj/pj_pr_list.c b/src/proj/pj_pr_list.c
deleted file mode 100644
index e14b20d..0000000
--- a/src/proj/pj_pr_list.c
+++ /dev/null
@@ -1,91 +0,0 @@
-/* print projection's list of parameters */
-#include <projects.h>
-#include <stdio.h>
-#include <string.h>
-#define LINE_LEN 72
-	static int
-pr_list(PJ *P, int not_used) {
-	paralist *t;
-	int l, n = 1, flag = 0;
-
-	(void)putchar('#');
-	for (t = P->params; t; t = t->next)
-		if ((!not_used && t->used) || (not_used && !t->used)) {
-			l = strlen(t->param) + 1;
-			if (n + l > LINE_LEN) {
-				(void)fputs("\n#", stdout);
-				n = 2;
-			}
-			(void)putchar(' ');
-			if (*(t->param) != '+')
-				(void)putchar('+');
-			(void)fputs(t->param, stdout);
-			n += l;
-		} else
-			flag = 1;
-	if (n > 1)
-		(void)putchar('\n');
-	return flag;
-}
-	void /* print link list of projection parameters */
-pj_pr_list(PJ *P) {
-	char const *s;
-
-	(void)putchar('#');
-	for (s = P->descr; *s ; ++s) {
-		(void)putchar(*s);
-		if (*s == '\n')
-			(void)putchar('#');
-	}
-	(void)putchar('\n');
-	if (pr_list(P, 0)) {
-		(void)fputs("#--- following specified but NOT used\n", stdout);
-		(void)pr_list(P, 1);
-	}
-}
-
-/************************************************************************/
-/*                             pj_get_def()                             */
-/*                                                                      */
-/*      Returns the PROJ.4 command string that would produce this       */
-/*      definition expanded as much as possible.  For instance,         */
-/*      +init= calls and +datum= definitions would be expanded.         */
-/************************************************************************/
-
-char *pj_get_def( PJ *P, int options )
-
-{
-    paralist *t;
-    int l;
-    char *definition;
-    int  def_max = 10;
-
-    definition = (char *) pj_malloc(def_max);
-    definition[0] = '\0';
-
-    for (t = P->params; t; t = t->next)
-    {
-        /* skip unused parameters ... mostly appended defaults and stuff */
-        if (!t->used)
-            continue;
-
-        /* grow the resulting string if needed */
-        l = strlen(t->param) + 1;
-        if( strlen(definition) + l + 5 > def_max )
-        {
-            char *def2;
-
-            def_max = def_max * 2 + l + 5;
-            def2 = (char *) pj_malloc(def_max);
-            strcpy( def2, definition );
-            pj_dalloc( definition );
-            definition = def2;
-        }
-
-        /* append this parameter */
-        strcat( definition, " +" );
-        strcat( definition, t->param );
-    }
-
-    return definition;
-}
diff --git a/src/proj/pj_qsfn.c b/src/proj/pj_qsfn.c
deleted file mode 100644
index ccb1230..0000000
--- a/src/proj/pj_qsfn.c
+++ /dev/null
@@ -1,16 +0,0 @@
-/* determine small q */
-#include <math.h>
-#include <projects.h>
-
-# define EPSILON 1.0e-7
-	double
-pj_qsfn(double sinphi, double e, double one_es) {
-	double con;
-
-	if (e >= EPSILON) {
-		con = e * sinphi;
-		return (one_es * (sinphi / (1. - con * con) -
-		   (.5 / e) * log ((1. - con) / (1. + con))));
-	} else
-		return (sinphi + sinphi);
-}
diff --git a/src/proj/pj_release.c b/src/proj/pj_release.c
deleted file mode 100644
index 1b6e54a..0000000
--- a/src/proj/pj_release.c
+++ /dev/null
@@ -1,11 +0,0 @@
-/* <<< Release Notice for library >>> */
-
-#include <projects.h>
-
-char const pj_release[]="Rel. 4.8.0, 6 March 2012";
-
-const char *pj_get_release()
-
-{
-    return pj_release;
-}
diff --git a/src/proj/pj_strerrno.c b/src/proj/pj_strerrno.c
deleted file mode 100644
index 9d23703..0000000
--- a/src/proj/pj_strerrno.c
+++ /dev/null
@@ -1,85 +0,0 @@
-/* list of projection system pj_errno values */
-#include "projects.h"
-#include <stdio.h>
-#include <errno.h>
-#include <string.h>
-
-	static char *
-pj_err_list[] = {
-	"no arguments in initialization list",	/*  -1 */
-	"no options found in 'init' file",		/*  -2 */
-	"no colon in init= string",			/*  -3 */
-	"projection not named",				/*  -4 */
-	"unknown projection id",			/*  -5 */
-	"effective eccentricity = 1.",			/*  -6 */
-	"unknown unit conversion id",			/*  -7 */
-	"invalid boolean param argument",		/*  -8 */
-	"unknown elliptical parameter name",	        /*  -9 */
-	"reciprocal flattening (1/f) = 0",		/* -10 */
-	"|radius reference latitude| > 90",		/* -11 */
-	"squared eccentricity < 0",			/* -12 */
-	"major axis or radius = 0 or not given",	/* -13 */
-	"latitude or longitude exceeded limits",	/* -14 */
-	"invalid x or y",				/* -15 */
-	"improperly formed DMS value",			/* -16 */
-	"non-convergent inverse meridional dist",	/* -17 */
-	"non-convergent inverse phi2",			/* -18 */
-	"acos/asin: |arg| >1.+1e-14",			/* -19 */
-	"tolerance condition error",			/* -20 */
-	"conic lat_1 = -lat_2",				/* -21 */
-	"lat_1 >= 90",					/* -22 */
-	"lat_1 = 0",					/* -23 */
-	"lat_ts >= 90",					/* -24 */
-	"no distance between control points",		/* -25 */
-	"projection not selected to be rotated",	/* -26 */
-	"W <= 0 or M <= 0",				/* -27 */
-	"lsat not in 1-5 range",			/* -28 */
-	"path not in range",				/* -29 */
-	"h <= 0",					/* -30 */
-	"k <= 0",					/* -31 */
-	"lat_0 = 0 or 90 or alpha = 90",		/* -32 */
-	"lat_1=lat_2 or lat_1=0 or lat_2=90",		/* -33 */
-	"elliptical usage required",			/* -34 */
-	"invalid UTM zone number",			/* -35 */
-	"arg(s) out of range for Tcheby eval",		/* -36 */
-	"failed to find projection to be rotated",	/* -37 */
-	"failed to load datum shift file",  	        /* -38 */
-	"both n & m must be spec'd and > 0",		/* -39 */
-	"n <= 0, n > 1 or not specified",		/* -40 */
-	"lat_1 or lat_2 not specified",			/* -41 */
-	"|lat_1| == |lat_2|",				/* -42 */
-	"lat_0 is pi/2 from mean lat",			/* -43 */
-	"unparseable coordinate system definition",	/* -44 */
-	"geocentric transformation missing z or ellps",	/* -45 */
-	"unknown prime meridian conversion id",		/* -46 */
-	"illegal axis orientation combination",		/* -47 */
-	"point not within available datum shift grids", /* -48 */
-	"invalid sweep axis, choose x or y",            /* -49 */
-};
-	char *
-pj_strerrno(int err) 
-{
-    static char note[50];
-
-    if (err > 0)
-#ifdef HAVE_STRERROR
-        return strerror(err);
-#else
-    {   
-        sprintf(note,"no system list, errno: %d\n", err);
-        return note;
-    }
-#endif
-    else if (err < 0) {
-        int adjusted_err = - err - 1;
-        if (adjusted_err < (sizeof(pj_err_list) / sizeof(char *)))
-            return(pj_err_list[adjusted_err]);
-        else
-        {
-            sprintf( note, "invalid projection system error (%d)",
-                     err );
-            return note;
-        }
-    } else
-        return NULL;
-}
diff --git a/src/proj/pj_transform.c b/src/proj/pj_transform.c
deleted file mode 100644
index c39358d..0000000
--- a/src/proj/pj_transform.c
+++ /dev/null
@@ -1,826 +0,0 @@
-/******************************************************************************
- * $Id: pj_transform.c 1950 2012-05-10 16:51:51Z caress $
- *
- * Project:  PROJ.4
- * Purpose:  Perform overall coordinate system to coordinate system 
- *           transformations (pj_transform() function) including reprojection
- *           and datum shifting.
- * Author:   Frank Warmerdam, warmerdam at pobox.com
- *
- ******************************************************************************
- * Copyright (c) 2000, Frank Warmerdam
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *****************************************************************************/
-
-#include <projects.h>
-#include <string.h>
-#include <math.h>
-#include "geocent.h"
-
-PJ_CVSID("$Id: pj_transform.c 1950 2012-05-10 16:51:51Z caress $");
-
-static int pj_adjust_axis( projCtx ctx, const char *axis, int denormalize_flag,
-                           long point_count, int point_offset, 
-                           double *x, double *y, double *z );
-
-#ifndef SRS_WGS84_SEMIMAJOR
-#define SRS_WGS84_SEMIMAJOR 6378137.0
-#endif
-
-#ifndef SRS_WGS84_ESQUARED
-#define SRS_WGS84_ESQUARED 0.0066943799901413165
-#endif
-
-#define Dx_BF (defn->datum_params[0])
-#define Dy_BF (defn->datum_params[1])
-#define Dz_BF (defn->datum_params[2])
-#define Rx_BF (defn->datum_params[3])
-#define Ry_BF (defn->datum_params[4])
-#define Rz_BF (defn->datum_params[5])
-#define M_BF  (defn->datum_params[6])
-
-/* 
-** This table is intended to indicate for any given error code in 
-** the range 0 to -44, whether that error will occur for all locations (ie.
-** it is a problem with the coordinate system as a whole) in which case the
-** value would be 0, or if the problem is with the point being transformed
-** in which case the value is 1. 
-**
-** At some point we might want to move this array in with the error message
-** list or something, but while experimenting with it this should be fine. 
-*/
-
-static const int transient_error[50] = {
-    /*             0  1  2  3  4  5  6  7  8  9   */
-    /* 0 to 9 */   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    /* 10 to 19 */ 0, 0, 0, 0, 1, 1, 0, 1, 1, 1,  
-    /* 20 to 29 */ 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 
-    /* 30 to 39 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    /* 40 to 49 */ 0, 0, 0, 0, 0, 0, 0, 0, 1, 0 };
-
-/************************************************************************/
-/*                            pj_transform()                            */
-/*                                                                      */
-/*      Currently this function doesn't recognise if two projections    */
-/*      are identical (to short circuit reprojection) because it is     */
-/*      difficult to compare PJ structures (since there are some        */
-/*      projection specific components).                                */
-/************************************************************************/
-
-int pj_transform( PJ *srcdefn, PJ *dstdefn, long point_count, int point_offset,
-                  double *x, double *y, double *z )
-
-{
-    long      i;
-    int       err;
-
-    srcdefn->ctx->last_errno = 0;
-    dstdefn->ctx->last_errno = 0;
-
-    if( point_offset == 0 )
-        point_offset = 1;
-
-/* -------------------------------------------------------------------- */
-/*      Transform unusual input coordinate axis orientation to          */
-/*      standard form if needed.                                        */
-/* -------------------------------------------------------------------- */
-    if( strcmp(srcdefn->axis,"enu") != 0 )
-    {
-        int err;
-
-        err = pj_adjust_axis( srcdefn->ctx, srcdefn->axis, 
-                              0, point_count, point_offset, x, y, z );
-        if( err != 0 )
-            return err;
-    }
-
-/* -------------------------------------------------------------------- */
-/*      Transform Z to meters if it isn't already.                      */
-/* -------------------------------------------------------------------- */
-    if( srcdefn->vto_meter != 1.0 && z != NULL )
-    {
-        for( i = 0; i < point_count; i++ )
-            z[point_offset*i] *= srcdefn->vto_meter;
-    }
-
-/* -------------------------------------------------------------------- */
-/*      Transform geocentric source coordinates to lat/long.            */
-/* -------------------------------------------------------------------- */
-    if( srcdefn->is_geocent )
-    {
-        if( z == NULL )
-        {
-            pj_ctx_set_errno( pj_get_ctx(srcdefn), PJD_ERR_GEOCENTRIC);
-            return PJD_ERR_GEOCENTRIC;
-        }
-
-        if( srcdefn->to_meter != 1.0 )
-        {
-            for( i = 0; i < point_count; i++ )
-            {
-                if( x[point_offset*i] != HUGE_VAL )
-                {
-                    x[point_offset*i] *= srcdefn->to_meter;
-                    y[point_offset*i] *= srcdefn->to_meter;
-                }
-            }
-        }
-
-        err = pj_geocentric_to_geodetic( srcdefn->a_orig, srcdefn->es_orig,
-                                         point_count, point_offset, 
-                                         x, y, z );
-        if( err != 0 )
-            return err;
-    }
-
-/* -------------------------------------------------------------------- */
-/*      Transform source points to lat/long, if they aren't             */
-/*      already.                                                        */
-/* -------------------------------------------------------------------- */
-    else if( !srcdefn->is_latlong )
-    {
-        if( srcdefn->inv == NULL )
-        {
-            pj_ctx_set_errno( pj_get_ctx(srcdefn), -17 );
-            pj_log( pj_get_ctx(srcdefn), PJ_LOG_ERROR, 
-                    "pj_transform(): source projection not invertable" );
-            return -17;
-        }
-
-        for( i = 0; i < point_count; i++ )
-        {
-            XY         projected_loc;
-            LP	       geodetic_loc;
-
-            projected_loc.u = x[point_offset*i];
-            projected_loc.v = y[point_offset*i];
-
-            if( projected_loc.u == HUGE_VAL )
-                continue;
-
-            geodetic_loc = pj_inv( projected_loc, srcdefn );
-            if( srcdefn->ctx->last_errno != 0 )
-            {
-                if( (srcdefn->ctx->last_errno != 33 /*EDOM*/ 
-                     && srcdefn->ctx->last_errno != 34 /*ERANGE*/ )
-                    && (srcdefn->ctx->last_errno > 0 
-                        || srcdefn->ctx->last_errno < -44 || point_count == 1
-                        || transient_error[-srcdefn->ctx->last_errno] == 0 ) )
-                    return srcdefn->ctx->last_errno;
-                else
-                {
-                    geodetic_loc.u = HUGE_VAL;
-                    geodetic_loc.v = HUGE_VAL;
-                }
-            }
-
-            x[point_offset*i] = geodetic_loc.u;
-            y[point_offset*i] = geodetic_loc.v;
-        }
-    }
-/* -------------------------------------------------------------------- */
-/*      But if they are already lat long, adjust for the prime          */
-/*      meridian if there is one in effect.                             */
-/* -------------------------------------------------------------------- */
-    if( srcdefn->from_greenwich != 0.0 )
-    {
-        for( i = 0; i < point_count; i++ )
-        {
-            if( x[point_offset*i] != HUGE_VAL )
-                x[point_offset*i] += srcdefn->from_greenwich;
-        }
-    }
-
-/* -------------------------------------------------------------------- */
-/*      Do we need to translate from geoid to ellipsoidal vertical      */
-/*      datum?                                                          */
-/* -------------------------------------------------------------------- */
-    if( srcdefn->has_geoid_vgrids )
-    {
-        if( pj_apply_vgridshift( srcdefn, "sgeoidgrids", 
-                                 &(srcdefn->vgridlist_geoid), 
-                                 &(srcdefn->vgridlist_geoid_count),
-                                 0, point_count, point_offset, x, y, z ) != 0 )
-            return pj_ctx_get_errno(srcdefn->ctx);
-    }
-        
-/* -------------------------------------------------------------------- */
-/*      Convert datums if needed, and possible.                         */
-/* -------------------------------------------------------------------- */
-    if( pj_datum_transform( srcdefn, dstdefn, point_count, point_offset, 
-                            x, y, z ) != 0 )
-    {
-        if( srcdefn->ctx->last_errno != 0 )
-            return srcdefn->ctx->last_errno;
-        else
-            return dstdefn->ctx->last_errno;
-    }
-
-/* -------------------------------------------------------------------- */
-/*      Do we need to translate from geoid to ellipsoidal vertical      */
-/*      datum?                                                          */
-/* -------------------------------------------------------------------- */
-    if( dstdefn->has_geoid_vgrids )
-    {
-        if( pj_apply_vgridshift( dstdefn, "sgeoidgrids", 
-                                 &(dstdefn->vgridlist_geoid), 
-                                 &(dstdefn->vgridlist_geoid_count),
-                                 1, point_count, point_offset, x, y, z ) != 0 )
-            return dstdefn->ctx->last_errno;
-    }
-        
-/* -------------------------------------------------------------------- */
-/*      But if they are staying lat long, adjust for the prime          */
-/*      meridian if there is one in effect.                             */
-/* -------------------------------------------------------------------- */
-    if( dstdefn->from_greenwich != 0.0 )
-    {
-        for( i = 0; i < point_count; i++ )
-        {
-            if( x[point_offset*i] != HUGE_VAL )
-                x[point_offset*i] -= dstdefn->from_greenwich;
-        }
-    }
-
-
-/* -------------------------------------------------------------------- */
-/*      Transform destination latlong to geocentric if required.        */
-/* -------------------------------------------------------------------- */
-    if( dstdefn->is_geocent )
-    {
-        if( z == NULL )
-        {
-            pj_ctx_set_errno( dstdefn->ctx, PJD_ERR_GEOCENTRIC );
-            return PJD_ERR_GEOCENTRIC;
-        }
-
-        pj_geodetic_to_geocentric( dstdefn->a_orig, dstdefn->es_orig,
-                                   point_count, point_offset, x, y, z );
-
-        if( dstdefn->fr_meter != 1.0 )
-        {
-            for( i = 0; i < point_count; i++ )
-            {
-                if( x[point_offset*i] != HUGE_VAL )
-                {
-                    x[point_offset*i] *= dstdefn->fr_meter;
-                    y[point_offset*i] *= dstdefn->fr_meter;
-                }
-            }
-        }
-    }
-
-/* -------------------------------------------------------------------- */
-/*      Transform destination points to projection coordinates, if      */
-/*      desired.                                                        */
-/* -------------------------------------------------------------------- */
-    else if( !dstdefn->is_latlong )
-    {
-        for( i = 0; i < point_count; i++ )
-        {
-            XY         projected_loc;
-            LP	       geodetic_loc;
-
-            geodetic_loc.u = x[point_offset*i];
-            geodetic_loc.v = y[point_offset*i];
-
-            if( geodetic_loc.u == HUGE_VAL )
-                continue;
-
-            projected_loc = pj_fwd( geodetic_loc, dstdefn );
-            if( dstdefn->ctx->last_errno != 0 )
-            {
-                if( (dstdefn->ctx->last_errno != 33 /*EDOM*/ 
-                     && dstdefn->ctx->last_errno != 34 /*ERANGE*/ )
-                    && (dstdefn->ctx->last_errno > 0 
-                        || dstdefn->ctx->last_errno < -44 || point_count == 1
-                        || transient_error[-dstdefn->ctx->last_errno] == 0 ) )
-                    return dstdefn->ctx->last_errno;
-                else
-                {
-                    projected_loc.u = HUGE_VAL;
-                    projected_loc.v = HUGE_VAL;
-                }
-            }
-
-            x[point_offset*i] = projected_loc.u;
-            y[point_offset*i] = projected_loc.v;
-        }
-    }
-
-/* -------------------------------------------------------------------- */
-/*      If a wrapping center other than 0 is provided, rewrap around    */
-/*      the suggested center (for latlong coordinate systems only).     */
-/* -------------------------------------------------------------------- */
-    else if( dstdefn->is_latlong && dstdefn->is_long_wrap_set )
-    {
-        for( i = 0; i < point_count; i++ )
-        {
-            if( x[point_offset*i] == HUGE_VAL )
-                continue;
-
-            while( x[point_offset*i] < dstdefn->long_wrap_center - PI )
-                x[point_offset*i] += TWOPI;
-            while( x[point_offset*i] > dstdefn->long_wrap_center + PI )
-                x[point_offset*i] -= TWOPI;
-        }
-    }
-
-/* -------------------------------------------------------------------- */
-/*      Transform Z from meters if needed.                              */
-/* -------------------------------------------------------------------- */
-    if( dstdefn->vto_meter != 1.0 && z != NULL )
-    {
-        for( i = 0; i < point_count; i++ )
-            z[point_offset*i] *= dstdefn->vfr_meter;
-    }
-
-/* -------------------------------------------------------------------- */
-/*      Transform normalized axes into unusual output coordinate axis   */
-/*      orientation if needed.                                          */
-/* -------------------------------------------------------------------- */
-    if( strcmp(dstdefn->axis,"enu") != 0 )
-    {
-        int err;
-
-        err = pj_adjust_axis( dstdefn->ctx, dstdefn->axis, 
-                              1, point_count, point_offset, x, y, z );
-        if( err != 0 )
-            return err;
-    }
-
-    return 0;
-}
-
-/************************************************************************/
-/*                     pj_geodetic_to_geocentric()                      */
-/************************************************************************/
-
-int pj_geodetic_to_geocentric( double a, double es, 
-                               long point_count, int point_offset,
-                               double *x, double *y, double *z )
-
-{
-    double b;
-    int    i;
-    GeocentricInfo gi;
-    int ret_errno = 0;
-
-    if( es == 0.0 )
-        b = a;
-    else
-        b = a * sqrt(1-es);
-
-    if( pj_Set_Geocentric_Parameters( &gi, a, b ) != 0 )
-    {
-        return PJD_ERR_GEOCENTRIC;
-    }
-
-    for( i = 0; i < point_count; i++ )
-    {
-        long io = i * point_offset;
-
-        if( x[io] == HUGE_VAL  )
-            continue;
-
-        if( pj_Convert_Geodetic_To_Geocentric( &gi, y[io], x[io], z[io], 
-                                               x+io, y+io, z+io ) != 0 )
-        {
-            ret_errno = -14;
-            x[io] = y[io] = HUGE_VAL;
-            /* but keep processing points! */
-        }
-    }
-
-    return ret_errno;
-}
-
-/************************************************************************/
-/*                     pj_geodetic_to_geocentric()                      */
-/************************************************************************/
-
-int pj_geocentric_to_geodetic( double a, double es, 
-                               long point_count, int point_offset,
-                               double *x, double *y, double *z )
-
-{
-    double b;
-    int    i;
-    GeocentricInfo gi;
-
-    if( es == 0.0 )
-        b = a;
-    else
-        b = a * sqrt(1-es);
-
-    if( pj_Set_Geocentric_Parameters( &gi, a, b ) != 0 )
-    {
-        return PJD_ERR_GEOCENTRIC;
-    }
-
-    for( i = 0; i < point_count; i++ )
-    {
-        long io = i * point_offset;
-
-        if( x[io] == HUGE_VAL )
-            continue;
-
-        pj_Convert_Geocentric_To_Geodetic( &gi, x[io], y[io], z[io], 
-                                           y+io, x+io, z+io );
-    }
-
-    return 0;
-}
-
-/************************************************************************/
-/*                         pj_compare_datums()                          */
-/*                                                                      */
-/*      Returns TRUE if the two datums are identical, otherwise         */
-/*      FALSE.                                                          */
-/************************************************************************/
-
-int pj_compare_datums( PJ *srcdefn, PJ *dstdefn )
-
-{
-    if( srcdefn->datum_type != dstdefn->datum_type )
-    {
-        return 0;
-    }
-    else if( srcdefn->a_orig != dstdefn->a_orig 
-             || ABS(srcdefn->es_orig - dstdefn->es_orig) > 0.000000000050 )
-    {
-        /* the tolerence for es is to ensure that GRS80 and WGS84 are
-           considered identical */
-        return 0;
-    }
-    else if( srcdefn->datum_type == PJD_3PARAM )
-    {
-        return (srcdefn->datum_params[0] == dstdefn->datum_params[0]
-                && srcdefn->datum_params[1] == dstdefn->datum_params[1]
-                && srcdefn->datum_params[2] == dstdefn->datum_params[2]);
-    }
-    else if( srcdefn->datum_type == PJD_7PARAM )
-    {
-        return (srcdefn->datum_params[0] == dstdefn->datum_params[0]
-                && srcdefn->datum_params[1] == dstdefn->datum_params[1]
-                && srcdefn->datum_params[2] == dstdefn->datum_params[2]
-                && srcdefn->datum_params[3] == dstdefn->datum_params[3]
-                && srcdefn->datum_params[4] == dstdefn->datum_params[4]
-                && srcdefn->datum_params[5] == dstdefn->datum_params[5]
-                && srcdefn->datum_params[6] == dstdefn->datum_params[6]);
-    }
-    else if( srcdefn->datum_type == PJD_GRIDSHIFT )
-    {
-        return strcmp( pj_param(srcdefn->ctx, srcdefn->params,"snadgrids").s,
-                       pj_param(dstdefn->ctx, dstdefn->params,"snadgrids").s ) == 0;
-    }
-    else
-        return 1;
-}
-
-/************************************************************************/
-/*                       pj_geocentic_to_wgs84()                        */
-/************************************************************************/
-
-int pj_geocentric_to_wgs84( PJ *defn, 
-                            long point_count, int point_offset,
-                            double *x, double *y, double *z )
-
-{
-    int       i;
-
-    if( defn->datum_type == PJD_3PARAM )
-    {
-        for( i = 0; i < point_count; i++ )
-        {
-            long io = i * point_offset;
-            
-            if( x[io] == HUGE_VAL )
-                continue;
-
-            x[io] = x[io] + Dx_BF;
-            y[io] = y[io] + Dy_BF;
-            z[io] = z[io] + Dz_BF;
-        }
-    }
-    else if( defn->datum_type == PJD_7PARAM )
-    {
-        for( i = 0; i < point_count; i++ )
-        {
-            long io = i * point_offset;
-            double x_out, y_out, z_out;
-
-            if( x[io] == HUGE_VAL )
-                continue;
-
-            x_out = M_BF*(       x[io] - Rz_BF*y[io] + Ry_BF*z[io]) + Dx_BF;
-            y_out = M_BF*( Rz_BF*x[io] +       y[io] - Rx_BF*z[io]) + Dy_BF;
-            z_out = M_BF*(-Ry_BF*x[io] + Rx_BF*y[io] +       z[io]) + Dz_BF;
-
-            x[io] = x_out;
-            y[io] = y_out;
-            z[io] = z_out;
-        }
-    }
-
-    return 0;
-}
-
-/************************************************************************/
-/*                      pj_geocentic_from_wgs84()                       */
-/************************************************************************/
-
-int pj_geocentric_from_wgs84( PJ *defn, 
-                              long point_count, int point_offset,
-                              double *x, double *y, double *z )
-
-{
-    int       i;
-
-    if( defn->datum_type == PJD_3PARAM )
-    {
-        for( i = 0; i < point_count; i++ )
-        {
-            long io = i * point_offset;
-
-            if( x[io] == HUGE_VAL )
-                continue;
-            
-            x[io] = x[io] - Dx_BF;
-            y[io] = y[io] - Dy_BF;
-            z[io] = z[io] - Dz_BF;
-        }
-    }
-    else if( defn->datum_type == PJD_7PARAM )
-    {
-        for( i = 0; i < point_count; i++ )
-        {
-            long io = i * point_offset;
-            double x_tmp, y_tmp, z_tmp;
-
-            if( x[io] == HUGE_VAL )
-                continue;
-
-            x_tmp = (x[io] - Dx_BF) / M_BF;
-            y_tmp = (y[io] - Dy_BF) / M_BF;
-            z_tmp = (z[io] - Dz_BF) / M_BF;
-
-            x[io] =        x_tmp + Rz_BF*y_tmp - Ry_BF*z_tmp;
-            y[io] = -Rz_BF*x_tmp +       y_tmp + Rx_BF*z_tmp;
-            z[io] =  Ry_BF*x_tmp - Rx_BF*y_tmp +       z_tmp;
-        }
-    }
-
-    return 0;
-}
-
-/************************************************************************/
-/*                         pj_datum_transform()                         */
-/*                                                                      */
-/*      The input should be long/lat/z coordinates in radians in the    */
-/*      source datum, and the output should be long/lat/z               */
-/*      coordinates in radians in the destination datum.                */
-/************************************************************************/
-
-int pj_datum_transform( PJ *srcdefn, PJ *dstdefn, 
-                        long point_count, int point_offset,
-                        double *x, double *y, double *z )
-
-{
-    double      src_a, src_es, dst_a, dst_es;
-    int         z_is_temp = FALSE;
-
-/* -------------------------------------------------------------------- */
-/*      We cannot do any meaningful datum transformation if either      */
-/*      the source or destination are of an unknown datum type          */
-/*      (ie. only a +ellps declaration, no +datum).  This is new        */
-/*      behavior for PROJ 4.6.0.                                        */
-/* -------------------------------------------------------------------- */
-    if( srcdefn->datum_type == PJD_UNKNOWN
-        || dstdefn->datum_type == PJD_UNKNOWN )
-        return 0;
-
-/* -------------------------------------------------------------------- */
-/*      Short cut if the datums are identical.                          */
-/* -------------------------------------------------------------------- */
-    if( pj_compare_datums( srcdefn, dstdefn ) )
-        return 0;
-
-    src_a = srcdefn->a_orig;
-    src_es = srcdefn->es_orig;
-
-    dst_a = dstdefn->a_orig;
-    dst_es = dstdefn->es_orig;
-
-/* -------------------------------------------------------------------- */
-/*      Create a temporary Z array if one is not provided.              */
-/* -------------------------------------------------------------------- */
-    if( z == NULL )
-    {
-        int	bytes = sizeof(double) * point_count * point_offset;
-        z = (double *) pj_malloc(bytes);
-        memset( z, 0, bytes );
-        z_is_temp = TRUE;
-    }
-
-#define CHECK_RETURN(defn) {if( defn->ctx->last_errno != 0 && (defn->ctx->last_errno > 0 || transient_error[-defn->ctx->last_errno] == 0) ) { if( z_is_temp ) pj_dalloc(z); return defn->ctx->last_errno; }}
-
-/* -------------------------------------------------------------------- */
-/*	If this datum requires grid shifts, then apply it to geodetic   */
-/*      coordinates.                                                    */
-/* -------------------------------------------------------------------- */
-    if( srcdefn->datum_type == PJD_GRIDSHIFT )
-    {
-        pj_apply_gridshift_2( srcdefn, 0, point_count, point_offset, x, y, z );
-        CHECK_RETURN(srcdefn);
-
-        src_a = SRS_WGS84_SEMIMAJOR;
-        src_es = SRS_WGS84_ESQUARED;
-    }
-
-    if( dstdefn->datum_type == PJD_GRIDSHIFT )
-    {
-        dst_a = SRS_WGS84_SEMIMAJOR;
-        dst_es = SRS_WGS84_ESQUARED;
-    }
-
-/* ==================================================================== */
-/*      Do we need to go through geocentric coordinates?                */
-/* ==================================================================== */
-    if( src_es != dst_es || src_a != dst_a
-        || srcdefn->datum_type == PJD_3PARAM 
-        || srcdefn->datum_type == PJD_7PARAM
-        || dstdefn->datum_type == PJD_3PARAM 
-        || dstdefn->datum_type == PJD_7PARAM)
-    {
-/* -------------------------------------------------------------------- */
-/*      Convert to geocentric coordinates.                              */
-/* -------------------------------------------------------------------- */
-        srcdefn->ctx->last_errno = 
-            pj_geodetic_to_geocentric( src_a, src_es,
-                                       point_count, point_offset, x, y, z );
-        CHECK_RETURN(srcdefn);
-
-/* -------------------------------------------------------------------- */
-/*      Convert between datums.                                         */
-/* -------------------------------------------------------------------- */
-        if( srcdefn->datum_type == PJD_3PARAM 
-            || srcdefn->datum_type == PJD_7PARAM )
-        {
-            pj_geocentric_to_wgs84( srcdefn, point_count, point_offset,x,y,z);
-            CHECK_RETURN(srcdefn);
-        }
-
-        if( dstdefn->datum_type == PJD_3PARAM 
-            || dstdefn->datum_type == PJD_7PARAM )
-        {
-            pj_geocentric_from_wgs84( dstdefn, point_count,point_offset,x,y,z);
-            CHECK_RETURN(dstdefn);
-        }
-
-/* -------------------------------------------------------------------- */
-/*      Convert back to geodetic coordinates.                           */
-/* -------------------------------------------------------------------- */
-        dstdefn->ctx->last_errno = 
-            pj_geocentric_to_geodetic( dst_a, dst_es,
-                                       point_count, point_offset, x, y, z );
-        CHECK_RETURN(dstdefn);
-    }
-
-/* -------------------------------------------------------------------- */
-/*      Apply grid shift to destination if required.                    */
-/* -------------------------------------------------------------------- */
-    if( dstdefn->datum_type == PJD_GRIDSHIFT )
-    {
-        pj_apply_gridshift_2( dstdefn, 1, point_count, point_offset, x, y, z );
-        CHECK_RETURN(dstdefn);
-    }
-
-    if( z_is_temp )
-        pj_dalloc( z );
-
-    return 0;
-}
-
-/************************************************************************/
-/*                           pj_adjust_axis()                           */
-/*                                                                      */
-/*      Normalize or de-normalized the x/y/z axes.  The normal form     */
-/*      is "enu" (easting, northing, up).                               */
-/************************************************************************/
-static int pj_adjust_axis( projCtx ctx, 
-                           const char *axis, int denormalize_flag,
-                           long point_count, int point_offset, 
-                           double *x, double *y, double *z )
-
-{
-    double x_in, y_in, z_in = 0.0;
-    int i, i_axis;
-
-    if( !denormalize_flag )
-    {
-        for( i = 0; i < point_count; i++ )
-        {
-            x_in = x[point_offset*i];
-            y_in = y[point_offset*i];
-            if( z )
-                z_in = z[point_offset*i];
-     
-            for( i_axis = 0; i_axis < 3; i_axis++ )
-            {
-                double value;
-
-                if( i_axis == 0 )
-                    value = x_in;
-                else if( i_axis == 1 )
-                    value = y_in;
-                else
-                    value = z_in;
-                
-                switch( axis[i_axis] )
-                {
-                  case 'e':
-                    x[point_offset*i] = value; break;
-                  case 'w':
-                    x[point_offset*i] = -value; break;
-                  case 'n':
-                    y[point_offset*i] = value; break;
-                  case 's':
-                    y[point_offset*i] = -value; break;
-                  case 'u':
-                    if( z ) z[point_offset*i] = value; break;
-                  case 'd':
-                    if( z ) z[point_offset*i] = -value; break;
-                  default:
-                    pj_ctx_set_errno( ctx, PJD_ERR_AXIS );
-                    return PJD_ERR_AXIS;
-                }
-            } /* i_axis */
-        } /* i (point) */
-    }
-
-    else /* denormalize */
-    {
-        for( i = 0; i < point_count; i++ )
-        {
-            x_in = x[point_offset*i];
-            y_in = y[point_offset*i];
-            if( z )
-                z_in = z[point_offset*i];
-     
-            for( i_axis = 0; i_axis < 3; i_axis++ )
-            {
-                double *target;
-
-                if( i_axis == 2 && z == NULL )
-                    continue;
-
-                if( i_axis == 0 )
-                    target = x;
-                else if( i_axis == 1 )
-                    target = y;
-                else
-                    target = z;
-                
-                switch( axis[i_axis] )
-                {
-                  case 'e':
-                    target[point_offset*i] = x_in; break;
-                  case 'w':
-                    target[point_offset*i] = -x_in; break;
-                  case 'n':
-                    target[point_offset*i] = y_in; break;
-                  case 's':
-                    target[point_offset*i] = -y_in; break;
-                  case 'u':
-                    target[point_offset*i] = z_in; break;
-                  case 'd':
-                    target[point_offset*i] = -z_in; break;
-                  default:
-                    pj_ctx_set_errno( ctx, PJD_ERR_AXIS );
-                    return PJD_ERR_AXIS;
-                }
-            } /* i_axis */
-        } /* i (point) */
-    }
-    
-    return 0;
-}
-
diff --git a/src/proj/pj_tsfn.c b/src/proj/pj_tsfn.c
deleted file mode 100644
index d9dc0bc..0000000
--- a/src/proj/pj_tsfn.c
+++ /dev/null
@@ -1,10 +0,0 @@
-/* determine small t */
-#include <math.h>
-#include <projects.h>
-#define HALFPI		1.5707963267948966
-	double
-pj_tsfn(double phi, double sinphi, double e) {
-	sinphi *= e;
-	return (tan (.5 * (HALFPI - phi)) /
-	   pow((1. - sinphi) / (1. + sinphi), .5 * e));
-}
diff --git a/src/proj/pj_units.c b/src/proj/pj_units.c
deleted file mode 100644
index bb39f91..0000000
--- a/src/proj/pj_units.c
+++ /dev/null
@@ -1,37 +0,0 @@
-/* definition of standard cartesian units */
-#define PJ_UNITS__
-#include <projects.h>
-/* Field 2 that contains the multiplier to convert named units to meters
-** may be expressed by either a simple floating point constant or a
-** numerator/denomenator values (e.g. 1/1000) */
-C_NAMESPACE_VAR struct PJ_UNITS
-pj_units[] = {
-	"km",	"1000.",	"Kilometer",
-	"m",	"1.",		"Meter",
-	"dm",	"1/10",		"Decimeter",
-	"cm",	"1/100",	"Centimeter",
-	"mm",	"1/1000",	"Millimeter",
-	"kmi",	"1852.0",	"International Nautical Mile",
-	"in",	"0.0254",	"International Inch",
-	"ft",	"0.3048",	"International Foot",
-	"yd",	"0.9144",	"International Yard",
-	"mi",	"1609.344",	"International Statute Mile",
-	"fath",	"1.8288",	"International Fathom",
-	"ch",	"20.1168",	"International Chain",
-	"link",	"0.201168",	"International Link",
-	"us-in",	"1./39.37",	"U.S. Surveyor's Inch",
-	"us-ft",	"0.304800609601219",	"U.S. Surveyor's Foot",
-	"us-yd",	"0.914401828803658",	"U.S. Surveyor's Yard",
-	"us-ch",	"20.11684023368047",	"U.S. Surveyor's Chain",
-	"us-mi",	"1609.347218694437",	"U.S. Surveyor's Statute Mile",
-	"ind-yd",	"0.91439523",	"Indian Yard",
-	"ind-ft",	"0.30479841",	"Indian Foot",
-	"ind-ch",	"20.11669506",	"Indian Chain",
-(char *)0, (char *)0, (char *)0
-};
-
-struct PJ_UNITS *pj_get_units_ref()
-
-{
-    return pj_units;
-}
diff --git a/src/proj/pj_utils.c b/src/proj/pj_utils.c
deleted file mode 100644
index 755c28b..0000000
--- a/src/proj/pj_utils.c
+++ /dev/null
@@ -1,173 +0,0 @@
-/******************************************************************************
- * $Id: pj_utils.c 1950 2012-05-10 16:51:51Z caress $
- *
- * Project:  PROJ.4
- * Purpose:  Some utility functions we don't want to bother putting in
- *           their own source files.
- * Author:   Frank Warmerdam, warmerdam at pobox.com
- *
- ******************************************************************************
- * Copyright (c) 2001, Frank Warmerdam
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *****************************************************************************/
-
-#define PJ_LIB__
-
-#include <projects.h>
-#include <string.h>
-#include <math.h>
-
-/************************************************************************/
-/*                           pj_is_latlong()                            */
-/*                                                                      */
-/*      Returns TRUE if this coordinate system object is                */
-/*      geographic.                                                     */
-/************************************************************************/
-
-int pj_is_latlong( PJ *pj )
-
-{
-    return pj == NULL || pj->is_latlong;
-}
-
-/************************************************************************/
-/*                           pj_is_geocent()                            */
-/*                                                                      */
-/*      Returns TRUE if this coordinate system object is geocentric.    */
-/************************************************************************/
-
-int pj_is_geocent( PJ *pj )
-
-{
-    return pj != NULL && pj->is_geocent;
-}
-
-/************************************************************************/
-/*                        pj_latlong_from_proj()                        */
-/*                                                                      */
-/*      Return a PJ* definition defining the lat/long coordinate        */
-/*      system on which a projection is based.  If the coordinate       */
-/*      system passed in is latlong, a clone of the same will be        */
-/*      returned.                                                       */
-/************************************************************************/
-
-PJ *pj_latlong_from_proj( PJ *pj_in )
-
-{
-    char	defn[512];
-    int		got_datum = FALSE;
-
-    pj_errno = 0;
-    strcpy( defn, "+proj=latlong" );
-
-    if( pj_param(pj_in->ctx, pj_in->params, "tdatum").i )
-    {
-        got_datum = TRUE;
-        sprintf( defn+strlen(defn), " +datum=%s", 
-                 pj_param(pj_in->ctx, pj_in->params,"sdatum").s );
-    }
-    else if( pj_param(pj_in->ctx, pj_in->params, "tellps").i )
-    {
-        sprintf( defn+strlen(defn), " +ellps=%s", 
-                 pj_param(pj_in->ctx, pj_in->params,"sellps").s );
-    }
-    else if( pj_param(pj_in->ctx,pj_in->params, "ta").i )
-    {
-        sprintf( defn+strlen(defn), " +a=%s", 
-                 pj_param(pj_in->ctx,pj_in->params,"sa").s );
-            
-        if( pj_param(pj_in->ctx,pj_in->params, "tb").i )
-            sprintf( defn+strlen(defn), " +b=%s", 
-                     pj_param(pj_in->ctx,pj_in->params,"sb").s );
-        else if( pj_param(pj_in->ctx,pj_in->params, "tes").i )
-            sprintf( defn+strlen(defn), " +es=%s", 
-                     pj_param(pj_in->ctx,pj_in->params,"ses").s );
-        else if( pj_param(pj_in->ctx,pj_in->params, "tf").i )
-            sprintf( defn+strlen(defn), " +f=%s", 
-                     pj_param(pj_in->ctx,pj_in->params,"sf").s );
-        else
-            sprintf( defn+strlen(defn), " +es=%.16g", 
-                     pj_in->es );
-    }
-    else
-    {
-        pj_ctx_set_errno( pj_in->ctx, -13 );
-
-        return NULL;
-    }
-
-    if( !got_datum )
-    {
-        if( pj_param(pj_in->ctx,pj_in->params, "ttowgs84").i )
-            sprintf( defn+strlen(defn), " +towgs84=%s", 
-                     pj_param(pj_in->ctx,pj_in->params,"stowgs84").s );
-
-        if( pj_param(pj_in->ctx,pj_in->params, "tnadgrids").i )
-            sprintf( defn+strlen(defn), " +nadgrids=%s", 
-                     pj_param(pj_in->ctx,pj_in->params,"snadgrids").s );
-    }
-
-    /* copy over some other information related to ellipsoid */
-    if( pj_param(pj_in->ctx,pj_in->params, "tR").i )
-        sprintf( defn+strlen(defn), " +R=%s", 
-                 pj_param(pj_in->ctx,pj_in->params,"sR").s );
-
-    if( pj_param(pj_in->ctx,pj_in->params, "tR_A").i )
-        sprintf( defn+strlen(defn), " +R_A" );
-
-    if( pj_param(pj_in->ctx,pj_in->params, "tR_V").i )
-        sprintf( defn+strlen(defn), " +R_V" );
-
-    if( pj_param(pj_in->ctx,pj_in->params, "tR_a").i )
-        sprintf( defn+strlen(defn), " +R_a" );
-
-    if( pj_param(pj_in->ctx,pj_in->params, "tR_lat_a").i )
-        sprintf( defn+strlen(defn), " +R_lat_a=%s", 
-                 pj_param(pj_in->ctx,pj_in->params,"sR_lat_a").s );
-
-    if( pj_param(pj_in->ctx,pj_in->params, "tR_lat_g").i )
-        sprintf( defn+strlen(defn), " +R_lat_g=%s", 
-                 pj_param(pj_in->ctx,pj_in->params,"sR_lat_g").s );
-
-    /* copy over prime meridian */
-    if( pj_param(pj_in->ctx,pj_in->params, "tpm").i )
-        sprintf( defn+strlen(defn), " +pm=%s", 
-                 pj_param(pj_in->ctx,pj_in->params,"spm").s );
-
-    return pj_init_plus_ctx( pj_in->ctx, defn );
-}
-
-/************************************************************************/
-/*                        pj_get_spheroid_defn()                        */
-/*                                                                      */
-/*      Fetch the internal definition of the spheroid.  Note that       */
-/*      you can compute "b" from eccentricity_squared as:               */
-/*                                                                      */
-/*      b = a * sqrt(1 - es)                                            */
-/************************************************************************/
-
-void pj_get_spheroid_defn(projPJ defn, double *major_axis, double *eccentricity_squared)
-{
-	if ( major_axis )
-		*major_axis = defn->a;
-		
-	if ( eccentricity_squared )
-		*eccentricity_squared = defn->es;
-};
diff --git a/src/proj/pj_zpoly1.c b/src/proj/pj_zpoly1.c
deleted file mode 100644
index fa163de..0000000
--- a/src/proj/pj_zpoly1.c
+++ /dev/null
@@ -1,46 +0,0 @@
-/* evaluate complex polynomial */
-#include <projects.h>
-/* note: coefficients are always from C_1 to C_n
-**	i.e. C_0 == (0., 0)
-**	n should always be >= 1 though no checks are made
-*/
-	COMPLEX
-pj_zpoly1(COMPLEX z, COMPLEX *C, int n) {
-	COMPLEX a;
-	double t;
-
-	a = *(C += n);
-	while (n-- > 0) {
-		a.r = (--C)->r + z.r * (t = a.r) - z.i * a.i;
-		a.i = C->i + z.r * a.i + z.i * t;
-	}
-	a.r = z.r * (t = a.r) - z.i * a.i;
-	a.i = z.r * a.i + z.i * t;
-	return a;
-}
-/* evaluate complex polynomial and derivative */
-	COMPLEX
-pj_zpolyd1(COMPLEX z, COMPLEX *C, int n, COMPLEX *der) {
-	COMPLEX a, b;
-	double t;
-	int first = 1;
-
-	a = *(C += n);
-	while (n-- > 0) {
-		if (first) {
-			first = 0;
-			b = a;
-		} else {
-			b.r = a.r + z.r * (t = b.r) - z.i * b.i;
-			b.i = a.i + z.r * b.i + z.i * t;
-		}
-		a.r = (--C)->r + z.r * (t = a.r) - z.i * a.i;
-		a.i = C->i + z.r * a.i + z.i * t;
-	}
-	b.r = a.r + z.r * (t = b.r) - z.i * b.i;
-	b.i = a.i + z.r * b.i + z.i * t;
-	a.r = z.r * (t = a.r) - z.i * a.i;
-	a.i = z.r * a.i + z.i * t;
-	*der = b;
-	return a;
-}
diff --git a/src/proj/proj.1 b/src/proj/proj.1
deleted file mode 100644
index e554745..0000000
--- a/src/proj/proj.1
+++ /dev/null
@@ -1,303 +0,0 @@
-.\" release 4
-.nr LL 5.5i
-.ad b
-.hy 1
-.TH PROJ 1 "2000/03/21 Rel. 4.4" 
-.SH NAME
-proj \- forward cartographic projection filter
-.br
-invproj \- inverse cartographic projection filter
-.SH SYNOPSIS
-.B proj
-[
-.B \-bceEfiIlmorsStTvVwW
-[
-.I args
-] ] [
-.B +args
-]
-file[s]
-.br
-.B invproj
-[
-.B \-bceEfiIlmorsStTwW
-[
-.I args
-] ] [
-.B +args
-]
-file[s]
-.SH DESCRIPTION
-.I Proj
-and
-.I invproj
-perform respective forward and inverse transformation of cartographic data
-to or from cartesian data with a wide range of selectable projection functions.
-.PP
-The following control parameters can appear in any order:
-.TP
-.BI \-b
-Special option for binary coordinate data input and output
-through standard input and standard output.
-Data is assumed to be in system type
-.I double
-floating point words.
-This option is to be used when
-.B proj
-is a
-.I son
-process and allows bypassing formatting operations.
-.TP
-.BI \-i
-Selects binary input only (see
-.B \-b option).
-.TP
-.BI \-I
-alternate method to specify inverse projection.
-Redundant when used with
-.B invproj.
-.TP
-.BI \-o
-Selects binary output only (see
-.B \-b option).
-.TP
-.BI \-t "a"
-.I A
-specifies a character employed as the first character to denote
-a control line to be passed through without processing.
-This option applicable to ascii input only.
-(# is the default value).
-.TP
-.BI \-e " string"
-.I String
-is an arbitrary string to be output if an error is detected during
-data transformations.
-The default value is: *\et*.
-Note that if the
-.B \-b,
-.B \-i
-or
-.B \-o
-options are employed, an error is returned as HUGE_VAL
-value for both return values.
-.TP
-.BI \-E
-causes the input coordinates to be copied to the output line
-prior to printing the converted values.
-.TP
-.BI \-l "[p|P|=|e|u|d]" id
-List projection identifiers with
-.B \-l,
-.B \-lp
-or
-.B \-lP (expanded)
-that can be selected with
-.B +proj.
-.BI \-l= id
-gives expanded description of projection
-.I id.
-List ellipsoid identifiers with
-.B \-le,
-that can be selected with
-.B +ellps,
-.B \-lu
-list of cartesian to meter conversion factors
-that can be selected with
-.B +units
-or
-.B \-ld
-list of datums that can be selected with 
-.B +datum.
-.TP
-.BI \-r
-This options reverses the order of the
-expected input from longitude-latitude or x-y to latitude-longitude or y-x.
-.TP
-.BI \-s
-This options reverses the order of the
-output from x-y or longitude-latitude to y-x or latitude-longitude.
-.TP
-.BI \-S
-Causes estimation of
-.I meridinal
-and
-.I parallel
-scale factors,
-.I area
-scale factor and
-.I angular distortion,
-and
-.I maximum
-and
-.I minimum
-scale factors to be listed between <> for each input point.
-For conformal projections meridinal and parallel scales factors
-will be equal and angular distortion zero.
-Equal area projections will have an area factor of 1.
-.TP
-.BI \-m " mult"
-The cartesian data may be scaled by the
-.I mult
-parameter.
-When processing data in a forward projection mode the
-cartesian output values are multiplied by
-.I mult
-otherwise the input cartesian values are divided by
-.I mult
-before inverse projection.
-If the first two characters of
-.I mult
-are 1/ or 1: then the reciprocal value of
-.I mult
-is employed.
-.TP
-.BI \-f " format"
-.I Format
-is a
-.I printf
-format string to control the form of the output values.
-For inverse projections, the output will be in degrees when this option
-is employed.
-The default format is "%.2f" for forward projection and DMS
-for inverse.
-.TP
-.BI \-[w|W] n
-.I N
-is the number of significant fractional digits to employ for
-seconds output (when the option is not specified,
-.B \-w3
-is assumed).
-When
-.B \-W
-is employed the fields will be constant width and with leading zeroes.
-.TP
-.B \-v
-causes a listing of cartographic control parameters tested for and
-used by the program to be printed prior to input data.
-Should not be used with the
-.B \-T
-option.
-.TP
-.B \-V
-This option causes an expanded annotated listing of the characteristics
-of the projected point.
-.B -v is implied with this option.
-.TP
-.BI \-T " ulow,uhi,vlow,vhi,res[,umax,vmax]"
-This option creates a set of bivariate Chebyshev polynomial
-coefficients that approximate the selected cartographic projection on
-.I stdout.
-The values
-.I low
-and
-.I hi
-denote the range of the input where the
-.I u
-or
-.I v
-prefixes apply to respective longitude-x or latitude-y
-depending upon whether a forward or inverse projection is selected.
-.I Res
-is an integer number specifying the power of 10 precision of the
-approximation.
-For example, a
-.I res
-of -3 specifies an approximation with an accuracy better than .001.
-.I Umax,
-and
-.I vmax
-specify maximum degree of the polynomials (default: 15).
-See also:
-.B fproj(1).
-.PP
-The
-.B +args
-run-line arguments are associated with cartographic parameters
-and usage varies with projection and for a complete description see
-.I "Cartographic Projection Procedures for the UNIX Environment\(emA User's Manual" )
-and supplementary documentation for Release 4.
-.PP
-Additional projection control parameters may be contained in two
-auxiliary control files:
-the first is optionally referenced with the
-.BI +init= file:id
-and the second is always processed after the name
-of the projection has been established from either the run-line
-or the contents of
-.B +init
-file.
-The environment parameter
-.B PROJ_LIB
-establishes the default directory for a file reference without
-an absolute path.  This is also used for supporting files like
-datum shift files.
-.PP
-One or more
-.I files
-(processed in left to right order)
-specify the source of data to be transformed.
-A \- will specify the location of processing standard input.
-If no files are specified, the input is assumed to be from
-.I stdin.
-For ASCII input data the two data values must be in the
-first two white space separated fields and
-when both input and output are ASCII all trailing portions
-of the input line are appended to the output line.
-.PP
-Input geographic data
-(longitude and latitude) must be in DMS format and input
-cartesian data must be in units consistent with the ellipsoid
-major axis or sphere radius units.
-Output geographic coordinates will be in DMS
-(if the
-.B \-w
-switch is not employed) and precise to 0.001"
-with trailing, zero-valued minute-second fields deleted.
-.SH EXAMPLE
-The following script
-.RS 5
- \f(CWproj +proj=utm +lon_0=112w +ellps=clrk66 -r <<EOF
- 45d15'33.1"	111.5W
- 45d15.551666667N	-111d30
- +45.25919444444	111d30'000w
- EOF\fR
-.RE
-will perform UTM forward projection with a standard UTM
-central meridian nearest longitude 112\(deW.
-The geographic values of this example are equivalent and meant
-as examples of various forms of DMS input.
-The x\-y output data will appear as three lines of:
-.RS 5
- \f(CW460769.27	5011648.45
-.RE
-.SH OTHER PROGRAMS
-.PP
-The \fIproj\fR program is limited to converting between geographic and
-projection coordinates within one datum.
-.PP
-The \fIcs2cs\fR program operates
-similarly, but allows translation between any pair of definable coordinate
-systems, including support for datum translation.
-.PP
-The \fInad2nad\fR program provides for translation between NAD27 and NAD83
-(also available in \fRcs2cs\fI) in a convenient manner. 
-.PP 
-The \fIgeod\fR program provides the ability to compute geodesic (Great
-Circle) computations.
-.SH SEE ALSO
-.B cs2cs(1U), nad2nad(1U), geod(1U), pj_init(3U),
-.br
-.I "Cartographic Projection Procedures for the UNIX Environment\(emA User's Manual,"
-(Evenden, 1990, Open-file report 90\-284).
-.br
-.I "Map Projections Used by the U. S. Geological Survey"
-(Snyder, 1984,
-USGS Bulletin 1532).
-.br
-.I "Map Projections\(emA Working Manual"
-(Snyder, 1988, USGS Prof. Paper 1395).
-.br
-.I "An Album of Map Projections"
-(Snyder & Voxland, 1989, USGS Prof. Paper 1453).
-.SH HOME PAGE
-http://www.remotesensing.org/proj
diff --git a/src/proj/proj.c b/src/proj/proj.c
deleted file mode 100644
index 23f9cca..0000000
--- a/src/proj/proj.c
+++ /dev/null
@@ -1,501 +0,0 @@
-/* <<<< Cartographic projection filter program >>>> */
-#include "projects.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include <ctype.h>
-#include <string.h>
-#include <math.h>
-#include "emess.h"
-
-/* TK 1999-02-13 */
-#if defined(MSDOS) || defined(OS2) || defined(WIN32) || defined(__WIN32__)
-#  include <fcntl.h>
-#  include <io.h>
-#  define SET_BINARY_MODE(file) setmode(fileno(file), O_BINARY)
-#else
-#  define SET_BINARY_MODE(file)
-#endif
-/* ! TK 1999-02-13 */
-
-#define MAX_LINE 1000
-#define MAX_PARGS 100
-#define PJ_INVERS(P) (P->inv ? 1 : 0)
-	static PJ
-*Proj;
-	static projUV
-(*proj)(projUV, PJ *);
-	static int
-reversein = 0,	/* != 0 reverse input arguments */
-reverseout = 0,	/* != 0 reverse output arguments */
-bin_in = 0,	/* != 0 then binary input */
-bin_out = 0,	/* != 0 then binary output */
-echoin = 0,	/* echo input data to output line */
-tag = '#',	/* beginning of line tag character */
-inverse = 0,	/* != 0 then inverse projection */
-prescale = 0,	/* != 0 apply cartesian scale factor */
-dofactors = 0,	/* determine scale factors */
-facs_bad = 0,	/* return condition from pj_factors */
-very_verby = 0, /* very verbose mode */
-postscale = 0;
-	static char
-*cheby_str,		/* string controlling Chebychev evaluation */
-*oform = (char *)0,	/* output format for x-y or decimal degrees */
-*oterr = "*\t*",	/* output line for unprojectable input */
-*usage =
-"%s\nusage: %s [ -beEfiIlormsStTvVwW [args] ] [ +opts[=arg] ] [ files ]\n";
-	static struct FACTORS
-facs;
-	static double
-(*informat)(const char *, char **),	/* input data deformatter function */
-fscale = 0.;	/* cartesian scale factor */
-	static projUV
-int_proj(projUV data) {
-	if (prescale) { data.u *= fscale; data.v *= fscale; }
-	data = (*proj)(data, Proj);
-	if (postscale && data.u != HUGE_VAL)
-		{ data.u *= fscale; data.v *= fscale; }
-	return(data);
-}
-	static void	/* file processing function */
-process(FILE *fid) {
-	char line[MAX_LINE+3], *s, pline[40];
-	projUV data;
-
-	for (;;) {
-		++emess_dat.File_line;
-		if (bin_in) {	/* binary input */
-			if (fread(&data, sizeof(projUV), 1, fid) != 1)
-				break;
-		} else {	/* ascii input */
-			if (!(s = fgets(line, MAX_LINE, fid)))
-				break;
-			if (!strchr(s, '\n')) { /* overlong line */
-				int c;
-				(void)strcat(s, "\n");
-				/* gobble up to newline */
-				while ((c = fgetc(fid)) != EOF && c != '\n') ;
-			}
-			if (*s == tag) {
-				if (!bin_out)
-					(void)fputs(line, stdout);
-				continue;
-			}
-			if (reversein) {
-				data.v = (*informat)(s, &s);
-				data.u = (*informat)(s, &s);
-			} else {
-				data.u = (*informat)(s, &s);
-				data.v = (*informat)(s, &s);
-			}
-			if (data.v == HUGE_VAL)
-				data.u = HUGE_VAL;
-			if (!*s && (s > line)) --s; /* assumed we gobbled \n */
-			if (!bin_out && echoin) {
-				int t;
-				t = *s;
-				*s = '\0';
-				(void)fputs(line, stdout);
-				*s = t;
-				putchar('\t');
-			}
-		}
-		if (data.u != HUGE_VAL) {
-			if (prescale) { data.u *= fscale; data.v *= fscale; }
-			if (dofactors && !inverse)
-				facs_bad = pj_factors(data, Proj, 0., &facs);
-			data = (*proj)(data, Proj);
-			if (dofactors && inverse)
-				facs_bad = pj_factors(data, Proj, 0., &facs);
-			if (postscale && data.u != HUGE_VAL)
-				{ data.u *= fscale; data.v *= fscale; }
-		}
-		if (bin_out) { /* binary output */
-			(void)fwrite(&data, sizeof(projUV), 1, stdout);
-			continue;
-		} else if (data.u == HUGE_VAL) /* error output */
-			(void)fputs(oterr, stdout);
-		else if (inverse && !oform) {	/*ascii DMS output */
-			if (reverseout) {
-				(void)fputs(rtodms(pline, data.v, 'N', 'S'), stdout);
-				putchar('\t');
-				(void)fputs(rtodms(pline, data.u, 'E', 'W'), stdout);
-			} else {
-				(void)fputs(rtodms(pline, data.u, 'E', 'W'), stdout);
-				putchar('\t');
-				(void)fputs(rtodms(pline, data.v, 'N', 'S'), stdout);
-			}
-		} else {	/* x-y or decimal degree ascii output */
-			if (inverse) {
-				data.v *= RAD_TO_DEG;
-				data.u *= RAD_TO_DEG;
-			}
-			if (reverseout) {
-				(void)printf(oform,data.v); putchar('\t');
-				(void)printf(oform,data.u);
-			} else {
-				(void)printf(oform,data.u); putchar('\t');
-				(void)printf(oform,data.v);
-			}
-		}
-		if (dofactors) /* print scale factor data */
-                {
-			if (!facs_bad)
-				(void)printf("\t<%g %g %g %g %g %g>",
-					facs.h, facs.k, facs.s,
-					facs.omega * RAD_TO_DEG, facs.a, facs.b);
-			else
-				(void)fputs("\t<* * * * * *>", stdout);
-                }
-		(void)fputs(bin_in ? "\n" : s, stdout);
-	}
-}
-	static void	/* file processing function --- verbosely */
-vprocess(FILE *fid) {
-	char line[MAX_LINE+3], *s, pline[40];
-	projUV dat_ll, dat_xy;
-	int linvers;
-
-	if (!oform)
-		oform = "%.3f";
-	if (bin_in || bin_out)
-		emess(1,"binary I/O not available in -V option");	
-	for (;;) {
-		++emess_dat.File_line;
-		if (!(s = fgets(line, MAX_LINE, fid)))
-			break;
-		if (!strchr(s, '\n')) { /* overlong line */
-			int c;
-			(void)strcat(s, "\n");
-			/* gobble up to newline */
-			while ((c = fgetc(fid)) != EOF && c != '\n') ;
-		}
-		if (*s == tag) { /* pass on data */
-			(void)fputs(s, stdout);
-			continue;
-		}
-		/* check to override default input mode */
-		if (*s == 'I' || *s == 'i') {
-			linvers = 1;
-			++s;
-		} else if (*s == 'I' || *s == 'i') {
-			linvers = 0;
-			++s;
-		} else
-			linvers = inverse;
-		if (linvers) {
-			if (!PJ_INVERS(Proj)) {
-				emess(-1,"inverse for this projection not avail.\n");
-				continue;
-			}
-			dat_xy.u = strtod(s, &s);
-			dat_xy.v = strtod(s, &s);
-			if (dat_xy.u == HUGE_VAL || dat_xy.v == HUGE_VAL) {
-				emess(-1,"lon-lat input conversion failure\n");
-				continue;
-			}
-			if (prescale) { dat_xy.u *= fscale; dat_xy.v *= fscale; }
-			dat_ll = pj_inv(dat_xy, Proj);
-		} else {
-			dat_ll.u = dmstor(s, &s);
-			dat_ll.v = dmstor(s, &s);
-			if (dat_ll.u == HUGE_VAL || dat_ll.v == HUGE_VAL) {
-				emess(-1,"lon-lat input conversion failure\n");
-				continue;
-			}
-			dat_xy = pj_fwd(dat_ll, Proj);
-			if (postscale) { dat_xy.u *= fscale; dat_xy.v *= fscale; }
-		}
-		if (pj_errno) {
-			emess(-1, pj_strerrno(pj_errno));
-			continue;
-		}
-		if (!*s && (s > line)) --s; /* assumed we gobbled \n */
-		if (pj_factors(dat_ll, Proj, 0., &facs)) {
-			emess(-1,"failed to conpute factors\n\n");
-			continue;
-		}
-		if (*s != '\n')
-			(void)fputs(s, stdout);
-		(void)fputs("Longitude: ", stdout);
-		(void)fputs(rtodms(pline, dat_ll.u, 'E', 'W'), stdout);
-		(void)printf(" [ %.11g ]\n", dat_ll.u * RAD_TO_DEG);
-		(void)fputs("Latitude:  ", stdout);
-		(void)fputs(rtodms(pline, dat_ll.v, 'N', 'S'), stdout);
-		(void)printf(" [ %.11g ]\n", dat_ll.v * RAD_TO_DEG);
-		(void)fputs("Easting (x):   ", stdout);
-		(void)printf(oform, dat_xy.u); putchar('\n');
-		(void)fputs("Northing (y):  ", stdout);
-		(void)printf(oform, dat_xy.v); putchar('\n');
-		(void)printf("Meridian scale (h)%c: %.8f  ( %.4g %% error )\n",
-			facs.code & IS_ANAL_HK ? '*' : ' ', facs.h, (facs.h-1.)*100.);
-		(void)printf("Parallel scale (k)%c: %.8f  ( %.4g %% error )\n",
-			facs.code & IS_ANAL_HK ? '*' : ' ', facs.k, (facs.k-1.)*100.);
-		(void)printf("Areal scale (s):     %.8f  ( %.4g %% error )\n",
-			facs.s, (facs.s-1.)*100.);
-		(void)printf("Angular distortion (w): %.3f\n", facs.omega *
-			RAD_TO_DEG);
-		(void)printf("Meridian/Parallel angle: %.5f\n",
-			facs.thetap * RAD_TO_DEG);
-		(void)printf("Convergence%c: ",facs.code & IS_ANAL_CONV ? '*' : ' ');
-		(void)fputs(rtodms(pline, facs.conv, 0, 0), stdout);
-		(void)printf(" [ %.8f ]\n", facs.conv * RAD_TO_DEG);
-		(void)printf("Max-min (Tissot axis a-b) scale error: %.5f %.5f\n\n",
-			facs.a, facs.b);
-	}
-}
-
-int main(int argc, char **argv) {
-    char *arg, **eargv = argv, *pargv[MAX_PARGS], **iargv = argv;
-    FILE *fid;
-    int pargc = 0, iargc = argc, eargc = 0, c, mon = 0;
-
-    if ( (emess_dat.Prog_name = strrchr(*argv,DIR_CHAR)) != NULL)
-        ++emess_dat.Prog_name;
-    else emess_dat.Prog_name = *argv;
-    inverse = ! strncmp(emess_dat.Prog_name, "inv", 3);
-    if (argc <= 1 ) {
-        (void)fprintf(stderr, usage, pj_get_release(), emess_dat.Prog_name);
-        exit (0);
-    }
-    /* process run line arguments */
-    while (--argc > 0) { /* collect run line arguments */
-        if(**++argv == '-') for(arg = *argv;;) {
-            switch(*++arg) {
-              case '\0': /* position of "stdin" */
-                if (arg[-1] == '-') eargv[eargc++] = "-";
-                break;
-              case 'b': /* binary I/O */
-                bin_in = bin_out = 1;
-                continue;
-              case 'v': /* monitor dump of initialization */
-                mon = 1;
-                continue;
-              case 'i': /* input binary */
-                bin_in = 1;
-                continue;
-              case 'o': /* output binary */
-                bin_out = 1;
-                continue;
-              case 'I': /* alt. method to spec inverse */
-                inverse = 1;
-                continue;
-              case 'E': /* echo ascii input to ascii output */
-                echoin = 1;
-                continue;
-              case 'V': /* very verbose processing mode */
-                very_verby = 1;
-                mon = 1;
-              case 'S': /* compute scale factors */
-                dofactors = 1;
-                continue;
-              case 't': /* set col. one char */
-                if (arg[1]) tag = *++arg;
-                else emess(1,"missing -t col. 1 tag");
-                continue;
-              case 'l': /* list projections, ellipses or units */
-                if (!arg[1] || arg[1] == 'p' || arg[1] == 'P') {
-                    /* list projections */
-                    struct PJ_LIST *lp;
-                    int do_long = arg[1] == 'P', c;
-                    char *str;
-
-                    for (lp = pj_get_list_ref() ; lp->id ; ++lp) {
-                        if( strcmp(lp->id,"latlong") == 0 
-                            || strcmp(lp->id,"longlat") == 0 
-                            || strcmp(lp->id,"geocent") == 0 )
-                            continue;
-
-                        (void)printf("%s : ", lp->id);
-                        if (do_long)  /* possibly multiline description */
-                            (void)puts(*lp->descr);
-                        else { /* first line, only */
-                            str = *lp->descr;
-                            while ((c = *str++) && c != '\n')
-                                putchar(c);
-                            putchar('\n');
-                        }
-                    }
-                } else if (arg[1] == '=') { /* list projection 'descr' */
-                    struct PJ_LIST *lp;
-
-                    arg += 2;
-                    for (lp = pj_get_list_ref(); lp->id ; ++lp)
-                        if (!strcmp(lp->id, arg)) {
-                            (void)printf("%9s : %s\n", lp->id, *lp->descr);
-                            break;
-                        }
-                } else if (arg[1] == 'e') { /* list ellipses */
-                    struct PJ_ELLPS *le;
-
-                    for (le = pj_get_ellps_ref(); le->id ; ++le)
-                        (void)printf("%9s %-16s %-16s %s\n",
-                                     le->id, le->major, le->ell, le->name);
-                } else if (arg[1] == 'u') { /* list units */
-                    struct PJ_UNITS *lu;
-
-                    for (lu = pj_get_units_ref(); lu->id ; ++lu)
-                        (void)printf("%12s %-20s %s\n",
-                                     lu->id, lu->to_meter, lu->name);
-                } else if (arg[1] == 'd') { /* list datums */
-                    struct PJ_DATUMS *ld;
-
-                    printf("__datum_id__ __ellipse___ __definition/comments______________________________\n" );
-                    for (ld = pj_get_datums_ref(); ld->id ; ++ld)
-                    {
-                        printf("%12s %-12s %-30s\n",
-                               ld->id, ld->ellipse_id, ld->defn);
-                        if( ld->comments != NULL && strlen(ld->comments) > 0 )
-                            printf( "%25s %s\n", " ", ld->comments );
-                    }
-                } else
-                    emess(1,"invalid list option: l%c",arg[1]);
-                exit(0);
-                continue; /* artificial */
-              case 'e': /* error line alternative */
-                if (--argc <= 0)
-                    noargument:			   
-                emess(1,"missing argument for -%c",*arg);
-                oterr = *++argv;
-                continue;
-              case 'T': /* generate Chebyshev coefficients */
-                if (--argc <= 0) goto noargument;
-                cheby_str = *++argv;
-                continue;
-              case 'm': /* cartesian multiplier */
-                if (--argc <= 0) goto noargument;
-                postscale = 1;
-                if (!strncmp("1/",*++argv,2) || 
-                    !strncmp("1:",*argv,2)) {
-                    if((fscale = atof((*argv)+2)) == 0.)
-                        goto badscale;
-                    fscale = 1. / fscale;
-                } else
-                    if ((fscale = atof(*argv)) == 0.) {
-                      badscale:
-                        emess(1,"invalid scale argument");
-                    }
-                continue;
-              case 'W': /* specify seconds precision */
-              case 'w': /* -W for constant field width */
-                if ((c = arg[1]) != 0 && isdigit(c)) {
-                    set_rtodms(c - '0', *arg == 'W');
-                    ++arg;
-                } else
-                    emess(1,"-W argument missing or non-digit");
-                continue;
-              case 'f': /* alternate output format degrees or xy */
-                if (--argc <= 0) goto noargument;
-                oform = *++argv;
-                continue;
-              case 'r': /* reverse input */
-                reversein = 1;
-                continue;
-              case 's': /* reverse output */
-                reverseout = 1;
-                continue;
-              default:
-                emess(1, "invalid option: -%c",*arg);
-                break;
-            }
-            break;
-        } else if (**argv == '+') { /* + argument */
-            if (pargc < MAX_PARGS)
-                pargv[pargc++] = *argv + 1;
-            else
-                emess(1,"overflowed + argument table");
-        } else /* assumed to be input file name(s) */
-            eargv[eargc++] = *argv;
-    }
-    if (eargc == 0 && !cheby_str) /* if no specific files force sysin */
-        eargv[eargc++] = "-";
-    else if (eargc > 0 && cheby_str) /* warning */
-        emess(4, "data files when generating Chebychev prohibited");
-    /* done with parameter and control input */
-    if (inverse && postscale) {
-        prescale = 1;
-        postscale = 0;
-        fscale = 1./fscale;
-    }
-    if (!(Proj = pj_init(pargc, pargv)))
-        emess(3,"projection initialization failure\ncause: %s",
-              pj_strerrno(pj_errno));
-
-    if( pj_is_latlong( Proj ) )
-    {
-        emess( 3, "+proj=latlong unsuitable for use with proj program." );
-        exit( 0 );
-    }
-
-    if (inverse) {
-        if (!Proj->inv)
-            emess(3,"inverse projection not available");
-        proj = pj_inv;
-    } else
-        proj = pj_fwd;
-    if (cheby_str) {
-        extern void gen_cheb(int, projUV(*)(projUV), char *, PJ *, int, char **);
-
-        gen_cheb(inverse, int_proj, cheby_str, Proj, iargc, iargv);
-        exit(0);
-    }
-    /* set input formating control */
-    if (mon) {
-        pj_pr_list(Proj);
-        if (very_verby) {
-            (void)printf("#Final Earth figure: ");
-            if (Proj->es) {
-                (void)printf("ellipsoid\n#  Major axis (a): ");
-                (void)printf(oform ? oform : "%.3f", Proj->a);
-                (void)printf("\n#  1/flattening: %.6f\n",
-                             1./(1. - sqrt(1. - Proj->es)));
-                (void)printf("#  squared eccentricity: %.12f\n", Proj->es);
-            } else {
-                (void)printf("sphere\n#  Radius: ");
-                (void)printf(oform ? oform : "%.3f", Proj->a);
-                (void)putchar('\n');
-            }
-        }
-    }
-    if (inverse)
-        informat = strtod;
-    else {
-        informat = dmstor;
-        if (!oform)
-            oform = "%.2f";
-    }
-
-    if (bin_out)
-    {
-        SET_BINARY_MODE(stdout);
-    }
-
-    /* process input file list */
-    for ( ; eargc-- ; ++eargv) {
-        if (**eargv == '-') {
-            fid = stdin;
-            emess_dat.File_name = "<stdin>";
-
-            if (bin_in)
-            {
-                SET_BINARY_MODE(stdin);
-            }
-
-        } else {
-            if ((fid = fopen(*eargv, "rb")) == NULL) {
-                emess(-2, *eargv, "input file");
-                continue;
-            }
-            emess_dat.File_name = *eargv;
-        }
-        emess_dat.File_line = 0;
-        if (very_verby)
-            vprocess(fid);
-        else
-            process(fid);
-        (void)fclose(fid);
-        emess_dat.File_name = 0;
-    }
-    if( Proj )
-        pj_free(Proj);
-    exit(0); /* normal completion */
-}
diff --git a/src/proj/proj_api.h b/src/proj/proj_api.h
deleted file mode 100644
index 30fe1aa..0000000
--- a/src/proj/proj_api.h
+++ /dev/null
@@ -1,134 +0,0 @@
-/******************************************************************************
- * $Id: proj_api.h 1950 2012-05-10 16:51:51Z caress $
- *
- * Project:  PROJ.4
- * Purpose:  Public (application) include file for PROJ.4 API, and constants.
- * Author:   Frank Warmerdam, <warmerdam at pobox.com>
- *
- ******************************************************************************
- * Copyright (c) 2001, Frank Warmerdam <warmerdam at pobox.com>
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *****************************************************************************/
-
-/* General projections header file */
-#ifndef PROJ_API_H
-#define PROJ_API_H
-
-/* standard inclusions */
-#include <math.h>
-#include <stdlib.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* Try to update this every version! */
-#define PJ_VERSION 480
-
-extern char const pj_release[]; /* global release id string */
-
-#define RAD_TO_DEG	57.29577951308232
-#define DEG_TO_RAD	.0174532925199432958
-
-
-extern int pj_errno;	/* global error return code */
-
-#if !defined(PROJECTS_H)
-    typedef struct { double u, v; } projUV;
-    typedef void *projPJ;
-    #define projXY projUV
-    #define projLP projUV
-    typedef void *projCtx;
-#else
-    typedef PJ *projPJ;
-    typedef projCtx_t *projCtx;
-#   define projXY	XY
-#   define projLP       LP
-#endif
-
-/* procedure prototypes */
-
-projXY pj_fwd(projLP, projPJ);
-projLP pj_inv(projXY, projPJ);
-
-int pj_transform( projPJ src, projPJ dst, long point_count, int point_offset,
-                  double *x, double *y, double *z );
-int pj_datum_transform( projPJ src, projPJ dst, long point_count, int point_offset,
-                        double *x, double *y, double *z );
-int pj_geocentric_to_geodetic( double a, double es,
-                               long point_count, int point_offset,
-                               double *x, double *y, double *z );
-int pj_geodetic_to_geocentric( double a, double es,
-                               long point_count, int point_offset,
-                               double *x, double *y, double *z );
-int pj_compare_datums( projPJ srcdefn, projPJ dstdefn );
-int pj_apply_gridshift( projCtx, const char *, int, 
-                        long point_count, int point_offset,
-                        double *x, double *y, double *z );
-void pj_deallocate_grids(void);
-void pj_clear_initcache(void);
-int pj_is_latlong(projPJ);
-int pj_is_geocent(projPJ);
-void pj_get_spheroid_defn(projPJ defn, double *major_axis, double *eccentricity_squared);
-void pj_pr_list(projPJ);
-void pj_free(projPJ);
-void pj_set_finder( const char *(*)(const char *) );
-void pj_set_searchpath ( int count, const char **path );
-projPJ pj_init(int, char **);
-projPJ pj_init_plus(const char *);
-projPJ pj_init_ctx( projCtx, int, char ** );
-projPJ pj_init_plus_ctx( projCtx, const char * );
-char *pj_get_def(projPJ, int);
-projPJ pj_latlong_from_proj( projPJ );
-void *pj_malloc(size_t);
-void pj_dalloc(void *);
-char *pj_strerrno(int);
-int *pj_get_errno_ref(void);
-const char *pj_get_release(void);
-void pj_acquire_lock(void);
-void pj_release_lock(void);
-void pj_cleanup_lock(void);
-
-projCtx pj_get_default_ctx(void);
-projCtx pj_get_ctx( projPJ );
-void pj_set_ctx( projPJ, projCtx );
-projCtx pj_ctx_alloc(void);
-void    pj_ctx_free( projCtx );
-int pj_ctx_get_errno( projCtx );
-void pj_ctx_set_errno( projCtx, int );
-void pj_ctx_set_debug( projCtx, int );
-void pj_ctx_set_logger( projCtx, void (*)(void *, int, const char *) );
-void pj_ctx_set_app_data( projCtx, void * );
-void *pj_ctx_get_app_data( projCtx );
-
-void pj_log( projCtx ctx, int level, const char *fmt, ... );
-void pj_stderr_logger( void *, int, const char * );
-
-#define PJ_LOG_NONE        0
-#define PJ_LOG_ERROR       1
-#define PJ_LOG_DEBUG_MAJOR 2
-#define PJ_LOG_DEBUG_MINOR 3
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* ndef PROJ_API_H */
-
diff --git a/src/proj/proj_etmerc.c b/src/proj/proj_etmerc.c
deleted file mode 100644
index 3a38960..0000000
--- a/src/proj/proj_etmerc.c
+++ /dev/null
@@ -1,252 +0,0 @@
-/*
-** libproj -- library of cartographic projections
-**
-** Copyright (c) 2008   Gerald I. Evenden
-*/
-
-/*
-** Permission is hereby granted, free of charge, to any person obtaining
-** a copy of this software and associated documentation files (the
-** "Software"), to deal in the Software without restriction, including
-** without limitation the rights to use, copy, modify, merge, publish,
-** distribute, sublicense, and/or sell copies of the Software, and to
-** permit persons to whom the Software is furnished to do so, subject to
-** the following conditions:
-**
-** The above copyright notice and this permission notice shall be
-** included in all copies or substantial portions of the Software.
-**
-** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
-** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-** SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-*/
-
-/* The code in this file is largly based upon procedures:
- *
- * Written by: Knud Poder and Karsten Engsager
- *
- * Based on math from: R.Koenig and K.H. Weise, "Mathematische
- * Grundlagen der hoeheren Geodaesie und Kartographie,
- * Springer-Verlag, Berlin/Goettingen" Heidelberg, 1951.
- *
- * Modified and used here by permission of Reference Networks
- * Division, Kort og Matrikelstyrelsen (KMS), Copenhagen, Denmark
-*/
-
-
-#define PROJ_PARMS__ \
-	double    Qn;    /* Merid. quad., scaled to the projection */ \
-	double    Zb;    /* Radius vector in polar coord. systems  */ \
-	double    cgb[5]; /* Constants for Gauss -> Geo lat */ \
-	double    cbg[5]; /* Constants for Geo lat -> Gauss */ \
-	double    utg[5]; /* Constants for transv. merc. -> geo */ \
-	double    gtu[5]; /* Constants for geo -> transv. merc. */
-
-#define PROJ_LIB__
-#define PJ_LIB__
-
-#include <projects.h>
-
-PROJ_HEAD(etmerc, "Extended Transverse Mercator")
-    "\n\tCyl, Sph\n\tlat_ts=(0)\nlat_0=(0)";
-
-#define FABS(x) ((x)<0?-(x):(x))
-
-#ifdef _GNU_SOURCE
-    inline
-#endif
-	static double
-gatg(double *p1, int len_p1, double B) {
-	double *p;
-	double h = 0., h1, h2 = 0., cos_2B;
-
-	cos_2B = 2.*cos(2.0*B);
-   	for (p = p1 + len_p1, h1 = *--p; p - p1; h2 = h1, h1 = h)
-   		h = -h2 + cos_2B*h1 + *--p;
-   	return (B + h*sin(2.0*B));
-}
-
-#ifdef _GNU_SOURCE
-    inline
-#endif
-	static double
-clenS(double *a, int size, double arg_r, double arg_i, double *R, double *I) {
-	double      *p, r, i, hr, hr1, hr2, hi, hi1, hi2;
-	double      sin_arg_r, cos_arg_r, sinh_arg_i, cosh_arg_i;
-	double      exp_arg_i, pxe_arg_i;
-
-	/* arguments */
-	p = a + size;
-#ifdef _GNU_SOURCE
-	sincos(arg_r, &sin_arg_r, &cos_arg_r);
-#else
-	sin_arg_r  = sin(arg_r);
-	cos_arg_r  = cos(arg_r);
-#endif
-    exp_arg_i  = exp( arg_i);
-    pxe_arg_i  = exp(-arg_i);
-	sinh_arg_i = (exp_arg_i-pxe_arg_i)/2;
-	cosh_arg_i = (exp_arg_i+pxe_arg_i)/2;
-	r          =  2.0*cos_arg_r*cosh_arg_i;
-	i          = -2.0*sin_arg_r*sinh_arg_i;
-	/* summation loop */
-	for (hi1 = hr1 = hi = 0.0, hr = *--p; a - p;) {
-		hr2 = hr1;
-		hi2 = hi1;
-		hr1 = hr;
-		hi1 = hi;
-		hr  = -hr2 + r*hr1 - i*hi1 + *--p;
-		hi  = -hi2 + i*hr1 + r*hi1;
-	}
-	r   = sin_arg_r*cosh_arg_i;
-	i   = cos_arg_r*sinh_arg_i;
-	*R  = r*hr - i*hi;
-	*I  = r*hi + i*hr;
-	return(*R);
-}
-	static double
-clens(double *a, int size, double arg_r) {
-	double      *p, r, hr, hr1, hr2, cos_arg_r;
-
-	p = a + size;
-	cos_arg_r  = cos(arg_r);
-	r          =  2.0*cos_arg_r;
-	/* summation loop */
-	for (hr1 = 0.0, hr = *--p; a - p;) {
-		hr2 = hr1;
-		hr1 = hr;
-		hr  = -hr2 + r*hr1 + *--p;
-	}
-	return(sin(arg_r)*hr);
-}
-
-
-FORWARD(e_forward); /* ellipsoid */
-	double sin_Cn, cos_Cn, cos_Ce, sin_Ce, dCn, dCe;
-	double Cn = lp.phi, Ce = lp.lam;
-
-	/* ell. LAT, LNG -> Gaussian LAT, LNG */
-	Cn  = gatg(P->cbg, 5, Cn);
-	/* Gaussian LAT, LNG -> compl. sph. LAT */
-#ifdef _GNU_SOURCE
-	sincos(Cn, &sin_Cn, &cos_Cn);
-	sincos(Ce, &sin_Ce, &cos_Ce);
-#else
-	sin_Cn = sin(Cn);
-	cos_Cn = cos(Cn);
-	sin_Ce = sin(Ce);
-	cos_Ce = cos(Ce);
-#endif
-
-	Cn     = atan2(sin_Cn, cos_Ce*cos_Cn);
-	Ce     = atan2(sin_Ce*cos_Cn, hypot(sin_Cn, cos_Cn*cos_Ce));
-	/* compl. sph. N, E -> ell. norm. N, E */
-	Ce  = log(tan(FORTPI + Ce*0.5));
-	Cn += clenS(P->gtu, 5, 2.*Cn, 2.*Ce, &dCn, &dCe);
-	Ce += dCe;
-	if (FABS(Ce) <= 2.623395162778) {
-		xy.y  = P->Qn * Cn + P->Zb;  /* Northing */
-		xy.x  = P->Qn * Ce;  /* Easting  */
-	} else
-		xy.x = xy.y = HUGE_VAL;
-	return (xy);
-}
-
-
-INVERSE(e_inverse); /* ellipsoid */
-	double sin_Cn, cos_Cn, cos_Ce, sin_Ce, dCn, dCe;
-	double Cn = xy.y, Ce = xy.x;
-
-	/* normalize N, E */
-	Cn = (Cn - P->Zb)/P->Qn;
-	Ce = Ce/P->Qn;
-	if (FABS(Ce) <= 2.623395162778) { /* 150 degrees */
-	/* norm. N, E -> compl. sph. LAT, LNG */
-		Cn += clenS(P->utg, 5, 2.*Cn, 2.*Ce, &dCn, &dCe);
-		Ce += dCe;
-		Ce = 2.0*(atan(exp(Ce)) - FORTPI);
-		/* compl. sph. LAT -> Gaussian LAT, LNG */
-#ifdef _GNU_SOURCE
-    	sincos(Cn, &sin_Cn, &cos_Cn);
-    	sincos(Ce, &sin_Ce, &cos_Ce);
-#else
-    	sin_Cn = sin(Cn);
-    	cos_Cn = cos(Cn);
-    	sin_Ce = sin(Ce);
-    	cos_Ce = cos(Ce);
-#endif
-		Ce     = atan2(sin_Ce, cos_Ce*cos_Cn);
-		Cn     = atan2(sin_Cn*cos_Ce, hypot(sin_Ce, cos_Ce*cos_Cn));
-		/* Gaussian LAT, LNG -> ell. LAT, LNG */
-		lp.phi = gatg(P->cgb,  5, Cn);
-		lp.lam = Ce;
-	}
-	else
-		lp.phi = lp.lam = HUGE_VAL;
-	return (lp);
-}
-
-
-FREEUP; if (P) free(P); }
-
-
-ENTRY0(etmerc)
-	double f, n, np, Z;
-
-	if (P->es <= 0.) E_ERROR(-34);
-	f = 1. - sqrt(1. - P->es);
-	/* third flattening */
-	np = n = f/(2.0 - f);
-
-	/* COEF. OF TRIG SERIES GEO <-> GAUSS */
-	/* cgb := Gaussian -> Geodetic, KW p190 - 191 (61) - (62) */
-	/* cbg := Geodetic -> Gaussian, KW p186 - 187 (51) - (52) */
-	/* 5 degree : Engsager and Poder: ICC2007 */
-	P->cgb[0] = n*( 2.0 + n*(-2.0/3.0  + n*(-2.0      + n*(116.0/45.0 + n*(26.0/45.0)))));
-	P->cbg[0] = n*(-2.0 + n*( 2.0/3.0  + n*( 4.0/3.0  + n*(-82.0/45.0 + n*(32.0/45.0)))));
-	np     *= n;
-	P->cgb[1] = np*(7.0/3.0     + n*( -8.0/5.0  + n*(-227.0/45.0 + n*(2704.0/315.0))));
-	P->cbg[1] = np*(5.0/3.0     + n*(-16.0/15.0 + n*( -13.0/ 9.0 + n*( 904.0/315.0))));
-	np     *= n;
-	P->cgb[2] = np*( 56.0/15.0  + n*(-136.0/35.0 + n*(1262.0/105.0)));
-	P->cbg[2] = np*(-26.0/15.0  + n*(  34.0/21.0 + n*(   8.0/  5.0)));
-	np     *= n;
-	P->cgb[3] = np*(4279.0/630.0 + n*(-322.0/35.0));
-	P->cbg[3] = np*(1237.0/630.0 + n*( -12.0/ 5.0));
-	np     *= n;
-	P->cgb[4] = np*(4174.0/315.0);
-	P->cbg[4] = np*(-734.0/315.0);
-
-	/* Constants of the projections */
-	/* Transverse Mercator (UTM, ITM, etc) */
-	np = n*n;
-	/* Norm. mer. quad, K&W p.50 (96), p.19 (38b), p.5 (2) */
-	P->Qn = P->k0/(1 + n) * (1. + np*(1./4.0 + np*(1./64.0 + np/256.0)));
-	/* coef of trig series */
-	/* utg := ell. N, E -> sph. N, E,  KW p194 (65) */
-	/* gtu := sph. N, E -> ell. N, E,  KW p196 (69) */
-	P->utg[0] = n*(-0.5  + n*( 2.0/3.0 + n*(-37.0/96.0 + n*( 1.0/360.0 + n*(  81.0/512.0)))));
-	P->gtu[0] = n*( 0.5  + n*(-2.0/3.0 + n*(  5.0/16.0 + n*(41.0/180.0 + n*(-127.0/288.0)))));
-	P->utg[1] = np*(-1.0/48.0 + n*(-1.0/15.0 + n*(437.0/1440.0 + n*(-46.0/105.0))));
-	P->gtu[1] = np*(13.0/48.0 + n*(-3.0/5.0  + n*(557.0/1440.0 + n*(281.0/630.0))));
-	np      *= n;
-	P->utg[2] = np*(-17.0/480.0 + n*(  37.0/840.0 + n*(  209.0/ 4480.0)));
-	P->gtu[2] = np*( 61.0/240.0 + n*(-103.0/140.0 + n*(15061.0/26880.0)));
-	np      *= n;
-	P->utg[3] = np*(-4397.0/161280.0 + n*(  11.0/504.0));
-	P->gtu[3] = np*(49561.0/161280.0 + n*(-179.0/168.0));
-	np     *= n;
-	P->utg[4] = np*(-4583.0/161280.0);
-	P->gtu[4] = np*(34729.0/ 80640.0);
-	/* Gaussian latitude value of the origin latitude */
-	Z = gatg(P->cbg, 5, P->phi0);
-	/* Origin northing minus true northing at the origin latitude */
-	/* i.e. true northing = N - P->Zb                         */
-	P->Zb  = - P->Qn*(Z + clens(P->gtu, 5, 2.0*Z));
-	P->inv = e_inverse;
-	P->fwd = e_forward;
-ENDENTRY(P)
diff --git a/src/proj/proj_mdist.c b/src/proj/proj_mdist.c
deleted file mode 100644
index e8b0127..0000000
--- a/src/proj/proj_mdist.c
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
-** libproj -- library of cartographic projections
-**
-** Copyright (c) 2003, 2006   Gerald I. Evenden
-*/
-static const char
-LIBPROJ_ID[] = "$Id: proj_mdist.c 1950 2012-05-10 16:51:51Z caress $";
-/*
-** Permission is hereby granted, free of charge, to any person obtaining
-** a copy of this software and associated documentation files (the
-** "Software"), to deal in the Software without restriction, including
-** without limitation the rights to use, copy, modify, merge, publish,
-** distribute, sublicense, and/or sell copies of the Software, and to
-** permit persons to whom the Software is furnished to do so, subject to
-** the following conditions:
-**
-** The above copyright notice and this permission notice shall be
-** included in all copies or substantial portions of the Software.
-**
-** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
-** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-** SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-*/
-/* Computes distance from equator along the meridian to latitude phi
-** and inverse on unit ellipsoid.
-** Precision commensurate with double precision.
-*/
-#define PROJ_LIB__
-#include <projects.h>
-#define MAX_ITER 20
-#define TOL 1e-14
-
-struct MDIST {
-	int nb;
-	double es;
-	double E;
-	double b[1];
-};
-#define B ((struct MDIST *)b)
-	void *
-proj_mdist_ini(double es) {
-	double numf, numfi, twon1, denf, denfi, ens, T, twon;
-	double den, El, Es;
-	double E[MAX_ITER];
-	struct MDIST *b;
-	int i, j;
-
-/* generate E(e^2) and its terms E[] */
-	ens = es;
-	numf = twon1 = denfi = 1.;
-	denf = 1.;
-	twon = 4.;
-	Es = El = E[0] = 1.;
-	for (i = 1; i < MAX_ITER ; ++i) {
-		numf *= (twon1 * twon1);
-		den = twon * denf * denf * twon1;
-		T = numf/den;
-		Es -= (E[i] = T * ens);
-		ens *= es;
-		twon *= 4.;
-		denf *= ++denfi;
-		twon1 += 2.;
-		if (Es == El) /* jump out if no change */
-			break;
-		El = Es;
-	}
-	if ((b = (struct MDIST *)malloc(sizeof(struct MDIST)+
-		(i*sizeof(double)))) == NULL)
-		return(NULL);
-	b->nb = i - 1;
-	b->es = es;
-	b->E = Es;
-	/* generate b_n coefficients--note: collapse with prefix ratios */
-	b->b[0] = Es = 1. - Es;
-	numf = denf = 1.;
-	numfi = 2.;
-	denfi = 3.;
-	for (j = 1; j < i; ++j) {
-		Es -= E[j];
-		numf *= numfi;
-		denf *= denfi;
-		b->b[j] = Es * numf / denf;
-		numfi += 2.;
-		denfi += 2.;
-	}
-	return (b);
-}
-	double
-proj_mdist(double phi, double sphi, double cphi, const void *b) {
-	double sc, sum, sphi2, D;
-	int i;
-
-	sc = sphi * cphi;
-	sphi2 = sphi * sphi;
-	D = phi * B->E - B->es * sc / sqrt(1. - B->es * sphi2);
-	sum = B->b[i = B->nb];
-	while (i) sum = B->b[--i] + sphi2 * sum;
-	return(D + sc * sum);
-}
-	double
-proj_inv_mdist(projCtx ctx, double dist, const void *b) {
-	double s, t, phi, k;
-	int i;
-
-	k = 1./(1.- B->es);
-	i = MAX_ITER;
-	phi = dist;
-	while ( i-- ) {
-		s = sin(phi);
-		t = 1. - B->es * s * s;
-		phi -= t = (proj_mdist(phi, s, cos(phi), b) - dist) *
-			(t * sqrt(t)) * k;
-		if (fabs(t) < TOL) /* that is no change */
-			return phi;
-	}
-		/* convergence failed */
-	pj_ctx_set_errno(ctx, -17);
-	return phi;
-}
diff --git a/src/proj/proj_rouss.c b/src/proj/proj_rouss.c
deleted file mode 100644
index 222a712..0000000
--- a/src/proj/proj_rouss.c
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
-** libproj -- library of cartographic projections
-**
-** Copyright (c) 2003, 2006   Gerald I. Evenden
-*/
-static const char
-LIBPROJ_ID[] = "$Id: proj_rouss.c 1950 2012-05-10 16:51:51Z caress $";
-/*
-** Permission is hereby granted, free of charge, to any person obtaining
-** a copy of this software and associated documentation files (the
-** "Software"), to deal in the Software without restriction, including
-** without limitation the rights to use, copy, modify, merge, publish,
-** distribute, sublicense, and/or sell copies of the Software, and to
-** permit persons to whom the Software is furnished to do so, subject to
-** the following conditions:
-**
-** The above copyright notice and this permission notice shall be
-** included in all copies or substantial portions of the Software.
-**
-** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
-** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-** SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-*/
-#define PROJ_PARMS__ \
-	double s0; \
-	double A1, A2, A3, A4, A5, A6; \
-	double B1, B2, B3, B4, B5, B6, B7, B8; \
-	double C1, C2, C3, C4, C5, C6, C7, C8; \
-	double D1, D2, D3, D4, D5, D6, D7, D8, D9, D10, D11; \
-	void *en;
-#define PJ_LIB__
-# include <projects.h>
-PROJ_HEAD(rouss, "Roussilhe Stereographic") "\n\tAzi., Ellps.";
-FORWARD(e_forward); /* ellipsoid */
-	double s, al, cp, sp, al2, s2;
-	
-	cp = cos(lp.phi);
-	sp = sin(lp.phi);
-	s = proj_mdist(lp.phi, sp, cp,  P->en) - P->s0;
-	s2 = s * s;
-	al = lp.lam * cp / sqrt(1. - P->es * sp * sp);
-	al2 = al * al;
-	xy.x = P->k0 * al*(1.+s2*(P->A1+s2*P->A4)-al2*(P->A2+s*P->A3+s2*P->A5
-				+al2*P->A6));
-	xy.y = P->k0 * (al2*(P->B1+al2*P->B4)+
-		s*(1.+al2*(P->B3-al2*P->B6)+s2*(P->B2+s2*P->B8)+
-		s*al2*(P->B5+s*P->B7)));
-	return (xy);
-}
-INVERSE(e_inverse); /* ellipsoid */
-	double s, al, x = xy.x / P->k0, y = xy.y / P->k0, x2, y2;;
-
-	x2 = x * x;
-	y2 = y * y;
-	al = x*(1.-P->C1*y2+x2*(P->C2+P->C3*y-P->C4*x2+P->C5*y2-P->C7*x2*y)
-		+y2*(P->C6*y2-P->C8*x2*y));
-	s = P->s0 + y*(1.+y2*(-P->D2+P->D8*y2))+
-		x2*(-P->D1+y*(-P->D3+y*(-P->D5+y*(-P->D7+y*P->D11)))+
-		x2*(P->D4+y*(P->D6+y*P->D10)-x2*P->D9));
-	lp.phi=proj_inv_mdist(P->ctx, s, P->en);
-	s = sin(lp.phi);
-	lp.lam=al * sqrt(1. - P->es * s * s)/cos(lp.phi);
-	return (lp);
-}
-FREEUP;
-	if (P) {
-		if (P->en)
-			free(P->en);
-		free(P);
-	}
-}
-ENTRY1(rouss, en)
-	double N0, es2, t, t2, R_R0_2, R_R0_4;
-
-	if (!((P->en = proj_mdist_ini(P->es))))
-		E_ERROR_0;
-	es2 = sin(P->phi0);
-	P->s0 = proj_mdist(P->phi0, es2, cos(P->phi0), P->en);
-	t = 1. - (es2 = P->es * es2 * es2);
-	N0 = 1./sqrt(t);
-	R_R0_2 = t * t / P->one_es;
-	R_R0_4 = R_R0_2 * R_R0_2;
-	t = tan(P->phi0);
-	t2 = t * t;
-	P->C1 = P->A1 = R_R0_2 / 4.;
-	P->C2 = P->A2 = R_R0_2 * (2 * t2 - 1. - 2. * es2) / 12.;
-	P->A3 = R_R0_2 * t * (1. + 4. * t2)/ ( 12. * N0);
-	P->A4 = R_R0_4 / 24.;
-	P->A5 = R_R0_4 * ( -1. + t2 * (11. + 12. * t2))/24.;
-	P->A6 = R_R0_4 * ( -2. + t2 * (11. - 2. * t2))/240.;
-	P->B1 = t / (2. * N0);
-	P->B2 = R_R0_2 / 12.;
-	P->B3 = R_R0_2 * (1. + 2. * t2 - 2. * es2)/4.;
-	P->B4 = R_R0_2 * t * (2. - t2)/(24. * N0);
-	P->B5 = R_R0_2 * t * (5. + 4.* t2)/(8. * N0);
-	P->B6 = R_R0_4 * (-2. + t2 * (-5. + 6. * t2))/48.;
-	P->B7 = R_R0_4 * (5. + t2 * (19. + 12. * t2))/24.;
-	P->B8 = R_R0_4 / 120.;
-	P->C3 = R_R0_2 * t * (1. + t2)/(3. * N0);
-	P->C4 = R_R0_4 * (-3. + t2 * (34. + 22. * t2))/240.;
-	P->C5 = R_R0_4 * (4. + t2 * (13. + 12. * t2))/24.;
-	P->C6 = R_R0_4 / 16.;
-	P->C7 = R_R0_4 * t * (11. + t2 * (33. + t2 * 16.))/(48. * N0);
-	P->C8 = R_R0_4 * t * (1. + t2 * 4.)/(36. * N0);
-	P->D1 = t / (2. * N0);
-	P->D2 = R_R0_2 / 12.;
-	P->D3 = R_R0_2 * (2 * t2 + 1. - 2. * es2) / 4.;
-	P->D4 = R_R0_2 * t * (1. + t2)/(8. * N0);
-	P->D5 = R_R0_2 * t * (1. + t2 * 2.)/(4. * N0);
-	P->D6 = R_R0_4 * (1. + t2 * (6. + t2 * 6.))/16.;
-	P->D7 = R_R0_4 * t2 * (3. + t2 * 4.)/8.;
-	P->D8 = R_R0_4 / 80.;
-	P->D9 = R_R0_4 * t * (-21. + t2 * (178. - t2 * 26.))/720.;
-	P->D10 = R_R0_4 * t * (29. + t2 * (86. + t2 * 48.))/(96. * N0);
-	P->D11 = R_R0_4 * t * (37. + t2 * 44.)/(96. * N0);
-	P->fwd = e_forward;
-	P->inv = e_inverse;
-	ENDENTRY(P)
diff --git a/src/proj/projects.h b/src/proj/projects.h
deleted file mode 100644
index b446c9a..0000000
--- a/src/proj/projects.h
+++ /dev/null
@@ -1,476 +0,0 @@
-/******************************************************************************
- * $Id: projects.h 1950 2012-05-10 16:51:51Z caress $
- *
- * Project:  PROJ.4
- * Purpose:  Primary (private) include file for PROJ.4 library.
- * Author:   Gerald Evenden
- *
- ******************************************************************************
- * Copyright (c) 2000, Frank Warmerdam
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *****************************************************************************/
-
-/* General projections header file */
-#ifndef PROJECTS_H
-#define PROJECTS_H
-
-#ifdef _MSC_VER
-#  ifndef _CRT_SECURE_NO_DEPRECATE
-#    define _CRT_SECURE_NO_DEPRECATE
-#  endif
-#  ifndef _CRT_NONSTDC_NO_DEPRECATE
-#    define _CRT_NONSTDC_NO_DEPRECATE
-#  endif
-#endif
-
-/* standard inclusions */
-#include <math.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#ifdef __cplusplus
-#define C_NAMESPACE extern "C"
-#define C_NAMESPACE_VAR extern "C"
-extern "C" {
-#else    
-#define C_NAMESPACE extern
-#define C_NAMESPACE_VAR
-#endif
-
-#ifndef NULL
-#  define NULL	0
-#endif
-
-#ifndef FALSE
-#  define FALSE	0
-#endif
-
-#ifndef TRUE
-#  define TRUE	1
-#endif
-
-#ifndef MAX
-#  define MIN(a,b)      ((a<b) ? a : b)
-#  define MAX(a,b)      ((a>b) ? a : b)
-#endif
-
-#ifndef ABS
-#  define ABS(x)        ((x<0) ? (-1*(x)) : x)
-#endif
-
-    /* maximum path/filename */
-#ifndef MAX_PATH_FILENAME
-#define MAX_PATH_FILENAME 1024
-#endif
-	/* prototype hypot for systems where absent */
-#ifndef _WIN32
-extern double hypot(double, double);
-#endif
-
-#ifdef _WIN32_WCE
-#  include <wce_stdlib.h>
-#  include <wce_stdio.h>
-#  define rewind wceex_rewind
-#  define getenv wceex_getenv
-#  define strdup _strdup
-#  define hypot _hypot
-#endif
-
-	/* some useful constants */
-#define HALFPI		1.5707963267948966
-#define FORTPI		0.78539816339744833
-#define PI		3.14159265358979323846
-#define TWOPI		6.2831853071795864769
-
-/* environment parameter name */
-#ifndef PROJ_LIB
-#define PROJ_LIB "PROJ_LIB"
-#endif
-/* maximum tag id length for +init and default files */
-#ifndef ID_TAG_MAX
-#define ID_TAG_MAX 50
-#endif
-
-/* Use WIN32 as a standard windows 32 bit declaration */
-#if defined(_WIN32) && !defined(WIN32) && !defined(_WIN32_WCE)
-#  define WIN32
-#endif
-
-#if defined(_WINDOWS) && !defined(WIN32) && !defined(_WIN32_WCE)
-#  define WIN32
-#endif
-
-/* directory delimiter for DOS support */
-#ifdef WIN32
-#define DIR_CHAR '\\'
-#else
-#define DIR_CHAR '/'
-#endif
-
-/* proj thread context */
-typedef struct {
-    int	    last_errno;
-    int     debug_level;
-    void    (*logger)(void *, int, const char *);
-    void    *app_data;
-} projCtx_t;
-
-/* datum_type values */
-#define PJD_UNKNOWN   0
-#define PJD_3PARAM    1   
-#define PJD_7PARAM    2   
-#define PJD_GRIDSHIFT 3
-#define PJD_WGS84     4   /* WGS84 (or anything considered equivelent) */
-
-/* library errors */
-#define PJD_ERR_GEOCENTRIC          -45
-#define PJD_ERR_AXIS                -47
-#define PJD_ERR_GRID_AREA           -48
-
-#define USE_PROJUV 
-
-typedef struct { double u, v; } projUV;
-typedef struct { double r, i; }	COMPLEX;
-
-#ifndef PJ_LIB__
-#define XY projUV
-#define LP projUV
-#else
-typedef struct { double x, y; }     XY;
-typedef struct { double lam, phi; } LP;
-#endif
-
-typedef union { double  f; int  i; char *s; } PVALUE;
-struct PJconsts;
-    
-struct PJ_LIST {
-	char	*id;		/* projection keyword */
-	struct PJconsts	*(*proj)(struct PJconsts*);/* projection entry point */
-	char 	* const *descr;	/* description text */
-};
-struct PJ_ELLPS {
-	char	*id;	/* ellipse keyword name */
-	char	*major;	/* a= value */
-	char	*ell;	/* elliptical parameter */
-	char	*name;	/* comments */
-};
-struct PJ_UNITS {
-	char	*id;	/* units keyword */
-	char	*to_meter;	/* multiply by value to get meters */
-	char	*name;	/* comments */
-};
-
-struct PJ_DATUMS {
-    char    *id;     /* datum keyword */
-    char    *defn;   /* ie. "to_wgs84=..." */
-    char    *ellipse_id; /* ie from ellipse table */
-    char    *comments; /* EPSG code, etc */
-};
-
-struct PJ_PRIME_MERIDIANS {
-    char    *id;     /* prime meridian keyword */
-    char    *defn;   /* offset from greenwich in DMS format. */
-};
-
-struct DERIVS {
-    double x_l, x_p; /* derivatives of x for lambda-phi */
-    double y_l, y_p; /* derivatives of y for lambda-phi */
-};
-    
-struct FACTORS {
-	struct DERIVS der;
-	double h, k;	/* meridinal, parallel scales */
-	double omega, thetap;	/* angular distortion, theta prime */
-	double conv;	/* convergence */
-	double s;		/* areal scale factor */
-	double a, b;	/* max-min scale error */
-	int code;		/* info as to analytics, see following */
-};
-#define IS_ANAL_XL_YL 01	/* derivatives of lon analytic */
-#define IS_ANAL_XP_YP 02	/* derivatives of lat analytic */
-#define IS_ANAL_HK	04		/* h and k analytic */
-#define IS_ANAL_CONV 010	/* convergence analytic */
-    /* parameter list struct */
-typedef struct ARG_list {
-	struct ARG_list *next;
-	char used;
-	char param[1]; } paralist;
-	/* base projection data structure */
-
-
-typedef struct PJconsts {
-    projCtx_t *ctx;
-	XY  (*fwd)(LP, struct PJconsts *);
-	LP  (*inv)(XY, struct PJconsts *);
-	void (*spc)(LP, struct PJconsts *, struct FACTORS *);
-	void (*pfree)(struct PJconsts *);
-	const char *descr;
-	paralist *params;   /* parameter list */
-	int over;   /* over-range flag */
-	int geoc;   /* geocentric latitude flag */
-        int is_latlong; /* proj=latlong ... not really a projection at all */
-        int is_geocent; /* proj=geocent ... not really a projection at all */
-	double
-		a,  /* major axis or radius if es==0 */
-                a_orig, /* major axis before any +proj related adjustment */
-		es, /* e ^ 2 */
-                es_orig, /* es before any +proj related adjustment */
-		e,  /* eccentricity */
-		ra, /* 1/A */
-		one_es, /* 1 - e^2 */
-		rone_es, /* 1/one_es */
-		lam0, phi0, /* central longitude, latitude */
-		x0, y0, /* easting and northing */
-		k0,	/* general scaling factor */
-		to_meter, fr_meter; /* cartesian scaling */
-    
-        int     datum_type; /* PJD_UNKNOWN/3PARAM/7PARAM/GRIDSHIFT/WGS84 */
-        double  datum_params[7];
-        struct _pj_gi **gridlist;
-        int     gridlist_count;
-
-        int     has_geoid_vgrids;
-        struct _pj_gi **vgridlist_geoid;
-        int     vgridlist_geoid_count;
-        double  vto_meter, vfr_meter;
-
-        double  from_greenwich; /* prime meridian offset (in radians) */
-        double  long_wrap_center; /* 0.0 for -180 to 180, actually in radians*/
-        int     is_long_wrap_set;
-        char    axis[4];
-        
-#ifdef PROJ_PARMS__
-PROJ_PARMS__
-#endif /* end of optional extensions */
-} PJ;
-
-/* public API */
-#include "proj_api.h"
-
-/* Generate pj_list external or make list from include file */
-#ifndef PJ_LIST_H
-extern struct PJ_LIST pj_list[];
-#else
-#define PROJ_HEAD(id, name) \
-    struct PJconsts *pj_##id(struct PJconsts*); extern char * const pj_s_##id;
-    
-#ifndef lint
-#define DO_PJ_LIST_ID
-#endif
-#include PJ_LIST_H
-#ifndef lint
-#undef DO_PJ_LIST_ID
-#endif
-#undef PROJ_HEAD
-#define PROJ_HEAD(id, name) {#id, pj_##id, &pj_s_##id},
-	struct PJ_LIST
-pj_list[] = {
-#include PJ_LIST_H
-		{0,     0,  0},
-	};
-#undef PROJ_HEAD
-#endif
-
-#ifndef PJ_ELLPS__
-extern struct PJ_ELLPS pj_ellps[];
-#endif
-
-#ifndef PJ_UNITS__
-extern struct PJ_UNITS pj_units[];
-#endif
-
-#ifndef PJ_DATUMS__
-extern struct PJ_DATUMS pj_datums[];
-extern struct PJ_PRIME_MERIDIANS pj_prime_meridians[];
-#endif
-
-#ifdef PJ_LIB__
-    /* repeatative projection code */
-#define PROJ_HEAD(id, name) static const char des_##id [] = name
-#define ENTRYA(name) \
-        C_NAMESPACE_VAR const char * const pj_s_##name = des_##name; \
-	C_NAMESPACE PJ *pj_##name(PJ *P) { if (!P) { \
-	if( (P = (PJ*) pj_malloc(sizeof(PJ))) != NULL) { \
-        memset( P, 0, sizeof(PJ) ); \
-	P->pfree = freeup; P->fwd = 0; P->inv = 0; \
-	P->spc = 0; P->descr = des_##name;
-#define ENTRYX } return P; } else {
-#define ENTRY0(name) ENTRYA(name) ENTRYX
-#define ENTRY1(name, a) ENTRYA(name) P->a = 0; ENTRYX
-#define ENTRY2(name, a, b) ENTRYA(name) P->a = 0; P->b = 0; ENTRYX
-#define ENDENTRY(p) } return (p); }
-#define E_ERROR(err) { pj_ctx_set_errno( P->ctx, err); freeup(P); return(0); }
-#define E_ERROR_0 { freeup(P); return(0); }
-#define F_ERROR { pj_ctx_set_errno( P->ctx, -20); return(xy); }
-#define I_ERROR { pj_ctx_set_errno( P->ctx, -20); return(lp); }
-#define FORWARD(name) static XY name(LP lp, PJ *P) { XY xy = {0.0,0.0}
-#define INVERSE(name) static LP name(XY xy, PJ *P) { LP lp = {0.0,0.0}
-#define FREEUP static void freeup(PJ *P) {
-#define SPECIAL(name) static void name(LP lp, PJ *P, struct FACTORS *fac)
-#endif
-#define MAX_TAB_ID 80
-typedef struct { float lam, phi; } FLP;
-typedef struct { int lam, phi; } ILP;
-
-struct CTABLE {
-	char id[MAX_TAB_ID]; /* ascii info */
-	LP ll;      /* lower left corner coordinates */
-	LP del;     /* size of cells */
-	ILP lim;    /* limits of conversion matrix */
-	FLP *cvs;   /* conversion matrix */
-};
-
-typedef struct _pj_gi {
-    char *gridname;   /* identifying name of grid, eg "conus" or ntv2_0.gsb */
-    char *filename;   /* full path to filename */
-    
-    const char *format; /* format of this grid, ie "ctable", "ntv1", 
-                           "ntv2" or "missing". */
-
-    int   grid_offset; /* offset in file, for delayed loading */
-
-    struct CTABLE *ct;
-
-    struct _pj_gi *next;
-    struct _pj_gi *child;
-} PJ_GRIDINFO;
-
-/* procedure prototypes */
-double dmstor(const char *, char **);
-double dmstor_ctx(projCtx ctx, const char *, char **);
-void set_rtodms(int, int);
-char *rtodms(char *, double, int, int);
-double adjlon(double);
-double aacos(projCtx,double), aasin(projCtx,double), asqrt(double), aatan2(double, double);
-PVALUE pj_param(projCtx ctx, paralist *, const char *);
-paralist *pj_mkparam(char *);
-int pj_ell_set(projCtx ctx, paralist *, double *, double *);
-int pj_datum_set(projCtx,paralist *, PJ *);
-int pj_prime_meridian_set(paralist *, PJ *);
-int pj_angular_units_set(paralist *, PJ *);
-
-paralist *pj_clone_paralist( const paralist* );
-paralist*pj_search_initcache( const char *filekey );
-void pj_insert_initcache( const char *filekey, const paralist *list);
-
-double *pj_enfn(double);
-double pj_mlfn(double, double, double, double *);
-double pj_inv_mlfn(projCtx, double, double, double *);
-double pj_qsfn(double, double, double);
-double pj_tsfn(double, double, double);
-double pj_msfn(double, double, double);
-double pj_phi2(projCtx, double, double);
-double pj_qsfn_(double, PJ *);
-double *pj_authset(double);
-double pj_authlat(double, double *);
-COMPLEX pj_zpoly1(COMPLEX, COMPLEX *, int);
-COMPLEX pj_zpolyd1(COMPLEX, COMPLEX *, int, COMPLEX *);
-FILE *pj_open_lib(projCtx, char *, char *);
-
-int pj_deriv(LP, double, PJ *, struct DERIVS *);
-int pj_factors(LP, PJ *, double, struct FACTORS *);
-
-struct PW_COEF {/* row coefficient structure */
-    int m;		/* number of c coefficients (=0 for none) */
-    double *c;	/* power coefficients */
-};
- 
-/* Approximation structures and procedures */
-typedef struct {	/* Chebyshev or Power series structure */
-	projUV a, b;		/* power series range for evaluation */
-					/* or Chebyshev argument shift/scaling */
-	struct PW_COEF *cu, *cv;
-	int mu, mv;		/* maximum cu and cv index (+1 for count) */
-	int power;		/* != 0 if power series, else Chebyshev */
-} Tseries;
-Tseries *mk_cheby(projUV, projUV, double, projUV *, projUV (*)(projUV), int, int, int);
-projUV bpseval(projUV, Tseries *);
-projUV bcheval(projUV, Tseries *);
-projUV biveval(projUV, Tseries *);
-void *vector1(int, int);
-void **vector2(int, int, int);
-void freev2(void **v, int nrows);
-int bchgen(projUV, projUV, int, int, projUV **, projUV(*)(projUV));
-int bch2bps(projUV, projUV, projUV **, int, int);
-/* nadcon related protos */
-LP nad_intr(LP, struct CTABLE *);
-LP nad_cvt(LP, int, struct CTABLE *);
-struct CTABLE *nad_init(projCtx ctx, char *);
-struct CTABLE *nad_ctable_init( projCtx ctx, FILE * fid );
-int nad_ctable_load( projCtx ctx, struct CTABLE *, FILE * fid );
-struct CTABLE *nad_ctable2_init( projCtx ctx, FILE * fid );
-int nad_ctable2_load( projCtx ctx, struct CTABLE *, FILE * fid );
-void nad_free(struct CTABLE *);
-
-/* higher level handling of datum grid shift files */
-
-int pj_apply_vgridshift( PJ *defn, const char *listname,
-                         PJ_GRIDINFO ***gridlist_p, 
-                         int *gridlist_count_p,
-                         int inverse, 
-                         long point_count, int point_offset,
-                         double *x, double *y, double *z );
-int pj_apply_gridshift_2( PJ *defn, int inverse, 
-                          long point_count, int point_offset,
-                          double *x, double *y, double *z );
-int pj_apply_gridshift_3( projCtx ctx, 
-                          PJ_GRIDINFO **gridlist, int gridlist_count,
-                          int inverse, long point_count, int point_offset,
-                          double *x, double *y, double *z );
-
-PJ_GRIDINFO **pj_gridlist_from_nadgrids( projCtx, const char *, int * );
-void pj_deallocate_grids();
-
-PJ_GRIDINFO *pj_gridinfo_init( projCtx, const char * );
-int pj_gridinfo_load( projCtx, PJ_GRIDINFO * );
-void pj_gridinfo_free( projCtx, PJ_GRIDINFO * );
-
-void *proj_mdist_ini(double);
-double proj_mdist(double, double, double, const void *);
-double proj_inv_mdist(projCtx ctx, double, const void *);
-void *pj_gauss_ini(double, double, double *,double *);
-LP pj_gauss(projCtx, LP, const void *);
-LP pj_inv_gauss(projCtx, LP, const void *);
-
-extern char const pj_release[];
-
-struct PJ_ELLPS *pj_get_ellps_ref( void );
-struct PJ_DATUMS *pj_get_datums_ref( void );
-struct PJ_UNITS *pj_get_units_ref( void );
-struct PJ_LIST  *pj_get_list_ref( void );
-struct PJ_PRIME_MERIDIANS  *pj_get_prime_meridians_ref( void );
- 
-#ifndef DISABLE_CVSID
-#  if defined(__GNUC__) && __GNUC__ >= 4
-#    define PJ_CVSID(string)     static char pj_cvsid[] __attribute__((used)) = string;
-#  else
-#    define PJ_CVSID(string)     static char pj_cvsid[] = string; \
-static char *cvsid_aw() { return( cvsid_aw() ? ((char *) NULL) : pj_cvsid ); }
-#  endif
-#else
-#  define PJ_CVSID(string)
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* end of basic projections header */
diff --git a/src/proj/rtodms.c b/src/proj/rtodms.c
deleted file mode 100644
index abf6bc1..0000000
--- a/src/proj/rtodms.c
+++ /dev/null
@@ -1,72 +0,0 @@
-/* Convert radian argument to DMS ascii format */
-#include <projects.h>
-#include <stdio.h>
-#include <string.h>
-/*
-** RES is fractional second figures
-** RES60 = 60 * RES
-** CONV = 180 * 3600 * RES / PI (radians to RES seconds)
-*/
-	static double
-RES = 1000.,
-RES60 = 60000.,
-CONV = 206264806.24709635515796003417;
-	static char
-format[50] = "%dd%d'%.3f\"%c";
-	static int
-dolong = 0;
-	void
-set_rtodms(int fract, int con_w) {
-	int i;
-
-	if (fract >= 0 && fract < 9 ) {
-		RES = 1.;
-		/* following not very elegant, but used infrequently */
-		for (i = 0; i < fract; ++i)
-			RES *= 10.;
-		RES60 = RES * 60.;
-		CONV = 180. * 3600. * RES / PI;
-		if (! con_w)
-			(void)sprintf(format,"%%dd%%d'%%.%df\"%%c", fract);
-		else
-			(void)sprintf(format,"%%dd%%02d'%%0%d.%df\"%%c",
-				fract+2+(fract?1:0), fract);
-		dolong = con_w;
-	}
-}
-	char *
-rtodms(char *s, double r, int pos, int neg) {
-	int deg, min, sign;
-	char *ss = s;
-	double sec;
-
-	if (r < 0) {
-		r = -r;
-		if  (!pos) { *ss++ = '-'; sign = 0; }
-		else sign = neg;
-	} else
-		sign = pos;
-	r = floor(r * CONV + .5);
-	sec = fmod(r / RES, 60.);
-	r = floor(r / RES60);
-	min = fmod(r, 60.);
-        r = floor(r / 60.);
-        deg = r;
-
-	if (dolong)
-		(void)sprintf(ss,format,deg,min,sec,sign);
-	else if (sec) {
-		char *p, *q;
-
-		(void)sprintf(ss,format,deg,min,sec,sign);
-		for (q = p = ss + strlen(ss) - (sign ? 3 : 2); *p == '0'; --p) ;
-		if (*p != '.')
-			++p;
-		if (++q != p)
-			(void)strcpy(p, q);
-	} else if (min)
-		(void)sprintf(ss,"%dd%d'%c",deg,min,sign);
-	else
-		(void)sprintf(ss,"%dd%c",deg, sign);
-	return s;
-}
diff --git a/src/proj/vector1.c b/src/proj/vector1.c
deleted file mode 100644
index b3023ee..0000000
--- a/src/proj/vector1.c
+++ /dev/null
@@ -1,29 +0,0 @@
-/* make storage for one and two dimensional matricies */
-#include <stdlib.h>
-#include <projects.h>
-	void * /* one dimension array */
-vector1(int nvals, int size) { return((void *)pj_malloc(size * nvals)); }
-	void /* free 2D array */
-freev2(void **v, int nrows) {
-	if (v) {
-		for (v += nrows; nrows > 0; --nrows)
-			pj_dalloc(*--v);
-		pj_dalloc(v);
-	}
-}
-	void ** /* two dimension array */
-vector2(int nrows, int ncols, int size) {
-	void **s;
-
-	if ((s = (void **)pj_malloc(sizeof(void *) * nrows)) != NULL) {
-		int rsize, i;
-
-		rsize = size * ncols;
-		for (i = 0; i < nrows; ++i)
-			if (!(s[i] = pj_malloc(rsize))) {
-				freev2(s, i);
-				return (void **)0;
-			}
-	}
-	return s;
-}
diff --git a/src/ps/.ps b/src/ps/.ps
deleted file mode 100644
index 2dbbf92..0000000
--- a/src/ps/.ps
+++ /dev/null
@@ -1,4296 +0,0 @@
-%!PS-Adobe-3.0
-%%Creator: groff version 1.19.2
-%%CreationDate: Fri May 17 00:30:29 2013
-%%DocumentNeededResources: font Times-Roman
-%%+ font Times-Bold
-%%+ font Times-Italic
-%%DocumentSuppliedResources: procset grops 1.19 2
-%%Pages: 63
-%%PageOrder: Ascend
-%%DocumentMedia: Default 612 792 0 () ()
-%%Orientation: Portrait
-%%EndComments
-%%BeginDefaults
-%%PageMedia: Default
-%%EndDefaults
-%%BeginProlog
-%%BeginResource: procset grops 1.19 2
-%!PS-Adobe-3.0 Resource-ProcSet
-/setpacking where{
-pop
-currentpacking
-true setpacking
-}if
-/grops 120 dict dup begin
-/SC 32 def
-/A/show load def
-/B{0 SC 3 -1 roll widthshow}bind def
-/C{0 exch ashow}bind def
-/D{0 exch 0 SC 5 2 roll awidthshow}bind def
-/E{0 rmoveto show}bind def
-/F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def
-/G{0 rmoveto 0 exch ashow}bind def
-/H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/I{0 exch rmoveto show}bind def
-/J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def
-/K{0 exch rmoveto 0 exch ashow}bind def
-/L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/M{rmoveto show}bind def
-/N{rmoveto 0 SC 3 -1 roll widthshow}bind def
-/O{rmoveto 0 exch ashow}bind def
-/P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/Q{moveto show}bind def
-/R{moveto 0 SC 3 -1 roll widthshow}bind def
-/S{moveto 0 exch ashow}bind def
-/T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/SF{
-findfont exch
-[exch dup 0 exch 0 exch neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/MF{
-findfont
-[5 2 roll
-0 3 1 roll
-neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/level0 0 def
-/RES 0 def
-/PL 0 def
-/LS 0 def
-/MANUAL{
-statusdict begin/manualfeed true store end
-}bind def
-/PLG{
-gsave newpath clippath pathbbox grestore
-exch pop add exch pop
-}bind def
-/BP{
-/level0 save def
-1 setlinecap
-1 setlinejoin
-72 RES div dup scale
-LS{
-90 rotate
-}{
-0 PL translate
-}ifelse
-1 -1 scale
-}bind def
-/EP{
-level0 restore
-showpage
-}def
-/DA{
-newpath arcn stroke
-}bind def
-/SN{
-transform
-.25 sub exch .25 sub exch
-round .25 add exch round .25 add exch
-itransform
-}bind def
-/DL{
-SN
-moveto
-SN
-lineto stroke
-}bind def
-/DC{
-newpath 0 360 arc closepath
-}bind def
-/TM matrix def
-/DE{
-TM currentmatrix pop
-translate scale newpath 0 0 .5 0 360 arc closepath
-TM setmatrix
-}bind def
-/RC/rcurveto load def
-/RL/rlineto load def
-/ST/stroke load def
-/MT/moveto load def
-/CL/closepath load def
-/Fr{
-setrgbcolor fill
-}bind def
-/setcmykcolor where{
-pop
-/Fk{
-setcmykcolor fill
-}bind def
-}if
-/Fg{
-setgray fill
-}bind def
-/FL/fill load def
-/LW/setlinewidth load def
-/Cr/setrgbcolor load def
-/setcmykcolor where{
-pop
-/Ck/setcmykcolor load def
-}if
-/Cg/setgray load def
-/RE{
-findfont
-dup maxlength 1 index/FontName known not{1 add}if dict begin
-{
-1 index/FID ne{def}{pop pop}ifelse
-}forall
-/Encoding exch def
-dup/FontName exch def
-currentdict end definefont pop
-}bind def
-/DEFS 0 def
-/EBEGIN{
-moveto
-DEFS begin
-}bind def
-/EEND/end load def
-/CNT 0 def
-/level1 0 def
-/PBEGIN{
-/level1 save def
-translate
-div 3 1 roll div exch scale
-neg exch neg exch translate
-0 setgray
-0 setlinecap
-1 setlinewidth
-0 setlinejoin
-10 setmiterlimit
-[]0 setdash
-/setstrokeadjust where{
-pop
-false setstrokeadjust
-}if
-/setoverprint where{
-pop
-false setoverprint
-}if
-newpath
-/CNT countdictstack def
-userdict begin
-/showpage{}def
-/setpagedevice{}def
-}bind def
-/PEND{
-countdictstack CNT sub{end}repeat
-level1 restore
-}bind def
-end def
-/setpacking where{
-pop
-setpacking
-}if
-%%EndResource
-%%EndProlog
-%%BeginSetup
-%%BeginFeature: *PageSize Default
-<< /PageSize [ 612 792 ] /ImagingBBox null >> setpagedevice
-%%EndFeature
-%%IncludeResource: font Times-Roman
-%%IncludeResource: font Times-Bold
-%%IncludeResource: font Times-Italic
-grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72
-def/PL 792 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron/Zcaron
-/scaron/zcaron/Ydieresis/trademark/quotesingle/Euro/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/space/exclam/quotedbl/numbersign/dollar/percent
-/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen
-/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon
-/semicolon/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O
-/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright/circumflex
-/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y
-/z/braceleft/bar/braceright/tilde/.notdef/quotesinglbase/guillemotleft
-/guillemotright/bullet/florin/fraction/perthousand/dagger/daggerdbl
-/endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut
-/dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash
-/quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen
-/brokenbar/section/dieresis/copyright/ordfeminine/guilsinglleft
-/logicalnot/minus/registered/macron/degree/plusminus/twosuperior
-/threesuperior/acute/mu/paragraph/periodcentered/cedilla/onesuperior
-/ordmasculine/guilsinglright/onequarter/onehalf/threequarters
-/questiondown/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE
-/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex
-/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis
-/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn
-/germandbls/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla
-/egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis
-/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide/oslash
-/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis]def
-/Times-Italic at 0 ENC0/Times-Italic RE/Times-Bold at 0 ENC0/Times-Bold RE
-/Times-Roman at 0 ENC0/Times-Roman RE
-%%EndSetup
-%%Page: 1 1
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F/F1 10.95/Times-Bold at 0 SF -.219(NA)72 84 S(ME).219 E
-/F2 10/Times-Bold at 0 SF(mbio)108 96 Q F0 2.5(-F)2.5 G
-(ormat independent input/output library for sw)-2.65 E
-(ath mapping sonar data.)-.1 E F1(VERSION)72 124.8 Q F0 -1.11(Ve)108
-136.8 S(rsion 5.0)1.11 E F1(DESCRIPTION)72 165.6 Q F2(MBIO)108 177.6 Q
-F0(\()3.843 E F2(M)A F0(ulti)A F2(B)A F0(eam)A F2(I)3.843 E F0(nput/)A
-F2(O)A F0 1.343
-(utput\) is a library of functions used for reading and writing sw)B
-1.342(ath mapping)-.1 F .702(sonar data \214les.)108 189.6 R F2(MBIO)
-5.702 E F0 .702(supports a lar)3.202 F .703
-(ge number of data formats associated with dif)-.18 F .703
-(ferent institutions and)-.25 F(dif)108 201.6 Q .438
-(ferent sonar systems.)-.25 F .438(The purpose of)5.438 F F2(MBIO)2.938
-E F0 .438(is to allo)2.938 F 2.937(wu)-.25 G .437
-(sers to write processing and display programs)-2.937 F 1.434
-(which are independent of particular data formats and to pro)108 213.6 R
-1.434(vide a standard approach to sw)-.15 F 1.434(ath mapping)-.1 F
-(sonar data i/o.)108 225.6 Q F1 -.548(AU)72 254.4 S(THORSHIP).548 E F0
-(Da)108 266.4 Q(vid W)-.2 E 2.5(.C)-.92 G(aress \(caress at mbari.or)-2.5 E
-(g\))-.18 E(Montere)113 278.4 Q 2.5(yB)-.15 G
-(ay Aquarium Research Institute)-2.5 E
-(Dale N. Chayes \(dale at ldeo.columbia.edu\))108 290.4 Q
-(Lamont-Doherty Earth Observ)113 302.4 Q(atory)-.25 E F1 -.383(DA)72
-331.2 S 1.972 -.986(TA T)-.657 H(ERMINOLOGY).986 E F2(MBIO)108 343.2 Q
-F0 .224(handles three types of sw)2.724 F .224(ath mapping data:)-.1 F
-.223(beam bath)5.224 F(ymetry)-.05 E 2.723(,b)-.65 G .223
-(eam amplitude, and sidescan.)-2.723 F(Both)5.223 E .173(amplitude and \
-sidescan represent measures of backscatter strength. Beam amplitudes ar\
-e backscatter v)108 355.2 R(alues)-.25 E .908
-(associated with the same preformed beams used to obtain bath)108 367.2
-R(ymetry;)-.05 E F2(MBIO)3.408 E F0 .907(assumes that a bath)3.408 F
-(ymetry)-.05 E -.25(va)108 379.2 S .138(lue e).25 F .138
-(xists for each amplitude v)-.15 F .138(alue and uses the bath)-.25 F
-.138(ymetry beam location for the amplitude.)-.05 F .139(Sidescan is)
-5.139 F .197
-(generally constructed with a higher spatial resolution than bath)108
-391.2 R(ymetry)-.05 E 2.696(,a)-.65 G .196(nd carries its o)-2.696 F
-.196(wn location parame-)-.25 F 3.811(ters. In)108 403.2 R 1.311
-(the conte)3.811 F 1.311(xt of)-.15 F F2(MB-System)3.811 E F0 1.311
-(documentation, the discrete v)3.811 F 1.312(alues of bath)-.25 F 1.312
-(ymetry and amplitude are)-.05 F .506
-(referred to as "beams", and the discrete v)108 415.2 R .506
-(alues of sidescan are referred to as "pix)-.25 F .505
-(els". An additional dif)-.15 F(fer)-.25 E(-)-.2 E .271
-(ence between "beam" and "pix)108 427.2 R .271(el" data in)-.15 F -.2
-(vo)-.4 G(lv).2 E .271
-(es data \215agging. An array of "beam\215ags" is carried by)-.15 F F2
-(MBIO)2.772 E F0 1.32(functions which allo)108 439.2 R 1.32(ws the bath)
--.25 F 1.32(ymetry \(and by e)-.05 F 1.32
-(xtension the amplitude\) data to be \215agged as bad. The)-.15 F
-(details of the beam\215agging scheme are presented belo)108 451.2 Q
--.65(w.)-.25 G F1(VERSION 5 CHANGES)72 480 Q F0 .426
-(This document describes v)108 492 R .426(ersion 5 releases of)-.15 F F2
-(MBIO)2.926 E F0 5.426(.T)C .426(he source code structure used in v)
--5.426 F .427(ersion 4)-.15 F F2(MBIO)2.927 E F0 1.46(had gro)108 504 R
-1.46(wn comple)-.25 F 3.96(xa)-.15 G 1.46(nd dif)-3.96 F 1.46
-(\214cult to support. In particular)-.25 F 3.959(,t)-.4 G 1.459
-(he addition of ne)-3.959 F 3.959(wi)-.25 G 1.459(/o modules had become)
--3.959 F -.15(ex)108 516 S(cessi).15 E -.15(ve)-.25 G .603
-(ly time consuming.).15 F(Consequently)5.604 E 3.104(,w)-.65 G 3.104(eh)
--3.104 G -2.25 -.2(av e)-3.104 H .604(restructured and re)3.304 F .604
-(written much of the library)-.25 F 5.604(.M)-.65 G(ost)-5.604 E 1.221
-(of the changes are internal, b)108 528 R 1.221(ut tw)-.2 F 6.221(of)-.1
-G 1.221(unction calls ha)-6.221 F 1.521 -.15(ve d)-.2 H 1.22
-(isappeared \().15 F F2(mb_put\(\))A F0(and)3.72 E F2(mb_write\(\))3.72
-E F0 1.22(\), and a)B(number of ne)108 540 Q 2.5(wf)-.25 G(unctions ha)
--2.5 E .3 -.15(ve b)-.2 H(een added.).15 E 3.493(Af)108 564 S .993
-(urther signi\214cant architectural change w)-3.493 F .993
-(as implemented for release 5.0.8 in order to support data for)-.1 F(-)
--.2 E .569(mats that ha)108 576 R .869 -.15(ve n)-.2 H 3.069(oe).15 G
-.569(xplicit maximum number of beams or pix)-3.219 F .568
-(els. The memory management of arrays used)-.15 F 1.486(to hold bath)108
-588 R(ymetry)-.05 E 3.986(,a)-.65 G 1.487
-(mplitude, and sidescan data has been made dynamic. No)-3.986 F 2.787
--.65(w, w)-.25 H 1.487(hen data records are).65 F .565
-(encountered that include lar)108 600 R .565
-(ger numbers of beams or pix)-.18 F .565
-(els than will \214t in the arrays pre)-.15 F .565(viously allocated,)
--.25 F .516(those arrays are reallocated to the required size. This is \
-handled automatically for all of the internal arrays)108 612 R 1.156
-(used by)108 624 R F2(MBIO)3.656 E F0 1.156
-(functions. Of course, applications using)3.656 F F2(MBIO)3.655 E F0
-1.155(must allocate arrays that are passed into)3.655 F .928
-(functions lik)108 636 R(e)-.1 E F2(mb_r)3.428 E(ead)-.18 E F0(,)A F2
-(mb_get_all)3.428 E F0 3.428(,a)C(nd)-3.428 E F2(mb_get)3.428 E F0 .928
-(to be populated by the desired data. In order for these)3.428 F .614
-(arrays to be managed dynamically)108 648 R 3.114(,t)-.65 G .614
-(he application must \214rst re)-3.114 F .613
-(gister each array by passing the location of)-.15 F
-(the array pointer to a ne)108 660 Q 2.5(wf)-.25 G(unction called)-2.5 E
-F2(mb_r)2.5 E(egister_array)-.18 E F0(.)A F1 -.548(OV)72 688.8 S(ER).548
-E(VIEW)-.602 E F2(MBIO)108 700.8 Q F0 .463(opens and initializes sonar \
-data \214les for reading and writing using the functions)2.962 F F2
-(mb_r)2.963 E(ead_init)-.18 E F0(and)2.963 E F2(mb_write_init)108 712.8
-Q F0 4.267(,r)C(especti)-4.267 E -.15(ve)-.25 G(ly).15 E 6.767(.T)-.65 G
-1.767
-(hese functions return a pointer to a data structure including all rele)
--6.767 F -.15(ve)-.25 G(nt).15 E .389(information about the opened \214\
-le, the control parameters which determine ho)108 724.8 R 2.889(wd)-.25
-G .389(ata is read or written, and)-2.889 F(MB-System 5.0)72 768 Q
-(26 October 2009)137.055 E(1)195.395 E 0 Cg EP
-%%Page: 2 2
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F .52
-(the arrays used for processing the data as it is read or written.)108
-84 R .52(This pointer is then passed to the functions)5.52 F .659
-(used for reading or writing.)108 96 R .659(There is no limit on the nu\
-mber of \214les which may be opened for reading or)5.659 F
-(writing at an)108 108 Q 2.5(yg)-.15 G -2.15 -.25(iv e)-2.5 H 2.5(nt).25
-G(ime in a program.)-2.5 E(The)108 132 Q/F1 10/Times-Bold at 0 SF(mb_r)
-4.953 E(ead_init)-.18 E F0(and)4.953 E F1(mb_write_init)4.953 E F0 2.453
-(functions also return initial maximum numbers of bath)4.953 F(ymetry)
--.05 E .54(beams, amplitude beams, and sidescan pix)108 144 R .541
-(els that can be used to allocate data storage arrays of the appro-)-.15
-F .119(priate sizes. Ho)108 156 R(we)-.25 E -.15(ve)-.25 G .919 -.4
-(r, f).15 H .119(or some data formats there are no speci\214ed maximum \
-numbers of beams and pix).4 F(els,)-.15 E .53(and so in general the req\
-uired dimensions may increase as data are read. Applications must pass \
-appropri-)108 168 R .192(ately dimensioned arrays into data e)108 180 R
-.191(xtraction routines such as)-.15 F F1(mb_r)2.691 E(ead)-.18 E F0(,)A
-F1(mb_get)2.691 E F0 2.691(,a)C(nd)-2.691 E F1(mb_get_all)2.691 E F0
-2.691(.I)C 2.691(no)-2.691 G(rder)-2.691 E .615(to enable dynamic memor\
-y management of thse application arrays, the application must \214rst r\
-e)108 192 R .615(gister each)-.15 F
-(array by passing the array pointer location to the function)108 204 Q
-F1(mb_r)2.5 E(egister_array)-.18 E F0(.)A .402
-(Data \214les are closed using the function)108 228 R F1(mb_close)2.901
-E F0 2.901(.A)C .401(ll internal and re)-2.901 F .401
-(gistered arrays are deallocated as part)-.15 F(of closing the \214le.)
-108 240 Q 1.163(When it comes to actually reading and writing sw)108 264
-R 1.164(ath mapping sonar data,)-.1 F F1(MBIO)3.664 E F0 1.164
-(has three le)3.664 F -.15(ve)-.25 G 1.164(ls of i/o).15 F
-(functionality:)108 276 Q 25.72(1: Simple)144 288 R(reading of sw)2.5 E
-(ath data \214les. The primary)-.1 E(functions are:)180 300 Q F1(mb_r)
-216 312 Q(ead\(\))-.18 E(mb_get\(\))216 324 Q F0(The positions of indi)
-180 336 Q(vidual beams and pix)-.25 E(els are)-.15 E
-(returned in longitude and latitude by)180 348 Q F1(mb_r)180 360 Q
-(ead\(\))-.18 E F0(and in acrosstrack and alongtrack)2.5 E(distances by)
-180 372 Q F1(mb_get\(\))2.5 E F0 2.5(.O)C(nly a limited set)-2.5 E
-(of na)180 384 Q(vig)-.2 E(ation information is returned. Comments)-.05
-E(are also returned. These functions can be used)180 396 Q(without an)
-180 408 Q 2.5(ys)-.15 G(pecial include)-2.5 E(\214les or an)5 E(y)-.15 E
-(kno)180 420 Q(wledge of the actual data structures used)-.25 E
-(by the data formats or)180 432 Q F1(MBIO)2.5 E F0(.)A 25.72
-(2: Complete)144 444 R(reading and writing of data structures)2.5 E
-(containing all of the a)180 456 Q -.25(va)-.2 G(ilable information.).25
-E(Data records may be read or written without)180 468 Q -.15(ex)180 480
-S(tracting an).15 E 2.5(yo)-.15 G 2.5(ft)-2.5 G(he information, or the)
--2.5 E(sw)180 492 Q(ath data may be passed with the data structure.)-.1
-E(Se)180 504 Q -.15(ve)-.25 G(ral functions e).15 E(xist to e)-.15 E
-(xtract information)-.15 E(from or insert information into the data)180
-516 Q(structures; otherwise, special include \214les)180 528 Q
-(are required to mak)180 540 Q 2.5(es)-.1 G(ense of the sonar)-2.5 E
-(-speci\214c)-.2 E(data structures passed by le)180 552 Q -.15(ve)-.25 G
-2.5(l2i).15 G(/o functions.)-2.5 E
-(The basic read and write functions that only pass)180 564 Q
-(pointers to internal data structures are:)180 576 Q F1(mb_r)216 588 Q
-(ead_ping\(\))-.18 E(mb_write_ping\(\))216 600 Q F0
-(The read and write routines which also e)180 612 Q(xtract)-.15 E
-(or insert information are:)180 624 Q F1(mb_get_all\(\))216 636 Q
-(mb_put_all\(\))216 648 Q(mb_put_comment\(\))216 660 Q F0
-(The information e)180 672 Q(xtraction and insertion)-.15 E
-(functions are:)180 684 Q F1(mb_insert\(\))216 696 Q(mb_extract\(\))216
-708 Q(mb_extract_na)216 720 Q(v\(\))-.25 E F0(MB-System 5.0)72 768 Q
-(26 October 2009)137.055 E(2)195.395 E 0 Cg EP
-%%Page: 3 3
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F/F1 10/Times-Bold at 0 SF(mb_insert_na)216 84 Q(v\(\))
--.25 E(mb_extract_altitude\(\))216 96 Q(mb_insert_altitude\(\))216 108 Q
-(mb_ttimes\(\))216 120 Q(mb_copyr)216 132 Q(ecord\(\))-.18 E F0 25.72
-(3: Buf)144 144 R(fered reading and writing of data structures)-.25 E
-(containing all of the a)180 156 Q -.25(va)-.2 G(ilable information.).25
-E(The primary functions are:)180 168 Q F1(mb_b)216 180 Q(uffer_init\(\))
--.2 E(mb_b)216 192 Q(uffer_close\(\))-.2 E(mb_b)216 204 Q
-(uffer_load\(\))-.2 E(mb_b)216 216 Q(uffer_dump\(\))-.2 E(mb_b)216 228 Q
-(uffer_inf)-.2 E(o\(\))-.25 E(mb_b)216 240 Q(uffer_get_next_data\(\))-.2
-E(mb_b)216 252 Q(uffer_extract\(\))-.2 E(mb_b)216 264 Q
-(uffer_insert\(\))-.2 E(mb_b)216 276 Q(uffer_get_next_na)-.2 E(v\(\))
--.25 E(mb_b)216 288 Q(uffer_extract_na)-.2 E(v\(\))-.25 E(mb_b)216 300 Q
-(uffer_insert_na)-.2 E(v\(\))-.25 E F0 .519(The le)108 324 R -.15(ve)
--.25 G 3.019(l1).15 G F1(MBIO)A F0 .518(functions allo)3.019 F 3.018(wu)
--.25 G .518(sers to read sonar data independent of format, with the lim\
-itation that)-3.018 F .577(only a limited set of na)108 336 R(vig)-.2 E
-.577(ation information is passed.)-.05 F .577
-(Thus, some of the information contained in certain)5.577 F .457
-(data formats \(e.g. the "hea)108 348 R -.15(ve)-.2 G 2.957("v).15 G
-.457(alue in Hydrosweep DS data\) is not passed by)-3.207 F F1(mb_r)
-2.957 E(ead\(\))-.18 E F0(or)2.957 E F1(mb_get\(\))2.957 E F0 5.457(.I)C
-(n)-5.457 E .292(general, the le)108 360 R -.15(ve)-.25 G 2.792(l1f).15
-G .293(unctions are useful for applications such as graphics which requ\
-ire only the na)-2.792 F(vig)-.2 E(ation)-.05 E
-(and the depth and/or backscatter v)108 372 Q(alues.)-.25 E .555(The le)
-108 396 R -.15(ve)-.25 G 3.055(l2f).15 G .555(unctions \()-3.055 F F1
-(mb_get_all\(\))A F0(and)3.054 E F1(mb_put_all\(\))3.054 E F0 3.054(\)r)
-C .554(ead and write the complete data structures, trans-)-3.054 F .22(\
-late the data to internal data structures associated with each of the s\
-upported sonar systems, and pass point-)108 408 R .049
-(ers to these internal data structures. Additional functions allo)108
-420 R 2.549(wav)-.25 G .048(ariety of information to be e)-2.799 F .048
-(xtracted from)-.15 F 1.794
-(or inserted into the data structures \(e.g. mb_e)108 432 R 1.795
-(xtract\(\) and mb_insert\(\)\). Additional information may be)-.15 F
-1.028(accessed using special include \214les to)108 444 R 1.028
-(decode the data structures.)6.028 F 1.028
-(The great majority of processing pro-)6.028 F(grams use le)108 456 Q
--.15(ve)-.25 G 2.5(l2f).15 G(unctions.)-2.5 E 1.076(The le)108 480 R
--.15(ve)-.25 G 3.576(l3f).15 G 1.076(unctions pro)-3.576 F 1.076(vide b)
--.15 F(uf)-.2 E 1.076(fered reading and writing which is useful for app\
-lications that generate)-.25 F 1.147
-(output \214les and need access to multiple pings at a time.)108 492 R
-1.147(In addition to reading \()6.147 F F1(mb_b)A(uffer_load\(\))-.2 E
-F0 3.646(\)a)C(nd)-3.646 E 8.79(writing \()108 504 R F1(mb_b)A
-(uffer_dump\(\))-.2 E F0 8.79(\), functions e)B 8.79(xist for e)-.15 F
-8.79(xtracting information from the b)-.15 F(uf)-.2 E(fer)-.25 E(\()108
-516 Q F1(mb_b)A(uffer_extract\(\))-.2 E F0 2.5(\)a)C
-(nd inserting information into the b)-2.5 E(uf)-.2 E(fer \()-.25 E F1
-(mb_b)A(uffer_insert\(\))-.2 E F0(\).)A F1(MBIO)108 540 Q F0 1.074
-(supports sw)3.574 F 1.074(ath data in a number of dif)-.1 F 1.073
-(ferent formats, each speci\214ed by a unique id number)-.25 F 3.573(.T)
--.55 G(he)-3.573 E(function)108 552 Q F1(mb_f)3.966 E(ormat\(\))-.25 E
-F0 1.466(determines if a format id is v)3.966 F 1.467
-(alid. A set of similar functions returns information)-.25 F 1.636
-(about the speci\214ed format \(e.g.)108 564 R F1(mb_f)4.136 E
-(ormat_description\(\))-.25 E F0(,)A F1(mb_f)4.135 E(ormat_system\(\))
--.25 E F0(,)A F1(mb_f)4.135 E(ormat_descrip-)-.25 E(tion\(\))108 576 Q
-F0(,)A F1(mb_f)2.827 E(ormat_dimensions\(\))-.25 E F0(,)A F1(mb_f)2.827
-E(ormat_\215ags\(\))-.25 E F0(,)A F1(mb_f)2.828 E(ormat_sour)-.25 E
-(ce\(\))-.18 E F0(,)A F1(mb_f)2.828 E(ormat_beamwidth\(\))-.25 E F0(\).)
-A(Some)108 600 Q F1(MB-System)2.553 E F0 .052(programs can process mult\
-iple data \214les speci\214ed in "datalist" \214les. Each line of a dat\
-al-)2.553 F .707
-(ist \214le contains a \214le path and the corresponding)108 612 R F1
-(MBIO)3.208 E F0 .708(format id. Datalist \214les can be recursi)3.208 F
-1.008 -.15(ve a)-.25 H .708(nd can).15 F 1.523
-(contain comments. The functions used to e)108 624 R 1.523
-(xtract input sw)-.15 F 1.522
-(ath data \214le paths from datalist \214les includes)-.1 F F1
-(mb_datalist_open\(\))108 636 Q F0(,)A F1(mb_datalist_r)2.5 E(ead\(\))
--.18 E F0 2.5(,a)C(nd)-2.5 E F1(mb_datalist_close\(\))2.5 E F0(.)A 3.11
-(An)108 660 S .61(umber of other)-3.11 F F1(MBIO)3.11 E F0 .61
-(functions dealing with def)3.11 F .61(ault v)-.1 F .61
-(alues for important parameters, error messages,)-.25 F
-(memory management, and time con)108 672 Q -.15(ve)-.4 G(rsions also e)
-.15 E(xist and are discussed belo)-.15 E -.65(w.)-.25 G/F2 10.95
-/Times-Bold at 0 SF(SUPPOR)72 700.8 Q(TED SW)-.438 E -1.04(AT)-1.314 G
-2.738(HS)1.04 G(ON)-2.738 E(AR SYSTEMS)-.219 E F0 .402(Each sw)108 712.8
-R .402
-(ath mapping sonar system outputs a data stream which includes some v)
--.1 F .402(alues or parameters unique)-.25 F .288(to that system.)108
-724.8 R .288(In general, a number of dif)5.288 F .288
-(ferent data formats ha)-.25 F .588 -.15(ve c)-.2 H .288
-(ome into use for data from each of the).15 F(MB-System 5.0)72 768 Q
-(26 October 2009)137.055 E(3)195.395 E 0 Cg EP
-%%Page: 4 4
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F .578(sonar systems; man)108 84 R 3.078(yo)-.15 G
-3.078(ft)-3.078 G .577
-(hese formats include only a subset of the original data stream.)-3.078
-F(Internally)5.577 E(,)-.65 E/F1 10/Times-Bold at 0 SF(MBIO)3.077 E F0 .651
-(recognizes which sonar system each data format is associated with and \
-uses a data structure including the)108 96 R .16
-(complete data stream for that sonar)108 108 R 5.16(.C)-.55 G
-(onsequently)-5.16 E 2.66(,i)-.65 G 2.659(ti)-2.66 G 2.659(sp)-2.659 G
-.159(ossible to read and write the complete data stream)-2.659 F .42
-(when using the le)108 120 R -.15(ve)-.25 G 2.92(l2o).15 G 2.92(r3)-2.92
-G F1(MBIO)A F0 2.921(functions. At)2.921 F .421
-(present, formats associated with the follo)2.921 F .421
-(wing sonars are)-.25 F(supported:)108 132 Q
-(SeaBeam "classic" 16 beam multibeam sonar)144 144 Q
-(Hydrosweep DS 59 beam multibeam sonar)144 156 Q
-(Hydrosweep MD 40 beam mid-depth multibeam)144 168 Q(sonar)180 180 Q
-(SeaBeam 2000 multibeam sonar)144 192 Q
-(SeaBeam 2112, 2120, and 2130 multibeam)144 204 Q(sonars)180 216 Q
-(Simrad EM12, EM121, EM950, and EM1000)144 228 Q(multibeam sonars)180
-240 Q(Simrad EM120, EM300, EM1002, and EM3000)144 252 Q
-(multibeam sonars)180 264 Q(Ha)144 276 Q -.1(wa)-.15 G(ii MR-1 shallo).1
-E 2.5(wt)-.25 G .5 -.25(ow i)-2.5 H(nterferometric).25 E(sonar)180 288 Q
-(ELA)144 300 Q 2.5(CB)-.4 G(ottomchart 1180 and 1050 multibeam)-2.5 E
-(sonars)180 312 Q(ELA)144 324 Q(C/SeaBeam Bottomchart Mk2 1180 and)-.4 E
-(1050 multibeam sonars)180 336 Q
-(Reson Seabat 9001/9002 multibeam sonars)144 348 Q
-(Reson Seabat 8101 multibeam sonars)144 360 Q
-(Simrad/Mesotech SM2000 multibeam sonars)144 372 Q
-(WHOI DSL AMS-120 deep to)144 384 Q 2.5(wi)-.25 G(nterferometric)-2.5 E
-36(sonar AMS-60)180 396 R(interferometric sonar)2.5 E/F2 10.95
-/Times-Bold at 0 SF(SUPPOR)72 412.8 Q(TED FORMA)-.438 E(TS)-1.04 E F0
-(The follo)108 424.8 Q(wing sw)-.25 E
-(ath mapping sonar data formats are supported in this v)-.1 E(ersion of)
--.15 E F1(MBIO)2.5 E F0(:)A(MBIO Data F)118 448.8 Q(ormat ID:)-.15 E(11)
-5 E -.15(Fo)118 460.8 S(rmat name:).15 E(MBF_SBSIOMRG)25 E
-(Informal Description: SIO mer)118 472.8 Q(ge Sea Beam)-.18 E(Attrib)118
-484.8 Q 25(utes: Sea)-.2 F(Beam, bath)2.5 E(ymetry)-.05 E 2.5(,1)-.65 G
-2.5(6b)-2.5 G(eams,)-2.5 E(binary)173 496.8 Q 2.5(,u)-.65 G
-(ncentered, SIO.)-2.5 E(MBIO Data F)118 520.8 Q(ormat ID:)-.15 E(12)5 E
--.15(Fo)118 532.8 S(rmat name:).15 E(MBF_SBSIOCEN)25 E
-(Informal Description: SIO centered Sea Beam)118 544.8 Q(Attrib)118
-556.8 Q 25(utes: Sea)-.2 F(Beam, bath)2.5 E(ymetry)-.05 E 2.5(,1)-.65 G
-2.5(9b)-2.5 G(eams,)-2.5 E(binary)173 568.8 Q 2.5(,c)-.65 G
-(entered, SIO.)-2.5 E(MBIO Data F)118 592.8 Q(ormat ID:)-.15 E(13)5 E
--.15(Fo)118 604.8 S(rmat name:).15 E(MBF_SBSIOLSI)25 E
-(Informal Description: SIO LSI Sea Beam)118 616.8 Q(Attrib)118 628.8 Q
-25(utes: Sea)-.2 F(Beam, bath)2.5 E(ymetry)-.05 E 2.5(,1)-.65 G 2.5(9b)
--2.5 G(eams,)-2.5 E(binary)173 640.8 Q 2.5(,c)-.65 G
-(entered, obsolete, SIO.)-2.5 E(MBIO Data F)118 664.8 Q(ormat ID:)-.15 E
-(14)5 E -.15(Fo)118 676.8 S(rmat name:).15 E(MBF_SB)25 E(URICEN)-.1 E
-(Informal Description: URI Sea Beam)118 688.8 Q(Attrib)118 700.8 Q 25
-(utes: Sea)-.2 F(Beam, bath)2.5 E(ymetry)-.05 E 2.5(,1)-.65 G 2.5(9b)
--2.5 G(eams,)-2.5 E(binary)173 712.8 Q 2.5(,c)-.65 G(entered, URI.)-2.5
-E(MB-System 5.0)72 768 Q(26 October 2009)137.055 E(4)195.395 E 0 Cg EP
-%%Page: 5 5
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F(MBIO Data F)118 84 Q(ormat ID:)-.15 E(15)5 E -.15
-(Fo)118 96 S(rmat name:).15 E(MBF_SB)25 E(URIV)-.1 E(AX)-1.35 E
-(Informal Description: URI Sea Beam from V)118 108 Q(AX)-1.35 E(Attrib)
-118 120 Q 25(utes: Sea)-.2 F(Beam, bath)2.5 E(ymetry)-.05 E 2.5(,1)-.65
-G 2.5(9b)-2.5 G(eams,)-2.5 E(binary)173 132 Q 2.5(,c)-.65 G(entered,)
--2.5 E -1.35(VA)173 144 S 2.5(Xb)1.35 G(yte order)-2.5 E 2.5(,U)-.4 G
-(RI.)-2.5 E(MBIO Data F)118 168 Q(ormat ID:)-.15 E(16)5 E -.15(Fo)118
-180 S(rmat name:).15 E(MBF_SBSIOSWB)25 E(Informal Description: SIO Sw)
-118 192 Q(ath-bath)-.1 E 2.5(yS)-.05 G(eaBeam)-2.5 E(Attrib)118 204 Q 25
-(utes: Sea)-.2 F(Beam, bath)2.5 E(ymetry)-.05 E 2.5(,1)-.65 G 2.5(9b)
--2.5 G(eams,)-2.5 E(binary)173 216 Q 2.5(,c)-.65 G(entered, SIO.)-2.5 E
-(MBIO Data F)118 240 Q(ormat ID:)-.15 E(17)5 E -.15(Fo)118 252 S
-(rmat name:).15 E(MBF_SBIFREMR)25 E(Informal Description: IFREMER Archi)
-118 264 Q .3 -.15(ve S)-.25 H(eaBeam).15 E(Attrib)118 276 Q 25
-(utes: Sea)-.2 F(Beam, bath)2.5 E(ymetry)-.05 E 2.5(,1)-.65 G 2.5(9b)
--2.5 G(eams,)-2.5 E(ascii, centered, IFREMER.)173 288 Q(MBIO Data F)118
-312 Q(ormat ID:)-.15 E(21)5 E -.15(Fo)118 324 S(rmat name:).15 E
-(MBF_HSA)25 E(TLRA)-1.11 E(W)-.9 E(Informal Description: Ra)118 336 Q
-2.5(wH)-.15 G(ydrosweep)-2.5 E(Attrib)118 348 Q 25(utes: Hydrosweep)-.2
-F(DS, bath)2.5 E(ymetry and)-.05 E(amplitude, 59 beams, ascii,)173 360 Q
-(Atlas Electronik.)173 372 Q(MBIO Data F)118 396 Q(ormat ID:)-.15 E(22)5
-E -.15(Fo)118 408 S(rmat name:).15 E(MBF_HSLDEDMB)25 E
-(Informal Description: EDMB Hydrosweep)118 420 Q(Attrib)118 432 Q 25
-(utes: Hydrosweep)-.2 F(DS, bath)2.5 E(ymetry)-.05 E(,)-.65 E
-(59 beams, binary)173 444 Q 2.5(,N)-.65 G(RL.)-2.5 E(MBIO Data F)118 468
-Q(ormat ID:)-.15 E(23)5 E -.15(Fo)118 480 S(rmat name:).15 E
-(MBF_HSURICEN)25 E(Informal Description: URI Hydrosweep)118 492 Q
-(Attrib)118 504 Q 25(utes: Hydrosweep)-.2 F(DS, 59 beams,)2.5 E(bath)173
-516 Q(ymetry)-.05 E 2.5(,b)-.65 G(inary)-2.5 E 2.5(,U)-.65 G(RI.)-2.5 E
-(MBIO Data F)118 540 Q(ormat ID:)-.15 E(24)5 E -.15(Fo)118 552 S
-(rmat name:).15 E(MBF_HSLDEOIH)25 E
-(Informal Description: L-DEO in-house binary Hydrosweep)118 564 Q
-(Attrib)118 576 Q 25(utes: Hydrosweep)-.2 F(DS, 59 beams,)2.5 E(bath)173
-588 Q(ymetry and amplitude,)-.05 E(binary)221 600 Q 2.5(,c)-.65 G
-(entered, L-DEO.)-2.5 E(MBIO Data F)118 624 Q(ormat ID:)-.15 E(25)5 E
--.15(Fo)118 636 S(rmat name:).15 E(MBF_HSURIV)25 E(AX)-1.35 E
-(Informal Description: URI Hydrosweep from V)118 648 Q(AX)-1.35 E
-(Attrib)118 660 Q 25(utes: Hydrosweep)-.2 F(DS, 59 beams,)2.5 E(bath)173
-672 Q(ymetry)-.05 E 2.5(,b)-.65 G(inary)-2.5 E 2.5(,V)-.65 G(AX byte)
--3.85 E(order)173 684 Q 2.5(,U)-.4 G(RI.)-2.5 E(MBIO Data F)118 708 Q
-(ormat ID:)-.15 E(32)5 E -.15(Fo)118 720 S(rmat name:).15 E
-(MBF_SB2000SB)25 E(MB-System 5.0)72 768 Q(26 October 2009)137.055 E(5)
-195.395 E 0 Cg EP
-%%Page: 6 6
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F(Informal Description: SIO Sw)118 84 Q(ath-bath)-.1
-E 2.5(yS)-.05 G(eaBeam 2000)-2.5 E(Attrib)118 96 Q 25(utes: SeaBeam)-.2
-F(2000, bath)2.5 E(ymetry)-.05 E 2.5(,1)-.65 G(21)-2.5 E(beams, binary)
-173 108 Q 5(,S)-.65 G(IO.)-5 E(MBIO Data F)118 132 Q(ormat ID:)-.15 E
-(33)5 E -.15(Fo)118 144 S(rmat name:).15 E(MBF_SB2000SS)25 E
-(Informal Description: SIO Sw)118 156 Q(ath-bath)-.1 E 2.5(yS)-.05 G
-(eaBeam 2000)-2.5 E(Attrib)118 168 Q 25(utes: SeaBeam)-.2 F
-(2000, sidescan,)2.5 E(1000 pix)173 180 Q(els for 4-bit)-.15 E
-(sidescan, 2000 pix)173 192 Q(els for)-.15 E(12+-bit sidescan, binary)
-173 204 Q(,)-.65 E(SIO.)173 216 Q(MBIO Data F)118 240 Q(ormat ID:)-.15 E
-(41)5 E -.15(Fo)118 252 S(rmat name:).15 E(MBF_SB2100R)25 E(W)-.55 E
-(Informal Description: SeaBeam 2100 series v)118 264 Q(ender format)-.15
-E(Attrib)118 276 Q 25(utes: SeaBeam)-.2 F(2100, bath)2.5 E(ymetry)-.05 E
-(,)-.65 E(amplitude and sidescan,)173 288 Q(151 beams and 2000 pix)173
-300 Q(els,)-.15 E(ascii with binary sidescan,)173 312 Q
-(SeaBeam Instruments.)173 324 Q(MBIO Data F)118 348 Q(ormat ID:)-.15 E
-(42)5 E -.15(Fo)118 360 S(rmat name:).15 E(MBF_SB2100B1)25 E
-(Informal Description: SeaBeam 2100 series v)118 372 Q(ender format)-.15
-E(Attrib)118 384 Q 25(utes: SeaBeam)-.2 F(2100, bath)2.5 E(ymetry)-.05 E
-(,)-.65 E(amplitude and sidescan,)173 396 Q(151 beams bath)173 408 Q
-(ymetry)-.05 E(,)-.65 E(2000 pix)173 420 Q(els sidescan, binary)-.15 E
-(,)-.65 E(SeaBeam Instruments and L-DEO.)173 432 Q(MBIO Data F)118 456 Q
-(ormat ID:)-.15 E(43)5 E -.15(Fo)118 468 S(rmat name:).15 E
-(MBF_SB2100B2)25 E(Informal Description: SeaBeam 2100 series v)118 480 Q
-(ender format)-.15 E(Attrib)118 492 Q 25(utes: SeaBeam)-.2 F(2100, bath)
-2.5 E(ymetry and)-.05 E(amplitude, 151 beams bath)173 504 Q(ymetry)-.05
-E(,)-.65 E(binary)173 516 Q 2.5(,S)-.65 G(eaBeam Instruments)-2.5 E
-(and L-DEO.)173 528 Q(MBIO Data F)118 552 Q(ormat ID:)-.15 E(51)5 E -.15
-(Fo)118 564 S(rmat name:).15 E(MBF_EMOLDRA)25 E(W)-.9 E
-(Informal Description: Old Simrad v)118 576 Q(endor multibeam format)
--.15 E(Attrib)118 588 Q 25(utes: Simrad)-.2 F(EM1000, EM12S, EM12D,)2.5
-E(and EM121 multibeam sonars,)173 600 Q(bath)173 612 Q(ymetry)-.05 E 2.5
-(,a)-.65 G(mplitude, and)-2.5 E(sidescan, 60 beams for EM1000,)173 624 Q
-(81 beams for EM12S/D, 121 beams)173 636 Q(for EM121, v)173 648 Q
-(ariable pix)-.25 E(els,)-.15 E(ascii + binary)173 660 Q 2.5(,S)-.65 G
-(imrad.)-2.5 E(MBIO Data F)118 684 Q(ormat ID:)-.15 E(53)5 E -.15(Fo)118
-696 S(rmat name:).15 E(MBF_EM12IFRM)25 E
-(Informal Description: IFREMER TRISMUS format for)118 708 Q(Simrad EM12)
-173 720 Q(MB-System 5.0)72 768 Q(26 October 2009)137.055 E(6)195.395 E 0
-Cg EP
-%%Page: 7 7
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F(Attrib)118 84 Q 25(utes: Simrad)-.2 F
-(EM12S and EM12D,)2.5 E(bath)173 96 Q(ymetry)-.05 E 2.5(,a)-.65 G
-(mplitude, and)-2.5 E(sidescan 81 beams, v)173 108 Q(ariable)-.25 E(pix)
-173 120 Q(els, binary)-.15 E 2.5(,I)-.65 G(FREMER.)-2.5 E(MBIO Data F)
-118 144 Q(ormat ID:)-.15 E(54)5 E -.15(Fo)118 156 S(rmat name:).15 E
-(MBF_EM12D)25 E(AR)-.4 E(W)-.55 E
-(Informal Description: Simrad EM12S RRS Darwin)118 168 Q
-(processed format)173 180 Q(Attrib)118 192 Q 25(utes: Simrad)-.2 F
-(EM12S, bath)2.5 E(ymetry)-.05 E(and amplitude, 81 beams,)173 204 Q
-(binary)173 216 Q 2.5(,O)-.65 G(xford Uni)-2.5 E -.15(ve)-.25 G(rsity)
-.15 E(.)-.65 E(MBIO Data F)118 240 Q(ormat ID:)-.15 E(56)5 E -.15(Fo)118
-252 S(rmat name:).15 E(MBF_EM300RA)25 E(W)-.9 E
-(Informal Description: Simrad current multibeam)118 264 Q -.15(ve)173
-276 S(ndor format).15 E(Attrib)118 288 Q 25(utes: Simrad)-.2 F
-(EM120, EM300, EM1002,)2.5 E(EM3000, bath)173 300 Q(ymetry)-.05 E 2.5
-(,a)-.65 G(mplitude,)-2.5 E(and sidescan, up to 254 beams,)173 312 Q
--.25(va)173 324 S(riable pix).25 E(els, ascii + binary)-.15 E(,)-.65 E
-(Simrad.)173 336 Q(MBIO Data F)118 360 Q(ormat ID:)-.15 E(57)5 E -.15
-(Fo)118 372 S(rmat name:).15 E(MBF_EM300MB)25 E(A)-.35 E
-(Informal Description: Simrad multibeam processing format)118 384 Q
-(Attrib)118 396 Q 25(utes: Old)-.2 F(and ne)2.5 E 2.5(wS)-.25 G
-(imrad multibeams,)-2.5 E(EM12S, EM12D, EM121, EM120,)221 408 Q
-(EM300, EM100, EM1000, EM950,)173 420 Q(EM1002, EM3000, bath)173 432 Q
-(ymetry)-.05 E(,)-.65 E(amplitude, and sidescan,)173 444 Q
-(up to 254 beams, v)173 456 Q(ariable pix)-.25 E(els,)-.15 E
-(ascii + binary)173 468 Q 2.5(,M)-.65 G -.35(BA)-2.5 G(RI.).35 E
-(MBIO Data F)118 492 Q(ormat ID:)-.15 E(58)5 E -.15(Fo)118 504 S
-(rmat name:).15 E(MBF_EM710RA)25 E(W)-.9 E
-(Informal Description: Simrad current multibeam v)118 516 Q
-(endor format)-.15 E(Attrib)118 528 Q 25(utes: Simrad)-.2 F(EM710,)2.5 E
-(bath)173 540 Q(ymetry)-.05 E 2.5(,a)-.65 G(mplitude, and sidescan,)-2.5
-E(up to 400 beams, v)173 552 Q(ariable pix)-.25 E(els,)-.15 E(binary)221
-564 Q 2.5(,S)-.65 G(imrad.)-2.5 E(MBIO Data F)118 588 Q(ormat ID:)-.15 E
-(59)5 E -.15(Fo)118 600 S(rmat name:).15 E(MBF_EM710MB)25 E(A)-.35 E
-(Informal Description: Simrad current multibeam v)118 612 Q
-(endor format)-.15 E(Attrib)118 624 Q 25(utes: Simrad)-.2 F(EM710,)2.5 E
-(bath)173 636 Q(ymetry)-.05 E 2.5(,a)-.65 G(mplitude, and sidescan,)-2.5
-E(up to 400 beams, v)173 648 Q(ariable pix)-.25 E(els,)-.15 E(binary)221
-660 Q 2.5(,S)-.65 G(imrad.)-2.5 E(MBIO Data F)118 684 Q(ormat ID:)-.15 E
-(61)5 E -.15(Fo)118 696 S(rmat name:).15 E(MBF_MR1PRHIG)25 E
-(Informal Description: SOEST MR1 post processed format)118 708 Q(Attrib)
-118 720 Q 25(utes: SOEST)-.2 F(MR1, bath)2.5 E(ymetry and)-.05 E
-(MB-System 5.0)72 768 Q(26 October 2009)137.055 E(7)195.395 E 0 Cg EP
-%%Page: 8 8
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F(sidescan, v)173 84 Q(ariable beams and)-.25 E(pix)
-173 96 Q(els, xdr binary)-.15 E 2.5(,S)-.65 G(OEST)-2.5 E(,)-.74 E(Uni)
-173 108 Q -.15(ve)-.25 G(rsity of Ha).15 E -.1(wa)-.15 G(ii.).1 E
-(MBIO Data F)118 132 Q(ormat ID:)-.15 E(62)5 E -.15(Fo)118 144 S
-(rmat name:).15 E(MBF_MR1ALDEO)25 E
-(Informal Description: L-DEO MR1 post processed)118 156 Q
-(format with tra)173 168 Q -.15(ve)-.2 G 2.5(lt).15 G(imes)-2.5 E
-(Attrib)118 180 Q 25(utes: L-DEO)-.2 F(MR1, bath)2.5 E(ymetry and)-.05 E
-(sidescan, v)173 192 Q(ariable beams)-.25 E(and pix)173 204 Q
-(els, xdr binary)-.15 E 2.5(,L)-.65 G(-DEO.)-2.5 E(MBIO Data F)118 228 Q
-(ormat ID:)-.15 E(63)5 E -.15(Fo)118 240 S(rmat name:).15 E
-(MBF_MR1BLDEO)25 E(Informal Description: L-DEO small MR1 post processed)
-118 252 Q(format with tra)173 264 Q -.15(ve)-.2 G 2.5(lt).15 G(imes)-2.5
-E(Attrib)118 276 Q 25(utes: L-DEO)-.2 F(MR1, bath)2.5 E
-(ymetry and sidescan,)-.05 E -.25(va)173 288 S(riable beams and pix).25
-E(els,)-.15 E(xdr binary)173 300 Q 2.5(,L)-.65 G(-DEO.)-2.5 E
-(MBIO Data F)118 324 Q(ormat ID:)-.15 E(64)5 E -.15(Fo)118 336 S
-(rmat name:).15 E(MBF_MR1PR)25 E(VR2)-.8 E
-(Informal Description: SOEST MR1 post processed format)118 348 Q(Attrib)
-118 360 Q 25(utes: SOEST)-.2 F(MR1, bath)2.5 E(ymetry and sidescan,)-.05
-E -.25(va)173 372 S(riable beams and pix).25 E(els, xdr binary)-.15 E(,)
--.65 E(SOEST)173 384 Q 2.5(,U)-.74 G(ni)-2.5 E -.15(ve)-.25 G
-(rsity of Ha).15 E -.1(wa)-.15 G(ii.).1 E(MBIO Data F)118 408 Q
-(ormat ID:)-.15 E(71)5 E -.15(Fo)118 420 S(rmat name:).15 E
-(MBF_MBLDEOIH)25 E
-(Informal Description: L-DEO in-house generic multibeam)118 432 Q
-(Attrib)118 444 Q 25(utes: Data)-.2 F(from all sonar systems,)2.5 E
-(bath)173 456 Q(ymetry)-.05 E 2.5(,a)-.65 G(mplitude and)-2.5 E
-(sidescan, v)173 468 Q(ariable beams and)-.25 E(pix)173 480 Q
-(els, binary)-.15 E 2.5(,c)-.65 G(entered, L-DEO.)-2.5 E(MBIO Data F)118
-504 Q(ormat ID:)-.15 E(75)5 E -.15(Fo)118 516 S(rmat name:).15 E
-(MBF_MBNETCDF)25 E(Informal Description: CARAIBES CDF multibeam)118 528
-Q(Attrib)118 540 Q 25(utes: Data)-.2 F(from all sonar systems,)2.5 E
-(bath)173 552 Q(ymetry only)-.05 E 2.5(,v)-.65 G(ariable)-2.75 E
-(beams, netCDF)173 564 Q 2.5(,I)-.8 G(FREMER.)-2.5 E(MBIO Data F)118 588
-Q(ormat ID:)-.15 E(81)5 E -.15(Fo)118 600 S(rmat name:).15 E(MBF_CB)25 E
--1.11(AT)-.35 G(9001)1.11 E
-(Informal Description: Reson SeaBat 9001 shallo)118 612 Q(w)-.25 E -.1
-(wa)173 624 S(ter multibeam).1 E(Attrib)118 636 Q 25(utes: 60)-.2 F
-(beam bath)2.5 E(ymetry and)-.05 E(amplitude, binary)173 648 Q 2.5(,U)
--.65 G(ni)-2.5 E -.15(ve)-.25 G(rsity).15 E(of Ne)173 660 Q 2.5(wB)-.25
-G(runswick.)-2.5 E(MBIO Data F)118 684 Q(ormat ID:)-.15 E(82)5 E -.15
-(Fo)118 696 S(rmat name:).15 E(MBF_CB)25 E -1.11(AT)-.35 G(8101)1.11 E
-(Informal Description: Reson SeaBat 8101 shallo)118 708 Q(w)-.25 E -.1
-(wa)173 720 S(ter multibeam).1 E(MB-System 5.0)72 768 Q(26 October 2009)
-137.055 E(8)195.395 E 0 Cg EP
-%%Page: 9 9
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F(Attrib)118 84 Q 25(utes: 101)-.2 F(beam bath)2.5 E
-(ymetry and)-.05 E(amplitude, binary)173 96 Q 2.5(,S)-.65 G(eaBeam)-2.5
-E(Instruments.)173 108 Q(MBIO Data F)118 132 Q(ormat ID:)-.15 E(83)5 E
--.15(Fo)118 144 S(rmat name:).15 E(MBF_HYPC8101)25 E
-(Informal Description: Reson SeaBat 8101 shallo)118 156 Q(w)-.25 E -.1
-(wa)173 168 S(ter multibeam).1 E(Attrib)118 180 Q 25(utes: 101)-.2 F
-(beam bath)2.5 E(ymetry)-.05 E(,)-.65 E(ASCII, read-only)173 192 Q 2.5
-(,C)-.65 G(oastal)-2.5 E(Oceanographics.)173 204 Q(MBIO Data F)118 228 Q
-(ormat ID:)-.15 E(84)5 E -.15(Fo)118 240 S(rmat name:).15 E
-(MBF_XTFR8101)25 E(Informal Description: XTF format Reson SeaBat 81XX)
-118 252 Q(Attrib)118 264 Q 25(utes: 240)-.2 F(beam bath)2.5 E
-(ymetry and amplitude,)-.05 E(1024 pix)173 276 Q(el sidescan)-.15 E
-(binary)173 288 Q 2.5(,r)-.65 G(ead-only)-2.5 E(,)-.65 E -.35(Tr)173 300
-S(iton-Elics.).35 E(MBIO Data F)118 324 Q(ormat ID:)-.15 E(88)5 E -.15
-(Fo)118 336 S(rmat name:).15 E(MBF_RESON7KR)25 E
-(Informal Description: Reson 7K multibeam v)118 348 Q(endor format)-.15
-E(Attrib)118 360 Q 25(utes: Reson)-.2 F(7K series multibeam sonars,)2.5
-E(bath)173 372 Q(ymetry)-.05 E 2.5(,a)-.65 G(mplitude, three)-2.5 E
-(channels sidescan, and subbottom)173 384 Q(up to 254 beams, v)173 396 Q
-(ariable pix)-.25 E(els,)-.15 E(binary)173 408 Q 2.5(,R)-.65 G(eson.)
--2.5 E(MBIO Data F)118 432 Q(ormat ID:)-.15 E(91)5 E -.15(Fo)118 444 S
-(rmat name:).15 E(MBF_BCHR)25 E(TUNB)-.6 E
-(Informal Description: Elac BottomChart shallo)118 456 Q(w)-.25 E -.1
-(wa)173 468 S(ter multibeam).1 E(Attrib)118 480 Q 25(utes: 56)-.2 F
-(beam bath)2.5 E(ymetry and)-.05 E(amplitude, binary)173 492 Q 2.5(,U)
--.65 G(ni)-2.5 E -.15(ve)-.25 G(rsity).15 E(of Ne)173 504 Q 2.5(wB)-.25
-G(runswick.)-2.5 E(MBIO Data F)118 528 Q(ormat ID:)-.15 E(92)5 E -.15
-(Fo)118 540 S(rmat name:).15 E(MBF_ELMK2UNB)25 E
-(Informal Description: Elac BottomChart MkII shallo)118 552 Q(w)-.25 E
--.1(wa)173 564 S(ter multibeam).1 E(Attrib)118 576 Q 25(utes: 126)-.2 F
-(beam bath)2.5 E(ymetry and)-.05 E(amplitude, binary)173 588 Q 2.5(,U)
--.65 G(ni)-2.5 E -.15(ve)-.25 G(rsity).15 E(of Ne)173 600 Q 2.5(wB)-.25
-G(runswick.)-2.5 E(MBIO Data F)118 624 Q(ormat ID:)-.15 E(93)5 E -.15
-(Fo)118 636 S(rmat name:).15 E(MBF_BCHRXUNB)25 E
-(Informal Description: Elac BottomChart shallo)118 648 Q(w)-.25 E -.1
-(wa)173 660 S(ter multibeam).1 E(Attrib)118 672 Q 25(utes: 56)-.2 F
-(beam bath)2.5 E(ymetry and)-.05 E(amplitude, binary)173 684 Q 2.5(,U)
--.65 G(ni)-2.5 E -.15(ve)-.25 G(rsity).15 E(of Ne)173 696 Q 2.5(wB)-.25
-G(runswick.)-2.5 E(MBIO Data F)118 720 Q(ormat ID:)-.15 E(94)5 E
-(MB-System 5.0)72 768 Q(26 October 2009)137.055 E(9)195.395 E 0 Cg EP
-%%Page: 10 10
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F -.15(Fo)118 84 S(rmat name:).15 E(MBF_L3XSERA)25 E
-(W)-.9 E(Informal Description: ELA)118 96 Q(C/SeaBeam XSE v)-.4 E
-(endor format)-.15 E(Attrib)118 108 Q 25(utes: Bottomchart)-.2 F
-(MkII 50 kHz and)2.5 E(180 kHz multibeam, SeaBeam 2120)173 120 Q
-(20 KHz multibeam, bath)173 132 Q(ymetry)-.05 E(,)-.65 E
-(amplitude and sidescan, v)173 144 Q(ariable)-.25 E(beams and pix)173
-156 Q(els, binary)-.15 E 2.5(,L)-.65 G(3)-2.5 E
-(Communications \(Elac Nautik)173 168 Q(and SeaBeam Instruments\).)173
-180 Q(MBIO Data F)118 204 Q(ormat ID:)-.15 E(101)5 E -.15(Fo)118 216 S
-(rmat name:).15 E(MBF_HSMD)25 E(ARA)-.4 E(W)-.9 E
-(Informal Description: Atlas HSMD medium depth)118 228 Q(multibeam ra)
-173 240 Q 2.5(wf)-.15 G(ormat)-2.5 E(Attrib)118 252 Q 25(utes: 40)-.2 F
-(beam bath)2.5 E(ymetry)-.05 E 2.5(,1)-.65 G(60 pix)-2.5 E(el)-.15 E
-(sidescan, XDR \(binary\),)173 264 Q(STN Atlas Elektronik.)173 276 Q
-(MBIO Data F)118 300 Q(ormat ID:)-.15 E(102)5 E -.15(Fo)118 312 S
-(rmat name:).15 E(MBF_HSMDLDIH)25 E
-(Informal Description: Atlas HSMD medium depth)118 324 Q
-(multibeam processed format)173 336 Q(Attrib)118 348 Q 25(utes: 40)-.2 F
-(beam bath)2.5 E(ymetry)-.05 E 2.5(,1)-.65 G(60 pix)-2.5 E(el)-.15 E
-(sidescan, XDR \(binary\), L-DEO.)173 360 Q(MBIO Data F)118 384 Q
-(ormat ID:)-.15 E(111)5 E -.15(Fo)118 396 S(rmat name:).15 E
-(MBF_DSL120SF)25 E
-(Informal Description: WHOI DSL AMS-120 processed format)118 408 Q
-(Attrib)118 420 Q 25(utes: 2048)-.2 F(beam bath)2.5 E(ymetry)-.05 E(,)
--.65 E(8192 pix)173 432 Q(el sidescan,)-.15 E(binary)173 444 Q 2.5(,s)
--.65 G(ingle \214les, WHOI DSL.)-2.5 E(MBIO Data F)118 468 Q(ormat ID:)
--.15 E(112)5 E -.15(Fo)118 480 S(rmat name:).15 E(MBF_DSL120PF)25 E
-(Informal Description: WHOI DSL AMS-120 processed)118 492 Q(format)173
-504 Q(Attrib)118 516 Q 25(utes: 2048)-.2 F(beam bath)2.5 E(ymetry)-.05 E
-(,)-.65 E(8192 pix)173 528 Q(el sidescan,)-.15 E(binary)173 540 Q 2.5
-(,p)-.65 G(arallel bath)-2.5 E(ymetry)-.05 E
-(and amplitude \214les, WHOI DSL.)173 552 Q(MBIO Data F)118 576 Q
-(ormat ID:)-.15 E(121)5 E -.15(Fo)118 588 S(rmat name:).15 E
-(MBF_GSFGENMB)25 E(Informal Description: SAIC Generic Sensor F)118 600 Q
-(ormat \(GSF\))-.15 E(Attrib)118 612 Q 25(utes: v)-.2 F(ariable beams,)
--.25 E(bath)5 E(ymetry)-.05 E(and amplitude, binary)173 624 Q(,)-.65 E
-(single \214les, SAIC.)173 636 Q(MBIO Data F)118 660 Q(ormat ID:)-.15 E
-(131)5 E -.15(Fo)118 672 S(rmat name:).15 E(MBF_MSTIFFSS)25 E
-(Informal Description: MSTIFF sidescan format)118 684 Q(Attrib)118 696 Q
-25(utes: v)-.2 F(ariable pix)-.25 E 2.5(els, sidescan,)-.15 F
-(binary TIFF v)173 708 Q(ariant,)-.25 E(single \214les, Sea Scan.)173
-720 Q(MB-System 5.0)72 768 Q(26 October 2009)137.055 E(10)190.395 E 0 Cg
-EP
-%%Page: 11 11
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F(MBIO Data F)118 84 Q(ormat ID:)-.15 E(132)5 E -.15
-(Fo)118 96 S(rmat name:).15 E(MBF_EDGJST)25 E(AR)-.93 E
-(Informal Description: Edgetech Jstar format)118 108 Q(Attrib)118 120 Q
-25(utes: v)-.2 F(ariable pix)-.25 E(els, dual frequenc)-.15 E(y)-.15 E
-(sidescan and subbottom,)173 132 Q(binary SEGY v)173 144 Q
-(ariant, single \214les,)-.25 E(lo)173 156 Q 2.5(wf)-.25 G(requenc)-2.5
-E 2.5(ys)-.15 G(idescan returned as)-2.5 E(surv)173 168 Q .3 -.15(ey d)
--.15 H(ata, Edgetech.).15 E(MBIO Data F)118 192 Q(ormat ID:)-.15 E(133)5
-E -.15(Fo)118 204 S(rmat name:).15 E(MBF_EDGJSTR2)25 E
-(Informal Description: Edgetech Jstar format)118 216 Q(Attrib)118 228 Q
-25(utes: v)-.2 F(ariable pix)-.25 E(els, dual frequenc)-.15 E(y)-.15 E
-(sidescan and subbottom,)173 240 Q(binary SEGY v)173 252 Q
-(ariant, single \214les,)-.25 E(high frequenc)173 264 Q 2.5(ys)-.15 G
-(idescan returned as)-2.5 E(surv)173 276 Q .3 -.15(ey d)-.15 H
-(ata, Edgetech.).15 E(MBIO Data F)118 312 Q(ormat ID:)-.15 E(141)5 E
--.15(Fo)118 324 S(rmat name:).15 E(MBF_OICGEOD)25 E(A)-.4 E
-(Informal Description: OIC sw)118 336 Q(ath sonar format)-.1 E(Attrib)
-118 348 Q 25(utes: v)-.2 F(ariable beam bath)-.25 E(ymetry and)-.05 E
-(amplitude, v)221 360 Q(ariable pix)-.25 E(el)-.15 E(sidescan, binary)
-173 372 Q(,)-.65 E(Oceanic Imaging Consultants)221 384 Q(MBIO Data F)118
-408 Q(ormat ID:)-.15 E(142)5 E -.15(Fo)118 420 S(rmat name:).15 E
-(MBF_OICMB)25 E(ARI)-.35 E(Informal Description: OIC-style e)118 432 Q
-(xtended sw)-.15 E(ath)-.1 E(sonar format)173 444 Q(Attrib)118 456 Q 25
-(utes: v)-.2 F(ariable beam bath)-.25 E(ymetry and)-.05 E(amplitude, v)
-173 468 Q(ariable pix)-.25 E(el)-.15 E(sidescan, binary)173 480 Q 2.5
-(,M)-.65 G -.35(BA)-2.5 G(RI).35 E(MBIO Data F)118 504 Q(ormat ID:)-.15
-E(151)5 E -.15(Fo)118 516 S(rmat name:).15 E(MBF_OMGHDCSJ)25 E
-(Informal Description: UNB OMG HDCS format)118 528 Q
-(\(the John Hughes Clark)173 540 Q 2.5(ef)-.1 G(ormat\))-2.5 E(Attrib)
-118 552 Q 25(utes: v)-.2 F(ariable beam bath)-.25 E(ymetry and)-.05 E
-(amplitude, v)173 564 Q(ariable pix)-.25 E(el)-.15 E(sidescan, binary)
-173 576 Q 2.5(,U)-.65 G(NB)-2.5 E(MBIO Data F)118 600 Q(ormat ID:)-.15 E
-(160)5 E -.15(Fo)118 612 S(rmat name:).15 E(MBF_SEGYSEGY)25 E
-(Informal Description: SEGY seismic data format)118 624 Q(Attrib)118 636
-Q 25(utes: seismic)-.2 F(or subbottom trace data,)2.5 E
-(single beam bath)173 648 Q(ymetry)-.05 E 2.5(,n)-.65 G -.2(av)-2.5 G(,)
--.45 E(binary)173 660 Q 2.5(,S)-.65 G(EG \(SIOSEIS v)-2.5 E(ariant\))
--.25 E(MBIO Data F)118 684 Q(ormat ID:)-.15 E(161)5 E -.15(Fo)118 696 S
-(rmat name:).15 E(MBF_MGD77D)25 E -1.11(AT)-.4 G
-(Informal Description: NGDC MGD77 underw)118 708 Q(ay geoph)-.1 E(ysics)
--.05 E(format)173 720 Q(MB-System 5.0)72 768 Q(26 October 2009)137.055 E
-(11)190.395 E 0 Cg EP
-%%Page: 12 12
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F(Attrib)118 84 Q 25(utes: single)-.2 F(beam bath)2.5
-E(ymetry)-.05 E 2.5(,n)-.65 G -.2(av)-2.5 G(,)-.45 E(magnetics, gra)173
-96 Q(vity)-.2 E 2.5(,a)-.65 G(scii,)-2.5 E(NO)173 108 Q(AA NGDC)-.35 E
-(MBIO Data F)118 132 Q(ormat ID:)-.15 E(162)5 E -.15(Fo)118 144 S
-(rmat name:).15 E(MBF_ASCIIXYZ)25 E
-(Informal Description: Generic XYZ sounding format)118 156 Q(Attrib)118
-168 Q 25(utes: XYZ)-.2 F(\(lon lat depth\) ASCII)2.5 E
-(soundings, generic)173 180 Q(MBIO Data F)118 204 Q(ormat ID:)-.15 E
-(163)5 E -.15(Fo)118 216 S(rmat name:).15 E(MBF_ASCIIYXZ)25 E
-(Informal Description: Generic YXZ sounding format)118 228 Q(Attrib)118
-240 Q 25(utes: YXZ)-.2 F(\(lat lon depth\) ASCII)2.5 E
-(soundings, generic)173 252 Q(MBIO Data F)118 276 Q(ormat ID:)-.15 E
-(164)5 E -.15(Fo)118 288 S(rmat name:).15 E(MBF_HYDR)22.5 E(OB93)-.4 E
-(Informal Description: NGDC binary h)118 300 Q(ydrographic)-.05 E
-(sounding format)173 312 Q(Attrib)118 324 Q 25(utes: XYZ)-.2 F
-(\(lon lat depth\) binary)2.5 E(soundings)173 336 Q(MBIO Data F)118 360
-Q(ormat ID:)-.15 E(165)5 E -.15(Fo)118 372 S(rmat name:).15 E(MBF_MB)25
-E(ARIR)-.35 E -.5(OV)-.4 G(Informal Description: MB)118 384 Q(ARI R)-.35
-E 1 -.5(OV n)-.4 H -.2(av).5 G(ig).2 E(ation format)-.05 E(Attrib)118
-396 Q 25(utes: R)-.2 F 1 -.5(OV n)-.4 H -.2(av).5 G(ig).2 E(ation, MB)
--.05 E(ARI)-.35 E(MBIO Data F)118 420 Q(ormat ID:)-.15 E(166)5 E -.15
-(Fo)118 432 S(rmat name:).15 E(MBF_MBPR)25 E(ON)-.4 E -1.35(AV)-.35 G
-(Informal Description: MB-System simple na)118 444 Q(vig)-.2 E(ation)
--.05 E(format)173 456 Q(Attrib)118 468 Q 25(utes: na)-.2 F(vig)-.2 E
-(ation, MB)-.05 E(ARI)-.35 E(MBIO Data F)118 492 Q(ormat ID:)-.15 E(167)
-5 E -.15(Fo)118 504 S(rmat name:).15 E(MBF_MBNETCDF)25 E
-(Informal Description: CARAIBES CDF na)118 516 Q(vig)-.2 E(ation)-.05 E
-(Attrib)118 528 Q 25(utes: netCDF)-.2 F 2.5(,I)-.8 G(FREMER.)-2.5 E
-(MBIO Data F)118 552 Q(ormat ID:)-.15 E(168)5 E -.15(Fo)118 564 S
-(rmat name:).15 E(MBF_ASCIIXYT)25 E
-(Informal Description: Generic XYT sounding format)118 576 Q(Attrib)118
-588 Q 25(utes: XYT)-.2 F(\(lon lat topograph)2.5 E(y\) ASCII)-.05 E
-(soundings, generic)173 600 Q(MBIO Data F)118 624 Q(ormat ID:)-.15 E
-(169)5 E -.15(Fo)118 636 S(rmat name:).15 E(MBF_ASCIIYXT)25 E
-(Informal Description: Generic YXT sounding format)118 648 Q(Attrib)118
-660 Q 25(utes: YXT)-.2 F(\(lat lon topograp)2.5 E(y\) ASCII)-.1 E
-(soundings, generic)173 672 Q(MBIO Data F)118 696 Q(ormat ID:)-.15 E
-(170)5 E -.15(Fo)118 708 S(rmat name:).15 E(MBF_MB)25 E(ARR)-.35 E -.5
-(OV)-.4 G(2).5 E(Informal Description: MB)118 720 Q(ARI R)-.35 E 1 -.5
-(OV n)-.4 H -.2(av).5 G(ig).2 E(ation format)-.05 E(MB-System 5.0)72 768
-Q(26 October 2009)137.055 E(12)190.395 E 0 Cg EP
-%%Page: 13 13
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F(Attrib)118 84 Q 25(utes: R)-.2 F 1 -.5(OV n)-.4 H
--.2(av).5 G(ig).2 E(ation, MB)-.05 E(ARI)-.35 E(MBIO Data F)118 108 Q
-(ormat ID:)-.15 E(171)5 E -.15(Fo)118 120 S(rmat name:).15 E(MBF_HS10J)
-25 E(AMS)-.6 E(Informal Description: Furuno HS-10 multibeam format,)118
-132 Q(Attrib)118 144 Q 25(utes: 45)-.2 F(beams bath)2.5 E
-(ymetry and amplitude,)-.05 E(ascii, J)173 156 Q(AMSTEC)-.6 E
-(MBIO Data F)118 180 Q(ormat ID:)-.15 E(181)5 E -.15(Fo)118 192 S
-(rmat name:).15 E(MBF_SAMESURF)25 E
-(Informal Description: SAM Electronics SURF format.)118 204 Q(Attrib)118
-216 Q 25(utes: v)-.2 F(ariable beams,)-.25 E(bath)5 E(ymetry)-.05 E(,)
--.65 E 2.5(amplitude, and)221 228 R(sidescan,)2.5 E(binary)173 240 Q
-4.439(,s)-.65 G 1.939(ingle \214les, SAM Electronics)-4.439 F 1.938
-(\(formerly Krupp-Atlas)119.376 F(Electronik\).)108 252 Q(MBIO Data F)
-118 276 Q(ormat ID:)-.15 E(182)5 E -.15(Fo)118 288 S(rmat name:).15 E
-(MBF_HSDS2RA)25 E(W)-.9 E(Informal Description: STN Atlas ra)118 300 Q
-2.5(wm)-.15 G(ultibeam format)-2.5 E(Attrib)118 312 Q 25(utes: STN)-.2 F
-(Atlas multibeam sonars,)2.5 E(Hydrosweep DS2, Hydrosweep MD,)221 324 Q
--.15(Fa)221 336 S(nsweep 10, F).15 E(answeep 20,)-.15 E(bath)221 348 Q
-(ymetry)-.05 E 2.5(,a)-.65 G(mplitude, and sidescan,)-2.5 E
-(up to 1440 beams and 4096 pix)221 360 Q(els,)-.15 E(XDR binary)221 372
-Q 2.5(,S)-.65 G(TN Atlas.)-2.5 E(MBIO Data F)118 396 Q(ormat ID:)-.15 E
-(183)5 E -.15(Fo)118 408 S(rmat name:).15 E(MBF_HSDS2LAM)25 E
-(Informal Description: L-DEO HSDS2 processing format)118 420 Q(Attrib)
-118 432 Q 25(utes: STN)-.2 F(Atlas multibeam sonars,)2.5 E
-(Hydrosweep DS2, Hydrosweep MD,)221 444 Q -.15(Fa)221 456 S
-(nsweep 10, F).15 E(answeep 20,)-.15 E(bath)221 468 Q(ymetry)-.05 E 2.5
-(,a)-.65 G(mplitude, and sidescan,)-2.5 E(up to 1440 beams and 4096 pix)
-221 480 Q(els,)-.15 E(XDR binary)221 492 Q 2.5(,L)-.65 G(-DEO.)-2.5 E
-(The institutional acron)108 528 Q(yms used abo)-.15 E .3 -.15(ve h)-.15
-H -2.25 -.2(av e).15 H(the follo)2.7 E(wing meanings:)-.25 E 3.51
-(L-DEO Lamont-Doherty)144 540 R(Earth Observ)2.5 E(atory)-.25 E(MB)144
-552 Q 1.07(ARI Montere)-.35 F 2.5(yB)-.15 G
-(ay Aquarium Research Institute)-2.5 E 17.39(SIO Scripps)144 564 R
-(Institution of Oceanograph)2.5 E(y)-.05 E 6.29(WHOI W)144 576 R
-(oods Hole Oceanographic Institution)-.8 E 16.28(URI Uni)144 588 R -.15
-(ve)-.25 G(rsity of Rhode Island).15 E 13.5(NRL Na)144 600 R -.25(va)-.2
-G 2.5(lR).25 G(esearch Laboratory)-2.5 E 12.39(UNB Uni)144 612 R -.15
-(ve)-.25 G(rsity of Ne).15 E 2.5(wB)-.25 G(runswick)-2.5 E 19.06(UH Uni)
-144 624 R -.15(ve)-.25 G(rsity of Ha).15 E -.1(wa)-.15 G(ii).1 E(NO)144
-636 Q 4.97(AA National)-.35 F(Oceans and Atmospheres Agenc)2.5 E(y)-.15
-E 5.17(NGDC National)144 648 R(Geoph)2.5 E(ysical Data Center)-.05 E
-7.94(USGS United)144 660 R(States Geological Surv)2.5 E -.15(ey)-.15 G
-26.16(IFREMER French)144 672 R(go)2.5 E -.15(ve)-.15 G(rnment agenc).15
-E 2.5(yr)-.15 G(esponsible)-2.5 E(for operation of French oceanographic)
-180 684 Q(research \215eet.)180 696 Q(MB-System 5.0)72 768 Q
-(26 October 2009)137.055 E(13)190.395 E 0 Cg EP
-%%Page: 14 14
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F/F1 10.95/Times-Bold at 0 SF(FUNCTION ST)72 84 Q -1.04
-(AT)-.986 G(US AND ERR)1.04 E(OR CODES)-.329 E F0(All of the)108 96 Q/F2
-10/Times-Bold at 0 SF(MBIO)2.5 E F0(functions return an inte)2.5 E
-(ger status v)-.15 E(alue with the con)-.25 E -.15(ve)-.4 G(ntion that:)
-.15 E(status = 1:)144 108 Q(success)30.8 E(status = 0:)144 120 Q -.1(fa)
-30.8 G(ilure).1 E(All)108 132 Q F2(MBIO)4.112 E F0 1.613
-(functions also pass an error v)4.112 F 1.613(alue ar)-.25 F 1.613
-(gument which gi)-.18 F -.15(ve)-.25 G 4.113(ss).15 G(ome)-4.113 E 1.613
-(what more information about)-.25 F 1.064(problems than the status v)108
-144 R 3.564(alue. The)-.25 F 1.064(full suite of possible error v)3.564
-F 1.063(alues and the associated error messages)-.25 F(are:)108 156 Q
-(error = 0:)144 168 Q("No error",)34.15 E(error = -1:)144 180 Q("T)30.82
-E(ime g)-.35 E(ap in data",)-.05 E(error = -2:)144 192 Q
-("Data outside speci\214ed location)30.82 E(bounds",)216 204 Q
-(error = -3:)144 216 Q("Data outside speci\214ed time interv)30.82 E
-(al",)-.25 E(error = -4:)144 228 Q("Ship speed too small",)30.82 E
-(error = -5:)144 240 Q("Comment record",)30.82 E(error = -6:)144 252 Q
-("Neither a data record nor a comment)30.82 E(record",)216 264 Q
-(error = -7:)144 276 Q("Unintelligible data record",)30.82 E
-(error = -8:)144 288 Q("Ignore this data",)30.82 E(error = -9:)144 300 Q
-("No data requested for b)30.82 E(uf)-.2 E(fer load",)-.25 E
-(error = -10:)144 312 Q("Data b)25.82 E(uf)-.2 E(fer is full",)-.25 E
-(error = -11:)144 324 Q("No data w)25.82 E(as loaded into the b)-.1 E
-(uf)-.2 E(fer",)-.25 E(error = -12:)144 336 Q("Data b)25.82 E(uf)-.2 E
-(fer is empty",)-.25 E(error = -13:)144 348 Q("No data w)25.82 E
-(as dumped from the b)-.1 E(uf)-.2 E(fer")-.25 E(error = -14:)144 360 Q
-("No more surv)25.82 E .3 -.15(ey d)-.15 H(ata records in b).15 E(uf)-.2
-E(fer")-.25 E(error = -15:)144 372 Q("Data inconsistencies pre)25.82 E
--.15(ve)-.25 G(nted).15 E(inserting data into storage structure")216 384
-Q(error = 1:)144 396 Q("Unable to allocate memory)34.15 E(,)-.65 E
-(initialization f)216 408 Q(ailed",)-.1 E(error = 2:)144 420 Q
-("Unable to open \214le,)34.15 E(initialization f)216 432 Q(ailed",)-.1
-E(error = 3:)144 444 Q("Ille)34.15 E -.05(ga)-.15 G 2.5(lf).05 G
-(ormat identi\214er)-2.5 E(,)-.4 E(initialization f)216 456 Q(ailed",)
--.1 E(error = 4:)144 468 Q("Read error)34.15 E 2.5(,p)-.4 G
-(robably end-of-\214le",)-2.5 E(error = 5:)144 480 Q("Write error",)
-34.15 E(error = 6:)144 492 Q("No data in speci\214ed location bounds",)
-34.15 E(error = 7:)144 504 Q("No data in speci\214ed time interv)34.15 E
-(al",)-.25 E(error = 8:)144 516 Q("In)34.15 E -.25(va)-.4 G
-(lid MBIO descriptor",).25 E(error = 9:)144 528 Q
-("Inconsistent usage of MBIO descriptor",)34.15 E(error = 10:)144 540 Q
-("No pings binned b)29.15 E(ut no f)-.2 E(atal error)-.1 E 2.5(-t)216
-552 S(his should not happen!",)-2.5 E(error = 11:)144 564 Q("In)29.15 E
--.25(va)-.4 G(lid data record type speci\214ed).25 E(for writing",)216
-576 Q(error = 12:)144 588 Q("In)29.15 E -.25(va)-.4 G
-(lid control parameter speci\214ed).25 E(by user",)216 600 Q
-(error = 13:)144 612 Q("In)29.15 E -.25(va)-.4 G(lid b).25 E(uf)-.2 E
-(fer id",)-.25 E(error = 14:)144 624 Q("In)29.15 E -.25(va)-.4 G
-(lid system id - this should).25 E(not happen!")216 636 Q(error = 15:)
-144 648 Q("This data \214le is not in the speci\214ed format!")29.15 E
-.463(In general, programs should treat ne)108 660 R -.05(ga)-.15 G(ti)
-.05 E .763 -.15(ve e)-.25 H .463(rror v).15 F .463(alues as non-f)-.25 F
-.464(atal \(reading and writing can continue\) and)-.1 F(positi)108 672
-Q .3 -.15(ve e)-.25 H(rror v).15 E(alues as f)-.25 E
-(atal \(the data \214les should be closed and the program terminated\).)
--.1 E F1(FUNCTION VERBOSITY)72 688.8 Q F0 .595(All of the)108 700.8 R F2
-(MBIO)3.095 E F0 .595(functions are passed a)3.095 F/F3 10
-/Times-Italic at 0 SF(verbose)3.095 E F0 .594(parameter which controls ho)
-3.095 F 3.094(wm)-.25 G .594(uch deb)-3.094 F .594(ugging informa-)-.2 F
-.016(tion is output to standard error)108 712.8 R 5.017(.I)-.55 G(f)
--5.017 E F3(verbose)2.517 E F0 .017(is 0 or 1, the)2.517 F F2(MBIO)2.517
-E F0 .017(functions will be silent.)2.517 F(If)5.017 E F3(verbose)2.517
-E F0 .017(is 2, then)2.517 F 1.378(each function will output informatio\
-n as it is entered and as it returns, along with the parameter v)108
-724.8 R(alues)-.25 E(MB-System 5.0)72 768 Q(26 October 2009)137.055 E
-(14)190.395 E 0 Cg EP
-%%Page: 15 15
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F .18(passed into and returned out of the function.)
-108 84 R .18(Greater v)5.18 F .18(alues of)-.25 F/F1 10/Times-Italic at 0
-SF(verbose)2.68 E F0 .18(will cause additional information to)2.68 F
-.734(be output, including v)108 96 R .734(alues at v)-.25 F .734
-(arious stages of data processing during read and write operations.)-.25
-F .733(In gen-)5.733 F(eral, programs using)108 108 Q/F2 10/Times-Bold at 0
-SF(MBIO)2.5 E F0(functions should adopt the follo)2.5 E(wing v)-.25 E
-(erbosity con)-.15 E -.15(ve)-.4 G(ntions:).15 E F1(verbose)144 120 Q F0
-2.5(=0)2.5 G 22.48(:")-2.5 G(silent" or near)-22.48 E(-"silent" e)-.2 E
--.15(xe)-.15 G(cution).15 E F1(verbose)144 132 Q F0 2.5(=1)2.5 G 22.48
-(:s)-2.5 G(imple output including)-22.48 E(program name, v)252 144 Q
-(ersion)-.15 E(and simple progress updates)252 156 Q F1(verbose)144 168
-Q F0(>= 2:)2.5 E(deb)16.84 E(ug mode with copious output)-.2 E
-(including e)252 180 Q -.15(ve)-.25 G(ry function call).15 E
-(and status listings)252 192 Q/F3 10.95/Times-Bold at 0 SF(INITIALIZA)72
-208.8 Q(TION AND CLOSING FUNCTIONS)-1.04 E F0(int)108 220.8 Q F2(mb_r)
-2.5 E(ead_init)-.18 E F0(\()A(int)180 232.8 Q F1(verbose)2.5 E F0(,)A
-(char)180 244.8 Q F1(*\214le)2.5 E F0(,)A(int)180 256.8 Q F1(format)2.5
-E F0(,)A(int)180 268.8 Q F1(pings)2.5 E F0(,)A(int)180 280.8 Q F1
-(lon\215ip)2.5 E F0(,)A(double)180 292.8 Q F1(bounds[4])2.5 E F0(,)A
-(int)180 304.8 Q F1(btime_i[7])2.5 E F0(,)A(int)180 316.8 Q F1
-(etime_i[7])2.5 E F0(,)A(double)180 328.8 Q F1(speedmin)2.5 E F0(,)A
-(double)180 340.8 Q F1(time)2.5 E(gap)-.4 E F0(,)A(char)180 352.8 Q F1
-(**mbio_ptr)2.5 E F0(,)A(double)180 364.8 Q F1(*btime_d)2.5 E F0(,)A
-(double)180 376.8 Q F1(*etime_d)2.5 E F0(,)A(int)180 388.8 Q F1
-(*beams_bath)2.5 E F0(,)A(int)180 400.8 Q F1(*beams_amp)2.5 E F0(,)A
-(int)180 412.8 Q F1(*pixels_ss)2.5 E F0(,)A(int)180 424.8 Q F1(*err)2.5
-E(or)-.45 E F0(\);)A .835(The function)108 448.8 R F2(mb_r)3.335 E
-(ead_init)-.18 E F0 .836(initializes the data \214le to be read and the\
- data structures required for reading)3.335 F(the data. The)108 460.8 Q
-F1(verbose)2.5 E F0 -.25(va)2.5 G
-(lue controls the standard error output v).25 E
-(erbosity of the function.)-.15 E(The input control parameters ha)108
-484.8 Q .3 -.15(ve t)-.2 H(he follo).15 E(wing signi\214cance:)-.25 E F1
-(\214le)144 496.8 Q F0 57(:i)C(nput \214lename)-57 E F1(format)144 508.8
-Q F0 42.55(:i)C(nput)-42.55 E F2(MBIO)2.5 E F0(data format id)2.5 E F1
-(pings)144 520.8 Q F0 47.55(:p)C(ing a)-47.55 E -.15(ve)-.2 G(raging).15
-E F1(lon\215ip)144 532.8 Q F0 43.66(:l)C(ongitude \215ipping)-43.66 E F1
-(bounds)144 544.8 Q F0 40.33(:l)C(ocation bounds of acceptable data)
--40.33 E F1(btime_i)144 556.8 Q F0 39.22(:b)C -.15(eg)-39.22 G
-(inning time of acceptable data).15 E F1(etime_i)144 568.8 Q F0 39.78
-(:e)C(nding time of acceptable data)-39.78 E F1(speedmin)144 580.8 Q F0
-67.45(:m)C(inimum ship speed of acceptable data)-67.45 E F1(time)144
-592.8 Q(gap)-.4 E F0 37.4(:m)C(aximum time allo)-37.4 E
-(wed before data g)-.25 E(ap)-.05 E .281(The format identi\214er)108
-616.8 R F1(format)2.781 E F0 .28(speci\214es which of the supported dat\
-a formats is being read or written; the cur)2.781 F(-)-.2 E
-(rently supported formats are listed in the "SUPPOR)108 628.8 Q
-(TED FORMA)-.6 E(TS" section.)-1.11 E(The)108 652.8 Q F1(pings)2.843 E
-F0 .343(parameter determines whether and ho)2.843 F 2.843(wp)-.25 G .343
-(ings are a)-2.843 F -.15(ve)-.2 G .343(raged as part of data input.).15
-F .344(This parameter)5.344 F 1.706(is used only by the functions)108
-664.8 R F2(mb_r)4.206 E(ead)-.18 E F0(and)4.206 E F2(mb_get)4.206 E F0
-(;)A F2(mb_get_all)4.206 E F0(and)4.206 E F2(mb_b)4.205 E(uffer_load)-.2
-E F0 1.705(do not a)4.205 F -.15(ve)-.2 G(rage).15 E 3.103(pings. If)108
-676.8 R F1(pings)3.103 E F0 3.103(=1)3.103 G 3.103(,t)-3.103 G .603
-(hen no ping a)-3.103 F -.15(ve)-.2 G .603
-(raging will be done and each ping read will be returned unaltered by)
-.15 F .02(the reading function.)108 688.8 R(If)5.02 E F1(pings)2.52 E F0
-2.52(>1)2.52 G 2.52(,t)-2.52 G .02(hen the na)-2.52 F(vig)-.2 E .019
-(ation and beam data for)-.05 F F1(pings)2.519 E F0 .019
-(pings will be read, a)2.519 F -.15(ve)-.2 G(raged,).15 E .711
-(and returned as the data for a single ping.)108 700.8 R(If)5.711 E F1
-(pings)3.211 E F0 3.211(=0)3.211 G 3.211(,t)-3.211 G .711
-(hen the ping a)-3.211 F -.15(ve)-.2 G .711(raging will be v).15 F .711
-(aried so that the)-.25 F 1.208(along-track distance between a)108 712.8
-R -.15(ve)-.2 G 1.207(raged pings is as close as possible to the across\
--track distance between).15 F(beams.)108 724.8 Q(MB-System 5.0)72 768 Q
-(26 October 2009)137.055 E(15)190.395 E 0 Cg EP
-%%Page: 16 16
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F(The)108 84 Q/F1 10/Times-Italic at 0 SF(lon\215ip)2.5
-E F0(paramenter determines the range in which longitude v)2.5 E
-(alues are returned:)-.25 E F1(lon\215ip)144 96 Q F0 2.5(=-)2.5 G 2.5
-(1:-)-2.5 G(360 to)-2.5 E(0)7.5 E F1(lon\215ip)144 108 Q F0 5(=0)2.5 G
-2.5(:-)-2.5 G(180 to 180)-2.5 E F1(lon\215ip)144 120 Q F0 5(=1)2.5 G 10
-(:0)-2.5 G(to 360)-7.5 E(The)108 144 Q F1(bounds)2.987 E F0 .487
-(array sets the area within which data are desired.)2.987 F .488
-(Data which lie outside the area speci\214ed by)5.487 F F1(bounds)108
-156 Q F0 2.039(will be returned with an error by the reading function.)
-4.539 F 2.038(The functions)7.038 F/F2 10/Times-Bold at 0 SF(mb_r)4.538 E
-(ead)-.18 E F0(,)A F2(mb_get)4.538 E F0(and)4.538 E F2(mb_get_all)108
-168 Q F0(use the)2.5 E F1(bounds)2.5 E F0(array; the function)2.5 E F2
-(mb_b)2.5 E(uffer_load)-.2 E F0(does no location checking.)2.5 E F1
-(bounds)144 180 Q F0([0] : minimum longitude)A F1(bounds)144 192 Q F0
-([1] : maximum longitude)A F1(bounds)144 204 Q F0
-([2] : minimum latitude)A F1(bounds)144 216 Q F0([3] : maximum latitude)
-A(The)108 240 Q F1(btime_i)2.871 E F0 .371(array sets the desired be)
-2.871 F .371(ginning time for the data and the)-.15 F F1(etime_i)2.871 E
-F0 .371(array sets the desired ending)2.871 F 3.882(time. If)108 252 R
-1.381(the be)3.881 F 1.381
-(ginning time is earlier than the ending time, then an)-.15 F 3.881(yd)
--.15 G 1.381(ata with a time stamp before the)-3.881 F(be)108 264 Q
-1.155
-(ginning time or after the ending time will be returned with an MB_ERR)
--.15 F 1.155(OR_OUT_TIME error by the)-.4 F 1.012(reading function.)108
-276 R 1.012(If the be)6.012 F 1.012(ginning time is after the ending ti\
-me, then data with time stamps between the)-.15 F .081(ending and be)108
-288 R .082(ginning time are returned with an error)-.15 F 2.582(.T)-.55
-G .082(his scheme allo)-2.582 F .082(ws time windo)-.25 F .082
-(wing outside or inside)-.25 F 3.055(as)108 300 S .555
-(peci\214ed interv)-3.055 F 3.055(al. The)-.25 F(functions)3.055 E F2
-(mb_r)3.055 E(ead)-.18 E F0(,)A F2(mb_get)3.055 E F0(and)3.055 E F2
-(mb_get_all)3.055 E F0 .555(use the)3.055 F F1(btime_i)3.055 E F0(and)
-3.055 E F1(btime_i)3.055 E F0(arrays;)3.055 E(the function)108 312 Q F2
-(mb_b)2.5 E(uffer_load)-.2 E F0(does no time checking.)2.5 E F1(btime)
-144 324 Q F0([0] : year)A F1(btime)144 336 Q F0([1] : month)A F1(btime)
-144 348 Q F0([2] : day)A F1(btime)144 360 Q F0([3] : hour)A F1(btime)144
-372 Q F0([4] : minute)A F1(btime)144 384 Q F0([5] : second)A F1(btime)
-144 396 Q F0([6] : microsecond)A F1(etime)144 408 Q F0([0] : year)A F1
-(etime)144 420 Q F0([1] : month)A F1(etime)144 432 Q F0([2] : day)A F1
-(etime)144 444 Q F0([3] : hour)A F1(etime)144 456 Q F0([4] : minute)A F1
-(etime)144 468 Q F0([5] : second)A F1(etime)144 480 Q F0
-([6] : microsecond)A(The)108 504 Q F1(speedmin)2.873 E F0 .374
-(parameter sets the minimum acceptable ship speed for the data.)2.873 F
-.374(If the ship speed associated)5.374 F .716(with an)108 516 R 3.216
-(yp)-.15 G .716(ing is less than)-3.216 F F1(speedmin)3.216 E F0 3.216
-(,t)C .716
-(hen that data will be returned with an error by the reading function.)
--3.216 F .404(This is used to eliminate data collected while a ship is \
-on station is a simple w)108 528 R(ay)-.1 E 2.905(.T)-.65 G .405
-(he functions)-2.905 F F2(mb_r)2.905 E(ead)-.18 E F0(,)A F2(mb_get)108
-540 Q F0(and)2.5 E F2(mb_get_all)2.5 E F0(use the)2.5 E F1(speedmin)2.5
-E F0 -.25(va)2.5 G(lue; the function).25 E F2(mb_b)2.5 E(uffer_load)-.2
-E F0(does no speed checking.)2.5 E(The)108 564 Q F1(time)2.781 E(gap)-.4
-E F0 .281(parameter sets the minimum time g)2.781 F .281(ap allo)-.05 F
-.281(wed before a g)-.25 F .28(ap in the data is declared.)-.05 F .28
-(Ping a)5.28 F -.15(ve)-.2 G -.2(r-).15 G 1.191
-(aging is not done across data g)108 576 R 1.191
-(aps; an error is returned when time g)-.05 F 1.191
-(aps are encountered.)-.05 F 1.192(The functions)6.192 F F2(mb_r)108 588
-Q(ead)-.18 E F0(and)3.473 E F2(mb_get)3.473 E F0 .973(use the)3.473 F F1
-(time)3.473 E(gap)-.4 E F0 -.25(va)3.473 G .973(lue; the functions).25 F
-F2(mb_get_all)3.473 E F0(and)3.473 E F2(mb_b)3.473 E(uffer_load)-.2 E F0
-.972(do no ping)3.473 F -2.25 -.2(av e)108 600 T(raging and thus ha).2 E
-.3 -.15(ve n)-.2 H 2.5(on).15 G(eed to check for time g)-2.5 E(aps.)-.05
-E(The returned v)108 624 Q(alues are:)-.25 E F1(mbio_ptr)144 636 Q F0
-32.55(:p)C(ointer to an)-32.55 E F2(MBIO)2.5 E F0(descriptor structure)
-2.5 E F1(btime_d)144 648 Q F0 37(:d)C(esired be)-37 E
-(ginning time in seconds)-.15 E(since 1/1/70 00:00:0)288 660 Q F1
-(etime_d)144 672 Q F0 37.56(:d)C(esired ending time in seconds)-37.56 E
-(since 1/1/70 00:00:0)288 684 Q F1(beams_bath)144 696 Q F0 20.89(:m)C
-(aximum number of bath)-20.89 E(ymetry beams)-.05 E F1(beams_amp)144 708
-Q F0 21.45(:m)C(aximum number of amplitude beams)-21.45 E F1(pixels_ss)
-144 720 Q F0 33.11(:m)C(aximum number of sidescan pix)-33.11 E(els)-.15
-E(MB-System 5.0)72 768 Q(26 October 2009)137.055 E(16)190.395 E 0 Cg EP
-%%Page: 17 17
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F/F1 10/Times-Italic at 0 SF(err)144 84 Q(or)-.45 E F0
-48.56(:e)C(rror v)-48.56 E(alue)-.25 E .473(The structure pointed to by)
-108 96 R F1(mbio_ptr)2.973 E F0 .473
-(holds the \214le descriptor and all of the control parameters which go)
-2.973 F(v-)-.15 E .416(ern ho)108 108 R 2.916(wt)-.25 G .416
-(he data is read; this pointer must be pro)-2.916 F .416
-(vided to the functions)-.15 F/F2 10/Times-Bold at 0 SF(mb_r)2.916 E(ead)
--.18 E F0(,)A F2(mb_get)2.916 E F0(,)A F2(mb_get_all)2.915 E F0 2.915
-(,o)C(r)-2.915 E F2(mb_b)108 120 Q(uffer_load)-.2 E F0 .107
-(to read data. The v)2.606 F(alues)-.25 E F1(beams_bath)2.607 E F0(,)A
-F1(beams_amp)2.607 E F0 2.607(,a)C(nd)-2.607 E F1(pixels_ss)2.607 E F0
-.107(return initial estimates of)2.607 F .316
-(the maximum number of bath)108 132 R .316
-(ymetry and amplitude beams and sidescan pix)-.05 F .315(els, respecti)
--.15 F -.15(ve)-.25 G(ly).15 E 2.815(,t)-.65 G .315(hat the speci-)
--2.815 F .562(\214ed data format may contain. In general,)108 144 R F1
-(beams_amp)3.062 E F0 .562(will either be zero or equal to)3.062 F F1
-(beams_bath)3.063 E F0 3.063(.T)C .563(he v)-3.063 F(al-)-.25 E(ues)108
-156 Q F1(btime_d)3.292 E F0(and)3.292 E F1(etime_d)3.292 E F0(gi)3.291 E
-1.091 -.15(ve t)-.25 H .791(he desired be).15 F .791
-(ginning and end times of the data con)-.15 F -.15(ve)-.4 G .791
-(rted to seconds since).15 F(00:00:00 on January 1, 1970;)108 168 Q F2
-(MBIO)2.5 E F0(uses these units to calculate time internally)2.5 E(.)
--.65 E -.15(Fo)108 192 S 3.283(rm).15 G .783
-(ost data formats, the initial maximum beam and pix)-3.283 F .783
-(el dimensions will not change.)-.15 F(Ho)5.783 E(we)-.25 E -.15(ve)-.25
-G 1.584 -.4(r, a f).15 H -.25(ew).4 G 1.479(formats support both v)108
-204 R 1.479(ariable and arbitrarily lar)-.25 F 1.478
-(ge numbers of beams and/or pix)-.18 F 1.478(els, and so applications)
--.15 F 1.094(must be capable of handling dynamic changes in the numbers\
- of beams and pix)108 216 R 1.095(els. The arrays allocated)-.15 F .629
-(internally in the)108 228 R F1(mbio_ptr)3.129 E F0 .629
-(structure are automatically increased when necessary)3.129 F 3.128(.H)
--.65 G -.25(ow)-3.128 G -2.15 -.25(ev e).25 H 1.428 -.4(r, i).25 H 3.128
-(no).4 G .628(rder to suc-)-3.128 F 1.038(cessfully e)108 240 R 1.038
-(xtract sw)-.15 F 1.038(ath data using)-.1 F F1(mb_g)3.538 E(et)-.1 E F0
-(,)A F1(mb_g)3.538 E(et_all)-.1 E F0(,)A F1(mb_r)3.538 E(ead)-.37 E F0
-3.539(,o)C(r)-3.539 E F1(mb_e)3.539 E(xtr)-.2 E(act)-.15 E F0 3.539(,a)C
-3.539(na)-3.539 G 1.039(pplication must also)-3.539 F(pro)108 252 Q .089
-(vide pointers to arrays lar)-.15 F .089
-(ge enough to hold the current maximum numbers of bath)-.18 F .088
-(ymetry beams, ampli-)-.05 F 1.544(tude beams, and sidescan pix)108 264
-R 1.544(els. The function)-.15 F F1(mb_r)4.044 E -.4(eg)-.37 G
-(ister_ioarr).4 E(ay)-.15 E F0(allo)4.044 E 1.544(ws applications to re)
--.25 F 1.545(gister array)-.15 F .193
-(pointers so that these arrays are also dynamically allocated by)108 276
-R F1(MBIO)2.692 E F0 2.692(.R)C -.15(eg)-2.692 G .192
-(istered arrays will be managed as).15 F
-(data are read and then freed when)108 288 Q F2(mb_close)2.5 E F0
-(is called.)2.5 E 2.831(As)108 312 S .331(tatus v)-2.831 F .331
-(alue indicating success or f)-.25 F .331
-(ailure is returned; an error v)-.1 F .331(alue ar)-.25 F .332
-(gument passes more detailed infor)-.18 F(-)-.2 E
-(mation about initialization f)108 324 Q(ailures.)-.1 E
-(---------------------------------------------------------)108 348 Q
-(int)108 360 Q F2(mb_write_init)2.5 E F0(\()A(int)180 372 Q F1(verbose)
-2.5 E F0(,)A(char)180 384 Q F1(*\214le)2.5 E F0(,)A(int)180 396 Q F1
-(format)2.5 E F0(,)A(char)180 408 Q F1(**mbio_ptr)2.5 E F0(,)A(int)180
-420 Q F1(*beams_bath)2.5 E F0(,)A(int)180 432 Q F1(*beams_amp)2.5 E F0
-(,)A(int)180 444 Q F1(*pixels_ss)2.5 E F0(,)A(int)180 456 Q F1(*err)2.5
-E(or)-.45 E F0(\);)A .025(The function)108 480 R F2(mb_write_init)2.525
-E F0 .025(initializes the data \214le to be written and the data struct\
-ures required for writing)2.525 F(the data. The)108 492 Q F1(verbose)2.5
-E F0 -.25(va)2.5 G(lue controls the standard error output v).25 E
-(erbosity of the function.)-.15 E(The input control parameters ha)108
-516 Q .3 -.15(ve t)-.2 H(he follo).15 E(wing signi\214cance:)-.25 E F1
-(\214le)144 528 Q F0 57(:o)C(utput \214lename)-57 E F1(format)144 540 Q
-F0 42.55(:o)C(utput)-42.55 E F2(MBIO)2.5 E F0(data format id)2.5 E
-(The returned v)108 564 Q(alues are:)-.25 E F1(mbio_ptr)144 576 Q F0
-32.55(:p)C(ointer to a structure describing)-32.55 E(the output \214le)
-288 588 Q F1(beams_bath)144 600 Q F0 20.89(:m)C(aximum number of bath)
--20.89 E(ymetry beams)-.05 E F1(beams_bac)144 612 Q(k)-.2 E F0 19.99(:m)
-C(aximum number of backscatter beams)-19.99 E F1(err)144 624 Q(or)-.45 E
-F0 48.56(:e)C(rror v)-48.56 E(alue)-.25 E .731
-(The structure pointed to by)108 648 R F1(mbio_ptr)3.232 E F0 .732
-(holds the output \214le descriptor; this pointer must be pro)3.232 F
-.732(vided to the)-.15 F(functions)108 660 Q F2(mb_write)3.735 E F0(,)A
-F2(mb_put)3.735 E F0(,)A F2(mb_put_all)3.735 E F0 3.735(,o)C(r)-3.735 E
-F2(mb_b)3.735 E(uffer_dump)-.2 E F0 1.234(to write data. The v)3.735 F
-(alues)-.25 E F1(beams_bath)3.734 E F0(,)A F1(beams_amp)108 672 Q F0
-3.217(,a)C(nd)-3.217 E F1(pixels_ss)3.217 E F0 .718
-(return the maximum number of bath)3.217 F .718
-(ymetry and amplitude beams and sidescan)-.05 F(pix)108 684 Q .516
-(els, respecti)-.15 F -.15(ve)-.25 G(ly).15 E 3.016(,t)-.65 G .516
-(hat the speci\214ed data format may contain.)-3.016 F .515(In general,)
-5.515 F F1(beams_amp)3.015 E F0 .515(will either be zero)3.015 F .745
-(or equal to)108 696 R F1(beams_bath)3.245 E F0 5.745(.I)C 3.245(no)
--5.745 G .746
-(rder to successfully write data, the calling program must pro)-3.245 F
-.746(vide pointers to)-.15 F 1.251(arrays lar)108 708 R 1.251
-(ge enough to hold)-.18 F F1(beams_bath)3.751 E F0(bath)3.751 E 1.251
-(ymetry v)-.05 F(alues,)-.25 E F1(beams_amp)3.751 E F0 1.251
-(amplitude v)3.751 F 1.25(alues, and)-.25 F F1(pixels_ss)3.75 E F0
-(sidescan v)108 720 Q(alues.)-.25 E(MB-System 5.0)72 768 Q
-(26 October 2009)137.055 E(17)190.395 E 0 Cg EP
-%%Page: 18 18
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F -.15(Fo)108 84 S 3.283(rm).15 G .783
-(ost data formats, the initial maximum beam and pix)-3.283 F .783
-(el dimensions will not change.)-.15 F(Ho)5.783 E(we)-.25 E -.15(ve)-.25
-G 1.584 -.4(r, a f).15 H -.25(ew).4 G 1.479(formats support both v)108
-96 R 1.479(ariable and arbitrarily lar)-.25 F 1.478
-(ge numbers of beams and/or pix)-.18 F 1.478(els, and so applications)
--.15 F 1.094(must be capable of handling dynamic changes in the numbers\
- of beams and pix)108 108 R 1.095(els. The arrays allocated)-.15 F .629
-(internally in the)108 120 R/F1 10/Times-Italic at 0 SF(mbio_ptr)3.129 E F0
-.629(structure are automatically increased when necessary)3.129 F 3.128
-(.H)-.65 G -.25(ow)-3.128 G -2.15 -.25(ev e).25 H 1.428 -.4(r, i).25 H
-3.128(no).4 G .628(rder to suc-)-3.128 F .33
-(cessfully insert modi\214ed sw)108 132 R .33(ath data using)-.1 F F1
-(mb_put)2.83 E F0(,)A F1(mb_put_all)2.83 E F0 2.83(,o)C(r)-2.83 E F1
-(mb_insert)2.83 E F0 2.83(,a)C 2.83(na)-2.83 G .33
-(pplication must also pro-)-2.83 F .042(vide pointers to arrays lar)108
-144 R .041(ge enough to hold the current maximum numbers of bath)-.18 F
-.041(ymetry beams, amplitude)-.05 F .294(beams, and sidescan pix)108 156
-R .294(els. The function)-.15 F F1(mb_r)2.794 E -.4(eg)-.37 G
-(ister_ioarr).4 E(ay)-.15 E F0(allo)2.794 E .294(ws applications to re)
--.25 F .295(gister array pointers)-.15 F .231
-(so that these arrays are also dynamically allocated by)108 168 R F1
-(MBIO)2.731 E F0 2.731(.R)C -.15(eg)-2.731 G .231
-(istered arrays will be managed as data are).15 F
-(read and written and then freed when)108 180 Q/F2 10/Times-Bold at 0 SF
-(mb_close)2.5 E F0(is called.)2.5 E 2.831(As)108 204 S .331(tatus v)
--2.831 F .331(alue indicating success or f)-.25 F .331
-(ailure is returned; an error v)-.1 F .331(alue ar)-.25 F .332
-(gument passes more detailed infor)-.18 F(-)-.2 E
-(mation about initialization f)108 216 Q(ailures.)-.1 E
-(---------------------------------------------------------)108 240 Q
-(int)108 252 Q F2(mb_r)2.5 E(egister_array)-.18 E F0(\()A(int)180 264 Q
-F1(verbose)2.5 E F0(,)A -.2(vo)180 276 S(id *).2 E F1(mbio_ptr)A F0(,)A
-(int)180 288 Q F1(type)2.5 E F0(,)A(int)180 300 Q F1(size)2.5 E F0(,)A
--.2(vo)180 312 S(id **).2 E F1(handle)A F0(,)A(int)180 324 Q F1(*err)2.5
-E(or)-.45 E F0(\))A(Re)108 348 Q .835(gisters an array pointer *)-.15 F
-F1(handle)A F0 .835
-(so that the size of the allocated array can be managed dynamically by)
-3.335 F F2(MBIO)108 360 Q F0 5.356(.N)C .356(ote that the location)
--5.356 F F1 .356(**handle of the arr)2.856 F .357
-(ay pointer must be supplied, not the pointer value *han-)-.15 F(dle)108
-372 Q 5.283(.T)-.15 G .283
-(he pointer value *handle should initially be NULL.)-5.283 F .282
-(The type value indicates whether this arr)5.282 F .282(ay is to)-.15 F
-.231(be dimensioned accor)108 384 R .231(ding to the maximum number of \
-bathymetry beams \(type = 1\), amplitude beams \(type)-.37 F 3.082(=2)
-108 396 S .582(\), or sidescan pixels \(type = 3\). The size value indi\
-cates the size of eac)-3.082 F 3.082(he)-.15 G .582(lement arr)-3.082 F
-.582(ay in bytes \(e)-.15 F(.g)-.15 E 3.081(.a)-.15 G -.15(ch)108 408 S
-.043(ar arr).15 F .043(ay has size = 1, a short arr)-.15 F .043
-(ay has size = 2, an int arr)-.15 F .043(ay or a \215oat arr)-.15 F .043
-(ay have size = 4, and a double)-.15 F(arr)108 420 Q 2.097
-(ay has size = 8\). The arr)-.15 F 2.097(ay is associated with the)-.15
-F F2(MBIO)4.596 E F1 2.096(descriptor mbio_ptr)4.596 F 4.596(,a)-1.11 G
-2.096(nd is fr)-4.596 F 2.096(eed when)-.37 F
-(mb_close is called for this particular mbio_ptr)108 432 Q(.)-1.11 E
-(---------------------------------------------------------)108 456 Q
-(int)108 468 Q F2(mb_close)2.5 E F1(\()A(int verbose)180 480 Q(,)-.1 E
--.15(ch)180 492 S(ar *mbio_ptr).15 E(,)-1.11 E(int *err)180 504 Q(or\))
--.45 E .809(Closes the data \214le listed in the)108 528 R F2(MBIO)3.309
-E F1 .81(descriptor pointed to by mbio_ptr and r)3.309 F .81
-(eleases all specially allo-)-.37 F 1.103(cated memory)108 540 R 3.603
-(,i)-.55 G 1.103(ncluding all application arr)-3.603 F 1.103(ays r)-.15
-F -.4(eg)-.37 G(ister).4 E 1.103(ed using)-.37 F F2(mb_r)3.603 E
-(egister_array)-.18 E F1 3.602(.. The)B 1.102(verbose value)3.602 F
-(contr)108 552 Q .661(ols the standar)-.45 F 3.161(de)-.37 G(rr)-3.161 E
-.661(or output verbosity of the function. A status value indicating suc\
-cess or failur)-.45 F 3.162(ei)-.37 G(s)-3.162 E -.37(re)108 564 S
-(turned; an err).37 E(or value ar)-.45 E(gument passes mor)-.37 E 2.5
-(ed)-.37 G(etailed information about failur)-2.5 E(es.)-.37 E/F3 10.95
-/Times-Bold at 0 SF(LEVEL 1 FUNCTIONS)72 580.8 Q F0
-(---------------------------------------------------------)108 592.8 Q
-(int)108 604.8 Q F2(mb_r)2.5 E(ead)-.18 E F0(\()A(int)180 616.8 Q F1
-(verbose)2.5 E F0(,)A(char)180 628.8 Q F1(*mbio_ptr)2.5 E F0(,)A(int)180
-640.8 Q F1(*kind)2.5 E F0(,)A(int)180 652.8 Q F1(*pings)2.5 E F0(,)A
-(int)180 664.8 Q F1(time_i[7])2.5 E F0(,)A(double)180 676.8 Q F1
-(*time_d)2.5 E F0(,)A(double)180 688.8 Q F1(*navlon)2.5 E F0(,)A(double)
-180 700.8 Q F1(*navlat)2.5 E F0(,)A(double)180 712.8 Q F1(*speed)2.5 E
-F0(,)A(double)180 724.8 Q F1(*heading)2.5 E F0(,)A(MB-System 5.0)72 768
-Q(26 October 2009)137.055 E(18)190.395 E 0 Cg EP
-%%Page: 19 19
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F(double)180 84 Q/F1 10/Times-Italic at 0 SF(*distance)
-2.5 E F0(,)A(double)180 96 Q F1(*altitude)2.5 E F0(,)A(double)180 108 Q
-F1(*sonar)2.5 E(depth)-.37 E F0(,)A(int)180 120 Q F1(*nbath)2.5 E F0(,)A
-(int)180 132 Q F1(*namp)2.5 E F0(,)A(int)180 144 Q F1(*nss)2.5 E F0(,)A
-(char)180 156 Q F1(*beam\215a)2.5 E(g)-.1 E F0(,)A(double)180 168 Q F1
-(*bath)2.5 E F0(,)A(double)180 180 Q F1(*amp)2.5 E F0(,)A(double)180 192
-Q F1(*bathlon)2.5 E F0(,)A(double)180 204 Q F1(*bathlat)2.5 E F0(,)A
-(double)180 216 Q F1(*ss)2.5 E F0(,)A(double)180 228 Q F1(*sslon)2.5 E
-F0(,)A(double)180 240 Q F1(*sslat)2.5 E F0(,)A(char)180 252 Q F1
-(*comment)2.5 E F0(,)A(int)180 264 Q F1(*err)2.5 E(or)-.45 E F0(\);)A
-.559(The function)108 288 R/F2 10/Times-Bold at 0 SF(mb_r)3.059 E(ead)-.18
-E F0 .559(reads, processes, and returns sonar data according to the)
-3.059 F F2(MBIO)3.058 E F0 .558(descriptor pointed)3.058 F .622(to by)
-108 300 R F1(mbio_ptr)3.122 E F0 5.622(.T)C(he)-5.622 E F1(verbose)3.122
-E F0 -.25(va)3.122 G .622(lue controls the standard error output v).25 F
-.623(erbosity of the function. A number)-.15 F .388(of dif)108 312 R
-.388(ferent data record types are recognized by)-.25 F F2(MB-System)
-2.888 E F0 2.888(,b)C(ut)-3.088 E F2(mb_r)2.888 E(ead\(\))-.18 E F0 .388
-(only returns surv)2.888 F .688 -.15(ey a)-.15 H .388(nd com-).15 F .354
-(ment data records. The)108 324 R F1(kind)2.854 E F0 -.25(va)2.854 G
-.354(lue indicates which type of record has been read.).25 F .354
-(The data is in the form of)5.354 F(bath)108 336 Q(ymetry)-.05 E 3.389
-(,a)-.65 G .889(mplitude, and sidescan v)-3.389 F .888
-(alues combined with the longitude and latitude locations of the ba-)
--.25 F(th)108 348 Q(ymetry and sidescan measurements \(amplitudes are c\
-oincident with the bath)-.05 E(ymetry\).)-.05 E(The return v)108 372 Q
-(alues are:)-.25 E F1(kind)144 384 Q F0 52(:k)C(ind of data record read)
--52 E 31(1s)288 396 S(urv)-31 E .3 -.15(ey d)-.15 H(ata).15 E 31(2c)288
-408 S(omment)-31 E 17.22(>=3 other)288 420 R(data that cannot)2.5 E
-(be passed by)324 432 Q F2(mb_r)2.5 E(ead)-.18 E F1(pings)144 444 Q F0
-47.55(:n)C(umber of pings a)-47.55 E -.15(ve)-.2 G(raged to gi).15 E .3
--.15(ve c)-.25 H(urrent data).15 E F1(time_i)144 456 Q F0 44.22(:t)C
-(ime of current ping)-44.22 E F1(time_i)216 468 Q F0([0]: year)A F1
-(time_i)216 480 Q F0([1]: month)A F1(time_i)216 492 Q F0([2]: day)A F1
-(time_i)216 504 Q F0([3]: hour)A F1(time_i)216 516 Q F0([4]: minute)A F1
-(time_i)216 528 Q F0([5]: second)A F1(time_i)216 540 Q F0
-([6]: microsecond)A F1(time_d)144 552 Q F0 42(:t)C
-(ime of current ping in seconds)-42 E(since 1/1/70 00:00:00)216 564 Q F1
-(navlon)144 576 Q F0 42(:l)C(ongitude)-42 E F1(navlat)144 588 Q F0 44.22
-(:l)C(atitude)-44.22 E F1(speed)144 600 Q F0 46.45(:s)C
-(hip speed in km/s)-46.45 E F1(heading)144 612 Q F0 37(:s)C
-(hip heading in de)-37 E(grees)-.15 E F1(distance)144 624 Q F0 71.89(:d)
-C(istance along shiptrack since last)-71.89 E(ping in km)216 636 Q F1
-(altitude)144 648 Q F0 38.66(:a)C(ltitude of sonar abo)-38.66 E .3 -.15
-(ve s)-.15 H(ea\215oor).15 E(in m)216 660 Q F1(sonar)144 672 Q(depth)
--.37 E F0 24.59(:d)C(epth of sonar in m)-24.59 E F1(nbath)144 684 Q F0
-46.44(:n)C(umber of bath)-46.44 E(ymetry v)-.05 E(alues)-.25 E F1(namp)
-144 696 Q F0 47(:n)C(umber of amplitude v)-47 E(alues)-.25 E F1(nss)144
-708 Q F0 56.44(:n)C(umber of sidescan v)-56.44 E(alues)-.25 E F1
-(beam\215a)144 720 Q(g)-.1 E F0 68.66(:a)C(rray of bath)-68.66 E
-(ymetry \215ags)-.05 E(MB-System 5.0)72 768 Q(26 October 2009)137.055 E
-(19)190.395 E 0 Cg EP
-%%Page: 20 20
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F/F1 10/Times-Italic at 0 SF(bath)144 84 Q F0 51.44(:a)C
-(rray of bath)-51.44 E(ymetry v)-.05 E(alues in meters)-.25 E F1(amp)144
-96 Q F0 52(:a)C(rray of amplitude v)-52 E(alues in unkno)-.25 E
-(wn units)-.25 E F1(bathlon)144 108 Q F0 38.66(:a)C
-(rray of of longitude v)-38.66 E(alues corresponding)-.25 E(to bath)216
-120 Q(ymetry)-.05 E F1(bathlat)144 132 Q F0 40.88(:a)C
-(rray of of latitude v)-40.88 E(alues corresponding)-.25 E(to bath)216
-144 Q(ymetry)-.05 E F1(ss)144 156 Q F0 61.44(:a)C(rray of sidescan v)
--61.44 E(alues in unkno)-.25 E(wn units)-.25 E F1(sslon)144 168 Q F0
-48.66(:a)C(rray of of longitude v)-48.66 E(alues corresponding)-.25 E
-(to sidescan)216 180 Q F1(sslat)144 192 Q F0 50.88(:a)C
-(rray of of latitude v)-50.88 E(alues corresponding)-.25 E(to sidescan)
-216 204 Q F1(comment)144 216 Q F0 33.12(:c)C(omment string)-33.12 E F1
-(err)144 228 Q(or)-.45 E F0 48.56(:e)C(rror v)-48.56 E(alue)-.25 E 2.776
-(As)108 252 S .276(tatus v)-2.776 F .277(alue indicating success or f)
--.25 F .277(ailure is returned; the error v)-.1 F .277(alue ar)-.25 F
-(gument)-.18 E F1(err)2.777 E(or)-.45 E F0 .277(passes more detailed)
-2.777 F(information about read f)108 264 Q(ailures.)-.1 E
-(---------------------------------------------------------)108 288 Q
-(int)108 300 Q/F2 10/Times-Bold at 0 SF(mb_get)2.5 E F0(\()A(int)180 312 Q
-F1(verbose)2.5 E F0(,)A(char)180 324 Q F1(*mbio_ptr)2.5 E F0(,)A(int)180
-336 Q F1(*kind)2.5 E F0(,)A(int)180 348 Q F1(*pings)2.5 E F0(,)A(int)180
-360 Q F1(time_i[7])2.5 E F0(,)A(double)180 372 Q F1(*time_d)2.5 E F0(,)A
-(double)180 384 Q F1(*navlon)2.5 E F0(,)A(double)180 396 Q F1(*navlat)
-2.5 E F0(,)A(double)180 408 Q F1(*speed)2.5 E F0(,)A(double)180 420 Q F1
-(*heading)2.5 E F0(,)A(double)180 432 Q F1(*distance)2.5 E F0(,)A
-(double)180 444 Q F1(*altitude)2.5 E F0(,)A(double)180 456 Q F1(*sonar)
-2.5 E(depth)-.37 E F0(,)A(int)180 468 Q F1(*nbath)2.5 E F0(,)A(int)180
-480 Q F1(*namp)2.5 E F0(,)A(int)180 492 Q F1(*nss)2.5 E F0(,)A(char)180
-504 Q F1(*beam\215a)2.5 E(g)-.1 E F0(,)A(double)180 516 Q F1(*bath)2.5 E
-F0(,)A(double)180 528 Q F1(*amp)2.5 E F0(,)A(double)180 540 Q F1
-(*bathacr)2.5 E(osstr)-.45 E(ac)-.15 E(k)-.2 E F0(,)A(double)180 552 Q
-F1(*bathalongtr)2.5 E(ac)-.15 E(k)-.2 E F0(,)A(double)180 564 Q F1(*ss)
-2.5 E F0(,)A(double)180 576 Q F1(*ssacr)2.5 E(osstr)-.45 E(ac)-.15 E(k)
--.2 E F0(,)A(double)180 588 Q F1(*ssalongtr)2.5 E(ac)-.15 E(k)-.2 E F0
-(,)A(char)180 600 Q F1(*comment)2.5 E F0(,)A(int)180 612 Q F1(*err)2.5 E
-(or)-.45 E F0(\);)A .269(The function)108 636 R F2(mb_get)2.769 E F0
-.269(reads, processes, and returns sonar data according to the)2.769 F
-F2(MBIO)2.768 E F0 .268(descriptor pointed to)2.768 F(by)108 648 Q F1
-(mbio_ptr)3.088 E F0 5.588(.T)C(he)-5.588 E F1(verbose)3.088 E F0 -.25
-(va)3.088 G .588(lue controls the standard error output v).25 F .588
-(erbosity of the function. A number of)-.15 F(dif)108 660 Q .462
-(ferent data record types are recognized by)-.25 F F2(MB-System)2.962 E
-F0 2.962(,b)C(ut)-3.162 E F2(mb_get\(\))2.962 E F0 .462
-(only returns surv)2.962 F .762 -.15(ey a)-.15 H .462(nd comment).15 F
-.715(data records. The)108 672 R F1(kind)3.215 E F0 -.25(va)3.215 G .715
-(lue indicates which type of record has been read.).25 F .716
-(The data is in the form of ba-)5.716 F(th)108 684 Q(ymetry)-.05 E 2.529
-(,a)-.65 G .029(mplitude, and sidescan v)-2.529 F .028
-(alues combined with the acrosstrack and alongtrack distances relati)
--.25 F .328 -.15(ve t)-.25 H(o).15 E .378(the na)108 696 R(vig)-.2 E
-.378(ation of the bath)-.05 F .379(ymetry and sidescan measurements \(a\
-mplitudes are coincident with the bath)-.05 F(yme-)-.05 E(try v)108 708
-Q(alues\).)-.25 E(MB-System 5.0)72 768 Q(26 October 2009)137.055 E(20)
-190.395 E 0 Cg EP
-%%Page: 21 21
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F(The return v)108 84 Q(alues are:)-.25 E/F1 10
-/Times-Italic at 0 SF(kind)144 96 Q F0 52(:k)C(ind of data record read)-52
-E 31(1s)288 108 S(urv)-31 E .3 -.15(ey d)-.15 H(ata).15 E 31(2c)288 120
-S(omment)-31 E 17.22(>=3 other)288 132 R(data that cannot)2.5 E
-(be passed by)324 144 Q/F2 10/Times-Bold at 0 SF(mb_get)2.5 E F1(pings)144
-156 Q F0 47.55(:n)C(umber of pings a)-47.55 E -.15(ve)-.2 G(raged to gi)
-.15 E .3 -.15(ve c)-.25 H(urrent data).15 E F1(time_i)144 168 Q F0 44.22
-(:t)C(ime of current ping)-44.22 E F1(time_i)216 180 Q F0([0]: year)A F1
-(time_i)216 192 Q F0([1]: month)A F1(time_i)216 204 Q F0([2]: day)A F1
-(time_i)216 216 Q F0([3]: hour)A F1(time_i)216 228 Q F0([4]: minute)A F1
-(time_i)216 240 Q F0([5]: second)A F1(time_i)216 252 Q F0
-([6]: microsecond)A F1(time_d)144 264 Q F0 42(:t)C
-(ime of current ping in seconds)-42 E(since 1/1/70 00:00:00)216 276 Q F1
-(navlon)144 288 Q F0 42(:l)C(ongitude)-42 E F1(navlat)144 300 Q F0 44.22
-(:l)C(atitude)-44.22 E F1(speed)144 312 Q F0 46.45(:s)C
-(hip speed in km/s)-46.45 E F1(heading)144 324 Q F0 37(:s)C
-(hip heading in de)-37 E(grees)-.15 E F1(distance)144 336 Q F0 35.89(:d)
-C(istance along shiptrack since last)-35.89 E(ping in km)216 348 Q F1
-(altitude)144 360 Q F0 38.66(:a)C(ltitude of sonar abo)-38.66 E .3 -.15
-(ve s)-.15 H(ea\215oor).15 E(in m)216 372 Q F1(sonar)144 384 Q(depth)
--.37 E F0 24.59(:d)C(epth of sonar in m)-24.59 E F1(nbath)144 396 Q F0
-46.44(:n)C(umber of bath)-46.44 E(ymetry v)-.05 E(alues)-.25 E F1(namp)
-144 408 Q F0 47(:n)C(umber of amplitude v)-47 E(alues)-.25 E F1(nss)144
-420 Q F0 56.44(:n)C(umber of sidescan v)-56.44 E(alues)-.25 E F1
-(beam\215a)144 432 Q(g)-.1 E F0 68.66(:a)C(rray of bath)-68.66 E
-(ymetry \215ags)-.05 E F1(bath)144 444 Q F0 51.44(:a)C(rray of bath)
--51.44 E(ymetry v)-.05 E(alues in meters)-.25 E F1(amp)144 456 Q F0 52
-(:a)C(rray of amplitude v)-52 E(alues in unkno)-.25 E(wn units)-.25 E F1
-(bathacr)144 468 Q(osstr)-.45 E(ac)-.15 E(k)-.2 E F0 5.58(:a)C
-(rray of of acrosstrack distances)-5.58 E
-(in meters corresponding to bath)216 480 Q(ymetry)-.05 E F1(bathalongtr)
-144 492 Q(ac)-.15 E(k)-.2 E F0 8.46(:a)C
-(rray of of alongtrack distances)-8.46 E
-(in meters corresponding to bath)216 504 Q(ymetry)-.05 E F1(ss)144 516 Q
-F0 61.44(:a)C(rray of sidescan v)-61.44 E(alues in unkno)-.25 E
-(wn units)-.25 E F1(ssacr)144 528 Q(osstr)-.45 E(ac)-.15 E(k)-.2 E F0
-15.58(:a)C(rray of of acrosstrack distances)-15.58 E
-(in meters corresponding to sidescan)216 540 Q F1(ssacr)144 552 Q(osstr)
--.45 E(ac)-.15 E(k)-.2 E F0 15.58(:a)C(rray of of alongtrack distances)
--15.58 E(in meters corresponding to sidescan)216 564 Q F1(comment)144
-576 Q F0 69.12(:c)C(omment string)-69.12 E F1(err)144 588 Q(or)-.45 E F0
-48.56(:e)C(rror v)-48.56 E(alue)-.25 E 2.777(As)108 612 S .277(tatus v)
--2.777 F .277(alue indicating success or f)-.25 F .277
-(ailure is returned; the error v)-.1 F .277(alue ar)-.25 F(gument)-.18 E
-F1(err)2.777 E(or)-.45 E F0 .276(passes more detailed)2.777 F
-(information about read f)108 624 Q(ailures.)-.1 E/F3 10.95/Times-Bold at 0
-SF(LEVEL 2 FUNCTIONS)72 652.8 Q F0(int)108 664.8 Q F2(mb_r)2.5 E
-(ead_ping)-.18 E F0(\()A(int)180 676.8 Q F1(verbose)2.5 E F0(,)A(char)
-180 688.8 Q F1(*mbio_ptr)2.5 E F0(,)A(char)180 700.8 Q F1(*stor)2.5 E
-(e_ptr)-.37 E F0(,)A(int)180 712.8 Q F1(*kind)2.5 E F0(,)A(int)180 724.8
-Q F1(*err)2.5 E(or)-.45 E F0(\);)A(MB-System 5.0)72 768 Q
-(26 October 2009)137.055 E(21)190.395 E 0 Cg EP
-%%Page: 22 22
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F .464(The function)108 84 R/F1 10/Times-Bold at 0 SF
-(mb_r)2.964 E(ead_ping)-.18 E F0 .464
-(reads and returns sonar data according to the)2.964 F F1(MBIO)2.964 E
-F0 .464(descriptor pointed to by)2.964 F/F2 10/Times-Italic at 0 SF
-(mbio_ptr)108 96 Q F0 6.776(.T)C(he)-6.776 E F2(verbose)4.276 E F0 -.25
-(va)4.276 G 1.775(lue controls the standard error output v).25 F 1.775
-(erbosity of the function.)-.15 F 1.775(The data is)6.775 F .231
-(returned one record at a time; no a)108 108 R -.15(ve)-.2 G .231
-(raging is performed.).15 F 2.731(Ap)5.231 G .231
-(ointer to a data structure containing all of the)-2.731 F .599
-(data read is returned as)108 120 R F2(stor)3.099 E(e_ptr)-.37 E F0
-3.099(;t)C .599(he form of the data structure is determined by the sona\
-r system associ-)-3.099 F .154
-(ated with the format of the data being read. A number of dif)108 132 R
-.154(ferent data record types are recognized by)-.25 F F1(MB-)2.655 E
-(System)108 144 Q F0 2.5(;t)C(he)-2.5 E F2(kind)2.5 E F0 -.25(va)2.5 G
-(lue indicates which type of record has been read.).25 E(The return v)
-108 168 Q(alues are:)-.25 E F2(stor)144 180 Q(e_ptr)-.37 E F0 32.92(:p)C
-(ointer to complete data structure)-32.92 E F2(kind)144 192 Q F0 52(:k)C
-(ind of data record read)-52 E 31(1s)288 204 S(urv)-31 E .3 -.15(ey d)
--.15 H(ata).15 E 31(2c)288 216 S(omment)-31 E 31(3h)288 228 S(eader)-31
-E 31(4c)288 240 S(alibrate)-31 E 31(5m)288 252 S(ean sound speed)-31 E
-31(6S)288 264 S(VP)-31 E 31(7s)288 276 S(tandby)-31 E 31(8n)288 288 S .4
--.2(av s)-31 H(ource).2 E 31(9p)288 300 S(arameter)-31 E 23.5(10 start)
-288 312 R 23.5(11 stop)288 324 R 23.5(12 na)288 336 R(v)-.2 E 23.5
-(13 run)288 348 R(parameter)2.5 E 23.5(14 clock)288 360 R 23.5(15 tide)
-288 372 R 23.5(16 height)288 384 R 23.5(17 heading)288 396 R 23.5
-(18 attitude)288 408 R 23.5(19 ssv)288 420 R 23.5(20 angle)288 432 R
-23.5(21 e)288 444 R -.15(ve)-.25 G(nt).15 E 23.5(22 history)288 456 R
-23.5(23 summary)288 468 R 23.5(24 processing)288 480 R(parameters)2.5 E
-23.5(25 sensor)288 492 R(parameters)2.5 E 23.5(26 na)288 504 R(vig)-.2 E
-(ation error)-.05 E 23.5(27 uninterpretable)288 516 R(line)2.5 E F2(err)
-144 528 Q(or)-.45 E F0 48.56(:e)C(rror v)-48.56 E(alue)-.25 E 2.777(As)
-108 552 S .277(tatus v)-2.777 F .277(alue indicating success or f)-.25 F
-.277(ailure is returned; the error v)-.1 F .277(alue ar)-.25 F(gument)
--.18 E F2(err)2.777 E(or)-.45 E F0 .276(passes more detailed)2.777 F
-(information about read f)108 564 Q(ailures.)-.1 E
-(---------------------------------------------------------)108 588 Q
-(int)108 600 Q F1(mb_write_ping)2.5 E F0(\()A(int)180 612 Q F2(verbose)
-2.5 E F0(,)A(char)180 624 Q F2(*mbio_ptr)2.5 E F0(,)A(char)180 636 Q F2
-(*stor)2.5 E(e_ptr)-.37 E F0(,)A(int)180 648 Q F2(*err)2.5 E(or)-.45 E
-F0(\);)A 1.585(The function)108 672 R F1(mb_write_ping)4.085 E F0 1.585
-(writes sonar data to the \214le listed in the)4.085 F F1(MBIO)4.085 E
-F0 1.585(descriptor pointed to by)4.085 F F2(MBIO_ptr)108 684 Q F0 5.641
-(.T)C(he)-5.641 E F2(verbose)3.141 E F0 -.25(va)3.141 G .641
-(lue controls the standard error output v).25 F .64
-(erbosity of the function.)-.15 F 3.14(Ap)5.64 G .64(ointer to a)-3.14 F
-.622(data structure containing all of the data read is passed as)108 696
-R F2(stor)3.122 E(e_ptr)-.37 E F0 3.122(;t)C .622
-(he form of the data structure is deter)-3.122 F(-)-.2 E .9(mined by th\
-e sonar system associated with the format of the data being written.)108
-708 R .899(The v)5.899 F .899(alues to be output)-.25 F(are:)108 720 Q
-(MB-System 5.0)72 768 Q(26 October 2009)137.055 E(22)190.395 E 0 Cg EP
-%%Page: 23 23
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F/F1 10/Times-Italic at 0 SF(stor)144 84 Q(e_ptr)-.37 E
-F0 32.92(:p)C(ointer to complete data structure)-32.92 E(The return v)
-108 108 Q(alues are:)-.25 E F1(err)144 120 Q(or)-.45 E F0 48.56(:e)C
-(rror v)-48.56 E(alue)-.25 E 2.776(As)108 144 S .276(tatus v)-2.776 F
-.277(alue indicating success or f)-.25 F .277
-(ailure is returned; the error v)-.1 F .277(alue ar)-.25 F(gument)-.18 E
-F1(err)2.777 E(or)-.45 E F0 .277(passes more detailed)2.777 F
-(information about write f)108 156 Q(ailures.)-.1 E
-(---------------------------------------------------------)108 180 Q
-(int)108 192 Q/F2 10/Times-Bold at 0 SF(mb_get_stor)2.5 E(e)-.18 E F0(\()A
-(int)180 204 Q F1(verbose)2.5 E F0(,)A(char)180 216 Q F1(*mbio_ptr)2.5 E
-F0(,)A(char)180 228 Q F1(**stor)2.5 E(e_ptr)-.37 E F0(,)A(int)180 240 Q
-F1(*err)2.5 E(or)-.45 E F0(\);)A 1.3(The function)108 264 R F2
-(mb_get_stor)3.8 E(e\(\))-.18 E F0 1.3(returns a pointer)3.8 F F1(*stor)
-3.799 E(e_ptr)-.37 E F0 1.299
-(to the data storage structure associated with a)3.799 F(particular)108
-276 Q F2(MBIO)3.918 E F0(descriptor)3.918 E F1(mbio_ptr)3.918 E F0 3.918
-(.T)C(he)-3.918 E F2(mb_r)3.918 E(ead_init\(\))-.18 E F0(and)3.918 E F2
-(mb_write_init\(\))3.918 E F0 1.418(functions both allocate)3.918 F .874
-(one of these internal storage structures. The form of the data structu\
-re is determined by the sonar system)108 288 R .232
-(associated with the format of the data being written.)108 300 R .233
-(Storage structure pointers must be passed to le)5.232 F -.15(ve)-.25 G
-2.733(lt).15 G -.1(wo)-2.733 G F2(MBIO)108 312 Q F0 .073
-(functions such as)2.573 F F2(mb_write_ping\(\))2.573 E F0(and)2.572 E
-F2(mb_insert\(\))2.572 E F0 5.072(.T)C(he)-5.072 E F1(verbose)2.572 E F0
--.25(va)2.572 G .072(lue controls the standard error).25 F(output v)108
-324 Q(erbosity of the function.)-.15 E(The return v)108 348 Q
-(alues are:)-.25 E F1(stor)144 360 Q(e_ptr)-.37 E F0 32.92(:p)C
-(ointer to complete data structure)-32.92 E F1(err)144 372 Q(or)-.45 E
-F0 48.56(:e)C(rror v)-48.56 E(alue)-.25 E 2.776(As)108 396 S .276
-(tatus v)-2.776 F .277(alue indicating success or f)-.25 F .277
-(ailure is returned; the error v)-.1 F .277(alue ar)-.25 F(gument)-.18 E
-F1(err)2.777 E(or)-.45 E F0 .277(passes more detailed)2.777 F
-(information about f)108 408 Q(ailures.)-.1 E
-(---------------------------------------------------------)108 432 Q
-(int)108 444 Q F2(mb_get_all)2.5 E F0(\()A(int)180 456 Q F1(verbose)2.5
-E F0(,)A(char)180 468 Q F1(*mbio_ptr)2.5 E F0(,)A(char)180 480 Q F1
-(**stor)2.5 E(e_ptr)-.37 E F0(,)A(int)180 492 Q F1(*kind)2.5 E F0(,)A
-(int)180 504 Q F1(time_i[7])2.5 E F0(,)A(double)180 516 Q F1(*time_d)2.5
-E F0(,)A(double)180 528 Q F1(*navlon)2.5 E F0(,)A(double)180 540 Q F1
-(*navlat)2.5 E F0(,)A(double)180 552 Q F1(*speed)2.5 E F0(,)A(double)180
-564 Q F1(*heading)2.5 E F0(,)A(double)180 576 Q F1(*distance)2.5 E F0(,)
-A(double)180 588 Q F1(*altitude)2.5 E F0(,)A(double)180 600 Q F1(*sonar)
-2.5 E(depth)-.37 E F0(,)A(int)180 612 Q F1(*nbath)2.5 E F0(,)A(int)180
-624 Q F1(*namp)2.5 E F0(,)A(int)180 636 Q F1(*nss)2.5 E F0(,)A(char)180
-648 Q F1(*beam\215a)2.5 E(g)-.1 E F0(,)A(double)180 660 Q F1(*bath)2.5 E
-F0(,)A(double)180 672 Q F1(*amp)2.5 E F0(,)A(double)180 684 Q F1
-(*bathacr)2.5 E(osstr)-.45 E(ac)-.15 E(k)-.2 E F0(,)A(double)180 696 Q
-F1(*bathalongtr)2.5 E(ac)-.15 E(k)-.2 E F0(,)A(double)180 708 Q F1(*ss)
-2.5 E F0(,)A(double)180 720 Q F1(*ssacr)2.5 E(osstr)-.45 E(ac)-.15 E(k)
--.2 E F0(,)A(MB-System 5.0)72 768 Q(26 October 2009)137.055 E(23)190.395
-E 0 Cg EP
-%%Page: 24 24
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F(double)180 84 Q/F1 10/Times-Italic at 0 SF(*ssalongtr)
-2.5 E(ac)-.15 E(k)-.2 E F0(,)A(char)180 96 Q F1(*comment)2.5 E F0(,)A
-(int)180 108 Q F1(*err)2.5 E(or)-.45 E F0(\);)A 1.453(The function)108
-132 R/F2 10/Times-Bold at 0 SF(mb_get_all)3.953 E F0 1.453
-(reads and returns sonar data according to the)3.953 F F2(MBIO)3.952 E
-F0 1.452(descriptor pointed to by)3.952 F F1(mbio_ptr)108 144 Q F0 6.775
-(.T)C(he)-6.775 E F1(verbose)4.275 E F0 -.25(va)4.275 G 1.775
-(lue controls the standard error output v).25 F 1.776
-(erbosity of the function.)-.15 F 1.776(The data is)6.776 F .231
-(returned one record at a time; no a)108 156 R -.15(ve)-.2 G .231
-(raging is performed.).15 F 2.731(Ap)5.231 G .231
-(ointer to a data structure containing all of the)-2.731 F .598
-(data read is returned as)108 168 R F1(stor)3.099 E(e_ptr)-.37 E F0
-3.099(;t)C .599(he form of the data structure is determined by the sona\
-r system associ-)-3.099 F .154
-(ated with the format of the data being read. A number of dif)108 180 R
-.154(ferent data record types are recognized by)-.25 F F2(MB-)2.654 E
-(System)108 192 Q F0 2.8(;t)C(he)-2.8 E F1(kind)2.8 E F0 -.25(va)2.8 G
-.3(lue indicates which type of record has been read. Additional data is\
- returned if the data).25 F .62(record is surv)108 204 R .919 -.15(ey d)
--.15 H .619(ata \(na).15 F(vig)-.2 E .619(ation, bath)-.05 F(ymetry)-.05
-E 3.119(,a)-.65 G .619(mplitude, and sidescan\), na)-3.119 F(vig)-.2 E
-.619(ation data \(na)-.05 F(vig)-.2 E .619(ation only\),)-.05 F
-(or comment data \(comment only\).)108 216 Q(The return v)108 240 Q
-(alues are:)-.25 E F1(stor)144 252 Q(e_ptr)-.37 E F0 32.92(:p)C
-(ointer to complete data structure)-32.92 E F1(kind)144 264 Q F0 52(:k)C
-(ind of data record read)-52 E 31(1s)288 276 S(urv)-31 E .3 -.15(ey d)
--.15 H(ata).15 E 31(2c)288 288 S(omment)-31 E 31(3h)288 300 S(eader)-31
-E 31(4c)288 312 S(alibrate)-31 E 31(5m)288 324 S(ean sound speed)-31 E
-31(6S)288 336 S(VP)-31 E 31(7s)288 348 S(tandby)-31 E 31(8n)288 360 S .4
--.2(av s)-31 H(ource).2 E 31(9p)288 372 S(arameter)-31 E 23.5(10 start)
-288 384 R 23.5(11 stop)288 396 R 23.5(12 na)288 408 R(v)-.2 E 23.5
-(13 run)288 420 R(parameter)2.5 E 23.5(14 clock)288 432 R 23.5(15 tide)
-288 444 R 23.5(16 height)288 456 R 23.5(17 heading)288 468 R 23.5
-(18 attitude)288 480 R 23.5(19 ssv)288 492 R 23.5(20 angle)288 504 R
-23.5(21 e)288 516 R -.15(ve)-.25 G(nt).15 E 23.5(22 history)288 528 R
-23.5(23 summary)288 540 R 23.5(24 processing)288 552 R(parameters)2.5 E
-23.5(25 sensor)288 564 R(parameters)2.5 E 23.5(26 na)288 576 R(vig)-.2 E
-(ation error)-.05 E 23.5(27 uninterpretable)288 588 R(line)2.5 E F1
-(time_i)144 600 Q F0 44.22(:t)C(ime of current ping)-44.22 E F1(time_i)
-216 612 Q F0([0]: year)A F1(time_i)216 624 Q F0([1]: month)A F1(time_i)
-216 636 Q F0([2]: day)A F1(time_i)216 648 Q F0([3]: hour)A F1(time_i)216
-660 Q F0([4]: minute)A F1(time_i)216 672 Q F0([5]: second)A F1(time_i)
-216 684 Q F0([6]: microsecond)A F1(time_d)144 696 Q F0 42(:t)C
-(ime of current ping in seconds)-42 E(since 1/1/70 00:00:00)216 708 Q F1
-(navlon)144 720 Q F0 42(:l)C(ongitude)-42 E(MB-System 5.0)72 768 Q
-(26 October 2009)137.055 E(24)190.395 E 0 Cg EP
-%%Page: 25 25
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F/F1 10/Times-Italic at 0 SF(navlat)144 84 Q F0 44.22
-(:l)C(atitude)-44.22 E F1(speed)144 96 Q F0 46.45(:s)C
-(hip speed in km/s)-46.45 E F1(heading)144 108 Q F0 37(:s)C
-(hip heading in de)-37 E(grees)-.15 E F1(distance)144 120 Q F0 35.89(:d)
-C(istance along shiptrack since last)-35.89 E(ping in km)216 132 Q F1
-(altitude)144 144 Q F0 38.66(:a)C(ltitude of sonar abo)-38.66 E .3 -.15
-(ve s)-.15 H(ea\215oor).15 E(in m)216 156 Q F1(sonar)144 168 Q(depth)
--.37 E F0 24.59(:d)C(epth of sonar in m)-24.59 E F1(nbath)144 180 Q F0
-46.44(:n)C(umber of bath)-46.44 E(ymetry v)-.05 E(alues)-.25 E F1(namp)
-144 192 Q F0 47(:n)C(umber of amplitude v)-47 E(alues)-.25 E F1(nss)144
-204 Q F0 56.44(:n)C(umber of sidescan v)-56.44 E(alues)-.25 E F1
-(beam\215a)144 216 Q(g)-.1 E F0 68.66(:a)C(rray of bath)-68.66 E
-(ymetry \215ags)-.05 E F1(bath)144 228 Q F0 51.44(:a)C(rray of bath)
--51.44 E(ymetry v)-.05 E(alues in meters)-.25 E F1(amp)144 240 Q F0 52
-(:a)C(rray of amplitude v)-52 E(alues in unkno)-.25 E(wn units)-.25 E F1
-(bathacr)144 252 Q(osstr)-.45 E(ac)-.15 E(k)-.2 E F0 5.58(:a)C
-(rray of of acrosstrack distances)-5.58 E
-(in meters corresponding to bath)216 264 Q(ymetry)-.05 E F1(bathalongtr)
-144 276 Q(ac)-.15 E(k)-.2 E F0 8.46(:a)C
-(rray of of alongtrack distances)-8.46 E
-(in meters corresponding to bath)216 288 Q(ymetry)-.05 E F1(ss)144 300 Q
-F0 61.44(:a)C(rray of sidescan v)-61.44 E(alues in unkno)-.25 E
-(wn units)-.25 E F1(ssacr)144 312 Q(osstr)-.45 E(ac)-.15 E(k)-.2 E F0
-15.58(:a)C(rray of of acrosstrack distances)-15.58 E
-(in meters corresponding to sidescan)216 324 Q F1(ssacr)144 336 Q(osstr)
--.45 E(ac)-.15 E(k)-.2 E F0 15.58(:a)C(rray of of alongtrack distances)
--15.58 E(in meters corresponding to sidescan)216 348 Q F1(comment)144
-360 Q F0 33.12(:c)C(omment string)-33.12 E F1(err)144 372 Q(or)-.45 E F0
-48.56(:e)C(rror v)-48.56 E(alue)-.25 E 2.776(As)108 396 S .276(tatus v)
--2.776 F .277(alue indicating success or f)-.25 F .277
-(ailure is returned; the error v)-.1 F .277(alue ar)-.25 F(gument)-.18 E
-F1(err)2.777 E(or)-.45 E F0 .277(passes more detailed)2.777 F
-(information about read f)108 408 Q(ailures.)-.1 E
-(---------------------------------------------------------)108 432 Q
-(int)108 444 Q/F2 10/Times-Bold at 0 SF(mb_put_all)2.5 E F0(\()A(int)180
-456 Q F1(verbose)2.5 E F0(,)A(char)180 468 Q F1(*mbio_ptr)2.5 E F0(,)A
-(char)180 480 Q F1(*stor)2.5 E(e_ptr)-.37 E F0(,)A(int)180 492 Q F1(use)
-2.5 E(values)-.15 E F0(,)A(int)180 504 Q F1(kind)2.5 E F0(,)A(int)180
-516 Q F1(time_i[7])2.5 E F0(,)A(double)180 528 Q F1(time_d)2.5 E F0(,)A
-(double)180 540 Q F1(navlon)2.5 E F0(,)A(double)180 552 Q F1(navlat)2.5
-E F0(,)A(double)180 564 Q F1(speed)2.5 E F0(,)A(double)180 576 Q F1
-(heading)2.5 E F0(,)A(int)180 588 Q F1(nbath)2.5 E F0(,)A(int)180 600 Q
-F1(namp)2.5 E F0(,)A(int)180 612 Q F1(nss)2.5 E F0(,)A(char)180 624 Q F1
-(*beam\215a)2.5 E(g)-.1 E F0(,)A(double)180 636 Q F1(*bath)2.5 E F0(,)A
-(double)180 648 Q F1(*amp)2.5 E F0(,)A(double)180 660 Q F1(*bathacr)2.5
-E(osstr)-.45 E(ac)-.15 E(k)-.2 E F0(,)A(double)180 672 Q F1
-(*bathalongtr)2.5 E(ac)-.15 E(k)-.2 E F0(,)A(double)180 684 Q F1(*ss)2.5
-E F0(,)A(double)180 696 Q F1(*ssacr)2.5 E(osstr)-.45 E(ac)-.15 E(k)-.2 E
-F0(,)A(double)180 708 Q F1(*ssalongtr)2.5 E(ac)-.15 E(k)-.2 E F0(,)A
-(char)180 720 Q F1(*comment)2.5 E F0(,)A(MB-System 5.0)72 768 Q
-(26 October 2009)137.055 E(25)190.395 E 0 Cg EP
-%%Page: 26 26
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F(int)180 84 Q/F1 10/Times-Italic at 0 SF(*err)2.5 E(or)
--.45 E F0(\);)A 2.592(The function)108 108 R/F2 10/Times-Bold at 0 SF
-(mb_put_all)5.092 E F0 2.591
-(writes sonar data to the \214le listed in the)5.092 F F2(MBIO)5.091 E
-F0 2.591(descriptor pointed to by)5.091 F F1(MBIO_ptr)108 120 Q F0 5.64
-(.T)C(he)-5.64 E F1(verbose)3.14 E F0 -.25(va)3.14 G .64
-(lue controls the standard error output v).25 F .641
-(erbosity of the function.)-.15 F 3.141(Ap)5.641 G .641(ointer to a)
--3.141 F .622
-(data structure containing all of the data read is passed as)108 132 R
-F1(stor)3.122 E(e_ptr)-.37 E F0 3.122(;t)C .622
-(he form of the data structure is deter)-3.122 F(-)-.2 E .052(mined by \
-the sonar system associated with the format of the data being written.)
-108 144 R .053(Additional data is passed if)5.052 F .915
-(the data record is surv)108 156 R 1.215 -.15(ey d)-.15 H .915(ata \(na)
-.15 F(vig)-.2 E .915(ation, bath)-.05 F(ymetry)-.05 E 3.415(,a)-.65 G
-.914(mplitude, and sidescan\), na)-3.415 F(vig)-.2 E .914
-(ation data \(na)-.05 F(vig)-.2 E(a-)-.05 E .094
-(tion only\), or comment data \(comment only\).)108 168 R .094(If the)
-5.094 F F1(use)2.594 E(values)-.15 E F0 .095
-(\215ag is set to 1, then the passed v)2.594 F .095(alues will be)-.25 F
-.101(inserted in the data structure pointed to by)108 180 R F1(stor)
-2.601 E(e_ptr)-.37 E F0 .101(before the data is written.)2.601 F .101
-(If the)5.101 F F1(use)2.601 E(values)-.15 E F0 .101(\215ag is set to)
-2.601 F .645(0, the data structure pointed to by)108 192 R F1(stor)3.145
-E(e_ptr)-.37 E F0 .645(will be written without modi\214cation.)3.145 F
-.646(The v)5.646 F .646(alues to be output)-.25 F(are:)108 204 Q F1
-(stor)144 216 Q(e_ptr)-.37 E F0 32.92(:p)C
-(ointer to complete data structure)-32.92 E F1(use)144 228 Q(values)-.15
-E F0 30.49<3a8d>C(ag controlling use of data passed by v)-30.49 E(alue)
--.25 E 31(0d)288 240 S 2.5(on)-31 G(ot insert into data)-2.5 E
-(structure before writing)324 252 Q(the data)324 264 Q 31(1i)288 276 S
-(nsert into data structure)-31 E(before writing the data)324 288 Q F1
-(kind)144 300 Q F0 52(:k)C(ind of data record to be written)-52 E 31(1s)
-288 312 S(urv)-31 E .3 -.15(ey d)-.15 H(ata).15 E 31(2c)288 324 S
-(omment)-31 E 31(3h)288 336 S(eader)-31 E 31(4c)288 348 S(alibrate)-31 E
-31(5m)288 360 S(ean sound speed)-31 E 31(6S)288 372 S(VP)-31 E 31(7s)288
-384 S(tandby)-31 E 31(8n)288 396 S .4 -.2(av s)-31 H(ource).2 E 31(9p)
-288 408 S(arameter)-31 E 23.5(10 start)288 420 R 23.5(11 stop)288 432 R
-23.5(12 na)288 444 R(v)-.2 E 23.5(13 run)288 456 R(parameter)2.5 E 23.5
-(14 clock)288 468 R 23.5(15 tide)288 480 R 23.5(16 height)288 492 R 23.5
-(17 heading)288 504 R 23.5(18 attitude)288 516 R 23.5(19 ssv)288 528 R
-23.5(20 angle)288 540 R 23.5(21 e)288 552 R -.15(ve)-.25 G(nt).15 E 23.5
-(22 history)288 564 R 23.5(23 summary)288 576 R 23.5(24 processing)288
-588 R(parameters)2.5 E 23.5(25 sensor)288 600 R(parameters)2.5 E 23.5
-(26 na)288 612 R(vig)-.2 E(ation error)-.05 E 23.5(27 uninterpretable)
-288 624 R(line)2.5 E F1(time_i)144 636 Q F0 44.22(:t)C
-(ime of current ping \(used if)-44.22 E F1(time_i)2.5 E F0([0] != 0\))A
-F1(time_i)216 648 Q F0([0]: year)A F1(time_i)216 660 Q F0([1]: month)A
-F1(time_i)216 672 Q F0([2]: day)A F1(time_i)216 684 Q F0([3]: hour)A F1
-(time_i)216 696 Q F0([4]: minute)A F1(time_i)216 708 Q F0([5]: second)A
-F1(time_i)216 720 Q F0([6]: microsecond)A(MB-System 5.0)72 768 Q
-(26 October 2009)137.055 E(26)190.395 E 0 Cg EP
-%%Page: 27 27
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F/F1 10/Times-Italic at 0 SF(time_d)144 84 Q F0 42(:t)C
-(ime of current ping in seconds since)-42 E(1/1/70 00:00:00 \(used if)
-252 96 Q F1(time_i)2.5 E F0([0] = 0\))A F1(navlon)144 108 Q F0 42(:l)C
-(ongitude)-42 E F1(navlat)144 120 Q F0 44.22(:l)C(atitude)-44.22 E F1
-(speed)144 132 Q F0 46.45(:s)C(hip speed in km/s)-46.45 E F1(heading)144
-144 Q F0 37(:s)C(hip heading in de)-37 E(grees)-.15 E F1(nbath)144 156 Q
-F0 46.44(:n)C(umber of bath)-46.44 E(ymetry v)-.05 E(alues)-.25 E F1
-(namp)144 168 Q F0 47(:n)C(umber of amplitude v)-47 E(alues)-.25 E F1
-(nss)144 180 Q F0 56.44(:n)C(umber of sidescan v)-56.44 E(alues)-.25 E
-F1(beam\215a)144 192 Q(g)-.1 E F0 68.66(:a)C(rray of bath)-68.66 E
-(ymetry \215ags)-.05 E F1(bath)144 204 Q F0 51.44(:a)C(rray of bath)
--51.44 E(ymetry v)-.05 E(alues in meters)-.25 E F1(amp)144 216 Q F0 52
-(:a)C(rray of amplitude v)-52 E(alues in unkno)-.25 E(wn units)-.25 E F1
-(bathacr)144 228 Q(osstr)-.45 E(ac)-.15 E(k)-.2 E F0 5.58(:a)C
-(rray of of acrosstrack distances)-5.58 E
-(in meters corresponding to bath)216 240 Q(ymetry)-.05 E F1(bathalongtr)
-144 252 Q(ac)-.15 E(k)-.2 E F0 8.46(:a)C
-(rray of of alongtrack distances)-8.46 E
-(in meters corresponding to bath)216 264 Q(ymetry)-.05 E F1(ss)144 276 Q
-F0 61.44(:a)C(rray of sidescan v)-61.44 E(alues in unkno)-.25 E
-(wn units)-.25 E F1(ssacr)144 288 Q(osstr)-.45 E(ac)-.15 E(k)-.2 E F0
-15.58(:a)C(rray of of acrosstrack distances)-15.58 E
-(in meters corresponding to sidescan)216 300 Q F1(ssacr)144 312 Q(osstr)
--.45 E(ac)-.15 E(k)-.2 E F0 15.58(:a)C(rray of of alongtrack distances)
--15.58 E(in meters corresponding to sidescan)216 324 Q F1(comment)144
-336 Q F0 33.12(:c)C(omment string)-33.12 E(The return v)108 360 Q
-(alues are:)-.25 E F1(err)144 372 Q(or)-.45 E F0 48.56(:e)C(rror v)
--48.56 E(alue)-.25 E 2.777(As)108 396 S .277(tatus v)-2.777 F .277
-(alue indicating success or f)-.25 F .277
-(ailure is returned; the error v)-.1 F .277(alue ar)-.25 F(gument)-.18 E
-F1(err)2.777 E(or)-.45 E F0 .276(passes more detailed)2.777 F
-(information about write f)108 408 Q(ailures.)-.1 E
-(---------------------------------------------------------)108 432 Q
-(int)108 444 Q/F2 10/Times-Bold at 0 SF(mb_put_comment)2.5 E F0(\()A(int)
-180 456 Q F1(verbose)2.5 E F0(,)A(char)180 468 Q F1(*mbio_ptr)2.5 E F0
-(,)A(char)180 480 Q F1(*comment)2.5 E F0(,)A(int)180 492 Q F1(*err)2.5 E
-(or)-.45 E F0(\);)A .578(The function)108 516 R F2(mb_put_comment)3.078
-E F0 .578(writes a comment to the \214le listed in the)3.078 F F2(MBIO)
-3.078 E F0 .579(descriptor pointed to by)3.078 F F1(MBIO_ptr)108 528 Q
-F0 5.71(.T)C(he)-5.71 E F1(verbose)3.21 E F0 -.25(va)3.21 G .71
-(lue controls the standard error output v).25 F .71
-(erbosity of the function.)-.15 F .71(The data is in)5.71 F .507
-(the form of a null terminated string. The maximum length of comments v)
-108 540 R .507(aries with dif)-.25 F .507(ferent data formats.)-.25 F
-.504(In general indi)108 552 R .503(vidual comments should be less than\
- 80 characters long to insure compatibility with all for)-.25 F(-)-.2 E
-2.5(mats. The)108 564 R -.25(va)2.5 G(lues to be output are:).25 E F1
-(comment)144 576 Q F0 69.12(:c)C(omment string)-69.12 E(The return v)108
-600 Q(alues are:)-.25 E F1(err)144 612 Q(or)-.45 E F0 48.56(:e)C(rror v)
--48.56 E(alue)-.25 E 2.776(As)108 636 S .276(tatus v)-2.776 F .277
-(alue indicating success or f)-.25 F .277
-(ailure is returned; the error v)-.1 F .277(alue ar)-.25 F(gument)-.18 E
-F1(err)2.777 E(or)-.45 E F0 .277(passes more detailed)2.777 F
-(information about write f)108 648 Q(ailures.)-.1 E
-(---------------------------------------------------------)108 672 Q
-(int)108 684 Q F2(mb_extract)2.5 E F0(\()A(int)180 696 Q F1(verbose)2.5
-E F0(,)A(char)180 708 Q F1(*mbio_ptr)2.5 E F0(,)A(char)180 720 Q F1
-(*stor)2.5 E(e_ptr)-.37 E F0(,)A(MB-System 5.0)72 768 Q(26 October 2009)
-137.055 E(27)190.395 E 0 Cg EP
-%%Page: 28 28
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F(int)180 84 Q/F1 10/Times-Italic at 0 SF(*kind)2.5 E F0
-(,)A(int)180 96 Q F1(time_i[7])2.5 E F0(,)A(double)180 108 Q F1(*time_d)
-2.5 E F0(,)A(double)180 120 Q F1(*navlon)2.5 E F0(,)A(double)180 132 Q
-F1(*navlat)2.5 E F0(,)A(double)180 144 Q F1(*speed)2.5 E F0(,)A(double)
-180 156 Q F1(*heading)2.5 E F0(,)A(int)180 168 Q F1(*nbath)2.5 E F0(,)A
-(int)180 180 Q F1(*namp)2.5 E F0(,)A(int)180 192 Q F1(*nss)2.5 E F0(,)A
-(char)180 204 Q F1(*beam\215a)2.5 E(g)-.1 E F0(,)A(double)180 216 Q F1
-(*bath)2.5 E F0(,)A(double)180 228 Q F1(*amp)2.5 E F0(,)A(double)180 240
-Q F1(*bathacr)2.5 E(osstr)-.45 E(ac)-.15 E(k)-.2 E F0(,)A(double)180 252
-Q F1(*bathalongtr)2.5 E(ac)-.15 E(k)-.2 E F0(,)A(double)180 264 Q F1
-(*ss)2.5 E F0(,)A(double)180 276 Q F1(*ssacr)2.5 E(osstr)-.45 E(ac)-.15
-E(k)-.2 E F0(,)A(double)180 288 Q F1(*ssalongtr)2.5 E(ac)-.15 E(k)-.2 E
-F0(,)A(char)180 300 Q F1(*comment)2.5 E F0(,)A(int)180 312 Q F1(*err)2.5
-E(or)-.45 E F0(\);)A .822(The function)108 336 R/F2 10/Times-Bold at 0 SF
-(mb_extract)3.322 E F0 -.15(ex)3.322 G .821
-(tracts sonar data from the structure pointed to by).15 F F1(*stor)3.321
-E(e_ptr)-.37 E F0 .821(according to the)3.321 F F2(MBIO)108 348 Q F0
-.034(descriptor pointed to by)2.534 F F1(mbio_ptr)2.534 E F0 5.034(.T)C
-(he)-5.034 E F1(verbose)2.534 E F0 -.25(va)2.534 G .034
-(lue controls the standard error output v).25 F .034(erbosity of)-.15 F
-.629(the function.)108 360 R .628(The form of the data structure is det\
-ermined by the sonar system associated with the format)5.629 F 1.087
-(of the data being read. A number of dif)108 372 R 1.087
-(ferent data record types are recognized by)-.25 F F2(MB-System)3.587 E
-F0 3.587(;t)C(he)-3.587 E F1(kind)3.588 E F0 -.25(va)108 384 S .15
-(lue indicates which type of record is stored in).25 F F1(*stor)2.649 E
-(e_ptr)-.37 E F0 5.149(.A)C .149
-(dditional data is returned if the data record is)-5.149 F(surv)108 396
-Q 1.196 -.15(ey d)-.15 H .896(ata \(na).15 F(vig)-.2 E .896(ation, bath)
--.05 F(ymetry)-.05 E 3.396(,a)-.65 G .897(mplitude, and sidescan\), na)
--3.396 F(vig)-.2 E .897(ation data \(na)-.05 F(vig)-.2 E .897
-(ation only\), or com-)-.05 F(ment data \(comment only\).)108 408 Q
-(The return v)108 432 Q(alues are:)-.25 E F1(kind)144 444 Q F0 52(:k)C
-(ind of data record read)-52 E 31(1s)288 456 S(urv)-31 E .3 -.15(ey d)
--.15 H(ata).15 E 31(2c)288 468 S(omment)-31 E 23.5(12 na)288 480 R(vig)
--.2 E(ation)-.05 E F1(time_i)144 492 Q F0 44.22(:t)C
-(ime of current ping)-44.22 E F1(time_i)216 504 Q F0([0]: year)A F1
-(time_i)216 516 Q F0([1]: month)A F1(time_i)216 528 Q F0([2]: day)A F1
-(time_i)216 540 Q F0([3]: hour)A F1(time_i)216 552 Q F0([4]: minute)A F1
-(time_i)216 564 Q F0([5]: second)A F1(time_i)216 576 Q F0
-([6]: microsecond)A F1(time_d)144 588 Q F0 42(:t)C
-(ime of current ping in seconds)-42 E(since 1/1/70 00:00:00)216 600 Q F1
-(navlon)144 612 Q F0 42(:l)C(ongitude)-42 E F1(navlat)144 624 Q F0 44.22
-(:l)C(atitude)-44.22 E F1(speed)144 636 Q F0 46.45(:s)C
-(hip speed in km/s)-46.45 E F1(heading)144 648 Q F0 37(:s)C
-(hip heading in de)-37 E(grees)-.15 E F1(distance)144 660 Q F0 71.89(:d)
-C(istance along shiptrack since last)-71.89 E(ping in km)216 672 Q F1
-(altitude)144 684 Q F0 38.66(:a)C(ltitude of sonar abo)-38.66 E .3 -.15
-(ve s)-.15 H(ea\215oor).15 E(in m)216 696 Q F1(sonar)144 708 Q(depth)
--.37 E F0 24.59(:d)C(epth of sonar in m)-24.59 E F1(nbath)144 720 Q F0
-46.44(:n)C(umber of bath)-46.44 E(ymetry v)-.05 E(alues)-.25 E
-(MB-System 5.0)72 768 Q(26 October 2009)137.055 E(28)190.395 E 0 Cg EP
-%%Page: 29 29
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F/F1 10/Times-Italic at 0 SF(namp)144 84 Q F0 47(:n)C
-(umber of amplitude v)-47 E(alues)-.25 E F1(nss)144 96 Q F0 56.44(:n)C
-(umber of sidescan v)-56.44 E(alues)-.25 E F1(beam\215a)144 108 Q(g)-.1
-E F0 68.66(:a)C(rray of bath)-68.66 E(ymetry \215ags)-.05 E F1(bath)144
-120 Q F0 51.44(:a)C(rray of bath)-51.44 E(ymetry v)-.05 E
-(alues in meters)-.25 E F1(amp)144 132 Q F0 52(:a)C(rray of amplitude v)
--52 E(alues in unkno)-.25 E(wn units)-.25 E F1(bathacr)144 144 Q(osstr)
--.45 E(ac)-.15 E(k)-.2 E F0 5.58(:a)C(rray of of acrosstrack distances)
--5.58 E(in meters corresponding to bath)216 156 Q(ymetry)-.05 E F1
-(bathalongtr)144 168 Q(ac)-.15 E(k)-.2 E F0 8.46(:a)C
-(rray of of alongtrack distances)-8.46 E
-(in meters corresponding to bath)216 180 Q(ymetry)-.05 E F1(ss)144 192 Q
-F0 61.44(:a)C(rray of sidescan v)-61.44 E(alues in unkno)-.25 E
-(wn units)-.25 E F1(ssacr)144 204 Q(osstr)-.45 E(ac)-.15 E(k)-.2 E F0
-15.58(:a)C(rray of of acrosstrack distances)-15.58 E
-(in meters corresponding to sidescan)216 216 Q F1(ssacr)144 228 Q(osstr)
--.45 E(ac)-.15 E(k)-.2 E F0 15.58(:a)C(rray of of alongtrack distances)
--15.58 E(in meters corresponding to sidescan)216 240 Q F1(comment)144
-252 Q F0 33.12(:c)C(omment string)-33.12 E F1(err)144 264 Q(or)-.45 E F0
-48.56(:e)C(rror v)-48.56 E(alue)-.25 E 2.777(As)108 288 S .277(tatus v)
--2.777 F .277(alue indicating success or f)-.25 F .277
-(ailure is returned; the error v)-.1 F .277(alue ar)-.25 F(gument)-.18 E
-F1(err)2.777 E(or)-.45 E F0 .276(passes more detailed)2.777 F
-(information about e)108 300 Q(xtract f)-.15 E(ailures.)-.1 E
-(---------------------------------------------------------)108 324 Q
-(int)108 336 Q/F2 10/Times-Bold at 0 SF(mb_insert)2.5 E F0(\()A(int)180 348
-Q F1(verbose)2.5 E F0(,)A(char)180 360 Q F1(*mbio_ptr)2.5 E F0(,)A(char)
-180 372 Q F1(*stor)2.5 E(e_ptr)-.37 E F0(,)A(int)180 384 Q F1(kind)2.5 E
-F0(,)A(int)180 396 Q F1(time_i[7])2.5 E F0(,)A(double)180 408 Q F1
-(time_d)2.5 E F0(,)A(double)180 420 Q F1(navlon)2.5 E F0(,)A(double)180
-432 Q F1(navlat)2.5 E F0(,)A(double)180 444 Q F1(speed)2.5 E F0(,)A
-(double)180 456 Q F1(heading)2.5 E F0(,)A(int)180 468 Q F1(nbath)2.5 E
-F0(,)A(int)180 480 Q F1(namp)2.5 E F0(,)A(int)180 492 Q F1(nss)2.5 E F0
-(,)A(char)180 504 Q F1(*beam\215a)2.5 E(g)-.1 E F0(,)A(double)180 516 Q
-F1(*bath)2.5 E F0(,)A(double)180 528 Q F1(*amp)2.5 E F0(,)A(double)180
-540 Q F1(*bathacr)2.5 E(osstr)-.45 E(ac)-.15 E(k)-.2 E F0(,)A(double)180
-552 Q F1(*bathalongtr)2.5 E(ac)-.15 E(k)-.2 E F0(,)A(double)180 564 Q F1
-(*ss)2.5 E F0(,)A(double)180 576 Q F1(*ssacr)2.5 E(osstr)-.45 E(ac)-.15
-E(k)-.2 E F0(,)A(double)180 588 Q F1(*ssalongtr)2.5 E(ac)-.15 E(k)-.2 E
-F0(,)A(char)180 600 Q F1(*comment)2.5 E F0(,)A(int)180 612 Q F1(*err)2.5
-E(or)-.45 E F0(\);)A 1.772(The function)108 636 R F2(mb_insert)4.272 E
-F0 1.772(inserts sonar data into the structure pointed to by)4.272 F F1
-(*stor)4.272 E(e_ptr)-.37 E F0 1.772(according to the)4.272 F F2(MBIO)
-108 648 Q F0 .034(descriptor pointed to by)2.534 F F1(mbio_ptr)2.534 E
-F0 5.034(.T)C(he)-5.034 E F1(verbose)2.534 E F0 -.25(va)2.534 G .034
-(lue controls the standard error output v).25 F .034(erbosity of)-.15 F
-.628(the function.)108 660 R .628(The form of the data structure is det\
-ermined by the sonar system associated with the format)5.628 F 1.087
-(of the data being read. A number of dif)108 672 R 1.087
-(ferent data record types are recognized by)-.25 F F2(MB-System)3.587 E
-F0 3.587(;t)C(he)-3.587 E F1(kind)3.587 E F0 -.25(va)108 684 S 1.12
-(lue indicates which type of record is to be stored in).25 F F1(*stor)
-3.621 E(e_ptr)-.37 E F0 6.121(.D)C 1.121
-(ata will be inserted only if the data)-6.121 F .62(record is surv)108
-696 R .919 -.15(ey d)-.15 H .619(ata \(na).15 F(vig)-.2 E .619
-(ation, bath)-.05 F(ymetry)-.05 E 3.119(,a)-.65 G .619
-(mplitude, and sidescan\), na)-3.119 F(vig)-.2 E .619(ation data \(na)
--.05 F(vig)-.2 E .619(ation only\),)-.05 F
-(or comment data \(comment only\).)108 708 Q(The v)5 E
-(alues to be inserted are:)-.25 E F1(kind)144 720 Q F0 52(:k)C
-(ind of data record inserted)-52 E(MB-System 5.0)72 768 Q
-(26 October 2009)137.055 E(29)190.395 E 0 Cg EP
-%%Page: 30 30
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F 31(1s)288 84 S(urv)-31 E .3 -.15(ey d)-.15 H(ata)
-.15 E 31(2c)288 96 S(omment)-31 E 23.5(12 na)288 108 R(vig)-.2 E(ation)
--.05 E/F1 10/Times-Italic at 0 SF(time_i)144 120 Q F0 44.22(:t)C
-(ime of current ping)-44.22 E F1(time_i)216 132 Q F0([0]: year)A F1
-(time_i)216 144 Q F0([1]: month)A F1(time_i)216 156 Q F0([2]: day)A F1
-(time_i)216 168 Q F0([3]: hour)A F1(time_i)216 180 Q F0([4]: minute)A F1
-(time_i)216 192 Q F0([5]: second)A F1(time_i)216 204 Q F0
-([6]: microsecond)A F1(time_d)144 216 Q F0 42(:t)C
-(ime of current ping in seconds)-42 E(since 1/1/70 00:00:00)216 228 Q F1
-(navlon)144 240 Q F0 42(:l)C(ongitude)-42 E F1(navlat)144 252 Q F0 44.22
-(:l)C(atitude)-44.22 E F1(speed)144 264 Q F0 46.45(:s)C
-(hip speed in km/s)-46.45 E F1(heading)144 276 Q F0 37(:s)C
-(hip heading in de)-37 E(grees)-.15 E F1(distance)144 288 Q F0 71.89(:d)
-C(istance along shiptrack since last)-71.89 E(ping in km)216 300 Q F1
-(altitude)144 312 Q F0 38.66(:a)C(ltitude of sonar abo)-38.66 E .3 -.15
-(ve s)-.15 H(ea\215oor).15 E(in m)216 324 Q F1(sonar)144 336 Q(depth)
--.37 E F0 24.59(:d)C(epth of sonar in m)-24.59 E F1(nbath)144 348 Q F0
-46.44(:n)C(umber of bath)-46.44 E(ymetry v)-.05 E(alues)-.25 E F1(namp)
-144 360 Q F0 47(:n)C(umber of amplitude v)-47 E(alues)-.25 E F1(nss)144
-372 Q F0 56.44(:n)C(umber of sidescan v)-56.44 E(alues)-.25 E F1
-(beam\215a)144 384 Q(g)-.1 E F0 68.66(:a)C(rray of bath)-68.66 E
-(ymetry \215ags)-.05 E F1(bath)144 396 Q F0 51.44(:a)C(rray of bath)
--51.44 E(ymetry v)-.05 E(alues in meters)-.25 E F1(amp)144 408 Q F0 52
-(:a)C(rray of amplitude v)-52 E(alues in unkno)-.25 E(wn units)-.25 E F1
-(bathacr)144 420 Q(osstr)-.45 E(ac)-.15 E(k)-.2 E F0 5.58(:a)C
-(rray of of acrosstrack distances)-5.58 E
-(in meters corresponding to bath)216 432 Q(ymetry)-.05 E F1(bathalongtr)
-144 444 Q(ac)-.15 E(k)-.2 E F0 8.46(:a)C
-(rray of of alongtrack distances)-8.46 E
-(in meters corresponding to bath)216 456 Q(ymetry)-.05 E F1(ss)144 468 Q
-F0 61.44(:a)C(rray of sidescan v)-61.44 E(alues in unkno)-.25 E
-(wn units)-.25 E F1(ssacr)144 480 Q(osstr)-.45 E(ac)-.15 E(k)-.2 E F0
-15.58(:a)C(rray of of acrosstrack distances)-15.58 E
-(in meters corresponding to sidescan)216 492 Q F1(ssacr)144 504 Q(osstr)
--.45 E(ac)-.15 E(k)-.2 E F0 15.58(:a)C(rray of of alongtrack distances)
--15.58 E(in meters corresponding to sidescan)216 516 Q F1(comment)144
-528 Q F0 33.12(:c)C(omment string)-33.12 E(The return v)108 552 Q
-(alues are:)-.25 E F1(err)144 564 Q(or)-.45 E F0 48.56(:e)C(rror v)
--48.56 E(alue)-.25 E 2.776(As)108 588 S .276(tatus v)-2.776 F .277
-(alue indicating success or f)-.25 F .277
-(ailure is returned; the error v)-.1 F .277(alue ar)-.25 F(gument)-.18 E
-F1(err)2.777 E(or)-.45 E F0 .277(passes more detailed)2.777 F
-(information about insert f)108 600 Q(ailures.)-.1 E
-(---------------------------------------------------------)108 624 Q
-(int)108 636 Q/F2 10/Times-Bold at 0 SF(mb_extract_na)2.5 E(v)-.25 E F0(\()
-A(int)180 648 Q F1(verbose)2.5 E F0(,)A(char)180 660 Q F1(*mbio_ptr)2.5
-E F0(,)A(char)180 672 Q F1(*stor)2.5 E(e_ptr)-.37 E F0(,)A(int)180 684 Q
-F1(*kind)2.5 E F0(,)A(int)180 696 Q F1(time_i[7])2.5 E F0(,)A(double)180
-708 Q F1(*time_d)2.5 E F0(,)A(double)180 720 Q F1(*navlon)2.5 E F0(,)A
-(MB-System 5.0)72 768 Q(26 October 2009)137.055 E(30)190.395 E 0 Cg EP
-%%Page: 31 31
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F(double)180 84 Q/F1 10/Times-Italic at 0 SF(*navlat)2.5
-E F0(,)A(double)180 96 Q F1(*speed)2.5 E F0(,)A(double)180 108 Q F1
-(*heading)2.5 E F0(,)A(double)180 120 Q F1(*dr)2.5 E(aft)-.15 E F0(,)A
-(double)180 132 Q F1(*r)2.5 E(oll)-.45 E F0(,)A(double)180 144 Q F1
-(*pitc)2.5 E(h)-.15 E F0(,)A(double)180 156 Q F1(*heave)2.5 E F0(,)A
-(int)180 168 Q F1(*err)2.5 E(or)-.45 E F0(\);)A .474(The function)108
-192 R/F2 10/Times-Bold at 0 SF(mb_extract_na)2.973 E(v)-.25 E F0 -.15(ex)
-2.973 G .473(tracts na).15 F(vig)-.2 E .473
-(ation data from the structure pointed to by)-.05 F F1(*stor)2.973 E
-(e_ptr)-.37 E F0(accord-)2.973 E .664(ing to the)108 204 R F2(MBIO)3.164
-E F0 .664(descriptor pointed to by)3.164 F F1(mbio_ptr)3.164 E F0 5.664
-(.T)C(he)-5.664 E F1(verbose)3.164 E F0 -.25(va)3.165 G .665
-(lue controls the standard error output).25 F -.15(ve)108 216 S .245
-(rbosity of the function.).15 F .245(The form of the data structure is \
-determined by the sonar system associated with)5.245 F .532
-(the format of the data being read. A number of dif)108 228 R .532
-(ferent data record types are recognized by)-.25 F F2(MB-System)3.032 E
-F0(;)A(the)108 240 Q F1(kind)2.725 E F0 -.25(va)2.725 G .225
-(lue indicates which type of record is stored in).25 F F1(*stor)2.725 E
-(e_ptr)-.37 E F0 5.225(.N)C -.2(av)-5.225 G(ig).2 E .225
-(ation data is returned if the data)-.05 F 2.1(record is surv)108 252 R
-2.401 -.15(ey d)-.15 H 2.101(ata \(na).15 F(vig)-.2 E 2.101(ation, bath)
--.05 F(ymetry)-.05 E 4.601(,a)-.65 G 2.101
-(mplitude, and sidescan\) or na)-4.601 F(vig)-.2 E 2.101
-(ation data \(na)-.05 F(vig)-.2 E(ation)-.05 E(only\).)108 264 Q
-(The return v)108 288 Q(alues are:)-.25 E F1(kind)144 300 Q F0 52(:k)C
-(ind of data record read)-52 E 31(1s)252 312 S(urv)-31 E .3 -.15(ey d)
--.15 H(ata).15 E 23.5(12 na)252 324 R(vig)-.2 E(ation)-.05 E F1(time_i)
-144 336 Q F0 44.22(:t)C(ime of current ping)-44.22 E F1(time_i)216 348 Q
-F0([0]: year)A F1(time_i)216 360 Q F0([1]: month)A F1(time_i)216 372 Q
-F0([2]: day)A F1(time_i)216 384 Q F0([3]: hour)A F1(time_i)216 396 Q F0
-([4]: minute)A F1(time_i)216 408 Q F0([5]: second)A F1(time_i)216 420 Q
-F0([6]: microsecond)A F1(time_d)144 432 Q F0 42(:t)C
-(ime of current ping in seconds)-42 E(since 1/1/70 00:00:00)216 444 Q F1
-(navlon)144 456 Q F0 42(:l)C(ongitude)-42 E F1(navlat)144 468 Q F0 44.22
-(:l)C(atitude)-44.22 E F1(speed)144 480 Q F0 46.45(:s)C
-(hip speed in km/s)-46.45 E F1(heading)144 492 Q F0 37(:s)C
-(hip heading in de)-37 E(grees)-.15 E F1(dr)144 504 Q(aft)-.15 E F0
-49.92(:s)C(onar depth in meters)-49.92 E F1 -.45(ro)144 516 S(ll).45 E
-F0 55.22(:s)C(onar roll in de)-55.22 E(grees)-.15 E F1(pitc)144 528 Q(h)
--.15 E F0 49.37(:s)C(onar pitch in de)-49.37 E(grees)-.15 E F1(heave)144
-540 Q F0 45.9(:s)C(onar hea)-45.9 E .3 -.15(ve i)-.2 H 2.5(nm).15 G
-(eters)-2.5 E 2.777(As)108 564 S .277(tatus v)-2.777 F .277
-(alue indicating success or f)-.25 F .277
-(ailure is returned; the error v)-.1 F .277(alue ar)-.25 F(gument)-.18 E
-F1(err)2.777 E(or)-.45 E F0 .276(passes more detailed)2.777 F
-(information about e)108 576 Q(xtract f)-.15 E(ailures.)-.1 E
-(---------------------------------------------------------)108 600 Q
-(int)108 612 Q F2(mb_insert_na)2.5 E(v)-.25 E F0(\()A(int)180 624 Q F1
-(verbose)2.5 E F0(,)A(char)180 636 Q F1(*mbio_ptr)2.5 E F0(,)A(char)180
-648 Q F1(*stor)2.5 E(e_ptr)-.37 E F0(,)A(int)180 660 Q F1(time_i[7])2.5
-E F0(,)A(double)180 672 Q F1(time_d)2.5 E F0(,)A(double)180 684 Q F1
-(navlon)2.5 E F0(,)A(double)180 696 Q F1(navlat)2.5 E F0(,)A(double)180
-708 Q F1(speed)2.5 E F0(,)A(double)180 720 Q F1(heading)2.5 E F0(,)A
-(MB-System 5.0)72 768 Q(26 October 2009)137.055 E(31)190.395 E 0 Cg EP
-%%Page: 32 32
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F(double)180 84 Q/F1 10/Times-Italic at 0 SF(dr)2.5 E
-(aft)-.15 E F0(,)A(double)180 96 Q F1 -.45(ro)2.5 G(ll).45 E F0(,)A
-(double)180 108 Q F1(pitc)2.5 E(h)-.15 E F0(,)A(double)180 120 Q F1
-(heave)2.5 E F0(,)A(int)180 132 Q F1(*err)2.5 E(or)-.45 E F0(\);)A .048
-(The function)108 156 R/F2 10/Times-Bold at 0 SF(mb_insert_na)2.548 E(v)
--.25 E F0 .048(inserts na)2.548 F(vig)-.2 E .049
-(ation data into the structure pointed to by)-.05 F F1(*stor)2.549 E
-(e_ptr)-.37 E F0 .049(according to)2.549 F(the)108 168 Q F2(MBIO)3.696 E
-F0 1.196(descriptor pointed to by)3.696 F F1(mbio_ptr)3.696 E F0 6.196
-(.T)C(he)-6.196 E F1(verbose)3.696 E F0 -.25(va)3.696 G 1.196
-(lue controls the standard error output v).25 F(er)-.15 E(-)-.2 E .114
-(bosity of the function.)108 180 R .115(The form of the data structure \
-is determined by the sonar system associated with the)5.114 F .532
-(format of the data being read. A number of dif)108 192 R .532
-(ferent data record types are recognized by)-.25 F F2(MB-System)3.031 E
-F0 3.031(;t)C(he)-3.031 E F1(kind)108 204 Q F0 -.25(va)2.578 G .078
-(lue indicates which type of record is to be stored in).25 F F1(*stor)
-2.579 E(e_ptr)-.37 E F0 5.079(.D)C .079
-(ata will be inserted only if the data)-5.079 F 1.893(record is surv)108
-216 R 2.193 -.15(ey d)-.15 H 1.893(ata \(na).15 F(vig)-.2 E 1.893
-(ation, bath)-.05 F(ymetry)-.05 E 4.393(,a)-.65 G 1.892
-(mplitude, and sidescan\), or na)-4.393 F(vig)-.2 E 1.892
-(ation data \(na)-.05 F(vig)-.2 E(ation)-.05 E 2.5(only\). The)108 228 R
--.25(va)2.5 G(lues to be inserted are:).25 E F1(time_i)144 240 Q F0
-44.22(:t)C(ime of current ping)-44.22 E F1(time_i)216 252 Q F0
-([0]: year)A F1(time_i)216 264 Q F0([1]: month)A F1(time_i)216 276 Q F0
-([2]: day)A F1(time_i)216 288 Q F0([3]: hour)A F1(time_i)216 300 Q F0
-([4]: minute)A F1(time_i)216 312 Q F0([5]: second)A F1(time_i)216 324 Q
-F0([6]: microsecond)A F1(time_d)144 336 Q F0 42(:t)C
-(ime of current ping in seconds)-42 E(since 1/1/70 00:00:00)216 348 Q F1
-(navlon)144 360 Q F0 42(:l)C(ongitude)-42 E F1(navlat)144 372 Q F0 44.22
-(:l)C(atitude)-44.22 E F1(speed)144 384 Q F0 46.45(:s)C
-(hip speed in km/s)-46.45 E F1(heading)144 396 Q F0 37(:s)C
-(hip heading in de)-37 E(grees)-.15 E F1(dr)144 408 Q(aft)-.15 E F0
-49.92(:s)C(onar depth in meters)-49.92 E F1 -.45(ro)144 420 S(ll).45 E
-F0 55.22(:s)C(onar roll in de)-55.22 E(grees)-.15 E F1(pitc)144 432 Q(h)
--.15 E F0 49.37(:s)C(onar pitch in de)-49.37 E(grees)-.15 E F1(heave)144
-444 Q F0 45.9(:s)C(onar hea)-45.9 E .3 -.15(ve i)-.2 H 2.5(nm).15 G
-(eters)-2.5 E(The return v)108 468 Q(alues are:)-.25 E F1(err)144 480 Q
-(or)-.45 E F0 48.56(:e)C(rror v)-48.56 E(alue)-.25 E 2.776(As)108 504 S
-.276(tatus v)-2.776 F .277(alue indicating success or f)-.25 F .277
-(ailure is returned; the error v)-.1 F .277(alue ar)-.25 F(gument)-.18 E
-F1(err)2.777 E(or)-.45 E F0 .277(passes more detailed)2.777 F
-(information about insert f)108 516 Q(ailures.)-.1 E
-(---------------------------------------------------------)108 540 Q
-(int)108 552 Q F2(mb_extract_altitude)2.5 E F0(\()A(int)180 564 Q F1
-(verbose)2.5 E F0(,)A(char)180 576 Q F1(*mbio_ptr)2.5 E F0(,)A(char)180
-588 Q F1(*stor)2.5 E(e_ptr)-.37 E F0(,)A(int)180 600 Q F1(*kind)2.5 E F0
-(,)A(double)180 612 Q F1(*tr)2.5 E(ansducer_depth)-.15 E F0(,)A(double)
-180 624 Q F1(*altitude)2.5 E F0(,)A(int)180 636 Q F1(*err)2.5 E(or)-.45
-E F0(\);)A .757(The function)108 660 R F2(mb_extract_altitude)3.257 E F0
--.15(ex)3.257 G .756(tracts the sonar transducer depth \().15 F F2
-(transducer_depth)A F0 3.256(\)b)C(elo)-3.256 E 3.256(wt)-.25 G .756
-(he sea)-3.256 F(surf)108 672 Q .406(ace and the the sonar transducer)
--.1 F F2(altitude)2.907 E F0(abo)2.907 E .707 -.15(ve t)-.15 H .407
-(he sea\215oor according to the).15 F F2(MBIO)2.907 E F0 .407
-(descriptor pointed)2.907 F .577(to by)108 684 R F1(mbio_ptr)3.077 E F0
-5.577(.T)C .577(his function is not de\214ned for all data formats.)
--5.577 F(The)5.576 E F1(verbose)3.076 E F0 -.25(va)3.076 G .576
-(lue controls the standard).25 F 1.061(error output v)108 696 R 1.061
-(erbosity of the function.)-.15 F 1.062
-(The form of the data structure is determined by the sonar system)6.062
-F .024
-(associated with the format of the data being read. A number of dif)108
-708 R .024(ferent data record types are recognized by)-.25 F F2
-(MB-System)108 720 Q F0 2.877(;t)C(he)-2.877 E F1(kind)2.877 E F0 -.25
-(va)2.877 G .377(lue indicates which type of record is stored in).25 F
-F1(*stor)2.878 E(e_ptr)-.37 E F0 5.378(.T)C .378(hese data are returned)
--5.378 F(MB-System 5.0)72 768 Q(26 October 2009)137.055 E(32)190.395 E 0
-Cg EP
-%%Page: 33 33
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F .912(only if the data record is surv)108 84 R 1.211
--.15(ey d)-.15 H 3.411(ata. These).15 F -.25(va)3.411 G .911
-(lues are useful for sidescan processing applications. Both).25 F
-(transducer depths and altitudes are reported in meters.)108 96 Q
-(The return v)108 120 Q(alues are:)-.25 E/F1 10/Times-Italic at 0 SF(kind)
-144 132 Q F0 52(:k)C(ind of data record read \(error)-52 E(if not surv)
-252 144 Q .3 -.15(ey d)-.15 H(ata\):).15 E 31(1s)288 156 S(urv)-31 E .3
--.15(ey d)-.15 H(ata).15 E F1(tr)144 168 Q(ansducer_depth)-.15 E F0
-34.82(:d)C(epth of sonar in meters)-34.82 E F1(altitude)144 180 Q F0
-38.66(:a)C(ltitude of sonar abo)-38.66 E .3 -.15(ve s)-.15 H(ea\215oor)
-.15 E(in meters.)216 192 Q F1(err)144 204 Q(or)-.45 E F0 48.56(:e)C
-(rror v)-48.56 E(alue)-.25 E 2.776(As)108 228 S .276(tatus v)-2.776 F
-.277(alue indicating success or f)-.25 F .277
-(ailure is returned; the error v)-.1 F .277(alue ar)-.25 F(gument)-.18 E
-F1(err)2.777 E(or)-.45 E F0 .277(passes more detailed)2.777 F
-(information about data e)108 240 Q(xtraction f)-.15 E(ailures.)-.1 E
-(---------------------------------------------------------)108 264 Q
-(int)108 276 Q/F2 10/Times-Bold at 0 SF(mb_insert_altitude)2.5 E F0(\()A
-(int)180 288 Q F1(verbose)2.5 E F0(,)A(char)180 300 Q F1(*mbio_ptr)2.5 E
-F0(,)A(char)180 312 Q F1(*stor)2.5 E(e_ptr)-.37 E F0(,)A(double)180 324
-Q F1(tr)2.5 E(ansducer_depth)-.15 E F0(,)A(double)180 336 Q F1(altitude)
-2.5 E F0(,)A(int)180 348 Q F1(*err)2.5 E(or)-.45 E F0(\);)A 1.813
-(The function)108 372 R F2(mb_insert_altitude)4.313 E F0 1.812
-(inserts sonar depth and altitude data into the structure pointed to by)
-4.312 F F1(*stor)108 384 Q(e_ptr)-.37 E F0 .774(according to the)3.274 F
-F2(MBIO)3.274 E F0 .774(descriptor pointed to by)3.274 F F1(mbio_ptr)
-3.274 E F0 5.774(.T)C .775(his function is not de\214ned for all)-5.774
-F .572(data formats.)108 396 R(The)5.572 E F1(verbose)3.072 E F0 -.25
-(va)3.072 G .572(lue controls the standard error output v).25 F .572
-(erbosity of the function.)-.15 F .571(The form of)5.572 F .872(the dat\
-a structure is determined by the sonar system associated with the forma\
-t of the data being read. A)108 408 R .221(number of dif)108 420 R .221
-(ferent data record types are recognized by)-.25 F F2(MB-System)2.721 E
-F0 5.221(.D)C .22(ata will be inserted only if the data)-5.221 F
-(record is surv)108 432 Q .3 -.15(ey d)-.15 H(ata \(na).15 E(vig)-.2 E
-(ation, bath)-.05 E(ymetry)-.05 E 2.5(,a)-.65 G
-(mplitude, and sidescan\).)-2.5 E(The v)5 E(alues to be inserted are:)
--.25 E F1(tr)144 444 Q(ansducer_depth)-.15 E F0 34.82(:d)C
-(epth of sonar in meters)-34.82 E F1(altitude)144 456 Q F0 38.66(:a)C
-(ltitude of sonar in meters)-38.66 E(The return v)108 480 Q(alues are:)
--.25 E F1(err)144 492 Q(or)-.45 E F0 48.56(:e)C(rror v)-48.56 E(alue)
--.25 E 2.776(As)108 516 S .276(tatus v)-2.776 F .277
-(alue indicating success or f)-.25 F .277
-(ailure is returned; the error v)-.1 F .277(alue ar)-.25 F(gument)-.18 E
-F1(err)2.777 E(or)-.45 E F0 .277(passes more detailed)2.777 F
-(information about insert f)108 528 Q(ailures.)-.1 E
-(---------------------------------------------------------)108 552 Q
-(int)108 564 Q F2(mb_extract_svp)2.5 E F0(\()A(int)180 576 Q F1(verbose)
-2.5 E F0(,)A(char)180 588 Q F1(*mbio_ptr)2.5 E F0(,)A(char)180 600 Q F1
-(*stor)2.5 E(e_ptr)-.37 E F0(,)A(int)180 612 Q F1(*kind)2.5 E F0(,)A
-(int)180 624 Q F1(*nsvp)2.5 E F0(,)A(double)180 636 Q F1(*depth)2.5 E F0
-(,)A(double)180 648 Q F1(*velocity)2.5 E F0(,)A(int)180 660 Q F1(*err)
-2.5 E(or)-.45 E F0(\);)A 1.195(The function)108 684 R F2(mb_extract_svp)
-3.695 E F0 -.15(ex)3.695 G 1.195(tracts a w).15 F 1.195(ater sound v)-.1
-F 1.194(elocity pro\214le according to the)-.15 F F2(MBIO)3.694 E F0
-(descriptor)3.694 E .804(pointed to by)108 696 R F1(mbio_ptr)3.304 E F0
-5.804(.T)C .805(his function is not de\214ned for all data formats.)
--5.804 F(The)5.805 E F1(verbose)3.305 E F0 -.25(va)3.305 G .805
-(lue controls the).25 F .703(standard error output v)108 708 R .703
-(erbosity of the function.)-.15 F .703
-(The form of the data structure is determined by the sonar)5.703 F 1.707
-(system associated with the format of the data being read. A number of \
-dif)108 720 R 1.707(ferent data record types are)-.25 F(MB-System 5.0)72
-768 Q(26 October 2009)137.055 E(33)190.395 E 0 Cg EP
-%%Page: 34 34
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F 1.124(recognized by)108 84 R/F1 10/Times-Bold at 0 SF
-(MB-System)3.624 E F0 3.624(;t)C(he)-3.624 E/F2 10/Times-Italic at 0 SF
-(kind)3.624 E F0 -.25(va)3.624 G 1.124
-(lue indicates which type of record is stored in).25 F F2(*stor)3.624 E
-(e_ptr)-.37 E F0 6.124(.T)C(hese)-6.124 E .045
-(data are returned only if the data record is a sound v)108 96 R .045
-(elocity pro\214le record. These v)-.15 F .046
-(alues are useful for calcu-)-.25 F(lating bath)108 108 Q
-(ymetry from tra)-.05 E -.15(ve)-.2 G 2.5(lt).15 G
-(imes and beam angles.)-2.5 E(The return v)108 132 Q(alues are:)-.25 E
-F2(kind)144 144 Q F0 52(:k)C(ind of data record read \(error)-52 E
-(if not SVP data\):)252 156 Q 31(6S)288 168 S(VP data)-31 E F2(nsvp)144
-180 Q F0 50.89(:n)C(umber of depth and sound speed)-50.89 E
-(data in the pro\214le)252 192 Q F2(depth)144 204 Q F0 47(:a)C
-(rray of depths in meters)-47 E F2(velocity)144 216 Q F0 38.12(:a)C
-(rray of sound speeds in m/sec)-38.12 E F2(err)144 228 Q(or)-.45 E F0
-48.56(:e)C(rror v)-48.56 E(alue)-.25 E 2.777(As)108 252 S .277(tatus v)
--2.777 F .277(alue indicating success or f)-.25 F .277
-(ailure is returned; the error v)-.1 F .277(alue ar)-.25 F(gument)-.18 E
-F2(err)2.777 E(or)-.45 E F0 .276(passes more detailed)2.777 F
-(information about data e)108 264 Q(xtraction f)-.15 E(ailures.)-.1 E
-(---------------------------------------------------------)108 288 Q
-(int)108 300 Q F1(mb_insert_svp)2.5 E F0(\()A(int)180 312 Q F2(verbose)
-2.5 E F0(,)A(char)180 324 Q F2(*mbio_ptr)2.5 E F0(,)A(char)180 336 Q F2
-(*stor)2.5 E(e_ptr)-.37 E F0(,)A(int)180 348 Q F2(nsvp)2.5 E F0(,)A
-(double)180 360 Q F2(*depth)2.5 E F0(,)A(double)180 372 Q F2(*velocity)
-2.5 E F0(,)A(int)180 384 Q F2(*err)2.5 E(or)-.45 E F0(\);)A 1.993
-(The function)108 408 R F1(mb_insert_svp)4.493 E F0 1.993(inserts a w)
-4.493 F 1.993(ater sound v)-.1 F 1.993
-(elocity pro\214le according to the)-.15 F F1(MBIO)4.493 E F0
-(descriptor)4.494 E .805(pointed to by)108 420 R F2(mbio_ptr)3.305 E F0
-5.805(.T)C .805(his function is not de\214ned for all data formats.)
--5.805 F(The)5.804 E F2(verbose)3.304 E F0 -.25(va)3.304 G .804
-(lue controls the).25 F .703(standard error output v)108 432 R .703
-(erbosity of the function.)-.15 F .703
-(The form of the data structure is determined by the sonar)5.703 F .055
-(system associated with the format of the data being read. A number of \
-dif)108 444 R .054(ferent data record types are recog-)-.25 F 1.112
-(nized by)108 456 R F1(MB-System)3.612 E F0 6.112(.T)C 1.112
-(hese data are inserted only if the data record is a sound v)-6.112 F
-1.113(elocity pro\214le record.)-.15 F .33(These v)108 468 R .33
-(alues are useful for calculating bath)-.25 F .329(ymetry from tra)-.05
-F -.15(ve)-.2 G 2.829(lt).15 G .329(imes and beam angles.)-2.829 F .329
-(The inserted v)5.329 F(alues)-.25 E(are:)108 480 Q F2(nsvp)144 492 Q F0
-50.89(:n)C(umber of depth and sound speed)-50.89 E
-(data in the pro\214le)252 504 Q F2(depth)144 516 Q F0 47(:a)C
-(rray of depths in meters)-47 E F2(velocity)144 528 Q F0 38.12(:a)C
-(rray of sound speeds in m/sec)-38.12 E(The return v)108 552 Q
-(alues are:)-.25 E F2(err)144 564 Q(or)-.45 E F0 48.56(:e)C(rror v)
--48.56 E(alue)-.25 E 2.776(As)108 588 S .276(tatus v)-2.776 F .277
-(alue indicating success or f)-.25 F .277
-(ailure is returned; the error v)-.1 F .277(alue ar)-.25 F(gument)-.18 E
-F2(err)2.777 E(or)-.45 E F0 .277(passes more detailed)2.777 F
-(information about data insertion f)108 600 Q(ailures.)-.1 E
-(---------------------------------------------------------)108 624 Q
-(int)108 636 Q F1(mb_ttimes)2.5 E F0(\()A(int)180 648 Q F2(verbose)2.5 E
-F0(,)A(char)180 660 Q F2(*mbio_ptr)2.5 E F0(,)A(char)180 672 Q F2(*stor)
-2.5 E(e_ptr)-.37 E F0(,)A(int)180 684 Q F2(*kind)2.5 E F0(,)A(int)180
-696 Q F2(*nbeams)2.5 E F0(,)A(double)180 708 Q F2(*ttimes)2.5 E F0(,)A
-(double)180 720 Q F2(*angles)8.78 E F0(,)A(MB-System 5.0)72 768 Q
-(26 October 2009)137.055 E(34)190.395 E 0 Cg EP
-%%Page: 35 35
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F(double)180 84 Q/F1 10/Times-Italic at 0 SF
-(*angles_forwar)2.5 E(d)-.37 E F0(,)A(double)180 96 Q F1(*angles_null)
-2.5 E F0(,)A(double)180 108 Q F1(*heave)2.5 E F0(,)A(double)180 120 Q F1
-(*alongtr)2.5 E(ac)-.15 E(k_of)-.2 E(fset)-.18 E F0(,)A(double)180 132 Q
-F1(*dr)2.5 E(aft)-.15 E F0(,)A(double)180 144 Q F1(*ssv)2.5 E F0(,)A
-(int)180 156 Q F1(*err)2.5 E(or)-.45 E F0(\);)A .398(The function)108
-180 R/F2 10/Times-Bold at 0 SF(mb_ttimes)2.898 E F0 -.15(ex)2.898 G .398
-(tracts tra).15 F -.15(ve)-.2 G 2.898(lt).15 G .398
-(imes and beam angles from a sonar)-2.898 F .397
-(-speci\214c data structure pointed)-.2 F 1.305(to by)108 192 R F1(stor)
-3.805 E(e_ptr)-.37 E F0 3.805(.T)C 1.305(hese v)-3.805 F 1.305
-(alues are used for calculating sw)-.25 F 1.305(ath bath)-.1 F(ymetry)
--.05 E 3.806(.T)-.65 G(he)-3.806 E F1(verbose)3.806 E F0 -.25(va)3.806 G
-1.306(lue controls the).25 F .295(standard error output v)108 204 R .295
-(erbosity of the function.)-.15 F .295
-(The coordinates of the beam angles can be a bit confusing.)5.295 F .249
-(The angles are returned in "tak)108 216 R(eof)-.1 E 2.749(fa)-.25 G
-.249(ngle coordinates" appropriate for raytracing. The array angles con\
-tains)-2.749 F .745(the angle from v)108 228 R .744
-(ertical and the array angles_forw)-.15 F .744
-(ard contains the angle from acrosstrack. This coordinate)-.1 F .155(sy\
-stem is distinct from the roll-pitch coordinates appropriate for correc\
-ting roll and pitch v)108 240 R .155(alues. A descrip-)-.25 F .091
-(tion of these rele)108 252 R -.15(ve)-.25 G .091
-(nt coordinate systems is gi).15 F -.15(ve)-.25 G 2.591(nb).15 G(elo)
--2.591 E 3.891 -.65(w. T)-.25 H(he).65 E F2(angles_null)2.591 E F0 .09
-(array contains the ef)2.59 F(fecti)-.25 E .39 -.15(ve s)-.25 H(onar).15
-E .807(array orientation for each beam. The)108 264 R F2(angles_null)
-3.307 E F0 .807(array may be used to correct beam angles using Snell')
-3.307 F(s)-.55 E(la)108 276 Q 4.276(wi)-.15 G 4.276(ft)-4.276 G(he)
--4.276 E F2(ssv)4.276 E F0 1.776(is changed.)4.276 F(The)6.775 E F2
-(angles_null)4.275 E F0 -.25(va)4.275 G 1.775
-(lues re\215ect the sonar con\214guration.).25 F -.15(Fo)6.775 G 4.275
-(re).15 G 1.775(xample, some)-4.425 F .103(multibeam sonars ha)108 288 R
-.403 -.15(ve a \215)-.2 H .103(at transducer array).15 F 2.603(,a)-.65 G
-.103(nd so the)-2.603 F F2(angles_null)2.603 E F0 .103
-(array consists of)2.603 F F2(nbeams)2.603 E F0 .104(zero v)2.604 F
-(alues.)-.25 E .749(Other multibeams ha)108 300 R 1.049 -.15(ve c)-.2 H
-.749(ircular arrays so that the).15 F F2(angles_null)3.249 E F0 -.25(va)
-3.249 G .749(lues equal the).25 F F2(angles)3.248 E F0 -.25(va)3.248 G
-.748(lues. The).25 F F2(along-)3.248 E(track_offset)108 312 Q F0 1.282
-(array accomodates sonars which report multiple pings in a single surv)
-3.782 F 1.582 -.15(ey r)-.15 H 1.283(ecord; each ping).15 F .29
-(occurs at a dif)108 324 R .289
-(ferent position along the shiptrack, producing alongtrack of)-.25 F
-.289(fsets relati)-.25 F .589 -.15(ve t)-.25 H 2.789(ot).15 G .289
-(he na)-2.789 F(vig)-.2 E .289(ation for)-.05 F .499(some beam v)108 336
-R .499(alues. The sum of the)-.25 F F2(draft)2.999 E F0 -.25(va)2.999 G
-.499(lue and the).25 F F2(hea)2.999 E -.1(ve)-.25 G F0 .499(array v)
-3.099 F .499(alues gi)-.25 F -.15(ve)-.25 G 2.999(st).15 G .499
-(he depth of the sonar for)-2.999 F .272(each beam. F)108 348 R .271
-(or hull mounted installations the)-.15 F F2(draft)2.771 E F0 -.25(va)
-2.771 G .271(lue is generally static b).25 F .271(ut the)-.2 F F2(hea)
-2.771 E -.1(ve)-.25 G F0 -.25(va)2.871 G .271(lues v).25 F .271
-(ary with)-.25 F .97(time. F)108 360 R .97(or to)-.15 F .97
-(wed sonars the)-.25 F F2(draft)3.47 E F0 -.25(va)3.47 G .97
-(ries with time and the).25 F F2(hea)3.47 E -.1(ve)-.25 G F0 -.25(va)
-3.57 G .97(lues are typically zero. The).25 F F2(ssv)3.47 E F0 -.25(va)
-3.47 G(lue).25 E(gi)108 372 Q -.15(ve)-.25 G 2.5(st).15 G(he w)-2.5 E
-(ater sound v)-.1 E(elocity at the sonar array)-.15 E(.)-.65 E
-(The return v)108 396 Q(alues are:)-.25 E F1(kind)144 408 Q F0 52(:k)C
-(ind of data record read \(error)-52 E(if not surv)252 420 Q .3 -.15
-(ey d)-.15 H(ata\):).15 E 31(1s)288 432 S(urv)-31 E .3 -.15(ey d)-.15 H
-(ata).15 E F1(nbeams)144 444 Q F0 38.67(:n)C(umber of beams)-38.67 E F1
-(ttimes)144 456 Q F0 45.33(:a)C(rray of tw)-45.33 E(o-w)-.1 E(ay tra)-.1
-E -.15(ve)-.2 G 2.5(lt).15 G(imes in seconds)-2.5 E F1(angles)144 468 Q
-F0 43.11(:a)C(rray of angles from v)-43.11 E(ertical in de)-.15 E(grees)
--.15 E F1(angles_forwar)144 480 Q(d)-.37 E F0 6.25(:a)C
-(rray of angles from acrosstrack in de)-6.25 E(grees)-.15 E F1
-(angles_null)144 492 Q F0 22.55(:a)C
-(rray of sonar array orientation in de)-22.55 E(grees)-.15 E F1(heave)
-144 504 Q F0 45.9(:a)C(rray of hea)-45.9 E .3 -.15(ve v)-.2 H
-(alues for each beam in meters)-.1 E F1(alongtr)144 516 Q(ac)-.15 E
-(k_of)-.2 E(fset)-.18 E F0(:array of alongtrack distance of)A(fsets for)
--.25 E(each beam in meters)252 528 Q F1(dr)144 540 Q(aft)-.15 E F0 49.92
-(:d)C(raft of sonar in meters)-49.92 E F1(ssv)144 552 Q F0 57(:w)C
-(ater sound v)-57.1 E(elocity at sonar in m/seconds)-.15 E F1(err)144
-564 Q(or)-.45 E F0 48.56(:e)C(rror v)-48.56 E(alue)-.25 E 2.777(As)108
-588 S .277(tatus v)-2.777 F .277(alue indicating success or f)-.25 F
-.277(ailure is returned; the error v)-.1 F .277(alue ar)-.25 F(gument)
--.18 E F1(err)2.777 E(or)-.45 E F0 .276(passes more detailed)2.777 F
-(information about data e)108 600 Q(xtraction f)-.15 E(ailures.)-.1 E
-(---------------------------------------------------------)108 624 Q
-(int)108 636 Q F2(mb_detects)2.5 E F0(\()A(int)180 648 Q F1(verbose)2.5
-E F0(,)A -.2(vo)180 660 S(id).2 E F1(*mbio_ptr)2.5 E F0(,)A -.2(vo)180
-672 S(id).2 E F1(*stor)2.5 E(e_ptr)-.37 E F0(,)A(int)180 684 Q F1(*kind)
-2.5 E F0(,)A(int)180 696 Q F1(*nbeams)2.5 E F0(,)A(int)180 708 Q F1
-(*detects)2.5 E F0(,)A(int)180 720 Q F1(*err)2.5 E(or)-.45 E F0(\);)A
-(MB-System 5.0)72 768 Q(26 October 2009)137.055 E(35)190.395 E 0 Cg EP
-%%Page: 36 36
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F .372(The function)108 84 R/F1 10/Times-Bold at 0 SF
-(mb_detects)2.872 E F0 -.15(ex)2.872 G .372
-(tracts beam bottom detect types from a sonar).15 F .372
-(-speci\214c data structure pointed to)-.2 F(by)108 96 Q/F2 10
-/Times-Italic at 0 SF(stor)3.909 E(e_ptr)-.37 E F0 3.909(.T)C 1.409(hese v)
--3.909 F 1.409(alues indicate whether the depth v)-.25 F 1.408
-(alue associated with a particular beam i deri)-.25 F -.15(ve)-.25 G(d)
-.15 E 1.897(from an amplitude detect \(e.g. detects[i] = 1\), a phase d\
-etect \(e.g. detects[i] = 2\), or the algorithm is)108 108 R(unkno)108
-120 Q .843(wn \(e.g. detects[i] = 0\). The)-.25 F F2(verbose)3.343 E F0
--.25(va)3.343 G .843(lue controls the standard error output v).25 F .843
-(erbosity of the func-)-.15 F(tion.)108 132 Q(The return v)108 156 Q
-(alues are:)-.25 E F2(kind)144 168 Q F0 52(:k)C
-(ind of data record read \(error)-52 E(if not surv)252 180 Q .3 -.15
-(ey d)-.15 H(ata\):).15 E 31(1s)288 192 S(urv)-31 E .3 -.15(ey d)-.15 H
-(ata).15 E F2(nbeams)144 204 Q F0 38.67(:n)C(umber of beams)-38.67 E F2
-(detects)144 216 Q F0 41.45(:a)C(rray of)-41.45 E F2(nbeams)2.5 E F0
-(bottom detect algorithm \215ags)2.5 E 3.437(0=u)288 228 S(nkno)-3.437 E
-180.938(wn 1)-.25 F(=)3.438 E(amplitude detect)108 240 Q 2.5(2=p)182.5 G
-(hase detect)-2.5 E F2(err)144 252 Q(or)-.45 E F0 48.56(:e)C(rror v)
--48.56 E(alue)-.25 E 2.777(As)108 276 S .277(tatus v)-2.777 F .277
-(alue indicating success or f)-.25 F .277
-(ailure is returned; the error v)-.1 F .277(alue ar)-.25 F(gument)-.18 E
-F2(err)2.777 E(or)-.45 E F0 .276(passes more detailed)2.777 F .406
-(information about data e)108 288 R .406(xtraction f)-.15 F .406
-(ailures. This functionality is a)-.1 F -.25(va)-.2 G .406
-(ilable for only a subset of the supported).25 F .475
-(sonars. If the corresponding lo)108 300 R 2.975(wl)-.25 G -2.15 -.25
-(ev e)-2.975 H 2.975(lr).25 G .475(outine is unde\214ned,)-2.975 F F2
-(*err)2.975 E(or)-.45 E F0 .475(will be set to MB_ERR)2.975 F(OR_B)-.4 E
-(AD_SYS-)-.35 E(TEM \(14\).)108 312 Q
-(---------------------------------------------------------)108 336 Q
-(int)108 348 Q F1(mb_gains)2.5 E F0(\()A(int)180 360 Q F2(verbose)2.5 E
-F0(,)A -.2(vo)180 372 S(id).2 E F2(*mbio_ptr)2.5 E F0(,)A -.2(vo)180 384
-S(id).2 E F2(*stor)2.5 E(e_ptr)-.37 E F0(,)A(int)180 396 Q F2(*kind)2.5
-E F0(,)A(double)180 408 Q F2(*tr)2.5 E(ansmit_gain)-.15 E F0(,)A(double)
-180 420 Q F2(*pulse_length)2.5 E F0(,)A(double)180 432 Q F2(*r)2.5 E
-(eceive_gain)-.37 E F0(,)A(int)180 444 Q F2(*err)2.5 E(or)-.45 E F0(\);)
-A .33(The function)108 468 R F1(mb_gains)2.83 E F0 -.15(ex)2.83 G .33
-(tracts the most basic g).15 F .33(ain settings from a sonar)-.05 F .33
-(-speci\214c data structure pointed to)-.2 F(by)108 480 Q F2(stor)3.107
-E(e_ptr)-.37 E F0 3.107(.I)C 3.107(nm)-3.107 G(an)-3.107 E 3.107(yc)-.15
-G .607(ases, sonars ha)-3.107 F .907 -.15(ve m)-.2 H .607
-(ore complicated g).15 F .606
-(ain functions, particularly with respect to the)-.05 F(recei)108 492 Q
--.15(ve)-.25 G 2.833(rT).15 G .633 -.15(VG f)-2.833 H .333
-(unction. In those cases, the recei).15 F .633 -.15(ve g)-.25 H .334
-(ain returned here refers to the constant g).1 F .334(ain setting and)
--.05 F .088(does not include an)108 504 R 2.588(yT)-.15 G .388 -.15
-(VG p)-2.588 H .088(arameters. The).15 F F2(verbose)2.588 E F0 -.25(va)
-2.588 G .087(lue controls the standard error output v).25 F .087
-(erbosity of the)-.15 F(function.)108 516 Q(The return v)108 540 Q
-(alues are:)-.25 E F2(kind)144 552 Q F0 52(:k)C
-(ind of data record read \(error)-52 E(if not surv)252 564 Q .3 -.15
-(ey d)-.15 H(ata\):).15 E 31(1s)288 576 S(urv)-31 E .3 -.15(ey d)-.15 H
-(ata).15 E F2(tr)144 588 Q(ansmit_gain)-.15 E F0 13.25(:t)C(ransmit g)
--13.25 E(ain \(dB\))-.05 E F2(pulse_length)144 600 Q F0 18.11(:t)C
-(ransmit pulse length \(sec\))-18.11 E F2 -.37(re)144 612 S(ceive_gain)
-.37 E F0 17.94(:r)C(ecei)-17.94 E .3 -.15(ve g)-.25 H(ain \(dB\)).1 E F2
-(err)144 624 Q(or)-.45 E F0 48.56(:e)C(rror v)-48.56 E(alue)-.25 E 2.776
-(As)108 648 S .276(tatus v)-2.776 F .277(alue indicating success or f)
--.25 F .277(ailure is returned; the error v)-.1 F .277(alue ar)-.25 F
-(gument)-.18 E F2(err)2.777 E(or)-.45 E F0 .277(passes more detailed)
-2.777 F .24(information about data e)108 660 R .24(xtraction f)-.15 F
-2.74(ailures. This)-.1 F .239(functionality is a)2.739 F -.25(va)-.2 G
-.239(ilable for only a subset of the supported).25 F .475
-(sonars. If the corresponding lo)108 672 R 2.975(wl)-.25 G -2.15 -.25
-(ev e)-2.975 H 2.975(lr).25 G .475(outine is unde\214ned,)-2.975 F F2
-(*err)2.975 E(or)-.45 E F0 .475(will be set to MB_ERR)2.975 F(OR_B)-.4 E
-(AD_SYS-)-.35 E(TEM \(14\).)108 684 Q
-(---------------------------------------------------------)108 708 Q
-(int)108 720 Q F1(mb_extract_rawss)2.5 E F0(\()A(MB-System 5.0)72 768 Q
-(26 October 2009)137.055 E(36)190.395 E 0 Cg EP
-%%Page: 37 37
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F(int)180 84 Q/F1 10/Times-Italic at 0 SF(verbose)2.5 E
-F0(,)A(char)180 96 Q F1(*mbio_ptr)2.5 E F0(,)A(char)180 108 Q F1(*stor)
-2.5 E(e_ptr)-.37 E F0(,)A(int)180 120 Q F1(*kind)2.5 E F0(,)A(int)180
-132 Q F1(*nr)2.5 E(awss)-.15 E F0(,)A(double)180 144 Q F1(*r)2.5 E(awss)
--.15 E F0(,)A(double)180 156 Q F1(*r)2.5 E(awssacr)-.15 E(osstr)-.45 E
-(ac)-.15 E(k)-.2 E F0(,)A(double)180 168 Q F1(*r)2.5 E(awssalongtr)-.15
-E(ac)-.15 E(k)-.2 E F0(,)A(int)180 180 Q F1(*err)2.5 E(or)-.45 E F0(\);)
-A 1.159(This function has not yet been implemented for an)108 204 R
-3.659(yd)-.15 G 1.159(ata format.)-3.659 F 1.159
-(The notion is that since some formats)6.159 F .006(carry both "ra)108
-216 R .007(w" and "processed" sidescan imagery)-.15 F 2.507(,t)-.65 G
-.007(here should be functions to e)-2.507 F .007
-(xtract and insert the "ra)-.15 F(w")-.15 E .518(sidescan. Gi)108 228 R
--.15(ve)-.25 G 3.018(nt).15 G .518(hat the meaning of "ra)-3.018 F .518
-(w" sidescan v)-.15 F .518
-(aries greatly among sonars, the processing one might)-.25 F .807
-(apply to the data will depend on the sonar source. The de\214nition of)
-108 240 R/F2 10/Times-Bold at 0 SF(mb_extract_rawss)3.307 E F0 .807
-(may well change)3.307 F(when we actually implement it.)108 252 Q
-(---------------------------------------------------------)108 276 Q
-(int)108 288 Q F2(mb_insert_rawss)2.5 E F0(\()A(int)180 300 Q F1
-(verbose)2.5 E F0(,)A(char)180 312 Q F1(*mbio_ptr)2.5 E F0(,)A(char)180
-324 Q F1(*stor)2.5 E(e_ptr)-.37 E F0(,)A(int)180 336 Q F1(nr)2.5 E(awss)
--.15 E F0(,)A(double)180 348 Q F1(*r)2.5 E(awss)-.15 E F0(,)A(double)180
-360 Q F1(*r)2.5 E(awssacr)-.15 E(osstr)-.45 E(ac)-.15 E(k)-.2 E F0(,)A
-(double)180 372 Q F1(*r)2.5 E(awssalongtr)-.15 E(ac)-.15 E(k)-.2 E F0(,)
-A(int)180 384 Q F1(*err)2.5 E(or)-.45 E F0(\);)A 1.159
-(This function has not yet been implemented for an)108 408 R 3.659(yd)
--.15 G 1.159(ata format.)-3.659 F 1.159
-(The notion is that since some formats)6.159 F .006(carry both "ra)108
-420 R .007(w" and "processed" sidescan imagery)-.15 F 2.507(,t)-.65 G
-.007(here should be functions to e)-2.507 F .007
-(xtract and insert the "ra)-.15 F(w")-.15 E .518(sidescan. Gi)108 432 R
--.15(ve)-.25 G 3.018(nt).15 G .518(hat the meaning of "ra)-3.018 F .518
-(w" sidescan v)-.15 F .518
-(aries greatly among sonars, the processing one might)-.25 F 1.153
-(apply to the data will depend on the sonar source. The de\214nition of)
-108 444 R F2(mb_insert_rawss)3.653 E F0 1.154(may well change)3.653 F
-(when we actually implement it.)108 456 Q
-(---------------------------------------------------------)108 480 Q
-(int)108 492 Q F2(mb_copyr)2.5 E(ecord)-.18 E F0(\()A(int)180 504 Q F1
-(verbose)2.5 E F0(,)A(char)180 516 Q F1(*mbio_ptr)2.5 E F0(,)A(char)180
-528 Q F1(*stor)2.5 E(e_ptr)-.37 E F0(,)A(char)180 540 Q F1(*copy_ptr)2.5
-E F0(,)A(int)180 552 Q F1(*err)2.5 E(or)-.45 E F0(\);)A .558
-(The function)108 576 R F2(mb_copyr)3.058 E(ecord)-.18 E F0 .558
-(copies the sonar)3.058 F .558(-speci\214c data structure pointed to by)
--.2 F F1(stor)3.058 E(e_ptr)-.37 E F0 .557(into the data)3.058 F
-(structure pointed to by)108 588 Q F1(*copy_ptr)2.5 E F0 5(.T)C
-(he data structures must already ha)-5 E .3 -.15(ve b)-.2 H
-(een allocated.).15 E(The return v)108 612 Q(alues are:)-.25 E F1(err)
-144 624 Q(or)-.45 E F0 48.56(:e)C(rror v)-48.56 E(alue)-.25 E 2.776(As)
-108 648 S .276(tatus v)-2.776 F .277(alue indicating success or f)-.25 F
-.277(ailure is returned; the error v)-.1 F .277(alue ar)-.25 F(gument)
--.18 E F1(err)2.777 E(or)-.45 E F0 .277(passes more detailed)2.777 F
-(information about data cop)108 660 Q 2.5(yf)-.1 G(ailures.)-2.6 E/F3
-10.95/Times-Bold at 0 SF(LEVEL 3 FUNCTIONS)72 688.8 Q F0(int)108 700.8 Q F2
-(mb_b)2.5 E(uffer_init)-.2 E F0(\()A(int)180 712.8 Q F1(verbose)2.5 E F0
-(,)A(char)180 724.8 Q F1(**b)2.5 E(uf)-.2 E(f_ptr)-.18 E F0(,)A
-(MB-System 5.0)72 768 Q(26 October 2009)137.055 E(37)190.395 E 0 Cg EP
-%%Page: 38 38
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F(int)180 84 Q/F1 10/Times-Italic at 0 SF(*err)2.5 E(or)
--.45 E F0(\);)A .212(The function)108 108 R/F2 10/Times-Bold at 0 SF(mb_b)
-2.712 E(uffer_init)-.2 E F0 .212
-(initializes the data structures required for b)2.712 F(uf)-.2 E .212
-(fered i/0. A pointer to the b)-.25 F(uf)-.2 E(fer)-.25 E .074
-(data structure is returned as *)108 120 R F1 -.2(bu)C -.18(ff).2 G
-(_ptr).18 E F0 5.074(.T)C(he)-5.074 E F1(verbose)2.574 E F0 -.25(va)
-2.574 G .075(lue controls the standard error output v).25 F .075
-(erbosity of the)-.15 F(function.)108 132 Q(The return v)108 156 Q
-(alues are:)-.25 E(*)144 168 Q F1 -.2(bu)C -.18(ff).2 G(_ptr).18 E F0
-32.37(:p)C(ointer to b)-32.37 E(uf)-.2 E(fer structure)-.25 E F1(err)144
-180 Q(or)-.45 E F0 48.56(:e)C(rror v)-48.56 E(alue)-.25 E 2.777(As)108
-204 S .277(tatus v)-2.777 F .277(alue indicating success or f)-.25 F
-.277(ailure is returned; the error v)-.1 F .277(alue ar)-.25 F(gument)
--.18 E F1(err)2.777 E(or)-.45 E F0 .276(passes more detailed)2.777 F
-(information about b)108 216 Q(uf)-.2 E(fer initialization f)-.25 E
-(ailures.)-.1 E
-(---------------------------------------------------------)108 240 Q
-(int)108 252 Q F2(mb_b)2.5 E(uffer_close)-.2 E F0(\()A(int)180 264 Q F1
-(verbose)2.5 E F0(,)A(char)180 276 Q F1(**b)2.5 E(uf)-.2 E(f_ptr)-.18 E
-F0(,)A(char)180 288 Q F1(*mbio_ptr)2.5 E F0(,)A(int)180 300 Q F1(*err)
-2.5 E(or)-.45 E F0(\);)A 2.334(The function)108 324 R F2(mb_b)4.834 E
-(uffer_close)-.2 E F0 2.334(releases all memory allocated for b)4.834 F
-(uf)-.2 E 2.334(fered i/0, including the structure)-.25 F
-(pointed to by *)108 336 Q F1 -.2(bu)C -.18(ff).2 G(_ptr).18 E F0 5(.T)C
-(he)-5 E F1(verbose)2.5 E F0 -.25(va)2.5 G
-(lue controls the standard error output v).25 E
-(erbosity of the function.)-.15 E(The return v)108 360 Q(alues are:)-.25
-E F1(err)144 372 Q(or)-.45 E F0 48.56(:e)C(rror v)-48.56 E(alue)-.25 E
-2.777(As)108 396 S .277(tatus v)-2.777 F .277
-(alue indicating success or f)-.25 F .277
-(ailure is returned; the error v)-.1 F .277(alue ar)-.25 F(gument)-.18 E
-F1(err)2.777 E(or)-.45 E F0 .276(passes more detailed)2.777 F
-(information about b)108 408 Q(uf)-.2 E(fer deallocation f)-.25 E
-(ailures.)-.1 E
-(---------------------------------------------------------)108 432 Q
-(int)108 444 Q F2(mb_b)2.5 E(uffer_load)-.2 E F0(\()A(int)180 456 Q F1
-(verbose)2.5 E F0(,)A(char)180 468 Q F1(*b)2.5 E(uf)-.2 E(f_ptr)-.18 E
-F0(,char)A F1(*mbio_ptr)2.5 E F0(,)A(int)180 480 Q F1(nwant)2.5 E F0(,)A
-(int)180 492 Q F1(*nload)2.5 E F0(,)A(int)180 504 Q F1(*nb)2.5 E(uf)-.2
-E(f)-.18 E F0(,)A(int)180 516 Q F1(*err)2.5 E(or)-.45 E F0(\);)A .016
-(The function)108 540 R F2(mb_b)2.516 E(uffer_load)-.2 E F0 .017
-(loads data into the b)2.517 F(uf)-.2 E .017(fer pointed to by)-.25 F F1
--.2(bu)2.517 G -.18(ff).2 G(_ptr).18 E F0 .017
-(from the input \214le initialized)2.517 F .479(in the)108 552 R F2
-(MBIO)2.979 E F0 .479(descriptor pointed to by)2.979 F F1(mbio_ptr)2.979
-E F0 5.479(.T)C(he)-5.479 E F1(verbose)2.979 E F0 -.25(va)2.979 G .478
-(lue controls the standard error output v).25 F(er)-.15 E(-)-.2 E
-(bosity of the function.)108 564 Q(The input control parameters ha)108
-588 Q .3 -.15(ve t)-.2 H(he follo).15 E(wing signi\214cance:)-.25 E F1
-(nwant)144 600 Q F0 44.77(:T)C(he number of data records desired)-44.77
-E(in the b)252 612 Q(uf)-.2 E(fer)-.25 E(.)-.55 E(The returned v)108 636
-Q(alues are:)-.25 E F1(nload)144 648 Q F0 46.44(:T)C
-(he number of data records loaded into the b)-46.44 E(uf)-.2 E(fer)-.25
-E(.)-.55 E F1(nb)144 660 Q(uf)-.2 E(f)-.18 E F0 49.04(:T)C
-(he total number of data records in the b)-49.04 E(uf)-.2 E
-(fer after loading.)-.25 E F1(err)144 672 Q(or)-.45 E F0 48.56(:e)C
-(rror v)-48.56 E(alue)-.25 E .374(The b)108 696 R(uf)-.2 E .374
-(fer may already contain data records when the)-.25 F F2(mb_b)2.874 E
-(uffer_load)-.2 E F0 .374(call is made; if the number of pre-)2.874 F
-.371(viously loaded records is less than)108 708 R F1(nwant)2.871 E F0
-2.871(,t)C .37
-(he function will attempt to read and load records until a total of)
--2.871 F F1(nwant)108 720 Q F0 .236(records are loaded. The)2.735 F F1
-(nload)2.736 E F0 -.25(va)2.736 G .236
-(lue is the number of data records loaded during the current function)
-.25 F(MB-System 5.0)72 768 Q(26 October 2009)137.055 E(38)190.395 E 0 Cg
-EP
-%%Page: 39 39
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F 3.833(call, and the)108 84 R/F1 10/Times-Italic at 0
-SF(nb)6.333 E(uf)-.2 E(f)-.18 E F0 -.25(va)6.333 G 3.832
-(lue is the number of data records in the b).25 F(uf)-.2 E 3.832
-(fer at the completion of the)-.25 F/F2 10/Times-Bold at 0 SF(mb_b)108 96 Q
-(uffer_load)-.2 E F0 3.908(call. A)3.908 F 1.408(status v)3.908 F 1.408
-(alue indicating success or f)-.25 F 1.409
-(ailure is returned; the error v)-.1 F 1.409(alue ar)-.25 F(gument)-.18
-E F1(err)108 108 Q(or)-.45 E F0
-(passes more detailed information about b)2.5 E(uf)-.2 E
-(fer deallocation f)-.25 E(ailures.)-.1 E
-(---------------------------------------------------------)108 132 Q
-(int)108 144 Q F2(mb_b)2.5 E(uffer_dump)-.2 E F0(\()A(int)180 156 Q F1
-(verbose)2.5 E F0(,)A(char)180 168 Q F1(*b)2.5 E(uf)-.2 E(f_ptr)-.18 E
-F0(,)A(char)180 180 Q F1(*mbio_ptr)2.5 E F0(,)A(char)180 192 Q F1
-(*ombio_ptr)2.5 E F0(,)A(int)180 204 Q F1(nhold)2.5 E F0(,)A(int)180 216
-Q F1(*ndump)2.5 E F0(,)A(int)180 228 Q F1(*nb)2.5 E(uf)-.2 E(f)-.18 E F0
-(,)A(int)180 240 Q F1(*err)2.5 E(or)-.45 E F0(\);)A .26(The function)108
-264 R F2(mb_b)2.76 E(uffer_dump)-.2 E F0 .26(dumps data from the b)2.76
-F(uf)-.2 E .259(fer pointed to by *)-.25 F F1 -.2(bu)C -.18(ff).2 G
-(_ptr).18 E F0 .259(into the output \214le ini-)2.759 F .71
-(tialized in the)108 276 R F2(MBIO)3.21 E F0 .71
-(descriptor pointed to by)3.21 F F1(ombio_ptr)3.21 E F0 3.211(.T)C .711
-(he data in the b)-3.211 F(uf)-.2 E .711(fer were read from the input)
--.25 F 1.208(\214le initialized in the)108 288 R F2(MBIO)3.708 E F0
-1.208(descriptor pointed to by)3.708 F F1(mbio_ptr)3.708 E F0 6.208(.T)C
-(he)-6.208 E F1(verbose)3.708 E F0 -.25(va)3.708 G 1.208
-(lue controls the standard).25 F(error output v)108 300 Q
-(erbosity of the function.)-.15 E(The input control parameters ha)108
-324 Q .3 -.15(ve t)-.2 H(he follo).15 E(wing signi\214cance:)-.25 E F1
-(nhold)144 336 Q F0 46.44(:T)C
-(he number of data records desired to be held)-46.44 E(in the b)252 348
-Q(uf)-.2 E(fer)-.25 E(.)-.55 E(The returned v)108 372 Q(alues are:)-.25
-E F1(nload)144 384 Q F0 46.44(:T)C
-(he number of data records dumped from the b)-46.44 E(uf)-.2 E(fer)-.25
-E(.)-.55 E F1(nb)144 396 Q(uf)-.2 E(f)-.18 E F0 49.04(:T)C
-(he total number of data records in the b)-49.04 E(uf)-.2 E
-(fer after dumping.)-.25 E F1(err)144 408 Q(or)-.45 E F0 48.56(:e)C
-(rror v)-48.56 E(alue)-.25 E .401
-(If the number of loaded records is more than)108 432 R F1(nhold)2.901 E
-F0 2.901(,t)C .401
-(he function will attempt to write out records from the)-2.901 F(be)108
-444 Q 1.026(ginning of the b)-.15 F(uf)-.2 E 1.026(fer until)-.25 F F1
-(nhold)3.526 E F0 1.026(records are left in the b)3.526 F(uf)-.2 E(fer)
--.25 E 3.526(.T)-.55 G(he)-3.526 E F1(ndump)3.526 E F0 -.25(va)3.526 G
-1.025(lue is the number of data).25 F .906
-(records dumped during the current function call, and the)108 456 R F1
-(nb)3.407 E(uf)-.2 E(f)-.18 E F0 -.25(va)3.407 G .907
-(lue is the number of data records in the).25 F -.2(bu)108 468 S -.25
-(ff).2 G 1.889(er at the completion of the).25 F F2(mb_b)4.389 E
-(uffer_dump)-.2 E F0 4.389(call. A)4.389 F 1.889(status v)4.389 F 1.888
-(alue indicating success or f)-.25 F 1.888(ailure is)-.1 F 1.19
-(returned; the error v)108 480 R 1.19(alue ar)-.25 F(gument)-.18 E F1
-(err)3.69 E(or)-.45 E F0 1.19(passes more detailed information about b)
-3.69 F(uf)-.2 E 1.19(fer deallocation f)-.25 F(ail-)-.1 E(ures.)108 492
-Q(---------------------------------------------------------)108 516 Q
-(int)108 528 Q F2(mb_b)2.5 E(uffer_clear)-.2 E F0(\()A(int)180 540 Q F1
-(verbose)2.5 E F0(,)A(char)180 552 Q F1(*b)2.5 E(uf)-.2 E(f_ptr)-.18 E
-F0(,)A(char)180 564 Q F1(*mbio_ptr)2.5 E F0(,)A(int)180 576 Q F1(nhold)
-2.5 E F0(,)A(int)180 588 Q F1(*ndump)2.5 E F0(,)A(int)180 600 Q F1(*nb)
-2.5 E(uf)-.2 E(f)-.18 E F0(,)A(int)180 612 Q F1(*err)2.5 E(or)-.45 E F0
-(\);)A .4(The function)108 636 R F2(mb_b)2.9 E(uffer_clear)-.2 E F0
-(remo)2.9 E -.15(ve)-.15 G 2.9(sd).15 G .4(ata from the b)-2.9 F(uf)-.2
-E .4(fer pointed to by *)-.25 F F1 -.2(bu)C -.18(ff).2 G(_ptr).18 E F0
-.4(without writing those)2.9 F .691
-(data records to an output \214le. An)108 648 R F2(MBIO)3.192 E F0 .692
-(descriptor pointed to by)3.192 F F1(mbio_ptr)3.192 E F0 .692
-(is still required, and generally)3.192 F .742(represents the)108 660 R
-F2(MBIO)3.242 E F0 .742
-(descriptor used to read and load the data originally)3.242 F 5.742(.T)
--.65 G(he)-5.742 E F1(verbose)3.242 E F0 -.25(va)3.242 G .741
-(lue controls the).25 F(standard error output v)108 672 Q
-(erbosity of the function.)-.15 E(The input control parameters ha)108
-696 Q .3 -.15(ve t)-.2 H(he follo).15 E(wing signi\214cance:)-.25 E F1
-(nwant)144 708 Q F0 44.77(:T)C
-(he number of data records desired to be held)-44.77 E(in the b)252 720
-Q(uf)-.2 E(fer)-.25 E(.)-.55 E(MB-System 5.0)72 768 Q(26 October 2009)
-137.055 E(39)190.395 E 0 Cg EP
-%%Page: 40 40
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F(The returned v)108 84 Q(alues are:)-.25 E/F1 10
-/Times-Italic at 0 SF(nload)144 96 Q F0 46.44(:T)C
-(he number of data records cleared from the b)-46.44 E(uf)-.2 E(fer)-.25
-E(.)-.55 E F1(nb)144 108 Q(uf)-.2 E(f)-.18 E F0 49.04(:T)C
-(he total number of data records in the b)-49.04 E(uf)-.2 E
-(fer after dumping.)-.25 E F1(err)144 120 Q(or)-.45 E F0 48.56(:e)C
-(rror v)-48.56 E(alue)-.25 E .46
-(If the number of loaded records is more than)108 144 R F1(nhold)2.96 E
-F0 2.96(,t)C .46(he function will attempt to clear out records from the)
--2.96 F(be)108 156 Q 1.026(ginning of the b)-.15 F(uf)-.2 E 1.026
-(fer until)-.25 F F1(nhold)3.526 E F0 1.026(records are left in the b)
-3.526 F(uf)-.2 E(fer)-.25 E 3.526(.T)-.55 G(he)-3.526 E F1(ndump)3.526 E
-F0 -.25(va)3.526 G 1.025(lue is the number of data).25 F 1.092
-(records cleared during the current function call, and the)108 168 R F1
-(nb)3.593 E(uf)-.2 E(f)-.18 E F0 -.25(va)3.593 G 1.093
-(lue is the number of data records in the).25 F -.2(bu)108 180 S -.25
-(ff).2 G 1.889(er at the completion of the).25 F/F2 10/Times-Bold at 0 SF
-(mb_b)4.389 E(uffer_dump)-.2 E F0 4.389(call. A)4.389 F 1.889(status v)
-4.389 F 1.888(alue indicating success or f)-.25 F 1.888(ailure is)-.1 F
-1.19(returned; the error v)108 192 R 1.19(alue ar)-.25 F(gument)-.18 E
-F1(err)3.69 E(or)-.45 E F0 1.19
-(passes more detailed information about b)3.69 F(uf)-.2 E 1.19
-(fer deallocation f)-.25 F(ail-)-.1 E(ures.)108 204 Q
-(---------------------------------------------------------)108 228 Q
-(int)108 240 Q F2(mb_b)2.5 E(uffer_inf)-.2 E(o)-.25 E F0(\()A(int)180
-252 Q F1(verbose)2.5 E F0(,)A(char)180 264 Q F1(*b)2.5 E(uf)-.2 E(f_ptr)
--.18 E F0(,)A(char)180 276 Q F1(*mbio_ptr)2.5 E F0(,)A(int)180 288 Q F1
-(id)2.5 E F0(,)A(int)180 300 Q F1(*system)2.5 E F0(,)A(int)180 312 Q F1
-(*kind)2.5 E F0(,)A(int)180 324 Q F1(*err)2.5 E(or)-.45 E F0(\);)A .4
-(The function)108 348 R F2(mb_b)2.9 E(uffer_clear)-.2 E F0(remo)2.9 E
--.15(ve)-.15 G 2.9(sd).15 G .4(ata from the b)-2.9 F(uf)-.2 E .4
-(fer pointed to by *)-.25 F F1 -.2(bu)C -.18(ff).2 G(_ptr).18 E F0 .4
-(without writing those)2.9 F .691(data records to an output \214le. An)
-108 360 R F2(MBIO)3.192 E F0 .692(descriptor pointed to by)3.192 F F1
-(mbio_ptr)3.192 E F0 .692(is still required, and generally)3.192 F .742
-(represents the)108 372 R F2(MBIO)3.242 E F0 .742
-(descriptor used to read and load the data originally)3.242 F 5.742(.T)
--.65 G(he)-5.742 E F1(verbose)3.242 E F0 -.25(va)3.242 G .741
-(lue controls the).25 F(standard error output v)108 384 Q
-(erbosity of the function.)-.15 E(The input control parameters ha)108
-408 Q .3 -.15(ve t)-.2 H(he follo).15 E(wing signi\214cance:)-.25 E F1
-(nwant)144 420 Q F0 44.77(:T)C
-(he number of data records desired to be held)-44.77 E(in the b)252 432
-Q(uf)-.2 E(fer)-.25 E(.)-.55 E(The returned v)108 456 Q(alues are:)-.25
-E F1(nload)144 468 Q F0 46.44(:T)C
-(he number of data records cleared from the b)-46.44 E(uf)-.2 E(fer)-.25
-E(.)-.55 E F1(nb)144 480 Q(uf)-.2 E(f)-.18 E F0 49.04(:T)C
-(he total number of data records in the b)-49.04 E(uf)-.2 E
-(fer after dumping.)-.25 E F1(err)144 492 Q(or)-.45 E F0 48.56(:e)C
-(rror v)-48.56 E(alue)-.25 E .46
-(If the number of loaded records is more than)108 516 R F1(nhold)2.96 E
-F0 2.96(,t)C .46(he function will attempt to clear out records from the)
--2.96 F(be)108 528 Q 1.026(ginning of the b)-.15 F(uf)-.2 E 1.026
-(fer until)-.25 F F1(nhold)3.526 E F0 1.026(records are left in the b)
-3.526 F(uf)-.2 E(fer)-.25 E 3.526(.T)-.55 G(he)-3.526 E F1(ndump)3.526 E
-F0 -.25(va)3.526 G 1.025(lue is the number of data).25 F 1.092
-(records cleared during the current function call, and the)108 540 R F1
-(nb)3.593 E(uf)-.2 E(f)-.18 E F0 -.25(va)3.593 G 1.093
-(lue is the number of data records in the).25 F -.2(bu)108 552 S -.25
-(ff).2 G 1.889(er at the completion of the).25 F F2(mb_b)4.389 E
-(uffer_dump)-.2 E F0 4.389(call. A)4.389 F 1.889(status v)4.389 F 1.888
-(alue indicating success or f)-.25 F 1.888(ailure is)-.1 F 1.19
-(returned; the error v)108 564 R 1.19(alue ar)-.25 F(gument)-.18 E F1
-(err)3.69 E(or)-.45 E F0 1.19(passes more detailed information about b)
-3.69 F(uf)-.2 E 1.19(fer deallocation f)-.25 F(ail-)-.1 E(ures.)108 576
-Q(---------------------------------------------------------)108 600 Q
-(int)108 612 Q F2(mb_b)2.5 E(uffer_get_next_data)-.2 E F0(\()A(int)180
-624 Q F1(verbose)2.5 E F0(,)A(char)180 636 Q F1(*b)2.5 E(uf)-.2 E(f_ptr)
--.18 E F0(,)A(char)180 648 Q F1(*mbio_ptr)2.5 E F0(,)A(int)180 660 Q F1
-(start)2.5 E F0(,)A(int)180 672 Q F1(*id)2.5 E F0(,)A(int)180 684 Q F1
-(time_i[7])2.5 E F0(,)A(double)180 696 Q F1(*time_d)2.5 E F0(,)A(double)
-180 708 Q F1(*navlon)2.5 E F0(,)A(double)180 720 Q F1(*navlat)2.5 E F0
-(,)A(MB-System 5.0)72 768 Q(26 October 2009)137.055 E(40)190.395 E 0 Cg
-EP
-%%Page: 41 41
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F(double)180 84 Q/F1 10/Times-Italic at 0 SF(*speed)2.5
-E F0(,)A(double)180 96 Q F1(*heading)2.5 E F0(,)A(int)180 108 Q F1
-(*nbath)2.5 E F0(,)A(int)180 120 Q F1(*namp)2.5 E F0(,)A(int)180 132 Q
-F1(*nss)2.5 E F0(,)A(char)180 144 Q F1(*beam\215a)2.5 E(g)-.1 E F0(,)A
-(double)180 156 Q F1(*bath)2.5 E F0(,)A(double)180 168 Q F1(*amp)2.5 E
-F0(,)A(double)180 180 Q F1(*bathacr)2.5 E(osstr)-.45 E(ac)-.15 E(k)-.2 E
-F0(,)A(double)180 192 Q F1(*bathalongtr)2.5 E(ac)-.15 E(k)-.2 E F0(,)A
-(double)180 204 Q F1(*ss)2.5 E F0(,)A(double)180 216 Q F1(*ssacr)2.5 E
-(osstr)-.45 E(ac)-.15 E(k)-.2 E F0(,)A(double)180 228 Q F1(*ssalongtr)
-2.5 E(ac)-.15 E(k)-.2 E F0(,)A(int)180 240 Q F1(*err)2.5 E(or)-.45 E F0
-(\);)A .09(The function)108 264 R/F2 10/Times-Bold at 0 SF(mb_b)2.59 E
-(uffer_get_next_data)-.2 E F0 .089(searches for the ne)2.59 F .089
-(xt surv)-.15 F .389 -.15(ey d)-.15 H .089(ata record in the b).15 F(uf)
--.2 E(fer)-.25 E 2.589(,b)-.4 G -.15(eg)-2.589 G .089(inning at).15 F
--.2(bu)108 276 S -.25(ff).2 G .588(er inde).25 F(x)-.15 E F1(start)3.088
-E F0 3.088(.S)C .588(ince b)-3.088 F(uf)-.2 E .588(fer inde)-.25 F -.15
-(xe)-.15 G 3.089(sb).15 G -.15(eg)-3.089 G .589
-(in at 0, the \214rst call to).15 F F2(mb_b)3.089 E(uffer_get_next_data)
--.2 E F0 .589(should ha)3.089 F -.15(ve)-.2 G F1(start)108 288 Q F0
-2.846(=0)2.846 G 5.346(.I)-2.846 G 2.846(fas)-5.346 G(urv)-2.846 E .645
--.15(ey d)-.15 H .345(ata record is found at or be).15 F(yond)-.15 E F1
-(start)2.845 E F0(,)A F2(mb_b)2.845 E(uffer_get_next_data)-.2 E F0 .345
-(returns the b)2.845 F(uf)-.2 E(fer)-.25 E(inde)108 300 Q 2.879(xo)-.15
-G 2.879(ft)-2.879 G .379(hat record in)-2.879 F F1(id)2.879 E F0 2.879
-(.D)C .379(ata is also returned in the forms of bath)-2.879 F(ymetry)
--.05 E 2.88(,a)-.65 G .38(mplitude, and sidescan surv)-2.88 F -.15(ey)
--.15 G .363(data. No comments or other non-surv)108 312 R .663 -.15
-(ey d)-.15 H .363(ata records are returned.).15 F(The)5.363 E F1
-(verbose)2.862 E F0 -.25(va)2.862 G .362(lue controls the standard).25 F
-(error output v)108 324 Q(erbosity of the function.)-.15 E
-(The input control parameters ha)108 348 Q .3 -.15(ve t)-.2 H(he follo)
-.15 E(wing signi\214cance:)-.25 E F1(start)144 360 Q F0 50.88(:T)C(he b)
--50.88 E(uf)-.2 E(fer inde)-.25 E 2.5(xa)-.15 G 2.5(tw)-2.5 G
-(hich to start)-2.5 E(searching for a surv)216 372 Q .3 -.15(ey d)-.15 H
-(ata record.).15 E(The returned v)108 396 Q(alues are:)-.25 E F1(id)144
-408 Q F0 61.44(:T)C(he b)-61.44 E(uf)-.2 E(fer inde)-.25 E 2.5(xo)-.15 G
-2.5(ft)-2.5 G(he \214rst surv)-2.5 E -.15(ey)-.15 G
-(data record at or after)216 420 Q F1(start)2.5 E F0(.)A F1(time_i)144
-432 Q F0 44.22(:t)C(ime of current ping)-44.22 E F1(time_i)216 444 Q F0
-([0]: year)A F1(time_i)216 456 Q F0([1]: month)A F1(time_i)216 468 Q F0
-([2]: day)A F1(time_i)216 480 Q F0([3]: hour)A F1(time_i)216 492 Q F0
-([4]: minute)A F1(time_i)216 504 Q F0([5]: second)A F1(time_i)216 516 Q
-F0([6]: microsecond)A F1(time_d)144 528 Q F0 42(:t)C
-(ime of current ping in seconds)-42 E(since 1/1/70 00:00:00)216 540 Q F1
-(navlon)144 552 Q F0 42(:l)C(ongitude)-42 E F1(navlat)144 564 Q F0 44.22
-(:l)C(atitude)-44.22 E F1(speed)144 576 Q F0 46.45(:s)C
-(hip speed in km/s)-46.45 E F1(heading)144 588 Q F0 37(:s)C
-(hip heading in de)-37 E(grees)-.15 E F1(nbath)144 600 Q F0 46.44(:n)C
-(umber of bath)-46.44 E(ymetry v)-.05 E(alues)-.25 E F1(namp)144 612 Q
-F0 47(:n)C(umber of amplitude v)-47 E(alues)-.25 E F1(nss)144 624 Q F0
-56.44(:n)C .058(umber of sidescan v)-56.44 F(alues)-.25 E F1(beam\215a)
-38.558 E(g)-.1 E F0 68.66(:a)C .059(rray of bath)-68.66 F(yme-)-.05 E
-(try \215ags)108 636 Q F1(bath)144 648 Q F0 51.44(:a)C(rray of bath)
--51.44 E(ymetry v)-.05 E(alues in meters)-.25 E F1(amp)144 660 Q F0 52
-(:a)C(rray of amplitude v)-52 E(alues in unkno)-.25 E(wn units)-.25 E F1
-(bathacr)144 672 Q(osstr)-.45 E(ac)-.15 E(k)-.2 E F0 5.58(:a)C
-(rray of of acrosstrack distances)-5.58 E
-(in meters corresponding to bath)216 684 Q(ymetry)-.05 E F1(bathalongtr)
-144 696 Q(ac)-.15 E(k)-.2 E F0 8.46(:a)C
-(rray of of alongtrack distances)-8.46 E
-(in meters corresponding to bath)216 708 Q(ymetry)-.05 E F1(ss)144 720 Q
-F0 61.44(:a)C(rray of sidescan v)-61.44 E(alues in unkno)-.25 E
-(wn units)-.25 E(MB-System 5.0)72 768 Q(26 October 2009)137.055 E(41)
-190.395 E 0 Cg EP
-%%Page: 42 42
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F/F1 10/Times-Italic at 0 SF(ssacr)144 84 Q(osstr)-.45 E
-(ac)-.15 E(k)-.2 E F0 15.58(:a)C(rray of of acrosstrack distances)-15.58
-E(in meters corresponding to sidescan)216 96 Q F1(ssacr)144 108 Q(osstr)
--.45 E(ac)-.15 E(k)-.2 E F0 15.58(:a)C(rray of of alongtrack distances)
--15.58 E(in meters corresponding to sidescan)216 120 Q F1(err)144 132 Q
-(or)-.45 E F0 48.56(:e)C(rror v)-48.56 E(alue)-.25 E 2.777(As)108 156 S
-.277(tatus v)-2.777 F .277(alue indicating success or f)-.25 F .277
-(ailure is returned; the error v)-.1 F .277(alue ar)-.25 F(gument)-.18 E
-F1(err)2.777 E(or)-.45 E F0 .276(passes more detailed)2.777 F .311
-(information about f)108 168 R .312
-(ailures. The most common error occurs when no more surv)-.1 F .612 -.15
-(ey d)-.15 H .312(ata records remain to be).15 F(found in the b)108 180
-Q(uf)-.2 E(fer; in this case,)-.25 E F1(err)2.5 E(or)-.45 E F0 2.5(=-)
-2.5 G(14.)-2.5 E
-(---------------------------------------------------------)108 204 Q
-(int)108 216 Q/F2 10/Times-Bold at 0 SF(mb_b)2.5 E(uffer_extract)-.2 E F0
-(\()A(int)180 228 Q F1(verbose)2.5 E F0(,)A(char)180 240 Q F1(*b)2.5 E
-(uf)-.2 E(f_ptr)-.18 E F0(,)A(char)180 252 Q F1(*mbio_ptr)2.5 E F0(,)A
-(int)180 264 Q F1(id)2.5 E F0(,)A(int)180 276 Q F1(*kind)2.5 E F0(,)A
-(int)180 288 Q F1(time_i[7])2.5 E F0(,)A(double)180 300 Q F1(*time_d)2.5
-E F0(,)A(double)180 312 Q F1(*navlon)2.5 E F0(,)A(double)180 324 Q F1
-(*navlat)2.5 E F0(,)A(double)180 336 Q F1(*speed)2.5 E F0(,)A(double)180
-348 Q F1(*heading)2.5 E F0(,)A(int)180 360 Q F1(*nbath)2.5 E F0(,)A(int)
-180 372 Q F1(*namp)2.5 E F0(,)A(int)180 384 Q F1(*nss)2.5 E F0(,)A(char)
-180 396 Q F1(*beam\215a)2.5 E(g)-.1 E F0(,)A(double)180 408 Q F1(*bath)
-2.5 E F0(,)A(double)180 420 Q F1(*amp)2.5 E F0(,)A(double)180 432 Q F1
-(*bathacr)2.5 E(osstr)-.45 E(ac)-.15 E(k)-.2 E F0(,)A(double)180 444 Q
-F1(*bathalongtr)2.5 E(ac)-.15 E(k)-.2 E F0(,)A(double)180 456 Q F1(*ss)
-2.5 E F0(,)A(double)180 468 Q F1(*ssacr)2.5 E(osstr)-.45 E(ac)-.15 E(k)
--.2 E F0(,)A(double)180 480 Q F1(*ssalongtr)2.5 E(ac)-.15 E(k)-.2 E F0
-(,)A(char)180 492 Q F1(*comment)2.5 E F0(,)A(int)180 504 Q F1(*err)2.5 E
-(or)-.45 E F0(\);)A .6(The function)108 528 R F2(mb_b)3.1 E
-(uffer_extract)-.2 E F0 -.15(ex)3.1 G .599
-(tracts and returns a subset of the data in a b).15 F(uf)-.2 E .599
-(fer record.)-.25 F(The)5.599 E F1(verbose)3.099 E F0 -.25(va)108 540 S
-.877(lue controls the standard error output v).25 F .877
-(erbosity of the function.)-.15 F .878(The b)5.878 F(uf)-.2 E .878
-(fer record is speci\214ed with the)-.25 F -.2(bu)108 552 S -.25(ff).2 G
-.224(er inde).25 F(x)-.15 E F1(id)2.724 E F0 2.724(.T)C .223
-(he data is either in the form of bath)-2.724 F(ymetry)-.05 E 2.723(,a)
--.65 G .223(mplitude, and sidescan surv)-2.723 F .523 -.15(ey d)-.15 H
-.223(ata or a com-).15 F(ment string.)108 564 Q
-(The input control parameters ha)108 588 Q .3 -.15(ve t)-.2 H(he follo)
-.15 E(wing signi\214cance:)-.25 E F1(id)144 600 Q F0 61.44(:T)C(he b)
--61.44 E(uf)-.2 E(fer inde)-.25 E 2.5(xo)-.15 G 2.5(ft)-2.5 G(he data)
--2.5 E(record to e)216 612 Q(xtract.)-.15 E(The returned v)108 636 Q
-(alues are:)-.25 E F1(kind)144 648 Q F0 52(:k)C(ind of data record e)-52
-E(xtracted)-.15 E 31(1s)288 660 S(urv)-31 E .3 -.15(ey d)-.15 H(ata).15
-E 31(2c)288 672 S(omment)-31 E 17.22(>=3 other)288 684 R
-(data that cannot)2.5 E(be passed by)324 696 Q F2(mb_b)2.5 E
-(uffer_extract)-.2 E F1(time_i)144 708 Q F0 44.22(:t)C
-(ime of current ping)-44.22 E F1(time_i)216 720 Q F0([0]: year)A
-(MB-System 5.0)72 768 Q(26 October 2009)137.055 E(42)190.395 E 0 Cg EP
-%%Page: 43 43
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F/F1 10/Times-Italic at 0 SF(time_i)216 84 Q F0
-([1]: month)A F1(time_i)216 96 Q F0([2]: day)A F1(time_i)216 108 Q F0
-([3]: hour)A F1(time_i)216 120 Q F0([4]: minute)A F1(time_i)216 132 Q F0
-([5]: second)A F1(time_i)216 144 Q F0([6]: microsecond)A F1(time_d)144
-156 Q F0 42(:t)C(ime of current ping in seconds)-42 E
-(since 1/1/70 00:00:00)216 168 Q F1(navlon)144 180 Q F0 42(:l)C
-(ongitude)-42 E F1(navlat)144 192 Q F0 44.22(:l)C(atitude)-44.22 E F1
-(speed)144 204 Q F0 46.45(:s)C(hip speed in km/s)-46.45 E F1(heading)144
-216 Q F0 37(:s)C(hip heading in de)-37 E(grees)-.15 E F1(nbath)144 228 Q
-F0 46.44(:n)C(umber of bath)-46.44 E(ymetry v)-.05 E(alues)-.25 E F1
-(namp)144 240 Q F0 47(:n)C(umber of amplitude v)-47 E(alues)-.25 E F1
-(nss)144 252 Q F0 56.44(:n)C(umber of sidescan v)-56.44 E(alues)-.25 E
-F1(beam\215a)144 264 Q(g)-.1 E F0 68.66(:a)C(rray of bath)-68.66 E
-(ymetry \215ags)-.05 E F1(bath)144 276 Q F0 51.44(:a)C(rray of bath)
--51.44 E(ymetry v)-.05 E(alues in meters)-.25 E F1(amp)144 288 Q F0 52
-(:a)C(rray of amplitude v)-52 E(alues in unkno)-.25 E(wn units)-.25 E F1
-(bathacr)144 300 Q(osstr)-.45 E(ac)-.15 E(k)-.2 E F0 5.58(:a)C
-(rray of of acrosstrack distances)-5.58 E
-(in meters corresponding to bath)216 312 Q(ymetry)-.05 E F1(bathalongtr)
-144 324 Q(ac)-.15 E(k)-.2 E F0 8.46(:a)C
-(rray of of alongtrack distances)-8.46 E
-(in meters corresponding to bath)216 336 Q(ymetry)-.05 E F1(ss)144 348 Q
-F0 61.44(:a)C(rray of sidescan v)-61.44 E(alues in unkno)-.25 E
-(wn units)-.25 E F1(ssacr)144 360 Q(osstr)-.45 E(ac)-.15 E(k)-.2 E F0
-15.58(:a)C(rray of of acrosstrack distances)-15.58 E
-(in meters corresponding to sidescan)216 372 Q F1(ssacr)144 384 Q(osstr)
--.45 E(ac)-.15 E(k)-.2 E F0 15.58(:a)C(rray of of alongtrack distances)
--15.58 E(in meters corresponding to sidescan)216 396 Q F1(comment)144
-408 Q F0 69.12(:c)C(omment string)-69.12 E F1(err)144 420 Q(or)-.45 E F0
-48.56(:e)C(rror v)-48.56 E(alue)-.25 E 2.776(As)108 444 S .276(tatus v)
--2.776 F .277(alue indicating success or f)-.25 F .277
-(ailure is returned; the error v)-.1 F .277(alue ar)-.25 F(gument)-.18 E
-F1(err)2.777 E(or)-.45 E F0 .277(passes more detailed)2.777 F
-(information about e)108 456 Q(xtract f)-.15 E(ailures.)-.1 E
-(---------------------------------------------------------)108 480 Q
-(int)108 492 Q/F2 10/Times-Bold at 0 SF(mb_b)2.5 E(uffer_insert)-.2 E F0
-(\()A(int)180 504 Q F1(verbose)2.5 E F0(,)A(char)180 516 Q F1(*b)2.5 E
-(uf)-.2 E(f_ptr)-.18 E F0(,)A(char)180 528 Q F1(*mbio_ptr)2.5 E F0(,)A
-(int)180 540 Q F1(id)2.5 E F0(,)A(int)180 552 Q F1(time_i[7])2.5 E F0(,)
-A(double)180 564 Q F1(time_d)2.5 E F0(,)A(double)180 576 Q F1(navlon)2.5
-E F0(,)A(double)180 588 Q F1(navlat)2.5 E F0(,)A(double)180 600 Q F1
-(speed)2.5 E F0(,)A(double)180 612 Q F1(heading)2.5 E F0(,)A(int)180 624
-Q F1(nbath)2.5 E F0(,)A(int)180 636 Q F1(namp)2.5 E F0(,)A(int)180 648 Q
-F1(nss)2.5 E F0(,)A(char)180 660 Q F1(*beam\215a)2.5 E(g)-.1 E F0(,)A
-(double)180 672 Q F1(*bath)2.5 E F0(,)A(double)180 684 Q F1(*amp)2.5 E
-F0(,)A(double)180 696 Q F1(*bathacr)2.5 E(osstr)-.45 E(ac)-.15 E(k)-.2 E
-F0(,)A(double)180 708 Q F1(*bathalongtr)2.5 E(ac)-.15 E(k)-.2 E F0(,)A
-(double)180 720 Q F1(*ss)2.5 E F0(,)A(MB-System 5.0)72 768 Q
-(26 October 2009)137.055 E(43)190.395 E 0 Cg EP
-%%Page: 44 44
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F(double)180 84 Q/F1 10/Times-Italic at 0 SF(*ssacr)2.5
-E(osstr)-.45 E(ac)-.15 E(k)-.2 E F0(,)A(double)180 96 Q F1(*ssalongtr)
-2.5 E(ac)-.15 E(k)-.2 E F0(,)A(char)180 108 Q F1(*comment)2.5 E F0(,)A
-(int)180 120 Q F1(*err)2.5 E(or)-.45 E F0(\);)A .662(The function)108
-144 R/F2 10/Times-Bold at 0 SF(mb_b)3.162 E(uffer_insert)-.2 E F0 .662
-(inserts data into a b)3.162 F(uf)-.2 E .662
-(fer record, replacing a subset of the original v)-.25 F(alues.)-.25 E
-(The)108 156 Q F1(verbose)3.066 E F0 -.25(va)3.066 G .566
-(lue controls the standard error output v).25 F .566
-(erbosity of the function.)-.15 F .567(The b)5.566 F(uf)-.2 E .567
-(fer record is speci-)-.25 F .652(\214ed with the b)108 168 R(uf)-.2 E
-.651(fer inde)-.25 F(x)-.15 E F1(id)3.151 E F0 3.151(.T)C .651
-(he data is either in the form of bath)-3.151 F(ymetry)-.05 E 3.151(,a)
--.65 G .651(mplitude, and sidescan surv)-3.151 F -.15(ey)-.15 G
-(data or a comment string.)108 180 Q(The input control parameters ha)108
-204 Q .3 -.15(ve t)-.2 H(he follo).15 E(wing signi\214cance:)-.25 E F1
-(id)144 216 Q F0 61.44(:T)C(he b)-61.44 E(uf)-.2 E(fer inde)-.25 E 2.5
-(xo)-.15 G 2.5(ft)-2.5 G(he data)-2.5 E(record to insert.)216 228 Q
-(The returned v)108 252 Q(alues are:)-.25 E F1(kind)144 264 Q F0 52(:k)C
-(ind of data record inserted)-52 E 31(1s)288 276 S(urv)-31 E .3 -.15
-(ey d)-.15 H(ata).15 E 31(2c)288 288 S(omment)-31 E 17.22(>=3 other)288
-300 R(data that cannot)2.5 E(be passed by)324 312 Q F2(mb_b)2.5 E
-(uffer_insert)-.2 E F1(time_i)144 324 Q F0 44.22(:t)C
-(ime of current ping)-44.22 E F1(time_i)216 336 Q F0([0]: year)A F1
-(time_i)216 348 Q F0([1]: month)A F1(time_i)216 360 Q F0([2]: day)A F1
-(time_i)216 372 Q F0([3]: hour)A F1(time_i)216 384 Q F0([4]: minute)A F1
-(time_i)216 396 Q F0([5]: second)A F1(time_i)216 408 Q F0
-([6]: microsecond)A F1(time_d)144 420 Q F0 42(:t)C
-(ime of current ping in seconds)-42 E(since 1/1/70 00:00:00)216 432 Q F1
-(navlon)144 444 Q F0 42(:l)C(ongitude)-42 E F1(navlat)144 456 Q F0 44.22
-(:l)C(atitude)-44.22 E F1(speed)144 468 Q F0 46.45(:s)C
-(hip speed in km/s)-46.45 E F1(heading)144 480 Q F0 37(:s)C
-(hip heading in de)-37 E(grees)-.15 E F1(nbath)144 492 Q F0 46.44(:n)C
-(umber of bath)-46.44 E(ymetry v)-.05 E(alues)-.25 E F1(namp)144 504 Q
-F0 47(:n)C(umber of amplitude v)-47 E(alues)-.25 E F1(nss)144 516 Q F0
-56.44(:n)C(umber of sidescan v)-56.44 E(alues)-.25 E F1(beam\215a)144
-528 Q(g)-.1 E F0 68.66(:a)C(rray of bath)-68.66 E(ymetry \215ags)-.05 E
-F1(bath)144 540 Q F0 51.44(:a)C(rray of bath)-51.44 E(ymetry v)-.05 E
-(alues in meters)-.25 E F1(amp)144 552 Q F0 52(:a)C(rray of amplitude v)
--52 E(alues in unkno)-.25 E(wn units)-.25 E F1(bathacr)144 564 Q(osstr)
--.45 E(ac)-.15 E(k)-.2 E F0 5.58(:a)C(rray of of acrosstrack distances)
--5.58 E(in meters corresponding to bath)216 576 Q(ymetry)-.05 E F1
-(bathalongtr)144 588 Q(ac)-.15 E(k)-.2 E F0 8.46(:a)C
-(rray of of alongtrack distances)-8.46 E
-(in meters corresponding to bath)216 600 Q(ymetry)-.05 E F1(ss)144 612 Q
-F0 61.44(:a)C(rray of sidescan v)-61.44 E(alues in unkno)-.25 E
-(wn units)-.25 E F1(ssacr)144 624 Q(osstr)-.45 E(ac)-.15 E(k)-.2 E F0
-15.58(:a)C(rray of of acrosstrack distances)-15.58 E
-(in meters corresponding to sidescan)216 636 Q F1(ssacr)144 648 Q(osstr)
--.45 E(ac)-.15 E(k)-.2 E F0 15.58(:a)C(rray of of alongtrack distances)
--15.58 E(in meters corresponding to sidescan)216 660 Q F1(comment)144
-672 Q F0 69.12(:c)C(omment string)-69.12 E(The returned v)108 696 Q
-(alues are:)-.25 E F1(err)144 708 Q(or)-.45 E F0 48.56(:e)C(rror v)
--48.56 E(alue)-.25 E(MB-System 5.0)72 768 Q(26 October 2009)137.055 E
-(44)190.395 E 0 Cg EP
-%%Page: 45 45
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F 2.776(As)108 84 S .276(tatus v)-2.776 F .277
-(alue indicating success or f)-.25 F .277
-(ailure is returned; the error v)-.1 F .277(alue ar)-.25 F(gument)-.18 E
-/F1 10/Times-Italic at 0 SF(err)2.777 E(or)-.45 E F0 .277
-(passes more detailed)2.777 F(information about insert f)108 96 Q
-(ailures.)-.1 E
-(---------------------------------------------------------)108 120 Q
-(int)108 132 Q/F2 10/Times-Bold at 0 SF(mb_b)2.5 E(uffer_get_next_na)-.2 E
-(v)-.25 E F0(\()A(int)180 144 Q F1(verbose)2.5 E F0(,)A(char)180 156 Q
-F1(*b)2.5 E(uf)-.2 E(f_ptr)-.18 E F0(,)A(char)180 168 Q F1(*mbio_ptr)2.5
-E F0(,)A(int)180 180 Q F1(start)2.5 E F0(,)A(int)180 192 Q F1(*id)2.5 E
-F0(,)A(int)180 204 Q F1(time_i[7])2.5 E F0(,)A(double)180 216 Q F1
-(*time_d)2.5 E F0(,)A(double)180 228 Q F1(*navlon)2.5 E F0(,)A(double)
-180 240 Q F1(*navlat)2.5 E F0(,)A(double)180 252 Q F1(*speed)2.5 E F0(,)
-A(double)180 264 Q F1(*heading)2.5 E F0(,)A(double)180 276 Q F1(*dr)2.5
-E(aft)-.15 E F0(,)A(double)180 288 Q F1(*r)2.5 E(oll)-.45 E F0(,)A
-(double)180 300 Q F1(*pitc)2.5 E(h)-.15 E F0(,)A(double)180 312 Q F1
-(*heave)2.5 E F0(,)A(int)180 324 Q F1(*err)2.5 E(or)-.45 E F0(\);)A .345
-(The function)108 348 R F2(mb_b)2.845 E(uffer_get_next_na)-.2 E(v)-.25 E
-F0 .345(searches for the ne)2.845 F .345(xt surv)-.15 F .645 -.15(ey d)
--.15 H .345(ata record in the b).15 F(uf)-.2 E(fer)-.25 E 2.845(,b)-.4 G
--.15(eg)-2.845 G .345(inning at).15 F -.2(bu)108 360 S -.25(ff).2 G .827
-(er inde).25 F(x)-.15 E F1(start)3.327 E F0 3.327(.S)C .827(ince b)
--3.327 F(uf)-.2 E .827(fer inde)-.25 F -.15(xe)-.15 G 3.327(sb).15 G
--.15(eg)-3.327 G .827(in at 0, the \214rst call to).15 F F2(mb_b)3.328 E
-(uffer_get_next_na)-.2 E(v)-.25 E F0 .828(should ha)3.328 F -.15(ve)-.2
-G F1(start)108 372 Q F0 3.056(=0)3.056 G 5.556(.I)-3.056 G 3.056(fas)
--5.556 G(urv)-3.056 E .856 -.15(ey d)-.15 H .556
-(ata record is found at or be).15 F(yond)-.15 E F1(start)3.056 E F0(,)A
-F2(mb_b)3.056 E(uffer_get_next_na)-.2 E(v)-.25 E F0 .555(returns the b)
-3.056 F(uf)-.2 E(fer)-.25 E(inde)108 384 Q 3.227(xo)-.15 G 3.227(ft)
--3.227 G .727(hat record in)-3.227 F F1(id)3.227 E F0 3.227(.N)C -.2(av)
--3.227 G(ig).2 E .728(ation and v)-.05 F .728
-(ertical reference sensor data is also returned. No comments or)-.15 F
-.479(other non-surv)108 396 R .779 -.15(ey d)-.15 H .479
-(ata records are returned.).15 F(The)5.479 E F1(verbose)2.979 E F0 -.25
-(va)2.979 G .478(lue controls the standard error output v).25 F
-(erbosity)-.15 E(of the function.)108 408 Q
-(The input control parameters ha)108 432 Q .3 -.15(ve t)-.2 H(he follo)
-.15 E(wing signi\214cance:)-.25 E F1(start)144 444 Q F0 50.88(:T)C(he b)
--50.88 E(uf)-.2 E(fer inde)-.25 E 2.5(xa)-.15 G 2.5(tw)-2.5 G
-(hich to start)-2.5 E(searching for a surv)216 456 Q .3 -.15(ey d)-.15 H
-(ata record.).15 E(The returned v)108 480 Q(alues are:)-.25 E F1(id)144
-492 Q F0 61.44(:T)C(he b)-61.44 E(uf)-.2 E(fer inde)-.25 E 2.5(xo)-.15 G
-2.5(ft)-2.5 G(he \214rst surv)-2.5 E .3 -.15(ey d)-.15 H
-(ata record at or after).15 E F1(start)2.5 E F0(.)A F1(time_i)144 504 Q
-F0 44.22(:t)C(ime of current ping)-44.22 E F1(time_i)216 516 Q F0
-([0]: year)A F1(time_i)216 528 Q F0([1]: month)A F1(time_i)216 540 Q F0
-([2]: day)A F1(time_i)216 552 Q F0([3]: hour)A F1(time_i)216 564 Q F0
-([4]: minute)A F1(time_i)216 576 Q F0([5]: second)A F1(time_i)216 588 Q
-F0([6]: microsecond)A F1(time_d)144 600 Q F0 42(:t)C
-(ime of current ping in seconds)-42 E(since 1/1/70 00:00:00)216 612 Q F1
-(navlon)144 624 Q F0 42(:l)C(ongitude)-42 E F1(navlat)144 636 Q F0 44.22
-(:l)C(atitude)-44.22 E F1(speed)144 648 Q F0 46.45(:s)C
-(hip speed in km/s)-46.45 E F1(heading)144 660 Q F0 37(:s)C
-(hip heading in de)-37 E(grees)-.15 E F1 -.45(ro)144 672 S(ll).45 E F0
-55.22(:s)C(hip roll in de)-55.22 E(grees)-.15 E F1(pitc)144 684 Q(h)-.15
-E F0 49.37(:s)C(hip pitch in de)-49.37 E(grees)-.15 E F1(heave)144 696 Q
-F0 45.9(:s)C(hip hea)-45.9 E .3 -.15(ve i)-.2 H 2.5(nm).15 G(eters)-2.5
-E 2.776(As)108 720 S .276(tatus v)-2.776 F .277
-(alue indicating success or f)-.25 F .277
-(ailure is returned; the error v)-.1 F .277(alue ar)-.25 F(gument)-.18 E
-F1(err)2.777 E(or)-.45 E F0 .277(passes more detailed)2.777 F
-(MB-System 5.0)72 768 Q(26 October 2009)137.055 E(45)190.395 E 0 Cg EP
-%%Page: 46 46
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F .312(information about f)108 84 R .312
-(ailures. The most common error occurs when no more surv)-.1 F .612 -.15
-(ey d)-.15 H .312(ata records remain to be).15 F(found in the b)108 96 Q
-(uf)-.2 E(fer; in this case,)-.25 E/F1 10/Times-Italic at 0 SF(err)2.5 E
-(or)-.45 E F0 2.5(=-)2.5 G(14.)-2.5 E
-(---------------------------------------------------------)108 120 Q
-(int)108 132 Q/F2 10/Times-Bold at 0 SF(mb_b)2.5 E(uffer_extract_na)-.2 E
-(v)-.25 E F0(\()A(int)180 144 Q F1(verbose)2.5 E F0(,)A(char)180 156 Q
-F1(*b)2.5 E(uf)-.2 E(f_ptr)-.18 E F0(,)A(char)180 168 Q F1(*mbio_ptr)2.5
-E F0(,)A(int)180 180 Q F1(id)2.5 E F0(,)A(int)180 192 Q F1(*kind)2.5 E
-F0(,)A(int)180 204 Q F1(time_i[7])2.5 E F0(,)A(double)180 216 Q F1
-(*time_d)2.5 E F0(,)A(double)180 228 Q F1(*navlon)2.5 E F0(,)A(double)
-180 240 Q F1(*navlat)2.5 E F0(,)A(double)180 252 Q F1(*speed)2.5 E F0(,)
-A(double)180 264 Q F1(*heading)2.5 E F0(,)A(double)180 276 Q F1(*dr)2.5
-E(aft)-.15 E F0(,)A(double)180 288 Q F1(*r)2.5 E(oll)-.45 E F0(,)A
-(double)180 300 Q F1(*pitc)2.5 E(h)-.15 E F0(,)A(double)180 312 Q F1
-(*heave)2.5 E F0(,)A(int)180 324 Q F1(*err)2.5 E(or)-.45 E F0(\);)A .28
-(The function)108 348 R F2(mb_b)2.78 E(uffer_extract_na)-.2 E(v)-.25 E
-F0 -.15(ex)2.78 G .28(tracts and returns a subset of the data in a b).15
-F(uf)-.2 E .28(fer record.)-.25 F(The)5.28 E F1(ver)2.78 E(-)-.2 E(bose)
-108 360 Q F0 -.25(va)2.996 G .496
-(lue controls the standard error output v).25 F .496
-(erbosity of the function.)-.15 F .495(The b)5.495 F(uf)-.2 E .495
-(fer record is speci\214ed with)-.25 F(the b)108 372 Q(uf)-.2 E
-(fer inde)-.25 E(x)-.15 E F1(id)2.5 E F0 2.5(.T)C
-(he data returned consists of na)-2.5 E(vig)-.2 E(ation and v)-.05 E
-(ertical reference sensor data.)-.15 E(The input control parameters ha)
-108 396 Q .3 -.15(ve t)-.2 H(he follo).15 E(wing signi\214cance:)-.25 E
-F1(id)144 408 Q F0 61.44(:T)C(he b)-61.44 E(uf)-.2 E(fer inde)-.25 E 2.5
-(xo)-.15 G 2.5(ft)-2.5 G(he data)-2.5 E(record to e)216 420 Q(xtract.)
--.15 E(The returned v)108 444 Q(alues are:)-.25 E F1(kind)144 456 Q F0
-52(:k)C(ind of data record e)-52 E(xtracted)-.15 E 31(1s)288 468 S(urv)
--31 E .3 -.15(ey d)-.15 H(ata).15 E 31(2c)288 480 S(omment)-31 E 17.22
-(>=3 other)288 492 R(data that cannot)2.5 E(be passed by)324 504 Q F2
-(mb_b)2.5 E(uffer_extract_na)-.2 E(v)-.25 E F1(time_i)144 516 Q F0 44.22
-(:t)C(ime of current ping)-44.22 E F1(time_i)216 528 Q F0([0]: year)A F1
-(time_i)216 540 Q F0([1]: month)A F1(time_i)216 552 Q F0([2]: day)A F1
-(time_i)216 564 Q F0([3]: hour)A F1(time_i)216 576 Q F0([4]: minute)A F1
-(time_i)216 588 Q F0([5]: second)A F1(time_i)216 600 Q F0
-([6]: microsecond)A F1(time_d)144 612 Q F0 42(:t)C
-(ime of current ping in seconds)-42 E(since 1/1/70 00:00:00)216 624 Q F1
-(navlon)144 636 Q F0 42(:l)C(ongitude)-42 E F1(navlat)144 648 Q F0 44.22
-(:l)C(atitude)-44.22 E F1(speed)144 660 Q F0 46.45(:s)C
-(hip speed in km/s)-46.45 E F1(heading)144 672 Q F0 37(:s)C
-(hip heading in de)-37 E(grees)-.15 E F1 -.45(ro)144 684 S(ll).45 E F0
-55.22(:s)C(hip roll in de)-55.22 E(grees)-.15 E F1(pitc)144 696 Q(h)-.15
-E F0 49.37(:s)C(hip pitch in de)-49.37 E(grees)-.15 E F1(heave)144 708 Q
-F0 45.9(:s)C(hip hea)-45.9 E .3 -.15(ve i)-.2 H 2.5(nm).15 G(eters)-2.5
-E(MB-System 5.0)72 768 Q(26 October 2009)137.055 E(46)190.395 E 0 Cg EP
-%%Page: 47 47
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F 2.776(As)108 84 S .276(tatus v)-2.776 F .277
-(alue indicating success or f)-.25 F .277
-(ailure is returned; the error v)-.1 F .277(alue ar)-.25 F(gument)-.18 E
-/F1 10/Times-Italic at 0 SF(err)2.777 E(or)-.45 E F0 .277
-(passes more detailed)2.777 F(information about e)108 96 Q(xtract f)-.15
-E(ailures.)-.1 E
-(---------------------------------------------------------)108 120 Q
-(int)108 132 Q/F2 10/Times-Bold at 0 SF(mb_b)2.5 E(uffer_insert_na)-.2 E(v)
--.25 E F0(\()A(int)180 144 Q F1(verbose)2.5 E F0(,)A(char)180 156 Q F1
-(*b)2.5 E(uf)-.2 E(f_ptr)-.18 E F0(,)A(char)180 168 Q F1(*mbio_ptr)2.5 E
-F0(,)A(int)180 180 Q F1(id)2.5 E F0(,)A(int)180 192 Q F1(time_i[7])2.5 E
-F0(,)A(double)180 204 Q F1(time_d)2.5 E F0(,)A(double)180 216 Q F1
-(navlon)2.5 E F0(,)A(double)180 228 Q F1(navlat)2.5 E F0(,)A(double)180
-240 Q F1(speed)2.5 E F0(,)A(double)180 252 Q F1(heading)2.5 E F0(,)A
-(double)180 264 Q F1(dr)2.5 E(aft)-.15 E F0(,)A(double)180 276 Q F1 -.45
-(ro)2.5 G(ll).45 E F0(,)A(double)180 288 Q F1(pitc)2.5 E(h)-.15 E F0(,)A
-(double)180 300 Q F1(heave)2.5 E F0(,)A(int)180 312 Q F1(*err)2.5 E(or)
--.45 E F0(\);)A 1.857(The function)108 336 R F2(mb_b)4.357 E
-(uffer_insert_na)-.2 E(v)-.25 E F0 1.857(inserts na)4.357 F(vig)-.2 E
-1.857(ation and v)-.05 F 1.856(ertical reference sensor data into a b)
--.15 F(uf)-.2 E(fer)-.25 E .514
-(record, replacing a subset of the original v)108 348 R 3.014
-(alues. The)-.25 F F1(verbose)3.014 E F0 -.25(va)3.014 G .515
-(lue controls the standard error output v).25 F(er)-.15 E(-)-.2 E
-(bosity of the function.)108 360 Q(The b)5 E(uf)-.2 E
-(fer record is speci\214ed with the b)-.25 E(uf)-.2 E(fer inde)-.25 E(x)
--.15 E F1(id)2.5 E F0(.)A(The input control parameters ha)108 384 Q .3
--.15(ve t)-.2 H(he follo).15 E(wing signi\214cance:)-.25 E F1(id)144 396
-Q F0 61.44(:T)C(he b)-61.44 E(uf)-.2 E(fer inde)-.25 E 2.5(xo)-.15 G 2.5
-(ft)-2.5 G(he data)-2.5 E(record to insert.)216 408 Q(The returned v)108
-432 Q(alues are:)-.25 E F1(kind)144 444 Q F0 52(:k)C
-(ind of data record inserted)-52 E 31(1s)288 456 S(urv)-31 E .3 -.15
-(ey d)-.15 H(ata).15 E 31(2c)288 468 S(omment)-31 E 17.22(>=3 other)288
-480 R(data that cannot)2.5 E(be passed by)324 492 Q F2(mb_b)2.5 E
-(uffer_insert_na)-.2 E(v)-.25 E F1(time_i)144 504 Q F0 44.22(:t)C
-(ime of current ping)-44.22 E F1(time_i)216 516 Q F0([0]: year)A F1
-(time_i)216 528 Q F0([1]: month)A F1(time_i)216 540 Q F0([2]: day)A F1
-(time_i)216 552 Q F0([3]: hour)A F1(time_i)216 564 Q F0([4]: minute)A F1
-(time_i)216 576 Q F0([5]: second)A F1(time_i)216 588 Q F0
-([6]: microsecond)A F1(time_d)144 600 Q F0 42(:t)C
-(ime of current ping in seconds)-42 E(since 1/1/70 00:00:00)216 612 Q F1
-(navlon)144 624 Q F0 42(:l)C(ongitude)-42 E F1(navlat)144 636 Q F0 44.22
-(:l)C(atitude)-44.22 E F1(speed)144 648 Q F0 46.45(:s)C
-(hip speed in km/s)-46.45 E F1(heading)144 660 Q F0 37(:s)C
-(hip heading in de)-37 E(grees)-.15 E F1 -.45(ro)144 672 S(ll).45 E F0
-55.22(:s)C(hip roll in de)-55.22 E(grees)-.15 E F1(pitc)144 684 Q(h)-.15
-E F0 49.37(:s)C(hip pitch in de)-49.37 E(grees)-.15 E F1(heave)144 696 Q
-F0 45.9(:s)C(hip hea)-45.9 E .3 -.15(ve i)-.2 H 2.5(nm).15 G(eters)-2.5
-E 2.777(As)108 720 S .277(tatus v)-2.777 F .277
-(alue indicating success or f)-.25 F .277
-(ailure is returned; the error v)-.1 F .277(alue ar)-.25 F(gument)-.18 E
-F1(err)2.777 E(or)-.45 E F0 .276(passes more detailed)2.777 F
-(MB-System 5.0)72 768 Q(26 October 2009)137.055 E(47)190.395 E 0 Cg EP
-%%Page: 48 48
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F(information about insert f)108 84 Q(ailures.)-.1 E
-(---------------------------------------------------------)108 108 Q
-(int)108 120 Q/F1 10/Times-Bold at 0 SF(mb_b)2.5 E(uffer_get_ptr)-.2 E F0
-(\()A(int)180 132 Q/F2 10/Times-Italic at 0 SF(verbose)2.5 E F0(,)A(char)
-180 144 Q F2(*b)2.5 E(uf)-.2 E(f_ptr)-.18 E F0(,)A(char)180 156 Q F2
-(*mbio_ptr)2.5 E F0(,)A(int)180 168 Q F2(id)2.5 E F0(,)A(char)180 180 Q
-F2(**stor)2.5 E(e_ptr)-.37 E F0(,)A(int)180 192 Q F2(*err)2.5 E(or)-.45
-E F0(\);)A 1.239(The function)108 216 R F1(mb_b)3.739 E(uffer_get_ptr)
--.2 E F0 1.239(returns a pointer to the data structure in a b)3.739 F
-(uf)-.2 E 1.24(fer record.)-.25 F(The)6.24 E F2(verbose)3.74 E F0 -.25
-(va)108 228 S .878(lue controls the standard error output v).25 F .878
-(erbosity of the function.)-.15 F .877(The b)5.877 F(uf)-.2 E .877
-(fer record is speci\214ed with the)-.25 F -.2(bu)108 240 S -.25(ff).2 G
-.93(er inde).25 F(x)-.15 E F2(id)3.43 E F0 3.43(.T)C .931(he data retur\
-ned consists of a pointer to the data structure stored in the speci\214\
-ed b)-3.43 F(uf)-.2 E(fer)-.25 E(record.)108 252 Q
-(The input control parameters ha)108 276 Q .3 -.15(ve t)-.2 H(he follo)
-.15 E(wing signi\214cance:)-.25 E F2(id)144 288 Q F0 61.44(:T)C(he b)
--61.44 E(uf)-.2 E(fer inde)-.25 E 2.5(xo)-.15 G 2.5(ft)-2.5 G(he data)
--2.5 E(record to locate.)252 300 Q(The return v)108 324 Q(alues are:)
--.25 E F2(*stor)144 336 Q(e_ptr)-.37 E F0 27.92(:p)C
-(ointer to data in speci\214ed)-27.92 E -.2(bu)252 348 S -.25(ff).2 G
-(er record).25 E F2(err)144 360 Q(or)-.45 E F0 48.56(:e)C(rror v)-48.56
-E(alue)-.25 E 2.777(As)108 384 S .277(tatus v)-2.777 F .277
-(alue indicating success or f)-.25 F .277
-(ailure is returned; the error v)-.1 F .277(alue ar)-.25 F(gument)-.18 E
-F2(err)2.777 E(or)-.45 E F0 .276(passes more detailed)2.777 F
-(information about b)108 396 Q(uf)-.2 E(fer f)-.25 E(ailures.)-.1 E/F3
-10.95/Times-Bold at 0 SF(MISCELLANEOUS FUNCTIONS)72 424.8 Q F0(int)108
-436.8 Q F1(mb_defaults)2.5 E F0(\()A(int)180 448.8 Q F2(verbose)2.5 E F0
-(,)A(int)180 460.8 Q F2(*format)2.5 E F0(,)A(int)180 472.8 Q F2(*pings)
-2.5 E F0(,)A(int)180 484.8 Q F2(*lon\215ip)2.5 E F0(,)A(double)180 496.8
-Q F2(bounds[4])2.5 E F0(,)A(int)180 508.8 Q F2(*btime_i)2.5 E F0(,)A
-(int)180 520.8 Q F2(*etime_i)2.5 E F0(,)A(double)180 532.8 Q F2
-(*speedmin)2.5 E F0(,)A(double)180 544.8 Q F2(*time)2.5 E(gap)-.4 E F0
-(\);)A .412(The function)108 568.8 R F1(mb_defaults)2.912 E F0(pro)2.912
-E .412(vides def)-.15 F .412(ault v)-.1 F .412
-(alues of control parameters used by some of the)-.25 F F1(MBIO)2.912 E
-F0(func-)2.912 E .351(tions. The)108 580.8 R F2(verbose)2.851 E F0 -.25
-(va)2.851 G .351(lue controls the standard error output v).25 F .35
-(erbosity of the function.)-.15 F .35(The other parameters)5.35 F 2.163
-(are set by the function; the meaning of these parameters is discussed \
-in the listings of the functions)108 592.8 R F1(mb_r)108 604.8 Q
-(ead_init)-.18 E F0(and)2.96 E F1(mb_write_init)2.96 E F0 5.46(.I)C 2.96
-(fa)-5.46 G 2.96(n.)-2.96 G(mbio_def)-2.96 E .46(aults \214le e)-.1 F
-.46(xists in the user')-.15 F 2.96(sh)-.55 G .46(ome directory)-2.96 F
-2.96(,t)-.65 G .46(he lon\215ip)-2.96 F(and time)108 616.8 Q -.05(ga)
--.15 G 2.5(pd).05 G(ef)-2.5 E(aults are read from this \214le.)-.1 E
-(Otherwise, the v)5 E(alues are set as:)-.25 E F2(*lon\215ip)144 628.8 Q
-F0 2.5(=0)2.5 G F2(*time)144 640.8 Q(gap)-.4 E F0 2.5(=1)2.5 G
-(The other v)108 652.8 Q(alues are simply set as:)-.25 E F2(*format)144
-664.8 Q F0 2.5(=0)2.5 G F2(*pings)144 676.8 Q F0 2.5(=1)2.5 G F2
-(bounds[0])144 688.8 Q F0 2.5(=-)2.5 G(360.)-2.5 E F2(bounds[1])144
-700.8 Q F0 2.5(=3)2.5 G(60.)-2.5 E F2(bounds[2])144 712.8 Q F0 2.5(=-)
-2.5 G(90.)-2.5 E F2(bounds[3])144 724.8 Q F0 2.5(=9)2.5 G(0.)-2.5 E
-(MB-System 5.0)72 768 Q(26 October 2009)137.055 E(48)190.395 E 0 Cg EP
-%%Page: 49 49
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F/F1 10/Times-Italic at 0 SF(btime_i[0])144 84 Q F0 2.5
-(=1)2.5 G(962;)-2.5 E F1(btime_i[1])144 96 Q F0 2.5(=2)2.5 G(;)-2.5 E F1
-(btime_i[2])144 108 Q F0 2.5(=2)2.5 G(1;)-2.5 E F1(btime_i[3])144 120 Q
-F0 2.5(=1)2.5 G(0;)-2.5 E F1(btime_i[4])144 132 Q F0 2.5(=3)2.5 G(0;)
--2.5 E F1(btime_i[5])144 144 Q F0 2.5(=0)2.5 G(;)-2.5 E F1(btime_i[6])
-144 156 Q F0 2.5(=0)2.5 G(;)-2.5 E F1(etime_i[0])144 168 Q F0 2.5(=2)2.5
-G(062;)-2.5 E F1(etime_i[1])144 180 Q F0 2.5(=2)2.5 G(;)-2.5 E F1
-(etime_i[2])144 192 Q F0 2.5(=2)2.5 G(1;)-2.5 E F1(etime_i[3])144 204 Q
-F0 2.5(=1)2.5 G(0;)-2.5 E F1(etime_i[4])144 216 Q F0 2.5(=3)2.5 G(0;)
--2.5 E F1(etime_i[5])144 228 Q F0 2.5(=0)2.5 G(;)-2.5 E F1(etime_i[6])
-144 240 Q F0 2.5(=0)2.5 G(;)-2.5 E F1(*speedmin)144 252 Q F0 2.5(=0)2.5
-G(.0)-2.5 E 2.5(As)108 276 S(tatus v)-2.5 E
-(alue is returned to indicate success or f)-.25 E(ailure.)-.1 E
-(---------------------------------------------------------)108 300 Q
-(int)108 312 Q/F2 10/Times-Bold at 0 SF(mb_en)2.5 E(v)-.4 E F0(\()A(int)180
-324 Q F1(verbose)2.5 E F0(,)A(char)180 336 Q F1(*psdisplay)2.5 E F0(,)A
-(char)180 348 Q F1(*imgdisplay)2.5 E F0(,)A(char)180 360 Q F1(*mbpr)2.5
-E(oject)-.45 E F0(\);)A .815(The function)108 384 R F2(mb_en)3.315 E(v)
--.4 E F0(pro)3.315 E .815(vides def)-.15 F .816(ault v)-.1 F .816
-(alues of Postscript and image display programs in)-.25 F -.2(vo)-.4 G
--.1(ke).2 G 3.316(db).1 G 3.316(ys)-3.316 G(ome)-3.316 E F2(MB-System)
-108 396 Q F0 1.228(programs and macros, and a def)3.728 F 1.228(ault v)
--.1 F 1.228(alue for a w)-.25 F 1.227
-(orking project name that will be used by)-.1 F 1.091
-(future applications. The)108 408 R F1(verbose)3.591 E F0 -.25(va)3.591
-G 1.091(lue controls the standard error output v).25 F 1.092
-(erbosity of the function.)-.15 F 1.092(If an)6.092 F(.mbio_def)108 420
-Q .247(aults \214le e)-.1 F .247(xists in the user')-.15 F 2.747(sh)-.55
-G .247(ome directory)-2.747 F 2.747(,t)-.65 G(he)-2.747 E F1(*psdisplay)
-2.747 E F0(,)A F1(*imgdisplay)2.747 E F0(,)A F1(*mbpr)2.747 E(oject)-.45
-E F0(def)2.747 E .246(aults are)-.1 F(read from this \214le.)108 432 Q
-(Otherwise, the v)5 E(alues are set as:)-.25 E F1(psdisplay)144 444 Q F0
-5(=")2.5 G(xpsvie)-5 E(w" \(IRIX OS\))-.25 E("page)191.5 456 Q(vie)-.25
-E(w" \(Solaris OS\))-.25 E("gv" \(other OS\))191.5 468 Q("ghostvie)191.5
-480 Q(w" \(other OS\))-.25 E F1(imgdisplay)144 492 Q F0 2.5(=")2.5 G
-(gimp" \(Linux OS\))-2.5 E("xv" \(other than Linux OS\))191.5 504 Q F1
-(mbpr)144 516 Q(oject)-.45 E F0 5(=")2.5 G(none")-5 E
-(---------------------------------------------------------)108 540 Q
-(int)108 552 Q F2(mb_f)2.5 E(ormat)-.25 E F0(\()A(int)180 564 Q F1
-(verbose)2.5 E F0(,)A(int)180 576 Q F1(*format)2.5 E F0(,)A(int)180 588
-Q F1(*err)2.5 E(or)-.45 E F0(\);)A(Gi)108 612 Q -.15(ve)-.25 G 2.511(nt)
-.15 G .011(he format identi\214er)-2.511 F F1(format)2.511 E F0(,)A F2
-(mb_f)2.511 E(ormat)-.25 E F0 .011(checks if the format is v)2.511 F
-2.511(alid. If)-.25 F .012(the format id corresponds to)2.511 F 3.104
-(av)108 624 S .604(alue used in pre)-3.354 F .604(vious \(<4.00\) v)-.25
-F .604(ersions of)-.15 F F2(MB-System)3.104 E F0 3.104(,t)C .604
-(hen the format v)-3.104 F .604(alue will be aliased to the cur)-.25 F
-(-)-.2 E(rent corresponding v)108 636 Q(alue.)-.25 E(The return v)108
-660 Q(alues are:)-.25 E F1(format)144 672 Q F0(:)A F2(MBIO)42.55 E F0
-(format id)2.5 E F1(err)144 684 Q(or)-.45 E F0 48.56(:e)C(rror v)-48.56
-E(alue)-.25 E 2.776(As)108 708 S .276(tatus v)-2.776 F .277
-(alue indicating success or f)-.25 F .277
-(ailure is returned; the error v)-.1 F .277(alue ar)-.25 F(gument)-.18 E
-F1(err)2.777 E(or)-.45 E F0 .277(passes more detailed)2.777 F
-(information about f)108 720 Q(ailures.)-.1 E(MB-System 5.0)72 768 Q
-(26 October 2009)137.055 E(49)190.395 E 0 Cg EP
-%%Page: 50 50
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F
-(---------------------------------------------------------)108 84 Q(int)
-108 96 Q/F1 10/Times-Bold at 0 SF(mb_f)2.5 E(ormat_r)-.25 E(egister)-.18 E
-F0(\()A(int)180 108 Q/F2 10/Times-Italic at 0 SF(verbose)2.5 E F0(,)A(int)
-180 120 Q F2(*format)2.5 E F0(,)A(char)180 132 Q F2(*mbio_ptr)2.5 E F0
-(,)A(int)180 144 Q F2(*err)2.5 E(or)-.45 E F0(\);)A .069(The function)
-108 168 R F1(mb_f)2.569 E(ormat_r)-.25 E(egister)-.18 E F0 .069
-(is called by)2.569 F F1(mb_r)2.569 E(ead_init)-.18 E F0(and)2.568 E F1
-(mb_write_init)2.568 E F0 .068(and serv)2.568 F .068(es to load format)
--.15 F .218(speci\214c parameters and function parameters into the)108
-180 R F1(MBIO)2.719 E F0 .219(control structure pointed to by)2.719 F F2
-(*err)2.719 E(or)-.45 E F0 2.719(.T)C .219(he for)-2.719 F(-)-.2 E .192
-(mat id)108 192 R F2(*format)2.692 E F0 .191(is \214rst check)2.691 F
-.191(ed for v)-.1 F(alidity)-.25 E 2.691(.I)-.65 G 2.691(ns)-2.691 G
-.191(ome cases, formerly v)-2.691 F .191(alid b)-.25 F .191(ut no)-.2 F
-2.691(wo)-.25 G .191(bsolete format id v)-2.691 F(alues)-.25 E
-(are mapped to current v)108 204 Q(alues.)-.25 E(The input v)108 228 Q
-(alues are:)-.25 E F2(*format)144 240 Q F0(:)A F1(MBIO)37.55 E F0
-(format id)2.5 E F2(*mbio_ptr)144 252 Q F0 27.55(:p)C
-(ointer to data in speci\214ed)-27.55 E -.2(bu)252 264 S -.25(ff).2 G
-(er record).25 E(The return v)108 288 Q(alues are:)-.25 E F2(err)144 300
-Q(or)-.45 E F0 48.56(:e)C(rror v)-48.56 E(alue)-.25 E 2.776(As)108 324 S
-.276(tatus v)-2.776 F .277(alue indicating success or f)-.25 F .277
-(ailure is returned; the error v)-.1 F .277(alue ar)-.25 F(gument)-.18 E
-F2(err)2.777 E(or)-.45 E F0 .277(passes more detailed)2.777 F
-(information about f)108 336 Q(ailures.)-.1 E
-(---------------------------------------------------------)108 360 Q
-(int)108 372 Q F1(mb_f)2.5 E(ormat_inf)-.25 E(o)-.25 E F0(\()A(int)180
-384 Q F2(verbose)2.5 E F0(,)A(int)180 396 Q F2(*format)2.5 E F0(,)A(int)
-180 408 Q F2(*system)2.5 E F0(,)A(int)180 420 Q F2(*beams_bath_max)2.5 E
-F0(,)A(int)180 432 Q F2(*beams_amp_max)2.5 E F0(,)A(int)180 444 Q F2
-(*pixels_ss_max)2.5 E F0(,)A(char)180 456 Q F2(*format_name)2.5 E F0(,)A
-(char)180 468 Q F2(*system_name)2.5 E F0(,)A(char)180 480 Q F2
-(*format_description)2.5 E F0(,)A(int)180 492 Q F2(*num\214le)2.5 E F0
-(,)A(int)180 504 Q F2(*\214letype)2.5 E F0(,)A(int)180 516 Q F2
-(*variable_beams)2.5 E F0(,)A(int)180 528 Q F2(*tr)2.5 E(aveltime)-.15 E
-F0(,)A(int)180 540 Q F2(*beam_\215a)2.5 E -.1(gg)-.1 G(ing).1 E F0(,)A
-(int)180 552 Q F2(*nav_sour)2.5 E(ce)-.37 E F0(,)A(int)180 564 Q F2
-(*heading_sour)2.5 E(ce)-.37 E F0(,)A(int)180 576 Q F2(*vru_sour)2.5 E
-(ce)-.37 E F0(,)A(double)180 588 Q F2(*beamwidth_xtr)2.5 E(ac)-.15 E(k)
--.2 E F0(,)A(double)180 600 Q F2(*beamwidth_ltr)2.5 E(ac)-.15 E(k)-.2 E
-F0(,)A(int)180 612 Q F2(*err)2.5 E(or)-.45 E F0(\);)A .62(The function)
-108 636 R F1(mb_f)3.12 E(ormat_inf)-.25 E(o)-.25 E F0 .62(returns a v)
-3.12 F .619(ariety of data format speci\214c parameters. The format id)
--.25 F F2(*format)3.119 E F0 .346(is \214rst check)108 648 R .346
-(ed for v)-.1 F(alidity)-.25 E 2.846(.I)-.65 G 2.846(ns)-2.846 G .347
-(ome cases, formerly v)-2.846 F .347(alid b)-.25 F .347(ut no)-.2 F
-2.847(wo)-.25 G .347(bsolete format id v)-2.847 F .347
-(alues are mapped to)-.25 F(current v)108 660 Q(alues.)-.25 E
-(The input v)108 684 Q(alues are:)-.25 E F2(*format)144 696 Q F0(:)A F1
-(MBIO)37.55 E F0(format id)2.5 E(The return v)108 720 Q(alues are:)-.25
-E(MB-System 5.0)72 768 Q(26 October 2009)137.055 E(50)190.395 E 0 Cg EP
-%%Page: 51 51
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F/F1 10/Times-Italic at 0 SF(*format)144 84 Q F0(:)A/F2
-10/Times-Bold at 0 SF(MBIO)37.55 E F0(format id)2.5 E F1(*system)144 96 Q
-F0(:)A F2(MBIO)37.56 E F0(sonar system id)2.5 E F1(*beams_bath_max)144
-108 Q F0 30.23(:m)C(aximum number of bath)-30.23 E(ymetry beams)-.05 E
-F1(*beams_amp_max)144 120 Q F0 30.79(:m)C
-(aximum number of amplitude beams)-30.79 E F1(*pixels_ss_max)144 132 Q
-F0 6.45(:m)C(aximum number of sidescan pix)-6.45 E(els)-.15 E F1
-(*format_name)144 144 Q F0(:)A F2(MBIO)10.89 E F0(format name)2.5 E F1
-(*system_name)144 156 Q F0(:)A F2(MBIO)10.9 E F0(sonar system name)2.5 E
-F1(*format_description)144 168 Q F0(:)A F2(MBIO)23.55 E F0
-(format description)2.5 E F1(*num\214le)144 180 Q F0 70.78(:n)C
-(umber of parallel data \214les used in format)-70.78 E F1(*\214letype)
-144 192 Q F0 35.34(:t)C(ype of data \214les)-35.34 E F1(*variable_beams)
-144 204 Q F0 .34(:n)C(umber of beams can v)-.34 E(ary [boolean])-.25 E
-F1(*tr)144 216 Q(aveltime)-.15 E F0 23.82(:t)C(ra)-23.82 E -.15(ve)-.2 G
-2.5(lt).15 G(ime data a)-2.5 E -.25(va)-.2 G(ilable [boolean]).25 E F1
-(*beam_\215a)144 228 Q -.1(gg)-.1 G(ing).1 E F0 4.98(:b)C
-(eam \215agging supported [boolean])-4.98 E F1(*nav_sour)144 240 Q(ce)
--.37 E F0 18.49(:k)C(ind of data records containing na)-18.49 E(vig)-.2
-E(ation)-.05 E F1(*heading_sour)144 252 Q(ce)-.37 E F0 .71(:k)C
-(ind of data records containing)-.71 E(heading)252 264 Q F1(*vru_sour)
-144 276 Q(ce)-.37 E F0 19.6(:k)C(ind of data records containing)-19.6 E
-(attitude)252 288 Q F1(*beamwidth_xtr)144 300 Q(ac)-.15 E(k)-.2 E F0
-26.69(:t)C(ypical athw)-26.69 E(artships beam)-.1 E(width [de)288 312 Q
-(grees])-.15 E F1(*beamwidth_ltr)144 324 Q(ac)-.15 E(k)-.2 E F0 28.35
-(:t)C(ypical alongtrack beam)-28.35 E(width [de)288 336 Q(grees])-.15 E
-F1(err)144 348 Q(or)-.45 E F0 48.56(:e)C(rror v)-48.56 E(alue)-.25 E
-2.777(As)108 372 S .277(tatus v)-2.777 F .277
-(alue indicating success or f)-.25 F .277
-(ailure is returned; the error v)-.1 F .277(alue ar)-.25 F(gument)-.18 E
-F1(err)2.777 E(or)-.45 E F0 .276(passes more detailed)2.777 F
-(information about f)108 384 Q(ailures.)-.1 E
-(---------------------------------------------------------)108 408 Q
-(int)108 420 Q F2(mb_f)2.5 E(ormat_system)-.25 E F0(\()A(int)180 432 Q
-F1(verbose)2.5 E F0(,)A(int)180 444 Q F1(*format)2.5 E F0(,)A(int)180
-456 Q F1(*system)2.5 E F0(,)A(int)180 468 Q F1(*err)2.5 E(or)-.45 E F0
-(\);)A 2.485(The function)108 492 R F2(mb_f)4.985 E(ormat_system)-.25 E
-F0 2.485(returns the)4.985 F F2(MBIO)4.985 E F0 2.485
-(sonar system id. The format id)4.985 F F1(*format)4.985 E F0 2.485
-(is \214rst)4.985 F(check)108 504 Q .807(ed for v)-.1 F(alidity)-.25 E
-3.307(.I)-.65 G 3.307(ns)-3.307 G .807(ome cases, formerly v)-3.307 F
-.807(alid b)-.25 F .807(ut no)-.2 F 3.307(wo)-.25 G .807
-(attintbsolete format id v)-3.307 F .806(alues are mapped to)-.25 F
-(current v)108 516 Q(alues. The input v)-.25 E(alues are:)-.25 E F1
-(*format)144 528 Q F0(:)A F2(MBIO)37.55 E F0(format id)2.5 E
-(The return v)108 540 Q(alues are:)-.25 E F1(*format)144 552 Q F0(:)A F2
-(MBIO)37.55 E F0(format id)2.5 E F1(*system)144 564 Q F0(:)A F2(MBIO)
-37.56 E F0(sonar system id)2.5 E F1(err)144 576 Q(or)-.45 E F0 48.56(:e)
-C(rror v)-48.56 E(alue)-.25 E 2.776(As)108 588 S .276(tatus v)-2.776 F
-.277(alue indicating success or f)-.25 F .277
-(ailure is returned; the error v)-.1 F .277(alue ar)-.25 F(gument)-.18 E
-F1(err)2.777 E(or)-.45 E F0 .277(passes more detailed)2.777 F
-(information about f)108 600 Q(ailures.)-.1 E
-(---------------------------------------------------------)108 624 Q
-(int)108 636 Q F2(mb_f)2.5 E(ormat_description)-.25 E F0(\()A(int)180
-648 Q F1(verbose)2.5 E F0(,)A(int)180 660 Q F1(*format)2.5 E F0(,)A
-(char)180 672 Q F1(*description)2.5 E F0(,)A(int)180 684 Q F1(*err)2.5 E
-(or)-.45 E F0(\);)A .818(The function)108 708 R F2(mb_f)3.318 E
-(ormat_description)-.25 E F0 .818
-(returns a short description of the format in the string)3.318 F F1
-(*description)3.317 E F0(.)A .085(The format id)108 720 R F1(*format)
-2.585 E F0 .085(is \214rst check)2.585 F .085(ed for v)-.1 F(alidity)
--.25 E 2.585(.I)-.65 G 2.585(ns)-2.585 G .085(ome cases, formerly v)
--2.585 F .085(alid b)-.25 F .085(ut no)-.2 F 2.585(wo)-.25 G .085
-(bsolete format id)-2.585 F(MB-System 5.0)72 768 Q(26 October 2009)
-137.055 E(51)190.395 E 0 Cg EP
-%%Page: 52 52
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F -.25(va)108 84 S(lues are mapped to current v).25 E
-(alues. The input v)-.25 E(alues are:)-.25 E/F1 10/Times-Italic at 0 SF
-(*format)144 96 Q F0(:)A/F2 10/Times-Bold at 0 SF(MBIO)37.55 E F0
-(format id)2.5 E(The return v)108 108 Q(alues are:)-.25 E F1(*format)144
-120 Q F0(:)A F2(MBIO)37.55 E F0(format id)2.5 E F1(*format_description)
-144 132 Q F0(:)A F2(MBIO)23.55 E F0(format description)2.5 E F1(err)144
-144 Q(or)-.45 E F0 48.56(:e)C(rror v)-48.56 E(alue)-.25 E 2.777(As)108
-156 S .277(tatus v)-2.777 F .277(alue indicating success or f)-.25 F
-.277(ailure is returned; the error v)-.1 F .277(alue ar)-.25 F(gument)
--.18 E F1(err)2.777 E(or)-.45 E F0 .276(passes more detailed)2.777 F
-(information about f)108 168 Q(ailures.)-.1 E
-(---------------------------------------------------------)108 192 Q
-(int)108 204 Q F2(mb_f)2.5 E(ormat_dimensions)-.25 E F0(\()A(int)180 216
-Q F1(verbose)2.5 E F0(,)A(int)180 228 Q F1(*format)2.5 E F0(,)A(int)180
-240 Q F1(*beams_bath_max)2.5 E F0(,)A(int)180 252 Q F1(*beams_amp_max)
-2.5 E F0(,)A(int)180 264 Q F1(*pixels_ss_max)2.5 E F0(,)A(int)180 276 Q
-F1(*err)2.5 E(or)-.45 E F0(\);)A .527(The function)108 300 R F2(mb_f)
-3.027 E(ormat_dimensions)-.25 E F0 .528
-(returns the maximum numbers of beams and pix)3.027 F .528
-(els associated with)-.15 F 3.252(ap)108 312 S .751
-(articular data format. The format id)-3.252 F F1(*format)3.251 E F0
-.751(is \214rst check)3.251 F .751(ed for v)-.1 F(alidity)-.25 E 3.251
-(.I)-.65 G 3.251(ns)-3.251 G .751(ome cases, formerly v)-3.251 F(alid)
--.25 E -.2(bu)108 324 S 2.5(tn).2 G .5 -.25(ow o)-2.5 H
-(bsolete format id v).25 E(alues are mapped to current v)-.25 E
-(alues. The input v)-.25 E(alues are:)-.25 E F1(*format)144 336 Q F0(:)A
-F2(MBIO)37.55 E F0(format id)2.5 E(The return v)108 348 Q(alues are:)
--.25 E F1(*format)144 360 Q F0(:)A F2(MBIO)37.55 E F0(format id)2.5 E F1
-(*beams_bath_max)144 372 Q F0 30.23(:m)C(aximum number of bath)-30.23 E
-(ymetry beams)-.05 E F1(*beams_amp_max)144 384 Q F0 30.79(:m)C
-(aximum number of amplitude beams)-30.79 E F1(*pixels_ss_max)144 396 Q
-F0 6.45(:m)C(aximum number of sidescan pix)-6.45 E(els)-.15 E F1(err)144
-408 Q(or)-.45 E F0 48.56(:e)C(rror v)-48.56 E(alue)-.25 E 2.776(As)108
-420 S .276(tatus v)-2.776 F .277(alue indicating success or f)-.25 F
-.277(ailure is returned; the error v)-.1 F .277(alue ar)-.25 F(gument)
--.18 E F1(err)2.777 E(or)-.45 E F0 .277(passes more detailed)2.777 F
-(information about f)108 432 Q(ailures.)-.1 E
-(---------------------------------------------------------)108 456 Q
-(int)108 468 Q F2(mb_f)2.5 E(ormat_\215ags)-.25 E F0(\()A(int)180 480 Q
-F1(verbose)2.5 E F0(,)A(int)180 492 Q F1(*format)2.5 E F0(,)A(int)180
-504 Q F1(*variable_beams)2.5 E F0(,)A(int)180 516 Q F1(*tr)2.5 E
-(aveltime)-.15 E F0(,)A(int)180 528 Q F1(*beam_\215a)2.5 E -.1(gg)-.1 G
-(ing).1 E F0(,)A(int)180 540 Q F1(*err)2.5 E(or)-.45 E F0(\);)A .635
-(The function)108 564 R F2(mb_f)3.135 E(ormat_\215ags)-.25 E F0 .634(re\
-turns \215ags indicating certain characteristics of the speci\214ed dat\
-a format.)3.134 F .085(The format id)108 576 R F1(*format)2.585 E F0
-.085(is \214rst check)2.585 F .085(ed for v)-.1 F(alidity)-.25 E 2.585
-(.I)-.65 G 2.585(ns)-2.585 G .085(ome cases, formerly v)-2.585 F .085
-(alid b)-.25 F .085(ut no)-.2 F 2.585(wo)-.25 G .085(bsolete format id)
--2.585 F -.25(va)108 588 S(lues are mapped to current v).25 E
-(alues. The input v)-.25 E(alues are:)-.25 E F1(*format)144 600 Q F0(:)A
-F2(MBIO)37.55 E F0(format id)2.5 E(The return v)108 612 Q(alues are:)
--.25 E F1(*format)144 624 Q F0(:)A F2(MBIO)37.55 E F0(format id)2.5 E F1
-(*variable_beams)144 636 Q F0 .34(:n)C(umber of beams can v)-.34 E
-(ary [boolean])-.25 E F1(*tr)144 648 Q(aveltime)-.15 E F0 23.82(:t)C(ra)
--23.82 E -.15(ve)-.2 G 2.5(lt).15 G(ime data a)-2.5 E -.25(va)-.2 G
-(ilable [boolean]).25 E F1(*beam_\215a)144 660 Q -.1(gg)-.1 G(ing).1 E
-F0 4.98(:b)C(eam \215agging supported [boolean])-4.98 E F1(err)144 672 Q
-(or)-.45 E F0 48.56(:e)C(rror v)-48.56 E(alue)-.25 E 2.777(As)108 684 S
-.277(tatus v)-2.777 F .277(alue indicating success or f)-.25 F .277
-(ailure is returned; the error v)-.1 F .277(alue ar)-.25 F(gument)-.18 E
-F1(err)2.777 E(or)-.45 E F0 .276(passes more detailed)2.777 F
-(information about f)108 696 Q(ailures.)-.1 E
-(---------------------------------------------------------)108 720 Q
-(MB-System 5.0)72 768 Q(26 October 2009)137.055 E(52)190.395 E 0 Cg EP
-%%Page: 53 53
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F(int)108 84 Q/F1 10/Times-Bold at 0 SF(mb_f)2.5 E
-(ormat_sour)-.25 E(ce)-.18 E F0(\()A(int)180 96 Q/F2 10/Times-Italic at 0
-SF(verbose)2.5 E F0(,)A(int)180 108 Q F2(*format)2.5 E F0(,)A(int)180
-120 Q F2(*nav_sour)2.5 E(ce)-.37 E F0(,)A(int)180 132 Q F2
-(*heading_sour)2.5 E(ce)-.37 E F0(,)A(int)180 144 Q F2(*vru_sour)2.5 E
-(ce)-.37 E F0(,)A(int)180 156 Q F2(*err)2.5 E(or)-.45 E F0(\);)A 1.363
-(The function)108 180 R F1(mb_f)3.863 E(ormat_sour)-.25 E(ce)-.18 E F0
-1.363(returns \215ags indicating what kinds of data records contain na)
-3.863 F(vig)-.2 E(ation,)-.05 E .227(heading, and attitude v)108 192 R
-.227(alues in the speci\214ed data format. The format id)-.25 F F2
-(*format)2.727 E F0 .227(is \214rst check)2.727 F .227(ed for v)-.1 F
-(alidity)-.25 E(.)-.65 E .895(In some cases, formerly v)108 204 R .895
-(alid b)-.25 F .895(ut no)-.2 F 3.395(wo)-.25 G .895
-(bsolete format id v)-3.395 F .896(alues are mapped to current v)-.25 F
-.896(alues. The input)-.25 F -.25(va)108 216 S(lues are:).25 E F2
-(*format)144 228 Q F0(:)A F1(MBIO)37.55 E F0(format id)2.5 E
-(The return v)108 240 Q(alues are:)-.25 E F2(*format)144 252 Q F0(:)A F1
-(MBIO)37.55 E F0(format id)2.5 E F2(*nav_sour)144 264 Q(ce)-.37 E F0
-18.49(:k)C(ind of data records containing)-18.49 E(na)252 276 Q(vig)-.2
-E(ation)-.05 E F2(*heading_sour)144 288 Q(ce)-.37 E F0 .71(:k)C
-(ind of data records containing)-.71 E(heading)252 300 Q F2(*vru_sour)
-144 312 Q(ce)-.37 E F0 19.6(:k)C(ind of data records containing)-19.6 E
-(attitude)252 324 Q F2(err)144 336 Q(or)-.45 E F0 48.56(:e)C(rror v)
--48.56 E(alue)-.25 E 2.777(As)108 348 S .277(tatus v)-2.777 F .277
-(alue indicating success or f)-.25 F .277
-(ailure is returned; the error v)-.1 F .277(alue ar)-.25 F(gument)-.18 E
-F2(err)2.777 E(or)-.45 E F0 .276(passes more detailed)2.777 F
-(information about f)108 360 Q(ailures.)-.1 E
-(---------------------------------------------------------)108 384 Q
-(int)108 396 Q F1(mb_f)2.5 E(ormat_beamwidth)-.25 E F0(\()A(int)180 408
-Q F2(verbose)2.5 E F0(,)A(int)180 420 Q F2(*format)2.5 E F0(,)A(double)
-180 432 Q F2(*beamwidth_xtr)2.5 E(ac)-.15 E(k)-.2 E F0(,)A(double)180
-444 Q F2(*beamwidth_ltr)2.5 E(ac)-.15 E(k)-.2 E F0(,)A(int)180 456 Q F2
-(*err)2.5 E(or)-.45 E F0(\);)A .495(The function)108 480 R F1(mb_f)2.995
-E(ormat_beamwidth)-.25 E F0 .495(returns typical, upper bound v)2.995 F
-.496(alues for athw)-.25 F .496(artships and alongtrack)-.1 F 1.234
-(beam widths. The format id)108 492 R F2(*format)3.734 E F0 1.234
-(is \214rst check)3.734 F 1.234(ed for v)-.1 F(alidity)-.25 E 3.733(.I)
--.65 G 3.733(ns)-3.733 G 1.233(ome cases, formerly v)-3.733 F 1.233
-(alid b)-.25 F 1.233(ut no)-.2 F(w)-.25 E(obsolete format id v)108 504 Q
-(alues are mapped to current v)-.25 E(alues. The input v)-.25 E
-(alues are:)-.25 E F2(*format)144 516 Q F0(:)A F1(MBIO)37.55 E F0
-(format id)2.5 E(The return v)108 528 Q(alues are:)-.25 E F2(*format)144
-540 Q F0(:)A F1(MBIO)37.55 E F0(format id)2.5 E F2(*beamwidth_xtr)144
-552 Q(ac)-.15 E(k)-.2 E F0 26.69(:t)C(ypical athw)-26.69 E
-(artships beam)-.1 E(width [de)288 564 Q(grees])-.15 E F2
-(*beamwidth_ltr)144 576 Q(ac)-.15 E(k)-.2 E F0 28.35(:t)C
-(ypical alongtrack beam)-28.35 E(width [de)288 588 Q(grees])-.15 E F2
-(err)144 600 Q(or)-.45 E F0 48.56(:e)C(rror v)-48.56 E(alue)-.25 E 2.776
-(As)108 612 S .276(tatus v)-2.776 F .277(alue indicating success or f)
--.25 F .277(ailure is returned; the error v)-.1 F .277(alue ar)-.25 F
-(gument)-.18 E F2(err)2.777 E(or)-.45 E F0 .277(passes more detailed)
-2.777 F(information about f)108 624 Q(ailures.)-.1 E
-(---------------------------------------------------------)108 648 Q
-(int)108 660 Q F1(mb_datalist_open)2.5 E F0(\()A(int)180 672 Q F2
-(verbose)2.5 E F0(,)A(char)180 684 Q F2(**datalist)2.5 E F0(,)A(char)180
-696 Q F2(*path)2.5 E F0(,)A(int)180 708 Q F2(look_pr)2.5 E(ocessed)-.45
-E F0(,)A(int)180 720 Q F2(*err)2.5 E(or)-.45 E F0(\);)A(MB-System 5.0)72
-768 Q(26 October 2009)137.055 E(53)190.395 E 0 Cg EP
-%%Page: 54 54
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F .665(The function)108 84 R/F1 10/Times-Bold at 0 SF
-(mb_datalist_open)3.165 E F0 .665
-(initializes reading from a datalist tree. The string)3.165 F/F2 10
-/Times-Italic at 0 SF(*path)3.165 E F0 .665(is the path to the)3.165 F .414
-(top le)108 96 R -.15(ve)-.25 G 2.914(ld).15 G .414
-(atalist \214le to be opened.)-2.914 F .414(The v)5.414 F(alue)-.25 E F2
-(look_pr)2.914 E(ocessed)-.45 E F0 .414
-(indicates whether the datalist parsing should)2.914 F .018
-(look for or ignore processed data \214les \(see the)108 108 R F1(mbpr)
-2.517 E(ocess)-.18 E F0(and)2.517 E F1(mbdatalist)2.517 E F0 .017
-(manual pages\).)2.517 F .017(The input v)5.017 F(alues)-.25 E(are:)108
-120 Q F2(*path)144 132 Q F0 46.44(:d)C(atalist \214le to be opened)
--46.44 E F2(look_pr)144 144 Q(ocessed)-.45 E F0 7.46(:p)C
-(rocessed \214le beha)-7.46 E(vior)-.2 E 2.5(0:u)288 156 S(nset)-2.5 E
-2.5(1:i)288 168 S(gnore processed \214les)-2.5 E 2.5(2:r)288 180 S
-(eturn processed \214les)-2.5 E(The return v)108 192 Q(alues are:)-.25 E
-F2(**datalist)144 204 Q F0 29.21(:p)C(ointer to datalist)-29.21 E
-(structure)252 216 Q F2(err)144 228 Q(or)-.45 E F0 48.56(:e)C(rror v)
--48.56 E(alue)-.25 E 2.776(As)108 240 S .276(tatus v)-2.776 F .277
-(alue indicating success or f)-.25 F .277
-(ailure is returned; the error v)-.1 F .277(alue ar)-.25 F(gument)-.18 E
-F2(err)2.777 E(or)-.45 E F0 .277(passes more detailed)2.777 F
-(information about f)108 252 Q(ailures.)-.1 E
-(---------------------------------------------------------)108 276 Q
-(int)108 288 Q F1(mb_datalist_r)2.5 E(ead)-.18 E F0(\()A(int)180 300 Q
-F2(verbose)2.5 E F0(,)A(char)180 312 Q F2(*datalist)2.5 E F0(,)A(char)
-180 324 Q F2(*path)2.5 E F0(,)A(int)180 336 Q F2(*format)2.5 E F0(,)A
-(double)180 348 Q F2(*weight)2.5 E F0(,)A(int)180 360 Q F2(*err)2.5 E
-(or)-.45 E F0(\);)A 1.015(The function)108 384 R F1(mb_datalist_r)3.515
-E(ead)-.18 E F0 1.015
-(reads from a datalist tree, attempting to return the path to the ne)
-3.515 F 1.015(xt v)-.15 F(alid)-.25 E(sw)108 396 Q .007(ath data \214le\
-, the corresponding data format id, and a gridding weight \(see the)-.1
-F F1(mbpr)2.508 E(ocess)-.18 E F0(and)2.508 E F1(mbdatalist)2.508 E F0
-.528(manual pages\).)108 408 R .527(Information about the datalist tree\
- is embedded in a data structure pointed to by)5.528 F F2(*datalist)
-3.027 E F0(.)A(The input v)108 420 Q(alues are:)-.25 E F2(*datalist)144
-432 Q F0 34.21(:p)C(ointer to datalist)-34.21 E(structure)252 444 Q
-(The return v)108 456 Q(alues are:)-.25 E F2(*path)144 468 Q F0 46.44
-(:s)C -.1(wa)-46.44 G(th data \214le).1 E F2(*format)144 480 Q F0(:)A F1
-(MBIO)37.55 E F0(format id)2.5 E F2(*weight)144 492 Q F0(:)A F1(mbgrid)
-37.55 E F0(gridding weight)2.5 E F2(err)144 504 Q(or)-.45 E F0 48.56(:e)
-C(rror v)-48.56 E(alue)-.25 E 2.776(As)108 516 S .276(tatus v)-2.776 F
-.277(alue indicating success or f)-.25 F .277
-(ailure is returned; the error v)-.1 F .277(alue ar)-.25 F(gument)-.18 E
-F2(err)2.777 E(or)-.45 E F0 .277(passes more detailed)2.777 F
-(information about f)108 528 Q(ailures.)-.1 E
-(---------------------------------------------------------)108 552 Q
-(int)108 564 Q F1(mb_datalist_close)2.5 E F0(\()A(int)180 576 Q F2
-(verbose)2.5 E F0(,)A(char)180 588 Q F2(**datalist)2.5 E F0(,)A(int)180
-600 Q F2(*err)2.5 E(or)-.45 E F0(\);)A .843(The function)108 624 R F1
-(mb_datalist_close)3.343 E F0 .842(closes an open datalist tree, and de\
-allocates the data structure pointed to)3.342 F(by)108 636 Q F2
-(*datalist)2.5 E F0 2.5(.T)C(he input v)-2.5 E(alues are:)-.25 E F2
-(*datalist)144 648 Q F0 34.21(:p)C(ointer to datalist)-34.21 E
-(structure)252 660 Q(The return v)108 672 Q(alues are:)-.25 E F2(err)144
-684 Q(or)-.45 E F0 48.56(:e)C(rror v)-48.56 E(alue)-.25 E 2.776(As)108
-696 S .276(tatus v)-2.776 F .277(alue indicating success or f)-.25 F
-.277(ailure is returned; the error v)-.1 F .277(alue ar)-.25 F(gument)
--.18 E F2(err)2.777 E(or)-.45 E F0 .277(passes more detailed)2.777 F
-(information about f)108 708 Q(ailures.)-.1 E(MB-System 5.0)72 768 Q
-(26 October 2009)137.055 E(54)190.395 E 0 Cg EP
-%%Page: 55 55
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F
-(---------------------------------------------------------)108 84 Q(int)
-108 96 Q/F1 10/Times-Bold at 0 SF(mb_alloc)2.5 E F0(\()A(int)180 108 Q/F2
-10/Times-Italic at 0 SF(verbose)2.5 E F0(,)A(char)180 120 Q F2(*mbio_ptr)
-2.5 E F0(,)A(char)180 132 Q F2(**stor)2.5 E(e_ptr)-.37 E F0(,)A(int)180
-144 Q F2(*err)2.5 E(or)-.45 E F0(\);)A 1.596(The function)108 168 R F1
-(mb_alloc)4.096 E F0 1.596
-(allocates a data structure for internal storage of sw)4.096 F 1.595
-(ath sonar data and returns a)-.1 F 1.432(pointer to this structure in)
-108 180 R F2(*stor)3.932 E(e_ptr)-.37 E F0 6.432(.T)C 1.433
-(he data structure is speci\214c to the data format identi\214ed in the)
--6.432 F F1(MBIO)108 192 Q F0(data structure pointed to by)2.5 E F2
-(*mbio_ptr)2.5 E F0 5(.T)C(he input v)-5 E(alues are:)-.25 E F2
-(*mbio_ptr)144 204 Q F0 27.55(:p)C(ointer to)-27.55 E F1(MBIO)2.5 E F0
-(structure)2.5 E(The return v)108 216 Q(alues are:)-.25 E F2(**stor)144
-228 Q(e_ptr)-.37 E F0 22.92(:p)C(ointer to storage data)-22.92 E
-(structure)252 240 Q F2(err)144 252 Q(or)-.45 E F0 48.56(:e)C(rror v)
--48.56 E(alue)-.25 E 2.777(As)108 264 S .277(tatus v)-2.777 F .277
-(alue indicating success or f)-.25 F .277
-(ailure is returned; the error v)-.1 F .277(alue ar)-.25 F(gument)-.18 E
-F2(err)2.777 E(or)-.45 E F0 .276(passes more detailed)2.777 F
-(information about f)108 276 Q(ailures.)-.1 E
-(---------------------------------------------------------)108 300 Q
-(int)108 312 Q F1(mb_deall)2.5 E F0(\()A(int)180 324 Q F2(verbose)2.5 E
-F0(,)A(char)180 336 Q F2(*mbio_ptr)2.5 E F0(,)A(char)180 348 Q F2
-(**stor)2.5 E(e_ptr)-.37 E F0(,)A(int)180 360 Q F2(*err)2.5 E(or)-.45 E
-F0(\);)A 1.033(The function)108 384 R F1(mb_deall)3.533 E F0 1.033
-(deallocates a format speci\214c sw)3.533 F 1.034
-(ath sonar data structure pointed to by)-.1 F F2(*stor)3.534 E(e_ptr)
--.37 E F0(.)A(The input v)108 396 Q(alues are:)-.25 E F2(*mbio_ptr)144
-408 Q F0 27.55(:p)C(ointer to)-27.55 E F1(MBIO)2.5 E F0(structure)2.5 E
-F2(*stor)144 420 Q(e_ptr)-.37 E F0 27.92(:p)C(ointer to storage data)
--27.92 E(structure)252 432 Q(The return v)108 444 Q(alues are:)-.25 E F2
-(err)144 456 Q(or)-.45 E F0 48.56(:e)C(rror v)-48.56 E(alue)-.25 E 2.777
-(As)108 468 S .277(tatus v)-2.777 F .277(alue indicating success or f)
--.25 F .277(ailure is returned; the error v)-.1 F .277(alue ar)-.25 F
-(gument)-.18 E F2(err)2.777 E(or)-.45 E F0 .276(passes more detailed)
-2.777 F(information about f)108 480 Q(ailures.)-.1 E
-(---------------------------------------------------------)108 504 Q
-(int)108 516 Q F1(mb_err)2.5 E(or)-.18 E F0(\()A(int)180 528 Q F2(err)
-2.5 E(or)-.45 E F0(,)A(int)180 540 Q F2(err)2.5 E(or)-.45 E F0(,)A(char)
-180 552 Q F2(**messa)2.5 E -.1(ge)-.1 G F0(\);).1 E(Gi)108 576 Q -.15
-(ve)-.25 G 2.566(nt).15 G .066(he error v)-2.566 F(alue)-.25 E F2(err)
-2.567 E(or)-.45 E F0(,)A F1(mb_f)2.567 E(ormat_inf)-.25 E F0 .067
-(returns a short error message in the string **)2.567 F F2(messa)A -.1
-(ge)-.1 G F0 2.567(.T).1 G(he)-2.567 E F2(ver)2.567 E(-)-.2 E(bose)108
-588 Q F0 -.25(va)2.809 G .309(lue controls the standard error output v)
-.25 F .309(erbosity of the function.)-.15 F .308(The return status v)
-5.309 F .308(alue signals suc-)-.25 F(cess if)108 600 Q F2(format)2.5 E
-F0(is v)2.5 E(alid and f)-.25 E(ailure otherwise.)-.1 E
-(---------------------------------------------------------)108 624 Q
-(int)108 636 Q F1(mb_na)2.5 E(vint_add)-.25 E F0(\()A(int)180 648 Q F2
-(verbose)2.5 E F0(,)A(char)180 660 Q F2(*mbio_ptr)2.5 E F0(,)A(double)
-180 672 Q F2(time_d)2.5 E F0(,)A(double)180 684 Q F2(lon)2.5 E F0(,)A
-(double)180 696 Q F2(lat)2.5 E F0(,)A(int)180 708 Q F2(*err)2.5 E(or)
--.45 E F0(\);)A(MB-System 5.0)72 768 Q(26 October 2009)137.055 E(55)
-190.395 E 0 Cg EP
-%%Page: 56 56
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F .584(The function)108 84 R/F1 10/Times-Bold at 0 SF
-(mb_na)3.084 E(vint_add)-.25 E F0 .584(adds a na)3.084 F(vig)-.2 E .585
-(ation \214x to a circular b)-.05 F(uf)-.2 E .585(fer of na)-.25 F(vig)
--.2 E .585(ation v)-.05 F .585(alues maintained in)-.25 F(the)108 96 Q
-F1(MBIO)3.436 E F0 .936(data structure pointed to by)3.436 F F1
-(*mbio_ptr)3.436 E F0 5.936(.T)C .936(his b)-5.936 F(uf)-.2 E .935
-(fer is used to interpolate na)-.25 F(vig)-.2 E .935(ation for data)-.05
-F .977(formats where the na)108 108 R(vig)-.2 E .978
-(ation is asynchronous \(where na)-.05 F(vig)-.2 E .978(ation and surv)
--.05 F 1.278 -.15(ey p)-.15 H .978(ings come in dif).15 F .978
-(ferent data)-.25 F 2.5(records\). The)108 120 R(input v)2.5 E
-(alues are:)-.25 E/F2 10/Times-Italic at 0 SF(*mbio_ptr)144 132 Q F0 27.55
-(:p)C(ointer to)-27.55 E F1(MBIO)2.5 E F0(structure)2.5 E F2(time_d)144
-144 Q F0 42(:t)C(ime of na)-42 E(vig)-.2 E(ation \214x in seconds)-.05 E
-(since 1/1/70 00:00:00)216 156 Q F2(lon)144 168 Q F0 56.44(:l)C
-(ongitude \(de)-56.44 E(grees\))-.15 E F2(lat)144 180 Q F0 58.66(:l)C
-(atitude \(de)-58.66 E(grees\))-.15 E(The return v)108 192 Q(alues are:)
--.25 E F2(err)144 204 Q(or)-.45 E F0 48.56(:e)C(rror v)-48.56 E(alue)
--.25 E 2.777(As)108 216 S .277(tatus v)-2.777 F .277
-(alue indicating success or f)-.25 F .277
-(ailure is returned; the error v)-.1 F .277(alue ar)-.25 F(gument)-.18 E
-F2(err)2.777 E(or)-.45 E F0 .276(passes more detailed)2.777 F
-(information about f)108 228 Q(ailures.)-.1 E
-(---------------------------------------------------------)108 252 Q
-(int)108 264 Q F1(mb_na)2.5 E(vint_inter)-.25 E(p)-.1 E F0(\()A(int)180
-276 Q F2(verbose)2.5 E F0(,)A(char)180 288 Q F2(*mbio_ptr)2.5 E F0(,)A
-(double)180 300 Q F2(time_d)2.5 E F0(,)A(double)180 312 Q F2(heading)2.5
-E F0(,)A(double)180 324 Q F2 -.15(ra)2.5 G(wspeed).15 E F0(,)A(double)
-180 336 Q F2(*lon)2.5 E F0(,)A(double)180 348 Q F2(*lat)2.5 E F0(,)A
-(double)180 360 Q F2(*speed)2.5 E F0(,)A(int)180 372 Q F2(*err)2.5 E(or)
--.45 E F0(\);)A .592(The function)108 396 R F1(mb_na)3.092 E(vint_inter)
--.25 E(p)-.1 E F0 .593(interpolates na)3.093 F(vig)-.2 E .593
-(ation to the time)-.05 F F2(time_d)3.093 E F0 .593(using a circular b)
-3.093 F(uf)-.2 E .593(fer of na)-.25 F(vi-)-.2 E -.05(ga)108 408 S .095
-(tion v).05 F .094(alues maintained in the)-.25 F F1(MBIO)2.594 E F0
-.094(data structure pointed to by)2.594 F F1(*mbio_ptr)2.594 E F0 5.094
-(.T)C .094(his b)-5.094 F(uf)-.2 E .094(fer is used to inter)-.25 F(-)
--.2 E 1.8(polate na)108 420 R(vig)-.2 E 1.801
-(ation for data formats where the na)-.05 F(vig)-.2 E 1.801
-(ation is asynchronous \(where na)-.05 F(vig)-.2 E 1.801(ation and surv)
--.05 F -.15(ey)-.15 G(pings come in dif)108 432 Q
-(ferent data records\).)-.25 E(The input v)5 E(alues are:)-.25 E F2
-(*mbio_ptr)144 444 Q F0 27.55(:p)C(ointer to)-27.55 E F1(MBIO)2.5 E F0
-(structure)2.5 E F2(time_d)144 456 Q F0 42(:t)C
-(ime of current ping in seconds)-42 E(since 1/1/70 00:00:00)216 468 Q F2
-(heading)144 480 Q F0 37(:h)C(eading in de)-37 E(grees)-.15 E F2 -.15
-(ra)144 492 S(wspeed).15 E F0 67.04(:s)C(peed in km/hr)-67.04 E
-(\(zero if not kno)252 504 Q(wn\))-.25 E(The return v)108 516 Q
-(alues are:)-.25 E F2(*lon)144 528 Q F0 51.44(:l)C(ongitude \(de)-51.44
-E(grees\))-.15 E F2(*lat)144 540 Q F0 53.66(:l)C(atitude \(de)-53.66 E
-(grees\))-.15 E F2(*speed)144 552 Q F0 41.45(:s)C
-(peed made good in km/hr)-41.45 E F2(err)144 564 Q(or)-.45 E F0 48.56
-(:e)C(rror v)-48.56 E(alue)-.25 E 2.777(As)108 576 S .277(tatus v)-2.777
-F .277(alue indicating success or f)-.25 F .277
-(ailure is returned; the error v)-.1 F .277(alue ar)-.25 F(gument)-.18 E
-F2(err)2.777 E(or)-.45 E F0 .276(passes more detailed)2.777 F
-(information about f)108 588 Q(ailures.)-.1 E
-(---------------------------------------------------------)108 612 Q
-(int)108 624 Q F1(mb_attint_add)2.5 E F0(\()A(int)180 636 Q F2(verbose)
-2.5 E F0(,)A(char)180 648 Q F2(*mbio_ptr)2.5 E F0(,)A(double)180 660 Q
-F2(time_d)2.5 E F0(,)A(double)180 672 Q F2(heave)2.5 E F0(,)A(double)180
-684 Q F2 -.45(ro)2.5 G(ll).45 E F0(,)A(double)180 696 Q F2(pitc)2.5 E(h)
--.15 E F0(,)A(int)180 708 Q F2(*err)2.5 E(or)-.45 E F0(\);)A
-(MB-System 5.0)72 768 Q(26 October 2009)137.055 E(56)190.395 E 0 Cg EP
-%%Page: 57 57
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F .7(The function)108 84 R/F1 10/Times-Bold at 0 SF
-(mb_attint_add)3.2 E F0 .7(adds an attitude \(hea)3.2 F -.15(ve)-.2 G
-3.2(,r).15 G .7(oll, pitch\) data point to a circular b)-3.2 F(uf)-.2 E
-.7(fer of attitude)-.25 F -.25(va)108 96 S .484(lues maintained in the)
-.25 F F1(MBIO)2.984 E F0 .484(data structure pointed to by)2.984 F F1
-(*mbio_ptr)2.984 E F0 5.484(.T)C .484(his b)-5.484 F(uf)-.2 E .483
-(fer is used to interpolate)-.25 F .004(attitude for data formats where\
- the attitude is asynchronous \(where attitude and surv)108 108 R .304
--.15(ey p)-.15 H .004(ings come in dif).15 F(fer)-.25 E(-)-.2 E
-(ent data records\).)108 120 Q(The input v)5 E(alues are:)-.25 E/F2 10
-/Times-Italic at 0 SF(*mbio_ptr)144 132 Q F0 27.55(:p)C(ointer to)-27.55 E
-F1(MBIO)2.5 E F0(structure)2.5 E F2(time_d)144 144 Q F0 42(:t)C
-(ime of attitude in seconds)-42 E(since 1/1/70 00:00:00)216 156 Q F2
-(heave)144 168 Q F0 45.9(:h)C(ea)-45.9 E .3 -.15(ve \()-.2 H
-(meters, up +\)).15 E F2 -.45(ro)144 180 S(ll).45 E F0 55.22(:r)C
-(oll \(de)-55.22 E(grees, starboard up +\))-.15 E F2(pitc)144 192 Q(h)
--.15 E F0 49.37(:p)C(itch \(de)-49.37 E(grees, forw)-.15 E(ard up +\))
--.1 E(The return v)108 204 Q(alues are:)-.25 E F2(err)144 216 Q(or)-.45
-E F0 48.56(:e)C(rror v)-48.56 E(alue)-.25 E 2.777(As)108 228 S .277
-(tatus v)-2.777 F .277(alue indicating success or f)-.25 F .277
-(ailure is returned; the error v)-.1 F .277(alue ar)-.25 F(gument)-.18 E
-F2(err)2.777 E(or)-.45 E F0 .276(passes more detailed)2.777 F
-(information about f)108 240 Q(ailures.)-.1 E
-(---------------------------------------------------------)108 264 Q
-(int)108 276 Q F1(mb_attint_inter)2.5 E(p)-.1 E F0(\()A(int)180 288 Q F2
-(verbose)2.5 E F0(,)A(char)180 300 Q F2(*mbio_ptr)2.5 E F0(,)A(double)
-180 312 Q F2(time_d)2.5 E F0(,)A(double)180 324 Q F2(*heave)2.5 E F0(,)A
-(double)180 336 Q F2(*r)2.5 E(oll)-.45 E F0(,)A(double)180 348 Q F2
-(*pitc)2.5 E(h)-.15 E F0(,)A(int)180 360 Q F2(*err)2.5 E(or)-.45 E F0
-(\);)A .384(The function)108 384 R F1(mb_attint_inter)2.884 E(p)-.1 E F0
-.384(interpolates attitude \(hea)2.884 F -.15(ve)-.2 G 2.884(,r).15 G
-.384(oll, pitch\) data to the time)-2.884 F F2(time_d)2.884 E F0 .384
-(using a cir)2.884 F(-)-.2 E .062(cular b)108 396 R(uf)-.2 E .062
-(fer of attitude v)-.25 F .062(alues maintained in the)-.25 F F1(MBIO)
-2.562 E F0 .062(data structure pointed to by)2.562 F F1(*mbio_ptr)2.562
-E F0 5.061(.T)C .061(his b)-5.061 F(uf)-.2 E(fer)-.25 E .044(is used to\
- interpolate attitude for data formats where the attitude is asynchrono\
-us \(where attitude and surv)108 408 R -.15(ey)-.15 G(pings come in dif)
-108 420 Q(ferent data records\).)-.25 E(The input v)5 E(alues are:)-.25
-E F2(*mbio_ptr)144 432 Q F0 27.55(:p)C(ointer to)-27.55 E F1(MBIO)2.5 E
-F0(structure)2.5 E F2(time_d)144 444 Q F0 42(:t)C
-(ime of current ping in seconds)-42 E(since 1/1/70 00:00:00)216 456 Q
-(The return v)108 468 Q(alues are:)-.25 E F2(*heave)144 480 Q F0 40.9
-(:h)C(ea)-40.9 E .3 -.15(ve \()-.2 H(meters, up +\)).15 E F2(*r)144 492
-Q(oll)-.45 E F0 50.22(:r)C(oll \(de)-50.22 E(grees, starboard up +\))
--.15 E F2(*pitc)144 504 Q(h)-.15 E F0 44.37(:p)C(itch \(de)-44.37 E
-(grees, forw)-.15 E(ard up +\))-.1 E F2(err)144 516 Q(or)-.45 E F0 48.56
-(:e)C(rror v)-48.56 E(alue)-.25 E 2.777(As)108 528 S .277(tatus v)-2.777
-F .277(alue indicating success or f)-.25 F .277
-(ailure is returned; the error v)-.1 F .277(alue ar)-.25 F(gument)-.18 E
-F2(err)2.777 E(or)-.45 E F0 .276(passes more detailed)2.777 F
-(information about f)108 540 Q(ailures.)-.1 E
-(---------------------------------------------------------)108 564 Q
-(int)108 576 Q F1(mb_hedint_add)2.5 E F0(\()A(int)180 588 Q F2(verbose)
-2.5 E F0(,)A(char)180 600 Q F2(*mbio_ptr)2.5 E F0(,)A(double)180 612 Q
-F2(time_d)2.5 E F0(,)A(double)180 624 Q F2(heading)2.5 E F0(,)A(int)180
-636 Q F2(*err)2.5 E(or)-.45 E F0(\);)A .276(The function)108 660 R F1
-(mb_hedint_add)2.776 E F0 .276(adds a heading point to a circular b)
-2.776 F(uf)-.2 E .276(fer of heading v)-.25 F .277
-(alues maintained in the)-.25 F F1(MBIO)108 672 Q F0 .435
-(data structure pointed to by)2.935 F F1(*mbio_ptr)2.935 E F0 5.434(.T)C
-.434(his b)-5.434 F(uf)-.2 E .434
-(fer is used to interpolate heading for data formats)-.25 F .603
-(where the heading is asynchronous \(where heading and surv)108 684 R
-.903 -.15(ey p)-.15 H .604(ings come in dif).15 F .604
-(ferent data records\).)-.25 F(The)5.604 E(input v)108 696 Q(alues are:)
--.25 E F2(*mbio_ptr)144 708 Q F0 27.55(:p)C(ointer to)-27.55 E F1(MBIO)
-2.5 E F0(structure)2.5 E F2(time_d)144 720 Q F0 42(:t)C
-(ime of heading v)-42 E(alue in seconds)-.25 E(MB-System 5.0)72 768 Q
-(26 October 2009)137.055 E(57)190.395 E 0 Cg EP
-%%Page: 58 58
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F(since 1/1/70 00:00:00)216 84 Q/F1 10/Times-Italic at 0
-SF(heading)144 96 Q F0 37(:h)C(eading \(de)-37 E(grees\))-.15 E
-(The return v)108 108 Q(alues are:)-.25 E F1(err)144 120 Q(or)-.45 E F0
-48.56(:e)C(rror v)-48.56 E(alue)-.25 E 2.777(As)108 132 S .277(tatus v)
--2.777 F .277(alue indicating success or f)-.25 F .277
-(ailure is returned; the error v)-.1 F .277(alue ar)-.25 F(gument)-.18 E
-F1(err)2.777 E(or)-.45 E F0 .276(passes more detailed)2.777 F
-(information about f)108 144 Q(ailures.)-.1 E
-(---------------------------------------------------------)108 168 Q
-(int)108 180 Q/F2 10/Times-Bold at 0 SF(mb_hedint_inter)2.5 E(p)-.1 E F0
-(\()A(int)180 192 Q F1(verbose)2.5 E F0(,)A(char)180 204 Q F1(*mbio_ptr)
-2.5 E F0(,)A(double)180 216 Q F1(time_d)2.5 E F0(,)A(double)180 228 Q F1
-(*heading)2.5 E F0(,)A(int)180 240 Q F1(*err)2.5 E(or)-.45 E F0(\);)A
-.503(The function)108 264 R F2(mb_hedint_inter)3.003 E(p)-.1 E F0 .503
-(interpolates heading to the time)3.003 F F1(time_d)3.004 E F0 .504
-(using a circular b)3.004 F(uf)-.2 E .504(fer of heading)-.25 F -.25(va)
-108 276 S .484(lues maintained in the).25 F F2(MBIO)2.984 E F0 .484
-(data structure pointed to by)2.984 F F2(*mbio_ptr)2.984 E F0 5.484(.T)C
-.484(his b)-5.484 F(uf)-.2 E .483(fer is used to interpolate)-.25 F .358
-(heading for data formats where the heading is asynchronous \(where hea\
-ding and surv)108 288 R .658 -.15(ey p)-.15 H .359(ings come in dif-).15
-F(ferent data records\).)108 300 Q(The input v)5 E(alues are:)-.25 E F1
-(*mbio_ptr)144 312 Q F0 27.55(:p)C(ointer to)-27.55 E F2(MBIO)2.5 E F0
-(structure)2.5 E F1(time_d)144 324 Q F0 42(:t)C
-(ime of current ping in seconds)-42 E(since 1/1/70 00:00:00)216 336 Q
-(The return v)108 348 Q(alues are:)-.25 E F1(*heading)144 360 Q F0 68
-(:h)C(eading in de)-68 E(grees)-.15 E F1(err)144 372 Q(or)-.45 E F0
-48.56(:e)C(rror v)-48.56 E(alue)-.25 E 2.777(As)108 384 S .277(tatus v)
--2.777 F .277(alue indicating success or f)-.25 F .277
-(ailure is returned; the error v)-.1 F .277(alue ar)-.25 F(gument)-.18 E
-F1(err)2.777 E(or)-.45 E F0 .276(passes more detailed)2.777 F
-(information about f)108 396 Q(ailures.)-.1 E
-(---------------------------------------------------------)108 420 Q
-(int)108 432 Q F2(mb_get_double)2.5 E F0(\()A(double)180 444 Q F1
-(*value)2.5 E F0(,)A(char)180 456 Q F1(*str)2.5 E F0(,)A(int)180 468 Q
-F1(nc)2.5 E(har)-.15 E F0(\);)A .691(The function)108 492 R F2
-(mb_get_double)3.191 E F0 .691(parses the \214rst)3.191 F F1(nc)3.191 E
-(har)-.15 E F0 .691(characters of the string)3.191 F F1(*str)3.191 E F0
-.692(for a \215oating point v)3.191 F(alue,)-.25 E(storing this v)108
-504 Q(alue as a double in)-.25 E F1(*value)2.5 E F0(.)A
-(---------------------------------------------------------)108 528 Q
-(int)108 540 Q F2(mb_get_int)2.5 E F0(\()A(int)180 552 Q F1(*value)2.5 E
-F0(,)A(char)180 564 Q F1(*str)2.5 E F0(,)A(int)180 576 Q F1(nc)2.5 E
-(har)-.15 E F0(\);)A .122(The function)108 600 R F2(mb_get_int)2.622 E
-F0 .121(parses the \214rst)2.622 F F1(nc)2.621 E(har)-.15 E F0 .121
-(characters of the string)2.621 F F1(*str)2.621 E F0 .121(for an inte)
-2.621 F .121(ger v)-.15 F .121(alue, storing this)-.25 F -.25(va)108 612
-S(lue as a int in).25 E F1(*value)2.5 E F0(.)A
-(---------------------------------------------------------)108 636 Q
-(int)108 648 Q F2(mb_get_binary_short)2.5 E F0(\()A(int)180 660 Q F1
-(swapped)2.5 E F0(,)A -.2(vo)180 672 S(id).2 E F1(*b)2.5 E(uf)-.2 E(fer)
--.18 E F0(,)A(short)180 684 Q F1(*value)2.5 E F0(\);)A .095
-(The function)108 708 R F2(mb_get_binary_short)2.595 E F0 -.15(ex)2.595
-G .095(tracts a short int v).15 F .095(alue from the \214rst tw)-.25 F
-2.595(ob)-.1 G .095(ytes pointed to by)-2.595 F F1(*b)2.595 E(uf)-.2 E
-(fer)-.18 E F0(.)A(If the boolean)108 720 Q F1(swapped)2.5 E F0
-(is true, the byte order of)2.5 E F1(*value)2.5 E F0(is sw)2.5 E(apped.)
--.1 E(MB-System 5.0)72 768 Q(26 October 2009)137.055 E(58)190.395 E 0 Cg
-EP
-%%Page: 59 59
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F
-(---------------------------------------------------------)108 84 Q(int)
-108 96 Q/F1 10/Times-Bold at 0 SF(mb_get_binary_int)2.5 E F0(\()A(int)180
-108 Q/F2 10/Times-Italic at 0 SF(swapped)2.5 E F0(,)A -.2(vo)180 120 S(id)
-.2 E F2(*b)2.5 E(uf)-.2 E(fer)-.18 E F0(,)A(int)180 132 Q F2(*value)2.5
-E F0(\);)A .232(The function)108 156 R F1(mb_get_binary_int)2.732 E F0
--.15(ex)2.732 G .231(tracts an int v).15 F .231
-(alue from the \214rst four bytes pointed to by)-.25 F F2(*b)2.731 E(uf)
--.2 E(fer)-.18 E F0 2.731(.I)C 2.731(ft)-2.731 G(he)-2.731 E(boolean)108
-168 Q F2(swapped)2.5 E F0(is true, the byte order of)2.5 E F2(*value)2.5
-E F0(is sw)2.5 E(apped.)-.1 E
-(---------------------------------------------------------)108 192 Q
-(int)108 204 Q F1(mb_get_binary_\215oat)2.5 E F0(\()A(int)180 216 Q F2
-(swapped)2.5 E F0(,)A -.2(vo)180 228 S(id).2 E F2(*b)2.5 E(uf)-.2 E(fer)
--.18 E F0(,)A(\215oat *v)180 240 Q(alue)-.25 E F2(\);)A .813
-(The function)108 264 R F1(mb_get_binary_\215oat)3.313 E F2 -.2(ex)3.313
-G(tr).2 E .813(acts a \215oat value fr)-.15 F .813(om the \214r)-.45 F
-.813(st four bytes pointed to by *b)-.1 F(uf)-.2 E(fer)-.18 E 3.314(.I)
--1.11 G(f)-3.314 E(the boolean swapped is true)108 276 Q 2.5(,t)-.1 G
-(he byte or)-2.5 E(der of *value is swapped.)-.37 E
-(---------------------------------------------------------)108 300 Q
-(int)108 312 Q F1(mb_get_binary_double)2.5 E F2(\()A(int swapped,)180
-324 Q(void *b)180 336 Q(uf)-.2 E(fer)-.18 E(,)-1.11 E(double *value\);)
-180 348 Q 2.232(The function)108 372 R F1(mb_get_binary_double)4.732 E
-F2 -.2(ex)4.732 G(tr).2 E 2.232(acts a double value fr)-.15 F 2.231
-(om the \214r)-.45 F 2.231(st eight bytes pointed to by)-.1 F(*b)108 384
-Q(uf)-.2 E(fer)-.18 E 2.5(.I)-1.11 G 2.5(ft)-2.5 G
-(he boolean swapped is true)-2.5 E 2.5(,t)-.1 G(he byte or)-2.5 E
-(der of *value is swapped.)-.37 E
-(---------------------------------------------------------)108 408 Q
-(int)108 420 Q F1(mb_put_binary_short)2.5 E F2(\()A(int swapped,)180 432
-Q(short value)180 444 Q(,)-.1 E(void *b)180 456 Q(uf)-.2 E(fer\);)-.18 E
-.111(The function)108 480 R F1(mb_put_binary_short)2.611 E F2 .112
-(inserts a short int value into the \214r)2.611 F .112
-(st two bytes pointed to by *b)-.1 F(uf)-.2 E(fer)-.18 E 2.612(.I)-1.11
-G(f)-2.612 E(the boolean swapped is true)108 492 Q 2.5(,t)-.1 G
-(he byte or)-2.5 E(der of value is swapped.)-.37 E
-(---------------------------------------------------------)108 516 Q
-(int)108 528 Q F1(mb_put_binary_int)2.5 E F2(\()A(int swapped,)180 540 Q
-(int value)180 552 Q(,)-.1 E(void *b)180 564 Q(uf)-.2 E(fer\);)-.18 E
-.799(The function)108 588 R F1(mb_put_binary_int)3.299 E F2 .798
-(inserts an int value into the \214r)3.299 F .798
-(st four bytes pointed to by *b)-.1 F(uf)-.2 E(fer)-.18 E 3.298(.I)-1.11
-G 3.298(ft)-3.298 G(he)-3.298 E(boolean swapped is true)108 600 Q 2.5
-(,t)-.1 G(he byte or)-2.5 E(der of value is swapped.)-.37 E
-(---------------------------------------------------------)108 624 Q
-(int)108 636 Q F1(mb_put_binary_\215oat)2.5 E F2(\()A(int swapped,)180
-648 Q(\215oat value)180 660 Q(,)-.1 E(void *b)180 672 Q(uf)-.2 E(fer\);)
--.18 E .242(The function)108 696 R F1(mb_put_binary_\215oat)2.743 E F2
-.243(inserts a \215oat value into the \214r)2.743 F .243
-(st four bytes pointed to by *b)-.1 F(uf)-.2 E(fer)-.18 E 2.743(.I)-1.11
-G 2.743(ft)-2.743 G(he)-2.743 E(boolean swapped is true)108 708 Q 2.5
-(,t)-.1 G(he byte or)-2.5 E(der of value is swapped.)-.37 E F0
-(MB-System 5.0)72 768 Q(26 October 2009)137.055 E(59)190.395 E 0 Cg EP
-%%Page: 60 60
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F/F1 10/Times-Italic at 0 SF
-(---------------------------------------------------------)108 84 Q(int)
-108 96 Q/F2 10/Times-Bold at 0 SF(mb_put_binary_double)2.5 E F1(\()A
-(int swapped,)180 108 Q(double value)180 120 Q(,)-.1 E(void *b)180 132 Q
-(uf)-.2 E(fer\);)-.18 E .312(The function)108 156 R F2
-(mb_put_binary_double)2.812 E F1 .312
-(inserts a double value into the \214r)2.812 F .312
-(st eight bytes pointed to by *b)-.1 F(uf)-.2 E(fer)-.18 E(.)-1.11 E
-(If the boolean swapped is true)108 168 Q 2.5(,t)-.1 G(he byte or)-2.5 E
-(der of value is swapped.)-.37 E
-(---------------------------------------------------------)108 192 Q
-(int)108 204 Q F2(mb_get_bounds)2.5 E F1(\()A -.15(ch)180 216 S(ar *te)
-.15 E(xt,)-.2 E(double *bounds\);)180 228 Q 1.776(The function)108 252 R
-F2(mb_get_bounds)4.276 E F1(par)4.276 E 1.776(ses the string *te)-.1 F
-1.776(xt and e)-.2 F(xtr)-.2 E 1.776(acts g)-.15 F(eo)-.1 E(gr)-.1 E
-1.776(aphic bounds of a r)-.15 F(ectangular)-.37 E -.37(re)108 264 S
-(gion in the form:)-.03 E(bounds[0]: minimum longitude)180 276 Q
-(bounds[1]: maximum longitude)180 288 Q(bounds[2]: minimum latitude)180
-300 Q(bounds[3]: maximum latitude)180 312 Q(wher)108 324 Q 2.996(e*)-.37
-G(te)-2.996 E .496(xt is in the standar)-.2 F(d)-.37 E F2(GMT)2.995 E F1
-.495(bounds form.)2.995 F .495(The longitude and latitude values in *te)
-5.495 F .495(xt should sepa-)-.2 F -.15(ra)108 336 S 1.236
-(ted by a '/' c).15 F(har)-.15 E(acter)-.15 E 3.737(,a)-1.11 G 1.237
-(nd individual values may be r)-3.737 F(epr)-.37 E 1.237
-(esented in decimal de)-.37 F(gr)-.4 E 1.237(ees or in "dd:mm:ss")-.37 F
-(form \(dd=de)108 348 Q(gr)-.4 E(ees, mm=minutes, ss=seconds\).)-.37 E
-(double)108 372 Q F2(mb_ddmmss_to_degr)2.5 E(ee)-.18 E F1(\()A -.15(ch)
-180 384 S(ar *te).15 E(xt\);)-.2 E .754(The function)108 408 R F2
-(mb_ddmmss_to_degr)3.253 E(ee)-.18 E F1(par)3.253 E .753
-(ses the string *te)-.1 F .753(xt and e)-.2 F(xtr)-.2 E .753
-(acts a decimal longitude or latitude)-.15 F(value fr)108 420 Q
-(om a "dd:mm:ss" \(dd=de)-.45 E(gr)-.4 E
-(ees, mm=minutes, ss=seconds\) value)-.37 E(.)-.15 E
-(---------------------------------------------------------)108 444 Q
-(int)108 456 Q F2(mb_tak)2.5 E(eoff_to_r)-.1 E(ollpitch)-.18 E F1(\()A
-(int verbose)180 468 Q(,)-.1 E(double theta,)180 480 Q(double phi,)180
-492 Q(double *alpha,)180 504 Q(double *beta,)180 516 Q(int *err)180 528
-Q(or\);)-.45 E .979(The function)108 552 R F2(mb_tak)3.479 E(eoff_to_r)
--.1 E(ollpitch)-.18 E F1(tr)3.479 E .979(anslates angles fr)-.15 F .979
-(om the "tak)-.45 F(eof)-.1 E .979(f" coor)-.18 F .979(dinate r)-.37 F
-(efer)-.37 E .979(ence fr)-.37 F .98(ame to)-.15 F(the "r)108 564 Q
-(ollpitc)-.45 E(h" coor)-.15 E(dinate system.)-.37 E
-(See the discussion of coor)5 E(dinate systems below)-.37 E(.)-.74 E
-(---------------------------------------------------------)108 588 Q
-(int)108 600 Q F2(mb_r)2.5 E(ollpitch_to_tak)-.18 E(eoff)-.1 E F1(\()A
-(int verbose)180 612 Q(,)-.1 E(double alpha,)180 624 Q(double beta,)180
-636 Q(double *theta,)180 648 Q(double *phi,)180 660 Q(int *err)180 672 Q
-(or\);)-.45 E .351(The function)108 696 R F2(mb_r)2.851 E
-(ollpitch_to_tak)-.18 E(eoff)-.1 E F1(tr)2.851 E .351
-(anslates angles fr)-.15 F .351(om the "r)-.45 F(ollpitc)-.45 E .351
-(h" coor)-.15 F .351(dinate r)-.37 F(efer)-.37 E .351(ence fr)-.37 F .35
-(ame to)-.15 F(the "tak)108 708 Q(eof)-.1 E(f" coor)-.18 E
-(dinate system.)-.37 E(See the discussion of coor)5 E
-(dinate systems below)-.37 E(.)-.74 E F0(MB-System 5.0)72 768 Q
-(26 October 2009)137.055 E(60)190.395 E 0 Cg EP
-%%Page: 61 61
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F/F1 10/Times-Italic at 0 SF
-(---------------------------------------------------------)108 84 Q(int)
-108 96 Q/F2 10/Times-Bold at 0 SF(mb_double_compar)2.5 E(e)-.18 E F1
-(\(double *a,)A(double *b\);)180 108 Q .321(The function)108 132 R F2
-(mb_double_compar)2.821 E(e)-.18 E F1 .321(is used with the)2.821 F F2
-(qsort)2.821 E F1 2.821(function. This)2.821 F .321(function r)2.821 F
-.321(eturns 1 if a > b and -1)-.37 F(if a <= b)108 144 Q(.)-.4 E
-(---------------------------------------------------------)108 168 Q
-(int)108 180 Q F2(mb_int_compar)2.5 E(e)-.18 E F1(\()A(int *a,)180 192 Q
-(int *b\);)180 204 Q .373(The function)108 228 R F2(mb_int_compar)2.873
-E(e)-.18 E F1 .373(is used with the)2.873 F F2(qsort)2.873 E F1 2.873
-(function. This)2.873 F .372(function r)2.873 F .372
-(eturns 1 if a > b and -1 if a)-.37 F(<= b)108 240 Q(.)-.4 E/F3 10.95
-/Times-Bold at 0 SF(COORDIN)72 268.8 Q -1.04(AT)-.219 G 2.738(ES)1.04 G
-(YSTEMS USED IN MB-SYSTEM)-2.738 E F0(I. Introduction)108 280.8 Q .93
-(The coordinate systems described belo)108 292.8 R 3.43(wa)-.25 G .93
-(re used within)-3.43 F F2(MB-System)3.43 E F0 .93(for calculations in)
-3.43 F -.2(vo)-.4 G .93(lving the loca-).2 F .367(tion in space of dept\
-h, amplitude, or sidescan data. In all cases the origin of the coordina\
-te system is at the)108 304.8 R(center of the sonar transducers.)108
-316.8 Q(II. Cartesian Coordinates)108 340.8 Q .84
-(The cartesian coordinate system used in)108 352.8 R F2(MB-System)3.34 E
-F0 .841(is a bit odd because it is left-handed, as opposed to)3.34 F
-.721(the right-handed x-y-z space con)108 364.8 R -.15(ve)-.4 G .721
-(ntionally used in most circumstances. W).15 F .72
-(ith respect to the sonar \(or the)-.4 F .022
-(ship on which the sonar is mounted\), the x-axis is athw)108 376.8 R
-.022(artships with positi)-.1 F .322 -.15(ve t)-.25 H 2.522(os).15 G
-.022(tarboard \(to the right if f)-2.522 F(ac-)-.1 E(ing forw)108 388.8
-Q(ard\), the y-axis is fore-aft with positi)-.1 E .3 -.15(ve f)-.25 H
-(orw).15 E(ard, and the z-axis is positi)-.1 E .3 -.15(ve d)-.25 H -.25
-(ow).15 G(n.).25 E(III. Spherical Coordinates)108 412.8 Q .594
-(There are tw)108 424.8 R 3.094(on)-.1 G .594
-(on-traditional spherical coordinate systems used in)-3.094 F F2
-(MB-System)3.093 E F0 3.093(.T)C .593(he \214rst, referred to here)
--3.093 F .202(as tak)108 436.8 R(eof)-.1 E 2.702(fa)-.25 G .202
-(ngle coordinates, is useful for raytracing.)-2.702 F .202
-(The second, referred to here as roll-pitch coordinates,)5.202 F
-(is useful for taking account of corrections to roll and pitch angles.)
-108 448.8 Q(III.1. T)108 472.8 Q(ak)-.8 E(eof)-.1 E 2.5(fA)-.25 G
-(ngle Coordinates)-2.5 E .82(The three parameters are r)108 496.8 R 3.32
-(,t)-.4 G .819(heta, and phi, where r is the distance from the origin, \
-theta is the angle from)-3.32 F -.15(ve)108 508.8 S .027(rtical do).15 F
-.027(wn \(that is, from the positi)-.25 F .327 -.15(ve z)-.25 H .027
-(-axis\), and phi is the angle from acrosstrack \(the positi).15 F .328
--.15(ve x)-.25 H .028(-axis\) in).15 F .38(the x-y plane.)108 520.8 R
-.38(Note that theta is al)5.38 F -.1(wa)-.1 G .38(ys positi).1 F -.15
-(ve)-.25 G 2.88(;t).15 G .379(he direction in the x-y plane is gi)-2.88
-F -.15(ve)-.25 G 2.879(nb).15 G 2.879(yp)-2.879 G 2.879(hi. Raytracing)
--2.879 F 1.004(is simple in these coordinates because the ray tak)108
-532.8 R(eof)-.1 E 3.505(fa)-.25 G 1.005(ngle is just theta. Ho)-3.505 F
-(we)-.25 E -.15(ve)-.25 G 1.805 -.4(r, a).15 H 1.005
-(pplying roll or pitch).4 F
-(corrections is complicated because roll and pitch ha)108 544.8 Q .3
--.15(ve c)-.2 H(omponents in both theta and phi.).15 E 2.5(0<)144 568.8
-S 2.5(=t)-2.5 G(heta <= PI/2)-2.5 E(-PI/2 <= phi <= 3*PI/2)144 580.8 Q
-2.5(x=r)144 604.8 S(SIN\(theta\)COS\(phi\))-2.5 E 2.5(y=r)144 616.8 S
-(SIN\(theta\)SIN\(phi\))-2.5 E 2.5(z=r)144 628.8 S(COS\(theta\))-2.5 E
-(theta = 0)144 652.8 Q(---> v)10 E(ertical, along positi)-.15 E .3 -.15
-(ve z)-.25 H(-axis).15 E(theta = PI/2 ---> horizontal, in x-y plane)144
-664.8 Q(phi = -PI/2)144 676.8 Q(---> aft, in y-z plane with y ne)5 E
--.05(ga)-.15 G(ti).05 E -.15(ve)-.25 G(phi = 0)144 688.8 Q
-(---> port, in x-z plane with x positi)15 E -.15(ve)-.25 G(phi = PI/2)
-144 700.8 Q(---> forw)7.5 E(ard, in y-z plane with y positi)-.1 E -.15
-(ve)-.25 G(phi = PI)144 712.8 Q(---> starboard, in x-z plane with x ne)
-12.5 E -.05(ga)-.15 G(ti).05 E -.15(ve)-.25 G
-(phi = 3*PI/2 ---> aft, in y-z plane with y ne)144 724.8 Q -.05(ga)-.15
-G(ti).05 E -.15(ve)-.25 G(MB-System 5.0)72 768 Q(26 October 2009)137.055
-E(61)190.395 E 0 Cg EP
-%%Page: 62 62
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F(III.2. Roll-Pitch Coordinates)108 84 Q .636
-(The three parameters are r)108 108 R 3.136(,a)-.4 G .636(lpha, and bet\
-a, where r is the distance from the origin, alpha is the angle for)
--3.136 F(-)-.2 E -.1(wa)108 120 S .222(rd \(ef).1 F(fecti)-.25 E -.15
-(ve)-.25 G .223(ly pitch angle\), and beta is the angle from horizontal\
- in the x-z plane \(ef).15 F(fecti)-.25 E -.15(ve)-.25 G .223
-(ly roll angle\).).15 F .414(Applying a roll or pitch correction is sim\
-ple in these coordinates because pitch is just alpha and roll is just)
-108 132 R 1.3(beta. Ho)108 144 R(we)-.25 E -.15(ve)-.25 G 2.1 -.4(r, r)
-.15 H 1.3(aytracing is complicated because de\215ection from v).4 F 1.3
-(ertical has components in both alpha)-.15 F(and beta.)108 156 Q
-(-PI/2 <= alpha <= PI/2)144 180 Q 2.5(0<)144 192 S 2.5(=b)-2.5 G
-(eta <= PI)-2.5 E 2.5(x=r)144 216 S(COS\(alpha\)COS\(beta\))-2.5 E 2.5
-(y=r)144 228 S(SIN\(alpha\))-2.5 E 2.5(z=r)144 240 S
-(COS\(alpha\)SIN\(beta\))-2.5 E
-(alpha = -PI/2 ---> horizontal, in x-y plane with y ne)144 264 Q -.05
-(ga)-.15 G(ti).05 E -.15(ve)-.25 G(alpha = 0)144 276 Q(---> ship le)12.5
-E -.15(ve)-.25 G(l, zero pitch, in x-z plane).15 E(alpha = PI/2)144 288
-Q(---> horizontal, in x-y plane with y positi)5 E -.15(ve)-.25 G
-(beta = 0)144 300 Q(---> starboard, along positi)15 E .3 -.15(ve x)-.25
-H(-axis).15 E(beta = PI/2)144 312 Q(---> in y-z plane rotated by alpha)
-7.5 E(beta = PI)144 324 Q(---> port, along ne)12.5 E -.05(ga)-.15 G(ti)
-.05 E .3 -.15(ve x)-.25 H(-axis).15 E(IV)108 348 Q 2.5(.S)-1.29 G
-(eaBeam Coordinates)-2.5 E .099(The per)108 372 R .098
-(-beam parameters in the SB2100 data format include angle-from-v)-.2 F
-.098(ertical and angle-forw)-.15 F .098(ard. Angle-)-.1 F(from-v)108 384
-Q .134(ertical is the same as theta e)-.15 F .135
-(xcept that it is signed based on the acrosstrack direction \(positi)
--.15 F .435 -.15(ve t)-.25 H 2.635(os).15 G(tar)-2.635 E(-)-.2 E 1.441
-(board, ne)108 396 R -.05(ga)-.15 G(ti).05 E 1.741 -.15(ve t)-.25 H
-3.941(op).15 G 1.441(ort\). The angle-forw)-3.941 F 1.441(ard v)-.1 F
-1.441(alues are also de\214ned slightly dif)-.25 F 1.44
-(ferently from phi, in that)-.25 F(angle-forw)108 408 Q .757
-(ard is signed dif)-.1 F .758(ferently on the port and starboard sides.\
- The SeaBeam 2100 External Interf)-.25 F(ace)-.1 E .474(Speci\214cation\
-s document includes both discussion and \214gures illustrating the angl\
-e-forw)108 420 R .474(ard v)-.1 F .474(alue. T)-.25 F 2.974(os)-.8 G
-(um-)-2.974 E(marize:)108 432 Q(Port:)118 456 Q(theta = absolute v)144
-480 Q(alue of angle-from-v)-.25 E(ertical)-.15 E(-PI/2 <= phi <= PI/2)
-144 504 Q(is equi)144 516 Q -.25(va)-.25 G(lent to).25 E
-(-PI/2 <= angle-forw)144 528 Q(ard <= PI/2)-.1 E
-(phi = -PI/2 ---> angle-forw)144 552 Q(ard = -PI/2 \(aft\))-.1 E
-(phi = 0)144 564 Q(---> angle-forw)12.5 E(ard = 0)-.1 E(\(starboard\))
-12.5 E(phi = PI/2)144 576 Q(---> angle-forw)5 E(ard = PI/2)-.1 E(\(forw)
-5 E(ard\))-.1 E(Starboard:)118 600 Q(theta = angle-from-v)144 624 Q
-(ertical)-.15 E(PI/2 <= phi <= 3*PI/2)144 648 Q(is equi)144 660 Q -.25
-(va)-.25 G(lent to).25 E(-PI/2 <= angle-forw)144 672 Q(ard <= PI/2)-.1 E
-(phi = PI/2)144 696 Q(---> angle-forw)7.5 E(ard = -PI/2 \(forw)-.1 E
-(ard\))-.1 E(phi = PI)144 708 Q(---> angle-forw)12.5 E(ard = 0)-.1 E
-(\(port\))12.5 E(phi = 3*PI/2 ---> angle-forw)144 720 Q(ard = PI/2)-.1 E
-(\(aft\))5 E(MB-System 5.0)72 768 Q(26 October 2009)137.055 E(62)190.395
-E 0 Cg EP
-%%Page: 63 63
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F 2.58 -1.29(V. U)108 84 T
-(sage of Coordinate Systems in)1.29 E/F1 10/Times-Bold at 0 SF(MB-System)
-2.5 E F0 .598(Some sonar data formats pro)108 108 R .598(vide angle v)
--.15 F .598(alues along with tra)-.25 F -.15(ve)-.2 G 3.098(lt).15 G
-.598(imes. The angles are con)-3.098 F -.15(ve)-.4 G .599(rted to tak)
-.15 F(of)-.1 E(f-)-.25 E .234(angle coordinates re)108 120 R -.05(ga)
--.15 G .234(rdless of the).05 F .233
-(storage form of the particular data format. Currently)5.234 F 2.733(,m)
--.65 G .233(ost data formats)-2.733 F .296
-(do not contain an alongtrack component to the position v)108 132 R .297
-(alues; in these cases the con)-.25 F -.15(ve)-.4 G .297(rsion is tri)
-.15 F .297(vial since)-.25 F .566
-(phi = beta = 0 and theta = alpha. The angle and tra)108 144 R -.15(ve)
--.2 G 3.066(lt).15 G .566(ime v)-3.066 F .565
-(alues can be accessed using the)-.25 F F1(MBIO)3.065 E F0(func-)3.065 E
-(tion)108 156 Q F1(mb_ttimes)2.5 E F0 5(.A)C(ll angle v)-5 E
-(alues passed by)-.25 E F1(MB-System)2.5 E F0(functions are in de)2.5 E
-(grees rather than radians.)-.15 E .37(The programs)108 180 R F1(mb)2.87
-E(bath)-.1 E F0(and)2.87 E F1(mb)2.87 E -.1(ve)-.15 G(locitytool).1 E F0
-.371(use angles in tak)2.87 F(e-of)-.1 E 2.871(fa)-.25 G .371
-(ngle coordinates to do the raytracing. If)-2.871 F .992
-(roll and/or pitch corrections are to be made, the angles are con)108
-192 R -.15(ve)-.4 G .992(rted to roll-pitch coordinates, corrected,).15
-F(and then con)108 204 Q -.15(ve)-.4 G(rted back prior to raytracing.)
-.15 E/F2 10.95/Times-Bold at 0 SF(BEAM FLA)72 244.8 Q(GS USED IN MB-SYSTEM)
--.602 E F1(MB-System)108 256.8 Q F0 .449
-(uses arrays of 1-byte "beam\215ag" v)2.949 F .449
-(alues to indicate beam data quality)-.25 F 2.95(.E)-.65 G .45
-(ach beam\215ag v)-2.95 F .45(alue is)-.25 F .587
-(actually an eight bit mask allo)108 268.8 R .587(wing f)-.25 F .587
-(airly complicated information to be stored re)-.1 F -.05(ga)-.15 G .587
-(rding each bath).05 F(ymetry)-.05 E -.25(va)108 280.8 S .079
-(lue. In particular).25 F 2.579(,b)-.4 G .079
-(eams may be \215agged as bad, the)-2.579 F 2.579(ym)-.15 G .08
-(ay be selected as being of special interest, and one)-2.579 F .604
-(or more reasons for \215agging or selection may be indicated.)108 292.8
-R .603(This scheme is v)5.603 F .603(ery similar to the con)-.15 F -.15
-(ve)-.4 G(ntion).15 E .032(used in the HMPS h)108 304.8 R .032(ydrograp\
-hic data processing package and the SAIC Hydrobat package. The beam sel\
-ec-)-.05 F(tion mechanism is not currently used by an)108 316.8 Q(y)-.15
-E F1(MB-System)2.5 E F0(programs.)2.5 E(The \215ag and select bits:)108
-340.8 Q(xxxxxx00 => This beam is neither \215agged nor selected.)113
-352.8 Q
-(xxxxxx01 => This beam is \215agged as bad and should be ignored.)113
-364.8 Q(xxxxxx10 => This beam has been selected.)113 376.8 Q
-(Flagging modes:)108 400.8 Q(00000001 => Flagged because no detection w)
-113 412.8 Q(as made by the sonar)-.1 E(.)-.55 E
-(xxxxx101 => Flagged by manual editing.)113 424.8 Q
-(xxxx1x01 => Flagged by automatic \214lter)113 436.8 Q(.)-.55 E
-(xxx1xx01 => Flagged because uncertainty e)113 448.8 Q
-(xceeds 1 X IHO standard.)-.15 E
-(xx1xxx01 => Flagged because uncertainty e)113 460.8 Q
-(xceeds 2 X IHO standard.)-.15 E
-(x1xxxx01 => Flagged because footprint is too lar)113 472.8 Q(ge)-.18 E
-(1xxxxx01 => Flagged by sonar as unreliable.)113 484.8 Q
-(Selection modes:)108 508.8 Q
-(00000010 => Selected, no reason speci\214ed.)113 520.8 Q
-(xxxxx110 => Selected as least depth.)113 532.8 Q
-(xxxx1x10 => Selected as a)113 544.8 Q -.15(ve)-.2 G(rage depth.).15 E
-(xxx1xx10 => Selected as maximum depth.)113 556.8 Q
-(xx1xxx10 => Selected as location of sidescan contact.)113 568.8 Q
-(x1xxxx10 => Selected, spare.)113 580.8 Q(1xxxxx10 => Selected, spare.)
-113 592.8 Q F2(SEE ALSO)72 621.6 Q F1(mbsystem)108 633.6 Q F0(\(l\),)A
-F1(mbf)2.5 E(ormat)-.25 E F0(\(l\))A F2 -.11(BU)72 662.4 S(GS).11 E F0
-(What could go wrong in a mere 204,289 lines of code?)108 674.4 Q
-(Let us kno)108 686.4 Q -.65(w.)-.25 G(..).65 E(MB-System 5.0)72 768 Q
-(26 October 2009)137.055 E(63)190.395 E 0 Cg EP
-%%Trailer
-end
-%%EOF
diff --git a/src/ps/Makefile.am b/src/ps/Makefile.am
deleted file mode 100644
index 70e949b..0000000
--- a/src/ps/Makefile.am
+++ /dev/null
@@ -1,81 +0,0 @@
-dist_mbsystemps_DATA = \
-mb7k2jstar.ps \
-mb7k2ss.ps \
-mb7kpreprocess.ps \
-mbabsorption.ps \
-mbareaclean.ps \
-mbauvloglist.ps \
-mbauvnavusbl.ps \
-mbbackangle.ps \
-mbclean.ps \
-mbcontour.ps \
-mbcopy.ps \
-mbctdlist.ps \
-mbdatalist.ps \
-mbdefaults.ps \
-mbdumpesf.ps \
-mbedit.ps \
-mbeditviz.ps \
-mbextractsegy.ps \
-mbfilter.ps \
-mbformat.ps \
-mbgetesf.ps \
-mbgrdtiff.ps \
-mbgrdviz.ps \
-mbgrid.ps \
-mbhistogram.ps \
-mbhsdump.ps \
-mbhysweeppreprocess.ps \
-mbinfo.ps \
-mbio.ps \
-mbkongsbergpreprocess.ps \
-mblevitus.ps \
-mblist.ps \
-mbm_arc2grd.ps \
-mbm_bpr.ps \
-mbm_copy.ps \
-mbm_dslnavfix.ps \
-mbm_fmtvel.ps \
-mbm_grd2arc.ps \
-mbm_grd2geovrml.ps \
-mbm_grd3dplot.ps \
-mbm_grdcut.ps \
-mbm_grdinfo.ps \
-mbm_grdplot.ps \
-mbm_grdtiff.ps \
-mbm_grid.ps \
-mbm_histplot.ps \
-mbm_makedatalist.ps \
-mbm_multicopy.ps \
-mbm_multidatalist.ps \
-mbm_multiprocess.ps \
-mbm_plot.ps \
-mbm_route2mission.ps \
-mbm_stat.ps \
-mbm_utm.ps \
-mbm_vrefcheck.ps \
-mbm_xbt.ps \
-mbm_xyplot.ps \
-mbmosaic.ps \
-mbnavadjust.ps \
-mbnavadjustmerge.ps \
-mbnavedit.ps \
-mbnavlist.ps \
-mbneptune2esf.ps \
-mbotps.ps \
-mbprocess.ps \
-mbps.ps \
-mbrollbias.ps \
-mbrolltimelag.ps \
-mbroutetime.ps \
-mbsegygrid.ps \
-mbsegyinfo.ps \
-mbsegylist.ps \
-mbsegypsd.ps \
-mbset.ps \
-mbstripnan.ps \
-mbsvplist.ps \
-mbswath.ps \
-mbsystem.ps \
-mbtime.ps \
-mbvelocitytool.ps
diff --git a/src/ps/Makefile.in b/src/ps/Makefile.in
deleted file mode 100644
index ac5ba84..0000000
--- a/src/ps/Makefile.in
+++ /dev/null
@@ -1,598 +0,0 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
-
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-
-VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
-am__make_running_with_option = \
-  case $${target_option-} in \
-      ?) ;; \
-      *) echo "am__make_running_with_option: internal error: invalid" \
-              "target option '$${target_option-}' specified" >&2; \
-         exit 1;; \
-  esac; \
-  has_opt=no; \
-  sane_makeflags=$$MAKEFLAGS; \
-  if $(am__is_gnu_make); then \
-    sane_makeflags=$$MFLAGS; \
-  else \
-    case $$MAKEFLAGS in \
-      *\\[\ \	]*) \
-        bs=\\; \
-        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
-          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
-    esac; \
-  fi; \
-  skip_next=no; \
-  strip_trailopt () \
-  { \
-    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
-  }; \
-  for flg in $$sane_makeflags; do \
-    test $$skip_next = yes && { skip_next=no; continue; }; \
-    case $$flg in \
-      *=*|--*) continue;; \
-        -*I) strip_trailopt 'I'; skip_next=yes;; \
-      -*I?*) strip_trailopt 'I';; \
-        -*O) strip_trailopt 'O'; skip_next=yes;; \
-      -*O?*) strip_trailopt 'O';; \
-        -*l) strip_trailopt 'l'; skip_next=yes;; \
-      -*l?*) strip_trailopt 'l';; \
-      -[dEDm]) skip_next=yes;; \
-      -[JT]) skip_next=yes;; \
-    esac; \
-    case $$flg in \
-      *$$target_option*) has_opt=yes; break;; \
-    esac; \
-  done; \
-  test $$has_opt = yes
-am__make_dryrun = (target_option=n; $(am__make_running_with_option))
-am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-subdir = src/ps
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(dist_mbsystemps_DATA)
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
-	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
-	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
-	$(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-	$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/src/mbio/mb_config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-AM_V_P = $(am__v_P_ at AM_V@)
-am__v_P_ = $(am__v_P_ at AM_DEFAULT_V@)
-am__v_P_0 = false
-am__v_P_1 = :
-AM_V_GEN = $(am__v_GEN_ at AM_V@)
-am__v_GEN_ = $(am__v_GEN_ at AM_DEFAULT_V@)
-am__v_GEN_0 = @echo "  GEN     " $@;
-am__v_GEN_1 = 
-AM_V_at = $(am__v_at_ at AM_V@)
-am__v_at_ = $(am__v_at_ at AM_DEFAULT_V@)
-am__v_at_0 = @
-am__v_at_1 = 
-SOURCES =
-DIST_SOURCES =
-am__can_run_installinfo = \
-  case $$AM_UPDATE_INFO_DIR in \
-    n|no|NO) false;; \
-    *) (install-info --version) >/dev/null 2>&1;; \
-  esac
-am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
-am__vpath_adj = case $$p in \
-    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
-    *) f=$$p;; \
-  esac;
-am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
-am__install_max = 40
-am__nobase_strip_setup = \
-  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
-am__nobase_strip = \
-  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
-am__nobase_list = $(am__nobase_strip_setup); \
-  for p in $$list; do echo "$$p $$p"; done | \
-  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
-  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
-    if (++n[$$2] == $(am__install_max)) \
-      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
-    END { for (dir in files) print dir, files[dir] }'
-am__base_list = \
-  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
-  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
-am__uninstall_files_from_dir = { \
-  test -z "$$files" \
-    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
-    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
-         $(am__cd) "$$dir" && rm -f $$files; }; \
-  }
-am__installdirs = "$(DESTDIR)$(mbsystempsdir)"
-DATA = $(dist_mbsystemps_DATA)
-am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-CC = @CC@
-CCAS = @CCAS@
-CCASDEPMODE = @CCASDEPMODE@
-CCASFLAGS = @CCASFLAGS@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DLLTOOL = @DLLTOOL@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GREP = @GREP@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBM = @LIBM@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIBTOOL_DEPS = @LIBTOOL_DEPS@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LTLIBOBJS = @LTLIBOBJS@
-LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
-MAINT = @MAINT@
-MAKEINFO = @MAKEINFO@
-MANIFEST_TOOL = @MANIFEST_TOOL@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-OTPS_DIR = @OTPS_DIR@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_URL = @PACKAGE_URL@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PKG_CONFIG = @PKG_CONFIG@
-PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
-PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-VERSION = @VERSION@
-XDR_LIB = @XDR_LIB@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_AR = @ac_ct_AR@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-fftw_app = @fftw_app@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libGLU_CFLAGS = @libGLU_CFLAGS@
-libGLU_LIBS = @libGLU_LIBS@
-libXm_CFLAGS = @libXm_CFLAGS@
-libXm_LIBS = @libXm_LIBS@
-libdir = @libdir@
-libexecdir = @libexecdir@
-libfftw3_CFLAGS = @libfftw3_CFLAGS@
-libfftw3_LIBS = @libfftw3_LIBS@
-libfftw_CPPFLAGS = @libfftw_CPPFLAGS@
-libfftw_LIBS = @libfftw_LIBS@
-libgmt_CFLAGS = @libgmt_CFLAGS@
-libgmt_CPPFLAGS = @libgmt_CPPFLAGS@
-libgmt_LIBS = @libgmt_LIBS@
-libmotif_CPPFLAGS = @libmotif_CPPFLAGS@
-libmotif_LIBS = @libmotif_LIBS@
-libnetcdf_CFLAGS = @libnetcdf_CFLAGS@
-libnetcdf_CPPFLAGS = @libnetcdf_CPPFLAGS@
-libnetcdf_LIBS = @libnetcdf_LIBS@
-libopengl_CPPFLAGS = @libopengl_CPPFLAGS@
-libopengl_LIBS = @libopengl_LIBS@
-libproj_CFLAGS = @libproj_CFLAGS@
-libproj_CPPFLAGS = @libproj_CPPFLAGS@
-libproj_LIBS = @libproj_LIBS@
-libpsl_CFLAGS = @libpsl_CFLAGS@
-libpsl_LIBS = @libpsl_LIBS@
-localedir = @localedir@
-localstatedir = @localstatedir@
-mandir = @mandir@
-mbsystemdatadir = @mbsystemdatadir@
-mbsystemhtmldir = @mbsystemhtmldir@
-mbsystempsdir = @mbsystempsdir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-dist_mbsystemps_DATA = \
-mb7k2jstar.ps \
-mb7k2ss.ps \
-mb7kpreprocess.ps \
-mbabsorption.ps \
-mbareaclean.ps \
-mbauvloglist.ps \
-mbauvnavusbl.ps \
-mbbackangle.ps \
-mbclean.ps \
-mbcontour.ps \
-mbcopy.ps \
-mbctdlist.ps \
-mbdatalist.ps \
-mbdefaults.ps \
-mbdumpesf.ps \
-mbedit.ps \
-mbeditviz.ps \
-mbextractsegy.ps \
-mbfilter.ps \
-mbformat.ps \
-mbgetesf.ps \
-mbgrdtiff.ps \
-mbgrdviz.ps \
-mbgrid.ps \
-mbhistogram.ps \
-mbhsdump.ps \
-mbhysweeppreprocess.ps \
-mbinfo.ps \
-mbio.ps \
-mbkongsbergpreprocess.ps \
-mblevitus.ps \
-mblist.ps \
-mbm_arc2grd.ps \
-mbm_bpr.ps \
-mbm_copy.ps \
-mbm_dslnavfix.ps \
-mbm_fmtvel.ps \
-mbm_grd2arc.ps \
-mbm_grd2geovrml.ps \
-mbm_grd3dplot.ps \
-mbm_grdcut.ps \
-mbm_grdinfo.ps \
-mbm_grdplot.ps \
-mbm_grdtiff.ps \
-mbm_grid.ps \
-mbm_histplot.ps \
-mbm_makedatalist.ps \
-mbm_multicopy.ps \
-mbm_multidatalist.ps \
-mbm_multiprocess.ps \
-mbm_plot.ps \
-mbm_route2mission.ps \
-mbm_stat.ps \
-mbm_utm.ps \
-mbm_vrefcheck.ps \
-mbm_xbt.ps \
-mbm_xyplot.ps \
-mbmosaic.ps \
-mbnavadjust.ps \
-mbnavadjustmerge.ps \
-mbnavedit.ps \
-mbnavlist.ps \
-mbneptune2esf.ps \
-mbotps.ps \
-mbprocess.ps \
-mbps.ps \
-mbrollbias.ps \
-mbrolltimelag.ps \
-mbroutetime.ps \
-mbsegygrid.ps \
-mbsegyinfo.ps \
-mbsegylist.ps \
-mbsegypsd.ps \
-mbset.ps \
-mbstripnan.ps \
-mbsvplist.ps \
-mbswath.ps \
-mbsystem.ps \
-mbtime.ps \
-mbvelocitytool.ps
-
-all: all-am
-
-.SUFFIXES:
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
-	@for dep in $?; do \
-	  case '$(am__configure_deps)' in \
-	    *$$dep*) \
-	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-	        && { if test -f $@; then exit 0; else break; fi; }; \
-	      exit 1;; \
-	  esac; \
-	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/ps/Makefile'; \
-	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --gnu src/ps/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	@case '$?' in \
-	  *config.status*) \
-	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-	esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-
-mostlyclean-libtool:
-	-rm -f *.lo
-
-clean-libtool:
-	-rm -rf .libs _libs
-install-dist_mbsystempsDATA: $(dist_mbsystemps_DATA)
-	@$(NORMAL_INSTALL)
-	@list='$(dist_mbsystemps_DATA)'; test -n "$(mbsystempsdir)" || list=; \
-	if test -n "$$list"; then \
-	  echo " $(MKDIR_P) '$(DESTDIR)$(mbsystempsdir)'"; \
-	  $(MKDIR_P) "$(DESTDIR)$(mbsystempsdir)" || exit 1; \
-	fi; \
-	for p in $$list; do \
-	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
-	  echo "$$d$$p"; \
-	done | $(am__base_list) | \
-	while read files; do \
-	  echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(mbsystempsdir)'"; \
-	  $(INSTALL_DATA) $$files "$(DESTDIR)$(mbsystempsdir)" || exit $$?; \
-	done
-
-uninstall-dist_mbsystempsDATA:
-	@$(NORMAL_UNINSTALL)
-	@list='$(dist_mbsystemps_DATA)'; test -n "$(mbsystempsdir)" || list=; \
-	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
-	dir='$(DESTDIR)$(mbsystempsdir)'; $(am__uninstall_files_from_dir)
-tags TAGS:
-
-ctags CTAGS:
-
-cscope cscopelist:
-
-
-distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	list='$(DISTFILES)'; \
-	  dist_files=`for file in $$list; do echo $$file; done | \
-	  sed -e "s|^$$srcdirstrip/||;t" \
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
-	case $$dist_files in \
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
-			   sort -u` ;; \
-	esac; \
-	for file in $$dist_files; do \
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  if test -d $$d/$$file; then \
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
-	    if test -d "$(distdir)/$$file"; then \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
-	  else \
-	    test -f "$(distdir)/$$file" \
-	    || cp -p $$d/$$file "$(distdir)/$$file" \
-	    || exit 1; \
-	  fi; \
-	done
-check-am: all-am
-check: check-am
-all-am: Makefile $(DATA)
-installdirs:
-	for dir in "$(DESTDIR)$(mbsystempsdir)"; do \
-	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
-	done
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
-	if test -z '$(STRIP)'; then \
-	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	      install; \
-	else \
-	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
-	fi
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
-	@echo "This command is intended for maintainers to use"
-	@echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-generic clean-libtool mostlyclean-am
-
-distclean: distclean-am
-	-rm -f Makefile
-distclean-am: clean-am distclean-generic
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am: install-dist_mbsystempsDATA
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am:
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
-	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-generic mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am: uninstall-dist_mbsystempsDATA
-
-.MAKE: install-am install-strip
-
-.PHONY: all all-am check check-am clean clean-generic clean-libtool \
-	cscopelist-am ctags-am distclean distclean-generic \
-	distclean-libtool distdir dvi dvi-am html html-am info info-am \
-	install install-am install-data install-data-am \
-	install-dist_mbsystempsDATA install-dvi install-dvi-am \
-	install-exec install-exec-am install-html install-html-am \
-	install-info install-info-am install-man install-pdf \
-	install-pdf-am install-ps install-ps-am install-strip \
-	installcheck installcheck-am installdirs maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-generic \
-	mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \
-	uninstall-am uninstall-dist_mbsystempsDATA
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/ps/mb7k2jstar.ps b/src/ps/mb7k2jstar.ps
deleted file mode 100644
index 4b25d2d..0000000
--- a/src/ps/mb7k2jstar.ps
+++ /dev/null
@@ -1,539 +0,0 @@
-%!PS-Adobe-3.0
-%%Creator: groff version 1.19.2
-%%CreationDate: Wed Jul  1 12:29:26 2015
-%%DocumentNeededResources: font Times-Roman
-%%+ font Times-Bold
-%%+ font Times-Italic
-%%DocumentSuppliedResources: procset grops 1.19 2
-%%Pages: 5
-%%PageOrder: Ascend
-%%DocumentMedia: Default 612 792 0 () ()
-%%Orientation: Portrait
-%%EndComments
-%%BeginDefaults
-%%PageMedia: Default
-%%EndDefaults
-%%BeginProlog
-%%BeginResource: procset grops 1.19 2
-%!PS-Adobe-3.0 Resource-ProcSet
-/setpacking where{
-pop
-currentpacking
-true setpacking
-}if
-/grops 120 dict dup begin
-/SC 32 def
-/A/show load def
-/B{0 SC 3 -1 roll widthshow}bind def
-/C{0 exch ashow}bind def
-/D{0 exch 0 SC 5 2 roll awidthshow}bind def
-/E{0 rmoveto show}bind def
-/F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def
-/G{0 rmoveto 0 exch ashow}bind def
-/H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/I{0 exch rmoveto show}bind def
-/J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def
-/K{0 exch rmoveto 0 exch ashow}bind def
-/L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/M{rmoveto show}bind def
-/N{rmoveto 0 SC 3 -1 roll widthshow}bind def
-/O{rmoveto 0 exch ashow}bind def
-/P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/Q{moveto show}bind def
-/R{moveto 0 SC 3 -1 roll widthshow}bind def
-/S{moveto 0 exch ashow}bind def
-/T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/SF{
-findfont exch
-[exch dup 0 exch 0 exch neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/MF{
-findfont
-[5 2 roll
-0 3 1 roll
-neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/level0 0 def
-/RES 0 def
-/PL 0 def
-/LS 0 def
-/MANUAL{
-statusdict begin/manualfeed true store end
-}bind def
-/PLG{
-gsave newpath clippath pathbbox grestore
-exch pop add exch pop
-}bind def
-/BP{
-/level0 save def
-1 setlinecap
-1 setlinejoin
-72 RES div dup scale
-LS{
-90 rotate
-}{
-0 PL translate
-}ifelse
-1 -1 scale
-}bind def
-/EP{
-level0 restore
-showpage
-}def
-/DA{
-newpath arcn stroke
-}bind def
-/SN{
-transform
-.25 sub exch .25 sub exch
-round .25 add exch round .25 add exch
-itransform
-}bind def
-/DL{
-SN
-moveto
-SN
-lineto stroke
-}bind def
-/DC{
-newpath 0 360 arc closepath
-}bind def
-/TM matrix def
-/DE{
-TM currentmatrix pop
-translate scale newpath 0 0 .5 0 360 arc closepath
-TM setmatrix
-}bind def
-/RC/rcurveto load def
-/RL/rlineto load def
-/ST/stroke load def
-/MT/moveto load def
-/CL/closepath load def
-/Fr{
-setrgbcolor fill
-}bind def
-/setcmykcolor where{
-pop
-/Fk{
-setcmykcolor fill
-}bind def
-}if
-/Fg{
-setgray fill
-}bind def
-/FL/fill load def
-/LW/setlinewidth load def
-/Cr/setrgbcolor load def
-/setcmykcolor where{
-pop
-/Ck/setcmykcolor load def
-}if
-/Cg/setgray load def
-/RE{
-findfont
-dup maxlength 1 index/FontName known not{1 add}if dict begin
-{
-1 index/FID ne{def}{pop pop}ifelse
-}forall
-/Encoding exch def
-dup/FontName exch def
-currentdict end definefont pop
-}bind def
-/DEFS 0 def
-/EBEGIN{
-moveto
-DEFS begin
-}bind def
-/EEND/end load def
-/CNT 0 def
-/level1 0 def
-/PBEGIN{
-/level1 save def
-translate
-div 3 1 roll div exch scale
-neg exch neg exch translate
-0 setgray
-0 setlinecap
-1 setlinewidth
-0 setlinejoin
-10 setmiterlimit
-[]0 setdash
-/setstrokeadjust where{
-pop
-false setstrokeadjust
-}if
-/setoverprint where{
-pop
-false setoverprint
-}if
-newpath
-/CNT countdictstack def
-userdict begin
-/showpage{}def
-/setpagedevice{}def
-}bind def
-/PEND{
-countdictstack CNT sub{end}repeat
-level1 restore
-}bind def
-end def
-/setpacking where{
-pop
-setpacking
-}if
-%%EndResource
-%%EndProlog
-%%BeginSetup
-%%BeginFeature: *PageSize Default
-<< /PageSize [ 612 792 ] /ImagingBBox null >> setpagedevice
-%%EndFeature
-%%IncludeResource: font Times-Roman
-%%IncludeResource: font Times-Bold
-%%IncludeResource: font Times-Italic
-grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72
-def/PL 792 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron/Zcaron
-/scaron/zcaron/Ydieresis/trademark/quotesingle/Euro/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/space/exclam/quotedbl/numbersign/dollar/percent
-/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen
-/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon
-/semicolon/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O
-/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright/circumflex
-/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y
-/z/braceleft/bar/braceright/tilde/.notdef/quotesinglbase/guillemotleft
-/guillemotright/bullet/florin/fraction/perthousand/dagger/daggerdbl
-/endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut
-/dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash
-/quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen
-/brokenbar/section/dieresis/copyright/ordfeminine/guilsinglleft
-/logicalnot/minus/registered/macron/degree/plusminus/twosuperior
-/threesuperior/acute/mu/paragraph/periodcentered/cedilla/onesuperior
-/ordmasculine/guilsinglright/onequarter/onehalf/threequarters
-/questiondown/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE
-/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex
-/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis
-/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn
-/germandbls/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla
-/egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis
-/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide/oslash
-/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis]def
-/Times-Italic at 0 ENC0/Times-Italic RE/Times-Bold at 0 ENC0/Times-Bold RE
-/Times-Roman at 0 ENC0/Times-Roman RE
-%%EndSetup
-%%Page: 1 1
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 143.17(mb7k2jstar\(1\) MB-System)72 48 R 143.17
-(5.0 mb7k2jstar\(1\))2.5 F/F1 10.95/Times-Bold at 0 SF -.219(NA)72 84 S(ME)
-.219 E/F2 10/Times-Bold at 0 SF(mb7k2jstar)108 96 Q F0 3.104<ad65>3.104 G
-.604(xtracts subbottom pro\214ler and/or sidescan sonar data from Reson\
- 7k format data \214les into)-3.254 F
-(Edgetech Jstar format data \214les.)108 108 Q F1(VERSION)72 136.8 Q F0
--1.11(Ve)108 148.8 S(rsion 5.0)1.11 E F1(SYNOPSIS)72 177.6 Q F2
-(mb7k2jstar)108 189.6 Q F0([)2.698 E F2<ad49>A/F3 10/Times-Italic at 0 SF
-(\214le)A F2<ad41>2.698 E F3(type)A F2<ad42>2.698 E F3(bottompic)A
-(kmode/bottompic)-.2 E(kthr)-.2 E(eshold)-.37 E F2 .199<ad4320ad46>2.699
-F F3(format)A F2<ad4c>2.699 E F3(startline/liner)A(oot)-.45 E F2<ad4d>
-2.699 E<ad4f>108 201.6 Q F3(out\214le)A F2<ad52>2.5 E F3 -.45(ro)C
-(ute\214le).45 E F2(\255X \255H \255V])2.5 E F1(DESCRIPTION)72 230.4 Q
-F2(MB7k2jstar)108 242.4 Q F0 .462(is a utility that e)2.962 F .461(xtra\
-cts Edgetech subbottom pro\214ler and sidescan data from Reson 7k forma\
-t)-.15 F .16(\(MBIO format 88\) data and outputs in the Edgetech Jstar \
-format \(MBIO formats 132 and 133\).)108 254.4 R .16(By def)5.16 F
-(ault,)-.1 E F2(mb7k2jstar)108 266.4 Q F0 -.15(ex)2.942 G .441(tracts a\
-ll channels of sonar data from the Reson 7k \214le to the Edgetech Jsta\
-r \214le.).15 F(Edgetech)5.441 E .042
-(sonar systems may include dual frequenc)108 278.4 R 2.542(ys)-.15 G
-.042(idescans and a subbottom pro\214ler)-2.542 F 2.542(.U)-.55 G .042
-(sers may use the)-2.542 F F2<ad41>2.542 E F0(option)2.542 E 1.722
-(to specify which channels are e)108 290.4 R(xtracted.)-.15 E F2
-(MB7k2jstar)4.221 E F0 1.721
-(operates on single input \214les or on datalists. By)4.221 F(def)108
-302.4 Q .106(ault there will be a separate output \214le for e)-.1 F
--.15(ve)-.25 G .106(ry input \214le, b).15 F .106(ut if the)-.2 F F2
-<ad4f>2.606 E F0 .106(option is used to specify an out-)2.606 F(put \
-\214le, data from all input \214les will be directed to that single out\
-put \214le.)108 314.4 Q 1.093(The e)108 338.4 R 1.093
-(xtracted Jstar data \214le\(s\) can be or)-.15 F -.05(ga)-.18 G 1.093
-(nized three w).05 F 1.093(ays. If the)-.1 F F2<ad4f>3.593 E F0 1.092
-(option is used to specify a single)3.592 F .045(Jstar output \214le, t\
-hen all of the Jstar data will be output to that single \214le. If the)
-108 350.4 R F2<ad52>2.545 E F0 .046(option is used to specify)2.546 F
-2.787(as)108 362.4 S(urv)-2.787 E .587 -.15(ey r)-.15 H .287
-(oute \214le that includes the w).15 F .287(aypoints co)-.1 F -.15(ve)
--.15 G .287(red while collecting the data \214le\(s\) referenced by).15
-F F2<ad49>2.786 E F3(\214le)A F0(,)A .79
-(then the output Jstar data will be brok)108 374.4 R .791
-(en up by the sequential lines de\214ned by the w)-.1 F .791
-(aypoints. In this case)-.1 F 1.951(each output Jstar \214le will be na\
-med using the line root name speci\214ed by)108 386.4 R F2<ad4c>4.45 E
-F3(startline/liner)A(oot)-.45 E F0 1.95(with a)4.45 F .746
-(sequential line number starting from)108 398.4 R F3(startline)3.246 E
-F0 3.246(.I)C 3.246(fn)-3.246 G .746(either the)-3.246 F F2<ad4f>3.246 E
-F0(or)3.247 E F2<ad4c>3.247 E F0 .747(options are used, each input sw)
-3.247 F(ath)-.1 E(\214le will ha)108 410.4 Q .3 -.15(ve a c)-.2 H
-(orresponding Jstar output \214le.).15 E .127(When the user speci\214es\
- that all Edgetech sidescan and subbottom data be e)108 434.4 R .126
-(xtracted b)-.15 F .126(ut does not specify the)-.2 F .784
-(output \214le name, the output \214les will ha)108 446.4 R 1.085 -.15
-(ve t)-.2 H .785(he "*.jsf" suf).15 F .785
-(\214x recognized by Edgetech softw)-.25 F .785(are. If the)-.1 F F2
-<ad41>3.285 E F3(1)A F0 2.037(option is used to specify that only lo)108
-458.4 R 4.537(wf)-.25 G(requenc)-4.537 E 4.536(ys)-.15 G 2.036
-(idescan be e)-4.536 F 2.036(xtracted, the output \214les will ha)-.15 F
-2.336 -.15(ve a)-.2 H(n).15 E .71("*.mb132" suf)108 470.4 R .71
-(\214x. If the)-.25 F F2<ad41>3.21 E F3(1)A F0 .711
-(option is used to specify that only high frequenc)3.21 F 3.211(ys)-.15
-G .711(idescan be e)-3.211 F .711(xtracted, the)-.15 F
-(output \214les will ha)108 482.4 Q .3 -.15(ve a)-.2 H 2.5(n").15 G
-(*.mb133" suf)-2.5 E(\214x.)-.25 E F1 -.548(AU)72 511.2 S(THORSHIP).548
-E F0(Da)108 523.2 Q(vid W)-.2 E 2.5(.C)-.92 G(aress \(caress at mbari.or)
--2.5 E(g\))-.18 E(Montere)113 535.2 Q 2.5(yB)-.15 G
-(ay Aquarium Research Institute)-2.5 E
-(Dale N. Chayes \(dale at ldeo.columbia.edu\))108 547.2 Q
-(Lamont-Doherty Earth Observ)113 559.2 Q(atory)-.25 E F1(OPTIONS)72 588
-Q F2<ad41>108 600 Q F3(mode)23.08 E F0 .888
-(This option sets the types of data to be e)144 612 R .887
-(xtracted and output.)-.15 F(If)5.887 E F2<ad41>3.387 E F3(1)A F0 .887
-(is gi)3.387 F -.15(ve)-.25 G .887(n, then an).15 F 3.387(yl)-.15 G
-1.387 -.25(ow f)-3.387 H(re-).25 E(quenc)144 624 Q 3.554(ys)-.15 G 1.054
-(idescan in the input will be e)-3.554 F 1.054
-(xtracted to the output. If)-.15 F F2<ad41>3.555 E F3(2)A F0 1.055
-(is gi)3.555 F -.15(ve)-.25 G 1.055(n, then an).15 F 3.555(yh)-.15 G
-1.055(igh fre-)-3.555 F(quenc)144 636 Q 3.6(ys)-.15 G 1.1
-(idescan records are e)-3.6 F 3.6(xtracted. The)-.15 F F2<ad41>3.6 E F3
-(3)A F0 1.1(option causes subbottom pro\214ler records to be)3.6 F -.15
-(ex)144 648 S(tracted. Def).15 E
-(ault: All Edgetech sidescan and subbottom pro\214ler records are e)-.1
-E(xtracted.)-.15 E F2<ad42>108 664.8 Q F3(bottompic)23.63 E
-(kmode/bottompic)-.2 E(kthr)-.2 E(eshold)-.37 E F0 .01
-(This option sets the source of the sonar \214rst arri)144 676.8 R -.25
-(va)-.25 G 2.511(lt).25 G .011
-(ime embedded into the Jstar format trace head-)-2.511 F .967
-(ers. This v)144 688.8 R .967
-(alue can be used for laying out sidescan on the sea\215oor)-.25 F 3.466
-(.I)-.55 G(f)-3.466 E F3(bottompic)3.466 E(kmode)-.2 E F0 3.466(=1)3.466
-G 3.466(,t)-3.466 G(hen)-3.466 E F2(mb7k2jstar)144 700.8 Q F0 .671
-(will use the altitude v)3.17 F .671(alue associated with platform na)
--.25 F(vig)-.2 E .671(ation. If)-.05 F F3(bottompic)3.171 E(kmode)-.2 E
-F0(=)3.171 E 1.079(2, then)144 712.8 R F2(mb7k2jstar)3.579 E F0 1.079
-(will e)3.579 F 1.079(xtract the \214rst arri)-.15 F -.25(va)-.25 G
-3.579(lt).25 G 1.079(ime from multibeam bath)-3.579 F 1.078
-(ymetry in the 7k data)-.05 F 1.277(stream. If)144 724.8 R F3(bottompic)
-3.777 E(kmode)-.2 E F0 3.777(=3)3.777 G 3.777(,t)-3.777 G(hen)-3.777 E
-F2(mb7k2jstar)3.777 E F0 1.277(will pick the \214rst arri)3.777 F -.25
-(va)-.25 G 3.778(lt).25 G 1.278(ime in the sidescan)-3.778 F
-(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(1)204.835 E 0
-Cg EP
-%%Page: 2 2
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 143.17(mb7k2jstar\(1\) MB-System)72 48 R 143.17
-(5.0 mb7k2jstar\(1\))2.5 F .008
-(sonar data by looking for the \214rst sample with an amplitude >)144 84
-R/F1 10/Times-Italic at 0 SF(bottompic)2.508 E(kthr)-.2 E(eshold)-.37 E F0
-.008(times the maxi-)2.508 F(mum amplitude in the trace.)144 96 Q(Def)5
-E(ault:)-.1 E F1(bottompic)2.5 E(kmode)-.2 E F0 2.5(=1)2.5 G(.)-2.5 E/F2
-10/Times-Bold at 0 SF<ad43>108 112.8 Q F0 .342(This option causes)144 124.8
-R F2(mb7k2jstar)5.343 E F0 .343(to print out an)2.843 F 2.843(yc)-.15 G
-.343(omment records encountered in the input Reson)-2.843 F(7k data.)144
-136.8 Q F2<ad46>108 153.6 Q F1(format)24.19 E F0 .22(Sets the data form\
-at used if the input is read from stdin or from a \214le. If)144 165.6 R
-F1(format)2.72 E F0 2.72(<0)2.72 G 2.72(,t)-2.72 G .22(hen the input)
--2.72 F .007(\214le speci\214ed with the)144 177.6 R F2<ad49>2.507 E F0
-.008(option will actually contain a list of input sw)2.508 F .008
-(ath sonar data \214les. This pro-)-.1 F
-(gram only reads Reson 7k format data \214les \()144 189.6 Q F2(MBIO)A
-F0(format 88\).)2.5 E F2<ad48>108 206.4 Q F0 .162(This "help" \215ag ca\
-use the program to print out a description of its operation and then e)
-22.52 F .161(xit immedi-)-.15 F(ately)144 218.4 Q(.)-.65 E F2<ad49>108
-235.2 Q F1(in\214le)26.41 E F0 .514(Sets the input \214le path. If)144
-247.2 R F1(format)3.015 E F0 3.015(>0\()3.015 G .515(set with the)-3.015
-F F2<ad66>3.015 E F0 .515(option or)3.015 F F2(mbdefaults)3.015 E F0
-3.015(\)t)C .515(hen the sw)-3.015 F .515(ath sonar)-.1 F .797
-(data contained in)144 259.2 R F1(in\214le)3.297 E F0 .797
-(is read and processed. If)3.297 F F1(format)3.297 E F0 3.297(<0)3.297 G
-3.297(,t)-3.297 G(hen)-3.297 E F1(in\214le)3.297 E F0 .796
-(is assumed to be an ascii)3.297 F .156
-(\214le containing a list of the input sw)144 271.2 R .157
-(ath sonar data \214les to be processed and their formats.)-.1 F .157
-(The pro-)5.157 F .929
-(gram will read the data in each one of these \214les.)144 283.2 R .928
-(In the)5.928 F F1(in\214le)3.428 E F0 .928
-(\214le, each data \214le should be fol-)3.428 F(lo)144 295.2 Q
-(wed by a data format identi\214er)-.25 E 2.5(,e)-.4 G(.g.:)-2.5 E
-(data\214le1 88)180 307.2 Q(data\214le2 88)180 319.2 Q
-(This program only reads Reson 7k format data \214les \()144 331.2 Q F2
-(MBIO)A F0(format 88\).)2.5 E F2<ad4c>108 348 Q F1(startline/liner)23.63
-E(oot)-.45 E F0 .035(This option sets the starting line number and the \
-output \214lename root used when)144 360 R F2<ad52>2.536 E F0 .036
-(is speci\214ed so)2.536 F
-(that data are output according to planned surv)144 372 Q .3 -.15(ey l)
--.15 H(ines. Def).15 E(ault:)-.1 E F1(startline)2.5 E F0 2.5(=1)2.5 G(;)
--2.5 E F1(liner)2.5 E(oot)-.45 E F0 2.5(=")2.5 G(jstar".)-2.5 E F2<ad4d>
-108 388.8 Q F0 .363(This option causes)144 400.8 R F2(mb7k2jstar)2.862 E
-F0 .362(to omit data during turns when e)2.862 F .362
-(xtracting into line \214les according)-.15 F 1.561
-(to a speci\214ed set of w)144 412.8 R 1.561(aypoints \()-.1 F F2<ad52>A
-F0 1.561(option\). The traces will not be output until the heading is)
-4.061 F(within 15 de)144 424.8 Q(grees of the ne)-.15 E(xt surv)-.15 E
-.3 -.15(ey l)-.15 H(ine').15 E 2.5(sb)-.55 G(earing.)-2.5 E F2<ad4f>108
-441.6 Q F0 .576(This option sets the output Edgetech Jstar \()144 453.6
-R F2(MBIO)A F0 .576(format 132/133\) format \214le path.)3.076 F(If)
-5.575 E F2<ad4f>3.075 E F0 .575(is not)3.075 F(in)144 465.6 Q -.2(vo)-.4
-G -.1(ke).2 G .565(d, the output jstar \214lename \(or \214les if a dat\
-alist is being processed\) will be the input sw).1 F(ath)-.1 E .347
-(\214lename with the ".s7k" or ".mb88" suf)144 477.6 R .347
-(\214x replaced by a ne)-.25 F 2.846(ws)-.25 G(uf)-2.846 E 2.846
-(\214x. An)-.25 F .346(".jsf" suf)2.846 F .346(\214x is used when)-.25 F
-1.064(all Edgetech record types are e)144 489.6 R 1.065
-(xtracted to the output, ".mb132" is used when the lo)-.15 F 3.565(wf)
--.25 G(requenc)-3.565 E(y)-.15 E .114(sidescan records are e)144 501.6 R
-.114(xtracted, and ".mb133" is used when the high frequenc)-.15 F 2.613
-(ys)-.15 G .113(idescan records are)-2.613 F -.15(ex)144 513.6 S
-(tracted. The record types to be e).15 E(xtracted are set using the)-.15
-E F2<ad41>2.5 E F0(option.)2.5 E F2<ad52>108 530.4 Q F1 -.45(ro)23.08 G
-(ute\214le).45 E F0 1.002(This option speci\214es an)144 542.4 R F2
-(mbgrdviz)3.502 E F0 1.002(route \214le containing the intended w)3.502
-F 1.002(aypoints of the surv)-.1 F -.15(ey)-.15 G 3.503(.I)-.5 G(f)
--3.503 E F1 -.45(ro)144 554.4 S(ute\214le).45 E F0 .656(is speci\214ed,)
-3.156 F F2(mb7k2jstar)3.156 E F0 .656
-(will output Jstar data in \214les corresponding to the planned sur)
-3.156 F(-)-.2 E .976 -.15(vey l)144 566.4 T 3.176(ines. The).15 F .676
-(output Jstar \214le names will be based on)3.176 F F1(liner)3.177 E
-(oot)-.45 E F0 .677(and will include the line number)3.177 F .167
-(starting with)144 578.4 R F1(starline)2.667 E F0 2.667(,b)C .167
-(oth of which are speci\214ed using the)-2.667 F F2<ad4c>2.666 E F0
-2.666(options. If)2.666 F(neither)2.666 E F2<ad4f>2.666 E F0(nore)2.666
-E F2<ad52>2.666 E F0(are)2.666 E(in)144 590.4 Q -.2(vo)-.4 G -.1(ke).2 G
-.5(d, the output Jstar \214lename \(or \214les if a datalist is being p\
-rocessed\) will be the input sw).1 F(ath)-.1 E 1.12
-(\214lename with an appropriate suf)144 602.4 R 1.119
-(\214x appended \(".jsf" for mix)-.25 F 1.119
-(ed Jstar \214les, ".mb132" for lo)-.15 F 3.619(wf)-.25 G(re-)-3.619 E
-(quenc)144 614.4 Q 2.5(ys)-.15 G
-(idescan only \214les, and ".mb133" for high frequenc)-2.5 E 2.5(ys)-.15
-G(idescan only \214les\).)-2.5 E F2<ad56>108 631.2 Q F0 .753
-(This option increases the v)23.08 F .753(erbosity of)-.15 F F2
-(mb7k2jstar)3.253 E F0 3.254(,c)C .754
-(ausing it to print out messages re)-3.254 F -.05(ga)-.15 G .754
-(rding its).05 F(progress to stdout.)144 643.2 Q F2<ad58>108 660 Q F0
-(This option switches port and starboard sidescan channels.)23.08 E/F3
-10.95/Times-Bold at 0 SF(EXAMPLES)72 688.8 Q F0 .527(Suppose that one has \
-collected a Reson 7k data\214le incorporating multibeam sonar data, sid\
-escan data, and)108 700.8 R
-(subbottom pro\214ler data, and that the \214lename is:)108 712.8 Q
-(20050418_150155.s7k)144 724.8 Q(MB-System 5.0)72 768 Q 2.5(3J)146.495 G
-(une 2013)-2.5 E(2)204.835 E 0 Cg EP
-%%Page: 3 3
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 143.17(mb7k2jstar\(1\) MB-System)72 48 R 143.17
-(5.0 mb7k2jstar\(1\))2.5 F .57(In order to e)108 84 R .57
-(xtract all of the Edgetech sonar data into a Jstar \214le, one can use)
--.15 F/F1 10/Times-Bold at 0 SF(mb7k2jstar)3.07 E F0 .57(with no special)
-3.07 F(ar)108 96 Q(guments:)-.18 E(mb7k2jstar \255I 20040722_152111.s7k)
-144 108 Q(which yields the follo)108 120 Q(wing output:)-.25 E
-(Data records read from: 20050418_150155.s7k)144 144 Q(Surv)156.5 156 Q
--.15(ey)-.15 G 20(:9).15 G(90)-20 E(File Header:)156.5 168 Q(1)7.5 E
-(Blue\214n CTD:)156.5 180 Q(989)7.5 E(Blue\214n Na)156.5 192 Q 5(v: 760)
--.2 F 10(Subbottom: 989)156.5 204 R(Lo)156.5 216 Q 2.5(wS)-.25 G 2.5
-(idescan: 990)-2.5 F(High Sidescan: 989)156.5 228 Q
-(Data records written to: 20050418_150155.jsf)144 240 Q 10
-(Subbottom: 989)156.5 252 R(Lo)156.5 264 Q 2.5(wS)-.25 G 2.5
-(idescan: 990)-2.5 F(High Sidescan: 989)156.5 276 Q(One may also e)108
-300 Q(xtract just the lo)-.15 E 2.5(wf)-.25 G(requenc)-2.5 E 2.5(ys)-.15
-G(idescan by using the)-2.5 E F1<ad41>2.5 E/F2 10/Times-Italic at 0 SF(1)A
-F0(option:)2.5 E(mb7k2jstar \255I 20040722_152111.s7k \255A1)144 312 Q
-(which yields the follo)108 324 Q(wing output:)-.25 E
-(Data records read from: 20050418_150155.s7k)144 348 Q(Surv)156.5 360 Q
--.15(ey)-.15 G 20(:9).15 G(90)-20 E(File Header:)156.5 372 Q(1)7.5 E
-(Blue\214n CTD:)156.5 384 Q(989)7.5 E(Blue\214n Na)156.5 396 Q 5(v: 760)
--.2 F 10(Subbottom: 989)156.5 408 R(Lo)156.5 420 Q 2.5(wS)-.25 G 2.5
-(idescan: 990)-2.5 F(High Sidescan: 989)156.5 432 Q
-(Data records written to: 20050418_150155.mb132)144 444 Q 10
-(Subbottom: 0)156.5 456 R(Lo)156.5 468 Q 2.5(wS)-.25 G 2.5(idescan: 990)
--2.5 F(High Sidescan: 0)156.5 480 Q(One may also e)108 504 Q
-(xtract just the high frequenc)-.15 E 2.5(ys)-.15 G
-(idescan by using the)-2.5 E F1<ad41>2.5 E F2(2)A F0(option:)2.5 E
-(mb7k2jstar \255I 20040722_152111.s7k \255A2)144 516 Q
-(which yields the follo)108 528 Q(wing output:)-.25 E
-(Data records read from: 20050418_150155.s7k)144 552 Q(Surv)156.5 564 Q
--.15(ey)-.15 G 20(:9).15 G(90)-20 E(File Header:)156.5 576 Q(1)7.5 E
-(Blue\214n CTD:)156.5 588 Q(989)7.5 E(Blue\214n Na)156.5 600 Q 5(v: 760)
--.2 F 10(Subbottom: 989)156.5 612 R(Lo)156.5 624 Q 2.5(wS)-.25 G 2.5
-(idescan: 990)-2.5 F(High Sidescan: 989)156.5 636 Q
-(Data records written to: 20050418_150155.mb132)144 648 Q 10
-(Subbottom: 0)156.5 660 R(Lo)156.5 672 Q 2.5(wS)-.25 G 2.5(idescan: 990)
--2.5 F(High Sidescan: 0)156.5 684 Q(2527 records output to se)144 708 Q
-(gy \214le 20040722_154429.s7k.se)-.15 E(gy)-.15 E(MB-System 5.0)72 768
-Q 2.5(3J)146.495 G(une 2013)-2.5 E(3)204.835 E 0 Cg EP
-%%Page: 4 4
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 143.17(mb7k2jstar\(1\) MB-System)72 48 R 143.17
-(5.0 mb7k2jstar\(1\))2.5 F 1.383(Users may process multiple Reson 7k \
-\214les by inputting a datalist, or list of sw)108 84 R 1.383
-(ath data \214les. All of the)-.1 F -.15(ex)108 96 S .876(tracted data \
-records can be output to a single \214le by specifying the output \214l\
-e with the).15 F/F1 10/Times-Bold at 0 SF<ad4f>3.376 E F0 .876(option. F)
-3.376 F(or)-.15 E -.15(ex)108 108 S(ample, if one has a datalist \214le\
- called datalistp.mb-1 that references three Reson 7k \214les:).15 E
-(20050418_150155p.mb88 88)144 120 Q(20050418_151812p.mb88 88)144 132 Q
-4.085(and one w)108 144 R 4.085(ants all the lo)-.1 F 6.585(wf)-.25 G
-(requenc)-6.585 E 6.584(ys)-.15 G 4.084
-(idescan data collated into a single Jstar data \214le called)-6.584 F
-(20050418_sslo)108 156 Q -.65(w.)-.25 G(mb132, then use the follo).65 E
-(wing command:)-.25 E
-(mb7k2jstar \255A1 \255I datalistp.mb-1 \255O 20050418_sslo)144 168 Q
--.65(w.)-.25 G(mb132).65 E(which yields the follo)108 180 Q
-(wing output:)-.25 E(Data records to e)144 192 Q(xtract:)-.15 E(Lo)156.5
-204 Q 2.5(wS)-.25 G(idescan)-2.5 E
-(Data records read from: 20050418_150155p.mb88)144 228 Q(Surv)156.5 240
-Q -.15(ey)-.15 G 20(:9).15 G(90)-20 E(File Header:)156.5 252 Q(2)7.5 E
-(Blue\214n CTD:)156.5 264 Q(989)7.5 E(Blue\214n Na)156.5 276 Q 5(v: 760)
--.2 F 10(Subbottom: 989)156.5 288 R(Lo)156.5 300 Q 2.5(wS)-.25 G 2.5
-(idescan: 990)-2.5 F(High Sidescan: 989)156.5 312 Q
-(Data records written to: 20050418_sslo)144 324 Q -.65(w.)-.25 G(mb132)
-.65 E 10(Subbottom: 0)156.5 336 R(Lo)156.5 348 Q 2.5(wS)-.25 G 2.5
-(idescan: 990)-2.5 F(High Sidescan: 0)156.5 360 Q
-(Data records read from: 20050418_151812p.mb88)144 384 Q(Surv)156.5 396
-Q -.15(ey)-.15 G 20(:7).15 G(41)-20 E(File Header:)156.5 408 Q(2)7.5 E
-(Blue\214n CTD:)156.5 420 Q(741)7.5 E(Blue\214n Na)156.5 432 Q 5(v: 563)
--.2 F 10(Subbottom: 741)156.5 444 R(Lo)156.5 456 Q 2.5(wS)-.25 G 2.5
-(idescan: 742)-2.5 F(High Sidescan: 741)156.5 468 Q
-(Data records written to: 20050418_sslo)144 480 Q -.65(w.)-.25 G(mb132)
-.65 E 10(Subbottom: 0)156.5 492 R(Lo)156.5 504 Q 2.5(wS)-.25 G 2.5
-(idescan: 742)-2.5 F(High Sidescan: 0)156.5 516 Q -.8(To)144 540 S
-(tal data records read from: 20050418_151812p.mb88).8 E(Surv)156.5 552 Q
--.15(ey)-.15 G 20(:1).15 G(731)-20 E(File Header:)156.5 564 Q(4)7.5 E
-(Blue\214n CTD:)156.5 576 Q(1730)7.5 E(Blue\214n Na)156.5 588 Q 5
-(v: 1323)-.2 F 10(Subbottom: 1730)156.5 600 R(Lo)156.5 612 Q 2.5(wS)-.25
-G 2.5(idescan: 1732)-2.5 F(High Sidescan: 1730)156.5 624 Q -.8(To)144
-636 S(tal data records written to: 20050418_sslo).8 E -.65(w.)-.25 G
-(mb132).65 E 10(Subbottom: 0)156.5 648 R(Lo)156.5 660 Q 2.5(wS)-.25 G
-2.5(idescan: 1732)-2.5 F(High Sidescan: 0)156.5 672 Q/F2 10.95
-/Times-Bold at 0 SF(SEE ALSO)72 700.8 Q F1(mbsystem)108 712.8 Q F0(\(1\),)A
-F1(mbf)2.5 E(ormat)-.25 E F0(\(1\),)A F1(mbinf)2.5 E(o)-.25 E F0(\(1\))A
-(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(4)204.835 E 0
-Cg EP
-%%Page: 5 5
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 143.17(mb7k2jstar\(1\) MB-System)72 48 R 143.17
-(5.0 mb7k2jstar\(1\))2.5 F/F1 10.95/Times-Bold at 0 SF -.11(BU)72 84 S(GS)
-.11 E F0(No doubt.)108 96 Q(MB-System 5.0)72 768 Q 2.5(3J)146.495 G
-(une 2013)-2.5 E(5)204.835 E 0 Cg EP
-%%Trailer
-end
-%%EOF
diff --git a/src/ps/mb7k2ss.ps b/src/ps/mb7k2ss.ps
deleted file mode 100644
index 1ae48eb..0000000
--- a/src/ps/mb7k2ss.ps
+++ /dev/null
@@ -1,637 +0,0 @@
-%!PS-Adobe-3.0
-%%Creator: groff version 1.19.2
-%%CreationDate: Wed Jul  1 12:29:26 2015
-%%DocumentNeededResources: font Times-Roman
-%%+ font Times-Bold
-%%+ font Times-Italic
-%%DocumentSuppliedResources: procset grops 1.19 2
-%%Pages: 5
-%%PageOrder: Ascend
-%%DocumentMedia: Default 612 792 0 () ()
-%%Orientation: Portrait
-%%EndComments
-%%BeginDefaults
-%%PageMedia: Default
-%%EndDefaults
-%%BeginProlog
-%%BeginResource: procset grops 1.19 2
-%!PS-Adobe-3.0 Resource-ProcSet
-/setpacking where{
-pop
-currentpacking
-true setpacking
-}if
-/grops 120 dict dup begin
-/SC 32 def
-/A/show load def
-/B{0 SC 3 -1 roll widthshow}bind def
-/C{0 exch ashow}bind def
-/D{0 exch 0 SC 5 2 roll awidthshow}bind def
-/E{0 rmoveto show}bind def
-/F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def
-/G{0 rmoveto 0 exch ashow}bind def
-/H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/I{0 exch rmoveto show}bind def
-/J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def
-/K{0 exch rmoveto 0 exch ashow}bind def
-/L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/M{rmoveto show}bind def
-/N{rmoveto 0 SC 3 -1 roll widthshow}bind def
-/O{rmoveto 0 exch ashow}bind def
-/P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/Q{moveto show}bind def
-/R{moveto 0 SC 3 -1 roll widthshow}bind def
-/S{moveto 0 exch ashow}bind def
-/T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/SF{
-findfont exch
-[exch dup 0 exch 0 exch neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/MF{
-findfont
-[5 2 roll
-0 3 1 roll
-neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/level0 0 def
-/RES 0 def
-/PL 0 def
-/LS 0 def
-/MANUAL{
-statusdict begin/manualfeed true store end
-}bind def
-/PLG{
-gsave newpath clippath pathbbox grestore
-exch pop add exch pop
-}bind def
-/BP{
-/level0 save def
-1 setlinecap
-1 setlinejoin
-72 RES div dup scale
-LS{
-90 rotate
-}{
-0 PL translate
-}ifelse
-1 -1 scale
-}bind def
-/EP{
-level0 restore
-showpage
-}def
-/DA{
-newpath arcn stroke
-}bind def
-/SN{
-transform
-.25 sub exch .25 sub exch
-round .25 add exch round .25 add exch
-itransform
-}bind def
-/DL{
-SN
-moveto
-SN
-lineto stroke
-}bind def
-/DC{
-newpath 0 360 arc closepath
-}bind def
-/TM matrix def
-/DE{
-TM currentmatrix pop
-translate scale newpath 0 0 .5 0 360 arc closepath
-TM setmatrix
-}bind def
-/RC/rcurveto load def
-/RL/rlineto load def
-/ST/stroke load def
-/MT/moveto load def
-/CL/closepath load def
-/Fr{
-setrgbcolor fill
-}bind def
-/setcmykcolor where{
-pop
-/Fk{
-setcmykcolor fill
-}bind def
-}if
-/Fg{
-setgray fill
-}bind def
-/FL/fill load def
-/LW/setlinewidth load def
-/Cr/setrgbcolor load def
-/setcmykcolor where{
-pop
-/Ck/setcmykcolor load def
-}if
-/Cg/setgray load def
-/RE{
-findfont
-dup maxlength 1 index/FontName known not{1 add}if dict begin
-{
-1 index/FID ne{def}{pop pop}ifelse
-}forall
-/Encoding exch def
-dup/FontName exch def
-currentdict end definefont pop
-}bind def
-/DEFS 0 def
-/EBEGIN{
-moveto
-DEFS begin
-}bind def
-/EEND/end load def
-/CNT 0 def
-/level1 0 def
-/PBEGIN{
-/level1 save def
-translate
-div 3 1 roll div exch scale
-neg exch neg exch translate
-0 setgray
-0 setlinecap
-1 setlinewidth
-0 setlinejoin
-10 setmiterlimit
-[]0 setdash
-/setstrokeadjust where{
-pop
-false setstrokeadjust
-}if
-/setoverprint where{
-pop
-false setoverprint
-}if
-newpath
-/CNT countdictstack def
-userdict begin
-/showpage{}def
-/setpagedevice{}def
-}bind def
-/PEND{
-countdictstack CNT sub{end}repeat
-level1 restore
-}bind def
-end def
-/setpacking where{
-pop
-setpacking
-}if
-%%EndResource
-%%EndProlog
-%%BeginSetup
-%%BeginFeature: *PageSize Default
-<< /PageSize [ 612 792 ] /ImagingBBox null >> setpagedevice
-%%EndFeature
-%%IncludeResource: font Times-Roman
-%%IncludeResource: font Times-Bold
-%%IncludeResource: font Times-Italic
-grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72
-def/PL 792 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron/Zcaron
-/scaron/zcaron/Ydieresis/trademark/quotesingle/Euro/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/space/exclam/quotedbl/numbersign/dollar/percent
-/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen
-/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon
-/semicolon/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O
-/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright/circumflex
-/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y
-/z/braceleft/bar/braceright/tilde/.notdef/quotesinglbase/guillemotleft
-/guillemotright/bullet/florin/fraction/perthousand/dagger/daggerdbl
-/endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut
-/dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash
-/quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen
-/brokenbar/section/dieresis/copyright/ordfeminine/guilsinglleft
-/logicalnot/minus/registered/macron/degree/plusminus/twosuperior
-/threesuperior/acute/mu/paragraph/periodcentered/cedilla/onesuperior
-/ordmasculine/guilsinglright/onequarter/onehalf/threequarters
-/questiondown/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE
-/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex
-/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis
-/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn
-/germandbls/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla
-/egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis
-/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide/oslash
-/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis]def
-/Times-Italic at 0 ENC0/Times-Italic RE/Times-Bold at 0 ENC0/Times-Bold RE
-/Times-Roman at 0 ENC0/Times-Roman RE
-%%EndSetup
-%%Page: 1 1
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 152.61(mb7k2ss\(1\) MB-System)72 48 R 152.61
-(5.0 mb7k2ss\(1\))2.5 F/F1 10.95/Times-Bold at 0 SF -.219(NA)72 84 S(ME)
-.219 E/F2 10/Times-Bold at 0 SF(mb7k2ss)108 96 Q F0 3.671<ad65>3.671 G
-1.171(xtracts sidescan sonar data from Reson 7k format data, bins and l\
-ays the sidescan onto the)-3.821 F(sea\215oor)108 108 Q 2.5(,a)-.4 G
-(nd outputs \214les in the MBF_MBLDEOIH formst \(MBIO format id 71\).)
--2.5 E F1(VERSION)72 136.8 Q F0 -1.11(Ve)108 148.8 S(rsion 5.0)1.11 E F1
-(SYNOPSIS)72 177.6 Q F2(mb7k2ss)108 189.6 Q F0([)5.49 E F2<ad41>A/F3 10
-/Times-Italic at 0 SF(type)A F2<ad42>5.49 E F3(bottompic)A(kmode/bottompic)
--.2 E(kthr)-.2 E(eshold)-.37 E F2 2.99<ad4320ad44>5.49 F F3(interpbins)A
-F2<ad46>5.49 E F3(format)A F2<ad49>5.49 E F3(\214le)A F2<ad4c>5.49 E F3
-(start-)A(line/liner)108 201.6 Q(oot)-.45 E F2<ad4d20ad4f>2.5 E F3
-(out\214le)A F2<ad51>2.5 E F3 -.45(ro)C(utetime\214le).45 E F2<ad52>2.5
-E F3 -.45(ro)C(ute\214le).45 E F2<ad54>2.5 E F3(topo)A(grid\214le)-.1 E
-F2<ad55>2.5 E F3 -.15(ra)C(ng).15 E(ethr)-.1 E(eshold)-.37 E F2
-(\255X \255H \255V])2.5 E F1(DESCRIPTION)72 230.4 Q F2(mb7k2ss)108 242.4
-Q F0 .114(is a utility that e)2.614 F .113(xtracts Edgetech sidescan da\
-ta from Reson 7k format \(MBIO format 88\) data and)-.15 F .087(outputs\
- in the MBF_MBLDEOIH format \(MBIO format 71\). Edgetech sonar systems \
-may include dual fre-)108 254.4 R(quenc)108 266.4 Q 2.846(ys)-.15 G .346
-(idescans and a subbottom pro\214ler)-2.846 F 2.846(.U)-.55 G .346
-(sers may use the)-2.846 F F2<ad41>2.846 E F0 .345
-(option to specify whether lo)2.845 F 2.845(wf)-.25 G(requenc)-2.845 E
-(y)-.15 E .813(or high frequenc)108 278.4 R 3.313(ys)-.15 G .813
-(idescan data are e)-3.313 F .814(xtracted. By def)-.15 F .814(ault, lo)
--.1 F 3.314(wf)-.25 G(requenc)-3.314 E 3.314(ys)-.15 G .814
-(idescan is e)-3.314 F(xtracted.)-.15 E F2(MB7k2ss)5.814 E F0
-(can operate on a single input \214le or on a datalist referencing man)
-108 290.4 Q 2.5(yi)-.15 G(nput \214les.)-2.5 E 1.446(The ra)108 314.4 R
-3.946(ws)-.15 G 1.445(idescan consists of port and starboard channels, \
-each with thousands of samples ordered uni-)-3.946 F 1.155
-(formly in time from the sonar ping.)108 326.4 R F2(MB7k2ss)6.155 E F0
-1.155(outputs a lo)3.655 F 1.155(wer resolution single sidescan sw)-.25
-F 1.155(ath laid out)-.1 F .83(onto the sea\215oor and ordered in pix)
-108 338.4 R .83(els with uniform spacing in acrosstrack distance. T)-.15
-F .83(ypically the output)-.8 F(sw)108 350.4 Q .213(ath will ha)-.1 F
-.513 -.15(ve 4)-.2 H .213(001 sidescan pix).15 F .214
-(els, each representing an a)-.15 F -.15(ve)-.2 G .214(rage of se).15 F
--.15(ve)-.25 G .214(ral ra).15 F 2.714(ws)-.15 G 2.714(amples. T)-2.714
-F 2.714(oa)-.8 G(chie)-2.714 E .514 -.15(ve t)-.25 H(his).15 E .463
-(result, the program calculates the location of each ra)108 362.4 R
-2.963(ws)-.15 G .463(ample, and bins the samples into the output sw)
--2.963 F(ath.)-.1 E .648(By def)108 374.4 R .649(ault, the program uses\
- the sonar altitude and a \215at bottom assumption to calculate the sam\
-ple posi-)-.1 F .388(tions. If a topograph)108 386.4 R 2.888(yg)-.05 G
-.388(rid co)-2.888 F -.15(ve)-.15 G .388(ring the surv).15 F .688 -.15
-(ey a)-.15 H .388(rea is input using the).15 F F2<ad54>2.888 E F0 .387
-(option, then the sample positions)2.888 F .444
-(will be calculated using that topograph)108 398.4 R 2.944(ya)-.05 G
-.445
-(nd the resulting sidescan will be properly located on the sea\215oor)
--2.944 F(\(that is, if the topograph)108 410.4 Q 2.5(yi)-.05 G 2.5(sa)
--2.5 G(ccurate...\).)-2.5 E .264(The method used to determine the sonar\
- altitude is controlled using the)108 434.4 R F2<ad42>2.764 E F0 .264
-(option. By def)2.764 F .264(ault, the program)-.1 F .716
-(will use the altitude v)108 446.4 R .716(alue recorded in the v)-.25 F
-.716(ehicle na)-.15 F(vig)-.2 E .717
-(ation records. Users may also specify use of nadir)-.05 F(bath)108
-458.4 Q 1.495(ymetry from co-recorded multibeam bath)-.05 F(ymetry)-.05
-E 3.995(,o)-.65 G 3.995(rt)-3.995 G 1.495(he altitude can be pick)-3.995
-F 1.495(ed from the \214rst arri)-.1 F -.25(va)-.25 G(l).25 E(observ)108
-470.4 Q(ed in the sidescan data itself.)-.15 E .845(The e)108 494.4 R
-.845(xtracted sidescan data \214le\(s\) can be or)-.15 F -.05(ga)-.18 G
-.846(nized three w).05 F .846(ays.By def)-.1 F .846
-(ault there will be a separate output)-.1 F 1.088(\214le for e)108 506.4
-R -.15(ve)-.25 G 1.088(ry input \214le.).15 F 1.088(If the)6.088 F F2
-<ad4f>3.588 E F0 1.087(option is used to specify a single output \214le\
-, then all of the speci\214ed)3.588 F .812
-(sidescan data will be output to that \214le. If the)108 518.4 R F2
-<ad51>3.313 E F0(or)3.313 E F2<ad52>3.313 E F0 .813
-(option is used to specify a surv)3.313 F 1.113 -.15(ey r)-.15 H .813
-(oute \214le that).15 F .526(includes the w)108 530.4 R .526
-(aypoints co)-.1 F -.15(ve)-.15 G .526
-(red while collecting the data \214le\(s\) referenced by).15 F F2<ad49>
-3.026 E F3(\214le)A F0 3.026(,t)C .526(hen the output sides-)-3.026 F
-.17(can data will be brok)108 542.4 R .17
-(en up by the sequential lines de\214ned by the w)-.1 F .17
-(aypoints. The)-.1 F F2<ad52>2.67 E F0 .17(option requires a route)2.67
-F .211(\214le of the form e)108 554.4 R .211(xported by)-.15 F F2
-(MBgrdviz)2.711 E F0 5.211(.T)C(he)-5.211 E F2<ad51>2.711 E F0 .21
-(option requires a route \214le that includes the time at which)2.711 F
-.248(each w)108 566.4 R .249
-(aypoint is reached in the data; this can be generated from a re)-.1 F
-.249(gular route \214le using)-.15 F F2(mbr)2.749 E(outetime)-.18 E F0
-2.749(.I)C(n)-2.749 E .406
-(either of these cases each output \214le will be named using the)108
-578.4 R .406(line root name speci\214ed by)5.406 F F2<ad4c>2.905 E F3
-(startline/line-)A -.45(ro)108 590.4 S(ot).45 E F0
-(with a sequential line number starting from)2.5 E F3(startline)2.5 E F0
-2.5(.A)C(ll output \214les will ha)-2.5 E .3 -.15(ve a ")-.2 H
-(.mb71" suf).15 E(\214x.)-.25 E(The program)108 614.4 Q F2
-(mbextractsegy)2.5 E F0(is a)2.5 E -.25(va)-.2 G(ilable to e).25 E
-(xtract subbottom pro\214ler data from Reson 7k data.)-.15 E F1 -.548
-(AU)72 643.2 S(THORSHIP).548 E F0(Da)108 655.2 Q(vid W)-.2 E 2.5(.C)-.92
-G(aress \(caress at mbari.or)-2.5 E(g\))-.18 E(Montere)113 667.2 Q 2.5(yB)
--.15 G(ay Aquarium Research Institute)-2.5 E
-(Dale N. Chayes \(dale at ldeo.columbia.edu\))108 679.2 Q
-(Lamont-Doherty Earth Observ)113 691.2 Q(atory)-.25 E(MB-System 5.0)72
-768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(1)204.835 E 0 Cg EP
-%%Page: 2 2
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 152.61(mb7k2ss\(1\) MB-System)72 48 R 152.61
-(5.0 mb7k2ss\(1\))2.5 F/F1 10.95/Times-Bold at 0 SF(OPTIONS)72 84 Q/F2 10
-/Times-Bold at 0 SF<ad41>108 96 Q/F3 10/Times-Italic at 0 SF(mode)23.08 E F0
-.887(This option sets the types of data to be e)144 108 R .887
-(xtracted and output.)-.15 F(If)5.887 E F2<ad41>3.388 E F3(1)A F0 .888
-(is gi)3.388 F -.15(ve)-.25 G .888(n, then an).15 F 3.388(yl)-.15 G
-1.388 -.25(ow f)-3.388 H(re-).25 E(quenc)144 120 Q 3.555(ys)-.15 G 1.055
-(idescan in the input will be e)-3.555 F 1.054
-(xtracted to the output. If)-.15 F F2<ad41>3.554 E F3(2)A F0 1.054
-(is gi)3.554 F -.15(ve)-.25 G 1.054(n, then an).15 F 3.554(yh)-.15 G
-1.054(igh fre-)-3.554 F(quenc)144 132 Q 2.5(ys)-.15 G
-(idescan records are e)-2.5 E 2.5(xtracted. Def)-.15 F(ault: Lo)-.1 E
-2.5(wf)-.25 G(requenc)-2.5 E 2.5(ys)-.15 G(idescan records are e)-2.5 E
-(xtracted.)-.15 E F2<ad42>108 148.8 Q F3(bottompic)23.63 E
-(kmode/bottompic)-.2 E(kthr)-.2 E(eshold)-.37 E F0 1.872
-(This option sets the source of the sonar \214rst arri)144 160.8 R -.25
-(va)-.25 G 4.372(lt).25 G 1.872(ime used for laying out sidescan on the)
--4.372 F(sea\215oor)144 172.8 Q 2.6(.I)-.55 G(f)-2.6 E F3(bottompic)2.6
-E(kmode)-.2 E F0 2.6(=1)2.6 G 2.6(,t)-2.6 G(hen)-2.6 E F2(mb7k2ss)2.6 E
-F0 .1(will use the altitude v)2.6 F .1(alue associated with platform)
--.25 F(na)144 184.8 Q(vig)-.2 E .027(ation. If)-.05 F F3(bottompic)2.527
-E(kmode)-.2 E F0 2.527(=2)2.527 G 2.527(,t)-2.527 G(hen)-2.527 E F2
-(mb7k2ss)2.527 E F0 .027(will e)2.527 F .027(xtract the \214rst arri)
--.15 F -.25(va)-.25 G 2.527(lt).25 G .028(ime from multibeam)-2.527 F
-(bath)144 196.8 Q .523(ymetry in the 7k data stream. If)-.05 F F3
-(bottompic)3.023 E(kmode)-.2 E F0 3.023(=3)3.023 G 3.023(,t)-3.023 G
-(hen)-3.023 E F2(mb7k2ss)3.023 E F0 .523(will pick the \214rst arri)
-3.023 F -.25(va)-.25 G(l).25 E 1.079(time in the sidescan sonar data by\
- looking for the \214rst sample with an amplitude >)144 208.8 R F3
-(bottompic)3.579 E(k-)-.2 E(thr)144 220.8 Q(eshold)-.37 E F0 .614(times\
- the maximum amplitude in the trace. The altitude used will be the a)
-3.114 F -.15(ve)-.2 G .613(rage of the).15 F(\214rst arri)144 232.8 Q
--.25(va)-.25 G 2.5(lt).25 G
-(imes calculated for the port and starboard channels.)-2.5 E(Def)5 E
-(ault: fIbottompickmode)-.1 E F3 2.5(=1)2.5 G(.)-2.5 E F2<ad43>108 249.6
-Q F0 .3(This option causes)144 261.6 R F2(mb7k2ss)5.3 E F0 .301
-(to print out an)2.8 F 2.801(yc)-.15 G .301
-(omment records encountered in the input Reson 7k)-2.801 F(data.)144
-273.6 Q F2<ad44>108 290.4 Q F3(interpbins)23.08 E F0 2.137
-(Causes interpolation o)144 302.4 R -.15(ve)-.15 G 4.637(rg).15 G 2.137
-(aps in the output sidescan resulting from draping the sidescan on)
--4.687 F(topograph)144 314.4 Q 2.761 -.65(y. T)-.05 H(he).65 E F3
-(interpbins)3.961 E F0 -.25(va)3.961 G 1.461(lues sets the maximum g).25
-F 1.462(ap size o)-.05 F -.15(ve)-.15 G 3.962(rw).15 G 1.462
-(hich interpolation will be)-3.962 F(applied.)144 326.4 Q F2<ad46>108
-343.2 Q F3(format)24.19 E F0 .22(Sets the data format used if the input\
- is read from stdin or from a \214le. If)144 355.2 R F3(format)2.72 E F0
-2.72(<0)2.72 G 2.72(,t)-2.72 G .22(hen the input)-2.72 F .007
-(\214le speci\214ed with the)144 367.2 R F2<ad49>2.507 E F0 .008
-(option will actually contain a list of input sw)2.508 F .008
-(ath sonar data \214les. This pro-)-.1 F
-(gram only reads Reson 7k format data \214les \()144 379.2 Q F2(MBIO)A
-F0(format 88\).)2.5 E F2<ad48>108 396 Q F0 .162(This "help" \215ag caus\
-e the program to print out a description of its operation and then e)
-22.52 F .161(xit immedi-)-.15 F(ately)144 408 Q(.)-.65 E F2<ad49>108
-424.8 Q F3(in\214le)26.41 E F0 .514(Sets the input \214le path. If)144
-436.8 R F3(format)3.015 E F0 3.015(>0\()3.015 G .515(set with the)-3.015
-F F2<ad66>3.015 E F0 .515(option or)3.015 F F2(mbdefaults)3.015 E F0
-3.015(\)t)C .515(hen the sw)-3.015 F .515(ath sonar)-.1 F .797
-(data contained in)144 448.8 R F3(in\214le)3.297 E F0 .797
-(is read and processed. If)3.297 F F3(format)3.297 E F0 3.297(<0)3.297 G
-3.297(,t)-3.297 G(hen)-3.297 E F3(in\214le)3.297 E F0 .796
-(is assumed to be an ascii)3.297 F .156
-(\214le containing a list of the input sw)144 460.8 R .157
-(ath sonar data \214les to be processed and their formats.)-.1 F .157
-(The pro-)5.157 F .929
-(gram will read the data in each one of these \214les.)144 472.8 R .928
-(In the)5.928 F F3(in\214le)3.428 E F0 .928
-(\214le, each data \214le should be fol-)3.428 F(lo)144 484.8 Q
-(wed by a data format identi\214er)-.25 E 2.5(,e)-.4 G(.g.:)-2.5 E
-(data\214le1 88)180 496.8 Q(data\214le2 88)180 508.8 Q
-(This program only reads Reson 7k format data \214les \()144 520.8 Q F2
-(MBIO)A F0(format 88\).)2.5 E F2<ad4c>108 537.6 Q F3(startline/liner)
-23.63 E(oot)-.45 E F0 .035(This option sets the starting line number an\
-d the output \214lename root used when)144 549.6 R F2<ad52>2.536 E F0
-.036(is speci\214ed so)2.536 F
-(that data are output according to planned surv)144 561.6 Q .3 -.15
-(ey l)-.15 H(ines. Def).15 E(ault:)-.1 E F3(startline)2.5 E F0 2.5(=1)
-2.5 G(;)-2.5 E F3(liner)2.5 E(oot)-.45 E F0 2.5(=")2.5 G(jstar".)-2.5 E
-F2<ad4d>108 578.4 Q F0 .004(This option causes)144 590.4 R F2(mb7k2ss)
-2.504 E F0 .004(to omit data during turns when e)2.504 F .003
-(xtracting into line \214les according to a)-.15 F .188
-(speci\214ed set of w)144 602.4 R .188(aypoints \()-.1 F F2<ad52>A F0
-.188
-(option\). The traces will not be output until the heading is within 15)
-2.688 F(de)144 614.4 Q(grees of the ne)-.15 E(xt surv)-.15 E .3 -.15
-(ey l)-.15 H(ine').15 E 2.5(sb)-.55 G(earing.)-2.5 E F2<ad4f>108 631.2 Q
-F0 1.78(This option sets the output MBF_LDEOIH \()144 643.2 R F2(MBIO)A
-F0 1.78(format 71\) format \214le path.)4.28 F(If)6.78 E F2<ad4f>4.28 E
-F0 1.78(is not)4.28 F(in)144 655.2 Q -.2(vo)-.4 G -.1(ke).2 G .479(d, t\
-he output \214lename \(or \214lenames if a datalist is being processed\
-\) will be the input sw).1 F(ath)-.1 E 1.079
-(\214lename with the ".s7k" or ".mb88" suf)144 667.2 R 1.079
-(\214x replaced by a ".mb71\) suf)-.25 F 1.078
-(\214x. The record types to be)-.25 F -.15(ex)144 679.2 S
-(tracted are set using the).15 E F2<ad41>2.5 E F0(option.)2.5 E F2<ad51>
-108 696 Q F3 -.45(ro)22.52 G(utetime\214le).45 E F0 1.075
-(This option speci\214es a \214le containing the times that the surv)144
-708 R 1.375 -.15(ey r)-.15 H 1.075(eached the intended w).15 F
-(aypoints.)-.1 E(This te)144 720 Q
-(xt \214le consists of lines of the form:)-.15 E(MB-System 5.0)72 768 Q
-2.5(3J)146.495 G(une 2013)-2.5 E(2)204.835 E 0 Cg EP
-%%Page: 3 3
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 152.61(mb7k2ss\(1\) MB-System)72 48 R 152.61
-(5.0 mb7k2ss\(1\))2.5 F(count w)180 84 Q
-(aypoint longitude latitude heading time_d)-.1 E .327
-(where count is just an inte)144 96 R .327(ger counter starting at 0, w)
--.15 F .327(aypoint is the w)-.1 F .327(aypoint number starting at 0,)
--.1 F .012(longitude and latitude are the w)144 108 R .013
-(aypoint position in decimal de)-.1 F .013
-(grees, heading is the heading in deci-)-.15 F .578(mal de)144 120 R
-.577(grees, and time_d is the unix or epoch time \(time since 00:00:00 \
-January 1, 1970\) in deci-)-.15 F .69(mal seconds that the surv)144 132
-R .99 -.15(ey r)-.15 H .691(eached this w).15 F .691
-(aypoint. This \214le can be generated from an)-.1 F/F1 10/Times-Bold at 0
-SF(mbgrdviz)3.191 E F0 .452(route \214le and surv)144 144 R .752 -.15
-(ey d)-.15 H .452(ata using the program).15 F F1(mbr)2.951 E(outetime)
--.18 E F0 5.451(.I)C(f)-5.451 E/F2 10/Times-Italic at 0 SF -.45(ro)2.951 G
-(utetime\214le).45 E F0 .451(is speci\214ed,)2.951 F F1(mb7k2ss)2.951 E
-F0 .638(will output data in \214les corresponding to the planned surv)
-144 156 R .938 -.15(ey l)-.15 H 3.138(ines. The).15 F .638
-(output \214le names will be)3.138 F .458(based on)144 168 R F2(liner)
-2.958 E(oot)-.45 E F0 .458
-(and will include the line number starting with)2.958 F F2(starline)
-2.957 E F0 2.957(,b)C .457(oth of which are speci-)-2.957 F .266
-(\214ed using the)144 180 R F1<ad4c>2.766 E F0 2.766(options. If)2.766 F
-.266(none of)2.766 F F1<ad4f>2.766 E F0(,)A F1<ad51>2.766 E F0 2.766(,o)
-C(r)-2.766 E F1<ad52>2.766 E F0 .266(are in)2.766 F -.2(vo)-.4 G -.1(ke)
-.2 G .266(d, the output \214lename \(or \214les if a).1 F
-(datalist is being processed\) will be the input sw)144 192 Q
-(ath \214lename with an ".mb71" suf)-.1 E(\214x appended.)-.25 E F1
-<ad52>108 208.8 Q F2 -.45(ro)23.08 G(ute\214le).45 E F0 1.003
-(This option speci\214es an)144 220.8 R F1(mbgrdviz)3.502 E F0 1.002
-(route \214le containing the intended w)3.502 F 1.002
-(aypoints of the surv)-.1 F -.15(ey)-.15 G 3.502(.I)-.5 G(f)-3.502 E F2
--.45(ro)144 232.8 S(ute\214le).45 E F0 .417(is speci\214ed,)2.917 F F1
-(mb7k2ss)2.917 E F0 .417
-(will output sidescan data in \214les corresponding to the planned sur)
-2.917 F(-)-.2 E .846 -.15(vey l)144 244.8 T 3.046(ines. The).15 F .546
-(output \214le names will be based on)3.046 F F2(liner)3.046 E(oot)-.45
-E F0 .546(and will include the line number start-)3.046 F .316(ing with)
-144 256.8 R F2(starline)2.816 E F0 2.816(,b)C .316
-(oth of which are speci\214ed using the)-2.816 F F1<ad4c>2.816 E F0
-2.816(options. If)2.816 F .317(none of)2.816 F F1<ad4f>2.817 E F0(,)A F1
-<ad51>2.817 E F0 2.817(,o)C(r)-2.817 E F1<ad52>2.817 E F0(are)2.817 E
-(in)144 268.8 Q -.2(vo)-.4 G -.1(ke).2 G .631(d, the output \214lename \
-\(or \214les if a datalist is being processed\) will be the input sw).1
-F .63(ath \214le-)-.1 F(name with an ".mb71" suf)144 280.8 Q
-(\214x appended.)-.25 E F1<ad54>108 297.6 Q F2(topo)23.63 E(grid\214le)
--.1 E F0 1.204
-(This option speci\214es a GMT grid \214le containing a topograph)144
-309.6 R 3.705(ym)-.05 G 1.205(odel of the surv)-3.705 F 1.505 -.15(ey a)
--.15 H 1.205(rea. When).15 F -.2(av)144 321.6 S(ailable,)-.05 E F1
-(mb7k2ss)2.98 E F0 2.98(,u)C .48(ses the topograph)-2.98 F 2.979(yt)-.05
-G 2.979(oc)-2.979 G .479(alculate the position of each ra)-2.979 F 2.979
-(ws)-.15 G .479(idescan sample on)-2.979 F 3.116
-(the sea\215oor prior to binning the sample into the sw)144 333.6 R
-3.117(ath data. This method is considerable)-.1 F(impro)144 345.6 Q -.15
-(ve)-.15 G .72(ment o).15 F -.15(ve)-.15 G 3.22(rt).15 G .719
-(he \215at bottom assumption used when topograph)-3.22 F 3.219(yi)-.05 G
-3.219(su)-3.219 G(na)-3.219 E -.25(va)-.2 G .719
-(ilable. The grid \214le).25 F(must contain topograph)144 357.6 Q 2.5
-(y\()-.05 G(positi)-2.5 E .3 -.15(ve u)-.25 H(p\) rather than bath).15 E
-(ymetry \(positi)-.05 E .3 -.15(ve d)-.25 H -.25(ow).15 G(n\).).25 E F1
-<ad55>108 374.4 Q F2 -.15(ra)23.08 G(ng).15 E(ethr)-.1 E(eshold)-.37 E
-F0 .021(If the)144 386.4 R F1<ad52>2.521 E F0 .021
-(option is speci\214ed,)2.521 F F1(mb7k2ss)2.521 E F0 .021
-(breaks up the output into \214les corresponding to surv)2.521 F .322
--.15(ey l)-.15 H(ines).15 E .013(speci\214ed in a route \214le.)144
-398.4 R .012(This option sets the threshold distance in meters used to \
-determine when a)5.013 F -.1(wa)144 410.4 S 1.841
-(ypoint along the route has been reached; the program considers the ne)
-.1 F 1.842(xt w)-.15 F 1.842(aypoint reached)-.1 F .268
-(when the range to the w)144 422.4 R .268(aypoint becomes smaller than)
--.1 F F2 -.15(ra)2.768 G(ng).15 E(ethr)-.1 E(eshold)-.37 E F0 .268
-(and then ceases to decrease.)2.768 F(Def)144 434.4 Q(ault:)-.1 E F2
--.15(ra)2.5 G(ng).15 E(ethr)-.1 E(eshold)-.37 E F0 2.5(=5)2.5 G 2.5(0m)
--2.5 G(.)-2.5 E F1<ad56>108 451.2 Q F0 1.625
-(This option increases the v)23.08 F 1.626(erbosity of)-.15 F F1
-(mb7k2ss)4.126 E F0 4.126(,c)C 1.626(ausing it to print out messages re)
--4.126 F -.05(ga)-.15 G 1.626(rding its).05 F(progress to stdout.)144
-463.2 Q F1<ad57>108 480 Q F2(swathwidth)20.3 E F0 .106
-(This option sets the output sidescan sw)2.606 F .106
-(ath width in meters. By def)-.1 F(ault)-.1 E F1(mb7k2ss)2.605 E F0
-(calcu-)2.605 E(lates the sw)144 492 Q
-(ath width to use all of the samples a)-.1 E -.25(va)-.2 G
-(ilable in the original data.).25 E F1<ad58>108 508.8 Q F0
-(This option switches port and starboard sidescan channels.)23.08 E/F3
-10.95/Times-Bold at 0 SF(EXAMPLES)72 537.6 Q F0 .576(Suppose that we ha)108
-549.6 R .876 -.15(ve c)-.2 H .576(ollected tw).15 F 3.076(oR)-.1 G .577
-(eson 7k data\214les incorporating multibeam sonar data, sidescan data,)
--3.076 F(and subbottom pro\214ler data, and that the \214lenames are:)
-108 561.6 Q(20070809_173212.s7k)128 573.6 Q .228
-(20070809_175133.s7k After running)128 585.6 R F1(mb7kpr)2.728 E(epr)
--.18 E(ocess)-.18 E F0 .228
-(on these \214les to \214x issues and prepare the data)2.728 F
-(for processing, we will ha)108 597.6 Q .3 -.15(ve t)-.2 H .2 -.1(wo a)
-.15 H(dditional \214les named:).1 E(20070809_173212.mb88)128 609.6 Q
-.765(20070809_175133.mb88 After editing the bath)128 621.6 R .765
-(ymetry in the ".mb88" \214les with)-.05 F F1(mbedit)3.265 E F0 3.265
-(,a)C .765(nd running)-3.265 F F1(mbpr)108 633.6 Q(ocess)-.18 E F0 1.4
-(to apply the edits, we will ha)3.9 F 1.7 -.15(ve t)-.2 H 1.6 -.1(wo p)
-.15 H 1.4(rocessed \214les that are, among other uses, suitable for).1 F
-(sidescan e)108 645.6 Q(xtraction:)-.15 E(20070809_173212p.mb88)128
-657.6 Q 2.803(20070809_175133p.mb88 If we ha)128 669.6 R 3.103 -.15
-(ve t)-.2 H 3.004 -.1(wo d).15 H 2.804
-(atalist \214les, one called datalist.mb-1 referencing the).1 F
-(".mb88" \214les with the follo)108 681.6 Q(wing contents:)-.25 E
-(20070809_173212p.mb88 88)128 693.6 Q 1.726(20070809_175133p.mb88 88 an\
-d another called datalistp.mb-1 referencing the \214rst datalist with a)
-128 705.6 R($PR)108 717.6 Q(OCESSED tag:)-.4 E($PR)128 729.6 Q(OCESSED)
--.4 E(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(3)204.835
-E 0 Cg EP
-%%Page: 4 4
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 152.61(mb7k2ss\(1\) MB-System)72 48 R 152.61
-(5.0 mb7k2ss\(1\))2.5 F(datalist.mb-1 \2551 then we can e)128 84 Q
-(xtract the Edgetech sidescan from the processed \214les using:)-.15 E
-(mb7k2ss \255v \255A1 \255B2 \255I datalistp.mb-1 \\)128 96 Q
-(-M \255X \255R MA)144 108 Q(UV_Axial_1v4.rte \255L1/Axial07SS \\)-.55 E
-.064(-T AxialCalderaMB)144 120 R(ARIAllT)-.35 E .064(opo.grd Here the)
--.8 F/F1 10/Times-Bold at 0 SF<ad52>2.564 E F0 .064(option speci\214es an)
-2.564 F F1(MBgrdviz)2.564 E F0 .065(route \214le that w)2.564 F(as)-.1 E
-(follo)108 132 Q 1.429(wed in collecting the data. By using this option\
-, the output sidescan \214les will be brok)-.25 F 1.429(en into lines)
--.1 F 1.262(de\214ned by the route w)108 144 R 1.262(aypoints, and the \
-output \214lenames will be sequentially numbered. The)-.1 F F1<ad54>
-3.762 E F0(option)3.762 E 1.304(speci\214es a topograph)108 156 R 3.804
-(yg)-.05 G 1.304(rid that is used by)-3.804 F F1(mb7k2ss)3.803 E F0
-1.303(to lay out the sidescan on the sea\215oor)3.803 F 3.803(.T)-.55 G
-1.303(he output)-3.803 F(appears as follo)108 168 Q(ws:)-.25 E
-(Program mb7k2ss)128 180 Q -1.11(Ve)144 192 S
-(rsion $Id: mb7k2ss.ps 2252 2015-07-01 19:35:37Z caress $)1.11 E
-(MB-system V)144 204 Q(ersion 5.1.1beta5)-1.11 E(Data records to e)144
-228 Q(xtract:)-.15 E(Lo)156.5 240 Q 2.5(wS)-.25 G(idescan)-2.5 E
-(Sidescan port and starboard e)156.5 252 Q(xchanged)-.15 E
-(Imported 45 w)144 276 Q(aypoints from route \214le: MA)-.1 E
-(UV_Axial_1v4.rte)-.55 E(Grid read:)144 288 Q(Dimensions: 2072 3558)149
-300 Q(Geographic Coordinate System Name: Geographic WGS84)149 312 Q
-(Geographic Coordinate System ID:)149 324 Q(4326)7.5 E 2.5
-(Longitude: 229.926767)149 336 R 2.5(230.060367 0.000065)2.5 F 5
-(Latitude: 45.866667)149 348 R 2.5(46.026700 0.000045)2.5 F
-(Internal Grid Projection Mode:)149 360 Q(0)22.5 E
-(Internal Grid Projection ID:)149 372 Q(epsg4326)27.5 E(Data Read:)144
-384 Q 10(grid_projection_mode: 0)149 396 R 15
-(grid_projection_id: epsg4326)149 408 R(nodata)149 420 Q -.25(va)-.2 G
-32.5(lue: \25510000000.000000).25 F 55(nx: 2072)149 432 R -.15(ny)149
-444 S 57.5(:3).15 G(558)-57.5 E 52.5(min: \2552302.588135)149 456 R 52.5
-(max: \2551382.877319)149 468 R 50(xmin: 229.926767)149 480 R 50
-(xmax: 230.060367)149 492 R 50(ymin: 45.866667)149 504 R 50
-(ymax: 46.026700)149 516 R 55(dx: 0.000065)149 528 R 55(dy: 0.000045)149
-540 R 50(data: 71467008)149 552 R
-(Data records read from: 20070809_173212p.mb88)144 576 Q(Surv)156.5 588
-Q -.15(ey)-.15 G 20(:2).15 G(330)-20 E(File Header:)156.5 600 Q(2)7.5 E
-(Blue\214n CTD:)156.5 612 Q(1152)7.5 E(Blue\214n Na)156.5 624 Q 5
-(v: 942)-.2 F 10(Subbottom: 0)156.5 636 R(Lo)156.5 648 Q 2.5(wS)-.25 G
-2.5(idescan: 2328)-2.5 F(High Sidescan: 0)156.5 660 Q
-(Generating inf \214le for Axial07SS_0001_sslo.mb71)144 684 Q
-(Generating fn)144 696 Q 2.5<768c>-.4 G(le for Axial07SS_0001_sslo.mb71)
--2.5 E(Data records written to: Axial07SS_0001_sslo.mb71)144 720 Q
-(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(4)204.835 E 0
-Cg EP
-%%Page: 5 5
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 152.61(mb7k2ss\(1\) MB-System)72 48 R 152.61
-(5.0 mb7k2ss\(1\))2.5 F(Lo)156.5 84 Q 2.5(wS)-.25 G 2.5(idescan: 2759)
--2.5 F(High Sidescan: 0)156.5 96 Q
-(Generating inf \214le for Axial07SS_0002_sslo.mb71)144 120 Q
-(Generating fn)144 132 Q 2.5<768c>-.4 G(le for Axial07SS_0002_sslo.mb71)
--2.5 E(Data records written to: Axial07SS_0002_sslo.mb71)144 156 Q(Lo)
-156.5 168 Q 2.5(wS)-.25 G 2.5(idescan: 369)-2.5 F(High Sidescan: 0)156.5
-180 Q(Data records read from: 20070809_175133p.mb88)144 204 Q(Surv)156.5
-216 Q -.15(ey)-.15 G 20(:2).15 G(367)-20 E(File Header:)156.5 228 Q(2)
-7.5 E(Blue\214n CTD:)156.5 240 Q(1158)7.5 E(Blue\214n Na)156.5 252 Q 5
-(v: 942)-.2 F 10(Subbottom: 0)156.5 264 R(Lo)156.5 276 Q 2.5(wS)-.25 G
-2.5(idescan: 2367)-2.5 F(High Sidescan: 0)156.5 288 Q
-(Generating inf \214le for Axial07SS_0003_sslo.mb71)144 312 Q
-(Generating fn)144 324 Q 2.5<768c>-.4 G(le for Axial07SS_0003_sslo.mb71)
--2.5 E -.8(To)144 348 S(tal data records read:).8 E(Surv)156.5 360 Q
--.15(ey)-.15 G 20(:4).15 G(697)-20 E(File Header:)156.5 372 Q(4)7.5 E
-(Blue\214n CTD:)156.5 384 Q(2310)7.5 E(Blue\214n Na)156.5 396 Q 5
-(v: 1884)-.2 F 10(Subbottom: 0)156.5 408 R(Lo)156.5 420 Q 2.5(wS)-.25 G
-2.5(idescan: 4695)-2.5 F(High Sidescan: 0)156.5 432 Q -.8(To)146.5 444 S
-(tal data records written:).8 E(Lo)159 456 Q 2.5(wS)-.25 G 2.5
-(idescan: 4160)-2.5 F(High Sidescan: 0)159 468 Q/F1 10.95/Times-Bold at 0
-SF(SEE ALSO)72 496.8 Q/F2 10/Times-Bold at 0 SF(mbsystem)108 508.8 Q F0
-(\(1\),)A F2(mbf)9.812 E(ormat)-.25 E F0(\(1\),)A F2(mbinf)9.812 E(o)
--.25 E F0(\(1\),)A F2(mb7kpr)9.812 E(epr)-.18 E(ocess)-.18 E F0(\(1\),)A
-F2(mb7k2jstar)9.812 E F0(\(1\),)A F2(mbextractsegy)9.812 E F0(\(1\),)A
-F2(mb)108 520.8 Q(backangle)-.1 E F0(\(1\),)A F2(mbpr)2.5 E(ocess)-.18 E
-F0(\(1\))A F1 -.11(BU)72 549.6 S(GS).11 E F0(No doubt.)108 561.6 Q
-(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(5)204.835 E 0
-Cg EP
-%%Trailer
-end
-%%EOF
diff --git a/src/ps/mb7kpreprocess.ps b/src/ps/mb7kpreprocess.ps
deleted file mode 100644
index 79a91dd..0000000
--- a/src/ps/mb7kpreprocess.ps
+++ /dev/null
@@ -1,522 +0,0 @@
-%!PS-Adobe-3.0
-%%Creator: groff version 1.19.2
-%%CreationDate: Wed Jul  1 12:29:26 2015
-%%DocumentNeededResources: font Times-Roman
-%%+ font Times-Bold
-%%+ font Times-Italic
-%%DocumentSuppliedResources: procset grops 1.19 2
-%%Pages: 4
-%%PageOrder: Ascend
-%%DocumentMedia: Default 612 792 0 () ()
-%%Orientation: Portrait
-%%EndComments
-%%BeginDefaults
-%%PageMedia: Default
-%%EndDefaults
-%%BeginProlog
-%%BeginResource: procset grops 1.19 2
-%!PS-Adobe-3.0 Resource-ProcSet
-/setpacking where{
-pop
-currentpacking
-true setpacking
-}if
-/grops 120 dict dup begin
-/SC 32 def
-/A/show load def
-/B{0 SC 3 -1 roll widthshow}bind def
-/C{0 exch ashow}bind def
-/D{0 exch 0 SC 5 2 roll awidthshow}bind def
-/E{0 rmoveto show}bind def
-/F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def
-/G{0 rmoveto 0 exch ashow}bind def
-/H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/I{0 exch rmoveto show}bind def
-/J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def
-/K{0 exch rmoveto 0 exch ashow}bind def
-/L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/M{rmoveto show}bind def
-/N{rmoveto 0 SC 3 -1 roll widthshow}bind def
-/O{rmoveto 0 exch ashow}bind def
-/P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/Q{moveto show}bind def
-/R{moveto 0 SC 3 -1 roll widthshow}bind def
-/S{moveto 0 exch ashow}bind def
-/T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/SF{
-findfont exch
-[exch dup 0 exch 0 exch neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/MF{
-findfont
-[5 2 roll
-0 3 1 roll
-neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/level0 0 def
-/RES 0 def
-/PL 0 def
-/LS 0 def
-/MANUAL{
-statusdict begin/manualfeed true store end
-}bind def
-/PLG{
-gsave newpath clippath pathbbox grestore
-exch pop add exch pop
-}bind def
-/BP{
-/level0 save def
-1 setlinecap
-1 setlinejoin
-72 RES div dup scale
-LS{
-90 rotate
-}{
-0 PL translate
-}ifelse
-1 -1 scale
-}bind def
-/EP{
-level0 restore
-showpage
-}def
-/DA{
-newpath arcn stroke
-}bind def
-/SN{
-transform
-.25 sub exch .25 sub exch
-round .25 add exch round .25 add exch
-itransform
-}bind def
-/DL{
-SN
-moveto
-SN
-lineto stroke
-}bind def
-/DC{
-newpath 0 360 arc closepath
-}bind def
-/TM matrix def
-/DE{
-TM currentmatrix pop
-translate scale newpath 0 0 .5 0 360 arc closepath
-TM setmatrix
-}bind def
-/RC/rcurveto load def
-/RL/rlineto load def
-/ST/stroke load def
-/MT/moveto load def
-/CL/closepath load def
-/Fr{
-setrgbcolor fill
-}bind def
-/setcmykcolor where{
-pop
-/Fk{
-setcmykcolor fill
-}bind def
-}if
-/Fg{
-setgray fill
-}bind def
-/FL/fill load def
-/LW/setlinewidth load def
-/Cr/setrgbcolor load def
-/setcmykcolor where{
-pop
-/Ck/setcmykcolor load def
-}if
-/Cg/setgray load def
-/RE{
-findfont
-dup maxlength 1 index/FontName known not{1 add}if dict begin
-{
-1 index/FID ne{def}{pop pop}ifelse
-}forall
-/Encoding exch def
-dup/FontName exch def
-currentdict end definefont pop
-}bind def
-/DEFS 0 def
-/EBEGIN{
-moveto
-DEFS begin
-}bind def
-/EEND/end load def
-/CNT 0 def
-/level1 0 def
-/PBEGIN{
-/level1 save def
-translate
-div 3 1 roll div exch scale
-neg exch neg exch translate
-0 setgray
-0 setlinecap
-1 setlinewidth
-0 setlinejoin
-10 setmiterlimit
-[]0 setdash
-/setstrokeadjust where{
-pop
-false setstrokeadjust
-}if
-/setoverprint where{
-pop
-false setoverprint
-}if
-newpath
-/CNT countdictstack def
-userdict begin
-/showpage{}def
-/setpagedevice{}def
-}bind def
-/PEND{
-countdictstack CNT sub{end}repeat
-level1 restore
-}bind def
-end def
-/setpacking where{
-pop
-setpacking
-}if
-%%EndResource
-%%EndProlog
-%%BeginSetup
-%%BeginFeature: *PageSize Default
-<< /PageSize [ 612 792 ] /ImagingBBox null >> setpagedevice
-%%EndFeature
-%%IncludeResource: font Times-Roman
-%%IncludeResource: font Times-Bold
-%%IncludeResource: font Times-Italic
-grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72
-def/PL 792 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron/Zcaron
-/scaron/zcaron/Ydieresis/trademark/quotesingle/Euro/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/space/exclam/quotedbl/numbersign/dollar/percent
-/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen
-/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon
-/semicolon/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O
-/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright/circumflex
-/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y
-/z/braceleft/bar/braceright/tilde/.notdef/quotesinglbase/guillemotleft
-/guillemotright/bullet/florin/fraction/perthousand/dagger/daggerdbl
-/endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut
-/dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash
-/quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen
-/brokenbar/section/dieresis/copyright/ordfeminine/guilsinglleft
-/logicalnot/minus/registered/macron/degree/plusminus/twosuperior
-/threesuperior/acute/mu/paragraph/periodcentered/cedilla/onesuperior
-/ordmasculine/guilsinglright/onequarter/onehalf/threequarters
-/questiondown/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE
-/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex
-/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis
-/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn
-/germandbls/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla
-/egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis
-/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide/oslash
-/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis]def
-/Times-Italic at 0 ENC0/Times-Italic RE/Times-Bold at 0 ENC0/Times-Bold RE
-/Times-Roman at 0 ENC0/Times-Roman RE
-%%EndSetup
-%%Page: 1 1
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 122.63(mb7kpreprocess\(1\) MB-System)72 48 R
-122.63(5.0 mb7kpreprocess\(1\))2.5 F/F1 10.95/Times-Bold at 0 SF -.219(NA)
-72 84 S(ME).219 E/F2 10/Times-Bold at 0 SF(mb7kpr)108 96 Q(epr)-.18 E
-(ocess)-.18 E F0 3.381<ad70>3.381 G .881
-(erforms preprocessing of Reson 7k multibeam data in the 7k format \()
--3.381 F F2(MBIO)A F0(format)3.38 E(88\).)108 108 Q F1(VERSION)72 136.8
-Q F0 -1.11(Ve)108 148.8 S(rsion 5.0)1.11 E F1(SYNOPSIS)72 177.6 Q F2
-(mb7kpr)108 189.6 Q(epr)-.18 E(ocess)-.18 E F0([)4.055 E F2 1.555
-<ad4120ad4220ad43>B/F3 10/Times-Italic at 0 SF -.45(ro)C(llbias/pitc).45 E
-(hbias)-.15 E F2<ad44>4.055 E F3(of)A(fx/of)-.18 E(fy[/of)-.18 E
-(fdepth])-.18 E F2<ad46>4.055 E F3(format)A F2<ad49>4.055 E F3(\214le)A
-F2<ad4b>4.055 E F3(klug)A(emode)-.1 E F2<ad4c>4.055 E<ad4d>108 201.6 Q
-F3 -.45(ro)C -.2(ck).45 G(\214le).2 E F2<ad4e>2.5 E F3(ins\214le)A F2
-<ad4f>2.5 E F3(out\214le)A F2<ad50>2.5 E F3(sonar)A(depth\214le)-.37 E
-F2(\255PF)2.5 E F3(\214lterlength/\214lter)A(depth)-.37 E F2<ad54>2.5 E
-F3(timela)A(g)-.1 E F2<ad57>2.5 E F3(dsl\214le)A F2<ad4820ad56>2.5 E F3
-(])A F1(DESCRIPTION)72 230.4 Q F2(mb7kpr)108 242.4 Q(epr)-.18 E(ocess)
--.18 E F0 .761(reads a Reson 7k \(format 88\) \214le, interpolates the \
-asynchronous na)3.261 F(vig)-.2 E .76(ation and attitude)-.05 F .821
-(onto the multibeam data, and writes a ne)108 254.4 R 3.321(w7)-.25 G
-3.321<6b8c>-3.321 G .821
-(le with that information correctly embedded in the multi-)-3.321 F .17
-(beam data. This program can also \214x v)108 266.4 R .169
-(arious problems with 7k data \(early generations of the 6046 datalog-)
--.25 F(ger f)108 278.4 Q
-(ailed to to meet the data format speci\214cation e)-.1 E(xactly\).)-.15
-E F1 -.548(AU)72 307.2 S(THORSHIP).548 E F0(Da)108 319.2 Q(vid W)-.2 E
-2.5(.C)-.92 G(aress \(caress at mbari.or)-2.5 E(g\))-.18 E(Montere)113
-331.2 Q 2.5(yB)-.15 G(ay Aquarium Research Institute)-2.5 E
-(Dale N. Chayes \(dale at ldeo.columbia.edu\))108 343.2 Q
-(Lamont-Doherty Earth Observ)113 355.2 Q(atory)-.25 E F1(OPTIONS)72 384
-Q F2<ad41>108 396 Q F0 1.419(This option causes the program to output m\
-ultibeam records occuring before the \214rst a)144 408 R -.25(va)-.2 G
-(ilable).25 E(na)144 420 Q(vig)-.2 E(ation and attitude data. Normally)
--.05 E 2.5(,t)-.65 G(hese records are ignored.)-2.5 E F2<ad42>108 436.8
-Q F3(mode)23.63 E F0 .968(This option is only rele)144 448.8 R -.25(va)
--.25 G .968(nt to MB).25 F .968(ARI Mapping A)-.35 F .968
-(UV data that includes Edgetech sidescan and)-.55 F .777(subbottom pro\
-\214ler data with multibeam data in a Reson 7k format \214le, and where\
- the sonars are)144 460.8 R .103
-(all synchronized to ping simulataneously)144 472.8 R 2.603(.I)-.65 G(f)
--2.603 E F2<ad42>2.603 E F0 .103(is speci\214ed with)2.603 F F3(mode)
-2.603 E F0 .103(=1, then the multibeam time)B 1.151
-(stamps will be reset to the time stamp v)144 484.8 R 1.151
-(alues of the Edgetech data records. If)-.25 F F2<ad42>3.651 E F0 1.152
-(is gi)3.651 F -.15(ve)-.25 G 3.652(nw).15 G(ith)-3.652 E F3(mode)144
-496.8 Q F0 1.448
-(=2, then the Edgetech data time stamps will be reset to the v)B 1.447
-(alues of the multibeam data)-.25 F 1.215(records. Although the sonar c\
-omputer clocks are supposed to be synchronized, this clock disci-)144
-508.8 R(pline sometimes f)144 520.8 Q(ails.)-.1 E F2<ad43>108 537.6 Q F3
--.45(ro)23.08 G(llbias/pitc).45 E(hbias)-.15 E F0 .122(This option sets\
- the roll and pitch bias of the sonar with respect to the attitude sens\
-or in de)144 549.6 R .121(grees. If)-.15 F .075(speci\214ed, these para\
-meters are applied to the sonar attitude data prior to the calculation \
-of bath)144 561.6 R(ym-)-.05 E(etry from tra)144 573.6 Q -.15(ve)-.2 G
-2.5(lt).15 G(imes and angles.)-2.5 E F2<ad44>108 590.4 Q F3(of)23.08 E
-(fx/of)-.18 E(fz[/of)-.18 E(fdepth])-.18 E F0 .253
-(This option sets horizontal and v)144 602.4 R .252(ertical.distance of)
--.15 F .252(fsets between the v)-.25 F(ehicle')-.15 E 2.752(sd)-.55 G
-.252(epth sensor and the)-2.752 F .366(multibeam recei)144 614.4 R .666
--.15(ve h)-.25 H .366(ead. If speci\214ed, these v).15 F .367
-(alues are used in a le)-.25 F -.15(ve)-.25 G -.2(r-).15 G .367
-(arm calculation to determine).2 F .869(the sonar depth change)144 626.4
-R .869(associated with v)5.869 F .869(ehicle pitch. The)-.15 F F3(of)
-3.369 E(fdepth)-.18 E F0 -.25(va)3.369 G .868
-(lue, if speci\214ed, is a static).25 F(depth of)144 638.4 Q
-(fset to be applied to the v)-.25 E(ehicle depth data.)-.15 E F2<ad46>
-108 655.2 Q F3(format)24.19 E F0 .22(Sets the data format used if the i\
-nput is read from stdin or from a \214le. If)144 667.2 R F3(format)2.72
-E F0 2.72(<0)2.72 G 2.72(,t)-2.72 G .22(hen the input)-2.72 F .008
-(\214le speci\214ed with the)144 679.2 R F2<ad49>2.508 E F0 .008
-(option will actually contain a list of input sw)2.508 F .007
-(ath sonar data \214les. This pro-)-.1 F
-(gram only reads Reson 7k format data \214les \()144 691.2 Q F2(MBIO)A
-F0(format 88\).)2.5 E F2<ad48>108 708 Q F0 .162(This "help" \215ag caus\
-e the program to print out a description of its operation and then e)
-22.52 F .162(xit immedi-)-.15 F(ately)144 720 Q(.)-.65 E(MB-System 5.0)
-72 768 Q(12 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E(1)190.545 E 0 Cg
-EP
-%%Page: 2 2
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 122.63(mb7kpreprocess\(1\) MB-System)72 48 R
-122.63(5.0 mb7kpreprocess\(1\))2.5 F/F1 10/Times-Bold at 0 SF<ad49>108 84 Q
-/F2 10/Times-Italic at 0 SF(in\214le)26.41 E F0 .515
-(Sets the input \214le path. If)144 96 R F2(format)3.015 E F0 3.015
-(>0\()3.015 G .515(set with the)-3.015 F F1<ad66>3.015 E F0 .515
-(option or)3.015 F F1(mbdefaults)3.014 E F0 3.014(\)t)C .514(hen the sw)
--3.014 F .514(ath sonar)-.1 F .796(data contained in)144 108 R F2
-(in\214le)3.296 E F0 .797(is read and processed. If)3.297 F F2(format)
-3.297 E F0 3.297(<0)3.297 G 3.297(,t)-3.297 G(hen)-3.297 E F2(in\214le)
-3.297 E F0 .797(is assumed to be an ascii)3.297 F .157
-(\214le containing a list of the input sw)144 120 R .157
-(ath sonar data \214les to be processed and their formats.)-.1 F .156
-(The pro-)5.156 F .928
-(gram will read the data in each one of these \214les.)144 132 R .929
-(In the)5.929 F F2(in\214le)3.429 E F0 .929
-(\214le, each data \214le should be fol-)3.429 F(lo)144 144 Q
-(wed by a data format identi\214er)-.25 E 2.5(,e)-.4 G(.g.:)-2.5 E
-(data\214le1 88)180 156 Q(data\214le2 88)180 168 Q
-(This program only reads Reson 7k format data \214les \()144 180 Q F1
-(MBIO)A F0(format 88\).)2.5 E F1<ad4b>108 196.8 Q F2(klug)22.52 E(emode)
--.1 E F0 .864(This option causes the program to implement one of the a)
-144 208.8 R -.25(va)-.2 G .863(ilable processing "kluge" \214x).25 F
-.863(es. This)-.15 F .315
-(are unusual steps required to \214x data with particular)144 220.8 R
-2.816(,u)-.4 G .316(nusual problems. Kluge 1 forces)-2.816 F F1(mb7kpr)
-2.816 E(e-)-.18 E(pr)144 232.8 Q(ocess)-.18 E F0 1.546
-(to replace the sonar depth v)4.046 F 1.545(alue with v)-.25 F 1.545
-(alues from v)-.25 F 1.545(ertical depth data records. K)-.15 F 1.545
-(uge 2)-.15 F(forces)144 244.8 Q F1(mb7kpr)2.5 E(epr)-.18 E(ocess)-.18 E
-F0(to zero the initial beam alongtrack distance v)2.5 E(alues.)-.25 E F1
-<ad4c>108 261.6 Q F0 .044
-(This option causes the program to list the timetags of bath)144 273.6 R
-(ymetry)-.05 E 2.545(,s)-.65 G .045(idescan, subbottom, na)-2.545 F(vig)
--.2 E(ation,)-.05 E(and attitude data records.)144 285.6 Q F1<ad4d>108
-302.4 Q F2 -.45(ro)20.86 G -.2(ck).45 G(\214le).2 E F0 1.33
-(The program will read na)144 314.4 R(vig)-.2 E 1.329
-(ation and attitude from the Ste)-.05 F 1.629 -.15(ve R)-.25 H 1.329
-(ock na).15 F(vig)-.2 E 1.329(ation and attitude \214le)-.05 F F2 -.45
-(ro)144 326.4 S -.2(ck).45 G(\214le).2 E F0 .343(and mer)2.843 F .343(g\
-e those data with the multibeam, sidescan, and subbtottom data in the 7\
-k \214le.If a)-.18 F .198(timelag model is speci\214ed using)144 338.4 R
-F1<ad54>2.698 E F2(timela)A(g)-.1 E F0 2.698(,t)C .197
-(he time lag will be applied to the na)-2.698 F(vig)-.2 E .197
-(ation and atti-)-.05 F .81(tude data before mer)144 350.4 R .81
-(ging with the sonar data. The na)-.18 F(vig)-.2 E .81
-(ation and attitude data from)-.05 F F2 -.45(ro)3.31 G -.2(ck).45 G
-(\214le).2 E F0(will)3.31 E 1.387(also be embedded in asynchronous data\
- records in the output 7k format data. An)144 362.4 R 3.887(yp)-.15 G
-(re-e)-3.887 E(xisting)-.15 E(na)144 374.4 Q(vig)-.2 E .349
-(ation data records will be replaced. The similar)-.05 F F1<ad4e>2.849 E
-F2(ins\214le)A F0(and)2.849 E F1<ad57>2.849 E F2(dsl\214le)A F0 .35
-(options cause mer)2.85 F(g-)-.18 E .856(ing of data from MB)144 386.4 R
-.856(ARI A)-.35 F .856(UV log\214les and WHOI DSL na)-.55 F(vig)-.2 E
-.855(ation \214les, respecti)-.05 F -.15(ve)-.25 G(ly).15 E 3.355(.T)
--.65 G .855(he Ste)-3.355 F -.15(ve)-.25 G(Rock na)144 398.4 Q(vig)-.2 E
-(ation and attitude \214le is a te)-.05 E(xt \214le with se)-.15 E -.15
-(ve)-.25 G 2.5(ns).15 G(pace delimited columns:)-2.5 E
-(time_d longitude latitude sonardepth heading roll pitch)180 410.4 Q
-1.444(where time_d is decimal seconds since the start of 1970, longitud\
-e, latitude, heading, roll, and)144 422.4 R(pitch are in decimal de)144
-434.4 Q(grees, and sonardepth is in meters.)-.15 E F1<ad4e>108 451.2 Q
-F2(ins\214le)23.08 E F0 1.127(The program will read na)144 463.2 R(vig)
--.2 E 1.126(ation and attitude from the MB)-.05 F 1.126(ARI A)-.35 F
-1.126(UV na)-.55 F(vig)-.2 E 1.126(ation log \214le)-.05 F F2(ins\214le)
-3.626 E F0 .137(and mer)144 475.2 R .137(ge those data with the multibe\
-am, sidescan, and subbtottom data in the 7k \214le. If a timelag)-.18 F
-.164(model is speci\214ed using)144 487.2 R F1<ad54>2.663 E F2(timela)A
-(g)-.1 E F0 2.663(,t)C .163(he time lag will be applied to the na)-2.663
-F(vig)-.2 E .163(ation and attitude data)-.05 F 1.728(before mer)144
-499.2 R 1.728(ging with the sonar data. The na)-.18 F(vig)-.2 E 1.729
-(ation and attitude data from)-.05 F F2(ins\214le)4.229 E F0 1.729
-(will also be)4.229 F .423
-(embedded in asynchronous data records in the output 7k format data. An)
-144 511.2 R 2.923(yp)-.15 G(re-e)-2.923 E .423(xisting na)-.15 F(vig)-.2
-E(ation)-.05 E(data records will be replaced. MB)144 523.2 Q(ARI A)-.35
-E(UV na)-.55 E(vig)-.2 E(ation \214les are binary and speci\214c to MB)
--.05 E(ARI.)-.35 E F1<ad4f>108 540 Q F2(out\214le)22.52 E F0 1.795
-(This option causes)144 552 R F1(mb7kpr)4.295 E(epr)-.18 E(ocess)-.18 E
-F0 1.795(to output all data to a single \214le speci\214ed as)4.295 F F2
-(out\214le)4.296 E F0 4.296(.B)C(y)-4.296 E(def)144 564 Q
-(ault, the program creates output \214les for each input \214le.)-.1 E
-F1<ad50>108 580.8 Q F2(sonar)24.19 E(depth\214le)-.37 E F0 .534
-(The program will read sonar depth data from)144 592.8 R F2(sonar)3.033
-E(depth\214le)-.37 E F0 .533(and mer)3.033 F .533
-(ge those data with the multi-)-.18 F .097
-(beam, sidescan, and subbtottom data in the 7k \214le.)144 604.8 R(The)
-5.097 E F2(sonar)2.597 E(depth\214le)-.37 E F0 .097(is a te)2.597 F .097
-(xt data \214le containing)-.15 F(tw)144 616.8 Q 2.5(os)-.1 G
-(pace delimited columns:)-2.5 E(time_d sonardepth)180 628.8 Q(where:)144
-640.8 Q(time_d \255 decimal epoch seconds \(since start of 1970\))180
-652.8 Q(sonardepth \255 sonar depth in meters, positi)180 664.8 Q .3
--.15(ve d)-.25 H -.25(ow).15 G(n).25 E F1 15.58(\255PF \255PF)108 681.6
-R F2(\214lterlength/\214lter)A(depth)-.37 E F0 2.18(This option speci\
-\214es Gaussian tapered time domain \214ltering of the)4.68 F .986
-(sonar depth data to be mer)144 693.6 R .986(ged with the surv)-.18 F
-1.286 -.15(ey d)-.15 H .986(ata, re).15 F -.05(ga)-.15 G .986
-(rdless of source.).05 F(The)5.986 E F2(\214lterlength)3.486 E F0 -.25
-(va)3.486 G(lue).25 E .164(speci\214es the \214lter windo)144 705.6 R
-2.664(wl)-.25 G .164(ength in seconds, and the)-2.664 F F2(\214lter)
-2.664 E(depth)-.37 E F0 -.25(va)2.664 G .164
-(lue controls the depths to which).25 F 1.422(\214ltering is applied. T\
-he \214ltered sonar depth is used to depths up to twice the)144 717.6 R
-F2(\214lter)3.923 E(depth)-.37 E F0 -.25(va)3.923 G(lue.).25 E(Belo)144
-729.6 Q 4.787(wt)-.25 G 2.287(hat threshold, the v)-4.787 F 2.287
-(alue used transitions to un\214ltered with an e)-.25 F 2.287
-(xponential taper)-.15 F 4.786(.T)-.55 G(his)-4.786 E(MB-System 5.0)72
-768 Q(12 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E(2)190.545 E 0 Cg EP
-%%Page: 3 3
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 122.63(mb7kpreprocess\(1\) MB-System)72 48 R
-122.63(5.0 mb7kpreprocess\(1\))2.5 F .643(\214ltering is used in tw)144
-84 R 3.143(ow)-.1 G .644(ays. First, one can apply short period smoothi\
-ng of noisy sonar depth at)-3.243 F .567(all by specifying a small)144
-96 R/F1 10/Times-Italic at 0 SF(\214lterlength)3.066 E F0 .566
-(\(e.g. 2 seconds\) and a)3.066 F F1(\214lter)3.066 E(depth)-.37 E F0
--.25(va)3.066 G .566(lue deeper than the v).25 F(ehi-)-.15 E(cle')144
-108 Q 2.845(st)-.55 G .345(rack. Second, when an A)-2.845 F .345
-(UV or R)-.55 F 1.346 -.5(OV i)-.4 H 2.846(so).5 G .346
-(perated at shallo)-2.846 F 2.846(wd)-.25 G .346(epths, the pressure v)
--2.846 F .346(alues used)-.25 F 1.252(to determine depth are af)144 120
-R 1.252(fected by w)-.25 F -2.25 -.2(av e)-.1 H 3.752(sa).2 G 3.752(tt)
--3.752 G 1.252(he sea surf)-3.752 F 1.252
-(ace. In this case, a longer period)-.1 F F1(\214lter)3.751 E(-)-.2 E
-(length)144 132 Q F0 .214(\(e.g. 10 seconds\) and a shallo)2.714 F(wer)
--.25 E F1(\214lter)2.714 E(depth)-.37 E F0 .214
-(\(e.g. 50 meters\) may be used to lessen the arti-)2.714 F -.1(fa)144
-144 S(cts due to surf).1 E(ace swell.)-.1 E/F2 10/Times-Bold at 0 SF<ad53>
-108 160.8 Q F1(sidescansour)24.74 E(ce)-.37 E F0 .61(This option speci\
-\214es the data record type source of the backscatter data used to gene\
-rate pseudo-)144 172.8 R 1.465
-(sidescan data from Reson multibeam sonars. If)144 184.8 R F1
-(sidescansour)3.965 E(ce)-.37 E F0 3.965(=')3.965 G 1.465
-(C' then the sidescan will be)-3.965 F(deri)144 196.8 Q -.15(ve)-.25 G
-3.809(df).15 G 1.309(rom calibrated "snippet" records, if the)-3.809 F
-F1(sidescansour)3.809 E(ce)-.37 E F0 3.808(=')3.809 G 1.308
-(S' then the sidescan will be)-3.808 F(deri)144 208.8 Q -.15(ve)-.25 G
-3.877(df).15 G 1.377(rom "snippet" records. If)-3.877 F F1(sidescansour)
-3.877 E(ce)-.37 E F0 3.877(=')3.877 G 1.377
-(B' then the sidescan will be deri)-3.877 F -.15(ve)-.25 G 3.878(df).15
-G(rom)-3.878 E .954("backscatter" records. The dif)144 220.8 R .953
-(ference is that the "backscatter" records contain port and starboard)
--.25 F 1.679(time series deri)144 232.8 R -.15(ve)-.25 G 4.179(df).15 G
-1.679(rom beams formed with a lar)-4.179 F 1.68
-(ge acrosstrack beamwidth, and the "snippet")-.18 F .909(records contai\
-n short sections of beamformed time series centered on the bottom retur\
-n times in)144 244.8 R(each of the v)144 256.8 Q(alid bath)-.25 E
-(ymetry beams.)-.05 E F2<ad54>108 273.6 Q F1(timela)23.63 E(g)-.1 E F0
-.831(This option speci\214es a)144 285.6 R F1(timela)3.331 E(g)-.1 E F0
--.25(va)3.331 G .831(lue in seconds to be applied to the na).25 F(vig)
--.2 E .832(ation and attitude data)-.05 F 1.067(prior to it being mer)
-144 297.6 R 1.067(ged with the bath)-.18 F(ymetry)-.05 E 3.567(.I)-.65 G
-(f)-3.567 E F1(timela)3.567 E(g)-.1 E F0 1.067(is a v)3.567 F 1.066
-(alid path to a \214le containing time)-.25 F .137(stamp and time lag p\
-airs, then these data will be read and the time lag applied to particul\
-ar records)144 309.6 R(will be interpolated by time.)144 321.6 Q F2
-<ad57>108 338.4 Q F1(dsl\214le)20.3 E F0 1.103(The program will read na)
-144 350.4 R(vig)-.2 E 1.103(ation and attitude from the WHOI DSL na)-.05
-F(vig)-.2 E 1.102(ation and attitude \214le)-.05 F F1(dsl\214le)144
-362.4 Q F0 .683(and mer)3.183 F .684(ge those data with the multibeam, \
-sidescan, and subbtottom data in the 7k \214le.If a)-.18 F .198
-(timelag model is speci\214ed using)144 374.4 R F2<ad54>2.698 E F1
-(timela)A(g)-.1 E F0 2.698(,t)C .197
-(he time lag will be applied to the na)-2.698 F(vig)-.2 E .197
-(ation and atti-)-.05 F 1.418(tude data before mer)144 386.4 R 1.418
-(ging with the sonar data. An)-.18 F 3.919(yp)-.15 G(re-e)-3.919 E 1.419
-(xisting na)-.15 F(vig)-.2 E 1.419(ation data records will be)-.05 F
-.784(replaced. The similar)144 398.4 R F2<ad4e>3.283 E F1(ins\214le)A F0
-(and)3.283 E F2<ad57>3.283 E F1(dsl\214le)A F0 .783(options cause mer)
-3.283 F .783(ging of data from MB)-.18 F .783(ARI A)-.35 F(UV)-.55 E
-.135(log\214les and WHOI DSL na)144 410.4 R(vig)-.2 E .135
-(ation \214les, respecti)-.05 F -.15(ve)-.25 G(ly).15 E 2.635(.T)-.65 G
-.136(he WHOI DSL na)-2.635 F(vig)-.2 E .136(ation and attitude \214le)
--.05 F(is a te)144 422.4 Q(xt \214le with ele)-.15 E -.15(ve)-.25 G 2.5
-(ns).15 G(pace delimited columns:)-2.5 E(PPL date time v)180 434.4 Q
-(ehicle latitude longitude depth heading pitch roll id)-.15 E(where:)144
-446.4 Q(PPL \255 tag indicating processed na)180 458.4 Q(vig)-.2 E
-(ation and attitude)-.05 E(date \255 yyyy/mm/dd)180 470.4 Q
-(time \255 hh:mm:ss.sss)180 482.4 Q -.15(ve)180 494.4 S
-(hicle \255 SEN for Sentry).15 E(latitude \255 decimal de)180 506.4 Q
-(grees)-.15 E(longitude \255 decimal de)180 518.4 Q(grees)-.15 E
-(depth \255 sonar depth in meters)180 530.4 Q(pitch \255 decimal de)180
-542.4 Q(grees)-.15 E(roll \255 decimal de)180 554.4 Q(grees)-.15 E
-(id \255 seems to be 1.00)180 566.4 Q/F3 10.95/Times-Bold at 0 SF(EXAMPLES)
-72 595.2 Q F0 .527(Suppose that one has collected a Reson 7k data\214le\
- incorporating multibeam sonar data, sidescan data, and)108 607.2 R
-(subbottom pro\214ler data, and that the \214lename is:)108 619.2 Q
-(20050418_150155.s7k)144 631.2 Q
-(In order to preprocess the data in a 7k data \214le, one can use)108
-655.2 Q F2(mb7kpr)2.5 E(epr)-.18 E(ocess)-.18 E F0(with no special ar)
-2.5 E(guments:)-.18 E(mb7kpreprocess \255I 20040722_152111.s7k)144 667.2
-Q F3(SEE ALSO)72 696 Q F2(mbsystem)108 708 Q F0(\(1\),)A F2(mbf)2.5 E
-(ormat)-.25 E F0(\(1\),)A F2(mbinf)2.5 E(o)-.25 E F0(\(1\))A
-(MB-System 5.0)72 768 Q(12 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E
-(3)190.545 E 0 Cg EP
-%%Page: 4 4
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 122.63(mb7kpreprocess\(1\) MB-System)72 48 R
-122.63(5.0 mb7kpreprocess\(1\))2.5 F/F1 10.95/Times-Bold at 0 SF -.11(BU)72
-84 S(GS).11 E F0(Oh yeah.)108 96 Q(MB-System 5.0)72 768 Q(12 No)132.205
-E -.15(ve)-.15 G(mber 2014).15 E(4)190.545 E 0 Cg EP
-%%Trailer
-end
-%%EOF
diff --git a/src/ps/mbabsorption.ps b/src/ps/mbabsorption.ps
deleted file mode 100644
index ae7850a..0000000
--- a/src/ps/mbabsorption.ps
+++ /dev/null
@@ -1,384 +0,0 @@
-%!PS-Adobe-3.0
-%%Creator: groff version 1.19.2
-%%CreationDate: Wed Jul  1 12:29:26 2015
-%%DocumentNeededResources: font Times-Roman
-%%+ font Times-Bold
-%%+ font Times-Italic
-%%DocumentSuppliedResources: procset grops 1.19 2
-%%Pages: 3
-%%PageOrder: Ascend
-%%DocumentMedia: Default 612 792 0 () ()
-%%Orientation: Portrait
-%%EndComments
-%%BeginDefaults
-%%PageMedia: Default
-%%EndDefaults
-%%BeginProlog
-%%BeginResource: procset grops 1.19 2
-%!PS-Adobe-3.0 Resource-ProcSet
-/setpacking where{
-pop
-currentpacking
-true setpacking
-}if
-/grops 120 dict dup begin
-/SC 32 def
-/A/show load def
-/B{0 SC 3 -1 roll widthshow}bind def
-/C{0 exch ashow}bind def
-/D{0 exch 0 SC 5 2 roll awidthshow}bind def
-/E{0 rmoveto show}bind def
-/F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def
-/G{0 rmoveto 0 exch ashow}bind def
-/H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/I{0 exch rmoveto show}bind def
-/J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def
-/K{0 exch rmoveto 0 exch ashow}bind def
-/L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/M{rmoveto show}bind def
-/N{rmoveto 0 SC 3 -1 roll widthshow}bind def
-/O{rmoveto 0 exch ashow}bind def
-/P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/Q{moveto show}bind def
-/R{moveto 0 SC 3 -1 roll widthshow}bind def
-/S{moveto 0 exch ashow}bind def
-/T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/SF{
-findfont exch
-[exch dup 0 exch 0 exch neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/MF{
-findfont
-[5 2 roll
-0 3 1 roll
-neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/level0 0 def
-/RES 0 def
-/PL 0 def
-/LS 0 def
-/MANUAL{
-statusdict begin/manualfeed true store end
-}bind def
-/PLG{
-gsave newpath clippath pathbbox grestore
-exch pop add exch pop
-}bind def
-/BP{
-/level0 save def
-1 setlinecap
-1 setlinejoin
-72 RES div dup scale
-LS{
-90 rotate
-}{
-0 PL translate
-}ifelse
-1 -1 scale
-}bind def
-/EP{
-level0 restore
-showpage
-}def
-/DA{
-newpath arcn stroke
-}bind def
-/SN{
-transform
-.25 sub exch .25 sub exch
-round .25 add exch round .25 add exch
-itransform
-}bind def
-/DL{
-SN
-moveto
-SN
-lineto stroke
-}bind def
-/DC{
-newpath 0 360 arc closepath
-}bind def
-/TM matrix def
-/DE{
-TM currentmatrix pop
-translate scale newpath 0 0 .5 0 360 arc closepath
-TM setmatrix
-}bind def
-/RC/rcurveto load def
-/RL/rlineto load def
-/ST/stroke load def
-/MT/moveto load def
-/CL/closepath load def
-/Fr{
-setrgbcolor fill
-}bind def
-/setcmykcolor where{
-pop
-/Fk{
-setcmykcolor fill
-}bind def
-}if
-/Fg{
-setgray fill
-}bind def
-/FL/fill load def
-/LW/setlinewidth load def
-/Cr/setrgbcolor load def
-/setcmykcolor where{
-pop
-/Ck/setcmykcolor load def
-}if
-/Cg/setgray load def
-/RE{
-findfont
-dup maxlength 1 index/FontName known not{1 add}if dict begin
-{
-1 index/FID ne{def}{pop pop}ifelse
-}forall
-/Encoding exch def
-dup/FontName exch def
-currentdict end definefont pop
-}bind def
-/DEFS 0 def
-/EBEGIN{
-moveto
-DEFS begin
-}bind def
-/EEND/end load def
-/CNT 0 def
-/level1 0 def
-/PBEGIN{
-/level1 save def
-translate
-div 3 1 roll div exch scale
-neg exch neg exch translate
-0 setgray
-0 setlinecap
-1 setlinewidth
-0 setlinejoin
-10 setmiterlimit
-[]0 setdash
-/setstrokeadjust where{
-pop
-false setstrokeadjust
-}if
-/setoverprint where{
-pop
-false setoverprint
-}if
-newpath
-/CNT countdictstack def
-userdict begin
-/showpage{}def
-/setpagedevice{}def
-}bind def
-/PEND{
-countdictstack CNT sub{end}repeat
-level1 restore
-}bind def
-end def
-/setpacking where{
-pop
-setpacking
-}if
-%%EndResource
-%%EndProlog
-%%BeginSetup
-%%BeginFeature: *PageSize Default
-<< /PageSize [ 612 792 ] /ImagingBBox null >> setpagedevice
-%%EndFeature
-%%IncludeResource: font Times-Roman
-%%IncludeResource: font Times-Bold
-%%IncludeResource: font Times-Italic
-grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72
-def/PL 792 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron/Zcaron
-/scaron/zcaron/Ydieresis/trademark/quotesingle/Euro/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/space/exclam/quotedbl/numbersign/dollar/percent
-/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen
-/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon
-/semicolon/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O
-/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright/circumflex
-/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y
-/z/braceleft/bar/braceright/tilde/.notdef/quotesinglbase/guillemotleft
-/guillemotright/bullet/florin/fraction/perthousand/dagger/daggerdbl
-/endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut
-/dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash
-/quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen
-/brokenbar/section/dieresis/copyright/ordfeminine/guilsinglleft
-/logicalnot/minus/registered/macron/degree/plusminus/twosuperior
-/threesuperior/acute/mu/paragraph/periodcentered/cedilla/onesuperior
-/ordmasculine/guilsinglright/onequarter/onehalf/threequarters
-/questiondown/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE
-/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex
-/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis
-/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn
-/germandbls/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla
-/egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis
-/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide/oslash
-/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis]def
-/Times-Italic at 0 ENC0/Times-Italic RE/Times-Bold at 0 ENC0/Times-Bold RE
-/Times-Roman at 0 ENC0/Times-Roman RE
-%%EndSetup
-%%Page: 1 1
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mble)72 48 Q 148.97(vitus\(1\) MB-System)-.25 F
-148.97(5.0 mble)2.5 F(vitus\(1\))-.25 E/F1 10.95/Times-Bold at 0 SF -.219
-(NA)72 84 S(ME).219 E/F2 10/Times-Bold at 0 SF(mbabsor)108 96 Q(ption)-.1 E
-F0 2.839<ad63>2.839 G .338(alculates the absorption of sound in sea w)
--2.839 F .338(ater in dB/km as a function of frequenc)-.1 F 1.638 -.65
-(y, t)-.15 H(em-).65 E(perature, salinity)108 108 Q 2.5(,s)-.65 G
-(ound speed, and depth.)-2.5 E F1(VERSION)72 148.8 Q F0 -1.11(Ve)108
-160.8 S(rsion 5.0)1.11 E F1(SYNOPSIS)72 189.6 Q F2(mbabsor)108 201.6 Q
-(ption)-.1 E F0([)2.5 E F2<ad43>A/F3 10/Times-Italic at 0 SF(soundspeed)A
-F2<ad44>2.5 E F3(depth)A F2<ad46>2.5 E F3(fr)A(equency)-.37 E F2<ad50>
-2.5 E F3(ph)A F2<ad53>2.5 E F3(salinity)A F2<ad54>2.5 E F3(temper)A
-(atur)-.15 E(e)-.37 E F2<ad5620ad48>2.5 E F0(])A F1(DESCRIPTION)72 230.4
-Q F2(mbabsor)108 242.4 Q(ption)-.1 E F0 2.5<ad63>2.5 G
-(alculates the absorption of sound in sea w)-2.5 E(ater in dB/km)-.1 E
-1.268(as a function of frequenc)110.5 254.4 R 3.768(y\()-.15 G 1.268
-(kHz\), temperature \(de)-3.768 F 1.268
-(grees C\), salinity \(per mil\), depth \(m\), pH, and w)-.15 F(ater)-.1
-E(sound speed \(m/sec\).)108 266.4 Q 1.6 -.8(We u)110.5 290.4 T
-(se the Francois and Garrison equations from:).8 E
-(Francois, R.E., Garrison, G.R., "Sound absorption based)118 302.4 Q
-(on ocean measurements: P)123 314.4 Q(art I: Pure w)-.15 E
-(ater and magnesium)-.1 E(sulf)123 326.4 Q(ate contrib)-.1 E
-(utions", J. Acoust. Soc. Am., 72\(3\),)-.2 E(896-907, 1982.)123 338.4 Q
-(Francois, R.E., Garrison, G.R., "Sound absorption based)118 350.4 Q
-(on ocean measurements: P)123 362.4 Q(art II: Boric acid contrib)-.15 E
-(ution)-.2 E(and equation for total absorption", J. Acoust. Soc. Am.,)
-123 374.4 Q(72\(6\), 1879-1890, 1982.)123 386.4 Q .213
-(Francois and Garrison [1982] model the sound absorption in sea w)108
-410.4 R .212(ater as resulting from contrib)-.1 F .212(utions from)-.2 F
-.125(pure w)108 422.4 R(ater)-.1 E 2.625(,m)-.4 G .125(agnesium sulf)
--2.625 F .126(ate, and boric acid. The boric acid contrib)-.1 F .126
-(ution is signi\214cant belo)-.2 F 2.626(w1)-.25 G 2.626(0k)-2.626 G
-.126(Hz. The)-2.626 F(equations are:)108 434.4 Q
-(absorption = Boric Acid Contrib)144 458.4 Q(ution)-.2 E 2.5(+M)216
-470.4 S(bSO4 Contrib)-2.5 E(ution)-.2 E 2.5(+P)216 482.4 S(ure W)-2.5 E
-(ater Contrib)-.8 E(ution)-.2 E(Boric Acid Contrib)108 506.4 Q(ution:)
--.2 E(AlphaB = Ab * Pb * Fb * f**2)144 518.4 Q(\255------------------)
-166.5 530.4 Q(f**2 + Fb**2)174 542.4 Q
-(Ab = 8.86 / c * 10**\(0.78 * pH \255 5\) \(dB/km/kHz\))144 566.4 Q
-(Pb = 1)144 578.4 Q
-(Fb = 2.8 * \(S / 35\)**0.5 * 10**\(4 \255 1245 / Tk\) \(kHz\))144 590.4
-Q(MgSO4 Contrib)108 614.4 Q(ution:)-.2 E(AlphaM = Am * Pm * Fm * f**2)
-144 626.4 Q(\255------------------)166.5 638.4 Q(f**2 + Fm**2)174 650.4
-Q(Am = 21.44 * S * \(1 + 0.025 * T\) / c \(dB/km/kHZ\))144 662.4 Q
-(Pm = 1 \255 0.000137 * D + 0.0000000062 * D**2)144 674.4 Q(Fm = \(8.17\
- * 10**\(8 \255 1990 / Tk\)\) / \(1 + 0.0018 * \(S \255 35\)\))144 686.4
-Q(\(kHz\))5 E(Pure W)108 710.4 Q(ater Contrib)-.8 E(ution:)-.2 E
-(AlphaW = A)144 722.4 Q 2.5(w*P)-.92 G 2.5(w*f)-2.5 G(**2)-2.5 E
-(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(1)204.835 E 0
-Cg EP
-%%Page: 2 2
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mble)72 48 Q 148.97(vitus\(1\) MB-System)-.25 F
-148.97(5.0 mble)2.5 F(vitus\(1\))-.25 E -.15(Fo)144 84 S 2.5(rT<).15 G
-2.5(=2)-2.5 G 2.5(0d)-2.5 G .3 -.15(eg C)-2.5 H 1.84 -.92(Aw = 0)149 96
-T(.0004397 \255 0.0000259 * T).92 E 2.5(+0)169 108 S
-(.000000911 * T**2 \255 0.000000015 * T**3 \(dB/km/kHz\))-2.5 E -.15(Fo)
-144 120 S 2.5(rT>2).15 G 2.5(0d)-2.5 G .3 -.15(eg C)-2.5 H 1.84 -.92
-(Aw = 0)149 132 T(.0003964 \255 0.00001146 * T).92 E 2.5(+0)169 144 S
-(.000000145 * T**2 \255 0.00000000049 * T**3 \(dB/km/kHz\))-2.5 E
-(Pw = 1 \255 0.0000383 * D + 0.00000000049 * D**2)144 156 Q -.15(Pa)108
-180 S(rameters:).15 E 2.5(f=s)144 192 S(ound frequenc)-2.5 E 2.5(y\()
--.15 G(kHz\))-2.5 E 2.5(c=s)144 204 S(peed of sound \(m/s\))-2.5 E 2.5
-(T=t)144 216 S(emperature \(de)-2.5 E 2.5(gC)-.15 G(\))-2.5 E
-(Tk = temperature \(de)144 228 Q 2.5(gK)-.15 G 2.5(\)=T+2)-2.5 G
-(73 \(de)-2.5 E 2.5(gK)-.15 G(\))-2.5 E 2.5(S=s)144 240 S
-(alinity \(per mil\))-2.5 E 2.5(D=d)144 252 S(epth \(m\))-2.5 E .31
-(If the speed of sound is not speci\214ed by the user)108 276 R 2.81(,i)
--.4 G 2.81(tw)-2.81 G .31(ill be calculated from temperature, salinity)
--2.81 F 2.81(,a)-.65 G .31(nd depth)-2.81 F(using:)108 288 Q 2.5(c=)144
-300 S 2.5(~1)-2.5 G(412 + 3.21 * T + 1.19 * S + 0.0167 * D)-2.5 E
-(Normally)108 324 Q(,)-.65 E/F1 10/Times-Bold at 0 SF(mbabsor)3.227 E
-(ption)-.1 E F0 .727(simply prints the resulting absorption v)3.227 F
-.727(alue to stdout. If the)-.25 F F1<ad56>3.228 E F0 .728
-(option is speci-)3.228 F(\214ed, the output will include a listing of \
-the parameters used in calculating the absorption.)108 336 Q/F2 10.95
-/Times-Bold at 0 SF -.548(AU)72 364.8 S(THORSHIP).548 E F0(Da)108 376.8 Q
-(vid W)-.2 E 2.5(.C)-.92 G(aress \(caress at mbari.or)-2.5 E(g\))-.18 E
-(Montere)113 388.8 Q 2.5(yB)-.15 G(ay Aquarium Research Institute)-2.5 E
-(Dale N. Chayes \(dale at ldeo.columbia.edu\))108 400.8 Q
-(Lamont-Doherty Earth Observ)113 412.8 Q(atory)-.25 E F2(OPTIONS)72
-441.6 Q F1<ad48>108 453.6 Q F0 .162(This "help" \215ag cause the progra\
-m to print out a description of its operation and then e)22.52 F .161
-(xit immedi-)-.15 F(ately)144 465.6 Q(.)-.65 E F1<ad43>108 482.4 Q/F3 10
-/Times-Italic at 0 SF(soundspeed)23.08 E F0 .532(Speci\214es the w)144
-494.4 R .532
-(ater sound speed in m/sec. If the option is not used, the w)-.1 F .533
-(ater sound speed will be)-.1 F
-(calculated from the temperature, salinity)144 506.4 Q 2.5(,a)-.65 G
-(nd depth.)-2.5 E F1<ad44>108 523.2 Q F3(depth)23.08 E F0 .361(Sets the\
- depth in meters at which the sound absorption should be calculated.)144
-535.2 R(Def)5.361 E(ault:)-.1 E F3(depth)2.861 E F0 2.861(=0)2.861 G(.0)
--2.861 E 2.5(m\()144 547.2 S(i.e. the sea surf)-2.5 E(ace\).)-.1 E F1
-<ad46>108 564 Q F3(fr)24.19 E(equency)-.37 E F0 .204
-(Sets the sound frequenc)144 576 R 2.704(yi)-.15 G 2.704(nk)-2.704 G
-.205(Hz at which the sound absorption should be calculated.)-2.704 F
-(Def)5.205 E(ault:)-.1 E F3(fr)2.705 E(e-)-.37 E(quency)144 588 Q F0 2.5
-(=2)2.5 G(00 kHz.)-2.5 E F1<ad50>108 604.8 Q F3(ph)24.19 E F0
-(Sets the pH v)144 616.8 Q
-(alue at which the sound absorption should be calculated.)-.25 E(Def)5 E
-(ault:)-.1 E F3(ph)2.5 E F0 2.5(=8)2.5 G(.)-2.5 E F1<ad53>108 633.6 Q F3
-(salinity)24.74 E F0 .273(Sets the salinity in per mil at which the sou\
-nd absorption should be calculated.)144 645.6 R(Def)5.273 E(ault:)-.1 E
-F3(salinity)2.773 E F0(=)2.773 E(35 per mil.)144 657.6 Q F1<ad54>108
-674.4 Q F3(temper)23.63 E(atur)-.15 E(e)-.37 E F0 1.085
-(Sets the temperature in de)144 686.4 R 1.086
-(grees C at which the sound absorption should be calculated.)-.15 F(Def)
-6.086 E(ault:)-.1 E F3(temper)144 698.4 Q(atur)-.15 E(e)-.37 E F0 2.5
-(=1)2.5 G(0.0 de)-2.5 E(grees C.)-.15 E F1<ad56>108 715.2 Q F0(Normally)
-23.08 E(,)-.65 E F1(mbabsor)3.487 E(ption)-.1 E F0 .987
-(outputs only a single absorption v)3.487 F .986
-(alue to the stdout stream.)-.25 F .986(If the)5.986 F F1<ad56>3.486 E
-F0 .204(\215ag is gi)144 727.2 R -.15(ve)-.25 G .204(n, then).15 F F1
-(mbabsor)2.704 E(ption)-.1 E F0 -.1(wo)2.704 G .205(rks in a "v).1 F
-.205(erbose" mode and also outputs the parameters used)-.15 F
-(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(2)204.835 E 0
-Cg EP
-%%Page: 3 3
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mble)72 48 Q 148.97(vitus\(1\) MB-System)-.25 F
-148.97(5.0 mble)2.5 F(vitus\(1\))-.25 E(to calculate the absorption.)144
-84 Q/F1 10.95/Times-Bold at 0 SF(EXAMPLES)72 112.8 Q F0 .089
-(Suppose that one wishes to obtain the w)108 124.8 R .089
-(ater sound absorption for a 200 kHz multibeam sonar operating at a)-.1
-F .155(depth of 1000 meters \(on an A)108 136.8 R(UV)-.55 E 2.656(,f)
--1.29 G .156(or instance\) in w)-2.656 F .156
-(ater with a salinity of 35 per mil, a pH of 8, and a tem-)-.1 F
-(perature of 4 de)108 148.8 Q(grees C. The follo)-.15 E(wing will suf)
--.25 E(\214ce:)-.25 E
-(mbabsorption \255D1000 \255F200 \255P8 \255S35 \255T4)144 160.8 Q
-(The output will be:)108 172.8 Q(37.692561)110.5 184.8 Q
-(In order to obtain a more readable result, use the)108 208.8 Q/F2 10
-/Times-Bold at 0 SF<ad56>2.5 E F0(option:)2.5 E
-(mbabsorption \255D1000 \255F200 \255P8 \255S35 \255T4 \255V)144 220.8 Q
-(The output will be:)108 232.8 Q(Program MBabsorption)110.5 244.8 Q
--1.11(Ve)110.5 256.8 S
-(rsion $Id: mbabsorption.ps 2252 2015-07-01 19:35:37Z caress $)1.11 E
-(MB-system V)110.5 268.8 Q(ersion 5.1.1beta15)-1.11 E(Input P)110.5
-292.8 Q(arameters:)-.15 E(Frequenc)123 304.8 Q 17.5(y: 200.000000)-.15 F
-(kHz)2.5 E -.7(Te)123 316.8 S 12.5(mperature: 4.000000).7 F(de)2.5 E 2.5
-(gC)-.15 G 20(Salinity: 35.000000)123 328.8 R(per mil)2.5 E 27.5
-(Depth: 1000.000000)123 340.8 R(m)2.5 E 35(pH: 8.000000)123 352.8 R
-(Result:)110.5 364.8 Q(Sound absorption: 37.692561 dB/km)123 376.8 Q F1
-(SEE ALSO)72 405.6 Q F2(mbsystem)108 417.6 Q F0(\(1\))A F1 -.11(BU)72
-446.4 S(GS).11 E F0(None kno)108 458.4 Q(wn.)-.25 E(MB-System 5.0)72 768
-Q 2.5(3J)146.495 G(une 2013)-2.5 E(3)204.835 E 0 Cg EP
-%%Trailer
-end
-%%EOF
diff --git a/src/ps/mbareaclean.ps b/src/ps/mbareaclean.ps
deleted file mode 100644
index 092305c..0000000
--- a/src/ps/mbareaclean.ps
+++ /dev/null
@@ -1,569 +0,0 @@
-%!PS-Adobe-3.0
-%%Creator: groff version 1.19.2
-%%CreationDate: Wed Jul  1 12:29:26 2015
-%%DocumentNeededResources: font Times-Roman
-%%+ font Times-Bold
-%%+ font Times-Italic
-%%DocumentSuppliedResources: procset grops 1.19 2
-%%Pages: 4
-%%PageOrder: Ascend
-%%DocumentMedia: Default 612 792 0 () ()
-%%Orientation: Portrait
-%%EndComments
-%%BeginDefaults
-%%PageMedia: Default
-%%EndDefaults
-%%BeginProlog
-%%BeginResource: procset grops 1.19 2
-%!PS-Adobe-3.0 Resource-ProcSet
-/setpacking where{
-pop
-currentpacking
-true setpacking
-}if
-/grops 120 dict dup begin
-/SC 32 def
-/A/show load def
-/B{0 SC 3 -1 roll widthshow}bind def
-/C{0 exch ashow}bind def
-/D{0 exch 0 SC 5 2 roll awidthshow}bind def
-/E{0 rmoveto show}bind def
-/F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def
-/G{0 rmoveto 0 exch ashow}bind def
-/H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/I{0 exch rmoveto show}bind def
-/J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def
-/K{0 exch rmoveto 0 exch ashow}bind def
-/L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/M{rmoveto show}bind def
-/N{rmoveto 0 SC 3 -1 roll widthshow}bind def
-/O{rmoveto 0 exch ashow}bind def
-/P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/Q{moveto show}bind def
-/R{moveto 0 SC 3 -1 roll widthshow}bind def
-/S{moveto 0 exch ashow}bind def
-/T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/SF{
-findfont exch
-[exch dup 0 exch 0 exch neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/MF{
-findfont
-[5 2 roll
-0 3 1 roll
-neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/level0 0 def
-/RES 0 def
-/PL 0 def
-/LS 0 def
-/MANUAL{
-statusdict begin/manualfeed true store end
-}bind def
-/PLG{
-gsave newpath clippath pathbbox grestore
-exch pop add exch pop
-}bind def
-/BP{
-/level0 save def
-1 setlinecap
-1 setlinejoin
-72 RES div dup scale
-LS{
-90 rotate
-}{
-0 PL translate
-}ifelse
-1 -1 scale
-}bind def
-/EP{
-level0 restore
-showpage
-}def
-/DA{
-newpath arcn stroke
-}bind def
-/SN{
-transform
-.25 sub exch .25 sub exch
-round .25 add exch round .25 add exch
-itransform
-}bind def
-/DL{
-SN
-moveto
-SN
-lineto stroke
-}bind def
-/DC{
-newpath 0 360 arc closepath
-}bind def
-/TM matrix def
-/DE{
-TM currentmatrix pop
-translate scale newpath 0 0 .5 0 360 arc closepath
-TM setmatrix
-}bind def
-/RC/rcurveto load def
-/RL/rlineto load def
-/ST/stroke load def
-/MT/moveto load def
-/CL/closepath load def
-/Fr{
-setrgbcolor fill
-}bind def
-/setcmykcolor where{
-pop
-/Fk{
-setcmykcolor fill
-}bind def
-}if
-/Fg{
-setgray fill
-}bind def
-/FL/fill load def
-/LW/setlinewidth load def
-/Cr/setrgbcolor load def
-/setcmykcolor where{
-pop
-/Ck/setcmykcolor load def
-}if
-/Cg/setgray load def
-/RE{
-findfont
-dup maxlength 1 index/FontName known not{1 add}if dict begin
-{
-1 index/FID ne{def}{pop pop}ifelse
-}forall
-/Encoding exch def
-dup/FontName exch def
-currentdict end definefont pop
-}bind def
-/DEFS 0 def
-/EBEGIN{
-moveto
-DEFS begin
-}bind def
-/EEND/end load def
-/CNT 0 def
-/level1 0 def
-/PBEGIN{
-/level1 save def
-translate
-div 3 1 roll div exch scale
-neg exch neg exch translate
-0 setgray
-0 setlinecap
-1 setlinewidth
-0 setlinejoin
-10 setmiterlimit
-[]0 setdash
-/setstrokeadjust where{
-pop
-false setstrokeadjust
-}if
-/setoverprint where{
-pop
-false setoverprint
-}if
-newpath
-/CNT countdictstack def
-userdict begin
-/showpage{}def
-/setpagedevice{}def
-}bind def
-/PEND{
-countdictstack CNT sub{end}repeat
-level1 restore
-}bind def
-end def
-/setpacking where{
-pop
-setpacking
-}if
-%%EndResource
-%%EndProlog
-%%BeginSetup
-%%BeginFeature: *PageSize Default
-<< /PageSize [ 612 792 ] /ImagingBBox null >> setpagedevice
-%%EndFeature
-%%IncludeResource: font Times-Roman
-%%IncludeResource: font Times-Bold
-%%IncludeResource: font Times-Italic
-grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72
-def/PL 792 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron/Zcaron
-/scaron/zcaron/Ydieresis/trademark/quotesingle/Euro/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/space/exclam/quotedbl/numbersign/dollar/percent
-/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen
-/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon
-/semicolon/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O
-/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright/circumflex
-/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y
-/z/braceleft/bar/braceright/tilde/.notdef/quotesinglbase/guillemotleft
-/guillemotright/bullet/florin/fraction/perthousand/dagger/daggerdbl
-/endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut
-/dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash
-/quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen
-/brokenbar/section/dieresis/copyright/ordfeminine/guilsinglleft
-/logicalnot/minus/registered/macron/degree/plusminus/twosuperior
-/threesuperior/acute/mu/paragraph/periodcentered/cedilla/onesuperior
-/ordmasculine/guilsinglright/onequarter/onehalf/threequarters
-/questiondown/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE
-/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex
-/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis
-/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn
-/germandbls/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla
-/egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis
-/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide/oslash
-/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis]def
-/Times-Italic at 0 ENC0/Times-Italic RE/Times-Bold at 0 ENC0/Times-Bold RE
-/Times-Roman at 0 ENC0/Times-Roman RE
-%%EndSetup
-%%Page: 1 1
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 137.64(mbareaclean\(1\) MB-System)72 48 R 137.64
-(5.0 mbareaclean\(1\))2.5 F/F1 10.95/Times-Bold at 0 SF -.219(NA)72 84 S
-(ME).219 E/F2 10/Times-Bold at 0 SF(mbar)108 96 Q(eaclean)-.18 E F0 3.725
-<ad54>3.725 G 1.225(ool to automatically \215ag bad beams in sw)-4.525 F
-1.225(ath sonar bath)-.1 F 1.224(ymetry data within a speci\214ed)-.05 F
-(area.)108 108 Q F1(VERSION)72 136.8 Q F0 -1.11(Ve)108 148.8 S
-(rsion 5.0)1.11 E F1(SYNOPSIS)72 177.6 Q F2(mbar)108 189.6 Q 3.388
-(eaclean \255R)-.18 F/F3 10/Times-Italic at 0 SF(west/east/south/north)A F2
-<ad53>5.889 E F3(binsize)A F0([)3.389 E F2<ad44>A F3(thr)A(eshold)-.37 E
-F2<ad46>3.389 E F3(format)A F2<ad49>3.389 E F3(in\214le)A F2 .889
-<ad4220ad4720ad4820ad4d>3.389 F F3(thr)A(esh-)-.37 E(old)108 201.6 Q F0
-([)A F3(/nmin)A F0([)A F3(/nmax)A F0(]])A F2<ad4e>2.5 E F0([-])A F3
-(min_beam)A F0([)A F3(/maxbeam)A F0(])A F2<ad54>2.5 E F3(type)A F0<ad56>
-2.5 E F3(])A F1(DESCRIPTION)72 230.4 Q F2(mbar)108 242.4 Q(eaclean)-.18
-E F0 .019(identi\214es and \215ags artif)2.519 F .019(acts in sw)-.1 F
-.019(ath sonar bath)-.1 F .018
-(ymetry data within a speci\214ed area of interest.)-.05 F 1.006
-(The input data are one sw)108 254.4 R 1.006
-(ath \214le or a datalist referencing multiple sw)-.1 F 1.006
-(ath \214les. The user may specify the)-.1 F -.1(wo)108 266.4 S .728(rk\
- area in longitude and latitude bounds, along with a bin size in meters\
-. If these are not speci\214ed, the).1 F .573
-(program will attempt to set useful v)108 278.4 R .573
-(alues. The area is di)-.25 F .573
-(vided into a grid with square cells of the speci\214ed)-.25 F .743
-(bin size. As the data are read, each of the soundings that f)108 290.4
-R .742(all within one of the bins is stored. Once all of)-.1 F .442(dat\
-a are read, one or more statistical tests are performed on the sounding\
-s within each bin, pro)108 302.4 R .442(viding there)-.15 F(are a suf)
-108 314.4 Q(\214cient number of soundings.)-.25 E
-(The user may specify one or both of the follo)108 338.4 Q
-(wing actions:)-.25 E(1\) Pre)113 350.4 Q
-(viously un\215agged soundings that f)-.25 E
-(ail a test are \215agged as bad)-.1 E(2\) Pre)113 362.4 Q
-(viously \215agged soundings that pass all tests are un\215agged \(the)
--.25 E F2<ad47>2.5 E F0(option\)..)2.5 E .86(The edit e)108 386.4 R -.15
-(ve)-.25 G .86(nts are output to edit sa).15 F 1.16 -.15(ve \214)-.2 H
-.859(les which can be applied to the data by the program).15 F F2(mbpr)
-3.359 E(ocess)-.18 E F0(.)A .975(These are the same edit sa)108 398.4 R
-1.275 -.15(ve \214)-.2 H .975(les created and/or modi\214ed by).15 F F2
-(mbclean)3.475 E F0(and)3.475 E F2(mbedit)3.476 E F0 5.976(.I)C 3.476
-(fas)-5.976 G(ounding')-3.476 E 3.476<738d>-.55 G(ag)-3.476 E .452
-(status is changed, that \215agging action is output to the edit sa)108
-410.4 R .751 -.15(ve \214)-.2 H .451(le of the sw).15 F .451
-(ath \214le containing that sound-)-.1 F
-(ing. This program will create edit sa)108 422.4 Q .3 -.15(ve \214)-.2 H
-(les if necessary).15 E 2.5(,o)-.65 G 2.5(ra)-2.5 G
-(ppend to those that already e)-2.5 E(xist.)-.15 E .876
-(At present only tw)108 446.4 R 3.376(oa)-.1 G .877(lgorithms for ident\
-ifying good and bad beams is implemented. The \214rst is a simple)-3.376
-F 1.25(median \214lter controlled by the)108 458.4 R F2<ad4d>3.75 E F3
-(thr)A(eshold/nmin[/nmax])-.37 E F0 1.25(option. Soundings that dif)3.75
-F 1.25(fer from the median)-.25 F .297(depth by a v)108 470.4 R .297
-(alue greater than)-.25 F F3(thr)2.797 E(eshold)-.37 E F0 .297
-(times the sonar altitude will be considered "bad". So, if)2.797 F F3
-(thr)2.798 E(eshold)-.37 E F0(=)2.798 E .438(0.05, then an)108 482.4 R
-2.938(ys)-.15 G .438(ounding that is 5% greater or less than the median\
- depth will be considered bad. The)-2.938 F F3(nmin)2.937 E F0 .989(par\
-ameter sets the minimum number of soundings required to use the median \
-\214lter)108 494.4 R 3.49(.T)-.55 G(he)-3.49 E F3(nmax)3.49 E F0
-(parameter)3.49 E .821(sets the maximum number of soundings allo)108
-506.4 R .821
-(wed within a cell. If the number of initially good beams in a)-.25 F
-.641(cell e)108 518.4 R(xceeds)-.15 E F3(nmax)3.141 E F0 3.141(,t)C .641
-(hen only the)-3.141 F F3(nmax)3.141 E F0 .641
-(soundings nearest the median v)3.141 F .642
-(alue remain un\215agged, and the rest)-.25 F 1.03(are \215agged e)108
-530.4 R -.15(ve)-.25 G 3.53(ni).15 G 3.53(ft)-3.53 G(he)-3.53 E 3.53(ym)
--.15 G 1.03(eet the threshold test. The def)-3.53 F 1.029(ault v)-.1 F
-1.029(alues are)-.25 F F3(thr)3.529 E(eshold)-.37 E F0 3.529(=0)3.529 G
-(.25,)-3.529 E F3(nmin)3.529 E F0 3.529(=1)3.529 G 1.029(0, and)-3.529 F
-F3(nmax)108 542.4 Q F0 2.5(=i)2.5 G(n\214nite.)-2.5 E 1.987
-(The second algorithm is a simple standard de)108 566.4 R 1.987
-(viation \214lter controlled by the)-.25 F F2<ad44>4.487 E F3(thr)A
-(eshold/nmin)-.37 E F0(option.)4.487 E .204(Soundings that dif)108 578.4
-R .204(fer from the mean depth by a v)-.25 F .203(alue greater than)-.25
-F F3(thr)2.703 E(eshold)-.37 E F0 .203(times the standard de)2.703 F
-.203(viation of)-.25 F .131(the bin will be considered "bad". So, if)108
-590.4 R F3(thr)2.631 E(eshold)-.37 E F0 2.631(=2)2.631 G 2.631(,t)-2.631
-G .131(hen an)-2.631 F 2.631(ys)-.15 G .131
-(ounding that is more than 2 standard de)-2.631 F(via-)-.25 E 1.102
-(tions greater or less than the mean depth will be considered bad. The)
-108 602.4 R F3(nmin)3.602 E F0 1.101(parameter sets the minimum)3.601 F
-(number of soundings required to use the \214lter)108 614.4 Q 2.5(,T)-.4
-G(he def)-2.5 E(ault v)-.1 E(alues are)-.25 E F3(thr)2.5 E(eshold)-.37 E
-F0 2.5(=2)2.5 G(.0 and)-2.5 E F3(nmin)2.5 E F0 2.5(=1)2.5 G(0.)-2.5 E -1
--.8(Tw o)108 638.4 T .082(options allo)3.382 F 2.582(wl)-.25 G .082
-(imiting the soundings that may be \215agged.)-2.582 F F2<ad4e>5.083 E
-F0([-])A F3(min_beam/maxbeam)A F0 .083(limits \215agging to)2.583 F
-1.033(only those beams in \(or out\) of the gi)108 650.4 R -.15(ve)-.25
-G 3.532(nr).15 G(ange.)-3.532 E F2<ad54>6.032 E F3(type)A F0 1.032
-(limits \215agging to soundings using the speci\214ed)3.532 F .617
-(bottom detection algorithm.)108 662.4 R(Man)5.617 E 3.117(ys)-.15 G
-.618
-(ounders use amplitude detection algorithms for the central beams and)
--3.117 F .85(phase detection algorithms for the outer beams, f)108 674.4
-R .849(alling back to amplitude detection when phase detection)-.1 F -.1
-(fa)108 686.4 S 4.057(ils. Amplitude).1 F 1.557(detections in the outer\
- beams are second rate soundings and frequently ha)4.057 F 1.858 -.15
-(ve a h)-.2 H(igher).15 E .682(range of errors than other soundings.)108
-698.4 R(Using)5.682 E F2<ad4e>3.182 E F0(and)3.182 E F2<ad54>3.182 E F0
-.682(together allo)3.182 F .682(ws stricter cleaning algorithms to be)
--.25 F 1.459(applied to these lo)108 710.4 R 1.459(wer quality data. F)
--.25 F 1.459(or e)-.15 F 1.46
-(xample to \215ag bad all amplitude detections in the outer thirty)-.15
-F(beams which are more than one standard de)108 722.4 Q
-(viation from the mean:)-.25 E F2(\255N-30 \255T1 \255D1)2.5 E F0(.)A
-(MB-System 5.0)72 768 Q(29 September 2013)131.775 E(1)190.115 E 0 Cg EP
-%%Page: 2 2
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 137.64(mbareaclean\(1\) MB-System)72 48 R 137.64
-(5.0 mbareaclean\(1\))2.5 F/F1 10.95/Times-Bold at 0 SF -.548(AU)72 84 S
-(THORSHIP).548 E F0(Da)108 96 Q(vid W)-.2 E 2.5(.C)-.92 G
-(aress \(caress at mbari.or)-2.5 E(g\))-.18 E(Montere)113 108 Q 2.5(yB)-.15
-G(ay Aquarium Research Institute)-2.5 E
-(Dale N. Chayes \(dale at ldeo.columbia.edu\))108 120 Q
-(Lamont-Doherty Earth Observ)113 132 Q(atory)-.25 E F1(OPTIONS)72 160.8
-Q/F2 10/Times-Bold at 0 SF<ad42>108 172.8 Q F0 .096(This option causes)144
-184.8 R F2(mbar)2.596 E(eaclean)-.18 E F0 .096(to \215ag as bad an)2.596
-F 2.596(yp)-.15 G(re)-2.596 E .096(viously un\215agged soundings that f)
--.25 F .096(ail one of)-.1 F .922
-(the speci\214ed statistical tests. If neither)144 196.8 R F2<ad42>3.422
-E F0(or)3.422 E F2<ad47>3.422 E F0 .922
-(are speci\214ed, then the program will by def)3.422 F(ault)-.1 E
-(use this option.)144 208.8 Q F2<ad44>108 225.6 Q/F3 10/Times-Italic at 0
-SF(thr)23.08 E(eshold)-.37 E F0([)A F3(/nmin)A F0(])A -.45(Tu)144 237.6
-S .819(rns on use of a standard de).45 F .819
-(viation \214lter test for the soundings.)-.25 F .818
-(Soundings that dif)5.819 F .818(fer from the)-.25 F 1.844
-(mean depth by a v)144 249.6 R 1.844(alue greater than)-.25 F F3(thr)
-4.344 E(eshold)-.37 E F0 1.844(times the standard de)4.344 F 1.845
-(viation will be considered)-.25 F .193("bad". So, if)144 261.6 R F3
-(thr)2.693 E(eshold)-.37 E F0 2.693(=2)2.693 G .193(.0, then an)-2.693 F
-2.693(ys)-.15 G .193(ounding that is twice the standard de)-2.693 F .193
-(viation from the mean)-.25 F 2.687(depth will be considered bad. The)
-144 273.6 R F3(nmin)5.187 E F0 2.687
-(parameter sets the minimum number of soundings)5.187 F
-(required to use the standard de)144 285.6 Q(viation \214lter)-.25 E 2.5
-(.T)-.55 G(he def)-2.5 E(ault v)-.1 E(alues are)-.25 E F3(thr)2.5 E
-(eshold)-.37 E F0 2.5(=2)2.5 G(.0 and)-2.5 E F3(nmin)2.5 E F0 2.5(=1)2.5
-G(0.)-2.5 E F2<ad46>108 302.4 Q F3(format)24.19 E F0 1.241
-(Sets the data format used to read)144 314.4 R F3(in\214le)3.741 E F0
-6.241(.I)C(f)-6.241 E F3(format)3.741 E F0 3.741(<0)3.741 G 3.741(,t)
--3.741 G 1.241(hen the input \214le speci\214ed with the)-3.741 F F2
-<ad49>3.741 E F0 1.163(option will actually contain a list of input sw)
-144 326.4 R 1.164(ath sonar data \214les. This program uses the)-.1 F F2
-(MBIO)3.664 E F0 1.292(library and will read or write an)144 338.4 R
-3.792(ys)-.15 G -.1(wa)-3.792 G 1.292(th sonar format supported by).1 F
-F2(MBIO)3.792 E F0 3.792(.A)C 1.291(list of the sw)-.001 F(ath)-.1 E .39
-(sonar data formats currently supported by)144 350.4 R F2(MBIO)2.891 E
-F0 .391(and their identi\214er v)2.891 F .391(alues is gi)-.25 F -.15
-(ve)-.25 G 2.891(ni).15 G 2.891(nt)-2.891 G(he)-2.891 E F2(MBIO)2.891 E
-F0(manual page. Def)144 362.4 Q(ault:)-.1 E F3(format)2.5 E F0 2.5(=1)
-2.5 G(1.)-2.5 E F2<ad47>108 379.2 Q F0 .115(This option cause)22.52 F F2
-(mbar)2.615 E(ealcean)-.18 E F0 .115(to un\215ag \(set good\) an)2.615 F
-2.615(yp)-.15 G(re)-2.615 E .115
-(viously \215agged soundings that pass all)-.25 F .23
-(of the speci\214ed statistical tests. If neither)144 391.2 R F2<ad42>
-2.73 E F0(or)2.731 E F2<ad47>2.731 E F0 .231
-(are speci\214ed, then the program will by def)2.731 F(ault)-.1 E
-(apply the)144 403.2 Q F2<ad42>5 E F0(option.)2.5 E F2<ad48>108 420 Q F0
-.162(This "help" \215ag cause the program to print out a description of\
- its operation and then e)22.52 F .161(xit immedi-)-.15 F(ately)144 432
-Q(.)-.65 E F2<ad49>108 448.8 Q F3(in\214le)26.41 E F0 .312
-(Sets the input \214lename. If)144 460.8 R F3(format)2.813 E F0 2.813
-(>0\()2.813 G .313(set with the)-2.813 F F2<ad46>2.813 E F0 .313
-(option\) then the sw)2.813 F .313(ath sonar data contained)-.1 F(in)144
-472.8 Q F3(in\214le)2.937 E F0 .437(is read and processed. If)2.937 F F3
-(format)2.937 E F0 2.937(<0)2.937 G 2.937(,t)-2.937 G(hen)-2.937 E F3
-(in\214le)2.937 E F0 .437(is assumed to be an ascii \214le containing a)
-2.937 F .868(list of the input sw)144 484.8 R .869
-(ath sonar data \214les to be processed and their formats.)-.1 F .869
-(The program will read)5.869 F .988(and process the data in all of thes\
-e \214les. Each input \214le will ha)144 496.8 R 1.288 -.15(ve a)-.2 H
-3.487(na).15 G .987(ssociated output \214le with)-3.487 F .405
-(either the ".esf" suf)144 508.8 R 2.905(\214x. In)-.25 F(the)2.905 E F3
-(in\214le)2.905 E F0 .405(\214le, each data \214le should be follo)2.905
-F .405(wed by a data format identi-)-.25 F(\214er)144 520.8 Q 2.5(,e)-.4
-G(.g.:)-2.5 E(data\214le1 11)180 532.8 Q(data\214le2 24)180 544.8 Q .569
-(This program uses the)144 556.8 R F2(MBIO)3.068 E F0 .568
-(library and will read or write an)3.068 F 3.068(ys)-.15 G -.1(wa)-3.068
-G .568(th sonar format supported by).1 F F2(MBIO)144 568.8 Q F0 3.428
-(.Al)C .928(ist of the sw)-3.428 F .928
-(ath sonar data formats currently supported by)-.1 F F2(MBIO)3.428 E F0
-.928(and their identi\214er)3.428 F -.25(va)144 580.8 S(lues is gi).25 E
--.15(ve)-.25 G 2.5(ni).15 G 2.5(nt)-2.5 G(he)-2.5 E F2(MBIO)2.5 E F0
-(manual page. Def)2.5 E(ault:)-.1 E F3(in\214le)2.5 E F0 2.5(=")2.5 G
-(datalist.mb-1".)-2.5 E F2<ad4d>108 597.6 Q F3(thr)20.86 E(eshold)-.37 E
-F0([)A F3(/nmin)A F0(])A -.45(Tu)144 609.6 S .21(rns on use of a median\
- \214lter test for the soundings. If no other test is speci\214ed, the \
-median \214lter).45 F .184(test is used by def)144 621.6 R .185
-(ault. Soundings that dif)-.1 F .185(fer from the median depth by a v)
--.25 F .185(alue greater than)-.25 F F3(thr)2.685 E(esh-)-.37 E(old)144
-633.6 Q F0 .866
-(times the sonar altitude will be considered "bad". So, if)3.366 F F3
-(thr)3.365 E(eshold)-.37 E F0 3.365(=0)3.365 G .865(.05, then an)-3.365
-F 3.365(ys)-.15 G(ounding)-3.365 E .619(that is 5% greater or less than\
- the median depth will be considered bad. The)144 645.6 R F3(nmin)3.119
-E F0 .619(parameter sets)3.119 F .145
-(the minimum number of soundings required to use the median \214lter)144
-657.6 R 2.644(,T)-.4 G .144(he def)-2.644 F .144(ault v)-.1 F .144
-(alues are)-.25 F F3(thr)2.644 E(esh-)-.37 E(old)144 669.6 Q F0 2.5(=0)
-2.5 G(.25 and)-2.5 E F3(nmin)2.5 E F0 2.5(=1)2.5 G(0.)-2.5 E F2<ad4e>108
-686.4 Q F0([-])23.08 E F3(min_beam)A F0([)A F3(/max_beam)A F0(])A .234
-(Limits the beams to which \215agging will be applied.)144 698.4 R .235
-(Only soundings for beams from)5.235 F F3(min_beam)2.735 E F0(to)2.735 E
-F3(max_beam)144 710.4 Q F0 3.519(,i)C(nclusi)-3.519 E -.15(ve)-.25 G
-3.519(,w).15 G 1.019(ill ha)-3.519 F 1.319 -.15(ve \215)-.2 H 1.019
-(ags applied.).15 F(If)6.019 E F3(min_beam)3.519 E F0 1.019
-(is preceded by a)3.519 F F2<ad>3.518 E F0 1.018(then only beams)3.518 F
-.383(outside the range will be \215agged.)144 722.4 R(If)5.383 E F3
-(max_beam)2.883 E F0 .383(is not gi)2.883 F -.15(ve)-.25 G 2.883(ni).15
-G 2.883(tw)-2.883 G .383(ill be set so that an equal number)-2.883 F
-(MB-System 5.0)72 768 Q(29 September 2013)131.775 E(2)190.115 E 0 Cg EP
-%%Page: 3 3
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 137.64(mbareaclean\(1\) MB-System)72 48 R 137.64
-(5.0 mbareaclean\(1\))2.5 F .519(of beams lay abo)144 84 R .819 -.15
-(ve i)-.15 H 3.019(ta).15 G 3.019(sl)-3.019 G .519(ay belo)-3.019 F(w)
--.25 E/F1 10/Times-Italic at 0 SF(min_beam)3.019 E F0 3.019(.S)C 3.019(of)
--3.019 G .519(or a Simrad EM1002 sounder with 111 beams)-3.019 F/F2 10
-/Times-Bold at 0 SF(\255N-30)144 96 Q F0 1.37
-(will only \215ag beam numbers 1 to 29 and 82 to 111.)3.87 F 1.371
-(All good soundings, re)6.371 F -.05(ga)-.15 G 1.371(rdless of).05 F(be\
-am, will be included in the calculations of median, mean and standard d\
-e)144 108 Q(viation for the bin.)-.25 E F2<ad52>108 124.8 Q F1
-(west/east/south/north)23.08 E F0 1.206
-(Sets the longitude and latitude bounds within which sw)144 136.8 R
-1.205(ath sonar data will be read, binned, and)-.1 F
-(tested. Soundings lying outside these bounds will be ignored.)144 148.8
-Q(Def)144 160.8 Q .209(ault: The program will determine and use a squar\
-e area encompassing all of the data contained)-.1 F
-(in the input \214les.)144 172.8 Q F2<ad53>108 189.6 Q F1(binsize)24.74
-E F0 .148(Sets the size of the bins to be used in meters. The area spec\
-i\214ed with the)144 201.6 R F2<ad52>2.647 E F0 .147
-(option will be brok)2.647 F(en)-.1 E
-(into a grid with cells that are roughly)144 213.6 Q F1(binsize)2.5 E F0
-(meters east-west and north-south.)2.5 E(Def)144 225.6 Q(ault: A binsiz\
-e equal to 0.2 times the maximum sonar altitude will be used.)-.1 E F2
-<ad54>108 242.4 Q F1(detect_type)23.63 E F0 .584(Limits the soundings t\
-o which \215agging will be applied to only those which use the speci\
-\214ed bot-)144 254.4 R(tom detection algorithm.)144 266.4 Q F1
-(detect_type)5 E F0(must be one of:)2.5 E 2.5(0\255u)159 278.4 S(nkno)
--2.5 E(wn algorithm)-.25 E 2.5(1\255a)159 290.4 S(mplitude detection)
--2.5 E 2.5(2\255p)159 302.4 S(hase detection)-2.5 E F2<ad56>108 319.2 Q
-F0(Normally)23.08 E(,)-.65 E F2(mbar)3.269 E(eaclean)-.18 E F0 -.1(wo)
-3.269 G .769(rks "silently" without outputting an).1 F .768
-(ything to the stderr stream.)-.15 F .768(If the)5.768 F F2<ad56>144
-331.2 Q F0 .692(\215ag is gi)3.192 F -.15(ve)-.25 G .692(n, then).15 F
-F2(mbar)3.192 E(eaclean)-.18 E F0 -.1(wo)3.193 G .693(rks in a "v).1 F
-.693(erbose" mode and outputs the program v)-.15 F(ersion)-.15 E(being \
-used, all error status messages, and the number of beams \215agged as b\
-ad.)144 343.2 Q/F3 10.95/Times-Bold at 0 SF(EXAMPLES)72 372 Q F0 .583
-(Suppose we are w)108 384 R .582(orking with a set of 5 Reson 8101 mult\
-ibeam data \214les comprising a shallo)-.1 F 3.082(ww)-.25 G .582
-(ater sur)-3.182 F(-)-.2 E -.15(vey)108 396 S 2.986(.O)-.5 G .486
-(ne of these \214les has pre)-2.986 F .486(viously been edited with)-.25
-F F2(mbedit)2.986 E F0 2.986(,s)C 2.986(oa)-2.986 G 2.986(ne)-2.986 G
-.487(sf \214le e)-2.986 F .487(xists and contains a number)-.15 F 6.054
-(of pre-e)108 408 R 6.054(xisting edits.)-.15 F 6.054(If we kno)11.054 F
-8.554(wt)-.25 G 6.054(hat this surv)-8.554 F 6.354 -.15(ey i)-.15 H
-8.554(sc).15 G 6.054(ontained in the area speci\214ed by)-8.554 F
-(\255R-122.42556/-122.41974/47.67111/47.67529, then we can in)108 420 Q
--.2(vo)-.4 G -.1(ke).2 G F2(mbar)2.6 E(eaclean)-.18 E F0(using:)2.5 E
-(mbareaclean \255Idatalist.mb-1 \\)144 432 Q(-B \255M0.1/10 \255S2.5 \\)
-180 444 Q 2.5(-R-122.42556/-122.41974/47.67111/47.67529 \\)180 456 R(-V)
-180 468 Q .853(where the bin size is 2.5 meters, the median \214lter th\
-reshold is 0.1 \(or 10%\) of the sonar altitude, and the)108 480 R(mini\
-mum number of sounding required for \214ltering is 10. The results look\
- lik)108 492 Q(e:)-.1 E(Program MB)110.5 516 Q(AREA)-.35 E(CLEAN)-.4 E
--1.11(Ve)110.5 528 S
-(rsion $Id: mbareaclean.ps 2252 2015-07-01 19:35:37Z caress $)1.11 E
-(MB-system V)110.5 540 Q(ersion 5.0.beta29)-1.11 E(Area of interest:)
-110.5 552 Q
-(Minimum Longitude: \255122.425560 Maximum Longitude: \255122.419740)123
-564 Q(Minimum Latitude:)123 576 Q(47.671110 Maximum Latitude:)5 E
-(47.675290)5 E(Bin Size:)123 588 Q(2.500000)7.5 E(Dimensions: 175 186)
-123 600 Q(Cleaning algorithms:)110.5 612 Q(Median \214lter: ON)123 624 Q
-(Plane \214t:)123 636 Q(OFF)12.5 E(Output:)110.5 648 Q
-(Flag un\215agged soundings identi\214ed as bad:)123 660 Q(ON)5 E
-(Un\215ag \215agged soundings identi\214ed as good: OFF)123 672 Q
-(Processing 001_1730.fbt)110.5 696 Q(Sorting 41580 old edits...)110.5
-708 Q(10000 of 41580 old edits sorted...)110.5 720 Q(MB-System 5.0)72
-768 Q(29 September 2013)131.775 E(3)190.115 E 0 Cg EP
-%%Page: 4 4
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 137.64(mbareaclean\(1\) MB-System)72 48 R 137.64
-(5.0 mbareaclean\(1\))2.5 F(20000 of 41580 old edits sorted...)110.5 84
-Q(30000 of 41580 old edits sorted...)110.5 96 Q
-(40000 of 41580 old edits sorted...)110.5 108 Q 2.5(pings:1169 beams:)
-110.5 120 R(20233 good)7.5 E(41686 \215agged)7.5 E(56150 null)7.5 E
-(Processing 003_1733.fbt)110.5 144 Q(pings: 991)110.5 156 Q 5
-(beams: 52439)5 F 10(good 159)2.5 F 5(\215agged 47493)2.5 F(null)2.5 E
-(Processing 005_1736.fbt)110.5 180 Q 2.5(pings:1011 beams:)110.5 192 R
-(53080 good)7.5 E(588 \215agged)12.5 E(48443 null)7.5 E
-(Processing 007_1739.fbt)110.5 216 Q(pings: 922)110.5 228 Q 5
-(beams: 48854)5 F 10(good 212)2.5 F 5(\215agged 44056)2.5 F(null)2.5 E
-(Processing 009_1741.fbt)110.5 252 Q 2.5(pings:1017 beams:)110.5 264 R
-(53416 good)7.5 E(586 \215agged)12.5 E(48715 null)7.5 E
-(MBareaclean Processing T)110.5 288 Q(otals:)-.8 E
-(\255------------------------)110.5 300 Q 2.5(5t)110.5 312 S(otal sw)
--2.5 E(ath data \214les processed)-.1 E(5110 total pings processed)110.5
-324 Q(271253 total soundings processed)110.5 336 Q
-(\255------------------------)110.5 348 Q 2.5(0s)115.5 360 S 2.5
-(oundings: 61919)-2.5 F 12.5(\215agged: 0)2.5 F 12.5(un\215agged: 0)2.5
-F(\214le:001_1730)5 E 2.5(1s)115.5 372 S 2.5(oundings: 52598)-2.5 F 12.5
-(\215agged: 0)2.5 F 12.5(un\215agged: 0)2.5 F(\214le:003_1733)5 E 2.5
-(2s)115.5 384 S 2.5(oundings: 53668)-2.5 F 12.5(\215agged: 0)2.5 F 12.5
-(un\215agged: 0)2.5 F(\214le:005_1736)5 E 2.5(3s)115.5 396 S 2.5
-(oundings: 49066)-2.5 F 12.5(\215agged: 0)2.5 F 12.5(un\215agged: 0)2.5
-F(\214le:007_1739)5 E 2.5(4s)115.5 408 S 2.5(oundings: 54002)-2.5 F 12.5
-(\215agged: 0)2.5 F 12.5(un\215agged: 0)2.5 F(\214le:009_1741)5 E/F1
-10.95/Times-Bold at 0 SF(SEE ALSO)72 448.8 Q/F2 10/Times-Bold at 0 SF
-(mbsystem)108 460.8 Q F0(\(1\),)A F2(mbclean)2.5 E F0(\(1\),)A F2
-(mbedit)2.5 E F0(\(1\),)A F2(mbinf)2.5 E(o)-.25 E F0(\(1\))A F2(mbpr)2.5
-E(ocess)-.18 E F0(\(1\),)A F1 -.11(BU)72 489.6 S(GS).11 E F0 .443
-(The algorithms implemented in)108 501.6 R F2(mbar)2.943 E(eaclean)-.18
-E F0 .443(simply don')2.943 F 2.943(td)-.18 G .443(etect all bath)-2.943
-F .443(ymetric artif)-.05 F .443(acts that are ob)-.1 F(vious)-.15 E
-.426(to the e)108 513.6 R .427(ye on contour charts.)-.15 F .427
-(Although the auto\214ltering tools)5.427 F F2(mbar)2.927 E(eaclean)-.18
-E F0(and)2.927 E F2(mbclean)2.927 E F0 .427(often do a credi-)2.927 F
-.96(ble \214rst pass at \215agging ob)108 525.6 R .959(vious artif)-.15
-F .959(acts, we strongly recommend that an)-.1 F 3.459(ys)-.15 G -.1(wa)
--3.459 G .959(th bath).1 F .959(ymetry processing)-.05 F
-(stream include interacti)108 537.6 Q .3 -.15(ve e)-.25 H
-(diting of the bath).15 E(ymetry data \(e.g.)-.05 E F2(mbedit)2.5 E F0
-(\).)A(MB-System 5.0)72 768 Q(29 September 2013)131.775 E(4)190.115 E 0
-Cg EP
-%%Trailer
-end
-%%EOF
diff --git a/src/ps/mbauvloglist.ps b/src/ps/mbauvloglist.ps
deleted file mode 100644
index 46be21c..0000000
--- a/src/ps/mbauvloglist.ps
+++ /dev/null
@@ -1,697 +0,0 @@
-%!PS-Adobe-3.0
-%%Creator: groff version 1.19.2
-%%CreationDate: Wed Jul  1 12:29:26 2015
-%%DocumentNeededResources: font Times-Roman
-%%+ font Times-Bold
-%%+ font Times-Italic
-%%DocumentSuppliedResources: procset grops 1.19 2
-%%Pages: 7
-%%PageOrder: Ascend
-%%DocumentMedia: Default 612 792 0 () ()
-%%Orientation: Portrait
-%%EndComments
-%%BeginDefaults
-%%PageMedia: Default
-%%EndDefaults
-%%BeginProlog
-%%BeginResource: procset grops 1.19 2
-%!PS-Adobe-3.0 Resource-ProcSet
-/setpacking where{
-pop
-currentpacking
-true setpacking
-}if
-/grops 120 dict dup begin
-/SC 32 def
-/A/show load def
-/B{0 SC 3 -1 roll widthshow}bind def
-/C{0 exch ashow}bind def
-/D{0 exch 0 SC 5 2 roll awidthshow}bind def
-/E{0 rmoveto show}bind def
-/F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def
-/G{0 rmoveto 0 exch ashow}bind def
-/H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/I{0 exch rmoveto show}bind def
-/J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def
-/K{0 exch rmoveto 0 exch ashow}bind def
-/L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/M{rmoveto show}bind def
-/N{rmoveto 0 SC 3 -1 roll widthshow}bind def
-/O{rmoveto 0 exch ashow}bind def
-/P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/Q{moveto show}bind def
-/R{moveto 0 SC 3 -1 roll widthshow}bind def
-/S{moveto 0 exch ashow}bind def
-/T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/SF{
-findfont exch
-[exch dup 0 exch 0 exch neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/MF{
-findfont
-[5 2 roll
-0 3 1 roll
-neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/level0 0 def
-/RES 0 def
-/PL 0 def
-/LS 0 def
-/MANUAL{
-statusdict begin/manualfeed true store end
-}bind def
-/PLG{
-gsave newpath clippath pathbbox grestore
-exch pop add exch pop
-}bind def
-/BP{
-/level0 save def
-1 setlinecap
-1 setlinejoin
-72 RES div dup scale
-LS{
-90 rotate
-}{
-0 PL translate
-}ifelse
-1 -1 scale
-}bind def
-/EP{
-level0 restore
-showpage
-}def
-/DA{
-newpath arcn stroke
-}bind def
-/SN{
-transform
-.25 sub exch .25 sub exch
-round .25 add exch round .25 add exch
-itransform
-}bind def
-/DL{
-SN
-moveto
-SN
-lineto stroke
-}bind def
-/DC{
-newpath 0 360 arc closepath
-}bind def
-/TM matrix def
-/DE{
-TM currentmatrix pop
-translate scale newpath 0 0 .5 0 360 arc closepath
-TM setmatrix
-}bind def
-/RC/rcurveto load def
-/RL/rlineto load def
-/ST/stroke load def
-/MT/moveto load def
-/CL/closepath load def
-/Fr{
-setrgbcolor fill
-}bind def
-/setcmykcolor where{
-pop
-/Fk{
-setcmykcolor fill
-}bind def
-}if
-/Fg{
-setgray fill
-}bind def
-/FL/fill load def
-/LW/setlinewidth load def
-/Cr/setrgbcolor load def
-/setcmykcolor where{
-pop
-/Ck/setcmykcolor load def
-}if
-/Cg/setgray load def
-/RE{
-findfont
-dup maxlength 1 index/FontName known not{1 add}if dict begin
-{
-1 index/FID ne{def}{pop pop}ifelse
-}forall
-/Encoding exch def
-dup/FontName exch def
-currentdict end definefont pop
-}bind def
-/DEFS 0 def
-/EBEGIN{
-moveto
-DEFS begin
-}bind def
-/EEND/end load def
-/CNT 0 def
-/level1 0 def
-/PBEGIN{
-/level1 save def
-translate
-div 3 1 roll div exch scale
-neg exch neg exch translate
-0 setgray
-0 setlinecap
-1 setlinewidth
-0 setlinejoin
-10 setmiterlimit
-[]0 setdash
-/setstrokeadjust where{
-pop
-false setstrokeadjust
-}if
-/setoverprint where{
-pop
-false setoverprint
-}if
-newpath
-/CNT countdictstack def
-userdict begin
-/showpage{}def
-/setpagedevice{}def
-}bind def
-/PEND{
-countdictstack CNT sub{end}repeat
-level1 restore
-}bind def
-end def
-/setpacking where{
-pop
-setpacking
-}if
-%%EndResource
-%%EndProlog
-%%BeginSetup
-%%BeginFeature: *PageSize Default
-<< /PageSize [ 612 792 ] /ImagingBBox null >> setpagedevice
-%%EndFeature
-%%IncludeResource: font Times-Roman
-%%IncludeResource: font Times-Bold
-%%IncludeResource: font Times-Italic
-grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72
-def/PL 792 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron/Zcaron
-/scaron/zcaron/Ydieresis/trademark/quotesingle/Euro/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/space/exclam/quotedbl/numbersign/dollar/percent
-/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen
-/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon
-/semicolon/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O
-/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright/circumflex
-/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y
-/z/braceleft/bar/braceright/tilde/.notdef/quotesinglbase/guillemotleft
-/guillemotright/bullet/florin/fraction/perthousand/dagger/daggerdbl
-/endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut
-/dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash
-/quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen
-/brokenbar/section/dieresis/copyright/ordfeminine/guilsinglleft
-/logicalnot/minus/registered/macron/degree/plusminus/twosuperior
-/threesuperior/acute/mu/paragraph/periodcentered/cedilla/onesuperior
-/ordmasculine/guilsinglright/onequarter/onehalf/threequarters
-/questiondown/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE
-/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex
-/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis
-/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn
-/germandbls/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla
-/egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis
-/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide/oslash
-/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis]def
-/Times-Italic at 0 ENC0/Times-Italic RE/Times-Bold at 0 ENC0/Times-Bold RE
-/Times-Roman at 0 ENC0/Times-Roman RE
-%%EndSetup
-%%Page: 1 1
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 135.94(mbauvloglist\(1\) MB-System)72 48 R
-135.94(5.0 mbauvloglist\(1\))2.5 F/F1 10.95/Times-Bold at 0 SF -.219(NA)72
-84 S(ME).219 E/F2 10/Times-Bold at 0 SF(mbauvloglist)108 96 Q F0 2.5<ad4c>
-2.5 G(ists table data from an MB)-2.5 E(ARI A)-.35 E
-(UV mission log \214le.)-.55 E F1(VERSION)72 124.8 Q F0 -1.11(Ve)108
-136.8 S(rsion 5.0)1.11 E F1(SYNOPSIS)72 165.6 Q F2(mbauvloglist \255I)
-108 177.6 Q/F3 10/Times-Italic at 0 SF(\214le)A F0([)2.5 E F2<ad46>A F3
-(printformat)A F2<ad4c>2.5 E F3(lon\215ip)A F2<ad4d>2.5 E F3(mode)A F2
-<ad4e>2.5 E F3(nav\214le)A F2<ad4f>2.5 E F3(list)A F2
-<ad5020ad5320ad5620ad48>2.5 E F0(])2.5 E F1(DESCRIPTION)72 206.4 Q F0
-.462(MBauvloglist reads an MB)108 218.4 R .462(ARI A)-.35 F .462(UV mis\
-sion log \214le and lists speci\214ed \214elds in tab-delimited te)-.55
-F .462(xt output.)-.15 F(MB)108 230.4 Q .206(ARI A)-.35 F .206
-(UV mission logs)-.55 F .207(are binary \214les with an ascii header de\
-scribing the units, name, and binary size)5.206 F(of each v)108 242.4 Q
-(alue in a single record. An e)-.25 E(xample of a log \214le header is:)
--.15 E 2.5(#b)108 266.4 S(inary f)-2.5 E(astcatlog)-.1 E 2.5(#t)108
-278.4 S(imeT)-2.5 E(ag time %8.8e ,time ,UNKNO)-.8 E(WN)-.35 E 2.5(#d)
-108 290.4 S(ouble conducti)-2.5 E(vity %8.8e ,Calculated conducti)-.25 E
-(vity ,Siemens/meter)-.25 E 2.5(#d)108 302.4 S
-(ouble temperature %8.8e ,Calculated temperature ,Celsius)-2.5 E 2.5(#d)
-108 314.4 S(ouble pressure %8.8e ,Calculated pressure ,Decibars)-2.5 E
-2.5(#d)108 326.4 S
-(ouble calculated_salinity %8.8e ,Calculated salinity ,V)-2.5 E(olts)
--1.29 E 2.5(#d)108 338.4 S(ouble cond_frequenc)-2.5 E 2.5(y%)-.15 G
-(8.8e ,Ra)-2.5 E 2.5(wC)-.15 G(onducti)-2.5 E(vity frequenc)-.25 E 2.5
-(y,)-.15 G(Hertz)-2.5 E 2.5(#d)108 350.4 S(ouble temp_counts %8.8e ,Ra)
--2.5 E 2.5(wP)-.15 G(ressure A/D counts ,Unitless)-2.5 E 2.5(#d)108
-362.4 S(ouble pressure_counts %8.8e ,pressure_counts ,Unitless)-2.5 E
-3.44(#d)108 374.4 S .94(ouble pressure_temp_comp_v)-3.44 F .94
-(oltage_reading %8.8e ,Ra)-.2 F 3.44(wp)-.15 G .94
-(ressure temp compensation v)-3.44 F .94(oltage reading)-.2 F(,V)108
-386.4 Q(olts)-1.29 E 2.5(#d)108 398.4 S(ouble calculated_sound_v)-2.5 E
-(elocity %8.8e ,Calculated sound v)-.15 E(elocity ,M/s)-.15 E 2.5(#b)108
-410.4 S -.15(eg)-2.5 G(in).15 E .991(Users can e)108 434.4 R .991
-(xtract arbitrary te)-.15 F .991(xt lists of v)-.15 F .992
-(alues in the A)-.25 F .992(UV log \214les by using the)-.55 F F2<ad4f>
-3.492 E F0 .992(option repeatedly to)3.492 F 1.453
-(specify \214elds by name \(e.g. calculated_sound_v)108 446.4 R 1.453
-(elocity\) in the order desired. The print formatting state-)-.15 F .63
-(ments \(e.g. %8.8e\) included in the log header is used by def)108
-458.4 R .63(ault. Ho)-.1 F(we)-.25 E -.15(ve)-.25 G 1.43 -.4(r, u).15 H
-.63(sers can use the).4 F F2<ad46>3.13 E F0 .63(option to)3.13 F
-(specify optional formatting for \214elds speci\214ed in follo)108 470.4
-Q(wing)-.25 E F2<ad4f>2.5 E F0(commands.)2.5 E 2.157 -.8(To \214)108
-494.4 T .557(nd out the v).8 F .557(alues contained in an)-.25 F 3.057
-(yp)-.15 G .557(articular log \214le, use the)-3.057 F F2<ad50>3.057 E
-F0 .557(option alone to print out a list of the)3.057 F 1.207
-(contents. Then run)108 506.4 R F2(mbauvloglist)3.707 E F0(ag)3.707 E
-1.207(ain using the)-.05 F F2<ad4f>3.708 E F0 1.208
-(option to specify each of the desired v)3.708 F 1.208(alues in the)-.25
-F .418(desired order of columns. The)108 518.4 R F2<ad46>2.917 E F0 .417
-(option can be used to set the printing format. Otherwise, the def)2.917
-F .417(ault for)-.1 F(-)-.2 E
-(mat speci\214ed in the log header will be used.)108 530.4 Q(The)108
-554.4 Q F2(-M)3.697 E F3(mode)A F0 1.197
-(option sets the output mode. By def)3.697 F 1.197
-(ault, the output will be ASCII te)-.1 F 1.197(xt with tab characters)
--.15 F .667(between \214elds, which is equi)108 566.4 R -.25(va)-.25 G
-.667(lent to).25 F F2(-M)3.167 E F3(0)A F0 3.166(.I)C 3.166(ff)-3.166 G
-(Imode)-3.166 E F3 3.166(=1)3.166 G 3.166(,t)-3.166 G .666
-(hen the output will be ASCII te)-3.166 F .666(xt with comma)-.2 F
-(delimiter)108 578.4 Q .237(s. If mode = 1, then the output will binary\
- values \(8-btye double or 4-byte int values\) with nothing)-.1 F
-(between the desir)108 590.4 Q(ed \214elds.)-.37 E -1.05(Fo)108 614.4 S
-2.814(rl)1.05 G .514 -.1(og \214)-2.814 H .314
-(les that do not include navigation, an e).1 F .314
-(xternal navigation \214le in the "fn)-.2 F .314
-(v" format may be speci\214ed)-.4 F(using the)108 626.4 Q F2(-N)2.5 E F3
-(option.)2.5 E(As of A)108 650.4 Q(ugust 2009, the contents of the MB)
--.2 E(ARI Mapping A)-.25 E(UV missions lo)-.5 E(gs ar)-.1 E(e:)-.37 E
-(Dr)108 674.4 Q(opW)-.45 E(eight.lo)-.92 E 2.5(gC)-.1 G(ontents:)-2.5 E
-(timeT)110.5 686.4 Q .2 -.1(ag t)-.92 H(ime %8.8e ,time ,UNKNO).1 E(WN)
--.5 E(short WDT)110.5 698.4 Q(imer %d ,Count Down T)-.55 E
-(imer ,Seconds)-.55 E(short BWT)110.5 710.4 Q(imer %d ,Burn W)-.55 E(ir)
--.55 E 2.5(eT)-.37 G(imer ,Seconds)-3.05 E(short WDClear %d ,W)110.5
-722.4 Q(atc)-.92 E 2.5(hD)-.15 G .2 -.1(og C)-2.5 H(lear ,Unitless).1 E
-F0(MB-System 5.0)72 768 Q(18 February 2015)135.11 E(1)193.45 E 0 Cg EP
-%%Page: 2 2
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 135.94(mbauvloglist\(1\) MB-System)72 48 R
-135.94(5.0 mbauvloglist\(1\))2.5 F/F1 10/Times-Italic at 0 SF
-(short AcommsDN %d ,Acoustic Comms Dr)110.5 84 Q(op Now ,Unitless)-.45 E
-(short WDStatus %d ,W)110.5 96 Q(atc)-.92 E 2.5(hD)-.15 G .2 -.1(og S)
--2.5 H(tatus ,Unknown).1 E(short D)110.5 108 Q -.92(Wo)-.4 G(ut %d ,Dr)
-.92 E(op W)-.45 E(eight Active ,Unitless)-.92 E(short GulperPr)110.5 120
-Q(oxIn %d ,Gulper Pr)-.45 E(oximity Sensor ,Unitless)-.45 E(adam6017.lo)
-108 144 Q 2.5(gC)-.1 G(ontents:)-2.5 E(timeT)110.5 156 Q .2 -.1(ag t)
--.92 H(ime %8.8e ,time ,UNKNO).1 E(WN)-.5 E(double c)110.5 168 Q
-(han0 %8.8e ,c)-.15 E(han0 ,UNKNO)-.15 E(WN)-.5 E(double c)110.5 180 Q
-(han1 %8.8e ,c)-.15 E(han1 ,UNKNO)-.15 E(WN)-.5 E(double c)110.5 192 Q
-(han2 %8.8e ,c)-.15 E(han2 ,UNKNO)-.15 E(WN)-.5 E(double c)110.5 204 Q
-(han3 %8.8e ,c)-.15 E(han3 ,UNKNO)-.15 E(WN)-.5 E(double c)110.5 216 Q
-(han4 %8.8e ,c)-.15 E(han4 ,UNKNO)-.15 E(WN)-.5 E(double c)110.5 228 Q
-(han5 %8.8e ,c)-.15 E(han5 ,UNKNO)-.15 E(WN)-.5 E(double c)110.5 240 Q
-(han6 %8.8e ,c)-.15 E(han6 ,UNKNO)-.15 E(WN)-.5 E(double c)110.5 252 Q
-(han7 %8.8e ,c)-.15 E(han7 ,UNKNO)-.15 E(WN)-.5 E(ats.lo)108 276 Q 2.5
-(gC)-.1 G(ontents:)-2.5 E(timeT)110.5 288 Q .2 -.1(ag t)-.92 H
-(ime %8.8e ,time ,UNKNO).1 E(WN)-.5 E
-(double AtsDelta %8.8e ,Last ms drift bt Reson and A)110.5 300 Q
-(uv cloc)-.2 E(ks: drift = delta0 \255 \(tReson-tA)-.2 E(uv\) ,seconds)
--.2 E(double AtsDrift %8.8e ,AtsDrift ,seconds)110.5 312 Q(dvl.lo)108
-336 Q 2.5(gC)-.1 G(ontents:)-2.5 E(timeT)110.5 348 Q .2 -.1(ag t)-.92 H
-(ime %8.8e ,time ,UNKNO).1 E(WN)-.5 E(double dvlBotV)110.5 360 Q
-(elx %8.8e ,dvlBotV)-1.11 E(elx ,UNKNO)-1.11 E(WN)-.5 E(double dvlBotV)
-110.5 372 Q(ely %8.8e ,dvlBotV)-1.11 E(ely ,UNKNO)-1.11 E(WN)-.5 E
-(double dvlBotV)110.5 384 Q(elz %8.8e ,dvlBotV)-1.11 E(elz ,UNKNO)-1.11
-E(WN)-.5 E(double dvlBotV)110.5 396 Q(ele %8.8e ,dvlBotV)-1.11 E
-(ele ,UNKNO)-1.11 E(WN)-.5 E(short dvlBotV)110.5 408 Q
-(elStat %d ,dvlBotV)-1.11 E(elStat ,UNKNO)-1.11 E(WN)-.5 E(double dvlW)
-110.5 420 Q(atV)-.92 E(elx %8.8e ,dvlW)-1.11 E(atV)-.92 E(elx ,UNKNO)
--1.11 E(WN)-.5 E(double dvlW)110.5 432 Q(atV)-.92 E(ely %8.8e ,dvlW)
--1.11 E(atV)-.92 E(ely ,UNKNO)-1.11 E(WN)-.5 E(double dvlW)110.5 444 Q
-(atV)-.92 E(elz %8.8e ,dvlW)-1.11 E(atV)-.92 E(elz ,UNKNO)-1.11 E(WN)-.5
-E(double dvlW)110.5 456 Q(atV)-.92 E(ele %8.8e ,dvlW)-1.11 E(atV)-.92 E
-(ele ,UNKNO)-1.11 E(WN)-.5 E(short dvlW)110.5 468 Q(atV)-.92 E
-(elStat %d ,dvlW)-1.11 E(atV)-.92 E(elStat ,UNKNO)-1.11 E(WN)-.5 E
-(double dvlT)110.5 480 Q(emp %8.8e ,dvlT)-.92 E(emp ,UNKNO)-.92 E(WN)-.5
-E(double dvlPitc)110.5 492 Q 2.5(h%)-.15 G(8.8e ,dvlPitc)-2.5 E 2.5(h,)
--.15 G(UNKNO)-2.5 E(WN)-.5 E(double dvlRoll %8.8e ,dvlRoll ,UNKNO)110.5
-504 Q(WN)-.5 E(double dvlHeading %8.8e ,dvlHeading ,UNKNO)110.5 516 Q
-(WN)-.5 E(double dvlBeam1 %4.6f ,dvlBeam1 ,UNKNO)110.5 528 Q(WN)-.5 E
-(double dvlBeam2 %4.6f ,dvlBeam2 ,UNKNO)110.5 540 Q(WN)-.5 E
-(double dvlBeam3 %4.6f ,dvlBeam3 ,UNKNO)110.5 552 Q(WN)-.5 E
-(double dvlBeam4 %8.8e ,dvlBeam4 ,UNKNO)110.5 564 Q(WN)-.5 E
-(double dvlRang)110.5 576 Q 2.5(e%)-.1 G(8.8e ,dvlRang)-2.5 E 2.5(e,)-.1
-G(UNKNO)-2.5 E(WN)-.5 E(double dvlT)110.5 588 Q(oping %20.4f ,dvlT)-.92
-E(oping ,UNKNO)-.92 E(WN)-.5 E
-(double dvlSpdSnd %12.4f ,dvlSpdSnd ,UNKNO)110.5 600 Q(WN)-.5 E
-(dynamicContr)108 624 Q(ol.lo)-.45 E 2.5(gC)-.1 G(ontents:)-2.5 E(timeT)
-110.5 636 Q .2 -.1(ag t)-.92 H(ime %8.8e ,time ,UNKNO).1 E(WN)-.5 E
-(double myT)110.5 648 Q(ime %.2f ,myT)-.55 E(ime ,UNKNO)-.55 E(WN)-.5 E
-(double xT)110.5 660 Q -.15(ra)-.55 G -.2(ck).15 G(Err).2 E
-(or %8.8e ,xT)-.45 E -.15(ra)-.55 G -.2(ck).15 G(Err).2 E(or ,UNKNO)-.45
-E(WN)-.5 E(double cPsi %8.8e ,cPsi ,UNKNO)110.5 672 Q(WN)-.5 E
-(double cDeltaR %8.8e ,cDeltaR ,UNKNO)110.5 684 Q(WN)-.5 E
-(double tPsi %8.8e ,tPsi ,UNKNO)110.5 696 Q(WN)-.5 E(double psiPr)110.5
-708 Q(op %8.8e ,psiPr)-.45 E(op ,UNKNO)-.45 E(WN)-.5 E
-(double psiInt %8.8e ,psiInt ,UNKNO)110.5 720 Q(WN)-.5 E F0
-(MB-System 5.0)72 768 Q(18 February 2015)135.11 E(2)193.45 E 0 Cg EP
-%%Page: 3 3
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 135.94(mbauvloglist\(1\) MB-System)72 48 R
-135.94(5.0 mbauvloglist\(1\))2.5 F/F1 10/Times-Italic at 0 SF
-(double psiRate %8.8e ,psiRate ,UNKNO)110.5 84 Q(WN)-.5 E
-(double xteInte)110.5 96 Q(gr)-.4 E(al %8.8e ,xteInte)-.15 E(gr)-.4 E
-(al ,UNKNO)-.15 E(WN)-.5 E(double kxte %8.8e ,kxte ,UNKNO)110.5 108 Q
-(WN)-.5 E(double dPsi %8.8e ,dPsi ,UNKNO)110.5 120 Q(WN)-.5 E
-(double speedCmd %8.8e ,speedCmd ,UNKNO)110.5 132 Q(WN)-.5 E(double ome)
-110.5 144 Q(gaCmd %8.8e ,ome)-.4 E(gaCmd ,UNKNO)-.4 E(WN)-.5 E
-(double cDepth %8.8e ,cDepth ,UNKNO)110.5 156 Q(WN)-.5 E
-(double tDepth %8.8e ,tDepth ,UNKNO)110.5 168 Q(WN)-.5 E
-(double DepthErr)110.5 180 Q(or %8.8e ,DepthErr)-.45 E(or ,UNKNO)-.45 E
-(WN)-.5 E(double dInte)110.5 192 Q(gr)-.4 E(al %8.8e ,dInte)-.15 E(gr)
--.4 E(al ,UNKNO)-.15 E(WN)-.5 E(double mDepthRateT)110.5 204 Q
-(erm %8.8e ,mDepthRateT)-.92 E(erm ,UNKNO)-.92 E(WN)-.5 E
-(double cTheta %8.8e ,cTheta ,UNKNO)110.5 216 Q(WN)-.5 E(double pitc)
-110.5 228 Q(hPr)-.15 E(op %8.8e ,pitc)-.45 E(hPr)-.15 E(op ,UNKNO)-.45 E
-(WN)-.5 E(double pitc)110.5 240 Q(hInt %8.8e ,pitc)-.15 E(hInt ,UNKNO)
--.15 E(WN)-.5 E(double pitc)110.5 252 Q(hRate %8.8e ,pitc)-.15 E
-(hRate ,UNKNO)-.15 E(WN)-.5 E(double pitc)110.5 264 Q
-(hIntInp %8.8e ,pitc)-.15 E(hIntInp ,UNKNO)-.15 E(WN)-.5 E
-(double cDeltaEBL %8.8e ,cDeltaEBL ,UNKNO)110.5 276 Q(WN)-.5 E
-(double cDeltaE %8.8e ,cDeltaE ,UNKNO)110.5 288 Q(WN)-.5 E(double tar)
-110.5 300 Q -.1(ge)-.37 G(tNorthing %13.2f ,tar).1 E -.1(ge)-.37 G
-(tNorthing ,UNKNO).1 E(WN)-.5 E(double tar)110.5 312 Q -.1(ge)-.37 G
-(tEasting %13.2f ,tar).1 E -.1(ge)-.37 G(tEasting ,UNKNO).1 E(WN)-.5 E
-(double ne)110.5 324 Q(wBearing %8.8e ,ne)-.15 E(wBearing ,UNKNO)-.15 E
-(WN)-.5 E(double ne)110.5 336 Q(wNorthing %13.2f ,ne)-.15 E
-(wNorthing ,UNKNO)-.15 E(WN)-.5 E(double ne)110.5 348 Q
-(wEasting %13.2f ,ne)-.15 E(wEasting ,UNKNO)-.15 E(WN)-.5 E(short \214r)
-110.5 360 Q(st %d ,\214r)-.1 E(st ,UNKNO)-.1 E(WN)-.5 E(fastcatlo)108
-384 Q -.15(g.)-.1 G(lo).15 E 2.5(gC)-.1 G(ontents:)-2.5 E(timeT)110.5
-396 Q .2 -.1(ag t)-.92 H(ime %8.8e ,time ,UNKNO).1 E(WN)-.5 E
-(double conductivity %8.8e ,Calculated conductivity ,Siemens/meter)110.5
-408 Q(double temper)110.5 420 Q(atur)-.15 E 2.5(e%)-.37 G
-(8.8e ,Calculated temper)-2.5 E(atur)-.15 E 2.5(e,)-.37 G(Celsius)-2.5 E
-(double pr)110.5 432 Q(essur)-.37 E 2.5(e%)-.37 G(8.8e ,Calculated pr)
--2.5 E(essur)-.37 E 2.5(e,)-.37 G(Decibar)-2.5 E(s)-.1 E
-(double calculated_salinity %8.8e ,Calculated salinity ,V)110.5 444 Q
-(olts)-1.11 E(double cond_fr)110.5 456 Q
-(equency %8.8e ,Raw Conductivity fr)-.37 E(equency ,Hertz)-.37 E
-(double temp_counts %8.8e ,Raw Pr)110.5 468 Q(essur)-.37 E 2.5(eA)-.37 G
-(/D counts ,Unitless)-2.5 E(double pr)110.5 480 Q(essur)-.37 E
-(e_counts %8.8e ,pr)-.37 E(essur)-.37 E(e_counts ,Unitless)-.37 E 1.66
-(double pr)110.5 492 R(essur)-.37 E(e_temp_comp_volta)-.37 E -.1(ge)-.1
-G(_r).1 E 1.66(eading %8.8e ,Raw pr)-.37 F(essur)-.37 E 4.16(et)-.37 G
-1.66(emp compensation volta)-4.16 F 1.86 -.1(ge r)-.1 H(eading)-.27 E
-(,V)108 504 Q(olts)-1.11 E
-(double calculated_sound_velocity %8.8e ,Calculated sound velocity ,M/s)
-110.5 516 Q(gps.lo)108 540 Q 2.5(gC)-.1 G(ontents:)-2.5 E(timeT)110.5
-552 Q .2 -.1(ag t)-.92 H(ime %8.8e ,time ,UNKNO).1 E(WN)-.5 E(inte)110.5
-564 Q -.1(ge)-.4 G 2.5(rh).1 G(our)-2.5 E 2.5(s%)-.1 G 2.5(d,)-2.5 G
-(Hour)-2.5 E 2.5(s,)-.1 G(Hour)-2.5 E(s)-.1 E(inte)110.5 576 Q -.1(ge)
--.4 G 2.5(rm).1 G(inutes %d ,Minutes ,Minutes)-2.5 E(inte)110.5 588 Q
--.1(ge)-.4 G 2.5(rs).1 G(econds %d ,Seconds ,Seconds)-2.5 E(inte)110.5
-600 Q -.1(ge)-.4 G 2.5(rc).1 G
-(entiSeconds %d ,CentiSeconds ,CentiSeconds)-2.5 E
-(angle latitude %8.8e ,V)110.5 612 Q(ehicle latitude ,De)-1.11 E(gr)-.4
-E(ees)-.37 E(angle longitude %8.8e ,V)110.5 624 Q(ehicle longitude ,De)
--1.11 E(gr)-.4 E(ees)-.37 E
-(short quality %d ,GPS quality code ,Unitless)110.5 636 Q
-(short numberOfSatellites %d ,Number of satellites visible ,Unitless)
-110.5 648 Q(double hdop %8.8e ,Horizontal dilution of pr)110.5 660 Q
-(ecision ,Unitless)-.37 E
-(double antennaHeight %8.8e ,Altitude of GPS antenna abo)110.5 672 Q
-(ve mean sea le)-.1 E(vel ,meter)-.15 E(s)-.1 E(double g)110.5 684 Q
-(eoHeight %8.8e ,Geoidal separ)-.1 E(ation ,meter)-.15 E(s)-.1 E
-(short dgpsDataAg)110.5 696 Q 2.5(e%)-.1 G 2.5(d,)-2.5 G(Ag)-2.5 E 2.5
-(eo)-.1 G 2.5(fd)-2.5 G(if)-2.5 E(fer)-.18 E(ential GPS corr)-.37 E
-(ection ,seconds)-.37 E(short dgpsRSID %d ,Dif)110.5 708 Q(fer)-.18 E
-(ential r)-.37 E(efer)-.37 E(ence station ID ,Unitless)-.37 E F0
-(MB-System 5.0)72 768 Q(18 February 2015)135.11 E(3)193.45 E 0 Cg EP
-%%Page: 4 4
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 135.94(mbauvloglist\(1\) MB-System)72 48 R
-135.94(5.0 mbauvloglist\(1\))2.5 F/F1 10/Times-Italic at 0 SF -.1(ke)108 84
-S(arfott.lo).1 E 2.5(gC)-.1 G(ontents:)-2.5 E(timeT)110.5 96 Q .2 -.1
-(ag t)-.92 H(ime %8.8e ,time ,UNKNO).1 E(WN)-.5 E(inte)110.5 108 Q -.1
-(ge)-.4 G 2.5(rm).1 G(CyclesK %d ,mCyclesK ,UNKNO)-2.5 E(WN)-.5 E(inte)
-110.5 120 Q -.1(ge)-.4 G 2.5(rm).1 G(ModeK %d ,mModeK ,UNKNO)-2.5 E(WN)
--.5 E(inte)110.5 132 Q -.1(ge)-.4 G 2.5(rm).1 G(MonK %d ,mMonK ,UNKNO)
--2.5 E(WN)-.5 E(double mLatK %3.8f ,mLatK ,UNKNO)110.5 144 Q(WN)-.5 E
-(double mLonK %3.8f ,mLonK ,UNKNO)110.5 156 Q(WN)-.5 E
-(double mNorthK %13.2f ,mNorthK ,UNKNO)110.5 168 Q(WN)-.5 E
-(double mEastK %13.2f ,mEastK ,UNKNO)110.5 180 Q(WN)-.5 E
-(double mDepthK %8.8e ,mDepthK ,UNKNO)110.5 192 Q(WN)-.5 E
-(double mRollK %8.8e ,mRollK ,UNKNO)110.5 204 Q(WN)-.5 E(double mPitc)
-110.5 216 Q(hK %8.8e ,mPitc)-.15 E(hK ,UNKNO)-.15 E(WN)-.5 E
-(double mHeadK %8.8e ,mHeadK ,UNKNO)110.5 228 Q(WN)-.5 E
-(double mVbodyxK %8.8e ,mVbodyxK ,UNKNO)110.5 240 Q(WN)-.5 E
-(double mVbodyyK %8.8e ,mVbodyyK ,UNKNO)110.5 252 Q(WN)-.5 E
-(double mVbodyzK %8.8e ,mVbodyzK ,UNKNO)110.5 264 Q(WN)-.5 E
-(double mAccelxK %8.8e ,mAccelxK ,UNKNO)110.5 276 Q(WN)-.5 E
-(double mAccelyK %8.8e ,mAccelyK ,UNKNO)110.5 288 Q(WN)-.5 E
-(double mAccelzK %8.8e ,mAccelzK ,UNKNO)110.5 300 Q(WN)-.5 E(double mPr)
-110.5 312 Q(ateK %8.8e ,mPr)-.15 E(ateK ,UNKNO)-.15 E(WN)-.5 E
-(double mQr)110.5 324 Q(ateK %8.8e ,mQr)-.15 E(ateK ,UNKNO)-.15 E(WN)-.5
-E(double mRr)110.5 336 Q(ateK %8.8e ,mRr)-.15 E(ateK ,UNKNO)-.15 E(WN)
--.5 E(double utcT)110.5 348 Q(ime %8.8e ,utcT)-.55 E(ime ,UNKNO)-.55 E
-(WN)-.5 E(m3dmgx1.lo)108 372 Q 2.5(gC)-.1 G(ontents:)-2.5 E(timeT)110.5
-384 Q .2 -.1(ag t)-.92 H(ime %8.8e ,time ,UNKNO).1 E(WN)-.5 E
-(angle mRollCB %8.8e ,Roll ,De)110.5 396 Q(gr)-.4 E(ees)-.37 E
-(angle mOme)110.5 408 Q(ga_xCB %8.8e ,Roll r)-.4 E(ate ,De)-.15 E(gr)-.4
-E(ees/second)-.37 E(angle mPitc)110.5 420 Q(hCB %8.8e ,Pitc)-.15 E 2.5
-(h,)-.15 G(De)-2.5 E(gr)-.4 E(ees)-.37 E(angle mOme)110.5 432 Q
-(ga_yCB %8.8e ,Pitc)-.4 E 2.5(hr)-.15 G(ate ,De)-2.65 E(gr)-.4 E
-(ees/second)-.37 E(angle mY)110.5 444 Q(awCB %8.8e ,Y)-.92 E(aw ,De)-.92
-E(gr)-.4 E(ees)-.37 E(angle mOme)110.5 456 Q(ga_zCB %8.8e ,Y)-.4 E(aw r)
--.92 E(ate ,De)-.15 E(gr)-.4 E(ees/second)-.37 E
-(double mAccel_xCB %8.8e ,Acceler)110.5 468 Q
-(ation along vehicle x-axis ,G)-.15 E(double mAccel_yCB %8.8e ,Acceler)
-110.5 480 Q(ation along vehicle y-axis ,G)-.15 E
-(double mAccel_zCB %8.8e ,Acceler)110.5 492 Q
-(ation along vehicle z-axis ,G)-.15 E(double mMa)110.5 504 Q
-(g_xCB %8.8e ,Ma)-.1 E(gnetic \214eld along vehicle x-axis ,Gauss)-.1 E
-(double mMa)110.5 516 Q(g_yCB %8.8e ,Ma)-.1 E
-(gnetic \214eld along vehicle y-axis ,Gauss)-.1 E(double mMa)110.5 528 Q
-(g_zCB %8.8e ,Ma)-.1 E(gnetic \214eld along vehicle z-axis ,Gauss)-.1 E
-(double mT)110.5 540 Q(empCB %8.8e ,Cr)-.92 E(ossbow internal temper)
--.45 E(atur)-.15 E 2.5(e,)-.37 G(Celsius)-2.5 E(navigation.lo)108 564 Q
-2.5(gC)-.1 G(ontents:)-2.5 E(timeT)110.5 576 Q .2 -.1(ag t)-.92 H
-(ime %8.8e ,time ,UNKNO).1 E(WN)-.5 E(double mP)110.5 588 Q
-(os_x %13.2f ,V)-.8 E(ehicle Northing \(WGS 84 Zone 10S\) ,Meter)-1.11 E
-(s)-.1 E(double mP)110.5 600 Q(os_y %13.2f ,V)-.8 E
-(ehicle Easting \(WGS 84 Zone 10S\) ,Meter)-1.11 E(s)-.1 E
-(double mDepth %8.8e ,V)110.5 612 Q(ehicle Depth ,Meter)-1.11 E(s)-.1 E
-(double mGpsNorth %13.2f ,Northing \(WGS 84 Zone 10S\) based upon GPS \
-\214x ,Meter)110.5 624 Q(s)-.1 E(double mGpsEast %13.2f ,Easting \(WGS \
-84 Zone 10S\) based upon GPS \214x ,Meter)110.5 636 Q(s)-.1 E(inte)110.5
-648 Q -.1(ge)-.4 G 2.5(rm).1 G(GpsV)-2.5 E
-(alid %d ,GPS \214x Status code ,Unitless)-1.11 E(double mPhi %8.8e ,V)
-110.5 660 Q(ehicle r)-1.11 E(oll ,De)-.45 E(gr)-.4 E(ees)-.37 E
-(double mTheta %8.8e ,V)110.5 672 Q(ehicle pitc)-1.11 E 2.5(h,)-.15 G
-(De)-2.5 E(gr)-.4 E(ees)-.37 E(double mPsi %8.8e ,V)110.5 684 Q
-(ehicle yaw ,De)-1.11 E(gr)-.4 E(ees)-.37 E(double mOme)110.5 696 Q
-(ga_x %8.8e ,V)-.4 E(ehicle r)-1.11 E(oll r)-.45 E(ate ,De)-.15 E(gr)-.4
-E(ees/second)-.37 E(double mOme)110.5 708 Q(ga_y %8.8e ,V)-.4 E
-(ehicle pitc)-1.11 E 2.5(hr)-.15 G(ate ,De)-2.65 E(gr)-.4 E(ees/second)
--.37 E(double mOme)110.5 720 Q(ga_z %8.8e ,V)-.4 E(ehicle yaw r)-1.11 E
-(ate ,De)-.15 E(gr)-.4 E(ees/second)-.37 E F0(MB-System 5.0)72 768 Q
-(18 February 2015)135.11 E(4)193.45 E 0 Cg EP
-%%Page: 5 5
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 135.94(mbauvloglist\(1\) MB-System)72 48 R
-135.94(5.0 mbauvloglist\(1\))2.5 F/F1 10/Times-Italic at 0 SF
-(double mPsaRang)110.5 84 Q 2.5(e%)-.1 G(8.8e ,Altimeter r)-2.5 E(ang)
--.15 E 2.5(e,)-.1 G(Meter)-2.5 E(s)-.1 E(double mAltitude %8.8e ,V)110.5
-96 Q(ehicle altitude abo)-1.11 E(ve bottom ,Meter)-.1 E(s)-.1 E
-(double mDvlAltitude %8.8e ,mDvlAltitude ,UNKNO)110.5 108 Q(WN)-.5 E
-(double mW)110.5 120 Q(aterSpeed %8.8e ,Curr)-.92 E
-(ent speed based upon D)-.37 E(VL data ,Meter)-.4 E(s/second)-.1 E(inte)
-110.5 132 Q -.1(ge)-.4 G 2.5(rm).1 G(DvlV)-2.5 E
-(alid %d ,Dvl valid \215a)-1.11 E 2.5(gi)-.1 G 2.5(nN)-2.5 G
-(avigation ,UNKNO)-2.5 E(WN)-.5 E(inte)110.5 144 Q -.1(ge)-.4 G 2.5(rm)
-.1 G(DvlNe)-2.5 E(wData %d ,Navigation thinks the Dvl has ne)-.15 E 2.5
-(wd)-.15 G(ata ,UNKNO)-2.5 E(WN)-.5 E(double mDeltaT %8.8e ,T)110.5 156
-Q(ime between Dvl updates ,Seconds)-.55 E(double n\214x %13.2f ,Northin\
-g \(WGS 84 Zone 10S\) based upon baseline \214x ,Meter)110.5 168 Q(s)-.1
-E(double e\214x %13.2f ,Easting \(WGS 84 Zone 10S\) based upon baseline\
- \214x ,Meter)110.5 180 Q(s)-.1 E(double \214lter_north %13.2f ,Kalman \
-\214lter northing \(WGS 84 Zone 10S\) ,Meter)110.5 192 Q(s)-.1 E(double\
- \214lter_east %13.2f ,Kalman \214lter easting \(WGS 84 Zone 10S\) ,Met\
-er)110.5 204 Q(s)-.1 E
-(double \214lter_depth %8.8e ,Kalman \214lter depth ,Meter)110.5 216 Q
-(s)-.1 E(double north_curr)110.5 228 Q(ent %8.8e ,Northwar)-.37 E 2.5
-<648d>-.37 G(owing curr)-2.5 E(ent estimate ,Meter)-.37 E(s/second)-.1 E
-(double east_curr)110.5 240 Q(ent %8.8e ,Eastwar)-.37 E 2.5<648d>-.37 G
-(owing curr)-2.5 E(ent estimate ,Meter)-.37 E(s/second)-.1 E(double spe\
-ed_bias %8.8e ,Speed bias based upon long baseline \214xes ,Meter)110.5
-252 Q(s/second)-.1 E(double heading_bias %8.8e ,Heading bias based upon\
- long baseline \214xes ,De)110.5 264 Q(gr)-.4 E(ees)-.37 E
-(double latitude %5.8f ,latitude ,UNKNO)110.5 276 Q(WN)-.5 E
-(double longitude %5.8f ,longitude ,UNKNO)110.5 288 Q(WN)-.5 E(par)108
-312 Q(osci.lo)-.45 E 2.5(gC)-.1 G(ontents:)-2.5 E(timeT)110.5 324 Q .2
--.1(ag t)-.92 H(ime %8.8e ,time ,UNKNO).1 E(WN)-.5 E
-(double depth %8.3lf ,Depth ,Meter)110.5 336 Q(s)-.1 E
-(double temp %8.8e ,Pr)110.5 348 Q(essur)-.37 E 2.5(eS)-.37 G
-(ensor Internal T)-2.5 E(emp ,Celsius)-.92 E(double pr)110.5 360 Q
-(essur)-.37 E 2.5(e%)-.37 G(8.8lf ,Pr)-2.5 E(essur)-.37 E 2.5(e,)-.37 G
-(Bar)-2.5 E(s)-.1 E(double temp_period %8.8lf ,T)110.5 372 Q(emper)-.92
-E(atur)-.15 E 2.5(eP)-.37 G(eriod ,Micr)-3.3 E(oseconds)-.45 E
-(double pr)110.5 384 Q(es_period %8.8lf ,Pr)-.37 E(essur)-.37 E 2.5(eP)
--.37 G(eriod ,Micr)-3.3 E(oseconds)-.45 E(tailCone)108 408 Q(.lo)-.15 E
-2.5(gC)-.1 G(ontents:)-2.5 E(timeT)110.5 420 Q .2 -.1(ag t)-.92 H
-(ime %8.8e ,time ,UNKNO).1 E(WN)-.5 E(inte)110.5 432 Q -.1(ge)-.4 G 2.5
-(rs).1 G(tatus %d ,status ,UNKNO)-2.5 E(WN)-.5 E(inte)110.5 444 Q -.1
-(ge)-.4 G 2.5(re).1 G(le)-2.5 E(vatorCurr)-.15 E(ent %d ,ele)-.37 E
-(vatorCurr)-.15 E(ent ,UNKNO)-.37 E(WN)-.5 E(inte)110.5 456 Q -.1(ge)-.4
-G 2.5(rr).1 G(udderCurr)-2.5 E(ent %d ,rudderCurr)-.37 E(ent ,UNKNO)-.37
-E(WN)-.5 E(\215oat pr)110.5 468 Q(opCurr)-.45 E(ent1 %f ,pr)-.37 E
-(opCurr)-.45 E(ent1 ,UNKNO)-.37 E(WN)-.5 E(inte)110.5 480 Q -.1(ge)-.4 G
-2.5(rp).1 G -.45(ro)-2.5 G(pCurr).45 E(ent2 %d ,pr)-.37 E(opCurr)-.45 E
-(ent2 ,UNKNO)-.37 E(WN)-.5 E(inte)110.5 492 Q -.1(ge)-.4 G 2.5(rp).1 G
--.45(ro)-2.5 G(pRpm %d ,pr).45 E(opRpm ,UNKNO)-.45 E(WN)-.5 E
-(\215oat ele)110.5 504 Q(vatorAngle %f ,ele)-.15 E(vatorAngle ,UNKNO)
--.15 E(WN)-.5 E(\215oat rudderAngle %f ,rudderAngle ,UNKNO)110.5 516 Q
-(WN)-.5 E(inte)110.5 528 Q -.1(ge)-.4 G 2.5(rp).1 G -.45(ro)-2.5 G
-(pPwm %d ,pr).45 E(opPwm ,UNKNO)-.45 E(WN)-.5 E(inte)110.5 540 Q -.1(ge)
--.4 G 2.5(rp).1 G -.45(ro)-2.5 G(pT).45 E(emp %d ,pr)-.92 E(opT)-.45 E
-(emp ,UNKNO)-.92 E(WN)-.5 E/F2 10.95/Times-Bold at 0 SF -.548(AU)72 568.8 S
-(THORSHIP).548 E F0(Da)108 580.8 Q(vid W)-.2 E 2.5(.C)-.92 G
-(aress \(caress at mbari.or)-2.5 E(g\))-.18 E(Montere)113 592.8 Q 2.5(yB)
--.15 G(ay Aquarium Research Institute)-2.5 E
-(Dale N. Chayes \(dale at ldeo.columbia.edu\))108 604.8 Q
-(Lamont-Doherty Earth Observ)113 616.8 Q(atory)-.25 E F2(OPTIONS)72
-645.6 Q/F3 10/Times-Bold at 0 SF<ad48>108 657.6 Q F0 .162(This "help" \215\
-ag cause the program to print out a description of its operation and th\
-en e)22.52 F .161(xit immedi-)-.15 F(ately)144 669.6 Q(.)-.65 E F3<ad46>
-108 686.4 Q F1(printformat)24.19 E F0 1.347
-(Sets the printing format \(in fprintf\(\) style\) of the ne)144 698.4 R
-1.348(xt v)-.15 F 1.348(alue speci\214ed using the)-.25 F F3<ad4f>3.848
-E F0 1.348(option. By)3.848 F(def)144 710.4 Q(ault,)-.1 E F3
-(mbauvloglist)3.682 E F0 1.182
-(uses the print format speci\214ed in the log \214le header)3.682 F
-3.682(.I)-.55 G 3.682(ft)-3.682 G(he)-3.682 E F3(-F)3.682 E F0 1.181
-(option has)3.681 F 1.455(been used, using it ag)144 722.4 R 1.455
-(ain with)-.05 F F1(printformat)3.955 E F0 1.456(equal to "def)3.956 F
-1.456(ault" will reset the print format to that)-.1 F(MB-System 5.0)72
-768 Q(18 February 2015)135.11 E(5)193.45 E 0 Cg EP
-%%Page: 6 6
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 135.94(mbauvloglist\(1\) MB-System)72 48 R
-135.94(5.0 mbauvloglist\(1\))2.5 F(speci\214ed in the log \214le header)
-144 84 Q(.)-.55 E/F1 10/Times-Bold at 0 SF<ad49>108 100.8 Q/F2 10
-/Times-Italic at 0 SF(i\214le)26.41 E F0(Sets the input MB)144 112.8 Q
-(ARI A)-.35 E(UV mission log)-.55 E(\214lename.)5 E F1<ad4c>108 129.6 Q
-F2(lon\215ip)23.63 E F0 .129(Sets the range of the longitude v)144 141.6
-R .129(alues output.)-.25 F(If)5.129 E F2(lon\215ip)2.629 E F0 .129
-(=\2551 then the longitude v)B .128(alues will be in the)-.25 F .02
-(range from \255360 to 0 de)144 153.6 R .02(grees. If)-.15 F F2
-(lon\215ip)2.52 E F0 .021(=0 then the longitude v)B .021
-(alues will be in the range from \255180)-.25 F .702(to 180 de)144 165.6
-R .702(grees. If)-.15 F F2(lon\215ip)3.202 E F0 .702
-(=1 then the longitude v)B .701
-(alues will be in the range from 0 to 360 de)-.25 F(grees.)-.15 E(Def)
-144 177.6 Q(ault:)-.1 E F1(mbauvloglist)2.5 E F0(uses the user def)2.5 E
-(ault)-.1 E F2(lon\215ip)2.5 E F0(set using)2.5 E F1(mbdefaults)2.5 E F0
-(.)A F1<ad4d>108 194.4 Q F2(mode)20.86 E F0 .44
-(Speci\214es the output mode. If)144 206.4 R F2(mode)2.94 E F0 2.94(=0)
-2.94 G 2.94(,t)-2.94 G .44(hen the output is ASCII te)-2.94 F .44
-(xt with tab delimiters between)-.15 F .088(\214elds. If)144 218.4 R F2
-(mode)2.588 E F0 2.588(=1)2.588 G 2.587(,t)-2.588 G .087
-(hen the output is ASCII te)-2.587 F .087
-(xt with comma delimiters between \214elds.)-.15 F(If)5.087 E F2(mode)
-2.587 E F0(=)2.587 E .597(2, then the output is binary with no v)144
-230.4 R .597(alues or breaks between \214elds. Def)-.25 F .597
-(ault: ASCII te)-.1 F .597(xt with tab)-.15 F(delimiters.)144 242.4 Q F1
-<ad4e>108 259.2 Q F2(nav\214le)23.08 E F0 1.145(Speci\214es a na)144
-271.2 R(vig)-.2 E 1.145(ation \214le in the "fn)-.05 F 1.144
-(v" format that contains position, heading, sensor depth, and)-.4 F
-(attitude data. V)144 283.2 Q(alues mer)-1.11 E(ged \(interpolated\) fr\
-om these data can be speci\214ed for output using the)-.18 E(mer)156.5
-295.2 Q(geLon)-.18 E(mer)156.5 307.2 Q(geLat)-.18 E(mer)156.5 319.2 Q
-(geHeading)-.18 E(mer)156.5 331.2 Q(geSpeed)-.18 E(mer)156.5 343.2 Q
-(geDraft)-.18 E(mer)156.5 355.2 Q(geSensordepth)-.18 E(mer)156.5 367.2 Q
-(geRoll)-.18 E(mer)156.5 379.2 Q(gePitch)-.18 E(mer)156.5 391.2 Q(geHea)
--.18 E -.15(ve)-.2 G -.25(va)144 403.2 S(luenames in the).25 E F1(-O)2.5
-E F0(option.)2.5 E F1<ad4f>108 420 Q F2(valuename)22.52 E F0(Causes)144
-432 Q F1(mbauvloglist)3.372 E F0 .872(to output the speci\214ed v)3.372
-F .872(alue. This option can be gi)-.25 F -.15(ve)-.25 G 3.372(nm).15 G
-.873(ultiple times, and)-3.372 F 1.768(the v)144 444 R 1.768
-(alues will be output in the order speci\214ed.)-.25 F 1.767(The v)6.767
-F 1.767(alid v)-.25 F 1.767(aluename strings consist of those)-.25 F
-(de\214ned in the header of the log \214le being parsed, plus the follo)
-144 456 Q(wing:)-.25 E(zero)156.5 468 Q(timeT)156.5 480 Q(ag)-.8 E(mer)
-156.5 492 Q(geLon)-.18 E(mer)156.5 504 Q(geLat)-.18 E(mer)156.5 516 Q
-(geHeading)-.18 E(mer)156.5 528 Q(geSpeed)-.18 E(mer)156.5 540 Q
-(geDraft)-.18 E(mer)156.5 552 Q(geSensordepth)-.18 E(mer)156.5 564 Q
-(geRoll)-.18 E(mer)156.5 576 Q(gePitch)-.18 E(mer)156.5 588 Q(geHea)-.18
-E -.15(ve)-.2 G .672(All of the special v)144 600 R .673
-(alues are double v)-.25 F .673(alues. Those be)-.25 F .673
-(ginning with "mer)-.15 F .673(ge" deri)-.18 F .973 -.15(ve f)-.25 H
-.673(rom interpola-).15 F(tion of data from an e)144 612 Q(xternal na)
--.15 E(vig)-.2 E(ation \214le speci\214ed using the)-.05 E F1(-N)2.5 E
-F0(option.)2.5 E F1<ad50>108 628.8 Q F0
-(Prints out the log \214le header)144 640.8 Q(.)-.55 E F1<ad53>108 657.6
-Q F0(Scales angular v)144 669.6 Q(alues to be in de)-.25 E
-(grees instead of radians.)-.15 E F1<ad56>108 686.4 Q F0(The)23.08 E F1
-<ad56>2.5 E F0(option causes the program to be v)2.5 E(erbose.)-.15 E/F3
-10.95/Times-Bold at 0 SF(EXAMPLE)72 703.2 Q F0 1.6 -.8(To e)108 715.2 T
-(xtract a list of pressure and w).65 E
-(ater sound speed from the CTD log of an A)-.1 E(UV mission, use:)-.55 E
-(mbauvloglist \255I mvc_logs/2006.224.00/f)144 727.2 Q(astcatlog.log \\)
--.1 E(MB-System 5.0)72 768 Q(18 February 2015)135.11 E(6)193.45 E 0 Cg
-EP
-%%Page: 7 7
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 135.94(mbauvloglist\(1\) MB-System)72 48 R
-135.94(5.0 mbauvloglist\(1\))2.5 F
-(-F%f \255O pressure \255O calculated_sound_v)180 84 Q(elocity)-.15 E
-.353(This simple list is ordered as the data were collected, follo)108
-96 R .353(wing the ups and do)-.25 F .353(wns of the A)-.25 F .353
-(UV mission. In)-.55 F 1.456(order to construct a model of the w)108 108
-R 1.456
-(ater sound speed as a function of depth, one can sort the output of)-.1
-F/F1 10/Times-Bold at 0 SF(mbauvloglist)108 120 Q F0 .486
-(\(using the program)2.986 F F1(sort)2.986 E F0 2.986(\)t)C 2.986(ob)
--2.986 G 2.986(eo)-2.986 G .485
-(rdered with increasing pressure \(depth\), and then resampled)-2.986 F
-(into uniform increments of pressure using the)108 132 Q F1(GMT)2.5 E F0
-(program)2.5 E F1(sample1d)2.5 E F0(.)A
-(mbauvloglist \255I mvc_logs/2006.224.00/f)144 144 Q(astcatlog.log \\)
--.1 E(-F%f \255O pressure \255O calculated_sound_v)180 156 Q(elocity \\)
--.15 E 2.5(|s)180 168 S(ort \255n \255u > auv_ssv)-2.5 E(.txt)-.65 E
-(sample1d auv_ssv)144 180 Q
-(.txt \255Fl \255H1 \255S0.0 \255I10.0 > auv_ssv_bin.txt)-.65 E/F2 10.95
-/Times-Bold at 0 SF(SEE ALSO)72 208.8 Q F1(mbsystem)108 220.8 Q F0(\(1\),)A
-F1(sample1d)2.5 E F0(,)A F1(sort)2.5 E F0(.)A F2 -.11(BU)72 249.6 S(GS)
-.11 E F0(Indubitably)108 261.6 Q(.)-.65 E(MB-System 5.0)72 768 Q
-(18 February 2015)135.11 E(7)193.45 E 0 Cg EP
-%%Trailer
-end
-%%EOF
diff --git a/src/ps/mbauvnavusbl.ps b/src/ps/mbauvnavusbl.ps
deleted file mode 100644
index 70c2661..0000000
--- a/src/ps/mbauvnavusbl.ps
+++ /dev/null
@@ -1,295 +0,0 @@
-%!PS-Adobe-3.0
-%%Creator: groff version 1.19.2
-%%CreationDate: Wed Jul  1 12:29:26 2015
-%%DocumentNeededResources: font Times-Roman
-%%+ font Times-Bold
-%%+ font Times-Italic
-%%DocumentSuppliedResources: procset grops 1.19 2
-%%Pages: 1
-%%PageOrder: Ascend
-%%DocumentMedia: Default 612 792 0 () ()
-%%Orientation: Portrait
-%%EndComments
-%%BeginDefaults
-%%PageMedia: Default
-%%EndDefaults
-%%BeginProlog
-%%BeginResource: procset grops 1.19 2
-%!PS-Adobe-3.0 Resource-ProcSet
-/setpacking where{
-pop
-currentpacking
-true setpacking
-}if
-/grops 120 dict dup begin
-/SC 32 def
-/A/show load def
-/B{0 SC 3 -1 roll widthshow}bind def
-/C{0 exch ashow}bind def
-/D{0 exch 0 SC 5 2 roll awidthshow}bind def
-/E{0 rmoveto show}bind def
-/F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def
-/G{0 rmoveto 0 exch ashow}bind def
-/H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/I{0 exch rmoveto show}bind def
-/J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def
-/K{0 exch rmoveto 0 exch ashow}bind def
-/L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/M{rmoveto show}bind def
-/N{rmoveto 0 SC 3 -1 roll widthshow}bind def
-/O{rmoveto 0 exch ashow}bind def
-/P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/Q{moveto show}bind def
-/R{moveto 0 SC 3 -1 roll widthshow}bind def
-/S{moveto 0 exch ashow}bind def
-/T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/SF{
-findfont exch
-[exch dup 0 exch 0 exch neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/MF{
-findfont
-[5 2 roll
-0 3 1 roll
-neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/level0 0 def
-/RES 0 def
-/PL 0 def
-/LS 0 def
-/MANUAL{
-statusdict begin/manualfeed true store end
-}bind def
-/PLG{
-gsave newpath clippath pathbbox grestore
-exch pop add exch pop
-}bind def
-/BP{
-/level0 save def
-1 setlinecap
-1 setlinejoin
-72 RES div dup scale
-LS{
-90 rotate
-}{
-0 PL translate
-}ifelse
-1 -1 scale
-}bind def
-/EP{
-level0 restore
-showpage
-}def
-/DA{
-newpath arcn stroke
-}bind def
-/SN{
-transform
-.25 sub exch .25 sub exch
-round .25 add exch round .25 add exch
-itransform
-}bind def
-/DL{
-SN
-moveto
-SN
-lineto stroke
-}bind def
-/DC{
-newpath 0 360 arc closepath
-}bind def
-/TM matrix def
-/DE{
-TM currentmatrix pop
-translate scale newpath 0 0 .5 0 360 arc closepath
-TM setmatrix
-}bind def
-/RC/rcurveto load def
-/RL/rlineto load def
-/ST/stroke load def
-/MT/moveto load def
-/CL/closepath load def
-/Fr{
-setrgbcolor fill
-}bind def
-/setcmykcolor where{
-pop
-/Fk{
-setcmykcolor fill
-}bind def
-}if
-/Fg{
-setgray fill
-}bind def
-/FL/fill load def
-/LW/setlinewidth load def
-/Cr/setrgbcolor load def
-/setcmykcolor where{
-pop
-/Ck/setcmykcolor load def
-}if
-/Cg/setgray load def
-/RE{
-findfont
-dup maxlength 1 index/FontName known not{1 add}if dict begin
-{
-1 index/FID ne{def}{pop pop}ifelse
-}forall
-/Encoding exch def
-dup/FontName exch def
-currentdict end definefont pop
-}bind def
-/DEFS 0 def
-/EBEGIN{
-moveto
-DEFS begin
-}bind def
-/EEND/end load def
-/CNT 0 def
-/level1 0 def
-/PBEGIN{
-/level1 save def
-translate
-div 3 1 roll div exch scale
-neg exch neg exch translate
-0 setgray
-0 setlinecap
-1 setlinewidth
-0 setlinejoin
-10 setmiterlimit
-[]0 setdash
-/setstrokeadjust where{
-pop
-false setstrokeadjust
-}if
-/setoverprint where{
-pop
-false setoverprint
-}if
-newpath
-/CNT countdictstack def
-userdict begin
-/showpage{}def
-/setpagedevice{}def
-}bind def
-/PEND{
-countdictstack CNT sub{end}repeat
-level1 restore
-}bind def
-end def
-/setpacking where{
-pop
-setpacking
-}if
-%%EndResource
-%%EndProlog
-%%BeginSetup
-%%BeginFeature: *PageSize Default
-<< /PageSize [ 612 792 ] /ImagingBBox null >> setpagedevice
-%%EndFeature
-%%IncludeResource: font Times-Roman
-%%IncludeResource: font Times-Bold
-%%IncludeResource: font Times-Italic
-grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72
-def/PL 792 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron/Zcaron
-/scaron/zcaron/Ydieresis/trademark/quotesingle/Euro/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/space/exclam/quotedbl/numbersign/dollar/percent
-/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen
-/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon
-/semicolon/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O
-/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright/circumflex
-/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y
-/z/braceleft/bar/braceright/tilde/.notdef/quotesinglbase/guillemotleft
-/guillemotright/bullet/florin/fraction/perthousand/dagger/daggerdbl
-/endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut
-/dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash
-/quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen
-/brokenbar/section/dieresis/copyright/ordfeminine/guilsinglleft
-/logicalnot/minus/registered/macron/degree/plusminus/twosuperior
-/threesuperior/acute/mu/paragraph/periodcentered/cedilla/onesuperior
-/ordmasculine/guilsinglright/onequarter/onehalf/threequarters
-/questiondown/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE
-/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex
-/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis
-/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn
-/germandbls/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla
-/egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis
-/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide/oslash
-/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis]def
-/Times-Italic at 0 ENC0/Times-Italic RE/Times-Bold at 0 ENC0/Times-Bold RE
-/Times-Roman at 0 ENC0/Times-Roman RE
-%%EndSetup
-%%Page: 1 1
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mbauvna)72 48 Q 130.04(vusbl\(1\) MB-System)-.2
-F 130.04(5.0 mbauvna)2.5 F(vusbl\(1\))-.2 E/F1 10.95/Times-Bold at 0 SF
--.219(NA)72 84 S(ME).219 E/F2 10/Times-Bold at 0 SF(mbauvna)108 96 Q(vusbl)
--.25 E F0 3.46<ad41>3.46 G .96(djusts inertial na)-3.46 F(vig)-.2 E .96
-(ation of a submer)-.05 F .96(ged platform/v)-.18 F .96
-(ehicle to be consistent with more)-.15 F(accurate b)108 108 Q
-(ut less precise surf)-.2 E(ace tracking \(USBL\) na)-.1 E(vig)-.2 E
-(ation.)-.05 E F1(VERSION)72 136.8 Q F0 -1.11(Ve)108 148.8 S(rsion 5.0)
-1.11 E F1(SYNOPSIS)72 177.6 Q F2(mbauvna)108 189.6 Q(vusbl \255I)-.25 E
-/F3 10/Times-Italic at 0 SF(inav\214le)A F0([)2.5 E F2<ad4c20ad4f>A F3
-(onav\214le)A F2<ad55>5 E F3(usbl\214le)A F2<ad5620ad48>A F0(])2.5 E F1
-(DESCRIPTION)72 218.4 Q F0(MBauvna)108 230.4 Q .459
-(vusbl reads a primary na)-.2 F(vig)-.2 E .459
-(ation \214le \(usually from a submer)-.05 F .459(ged platform sw)-.18 F
-.46(ath surv)-.1 F -.15(ey)-.15 G 2.96(\)a).15 G .46(nd also)-2.96 F
-1.355(reads secondary na)108 242.4 R(vig)-.2 E 1.355
-(ation \(e.g. USBL \214x)-.05 F 3.855(es\). The)-.15 F 1.354
-(program calculates position of)3.855 F 1.354(fsets between the ra)-.25
-F(w)-.15 E(surv)108 254.4 Q .395 -.15(ey n)-.15 H -.2(av).15 G(ig).2 E
-.095(ation and the secondary na)-.05 F(vig)-.2 E .095(ation e)-.05 F
--.15(ve)-.25 G .095
-(ry 3600 seconds \(10 minutes\), and then linearly interpo-).15 F
-(lates and applies this adjustment v)108 266.4 Q
-(ector for each primary na)-.15 E(vig)-.2 E(ation position.)-.05 E .775
-(The inertial na)108 290.4 R(vig)-.2 E .775
-(ation is read in format 166 and the USBL na)-.05 F(vig)-.2 E .774
-(ation is read from format 165 \214les. The)-.05 F(adjusted na)108 302.4
-Q(vig)-.2 E(ation is output in format 166.)-.05 E F1 -.548(AU)72 331.2 S
-(THORSHIP).548 E F0(Da)108 343.2 Q(vid W)-.2 E 2.5(.C)-.92 G
-(aress \(caress at mbari.or)-2.5 E(g\))-.18 E(Montere)113 355.2 Q 2.5(yB)
--.15 G(ay Aquarium Research Institute)-2.5 E
-(Dale N. Chayes \(dale at ldeo.columbia.edu\))108 367.2 Q
-(Lamont-Doherty Earth Observ)113 379.2 Q(atory)-.25 E F1(OPTIONS)72 408
-Q F2<ad48>108 420 Q F0 .162(This "help" \215ag cause the program to pri\
-nt out a description of its operation and then e)22.52 F .162
-(xit immedi-)-.15 F(ately)144 432 Q(.)-.65 E F2<ad49>108 448.8 Q F3
-(inav\214le)26.41 E F0(Sets the input na)144 460.8 Q(vig)-.2 E
-(ation \214lename. The na)-.05 E(vig)-.2 E
-(ation data must be in format 166.)-.05 E F2<ad4c>5 E F3(lon\215ip)2.5 E
-F0 .554(Sets the range of the longitude v)144 472.8 R .554(alues used.)
--.25 F(If)5.554 E F3(lon\215ip)3.054 E F0 .554
-(=\2551 then the longitude v)B .554(alues will be in the)-.25 F .02
-(range from \255360 to 0 de)144 484.8 R .02(grees. If)-.15 F F3
-(lon\215ip)2.52 E F0 .021(=0 then the longitude v)B .021
-(alues will be in the range from \255180)-.25 F .702(to 180 de)144 496.8
-R .702(grees. If)-.15 F F3(lon\215ip)3.202 E F0 .702
-(=1 then the longitude v)B .701
-(alues will be in the range from 0 to 360 de)-.25 F(grees.)-.15 E(Def)
-144 508.8 Q(ault:)-.1 E F2(mbauvna)2.5 E(vusbl)-.25 E F0
-(uses the user def)2.5 E(ault)-.1 E F3(lon\215ip)2.5 E F0(set using)2.5
-E F2(mbdefaults)2.5 E F0(.)A F2<ad4f>108 525.6 Q F3(onav\214le)22.52 E
-F0(Sets the output na)144 537.6 Q(vig)-.2 E(ation \214lename. The na)
--.05 E(vig)-.2 E(ation data will be in format 166.)-.05 E F2<ad55>108
-554.4 Q F3(usbl\214le)23.08 E F0(Sets the input usbl na)144 566.4 Q(vig)
--.2 E(ation \214lename. The usbl na)-.05 E(vig)-.2 E
-(ation data must be in format 165.)-.05 E F2<ad56>108 583.2 Q F0(The)
-23.08 E F2<ad56>2.5 E F0(option causes the program to be v)2.5 E
-(erbose.)-.15 E F1(EXAMPLE)72 600 Q F0(Coming...)108 612 Q F1(SEE ALSO)
-72 640.8 Q F2(mbsystem)108 652.8 Q F0(\(1\))A F1 -.11(BU)72 681.6 S(GS)
-.11 E F0(Da.)108 693.6 Q(MB-System 5.0)72 768 Q 2.5(3J)146.495 G
-(une 2013)-2.5 E(1)204.835 E 0 Cg EP
-%%Trailer
-end
-%%EOF
diff --git a/src/ps/mbbackangle.ps b/src/ps/mbbackangle.ps
deleted file mode 100644
index de1a5eb..0000000
--- a/src/ps/mbbackangle.ps
+++ /dev/null
@@ -1,655 +0,0 @@
-%!PS-Adobe-3.0
-%%Creator: groff version 1.19.2
-%%CreationDate: Wed Jul  1 12:29:26 2015
-%%DocumentNeededResources: font Times-Roman
-%%+ font Times-Bold
-%%+ font Times-Italic
-%%DocumentSuppliedResources: procset grops 1.19 2
-%%Pages: 6
-%%PageOrder: Ascend
-%%DocumentMedia: Default 612 792 0 () ()
-%%Orientation: Portrait
-%%EndComments
-%%BeginDefaults
-%%PageMedia: Default
-%%EndDefaults
-%%BeginProlog
-%%BeginResource: procset grops 1.19 2
-%!PS-Adobe-3.0 Resource-ProcSet
-/setpacking where{
-pop
-currentpacking
-true setpacking
-}if
-/grops 120 dict dup begin
-/SC 32 def
-/A/show load def
-/B{0 SC 3 -1 roll widthshow}bind def
-/C{0 exch ashow}bind def
-/D{0 exch 0 SC 5 2 roll awidthshow}bind def
-/E{0 rmoveto show}bind def
-/F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def
-/G{0 rmoveto 0 exch ashow}bind def
-/H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/I{0 exch rmoveto show}bind def
-/J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def
-/K{0 exch rmoveto 0 exch ashow}bind def
-/L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/M{rmoveto show}bind def
-/N{rmoveto 0 SC 3 -1 roll widthshow}bind def
-/O{rmoveto 0 exch ashow}bind def
-/P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/Q{moveto show}bind def
-/R{moveto 0 SC 3 -1 roll widthshow}bind def
-/S{moveto 0 exch ashow}bind def
-/T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/SF{
-findfont exch
-[exch dup 0 exch 0 exch neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/MF{
-findfont
-[5 2 roll
-0 3 1 roll
-neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/level0 0 def
-/RES 0 def
-/PL 0 def
-/LS 0 def
-/MANUAL{
-statusdict begin/manualfeed true store end
-}bind def
-/PLG{
-gsave newpath clippath pathbbox grestore
-exch pop add exch pop
-}bind def
-/BP{
-/level0 save def
-1 setlinecap
-1 setlinejoin
-72 RES div dup scale
-LS{
-90 rotate
-}{
-0 PL translate
-}ifelse
-1 -1 scale
-}bind def
-/EP{
-level0 restore
-showpage
-}def
-/DA{
-newpath arcn stroke
-}bind def
-/SN{
-transform
-.25 sub exch .25 sub exch
-round .25 add exch round .25 add exch
-itransform
-}bind def
-/DL{
-SN
-moveto
-SN
-lineto stroke
-}bind def
-/DC{
-newpath 0 360 arc closepath
-}bind def
-/TM matrix def
-/DE{
-TM currentmatrix pop
-translate scale newpath 0 0 .5 0 360 arc closepath
-TM setmatrix
-}bind def
-/RC/rcurveto load def
-/RL/rlineto load def
-/ST/stroke load def
-/MT/moveto load def
-/CL/closepath load def
-/Fr{
-setrgbcolor fill
-}bind def
-/setcmykcolor where{
-pop
-/Fk{
-setcmykcolor fill
-}bind def
-}if
-/Fg{
-setgray fill
-}bind def
-/FL/fill load def
-/LW/setlinewidth load def
-/Cr/setrgbcolor load def
-/setcmykcolor where{
-pop
-/Ck/setcmykcolor load def
-}if
-/Cg/setgray load def
-/RE{
-findfont
-dup maxlength 1 index/FontName known not{1 add}if dict begin
-{
-1 index/FID ne{def}{pop pop}ifelse
-}forall
-/Encoding exch def
-dup/FontName exch def
-currentdict end definefont pop
-}bind def
-/DEFS 0 def
-/EBEGIN{
-moveto
-DEFS begin
-}bind def
-/EEND/end load def
-/CNT 0 def
-/level1 0 def
-/PBEGIN{
-/level1 save def
-translate
-div 3 1 roll div exch scale
-neg exch neg exch translate
-0 setgray
-0 setlinecap
-1 setlinewidth
-0 setlinejoin
-10 setmiterlimit
-[]0 setdash
-/setstrokeadjust where{
-pop
-false setstrokeadjust
-}if
-/setoverprint where{
-pop
-false setoverprint
-}if
-newpath
-/CNT countdictstack def
-userdict begin
-/showpage{}def
-/setpagedevice{}def
-}bind def
-/PEND{
-countdictstack CNT sub{end}repeat
-level1 restore
-}bind def
-end def
-/setpacking where{
-pop
-setpacking
-}if
-%%EndResource
-%%EndProlog
-%%BeginSetup
-%%BeginFeature: *PageSize Default
-<< /PageSize [ 612 792 ] /ImagingBBox null >> setpagedevice
-%%EndFeature
-%%IncludeResource: font Times-Roman
-%%IncludeResource: font Times-Bold
-%%IncludeResource: font Times-Italic
-grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72
-def/PL 792 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron/Zcaron
-/scaron/zcaron/Ydieresis/trademark/quotesingle/Euro/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/space/exclam/quotedbl/numbersign/dollar/percent
-/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen
-/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon
-/semicolon/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O
-/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright/circumflex
-/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y
-/z/braceleft/bar/braceright/tilde/.notdef/quotesinglbase/guillemotleft
-/guillemotright/bullet/florin/fraction/perthousand/dagger/daggerdbl
-/endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut
-/dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash
-/quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen
-/brokenbar/section/dieresis/copyright/ordfeminine/guilsinglleft
-/logicalnot/minus/registered/macron/degree/plusminus/twosuperior
-/threesuperior/acute/mu/paragraph/periodcentered/cedilla/onesuperior
-/ordmasculine/guilsinglright/onequarter/onehalf/threequarters
-/questiondown/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE
-/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex
-/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis
-/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn
-/germandbls/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla
-/egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis
-/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide/oslash
-/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis]def
-/Times-Italic at 0 ENC0/Times-Italic RE/Times-Bold at 0 ENC0/Times-Bold RE
-/Times-Roman at 0 ENC0/Times-Roman RE
-%%EndSetup
-%%Page: 1 1
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 134.85(mbbackangle\(1\) MB-System)72 48 R 134.85
-(5.0 mbbackangle\(1\))2.5 F/F1 10.95/Times-Bold at 0 SF -.219(NA)72 84 S
-(ME).219 E/F2 10/Times-Bold at 0 SF(mb)108 96 Q(backangle)-.1 E F0 2.584
-<ad47>2.584 G .084(enerates tables of the a)-2.584 F -.15(ve)-.2 G .084
-(rage amplitude or sidescan v).15 F .083(alues in sw)-.25 F .083
-(ath sonar data as a func-)-.1 F
-(tion of the grazing angle with the sea\215oor)108 108 Q(.)-.55 E F1
-(VERSION)72 136.8 Q F0 -1.11(Ve)108 148.8 S(rsion 5.0)1.11 E F1
-(SYNOPSIS)72 177.6 Q F2(mb)108 189.6 Q(backangle)-.1 E F0([)2.992 E F2
-<ad41>A/F3 10/Times-Italic at 0 SF(kind)A F2 .492<ad4320ad4420ad46>2.992 F
-F3(format)A F2<ad47>2.992 E F3(kind/angle/max/nx/ny)A F2<ad49>2.992 E F3
-(\214le)A F2<ad4e>2.992 E F3(nangle/anglemax)A F2<ad50>2.993 E F3(pings)
-A F2<ad51>2.993 E<ad52>108 201.6 Q F3 -.37(re)C(fangle).37 E F2<ad54>2.5
-E F3(topo)A(grid\214le)-.1 E F2<ad5a>2.5 E F3(altitude)A F2
-(\255V \255H])2.5 E F1(DESCRIPTION)72 230.4 Q F0 .758(The program)108
-242.4 R F2(mb)3.258 E(backangle)-.1 E F0 .757(reads a sw)3.257 F .757
-(ath sonar data \214le containing beam amplitude and/or sidescan data)
--.1 F .11(and generates tables of the a)108 254.4 R -.15(ve)-.2 G .11
-(rage amplitude and/or sidescan v).15 F .11
-(alues as a function of the grazing angle with)-.25 F .395
-(the sea\215oor)108 266.4 R 2.895(.T)-.55 G .395
-(hese tables can be used by the program)-2.895 F F2(mbpr)2.895 E(ocess)
--.18 E F0 .394(to correct the sidescan or amplitude data)2.895 F .531
-(for the v)108 278.4 R .532(ariation with grazing angle. No assumption \
-is made about the nature of the data or the sonar used)-.25 F
-(to collect it.)108 290.4 Q .404
-(The user speci\214es the angular width of the sw)108 314.4 R .404
-(ath considered and the number of angular bins in that sw)-.1 F(ath;)-.1
-E .245(the a)108 326.4 R -.15(ve)-.2 G .245
-(rage amplitude or sidescan v).15 F .245
-(alue within each bin form the output data. By def)-.25 F .246
-(ault, the grazing angle)-.1 F .084(is calculated simply using the acro\
-sstrack distance and depth at the beam or pix)108 338.4 R .084
-(el location.)-.15 F .084(If bath)5.084 F .084(ymetry is)-.05 F .457
-(not a)108 350.4 R -.25(va)-.2 G .457(ilable, the sea\215oor is assumed\
- to be \215at with a sonar altitude speci\214ed by the).25 F F2<ad5a>
-2.957 E F0 2.957(option. If)2.957 F(the)2.957 E F2<ad51>2.957 E F0 .637
-(option is used, then the acrosstrack bottom slope at the beam or pix)
-108 362.4 R .637(el location is f)-.15 F .637(actored into the grazing)
--.1 F .365(angle v)108 374.4 R .365(alues. F)-.25 F .365
-(or bins outside the nadir re)-.15 F .366(gion \(angles > 15.0 de)-.15 F
-.366(grees from v)-.15 F .366(ertical\), the a)-.15 F -.15(ve)-.2 G .366
-(raging e).15 F(xtends)-.15 E -.15(ove)108 386.4 S 2.873(rt).15 G .373
-(he neighboring bins \(three bins a)-2.873 F -.15(ve)-.2 G .372
-(raged for each v).15 F .372
-(alue\). The user also speci\214es the number of pings)-.25 F
-(to be read to generate each table; the def)108 398.4 Q
-(ault is 50 pings.)-.1 E 1.308
-(The results are written to a \214le named by adding a ".sg)108 422.4 R
-1.309(a" suf)-.05 F 1.309(\214x to the sw)-.25 F 1.309
-(ath \214lename for sidescan and)-.1 F(".ag)108 434.4 Q .856
-(a" for amplitude. These \214les contain a series of amplitude vs.)-.05
-F .855(grazing angle tables, each time tagged)5.855 F .355
-(according to the a)108 446.4 R -.15(ve)-.2 G .356
-(rage time of the pings used to generate that table. The sw).15 F .356
-(ath \214le')-.1 F(s)-.55 E F2(mbpr)2.856 E(ocess)-.18 E F0(parame-)
-2.856 E(ter \214le is also modi\214ed \(or created if necessary\) so th\
-at sidescan or amplitude correction is enabled.)108 458.4 Q .354(The co\
-rrection tables are read and interpolated according to ping time by)108
-482.4 R F2(mbpr)2.854 E(ocess)-.18 E F0 2.854(.T)C .354(he correction v)
--2.854 F(alue)-.25 E .713(for each amplitude or sidescan sample is also\
- interpolated using the samples apparent grazing angle.)108 494.4 R(The)
-5.713 E 1.232
-(grazing angle is calculated using a \215at bottom assumption by def)108
-506.4 R 1.232(ault b)-.1 F 1.232(ut, if the)-.2 F F2<ad51>3.731 E F0
-1.231(option is used, will)3.731 F .443
-(instead be calculated using the acrosstrack slope in the bath)108 518.4
-R .443(ymetry \(if a)-.05 F -.25(va)-.2 G .443(ilable\) .).25 F .444
-(If the)5.444 F F2<ad54>2.944 E F0 .444(option is used)2.944 F 1.43
-(to specify a topograph)108 530.4 R 3.93(yg)-.05 G 1.43(rid of the area\
- of interest, then the grazing angle is calculated using that grid)-3.93
-F(rather than an)108 542.4 Q 2.5(yb)-.15 G(ath)-2.5 E
-(ymetry data within the \214le being processed.)-.05 E .102(If the v)108
-566.4 R .102(alues are in dB, and therefore log scaled, then the correc\
-tions are subtracted from the ra)-.25 F 2.603(wv)-.15 G .103(alues and)
--2.853 F .234(then the v)108 578.4 R .233(alue of the correction table \
-at the reference angle \(speci\214ed with the)-.25 F F2<ad52>2.733 E F0
-.233(option\) is added back in.)2.733 F .369
-(In the case of linear data, the correction operation is to di)108 590.4
-R .37(vide by the correction v)-.25 F .37(alue and then multiply by)-.25
-F 1.488(the reference v)108 602.4 R 1.488
-(alue. At present, only SeaBeam 2100 sidescan v)-.25 F 1.488
-(alues are linear; all other amplitude and)-.25 F
-(sidescan data supported by)108 614.4 Q F2(MB-System)2.5 E F0
-(are in dB.)2.5 E 1.364(If the)108 638.4 R F2<ad47>3.864 E F0 1.364
-(option is used, then)3.864 F F2(mb)3.865 E(backangle)-.1 E F0 1.365
-(also generates gridded histograms of the amplitude v)3.865 F(ersus)-.15
-E .899(grazing angle v)108 650.4 R .899(alues for each sw)-.25 F .899(a\
-th data \214le processed. The user speci\214es the bounds and dimension\
-s of)-.1 F .591(the grids; the)108 662.4 R F2<ad47>3.091 E F0 .592
-(option must be gi)3.091 F -.15(ve)-.25 G 3.092(nt).15 G .592
-(wice to produce grids of both amplitude and sidescan histograms.)-3.092
-F 1.038(In addition to outputting the grids,)108 674.4 R F2(mb)3.538 E
-(backangle)-.1 E F0(uses)3.538 E F2(mbm_grdplot)3.538 E F0 1.037
-(to generate)3.538 F F2(GMT)3.537 E F0 1.037(shellscripts that,)3.537 F
-1.133(when e)108 686.4 R -.15(xe)-.15 G 1.133
-(cuted, will generate plots of the gridded histograms o).15 F -.15(ve)
--.15 G 1.134(rlain with the amplitude v).15 F 1.134(ersus grazing)-.15 F
-(angle tables in the ".ag)108 698.4 Q(a" and ".sg)-.05 E(a" \214les.)
--.05 E(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(1)204.835
-E 0 Cg EP
-%%Page: 2 2
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 134.85(mbbackangle\(1\) MB-System)72 48 R 134.85
-(5.0 mbbackangle\(1\))2.5 F/F1 10.95/Times-Bold at 0 SF -.548(AU)72 84 S
-(THORSHIP).548 E F0(Da)108 96 Q(vid W)-.2 E 2.5(.C)-.92 G
-(aress \(caress at mbari.or)-2.5 E(g\))-.18 E(Montere)113 108 Q 2.5(yB)-.15
-G(ay Aquarium Research Institute)-2.5 E
-(Dale N. Chayes \(dale at ldeo.columbia.edu\))108 120 Q
-(Lamont-Doherty Earth Observ)113 132 Q(atory)-.25 E F1(OPTIONS)72 160.8
-Q/F2 10/Times-Bold at 0 SF<ad41>108 172.8 Q/F3 10/Times-Italic at 0 SF(kind)
-23.08 E F0 2.172(Determines if beam amplitude \()144 184.8 R F3(kind)A
-F0 4.671(=1)4.672 G 4.671(\)a)-4.671 G 2.171(nd/or sidescan \()-4.671 F
-F3(kind)A F0 4.671(=2)4.671 G 4.671(\)d)-4.671 G 2.171
-(ata will be processed.)-4.671 F(Def)144 196.8 Q
-(ault: both amplitude and sidescan data are processed.)-.1 E F2<ad43>108
-213.6 Q F0(Normally)23.08 E(,)-.65 E F2(mb)2.614 E(backangle)-.1 E F0
-.115(produces a table of amplitude vs grazing angle v)2.614 F .115
-(alues which is asymmet-)-.25 F .415(ric about the v)144 225.6 R .415
-(ertical \(zero angle\) axis. If)-.15 F F2<ad43>2.915 E F0 .415
-(is speci\214ed, the amplitude vs grazing angle function)2.915 F .381
-(will be forced to be symmetric.)144 237.6 R(Generally)5.382 E 2.882(,i)
--.65 G 2.882(ti)-2.882 G 2.882(sb)-2.882 G .382
-(etter to not use this option in)-2.882 F F2(mb)2.882 E(backangle)-.1 E
-F0 2.882(,a)C(nd)-2.882 E .129(to instead use)144 249.6 R F2(mbset)2.629
-E F0 .129(to set symmetric or asymmetric sidescan correction in the)
-2.629 F F2(mbpr)2.628 E(ocess)-.18 E F0(param-)2.628 E(eter \214le.)144
-261.6 Q F2<ad44>108 278.4 Q F0 .131(This option causes)23.08 F F2(mb)
-2.632 E(backangle)-.1 E F0 .132
-(to dump the output to stdout rather than to ".sg)2.632 F .132
-(a" or ".ag)-.05 F .132(a" \214les..)-.05 F F2<ad46>108 295.2 Q F3
-(format)24.19 E F0 .418(Sets the)144 307.2 R F2(MBIO)2.918 E F0(inte)
-2.918 E .418
-(ger format identi\214er for the input \214le speci\214ed with the)-.15
-F F2<ad49>2.917 E F0 .417(option. By def)2.917 F(ault,)-.1 E F2(mb)144
-319.2 Q(backangle)-.1 E F0(infers the format from the "*.mbXX")2.5 E F2
-(MB-System)2.5 E F0(suf)2.5 E(\214x con)-.25 E -.15(ve)-.4 G(ntion.).15
-E F2<ad47>108 336 Q F3(kind/angle/max/nx/ny)22.52 E F0 1.309
-(This option causes)144 348 R F2(mb)3.809 E(backangle)-.1 E F0 1.309
-(to output gridded histograms of the amplitude v)3.809 F 1.31
-(ersus grazing)-.15 F 1.266(angle data for each sw)144 360 R 1.265(ath \
-\214le processed. The program also generates a shellscript to produce a)
--.1 F(\214rst-cut)144 372 Q F2(GMT)4.173 E F0 1.674
-(postscript plot of the histogram o)4.173 F -.15(ve)-.15 G 1.674
-(rlain by the amplitude v).15 F 1.674(ersus grazing angle)-.15 F .023
-(tables used by)144 384 R F2(mbpr)2.523 E(ocess)-.18 E F0 5.023(.T)C(he)
--5.023 E F3(kind)2.523 E F0 .023
-(parameter indicates whether an amplitude \()2.523 F F3(kind)A F0 2.522
-(=1)2.522 G 2.522(\)o)-2.522 G 2.522(rs)-2.522 G(ides-)-2.522 E .103
-(can \()144 396 R F3(kind)A F0 2.603(=2)2.603 G 2.603(\)h)-2.603 G .103
-(istogram is desired; the)-2.603 F F2<ad47>2.604 E F0 .104
-(command must be gi)2.604 F -.15(ve)-.25 G 2.604(nt).15 G .104
-(wice \(once with)-2.604 F F3(kind)2.604 E F0 2.604(=1a)2.604 G(nd)
--2.604 E .472(once with)144 408 R F3(kind)2.972 E F0 2.972(=2)2.972 G
-2.972(\)t)-2.972 G 2.972(og)-2.972 G .472(enerate both amplitude and si\
-descan histograms. The histogram grid con-)-2.972 F .551(sists of)144
-420 R F3(nx)3.051 E F0 .551(bins e)3.051 F .551(xtending from \255)-.15
-F F3(angle)A F0 .551(to +)3.051 F F3(angle)A F0(de)3.051 E .551
-(grees in the x-dimension, and)-.15 F F3(ny)3.052 E F0 .552(bins e)3.052
-F(xtend-)-.15 E .723(ing from 0.0 to)144 432 R F3(max)3.223 E F0 .722
-(in the y-dimension. The v)3.223 F .722
-(alues of the histogram are normalized so that the)-.25 F(y)-.15 E
-(sum to 1000.0 within each angle bin.)144 444 Q F2<ad48>108 460.8 Q F0
-.391(This "help" \215ag causes the program to print out a description o\
-f its operation and then e)22.52 F .391(xit imme-)-.15 F(diately)144
-472.8 Q(.)-.65 E F2<ad49>108 489.6 Q F3(\214lename)26.41 E F0 .313
-(Sets the input \214lename. If)144 501.6 R F3(format)2.813 E F0 2.813
-(>0\()2.813 G .313(set with the)-2.813 F F2<ad46>2.813 E F0 .313
-(option\) then the sw)2.813 F .312(ath sonar data contained)-.1 F(in)144
-513.6 Q F3(in\214le)2.937 E F0 .437(is read and processed. If)2.937 F F3
-(format)2.937 E F0 2.937(<0)2.937 G 2.937(,t)-2.937 G(hen)-2.937 E F3
-(in\214le)2.937 E F0 .437(is assumed to be an ascii \214le containing a)
-2.937 F .869(list of the input sw)144 525.6 R .869
-(ath sonar data \214les to be processed and their formats.)-.1 F .868
-(The program will read)5.869 F .711(and process the data in each one of\
- these \214les. Each input \214le will ha)144 537.6 R 1.011 -.15(ve a)
--.2 H 3.211(na).15 G .712(ssociated output \214le)-3.211 F .281
-(with either the ".sg)144 549.6 R .281(a" or ".ag)-.05 F .281(a" suf)
--.05 F 2.781(\214x. In)-.25 F(the)2.781 E F3(in\214le)2.781 E F0 .281
-(\214le, each data \214le should be follo)2.781 F .281(wed by a data)
--.25 F(format identi\214er)144 561.6 Q 2.5(,e)-.4 G(.g.:)-2.5 E
-(data\214le1 11)180 573.6 Q(data\214le2 24)180 585.6 Q .029
-(This program uses the)144 597.6 R F2(MBIO)2.529 E F0 .029
-(library and will read an)2.529 F 2.529(ys)-.15 G -.1(wa)-2.529 G .03
-(th sonar format supported by).1 F F2(MBIO)2.53 E F0 2.53(.A)C 1.297
-(list of the sw)144 609.6 R 1.297
-(ath sonar data formats currently supported by)-.1 F F2(MBIO)3.797 E F0
-1.296(and their identi\214er v)3.796 F 1.296(alues is)-.25 F(gi)144
-621.6 Q -.15(ve)-.25 G 2.5(ni).15 G 2.5(nt)-2.5 G(he)-2.5 E F2(MBIO)2.5
-E F0(manual page. Def)2.5 E(ault:)-.1 E F3(in\214le)2.5 E F0 2.5(=")2.5
-G(datalist.mb-1".)-2.5 E F2<ad4e>108 638.4 Q F3(nangle/angle)23.08 E F0
-.926(The amplitude vs grazing angle table is calculated by binning the \
-amplitude v)144 650.4 R .927(alues according to)-.25 F .427
-(their grazing angles and a)144 662.4 R -.15(ve)-.2 G .427
-(raging the amplitudes within each bin. This option sets the number of)
-.15 F .724(grazing angle bins \()144 674.4 R F3(nangle)A F0 3.224(\)a)C
-.725(nd the maximum angle considered \()-3.224 F F3(angle)A F0 .725
-(\). The grazing angle func-)B 1.556(tion will be de\214ned at)144 686.4
-R F3(nangle)4.056 E F0 1.556(points spaced equally from \255)4.056 F F3
-(angle)A F0 1.556(to +)4.056 F F3(angle)A F0 4.056(.T)C(he)-4.056 E F3
-(nangle)4.056 E F0 -.25(va)4.056 G(lue).25 E .195(should be an odd inte)
-144 698.4 R .195
-(ger so that the middle bin is centered on the angle 0.0.)-.15 F(Def)
-5.196 E(ault:)-.1 E F3(nangle)2.696 E F0 2.696(=8)2.696 G(1,)-2.696 E F3
-(angle)144 710.4 Q F0 2.5(=8)2.5 G(0.0.)-2.5 E(MB-System 5.0)72 768 Q
-2.5(3J)146.495 G(une 2013)-2.5 E(2)204.835 E 0 Cg EP
-%%Page: 3 3
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 134.85(mbbackangle\(1\) MB-System)72 48 R 134.85
-(5.0 mbbackangle\(1\))2.5 F/F1 10/Times-Bold at 0 SF<ad50>108 84 Q/F2 10
-/Times-Italic at 0 SF(pings)24.19 E F0 .673
-(Sets the number of pings to be read and a)144 96 R -.15(ve)-.2 G .673
-(raged for each amplitude vs grazing angle table. The).15 F 1.487
-(output "*.sg)144 108 R 1.487(a" or ".ag)-.05 F 1.487
-(a" \214les will generally contain man)-.05 F 3.987(yt)-.15 G 1.487
-(ables, each with a timestamp corre-)-3.987 F .07(sponding to the a)144
-120 R -.15(ve)-.2 G .069
-(rage of the ping times used for each table. A table may be output a).15
-F -.15(ve)-.2 G .069(raged o).15 F -.15(ve)-.15 G(r).15 E 3.175(al)144
-132 S .675(esser number of beams if a time g)-3.175 F .675
-(ap is encountered in the data, and also at the end of the \214le.)-.05
-F(Def)144 144 Q(ault:)-.1 E F2(pings)2.5 E F0 2.5(=5)2.5 G(0.)-2.5 E F1
-<ad51>108 160.8 Q F0 .824(By def)22.52 F(ault,)-.1 E F1(mb)3.324 E
-(backangle)-.1 E F0 .823(does not use sea\215oor slopes in calculating \
-the grazing angles for each)3.324 F .179
-(amplitude beam and sidescan pix)144 172.8 R .179
-(el. This option causes the program to calculate acrosstrack slopes)-.15
-F .888(from sw)144 184.8 R .888(ath bath)-.1 F(ymetry)-.05 E 3.387(,i)
--.65 G 3.387(fa)-3.387 G -.25(va)-3.587 G .887(ilable, and to f).25 F
-.887(actor these slopes into the grazing angle calculation)-.1 F
-(for each data point.)144 196.8 Q F1<ad52>108 213.6 Q F2 -.37(re)23.08 G
-(fangle).37 E F0 .236(Sets the reference angle that will be used by)
-2.736 F F1(mbpr)2.737 E(ocess)-.18 E F0 .237
-(in applying the amplitude and/or)2.737 F
-(sidescan correction tables generated by)144 225.6 Q F1(mb)2.5 E
-(backangle)-.1 E F0 2.5(.D)C(ef)-2.5 E(ault:)-.1 E F2 -.37(re)2.5 G
-(fangle).37 E F0 2.5(=3)2.5 G(0.0 de)-2.5 E(grees.)-.15 E F1<ad54>108
-242.4 Q F2(topo)23.63 E(grid\214le)-.1 E F0 2.125(By def)4.625 F(ault,)
--.1 E F1(mb)4.624 E(backangle)-.1 E F0 2.124
-(does not use sea\215oor slopes in calculating the grazing)4.624 F 1.02
-(angles for each amplitude beam and sidescan pix)144 254.4 R 1.02
-(el. This option causes the program to calculate)-.15 F .51
-(acrosstrack slopes using the topograph)144 266.4 R 3.01(yg)-.05 G(rid)
--3.01 E F2(topo)3.01 E(grid\214le)-.1 E F0 3.01(,a)C .51(nd to f)-3.01 F
-.51(actor these slopes into the graz-)-.1 F
-(ing angle calculation for each data point.)144 278.4 Q F1<ad56>108
-295.2 Q F0(Normally)23.08 E(,)-.65 E F1(mb)3.075 E(backangle)-.1 E F0
--.1(wo)3.075 G .575(rks "silently" without outputting an).1 F .575
-(ything to the stderr stream.)-.15 F .575(If the)5.575 F F1<ad56>144
-307.2 Q F0 .239(\215ag is gi)2.739 F -.15(ve)-.25 G .238(n, then).15 F
-F1(mbmask)2.738 E F0 -.1(wo)2.738 G .238(rks in a "v).1 F .238
-(erbose" mode and outputs the program v)-.15 F .238(ersion being)-.15 F
-(used and all error status messages.)144 319.2 Q F1<ad5a>108 336 Q F2
-(depth)23.63 E F0 .418(This option speci\214es a def)144 348 R .419
-(ault sonar altitude v)-.1 F .419(alue in meters to be used whene)-.25 F
--.15(ve)-.25 G 2.919(rb).15 G(ath)-2.919 E .419(ymetry v)-.05 F(al-)-.25
-E .47(ues are una)144 360 R -.25(va)-.2 G .47
-(ilable. A \215at sea\215oor \(zero slope\) will be assumed where).25 F
--.15(ve)-.25 G 2.97(rt).15 G .47(he def)-2.97 F .47(ault depth needs)-.1
-F .562(to be used \(e.g. data \214les with sidescan b)144 372 R .562
-(ut no bath)-.2 F(ymetry)-.05 E 3.062(,o)-.65 G 3.062(rt)-3.062 G .562
-(he outer parts of sw)-3.062 F .563(aths where the)-.1 F .408
-(sidescan may e)144 384 R .408(xtend further than the bath)-.15 F .408
-(ymetry\). If this option is not speci\214ed, an)-.05 F 2.908(ya)-.15 G
-.408(mplitude or)-2.908 F 1.87(sidescan v)144 396 R 1.871
-(alues without associated bath)-.25 F 1.871
-(ymetry information will not be used in calculating the)-.05 F
-(amplitude vs grazing angle table.)144 408 Q/F3 10.95/Times-Bold at 0 SF
-(EXAMPLE)72 436.8 Q F0
-(Suppose one has a Simrad EM300 data \214le called)108 448.8 Q .749(000\
-3_20020425_022926.mb57 which contains 131 pings. In order to correct th\
-e beam amplitude and)125.5 460.8 R(sidescan with mbprocess, \214rst use)
-108 472.8 Q F1(mb)2.5 E(backangle)-.1 E F0
-(to generate the amplitude vs grazing angle tables:)2.5 E
-(mbbackangle \255I mbari_1998_988_msn.mb57 \\)144 484.8 Q
-(-N81/80.0 \255P50 \\)216 496.8 Q(-G1/80/60/81/121 \\)216 508.8 Q
-(-G2/80/60/81/121 \\)216 520.8 Q(-V)216 532.8 Q .559
-(Here the angle bins will be 2.0 de)108 544.8 R .559
-(gree wide, the table will e)-.15 F .559(xtend from \25580.0 de)-.15 F
-.559(gees \(port\) to +80.0 \(star)-.15 F(-)-.2 E
-(board\), and each table will represent the a)108 556.8 Q -.15(ve)-.2 G
-(rages o).15 E -.15(ve)-.15 G 2.5(ru).15 G 2.5(pt)-2.5 G 2.5(o5)-2.5 G
-2.5(0p)-2.5 G(ings. The output looks lik)-2.5 E(e:)-.1 E
-(Program mbbackangle)144 580.8 Q -1.11(Ve)144 592.8 S
-(rsion $Id: mbbackangle.ps 2252 2015-07-01 19:35:37Z caress $)1.11 E
-(MB-system V)144 604.8 Q(ersion 5.0.4)-1.11 E(Pings to a)144 628.8 Q
--.15(ve)-.2 G 7.5(rage: 50).15 F(Number of angle bins: 81)144 640.8 Q
-(Maximum angle:)144 652.8 Q(80.000000)22.5 E(Def)144 664.8 Q
-(ault altitude:)-.1 E(0.000000)15 E -.8(Wo)144 676.8 S
-(rking on beam amplitude data...).8 E -.8(Wo)144 688.8 S
-(rking on sidescan data...).8 E
-(Using \215at bottom assumption in calculating correction tables...)144
-700.8 Q
-(Outputting gridded histograms of beam amplitude vs grazing angle...)144
-712.8 Q(Outputting gridded histograms of sidescan amplitude vs grazing \
-angle...)144 724.8 Q(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)
--2.5 E(3)204.835 E 0 Cg EP
-%%Page: 4 4
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 134.85(mbbackangle\(1\) MB-System)72 48 R 134.85
-(5.0 mbbackangle\(1\))2.5 F(processing sw)144 84 Q
-(ath \214le: mbari_1998_988_msn.mb57 57)-.1 E(7274 records processed)144
-108 Q(805564 amplitude data processed)144 120 Q
-(146 tables written to mbari_1998_988_msn.mb57.ag)144 132 Q(a)-.05 E
-(5371412 sidescan data processed)144 144 Q
-(146 tables written to mbari_1998_988_msn.mb57.sg)144 156 Q(a)-.05 E
-(Plot generation shellscript <mbari_1998_988_msn.mb57_ag)144 180 Q
-(a.grd.cmd> created.)-.05 E
-(Plot generation shellscript <mbari_1998_988_msn.mb57_sg)144 192 Q
-(a.grd.cmd> created.)-.05 E(7274 total records processed)144 216 Q
-(805564 total amplitude data processed)144 228 Q(146 total ag)144 240 Q
-2.5(at)-.05 G(ables written)-2.5 E
-(5371412 total sidescan data processed)144 252 Q(146 total sg)144 264 Q
-2.5(at)-.05 G(ables written)-2.5 E .696
-(The output \214les include the amplitude v)108 288 R .696
-(ersus grazing angle tables in mbari_1998_988_msn.mb57.ag)-.15 F 3.195
-(aa)-.05 G(nd)-3.195 E(mbari_1998_988_msn.mb57.sg)108 300 Q 3.27
-(a, the gridded histogram \214les mbari_1998_988_msn.mb57_ag)-.05 F 3.27
-(a.grd and)-.05 F(mbari_1998_988_msn.mb57_sg)108 312 Q 41.833
-(a.grd, and the plotting shellscripts)-.05 F(mbari_1998_988_msn.mb57_ag)
-108 324 Q 1.342(a.grd.cmd and mbari_1998_988_msn.mb57_sg)-.05 F 1.343
-(a.grd.cmd. The)-.05 F/F1 10/Times-Bold at 0 SF(mbpr)3.843 E(ocess)-.18 E
-F0 1.285(parameter \214le mbari_1998_988_msn.mb57.par has also been eit\
-her created \(if necessary\) or modi\214ed to)108 336 R 9.298
-(enable sidescan correction using the ".sg)108 348 R 9.299
-(a" tables. The \214rst of the six tables in)-.05 F
-(mbari_1998_988_msn.mb57.sg)108 360 Q 2.5(al)-.05 G(ooks lik)-2.5 E(e:)
--.1 E
-(## Sidescan correction table \214les generated by program mbbackangle)
-144 372 Q(## V)144 384 Q
-(ersion $Id: mbbackangle.ps 2252 2015-07-01 19:35:37Z caress $)-1.11 E
-(## MB-system V)144 396 Q(ersion 5.0.4)-1.11 E(## T)144 408 Q
-(able \214le format: 1.0.0)-.8 E
-(## Run by user <caress> on cpu <hess> at <Fri Oct)144 420 Q 2.5(11)5 G
-(1:18:30 2004>)-2.5 E(## Input sw)144 432 Q(ath \214le:)-.1 E
-(mbari_1998_988_msn.mb57)15 E(## Input sw)144 444 Q(ath format:)-.1 E
-(57)10 E(## Output table \214le:)144 456 Q(mbari_1998_988_msn.mb57.sg)
-12.5 E(a)-.05 E(## Pings to a)144 468 Q -.15(ve)-.2 G 12.5(rage: 50).15
-F(## Number of angle bins:)144 480 Q(81)5 E(## Maximum angle:)144 492 Q
-(80.000000)22.5 E(## Def)144 504 Q(ault altitude:)-.1 E(0.000000)15 E
-(## Data type:)144 516 Q(sidescan)32.5 E 2.5(#t)144 528 S(able: 0)-2.5 E
-2.5(#n)144 540 S(ping: 50)-2.5 E 2.5(#t)144 552 S 2.5(ime: 1998/06/10)
--2.5 F 7.5(14:55:24.979779 897490524.979780)2.5 F 2.5(#n)144 564 S
-(angles: 81)-2.5 E 15(-80.0000 0.0000 0.0000)144 576 R 15
-(-78.0000 0.0000 0.0000)144 588 R 15(-76.0000 0.0000 0.0000)144 600 R 15
-(-74.0000 0.0000 0.0000)144 612 R 15(-72.0000 0.0000 0.0000)144 624 R 15
-(-70.0000 0.0000 0.0000)144 636 R 15(-68.0000 0.0000 0.0000)144 648 R 15
-(-66.0000 0.0000 0.0000)144 660 R 12.5(-64.0000 33.4828)144 672 R
-(7.5915)17.5 E 12.5(-62.0000 32.4068)144 684 R(5.4016)17.5 E 12.5
-(-60.0000 31.9667)144 696 R(5.3320)17.5 E 12.5(-58.0000 31.7880)144 708
-R(5.1880)17.5 E 12.5(-56.0000 31.6249)144 720 R(5.0681)17.5 E
-(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(4)204.835 E 0
-Cg EP
-%%Page: 5 5
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 134.85(mbbackangle\(1\) MB-System)72 48 R 134.85
-(5.0 mbbackangle\(1\))2.5 F 12.5(-54.0000 31.6362)144 84 R(4.9521)17.5 E
-12.5(-52.0000 31.5590)144 96 R(5.0482)17.5 E 12.5(-50.0000 31.3955)144
-108 R(5.1242)17.5 E 12.5(-48.0000 31.0372)144 120 R(5.2364)17.5 E 12.5
-(-46.0000 30.9569)144 132 R(5.1092)17.5 E 12.5(-44.0000 30.8126)144 144
-R(4.9848)17.5 E 12.5(-42.0000 30.3497)144 156 R(4.9611)17.5 E 12.5
-(-40.0000 29.7660)144 168 R(4.9479)17.5 E 12.5(-38.0000 29.2746)144 180
-R(4.9727)17.5 E 12.5(-36.0000 29.1929)144 192 R(4.9734)17.5 E 12.5
-(-34.0000 29.1729)144 204 R(4.9893)17.5 E 12.5(-32.0000 28.7375)144 216
-R(5.0295)17.5 E 12.5(-30.0000 28.6560)144 228 R(5.0031)17.5 E 12.5
-(-28.0000 28.0609)144 240 R(5.1757)17.5 E 12.5(-26.0000 27.3652)144 252
-R(5.2692)17.5 E 12.5(-24.0000 26.2536)144 264 R(5.1193)17.5 E 12.5
-(-22.0000 25.2113)144 276 R(4.8437)17.5 E 12.5(-20.0000 24.9033)144 288
-R(4.5717)17.5 E 12.5(-18.0000 24.4118)144 300 R(4.5952)17.5 E 12.5
-(-16.0000 24.4341)144 312 R(4.5824)17.5 E 12.5(-14.0000 24.3251)144 324
-R(4.7864)17.5 E 12.5(-12.0000 23.6965)144 336 R(4.1409)17.5 E 12.5
-(-10.0000 24.1326)144 348 R(3.7653)17.5 E 12.5(-8.0000 26.1912)144 360 R
-(4.2246)17.5 E 12.5(-6.0000 27.9516)144 372 R(4.5724)17.5 E 12.5
-(-4.0000 31.1992)144 384 R(5.6401)17.5 E 12.5(-2.0000 29.2624)144 396 R
-(5.8076)17.5 E 12.5(0.0000 27.4466)146.5 408 R(4.3310)17.5 E 12.5
-(2.0000 24.9780)146.5 420 R(4.1345)17.5 E 12.5(4.0000 24.2328)146.5 432
-R(4.0980)17.5 E 12.5(6.0000 23.3917)146.5 444 R(4.6856)17.5 E 12.5
-(8.0000 24.0867)146.5 456 R(4.5882)17.5 E 12.5(10.0000 23.2293)144 468 R
-(4.6383)17.5 E 12.5(12.0000 24.1375)144 480 R(4.5005)17.5 E 12.5
-(14.0000 25.1402)144 492 R(4.6843)17.5 E 12.5(16.0000 25.1948)144 504 R
-(4.9131)17.5 E 12.5(18.0000 25.0986)144 516 R(5.0503)17.5 E 12.5
-(20.0000 25.0798)144 528 R(5.0769)17.5 E 12.5(22.0000 25.0582)144 540 R
-(5.1801)17.5 E 12.5(24.0000 25.6108)144 552 R(5.1108)17.5 E 12.5
-(26.0000 25.8393)144 564 R(5.0068)17.5 E 12.5(28.0000 26.3232)144 576 R
-(4.9469)17.5 E 12.5(30.0000 26.4346)144 588 R(5.0686)17.5 E 12.5
-(32.0000 26.6474)144 600 R(5.1690)17.5 E 12.5(34.0000 27.0092)144 612 R
-(5.2098)17.5 E 12.5(36.0000 27.1987)144 624 R(5.1664)17.5 E 12.5
-(38.0000 27.3710)144 636 R(5.2504)17.5 E 12.5(40.0000 27.1160)144 648 R
-(5.1788)17.5 E 12.5(42.0000 27.0691)144 660 R(5.1418)17.5 E 12.5
-(44.0000 27.2547)144 672 R(4.8907)17.5 E 12.5(46.0000 27.7406)144 684 R
-(4.9654)17.5 E 12.5(48.0000 28.1568)144 696 R(4.9277)17.5 E 12.5
-(50.0000 28.4015)144 708 R(4.9687)17.5 E 12.5(52.0000 28.4042)144 720 R
-(4.9034)17.5 E(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E
-(5)204.835 E 0 Cg EP
-%%Page: 6 6
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 134.85(mbbackangle\(1\) MB-System)72 48 R 134.85
-(5.0 mbbackangle\(1\))2.5 F 12.5(54.0000 28.3741)144 84 R(4.9500)17.5 E
-12.5(56.0000 28.5195)144 96 R(4.9799)17.5 E 12.5(58.0000 28.6455)144 108
-R(5.0142)17.5 E 12.5(60.0000 28.9284)144 120 R(4.9876)17.5 E 12.5
-(62.0000 28.9028)144 132 R(5.0380)17.5 E 15(64.0000 0.0000 0.0000)144
-144 R 15(66.0000 0.0000 0.0000)144 156 R 15(68.0000 0.0000 0.0000)144
-168 R 15(70.0000 0.0000 0.0000)144 180 R 15(72.0000 0.0000 0.0000)144
-192 R 15(74.0000 0.0000 0.0000)144 204 R 15(76.0000 0.0000 0.0000)144
-216 R 15(78.0000 0.0000 0.0000)144 228 R 15(80.0000 0.0000 0.0000)144
-240 R(#)144 252 Q(#)144 264 Q/F1 10.95/Times-Bold at 0 SF(SEE ALSO)72 292.8
-Q/F2 10/Times-Bold at 0 SF(mbsystem)108 304.8 Q F0(\(1\),)A F2(mbpr)2.5 E
-(ocess)-.18 E F0(\(1\),)A F2(mbset)2.5 E F0(\(1\),)A F2(mb\214lter)2.5 E
-F0(\(1\))A F1 -.11(BU)72 333.6 S(GS).11 E F0(None w)108 345.6 Q
-(orth bragging about.)-.1 E(MB-System 5.0)72 768 Q 2.5(3J)146.495 G
-(une 2013)-2.5 E(6)204.835 E 0 Cg EP
-%%Trailer
-end
-%%EOF
diff --git a/src/ps/mbclean.ps b/src/ps/mbclean.ps
deleted file mode 100644
index 61cd9a4..0000000
--- a/src/ps/mbclean.ps
+++ /dev/null
@@ -1,732 +0,0 @@
-%!PS-Adobe-3.0
-%%Creator: groff version 1.19.2
-%%CreationDate: Wed Jul  1 12:29:26 2015
-%%DocumentNeededResources: font Times-Roman
-%%+ font Times-Bold
-%%+ font Times-Italic
-%%DocumentSuppliedResources: procset grops 1.19 2
-%%Pages: 6
-%%PageOrder: Ascend
-%%DocumentMedia: Default 612 792 0 () ()
-%%Orientation: Portrait
-%%EndComments
-%%BeginDefaults
-%%PageMedia: Default
-%%EndDefaults
-%%BeginProlog
-%%BeginResource: procset grops 1.19 2
-%!PS-Adobe-3.0 Resource-ProcSet
-/setpacking where{
-pop
-currentpacking
-true setpacking
-}if
-/grops 120 dict dup begin
-/SC 32 def
-/A/show load def
-/B{0 SC 3 -1 roll widthshow}bind def
-/C{0 exch ashow}bind def
-/D{0 exch 0 SC 5 2 roll awidthshow}bind def
-/E{0 rmoveto show}bind def
-/F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def
-/G{0 rmoveto 0 exch ashow}bind def
-/H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/I{0 exch rmoveto show}bind def
-/J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def
-/K{0 exch rmoveto 0 exch ashow}bind def
-/L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/M{rmoveto show}bind def
-/N{rmoveto 0 SC 3 -1 roll widthshow}bind def
-/O{rmoveto 0 exch ashow}bind def
-/P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/Q{moveto show}bind def
-/R{moveto 0 SC 3 -1 roll widthshow}bind def
-/S{moveto 0 exch ashow}bind def
-/T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/SF{
-findfont exch
-[exch dup 0 exch 0 exch neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/MF{
-findfont
-[5 2 roll
-0 3 1 roll
-neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/level0 0 def
-/RES 0 def
-/PL 0 def
-/LS 0 def
-/MANUAL{
-statusdict begin/manualfeed true store end
-}bind def
-/PLG{
-gsave newpath clippath pathbbox grestore
-exch pop add exch pop
-}bind def
-/BP{
-/level0 save def
-1 setlinecap
-1 setlinejoin
-72 RES div dup scale
-LS{
-90 rotate
-}{
-0 PL translate
-}ifelse
-1 -1 scale
-}bind def
-/EP{
-level0 restore
-showpage
-}def
-/DA{
-newpath arcn stroke
-}bind def
-/SN{
-transform
-.25 sub exch .25 sub exch
-round .25 add exch round .25 add exch
-itransform
-}bind def
-/DL{
-SN
-moveto
-SN
-lineto stroke
-}bind def
-/DC{
-newpath 0 360 arc closepath
-}bind def
-/TM matrix def
-/DE{
-TM currentmatrix pop
-translate scale newpath 0 0 .5 0 360 arc closepath
-TM setmatrix
-}bind def
-/RC/rcurveto load def
-/RL/rlineto load def
-/ST/stroke load def
-/MT/moveto load def
-/CL/closepath load def
-/Fr{
-setrgbcolor fill
-}bind def
-/setcmykcolor where{
-pop
-/Fk{
-setcmykcolor fill
-}bind def
-}if
-/Fg{
-setgray fill
-}bind def
-/FL/fill load def
-/LW/setlinewidth load def
-/Cr/setrgbcolor load def
-/setcmykcolor where{
-pop
-/Ck/setcmykcolor load def
-}if
-/Cg/setgray load def
-/RE{
-findfont
-dup maxlength 1 index/FontName known not{1 add}if dict begin
-{
-1 index/FID ne{def}{pop pop}ifelse
-}forall
-/Encoding exch def
-dup/FontName exch def
-currentdict end definefont pop
-}bind def
-/DEFS 0 def
-/EBEGIN{
-moveto
-DEFS begin
-}bind def
-/EEND/end load def
-/CNT 0 def
-/level1 0 def
-/PBEGIN{
-/level1 save def
-translate
-div 3 1 roll div exch scale
-neg exch neg exch translate
-0 setgray
-0 setlinecap
-1 setlinewidth
-0 setlinejoin
-10 setmiterlimit
-[]0 setdash
-/setstrokeadjust where{
-pop
-false setstrokeadjust
-}if
-/setoverprint where{
-pop
-false setoverprint
-}if
-newpath
-/CNT countdictstack def
-userdict begin
-/showpage{}def
-/setpagedevice{}def
-}bind def
-/PEND{
-countdictstack CNT sub{end}repeat
-level1 restore
-}bind def
-end def
-/setpacking where{
-pop
-setpacking
-}if
-%%EndResource
-%%EndProlog
-%%BeginSetup
-%%BeginFeature: *PageSize Default
-<< /PageSize [ 612 792 ] /ImagingBBox null >> setpagedevice
-%%EndFeature
-%%IncludeResource: font Times-Roman
-%%IncludeResource: font Times-Bold
-%%IncludeResource: font Times-Italic
-grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72
-def/PL 792 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron/Zcaron
-/scaron/zcaron/Ydieresis/trademark/quotesingle/Euro/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/space/exclam/quotedbl/numbersign/dollar/percent
-/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen
-/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon
-/semicolon/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O
-/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright/circumflex
-/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y
-/z/braceleft/bar/braceright/tilde/.notdef/quotesinglbase/guillemotleft
-/guillemotright/bullet/florin/fraction/perthousand/dagger/daggerdbl
-/endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut
-/dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash
-/quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen
-/brokenbar/section/dieresis/copyright/ordfeminine/guilsinglleft
-/logicalnot/minus/registered/macron/degree/plusminus/twosuperior
-/threesuperior/acute/mu/paragraph/periodcentered/cedilla/onesuperior
-/ordmasculine/guilsinglright/onequarter/onehalf/threequarters
-/questiondown/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE
-/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex
-/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis
-/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn
-/germandbls/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla
-/egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis
-/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide/oslash
-/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis]def
-/Times-Italic at 0 ENC0/Times-Italic RE/Times-Bold at 0 ENC0/Times-Bold RE
-/Times-Roman at 0 ENC0/Times-Roman RE
-%%EndSetup
-%%Page: 1 1
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 154.29(mbclean\(1\) MB-System)72 48 R 154.29
-(5.0 mbclean\(1\))2.5 F/F1 10.95/Times-Bold at 0 SF -.219(NA)72 84 S(ME)
-.219 E/F2 10/Times-Bold at 0 SF(mbclean)108 96 Q F0 2.5<ad54>2.5 G
-(ool to automatically \215ag bad beams in sw)-3.3 E(ath sonar bath)-.1 E
-(ymetry data.)-.05 E F1(VERSION)72 124.8 Q F0 -1.11(Ve)108 136.8 S
-(rsion 5.0)1.11 E F1(SYNOPSIS)72 165.6 Q F2(mbclean)108 177.6 Q F0([)
-3.198 E F2<ad41>A/F3 10/Times-Italic at 0 SF(max)A F2<ad42>3.197 E F3
-(low/high)A F2<ad43>3.197 E F3(slope/units)A F2<ad44>3.197 E F3(min/max)
-A F2<ad46>3.197 E F3(format)A F2<ad47>3.197 E F3(fr)A(action_low/fr)-.15
-E(action_high)-.15 E F2<ad49>3.197 E F3(in\214le)A F2<ad4b>108 189.6 Q
-F3 -.15(ra)C(ng).15 E(e_min)-.1 E F2<ad4c>6.753 E F3(lon\215ip)A F2
-<ad4d>6.753 E F3(mode)A F2<ad4f>6.753 E F3(out\214le)A F2<ad50>6.753 E
-F3(min_speed/max_speed)A F2<ad51>6.754 E F3(bac)A(kup)-.2 E F2<ad52>
-6.754 E F3(maxheadingr)A(ate)-.15 E F2<ad53>108 201.6 Q F3
-(slope/mode/units)A F2<ad54>8.366 E F3(toler)A(ance)-.15 E F2<ad55>8.366
-E F3(nmin)A F2<ad57>8.366 E F3(west/east/south/north)A F2<ad58>8.366 E
-F3(beamsleft/beamsright)A F2<ad59>8.366 E F3(dis-)A
-(tanceleft/distanceright)108 213.6 Q F2(\255Z \255V \255H])2.5 E F1
-(DESCRIPTION)72 242.4 Q F2(mbclean)108 254.4 Q F0 .504
-(identi\214es and \215ags artif)3.004 F .504(acts in sw)-.1 F .504
-(ath sonar bath)-.1 F .504(ymetry data.)-.05 F(Se)5.504 E -.15(ve)-.25 G
-.505(ral algorithms are a).15 F -.25(va)-.2 G .505(ilable for).25 F
-2.493(identifying artif)108 266.4 R 2.493
-(acts; multiple algorithms can be applied in a single pass.)-.1 F 2.492
-(The most commonly used)7.493 F 1.078(approach is to identify artif)108
-278.4 R 1.078(acts based on e)-.1 F(xcessi)-.15 E 1.379 -.15(ve b)-.25 H
-(ath).15 E 1.079(ymetric slopes.)-.05 F(Spik)6.079 E 1.079
-(es where an e)-.1 F(xcessi)-.15 E 1.379 -.15(ve s)-.25 H(lope).15 E
-1.245(occurs before and re)108 290.4 R -.15(ve)-.25 G 1.244
-(rses after a beam can also be remo).15 F -.15(ve)-.15 G 3.744(d. If).15
-F(desired,)3.744 E F2(mbclean)3.744 E F0 1.244(will also \215ag beams)
-3.744 F .851(associated with "rails" where outer beams ha)108 302.4 R
-1.151 -.15(ve s)-.2 H .852
-(maller acrosstrack distances than more inner beams \().15 F F2<ad51>A
-F0 3.198(option\). Lo)108 314.4 R 3.198(wa)-.25 G .698
-(nd high bounds on acceptable depth v)-3.198 F .697
-(alues can be set; depth v)-.25 F .697(alues outside the acceptable)-.25
-F .514(range will be \215agged. The acceptable depth ranges can either \
-be absolute \()108 326.4 R F2<ad42>A F0 .514(option\), relati)3.014 F
-.814 -.15(ve t)-.25 H 3.015(ot).15 G .515(he local)-3.015 F .606
-(median depth \()108 338.4 R F2<ad41>A F0 .606
-(option\) or de\214ned by lo)3.106 F 3.106(wa)-.25 G .605
-(nd high fractions of the local median depth \()-3.106 F F2<ad47>A F0
-3.105(option\). A)3.105 F
-(set number of outer beams can also be \215agged.)108 350.4 Q
-(The order in which the \215agging algorithms are applied is as follo)
-108 374.4 Q(ws:)-.25 E(1. Flag speci\214ed numbers of outer beams)144
-386.4 Q(\()180 398.4 Q F2<ad58>A F0(option\).)2.5 E
-(2. Flag outer beams by acrosstrack distance)144 410.4 Q(\()180 422.4 Q
-F2<ad59>A F0 49.237(option\). 3.)13.237 F 10.738
-(Flag all beams in pings outside speci\214ed)13.238 F .256
-(acceptable speed range \()180 434.4 R F2<ad50>A F0 38.756(option\). 4.)
-2.756 F .256(Flag all beams in pings outside speci\214ed)2.756 F 1.04
-(acceptable position bounds \()180 446.4 R F2<ad57>A F0 39.541
-(option\). 5.)3.541 F 1.041(Flag all beams in pings with zero)3.541 F
-(longitude and latitude v)180 458.4 Q(alues \()-.25 E F2<ad5a>A F0
-(option\).)2.5 E(6. Flag soundings outside speci\214ed acceptable)144
-470.4 Q(depth range \()180 482.4 Q F2<ad42>A F0(option\).)2.5 E
-(7. Flag soundings with ranges less than)144 494.4 Q
-(speci\214ed minimum v)180 506.4 Q(alue \()-.25 E F2<ad42>A F0
-(option\).)2.5 E(8. Flag pings with e)144 518.4 Q(xcessi)-.15 E .3 -.15
-(ve h)-.25 H(eading change rate).15 E(\()58.5 E F2<ad52>A F0(option\).)
-2.5 E(9. Zap "rails" \()144 530.4 Q F2<ad51>A F0(option\).)2.5 E
-(10. Flag soundings with acrosstrack distances)144 542.4 Q
-(greater than speci\214ed maximum v)180 554.4 Q(alue)-.25 E(\()180 566.4
-Q F2<ad42>A F0(option\).)2.5 E
-(11. Flag soundings outside acceptable depth range)144 578.4 Q
-(using fractions of local median depth)180 590.4 Q(\()180 602.4 Q F2
-<ad47>A F0(option\).)2.5 E
-(12. Flag soundings outside acceptable depth range)144 614.4 Q(using de)
-180 626.4 Q(viation from local median depth)-.25 E(\()180 638.4 Q F2
-<ad41>A F0(option\).)2.5 E(13. Flag soundings associated with spik)144
-650.4 Q(es \()-.1 E F2<ad53>A F0(option\).)2.5 E
-(14. Flag soundings associated with e)144 662.4 Q(xcessi)-.15 E .3 -.15
-(ve s)-.25 H(lopes).15 E(\()180 674.4 Q F2<ad43>A F0(option or def)2.5 E
-(ault\).)-.1 E(15. Flag all soundings in pings with too fe)144 686.4 Q
-(w)-.25 E(good soundings \()180 698.4 Q F2<ad55>A F0(option\).)2.5 E
-.395(This program \215ags beams by outputting the \215ags as edit e)108
-722.4 R -.15(ve)-.25 G .395(nts to an "edit sa).15 F .694 -.15(ve \214)
--.2 H .394(le", lik).15 F 2.894(et)-.1 G .394(hat produced by)-2.894 F
-(MB-System 5.0)72 768 Q(14 April 2015)142.605 E(1)200.945 E 0 Cg EP
-%%Page: 2 2
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 154.29(mbclean\(1\) MB-System)72 48 R 154.29
-(5.0 mbclean\(1\))2.5 F/F1 10/Times-Bold at 0 SF(mbedit)108 84 Q F0 3.19
-(.I)C 3.19(fa)-3.19 G 3.19(n")-3.19 G .69(edit sa)-3.19 F .99 -.15
-(ve \214)-.2 H .69(le" \(named by adding a ".esf" suf).15 F .69
-(\214x to the input sw)-.25 F .69(ath \214lename\) already e)-.1 F
-(xists,)-.15 E .156(the edits are read in and applied before the)108 96
-R F1(mbclean)2.656 E F0 .156(\215agging algorithms are used.)2.656 F
-.155(Once generated, the edit)5.156 F -2.15 -.25(ev e)108 108 T .374
-(nts can be applied to the data using the program).25 F F1(mbpr)2.874 E
-(ocess)-.18 E F0 2.874(,w)C .374(hich outputs a processed sw)-2.874 F
-.375(ath data \214le.)-.1 F(The)108 120 Q F1(mbpr)3.338 E(ocess)-.18 E
-F0 .837(program is also used to mer)3.338 F .837(ge edited na)-.18 F
-(vig)-.2 E .837(ation, recalculate bath)-.05 F(ymetry)-.05 E 3.337(,a)
--.65 G .837(nd apply other)-3.337 F(corrections to sw)108 132 Q
-(ath bath)-.1 E(ymetry data.)-.05 E/F2 10.95/Times-Bold at 0 SF -.548(AU)72
-160.8 S(THORSHIP).548 E F0(Da)108 172.8 Q(vid W)-.2 E 2.5(.C)-.92 G
-(aress \(caress at mbari.or)-2.5 E(g\))-.18 E(Montere)113 184.8 Q 2.5(yB)
--.15 G(ay Aquarium Research Institute)-2.5 E
-(Dale N. Chayes \(dale at ldeo.columbia.edu\))108 196.8 Q
-(Lamont-Doherty Earth Observ)113 208.8 Q(atory)-.25 E(Alberto Malin)108
-220.8 Q -.15(ve)-.4 G(rno).15 E(Schlumber)113 232.8 Q(ger)-.18 E(-Doll)
--.2 E F2(OPTIONS)72 261.6 Q F1<ad41>108 273.6 Q/F3 10/Times-Italic at 0 SF
-(max)23.08 E F0 1.929(This option sets the range of acceptable depth v)
-144 285.6 R 1.929(alues relati)-.25 F 2.229 -.15(ve t)-.25 H 4.43(ot).15
-G 1.93(he local median depth. The)-4.43 F 1.089(median depth is obtaine\
-d from the current ping and the pings immediately before and after that)
-144 297.6 R 3.111(ping. If)144 309.6 R 3.111(ad)3.111 G .611(epth v)
--3.111 F .611(alue de)-.25 F .611
-(viates from the median depth by more than)-.25 F F3(max)3.111 E F0
-3.111(,t)C .611(hen it will be \215agged.)-3.111 F(No de)144 321.6 Q
-(viation from the median depth checking is done if the)-.25 E F1<ad41>
-2.5 E F0(option is not used.)2.5 E F1<ad42>108 338.4 Q F3(low/high)23.63
-E F0 1.013(This option sets the range of acceptable depth v)144 350.4 R
-3.513(alues. If)-.25 F 3.513(ad)3.513 G 1.013(epth v)-3.513 F 1.013
-(alue is less than)-.25 F F3(low)3.512 E F0 1.012(or more)3.512 F(than)
-144 362.4 Q F3(high)2.5 E F0
-(then it will be \215agged. No depth range checking is done if the)2.5 E
-F1<ad42>2.5 E F0(option is not used.)2.5 E F1<ad43>108 379.2 Q F3
-(slope/unit)23.08 E F0 .271(The v)144 391.2 R(alue)-.25 E F3(slope)2.771
-E F0 .271(is the maximum acceptable slope. Beams associated with e)2.771
-F(xcessi)-.15 E .572 -.15(ve s)-.25 H .272(lopes will be).15 F .106
-(\215agged or remo)144 403.2 R -.15(ve)-.15 G 2.606(da).15 G .106
-(ccording to the operational mode speci\214ed using the)-2.606 F F1
-<ad4d>2.605 E F0 .105(option. This method)2.605 F 1.061(will be used if\
- no other algorithms are speci\214ed; if other algorithms are speci\214\
-ed b)144 415.2 R(ut)-.2 E F1<ad43>3.562 E F0 1.062(is not)3.562 F .329
-(used then no slope checking will occur)144 427.2 R(.)-.55 E F3(unit)
-5.328 E F0 .328(is optional and speci\214es the unit of)2.828 F F3
-(slope)2.828 E F0 2.828(,0\()C(def)-2.828 E(ault\))-.1 E(indicates the \
-slope is in tangents, 1 slope is in radians, 2 slope is in de)144 439.2
-Q 2.5(grees. Def)-.15 F(ault:)-.1 E F3(slope)2.5 E F0 2.5(=1)2.5 G(.0)
--2.5 E F1<ad44>108 456 Q F3(min/max)23.08 E F0 .488
-(Sets the minimum and maximum allo)144 468 R .489
-(wed distances between beams used for some of the \215agging)-.25 F 4.43
-(algorithms. Both)144 480 R -.25(va)4.43 G 1.93(lues are e).25 F 1.929
-(xpressed in terms of fractions of the local median depth. Thus,)-.15 F
-F1<ad44>144 492 Q F3(0.01/0.25)A F0 .368(will translate, if the local m\
-edian depth is 1000 meters, to a minimum distance of 10)2.867 F .032
-(meters and a maximum distance of 250 meters.)144 504 R(The)5.031 E F3
-(min)2.531 E F0 -.25(va)2.531 G .031
-(lue sets the minimum distance between).25 F .638
-(beams required for an e)144 516 R(xcessi)-.15 E .938 -.15(ve s)-.25 H
-.638(lope to be used to \215ag bad beams.).15 F .638(The na)5.638 F(vig)
--.2 E .639(ation and heading)-.05 F .407
-(of the ship are used to calculate the locations of beams.)144 528 R
-.406(Ship turns often cause beams of adjacent)5.406 F .701(pings to o)
-144 540 R -.15(ve)-.15 G .701
-(rlap, causing the distances between these beams to become quite small.)
-.15 F .702(This can, in)5.702 F .212(turn, magnify noise in the bath)144
-552 R .211(ymetry data to produce slope estimates which are e)-.05 F
-(xcessi)-.15 E -.15(ve)-.25 G .211(ly lar).15 F(ge.)-.18 E(The)144 564 Q
-F3(max)3.533 E F0 -.25(va)3.533 G 1.033(lue sets the maximum distance b\
-etween the current beam and other beams for those).25 F .872
-(beams to be used in e)144 576 R -.25(va)-.25 G .872
-(luating the current beam. F).25 F .872
-(or instance, only beams within the maximum)-.15 F .996(distance are us\
-ed to calculate the local median depth, and only beams within the maxim\
-um dis-)144 588 R(tance are used to check for e)144 600 Q(xcessi)-.15 E
-.3 -.15(ve s)-.25 H 2.5(lopes. Def).15 F(ault:)-.1 E F3(min/max)2.5 E F0
-2.5(=0)2.5 G(.01/0.25.)-2.5 E F1<ad46>108 616.8 Q F3(format)24.19 E F0
-.22(Sets the data format used if the input is read from stdin or from a\
- \214le. If)144 628.8 R F3(format)2.72 E F0 2.72(<0)2.72 G 2.72(,t)-2.72
-G .22(hen the input)-2.72 F .007(\214le speci\214ed with the)144 640.8 R
-F1<ad49>2.507 E F0 .008(option will actually contain a list of input sw)
-2.508 F .008(ath sonar data \214les. This pro-)-.1 F .012(gram uses the)
-144 652.8 R F1(MBIO)2.512 E F0 .012(library and will read or write an)
-2.512 F 2.512(ys)-.15 G -.1(wa)-2.512 G .012
-(th sonar format supported by).1 F F1(MBIO)2.511 E F0 2.511(.A)C 1.296
-(list of the sw)144 664.8 R 1.297
-(ath sonar data formats currently supported by)-.1 F F1(MBIO)3.797 E F0
-1.297(and their identi\214er v)3.797 F 1.297(alues is)-.25 F(gi)144
-676.8 Q -.15(ve)-.25 G 2.5(ni).15 G 2.5(nt)-2.5 G(he)-2.5 E F1(MBIO)2.5
-E F0(manual page. Def)2.5 E(ault:)-.1 E F3(format)2.5 E F0 2.5(=1)2.5 G
-(1.)-2.5 E F1<ad47>108 693.6 Q F3(fr)22.52 E(action_low/fr)-.15 E
-(action_high)-.15 E F0 .198
-(This option sets the range of acceptable depth v)144 705.6 R .198
-(alues relati)-.25 F .498 -.15(ve t)-.25 H 2.698(ol).15 G .697 -.25
-(ow a)-2.698 H .197(nd high fractions of the local).25 F 1.423
-(median depth.)144 717.6 R 1.424(The median depth is obtained from the \
-current ping and the pings immediately)6.423 F .56
-(before and after that ping.)144 729.6 R .56(If a depth v)5.56 F .559
-(alue is less than)-.25 F F3(fr)3.059 E(action_low)-.15 E F0 .559
-(times the median depth \(e.g.)3.059 F(MB-System 5.0)72 768 Q
-(14 April 2015)142.605 E(2)200.945 E 0 Cg EP
-%%Page: 3 3
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 154.29(mbclean\(1\) MB-System)72 48 R 154.29
-(5.0 mbclean\(1\))2.5 F/F1 10/Times-Italic at 0 SF(fr)144 84 Q(action_low)
--.15 E F0 2.694(=0)2.694 G .194
-(.5 means one half the median depth\) or more than)-2.694 F F1(fr)2.694
-E(action_high)-.15 E F0 .194(times the median)2.694 F .837(depth then i\
-t will be \215agged. No fractional depth range checking is done if the)
-144 96 R/F2 10/Times-Bold at 0 SF<ad47>3.336 E F0 .836(option is not)3.336
-F(used.)144 108 Q F2<ad48>108 124.8 Q F0 .162(This "help" \215ag cause \
-the program to print out a description of its operation and then e)22.52
-F .162(xit immedi-)-.15 F(ately)144 136.8 Q(.)-.65 E F2<ad49>108 153.6 Q
-F1(in\214le)26.41 E F0 .313(Sets the input \214lename. If)144 165.6 R F1
-(format)2.813 E F0 2.813(>0\()2.813 G .313(set with the)-2.813 F F2
-<ad46>2.813 E F0 .313(option\) then the sw)2.813 F .312
-(ath sonar data contained)-.1 F(in)144 177.6 Q F1(in\214le)2.937 E F0
-.437(is read and processed. If)2.937 F F1(format)2.937 E F0 2.937(<0)
-2.937 G 2.937(,t)-2.937 G(hen)-2.937 E F1(in\214le)2.937 E F0 .437
-(is assumed to be an ascii \214le containing a)2.937 F .869
-(list of the input sw)144 189.6 R .869
-(ath sonar data \214les to be processed and their formats.)-.1 F .868
-(The program will read)5.869 F .711(and process the data in each one of\
- these \214les. Each input \214le will ha)144 201.6 R 1.011 -.15(ve a)
--.2 H 3.211(na).15 G .712(ssociated output \214le)-3.211 F .281
-(with either the ".sg)144 213.6 R .281(a" or ".ag)-.05 F .281(a" suf)
--.05 F 2.781(\214x. In)-.25 F(the)2.781 E F1(in\214le)2.781 E F0 .281
-(\214le, each data \214le should be follo)2.781 F .281(wed by a data)
--.25 F(format identi\214er)144 225.6 Q 2.5(,e)-.4 G(.g.:)-2.5 E
-(data\214le1 11)180 237.6 Q(data\214le2 24)180 249.6 Q .568
-(This program uses the)144 261.6 R F2(MBIO)3.068 E F0 .568
-(library and will read or write an)3.068 F 3.068(ys)-.15 G -.1(wa)-3.068
-G .568(th sonar format supported by).1 F F2(MBIO)144 273.6 Q F0 3.428
-(.Al)C .928(ist of the sw)-3.428 F .928
-(ath sonar data formats currently supported by)-.1 F F2(MBIO)3.428 E F0
-.928(and their identi\214er)3.428 F -.25(va)144 285.6 S(lues is gi).25 E
--.15(ve)-.25 G 2.5(ni).15 G 2.5(nt)-2.5 G(he)-2.5 E F2(MBIO)2.5 E F0
-(manual page. Def)2.5 E(ault:)-.1 E F1(in\214le)2.5 E F0 2.5(=")2.5 G
-(datalist.mb-1".)-2.5 E F2<ad4b>108 302.4 Q F1 -.15(ra)22.52 G(ng).15 E
-(e_min)-.1 E F0 .307
-(This option causes all un\215agged beams with ranges less than)144
-314.4 R F1 -.15(ra)2.807 G(ng).15 E(e_min)-.1 E F0 .307
-(to be \215agged as bad. The)2.807 F -.25(va)144 326.4 S(lue).25 E F1
--.15(ra)2.5 G(ng).15 E(e_min)-.1 E F0(is speci\214ed in meters.)2.5 E F2
-<ad4c>108 343.2 Q F1(lon\215ip)23.63 E F0 .554
-(Sets the range of the longitude v)144 355.2 R .554(alues used.)-.25 F
-(If)5.554 E F1(lon\215ip)3.054 E F0 .554(=\2551 then the longitude v)B
-.554(alues will be in the)-.25 F .02(range from \255360 to 0 de)144
-367.2 R .02(grees. If)-.15 F F1(lon\215ip)2.52 E F0 .021
-(=0 then the longitude v)B .021(alues will be in the range from \255180)
--.25 F .702(to 180 de)144 379.2 R .702(grees. If)-.15 F F1(lon\215ip)
-3.202 E F0 .702(=1 then the longitude v)B .701
-(alues will be in the range from 0 to 360 de)-.25 F(grees.)-.15 E(Def)
-144 391.2 Q(ault:)-.1 E F1(lon\215ip)2.5 E F0 2.5(=0)2.5 G(.)-2.5 E F2
-<ad4d>108 408 Q F1(mode)20.86 E F0
-(Sets the manner in which bad beams identi\214ed by e)144 420 Q(xcessi)
--.15 E .3 -.15(ve s)-.25 H(lope are handled.).15 E F1(mode)180 432 Q F0
-2.5(=1)2.5 G 31.92(:F)-2.5 G
-(lags one beam associated with each outlier slope.)-31.92 E
-(The \215agged beam is the one furthest from the local)252 444 Q
-(median depth.)252 456 Q F1(mode)180 468 Q F0 3.217(=2)3.217 G 31.92(:F)
--3.217 G .717(lags both beams associated with each outlier slope.)-31.92
-F(Def)5.718 E(ault:)-.1 E F1(mode)3.218 E F0(=)3.218 E(1.)144 480 Q F2
-<ad50>108 496.8 Q F1(speed_low/speed_high)24.19 E F0 .482
-(This option causes)144 508.8 R F2(mbclean)2.982 E F0 .481(to \215ag as\
- bad all beams in pings associated with platform speed out-)2.982 F
-2.623(side the acceptable range from)144 520.8 R F1(speed_low)5.124 E F0
-(to)5.124 E F1(speed_high)5.124 E F0 5.124(.T)C 2.624(he speed v)-5.124
-F 2.624(alues are speci\214ed in)-.25 F(km/hour)144 532.8 Q(.)-.55 E F2
-<ad51>108 549.6 Q F1(bac)22.52 E(kup)-.2 E F0 1.092(This \215ag causes)
-144 561.6 R F2(mbclean)3.592 E F0 1.092
-(to search for bad "rails" in the sw)3.592 F 1.092(ath sonar sw)-.1 F
-1.091(ath; the "rails" refer to)-.1 F .985
-(groups of outer beams which ha)144 573.6 R 1.285 -.15(ve c)-.2 H .985
-(rosstrack distances \(and depths\) much less than the).15 F 3.485(ys)
--.15 G(hould)-3.485 E(ha)144 585.6 Q -.15(ve)-.2 G 5.103(.T).15 G .103
-(hese are identi\214ed when one or more outer beams lies more than)
--5.103 F F1(bac)2.602 E(kup)-.2 E F0 .102(meters inboard of)2.602 F 2.5
-(am)144 597.6 S
-(ore inner beam; all beams meeting this criteria are \215agged.)-2.5 E
-F2<ad52>108 614.4 Q F1(maxheadingr)23.08 E(ate)-.15 E F0 .916(The v)144
-626.4 R(alue)-.25 E F1(maxheadingr)3.417 E(ate)-.15 E F0 .917
-(is the maximum acceptable rate of change in heading in de)3.417 F
-(grees/sec-)-.15 E .16
-(ond. All soundings associated with pings for which the heading w)144
-638.4 R .159(as changing at a greater rate will)-.1 F(be \215agged.)144
-650.4 Q F2<ad53>108 667.2 Q F1(slope/mode/unit)24.74 E F0 .54(The v)144
-679.2 R(alue)-.25 E F1(slope)3.04 E F0 .54
-(is the maximum acceptable spik)3.04 F 3.04(es)-.1 G 3.04(lope. If)-3.04
-F .54(the slope from the preceding beam to)3.04 F .342(this beam e)144
-691.2 R .342(xceeds this v)-.15 F .342
-(alue, and the slope from this beam to subsequent beam e)-.25 F .341
-(xceeds this v)-.15 F(alue)-.25 E -.2(bu)144 703.2 S 2.515(tw).2 G .015
-(ith an opposite sign this beam is considered a spik)-2.515 F 2.515(ea)
--.1 G .016(nd will be \215agged or remo)-2.515 F -.15(ve)-.15 G 2.516
-(da).15 G(ccording)-2.516 E .462
-(to the operational mode speci\214ed using the)144 715.2 R F2<ad4d>2.962
-E F0 2.962(option. Acrosstrack)2.962 F .462
-(slopes are determined by the)2.962 F 1.535(preceding and subsequent be\
-ams in the same ping. Alongtrack slopes are determined from the)144
-727.2 R(MB-System 5.0)72 768 Q(14 April 2015)142.605 E(3)200.945 E 0 Cg
-EP
-%%Page: 4 4
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 154.29(mbclean\(1\) MB-System)72 48 R 154.29
-(5.0 mbclean\(1\))2.5 F .485(same beam in the pre)144 84 R .485
-(vious and subsequent pings.)-.25 F .485(Alongtrack are f)5.485 F .485
-(airly sensiti)-.1 F .785 -.15(ve t)-.25 H 2.985(ot).15 G .485
-(he minimum)-2.985 F(distance)144 96 Q/F1 10/Times-Bold at 0 SF<ad44>3.361
-E F0 .861(option, which will normally need to be set less to a v)3.361 F
-.861(ery small v)-.15 F .862(alue for alongtrack)-.25 F(slopes to be de\
-tected. There is no test that alongtrack distances are all in the same \
-direction.)144 108 Q(If)144 132 Q/F2 10/Times-Italic at 0 SF(mode)2.73 E F0
-.23(is 1 \(def)2.73 F .23(ault\) only acrosstrack spik)-.1 F .229
-(es are detected.)-.1 F(If)5.229 E F2(mode)2.729 E F0 .229
-(is 2 only alongtrack spik)2.729 F .229(es are)-.1 F 2.5(detected. If)
-144 144 R F2(mode)2.5 E F0
-(is 3 both along track and across track slopes are check)2.5 E(ed.)-.1 E
-F2(unit)144 168 Q F0 .155(is optional and speci\214es the unit of)2.655
-F F2(slope)2.655 E F0 2.655(,0\()C(def)-2.655 E .155
-(ault\) indicates the slope is in tangents, 1 slope)-.1 F .052
-(is in radians, 2 slope is in de)144 180 R 2.552(grees. A)-.15 F .052
-(beam is not considered a spik)2.552 F 2.552(ei)-.1 G 2.552(fe)-2.552 G
-.052(ither the preceding or sub-)-2.552 F
-(sequent beam has already been \215agged.)144 192 Q(Def)5 E(ault:)-.1 E
-F2(slope)2.5 E F0 2.5(=1)2.5 G(.0)-2.5 E F1<ad54>108 208.8 Q F2(toler)
-23.63 E(ance)-.15 E F0 .38
-(If requested this option will reset the timestamps of edit e)144 220.8
-R -.15(ve)-.25 G .38(nts from an e).15 F .38(xisting esf \214le to e)
--.15 F(xactly)-.15 E 1.339(match the timestamps of the surv)144 232.8 R
-1.639 -.15(ey p)-.15 H 1.338(ings. The /fItolerance/fP v).15 F 1.338
-(alue sets ho)-.25 F 3.838(wc)-.25 G 1.338(lose timestamps)-3.838 F .232
-(must be in seconds to be considered a match. This option handles the c\
-ase where surv)144 244.8 R .533 -.15(ey d)-.15 H .233(ata ha).15 F -.15
-(ve)-.2 G .626(been processed using non-)144 256.8 R F1(MB-System)A F0
-(softw)3.126 E .626(are and a user is e)-.1 F .626
-(xtracting the edits from one set of)-.15 F(\214les with)144 268.8 Q F1
-(mbgetesf)2.5 E F0(and then applying them to another using)2.5 E F1
-(mbpr)2.5 E(ocess)-.18 E F0(.)A F1<ad55>108 285.6 Q F2(nmin)23.08 E F0
-.335(This \215ag causes)144 297.6 R F1(mbclean)2.835 E F0 .336
-(to search for port or starboard halv)2.835 F .336
-(es of pings which contain fe)-.15 F .336(wer than)-.25 F F2(nmin)144
-309.6 Q F0(good bath)2.5 E(ymetry v)-.05 E(alues. All bath)-.25 E
-(ymetry v)-.05 E(alues in the af)-.25 E
-(fected half-pings are \215agged.)-.25 E F1<ad56>108 326.4 Q F0
-(Normally)23.08 E(,)-.65 E F1(mbclean)3.462 E F0 -.1(wo)3.462 G .962
-(rks "silently" without outputting an).1 F .961
-(ything to the stderr stream.)-.15 F .961(If the)5.961 F F1<ad56>3.461 E
-F0 1.319(\215ag is gi)144 338.4 R -.15(ve)-.25 G 1.319(n, then).15 F F1
-(mbclean)3.819 E F0 -.1(wo)3.819 G 1.319(rks in a "v).1 F 1.32
-(erbose" mode and outputs the program v)-.15 F 1.32(ersion being)-.15 F
-(used, all error status messages, and the number of beams \215agged as \
-bad.)144 350.4 Q F1<ad57>108 367.2 Q F2(west/east/south/north)20.3 E F0
-.219(This option causes)144 379.2 R F1(mbclean)2.718 E F0 .218
-(to \215ag as bad all beams in pings with na)2.718 F(vig)-.2 E .218
-(ation outside the speci\214ed)-.05 F(acceptable bounds.)144 391.2 Q F1
-<ad58>108 408 Q F2(zap_beams)23.08 E F0 .118
-(If this option is used, the outermost)144 420 R F2(zap_beams)2.618 E F0
-.118(at both ends of the sw)2.618 F .118
-(ath are \215agged as bad; this is)-.1 F
-(useful if the outer beams are kno)144 432 Q(wn to be unreliable. Def)
--.25 E(ault:)-.1 E F2(zap_beams)2.5 E F0 2.5(=0)2.5 G(.)-2.5 E F1<ad59>
-108 448.8 Q F2(distanceleft/distanceright)23.08 E F0 .517
-(This option causes)144 460.8 R F1(mbclean)3.017 E F0 .517(to \215ag as\
- bad all beams with acrosstrack distances more to port than)3.017 F F2
-(distanceleft)144 472.8 Q F0 .155(and more to starboard than)2.655 F F2
-(distanceright)2.655 E F0 2.655(.T)C .155
-(he distances are de\214ned in meters, and dis-)-2.655 F
-(tances to port of nadir are ne)144 484.8 Q -.05(ga)-.15 G(ti).05 E -.15
-(ve)-.25 G(.).15 E F1<ad5a>108 501.6 Q F0 .288(This option causes)144
-513.6 R F1(mbclean)2.788 E F0 .288
-(to \215ag as bad all beams in pings with zero longitude and latitude v)
-2.788 F(al-)-.25 E(ues.)144 525.6 Q/F3 10.95/Times-Bold at 0 SF(EXAMPLES)72
-554.4 Q F0 .428(Suppose one wishes to do a \214rst pass edit of six Sim\
-rad EM300 \214les in the processing format \(format 57\).)108 566.4 R
-2.5(Ad)108 578.4 S(atalist referencing these six \214les e)-2.5 E
-(xists as the \214le datalist.mb-1 and has the contents:)-.15 E
-(0001_20020424_212920.mb57 57)144 590.4 Q(0002_20020425_011607.mb57 57)
-144 602.4 Q(0003_20020425_022926.mb57 57)144 614.4 Q
-(0004_20020425_024336.mb57 57)144 626.4 Q(0005_20020425_034057.mb57 57)
-144 638.4 Q(0006_20020425_045013.mb57 57)144 650.4 Q .041(Use the follo)
-108 662.4 R .041(wing to \215ag an)-.25 F 2.541(yb)-.15 G .041
-(eams which de)-2.541 F .04
-(viate by more than 20% from the local median depth or which)-.25 F
-(produce a slope greater than 3.5 \(74 de)108 674.4 Q(grees\):)-.15 E
-(mbclean \255Idatalist.mb-1 \\)144 698.4 Q
-(-M1 \255C3.5 \255D0.01/0.20 \\)180 710.4 Q(-G0.80/1.20)180 722.4 Q
-(MB-System 5.0)72 768 Q(14 April 2015)142.605 E(4)200.945 E 0 Cg EP
-%%Page: 5 5
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 154.29(mbclean\(1\) MB-System)72 48 R 154.29
-(5.0 mbclean\(1\))2.5 F .212
-(The program will output \215agging statistics for each \214le and gi)
-108 84 R .512 -.15(ve t)-.25 H .212(otals at the end. If the).15 F/F1 10
-/Times-Bold at 0 SF<ad56>2.712 E F0 .212(option is speci-)2.712 F(\214ed,)
-108 96 Q F1(mbclean)2.696 E F0 .196(will also output information for ea\
-ch beam that is \215agged. Here is an e)2.696 F .195(xample of the non)
--.15 F -.15(ve)-.4 G -.2(r-).15 G(bose output:)108 108 Q
-(Processing 0001_20020424_212920.mb57)144 120 Q(908 bath)144 132 Q
-(ymetry data records processed)-.05 E 2.5(0o)144 144 S
-(uter beams zapped)-2.5 E 2.5(0b)144 156 S(eams zapped for too fe)-2.5 E
-2.5(wg)-.25 G(ood beams in ping)-2.5 E 2.5(0b)144 168 S
-(eams out of acceptable depth range)-2.5 E
-(64 beams out of acceptable fractional depth range)144 180 Q 2.5(0b)144
-192 S(eams e)-2.5 E(xceed acceptable de)-.15 E
-(viation from median depth)-.25 E 2.5(0b)144 204 S
-(ad rail beams identi\214ed)-2.5 E(1601 e)144 216 Q(xcessi)-.15 E .3
--.15(ve s)-.25 H(lopes identi\214ed).15 E 2.5(0e)38.5 G(xcessi)-2.65 E
-.3 -.15(ve s)-.25 H(pik).15 E(es identi\214ed)-.1 E
-(1665 beams \215agged)144 228 Q 2.5(0b)144 240 S(eams un\215agged)-2.5 E
-(Processing 0002_20020425_011607.mb57)144 264 Q(259 bath)144 276 Q
-(ymetry data records processed)-.05 E 2.5(0o)144 288 S
-(uter beams zapped)-2.5 E 2.5(0b)144 300 S(eams zapped for too fe)-2.5 E
-2.5(wg)-.25 G(ood beams in ping)-2.5 E 2.5(0b)144 312 S
-(eams out of acceptable depth range)-2.5 E 2.5(0b)144 324 S
-(eams out of acceptable fractional depth range)-2.5 E 2.5(0b)144 336 S
-(eams e)-2.5 E(xceed acceptable de)-.15 E(viation from median depth)-.25
-E 2.5(0b)144 348 S(ad rail beams identi\214ed)-2.5 E(242 e)144 360 Q
-(xcessi)-.15 E .3 -.15(ve s)-.25 H(lopes identi\214ed).15 E 2.5(0e)38.5
-G(xcessi)-2.65 E .3 -.15(ve s)-.25 H(pik).15 E(es identi\214ed)-.1 E
-(242 beams \215agged)144 372 Q 2.5(0b)144 384 S(eams un\215agged)-2.5 E
-(Processing 0003_20020425_022926.mb57)144 408 Q(65 bath)144 420 Q
-(ymetry data records processed)-.05 E 2.5(0o)144 432 S
-(uter beams zapped)-2.5 E 2.5(0b)144 444 S(eams zapped for too fe)-2.5 E
-2.5(wg)-.25 G(ood beams in ping)-2.5 E 2.5(0b)144 456 S
-(eams out of acceptable depth range)-2.5 E 2.5(9b)144 468 S
-(eams out of acceptable fractional depth range)-2.5 E 2.5(0b)144 480 S
-(eams e)-2.5 E(xceed acceptable de)-.15 E(viation from median depth)-.25
-E 2.5(0b)144 492 S(ad rail beams identi\214ed)-2.5 E(497 e)144 504 Q
-(xcessi)-.15 E .3 -.15(ve s)-.25 H(lopes identi\214ed).15 E 2.5(0e)38.5
-G(xcessi)-2.65 E .3 -.15(ve s)-.25 H(pik).15 E(es identi\214ed)-.1 E
-(506 beams \215agged)144 516 Q 2.5(0b)144 528 S(eams un\215agged)-2.5 E
-(Processing 0004_20020425_024336.mb57)144 552 Q(410 bath)144 564 Q
-(ymetry data records processed)-.05 E 2.5(0o)144 576 S
-(uter beams zapped)-2.5 E 2.5(0b)144 588 S(eams zapped for too fe)-2.5 E
-2.5(wg)-.25 G(ood beams in ping)-2.5 E 2.5(0b)144 600 S
-(eams out of acceptable depth range)-2.5 E 2.5(0b)144 612 S
-(eams out of acceptable fractional depth range)-2.5 E 2.5(0b)144 624 S
-(eams e)-2.5 E(xceed acceptable de)-.15 E(viation from median depth)-.25
-E 2.5(0b)144 636 S(ad rail beams identi\214ed)-2.5 E(148 e)144 648 Q
-(xcessi)-.15 E .3 -.15(ve s)-.25 H(lopes identi\214ed).15 E 2.5(0e)38.5
-G(xcessi)-2.65 E .3 -.15(ve s)-.25 H(pik).15 E(es identi\214ed)-.1 E
-(148 beams \215agged)144 660 Q 2.5(0b)144 672 S(eams un\215agged)-2.5 E
-(Processing 0005_20020425_034057.mb57)144 696 Q(252 bath)144 708 Q
-(ymetry data records processed)-.05 E 2.5(0o)144 720 S
-(uter beams zapped)-2.5 E(MB-System 5.0)72 768 Q(14 April 2015)142.605 E
-(5)200.945 E 0 Cg EP
-%%Page: 6 6
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 154.29(mbclean\(1\) MB-System)72 48 R 154.29
-(5.0 mbclean\(1\))2.5 F 2.5(0b)144 84 S(eams zapped for too fe)-2.5 E
-2.5(wg)-.25 G(ood beams in ping)-2.5 E 2.5(0b)144 96 S
-(eams out of acceptable depth range)-2.5 E 2.5(0b)144 108 S
-(eams out of acceptable fractional depth range)-2.5 E 2.5(0b)144 120 S
-(eams e)-2.5 E(xceed acceptable de)-.15 E(viation from median depth)-.25
-E 2.5(0b)144 132 S(ad rail beams identi\214ed)-2.5 E(100 e)144 144 Q
-(xcessi)-.15 E .3 -.15(ve s)-.25 H(lopes identi\214ed).15 E 2.5(0e)38.5
-G(xcessi)-2.65 E .3 -.15(ve s)-.25 H(pik).15 E(es identi\214ed)-.1 E
-(100 beams \215agged)144 156 Q 2.5(0b)144 168 S(eams un\215agged)-2.5 E
-(Processing 0006_20020425_045013.mb57)144 192 Q(562 bath)144 204 Q
-(ymetry data records processed)-.05 E 2.5(0o)144 216 S
-(uter beams zapped)-2.5 E 2.5(0b)144 228 S(eams zapped for too fe)-2.5 E
-2.5(wg)-.25 G(ood beams in ping)-2.5 E 2.5(0b)144 240 S
-(eams out of acceptable depth range)-2.5 E 2.5(0b)144 252 S
-(eams out of acceptable fractional depth range)-2.5 E 2.5(0b)144 264 S
-(eams e)-2.5 E(xceed acceptable de)-.15 E(viation from median depth)-.25
-E 2.5(0b)144 276 S(ad rail beams identi\214ed)-2.5 E(41 e)144 288 Q
-(xcessi)-.15 E .3 -.15(ve s)-.25 H(lopes identi\214ed).15 E 2.5(0e)38.5
-G(xcessi)-2.65 E .3 -.15(ve s)-.25 H(pik).15 E(es identi\214ed)-.1 E
-(41 beams \215agged)144 300 Q 2.5(0b)144 312 S(eams un\215agged)-2.5 E
-(MBclean Processing T)144 336 Q(otals:)-.8 E(-------------------------)
-144 348 Q 2.5(6t)144 360 S(otal sw)-2.5 E(ath data \214les processed)-.1
-E(2456 total bath)144 372 Q(ymetry data records processed)-.05 E 2.5(0t)
-144 384 S(otal beams \215agged in old esf \214les)-2.5 E 2.5(0t)144 396
-S(otal beams un\215agged in old esf \214les)-2.5 E 2.5(0t)144 408 S
-(otal beams zeroed in old esf \214les)-2.5 E 2.5(0t)144 420 S
-(otal outer beams zapped)-2.5 E 2.5(0t)144 432 S
-(otal beams zapped for too fe)-2.5 E 2.5(wg)-.25 G(ood beams in ping)
--2.5 E 2.5(0t)144 444 S(otal beams out of acceptable depth range)-2.5 E
-(73 total beams out of acceptable fractional depth range)144 456 Q 2.5
-(0t)144 468 S(otal beams e)-2.5 E(xceed acceptable de)-.15 E
-(viation from median depth)-.25 E 2.5(0t)144 480 S
-(otal bad rail beams identi\214ed)-2.5 E(2629 total e)144 492 Q(xcessi)
--.15 E .3 -.15(ve s)-.25 H(lopes identi\214ed).15 E 2.5(0t)38.5 G
-(otal e)-2.5 E(xcessi)-.15 E .3 -.15(ve s)-.25 H(pik).15 E
-(es identi\214ed)-.1 E(2702 total beams \215agged)144 504 Q 2.5(0t)144
-516 S(otal beams un\215agged)-2.5 E/F1 10.95/Times-Bold at 0 SF(SEE ALSO)72
-544.8 Q/F2 10/Times-Bold at 0 SF(mbsystem)108 556.8 Q F0(\(1\),)A F2
-(mbedit)2.5 E F0(\(1\),)A F2(mbinf)2.5 E(o)-.25 E F0(\(1\))A F2(mbpr)2.5
-E(ocess)-.18 E F0(\(1\),)A F1 -.11(BU)72 585.6 S(GS).11 E F0 1.012
-(The algorithms implemented in)108 597.6 R F2(mbclean)3.513 E F0 1.013
-(simply don')3.513 F 3.513(td)-.18 G 1.013(etect all bath)-3.513 F 1.013
-(ymetric artif)-.05 F 1.013(acts that are ob)-.1 F 1.013(vious to)-.15 F
-.519(the e)108 609.6 R .518(ye on contour charts.)-.15 F(Although)5.518
-E F2(mbclean)3.018 E F0 .518
-(often does a credible \214rst pass at \215agging ob)3.018 F .518
-(vious artif)-.15 F(acts,)-.1 E .396(we strongly recommend that an)108
-621.6 R 2.896(ys)-.15 G -.1(wa)-2.896 G .396(th bath).1 F .396
-(ymetry processing stream include interacti)-.05 F .697 -.15(ve e)-.25 H
-.397(diting of the ba-).15 F(th)108 633.6 Q(ymetry data \(e.g.)-.05 E F2
-(mbedit)2.5 E F0(\).)A(MB-System 5.0)72 768 Q(14 April 2015)142.605 E(6)
-200.945 E 0 Cg EP
-%%Trailer
-end
-%%EOF
diff --git a/src/ps/mbcontour.ps b/src/ps/mbcontour.ps
deleted file mode 100644
index 9748de2..0000000
--- a/src/ps/mbcontour.ps
+++ /dev/null
@@ -1,703 +0,0 @@
-%!PS-Adobe-3.0
-%%Creator: groff version 1.19.2
-%%CreationDate: Wed Jul  1 12:29:26 2015
-%%DocumentNeededResources: font Times-Roman
-%%+ font Times-Bold
-%%+ font Times-Italic
-%%DocumentSuppliedResources: procset grops 1.19 2
-%%Pages: 5
-%%PageOrder: Ascend
-%%DocumentMedia: Default 612 792 0 () ()
-%%Orientation: Portrait
-%%EndComments
-%%BeginDefaults
-%%PageMedia: Default
-%%EndDefaults
-%%BeginProlog
-%%BeginResource: procset grops 1.19 2
-%!PS-Adobe-3.0 Resource-ProcSet
-/setpacking where{
-pop
-currentpacking
-true setpacking
-}if
-/grops 120 dict dup begin
-/SC 32 def
-/A/show load def
-/B{0 SC 3 -1 roll widthshow}bind def
-/C{0 exch ashow}bind def
-/D{0 exch 0 SC 5 2 roll awidthshow}bind def
-/E{0 rmoveto show}bind def
-/F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def
-/G{0 rmoveto 0 exch ashow}bind def
-/H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/I{0 exch rmoveto show}bind def
-/J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def
-/K{0 exch rmoveto 0 exch ashow}bind def
-/L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/M{rmoveto show}bind def
-/N{rmoveto 0 SC 3 -1 roll widthshow}bind def
-/O{rmoveto 0 exch ashow}bind def
-/P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/Q{moveto show}bind def
-/R{moveto 0 SC 3 -1 roll widthshow}bind def
-/S{moveto 0 exch ashow}bind def
-/T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/SF{
-findfont exch
-[exch dup 0 exch 0 exch neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/MF{
-findfont
-[5 2 roll
-0 3 1 roll
-neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/level0 0 def
-/RES 0 def
-/PL 0 def
-/LS 0 def
-/MANUAL{
-statusdict begin/manualfeed true store end
-}bind def
-/PLG{
-gsave newpath clippath pathbbox grestore
-exch pop add exch pop
-}bind def
-/BP{
-/level0 save def
-1 setlinecap
-1 setlinejoin
-72 RES div dup scale
-LS{
-90 rotate
-}{
-0 PL translate
-}ifelse
-1 -1 scale
-}bind def
-/EP{
-level0 restore
-showpage
-}def
-/DA{
-newpath arcn stroke
-}bind def
-/SN{
-transform
-.25 sub exch .25 sub exch
-round .25 add exch round .25 add exch
-itransform
-}bind def
-/DL{
-SN
-moveto
-SN
-lineto stroke
-}bind def
-/DC{
-newpath 0 360 arc closepath
-}bind def
-/TM matrix def
-/DE{
-TM currentmatrix pop
-translate scale newpath 0 0 .5 0 360 arc closepath
-TM setmatrix
-}bind def
-/RC/rcurveto load def
-/RL/rlineto load def
-/ST/stroke load def
-/MT/moveto load def
-/CL/closepath load def
-/Fr{
-setrgbcolor fill
-}bind def
-/setcmykcolor where{
-pop
-/Fk{
-setcmykcolor fill
-}bind def
-}if
-/Fg{
-setgray fill
-}bind def
-/FL/fill load def
-/LW/setlinewidth load def
-/Cr/setrgbcolor load def
-/setcmykcolor where{
-pop
-/Ck/setcmykcolor load def
-}if
-/Cg/setgray load def
-/RE{
-findfont
-dup maxlength 1 index/FontName known not{1 add}if dict begin
-{
-1 index/FID ne{def}{pop pop}ifelse
-}forall
-/Encoding exch def
-dup/FontName exch def
-currentdict end definefont pop
-}bind def
-/DEFS 0 def
-/EBEGIN{
-moveto
-DEFS begin
-}bind def
-/EEND/end load def
-/CNT 0 def
-/level1 0 def
-/PBEGIN{
-/level1 save def
-translate
-div 3 1 roll div exch scale
-neg exch neg exch translate
-0 setgray
-0 setlinecap
-1 setlinewidth
-0 setlinejoin
-10 setmiterlimit
-[]0 setdash
-/setstrokeadjust where{
-pop
-false setstrokeadjust
-}if
-/setoverprint where{
-pop
-false setoverprint
-}if
-newpath
-/CNT countdictstack def
-userdict begin
-/showpage{}def
-/setpagedevice{}def
-}bind def
-/PEND{
-countdictstack CNT sub{end}repeat
-level1 restore
-}bind def
-end def
-/setpacking where{
-pop
-setpacking
-}if
-%%EndResource
-%%EndProlog
-%%BeginSetup
-%%BeginFeature: *PageSize Default
-<< /PageSize [ 612 792 ] /ImagingBBox null >> setpagedevice
-%%EndFeature
-%%IncludeResource: font Times-Roman
-%%IncludeResource: font Times-Bold
-%%IncludeResource: font Times-Italic
-grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72
-def/PL 792 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron/Zcaron
-/scaron/zcaron/Ydieresis/trademark/quotesingle/Euro/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/space/exclam/quotedbl/numbersign/dollar/percent
-/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen
-/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon
-/semicolon/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O
-/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright/circumflex
-/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y
-/z/braceleft/bar/braceright/tilde/.notdef/quotesinglbase/guillemotleft
-/guillemotright/bullet/florin/fraction/perthousand/dagger/daggerdbl
-/endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut
-/dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash
-/quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen
-/brokenbar/section/dieresis/copyright/ordfeminine/guilsinglleft
-/logicalnot/minus/registered/macron/degree/plusminus/twosuperior
-/threesuperior/acute/mu/paragraph/periodcentered/cedilla/onesuperior
-/ordmasculine/guilsinglright/onequarter/onehalf/threequarters
-/questiondown/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE
-/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex
-/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis
-/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn
-/germandbls/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla
-/egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis
-/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide/oslash
-/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis]def
-/Times-Italic at 0 ENC0/Times-Italic RE/Times-Bold at 0 ENC0/Times-Bold RE
-/Times-Roman at 0 ENC0/Times-Roman RE
-%%EndSetup
-%%Page: 1 1
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 144.84(mbcontour\(1\) MB-System)72 48 R 144.84
-(5.0 mbcontour\(1\))2.5 F/F1 10.95/Times-Bold at 0 SF -.219(NA)72 84 S(ME)
-.219 E/F2 10/Times-Bold at 0 SF(mbcontour)108 96 Q F0<ad>3.69 E F2(GMT)3.69
-E F0 1.189(plug-in module for color \214ll or color shaded relief sw)
-3.69 F 1.189(ath plots of sw)-.1 F 1.189(ath sonar data)-.1 F
-(using Postscript.)108 108 Q F1(VERSION)72 136.8 Q F0 -1.11(Ve)108 148.8
-S(rsion 5.0)1.11 E F1(SYNOPSIS)72 177.6 Q F2 68.71(gmt mbcontour \255J)
-108 189.6 R/F3 10/Times-Italic at 0 SF(par)A(ameter)-.15 E(s)-.1 E F2<ad52>
-71.21 E F3(west/east/south/north)A F2([\255A)108 201.6 Q F3
-(cont_int/col_int/tic_int/lab_int/tic_int/lab_hgt/lab_spacing)A F2<ad42>
-7.197 E F3(tic)A(kinfo)-.2 E F2<ad62>7.197 E F3(yr/mo/da/hr/mn/sc)A F2
-<ad43>7.196 E F3(con-)A(tour\214le)108 213.6 Q F2<ad63>11.015 E F3
-(copies)A F2<ad44>11.015 E F3(time_tic)A
-(k/time_annot/date_annot/time_tic)-.2 E(k_len)-.2 E F2<ad45>11.015 E F3
-(yr/mo/da/hr/mn/sc)A F2<ad66>11.015 E F3(format)A F2<ad46>108 225.6 Q F3
--.37(re)C(d/gr).37 E(een/blue)-.37 E F2<ad47>9.752 E F3
-(name_hgt[/name_perp])A F2<ad49>9.752 E F3(in\214le)A F2 7.252
-<ad4b20ad4c>9.752 F F3(lon\215ip)A F2<ad4d>9.752 E F3(pingnumber_tic)A
-(k/pingnum-)-.2 E(ber_annot/pingnumber_tic)108 237.6 Q(k_len)-.2 E F2
-<ad4e>2.971 E F3(nplot)A F2 .472<ad4f20ad5020ad70>2.971 F F3(pings)A F2
-.472<ad5120ad53>2.972 F F3(speed)A F2<ad54>2.972 E F3(time)A(gap)-.4 E
-F2 .472<ad5520ad5720ad58>2.972 F F3(x-shift)A F2<ad59>2.972 E F3(y-)A
-(shift)108 249.6 Q F2<ad5a>2.5 E F3(algorithm)A F2(\255V \255H])2.5 E F1
-(DESCRIPTION)72 278.4 Q F2(mbcontour)108 290.4 Q F0 2.18
-(is a plug-in module for plotting bath)4.68 F 2.179
-(ymetry contours from sw)-.05 F 2.179(ath sonar data using)-.1 F F2(GMT)
-4.679 E F0 .601(\(Generic Mapping T)108 302.4 R .601(ools\). Lik)-.8 F
-(e)-.1 E F2(mbswath)3.101 E F0(,)A F2(mbcontour)3.101 E F0 .602
-(is fully compatible with the)3.101 F F2(GMT)3.102 E F0 .602(package v)
-3.102 F(ersion)-.15 E 2.168(5. T)108 314.4 R 2.368 -.1(wo c)-.8 H 2.168
-(ontouring algorithms are a).1 F -.25(va)-.2 G 2.167(ilable; the).25 F
-F2<ad5a>4.667 E F0 2.167(option speci\214es which is used.)4.667 F 2.167
-(The \214rst, def)7.167 F(ault)-.1 E .169(approach dra)108 326.4 R .169
-(ws contours between successi)-.15 F .469 -.15(ve p)-.25 H .169
-(ings; this algorithm is simple and therefore f).15 F .17(ast b)-.1 F
-.17(ut produces)-.2 F .779(poor looking contours when beams from one pi\
-ng lie "behind" beams from a pre)108 338.4 R .779
-(vious ping \(this happens)-.25 F .947(for sonars that ping at nonnull \
-pitch angles or for the "inside" beams when ships mak)108 350.4 R 3.448
-(es)-.1 G .948(harp turns\). The)-3.448 F .914
-(second algorithm constructs a triangular netw)108 362.4 R .914
-(ork from the a)-.1 F -.25(va)-.2 G .914
-(ilable soundings and contours the netw).25 F(ork;)-.1 E .079
-(this approach is complicated and therefore slo)108 374.4 R 2.579(wb)
--.25 G .08(ut produces good looking contours under most conditions.)
--2.779 F .832(The contour le)108 386.4 R -.15(ve)-.25 G 3.332(ls and).15
-F .831(colors can be controlled directly or set implicitly using contou\
-r and color change)3.332 F(interv)108 398.4 Q 2.5(als. Contours)-.25 F
-(can also be set to ha)2.5 E .3 -.15(ve t)-.2 H(icks pointing do).15 E
-(wnhill.)-.25 E .652(Shiptracks can also be plotted using the)108 422.4
-R F2<ad44>3.152 E F0(,)A F2<ad47>3.152 E F0 3.152(,a)C(nd)-3.152 E F2
-<ad4d>3.152 E F0 .652(options. The)3.152 F F2<ad44>3.152 E F0 .653
-(option controls the basic track)3.152 F .592
-(plotting, including time annotation. The)108 434.4 R F2<ad47>3.091 E F0
-.591(option causes the start of each sw)3.091 F .591
-(ath data \214le to be annotated)-.1 F .535(with the \214lename. The)108
-446.4 R F2<ad4d>3.035 E F0 .535(option controls ping number annotation,\
- or shot number annotation in the case)3.035 F(of se)108 458.4 Q
-(gy format seismic data.)-.15 E .859(Before opening an input sw)108
-482.4 R .858(ath data \214le,)-.1 F F2(mbcontour)3.358 E F0 .858
-(checks for an ascii \214le in the same directory ha)3.358 F(ving)-.2 E
-.626(the same name e)108 494.4 R .626(xcept that ".inf" is appended to \
-the end. The program assumes that this ascii \214le contains)-.15 F .781
-(the output of the program)108 506.4 R F2(mbinf)3.281 E(o)-.25 E F0 .78
-(run on the input data \214le. If the ".inf" \214le e)3.281 F(xists,)
--.15 E F2(mbcontour)3.28 E F0 .78(reads the)3.28 F .539
-(minimum and maximum longitude and latitude bounds from the)108 518.4 R
-F2(mbinf)3.039 E(o)-.25 E F0 .54(output and compares those to the)3.039
-F 1.388(bounds for the plot. If the ".inf" \214le indicates that none o\
-f the data in the input \214le lies inside the plot)108 530.4 R .041
-(bounds, that input \214le is skipped. This allo)108 542.4 R .042(ws us\
-ers to maintain a single master list of data \214les for use in all)-.25
-F .571(plotting without the performance penalty of)108 554.4 R F2
-(mbcontour)3.071 E F0 .571(reading through all the data \214les, e)3.071
-F -.15(ve)-.25 G 3.07(nt).15 G .57(hose with)-3.07 F .537(no rele)108
-566.4 R -.15(ve)-.25 G .537(nt data. W).15 F 3.037(er)-.8 G .537
-(ecommend that users maintain a ".inf" \214le for each sw)-3.037 F .538
-(ath data \214le used for gridding)-.1 F(or plotting. The)108 578.4 Q F2
-(GMT)2.5 E F0(modules)2.5 E F2(mbswath)2.5 E F0(and)2.5 E F2(mbgrid)2.5
-E F0(also use ".inf" \214les in the same f)2.5 E(ashion.)-.1 E .307
-(In order for)108 602.4 R F2(GMT)2.807 E F0 .307(to successfully e)2.807
-F -.15(xe)-.15 G(cute).15 E F2(mbcontour)2.807 E F0 2.807(,t)C .306
-(he location of the shared library)-2.807 F F3(libmbgmt)2.806 E F0
-(contain-)2.806 E 1.53(ing this module must be kno)108 614.4 R 1.53
-(wn to)-.25 F F2(GMT)4.031 E F0 6.531(.T)C 1.531
-(his can be accomplished by either setting the GMT_CUS-)-6.531 F -.18
-(TO)108 626.4 S .375(M_LIBS parameter in the \214le gmt.conf that is pa\
-rt of the GMT installation, by setting this parameter in).18 F .335
-(the \214le gmt.conf in the user')108 638.4 R 2.835(sh)-.55 G .335
-(ome directory)-2.835 F 2.835(,o)-.65 G 2.835(rb)-2.835 G 2.835(yu)
--2.835 G .335(sing the GMT module)-2.835 F F2(gmtset)2.835 E F0 .335
-(to modify this parame-)2.835 F .853(ter in the current w)108 650.4 R
-.853(orking directory)-.1 F 3.353(.I)-.65 G .853(f, for instance, the)
--3.353 F F3(libmbgmt)3.353 E F0 .853
-(shared library has been installed in the)3.353 F
-(\214le /usr/lib/libmbgmt.dylib, then the GMT_CUST)108 662.4 Q
-(OM_LIBS parameter in a gmt.conf \214le can be set to:)-.18 E(GMT_CUST)
-128 674.4 Q(OM_LIBS = /usr/lib/libmbgmt.dylib)-.18 E F1 -.548(AU)72
-703.2 S(THORSHIP).548 E F0(Da)108 715.2 Q(vid W)-.2 E 2.5(.C)-.92 G
-(aress \(caress at mbari.or)-2.5 E(g\))-.18 E(Montere)113 727.2 Q 2.5(yB)
--.15 G(ay Aquarium Research Institute)-2.5 E(MB-System 5.0)72 768 Q 2.5
-(5F)137.61 G(ebruary 2015)-2.5 E(1)195.95 E 0 Cg EP
-%%Page: 2 2
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 144.84(mbcontour\(1\) MB-System)72 48 R 144.84
-(5.0 mbcontour\(1\))2.5 F(Dale N. Chayes \(dale at ldeo.columbia.edu\))108
-84 Q(Lamont-Doherty Earth Observ)113 96 Q(atory)-.25 E/F1 10.95
-/Times-Bold at 0 SF(OPTIONS)72 124.8 Q/F2 10/Times-Bold at 0 SF<ad41>108 136.8
-Q/F3 10/Times-Italic at 0 SF
-(cont_int/col_int/tic_int/lab_int/tic_len/lab_hgt/lab_spacing)23.08 E F0
-.837(If speci\214c contour le)144 148.8 R -.15(ve)-.25 G .837
-(ls are not speci\214ed with the).15 F F3(-C)3.338 E F0 .838
-(option, then contours will be generated in)3.338 F .956
-(four colors \(black, red, green, and blue\) with interv)144 160.8 R
-.956(als, annotations, and tickmarks controlled by)-.25 F .549
-(these parameters.)144 172.8 R .549(Contours will be generated at in)
-5.549 F -.15(ve)-.4 G(rv).15 E .549(als of)-.25 F F3(cont_int)3.049 E F0
-3.05(meters. Color)3.049 F .55(changes will)3.05 F .816(occur at interv)
-144 184.8 R .816(als of)-.25 F F3(col_int)3.316 E F0 3.315
-(meters. Contours)3.316 F .815(will ha)3.315 F 1.115 -.15(ve d)-.2 H
--.25(ow).15 G .815(nhill f).25 F .815(acing tickmarks)-.1 F F3(tic_int)
-3.315 E F0(inches)3.315 E 2.01(long e)144 196.8 R -.15(ve)-.25 G(ry).15
-E F3(tic_int)4.51 E F0 2.01(meters. Contours will ha)4.51 F 2.31 -.15
-(ve a)-.2 H(nnotations).15 E F3(label_len)4.51 E F0 2.01(inches high e)
-4.51 F -.15(ve)-.25 G(ry).15 E F3(lab_int)4.51 E F0 .532
-(meters. The origins of contour labels will be separated by at least)144
-208.8 R F3(lab_spacing)3.031 E F0 .531(inches \(potentially)3.031 F -.15
-(ove)144 220.8 S 1.897(rlapping labels will be omitted\); if).15 F F3
-(lab_spacing)4.397 E F0 4.397(=0)4.397 G 1.898
-(.0 then the spacing will be de\214ned by)-4.397 F F3(lab_hgt)144 232.8
-Q F0 3.122(.I)C 3.122(ff)-3.122 G -.25(ew)-3.122 G .622(er than se).25 F
--.15(ve)-.25 G 3.122(np).15 G .621(arameters are speci\214ed, the def)
--3.122 F .621(ault v)-.1 F .621(alues are used for the)-.25 F(missing)
-5.621 E 3.809(parameters. Def)144 244.8 R(aults:)-.1 E F3(cont_int)3.809
-E F0 3.809(=2)3.809 G(5;)-3.809 E F3(col_int)3.809 E F0 3.809(=1)3.809 G
-(00;)-3.809 E F3(tic_int)3.809 E F0 3.809(=1)3.809 G(00;)-3.809 E F3
-(lab_int)3.81 E F0 3.81(=1)3.81 G(00;)-3.81 E F3(tic_int)3.81 E F0 3.81
-(=0)3.81 G(.1;)-3.81 E F3(lab_hgt)144 256.8 Q F0 2.5(=0)2.5 G(.05;)-2.5
-E F3(lab_spacing)2.5 E F0 2.5(=0)2.5 G(.0.)-2.5 E F2<ad42>108 273.6 Q F3
-(tic)23.63 E(kinfo)-.2 E F0(Sets map boundary tickmark interv)144 285.6
-Q(als. See)-.25 E F2(psbasemap)2.5 E F0(for details.)2.5 E F2<ad62>108
-302.4 Q F3(yr/mo/da/hr/mn/sc)24.74 E F0 .614
-(Sets the starting time for data allo)144 314.4 R .614
-(wed in the input data; pings with times before the starting time)-.25 F
-(will be ignored.)144 326.4 Q(Def)5 E(ault:)-.1 E F3(yr/mo/da/hr/mn/sc)
-2.5 E F0 2.5(=1)2.5 G(962/2/21/10/30/0.)-2.5 E F2<ad43>108 343.2 Q F3
-(contour\214le)23.08 E F0 .451
-(Sets the \214le from which the contour le)144 355.2 R -.15(ve)-.25 G
-.451(ls and their style and color are read.).15 F .452
-(This \214le consists of)5.451 F(lines in the format:)144 367.2 Q F3(le)
-154 379.2 Q(vel label tic)-.15 E 2.5(kr)-.2 G(ed gr)-2.87 E(een blue)
--.37 E F0(where)144 391.2 Q F3(le)2.813 E(vel)-.15 E F0 .313
-(is the depth v)2.813 F .313(alue to be contoured in meters,)-.25 F F3
-(label)2.813 E F0 .312(is either 'a' for annotated or 'n' for)2.813 F
-.332(not annotated,)144 403.2 R F3(tic)2.832 E(k)-.2 E F0 .332
-(is either ')2.832 F .332
-(t' for tick marks or 'n' for no tick marks, and)-.18 F F3 -.37(re)2.832
-G(d).37 E F0(,)A F3(gr)2.832 E(een)-.37 E F0 2.832(,a)C(nd)-2.832 E F3
-(blue)2.832 E F0(set)2.832 E .347
-(the color of the contour lines \(these v)144 415.2 R .347
-(alues can range from 0 to 255\). If a GMT cpt \214le is gi)-.25 F -.15
-(ve)-.25 G 2.846(na).15 G(s)-2.846 E(the)144 427.2 Q F3(contour\214le)
-2.677 E F0 2.677(,t)C .178(he color boundaries speci\214ed in the cpt \
-\214le will be interpreted as contour le)-2.677 F -.15(ve)-.25 G .178
-(ls to).15 F 1.809(be plotted with unannotated, untick)144 439.2 R 1.809
-(ed, black contours.)-.1 F 1.808(If contours are speci\214ed using the)
-6.808 F F2<ad43>4.308 E F0(option, then an)144 451.2 Q 2.5(yu)-.15 G
-(se of the)-2.5 E F2<ad41>2.5 E F0(option will be ignored.)2.5 E F2
-<ad44>108 468 Q F3(time_tic)23.08 E(k/time_annot/date_annot/time_tic)-.2
-E(k_len)-.2 E F0 1.365(Sets the parameters go)144 480 R -.15(ve)-.15 G
-1.365(rning the annotation of the shiptrack.).15 F -.35(Ti)6.365 G 1.365
-(me marks are made with "X").35 F .09
-(marks along the shiptrack; annotated time marks sho)144 492 R 2.589(wt)
--.25 G .089(he time in HH:MM format ne)-2.589 F .089(xt to the time)-.15
-F .746(mark and annotated date marks sho)144 504 R 3.247(wt)-.25 G .747
-(he time and julian day in HH:MM/DDD format.)-3.247 F .747(The "X")5.747
-F 1.523(marks are)144 516 R F3(time_tic)4.023 E(k_len)-.2 E F0 1.522
-(inches high for normal time marks and 1.5 times)4.023 F F3(time_tic)
-4.022 E(k_len)-.2 E F0(inches)4.022 E .428
-(high for annotated time or date marks.)144 528 R .429(The interv)5.429
-F .429(al of time ticks, annotated time ticks, and anno-)-.25 F 3.235
-(tated date ticks are gi)144 540 R -.15(ve)-.25 G 5.734(ni).15 G 5.734
-(nh)-5.734 G 3.234(ours by)-5.734 F F3(time_tic)5.734 E(k)-.2 E F0(,)A
-F3(time_annot)5.734 E F0 5.734(,a)C(nd)-5.734 E F3(date_annot)5.734 E F0
-5.734(,r)C(especti)-5.734 E -.15(ve)-.25 G(ly).15 E(.)-.65 E(Def)144 552
-Q(aults:)-.1 E F3(time_tic)2.5 E(k)-.2 E F0 2.5(=0)2.5 G(.25;)-2.5 E F3
-(time_annot)2.5 E F0 2.5(=1)2.5 G(.0;)-2.5 E F3(date_annot)2.5 E F0 2.5
-(=4)2.5 G(.0;)-2.5 E F3(time_tic)2.5 E(k_len)-.2 E F0 2.5(=0)2.5 G(.1.)
--2.5 E F2<ad45>108 568.8 Q F3(yr/mo/da/hr/mn/sc)23.63 E F0 .286
-(Sets the ending time for data allo)144 580.8 R .287
-(wed in the input data; pings with times after the ending time will)-.25
-F(be ignored.)144 592.8 Q(Def)5 E(ault:)-.1 E F3(yr/mo/da/hr/mn/sc)2.5 E
-F0 2.5(=2)2.5 G(062/2/21/10/30/0.)-2.5 E F2<ad66>108 609.6 Q F3(format)
-26.97 E F0 .22(Sets the data format used if the input is read from stdi\
-n or from a \214le. If)144 621.6 R F3(format)2.72 E F0 2.72(<0)2.72 G
-2.72(,t)-2.72 G .22(hen the input)-2.72 F .007
-(\214le speci\214ed with the)144 633.6 R F2<ad49>2.507 E F0 .008
-(option will actually contain a list of input sw)2.508 F .008
-(ath sonar data \214les. This pro-)-.1 F .012(gram uses the)144 645.6 R
-F2(MBIO)2.512 E F0 .012(library and will read or write an)2.512 F 2.512
-(ys)-.15 G -.1(wa)-2.512 G .012(th sonar format supported by).1 F F2
-(MBIO)2.511 E F0 2.511(.A)C 1.296(list of the sw)144 657.6 R 1.297
-(ath sonar data formats currently supported by)-.1 F F2(MBIO)3.797 E F0
-1.297(and their identi\214er v)3.797 F 1.297(alues is)-.25 F(gi)144
-669.6 Q -.15(ve)-.25 G 2.5(ni).15 G 2.5(nt)-2.5 G(he)-2.5 E F2(MBIO)2.5
-E F0(manual page. Def)2.5 E(ault:)-.1 E F3(format)2.5 E F0 2.5<3dad>2.5
-G(1.)-2.5 E F2<ad46>108 686.4 Q F3 -.37(re)24.19 G(d/gr).37 E(een/blue)
--.37 E F0(Sets the color used for Frame and annotation. [Def)144 698.4 Q
-(ault is black])-.1 E F2<ad47>108 715.2 Q F3(name_hgt[/name_perp])22.52
-E F0 -.45(Tu)144 727.2 S .959(rns on sw).45 F .959
-(ath \214le name annotation. The)-.1 F F3(name_hgt)3.459 E F0 .958
-(parameter sets the height of the lettering in)3.459 F(MB-System 5.0)72
-768 Q 2.5(5F)137.61 G(ebruary 2015)-2.5 E(2)195.95 E 0 Cg EP
-%%Page: 3 3
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 144.84(mbcontour\(1\) MB-System)72 48 R 144.84
-(5.0 mbcontour\(1\))2.5 F .159(inches. By def)144 84 R .159
-(ault, the \214le name will be plotted along the shiptrack. If the)-.1 F
-/F1 10/Times-Italic at 0 SF(name_perp)2.66 E F0 .16(parameter is)2.66 F(gi)
-144 96 Q -.15(ve)-.25 G 2.56(na).15 G 2.56(s1)-2.56 G 2.56(,t)-2.56 G
-.059(hen the \214le name will be plotted perpendicular to the shiptrack\
-. The)-2.56 F/F2 10/Times-Bold at 0 SF<ad47>2.559 E F0 .059(option implies)
-2.559 F .634(track plotting, so if the)144 108 R F2<ad44>3.134 E F0 .635
-(option is not also speci\214ed, then track plotting will be turned on \
-with)3.134 F(def)144 120 Q(ault parameters.)-.1 E(Def)5 E(ault:)-.1 E F1
-(name_hgt)2.5 E F0 2.5(=0)2.5 G(.1.)-2.5 E F2<ad48>108 136.8 Q F0 .162(\
-This "help" \215ag cause the program to print out a description of its \
-operation and then e)22.52 F .161(xit immedi-)-.15 F(ately)144 148.8 Q
-(.)-.65 E F2<ad49>108 165.6 Q F1(in\214le)26.41 E F0 .467
-(Sets the input \214lename. If)144 177.6 R F1(format)2.967 E F0 2.967
-(>0\()2.967 G .467(set with the)-2.967 F F2<ad66>2.967 E F0 .467
-(option\) then the sw)2.967 F .468(ath sonar data contained)-.1 F(in)144
-189.6 Q F1(in\214le)2.937 E F0 .437(is read and processed. If)2.937 F F1
-(format)2.937 E F0 2.937(<0)2.937 G 2.937(,t)-2.937 G(hen)-2.937 E F1
-(in\214le)2.937 E F0 .437(is assumed to be an ascii \214le containing a)
-2.937 F .868(list of the input sw)144 201.6 R .869
-(ath sonar data \214les to be processed and their formats.)-.1 F .869
-(The program will read)5.869 F .195
-(and plot the data in each one of these \214les.)144 213.6 R .195
-(In the)5.195 F F1(in\214le)2.695 E F0 .195
-(\214le, each data \214le should be follo)2.695 F .194(wed by a)-.25 F
-(data format identi\214er)144 225.6 Q 2.5(,e)-.4 G(.g.:)-2.5 E
-(data\214le1 11)154 237.6 Q(data\214le2 24)154 249.6 Q .029
-(This program uses the)144 261.6 R F2(MBIO)2.529 E F0 .029
-(library and will read an)2.529 F 2.529(ys)-.15 G -.1(wa)-2.529 G .03
-(th sonar format supported by).1 F F2(MBIO)2.53 E F0 2.53(.A)C 1.297
-(list of the sw)144 273.6 R 1.297
-(ath sonar data formats currently supported by)-.1 F F2(MBIO)3.797 E F0
-1.296(and their identi\214er v)3.796 F 1.296(alues is)-.25 F(gi)144
-285.6 Q -.15(ve)-.25 G 2.5(ni).15 G 2.5(nt)-2.5 G(he)-2.5 E F2(MBIO)2.5
-E F0(manual page.)2.5 E .706
-(An input data\214le may be accompanied by a "f)144 297.6 R .706
-(ast bath)-.1 F .706(ymetry" or "fbt" \214le and by a "f)-.05 F .706
-(ast na)-.1 F(vig)-.2 E(a-)-.05 E .203(tion" or "fn)144 309.6 R .203
-(v" \214le. The "fbt" and "fn)-.4 F .203(v" \214le naming con)-.4 F -.15
-(ve)-.4 G .202(ntion is to add the ".fbt" or ".fbt" suf).15 F .202
-(\214x to)-.25 F 1.056(the original sw)144 321.6 R 1.056
-(ath data \214lename.)-.1 F 1.056(An "fbt" \214le contains only sw)6.056
-F 1.057(ath bath)-.1 F 1.057(ymetry information in a)-.05 F 1.171
-(compact format \(format 71\), and is thus quick to read. In the e)144
-333.6 R -.15(ve)-.25 G 1.17(nt that bath).15 F 1.17(ymetry contours is)
--.05 F .072(being generated,)144 345.6 R F2(mbcontour)2.573 E F0 .073
-(will attempt to read an "fbt" \214le in lieu of the original data.)
-2.573 F .073(An "fn)5.073 F(v")-.4 E 1.461(\214le contains only na)144
-357.6 R(vig)-.2 E 1.461(ation information in a compact ASCII format \(f\
-ormat 166\), and is thus)-.05 F -2.15 -.25(ev e)144 369.6 T 2.788(nq).25
-G(uick)-2.788 E .288(er to read.)-.1 F(When)5.288 E F2(mbcontour)2.788 E
-F0 .288(is only generating a shiptrack plot, it will attempt to read)
-2.788 F(an "fn)144 381.6 Q(v" \214le in lieu of the original data.)-.4 E
-F2<ad4a>108 410.4 Q F0 .96(Selects the map projection. Scale is inch/de)
-25.3 F .959(gree, 1:xxxxx.)-.15 F .959
-(or width in inches \(upper case modi-)5.959 F(\214er\).)144 422.4 Q F2
-(CYLINDRICAL PR)144 446.4 Q(OJECTIONS:)-.3 E(\255Jc)144 470.4 Q F1
-(lon0/lat0/scale)A F0(\(Cassini\))2.5 E F2(\255Jm)144 482.4 Q F1(scale)A
-F0(\(Mercator\))2.5 E F2<ad4a>144 494.4 Q(oa)-.15 E F1
-(lon0/lat0/azimuth/scale)A F0
-(\(Oblique Mercator \255 point and azimuth\))2.5 E F2<ad4a>144 506.4 Q
-(ob)-.15 E F1(lon0/lat0/lon1/lat1/scale)A F0(\(Oblique Mercator \255 tw)
-2.5 E 2.5(op)-.1 G(oints\))-2.5 E F2<ad4a>144 518.4 Q(oc)-.15 E F1
-(lon0/lat0/lonp/latp/scale)A F0
-(\(Oblique Mercator \255 point and pole\))2.5 E F2(\255Jq)144 530.4 Q F1
-(lon0/scale)A F0
-(\(Equidistant Cylindrical Projection \(Plate Carree\)\))2.5 E F2
-(\255Jt)144 542.4 Q F1(lon0/scale)A F0(\(TM \255 T)2.5 E(ransv)-.35 E
-(erse Mercator\))-.15 E F2<ad4a>144 554.4 Q(u)-.15 E F1(zone/scale)A F0
-(\(UTM \255 Uni)2.5 E -.15(ve)-.25 G(rsal T).15 E(ransv)-.35 E
-(erse Mercator\))-.15 E F2(\255Jy)144 566.4 Q F1(lon0/lats/scale)A F0
-(\(Basic Cylindrical Projection\))2.5 E F2(AZIMUTHAL PR)144 590.4 Q
-(OJECTIONS:)-.3 E<ad4a>144 614.4 Q(a)-.15 E F1(lon0/lat0/scale)A F0
-(\(Lambert\).)2.5 E F2<ad4a>144 626.4 Q(e)-.15 E F1(lon0/lat0/scale)A F0
-(\(Equidistant\).)2.5 E F2(\255Jg)144 638.4 Q F1(lon0/lat0/scale)A F0
-(\(Orthographic\).)2.5 E F2(\255Js)144 650.4 Q F1(lon0/lat0/scale)A F0
-(\(General Stereographic\))2.5 E F2(CONIC PR)144 674.4 Q(OJECTIONS:)-.3
-E(\255Jb)144 698.4 Q F1(lon0/lat0/lat1/lat2/scale)A F0(\(Albers\))2.5 E
-F2(\255Jl)144 710.4 Q F1(lon0/lat0/lat1/lat2/scale)A F0(\(Lambert\))2.5
-E(MB-System 5.0)72 768 Q 2.5(5F)137.61 G(ebruary 2015)-2.5 E(3)195.95 E
-0 Cg EP
-%%Page: 4 4
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 144.84(mbcontour\(1\) MB-System)72 48 R 144.84
-(5.0 mbcontour\(1\))2.5 F/F1 10/Times-Bold at 0 SF(MISCELLANEOUS PR)144 84
-Q(OJECTIONS:)-.3 E(\255Jh)144 108 Q/F2 10/Times-Italic at 0 SF(lon0/scale)A
-F0(\(Hammer\))2.5 E F1(\255Ji)144 120 Q F2(lon0/scale)A F0
-(\(Sinusoidal\))2.5 E F1(\255Jk)144 132 Q F2(lon0/scale)A F0(\(Eck)2.5 E
-(ert VI\))-.1 E F1(\255Jn)144 144 Q F2(lon0/scale)A F0(\(Robinson\))2.5
-E F1(\255Jr)144 156 Q F2(lon0/scale)A F0(\(W)2.5 E(ink)-.4 E(el T)-.1 E
-(ripel\))-.35 E F1(\255Jw)144 168 Q F2(lon0/scale)A F0(\(Moll)2.5 E
-(weide\))-.1 E F1(NON-GEOGRAPHICAL PR)144 192 Q(OJECTIONS:)-.3 E(\255Jp)
-144 216 Q F2(scale)A F0
-(\(Linear projection for polar \(theta,r\) coordinates\))2.5 E F1
-(\255Jx)144 228 Q F2(x-scale)A F0([)A F1(l|p)A F2(pow)A F0(][)A F2
-(/y-scale)A F0([)A F1(l|p)A F2(pow)A F0(]] \(Linear)A 2.5(,l)-.4 G
-(og, and po)-2.5 E(wer scaling\))-.25 E
-(More details can be found in the)144 240 Q F1(psbasemap)2.5 E F0
-(manpages.)2.5 E F1<ad4b>108 256.8 Q F0(More)22.52 E F2 -.8(Po)2.5 G
-(stScript).8 E F0(code will be appended later [Def)2.5 E
-(ault terminates the plot system].)-.1 E F1<ad4c>108 273.6 Q F2
-(lon\215ip)23.63 E F0 .458(Sets the range of the longitude v)144 285.6 R
-.459(alues returned by the sw)-.25 F .459(ath sonar i/o routines.)-.1 F
-(If)5.459 E F2(lon\215ip)2.959 E F0 .459(=\2551 then)B .892
-(the longitude v)144 297.6 R .892
-(alues will be in the range from \255360 to 0 de)-.25 F .892(grees. If)
--.15 F F2(lon\215ip)3.391 E F0 .891(=0 then the longitude)B -.25(va)144
-309.6 S .131(lues will be in the range from \255180 to 180 de).25 F .131
-(grees. If)-.15 F F2(lon\215ip)2.631 E F0 .131(=1 then the longitude v)B
-.132(alues will be)-.25 F(in the range from 0 to 360 de)144 321.6 Q 2.5
-(grees. Def)-.15 F(ault:)-.1 E F2(lon\215ip)2.5 E F0 2.5(=0)2.5 G(.)-2.5
-E F1<ad4d>108 338.4 Q F2(pingnumber_tic)20.86 E
-(k/pingnumber_annot/pingnumber_tic)-.2 E(k_len)-.2 E F0 .71
-(Sets the parameters go)144 350.4 R -.15(ve)-.15 G .709
-(rning the pingnumber annotation of the shiptrack.).15 F -.35(Ti)5.709 G
-.709(ck marks are made).35 F .582(along the shiptrack at)144 362.4 R F2
-(pingnumber_tic)3.082 E(k)-.2 E F0(interv)3.082 E .582(als; these are)
--.25 F F2(time_tic)3.083 E(k_len)-.2 E F0 .583(inches long. Longer tick)
-3.083 F 4.114(marks are made along the shiptrack at)144 374.4 R F2
-(pingnumber_annot)6.613 E F0(interv)6.613 E 4.113
-(als; these are 1.5 times)-.25 F F2(time_tic)144 386.4 Q(k_len)-.2 E F0
-.858(inches long.)3.358 F(Def)5.858 E(aults:)-.1 E F2(pingnumber_tic)
-3.358 E(k)-.2 E F0 3.358(=5)3.358 G(0;)-3.358 E F2(pingnumber_annot)
-3.358 E F0 3.358(=1)3.358 G(00;)-3.358 E F2(pingnum-)3.358 E(ber_tic)144
-398.4 Q(k_len)-.2 E F0 2.5(=0)2.5 G(.1.)-2.5 E F1<ad4e>108 415.2 Q F2
-(nplot)23.08 E F0 .095(Sets the number of pings to be read in before ea\
-ch contouring episode. See the description of)2.596 F(the)144 427.2 Q F1
-<ad5a>3.252 E F2(algorithm)A F0 .752(option for advice on reasonable v)
-3.252 F .753(alues Def)-.25 F(ault:)-.1 E F2(nplot)3.253 E F0 3.253(=5)
-3.253 G 3.253(0u)-3.253 G(nless)-3.253 E F1<ad5a>3.253 E F2(1)A F0 .753
-(is speci-)3.253 F(\214ed, in which case the def)144 439.2 Q(ault is)-.1
-E F2(nplot)2.5 E F0 2.5(=5)2.5 G(.)-2.5 E F1<ad4f>108 456 Q F0
-(Selects Ov)22.52 E(erlay plot mode [Def)-.15 E(ault initializes a ne)
--.1 E 2.5(wp)-.25 G(lot system].)-2.5 E F1<ad50>108 472.8 Q F0
-(Selects Portrait plotting mode [GMT Def)24.19 E
-(ault is Landscape, see gmtdef)-.1 E(aults to change this].)-.1 E F1
-<ad70>108 489.6 Q F2(pings)24.74 E F0 1.22(Sets the ping a)144 501.6 R
--.15(ve)-.2 G 1.22(raging of the input data. If).15 F F2(pings)3.719 E
-F0 3.719(=1)3.719 G 3.719(,t)-3.719 G 1.219(hen no ping a)-3.719 F -.15
-(ve)-.2 G 1.219(raging is performed. If).15 F F2(pings)144 513.6 Q F0
-2.651(>0)2.651 G 2.651(,t)-2.651 G .151
-(hen that number of input pings will be a)-2.651 F -.15(ve)-.2 G .152
-(raged to produce one output ping.).15 F(If)5.152 E F2(pings)2.652 E F0
-(=)2.652 E .314(0, then the ping a)144 525.6 R -.15(ve)-.2 G .313(ragin\
-g will automatically be done so that the along-track ping spacing is eq\
-ual).15 F(to the across-track beam spacing.)144 537.6 Q(Def)5 E(ault:)
--.1 E F2(pings)2.5 E F0 2.5(=1\()2.5 G(no ping a)-2.5 E -.15(ve)-.2 G
-(raging\).).15 E F1<ad51>108 554.4 Q F0 .262(Causes the program to plot\
- the triangles constructed as part of the contouring if the "triangle a\
-lgo-)22.52 F(rithm" is speci\214ed using the)144 566.4 Q F1<ad5a>2.5 E
-F2(1)A F0(option. This allo)2.5 E(ws the data distrib)-.25 E
-(ution to be directly vie)-.2 E(wed.)-.25 E F1<ad52>108 583.2 Q F2
-(west/east/south/north)23.08 E F0 1.335
-(Sets the longitude and latitude bounds within which sw)144 595.2 R
-1.334(ath sonar data will be read and plotted.)-.1 F 2.696
-(Only the data which lies within these bounds will be read.)144 607.2 R
-(Def)7.696 E(ault:)-.1 E F2(west)5.197 E F0 2.697(=\255360, east)B F2
-(=360)A F0(,)A F2(south)144 619.2 Q F0(=\25590,)A F2(north)2.5 E F0
-(=90.)A F1<ad53>108 636 Q F2(speed)24.74 E F0 .532
-(Sets the minimum speed in km/hr \(5.5 kts ~ 10 km/hr\) allo)144 648 R
-.531(wed in the input data; pings associated)-.25 F
-(with a smaller ship speed will not be processed. Def)144 660 Q(ault:)
--.1 E F2(speed)2.5 E F0 2.5(=0)2.5 G(.)-2.5 E F1<ad54>108 676.8 Q F2
-(time)23.63 E(gap)-.4 E F0 .478(Sets the maximum time g)144 688.8 R .479
-(ap in minutes between adjacent pings allo)-.05 F .479
-(wed before the data is consid-)-.25 F(ered to ha)144 700.8 Q .3 -.15
-(ve a g)-.2 H(ap. Def).1 E(ault:)-.1 E F2(time)2.5 E(gap)-.4 E F0 2.5
-(=1)2.5 G(.)-2.5 E F1<ad55>108 717.6 Q F0(Dra)23.08 E 2.625(wU)-.15 G
-.124(nix System time stamp on plot.)-2.625 F(Optionally)5.124 E 2.624
-(,a)-.65 G .124(ppend a label, or 'c' which will plot the com-)-2.624 F
-(mand string.)144 729.6 Q(MB-System 5.0)72 768 Q 2.5(5F)137.61 G
-(ebruary 2015)-2.5 E(4)195.95 E 0 Cg EP
-%%Page: 5 5
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 144.84(mbcontour\(1\) MB-System)72 48 R 144.84
-(5.0 mbcontour\(1\))2.5 F/F1 10/Times-Bold at 0 SF<ad56>108 84 Q F0
-(Selects v)23.08 E
-(erbose mode, which will send progress reports to stderr [Def)-.15 E
-(ault runs "silently"].)-.1 E F1<ad57>108 100.8 Q F0(Normally)20.3 E(,)
--.65 E F1(mbcontour)4.175 E F0 -.1(wo)4.175 G 1.675(rks with bath).1 F
-1.675(ymetry v)-.05 F 1.675(alues in meters.)-.25 F 1.675(If the)6.675 F
-F1<ad57>4.175 E F0 1.675(\215ag is gi)4.175 F -.15(ve)-.25 G 1.675
-(n, then).15 F F1(mbcontour)144 112.8 Q F0(will contour the bath)2.5 E
-(ymetry v)-.05 E(alues in feet.)-.25 E F1<ad5820ad59>108 129.6 Q F0
-(Shift origin of plot by \()7.66 E/F2 10/Times-Italic at 0 SF
-(x-shift,y-shift)A F0 2.5(\)i)C 2.5(nches [Def)-2.5 F
-(ault is \(1,1\) for ne)-.1 E 2.5(wp)-.25 G(lots, \(0,0\) for o)-2.5 E
--.15(ve)-.15 G(rlays].).15 E F1<ad5a>108 146.4 Q F2(algorithm)23.63 E F0
-2.487(Sets the contouring algorithm to be used. If)144 158.4 R F2
-(algorithm)4.986 E F0 2.486(=0, a simple ping to ping contouring)B .885
-(approach is used; this algorithm is f)144 170.4 R .885(ast b)-.1 F .886
-(ut produces poor looking contours when used with data)-.2 F .377
-(where beams from one ping may lie "behind" beams from pre)144 182.4 R
-.376(vious pings \(this happens for sonars)-.25 F .355(that ping at non\
-null pitch angles or for the "inside" beams when ships mak)144 194.4 R
-2.856(es)-.1 G .356(harp turns\).)-2.856 F(If)5.356 E F2(algo-)2.856 E
-(rithm)144 206.4 Q F0 .473(=1 then a triangular netw)B .472
-(ork is constructed from the a)-.1 F -.25(va)-.2 G .472
-(ilable soundings and this netw).25 F .472(ork is)-.1 F .837
-(in turn contoured; this algorithm is slo)144 218.4 R 3.337(wb)-.25 G
-.838(ut produces good looking contours in most cases. It is)-3.537 F
-.915(important to note that the time required for "triangle" algorithm \
-increases with the square of the)144 230.4 R .804
-(number of beams to be contoured; thus it is sensible to k)144 242.4 R
-.805(eep the number of pings contoured at a)-.1 F .395
-(time small \(e.g. use)144 254.4 R F1<ad4e>2.895 E F2(5)A F0 2.895
-(\). The)B .395(time required for the "ping to ping" algorithm v)2.895 F
-.395(aries linearly with)-.25 F 1.138
-(the number of pings contoured; thus lar)144 266.4 R 1.139
-(ger numbers of pings may be reasonably contoured at a)-.18 F
-(time \(e.g. use)144 278.4 Q F1<ad4e>2.5 E F2(50)A F0 2.5(\). Def)B
-(ault:)-.1 E F2(algorithm)2.5 E F0 2.5(=0)2.5 G(.)-2.5 E F1<ad23>108
-295.2 Q F0(Speci\214es the number of plot copies. [Def)25.3 E
-(ault is 1])-.1 E/F3 10.95/Times-Bold at 0 SF(EXAMPLES)72 312 Q F0 .792(Su\
-ppose the user has a Hydrosweep data \214le in the L-DEO in-house binar\
-y format \()108 324 R F1(MBIO)A F0 .791(format id 24\))3.291 F 1.021
-(called hs_e)108 336 R 1.021(w9302_161_mn.mb24 which lies in the re)-.25
-F 1.021(gion w/s/e/n = \25532.1874/-26.6236/54.6349/56.7536.)-.15 F
-(The follo)108 348 Q(wing will suf)-.25 E
-(\214ce to generate a traditional four)-.25 E(-color contour plot:)-.2 E
-(gmt mbcontour \255Idatalist \255Jm2.44652)118 360 Q
-(-R-25.7252/-23.0683/59.7415/61.0699)22.5 E 21.495
-(-Ba0.5314g0.5314 -A50.0/250.0/250.0/250.0/0.01/0.1 -p1)128 372 R 1.494
-(\255P \255X1 \255Y1 \255K \255V > mbcon-)3.995 F(tour)108 384 Q(.ps)
--.55 E(where the \214le datalist contains:)108 396 Q(hs_e)118 408 Q
-(w9302_161_mn.mb24 24)-.25 E 2.581(Ap)108 420 S .081(lot including a na)
--2.581 F(vig)-.2 E .081(ation track can also be created using)-.05 F F1
-(mbcontour)2.581 E F0 5.081(.H)C .081(ere the)-5.081 F F1<ad44>2.581 E
-F0 .081(\215ag is used to add a)2.581 F .944
-(plot of the ship track annotated with time marks e)108 432 R -.15(ve)
--.25 G .943(ry 0.25 hours, annotated time marks e).15 F -.15(ve)-.25 G
-.943(ry hour).15 F 3.443(,a)-.4 G(nd)-3.443 E(day annotations e)108 444
-Q -.15(ve)-.25 G(ry four hours:).15 E 22.61
-(gmt mbcontour \255Idatalist \255Jm2.44652)118 456 R
-(-R-25.7252/-23.0683/59.7415/61.0699)45.11 E 64.265
-(-Ba0.5314g0.5314":.File hs_e)108 468 R 84.265
-(w9302_161_bmn.mb24:" -D0.25/1/4/0.1)-.25 F 20
-(-A50.0/250.0/250.0/250.0/0.01/0.1 -p1)108 480 R
-(\255P \255X1 \255Y1 \255K \255V > hs_e)2.5 E(w9302_161_bmn.mb24.ps)-.25
-E F3(SEE ALSO)72 508.8 Q F1(mbsystem)108 520.8 Q F0(\(1\),)A F1
-(mbm_plot)2.5 E F0(\(1\),)A F1(mbswath)2.5 E F0(\(1\),)A F1(gmtsystem)
-2.5 E F0(\(1\),)A F1(psbasemap)2.5 E F0(\(1\),)A F1(psto24)2.5 E F0
-(\(1\))A F3 -.11(BU)72 549.6 S(GS).11 E F0(Please let us kno)108 561.6 Q
--.65(w.)-.25 G(MB-System 5.0)72 768 Q 2.5(5F)137.61 G(ebruary 2015)-2.5
-E(5)195.95 E 0 Cg EP
-%%Trailer
-end
-%%EOF
diff --git a/src/ps/mbcopy.ps b/src/ps/mbcopy.ps
deleted file mode 100644
index 1046eff..0000000
--- a/src/ps/mbcopy.ps
+++ /dev/null
@@ -1,468 +0,0 @@
-%!PS-Adobe-3.0
-%%Creator: groff version 1.19.2
-%%CreationDate: Wed Jul  1 12:29:26 2015
-%%DocumentNeededResources: font Times-Roman
-%%+ font Times-Bold
-%%+ font Times-Italic
-%%DocumentSuppliedResources: procset grops 1.19 2
-%%Pages: 3
-%%PageOrder: Ascend
-%%DocumentMedia: Default 612 792 0 () ()
-%%Orientation: Portrait
-%%EndComments
-%%BeginDefaults
-%%PageMedia: Default
-%%EndDefaults
-%%BeginProlog
-%%BeginResource: procset grops 1.19 2
-%!PS-Adobe-3.0 Resource-ProcSet
-/setpacking where{
-pop
-currentpacking
-true setpacking
-}if
-/grops 120 dict dup begin
-/SC 32 def
-/A/show load def
-/B{0 SC 3 -1 roll widthshow}bind def
-/C{0 exch ashow}bind def
-/D{0 exch 0 SC 5 2 roll awidthshow}bind def
-/E{0 rmoveto show}bind def
-/F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def
-/G{0 rmoveto 0 exch ashow}bind def
-/H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/I{0 exch rmoveto show}bind def
-/J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def
-/K{0 exch rmoveto 0 exch ashow}bind def
-/L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/M{rmoveto show}bind def
-/N{rmoveto 0 SC 3 -1 roll widthshow}bind def
-/O{rmoveto 0 exch ashow}bind def
-/P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/Q{moveto show}bind def
-/R{moveto 0 SC 3 -1 roll widthshow}bind def
-/S{moveto 0 exch ashow}bind def
-/T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/SF{
-findfont exch
-[exch dup 0 exch 0 exch neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/MF{
-findfont
-[5 2 roll
-0 3 1 roll
-neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/level0 0 def
-/RES 0 def
-/PL 0 def
-/LS 0 def
-/MANUAL{
-statusdict begin/manualfeed true store end
-}bind def
-/PLG{
-gsave newpath clippath pathbbox grestore
-exch pop add exch pop
-}bind def
-/BP{
-/level0 save def
-1 setlinecap
-1 setlinejoin
-72 RES div dup scale
-LS{
-90 rotate
-}{
-0 PL translate
-}ifelse
-1 -1 scale
-}bind def
-/EP{
-level0 restore
-showpage
-}def
-/DA{
-newpath arcn stroke
-}bind def
-/SN{
-transform
-.25 sub exch .25 sub exch
-round .25 add exch round .25 add exch
-itransform
-}bind def
-/DL{
-SN
-moveto
-SN
-lineto stroke
-}bind def
-/DC{
-newpath 0 360 arc closepath
-}bind def
-/TM matrix def
-/DE{
-TM currentmatrix pop
-translate scale newpath 0 0 .5 0 360 arc closepath
-TM setmatrix
-}bind def
-/RC/rcurveto load def
-/RL/rlineto load def
-/ST/stroke load def
-/MT/moveto load def
-/CL/closepath load def
-/Fr{
-setrgbcolor fill
-}bind def
-/setcmykcolor where{
-pop
-/Fk{
-setcmykcolor fill
-}bind def
-}if
-/Fg{
-setgray fill
-}bind def
-/FL/fill load def
-/LW/setlinewidth load def
-/Cr/setrgbcolor load def
-/setcmykcolor where{
-pop
-/Ck/setcmykcolor load def
-}if
-/Cg/setgray load def
-/RE{
-findfont
-dup maxlength 1 index/FontName known not{1 add}if dict begin
-{
-1 index/FID ne{def}{pop pop}ifelse
-}forall
-/Encoding exch def
-dup/FontName exch def
-currentdict end definefont pop
-}bind def
-/DEFS 0 def
-/EBEGIN{
-moveto
-DEFS begin
-}bind def
-/EEND/end load def
-/CNT 0 def
-/level1 0 def
-/PBEGIN{
-/level1 save def
-translate
-div 3 1 roll div exch scale
-neg exch neg exch translate
-0 setgray
-0 setlinecap
-1 setlinewidth
-0 setlinejoin
-10 setmiterlimit
-[]0 setdash
-/setstrokeadjust where{
-pop
-false setstrokeadjust
-}if
-/setoverprint where{
-pop
-false setoverprint
-}if
-newpath
-/CNT countdictstack def
-userdict begin
-/showpage{}def
-/setpagedevice{}def
-}bind def
-/PEND{
-countdictstack CNT sub{end}repeat
-level1 restore
-}bind def
-end def
-/setpacking where{
-pop
-setpacking
-}if
-%%EndResource
-%%EndProlog
-%%BeginSetup
-%%BeginFeature: *PageSize Default
-<< /PageSize [ 612 792 ] /ImagingBBox null >> setpagedevice
-%%EndFeature
-%%IncludeResource: font Times-Roman
-%%IncludeResource: font Times-Bold
-%%IncludeResource: font Times-Italic
-grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72
-def/PL 792 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron/Zcaron
-/scaron/zcaron/Ydieresis/trademark/quotesingle/Euro/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/space/exclam/quotedbl/numbersign/dollar/percent
-/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen
-/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon
-/semicolon/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O
-/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright/circumflex
-/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y
-/z/braceleft/bar/braceright/tilde/.notdef/quotesinglbase/guillemotleft
-/guillemotright/bullet/florin/fraction/perthousand/dagger/daggerdbl
-/endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut
-/dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash
-/quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen
-/brokenbar/section/dieresis/copyright/ordfeminine/guilsinglleft
-/logicalnot/minus/registered/macron/degree/plusminus/twosuperior
-/threesuperior/acute/mu/paragraph/periodcentered/cedilla/onesuperior
-/ordmasculine/guilsinglright/onequarter/onehalf/threequarters
-/questiondown/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE
-/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex
-/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis
-/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn
-/germandbls/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla
-/egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis
-/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide/oslash
-/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis]def
-/Times-Italic at 0 ENC0/Times-Italic RE/Times-Bold at 0 ENC0/Times-Bold RE
-/Times-Roman at 0 ENC0/Times-Roman RE
-%%EndSetup
-%%Page: 1 1
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mbcop)72 48 Q 156.05(y\(1\) MB-System)-.1 F
-156.05(5.0 mbcop)2.5 F(y\(1\))-.1 E/F1 10.95/Times-Bold at 0 SF -.219(NA)72
-84 S(ME).219 E/F2 10/Times-Bold at 0 SF(mbcopy)108 96 Q F0 2.5<ad43>2.5 G
-(op)-2.5 E 2.5(ys)-.1 G -.1(wa)-2.5 G(th sonar bath).1 E
-(ymetry data \214les.)-.05 E F1(VERSION)72 124.8 Q F0 -1.11(Ve)108 136.8
-S(rsion 5.0)1.11 E F1(SYNOPSIS)72 165.6 Q F2(mbcopy)108 177.6 Q F0([)
-13.518 E F2<ad42>A/F3 10/Times-Italic at 0 SF(yr/mo/da/hr/mn/sc)A F2<ad43>
-13.518 E F3(comment\214le)A F2 11.018<ad4420ad45>13.518 F F3
-(yr/mo/da/hr/mn/sc)A F2<ad46>13.518 E F3(informat[/outfor)A(-)-.2 E
-(mat[/mer)108 189.6 Q -.1(ge)-.37 G(format]]).1 E F2 7.303<ad4820ad49>
-9.802 F F3(in\214lename)A F2<ad4c>9.803 E F3(lon\215ip)A F2<ad4d>9.803 E
-F3(mer)A -.1(ge)-.37 G(\214lename).1 E F2 7.303<ad4e20ad4f>9.803 F F3
-(out\214lename)A F2<ad50>9.803 E F3(pings)A F2<ad51>108 201.6 Q F3
-(sleep_factor)A F2<ad52>2.5 E F3(west/east/south/north)A F2<ad53>2.5 E
-F3(speed)A F2(\255V])2.5 E F1(DESCRIPTION)72 230.4 Q F2(mbcopy)108 242.4
-Q F0 .145(is a utility for cop)2.645 F .145(ying sw)-.1 F .145
-(ath sonar data \214les which may be used to change formats, a)-.1 F
--.15(ve)-.2 G .145(rage pings,).15 F .642(or windo)108 254.4 R 3.142(wi)
--.25 G 3.142(nt)-3.142 G .642(ime and space.)-3.142 F F2(mbcopy)3.142 E
-F0 .643(can be used as a \214lter from stdin to stdout, or it may do i/\
-o to and)3.142 F(from \214les.)108 266.4 Q F1 -.548(AU)72 295.2 S
-(THORSHIP).548 E F0(Da)108 307.2 Q(vid W)-.2 E 2.5(.C)-.92 G
-(aress \(caress at mbari.or)-2.5 E(g\))-.18 E(Montere)113 319.2 Q 2.5(yB)
--.15 G(ay Aquarium Research Institute)-2.5 E
-(Dale N. Chayes \(dale at ldeo.columbia.edu\))108 331.2 Q
-(Lamont-Doherty Earth Observ)113 343.2 Q(atory)-.25 E F1(OPTIONS)72 372
-Q F2<ad42>108 384 Q F3(yr/mo/da/hr/mn/sc)23.63 E F0 .155
-(This option sets the starting time for data allo)144 396 R .155
-(wed in the input data.)-.25 F(The)5.155 E F2<ad45>2.655 E F0 .155
-(option sets the ending)2.655 F .195
-(time for data. If the starting time is before the ending time, then an)
-144 408 R 2.695(yd)-.15 G .196(ata with a time stamp before)-2.695 F
-.444(the starting time or after the ending time is ignored. If instead \
-the starting time is after the ending)144 420 R .194(time, then an)144
-432 R 2.694(yd)-.15 G .194(ata between the ending and starting time wil\
-l be ignored. This scheme allo)-2.694 F .195(ws time)-.25 F(windo)144
-444 Q 5.376(wing both inside and outside a speci\214ed interv)-.25 F
-7.876(al. Def)-.25 F(ault:)-.1 E F3(yr/mo/da/hr/mn/sc)7.876 E F0(=)7.876
-E(1962/2/21/10/30/0.)144 456 Q F2<ad43>108 472.8 Q F3(comment\214le)
-23.08 E F0 -1.25 -.7(Te x)144 484.8 T 3.895<748c>.7 G 1.396
-(le containing comments which are inserted into the be)-3.895 F 1.396
-(ginning of the output data stream.)-.15 F .7(This option is typically \
-used to insert a data pedigree statement at the be)144 496.8 R .7
-(ginning of data process-)-.15 F(ing.)144 508.8 Q F2<ad44>108 525.6 Q F0
-.112(This option only w)23.08 F .113
-(orks when the output format is MBLDEOIH \(format 71\).)-.1 F(When)5.113
-E F2<ad44>2.613 E F0 .113(is in)2.613 F -.2(vo)-.4 G -.1(ke).2 G(d,).1 E
-F2(mbcopy)144 537.6 Q F0 .572(only outputs sw)3.072 F .572(ath bath)-.1
-F .572(ymetry data \(an)-.05 F 3.071(ya)-.15 G .571
-(mplitude and sidescan data found in the input)-3.071 F .254
-(are ignored\).)144 549.6 R(The)5.254 E F2(MB-System)2.754 E F0(program)
-2.754 E F2(mbdatalist)2.754 E F0 .254(uses this option to generate "f)
-2.754 F .255(ast bath)-.1 F(ymetry")-.05 E .131
-(or "fbt" \214les. See the)144 561.6 R F2(MB-System)2.631 E F0 .13
-(manual page for information on the use and utility of "fbt" \214les.)
-2.631 F F2<ad45>108 578.4 Q F3(yr/mo/da/hr/mn/sc)23.63 E F0 .155
-(This option sets the ending time for data allo)144 590.4 R .155
-(wed in the input data.)-.25 F(The)5.155 E F2<ad42>2.655 E F0 .155
-(option sets the starting)2.655 F .195
-(time for data. If the starting time is before the ending time, then an)
-144 602.4 R 2.695(yd)-.15 G .195(ata with a time stamp before)-2.695 F
-.444(the starting time or after the ending time is ignored. If instead \
-the starting time is after the ending)144 614.4 R .195(time, then an)144
-626.4 R 2.695(yd)-.15 G .194(ata between the ending and starting time w\
-ill be ignored. This scheme allo)-2.695 F .194(ws time)-.25 F(windo)144
-638.4 Q 5.376(wing both inside and outside a speci\214ed interv)-.25 F
-7.876(al. Def)-.25 F(ault:)-.1 E F3(yr/mo/da/hr/mn/sc)7.876 E F0(=)7.876
-E(2062/2/21/10/30/0.)144 650.4 Q F2<ad46>108 667.2 Q F3
-(informat[/outformat[/mer)24.19 E -.1(ge)-.37 G(format]]).1 E F0 .098
-(Sets the format for the input and output sw)144 679.2 R .098
-(ath sonar data using)-.1 F F2(MBIO)2.598 E F0(inte)2.598 E .098
-(ger format identi\214ers. If)-.15 F(only)144 691.2 Q F3(informat)3.786
-E F0 1.286(is speci\214ed, then)3.786 F F3(outformat)3.786 E F0 1.287
-(is assumed to be the same. If bath)3.787 F 1.287(ymetry mer)-.05 F
-1.287(ging is)-.18 F .159(speci\214ed with the)144 703.2 R F2<ad4d>2.659
-E F0 .159(option, then the optional)2.659 F F3(mer)2.659 E -.1(ge)-.37 G
-(format).1 E F0 .158(speci\214es the format of the mer)2.659 F .158
-(ge \214le.)-.18 F .568(This program uses the)144 715.2 R F2(MBIO)3.068
-E F0 .568(library and will read or write an)3.068 F 3.068(ys)-.15 G -.1
-(wa)-3.068 G .568(th sonar format supported by).1 F F2(MBIO)144 727.2 Q
-F0 3.428(.Al)C .928(ist of the sw)-3.428 F .928
-(ath sonar data formats currently supported by)-.1 F F2(MBIO)3.428 E F0
-.928(and their identi\214er)3.428 F(MB-System 5.0)72 768 Q 2.5(3J)
-146.495 G(une 2013)-2.5 E(1)204.835 E 0 Cg EP
-%%Page: 2 2
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mbcop)72 48 Q 156.05(y\(1\) MB-System)-.1 F
-156.05(5.0 mbcop)2.5 F(y\(1\))-.1 E -.25(va)144 84 S .208(lues is gi).25
-F -.15(ve)-.25 G 2.708(ni).15 G 2.708(nt)-2.708 G(he)-2.708 E/F1 10
-/Times-Bold at 0 SF(MBIO)2.708 E F0 .208(manual page. When the)2.708 F/F2
-10/Times-Italic at 0 SF(informat)2.708 E F0(and)2.708 E F2(outformat)2.708
-E F0 -.25(va)2.708 G .209(lues are both asso-).25 F .818
-(ciated with the same sw)144 96 R .818(ath sonar sonar system \(e.g. th\
-e Atlas Hydrosweep DS system\), then the)-.1 F .064(complete data strea\
-m contained in the input \214le can be copied to the output \214le.)144
-108 R .064(If the tw)5.064 F 2.564(of)-.1 G(ormats)-2.564 E .82
-(are associated with tw)144 120 R 3.32(od)-.1 G(if)-3.32 E .819
-(ferent sw)-.25 F .819(ath sonar systems, then only the time stamp, na)
--.1 F(vig)-.2 E .819(ation, and)-.05 F 1.357(beam v)144 132 R 1.357
-(alues will be copied.)-.25 F 1.357(The use of ping a)6.357 F -.15(ve)
--.2 G 1.357(raging also causes a partial data stream to be).15 F 1.821
-(passed, e)144 144 R -.15(ve)-.25 G 4.321(nw).15 G 1.821(hen compatible\
- or identical input and output formats are speci\214ed \(see the)-4.321
-F F1<ad50>4.32 E F0 2.5(option\). Def)144 156 R(ault:)-.1 E F2(informat)
-2.5 E F0 2.5(=1)2.5 G(1;)-2.5 E F2(outformat)2.5 E F0 2.5(=1)2.5 G(1.)
--2.5 E F1<ad48>108 172.8 Q F0 .162(This "help" \215ag cause the program\
- to print out a description of its operation and then e)22.52 F .162
-(xit immedi-)-.15 F(ately)144 184.8 Q(.)-.65 E F1<ad49>108 201.6 Q F2
-(in\214lename)26.41 E F0 .33(Data \214le from which the input data will\
- be read. If no input \214le is speci\214ed, the input will be read)144
-213.6 R(from stdin. Def)144 225.6 Q(ault:)-.1 E F2(in\214lename)2.5 E F0
-2.5(=s)2.5 G(tdin.)-2.5 E F1<ad4c>108 242.4 Q F2(lon\215ip)23.63 E F0
-.572(Sets the range of the longitude v)144 254.4 R .572(alues returned.)
--.25 F(If)5.572 E F2(lon\215ip)3.072 E F0 .572
-(=\2551 then the longitude v)B .572(alues will be in)-.25 F .489
-(the range from \255360 to 0 de)144 266.4 R .488(grees. If)-.15 F F2
-(lon\215ip)2.988 E F0 .488(=0 then the longitude v)B .488
-(alues will be in the range from)-.25 F 1.382(\255180 to 180 de)144
-278.4 R 1.382(grees. If)-.15 F F2(lon\215ip)3.882 E F0 1.382
-(=1 then the longitude v)B 1.382
-(alues will be in the range from 0 to 360)-.25 F(de)144 290.4 Q 2.5
-(grees. Def)-.15 F(ault:)-.1 E F2(lon\215ip)2.5 E F0 2.5(=0)2.5 G(.)-2.5
-E F1<ad4d>108 307.2 Q F2(mer)20.86 E -.1(ge)-.37 G(\214lename).1 E F0
-.122(If a mer)144 319.2 R .121(ge \214le is speci\214ed then the bath)
--.18 F .121(ymetry data and \215ags from the mer)-.05 F .121
-(ge \214le will be written to)-.18 F .783
-(the output \214le along with the remaining data from the input \214le.)
-144 331.2 R .783(This can be used to mer)5.783 F .783(ge tw)-.18 F(o)-.1
-E .939(processing streams, one for bath)144 343.2 R .938
-(ymetry data and the other for other data sets. The input \214le and)
--.05 F(mer)144 355.2 Q(ge \214le must both be based on the same ra)-.18
-E 2.5(wd)-.15 G(ata.)-2.5 E F1<ad4e>108 372 Q F0(Normally)23.08 E(,)-.65
-E F1(mbcopy)4.398 E F0 1.898
-(generates a set of comment records at the be)4.398 F 1.899
-(ginning of the output stream)-.15 F .235(which record when, ho)144 384
-R 1.534 -.65(w, a)-.25 H .234(nd by whom).65 F F1(mbcopy)2.734 E F0 -.1
-(wa)2.734 G 2.734(sr).1 G 2.734(un. If)-2.734 F(the)2.734 E F1<ad4e>
-2.734 E F0 .234(\215ag is gi)2.734 F -.15(ve)-.25 G .234
-(n, these comments).15 F 1.274
-(are not included in the output stream, and, in addition, an)144 396 R
-3.775(yp)-.15 G(ree)-3.775 E 1.275(xisting comment records in the)-.15 F
-.098(input data stream are not passed to the output data stream.)144 408
-R(Ho)5.098 E(we)-.25 E -.15(ve)-.25 G .898 -.4(r, t).15 H(he).4 E F1
-<ad4e>2.598 E F0 .098(option does not af)2.598 F(fect)-.25 E
-(the insertion of comments from a te)144 420 Q
-(xt \214le if speci\214ed using the)-.15 E F1<ad43>2.5 E F0(option.)2.5
-E F1<ad4f>108 436.8 Q F2(out\214lename)22.52 E F0 .624(Data \214le to w\
-hich the output data will be written. If no output \214le is speci\214e\
-d, the output will be)144 448.8 R(written to stdout. Def)144 460.8 Q
-(ault:)-.1 E F2(out\214lename)2.5 E F0 2.5(=s)2.5 G(tdout.)-2.5 E F1
-<ad50>108 477.6 Q F2(pings)24.19 E F0 1.22(Sets the ping a)144 489.6 R
--.15(ve)-.2 G 1.22(raging of the input data. If).15 F F2(pings)3.719 E
-F0 3.719(=1)3.719 G 3.719(,t)-3.719 G 1.219(hen no ping a)-3.719 F -.15
-(ve)-.2 G 1.219(raging is performed. If).15 F F2(pings)144 501.6 Q F0
-2.651(>0)2.651 G 2.651(,t)-2.651 G .151
-(hen that number of input pings will be a)-2.651 F -.15(ve)-.2 G .152
-(raged to produce one output ping.).15 F(If)5.152 E F2(pings)2.652 E F0
-(=)2.652 E .314(0, then the ping a)144 513.6 R -.15(ve)-.2 G .313(ragin\
-g will automatically be done so that the along-track ping spacing is eq\
-ual).15 F .912(to the across-track beam spacing. If ping a)144 525.6 R
--.15(ve)-.2 G .912(raging is used \().15 F F2(pings)A F0 .913
-(!= 1\), then only a partial data)3.412 F
-(stream can be copied \(see the)144 537.6 Q F1<ad46>2.5 E F0 2.5
-(option\). Def)2.5 F(ault:)-.1 E F2(pings)2.5 E F0 2.5(=1\()2.5 G
-(no ping a)-2.5 E -.15(ve)-.2 G(raging\).).15 E F1<ad51>108 554.4 Q F2
-(sleep_factor)22.52 E F0 .275(Causes the program to sleep before writin\
-g each data record, thus simulating a simple data logger)144 566.4 R(.)
--.55 E 1.832(The amount of time slept is the time between the pre)144
-578.4 R 1.833(vious and current pings times the v)-.25 F(alue)-.25 E F2
-(sleep_factor)144 590.4 Q F0 5(.D)C(ef)-5 E(ault:)-.1 E F2(sleep_factor)
-2.5 E F0 2.5(=1)2.5 G(.0)-2.5 E F1<ad52>108 607.2 Q F2
-(west/east/south/north)23.08 E F0 .679
-(Sets the longitude and latitude bounds within which sw)144 619.2 R .679
-(ath sonar data will be read. Only the data)-.1 F 3.093
-(which lies within these bounds will be copied.)144 631.2 R(Def)8.094 E
-(ault:)-.1 E F2(west)5.594 E F0 3.094(=\255360, east)B F2(=360)A F0(,)A
-F2(south)5.594 E F0(=\25590,)A F2(north)144 643.2 Q F0(=90.)A F1<ad53>
-108 660 Q F2(speed)24.74 E F0 .532
-(Sets the minimum speed in km/hr \(5.5 kts ~ 10 km/hr\) allo)144 672 R
-.531(wed in the input data; pings associated)-.25 F
-(with a smaller ship speed will not be copied. Def)144 684 Q(ault:)-.1 E
-F2(speed)2.5 E F0 2.5(=0)2.5 G(.)-2.5 E F1<ad54>108 700.8 Q F2(time)
-23.63 E(gap)-.4 E F0 .478(Sets the maximum time g)144 712.8 R .479
-(ap in minutes between adjacent pings allo)-.05 F .479
-(wed before the data is consid-)-.25 F(ered to ha)144 724.8 Q .3 -.15
-(ve a g)-.2 H(ap. Def).1 E(ault:)-.1 E F2(time)2.5 E(gap)-.4 E F0 2.5
-(=1)2.5 G(.)-2.5 E(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)-2.5
-E(2)204.835 E 0 Cg EP
-%%Page: 3 3
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mbcop)72 48 Q 156.05(y\(1\) MB-System)-.1 F
-156.05(5.0 mbcop)2.5 F(y\(1\))-.1 E/F1 10/Times-Bold at 0 SF<ad56>108 84 Q
-F0(Normally)23.08 E(,)-.65 E F1(mbcopy)3.633 E F0 -.1(wo)3.633 G 1.133
-(rks "silently" without outputting an).1 F 1.132
-(ything to the stderr stream.)-.15 F 1.132(If the)6.132 F F1<ad56>3.632
-E F0 1.467(\215ag is gi)144 96 R -.15(ve)-.25 G 1.467(n, then).15 F F1
-(mbcopy)3.967 E F0 -.1(wo)3.967 G 1.467(rks in a "v).1 F 1.468
-(erbose" mode and outputs the program v)-.15 F 1.468(ersion being)-.15 F
-(used, all error status messages, and the number of records input and o\
-utput.)144 108 Q/F2 10.95/Times-Bold at 0 SF(EXAMPLES)72 136.8 Q F0 2.204
-(Suppose one wishes to cop)108 148.8 R 4.704(yar)-.1 G 2.504 -.15(aw H)
--4.704 H 2.204(ydrosweep \214le \(format 21\) called hs_ra).15 F 4.703
-(wi)-.15 G 2.203(nto a L-DEO binary)-4.703 F .739
-(Hydrosweep \214le \(format 24\) called hs_binary while windo)108 160.8
-R .739(wing the data into a re)-.25 F .74(gion between 145W and)-.15 F
-(140W longitude and between 10S and 5S longitude. The follo)108 172.8 Q
-(wing will suf)-.25 E(\214ce:)-.25 E(mbcop)144 184.8 Q 2.5<79ad>-.1 G
-(P1 \255F21/24 \255R-145/-140/-10/-5 \255Ihs_ra)-2.5 E 2.5<77ad>-.15 G
-(Ohs_binary)-2.5 E .249(Suppose one has a program called thrash_prog wh\
-ich requires Hydrosweep data to be input in the URI for)108 208.8 R(-)
--.2 E .439(mat \(format 23\) to stdin, b)108 220.8 R .439(ut the e)-.2 F
-.439(xisting data is in a ra)-.15 F 2.94(wH)-.15 G .44
-(ydrosweep \214le \(format 21\).)-2.94 F .44(The follo)5.44 F .44
-(wing will)-.25 F -.1(wo)108 232.8 S(rk:).1 E(mbcop)144 244.8 Q 2.5
-<79ad>-.1 G(P1 \255F21/23 | thrash_prog)-2.5 E
-(where a pipe \(|\) has been used to direct the stdout stream from)108
-268.8 Q F1(mbcopy)2.5 E F0(to the stdin stream of thrash_prog.)2.5 E
-.104(Suppose one has some ra)108 292.8 R 2.603(wd)-.15 G .103(ata from \
-a Simrad EM300 that has been cleaned and processed by a third party)
--2.603 F .808(using other softw)108 304.8 R .808(are and e)-.1 F .808
-(xported as a GSF \214le, b)-.15 F .808(ut one w)-.2 F .809
-(ants to access the original Simrad attitude and)-.1 F
-(backscatter data with the corrected bath)108 316.8 Q(ymetry data.)-.05
-E(The follo)5 E(wing will w)-.25 E(ork:)-.1 E(mbcop)144 328.8 Q 22.404
-<79ad>-.1 G 19.903(F56/57/121 \255I0015_20040212_052714_ra)-22.404 F
--.65(w.)-.15 G 19.903(all \255M20040212_052714.gsf).65 F
-(\255O20040212_052714.mb57)108 340.8 Q F2(SEE ALSO)72 369.6 Q F1
-(mbsystem)108 381.6 Q F0(\(1\),)A F1(mbio)2.5 E F0(\(1\))A F2 -.11(BU)72
-410.4 S(GS).11 E F0(Certainly)108 422.4 Q(.)-.65 E(MB-System 5.0)72 768
-Q 2.5(3J)146.495 G(une 2013)-2.5 E(3)204.835 E 0 Cg EP
-%%Trailer
-end
-%%EOF
diff --git a/src/ps/mbctdlist.ps b/src/ps/mbctdlist.ps
deleted file mode 100644
index a9e30c4..0000000
--- a/src/ps/mbctdlist.ps
+++ /dev/null
@@ -1,434 +0,0 @@
-%!PS-Adobe-3.0
-%%Creator: groff version 1.19.2
-%%CreationDate: Wed Jul  1 12:29:26 2015
-%%DocumentNeededResources: font Times-Roman
-%%+ font Times-Bold
-%%+ font Times-Italic
-%%DocumentSuppliedResources: procset grops 1.19 2
-%%Pages: 3
-%%PageOrder: Ascend
-%%DocumentMedia: Default 612 792 0 () ()
-%%Orientation: Portrait
-%%EndComments
-%%BeginDefaults
-%%PageMedia: Default
-%%EndDefaults
-%%BeginProlog
-%%BeginResource: procset grops 1.19 2
-%!PS-Adobe-3.0 Resource-ProcSet
-/setpacking where{
-pop
-currentpacking
-true setpacking
-}if
-/grops 120 dict dup begin
-/SC 32 def
-/A/show load def
-/B{0 SC 3 -1 roll widthshow}bind def
-/C{0 exch ashow}bind def
-/D{0 exch 0 SC 5 2 roll awidthshow}bind def
-/E{0 rmoveto show}bind def
-/F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def
-/G{0 rmoveto 0 exch ashow}bind def
-/H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/I{0 exch rmoveto show}bind def
-/J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def
-/K{0 exch rmoveto 0 exch ashow}bind def
-/L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/M{rmoveto show}bind def
-/N{rmoveto 0 SC 3 -1 roll widthshow}bind def
-/O{rmoveto 0 exch ashow}bind def
-/P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/Q{moveto show}bind def
-/R{moveto 0 SC 3 -1 roll widthshow}bind def
-/S{moveto 0 exch ashow}bind def
-/T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/SF{
-findfont exch
-[exch dup 0 exch 0 exch neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/MF{
-findfont
-[5 2 roll
-0 3 1 roll
-neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/level0 0 def
-/RES 0 def
-/PL 0 def
-/LS 0 def
-/MANUAL{
-statusdict begin/manualfeed true store end
-}bind def
-/PLG{
-gsave newpath clippath pathbbox grestore
-exch pop add exch pop
-}bind def
-/BP{
-/level0 save def
-1 setlinecap
-1 setlinejoin
-72 RES div dup scale
-LS{
-90 rotate
-}{
-0 PL translate
-}ifelse
-1 -1 scale
-}bind def
-/EP{
-level0 restore
-showpage
-}def
-/DA{
-newpath arcn stroke
-}bind def
-/SN{
-transform
-.25 sub exch .25 sub exch
-round .25 add exch round .25 add exch
-itransform
-}bind def
-/DL{
-SN
-moveto
-SN
-lineto stroke
-}bind def
-/DC{
-newpath 0 360 arc closepath
-}bind def
-/TM matrix def
-/DE{
-TM currentmatrix pop
-translate scale newpath 0 0 .5 0 360 arc closepath
-TM setmatrix
-}bind def
-/RC/rcurveto load def
-/RL/rlineto load def
-/ST/stroke load def
-/MT/moveto load def
-/CL/closepath load def
-/Fr{
-setrgbcolor fill
-}bind def
-/setcmykcolor where{
-pop
-/Fk{
-setcmykcolor fill
-}bind def
-}if
-/Fg{
-setgray fill
-}bind def
-/FL/fill load def
-/LW/setlinewidth load def
-/Cr/setrgbcolor load def
-/setcmykcolor where{
-pop
-/Ck/setcmykcolor load def
-}if
-/Cg/setgray load def
-/RE{
-findfont
-dup maxlength 1 index/FontName known not{1 add}if dict begin
-{
-1 index/FID ne{def}{pop pop}ifelse
-}forall
-/Encoding exch def
-dup/FontName exch def
-currentdict end definefont pop
-}bind def
-/DEFS 0 def
-/EBEGIN{
-moveto
-DEFS begin
-}bind def
-/EEND/end load def
-/CNT 0 def
-/level1 0 def
-/PBEGIN{
-/level1 save def
-translate
-div 3 1 roll div exch scale
-neg exch neg exch translate
-0 setgray
-0 setlinecap
-1 setlinewidth
-0 setlinejoin
-10 setmiterlimit
-[]0 setdash
-/setstrokeadjust where{
-pop
-false setstrokeadjust
-}if
-/setoverprint where{
-pop
-false setoverprint
-}if
-newpath
-/CNT countdictstack def
-userdict begin
-/showpage{}def
-/setpagedevice{}def
-}bind def
-/PEND{
-countdictstack CNT sub{end}repeat
-level1 restore
-}bind def
-end def
-/setpacking where{
-pop
-setpacking
-}if
-%%EndResource
-%%EndProlog
-%%BeginSetup
-%%BeginFeature: *PageSize Default
-<< /PageSize [ 612 792 ] /ImagingBBox null >> setpagedevice
-%%EndFeature
-%%IncludeResource: font Times-Roman
-%%IncludeResource: font Times-Bold
-%%IncludeResource: font Times-Italic
-grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72
-def/PL 792 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron/Zcaron
-/scaron/zcaron/Ydieresis/trademark/quotesingle/Euro/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/space/exclam/quotedbl/numbersign/dollar/percent
-/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen
-/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon
-/semicolon/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O
-/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright/circumflex
-/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y
-/z/braceleft/bar/braceright/tilde/.notdef/quotesinglbase/guillemotleft
-/guillemotright/bullet/florin/fraction/perthousand/dagger/daggerdbl
-/endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut
-/dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash
-/quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen
-/brokenbar/section/dieresis/copyright/ordfeminine/guilsinglleft
-/logicalnot/minus/registered/macron/degree/plusminus/twosuperior
-/threesuperior/acute/mu/paragraph/periodcentered/cedilla/onesuperior
-/ordmasculine/guilsinglright/onequarter/onehalf/threequarters
-/questiondown/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE
-/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex
-/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis
-/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn
-/germandbls/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla
-/egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis
-/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide/oslash
-/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis]def
-/Times-Italic at 0 ENC0/Times-Italic RE/Times-Bold at 0 ENC0/Times-Bold RE
-/Times-Roman at 0 ENC0/Times-Roman RE
-%%EndSetup
-%%Page: 1 1
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 150.94(mbctdlist\(1\) MB-System)72 48 R 150.94
-(5.0 mbctdlist\(1\))2.5 F/F1 10.95/Times-Bold at 0 SF -.219(NA)72 84 S(ME)
-.219 E/F2 10/Times-Bold at 0 SF(mbctdlist)108 96 Q F0 2.5<ad4c>2.5 G
-(ist CTD data in sw)-2.5 E(ath sonar data \214les.)-.1 E F1(VERSION)72
-124.8 Q F0 -1.11(Ve)108 136.8 S(rsion 5.0)1.11 E F1(SYNOPSIS)72 165.6 Q
-F2(mbctdlist)108 177.6 Q F0([)2.5 E F2<ad4120ad44>A/F3 10/Times-Italic at 0
-SF(decimate)A F2<ad46>2.5 E F3(format)A F2<ad47>2.5 E F3(delimeter)A F2
-<ad4820ad49>2.5 E F3(\214le)A F2<ad4f>2.5 E F3(output_format)A F2
-<ad5620ad5a>2.5 E F3(se)A(gment)-.4 E F0(])A F1(DESCRIPTION)72 206.4 Q
-F2(MBctdlist)108 218.4 Q F0 .289
-(prints the speci\214ed contents of CTD records in a sw)2.789 F .289
-(ath sonar data \214le to stdout. CTD stands for)-.1 F(conducti)108
-230.4 Q(vity)-.25 E 4.466(,t)-.65 G 1.967(emperature, and depth \(press\
-ure\). Some seafoor mapping sonar platforms \(e.g. R)-4.466 F -.5(OV)-.4
-G 4.467(so).5 G(r)-4.467 E -.55(AU)108 242.4 S .292(Vs\) carry CTDs. Th\
-e CTD data may be included in the sonar data stream to enable calculati\
-on of w).55 F(ater)-.1 E .062(sound speed for use in sonar settings and\
-/or data processing. In addition to the ra)108 254.4 R 2.563(wc)-.15 G
-(onducti)-2.563 E .063(vity \(S/m\), tem-)-.25 F .912(perature \(de)108
-266.4 R .912(gree C\), and pressure \(dBar\) data, salinity \(ppu\), de\
-pth \(m\), and w)-.15 F .912(ater sound speed \(m/s\) are)-.1 F .536
-(typically a)108 278.4 R -.25(va)-.2 G .537(ilable by calculation.).25 F
-F2(MBctdlist)A F0 .537(can also output na)3.037 F(vig)-.2 E .537
-(ation and time stamp v)-.05 F .537(alues. By def)-.25 F(ault,)-.1 E F2
-(mbctdlist)108 290.4 Q F0 1.029(produces ASCII \214les in spreadsheet s\
-tyle, with data columns separated by tabs. Alternati)6.03 F -.15(ve)-.25
-G(ly).15 E(,)-.65 E .081(other column delimiters can be used \()108
-302.4 R F2<ad47>A F0 .082(option\), or the output can be binary)2.582 F
-2.582(,w)-.65 G .082(ith each \214eld represented as)-2.582 F 2.832(ad)
-108 314.4 S .332(ouble precision \215oat \()-2.832 F F2<ad41>A F0 .331
-(option\). The option)2.831 F F2<ad4f>2.831 E F3(output_format)A F0 .331
-(is used to control the data types that are)2.831 F .908
-(sent to stdout. The output stream can be decimated using the)108 326.4
-R F2<ad44>3.408 E F0 .908(option. The output of)3.408 F F2(mbctdlist)
-3.408 E F0 .908(can be)3.408 F
-(piped to plotting and data analysis programs.)108 338.4 Q F1 -.548(AU)
-72 367.2 S(THORSHIP).548 E F0(Da)108 379.2 Q(vid W)-.2 E 2.5(.C)-.92 G
-(aress \(caress at mbari.or)-2.5 E(g\))-.18 E(Montere)113 391.2 Q 2.5(yB)
--.15 G(ay Aquarium Research Institute)-2.5 E
-(Dale N. Chayes \(dale at ldeo.columbia.edu\))108 403.2 Q
-(Lamont-Doherty Earth Observ)113 415.2 Q(atory)-.25 E F1(OPTIONS)72 444
-Q F2<ad41>108 456 Q F0 1.035(Causes the output to be binary \(nati)144
-468 R 1.335 -.15(ve d)-.25 H 1.035
-(ouble precision \215oating point\) rather than ASCII. Some).15 F .032
-(output options cannot be represented as single binary \215oats \(e.g.)
-144 480 R .032(time strings and longitude or lati-)5.032 F 1.064
-(tude brok)144 492 R 1.064(en into de)-.1 F 1.064
-(grees and minutes. These v)-.15 F 1.063
-(alues are output as multiple \214elds as appropriate.)-.25 F(Def)144
-504 Q(ault: ASCII output with \214elds separated by tabs.)-.1 E F2<ad44>
-108 520.8 Q F3(decimate)23.08 E F0 .407
-(Sets the decimation of the output data. By def)144 532.8 R .407
-(ault \(i.e.)-.1 F F3(decimate)2.907 E F0 .408(=1\), e)B -.15(ve)-.25 G
-.408(ry a).15 F -.25(va)-.2 G .408(ilable data record is).25 F
-(output. If)144 544.8 Q F3(decimate)2.5 E F0(>1, then only e)A -.15(ve)
--.25 G(ry ").15 E F3(decimate)A F0("th record will be output. Def)A
-(ault:)-.1 E F3(decimate)2.5 E F0(=1.)A F2<ad46>108 561.6 Q F3(format)
-24.19 E F0 .92(Sets the format for the input sw)144 573.6 R .919
-(ath sonar data using)-.1 F F2(MBIO)3.419 E F0(inte)3.419 E .919
-(ger format identi\214ers.)-.15 F .919(This pro-)5.919 F .501
-(gram uses the)144 585.6 R F2(MBIO)3.001 E F0 .501
-(library and will read an)3.001 F 3.001(ys)-.15 G -.1(wa)-3.001 G .501
-(th sonar format supported by).1 F F2(MBIO)3.001 E F0 3.002(.Al)C .502
-(ist of)-3.002 F .694(the sw)144 597.6 R .694
-(ath sonar data formats currently supported by)-.1 F F2(MBIO)3.194 E F0
-.694(and their identi\214er v)3.194 F .694(alues is gi)-.25 F -.15(ve)
--.25 G 3.194(ni).15 G(n)-3.194 E(the)144 609.6 Q F2(MBIO)2.5 E F0
-(manual page. Def)2.5 E(ault:)-.1 E F3(format)2.5 E F0 2.5(=1)2.5 G(1.)
--2.5 E F2<ad47>108 626.4 Q F3(delimiter)22.52 E F0 .079(Sets the charac\
-ter\(s\) used to separate output \214elds when ascii columns are output\
-. Def)144 638.4 R .079(ault: tabs are)-.1 F(used as delimiters.)144
-650.4 Q F2<ad48>108 667.2 Q F0 .162(This "help" \215ag cause the progra\
-m to print out a description of its operation and then e)22.52 F .161
-(xit immedi-)-.15 F(ately)144 679.2 Q(.)-.65 E F2<ad49>108 696 Q F3
-(\214le)26.41 E F0 .312(Sets the input \214lename. If)144 708 R F3
-(format)2.813 E F0 2.813(>0\()2.813 G .313(set with the)-2.813 F F2
-<ad46>2.813 E F0 .313(option\) then the sw)2.813 F .313
-(ath sonar data contained)-.1 F(in)144 720 Q F3(\214le)2.956 E F0 .456
-(is read and processed. If)2.956 F F3(format)2.956 E F0 2.956(<0)2.956 G
-2.956(,t)-2.956 G(hen)-2.956 E F3(\214le)2.956 E F0 .455
-(is assumed to be an ascii \214le containing a list)2.956 F
-(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(1)204.835 E 0
-Cg EP
-%%Page: 2 2
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 150.94(mbctdlist\(1\) MB-System)72 48 R 150.94
-(5.0 mbctdlist\(1\))2.5 F .869(of the input sw)144 84 R .869
-(ath sonar data \214les to be processed and their formats.)-.1 F .87
-(The program will read the)5.87 F .664
-(data in each one of these \214les.)144 96 R .664(In the)5.664 F/F1 10
-/Times-Italic at 0 SF(\214le)3.164 E F0 .663
-(\214le, each data \214le should be follo)3.164 F .663
-(wed by a data format)-.25 F(identi\214er)144 108 Q 2.5(,e)-.4 G(.g.:)
--2.5 E(data\214le.mb88 88)180 120 Q(data\214le.mb88 88)180 132 Q .679
-(This program uses the)144 144 R/F2 10/Times-Bold at 0 SF(MBIO)3.179 E F0
-.679(library and will read an)3.179 F 3.179(ys)-.15 G -.1(wa)-3.179 G
-.68(th sonar format supported by).1 F F2(MBIO)3.18 E F0(.)A(Ho)144 156 Q
-(we)-.25 E -.15(ve)-.25 G .974 -.4(r, o).15 H .174
-(nly \214les in formats supporting CTD data will contain rele).4 F -.25
-(va)-.25 G .174(nt data and produce an out-).25 F 3.038(put. A)144 168 R
-.538(list of the sw)3.038 F .539
-(ath sonar data formats currently supported by)-.1 F F2(MBIO)3.039 E F0
-.539(and their identi\214er v)3.039 F(al-)-.25 E(ues is gi)144 180 Q
--.15(ve)-.25 G 2.5(ni).15 G 2.5(nt)-2.5 G(he)-2.5 E F2(MBIO)2.5 E F0
-(manual page.)2.5 E(Def)5 E(ault:)-.1 E F1(\214le)2.5 E F0 2.5(=")2.5 G
-(datalist.mb-1".)-2.5 E F2<ad4c>108 196.8 Q F1(lon\215ip)23.63 E F0 .572
-(Sets the range of the longitude v)144 208.8 R .572(alues returned.)-.25
-F(If)5.572 E F1(lon\215ip)3.072 E F0 .572(=\2551 then the longitude v)B
-.571(alues will be in)-.25 F .488(the range from \255360 to 0 de)144
-220.8 R .488(grees. If)-.15 F F1(lon\215ip)2.988 E F0 .488
-(=0 then the longitude v)B .489(alues will be in the range from)-.25 F
-1.383(\255180 to 180 de)144 232.8 R 1.383(grees. If)-.15 F F1(lon\215ip)
-3.882 E F0 1.382(=1 then the longitude v)B 1.382
-(alues will be in the range from 0 to 360)-.25 F(de)144 244.8 Q 2.5
-(grees. Def)-.15 F(ault:)-.1 E F1(lon\215ip)2.5 E F0 2.5(=0)2.5 G(.)-2.5
-E F2<ad4f>108 261.6 Q F1(output_format)22.52 E F0 .388
-(Determines the form of the output.)144 273.6 R F1(Output_format)2.888 E
-F0 .388(is a string composed of one or more of the fol-)2.888 F(lo)144
-285.6 Q(wing characters:)-.25 E F2(C)180 309.6 Q F0(for conducti)5 E
-(vity \(S/m\))-.25 E F2(^C)180 321.6 Q F0(for sonar altitude \(meters\))
-2.5 E F2(c)180 333.6 Q F0(for temperature \(de)5 E(gree C\))-.15 E F2
-(^c)180 345.6 Q F0(for sonar depth \(meters\))2.5 E F2(H)180 357.6 Q F0
-(for heading \(de)5 E(grees\))-.15 E F2(h)180 369.6 Q F0
-(for course made good \(de)5 E(grees\))-.15 E F2(J)180 381.6 Q F0
-(for a time string \(yyyy jd hh mm ss.ssssss\))5 E
-(where jd is the julian day of the year)186.5 393.6 Q F2(j)180 405.6 Q
-F0(for a time string \(yyyy jd dm ss.ssssss\))5 E
-(where jd is the julian day of the year)186.5 417.6 Q
-(and dm is the minute of the day)186.5 429.6 Q F2(L)180 441.6 Q F0
-(for cumulati)5 E .3 -.15(ve a)-.25 H(long-track distance \(km\)).15 E
-F2(l)180 453.6 Q F0(for cumulati)5 E .3 -.15(ve a)-.25 H
-(long-track distance \(m\)).15 E F2(M)180 465.6 Q F0
-(for unix time in decimal seconds since 1/1/70 00:00:00)5 E F2(m)180
-477.6 Q F0(for time in decimal seconds since \214rst record)5 E F2(P)180
-489.6 Q F0(for potential temperature \(de)5 E(gree\))-.15 E F2(S)180
-501.6 Q F0(for salinity \(ppu\))5 E F2(^S)180 513.6 Q F0
-(for speed \(km/hr\))2.5 E F2(s)180 525.6 Q F0(for w)5 E
-(ater sound speed \(m/s\))-.1 E F2(^s)180 537.6 Q F0
-(for speed made good \(km/hr\))2.5 E F2(T)180 549.6 Q F0
-(for a time string \(yyyy/mm/dd/hh/mm/ss\))5 E F2(t)180 561.6 Q F0
-(for a time string \(yyyy mm dd hh mm ss\))5 E F2(U)180 573.6 Q F0
-(for unix time in inte)5 E(ger seconds since 1/1/70 00:00:00)-.15 E F2
-(u)180 585.6 Q F0(for time in inte)5 E(ger seconds since \214rst record)
--.15 E F2(V)180 597.6 Q F0(for ping interv)5 E(al \(decimal seconds\))
--.25 E F2(X)180 609.6 Q F0(for longitude \(decimal de)5 E(grees\))-.15 E
-F2(x)180 621.6 Q F0(for longitude \(de)5 E
-(grees + decimal minutes + E/W\))-.15 E F2(Y)180 633.6 Q F0
-(for latitude \(decimal de)5 E(grees\))-.15 E F2(y)180 645.6 Q F0
-(for latitude \(de)5 E(grees + decimal minutes + N/S\))-.15 E(Def)144
-669.6 Q(ault)-.1 E F1(output_format)4.1 E F0(=)4.1 E F2(TXYCc^cSs)4.1 E
-F0(\(T)4.1 E 1.6(ime, lon, lat, conducti)-.35 F(vity)-.25 E 4.1(,t)-.65
-G 1.6(emperature, depth, salinity)-4.1 F(,)-.65 E(sound speed\).)144
-681.6 Q F2<ad56>108 698.4 Q F0(Normally)23.08 E(,)-.65 E F2(mbctdlist)
-3.162 E F0 -.1(wo)3.162 G .662(rks "silently" without outputting an).1 F
-.662(ything to the stderr stream.)-.15 F .663(If the)5.663 F F2<ad56>
-3.163 E F0 1.06(\215ag is gi)144 710.4 R -.15(ve)-.25 G 1.06(n, then).15
-F F2(mbctdlist)3.56 E F0 -.1(wo)3.56 G 1.06(rks in a "v).1 F 1.06
-(erbose" mode and outputs the program v)-.15 F 1.06(ersion being)-.15 F
-(used and all error status messages.)144 722.4 Q(MB-System 5.0)72 768 Q
-2.5(3J)146.495 G(une 2013)-2.5 E(2)204.835 E 0 Cg EP
-%%Page: 3 3
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 150.94(mbctdlist\(1\) MB-System)72 48 R 150.94
-(5.0 mbctdlist\(1\))2.5 F/F1 10/Times-Bold at 0 SF<ad5a>108 84 Q/F2 10
-/Times-Italic at 0 SF(se)23.63 E(gment)-.4 E F0 .677
-(Causes the ascii output of dif)144 96 R .677(ferent input sw)-.25 F
-.678(ath \214les \(e.g. when a datalist is speci\214ed with the)-.1 F F1
-<ad49>3.178 E F0 .373(option\) to be separated by lines with)144 108 R
-F2(se)2.873 E(gment)-.4 E F0 2.873(.I)C(f)-2.873 E F2(se)2.873 E(gment)
--.4 E F0 .373(is a single character)2.873 F 2.873(,t)-.4 G .372
-(hen the output is a)-2.873 F 1.251(multiple se)144 120 R 1.251
-(gment \214le of the sort accepted by the)-.15 F F1(GMT)3.751 E F0
-(program)3.751 E F1(psxy)3.752 E F0 6.252(.T)C 1.252(his option only w)
--6.252 F(orks)-.1 E .1(with ascii output, and is thus disabled when the)
-144 132 R F1<ad41>2.6 E F0 .1
-(option is speci\214ed. The most common usage is)2.6 F F1<ad5a>144 144 Q
-F0(I>)A F1(.)A/F3 10.95/Times-Bold at 0 SF(EXAMPLES)72 172.8 Q F0 .613(Sup\
-pose one wishes to obtain a ctd list from a Reson 7125 data \214le in t\
-he 7k format \(MBIO id 88\) called)108 184.8 R .754
-(20080904_231809p.mb88. T)108 196.8 R 3.254(oo)-.8 G .754
-(btain a listing with time in unix second forms follo)-3.254 F .753
-(wed by longitude, lati-)-.25 F(tude, and salinity)108 208.8 Q 2.5(,t)
--.65 G(he follo)-2.5 E(wing will suf)-.25 E(\214ce:)-.25 E
-(mbctdlist \255i 20080904_231809p.mb88 \255OMXYS | more)144 232.8 Q
-(The output will be as follo)108 256.8 Q(ws:)-.25 E 15
-(1220570288.486000 \255129.066699 47.997246)144 280.8 R(34.305)12.5 E 15
-(1220570288.685999 \255129.066702 47.997245)144 292.8 R(34.304)12.5 E 15
-(1220570288.885999 \255129.066706 47.997244)144 304.8 R(34.305)12.5 E 15
-(1220570289.086000 \255129.066710 47.997243)144 316.8 R(34.305)12.5 E 15
-(1220570289.286000 \255129.066713 47.997242)144 328.8 R(34.304)12.5 E
-(.....)144 340.8 Q F3(SEE ALSO)72 369.6 Q F1(mbsystem)108 381.6 Q F0
-(\(1\),)A F1(mbinf)2.5 E(o)-.25 E F0(\(1\))A F3 -.11(BU)72 410.4 S(GS)
-.11 E F1(mbctdlist)108 422.4 Q F0 .348(initially only w)2.848 F .349(or\
-ks with data in the MBF_RESON7KR format \(MBIO format id 88\) supportin\
-g)-.1 F(Reson 7k series multibeam sonars.)108 434.4 Q(MB-System 5.0)72
-768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(3)204.835 E 0 Cg EP
-%%Trailer
-end
-%%EOF
diff --git a/src/ps/mbdatalist.ps b/src/ps/mbdatalist.ps
deleted file mode 100644
index 196cea0..0000000
--- a/src/ps/mbdatalist.ps
+++ /dev/null
@@ -1,676 +0,0 @@
-%!PS-Adobe-3.0
-%%Creator: groff version 1.19.2
-%%CreationDate: Wed Jul  1 12:29:26 2015
-%%DocumentNeededResources: font Times-Roman
-%%+ font Times-Bold
-%%+ font Times-Italic
-%%DocumentSuppliedResources: procset grops 1.19 2
-%%Pages: 5
-%%PageOrder: Ascend
-%%DocumentMedia: Default 612 792 0 () ()
-%%Orientation: Portrait
-%%EndComments
-%%BeginDefaults
-%%PageMedia: Default
-%%EndDefaults
-%%BeginProlog
-%%BeginResource: procset grops 1.19 2
-%!PS-Adobe-3.0 Resource-ProcSet
-/setpacking where{
-pop
-currentpacking
-true setpacking
-}if
-/grops 120 dict dup begin
-/SC 32 def
-/A/show load def
-/B{0 SC 3 -1 roll widthshow}bind def
-/C{0 exch ashow}bind def
-/D{0 exch 0 SC 5 2 roll awidthshow}bind def
-/E{0 rmoveto show}bind def
-/F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def
-/G{0 rmoveto 0 exch ashow}bind def
-/H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/I{0 exch rmoveto show}bind def
-/J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def
-/K{0 exch rmoveto 0 exch ashow}bind def
-/L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/M{rmoveto show}bind def
-/N{rmoveto 0 SC 3 -1 roll widthshow}bind def
-/O{rmoveto 0 exch ashow}bind def
-/P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/Q{moveto show}bind def
-/R{moveto 0 SC 3 -1 roll widthshow}bind def
-/S{moveto 0 exch ashow}bind def
-/T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/SF{
-findfont exch
-[exch dup 0 exch 0 exch neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/MF{
-findfont
-[5 2 roll
-0 3 1 roll
-neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/level0 0 def
-/RES 0 def
-/PL 0 def
-/LS 0 def
-/MANUAL{
-statusdict begin/manualfeed true store end
-}bind def
-/PLG{
-gsave newpath clippath pathbbox grestore
-exch pop add exch pop
-}bind def
-/BP{
-/level0 save def
-1 setlinecap
-1 setlinejoin
-72 RES div dup scale
-LS{
-90 rotate
-}{
-0 PL translate
-}ifelse
-1 -1 scale
-}bind def
-/EP{
-level0 restore
-showpage
-}def
-/DA{
-newpath arcn stroke
-}bind def
-/SN{
-transform
-.25 sub exch .25 sub exch
-round .25 add exch round .25 add exch
-itransform
-}bind def
-/DL{
-SN
-moveto
-SN
-lineto stroke
-}bind def
-/DC{
-newpath 0 360 arc closepath
-}bind def
-/TM matrix def
-/DE{
-TM currentmatrix pop
-translate scale newpath 0 0 .5 0 360 arc closepath
-TM setmatrix
-}bind def
-/RC/rcurveto load def
-/RL/rlineto load def
-/ST/stroke load def
-/MT/moveto load def
-/CL/closepath load def
-/Fr{
-setrgbcolor fill
-}bind def
-/setcmykcolor where{
-pop
-/Fk{
-setcmykcolor fill
-}bind def
-}if
-/Fg{
-setgray fill
-}bind def
-/FL/fill load def
-/LW/setlinewidth load def
-/Cr/setrgbcolor load def
-/setcmykcolor where{
-pop
-/Ck/setcmykcolor load def
-}if
-/Cg/setgray load def
-/RE{
-findfont
-dup maxlength 1 index/FontName known not{1 add}if dict begin
-{
-1 index/FID ne{def}{pop pop}ifelse
-}forall
-/Encoding exch def
-dup/FontName exch def
-currentdict end definefont pop
-}bind def
-/DEFS 0 def
-/EBEGIN{
-moveto
-DEFS begin
-}bind def
-/EEND/end load def
-/CNT 0 def
-/level1 0 def
-/PBEGIN{
-/level1 save def
-translate
-div 3 1 roll div exch scale
-neg exch neg exch translate
-0 setgray
-0 setlinecap
-1 setlinewidth
-0 setlinejoin
-10 setmiterlimit
-[]0 setdash
-/setstrokeadjust where{
-pop
-false setstrokeadjust
-}if
-/setoverprint where{
-pop
-false setoverprint
-}if
-newpath
-/CNT countdictstack def
-userdict begin
-/showpage{}def
-/setpagedevice{}def
-}bind def
-/PEND{
-countdictstack CNT sub{end}repeat
-level1 restore
-}bind def
-end def
-/setpacking where{
-pop
-setpacking
-}if
-%%EndResource
-%%EndProlog
-%%BeginSetup
-%%BeginFeature: *PageSize Default
-<< /PageSize [ 612 792 ] /ImagingBBox null >> setpagedevice
-%%EndFeature
-%%IncludeResource: font Times-Roman
-%%IncludeResource: font Times-Bold
-%%IncludeResource: font Times-Italic
-grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72
-def/PL 792 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron/Zcaron
-/scaron/zcaron/Ydieresis/trademark/quotesingle/Euro/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/space/exclam/quotedbl/numbersign/dollar/percent
-/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen
-/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon
-/semicolon/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O
-/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright/circumflex
-/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y
-/z/braceleft/bar/braceright/tilde/.notdef/quotesinglbase/guillemotleft
-/guillemotright/bullet/florin/fraction/perthousand/dagger/daggerdbl
-/endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut
-/dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash
-/quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen
-/brokenbar/section/dieresis/copyright/ordfeminine/guilsinglleft
-/logicalnot/minus/registered/macron/degree/plusminus/twosuperior
-/threesuperior/acute/mu/paragraph/periodcentered/cedilla/onesuperior
-/ordmasculine/guilsinglright/onequarter/onehalf/threequarters
-/questiondown/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE
-/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex
-/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis
-/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn
-/germandbls/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla
-/egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis
-/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide/oslash
-/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis]def
-/Times-Italic at 0 ENC0/Times-Italic RE/Times-Bold at 0 ENC0/Times-Bold RE
-/Times-Roman at 0 ENC0/Times-Roman RE
-%%EndSetup
-%%Page: 1 1
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 146.5(mbdatalist\(1\) MB-System)72 48 R 146.5
-(5.0 mbdatalist\(1\))2.5 F/F1 10.95/Times-Bold at 0 SF -.219(NA)72 84 S(ME)
-.219 E/F2 10/Times-Bold at 0 SF(mbdatalist)108 96 Q F0 4.036<ad70>4.036 G
-1.536(arses recursi)-4.036 F 1.836 -.15(ve d)-.25 H 1.536(atalist \214l\
-es and outputs the complete list of data \214les, formats, and \214le)
-.15 F(weights.)108 108 Q F1(VERSION)72 136.8 Q F0 -1.11(Ve)108 148.8 S
-(rsion 5.0)1.11 E F1(SYNOPSIS)72 177.6 Q F2(mbdatalist)108 189.6 Q F0([)
-2.5 E F2<ad4320ad46>A/F3 10/Times-Italic at 0 SF(format)A F2<ad49>2.5 E F3
-(\214lename)A F2
-<ad4e20ad4f20ad5020ad5120ad5220ad5320ad5520ad5920ad5a20ad5620ad48>2.5 E
-F0(])A F1(DESCRIPTION)72 218.4 Q F2(MBdatalist)108 230.4 Q F0 .75
-(is a utility for parsing datalist \214les.)3.25 F .75
-(Datalist \214les, or lists of sw)5.75 F .75
-(ath data \214les and their format)-.1 F .773
-(ids, are used by a number of)108 242.4 R F2(MB-System)3.273 E F0 .772
-(programs. These lists may contain references to other datalists,)3.273
-F .693(making them recursi)108 254.4 R -.15(ve)-.25 G 3.193(.S).15 G
-.693(ee the)-3.193 F F2(MB-System)3.194 E F0 .694
-(manual page for details on the format and structure of datal-)3.194 F
-3.033(ists. The)108 266.4 R(program)3.033 E F2(mbdatalist)3.033 E F0
-.533(outputs each sw)3.033 F .532
-(ath data \214lename, format id, and \214le weight encountered as)-.1 F
-.337(it descends through the input datalist tree. If a sw)108 278.4 R
-.338(ath data \214le rather than a datalist is pro)-.1 F .338
-(vided as input, the)-.15 F(same sw)108 290.4 Q
-(ath data \214lename and format will be the sole output.)-.1 E .28(This\
- program can be used in shellscripts to read datalists in the same f)108
-314.4 R .28(ashion as)-.1 F F2(MB-System)2.78 E F0 .28(programs lik)2.78
-F(e)-.1 E F2(mbgrid)108 326.4 Q F0(and)3.792 E F2(mbpr)3.792 E(ocess)
--.18 E F0 6.292(.T)C 1.293
-(his program can also be used to check and deb)-6.292 F 1.293(ug comple)
--.2 F 3.793(xr)-.15 G(ecursi)-3.793 E 1.593 -.15(ve d)-.25 H(atalist).15
-E(structures.)108 338.4 Q .865(The program)108 362.4 R F2(mbpr)3.365 E
-(ocess)-.18 E F0 .865(operates on "ra)3.365 F .865(w" sw)-.15 F .865
-(ath data \214les, producing a "processed" sw)-.1 F .864
-(ath data \214le \(see)-.1 F(the)108 374.4 Q F2(mbpr)2.666 E(ocess)-.18
-E F0 .167(man page for e)2.666 F 2.667(xplanation\). The)-.15 F F2
-(MB-System)2.667 E F0 .167
-(algorithm for reading datalists will, if a \215ag is)2.667 F .758
-(set, replace a sw)108 386.4 R .757(ath \214le name with the associated\
- "processed" \214le name when that "processed" \214le e)-.1 F(xists.)
--.15 E .294(This \215ag may be set by embedding "$PR)108 398.4 R .295
-(OCESSED" as a line in a datalist or it may be set \214rst by the call-)
--.4 F .155(ing program. The \215ag may also be set to preclude reportin\
-g "processed" \214le names \(embedding "$RA)108 410.4 R .155(W" in)-.9 F
-2.827(ad)108 422.4 S .327(atalist accomplishes this\). When setting thi\
-s \215ag within datalists, the \214rst encounter of a $PR)-2.827 F
-(OCESSED)-.4 E .096(or $RA)108 434.4 R 2.596(Wt)-.9 G .096(ag will pre)
--2.596 F -.25(va)-.25 G .096(il o).25 F -.15(ve)-.15 G 2.595(rl).15 G
-.095(ater instances of either tag. The)-2.595 F F2<ad50>2.595 E F0(and)
-2.595 E F2<ad55>2.595 E F0 .095(options force)2.595 F F2(mbdatalist)
-2.595 E F0 .095(to out-)2.595 F(put processed \214le names when the)108
-446.4 Q 2.5(ye)-.15 G(xist \()-2.65 E F2<ad50>A F0 2.5(\)o)C 2.5(rt)-2.5
-G 2.5(oo)-2.5 G(nly output unprocessed \(ra)-2.5 E(w\) \214le names \()
--.15 E F2<ad55>A F0(\).)A .586(Programs such as)108 470.4 R F2(mbgrid)
-3.086 E F0 .586(try to check statistics or "inf" \214les to see if the \
-corresponding data \214les include)3.086 F .029(data within the speci\
-\214ed geographic bounds. Other programs look for "f)108 482.4 R .029
-(ast bath)-.1 F .029(ymetry" or "f)-.05 F .029(ast na)-.1 F(vig)-.2 E
-(ation")-.05 E 1.249(\("fbt" or "fn)108 494.4 R 1.249
-(v"\) \214les in order to read the data more quickly)-.4 F 3.75(.T)-.65
-G(he)-3.75 E F2<ad4e>3.75 E F0 1.25(option causes)3.75 F F2(mbdatalist)
-3.75 E F0 1.25(to create)3.75 F .561
-(these three types of ancillary \214les for each sw)108 506.4 R .561
-(ath data \214le. The)-.1 F F2<ad4f>3.06 E F0 .56(option causes)3.06 F
-F2(mbdatalist)3.06 E F0 .56(to create the)3.06 F("inf", "fbt", and "fn)
-108 518.4 Q(v" \214les only when the)-.4 E 2.5(yd)-.15 G(on')-2.5 E 2.5
-(ta)-.18 G(lready e)-2.5 E
-(xist or are out of date \(older than the data \214le\).)-.15 E .451
-(Datalists may also contain a third v)108 542.4 R .452
-(alue, called the grid weight, which is used by)-.25 F F2(mbgrid)2.952 E
-F0 .452(to priortize data.)2.952 F 1.728(The lar)108 554.4 R 1.728
-(ger the grid weight, the more importance)-.18 F F2(mbgrid)4.228 E F0
-1.728(attaches to the related bath)4.228 F 1.728(ymetry data. Grid)-.05
-F 1.023(weights can be applied to datalist entries which are themselv)
-108 566.4 R 1.023(es datalist \214les, causing these weights to be)-.15
-F .212(associated with all of \214les referenced therein. Ho)108 578.4 R
-(we)-.25 E -.15(ve)-.25 G 1.012 -.4(r, t).15 H .212(he def).4 F .212
-(ault beha)-.1 F .212(vior is for an)-.2 F 2.711(yg)-.15 G .211
-(rid weight in a par)-2.711 F(-)-.2 E .472(ticular datalist entry to o)
-108 590.4 R -.15(ve)-.15 G .472(rride v).15 F .473(alues deri)-.25 F
--.15(ve)-.25 G 2.973(df).15 G .473(rom higher le)-2.973 F -.15(ve)-.25 G
-.473(ls in the recursi).15 F .773 -.15(ve s)-.25 H 2.973(tructure. This)
-.15 F(beha)2.973 E(vior)-.2 E 1.281(can be re)108 602.4 R -.15(ve)-.25 G
-1.281(rsed if a $NOLOCAL).15 F 1.28(WEIGHT tag is placed in the datalis\
-t, or in a datalist higher up in the)-.74 F 2.5(structure. See)108 614.4
-R(the)2.5 E F2(MB-System)2.5 E F0
-(manual page for a more complete description.)2.5 E(The)108 638.4 Q F2
-<ad52>3.775 E F3(w/e/s/n)A F0 1.275(option causes the program to check \
-each data \214le with an "inf" \214le for o)3.775 F -.15(ve)-.15 G 1.275
-(rlap with the).15 F 1.156(desired bounds, and only report those \214le\
-s with data in the desired area \(or no "inf" \214le to check\). This)
-108 650.4 R(beha)108 662.4 Q .775(vior mimics that of)-.2 F F2(mbgrid)
-3.275 E F0 3.275(,a)C(llo)-3.275 E .775
-(wing users to check what data \214les will contrib)-.25 F .775
-(ute to gridding some)-.2 F(particular area.)108 674.4 Q(The)108 698.4 Q
-F2<ad51>2.79 E F0 .29
-(option causes the program to check each data \214le for the e)2.79 F
-.29(xistence of an)-.15 F 2.79(ya)-.15 G .29(ncillary \214les \(e.g. na)
--2.79 F(vi-)-.2 E -.05(ga)108 710.4 S .171(tion \214les, edit sa).05 F
-.471 -.15(ve \214)-.2 H .172(les, etc.\) referenced in its mbprocess pa\
-rameter \214le \(if the parameter \214le e).15 F .172(xists\). The)-.15
-F 1.102(program will list an)108 722.4 R 3.602(yp)-.15 G 1.101
-(roblem found with the processing parameters, and will also list an)
--3.602 F 3.601(yd)-.15 G 1.101(ata problem)-3.601 F(MB-System 5.0)72 768
-Q 2.5(3J)146.495 G(une 2013)-2.5 E(1)204.835 E 0 Cg EP
-%%Page: 2 2
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 146.5(mbdatalist\(1\) MB-System)72 48 R 146.5
-(5.0 mbdatalist\(1\))2.5 F
-(noted in the "inf" \214les. The possible data problems include:)108 84
-Q(No surv)128 96 Q .3 -.15(ey d)-.15 H(ata found).15 E
-(Zero longitude or latitude in surv)128 108 Q .3 -.15(ey d)-.15 H(ata)
-.15 E(Instantaneous speed e)128 120 Q(xceeds 25 km/hr)-.15 E -1.17 -.74
-(Av e)128 132 T(rage speed e).74 E(xceeds 25 km/hr)-.15 E
-(Sounding depth e)128 144 Q(xceeds 11000 m)-.15 E
-(Unsupported Simrad datagram)128 156 Q(The)108 180 Q/F1 10/Times-Bold at 0
-SF<ad5a>3.715 E F0 1.216(option causes the program to generate a datali\
-st \214le named "datalistp.mb-1" and then e)3.715 F 1.216(xit. This)-.15
-F(datalist has the follo)108 192 Q(wing form:)-.25 E($PR)144 204 Q
-(OCESSED)-.4 E(datalist.mb-1 \2551)144 216 Q .682
-(This \214le is a commonly used con)108 228 R -.15(ve)-.4 G .681
-(nience because it allo).15 F .681(ws users to easily reference the sw)
--.25 F .681(ath \214les listed)-.1 F .236(\(directly or recursi)108 240
-R -.15(ve)-.25 G .237
-(ly\) through the datalist "datalist.mb-1" with the $PR).15 F .237
-(OCESSED \215ag on. So, in order to)-.4 F 1.415(grid the processed bath)
-108 252 R 1.414(ymetry rather than the ra)-.05 F 3.914(wb)-.15 G(ath)
--3.914 E(ymetry)-.05 E 3.914(,r)-.65 G(un)-3.914 E F1(mbgrid)3.914 E F0
-1.414(with "datalistp.mb-1" as the)3.914 F
-(input rather than "datalist.mb-1".)108 264 Q(The)108 288 Q F1<ad53>
-3.023 E F0 .523(option causes)3.023 F F1(mbdatalist)3.023 E F0 .524(to \
-report the status of the \214les it lists, including whether the \214le\
- is up to)3.023 F .027
-(date or needs reprocessing, and if the \214le is lock)108 300 R(ed.)-.1
-E F1(MBpr)2.526 E(ocess)-.18 E F0 .026
-(sets locks while operating on a sw)2.526 F .026(ath \214le to)-.1 F
-(pre)108 312 Q -.15(ve)-.25 G .636(nt other instances of).15 F F1(mbpr)
-3.136 E(ocess)-.18 E F0 .636
-(from simultaneously operating on that same \214le. This allo)3.136 F
-.636(ws one to)-.25 F(run)108 324 Q F1(mbpr)5.19 E(ocess)-.18 E F0 2.69
-(multiple times simultaneously on a single datalist, either on a single\
- multiprocessor)5.19 F .413
-(machine or on multiple computers mounting the same \214lesystem.)108
-336 R .414(The consists of creating a small te)5.414 F .414(xt \214le)
--.15 F .471(named by appending ".lck" to the sw)108 348 R .471
-(ath \214lename; while this \214le e)-.1 F .47
-(xists other programs will not modify the)-.15 F(lock)108 360 Q .947(ed\
- \214le. The locking program deletes the lock \214le when it is done. O\
-rphaned lock \214les may be left if)-.1 F F1(mbpr)108 372 Q(ocess)-.18 E
-F0 2.122(crashes or is interrupted. These will pre)4.622 F -.15(ve)-.25
-G 2.121(nt reprocessing by).15 F F1(mbpr)4.621 E(ocess)-.18 E F0 4.621
-(,b)C 2.121(ut can be both)-4.821 F(detected with the)108 384 Q F1<ad53>
-2.5 E F0(option and remo)2.5 E -.15(ve)-.15 G 2.5(du).15 G(sing the)-2.5
-E F1<ad59>2.5 E F0(option.)2.5 E(Finally)108 408 Q 2.887(,t)-.65 G .388
-(his program can be used to cop)-2.887 F 2.888(yt)-.1 G .388(he sw)
--2.888 F .388
-(ath \214les referenced in a datalist structure to a single direc-)-.1 F
-.634(tory and to create a datalist there \(names "datalist.mb-1"\) that\
- references those sw)108 420 R .633(ath \214les. This is accom-)-.1 F
-.035(plished using the)108 432 R/F2 10/Times-Italic at 0 SF(-C)2.535 E F0
-.035(option. The)2.535 F F2(-C)2.535 E F0(cop)2.536 E 2.536(yf)-.1 G
-.036(unction will not be done if the)-2.536 F F2(-N)2.536 E F0(,)A F2
-(-O)2.536 E F0 2.536(,o)C(r)-2.536 E F2(-Q)2.536 E F0 .036
-(options are speci\214ed,)2.536 F -.2(bu)108 444 S 2.5(ti).2 G 2.5(sc)
--2.5 G(ompatible with the)-2.5 E F2(-P)2.5 E F0(,)A F2(-R)2.5 E F0 2.5
-(,a)C(nd)-2.5 E F2(-U)2.5 E F0(options.)2.5 E/F3 10.95/Times-Bold at 0 SF
--.548(AU)72 472.8 S(THORSHIP).548 E F0(Da)108 484.8 Q(vid W)-.2 E 2.5
-(.C)-.92 G(aress \(caress at mbari.or)-2.5 E(g\))-.18 E(Montere)113 496.8 Q
-2.5(yB)-.15 G(ay Aquarium Research Institute)-2.5 E
-(Dale N. Chayes \(dale at ldeo.columbia.edu\))108 508.8 Q
-(Lamont-Doherty Earth Observ)113 520.8 Q(atory)-.25 E F3(OPTIONS)72
-549.6 Q F1<ad43>108 561.6 Q F0 .039(Causes the sw)144 573.6 R .039(ath \
-\214les referenced in the input datalist structure to be copied to the \
-current directory)-.1 F 1.565(and creates a datalist \(names "datalist.\
-mb-1"\) that references the copied sw)144 585.6 R 1.566(ath \214les.)-.1
-F 1.566(The cop)6.566 F(y)-.1 E .664(function will not be done if the)
-144 597.6 R F2(-N)3.164 E F0(,)A F2(-O)3.164 E F0 3.164(,o)C(r)-3.164 E
-F2(-Q)3.164 E F0 .664(options are speci\214ed.)3.164 F .664(If the)5.664
-F F2(-P)3.164 E F0(,)A F2(-R)3.164 E F0 3.164(,a)C(nd)-3.164 E F2(-U)
-3.164 E F0(options)3.164 E 1.145
-(are speci\214ed these functions will modify which sw)144 609.6 R 1.145
-(ath \214les are copied. An)-.1 F 3.645(ya)-.15 G 1.145
-(ncilliary \214les \(e.g.)-3.645 F .063
-(*inf metadata \214les\) will also be copied, b)144 621.6 R .063
-(ut processed data \214les deri)-.2 F -.15(ve)-.25 G 2.563(df).15 G .063
-(rom the tar)-2.563 F .063(get copied \214les)-.18 F
-(will not be copied.)144 633.6 Q F1<ad46>108 650.4 Q F2(format)24.19 E
-F0 .319(Sets the data format associated with the datalist or sw)144
-662.4 R .32(ath data \214le speci\214ed with the)-.1 F F1<ad49>2.82 E F0
-.32(option. By)2.82 F(def)144 674.4 Q .147(ault, this program will atte\
-mpt to determine the format from the input \214le suf)-.1 F .147
-(\214x \(e.g. a \214le end-)-.25 F .126(ing in .mb57 has a format id of\
- 57, and a \214le ending in .mb-1 has a format id of \2551\). A datalis\
-t has)144 686.4 R 2.5(af)144 698.4 S(ormat id of \2551.)-2.5 E F1<ad48>
-108 715.2 Q F0 .162(This "help" \215ag cause the program to print out a\
- description of its operation and then e)22.52 F .161(xit immedi-)-.15 F
-(ately)144 727.2 Q(.)-.65 E(MB-System 5.0)72 768 Q 2.5(3J)146.495 G
-(une 2013)-2.5 E(2)204.835 E 0 Cg EP
-%%Page: 3 3
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 146.5(mbdatalist\(1\) MB-System)72 48 R 146.5
-(5.0 mbdatalist\(1\))2.5 F/F1 10/Times-Bold at 0 SF<ad49>108 84 Q/F2 10
-/Times-Italic at 0 SF(\214lename)26.41 E F0 .59
-(Sets the input \214lename. If)144 96 R F2(format)3.09 E F0 3.09(>0\()
-3.09 G .591(set with the)-3.09 F F1<ad66>3.091 E F0 .591
-(option\) then the sw)3.091 F .591(ath data \214lename speci-)-.1 F .719
-(\214ed by)144 108 R F2(in\214le)3.219 E F0 .719
-(is output along with its format and a \214le weight of 1.0.)3.219 F(If)
-5.718 E F2(format)3.218 E F0 3.218(<0)3.218 G 3.218(,t)-3.218 G(hen)
--3.218 E F2(in\214le)3.218 E F0(is)3.218 E 1.113
-(treated as a datalist \214le containing a list of the input sw)144 120
-R 1.114(ath sonar data \214les to be processed and)-.1 F .061
-(their formats.)144 132 R .061
-(The program will parse the datalist \(recursi)5.061 F -.15(ve)-.25 G
-(ly).15 E 2.561(,i)-.65 G 2.561(fn)-2.561 G .06
-(ecessary\) and output each sw)-2.561 F(ath)-.1 E
-(\214lename and the associated format and \214le weight.)144 144 Q F1
-<ad4e>108 160.8 Q F0 .788(This ar)23.08 F .788(gument causes)-.18 F F1
-(MBdatalist)3.288 E F0 .789
-(to generate three types of ancillary data \214les \("inf", "fbt", and)
-3.288 F("fn)144 172.8 Q 4.002(v"\). In)-.4 F 1.502(all cases, the ancil\
-lary \214lenames are just the original \214lename with ".inf", ".fbt", \
-or)4.002 F(".fn)144 184.8 Q 2.56(v" appended on the end.)-.4 F F1
-(MB-System)7.56 E F0(mak)5.061 E 2.561
-(es use of ancillary data \214les in a number of)-.1 F .083(instances. \
-The most prominent ancillary \214les are metadata or "inf" \214les \(cr\
-eated from the output of)144 196.8 R F1(mbinf)144 208.8 Q(o)-.25 E F0
-3.841(\). Programs)B 1.342(such as)3.841 F F1(mbgrid)3.842 E F0(and)
-3.842 E F1(mbm_plot)3.842 E F0 1.342
-(try to check "inf" \214les to see if the corre-)3.842 F .849(sponding \
-data \214les include data within desired areas. Additional ancillary \
-\214les are used to speed)144 220.8 R .742
-(plotting and gridding functions. The "f)144 232.8 R .743
-(ast bath" or "fbt" \214les are generated by cop)-.1 F .743(ying the sw)
--.1 F(ath)-.1 E(bath)144 244.8 Q 1.629
-(ymetry to a sparse, quickly read format \(format 71\). The "f)-.05 F
-1.629(ast na)-.1 F 1.629(v" or "fn)-.2 F 1.628(v" \214les are just)-.4 F
-1.197(ASCII lists of na)144 256.8 R(vig)-.2 E 1.197
-(ation generated using)-.05 F F1(mblist)3.698 E F0 1.198(with a)3.698 F
-F1<ad4f>3.698 E F2(tMXYHSc)A F0 1.198(option. Programs such as)3.698 F
-F1(mbgrid)144 268.8 Q F0(,)A F1(mbswath)3.514 E F0 3.514(,a)C(nd)-3.514
-E F1(mbcontour)3.514 E F0 1.014(will try to read "fbt" and "fn)3.514 F
-1.013(v" \214les instead of the full data)-.4 F(\214les whene)144 280.8
-Q -.15(ve)-.25 G 2.5(ro).15 G(nly bath)-2.5 E(ymetry or na)-.05 E(vig)
--.2 E(ation information are required.)-.05 E F1<ad4f>108 297.6 Q F0 .274
-(This ar)22.52 F .274(gument causes)-.18 F F1(MBdatalist)2.774 E F0 .274
-(to generate the three ancillary data \214les \("inf", "fbt", and "fn)
-2.774 F(v"\))-.4 E(if these \214les don')144 309.6 Q 2.5(ta)-.18 G
-(lready e)-2.5 E(xist or are out of date.)-.15 E F1<ad50>108 326.4 Q F0
-(Normally)24.19 E(,)-.65 E F1(mbdatalist)2.836 E F0(allo)2.836 E .336
-(ws $PR)-.25 F .336(OCESSED and $RA)-.4 F 2.836(Wt)-.9 G .336
-(ags within the datalist \214les to determine)-2.836 F .267
-(whether processed \214le names are reported when a)144 338.4 R -.25(va)
--.2 G .267(ilable \($PR).25 F .267(OCESSED\) or only ra)-.4 F 2.767
-<778c>-.15 G .267(le names)-2.767 F .439(are reported \($RA)144 350.4 R
-.439(W\). The)-.9 F F1<ad50>2.939 E F0 .439(option forces)2.939 F F1
-(mbdatalist)2.939 E F0 .438(to output processed \214le names when the)
-2.939 F(y)-.15 E -.15(ex)144 362.4 S(ist.).15 E F1<ad51>108 379.2 Q F0
-.11(This option causes the program to check each data \214le for the e)
-22.52 F .111(xistence of an)-.15 F 2.611(ya)-.15 G .111
-(ncillary \214les refer)-2.611 F(-)-.2 E 1.652
-(enced in its mbprocess parameter \214le \(if the parameter \214le e)144
-391.2 R 1.651(xists\). The rele)-.15 F -.25(va)-.25 G 1.651
-(nt ancillary \214les).25 F .495(include edit sa)144 403.2 R .795 -.15
-(ve \214)-.2 H .495(les generated by).15 F F1(mbedit)2.995 E F0(or)2.995
-E F1(mbclean)2.995 E F0 2.996(,n)C -.2(av)-2.996 G(ig).2 E .496
-(ation \214les generated by)-.05 F F1(mbna)2.996 E -.1(ve)-.25 G(dit).1
-E F0(or)144 415.2 Q F1(mbna)3.592 E -.1(va)-.25 G(djust).1 E F0 3.592
-(,t)C 1.092(ide \214les, and svp \214les. An error message is output fo\
-r each missing ancillary)-3.592 F(\214le.)144 427.2 Q F1<ad52>108 444 Q
-F2(w/e/s/n)23.08 E F0 .033(The bounds of the desired area are set in lo\
-ngitude and latitude using w=west, e=east, s=south, and)144 456 R 2.733
-(n=north. This)144 468 R .232(option causes the program to check each d\
-ata \214le with an "inf" \214le for o)2.733 F -.15(ve)-.15 G .232
-(rlap with).15 F 1.287(the desired bounds, and only report those \214le\
-s with data in the desired area \(or no "inf" \214le to)144 480 R .23
-(check\). This beha)144 492 R .23(vior mimics that of)-.2 F F1(mbgrid)
-2.729 E F0 2.729(,a)C(llo)-2.729 E .229
-(wing users to check what data \214les will contrib-)-.25 F
-(ute to gridding some particular area.)144 504 Q F1<ad53>108 520.8 Q F0
-.516(This option causes)24.74 F F1(mbdatalist)3.016 E F0 .517(to report\
- the status of the \214les it lists, including whether the \214le is)
-3.016 F .778
-(up to date or needs reprocessing, and if the \214le is lock)144 532.8 R
-(ed.)-.1 E F1(MBpr)3.278 E(ocess)-.18 E F0 .778
-(sets locks while operating)3.278 F 1.392(on a sw)144 544.8 R 1.393
-(ath \214le to pre)-.1 F -.15(ve)-.25 G 1.393(nt other instances of).15
-F F1(mbpr)3.893 E(ocess)-.18 E F0 1.393
-(from simultaneously operating on that)3.893 F 1.029
-(same \214le. Locking consists of creating a small te)144 556.8 R 1.029
-(xt \214le named by appending ".lck" to the sw)-.15 F(ath)-.1 E .01
-(\214lename; while this \214le e)144 568.8 R .011
-(xists other programs will not modify the lock)-.15 F .011
-(ed \214le. The locking program)-.1 F .887(deletes the lock \214le when\
- it is done. Orphaned lock \214les may be left if)144 580.8 R F1(mbpr)
-3.386 E(ocess)-.18 E F0 .886(crashes or is)3.386 F .273
-(interrupted. These will pre)144 592.8 R -.15(ve)-.25 G .273
-(nt reprocessing by).15 F F1(mbpr)2.773 E(ocess)-.18 E F0 2.773(,b)C
-.273(ut can be both detected and remo)-2.973 F -.15(ve)-.15 G(d).15 E
-(using)144 604.8 Q F1(mbdatalist)2.5 E F0(.)A F1<ad55>108 621.6 Q F0
-(Normally)23.08 E(,)-.65 E F1(mbdatalist)2.836 E F0(allo)2.836 E .336
-(ws $PR)-.25 F .336(OCESSED and $RA)-.4 F 2.836(Wt)-.9 G .336
-(ags within the datalist \214les to determine)-2.836 F .915
-(whether processed \214le names are reported when a)144 633.6 R -.25(va)
--.2 G .915(ilable \($PR).25 F .915(OCESSED\) or only \(ra)-.4 F .915
-(w\) unpro-)-.15 F .613(cessed \214le names are reported \($RA)144 645.6
-R .613(W\). The)-.9 F F1<ad55>3.113 E F0 .613(option forces)3.113 F F1
-(mbdatalist)3.113 E F0 .612(to only output ra)3.112 F 3.112<778c>-.15 G
-(le)-3.112 E(names.)144 657.6 Q F1<ad56>108 674.4 Q F0(Normally)23.08 E
-(,)-.65 E F1(mbdatalist)4.091 E F0 1.591
-(only prints out the \214lenames and formats.)4.091 F 1.591(If the)6.591
-F F1<ad56>4.092 E F0 1.592(\215ag is gi)4.092 F -.15(ve)-.25 G 1.592
-(n, then).15 F F1(mbinf)144 686.4 Q(o)-.25 E F0 -.1(wo)2.5 G
-(rks in a "v).1 E(erbose" mode and outputs the program v)-.15 E
-(ersion being used.)-.15 E F1<ad59>108 703.2 Q F0 .615
-(This option causes)23.08 F F1(mbdatalist)3.115 E F0 .615(to remo)3.115
-F .915 -.15(ve a)-.15 H .915 -.15(ny p).15 H .615
-(rocessing locks on \214les it parses.).15 F F1(MBpr)3.115 E(ocess)-.18
-E F0(and)3.115 E 1.678
-(other programs may set locks while operating on a sw)144 715.2 R 1.678
-(ath \214le to pre)-.1 F -.15(ve)-.25 G 1.678(nt other programs from).15
-F 1.692(simultaneously operating on that same \214le.The consists of cr\
-eating a small te)144 727.2 R 1.691(xt \214le named by)-.15 F
-(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(3)204.835 E 0
-Cg EP
-%%Page: 4 4
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 146.5(mbdatalist\(1\) MB-System)72 48 R 146.5
-(5.0 mbdatalist\(1\))2.5 F .91(appending ".lck" to the sw)144 84 R .911
-(ath \214lename; while this \214le e)-.1 F .911
-(xists other programs will not modify the)-.15 F(lock)144 96 Q .378(ed \
-\214le. The locking program deletes the lock \214le when it is done. Or\
-phaned lock \214les may be)-.1 F .076(left if)144 108 R/F1 10
-/Times-Bold at 0 SF(MB-System)2.576 E F0 .076
-(programs crash or are interrupted. These can be detected using the)
-2.576 F F1<ad53>2.577 E F0 .077(option of)2.577 F F1(mbdatalist)144 120
-Q F0(.)A F1<ad5a>108 136.8 Q F0(The)23.63 E F1<ad5a>2.625 E F0 .124(opt\
-ion causes the program to generate a datalist \214le that will \214rst \
-set a $PR)2.625 F .124(OCESSED \215ag)-.4 F 1.889
-(and then reference the input \214le speci\214ed using the)144 148.8 R
-F1<ad49>4.389 E/F2 10/Times-Italic at 0 SF(\214lename)A F0 4.39
-(option. The)4.389 F 1.89(output datalist is)4.39 F .611
-(named by adding a "p.mb-1" suf)144 160.8 R .611(\214x to the root of t\
-he input \214le \(the root is the portion before an)-.25 F(y)-.15 E F1
-(MB-System)144 172.8 Q F0(suf)2.5 E(\214x\).)-.25 E .086(By def)144
-184.8 R .087(ault, the input is assumed to be a datalist named datalist\
-.mb-1, resulting in an output datalist)-.1 F
-(named datalistp.mb-1 with the follo)144 196.8 Q(wing contents:)-.25 E
-($PR)180 208.8 Q(OCESSED)-.4 E(datalist.mb-1 \2551)180 220.8 Q 1.686
-(If the input \214le is speci\214ed as a datalist lik)144 232.8 R 4.185
-(ed)-.1 G 1.685(atalist_sslo.mb-1, then the output datalist datal-)
--4.185 F(ist_sslop.mb-1 will ha)144 244.8 Q .3 -.15(ve t)-.2 H(he follo)
-.15 E(wing contents:)-.25 E($PR)180 256.8 Q(OCESSED)-.4 E
-(datalist_sslo.mb-1 \2551)180 268.8 Q 1.247
-(If the input \214le is speci\214ed as a sw)144 280.8 R 1.247
-(ath \214le lik)-.1 F 3.748(e2)-.1 G 1.248
-(0050916122920.mb57, then the output datalist)-3.748 F
-(20050916122920p.mb-1 will ha)144 292.8 Q .3 -.15(ve t)-.2 H(he follo)
-.15 E(wing contents:)-.25 E($PR)180 304.8 Q(OCESSED)-.4 E
-(20050916122920.mb57 57)180 316.8 Q/F3 10.95/Times-Bold at 0 SF(EXAMPLES)72
-345.6 Q F0 .691(Suppose we ha)108 357.6 R .991 -.15(ve t)-.2 H .891 -.1
-(wo s).15 H -.1(wa).1 G .691
-(th data \214les from an EM3000 multibeam and another tw).1 F 3.19(of)
--.1 G .69(rom an Hydrosweep)-3.19 F 4.357(MD multibeam. W)108 369.6 R
-6.857(em)-.8 G 4.357(ight construct tw)-6.857 F 6.857(od)-.1 G 4.357
-(atalist \214les. F)-6.857 F 4.358(or the EM3000 we might ha)-.15 F
-4.658 -.15(ve a \214)-.2 H(le).15 E(dlst_em3000.mb-1 containing:)108
-381.6 Q(0004_20010705_165004_ra)144 393.6 Q -.65(w.)-.15 G(mb57 57).65 E
-(0005_20010705_172010_ra)144 405.6 Q -.65(w.)-.15 G(mb57 57).65 E -.15
-(Fo)108 417.6 S 2.5(rt).15 G(he Hydrosweep MD data we might ha)-2.5 E .3
--.15(ve a \214)-.2 H(le dlst_hsmd.mb-1 containing:).15 E
-(al10107051649.mb102 102)144 429.6 Q(al10107051719.mb102 102)144 441.6 Q
-11.593(Further suppose that we ha)108 465.6 R 11.893 -.15(ve f)-.2 H
-11.592(ound it necessary to edit the bath).15 F 11.592(ymetry in)-.05 F
-(0005_20010705_172010_ra)108 477.6 Q -.65(w.)-.15 G 2.285
-(mb57 and al10107051719.mb102 using).65 F F1(mbedit)4.785 E F0 4.785(,a)
-C 2.285(nd that)-4.785 F F1(mbpr)4.785 E(ocess)-.18 E F0(has)4.785 E
-3.786(been run on both \214les to generate processed \214les called 000\
-5_20010705_172010_ra)108 489.6 R 3.786(wp.mb57 and)-.15 F
-(al10107051719p.mb102.)108 501.6 Q(If we run:)108 525.6 Q
-(mbdatalist \255I dlst_em3000.mb-1)144 537.6 Q(the output is:)108 549.6
-Q(0004_20010705_165004_ra)144 561.6 Q -.65(w.)-.15 G(mb57 57 1.000000)
-.65 E(0005_20010705_172010_ra)144 573.6 Q -.65(w.)-.15 G
-(mb57 57 1.000000).65 E .55(Here the \214le name is follo)108 585.6 R
-.551(wed by the format and then by a third column containing the def)
--.25 F .551(ault \214le weight)-.1 F(of 1.0.)108 597.6 Q(Similarly)108
-621.6 Q 2.5(,i)-.65 G 2.5(fw)-2.5 G 2.5(er)-2.5 G(un:)-2.5 E
-(mbdatalist \255I dlst_hsmd.mb-1)144 633.6 Q(the output is:)108 645.6 Q
-(al10107051649.mb102 102 1.000000)144 657.6 Q
-(al10107051719.mb102 102 1.000000)144 669.6 Q(If we insert a line)108
-693.6 Q($PR)144 705.6 Q(OCESSED)-.4 E(at the top of both dlst_hsmd.mb-1\
- and dlst_em3000.mb-1, then the output of)108 717.6 Q F1(mbdatalist)2.5
-E F0(changes so that:)2.5 E(mbdatalist \255I dlst_em3000.mb-1)144 729.6
-Q(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(4)204.835 E 0
-Cg EP
-%%Page: 5 5
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 146.5(mbdatalist\(1\) MB-System)72 48 R 146.5
-(5.0 mbdatalist\(1\))2.5 F(yields:)108 84 Q(0004_20010705_165004_ra)144
-96 Q -.65(w.)-.15 G(mb57 57 1.000000).65 E(0005_20010705_172010_ra)144
-108 Q(wp.mb57 57 1.000000 and:)-.15 E(mbdatalist \255I dlst_hsmd.mb-1)
-144 120 Q(yields:)108 132 Q(al10107051649.mb102 102 1.000000)144 144 Q
-(al10107051719p.mb102 102 1.000000)144 156 Q(No)108 180 Q 2.512(ws)-.25
-G .011(uppose we create a datalist \214le called dlst_all.mb-1 that ref\
-ers to the tw)-2.512 F 2.511(od)-.1 G .011(atalists sho)-2.511 F .011
-(wn abo)-.25 F .311 -.15(ve \()-.15 H(with-).15 E(out the $PR)108 192 Q
-(OCESSED tags\). If the contents of dlst_all.mb-1 are:)-.4 E
-(dlst_em3000.mb-1 \2551 100.0)144 204 Q 5(dlst_hsmd.mb-1 \2551 1.0)144
-216 R(where we ha)108 228 Q .3 -.15(ve s)-.2 H(peci\214ed dif).15 E
-(ferent \214le weights for the tw)-.25 E 2.5(od)-.1 G(atalists, then:)
--2.5 E(mbdatalist \255I dlst_all.mb-1)144 240 Q(yields:)108 252 Q
-(0004_20010705_165004_ra)144 264 Q -.65(w.)-.15 G(mb57 57 100.000000).65
-E(0005_20010705_172010_ra)144 276 Q -.65(w.)-.15 G(mb57 57 100.000000)
-.65 E(al10107051649.mb102 102 1.000000)144 288 Q
-(al10107051719.mb102 102 1.000000)144 300 Q(No)108 324 Q 1.3 -.65(w, i)
--.25 H 2.5(fw).65 G 2.5(eu)-2.5 G(se the)-2.5 E/F1 10/Times-Bold at 0 SF
-<ad50>2.5 E F0(option to force)2.5 E F1(mbdatalist)2.5 E F0
-(to output processed data \214le names when possible, then:)2.5 E
-(mbdatalist \255I dlst_all.mb-1 \255P)144 336 Q(yields:)108 348 Q
-(0004_20010705_165004_ra)144 360 Q -.65(w.)-.15 G(mb57 57 100.000000).65
-E(0005_20010705_172010_ra)144 372 Q(wp.mb57 57 100.000000)-.15 E
-(al10107051649.mb102 102 1.000000)144 384 Q
-(al10107051719p.mb102 102 1.000000)144 396 Q/F2 10.95/Times-Bold at 0 SF
-(SEE ALSO)72 424.8 Q F1(mbsystem)108 436.8 Q F0(\(1\))A F2 -.11(BU)72
-465.6 S(GS).11 E F0 .509(No true b)108 477.6 R .509
-(ugs here, only distantly related arthropods... Y)-.2 F 3.009
-(um. Seriously)-1.11 F 3.009(,i)-.65 G 3.01(tw)-3.009 G .51
-(ould be better if the cop)-3.11 F 3.01(yf)-.1 G(unc-)-3.01 E 1.012
-(tion preserv)108 489.6 R 1.012
-(ed the modi\214cation times of the copied sw)-.15 F 1.011
-(ath \214les and ancilliary \214les. Cop)-.1 F 1.011(ying of processed)
--.1 F(\214les should also be an option.)108 501.6 Q(MB-System 5.0)72 768
-Q 2.5(3J)146.495 G(une 2013)-2.5 E(5)204.835 E 0 Cg EP
-%%Trailer
-end
-%%EOF
diff --git a/src/ps/mbdefaults.ps b/src/ps/mbdefaults.ps
deleted file mode 100644
index d2ffb4b..0000000
--- a/src/ps/mbdefaults.ps
+++ /dev/null
@@ -1,483 +0,0 @@
-%!PS-Adobe-3.0
-%%Creator: groff version 1.19.2
-%%CreationDate: Wed Jul  1 12:29:27 2015
-%%DocumentNeededResources: font Times-Roman
-%%+ font Times-Bold
-%%+ font Times-Italic
-%%DocumentSuppliedResources: procset grops 1.19 2
-%%Pages: 3
-%%PageOrder: Ascend
-%%DocumentMedia: Default 612 792 0 () ()
-%%Orientation: Portrait
-%%EndComments
-%%BeginDefaults
-%%PageMedia: Default
-%%EndDefaults
-%%BeginProlog
-%%BeginResource: procset grops 1.19 2
-%!PS-Adobe-3.0 Resource-ProcSet
-/setpacking where{
-pop
-currentpacking
-true setpacking
-}if
-/grops 120 dict dup begin
-/SC 32 def
-/A/show load def
-/B{0 SC 3 -1 roll widthshow}bind def
-/C{0 exch ashow}bind def
-/D{0 exch 0 SC 5 2 roll awidthshow}bind def
-/E{0 rmoveto show}bind def
-/F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def
-/G{0 rmoveto 0 exch ashow}bind def
-/H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/I{0 exch rmoveto show}bind def
-/J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def
-/K{0 exch rmoveto 0 exch ashow}bind def
-/L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/M{rmoveto show}bind def
-/N{rmoveto 0 SC 3 -1 roll widthshow}bind def
-/O{rmoveto 0 exch ashow}bind def
-/P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/Q{moveto show}bind def
-/R{moveto 0 SC 3 -1 roll widthshow}bind def
-/S{moveto 0 exch ashow}bind def
-/T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/SF{
-findfont exch
-[exch dup 0 exch 0 exch neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/MF{
-findfont
-[5 2 roll
-0 3 1 roll
-neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/level0 0 def
-/RES 0 def
-/PL 0 def
-/LS 0 def
-/MANUAL{
-statusdict begin/manualfeed true store end
-}bind def
-/PLG{
-gsave newpath clippath pathbbox grestore
-exch pop add exch pop
-}bind def
-/BP{
-/level0 save def
-1 setlinecap
-1 setlinejoin
-72 RES div dup scale
-LS{
-90 rotate
-}{
-0 PL translate
-}ifelse
-1 -1 scale
-}bind def
-/EP{
-level0 restore
-showpage
-}def
-/DA{
-newpath arcn stroke
-}bind def
-/SN{
-transform
-.25 sub exch .25 sub exch
-round .25 add exch round .25 add exch
-itransform
-}bind def
-/DL{
-SN
-moveto
-SN
-lineto stroke
-}bind def
-/DC{
-newpath 0 360 arc closepath
-}bind def
-/TM matrix def
-/DE{
-TM currentmatrix pop
-translate scale newpath 0 0 .5 0 360 arc closepath
-TM setmatrix
-}bind def
-/RC/rcurveto load def
-/RL/rlineto load def
-/ST/stroke load def
-/MT/moveto load def
-/CL/closepath load def
-/Fr{
-setrgbcolor fill
-}bind def
-/setcmykcolor where{
-pop
-/Fk{
-setcmykcolor fill
-}bind def
-}if
-/Fg{
-setgray fill
-}bind def
-/FL/fill load def
-/LW/setlinewidth load def
-/Cr/setrgbcolor load def
-/setcmykcolor where{
-pop
-/Ck/setcmykcolor load def
-}if
-/Cg/setgray load def
-/RE{
-findfont
-dup maxlength 1 index/FontName known not{1 add}if dict begin
-{
-1 index/FID ne{def}{pop pop}ifelse
-}forall
-/Encoding exch def
-dup/FontName exch def
-currentdict end definefont pop
-}bind def
-/DEFS 0 def
-/EBEGIN{
-moveto
-DEFS begin
-}bind def
-/EEND/end load def
-/CNT 0 def
-/level1 0 def
-/PBEGIN{
-/level1 save def
-translate
-div 3 1 roll div exch scale
-neg exch neg exch translate
-0 setgray
-0 setlinecap
-1 setlinewidth
-0 setlinejoin
-10 setmiterlimit
-[]0 setdash
-/setstrokeadjust where{
-pop
-false setstrokeadjust
-}if
-/setoverprint where{
-pop
-false setoverprint
-}if
-newpath
-/CNT countdictstack def
-userdict begin
-/showpage{}def
-/setpagedevice{}def
-}bind def
-/PEND{
-countdictstack CNT sub{end}repeat
-level1 restore
-}bind def
-end def
-/setpacking where{
-pop
-setpacking
-}if
-%%EndResource
-%%EndProlog
-%%BeginSetup
-%%BeginFeature: *PageSize Default
-<< /PageSize [ 612 792 ] /ImagingBBox null >> setpagedevice
-%%EndFeature
-%%IncludeResource: font Times-Roman
-%%IncludeResource: font Times-Bold
-%%IncludeResource: font Times-Italic
-grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72
-def/PL 792 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron/Zcaron
-/scaron/zcaron/Ydieresis/trademark/quotesingle/Euro/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/space/exclam/quotedbl/numbersign/dollar/percent
-/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen
-/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon
-/semicolon/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O
-/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright/circumflex
-/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y
-/z/braceleft/bar/braceright/tilde/.notdef/quotesinglbase/guillemotleft
-/guillemotright/bullet/florin/fraction/perthousand/dagger/daggerdbl
-/endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut
-/dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash
-/quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen
-/brokenbar/section/dieresis/copyright/ordfeminine/guilsinglleft
-/logicalnot/minus/registered/macron/degree/plusminus/twosuperior
-/threesuperior/acute/mu/paragraph/periodcentered/cedilla/onesuperior
-/ordmasculine/guilsinglright/onequarter/onehalf/threequarters
-/questiondown/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE
-/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex
-/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis
-/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn
-/germandbls/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla
-/egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis
-/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide/oslash
-/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis]def
-/Times-Italic at 0 ENC0/Times-Italic RE/Times-Bold at 0 ENC0/Times-Bold RE
-/Times-Roman at 0 ENC0/Times-Roman RE
-%%EndSetup
-%%Page: 1 1
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mbdef)72 48 Q 143.83(aults\(1\) MB-System)-.1 F
-143.83(5.0 mbdef)2.5 F(aults\(1\))-.1 E/F1 10.95/Times-Bold at 0 SF -.219
-(NA)72 84 S(ME).219 E/F2 10/Times-Bold at 0 SF(mbdefaults)108 96 Q F0 2.5
-<ad53>2.5 G(et or list def)-2.5 E
-(ault mbio parameters for reading and writing sw)-.1 E(ath sonar data)
--.1 E F1(VERSION)72 124.8 Q F0 -1.11(Ve)108 136.8 S(rsion 5.0)1.11 E F1
-(SYNOPSIS)72 165.6 Q F2(mbdefaults)108 177.6 Q F0([)7.225 E F2<ad42>A/F3
-10/Times-Italic at 0 SF(\214leiob)A(uf)-.2 E(fer)-.18 E F2<ad44>7.225 E F3
-(psdisplay)A F2<ad46>7.225 E F3(fbtver)A(sion)-.1 E F2<ad49>9.725 E F3
-(ima)A -.1(ge)-.1 G(display).1 E F2<ad4c>7.225 E F3(lon\215ip)A F2<ad4d>
-7.225 E F3(mbvie)A(wsettings)-.15 E F2<ad54>108 189.6 Q F3(time)A(gap)
--.4 E F2<ad55>2.5 E F3(useloc)A(k\214les)-.2 E F2<ad57>2.5 E F3(pr)A
-(oject)-.45 E F2<ad5620ad48>2.5 E F0(])A F1(DESCRIPTION)72 218.4 Q F2
-(mbdefaults)108 230.4 Q F0 .5
-(is a utility for setting or listing the def)3 F .501
-(ault read parameters used by some)-.1 F F2(MBIO)3.001 E F0 .501
-(utilities such)3.001 F(as)108 242.4 Q F2(MBcopy)2.759 E F0(or)2.759 E
-F2(MBgrdviz)2.759 E F0 5.259(.I)C 2.759(fau)-5.259 G .258
-(ser wishes to set def)-2.759 F .258(ault parameters dif)-.1 F .258
-(ferent from those set by the)-.25 F F2(MBIO)2.758 E F0(library)108
-254.4 Q 3.738(,t)-.65 G 1.238(hen these specialized def)-3.738 F 1.239
-(ault v)-.1 F 1.239(alues must be stored in the \214le .mbio_def)-.25 F
-1.239(aults in the users home)-.1 F(directory)108 266.4 Q 5.132(.I)-.65
-G 2.632(fa)-5.132 G .432 -.15(ny o)-2.632 H .131(ption \215ag is gi).15
-F -.15(ve)-.25 G 2.631(ni).15 G 2.631(ni)-2.631 G -1.9 -.4(nv o)-2.631 H
-(king).4 E F2(mbdefaults)2.631 E F0 2.631(,t)C .131(hen a ne)-2.631 F
-2.631(w.)-.25 G(mbio_def)-2.631 E .131(aults \214le will be written)-.1
-F 1.445(incorporating the ne)108 278.4 R 1.445
-(wly set parameters along with an)-.25 F 3.945(yo)-.15 G 1.445
-(ld parameters which ha)-3.945 F 1.745 -.15(ve n)-.2 H 1.445
-(ot been reset. If no).15 F .577(option \215ag is gi)108 290.4 R -.15
-(ve)-.25 G .577(n, then).15 F F2(mbdefaults)3.077 E F0 .577
-(will list the current def)3.077 F .577(ault v)-.1 F .577
-(alues \(set by)-.25 F F2(mbio)3.077 E F0 .577(if no .mbio_def)3.077 F
-(aults)-.1 E(\214le e)108 302.4 Q(xists\).)-.15 E F1(CHANGES FR)72 331.2
-Q(OM VERSION 4.6)-.329 E F0 .265(Note that prior to v)108 343.2 R .266
-(ersion 5.0, the)-.15 F F2(MB-System)2.766 E F0(def)2.766 E .266
-(aults set by)-.1 F F2(mbdefaults)2.766 E F0 .266
-(included the format id, a control)2.766 F .28(for ping a)108 355.2 R
--.15(ve)-.2 G .28(raging, longitude and latitude bounds for windo).15 F
-.28(wing by area, and be)-.25 F .28(gin and end times for win-)-.15 F
-(do)108 367.2 Q(wing in time. These v)-.25 E
-(alues are no longer set in the .mbio_def)-.25 E
-(aults \214le or controlled by)-.1 E F2(mbdefaults)2.5 E F0(.)A F1 -.548
-(AU)72 396 S(THORSHIP).548 E F0(Da)108 408 Q(vid W)-.2 E 2.5(.C)-.92 G
-(aress \(caress at mbari.or)-2.5 E(g\))-.18 E(Montere)113 420 Q 2.5(yB)-.15
-G(ay Aquarium Research Institute)-2.5 E
-(Dale N. Chayes \(dale at ldeo.columbia.edu\))108 432 Q
-(Lamont-Doherty Earth Observ)113 444 Q(atory)-.25 E F1(OPTIONS)72 472.8
-Q F2<ad42>108 484.8 Q F3(\214leiob)23.63 E(uf)-.2 E(fer)-.18 E F0 .049
-(Sets the \214le i/o block b)144 496.8 R(uf)-.2 E .049
-(fer size for certain formats \(currently formats 88 and 58\).)-.25 F
-(The)5.05 E F3(\214leiob)2.55 E(uf)-.2 E(fer)-.18 E F0 -.25(va)144 508.8
-S 1.297(lue is in kilobytes, so).25 F F3(\214leiob)3.797 E(uf)-.2 E(fer)
--.18 E F0 3.797(=1)3.797 G 1.297(000 corresponds rougly to a one me)
--3.797 F -.05(ga)-.15 G 1.296(byte b).05 F(uf)-.2 E(fer)-.25 E 6.296(.T)
--.55 G(his)-6.296 E .397(option allo)144 520.8 R .397
-(ws users to optimize i/o speed of certain lar)-.25 F .398
-(ge and comple)-.18 F 2.898(xd)-.15 G .398(ata formats \(e.g Reson 7k)
--2.898 F .351(and current generation K)144 532.8 R(ongsber)-.35 E 2.851
-(gm)-.18 G .351(ultibeam\) by increasing the block b)-2.851 F(uf)-.2 E
-.35(fer size from the system)-.25 F(def)144 544.8 Q .222
-(ault. Making the b)-.1 F(uf)-.2 E .222(fer size lar)-.25 F .222
-(ger generally has bene\214t only when reading o)-.18 F -.15(ve)-.15 G
-2.722(ran).15 G(etw)-2.722 E .222(ork; this)-.1 F 1.44(option has littl\
-e impact for \214lesystems mounted from locally attached hard dri)144
-556.8 R -.15(ve)-.25 G 1.44(s. At MB).15 F(ARI,)-.35 E .825
-(where our primary data storage is accessed o)144 568.8 R -.15(ve)-.15 G
-3.325(rag).15 G(ig)-3.325 E .825(abit ethernet netw)-.05 F .825
-(ork, setting)-.1 F F3(\214leiob)3.325 E(uf)-.2 E(fer)-.18 E F0(=)3.325
-E .94(10000 achie)144 580.8 R -.15(ve)-.25 G 3.44(sa).15 G 3.44(n8)-3.44
-G 3.44(%r)-3.44 G .94(un time reduction for)-3.44 F F2(mbpr)3.44 E
-(ocess)-.18 E F0 3.44(.D)C(ef)-3.44 E(ault:)-.1 E F3(\214leiob)3.44 E
-(uf)-.2 E(fer)-.18 E F0 3.44(=0)3.44 G 3.44(,w)-3.44 G .94(hich corre-)
--3.44 F(sponds to the system def)144 592.8 Q(ault.)-.1 E F2<ad44>108
-609.6 Q F3(psdisplay)23.08 E F0 .696(Sets the program used for displayi\
-ng Postscript graphics \214les on a screen; this f)144 621.6 R .696
-(acility is used by)-.1 F 1.352(shellscripts created through macros lik)
-144 633.6 R(e)-.1 E F2(mbm_plot)3.852 E F0 3.852(.T)C 1.352(he def)
--3.852 F 1.351(ault Postscript display utility is)-.1 F F2(gv)3.851 E F0
-(.)A 3.292(Another common Postscript display utilities is)144 645.6 R F2
-(ghostview)5.792 E F0 5.792(;p)C 3.292(ast postscript vie)-5.792 F 3.292
-(wers included)-.25 F F2(page)144 657.6 Q(view)-.15 E F0(\(for Sun w)2.5
-E(orkstations\) and)-.1 E F2(xpsview)2.5 E F0(\(for Silicon Graphics w)
-2.5 E(orkstations\).)-.1 E F2<ad46>108 674.4 Q F3(fbtver)24.19 E(sion)
--.1 E F0 1.556(Set the v)144 686.4 R 1.556
-(ersion of fbt \214les created by)-.15 F F2(mbdatalist)4.056 E F0(and)
-4.056 E F2(mbpr)4.056 E(ocess)-.18 E F0 6.555(.I)C(f)-6.555 E F3(fbtver)
-4.055 E(sion)-.1 E F0 4.055(=2)4.055 G 4.055(,")-4.055 G 1.555(old", or)
--4.055 F .61("OLD", then the pre-5.3.1897 v)144 698.4 R .61
-(ersion of format 71 will be used to write the "f)-.15 F .61(ast bath)
--.1 F .61(ymetry" or)-.05 F .133("*.fbt" \214les.)144 710.4 R(If)5.133 E
-F3(fbtver)2.633 E(sion)-.1 E F0 2.633(=3)2.633 G 2.633(,")-2.633 G(ne)
--2.633 E .133(w", or "NEW", then the ne)-.25 F 1.432 -.65(w, 5)-.25 H
-(.3.1897-or).65 E .132(-later v)-.2 F .132(ersion of format)-.15 F
-(71 will be used to write the "f)144 722.4 Q(ast bath)-.1 E
-(ymetry" or "*.fbt" \214les.)-.05 E(MB-System 5.0)72 768 Q 2.5(5S)
-134.275 G(eptember 2014)-2.5 E(1)192.615 E 0 Cg EP
-%%Page: 2 2
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mbdef)72 48 Q 143.83(aults\(1\) MB-System)-.1 F
-143.83(5.0 mbdef)2.5 F(aults\(1\))-.1 E/F1 10/Times-Bold at 0 SF<ad48>108
-84 Q F0 .162(This "help" \215ag cause the program to print out a descri\
-ption of its operation and then e)22.52 F .162(xit immedi-)-.15 F(ately)
-144 96 Q(.)-.65 E F1<ad49>108 112.8 Q/F2 10/Times-Italic at 0 SF(ima)26.41
-E -.1(ge)-.1 G(display).1 E F0 2.817
-(Sets the program used for displaying T)144 124.8 R(if)-.35 E 5.317(fi)
--.25 G 2.817(mage \214les on a screen; this f)-5.317 F 2.816
-(acility is used by)-.1 F 1.677(shellscripts created through macros lik)
-144 136.8 R(e)-.1 E F1(mbm_grdtiff)4.177 E F0 4.177(.T)C 1.678(he def)
--4.177 F 1.678(ault image display utility is)-.1 F F1(xv)4.178 E F0(.)A
-(Other common image display utilities are)144 148.8 Q F1(gimp)2.5 E F0
-(\(GNU image processing\) and)2.5 E F1(gqview)2.5 E F0(.)A F1<ad4c>108
-165.6 Q F2(lon\215ip)23.63 E F0 .572(Sets the range of the longitude v)
-144 177.6 R .572(alues returned.)-.25 F(If)5.572 E F2(lon\215ip)3.072 E
-F0 .572(=\2551 then the longitude v)B .571(alues will be in)-.25 F .488
-(the range from \255360 to 0 de)144 189.6 R .488(grees. If)-.15 F F2
-(lon\215ip)2.988 E F0 .488(=0 then the longitude v)B .489
-(alues will be in the range from)-.25 F 1.383(\255180 to 180 de)144
-201.6 R 1.383(grees. If)-.15 F F2(lon\215ip)3.882 E F0 1.382
-(=1 then the longitude v)B 1.382
-(alues will be in the range from 0 to 360)-.25 F(de)144 213.6 Q 2.5
-(grees. Def)-.15 F(ault:)-.1 E F2(lon\215ip)2.5 E F0 2.5(=0)2.5 G(.)-2.5
-E F1(\255MP)108 230.4 Q F2(colortable/colortable_mode/shade_mode)14.75 E
-F0 .965(Sets the def)144 242.4 R .965
-(ault colortable, colortable mode, and shading mode for the programs)-.1
-F F1(MBgrdviz)3.466 E F0(and)3.466 E F1(MBeditviz)144 254.4 Q F0 2.5(.T)
-C(he)-2.5 E F2(colortable)2.5 E F0
-(identi\214ers are similar to those used for)2.5 E F1(mbm_grdplot)2.5 E
-F0(:)A 2.5(0=H)164 266.4 S(axby colortable)-2.5 E 2.5(1=B)164 278.4 S
-(right colortable)-2.5 E 2.5(2=M)164 290.4 S(uted colortable)-2.5 E 2.5
-(3=G)164 302.4 S(rayscale colortable)-2.5 E 2.5(4=F)164 314.4 S
-(lat Gray colortable)-2.5 E 2.5(5=S)164 326.4 S(eale)-2.5 E -.15(ve)-.25
-G 2.5(l1c).15 G(olortable)-2.5 E 2.5(6=S)164 338.4 S(eale)-2.5 E -.15
-(ve)-.25 G 2.5(l2c).15 G(olortable)-2.5 E(The)144 350.4 Q F2
-(colortable_mode)2.786 E F0 .286(refers to whether lo)2.786 F 2.786(wv)
--.25 G .286(alues are represented by "cool" colors \(e.g. blue\) and)
--3.036 F .352(high v)144 362.4 R .352
-(alues by "hot" colors \(e.g. red\), which corresponds to)-.25 F F2
-(colortable_mode)2.852 E F0 2.852(=0)2.852 G 2.852(,o)-2.852 G 2.852(rt)
--2.852 G .352(he opposite,)-2.852 F(which corresponds to)144 374.4 Q F2
-(colortable_mode)2.5 E F0 2.5(=1)2.5 G(.)-2.5 E(The)144 398.4 Q F2
-(shade_mode)3.683 E F0 -.25(va)3.683 G 1.182
-(lue determines whether shading is of).25 F 3.682(f\()-.25 G F2
-(shade_mode)-3.682 E F0 3.682(=0)3.682 G 1.182(\), done by illumina-)
--3.682 F(tion\()144 410.4 Q F2(shade_mode)A F0 2.743(=1)2.743 G .243
-(\), or done using slope magnitude \()-2.743 F F2(shade_mode)A F0 2.744
-(=2)2.744 G .244(\). Shading by o)-2.744 F -.15(ve)-.15 G .244
-(rlay can-).15 F(not be a def)144 422.4 Q(ault because o)-.1 E -.15(ve)
--.15 G(rlay data are not al).15 E -.1(wa)-.1 G(ys de\214ned.).1 E F1
-(\255MG)108 439.2 Q F2(slope_colortable/slope_colortable_mode)13.08 E F0
-.559(Sets the def)144 451.2 R .559(ault colortable and colortable mode \
-for displays of slope using the programs)-.1 F F1(MBgrd-)3.058 E(viz)144
-463.2 Q F0(and)3.5 E F1(MBeditviz)3.5 E F0 6(.T)C 1
-(he colortable and colortable mode identi\214ers are the same as gi)-6 F
--.15(ve)-.25 G 3.5(na).15 G(bo)-3.5 E -.15(ve)-.15 G(for)144 475.2 Q F1
-(-MP)2.5 E F0(.)A F1(\255MO)108 492 Q F2
-(secondary_colortable/secondary_colortable_mode)13.08 E F0 1.216
-(Sets the def)144 504 R 1.216
-(ault colortable and colortable mode for displays of o)-.1 F -.15(ve)
--.15 G 1.215(rlay data using the programs).15 F F1(MBgrdviz)144 516 Q F0
-(and)3.19 E F1(MBeditviz)3.19 E F0 5.69(.T)C .69
-(he colortable and colortable mode identi\214ers are the same as gi)
--5.69 F -.15(ve)-.25 G(n).15 E(abo)144 528 Q .3 -.15(ve f)-.15 H(or).15
-E F1(-MP)2.5 E F0(.)A F1(\255MI)108 544.8 Q F2(ma)16.97 E(gnitude/ele)
--.1 E(vation/azimuth)-.15 E F0 .195(Sets the def)144 556.8 R .195
-(ault parameters for shading by illumination using the programs)-.1 F F1
-(MBgrdviz)2.694 E F0(and)2.694 E F1(MBed-)2.694 E(itviz)144 568.8 Q F0 5
-(.T)C(he)-5 E F2(ele)2.5 E(vation)-.15 E F0(and)2.5 E F2(azimuth)2.5 E
-F0 -.25(va)2.5 G(lues are in de).25 E(grees.)-.15 E F1(\255MS)108 585.6
-Q F2(ma)15.3 E(gnitude)-.1 E F0 1.648(Sets the def)144 597.6 R 1.648
-(ault parameter for shading by slope magnitude using the programs)-.1 F
-F1(MBgrdviz)4.149 E F0(and)4.149 E F1(MBeditviz)144 609.6 Q F0(.)A F1
-<ad54>108 626.4 Q F2(time)23.63 E(gap)-.4 E F0 .479
-(Sets the maximum time g)144 638.4 R .479
-(ap in minutes between adjacent pings allo)-.05 F .478
-(wed before the data is consid-)-.25 F(ered to ha)144 650.4 Q .3 -.15
-(ve a g)-.2 H(ap. Def).1 E(ault:)-.1 E F2(time)2.5 E(gap)-.4 E F0 2.5
-(=1)2.5 G(.)-2.5 E F1<ad55>108 667.2 Q F2(useloc)23.08 E(k\214les)-.2 E
-F0 .661(Sets whether)144 679.2 R F1(MB-System)3.161 E F0 .661
-(uses the \214le locking mechanism to insure that a sw)3.161 F .662
-(ath \214le is only pro-)-.1 F .016
-(cessed or edited by a single program at a time.)144 691.2 R 1.615 -.8
-(To r)5.015 H -2.15 -.25(ev e).8 H .015(rt to pre-lock\214le beha).25 F
-.015(vior for)-.2 F F1(mbedit)2.515 E F0(,)A F1(mbe-)2.515 E(ditviz)144
-703.2 Q F0(,)A F1(mbclean)3.22 E F0(,)A F1(mbar)3.22 E(eaclean)-.18 E F0
-(,)A F1(mbna)3.221 E -.1(ve)-.25 G(dit).1 E F0 3.221(,a)C(nd)-3.221 E F1
-(mbpr)3.221 E(ocess)-.18 E F0 3.221(,u)C(se)-3.221 E F1<ad55>3.221 E F2
-(0)A F0(or)3.221 E F1<ad55>5.721 E F2(no)A F0 3.221(.T)C 3.221(or)-4.021
-G .721(einstate use)-3.221 F(of lock \214les, use)144 715.2 Q F1<ad55>
-2.5 E F2(1)A F0(or)2.5 E F1<ad55>5 E F2(yes)A F0(.)A(MB-System 5.0)72
-768 Q 2.5(5S)134.275 G(eptember 2014)-2.5 E(2)192.615 E 0 Cg EP
-%%Page: 3 3
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mbdef)72 48 Q 143.83(aults\(1\) MB-System)-.1 F
-143.83(5.0 mbdef)2.5 F(aults\(1\))-.1 E/F1 10/Times-Bold at 0 SF<ad56>108
-84 Q F0(Normally)23.08 E(,)-.65 E F1(mbdefaults)2.807 E F0 .307
-(outputs only a list of the def)2.807 F .306(ault v)-.1 F .306
-(alues to the stdout stream.)-.25 F .306(If the)5.306 F F1<ad56>2.806 E
-F0(\215ag)2.806 E .467(is gi)144 96 R -.15(ve)-.25 G .467(n, then).15 F
-F1(mbdefaults)2.967 E F0 -.1(wo)2.967 G .467(rks in a "v).1 F .468
-(erbose" mode and also outputs the program v)-.15 F .468(ersion being)
--.15 F(used.)144 108 Q F1<ad57>108 124.8 Q/F2 10/Times-Italic at 0 SF(pr)
-20.3 E(oject)-.45 E F0 .336(Sets the name of the def)144 136.8 R .335(a\
-ult project. This will be used by MB-System database management utili-)
--.1 F(ties yet to be created.)144 148.8 Q(Def)5 E(ault:)-.1 E F2(pr)2.5
-E(oject)-.45 E F0 2.5(=")2.5 G(none".)-2.5 E/F3 10.95/Times-Bold at 0 SF
-(EXAMPLES)72 177.6 Q F0 .127(Suppose that one wishes the def)108 189.6 R
-.127(ault Postscript vie)-.1 F .127(wer to be xpsvie)-.25 F 2.627(wr)
--.25 G .127(ather than gv)-2.627 F 5.127(.T)-.65 G .127(he follo)-5.127
-F .127(wing will suf-)-.25 F(\214ce to create \(or re)108 201.6 Q
-(write\) a .mbio_def)-.25 E(aults \214le in the users home directory:)
--.1 E(mbdef)38.5 E(aults \255Dxpsvie)-.1 E(w)-.25 E(The output will be:)
-108 225.6 Q(Ne)110.5 249.6 Q 2.5(wM)-.25 G(BIO Def)-2.5 E
-(ault Control P)-.1 E(arameters:)-.15 E 2.5(lon\215ip: 0)110.5 261.6 R
-(time)110.5 273.6 Q -.05(ga)-.15 G 2.5(p: 1.000000).05 F(ps vie)110.5
-285.6 Q 2.5(wer: xspsvie)-.25 F(w)-.25 E(img vie)110.5 297.6 Q(wer: xv)
--.25 E 7.5(project: none)110.5 309.6 R(fbtv)110.5 321.6 Q
-(ersion: 3 \(ne)-.15 E(w\))-.25 E(uselock\214les: 1)110.5 333.6 Q
-(\214leiob)110.5 345.6 Q(uf)-.2 E(fer: 10000 \(use 10000 kB b)-.25 E(uf)
--.2 E(fer for fread\(\) & fwrite\(\)\))-.25 E 1.174
-(Suppose that one just wishes to see what the current def)108 369.6 R
-1.174(ault parameters are.)-.1 F 1.173(The follo)6.173 F 1.173
-(wing will suf)-.25 F(\214ce:)-.25 E(mbdef)144 381.6 Q(aults)-.1 E
-(The output will be)108 405.6 Q(Current MBIO Def)110.5 429.6 Q
-(ault Control P)-.1 E(arameters:)-.15 E 7.5(lon\215ip: 0)110.5 441.6 R
-(time)110.5 453.6 Q -.05(ga)-.15 G 7.5(p: 1.000000).05 F(ps vie)110.5
-465.6 Q 2.5(wer: ghostvie)-.25 F(w)-.25 E(img vie)110.5 477.6 Q(wer: xv)
--.25 E 7.5(project: none)110.5 489.6 R(fbtv)110.5 501.6 Q
-(ersion: 3 \(ne)-.15 E(w\))-.25 E(uselock\214les: 1)110.5 513.6 Q
-(\214leiob)110.5 525.6 Q(uf)-.2 E(fer: 10000 \(use 10000 kB b)-.25 E(uf)
--.2 E(fer for fread\(\) & fwrite\(\)\))-.25 E F3(SEE ALSO)72 554.4 Q F1
-(mbsystem)108 566.4 Q F0(\(1\),)A F1(mbio)6.315 E F0(\(1\),)A F1
-(mbcontour)6.315 E F0(\(1\),)A F1(mbswath)6.315 E F0(\(1\),)A F1
-(mbgrdtiff)6.315 E F0(\(1\),)A F1(mbm_plot)6.315 E F0(\(1\),)A F1
-(mbm_grdplot)6.315 E F0(\(1\),)A F1(mbm_grd3dplot)108 578.4 Q F0(\(1\),)
-A F1(mbm_xyplot)2.5 E F0(\(1\),)A F1(mbm_grdtiff)2.5 E F0(\(1\))A F3
--.11(BU)72 607.2 S(GS).11 E F0 -.8(To)108 619.2 S 2.5(os).8 G
-(imple to ha)-2.5 E .3 -.15(ve a)-.2 H .3 -.15(ny r).15 H
-(eally interesting b).15 E(ugs.)-.2 E -.8(We)108 643.2 S .182
-(ll, ok, this program occassionally runs wild, destro).8 F .182
-(ying \214lesystems and eating young children. But don')-.1 F(t)-.18 E
--.1(wo)108 655.2 S(rry).1 E 2.5(,i)-.65 G 2.5(tc)-2.5 G(ould ne)-2.5 E
--.15(ve)-.25 G 2.5(rh).15 G(appen to you...)-2.5 E(MB-System 5.0)72 768
-Q 2.5(5S)134.275 G(eptember 2014)-2.5 E(3)192.615 E 0 Cg EP
-%%Trailer
-end
-%%EOF
diff --git a/src/ps/mbdumpesf.ps b/src/ps/mbdumpesf.ps
deleted file mode 100644
index c7c045b..0000000
--- a/src/ps/mbdumpesf.ps
+++ /dev/null
@@ -1,342 +0,0 @@
-%!PS-Adobe-3.0
-%%Creator: groff version 1.19.2
-%%CreationDate: Wed Jul  1 12:29:27 2015
-%%DocumentNeededResources: font Times-Roman
-%%+ font Times-Bold
-%%+ font Times-Italic
-%%DocumentSuppliedResources: procset grops 1.19 2
-%%Pages: 2
-%%PageOrder: Ascend
-%%DocumentMedia: Default 612 792 0 () ()
-%%Orientation: Portrait
-%%EndComments
-%%BeginDefaults
-%%PageMedia: Default
-%%EndDefaults
-%%BeginProlog
-%%BeginResource: procset grops 1.19 2
-%!PS-Adobe-3.0 Resource-ProcSet
-/setpacking where{
-pop
-currentpacking
-true setpacking
-}if
-/grops 120 dict dup begin
-/SC 32 def
-/A/show load def
-/B{0 SC 3 -1 roll widthshow}bind def
-/C{0 exch ashow}bind def
-/D{0 exch 0 SC 5 2 roll awidthshow}bind def
-/E{0 rmoveto show}bind def
-/F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def
-/G{0 rmoveto 0 exch ashow}bind def
-/H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/I{0 exch rmoveto show}bind def
-/J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def
-/K{0 exch rmoveto 0 exch ashow}bind def
-/L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/M{rmoveto show}bind def
-/N{rmoveto 0 SC 3 -1 roll widthshow}bind def
-/O{rmoveto 0 exch ashow}bind def
-/P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/Q{moveto show}bind def
-/R{moveto 0 SC 3 -1 roll widthshow}bind def
-/S{moveto 0 exch ashow}bind def
-/T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/SF{
-findfont exch
-[exch dup 0 exch 0 exch neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/MF{
-findfont
-[5 2 roll
-0 3 1 roll
-neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/level0 0 def
-/RES 0 def
-/PL 0 def
-/LS 0 def
-/MANUAL{
-statusdict begin/manualfeed true store end
-}bind def
-/PLG{
-gsave newpath clippath pathbbox grestore
-exch pop add exch pop
-}bind def
-/BP{
-/level0 save def
-1 setlinecap
-1 setlinejoin
-72 RES div dup scale
-LS{
-90 rotate
-}{
-0 PL translate
-}ifelse
-1 -1 scale
-}bind def
-/EP{
-level0 restore
-showpage
-}def
-/DA{
-newpath arcn stroke
-}bind def
-/SN{
-transform
-.25 sub exch .25 sub exch
-round .25 add exch round .25 add exch
-itransform
-}bind def
-/DL{
-SN
-moveto
-SN
-lineto stroke
-}bind def
-/DC{
-newpath 0 360 arc closepath
-}bind def
-/TM matrix def
-/DE{
-TM currentmatrix pop
-translate scale newpath 0 0 .5 0 360 arc closepath
-TM setmatrix
-}bind def
-/RC/rcurveto load def
-/RL/rlineto load def
-/ST/stroke load def
-/MT/moveto load def
-/CL/closepath load def
-/Fr{
-setrgbcolor fill
-}bind def
-/setcmykcolor where{
-pop
-/Fk{
-setcmykcolor fill
-}bind def
-}if
-/Fg{
-setgray fill
-}bind def
-/FL/fill load def
-/LW/setlinewidth load def
-/Cr/setrgbcolor load def
-/setcmykcolor where{
-pop
-/Ck/setcmykcolor load def
-}if
-/Cg/setgray load def
-/RE{
-findfont
-dup maxlength 1 index/FontName known not{1 add}if dict begin
-{
-1 index/FID ne{def}{pop pop}ifelse
-}forall
-/Encoding exch def
-dup/FontName exch def
-currentdict end definefont pop
-}bind def
-/DEFS 0 def
-/EBEGIN{
-moveto
-DEFS begin
-}bind def
-/EEND/end load def
-/CNT 0 def
-/level1 0 def
-/PBEGIN{
-/level1 save def
-translate
-div 3 1 roll div exch scale
-neg exch neg exch translate
-0 setgray
-0 setlinecap
-1 setlinewidth
-0 setlinejoin
-10 setmiterlimit
-[]0 setdash
-/setstrokeadjust where{
-pop
-false setstrokeadjust
-}if
-/setoverprint where{
-pop
-false setoverprint
-}if
-newpath
-/CNT countdictstack def
-userdict begin
-/showpage{}def
-/setpagedevice{}def
-}bind def
-/PEND{
-countdictstack CNT sub{end}repeat
-level1 restore
-}bind def
-end def
-/setpacking where{
-pop
-setpacking
-}if
-%%EndResource
-%%EndProlog
-%%BeginSetup
-%%BeginFeature: *PageSize Default
-<< /PageSize [ 612 792 ] /ImagingBBox null >> setpagedevice
-%%EndFeature
-%%IncludeResource: font Times-Roman
-%%IncludeResource: font Times-Bold
-%%IncludeResource: font Times-Italic
-grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72
-def/PL 792 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron/Zcaron
-/scaron/zcaron/Ydieresis/trademark/quotesingle/Euro/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/space/exclam/quotedbl/numbersign/dollar/percent
-/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen
-/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon
-/semicolon/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O
-/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright/circumflex
-/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y
-/z/braceleft/bar/braceright/tilde/.notdef/quotesinglbase/guillemotleft
-/guillemotright/bullet/florin/fraction/perthousand/dagger/daggerdbl
-/endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut
-/dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash
-/quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen
-/brokenbar/section/dieresis/copyright/ordfeminine/guilsinglleft
-/logicalnot/minus/registered/macron/degree/plusminus/twosuperior
-/threesuperior/acute/mu/paragraph/periodcentered/cedilla/onesuperior
-/ordmasculine/guilsinglright/onequarter/onehalf/threequarters
-/questiondown/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE
-/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex
-/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis
-/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn
-/germandbls/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla
-/egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis
-/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide/oslash
-/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis]def
-/Times-Italic at 0 ENC0/Times-Italic RE/Times-Bold at 0 ENC0/Times-Bold RE
-/Times-Roman at 0 ENC0/Times-Roman RE
-%%EndSetup
-%%Page: 1 1
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 140.95(mbdumpesf\(1\) MB-System)72 48 R 140.95
-(5.0 mbdumpesf\(1\))2.5 F/F1 10.95/Times-Bold at 0 SF -.219(NA)72 84 S(ME)
-.219 E/F2 10/Times-Bold at 0 SF(mbdumpesf)108 96 Q F0 2.776<ad4f>2.776 G
-.276(utput beam edits from a binary edit sa)-2.776 F .576 -.15(ve \214)
--.2 H .276(le, either in the binary form or as an ASCII te).15 F(xt)-.15
-E(dump.)108 108 Q F1(VERSION)72 136.8 Q F0 -1.11(Ve)108 148.8 S
-(rsion 5.0)1.11 E F1(SYNOPSIS)72 177.6 Q F2 .888
-(mbdumpesf \255\255input=)108 189.6 R/F3 10/Times-Italic at 0 SF(\214le)A
-F0([)3.388 E F2(\255\255output=)A F3(\214le)A F2(\255\255ignor)3.388 E
-.888(e-un\215ag \255\255ignor)-.18 F .889(e-\215ag \255\255ignor)-.18 F
-.889(e-\214lter \255\255ignor)-.18 F(e-zer)-.18 E(o)-.18 E<adad76>108
-201.6 Q(erbose \255\255help)-.1 E F0(])A F1(DESCRIPTION)72 230.4 Q F0
-(Sw)108 242.4 Q .821(ath bath)-.1 F .821
-(ymetry data is typically edited either with interacti)-.05 F 1.121 -.15
-(ve t)-.25 H .821(ools such as).15 F F2(mbedit)3.32 E F0 .82
-(or automatic \214lters)3.32 F .83(such as)108 254.4 R F2(mbclean)3.33 E
-F0 5.83(.I)C(n)-5.83 E F2(MB-System)3.33 E F0 3.33(,t)C .831
-(he beam \215ags are stored in binary "edit sa)-3.33 F 1.131 -.15
-(ve \214)-.2 H .831(les" \(\214le suf).15 F .831(\214x ".esf"\).)-.25 F
-1.133(The program)108 266.4 R F2(mbdumpesf)3.633 E F0 1.132(reads and o\
-utputs esf \214les. If no output \214le is speci\214ed, then each of th\
-e edit)3.633 F -2.15 -.25(ev e)108 278.4 T .12
-(nts is written in ASCII te).25 F .12(xt as a single line to stdout. If\
- an output \214le is speci\214ed with the)-.15 F F2(\255\255output=)2.62
-E F3(\214le)A F0(option, then the edit sa)108 290.4 Q .3 -.15(ve d)-.2 H
-(ata will be written to that \214le in binary form.).15 E
-(The four types of edit e)108 314.4 Q -.15(ve)-.25 G
-(nts supported by esf \214les are:).15 E(action=1: \215ag manually)144
-326.4 Q(action=2: un\215ag)144 338.4 Q(action=3: zero \255 mak)144 350.4
-Q 2.5(eb)-.1 G(eam null)-2.5 E(action=4: \215ag by auto\214lter)144
-362.4 Q .988(This program can be forced to ignore \(e)108 374.4 R .987
-(xclude from the output\) an)-.15 F 3.487(yo)-.15 G 3.487(ft)-3.487 G
-.987(he e)-3.487 F -.15(ve)-.25 G .987(nt types using the options).15 F
-F2(\255\255ignor)108 386.4 Q(e-un\215ag)-.18 E F0(,)A F2(\255\255ignor)
-2.5 E(e-\215ag)-.18 E F0(,)A F2(\255\255ignor)2.5 E(e-\214lter)-.18 E F0
-2.5(,a)C(nd)-2.5 E F2(\255\255ignor)2.5 E(e-zer)-.18 E(o)-.18 E F0(.)A
-F1 -.548(AU)72 415.2 S(THORSHIP).548 E F0(Da)108 427.2 Q(vid W)-.2 E 2.5
-(.C)-.92 G(aress \(caress at mbari.or)-2.5 E(g\))-.18 E(Montere)113 439.2 Q
-2.5(yB)-.15 G(ay Aquarium Research Institute)-2.5 E
-(Dale N. Chayes \(dale at ldeo.columbia.edu\))108 451.2 Q
-(Lamont-Doherty Earth Observ)113 463.2 Q(atory)-.25 E F1
-(MBDUMPESF OPTIONS)72 492 Q F2(\255\255input=)108 504 Q F3(\214le)A F0
-("Edit sa)144 516 Q .3 -.15(ve \214)-.2 H
-(le" \(esf \214le\) from which the edit e).15 E -.15(ve)-.25 G
-(nts will be read.).15 E F2(\255\255output=)108 532.8 Q F3(\214le)A F0
-.381(Speci\214es output esf \214le. If this option is not used, then th\
-e edit e)144 544.8 R -.15(ve)-.25 G .381
-(nt stream will be output to std-).15 F(out as a sequence of ASCII te)
-144 556.8 Q(xt lines.)-.15 E F2(\255\255ignor)108 573.6 Q(e-un\215ag)
--.18 E F0(Causes)144 585.6 Q F2(mbdumpesf)2.5 E F0(to not output an)2.5
-E 2.5(yu)-.15 G(n\215ag edit e)-2.5 E -.15(ve)-.25 G
-(nts read from the input.).15 E F2(\255\255ignor)108 602.4 Q(e-\215ag)
--.18 E F0(Causes)144 614.4 Q F2(mbdumpesf)2.5 E F0(to not output an)2.5
-E 2.5<798d>-.15 G(ag edit e)-2.5 E -.15(ve)-.25 G
-(nts read from the input.).15 E F2(\255\255ignor)108 631.2 Q(e-\214lter)
--.18 E F0(Causes)144 643.2 Q F2(mbdumpesf)2.5 E F0(to not output an)2.5
-E 2.5<798c>-.15 G(lter edit e)-2.5 E -.15(ve)-.25 G
-(nts read from the input.).15 E F2(\255\255ignor)108 660 Q(e-zer)-.18 E
-(o)-.18 E F0(Causes)144 672 Q F2(mbdumpesf)2.5 E F0(to not output an)2.5
-E 2.5(yz)-.15 G(ero edit e)-2.5 E -.15(ve)-.25 G
-(nts read from the input.).15 E F2<adad76>108 688.8 Q(erbose)-.1 E F0
-(Normally)144 700.8 Q(,)-.65 E F2(mbdumpesf)3.064 E F0 .564
-(outputs one line for each edit e)3.064 F -.15(ve)-.25 G .564
-(nt in the input esf \214le.).15 F .563(If the \255\255v)5.563 F(erbose)
--.15 E .487(\215ag is gi)144 712.8 R -.15(ve)-.25 G .487(n, then).15 F
-F2(mbdumpesf)2.987 E F0 .488
-(also outputs the total number of each type of edit e)2.988 F -.15(ve)
--.25 G .488(nt at the end).15 F(of the listing.)144 724.8 Q
-(MB-System 5.0)72 768 Q 2.5(3M)146.495 G(ay 2015)-2.5 E(1)204.835 E 0 Cg
-EP
-%%Page: 2 2
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 140.95(mbdumpesf\(1\) MB-System)72 48 R 140.95
-(5.0 mbdumpesf\(1\))2.5 F/F1 10/Times-Bold at 0 SF(\255\255help)108 84 Q F0
-.391(This "help" \215ag causes the program to print out a description o\
-f its operation and then e)6.26 F .39(xit imme-)-.15 F(diately)144 96 Q
-(.)-.65 E/F2 10.95/Times-Bold at 0 SF(EXAMPLES)72 124.8 Q F0 5.142
-(Suppose one has edited a sw)108 136.8 R 5.142
-(ath \214le 20080422_222636.mb88, resulting in an esf \214le named)-.1 F
-(20080422_222636.mb88.esf. T)108 148.8 Q 2.5(od)-.8 G(ump the edit e)
--2.5 E -.15(ve)-.25 G(nts as a te).15 E(xt stream, use)-.15 E F1
-(mbdumpesf)2.5 E F0(:)A(mbdumpesf \255I 20080422_222636.mb88.esf)144
-160.8 Q(The output will look something lik)108 172.8 Q(e:)-.1 E(EDITS R\
-EAD: i:0 time: 947562291.799000 2008/04/22 22:26:36.799000 beam:21 acti\
-on:1)108 196.8 Q(EDITS READ: i:1 time: 947562291.799000 2008/04/22 22:2\
-6:36.799000 beam:22 action:1)108 208.8 Q(EDITS READ: i:2 time: 94756229\
-1.799000 2008/04/22 22:26:36.799000 beam:23 action:1)108 220.8 Q(EDITS \
-READ: i:3 time: 947562291.799000 2008/04/22 22:26:36.799000 beam:24 act\
-ion:1)108 232.8 Q(EDITS READ: i:4 time: 947562291.799000 2008/04/22 22:\
-26:36.799000 beam:25 action:1)108 244.8 Q(EDITS READ: i:5 time: 9475622\
-91.799000 2008/04/22 22:26:36.799000 beam:26 action:1)108 256.8 Q(EDITS\
- READ: i:6 time: 947562291.799000 2008/04/22 22:26:36.799000 beam:27 ac\
-tion:1)108 268.8 Q(EDITS READ: i:7 time: 947562291.799000 2008/04/22 22\
-:26:36.799000 beam:28 action:1)108 280.8 Q(Here the lar)108 304.8 Q
-(ge time v)-.18 E
-(alue is epoch seconds \(seconds since 1/1/1970\), and the edit e)-.25 E
--.15(ve)-.25 G(nt action v).15 E(alues are:)-.25 E
-(action=1: \215ag manually)144 316.8 Q(action=2: un\215ag)144 328.8 Q
-(action=3: zero \255 mak)144 340.8 Q 2.5(eb)-.1 G(eam null)-2.5 E
-(action=4: \215ag by auto\214lter)144 352.8 Q F2(SEE ALSO)72 381.6 Q F1
-(mbsystem)108 393.6 Q F0(\(1\),)A F1(mbedit)2.5 E F0(\(1\),)A F1
-(mbeditviz)2.5 E F0(\(1\), fBmbclean)A F1(\(1\), mb)A(unclean\(1\))-.2 E
-F2 -.11(BU)72 422.4 S(GS).11 E F0 -.8(To)108 434.4 S 2.5(os).8 G
-(imple to ha)-2.5 E .3 -.15(ve a)-.2 H .3 -.15(ny i).15 H
-(nteresting problems.).15 E(MB-System 5.0)72 768 Q 2.5(3M)146.495 G
-(ay 2015)-2.5 E(2)204.835 E 0 Cg EP
-%%Trailer
-end
-%%EOF
diff --git a/src/ps/mbedit.ps b/src/ps/mbedit.ps
deleted file mode 100644
index feb8552..0000000
--- a/src/ps/mbedit.ps
+++ /dev/null
@@ -1,1284 +0,0 @@
-%!PS-Adobe-3.0
-%%Creator: groff version 1.19.2
-%%CreationDate: Wed Jul  1 12:29:27 2015
-%%DocumentNeededResources: font Times-Roman
-%%+ font Times-Bold
-%%+ font Times-Italic
-%%DocumentSuppliedResources: procset grops 1.19 2
-%%Pages: 10
-%%PageOrder: Ascend
-%%DocumentMedia: Default 612 792 0 () ()
-%%Orientation: Portrait
-%%EndComments
-%%BeginDefaults
-%%PageMedia: Default
-%%EndDefaults
-%%BeginProlog
-%%BeginResource: procset grops 1.19 2
-%!PS-Adobe-3.0 Resource-ProcSet
-/setpacking where{
-pop
-currentpacking
-true setpacking
-}if
-/grops 120 dict dup begin
-/SC 32 def
-/A/show load def
-/B{0 SC 3 -1 roll widthshow}bind def
-/C{0 exch ashow}bind def
-/D{0 exch 0 SC 5 2 roll awidthshow}bind def
-/E{0 rmoveto show}bind def
-/F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def
-/G{0 rmoveto 0 exch ashow}bind def
-/H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/I{0 exch rmoveto show}bind def
-/J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def
-/K{0 exch rmoveto 0 exch ashow}bind def
-/L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/M{rmoveto show}bind def
-/N{rmoveto 0 SC 3 -1 roll widthshow}bind def
-/O{rmoveto 0 exch ashow}bind def
-/P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/Q{moveto show}bind def
-/R{moveto 0 SC 3 -1 roll widthshow}bind def
-/S{moveto 0 exch ashow}bind def
-/T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/SF{
-findfont exch
-[exch dup 0 exch 0 exch neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/MF{
-findfont
-[5 2 roll
-0 3 1 roll
-neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/level0 0 def
-/RES 0 def
-/PL 0 def
-/LS 0 def
-/MANUAL{
-statusdict begin/manualfeed true store end
-}bind def
-/PLG{
-gsave newpath clippath pathbbox grestore
-exch pop add exch pop
-}bind def
-/BP{
-/level0 save def
-1 setlinecap
-1 setlinejoin
-72 RES div dup scale
-LS{
-90 rotate
-}{
-0 PL translate
-}ifelse
-1 -1 scale
-}bind def
-/EP{
-level0 restore
-showpage
-}def
-/DA{
-newpath arcn stroke
-}bind def
-/SN{
-transform
-.25 sub exch .25 sub exch
-round .25 add exch round .25 add exch
-itransform
-}bind def
-/DL{
-SN
-moveto
-SN
-lineto stroke
-}bind def
-/DC{
-newpath 0 360 arc closepath
-}bind def
-/TM matrix def
-/DE{
-TM currentmatrix pop
-translate scale newpath 0 0 .5 0 360 arc closepath
-TM setmatrix
-}bind def
-/RC/rcurveto load def
-/RL/rlineto load def
-/ST/stroke load def
-/MT/moveto load def
-/CL/closepath load def
-/Fr{
-setrgbcolor fill
-}bind def
-/setcmykcolor where{
-pop
-/Fk{
-setcmykcolor fill
-}bind def
-}if
-/Fg{
-setgray fill
-}bind def
-/FL/fill load def
-/LW/setlinewidth load def
-/Cr/setrgbcolor load def
-/setcmykcolor where{
-pop
-/Ck/setcmykcolor load def
-}if
-/Cg/setgray load def
-/RE{
-findfont
-dup maxlength 1 index/FontName known not{1 add}if dict begin
-{
-1 index/FID ne{def}{pop pop}ifelse
-}forall
-/Encoding exch def
-dup/FontName exch def
-currentdict end definefont pop
-}bind def
-/DEFS 0 def
-/EBEGIN{
-moveto
-DEFS begin
-}bind def
-/EEND/end load def
-/CNT 0 def
-/level1 0 def
-/PBEGIN{
-/level1 save def
-translate
-div 3 1 roll div exch scale
-neg exch neg exch translate
-0 setgray
-0 setlinecap
-1 setlinewidth
-0 setlinejoin
-10 setmiterlimit
-[]0 setdash
-/setstrokeadjust where{
-pop
-false setstrokeadjust
-}if
-/setoverprint where{
-pop
-false setoverprint
-}if
-newpath
-/CNT countdictstack def
-userdict begin
-/showpage{}def
-/setpagedevice{}def
-}bind def
-/PEND{
-countdictstack CNT sub{end}repeat
-level1 restore
-}bind def
-end def
-/setpacking where{
-pop
-setpacking
-}if
-%%EndResource
-%%EndProlog
-%%BeginSetup
-%%BeginFeature: *PageSize Default
-<< /PageSize [ 612 792 ] /ImagingBBox null >> setpagedevice
-%%EndFeature
-%%IncludeResource: font Times-Roman
-%%IncludeResource: font Times-Bold
-%%IncludeResource: font Times-Italic
-grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72
-def/PL 792 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron/Zcaron
-/scaron/zcaron/Ydieresis/trademark/quotesingle/Euro/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/space/exclam/quotedbl/numbersign/dollar/percent
-/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen
-/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon
-/semicolon/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O
-/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright/circumflex
-/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y
-/z/braceleft/bar/braceright/tilde/.notdef/quotesinglbase/guillemotleft
-/guillemotright/bullet/florin/fraction/perthousand/dagger/daggerdbl
-/endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut
-/dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash
-/quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen
-/brokenbar/section/dieresis/copyright/ordfeminine/guilsinglleft
-/logicalnot/minus/registered/macron/degree/plusminus/twosuperior
-/threesuperior/acute/mu/paragraph/periodcentered/cedilla/onesuperior
-/ordmasculine/guilsinglright/onequarter/onehalf/threequarters
-/questiondown/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE
-/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex
-/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis
-/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn
-/germandbls/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla
-/egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis
-/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide/oslash
-/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis]def
-/Times-Italic at 0 ENC0/Times-Italic RE/Times-Bold at 0 ENC0/Times-Bold RE
-/Times-Roman at 0 ENC0/Times-Roman RE
-%%EndSetup
-%%Page: 1 1
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 160.39(mbedit\(1\) MB-System)72 48 R 160.39
-(5.0 mbedit\(1\))2.5 F/F1 10.95/Times-Bold at 0 SF -.219(NA)72 84 S(ME).219
-E/F2 10/Times-Bold at 0 SF(mbedit)108 96 Q F0 2.5<ad49>2.5 G(nteracti)-2.5
-E .3 -.15(ve e)-.25 H(ditor used to \215ag bad bath).15 E(ymetry v)-.05
-E(alues in sw)-.25 E(ath sonar bath)-.1 E(ymetry data.)-.05 E F1
-(VERSION)72 124.8 Q F0 -1.11(Ve)108 136.8 S(rsion 5.0)1.11 E F1
-(SYNOPSIS)72 165.6 Q F2(mbedit)108 177.6 Q F0([)2.5 E F2<ad42>A/F3 10
-/Times-Italic at 0 SF(yr/mo/da/hr/mn/sc)A F2<ad4420ad45>2.5 E F3
-(yr/mo/da/hr/mn/sc)A F2<ad46>2.5 E F3(format)A F2<ad4720ad49>5 E F3
-(in\214le)A F2(\255X \255V \255H])2.5 E F1(DESCRIPTION)72 206.4 Q F2
-(MBedit)108 218.4 Q F0 .847(is an interacti)3.347 F 1.147 -.15(ve e)-.25
-H .847(ditor used to identify and \215ag artif).15 F .846(acts in sw)-.1
-F .846(ath sonar bath)-.1 F .846(ymetry data. Once a)-.05 F .047
-(\214le has been read in,)108 230.4 R F2(MBedit)2.547 E F0 .048
-(displays the bath)2.547 F .048(ymetry pro\214les from se)-.05 F -.15
-(ve)-.25 G .048(ral pings, allo).15 F .048(wing the user to iden-)-.25 F
-.805(tify and \215ag anomalous beams. In e)108 242.4 R .805
-(xtreme circumstances, entire pings may be nulled \(see "KEYBO)-.15 F
-(ARD)-.35 E -.4(AC)108 254.4 S(TIONS"\).).4 E .491(In the def)108 278.4
-R .492(ault mode the edit e)-.1 F -.15(ve)-.25 G .492
-(nts are output to an "edit sa).15 F -.15(ve)-.2 G 2.992<228c>.15 G .492
-(le. The program can also be operated in a)-2.992 F("bro)108 290.4 Q .69
-(wse" mode where no edit e)-.25 F -.15(ve)-.25 G .69(nts are output.).15
-F .69(If sa)5.69 F -.15(ve)-.2 G .689(d, the edit e).15 F -.15(ve)-.25 G
-.689(nts can be applied to the data using).15 F .612(the program)108
-302.4 R F2(mbpr)3.112 E(ocess)-.18 E F0 3.112(,w)C .612
-(hich outputs a processed sw)-3.112 F .613(ath data \214le.)-.1 F(The)
-5.613 E F2(mbpr)3.113 E(ocess)-.18 E F0 .613(program is also used)3.113
-F .772(to mer)108 314.4 R .772(ge edited na)-.18 F(vig)-.2 E .772
-(ation, recalculate bath)-.05 F(ymetry)-.05 E 3.272(,a)-.65 G .771
-(nd apply other corrections to sw)-3.272 F .771(ath bath)-.1 F .771
-(ymetry data.)-.05 F(Users may cause)108 326.4 Q F2(mbpr)2.5 E(ocess)
--.18 E F0(to be run automatically by specifying the)2.5 E F2<ad58>2.5 E
-F0(option when starting)2.5 E F2(mbedit)2.5 E F0(.)A .987(In pre)108
-350.4 R 3.487(vious v)-.25 F .988(ersions of)-.15 F F2(MB-System)3.488 E
-F0(\(v)3.488 E .988(ersion 4.6.10 or earlier\),)-.15 F F2(mbedit)3.488 E
-F0 .988(produced output sw)3.488 F .988(ath data \214les)-.1 F 1.368
-(directly by reading and storing all of the sw)108 362.4 R 1.367
-(ath data information in memory \(including non-surv)-.1 F 1.667 -.15
-(ey d)-.15 H(ata).15 E .096(records\). This approach limited the amount\
- of data that could be handled at once, frequently requiring users)108
-374.4 R 1.894(to process \214les in small pieces. The current v)108
-386.4 R 1.894(ersion only stores the bath)-.15 F 1.893
-(ymetry data and only outputs)-.05 F
-(changes to the beam \215ag status \(good data or bad data\) of bath)108
-398.4 Q(ymetry soundings.)-.05 E .552(The def)108 422.4 R(ault)-.1 E F2
-(mbedit)3.052 E F0 .552(display consists of se)3.052 F -.15(ve)-.25 G
-.552(ral bath).15 F .553(ymetry acrosstrack pro\214les plotted with v)
--.05 F .553(ertical of)-.15 F(fsets)-.25 E .73
-(between each pro\214le \(in w)108 434.4 R(aterf)-.1 E .73(all f)-.1 F
-.73
-(ashion\). The pro\214les are plotted within a box with annotation sho)
--.1 F(wing)-.25 E .682
-(the scaling of the x \(acrosstrack distance\) and y \(depth\) ax)108
-446.4 R .682(es. Alternati)-.15 F -.15(ve)-.25 G(ly).15 E 3.183(,t)-.65
-G .683(he display can sho)-3.183 F 3.183(wt)-.25 G .683(he pro-)-3.183 F
-2.846(\214les without the w)108 458.4 R(aterf)-.1 E 2.846(all of)-.1 F
-2.846(fsets, with the vie)-.25 F 5.346(wb)-.25 G 2.845
-(eing either in the alongtrack direction, or in the)-5.346 F
-(acrosstrack dimension.)108 470.4 Q .177
-(The number of pings displayed, and the width, v)108 494.4 R .178
-(ertical e)-.15 F .178
-(xageration, and annotation of the plot are all set by)-.15 F 1.402
-(the user)108 506.4 R 3.902(.U)-.55 G 1.402(n\215agged bath)-3.902 F
-1.402(ymetry points are sho)-.05 F 1.401
-(wn as small \214lled black squares, and \215agged bath)-.25 F(ymtetry)
--.05 E .656(points are sho)108 518.4 R .656(wn as small un\214lled red \
-or blue squares. Soundings \215agged manually are sho)-.25 F .657
-(wn in red, and)-.25 F .779
-(those \215agged by \214lter algorithms are sho)108 530.4 R .778
-(wn in green. When a sounding is selected in the info mode, it is)-.25 F
-.595(displayed as a lar)108 542.4 R .595(ge, \214lled, blue square.)-.18
-F .596(The un\215agged or good bath)5.596 F .596
-(ymetry points are connected by black)-.05 F .504(line se)108 554.4 R
-.504(gments to sho)-.15 F 3.004(wt)-.25 G .504(he acrosstrack bath)
--3.004 F .504(ymetry pro\214les for each ping. If the)-.05 F F2(Sho)
-3.003 E 3.003(wF)-.1 G .503(lagged Pr)-3.003 F(o\214le)-.18 E F0(tog-)
-3.003 E .327(gle is set on, then red line se)108 566.4 R .328
-(gments connect the \215agged depth v)-.15 F .328
-(alues in the acrosstrack bath)-.25 F .328(ymetry pro\214le.)-.05 F .097
-(Each of the displayed pings has a label gi)108 578.4 R .097
-(ving the record number in the data \214le, the ping time, and the cen-)
--.25 F(ter beam depth.)108 590.4 Q 1.49(The editing is dri)108 614.4 R
--.15(ve)-.25 G 3.99(nb).15 G 3.99(yt)-3.99 G 1.49(he left mouse b)-3.99
-F 1.49(utton and in)-.2 F -.2(vo)-.4 G(lv).2 E 1.49
-(es four basic edit modes and one information)-.15 F .03
-(mode. In toggle mode each mouse pick toggles the nearest bath)108 626.4
-R .03(ymetry point between \215agged and un\215agged)-.05 F .345
-(states. In pick mode each mouse pick \215ags the nearest bath)108 638.4
-R .345(ymetry point. In erase mode the left mouse b)-.05 F(ut-)-.2 E
-1.061(ton is held do)108 650.4 R 1.061(wn as the cursor is dragged o)
--.25 F -.15(ve)-.15 G 3.561(rt).15 G 1.061(he data; all bath)-3.561 F
-1.061(ymetry points touched by the mouse are)-.05 F .319
-(\215agged. Restore mode is just lik)108 662.4 R 2.819(ee)-.1 G .319
-(rase mode, e)-2.819 F .319(xcept that the af)-.15 F .32(fected bath)
--.25 F .32(ymetry v)-.05 F .32(alues are un\215agged.)-.25 F(In)5.32 E
-.366(grab mode, a red rectangle is dra)108 674.4 R .365
-(wn as the mouse is dragged with the left b)-.15 F .365(utton do)-.2 F
-.365(wn. When the b)-.25 F .365(utton is)-.2 F .65(released, all un\215\
-agged soundings within the rectangle are \215agged. Finally)108 686.4 R
-3.15(,i)-.65 G .65(nfo mode acts lik)-3.15 F 3.15(ep)-.1 G .65
-(ick mode,)-3.15 F -.15(ex)108 698.4 S 1.011(cept that instead of \215a\
-gging the nearest sounding, the program displays information about the \
-selected).15 F .86(ping and sounding abo)108 710.4 R 1.16 -.15(ve t)-.15
-H .86(he bath).15 F .86(ymetry pro\214le box.)-.05 F 3.36(Af)5.86 G 1.36
--.25(ew k)-3.36 H -.15(ey).15 G .86(board macros described belo).15 F
-3.36(wa)-.25 G .86(dd addi-)-3.36 F(tional \215e)108 722.4 Q
-(xibility to the editing process.)-.15 E(MB-System 5.0)72 768 Q 2.5(3J)
-146.495 G(une 2013)-2.5 E(1)204.835 E 0 Cg EP
-%%Page: 2 2
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 160.39(mbedit\(1\) MB-System)72 48 R 160.39
-(5.0 mbedit\(1\))2.5 F/F1 10/Times-Bold at 0 SF(MBedit)108 84 Q F0 .262
-(has some limited automatic \215agging and un\215agging options. The)
-2.762 F F1 .261(Un\215ag V)2.761 F(iew)-.37 E F0 -.2(bu)2.761 G .261
-(tton allo).2 F .261(ws users)-.25 F .379
-(to un\215ag all of the currently visible soundings, and the)108 96 R F1
-.38(Un\215ag F)2.879 F(orward)-.25 E F0 -.2(bu)2.88 G .38
-(tton un\215ags all soundings from).2 F .167(the current position forw)
-108 108 R .167(ard to the end of the data held in memory)-.1 F 2.666(.T)
--.65 G(he)-2.666 E F1(Contr)2.666 E(ols)-.18 E F0 .166(menu includes a)
-2.666 F F1(Filters...)2.666 E F0 -.2(bu)108 120 S 1.737(tton that bring\
-s up a dialog which sets the automatic \215agging functions. At present\
-, these include a).2 F 2.345(median \214lter algorithm, a "wrong side \
-\214lter", "data cutting" by beam number)108 132 R 4.845(,a)-.4 G 2.345
-(nd "data cutting" by)-4.845 F .87(acrosstrack distance. The "wrong sid\
-e" \214lter \215ags soundings positioned on the "wrong" side of the sw)
-108 144 R(ath)-.1 E .444
-(\(port soundings incorrectly located on the starboard side, or vice v)
-108 156 R .444(ersa\). The tw)-.15 F 2.944(o")-.1 G .444
-(data cutting" algorithms)-2.944 F .621(\215ag beams inside or outside \
-of speci\214ed beam number ranges or acrosstrack distance ranges, respe\
-cti)108 168 R -.15(ve)-.25 G(ly).15 E(.)-.65 E
-(Additional automatic \214lters will be added in later v)108 180 Q
-(ersions.)-.15 E .765(If the ping includes \215agged depths outside the\
- plotting box, the ping label is underlain by a green box. If)108 204 R
-.238(the ping includes un\215agged depths outside the plotting box, the\
- label is underlain by a red box, and a small)108 216 R .942(black box \
-appears to the left of the label. These colored labels help users ident\
-ify bad bath)108 228 R .941(ymetry points)-.05 F 1.429
-(which lie outside the box de\214ned by the current v)108 240 R 1.429
-(ertical e)-.15 F 1.429(xageration and plot width v)-.15 F 1.429
-(alues. In the case)-.25 F .078(where un\215agged depths lie outside th\
-e plotting box \(red label\), clicking on the small black box to the le\
-ft of)108 252 R .799
-(the ping label automatically \215ags all of the depth v)108 264 R .799
-(alues outside the plotting box. Alternati)-.25 F -.15(ve)-.25 G(ly).15
-E 3.299(,u)-.65 G .799(sers can)-3.299 F 1.105(decrease the v)108 276 R
-1.105(ertical e)-.15 F 1.104
-(xageration and/or increase the plot width to bring the of)-.15 F 1.104
-(fending bath)-.25 F 1.104(ymetry points)-.05 F .806(into vie)108 288 R
-2.106 -.65(w. U)-.25 H .806(sers should be a).65 F -.1(wa)-.15 G .806
-(re that e).1 F .806(xtreme bath)-.15 F .806
-(ymetric slopes or the use of high v)-.05 F .807(ertical e)-.15 F
-(xagerations)-.15 E(may cause good depth v)108 300 Q(alues to lie outsi\
-de the plotting box for the \214rst and last pings in vie)-.25 E -.65
-(w.)-.25 G .305(The middle and right mouse b)108 324 R .305(uttons allo)
--.2 F 2.805(wt)-.25 G .305(he user to step forw)-2.805 F .305
-(ard and backw)-.1 F .305(ard, respecti)-.1 F -.15(ve)-.25 G(ly).15 E
-2.805(,t)-.65 G .305(hrough the)-2.805 F 1.429(data \214le. The)108 336
-R F1 -.25(Fo)3.929 G(rward).25 E F0(and)3.929 E F1(Re)3.929 E -.1(ve)
--.15 G(rse).1 E F0 -.2(bu)3.929 G 1.429(ttons pro).2 F 1.429
-(vide a duplicate stepping capability)-.15 F 6.43(.L)-.65 G 1.43
-(eft-handed users)-6.43 F .544(may re)108 348 R -.15(ve)-.25 G .544
-(rse the right and left mouse b).15 F .544
-(utton functions by pulling do)-.2 F .544(wn the)-.25 F F1(Re)3.043 E
--.1(ve)-.15 G .543(rse Mouse Buttons).1 F F0(menu)3.043 E(item from the)
-108 360 Q F1(Contr)2.5 E(ols)-.18 E F0 -.2(bu)2.5 G(tton.).2 E F1
-(MBedit)108 384 Q F0 .878(can hold up to 25000 sw)3.378 F .878(ath bath)
--.1 F .878(ymetry pro\214les at a time in memory)-.05 F 3.379(.I)-.65 G
-3.379(nt)-3.379 G .879(he case that a data \214le)-3.379 F .492
-(contains more surv)108 396 R .792 -.15(ey d)-.15 H .492
-(ata records than can be held in memory).15 F 2.992(,u)-.65 G .491
-(sers will \214nd it necessary to step through)-2.992 F 1.014
-(multiple b)108 408 R(uf)-.2 E 1.014(fers of data. The)-.25 F F1 1.014
-(Next Buffer)3.514 F F0 -.2(bu)3.514 G 1.014(tton will cause).2 F F1
-(MBedit)3.514 E F0 1.015(to dump the current b)3.515 F(uf)-.2 E 1.015
-(fer contents)-.25 F 1.72(and read in a ne)108 420 R 4.22(ws)-.25 G 1.72
-(et of data.)-4.22 F 1.72(The handling of b)6.72 F(uf)-.2 E 1.72
-(fered data is set using the)-.25 F F1 1.72(Buffer Contr)4.22 F(ols)-.18
-E F0(dialog)4.22 E .746(accessed by pulling do)108 432 R .746(wn the)
--.25 F F1 .746(Buffer Contr)3.246 F(ols...)-.18 E F0 .746
-(menu item from the)3.246 F F1(Contr)3.246 E(ols)-.18 E F0 -.2(bu)3.246
-G 3.246(tton. The).2 F F1 .746(Buffer Con-)3.246 F(tr)108 444 Q(ols)-.18
-E F0 .598(dialog includes tw)3.098 F 3.098(os)-.1 G .598
-(lider controls, one entitled)-3.098 F F1 .597(Data Buffer Size)3.098 F
-F0 .597(and the other)3.097 F F1 .597(Buffer Retain Size)3.097 F F0(.)A
-.2(Users on memory limited machines may \214nd it necessary to set the \
-maximum b)108 456 R(uf)-.2 E .201(fer size to a smaller num-)-.25 F
-1.609(ber using the)108 468 R F1 1.609(Data Buffer Size)4.109 F F0
-(slider)4.109 E 6.609(.T)-.55 G(he)-6.609 E F1 1.609(Buffer Retain Size)
-4.109 F F0 1.609(slider sets the number of data records)4.109 F
-(retained from the old b)108 480 Q(uf)-.2 E
-(fer when more data are loaded.)-.25 E .377(The user can bring up a)108
-504 R F1 .377(Go T)2.877 F 2.877(oS)-.92 G .377(peci\214ed T)-2.877 F
-(ime)-.18 E F0 .377(dialog by pulling do)2.877 F .377(wn the)-.25 F F1
-.377(Go to a speci\214ed time...)2.877 F F0(menu)2.877 E 1.047
-(item from the)108 516 R F1(Contr)3.547 E(ols)-.18 E F0 -.2(bu)3.547 G
-1.047(tton. This dialog allo).2 F 1.047
-(ws the user to specify the time of a particular ping to be)-.25 F(vie)
-108 528 Q 2.92(wed. The)-.25 F .421(\214rst ping with a time tag later \
-than or equal to the speci\214ed time is then displayed, pro)2.92 F
-(viding)-.15 E .275(such a ping is a)108 540 R -.25(va)-.2 G .274
-(ilable. If an appropriate ping is not a).25 F -.25(va)-.2 G .274
-(ilable in the current b).25 F(uf)-.2 E(fer)-.25 E(,)-.4 E F1(MBedit)
-2.774 E F0 .274(will dump and)2.774 F .133(load b)108 552 R(uf)-.2 E
-.134(fers of data until such a ping is found or the end of the \214le i\
-s reached. Thus, specifying an incorrect)-.25 F("go to" time may cause)
-108 564 Q F1(MBedit)2.5 E F0
-(to close the \214le. Caution is advised in using this feature.)2.5 E F1
-(MBedit)108 588 Q F0 .302(creates "edit sa)2.802 F -.15(ve)-.2 G 2.802
-<228c>.15 G .302(les containing a list of each edit command e)-2.802 F
--.15(xe)-.15 G .302(cuted during an editing session.).15 F .181
-(These \214les are gi)108 600 R -.15(ve)-.25 G 2.682(nn).15 G .182
-(ames consisting of the input \214lename appended with ".esf".)-2.682 F
-.182(The program also modi-)5.182 F .617(\214es the)108 612 R F1(mbpr)
-3.117 E(ocess)-.18 E F0 .616
-(parameter \214le for the input \214le by specifying the edit sa)3.116 F
-.916 -.15(ve \214)-.2 H .616(le and setting the).15 F F1(mbpr)3.116 E
-(o-)-.18 E(cess)108 624 Q F0 1.272
-(mode to apply the edits when generating a processed sw)3.771 F 1.272
-(ath output \214le. If no parameter \214le named)-.1 F("i\214le.par" e)
-108 636 Q(xists,)-.15 E F1(mbedit)2.5 E F0(creates one.)2.5 E 1.134
-(If a user seeks to open a sw)108 660 R 1.133
-(ath sonar data \214le and an associated edit sa)-.1 F 1.433 -.15
-(ve \214)-.2 H 1.133(le already e).15 F 1.133(xists, the user is)-.15 F
-(gi)108 672 Q -.15(ve)-.25 G 2.528(na).15 G 2.528(no)-2.528 G .028
-(ption to apply the sa)-2.528 F -.15(ve)-.2 G 2.528(de).15 G .028
-(dits to the data as it is loaded.)-2.528 F .029
-(If the user chooses not to apply the sa)5.028 F -.15(ve)-.2 G(d).15 E
-.277(edits, those edits will be lost as a ne)108 684 R 2.777(we)-.25 G
-.277(dit sa)-2.777 F .577 -.15(ve \214)-.2 H .277(le is created.).15 F
-.276(If \(as is usually the case\) the sa)5.276 F -.15(ve)-.2 G 2.776
-(de).15 G .276(dits are)-2.776 F .625(to be applied,)108 696 R F1
-(MBedit)3.125 E F0 .625(copies the edit sa)3.125 F .925 -.15(ve \214)-.2
-H .626(le to a \214le named "mbedit_tmp.esf" and reads the sa).15 F -.15
-(ve)-.2 G 3.126(de).15 G(dits)-3.126 E .216
-(from that second \214le. In this w)108 708 R(ay)-.1 E 2.715(,t)-.65 G
-.215(he use of edit sa)-2.715 F .515 -.15(ve \214)-.2 H .215(les and).15
-F F1(mbpr)2.715 E(ocess)-.18 E F0(allo)2.715 E .215
-(ws users to edit a sw)-.25 F .215(ath data)-.1 F .292(\214le multiple \
-times without generating multiple output \214les. Subsequent editing se\
-ssions serv)108 720 R 2.792(et)-.15 G 2.793(ou)-2.792 G .293(pdate the)
--2.793 F(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(2)
-204.835 E 0 Cg EP
-%%Page: 3 3
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 160.39(mbedit\(1\) MB-System)72 48 R 160.39
-(5.0 mbedit\(1\))2.5 F
-(processed data rather than generate additional edited data \214les.)108
-84 Q/F1 10.95/Times-Bold at 0 SF -.548(AU)72 112.8 S(THORSHIP).548 E F0(Da)
-108 124.8 Q(vid W)-.2 E 2.5(.C)-.92 G(aress \(caress at mbari.or)-2.5 E
-(g\))-.18 E(Montere)113 136.8 Q 2.5(yB)-.15 G
-(ay Aquarium Research Institute)-2.5 E
-(Dale N. Chayes \(dale at ldeo.columbia.edu\))108 148.8 Q
-(Lamont-Doherty Earth Observ)113 160.8 Q(atory)-.25 E F1(OPTIONS)72
-189.6 Q/F2 10/Times-Bold at 0 SF<ad42>108 201.6 Q/F3 10/Times-Italic at 0 SF
-(yr/mo/da/hr/mn/sc)23.63 E F0 .614(Sets the starting time for data allo)
-144 213.6 R .614
-(wed in the input data; pings with times before the starting time)-.25 F
-(will be ignored.)144 225.6 Q(Def)5 E(ault:)-.1 E F3(yr/mo/da/hr/mn/sc)
-2.5 E F0 2.5(=1)2.5 G(962/2/21/10/30/0.)-2.5 E F2<ad44>108 242.4 Q F0
-.883(Starts up the program in "bro)23.08 F .883
-(wse" mode. If a \214le is opened in bro)-.25 F .884
-(wse mode \(either at startup or)-.25 F .571
-(later\), none of the edited data will be output to a \214le. The def)
-144 254.4 R .57(ault is to output the edited data to a)-.1 F(\214le.)144
-266.4 Q F2<ad45>108 283.2 Q F3(yr/mo/da/hr/mn/sc)23.63 E F0 .286
-(Sets the ending time for data allo)144 295.2 R .287
-(wed in the input data; pings with times after the ending time will)-.25
-F(be ignored.)144 307.2 Q(Def)5 E(ault:)-.1 E F3(yr/mo/da/hr/mn/sc)2.5 E
-F0 2.5(=2)2.5 G(062/2/21/10/30/0.)-2.5 E F2<ad46>108 324 Q F3(format)
-24.19 E F0 1.018(Sets the format at startup for the input and output sw)
-144 336 R 1.018(ath sonar data using)-.1 F F2(MBIO)3.518 E F0(inte)3.518
-E 1.018(ger format)-.15 F .974(identi\214ers. This v)144 348 R .974
-(alue can also be set interacti)-.25 F -.15(ve)-.25 G .974
-(ly when specifying the input \214le.).15 F .975(This program)5.975 F
-.992(uses the)144 360 R F2(MBIO)3.492 E F0 .991
-(library and will read an)3.492 F 3.491(ys)-.15 G -.1(wa)-3.491 G .991
-(th sonar format supported by).1 F F2(MBIO)3.491 E F0 3.491(.Al)C .991
-(ist of the)-3.491 F(sw)144 372 Q .694
-(ath sonar data formats currently supported by)-.1 F F2(MBIO)3.194 E F0
-.694(and their identi\214er v)3.194 F .694(alues is gi)-.25 F -.15(ve)
--.25 G 3.194(ni).15 G 3.194(nt)-3.194 G(he)-3.194 E F2(MBIO)144 384 Q F0
-(manual page.)2.5 E(Def)5 E(ault:)-.1 E F3(format)2.5 E F0 2.5(=1)2.5 G
-(1.)-2.5 E F2<ad47>108 400.8 Q F0 .179
-(This \215ag causes the program to treat the)22.52 F F2(Done)2.678 E F0
--.2(bu)2.678 G .178(tton as equi).2 F -.25(va)-.25 G .178(lent to the)
-.25 F F2(Quit)2.678 E F0 -.2(bu)2.678 G .178(tton. This option).2 F
-1.024(is used when)144 412.8 R F2(MBedit)3.524 E F0 1.025(is started au\
-tomatically by some other process and only a single \214le is to)3.524 F
-(edited.)144 424.8 Q F2<ad48>108 441.6 Q F0 .162(This "help" \215ag cau\
-se the program to print out a description of its operation and then e)
-22.52 F .161(xit immedi-)-.15 F(ately)144 453.6 Q(.)-.65 E F2<ad49>108
-470.4 Q F3(in\214le)26.41 E F0 .01(Sets the data \214le from which the \
-input data will be read at startup.)144 482.4 R .01
-(This option is usually used only)5.01 F(when)144 494.4 Q F2(MBedit)
-3.973 E F0 1.473(is started automatically from some other process. The)
-3.973 F F2<ad46>3.973 E F0 1.472(option should also be)3.973 F .696
-(used to set the data format id. If the)144 506.4 R F2<ad42>3.196 E F0
-.696(option is not used to specify bro)3.196 F .696
-(wse mode, then the edit)-.25 F(sa)144 518.4 Q .3 -.15(ve o)-.2 H
-(utput \214le is automatically set as).15 E F3(in\214le)2.5 E F0
-(with ".esf" appended.)2.5 E F2<ad58>108 535.2 Q F0 .773
-(This option causes)23.08 F F2(mbpr)3.273 E(ocess)-.18 E F0 .773
-(to run automatically on an input sw)3.273 F .772
-(ath data \214le when the)-.1 F F2(mbedit)3.272 E F0 1.079
-(editing session is completed. The)144 547.2 R F2<ad58>3.579 E F0 1.079
-(option ef)3.579 F(fecti)-.25 E -.15(ve)-.25 G 1.079
-(ly means that the corresponding processed).15 F(sw)144 559.2 Q .787
-(ath data is generated or updated immediately)-.1 F 5.787(.T)-.65 G .787
-(he program)-5.787 F F2(mbpr)3.287 E(ocess)-.18 E F0 .787
-(will not be in)3.287 F -.2(vo)-.4 G -.1(ke).2 G 3.287(di).1 G(f)-3.287
-E(the editing session is in the bro)144 571.2 Q(wse mode.)-.25 E F2
-<ad56>108 588 Q F0(Normally)23.08 E(,)-.65 E F2(MBedit)4.904 E F0 2.404
-(outputs information to the stderr stream re)4.904 F -.05(ga)-.15 G
-2.404(rding the number of records).05 F .363(loaded and dumped.)144 600
-R .363(If the)5.363 F F2<ad56>2.863 E F0 .363(\215ag is gi)2.863 F -.15
-(ve)-.25 G .363(n, then).15 F F2(MBedit)2.863 E F0 -.1(wo)2.863 G .363
-(rks in a "v).1 F .363(erbose" mode and outputs)-.15 F .186
-(the program v)144 612 R .186
-(ersion being used, all error status messages, and a lar)-.15 F .186
-(ge amount of other information)-.18 F
-(including all of the beams \215agged or zeroed.)144 624 Q F1(INTERA)72
-652.8 Q(CTIVE CONTR)-.602 E(OLS)-.329 E F2(File)108 664.8 Q F0(This b)
-19.89 E(utton accesses a pulldo)-.2 E(wn menu with tw)-.25 E 2.5(op)-.1
-G(ush b)-2.5 E(uttons:)-.2 E F2(Open)2.5 E F0(and)2.5 E F2
-(File Selection List)2.5 E F0(,)A F2(File->Open)108 681.6 Q F0 .615
-(This b)144 693.6 R .615(utton brings up a popup windo)-.2 F 3.115(ww)
--.25 G .615(hich allo)-3.115 F .615(ws the user to specify an input sw)
--.25 F .614(ath sonar ba-)-.1 F(th)144 705.6 Q 1.7
-(ymetry data \214le, its)-.05 F F2(MBIO)4.2 E F0 1.701(format id, and)
-4.2 F 1.701(the output mode.)6.701 F 1.701(This program uses the)6.701 F
-F2(MBIO)4.201 E F0 1.292(library and will read or write an)144 717.6 R
-3.792(ys)-.15 G -.1(wa)-3.792 G 1.292(th sonar format supported by).1 F
-F2(MBIO)3.792 E F0 3.792(.A)C 1.291(list of the sw)-.001 F(ath)-.1 E .39
-(sonar data formats currently supported by)144 729.6 R F2(MBIO)2.891 E
-F0 .391(and their identi\214er v)2.891 F .391(alues is gi)-.25 F -.15
-(ve)-.25 G 2.891(ni).15 G 2.891(nt)-2.891 G(he)-2.891 E F2(MBIO)2.891 E
-F0(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(3)204.835 E 0
-Cg EP
-%%Page: 4 4
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 160.39(mbedit\(1\) MB-System)72 48 R 160.39
-(5.0 mbedit\(1\))2.5 F .682(manual page.)144 84 R .682(If the sw)5.682 F
-.681(ath sonar data \214le is named using the)-.1 F/F1 10/Times-Bold at 0
-SF(MB-System)3.181 E F0(suf)3.181 E .681(\214x con)-.25 F -.15(ve)-.4 G
-.681(ntion \(for).15 F(-)-.2 E .162(mat 11 \214les end with ".mb11", fo\
-rmat 41 \214les end with ".mb41", etc.\), then the program will auto-)
-144 96 R .552(matically use the appropriate format id; otherwise the fo\
-rmat must be set by the user)144 108 R 5.551(.T)-.55 G .551(he popup)
--5.551 F(windo)144 120 Q 2.692(wa)-.25 G .192(lso allo)-2.692 F .193
-(ws the output mode to be set to "bro)-.25 F .193
-(wse" so that no edit e)-.25 F -.15(ve)-.25 G .193(nts are output.).15 F
-(When)5.193 E 2.903(av)144 132 S .403
-(alid \214le is speci\214ed and the)-3.153 F F1(OK)2.903 E F0 -.2(bu)
-2.903 G .403(tton is click).2 F .403
-(ed, \214le will be added to an internal list of sw)-.1 F(ath)-.1 E .447
-(\214les a)144 144 R -.25(va)-.2 G .447(ilable for editing, and then th\
-at \214le will be loaded into memory for editing \(if another \214le).25
-F -.1(wa)144 156 S 2.683(sa).1 G .183
-(lready loaded, that \214le is closed out gracefully before the ne)
--2.683 F 2.682<778c>-.25 G .182(le is loaded\).)-2.682 F .182
-(If the speci\214ed)5.182 F 1.329(input is a datalist \(format id = \
-\2551\), then all of the \214les referenced through that datalist will \
-be)144 168 R .084(added to the internal list, and the \214rst of those \
-\214les loaded. When a \214le is loaded for editing,)144 180 R F1(MBe-)
-2.584 E(dit)144 192 Q F0 .75
-(reads as much data as will \214t into the data b)3.25 F(uf)-.2 E .75
-(fer \(typically 25000 records\) and se)-.25 F -.15(ve)-.25 G .75
-(ral pings).15 F(are displayed as stack)144 204 Q(ed bath)-.1 E
-(ymetry pro\214les.)-.05 E F1(File->File Selection List)108 220.8 Q F0
-.37(This b)144 232.8 R .37(utton brings up a popup windo)-.2 F 2.869(wd)
--.25 G .369(isplaying the internal list of sw)-2.869 F .369
-(ath \214les a)-.1 F -.25(va)-.2 G .369(ilable for edit-).25 F .069
-(ing. The list has four columns.)144 244.8 R .069
-(The \214rst \(left-most\) column is either blank or sho)5.069 F .07
-(ws "<lock)-.25 F .07(ed>" or)-.1 F 3.73("<loaded>". If)144 256.8 R 3.73
-<618c>3.73 G 1.23(le is loaded for editing by this program, it sho)-3.73
-F 1.229(ws as "<loaded>".)-.25 F 1.229(If a \214le is)6.229 F 1.458
-(being edited or processed by another program, it sho)144 268.8 R 1.458
-(ws as "<lock)-.25 F 1.458(ed>". Lock)-.1 F 1.458(ed \214les cannot be)
--.1 F .494(opened for editing, and an)144 280.8 R 2.994<798c>-.15 G .494
-(le loaded for editing by)-2.994 F F1(MBedit)2.993 E F0 .493(will sho)
-2.993 F 2.993(wa)-.25 G 2.993(s")-2.993 G(lock)-2.993 E .493
-(ed" to other pro-)-.1 F .141
-(grams. The second column is either blank or sho)144 292.8 R .141
-(ws "<esf>". This indicates if a \214le has been pre)-.25 F(vi-)-.25 E
-1.053(ously edited so that an edit sa)144 304.8 R 1.353 -.15(ve \214)-.2
-H 1.053(le already e).15 F 1.053
-(xists. The third and fourth columns sho)-.15 F 3.553(wt)-.25 G 1.052
-(he \214le-)-3.553 F .249(name path and the)144 316.8 R F1(MBIO)2.749 E
-F0 .249(format id, respecti)2.749 F -.15(ve)-.25 G(ly).15 E 5.249(.U)
--.65 G .25(sers can select one of the \214les in the a)-5.249 F -.25(va)
--.2 G(ilable).25 E .824(list. If the "Edit Selected File" b)144 328.8 R
-.824(utton is click)-.2 F .824
-(ed, the selected \214le will be opened for editing \(and)-.1 F(an)144
-340.8 Q 2.964<798c>-.15 G .464
-(le already loaded will be closed \214rst\). If the "Remo)-2.964 F .765
--.15(ve S)-.15 H .465(elected File" b).15 F .465
-(utton is selected, then)-.2 F(the selected \214le will be remo)144
-352.8 Q -.15(ve)-.15 G 2.5(df).15 G(rom the a)-2.5 E -.25(va)-.2 G
-(ilable list.).25 E F1 -.37(Vi)108 369.6 S(ew).37 E F0 .792(This b)14.71
-F .792(utton accesses a pulldo)-.2 F .792(wn menu with se)-.25 F -.15
-(ve)-.25 G .792(ral toggle b).15 F(uttons:)-.2 E F1 -.65(Wa)3.291 G .791
-(terfall V).65 F(iew)-.37 E F0(,)A F1(Alongtrack)3.291 E -.37(Vi)144
-381.6 S(ew).37 E F0(,)A F1(Acr)3.512 E 1.012(osstrack V)-.18 F(iew)-.37
-E F0(,)A F1(Sho)3.512 E 3.513(wF)-.1 G 1.013(lagged Pr)-3.513 F(o\214le)
--.18 E F0(,)A F1(Sho)3.513 E 3.513(wB)-.1 G 1.013
-(ottom Detect Algorithms)-3.513 F F0(,)A F1 -.18(Wi)3.513 G 1.013
-(de Ba-).18 F(th)144 393.6 Q .676(ymetry Pr)-.15 F(o\214les)-.18 E F0(,)
-A F1 .676(Plot T)3.176 F .676(ime Stamps)-.18 F F0(,)A F1 .676
-(Plot Ping Inter)3.176 F -.1(va)-.1 G(l).1 E F0(,)A F1 .676
-(Plot Longitude)3.176 F F0(,)A F1 .675(Plot Latitude)3.176 F F0(,)A F1
-(Plot)3.175 E(Heading)144 405.6 Q F0(,)A F1 .847(Plot Speed)3.346 F F0
-(,)A F1 .847(Plot Center Beam Depth)3.347 F F0(,)A F1 .847
-(Plot Sonar Altitude)3.347 F F0(,)A F1 .847(Plot Sonar Depth)3.347 F F0
-(,)A F1(Plot)3.347 E(Roll)144 417.6 Q F0(,)A F1(Plot Pitch)2.5 E F0 2.5
-(,a)C(nd)-2.5 E F1(Plot Hea)2.5 E -.1(ve)-.25 G F0(.).1 E 1.24
-(The \214rst three toggle b)144 429.6 R 1.24(uttons set the vie)-.2 F
-3.74(wm)-.25 G 1.24(ode, which may be a w)-3.74 F(aterf)-.1 E 1.24
-(all vie)-.1 F 2.54 -.65(w, a)-.25 H 3.74(na).65 G(longtrack)-3.74 E
-(vie)144 441.6 Q 2.061 -.65(w, o)-.25 H 3.261(ra).65 G 3.261(na)-3.261 G
-.761(crosstrack vie)-3.261 F 2.061 -.65(w. T)-.25 H .761(he ne).65 F
-.761(xt tw)-.15 F 3.261(ot)-.1 G .761(oggle b)-3.261 F .762
-(uttons set simple display options and may be)-.2 F .825
-(set or unset indi)144 453.6 R(vidually)-.25 E 5.825(.T)-.65 G .825
-(he remaining toggle b)-5.825 F .825
-(uttons control the display plot modes; only one)-.2 F
-(mode and therefore one of these toggle b)144 465.6 Q
-(uttons may be set at an)-.2 E 2.5(yt)-.15 G(ime.)-2.5 E F1 -.37(Vi)108
-482.4 S(ew->W).37 E(aterfall V)-.65 E(iew)-.37 E F0 .186(Sets the)144
-494.4 R F1(mbedit)2.686 E F0 .186(display so that the bath)2.686 F .187
-(ymetry acrosstrack pro\214les are plotted with v)-.05 F .187
-(ertical of)-.15 F(fsets)-.25 E(between each pro\214le \(in w)144 506.4
-Q(aterf)-.1 E(all f)-.1 E(ashion\).)-.1 E F1 -.37(Vi)108 523.2 S
-(ew->Alongtrack V).37 E(iew)-.37 E F0 .97(Sets the)144 535.2 R F1
-(mbedit)3.47 E F0 .97(display so that the bath)3.47 F .97
-(ymetry acrosstrack pro\214les are vie)-.05 F .97(wed in the alongtrack)
--.25 F(direction without v)144 547.2 Q(ertical of)-.15 E
-(fsets between the pings.)-.25 E F1 -.37(Vi)108 564 S(ew->Acr).37 E
-(osstrack V)-.18 E(iew)-.37 E F0 .772(Sets the)144 576 R F1(mbedit)3.272
-E F0 .772(display so that the bath)3.272 F .772
-(ymetry acrosstrack pro\214les are vie)-.05 F .773
-(wed in the acrosstrack)-.25 F(direction without v)144 588 Q(ertical of)
--.15 E(fsets between the pings.)-.25 E F1 -.37(Vi)108 604.8 S(ew->Sho)
-.37 E 2.5(wF)-.1 G(lagged Pr)-2.5 E(o\214le)-.18 E F0 .177
-(This toggle allo)144 616.8 R .177
-(ws the user to specify whether the acrosstrack bath)-.25 F .176
-(ymetry pro\214le includes only the)-.05 F 1.907
-(un\215agged or "good" bath)144 628.8 R 1.907
-(ymetry \(toggle set to "Of)-.05 F 1.907
-(f"\) or whether the pro\214le also includes the)-.25 F 1.124
-(\215agged or "bad" bath)144 640.8 R 1.123
-(ymetry \(toggle set to "On"\). In the latter case, red line se)-.05 F
-1.123(gments sho)-.15 F 3.623(wt)-.25 G(he)-3.623 E
-(portion of the pro\214le associated with the \215agged depth points.)
-144 652.8 Q F1 -.37(Vi)108 669.6 S(ew->Sho).37 E 2.5(wB)-.1 G
-(ottom Detect Algorithms)-2.5 E F0 .921(This toggle allo)144 681.6 R
-.921(ws the user to specify whether the beams are colored according to \
-their \215agging)-.25 F .07(status \(toggle set to "Of)144 693.6 R .07(\
-f" or according to the bottom detect algorithm used by the sonar \(togg\
-le set)-.25 F .371(to "On"\). The def)144 705.6 R .372(ault is to color\
- each sounding according to its \215agging status \255 un\215agged beam\
-s)-.1 F .001(are black, manually \215agged beams are red, and \214lter \
-\215agged beams are green. If the beams are col-)144 717.6 R 2.088(ored\
- according to bottom detect algorithm, then amplitude detects are sho)
-144 729.6 R 2.088(wn in black, phase)-.25 F(MB-System 5.0)72 768 Q 2.5
-(3J)146.495 G(une 2013)-2.5 E(4)204.835 E 0 Cg EP
-%%Page: 5 5
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 160.39(mbedit\(1\) MB-System)72 48 R 160.39
-(5.0 mbedit\(1\))2.5 F 1.438(detects are sho)144 84 R 1.437
-(wn in red, and beams for which the bottom detection algorithm is unkno)
--.25 F 1.437(wn are)-.25 F(sho)144 96 Q .165
-(wn in green. Users should be a)-.25 F -.1(wa)-.15 G .166(re that man).1
-F 2.666(ys)-.15 G -.1(wa)-2.666 G .166
-(th data formats do not include bottom detec-).1 F
-(tion algorithm information.)144 108 Q/F1 10/Times-Bold at 0 SF -.37(Vi)108
-124.8 S(ew->W).37 E(ide Bath)-.18 E(ymetry Pr)-.15 E(o\214les)-.18 E F0
-.794(This toggle, when set, causes)144 136.8 R F1(mbedit)3.294 E F0 .794
-(to display the widest possible plots of the bath)3.294 F .794
-(ymetry pro-)-.05 F 1.287
-(\214les. All of the other options discussed immediately belo)144 148.8
-R 3.787(wn)-.25 G(arro)-3.787 E 3.787(wt)-.25 G 1.288
-(he primary plot in order to)-3.787 F
-(present additional information on the left side of the windo)144 160.8
-Q -.65(w.)-.25 G F1 -.37(Vi)108 177.6 S(ew->Plot T).37 E(ime Stamps)-.18
-E F0 .137(This toggle, when set, causes)144 189.6 R F1(mbedit)2.637 E F0
-.137(to display time stamp information to the left of the bath)2.637 F
-(yme-)-.05 E(try pro\214les.)144 201.6 Q F1 -.37(Vi)108 218.4 S
-(ew->Plot Ping Inter).37 E -.1(va)-.1 G(l).1 E F0 .135
-(This toggle, when set, causes)144 230.4 R F1(mbedit)2.635 E F0 .135
-(to display an automatically scaled v)2.635 F .136
-(ertical time series plot of)-.15 F(the time between pings.)144 242.4 Q
-(This plot appears to the left of the bath)146.5 254.4 Q
-(ymetry pro\214les.)-.05 E F1 -.37(Vi)108 271.2 S(ew->Plot Longitude).37
-E F0 .136(This toggle, when set, causes)144 283.2 R F1(mbedit)2.636 E F0
-.135(to display an automatically scaled v)2.635 F .135
-(ertical time series plot of)-.15 F(the na)144 295.2 Q(vig)-.2 E
-(ation longitude associated with each ping.)-.05 E
-(This plot appears to the left of the bath)146.5 307.2 Q
-(ymetry pro\214les.)-.05 E F1 -.37(Vi)108 324 S(ew->Plot Latitude).37 E
-F0 .135(This toggle, when set, causes)144 336 R F1(mbedit)2.635 E F0
-.135(to display an automatically scaled v)2.635 F .136
-(ertical time series plot of)-.15 F(the na)144 348 Q(vig)-.2 E
-(ation latitude associated with each ping.)-.05 E
-(This plot appears to the left of the bath)146.5 360 Q
-(ymetry pro\214les.)-.05 E F1 -.37(Vi)108 376.8 S(ew->Plot Heading).37 E
-F0 .136(This toggle, when set, causes)144 388.8 R F1(mbedit)2.636 E F0
-.135(to display an automatically scaled v)2.635 F .135
-(ertical time series plot of)-.15 F
-(the heading associated with each ping.)144 400.8 Q
-(This plot appears to the left of the bath)146.5 412.8 Q
-(ymetry pro\214les.)-.05 E F1 -.37(Vi)108 429.6 S(ew->Plot Speed).37 E
-F0 .135(This toggle, when set, causes)144 441.6 R F1(mbedit)2.635 E F0
-.135(to display an automatically scaled v)2.635 F .136
-(ertical time series plot of)-.15 F
-(the speed associated with each ping.)144 453.6 Q
-(This plot appears to the left of the bath)146.5 465.6 Q
-(ymetry pro\214les.)-.05 E F1 -.37(Vi)108 482.4 S
-(ew->Plot Center Beam Depth).37 E F0 .136(This toggle, when set, causes)
-144 494.4 R F1(mbedit)2.636 E F0 .135
-(to display an automatically scaled v)2.635 F .135
-(ertical time series plot of)-.15 F
-(the speed associated with each ping.)144 506.4 Q
-(This plot appears to the left of the bath)146.5 518.4 Q
-(ymetry pro\214les.)-.05 E F1 -.37(Vi)108 535.2 S(ew->Plot Sonar Depth)
-.37 E F0 .135(This toggle, when set, causes)144 547.2 R F1(mbedit)2.635
-E F0 .135(to display an automatically scaled v)2.635 F .136
-(ertical time series plot of)-.15 F
-(the sonar depth associated with each ping.)144 559.2 Q
-(This plot appears to the left of the bath)146.5 571.2 Q
-(ymetry pro\214les.)-.05 E F1 -.37(Vi)108 588 S(ew->Plot Sonar Altitude)
-.37 E F0 .136(This toggle, when set, causes)144 600 R F1(mbedit)2.636 E
-F0 .135(to display an automatically scaled v)2.635 F .135
-(ertical time series plot of)-.15 F
-(the sonar altitude associated with each ping.)144 612 Q
-(This plot appears to the left of the bath)146.5 624 Q
-(ymetry pro\214les.)-.05 E F1 -.37(Vi)108 640.8 S(ew->Plot Roll).37 E F0
-.135(This toggle, when set, causes)144 652.8 R F1(mbedit)2.635 E F0 .135
-(to display an automatically scaled v)2.635 F .136
-(ertical time series plot of)-.15 F .165(the roll associated with each \
-ping. In addition to the roll time series sho)144 664.8 R .164
-(wn in black, an estimate of)-.25 F 1.455
-(the acrosstrack sea\215oor slope is sho)144 676.8 R 1.455
-(wn in red \(calculated by linear re)-.25 F 1.455
-(gression of the un\215agged)-.15 F .342
-(soundings for each ping\), and the dif)144 688.8 R .342
-(ference between the roll and apparent slope is sho)-.25 F .341
-(wn in blue.)-.25 F .832(If the sonar roll has been correctly applied, \
-the roll and sea\215oor slope should be uncorrelated. If)144 700.8 R .05
-(there is a timing error in the roll correction, then the apparent sea\
-\215oor slope may correlate strongly)144 712.8 R(with the roll.)144
-724.8 Q(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(5)
-204.835 E 0 Cg EP
-%%Page: 6 6
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 160.39(mbedit\(1\) MB-System)72 48 R 160.39
-(5.0 mbedit\(1\))2.5 F(This plot appears to the left of the bath)146.5
-84 Q(ymetry pro\214les.)-.05 E/F1 10/Times-Bold at 0 SF -.37(Vi)108 100.8 S
-(ew->Plot Pitch).37 E F0 .135(This toggle, when set, causes)144 112.8 R
-F1(mbedit)2.635 E F0 .135(to display an automatically scaled v)2.635 F
-.136(ertical time series plot of)-.15 F
-(the pitch associated with each ping.)144 124.8 Q
-(This plot appears to the left of the bath)146.5 136.8 Q
-(ymetry pro\214les.)-.05 E F1 -.37(Vi)108 153.6 S(ew->Plot Hea).37 E -.1
-(ve)-.25 G F0 .136(This toggle, when set, causes)144 165.6 R F1(mbedit)
-2.636 E F0 .135(to display an automatically scaled v)2.635 F .135
-(ertical time series plot of)-.15 F(the hea)144 177.6 Q .3 -.15(ve a)-.2
-H(ssociated with each ping.).15 E
-(This plot appears to the left of the bath)146.5 189.6 Q
-(ymetry pro\214les.)-.05 E F1(Contr)108 206.4 Q(ols)-.18 E F0 1.65
-(This b)144 218.4 R 1.65(utton accesses a pulldo)-.2 F 1.651
-(wn menu with six items:)-.25 F F1 1.651(Go T)4.151 F 4.151(oS)-.92 G
-1.651(peci\214ed T)-4.151 F(ime...)-.18 E F0(,)A F1 1.651(Buffer Con-)
-4.151 F(tr)144 230.4 Q(ols...)-.18 E F0(,)A F1(Annotation...)2.884 E F0
-(,)A F1(Filters...)2.884 E F0(,)A F1(Re)2.884 E -.1(ve)-.15 G .384
-(rse Right/Left K).1 F .384(ey Macr)-.25 F(os)-.18 E F0 2.884(,a)C(nd)
--2.884 E F1(Re)2.884 E -.1(ve)-.15 G .384(rse Mouse Buttons).1 F F0(.)A
-.556(The \214rst \(top\) four items bring up a dialog of the same name.\
- These dialogs are discussed belo)144 242.4 R -.65(w.)-.25 G
-(The last tw)144 254.4 Q 2.5(oi)-.1 G(tems are toggle b)-2.5 E
-(uttons which set mouse b)-.2 E(utton and k)-.2 E .3 -.15(ey m)-.1 H
-(acro beha).15 E(viors.)-.2 E F1(Contr)108 271.2 Q(ols->Go T)-.18 E 2.5
-(oS)-.92 G(peci\214ed T)-2.5 E(ime...)-.18 E F0 .2
-(This menu item brings up a dialog which allo)144 283.2 R .199
-(ws the user to specify the time of a particular ping to)-.25 F .13
-(be displayed.)144 295.2 R .13(Once the year)5.13 F 2.63(,m)-.4 G .13
-(onth, day)-2.63 F 2.63(,h)-.65 G(our)-2.63 E 2.63(,m)-.4 G .13
-(inute, and second v)-2.63 F .13(alues are entered, clicking the)-.25 F
-F1 -.25(Ap)144 307.2 S(ply).25 E F0 -.2(bu)3.746 G 1.246(tton causes).2
-F F1(mbedit)3.746 E F0 1.245(to seek the speci\214ed tar)3.746 F 1.245
-(get time.)-.18 F 1.245(If the current data b)6.245 F(uf)-.2 E 1.245
-(fer be)-.25 F(gins)-.15 E .281(after the tar)144 319.2 R .281
-(get time, an error is returned.)-.18 F .281(If the tar)5.281 F .282
-(get time is later than the end of the current data)-.18 F -.2(bu)144
-331.2 S -.25(ff).2 G(er).25 E 2.518(,t)-.4 G(hen)-2.518 E F1(mbedit)
-2.518 E F0 .018(will dump and load b)2.518 F(uf)-.2 E .018
-(fers until the tar)-.25 F .018
-(get time is reached or the data \214le ends.)-.18 F(If the end of the \
-\214le is reached during the search, the \214le will be closed.)144
-343.2 Q F1(Contr)108 360 Q(ols->Buffer Contr)-.18 E(ols...)-.18 E F0
-.837(This menu item brings up a dialog which allo)144 372 R .838
-(ws the user to set the data b)-.25 F(uf)-.2 E .838
-(fer handling through)-.25 F(tw)144 384 Q 2.5(os)-.1 G
-(liders discussed immediately belo)-2.5 E -.65(w.)-.25 G F1(Contr)108
-400.8 Q(ols->Buffer Contr)-.18 E(ols->Data Buffer Size)-.18 E F0 .1
-(This slider on the)144 412.8 R F1 .1(Buffer Contr)2.6 F(ols)-.18 E F0
-.1(dialog sets the number of data records which can be held in the)2.6 F
-(data b)144 424.8 Q(uf)-.2 E(fer)-.25 E 5(.A)-.55 G .3 -.15(ny c)-5 H
-(hange becomes ef).15 E(fecti)-.25 E .3 -.15(ve t)-.25 H(he ne).15 E
-(xt time that a data \214le is read in.)-.15 E F1(Contr)108 441.6 Q
-(ols->Buffer Contr)-.18 E(ols->Buffer Retain Size)-.18 E F0 .597
-(This slider on the)144 453.6 R F1 .597(Buffer Contr)3.097 F(ols)-.18 E
-F0 .598(dialog sets the number of data records which are held o)3.097 F
--.15(ve)-.15 G 3.098(ri).15 G(n)-3.098 E(the b)144 465.6 Q(uf)-.2 E
-(fer each time the old b)-.25 E(uf)-.2 E(fer is written out.)-.25 E F1
-(Contr)108 482.4 Q(ols->Annotation...)-.18 E F0 1.218
-(This menu item brings up a dialog which allo)144 494.4 R 1.217
-(ws the user to set the annotation interv)-.25 F 1.217(als for the)-.25
-F(across track distance and depth ax)144 506.4 Q(es through the tw)-.15
-E 2.5(os)-.1 G(liders discussed immediately belo)-2.5 E -.65(w.)-.25 G
-F1(Contr)108 523.2 Q(ols->Annotation->X Axis T)-.18 E(ick Inter)-.18 E
--.1(va)-.1 G(l).1 E F0 .565(This slider on the)144 535.2 R F1
-(Annotation)3.066 E F0 .566(dialog sets the tick interv)3.066 F .566
-(al in m for the across track distance axis.)-.25 F .723
-(If a particular v)144 547.2 R .723
-(alue is desired which cannot be obtained by dragging the slider)-.25 F
-3.223(,t)-.4 G .723(he slider can be)-3.223 F .805
-(changed by increments of 1 by clicking with the left b)144 559.2 R .806
-(utton inside the slider area, b)-.2 F .806(ut not on the)-.2 F
-(slider itself.)144 571.2 Q F1(Contr)108 588 Q
-(ols->Annotation->Y Axis T)-.18 E(ick Inter)-.18 E -.1(va)-.1 G(l).1 E
-F0 .597(This slider on the)144 600 R F1(Annotation)3.096 E F0 .596
-(dialog sets the tick interv)3.096 F .596(al in m for the depth axis.)
--.25 F .596(If a particular)5.596 F -.25(va)144 612 S 1.305
-(lue is desired which cannot be obtained by dragging the slider).25 F
-3.806(,t)-.4 G 1.306(he slider can be changed by)-3.806 F
-(increments of 1 by clicking with the left b)144 624 Q
-(utton inside the slider area, b)-.2 E(ut not on the slider itself.)-.2
-E F1(Contr)108 640.8 Q(ols->Filters)-.18 E F0 1.107
-(This menu item brings up a dialog which allo)144 652.8 R 1.106
-(ws the user to turn automatic bath)-.25 F 1.106(ymetry \214ltering)-.05
-F .806(algorithms on and of)144 664.8 R 3.306(fa)-.25 G .807(nd to set \
-the \214lter parameters through the widgets discussed immediately)-3.306
-F(belo)144 676.8 Q 5.09 -.65(w. C)-.25 H 1.29(licking on the).65 F F1
--.25(Ap)3.79 G(ply).25 E F0 -.2(bu)3.79 G 1.29(tton \214rst remo).2 F
--.15(ve)-.15 G 3.79(sa).15 G 1.59 -.15(ny p)-3.79 H(re).15 E 1.29
-(vious automatic \214lter \215ags and then)-.25 F .08
-(applies the current \214lter settings to the sw)144 688.8 R .081
-(ath bath)-.1 F .081(ymetry data. These actions are applied only from)
--.05 F 1.309
-(the current position to the end of the data currently in memory)144
-700.8 R 3.809(.T)-.65 G 1.308(he \214ltering is not applied \(or)-3.809
-F .391(unapplied\) to pings earlier in the data \214le than the current\
- position.)144 712.8 R(The)5.391 E F1(Reset)2.892 E F0 -.2(bu)2.892 G
-.392(tton restores the).2 F(\214lter settings that were applied last.)
-144 724.8 Q(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(6)
-204.835 E 0 Cg EP
-%%Page: 7 7
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 160.39(mbedit\(1\) MB-System)72 48 R 160.39
-(5.0 mbedit\(1\))2.5 F/F1 10/Times-Bold at 0 SF(Contr)108 84 Q
-(ols->Filters->Median Spik)-.18 E 2.5(eF)-.1 G(llter)-2.5 E F0 2.02
-(This toggle b)144 96 R 2.019
-(utton turns automatic median \214ltering of bath)-.2 F 2.019
-(ymetry pro\214les on and of)-.05 F 4.519(f. When)-.25 F .397(median \
-\214ltering is enabled, the median depth is calculated for each bath)144
-108 R .398(ymetry ping. Each sound-)-.05 F .187
-(ing in the ping is compared with the median v)144 120 R .187(alue; an)
--.25 F 2.687(ys)-.15 G .187(ounding that dif)-2.687 F .186
-(fers from the median by a)-.25 F(percentage greater than a threshold p\
-ercentage is \215agged as bad data.)144 132 Q F1(Contr)108 148.8 Q
-(ols->Filters->% Median Depth Thr)-.18 E(eshold)-.18 E F0 .258(This sli\
-der sets the threshold of the median depth \214lter in units of percent\
-age of the median depth.)144 160.8 R F1(Contr)108 177.6 Q
-(ols->Filters->Wr)-.18 E(ong Side Fllter)-.18 E F0 .398(This toggle b)
-144 189.6 R .397(utton turns automatic wrong side \214ltering of bath)
--.2 F .397(ymetry pro\214les on and of)-.05 F .397(f. This \214l-)-.25 F
-1.113(ter e)144 201.6 R 1.113(xpects bath)-.15 F 1.114
-(ymetry beams to be numbered from port to starboard. An)-.05 F 3.614(yb)
--.15 G 1.114(eam numbered less)-3.614 F 1.229
-(than the center beam with a positi)144 213.6 R 1.529 -.15(ve \()-.25 H
-1.228(starboard\) acrosstrack distance is considered to be on the).15 F
-2.782("wrong side", and an)144 225.6 R 5.282(yb)-.15 G 2.782
-(eam numbered higher than the center beam with a ne)-5.282 F -.05(ga)
--.15 G(ti).05 E 3.083 -.15(ve \()-.25 H(port\)).15 E 1.023
-(acrosstrack distance is similarly re)144 237.6 R -.05(ga)-.15 G 1.023
-(rded. F).05 F 1.023(or most sw)-.15 F 1.023
-(ath data, the center beam occurs near the)-.1 F(midw)144 249.6 Q 1.409
-(ay point in the beam list. This algorithm ignores apparent wrong side \
-beams close to the)-.1 F(midw)144 261.6 Q(ay beam, where close is de\
-\214ned as being within a threshold number of the midw)-.1 E(ay beam.)
--.1 E F1(Contr)108 278.4 Q(ols->Filters->Beams fr)-.18 E(om Center Thr)
--.18 E(eshold)-.18 E F0
-(This slider sets the threshold of beam locations check)144 290.4 Q
-(ed by the wrong side \214lter)-.1 E(.)-.55 E F1(Contr)108 307.2 Q
-(ols->Filters->Flag by Beam Number)-.18 E F0 .041(This toggle b)144
-319.2 R .041
-(utton turns automatic beam \215agging by beam number on and of)-.2 F
-.04(f. The \215agging is con-)-.25 F .184
-(trolled by start and end beam number v)144 331.2 R .184
-(alues \(set by the tw)-.25 F 2.684(os)-.1 G .184
-(liders discussed immediately belo)-2.684 F(w\).)-.25 E .107
-(If the start beam number is less than or equal to the end beam number)
-144 343.2 R 2.607(,t)-.4 G .106(hen all beams between and)-2.607 F 1.427
-(including the start and end are \215agged, producing a \215agged zone \
-within the sw)144 355.2 R 1.427(ath. If the start)-.1 F .874
-(beam number is greater than the end beam number)144 367.2 R 3.374(,t)
--.4 G .873(hen all beams before and including the end)-3.374 F 1.369(be\
-am are \215agged, and all beams including and after the start beam are \
-\215agged.)144 379.2 R 1.369(This produces)6.369 F
-(\215agging of both sw)144 391.2 Q(ath edges.)-.1 E F1(Contr)108 408 Q
-(ols->Filters->Start Flagging Beam Number)-.18 E F0(This slider sets th\
-e beam number at which \215agging by beam number starts.)144 420 Q F1
-(Contr)108 436.8 Q(ols->Filters->End Flagging Beam Number)-.18 E F0(Thi\
-s slider sets the beam number at which \215agging by beam number ends.)
-144 448.8 Q F1(Contr)108 465.6 Q(ols->Filters->Flag by Distance)-.18 E
-F0 .325(This toggle b)144 477.6 R .325(utton turns automatic beam \215a\
-gging by acrosstrack distance on and of)-.2 F .325(f. The \215agging)
--.25 F .072(is controlled by start and end distance v)144 489.6 R .073
-(alues \(set by the tw)-.25 F 2.573(os)-.1 G .073
-(liders discussed immediately belo)-2.573 F(w\).)-.25 E .723(If the sta\
-rt distance is less than or equal to the end distance, then all beams w\
-ith acrosstrack dis-)144 501.6 R .283(tances between the start and end \
-distances are \215agged, producing a \215agged zone within the sw)144
-513.6 R(ath.)-.1 E .641(If the start distance is greater than the end d\
-istance, then all beams with acrosstrack distance less)144 525.6 R .016
-(than the end distance are \215agged, and all beams with acrosstrack di\
-stance greater than the start dis-)144 537.6 R(tance are \215agged.)144
-549.6 Q(This produces \215agging of both sw)5 E(ath edges.)-.1 E F1
-(Contr)108 566.4 Q(ols->Filters->Start Flagging Distance)-.18 E F0(This\
- slider sets the beam number at which \215agging by acrosstrack distanc\
-e starts.)144 578.4 Q F1(Contr)108 595.2 Q
-(ols->Filters->End Flagging Distance)-.18 E F0(This slider sets the bea\
-m number at which \215agging by acrosstrack distance ends.)144 607.2 Q
-F1(Contr)108 624 Q(ols->Re)-.18 E -.1(ve)-.15 G(rse Right/Left K).1 E
-(ey Macr)-.25 E(os)-.18 E F0 .119(This toggle b)144 636 R .119
-(utton, when set, re)-.2 F -.15(ve)-.25 G .119(rses the k).15 F .419
--.15(ey m)-.1 H .119
-(acros associated with \215agging all beams to the left).15 F .344
-(or right of the last pick)144 648 R .345
-(ed beam. This means that the 'A)-.1 F .345(', 'a', 'J', and 'j' k)-1.11
-F -.15(ey)-.1 G 2.845(sw).15 G .345(ill \215ag to the right)-2.845 F
-.127(rather than to the left. Similarly)144 660 R 2.626(,t)-.65 G 2.626
-(he 'D',)-2.626 F -.5('d)2.626 G .126(', 'L).5 F .126(', and ')-.92 F
-.126(l' k)-.1 F -.15(ey)-.1 G 2.626(sw).15 G .126
-(ill \215ag to the left rather than to the)-2.626 F .955
-(right. This option allo)144 672 R .956(ws users to con)-.25 F -.15(ve)
--.4 G .956(niently handle sw).15 F .956(ath bath)-.1 F .956
-(ymetry in which the beams are)-.05 F(mistak)144 684 Q
-(enly ordered starboard to port instead of the usual port to starboard.)
--.1 E F1(Contr)108 700.8 Q(ols->Re)-.18 E -.1(ve)-.15 G
-(rse Mouse Buttons).1 E F0 .167(This toggle b)144 712.8 R .167
-(utton, when set, re)-.2 F -.15(ve)-.25 G .166
-(rses the meaning of the right and left mouse b).15 F .166
-(uttons. This option)-.2 F(is for the con)144 724.8 Q -.15(ve)-.4 G
-(nience of left-handed users.).15 E(MB-System 5.0)72 768 Q 2.5(3J)
-146.495 G(une 2013)-2.5 E(7)204.835 E 0 Cg EP
-%%Page: 8 8
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 160.39(mbedit\(1\) MB-System)72 48 R 160.39
-(5.0 mbedit\(1\))2.5 F/F1 10/Times-Bold at 0 SF(Start)108 84 Q F0 1.482
-(This b)14.34 F 1.482
-(utton causes the set of displayed pings to step backw)-.2 F 1.483
-(ard to the be)-.1 F 1.483(ginning of the current)-.15 F -.2(bu)144 96 S
--.25(ff).2 G(er).25 E 2.5(.T)-.55 G(he middle mouse b)-2.5 E
-(utton causes the same action if the 'G' or 'g' k)-.2 E .3 -.15(ey i)-.1
-H 2.5(sd).15 G -.25(ow)-2.5 G(n.).25 E F1(Re)108 112.8 Q -.1(ve)-.15 G
-(rse).1 E F0 .964(This b)144 124.8 R .963
-(utton causes the set of displayed pings to step)-.2 F/F2 10
-/Times-Italic at 0 SF(nstep)3.463 E F0 .963(pings backw)3.463 F .963
-(ard in the current b)-.1 F(uf)-.2 E(fer)-.25 E(.)-.55 E
-(The middle mouse b)144 136.8 Q(utton causes the same action.)-.2 E F1
--.25(Fo)108 153.6 S(rward).25 E F0 .122(This b)144 165.6 R .122
-(utton causes the set of displayed pings to step)-.2 F F2(nstep)2.622 E
-F0 .123(pings forw)2.622 F .123(ard in the current b)-.1 F(uf)-.2 E(fer)
--.25 E 5.123(.T)-.55 G(he)-5.123 E(right mouse b)144 177.6 Q
-(utton causes the same action.)-.2 E F1(End)108 194.4 Q F0 .549(This b)
-18.21 F .549(utton causes the set of displayed pings to step forw)-.2 F
-.548(ard to the end of the current b)-.1 F(uf)-.2 E(fer)-.25 E 3.048(.T)
--.55 G(he)-3.048 E(right mouse b)144 206.4 Q
-(utton causes the same action if the 'G' or 'g' k)-.2 E .3 -.15(ey i)-.1
-H 2.5(sd).15 G -.25(ow)-2.5 G(n.).25 E F1(Next Buffer)108 223.2 Q F0 .59
-(This b)144 235.2 R .59
-(utton causes the program to write out the data from the current b)-.2 F
-(uf)-.2 E .59(fer and then read in and)-.25 F .108(display the ne)144
-247.2 R .108(xt b)-.15 F(uf)-.2 E(fer)-.25 E 5.108(.I)-.55 G 2.608(ft)
--5.108 G .108(here is no more data to be read in after the current b)
--2.608 F(uf)-.2 E .108(fer has been writ-)-.25 F
-(ten out, then the input and output \214les are closed.)144 259.2 Q F1
-(Done | Next File)108 276 Q F0 1.203
-(When the last \214le in the list of \214les a)144 288 R -.25(va)-.2 G
-1.203(ilable for editing has been loaded, this b).25 F 1.203(utton sho)
--.2 F 1.203(ws as)-.25 F .299("Done". Otherwise, it sho)144 300 R .299
-(ws as "Ne)-.25 F .299(xt File". In either case, this b)-.15 F .298
-(utton causes the program to write)-.2 F .301(out all of the edited na)
-144 312 R(vig)-.2 E .302(ation data and then close the current \214le. \
-If the current \214le is not the last)-.05 F(one in the a)144 324 Q -.25
-(va)-.2 G(ilable list, then the ne).25 E(xt unlock)-.15 E
-(ed \214le will be loaded for editing.)-.1 E F1(Quit)108 340.8 Q F0 .625
-(This b)16.55 F .625(utton causes the program to e)-.2 F .625
-(xit gracefully)-.15 F 5.625(.I)-.65 G 3.124(fad)-5.625 G .624
-(ata \214le has been loaded, all of the edited)-3.124 F(na)144 352.8 Q
-(vig)-.2 E(ation will be written to the output \214le before e)-.05 E
-(xiting.)-.15 E F1(About)108 369.6 Q F0 1.202(This b)9.33 F 1.202
-(utton causes the program to bring up a dialog sho)-.2 F 1.202
-(wing the program')-.25 F 3.702(sn)-.55 G 1.202(ame, v)-3.702 F 1.202
-(ersion, and)-.15 F(authors.)144 381.6 Q F1(Acr)108 398.4 Q(osstrack W)
--.18 E(idth)-.18 E F0 .451
-(This slider sets the width of the plot in meters; in general this v)144
-410.4 R .451(alue should be slightly lar)-.25 F .451(ger than)-.18 F
-.443(the sw)144 422.4 R .443
-(ath width of the data being edited. If a particular v)-.1 F .444
-(alue is desired which cannot be obtained)-.25 F .109
-(by dragging the slider \(e.g., the user w)144 434.4 R .108
-(ants a plot width of 10 meters b)-.1 F .108
-(ut the slider jumps from 1 to)-.2 F .424(47\), the slider can be chang\
-ed by increments of 1 by clicking with the left b)144 446.4 R .425
-(utton inside the slider)-.2 F(area, b)144 458.4 Q
-(ut not on the slider itself.)-.2 E F1 -1(Ve)108 475.2 S
-(rtical Exageration)1 E F0 .13
-(This slider sets the depth scale in terms of v)144 487.2 R .13
-(ertical e)-.15 F 2.63(xageration. The)-.15 F .13
-(depth scale will change as the)2.63 F 1.528
-(cross track distance scale is changed to maintain the same v)144 499.2
-R 1.529(ertical e)-.15 F 4.029(xageration. If)-.15 F 4.029(ap)4.029 G
-(articular)-4.029 E -.25(va)144 511.2 S 1.306
-(lue is desired which cannot be obtained by dragging the slider).25 F
-3.805(,t)-.4 G 1.305(he slider can be changed by)-3.805 F .033
-(increments of 0.01 by clicking with the left b)144 523.2 R .033
-(utton inside the slider area, b)-.2 F .034
-(ut not on the slider itself.)-.2 F F1(Mode)108 540 Q F0 .912
-(This set of radio b)11.56 F .912(uttons allo)-.2 F .912
-(ws the user to specify the edit mode. If mode is set to)-.25 F F2 -.76
--.92(To g g)3.411 H(le).92 E F0 3.411(,t)C(hen)-3.411 E 2.986
-(clicking the left mouse b)144 552 R 2.987
-(utton will cause the nearest beam to toggle between \215agged and)-.2 F
-4.518(un\215agged. If)144 564 R 2.018(mode is set to)4.518 F F2(Pic)
-4.518 E(k)-.2 E F0 4.518(,t)C 2.017(hen clicking the left mouse b)-4.518
-F 2.017(utton will cause the nearest)-.2 F .064
-(un\215agged beam to be \215agged.)144 576 R .064(If mode is set to)
-5.064 F F2(Er)2.564 E(ase)-.15 E F0 2.564(,t)C .064
-(hen the cursor will change to an erasor and)-2.564 F(an)144 588 Q 2.835
-(yb)-.15 G .335(eam with the cursor while the left mouse b)-2.835 F .335
-(utton is held do)-.2 F .335(wn will be \215agged.)-.25 F .334
-(If mode is set)5.334 F(to)144 600 Q F2(Restor)4.23 E(e)-.37 E F0 4.23
-(,t)C 1.73(he beha)-4.23 F 1.73(vior will be the same as for)-.2 F F2
-(Er)4.231 E(ase)-.15 E F0 -.15(ex)4.231 G 1.731(cept that the af).15 F
-1.731(fected beams will be)-.25 F .163
-(un\215agged instead of \215agged. In)144 612 R F2(Gr)2.663 E(ab)-.15 E
-F0 .162(mode, a red rectangle is dra)2.663 F .162
-(wn as the mouse is dragged with)-.15 F .206(the left b)144 624 R .206
-(utton do)-.2 F .206(wn. When the b)-.25 F .206
-(utton is released, all un\215agged soundings within the rectangle are)
--.2 F(\215agged.)144 636 Q F2(Info)5.735 E F0 .735(mode acts lik)3.235 F
-3.235(ep)-.1 G .735(ick mode, e)-3.235 F .734
-(xcept that instead of \215agging the nearest sounding, the)-.15 F .764
-(program displays information about the selected ping and sounding abo)
-144 648 R 1.064 -.15(ve t)-.15 H .765(he bath).15 F .765
-(ymetry pro\214le)-.05 F 2.5(box. The)144 660 R
-(edit mode can also be set using k)2.5 E .3 -.15(ey m)-.1 H
-(acros \(see the k).15 E -.15(ey)-.1 G(board action section\):).15 E -.8
-(To)180 672 S 39.19(ggle: 'Q',).8 F('q', 'U', 'u')2.5 E 48.94
-(Pick: 'W',)180 684 R('w', 'I', 'i')2.5 E 44.51(Erase: 'E',)180 696 R
-('e', 'O', 'o')2.5 E .17(Restore: 'R',)180 708 R -.5('r)2.5 G
-(', 'P', 'p').5 E 46.73(Grab: 'Y',)180 720 R('y', '}, ']')2.5 E
-(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(8)204.835 E 0
-Cg EP
-%%Page: 9 9
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 160.39(mbedit\(1\) MB-System)72 48 R 160.39
-(5.0 mbedit\(1\))2.5 F 50.06(Info: 'T',)180 84 R -.18('t)2.5 G
-(', '{', '[').18 E/F1 10/Times-Bold at 0 SF(Un\215ag V)108 100.8 Q(iew)-.37
-E F0 1.41(This b)144 112.8 R 1.409(utton \215ags all un\215agged beams \
-among the currently displayed pings. Pings in the b)-.2 F(uf)-.2 E(fer)
--.25 E(before or after the current display are unaf)144 124.8 Q(fected.)
--.25 E F1(Un\215ag V)108 141.6 Q(iew)-.37 E F0 1.409(This b)144 153.6 R
-1.409(utton un\215ags all \215agged beams among the currently displayed\
- pings. Pings in the b)-.2 F(uf)-.2 E(fer)-.25 E
-(before or after the current display are unaf)144 165.6 Q(fected.)-.25 E
-F1(Un\215ag F)108 182.4 Q(orward)-.25 E F0 .498(This b)144 194.4 R 2.997
-(utton un\215ags)-.2 F .497(all \215agged beams among all pings from th\
-e start of the current display to the)2.997 F(end of the current data b)
-144 206.4 Q(uf)-.2 E(fer)-.25 E 2.5(.P)-.55 G
-(ings before the start of the current display are unaf)-2.5 E(fected.)
--.25 E F1(Number of pings sho)108 223.2 Q(wn)-.1 E F0
-(This slider sets the number of pings sho)144 235.2 Q(wn at a time.)-.25
-E F1(Number of pings to step)108 252 Q F0
-(This slider sets the number of pings to step when the)144 264 Q F1 -.25
-(Fo)2.5 G(rward).25 E F0(or)2.5 E F1(Re)2.5 E -.1(ve)-.15 G(rse).1 E F0
--.2(bu)2.5 G(ttons are pushed.).2 E/F2 10.95/Times-Bold at 0 SF(MOUSE A)72
-292.8 Q(CTIONS)-.602 E F1(Left Mouse Button)108 304.8 Q F0 .693
-(The left mouse b)144 316.8 R .693(utton is used to pick beams.)-.2 F
-.693(Good beams are sho)5.693 F .693(wn as \214lled black squares and)
--.25 F 1.647
-(bad \(\215agged\) beams as un\214lled red or green squares.)144 328.8 R
-1.646(The result of picking a particular beam)6.647 F .741
-(depends on the current edit mode, as set by the)144 340.8 R F1(Mode)
-3.241 E F0 -.2(bu)3.241 G .741(tton or k).2 F -.15(ey)-.1 G .742
-(board macros de\214ned belo).15 F -.65(w.)-.25 G 2.373(The last pick)
-144 352.8 R 2.373
-(ed beam \(and ping\) is remembered for use with some of the k)-.1 F
--.15(ey)-.1 G 2.372(board actions).15 F(described belo)144 364.8 Q -.65
-(w.)-.25 G F1(Middle Mouse Button)108 381.6 Q F0 1.125
-(The middle mouse b)144 393.6 R 1.125
-(utton causes the set of displayed pings to step)-.2 F/F3 10
-/Times-Italic at 0 SF(nstep)3.625 E F0 1.125(pings backw)3.625 F 1.125
-(ard in the)-.1 F 2.311(current b)144 405.6 R(uf)-.2 E(fer)-.25 E 7.311
-(.T)-.55 G 2.311(he control b)-7.311 F(utton)-.2 E F1(Re)4.811 E -.1(ve)
--.15 G(rse).1 E F0 2.31(causes the same action. If the 'G' or 'g' k)
-4.811 F 2.61 -.15(ey i)-.1 H(s).15 E
-(depressed, the display will jump to the be)144 417.6 Q
-(ginning of the current b)-.15 E(uf)-.2 E(fer)-.25 E(.)-.55 E F1
-(Right Mouse Button)108 434.4 Q F0 .193(The right mouse b)144 446.4 R
-.193(utton causes the set of displayed pings to step)-.2 F F3(nstep)
-2.694 E F0 .194(pings forw)2.694 F .194(ard in the current)-.1 F -.2(bu)
-144 458.4 S -.25(ff).2 G(er).25 E 5.279(.T)-.55 G .279(he control b)
--5.279 F(utton)-.2 E F1 -.25(Fo)2.779 G(rward).25 E F0 .279
-(causes the same action. If the 'G' or 'g' k)2.779 F .578 -.15(ey i)-.1
-H 2.778(sd).15 G .278(epressed, the)-2.778 F
-(display will jump to the end of the current b)144 470.4 Q(uf)-.2 E(fer)
--.25 E(.)-.55 E F2(KEYBO)72 499.2 Q(ARD A)-.438 E(CTIONS)-.602 E F1
-('G' or 'g')108 511.2 Q 1.52(Big J)144 523.2 R(ump:)-.15 E F0 1.52
-(Scolling forw)4.02 F 1.52(ard while pressing one of these k)-.1 F -.15
-(ey)-.1 G 4.02(sj).15 G 1.52(umps to the end of the current)-4.02 F -.2
-(bu)144 535.2 S -.25(ff).2 G(er).25 E 2.5(,a)-.4 G(nd scrolling backw)
--2.5 E(ard jumps to the be)-.1 E(ginning of the b)-.15 E(uf)-.2 E(fer)
--.25 E(.)-.55 E F1('Z', 'z', 'M', or 'm')108 552 Q .322(Bad Ping:)144
-564 R F0 .322(Pressing one of these k)2.822 F -.15(ey)-.1 G 2.822(sc).15
-G .322(auses all of the beams in the last pick)-2.822 F .321
-(ed ping to be \215agged)-.1 F(as bad.)144 576 Q F1
-('X', 'x', '<', or ',)108 592.8 Q(')-.55 E(Right:)144 604.8 Q F0 .257
-(Pressing one of these k)2.757 F -.15(ey)-.1 G 2.758(sc).15 G .258
-(auses all of the un\215agged beams in the current display to to be)
--2.758 F(\215agged as bad. This is equi)144 616.8 Q -.25(va)-.25 G
-(lent to the CFlag V).25 E(ie)-.6 E(w)-.25 E F1 -.2(bu)2.5 G(tton.).2 E
-('C', 'c', '>', or '.)108 633.6 Q(')-.55 E(Right:)144 645.6 Q F0 .814
-(Pressing one of these k)3.314 F -.15(ey)-.1 G 3.314(sc).15 G .813
-(auses all of the \215agged beams in the current display to to be)-3.314
-F(un\215agged. This is equi)144 657.6 Q -.25(va)-.25 G(lent to the).25 E
-F1(Un\215ag V)2.5 E(iew)-.37 E F0 -.2(bu)2.5 G(tton.).2 E F1('S', ')108
-674.4 Q(s', 'K', or 'k')-.37 E 1.774(Good Ping:)144 686.4 R F0 1.774
-(Pressing one of these k)4.274 F -.15(ey)-.1 G 4.274(sc).15 G 1.775
-(auses all of the beams in the last pick)-4.274 F 1.775(ed ping to be)
--.1 F(un\215agged as good.)144 698.4 Q(MB-System 5.0)72 768 Q 2.5(3J)
-146.495 G(une 2013)-2.5 E(9)204.835 E 0 Cg EP
-%%Page: 10 10
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 160.39(mbedit\(1\) MB-System)72 48 R 160.39
-(5.0 mbedit\(1\))2.5 F/F1 10/Times-Bold at 0 SF('A)108 84 Q
-(', 'a', 'J', or 'j')-.74 E(Left:)144 96 Q F0 .177
-(Pressing one of these k)2.677 F -.15(ey)-.1 G 2.677(sc).15 G .177
-(auses all of the beams including and to the left of the last pick)
--2.677 F(ed)-.1 E(beam to be \215agged as bad.)144 108 Q F1('D', ')108
-124.8 Q(d', 'L)-.2 E(', or 'l')-1.1 E(Right:)144 136.8 Q F0 1.152
-(Pressing one of these k)3.652 F -.15(ey)-.1 G 3.652(sc).15 G 1.152
-(auses all of the beams including and to the right of the last)-3.652 F
-(pick)144 148.8 Q(ed beam to be \215agged as bad.)-.1 E F1 23.51
-('!' Zer)108 165.6 R 3.459(oP)-.18 G(ing:)-3.459 E F0 .959
-(Pressing this k)3.459 F 1.258 -.15(ey c)-.1 H .958
-(auses all of the beams in the ping associated with the last pick).15 F
-(ed)-.1 E .043(beam to be zeroed. This should be used only for complete\
-ly ridiculous v)144 177.6 R .043(alues, as the v)-.25 F .043
-(alues are not)-.25 F(reco)144 189.6 Q -.15(ve)-.15 G(rable.).15 E F1
-('Q', 'q', 'U', or 'u')108 206.4 Q -.92(To)144 218.4 S .908(ggle Mode:)
-.92 F F0 .908(Pressing one of these k)3.408 F -.15(ey)-.1 G 3.408(ss).15
-G .907(ets the edit mode to "toggle" so that clicking the left)-3.408 F
-1.756(mouse b)144 230.4 R 1.756(utton will cause the nearest beam to to\
-ggle between \215agged and un\215agged.)-.2 F 1.757(The edit)6.757 F
-(mode can also be set using the)144 242.4 Q F1(Mode)2.5 E F0(toggle b)
-2.5 E(uttons.)-.2 E F1('W', 'w', 'I', or 'i')108 259.2 Q .205
-(Pick Mode:)144 271.2 R F0 .205(Pressing one of these k)2.705 F -.15(ey)
--.1 G 2.705(ss).15 G .204
-(ets the edit mode to "pick" so that clicking the left mouse)-2.705 F
--.2(bu)144 283.2 S .711
-(tton will cause the nearest un\215agged beam to be \215agged.).2 F .711
-(The edit mode can also be set using)5.711 F(the)144 295.2 Q F1(Mode)2.5
-E F0(toggle b)2.5 E(uttons.)-.2 E F1('E', 'e', 'O', or 'o')108 312 Q
-1.378(Erase Mode:)144 324 R F0 1.378(Pressing one of these k)3.878 F
--.15(ey)-.1 G 3.878(ss).15 G 1.377
-(ets the edit mode to "erase" so that clicking the left)-3.878 F .195
-(mouse b)144 336 R .195(utton will cause an)-.2 F 2.695(yb)-.15 G .195
-(eam under the cursor while the left mouse b)-2.695 F .195
-(utton is held do)-.2 F .195(wn to be)-.25 F 2.5(\215agged. The)144 348
-R(edit mode can also be set using the)2.5 E F1(Mode)2.5 E F0(toggle b)
-2.5 E(uttons.)-.2 E F1('R', ')108 364.8 Q(r', 'P', or 'p')-.2 E(Restor)
-144 376.8 Q 3.007(eM)-.18 G(ode:)-3.007 E F0 .507
-(Pressing one of these k)3.007 F -.15(ey)-.1 G 3.007(ss).15 G .506
-(ets the edit mode to "restore" so that clicking the left)-3.007 F .195
-(mouse b)144 388.8 R .195(utton will cause an)-.2 F 2.695(yb)-.15 G .195
-(eam under the cursor while the left mouse b)-2.695 F .195
-(utton is held do)-.2 F .195(wn to be)-.25 F 2.5(un\215agged. The)144
-400.8 R(edit mode can also be set using the)2.5 E F1(Mode)2.5 E F0
-(toggle b)2.5 E(uttons.)-.2 E F1('T', 't', '{', or '[')108 417.6 Q 1.443
-(Grab Mode:)144 429.6 R F0 1.443(Pressing one of these k)3.943 F -.15
-(ey)-.1 G 3.942(ss).15 G 1.442
-(ets the edit mode to "grab" so that dragging the left)-3.942 F .51
-(mouse b)144 441.6 R .51(utton will dra)-.2 F 3.01(war)-.15 G .51
-(ed rectangle. An)-3.01 F 3.01(yb)-.15 G .51
-(eams inside the rectangle when the left mouse b)-3.01 F(ut-)-.2 E(ton \
-is released will be \215agged. The edit mode can also be set using the)
-144 453.6 Q F1(Mode)2.5 E F0(toggle b)2.5 E(uttons.)-.2 E F1
-('Y', 'y', '}', or ']')108 470.4 Q(Inf)144 482.4 Q 2.842(oM)-.25 G(ode:)
--2.842 E F0 .342(Pressing one of these k)2.842 F -.15(ey)-.1 G 2.842(ss)
-.15 G .341(ets the edit mode to "info" so that clicking the left mouse)
--2.842 F -.2(bu)144 494.4 S .233
-(tton will cause information about the nearest beam to be displayed abo)
-.2 F .534 -.15(ve t)-.15 H .234(he bath).15 F .234(ymetry pro\214le)-.05
-F 2.5(box. The)144 506.4 R(edit mode can also be set using the)2.5 E F1
-(Mode)2.5 E F0(toggle b)2.5 E(uttons.)-.2 E F1('2')108 523.2 Q F0 .187
-(Sets the)24.34 F F1(mbedit)2.687 E F0 .187(display so that the bath)
-2.687 F .186(ymetry acrosstrack pro\214les are plotted with v)-.05 F
-.186(ertical of)-.15 F(fsets)-.25 E(between each pro\214le \(in w)144
-535.2 Q(aterf)-.1 E(all f)-.1 E(ashion\).)-.1 E F1('3')108 552 Q F0 .97
-(Sets the)24.34 F F1(mbedit)3.47 E F0 .97(display so that the bath)3.47
-F .97(ymetry acrosstrack pro\214les are vie)-.05 F .97
-(wed in the alongtrack)-.25 F(direction without v)144 564 Q(ertical of)
--.15 E(fsets between the pings.)-.25 E F1('4')108 580.8 Q F0 .773
-(Sets the)24.34 F F1(mbedit)3.273 E F0 .772(display so that the bath)
-3.272 F .772(ymetry acrosstrack pro\214les are vie)-.05 F .772
-(wed in the acrosstrack)-.25 F(direction without v)144 592.8 Q
-(ertical of)-.15 E(fsets between the pings.)-.25 E/F2 10.95/Times-Bold at 0
-SF(SEE ALSO)72 621.6 Q F1(mbsystem)108 633.6 Q F0(\(1\),)A F1(mbpr)2.5 E
-(ocess)-.18 E F0(\(1\),)A F1(mbset)2.5 E F0(\(1\),)A F1(mbclean)2.5 E F0
-(\(1\),)A F1(mbeditviz)2.5 E F0(\(1\),)A F1(mbinf)2.5 E(o)-.25 E F0
-(\(1\))A F2 -.11(BU)72 662.4 S(GS).11 E F0
-(This program is only fun when the data are good. The main windo)108
-674.4 Q 2.5(wf)-.25 G(or)-2.5 E F1(mbedit)2.5 E F0(is not resizable.)2.5
-E(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(10)199.835 E 0
-Cg EP
-%%Trailer
-end
-%%EOF
diff --git a/src/ps/mbeditviz.ps b/src/ps/mbeditviz.ps
deleted file mode 100644
index 894fb30..0000000
--- a/src/ps/mbeditviz.ps
+++ /dev/null
@@ -1,458 +0,0 @@
-%!PS-Adobe-3.0
-%%Creator: groff version 1.19.2
-%%CreationDate: Wed Jul  1 12:29:27 2015
-%%DocumentNeededResources: font Times-Roman
-%%+ font Times-Bold
-%%+ font Times-Italic
-%%DocumentSuppliedResources: procset grops 1.19 2
-%%Pages: 3
-%%PageOrder: Ascend
-%%DocumentMedia: Default 612 792 0 () ()
-%%Orientation: Portrait
-%%EndComments
-%%BeginDefaults
-%%PageMedia: Default
-%%EndDefaults
-%%BeginProlog
-%%BeginResource: procset grops 1.19 2
-%!PS-Adobe-3.0 Resource-ProcSet
-/setpacking where{
-pop
-currentpacking
-true setpacking
-}if
-/grops 120 dict dup begin
-/SC 32 def
-/A/show load def
-/B{0 SC 3 -1 roll widthshow}bind def
-/C{0 exch ashow}bind def
-/D{0 exch 0 SC 5 2 roll awidthshow}bind def
-/E{0 rmoveto show}bind def
-/F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def
-/G{0 rmoveto 0 exch ashow}bind def
-/H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/I{0 exch rmoveto show}bind def
-/J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def
-/K{0 exch rmoveto 0 exch ashow}bind def
-/L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/M{rmoveto show}bind def
-/N{rmoveto 0 SC 3 -1 roll widthshow}bind def
-/O{rmoveto 0 exch ashow}bind def
-/P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/Q{moveto show}bind def
-/R{moveto 0 SC 3 -1 roll widthshow}bind def
-/S{moveto 0 exch ashow}bind def
-/T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/SF{
-findfont exch
-[exch dup 0 exch 0 exch neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/MF{
-findfont
-[5 2 roll
-0 3 1 roll
-neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/level0 0 def
-/RES 0 def
-/PL 0 def
-/LS 0 def
-/MANUAL{
-statusdict begin/manualfeed true store end
-}bind def
-/PLG{
-gsave newpath clippath pathbbox grestore
-exch pop add exch pop
-}bind def
-/BP{
-/level0 save def
-1 setlinecap
-1 setlinejoin
-72 RES div dup scale
-LS{
-90 rotate
-}{
-0 PL translate
-}ifelse
-1 -1 scale
-}bind def
-/EP{
-level0 restore
-showpage
-}def
-/DA{
-newpath arcn stroke
-}bind def
-/SN{
-transform
-.25 sub exch .25 sub exch
-round .25 add exch round .25 add exch
-itransform
-}bind def
-/DL{
-SN
-moveto
-SN
-lineto stroke
-}bind def
-/DC{
-newpath 0 360 arc closepath
-}bind def
-/TM matrix def
-/DE{
-TM currentmatrix pop
-translate scale newpath 0 0 .5 0 360 arc closepath
-TM setmatrix
-}bind def
-/RC/rcurveto load def
-/RL/rlineto load def
-/ST/stroke load def
-/MT/moveto load def
-/CL/closepath load def
-/Fr{
-setrgbcolor fill
-}bind def
-/setcmykcolor where{
-pop
-/Fk{
-setcmykcolor fill
-}bind def
-}if
-/Fg{
-setgray fill
-}bind def
-/FL/fill load def
-/LW/setlinewidth load def
-/Cr/setrgbcolor load def
-/setcmykcolor where{
-pop
-/Ck/setcmykcolor load def
-}if
-/Cg/setgray load def
-/RE{
-findfont
-dup maxlength 1 index/FontName known not{1 add}if dict begin
-{
-1 index/FID ne{def}{pop pop}ifelse
-}forall
-/Encoding exch def
-dup/FontName exch def
-currentdict end definefont pop
-}bind def
-/DEFS 0 def
-/EBEGIN{
-moveto
-DEFS begin
-}bind def
-/EEND/end load def
-/CNT 0 def
-/level1 0 def
-/PBEGIN{
-/level1 save def
-translate
-div 3 1 roll div exch scale
-neg exch neg exch translate
-0 setgray
-0 setlinecap
-1 setlinewidth
-0 setlinejoin
-10 setmiterlimit
-[]0 setdash
-/setstrokeadjust where{
-pop
-false setstrokeadjust
-}if
-/setoverprint where{
-pop
-false setoverprint
-}if
-newpath
-/CNT countdictstack def
-userdict begin
-/showpage{}def
-/setpagedevice{}def
-}bind def
-/PEND{
-countdictstack CNT sub{end}repeat
-level1 restore
-}bind def
-end def
-/setpacking where{
-pop
-setpacking
-}if
-%%EndResource
-%%EndProlog
-%%BeginSetup
-%%BeginFeature: *PageSize Default
-<< /PageSize [ 612 792 ] /ImagingBBox null >> setpagedevice
-%%EndFeature
-%%IncludeResource: font Times-Roman
-%%IncludeResource: font Times-Bold
-%%IncludeResource: font Times-Italic
-grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72
-def/PL 792 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron/Zcaron
-/scaron/zcaron/Ydieresis/trademark/quotesingle/Euro/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/space/exclam/quotedbl/numbersign/dollar/percent
-/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen
-/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon
-/semicolon/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O
-/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright/circumflex
-/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y
-/z/braceleft/bar/braceright/tilde/.notdef/quotesinglbase/guillemotleft
-/guillemotright/bullet/florin/fraction/perthousand/dagger/daggerdbl
-/endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut
-/dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash
-/quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen
-/brokenbar/section/dieresis/copyright/ordfeminine/guilsinglleft
-/logicalnot/minus/registered/macron/degree/plusminus/twosuperior
-/threesuperior/acute/mu/paragraph/periodcentered/cedilla/onesuperior
-/ordmasculine/guilsinglright/onequarter/onehalf/threequarters
-/questiondown/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE
-/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex
-/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis
-/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn
-/germandbls/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla
-/egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis
-/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide/oslash
-/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis]def
-/Times-Italic at 0 ENC0/Times-Italic RE/Times-Bold at 0 ENC0/Times-Bold RE
-/Times-Roman at 0 ENC0/Times-Roman RE
-%%EndSetup
-%%Page: 1 1
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 145.39(MBeditviz\(1\) MB-System)72 48 R 145.39
-(5.0 MBeditviz\(1\))2.5 F/F1 10.95/Times-Bold at 0 SF -.219(NA)72 84 S(ME)
-.219 E/F2 10/Times-Bold at 0 SF(MBeditviz)108 96 Q F0 2.5<ad33>2.5 G 2.5
-(Dv)-2.5 G(isualization-based editing of sw)-2.5 E(ath bath)-.1 E
-(ymetry soundings.)-.05 E F1(VERSION)72 124.8 Q F0 -1.11(Ve)108 136.8 S
-(rsion 5.0)1.11 E F1(SYNOPSIS)72 165.6 Q F2(MBeditviz)108 177.6 Q F0
-([-I)2.5 E/F3 10/Times-Italic at 0 SF(datalist)A F2<ad5620ad48>2.5 E F0(])A
-F1(DESCRIPTION)72 206.4 Q F3(Overvie)108 218.4 Q(w)-.15 E F2(MBeditviz)
-108 242.4 Q F0 .077(is an interacti)2.577 F .376 -.15(ve 2)-.25 H .076
-(D/3D visualization-based tool for editing sw).15 F .076(ath bath)-.1 F
-.076(ymetry data. The bath)-.05 F(ym-)-.05 E .413
-(etry data from selected \214les are read into memory)108 254.4 R 2.913
-(,g)-.65 G .413(ridded, and displayed in the same 2D/3D visualization)
--2.913 F(en)108 266.4 Q .415(vironment used by)-.4 F F2(MBgrdviz)2.915 E
-F0 2.915(.I)C 2.915(nt)-2.915 G .415(his en)-2.915 F .415
-(vironment, users can select arbitrary areas or re)-.4 F .415
-(gions. All of the)-.15 F .175(soundings in the selected areas are disp\
-layed in a 3D "cloud" that can be rotated, zoomed, and e)108 278.4 R
-(xaggerated.)-.15 E .684(These soundings can also be edited using the s\
-ame edit mouse modes as in)108 290.4 R F2(MBedit)3.183 E F0(.)A F2
-(MBeditviz)5.683 E F0(operates)3.183 E .1(with "edit sa)108 302.4 R .4
--.15(ve \214)-.2 H .1(les" \(*.esf\) in the same f).15 F .101(ashion as)
--.1 F F2(MBedit)2.601 E F0(,)A F2(mbclean)2.601 E F0 2.601(,a)C(nd)
--2.601 E F2(mbar)2.601 E(eaclean)-.18 E F0 2.601(.T)C 2.601(oa)-3.401 G
-.101(pply the edits)-2.601 F(in processing, simply run)108 314.4 Q F2
-(mbpr)2.5 E(ocess)-.18 E F0(on a datalist referencing the rele)2.5 E
--.25(va)-.25 G(nt \214les.).25 E F3(Starting Up)108 338.4 Q F0 .683
-(The initial MBeditviz display sho)108 362.4 R .682(ws a list of the sw)
--.25 F .682(ath \214les you ha)-.1 F .982 -.15(ve i)-.2 H .682
-(denti\214ed by using the "File->Open).15 F(Sw)108 374.4 Q 1.01
-(ath File" menu item. The list has four columns.)-.1 F 1.011
-(The \214rst \(left-most\) column is either blank or sho)6.011 F(ws)-.25
-E("<lock)108 386.4 Q 2.331(ed>" or "<loaded>".)-.1 F 2.331
-(If a \214le is loaded for gridding and editing by this program, it sho)
-7.331 F 2.33(ws as)-.25 F 2.697("<loaded>". If)108 398.4 R 2.697<618c>
-2.697 G .198(le is being edited or processed by another program, it sho)
--2.697 F .198(ws as "<lock)-.25 F .198(ed>". Lock)-.1 F .198(ed \214les)
--.1 F .569(cannot be opened for editing, and an)108 410.4 R 3.068<798c>
--.15 G .568(le loaded for editing by)-3.068 F F2(MBeditviz)3.068 E F0
-.568(will sho)3.068 F 3.068(wa)-.25 G 3.068(s")-3.068 G(lock)-3.068 E
-.568(ed" to other)-.1 F .396
-(programs. The second column is either blank or sho)108 422.4 R .396
-(ws "<esf>". This indicates if a \214le has been pre)-.25 F(viously)-.25
-E .194(edited so that an edit sa)108 434.4 R .493 -.15(ve \214)-.2 H
-.193(le already e).15 F .193(xists. The third column indicates, if the \
-\214le is loaded, whether asyn-)-.15 F .289(chronous heading \("H"\), s\
-onar depth \("S"\), and attitude \("A"\) time series data ha)108 446.4 R
-.589 -.15(ve b)-.2 H .289(een loaded along with).15 F .4(the sw)108
-458.4 R .4(ath bath)-.1 F .4
-(ymetry data. These asynchronous data are required in order to use)-.05
-F F2(MBeditviz)2.9 E F0 .4(to assess time)2.9 F .982(lag issues, b)108
-470.4 R .982(ut are not a)-.2 F -.25(va)-.2 G .982
-(ilable for all datasets.).25 F .982(The fourth and \214fth columns sho)
-5.982 F 3.483(wt)-.25 G .983(he \214lename and the)-3.483 F F2(MBIO)108
-482.4 Q F0 .836(format id, respecti)3.336 F -.15(ve)-.25 G(ly).15 E
-5.836(.U)-.65 G .836(sers can select one of the \214les in the a)-5.836
-F -.25(va)-.2 G .835(ilable list. If the "Edit Selected).25 F 1.532
-(File" b)108 494.4 R 1.532(utton is click)-.2 F 1.533
-(ed, the selected \214le will be opened for editing \(and an)-.1 F 4.033
-<798c>-.15 G 1.533(le already loaded will be)-4.033 F .75
-(closed \214rst\). If the "Remo)108 506.4 R 1.05 -.15(ve S)-.15 H .75
-(elected File" b).15 F .75
-(utton is selected, then the selected \214le will be remo)-.2 F -.15(ve)
--.15 G 3.25(df).15 G(rom)-3.25 E(the a)108 518.4 Q -.25(va)-.2 G
-(ilable list.).25 E -1.1(Yo)108 554.4 S 3.552(uc)1.1 G 1.052
-(an select some or all of the \214les in the list.)-3.552 F 1.053
-(When you click on the "V)6.053 F(ie)-.6 E 3.553(wA)-.25 G 1.053
-(ll Files" or the "V)-3.553 F(ie)-.6 E(w)-.25 E .166(Selected Files", M\
-Beditviz reads the speci\214ed \214les, loading all of the soundings in\
-to memory)108 566.4 R 2.666(.T)-.65 G .166(he program)-2.666 F .039
-(then brings up a "Grid P)108 578.4 R .039
-(arameters" dialog which suggests a grid cell size and sho)-.15 F .04
-(ws the implied dimensions)-.25 F .514
-(of a grid enclosing all of the data. The tw)108 590.4 R 3.014(oi)-.1 G
-.514(ssues to k)-3.014 F .513(eep in mind are that you w)-.1 F .513
-(ant the grid to be reason-)-.1 F .802(ably sized \(dimensions <2500 or\
- so on my laptop\) and that no interpolation is applied in the gridding\
-, so)108 602.4 R 1.184(too small a grid cell size will lea)108 614.4 R
-1.483 -.15(ve g)-.2 H 1.183(aps between soundings in the map vie).1 F
-2.483 -.65(w. W)-.25 H 1.183(hen you click "Apply",).65 F 1.013(MBeditv\
-iz grids the soundings, and then displays the grid using the same 2D/3D\
- interf)108 626.4 R 1.013(ace as MBgrdviz,)-.1 F(including the na)108
-638.4 Q(vig)-.2 E(ation associated with the selected sw)-.05 E
-(ath \214les.)-.1 E 1.123(The na)108 662.4 R(vig)-.2 E 1.123
-(ation associated with the selected sw)-.05 F 1.123
-(ath \214les will be displayed as well, and can be selected or)-.1 F
-(queried by setting the mouse mode to)108 674.4 Q .525
-(Data \214les that ha)108 698.4 R .825 -.15(ve b)-.2 H .525(een pre).15
-F .525(viously edited with)-.25 F F2(MBeditviz)3.025 E F0(,)A F2(MBedit)
-3.025 E F0(,)A F2(mbclean)3.025 E F0 3.025(,o)C(r)-3.025 E F2(mbar)3.025
-E(eaclean)-.18 E F0 .525(will ha)3.025 F -.15(ve)-.2 G(tw)108 710.4 Q
-2.768(or)-.1 G .268(elated ancilliary \214les with suf)-2.768 F<8c78>
--.25 E .267(es ".esf" and ".par".)-.15 F .267
-(The "*.esf" \214le is the edit sa)5.267 F .567 -.15(ve \214)-.2 H .267
-(le containing all).15 F .825(of the \215ag and un\215ag edit e)108
-722.4 R -.15(ve)-.25 G .826(nts generated for soundings in a data \214l\
-e. The "*.par" \214le is the processing).15 F(MB-System 5.0)72 768 Q 2.5
-(2J)146.495 G(une 2014)-2.5 E(1)204.835 E 0 Cg EP
-%%Page: 2 2
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 145.39(MBeditviz\(1\) MB-System)72 48 R 145.39
-(5.0 MBeditviz\(1\))2.5 F .616(parameter \214le that contains all of th\
-e processing parameters and instructions to be applied by the program)
-108 84 R/F1 10/Times-Bold at 0 SF(mbpr)108 96 Q(ocess)-.18 E F0(.)A F1
-(MBeditviz)3.097 E F0 .597(will read and apply the pre-e)3.097 F .597
-(xisting edit e)-.15 F -.15(ve)-.25 G .598
-(nts as \214les are read into memory).15 F 3.098(.T)-.65 G(he)-3.098 E
-(initial gridded vie)108 108 Q 2.5(wo)-.25 G 2.5(ft)-2.5 G(he bath)-2.5
-E(ymetry will re\215ect all of the pre-e)-.05 E(xisting edit e)-.15 E
--.15(ve)-.25 G(nts.).15 E/F2 10/Times-Italic at 0 SF
-(Displaying a "Sounding Cloud")108 132 Q F0 .197(Once you ha)108 156 R
-.497 -.15(ve a)-.2 H 2.697(nM).15 G .197(Beditviz surv)-2.697 F .497
--.15(ey d)-.15 H(isplay).15 E 2.697(,s)-.65 G .197
-(et the mouse mode to "Pick Area" and either use the left b)-2.697 F
-(ut-)-.2 E .167(ton to drag a square "re)108 168 R .167
-(gion", or use the middle b)-.15 F .168
-(utton to drag an arbitrarily oriented "area" \(also, if an area)-.2 F
-1.345(is de\214ned the right b)108 180 R 1.344(utton decreases/increase\
-s the width of the area\). Each time you de\214ne or change a)-.2 F
-(pick)108 192 Q 1.01(ed re)-.1 F 1.011(gion or area, MBeditviz will dis\
-play the point cloud of soundings located in the re)-.15 F 1.011
-(gion or area.)-.15 F(Since)108 204 Q F1(MBeditviz)3.419 E F0 .919
-(also displays the sw)3.419 F .919(ath \214le na)-.1 F(vig)-.2 E .919
-(ation, users can also change the mouse mode to "Pick)-.05 F(Na)108 216
-Q .472(v" or "Pick Na)-.2 F 2.972(vF)-.2 G .473
-(ile" and select portions of the na)-2.972 F(vig)-.2 E .473
-(ation. In this case the sounding cloud will encom-)-.05 F .142
-(pass all of the data associated with the selected na)108 228 R(vig)-.2
-E .142(ation. The 3Dsoundings vie)-.05 F 2.642(wi)-.25 G 2.642(sm)-2.642
-G .141(anipulated using the)-2.642 F(middle and right mouse b)108 240 Q
-(uttons in either rotation mode or zoom/e)-.2 E(xagerate mode.)-.15 E
--1.1(Yo)108 264 S 2.522(uc)1.1 G .023
-(an edit the soundings in the point cloud conte)-2.522 F .023
-(xt using the left mouse b)-.15 F .023(utton. The editing mouse modes)
--.2 F -.1(wo)108 276 S .754(rk just lik).1 F 3.254(eM)-.1 G .753
-(Bedit. The V)-3.254 F(ie)-.6 E 3.253(wm)-.25 G .753
-(enu in the point cloud display lets you sho)-3.253 F 2.053 -.65(w, o)
--.25 H 3.253(rn).65 G .753(ot sho)-3.253 F 2.053 -.65(w, t)-.25 H .753
-(he \215agged).65 F(soundings \(which are displayed in red\).)108 288 Q
-F2(Changing Sounding Color)108 312 Q(s)-.1 E F0 .586
-(The [3D Soundings]:<Action> pulldo)108 336 R .586(wn menu has se)-.25 F
--.15(ve)-.25 G 3.087(nb).15 G .587(uttons that allo)-3.287 F 3.087(wt)
--.25 G .587(he user to change the display)-3.087 F .643(color of all cu\
-rrently selected un\215agged soundings. Each of these options \(black, \
-red, yello)108 348 R 1.943 -.65(w, g)-.25 H .643(reen, blue-).65 F .322
-(green, blue, purple\) acts on the soundings)108 360 R .323
-(displayed in the 3D Soundings windo)5.322 F 1.623 -.65(w, a)-.25 H .323
-(nd these color settings).65 F .059(are sa)108 372 R -.15(ve)-.2 G 2.559
-(dw).15 G .059(hen the 3D Soundings windo)-2.559 F 2.558(wi)-.25 G 2.558
-(sd)-2.558 G .058
-(ismissed or redisplayed. This feature can aid in using)-2.558 F F1
-(MBed-)2.558 E(itviz)108 384 Q F0 .304
-(for patch test \(bias parameter\) analysis. F)2.804 F .304
-(or instance, if a surv)-.15 F .605 -.15(ey i)-.15 H .305
-(ncludes reciprocal lines \(tw).15 F 2.805(oc)-.1 G(oinci-)-2.805 E
-1.779(dent surv)108 396 R 2.079 -.15(ey l)-.15 H 1.778
-(ines collected in opposite directions\), one can use a narro).15 F
-4.278(ws)-.25 G 1.778(trip of soundings across the)-4.278 F(sw)108 408 Q
-.499(aths to assess the roll bias v)-.1 F .5
-(alue. This analysis is easier if the soundings from the tw)-.25 F 3(or)
--.1 G .5(eciprocal sw)-3 F(aths)-.1 E .265(can be dif)108 420 R .265
-(ferentiated. T)-.25 F 2.765(oa)-.8 G .265
-(ccomplish this, a user can select one line using the [MBvie)-2.765 F
-.265(w]:<Pick Na)-.25 F .265(v> mode,)-.2 F .171
-(bringing those associated soundings up in the 3D Soundings windo)108
-432 R 1.471 -.65(w, a)-.25 H .171(nd then set all those soundings to be)
-.65 F .233(colored green. The soundings of the opposite line can be sim\
-ilarly colored purple. Then, selecting a narro)108 444 R(w)-.25 E .423(\
-area across the reciprocal lines will select and display soundings from\
- both lines, and those soundings will)108 456 R
-(be green or purple depending on which line the)108 468 Q 2.5(ya)-.15 G
-(re part of.)-2.5 E F2(Applying the Bathyemtry Edits)108 492 Q F0 .654
-(When you dismiss the gridded vie)108 516 R 1.954 -.65(w, t)-.25 H .654
-(he esf \214les of the af).65 F .654
-(fected \214les will be updated just as the)-.25 F 3.154(ya)-.15 G .654
-(re with)-3.154 F .781(MBedit. The program also modi\214es the)108 528 R
-F1(mbpr)3.281 E(ocess)-.18 E F0 .781
-(parameter \214le for the input \214le by specifying the edit)3.281 F
-(sa)108 540 Q .622 -.15(ve \214)-.2 H .322(le and setting the).15 F F1
-(mbpr)2.821 E(ocess)-.18 E F0 .321
-(mode to apply the edits when generating a processed sw)2.821 F .321
-(ath output \214le.)-.1 F(If no parameter \214le e)108 552 Q(xists,)-.15
-E F1(mbeditviz)2.5 E F0(creates one.)2.5 E/F3 10.95/Times-Bold at 0 SF
--.548(AU)72 580.8 S(THORSHIP).548 E F0(Da)108 592.8 Q(vid W)-.2 E 2.5
-(.C)-.92 G(aress \(caress at mbari.or)-2.5 E(g\))-.18 E(Montere)113 604.8 Q
-2.5(yB)-.15 G(ay Aquarium Research Institute)-2.5 E
-(Dale N. Chayes \(dale at ldeo.columbia.edu\))108 616.8 Q
-(Lamont-Doherty Earth Observ)113 628.8 Q(atory)-.25 E F3(OPTIONS)72
-657.6 Q F1<ad48>108 669.6 Q F0 .162(This "help" \215ag cause the progra\
-m to print out a description of its operation and then e)22.52 F .162
-(xit immedi-)-.15 F(ately)144 681.6 Q(.)-.65 E F1<ad49>108 698.4 Q F2
-(datalist)26.41 E F0 .86(Sets an)144 710.4 R F1(MB-System)3.36 E F0 .86
-(datalist \214le to be parsed on input for sw)3.36 F .86
-(ath data \214les to list as a)-.1 F -.25(va)-.2 G .86(ilable for).25 F
-3.924(editing. This)144 722.4 R 1.424(option is usually used when)3.924
-F F1(MBeditviz)3.925 E F0 1.425
-(is started automatically from some other)3.925 F(MB-System 5.0)72 768 Q
-2.5(2J)146.495 G(une 2014)-2.5 E(2)204.835 E 0 Cg EP
-%%Page: 3 3
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 145.39(MBeditviz\(1\) MB-System)72 48 R 145.39
-(5.0 MBeditviz\(1\))2.5 F(process, such as)144 84 Q/F1 10/Times-Bold at 0
-SF(MBgrdviz)2.5 E F0(.)A F1<ad56>108 100.8 Q F0(Normally)23.08 E(,)-.65
-E F1(MBeditviz)3.868 E F0 1.368
-(outputs limited information to the stderr stream.)3.868 F 1.368(If the)
-6.368 F F1<ad56>3.868 E F0 1.367(\215ag is gi)3.868 F -.15(ve)-.25 G(n,)
-.15 E(then)144 112.8 Q F1(MBeditviz)2.979 E F0 -.1(wo)2.979 G .479
-(rks in a "v).1 F .479(erbose" mode and outputs the program v)-.15 F .48
-(ersion being used, all error)-.15 F 1.268(status messages, and a lar)
-144 124.8 R 1.267
-(ge amount of other information including all of the beams \215agged or)
--.18 F(zeroed.)144 136.8 Q/F2 10.95/Times-Bold at 0 SF(INTERA)72 165.6 Q
-(CTIVE CONTR)-.602 E(OLS)-.329 E(MOUSE A)72 177.6 Q(CTIONS)-.602 E
-(KEYBO)72 189.6 Q(ARD A)-.438 E(CTIONS)-.602 E(SEE ALSO)72 201.6 Q F1
-(mbsystem)108 213.6 Q F0(\(1\),)A F1(mbedit)2.5 E F0(\(1\),)A F1(mbpr)
-2.5 E(ocess)-.18 E F0(\(1\))A F1(mbset)2.5 E F0(\(1\))A F2 -.11(BU)72
-242.4 S(GS).11 E F0
-(This program is not done, nor is it adequately documented.)108 254.4 Q
-(MB-System 5.0)72 768 Q 2.5(2J)146.495 G(une 2014)-2.5 E(3)204.835 E 0
-Cg EP
-%%Trailer
-end
-%%EOF
diff --git a/src/ps/mbextractsegy.ps b/src/ps/mbextractsegy.ps
deleted file mode 100644
index 7397823..0000000
--- a/src/ps/mbextractsegy.ps
+++ /dev/null
@@ -1,628 +0,0 @@
-%!PS-Adobe-3.0
-%%Creator: groff version 1.19.2
-%%CreationDate: Wed Jul  1 12:29:27 2015
-%%DocumentNeededResources: font Times-Roman
-%%+ font Times-Bold
-%%+ font Times-Italic
-%%DocumentSuppliedResources: procset grops 1.19 2
-%%Pages: 5
-%%PageOrder: Ascend
-%%DocumentMedia: Default 612 792 0 () ()
-%%Orientation: Portrait
-%%EndComments
-%%BeginDefaults
-%%PageMedia: Default
-%%EndDefaults
-%%BeginProlog
-%%BeginResource: procset grops 1.19 2
-%!PS-Adobe-3.0 Resource-ProcSet
-/setpacking where{
-pop
-currentpacking
-true setpacking
-}if
-/grops 120 dict dup begin
-/SC 32 def
-/A/show load def
-/B{0 SC 3 -1 roll widthshow}bind def
-/C{0 exch ashow}bind def
-/D{0 exch 0 SC 5 2 roll awidthshow}bind def
-/E{0 rmoveto show}bind def
-/F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def
-/G{0 rmoveto 0 exch ashow}bind def
-/H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/I{0 exch rmoveto show}bind def
-/J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def
-/K{0 exch rmoveto 0 exch ashow}bind def
-/L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/M{rmoveto show}bind def
-/N{rmoveto 0 SC 3 -1 roll widthshow}bind def
-/O{rmoveto 0 exch ashow}bind def
-/P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/Q{moveto show}bind def
-/R{moveto 0 SC 3 -1 roll widthshow}bind def
-/S{moveto 0 exch ashow}bind def
-/T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/SF{
-findfont exch
-[exch dup 0 exch 0 exch neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/MF{
-findfont
-[5 2 roll
-0 3 1 roll
-neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/level0 0 def
-/RES 0 def
-/PL 0 def
-/LS 0 def
-/MANUAL{
-statusdict begin/manualfeed true store end
-}bind def
-/PLG{
-gsave newpath clippath pathbbox grestore
-exch pop add exch pop
-}bind def
-/BP{
-/level0 save def
-1 setlinecap
-1 setlinejoin
-72 RES div dup scale
-LS{
-90 rotate
-}{
-0 PL translate
-}ifelse
-1 -1 scale
-}bind def
-/EP{
-level0 restore
-showpage
-}def
-/DA{
-newpath arcn stroke
-}bind def
-/SN{
-transform
-.25 sub exch .25 sub exch
-round .25 add exch round .25 add exch
-itransform
-}bind def
-/DL{
-SN
-moveto
-SN
-lineto stroke
-}bind def
-/DC{
-newpath 0 360 arc closepath
-}bind def
-/TM matrix def
-/DE{
-TM currentmatrix pop
-translate scale newpath 0 0 .5 0 360 arc closepath
-TM setmatrix
-}bind def
-/RC/rcurveto load def
-/RL/rlineto load def
-/ST/stroke load def
-/MT/moveto load def
-/CL/closepath load def
-/Fr{
-setrgbcolor fill
-}bind def
-/setcmykcolor where{
-pop
-/Fk{
-setcmykcolor fill
-}bind def
-}if
-/Fg{
-setgray fill
-}bind def
-/FL/fill load def
-/LW/setlinewidth load def
-/Cr/setrgbcolor load def
-/setcmykcolor where{
-pop
-/Ck/setcmykcolor load def
-}if
-/Cg/setgray load def
-/RE{
-findfont
-dup maxlength 1 index/FontName known not{1 add}if dict begin
-{
-1 index/FID ne{def}{pop pop}ifelse
-}forall
-/Encoding exch def
-dup/FontName exch def
-currentdict end definefont pop
-}bind def
-/DEFS 0 def
-/EBEGIN{
-moveto
-DEFS begin
-}bind def
-/EEND/end load def
-/CNT 0 def
-/level1 0 def
-/PBEGIN{
-/level1 save def
-translate
-div 3 1 roll div exch scale
-neg exch neg exch translate
-0 setgray
-0 setlinecap
-1 setlinewidth
-0 setlinejoin
-10 setmiterlimit
-[]0 setdash
-/setstrokeadjust where{
-pop
-false setstrokeadjust
-}if
-/setoverprint where{
-pop
-false setoverprint
-}if
-newpath
-/CNT countdictstack def
-userdict begin
-/showpage{}def
-/setpagedevice{}def
-}bind def
-/PEND{
-countdictstack CNT sub{end}repeat
-level1 restore
-}bind def
-end def
-/setpacking where{
-pop
-setpacking
-}if
-%%EndResource
-%%EndProlog
-%%BeginSetup
-%%BeginFeature: *PageSize Default
-<< /PageSize [ 612 792 ] /ImagingBBox null >> setpagedevice
-%%EndFeature
-%%IncludeResource: font Times-Roman
-%%IncludeResource: font Times-Bold
-%%IncludeResource: font Times-Italic
-grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72
-def/PL 792 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron/Zcaron
-/scaron/zcaron/Ydieresis/trademark/quotesingle/Euro/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/space/exclam/quotedbl/numbersign/dollar/percent
-/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen
-/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon
-/semicolon/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O
-/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright/circumflex
-/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y
-/z/braceleft/bar/braceright/tilde/.notdef/quotesinglbase/guillemotleft
-/guillemotright/bullet/florin/fraction/perthousand/dagger/daggerdbl
-/endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut
-/dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash
-/quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen
-/brokenbar/section/dieresis/copyright/ordfeminine/guilsinglleft
-/logicalnot/minus/registered/macron/degree/plusminus/twosuperior
-/threesuperior/acute/mu/paragraph/periodcentered/cedilla/onesuperior
-/ordmasculine/guilsinglright/onequarter/onehalf/threequarters
-/questiondown/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE
-/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex
-/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis
-/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn
-/germandbls/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla
-/egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis
-/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide/oslash
-/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis]def
-/Times-Italic at 0 ENC0/Times-Italic RE/Times-Bold at 0 ENC0/Times-Bold RE
-/Times-Roman at 0 ENC0/Times-Roman RE
-%%EndSetup
-%%Page: 1 1
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mbe)72 48 Q(xtractse)-.15 E 130.15
-(gy\(1\) MB-System)-.15 F 130.15(5.0 mbe)2.5 F(xtractse)-.15 E(gy\(1\))
--.15 E/F1 10.95/Times-Bold at 0 SF -.219(NA)72 84 S(ME).219 E/F2 10
-/Times-Bold at 0 SF(mbextractsegy)108 96 Q F0 2.897<ad65>2.897 G .396
-(xtracts subbottom pro\214ler)-3.047 F 2.896(,c)-.4 G .396
-(enter beam re\215ection, or seismic re\215ection data from sw)-2.896 F
-(ath)-.1 E(data supported by MB-System and re)108 108 Q
-(writes it as a SEGY \214le.)-.25 E F1(VERSION)72 136.8 Q F0 -1.11(Ve)
-108 148.8 S(rsion 5.0)1.11 E F1(SYNOPSIS)72 177.6 Q F2(mbextractsegy)108
-189.6 Q F0([)5.706 E F2<ad42>A/F3 10/Times-Italic at 0 SF
-(yr/mo/da/hr/mn/sc)A F2<ad45>5.706 E F3(yr/mo/da/hr/mn/sc)A F2<ad46>
-5.706 E F3(format)A F2<ad49>5.706 E F3(\214le)A F2<ad4a>5.706 E F3
-(xscale/yscale/maxwidth)A F2<ad4c>108 201.6 Q F3(startline/liner)A(oot)
--.45 E F2 1.002<ad4d20ad4f>3.502 F F3(se)A(gy\214le)-.4 E F2<ad51>3.502
-E F3 -.45(ro)C(utetime\214le).45 E F2<ad52>3.501 E F3 -.45(ro)C
-(ute\214le).45 E F2<ad53>3.501 E F3(sampleformat)A F2<ad54>3.501 E F3
-(timeshift)A F2<ad55>3.501 E F3 -.15(ra)C(ng).15 E(eth-)-.1 E -.37(re)
-108 213.6 S(shold).37 E F2<ad5a>2.5 E F3(plotmax)A F2<ad5620ad48>2.5 E
-F0(])A F1(DESCRIPTION)72 242.4 Q F2(MBextractsegy)108 254.4 Q F0 .413
-(is a utility for reading a sw)2.913 F .413
-(ath sonar data \214le or \214les, e)-.1 F .413
-(xtracting subbottom pro\214ler)-.15 F 2.914(,c)-.4 G(enter)-2.914 E
-1.296(beam re\215ection, or seismic re\215ection data, and outputting t\
-hat selected data as a SEGY \214le. P)108 266.4 R(arameters)-.15 E .971
-(such as sonar depth, sea\215oor depth, and position are embedded into \
-the SEGY data. The SEGY \214les are)108 278.4 R .016
-(output in a form used by the seismic re\215ection processing package)
-108 290.4 R F2(SIOSEIS)2.515 E F0 2.515(.A")C .015
-(sinf" \214le containing statis-)-2.515 F .856
-(tics about the content of the SEGY \214le is created automatically by)
-108 302.4 R F2(MBextractsegy)3.356 E F0 3.356(;t)C .856
-(his \214le is named by)-3.356 F(adding a ".sinf" suf)108 314.4 Q
-(\214x to the SEGY \214lename.)-.25 E .465(At present, the only sw)108
-338.4 R .464(ath data formats from which subbottom data can be e)-.1 F
-.464(xtracted are format 88 \(Reson)-.15 F(7k format\), format 132 \(Ed\
-getech Jstar format\), and format 133 \(Edgetech Jstar format\).)108
-350.4 Q .011(The e)108 374.4 R .011(xtracted se)-.15 F .011
-(gy data \214le\(s\) can be or)-.15 F -.05(ga)-.18 G .011(nized three w)
-.05 F .011(ays. If the)-.1 F F2<ad4f>2.512 E F0 .012
-(option is used to specify a single se)2.512 F(gy)-.15 E .095
-(output \214le, then all of the se)108 386.4 R .094
-(gy data will be output to that single \214le. If either the)-.15 F F2
-<ad51>2.594 E F0(or)2.594 E F2<ad52>2.594 E F0 .094(options are used)
-2.594 F .14(to specify a surv)108 398.4 R .44 -.15(ey r)-.15 H .14
-(oute \214le that includes the w).15 F .14(aypoints co)-.1 F -.15(ve)
--.15 G .14(red while collecting the data \214le\(s\) referenced).15 F
-(by)108 410.4 Q F2<ad49>2.779 E F3(\214le)A F0 2.779(,t)C .279
-(hen the output se)-2.779 F .279(gy data will be brok)-.15 F .279
-(en up by the sequential lines de\214ned by the w)-.1 F .278
-(aypoints. The)-.1 F F2<ad51>108 422.4 Q F0 .087(option speci\214es a r\
-oute \214le that includes the time at which each w)2.587 F .087
-(aypoint is reached in the data, and the)-.1 F F2<ad52>108 434.4 Q F0
-.054(option speci\214es a route \214le of the form e)2.554 F .053
-(xported by)-.15 F F2(MBgrdviz)2.553 E F0 2.553(.I)C 2.553(nt)-2.553 G
-.053(he w)-2.553 F(aypoint-dri)-.1 E -.15(ve)-.25 G 2.553(nc).15 G .053
-(ase each output)-2.553 F(se)108 446.4 Q 1.23
-(gy \214le will be named using the line root name speci\214ed by)-.15 F
-F2<ad4c>3.731 E F3(startline/liner)A(oot)-.45 E F0 1.231
-(with a sequential line)3.731 F .628(number starting from)108 458.4 R F3
-(startline)3.128 E F0 3.128(.I)C 3.128(fn)-3.128 G .628(either the)
--3.128 F F2<ad4f>3.128 E F0(or)3.128 E F2<ad4c>3.128 E F0 .628
-(options are used, each input sw)3.128 F .628(ath \214le will ha)-.1 F
-.927 -.15(ve a)-.2 H(corresponding se)108 470.4 Q
-(gy output \214le with the ".se)-.15 E(gy" suf)-.15 E
-(\214x added to the original \214lename.)-.25 E F2(MBextractsegy)108
-494.4 Q F0 .057(also generates a "\214rst cut plot" script that will ge\
-nerate grayscale section plots in Postscript)2.556 F .927(of each se)108
-506.4 R .927(gy \214le using the programs)-.15 F F2(MBsegygrid)3.427 E
-F0(and)3.427 E F2(mbm_grdplot)3.427 E F0 3.427(.T)C(he)-3.427 E F2<ad5a>
-3.427 E F0 .927(sets the trace v)3.427 F .926(alue corre-)-.25 F
-(sponding to the maximum grayscale \(black\) in the section plots.)108
-518.4 Q F1 -.548(AU)72 547.2 S(THORSHIP).548 E F0(Da)108 559.2 Q(vid W)
--.2 E 2.5(.C)-.92 G(aress \(caress at mbari.or)-2.5 E(g\))-.18 E(Montere)
-113 571.2 Q 2.5(yB)-.15 G(ay Aquarium Research Institute)-2.5 E
-(Dale N. Chayes \(dale at ldeo.columbia.edu\))108 583.2 Q
-(Lamont-Doherty Earth Observ)113 595.2 Q(atory)-.25 E F1(OPTIONS)72 624
-Q F2<ad42>108 636 Q F3(yr/mo/da/hr/mn/sc)23.63 E F0 .155
-(This option sets the starting time for data allo)144 648 R .155
-(wed in the input data.)-.25 F(The)5.155 E F2<ad45>2.655 E F0 .155
-(option sets the ending)2.655 F .195
-(time for data. If the starting time is before the ending time, then an)
-144 660 R 2.695(yd)-.15 G .195(ata with a time stamp before)-2.695 F
-.444(the starting time or after the ending time is ignored. If instead \
-the starting time is after the ending)144 672 R .195(time, then an)144
-684 R 2.695(yd)-.15 G .194(ata between the ending and starting time wil\
-l be ignored. This scheme allo)-2.695 F .194(ws time)-.25 F(windo)144
-696 Q 5.376(wing both inside and outside a speci\214ed interv)-.25 F
-7.876(al. Def)-.25 F(ault:)-.1 E F3(yr/mo/da/hr/mn/sc)7.876 E F0(=)7.876
-E(1962/2/21/10/30/0.)144 708 Q F2<ad45>5 E F3(yr/mo/da/hr/mn/sc)2.5 E F0
-.155(This option sets the ending time for data allo)144 720 R .155
-(wed in the input data.)-.25 F(The)5.155 E F2<ad42>2.655 E F0 .155
-(option sets the starting)2.655 F(MB-System 5.0)72 768 Q 2.5(3J)146.495
-G(une 2013)-2.5 E(1)204.835 E 0 Cg EP
-%%Page: 2 2
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mbe)72 48 Q(xtractse)-.15 E 130.15
-(gy\(1\) MB-System)-.15 F 130.15(5.0 mbe)2.5 F(xtractse)-.15 E(gy\(1\))
--.15 E .195
-(time for data. If the starting time is before the ending time, then an)
-144 84 R 2.695(yd)-.15 G .196(ata with a time stamp before)-2.695 F .444
-(the starting time or after the ending time is ignored. If instead the \
-starting time is after the ending)144 96 R .194(time, then an)144 108 R
-2.694(yd)-.15 G .194(ata between the ending and starting time will be i\
-gnored. This scheme allo)-2.694 F .195(ws time)-.25 F(windo)144 120 Q
-5.376(wing both inside and outside a speci\214ed interv)-.25 F 7.876
-(al. Def)-.25 F(ault:)-.1 E/F1 10/Times-Italic at 0 SF(yr/mo/da/hr/mn/sc)
-7.876 E F0(=)7.876 E(2062/2/21/10/30/0.)144 132 Q/F2 10/Times-Bold at 0 SF
-<ad46>108 148.8 Q F1(format)24.19 E F0 .22(Sets the data format used if\
- the input is read from stdin or from a \214le. If)144 160.8 R F1
-(format)2.72 E F0 2.72(<0)2.72 G 2.72(,t)-2.72 G .22(hen the input)-2.72
-F .008(\214le speci\214ed with the)144 172.8 R F2<ad49>2.508 E F0 .008
-(option will actually contain a list of input sw)2.508 F .007
-(ath sonar data \214les. This pro-)-.1 F .011(gram uses the)144 184.8 R
-F2(MBIO)2.511 E F0 .012(library and will read or write an)2.511 F 2.512
-(ys)-.15 G -.1(wa)-2.512 G .012(th sonar format supported by).1 F F2
-(MBIO)2.512 E F0 2.512(.A)C 1.297(list of the sw)144 196.8 R 1.297
-(ath sonar data formats currently supported by)-.1 F F2(MBIO)3.797 E F0
-1.296(and their identi\214er v)3.796 F 1.296(alues is)-.25 F(gi)144
-208.8 Q -.15(ve)-.25 G 2.5(ni).15 G 2.5(nt)-2.5 G(he)-2.5 E F2(MBIO)2.5
-E F0(manual page. The def)2.5 E(ault format is set using the program)-.1
-E F2(mbdefaults)2.5 E F0(..)A F2<ad48>108 225.6 Q F0 .162(This "help" \
-\215ag cause the program to print out a description of its operation an\
-d then e)22.52 F .162(xit immedi-)-.15 F(ately)144 237.6 Q(.)-.65 E F2
-<ad49>108 254.4 Q F1(in\214le)26.41 E F0 .515
-(Sets the input \214le path. If)144 266.4 R F1(format)3.015 E F0 3.015
-(>0\()3.015 G .515(set with the)-3.015 F F2<ad66>3.015 E F0 .515
-(option or)3.015 F F2(mbdefaults)3.014 E F0 3.014(\)t)C .514(hen the sw)
--3.014 F .514(ath sonar)-.1 F .796(data contained in)144 278.4 R F1
-(in\214le)3.296 E F0 .797(is read and processed. If)3.297 F F1(format)
-3.297 E F0 3.297(<0)3.297 G 3.297(,t)-3.297 G(hen)-3.297 E F1(in\214le)
-3.297 E F0 .797(is assumed to be an ascii)3.297 F .157
-(\214le containing a list of the input sw)144 290.4 R .157
-(ath sonar data \214les to be processed and their formats.)-.1 F .156
-(The pro-)5.156 F .928
-(gram will read the data in each one of these \214les.)144 302.4 R .929
-(In the)5.929 F F1(in\214le)3.429 E F0 .929
-(\214le, each data \214le should be fol-)3.429 F(lo)144 314.4 Q
-(wed by a data format identi\214er)-.25 E 2.5(,e)-.4 G(.g.:)-2.5 E
-(data\214le1 11)180 326.4 Q(data\214le2 24)180 338.4 Q .569
-(This program uses the)144 350.4 R F2(MBIO)3.068 E F0 .568
-(library and will read or write an)3.068 F 3.068(ys)-.15 G -.1(wa)-3.068
-G .568(th sonar format supported by).1 F F2(MBIO)144 362.4 Q F0 3.428
-(.Al)C .928(ist of the sw)-3.428 F .928
-(ath sonar data formats currently supported by)-.1 F F2(MBIO)3.428 E F0
-.928(and their identi\214er)3.428 F -.25(va)144 374.4 S(lues is gi).25 E
--.15(ve)-.25 G 2.5(ni).15 G 2.5(nt)-2.5 G(he)-2.5 E F2(MBIO)2.5 E F0
-(manual page. Def)2.5 E(ault:)-.1 E F1(in\214le)2.5 E F0 2.5(=")2.5 G
-(stdin".)-2.5 E F2<ad4a>108 391.2 Q F1(xscale/yscale/maxwidth)25.3 E F0
-1.005(Sets the scale of the def)144 403.2 R 1.005
-(ault section plots. The)-.1 F F1(xscale)3.504 E F0 -.25(va)3.504 G
-1.004(lue is in inches per shot, and the).25 F F1(yscale)3.504 E F0 -.25
-(va)144 415.2 S 1.537(lue is in inches per second.).25 F(The)6.537 E F1
-(maxwidth)4.037 E F0 -.25(va)4.037 G 1.537
-(lue sets the maximum plot width in inches. If).25 F F1(xscale)144 427.2
-Q F0 .33(and the shot range imply a width greater than)2.83 F F1
-(maxwidth)2.829 E F0 2.829(,t)C .329(hen the section will be brok)-2.829
-F .329(en up)-.1 F(into multiple plots.)144 439.2 Q(Def)5 E(ault:)-.1 E
-F1(xscale)2.5 E F0 2.5(=0)2.5 G(.01;)-2.5 E F1(yscale)2.5 E F0 2.5(=7)
-2.5 G(5;)-2.5 E F1(maxwidth)2.5 E F0 2.5(=4)2.5 G(5.0)-2.5 E F2<ad4c>108
-456 Q F1(startline/liner)23.63 E(oot)-.45 E F0 .035(This option sets th\
-e starting line number and the output \214lename root used when)144 468
-R F2<ad52>2.536 E F0 .036(is speci\214ed so)2.536 F
-(that data are output according to planned surv)144 480 Q .3 -.15(ey l)
--.15 H(ines. Def).15 E(ault:)-.1 E F1(startline)2.5 E F0 2.5(=1)2.5 G(;)
--2.5 E F1(liner)2.5 E(oot)-.45 E F0 2.5(=")2.5 G(sbp".)-2.5 E F2<ad4d>
-108 496.8 Q F0 .126(This option causes)144 508.8 R F2(mbextractsegy)
-2.626 E F0 .126(to omit data during turns when e)2.626 F .125
-(xtracting into line \214les accord-)-.15 F .625
-(ing to a speci\214ed set of w)144 520.8 R .625(aypoints \()-.1 F F2
-<ad52>A F0 .626
-(option\). The traces will not be output until the heading is)3.125 F
-(within 15 de)144 532.8 Q(grees of the ne)-.15 E(xt surv)-.15 E .3 -.15
-(ey l)-.15 H(ine').15 E 2.5(sb)-.55 G(earing.)-2.5 E F2<ad4f>108 549.6 Q
-F0 .591(This option sets the output SEGY \214le path. If neither)144
-561.6 R F2<ad4f>3.091 E F0(nore)3.091 E F2<ad52>3.091 E F0 .591(are in)
-3.091 F -.2(vo)-.4 G -.1(ke).2 G .591(d, the output SEGY).1 F 1.254(\
-\214lename \(or \214les if a datalist is being processed\) will be the \
-input sw)144 573.6 R 1.255(ath \214lename with ".se)-.1 F(gy")-.15 E
-(appended.)144 585.6 Q F2<ad51>108 602.4 Q F1 -.45(ro)22.52 G
-(utetime\214le).45 E F0 1.612(This option speci\214es route \214le cont\
-aining the times that the surv)144 614.4 R 1.911 -.15(ey r)-.15 H 1.611
-(eached the intended w).15 F(ay-)-.1 E(points. This te)144 626.4 Q
-(xt \214le consists of lines of the form:)-.15 E(count w)180 638.4 Q
-(aypoint longitude latitude heading time_d)-.1 E .327
-(where count is just an inte)144 650.4 R .327
-(ger counter starting at 0, w)-.15 F .327(aypoint is the w)-.1 F .327
-(aypoint number starting at 0,)-.1 F .013
-(longitude and latitude are the w)144 662.4 R .013
-(aypoint position in decimal de)-.1 F .012
-(grees, heading is the heading in deci-)-.15 F .577(mal de)144 674.4 R
-.577(grees, and time_d is the unix or epoch time \(time since 00:00:00 \
-January 1, 1970\) in deci-)-.15 F .691(mal seconds that the surv)144
-686.4 R .991 -.15(ey r)-.15 H .691(eached this w).15 F .69
-(aypoint. This \214le can be generated from an)-.1 F F2(mbgrdviz)3.19 E
-F0 1.264(route \214le and surv)144 698.4 R 1.564 -.15(ey d)-.15 H 1.265
-(ata using the program).15 F F2(mbr)3.765 E(outetime)-.18 E F0 6.265(.I)
-C(f)-6.265 E F1 -.45(ro)3.765 G(utetime\214le).45 E F0 1.265
-(is speci\214ed,)3.765 F F2(mbex-)3.765 E(tractsegy)144 710.4 Q F0 .969
-(will output SEGY data in \214les corresponding to the planned surv)
-3.469 F 1.268 -.15(ey l)-.15 H 3.468(ines. The).15 F(output)3.468 E .282
-(SEGY \214le names will be based on)144 722.4 R F1(liner)2.782 E(oot)
--.45 E F0 .283(and will include the line number starting with)2.782 F F1
-(starline)2.783 E F0(,)A(MB-System 5.0)72 768 Q 2.5(3J)146.495 G
-(une 2013)-2.5 E(2)204.835 E 0 Cg EP
-%%Page: 3 3
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mbe)72 48 Q(xtractse)-.15 E 130.15
-(gy\(1\) MB-System)-.15 F 130.15(5.0 mbe)2.5 F(xtractse)-.15 E(gy\(1\))
--.15 E .699(both of which are speci\214ed using the)144 84 R/F1 10
-/Times-Bold at 0 SF<ad4c>3.198 E F0 3.198(options. If)3.198 F(neither)3.198
-E F1<ad4f>3.198 E F0(nore)3.198 E F1<ad52>3.198 E F0 .698(are in)3.198 F
--.2(vo)-.4 G -.1(ke).2 G .698(d, the output).1 F 1.425(SEGY \214lename \
-\(or \214les if a datalist is being processed\) will be the input sw)144
-96 R 1.425(ath \214lename with)-.1 F(".se)144 108 Q(gy" appended.)-.15 E
-F1<ad52>108 124.8 Q/F2 10/Times-Italic at 0 SF -.45(ro)23.08 G(ute\214le)
-.45 E F0 1.003(This option speci\214es an)144 136.8 R F1(mbgrdviz)3.502
-E F0 1.002(route \214le containing the intended w)3.502 F 1.002
-(aypoints of the surv)-.1 F -.15(ey)-.15 G 3.502(.I)-.5 G(f)-3.502 E F2
--.45(ro)144 148.8 S(ute\214le).45 E F0 .499(is speci\214ed,)2.999 F F1
-(mbextractsegy)2.999 E F0 .499
-(will output SEGY data in \214les corresponding to the planned)2.999 F
-(surv)144 160.8 Q .356 -.15(ey l)-.15 H 2.556(ines. The).15 F .055
-(output SEGY \214le names will be based on)2.556 F F2(liner)2.555 E(oot)
--.45 E F0 .055(and will include the line num-)2.555 F .133
-(ber starting with)144 172.8 R F2(starline)2.633 E F0 2.633(,b)C .133
-(oth of which are speci\214ed using the)-2.633 F F1<ad4c>2.634 E F0
-2.634(options. If)2.634 F(neither)2.634 E F1<ad4f>2.634 E F0(nore)2.634
-E F1<ad52>2.634 E F0 .691(are in)144 184.8 R -.2(vo)-.4 G -.1(ke).2 G
-.691(d, the output SEGY \214lename \(or \214les if a datalist is being \
-processed\) will be the input).1 F(sw)144 196.8 Q
-(ath \214lename with ".se)-.1 E(gy" appended.)-.15 E F1<ad53>108 213.6 Q
-F2(sampleformat)24.74 E F0(Sets the sample format desired for use in th\
-e output SEGY \214le. Options include:)144 225.6 Q(MB_SEGY_SAMPLEFORMA)
-180 237.6 Q 25(T_NONE 1)-1.11 F(MB_SEGY_SAMPLEFORMA)180 249.6 Q(T_TRA)
--1.11 E 22.5(CE 2)-.4 F(MB_SEGY_SAMPLEFORMA)180 261.6 Q 15(T_ENVELOPE 3)
--1.11 F(MB_SEGY_SAMPLEFORMA)180 273.6 Q(T_AN)-1.11 E(AL)-.35 E 15
-(YTIC 4)-1 F(MB_SEGY_SAMPLEFORMA)144 285.6 Q(T_TRA)-1.11 E 1.611
-(CE implies that the seismic trace is in the original, most)-.4 F(ra)144
-297.6 Q 3.805(wf)-.15 G 1.305(orm with both positi)-3.805 F 1.605 -.15
-(ve a)-.25 H 1.305(nd ne).15 F -.05(ga)-.15 G(ti).05 E 1.605 -.15(ve v)
--.25 H 3.805(alues. MB_SEGY_SAMPLEFORMA)-.1 F(T_AN)-1.11 E(AL)-.35 E
-(YTIC)-1 E .275(implies that the trace has been been transformed from t\
-he original time series to an analytic signal)144 309.6 R 1.367(contain\
-ing both real and imaginary parts. Both the real and imaginary signals \
-are stored in the)144 321.6 R 2.59(SEGY \214le. MB_SEGY_SAMPLEFORMA)144
-333.6 R 2.59(T_ENVELOPE implies that the analytic signal has)-1.11 F
-.912(been reduced back to a single real, positi)144 345.6 R -.15(ve)-.25
-G .912(-only en).15 F -.15(ve)-.4 G .912
-(lope signal by taking the magnitude of the).15 F 1.473
-(real and imaginary parts at e)144 357.6 R -.15(ve)-.25 G 1.473
-(ry sample.).15 F 1.473
-(It is important to note that this option only sets the)6.473 F 1.508(d\
-esired sample format, and the program may \214nd it necessary to store \
-the data in an alternate)144 369.6 R 7.278(form. F)144 381.6 R 7.279
-(or instance, if the user speci\214es MB_SEGY_SAMPLEFORMA)-.15 F(T_TRA)
--1.11 E 7.279(CE or)-.4 F(MB_SEGY_SAMPLEFORMA)144 393.6 Q(T_AN)-1.11 E
-(AL)-.35 E .914(YTIC b)-1 F .914(ut the sw)-.2 F .913
-(ath \214le only contains en)-.1 F -.15(ve)-.4 G .913(lope data, the).15
-F 2.638(data will be written in the en)144 405.6 R -.15(ve)-.4 G 2.638
-(lope form. The def).15 F 2.639(ault v)-.1 F 2.639
-(alue of MB_SEGY_SAMPLEFOR-)-.25 F(MA)144 417.6 Q(T_NONE allo)-1.11 E
-(ws the program to choose the most appropriate sample format.)-.25 E F1
-<ad55>108 434.4 Q F2 -.15(ra)23.08 G(ng).15 E(ethr)-.1 E(eshold)-.37 E
-F0 .518(If the)144 446.4 R F1<ad52>3.018 E F0 .518
-(option is speci\214ed,)3.018 F F1(mbextractsegy)3.018 E F0 .518
-(breaks up the output into \214les corresponding to sur)3.018 F(-)-.2 E
-.897 -.15(vey l)144 458.4 T .597(ines speci\214ed in a route \214le.).15
-F .597(This option sets the threshold distance in meters used to deter)
-5.597 F(-)-.2 E .262(mine when a w)144 470.4 R .262
-(aypoint along the route has been reached; the program considers the ne)
--.1 F .262(xt w)-.15 F(aypoint)-.1 E .684
-(reached when the range to the w)144 482.4 R .684
-(aypoint becomes smaller than)-.1 F F2 -.15(ra)3.184 G(ng).15 E(ethr)-.1
-E(eshold)-.37 E F0 .685(and then ceases to)3.185 F 2.5(decrease. Def)144
-494.4 R(ault:)-.1 E F2 -.15(ra)2.5 G(ng).15 E(ethr)-.1 E(eshold)-.37 E
-F0 2.5(=2)2.5 G 2.5(5m)-2.5 G(.)-2.5 E F1<ad5a>108 511.2 Q F2(plotmax)
-23.63 E F0 1.554(Speci\214es the trace v)144 523.2 R 1.554(alue corresp\
-onding to the maximum grayscale \(black\) in the section plots.)-.25 F
-(Def)144 535.2 Q(ault:)-.1 E F2(plotmax)2.5 E F0 2.5(=5)2.5 G(0.)-2.5 E
-F1<ad56>108 552 Q F0 .749(This option increases the v)23.08 F .749
-(erbosity of)-.15 F F1(mbextractsegy)3.249 E F0 3.249(,c)C .749
-(ausing it to print out messages re)-3.249 F -.05(ga)-.15 G(rding).05 E
-(its progress to stdout.)144 564 Q/F3 10.95/Times-Bold at 0 SF(EXAMPLES)72
-592.8 Q F0 1.211(Suppose that one has collected a set of Reson 7k data\
-\214les incorporating multibeam sonar data, sidescan)108 604.8 R
-(data, and subbottom pro\214ler data, and that the \214lenames are:)108
-616.8 Q(20040722_152111.s7k)144 628.8 Q(20040722_154429.s7k)144 640.8 Q
-(20040722_160809.s7k)144 652.8 Q .695(In order to e)108 676.8 R .695
-(xtract the subbottom data into se)-.15 F .695(gy \214les, one can use)
--.15 F F1(mbextractsegy)3.195 E F0 .696(on each \214le in turn, for)
-3.195 F -.15(ex)108 688.8 S(ample:).15 E(mbe)144 700.8 Q(xtractse)-.15 E
-(gy \255I 20040722_152111.s7k)-.15 E(which yields the follo)108 712.8 Q
-(wing output:)-.25 E(2527 records output to se)144 724.8 Q
-(gy \214le 20040722_154429.s7k.se)-.15 E(gy)-.15 E(MB-System 5.0)72 768
-Q 2.5(3J)146.495 G(une 2013)-2.5 E(3)204.835 E 0 Cg EP
-%%Page: 4 4
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mbe)72 48 Q(xtractse)-.15 E 130.15
-(gy\(1\) MB-System)-.15 F 130.15(5.0 mbe)2.5 F(xtractse)-.15 E(gy\(1\))
--.15 E(In this command the 7k \214le format id of 88 is inferred from t\
-he ".7k" \214lename suf)108 84 Q(\214x.)-.25 E 1.102(One may also input\
- a datalist \214le referencing all of the 7k \214les. The contents of a\
- datalist \214le \(typically)108 108 R(named datalist.mb-1\) w)108 120 Q
-(ould look lik)-.1 E(e:)-.1 E(20040722_152111.s7k 88)144 132 Q
-(20040722_154429.s7k 88)144 144 Q(20040722_160809.s7k 88)144 156 Q 1.134
-(where the second column is the data format id \(see the)108 168 R/F1 10
-/Times-Bold at 0 SF(mbsystem)3.634 E F0 1.134
-(man page for a discussion of datalist)3.634 F(\214les\). T)108 180 Q
-2.5(oo)-.8 G(perate on all the \214les in a single command, use:)-2.5 E
-(mbe)144 192 Q(xtractse)-.15 E(gy \255I datalist.mb-1)-.15 E
-(which yields the follo)110.5 204 Q(wing output:)-.25 E
-(2527 records output to se)144 216 Q(gy \214le 20040722_154429.s7k.se)
--.15 E(gy)-.15 E(2568 records output to se)144 228 Q
-(gy \214le 20040722_160809.s7k.se)-.15 E(gy)-.15 E
-(2569 records output to se)144 240 Q(gy \214le 20040722_163148.s7k.se)
--.15 E(gy)-.15 E(In this command the datalist format id of \2551 is inf\
-erred from the ".mb-1" \214lename suf)108 252 Q(\214x.)-.25 E 1.153
-(Use of the)108 276 R F1<ad56>3.653 E F0 1.153(option causes)3.653 F F1
-(mbextractsegy)3.653 E F0 1.152(to output information about e)3.653 F
--.15(ve)-.25 G 1.152(ry tenth record written to a).15 F(se)108 288 Q
-(gy \214le. So:)-.15 E(mbe)144 300 Q(xtractse)-.15 E
-(gy \255I 20040722_152111.s7k \255V)-.15 E(which yields the follo)108
-312 Q(wing output:)-.25 E(2527 records output to se)144 324 Q
-(gy \214le 20040722_154429.s7k.se)-.15 E(gy)-.15 E
-(Outputting subbottom data to se)144 336 Q
-(gy \214le 20040722_152111.s7k.se)-.15 E(gy)-.15 E 2.476
-(\214le:20040722_152111.s7k record:10 shot:65)144 348 R 2.477
-(2004/204 15:20:42.083 samples:8330 interv)7.477 F(al:64)-.25 E 2.5
-(usec minmax:)108 360 R(0.000000 17487.244141)2.5 E 2.477
-(\214le:20040722_152111.s7k record:20 shot:75)144 372 R 2.476
-(2004/204 15:20:47.698 samples:8330 interv)7.477 F(al:64)-.25 E 2.5
-(usec minmax:)108 384 R(0.000000 16525.875000)2.5 E
-(......... lines omitted ..........)144 396 Q 2.746
-(\214le:20040722_152111.s7k record:2510 shot:2565)144 408 R 2.747
-(2004/204 15:44:05.893 samples:8330 inter)7.747 F(-)-.2 E -.25(va)108
-420 S(l:64 usec).25 E(minmax: 0.000000 17616.189453)5 E 2.747
-(\214le:20040722_152111.s7k record:2520 shot:2575)144 432 R 2.746
-(2004/204 15:44:11.507 samples:8330 inter)7.747 F(-)-.2 E -.25(va)108
-444 S(l:64 usec).25 E(minmax: 0.000000 31888.093750)5 E
-(2527 records output to se)144 456 Q(gy \214le 20040722_152111.s7k.se)
--.15 E(gy)-.15 E F1(MBextractsegy)108 468 Q F0 4.257(also generates a "\
-sinf" \214le containing statistics about the data in the se)6.757 F
-4.258(gy \214le)-.15 F(20040722_152111.s7k.se)108 480 Q(gy)-.15 E 2.5
-(.T)-.65 G(he contents of the sinf \214le 20040722_152111.s7k.se)-2.5 E
-(gy)-.15 E(.sinf are:)-.65 E(SEGY Data File:)144 492 Q
-(20040722_152111.s7k.se)15 E(gy)-.15 E(File Header Info:)144 516 Q 62.5
-(Channels: 1)149 528 R(Auxiliary Channels:)149 540 Q(0)40 E
-(Sample Interv)149 552 Q(al \(usec\):)-.25 E(64)27.5 E
-(Number of Samples in T)149 564 Q 10(race: 8330)-.35 F -.35(Tr)149 576 S
-(ace length \(sec\):).35 E(0.533120)22.5 E(Data F)149 588 Q 37.5
-(ormat: IEEE)-.15 F(32 bit inte)2.5 E(ger)-.15 E(CDP F)149 600 Q 62.5
-(old: 0)-.15 F(Data T)144 624 Q(otals:)-.8 E(Number of T)149 636 Q 35
-(races: 2527)-.35 F(Min Max Delta:)149 648 Q(Shot number:)154 660 Q 10
-(56 2582 2527)50 F(Shot trace:)154 672 Q 20(111)55 G(RP number:)154 684
-Q 10(56 2582 2527)55 F(RP trace:)154 696 Q 20(111)60 G(Delay \(sec\):)
-154 708 Q(0.000000 0.000000 0.000000)35 E(Range \(m\):)154 720 Q
-(0.000000 0.000000 0.000000)40 E(MB-System 5.0)72 768 Q 2.5(3J)146.495 G
-(une 2013)-2.5 E(4)204.835 E 0 Cg EP
-%%Page: 5 5
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mbe)72 48 Q(xtractse)-.15 E 130.15
-(gy\(1\) MB-System)-.15 F 130.15(5.0 mbe)2.5 F(xtractse)-.15 E(gy\(1\))
--.15 E(Recei)154 84 Q -.15(ve)-.25 G 2.5(rE).15 G(le)-2.5 E -.25(va)-.25
-G(tion \(m\):).25 E(\255224.030000 \2552.860000 \255221.170000)7.5 E
-(Source Ele)154 96 Q -.25(va)-.25 G(tion \(m\):).25 E
-(\255224.030000 \2552.860000 \255221.170000)12.5 E(Source Depth \(m\):)
-154 108 Q(2.860000 224.030000 \255221.170000)22.5 E(Recei)154 120 Q -.15
-(ve)-.25 G 2.5(rW).15 G
-(ater Depth \(m\): 51.510000 487.670000 \255436.160000)-3.3 E(Source W)
-154 132 Q(ater Depth \(m\):)-.8 E(51.510000 487.670000 \255436.160000)
-7.5 E(Na)144 156 Q(vig)-.2 E(ation T)-.05 E(otals:)-.8 E(Start of Data:)
-149 180 Q -.35(Ti)154 192 S 2.5(me: 07).35 F(22 2004 15:20:37.029000)2.5
-E(JD204)5 E(Lon: \255121.8573)154 204 Q 5(Lat: 36.7755)12.5 F
-(End of Data:)149 228 Q -.35(Ti)154 240 S 2.5(me: 07).35 F
-(22 2004 15:44:15.438000)2.5 E(JD204)5 E(Lon: \255121.8572)154 252 Q 5
-(Lat: 36.7952)12.5 F(Limits:)144 276 Q(Minimum Longitude:)149 288 Q 5
-(\255121.8574 Maximum)10 F 7.5(Longitude: \255121.8572)2.5 F
-(Minimum Latitude:)149 300 Q 5(36.7755 Maximum)17.5 F 15
-(Latitude: 36.7952)2.5 F/F1 10.95/Times-Bold at 0 SF(SEE ALSO)72 352.8 Q/F2
-10/Times-Bold at 0 SF(mbsystem)108 364.8 Q F0(\(1\),)A F2(mbsegyinf)2.5 E
-(o)-.25 E F0(\(1\),)A F2(mbsegylist)2.5 E F0(\(1\),)A F2(mbsegygrid)2.5
-E F0(\(1\),)A F2(SIOSEIS)2.5 E F0(\(http://sioseis.ucsd.edu/ \))A F1
--.11(BU)72 393.6 S(GS).11 E F0(Doesn')108 405.6 Q 2.5(ts)-.18 G(upport \
-all of the data formats containing subbottom or center beam re\215ectio\
-n data..)-2.5 E(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E
-(5)204.835 E 0 Cg EP
-%%Trailer
-end
-%%EOF
diff --git a/src/ps/mbfilter.ps b/src/ps/mbfilter.ps
deleted file mode 100644
index 5300737..0000000
--- a/src/ps/mbfilter.ps
+++ /dev/null
@@ -1,630 +0,0 @@
-%!PS-Adobe-3.0
-%%Creator: groff version 1.19.2
-%%CreationDate: Wed Jul  1 12:29:27 2015
-%%DocumentNeededResources: font Times-Roman
-%%+ font Times-Bold
-%%+ font Times-Italic
-%%DocumentSuppliedResources: procset grops 1.19 2
-%%Pages: 4
-%%PageOrder: Ascend
-%%DocumentMedia: Default 612 792 0 () ()
-%%Orientation: Portrait
-%%EndComments
-%%BeginDefaults
-%%PageMedia: Default
-%%EndDefaults
-%%BeginProlog
-%%BeginResource: procset grops 1.19 2
-%!PS-Adobe-3.0 Resource-ProcSet
-/setpacking where{
-pop
-currentpacking
-true setpacking
-}if
-/grops 120 dict dup begin
-/SC 32 def
-/A/show load def
-/B{0 SC 3 -1 roll widthshow}bind def
-/C{0 exch ashow}bind def
-/D{0 exch 0 SC 5 2 roll awidthshow}bind def
-/E{0 rmoveto show}bind def
-/F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def
-/G{0 rmoveto 0 exch ashow}bind def
-/H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/I{0 exch rmoveto show}bind def
-/J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def
-/K{0 exch rmoveto 0 exch ashow}bind def
-/L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/M{rmoveto show}bind def
-/N{rmoveto 0 SC 3 -1 roll widthshow}bind def
-/O{rmoveto 0 exch ashow}bind def
-/P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/Q{moveto show}bind def
-/R{moveto 0 SC 3 -1 roll widthshow}bind def
-/S{moveto 0 exch ashow}bind def
-/T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/SF{
-findfont exch
-[exch dup 0 exch 0 exch neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/MF{
-findfont
-[5 2 roll
-0 3 1 roll
-neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/level0 0 def
-/RES 0 def
-/PL 0 def
-/LS 0 def
-/MANUAL{
-statusdict begin/manualfeed true store end
-}bind def
-/PLG{
-gsave newpath clippath pathbbox grestore
-exch pop add exch pop
-}bind def
-/BP{
-/level0 save def
-1 setlinecap
-1 setlinejoin
-72 RES div dup scale
-LS{
-90 rotate
-}{
-0 PL translate
-}ifelse
-1 -1 scale
-}bind def
-/EP{
-level0 restore
-showpage
-}def
-/DA{
-newpath arcn stroke
-}bind def
-/SN{
-transform
-.25 sub exch .25 sub exch
-round .25 add exch round .25 add exch
-itransform
-}bind def
-/DL{
-SN
-moveto
-SN
-lineto stroke
-}bind def
-/DC{
-newpath 0 360 arc closepath
-}bind def
-/TM matrix def
-/DE{
-TM currentmatrix pop
-translate scale newpath 0 0 .5 0 360 arc closepath
-TM setmatrix
-}bind def
-/RC/rcurveto load def
-/RL/rlineto load def
-/ST/stroke load def
-/MT/moveto load def
-/CL/closepath load def
-/Fr{
-setrgbcolor fill
-}bind def
-/setcmykcolor where{
-pop
-/Fk{
-setcmykcolor fill
-}bind def
-}if
-/Fg{
-setgray fill
-}bind def
-/FL/fill load def
-/LW/setlinewidth load def
-/Cr/setrgbcolor load def
-/setcmykcolor where{
-pop
-/Ck/setcmykcolor load def
-}if
-/Cg/setgray load def
-/RE{
-findfont
-dup maxlength 1 index/FontName known not{1 add}if dict begin
-{
-1 index/FID ne{def}{pop pop}ifelse
-}forall
-/Encoding exch def
-dup/FontName exch def
-currentdict end definefont pop
-}bind def
-/DEFS 0 def
-/EBEGIN{
-moveto
-DEFS begin
-}bind def
-/EEND/end load def
-/CNT 0 def
-/level1 0 def
-/PBEGIN{
-/level1 save def
-translate
-div 3 1 roll div exch scale
-neg exch neg exch translate
-0 setgray
-0 setlinecap
-1 setlinewidth
-0 setlinejoin
-10 setmiterlimit
-[]0 setdash
-/setstrokeadjust where{
-pop
-false setstrokeadjust
-}if
-/setoverprint where{
-pop
-false setoverprint
-}if
-newpath
-/CNT countdictstack def
-userdict begin
-/showpage{}def
-/setpagedevice{}def
-}bind def
-/PEND{
-countdictstack CNT sub{end}repeat
-level1 restore
-}bind def
-end def
-/setpacking where{
-pop
-setpacking
-}if
-%%EndResource
-%%EndProlog
-%%BeginSetup
-%%BeginFeature: *PageSize Default
-<< /PageSize [ 612 792 ] /ImagingBBox null >> setpagedevice
-%%EndFeature
-%%IncludeResource: font Times-Roman
-%%IncludeResource: font Times-Bold
-%%IncludeResource: font Times-Italic
-grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72
-def/PL 792 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron/Zcaron
-/scaron/zcaron/Ydieresis/trademark/quotesingle/Euro/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/space/exclam/quotedbl/numbersign/dollar/percent
-/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen
-/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon
-/semicolon/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O
-/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright/circumflex
-/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y
-/z/braceleft/bar/braceright/tilde/.notdef/quotesinglbase/guillemotleft
-/guillemotright/bullet/florin/fraction/perthousand/dagger/daggerdbl
-/endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut
-/dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash
-/quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen
-/brokenbar/section/dieresis/copyright/ordfeminine/guilsinglleft
-/logicalnot/minus/registered/macron/degree/plusminus/twosuperior
-/threesuperior/acute/mu/paragraph/periodcentered/cedilla/onesuperior
-/ordmasculine/guilsinglright/onequarter/onehalf/threequarters
-/questiondown/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE
-/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex
-/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis
-/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn
-/germandbls/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla
-/egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis
-/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide/oslash
-/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis]def
-/Times-Italic at 0 ENC0/Times-Italic RE/Times-Bold at 0 ENC0/Times-Bold RE
-/Times-Roman at 0 ENC0/Times-Roman RE
-%%EndSetup
-%%Page: 1 1
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 156.5(mb\214lter\(1\) MB-System)72 48 R 156.5
-(5.0 mb\214lter\(1\))2.5 F/F1 10.95/Times-Bold at 0 SF -.219(NA)72 84 S(ME)
-.219 E/F2 10/Times-Bold at 0 SF(mb\214lter)108 96 Q F0 3.359<ad41>3.359 G
-.858(pply some simple \214lter functions to sidescan or beam amplitude \
-data from sw)-3.359 F .858(ath sonar data)-.1 F(\214les.)108 108 Q F1
-(VERSION)72 136.8 Q F0 -1.11(Ve)108 148.8 S(rsion 5.0)1.11 E F1
-(SYNOPSIS)72 177.6 Q F2(mb\214lter)108 189.6 Q F0([)4.225 E F2<ad41>A/F3
-10/Times-Italic at 0 SF(kind)A F2<ad42>4.225 E F3(yr/mo/da/hr/mn/sc)A F2
-<ad43>4.225 E F3(mode/xdim/ldim/iter)A(ation)-.15 E F2<ad44>4.225 E F3
-(mode/xdim/ldim/iter)A(ation[/of)-.15 E(fset])-.18 E F2<ad45>108 201.6 Q
-F3(yr/mo/da/hr/mn/sc)A F2<ad46>5.46 E F3(format)A F2<ad49>5.46 E F3
-(in\214le)A F2<ad4e>5.46 E F3 -.2(bu)C -.18(ff).2 G(er).18 E(size)-.1 E
-F2<ad52>5.46 E F3(west/east/south/north)A F2<ad53>5.46 E F3
-(mode/xdim/ldim/iter)A(a-)-.15 E(tion[/thr)108 213.6 Q(eshold_lo/thr)
--.37 E(eshold_hi])-.37 E F2(\255V \255H])2.5 E F1(DESCRIPTION)72 242.4 Q
-F2(mb\214lter)108 254.4 Q F0 1.222(applies one or more simple \214lters\
- to the speci\214ed sidescan or beam amplitude data. The \214lters)3.721
-F(include:)108 266.4 Q(\255S1: boxcar mean for lo)113 278.4 Q
-(w-pass \214ltering)-.25 E(\255S2: g)113 290.4 Q(aussian mean for lo)
--.05 E(w-pass \214ltering)-.25 E(\255S3: boxcar median for lo)113 302.4
-Q(w-pass \214ltering)-.25 E(\255S4: in)113 314.4 Q -.15(ve)-.4 G
-(rse gradient for lo).15 E(w-pass \214ltering)-.25 E
-(\255D1: boxcar mean subtraction for high-pass \214ltering)113 326.4 Q
-(\255D2: g)113 338.4 Q
-(aussian mean subtraction for high-pass \214ltering)-.05 E
-(\255D3: boxcar median subtraction for high-pass \214ltering)113 350.4 Q
-(\255C1: edge detection for contrast enhancement)113 362.4 Q
-(\255C2: gradient magnitude subtraction for contrast enhancement)113
-374.4 Q .378(These \214lters are mostly intended for use with sidescan \
-data. In particular)108 398.4 R 2.877(,t)-.4 G .377(he lo)-2.877 F .377
-(w-pass or smoothing \214lters)-.25 F 1.789(can be used for \214rst-ord\
-er speckle reduction in sidescan data, and the high-pass \214lters can \
-be used to)108 410.4 R .125
-(emphasize \214ne scale structure in the data. A combination of lo)108
-422.4 R .124(w-pass and high-pass \214ltering can ef)-.25 F(fecti)-.25 E
--.15(ve)-.25 G(ly).15 E .383(perform band-pass \214ltering. The contras\
-t enhancing \214lters can, under certain circumstances, sharpen sides-)
-108 434.4 R 1.275(can images of the sea\215oor)108 446.4 R 3.775(.T)-.55
-G 1.275(he lo)-3.775 F 1.275(w-pass and contrast enhancement \214lters \
-are described in the paper by)-.25 F(Sauter and P)108 458.4 Q
-(arson \(1994\) listed belo)-.15 E -.65(w.)-.25 G .562(The \214ltering \
-used here is designed and applied in the same manner as spatial \214lte\
-rs are applied to images.)108 482.4 R .386(The sw)108 494.4 R .386(ath \
-data is treated as an image, with the x and y coordinates corresponding\
- to pix)-.1 F .385(el \(or beam\) num-)-.15 F 1.476(ber and ping number)
-108 506.4 R 3.976(,r)-.4 G(especti)-3.976 E -.15(ve)-.25 G(ly).15 E
-3.976(.T)-.65 G 1.477
-(he \214lters consist of M x N matrices which are con)-3.976 F -.2(vo)
--.4 G(lv).2 E 1.477(ed with the)-.15 F(sw)108 518.4 Q .361(ath data ima\
-ge \(M is the \214lter dimension in the acrosstrack direction and N is \
-the \214lter dimension in the)-.1 F(alongtrack direction\).)108 530.4 Q
-(Missing or \215agged data are ignored in the \214ltering process.)5 E
-(Lo)108 554.4 Q 2.521(w-pass \214lters are speci\214ed with the)-.25 F
-F2<ad53>5.021 E F0 2.521(option, high-pass \214lters with the)5.021 F F2
-<ad44>5.022 E F0 2.522(option, and contrast)5.022 F .201
-(enhancement with the)108 566.4 R F2<ad43>2.701 E F0 .201
-(option. Users can apply up to ten \214lters in an)2.701 F 2.7(yo)-.15 G
-.2(rder; the \214lters are applied in the)-2.7 F .227
-(order in which the)108 578.4 R 2.728(ya)-.15 G .228
-(re speci\214ed on the command line.)-2.728 F .228
-(Users can apply as man)5.228 F 2.728(yi)-.15 G .228
-(terations of each \214lter as)-2.728 F .514
-(desired. The user speci\214es the windo)108 590.4 R 3.014(ws)-.25 G
-.514
-(ize used by the \214lters \(3x3 or 5x5 are typical for using smoothing)
--3.014 F(\214lters iterati)108 602.4 Q -.15(ve)-.25 G
-(ly to reduce speckle; lar).15 E(ger windo)-.18 E(ws lik)-.25 E 2.5(e3)
--.1 G(x20 are typical for high-pass \214ltering\).)-2.5 E .666
-(The boxcar mean, g)108 626.4 R .667
-(aussian mean, and median \214lter all achie)-.05 F .967 -.15(ve s)-.25
-H .667(imilar results in uniformly smoothing the).15 F .318
-(data; the boxcar mean is f)108 638.4 R .317(aster to apply)-.1 F 2.817
-(,t)-.65 G .317(he g)-2.817 F .317(aussian mean preserv)-.05 F .317
-(es the frequenc)-.15 F 2.817(yc)-.15 G .317(ontent of the data bet-)
--2.817 F(ter)108 650.4 Q 2.776(,a)-.4 G .276
-(nd the median \214lter is least sensiti)-2.776 F .576 -.15(ve t)-.25 H
-2.776(os).15 G(pik)-2.776 E .276(es in the data. The in)-.1 F -.15(ve)
--.4 G .276(rse gradient \214lter applies a).15 F -.15(ve)-.2 G(raging)
-.15 E .229(weights which depend on the in)108 662.4 R -.15(ve)-.4 G .228
-(rse gradient of the data. This approach causes the \214lter to smooth \
-re).15 F(gions)-.15 E .859(without distinct edges much more than re)108
-674.4 R .859(gions with edges, thus tending to preserv)-.15 F 3.36(et)
--.15 G .86(he sharpness of fea-)-3.36 F
-(tures more than the simpler smoothing \214lters.)108 686.4 Q .361
-(The median smoothing \214lter can be set by the)108 710.4 R F2<ad54>
-2.861 E F0 .361(option to operate with lo)2.861 F 2.861(wa)-.25 G .361
-(nd high ratio thresholds \(the)-2.861 F -.25(va)108 722.4 S 1.065
-(lue is changed only if the original v).25 F 1.065(alue di)-.25 F 1.065
-(vided by the median v)-.25 F 1.066(alue is less than the lo)-.25 F
-3.566(wt)-.25 G 1.066(hreshold or)-3.566 F(MB-System 5.0)72 768 Q 2.5
-(3J)146.495 G(une 2013)-2.5 E(1)204.835 E 0 Cg EP
-%%Page: 2 2
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 156.5(mb\214lter\(1\) MB-System)72 48 R 156.5
-(5.0 mb\214lter\(1\))2.5 F .784
-(greater than the high threshold\). This allo)108 84 R .784
-(ws the \214lter to preferentially despik)-.25 F 3.284(et)-.1 G .783
-(he data. In particular)-3.284 F 3.283(,t)-.4 G(his)-3.283 E .361
-(approach is useful for suppressing "stripes" or "bad" pings which ha)
-108 96 R .662 -.15(ve a)-.2 H .362(mplitude or sidescan v).15 F .362
-(alues dif)-.25 F(fer)-.25 E(-)-.2 E
-(ing signi\214cantly from surrounding pings.)108 108 Q .121
-(The high-pass \214lters are constructed by calculating a lo)108 132 R
-.121(w-pass \214ltered v)-.25 F .12
-(ersion of the data and then subtract-)-.15 F .641
-(ing that from the original data. An of)108 144 R .641(fset v)-.25 F
-.641(alue is added to the high-passed data so that it is positi)-.25 F
-.941 -.15(ve \()-.25 H(ne).15 E(g-)-.15 E(ati)108 156 Q .426 -.15(ve v)
--.25 H .126
-(alues are considered \215agged as bad in some formats and not allo)-.1
-F .126(wed in others\).)-.25 F .125(The high-pass \214lters)5.126 F .872
-(can be used to remo)108 168 R 1.173 -.15(ve l)-.15 H(ong-w).15 E -2.25
--.2(av e)-.1 H .873(length v).2 F .873
-(ariations in sea\215oor re\215ecti)-.25 F .873
-(vity in order to emphasize \214ne-scale)-.25 F(structure.)108 180 Q
-1.294(The contrast enhancement \214lters are generally only successful \
-when applied after smoothing because of)108 204 R 1.004(their tendenc)
-108 216 R 3.504(yt)-.15 G 3.504(oa)-3.504 G 1.004(mplify noise. The edg\
-e detection \214lter enhances contrast by tending to shift v)-3.504 F
-1.005(alues on)-.25 F .085(either side of a boundary a)108 228 R -.1(wa)
--.15 G 2.585(yf).1 G .085(rom the a)-2.585 F -.15(ve)-.2 G .085(rage v)
-.15 F .085(alue across the boundary)-.25 F 2.585(.A5X5)-.65 G .084
-(\214lter or lar)-.001 F .084(ger is gener)-.18 F(-)-.2 E .991(ally req\
-uired for success with the edge detection algorithm. The gradient \214l\
-ter increases contrast by sub-)108 240 R
-(tracting twice the local gradient magnitude from each v)108 252 Q
-(alue.)-.25 E .275(The \214ltered amplitude or sidescan data are writte\
-n to ancilliary \214les located parallel to the input sw)108 276 R .274
-(ath data)-.1 F .018(\214les. Filtered amplitude data will be in \214le\
-s named by adding ".f)108 288 R -.1(fa)-.25 G 2.518("t).1 G 2.518(ot)
--2.518 G .018(he input \214le name, and sidescan data)-2.518 F .505
-(will be in \214les with an ".f)108 300 R .505(fs" suf)-.25 F 3.005
-(\214x. Filtered)-.25 F .505
-(amplitude or sidescan data can be plotted with)3.005 F/F1 10
-/Times-Bold at 0 SF(mbm_plot)3.005 E F0(by)3.005 E 1
-(appending "F" to that macro')108 312 R 3.5(sm)-.55 G 1(ode ar)-3.5 F 1
-(gument \(e.g.)-.18 F F1<ad47>3.5 E/F2 10/Times-Italic at 0 SF(4F)A F0 1
-(for \214ltered amplitude data, and)3.5 F F1<ad47>6 E F2(5F)A F0 1
-(for \214l-)3.5 F .028(tered sidescan data\).)108 324 R .028
-(If accessing)5.028 F F1(mbswath)2.528 E F0 .027
-(directly rather than through)2.527 F F1(mbm_plot)2.527 E F0 2.527(,p)C
-.027(lot the \214ltered data by)-2.527 F .756
-(appending "F" to the program')108 336 R 3.257(sm)-.55 G .757(ode ar)
--3.257 F .757(gument \(e.g.)-.18 F F1<ad5a>3.257 E F2(4F)A F0 .757
-(for \214ltered amplitude data, and)3.257 F F1<ad5a>5.757 E F2(5F)A F0
-.757(for \214l-)3.257 F .176(tered sidescan data\).)108 348 R .176
-(When using)5.176 F F1(mbmosaic)2.676 E F0 .176
-(to generate mosaics of amplitude or sidescan data, the \214ltered)2.676
-F .474(data can be accessed by appending "F" to the data kind ar)108 360
-R .475(gument \(e.g.)-.18 F F1<ad41>2.975 E F2(3F)A F0 .475
-(for amplitude and)2.975 F F1<ad41>5.475 E F2(4F)A F0(for)2.975 E
-(sidescan data.)108 372 Q/F3 10.95/Times-Bold at 0 SF -.548(AU)72 400.8 S
-(THORSHIP).548 E F0(Da)108 412.8 Q(vid W)-.2 E 2.5(.C)-.92 G
-(aress \(caress at mbari.or)-2.5 E(g\))-.18 E(Montere)113 424.8 Q 2.5(yB)
--.15 G(ay Aquarium Research Institute)-2.5 E
-(Dale N. Chayes \(dale at ldeo.columbia.edu\))108 436.8 Q
-(Lamont-Doherty Earth Observ)113 448.8 Q(atory)-.25 E F3(OPTIONS)72
-477.6 Q F1<ad41>108 489.6 Q F2(kind)23.08 E F0 1.413
-(Determines whether beam amplitude \()144 501.6 R F2(kind)A F0 3.913(=1)
-3.913 G 1.413(\), or sidescan \()-3.913 F F2(kind)A F0 3.912(=2)3.913 G
-3.912(\)d)-3.912 G 1.412(ata will be processed.)-3.912 F(Def)144 513.6 Q
-(ault:)-.1 E F2(kind)2.5 E F0 2.5(=2)2.5 G(.)-2.5 E F1<ad42>108 530.4 Q
-F2(yr/mo/da/hr/mn/sc)23.63 E F0 .155
-(This option sets the starting time for data allo)144 542.4 R .155
-(wed in the input data.)-.25 F(The)5.155 E F1<ad45>2.655 E F0 .155
-(option sets the ending)2.655 F .195
-(time for data. If the starting time is before the ending time, then an)
-144 554.4 R 2.695(yd)-.15 G .195(ata with a time stamp before)-2.695 F
-.444(the starting time or after the ending time is ignored. If instead \
-the starting time is after the ending)144 566.4 R .195(time, then an)144
-578.4 R 2.695(yd)-.15 G .194(ata between the ending and starting time w\
-ill be ignored. This scheme allo)-2.695 F .194(ws time)-.25 F(windo)144
-590.4 Q 5.376(wing both inside and outside a speci\214ed interv)-.25 F
-7.876(al. Def)-.25 F(ault:)-.1 E F2(yr/mo/da/hr/mn/sc)7.876 E F0(=)7.876
-E(1962/2/21/10/30/0.)144 602.4 Q F1<ad43>108 619.2 Q F2
-(mode/xdim/ldim/iter)23.08 E(ation)-.15 E F0 -.45(Tu)144 631.2 S .139(r\
-ns on contrast enhancement \214ltering and sets the \214lter parameters\
- to be used. Here).45 F F2(mode)2.639 E F0(speci-)2.639 E
-(\214es the \214lter type:)144 643.2 Q F2(mode)180 655.2 Q F0 2.5(=1:E)
-2.5 G(dge Detection Filter)-2.5 E F2(mode)180 667.2 Q F0 2.5(=2:G)2.5 G
-(radient Magnitude Subtraction Filter)-2.5 E 1.601
-(The dimensions of the data windo)144 679.2 R 4.101(wu)-.25 G 1.601
-(sed are set using)-4.101 F F2(xdim)4.102 E F0 1.602
-(\(acrosstrack dimension\) and)4.102 F F2(ldim)4.102 E F0 .37
-(\(alongtrack dimension\).)144 691.2 R -1.11(Va)5.37 G .37(lues of)1.11
-F F2(xdim)2.87 E F0 2.87(=5a)2.87 G(nd)-2.87 E F2(ldim)2.869 E F0 2.869
-(=5a)2.869 G .369(re typical, b)-2.869 F .369(ut lar)-.2 F .369
-(ger or smaller dimen-)-.18 F .656(sions can be used.)144 703.2 R(The)
-5.656 E F2(iter)3.156 E(ation)-.15 E F0 -.25(va)3.156 G .657
-(lue speci\214es the number of times the \214lter is applied; there is)
-.25 F(no limit to this v)144 715.2 Q 2.5(alue. Def)-.25 F
-(ault: contrast enhancement of)-.1 E(f,)-.25 E F2(xdim)2.5 E F0 2.5(=5)
-2.5 G(,)-2.5 E F2(ldim)2.5 E F0 2.5(=5)2.5 G(,)-2.5 E F2(iter)2.5 E
-(ation)-.15 E F0 2.5(=1)2.5 G(.)-2.5 E(MB-System 5.0)72 768 Q 2.5(3J)
-146.495 G(une 2013)-2.5 E(2)204.835 E 0 Cg EP
-%%Page: 3 3
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 156.5(mb\214lter\(1\) MB-System)72 48 R 156.5
-(5.0 mb\214lter\(1\))2.5 F/F1 10/Times-Bold at 0 SF<ad44>108 84 Q/F2 10
-/Times-Italic at 0 SF(mode/xdim/ldim/iter)23.08 E(ation/of)-.15 E(fset)-.18
-E F0 -.45(Tu)144 96 S .251(rns on high-pass \214ltering and sets the \
-\214lter parameters to be used. Here).45 F F2(mode)2.75 E F0 .25
-(speci\214es the \214lter)2.75 F(type:)144 108 Q F2(mode)180 120 Q F0
-2.5(=1:B)2.5 G(oxcar Mean Subtraction Filter)-2.5 E F2(mode)180 132 Q F0
-2.5(=2:G)2.5 G(aussian Mean Subtraction Filter)-2.5 E F2(mode)180 144 Q
-F0 2.5(=3:B)2.5 G(oxcar Median Subtraction Filter)-2.5 E 1.601
-(The dimensions of the data windo)144 156 R 4.101(wu)-.25 G 1.601
-(sed are set using)-4.101 F F2(xdim)4.102 E F0 1.602
-(\(acrosstrack dimension\) and)4.102 F F2(ldim)4.102 E F0 .206
-(\(alongtrack dimension\).)144 168 R -1.11(Va)5.206 G .206(lues of)1.11
-F F2(xdim)2.706 E F0 2.706(=3a)2.706 G(nd)-2.706 E F2(ldim)2.706 E F0
-2.706(=3a)2.706 G .206(re typical, b)-2.706 F .206(ut lar)-.2 F .205
-(ger dimensions can be)-.18 F .217(used. The)144 180 R F2(iter)2.717 E
-(ation)-.15 E F0 -.25(va)2.717 G .217(lue speci\214es the number of tim\
-es the \214lter is applied; there is no limit to this).25 F -.25(va)144
-192 S .261(lue, b).25 F .261
-(ut high-pass \214lters are generally only applied once. The)-.2 F F2
-(of)2.761 E(fset)-.18 E F0 -.25(va)2.76 G .26
-(lue is added to each high-).25 F .555(pass \214ltered v)144 204 R .556
-(alue to force the results to be positi)-.25 F -.15(ve)-.25 G 3.056(;t)
-.15 G .556(his v)-3.056 F .556(alue should be chosen according to the)
--.25 F 1.592(range of v)144 216 R 1.592(alues allo)-.25 F 1.592(wed in \
-the data type and data formats being used \(e.g. for SeaBeam 2100)-.25 F
-.171(sidescan as represented in format 41, the sidescan v)144 228 R .172
-(alues can range from 1 to 65535, so an)-.25 F F2(of)2.672 E(fset)-.18 E
-F0(=)2.672 E .783(1000 is appropriate\).)144 240 R(Def)5.783 E .783
-(ault: high-pass \214ltering of)-.1 F(f,)-.25 E F2(xdim)3.283 E F0 3.283
-(=3)3.283 G(,)-3.283 E F2(ldim)3.283 E F0 3.283(=1)3.283 G(0,)-3.283 E
-F2(iter)3.283 E(ation)-.15 E F0 3.283(=1)3.283 G(,)-3.283 E F2(of)3.283
-E(fset)-.18 E F0(=)3.282 E(1000.)144 252 Q F1<ad45>108 268.8 Q F2
-(yr/mo/da/hr/mn/sc)23.63 E F0 .155
-(This option sets the ending time for data allo)144 280.8 R .155
-(wed in the input data.)-.25 F(The)5.155 E F1<ad42>2.655 E F0 .155
-(option sets the starting)2.655 F .195
-(time for data. If the starting time is before the ending time, then an)
-144 292.8 R 2.695(yd)-.15 G .195(ata with a time stamp before)-2.695 F
-.444(the starting time or after the ending time is ignored. If instead \
-the starting time is after the ending)144 304.8 R .195(time, then an)144
-316.8 R 2.695(yd)-.15 G .194(ata between the ending and starting time w\
-ill be ignored. This scheme allo)-2.695 F .194(ws time)-.25 F(windo)144
-328.8 Q 5.376(wing both inside and outside a speci\214ed interv)-.25 F
-7.876(al. Def)-.25 F(ault:)-.1 E F2(yr/mo/da/hr/mn/sc)7.876 E F0(=)7.876
-E(2062/2/21/10/30/0.)144 340.8 Q F1<ad46>108 357.6 Q F2(format)24.19 E
-F0 .092(Sets the MBIO inte)144 369.6 R .092
-(ger format identi\214er for the input \214le)-.15 F 2.592
-(speci\214ed with)5.092 F 2.592(the \255I)2.592 F .091(option. By def)
-2.592 F(ault,)-.1 E .265(mb\214lter deri)144 381.6 R -.15(ve)-.25 G
-2.765(st).15 G .265(he format id from the mbpro- cess parameter \214le \
-associated with the input \214le \(-I)-2.765 F(option\) or)144 393.6 Q
-2.5(,i)-.4 G 5(fn)-2.5 G(ec- essary)-5 E 2.5(,i)-.65 G
-(nfers the format from the "*.mbXX" MB-System suf)-2.5 E(\214x con)-.25
-E -.15(ve)-.4 G(ntion.).15 E F1<ad48>108 410.4 Q F0 .391(This "help" \
-\215ag causes the program to print out a description of its operation a\
-nd then e)22.52 F .39(xit imme-)-.15 F(diately)144 422.4 Q(.)-.65 E F1
-<ad49>108 439.2 Q F2(in\214le)26.41 E F0(Sw)144 451.2 Q .6
-(ath data \214le from which the input data will be read, or a datalist)
--.1 F .601(\214le containing a list of input)5.601 F(sw)144 463.2 Q .409
-(ath data \214les and/or other datalist \214les. If in\214le is a datal\
-ist \214le, then mbprocess will attempt to)-.1 F(process all)144 475.2 Q
-(data \214les identi\214ed by recursi)5 E -.15(ve)-.25 G
-(ly reading in\214le.).15 E(Def)5 E(ault:)-.1 E F2(in\214le)2.5 E F0 2.5
-(=")2.5 G(datalist.mb-1")-2.5 E F1<ad4e>108 492 Q F2 -.2(bu)23.08 G -.18
-(ff).2 G(er).18 E(size)-.1 E F0 1.624
-(Sets the maximum number of data records which can be read into the b)
-144 504 R(uf)-.2 E(fer)-.25 E 4.124(.I)-.55 G 4.124(ng)-4.124 G 1.624
-(eneral, data)-4.124 F .253(records may be of se)144 516 R -.15(ve)-.25
-G .253(ral dif).15 F .253(ferent types \(e.g. parameter)-.25 F 2.753(,p)
--.4 G .253(osition, comment\) in addition to surv)-2.753 F -.15(ey)-.15
-G 2.607(data records. Man)144 528 R 5.107(yd)-.15 G 2.608
-(ata formats include man)-5.107 F 5.108(ym)-.15 G 2.608
-(ore position data records than surv)-5.108 F 2.908 -.15(ey d)-.15 H
-(ata).15 E 2.23(records. Thus, a lar)144 540 R 2.23(ge b)-.18 F(uf)-.2 E
-2.229(fer may be required to access a reasonable number of surv)-.25 F
-2.529 -.15(ey d)-.15 H(ata).15 E 3.355(records. Ho)144 552 R(we)-.25 E
--.15(ve)-.25 G 1.655 -.4(r, o).15 H 3.355(nm).4 G .855
-(emory limited machines lar)-3.355 F .855(ge b)-.18 F(uf)-.2 E .856
-(fer sizes can lead to poor performance)-.25 F .357(due to memory sw)144
-564 R 2.857(apping. The)-.1 F(def)2.857 E .357(ault v)-.1 F .357
-(alue of)-.25 F F2 -.2(bu)2.857 G -.18(ff).2 G(er).18 E(size)-.1 E F0
-2.857(=5)2.857 G .357(00 is appropriate for most cases, b)-2.857 F(ut)
--.2 E 1.416(users can set the b)144 576 R(uf)-.2 E 1.417
-(fer size as required.)-.25 F 1.417(The absolute maximum b)6.417 F(uf)
--.2 E 1.417(fer size is 5000.)-.25 F(Def)6.417 E(ault:)-.1 E F2 -.2(bu)
-144 588 S -.18(ff).2 G(er).18 E(size)-.1 E F0 2.5(=5)2.5 G(00.)-2.5 E F1
-<ad52>108 604.8 Q F2(west/east/south/north)23.08 E F0 .679
-(Sets the longitude and latitude bounds within which sw)144 616.8 R .679
-(ath sonar data will be read. Only the data)-.1 F 3.093
-(which lies within these bounds will be copied.)144 628.8 R(Def)8.094 E
-(ault:)-.1 E F2(west)5.594 E F0 3.094(=\255360, east)B F2(=360)A F0(,)A
-F2(south)5.594 E F0(=\25590,)A F2(north)144 640.8 Q F0(=90.)A F1<ad53>
-108 657.6 Q F2(mode/xdim/ldim/iter)24.74 E(ation)-.15 E F0 -.45(Tu)144
-669.6 S .334(rns on lo).45 F .334(w-pass smoothing \214ltering and sets\
- the \214lter parameters to be used to smooth the data.)-.25 F(Here)144
-681.6 Q F2(mode)2.5 E F0(speci\214es the \214lter type:)2.5 E F2(mode)
-180 693.6 Q F0 2.5(=1:B)2.5 G(oxcar Mean Filter)-2.5 E F2(mode)180 705.6
-Q F0 2.5(=2:G)2.5 G(aussian Mean Filter)-2.5 E F2(mode)180 717.6 Q F0
-2.5(=3:B)2.5 G(oxcar Median Filter)-2.5 E F2(mode)180 729.6 Q F0 2.5
-(=4:B)2.5 G(oxcar In)-2.5 E -.15(ve)-.4 G(rse Gradient Filter).15 E
-(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(3)204.835 E 0
-Cg EP
-%%Page: 4 4
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 156.5(mb\214lter\(1\) MB-System)72 48 R 156.5
-(5.0 mb\214lter\(1\))2.5 F 1.601(The dimensions of the data windo)144 84
-R 4.101(wu)-.25 G 1.601(sed are set using)-4.101 F/F1 10/Times-Italic at 0
-SF(xdim)4.102 E F0 1.602(\(acrosstrack dimension\) and)4.102 F F1(ldim)
-4.102 E F0 .206(\(alongtrack dimension\).)144 96 R -1.11(Va)5.206 G .206
-(lues of)1.11 F F1(xdim)2.706 E F0 2.706(=3a)2.706 G(nd)-2.706 E F1
-(ldim)2.706 E F0 2.706(=3a)2.706 G .206(re typical, b)-2.706 F .206
-(ut lar)-.2 F .205(ger dimensions can be)-.18 F .217(used. The)144 108 R
-F1(iter)2.717 E(ation)-.15 E F0 -.25(va)2.717 G .217(lue speci\214es th\
-e number of times the \214lter is applied; there is no limit to this).25
-F -.25(va)144 120 S 2.5(lue. Def).25 F(ault:)-.1 E F1(mode)2.5 E F0 2.5
-(=1)2.5 G(,)-2.5 E F1(xdim)2.5 E F0 2.5(=3)2.5 G(,)-2.5 E F1(ldim)2.5 E
-F0 2.5(=3)2.5 G(,)-2.5 E F1(iter)2.5 E(ation)-.15 E F0 2.5(=1)2.5 G(.)
--2.5 E/F2 10/Times-Bold at 0 SF<ad54>108 136.8 Q F1(thr)23.63 E
-(eshold_lo/thr)-.37 E(eshold_hi)-.37 E F0 .734(This option causes the b\
-oxcar median smoothing \214lter to operate with lo)144 148.8 R 3.234(wa)
--.25 G .734(nd high ratio thresh-)-3.234 F 1.737(olds \(the v)144 160.8
-R 1.737(alue is changed only if the original v)-.25 F 1.738(alue di)-.25
-F 1.738(vided by the median v)-.25 F 1.738(alue is less than)-.25 F F1
-(thr)144 172.8 Q(eshold_lo)-.37 E F0 .443(or greater than)2.943 F F1
-(thr)2.943 E(eshold_hi)-.37 E F0 .442(\). This allo)B .442
-(ws the \214lter to preferentially despik)-.25 F 2.942(et)-.1 G .442
-(he data.)-2.942 F .094(In particular)144 184.8 R 2.594(,t)-.4 G .094(h\
-is approach is useful for suppressing "stripes" or "bad" pings which ha)
--2.594 F .395 -.15(ve a)-.2 H(mplitude).15 E .339(or sidescan v)144
-196.8 R .339(alues dif)-.25 F .338
-(fering signi\214cantly from surrounding pings. This option only w)-.25
-F .338(orks with the)-.1 F(median smoothing \214lter)144 208.8 Q(.)-.55
-E F2<ad56>108 225.6 Q F0(Normally)23.08 E(,)-.65 E F2(mb\214lter)3.59 E
-F0 -.1(wo)3.59 G 1.09(rks "silently" without outputting an).1 F 1.09
-(ything to the stderr stream.)-.15 F 1.09(If the)6.09 F F2<ad56>3.59 E
-F0 1.431(\215ag is gi)144 237.6 R -.15(ve)-.25 G 1.431(n, then).15 F F2
-(mb\214lter)3.931 E F0 -.1(wo)3.931 G 1.431(rks in a "v).1 F 1.43
-(erbose" mode and outputs the program v)-.15 F 1.43(ersion being)-.15 F
-(used, the v)144 249.6 Q(alues of some important control parameters, an\
-d all error status messages.)-.25 E/F3 10.95/Times-Bold at 0 SF(EXAMPLES)72
-278.4 Q F0 1.017(Suppose one has a SeaBeam 2100 data \214le called test\
-.mb41 which contains bath)108 290.4 R 1.017(ymetry \(121 beams in a)-.05
-F .408(120 de)108 302.4 R .408(gree sw)-.15 F .408
-(ath\), beam amplitude \(121 beams coincident with bath)-.1 F .408
-(ymetry\), and sidescan data \(2000 pix-)-.05 F 1.325
-(els, roughly a 150 de)108 314.4 R 1.325(gree sw)-.15 F 1.326
-(ath\) which has been corrected for the amplitude vs grazing angle v)-.1
-F(ariation)-.25 E .606(using the program)108 326.4 R F2(mbanglecorr)
-3.106 E(ect)-.18 E F0 5.606(.P)C .606
-(lots of the corrected sidescan often sho)-5.606 F 3.106(wal)-.25 G(ar)
--3.106 E .606(ge amount of speckle)-.18 F 1.014(that w)108 338.4 R 1.014
-(as suppressed in plots of the ra)-.1 F 3.515(wd)-.15 G 1.015
-(ata by the lar)-3.515 F 1.015
-(ge contrast between the specular and non-specular)-.18 F(re)108 350.4 Q
-1.162(gions of the sw)-.15 F 1.162(ath. T)-.1 F 3.662(or)-.8 G 1.162
-(educe the speckle and mak)-3.662 F 3.662(ec)-.1 G 1.161
-(oherent features of the data clearer)-3.662 F 3.661(,t)-.4 G 1.161
-(he user can)-3.661 F 1.496(apply an)108 362.4 R 3.996(yo)-.15 G 3.996
-(ft)-3.996 G 1.496(he smoothing \214lters a)-3.996 F -.25(va)-.2 G 1.496
-(ilable in).25 F F2(mb\214lter)3.996 E F0 3.996(.O)C 1.497
-(ne iteration of the boxcar mean \214lter can be)-3.996 F
-(applied as follo)108 374.4 Q(ws:)-.25 E
-(mb\214lter \255F41 \255Itest.mb41 \255Otest_mean.mb41)144 386.4 Q
-(-S1/3/3/1)64.8 E(Fi)108 398.4 Q .3 -.15(ve i)-.25 H
-(terations of the in).15 E -.15(ve)-.4 G
-(rse gradient \214lter can be applied as follo).15 E(ws:)-.25 E
-(mb\214lter \255F41 \255Itest.mb41 \255Otest_igrad.mb41)144 410.4 Q
-(-S4/3/3/5)65.91 E 1.6 -.8(To r)108 422.4 T(emo).8 E .3 -.15(ve l)-.15 H
-(ar).15 E(ge scale v)-.18 E(ariations in sea\215oor re\215ecti)-.25 E
-(vity)-.25 E 2.5(,o)-.65 G
-(ne can apply a high-pass \214lter to the data:)-2.5 E
-(mb\214lter \255F41 \255Itest.mb41 \255Otest_hipass.mb41)144 434.4 Q
-(-D1/3/10/1/10000)61.46 E 2.16 -.8(To \214)108 446.4 T .559(rst apply a\
- high-pass \214lter to emphasize \214ne-scale structure and then apply \
-a lo).8 F .559(w-pass \214lter to reduce)-.25 F(speckle:)108 458.4 Q
-(mb\214lter \255F41 \255Itest.mb41 \255Otest_hipass.mb41)144 470.4 Q
-(-D1/3/10/1/10000 \255S4/3/3/5)61.46 E 2.275 -.8(To \214)108 482.4 T
-.675(rst reduce speckle by smoothing the data with Gaussian mean \214lt\
-er and apply an edge detection con-).8 F(trast enhancement \214lter:)108
-494.4 Q(mb\214lter \255F41 \255Itest.mb41 \255Otest_hipass.mb41)144
-506.4 Q(-S3/7/7/1 \255C1/5/5/1)61.46 E F3(SEE ALSO)72 535.2 Q F2
-(mbsystem)108 547.2 Q F0(\(1\),)A F2(mbmosaic)2.5 E F0(\(1\),)A F2
-(mbm_plot)2.5 E F0(\(1\),)A F2(mb)2.5 E(backangle)-.1 E F0(\(1\),)A F2
-(mbanglecorr)2.5 E(ect)-.18 E F0(\(1\))A F3(REFERENCES)72 576 Q F0
-(Sauter)108 588 Q 2.838(,D)-.4 G .338(., and L. P)-2.838 F .338(arson, \
-Spatial \214ltering for speckle reduction, contrast enchancement, and t\
-e)-.15 F .337(xture analy-)-.15 F(sis of GLORIA images,)108 600 Q F1
-(IEEE J)2.5 E 2.5(.O)-.25 G(cean. Eng)-2.5 E(.)-.15 E F0(,)A F2(19)2.5 E
-F0 2.5(,5)C(63-576, 1994.)-2.5 E F3 -.11(BU)72 628.8 S(GS).11 E F0
-(All the \214ltering in the w)108 640.8 Q(orld w)-.1 E(on')-.1 E 2.5(tm)
--.18 G(ak)-2.5 E 2.5(eb)-.1 G(ad data good.)-2.5 E(MB-System 5.0)72 768
-Q 2.5(3J)146.495 G(une 2013)-2.5 E(4)204.835 E 0 Cg EP
-%%Trailer
-end
-%%EOF
diff --git a/src/ps/mbformat.ps b/src/ps/mbformat.ps
deleted file mode 100644
index 7373f08..0000000
--- a/src/ps/mbformat.ps
+++ /dev/null
@@ -1,348 +0,0 @@
-%!PS-Adobe-3.0
-%%Creator: groff version 1.19.2
-%%CreationDate: Wed Jul  1 12:29:27 2015
-%%DocumentNeededResources: font Times-Roman
-%%+ font Times-Bold
-%%+ font Times-Italic
-%%DocumentSuppliedResources: procset grops 1.19 2
-%%Pages: 2
-%%PageOrder: Ascend
-%%DocumentMedia: Default 612 792 0 () ()
-%%Orientation: Portrait
-%%EndComments
-%%BeginDefaults
-%%PageMedia: Default
-%%EndDefaults
-%%BeginProlog
-%%BeginResource: procset grops 1.19 2
-%!PS-Adobe-3.0 Resource-ProcSet
-/setpacking where{
-pop
-currentpacking
-true setpacking
-}if
-/grops 120 dict dup begin
-/SC 32 def
-/A/show load def
-/B{0 SC 3 -1 roll widthshow}bind def
-/C{0 exch ashow}bind def
-/D{0 exch 0 SC 5 2 roll awidthshow}bind def
-/E{0 rmoveto show}bind def
-/F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def
-/G{0 rmoveto 0 exch ashow}bind def
-/H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/I{0 exch rmoveto show}bind def
-/J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def
-/K{0 exch rmoveto 0 exch ashow}bind def
-/L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/M{rmoveto show}bind def
-/N{rmoveto 0 SC 3 -1 roll widthshow}bind def
-/O{rmoveto 0 exch ashow}bind def
-/P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/Q{moveto show}bind def
-/R{moveto 0 SC 3 -1 roll widthshow}bind def
-/S{moveto 0 exch ashow}bind def
-/T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/SF{
-findfont exch
-[exch dup 0 exch 0 exch neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/MF{
-findfont
-[5 2 roll
-0 3 1 roll
-neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/level0 0 def
-/RES 0 def
-/PL 0 def
-/LS 0 def
-/MANUAL{
-statusdict begin/manualfeed true store end
-}bind def
-/PLG{
-gsave newpath clippath pathbbox grestore
-exch pop add exch pop
-}bind def
-/BP{
-/level0 save def
-1 setlinecap
-1 setlinejoin
-72 RES div dup scale
-LS{
-90 rotate
-}{
-0 PL translate
-}ifelse
-1 -1 scale
-}bind def
-/EP{
-level0 restore
-showpage
-}def
-/DA{
-newpath arcn stroke
-}bind def
-/SN{
-transform
-.25 sub exch .25 sub exch
-round .25 add exch round .25 add exch
-itransform
-}bind def
-/DL{
-SN
-moveto
-SN
-lineto stroke
-}bind def
-/DC{
-newpath 0 360 arc closepath
-}bind def
-/TM matrix def
-/DE{
-TM currentmatrix pop
-translate scale newpath 0 0 .5 0 360 arc closepath
-TM setmatrix
-}bind def
-/RC/rcurveto load def
-/RL/rlineto load def
-/ST/stroke load def
-/MT/moveto load def
-/CL/closepath load def
-/Fr{
-setrgbcolor fill
-}bind def
-/setcmykcolor where{
-pop
-/Fk{
-setcmykcolor fill
-}bind def
-}if
-/Fg{
-setgray fill
-}bind def
-/FL/fill load def
-/LW/setlinewidth load def
-/Cr/setrgbcolor load def
-/setcmykcolor where{
-pop
-/Ck/setcmykcolor load def
-}if
-/Cg/setgray load def
-/RE{
-findfont
-dup maxlength 1 index/FontName known not{1 add}if dict begin
-{
-1 index/FID ne{def}{pop pop}ifelse
-}forall
-/Encoding exch def
-dup/FontName exch def
-currentdict end definefont pop
-}bind def
-/DEFS 0 def
-/EBEGIN{
-moveto
-DEFS begin
-}bind def
-/EEND/end load def
-/CNT 0 def
-/level1 0 def
-/PBEGIN{
-/level1 save def
-translate
-div 3 1 roll div exch scale
-neg exch neg exch translate
-0 setgray
-0 setlinecap
-1 setlinewidth
-0 setlinejoin
-10 setmiterlimit
-[]0 setdash
-/setstrokeadjust where{
-pop
-false setstrokeadjust
-}if
-/setoverprint where{
-pop
-false setoverprint
-}if
-newpath
-/CNT countdictstack def
-userdict begin
-/showpage{}def
-/setpagedevice{}def
-}bind def
-/PEND{
-countdictstack CNT sub{end}repeat
-level1 restore
-}bind def
-end def
-/setpacking where{
-pop
-setpacking
-}if
-%%EndResource
-%%EndProlog
-%%BeginSetup
-%%BeginFeature: *PageSize Default
-<< /PageSize [ 612 792 ] /ImagingBBox null >> setpagedevice
-%%EndFeature
-%%IncludeResource: font Times-Roman
-%%IncludeResource: font Times-Bold
-%%IncludeResource: font Times-Italic
-grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72
-def/PL 792 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron/Zcaron
-/scaron/zcaron/Ydieresis/trademark/quotesingle/Euro/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/space/exclam/quotedbl/numbersign/dollar/percent
-/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen
-/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon
-/semicolon/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O
-/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright/circumflex
-/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y
-/z/braceleft/bar/braceright/tilde/.notdef/quotesinglbase/guillemotleft
-/guillemotright/bullet/florin/fraction/perthousand/dagger/daggerdbl
-/endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut
-/dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash
-/quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen
-/brokenbar/section/dieresis/copyright/ordfeminine/guilsinglleft
-/logicalnot/minus/registered/macron/degree/plusminus/twosuperior
-/threesuperior/acute/mu/paragraph/periodcentered/cedilla/onesuperior
-/ordmasculine/guilsinglright/onequarter/onehalf/threequarters
-/questiondown/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE
-/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex
-/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis
-/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn
-/germandbls/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla
-/egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis
-/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide/oslash
-/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis]def
-/Times-Italic at 0 ENC0/Times-Italic RE/Times-Bold at 0 ENC0/Times-Bold RE
-/Times-Roman at 0 ENC0/Times-Roman RE
-%%EndSetup
-%%Page: 1 1
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 148.73(mbformat\(1\) MB-System)72 48 R 148.73
-(5.0 mbformat\(1\))2.5 F/F1 10.95/Times-Bold at 0 SF -.219(NA)72 84 S(ME)
-.219 E/F2 10/Times-Bold at 0 SF(mbf)108 96 Q(ormat)-.25 E F0 5<ad4c>2.5 G
-(ist information about sw)-5 E(ath sonar data formats supported by the)
--.1 E F2(MBIO)2.5 E F0(library)2.5 E(.)-.65 E F1(VERSION)72 124.8 Q F0
--1.11(Ve)108 136.8 S(rsion 5.0)1.11 E F1(SYNOPSISmbf)72 165.6 Q
-(ormat [ \255F)-.274 E/F3 10.95/Times-Italic at 0 SF(format)A F1<ad49>2.738
-E F3(\214le)A F1(\255L \255K \255V \255H])2.738 E(DESCRIPTION)72 177.6 Q
-F2(mbf)108 189.6 Q(ormat)-.25 E F0 .157
-(is a utility which identi\214es the sw)2.658 F .157
-(ath sonar data formats associated with)-.1 F F2(mbio)2.657 E F0 .157
-(format id')2.657 F 2.657(s. If)-.55 F(no)2.657 E .855
-(format id or input \214lename is speci\214ed,)108 201.6 R F2(mbf)3.355
-E(ormat)-.25 E F0 .855
-(lists all of the currently supported formats along with)3.355 F .306
-(short descriptions. If a format id is speci\214ed using the)108 213.6 R
-F2<ad46>2.806 E F0 .306(option, then)2.806 F F2(mbf)2.806 E(ormat)-.25 E
-F0 .305(prints a short description)2.806 F .034
-(of that format. If a \214lename is speci\214ed using the)108 225.6 R F2
-<ad49>2.535 E F0 .035(option, then)2.535 F F2(mbf)2.535 E(ormat)-.25 E
-F0 .035(attempts to identify a v)2.535 F .035(alid for)-.25 F(-)-.2 E
-.393(mat id for that \214le using sw)108 237.6 R .392
-(ath data \214lename pre\214x and suf)-.1 F .392(\214x con)-.25 F -.15
-(ve)-.4 G .392(ntions embedded in).15 F F2(MB-System)2.892 E F0 5.392
-(.T)C(he)-5.392 E .758(program also determines the \214lename "root", w\
-hich is the \214lename minus whate)108 249.6 R -.15(ve)-.25 G 3.259(rf)
-.15 G .759(ormat-speci\214c pre\214x)-3.259 F .998(or suf)108 261.6 R
-.998(\214x has been recognized. In no pre\214x or suf)-.25 F .997
-(\214x is recognized, then the root is simply the entire \214le-)-.25 F
-(name.)108 273.6 Q(Normally)108 297.6 Q(,)-.65 E F2(mbf)4.22 E(ormat)
--.25 E F0 1.721
-(prints out a brief description of each identi\214ed format. If the)4.22
-F F2<ad4c>4.221 E F0 1.721(option is used,)4.221 F F2(mbf)108 309.6 Q
-(ormat)-.25 E F0 .755(simply prints out the v)3.255 F .755
-(alid format id number)-.25 F 3.255(,o)-.4 G 3.255(r0)-3.255 G .754
-(if a \214le or format has been speci\214ed b)-.001 F .754(ut no)-.2 F
--.25(va)108 321.6 S .634(lid id can be identi\214ed.).25 F .634(If the)
-5.634 F F2<ad4b>3.134 E F0 .634(option is used,)3.134 F F2(mbf)3.135 E
-(ormat)-.25 E F0 .635(will print out the \214lename "root" follo)3.135 F
-(wed)-.25 E(by the format id number)108 333.6 Q(.)-.55 E F1 -.548(AU)72
-362.4 S(THORSHIP).548 E F0(Da)108 374.4 Q(vid W)-.2 E 2.5(.C)-.92 G
-(aress \(caress at mbari.or)-2.5 E(g\))-.18 E(Montere)113 386.4 Q 2.5(yB)
--.15 G(ay Aquarium Research Institute)-2.5 E
-(Dale N. Chayes \(dale at ldeo.columbia.edu\))108 398.4 Q
-(Lamont-Doherty Earth Observ)113 410.4 Q(atory)-.25 E F1(OPTIONS)72
-439.2 Q F2<ad46>108 451.2 Q/F4 10/Times-Italic at 0 SF(format)24.19 E F0
-.281(Sets the format id to be listed.)144 463.2 R .281
-(If no format is gi)5.281 F -.15(ve)-.25 G .28
-(n, all of the currently supported formats will be).15 F .139
-(listed. A list of the sw)144 475.2 R .139
-(ath sonar data formats currently supported by)-.1 F F2(MBIO)2.64 E F0
-.14(and their identi\214er v)2.64 F(al-)-.25 E(ues is gi)144 487.2 Q
--.15(ve)-.25 G 2.5(ni).15 G 2.5(nt)-2.5 G(he)-2.5 E F2(MBIO)2.5 E F0
-(manual page.)2.5 E F2<ad48>108 504 Q F0 .162(This "help" \215ag cause \
-the program to print out a description of its operation and then e)22.52
-F .161(xit immedi-)-.15 F(ately)144 516 Q(.)-.65 E F2<ad49>108 532.8 Q
-F4(\214le)26.41 E F0 1.346(Sets the \214lename to be tested ag)144 544.8
-R 1.346(ainst kno)-.05 F 1.346(wn \214lename pre\214x and suf)-.25 F
-1.346(\214x con)-.25 F -.15(ve)-.4 G 1.346(ntions in order to).15 F
-(identify the format id.)144 556.8 Q F2<ad4b>108 573.6 Q F0 .112(Causes\
- the \214leroot and the format id to be output. The \214leroot is the \
-\214lename with an)22.52 F 2.612(yf)-.15 G .112(ormat spe-)-2.612 F
-(ci\214c suf)144 585.6 Q(\214x remo)-.25 E -.15(ve)-.15 G(d.).15 E F2
-<ad4c>108 602.4 Q F0
-(Causes the format descriptions to be omitted so that only the)23.63 E
-F2(MBIO)2.5 E F0(format id numbers are listed.)2.5 E F2<ad56>108 619.2 Q
-F0(Normally)23.08 E(,)-.65 E F2(mbf)2.952 E(ormat)-.25 E F0 .453
-(only prints out format descriptions.)2.952 F .453(If the)5.453 F F2
-<ad56>2.953 E F0 .453(\215ag is gi)2.953 F -.15(ve)-.25 G .453(n, then)
-.15 F F2(mbf)2.953 E(ormat)-.25 E F0 -.1(wo)144 631.2 S(rks in a "v).1 E
-(erbose" mode and also outputs the program v)-.15 E(ersion being used.)
--.15 E F1(EXAMPLES)72 660 Q F0 .35
-(Suppose one wishes to identify the sw)108 672 R .35
-(ath sonar data format associated with a format id of 11.)-.1 F .35
-(The follo)5.35 F(w-)-.25 E(ing will suf)108 684 Q(\214ce:)-.25 E
-(mbformat \255F11)144 696 Q(and the result will be this output:)108 708
-Q(MBIO data format id: 11)113 720 Q(MB-System 5.0)72 768 Q 2.5(3J)
-146.495 G(une 2013)-2.5 E(1)204.835 E 0 Cg EP
-%%Page: 2 2
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 148.73(mbformat\(1\) MB-System)72 48 R 148.73
-(5.0 mbformat\(1\))2.5 F -.15(Fo)113 84 S(rmat name:).15 E(MBF_SBSIOMRG)
-25 E(Informal Description: SIO mer)113 96 Q(ge Sea Beam)-.18 E(Attrib)
-113 108 Q 25(utes: Sea)-.2 F(Beam, bath)2.5 E(ymetry)-.05 E 2.5(,1)-.65
-G 2.5(6b)-2.5 G(eams, binary)-2.5 E 2.5(,u)-.65 G(ncentered,)-2.5 E
-(SIO.)168 120 Q(Suppose one wishes to list all of the currently support\
-ed data formats.)108 144 Q(The follo)5 E(wing will suf)-.25 E(\214ce:)
--.25 E(mbformat)144 156 Q 3.511(Suppose one w)108 180 R 3.511
-(ants to \214nd out what format is associated with a ra)-.1 F 6.012(wS)
--.15 G 3.512(eaBeam 2112 \214le named)-6.012 F(sb199811231045.rec:)108
-192 Q(mbformat \255I sb199811231045.rec)144 204 Q
-(This results in the output:)108 216 Q(MBIO data format id: 41)113 228 Q
--.15(Fo)113 240 S(rmat name:).15 E(MBF_SB2100R)25 E(W)-.55 E
-(Informal Description: SeaBeam 2100 series v)113 252 Q(ender format)-.15
-E(Attrib)113 264 Q 25(utes: SeaBeam)-.2 F(2100, bath)2.5 E(ymetry)-.05 E
-2.5(,a)-.65 G(mplitude)-2.5 E(and sidescan, 151 beams and 2000 pix)168
-276 Q(els, ascii)-.15 E(with binary sidescan, SeaBeam Instruments.)168
-288 Q(Using the \255K option:)108 312 Q
-(mbformat \255K \255I sb199811231045.rec)144 324 Q
-(will produce the follo)108 336 Q(wing output:)-.25 E(sb199811231045 41)
-113 348 Q .195(where the format id has been identi\214ed as 41 because \
-of the ".rec" \214le suf)108 360 R .195
-(\214x and the \214leroot has been iden-)-.25 F
-(ti\214ed as "sb199811231045" by remo)108 372 Q(ving the suf)-.15 E
-(\214x. Use of the \255L option:)-.25 E
-(mbformat \255L \255I sb199811231045.rec)144 384 Q
-(will produce output with just format id:)108 396 Q(41)113 408 Q/F1
-10.95/Times-Bold at 0 SF(SEE ALSO)72 436.8 Q/F2 10/Times-Bold at 0 SF
-(mbsystem)108 448.8 Q F0(\(1\),)A F2(mbio)2.5 E F0(\(1\))A F1 -.11(BU)72
-477.6 S(GS).11 E F0(No kno)108 489.6 Q(wn b)-.25 E(ugs.)-.2 E
-(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(2)204.835 E 0
-Cg EP
-%%Trailer
-end
-%%EOF
diff --git a/src/ps/mbgetesf.ps b/src/ps/mbgetesf.ps
deleted file mode 100644
index 04d12cf..0000000
--- a/src/ps/mbgetesf.ps
+++ /dev/null
@@ -1,384 +0,0 @@
-%!PS-Adobe-3.0
-%%Creator: groff version 1.19.2
-%%CreationDate: Wed Jul  1 12:29:27 2015
-%%DocumentNeededResources: font Times-Roman
-%%+ font Times-Bold
-%%+ font Times-Italic
-%%DocumentSuppliedResources: procset grops 1.19 2
-%%Pages: 2
-%%PageOrder: Ascend
-%%DocumentMedia: Default 612 792 0 () ()
-%%Orientation: Portrait
-%%EndComments
-%%BeginDefaults
-%%PageMedia: Default
-%%EndDefaults
-%%BeginProlog
-%%BeginResource: procset grops 1.19 2
-%!PS-Adobe-3.0 Resource-ProcSet
-/setpacking where{
-pop
-currentpacking
-true setpacking
-}if
-/grops 120 dict dup begin
-/SC 32 def
-/A/show load def
-/B{0 SC 3 -1 roll widthshow}bind def
-/C{0 exch ashow}bind def
-/D{0 exch 0 SC 5 2 roll awidthshow}bind def
-/E{0 rmoveto show}bind def
-/F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def
-/G{0 rmoveto 0 exch ashow}bind def
-/H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/I{0 exch rmoveto show}bind def
-/J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def
-/K{0 exch rmoveto 0 exch ashow}bind def
-/L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/M{rmoveto show}bind def
-/N{rmoveto 0 SC 3 -1 roll widthshow}bind def
-/O{rmoveto 0 exch ashow}bind def
-/P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/Q{moveto show}bind def
-/R{moveto 0 SC 3 -1 roll widthshow}bind def
-/S{moveto 0 exch ashow}bind def
-/T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/SF{
-findfont exch
-[exch dup 0 exch 0 exch neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/MF{
-findfont
-[5 2 roll
-0 3 1 roll
-neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/level0 0 def
-/RES 0 def
-/PL 0 def
-/LS 0 def
-/MANUAL{
-statusdict begin/manualfeed true store end
-}bind def
-/PLG{
-gsave newpath clippath pathbbox grestore
-exch pop add exch pop
-}bind def
-/BP{
-/level0 save def
-1 setlinecap
-1 setlinejoin
-72 RES div dup scale
-LS{
-90 rotate
-}{
-0 PL translate
-}ifelse
-1 -1 scale
-}bind def
-/EP{
-level0 restore
-showpage
-}def
-/DA{
-newpath arcn stroke
-}bind def
-/SN{
-transform
-.25 sub exch .25 sub exch
-round .25 add exch round .25 add exch
-itransform
-}bind def
-/DL{
-SN
-moveto
-SN
-lineto stroke
-}bind def
-/DC{
-newpath 0 360 arc closepath
-}bind def
-/TM matrix def
-/DE{
-TM currentmatrix pop
-translate scale newpath 0 0 .5 0 360 arc closepath
-TM setmatrix
-}bind def
-/RC/rcurveto load def
-/RL/rlineto load def
-/ST/stroke load def
-/MT/moveto load def
-/CL/closepath load def
-/Fr{
-setrgbcolor fill
-}bind def
-/setcmykcolor where{
-pop
-/Fk{
-setcmykcolor fill
-}bind def
-}if
-/Fg{
-setgray fill
-}bind def
-/FL/fill load def
-/LW/setlinewidth load def
-/Cr/setrgbcolor load def
-/setcmykcolor where{
-pop
-/Ck/setcmykcolor load def
-}if
-/Cg/setgray load def
-/RE{
-findfont
-dup maxlength 1 index/FontName known not{1 add}if dict begin
-{
-1 index/FID ne{def}{pop pop}ifelse
-}forall
-/Encoding exch def
-dup/FontName exch def
-currentdict end definefont pop
-}bind def
-/DEFS 0 def
-/EBEGIN{
-moveto
-DEFS begin
-}bind def
-/EEND/end load def
-/CNT 0 def
-/level1 0 def
-/PBEGIN{
-/level1 save def
-translate
-div 3 1 roll div exch scale
-neg exch neg exch translate
-0 setgray
-0 setlinecap
-1 setlinewidth
-0 setlinejoin
-10 setmiterlimit
-[]0 setdash
-/setstrokeadjust where{
-pop
-false setstrokeadjust
-}if
-/setoverprint where{
-pop
-false setoverprint
-}if
-newpath
-/CNT countdictstack def
-userdict begin
-/showpage{}def
-/setpagedevice{}def
-}bind def
-/PEND{
-countdictstack CNT sub{end}repeat
-level1 restore
-}bind def
-end def
-/setpacking where{
-pop
-setpacking
-}if
-%%EndResource
-%%EndProlog
-%%BeginSetup
-%%BeginFeature: *PageSize Default
-<< /PageSize [ 612 792 ] /ImagingBBox null >> setpagedevice
-%%EndFeature
-%%IncludeResource: font Times-Roman
-%%IncludeResource: font Times-Bold
-%%IncludeResource: font Times-Italic
-grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72
-def/PL 792 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron/Zcaron
-/scaron/zcaron/Ydieresis/trademark/quotesingle/Euro/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/space/exclam/quotedbl/numbersign/dollar/percent
-/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen
-/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon
-/semicolon/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O
-/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright/circumflex
-/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y
-/z/braceleft/bar/braceright/tilde/.notdef/quotesinglbase/guillemotleft
-/guillemotright/bullet/florin/fraction/perthousand/dagger/daggerdbl
-/endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut
-/dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash
-/quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen
-/brokenbar/section/dieresis/copyright/ordfeminine/guilsinglleft
-/logicalnot/minus/registered/macron/degree/plusminus/twosuperior
-/threesuperior/acute/mu/paragraph/periodcentered/cedilla/onesuperior
-/ordmasculine/guilsinglright/onequarter/onehalf/threequarters
-/questiondown/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE
-/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex
-/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis
-/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn
-/germandbls/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla
-/egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis
-/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide/oslash
-/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis]def
-/Times-Italic at 0 ENC0/Times-Italic RE/Times-Bold at 0 ENC0/Times-Bold RE
-/Times-Roman at 0 ENC0/Times-Roman RE
-%%EndSetup
-%%Page: 1 1
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 151.51(mbgetesf\(1\) MB-System)72 48 R 151.51
-(5.0 mbgetesf\(1\))2.5 F/F1 10.95/Times-Bold at 0 SF -.219(NA)72 84 S(ME)
-.219 E/F2 10/Times-Bold at 0 SF(mbgetesf)108 96 Q F0 2.5<ad45>2.5 G
-(xtract sw)-2.5 E(ath bath)-.1 E(ymetry data \215ags into an edit sa)
--.05 E .3 -.15(ve \214)-.2 H(le.).15 E F1(VERSION)72 124.8 Q F0 -1.11
-(Ve)108 136.8 S(rsion 5.0)1.11 E F1(SYNOPSIS)72 165.6 Q F2(mbgetesf)108
-177.6 Q F0([)2.5 E F2<ad46>A F0(format)A F2<ad49>2.5 E F0(in\214le)A F2
-<ad4d>2.5 E F0(mode)A F2<ad4f>2.5 E F0(esf)A(\214le)-.25 E F2
-<ad5620ad48>2.5 E F0(])A F1(DESCRIPTION)72 206.4 Q F0(Sw)108 218.4 Q
-.821(ath bath)-.1 F .821
-(ymetry data is typically edited either with interacti)-.05 F 1.121 -.15
-(ve t)-.25 H .821(ools such as).15 F F2(mbedit)3.32 E F0 .82
-(or automatic \214lters)3.32 F .215(such as)108 230.4 R F2(mbclean)2.715
-E F0 5.215(.T)C .215(he beams which are deemed "bad" are \215agged, and\
- the \215ags are output to an "edit sa)-5.215 F -.15(ve)-.2 G .34
-(\214le", which can be applied to data later by)108 242.4 R F2(mbpr)2.84
-E(ocess)-.18 E F0 5.34(.O)C(ccasionally)-5.34 E 2.84(,t)-.65 G .34
-(he need arises to translate data \215ag-)-2.84 F .534
-(ging information from one \214le to another which represents a dif)108
-254.4 R .534(ferent v)-.25 F .534(ersion of the same dataset.)-.15 F
-.535(In par)5.535 F(-)-.2 E(ticular)108 266.4 Q 2.665(,i)-.4 G 2.665(tm)
--2.665 G .164(ay happen that editing has been done on a data format whi\
-ch does not support all of the original)-2.665 F .441(data stream \(e.g\
-. the edmb Hydrosweep format 22, which does not contain tra)108 278.4 R
--.15(ve)-.2 G 2.942(lt).15 G .442(imes or amplitudes\), b)-2.942 F(ut)
--.2 E(the user no)108 290.4 Q 2.5(ww)-.25 G(ishes to w)-2.5 E
-(ork with the complete data stream without ha)-.1 E
-(ving to redo the editing process.)-.2 E .937(The utility)108 314.4 R F2
-(mbgetesf)3.437 E F0(allo)3.437 E .937(ws the user to e)-.25 F .937
-(xtract the \215agging information in the form of an "edit sa)-.15 F
-1.236 -.15(ve \214)-.2 H(le").15 E(lik)108 326.4 Q 2.948(et)-.1 G .448
-(hose generated by)-2.948 F F2(mbedit)2.949 E F0(and)2.949 E F2(mbclean)
-2.949 E F0 2.949(.T)C .449
-(hese edits can be applied to data later using)-2.949 F F2(mbpr)2.949 E
-(ocess)-.18 E F0 2.949(.I)C(f)-2.949 E .314(the edit sa)108 338.4 R .614
--.15(ve \214)-.2 H .314(le is named properly \(an ".esf" suf).15 F .313
-(\214x added to the input sw)-.25 F .313
-(ath \214le name\), the edits can auto-)-.1 F(matically be loaded into)
-108 350.4 Q F2(mbedit)2.5 E F0(or)2.5 E F2(mbclean)2.5 E F0(.)A .67
-(The user can e)108 374.4 R .67(xtract edit e)-.15 F -.15(ve)-.25 G .67
-(nts from only the \215agged beams \().15 F F2<ad4d>A/F3 10
-/Times-Italic at 0 SF(1)A F0 .67(\), or can e)B .67(xtract edit e)-.15 F
--.15(ve)-.25 G .67(nts specifying).15 F .728
-(null and \215agged beams \()108 386.4 R F2<ad4d>A F3(2)A F0 3.228(\)a)C
-.728(nd all \(good, \215agged, and null\) beams \()-3.228 F F2<ad4d>A F3
-(3)A F0 .727(\). The latter cases are neces-)B .78(sary only if pre)108
-398.4 R .78(vious editing has in)-.25 F -.2(vo)-.4 G(lv).2 E .78(ed nul\
-ling beams that were originally classi\214ed as good or un\215ag-)-.15 F
-(ging beams that were originally \215agged.)108 410.4 Q(The def)108
-434.4 Q(ault input is from stdin, and the def)-.1 E
-(ault output is to standard out.)-.1 E F1 -.548(AU)72 463.2 S(THORSHIP)
-.548 E F0(Da)108 475.2 Q(vid W)-.2 E 2.5(.C)-.92 G
-(aress \(caress at mbari.or)-2.5 E(g\))-.18 E(Montere)113 487.2 Q 2.5(yB)
--.15 G(ay Aquarium Research Institute)-2.5 E
-(Dale N. Chayes \(dale at ldeo.columbia.edu\))108 499.2 Q
-(Lamont-Doherty Earth Observ)113 511.2 Q(atory)-.25 E F1(OPTIONS)72 540
-Q F2<ad46>108 552 Q F3(format)24.19 E F0 .401
-(Sets the format for the input and output sw)144 564 R .401
-(ath data using)-.1 F F2(MBIO)2.9 E F0(inte)2.9 E .4
-(ger format identi\214ers.)-.15 F(These)5.4 E .238(utilities uses the)
-144 576 R F2(MBIO)2.738 E F0 .239(library and will read an)2.739 F 2.739
-(ys)-.15 G -.1(wa)-2.739 G .239(th data format supported by).1 F F2
-(MBIO)2.739 E F0 2.739(.Al)C .239(ist of)-2.739 F 1.324(the sw)144 588 R
-1.324(ath data formats currently supported by)-.1 F F2(MBIO)3.823 E F0
-1.323(and their identi\214er v)3.823 F 1.323(alues is gi)-.25 F -.15(ve)
--.25 G 3.823(ni).15 G 3.823(nt)-3.823 G(he)-3.823 E F2(MBIO)144 600 Q F0
-(manual page.)2.5 E F2<ad48>108 616.8 Q F0 .391(This "help" \215ag caus\
-es the program to print out a description of its operation and then e)
-22.52 F .391(xit imme-)-.15 F(diately)144 628.8 Q(.)-.65 E F2<ad49>108
-645.6 Q F3(in\214le)26.41 E F0 .33(Data \214le from which the input dat\
-a will be read. If no input \214le is speci\214ed, the input will be re\
-ad)144 657.6 R(from stdin. Def)144 669.6 Q(ault:)-.1 E F3(in\214le)2.5 E
-F0 2.5(=s)2.5 G(tdin.)-2.5 E F2<ad4d>108 686.4 Q F3(mode)20.86 E F0 .487
-(Speci\214es which beam \215ag v)144 698.4 R .488
-(alues are output as edit e)-.25 F -.15(ve)-.25 G 2.988(nts. If).15 F F3
-(mode)2.988 E F0 2.988(=1)2.988 G 2.988(,t)-2.988 G .488
-(hen only \215agged beams)-2.988 F .871(are output. If)144 710.4 R F3
-(mode)3.371 E F0 3.371(=2)3.371 G 3.371(,t)-3.371 G .871
-(hen \215agged and null beams are output. If)-3.371 F F3(mode)3.37 E F0
-3.37(=3)3.37 G 3.37(,t)-3.37 G .87(hen an edit e)-3.37 F -.15(ve)-.25 G
-(nt).15 E .541(will be output for e)144 722.4 R -.15(ve)-.25 G .541(ry \
-beam, including those that are "good" \(neither \215agged nor null\). D\
-ef).15 F(ault:)-.1 E(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)
--2.5 E(1)204.835 E 0 Cg EP
-%%Page: 2 2
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 151.51(mbgetesf\(1\) MB-System)72 48 R 151.51
-(5.0 mbgetesf\(1\))2.5 F/F1 10/Times-Italic at 0 SF(mode)144 84 Q F0 2.5
-(=1)2.5 G(.)-2.5 E/F2 10/Times-Bold at 0 SF<ad4f>108 100.8 Q F1(esf)22.52 E
-(\214le)-.18 E F0 .464(Speci\214es output edit sa)144 112.8 R .763 -.15
-(ve \214)-.2 H .463(le to which the edit e).15 F -.15(ve)-.25 G .463
-(nts will be written. If no edit sa).15 F .763 -.15(ve \214)-.2 H .463
-(le is speci-).15 F(\214ed, the output will be written to stdout. Def)
-144 124.8 Q(ault:)-.1 E F1(esf)2.5 E(\214le)-.18 E F0 2.5(=s)2.5 G
-(tdout.)-2.5 E F2<ad56>108 141.6 Q F0(Normally)23.08 E(,)-.65 E F2
-(mbgetesf)3.291 E F0 -.1(wo)3.291 G .791
-(rks "silently" without outputting an).1 F .792
-(ything to the stderr stream.)-.15 F .792(If the)5.792 F F2<ad56>3.292 E
-F0 1.172(\215ag is gi)144 153.6 R -.15(ve)-.25 G 1.172(n, then).15 F F2
-(mbgetesf)3.672 E F0 -.1(wo)3.672 G 1.172(rks in a "v).1 F 1.172
-(erbose" mode and outputs the program v)-.15 F 1.172(ersion being)-.15 F
-(used and all error status messages.)144 165.6 Q/F3 10.95/Times-Bold at 0
-SF(EXAMPLES)72 194.4 Q F0 1.758(Suppose one has an edmb format \()108
-206.4 R F2(MBIO)A F0 1.759(format id 22\) Hydrosweep \214le called hs_e)
-4.258 F(w9103_143.mb22)-.25 E .395(which has been edited using older v)
-108 218.4 R .395(ersions of)-.15 F F2(mbedit)2.895 E F0 .395
-(so that no edit sa)2.895 F .695 -.15(ve \214)-.2 H .395(le w).15 F .395
-(as generated.)-.1 F .395(Further sup-)5.395 F 1.423(pose that one')108
-230.4 R 3.923(st)-.55 G 1.423(hesis advisor suggests that the bath)
--3.923 F 1.423(ymetry w)-.05 F 1.423
-(ould be better if it were recalculated from)-.1 F(tra)108 242.4 Q -.15
-(ve)-.2 G 2.632(lt).15 G .132(imes using a ne)-2.632 F 2.632(ww)-.25 G
-.131(ater v)-2.732 F .131(elocity model, requiring that the ra)-.15 F
-2.631(wH)-.15 G .131(ydrosweep data \(originally collected)-2.631 F .139
-(in format 21 b)108 254.4 R .139
-(ut recently translated to format 24\) in the \214le hs_e)-.2 F .14
-(w9103_143.mb24 be used. First e)-.25 F .14(xtract the)-.15 F(edit e)108
-266.4 Q -.15(ve)-.25 G(nts in the form of a edit sa).15 E .3 -.15
-(ve \214)-.2 H(le from the edited edmb \214le:).15 E
-(mbgetesf \255F22 \255Ihs_e)144 278.4 Q 51.09(w9103_143.mb22 -Ohs_e)-.25
-F(w9103_143.mb24.esf \255V)-.25 E 1.143(Note that the edit sa)108 290.4
-R 1.442 -.15(ve \214)-.2 H 1.142(le has been gi).15 F -.15(ve)-.25 G
-3.642(nt).15 G 1.142(he name of the second sw)-3.642 F 1.142
-(ath \214le with ".esf" appended. This)-.1 F .147(naming con)108 302.4 R
--.15(ve)-.4 G .147(ntion is the same as if).15 F F2(mbedit)2.647 E F0
-(or)2.647 E F2(mbclean)2.648 E F0 .148(had been run on hs_e)2.648 F .148
-(w9103_143.mb24. No)-.25 F 1.448 -.65(w, r)-.25 H(un-).65 E .537
-(ning either)108 314.4 R F2(mbedit)3.037 E F0(or)3.036 E F2(mbclean)
-3.036 E F0 .536(will automatically load the edit e)3.036 F -.15(ve)-.25
-G .536(nts as a starting point for editing or \214l-).15 F 2.975
-(tering. T)108 326.4 R 2.975(os)-.8 G .476(imply apply the e)-2.975 F
-.476(xtracted edit e)-.15 F -.15(ve)-.25 G .476(nts to the sw).15 F .476
-(ath bath)-.1 F(ymetry)-.05 E 2.976<2c8c>-.65 G .476(rst use)-2.976 F F2
-(mbset)2.976 E F0 .476(to enable apply-)2.976 F .397
-(ing the edits in the)108 338.4 R F2(mbpr)2.897 E(ocess)-.18 E F0 .397
-(parameter \214le, and then run)2.897 F F2(mbpr)2.897 E(ocess)-.18 E F0
-.396(to actually apply the edits and gen-)2.897 F
-(erate a processed output sw)108 350.4 Q(ath \214le:)-.1 E 4.083
-(mbset \255Ihs_e)144 362.4 R 55.643(w9103_143.mb24 -PEDITSA)-.25 F
-51.944(VEMODE:1 -PEDITSA)-1.35 F(VE-)-1.35 E(FILE:hs_e)108 374.4 Q 48.87
-(w9103_143.mb24.esf -V)-.25 F(mbprocess \255Ihs_e)144 386.4 Q
-(w9103_143.mb24 \255V)-.25 E(The output sw)108 398.4 Q
-(ath \214le will be named hs_e)-.1 E(w9103_143p.mb24.)-.25 E F3
-(SEE ALSO)72 427.2 Q F2(mbsystem)108 439.2 Q F0(\(1\),)A F2(mbedit)2.5 E
-F0(\(1\),)A F2(mbclean)2.5 E F0(\(1\),)A F2(mbset)2.5 E F0(\(1\),)A F2
-(mbpr)2.5 E(ocess)-.18 E F0(\(1\).)A F3 -.11(BU)72 468 S(GS).11 E F0
-(Let us kno)108 480 Q -.65(w.)-.25 G(MB-System 5.0)72 768 Q 2.5(3J)
-146.495 G(une 2013)-2.5 E(2)204.835 E 0 Cg EP
-%%Trailer
-end
-%%EOF
diff --git a/src/ps/mbgrdtiff.ps b/src/ps/mbgrdtiff.ps
deleted file mode 100644
index 525a080..0000000
--- a/src/ps/mbgrdtiff.ps
+++ /dev/null
@@ -1,415 +0,0 @@
-%!PS-Adobe-3.0
-%%Creator: groff version 1.19.2
-%%CreationDate: Wed Jul  1 12:29:27 2015
-%%DocumentNeededResources: font Times-Roman
-%%+ font Times-Bold
-%%+ font Times-Italic
-%%DocumentSuppliedResources: procset grops 1.19 2
-%%Pages: 3
-%%PageOrder: Ascend
-%%DocumentMedia: Default 612 792 0 () ()
-%%Orientation: Portrait
-%%EndComments
-%%BeginDefaults
-%%PageMedia: Default
-%%EndDefaults
-%%BeginProlog
-%%BeginResource: procset grops 1.19 2
-%!PS-Adobe-3.0 Resource-ProcSet
-/setpacking where{
-pop
-currentpacking
-true setpacking
-}if
-/grops 120 dict dup begin
-/SC 32 def
-/A/show load def
-/B{0 SC 3 -1 roll widthshow}bind def
-/C{0 exch ashow}bind def
-/D{0 exch 0 SC 5 2 roll awidthshow}bind def
-/E{0 rmoveto show}bind def
-/F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def
-/G{0 rmoveto 0 exch ashow}bind def
-/H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/I{0 exch rmoveto show}bind def
-/J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def
-/K{0 exch rmoveto 0 exch ashow}bind def
-/L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/M{rmoveto show}bind def
-/N{rmoveto 0 SC 3 -1 roll widthshow}bind def
-/O{rmoveto 0 exch ashow}bind def
-/P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/Q{moveto show}bind def
-/R{moveto 0 SC 3 -1 roll widthshow}bind def
-/S{moveto 0 exch ashow}bind def
-/T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/SF{
-findfont exch
-[exch dup 0 exch 0 exch neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/MF{
-findfont
-[5 2 roll
-0 3 1 roll
-neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/level0 0 def
-/RES 0 def
-/PL 0 def
-/LS 0 def
-/MANUAL{
-statusdict begin/manualfeed true store end
-}bind def
-/PLG{
-gsave newpath clippath pathbbox grestore
-exch pop add exch pop
-}bind def
-/BP{
-/level0 save def
-1 setlinecap
-1 setlinejoin
-72 RES div dup scale
-LS{
-90 rotate
-}{
-0 PL translate
-}ifelse
-1 -1 scale
-}bind def
-/EP{
-level0 restore
-showpage
-}def
-/DA{
-newpath arcn stroke
-}bind def
-/SN{
-transform
-.25 sub exch .25 sub exch
-round .25 add exch round .25 add exch
-itransform
-}bind def
-/DL{
-SN
-moveto
-SN
-lineto stroke
-}bind def
-/DC{
-newpath 0 360 arc closepath
-}bind def
-/TM matrix def
-/DE{
-TM currentmatrix pop
-translate scale newpath 0 0 .5 0 360 arc closepath
-TM setmatrix
-}bind def
-/RC/rcurveto load def
-/RL/rlineto load def
-/ST/stroke load def
-/MT/moveto load def
-/CL/closepath load def
-/Fr{
-setrgbcolor fill
-}bind def
-/setcmykcolor where{
-pop
-/Fk{
-setcmykcolor fill
-}bind def
-}if
-/Fg{
-setgray fill
-}bind def
-/FL/fill load def
-/LW/setlinewidth load def
-/Cr/setrgbcolor load def
-/setcmykcolor where{
-pop
-/Ck/setcmykcolor load def
-}if
-/Cg/setgray load def
-/RE{
-findfont
-dup maxlength 1 index/FontName known not{1 add}if dict begin
-{
-1 index/FID ne{def}{pop pop}ifelse
-}forall
-/Encoding exch def
-dup/FontName exch def
-currentdict end definefont pop
-}bind def
-/DEFS 0 def
-/EBEGIN{
-moveto
-DEFS begin
-}bind def
-/EEND/end load def
-/CNT 0 def
-/level1 0 def
-/PBEGIN{
-/level1 save def
-translate
-div 3 1 roll div exch scale
-neg exch neg exch translate
-0 setgray
-0 setlinecap
-1 setlinewidth
-0 setlinejoin
-10 setmiterlimit
-[]0 setdash
-/setstrokeadjust where{
-pop
-false setstrokeadjust
-}if
-/setoverprint where{
-pop
-false setoverprint
-}if
-newpath
-/CNT countdictstack def
-userdict begin
-/showpage{}def
-/setpagedevice{}def
-}bind def
-/PEND{
-countdictstack CNT sub{end}repeat
-level1 restore
-}bind def
-end def
-/setpacking where{
-pop
-setpacking
-}if
-%%EndResource
-%%EndProlog
-%%BeginSetup
-%%BeginFeature: *PageSize Default
-<< /PageSize [ 612 792 ] /ImagingBBox null >> setpagedevice
-%%EndFeature
-%%IncludeResource: font Times-Roman
-%%IncludeResource: font Times-Bold
-%%IncludeResource: font Times-Italic
-grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72
-def/PL 792 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron/Zcaron
-/scaron/zcaron/Ydieresis/trademark/quotesingle/Euro/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/space/exclam/quotedbl/numbersign/dollar/percent
-/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen
-/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon
-/semicolon/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O
-/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright/circumflex
-/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y
-/z/braceleft/bar/braceright/tilde/.notdef/quotesinglbase/guillemotleft
-/guillemotright/bullet/florin/fraction/perthousand/dagger/daggerdbl
-/endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut
-/dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash
-/quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen
-/brokenbar/section/dieresis/copyright/ordfeminine/guilsinglleft
-/logicalnot/minus/registered/macron/degree/plusminus/twosuperior
-/threesuperior/acute/mu/paragraph/periodcentered/cedilla/onesuperior
-/ordmasculine/guilsinglright/onequarter/onehalf/threequarters
-/questiondown/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE
-/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex
-/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis
-/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn
-/germandbls/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla
-/egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis
-/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide/oslash
-/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis]def
-/Times-Italic at 0 ENC0/Times-Italic RE/Times-Bold at 0 ENC0/Times-Bold RE
-/Times-Roman at 0 ENC0/Times-Roman RE
-%%EndSetup
-%%Page: 1 1
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mbgrdtif)72 48 Q 150.09(f\(1\) MB-System)-.25 F
-150.09(5.0 mbgrdtif)2.5 F(f\(1\))-.25 E/F1 10.95/Times-Bold at 0 SF -.219
-(NA)72 84 S(ME).219 E/F2 10/Times-Bold at 0 SF(mbgrdtiff)108 96 Q F0<ad>
-3.396 E F2(GMT)3.396 E F0 .896(plug-in module for generating a geograph\
-ically located GeoTIFF image from a GMT)3.396 F(grid \214le.)108 108 Q
-F1(VERSION)72 136.8 Q F0 -1.11(Ve)108 148.8 S(rsion 5.0)1.11 E F1
-(SYNOPSIS)72 177.6 Q F2(gmt mbgrdtiff \255C)108 189.6 Q/F3 10
-/Times-Italic at 0 SF(cpt\214le)A F2<ad49>2.5 E F3(gr)A(d\214le)-.37 E F2
-<ad4f>2.5 E F3(tif)A(f_\214le)-.18 E F2([\255H \255K)2.5 E F3
-(intens\214le)A F2(\255V -W])2.5 E F1(DESCRIPTION)72 218.4 Q F2
-(mbgrdtiff)108 230.4 Q F0 .688
-(is a plug-in module to generate a Geographically located GeoT)3.188 F
-(if)-.35 E 3.188(fi)-.25 G .688(mage from a)-3.188 F F2(GMT)3.188 E F0
-.689(grid \214le)3.189 F(using)108 242.4 Q F2(GMT)2.64 E F0 .14
-(\(Generic Mapping T)2.64 F 2.64(ools\). Lik)-.8 F(e)-.1 E F2(mbcontour)
-2.64 E F0(and)2.64 E F2(mbswath)2.64 E F0(,)A F2(mbgrdtiff)2.64 E F0 .14
-(is fully compatible with)2.64 F(the)108 254.4 Q F2(GMT)2.935 E F0 .435
-(package v)2.935 F .435(ersion 5.)-.15 F 2.935(AG)5.435 G .435(eoTIFF i\
-mage \214le includes location, projection and scaling information.)
--2.935 F 1.377(The image generation used by)108 266.4 R F2(mbgrdtiff)
-3.877 E F0 1.376(is identical to that of the Postscript-producing)3.877
-F F2(GMT)3.876 E F0(program)3.876 E F2(grdimage)108 278.4 Q F0 2.822(.I)
-C 2.822(np)-2.822 G(articular)-2.822 E 2.822(,t)-.4 G .323
-(he color map is applied from a)-2.822 F F2(GMT)2.823 E F0 .323
-(CPT \214le, and shading o)2.823 F -.15(ve)-.15 G .323
-(rlay grids may be).15 F 3.34(applied. The)108 290.4 R .84
-(image is 8 bits per pix)3.34 F .84
-(el if the color map is a grayscale, and 24 bits per pix)-.15 F .84
-(el otherwise. In)-.15 F .955(order to automatically generate a reasona\
-ble image of a grid, use the macro)108 302.4 R F2(mbm_grdtiff)3.456 E F0
-5.956(.T)C .956(he program)-5.956 F F2(mbgrdtiff)108 314.4 Q F0 .286
-(recognizes the coordinate system used by)2.786 F F2(mbgrid)2.786 E F0
-(or)2.786 E F2(mbmosaic)2.786 E F0 .285
-(to generate a grid \214le, and then)2.786 F .785(embeds the projection\
- and grid bounds information into the TIFF image in accordance with the\
- GeoTIFF)108 326.4 R 2.429(standard. A number of GIS softw)108 338.4 R
-2.429(are packages recognize the georeferencing information in GeoTIFF)
--.1 F 3.133(images. In)108 350.4 R(particular)3.133 E 3.133(,i)-.4 G
-.633(mages generated by)-3.133 F F2(mbgrdtiff)3.133 E F0 .634
-(from grids created using)3.134 F F2(mbgrid)3.134 E F0(or)3.134 E F2
-(mbmosaic)3.134 E F0(can)3.134 E .472
-(be loaded into the GRASS, ArcInfo, ArcV)108 362.4 R(ie)-.6 E 1.772 -.65
-(w, a)-.25 H .472(nd ArcGIS GIS packages as geographically located co)
-.65 F -.15(ve)-.15 G -.2(r-).15 G 2.932(ages. The)108 374.4 R F2(mbgrid)
-2.932 E F0(and)2.932 E F2(mbmosaic)2.932 E F0 .432
-(manual pages each contain an appendix with a complete list of the pro-)
-2.932 F .432
-(jected coordinate systems that may used in grid generation. Some softw)
-108 386.4 R .431(are packages \(e.g. W)-.1 F .431(infrog\) do not)-.4 F
-.188(recognize the embedded coordinate system information, and install \
-require a parallel "w)108 398.4 R .188(orld" \214le to specify)-.1 F
-(the bounds and resolution. The)108 410.4 Q F2(-W)2.5 E F0
-(option causes a w)2.5 E(orld \214le to be generated with a ".tfw" suf)
--.1 E(\214x.)-.25 E .048(In order for)108 434.4 R F2(GMT)2.548 E F0 .048
-(to successfully e)2.548 F -.15(xe)-.15 G(cute).15 E F2(mbgrdtiff)2.547
-E F0 2.547(,t)C .047(he location of the shared library)-2.547 F F3
-(libmbgmt)2.547 E F0(containing)2.547 E 2.651(this module must be kno)
-108 446.4 R 2.651(wn to)-.25 F F2(GMT)5.151 E F0 7.651(.T)C 2.652
-(his can be accomplished by either setting the GMT_CUS-)-7.651 F -.18
-(TO)108 458.4 S .375(M_LIBS parameter in the \214le gmt.conf that is pa\
-rt of the GMT installation, by setting this parameter in).18 F .335
-(the \214le gmt.conf in the user')108 470.4 R 2.835(sh)-.55 G .335
-(ome directory)-2.835 F 2.835(,o)-.65 G 2.835(rb)-2.835 G 2.835(yu)
--2.835 G .335(sing the GMT module)-2.835 F F2(gmtset)2.835 E F0 .335
-(to modify this parame-)2.835 F .853(ter in the current w)108 482.4 R
-.853(orking directory)-.1 F 3.353(.I)-.65 G .853(f, for instance, the)
--3.353 F F3(libmbgmt)3.353 E F0 .853
-(shared library has been installed in the)3.353 F
-(\214le /usr/lib/libmbgmt.dylib, then the GMT_CUST)108 494.4 Q
-(OM_LIBS parameter in a gmt.conf \214le can be set to:)-.18 E(GMT_CUST)
-128 506.4 Q(OM_LIBS = /usr/lib/libmbgmt.dylib)-.18 E F1 -.548(AU)72
-535.2 S(THORSHIP).548 E F0(Da)108 547.2 Q(vid W)-.2 E 2.5(.C)-.92 G
-(aress \(caress at mbari.or)-2.5 E(g\))-.18 E(Montere)113 559.2 Q 2.5(yB)
--.15 G(ay Aquarium Research Institute)-2.5 E
-(Dale N. Chayes \(dale at ldeo.columbia.edu\))108 571.2 Q
-(Lamont-Doherty Earth Observ)113 583.2 Q(atory)-.25 E F1(OPTIONS)72 612
-Q F2<ad43>108 624 Q F0 1.072(Sets the color palette \(CPT\) \214le whic\
-h controls the color of the plot.)23.08 F 1.072
-(See documentation of the)6.072 F .33(GMT package for a complete descri\
-ption of cpt \214les. If the R, G, and B v)144 636 R .329
-(alues in the CPT \214le are)-.25 F .265(all equal for each data le)144
-648 R -.15(ve)-.25 G 2.765(l\().15 G .265
-(i.e. R=G=B\), the the output TIFF image will be 8 bits per pix)-2.765 F
-.266(el. Oth-)-.15 F
-(erwise, the output TIFF image will be 24 bits per pix)144 660 Q(el.)
--.15 E F2<ad48>108 676.8 Q F0 .162(This "help" \215ag cause the program\
- to print out a description of its operation and then e)22.52 F .161
-(xit immedi-)-.15 F(ately)144 688.8 Q(.)-.65 E F2<ad49>108 705.6 Q F3
-(gr)26.41 E(d\214le)-.37 E F0 .235(The \214rst in)144 717.6 R -.2(vo)-.4
-G .235(cation of the).2 F F2(-I)2.735 E F3(gr)A(d\214le)-.37 E F0 .235
-(option sets the name of the gridded data \214le to be plotted.)2.735 F
-(The)5.235 E 1.95(data must be in a form acceptable to)144 729.6 R F2
-(GMT)4.45 E F0 -.15(ve)4.45 G 1.95(rsion 3 programs \(see the).15 F F2
-(GMT)4.45 E F0 1.95(Cookbook &)4.45 F(MB-System 5.0)72 768 Q 2.5(5F)
-137.61 G(ebruary 2015)-2.5 E(1)195.95 E 0 Cg EP
-%%Page: 2 2
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mbgrdtif)72 48 Q 150.09(f\(1\) MB-System)-.25 F
-150.09(5.0 mbgrdtif)2.5 F(f\(1\))-.25 E -.7(Te)144 84 S
-(chnical Reference\).).7 E/F1 10/Times-Bold at 0 SF<ad49>108 100.8 Q/F2 10
-/Times-Italic at 0 SF(intensity_\214le)26.41 E F0 .3(The second in)144
-112.8 R -.2(vo)-.4 G .3(cation of the).2 F F1(-I)2.8 E F2(gr)A(d\214le)
--.37 E F0 .3
-(option sets the name of a gridded data \214le containing inten-)2.8 F
-.907(sity v)144 124.8 R .907(alues to be used for shading the map.)-.25
-F(Alternati)5.907 E -.15(ve)-.25 G(ly).15 E(,)-.65 E F2(gr)3.407 E
-(d\214le)-.37 E F0 .906(may be a list of grid \214les \(one)3.407 F .273
-(\214lename on each line\) to be used together)144 136.8 R 2.773(.I)-.55
-G 2.773(fal)-2.773 G .273
-(ist of \214les is supplied, the intensity \214les must con-)-2.773 F
-(form in order to the list of data grid \214les the)144 148.8 Q 2.5(yw)
--.15 G(ill shade.)-2.5 E F1<ad4f>108 165.6 Q F2 -.45(ro)22.52 G(ot).45 E
-F0 .423(Sets the root used to construct the \214lename of the output sh\
-ellscript \()144 177.6 R F2 -.45(ro)C(ot).45 E F0 .422
-(.cmd\) and names of \214les)B .156
-(created when the shellscript is run.)144 189.6 R .157
-(Normally the name of the input grid \214le or grid \214le list is used)
-5.157 F(as the)144 201.6 Q F2 -.45(ro)2.5 G(ot).45 E F0(.)A F1<ad56>108
-218.4 Q F0(Selects v)23.08 E(erbose mode [Def)-.15 E
-(ault runs "silently"].)-.1 E F1<ad57>108 235.2 Q F0(The)20.3 E F1(-W)
-3.442 E F0 .942(option causes a "w)3.442 F .942
-(orld" \214le to be generated parallel to the GeoT)-.1 F(if)-.35 E 3.441
-(fi)-.25 G .941(mage with a ".tfw")-3.441 F(suf)144 247.2 Q 2.893
-(\214x. Some softw)-.25 F 2.893(are packages \(e.g. W)-.1 F 2.894
-(infrog\) do not recognize the coordinate information)-.4 F
-(embedded in the GeoT)144 259.2 Q(if)-.35 E 2.5<668c>-.25 G
-(le, and look for a w)-2.5 E(orld \214le.)-.1 E/F3 10.95/Times-Bold at 0 SF
-(EXAMPLES)72 276 Q F0 .405(Suppose we ha)108 288 R .705 -.15(ve o)-.2 H
-.405(btained tw).15 F 2.905(oG)-.1 G .404(RD \214les called PunaA_bath.\
-grd and PunaA_ss.grd, both with dimensions)-2.905 F 1.424
-(1162 x 1068. The \214le PunaA_bath.grd contains sea\215oor topograph)
-108 300 R 3.925(y\()-.05 G 1.425(depth v)-3.925 F 1.425(alues are ne)
--.25 F -.05(ga)-.15 G(ti).05 E -.15(ve)-.25 G 3.925(,r).15 G(anging)
--3.925 E .253(from \2555035 m to \2551619 m\), and the \214le PunaA_ss.\
-grd contains a sidescan mosaic \(re\215ecti)108 312 R .253(vity v)-.25 F
-.253(alues rang-)-.25 F(ing from 0 to 128 dB\). In order to generate a \
-24 bit color TIFF image of the sea\215oor topograph)108 324 Q 1.3 -.65
-(y, w)-.05 H 2.5(eu).65 G(se:)-2.5 E(gmt mbgrdtif)144 336 Q 2.5<66ad>
--.25 G 2.5(IP)-2.5 G 42.12(unaA_bath.grd -O)-2.5 F 67.62
-(PunaA_bath.tif -C)2.5 F(bath.cpt \255V)2.5 E
-(where the color is controlled by a GMT cpt \214le bath.cpt containing:)
-108 348 Q 2.5(-5250 37 57)144 360 R(175 \2554875)2.5 E(40 127 251)5 E
-2.5(-4875 40)144 372 R(127 251 \2554500)2.5 E(50 190 255)5 E 2.5
-(-4500 50)144 384 R(190 255 \2554125 106 235 255)2.5 E
-(-4125 106 235 255 \2553750 138 236 174)144 396 Q
-(-3750 138 236 174 \2553375 205 255 162)144 408 Q
-(-3375 205 255 162 \2553000 240 236 121)144 420 Q
-(-3000 240 236 121 \2552625 255 189)144 432 Q(87)5 E(-2625 255 189)144
-444 Q(87 \2552250 255 161)5 E(68)5 E(-2250 255 161)144 456 Q
-(68 \2551875 255 186 133)5 E(-1875 255 186 133 \2551500 255 255 255)144
-468 Q(In order to generate an 8 bit grayscale TIFF image of the sidesca\
-n mosaic, we use:)108 480 Q(gmt mbgrdtif)144 492 Q 2.5<66ad>-.25 G 2.5
-(IP)-2.5 G 51.56(unaA_ss.grd -O)-2.5 F 41.06(PunaA_ss.tif -C)2.5 F
-(ss.cpt \255V)2.5 E(where the grayscale is controlled by a GMT cpt \214\
-le ss.cpt containing:)108 504 Q 5(0.00 0 0 0 16.50)146.5 516 R 2.5
-(26 26 26)5 F 2.5(16.50 26 26 26)144 528 R 2.5(22.87 51 51 51)7.5 F 2.5
-(22.87 51 51 51)144 540 R 2.5(27.00 77 77 77)7.5 F 2.5(27.00 77 77 77)
-144 552 R(30.00 102 102 102)7.5 E(30.00 102 102 102)144 564 Q
-(32.25 128 128 128)7.5 E(32.25 128 128 128)144 576 Q(34.25 153 153 153)
-7.5 E(34.25 153 153 153)144 588 Q(36.25 179 179 179)7.5 E
-(36.25 179 179 179)144 600 Q(38.50 204 204 204)7.5 E(38.50 204 204 204)
-144 612 Q(41.23 230 230 230)7.5 E(41.23 230 230 230)144 624 Q
-(128.00 255 255 255)5 E(Here greater re\215ecti)108 636 Q
-(vity amplitudes are represented by light grayscales.)-.25 E F3
-(SEE ALSO)72 664.8 Q F1(mbsystem)108 676.8 Q F0(\(1\),)A F1(mbm_grdplot)
-6.595 E F0(\(1\),)A F1(mbgrid)6.595 E F0(\(1\),)A F1(mbmosaic)6.595 E F0
-(\(1\),)A F1(mbm_grid)6.595 E F0(\(1\),)A F1(mbm_grdtiff)6.595 E F0
-(\(1\),)A F1(gmt)6.595 E F0(\(1\),)A F1(grdimage)108 688.8 Q F0(\(1\))A
-(MB-System 5.0)72 768 Q 2.5(5F)137.61 G(ebruary 2015)-2.5 E(2)195.95 E 0
-Cg EP
-%%Page: 3 3
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mbgrdtif)72 48 Q 150.09(f\(1\) MB-System)-.25 F
-150.09(5.0 mbgrdtif)2.5 F(f\(1\))-.25 E/F1 10.95/Times-Bold at 0 SF -.11
-(BU)72 84 S(GS).11 E F0(Let us kno)108 96 Q -.65(w.)-.25 G
-(MB-System 5.0)72 768 Q 2.5(5F)137.61 G(ebruary 2015)-2.5 E(3)195.95 E 0
-Cg EP
-%%Trailer
-end
-%%EOF
diff --git a/src/ps/mbgrdviz.ps b/src/ps/mbgrdviz.ps
deleted file mode 100644
index 11690bf..0000000
--- a/src/ps/mbgrdviz.ps
+++ /dev/null
@@ -1,644 +0,0 @@
-%!PS-Adobe-3.0
-%%Creator: groff version 1.19.2
-%%CreationDate: Wed Jul  1 12:29:27 2015
-%%DocumentNeededResources: font Times-Roman
-%%+ font Times-Bold
-%%+ font Times-Italic
-%%DocumentSuppliedResources: procset grops 1.19 2
-%%Pages: 7
-%%PageOrder: Ascend
-%%DocumentMedia: Default 612 792 0 () ()
-%%Orientation: Portrait
-%%EndComments
-%%BeginDefaults
-%%PageMedia: Default
-%%EndDefaults
-%%BeginProlog
-%%BeginResource: procset grops 1.19 2
-%!PS-Adobe-3.0 Resource-ProcSet
-/setpacking where{
-pop
-currentpacking
-true setpacking
-}if
-/grops 120 dict dup begin
-/SC 32 def
-/A/show load def
-/B{0 SC 3 -1 roll widthshow}bind def
-/C{0 exch ashow}bind def
-/D{0 exch 0 SC 5 2 roll awidthshow}bind def
-/E{0 rmoveto show}bind def
-/F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def
-/G{0 rmoveto 0 exch ashow}bind def
-/H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/I{0 exch rmoveto show}bind def
-/J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def
-/K{0 exch rmoveto 0 exch ashow}bind def
-/L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/M{rmoveto show}bind def
-/N{rmoveto 0 SC 3 -1 roll widthshow}bind def
-/O{rmoveto 0 exch ashow}bind def
-/P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/Q{moveto show}bind def
-/R{moveto 0 SC 3 -1 roll widthshow}bind def
-/S{moveto 0 exch ashow}bind def
-/T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/SF{
-findfont exch
-[exch dup 0 exch 0 exch neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/MF{
-findfont
-[5 2 roll
-0 3 1 roll
-neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/level0 0 def
-/RES 0 def
-/PL 0 def
-/LS 0 def
-/MANUAL{
-statusdict begin/manualfeed true store end
-}bind def
-/PLG{
-gsave newpath clippath pathbbox grestore
-exch pop add exch pop
-}bind def
-/BP{
-/level0 save def
-1 setlinecap
-1 setlinejoin
-72 RES div dup scale
-LS{
-90 rotate
-}{
-0 PL translate
-}ifelse
-1 -1 scale
-}bind def
-/EP{
-level0 restore
-showpage
-}def
-/DA{
-newpath arcn stroke
-}bind def
-/SN{
-transform
-.25 sub exch .25 sub exch
-round .25 add exch round .25 add exch
-itransform
-}bind def
-/DL{
-SN
-moveto
-SN
-lineto stroke
-}bind def
-/DC{
-newpath 0 360 arc closepath
-}bind def
-/TM matrix def
-/DE{
-TM currentmatrix pop
-translate scale newpath 0 0 .5 0 360 arc closepath
-TM setmatrix
-}bind def
-/RC/rcurveto load def
-/RL/rlineto load def
-/ST/stroke load def
-/MT/moveto load def
-/CL/closepath load def
-/Fr{
-setrgbcolor fill
-}bind def
-/setcmykcolor where{
-pop
-/Fk{
-setcmykcolor fill
-}bind def
-}if
-/Fg{
-setgray fill
-}bind def
-/FL/fill load def
-/LW/setlinewidth load def
-/Cr/setrgbcolor load def
-/setcmykcolor where{
-pop
-/Ck/setcmykcolor load def
-}if
-/Cg/setgray load def
-/RE{
-findfont
-dup maxlength 1 index/FontName known not{1 add}if dict begin
-{
-1 index/FID ne{def}{pop pop}ifelse
-}forall
-/Encoding exch def
-dup/FontName exch def
-currentdict end definefont pop
-}bind def
-/DEFS 0 def
-/EBEGIN{
-moveto
-DEFS begin
-}bind def
-/EEND/end load def
-/CNT 0 def
-/level1 0 def
-/PBEGIN{
-/level1 save def
-translate
-div 3 1 roll div exch scale
-neg exch neg exch translate
-0 setgray
-0 setlinecap
-1 setlinewidth
-0 setlinejoin
-10 setmiterlimit
-[]0 setdash
-/setstrokeadjust where{
-pop
-false setstrokeadjust
-}if
-/setoverprint where{
-pop
-false setoverprint
-}if
-newpath
-/CNT countdictstack def
-userdict begin
-/showpage{}def
-/setpagedevice{}def
-}bind def
-/PEND{
-countdictstack CNT sub{end}repeat
-level1 restore
-}bind def
-end def
-/setpacking where{
-pop
-setpacking
-}if
-%%EndResource
-%%EndProlog
-%%BeginSetup
-%%BeginFeature: *PageSize Default
-<< /PageSize [ 612 792 ] /ImagingBBox null >> setpagedevice
-%%EndFeature
-%%IncludeResource: font Times-Roman
-%%IncludeResource: font Times-Bold
-%%IncludeResource: font Times-Italic
-grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72
-def/PL 792 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron/Zcaron
-/scaron/zcaron/Ydieresis/trademark/quotesingle/Euro/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/space/exclam/quotedbl/numbersign/dollar/percent
-/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen
-/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon
-/semicolon/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O
-/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright/circumflex
-/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y
-/z/braceleft/bar/braceright/tilde/.notdef/quotesinglbase/guillemotleft
-/guillemotright/bullet/florin/fraction/perthousand/dagger/daggerdbl
-/endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut
-/dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash
-/quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen
-/brokenbar/section/dieresis/copyright/ordfeminine/guilsinglleft
-/logicalnot/minus/registered/macron/degree/plusminus/twosuperior
-/threesuperior/acute/mu/paragraph/periodcentered/cedilla/onesuperior
-/ordmasculine/guilsinglright/onequarter/onehalf/threequarters
-/questiondown/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE
-/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex
-/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis
-/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn
-/germandbls/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla
-/egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis
-/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide/oslash
-/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis]def
-/Times-Italic at 0 ENC0/Times-Italic RE/Times-Bold at 0 ENC0/Times-Bold RE
-/Times-Roman at 0 ENC0/Times-Roman RE
-%%EndSetup
-%%Page: 1 1
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 149.84(mbgrdviz\(1\) MB-System)72 48 R 149.84
-(5.0 mbgrdviz\(1\))2.5 F/F1 10.95/Times-Bold at 0 SF -.219(NA)72 84 S(ME)
-.219 E/F2 10/Times-Bold at 0 SF(MBgrdviz)108 96 Q F0 2.5<ad53>2.5 G
-(imple interacti)-2.5 E .3 -.15(ve 2)-.25 H
-(D/3D visualization of GMT grids.).15 E F1(VERSION)72 124.8 Q F0 -1.11
-(Ve)108 136.8 S(rsion 5.0)1.11 E F1(SYNOPSIS)72 165.6 Q F2(MBgrdviz)108
-177.6 Q F0([-I)2.5 E/F3 10/Times-Italic at 0 SF(grid\214le)A F2
-<ad5420ad5620ad48>2.5 E F0(])A F1(DESCRIPTION)72 206.4 Q F3(Overvie)108
-218.4 Q(w)-.15 E F2(MBgrdviz)108 242.4 Q F0 1.349(is an interacti)3.849
-F 1.649 -.15(ve 2)-.25 H 1.349(D/3D visualization tool for).15 F F2(GMT)
-3.849 E F0(topograph)3.848 E 3.848(yg)-.05 G 1.348(rid \214les.)-3.848 F
-F2(MBgrdviz)3.848 E F0 1.348(can be)3.848 F .506
-(used for general data visualization and also has features inte)108
-254.4 R .507(grating it with sw)-.15 F .507(ath mapping data processing)
--.1 F(and sw)108 266.4 Q(ath surv)-.1 E .3 -.15(ey p)-.15 H(lanning.).15
-E .525(Once a topographic grid has been read, it may be displayed eithe\
-r as a 2D map or as a 3D model. The 2D)108 290.4 R(vie)108 302.4 Q 2.815
-(wc)-.25 G .316(an be panned and zoomed; the 3D vie)-2.815 F 2.816(wa)
--.25 G .316(lso allo)-2.816 F .316
-(ws arbitrary rotations of both the topograph)-.25 F 2.816(ym)-.05 G
-(odel)-2.816 E(and the vie)108 314.4 Q(wpoint.)-.25 E 1.079
-(In addition to the primary topograph)108 338.4 R 2.379 -.65(y, o)-.05 H
-1.079
-(ther data sets \(e.g. sidescan sonar mosaics\) can be read and dis-).65
-F 1.561(played as o)108 350.4 R -.15(ve)-.15 G 1.561
-(rlays on the topograph).15 F 2.861 -.65(y. N)-.05 H -.2(av).65 G(ig).2
-E 1.561(ation of ships or underw)-.05 F 1.561(ater v)-.1 F 1.562
-(ehicles can be read and dis-)-.15 F .128(played; if associated with sw)
-108 362.4 R .128(ath data the e)-.1 F .127(xtent of mapping co)-.15 F
--.15(ve)-.15 G .127(rage can be displayed. Site data \(indi).15 F
-(vidual)-.25 E .838(point locations\) can be read, displayed, interacti)
-108 374.4 R -.15(ve)-.25 G .838(ly created and modi\214ed, and sa).15 F
--.15(ve)-.2 G .838(d. Route data \(collec-).15 F(tions of w)108 386.4 Q
-(aypoints\) can also be read, displayed, interacti)-.1 E -.15(ve)-.25 G
-(ly created and modi\214ed, and sa).15 E -.15(ve)-.2 G(d.).15 E .272
-(The topograph)108 410.4 R 2.772(yd)-.05 G .272(ata can be sho)-2.772 F
-.271(wn using a number of colortables. The colortables can be linearly \
-stretched)-.25 F .639(between minimum and maximum v)108 422.4 R .639
-(alues, or applied using a histogram equalization. The display may also)
--.25 F 1.32
-(be shaded using an illumination model, slope magnitude, or o)108 434.4
-R -.15(ve)-.15 G 1.32(rlay grid data. Ov).15 F 1.32
-(erlay data can be dis-)-.15 F .03(played draped on the topograph)108
-446.4 R 1.33 -.65(y. T)-.05 H .03(opographic contours can be displayed \
-using a user de\214ned contour inter)-.15 F(-)-.2 E -.25(va)108 458.4 S
-(l.).25 E .193(In addition to modifying the vie)108 482.4 R 1.492 -.65
-(w, u)-.25 H .192(sers can interact with the display in se).65 F -.15
-(ve)-.25 G .192(ral w).15 F .192(ays. Users can pick single)-.1 F .243
-(points on the surf)108 494.4 R .243
-(ace to determine position and topograph)-.1 F 2.744(yv)-.05 G .244
-(alues, or pick and drag to determine range and)-2.994 F .496
-(bearing between tw)108 506.4 R 2.996(ol)-.1 G .496
-(ocations. Arbitrary rectangular re)-2.996 F .496
-(gions with north-south and east-west boundaries or)-.15 F .28(arbitrar\
-ily oriented rectangular areas can be de\214ned by picking and dragging\
-.)108 518.4 R .28(The data within a re)5.28 F .28(gion can)-.15 F
-(be opened as a ne)108 530.4 Q 2.5(wd)-.25 G
-(isplay; areas can be used for surv)-2.5 E .3 -.15(ey p)-.15 H(lanning.)
-.15 E -.8(To)108 554.4 S 1.38(pographic pro\214les associated with tw).8
-F 1.38(o-point picks, selected na)-.1 F(vig)-.2 E 1.38
-(ation, or selected routes can be dis-)-.05 F
-(played in a separate windo)108 566.4 Q 2.5(wa)-.25 G(nd sa)-2.5 E -.15
-(ve)-.2 G(d.).15 E F2(MBgrdviz)108 590.4 Q F0 .976
-(can be used to select sw)3.476 F .977
-(ath data \214les for editing or analysis using other)-.1 F F2
-(MB-System)3.477 E F0 .977(tools. If)3.477 F(surv)108 602.4 Q 1.532 -.15
-(ey n)-.15 H -.2(av).15 G(ig).2 E 1.231
-(ation has been read and displayed, a user may interacti)-.05 F -.15(ve)
--.25 G 1.231(ly select \214les of interest, and then).15 F .898
-(start up the interacti)108 614.4 R 1.198 -.15(ve w)-.25 H(aterf).05 E
-.899(all bath)-.1 F .899(ymetry editor)-.05 F F2(MBedit)3.399 E F0 .899
-(to w)3.399 F .899(ork on those \214les.)-.1 F .899(Also a)5.899 F -.25
-(va)-.2 G .899(ilable are the).25 F(interacti)108 626.4 Q -.15(ve)-.25 G
-3.994(,v).15 G 1.494(isualization based bath)-3.994 F 1.494
-(ymetry editor)-.05 F F2(MBeditviz)3.994 E F0 3.994(,t)C 1.494(he na)
--3.994 F(vig)-.2 E 1.493(ation editor)-.05 F F2(MBna)3.993 E -.1(ve)-.25
-G(dit).1 E F0 3.993(,a)C 1.493(nd the)-3.993 F -.1(wa)108 638.4 S
-(ter sound speed modeling tool).1 E F2(MBv)2.5 E(elocitytool)-.1 E F0(.)
-A F2(MBgrdviz)108 662.4 Q F0 1.221(supports as man)3.721 F 3.721(ya)-.15
-G 3.721(st)-3.721 G 1.221(en displays deri)-3.721 F 1.222
-(ving either from reading topograph)-.25 F 3.722(yg)-.05 G 1.222
-(rids or e)-3.722 F(xtracting)-.15 E(user de\214ned re)108 674.4 Q
-(gions from e)-.15 E(xisting displays.)-.15 E F3(Starting Up)108 698.4 Q
-F0(When)108 722.4 Q F2(MBgrdviz)2.839 E F0 .339(is in)2.839 F -.2(vo)-.4
-G -.1(ke).2 G 2.839(do).1 G 2.839(nt)-2.839 G .339
-(he command line, a single windo)-2.839 F 2.839(wc)-.25 G .339
-(omes up with the title)-2.839 F F2(MBgrdviz)2.838 E F0(and)2.838 E
-(MB-System 5.0)72 768 Q(16 August 2013)138.715 E(1)197.055 E 0 Cg EP
-%%Page: 2 2
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 149.84(mbgrdviz\(1\) MB-System)72 48 R 149.84
-(5.0 mbgrdviz\(1\))2.5 F(tw)108 84 Q 2.802(om)-.1 G(enus:)-2.802 E/F1 10
-/Times-Bold at 0 SF(File)2.802 E F0(and)2.802 E F1(Help)2.802 E F0 2.803
-(.T)C(he)-2.803 E F1(Help)2.803 E F0 .303
-(menu contains a single item named)2.803 F F1(About)2.803 E F0 2.803(,w)
-C .303(hich brings up a simple)-2.803 F .978(information windo)108 96 R
-3.478(wi)-.25 G .978(ncluding the MB-System release v)-3.478 F .977
-(ersion identi\214er)-.15 F 5.977(.T)-.55 G(he)-5.977 E F1(File)3.477 E
-F0 .977(menu contains se)3.477 F -.15(ve)-.25 G(ral).15 E 1.24(items, b)
-108 108 R 1.24(ut initially only the)-.2 F F1 1.24(Open Primary Grid)
-3.74 F F0(and)3.74 E F1(Quit)3.74 E F0 1.24
-(items are enabled. Selecting)3.74 F F1 1.24(Open Primary)3.74 F(Grid)
-108 120 Q F0 .246(brings up a \214lesystem bro)2.746 F .246(wser windo)
--.25 F 2.746(wt)-.25 G .246(hat allo)-2.746 F .246
-(ws users to \214nd and select the desired)-.25 F F1(GMT)2.745 E F0
-(topogra-)2.745 E(ph)108 132 Q 3.658(yg)-.05 G 1.159(rid. By def)-3.658
-F 1.159(ault, the bro)-.1 F 1.159
-(wser \214lter is set to display only \214les ending with a ".grd" suf)
--.25 F 1.159(\214x. Users can)-.25 F .058(change this \214lter \(e.g. s\
-etting it to "*" will display all \214les\) and then hit the)108 144 R
-F1(Filter)2.558 E F0 -.2(bu)2.557 G .057(tton to relist the \214les as)
-.2 F .473(desired. Once the desired topograph)108 156 R 2.973(yg)-.05 G
-.473(rid \214le has been located and selected so that its full path app\
-ears in)-2.973 F(the)108 168 Q F1(Selection)2.649 E F0(te)2.649 E .149
-(xt item, clicking the)-.15 F F1(OK)2.649 E F0 -.2(bu)2.648 G .148
-(tton will cause).2 F F1(MBgrdviz)2.648 E F0 .148
-(to read the grid and open an)2.648 F F1(MBview)2.648 E F0 .202
-(display windo)108 180 R 1.502 -.65(w. I)-.25 H(nitially).65 E 2.702(,t)
--.65 G .202(he topograph)-2.702 F 2.702(yw)-.05 G .202
-(ill be displayed in 2D, or map vie)-2.702 F 2.703(wm)-.25 G 2.703
-(ode. The)-2.703 F(def)2.703 E .203(ault color ta-)-.1 F
-(ble will be "Haxby", and the topograph)108 192 Q 2.5(yw)-.05 G
-(ill be shaded using slope magnitude.)-2.5 E/F2 10/Times-Italic at 0 SF
-(Pic)108 216 Q(king)-.2 E 2.5(,Z)-.1 G(ooming)-2.5 E 2.5(,P)-.1 G
-(anning in 2D V)-3.3 E(ie)-.74 E(w)-.15 E F1(MBgrdviz)108 240 Q F0
-(will initially be in the "pan and zoom" mouse mode.)2.5 E .124
-(In this mode, if the cursor is o)108 264 R -.15(ve)-.15 G 2.624(rt).15
-G(opograph)-2.624 E 2.624(yw)-.05 G .124(hen the left b)-2.624 F .124
-(utton is click)-.2 F .123(ed, a red X will appear at the pick)-.1 F
-.246(point and an info windo)108 276 R 2.746(wo)-.25 G 2.746(nt)-2.746 G
-.247(he left side of the)-2.746 F F1(MBview)2.747 E F0 .247
-(display windo)2.747 F 2.747(ww)-.25 G .247(ill sho)-2.747 F 2.747(wt)
--.25 G .247(he longitude, latitude,)-2.747 F .906(and topograph)108 288
-R 3.406(yv)-.05 G .906(alue of the pick point.)-3.656 F .906
-(If the left b)5.906 F .905
-(utton is used to drag the cursor from one location to)-.2 F(another)108
-300 Q 4.26(,b)-.4 G 1.76(oth the pick and release points will be sho)
--4.26 F 1.761(wn as red Xs and a red line will be displayed in)-.25 F
-1.883(between. The info windo)108 312 R 4.383(ww)-.25 G 1.883(ill sho)
--4.383 F 4.383(wb)-.25 G 1.882
-(oth the start and end positions and also the range and bearing)-4.383 F
-(between the tw)108 324 Q 2.5(ol)-.1 G(ocations.)-2.5 E(The middle b)108
-348 Q(utton can be used to pan by clicking, holding do)-.2 E(wn, and mo)
--.25 E(ving the cursor)-.15 E(.)-.55 E .65(The right b)108 372 R .65
-(utton can be used to zoom the display by clicking, holding do)-.2 F .65
-(wn, and mo)-.25 F .65(ving the cursor up to)-.15 F(zoom in or do)108
-384 Q(wn to zoom out.)-.25 E F2(Manipulating a 3D V)108 408 Q(ie)-.74 E
-(w)-.15 E F0 .515(The user can switch from 2D map vie)108 432 R 3.015
-(wt)-.25 G 3.015(o3)-3.015 G 3.015(Dv)-3.015 G(ie)-3.015 E 3.015(wm)-.25
-G .515(ode using the <V)-3.015 F(ie)-.6 E .515
-(w->3D Display> menu item \(and)-.25 F .471(can switch back using the<V)
-108 444 R(ie)-.6 E .471(w->Map Display> menu item\). In the 3D vie)-.25
-F 2.972(wm)-.25 G .472(ode, picking, panning, and)-2.972 F .617
-(zooming are done in the same f)108 456 R .617(ashion as in the map vie)
--.1 F 1.917 -.65(w. H)-.25 H -.25(ow).65 G -2.15 -.25(ev e).25 H 1.417
--.4(r, t).25 H .617(he display is a perspecti).4 F .916 -.15(ve v)-.25 H
-(ie).15 E 3.116(wt)-.25 G(hat)-3.116 E 1.964
-(includes both rotation of the topographic model and of the vie)108 468
-R 1.965(wpoint. T)-.25 F 4.465(or)-.8 G 1.965
-(otate the model, select the)-4.465 F .999("Rotate Model" b)108 480 R
-.998(utton \(or the <Mouse->Rotate Model> menu item\). The left b)-.2 F
-.998(utton can be used to pick)-.2 F(topograph)108 492 Q 2.405 -.65
-(y, t)-.05 H 1.105(he middle b).65 F 1.105
-(utton will rotate the model when click)-.2 F 1.105
-(ed and dragged, and the right b)-.1 F 1.105(utton will)-.2 F .261
-(change the v)108 504 R .261(ertical e)-.15 F .261
-(xageration when click)-.15 F .261(ed and mo)-.1 F -.15(ve)-.15 G 2.761
-(du).15 G 2.761(p\()-2.761 G .261(more e)-2.761 F .26
-(xageration\) or do)-.15 F .26(wn \(less e)-.25 F(xageration\).)-.15 E
-2.391 -.8(To r)108 516 T .791(otate the vie).8 F .791
-(wpoint, select the "Rotate V)-.25 F(ie)-.6 E .791(w" b)-.25 F .791
-(utton \(or the <Mouse->Rotate V)-.2 F(ie)-.6 E .792
-(w> menu item\). The)-.25 F 1.825(left b)108 528 R 1.825
-(utton can be used to pick topograph)-.2 F 3.125 -.65(y, t)-.05 H 1.825
-(he middle b).65 F 1.824(utton will rotate the model when click)-.2 F
-1.824(ed and)-.1 F 2.05(dragged, and the right b)108 540 R 2.051
-(utton will change the v)-.2 F 2.051(ertical e)-.15 F 2.051
-(xageration when click)-.15 F 2.051(ed and mo)-.1 F -.15(ve)-.15 G 4.551
-(du).15 G 4.551(p\()-4.551 G(more)-4.551 E -.15(ex)108 552 S
-(ageration\) or do).15 E(wn \(less e)-.25 E(xageration\).)-.15 E/F3
-10.95/Times-Bold at 0 SF -.548(AU)72 580.8 S(THORSHIP).548 E F0(Da)108
-592.8 Q(vid W)-.2 E 2.5(.C)-.92 G(aress \(caress at mbari.or)-2.5 E(g\))
--.18 E(Montere)113 604.8 Q 2.5(yB)-.15 G(ay Aquarium Research Institute)
--2.5 E(Dale N. Chayes \(dale at ldeo.columbia.edu\))108 616.8 Q
-(Lamont-Doherty Earth Observ)113 628.8 Q(atory)-.25 E F3(OPTIONS)72
-657.6 Q F1<ad48>108 669.6 Q F0 .162(This "help" \215ag cause the progra\
-m to print out a description of its operation and then e)22.52 F .161
-(xit immedi-)-.15 F(ately)144 681.6 Q(.)-.65 E F1<ad49>108 698.4 Q F2
-(grid\214le)26.41 E F0 .859
-(Sets a GMT grid \214le to be read and displayed at startup.)144 710.4 R
-.86(This option is usually used only when)5.86 F F1(MBgrdviz)144 722.4 Q
-F0(is started automatically from some other process.)2.5 E
-(MB-System 5.0)72 768 Q(16 August 2013)138.715 E(2)197.055 E 0 Cg EP
-%%Page: 3 3
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 149.84(mbgrdviz\(1\) MB-System)72 48 R 149.84
-(5.0 mbgrdviz\(1\))2.5 F/F1 10/Times-Bold at 0 SF<ad54>108 84 Q F0 .362
-(Sets a test grid to be calculated and displayed at startup.This allo)
-23.63 F .361(ws the program to be tested e)-.25 F -.15(ve)-.25 G(n).15 E
-(when a grid \214le is una)144 96 Q -.25(va)-.2 G(ilable.).25 E F1<ad56>
-108 112.8 Q F0(Normally)23.08 E(,)-.65 E F1(MBgrdviz)2.536 E F0 .036
-(outputs limited information to the stderr stream.)2.536 F .036(If the)
-5.036 F F1<ad56>2.536 E F0 .036(\215ag is gi)2.536 F -.15(ve)-.25 G .036
-(n, then).15 F F1(MBgrdviz)144 124.8 Q F0 -.1(wo)2.683 G .183
-(rks in a "v).1 F .183(erbose" mode and outputs the program v)-.15 F
-.182(ersion being used, all error status)-.15 F(messages, and a lar)144
-136.8 Q(ge amount of other information including all of the beams \215a\
-gged or zeroed.)-.18 E/F2 10.95/Times-Bold at 0 SF(INTERA)72 165.6 Q
-(CTIVE CONTR)-.602 E(OLS: MBgrdviz Startup W)-.329 E(indo)-.197 E(w)-.11
-E F1([MBgrdviz]:<File->Open Primary Grid>)108 177.6 Q F0 .675
-(This menu b)144 189.6 R .676(utton pops up a \214le bro)-.2 F .676
-(wser that allo)-.25 F .676(ws the user to select an input)-.25 F F1
-(GMT)3.176 E F0 .676(grid \214le. If)3.176 F .226(the OK b)144 201.6 R
-.226(utton is click)-.2 F(ed,)-.1 E F1(MBgrdviz)2.726 E F0 .226
-(will attempt to read a topograph)2.726 F 2.725(yg)-.05 G .225
-(rid from the speci\214ed \214le.)-2.725 F(If successful, a ne)144 213.6
-Q(w)-.25 E F1(MBview)2.5 E F0(windo)2.5 E 2.5(ww)-.25 G
-(ill appear displaying the topograph)-2.5 E -.65(y.)-.05 G F1
-([MBgrdviz]:<File->Open Site>)108 230.4 Q F0 .461(This menu b)144 242.4
-R .461(utton pops up a \214le bro)-.2 F .461(wser that allo)-.25 F .461
-(ws the user to select an input site \214le. A site \214le)-.25 F .143
-(speci\214es one or more indi)144 254.4 R .142
-(vidual locations that can be displayed and interacti)-.25 F -.15(ve)
--.25 G .142(ly mo).15 F -.15(ve)-.15 G 2.642(d. Site).15 F(\214les)2.642
-E(are te)144 266.4 Q(xt with each line delineating a single site with w\
-hite space delimited columns)-.15 E F1([MBgrdviz]:<File->Open Route>)108
-283.2 Q([MBgrdviz]:<File->Open Na)108 300 Q(vigation>)-.25 E
-([MBgrdviz]:<File->Open Swath>)108 316.8 Q([MBgrdviz]:<File->Sa)108
-333.6 Q .2 -.1(ve S)-.25 H(ite>).1 E([MBgrdviz]:<File->Sa)108 350.4 Q .2
--.1(ve R)-.25 H(oute>).1 E([MBgrdviz]:<File->Quit>)108 367.2 Q F0
-(This b)144 379.2 Q(utton causes the program to e)-.2 E
-(xit \(mostly\) gracefully)-.15 E(.)-.65 E F1([MBgrdviz]:<Help->About>)
-108 396 Q F0 1.202(This b)144 408 R 1.202
-(utton causes the program to bring up a dialog sho)-.2 F 1.202
-(wing the program')-.25 F 3.702(sn)-.55 G 1.202(ame, v)-3.702 F 1.202
-(ersion, and)-.15 F(authors.)144 420 Q F2(INTERA)72 448.8 Q(CTIVE CONTR)
--.602 E(OLS: MBview Main W)-.329 E(indo)-.197 E(w)-.11 E F1([MBview]:<V)
-108 460.8 Q(iew->Map Display>)-.37 E([MBview]:<V)108 477.6 Q
-(iew->3D Display>)-.37 E([MBview]:<V)108 494.4 Q(iew->T)-.37 E(opograph)
--.92 E(y>)-.15 E([MBview]:<V)108 511.2 Q(iew->T)-.37 E(opograph)-.92 E
-2.5(yS)-.15 G(lope>)-2.5 E([MBview]:<V)108 528 Q(iew->Ov)-.37 E(erlay>)
--.1 E([MBview]:<V)108 544.8 Q(iew->No Shading>)-.37 E([MBview]:<V)108
-561.6 Q(iew->Shading by Illumination>)-.37 E([MBview]:<V)108 578.4 Q
-(iew->Shading by Slope>)-.37 E([MBview]:<V)108 595.2 Q
-(iew->Shading by Ov)-.37 E(erlay>)-.1 E([MBview]:<V)108 612 Q(iew->T)
--.37 E(opograph)-.92 E 2.5(yC)-.15 G(ontours>)-2.5 E([MBview]:<V)108
-628.8 Q(iew->Sites>)-.37 E([MBview]:<V)108 645.6 Q(iew->Routes>)-.37 E
-([MBview]:<V)108 662.4 Q(iew->Na)-.37 E(vigation>)-.25 E([MBview]:<V)108
-679.2 Q(iew->Draped Na)-.37 E(vigation>)-.25 E([MBview]:<V)108 696 Q
-(iew->Haxby Colortable>)-.37 E F0(MB-System 5.0)72 768 Q(16 August 2013)
-138.715 E(3)197.055 E 0 Cg EP
-%%Page: 4 4
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 149.84(mbgrdviz\(1\) MB-System)72 48 R 149.84
-(5.0 mbgrdviz\(1\))2.5 F/F1 10/Times-Bold at 0 SF([MBview]:<V)108 84 Q
-(iew->Bright Rainbo)-.37 E 2.5(wC)-.1 G(olortable>)-2.5 E([MBview]:<V)
-108 100.8 Q(iew->Muted Rainbo)-.37 E 2.5(wC)-.1 G(olortable>)-2.5 E
-([MBview]:<V)108 117.6 Q(iew->Grayscale Colortable>)-.37 E([MBview]:<V)
-108 134.4 Q(iew->Flat Gray Colortable>)-.37 E([MBview]:<V)108 151.2 Q
-(iew->Seale)-.37 E -.1(ve)-.15 G 2.5(lC).1 G(olortable>)-2.5 E
-([MBview]:<Contr)108 168 Q(ols->Colors and Contours>)-.18 E
-([MBview]:<Contr)108 184.8 Q(ols->2D Contr)-.18 E(ols>)-.18 E
-([MBview]:<Contr)108 201.6 Q(ols->3D Contr)-.18 E(ols>)-.18 E
-([MBview]:<Contr)108 218.4 Q(ols->Shading>)-.18 E([MBview]:<Contr)108
-235.2 Q(ols->Resolution>)-.18 E([MBview]:<Contr)108 252 Q(ols->Pr)-.18 E
-(ojections>)-.18 E([MBview]:<Contr)108 268.8 Q(ols->Site List>)-.18 E
-([MBview]:<Contr)108 285.6 Q(ols->Route List>)-.18 E([MBview]:<Contr)108
-302.4 Q(ols->Na)-.18 E(vigation List>)-.25 E([MBview]:<Mouse->Full>)108
-319.2 Q([MBview]:<Mouse->Reset>)108 336 Q([MBview]:<Mouse->Clear>)108
-352.8 Q([MBview]:<Mouse->P)108 369.6 Q(an and Zoom>)-.1 E
-([MBview]:<Mouse->Rotate Model>)108 386.4 Q([MBview]:<Mouse->Rotate V)
-108 403.2 Q(iew>)-.37 E([MBview]:<Mouse->Shading>)108 420 Q
-([MBview]:<Mouse->Pick Ar)108 436.8 Q(ea>)-.18 E
-([MBview]:<Mouse->Edit Sites>)108 453.6 Q([MBview]:<Mouse->Edit Routes>)
-108 470.4 Q([MBview]:<Mouse->Pick Na)108 487.2 Q(v>)-.25 E
-([MBview]:<Action->About MBview)108 504 Q(...>)-.7 E
-([MBview]:<Action->Open Ov)108 520.8 Q(erlay Grid>)-.1 E
-([MBview]:<Action->Open Site File>)108 537.6 Q
-([MBview]:<Action->Open Route File>)108 554.4 Q
-([MBview]:<Action->Open Na)108 571.2 Q(vigation>)-.25 E
-([MBview]:<Action->Open Swath File>)108 588 Q([MBview]:<Action->Sa)108
-604.8 Q .2 -.1(ve S)-.25 H(ite File>).1 E([MBview]:<Action->Sa)108 621.6
-Q .2 -.1(ve R)-.25 H(oute File>).1 E([MBview]:<Action->Sa)108 638.4 Q .2
--.1(ve R)-.25 H(oute as W).1 E(infr)-.18 E(og PTS File>)-.18 E
-([MBview]:<Action->Sa)108 655.2 Q .2 -.1(ve R)-.25 H(oute as W).1 E
-(infr)-.18 E(og WPT File>)-.18 E([MBview]:<Action->Sa)108 672 Q .2 -.1
-(ve R)-.25 H(oute as Degr).1 E(ees + Decimal Minutes File>)-.18 E
-([MBview]:<Action->Sa)108 688.8 Q .2 -.1(ve R)-.25 H
-(oute as Hypack LNW File>).1 E([MBview]:<Action->Sa)108 705.6 Q .2 -.1
-(ve P)-.25 H -.18(ro).1 G(\214le File>).18 E F0(MB-System 5.0)72 768 Q
-(16 August 2013)138.715 E(4)197.055 E 0 Cg EP
-%%Page: 5 5
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 149.84(mbgrdviz\(1\) MB-System)72 48 R 149.84
-(5.0 mbgrdviz\(1\))2.5 F/F1 10/Times-Bold at 0 SF
-([MBview]:<Action->Open Selected Na)108 84 Q 2.5(vi)-.25 G 2.5(nM)-2.5 G
-(Bedit>)-2.5 E F0 2.5(B[)108 100.8 S(MBvie)-2.5 E
-(w]:<Action->Open Selected Na)-.25 E 2.5(vi)-.2 G 2.5(nM)-2.5 G
-(Beditviz>)-2.5 E 2.5(B[)108 117.6 S(MBvie)-2.5 E
-(w]:<Action->Open Selected Na)-.25 E 2.5(vi)-.2 G 2.5(nM)-2.5 G(Bna)-2.5
-E -.15(ve)-.2 G(dit>).15 E 2.5(B[)108 134.4 S(MBvie)-2.5 E
-(w]:<Action->Open Selected Na)-.25 E 2.5(vi)-.2 G 2.5(nM)-2.5 G(Bv)-2.5
-E(elocitytool>)-.15 E F1([MBview]:<Action->Open Region as New V)108
-151.2 Q(iew>)-.37 E([MBview]:<Action->Generate Sur)108 168 Q -.1(ve)-.1
-G 2.5(yR).1 G(oute fr)-2.5 E(om Ar)-.18 E(ea>)-.18 E
-([MBview]:<Dismiss->Dismiss>)108 184.8 Q([MBview]:<Full>)108 201.6 Q
-([MBview]:<Reset>)108 218.4 Q([MBview]:<Clear>)108 235.2 Q([MBview]:<P)
-108 252 Q(an and Zoom>)-.1 E([MBview]:<Rotate Model>)108 268.8 Q
-([MBview]:<Rotate V)108 285.6 Q(iew>)-.37 E([MBview]:<Shading>)108 302.4
-Q([MBview]:<Pick Ar)108 319.2 Q(ea>)-.18 E([MBview]:<Edit Sites>)108 336
-Q([MBview]:<Edit Routes>)108 352.8 Q([MBview]:<Pick Na)108 369.6 Q(v>)
--.25 E/F2 10.95/Times-Bold at 0 SF(INTERA)72 398.4 Q(CTIVE CONTR)-.602 E
-(OLS: MBview Colors and Contours W)-.329 E(indo)-.197 E(w)-.11 E F1
-([Colors and Contours]:{Data Color Bounds}"Minimum")108 410.4 Q
-([Colors and Contours]:{Data Color Bounds}"Maximum")108 427.2 Q
-([Colors and Contours]:{Data Color Bounds}<<Cold-to-Hot><Hot-to-Cold>>)
-108 444 Q([Colors and Contours]:"Data Contour Inter)108 460.8 Q -.1(va)
--.1 G(l").1 E([Colors and Contours]:{Data Slope Color Bounds}"Minimum")
-108 477.6 Q([Colors and Contours]:{Data Slope Color Bounds}"Maximum")108
-494.4 Q([Colors and Contours]:{Data Slope Color Bounds}<<Cold-to-Hot><H\
-ot-to-Cold>>)108 511.2 Q([Colors and Contours]:{Ov)108 528 Q
-(erlay Color Bounds}"Minimum")-.1 E([Colors and Contours]:{Ov)108 544.8
-Q(erlay Color Bounds}"Maximum")-.1 E([Colors and Contours]:{Ov)108 561.6
-Q(erlay Color Bounds}<<Cold-to-Hot><Hot-to-Cold>>)-.1 E
-([Colors and Contours]:<A)108 578.4 Q(pply>)-.25 E
-([Colors and Contours]:<Dismiss>)108 595.2 Q F2(INTERA)72 624 Q
-(CTIVE CONTR)-.602 E(OLS: MBview Colors and Contours W)-.329 E(indo)
--.197 E(w)-.11 E F1([2D P)108 636 Q(arameters]:{V)-.1 E(iew Offset}"X")
--.37 E([2D P)108 652.8 Q(arameters]:{V)-.1 E(iew Offset}"Y")-.37 E
-([2D P)108 669.6 Q(arameters]:{V)-.1 E(iew Offset}"Zoom")-.37 E([2D P)
-108 686.4 Q(arameters]:<A)-.1 E(pply>)-.25 E([2D P)108 703.2 Q
-(arameters]:<Dismiss>)-.1 E F0(MB-System 5.0)72 768 Q(16 August 2013)
-138.715 E(5)197.055 E 0 Cg EP
-%%Page: 6 6
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 149.84(mbgrdviz\(1\) MB-System)72 48 R 149.84
-(5.0 mbgrdviz\(1\))2.5 F/F1 10.95/Times-Bold at 0 SF(INTERA)72 84 Q
-(CTIVE CONTR)-.602 E(OLS: MBview Colors and Contours W)-.329 E(indo)
--.197 E(w)-.11 E/F2 10/Times-Bold at 0 SF([3D P)108 96 Q
-(arameters]:{Model Orientation & Zoom}"Azimuth")-.1 E([3D P)108 112.8 Q
-(arameters]:{Model Orientation & Zoom}"Ele)-.1 E -.1(va)-.15 G(tion").1
-E([3D P)108 129.6 Q(arameters]:{Model Orientation & Zoom}"Zoom")-.1 E
-([3D P)108 146.4 Q(arameters]:{V)-.1 E(iew Orientation & Zoom}"Azimuth")
--.37 E([3D P)108 163.2 Q(arameters]:{V)-.1 E
-(iew Orientation & Zoom}"Ele)-.37 E -.1(va)-.15 G(tion").1 E([3D P)144
-175.2 Q(arameters]:{V)-.1 E(iew Orientation & Zoom}"Zoom")-.37 E([3D P)
-108 192 Q(arameters]:"V)-.1 E(ertical Exageration")-1 E([3D P)108 208.8
-Q(arameters]:{P)-.1 E(an}"X")-.1 E([3D P)108 225.6 Q(arameters]:{P)-.1 E
-(an}"Y")-.1 E([3D P)108 242.4 Q(arameters]:<A)-.1 E(pply>)-.25 E([2D P)
-108 259.2 Q(arameters]:<Dismiss>)-.1 E F1(INTERA)72 288 Q(CTIVE CONTR)
--.602 E(OLS: MBview Colors and Contours W)-.329 E(indo)-.197 E(w)-.11 E
-F2([Shading P)108 300 Q(arameters]:{Shading by Illumination}"Amplitude")
--.1 E([Shading P)108 316.8 Q
-(arameters]:{Shading by Illumination}"Azimuth")-.1 E([Shading P)108
-333.6 Q(arameters]:{Shading by Illumination}"Ele)-.1 E -.1(va)-.15 G
-(tion").1 E([Shading P)108 350.4 Q
-(arameters]:{Shading by Slope}"Amplitude")-.1 E([Shading P)108 367.2 Q
-(arameters]:{Shading by Ov)-.1 E(erlay}"Amplitude")-.1 E([Shading P)108
-384 Q(arameters]:{Shading by Ov)-.1 E(erlay}"Center")-.1 E([Shading P)
-108 400.8 Q(arameters]:{Shading by Ov)-.1 E
-(erlay}<<Cold-to-Hot><Hot-to-Cold>>)-.1 E([Shading P)108 417.6 Q
-(arameters]:<A)-.1 E(pply>)-.25 E([Shading P)108 434.4 Q
-(arameters]:<Dismiss>)-.1 E F1(INTERA)72 463.2 Q(CTIVE CONTR)-.602 E
-(OLS: MBview Colors and Contours W)-.329 E(indo)-.197 E(w)-.11 E F2
-([Rendering Resolution]:<Dismiss>)108 475.2 Q
-([Rendering Resolution]:==Lo)108 492 Q 2.5(wR)-.1 G
-(esolution Dimension==)-2.5 E
-([Rendering Resolution]:==High Resolution Dimension==)108 508.8 Q
-([Rendering Resolution]:<Dismiss>)108 525.6 Q
-([Rendering Resolution]:<Dismiss>)108 542.4 Q F1(INTERA)72 571.2 Q
-(CTIVE CONTR)-.602 E(OLS: MBview Colors and Contours W)-.329 E(indo)
--.197 E(w)-.11 E F2([Pr)108 583.2 Q(ojections]:{Display Pr)-.18 E
-(ojection}<<Geographic><UTM><Spher)-.18 E(oid>>)-.18 E([Pr)108 600 Q
-(ojections]:<Dismiss>)-.18 E F1(INTERA)72 628.8 Q(CTIVE CONTR)-.602 E
-(OLS: MBview Colors and Contours W)-.329 E(indo)-.197 E(w)-.11 E F2
-([Site List]:|Site List|)108 640.8 Q
-([Site List]:<Delete Selected Sites>)108 657.6 Q([Site List]:<Dismiss>)
-108 674.4 Q F1(INTERA)72 703.2 Q(CTIVE CONTR)-.602 E
-(OLS: MBview Colors and Contours W)-.329 E(indo)-.197 E(w)-.11 E F0
-(MB-System 5.0)72 768 Q(16 August 2013)138.715 E(6)197.055 E 0 Cg EP
-%%Page: 7 7
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 149.84(mbgrdviz\(1\) MB-System)72 48 R 149.84
-(5.0 mbgrdviz\(1\))2.5 F/F1 10/Times-Bold at 0 SF
-([Route List]:|Route List|)108 84 Q
-([Route List]:<Delete Selected Routes>)108 100.8 Q
-([Route List]:<Dismiss>)108 117.6 Q/F2 10.95/Times-Bold at 0 SF(INTERA)72
-146.4 Q(CTIVE CONTR)-.602 E(OLS: MBview Colors and Contours W)-.329 E
-(indo)-.197 E(w)-.11 E F1([Na)108 158.4 Q(vigation List]:|Na)-.25 E
-(vigation List|)-.25 E([Na)108 175.2 Q
-(vigation List]:<Delete Selected Na)-.25 E(vigation>)-.25 E([Na)108 192
-Q(vigation List]:<Dismiss>)-.25 E F2(MOUSE A)72 220.8 Q(CTIONS)-.602 E
-(KEYBO)72 232.8 Q(ARD A)-.438 E(CTIONS)-.602 E(MBGRD)72 244.8 Q(VIZ R)
--.438 E(OUTE FILES)-.329 E(MBGRD)72 256.8 Q(VIZ SITE FILES)-.438 E
-(SEE ALSO)72 268.8 Q F1(mbsystem)108 280.8 Q F0(\(1\))A F2 -.11(BU)72
-309.6 S(GS).11 E F0
-(This program is not done, nor is it adequately documented.)108 321.6 Q
-(MB-System 5.0)72 768 Q(16 August 2013)138.715 E(7)197.055 E 0 Cg EP
-%%Trailer
-end
-%%EOF
diff --git a/src/ps/mbgrid.ps b/src/ps/mbgrid.ps
deleted file mode 100644
index d946857..0000000
--- a/src/ps/mbgrid.ps
+++ /dev/null
@@ -1,10293 +0,0 @@
-%!PS-Adobe-3.0
-%%Creator: groff version 1.19.2
-%%CreationDate: Wed Jul  1 12:29:27 2015
-%%DocumentNeededResources: font Times-Roman
-%%+ font Times-Bold
-%%+ font Times-Italic
-%%DocumentSuppliedResources: procset grops 1.19 2
-%%Pages: 149
-%%PageOrder: Ascend
-%%DocumentMedia: Default 612 792 0 () ()
-%%Orientation: Portrait
-%%EndComments
-%%BeginDefaults
-%%PageMedia: Default
-%%EndDefaults
-%%BeginProlog
-%%BeginResource: procset grops 1.19 2
-%!PS-Adobe-3.0 Resource-ProcSet
-/setpacking where{
-pop
-currentpacking
-true setpacking
-}if
-/grops 120 dict dup begin
-/SC 32 def
-/A/show load def
-/B{0 SC 3 -1 roll widthshow}bind def
-/C{0 exch ashow}bind def
-/D{0 exch 0 SC 5 2 roll awidthshow}bind def
-/E{0 rmoveto show}bind def
-/F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def
-/G{0 rmoveto 0 exch ashow}bind def
-/H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/I{0 exch rmoveto show}bind def
-/J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def
-/K{0 exch rmoveto 0 exch ashow}bind def
-/L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/M{rmoveto show}bind def
-/N{rmoveto 0 SC 3 -1 roll widthshow}bind def
-/O{rmoveto 0 exch ashow}bind def
-/P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/Q{moveto show}bind def
-/R{moveto 0 SC 3 -1 roll widthshow}bind def
-/S{moveto 0 exch ashow}bind def
-/T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/SF{
-findfont exch
-[exch dup 0 exch 0 exch neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/MF{
-findfont
-[5 2 roll
-0 3 1 roll
-neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/level0 0 def
-/RES 0 def
-/PL 0 def
-/LS 0 def
-/MANUAL{
-statusdict begin/manualfeed true store end
-}bind def
-/PLG{
-gsave newpath clippath pathbbox grestore
-exch pop add exch pop
-}bind def
-/BP{
-/level0 save def
-1 setlinecap
-1 setlinejoin
-72 RES div dup scale
-LS{
-90 rotate
-}{
-0 PL translate
-}ifelse
-1 -1 scale
-}bind def
-/EP{
-level0 restore
-showpage
-}def
-/DA{
-newpath arcn stroke
-}bind def
-/SN{
-transform
-.25 sub exch .25 sub exch
-round .25 add exch round .25 add exch
-itransform
-}bind def
-/DL{
-SN
-moveto
-SN
-lineto stroke
-}bind def
-/DC{
-newpath 0 360 arc closepath
-}bind def
-/TM matrix def
-/DE{
-TM currentmatrix pop
-translate scale newpath 0 0 .5 0 360 arc closepath
-TM setmatrix
-}bind def
-/RC/rcurveto load def
-/RL/rlineto load def
-/ST/stroke load def
-/MT/moveto load def
-/CL/closepath load def
-/Fr{
-setrgbcolor fill
-}bind def
-/setcmykcolor where{
-pop
-/Fk{
-setcmykcolor fill
-}bind def
-}if
-/Fg{
-setgray fill
-}bind def
-/FL/fill load def
-/LW/setlinewidth load def
-/Cr/setrgbcolor load def
-/setcmykcolor where{
-pop
-/Ck/setcmykcolor load def
-}if
-/Cg/setgray load def
-/RE{
-findfont
-dup maxlength 1 index/FontName known not{1 add}if dict begin
-{
-1 index/FID ne{def}{pop pop}ifelse
-}forall
-/Encoding exch def
-dup/FontName exch def
-currentdict end definefont pop
-}bind def
-/DEFS 0 def
-/EBEGIN{
-moveto
-DEFS begin
-}bind def
-/EEND/end load def
-/CNT 0 def
-/level1 0 def
-/PBEGIN{
-/level1 save def
-translate
-div 3 1 roll div exch scale
-neg exch neg exch translate
-0 setgray
-0 setlinecap
-1 setlinewidth
-0 setlinejoin
-10 setmiterlimit
-[]0 setdash
-/setstrokeadjust where{
-pop
-false setstrokeadjust
-}if
-/setoverprint where{
-pop
-false setoverprint
-}if
-newpath
-/CNT countdictstack def
-userdict begin
-/showpage{}def
-/setpagedevice{}def
-}bind def
-/PEND{
-countdictstack CNT sub{end}repeat
-level1 restore
-}bind def
-end def
-/setpacking where{
-pop
-setpacking
-}if
-%%EndResource
-%%EndProlog
-%%BeginSetup
-%%BeginFeature: *PageSize Default
-<< /PageSize [ 612 792 ] /ImagingBBox null >> setpagedevice
-%%EndFeature
-%%IncludeResource: font Times-Roman
-%%IncludeResource: font Times-Bold
-%%IncludeResource: font Times-Italic
-grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72
-def/PL 792 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron/Zcaron
-/scaron/zcaron/Ydieresis/trademark/quotesingle/Euro/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/space/exclam/quotedbl/numbersign/dollar/percent
-/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen
-/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon
-/semicolon/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O
-/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright/circumflex
-/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y
-/z/braceleft/bar/braceright/tilde/.notdef/quotesinglbase/guillemotleft
-/guillemotright/bullet/florin/fraction/perthousand/dagger/daggerdbl
-/endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut
-/dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash
-/quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen
-/brokenbar/section/dieresis/copyright/ordfeminine/guilsinglleft
-/logicalnot/minus/registered/macron/degree/plusminus/twosuperior
-/threesuperior/acute/mu/paragraph/periodcentered/cedilla/onesuperior
-/ordmasculine/guilsinglright/onequarter/onehalf/threequarters
-/questiondown/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE
-/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex
-/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis
-/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn
-/germandbls/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla
-/egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis
-/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide/oslash
-/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis]def
-/Times-Italic at 0 ENC0/Times-Italic RE/Times-Bold at 0 ENC0/Times-Bold RE
-/Times-Roman at 0 ENC0/Times-Roman RE
-%%EndSetup
-%%Page: 1 1
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F/F1 10.95/Times-Bold at 0 SF -.219(NA)72 84 S(ME).219
-E/F2 10/Times-Bold at 0 SF(mbgrid)108 96 Q F0 2.5<ad47>2.5 G(rid bath)-2.5
-E(ymetry)-.05 E 2.5(,a)-.65 G(mplitude, or sidescan data from sw)-2.5 E
-(ath sonar data \214les.)-.1 E F1(VERSION)72 124.8 Q F0 -1.11(Ve)108
-136.8 S(rsion 5.0)1.11 E F1(SYNOPSIS)72 165.6 Q F2 1.53(mbgrid \255I)108
-177.6 R/F3 10/Times-Italic at 0 SF(\214lelist)A F2<ad4f>4.03 E F3 -.45(ro)C
-(ot).45 E F2([\255A)4.03 E F3(datatype)A F2<ad42>4.03 E F3(bor)A(der)
--.37 E F2<ad43>4.03 E F3(clip)A F2([)A F3(/mode)A F2 4.03<5dad>C(D)-4.03
-E F3(xdim/ydim)A F2<ad45>4.03 E F3(dx/dy/units[!])A F2<ad46>4.03 E F3
-(mode)A F2<ad47>108 189.6 Q F3(gridkind)A F2<ad4a>2.713 E F3(pr)A
-(ojection)-.45 E F2<ad4b>2.713 E F3(bac)A(kgr)-.2 E(ound)-.45 E F2<ad4c>
-2.713 E F3(lon\215ip)A F2 .213<ad4d20ad4e20ad50>2.713 F F3(pings)A F2
-.214<ad5120ad52>2.714 F F3(west/east/south/north)A F2<ad52>2.714 E F3
-(factor)A F2<ad53>108 201.6 Q F3(speed)A F2<ad54>2.5 E F3(tension)A F2
-<ad55>2.5 E F3(time)A F2<ad5620ad57>2.5 E F3(scale)A F2<ad58>2.5 E F3
--.2(ex)C(tend).2 E F2(])A F1(DESCRIPTION)72 230.4 Q F2(mbgrid)108 242.4
-Q F0 .775(is a utility used to grid bath)3.275 F(ymetry)-.05 E 3.275(,a)
--.65 G .775(mplitude, or sidescan data contained in a set of sw)-3.275 F
-.775(ath sonar)-.1 F .104
-(data \214les. This program uses one of four algorithms to grid re)108
-254.4 R .105(gions co)-.15 F -.15(ve)-.15 G .105(red by sw).15 F .105
-(ath sonar sw)-.1 F .105(aths and then)-.1 F .49(can \214ll in g)108
-266.4 R .49(aps between the sw)-.05 F .49(aths \(to the de)-.1 F .49
-(gree speci\214ed by the user\) using a thin plate spline interpola-)
--.15 F 2.995(tion. The)108 278.4 R .495(gridding algorithms include g)
-2.995 F .495(aussian weighted a)-.05 F -.15(ve)-.2 G .495
-(rage, median \214lter).15 F 2.996(,m)-.4 G .496
-(inimum \214lter \(use mini-)-2.996 F(mum v)108 290.4 Q
-(alue in grid bin\), and maximum \214lter \(use maximum v)-.25 E
-(alue in grid bin\).)-.25 E .605(The user must specify a \214le contain\
-ing a list of the data \214les to be used and their data formats \()108
-314.4 R F2<ad49>A F0 .605(\), and a)B .166
-(character string to be used as the root of the output \214lenames \()
-108 326.4 R F2<ad4f>A F0 .166
-(\). The user may specify the bounds of the)B(re)108 338.4 Q .525
-(gion to be gridded \()-.15 F F2<ad52>A F3(west/east/south/north)A F0
-.525(\), and either the dimensions \()B F2<ad44>A F0 3.025(\)o)C 3.024
-(rn)-3.025 G .524(ode spacing)-3.024 F F2<ad45>3.024 E F0 .524(of the)
-3.024 F .964(grid, If the bounds and grid dimensions \(or spacing\) are\
- not speci\214ed, the program will select the re)108 350.4 R(gion)-.15 E
-1.082(encompassing all of the data in the input \214les and a grid spac\
-ing equi)108 362.4 R -.25(va)-.25 G 1.081
-(lent to 0.02 times the maximum).25 F .256
-(sonar altitude. The automatically calculated grid bounds will e)108
-374.4 R .256(xactly correspond to the smallest rectangular)-.15 F(re)108
-386.4 Q .319(gion including the data unless the user speci\214es a lar)
--.15 F .319(ger re)-.18 F .319(gion using)-.15 F F2<ad52>2.819 E F3
-(factor)A F0 2.819(.T)C .319(he v)-2.819 F(alue)-.25 E F3(factor)2.818 E
-F0 .318(must be)2.818 F .656(greater than one; if)108 398.4 R F3(factor)
-3.156 E F0 3.156(=1)3.156 G .657(.1 then the grid bounds will be e)
--3.156 F .657(xpanded to the east and west by an amount)-.15 F .774
-(0.05 times the data bounds east-west e)108 410.4 R .773
-(xtend and to the north and south by an amount 0.05 times the data)-.15
-F .272(bounds north-south e)108 422.4 R .273
-(xtent. The user can also specify the type of the input data \()-.15 F
-F2<ad41>A F0 .273(\), the width of the g)B(aus-)-.05 E .228
-(sian \214lter used for weighted a)108 434.4 R -.15(ve)-.2 G .228
-(rage gridding \().15 F F2<ad57>A F0 .228
-(\), the maximum distance from data points that the spline)B
-(interpolation is used \()108 446.4 Q F2<ad43>A F0
-(\), the format of the output \214les, and other parameters.)A .946
-(By def)108 470.4 R(ault,)-.1 E F2(mbgrid)3.446 E F0 .947(generates gri\
-ds in Geographic coordinates, meaning that position is de\214ned in lon\
-gi-)3.446 F 1.011
-(tude and latitude using the WGS84 horizontal datum. The)108 482.4 R F2
-<ad4a>3.511 E F0 1.011(option can be used to specify an alternate,)3.511
-F .334(projected coordinate system \(PCS\). When a PCS is used, positio\
-n will be de\214ned in eastings and northings)108 494.4 R .595
-(\(meters\) relati)108 506.4 R .895 -.15(ve t)-.25 H 3.095(ot).15 G .595
-(he origin of the particular PCS. Uni)-3.095 F -.15(ve)-.25 G .595
-(rsal T).15 F(ransv)-.35 E .594(erse Mercator is the most commonly)-.15
-F .751(used PCS in the oceanographic community)108 518.4 R 3.252(,b)-.65
-G(ut)-3.452 E F2(mbgrid)3.252 E F0 .752(supports a lar)3.252 F .752
-(ge number of other PCS as well. A)-.18 F(list of the supported PCS')108
-530.4 Q 2.5(si)-.55 G 2.5(sp)-2.5 G(ro)-2.5 E
-(vided at the end of this manual page.)-.15 E .857
-(Before opening an input sw)108 554.4 R .857(ath data \214le,)-.1 F F2
-(mbgrid)3.357 E F0 .856
-(checks for an ascii \214le in the same directory ha)3.357 F .856
-(ving the)-.2 F .626(same name e)108 566.4 R .626(xcept that ".inf" is \
-appended to the end. The program assumes that this ascii \214le contain\
-s the)-.15 F .195(output of the program)108 578.4 R F2(mbinf)2.695 E(o)
--.25 E F0 .195(run on the input data \214le. If the ".inf" \214le e)
-2.695 F(xists,)-.15 E F2(mbgrid)2.694 E F0 .194(reads the minimum)2.694
-F .917(and maximum longitude and latitude bounds from the)108 590.4 R F2
-(mbinf)3.417 E(o)-.25 E F0 .918(output and compares those to the w)3.417
-F(orking)-.1 E .52(bounds for the grid. If the ".inf" \214le indicates \
-that none of the data in the input \214le lies inside the w)108 602.4 R
-(orking)-.1 E .252(grid bounds, that input \214le is skipped. This allo)
-108 614.4 R .252
-(ws users to maintain a single master list of data \214les for use)-.25
-F 1.178(in all gridding without the performance penalty of)108 626.4 R
-F2(mbgrid)3.678 E F0 1.177(reading through all the data \214les, e)3.677
-F -.15(ve)-.25 G 3.677(nt).15 G(hose)-3.677 E .202(with no rele)108
-638.4 R -.15(ve)-.25 G .202(nt data. W).15 F 2.702(er)-.8 G .202
-(ecommend that users maintain a ".inf" \214le for each sw)-2.702 F .202
-(ath data \214le used for grid-)-.1 F(ding or plotting. The programs)108
-650.4 Q F2(mbswath)2.5 E F0(and)2.5 E F2(mbcontour)2.5 E F0
-(also use ".inf" \214les in the same f)2.5 E(ashion.)-.1 E(Usually)108
-674.4 Q 3.965(,t)-.65 G 1.465(he internal w)-3.965 F 1.464
-(orking grid has the same boundaries as the output grid. Ho)-.1 F(we)
--.25 E -.15(ve)-.25 G 2.264 -.4(r, t).15 H(he).4 E F2<ad58>3.964 E F0
-(option)3.964 E(allo)108 686.4 Q 1.05(ws the size of the internal grid \
-to be increased so that data outside the grid can be used to guide the)
--.25 F .283(spline interpolation of data g)108 698.4 R .282
-(aps which happen to lie at the the edge of the grid.)-.05 F .282
-(This is particularly impor)5.282 F(-)-.2 E .301(tant when adjacent gri\
-ds are created which should match along the edges.)108 710.4 R .301
-(The data input bounds are set to)5.301 F 3.843(ar)108 722.4 S -.15(eg)
--3.843 G 1.343(ion three times as lar).15 F 1.342(ge as the w)-.18 F
-1.342(orking grid in both longitude and latitude.)-.1 F 1.342
-(The program reads all)6.342 F(MB-System 5.0)72 768 Q(29 No)132.205 E
--.15(ve)-.15 G(mber 2014).15 E(1)190.545 E 0 Cg EP
-%%Page: 2 2
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F .075
-(pings which lie within the data input bounds, and accepts all beam v)
-108 84 R .075(alues with locations within the w)-.25 F(orking)-.1 E 1.33
-(grid. In addition to sw)108 96 R 1.329
-(ath sonar data in formats supported by)-.1 F/F1 10/Times-Bold at 0 SF
-(MB-System)3.829 E F0 1.329(\(see the)3.829 F F1(MB-System)3.829 E F0
-(manual)3.829 E(page\),)108 108 Q F1(mbgrid)2.772 E F0 .273
-(can also read data from ASCII te)2.773 F .273
-(xt \214les in longitude, latitude, v)-.15 F .273
-(alue triples. This allo)-.25 F .273(ws one)-.25 F(to incorporate con)
-108 120 Q -.15(ve)-.4 G(ntional echosounder bath).15 E
-(ymetry data into the gridding.)-.05 E(The a)108 144 Q -.25(va)-.2 G
-(ilable gridding algorithms speci\214ed with the).25 E F1(-F)2.5 E F0
-(option are:)2.5 E(1. Gaussian weighted mean \214lter)120.5 156 Q
-(2. Median \214lter)120.5 168 Q(3. Minimum \214lter)120.5 180 Q
-(4. Maximum \214lter)120.5 192 Q(5. Beam footprint with slope)120.5 204
-Q(6. Beam footprint)120.5 216 Q .466
-(Algorithms 5 and 6 can only be used to grid bath)108 228 R .466
-(ymetry data, and are not a)-.05 F -.25(va)-.2 G .466
-(ilable for gridding amplitude).25 F(or sidescan data.)108 240 Q 1.116
-(If the def)108 264 R 1.116(ault weighted a)-.1 F -.15(ve)-.2 G 1.116
-(rage gridding scheme \().15 F F1<ad46>A/F2 10/Times-Italic at 0 SF(1)A F0
-3.616(\)i)C 3.616(sb)-3.616 G 1.116(eing used, each data point')-3.616 F
-3.617(sc)-.55 G(ontrib)-3.617 E 1.117(ution to a)-.2 F .32
-(Gaussian weighted a)108 276 R -.15(ve)-.2 G .319(rage for each nearby \
-grid cell is calculated as the point is read and added to the grid).15 F
-(cell sums.)108 288 Q(The weighting function is gi)5 E -.15(ve)-.25 G
-2.5(nb).15 G(y:)-2.5 E(W\(r\) = Ae)144 300 Q(xp\(-r**2/a**2\))-.15 E
-1.117(where r is the distance from the center of the grid point to the \
-data point, a is the distance at which the)108 312 R .013
-(weighting function f)108 324 R .013(alls to 1/e of its maximum v)-.1 F
-.012(alue, and A is a normalizing f)-.25 F .012
-(actor set so that the sum of all)-.1 F .621(the weights adds to a v)108
-336 R .621(alue of 1.)-.25 F(Normally)5.621 E 3.121(,t)-.65 G .621
-(he distance a is set to be half the a)-3.121 F -.15(ve)-.2 G .621
-(rage grid point spacing,).15 F -.2(bu)108 348 S 2.5(tt).2 G
-(his can be v)-2.5 E(aried using the)-.25 E F1<ad57>2.5 E F0(option.)2.5
-E 1.418(If the)108 372 R F1<ad46>3.918 E F2(2)A F0 1.418(option is used\
-, the gridding is performed with a median \214lter scheme instead of a \
-Gaussian)3.918 F .773(weighted a)108 384 R -.15(ve)-.2 G .773
-(rage. In this approach, all of the v).15 F .774
-(alues for each bin are held in memory until all of the data)-.25 F .032
-(has been read. Then, the median v)108 396 R .031
-(alue for each bin is assigned as the gridded v)-.25 F .031
-(alue for that bin.)-.25 F .031(The adv)5.031 F(an-)-.25 E .743
-(tage of a median \214lter approach is that it is relati)108 408 R -.15
-(ve)-.25 G .743(ly insensiti).15 F 1.043 -.15(ve t)-.25 H 3.244(oi).15 G
-.744(solated artif)-3.244 F .744(acts in the data, pro)-.1 F(vided)-.15
-E .459(that se)108 420 R -.15(ve)-.25 G .459(ral samples e).15 F .459
-(xist for each bin.)-.15 F .459(The disadv)5.459 F .458
-(antage to the median \214lter is that in the absence of arti-)-.25 F
--.1(fa)108 432 S 1.096(cts, the weighted a).1 F -.15(ve)-.2 G 1.097(rag\
-e scheme does a better job of representing the gridded \214eld, particu\
-larly if the).15 F .904
-(spectral characteristics of the gridded \214eld are important.)108 444
-R .903(The median \214lter approach also requires much)5.904 F .11
-(more memory than a weighted a)108 456 R -.15(ve)-.2 G .11
-(rage. In general, edited bath).15 F .11
-(ymetry should be gridded using the Gaussian)-.05 F .625(weighted a)108
-468 R -.15(ve)-.2 G .625(rage, while unedited bath).15 F(ymetry)-.05 E
-3.125(,b)-.65 G .624
-(eam amplitude, and sidescan data should be gridded using)-3.125 F
-(the median \214lter)108 480 Q(.)-.55 E .574(The minimum \214lter \()108
-504 R F1<ad46>A F2(3)A F0 3.074(\)a)C .574(nd maximum \214lter \()-3.074
-F F1<ad46>A F2(4)A F0 3.074(\)g)C .574(ridding schemes w)-3.074 F .574
-(ork lik)-.1 F 3.074(et)-.1 G .574(he median \214lter)-3.074 F 3.074(,e)
--.4 G(xcept)-3.224 E .202(that the minimum or maximum bin v)108 516 R
-.201
-(alues are reported instead of the median. These algorithms can be use-)
--.25 F 1.016(ful for producing grids which strongly re\215ect outliers \
-in the data. Hydrographers often prefer to grid ba-)108 528 R(th)108 540
-Q .458(ymetry using a minimum depth scheme because the)-.05 F 2.958(ya)
--.15 G .458(re most interested in the shallo)-2.958 F .458
-(west \(most danger)-.25 F(-)-.2 E(ous\) soundings in their data.)108
-552 Q .104(If the)108 576 R F1<ad46>2.604 E F2(5)A F0 .104
-(option is used, gridding of multibeam bath)2.604 F .105
-(ymetry is performed using beam footprints rather than)-.05 F 2.605(aw)
-108 588 S .104(eighting function tied to the grid cell spacing. In this\
- algorithm, the beam footprints are calculated using)-2.605 F .338
-(the angular beamwidths and the sonar altitude abo)108 600 R .638 -.15
-(ve t)-.15 H .338(he sea\215oor).15 F 5.338(.A)-.55 G .338(weighting v)
--2.5 F .338(alue is calculated for each)-.25 F .144(grid cell which ful\
-ly or parially lies within the beam footprint; these weighting v)108 612
-R .144(alues represent the fraction)-.25 F .342(of the beam contained w\
-ithin the cell. Each footprint is tilted according to the local slope; \
-the slope is esti-)108 624 R .478(mated from a lo)108 636 R 2.978(wr)
--.25 G .478(esolution, \214rst pass grid created by simple mean \214lte\
-ring the soundings. The slope grid)-2.978 F 1.116(is generated using a \
-cell size twice that of the \214nal grid. This approach allo)108 648 R
-1.116(ws one to sensibly grid data)-.25 F .592
-(using a resolution greater than that of the ra)108 660 R 3.092(wd)-.15
-G .591(ata. Thus, if one has data with a lar)-3.092 F .591(ge depth v)
--.18 F .591(ariation, one)-.25 F .021(can generate a grid with a cell s\
-pacing appropriate for the high resolution, shallo)108 672 R 2.521(wd)
--.25 G .021(ata and still get sensible)-2.521 F .101(results in deep re)
-108 684 R .101(gions where the grid cells may be much smaller than the \
-beam footprints. Bath)-.15 F .1(ymetry data)-.05 F(deri)108 696 Q -.15
-(ve)-.25 G 4.174(df).15 G 1.674
-(rom sources other than multibeam data \(e.g. xyz, lidar)-4.174 F 4.174
-(,p)-.4 G 1.675(hotogrammetry\) are treated as points)-4.174 F .151(rat\
-her than soundings with footprints; the full weight of each sounding is\
- applied to the grid cell in which it)108 708 R(is located.)108 720 Q
-(MB-System 5.0)72 768 Q(29 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E
-(2)190.545 E 0 Cg EP
-%%Page: 3 3
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(The)108 84 Q/F1 10/Times-Bold at 0 SF<ad46>3.346 E
-/F2 10/Times-Italic at 0 SF(6)A F0 .847(option results in beam footprint g\
-ridding of multibeam data without application of a local slope)3.346 F
-(estimate.)108 96 Q(Normally)108 120 Q 2.592(,a)-.65 G .092
-(ll of the data which f)-2.592 F .092(alls into the re)-.1 F .092
-(gion of interest is used to construct the gridded data set. This)-.15 F
-1.227(means that the data from o)108 132 R -.15(ve)-.15 G 1.227
-(rlapping sw).15 F 1.227(aths will be "a)-.1 F -.15(ve)-.2 G 1.227
-(raged" in the re).15 F 1.227(gion of o)-.15 F -.15(ve)-.15 G 1.227
-(rlap. A).15 F -.15(ve)-.74 G 1.227(raging ba-).15 F(th)108 144 Q 1.628
-(ymetry data from o)-.05 F -.15(ve)-.15 G 1.627(rlapping sw).15 F 1.627
-(aths is usually \214ne, b)-.1 F 1.627(ut a)-.2 F -.15(ve)-.2 G 1.627
-(raging imagery data \(beam amplitude or).15 F 1.714(sidescan\) deri)108
-156 R -.15(ve)-.25 G 4.214(df).15 G 1.714(rom dif)-4.214 F 1.714
-(ferent sw)-.25 F 1.714(aths is usually undesirable. The)-.1 F F1<ad55>
-4.214 E F0 1.714(option allo)4.214 F 1.714(ws the user to force)-.25 F
-F1(mbgrid)108 168 Q F0 .917(to ignore data which o)3.417 F -.15(ve)-.15
-G .917(rlies re).15 F .917(gions already co)-.15 F -.15(ve)-.15 G .916
-(red by pre).15 F .916(vious data \(as de\214ned by a time lag)-.25 F
-.205(criterea\). Alternati)108 180 R -.15(ve)-.25 G(ly).15 E 2.705(,t)
--.65 G .206
-(he user can force the program to use only the last data in a re)-2.705
-F .206(gion, ag)-.15 F .206(ain as de\214ned)-.05 F
-(by a time lag. This option w)108 192 Q
-(orks best with the median \214lter scheme.)-.1 E .752(The gridding can\
- be augmented by interpolation using a 2D thin plate spline algorithm w\
-ith optional ten-)108 216 R .343
-(sion. The use of interpolation is set with the)108 228 R F1<ad43>2.843
-E F2(clip[/mode])A F0 .343
-(option, and is only used to \214ll in grid cells left)2.843 F .455
-(unde\214ned after all of the sw)108 240 R .455(ath data ha)-.1 F .755
--.15(ve b)-.2 H .454(een processed. The).15 F F2(clip)2.954 E F0 -.25
-(va)2.954 G .454(lue sets the distance from sw).25 F .454(ath data)-.1 F
-1.125(to which the interpolation is applied \(this distance is speci\
-\214ed as an inte)108 252 R 1.125(ger number of grid cells, so the)-.15
-F(ph)108 264 Q .257(ysical distance is)-.05 F F2(clip)2.757 E F0 .257
-(times the grid cell interv)2.757 F .256(al\). If)-.25 F F2(mode)2.756 E
-F0 2.756(=1\()2.756 G .256(the def)-2.756 F .256
-(ault\), unde\214ned cells will be \214lled)-.1 F .571
-(with interpolation only if cells \214lled with sw)108 276 R .572
-(ath data are found within)-.1 F F2(clip)3.072 E F0 .572(cells in tw)
-3.072 F 3.072(oo)-.1 G .572(pposite directions)-3.072 F 1.203
-(\(e.g east and west, or northeast and southwest\). This approach serv)
-108 288 R 1.202(es to \214ll in data g)-.15 F 1.202(aps while a)-.05 F
--.2(vo)-.2 G(iding).2 E .763
-(adding an interpolated band around the edges of a surv)108 300 R -.15
-(ey)-.15 G 3.263(.Ac)-.5 G .763(aution: a lar)-3.263 F .764(ge v)-.18 F
-.764(alue of)-.25 F F2(clip)3.264 E F0 .764(combined with)3.264 F F2
-(mode)108 312 Q F0 2.921(=1w)2.921 G .421(ill be VER)-2.921 F 2.921(Ys)
--.65 G(lo)-2.921 E 1.721 -.65(w. I)-.25 H(f).65 E F2(mode)2.921 E F0
-2.921(=2)2.921 G 2.921(,t)-2.921 G .421
-(hen unde\214ned cells will be \214lled with the interpolation if the)
--2.921 F(y)-.15 E 1.218(are within)108 324 R F2(clip)3.718 E F0 1.218
-(cells of sw)3.718 F 1.218(ath data in an)-.1 F 3.718(yd)-.15 G 1.218
-(irection. This approach is f)-3.718 F(aster)-.1 E 3.719(,b)-.4 G 1.219
-(ut can mak)-3.919 F 3.719(eas)-.1 G(urv)-3.719 E 1.519 -.15(ey l)-.15 H
-(ook).15 E(lar)108 336 Q .371(ger and more complete than in reality)-.18
-F 5.371(.I)-.65 G(f)-5.371 E F2(mode)2.871 E F0 2.871(=3o)2.871 G(r)
--2.871 E F2(clip)2.871 E F0 .371(is set to a v)2.871 F .371
-(alue greater than both dimensions)-.25 F .835
-(of the output grid, then all grid cells not set by sw)108 348 R .835
-(ath data will be \214lled by interpolation.)-.1 F(The)5.835 E F1<ad54>
-3.335 E F2(tension)A F0 .005
-(option modulates the thin plate spline algorithm.)108 360 R .005
-(Using the def)5.005 F(ault)-.1 E F2(tension)2.505 E F0 2.505(=0)2.505 G
-.005(.0 corresponds to a minimum)-2.505 F(curv)108 372 Q .036
-(ature, pure Laplacian solution. If)-.25 F F2(tension)2.536 E F0 .036
-(is made lar)2.536 F .037(ge, the solution tends to)-.18 F -.1(wa)-.25 G
-.037(rd a thin plate spline and).1 F(is ef)108 384 Q(fecti)-.25 E -.15
-(ve)-.25 G(ly \215attened.).15 E(The)108 408 Q F1<ad4b>3.405 E F2(bac)A
-(kgr)-.2 E(ound)-.45 E F0 .905(option is used to underlay a bath)3.405 F
-.904(ymetry or topograph)-.05 F 3.404(yg)-.05 G .904
-(rid with a global or re)-3.404 F(gional)-.15 E(topograph)108 420 Q 4.26
-(ym)-.05 G 1.76(odel. The background data model can be read from a GMT \
-grid \214le or from a database)-4.26 F .277(accessed by the)108 432 R F1
-(GMT)2.776 E F0(program)2.776 E F1(grdraster)2.776 E F0 5.276(.I)C 2.776
-(nt)-5.276 G .276(he former case)-2.776 F F2(bac)2.776 E(kgr)-.2 E(ound)
--.45 E F0 .276(is just the \214le path for the back-)2.776 F .724
-(ground grid. In the latter case)108 444 R F2(bac)3.225 E(kgr)-.2 E
-(ound)-.45 E F0 .725
-(is an identi\214er number used to specify which dataset to e)3.225 F
-(xtract)-.15 E(using)108 456 Q F1(grdraster)3.503 E F0 3.503(.T)C 1.003
-(hese identi\214ers are user de\214ned and v)-3.503 F 1.003(ary with)
--.25 F F1(GMT)3.503 E F0 1.003(installations. When the)3.503 F F1<ad4b>
-3.502 E F2(bac)A(k-)-.2 E(gr)108 468 Q(ound)-.45 E F0(option is in)2.5 E
--.2(vo)-.4 G -.1(ke).2 G(d,).1 E F1(grd2xyz)2.5 E F0(or)2.5 E F1
-(grdraster)2.5 E F0 .001(is used to e)2.5 F .001
-(xtract all of the longitude, latitude, and topogra-)-.15 F(ph)108 480 Q
-2.924(yv)-.05 G .424(alues within the speci\214ed database that lie wit\
-hin the desired grid. These v)-3.174 F .423(alues are interpolated onto)
--.25 F .209(the desired grid locations using the thin plate spline algo\
-rithm, and then mapped onto the grid where)108 492 R -.15(ve)-.25 G 2.71
-(rt).15 G(he)-2.71 E -.25(va)108 504 S
-(lues are unde\214ned by either sw).25 E
-(ath data or the spline interpolation in)-.1 E -.2(vo)-.4 G -.1(ke).2 G
-2.5(dw).1 G(ith the)-2.5 E F1<ad43>2.5 E F0(option.)2.5 E -.15(Fo)108
-528 S 2.832(rm).15 G .332(agnetic in)-2.832 F -.15(ve)-.4 G .332
-(rsions it is useful to ha).15 F .632 -.15(ve a b)-.2 H(ath).15 E .331
-(ymetry grid which tails of)-.05 F 2.831(ft)-.25 G 2.831(oac)-2.831 G
-.331(onstant v)-2.831 F .331(alue at the bor)-.25 F(-)-.2 E(der)108 540
-Q 5.721(.T)-.55 G 3.221(of)-6.521 G .721(acilitate this, the)-3.321 F F1
-<ad42>3.221 E F0 .721(option allo)3.221 F .722
-(ws the user to set the border of a smoothly interpolated grid to a)-.25
-F 1.511(constant v)108 552 R 1.511(alue where)-.25 F -.15(ve)-.25 G
-4.011(rn).15 G 4.011(od)-4.011 G 1.511(ata are present.)-4.011 F 1.51
-(This is useful only if the data are con\214ned to the central)6.511 F
-(re)108 564 Q
-(gion of the grid and a smooth interpolation is done with a lar)-.15 E
-(ge)-.18 E F2(clip)2.5 E F0(so that the entire grid is \214lled.)2.5 E
-.936(The output grid will by def)108 588 R .936(ault contain v)-.1 F
-.936(alues of 99999.9 at cells containing no data; if the)-.25 F F1
-<ad4e>3.437 E F0 .937(option is)3.437 F(used then the \215agging v)108
-600 Q(alue used is NaN, or not-a-number)-.25 E(.)-.55 E .452(The names \
-of the output \214les are based on the root character string speci\214e\
-d using the)108 624 R F1<ad4f>2.951 E F0 .451(option. A num-)2.951 F
-.337(ber of grid formats are supported, including all of the grid forma\
-ts supported by)108 636 R F1(GMT)2.837 E F0 5.338(.S)C .338(ee the)
--5.338 F F1<ad47>2.838 E F0(option)2.838 E(belo)108 648 Q 2.821(wf)-.25
-G .321(or a list of the a)-2.821 F -.25(va)-.2 G .321(ilable formats.)
-.25 F .321(If the grid is output in an)5.321 F 2.821(yo)-.15 G 2.821(ft)
--2.821 G(he)-2.821 E F1(GMT)2.821 E F0 .321
-(grid formats, then its \214le-)2.821 F .07
-(name is "root.grd", and a shellscript which will allo)108 660 R 2.57
-(wt)-.25 G .07(he contents of the grid to be vie)-2.57 F .07(wed using)
--.25 F F1(GMT)2.57 E F0(pro-)2.57 E .331
-(grams is also output with the \214lename "root.grd.cmd".)108 672 R .331
-(If the)5.331 F F1<ad47>2.831 E F2(1)A F0 .33
-(option is used to specify an ascii format)2.83 F
-(grid, then the output grid \214lename will be "root.asc", b)108 684 Q
-(ut no plotting shellscript will be created.)-.2 E 3.016(Ad)108 708 S
-.516(atalist \214le containing references to all of the sw)-3.016 F .517
-(ath \214les actually contib)-.1 F .517
-(uting to the grid is also created.)-.2 F
-(This \214le is named by adding a ".mb-1" suf)108 720 Q
-(\214x to the root string.)-.25 E(MB-System 5.0)72 768 Q(29 No)132.205 E
--.15(ve)-.15 G(mber 2014).15 E(3)190.545 E 0 Cg EP
-%%Page: 4 4
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(The)108 84 Q/F1 10/Times-Bold at 0 SF<ad4d>2.996 E
-F0 .496(option causes)2.996 F F1(mbgrid)2.996 E F0 .495(to output tw)
-2.996 F 2.995(oa)-.1 G .495
-(dditional grids, the \214rst \("root_num.grd"\) being the number)-2.995
-F .85(of data points located within each bin, and the second \("root_sd\
-.grd"\) being the standard de)108 96 R .85(viation of the)-.25 F .14
-(data points located within each bin.)108 108 R .14
-(Plotting shellscripts called "root_num.grd.cmd" and "root_sd.grd.cmd")
-5.14 F 1.081(are also output if the grids are in a)108 120 R F1(GMT)
-3.581 E F0 1.081(grid format. The)3.581 F F1<ad4d>3.581 E F0 1.081
-(option is ignored when the minimum or)3.581 F
-(maximum \214lter gridding algorithms are used.)108 132 Q/F2 10.95
-/Times-Bold at 0 SF -.548(AU)72 160.8 S(THORSHIP).548 E F0(Da)108 172.8 Q
-(vid W)-.2 E 2.5(.C)-.92 G(aress \(caress at mbari.or)-2.5 E(g\))-.18 E
-(Montere)113 184.8 Q 2.5(yB)-.15 G(ay Aquarium Research Institute)-2.5 E
-(Dale N. Chayes \(dale at ldeo.columbia.edu\))108 196.8 Q
-(Lamont-Doherty Earth Observ)113 208.8 Q(atory)-.25 E F2(OPTIONS)72
-237.6 Q F1<ad41>108 249.6 Q/F3 10/Times-Italic at 0 SF(datatype)23.08 E F0
-.011(Sets the type of data to be read and gridded. If)144 261.6 R F3
-(datatype)2.51 E F0 2.51(=1)2.51 G 2.51(,b)-2.51 G(ath)-2.51 E .01
-(ymetry data will be gridded \(posi-)-.05 F(ti)144 273.6 Q 3.141 -.15
-(ve d)-.25 H -.25(ow).15 G(nw).25 E 2.841(ards\). If)-.1 F F3(datatype)
-5.341 E F0 5.341(=2)5.341 G 5.341(,b)-5.341 G(ath)-5.341 E 2.842
-(ymetry data will be gridded as topograph)-.05 F 5.342(y\()-.05 G
-(positi)-5.342 E -.15(ve)-.25 G(upw)144 285.6 Q 3.098(ards\). If)-.1 F
-F3(datatype)3.098 E F0 3.098(=3)3.098 G 3.098(,a)-3.098 G .598
-(mplitude data will be gridded.)-3.098 F(If)5.598 E F3(datatype)3.098 E
-F0 3.097(=4)3.097 G 3.097(,s)-3.097 G .597(idescan data will be)-3.097 F
-(gridded. Def)144 297.6 Q(ault:)-.1 E F3(datatype)2.5 E F0 2.5(=1\()2.5
-G(bath)-2.5 E(ymetry\).)-.05 E F1<ad42>108 314.4 Q F3(bor)23.63 E(der)
--.37 E F0 1.094
-(Sets the border of a smoothly interpolated grid to the v)144 326.4 R
-(alue)-.25 E F3(bor)3.595 E(der)-.37 E F0(where)3.595 E -.15(ve)-.25 G
-3.595(rn).15 G 3.595(od)-3.595 G 1.095(ata e)-3.595 F 1.095(xist, pro-)
--.15 F(vided)144 338.4 Q F3(bor)2.5 E(der)-.37 E F0 2.5(>0)2.5 G 2.5
-(.0. Def)-2.5 F(ault:)-.1 E F3(bor)2.5 E(der)-.37 E F0 2.5(=0)2.5 G(.0)
--2.5 E F1<ad43>108 355.2 Q F3(clip[/mode])23.08 E F0 .091(Controls the \
-use of spline interpolation to \214ll grid cells not \214lled by sw)144
-367.2 R .091(ath data. The)-.1 F F3(clip)2.591 E F0 -.25(va)2.591 G .091
-(lue sets).25 F .605(the distance from sw)144 379.2 R .605(ath data \(i\
-n grid cells\) that the spline interpolation may be applied. If)-.1 F F3
-(clip)3.105 E F0(=0)A .811(no spline interpolation will be done.)144
-391.2 R(If)5.811 E F3(mode)3.311 E F0 .811(=1 \(the def)B .81
-(ault\), then the interpolation will \214ll data)-.1 F -.05(ga)144 403.2
-S 1.278(ps up to tw).05 F 3.779(ot)-.1 G(imes)-3.779 E F3(clip)3.779 E
-F0 1.279(grid cells in size. If)3.779 F F3(mode)3.779 E F0 1.279
-(=2 then the spline interpolation will \214ll all)B .059
-(unde\214ned cells within a distance of)144 415.2 R F3(clip)2.559 E F0
-.059(cells from data. If)2.559 F F3(mode)2.559 E F0 2.559(=3o)2.559 G(r)
--2.559 E F3(clip)2.559 E F0 .059(is set to a v)2.559 F .059
-(alue greater)-.25 F .643(than both dimensions of the output grid, then\
- all grid cells not set by sw)144 427.2 R .644
-(ath data will be \214lled by)-.1 F 2.5(interpolation. Def)144 439.2 R
-(ault:)-.1 E F3(clip)2.5 E F0 2.5(=0a)2.5 G(nd)-2.5 E F3(mode)2.5 E F0
-2.5(=1)2.5 G(.)-2.5 E F1<ad44>108 456 Q F3(xdim/ydim)23.08 E F0 1.349
-(Sets the dimensions of the output grid.)144 468 R 1.349
-(This option is superceded if the user speci\214es the grid)6.349 F
-(spacing with the)144 480 Q F1<ad45>2.5 E F0 2.5(option. Def)2.5 F
-(ault:)-.1 E F3(xdim)5 E F0(=)2.5 E F3(ydim)2.5 E F0 2.5(=1)2.5 G(01.)
--2.5 E F1<ad45>108 496.8 Q F3(dx/dy/units[!])23.63 E F0 .468
-(Sets the grid cell spacing to)144 508.8 R F3(dx)2.968 E F0 .468
-(in longitude and)2.968 F F3(dy)2.968 E F0 .468(in latitude. If)2.968 F
-F3(units)2.968 E F0 .468(is not speci\214ed, the)2.968 F F3(dx)2.968 E
-F0(and)2.968 E F3(dy)144 520.8 Q F0 -.25(va)5.22 G 2.72
-(lues are assumed to be in meters. V).25 F 2.719(alid v)-1.11 F 2.719
-(alues for)-.25 F F3(units)5.219 E F0 2.719(include "km", "meters", and)
-5.219 F("de)144 532.8 Q 2.71(grees". If)-.15 F .21(not in de)2.71 F .21
-(grees, the grid cell spacing v)-.15 F .21(alues are con)-.25 F -.15(ve)
--.4 G .21(rted to de).15 F .21(grees using the central)-.15 F .284
-(latitude of the grid. If)144 544.8 R F3(dy)2.784 E F0 2.784(=0)2.784 G
-.284(.0, then the latitude cell spacing will be set equal to the longit\
-ude cell)-2.784 F .294(spacing \(after con)144 556.8 R -.15(ve)-.4 G
-.294(rsion to de).15 F .294(grees, if necessary\).)-.15 F .294(By def)
-5.294 F .295(ault, the grid spacing is calculated from)-.1 F .019
-(the grid bounds and the grid dimensions. When the user uses the)144
-568.8 R F1<ad45>2.518 E F0 .018(option to set the cell spacings,)2.518 F
-.944(the grid dimensions are calculated using the grid bounds and grid \
-cell spacings. Ho)144 580.8 R(we)-.25 E -.15(ve)-.25 G 1.744 -.4(r, s)
-.15 H(light).4 E 1.41
-(adjustments to the grid cell spacings are usually required to k)144
-592.8 R 1.41(eep the grid bounds as speci\214ed.)-.1 F .748
-(Appending an ! to the end of the)144 604.8 R F1<ad45>3.248 E F0(ar)
-3.248 E .748(guments forces)-.18 F F1(mbgrid)3.248 E F0 .749
-(to use the e)3.248 F .749(xact grid cell spacing)-.15 F -.25(va)144
-616.8 S .046(lues speci\214ed by adjusting the grid bounds.).25 F(Def)
-5.046 E .046(ault: If neither the)-.1 F F1<ad45>2.545 E F0(or)2.545 E F1
-.045(\255DP options ar)2.545 F 2.545(es)-.18 G(pec-)-2.545 E .665
-(i\214ed, the pr)144 628.8 R .665(ogram sets the grid cell spacing to b\
-e 0.02 times the maximum sonar altitude in)-.18 F(the input \214les.)144
-640.8 Q<ad46>108 657.6 Q F3(mode)24.19 E F0
-(Sets the gridding algorithm to be used.)144 669.6 Q F3(mode)180 681.6 Q
-F0 2.5(=1)2.5 G 22.5(:G)-2.5 G(aussian W)-22.5 E(eighted Mean)-.8 E F3
-(mode)180 693.6 Q F0 2.5(=2)2.5 G 22.5(:M)-2.5 G(edian Filter)-22.5 E F3
-(mode)180 705.6 Q F0 2.5(=3)2.5 G 22.5(:M)-2.5 G(inimum Filter)-22.5 E
-F3(mode)180 717.6 Q F0 2.5(=4)2.5 G 22.5(:M)-2.5 G(aximum Filter)-22.5 E
-F3(mode)180 729.6 Q F0 2.5(=5)2.5 G 22.5(:W)-2.5 G(eighted Sonar F)-23.3
-E(ootprint with slope)-.15 E(MB-System 5.0)72 768 Q(29 No)132.205 E -.15
-(ve)-.15 G(mber 2014).15 E(4)190.545 E 0 Cg EP
-%%Page: 5 5
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F/F1 10/Times-Italic at 0 SF(mode)180 84 Q F0 3.552
-(=6)3.552 G 23.552(:W)-3.552 G 1.052(eighted Sonar F)-24.352 F 1.052
-(ootprint The def)-.15 F 1.051(ault is)-.1 F F1(mode)3.551 E F0 3.551
-(=1\()3.551 G 1.051(Gaussian W)-3.551 F(eighted)-.8 E(Mean\).)144 96 Q
-/F2 10/Times-Bold at 0 SF<ad47>108 112.8 Q F1(gridkind)22.52 E F0 .37
-(This option sets the format of the output grid \214le.)144 124.8 R .371
-(The def)5.371 F .371(ault is to output a GMT netCDF 4-byte)-.1 F .51
-(\215oat grid.)144 136.8 R .51(The user may specify the grid format eit\
-her by using an identi\214er number)5.51 F 3.01(,o)-.4 G 3.01(rb)-3.01 G
-3.01(yu)-3.01 G(sing)-3.01 E(the)144 148.8 Q F2(GMT)2.5 E F0
-(grid format syntax, which allo)2.5 E(ws for scaling and of)-.25 E
-(fsets of the data.)-.25 E
-(First, the simple grid format identi\214ers are:)144 172.8 Q F1
-(gridkind)180 184.8 Q F0 2.5(=1)2.5 G 19.69(:A)-2.5 G(SCII table)-19.69
-E F1(gridkind)180 196.8 Q F0 2.5(=2)2.5 G 19.69(:b)-2.5 G
-(inary \214le \()-19.69 E F2(GMT)A F0 -.15(ve)2.5 G
-(rsion 1 GRD \214le\)).15 E F1(gridkind)180 208.8 Q F0 2.5(=3)2.5 G
-19.69(:n)-2.5 G(etCDF \214le \()-19.69 E F2(GMT)A F0 -.15(ve)2.5 G
-(rsion 2 GRD \214le\)).15 E F1(gridkind)180 220.8 Q F0 2.5(=4)2.5 G
-19.69(:A)-2.5 G(rc/Info and ArcV)-19.69 E(ie)-.6 E 2.5(wA)-.25 G
-(SCII grid)-2.5 E F1(gridkind)180 232.8 Q F0 2.5(=1)2.5 G 7.19(00: GMT)
--2.5 F(netCDF 4-byte \215oat format [Def)2.5 E(ault])-.1 E F1(gridkind)
-180 244.8 Q F0 4.907(=1)4.907 G 7.19(01: Nati)-4.907 F 2.707 -.15(ve b)
--.25 H 2.407
-(inary single precision \215oats in scanlines with leading grd).15 F
-(header)144 256.8 Q F1(gridkind)180 268.8 Q F0 2.5(=1)2.5 G 7.19
-(02: Nati)-2.5 F .3 -.15(ve b)-.25 H(inary short inte).15 E
-(gers in scanlines with leading grd header)-.15 E F1(gridkind)180 280.8
-Q F0 2.5(=1)2.5 G 7.19(03: 8-bit)-2.5 F
-(standard Sun raster\214le \(colormap ignored\))2.5 E F1(gridkind)180
-292.8 Q F0 2.5(=1)2.5 G 7.19(04: Nati)-2.5 F .3 -.15(ve b)-.25 H
-(inary unsigned char in scanlines with leading grd header).15 E F1
-(gridkind)180 304.8 Q F0 2.5(=1)2.5 G 7.19(05: Nati)-2.5 F .3 -.15(ve b)
--.25 H(inary bits in scanlines with leading grd header).15 E F1
-(gridkind)180 316.8 Q F0 2.5(=1)2.5 G 7.19(06: Nati)-2.5 F .3 -.15(ve b)
--.25 H(inary `).15 E(`surfer')-.74 E 2.5('g)-.74 G(rid \214les)-2.5 E F1
-(gridkind)180 328.8 Q F0 2.5(=1)2.5 G 7.19(07: netCDF)-2.5 F
-(1-byte byte format)2.5 E F1(gridkind)180 340.8 Q F0 2.5(=1)2.5 G 7.19
-(08: netCDF)-2.5 F(1-byte char format)2.5 E F1(gridkind)180 352.8 Q F0
-2.5(=1)2.5 G 7.19(09: netCDF)-2.5 F(2-byte int format)2.5 E F1(gridkind)
-180 364.8 Q F0 2.5(=1)2.5 G 7.19(10: netCDF)-2.5 F(4-byte int format)2.5
-E F1(gridkind)180 376.8 Q F0 2.5(=1)2.5 G 7.19(11: netCDF)-2.5 F
-(8-byte double format)2.5 E(Second, a)144 400.8 Q F2(GMT)2.5 E F0
-(grid format string has the form:)2.5 E(=id[/scale/of)180 412.8 Q
-(fset[/nan]])-.25 E .247(where id is the)144 424.8 R F2(GMT)2.747 E F0
-.246(format id, and the other v)2.747 F .246(alues are optional. If)-.25
-F F1(scale)2.746 E F0(and)2.746 E F1(of)2.746 E(fset)-.18 E F0 .246
-(are gi)2.746 F -.15(ve)-.25 G .246(n, the).15 F .696
-(data will be multiplied by)144 436.8 R F1(scale)3.196 E F0 .697(and of)
-3.196 F .697(fset by)-.25 F F1(of)3.197 E(fset)-.18 E F0 .697
-(prior to being output. The)3.197 F F1(nan)3.197 E F0 -.25(va)3.197 G
-.697(lue sets the).25 F -.25(va)144 448.8 S
-(lue used for "not-a-number". The).25 E F2(GMT)2.5 E F0(format id')2.5 E
-2.5(sf)-.55 G(or these format strings are:)-2.5 E F1(id)180 460.8 Q F0
-2.5(=0)2.5 G 9.8(:G)-2.5 G(MT netCDF 4-byte \215oat format [Def)-9.8 E
-(ault])-.1 E F1(id)180 472.8 Q F0 2.5(=1)2.5 G 9.8(:N)-2.5 G(ati)-9.8 E
-.3 -.15(ve b)-.25 H
-(inary single precision \215oats in scanlines with leading grd header)
-.15 E F1(id)180 484.8 Q F0 2.5(=2)2.5 G 9.8(:N)-2.5 G(ati)-9.8 E .3 -.15
-(ve b)-.25 H(inary short inte).15 E
-(gers in scanlines with leading grd header)-.15 E F1(id)180 496.8 Q F0
-2.5(=3)2.5 G 9.8(:8)-2.5 G
-(-bit standard Sun raster\214le \(colormap ignored\))-9.8 E F1(id)180
-508.8 Q F0 2.5(=4)2.5 G 9.8(:N)-2.5 G(ati)-9.8 E .3 -.15(ve b)-.25 H
-(inary unsigned char in scanlines with leading grd header).15 E F1(id)
-180 520.8 Q F0 2.5(=5)2.5 G 9.8(:N)-2.5 G(ati)-9.8 E .3 -.15(ve b)-.25 H
-(inary bits in scanlines with leading grd header).15 E F1(id)180 532.8 Q
-F0 2.5(=6)2.5 G 9.8(:N)-2.5 G(ati)-9.8 E .3 -.15(ve b)-.25 H(inary `).15
-E(`surfer')-.74 E 2.5('g)-.74 G(rid \214les)-2.5 E F1(id)180 544.8 Q F0
-2.5(=7)2.5 G 9.8(:n)-2.5 G(etCDF 1-byte byte format)-9.8 E F1(id)180
-556.8 Q F0 2.5(=8)2.5 G 9.8(:n)-2.5 G(etCDF 1-byte char format)-9.8 E F1
-(id)180 568.8 Q F0 2.5(=9)2.5 G 9.8(:n)-2.5 G(etCDF 2-byte int format)
--9.8 E F1(id)180 580.8 Q F0 2.5(=1)2.5 G 2.3(0: netCDF)-2.5 F
-(4-byte int format)2.5 E F1(id)180 592.8 Q F0 2.5(=1)2.5 G 2.3
-(1: netCDF)-2.5 F(8-byte double format)2.5 E 2.324(Note that the follo)
-144 604.8 R 2.324(wing ar)-.25 F 2.324(guments are equi)-.18 F -.25(va)
--.25 G 2.324(lent because the).25 F 4.824(ya)-.15 G 2.324
-(ll produce a standard)-4.824 F F2(GMT)4.823 E F0
-(netCDF 4-byte \215oat grid:)144 616.8 Q F2<ad47>180 628.8 Q F1(3)A F2
-<ad47>180 640.8 Q F1(100)A F2<ad47>180 652.8 Q F1(=0)A F0 .834
-(Should the user wish to produce a grid in nati)144 664.8 R 1.134 -.15
-(ve b)-.25 H .835(inary \215oats, then the follo).15 F .835(wing tw)-.25
-F 3.335(oa)-.1 G -.18(rg)-3.335 G(uments).18 E(will w)144 676.8 Q(ork:)
--.1 E F2<ad47>180 688.8 Q F1(101)A F2<ad47>180 700.8 Q F1(=1)A F0 .077
-(Should the user wish to produce a grid in nati)144 712.8 R .377 -.15
-(ve s)-.25 H .076(hort int format with a scaling f).15 F .076
-(actor of 10, an of)-.1 F(f-)-.25 E(set of 32000, and a NaN v)144 724.8
-Q(alue of 32767, then the follo)-.25 E(wing ar)-.25 E(guments will suf)
--.18 E(\214ce:)-.25 E(MB-System 5.0)72 768 Q(29 No)132.205 E -.15(ve)
--.15 G(mber 2014).15 E(5)190.545 E 0 Cg EP
-%%Page: 6 6
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F/F1 10/Times-Bold at 0 SF<ad47>180 84 Q/F2 10
-/Times-Italic at 0 SF(=2/10/32000/32767)A F0(If)144 108 Q F2(gridkind)2.773
-E F0 2.773(=3o)2.773 G(r)-2.773 E F2(gridkind)2.773 E F0 .273(>= 100,)
-2.773 F F1(mbgrid)2.773 E F0 .273(also outputs shellscripts which run)
-2.773 F F1(GMT)2.773 E F0 .274(programs to)2.774 F(pro)144 120 Q .504(v\
-ide preliminary color \214ll maps of the gridded data. These shellscrip\
-ts are generated using the)-.15 F F1(mbm_grdplot)144 132 Q F0(macro.)2.5
-E(If)144 156 Q F2(gridkind)2.981 E F0 2.981(=4)2.981 G 2.981(,t)-2.981 G
-.481(he output grids will be in the Arc/Info ASCII grid format.)-2.981 F
-.482(Arc/Info ASCII grids)5.482 F 1.396(use "square" bins, meaning that\
- the longitude and latitude grid cell spacings must be identical.)144
-168 R .58(Thus, whene)144 180 R -.15(ve)-.25 G 3.08(rt).15 G(he)-3.08 E
-F2(gridkind)3.08 E F0 3.08(=4o)3.08 G .58(ption is used, the)-3.08 F F1
-<ad45>3.08 E F0 .58(option must also be used in a w)3.08 F .58(ay which)
--.1 F(ensures equal grid cell spacings \(see the)144 192 Q F1<ad45>2.5 E
-F0(documentation abo)2.5 E -.15(ve)-.15 G 2.5(\). Def).15 F(ault:)-.1 E
-F2(gridkind)2.5 E F0 2.5(=1)2.5 G(00.)-2.5 E F1<ad48>108 208.8 Q F0 .162
-(This "help" \215ag cause the program to print out a description of its\
- operation and then e)22.52 F .161(xit immedi-)-.15 F(ately)144 220.8 Q
-(.)-.65 E F1<ad49>108 237.6 Q F2(datalist)26.41 E F0 .572
-(Sets the \214lename of the \214le containing a list of the input sw)144
-249.6 R .573(ath sonar data \214les and their formats.)-.1 F(In the)144
-261.6 Q F2(datalist)2.5 E F0(\214le, each data \214le should be follo)
-2.5 E(wed by a data format identi\214er)-.25 E 2.5(,e)-.4 G(.g.:)-2.5 E
-(data\214le1 11)180 273.6 Q(data\214le2 24)180 285.6 Q .03
-(This program uses the)144 297.6 R F1(MBIO)2.53 E F0 .029
-(library and will read an)2.53 F 2.529(ys)-.15 G -.1(wa)-2.529 G .029
-(th sonar format supported by).1 F F1(MBIO)2.529 E F0 2.529(.A)C 1.296
-(list of the sw)144 309.6 R 1.297
-(ath sonar data formats currently supported by)-.1 F F1(MBIO)3.797 E F0
-1.297(and their identi\214er v)3.797 F 1.297(alues is)-.25 F(gi)144
-321.6 Q -.15(ve)-.25 G 3.157(ni).15 G 3.157(nt)-3.157 G(he)-3.157 E F1
-(MBIO)3.157 E F0 .657(manual page.)3.157 F 3.157(Af)5.657 G .656
-(ormat identi\214er of 0 indicates that the \214le contains lines of)
--3.157 F(\(lon, lat, depth\) triples which can be read in free format.)
-144 333.6 Q .558(An input data\214le may be accompanied by a "f)144
-345.6 R .559(ast bath)-.1 F .559(ymetry" or "fbt" \214le.)-.05 F .559
-(An "fbt" \214le contains)5.559 F .041(only sw)144 357.6 R .041
-(ath bath)-.1 F .041(ymetry information in a compact format \(format 71\
-\), and is thus quick to read. The)-.05 F .673("fbt" \214ne naming con)
-144 369.6 R -.15(ve)-.4 G .673(ntion is to add the ".fbt" suf).15 F .673
-(\214x to the original sw)-.25 F .673(ath data \214lename. In the)-.1 F
--2.15 -.25(ev e)144 381.6 T 1.363(nt that a bath).25 F 1.363
-(ymetry or topograph)-.05 F 3.863(yg)-.05 G 1.363
-(rid is being generated,)-3.863 F F1(mbgrid)3.863 E F0 1.362
-(will attempt to read an)3.862 F
-("fbt" \214le in lieu of the original data.)144 393.6 Q(Def)5 E(ault:)
--.1 E F2(datalist)2.5 E F0 2.5(=d)2.5 G(atalist.mb-1)-2.5 E F1<ad4a>108
-410.4 Q F2(pr)25.3 E(ojection)-.45 E F0 .225(By def)2.725 F(ault,)-.1 E
-F1(mbgrid)2.725 E F0 .225
-(generates grids in Geographic coordinates, meaning that position is)
-2.725 F .517(de\214ned in longitude and latitude using the WGS84 geogra\
-phic coordinate system.)144 422.4 R(The)5.517 E F1<ad4a>3.017 E F0
-(option)3.016 E .222(can be used to specify an alternate, projected coo\
-rdinate system \(PCS\). When a PCS is used, posi-)144 434.4 R .489
-(tion will be de\214ned in eastings and northings \(meters\) relati)144
-446.4 R .789 -.15(ve t)-.25 H 2.989(ot).15 G .488
-(he origin of the particular PCS.)-2.989 F(Uni)144 458.4 Q -.15(ve)-.25
-G .378(rsal T).15 F(ransv)-.35 E .378(erse Mercator is the most commonl\
-y used PCS in the oceanographic community)-.15 F(,)-.65 E -.2(bu)144
-470.4 S(t).2 E F1(mbgrid)3.038 E F0 .537(supports a lar)3.038 F .537
-(ge number of other PCS')-.18 F 3.037(sa)-.55 G 3.037(sw)-3.037 G 3.037
-(ell. The)-3.037 F .537(underlying projection functions)3.037 F(deri)144
-482.4 Q .3 -.15(ve f)-.25 H(rom the).15 E F1(PR)2.5 E(OJ)-.3 E(.4)-.2 E
-F0(library written by Gerald Ev)2.5 E
-(enden, then of the U.S. Geological Surv)-.15 E -.15(ey)-.15 G(.)-.5 E
-(The)144 506.4 Q F2(pr)2.943 E(ojection)-.45 E F0(ar)2.943 E .443
-(gument for the)-.18 F F1<ad4a>2.943 E F0 .443
-(option can be either a PCS identi\214er from the projection de\214-)
-2.943 F .443(nition list pro)144 518.4 R .443
-(vided at the end of this manual page, or simply)-.15 F F1<ad4a>2.943 E
-F2(U)A F0 .442(to specify using UTM in what-)2.943 F -2.15 -.25(ev e)144
-530.4 T 2.5(rz).25 G
-(one is appropriate for the grid bounds speci\214ed with the)-2.5 E F1
-<ad52>2.5 E F0(option.)2.5 E -.15(Fo)144 554.4 S 3.248(ri).15 G .748
-(nstance, to fully specify a particular northern UTM zone, set)-3.248 F
-F2(pr)3.249 E(ojection)-.45 E F0 3.249(=U)3.249 G .749(TMXXN where)
--3.249 F .122(XX gi)144 566.4 R -.15(ve)-.25 G 2.622(st).15 G .122
-(he UTM zone \(de\214ned from 01 to 60\). As an e)-2.622 F .121
-(xample, a northern UTM zone 12 projec-)-.15 F 1.266
-(tion can be speci\214ed using)144 578.4 R F1<ad4a>3.766 E F2(UTM12N)A
-F0 6.266(.S)C 1.266(outhern UTM zones are speci\214ed as UTMXXS. The)
--6.266 F .617(European Petroleum Surv)144 590.4 R .917 -.15(ey G)-.15 H
-.617(roup \(EPSG\) has de\214ned a lar).15 F .617(ge number of PCS')-.18
-F 3.117(su)-.55 G .616(sed w)-3.117 F(orldwide)-.1 E .031
-(and assigned number id')144 602.4 R 2.532(st)-.55 G 2.532(oe)-2.532 G
-.032
-(ach; one can also specify the northern UTM zone 12 projection using)
--2.532 F .977(its EPSG designation, or)144 614.4 R F1<ad4a>3.477 E F2
-(epsg32612)A F0 5.977(.W)C .976
-(hen the projected coordinate system is fully speci\214ed)-5.977 F .5
-(by the)144 626.4 R F1<ad4a>3 E F0 .5
-(option, then the grid bounds may be speci\214ed using)3 F F1<ad52>3.001
-E F0 .501(in either longitude and latitude)3.001 F
-(or in eastings and northings.)144 638.4 Q(Alternati)144 662.4 Q -.15
-(ve)-.25 G(ly).15 E 3.394(,o)-.65 G .894
-(ne may indicate a UTM projection without specifying the zone by using)
--3.394 F F1<ad4a>3.393 E F2(U)A F0 3.393(.I)C(n)-3.393 E .361(this case\
-, the UTM zone will be inferred from the midpoint of the speci\214ed lo\
-ngitude and latitude)144 674.4 R 1.308
-(bounds, and then the longitude and latitude bounds gi)144 686.4 R -.15
-(ve)-.25 G 3.808(nw).15 G 1.308(ith the)-3.808 F F1(\255fR)3.808 E F0
-1.308(option are translated to)3.808 F(UTM eastings and northings.)144
-698.4 Q .922(All grids and mosaics produced by)144 722.4 R F1(MB-System)
-3.422 E F0 .923(programs contain identi\214ers that are recognized)3.423
-F(MB-System 5.0)72 768 Q(29 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E
-(6)190.545 E 0 Cg EP
-%%Page: 7 7
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F 3.168(by the plotting macros)144 84 R/F1 10
-/Times-Bold at 0 SF(mbm_grdplot)5.668 E F0(,)A F1(mbm_grd3dplot)5.668 E F0
-5.668(,a)C(nd)-5.668 E F1(mbm_grdtiff)5.668 E F0 8.167(.T)C 3.167
-(hese plotting)-8.167 F .403
-(macros automatically use a linear map projection whene)144 96 R -.15
-(ve)-.25 G 2.903(rt).15 G(he)-2.903 E 2.903(ye)-.15 G .403
-(ncounter grids and mosaics that)-2.903 F 1.062
-(are already in a projected coordinate system. Also, the program)144 108
-R F1(mbgrdtiff)3.561 E F0 1.061(automatically inserts)3.561 F .786(the \
-appropriate projection information into the GeoTIFF images it generates\
-. As a result, images)144 120 R .147(generated by)144 132 R F1
-(mbgrdtiff)2.647 E F0 .147(will be properly georeferenced when the)2.647
-F 2.647(ya)-.15 G .147(re imported into GIS softw)-2.647 F(are.)-.1 E F1
-<ad4b>108 160.8 Q/F2 10/Times-Italic at 0 SF(bac)22.52 E(kgr)-.2 E(ound)
--.45 E F0 .289
-(Enables \214lling in all unde\214ned grid cells with bath)144 172.8 R
-.289(ymetry or topograph)-.05 F 2.79(yf)-.05 G .29(rom a global or re)
--2.79 F(gional)-.15 E 1.151(database. If raster data ha)144 184.8 R
-1.451 -.15(ve b)-.2 H 1.151(een locally made a).15 F -.25(va)-.2 G 1.151
-(ilable through the).25 F F1(GMT)3.65 E F0(program)3.65 E F1(grdraster)
-3.65 E F0(,)A .786(these can be accessed by specifying)144 196.8 R F2
-(bac)3.286 E(kgr)-.2 E(ound)-.45 E F0 .786(as the)3.286 F F1(grdraster)
-3.286 E F0 .786(dataset id number \(e.g.)3.286 F F1<ad4b>3.286 E F2(4)A
-F0<ad>3.286 E .309(note that)144 208.8 R F1(grdraster)2.809 E F0 .309
-(datasets are numbered starting at 1\).)2.809 F .309
-(Users can also use data in GMT grids as)5.309 F 3.018(ab)144 220.8 S
-.518(ackground \(including grids generated by)-3.018 F F1(mbgrid)3.018 E
-F0 3.019(\)b)C 3.019(ys)-3.019 G(pecifying)-3.019 E F2(bac)3.019 E(kgr)
--.2 E(ound)-.45 E F0 .519(as the \214le path to)3.019 F
-(the desired grid \(e.g.)144 232.8 Q F1<ad4b>2.5 E F2(/usr/local/shar)A
-(e/globaltopo.gr)-.37 E(d)-.37 E F0(\).)A F1<ad4c>108 261.6 Q F2
-(lon\215ip)23.63 E F0 .572(Sets the range of the longitude v)144 273.6 R
-.572(alues returned.)-.25 F(If)5.572 E F2(lon\215ip)3.072 E F0 .572
-(=\2551 then the longitude v)B .571(alues will be in)-.25 F .488
-(the range from \255360 to 0 de)144 285.6 R .488(grees. If)-.15 F F2
-(lon\215ip)2.988 E F0 .488(=0 then the longitude v)B .489
-(alues will be in the range from)-.25 F 1.383(\255180 to 180 de)144
-297.6 R 1.383(grees. If)-.15 F F2(lon\215ip)3.882 E F0 1.382
-(=1 then the longitude v)B 1.382
-(alues will be in the range from 0 to 360)-.25 F(de)144 309.6 Q 2.5
-(grees. Def)-.15 F(ault:)-.1 E F2(lon\215ip)2.5 E F0 2.5(=0)2.5 G(.)-2.5
-E F1<ad4d>108 326.4 Q F0 1.11(Causes tw)20.86 F 3.61(oa)-.1 G 1.111
-(dditional grids to be output. One is a grid containing the standard de)
--3.61 F 1.111(viation of the)-.25 F .234
-(data within each grid cell relati)144 338.4 R .534 -.15(ve t)-.25 H
-2.734(ot).15 G .234(he grid v)-2.734 F .234
-(alue, the other contains the number of data points in)-.25 F .846(each\
- grid cell. This option is ignored when the minimum or maximum \214lter\
- gridding algorithms)144 350.4 R(are used \(see the)144 362.4 Q F1(-F)
-2.5 E F0(option\).)2.5 E F1<ad4e>108 379.2 Q F0 1.458
-(Causes grid cells with no data and no interpolation to be set to a v)
-23.08 F 1.457(alue of NaN instead of the)-.25 F(def)144 391.2 Q(ault v)
--.1 E(alue of 99999.9.)-.25 E(The NaN v)5 E(alue is e)-.25 E(xpected by)
--.15 E F1(GMT)2.5 E F0(programs such)2.5 E F1(grdview)2.5 E F0(.)A F1
-<ad4f>108 408 Q F2 -.45(ro)22.52 G(ot).45 E F0 .524(Sets the character \
-string to be used as the root of the output \214lenames. F)144 420 R
-.524(or e)-.15 F .525(xample, if the grid is)-.15 F .074(output as a)144
-432 R F1(GMT)2.574 E F0 -.15(ve)2.574 G .074
-(rsion 2 GRD format \(netCDF\) \214le \(the def).15 F .073
-(ault\), then its \214lename is "root.grd".)-.1 F 1.268(If the)144 444 R
-F1<ad47>3.768 E F2(1)A F0 1.268(option is used to specify an ascii form\
-at grid, then the output grid \214lename will be)3.768 F .084
-("root.asc". If the)144 456 R F1<ad47>2.584 E F2(2)A F0 .084
-(option is used to specify a v)2.584 F .084
-(ersion 1 GRD format \(binary\) grid, then the out-)-.15 F .831
-(put grid \214lename will be "root.grd1". If the output grid is in the)
-144 468 R F1(GMT)3.331 E F0 -.15(ve)3.331 G .831(rsion 2 GRD format, a)
-.15 F .165(shellscript which will allo)144 480 R 2.665(wt)-.25 G .164
-(he contents of the grid to vie)-2.665 F .164(wed using)-.25 F F1(GMT)
-2.664 E F0 .164(programs is also output)2.664 F
-(with the \214lename "root.grd.cmd".)144 492 Q F1<ad50>108 508.8 Q F2
-(pings)24.19 E F0 .55(Sets the ping a)3.05 F -.15(ve)-.2 G .55
-(raging of the input data. If).15 F F2(pings)3.05 E F0 3.05(>0)3.05 G
-3.05(,t)-3.05 G .55(hen that number of input pings will)-3.05 F .643
-(be a)144 520.8 R -.15(ve)-.2 G .643(raged to produce one output ping.)
-.15 F(If)5.643 E F2(pings)3.143 E F0 3.142(=0)3.142 G 3.142(,t)-3.142 G
-.642(hen the ping a)-3.142 F -.15(ve)-.2 G .642
-(raging will automatically).15 F 1.041(be done so that the along-track \
-ping spacing is equal to the across-track beam spacing. Def)144 532.8 R
-(ault:)-.1 E F2(pings)144 544.8 Q F0 2.5(=1)2.5 G(.)-2.5 E F1<ad51>108
-561.6 Q F0(Normally)22.52 E 2.512(,b)-.65 G(ath)-2.512 E .012
-(ymetry or topograph)-.05 F 2.512(yd)-.05 G .011
-(ata is gridded in meters. If this option is used, bath)-2.512 F .011
-(ymetry or)-.05 F(topograph)144 573.6 Q 2.5(yd)-.05 G
-(ata is gridded in feet.)-2.5 E F1<ad52>108 590.4 Q F2
-(west/east/south/north)23.08 E(factor)144 602.4 Q F0 2.431(The \214rst \
-form sets the longitude and latitude bounds of the output grid.)144
-614.4 R 2.432(By def)7.432 F 2.432(ault \(if the)-.1 F F1<ad52>144 626.4
-Q F2(west/east/south/north)A F0 .003(option is not speci\214ed\) the pr\
-ogram will set the grid bounds to be the area)2.503 F .367
-(encompassing all of the data in the input \214les. The second form \()
-144 638.4 R F1<ad52>A F2(factor)A F0 2.867(\)e)C .367
-(xpands the automati-)-3.017 F .737
-(cally calculated bounds by the multiplicati)144 650.4 R -.15(ve)-.25 G
-F2(factor)3.387 E F0 .736(.The v)B(alue)-.25 E F2(factor)3.236 E F0 .736
-(must be greater than one; if)3.236 F F2(factor)144 662.4 Q F0 3.127(=1)
-3.127 G .628(.1 then the grid bounds will be e)-3.127 F .628
-(xpanded to the east and west by an amount 0.05 times)-.15 F 1.345
-(the data bounds east-west e)144 674.4 R 1.345
-(xtend and to the north and south by an amount 0.05 times the data)-.15
-F .485(bounds north-south e)144 686.4 R 2.986(xtent. If)-.15 F .486
-(the user uses the)2.986 F F1<ad45>2.986 E F0 .486
-(option to set the grid spacing, then the dimen-)2.986 F .414(sions wil\
-l be calculated from the grid bounds and spacing. In these circumstance\
-s rounding errors)144 698.4 R 1.047(will usually require that the easte\
-rn and northern bounds be adjusted to \214t e)144 710.4 R 1.047
-(xactly with the grid)-.15 F 2.512(dimensions and spacing.)144 722.4 R
-(Def)7.512 E 2.512(ault: If the)-.1 F F1<ad52>5.012 E F2
-(west/east/south/north)A F0 2.512(option is not speci\214ed, the)5.012 F
-(MB-System 5.0)72 768 Q(29 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E
-(7)190.545 E 0 Cg EP
-%%Page: 8 8
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(program will set the grid bounds to be the area \
-encompassing all of the data in the input \214les.)144 84 Q/F1 10
-/Times-Bold at 0 SF<ad53>108 100.8 Q/F2 10/Times-Italic at 0 SF(speed)24.74 E
-F0 .532(Sets the minimum speed in km/hr \(5.5 kts ~ 10 km/hr\) allo)144
-112.8 R .532(wed in the input data; pings associated)-.25 F
-(with a smaller ship speed will not be output. Def)144 124.8 Q(ault:)-.1
-E F2(speed)2.5 E F0 2.5(=0)2.5 G(.)-2.5 E F1<ad54>108 141.6 Q F2
-(tension)23.63 E F0(Sets the)144 153.6 Q F2(tension)2.5 E F0 -.25(va)2.5
-G(lue used in the thin plate spline interpolation.).25 E(A)144 177.6 Q
-F2(tension)3.212 E F0 .712(of 0 gi)3.212 F -.15(ve)-.25 G 3.212(sam).15
-G .712(inimum curv)-3.212 F .712(ature surf)-.25 F .712
-(ace with free edges; this is a pure Laplacian solu-)-.1 F .319
-(tion. A nonzero)144 189.6 R F2(tension)2.819 E F0 .319(tends to suppre\
-ss spurious oscillations and \215atten the interpolation to)2.819 F -.1
-(wa)-.25 G(rd).1 E .227(the edges; a)144 201.6 R F2(tension)2.727 E F0
-.227(of in\214nity yields a pure thin plate spline solution. The)2.727 F
-F2(tension)2.726 E F0 .226(must be zero or)2.726 F(greater)144 213.6 Q 5
-(.D)-.55 G(ef)-5 E(ault:)-.1 E F2(tension)2.5 E F0 2.5(=0)2.5 G
-(.0 \(minimum curv)-2.5 E(ature solution\).)-.25 E F1<ad55>108 230.4 Q
-F2(time)23.08 E F0 -.15(Fo)144 242.4 S(rces).15 E F1(mbgrid)4.226 E F0
-1.727(to a)4.227 F -.2(vo)-.2 G 1.727(id a).2 F -.15(ve)-.2 G 1.727
-(raging o).15 F -.15(ve)-.15 G 1.727(rlapping sw).15 F 1.727
-(aths by ignoring the data from later sw)-.1 F(aths.)-.1 E .242
-("Later" data is identi\214ed using the)144 254.4 R F2(time)2.742 E F0
--.25(va)2.742 G .242(lue. The time of the \214rst data point is sa).25 F
--.15(ve)-.2 G 2.742(df).15 G .242(or each bin)-2.742 F .468
-(in the grid; an)144 266.4 R 2.969(yo)-.15 G .469
-(ther data points which are more than)-2.969 F F2(time)2.969 E F0 .469
-(minutes before or after the initial data)2.969 F .519
-(point in the rele)144 278.4 R -.15(ve)-.25 G .519
-(nt bin are ignored. If).15 F F2(time)3.019 E F0 .519(is ne)3.019 F -.05
-(ga)-.15 G(ti).05 E -.15(ve)-.25 G 3.019(,t).15 G .519
-(he last data in a bin \(within the time lag)-3.019 F
-(criterea\) will be sa)144 290.4 Q -.15(ve)-.2 G 2.5(da).15 G
-(nd used instead of the \214rst data.)-2.5 E F1<ad56>108 307.2 Q(-)-.74
-E F0(Normally)20.49 E(,)-.65 E F1(mbgrid)3.857 E F0 1.357
-(prints out information re)3.857 F -.05(ga)-.15 G 1.357
-(rding its controlling parameters during e).05 F -.15(xe)-.15 G(cution;)
-.15 E(the)144 319.2 Q F1<ad56>2.5 E F0(option causes the program to als\
-o print out statements indicating its progress.)2.5 E F1<ad57>108 336 Q
-F2(scale)20.3 E F0 .179(Sets the width of the g)144 348 R .178
-(aussian weighting function in terms of the grid spacing.)-.05 F .178
-(The distance to the)5.178 F .303
-(1/e point of the weighting function is gi)144 360 R -.15(ve)-.25 G
-2.803(nb).15 G 2.803(yh)-2.803 G .303(alf of the grid spacing times)
--2.803 F F2(scale)2.803 E F0 5.303(.D)C(ef)-5.303 E(ault:)-.1 E F2
-(scale)2.803 E F0 2.5(=1)144 372 S(.0)-2.5 E F1<ad58>108 388.8 Q F2 -.2
-(ex)23.08 G(tend).2 E F0 .646(Extends the size of the internal grid so \
-that the output grid is a subset from the center of a lar)144 400.8 R
-(ger)-.18 E 5.273(grid. This)144 412.8 R(allo)2.773 E .274(ws data outs\
-ide the output grid to guide the spline interpolation of data g)-.25 F
-.274(aps which)-.05 F .498
-(happen to lie at the the edge of the output grid.)144 424.8 R .497
-(The amount of e)5.497 F .497(xtension is)-.15 F F2 -.2(ex)2.997 G(tend)
-.2 E F0 .497(times the grid)2.997 F .881(width/height to each side.)144
-436.8 R .881(Thus, if)5.881 F F2 -.2(ex)3.381 G(tend).2 E F0 .882
-(=1.0, then the internal grid will ha)B 1.182 -.15(ve d)-.2 H .882
-(imensions three).15 F(times the output grid.)144 448.8 Q(Def)5 E(ault:)
--.1 E F2 -.2(ex)2.5 G(tend).2 E F0 2.5(=0)2.5 G(.0)-2.5 E/F3 10.95
-/Times-Bold at 0 SF(EXAMPLES)72 465.6 Q F0 .762(Suppose you w)108 477.6 R
-.761(ant to grid some Hydrosweep data in six data \214les o)-.1 F -.15
-(ve)-.15 G 3.261(rar).15 G -.15(eg)-3.261 G .761
-(ion with longitude bounds of).15 F .822
-(139.9W to 139.65W and latitude bounds of 9.7S to 9.45S.)108 489.6 R
-2.422 -.8(To g)5.822 H .822(et a 110 m grid spacing, you need a grid).8
-F 1.095(dimensions of 251 \(x or longitude\) and 251 \(y or latitude\).\
- First, create a datalist \214le using a te)108 501.6 R 1.094(xt editor)
--.15 F(which contains the data \214lenames follo)108 513.6 Q
-(wed by the appropriate format identi\214er:)-.25 E(d123e.mb24 24)144
-537.6 Q(d126e.mb24 24)144 549.6 Q(d128e.mb24 24)144 561.6 Q
-(d129e.mb24 24)144 573.6 Q(d130e.mb24 24)144 585.6 Q(d131e.mb24 24)144
-597.6 Q(Then, run)108 621.6 Q F1(mbgrid)2.5 E F0(as follo)2.5 E(ws:)-.25
-E(mbgrid \255R220.1/220.35/-9.7/-9.45 \255D251/251 \\)144 633.6 Q
-(-L1 \255C251)180 645.6 Q(\255N \\)5 E
-(-Idatalist \255Ourville_int \255V)180 657.6 Q .421(By specifying a cli\
-pping dimension of 251 we insure that the grid will be \214lled in thro\
-ugh spine interpola-)108 681.6 R(tion e)108 693.6 Q -.15(ve)-.25 G 2.5
-(ni).15 G 2.5(nt)-2.5 G(he areas not co)-2.5 E -.15(ve)-.15 G
-(red by data. The output looks lik).15 E(e:)-.1 E(Program MBGRID)110.5
-717.6 Q -1.11(Ve)110.5 729.6 S
-(rsion $Id: mbgrid.ps 2252 2015-07-01 19:35:37Z caress $)1.11 E
-(MB-System 5.0)72 768 Q(29 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E
-(8)190.545 E 0 Cg EP
-%%Page: 9 9
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(MB-system V)110.5 84 Q(ersion 4.5)-1.11 E
-(MBGRID P)110.5 108 Q(arameters:)-.15 E(List of input \214les: datalist)
-110.5 120 Q(Output \214leroot:)110.5 132 Q(urville_int)12.5 E
-(Input Data T)110.5 144 Q 10(ype: Bath)-.8 F(ymetry)-.05 E
-(Gridding algorithm:)110.5 156 Q(Gaussian W)5 E(eighted Mean)-.8 E
-(Grid dimensions: 251 251)110.5 168 Q(Grid bounds:)110.5 180 Q 2.5
-(Longitude: 220.1000 220.3500)115.5 192 R 7.5(Latitude: \2559.7000)115.5
-204 R(\2559.4500)7.5 E -.8(Wo)110.5 216 S
-(rking grid dimensions: 251 251).8 E -.8(Wo)110.5 228 S
-(rking Grid bounds:).8 E 2.5(Longitude: 220.1000 220.3500)115.5 240 R
-7.5(Latitude: \2559.7000)115.5 252 R(\2559.4500)7.5 E
-(Input data bounds:)110.5 264 Q 2.5(Longitude: 219.8500 220.6000)115.5
-276 R 7.5(Latitude: \2559.9500)115.5 288 R(\2559.2000)7.5 E
-(Longitude interv)110.5 300 Q(al: 0.001000 de)-.25 E
-(grees or 109.778801 m)-.15 E(Latitude interv)110.5 312 Q 2.5
-(al: 0.001000)-.25 F(de)2.5 E(grees or 110.605002 m)-.15 E
-(Gaussian \214lter 1/e length: 0.055096 km)110.5 324 Q
-(Spline interpolation applied with clipping dimension: 251)110.5 336 Q
-(Spline tension \(range 0.0 to 1.0\): 10000000000.000000)110.5 348 Q
-(Grid format 3:)110.5 360 Q(GMT v)5 E(ersion 2 grd \(netCDF\))-.15 E
-(NaN v)110.5 372 Q(alues used to \215ag re)-.25 E(gions with no data)
--.15 E(MBIO parameters:)110.5 384 Q(Ping a)115.5 396 Q -.15(ve)-.2 G 15
-(raging: 1).15 F(Longitude \215ipping:)115.5 408 Q(1)7.5 E
-(Speed minimum:)115.5 420 Q(0.0 km/hr)17.5 E
-(29075 data points processed in d123e.mb8)110.5 444 Q 2.5(0d)110.5 456 S
-(ata points processed in d125e.mb8)-2.5 E
-(98175 data points processed in d126e.mb8)110.5 468 Q
-(68637 data points processed in d128e.mb8)110.5 480 Q
-(20703 data points processed in d129e.mb8)110.5 492 Q
-(80372 data points processed in d130e.mb8)110.5 504 Q
-(55620 data points processed in d131e.mb8)110.5 516 Q
-(352582 total data points processed)110.5 540 Q(Making ra)110.5 564 Q
-2.5(wg)-.15 G(rid...)-2.5 E
-(Doing spline interpolation with 53513 data points...)110.5 588 Q -.8
-(To)110.5 612 S(tal number of bins:).8 E(63001)30 E
-(Bins set using data:)110.5 624 Q(53513)32.5 E
-(Bins set using interpolation:)110.5 636 Q(9488)10 E(Bins not set:)110.5
-648 Q(0)50 E(Maximum number of data in a bin: 65)110.5 660 Q(Minimum v)
-110.5 672 Q 10(alue: 504.93)-.25 F(Maximum v)7.5 E 7.5(alue: 3405.75)
--.25 F(Minimum sigma:)110.5 684 Q 5(0.14060 Maximum)10 F 2.5
-(sigma: 275.53399)2.5 F(Outputting results...)110.5 708 Q(MB-System 5.0)
-72 768 Q(29 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E(9)190.545 E 0 Cg
-EP
-%%Page: 10 10
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F -.15(exe)110.5 84 S(cuting mbm_grdplot...).15 E(\
-mbm_grdplot \255Iurville_int.grd \255G1 \255C \255D \255V \255L"File ur\
-ville_int.grd \255 Bath)110.5 96 Q(ymetry Grid:Depth \(m\)")-.05 E
-(Program Status:)110.5 120 Q(\255-------------)110.5 132 Q(Plot Style:)
-115.5 156 Q(Color Fill)120.5 168 Q(Contours)120.5 180 Q
-(Horizontal Color Scale)120.5 192 Q(Input Files:)115.5 216 Q
-(Data GRD File:)120.5 228 Q(urville_int.grd)30 E
-(Intensity GRD List File:)120.5 240 Q(Output Files:)115.5 264 Q
-(Output plot name root:)120.5 276 Q(urville_int.grd)10 E
-(Color palette table:)120.5 288 Q(urville_int.grd.cpt)15 E
-(Plotting shellscript:)120.5 300 Q(urville_int.grd.cmd)12.5 E
-(Plot \214le:)120.5 312 Q(urville_int.grd.ps)40 E(Plot Attrib)115.5 336
-Q(utes:)-.2 E(Plot width:)120.5 348 Q(6.5000)37.5 E(Plot height:)120.5
-360 Q(6.5489)35 E -.15(Pa)120.5 372 S(ge size:).15 E(a)40 E -.15(Pa)
-120.5 384 S(ge width:).15 E(8.5)37.5 E -.15(Pa)120.5 396 S(ge height:)
-.15 E(11)35 E 25(Projection: \255Jm26)120.5 408 R(Ax)120.5 420 Q
-(es annotation:)-.15 E(5m/5m:."File urville_int.grd \255 Bath)25 E
-(ymetry Grid":)-.05 E 32.5(Orientation: portrait)120.5 432 R
-(Number of colors:)120.5 444 Q(11)22.5 E(Color P)120.5 456 Q 27.5
-(alette: Haxby)-.15 F(Colors)2.5 E(Colors re)120.5 468 Q -.15(ve)-.25 G
-(rsed).15 E(Grid Data Attrib)115.5 492 Q(utes:)-.2 E(Longitude min max:)
-120.5 504 Q 5(220.1000 220.3500)22.5 F(Latitude min max:)120.5 516 Q 7.5
-(\2559.7000 \2559.4500)17.5 F(Data min max:)120.5 528 Q 15(504.9 3406)
-42.5 F(Primary Grid Plotting Controls:)115.5 552 Q(Contour control:)
-120.5 564 Q(100)25 E(Color start datum:)120.5 576 Q(350.000000)20 E
-(Color end datum:)120.5 588 Q(3850.000000)25 E(Color datum interv)120.5
-600 Q 10(al: 350.000000)-.25 F(GMT Def)115.5 624 Q(ault V)-.1 E
-(alues Reset in Script:)-1.11 E -.92(PA)120.5 636 S 35(PER_WIDTH 8.5).92
-F(ANO)120.5 648 Q 40(T_FONT Helv)-.4 F(etica)-.15 E 37.5
-(LABEL_FONT Helv)120.5 660 R(etica)-.15 E 35(HEADER_FONT Helv)120.5 672
-R(etica)-.15 E(ANO)120.5 684 Q 27.5(T_FONT_SIZE 8)-.4 F 25
-(LABEL_FONT_SIZE 8)120.5 696 R 22.5(HEADER_FONT_SIZE 10)120.5 708 R 35
-(FRAME_WIDTH 0.074999999999999997)120.5 720 R(MB-System 5.0)72 768 Q
-(29 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E(10)185.545 E 0 Cg EP
-%%Page: 11 11
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F 35(TICK_LENGTH 0.074999999999999997)120.5 84 R
--1.06 -.92(PA G)120.5 96 T(E_ORIENT).92 E -1.11(AT)-.93 G 22.5
-(ION LANDSCAPE)1.11 F(COLOR_B)120.5 108 Q -.4(AC)-.35 G(KGR).4 E 22.5
-(OUND 0/0/0)-.4 F(COLOR_FOREGR)120.5 120 Q 22.5(OUND 255/255/255)-.4 F
-(COLOR_N)120.5 132 Q 40(AN 255/255/255)-.35 F(\255-------------)110.5
-156 Q(Plot generation shellscript <urville_int.grd.cmd> created.)110.5
-180 Q(Instructions:)110.5 204 Q(Ex)115.5 216 Q(ecute <urville_int.grd.c\
-md> to generate Postscript plot <urville_int.grd.ps>.)-.15 E(Ex)115.5
-228 Q(ecuting <urville_int.grd.cmd> also in)-.15 E -.2(vo)-.4 G -.1(ke)
-.2 G 2.5(sx).1 G(psvie)-2.5 E 2.5(wt)-.25 G 2.5(ov)-2.5 G(ie)-2.5 E 2.5
-(wt)-.25 G(he plot on the screen.)-2.5 E(\255-------------)110.5 252 Q
-(Done.)110.5 288 Q .816(The names of the output \214les are based on th\
-e root character string speci\214ed using the)108 312 R/F1 10
-/Times-Bold at 0 SF<ad4f>3.316 E F0 3.316(option. Since)3.316 F .994(the g\
-rid is output as a netCDF GRD format \214le, its \214lename is "urville\
-_int.grd"; a shellscript which will)108 324 R(allo)108 336 Q 5.957(wt)
--.25 G 3.457(he contents of the grid to vie)-5.957 F 3.456(wed using)
--.25 F F1(GMT)5.956 E F0 3.456
-(programs is also output with the \214lename)5.956 F
-("urville_int.grd.cmd".)108 348 Q .063(Suppose that one w)108 372 R .063
-(ants to grid the same data considered abo)-.1 F .363 -.15(ve u)-.15 H
-.063(sing the median \214ltering scheme instead of).15 F .047(the def)
-108 384 R .047(ault Gaussian weighted mean scheme and also outputting g\
-rids of the data density and standard de)-.1 F(vi-)-.25 E(ation v)108
-396 Q(alues. The follo)-.25 E(wing will suf)-.25 E(\214ce:)-.25 E
-(mbgrid \255R220.1/220.35/-9.7/-9.45 \255D251/251 \\)144 408 Q
-(-L1 \255C251 \255N \\)180 420 Q
-(-Idatalist \255Ourville_int \255F2 \255M \255V)180 432 Q/F2 10.95
-/Times-Bold at 0 SF(SEE ALSO)72 460.8 Q F1(mbsystem)108 472.8 Q F0(\(1\),)A
-F1(mbmosaic)2.5 E F0(\(1\),)A F1(mbm_grid)2.5 E F0(\(1\),)A F1
-(mbm_grd2ar)2.5 E(c)-.18 E F0(\(1\))A F2 -.11(BU)72 501.6 S(GS).11 E F0
-.063(The options for this program ha)108 513.6 R .363 -.15(ve g)-.2 H
-(ro).15 E .063(wn a bit complicated.)-.25 F .063(If you ha)5.063 F .364
--.15(ve o)-.2 H .064(ther problems, please let us kno).15 F -.65(w.)-.25
-G F2(APPENDIX 1: PR)72 542.4 Q(OJECTED COORDIN)-.329 E -1.04(AT)-.219 G
-2.738(ES)1.04 G(YSTEM IDENTIFIERS)-2.738 E F0 .542(The follo)108 554.4 R
-.542(wing is a list of the projected coordinate systems \(PCS')-.25 F
-.542(s\) that are supported by MB-System. The)-.55 F 2.27(full PCS de\
-\214nitions are found in the \214le mbsystem/share/Projections.dat. The\
-se de\214nitions are in the)108 566.4 R F1(PR)108 578.4 Q(OJ)-.3 E(.4)
--.2 E F0 .735(format and deri)3.235 F 1.034 -.15(ve f)-.25 H .734
-(rom the).15 F F1(PR)3.234 E(OJ)-.3 E(.4)-.2 E F0 .734(4.6.1 distrib)
-3.234 F .734(ution obtained from http://trac.osgeo.or)-.2 F .734
-(g/proj/ in)-.18 F .288(September 2008. The proj library source code ha\
-s been incorporated unchanged into the MB-System pack-)108 590.4 R(age.)
-108 602.4 Q .692
-(The \214rst item on each line is the PCS identi\214er inside brack)108
-626.4 R .691(ets, such as <UTM10N> or <epsg32749>. T)-.1 F(o)-.8 E
-(specify using one of these PCS')108 638.4 Q(s, use the)-.55 E F1<ad4a>
-2.5 E F0(option, e.g.)2.5 E F1<ad4a>2.5 E/F3 10/Times-Italic at 0 SF
-(UTM10N)A F0(or)2.5 E F1<ad4a>2.5 E F3(epsg32749)A F0(.)A
-(\255--------------------------------------------------------)110.5
-662.4 Q(Standard Uni)110.5 674.4 Q -.15(ve)-.25 G(rsal T).15 E(ransv)
--.35 E(erse Mercator \(UTM\))-.15 E(and Uni)120.5 686.4 Q -.15(ve)-.25 G
-(rsal Polar Stereographic \(UPS\)).15 E
-(projected coordinate systems for MB-System)120.5 698.4 Q
-(\255--------------------------------------------------------)110.5
-710.4 Q(MB-System 5.0)72 768 Q(29 No)132.205 E -.15(ve)-.15 G(mber 2014)
-.15 E(11)185.545 E 0 Cg EP
-%%Page: 12 12
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<UTM01N> : WGS 84 / UTM zone 1N)110.5 84 Q
-(<UTM02N> : WGS 84 / UTM zone 2N)110.5 96 Q
-(<UTM03N> : WGS 84 / UTM zone 3N)110.5 108 Q
-(<UTM04N> : WGS 84 / UTM zone 4N)110.5 120 Q
-(<UTM05N> : WGS 84 / UTM zone 5N)110.5 132 Q
-(<UTM06N> : WGS 84 / UTM zone 6N)110.5 144 Q
-(<UTM07N> : WGS 84 / UTM zone 7N)110.5 156 Q
-(<UTM08N> : WGS 84 / UTM zone 8N)110.5 168 Q
-(<UTM09N> : WGS 84 / UTM zone 9N)110.5 180 Q
-(<UTM10N> : WGS 84 / UTM zone 10N)110.5 192 Q
-(<UTM11N> : WGS 84 / UTM zone 11N)110.5 204 Q
-(<UTM12N> : WGS 84 / UTM zone 12N)110.5 216 Q
-(<UTM13N> : WGS 84 / UTM zone 13N)110.5 228 Q
-(<UTM14N> : WGS 84 / UTM zone 14N)110.5 240 Q
-(<UTM15N> : WGS 84 / UTM zone 15N)110.5 252 Q
-(<UTM16N> : WGS 84 / UTM zone 16N)110.5 264 Q
-(<UTM17N> : WGS 84 / UTM zone 17N)110.5 276 Q
-(<UTM18N> : WGS 84 / UTM zone 18N)110.5 288 Q
-(<UTM19N> : WGS 84 / UTM zone 19N)110.5 300 Q
-(<UTM20N> : WGS 84 / UTM zone 20N)110.5 312 Q
-(<UTM21N> : WGS 84 / UTM zone 21N)110.5 324 Q
-(<UTM22N> : WGS 84 / UTM zone 22N)110.5 336 Q
-(<UTM23N> : WGS 84 / UTM zone 23N)110.5 348 Q
-(<UTM24N> : WGS 84 / UTM zone 24N)110.5 360 Q
-(<UTM25N> : WGS 84 / UTM zone 25N)110.5 372 Q
-(<UTM26N> : WGS 84 / UTM zone 26N)110.5 384 Q
-(<UTM27N> : WGS 84 / UTM zone 27N)110.5 396 Q
-(<UTM28N> : WGS 84 / UTM zone 28N)110.5 408 Q
-(<UTM29N> : WGS 84 / UTM zone 29N)110.5 420 Q
-(<UTM30N> : WGS 84 / UTM zone 30N)110.5 432 Q
-(<UTM31N> : WGS 84 / UTM zone 31N)110.5 444 Q
-(<UTM32N> : WGS 84 / UTM zone 32N)110.5 456 Q
-(<UTM33N> : WGS 84 / UTM zone 33N)110.5 468 Q
-(<UTM34N> : WGS 84 / UTM zone 34N)110.5 480 Q
-(<UTM35N> : WGS 84 / UTM zone 35N)110.5 492 Q
-(<UTM36N> : WGS 84 / UTM zone 36N)110.5 504 Q
-(<UTM37N> : WGS 84 / UTM zone 37N)110.5 516 Q
-(<UTM38N> : WGS 84 / UTM zone 38N)110.5 528 Q
-(<UTM39N> : WGS 84 / UTM zone 39N)110.5 540 Q
-(<UTM40N> : WGS 84 / UTM zone 40N)110.5 552 Q
-(<UTM41N> : WGS 84 / UTM zone 41N)110.5 564 Q
-(<UTM42N> : WGS 84 / UTM zone 42N)110.5 576 Q
-(<UTM43N> : WGS 84 / UTM zone 43N)110.5 588 Q
-(<UTM44N> : WGS 84 / UTM zone 44N)110.5 600 Q
-(<UTM45N> : WGS 84 / UTM zone 45N)110.5 612 Q
-(<UTM46N> : WGS 84 / UTM zone 46N)110.5 624 Q
-(<UTM47N> : WGS 84 / UTM zone 47N)110.5 636 Q
-(<UTM48N> : WGS 84 / UTM zone 48N)110.5 648 Q
-(<UTM49N> : WGS 84 / UTM zone 49N)110.5 660 Q
-(<UTM50N> : WGS 84 / UTM zone 50N)110.5 672 Q
-(<UTM51N> : WGS 84 / UTM zone 51N)110.5 684 Q
-(<UTM52N> : WGS 84 / UTM zone 52N)110.5 696 Q
-(<UTM53N> : WGS 84 / UTM zone 53N)110.5 708 Q
-(<UTM54N> : WGS 84 / UTM zone 54N)110.5 720 Q(MB-System 5.0)72 768 Q
-(29 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E(12)185.545 E 0 Cg EP
-%%Page: 13 13
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<UTM55N> : WGS 84 / UTM zone 55N)110.5 84 Q
-(<UTM56N> : WGS 84 / UTM zone 56N)110.5 96 Q
-(<UTM57N> : WGS 84 / UTM zone 57N)110.5 108 Q
-(<UTM58N> : WGS 84 / UTM zone 58N)110.5 120 Q
-(<UTM59N> : WGS 84 / UTM zone 59N)110.5 132 Q
-(<UTM60N> : WGS 84 / UTM zone 60N)110.5 144 Q
-(<UTM01S> : WGS 84 / UTM zone 1S)110.5 156 Q
-(<UTM02S> : WGS 84 / UTM zone 2S)110.5 168 Q
-(<UTM03S> : WGS 84 / UTM zone 3S)110.5 180 Q
-(<UTM04S> : WGS 84 / UTM zone 4S)110.5 192 Q
-(<UTM05S> : WGS 84 / UTM zone 5S)110.5 204 Q
-(<UTM06S> : WGS 84 / UTM zone 6S)110.5 216 Q
-(<UTM07S> : WGS 84 / UTM zone 7S)110.5 228 Q
-(<UTM08S> : WGS 84 / UTM zone 8S)110.5 240 Q
-(<UTM09S> : WGS 84 / UTM zone 9S)110.5 252 Q
-(<UTM10S> : WGS 84 / UTM zone 10S)110.5 264 Q
-(<UTM11S> : WGS 84 / UTM zone 11S)110.5 276 Q
-(<UTM12S> : WGS 84 / UTM zone 12S)110.5 288 Q
-(<UTM13S> : WGS 84 / UTM zone 13S)110.5 300 Q
-(<UTM14S> : WGS 84 / UTM zone 14S)110.5 312 Q
-(<UTM15S> : WGS 84 / UTM zone 15S)110.5 324 Q
-(<UTM16S> : WGS 84 / UTM zone 16S)110.5 336 Q
-(<UTM17S> : WGS 84 / UTM zone 17S)110.5 348 Q
-(<UTM18S> : WGS 84 / UTM zone 18S)110.5 360 Q
-(<UTM19S> : WGS 84 / UTM zone 19S)110.5 372 Q
-(<UTM20S> : WGS 84 / UTM zone 20S)110.5 384 Q
-(<UTM21S> : WGS 84 / UTM zone 21S)110.5 396 Q
-(<UTM22S> : WGS 84 / UTM zone 22S)110.5 408 Q
-(<UTM23S> : WGS 84 / UTM zone 23S)110.5 420 Q
-(<UTM24S> : WGS 84 / UTM zone 24S)110.5 432 Q
-(<UTM25S> : WGS 84 / UTM zone 25S)110.5 444 Q
-(<UTM26S> : WGS 84 / UTM zone 26S)110.5 456 Q
-(<UTM27S> : WGS 84 / UTM zone 27S)110.5 468 Q
-(<UTM28S> : WGS 84 / UTM zone 28S)110.5 480 Q
-(<UTM29S> : WGS 84 / UTM zone 29S)110.5 492 Q
-(<UTM30S> : WGS 84 / UTM zone 30S)110.5 504 Q
-(<UTM31S> : WGS 84 / UTM zone 31S)110.5 516 Q
-(<UTM32S> : WGS 84 / UTM zone 32S)110.5 528 Q
-(<UTM33S> : WGS 84 / UTM zone 33S)110.5 540 Q
-(<UTM34S> : WGS 84 / UTM zone 34S)110.5 552 Q
-(<UTM35S> : WGS 84 / UTM zone 35S)110.5 564 Q
-(<UTM36S> : WGS 84 / UTM zone 36S)110.5 576 Q
-(<UTM37S> : WGS 84 / UTM zone 37S)110.5 588 Q
-(<UTM38S> : WGS 84 / UTM zone 38S)110.5 600 Q
-(<UTM39S> : WGS 84 / UTM zone 39S)110.5 612 Q
-(<UTM40S> : WGS 84 / UTM zone 40S)110.5 624 Q
-(<UTM41S> : WGS 84 / UTM zone 41S)110.5 636 Q
-(<UTM42S> : WGS 84 / UTM zone 42S)110.5 648 Q
-(<UTM43S> : WGS 84 / UTM zone 43S)110.5 660 Q
-(<UTM44S> : WGS 84 / UTM zone 44S)110.5 672 Q
-(<UTM45S> : WGS 84 / UTM zone 45S)110.5 684 Q
-(<UTM46S> : WGS 84 / UTM zone 46S)110.5 696 Q
-(<UTM47S> : WGS 84 / UTM zone 47S)110.5 708 Q
-(<UTM48S> : WGS 84 / UTM zone 48S)110.5 720 Q(MB-System 5.0)72 768 Q
-(29 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E(13)185.545 E 0 Cg EP
-%%Page: 14 14
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<UTM49S> : WGS 84 / UTM zone 49S)110.5 84 Q
-(<UTM50S> : WGS 84 / UTM zone 50S)110.5 96 Q
-(<UTM51S> : WGS 84 / UTM zone 51S)110.5 108 Q
-(<UTM52S> : WGS 84 / UTM zone 52S)110.5 120 Q
-(<UTM53S> : WGS 84 / UTM zone 53S)110.5 132 Q
-(<UTM54S> : WGS 84 / UTM zone 54S)110.5 144 Q
-(<UTM55S> : WGS 84 / UTM zone 55S)110.5 156 Q
-(<UTM56S> : WGS 84 / UTM zone 56S)110.5 168 Q
-(<UTM57S> : WGS 84 / UTM zone 57S)110.5 180 Q
-(<UTM58S> : WGS 84 / UTM zone 58S)110.5 192 Q
-(<UTM59S> : WGS 84 / UTM zone 59S)110.5 204 Q
-(<UTM60S> : WGS 84 / UTM zone 60S)110.5 216 Q
-(<UPSN> : WGS 84 / UPS North)110.5 228 Q(<UPSS> : WGS 84 / UPS South)
-110.5 240 Q
-(\255--------------------------------------------------------)110.5 264
-Q(Listing of State Plane North American Datum Zones)110.5 276 Q
-(\255--------------------------------------------------------)110.5 288
-Q(MB-System projection ids are the zone number)115.5 300 Q(pre\214x)
-115.5 312 Q(ed by either "nad27sp" or "nad83sp")-.15 E
-(\255---------------------------------------------)110.5 324 Q
-(NGS zone number)188 336 Q(State and zone)110.5 348 Q 10(1927 1983)45 F
-(\255---------------------------------------------)110.5 360 Q
-(Alabama east ..................)110.5 372 Q 12.5(101 101)5 F
-(Alabama west ..................)110.5 384 Q 12.5(102 102)5 F
-(Alaska zone no. 1 ............. 5001)110.5 396 Q(5001)12.5 E
-(Alaska zone no. 2 ............. 5002)110.5 408 Q(5002)12.5 E
-(Alaska zone no. 3 ............. 5003)110.5 420 Q(5003)12.5 E
-(Alaska zone no. 4 ............. 5004)110.5 432 Q(5004)12.5 E
-(Alaska zone no. 5 ............. 5005)110.5 444 Q(5005)12.5 E
-(Alaska zone no. 6 ............. 5006)110.5 456 Q(5006)12.5 E
-(Alaska zone no. 7 ............. 5007)110.5 468 Q(5007)12.5 E
-(Alaska zone no. 8 ............. 5008)110.5 480 Q(5008)12.5 E
-(Alaska zone no. 9 ............. 5009)110.5 492 Q(5009)12.5 E
-(Alaska zone no. 10 ............ 5010)110.5 504 Q(5010)12.5 E
-(American Samoa ................ 5300)110.5 516 Q
-(Arizona central ...............)110.5 528 Q 12.5(202 202)5 F
-(Arizona east ..................)110.5 540 Q 12.5(201 201)5 F
-(Arizona west ..................)110.5 552 Q 12.5(203 203)5 F
-(Arkansas north ................)110.5 564 Q 12.5(301 301)5 F
-(Arkansas south ................)110.5 576 Q 12.5(302 302)5 F
-(California I ..................)110.5 588 Q 12.5(401 401)5 F
-(California II .................)110.5 600 Q 12.5(402 402)5 F
-(California III ................)110.5 612 Q 12.5(403 403)5 F
-(California IV .................)110.5 624 Q 12.5(404 404)5 F
-(California V ..................)110.5 636 Q 12.5(405 405)5 F
-(California VI .................)110.5 648 Q 12.5(406 406)5 F
-(California VII ................)110.5 660 Q(407)5 E
-(Colorado central ..............)110.5 672 Q 12.5(502 502)5 F
-(Colorado north ................)110.5 684 Q 12.5(501 501)5 F
-(Colorado south ................)110.5 696 Q 12.5(503 503)5 F
-(Connecticut ...................)110.5 708 Q 12.5(600 600)5 F(Dela)110.5
-720 Q -.1(wa)-.15 G(re ......................).1 E 12.5(700 700)5 F
-(MB-System 5.0)72 768 Q(29 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E
-(14)185.545 E 0 Cg EP
-%%Page: 15 15
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(Florida east ..................)110.5 84 Q 12.5
-(901 901)5 F(Florida north .................)110.5 96 Q 12.5(903 903)5 F
-(Florida west ..................)110.5 108 Q 12.5(902 902)5 F(Geor)110.5
-120 Q(gia east .................. 1001)-.18 E(1001)12.5 E(Geor)110.5 132
-Q(gia west .................. 1002)-.18 E(1002)12.5 E
-(Guam Island ................... 5400)110.5 144 Q(Ha)110.5 156 Q -.1(wa)
--.15 G(ii 1 ...................... 5101).1 E(5101)12.5 E(Ha)110.5 168 Q
--.1(wa)-.15 G(ii 2 ...................... 5102).1 E(5102)12.5 E(Ha)110.5
-180 Q -.1(wa)-.15 G(ii 3 ...................... 5103).1 E(5103)12.5 E
-(Ha)110.5 192 Q -.1(wa)-.15 G(ii 4 ...................... 5104).1 E
-(5104)12.5 E(Ha)110.5 204 Q -.1(wa)-.15 G
-(ii 5 ...................... 5105).1 E(5105)12.5 E
-(Idaho central ................. 1102)110.5 216 Q(1102)12.5 E
-(Idaho east .................... 1101)110.5 228 Q(1101)12.5 E
-(Idaho west .................... 1103)110.5 240 Q(1103)12.5 E
-(Illinois east ................. 1201)110.5 252 Q(1201)12.5 E
-(Illinois west ................. 1202)110.5 264 Q(1202)12.5 E
-(Indiana east .................. 1301)110.5 276 Q(1301)12.5 E
-(Indiana west .................. 1302)110.5 288 Q(1302)12.5 E(Io)110.5
-300 Q .2 -.1(wa n)-.25 H(orth .................... 1401).1 E(1401)12.5 E
-(Io)110.5 312 Q .2 -.1(wa s)-.25 H(outh .................... 1402).1 E
-(1402)12.5 E(Kansas north .................. 1501)110.5 324 Q(1501)12.5
-E(Kansas south .................. 1502)110.5 336 Q(1502)12.5 E -.25(Ke)
-110.5 348 S(ntuck).25 E 2.5(yn)-.15 G(orth ................ 1601)-2.5 E
-(1601)12.5 E -.25(Ke)110.5 360 S(ntuck).25 E 2.5(ys)-.15 G
-(outh ................ 1602)-2.5 E(1602)12.5 E
-(Louisiana north ............... 1701)110.5 372 Q(1701)12.5 E
-(Louisiana of)110.5 384 Q(fshore ............ 1703)-.25 E(1703)12.5 E
-(Louisiana south ............... 1702)110.5 396 Q(1702)12.5 E
-(Maine east .................... 1801)110.5 408 Q(1801)12.5 E
-(Maine west .................... 1802)110.5 420 Q(1802)12.5 E
-(Maryland ...................... 1900)110.5 432 Q(1900)12.5 E
-(Massachusetts island .......... 2002)110.5 444 Q(2002)12.5 E
-(Massachusetts mainland ........ 2001)110.5 456 Q(2001)12.5 E(Michig)
-110.5 468 Q(an central/l ............ 2112)-.05 E(2112 current)12.5 E
-(Michig)110.5 480 Q(an central/m ............ 2102)-.05 E(old)25 E
-(Michig)110.5 492 Q(an east ................. 2101)-.05 E(old)25 E
-(Michig)110.5 504 Q(an north ................ 2111)-.05 E(2111 current)
-12.5 E(Michig)110.5 516 Q(an south ................ 2113)-.05 E
-(2113 current)12.5 E(Michig)110.5 528 Q(an west ................. 2103)
--.05 E(old)25 E(Minnesota central ............. 2202)110.5 540 Q(2202)
-12.5 E(Minnesota north ............... 2201)110.5 552 Q(2201)12.5 E
-(Minnesota south ............... 2203)110.5 564 Q(2203)12.5 E
-(Mississippi east .............. 2301)110.5 576 Q(2301)12.5 E
-(Mississippi west .............. 2302)110.5 588 Q(2302)12.5 E
-(Missouri central .............. 2402)110.5 600 Q(2402)12.5 E
-(Missouri east ................. 2401)110.5 612 Q(2401)12.5 E
-(Missouri west ................. 2403)110.5 624 Q(2403)12.5 E
-(Montana .......................)110.5 636 Q(2500)25 E
-(Montana central ............... 2502)110.5 648 Q
-(Montana north ................. 2501)110.5 660 Q
-(Montana south ................. 2503)110.5 672 Q
-(Nebraska ......................)110.5 684 Q(2600)25 E
-(Nebraska north ................ 2601)110.5 696 Q
-(Nebraska south ................ 2602)110.5 708 Q(Ne)110.5 720 Q -.25
-(va)-.25 G(da central ................ 2702).25 E(2702)12.5 E
-(MB-System 5.0)72 768 Q(29 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E
-(15)185.545 E 0 Cg EP
-%%Page: 16 16
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(Ne)110.5 84 Q -.25(va)-.25 G
-(da east ................... 2701).25 E(2701)12.5 E(Ne)110.5 96 Q -.25
-(va)-.25 G(da west ................... 2703).25 E(2703)12.5 E(Ne)110.5
-108 Q 2.5(wh)-.25 G(ampshire ................. 2800)-2.5 E(2800)12.5 E
-(Ne)110.5 120 Q 2.5(wj)-.25 G(erse)-2.5 E 2.5(y.)-.15 G
-(................... 2900)-2.5 E(2900)12.5 E(Ne)110.5 132 Q 2.5(wm)-.25
-G -.15(ex)-2.5 G(ico central ............ 3002).15 E(3002)12.5 E(Ne)
-110.5 144 Q 2.5(wm)-.25 G -.15(ex)-2.5 G(ico east ............... 3001)
-.15 E(3001)12.5 E(Ne)110.5 156 Q 2.5(wm)-.25 G -.15(ex)-2.5 G
-(ico west ............... 3003).15 E(3003)12.5 E(Ne)110.5 168 Q 2.5(wy)
--.25 G(ork central .............. 3102)-2.5 E(3102)12.5 E(Ne)110.5 180 Q
-2.5(wy)-.25 G(ork east ................. 3101)-2.5 E(3101)12.5 E(Ne)
-110.5 192 Q 2.5(wy)-.25 G(ork long island .......... 3104)-2.5 E(3104)
-12.5 E(Ne)110.5 204 Q 2.5(wy)-.25 G(ork west ................. 3103)-2.5
-E(3103)12.5 E(North carolina ................ 3200)110.5 216 Q(3200)12.5
-E(North dak)110.5 228 Q(ota north ............ 3301)-.1 E(3301)12.5 E
-(North dak)110.5 240 Q(ota south ............ 3302)-.1 E(3302)12.5 E
-(Ohio north .................... 3401)110.5 252 Q(3401)12.5 E
-(Ohio south .................... 3402)110.5 264 Q(3402)12.5 E
-(Oklahoma north ................ 3501)110.5 276 Q(3501)12.5 E
-(Oklahoma south ................ 3502)110.5 288 Q(3502)12.5 E(Ore)110.5
-300 Q(gon north .................. 3601)-.15 E(3601)12.5 E(Ore)110.5 312
-Q(gon south .................. 3602)-.15 E(3602)12.5 E(Pennsylv)110.5
-324 Q(ania north ............ 3701)-.25 E(3701)12.5 E(Pennsylv)110.5 336
-Q(ania south ............ 3702)-.25 E(3702)12.5 E(Puerto Rico, V)110.5
-348 Q(ir)-.6 E(gin Islands ... 5201)-.18 E(5200)12.5 E
-(Rhode Island .................. 3800)110.5 360 Q(3800)12.5 E
-(South Carolina ................)110.5 372 Q(3900)25 E
-(South Carolina north .......... 3901)110.5 384 Q
-(South Carolina south .......... 3902)110.5 396 Q(South Dak)110.5 408 Q
-(ota north ............ 4001)-.1 E(4001)12.5 E(South Dak)110.5 420 Q
-(ota south ............ 4002)-.1 E(4002)12.5 E -.7(Te)110.5 432 S
-(nnessee ..................... 4100).7 E(4100)12.5 E -1.25 -.7(Te x)
-110.5 444 T(as central ................. 4203).7 E(4203)12.5 E -1.25 -.7
-(Te x)110.5 456 T(as north ................... 4201).7 E(4201)12.5 E
--1.25 -.7(Te x)110.5 468 T(as north central ........... 4202).7 E(4202)
-12.5 E -1.25 -.7(Te x)110.5 480 T(as south ................... 4205).7 E
-(4205)12.5 E -1.25 -.7(Te x)110.5 492 T
-(as south central ........... 4204).7 E(4204)12.5 E
-(Utah central .................. 4302)110.5 504 Q(4302)12.5 E
-(Utah north .................... 4301)110.5 516 Q(4301)12.5 E
-(Utah south .................... 4303)110.5 528 Q(4303)12.5 E -1.11(Ve)
-110.5 540 S(rmont ....................... 4400)1.11 E(4400)12.5 E -.6
-(Vi)110.5 552 S -.18(rg).6 G(in Islands, St. Croix ..... 5202).18 E -.6
-(Vi)110.5 564 S -.18(rg).6 G(inia north ................ 4501).18 E
-(4501)12.5 E -.6(Vi)110.5 576 S -.18(rg).6 G
-(inia south ................ 4502).18 E(4502)12.5 E -.8(Wa)110.5 588 S
-(shington north .............. 4601).8 E(4601)12.5 E -.8(Wa)110.5 600 S
-(shington south .............. 4602).8 E(4602)12.5 E -.8(We)110.5 612 S
-(st V).8 E(ir)-.6 E(ginia north ........... 4701)-.18 E(4701)12.5 E -.8
-(We)110.5 624 S(st V).8 E(ir)-.6 E(ginia south ........... 4702)-.18 E
-(4702)12.5 E -.4(Wi)110.5 636 S(sconsin central ............. 4802).4 E
-(4802)12.5 E -.4(Wi)110.5 648 S(sconsin north ............... 4801).4 E
-(4801)12.5 E -.4(Wi)110.5 660 S(sconsin south ............... 4803).4 E
-(4803)12.5 E -.73(Wy)110.5 672 S(oming east .................. 4901).73
-E(4901)12.5 E -.73(Wy)110.5 684 S(oming east central .......... 4902).73
-E(4902)12.5 E -.73(Wy)110.5 696 S(oming west .................. 4904).73
-E(4904)12.5 E -.73(Wy)110.5 708 S(oming west central .......... 4903).73
-E(4903)12.5 E(\255---------------------------------------------)110.5
-720 Q(MB-System 5.0)72 768 Q(29 No)132.205 E -.15(ve)-.15 G(mber 2014)
-.15 E(16)185.545 E 0 Cg EP
-%%Page: 17 17
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F
-(\255--------------------------------------------------------)110.5 84 Q
-(State Plane Coordinate Systems)110.5 96 Q(North American Datum 1927)
-110.5 108 Q
-(\255--------------------------------------------------------)110.5 120
-Q(<nad27sp101> : alabama east> : nad27sp)110.5 132 Q
-(<nad27sp102> : alabama west> : nad27sp)110.5 144 Q
-(<nad27sp5010> : alaska zone no. 10> : nad27sp)110.5 156 Q
-(<nad27sp5300> : american samoa> : nad27sp)110.5 168 Q
-(<nad27sp201> : arizona east> : nad27sp)110.5 180 Q
-(<nad27sp202> : arizona central> : nad27sp)110.5 192 Q
-(<nad27sp203> : arizona west> : nad27sp)110.5 204 Q
-(<nad27sp301> : arkansas north> : nad27sp)110.5 216 Q
-(<nad27sp302> : arkansas south> : nad27sp)110.5 228 Q
-(<nad27sp401> : california i> : nad27sp)110.5 240 Q
-(<nad27sp402> : california ii> : nad27sp)110.5 252 Q
-(<nad27sp403> : california iii> : nad27sp)110.5 264 Q
-(<nad27sp404> : california i)110.5 276 Q(v> : nad27sp)-.25 E
-(<nad27sp405> : california v> : nad27sp)110.5 288 Q
-(<nad27sp406> : california vi> : nad27sp)110.5 300 Q
-(<nad27sp407> : california vii> : nad27sp)110.5 312 Q
-(<nad27sp501> : colorado north> : nad27sp)110.5 324 Q
-(<nad27sp502> : colorado central> : nad27sp)110.5 336 Q
-(<nad27sp503> : colorado south> : nad27sp)110.5 348 Q
-(<nad27sp600> : connecticut \255--> : nad27sp)110.5 360 Q
-(<nad27sp700> : dela)110.5 372 Q -.1(wa)-.15 G(re \255--> : nad27sp).1 E
-(<nad27sp901> : \215orida east> : nad27sp)110.5 384 Q
-(<nad27sp902> : \215orida west> : nad27sp)110.5 396 Q
-(<nad27sp903> : \215orida north> : nad27sp)110.5 408 Q
-(<nad27sp1001> : geor)110.5 420 Q(gia east> : nad27sp)-.18 E
-(<nad27sp1002> : geor)110.5 432 Q(gia west> : nad27sp)-.18 E
-(<nad27sp5101> : ha)110.5 444 Q -.1(wa)-.15 G(ii 1> : nad27sp).1 E
-(<nad27sp5102> : ha)110.5 456 Q -.1(wa)-.15 G(ii 2> : nad27sp).1 E
-(<nad27sp5103> : ha)110.5 468 Q -.1(wa)-.15 G(ii 3> : nad27sp).1 E
-(<nad27sp5104> : ha)110.5 480 Q -.1(wa)-.15 G(ii 4> : nad27sp).1 E
-(<nad27sp5105> : ha)110.5 492 Q -.1(wa)-.15 G(ii 5> : nad27sp).1 E
-(<nad27sp1101> : idaho east> : nad27sp)110.5 504 Q
-(<nad27sp1102> : idaho central> : nad27sp)110.5 516 Q
-(<nad27sp1103> : idaho west> : nad27sp)110.5 528 Q
-(<nad27sp1201> : illinois east> : nad27sp)110.5 540 Q
-(<nad27sp1202> : illinois west> : nad27sp)110.5 552 Q
-(<nad27sp1301> : indiana east> : nad27sp)110.5 564 Q
-(<nad27sp1302> : indiana west> : nad27sp)110.5 576 Q(<nad27sp1401> : io)
-110.5 588 Q .2 -.1(wa n)-.25 H(orth> : nad27sp).1 E(<nad27sp1402> : io)
-110.5 600 Q .2 -.1(wa s)-.25 H(outh> : nad27sp).1 E
-(<nad27sp1501> : kansas north> : nad27sp)110.5 612 Q
-(<nad27sp1502> : kansas south> : nad27sp)110.5 624 Q(<nad27sp1601> : k)
-110.5 636 Q(entuck)-.1 E 2.5(yn)-.15 G(orth> : nad27sp)-2.5 E
-(<nad27sp1602> : k)110.5 648 Q(entuck)-.1 E 2.5(ys)-.15 G
-(outh> : nad27sp)-2.5 E(<nad27sp1701> : louisiana north> : nad27sp)110.5
-660 Q(<nad27sp1702> : louisiana south> : nad27sp)110.5 672 Q
-(<nad27sp1703> : louisiana of)110.5 684 Q(fshore> : nad27sp)-.25 E
-(<nad27sp1801> : maine east> : nad27sp)110.5 696 Q
-(<nad27sp1802> : maine west> : nad27sp)110.5 708 Q
-(<nad27sp1900> : maryland \255--> : nad27sp)110.5 720 Q(MB-System 5.0)72
-768 Q(29 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E(17)185.545 E 0 Cg
-EP
-%%Page: 18 18
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F
-(<nad27sp2001> : massachusetts mainland> : nad27sp)110.5 84 Q
-(<nad27sp2002> : massachusetts island> : nad27sp)110.5 96 Q
-(<nad27sp2101> : michig)110.5 108 Q(an east> : nad27sp)-.05 E
-(<nad27sp2102> : michig)110.5 120 Q(an central/m> : nad27sp)-.05 E
-(<nad27sp2103> : michig)110.5 132 Q(an west> : nad27sp)-.05 E
-(<nad27sp2111> : michig)110.5 144 Q(an north> : nad27sp)-.05 E
-(<nad27sp2112> : michig)110.5 156 Q(an central/l> : nad27sp)-.05 E
-(<nad27sp2113> : michig)110.5 168 Q(an south> : nad27sp)-.05 E
-(<nad27sp2201> : minnesota north> : nad27sp)110.5 180 Q
-(<nad27sp2202> : minnesota central> : nad27sp)110.5 192 Q
-(<nad27sp2203> : minnesota south> : nad27sp)110.5 204 Q
-(<nad27sp2301> : mississippi east> : nad27sp)110.5 216 Q
-(<nad27sp2302> : mississippi west> : nad27sp)110.5 228 Q
-(<nad27sp2401> : missouri east> : nad27sp)110.5 240 Q
-(<nad27sp2402> : missouri central> : nad27sp)110.5 252 Q
-(<nad27sp2403> : missouri west> : nad27sp)110.5 264 Q
-(<nad27sp2501> : montana north> : nad27sp)110.5 276 Q
-(<nad27sp2502> : montana central> : nad27sp)110.5 288 Q
-(<nad27sp2503> : montana south> : nad27sp)110.5 300 Q
-(<nad27sp2601> : nebraska north> : nad27sp)110.5 312 Q
-(<nad27sp2602> : nebraska south> : nad27sp)110.5 324 Q
-(<nad27sp2701> : ne)110.5 336 Q -.25(va)-.25 G(da east> : nad27sp).25 E
-(<nad27sp2702> : ne)110.5 348 Q -.25(va)-.25 G(da central> : nad27sp).25
-E(<nad27sp2703> : ne)110.5 360 Q -.25(va)-.25 G(da west> : nad27sp).25 E
-(<nad27sp2800> : ne)110.5 372 Q 2.5(wh)-.25 G
-(ampshire \255--> : nad27sp)-2.5 E(<nad27sp2900> : ne)110.5 384 Q 2.5
-(wj)-.25 G(erse)-2.5 E 2.5<79ad>-.15 G(--> : nad27sp)-2.5 E
-(<nad27sp3001> : ne)110.5 396 Q 2.5(wm)-.25 G -.15(ex)-2.5 G
-(ico east> : nad27sp).15 E(<nad27sp3002> : ne)110.5 408 Q 2.5(wm)-.25 G
--.15(ex)-2.5 G(ico central> : nad27sp).15 E(<nad27sp3003> : ne)110.5 420
-Q 2.5(wm)-.25 G -.15(ex)-2.5 G(ico west> : nad27sp).15 E
-(<nad27sp3101> : ne)110.5 432 Q 2.5(wy)-.25 G(ork east> : nad27sp)-2.5 E
-(<nad27sp3102> : ne)110.5 444 Q 2.5(wy)-.25 G(ork central> : nad27sp)
--2.5 E(<nad27sp3103> : ne)110.5 456 Q 2.5(wy)-.25 G(ork west> : nad27sp)
--2.5 E(<nad27sp3104> : ne)110.5 468 Q 2.5(wy)-.25 G
-(ork long island> : nad27sp)-2.5 E
-(<nad27sp3200> : north carolina \255--> : nad27sp)110.5 480 Q
-(<nad27sp3301> : north dak)110.5 492 Q(ota north> : nad27sp)-.1 E
-(<nad27sp3302> : north dak)110.5 504 Q(ota south> : nad27sp)-.1 E
-(<nad27sp3401> : ohio north> : nad27sp)110.5 516 Q
-(<nad27sp3402> : ohio south> : nad27sp)110.5 528 Q
-(<nad27sp3501> : oklahoma north> : nad27sp)110.5 540 Q
-(<nad27sp3502> : oklahoma south> : nad27sp)110.5 552 Q
-(<nad27sp3601> : ore)110.5 564 Q(gon north> : nad27sp)-.15 E
-(<nad27sp3602> : ore)110.5 576 Q(gon south> : nad27sp)-.15 E
-(<nad27sp3701> : pennsylv)110.5 588 Q(ania north> : nad27sp)-.25 E
-(<nad27sp3702> : pennsylv)110.5 600 Q(ania south> : nad27sp)-.25 E
-(<nad27sp3800> : rhode island \255--> : nad27sp)110.5 612 Q
-(<nad27sp3901> : south carolina north> : nad27sp)110.5 624 Q
-(<nad27sp3902> : south carolina south> : nad27sp)110.5 636 Q
-(<nad27sp4001> : south dak)110.5 648 Q(ota north> : nad27sp)-.1 E
-(<nad27sp4002> : south dak)110.5 660 Q(ota south> : nad27sp)-.1 E
-(<nad27sp4100> : tennessee \255--> : nad27sp)110.5 672 Q
-(<nad27sp4201> : te)110.5 684 Q(xas north> : nad27sp)-.15 E
-(<nad27sp4202> : te)110.5 696 Q(xas north central> : nad27sp)-.15 E
-(<nad27sp4203> : te)110.5 708 Q(xas central> : nad27sp)-.15 E
-(<nad27sp4204> : te)110.5 720 Q(xas south central> : nad27sp)-.15 E
-(MB-System 5.0)72 768 Q(29 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E
-(18)185.545 E 0 Cg EP
-%%Page: 19 19
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<nad27sp4205> : te)110.5 84 Q
-(xas south> : nad27sp)-.15 E(<nad27sp4301> : utah north> : nad27sp)110.5
-96 Q(<nad27sp4302> : utah central> : nad27sp)110.5 108 Q
-(<nad27sp4303> : utah south> : nad27sp)110.5 120 Q(<nad27sp4400> : v)
-110.5 132 Q(ermont \255--> : nad27sp)-.15 E(<nad27sp4501> : vir)110.5
-144 Q(ginia north> : nad27sp)-.18 E(<nad27sp4502> : vir)110.5 156 Q
-(ginia south> : nad27sp)-.18 E(<nad27sp4601> : w)110.5 168 Q
-(ashington north> : nad27sp)-.1 E(<nad27sp4602> : w)110.5 180 Q
-(ashington south> : nad27sp)-.1 E(<nad27sp4701> : west vir)110.5 192 Q
-(ginia north> : nad27sp)-.18 E(<nad27sp4702> : west vir)110.5 204 Q
-(ginia south> : nad27sp)-.18 E
-(<nad27sp4801> : wisconsin north> : nad27sp)110.5 216 Q
-(<nad27sp4802> : wisconsin central> : nad27sp)110.5 228 Q
-(<nad27sp4803> : wisconsin south> : nad27sp)110.5 240 Q
-(<nad27sp4901> : wyoming east> : nad27sp)110.5 252 Q
-(<nad27sp4902> : wyoming east central> : nad27sp)110.5 264 Q
-(<nad27sp4903> : wyoming west central> : nad27sp)110.5 276 Q
-(<nad27sp4904> : wyoming west> : nad27sp)110.5 288 Q
-(<nad27sp5001> : alaska zone no. 1> : nad27sp)110.5 300 Q
-(<nad27sp5002> : alaska zone no. 2> : nad27sp)110.5 312 Q
-(<nad27sp5003> : alaska zone no. 3> : nad27sp)110.5 324 Q
-(<nad27sp5004> : alaska zone no. 4> : nad27sp)110.5 336 Q
-(<nad27sp5005> : alaska zone no. 5> : nad27sp)110.5 348 Q
-(<nad27sp5006> : alaska zone no. 6> : nad27sp)110.5 360 Q
-(<nad27sp5007> : alaska zone no. 7> : nad27sp)110.5 372 Q
-(<nad27sp5008> : alaska zone no. 8> : nad27sp)110.5 384 Q
-(<nad27sp5009> : alaska zone no. 9> : nad27sp)110.5 396 Q
-(<nad27sp5201> : puerto rico and vir)110.5 408 Q(gin islands> : nad27sp)
--.18 E(<nad27sp5202> : vir)110.5 420 Q(gin islands st. croix> : nad27sp)
--.18 E(<nad27sp5400> : guam island> : nad27sp)110.5 432 Q
-(\255--------------------------------------------------------)110.5 456
-Q(State Plane Coordinate Systems)110.5 468 Q(North American Datum 1983)
-110.5 480 Q
-(\255--------------------------------------------------------)110.5 492
-Q(<nad83sp101> : alabama east> : nad83)110.5 504 Q
-(<nad83sp102> : alabama west> : nad83)110.5 516 Q
-(<nad83sp5010> : alaska zone no. 10> : nad83)110.5 528 Q
-(<nad83sp201> : arizona east> : nad83)110.5 540 Q
-(<nad83sp202> : arizona central> : nad83)110.5 552 Q
-(<nad83sp203> : arizona west> : nad83)110.5 564 Q
-(<nad83sp301> : arkansas north> : nad83)110.5 576 Q
-(<nad83sp302> : arkansas south> : nad83)110.5 588 Q
-(<nad83sp401> : california i> : nad83)110.5 600 Q
-(<nad83sp402> : california ii> : nad83)110.5 612 Q
-(<nad83sp403> : california iii> : nad83)110.5 624 Q
-(<nad83sp404> : california i)110.5 636 Q(v> : nad83)-.25 E
-(<nad83sp405> : california v> : nad83)110.5 648 Q
-(<nad83sp406> : california vi> : nad83)110.5 660 Q
-(<nad83sp501> : colorado north> : nad83)110.5 672 Q
-(<nad83sp502> : colorado central> : nad83)110.5 684 Q
-(<nad83sp503> : colorado south> : nad83)110.5 696 Q
-(<nad83sp600> : connecticut \255--> : nad83)110.5 708 Q
-(<nad83sp700> : dela)110.5 720 Q -.1(wa)-.15 G(re \255--> : nad83).1 E
-(MB-System 5.0)72 768 Q(29 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E
-(19)185.545 E 0 Cg EP
-%%Page: 20 20
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<nad83sp901> : \215orida east> : nad83)110.5 84 Q
-(<nad83sp902> : \215orida west> : nad83)110.5 96 Q
-(<nad83sp903> : \215orida north> : nad83)110.5 108 Q
-(<nad83sp1001> : geor)110.5 120 Q(gia east> : nad83)-.18 E
-(<nad83sp1002> : geor)110.5 132 Q(gia west> : nad83)-.18 E
-(<nad83sp5101> : ha)110.5 144 Q -.1(wa)-.15 G(ii 1> : nad83).1 E
-(<nad83sp5102> : ha)110.5 156 Q -.1(wa)-.15 G(ii 2> : nad83).1 E
-(<nad83sp5103> : ha)110.5 168 Q -.1(wa)-.15 G(ii 3> : nad83).1 E
-(<nad83sp5104> : ha)110.5 180 Q -.1(wa)-.15 G(ii 4> : nad83).1 E
-(<nad83sp5105> : ha)110.5 192 Q -.1(wa)-.15 G(ii 5> : nad83).1 E
-(<nad83sp1101> : idaho east> : nad83)110.5 204 Q
-(<nad83sp1102> : idaho central> : nad83)110.5 216 Q
-(<nad83sp1103> : idaho west> : nad83)110.5 228 Q
-(<nad83sp1201> : illinois east> : nad83)110.5 240 Q
-(<nad83sp1202> : illinois west> : nad83)110.5 252 Q
-(<nad83sp1301> : indiana east> : nad83)110.5 264 Q
-(<nad83sp1302> : indiana west> : nad83)110.5 276 Q(<nad83sp1401> : io)
-110.5 288 Q .2 -.1(wa n)-.25 H(orth> : nad83).1 E(<nad83sp1402> : io)
-110.5 300 Q .2 -.1(wa s)-.25 H(outh> : nad83).1 E
-(<nad83sp1501> : kansas north> : nad83)110.5 312 Q
-(<nad83sp1502> : kansas south> : nad83)110.5 324 Q(<nad83sp1601> : k)
-110.5 336 Q(entuck)-.1 E 2.5(yn)-.15 G(orth> : nad83)-2.5 E
-(<nad83sp1602> : k)110.5 348 Q(entuck)-.1 E 2.5(ys)-.15 G(outh> : nad83)
--2.5 E(<nad83sp1701> : louisiana north> : nad83)110.5 360 Q
-(<nad83sp1702> : louisiana south> : nad83)110.5 372 Q
-(<nad83sp1703> : louisiana of)110.5 384 Q(fshore> : nad83)-.25 E
-(<nad83sp1801> : maine east> : nad83)110.5 396 Q
-(<nad83sp1802> : maine west> : nad83)110.5 408 Q
-(<nad83sp1900> : maryland \255--> : nad83)110.5 420 Q
-(<nad83sp2001> : massachusetts mainland> : nad83)110.5 432 Q
-(<nad83sp2002> : massachusetts island> : nad83)110.5 444 Q
-(<nad83sp2111> : michig)110.5 456 Q(an north> : nad83)-.05 E
-(<nad83sp2112> : michig)110.5 468 Q(an central/l> : nad83)-.05 E
-(<nad83sp2113> : michig)110.5 480 Q(an south> : nad83)-.05 E
-(<nad83sp2201> : minnesota north> : nad83)110.5 492 Q
-(<nad83sp2202> : minnesota central> : nad83)110.5 504 Q
-(<nad83sp2203> : minnesota south> : nad83)110.5 516 Q
-(<nad83sp2301> : mississippi east> : nad83)110.5 528 Q
-(<nad83sp2302> : mississippi west> : nad83)110.5 540 Q
-(<nad83sp2401> : missouri east> : nad83)110.5 552 Q
-(<nad83sp2402> : missouri central> : nad83)110.5 564 Q
-(<nad83sp2403> : missouri west> : nad83)110.5 576 Q
-(<nad83sp2500> : montana> : nad83)110.5 588 Q
-(<nad83sp2600> : nebraska> : nad83)110.5 600 Q(<nad83sp2701> : ne)110.5
-612 Q -.25(va)-.25 G(da east> : nad83).25 E(<nad83sp2702> : ne)110.5 624
-Q -.25(va)-.25 G(da central> : nad83).25 E(<nad83sp2703> : ne)110.5 636
-Q -.25(va)-.25 G(da west> : nad83).25 E(<nad83sp2800> : ne)110.5 648 Q
-2.5(wh)-.25 G(ampshire \255--> : nad83)-2.5 E(<nad83sp2900> : ne)110.5
-660 Q 2.5(wj)-.25 G(erse)-2.5 E 2.5<79ad>-.15 G(--> : nad83)-2.5 E
-(<nad83sp3001> : ne)110.5 672 Q 2.5(wm)-.25 G -.15(ex)-2.5 G
-(ico east> : nad83).15 E(<nad83sp3002> : ne)110.5 684 Q 2.5(wm)-.25 G
--.15(ex)-2.5 G(ico central> : nad83).15 E(<nad83sp3003> : ne)110.5 696 Q
-2.5(wm)-.25 G -.15(ex)-2.5 G(ico west> : nad83).15 E(<nad83sp3101> : ne)
-110.5 708 Q 2.5(wy)-.25 G(ork east> : nad83)-2.5 E(<nad83sp3102> : ne)
-110.5 720 Q 2.5(wy)-.25 G(ork central> : nad83)-2.5 E(MB-System 5.0)72
-768 Q(29 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E(20)185.545 E 0 Cg
-EP
-%%Page: 21 21
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<nad83sp3103> : ne)110.5 84 Q 2.5(wy)-.25 G
-(ork west> : nad83)-2.5 E(<nad83sp3104> : ne)110.5 96 Q 2.5(wy)-.25 G
-(ork long island> : nad83)-2.5 E
-(<nad83sp3200> : north carolina \255--> : nad83)110.5 108 Q
-(<nad83sp3301> : north dak)110.5 120 Q(ota north> : nad83)-.1 E
-(<nad83sp3302> : north dak)110.5 132 Q(ota south> : nad83)-.1 E
-(<nad83sp3401> : ohio north> : nad83)110.5 144 Q
-(<nad83sp3402> : ohio south> : nad83)110.5 156 Q
-(<nad83sp3501> : oklahoma north> : nad83)110.5 168 Q
-(<nad83sp3502> : oklahoma south> : nad83)110.5 180 Q
-(<nad83sp3601> : ore)110.5 192 Q(gon north> : nad83)-.15 E
-(<nad83sp3602> : ore)110.5 204 Q(gon south> : nad83)-.15 E
-(<nad83sp3701> : pennsylv)110.5 216 Q(ania north> : nad83)-.25 E
-(<nad83sp3702> : pennsylv)110.5 228 Q(ania south> : nad83)-.25 E
-(<nad83sp3800> : rhode island \255--> : nad83)110.5 240 Q
-(<nad83sp3900> : south carolina> : nad83)110.5 252 Q
-(<nad83sp4001> : south dak)110.5 264 Q(ota north> : nad83)-.1 E
-(<nad83sp4002> : south dak)110.5 276 Q(ota south> : nad83)-.1 E
-(<nad83sp4100> : tennessee \255--> : nad83)110.5 288 Q
-(<nad83sp4201> : te)110.5 300 Q(xas north> : nad83)-.15 E
-(<nad83sp4202> : te)110.5 312 Q(xas north central> : nad83)-.15 E
-(<nad83sp4203> : te)110.5 324 Q(xas central> : nad83)-.15 E
-(<nad83sp4204> : te)110.5 336 Q(xas south central> : nad83)-.15 E
-(<nad83sp4205> : te)110.5 348 Q(xas south> : nad83)-.15 E
-(<nad83sp4301> : utah north> : nad83)110.5 360 Q
-(<nad83sp4302> : utah central> : nad83)110.5 372 Q
-(<nad83sp4303> : utah south> : nad83)110.5 384 Q(<nad83sp4400> : v)110.5
-396 Q(ermont \255--> : nad83)-.15 E(<nad83sp4501> : vir)110.5 408 Q
-(ginia north> : nad83)-.18 E(<nad83sp4502> : vir)110.5 420 Q
-(ginia south> : nad83)-.18 E(<nad83sp4601> : w)110.5 432 Q
-(ashington north> : nad83)-.1 E(<nad83sp4602> : w)110.5 444 Q
-(ashington south> : nad83)-.1 E(<nad83sp4701> : west vir)110.5 456 Q
-(ginia north> : nad83)-.18 E(<nad83sp4702> : west vir)110.5 468 Q
-(ginia south> : nad83)-.18 E(<nad83sp4801> : wisconsin north> : nad83)
-110.5 480 Q(<nad83sp4802> : wisconsin central> : nad83)110.5 492 Q
-(<nad83sp4803> : wisconsin south> : nad83)110.5 504 Q
-(<nad83sp4901> : wyoming east> : nad83)110.5 516 Q
-(<nad83sp4902> : wyoming east central> : nad83)110.5 528 Q
-(<nad83sp4903> : wyoming west central> : nad83)110.5 540 Q
-(<nad83sp4904> : wyoming west> : nad83)110.5 552 Q
-(<nad83sp5001> : alaska zone no. 1> : nad83)110.5 564 Q
-(<nad83sp5002> : alaska zone no. 2> : nad83)110.5 576 Q
-(<nad83sp5003> : alaska zone no. 3> : nad83)110.5 588 Q
-(<nad83sp5004> : alaska zone no. 4> : nad83)110.5 600 Q
-(<nad83sp5005> : alaska zone no. 5> : nad83)110.5 612 Q
-(<nad83sp5006> : alaska zone no. 6> : nad83)110.5 624 Q
-(<nad83sp5007> : alaska zone no. 7> : nad83)110.5 636 Q
-(<nad83sp5008> : alaska zone no. 8> : nad83)110.5 648 Q
-(<nad83sp5009> : alaska zone no. 9> : nad83)110.5 660 Q
-(<nad83sp5200> : puerto rico and vir)110.5 672 Q(gin islands> : nad83)
--.18 E(\255--------------------------------------------------------)
-110.5 696 Q(Great Lak)110.5 708 Q(es Grids using Clark)-.1 E 2.5(e1)-.1
-G(866 ellipsoid)-2.5 E
-(\255--------------------------------------------------------)110.5 720
-Q(MB-System 5.0)72 768 Q(29 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E
-(21)185.545 E 0 Cg EP
-%%Page: 22 22
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<erie-etal> : Lak)110.5 84 Q 2.5(eE)-.1 G
-(rie, Ontario and St. La)-2.5 E(wrence Ri)-.15 E -.15(ve)-.25 G -.55(r.)
-.15 G(<huron> : Lak)110.5 96 Q 2.5(eH)-.1 G(uron)-2.5 E(<michig)110.5
-108 Q(an> : Lak)-.05 E 2.5(eM)-.1 G(ichig)-2.5 E(an)-.05 E
-(<superior> : Lak)110.5 120 Q 2.5(eS)-.1 G(uperior)-2.5 E 2.5(,L)-.4 G
-(ak)-2.5 E 2.5(eo)-.1 G 2.5(ft)-2.5 G(he W)-2.5 E(oods)-.8 E
-(\255--------------------------------------------------------)110.5 144
-Q(EPSG projection de\214nitions)110.5 156 Q
-(\255--------------------------------------------------------)110.5 168
-Q(<epsg4001> : Unkno)110.5 180 Q
-(wn datum based upon the Airy 1830 ellipsoid)-.25 E(<epsg4002> : Unkno)
-110.5 192 Q(wn datum based upon the Airy Modi\214ed 1849 ellipsoid)-.25
-E(<epsg4003> : Unkno)110.5 204 Q
-(wn datum based upon the Australian National Spheroid)-.25 E
-(<epsg4004> : Unkno)110.5 216 Q
-(wn datum based upon the Bessel 1841 ellipsoid)-.25 E
-(<epsg4005> : Unkno)110.5 228 Q
-(wn datum based upon the Bessel Modi\214ed ellipsoid)-.25 E
-(<epsg4006> : Unkno)110.5 240 Q
-(wn datum based upon the Bessel Namibia ellipsoid)-.25 E
-(<epsg4007> : Unkno)110.5 252 Q(wn datum based upon the Clark)-.25 E 2.5
-(e1)-.1 G(858 ellipsoid)-2.5 E(<epsg4008> : Unkno)110.5 264 Q
-(wn datum based upon the Clark)-.25 E 2.5(e1)-.1 G(866 ellipsoid)-2.5 E
-(<epsg4009> : Unkno)110.5 276 Q(wn datum based upon the Clark)-.25 E 2.5
-(e1)-.1 G(866 Michig)-2.5 E(an ellipsoid)-.05 E(<epsg4010> : Unkno)110.5
-288 Q(wn datum based upon the Clark)-.25 E 2.5(e1)-.1 G
-(880 \(Benoit\) ellipsoid)-2.5 E(<epsg4011> : Unkno)110.5 300 Q
-(wn datum based upon the Clark)-.25 E 2.5(e1)-.1 G
-(880 \(IGN\) ellipsoid)-2.5 E(<epsg4012> : Unkno)110.5 312 Q
-(wn datum based upon the Clark)-.25 E 2.5(e1)-.1 G
-(880 \(RGS\) ellipsoid)-2.5 E(<epsg4013> : Unkno)110.5 324 Q
-(wn datum based upon the Clark)-.25 E 2.5(e1)-.1 G
-(880 \(Arc\) ellipsoid)-2.5 E(<epsg4014> : Unkno)110.5 336 Q
-(wn datum based upon the Clark)-.25 E 2.5(e1)-.1 G
-(880 \(SGA 1922\) ellipsoid)-2.5 E(<epsg4015> : Unkno)110.5 348 Q
-(wn datum based upon the Ev)-.25 E
-(erest 1830 \(1937 Adjustment\) ellipsoid)-.15 E(<epsg4016> : Unkno)
-110.5 360 Q(wn datum based upon the Ev)-.25 E
-(erest 1830 \(1967 De\214nition\) ellipsoid)-.15 E(<epsg4018> : Unkno)
-110.5 372 Q(wn datum based upon the Ev)-.25 E
-(erest 1830 Modi\214ed ellipsoid)-.15 E(<epsg4019> : Unkno)110.5 384 Q
-(wn datum based upon the GRS 1980 ellipsoid)-.25 E(<epsg4020> : Unkno)
-110.5 396 Q(wn datum based upon the Helmert 1906 ellipsoid)-.25 E
-(<epsg4021> : Unkno)110.5 408 Q
-(wn datum based upon the Indonesian National Spheroid)-.25 E
-(<epsg4022> : Unkno)110.5 420 Q
-(wn datum based upon the International 1924 ellipsoid)-.25 E
-(<epsg4024> : Unkno)110.5 432 Q(wn datum based upon the Krasso)-.25 E
-(wsk)-.25 E 2.5(y1)-.15 G(940 ellipsoid)-2.5 E(<epsg4025> : Unkno)110.5
-444 Q(wn datum based upon the NWL 9D ellipsoid)-.25 E
-(<epsg4027> : Unkno)110.5 456 Q
-(wn datum based upon the Plessis 1817 ellipsoid)-.25 E
-(<epsg4028> : Unkno)110.5 468 Q(wn datum based upon the Struv)-.25 E 2.5
-(e1)-.15 G(860 ellipsoid)-2.5 E(<epsg4029> : Unkno)110.5 480 Q
-(wn datum based upon the W)-.25 E(ar Of)-.8 E(\214ce ellipsoid)-.25 E
-(<epsg4030> : Unkno)110.5 492 Q
-(wn datum based upon the WGS 84 ellipsoid)-.25 E(<epsg4031> : Unkno)
-110.5 504 Q(wn datum based upon the GEM 10C ellipsoid)-.25 E
-(<epsg4032> : Unkno)110.5 516 Q
-(wn datum based upon the OSU86F ellipsoid)-.25 E(<epsg4033> : Unkno)
-110.5 528 Q(wn datum based upon the OSU91A ellipsoid)-.25 E
-(<epsg4034> : Unkno)110.5 540 Q(wn datum based upon the Clark)-.25 E 2.5
-(e1)-.1 G(880 ellipsoid)-2.5 E(<epsg4035> : Unkno)110.5 552 Q
-(wn datum based upon the Authalic Sphere)-.25 E(<epsg4036> : Unkno)110.5
-564 Q(wn datum based upon the GRS 1967 ellipsoid)-.25 E
-(<epsg4041> : Unkno)110.5 576 Q(wn datum based upon the A)-.25 E -.15
-(ve)-.74 G(rage T).15 E(errestrial System 1977 ellipsoid)-.7 E
-(<epsg4042> : Unkno)110.5 588 Q(wn datum based upon the Ev)-.25 E
-(erest \(1830 De\214nition\) ellipsoid)-.15 E(<epsg4043> : Unkno)110.5
-600 Q(wn datum based upon the WGS 72 ellipsoid)-.25 E
-(<epsg4044> : Unkno)110.5 612 Q(wn datum based upon the Ev)-.25 E
-(erest 1830 \(1962 De\214nition\) ellipsoid)-.15 E(<epsg4045> : Unkno)
-110.5 624 Q(wn datum based upon the Ev)-.25 E
-(erest 1830 \(1975 De\214nition\) ellipsoid)-.15 E(<epsg4047> : Unspeci\
-\214ed datum based upon the GRS 1980 Authalic Sphere)110.5 636 Q
-(<epsg4052> : Unspeci\214ed datum based upon the Clark)110.5 648 Q 2.5
-(e1)-.1 G(866 Authalic Sphere)-2.5 E(<epsg4053> : Unspeci\214ed datum b\
-ased upon the International 1924 Authalic Sphere)110.5 660 Q
-(<epsg4054> : Unspeci\214ed datum based upon the Hughes 1980 ellipsoid)
-110.5 672 Q(<epsg4120> : Greek)110.5 684 Q(<epsg4121> : GGRS87)110.5 696
-Q(<epsg4122> : A)110.5 708 Q(TS77)-1.11 E(<epsg4123> : KKJ)110.5 720 Q
-(MB-System 5.0)72 768 Q(29 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E
-(22)185.545 E 0 Cg EP
-%%Page: 23 23
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<epsg4124> : R)110.5 84 Q(T90)-.6 E
-(<epsg4125> : Samboja)110.5 96 Q(<epsg4126> : LKS94 \(ETRS89\))110.5 108
-Q(<epsg4127> : T)110.5 120 Q(ete)-.7 E(<epsg4128> : Madzansua)110.5 132
-Q(<epsg4129> : Observ)110.5 144 Q(atario)-.25 E(<epsg4130> : Moznet)
-110.5 156 Q(<epsg4131> : Indian 1960)110.5 168 Q(<epsg4132> : FD58)110.5
-180 Q(<epsg4133> : EST92)110.5 192 Q(<epsg4134> : PDO Surv)110.5 204 Q
-.3 -.15(ey D)-.15 H(atum 1993).15 E(<epsg4135> : Old Ha)110.5 216 Q -.1
-(wa)-.15 G(iian).1 E(<epsg4136> : St. La)110.5 228 Q(wrence Island)-.15
-E(<epsg4137> : St. P)110.5 240 Q(aul Island)-.15 E
-(<epsg4138> : St. Geor)110.5 252 Q(ge Island)-.18 E
-(<epsg4139> : Puerto Rico)110.5 264 Q(<epsg4140> : N)110.5 276 Q
-(AD83\(CSRS98\))-.35 E(<epsg4141> : Israel)110.5 288 Q
-(<epsg4142> : Locodjo 1965)110.5 300 Q(<epsg4143> : Abidjan 1987)110.5
-312 Q(<epsg4144> : Kalianpur 1937)110.5 324 Q
-(<epsg4145> : Kalianpur 1962)110.5 336 Q(<epsg4146> : Kalianpur 1975)
-110.5 348 Q(<epsg4147> : Hanoi 1972)110.5 360 Q
-(<epsg4148> : Hartebeesthoek94)110.5 372 Q(<epsg4149> : CH1903)110.5 384
-Q(<epsg4150> : CH1903+)110.5 396 Q(<epsg4151> : CHTRF95)110.5 408 Q
-(<epsg4152> : N)110.5 420 Q(AD83\(HARN\))-.35 E(<epsg4153> : Rassadiran)
-110.5 432 Q(<epsg4154> : ED50\(ED77\))110.5 444 Q
-(<epsg4155> : Dabola 1981)110.5 456 Q(<epsg4156> : S-JTSK)110.5 468 Q
-(<epsg4157> : Mount Dillon)110.5 480 Q(<epsg4158> : Naparima 1955)110.5
-492 Q(<epsg4159> : ELD79)110.5 504 Q(<epsg4160> : Chos Malal 1914)110.5
-516 Q(<epsg4161> : P)110.5 528 Q(ampa del Castillo)-.15 E
-(<epsg4162> : K)110.5 540 Q(orean 1985)-.35 E(<epsg4163> : Y)110.5 552 Q
-(emen NGN96)-1 E(<epsg4164> : South Y)110.5 564 Q(emen)-1 E
-(<epsg4165> : Bissau)110.5 576 Q(<epsg4166> : K)110.5 588 Q(orean 1995)
--.35 E(<epsg4167> : NZGD2000)110.5 600 Q(<epsg4168> : Accra)110.5 612 Q
-(<epsg4169> : American Samoa 1962)110.5 624 Q(<epsg4170> : SIRGAS)110.5
-636 Q(<epsg4171> : RGF93)110.5 648 Q(<epsg4172> : POSGAR)110.5 660 Q
-(<epsg4173> : IRENET95)110.5 672 Q(<epsg4174> : Sierra Leone 1924)110.5
-684 Q(<epsg4175> : Sierra Leone 1968)110.5 696 Q
-(<epsg4176> : Australian Antarctic)110.5 708 Q(<epsg4178> : Pulk)110.5
-720 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942\(83\))-2.5 E(MB-System 5.0)72 768
-Q(29 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E(23)185.545 E 0 Cg EP
-%%Page: 24 24
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<epsg4179> : Pulk)110.5 84 Q -.15(ov)-.1 G 2.5
-(o1)-.05 G(942\(58\))-2.5 E(<epsg4180> : EST97)110.5 96 Q
-(<epsg4181> : Lux)110.5 108 Q(embour)-.15 E 2.5(g1)-.18 G(930)-2.5 E
-(<epsg4182> : Azores Occidental 1939)110.5 120 Q
-(<epsg4183> : Azores Central 1948)110.5 132 Q
-(<epsg4184> : Azores Oriental 1940)110.5 144 Q
-(<epsg4185> : Madeira 1936)110.5 156 Q(<epsg4188> : OSNI 1952)110.5 168
-Q(<epsg4189> : REGVEN)110.5 180 Q(<epsg4190> : POSGAR 98)110.5 192 Q
-(<epsg4191> : Albanian 1987)110.5 204 Q(<epsg4192> : Douala 1948)110.5
-216 Q(<epsg4193> : Manoca 1962)110.5 228 Q(<epsg4194> : Qornoq 1927)
-110.5 240 Q(<epsg4195> : Scoresbysund 1952)110.5 252 Q
-(<epsg4196> : Ammassalik 1958)110.5 264 Q(<epsg4197> : Garoua)110.5 276
-Q(<epsg4198> : K)110.5 288 Q(ousseri)-.35 E(<epsg4199> : Egypt 1930)
-110.5 300 Q(<epsg4200> : Pulk)110.5 312 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995)-2.5 E(<epsg4201> : Adindan)110.5 324 Q(<epsg4202> : A)110.5 336 Q
-(GD66)-.4 E(<epsg4203> : A)110.5 348 Q(GD84)-.4 E
-(<epsg4204> : Ain el Abd)110.5 360 Q(<epsg4205> : Afgoo)110.5 372 Q(ye)
--.1 E(<epsg4206> : Ag)110.5 384 Q(adez)-.05 E(<epsg4207> : Lisbon)110.5
-396 Q(<epsg4208> : Aratu)110.5 408 Q(<epsg4209> : Arc 1950)110.5 420 Q
-(<epsg4210> : Arc 1960)110.5 432 Q(<epsg4211> : Bata)110.5 444 Q(via)-.2
-E(<epsg4212> : Barbados 1938)110.5 456 Q(<epsg4213> : Beduaram)110.5 468
-Q(<epsg4214> : Beijing 1954)110.5 480 Q(<epsg4215> : Belge 1950)110.5
-492 Q(<epsg4216> : Bermuda 1957)110.5 504 Q(<epsg4218> : Bogota 1975)
-110.5 516 Q(<epsg4219> : Bukit Rimpah)110.5 528 Q(<epsg4220> : Camacupa)
-110.5 540 Q(<epsg4221> : Campo Inchauspe)110.5 552 Q(<epsg4222> : Cape)
-110.5 564 Q(<epsg4223> : Carthage)110.5 576 Q(<epsg4224> : Chua)110.5
-588 Q(<epsg4225> : Corre)110.5 600 Q(go Ale)-.15 E(gre)-.15 E
-(<epsg4226> : Cote d'Iv)110.5 612 Q(oire)-.2 E(<epsg4227> : Deir ez Zor)
-110.5 624 Q(<epsg4228> : Douala)110.5 636 Q(<epsg4229> : Egypt 1907)
-110.5 648 Q(<epsg4230> : ED50)110.5 660 Q(<epsg4231> : ED87)110.5 672 Q
-(<epsg4232> : F)110.5 684 Q(ahud)-.15 E(<epsg4233> : Gandajika 1970)
-110.5 696 Q(<epsg4234> : Garoua)110.5 708 Q
-(<epsg4235> : Guyane Francaise)110.5 720 Q(MB-System 5.0)72 768 Q(29 No)
-132.205 E -.15(ve)-.15 G(mber 2014).15 E(24)185.545 E 0 Cg EP
-%%Page: 25 25
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<epsg4236> : Hu Tzu Shan)110.5 84 Q
-(<epsg4237> : HD72)110.5 96 Q(<epsg4238> : ID74)110.5 108 Q
-(<epsg4239> : Indian 1954)110.5 120 Q(<epsg4240> : Indian 1975)110.5 132
-Q(<epsg4241> : Jamaica 1875)110.5 144 Q(<epsg4242> : J)110.5 156 Q(AD69)
--.6 E(<epsg4243> : Kalianpur 1880)110.5 168 Q(<epsg4244> : Kanda)110.5
-180 Q -.1(wa)-.15 G(la).1 E(<epsg4245> : K)110.5 192 Q(ertau 1968)-.25 E
-(<epsg4246> : K)110.5 204 Q(OC)-.3 E(<epsg4247> : La Canoa)110.5 216 Q
-(<epsg4248> : PSAD56)110.5 228 Q(<epsg4249> : Lak)110.5 240 Q(e)-.1 E
-(<epsg4250> : Leigon)110.5 252 Q(<epsg4251> : Liberia 1964)110.5 264 Q
-(<epsg4252> : Lome)110.5 276 Q(<epsg4253> : Luzon 1911)110.5 288 Q
-(<epsg4254> : Hito XVIII 1963)110.5 300 Q(<epsg4255> : Herat North)110.5
-312 Q(<epsg4256> : Mahe 1971)110.5 324 Q(<epsg4257> : Makassar)110.5 336
-Q(<epsg4258> : ETRS89)110.5 348 Q(<epsg4259> : Malongo 1987)110.5 360 Q
-(<epsg4260> : Manoca)110.5 372 Q(<epsg4261> : Merchich)110.5 384 Q
-(<epsg4262> : Massa)110.5 396 Q -.1(wa)-.15 G(<epsg4263> : Minna)110.5
-408 Q(<epsg4264> : Mhast)110.5 420 Q(<epsg4265> : Monte Mario)110.5 432
-Q(<epsg4266> : M'poralok)110.5 444 Q(o)-.1 E(<epsg4267> : N)110.5 456 Q
-(AD27)-.35 E(<epsg4268> : N)110.5 468 Q(AD27 Michig)-.35 E(an)-.05 E
-(<epsg4269> : N)110.5 480 Q(AD83)-.35 E(<epsg4270> : Nahrw)110.5 492 Q
-(an 1967)-.1 E(<epsg4271> : Naparima 1972)110.5 504 Q
-(<epsg4272> : NZGD49)110.5 516 Q(<epsg4273> : NGO 1948)110.5 528 Q
-(<epsg4274> : Datum 73)110.5 540 Q(<epsg4275> : NTF)110.5 552 Q
-(<epsg4276> : NSWC 9Z-2)110.5 564 Q(<epsg4277> : OSGB 1936)110.5 576 Q
-(<epsg4278> : OSGB70)110.5 588 Q(<epsg4279> : OS\(SN\)80)110.5 600 Q
-(<epsg4280> : P)110.5 612 Q(adang)-.15 E(<epsg4281> : P)110.5 624 Q
-(alestine 1923)-.15 E(<epsg4282> : Pointe Noire)110.5 636 Q
-(<epsg4283> : GD)110.5 648 Q(A94)-.4 E(<epsg4284> : Pulk)110.5 660 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(942)-2.5 E(<epsg4285> : Qatar 1974)110.5 672
-Q(<epsg4286> : Qatar 1948)110.5 684 Q(<epsg4287> : Qornoq)110.5 696 Q
-(<epsg4288> : Loma Quintana)110.5 708 Q(<epsg4289> : Amersfoort)110.5
-720 Q(MB-System 5.0)72 768 Q(29 No)132.205 E -.15(ve)-.15 G(mber 2014)
-.15 E(25)185.545 E 0 Cg EP
-%%Page: 26 26
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<epsg4291> : SAD69)110.5 84 Q
-(<epsg4292> : Sapper Hill 1943)110.5 96 Q(<epsg4293> : Schw)110.5 108 Q
-(arzeck)-.1 E(<epsg4294> : Se)110.5 120 Q(gora)-.15 E
-(<epsg4295> : Serindung)110.5 132 Q(<epsg4296> : Sudan)110.5 144 Q
-(<epsg4297> : T)110.5 156 Q(ananari)-.8 E -.15(ve)-.25 G(<epsg4298> : T)
-110.5 168 Q(imbalai 1948)-.35 E(<epsg4299> : TM65)110.5 180 Q
-(<epsg4300> : TM75)110.5 192 Q(<epsg4301> : T)110.5 204 Q(ok)-.8 E(yo)
--.15 E(<epsg4302> : T)110.5 216 Q(rinidad 1903)-.35 E
-(<epsg4303> : TC\(1948\))110.5 228 Q(<epsg4304> : V)110.5 240 Q
-(oirol 1875)-1.29 E(<epsg4306> : Bern 1938)110.5 252 Q
-(<epsg4307> : Nord Sahara 1959)110.5 264 Q(<epsg4308> : R)110.5 276 Q
-(T38)-.6 E(<epsg4309> : Y)110.5 288 Q(acare)-1 E(<epsg4310> : Y)110.5
-300 Q(of)-1.1 E(f)-.25 E(<epsg4311> : Zanderij)110.5 312 Q
-(<epsg4312> : MGI)110.5 324 Q(<epsg4313> : Belge 1972)110.5 336 Q
-(<epsg4314> : DHDN)110.5 348 Q(<epsg4315> : Conakry 1905)110.5 360 Q
-(<epsg4316> : Dealul Piscului 1933)110.5 372 Q
-(<epsg4317> : Dealul Piscului 1970)110.5 384 Q(<epsg4318> : NGN)110.5
-396 Q(<epsg4319> : KUD)110.5 408 Q(AMS)-.4 E(<epsg4322> : WGS 72)110.5
-420 Q(<epsg4324> : WGS 72BE)110.5 432 Q(<epsg4326> : WGS 84)110.5 444 Q
-(<epsg4600> : Anguilla 1957)110.5 456 Q(<epsg4601> : Antigua 1943)110.5
-468 Q(<epsg4602> : Dominica 1945)110.5 480 Q(<epsg4603> : Grenada 1953)
-110.5 492 Q(<epsg4604> : Montserrat 1958)110.5 504 Q
-(<epsg4605> : St. Kitts 1955)110.5 516 Q(<epsg4606> : St. Lucia 1955)
-110.5 528 Q(<epsg4607> : St. V)110.5 540 Q(incent 1945)-.6 E
-(<epsg4608> : N)110.5 552 Q(AD27\(76\))-.35 E(<epsg4609> : N)110.5 564 Q
-(AD27\(CGQ77\))-.35 E(<epsg4610> : Xian 1980)110.5 576 Q
-(<epsg4611> : Hong K)110.5 588 Q(ong 1980)-.35 E(<epsg4612> : JGD2000)
-110.5 600 Q(<epsg4613> : Se)110.5 612 Q -.05(ga)-.15 G(ra).05 E
-(<epsg4614> : QND95)110.5 624 Q(<epsg4615> : Porto Santo)110.5 636 Q
-(<epsg4616> : Selv)110.5 648 Q(agem Grande)-.25 E(<epsg4617> : N)110.5
-660 Q(AD83\(CSRS\))-.35 E(<epsg4618> : SAD69)110.5 672 Q
-(<epsg4619> : SWEREF99)110.5 684 Q(<epsg4620> : Point 58)110.5 696 Q
-(<epsg4621> : F)110.5 708 Q(ort Marigot)-.15 E
-(<epsg4622> : Guadeloupe 1948)110.5 720 Q(MB-System 5.0)72 768 Q(29 No)
-132.205 E -.15(ve)-.15 G(mber 2014).15 E(26)185.545 E 0 Cg EP
-%%Page: 27 27
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<epsg4623> : CSG67)110.5 84 Q
-(<epsg4624> : RGFG95)110.5 96 Q(<epsg4625> : Martinique 1938)110.5 108 Q
-(<epsg4626> : Reunion 1947)110.5 120 Q(<epsg4627> : RGR92)110.5 132 Q
-(<epsg4628> : T)110.5 144 Q(ahiti 52)-.8 E(<epsg4629> : T)110.5 156 Q
-(ahaa 54)-.8 E(<epsg4630> : IGN72 Nuku Hi)110.5 168 Q -.25(va)-.25 G
-(<epsg4631> : K0 1949)110.5 180 Q(<epsg4632> : Combani 1950)110.5 192 Q
-(<epsg4633> : IGN56 Lifou)110.5 204 Q(<epsg4634> : IGN72 Grand T)110.5
-216 Q(erre)-.7 E(<epsg4635> : ST87 Ouv)110.5 228 Q(ea)-.15 E
-(<epsg4636> : Petrels 1972)110.5 240 Q(<epsg4637> : Perroud 1950)110.5
-252 Q(<epsg4638> : Saint Pierre et Miquelon 1950)110.5 264 Q
-(<epsg4639> : MOP78)110.5 276 Q(<epsg4640> : RRAF 1991)110.5 288 Q
-(<epsg4641> : IGN53 Mare)110.5 300 Q(<epsg4642> : ST84 Ile des Pins)
-110.5 312 Q(<epsg4643> : ST71 Belep)110.5 324 Q
-(<epsg4644> : NEA74 Noumea)110.5 336 Q(<epsg4645> : RGNC 1991)110.5 348
-Q(<epsg4646> : Grand Comoros)110.5 360 Q(<epsg4657> : Re)110.5 372 Q
-(ykja)-.15 E(vik 1900)-.2 E(<epsg4658> : Hjorse)110.5 384 Q 2.5(y1)-.15
-G(955)-2.5 E(<epsg4659> : ISN93)110.5 396 Q(<epsg4660> : Helle 1954)
-110.5 408 Q(<epsg4661> : LKS92)110.5 420 Q(<epsg4662> : IGN72 Grande T)
-110.5 432 Q(erre)-.7 E(<epsg4663> : Porto Santo 1995)110.5 444 Q
-(<epsg4664> : Azores Oriental 1995)110.5 456 Q
-(<epsg4665> : Azores Central 1995)110.5 468 Q(<epsg4666> : Lisbon 1890)
-110.5 480 Q(<epsg4667> : IKBD-92)110.5 492 Q(<epsg4668> : ED79)110.5 504
-Q(<epsg4669> : LKS94)110.5 516 Q(<epsg4670> : IGM95)110.5 528 Q
-(<epsg4671> : V)110.5 540 Q(oirol 1879)-1.29 E(<epsg4672> : CI1971)110.5
-552 Q(<epsg4673> : CI1979)110.5 564 Q(<epsg4674> : SIRGAS 2000)110.5 576
-Q(<epsg4675> : Guam 1963)110.5 588 Q(<epsg4676> : V)110.5 600 Q
-(ientiane 1982)-.6 E(<epsg4677> : Lao 1993)110.5 612 Q
-(<epsg4678> : Lao 1997)110.5 624 Q(<epsg4679> : Jouik 1961)110.5 636 Q
-(<epsg4680> : Nouakchott 1965)110.5 648 Q(<epsg4681> : Mauritania 1999)
-110.5 660 Q(<epsg4682> : Gulshan 303)110.5 672 Q(<epsg4683> : PRS92)
-110.5 684 Q(<epsg4684> : Gan 1970)110.5 696 Q(<epsg4685> : Gandajika)
-110.5 708 Q(<epsg4686> : MA)110.5 720 Q(GN)-.4 E(A-SIRGAS)-.35 E
-(MB-System 5.0)72 768 Q(29 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E
-(27)185.545 E 0 Cg EP
-%%Page: 28 28
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<epsg4687> : RGPF)110.5 84 Q(<epsg4688> : F)110.5
-96 Q(atu Iv)-.15 E 2.5(a7)-.25 G(2)-2.5 E(<epsg4689> : IGN63 Hi)110.5
-108 Q .5 -.25(va O)-.25 H(a).25 E(<epsg4690> : T)110.5 120 Q(ahiti 79)
--.8 E(<epsg4691> : Moorea 87)110.5 132 Q(<epsg4692> : Maupiti 83)110.5
-144 Q(<epsg4693> : Nakhl-e Ghanem)110.5 156 Q(<epsg4694> : POSGAR 94)
-110.5 168 Q(<epsg4695> : Katang)110.5 180 Q 2.5(a1)-.05 G(955)-2.5 E
-(<epsg4696> : Kasai 1953)110.5 192 Q(<epsg4697> : IGC 1962 6th P)110.5
-204 Q(arallel South)-.15 E(<epsg4698> : IGN 1962 K)110.5 216 Q(er)-.25 E
-(guelen)-.18 E(<epsg4699> : Le Pouce 1934)110.5 228 Q
-(<epsg4700> : IGN Astro 1960)110.5 240 Q(<epsg4701> : IGCB 1955)110.5
-252 Q(<epsg4702> : Mauritania 1999)110.5 264 Q(<epsg4703> : Mhast 1951)
-110.5 276 Q(<epsg4704> : Mhast \(onshore\))110.5 288 Q
-(<epsg4705> : Mhast \(of)110.5 300 Q(fshore\))-.25 E
-(<epsg4706> : Egypt Gulf of Suez S-650 TL)110.5 312 Q(<epsg4707> : T)
-110.5 324 Q(ern Island 1961)-.7 E(<epsg4708> : Cocos Islands 1965)110.5
-336 Q(<epsg4709> : Iw)110.5 348 Q 2.5(oJ)-.1 G(ima 1945)-2.5 E
-(<epsg4710> : St. Helena 1971)110.5 360 Q
-(<epsg4711> : Marcus Island 1952)110.5 372 Q
-(<epsg4712> : Ascension Island 1958)110.5 384 Q(<epsg4713> : A)110.5 396
-Q(yabelle Lighthouse)-.92 E(<epsg4714> : Belle)110.5 408 Q(vue)-.25 E
-(<epsg4715> : Camp Area Astro)110.5 420 Q
-(<epsg4716> : Phoenix Islands 1966)110.5 432 Q(<epsg4717> : Cape Cana)
-110.5 444 Q -.15(ve)-.2 G(ral).15 E(<epsg4718> : Solomon 1968)110.5 456
-Q(<epsg4719> : Easter Island 1967)110.5 468 Q(<epsg4720> : Fiji 1986)
-110.5 480 Q(<epsg4721> : Fiji 1956)110.5 492 Q(<epsg4722> : South Geor)
-110.5 504 Q(gia 1968)-.18 E(<epsg4723> : Grand Cayman 1959)110.5 516 Q
-(<epsg4724> : Die)110.5 528 Q(go Garcia 1969)-.15 E
-(<epsg4725> : Johnston Island 1961)110.5 540 Q
-(<epsg4726> : Little Cayman 1961)110.5 552 Q(<epsg4727> : Midw)110.5 564
-Q(ay 1961)-.1 E(<epsg4728> : Pico de la Nie)110.5 576 Q -.15(ve)-.25 G
-(s).15 E(<epsg4729> : Pitcairn 1967)110.5 588 Q(<epsg4730> : Santo 1965)
-110.5 600 Q(<epsg4731> : V)110.5 612 Q(iti Le)-.6 E(vu 1916)-.25 E
-(<epsg4732> : Marshall Islands 1960)110.5 624 Q(<epsg4733> : W)110.5 636
-Q(ak)-.8 E 2.5(eI)-.1 G(sland 1952)-2.5 E(<epsg4734> : T)110.5 648 Q
-(ristan 1968)-.35 E(<epsg4735> : K)110.5 660 Q(usaie 1951)-.15 E
-(<epsg4736> : Deception Island)110.5 672 Q(<epsg4737> : K)110.5 684 Q
-(orea 2000)-.35 E(<epsg4738> : Hong K)110.5 696 Q(ong 1963)-.35 E
-(<epsg4739> : Hong K)110.5 708 Q(ong 1963\(67\))-.35 E
-(<epsg4740> : PZ-90)110.5 720 Q(MB-System 5.0)72 768 Q(29 No)132.205 E
--.15(ve)-.15 G(mber 2014).15 E(28)185.545 E 0 Cg EP
-%%Page: 29 29
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<epsg4741> : FD54)110.5 84 Q
-(<epsg4742> : GDM2000)110.5 96 Q
-(<epsg4743> : Karbala 1979 \(Polservice\))110.5 108 Q
-(<epsg4744> : Nahrw)110.5 120 Q(an 1934)-.1 E(<epsg4745> : RD/83)110.5
-132 Q(<epsg4746> : PD/83)110.5 144 Q(<epsg4747> : GR96)110.5 156 Q
-(<epsg4748> : V)110.5 168 Q(anua Le)-1.11 E(vu 1915)-.25 E
-(<epsg4749> : RGNC91-93)110.5 180 Q(<epsg4750> : ST87 Ouv)110.5 192 Q
-(ea)-.15 E(<epsg4751> : K)110.5 204 Q(ertau \(RSO\))-.25 E
-(<epsg4752> : V)110.5 216 Q(iti Le)-.6 E(vu 1912)-.25 E
-(<epsg4753> : fk89)110.5 228 Q(<epsg4754> : LGD2006)110.5 240 Q
-(<epsg4755> : DGN95)110.5 252 Q(<epsg4756> : VN-2000)110.5 264 Q
-(<epsg4757> : SVY21)110.5 276 Q(<epsg4758> : J)110.5 288 Q(AD2001)-.6 E
-(<epsg4759> : N)110.5 300 Q(AD83\(NSRS2007\))-.35 E(<epsg4760> : WGS 66)
-110.5 312 Q(<epsg4801> : Bern 1898 \(Bern\))110.5 324 Q
-(<epsg4802> : Bogota 1975 \(Bogota\))110.5 336 Q
-(<epsg4803> : Lisbon \(Lisbon\))110.5 348 Q
-(<epsg4804> : Makassar \(Jakarta\))110.5 360 Q
-(<epsg4805> : MGI \(Ferro\))110.5 372 Q
-(<epsg4806> : Monte Mario \(Rome\))110.5 384 Q(<epsg4807> : NTF \(P)
-110.5 396 Q(aris\))-.15 E(<epsg4808> : P)110.5 408 Q(adang \(Jakarta\))
--.15 E(<epsg4809> : Belge 1950 \(Brussels\))110.5 420 Q(<epsg4810> : T)
-110.5 432 Q(ananari)-.8 E .3 -.15(ve \()-.25 H -.15(Pa).15 G(ris\)).15 E
-(<epsg4811> : V)110.5 444 Q(oirol 1875 \(P)-1.29 E(aris\))-.15 E
-(<epsg4813> : Bata)110.5 456 Q(via \(Jakarta\))-.2 E(<epsg4814> : R)
-110.5 468 Q(T38 \(Stockholm\))-.6 E(<epsg4815> : Greek \(Athens\))110.5
-480 Q(<epsg4816> : Carthage \(P)110.5 492 Q(aris\))-.15 E
-(<epsg4817> : NGO 1948 \(Oslo\))110.5 504 Q
-(<epsg4818> : S-JTSK \(Ferro\))110.5 516 Q
-(<epsg4819> : Nord Sahara 1959 \(P)110.5 528 Q(aris\))-.15 E
-(<epsg4820> : Se)110.5 540 Q -.05(ga)-.15 G(ra \(Jakarta\)).05 E
-(<epsg4821> : V)110.5 552 Q(oirol 1879 \(P)-1.29 E(aris\))-.15 E
-(<epsg4901> : A)110.5 564 Q(TF \(P)-1.11 E(aris\))-.15 E
-(<epsg4902> : NDG \(P)110.5 576 Q(aris\))-.15 E
-(<epsg4903> : Madrid 1870 \(Madrid\))110.5 588 Q
-(<epsg4904> : Lisbon 1890 \(Lisbon\))110.5 600 Q
-(<epsg2000> : Anguilla 1957 / British W)110.5 612 Q(est Indies Grid)-.8
-E(<epsg2001> : Antigua 1943 / British W)110.5 624 Q(est Indies Grid)-.8
-E(<epsg2002> : Dominica 1945 / British W)110.5 636 Q(est Indies Grid)-.8
-E(<epsg2003> : Grenada 1953 / British W)110.5 648 Q(est Indies Grid)-.8
-E(<epsg2004> : Montserrat 1958 / British W)110.5 660 Q(est Indies Grid)
--.8 E(<epsg2005> : St. Kitts 1955 / British W)110.5 672 Q
-(est Indies Grid)-.8 E(<epsg2006> : St. Lucia 1955 / British W)110.5 684
-Q(est Indies Grid)-.8 E(<epsg2007> : St. V)110.5 696 Q
-(incent 45 / British W)-.6 E(est Indies Grid)-.8 E(<epsg2008> : N)110.5
-708 Q(AD27\(CGQ77\) / SCoPQ zone 2)-.35 E(<epsg2009> : N)110.5 720 Q
-(AD27\(CGQ77\) / SCoPQ zone 3)-.35 E(MB-System 5.0)72 768 Q(29 No)
-132.205 E -.15(ve)-.15 G(mber 2014).15 E(29)185.545 E 0 Cg EP
-%%Page: 30 30
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<epsg2010> : N)110.5 84 Q
-(AD27\(CGQ77\) / SCoPQ zone 4)-.35 E(<epsg2011> : N)110.5 96 Q
-(AD27\(CGQ77\) / SCoPQ zone 5)-.35 E(<epsg2012> : N)110.5 108 Q
-(AD27\(CGQ77\) / SCoPQ zone 6)-.35 E(<epsg2013> : N)110.5 120 Q
-(AD27\(CGQ77\) / SCoPQ zone 7)-.35 E(<epsg2014> : N)110.5 132 Q
-(AD27\(CGQ77\) / SCoPQ zone 8)-.35 E(<epsg2015> : N)110.5 144 Q
-(AD27\(CGQ77\) / SCoPQ zone 9)-.35 E(<epsg2016> : N)110.5 156 Q
-(AD27\(CGQ77\) / SCoPQ zone 10)-.35 E(<epsg2017> : N)110.5 168 Q
-(AD27\(76\) / MTM zone 8)-.35 E(<epsg2018> : N)110.5 180 Q
-(AD27\(76\) / MTM zone 9)-.35 E(<epsg2019> : N)110.5 192 Q
-(AD27\(76\) / MTM zone 10)-.35 E(<epsg2020> : N)110.5 204 Q
-(AD27\(76\) / MTM zone 11)-.35 E(<epsg2021> : N)110.5 216 Q
-(AD27\(76\) / MTM zone 12)-.35 E(<epsg2022> : N)110.5 228 Q
-(AD27\(76\) / MTM zone 13)-.35 E(<epsg2023> : N)110.5 240 Q
-(AD27\(76\) / MTM zone 14)-.35 E(<epsg2024> : N)110.5 252 Q
-(AD27\(76\) / MTM zone 15)-.35 E(<epsg2025> : N)110.5 264 Q
-(AD27\(76\) / MTM zone 16)-.35 E(<epsg2026> : N)110.5 276 Q
-(AD27\(76\) / MTM zone 17)-.35 E(<epsg2027> : N)110.5 288 Q
-(AD27\(76\) / UTM zone 15N)-.35 E(<epsg2028> : N)110.5 300 Q
-(AD27\(76\) / UTM zone 16N)-.35 E(<epsg2029> : N)110.5 312 Q
-(AD27\(76\) / UTM zone 17N)-.35 E(<epsg2030> : N)110.5 324 Q
-(AD27\(76\) / UTM zone 18N)-.35 E(<epsg2031> : N)110.5 336 Q
-(AD27\(CGQ77\) / UTM zone 17N)-.35 E(<epsg2032> : N)110.5 348 Q
-(AD27\(CGQ77\) / UTM zone 18N)-.35 E(<epsg2033> : N)110.5 360 Q
-(AD27\(CGQ77\) / UTM zone 19N)-.35 E(<epsg2034> : N)110.5 372 Q
-(AD27\(CGQ77\) / UTM zone 20N)-.35 E(<epsg2035> : N)110.5 384 Q
-(AD27\(CGQ77\) / UTM zone 21N)-.35 E(<epsg2036> : N)110.5 396 Q
-(AD83\(CSRS98\) / Ne)-.35 E 2.5(wB)-.25 G
-(runswick Stereo \(deprecated\))-2.5 E(<epsg2037> : N)110.5 408 Q
-(AD83\(CSRS98\) / UTM zone 19N \(deprecated\))-.35 E(<epsg2038> : N)
-110.5 420 Q(AD83\(CSRS98\) / UTM zone 20N \(deprecated\))-.35 E
-(<epsg2039> : Israel / Israeli TM Grid)110.5 432 Q
-(<epsg2040> : Locodjo 1965 / UTM zone 30N)110.5 444 Q
-(<epsg2041> : Abidjan 1987 / UTM zone 30N)110.5 456 Q
-(<epsg2042> : Locodjo 1965 / UTM zone 29N)110.5 468 Q
-(<epsg2043> : Abidjan 1987 / UTM zone 29N)110.5 480 Q
-(<epsg2044> : Hanoi 1972 / Gauss-Kruger zone 18)110.5 492 Q
-(<epsg2045> : Hanoi 1972 / Gauss-Kruger zone 19)110.5 504 Q
-(<epsg2056> : CH1903+ / L)110.5 516 Q(V95)-1 E
-(<epsg2057> : Rassadiran / Nakhl e T)110.5 528 Q(aqi)-.8 E
-(<epsg2058> : ED50\(ED77\) / UTM zone 38N)110.5 540 Q
-(<epsg2059> : ED50\(ED77\) / UTM zone 39N)110.5 552 Q
-(<epsg2060> : ED50\(ED77\) / UTM zone 40N)110.5 564 Q
-(<epsg2061> : ED50\(ED77\) / UTM zone 41N)110.5 576 Q
-(<epsg2062> : Madrid 1870 \(Madrid\) / Spain)110.5 588 Q
-(<epsg2063> : Dabola 1981 / UTM zone 28N \(deprecated\))110.5 600 Q
-(<epsg2064> : Dabola 1981 / UTM zone 29N \(deprecated\))110.5 612 Q
-(<epsg2065> : S-JTSK \(Ferro\) / Kro)110.5 624 Q -.25(va)-.15 G(k).25 E
-(<epsg2066> : Mount Dillon / T)110.5 636 Q(obago Grid)-.8 E
-(<epsg2067> : Naparima 1955 / UTM zone 20N)110.5 648 Q
-(<epsg2068> : ELD79 / Libya zone 5)110.5 660 Q
-(<epsg2069> : ELD79 / Libya zone 6)110.5 672 Q
-(<epsg2070> : ELD79 / Libya zone 7)110.5 684 Q
-(<epsg2071> : ELD79 / Libya zone 8)110.5 696 Q
-(<epsg2072> : ELD79 / Libya zone 9)110.5 708 Q
-(<epsg2073> : ELD79 / Libya zone 10)110.5 720 Q(MB-System 5.0)72 768 Q
-(29 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E(30)185.545 E 0 Cg EP
-%%Page: 31 31
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<epsg2074> : ELD79 / Libya zone 11)110.5 84 Q
-(<epsg2075> : ELD79 / Libya zone 12)110.5 96 Q
-(<epsg2076> : ELD79 / Libya zone 13)110.5 108 Q
-(<epsg2077> : ELD79 / UTM zone 32N)110.5 120 Q
-(<epsg2078> : ELD79 / UTM zone 33N)110.5 132 Q
-(<epsg2079> : ELD79 / UTM zone 34N)110.5 144 Q
-(<epsg2080> : ELD79 / UTM zone 35N)110.5 156 Q
-(<epsg2081> : Chos Malal 1914 / Ar)110.5 168 Q(gentina zone 2)-.18 E
-(<epsg2082> : P)110.5 180 Q(ampa del Castillo / Ar)-.15 E
-(gentina zone 2)-.18 E(<epsg2083> : Hito XVIII 1963 / Ar)110.5 192 Q
-(gentina zone 2)-.18 E(<epsg2084> : Hito XVIII 1963 / UTM zone 19S)110.5
-204 Q(<epsg2085> : N)110.5 216 Q(AD27 / Cuba Norte)-.35 E
-(<epsg2086> : N)110.5 228 Q(AD27 / Cuba Sur)-.35 E
-(<epsg2087> : ELD79 / TM 12 NE)110.5 240 Q
-(<epsg2088> : Carthage / TM 11 NE)110.5 252 Q(<epsg2089> : Y)110.5 264 Q
-(emen NGN96 / UTM zone 38N)-1 E(<epsg2090> : Y)110.5 276 Q
-(emen NGN96 / UTM zone 39N)-1 E(<epsg2091> : South Y)110.5 288 Q
-(emen / Gauss Kruger zone 8 \(deprecated\))-1 E(<epsg2092> : South Y)
-110.5 300 Q(emen / Gauss Kruger zone 9 \(deprecated\))-1 E
-(<epsg2093> : Hanoi 1972 / GK 106 NE)110.5 312 Q
-(<epsg2094> : WGS 72BE / TM 106 NE)110.5 324 Q
-(<epsg2095> : Bissau / UTM zone 28N)110.5 336 Q(<epsg2096> : K)110.5 348
-Q(orean 1985 / K)-.35 E(orea East Belt)-.35 E(<epsg2097> : K)110.5 360 Q
-(orean 1985 / K)-.35 E(orea Central Belt)-.35 E(<epsg2098> : K)110.5 372
-Q(orean 1985 / K)-.35 E(orea W)-.35 E(est Belt)-.8 E
-(<epsg2099> : Qatar 1948 / Qatar Grid)110.5 384 Q
-(<epsg2100> : GGRS87 / Greek Grid)110.5 396 Q(<epsg2101> : Lak)110.5 408
-Q 2.5(e/M)-.1 G(aracaibo Grid M1)-2.5 E(<epsg2102> : Lak)110.5 420 Q 2.5
-(e/M)-.1 G(aracaibo Grid)-2.5 E(<epsg2103> : Lak)110.5 432 Q 2.5(e/M)-.1
-G(aracaibo Grid M3)-2.5 E(<epsg2104> : Lak)110.5 444 Q 2.5(e/M)-.1 G
-(aracaibo La Rosa Grid)-2.5 E
-(<epsg2105> : NZGD2000 / Mount Eden Circuit 2000)110.5 456 Q
-(<epsg2106> : NZGD2000 / Bay of Plenty Circuit 2000)110.5 468 Q
-(<epsg2107> : NZGD2000 / Po)110.5 480 Q -.15(ve)-.15 G
-(rty Bay Circuit 2000).15 E(<epsg2108> : NZGD2000 / Ha)110.5 492 Q(wk)
--.15 E(es Bay Circuit 2000)-.1 E(<epsg2109> : NZGD2000 / T)110.5 504 Q
-(aranaki Circuit 2000)-.8 E(<epsg2110> : NZGD2000 / T)110.5 516 Q
-(uhirangi Circuit 2000)-.45 E(<epsg2111> : NZGD2000 / W)110.5 528 Q(ang)
--.8 E(anui Circuit 2000)-.05 E(<epsg2112> : NZGD2000 / W)110.5 540 Q
-(airarapa Circuit 2000)-.8 E(<epsg2113> : NZGD2000 / W)110.5 552 Q
-(ellington Circuit 2000)-.8 E(<epsg2114> : NZGD2000 / Collingw)110.5 564
-Q(ood Circuit 2000)-.1 E(<epsg2115> : NZGD2000 / Nelson Circuit 2000)
-110.5 576 Q(<epsg2116> : NZGD2000 / Karamea Circuit 2000)110.5 588 Q
-(<epsg2117> : NZGD2000 / Buller Circuit 2000)110.5 600 Q
-(<epsg2118> : NZGD2000 / Gre)110.5 612 Q 2.5(yC)-.15 G(ircuit 2000)-2.5
-E(<epsg2119> : NZGD2000 / Amuri Circuit 2000)110.5 624 Q
-(<epsg2120> : NZGD2000 / Marlborough Circuit 2000)110.5 636 Q
-(<epsg2121> : NZGD2000 / Hokitika Circuit 2000)110.5 648 Q
-(<epsg2122> : NZGD2000 / Okarito Circuit 2000)110.5 660 Q
-(<epsg2123> : NZGD2000 / Jacksons Bay Circuit 2000)110.5 672 Q
-(<epsg2124> : NZGD2000 / Mount Pleasant Circuit 2000)110.5 684 Q
-(<epsg2125> : NZGD2000 / Ga)110.5 696 Q(wler Circuit 2000)-.15 E
-(<epsg2126> : NZGD2000 / T)110.5 708 Q(imaru Circuit 2000)-.35 E
-(<epsg2127> : NZGD2000 / Lindis Peak Circuit 2000)110.5 720 Q
-(MB-System 5.0)72 768 Q(29 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E
-(31)185.545 E 0 Cg EP
-%%Page: 32 32
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F
-(<epsg2128> : NZGD2000 / Mount Nicholas Circuit 2000)110.5 84 Q
-(<epsg2129> : NZGD2000 / Mount Y)110.5 96 Q(ork Circuit 2000)-1.1 E
-(<epsg2130> : NZGD2000 / Observ)110.5 108 Q(ation Point Circuit 2000)
--.25 E(<epsg2131> : NZGD2000 / North T)110.5 120 Q(aieri Circuit 2000)
--.8 E(<epsg2132> : NZGD2000 / Bluf)110.5 132 Q 2.5(fC)-.25 G
-(ircuit 2000)-2.5 E(<epsg2133> : NZGD2000 / UTM zone 58S)110.5 144 Q
-(<epsg2134> : NZGD2000 / UTM zone 59S)110.5 156 Q
-(<epsg2135> : NZGD2000 / UTM zone 60S)110.5 168 Q
-(<epsg2136> : Accra / Ghana National Grid)110.5 180 Q
-(<epsg2137> : Accra / TM 1 NW)110.5 192 Q(<epsg2138> : N)110.5 204 Q
-(AD27\(CGQ77\) / Quebec Lambert)-.35 E(<epsg2139> : N)110.5 216 Q
-(AD83\(CSRS98\) / SCoPQ zone 2 \(deprecated\))-.35 E(<epsg2140> : N)
-110.5 228 Q(AD83\(CSRS98\) / MTM zone 3 \(deprecated\))-.35 E
-(<epsg2141> : N)110.5 240 Q(AD83\(CSRS98\) / MTM zone 4 \(deprecated\))
--.35 E(<epsg2142> : N)110.5 252 Q
-(AD83\(CSRS98\) / MTM zone 5 \(deprecated\))-.35 E(<epsg2143> : N)110.5
-264 Q(AD83\(CSRS98\) / MTM zone 6 \(deprecated\))-.35 E(<epsg2144> : N)
-110.5 276 Q(AD83\(CSRS98\) / MTM zone 7 \(deprecated\))-.35 E
-(<epsg2145> : N)110.5 288 Q(AD83\(CSRS98\) / MTM zone 8 \(deprecated\))
--.35 E(<epsg2146> : N)110.5 300 Q
-(AD83\(CSRS98\) / MTM zone 9 \(deprecated\))-.35 E(<epsg2147> : N)110.5
-312 Q(AD83\(CSRS98\) / MTM zone 10 \(deprecated\))-.35 E(<epsg2148> : N)
-110.5 324 Q(AD83\(CSRS98\) / UTM zone 21N \(deprecated\))-.35 E
-(<epsg2149> : N)110.5 336 Q
-(AD83\(CSRS98\) / UTM zone 18N \(deprecated\))-.35 E(<epsg2150> : N)
-110.5 348 Q(AD83\(CSRS98\) / UTM zone 17N \(deprecated\))-.35 E
-(<epsg2151> : N)110.5 360 Q
-(AD83\(CSRS98\) / UTM zone 13N \(deprecated\))-.35 E(<epsg2152> : N)
-110.5 372 Q(AD83\(CSRS98\) / UTM zone 12N \(deprecated\))-.35 E
-(<epsg2153> : N)110.5 384 Q
-(AD83\(CSRS98\) / UTM zone 11N \(deprecated\))-.35 E
-(<epsg2154> : RGF93 / Lambert-93)110.5 396 Q(<epsg2155> : American Samo\
-a 1962 / American Samoa Lambert \(deprecated\))110.5 408 Q
-(<epsg2156> : N)110.5 420 Q(AD83\(HARN\) / UTM zone 59S \(deprecated\))
--.35 E(<epsg2157> : IRENET95 / Irish T)110.5 432 Q(ransv)-.35 E
-(erse Mercator)-.15 E(<epsg2158> : IRENET95 / UTM zone 29N)110.5 444 Q
-(<epsg2159> : Sierra Leone 1924 / Ne)110.5 456 Q 2.5(wC)-.25 G(olon)-2.5
-E 2.5(yG)-.15 G(rid)-2.5 E(<epsg2160> : Sierra Leone 1924 / Ne)110.5 468
-Q 2.5(wW)-.25 G(ar Of)-3.3 E(\214ce Grid)-.25 E
-(<epsg2161> : Sierra Leone 1968 / UTM zone 28N)110.5 480 Q
-(<epsg2162> : Sierra Leone 1968 / UTM zone 29N)110.5 492 Q
-(<epsg2163> : US National Atlas Equal Area)110.5 504 Q
-(<epsg2164> : Locodjo 1965 / TM 5 NW)110.5 516 Q
-(<epsg2165> : Abidjan 1987 / TM 5 NW)110.5 528 Q(<epsg2166> : Pulk)110.5
-540 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942\(83\) / Gauss Kruger zone 3 \(deprecated\))-2.5 E
-(<epsg2167> : Pulk)110.5 552 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942\(83\) / Gauss Kruger zone 4 \(deprecated\))-2.5 E
-(<epsg2168> : Pulk)110.5 564 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942\(83\) / Gauss Kruger zone 5 \(deprecated\))-2.5 E(<epsg2169> : Lux)
-110.5 576 Q(embour)-.15 E 2.5(g1)-.18 G(930 / Gauss)-2.5 E
-(<epsg2170> : MGI / Slo)110.5 588 Q -.15(ve)-.15 G(nia Grid).15 E
-(<epsg2171> : Pulk)110.5 600 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942\(58\) / Poland zone I \(deprecated\))-2.5 E(<epsg2172> : Pulk)110.5
-612 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942\(58\) / Poland zone II)-2.5 E
-(<epsg2173> : Pulk)110.5 624 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942\(58\) / Poland zone III)-2.5 E(<epsg2174> : Pulk)110.5 636 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(942\(58\) / Poland zone IV)-2.5 E
-(<epsg2175> : Pulk)110.5 648 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942\(58\) / Poland zone V)-2.5 E
-(<epsg2176> : ETRS89 / Poland CS2000 zone 5)110.5 660 Q
-(<epsg2177> : ETRS89 / Poland CS2000 zone 6)110.5 672 Q
-(<epsg2178> : ETRS89 / Poland CS2000 zone 7)110.5 684 Q
-(<epsg2179> : ETRS89 / Poland CS2000 zone 8)110.5 696 Q
-(<epsg2180> : ETRS89 / Poland CS92)110.5 708 Q
-(<epsg2188> : Azores Occidental 1939 / UTM zone 25N)110.5 720 Q
-(MB-System 5.0)72 768 Q(29 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E
-(32)185.545 E 0 Cg EP
-%%Page: 33 33
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<epsg2189> : Azores Central 1948 / UTM zone 26N)
-110.5 84 Q(<epsg2190> : Azores Oriental 1940 / UTM zone 26N)110.5 96 Q
-(<epsg2191> : Madeira 1936 / UTM zone 28N \(deprecated\))110.5 108 Q
-(<epsg2192> : ED50 / France EuroLambert)110.5 120 Q
-(<epsg2193> : NZGD2000 / Ne)110.5 132 Q 2.5(wZ)-.25 G(ealand T)-2.5 E
-(ransv)-.35 E(erse Mercator)-.15 E(<epsg2194> : American Samoa 1962 / A\
-merican Samoa Lambert \(deprecated\))110.5 144 Q(<epsg2195> : N)110.5
-156 Q(AD83\(HARN\) / UTM zone 2S)-.35 E
-(<epsg2196> : ETRS89 / Kp2000 Jutland)110.5 168 Q
-(<epsg2197> : ETRS89 / Kp2000 Zealand)110.5 180 Q
-(<epsg2198> : ETRS89 / Kp2000 Bornholm)110.5 192 Q
-(<epsg2199> : Albanian 1987 / Gauss Kruger zone 4 \(deprecated\))110.5
-204 Q(<epsg2200> : A)110.5 216 Q(TS77 / Ne)-1.11 E 2.5(wB)-.25 G
-(runswick Stereographic \(A)-2.5 E(TS77\))-1.11 E
-(<epsg2201> : REGVEN / UTM zone 18N)110.5 228 Q
-(<epsg2202> : REGVEN / UTM zone 19N)110.5 240 Q
-(<epsg2203> : REGVEN / UTM zone 20N)110.5 252 Q(<epsg2204> : N)110.5 264
-Q(AD27 / T)-.35 E(ennessee)-.7 E(<epsg2205> : N)110.5 276 Q(AD83 / K)
--.35 E(entuck)-.25 E 2.5(yN)-.15 G(orth)-2.5 E(<epsg2206> : ED50 / 3-de)
-110.5 288 Q(gree Gauss-Kruger zone 9)-.15 E(<epsg2207> : ED50 / 3-de)
-110.5 300 Q(gree Gauss-Kruger zone 10)-.15 E(<epsg2208> : ED50 / 3-de)
-110.5 312 Q(gree Gauss-Kruger zone 11)-.15 E(<epsg2209> : ED50 / 3-de)
-110.5 324 Q(gree Gauss-Kruger zone 12)-.15 E(<epsg2210> : ED50 / 3-de)
-110.5 336 Q(gree Gauss-Kruger zone 13)-.15 E(<epsg2211> : ED50 / 3-de)
-110.5 348 Q(gree Gauss-Kruger zone 14)-.15 E(<epsg2212> : ED50 / 3-de)
-110.5 360 Q(gree Gauss-Kruger zone 15)-.15 E
-(<epsg2213> : ETRS89 / TM 30 NE)110.5 372 Q
-(<epsg2214> : Douala 1948 / A)110.5 384 Q(OF west \(deprecated\))-.55 E
-(<epsg2215> : Manoca 1962 / UTM zone 32N)110.5 396 Q
-(<epsg2216> : Qornoq 1927 / UTM zone 22N)110.5 408 Q
-(<epsg2217> : Qornoq 1927 / UTM zone 23N)110.5 420 Q(<epsg2219> : A)
-110.5 432 Q(TS77 / UTM zone 19N)-1.11 E(<epsg2220> : A)110.5 444 Q
-(TS77 / UTM zone 20N)-1.11 E(<epsg2222> : N)110.5 456 Q
-(AD83 / Arizona East \(ft\))-.35 E(<epsg2223> : N)110.5 468 Q
-(AD83 / Arizona Central \(ft\))-.35 E(<epsg2224> : N)110.5 480 Q
-(AD83 / Arizona W)-.35 E(est \(ft\))-.8 E(<epsg2225> : N)110.5 492 Q
-(AD83 / California zone 1 \(ftUS\))-.35 E(<epsg2226> : N)110.5 504 Q
-(AD83 / California zone 2 \(ftUS\))-.35 E(<epsg2227> : N)110.5 516 Q
-(AD83 / California zone 3 \(ftUS\))-.35 E(<epsg2228> : N)110.5 528 Q
-(AD83 / California zone 4 \(ftUS\))-.35 E(<epsg2229> : N)110.5 540 Q
-(AD83 / California zone 5 \(ftUS\))-.35 E(<epsg2230> : N)110.5 552 Q
-(AD83 / California zone 6 \(ftUS\))-.35 E(<epsg2231> : N)110.5 564 Q
-(AD83 / Colorado North \(ftUS\))-.35 E(<epsg2232> : N)110.5 576 Q
-(AD83 / Colorado Central \(ftUS\))-.35 E(<epsg2233> : N)110.5 588 Q
-(AD83 / Colorado South \(ftUS\))-.35 E(<epsg2234> : N)110.5 600 Q
-(AD83 / Connecticut \(ftUS\))-.35 E(<epsg2235> : N)110.5 612 Q
-(AD83 / Dela)-.35 E -.1(wa)-.15 G(re \(ftUS\)).1 E(<epsg2236> : N)110.5
-624 Q(AD83 / Florida East \(ftUS\))-.35 E(<epsg2237> : N)110.5 636 Q
-(AD83 / Florida W)-.35 E(est \(ftUS\))-.8 E(<epsg2238> : N)110.5 648 Q
-(AD83 / Florida North \(ftUS\))-.35 E(<epsg2239> : N)110.5 660 Q
-(AD83 / Geor)-.35 E(gia East \(ftUS\))-.18 E(<epsg2240> : N)110.5 672 Q
-(AD83 / Geor)-.35 E(gia W)-.18 E(est \(ftUS\))-.8 E(<epsg2241> : N)110.5
-684 Q(AD83 / Idaho East \(ftUS\))-.35 E(<epsg2242> : N)110.5 696 Q
-(AD83 / Idaho Central \(ftUS\))-.35 E(<epsg2243> : N)110.5 708 Q
-(AD83 / Idaho W)-.35 E(est \(ftUS\))-.8 E(<epsg2244> : N)110.5 720 Q
-(AD83 / Indiana East \(ftUS\) \(deprecated\))-.35 E(MB-System 5.0)72 768
-Q(29 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E(33)185.545 E 0 Cg EP
-%%Page: 34 34
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<epsg2245> : N)110.5 84 Q(AD83 / Indiana W)-.35 E
-(est \(ftUS\) \(deprecated\))-.8 E(<epsg2246> : N)110.5 96 Q(AD83 / K)
--.35 E(entuck)-.25 E 2.5(yN)-.15 G(orth \(ftUS\))-2.5 E(<epsg2247> : N)
-110.5 108 Q(AD83 / K)-.35 E(entuck)-.25 E 2.5(yS)-.15 G(outh \(ftUS\))
--2.5 E(<epsg2248> : N)110.5 120 Q(AD83 / Maryland \(ftUS\))-.35 E
-(<epsg2249> : N)110.5 132 Q(AD83 / Massachusetts Mainland \(ftUS\))-.35
-E(<epsg2250> : N)110.5 144 Q(AD83 / Massachusetts Island \(ftUS\))-.35 E
-(<epsg2251> : N)110.5 156 Q(AD83 / Michig)-.35 E(an North \(ft\))-.05 E
-(<epsg2252> : N)110.5 168 Q(AD83 / Michig)-.35 E(an Central \(ft\))-.05
-E(<epsg2253> : N)110.5 180 Q(AD83 / Michig)-.35 E(an South \(ft\))-.05 E
-(<epsg2254> : N)110.5 192 Q(AD83 / Mississippi East \(ftUS\))-.35 E
-(<epsg2255> : N)110.5 204 Q(AD83 / Mississippi W)-.35 E(est \(ftUS\))-.8
-E(<epsg2256> : N)110.5 216 Q(AD83 / Montana \(ft\))-.35 E
-(<epsg2257> : N)110.5 228 Q(AD83 / Ne)-.35 E 2.5(wM)-.25 G -.15(ex)-2.5
-G(ico East \(ftUS\)).15 E(<epsg2258> : N)110.5 240 Q(AD83 / Ne)-.35 E
-2.5(wM)-.25 G -.15(ex)-2.5 G(ico Central \(ftUS\)).15 E(<epsg2259> : N)
-110.5 252 Q(AD83 / Ne)-.35 E 2.5(wM)-.25 G -.15(ex)-2.5 G(ico W).15 E
-(est \(ftUS\))-.8 E(<epsg2260> : N)110.5 264 Q(AD83 / Ne)-.35 E 2.5(wY)
--.25 G(ork East \(ftUS\))-3.6 E(<epsg2261> : N)110.5 276 Q(AD83 / Ne)
--.35 E 2.5(wY)-.25 G(ork Central \(ftUS\))-3.6 E(<epsg2262> : N)110.5
-288 Q(AD83 / Ne)-.35 E 2.5(wY)-.25 G(ork W)-3.6 E(est \(ftUS\))-.8 E
-(<epsg2263> : N)110.5 300 Q(AD83 / Ne)-.35 E 2.5(wY)-.25 G
-(ork Long Island \(ftUS\))-3.6 E(<epsg2264> : N)110.5 312 Q
-(AD83 / North Carolina \(ftUS\))-.35 E(<epsg2265> : N)110.5 324 Q
-(AD83 / North Dak)-.35 E(ota North \(ft\))-.1 E(<epsg2266> : N)110.5 336
-Q(AD83 / North Dak)-.35 E(ota South \(ft\))-.1 E(<epsg2267> : N)110.5
-348 Q(AD83 / Oklahoma North \(ftUS\))-.35 E(<epsg2268> : N)110.5 360 Q
-(AD83 / Oklahoma South \(ftUS\))-.35 E(<epsg2269> : N)110.5 372 Q
-(AD83 / Ore)-.35 E(gon North \(ft\))-.15 E(<epsg2270> : N)110.5 384 Q
-(AD83 / Ore)-.35 E(gon South \(ft\))-.15 E(<epsg2271> : N)110.5 396 Q
-(AD83 / Pennsylv)-.35 E(ania North \(ftUS\))-.25 E(<epsg2272> : N)110.5
-408 Q(AD83 / Pennsylv)-.35 E(ania South \(ftUS\))-.25 E(<epsg2273> : N)
-110.5 420 Q(AD83 / South Carolina \(ft\))-.35 E(<epsg2274> : N)110.5 432
-Q(AD83 / T)-.35 E(ennessee \(ftUS\))-.7 E(<epsg2275> : N)110.5 444 Q
-(AD83 / T)-.35 E -.15(ex)-.7 G(as North \(ftUS\)).15 E(<epsg2276> : N)
-110.5 456 Q(AD83 / T)-.35 E -.15(ex)-.7 G(as North Central \(ftUS\)).15
-E(<epsg2277> : N)110.5 468 Q(AD83 / T)-.35 E -.15(ex)-.7 G
-(as Central \(ftUS\)).15 E(<epsg2278> : N)110.5 480 Q(AD83 / T)-.35 E
--.15(ex)-.7 G(as South Central \(ftUS\)).15 E(<epsg2279> : N)110.5 492 Q
-(AD83 / T)-.35 E -.15(ex)-.7 G(as South \(ftUS\)).15 E(<epsg2280> : N)
-110.5 504 Q(AD83 / Utah North \(ft\))-.35 E(<epsg2281> : N)110.5 516 Q
-(AD83 / Utah Central \(ft\))-.35 E(<epsg2282> : N)110.5 528 Q
-(AD83 / Utah South \(ft\))-.35 E(<epsg2283> : N)110.5 540 Q(AD83 / V)
--.35 E(ir)-.6 E(ginia North \(ftUS\))-.18 E(<epsg2284> : N)110.5 552 Q
-(AD83 / V)-.35 E(ir)-.6 E(ginia South \(ftUS\))-.18 E(<epsg2285> : N)
-110.5 564 Q(AD83 / W)-.35 E(ashington North \(ftUS\))-.8 E
-(<epsg2286> : N)110.5 576 Q(AD83 / W)-.35 E(ashington South \(ftUS\))-.8
-E(<epsg2287> : N)110.5 588 Q(AD83 / W)-.35 E(isconsin North \(ftUS\))-.4
-E(<epsg2288> : N)110.5 600 Q(AD83 / W)-.35 E(isconsin Central \(ftUS\))
--.4 E(<epsg2289> : N)110.5 612 Q(AD83 / W)-.35 E
-(isconsin South \(ftUS\))-.4 E(<epsg2290> : A)110.5 624 Q
-(TS77 / Prince Edw)-1.11 E(ard Isl. Stereographic \(A)-.1 E(TS77\))-1.11
-E(<epsg2291> : N)110.5 636 Q(AD83\(CSRS98\) / Prince Edw)-.35 E
-(ard Isl. Stereographic \(N)-.1 E(AD83\) \(deprecated\))-.35 E
-(<epsg2292> : N)110.5 648 Q(AD83\(CSRS98\) / Prince Edw)-.35 E
-(ard Isl. Stereographic \(N)-.1 E(AD83\) \(deprecated\))-.35 E
-(<epsg2294> : A)110.5 660 Q(TS77 / MTM No)-1.11 E .5 -.25(va S)-.15 H
-(cotia zone 4).25 E(<epsg2295> : A)110.5 672 Q(TS77 / MTM No)-1.11 E .5
--.25(va S)-.15 H(cotia zone 5).25 E(<epsg2308> : Bata)110.5 684 Q
-(via / TM 109 SE)-.2 E(<epsg2309> : WGS 84 / TM 116 SE)110.5 696 Q
-(<epsg2310> : WGS 84 / TM 132 SE)110.5 708 Q
-(<epsg2311> : WGS 84 / TM 6 NE)110.5 720 Q(MB-System 5.0)72 768 Q(29 No)
-132.205 E -.15(ve)-.15 G(mber 2014).15 E(34)185.545 E 0 Cg EP
-%%Page: 35 35
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<epsg2312> : Garoua / UTM zone 33N)110.5 84 Q
-(<epsg2313> : K)110.5 96 Q(ousseri / UTM zone 33N)-.35 E(<epsg2314> : T)
-110.5 108 Q(rinidad 1903 / T)-.35 E(rinidad Grid \(ftCla\))-.35 E
-(<epsg2315> : Campo Inchauspe / UTM zone 19S)110.5 120 Q
-(<epsg2316> : Campo Inchauspe / UTM zone 20S)110.5 132 Q
-(<epsg2317> : PSAD56 / ICN Re)110.5 144 Q(gional)-.15 E
-(<epsg2318> : Ain el Abd / Aramco Lambert)110.5 156 Q
-(<epsg2319> : ED50 / TM27)110.5 168 Q(<epsg2320> : ED50 / TM30)110.5 180
-Q(<epsg2321> : ED50 / TM33)110.5 192 Q(<epsg2322> : ED50 / TM36)110.5
-204 Q(<epsg2323> : ED50 / TM39)110.5 216 Q(<epsg2324> : ED50 / TM42)
-110.5 228 Q(<epsg2325> : ED50 / TM45)110.5 240 Q(<epsg2326> : Hong K)
-110.5 252 Q(ong 1980 Grid System)-.35 E
-(<epsg2327> : Xian 1980 / Gauss-Kruger zone 13)110.5 264 Q
-(<epsg2328> : Xian 1980 / Gauss-Kruger zone 14)110.5 276 Q
-(<epsg2329> : Xian 1980 / Gauss-Kruger zone 15)110.5 288 Q
-(<epsg2330> : Xian 1980 / Gauss-Kruger zone 16)110.5 300 Q
-(<epsg2331> : Xian 1980 / Gauss-Kruger zone 17)110.5 312 Q
-(<epsg2332> : Xian 1980 / Gauss-Kruger zone 18)110.5 324 Q
-(<epsg2333> : Xian 1980 / Gauss-Kruger zone 19)110.5 336 Q
-(<epsg2334> : Xian 1980 / Gauss-Kruger zone 20)110.5 348 Q
-(<epsg2335> : Xian 1980 / Gauss-Kruger zone 21)110.5 360 Q
-(<epsg2336> : Xian 1980 / Gauss-Kruger zone 22)110.5 372 Q
-(<epsg2337> : Xian 1980 / Gauss-Kruger zone 23)110.5 384 Q
-(<epsg2338> : Xian 1980 / Gauss-Kruger CM 75E)110.5 396 Q
-(<epsg2339> : Xian 1980 / Gauss-Kruger CM 81E)110.5 408 Q
-(<epsg2340> : Xian 1980 / Gauss-Kruger CM 87E)110.5 420 Q
-(<epsg2341> : Xian 1980 / Gauss-Kruger CM 93E)110.5 432 Q
-(<epsg2342> : Xian 1980 / Gauss-Kruger CM 99E)110.5 444 Q
-(<epsg2343> : Xian 1980 / Gauss-Kruger CM 105E)110.5 456 Q
-(<epsg2344> : Xian 1980 / Gauss-Kruger CM 111E)110.5 468 Q
-(<epsg2345> : Xian 1980 / Gauss-Kruger CM 117E)110.5 480 Q
-(<epsg2346> : Xian 1980 / Gauss-Kruger CM 123E)110.5 492 Q
-(<epsg2347> : Xian 1980 / Gauss-Kruger CM 129E)110.5 504 Q
-(<epsg2348> : Xian 1980 / Gauss-Kruger CM 135E)110.5 516 Q
-(<epsg2349> : Xian 1980 / 3-de)110.5 528 Q(gree Gauss-Kruger zone 25)
--.15 E(<epsg2350> : Xian 1980 / 3-de)110.5 540 Q
-(gree Gauss-Kruger zone 26)-.15 E(<epsg2351> : Xian 1980 / 3-de)110.5
-552 Q(gree Gauss-Kruger zone 27)-.15 E(<epsg2352> : Xian 1980 / 3-de)
-110.5 564 Q(gree Gauss-Kruger zone 28)-.15 E
-(<epsg2353> : Xian 1980 / 3-de)110.5 576 Q(gree Gauss-Kruger zone 29)
--.15 E(<epsg2354> : Xian 1980 / 3-de)110.5 588 Q
-(gree Gauss-Kruger zone 30)-.15 E(<epsg2355> : Xian 1980 / 3-de)110.5
-600 Q(gree Gauss-Kruger zone 31)-.15 E(<epsg2356> : Xian 1980 / 3-de)
-110.5 612 Q(gree Gauss-Kruger zone 32)-.15 E
-(<epsg2357> : Xian 1980 / 3-de)110.5 624 Q(gree Gauss-Kruger zone 33)
--.15 E(<epsg2358> : Xian 1980 / 3-de)110.5 636 Q
-(gree Gauss-Kruger zone 34)-.15 E(<epsg2359> : Xian 1980 / 3-de)110.5
-648 Q(gree Gauss-Kruger zone 35)-.15 E(<epsg2360> : Xian 1980 / 3-de)
-110.5 660 Q(gree Gauss-Kruger zone 36)-.15 E
-(<epsg2361> : Xian 1980 / 3-de)110.5 672 Q(gree Gauss-Kruger zone 37)
--.15 E(<epsg2362> : Xian 1980 / 3-de)110.5 684 Q
-(gree Gauss-Kruger zone 38)-.15 E(<epsg2363> : Xian 1980 / 3-de)110.5
-696 Q(gree Gauss-Kruger zone 39)-.15 E(<epsg2364> : Xian 1980 / 3-de)
-110.5 708 Q(gree Gauss-Kruger zone 40)-.15 E
-(<epsg2365> : Xian 1980 / 3-de)110.5 720 Q(gree Gauss-Kruger zone 41)
--.15 E(MB-System 5.0)72 768 Q(29 No)132.205 E -.15(ve)-.15 G(mber 2014)
-.15 E(35)185.545 E 0 Cg EP
-%%Page: 36 36
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<epsg2366> : Xian 1980 / 3-de)110.5 84 Q
-(gree Gauss-Kruger zone 42)-.15 E(<epsg2367> : Xian 1980 / 3-de)110.5 96
-Q(gree Gauss-Kruger zone 43)-.15 E(<epsg2368> : Xian 1980 / 3-de)110.5
-108 Q(gree Gauss-Kruger zone 44)-.15 E(<epsg2369> : Xian 1980 / 3-de)
-110.5 120 Q(gree Gauss-Kruger zone 45)-.15 E
-(<epsg2370> : Xian 1980 / 3-de)110.5 132 Q(gree Gauss-Kruger CM 75E)-.15
-E(<epsg2371> : Xian 1980 / 3-de)110.5 144 Q(gree Gauss-Kruger CM 78E)
--.15 E(<epsg2372> : Xian 1980 / 3-de)110.5 156 Q
-(gree Gauss-Kruger CM 81E)-.15 E(<epsg2373> : Xian 1980 / 3-de)110.5 168
-Q(gree Gauss-Kruger CM 84E)-.15 E(<epsg2374> : Xian 1980 / 3-de)110.5
-180 Q(gree Gauss-Kruger CM 87E)-.15 E(<epsg2375> : Xian 1980 / 3-de)
-110.5 192 Q(gree Gauss-Kruger CM 90E)-.15 E
-(<epsg2376> : Xian 1980 / 3-de)110.5 204 Q(gree Gauss-Kruger CM 93E)-.15
-E(<epsg2377> : Xian 1980 / 3-de)110.5 216 Q(gree Gauss-Kruger CM 96E)
--.15 E(<epsg2378> : Xian 1980 / 3-de)110.5 228 Q
-(gree Gauss-Kruger CM 99E)-.15 E(<epsg2379> : Xian 1980 / 3-de)110.5 240
-Q(gree Gauss-Kruger CM 102E)-.15 E(<epsg2380> : Xian 1980 / 3-de)110.5
-252 Q(gree Gauss-Kruger CM 105E)-.15 E(<epsg2381> : Xian 1980 / 3-de)
-110.5 264 Q(gree Gauss-Kruger CM 108E)-.15 E
-(<epsg2382> : Xian 1980 / 3-de)110.5 276 Q(gree Gauss-Kruger CM 111E)
--.15 E(<epsg2383> : Xian 1980 / 3-de)110.5 288 Q
-(gree Gauss-Kruger CM 114E)-.15 E(<epsg2384> : Xian 1980 / 3-de)110.5
-300 Q(gree Gauss-Kruger CM 117E)-.15 E(<epsg2385> : Xian 1980 / 3-de)
-110.5 312 Q(gree Gauss-Kruger CM 120E)-.15 E
-(<epsg2386> : Xian 1980 / 3-de)110.5 324 Q(gree Gauss-Kruger CM 123E)
--.15 E(<epsg2387> : Xian 1980 / 3-de)110.5 336 Q
-(gree Gauss-Kruger CM 126E)-.15 E(<epsg2388> : Xian 1980 / 3-de)110.5
-348 Q(gree Gauss-Kruger CM 129E)-.15 E(<epsg2389> : Xian 1980 / 3-de)
-110.5 360 Q(gree Gauss-Kruger CM 132E)-.15 E
-(<epsg2390> : Xian 1980 / 3-de)110.5 372 Q(gree Gauss-Kruger CM 135E)
--.15 E(<epsg2391> : KKJ / Finland zone 1)110.5 384 Q
-(<epsg2392> : KKJ / Finland zone 2)110.5 396 Q
-(<epsg2393> : KKJ / Finland Uniform Coordinate System)110.5 408 Q
-(<epsg2394> : KKJ / Finland zone 4)110.5 420 Q(<epsg2395> : South Y)
-110.5 432 Q(emen / Gauss-Kruger zone 8)-1 E(<epsg2396> : South Y)110.5
-444 Q(emen / Gauss-Kruger zone 9)-1 E(<epsg2397> : Pulk)110.5 456 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(942\(83\) / Gauss-Kruger zone 3)-2.5 E
-(<epsg2398> : Pulk)110.5 468 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942\(83\) / Gauss-Kruger zone 4)-2.5 E(<epsg2399> : Pulk)110.5 480 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(942\(83\) / Gauss-Kruger zone 5)-2.5 E
-(<epsg2400> : R)110.5 492 Q(T90 2.5 gon W \(deprecated\))-.6 E
-(<epsg2401> : Beijing 1954 / 3-de)110.5 504 Q(gree Gauss-Kruger zone 25)
--.15 E(<epsg2402> : Beijing 1954 / 3-de)110.5 516 Q
-(gree Gauss-Kruger zone 26)-.15 E(<epsg2403> : Beijing 1954 / 3-de)110.5
-528 Q(gree Gauss-Kruger zone 27)-.15 E(<epsg2404> : Beijing 1954 / 3-de)
-110.5 540 Q(gree Gauss-Kruger zone 28)-.15 E
-(<epsg2405> : Beijing 1954 / 3-de)110.5 552 Q(gree Gauss-Kruger zone 29)
--.15 E(<epsg2406> : Beijing 1954 / 3-de)110.5 564 Q
-(gree Gauss-Kruger zone 30)-.15 E(<epsg2407> : Beijing 1954 / 3-de)110.5
-576 Q(gree Gauss-Kruger zone 31)-.15 E(<epsg2408> : Beijing 1954 / 3-de)
-110.5 588 Q(gree Gauss-Kruger zone 32)-.15 E
-(<epsg2409> : Beijing 1954 / 3-de)110.5 600 Q(gree Gauss-Kruger zone 33)
--.15 E(<epsg2410> : Beijing 1954 / 3-de)110.5 612 Q
-(gree Gauss-Kruger zone 34)-.15 E(<epsg2411> : Beijing 1954 / 3-de)110.5
-624 Q(gree Gauss-Kruger zone 35)-.15 E(<epsg2412> : Beijing 1954 / 3-de)
-110.5 636 Q(gree Gauss-Kruger zone 36)-.15 E
-(<epsg2413> : Beijing 1954 / 3-de)110.5 648 Q(gree Gauss-Kruger zone 37)
--.15 E(<epsg2414> : Beijing 1954 / 3-de)110.5 660 Q
-(gree Gauss-Kruger zone 38)-.15 E(<epsg2415> : Beijing 1954 / 3-de)110.5
-672 Q(gree Gauss-Kruger zone 39)-.15 E(<epsg2416> : Beijing 1954 / 3-de)
-110.5 684 Q(gree Gauss-Kruger zone 40)-.15 E
-(<epsg2417> : Beijing 1954 / 3-de)110.5 696 Q(gree Gauss-Kruger zone 41)
--.15 E(<epsg2418> : Beijing 1954 / 3-de)110.5 708 Q
-(gree Gauss-Kruger zone 42)-.15 E(<epsg2419> : Beijing 1954 / 3-de)110.5
-720 Q(gree Gauss-Kruger zone 43)-.15 E(MB-System 5.0)72 768 Q(29 No)
-132.205 E -.15(ve)-.15 G(mber 2014).15 E(36)185.545 E 0 Cg EP
-%%Page: 37 37
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<epsg2420> : Beijing 1954 / 3-de)110.5 84 Q
-(gree Gauss-Kruger zone 44)-.15 E(<epsg2421> : Beijing 1954 / 3-de)110.5
-96 Q(gree Gauss-Kruger zone 45)-.15 E(<epsg2422> : Beijing 1954 / 3-de)
-110.5 108 Q(gree Gauss-Kruger CM 75E)-.15 E
-(<epsg2423> : Beijing 1954 / 3-de)110.5 120 Q(gree Gauss-Kruger CM 78E)
--.15 E(<epsg2424> : Beijing 1954 / 3-de)110.5 132 Q
-(gree Gauss-Kruger CM 81E)-.15 E(<epsg2425> : Beijing 1954 / 3-de)110.5
-144 Q(gree Gauss-Kruger CM 84E)-.15 E(<epsg2426> : Beijing 1954 / 3-de)
-110.5 156 Q(gree Gauss-Kruger CM 87E)-.15 E
-(<epsg2427> : Beijing 1954 / 3-de)110.5 168 Q(gree Gauss-Kruger CM 90E)
--.15 E(<epsg2428> : Beijing 1954 / 3-de)110.5 180 Q
-(gree Gauss-Kruger CM 93E)-.15 E(<epsg2429> : Beijing 1954 / 3-de)110.5
-192 Q(gree Gauss-Kruger CM 96E)-.15 E(<epsg2430> : Beijing 1954 / 3-de)
-110.5 204 Q(gree Gauss-Kruger CM 99E)-.15 E
-(<epsg2431> : Beijing 1954 / 3-de)110.5 216 Q(gree Gauss-Kruger CM 102E)
--.15 E(<epsg2432> : Beijing 1954 / 3-de)110.5 228 Q
-(gree Gauss-Kruger CM 105E)-.15 E(<epsg2433> : Beijing 1954 / 3-de)110.5
-240 Q(gree Gauss-Kruger CM 108E)-.15 E(<epsg2434> : Beijing 1954 / 3-de)
-110.5 252 Q(gree Gauss-Kruger CM 111E)-.15 E
-(<epsg2435> : Beijing 1954 / 3-de)110.5 264 Q(gree Gauss-Kruger CM 114E)
--.15 E(<epsg2436> : Beijing 1954 / 3-de)110.5 276 Q
-(gree Gauss-Kruger CM 117E)-.15 E(<epsg2437> : Beijing 1954 / 3-de)110.5
-288 Q(gree Gauss-Kruger CM 120E)-.15 E(<epsg2438> : Beijing 1954 / 3-de)
-110.5 300 Q(gree Gauss-Kruger CM 123E)-.15 E
-(<epsg2439> : Beijing 1954 / 3-de)110.5 312 Q(gree Gauss-Kruger CM 126E)
--.15 E(<epsg2440> : Beijing 1954 / 3-de)110.5 324 Q
-(gree Gauss-Kruger CM 129E)-.15 E(<epsg2441> : Beijing 1954 / 3-de)110.5
-336 Q(gree Gauss-Kruger CM 132E)-.15 E(<epsg2442> : Beijing 1954 / 3-de)
-110.5 348 Q(gree Gauss-Kruger CM 135E)-.15 E
-(<epsg2443> : JGD2000 / Japan Plane Rectangular CS I)110.5 360 Q
-(<epsg2444> : JGD2000 / Japan Plane Rectangular CS II)110.5 372 Q
-(<epsg2445> : JGD2000 / Japan Plane Rectangular CS III)110.5 384 Q
-(<epsg2446> : JGD2000 / Japan Plane Rectangular CS IV)110.5 396 Q
-(<epsg2447> : JGD2000 / Japan Plane Rectangular CS V)110.5 408 Q
-(<epsg2448> : JGD2000 / Japan Plane Rectangular CS VI)110.5 420 Q
-(<epsg2449> : JGD2000 / Japan Plane Rectangular CS VII)110.5 432 Q
-(<epsg2450> : JGD2000 / Japan Plane Rectangular CS VIII)110.5 444 Q
-(<epsg2451> : JGD2000 / Japan Plane Rectangular CS IX)110.5 456 Q
-(<epsg2452> : JGD2000 / Japan Plane Rectangular CS X)110.5 468 Q
-(<epsg2453> : JGD2000 / Japan Plane Rectangular CS XI)110.5 480 Q
-(<epsg2454> : JGD2000 / Japan Plane Rectangular CS XII)110.5 492 Q
-(<epsg2455> : JGD2000 / Japan Plane Rectangular CS XIII)110.5 504 Q
-(<epsg2456> : JGD2000 / Japan Plane Rectangular CS XIV)110.5 516 Q
-(<epsg2457> : JGD2000 / Japan Plane Rectangular CS XV)110.5 528 Q
-(<epsg2458> : JGD2000 / Japan Plane Rectangular CS XVI)110.5 540 Q
-(<epsg2459> : JGD2000 / Japan Plane Rectangular CS XVII)110.5 552 Q
-(<epsg2460> : JGD2000 / Japan Plane Rectangular CS XVIII)110.5 564 Q
-(<epsg2461> : JGD2000 / Japan Plane Rectangular CS XIX)110.5 576 Q
-(<epsg2462> : Albanian 1987 / Gauss-Kruger zone 4)110.5 588 Q
-(<epsg2463> : Pulk)110.5 600 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger CM 21E)-2.5 E(<epsg2464> : Pulk)110.5 612 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger CM 27E)-2.5 E(<epsg2465> : Pulk)
-110.5 624 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger CM 33E)-2.5 E
-(<epsg2466> : Pulk)110.5 636 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger CM 39E)-2.5 E(<epsg2467> : Pulk)110.5 648 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger CM 45E)-2.5 E(<epsg2468> : Pulk)
-110.5 660 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger CM 51E)-2.5 E
-(<epsg2469> : Pulk)110.5 672 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger CM 57E)-2.5 E(<epsg2470> : Pulk)110.5 684 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger CM 63E)-2.5 E(<epsg2471> : Pulk)
-110.5 696 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger CM 69E)-2.5 E
-(<epsg2472> : Pulk)110.5 708 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger CM 75E)-2.5 E(<epsg2473> : Pulk)110.5 720 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger CM 81E)-2.5 E(MB-System 5.0)72
-768 Q(29 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E(37)185.545 E 0 Cg
-EP
-%%Page: 38 38
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<epsg2474> : Pulk)110.5 84 Q -.15(ov)-.1 G 2.5
-(o1)-.05 G(995 / Gauss-Kruger CM 87E)-2.5 E(<epsg2475> : Pulk)110.5 96 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger CM 93E)-2.5 E
-(<epsg2476> : Pulk)110.5 108 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger CM 99E)-2.5 E(<epsg2477> : Pulk)110.5 120 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger CM 105E)-2.5 E(<epsg2478> : Pulk)
-110.5 132 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger CM 111E)-2.5
-E(<epsg2479> : Pulk)110.5 144 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger CM 117E)-2.5 E(<epsg2480> : Pulk)110.5 156 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger CM 123E)-2.5 E
-(<epsg2481> : Pulk)110.5 168 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger CM 129E)-2.5 E(<epsg2482> : Pulk)110.5 180 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger CM 135E)-2.5 E
-(<epsg2483> : Pulk)110.5 192 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger CM 141E)-2.5 E(<epsg2484> : Pulk)110.5 204 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger CM 147E)-2.5 E
-(<epsg2485> : Pulk)110.5 216 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger CM 153E)-2.5 E(<epsg2486> : Pulk)110.5 228 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger CM 159E)-2.5 E
-(<epsg2487> : Pulk)110.5 240 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger CM 165E)-2.5 E(<epsg2488> : Pulk)110.5 252 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger CM 171E)-2.5 E
-(<epsg2489> : Pulk)110.5 264 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger CM 177E)-2.5 E(<epsg2490> : Pulk)110.5 276 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger CM 177W)-2.5 E
-(<epsg2491> : Pulk)110.5 288 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger CM 171W)-2.5 E(<epsg2492> : Pulk)110.5 300 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger CM 9E)-2.5 E
-(<epsg2493> : Pulk)110.5 312 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger CM 15E)-2.5 E(<epsg2494> : Pulk)110.5 324 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger CM 21E)-2.5 E(<epsg2495> : Pulk)
-110.5 336 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger CM 27E)-2.5 E
-(<epsg2496> : Pulk)110.5 348 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger CM 33E)-2.5 E(<epsg2497> : Pulk)110.5 360 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger CM 39E)-2.5 E(<epsg2498> : Pulk)
-110.5 372 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger CM 45E)-2.5 E
-(<epsg2499> : Pulk)110.5 384 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger CM 51E)-2.5 E(<epsg2500> : Pulk)110.5 396 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger CM 57E)-2.5 E(<epsg2501> : Pulk)
-110.5 408 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger CM 63E)-2.5 E
-(<epsg2502> : Pulk)110.5 420 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger CM 69E)-2.5 E(<epsg2503> : Pulk)110.5 432 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger CM 75E)-2.5 E(<epsg2504> : Pulk)
-110.5 444 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger CM 81E)-2.5 E
-(<epsg2505> : Pulk)110.5 456 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger CM 87E)-2.5 E(<epsg2506> : Pulk)110.5 468 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger CM 93E)-2.5 E(<epsg2507> : Pulk)
-110.5 480 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger CM 99E)-2.5 E
-(<epsg2508> : Pulk)110.5 492 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger CM 105E)-2.5 E(<epsg2509> : Pulk)110.5 504 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger CM 111E)-2.5 E
-(<epsg2510> : Pulk)110.5 516 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger CM 117E)-2.5 E(<epsg2511> : Pulk)110.5 528 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger CM 123E)-2.5 E
-(<epsg2512> : Pulk)110.5 540 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger CM 129E)-2.5 E(<epsg2513> : Pulk)110.5 552 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger CM 135E)-2.5 E
-(<epsg2514> : Pulk)110.5 564 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger CM 141E)-2.5 E(<epsg2515> : Pulk)110.5 576 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger CM 147E)-2.5 E
-(<epsg2516> : Pulk)110.5 588 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger CM 153E)-2.5 E(<epsg2517> : Pulk)110.5 600 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger CM 159E)-2.5 E
-(<epsg2518> : Pulk)110.5 612 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger CM 165E)-2.5 E(<epsg2519> : Pulk)110.5 624 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger CM 171E)-2.5 E
-(<epsg2520> : Pulk)110.5 636 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger CM 177E)-2.5 E(<epsg2521> : Pulk)110.5 648 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger CM 177W)-2.5 E
-(<epsg2522> : Pulk)110.5 660 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger CM 171W)-2.5 E(<epsg2523> : Pulk)110.5 672 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 7)-.15
-E(<epsg2524> : Pulk)110.5 684 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)
--2.5 E(gree Gauss-Kruger zone 8)-.15 E(<epsg2525> : Pulk)110.5 696 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 9)
--.15 E(<epsg2526> : Pulk)110.5 708 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 10)-.15 E(<epsg2527> : Pulk)
-110.5 720 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E
-(gree Gauss-Kruger zone 11)-.15 E(MB-System 5.0)72 768 Q(29 No)132.205 E
--.15(ve)-.15 G(mber 2014).15 E(38)185.545 E 0 Cg EP
-%%Page: 39 39
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<epsg2528> : Pulk)110.5 84 Q -.15(ov)-.1 G 2.5
-(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 12)-.15 E
-(<epsg2529> : Pulk)110.5 96 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)
--2.5 E(gree Gauss-Kruger zone 13)-.15 E(<epsg2530> : Pulk)110.5 108 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 14)
--.15 E(<epsg2531> : Pulk)110.5 120 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 15)-.15 E(<epsg2532> : Pulk)
-110.5 132 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E
-(gree Gauss-Kruger zone 16)-.15 E(<epsg2533> : Pulk)110.5 144 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 17)-.15 E
-(<epsg2534> : Pulk)110.5 156 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)
--2.5 E(gree Gauss-Kruger zone 18)-.15 E(<epsg2535> : Pulk)110.5 168 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 19)
--.15 E(<epsg2536> : Pulk)110.5 180 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 20)-.15 E(<epsg2537> : Pulk)
-110.5 192 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E
-(gree Gauss-Kruger zone 21)-.15 E(<epsg2538> : Pulk)110.5 204 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 22)-.15 E
-(<epsg2539> : Pulk)110.5 216 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)
--2.5 E(gree Gauss-Kruger zone 23)-.15 E(<epsg2540> : Pulk)110.5 228 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 24)
--.15 E(<epsg2541> : Pulk)110.5 240 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 25)-.15 E(<epsg2542> : Pulk)
-110.5 252 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E
-(gree Gauss-Kruger zone 26)-.15 E(<epsg2543> : Pulk)110.5 264 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 27)-.15 E
-(<epsg2544> : Pulk)110.5 276 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)
--2.5 E(gree Gauss-Kruger zone 28)-.15 E(<epsg2545> : Pulk)110.5 288 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 29)
--.15 E(<epsg2546> : Pulk)110.5 300 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 30)-.15 E(<epsg2547> : Pulk)
-110.5 312 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E
-(gree Gauss-Kruger zone 31)-.15 E(<epsg2548> : Pulk)110.5 324 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 32)-.15 E
-(<epsg2549> : Pulk)110.5 336 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)
--2.5 E(gree Gauss-Kruger zone 33)-.15 E
-(<epsg2550> : Samboja / UTM zone 50S \(deprecated\))110.5 348 Q
-(<epsg2551> : Pulk)110.5 360 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)
--2.5 E(gree Gauss-Kruger zone 34)-.15 E(<epsg2552> : Pulk)110.5 372 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 35)
--.15 E(<epsg2553> : Pulk)110.5 384 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 36)-.15 E(<epsg2554> : Pulk)
-110.5 396 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E
-(gree Gauss-Kruger zone 37)-.15 E(<epsg2555> : Pulk)110.5 408 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 38)-.15 E
-(<epsg2556> : Pulk)110.5 420 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)
--2.5 E(gree Gauss-Kruger zone 39)-.15 E(<epsg2557> : Pulk)110.5 432 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 40)
--.15 E(<epsg2558> : Pulk)110.5 444 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 41)-.15 E(<epsg2559> : Pulk)
-110.5 456 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E
-(gree Gauss-Kruger zone 42)-.15 E(<epsg2560> : Pulk)110.5 468 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 43)-.15 E
-(<epsg2561> : Pulk)110.5 480 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)
--2.5 E(gree Gauss-Kruger zone 44)-.15 E(<epsg2562> : Pulk)110.5 492 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 45)
--.15 E(<epsg2563> : Pulk)110.5 504 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 46)-.15 E(<epsg2564> : Pulk)
-110.5 516 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E
-(gree Gauss-Kruger zone 47)-.15 E(<epsg2565> : Pulk)110.5 528 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 48)-.15 E
-(<epsg2566> : Pulk)110.5 540 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)
--2.5 E(gree Gauss-Kruger zone 49)-.15 E(<epsg2567> : Pulk)110.5 552 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 50)
--.15 E(<epsg2568> : Pulk)110.5 564 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 51)-.15 E(<epsg2569> : Pulk)
-110.5 576 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E
-(gree Gauss-Kruger zone 52)-.15 E(<epsg2570> : Pulk)110.5 588 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 53)-.15 E
-(<epsg2571> : Pulk)110.5 600 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)
--2.5 E(gree Gauss-Kruger zone 54)-.15 E(<epsg2572> : Pulk)110.5 612 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 55)
--.15 E(<epsg2573> : Pulk)110.5 624 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 56)-.15 E(<epsg2574> : Pulk)
-110.5 636 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E
-(gree Gauss-Kruger zone 57)-.15 E(<epsg2575> : Pulk)110.5 648 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 58)-.15 E
-(<epsg2576> : Pulk)110.5 660 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)
--2.5 E(gree Gauss-Kruger zone 59)-.15 E(<epsg2577> : Pulk)110.5 672 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E
-(gree Gauss-Kruger zone 60 \(deprecated\))-.15 E(<epsg2578> : Pulk)110.5
-684 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E
-(gree Gauss-Kruger zone 61)-.15 E(<epsg2579> : Pulk)110.5 696 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 62)-.15 E
-(<epsg2580> : Pulk)110.5 708 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)
--2.5 E(gree Gauss-Kruger zone 63)-.15 E(<epsg2581> : Pulk)110.5 720 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 64)
--.15 E(MB-System 5.0)72 768 Q(29 No)132.205 E -.15(ve)-.15 G(mber 2014)
-.15 E(39)185.545 E 0 Cg EP
-%%Page: 40 40
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<epsg2582> : Pulk)110.5 84 Q -.15(ov)-.1 G 2.5
-(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 21E)-.15 E
-(<epsg2583> : Pulk)110.5 96 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)
--2.5 E(gree Gauss-Kruger CM 24E)-.15 E(<epsg2584> : Pulk)110.5 108 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 27E)
--.15 E(<epsg2585> : Pulk)110.5 120 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 30E)-.15 E(<epsg2586> : Pulk)
-110.5 132 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E
-(gree Gauss-Kruger CM 33E)-.15 E(<epsg2587> : Pulk)110.5 144 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 36E)-.15 E
-(<epsg2588> : Pulk)110.5 156 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)
--2.5 E(gree Gauss-Kruger CM 39E)-.15 E(<epsg2589> : Pulk)110.5 168 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 42E)
--.15 E(<epsg2590> : Pulk)110.5 180 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 45E)-.15 E(<epsg2591> : Pulk)
-110.5 192 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E
-(gree Gauss-Kruger CM 48E)-.15 E(<epsg2592> : Pulk)110.5 204 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 51E)-.15 E
-(<epsg2593> : Pulk)110.5 216 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)
--2.5 E(gree Gauss-Kruger CM 54E)-.15 E(<epsg2594> : Pulk)110.5 228 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 57E)
--.15 E(<epsg2595> : Pulk)110.5 240 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 60E)-.15 E(<epsg2596> : Pulk)
-110.5 252 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E
-(gree Gauss-Kruger CM 63E)-.15 E(<epsg2597> : Pulk)110.5 264 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 66E)-.15 E
-(<epsg2598> : Pulk)110.5 276 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)
--2.5 E(gree Gauss-Kruger CM 69E)-.15 E(<epsg2599> : Pulk)110.5 288 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 72E)
--.15 E(<epsg2600> : Lietuv)110.5 300 Q(os K)-.2 E
-(oordinoei Sistema 1994 \(deprecated\))-.35 E(<epsg2601> : Pulk)110.5
-312 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E
-(gree Gauss-Kruger CM 75E)-.15 E(<epsg2602> : Pulk)110.5 324 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 78E)-.15 E
-(<epsg2603> : Pulk)110.5 336 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)
--2.5 E(gree Gauss-Kruger CM 81E)-.15 E(<epsg2604> : Pulk)110.5 348 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 84E)
--.15 E(<epsg2605> : Pulk)110.5 360 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 87E)-.15 E(<epsg2606> : Pulk)
-110.5 372 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E
-(gree Gauss-Kruger CM 90E)-.15 E(<epsg2607> : Pulk)110.5 384 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 93E)-.15 E
-(<epsg2608> : Pulk)110.5 396 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)
--2.5 E(gree Gauss-Kruger CM 96E)-.15 E(<epsg2609> : Pulk)110.5 408 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 99E)
--.15 E(<epsg2610> : Pulk)110.5 420 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 102E)-.15 E(<epsg2611> : Pulk)
-110.5 432 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E
-(gree Gauss-Kruger CM 105E)-.15 E(<epsg2612> : Pulk)110.5 444 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 108E)-.15 E
-(<epsg2613> : Pulk)110.5 456 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)
--2.5 E(gree Gauss-Kruger CM 111E)-.15 E(<epsg2614> : Pulk)110.5 468 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 114E)
--.15 E(<epsg2615> : Pulk)110.5 480 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 117E)-.15 E(<epsg2616> : Pulk)
-110.5 492 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E
-(gree Gauss-Kruger CM 120E)-.15 E(<epsg2617> : Pulk)110.5 504 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 123E)-.15 E
-(<epsg2618> : Pulk)110.5 516 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)
--2.5 E(gree Gauss-Kruger CM 126E)-.15 E(<epsg2619> : Pulk)110.5 528 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 129E)
--.15 E(<epsg2620> : Pulk)110.5 540 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 132E)-.15 E(<epsg2621> : Pulk)
-110.5 552 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E
-(gree Gauss-Kruger CM 135E)-.15 E(<epsg2622> : Pulk)110.5 564 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 138E)-.15 E
-(<epsg2623> : Pulk)110.5 576 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)
--2.5 E(gree Gauss-Kruger CM 141E)-.15 E(<epsg2624> : Pulk)110.5 588 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 144E)
--.15 E(<epsg2625> : Pulk)110.5 600 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 147E)-.15 E(<epsg2626> : Pulk)
-110.5 612 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E
-(gree Gauss-Kruger CM 150E)-.15 E(<epsg2627> : Pulk)110.5 624 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 153E)-.15 E
-(<epsg2628> : Pulk)110.5 636 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)
--2.5 E(gree Gauss-Kruger CM 156E)-.15 E(<epsg2629> : Pulk)110.5 648 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 159E)
--.15 E(<epsg2630> : Pulk)110.5 660 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 162E)-.15 E(<epsg2631> : Pulk)
-110.5 672 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E
-(gree Gauss-Kruger CM 165E)-.15 E(<epsg2632> : Pulk)110.5 684 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 168E)-.15 E
-(<epsg2633> : Pulk)110.5 696 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)
--2.5 E(gree Gauss-Kruger CM 171E)-.15 E(<epsg2634> : Pulk)110.5 708 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 174E)
--.15 E(<epsg2635> : Pulk)110.5 720 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 177E)-.15 E(MB-System 5.0)72 768
-Q(29 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E(40)185.545 E 0 Cg EP
-%%Page: 41 41
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<epsg2636> : Pulk)110.5 84 Q -.15(ov)-.1 G 2.5
-(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 180E)-.15 E
-(<epsg2637> : Pulk)110.5 96 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)
--2.5 E(gree Gauss-Kruger CM 177W)-.15 E(<epsg2638> : Pulk)110.5 108 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 174W)
--.15 E(<epsg2639> : Pulk)110.5 120 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 171W)-.15 E(<epsg2640> : Pulk)
-110.5 132 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E
-(gree Gauss-Kruger CM 168W)-.15 E(<epsg2641> : Pulk)110.5 144 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 7)-.15 E
-(<epsg2642> : Pulk)110.5 156 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)
--2.5 E(gree Gauss-Kruger zone 8)-.15 E(<epsg2643> : Pulk)110.5 168 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 9)
--.15 E(<epsg2644> : Pulk)110.5 180 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 10)-.15 E(<epsg2645> : Pulk)
-110.5 192 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E
-(gree Gauss-Kruger zone 11)-.15 E(<epsg2646> : Pulk)110.5 204 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 12)-.15 E
-(<epsg2647> : Pulk)110.5 216 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)
--2.5 E(gree Gauss-Kruger zone 13)-.15 E(<epsg2648> : Pulk)110.5 228 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 14)
--.15 E(<epsg2649> : Pulk)110.5 240 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 15)-.15 E(<epsg2650> : Pulk)
-110.5 252 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E
-(gree Gauss-Kruger zone 16)-.15 E(<epsg2651> : Pulk)110.5 264 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 17)-.15 E
-(<epsg2652> : Pulk)110.5 276 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)
--2.5 E(gree Gauss-Kruger zone 18)-.15 E(<epsg2653> : Pulk)110.5 288 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 19)
--.15 E(<epsg2654> : Pulk)110.5 300 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 20)-.15 E(<epsg2655> : Pulk)
-110.5 312 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E
-(gree Gauss-Kruger zone 21)-.15 E(<epsg2656> : Pulk)110.5 324 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 22)-.15 E
-(<epsg2657> : Pulk)110.5 336 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)
--2.5 E(gree Gauss-Kruger zone 23)-.15 E(<epsg2658> : Pulk)110.5 348 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 24)
--.15 E(<epsg2659> : Pulk)110.5 360 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 25)-.15 E(<epsg2660> : Pulk)
-110.5 372 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E
-(gree Gauss-Kruger zone 26)-.15 E(<epsg2661> : Pulk)110.5 384 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 27)-.15 E
-(<epsg2662> : Pulk)110.5 396 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)
--2.5 E(gree Gauss-Kruger zone 28)-.15 E(<epsg2663> : Pulk)110.5 408 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 29)
--.15 E(<epsg2664> : Pulk)110.5 420 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 30)-.15 E(<epsg2665> : Pulk)
-110.5 432 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E
-(gree Gauss-Kruger zone 31)-.15 E(<epsg2666> : Pulk)110.5 444 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 32)-.15 E
-(<epsg2667> : Pulk)110.5 456 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)
--2.5 E(gree Gauss-Kruger zone 33)-.15 E(<epsg2668> : Pulk)110.5 468 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 34)
--.15 E(<epsg2669> : Pulk)110.5 480 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 35)-.15 E(<epsg2670> : Pulk)
-110.5 492 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E
-(gree Gauss-Kruger zone 36)-.15 E(<epsg2671> : Pulk)110.5 504 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 37)-.15 E
-(<epsg2672> : Pulk)110.5 516 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)
--2.5 E(gree Gauss-Kruger zone 38)-.15 E(<epsg2673> : Pulk)110.5 528 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 39)
--.15 E(<epsg2674> : Pulk)110.5 540 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 40)-.15 E(<epsg2675> : Pulk)
-110.5 552 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E
-(gree Gauss-Kruger zone 41)-.15 E(<epsg2676> : Pulk)110.5 564 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 42)-.15 E
-(<epsg2677> : Pulk)110.5 576 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)
--2.5 E(gree Gauss-Kruger zone 43)-.15 E(<epsg2678> : Pulk)110.5 588 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 44)
--.15 E(<epsg2679> : Pulk)110.5 600 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 45)-.15 E(<epsg2680> : Pulk)
-110.5 612 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E
-(gree Gauss-Kruger zone 46)-.15 E(<epsg2681> : Pulk)110.5 624 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 47)-.15 E
-(<epsg2682> : Pulk)110.5 636 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)
--2.5 E(gree Gauss-Kruger zone 48)-.15 E(<epsg2683> : Pulk)110.5 648 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 49)
--.15 E(<epsg2684> : Pulk)110.5 660 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 50)-.15 E(<epsg2685> : Pulk)
-110.5 672 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E
-(gree Gauss-Kruger zone 51)-.15 E(<epsg2686> : Pulk)110.5 684 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 52)-.15 E
-(<epsg2687> : Pulk)110.5 696 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)
--2.5 E(gree Gauss-Kruger zone 53)-.15 E(<epsg2688> : Pulk)110.5 708 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 54)
--.15 E(<epsg2689> : Pulk)110.5 720 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 55)-.15 E(MB-System 5.0)72 768
-Q(29 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E(41)185.545 E 0 Cg EP
-%%Page: 42 42
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<epsg2690> : Pulk)110.5 84 Q -.15(ov)-.1 G 2.5
-(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 56)-.15 E
-(<epsg2691> : Pulk)110.5 96 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)
--2.5 E(gree Gauss-Kruger zone 57)-.15 E(<epsg2692> : Pulk)110.5 108 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 58)
--.15 E(<epsg2693> : Pulk)110.5 120 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 59)-.15 E(<epsg2694> : Pulk)
-110.5 132 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E
-(gree Gauss-Kruger zone 60 \(deprecated\))-.15 E(<epsg2695> : Pulk)110.5
-144 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E
-(gree Gauss-Kruger zone 61)-.15 E(<epsg2696> : Pulk)110.5 156 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 62)-.15 E
-(<epsg2697> : Pulk)110.5 168 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)
--2.5 E(gree Gauss-Kruger zone 63)-.15 E(<epsg2698> : Pulk)110.5 180 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 64)
--.15 E(<epsg2699> : Pulk)110.5 192 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 21E)-.15 E(<epsg2700> : Pulk)
-110.5 204 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E
-(gree Gauss-Kruger CM 24E)-.15 E(<epsg2701> : Pulk)110.5 216 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 27E)-.15 E
-(<epsg2702> : Pulk)110.5 228 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)
--2.5 E(gree Gauss-Kruger CM 30E)-.15 E(<epsg2703> : Pulk)110.5 240 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 33E)
--.15 E(<epsg2704> : Pulk)110.5 252 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 36E)-.15 E(<epsg2705> : Pulk)
-110.5 264 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E
-(gree Gauss-Kruger CM 39E)-.15 E(<epsg2706> : Pulk)110.5 276 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 42E)-.15 E
-(<epsg2707> : Pulk)110.5 288 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)
--2.5 E(gree Gauss-Kruger CM 45E)-.15 E(<epsg2708> : Pulk)110.5 300 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 48E)
--.15 E(<epsg2709> : Pulk)110.5 312 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 51E)-.15 E(<epsg2710> : Pulk)
-110.5 324 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E
-(gree Gauss-Kruger CM 54E)-.15 E(<epsg2711> : Pulk)110.5 336 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 57E)-.15 E
-(<epsg2712> : Pulk)110.5 348 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)
--2.5 E(gree Gauss-Kruger CM 60E)-.15 E(<epsg2713> : Pulk)110.5 360 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 63E)
--.15 E(<epsg2714> : Pulk)110.5 372 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 66E)-.15 E(<epsg2715> : Pulk)
-110.5 384 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E
-(gree Gauss-Kruger CM 69E)-.15 E(<epsg2716> : Pulk)110.5 396 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 72E)-.15 E
-(<epsg2717> : Pulk)110.5 408 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)
--2.5 E(gree Gauss-Kruger CM 75E)-.15 E(<epsg2718> : Pulk)110.5 420 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 78E)
--.15 E(<epsg2719> : Pulk)110.5 432 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 81E)-.15 E(<epsg2720> : Pulk)
-110.5 444 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E
-(gree Gauss-Kruger CM 84E)-.15 E(<epsg2721> : Pulk)110.5 456 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 87E)-.15 E
-(<epsg2722> : Pulk)110.5 468 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)
--2.5 E(gree Gauss-Kruger CM 90E)-.15 E(<epsg2723> : Pulk)110.5 480 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 93E)
--.15 E(<epsg2724> : Pulk)110.5 492 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 96E)-.15 E(<epsg2725> : Pulk)
-110.5 504 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E
-(gree Gauss-Kruger CM 99E)-.15 E(<epsg2726> : Pulk)110.5 516 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 102E)-.15 E
-(<epsg2727> : Pulk)110.5 528 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)
--2.5 E(gree Gauss-Kruger CM 105E)-.15 E(<epsg2728> : Pulk)110.5 540 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 108E)
--.15 E(<epsg2729> : Pulk)110.5 552 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 111E)-.15 E(<epsg2730> : Pulk)
-110.5 564 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E
-(gree Gauss-Kruger CM 114E)-.15 E(<epsg2731> : Pulk)110.5 576 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 117E)-.15 E
-(<epsg2732> : Pulk)110.5 588 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)
--2.5 E(gree Gauss-Kruger CM 120E)-.15 E(<epsg2733> : Pulk)110.5 600 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 123E)
--.15 E(<epsg2734> : Pulk)110.5 612 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 126E)-.15 E(<epsg2735> : Pulk)
-110.5 624 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E
-(gree Gauss-Kruger CM 129E)-.15 E(<epsg2736> : T)110.5 636 Q
-(ete / UTM zone 36S)-.7 E(<epsg2737> : T)110.5 648 Q(ete / UTM zone 37S)
--.7 E(<epsg2738> : Pulk)110.5 660 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 132E)-.15 E(<epsg2739> : Pulk)
-110.5 672 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E
-(gree Gauss-Kruger CM 135E)-.15 E(<epsg2740> : Pulk)110.5 684 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 138E)-.15 E
-(<epsg2741> : Pulk)110.5 696 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)
--2.5 E(gree Gauss-Kruger CM 141E)-.15 E(<epsg2742> : Pulk)110.5 708 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 144E)
--.15 E(<epsg2743> : Pulk)110.5 720 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 147E)-.15 E(MB-System 5.0)72 768
-Q(29 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E(42)185.545 E 0 Cg EP
-%%Page: 43 43
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<epsg2744> : Pulk)110.5 84 Q -.15(ov)-.1 G 2.5
-(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 150E)-.15 E
-(<epsg2745> : Pulk)110.5 96 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)
--2.5 E(gree Gauss-Kruger CM 153E)-.15 E(<epsg2746> : Pulk)110.5 108 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 156E)
--.15 E(<epsg2747> : Pulk)110.5 120 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 159E)-.15 E(<epsg2748> : Pulk)
-110.5 132 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E
-(gree Gauss-Kruger CM 162E)-.15 E(<epsg2749> : Pulk)110.5 144 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 165E)-.15 E
-(<epsg2750> : Pulk)110.5 156 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)
--2.5 E(gree Gauss-Kruger CM 168E)-.15 E(<epsg2751> : Pulk)110.5 168 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 171E)
--.15 E(<epsg2752> : Pulk)110.5 180 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 174E)-.15 E(<epsg2753> : Pulk)
-110.5 192 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E
-(gree Gauss-Kruger CM 177E)-.15 E(<epsg2754> : Pulk)110.5 204 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 180E)-.15 E
-(<epsg2755> : Pulk)110.5 216 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)
--2.5 E(gree Gauss-Kruger CM 177W)-.15 E(<epsg2756> : Pulk)110.5 228 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 174W)
--.15 E(<epsg2757> : Pulk)110.5 240 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 171W)-.15 E(<epsg2758> : Pulk)
-110.5 252 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E
-(gree Gauss-Kruger CM 168W)-.15 E(<epsg2759> : N)110.5 264 Q
-(AD83\(HARN\) / Alabama East)-.35 E(<epsg2760> : N)110.5 276 Q
-(AD83\(HARN\) / Alabama W)-.35 E(est)-.8 E(<epsg2761> : N)110.5 288 Q
-(AD83\(HARN\) / Arizona East)-.35 E(<epsg2762> : N)110.5 300 Q
-(AD83\(HARN\) / Arizona Central)-.35 E(<epsg2763> : N)110.5 312 Q
-(AD83\(HARN\) / Arizona W)-.35 E(est)-.8 E(<epsg2764> : N)110.5 324 Q
-(AD83\(HARN\) / Arkansas North)-.35 E(<epsg2765> : N)110.5 336 Q
-(AD83\(HARN\) / Arkansas South)-.35 E(<epsg2766> : N)110.5 348 Q
-(AD83\(HARN\) / California zone 1)-.35 E(<epsg2767> : N)110.5 360 Q
-(AD83\(HARN\) / California zone 2)-.35 E(<epsg2768> : N)110.5 372 Q
-(AD83\(HARN\) / California zone 3)-.35 E(<epsg2769> : N)110.5 384 Q
-(AD83\(HARN\) / California zone 4)-.35 E(<epsg2770> : N)110.5 396 Q
-(AD83\(HARN\) / California zone 5)-.35 E(<epsg2771> : N)110.5 408 Q
-(AD83\(HARN\) / California zone 6)-.35 E(<epsg2772> : N)110.5 420 Q
-(AD83\(HARN\) / Colorado North)-.35 E(<epsg2773> : N)110.5 432 Q
-(AD83\(HARN\) / Colorado Central)-.35 E(<epsg2774> : N)110.5 444 Q
-(AD83\(HARN\) / Colorado South)-.35 E(<epsg2775> : N)110.5 456 Q
-(AD83\(HARN\) / Connecticut)-.35 E(<epsg2776> : N)110.5 468 Q
-(AD83\(HARN\) / Dela)-.35 E -.1(wa)-.15 G(re).1 E(<epsg2777> : N)110.5
-480 Q(AD83\(HARN\) / Florida East)-.35 E(<epsg2778> : N)110.5 492 Q
-(AD83\(HARN\) / Florida W)-.35 E(est)-.8 E(<epsg2779> : N)110.5 504 Q
-(AD83\(HARN\) / Florida North)-.35 E(<epsg2780> : N)110.5 516 Q
-(AD83\(HARN\) / Geor)-.35 E(gia East)-.18 E(<epsg2781> : N)110.5 528 Q
-(AD83\(HARN\) / Geor)-.35 E(gia W)-.18 E(est)-.8 E(<epsg2782> : N)110.5
-540 Q(AD83\(HARN\) / Ha)-.35 E -.1(wa)-.15 G(ii zone 1).1 E
-(<epsg2783> : N)110.5 552 Q(AD83\(HARN\) / Ha)-.35 E -.1(wa)-.15 G
-(ii zone 2).1 E(<epsg2784> : N)110.5 564 Q(AD83\(HARN\) / Ha)-.35 E -.1
-(wa)-.15 G(ii zone 3).1 E(<epsg2785> : N)110.5 576 Q(AD83\(HARN\) / Ha)
--.35 E -.1(wa)-.15 G(ii zone 4).1 E(<epsg2786> : N)110.5 588 Q
-(AD83\(HARN\) / Ha)-.35 E -.1(wa)-.15 G(ii zone 5).1 E(<epsg2787> : N)
-110.5 600 Q(AD83\(HARN\) / Idaho East)-.35 E(<epsg2788> : N)110.5 612 Q
-(AD83\(HARN\) / Idaho Central)-.35 E(<epsg2789> : N)110.5 624 Q
-(AD83\(HARN\) / Idaho W)-.35 E(est)-.8 E(<epsg2790> : N)110.5 636 Q
-(AD83\(HARN\) / Illinois East)-.35 E(<epsg2791> : N)110.5 648 Q
-(AD83\(HARN\) / Illinois W)-.35 E(est)-.8 E(<epsg2792> : N)110.5 660 Q
-(AD83\(HARN\) / Indiana East)-.35 E(<epsg2793> : N)110.5 672 Q
-(AD83\(HARN\) / Indiana W)-.35 E(est)-.8 E(<epsg2794> : N)110.5 684 Q
-(AD83\(HARN\) / Io)-.35 E .2 -.1(wa N)-.25 H(orth).1 E(<epsg2795> : N)
-110.5 696 Q(AD83\(HARN\) / Io)-.35 E .2 -.1(wa S)-.25 H(outh).1 E
-(<epsg2796> : N)110.5 708 Q(AD83\(HARN\) / Kansas North)-.35 E
-(<epsg2797> : N)110.5 720 Q(AD83\(HARN\) / Kansas South)-.35 E
-(MB-System 5.0)72 768 Q(29 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E
-(43)185.545 E 0 Cg EP
-%%Page: 44 44
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<epsg2798> : N)110.5 84 Q(AD83\(HARN\) / K)-.35 E
-(entuck)-.25 E 2.5(yN)-.15 G(orth)-2.5 E(<epsg2799> : N)110.5 96 Q
-(AD83\(HARN\) / K)-.35 E(entuck)-.25 E 2.5(yS)-.15 G(outh)-2.5 E
-(<epsg2800> : N)110.5 108 Q(AD83\(HARN\) / Louisiana North)-.35 E
-(<epsg2801> : N)110.5 120 Q(AD83\(HARN\) / Louisiana South)-.35 E
-(<epsg2802> : N)110.5 132 Q(AD83\(HARN\) / Maine East)-.35 E
-(<epsg2803> : N)110.5 144 Q(AD83\(HARN\) / Maine W)-.35 E(est)-.8 E
-(<epsg2804> : N)110.5 156 Q(AD83\(HARN\) / Maryland)-.35 E
-(<epsg2805> : N)110.5 168 Q(AD83\(HARN\) / Massachusetts Mainland)-.35 E
-(<epsg2806> : N)110.5 180 Q(AD83\(HARN\) / Massachusetts Island)-.35 E
-(<epsg2807> : N)110.5 192 Q(AD83\(HARN\) / Michig)-.35 E(an North)-.05 E
-(<epsg2808> : N)110.5 204 Q(AD83\(HARN\) / Michig)-.35 E(an Central)-.05
-E(<epsg2809> : N)110.5 216 Q(AD83\(HARN\) / Michig)-.35 E(an South)-.05
-E(<epsg2810> : N)110.5 228 Q(AD83\(HARN\) / Minnesota North)-.35 E
-(<epsg2811> : N)110.5 240 Q(AD83\(HARN\) / Minnesota Central)-.35 E
-(<epsg2812> : N)110.5 252 Q(AD83\(HARN\) / Minnesota South)-.35 E
-(<epsg2813> : N)110.5 264 Q(AD83\(HARN\) / Mississippi East)-.35 E
-(<epsg2814> : N)110.5 276 Q(AD83\(HARN\) / Mississippi W)-.35 E(est)-.8
-E(<epsg2815> : N)110.5 288 Q(AD83\(HARN\) / Missouri East)-.35 E
-(<epsg2816> : N)110.5 300 Q(AD83\(HARN\) / Missouri Central)-.35 E
-(<epsg2817> : N)110.5 312 Q(AD83\(HARN\) / Missouri W)-.35 E(est)-.8 E
-(<epsg2818> : N)110.5 324 Q(AD83\(HARN\) / Montana)-.35 E
-(<epsg2819> : N)110.5 336 Q(AD83\(HARN\) / Nebraska)-.35 E
-(<epsg2820> : N)110.5 348 Q(AD83\(HARN\) / Ne)-.35 E -.25(va)-.25 G
-(da East).25 E(<epsg2821> : N)110.5 360 Q(AD83\(HARN\) / Ne)-.35 E -.25
-(va)-.25 G(da Central).25 E(<epsg2822> : N)110.5 372 Q
-(AD83\(HARN\) / Ne)-.35 E -.25(va)-.25 G(da W).25 E(est)-.8 E
-(<epsg2823> : N)110.5 384 Q(AD83\(HARN\) / Ne)-.35 E 2.5(wH)-.25 G
-(ampshire)-2.5 E(<epsg2824> : N)110.5 396 Q(AD83\(HARN\) / Ne)-.35 E 2.5
-(wJ)-.25 G(erse)-2.5 E(y)-.15 E(<epsg2825> : N)110.5 408 Q
-(AD83\(HARN\) / Ne)-.35 E 2.5(wM)-.25 G -.15(ex)-2.5 G(ico East).15 E
-(<epsg2826> : N)110.5 420 Q(AD83\(HARN\) / Ne)-.35 E 2.5(wM)-.25 G -.15
-(ex)-2.5 G(ico Central).15 E(<epsg2827> : N)110.5 432 Q
-(AD83\(HARN\) / Ne)-.35 E 2.5(wM)-.25 G -.15(ex)-2.5 G(ico W).15 E(est)
--.8 E(<epsg2828> : N)110.5 444 Q(AD83\(HARN\) / Ne)-.35 E 2.5(wY)-.25 G
-(ork East)-3.6 E(<epsg2829> : N)110.5 456 Q(AD83\(HARN\) / Ne)-.35 E 2.5
-(wY)-.25 G(ork Central)-3.6 E(<epsg2830> : N)110.5 468 Q
-(AD83\(HARN\) / Ne)-.35 E 2.5(wY)-.25 G(ork W)-3.6 E(est)-.8 E
-(<epsg2831> : N)110.5 480 Q(AD83\(HARN\) / Ne)-.35 E 2.5(wY)-.25 G
-(ork Long Island)-3.6 E(<epsg2832> : N)110.5 492 Q
-(AD83\(HARN\) / North Dak)-.35 E(ota North)-.1 E(<epsg2833> : N)110.5
-504 Q(AD83\(HARN\) / North Dak)-.35 E(ota South)-.1 E(<epsg2834> : N)
-110.5 516 Q(AD83\(HARN\) / Ohio North)-.35 E(<epsg2835> : N)110.5 528 Q
-(AD83\(HARN\) / Ohio South)-.35 E(<epsg2836> : N)110.5 540 Q
-(AD83\(HARN\) / Oklahoma North)-.35 E(<epsg2837> : N)110.5 552 Q
-(AD83\(HARN\) / Oklahoma South)-.35 E(<epsg2838> : N)110.5 564 Q
-(AD83\(HARN\) / Ore)-.35 E(gon North)-.15 E(<epsg2839> : N)110.5 576 Q
-(AD83\(HARN\) / Ore)-.35 E(gon South)-.15 E(<epsg2840> : N)110.5 588 Q
-(AD83\(HARN\) / Rhode Island)-.35 E(<epsg2841> : N)110.5 600 Q
-(AD83\(HARN\) / South Dak)-.35 E(ota North)-.1 E(<epsg2842> : N)110.5
-612 Q(AD83\(HARN\) / South Dak)-.35 E(ota South)-.1 E(<epsg2843> : N)
-110.5 624 Q(AD83\(HARN\) / T)-.35 E(ennessee)-.7 E(<epsg2844> : N)110.5
-636 Q(AD83\(HARN\) / T)-.35 E -.15(ex)-.7 G(as North).15 E
-(<epsg2845> : N)110.5 648 Q(AD83\(HARN\) / T)-.35 E -.15(ex)-.7 G
-(as North Central).15 E(<epsg2846> : N)110.5 660 Q(AD83\(HARN\) / T)-.35
-E -.15(ex)-.7 G(as Central).15 E(<epsg2847> : N)110.5 672 Q
-(AD83\(HARN\) / T)-.35 E -.15(ex)-.7 G(as South Central).15 E
-(<epsg2848> : N)110.5 684 Q(AD83\(HARN\) / T)-.35 E -.15(ex)-.7 G
-(as South).15 E(<epsg2849> : N)110.5 696 Q(AD83\(HARN\) / Utah North)
--.35 E(<epsg2850> : N)110.5 708 Q(AD83\(HARN\) / Utah Central)-.35 E
-(<epsg2851> : N)110.5 720 Q(AD83\(HARN\) / Utah South)-.35 E
-(MB-System 5.0)72 768 Q(29 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E
-(44)185.545 E 0 Cg EP
-%%Page: 45 45
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<epsg2852> : N)110.5 84 Q(AD83\(HARN\) / V)-.35 E
-(ermont)-1.11 E(<epsg2853> : N)110.5 96 Q(AD83\(HARN\) / V)-.35 E(ir)-.6
-E(ginia North)-.18 E(<epsg2854> : N)110.5 108 Q(AD83\(HARN\) / V)-.35 E
-(ir)-.6 E(ginia South)-.18 E(<epsg2855> : N)110.5 120 Q
-(AD83\(HARN\) / W)-.35 E(ashington North)-.8 E(<epsg2856> : N)110.5 132
-Q(AD83\(HARN\) / W)-.35 E(ashington South)-.8 E(<epsg2857> : N)110.5 144
-Q(AD83\(HARN\) / W)-.35 E(est V)-.8 E(ir)-.6 E(ginia North)-.18 E
-(<epsg2858> : N)110.5 156 Q(AD83\(HARN\) / W)-.35 E(est V)-.8 E(ir)-.6 E
-(ginia South)-.18 E(<epsg2859> : N)110.5 168 Q(AD83\(HARN\) / W)-.35 E
-(isconsin North)-.4 E(<epsg2860> : N)110.5 180 Q(AD83\(HARN\) / W)-.35 E
-(isconsin Central)-.4 E(<epsg2861> : N)110.5 192 Q(AD83\(HARN\) / W)-.35
-E(isconsin South)-.4 E(<epsg2862> : N)110.5 204 Q(AD83\(HARN\) / W)-.35
-E(yoming East)-.73 E(<epsg2863> : N)110.5 216 Q(AD83\(HARN\) / W)-.35 E
-(yoming East Central)-.73 E(<epsg2864> : N)110.5 228 Q(AD83\(HARN\) / W)
--.35 E(yoming W)-.73 E(est Central)-.8 E(<epsg2865> : N)110.5 240 Q
-(AD83\(HARN\) / W)-.35 E(yoming W)-.73 E(est)-.8 E(<epsg2866> : N)110.5
-252 Q(AD83\(HARN\) / Puerto Rico & V)-.35 E(ir)-.6 E(gin Is.)-.18 E
-(<epsg2867> : N)110.5 264 Q(AD83\(HARN\) / Arizona East \(ft\))-.35 E
-(<epsg2868> : N)110.5 276 Q(AD83\(HARN\) / Arizona Central \(ft\))-.35 E
-(<epsg2869> : N)110.5 288 Q(AD83\(HARN\) / Arizona W)-.35 E(est \(ft\))
--.8 E(<epsg2870> : N)110.5 300 Q
-(AD83\(HARN\) / California zone 1 \(ftUS\))-.35 E(<epsg2871> : N)110.5
-312 Q(AD83\(HARN\) / California zone 2 \(ftUS\))-.35 E(<epsg2872> : N)
-110.5 324 Q(AD83\(HARN\) / California zone 3 \(ftUS\))-.35 E
-(<epsg2873> : N)110.5 336 Q(AD83\(HARN\) / California zone 4 \(ftUS\))
--.35 E(<epsg2874> : N)110.5 348 Q
-(AD83\(HARN\) / California zone 5 \(ftUS\))-.35 E(<epsg2875> : N)110.5
-360 Q(AD83\(HARN\) / California zone 6 \(ftUS\))-.35 E(<epsg2876> : N)
-110.5 372 Q(AD83\(HARN\) / Colorado North \(ftUS\))-.35 E
-(<epsg2877> : N)110.5 384 Q(AD83\(HARN\) / Colorado Central \(ftUS\))
--.35 E(<epsg2878> : N)110.5 396 Q
-(AD83\(HARN\) / Colorado South \(ftUS\))-.35 E(<epsg2879> : N)110.5 408
-Q(AD83\(HARN\) / Connecticut \(ftUS\))-.35 E(<epsg2880> : N)110.5 420 Q
-(AD83\(HARN\) / Dela)-.35 E -.1(wa)-.15 G(re \(ftUS\)).1 E
-(<epsg2881> : N)110.5 432 Q(AD83\(HARN\) / Florida East \(ftUS\))-.35 E
-(<epsg2882> : N)110.5 444 Q(AD83\(HARN\) / Florida W)-.35 E
-(est \(ftUS\))-.8 E(<epsg2883> : N)110.5 456 Q
-(AD83\(HARN\) / Florida North \(ftUS\))-.35 E(<epsg2884> : N)110.5 468 Q
-(AD83\(HARN\) / Geor)-.35 E(gia East \(ftUS\))-.18 E(<epsg2885> : N)
-110.5 480 Q(AD83\(HARN\) / Geor)-.35 E(gia W)-.18 E(est \(ftUS\))-.8 E
-(<epsg2886> : N)110.5 492 Q(AD83\(HARN\) / Idaho East \(ftUS\))-.35 E
-(<epsg2887> : N)110.5 504 Q(AD83\(HARN\) / Idaho Central \(ftUS\))-.35 E
-(<epsg2888> : N)110.5 516 Q(AD83\(HARN\) / Idaho W)-.35 E(est \(ftUS\))
--.8 E(<epsg2889> : N)110.5 528 Q
-(AD83\(HARN\) / Indiana East \(ftUS\) \(deprecated\))-.35 E
-(<epsg2890> : N)110.5 540 Q(AD83\(HARN\) / Indiana W)-.35 E
-(est \(ftUS\) \(deprecated\))-.8 E(<epsg2891> : N)110.5 552 Q
-(AD83\(HARN\) / K)-.35 E(entuck)-.25 E 2.5(yN)-.15 G(orth \(ftUS\))-2.5
-E(<epsg2892> : N)110.5 564 Q(AD83\(HARN\) / K)-.35 E(entuck)-.25 E 2.5
-(yS)-.15 G(outh \(ftUS\))-2.5 E(<epsg2893> : N)110.5 576 Q
-(AD83\(HARN\) / Maryland \(ftUS\))-.35 E(<epsg2894> : N)110.5 588 Q
-(AD83\(HARN\) / Massachusetts Mainland \(ftUS\))-.35 E(<epsg2895> : N)
-110.5 600 Q(AD83\(HARN\) / Massachusetts Island \(ftUS\))-.35 E
-(<epsg2896> : N)110.5 612 Q(AD83\(HARN\) / Michig)-.35 E
-(an North \(ft\))-.05 E(<epsg2897> : N)110.5 624 Q
-(AD83\(HARN\) / Michig)-.35 E(an Central \(ft\))-.05 E(<epsg2898> : N)
-110.5 636 Q(AD83\(HARN\) / Michig)-.35 E(an South \(ft\))-.05 E
-(<epsg2899> : N)110.5 648 Q(AD83\(HARN\) / Mississippi East \(ftUS\))
--.35 E(<epsg2900> : N)110.5 660 Q(AD83\(HARN\) / Mississippi W)-.35 E
-(est \(ftUS\))-.8 E(<epsg2901> : N)110.5 672 Q
-(AD83\(HARN\) / Montana \(ft\))-.35 E(<epsg2902> : N)110.5 684 Q
-(AD83\(HARN\) / Ne)-.35 E 2.5(wM)-.25 G -.15(ex)-2.5 G
-(ico East \(ftUS\)).15 E(<epsg2903> : N)110.5 696 Q(AD83\(HARN\) / Ne)
--.35 E 2.5(wM)-.25 G -.15(ex)-2.5 G(ico Central \(ftUS\)).15 E
-(<epsg2904> : N)110.5 708 Q(AD83\(HARN\) / Ne)-.35 E 2.5(wM)-.25 G -.15
-(ex)-2.5 G(ico W).15 E(est \(ftUS\))-.8 E(<epsg2905> : N)110.5 720 Q
-(AD83\(HARN\) / Ne)-.35 E 2.5(wY)-.25 G(ork East \(ftUS\))-3.6 E
-(MB-System 5.0)72 768 Q(29 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E
-(45)185.545 E 0 Cg EP
-%%Page: 46 46
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<epsg2906> : N)110.5 84 Q(AD83\(HARN\) / Ne)-.35
-E 2.5(wY)-.25 G(ork Central \(ftUS\))-3.6 E(<epsg2907> : N)110.5 96 Q
-(AD83\(HARN\) / Ne)-.35 E 2.5(wY)-.25 G(ork W)-3.6 E(est \(ftUS\))-.8 E
-(<epsg2908> : N)110.5 108 Q(AD83\(HARN\) / Ne)-.35 E 2.5(wY)-.25 G
-(ork Long Island \(ftUS\))-3.6 E(<epsg2909> : N)110.5 120 Q
-(AD83\(HARN\) / North Dak)-.35 E(ota North \(ft\))-.1 E(<epsg2910> : N)
-110.5 132 Q(AD83\(HARN\) / North Dak)-.35 E(ota South \(ft\))-.1 E
-(<epsg2911> : N)110.5 144 Q(AD83\(HARN\) / Oklahoma North \(ftUS\))-.35
-E(<epsg2912> : N)110.5 156 Q(AD83\(HARN\) / Oklahoma South \(ftUS\))-.35
-E(<epsg2913> : N)110.5 168 Q(AD83\(HARN\) / Ore)-.35 E(gon North \(ft\))
--.15 E(<epsg2914> : N)110.5 180 Q(AD83\(HARN\) / Ore)-.35 E
-(gon South \(ft\))-.15 E(<epsg2915> : N)110.5 192 Q(AD83\(HARN\) / T)
--.35 E(ennessee \(ftUS\))-.7 E(<epsg2916> : N)110.5 204 Q
-(AD83\(HARN\) / T)-.35 E -.15(ex)-.7 G(as North \(ftUS\)).15 E
-(<epsg2917> : N)110.5 216 Q(AD83\(HARN\) / T)-.35 E -.15(ex)-.7 G
-(as North Central \(ftUS\)).15 E(<epsg2918> : N)110.5 228 Q
-(AD83\(HARN\) / T)-.35 E -.15(ex)-.7 G(as Central \(ftUS\)).15 E
-(<epsg2919> : N)110.5 240 Q(AD83\(HARN\) / T)-.35 E -.15(ex)-.7 G
-(as South Central \(ftUS\)).15 E(<epsg2920> : N)110.5 252 Q
-(AD83\(HARN\) / T)-.35 E -.15(ex)-.7 G(as South \(ftUS\)).15 E
-(<epsg2921> : N)110.5 264 Q(AD83\(HARN\) / Utah North \(ft\))-.35 E
-(<epsg2922> : N)110.5 276 Q(AD83\(HARN\) / Utah Central \(ft\))-.35 E
-(<epsg2923> : N)110.5 288 Q(AD83\(HARN\) / Utah South \(ft\))-.35 E
-(<epsg2924> : N)110.5 300 Q(AD83\(HARN\) / V)-.35 E(ir)-.6 E
-(ginia North \(ftUS\))-.18 E(<epsg2925> : N)110.5 312 Q
-(AD83\(HARN\) / V)-.35 E(ir)-.6 E(ginia South \(ftUS\))-.18 E
-(<epsg2926> : N)110.5 324 Q(AD83\(HARN\) / W)-.35 E
-(ashington North \(ftUS\))-.8 E(<epsg2927> : N)110.5 336 Q
-(AD83\(HARN\) / W)-.35 E(ashington South \(ftUS\))-.8 E(<epsg2928> : N)
-110.5 348 Q(AD83\(HARN\) / W)-.35 E(isconsin North \(ftUS\))-.4 E
-(<epsg2929> : N)110.5 360 Q(AD83\(HARN\) / W)-.35 E
-(isconsin Central \(ftUS\))-.4 E(<epsg2930> : N)110.5 372 Q
-(AD83\(HARN\) / W)-.35 E(isconsin South \(ftUS\))-.4 E
-(<epsg2931> : Beduaram / TM 13 NE)110.5 384 Q
-(<epsg2932> : QND95 / Qatar National Grid)110.5 396 Q(<epsg2933> : Se)
-110.5 408 Q -.05(ga)-.15 G(ra / UTM zone 50S).05 E(<epsg2934> : Se)110.5
-420 Q -.05(ga)-.15 G(ra \(Jakarta\) / NEIEZ \(deprecated\)).05 E
-(<epsg2935> : Pulk)110.5 432 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / CS63 zone A1)-2.5 E(<epsg2936> : Pulk)110.5 444 Q -.15(ov)-.1 G
-2.5(o1)-.05 G(942 / CS63 zone A2)-2.5 E(<epsg2937> : Pulk)110.5 456 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(942 / CS63 zone A3)-2.5 E(<epsg2938> : Pulk)
-110.5 468 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / CS63 zone A4)-2.5 E
-(<epsg2939> : Pulk)110.5 480 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / CS63 zone K2)-2.5 E(<epsg2940> : Pulk)110.5 492 Q -.15(ov)-.1 G
-2.5(o1)-.05 G(942 / CS63 zone K3)-2.5 E(<epsg2941> : Pulk)110.5 504 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(942 / CS63 zone K4)-2.5 E
-(<epsg2942> : Porto Santo / UTM zone 28N)110.5 516 Q(<epsg2943> : Selv)
-110.5 528 Q(agem Grande / UTM zone 28N)-.25 E(<epsg2944> : N)110.5 540 Q
-(AD83\(CSRS\) / SCoPQ zone 2)-.35 E(<epsg2945> : N)110.5 552 Q
-(AD83\(CSRS\) / MTM zone 3)-.35 E(<epsg2946> : N)110.5 564 Q
-(AD83\(CSRS\) / MTM zone 4)-.35 E(<epsg2947> : N)110.5 576 Q
-(AD83\(CSRS\) / MTM zone 5)-.35 E(<epsg2948> : N)110.5 588 Q
-(AD83\(CSRS\) / MTM zone 6)-.35 E(<epsg2949> : N)110.5 600 Q
-(AD83\(CSRS\) / MTM zone 7)-.35 E(<epsg2950> : N)110.5 612 Q
-(AD83\(CSRS\) / MTM zone 8)-.35 E(<epsg2951> : N)110.5 624 Q
-(AD83\(CSRS\) / MTM zone 9)-.35 E(<epsg2952> : N)110.5 636 Q
-(AD83\(CSRS\) / MTM zone 10)-.35 E(<epsg2953> : N)110.5 648 Q
-(AD83\(CSRS\) / Ne)-.35 E 2.5(wB)-.25 G(runswick Stereo)-2.5 E
-(<epsg2954> : N)110.5 660 Q(AD83\(CSRS\) / Prince Edw)-.35 E
-(ard Isl. Stereographic \(N)-.1 E(AD83\))-.35 E(<epsg2955> : N)110.5 672
-Q(AD83\(CSRS\) / UTM zone 11N)-.35 E(<epsg2956> : N)110.5 684 Q
-(AD83\(CSRS\) / UTM zone 12N)-.35 E(<epsg2957> : N)110.5 696 Q
-(AD83\(CSRS\) / UTM zone 13N)-.35 E(<epsg2958> : N)110.5 708 Q
-(AD83\(CSRS\) / UTM zone 17N)-.35 E(<epsg2959> : N)110.5 720 Q
-(AD83\(CSRS\) / UTM zone 18N)-.35 E(MB-System 5.0)72 768 Q(29 No)132.205
-E -.15(ve)-.15 G(mber 2014).15 E(46)185.545 E 0 Cg EP
-%%Page: 47 47
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<epsg2960> : N)110.5 84 Q
-(AD83\(CSRS\) / UTM zone 19N)-.35 E(<epsg2961> : N)110.5 96 Q
-(AD83\(CSRS\) / UTM zone 20N)-.35 E(<epsg2962> : N)110.5 108 Q
-(AD83\(CSRS\) / UTM zone 21N)-.35 E(<epsg2964> : N)110.5 120 Q
-(AD27 / Alaska Albers)-.35 E(<epsg2965> : N)110.5 132 Q
-(AD83 / Indiana East \(ftUS\))-.35 E(<epsg2966> : N)110.5 144 Q
-(AD83 / Indiana W)-.35 E(est \(ftUS\))-.8 E(<epsg2967> : N)110.5 156 Q
-(AD83\(HARN\) / Indiana East \(ftUS\))-.35 E(<epsg2968> : N)110.5 168 Q
-(AD83\(HARN\) / Indiana W)-.35 E(est \(ftUS\))-.8 E(<epsg2969> : F)110.5
-180 Q(ort Marigot / UTM zone 20N)-.15 E
-(<epsg2970> : Guadeloupe 1948 / UTM zone 20N)110.5 192 Q
-(<epsg2971> : CSG67 / UTM zone 22N)110.5 204 Q
-(<epsg2972> : RGFG95 / UTM zone 22N)110.5 216 Q
-(<epsg2973> : Martinique 1938 / UTM zone 20N)110.5 228 Q
-(<epsg2975> : RGR92 / UTM zone 40S)110.5 240 Q(<epsg2976> : T)110.5 252
-Q(ahiti 52 / UTM zone 6S)-.8 E(<epsg2977> : T)110.5 264 Q
-(ahaa 54 / UTM zone 5S)-.8 E(<epsg2978> : IGN72 Nuku Hi)110.5 276 Q .5
--.25(va / U)-.25 H(TM zone 7S).25 E
-(<epsg2979> : K0 1949 / UTM zone 42S \(deprecated\))110.5 288 Q
-(<epsg2980> : Combani 1950 / UTM zone 38S)110.5 300 Q
-(<epsg2981> : IGN56 Lifou / UTM zone 58S)110.5 312 Q
-(<epsg2982> : IGN72 Grand T)110.5 324 Q
-(erre / UTM zone 58S \(deprecated\))-.7 E(<epsg2983> : ST87 Ouv)110.5
-336 Q(ea / UTM zone 58S \(deprecated\))-.15 E
-(<epsg2984> : RGNC 1991 / Lambert Ne)110.5 348 Q 2.5(wC)-.25 G
-(aledonia \(deprecated\))-2.5 E
-(<epsg2987> : Saint Pierre et Miquelon 1950 / UTM zone 21N)110.5 360 Q
-(<epsg2988> : MOP78 / UTM zone 1S)110.5 372 Q
-(<epsg2989> : RRAF 1991 / UTM zone 20N)110.5 384 Q
-(<epsg2990> : Reunion 1947 / TM Reunion \(deprecated\))110.5 396 Q
-(<epsg2991> : N)110.5 408 Q(AD83 / Ore)-.35 E(gon Lambert)-.15 E
-(<epsg2992> : N)110.5 420 Q(AD83 / Ore)-.35 E(gon Lambert \(ft\))-.15 E
-(<epsg2993> : N)110.5 432 Q(AD83\(HARN\) / Ore)-.35 E(gon Lambert)-.15 E
-(<epsg2994> : N)110.5 444 Q(AD83\(HARN\) / Ore)-.35 E
-(gon Lambert \(ft\))-.15 E(<epsg2995> : IGN53 Mare / UTM zone 58S)110.5
-456 Q(<epsg2996> : ST84 Ile des Pins / UTM zone 58S)110.5 468 Q
-(<epsg2997> : ST71 Belep / UTM zone 58S)110.5 480 Q
-(<epsg2998> : NEA74 Noumea / UTM zone 58S)110.5 492 Q
-(<epsg2999> : Grand Comoros / UTM zone 38S)110.5 504 Q(<epsg3000> : Se)
-110.5 516 Q -.05(ga)-.15 G(ra / NEIEZ).05 E(<epsg3001> : Bata)110.5 528
-Q(via / NEIEZ)-.2 E(<epsg3002> : Makassar / NEIEZ)110.5 540 Q
-(<epsg3003> : Monte Mario / Italy zone 1)110.5 552 Q
-(<epsg3004> : Monte Mario / Italy zone 2)110.5 564 Q(<epsg3005> : N)
-110.5 576 Q(AD83 / BC Albers)-.35 E(<epsg3006> : SWEREF99 TM)110.5 588 Q
-(<epsg3007> : SWEREF99 12 00)110.5 600 Q(<epsg3008> : SWEREF99 13 30)
-110.5 612 Q(<epsg3009> : SWEREF99 15 00)110.5 624 Q
-(<epsg3010> : SWEREF99 16 30)110.5 636 Q(<epsg3011> : SWEREF99 18 00)
-110.5 648 Q(<epsg3012> : SWEREF99 14 15)110.5 660 Q
-(<epsg3013> : SWEREF99 15 45)110.5 672 Q(<epsg3014> : SWEREF99 17 15)
-110.5 684 Q(<epsg3015> : SWEREF99 18 45)110.5 696 Q
-(<epsg3016> : SWEREF99 20 15)110.5 708 Q(<epsg3017> : SWEREF99 21 45)
-110.5 720 Q(MB-System 5.0)72 768 Q(29 No)132.205 E -.15(ve)-.15 G
-(mber 2014).15 E(47)185.545 E 0 Cg EP
-%%Page: 48 48
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<epsg3018> : SWEREF99 23 15)110.5 84 Q
-(<epsg3019> : R)110.5 96 Q(T90 7.5 gon V)-.6 E(<epsg3020> : R)110.5 108
-Q(T90 5 gon V)-.6 E(<epsg3021> : R)110.5 120 Q(T90 2.5 gon V)-.6 E
-(<epsg3022> : R)110.5 132 Q(T90 0 gon)-.6 E(<epsg3023> : R)110.5 144 Q
-(T90 2.5 gon O)-.6 E(<epsg3024> : R)110.5 156 Q(T90 5 gon O)-.6 E
-(<epsg3025> : R)110.5 168 Q(T38 7.5 gon V)-.6 E(<epsg3026> : R)110.5 180
-Q(T38 5 gon V)-.6 E(<epsg3027> : R)110.5 192 Q(T38 2.5 gon V)-.6 E
-(<epsg3028> : R)110.5 204 Q(T38 0 gon)-.6 E(<epsg3029> : R)110.5 216 Q
-(T38 2.5 gon O)-.6 E(<epsg3030> : R)110.5 228 Q(T38 5 gon O)-.6 E
-(<epsg3031> : WGS 84 / Antarctic Polar Stereographic)110.5 240 Q
-(<epsg3032> : WGS 84 / Australian Antarctic Polar Stereographic)110.5
-252 Q(<epsg3033> : WGS 84 / Australian Antarctic Lambert)110.5 264 Q
-(<epsg3034> : ETRS89 / ETRS-LCC)110.5 276 Q
-(<epsg3035> : ETRS89 / ETRS-LAEA)110.5 288 Q
-(<epsg3036> : Moznet / UTM zone 36S)110.5 300 Q
-(<epsg3037> : Moznet / UTM zone 37S)110.5 312 Q
-(<epsg3038> : ETRS89 / ETRS-TM26)110.5 324 Q
-(<epsg3039> : ETRS89 / ETRS-TM27)110.5 336 Q
-(<epsg3040> : ETRS89 / ETRS-TM28)110.5 348 Q
-(<epsg3041> : ETRS89 / ETRS-TM29)110.5 360 Q
-(<epsg3042> : ETRS89 / ETRS-TM30)110.5 372 Q
-(<epsg3043> : ETRS89 / ETRS-TM31)110.5 384 Q
-(<epsg3044> : ETRS89 / ETRS-TM32)110.5 396 Q
-(<epsg3045> : ETRS89 / ETRS-TM33)110.5 408 Q
-(<epsg3046> : ETRS89 / ETRS-TM34)110.5 420 Q
-(<epsg3047> : ETRS89 / ETRS-TM35)110.5 432 Q
-(<epsg3048> : ETRS89 / ETRS-TM36)110.5 444 Q
-(<epsg3049> : ETRS89 / ETRS-TM37)110.5 456 Q
-(<epsg3050> : ETRS89 / ETRS-TM38)110.5 468 Q
-(<epsg3051> : ETRS89 / ETRS-TM39)110.5 480 Q(<epsg3054> : Hjorse)110.5
-492 Q 2.5(y1)-.15 G(955 / UTM zone 26N)-2.5 E(<epsg3055> : Hjorse)110.5
-504 Q 2.5(y1)-.15 G(955 / UTM zone 27N)-2.5 E(<epsg3056> : Hjorse)110.5
-516 Q 2.5(y1)-.15 G(955 / UTM zone 28N)-2.5 E
-(<epsg3057> : ISN93 / Lambert 1993)110.5 528 Q
-(<epsg3058> : Helle 1954 / Jan Mayen Grid)110.5 540 Q
-(<epsg3059> : LKS92 / Latvia TM)110.5 552 Q(<epsg3060> : IGN72 Grande T)
-110.5 564 Q(erre / UTM zone 58S)-.7 E
-(<epsg3061> : Porto Santo 1995 / UTM zone 28N)110.5 576 Q
-(<epsg3062> : Azores Oriental 1995 / UTM zone 26N)110.5 588 Q
-(<epsg3063> : Azores Central 1995 / UTM zone 26N)110.5 600 Q
-(<epsg3064> : IGM95 / UTM zone 32N)110.5 612 Q
-(<epsg3065> : IGM95 / UTM zone 33N)110.5 624 Q
-(<epsg3066> : ED50 / Jordan TM)110.5 636 Q
-(<epsg3067> : ETRS89 / ETRS-TM35FIN)110.5 648 Q
-(<epsg3068> : DHDN / Soldner Berlin)110.5 660 Q(<epsg3069> : N)110.5 672
-Q(AD27 / W)-.35 E(isconsin T)-.4 E(ransv)-.35 E(erse Mercator)-.15 E
-(<epsg3070> : N)110.5 684 Q(AD83 / W)-.35 E(isconsin T)-.4 E(ransv)-.35
-E(erse Mercator)-.15 E(<epsg3071> : N)110.5 696 Q(AD83\(HARN\) / W)-.35
-E(isconsin T)-.4 E(ransv)-.35 E(erse Mercator)-.15 E(<epsg3072> : N)
-110.5 708 Q(AD83 / Maine CS2000 East)-.35 E(<epsg3073> : N)110.5 720 Q
-(AD83 / Maine CS2000 Central \(deprecated\))-.35 E(MB-System 5.0)72 768
-Q(29 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E(48)185.545 E 0 Cg EP
-%%Page: 49 49
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<epsg3074> : N)110.5 84 Q(AD83 / Maine CS2000 W)
--.35 E(est)-.8 E(<epsg3075> : N)110.5 96 Q
-(AD83\(HARN\) / Maine CS2000 East)-.35 E(<epsg3076> : N)110.5 108 Q
-(AD83\(HARN\) / Maine CS2000 Central \(deprecated\))-.35 E
-(<epsg3077> : N)110.5 120 Q(AD83\(HARN\) / Maine CS2000 W)-.35 E(est)-.8
-E(<epsg3078> : N)110.5 132 Q(AD83 / Michig)-.35 E(an Oblique Mercator)
--.05 E(<epsg3079> : N)110.5 144 Q(AD83\(HARN\) / Michig)-.35 E
-(an Oblique Mercator)-.05 E(<epsg3080> : N)110.5 156 Q
-(AD27 / Shackleford)-.35 E(<epsg3081> : N)110.5 168 Q(AD83 / T)-.35 E
--.15(ex)-.7 G(as State Mapping System).15 E(<epsg3082> : N)110.5 180 Q
-(AD83 / T)-.35 E -.15(ex)-.7 G(as Centric Lambert Conformal).15 E
-(<epsg3083> : N)110.5 192 Q(AD83 / T)-.35 E -.15(ex)-.7 G
-(as Centric Albers Equal Area).15 E(<epsg3084> : N)110.5 204 Q
-(AD83\(HARN\) / T)-.35 E -.15(ex)-.7 G(as Centric Lambert Conformal).15
-E(<epsg3085> : N)110.5 216 Q(AD83\(HARN\) / T)-.35 E -.15(ex)-.7 G
-(as Centric Albers Equal Area).15 E(<epsg3086> : N)110.5 228 Q
-(AD83 / Florida GDL Albers)-.35 E(<epsg3087> : N)110.5 240 Q
-(AD83\(HARN\) / Florida GDL Albers)-.35 E(<epsg3088> : N)110.5 252 Q
-(AD83 / K)-.35 E(entuck)-.25 E 2.5(yS)-.15 G(ingle Zone)-2.5 E
-(<epsg3089> : N)110.5 264 Q(AD83 / K)-.35 E(entuck)-.25 E 2.5(yS)-.15 G
-(ingle Zone \(ftUS\))-2.5 E(<epsg3090> : N)110.5 276 Q(AD83\(HARN\) / K)
--.35 E(entuck)-.25 E 2.5(yS)-.15 G(ingle Zone)-2.5 E(<epsg3091> : N)
-110.5 288 Q(AD83\(HARN\) / K)-.35 E(entuck)-.25 E 2.5(yS)-.15 G
-(ingle Zone \(ftUS\))-2.5 E(<epsg3092> : T)110.5 300 Q(ok)-.8 E
-(yo / UTM zone 51N)-.15 E(<epsg3093> : T)110.5 312 Q(ok)-.8 E
-(yo / UTM zone 52N)-.15 E(<epsg3094> : T)110.5 324 Q(ok)-.8 E
-(yo / UTM zone 53N)-.15 E(<epsg3095> : T)110.5 336 Q(ok)-.8 E
-(yo / UTM zone 54N)-.15 E(<epsg3096> : T)110.5 348 Q(ok)-.8 E
-(yo / UTM zone 55N)-.15 E(<epsg3097> : JGD2000 / UTM zone 51N)110.5 360
-Q(<epsg3098> : JGD2000 / UTM zone 52N)110.5 372 Q
-(<epsg3099> : JGD2000 / UTM zone 53N)110.5 384 Q
-(<epsg3100> : JGD2000 / UTM zone 54N)110.5 396 Q
-(<epsg3101> : JGD2000 / UTM zone 55N)110.5 408 Q
-(<epsg3102> : American Samoa 1962 / American Samoa Lambert)110.5 420 Q
-(<epsg3103> : Mauritania 1999 / UTM zone 28N \(deprecated\))110.5 432 Q
-(<epsg3104> : Mauritania 1999 / UTM zone 29N \(deprecated\))110.5 444 Q
-(<epsg3105> : Mauritania 1999 / UTM zone 30N \(deprecated\))110.5 456 Q
-(<epsg3106> : Gulshan 303 / Bangladesh T)110.5 468 Q(ransv)-.35 E
-(erse Mercator)-.15 E(<epsg3107> : GD)110.5 480 Q(A94 / SA Lambert)-.4 E
-(<epsg3108> : ETRS89 / Guernse)110.5 492 Q 2.5(yG)-.15 G(rid)-2.5 E
-(<epsg3109> : ETRS89 / Jerse)110.5 504 Q 2.5(yT)-.15 G(ransv)-2.85 E
-(erse Mercator)-.15 E(<epsg3110> : A)110.5 516 Q(GD66 / V)-.4 E
-(icgrid66)-.6 E(<epsg3111> : GD)110.5 528 Q(A94 / V)-.4 E(icgrid94)-.6 E
-(<epsg3112> : GD)110.5 540 Q(A94 / Geoscience Australia Lambert)-.4 E
-(<epsg3113> : GD)110.5 552 Q(A94 / BCSG02)-.4 E(<epsg3114> : MA)110.5
-564 Q(GN)-.4 E(A-SIRGAS / Colombia F)-.35 E(ar W)-.15 E(est zone)-.8 E
-(<epsg3115> : MA)110.5 576 Q(GN)-.4 E(A-SIRGAS / Colombia W)-.35 E
-(est zone)-.8 E(<epsg3116> : MA)110.5 588 Q(GN)-.4 E
-(A-SIRGAS / Colombia Bogota zone)-.35 E(<epsg3117> : MA)110.5 600 Q(GN)
--.4 E(A-SIRGAS / Colombia East Central zone)-.35 E(<epsg3118> : MA)110.5
-612 Q(GN)-.4 E(A-SIRGAS / Colombia East zone)-.35 E
-(<epsg3119> : Douala 1948 / AEF west)110.5 624 Q(<epsg3120> : Pulk)110.5
-636 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942\(58\) / Poland zone I)-2.5 E
-(<epsg3121> : PRS92 / Philippines zone 1)110.5 648 Q
-(<epsg3122> : PRS92 / Philippines zone 2)110.5 660 Q
-(<epsg3123> : PRS92 / Philippines zone 3)110.5 672 Q
-(<epsg3124> : PRS92 / Philippines zone 4)110.5 684 Q
-(<epsg3125> : PRS92 / Philippines zone 5)110.5 696 Q
-(<epsg3126> : ETRS89 / ETRS-GK19FIN)110.5 708 Q
-(<epsg3127> : ETRS89 / ETRS-GK20FIN)110.5 720 Q(MB-System 5.0)72 768 Q
-(29 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E(49)185.545 E 0 Cg EP
-%%Page: 50 50
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<epsg3128> : ETRS89 / ETRS-GK21FIN)110.5 84 Q
-(<epsg3129> : ETRS89 / ETRS-GK22FIN)110.5 96 Q
-(<epsg3130> : ETRS89 / ETRS-GK23FIN)110.5 108 Q
-(<epsg3131> : ETRS89 / ETRS-GK24FIN)110.5 120 Q
-(<epsg3132> : ETRS89 / ETRS-GK25FIN)110.5 132 Q
-(<epsg3133> : ETRS89 / ETRS-GK26FIN)110.5 144 Q
-(<epsg3134> : ETRS89 / ETRS-GK27FIN)110.5 156 Q
-(<epsg3135> : ETRS89 / ETRS-GK28FIN)110.5 168 Q
-(<epsg3136> : ETRS89 / ETRS-GK29FIN)110.5 180 Q
-(<epsg3137> : ETRS89 / ETRS-GK30FIN)110.5 192 Q
-(<epsg3138> : ETRS89 / ETRS-GK31FIN)110.5 204 Q(<epsg3140> : V)110.5 216
-Q(iti Le)-.6 E(vu 1912 / V)-.25 E(iti Le)-.6 E(vu Grid)-.25 E
-(<epsg3141> : Fiji 1956 / UTM zone 60S)110.5 228 Q
-(<epsg3142> : Fiji 1956 / UTM zone 1S)110.5 240 Q
-(<epsg3143> : Fiji 1986 / Fiji Map Grid \(deprecated\))110.5 252 Q
-(<epsg3146> : Pulk)110.5 264 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)
--2.5 E(gree Gauss-Kruger zone 6)-.15 E(<epsg3147> : Pulk)110.5 276 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 18E)
--.15 E(<epsg3148> : Indian 1960 / UTM zone 48N)110.5 288 Q
-(<epsg3149> : Indian 1960 / UTM zone 49N)110.5 300 Q(<epsg3150> : Pulk)
-110.5 312 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E
-(gree Gauss-Kruger zone 6)-.15 E(<epsg3151> : Pulk)110.5 324 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 18E)-.15 E
-(<epsg3152> : ST74)110.5 336 Q(<epsg3153> : N)110.5 348 Q
-(AD83\(CSRS\) / BC Albers)-.35 E(<epsg3154> : N)110.5 360 Q
-(AD83\(CSRS\) / UTM zone 7N)-.35 E(<epsg3155> : N)110.5 372 Q
-(AD83\(CSRS\) / UTM zone 8N)-.35 E(<epsg3156> : N)110.5 384 Q
-(AD83\(CSRS\) / UTM zone 9N)-.35 E(<epsg3157> : N)110.5 396 Q
-(AD83\(CSRS\) / UTM zone 10N)-.35 E(<epsg3158> : N)110.5 408 Q
-(AD83\(CSRS\) / UTM zone 14N)-.35 E(<epsg3159> : N)110.5 420 Q
-(AD83\(CSRS\) / UTM zone 15N)-.35 E(<epsg3160> : N)110.5 432 Q
-(AD83\(CSRS\) / UTM zone 16N)-.35 E(<epsg3161> : N)110.5 444 Q
-(AD83 / Ontario MNR Lambert)-.35 E(<epsg3162> : N)110.5 456 Q
-(AD83\(CSRS\) / Ontario MNR Lambert)-.35 E
-(<epsg3163> : RGNC91-93 / Lambert Ne)110.5 468 Q 2.5(wC)-.25 G(aledonia)
--2.5 E(<epsg3164> : ST87 Ouv)110.5 480 Q(ea / UTM zone 58S)-.15 E
-(<epsg3165> : NEA74 Noumea / Noumea Lambert)110.5 492 Q
-(<epsg3166> : NEA74 Noumea / Noumea Lambert 2)110.5 504 Q
-(<epsg3167> : K)110.5 516 Q(ertau \(RSO\) / RSO Malaya \(ch\))-.25 E
-(<epsg3168> : K)110.5 528 Q(ertau \(RSO\) / RSO Malaya \(m\))-.25 E
-(<epsg3169> : RGNC91-93 / UTM zone 57S)110.5 540 Q
-(<epsg3170> : RGNC91-93 / UTM zone 58S)110.5 552 Q
-(<epsg3171> : RGNC91-93 / UTM zone 59S)110.5 564 Q
-(<epsg3172> : IGN53 Mare / UTM zone 59S)110.5 576 Q(<epsg3174> : N)110.5
-588 Q(AD83 / Great Lak)-.35 E(es Albers)-.1 E(<epsg3175> : N)110.5 600 Q
-(AD83 / Great Lak)-.35 E(es and St La)-.1 E(wrence Albers)-.15 E
-(<epsg3176> : Indian 1960 / TM 106 NE)110.5 612 Q
-(<epsg3177> : LGD2006 / Libya TM)110.5 624 Q
-(<epsg3178> : GR96 / UTM zone 18N)110.5 636 Q
-(<epsg3179> : GR96 / UTM zone 19N)110.5 648 Q
-(<epsg3180> : GR96 / UTM zone 20N)110.5 660 Q
-(<epsg3181> : GR96 / UTM zone 21N)110.5 672 Q
-(<epsg3182> : GR96 / UTM zone 22N)110.5 684 Q
-(<epsg3183> : GR96 / UTM zone 23N)110.5 696 Q
-(<epsg3184> : GR96 / UTM zone 24N)110.5 708 Q
-(<epsg3185> : GR96 / UTM zone 25N)110.5 720 Q(MB-System 5.0)72 768 Q
-(29 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E(50)185.545 E 0 Cg EP
-%%Page: 51 51
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<epsg3186> : GR96 / UTM zone 26N)110.5 84 Q
-(<epsg3187> : GR96 / UTM zone 27N)110.5 96 Q
-(<epsg3188> : GR96 / UTM zone 28N)110.5 108 Q
-(<epsg3189> : GR96 / UTM zone 29N)110.5 120 Q
-(<epsg3190> : LGD2006 / Libya TM zone 5)110.5 132 Q
-(<epsg3191> : LGD2006 / Libya TM zone 6)110.5 144 Q
-(<epsg3192> : LGD2006 / Libya TM zone 7)110.5 156 Q
-(<epsg3193> : LGD2006 / Libya TM zone 8)110.5 168 Q
-(<epsg3194> : LGD2006 / Libya TM zone 9)110.5 180 Q
-(<epsg3195> : LGD2006 / Libya TM zone 10)110.5 192 Q
-(<epsg3196> : LGD2006 / Libya TM zone 11)110.5 204 Q
-(<epsg3197> : LGD2006 / Libya TM zone 12)110.5 216 Q
-(<epsg3198> : LGD2006 / Libya TM zone 13)110.5 228 Q
-(<epsg3199> : LGD2006 / UTM zone 32N)110.5 240 Q
-(<epsg3200> : FD58 / Iraq zone)110.5 252 Q
-(<epsg3201> : LGD2006 / UTM zone 33N)110.5 264 Q
-(<epsg3202> : LGD2006 / UTM zone 34N)110.5 276 Q
-(<epsg3203> : LGD2006 / UTM zone 35N)110.5 288 Q
-(<epsg3204> : WGS 84 / SCAR IMW SP19-20)110.5 300 Q
-(<epsg3205> : WGS 84 / SCAR IMW SP21-22)110.5 312 Q
-(<epsg3206> : WGS 84 / SCAR IMW SP23-24)110.5 324 Q
-(<epsg3207> : WGS 84 / SCAR IMW SQ01-02)110.5 336 Q
-(<epsg3208> : WGS 84 / SCAR IMW SQ19-20)110.5 348 Q
-(<epsg3209> : WGS 84 / SCAR IMW SQ21-22)110.5 360 Q
-(<epsg3210> : WGS 84 / SCAR IMW SQ37-38)110.5 372 Q
-(<epsg3211> : WGS 84 / SCAR IMW SQ39-40)110.5 384 Q
-(<epsg3212> : WGS 84 / SCAR IMW SQ41-42)110.5 396 Q
-(<epsg3213> : WGS 84 / SCAR IMW SQ43-44)110.5 408 Q
-(<epsg3214> : WGS 84 / SCAR IMW SQ45-46)110.5 420 Q
-(<epsg3215> : WGS 84 / SCAR IMW SQ47-48)110.5 432 Q
-(<epsg3216> : WGS 84 / SCAR IMW SQ49-50)110.5 444 Q
-(<epsg3217> : WGS 84 / SCAR IMW SQ51-52)110.5 456 Q
-(<epsg3218> : WGS 84 / SCAR IMW SQ53-54)110.5 468 Q
-(<epsg3219> : WGS 84 / SCAR IMW SQ55-56)110.5 480 Q
-(<epsg3220> : WGS 84 / SCAR IMW SQ57-58)110.5 492 Q
-(<epsg3221> : WGS 84 / SCAR IMW SR13-14)110.5 504 Q
-(<epsg3222> : WGS 84 / SCAR IMW SR15-16)110.5 516 Q
-(<epsg3223> : WGS 84 / SCAR IMW SR17-18)110.5 528 Q
-(<epsg3224> : WGS 84 / SCAR IMW SR19-20)110.5 540 Q
-(<epsg3225> : WGS 84 / SCAR IMW SR27-28)110.5 552 Q
-(<epsg3226> : WGS 84 / SCAR IMW SR29-30)110.5 564 Q
-(<epsg3227> : WGS 84 / SCAR IMW SR31-32)110.5 576 Q
-(<epsg3228> : WGS 84 / SCAR IMW SR33-34)110.5 588 Q
-(<epsg3229> : WGS 84 / SCAR IMW SR35-36)110.5 600 Q
-(<epsg3230> : WGS 84 / SCAR IMW SR37-38)110.5 612 Q
-(<epsg3231> : WGS 84 / SCAR IMW SR39-40)110.5 624 Q
-(<epsg3232> : WGS 84 / SCAR IMW SR41-42)110.5 636 Q
-(<epsg3233> : WGS 84 / SCAR IMW SR43-44)110.5 648 Q
-(<epsg3234> : WGS 84 / SCAR IMW SR45-46)110.5 660 Q
-(<epsg3235> : WGS 84 / SCAR IMW SR47-48)110.5 672 Q
-(<epsg3236> : WGS 84 / SCAR IMW SR49-50)110.5 684 Q
-(<epsg3237> : WGS 84 / SCAR IMW SR51-52)110.5 696 Q
-(<epsg3238> : WGS 84 / SCAR IMW SR53-54)110.5 708 Q
-(<epsg3239> : WGS 84 / SCAR IMW SR55-56)110.5 720 Q(MB-System 5.0)72 768
-Q(29 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E(51)185.545 E 0 Cg EP
-%%Page: 52 52
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<epsg3240> : WGS 84 / SCAR IMW SR57-58)110.5 84 Q
-(<epsg3241> : WGS 84 / SCAR IMW SR59-60)110.5 96 Q
-(<epsg3242> : WGS 84 / SCAR IMW SS04-06)110.5 108 Q
-(<epsg3243> : WGS 84 / SCAR IMW SS07-09)110.5 120 Q
-(<epsg3244> : WGS 84 / SCAR IMW SS10-12)110.5 132 Q
-(<epsg3245> : WGS 84 / SCAR IMW SS13-15)110.5 144 Q
-(<epsg3246> : WGS 84 / SCAR IMW SS16-18)110.5 156 Q
-(<epsg3247> : WGS 84 / SCAR IMW SS19-21)110.5 168 Q
-(<epsg3248> : WGS 84 / SCAR IMW SS25-27)110.5 180 Q
-(<epsg3249> : WGS 84 / SCAR IMW SS28-30)110.5 192 Q
-(<epsg3250> : WGS 84 / SCAR IMW SS31-33)110.5 204 Q
-(<epsg3251> : WGS 84 / SCAR IMW SS34-36)110.5 216 Q
-(<epsg3252> : WGS 84 / SCAR IMW SS37-39)110.5 228 Q
-(<epsg3253> : WGS 84 / SCAR IMW SS40-42)110.5 240 Q
-(<epsg3254> : WGS 84 / SCAR IMW SS43-45)110.5 252 Q
-(<epsg3255> : WGS 84 / SCAR IMW SS46-48)110.5 264 Q
-(<epsg3256> : WGS 84 / SCAR IMW SS49-51)110.5 276 Q
-(<epsg3257> : WGS 84 / SCAR IMW SS52-54)110.5 288 Q
-(<epsg3258> : WGS 84 / SCAR IMW SS55-57)110.5 300 Q
-(<epsg3259> : WGS 84 / SCAR IMW SS58-60)110.5 312 Q
-(<epsg3260> : WGS 84 / SCAR IMW ST01-04)110.5 324 Q
-(<epsg3261> : WGS 84 / SCAR IMW ST05-08)110.5 336 Q
-(<epsg3262> : WGS 84 / SCAR IMW ST09-12)110.5 348 Q
-(<epsg3263> : WGS 84 / SCAR IMW ST13-16)110.5 360 Q
-(<epsg3264> : WGS 84 / SCAR IMW ST17-20)110.5 372 Q
-(<epsg3265> : WGS 84 / SCAR IMW ST21-24)110.5 384 Q
-(<epsg3266> : WGS 84 / SCAR IMW ST25-28)110.5 396 Q
-(<epsg3267> : WGS 84 / SCAR IMW ST29-32)110.5 408 Q
-(<epsg3268> : WGS 84 / SCAR IMW ST33-36)110.5 420 Q
-(<epsg3269> : WGS 84 / SCAR IMW ST37-40)110.5 432 Q
-(<epsg3270> : WGS 84 / SCAR IMW ST41-44)110.5 444 Q
-(<epsg3271> : WGS 84 / SCAR IMW ST45-48)110.5 456 Q
-(<epsg3272> : WGS 84 / SCAR IMW ST49-52)110.5 468 Q
-(<epsg3273> : WGS 84 / SCAR IMW ST53-56)110.5 480 Q
-(<epsg3274> : WGS 84 / SCAR IMW ST57-60)110.5 492 Q
-(<epsg3275> : WGS 84 / SCAR IMW SU01-05)110.5 504 Q
-(<epsg3276> : WGS 84 / SCAR IMW SU06-10)110.5 516 Q
-(<epsg3277> : WGS 84 / SCAR IMW SU11-15)110.5 528 Q
-(<epsg3278> : WGS 84 / SCAR IMW SU16-20)110.5 540 Q
-(<epsg3279> : WGS 84 / SCAR IMW SU21-25)110.5 552 Q
-(<epsg3280> : WGS 84 / SCAR IMW SU26-30)110.5 564 Q
-(<epsg3281> : WGS 84 / SCAR IMW SU31-35)110.5 576 Q
-(<epsg3282> : WGS 84 / SCAR IMW SU36-40)110.5 588 Q
-(<epsg3283> : WGS 84 / SCAR IMW SU41-45)110.5 600 Q
-(<epsg3284> : WGS 84 / SCAR IMW SU46-50)110.5 612 Q
-(<epsg3285> : WGS 84 / SCAR IMW SU51-55)110.5 624 Q
-(<epsg3286> : WGS 84 / SCAR IMW SU56-60)110.5 636 Q
-(<epsg3287> : WGS 84 / SCAR IMW SV01-10)110.5 648 Q
-(<epsg3288> : WGS 84 / SCAR IMW SV11-20)110.5 660 Q
-(<epsg3289> : WGS 84 / SCAR IMW SV21-30)110.5 672 Q
-(<epsg3290> : WGS 84 / SCAR IMW SV31-40)110.5 684 Q
-(<epsg3291> : WGS 84 / SCAR IMW SV41-50)110.5 696 Q
-(<epsg3292> : WGS 84 / SCAR IMW SV51-60)110.5 708 Q
-(<epsg3293> : WGS 84 / SCAR IMW SW01-60)110.5 720 Q(MB-System 5.0)72 768
-Q(29 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E(52)185.545 E 0 Cg EP
-%%Page: 53 53
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<epsg3294> : WGS 84 / USGS T)110.5 84 Q
-(ransantarctic Mountains)-.35 E(<epsg3296> : RGPF / UTM zone 5S)110.5 96
-Q(<epsg3297> : RGPF / UTM zone 6S)110.5 108 Q
-(<epsg3298> : RGPF / UTM zone 7S)110.5 120 Q
-(<epsg3299> : RGPF / UTM zone 8S)110.5 132 Q
-(<epsg3300> : Estonian Coordinate System of 1992)110.5 144 Q
-(<epsg3301> : Estonian Coordinate System of 1997)110.5 156 Q
-(<epsg3302> : IGN63 Hi)110.5 168 Q .5 -.25(va O)-.25 H 2.5(a/U).25 G
-(TM zone 7S)-2.5 E(<epsg3303> : F)110.5 180 Q(atu Iv)-.15 E 2.5(a7)-.25
-G 2.5(2/U)-2.5 G(TM zone 7S)-2.5 E(<epsg3304> : T)110.5 192 Q
-(ahiti 79 / UTM zone 6S)-.8 E(<epsg3305> : Moorea 87 / UTM zone 6S)110.5
-204 Q(<epsg3306> : Maupiti 83 / UTM zone 5S)110.5 216 Q
-(<epsg3307> : Nakhl-e Ghanem / UTM zone 39N)110.5 228 Q(<epsg3308> : GD)
-110.5 240 Q(A94 / NSW Lambert)-.4 E(<epsg3309> : N)110.5 252 Q
-(AD27 / California Albers)-.35 E(<epsg3310> : N)110.5 264 Q
-(AD83 / California Albers)-.35 E(<epsg3311> : N)110.5 276 Q
-(AD83\(HARN\) / California Albers)-.35 E
-(<epsg3312> : CSG67 / UTM zone 21N)110.5 288 Q
-(<epsg3313> : RGFG95 / UTM zone 21N)110.5 300 Q(<epsg3314> : Katang)
-110.5 312 Q 2.5(a1)-.05 G(955 / Katang)-2.5 E 2.5(aL)-.05 G(ambert)-2.5
-E(<epsg3315> : Katang)110.5 324 Q 2.5(a1)-.05 G(955 / Katang)-2.5 E 2.5
-(aT)-.05 G(M)-2.5 E(<epsg3316> : Kasai 1953 / Congo TM zone 22)110.5 336
-Q(<epsg3317> : Kasai 1953 / Congo TM zone 24)110.5 348 Q
-(<epsg3318> : IGC 1962 / Congo TM zone 12)110.5 360 Q
-(<epsg3319> : IGC 1962 / Congo TM zone 14)110.5 372 Q
-(<epsg3320> : IGC 1962 / Congo TM zone 16)110.5 384 Q
-(<epsg3321> : IGC 1962 / Congo TM zone 18)110.5 396 Q
-(<epsg3322> : IGC 1962 / Congo TM zone 20)110.5 408 Q
-(<epsg3323> : IGC 1962 / Congo TM zone 22)110.5 420 Q
-(<epsg3324> : IGC 1962 / Congo TM zone 24)110.5 432 Q
-(<epsg3325> : IGC 1962 / Congo TM zone 26)110.5 444 Q
-(<epsg3326> : IGC 1962 / Congo TM zone 28)110.5 456 Q
-(<epsg3327> : IGC 1962 / Congo TM zone 30)110.5 468 Q(<epsg3328> : Pulk)
-110.5 480 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942\(58\) / GUGiK-80)-2.5 E
-(<epsg3329> : Pulk)110.5 492 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942\(58\) / 3-de)-2.5 E(gree Gauss-Kruger zone 5)-.15 E
-(<epsg3330> : Pulk)110.5 504 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942\(58\) / 3-de)-2.5 E(gree Gauss-Kruger zone 6)-.15 E
-(<epsg3331> : Pulk)110.5 516 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942\(58\) / 3-de)-2.5 E(gree Gauss-Kruger zone 7)-.15 E
-(<epsg3332> : Pulk)110.5 528 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942\(58\) / 3-de)-2.5 E(gree Gauss-Kruger zone 8)-.15 E
-(<epsg3333> : Pulk)110.5 540 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942\(58\) / Gauss-Kruger zone 3)-2.5 E(<epsg3334> : Pulk)110.5 552 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(942\(58\) / Gauss-Kruger zone 4)-2.5 E
-(<epsg3335> : Pulk)110.5 564 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942\(58\) / Gauss-Kruger zone 5)-2.5 E(<epsg3336> : IGN 1962 K)110.5
-576 Q(er)-.25 E(guelen / UTM zone 42S)-.18 E
-(<epsg3337> : Le Pouce 1934 / Mauritius Grid)110.5 588 Q(<epsg3338> : N)
-110.5 600 Q(AD83 / Alaska Albers)-.35 E
-(<epsg3339> : IGCB 1955 / Congo TM zone 12)110.5 612 Q
-(<epsg3340> : IGCB 1955 / Congo TM zone 14)110.5 624 Q
-(<epsg3341> : IGCB 1955 / Congo TM zone 16)110.5 636 Q
-(<epsg3342> : IGCB 1955 / UTM zone 33S)110.5 648 Q
-(<epsg3343> : Mauritania 1999 / UTM zone 28N)110.5 660 Q
-(<epsg3344> : Mauritania 1999 / UTM zone 29N)110.5 672 Q
-(<epsg3345> : Mauritania 1999 / UTM zone 30N)110.5 684 Q
-(<epsg3346> : LKS94 / Lithuania TM)110.5 696 Q(<epsg3347> : N)110.5 708
-Q(AD83 / Statistics Canada Lambert)-.35 E(<epsg3348> : N)110.5 720 Q
-(AD83\(CSRS\) / Statistics Canada Lambert)-.35 E(MB-System 5.0)72 768 Q
-(29 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E(53)185.545 E 0 Cg EP
-%%Page: 54 54
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<epsg3349> : WGS 84 / PDC Mercator)110.5 84 Q
-(<epsg3350> : Pulk)110.5 96 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / CS63 zone C0)-2.5 E(<epsg3351> : Pulk)110.5 108 Q -.15(ov)-.1 G
-2.5(o1)-.05 G(942 / CS63 zone C1)-2.5 E(<epsg3352> : Pulk)110.5 120 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(942 / CS63 zone C2)-2.5 E
-(<epsg3353> : Mhast \(onshore\) / UTM zone 32S)110.5 132 Q
-(<epsg3354> : Mhast \(of)110.5 144 Q(fshore\) / UTM zone 32S)-.25 E
-(<epsg3355> : Egypt Gulf of Suez S-650 TL / Red Belt)110.5 156 Q
-(<epsg3356> : Grand Cayman 1959 / UTM zone 17N)110.5 168 Q
-(<epsg3357> : Little Cayman 1961 / UTM zone 17N)110.5 180 Q
-(<epsg3358> : N)110.5 192 Q(AD83\(HARN\) / North Carolina)-.35 E
-(<epsg3359> : N)110.5 204 Q
-(AD83\(HARN\) / North Carolina \(ftUS\) \(deprecated\))-.35 E
-(<epsg3360> : N)110.5 216 Q(AD83\(HARN\) / South Carolina)-.35 E
-(<epsg3361> : N)110.5 228 Q(AD83\(HARN\) / South Carolina \(ft\))-.35 E
-(<epsg3362> : N)110.5 240 Q(AD83\(HARN\) / Pennsylv)-.35 E(ania North)
--.25 E(<epsg3363> : N)110.5 252 Q(AD83\(HARN\) / Pennsylv)-.35 E
-(ania North \(ftUS\))-.25 E(<epsg3364> : N)110.5 264 Q
-(AD83\(HARN\) / Pennsylv)-.35 E(ania South)-.25 E(<epsg3365> : N)110.5
-276 Q(AD83\(HARN\) / Pennsylv)-.35 E(ania South \(ftUS\))-.25 E
-(<epsg3366> : Hong K)110.5 288 Q(ong 1963 Grid System \(deprecated\))
--.35 E(<epsg3367> : IGN Astro 1960 / UTM zone 28N)110.5 300 Q
-(<epsg3368> : IGN Astro 1960 / UTM zone 29N)110.5 312 Q
-(<epsg3369> : IGN Astro 1960 / UTM zone 30N)110.5 324 Q(<epsg3370> : N)
-110.5 336 Q(AD27 / UTM zone 59N)-.35 E(<epsg3371> : N)110.5 348 Q
-(AD27 / UTM zone 60N)-.35 E(<epsg3372> : N)110.5 360 Q
-(AD83 / UTM zone 59N)-.35 E(<epsg3373> : N)110.5 372 Q
-(AD83 / UTM zone 60N)-.35 E(<epsg3374> : FD54 / UTM zone 29N)110.5 384 Q
-(<epsg3375> : GDM2000 / Peninsula RSO)110.5 396 Q
-(<epsg3376> : GDM2000 / East Malaysia BRSO)110.5 408 Q
-(<epsg3377> : GDM2000 / Johor Grid)110.5 420 Q
-(<epsg3378> : GDM2000 / Sembilan and Melaka Grid)110.5 432 Q
-(<epsg3379> : GDM2000 / P)110.5 444 Q(ahangGrid)-.15 E
-(<epsg3380> : GDM2000 / Selangor Grid)110.5 456 Q
-(<epsg3381> : GDM2000 / T)110.5 468 Q(erengg)-.7 E(anu Grid)-.05 E
-(<epsg3382> : GDM2000 / Pinang Grid)110.5 480 Q
-(<epsg3383> : GDM2000 / K)110.5 492 Q(edah and Perlis Grid)-.25 E
-(<epsg3384> : GDM2000 / Perak Grid)110.5 504 Q(<epsg3385> : GDM2000 / K)
-110.5 516 Q(elantan Grid)-.25 E(<epsg3386> : KKJ / Finland zone 0)110.5
-528 Q(<epsg3387> : KKJ / Finland zone 5)110.5 540 Q(<epsg3388> : Pulk)
-110.5 552 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / Caspian Sea Mercator)-2.5
-E(<epsg3389> : Pulk)110.5 564 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)
--2.5 E(gree Gauss-Kruger zone 60)-.15 E(<epsg3390> : Pulk)110.5 576 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 60)
--.15 E(<epsg3391> : Karbala 1979 \(Polservice\) / UTM zone 37N)110.5 588
-Q(<epsg3392> : Karbala 1979 \(Polservice\) / UTM zone 38N)110.5 600 Q
-(<epsg3393> : Karbala 1979 \(Polservice\) / UTM zone 39N)110.5 612 Q
-(<epsg3394> : Nahrw)110.5 624 Q(an 1934 / Iraq zone)-.1 E
-(<epsg3395> : WGS 84 / W)110.5 636 Q(orld Mercator)-.8 E
-(<epsg3396> : PD/83 / Gauss-Kruger zone 3)110.5 648 Q
-(<epsg3397> : PD/83 / Gauss-Kruger zone 4)110.5 660 Q
-(<epsg3398> : RD/83 / Gauss-Kruger zone 4)110.5 672 Q
-(<epsg3399> : RD/83 / Gauss-Kruger zone 5)110.5 684 Q(<epsg3400> : N)
-110.5 696 Q(AD83 / Alberta 10-TM \(F)-.35 E(orest\))-.15 E
-(<epsg3401> : N)110.5 708 Q(AD83 / Alberta 10-TM \(Resource\))-.35 E
-(<epsg3402> : N)110.5 720 Q(AD83\(CSRS\) / Alberta 10-TM \(F)-.35 E
-(orest\))-.15 E(MB-System 5.0)72 768 Q(29 No)132.205 E -.15(ve)-.15 G
-(mber 2014).15 E(54)185.545 E 0 Cg EP
-%%Page: 55 55
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<epsg3403> : N)110.5 84 Q
-(AD83\(CSRS\) / Alberta 10-TM \(Resource\))-.35 E(<epsg3404> : N)110.5
-96 Q(AD83\(HARN\) / North Carolina \(ftUS\))-.35 E
-(<epsg3405> : VN-2000 / UTM zone 48N)110.5 108 Q
-(<epsg3406> : VN-2000 / UTM zone 49N)110.5 120 Q(<epsg3407> : Hong K)
-110.5 132 Q(ong 1963 Grid System)-.35 E
-(<epsg3408> : NSIDC EASE-Grid North)110.5 144 Q
-(<epsg3409> : NSIDC EASE-Grid South)110.5 156 Q
-(<epsg3411> : NSIDC Sea Ice Polar Stereographic North)110.5 168 Q
-(<epsg3412> : NSIDC Sea Ice Polar Stereographic South)110.5 180 Q
-(<epsg3413> : WGS 84 / NSIDC Sea Ice Polar Stereographic North)110.5 192
-Q(<epsg3414> : SVY21 / Sing)110.5 204 Q(apore TM)-.05 E
-(<epsg3415> : WGS 72BE / South China Sea Lambert)110.5 216 Q
-(<epsg3416> : ETRS89 / Austria Lambert)110.5 228 Q(<epsg3417> : N)110.5
-240 Q(AD83 / Io)-.35 E .2 -.1(wa N)-.25 H(orth \(ft US\)).1 E
-(<epsg3418> : N)110.5 252 Q(AD83 / Io)-.35 E .2 -.1(wa S)-.25 H
-(outh \(ft US\)).1 E(<epsg3419> : N)110.5 264 Q
-(AD83 / Kansas North \(ft US\))-.35 E(<epsg3420> : N)110.5 276 Q
-(AD83 / Kansas South \(ft US\))-.35 E(<epsg3421> : N)110.5 288 Q
-(AD83 / Ne)-.35 E -.25(va)-.25 G(da East \(ft US\)).25 E(<epsg3422> : N)
-110.5 300 Q(AD83 / Ne)-.35 E -.25(va)-.25 G(da Central \(ft US\)).25 E
-(<epsg3423> : N)110.5 312 Q(AD83 / Ne)-.35 E -.25(va)-.25 G(da W).25 E
-(est \(ft US\))-.8 E(<epsg3424> : N)110.5 324 Q(AD83 / Ne)-.35 E 2.5(wJ)
--.25 G(erse)-2.5 E 2.5(y\()-.15 G(ft US\))-2.5 E(<epsg3425> : N)110.5
-336 Q(AD83\(HARN\) / Io)-.35 E .2 -.1(wa N)-.25 H(orth \(ft US\)).1 E
-(<epsg3426> : N)110.5 348 Q(AD83\(HARN\) / Io)-.35 E .2 -.1(wa S)-.25 H
-(outh \(ft US\)).1 E(<epsg3427> : N)110.5 360 Q
-(AD83\(HARN\) / Kansas North \(ft US\))-.35 E(<epsg3428> : N)110.5 372 Q
-(AD83\(HARN\) / Kansas South \(ft US\))-.35 E(<epsg3429> : N)110.5 384 Q
-(AD83\(HARN\) / Ne)-.35 E -.25(va)-.25 G(da East \(ft US\)).25 E
-(<epsg3430> : N)110.5 396 Q(AD83\(HARN\) / Ne)-.35 E -.25(va)-.25 G
-(da Central \(ft US\)).25 E(<epsg3431> : N)110.5 408 Q
-(AD83\(HARN\) / Ne)-.35 E -.25(va)-.25 G(da W).25 E(est \(ft US\))-.8 E
-(<epsg3432> : N)110.5 420 Q(AD83\(HARN\) / Ne)-.35 E 2.5(wJ)-.25 G(erse)
--2.5 E 2.5(y\()-.15 G(ft US\))-2.5 E(<epsg3433> : N)110.5 432 Q
-(AD83 / Arkansas North \(ftUS\))-.35 E(<epsg3434> : N)110.5 444 Q
-(AD83 / Arkansas South \(ftUS\))-.35 E(<epsg3435> : N)110.5 456 Q
-(AD83 / Illinois East \(ftUS\))-.35 E(<epsg3436> : N)110.5 468 Q
-(AD83 / Illinois W)-.35 E(est \(ftUS\))-.8 E(<epsg3437> : N)110.5 480 Q
-(AD83 / Ne)-.35 E 2.5(wH)-.25 G(ampshire \(ftUS\))-2.5 E(<epsg3438> : N)
-110.5 492 Q(AD83 / Rhode Island \(ftUS\))-.35 E
-(<epsg3439> : PSD93 / UTM zone 39N)110.5 504 Q
-(<epsg3440> : PSD93 / UTM zone 40N)110.5 516 Q(<epsg3441> : N)110.5 528
-Q(AD83\(HARN\) / Arkansas North \(ftUS\))-.35 E(<epsg3442> : N)110.5 540
-Q(AD83\(HARN\) / Arkansas South \(ftUS\))-.35 E(<epsg3443> : N)110.5 552
-Q(AD83\(HARN\) / Illinois East \(ftUS\))-.35 E(<epsg3444> : N)110.5 564
-Q(AD83\(HARN\) / Illinois W)-.35 E(est \(ftUS\))-.8 E(<epsg3445> : N)
-110.5 576 Q(AD83\(HARN\) / Ne)-.35 E 2.5(wH)-.25 G(ampshire \(ftUS\))
--2.5 E(<epsg3446> : N)110.5 588 Q(AD83\(HARN\) / Rhode Island \(ftUS\))
--.35 E(<epsg3447> : ETRS89 / Belgian Lambert 2005)110.5 600 Q
-(<epsg3448> : J)110.5 612 Q(AD2001 / Jamaica Metric Grid)-.6 E
-(<epsg3449> : J)110.5 624 Q(AD2001 / UTM zone 17N)-.6 E(<epsg3450> : J)
-110.5 636 Q(AD2001 / UTM zone 18N)-.6 E(<epsg3451> : N)110.5 648 Q
-(AD83 / Louisiana North \(ftUS\))-.35 E(<epsg3452> : N)110.5 660 Q
-(AD83 / Louisiana South \(ftUS\))-.35 E(<epsg3453> : N)110.5 672 Q
-(AD83 / Louisiana Of)-.35 E(fshore \(ftUS\))-.25 E(<epsg3454> : N)110.5
-684 Q(AD83 / South Dak)-.35 E(ota North \(ftUS\))-.1 E(<epsg3455> : N)
-110.5 696 Q(AD83 / South Dak)-.35 E(ota South \(ftUS\))-.1 E
-(<epsg3456> : N)110.5 708 Q(AD83\(HARN\) / Louisiana North \(ftUS\))-.35
-E(<epsg3457> : N)110.5 720 Q(AD83\(HARN\) / Louisiana South \(ftUS\))
--.35 E(MB-System 5.0)72 768 Q(29 No)132.205 E -.15(ve)-.15 G(mber 2014)
-.15 E(55)185.545 E 0 Cg EP
-%%Page: 56 56
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<epsg3458> : N)110.5 84 Q
-(AD83\(HARN\) / South Dak)-.35 E(ota North \(ftUS\))-.1 E
-(<epsg3459> : N)110.5 96 Q(AD83\(HARN\) / South Dak)-.35 E
-(ota South \(ftUS\))-.1 E(<epsg3460> : Fiji 1986 / Fiji Map Grid)110.5
-108 Q(<epsg3461> : Dabola 1981 / UTM zone 28N)110.5 120 Q
-(<epsg3462> : Dabola 1981 / UTM zone 29N)110.5 132 Q(<epsg3463> : N)
-110.5 144 Q(AD83 / Maine CS2000 Central)-.35 E(<epsg3464> : N)110.5 156
-Q(AD83\(HARN\) / Maine CS2000 Central)-.35 E(<epsg3465> : N)110.5 168 Q
-(AD83\(NSRS2007\) / Alabama East)-.35 E(<epsg3466> : N)110.5 180 Q
-(AD83\(NSRS2007\) / Alabama W)-.35 E(est)-.8 E(<epsg3467> : N)110.5 192
-Q(AD83\(NSRS2007\) / Alaska Albers)-.35 E(<epsg3468> : N)110.5 204 Q
-(AD83\(NSRS2007\) / Alaska zone 1)-.35 E(<epsg3469> : N)110.5 216 Q
-(AD83\(NSRS2007\) / Alaska zone 2)-.35 E(<epsg3470> : N)110.5 228 Q
-(AD83\(NSRS2007\) / Alaska zone 3)-.35 E(<epsg3471> : N)110.5 240 Q
-(AD83\(NSRS2007\) / Alaska zone 4)-.35 E(<epsg3472> : N)110.5 252 Q
-(AD83\(NSRS2007\) / Alaska zone 5)-.35 E(<epsg3473> : N)110.5 264 Q
-(AD83\(NSRS2007\) / Alaska zone 6)-.35 E(<epsg3474> : N)110.5 276 Q
-(AD83\(NSRS2007\) / Alaska zone 7)-.35 E(<epsg3475> : N)110.5 288 Q
-(AD83\(NSRS2007\) / Alaska zone 8)-.35 E(<epsg3476> : N)110.5 300 Q
-(AD83\(NSRS2007\) / Alaska zone 9)-.35 E(<epsg3477> : N)110.5 312 Q
-(AD83\(NSRS2007\) / Alaska zone 10)-.35 E(<epsg3478> : N)110.5 324 Q
-(AD83\(NSRS2007\) / Arizona Central)-.35 E(<epsg3479> : N)110.5 336 Q
-(AD83\(NSRS2007\) / Arizona Central \(ft\))-.35 E(<epsg3480> : N)110.5
-348 Q(AD83\(NSRS2007\) / Arizona East)-.35 E(<epsg3481> : N)110.5 360 Q
-(AD83\(NSRS2007\) / Arizona East \(ft\))-.35 E(<epsg3482> : N)110.5 372
-Q(AD83\(NSRS2007\) / Arizona W)-.35 E(est)-.8 E(<epsg3483> : N)110.5 384
-Q(AD83\(NSRS2007\) / Arizona W)-.35 E(est \(ft\))-.8 E(<epsg3484> : N)
-110.5 396 Q(AD83\(NSRS2007\) / Arkansas North)-.35 E(<epsg3485> : N)
-110.5 408 Q(AD83\(NSRS2007\) / Arkansas North \(ftUS\))-.35 E
-(<epsg3486> : N)110.5 420 Q(AD83\(NSRS2007\) / Arkansas South)-.35 E
-(<epsg3487> : N)110.5 432 Q(AD83\(NSRS2007\) / Arkansas South \(ftUS\))
--.35 E(<epsg3488> : N)110.5 444 Q(AD83\(NSRS2007\) / California Albers)
--.35 E(<epsg3489> : N)110.5 456 Q(AD83\(NSRS2007\) / California zone 1)
--.35 E(<epsg3490> : N)110.5 468 Q
-(AD83\(NSRS2007\) / California zone 1 \(ftUS\))-.35 E(<epsg3491> : N)
-110.5 480 Q(AD83\(NSRS2007\) / California zone 2)-.35 E(<epsg3492> : N)
-110.5 492 Q(AD83\(NSRS2007\) / California zone 2 \(ftUS\))-.35 E
-(<epsg3493> : N)110.5 504 Q(AD83\(NSRS2007\) / California zone 3)-.35 E
-(<epsg3494> : N)110.5 516 Q
-(AD83\(NSRS2007\) / California zone 3 \(ftUS\))-.35 E(<epsg3495> : N)
-110.5 528 Q(AD83\(NSRS2007\) / California zone 4)-.35 E(<epsg3496> : N)
-110.5 540 Q(AD83\(NSRS2007\) / California zone 4 \(ftUS\))-.35 E
-(<epsg3497> : N)110.5 552 Q(AD83\(NSRS2007\) / California zone 5)-.35 E
-(<epsg3498> : N)110.5 564 Q
-(AD83\(NSRS2007\) / California zone 5 \(ftUS\))-.35 E(<epsg3499> : N)
-110.5 576 Q(AD83\(NSRS2007\) / California zone 6)-.35 E(<epsg3500> : N)
-110.5 588 Q(AD83\(NSRS2007\) / California zone 6 \(ftUS\))-.35 E
-(<epsg3501> : N)110.5 600 Q(AD83\(NSRS2007\) / Colorado Central)-.35 E
-(<epsg3502> : N)110.5 612 Q
-(AD83\(NSRS2007\) / Colorado Central \(ftUS\))-.35 E(<epsg3503> : N)
-110.5 624 Q(AD83\(NSRS2007\) / Colorado North)-.35 E(<epsg3504> : N)
-110.5 636 Q(AD83\(NSRS2007\) / Colorado North \(ftUS\))-.35 E
-(<epsg3505> : N)110.5 648 Q(AD83\(NSRS2007\) / Colorado South)-.35 E
-(<epsg3506> : N)110.5 660 Q(AD83\(NSRS2007\) / Colorado South \(ftUS\))
--.35 E(<epsg3507> : N)110.5 672 Q(AD83\(NSRS2007\) / Connecticut)-.35 E
-(<epsg3508> : N)110.5 684 Q(AD83\(NSRS2007\) / Connecticut \(ftUS\))-.35
-E(<epsg3509> : N)110.5 696 Q(AD83\(NSRS2007\) / Dela)-.35 E -.1(wa)-.15
-G(re).1 E(<epsg3510> : N)110.5 708 Q(AD83\(NSRS2007\) / Dela)-.35 E -.1
-(wa)-.15 G(re \(ftUS\)).1 E(<epsg3511> : N)110.5 720 Q
-(AD83\(NSRS2007\) / Florida East)-.35 E(MB-System 5.0)72 768 Q(29 No)
-132.205 E -.15(ve)-.15 G(mber 2014).15 E(56)185.545 E 0 Cg EP
-%%Page: 57 57
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<epsg3512> : N)110.5 84 Q
-(AD83\(NSRS2007\) / Florida East \(ftUS\))-.35 E(<epsg3513> : N)110.5 96
-Q(AD83\(NSRS2007\) / Florida GDL Albers)-.35 E(<epsg3514> : N)110.5 108
-Q(AD83\(NSRS2007\) / Florida North)-.35 E(<epsg3515> : N)110.5 120 Q
-(AD83\(NSRS2007\) / Florida North \(ftUS\))-.35 E(<epsg3516> : N)110.5
-132 Q(AD83\(NSRS2007\) / Florida W)-.35 E(est)-.8 E(<epsg3517> : N)110.5
-144 Q(AD83\(NSRS2007\) / Florida W)-.35 E(est \(ftUS\))-.8 E
-(<epsg3518> : N)110.5 156 Q(AD83\(NSRS2007\) / Geor)-.35 E(gia East)-.18
-E(<epsg3519> : N)110.5 168 Q(AD83\(NSRS2007\) / Geor)-.35 E
-(gia East \(ftUS\))-.18 E(<epsg3520> : N)110.5 180 Q
-(AD83\(NSRS2007\) / Geor)-.35 E(gia W)-.18 E(est)-.8 E(<epsg3521> : N)
-110.5 192 Q(AD83\(NSRS2007\) / Geor)-.35 E(gia W)-.18 E(est \(ftUS\))-.8
-E(<epsg3522> : N)110.5 204 Q(AD83\(NSRS2007\) / Idaho Central)-.35 E
-(<epsg3523> : N)110.5 216 Q(AD83\(NSRS2007\) / Idaho Central \(ftUS\))
--.35 E(<epsg3524> : N)110.5 228 Q(AD83\(NSRS2007\) / Idaho East)-.35 E
-(<epsg3525> : N)110.5 240 Q(AD83\(NSRS2007\) / Idaho East \(ftUS\))-.35
-E(<epsg3526> : N)110.5 252 Q(AD83\(NSRS2007\) / Idaho W)-.35 E(est)-.8 E
-(<epsg3527> : N)110.5 264 Q(AD83\(NSRS2007\) / Idaho W)-.35 E
-(est \(ftUS\))-.8 E(<epsg3528> : N)110.5 276 Q
-(AD83\(NSRS2007\) / Illinois East)-.35 E(<epsg3529> : N)110.5 288 Q
-(AD83\(NSRS2007\) / Illinois East \(ftUS\))-.35 E(<epsg3530> : N)110.5
-300 Q(AD83\(NSRS2007\) / Illinois W)-.35 E(est)-.8 E(<epsg3531> : N)
-110.5 312 Q(AD83\(NSRS2007\) / Illinois W)-.35 E(est \(ftUS\))-.8 E
-(<epsg3532> : N)110.5 324 Q(AD83\(NSRS2007\) / Indiana East)-.35 E
-(<epsg3533> : N)110.5 336 Q(AD83\(NSRS2007\) / Indiana East \(ftUS\))
--.35 E(<epsg3534> : N)110.5 348 Q(AD83\(NSRS2007\) / Indiana W)-.35 E
-(est)-.8 E(<epsg3535> : N)110.5 360 Q(AD83\(NSRS2007\) / Indiana W)-.35
-E(est \(ftUS\))-.8 E(<epsg3536> : N)110.5 372 Q(AD83\(NSRS2007\) / Io)
--.35 E .2 -.1(wa N)-.25 H(orth).1 E(<epsg3537> : N)110.5 384 Q
-(AD83\(NSRS2007\) / Io)-.35 E .2 -.1(wa N)-.25 H(orth \(ft US\)).1 E
-(<epsg3538> : N)110.5 396 Q(AD83\(NSRS2007\) / Io)-.35 E .2 -.1(wa S)
--.25 H(outh).1 E(<epsg3539> : N)110.5 408 Q(AD83\(NSRS2007\) / Io)-.35 E
-.2 -.1(wa S)-.25 H(outh \(ft US\)).1 E(<epsg3540> : N)110.5 420 Q
-(AD83\(NSRS2007\) / Kansas North)-.35 E(<epsg3541> : N)110.5 432 Q
-(AD83\(NSRS2007\) / Kansas North \(ft US\))-.35 E(<epsg3542> : N)110.5
-444 Q(AD83\(NSRS2007\) / Kansas South)-.35 E(<epsg3543> : N)110.5 456 Q
-(AD83\(NSRS2007\) / Kansas South \(ft US\))-.35 E(<epsg3544> : N)110.5
-468 Q(AD83\(NSRS2007\) / K)-.35 E(entuck)-.25 E 2.5(yN)-.15 G(orth)-2.5
-E(<epsg3545> : N)110.5 480 Q(AD83\(NSRS2007\) / K)-.35 E(entuck)-.25 E
-2.5(yN)-.15 G(orth \(ftUS\))-2.5 E(<epsg3546> : N)110.5 492 Q
-(AD83\(NSRS2007\) / K)-.35 E(entuck)-.25 E 2.5(yS)-.15 G(ingle Zone)-2.5
-E(<epsg3547> : N)110.5 504 Q(AD83\(NSRS2007\) / K)-.35 E(entuck)-.25 E
-2.5(yS)-.15 G(ingle Zone \(ftUS\))-2.5 E(<epsg3548> : N)110.5 516 Q
-(AD83\(NSRS2007\) / K)-.35 E(entuck)-.25 E 2.5(yS)-.15 G(outh)-2.5 E
-(<epsg3549> : N)110.5 528 Q(AD83\(NSRS2007\) / K)-.35 E(entuck)-.25 E
-2.5(yS)-.15 G(outh \(ftUS\))-2.5 E(<epsg3550> : N)110.5 540 Q
-(AD83\(NSRS2007\) / Louisiana North)-.35 E(<epsg3551> : N)110.5 552 Q
-(AD83\(NSRS2007\) / Louisiana North \(ftUS\))-.35 E(<epsg3552> : N)110.5
-564 Q(AD83\(NSRS2007\) / Louisiana South)-.35 E(<epsg3553> : N)110.5 576
-Q(AD83\(NSRS2007\) / Louisiana South \(ftUS\))-.35 E(<epsg3554> : N)
-110.5 588 Q(AD83\(NSRS2007\) / Maine CS2000 Central)-.35 E
-(<epsg3555> : N)110.5 600 Q(AD83\(NSRS2007\) / Maine CS2000 East)-.35 E
-(<epsg3556> : N)110.5 612 Q(AD83\(NSRS2007\) / Maine CS2000 W)-.35 E
-(est)-.8 E(<epsg3557> : N)110.5 624 Q(AD83\(NSRS2007\) / Maine East)-.35
-E(<epsg3558> : N)110.5 636 Q(AD83\(NSRS2007\) / Maine W)-.35 E(est)-.8 E
-(<epsg3559> : N)110.5 648 Q(AD83\(NSRS2007\) / Maryland)-.35 E
-(<epsg3560> : N)110.5 660 Q(AD83 / Utah North \(ftUS\))-.35 E
-(<epsg3561> : Old Ha)110.5 672 Q -.1(wa)-.15 G(iian / Ha).1 E -.1(wa)
--.15 G(ii zone 1).1 E(<epsg3562> : Old Ha)110.5 684 Q -.1(wa)-.15 G
-(iian / Ha).1 E -.1(wa)-.15 G(ii zone 2).1 E(<epsg3563> : Old Ha)110.5
-696 Q -.1(wa)-.15 G(iian / Ha).1 E -.1(wa)-.15 G(ii zone 3).1 E
-(<epsg3564> : Old Ha)110.5 708 Q -.1(wa)-.15 G(iian / Ha).1 E -.1(wa)
--.15 G(ii zone 4).1 E(<epsg3565> : Old Ha)110.5 720 Q -.1(wa)-.15 G
-(iian / Ha).1 E -.1(wa)-.15 G(ii zone 5).1 E(MB-System 5.0)72 768 Q
-(29 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E(57)185.545 E 0 Cg EP
-%%Page: 58 58
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<epsg3566> : N)110.5 84 Q
-(AD83 / Utah Central \(ftUS\))-.35 E(<epsg3567> : N)110.5 96 Q
-(AD83 / Utah South \(ftUS\))-.35 E(<epsg3568> : N)110.5 108 Q
-(AD83\(HARN\) / Utah North \(ftUS\))-.35 E(<epsg3569> : N)110.5 120 Q
-(AD83\(HARN\) / Utah Central \(ftUS\))-.35 E(<epsg3570> : N)110.5 132 Q
-(AD83\(HARN\) / Utah South \(ftUS\))-.35 E
-(<epsg3571> : WGS 84 / North Pole LAEA Bering Sea)110.5 144 Q
-(<epsg3572> : WGS 84 / North Pole LAEA Alaska)110.5 156 Q
-(<epsg3573> : WGS 84 / North Pole LAEA Canada)110.5 168 Q
-(<epsg3574> : WGS 84 / North Pole LAEA Atlantic)110.5 180 Q
-(<epsg3575> : WGS 84 / North Pole LAEA Europe)110.5 192 Q
-(<epsg3576> : WGS 84 / North Pole LAEA Russia)110.5 204 Q
-(<epsg3577> : GD)110.5 216 Q(A94 / Australian Albers)-.4 E
-(<epsg3578> : N)110.5 228 Q(AD83 / Y)-.35 E(uk)-1.11 E(on Albers)-.1 E
-(<epsg3579> : N)110.5 240 Q(AD83\(CSRS\) / Y)-.35 E(uk)-1.11 E
-(on Albers)-.1 E(<epsg3580> : N)110.5 252 Q(AD83 / NWT Lambert)-.35 E
-(<epsg3581> : N)110.5 264 Q(AD83\(CSRS\) / NWT Lambert)-.35 E
-(<epsg3582> : N)110.5 276 Q(AD83\(NSRS2007\) / Maryland \(ftUS\))-.35 E
-(<epsg3583> : N)110.5 288 Q(AD83\(NSRS2007\) / Massachusetts Island)-.35
-E(<epsg3584> : N)110.5 300 Q
-(AD83\(NSRS2007\) / Massachusetts Island \(ftUS\))-.35 E(<epsg3585> : N)
-110.5 312 Q(AD83\(NSRS2007\) / Massachusetts Mainland)-.35 E
-(<epsg3586> : N)110.5 324 Q
-(AD83\(NSRS2007\) / Massachusetts Mainland \(ftUS\))-.35 E
-(<epsg3587> : N)110.5 336 Q(AD83\(NSRS2007\) / Michig)-.35 E(an Central)
--.05 E(<epsg3588> : N)110.5 348 Q(AD83\(NSRS2007\) / Michig)-.35 E
-(an Central \(ft\))-.05 E(<epsg3589> : N)110.5 360 Q
-(AD83\(NSRS2007\) / Michig)-.35 E(an North)-.05 E(<epsg3590> : N)110.5
-372 Q(AD83\(NSRS2007\) / Michig)-.35 E(an North \(ft\))-.05 E
-(<epsg3591> : N)110.5 384 Q(AD83\(NSRS2007\) / Michig)-.35 E
-(an Oblique Mercator)-.05 E(<epsg3592> : N)110.5 396 Q
-(AD83\(NSRS2007\) / Michig)-.35 E(an South)-.05 E(<epsg3593> : N)110.5
-408 Q(AD83\(NSRS2007\) / Michig)-.35 E(an South \(ft\))-.05 E
-(<epsg3594> : N)110.5 420 Q(AD83\(NSRS2007\) / Minnesota Central)-.35 E
-(<epsg3595> : N)110.5 432 Q(AD83\(NSRS2007\) / Minnesota North)-.35 E
-(<epsg3596> : N)110.5 444 Q(AD83\(NSRS2007\) / Minnesota South)-.35 E
-(<epsg3597> : N)110.5 456 Q(AD83\(NSRS2007\) / Mississippi East)-.35 E
-(<epsg3598> : N)110.5 468 Q
-(AD83\(NSRS2007\) / Mississippi East \(ftUS\))-.35 E(<epsg3599> : N)
-110.5 480 Q(AD83\(NSRS2007\) / Mississippi W)-.35 E(est)-.8 E
-(<epsg3600> : N)110.5 492 Q(AD83\(NSRS2007\) / Mississippi W)-.35 E
-(est \(ftUS\))-.8 E(<epsg3601> : N)110.5 504 Q
-(AD83\(NSRS2007\) / Missouri Central)-.35 E(<epsg3602> : N)110.5 516 Q
-(AD83\(NSRS2007\) / Missouri East)-.35 E(<epsg3603> : N)110.5 528 Q
-(AD83\(NSRS2007\) / Missouri W)-.35 E(est)-.8 E(<epsg3604> : N)110.5 540
-Q(AD83\(NSRS2007\) / Montana)-.35 E(<epsg3605> : N)110.5 552 Q
-(AD83\(NSRS2007\) / Montana \(ft\))-.35 E(<epsg3606> : N)110.5 564 Q
-(AD83\(NSRS2007\) / Nebraska)-.35 E(<epsg3607> : N)110.5 576 Q
-(AD83\(NSRS2007\) / Ne)-.35 E -.25(va)-.25 G(da Central).25 E
-(<epsg3608> : N)110.5 588 Q(AD83\(NSRS2007\) / Ne)-.35 E -.25(va)-.25 G
-(da Central \(ft US\)).25 E(<epsg3609> : N)110.5 600 Q
-(AD83\(NSRS2007\) / Ne)-.35 E -.25(va)-.25 G(da East).25 E
-(<epsg3610> : N)110.5 612 Q(AD83\(NSRS2007\) / Ne)-.35 E -.25(va)-.25 G
-(da East \(ft US\)).25 E(<epsg3611> : N)110.5 624 Q
-(AD83\(NSRS2007\) / Ne)-.35 E -.25(va)-.25 G(da W).25 E(est)-.8 E
-(<epsg3612> : N)110.5 636 Q(AD83\(NSRS2007\) / Ne)-.35 E -.25(va)-.25 G
-(da W).25 E(est \(ft US\))-.8 E(<epsg3613> : N)110.5 648 Q
-(AD83\(NSRS2007\) / Ne)-.35 E 2.5(wH)-.25 G(ampshire)-2.5 E
-(<epsg3614> : N)110.5 660 Q(AD83\(NSRS2007\) / Ne)-.35 E 2.5(wH)-.25 G
-(ampshire \(ftUS\))-2.5 E(<epsg3615> : N)110.5 672 Q
-(AD83\(NSRS2007\) / Ne)-.35 E 2.5(wJ)-.25 G(erse)-2.5 E(y)-.15 E
-(<epsg3616> : N)110.5 684 Q(AD83\(NSRS2007\) / Ne)-.35 E 2.5(wJ)-.25 G
-(erse)-2.5 E 2.5(y\()-.15 G(ft US\))-2.5 E(<epsg3617> : N)110.5 696 Q
-(AD83\(NSRS2007\) / Ne)-.35 E 2.5(wM)-.25 G -.15(ex)-2.5 G(ico Central)
-.15 E(<epsg3618> : N)110.5 708 Q(AD83\(NSRS2007\) / Ne)-.35 E 2.5(wM)
--.25 G -.15(ex)-2.5 G(ico Central \(ftUS\)).15 E(<epsg3619> : N)110.5
-720 Q(AD83\(NSRS2007\) / Ne)-.35 E 2.5(wM)-.25 G -.15(ex)-2.5 G
-(ico East).15 E(MB-System 5.0)72 768 Q(29 No)132.205 E -.15(ve)-.15 G
-(mber 2014).15 E(58)185.545 E 0 Cg EP
-%%Page: 59 59
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<epsg3620> : N)110.5 84 Q(AD83\(NSRS2007\) / Ne)
--.35 E 2.5(wM)-.25 G -.15(ex)-2.5 G(ico East \(ftUS\)).15 E
-(<epsg3621> : N)110.5 96 Q(AD83\(NSRS2007\) / Ne)-.35 E 2.5(wM)-.25 G
--.15(ex)-2.5 G(ico W).15 E(est)-.8 E(<epsg3622> : N)110.5 108 Q
-(AD83\(NSRS2007\) / Ne)-.35 E 2.5(wM)-.25 G -.15(ex)-2.5 G(ico W).15 E
-(est \(ftUS\))-.8 E(<epsg3623> : N)110.5 120 Q(AD83\(NSRS2007\) / Ne)
--.35 E 2.5(wY)-.25 G(ork Central)-3.6 E(<epsg3624> : N)110.5 132 Q
-(AD83\(NSRS2007\) / Ne)-.35 E 2.5(wY)-.25 G(ork Central \(ftUS\))-3.6 E
-(<epsg3625> : N)110.5 144 Q(AD83\(NSRS2007\) / Ne)-.35 E 2.5(wY)-.25 G
-(ork East)-3.6 E(<epsg3626> : N)110.5 156 Q(AD83\(NSRS2007\) / Ne)-.35 E
-2.5(wY)-.25 G(ork East \(ftUS\))-3.6 E(<epsg3627> : N)110.5 168 Q
-(AD83\(NSRS2007\) / Ne)-.35 E 2.5(wY)-.25 G(ork Long Island)-3.6 E
-(<epsg3628> : N)110.5 180 Q(AD83\(NSRS2007\) / Ne)-.35 E 2.5(wY)-.25 G
-(ork Long Island \(ftUS\))-3.6 E(<epsg3629> : N)110.5 192 Q
-(AD83\(NSRS2007\) / Ne)-.35 E 2.5(wY)-.25 G(ork W)-3.6 E(est)-.8 E
-(<epsg3630> : N)110.5 204 Q(AD83\(NSRS2007\) / Ne)-.35 E 2.5(wY)-.25 G
-(ork W)-3.6 E(est \(ftUS\))-.8 E(<epsg3631> : N)110.5 216 Q
-(AD83\(NSRS2007\) / North Carolina)-.35 E(<epsg3632> : N)110.5 228 Q
-(AD83\(NSRS2007\) / North Carolina \(ftUS\))-.35 E(<epsg3633> : N)110.5
-240 Q(AD83\(NSRS2007\) / North Dak)-.35 E(ota North)-.1 E
-(<epsg3634> : N)110.5 252 Q(AD83\(NSRS2007\) / North Dak)-.35 E
-(ota North \(ft\))-.1 E(<epsg3635> : N)110.5 264 Q
-(AD83\(NSRS2007\) / North Dak)-.35 E(ota South)-.1 E(<epsg3636> : N)
-110.5 276 Q(AD83\(NSRS2007\) / North Dak)-.35 E(ota South \(ft\))-.1 E
-(<epsg3637> : N)110.5 288 Q(AD83\(NSRS2007\) / Ohio North)-.35 E
-(<epsg3638> : N)110.5 300 Q(AD83\(NSRS2007\) / Ohio South)-.35 E
-(<epsg3639> : N)110.5 312 Q(AD83\(NSRS2007\) / Oklahoma North)-.35 E
-(<epsg3640> : N)110.5 324 Q(AD83\(NSRS2007\) / Oklahoma North \(ftUS\))
--.35 E(<epsg3641> : N)110.5 336 Q(AD83\(NSRS2007\) / Oklahoma South)-.35
-E(<epsg3642> : N)110.5 348 Q(AD83\(NSRS2007\) / Oklahoma South \(ftUS\))
--.35 E(<epsg3643> : N)110.5 360 Q(AD83\(NSRS2007\) / Ore)-.35 E
-(gon Lambert)-.15 E(<epsg3644> : N)110.5 372 Q(AD83\(NSRS2007\) / Ore)
--.35 E(gon Lambert \(ft\))-.15 E(<epsg3645> : N)110.5 384 Q
-(AD83\(NSRS2007\) / Ore)-.35 E(gon North)-.15 E(<epsg3646> : N)110.5 396
-Q(AD83\(NSRS2007\) / Ore)-.35 E(gon North \(ft\))-.15 E(<epsg3647> : N)
-110.5 408 Q(AD83\(NSRS2007\) / Ore)-.35 E(gon South)-.15 E
-(<epsg3648> : N)110.5 420 Q(AD83\(NSRS2007\) / Ore)-.35 E
-(gon South \(ft\))-.15 E(<epsg3649> : N)110.5 432 Q
-(AD83\(NSRS2007\) / Pennsylv)-.35 E(ania North)-.25 E(<epsg3650> : N)
-110.5 444 Q(AD83\(NSRS2007\) / Pennsylv)-.35 E(ania North \(ftUS\))-.25
-E(<epsg3651> : N)110.5 456 Q(AD83\(NSRS2007\) / Pennsylv)-.35 E
-(ania South)-.25 E(<epsg3652> : N)110.5 468 Q
-(AD83\(NSRS2007\) / Pennsylv)-.35 E(ania South \(ftUS\))-.25 E
-(<epsg3653> : N)110.5 480 Q(AD83\(NSRS2007\) / Rhode Island)-.35 E
-(<epsg3654> : N)110.5 492 Q(AD83\(NSRS2007\) / Rhode Island \(ftUS\))
--.35 E(<epsg3655> : N)110.5 504 Q(AD83\(NSRS2007\) / South Carolina)-.35
-E(<epsg3656> : N)110.5 516 Q(AD83\(NSRS2007\) / South Carolina \(ft\))
--.35 E(<epsg3657> : N)110.5 528 Q(AD83\(NSRS2007\) / South Dak)-.35 E
-(ota North)-.1 E(<epsg3658> : N)110.5 540 Q
-(AD83\(NSRS2007\) / South Dak)-.35 E(ota North \(ftUS\))-.1 E
-(<epsg3659> : N)110.5 552 Q(AD83\(NSRS2007\) / South Dak)-.35 E
-(ota South)-.1 E(<epsg3660> : N)110.5 564 Q
-(AD83\(NSRS2007\) / South Dak)-.35 E(ota South \(ftUS\))-.1 E
-(<epsg3661> : N)110.5 576 Q(AD83\(NSRS2007\) / T)-.35 E(ennessee)-.7 E
-(<epsg3662> : N)110.5 588 Q(AD83\(NSRS2007\) / T)-.35 E
-(ennessee \(ftUS\))-.7 E(<epsg3663> : N)110.5 600 Q
-(AD83\(NSRS2007\) / T)-.35 E -.15(ex)-.7 G(as Central).15 E
-(<epsg3664> : N)110.5 612 Q(AD83\(NSRS2007\) / T)-.35 E -.15(ex)-.7 G
-(as Central \(ftUS\)).15 E(<epsg3665> : N)110.5 624 Q
-(AD83\(NSRS2007\) / T)-.35 E -.15(ex)-.7 G(as Centric Albers Equal Area)
-.15 E(<epsg3666> : N)110.5 636 Q(AD83\(NSRS2007\) / T)-.35 E -.15(ex)-.7
-G(as Centric Lambert Conformal).15 E(<epsg3667> : N)110.5 648 Q
-(AD83\(NSRS2007\) / T)-.35 E -.15(ex)-.7 G(as North).15 E
-(<epsg3668> : N)110.5 660 Q(AD83\(NSRS2007\) / T)-.35 E -.15(ex)-.7 G
-(as North \(ftUS\)).15 E(<epsg3669> : N)110.5 672 Q
-(AD83\(NSRS2007\) / T)-.35 E -.15(ex)-.7 G(as North Central).15 E
-(<epsg3670> : N)110.5 684 Q(AD83\(NSRS2007\) / T)-.35 E -.15(ex)-.7 G
-(as North Central \(ftUS\)).15 E(<epsg3671> : N)110.5 696 Q
-(AD83\(NSRS2007\) / T)-.35 E -.15(ex)-.7 G(as South).15 E
-(<epsg3672> : N)110.5 708 Q(AD83\(NSRS2007\) / T)-.35 E -.15(ex)-.7 G
-(as South \(ftUS\)).15 E(<epsg3673> : N)110.5 720 Q
-(AD83\(NSRS2007\) / T)-.35 E -.15(ex)-.7 G(as South Central).15 E
-(MB-System 5.0)72 768 Q(29 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E
-(59)185.545 E 0 Cg EP
-%%Page: 60 60
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<epsg3674> : N)110.5 84 Q(AD83\(NSRS2007\) / T)
--.35 E -.15(ex)-.7 G(as South Central \(ftUS\)).15 E(<epsg3675> : N)
-110.5 96 Q(AD83\(NSRS2007\) / Utah Central)-.35 E(<epsg3676> : N)110.5
-108 Q(AD83\(NSRS2007\) / Utah Central \(ft\))-.35 E(<epsg3677> : N)110.5
-120 Q(AD83\(NSRS2007\) / Utah Central \(ftUS\))-.35 E(<epsg3678> : N)
-110.5 132 Q(AD83\(NSRS2007\) / Utah North)-.35 E(<epsg3679> : N)110.5
-144 Q(AD83\(NSRS2007\) / Utah North \(ft\))-.35 E(<epsg3680> : N)110.5
-156 Q(AD83\(NSRS2007\) / Utah North \(ftUS\))-.35 E(<epsg3681> : N)110.5
-168 Q(AD83\(NSRS2007\) / Utah South)-.35 E(<epsg3682> : N)110.5 180 Q
-(AD83\(NSRS2007\) / Utah South \(ft\))-.35 E(<epsg3683> : N)110.5 192 Q
-(AD83\(NSRS2007\) / Utah South \(ftUS\))-.35 E(<epsg3684> : N)110.5 204
-Q(AD83\(NSRS2007\) / V)-.35 E(ermont)-1.11 E(<epsg3685> : N)110.5 216 Q
-(AD83\(NSRS2007\) / V)-.35 E(ir)-.6 E(ginia North)-.18 E(<epsg3686> : N)
-110.5 228 Q(AD83\(NSRS2007\) / V)-.35 E(ir)-.6 E(ginia North \(ftUS\))
--.18 E(<epsg3687> : N)110.5 240 Q(AD83\(NSRS2007\) / V)-.35 E(ir)-.6 E
-(ginia South)-.18 E(<epsg3688> : N)110.5 252 Q(AD83\(NSRS2007\) / V)-.35
-E(ir)-.6 E(ginia South \(ftUS\))-.18 E(<epsg3689> : N)110.5 264 Q
-(AD83\(NSRS2007\) / W)-.35 E(ashington North)-.8 E(<epsg3690> : N)110.5
-276 Q(AD83\(NSRS2007\) / W)-.35 E(ashington North \(ftUS\))-.8 E
-(<epsg3691> : N)110.5 288 Q(AD83\(NSRS2007\) / W)-.35 E(ashington South)
--.8 E(<epsg3692> : N)110.5 300 Q(AD83\(NSRS2007\) / W)-.35 E
-(ashington South \(ftUS\))-.8 E(<epsg3693> : N)110.5 312 Q
-(AD83\(NSRS2007\) / W)-.35 E(est V)-.8 E(ir)-.6 E(ginia North)-.18 E
-(<epsg3694> : N)110.5 324 Q(AD83\(NSRS2007\) / W)-.35 E(est V)-.8 E(ir)
--.6 E(ginia South)-.18 E(<epsg3695> : N)110.5 336 Q
-(AD83\(NSRS2007\) / W)-.35 E(isconsin Central)-.4 E(<epsg3696> : N)110.5
-348 Q(AD83\(NSRS2007\) / W)-.35 E(isconsin Central \(ftUS\))-.4 E
-(<epsg3697> : N)110.5 360 Q(AD83\(NSRS2007\) / W)-.35 E(isconsin North)
--.4 E(<epsg3698> : N)110.5 372 Q(AD83\(NSRS2007\) / W)-.35 E
-(isconsin North \(ftUS\))-.4 E(<epsg3699> : N)110.5 384 Q
-(AD83\(NSRS2007\) / W)-.35 E(isconsin South)-.4 E(<epsg3700> : N)110.5
-396 Q(AD83\(NSRS2007\) / W)-.35 E(isconsin South \(ftUS\))-.4 E
-(<epsg3701> : N)110.5 408 Q(AD83\(NSRS2007\) / W)-.35 E(isconsin T)-.4 E
-(ransv)-.35 E(erse Mercator)-.15 E(<epsg3702> : N)110.5 420 Q
-(AD83\(NSRS2007\) / W)-.35 E(yoming East)-.73 E(<epsg3703> : N)110.5 432
-Q(AD83\(NSRS2007\) / W)-.35 E(yoming East Central)-.73 E(<epsg3704> : N)
-110.5 444 Q(AD83\(NSRS2007\) / W)-.35 E(yoming W)-.73 E(est Central)-.8
-E(<epsg3705> : N)110.5 456 Q(AD83\(NSRS2007\) / W)-.35 E(yoming W)-.73 E
-(est)-.8 E(<epsg3706> : N)110.5 468 Q(AD83\(NSRS2007\) / UTM zone 59N)
--.35 E(<epsg3707> : N)110.5 480 Q(AD83\(NSRS2007\) / UTM zone 60N)-.35 E
-(<epsg3708> : N)110.5 492 Q(AD83\(NSRS2007\) / UTM zone 1N)-.35 E
-(<epsg3709> : N)110.5 504 Q(AD83\(NSRS2007\) / UTM zone 2N)-.35 E
-(<epsg3710> : N)110.5 516 Q(AD83\(NSRS2007\) / UTM zone 3N)-.35 E
-(<epsg3711> : N)110.5 528 Q(AD83\(NSRS2007\) / UTM zone 4N)-.35 E
-(<epsg3712> : N)110.5 540 Q(AD83\(NSRS2007\) / UTM zone 5N)-.35 E
-(<epsg3713> : N)110.5 552 Q(AD83\(NSRS2007\) / UTM zone 6N)-.35 E
-(<epsg3714> : N)110.5 564 Q(AD83\(NSRS2007\) / UTM zone 7N)-.35 E
-(<epsg3715> : N)110.5 576 Q(AD83\(NSRS2007\) / UTM zone 8N)-.35 E
-(<epsg3716> : N)110.5 588 Q(AD83\(NSRS2007\) / UTM zone 9N)-.35 E
-(<epsg3717> : N)110.5 600 Q(AD83\(NSRS2007\) / UTM zone 10N)-.35 E
-(<epsg3718> : N)110.5 612 Q(AD83\(NSRS2007\) / UTM zone 11N)-.35 E
-(<epsg3719> : N)110.5 624 Q(AD83\(NSRS2007\) / UTM zone 12N)-.35 E
-(<epsg3720> : N)110.5 636 Q(AD83\(NSRS2007\) / UTM zone 13N)-.35 E
-(<epsg3721> : N)110.5 648 Q(AD83\(NSRS2007\) / UTM zone 14N)-.35 E
-(<epsg3722> : N)110.5 660 Q(AD83\(NSRS2007\) / UTM zone 15N)-.35 E
-(<epsg3723> : N)110.5 672 Q(AD83\(NSRS2007\) / UTM zone 16N)-.35 E
-(<epsg3724> : N)110.5 684 Q(AD83\(NSRS2007\) / UTM zone 17N)-.35 E
-(<epsg3725> : N)110.5 696 Q(AD83\(NSRS2007\) / UTM zone 18N)-.35 E
-(<epsg3726> : N)110.5 708 Q(AD83\(NSRS2007\) / UTM zone 19N)-.35 E
-(<epsg3727> : Reunion 1947 / TM Reunion)110.5 720 Q(MB-System 5.0)72 768
-Q(29 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E(60)185.545 E 0 Cg EP
-%%Page: 61 61
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<epsg3728> : N)110.5 84 Q
-(AD83\(NSRS2007\) / Ohio North \(ftUS\))-.35 E(<epsg3729> : N)110.5 96 Q
-(AD83\(NSRS2007\) / Ohio South \(ftUS\))-.35 E(<epsg3730> : N)110.5 108
-Q(AD83\(NSRS2007\) / W)-.35 E(yoming East \(ftUS\))-.73 E
-(<epsg3731> : N)110.5 120 Q(AD83\(NSRS2007\) / W)-.35 E
-(yoming East Central \(ftUS\))-.73 E(<epsg3732> : N)110.5 132 Q
-(AD83\(NSRS2007\) / W)-.35 E(yoming W)-.73 E(est Central \(ftUS\))-.8 E
-(<epsg3733> : N)110.5 144 Q(AD83\(NSRS2007\) / W)-.35 E(yoming W)-.73 E
-(est \(ftUS\))-.8 E(<epsg3734> : N)110.5 156 Q
-(AD83 / Ohio North \(ftUS\))-.35 E(<epsg3735> : N)110.5 168 Q
-(AD83 / Ohio South \(ftUS\))-.35 E(<epsg3736> : N)110.5 180 Q(AD83 / W)
--.35 E(yoming East \(ftUS\))-.73 E(<epsg3737> : N)110.5 192 Q(AD83 / W)
--.35 E(yoming East Central \(ftUS\))-.73 E(<epsg3738> : N)110.5 204 Q
-(AD83 / W)-.35 E(yoming W)-.73 E(est Central \(ftUS\))-.8 E
-(<epsg3739> : N)110.5 216 Q(AD83 / W)-.35 E(yoming W)-.73 E
-(est \(ftUS\))-.8 E(<epsg3740> : N)110.5 228 Q
-(AD83\(HARN\) / UTM zone 10N)-.35 E(<epsg3741> : N)110.5 240 Q
-(AD83\(HARN\) / UTM zone 11N)-.35 E(<epsg3742> : N)110.5 252 Q
-(AD83\(HARN\) / UTM zone 12N)-.35 E(<epsg3743> : N)110.5 264 Q
-(AD83\(HARN\) / UTM zone 13N)-.35 E(<epsg3744> : N)110.5 276 Q
-(AD83\(HARN\) / UTM zone 14N)-.35 E(<epsg3745> : N)110.5 288 Q
-(AD83\(HARN\) / UTM zone 15N)-.35 E(<epsg3746> : N)110.5 300 Q
-(AD83\(HARN\) / UTM zone 16N)-.35 E(<epsg3747> : N)110.5 312 Q
-(AD83\(HARN\) / UTM zone 17N)-.35 E(<epsg3748> : N)110.5 324 Q
-(AD83\(HARN\) / UTM zone 18N)-.35 E(<epsg3749> : N)110.5 336 Q
-(AD83\(HARN\) / UTM zone 19N)-.35 E(<epsg3750> : N)110.5 348 Q
-(AD83\(HARN\) / UTM zone 4N)-.35 E(<epsg3751> : N)110.5 360 Q
-(AD83\(HARN\) / UTM zone 5N)-.35 E(<epsg3752> : WGS 84 / Mercator 41)
-110.5 372 Q(<epsg3753> : N)110.5 384 Q
-(AD83\(HARN\) / Ohio North \(ftUS\))-.35 E(<epsg3754> : N)110.5 396 Q
-(AD83\(HARN\) / Ohio South \(ftUS\))-.35 E(<epsg3755> : N)110.5 408 Q
-(AD83\(HARN\) / W)-.35 E(yoming East \(ftUS\))-.73 E(<epsg3756> : N)
-110.5 420 Q(AD83\(HARN\) / W)-.35 E(yoming East Central \(ftUS\))-.73 E
-(<epsg3757> : N)110.5 432 Q(AD83\(HARN\) / W)-.35 E(yoming W)-.73 E
-(est Central \(ftUS\))-.8 E(<epsg3758> : N)110.5 444 Q(AD83\(HARN\) / W)
--.35 E(yoming W)-.73 E(est \(ftUS\))-.8 E(<epsg3759> : N)110.5 456 Q
-(AD83 / Ha)-.35 E -.1(wa)-.15 G(ii zone 3 \(ftUS\)).1 E(<epsg3760> : N)
-110.5 468 Q(AD83\(HARN\) / Ha)-.35 E -.1(wa)-.15 G(ii zone 3 \(ftUS\)).1
-E(<epsg3761> : N)110.5 480 Q(AD83\(CSRS\) / UTM zone 22N)-.35 E
-(<epsg3762> : WGS 84 / South Geor)110.5 492 Q(gia Lambert)-.18 E
-(<epsg3920> : Puerto Rico / UTM zone 20N)110.5 504 Q
-(<epsg3991> : Puerto Rico State Plane CS of 1927)110.5 516 Q
-(<epsg3992> : Puerto Rico / St. Croix)110.5 528 Q(<epsg20004> : Pulk)
-110.5 540 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger zone 4)-2.5 E
-(<epsg20005> : Pulk)110.5 552 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger zone 5)-2.5 E(<epsg20006> : Pulk)110.5 564 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger zone 6)-2.5 E
-(<epsg20007> : Pulk)110.5 576 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger zone 7)-2.5 E(<epsg20008> : Pulk)110.5 588 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger zone 8)-2.5 E
-(<epsg20009> : Pulk)110.5 600 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger zone 9)-2.5 E(<epsg20010> : Pulk)110.5 612 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger zone 10)-2.5 E
-(<epsg20011> : Pulk)110.5 624 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger zone 11)-2.5 E(<epsg20012> : Pulk)110.5 636 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger zone 12)-2.5 E
-(<epsg20013> : Pulk)110.5 648 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger zone 13)-2.5 E(<epsg20014> : Pulk)110.5 660 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger zone 14)-2.5 E
-(<epsg20015> : Pulk)110.5 672 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger zone 15)-2.5 E(<epsg20016> : Pulk)110.5 684 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger zone 16)-2.5 E
-(<epsg20017> : Pulk)110.5 696 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger zone 17)-2.5 E(<epsg20018> : Pulk)110.5 708 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger zone 18)-2.5 E
-(<epsg20019> : Pulk)110.5 720 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger zone 19)-2.5 E(MB-System 5.0)72 768 Q(29 No)132.205
-E -.15(ve)-.15 G(mber 2014).15 E(61)185.545 E 0 Cg EP
-%%Page: 62 62
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<epsg20020> : Pulk)110.5 84 Q -.15(ov)-.1 G 2.5
-(o1)-.05 G(995 / Gauss-Kruger zone 20)-2.5 E(<epsg20021> : Pulk)110.5 96
-Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger zone 21)-2.5 E
-(<epsg20022> : Pulk)110.5 108 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger zone 22)-2.5 E(<epsg20023> : Pulk)110.5 120 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger zone 23)-2.5 E
-(<epsg20024> : Pulk)110.5 132 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger zone 24)-2.5 E(<epsg20025> : Pulk)110.5 144 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger zone 25)-2.5 E
-(<epsg20026> : Pulk)110.5 156 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger zone 26)-2.5 E(<epsg20027> : Pulk)110.5 168 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger zone 27)-2.5 E
-(<epsg20028> : Pulk)110.5 180 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger zone 28)-2.5 E(<epsg20029> : Pulk)110.5 192 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger zone 29)-2.5 E
-(<epsg20030> : Pulk)110.5 204 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger zone 30)-2.5 E(<epsg20031> : Pulk)110.5 216 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger zone 31)-2.5 E
-(<epsg20032> : Pulk)110.5 228 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger zone 32)-2.5 E(<epsg20064> : Pulk)110.5 240 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger 4N \(deprecated\))-2.5 E
-(<epsg20065> : Pulk)110.5 252 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger 5N \(deprecated\))-2.5 E(<epsg20066> : Pulk)110.5
-264 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger 6N \(deprecated\))
--2.5 E(<epsg20067> : Pulk)110.5 276 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger 7N \(deprecated\))-2.5 E(<epsg20068> : Pulk)110.5
-288 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger 8N \(deprecated\))
--2.5 E(<epsg20069> : Pulk)110.5 300 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger 9N \(deprecated\))-2.5 E(<epsg20070> : Pulk)110.5
-312 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger 10N \(deprecated\))
--2.5 E(<epsg20071> : Pulk)110.5 324 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger 11N \(deprecated\))-2.5 E(<epsg20072> : Pulk)110.5
-336 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger 12N \(deprecated\))
--2.5 E(<epsg20073> : Pulk)110.5 348 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger 13N \(deprecated\))-2.5 E(<epsg20074> : Pulk)110.5
-360 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger 14N \(deprecated\))
--2.5 E(<epsg20075> : Pulk)110.5 372 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger 15N \(deprecated\))-2.5 E(<epsg20076> : Pulk)110.5
-384 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger 16N \(deprecated\))
--2.5 E(<epsg20077> : Pulk)110.5 396 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger 17N \(deprecated\))-2.5 E(<epsg20078> : Pulk)110.5
-408 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger 18N \(deprecated\))
--2.5 E(<epsg20079> : Pulk)110.5 420 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger 19N \(deprecated\))-2.5 E(<epsg20080> : Pulk)110.5
-432 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger 20N \(deprecated\))
--2.5 E(<epsg20081> : Pulk)110.5 444 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger 21N \(deprecated\))-2.5 E(<epsg20082> : Pulk)110.5
-456 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger 22N \(deprecated\))
--2.5 E(<epsg20083> : Pulk)110.5 468 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger 23N \(deprecated\))-2.5 E(<epsg20084> : Pulk)110.5
-480 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger 24N \(deprecated\))
--2.5 E(<epsg20085> : Pulk)110.5 492 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger 25N \(deprecated\))-2.5 E(<epsg20086> : Pulk)110.5
-504 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger 26N \(deprecated\))
--2.5 E(<epsg20087> : Pulk)110.5 516 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger 27N \(deprecated\))-2.5 E(<epsg20088> : Pulk)110.5
-528 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger 28N \(deprecated\))
--2.5 E(<epsg20089> : Pulk)110.5 540 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger 29N \(deprecated\))-2.5 E(<epsg20090> : Pulk)110.5
-552 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger 30N \(deprecated\))
--2.5 E(<epsg20091> : Pulk)110.5 564 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger 31N \(deprecated\))-2.5 E(<epsg20092> : Pulk)110.5
-576 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger 32N \(deprecated\))
--2.5 E(<epsg20135> : Adindan / UTM zone 35N)110.5 588 Q
-(<epsg20136> : Adindan / UTM zone 36N)110.5 600 Q
-(<epsg20137> : Adindan / UTM zone 37N)110.5 612 Q
-(<epsg20138> : Adindan / UTM zone 38N)110.5 624 Q(<epsg20248> : A)110.5
-636 Q(GD66 / AMG zone 48)-.4 E(<epsg20249> : A)110.5 648 Q
-(GD66 / AMG zone 49)-.4 E(<epsg20250> : A)110.5 660 Q
-(GD66 / AMG zone 50)-.4 E(<epsg20251> : A)110.5 672 Q
-(GD66 / AMG zone 51)-.4 E(<epsg20252> : A)110.5 684 Q
-(GD66 / AMG zone 52)-.4 E(<epsg20253> : A)110.5 696 Q
-(GD66 / AMG zone 53)-.4 E(<epsg20254> : A)110.5 708 Q
-(GD66 / AMG zone 54)-.4 E(<epsg20255> : A)110.5 720 Q
-(GD66 / AMG zone 55)-.4 E(MB-System 5.0)72 768 Q(29 No)132.205 E -.15
-(ve)-.15 G(mber 2014).15 E(62)185.545 E 0 Cg EP
-%%Page: 63 63
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<epsg20256> : A)110.5 84 Q(GD66 / AMG zone 56)-.4
-E(<epsg20257> : A)110.5 96 Q(GD66 / AMG zone 57)-.4 E(<epsg20258> : A)
-110.5 108 Q(GD66 / AMG zone 58)-.4 E(<epsg20348> : A)110.5 120 Q
-(GD84 / AMG zone 48)-.4 E(<epsg20349> : A)110.5 132 Q
-(GD84 / AMG zone 49)-.4 E(<epsg20350> : A)110.5 144 Q
-(GD84 / AMG zone 50)-.4 E(<epsg20351> : A)110.5 156 Q
-(GD84 / AMG zone 51)-.4 E(<epsg20352> : A)110.5 168 Q
-(GD84 / AMG zone 52)-.4 E(<epsg20353> : A)110.5 180 Q
-(GD84 / AMG zone 53)-.4 E(<epsg20354> : A)110.5 192 Q
-(GD84 / AMG zone 54)-.4 E(<epsg20355> : A)110.5 204 Q
-(GD84 / AMG zone 55)-.4 E(<epsg20356> : A)110.5 216 Q
-(GD84 / AMG zone 56)-.4 E(<epsg20357> : A)110.5 228 Q
-(GD84 / AMG zone 57)-.4 E(<epsg20358> : A)110.5 240 Q
-(GD84 / AMG zone 58)-.4 E(<epsg20436> : Ain el Abd / UTM zone 36N)110.5
-252 Q(<epsg20437> : Ain el Abd / UTM zone 37N)110.5 264 Q
-(<epsg20438> : Ain el Abd / UTM zone 38N)110.5 276 Q
-(<epsg20439> : Ain el Abd / UTM zone 39N)110.5 288 Q
-(<epsg20440> : Ain el Abd / UTM zone 40N)110.5 300 Q
-(<epsg20499> : Ain el Abd / Bahrain Grid)110.5 312 Q
-(<epsg20538> : Afgoo)110.5 324 Q(ye / UTM zone 38N)-.1 E
-(<epsg20539> : Afgoo)110.5 336 Q(ye / UTM zone 39N)-.1 E
-(<epsg20790> : Lisbon \(Lisbon\)/Portuguese National Grid)110.5 348 Q
-(<epsg20791> : Lisbon \(Lisbon\)/Portuguese Grid)110.5 360 Q
-(<epsg20822> : Aratu / UTM zone 22S)110.5 372 Q
-(<epsg20823> : Aratu / UTM zone 23S)110.5 384 Q
-(<epsg20824> : Aratu / UTM zone 24S)110.5 396 Q
-(<epsg20934> : Arc 1950 / UTM zone 34S)110.5 408 Q
-(<epsg20935> : Arc 1950 / UTM zone 35S)110.5 420 Q
-(<epsg20936> : Arc 1950 / UTM zone 36S)110.5 432 Q
-(<epsg21035> : Arc 1960 / UTM zone 35S)110.5 444 Q
-(<epsg21036> : Arc 1960 / UTM zone 36S)110.5 456 Q
-(<epsg21037> : Arc 1960 / UTM zone 37S)110.5 468 Q
-(<epsg21095> : Arc 1960 / UTM zone 35N)110.5 480 Q
-(<epsg21096> : Arc 1960 / UTM zone 36N)110.5 492 Q
-(<epsg21097> : Arc 1960 / UTM zone 37N)110.5 504 Q(<epsg21100> : Bata)
-110.5 516 Q(via \(Jakarta\) / NEIEZ \(deprecated\))-.2 E
-(<epsg21148> : Bata)110.5 528 Q(via / UTM zone 48S)-.2 E
-(<epsg21149> : Bata)110.5 540 Q(via / UTM zone 49S)-.2 E
-(<epsg21150> : Bata)110.5 552 Q(via / UTM zone 50S)-.2 E
-(<epsg21291> : Barbados 1938 / British W)110.5 564 Q(est Indies Grid)-.8
-E(<epsg21292> : Barbados 1938 / Barbados National Grid)110.5 576 Q
-(<epsg21413> : Beijing 1954 / Gauss-Kruger zone 13)110.5 588 Q
-(<epsg21414> : Beijing 1954 / Gauss-Kruger zone 14)110.5 600 Q
-(<epsg21415> : Beijing 1954 / Gauss-Kruger zone 15)110.5 612 Q
-(<epsg21416> : Beijing 1954 / Gauss-Kruger zone 16)110.5 624 Q
-(<epsg21417> : Beijing 1954 / Gauss-Kruger zone 17)110.5 636 Q
-(<epsg21418> : Beijing 1954 / Gauss-Kruger zone 18)110.5 648 Q
-(<epsg21419> : Beijing 1954 / Gauss-Kruger zone 19)110.5 660 Q
-(<epsg21420> : Beijing 1954 / Gauss-Kruger zone 20)110.5 672 Q
-(<epsg21421> : Beijing 1954 / Gauss-Kruger zone 21)110.5 684 Q
-(<epsg21422> : Beijing 1954 / Gauss-Kruger zone 22)110.5 696 Q
-(<epsg21423> : Beijing 1954 / Gauss-Kruger zone 23)110.5 708 Q
-(<epsg21453> : Beijing 1954 / Gauss-Kruger CM 75E)110.5 720 Q
-(MB-System 5.0)72 768 Q(29 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E
-(63)185.545 E 0 Cg EP
-%%Page: 64 64
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<epsg21454> : Beijing 1954 / Gauss-Kruger CM 81E)
-110.5 84 Q(<epsg21455> : Beijing 1954 / Gauss-Kruger CM 87E)110.5 96 Q
-(<epsg21456> : Beijing 1954 / Gauss-Kruger CM 93E)110.5 108 Q
-(<epsg21457> : Beijing 1954 / Gauss-Kruger CM 99E)110.5 120 Q
-(<epsg21458> : Beijing 1954 / Gauss-Kruger CM 105E)110.5 132 Q
-(<epsg21459> : Beijing 1954 / Gauss-Kruger CM 111E)110.5 144 Q
-(<epsg21460> : Beijing 1954 / Gauss-Kruger CM 117E)110.5 156 Q
-(<epsg21461> : Beijing 1954 / Gauss-Kruger CM 123E)110.5 168 Q
-(<epsg21462> : Beijing 1954 / Gauss-Kruger CM 129E)110.5 180 Q
-(<epsg21463> : Beijing 1954 / Gauss-Kruger CM 135E)110.5 192 Q
-(<epsg21473> : Beijing 1954 / Gauss-Kruger 13N \(deprecated\))110.5 204
-Q(<epsg21474> : Beijing 1954 / Gauss-Kruger 14N \(deprecated\))110.5 216
-Q(<epsg21475> : Beijing 1954 / Gauss-Kruger 15N \(deprecated\))110.5 228
-Q(<epsg21476> : Beijing 1954 / Gauss-Kruger 16N \(deprecated\))110.5 240
-Q(<epsg21477> : Beijing 1954 / Gauss-Kruger 17N \(deprecated\))110.5 252
-Q(<epsg21478> : Beijing 1954 / Gauss-Kruger 18N \(deprecated\))110.5 264
-Q(<epsg21479> : Beijing 1954 / Gauss-Kruger 19N \(deprecated\))110.5 276
-Q(<epsg21480> : Beijing 1954 / Gauss-Kruger 20N \(deprecated\))110.5 288
-Q(<epsg21481> : Beijing 1954 / Gauss-Kruger 21N \(deprecated\))110.5 300
-Q(<epsg21482> : Beijing 1954 / Gauss-Kruger 22N \(deprecated\))110.5 312
-Q(<epsg21483> : Beijing 1954 / Gauss-Kruger 23N \(deprecated\))110.5 324
-Q(<epsg21500> : Belge 1950 \(Brussels\) / Belge Lambert 50)110.5 336 Q
-(<epsg21780> : Bern 1898 \(Bern\) / L)110.5 348 Q(V03C)-1 E
-(<epsg21781> : CH1903 / L)110.5 360 Q(V03)-1 E
-(<epsg21817> : Bogota 1975 / UTM zone 17N \(deprecated\))110.5 372 Q
-(<epsg21818> : Bogota 1975 / UTM zone 18N)110.5 384 Q
-(<epsg21891> : Bogota 1975 / Colombia W)110.5 396 Q
-(est zone \(deprecated\))-.8 E
-(<epsg21892> : Bogota 1975 / Colombia Bogota zone \(deprecated\))110.5
-408 Q
-(<epsg21893> : Bogota 1975 / Colombia East Central zone \(deprecated\))
-110.5 420 Q(<epsg21894> : Bogota 1975 / Colombia East \(deprecated\))
-110.5 432 Q(<epsg21896> : Bogota 1975 / Colombia W)110.5 444 Q(est zone)
--.8 E(<epsg21897> : Bogota 1975 / Colombia Bogota zone)110.5 456 Q
-(<epsg21898> : Bogota 1975 / Colombia East Central zone)110.5 468 Q
-(<epsg21899> : Bogota 1975 / Colombia East)110.5 480 Q
-(<epsg22032> : Camacupa / UTM zone 32S)110.5 492 Q
-(<epsg22033> : Camacupa / UTM zone 33S)110.5 504 Q
-(<epsg22091> : Camacupa / TM 11.30 SE)110.5 516 Q
-(<epsg22092> : Camacupa / TM 12 SE)110.5 528 Q
-(<epsg22171> : POSGAR 98 / Ar)110.5 540 Q(gentina 1)-.18 E
-(<epsg22172> : POSGAR 98 / Ar)110.5 552 Q(gentina 2)-.18 E
-(<epsg22173> : POSGAR 98 / Ar)110.5 564 Q(gentina 3)-.18 E
-(<epsg22174> : POSGAR 98 / Ar)110.5 576 Q(gentina 4)-.18 E
-(<epsg22175> : POSGAR 98 / Ar)110.5 588 Q(gentina 5)-.18 E
-(<epsg22176> : POSGAR 98 / Ar)110.5 600 Q(gentina 6)-.18 E
-(<epsg22177> : POSGAR 98 / Ar)110.5 612 Q(gentina 7)-.18 E
-(<epsg22181> : POSGAR 94 / Ar)110.5 624 Q(gentina 1)-.18 E
-(<epsg22182> : POSGAR 94 / Ar)110.5 636 Q(gentina 2)-.18 E
-(<epsg22183> : POSGAR 94 / Ar)110.5 648 Q(gentina 3)-.18 E
-(<epsg22184> : POSGAR 94 / Ar)110.5 660 Q(gentina 4)-.18 E
-(<epsg22185> : POSGAR 94 / Ar)110.5 672 Q(gentina 5)-.18 E
-(<epsg22186> : POSGAR 94 / Ar)110.5 684 Q(gentina 6)-.18 E
-(<epsg22187> : POSGAR 94 / Ar)110.5 696 Q(gentina 7)-.18 E
-(<epsg22191> : Campo Inchauspe / Ar)110.5 708 Q(gentina 1)-.18 E
-(<epsg22192> : Campo Inchauspe / Ar)110.5 720 Q(gentina 2)-.18 E
-(MB-System 5.0)72 768 Q(29 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E
-(64)185.545 E 0 Cg EP
-%%Page: 65 65
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<epsg22193> : Campo Inchauspe / Ar)110.5 84 Q
-(gentina 3)-.18 E(<epsg22194> : Campo Inchauspe / Ar)110.5 96 Q
-(gentina 4)-.18 E(<epsg22195> : Campo Inchauspe / Ar)110.5 108 Q
-(gentina 5)-.18 E(<epsg22196> : Campo Inchauspe / Ar)110.5 120 Q
-(gentina 6)-.18 E(<epsg22197> : Campo Inchauspe / Ar)110.5 132 Q
-(gentina 7)-.18 E(<epsg22234> : Cape / UTM zone 34S)110.5 144 Q
-(<epsg22235> : Cape / UTM zone 35S)110.5 156 Q
-(<epsg22236> : Cape / UTM zone 36S)110.5 168 Q
-(<epsg22332> : Carthage / UTM zone 32N)110.5 180 Q
-(<epsg22391> : Carthage / Nord T)110.5 192 Q(unisie)-.45 E
-(<epsg22392> : Carthage / Sud T)110.5 204 Q(unisie)-.45 E
-(<epsg22521> : Corre)110.5 216 Q(go Ale)-.15 E(gre / UTM zone 21S)-.15 E
-(<epsg22522> : Corre)110.5 228 Q(go Ale)-.15 E(gre / UTM zone 22S)-.15 E
-(<epsg22523> : Corre)110.5 240 Q(go Ale)-.15 E(gre / UTM zone 23S)-.15 E
-(<epsg22524> : Corre)110.5 252 Q(go Ale)-.15 E(gre / UTM zone 24S)-.15 E
-(<epsg22525> : Corre)110.5 264 Q(go Ale)-.15 E(gre / UTM zone 25S)-.15 E
-(<epsg22700> : Deir ez Zor / Le)110.5 276 Q -.25(va)-.25 G(nt Zone).25 E
-(<epsg22770> : Deir ez Zor / Syria Lambert)110.5 288 Q
-(<epsg22780> : Deir ez Zor / Le)110.5 300 Q -.25(va)-.25 G
-(nt Stereographic).25 E
-(<epsg22832> : Douala / UTM zone 32N \(deprecated\))110.5 312 Q
-(<epsg22991> : Egypt 1907 / Blue Belt)110.5 324 Q
-(<epsg22992> : Egypt 1907 / Red Belt)110.5 336 Q
-(<epsg22993> : Egypt 1907 / Purple Belt)110.5 348 Q
-(<epsg22994> : Egypt 1907 / Extended Purple Belt)110.5 360 Q
-(<epsg23028> : ED50 / UTM zone 28N)110.5 372 Q
-(<epsg23029> : ED50 / UTM zone 29N)110.5 384 Q
-(<epsg23030> : ED50 / UTM zone 30N)110.5 396 Q
-(<epsg23031> : ED50 / UTM zone 31N)110.5 408 Q
-(<epsg23032> : ED50 / UTM zone 32N)110.5 420 Q
-(<epsg23033> : ED50 / UTM zone 33N)110.5 432 Q
-(<epsg23034> : ED50 / UTM zone 34N)110.5 444 Q
-(<epsg23035> : ED50 / UTM zone 35N)110.5 456 Q
-(<epsg23036> : ED50 / UTM zone 36N)110.5 468 Q
-(<epsg23037> : ED50 / UTM zone 37N)110.5 480 Q
-(<epsg23038> : ED50 / UTM zone 38N)110.5 492 Q
-(<epsg23090> : ED50 / TM 0 N)110.5 504 Q(<epsg23095> : ED50 / TM 5 NE)
-110.5 516 Q(<epsg23239> : F)110.5 528 Q(ahud / UTM zone 39N)-.15 E
-(<epsg23240> : F)110.5 540 Q(ahud / UTM zone 40N)-.15 E
-(<epsg23433> : Garoua / UTM zone 33N \(deprecated\))110.5 552 Q
-(<epsg23700> : HD72 / EO)110.5 564 Q(V)-.5 E
-(<epsg23830> : DGN95 / Indonesia TM-3 zone 46.2)110.5 576 Q
-(<epsg23831> : DGN95 / Indonesia TM-3 zone 47.1)110.5 588 Q
-(<epsg23832> : DGN95 / Indonesia TM-3 zone 47.2)110.5 600 Q
-(<epsg23833> : DGN95 / Indonesia TM-3 zone 48.1)110.5 612 Q
-(<epsg23834> : DGN95 / Indonesia TM-3 zone 48.2)110.5 624 Q
-(<epsg23835> : DGN95 / Indonesia TM-3 zone 49.1)110.5 636 Q
-(<epsg23836> : DGN95 / Indonesia TM-3 zone 49.2)110.5 648 Q
-(<epsg23837> : DGN95 / Indonesia TM-3 zone 50.1)110.5 660 Q
-(<epsg23838> : DGN95 / Indonesia TM-3 zone 50.2)110.5 672 Q
-(<epsg23839> : DGN95 / Indonesia TM-3 zone 51.1)110.5 684 Q
-(<epsg23840> : DGN95 / Indonesia TM-3 zone 51.2)110.5 696 Q
-(<epsg23841> : DGN95 / Indonesia TM-3 zone 52.1)110.5 708 Q
-(<epsg23842> : DGN95 / Indonesia TM-3 zone 52.2)110.5 720 Q
-(MB-System 5.0)72 768 Q(29 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E
-(65)185.545 E 0 Cg EP
-%%Page: 66 66
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<epsg23843> : DGN95 / Indonesia TM-3 zone 53.1)
-110.5 84 Q(<epsg23844> : DGN95 / Indonesia TM-3 zone 53.2)110.5 96 Q
-(<epsg23845> : DGN95 / Indonesia TM-3 zone 54.1)110.5 108 Q
-(<epsg23846> : ID74 / UTM zone 46N)110.5 120 Q
-(<epsg23847> : ID74 / UTM zone 47N)110.5 132 Q
-(<epsg23848> : ID74 / UTM zone 48N)110.5 144 Q
-(<epsg23849> : ID74 / UTM zone 49N)110.5 156 Q
-(<epsg23850> : ID74 / UTM zone 50N)110.5 168 Q
-(<epsg23851> : ID74 / UTM zone 51N)110.5 180 Q
-(<epsg23852> : ID74 / UTM zone 52N)110.5 192 Q
-(<epsg23853> : ID74 / UTM zone 53N \(deprecated\))110.5 204 Q
-(<epsg23866> : DGN95 / UTM zone 46N)110.5 216 Q
-(<epsg23867> : DGN95 / UTM zone 47N)110.5 228 Q
-(<epsg23868> : DGN95 / UTM zone 48N)110.5 240 Q
-(<epsg23869> : DGN95 / UTM zone 49N)110.5 252 Q
-(<epsg23870> : DGN95 / UTM zone 50N)110.5 264 Q
-(<epsg23871> : DGN95 / UTM zone 51N)110.5 276 Q
-(<epsg23872> : DGN95 / UTM zone 52N)110.5 288 Q
-(<epsg23877> : DGN95 / UTM zone 47S)110.5 300 Q
-(<epsg23878> : DGN95 / UTM zone 48S)110.5 312 Q
-(<epsg23879> : DGN95 / UTM zone 49S)110.5 324 Q
-(<epsg23880> : DGN95 / UTM zone 50S)110.5 336 Q
-(<epsg23881> : DGN95 / UTM zone 51S)110.5 348 Q
-(<epsg23882> : DGN95 / UTM zone 52S)110.5 360 Q
-(<epsg23883> : DGN95 / UTM zone 53S)110.5 372 Q
-(<epsg23884> : DGN95 / UTM zone 54S)110.5 384 Q
-(<epsg23886> : ID74 / UTM zone 46S \(deprecated\))110.5 396 Q
-(<epsg23887> : ID74 / UTM zone 47S)110.5 408 Q
-(<epsg23888> : ID74 / UTM zone 48S)110.5 420 Q
-(<epsg23889> : ID74 / UTM zone 49S)110.5 432 Q
-(<epsg23890> : ID74 / UTM zone 50S)110.5 444 Q
-(<epsg23891> : ID74 / UTM zone 51S)110.5 456 Q
-(<epsg23892> : ID74 / UTM zone 52S)110.5 468 Q
-(<epsg23893> : ID74 / UTM zone 53S)110.5 480 Q
-(<epsg23894> : ID74 / UTM zone 54S)110.5 492 Q
-(<epsg23946> : Indian 1954 / UTM zone 46N)110.5 504 Q
-(<epsg23947> : Indian 1954 / UTM zone 47N)110.5 516 Q
-(<epsg23948> : Indian 1954 / UTM zone 48N)110.5 528 Q
-(<epsg24047> : Indian 1975 / UTM zone 47N)110.5 540 Q
-(<epsg24048> : Indian 1975 / UTM zone 48N)110.5 552 Q
-(<epsg24100> : Jamaica 1875 / Jamaica \(Old Grid\))110.5 564 Q
-(<epsg24200> : J)110.5 576 Q(AD69 / Jamaica National Grid)-.6 E
-(<epsg24305> : Kalianpur 1937 / UTM zone 45N)110.5 588 Q
-(<epsg24306> : Kalianpur 1937 / UTM zone 46N)110.5 600 Q
-(<epsg24311> : Kalianpur 1962 / UTM zone 41N)110.5 612 Q
-(<epsg24312> : Kalianpur 1962 / UTM zone 42N)110.5 624 Q
-(<epsg24313> : Kalianpur 1962 / UTM zone 43N)110.5 636 Q
-(<epsg24342> : Kalianpur 1975 / UTM zone 42N)110.5 648 Q
-(<epsg24343> : Kalianpur 1975 / UTM zone 43N)110.5 660 Q
-(<epsg24344> : Kalianpur 1975 / UTM zone 44N)110.5 672 Q
-(<epsg24345> : Kalianpur 1975 / UTM zone 45N)110.5 684 Q
-(<epsg24346> : Kalianpur 1975 / UTM zone 46N)110.5 696 Q
-(<epsg24347> : Kalianpur 1975 / UTM zone 47N)110.5 708 Q
-(<epsg24370> : Kalianpur 1880 / India zone 0)110.5 720 Q(MB-System 5.0)
-72 768 Q(29 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E(66)185.545 E 0
-Cg EP
-%%Page: 67 67
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<epsg24371> : Kalianpur 1880 / India zone I)110.5
-84 Q(<epsg24372> : Kalianpur 1880 / India zone IIa)110.5 96 Q
-(<epsg24373> : Kalianpur 1880 / India zone III)110.5 108 Q
-(<epsg24374> : Kalianpur 1880 / India zone IV)110.5 120 Q
-(<epsg24375> : Kalianpur 1937 / India zone IIb)110.5 132 Q
-(<epsg24376> : Kalianpur 1962 / India zone I)110.5 144 Q
-(<epsg24377> : Kalianpur 1962 / India zone IIa)110.5 156 Q
-(<epsg24378> : Kalianpur 1975 / India zone I)110.5 168 Q
-(<epsg24379> : Kalianpur 1975 / India zone IIa)110.5 180 Q
-(<epsg24380> : Kalianpur 1975 / India zone IIb)110.5 192 Q
-(<epsg24381> : Kalianpur 1975 / India zone III)110.5 204 Q
-(<epsg24382> : Kalianpur 1880 / India zone IIb)110.5 216 Q
-(<epsg24383> : Kalianpur 1975 / India zone IV)110.5 228 Q
-(<epsg24500> : K)110.5 240 Q(ertau 1968 / Sing)-.25 E(apore Grid)-.05 E
-(<epsg24547> : K)110.5 252 Q(ertau 1968 / UTM zone 47N)-.25 E
-(<epsg24548> : K)110.5 264 Q(ertau 1968 / UTM zone 48N)-.25 E
-(<epsg24571> : K)110.5 276 Q
-(ertau / R.S.O. Malaya \(ch\) \(deprecated\))-.25 E(<epsg24600> : K)
-110.5 288 Q(OC Lambert)-.3 E(<epsg24718> : La Canoa / UTM zone 18N)110.5
-300 Q(<epsg24719> : La Canoa / UTM zone 19N)110.5 312 Q
-(<epsg24720> : La Canoa / UTM zone 20N)110.5 324 Q
-(<epsg24817> : PSAD56 / UTM zone 17N)110.5 336 Q
-(<epsg24818> : PSAD56 / UTM zone 18N)110.5 348 Q
-(<epsg24819> : PSAD56 / UTM zone 19N)110.5 360 Q
-(<epsg24820> : PSAD56 / UTM zone 20N)110.5 372 Q
-(<epsg24821> : PSAD56 / UTM zone 21N)110.5 384 Q
-(<epsg24877> : PSAD56 / UTM zone 17S)110.5 396 Q
-(<epsg24878> : PSAD56 / UTM zone 18S)110.5 408 Q
-(<epsg24879> : PSAD56 / UTM zone 19S)110.5 420 Q
-(<epsg24880> : PSAD56 / UTM zone 20S)110.5 432 Q
-(<epsg24881> : PSAD56 / UTM zone 21S)110.5 444 Q
-(<epsg24882> : PSAD56 / UTM zone 22S)110.5 456 Q
-(<epsg24891> : PSAD56 / Peru west zone)110.5 468 Q
-(<epsg24892> : PSAD56 / Peru central zone)110.5 480 Q
-(<epsg24893> : PSAD56 / Peru east zone)110.5 492 Q
-(<epsg25000> : Leigon / Ghana Metre Grid)110.5 504 Q
-(<epsg25231> : Lome / UTM zone 31N)110.5 516 Q
-(<epsg25391> : Luzon 1911 / Philippines zone I)110.5 528 Q
-(<epsg25392> : Luzon 1911 / Philippines zone II)110.5 540 Q
-(<epsg25393> : Luzon 1911 / Philippines zone III)110.5 552 Q
-(<epsg25394> : Luzon 1911 / Philippines zone IV)110.5 564 Q
-(<epsg25395> : Luzon 1911 / Philippines zone V)110.5 576 Q
-(<epsg25700> : Makassar \(Jakarta\) / NEIEZ \(deprecated\))110.5 588 Q
-(<epsg25828> : ETRS89 / UTM zone 28N)110.5 600 Q
-(<epsg25829> : ETRS89 / UTM zone 29N)110.5 612 Q
-(<epsg25830> : ETRS89 / UTM zone 30N)110.5 624 Q
-(<epsg25831> : ETRS89 / UTM zone 31N)110.5 636 Q
-(<epsg25832> : ETRS89 / UTM zone 32N)110.5 648 Q
-(<epsg25833> : ETRS89 / UTM zone 33N)110.5 660 Q
-(<epsg25834> : ETRS89 / UTM zone 34N)110.5 672 Q
-(<epsg25835> : ETRS89 / UTM zone 35N)110.5 684 Q
-(<epsg25836> : ETRS89 / UTM zone 36N)110.5 696 Q
-(<epsg25837> : ETRS89 / UTM zone 37N)110.5 708 Q
-(<epsg25838> : ETRS89 / UTM zone 38N)110.5 720 Q(MB-System 5.0)72 768 Q
-(29 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E(67)185.545 E 0 Cg EP
-%%Page: 68 68
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<epsg25884> : ETRS89 / TM Baltic93)110.5 84 Q
-(<epsg25932> : Malongo 1987 / UTM zone 32S)110.5 96 Q
-(<epsg26191> : Merchich / Nord Maroc)110.5 108 Q
-(<epsg26192> : Merchich / Sud Maroc)110.5 120 Q
-(<epsg26193> : Merchich / Sahara \(deprecated\))110.5 132 Q
-(<epsg26194> : Merchich / Sahara Nord)110.5 144 Q
-(<epsg26195> : Merchich / Sahara Sud)110.5 156 Q(<epsg26237> : Massa)
-110.5 168 Q .2 -.1(wa / U)-.15 H(TM zone 37N).1 E
-(<epsg26331> : Minna / UTM zone 31N)110.5 180 Q
-(<epsg26332> : Minna / UTM zone 32N)110.5 192 Q
-(<epsg26391> : Minna / Nigeria W)110.5 204 Q(est Belt)-.8 E
-(<epsg26392> : Minna / Nigeria Mid Belt)110.5 216 Q
-(<epsg26393> : Minna / Nigeria East Belt)110.5 228 Q
-(<epsg26432> : Mhast / UTM zone 32S \(deprecated\))110.5 240 Q
-(<epsg26591> : Monte Mario \(Rome\) / Italy zone 1 \(deprecated\))110.5
-252 Q(<epsg26592> : Monte Mario \(Rome\) / Italy zone 2 \(deprecated\))
-110.5 264 Q(<epsg26632> : M'poralok)110.5 276 Q 2.5(o/U)-.1 G
-(TM zone 32N)-2.5 E(<epsg26692> : M'poralok)110.5 288 Q 2.5(o/U)-.1 G
-(TM zone 32S)-2.5 E(<epsg26701> : N)110.5 300 Q(AD27 / UTM zone 1N)-.35
-E(<epsg26702> : N)110.5 312 Q(AD27 / UTM zone 2N)-.35 E(<epsg26703> : N)
-110.5 324 Q(AD27 / UTM zone 3N)-.35 E(<epsg26704> : N)110.5 336 Q
-(AD27 / UTM zone 4N)-.35 E(<epsg26705> : N)110.5 348 Q
-(AD27 / UTM zone 5N)-.35 E(<epsg26706> : N)110.5 360 Q
-(AD27 / UTM zone 6N)-.35 E(<epsg26707> : N)110.5 372 Q
-(AD27 / UTM zone 7N)-.35 E(<epsg26708> : N)110.5 384 Q
-(AD27 / UTM zone 8N)-.35 E(<epsg26709> : N)110.5 396 Q
-(AD27 / UTM zone 9N)-.35 E(<epsg26710> : N)110.5 408 Q
-(AD27 / UTM zone 10N)-.35 E(<epsg26711> : N)110.5 420 Q
-(AD27 / UTM zone 11N)-.35 E(<epsg26712> : N)110.5 432 Q
-(AD27 / UTM zone 12N)-.35 E(<epsg26713> : N)110.5 444 Q
-(AD27 / UTM zone 13N)-.35 E(<epsg26714> : N)110.5 456 Q
-(AD27 / UTM zone 14N)-.35 E(<epsg26715> : N)110.5 468 Q
-(AD27 / UTM zone 15N)-.35 E(<epsg26716> : N)110.5 480 Q
-(AD27 / UTM zone 16N)-.35 E(<epsg26717> : N)110.5 492 Q
-(AD27 / UTM zone 17N)-.35 E(<epsg26718> : N)110.5 504 Q
-(AD27 / UTM zone 18N)-.35 E(<epsg26719> : N)110.5 516 Q
-(AD27 / UTM zone 19N)-.35 E(<epsg26720> : N)110.5 528 Q
-(AD27 / UTM zone 20N)-.35 E(<epsg26721> : N)110.5 540 Q
-(AD27 / UTM zone 21N)-.35 E(<epsg26722> : N)110.5 552 Q
-(AD27 / UTM zone 22N)-.35 E(<epsg26729> : N)110.5 564 Q
-(AD27 / Alabama East)-.35 E(<epsg26730> : N)110.5 576 Q
-(AD27 / Alabama W)-.35 E(est)-.8 E(<epsg26731> : N)110.5 588 Q
-(AD27 / Alaska zone 1)-.35 E(<epsg26732> : N)110.5 600 Q
-(AD27 / Alaska zone 2)-.35 E(<epsg26733> : N)110.5 612 Q
-(AD27 / Alaska zone 3)-.35 E(<epsg26734> : N)110.5 624 Q
-(AD27 / Alaska zone 4)-.35 E(<epsg26735> : N)110.5 636 Q
-(AD27 / Alaska zone 5)-.35 E(<epsg26736> : N)110.5 648 Q
-(AD27 / Alaska zone 6)-.35 E(<epsg26737> : N)110.5 660 Q
-(AD27 / Alaska zone 7)-.35 E(<epsg26738> : N)110.5 672 Q
-(AD27 / Alaska zone 8)-.35 E(<epsg26739> : N)110.5 684 Q
-(AD27 / Alaska zone 9)-.35 E(<epsg26740> : N)110.5 696 Q
-(AD27 / Alaska zone 10)-.35 E(<epsg26741> : N)110.5 708 Q
-(AD27 / California zone I)-.35 E(<epsg26742> : N)110.5 720 Q
-(AD27 / California zone II)-.35 E(MB-System 5.0)72 768 Q(29 No)132.205 E
--.15(ve)-.15 G(mber 2014).15 E(68)185.545 E 0 Cg EP
-%%Page: 69 69
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<epsg26743> : N)110.5 84 Q
-(AD27 / California zone III)-.35 E(<epsg26744> : N)110.5 96 Q
-(AD27 / California zone IV)-.35 E(<epsg26745> : N)110.5 108 Q
-(AD27 / California zone V)-.35 E(<epsg26746> : N)110.5 120 Q
-(AD27 / California zone VI)-.35 E(<epsg26747> : N)110.5 132 Q
-(AD27 / California zone VII \(deprecated\))-.35 E(<epsg26748> : N)110.5
-144 Q(AD27 / Arizona East)-.35 E(<epsg26749> : N)110.5 156 Q
-(AD27 / Arizona Central)-.35 E(<epsg26750> : N)110.5 168 Q
-(AD27 / Arizona W)-.35 E(est)-.8 E(<epsg26751> : N)110.5 180 Q
-(AD27 / Arkansas North)-.35 E(<epsg26752> : N)110.5 192 Q
-(AD27 / Arkansas South)-.35 E(<epsg26753> : N)110.5 204 Q
-(AD27 / Colorado North)-.35 E(<epsg26754> : N)110.5 216 Q
-(AD27 / Colorado Central)-.35 E(<epsg26755> : N)110.5 228 Q
-(AD27 / Colorado South)-.35 E(<epsg26756> : N)110.5 240 Q
-(AD27 / Connecticut)-.35 E(<epsg26757> : N)110.5 252 Q(AD27 / Dela)-.35
-E -.1(wa)-.15 G(re).1 E(<epsg26758> : N)110.5 264 Q(AD27 / Florida East)
--.35 E(<epsg26759> : N)110.5 276 Q(AD27 / Florida W)-.35 E(est)-.8 E
-(<epsg26760> : N)110.5 288 Q(AD27 / Florida North)-.35 E
-(<epsg26766> : N)110.5 300 Q(AD27 / Geor)-.35 E(gia East)-.18 E
-(<epsg26767> : N)110.5 312 Q(AD27 / Geor)-.35 E(gia W)-.18 E(est)-.8 E
-(<epsg26768> : N)110.5 324 Q(AD27 / Idaho East)-.35 E(<epsg26769> : N)
-110.5 336 Q(AD27 / Idaho Central)-.35 E(<epsg26770> : N)110.5 348 Q
-(AD27 / Idaho W)-.35 E(est)-.8 E(<epsg26771> : N)110.5 360 Q
-(AD27 / Illinois East)-.35 E(<epsg26772> : N)110.5 372 Q
-(AD27 / Illinois W)-.35 E(est)-.8 E(<epsg26773> : N)110.5 384 Q
-(AD27 / Indiana East)-.35 E(<epsg26774> : N)110.5 396 Q
-(AD27 / Indiana W)-.35 E(est)-.8 E(<epsg26775> : N)110.5 408 Q
-(AD27 / Io)-.35 E .2 -.1(wa N)-.25 H(orth).1 E(<epsg26776> : N)110.5 420
-Q(AD27 / Io)-.35 E .2 -.1(wa S)-.25 H(outh).1 E(<epsg26777> : N)110.5
-432 Q(AD27 / Kansas North)-.35 E(<epsg26778> : N)110.5 444 Q
-(AD27 / Kansas South)-.35 E(<epsg26779> : N)110.5 456 Q(AD27 / K)-.35 E
-(entuck)-.25 E 2.5(yN)-.15 G(orth)-2.5 E(<epsg26780> : N)110.5 468 Q
-(AD27 / K)-.35 E(entuck)-.25 E 2.5(yS)-.15 G(outh)-2.5 E
-(<epsg26781> : N)110.5 480 Q(AD27 / Louisiana North)-.35 E
-(<epsg26782> : N)110.5 492 Q(AD27 / Louisiana South)-.35 E
-(<epsg26783> : N)110.5 504 Q(AD27 / Maine East)-.35 E(<epsg26784> : N)
-110.5 516 Q(AD27 / Maine W)-.35 E(est)-.8 E(<epsg26785> : N)110.5 528 Q
-(AD27 / Maryland)-.35 E(<epsg26786> : N)110.5 540 Q
-(AD27 / Massachusetts Mainland)-.35 E(<epsg26787> : N)110.5 552 Q
-(AD27 / Massachusetts Island)-.35 E(<epsg26791> : N)110.5 564 Q
-(AD27 / Minnesota North)-.35 E(<epsg26792> : N)110.5 576 Q
-(AD27 / Minnesota Central)-.35 E(<epsg26793> : N)110.5 588 Q
-(AD27 / Minnesota South)-.35 E(<epsg26794> : N)110.5 600 Q
-(AD27 / Mississippi East)-.35 E(<epsg26795> : N)110.5 612 Q
-(AD27 / Mississippi W)-.35 E(est)-.8 E(<epsg26796> : N)110.5 624 Q
-(AD27 / Missouri East)-.35 E(<epsg26797> : N)110.5 636 Q
-(AD27 / Missouri Central)-.35 E(<epsg26798> : N)110.5 648 Q
-(AD27 / Missouri W)-.35 E(est)-.8 E(<epsg26799> : N)110.5 660 Q
-(AD27 / California zone VII)-.35 E(<epsg26801> : N)110.5 672 Q
-(AD Michig)-.35 E(an / Michig)-.05 E(an East)-.05 E(<epsg26802> : N)
-110.5 684 Q(AD Michig)-.35 E(an / Michig)-.05 E(an Old Central)-.05 E
-(<epsg26803> : N)110.5 696 Q(AD Michig)-.35 E(an / Michig)-.05 E(an W)
--.05 E(est)-.8 E(<epsg26811> : N)110.5 708 Q(AD Michig)-.35 E
-(an / Michig)-.05 E(an North)-.05 E(<epsg26812> : N)110.5 720 Q
-(AD Michig)-.35 E(an / Michig)-.05 E(an Central)-.05 E(MB-System 5.0)72
-768 Q(29 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E(69)185.545 E 0 Cg
-EP
-%%Page: 70 70
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<epsg26813> : N)110.5 84 Q(AD Michig)-.35 E
-(an / Michig)-.05 E(an South)-.05 E(<epsg26901> : N)110.5 96 Q
-(AD83 / UTM zone 1N)-.35 E(<epsg26902> : N)110.5 108 Q
-(AD83 / UTM zone 2N)-.35 E(<epsg26903> : N)110.5 120 Q
-(AD83 / UTM zone 3N)-.35 E(<epsg26904> : N)110.5 132 Q
-(AD83 / UTM zone 4N)-.35 E(<epsg26905> : N)110.5 144 Q
-(AD83 / UTM zone 5N)-.35 E(<epsg26906> : N)110.5 156 Q
-(AD83 / UTM zone 6N)-.35 E(<epsg26907> : N)110.5 168 Q
-(AD83 / UTM zone 7N)-.35 E(<epsg26908> : N)110.5 180 Q
-(AD83 / UTM zone 8N)-.35 E(<epsg26909> : N)110.5 192 Q
-(AD83 / UTM zone 9N)-.35 E(<epsg26910> : N)110.5 204 Q
-(AD83 / UTM zone 10N)-.35 E(<epsg26911> : N)110.5 216 Q
-(AD83 / UTM zone 11N)-.35 E(<epsg26912> : N)110.5 228 Q
-(AD83 / UTM zone 12N)-.35 E(<epsg26913> : N)110.5 240 Q
-(AD83 / UTM zone 13N)-.35 E(<epsg26914> : N)110.5 252 Q
-(AD83 / UTM zone 14N)-.35 E(<epsg26915> : N)110.5 264 Q
-(AD83 / UTM zone 15N)-.35 E(<epsg26916> : N)110.5 276 Q
-(AD83 / UTM zone 16N)-.35 E(<epsg26917> : N)110.5 288 Q
-(AD83 / UTM zone 17N)-.35 E(<epsg26918> : N)110.5 300 Q
-(AD83 / UTM zone 18N)-.35 E(<epsg26919> : N)110.5 312 Q
-(AD83 / UTM zone 19N)-.35 E(<epsg26920> : N)110.5 324 Q
-(AD83 / UTM zone 20N)-.35 E(<epsg26921> : N)110.5 336 Q
-(AD83 / UTM zone 21N)-.35 E(<epsg26922> : N)110.5 348 Q
-(AD83 / UTM zone 22N)-.35 E(<epsg26923> : N)110.5 360 Q
-(AD83 / UTM zone 23N)-.35 E(<epsg26929> : N)110.5 372 Q
-(AD83 / Alabama East)-.35 E(<epsg26930> : N)110.5 384 Q
-(AD83 / Alabama W)-.35 E(est)-.8 E(<epsg26931> : N)110.5 396 Q
-(AD83 / Alaska zone 1)-.35 E(<epsg26932> : N)110.5 408 Q
-(AD83 / Alaska zone 2)-.35 E(<epsg26933> : N)110.5 420 Q
-(AD83 / Alaska zone 3)-.35 E(<epsg26934> : N)110.5 432 Q
-(AD83 / Alaska zone 4)-.35 E(<epsg26935> : N)110.5 444 Q
-(AD83 / Alaska zone 5)-.35 E(<epsg26936> : N)110.5 456 Q
-(AD83 / Alaska zone 6)-.35 E(<epsg26937> : N)110.5 468 Q
-(AD83 / Alaska zone 7)-.35 E(<epsg26938> : N)110.5 480 Q
-(AD83 / Alaska zone 8)-.35 E(<epsg26939> : N)110.5 492 Q
-(AD83 / Alaska zone 9)-.35 E(<epsg26940> : N)110.5 504 Q
-(AD83 / Alaska zone 10)-.35 E(<epsg26941> : N)110.5 516 Q
-(AD83 / California zone 1)-.35 E(<epsg26942> : N)110.5 528 Q
-(AD83 / California zone 2)-.35 E(<epsg26943> : N)110.5 540 Q
-(AD83 / California zone 3)-.35 E(<epsg26944> : N)110.5 552 Q
-(AD83 / California zone 4)-.35 E(<epsg26945> : N)110.5 564 Q
-(AD83 / California zone 5)-.35 E(<epsg26946> : N)110.5 576 Q
-(AD83 / California zone 6)-.35 E(<epsg26948> : N)110.5 588 Q
-(AD83 / Arizona East)-.35 E(<epsg26949> : N)110.5 600 Q
-(AD83 / Arizona Central)-.35 E(<epsg26950> : N)110.5 612 Q
-(AD83 / Arizona W)-.35 E(est)-.8 E(<epsg26951> : N)110.5 624 Q
-(AD83 / Arkansas North)-.35 E(<epsg26952> : N)110.5 636 Q
-(AD83 / Arkansas South)-.35 E(<epsg26953> : N)110.5 648 Q
-(AD83 / Colorado North)-.35 E(<epsg26954> : N)110.5 660 Q
-(AD83 / Colorado Central)-.35 E(<epsg26955> : N)110.5 672 Q
-(AD83 / Colorado South)-.35 E(<epsg26956> : N)110.5 684 Q
-(AD83 / Connecticut)-.35 E(<epsg26957> : N)110.5 696 Q(AD83 / Dela)-.35
-E -.1(wa)-.15 G(re).1 E(<epsg26958> : N)110.5 708 Q(AD83 / Florida East)
--.35 E(<epsg26959> : N)110.5 720 Q(AD83 / Florida W)-.35 E(est)-.8 E
-(MB-System 5.0)72 768 Q(29 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E
-(70)185.545 E 0 Cg EP
-%%Page: 71 71
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<epsg26960> : N)110.5 84 Q(AD83 / Florida North)
--.35 E(<epsg26961> : N)110.5 96 Q(AD83 / Ha)-.35 E -.1(wa)-.15 G
-(ii zone 1).1 E(<epsg26962> : N)110.5 108 Q(AD83 / Ha)-.35 E -.1(wa)-.15
-G(ii zone 2).1 E(<epsg26963> : N)110.5 120 Q(AD83 / Ha)-.35 E -.1(wa)
--.15 G(ii zone 3).1 E(<epsg26964> : N)110.5 132 Q(AD83 / Ha)-.35 E -.1
-(wa)-.15 G(ii zone 4).1 E(<epsg26965> : N)110.5 144 Q(AD83 / Ha)-.35 E
--.1(wa)-.15 G(ii zone 5).1 E(<epsg26966> : N)110.5 156 Q(AD83 / Geor)
--.35 E(gia East)-.18 E(<epsg26967> : N)110.5 168 Q(AD83 / Geor)-.35 E
-(gia W)-.18 E(est)-.8 E(<epsg26968> : N)110.5 180 Q(AD83 / Idaho East)
--.35 E(<epsg26969> : N)110.5 192 Q(AD83 / Idaho Central)-.35 E
-(<epsg26970> : N)110.5 204 Q(AD83 / Idaho W)-.35 E(est)-.8 E
-(<epsg26971> : N)110.5 216 Q(AD83 / Illinois East)-.35 E
-(<epsg26972> : N)110.5 228 Q(AD83 / Illinois W)-.35 E(est)-.8 E
-(<epsg26973> : N)110.5 240 Q(AD83 / Indiana East)-.35 E(<epsg26974> : N)
-110.5 252 Q(AD83 / Indiana W)-.35 E(est)-.8 E(<epsg26975> : N)110.5 264
-Q(AD83 / Io)-.35 E .2 -.1(wa N)-.25 H(orth).1 E(<epsg26976> : N)110.5
-276 Q(AD83 / Io)-.35 E .2 -.1(wa S)-.25 H(outh).1 E(<epsg26977> : N)
-110.5 288 Q(AD83 / Kansas North)-.35 E(<epsg26978> : N)110.5 300 Q
-(AD83 / Kansas South)-.35 E(<epsg26979> : N)110.5 312 Q(AD83 / K)-.35 E
-(entuck)-.25 E 2.5(yN)-.15 G(orth \(deprecated\))-2.5 E(<epsg26980> : N)
-110.5 324 Q(AD83 / K)-.35 E(entuck)-.25 E 2.5(yS)-.15 G(outh)-2.5 E
-(<epsg26981> : N)110.5 336 Q(AD83 / Louisiana North)-.35 E
-(<epsg26982> : N)110.5 348 Q(AD83 / Louisiana South)-.35 E
-(<epsg26983> : N)110.5 360 Q(AD83 / Maine East)-.35 E(<epsg26984> : N)
-110.5 372 Q(AD83 / Maine W)-.35 E(est)-.8 E(<epsg26985> : N)110.5 384 Q
-(AD83 / Maryland)-.35 E(<epsg26986> : N)110.5 396 Q
-(AD83 / Massachusetts Mainland)-.35 E(<epsg26987> : N)110.5 408 Q
-(AD83 / Massachusetts Island)-.35 E(<epsg26988> : N)110.5 420 Q
-(AD83 / Michig)-.35 E(an North)-.05 E(<epsg26989> : N)110.5 432 Q
-(AD83 / Michig)-.35 E(an Central)-.05 E(<epsg26990> : N)110.5 444 Q
-(AD83 / Michig)-.35 E(an South)-.05 E(<epsg26991> : N)110.5 456 Q
-(AD83 / Minnesota North)-.35 E(<epsg26992> : N)110.5 468 Q
-(AD83 / Minnesota Central)-.35 E(<epsg26993> : N)110.5 480 Q
-(AD83 / Minnesota South)-.35 E(<epsg26994> : N)110.5 492 Q
-(AD83 / Mississippi East)-.35 E(<epsg26995> : N)110.5 504 Q
-(AD83 / Mississippi W)-.35 E(est)-.8 E(<epsg26996> : N)110.5 516 Q
-(AD83 / Missouri East)-.35 E(<epsg26997> : N)110.5 528 Q
-(AD83 / Missouri Central)-.35 E(<epsg26998> : N)110.5 540 Q
-(AD83 / Missouri W)-.35 E(est)-.8 E(<epsg27037> : Nahrw)110.5 552 Q
-(an 1967 / UTM zone 37N)-.1 E(<epsg27038> : Nahrw)110.5 564 Q
-(an 1967 / UTM zone 38N)-.1 E(<epsg27039> : Nahrw)110.5 576 Q
-(an 1967 / UTM zone 39N)-.1 E(<epsg27040> : Nahrw)110.5 588 Q
-(an 1967 / UTM zone 40N)-.1 E
-(<epsg27120> : Naparima 1972 / UTM zone 20N)110.5 600 Q
-(<epsg27200> : NZGD49 / Ne)110.5 612 Q 2.5(wZ)-.25 G(ealand Map Grid)
--2.5 E(<epsg27205> : NZGD49 / Mount Eden Circuit)110.5 624 Q
-(<epsg27206> : NZGD49 / Bay of Plenty Circuit)110.5 636 Q
-(<epsg27207> : NZGD49 / Po)110.5 648 Q -.15(ve)-.15 G(rty Bay Circuit)
-.15 E(<epsg27208> : NZGD49 / Ha)110.5 660 Q(wk)-.15 E(es Bay Circuit)-.1
-E(<epsg27209> : NZGD49 / T)110.5 672 Q(aranaki Circuit)-.8 E
-(<epsg27210> : NZGD49 / T)110.5 684 Q(uhirangi Circuit)-.45 E
-(<epsg27211> : NZGD49 / W)110.5 696 Q(ang)-.8 E(anui Circuit)-.05 E
-(<epsg27212> : NZGD49 / W)110.5 708 Q(airarapa Circuit)-.8 E
-(<epsg27213> : NZGD49 / W)110.5 720 Q(ellington Circuit)-.8 E
-(MB-System 5.0)72 768 Q(29 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E
-(71)185.545 E 0 Cg EP
-%%Page: 72 72
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<epsg27214> : NZGD49 / Collingw)110.5 84 Q
-(ood Circuit)-.1 E(<epsg27215> : NZGD49 / Nelson Circuit)110.5 96 Q
-(<epsg27216> : NZGD49 / Karamea Circuit)110.5 108 Q
-(<epsg27217> : NZGD49 / Buller Circuit)110.5 120 Q
-(<epsg27218> : NZGD49 / Gre)110.5 132 Q 2.5(yC)-.15 G(ircuit)-2.5 E
-(<epsg27219> : NZGD49 / Amuri Circuit)110.5 144 Q
-(<epsg27220> : NZGD49 / Marlborough Circuit)110.5 156 Q
-(<epsg27221> : NZGD49 / Hokitika Circuit)110.5 168 Q
-(<epsg27222> : NZGD49 / Okarito Circuit)110.5 180 Q
-(<epsg27223> : NZGD49 / Jacksons Bay Circuit)110.5 192 Q
-(<epsg27224> : NZGD49 / Mount Pleasant Circuit)110.5 204 Q
-(<epsg27225> : NZGD49 / Ga)110.5 216 Q(wler Circuit)-.15 E
-(<epsg27226> : NZGD49 / T)110.5 228 Q(imaru Circuit)-.35 E
-(<epsg27227> : NZGD49 / Lindis Peak Circuit)110.5 240 Q
-(<epsg27228> : NZGD49 / Mount Nicholas Circuit)110.5 252 Q
-(<epsg27229> : NZGD49 / Mount Y)110.5 264 Q(ork Circuit)-1.1 E
-(<epsg27230> : NZGD49 / Observ)110.5 276 Q(ation Point Circuit)-.25 E
-(<epsg27231> : NZGD49 / North T)110.5 288 Q(aieri Circuit)-.8 E
-(<epsg27232> : NZGD49 / Bluf)110.5 300 Q 2.5(fC)-.25 G(ircuit)-2.5 E
-(<epsg27258> : NZGD49 / UTM zone 58S)110.5 312 Q
-(<epsg27259> : NZGD49 / UTM zone 59S)110.5 324 Q
-(<epsg27260> : NZGD49 / UTM zone 60S)110.5 336 Q
-(<epsg27291> : NZGD49 / North Island Grid)110.5 348 Q
-(<epsg27292> : NZGD49 / South Island Grid)110.5 360 Q
-(<epsg27391> : NGO 1948 \(Oslo\) / NGO zone I)110.5 372 Q
-(<epsg27392> : NGO 1948 \(Oslo\) / NGO zone II)110.5 384 Q
-(<epsg27393> : NGO 1948 \(Oslo\) / NGO zone III)110.5 396 Q
-(<epsg27394> : NGO 1948 \(Oslo\) / NGO zone IV)110.5 408 Q
-(<epsg27395> : NGO 1948 \(Oslo\) / NGO zone V)110.5 420 Q
-(<epsg27396> : NGO 1948 \(Oslo\) / NGO zone VI)110.5 432 Q
-(<epsg27397> : NGO 1948 \(Oslo\) / NGO zone VII)110.5 444 Q
-(<epsg27398> : NGO 1948 \(Oslo\) / NGO zone VIII)110.5 456 Q
-(<epsg27429> : Datum 73 / UTM zone 29N)110.5 468 Q
-(<epsg27492> : Datum 73 / Modi\214ed Portuguese Grid)110.5 480 Q
-(<epsg27500> : A)110.5 492 Q(TF \(P)-1.11 E(aris\) / Nord de Guerre)-.15
-E(<epsg27561> : NTF \(P)110.5 504 Q(aris\) / Lambert Nord France)-.15 E
-(<epsg27562> : NTF \(P)110.5 516 Q(aris\) / Lambert Centre France)-.15 E
-(<epsg27563> : NTF \(P)110.5 528 Q(aris\) / Lambert Sud France)-.15 E
-(<epsg27564> : NTF \(P)110.5 540 Q(aris\) / Lambert Corse)-.15 E
-(<epsg27571> : NTF \(P)110.5 552 Q(aris\) / Lambert zone I)-.15 E
-(<epsg27572> : NTF \(P)110.5 564 Q(aris\) / Lambert zone II)-.15 E
-(<epsg27573> : NTF \(P)110.5 576 Q(aris\) / Lambert zone III)-.15 E
-(<epsg27574> : NTF \(P)110.5 588 Q(aris\) / Lambert zone IV)-.15 E
-(<epsg27581> : NTF \(P)110.5 600 Q(aris\) / France I \(deprecated\))-.15
-E(<epsg27582> : NTF \(P)110.5 612 Q(aris\) / France II \(deprecated\))
--.15 E(<epsg27583> : NTF \(P)110.5 624 Q
-(aris\) / France III \(deprecated\))-.15 E(<epsg27584> : NTF \(P)110.5
-636 Q(aris\) / France IV \(deprecated\))-.15 E(<epsg27591> : NTF \(P)
-110.5 648 Q(aris\) / Nord France \(deprecated\))-.15 E
-(<epsg27592> : NTF \(P)110.5 660 Q
-(aris\) / Centre France \(deprecated\))-.15 E(<epsg27593> : NTF \(P)
-110.5 672 Q(aris\) / Sud France \(deprecated\))-.15 E
-(<epsg27594> : NTF \(P)110.5 684 Q(aris\) / Corse \(deprecated\))-.15 E
-(<epsg27700> : OSGB 1936 / British National Grid)110.5 696 Q
-(<epsg28191> : P)110.5 708 Q(alestine 1923 / P)-.15 E(alestine Grid)-.15
-E(<epsg28192> : P)110.5 720 Q(alestine 1923 / P)-.15 E(alestine Belt)
--.15 E(MB-System 5.0)72 768 Q(29 No)132.205 E -.15(ve)-.15 G(mber 2014)
-.15 E(72)185.545 E 0 Cg EP
-%%Page: 73 73
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<epsg28193> : P)110.5 84 Q
-(alestine 1923 / Israeli CS Grid)-.15 E
-(<epsg28232> : Pointe Noire / UTM zone 32S)110.5 96 Q(<epsg28348> : GD)
-110.5 108 Q(A94 / MGA zone 48)-.4 E(<epsg28349> : GD)110.5 120 Q
-(A94 / MGA zone 49)-.4 E(<epsg28350> : GD)110.5 132 Q(A94 / MGA zone 50)
--.4 E(<epsg28351> : GD)110.5 144 Q(A94 / MGA zone 51)-.4 E
-(<epsg28352> : GD)110.5 156 Q(A94 / MGA zone 52)-.4 E(<epsg28353> : GD)
-110.5 168 Q(A94 / MGA zone 53)-.4 E(<epsg28354> : GD)110.5 180 Q
-(A94 / MGA zone 54)-.4 E(<epsg28355> : GD)110.5 192 Q(A94 / MGA zone 55)
--.4 E(<epsg28356> : GD)110.5 204 Q(A94 / MGA zone 56)-.4 E
-(<epsg28357> : GD)110.5 216 Q(A94 / MGA zone 57)-.4 E(<epsg28358> : GD)
-110.5 228 Q(A94 / MGA zone 58)-.4 E(<epsg28402> : Pulk)110.5 240 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger zone 2)-2.5 E
-(<epsg28403> : Pulk)110.5 252 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger zone 3)-2.5 E(<epsg28404> : Pulk)110.5 264 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger zone 4)-2.5 E
-(<epsg28405> : Pulk)110.5 276 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger zone 5)-2.5 E(<epsg28406> : Pulk)110.5 288 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger zone 6)-2.5 E
-(<epsg28407> : Pulk)110.5 300 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger zone 7)-2.5 E(<epsg28408> : Pulk)110.5 312 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger zone 8)-2.5 E
-(<epsg28409> : Pulk)110.5 324 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger zone 9)-2.5 E(<epsg28410> : Pulk)110.5 336 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger zone 10)-2.5 E
-(<epsg28411> : Pulk)110.5 348 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger zone 11)-2.5 E(<epsg28412> : Pulk)110.5 360 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger zone 12)-2.5 E
-(<epsg28413> : Pulk)110.5 372 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger zone 13)-2.5 E(<epsg28414> : Pulk)110.5 384 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger zone 14)-2.5 E
-(<epsg28415> : Pulk)110.5 396 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger zone 15)-2.5 E(<epsg28416> : Pulk)110.5 408 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger zone 16)-2.5 E
-(<epsg28417> : Pulk)110.5 420 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger zone 17)-2.5 E(<epsg28418> : Pulk)110.5 432 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger zone 18)-2.5 E
-(<epsg28419> : Pulk)110.5 444 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger zone 19)-2.5 E(<epsg28420> : Pulk)110.5 456 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger zone 20)-2.5 E
-(<epsg28421> : Pulk)110.5 468 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger zone 21)-2.5 E(<epsg28422> : Pulk)110.5 480 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger zone 22)-2.5 E
-(<epsg28423> : Pulk)110.5 492 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger zone 23)-2.5 E(<epsg28424> : Pulk)110.5 504 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger zone 24)-2.5 E
-(<epsg28425> : Pulk)110.5 516 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger zone 25)-2.5 E(<epsg28426> : Pulk)110.5 528 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger zone 26)-2.5 E
-(<epsg28427> : Pulk)110.5 540 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger zone 27)-2.5 E(<epsg28428> : Pulk)110.5 552 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger zone 28)-2.5 E
-(<epsg28429> : Pulk)110.5 564 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger zone 29)-2.5 E(<epsg28430> : Pulk)110.5 576 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger zone 30)-2.5 E
-(<epsg28431> : Pulk)110.5 588 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger zone 31)-2.5 E(<epsg28432> : Pulk)110.5 600 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger zone 32)-2.5 E
-(<epsg28462> : Pulk)110.5 612 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger 2N \(deprecated\))-2.5 E(<epsg28463> : Pulk)110.5
-624 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger 3N \(deprecated\))
--2.5 E(<epsg28464> : Pulk)110.5 636 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger 4N \(deprecated\))-2.5 E(<epsg28465> : Pulk)110.5
-648 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger 5N \(deprecated\))
--2.5 E(<epsg28466> : Pulk)110.5 660 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger 6N \(deprecated\))-2.5 E(<epsg28467> : Pulk)110.5
-672 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger 7N \(deprecated\))
--2.5 E(<epsg28468> : Pulk)110.5 684 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger 8N \(deprecated\))-2.5 E(<epsg28469> : Pulk)110.5
-696 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger 9N \(deprecated\))
--2.5 E(<epsg28470> : Pulk)110.5 708 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger 10N \(deprecated\))-2.5 E(<epsg28471> : Pulk)110.5
-720 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger 11N \(deprecated\))
--2.5 E(MB-System 5.0)72 768 Q(29 No)132.205 E -.15(ve)-.15 G(mber 2014)
-.15 E(73)185.545 E 0 Cg EP
-%%Page: 74 74
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<epsg28472> : Pulk)110.5 84 Q -.15(ov)-.1 G 2.5
-(o1)-.05 G(942 / Gauss-Kruger 12N \(deprecated\))-2.5 E
-(<epsg28473> : Pulk)110.5 96 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger 13N \(deprecated\))-2.5 E(<epsg28474> : Pulk)110.5
-108 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger 14N \(deprecated\))
--2.5 E(<epsg28475> : Pulk)110.5 120 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger 15N \(deprecated\))-2.5 E(<epsg28476> : Pulk)110.5
-132 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger 16N \(deprecated\))
--2.5 E(<epsg28477> : Pulk)110.5 144 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger 17N \(deprecated\))-2.5 E(<epsg28478> : Pulk)110.5
-156 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger 18N \(deprecated\))
--2.5 E(<epsg28479> : Pulk)110.5 168 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger 19N \(deprecated\))-2.5 E(<epsg28480> : Pulk)110.5
-180 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger 20N \(deprecated\))
--2.5 E(<epsg28481> : Pulk)110.5 192 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger 21N \(deprecated\))-2.5 E(<epsg28482> : Pulk)110.5
-204 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger 22N \(deprecated\))
--2.5 E(<epsg28483> : Pulk)110.5 216 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger 23N \(deprecated\))-2.5 E(<epsg28484> : Pulk)110.5
-228 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger 24N \(deprecated\))
--2.5 E(<epsg28485> : Pulk)110.5 240 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger 25N \(deprecated\))-2.5 E(<epsg28486> : Pulk)110.5
-252 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger 26N \(deprecated\))
--2.5 E(<epsg28487> : Pulk)110.5 264 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger 27N \(deprecated\))-2.5 E(<epsg28488> : Pulk)110.5
-276 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger 28N \(deprecated\))
--2.5 E(<epsg28489> : Pulk)110.5 288 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger 29N \(deprecated\))-2.5 E(<epsg28490> : Pulk)110.5
-300 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger 30N \(deprecated\))
--2.5 E(<epsg28491> : Pulk)110.5 312 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger 31N \(deprecated\))-2.5 E(<epsg28492> : Pulk)110.5
-324 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger 32N \(deprecated\))
--2.5 E(<epsg28600> : Qatar 1974 / Qatar National Grid)110.5 336 Q
-(<epsg28991> : Amersfoort / RD Old)110.5 348 Q
-(<epsg28992> : Amersfoort / RD Ne)110.5 360 Q(w)-.25 E
-(<epsg29100> : SAD69 / Brazil Polyconic \(deprecated\))110.5 372 Q
-(<epsg29101> : SAD69 / Brazil Polyconic)110.5 384 Q
-(<epsg29118> : SAD69 / UTM zone 18N \(deprecated\))110.5 396 Q
-(<epsg29119> : SAD69 / UTM zone 19N \(deprecated\))110.5 408 Q
-(<epsg29120> : SAD69 / UTM zone 20N \(deprecated\))110.5 420 Q
-(<epsg29121> : SAD69 / UTM zone 21N \(deprecated\))110.5 432 Q
-(<epsg29122> : SAD69 / UTM zone 22N \(deprecated\))110.5 444 Q
-(<epsg29168> : SAD69 / UTM zone 18N)110.5 456 Q
-(<epsg29169> : SAD69 / UTM zone 19N)110.5 468 Q
-(<epsg29170> : SAD69 / UTM zone 20N)110.5 480 Q
-(<epsg29171> : SAD69 / UTM zone 21N)110.5 492 Q
-(<epsg29172> : SAD69 / UTM zone 22N)110.5 504 Q
-(<epsg29177> : SAD69 / UTM zone 17S \(deprecated\))110.5 516 Q
-(<epsg29178> : SAD69 / UTM zone 18S \(deprecated\))110.5 528 Q
-(<epsg29179> : SAD69 / UTM zone 19S \(deprecated\))110.5 540 Q
-(<epsg29180> : SAD69 / UTM zone 20S \(deprecated\))110.5 552 Q
-(<epsg29181> : SAD69 / UTM zone 21S \(deprecated\))110.5 564 Q
-(<epsg29182> : SAD69 / UTM zone 22S \(deprecated\))110.5 576 Q
-(<epsg29183> : SAD69 / UTM zone 23S \(deprecated\))110.5 588 Q
-(<epsg29184> : SAD69 / UTM zone 24S \(deprecated\))110.5 600 Q
-(<epsg29185> : SAD69 / UTM zone 25S \(deprecated\))110.5 612 Q
-(<epsg29187> : SAD69 / UTM zone 17S)110.5 624 Q
-(<epsg29188> : SAD69 / UTM zone 18S)110.5 636 Q
-(<epsg29189> : SAD69 / UTM zone 19S)110.5 648 Q
-(<epsg29190> : SAD69 / UTM zone 20S)110.5 660 Q
-(<epsg29191> : SAD69 / UTM zone 21S)110.5 672 Q
-(<epsg29192> : SAD69 / UTM zone 22S)110.5 684 Q
-(<epsg29193> : SAD69 / UTM zone 23S)110.5 696 Q
-(<epsg29194> : SAD69 / UTM zone 24S)110.5 708 Q
-(<epsg29195> : SAD69 / UTM zone 25S)110.5 720 Q(MB-System 5.0)72 768 Q
-(29 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E(74)185.545 E 0 Cg EP
-%%Page: 75 75
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<epsg29220> : Sapper Hill 1943 / UTM zone 20S)
-110.5 84 Q(<epsg29221> : Sapper Hill 1943 / UTM zone 21S)110.5 96 Q
-(<epsg29333> : Schw)110.5 108 Q(arzeck / UTM zone 33S)-.1 E
-(<epsg29635> : Sudan / UTM zone 35N \(deprecated\))110.5 120 Q
-(<epsg29636> : Sudan / UTM zone 36N \(deprecated\))110.5 132 Q
-(<epsg29700> : T)110.5 144 Q(ananari)-.8 E .3 -.15(ve \()-.25 H -.15(Pa)
-.15 G(ris\) / Laborde Grid \(deprecated\)).15 E(<epsg29702> : T)110.5
-156 Q(ananari)-.8 E .3 -.15(ve \()-.25 H -.15(Pa).15 G
-(ris\) / Laborde Grid approximation).15 E(<epsg29738> : T)110.5 168 Q
-(ananari)-.8 E .3 -.15(ve / U)-.25 H(TM zone 38S).15 E(<epsg29739> : T)
-110.5 180 Q(ananari)-.8 E .3 -.15(ve / U)-.25 H(TM zone 39S).15 E
-(<epsg29849> : T)110.5 192 Q(imbalai 1948 / UTM zone 49N)-.35 E
-(<epsg29850> : T)110.5 204 Q(imbalai 1948 / UTM zone 50N)-.35 E
-(<epsg29871> : T)110.5 216 Q(imbalai 1948 / RSO Borneo \(ch\))-.35 E
-(<epsg29872> : T)110.5 228 Q(imbalai 1948 / RSO Borneo \(ft\))-.35 E
-(<epsg29873> : T)110.5 240 Q(imbalai 1948 / RSO Borneo \(m\))-.35 E
-(<epsg29900> : TM65 / Irish National Grid \(deprecated\))110.5 252 Q
-(<epsg29901> : OSNI 1952 / Irish National Grid)110.5 264 Q
-(<epsg29902> : TM65 / Irish Grid)110.5 276 Q
-(<epsg29903> : TM75 / Irish Grid)110.5 288 Q(<epsg30161> : T)110.5 300 Q
-(ok)-.8 E(yo / Japan Plane Rectangular CS I)-.15 E(<epsg30162> : T)110.5
-312 Q(ok)-.8 E(yo / Japan Plane Rectangular CS II)-.15 E
-(<epsg30163> : T)110.5 324 Q(ok)-.8 E
-(yo / Japan Plane Rectangular CS III)-.15 E(<epsg30164> : T)110.5 336 Q
-(ok)-.8 E(yo / Japan Plane Rectangular CS IV)-.15 E(<epsg30165> : T)
-110.5 348 Q(ok)-.8 E(yo / Japan Plane Rectangular CS V)-.15 E
-(<epsg30166> : T)110.5 360 Q(ok)-.8 E
-(yo / Japan Plane Rectangular CS VI)-.15 E(<epsg30167> : T)110.5 372 Q
-(ok)-.8 E(yo / Japan Plane Rectangular CS VII)-.15 E(<epsg30168> : T)
-110.5 384 Q(ok)-.8 E(yo / Japan Plane Rectangular CS VIII)-.15 E
-(<epsg30169> : T)110.5 396 Q(ok)-.8 E
-(yo / Japan Plane Rectangular CS IX)-.15 E(<epsg30170> : T)110.5 408 Q
-(ok)-.8 E(yo / Japan Plane Rectangular CS X)-.15 E(<epsg30171> : T)110.5
-420 Q(ok)-.8 E(yo / Japan Plane Rectangular CS XI)-.15 E
-(<epsg30172> : T)110.5 432 Q(ok)-.8 E
-(yo / Japan Plane Rectangular CS XII)-.15 E(<epsg30173> : T)110.5 444 Q
-(ok)-.8 E(yo / Japan Plane Rectangular CS XIII)-.15 E(<epsg30174> : T)
-110.5 456 Q(ok)-.8 E(yo / Japan Plane Rectangular CS XIV)-.15 E
-(<epsg30175> : T)110.5 468 Q(ok)-.8 E
-(yo / Japan Plane Rectangular CS XV)-.15 E(<epsg30176> : T)110.5 480 Q
-(ok)-.8 E(yo / Japan Plane Rectangular CS XVI)-.15 E(<epsg30177> : T)
-110.5 492 Q(ok)-.8 E(yo / Japan Plane Rectangular CS XVII)-.15 E
-(<epsg30178> : T)110.5 504 Q(ok)-.8 E
-(yo / Japan Plane Rectangular CS XVIII)-.15 E(<epsg30179> : T)110.5 516
-Q(ok)-.8 E(yo / Japan Plane Rectangular CS XIX)-.15 E(<epsg30200> : T)
-110.5 528 Q(rinidad 1903 / T)-.35 E(rinidad Grid)-.35 E
-(<epsg30339> : TC\(1948\) / UTM zone 39N)110.5 540 Q
-(<epsg30340> : TC\(1948\) / UTM zone 40N)110.5 552 Q(<epsg30491> : V)
-110.5 564 Q(oirol 1875 / Nord Algerie \(ancienne\))-1.29 E
-(<epsg30492> : V)110.5 576 Q(oirol 1875 / Sud Algerie \(ancienne\))-1.29
-E(<epsg30493> : V)110.5 588 Q(oirol 1879 / Nord Algerie \(ancienne\))
--1.29 E(<epsg30494> : V)110.5 600 Q
-(oirol 1879 / Sud Algerie \(ancienne\))-1.29 E
-(<epsg30729> : Nord Sahara 1959 / UTM zone 29N)110.5 612 Q
-(<epsg30730> : Nord Sahara 1959 / UTM zone 30N)110.5 624 Q
-(<epsg30731> : Nord Sahara 1959 / UTM zone 31N)110.5 636 Q
-(<epsg30732> : Nord Sahara 1959 / UTM zone 32N)110.5 648 Q
-(<epsg30791> : Nord Sahara 1959 / V)110.5 660 Q(oirol Uni\214e Nord)
--1.29 E(<epsg30792> : Nord Sahara 1959 / V)110.5 672 Q
-(oirol Uni\214e Sud)-1.29 E(<epsg30800> : R)110.5 684 Q
-(T38 2.5 gon W \(deprecated\))-.6 E(<epsg31028> : Y)110.5 696 Q(of)-1.1
-E 2.5(f/U)-.25 G(TM zone 28N)-2.5 E
-(<epsg31121> : Zanderij / UTM zone 21N)110.5 708 Q
-(<epsg31154> : Zanderij / TM 54 NW)110.5 720 Q(MB-System 5.0)72 768 Q
-(29 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E(75)185.545 E 0 Cg EP
-%%Page: 76 76
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<epsg31170> : Zanderij / Suriname Old TM)110.5 84
-Q(<epsg31171> : Zanderij / Suriname TM)110.5 96 Q
-(<epsg31251> : MGI \(Ferro\) / Austria GK W)110.5 108 Q(est Zone)-.8 E
-(<epsg31252> : MGI \(Ferro\) / Austria GK Central Zone)110.5 120 Q
-(<epsg31253> : MGI \(Ferro\) / Austria GK East Zone)110.5 132 Q
-(<epsg31254> : MGI / Austria GK W)110.5 144 Q(est)-.8 E
-(<epsg31255> : MGI / Austria GK Central)110.5 156 Q
-(<epsg31256> : MGI / Austria GK East)110.5 168 Q
-(<epsg31257> : MGI / Austria GK M28)110.5 180 Q
-(<epsg31258> : MGI / Austria GK M31)110.5 192 Q
-(<epsg31259> : MGI / Austria GK M34)110.5 204 Q
-(<epsg31265> : MGI / 3-de)110.5 216 Q(gree Gauss zone 5 \(deprecated\))
--.15 E(<epsg31266> : MGI / 3-de)110.5 228 Q
-(gree Gauss zone 6 \(deprecated\))-.15 E(<epsg31267> : MGI / 3-de)110.5
-240 Q(gree Gauss zone 7 \(deprecated\))-.15 E(<epsg31268> : MGI / 3-de)
-110.5 252 Q(gree Gauss zone 8 \(deprecated\))-.15 E
-(<epsg31275> : MGI / Balkans zone 5)110.5 264 Q
-(<epsg31276> : MGI / Balkans zone 6)110.5 276 Q
-(<epsg31277> : MGI / Balkans zone 7)110.5 288 Q
-(<epsg31278> : MGI / Balkans zone 8 \(deprecated\))110.5 300 Q
-(<epsg31279> : MGI / Balkans zone 8)110.5 312 Q
-(<epsg31281> : MGI \(Ferro\) / Austria W)110.5 324 Q(est Zone)-.8 E
-(<epsg31282> : MGI \(Ferro\) / Austria Central Zone)110.5 336 Q
-(<epsg31283> : MGI \(Ferro\) / Austria East Zone)110.5 348 Q
-(<epsg31284> : MGI / Austria M28)110.5 360 Q
-(<epsg31285> : MGI / Austria M31)110.5 372 Q
-(<epsg31286> : MGI / Austria M34)110.5 384 Q
-(<epsg31287> : MGI / Austria Lambert)110.5 396 Q
-(<epsg31288> : MGI \(Ferro\) / M28)110.5 408 Q
-(<epsg31289> : MGI \(Ferro\) / M31)110.5 420 Q
-(<epsg31290> : MGI \(Ferro\) / M34)110.5 432 Q
-(<epsg31291> : MGI \(Ferro\) / Austria W)110.5 444 Q
-(est Zone \(deprecated\))-.8 E
-(<epsg31292> : MGI \(Ferro\) / Austria Central Zone \(deprecated\))110.5
-456 Q(<epsg31293> : MGI \(Ferro\) / Austria East Zone \(deprecated\))
-110.5 468 Q(<epsg31294> : MGI / M28 \(deprecated\))110.5 480 Q
-(<epsg31295> : MGI / M31 \(deprecated\))110.5 492 Q
-(<epsg31296> : MGI / M34 \(deprecated\))110.5 504 Q
-(<epsg31297> : MGI / Austria Lambert \(deprecated\))110.5 516 Q
-(<epsg31300> : Belge 1972 / Belge Lambert 72)110.5 528 Q
-(<epsg31370> : Belge 1972 / Belgian Lambert 72)110.5 540 Q
-(<epsg31461> : DHDN / 3-de)110.5 552 Q(gree Gauss zone 1 \(deprecated\))
--.15 E(<epsg31462> : DHDN / 3-de)110.5 564 Q
-(gree Gauss zone 2 \(deprecated\))-.15 E(<epsg31463> : DHDN / 3-de)110.5
-576 Q(gree Gauss zone 3 \(deprecated\))-.15 E(<epsg31464> : DHDN / 3-de)
-110.5 588 Q(gree Gauss zone 4 \(deprecated\))-.15 E
-(<epsg31465> : DHDN / 3-de)110.5 600 Q(gree Gauss zone 5 \(deprecated\))
--.15 E(<epsg31466> : DHDN / Gauss-Kruger zone 2)110.5 612 Q
-(<epsg31467> : DHDN / Gauss-Kruger zone 3)110.5 624 Q
-(<epsg31468> : DHDN / Gauss-Kruger zone 4)110.5 636 Q
-(<epsg31469> : DHDN / Gauss-Kruger zone 5)110.5 648 Q
-(<epsg31528> : Conakry 1905 / UTM zone 28N)110.5 660 Q
-(<epsg31529> : Conakry 1905 / UTM zone 29N)110.5 672 Q
-(<epsg31600> : Dealul Piscului 1933/ Stereo 33)110.5 684 Q
-(<epsg31700> : Dealul Piscului 1970/ Stereo 70)110.5 696 Q
-(<epsg31838> : NGN / UTM zone 38N)110.5 708 Q
-(<epsg31839> : NGN / UTM zone 39N)110.5 720 Q(MB-System 5.0)72 768 Q
-(29 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E(76)185.545 E 0 Cg EP
-%%Page: 77 77
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<epsg31900> : KUD)110.5 84 Q
-(AMS / KTM \(deprecated\))-.4 E(<epsg31901> : KUD)110.5 96 Q(AMS / KTM)
--.4 E(<epsg31965> : SIRGAS 2000 / UTM zone 11N)110.5 108 Q
-(<epsg31966> : SIRGAS 2000 / UTM zone 12N)110.5 120 Q
-(<epsg31967> : SIRGAS 2000 / UTM zone 13N)110.5 132 Q
-(<epsg31968> : SIRGAS 2000 / UTM zone 14N)110.5 144 Q
-(<epsg31969> : SIRGAS 2000 / UTM zone 15N)110.5 156 Q
-(<epsg31970> : SIRGAS 2000 / UTM zone 16N)110.5 168 Q
-(<epsg31971> : SIRGAS 2000 / UTM zone 17N)110.5 180 Q
-(<epsg31972> : SIRGAS 2000 / UTM zone 18N)110.5 192 Q
-(<epsg31973> : SIRGAS 2000 / UTM zone 19N)110.5 204 Q
-(<epsg31974> : SIRGAS 2000 / UTM zone 20N)110.5 216 Q
-(<epsg31975> : SIRGAS 2000 / UTM zone 21N)110.5 228 Q
-(<epsg31976> : SIRGAS 2000 / UTM zone 22N)110.5 240 Q
-(<epsg31977> : SIRGAS 2000 / UTM zone 17S)110.5 252 Q
-(<epsg31978> : SIRGAS 2000 / UTM zone 18S)110.5 264 Q
-(<epsg31979> : SIRGAS 2000 / UTM zone 19S)110.5 276 Q
-(<epsg31980> : SIRGAS 2000 / UTM zone 20S)110.5 288 Q
-(<epsg31981> : SIRGAS 2000 / UTM zone 21S)110.5 300 Q
-(<epsg31982> : SIRGAS 2000 / UTM zone 22S)110.5 312 Q
-(<epsg31983> : SIRGAS 2000 / UTM zone 23S)110.5 324 Q
-(<epsg31984> : SIRGAS 2000 / UTM zone 24S)110.5 336 Q
-(<epsg31985> : SIRGAS 2000 / UTM zone 25S)110.5 348 Q
-(<epsg31986> : SIRGAS / UTM zone 17N)110.5 360 Q
-(<epsg31987> : SIRGAS / UTM zone 18N)110.5 372 Q
-(<epsg31988> : SIRGAS / UTM zone 19N)110.5 384 Q
-(<epsg31989> : SIRGAS / UTM zone 20N)110.5 396 Q
-(<epsg31990> : SIRGAS / UTM zone 21N)110.5 408 Q
-(<epsg31991> : SIRGAS / UTM zone 22N)110.5 420 Q
-(<epsg31992> : SIRGAS / UTM zone 17S)110.5 432 Q
-(<epsg31993> : SIRGAS / UTM zone 18S)110.5 444 Q
-(<epsg31994> : SIRGAS / UTM zone 19S)110.5 456 Q
-(<epsg31995> : SIRGAS / UTM zone 20S)110.5 468 Q
-(<epsg31996> : SIRGAS / UTM zone 21S)110.5 480 Q
-(<epsg31997> : SIRGAS / UTM zone 22S)110.5 492 Q
-(<epsg31998> : SIRGAS / UTM zone 23S)110.5 504 Q
-(<epsg31999> : SIRGAS / UTM zone 24S)110.5 516 Q
-(<epsg32000> : SIRGAS / UTM zone 25S)110.5 528 Q(<epsg32001> : N)110.5
-540 Q(AD27 / Montana North)-.35 E(<epsg32002> : N)110.5 552 Q
-(AD27 / Montana Central)-.35 E(<epsg32003> : N)110.5 564 Q
-(AD27 / Montana South)-.35 E(<epsg32005> : N)110.5 576 Q
-(AD27 / Nebraska North)-.35 E(<epsg32006> : N)110.5 588 Q
-(AD27 / Nebraska South)-.35 E(<epsg32007> : N)110.5 600 Q(AD27 / Ne)-.35
-E -.25(va)-.25 G(da East).25 E(<epsg32008> : N)110.5 612 Q(AD27 / Ne)
--.35 E -.25(va)-.25 G(da Central).25 E(<epsg32009> : N)110.5 624 Q
-(AD27 / Ne)-.35 E -.25(va)-.25 G(da W).25 E(est)-.8 E(<epsg32010> : N)
-110.5 636 Q(AD27 / Ne)-.35 E 2.5(wH)-.25 G(ampshire)-2.5 E
-(<epsg32011> : N)110.5 648 Q(AD27 / Ne)-.35 E 2.5(wJ)-.25 G(erse)-2.5 E
-(y)-.15 E(<epsg32012> : N)110.5 660 Q(AD27 / Ne)-.35 E 2.5(wM)-.25 G
--.15(ex)-2.5 G(ico East).15 E(<epsg32013> : N)110.5 672 Q(AD27 / Ne)-.35
-E 2.5(wM)-.25 G -.15(ex)-2.5 G(ico Central).15 E(<epsg32014> : N)110.5
-684 Q(AD27 / Ne)-.35 E 2.5(wM)-.25 G -.15(ex)-2.5 G(ico W).15 E(est)-.8
-E(<epsg32015> : N)110.5 696 Q(AD27 / Ne)-.35 E 2.5(wY)-.25 G(ork East)
--3.6 E(<epsg32016> : N)110.5 708 Q(AD27 / Ne)-.35 E 2.5(wY)-.25 G
-(ork Central)-3.6 E(<epsg32017> : N)110.5 720 Q(AD27 / Ne)-.35 E 2.5(wY)
--.25 G(ork W)-3.6 E(est)-.8 E(MB-System 5.0)72 768 Q(29 No)132.205 E
--.15(ve)-.15 G(mber 2014).15 E(77)185.545 E 0 Cg EP
-%%Page: 78 78
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<epsg32018> : N)110.5 84 Q(AD27 / Ne)-.35 E 2.5
-(wY)-.25 G(ork Long Island)-3.6 E(<epsg32019> : N)110.5 96 Q
-(AD27 / North Carolina)-.35 E(<epsg32020> : N)110.5 108 Q
-(AD27 / North Dak)-.35 E(ota North)-.1 E(<epsg32021> : N)110.5 120 Q
-(AD27 / North Dak)-.35 E(ota South)-.1 E(<epsg32022> : N)110.5 132 Q
-(AD27 / Ohio North)-.35 E(<epsg32023> : N)110.5 144 Q(AD27 / Ohio South)
--.35 E(<epsg32024> : N)110.5 156 Q(AD27 / Oklahoma North)-.35 E
-(<epsg32025> : N)110.5 168 Q(AD27 / Oklahoma South)-.35 E
-(<epsg32026> : N)110.5 180 Q(AD27 / Ore)-.35 E(gon North)-.15 E
-(<epsg32027> : N)110.5 192 Q(AD27 / Ore)-.35 E(gon South)-.15 E
-(<epsg32028> : N)110.5 204 Q(AD27 / Pennsylv)-.35 E(ania North)-.25 E
-(<epsg32029> : N)110.5 216 Q(AD27 / Pennsylv)-.35 E(ania South)-.25 E
-(<epsg32030> : N)110.5 228 Q(AD27 / Rhode Island)-.35 E(<epsg32031> : N)
-110.5 240 Q(AD27 / South Carolina North)-.35 E(<epsg32033> : N)110.5 252
-Q(AD27 / South Carolina South)-.35 E(<epsg32034> : N)110.5 264 Q
-(AD27 / South Dak)-.35 E(ota North)-.1 E(<epsg32035> : N)110.5 276 Q
-(AD27 / South Dak)-.35 E(ota South)-.1 E(<epsg32036> : N)110.5 288 Q
-(AD27 / T)-.35 E(ennessee \(deprecated\))-.7 E(<epsg32037> : N)110.5 300
-Q(AD27 / T)-.35 E -.15(ex)-.7 G(as North).15 E(<epsg32038> : N)110.5 312
-Q(AD27 / T)-.35 E -.15(ex)-.7 G(as North Central).15 E(<epsg32039> : N)
-110.5 324 Q(AD27 / T)-.35 E -.15(ex)-.7 G(as Central).15 E
-(<epsg32040> : N)110.5 336 Q(AD27 / T)-.35 E -.15(ex)-.7 G
-(as South Central).15 E(<epsg32041> : N)110.5 348 Q(AD27 / T)-.35 E -.15
-(ex)-.7 G(as South).15 E(<epsg32042> : N)110.5 360 Q(AD27 / Utah North)
--.35 E(<epsg32043> : N)110.5 372 Q(AD27 / Utah Central)-.35 E
-(<epsg32044> : N)110.5 384 Q(AD27 / Utah South)-.35 E(<epsg32045> : N)
-110.5 396 Q(AD27 / V)-.35 E(ermont)-1.11 E(<epsg32046> : N)110.5 408 Q
-(AD27 / V)-.35 E(ir)-.6 E(ginia North)-.18 E(<epsg32047> : N)110.5 420 Q
-(AD27 / V)-.35 E(ir)-.6 E(ginia South)-.18 E(<epsg32048> : N)110.5 432 Q
-(AD27 / W)-.35 E(ashington North)-.8 E(<epsg32049> : N)110.5 444 Q
-(AD27 / W)-.35 E(ashington South)-.8 E(<epsg32050> : N)110.5 456 Q
-(AD27 / W)-.35 E(est V)-.8 E(ir)-.6 E(ginia North)-.18 E
-(<epsg32051> : N)110.5 468 Q(AD27 / W)-.35 E(est V)-.8 E(ir)-.6 E
-(ginia South)-.18 E(<epsg32052> : N)110.5 480 Q(AD27 / W)-.35 E
-(isconsin North)-.4 E(<epsg32053> : N)110.5 492 Q(AD27 / W)-.35 E
-(isconsin Central)-.4 E(<epsg32054> : N)110.5 504 Q(AD27 / W)-.35 E
-(isconsin South)-.4 E(<epsg32055> : N)110.5 516 Q(AD27 / W)-.35 E
-(yoming East)-.73 E(<epsg32056> : N)110.5 528 Q(AD27 / W)-.35 E
-(yoming East Central)-.73 E(<epsg32057> : N)110.5 540 Q(AD27 / W)-.35 E
-(yoming W)-.73 E(est Central)-.8 E(<epsg32058> : N)110.5 552 Q(AD27 / W)
--.35 E(yoming W)-.73 E(est)-.8 E(<epsg32061> : N)110.5 564 Q
-(AD27 / Guatemala Norte)-.35 E(<epsg32062> : N)110.5 576 Q
-(AD27 / Guatemala Sur)-.35 E(<epsg32064> : N)110.5 588 Q
-(AD27 / BLM 14N \(ftUS\))-.35 E(<epsg32065> : N)110.5 600 Q
-(AD27 / BLM 15N \(ftUS\))-.35 E(<epsg32066> : N)110.5 612 Q
-(AD27 / BLM 16N \(ftUS\))-.35 E(<epsg32067> : N)110.5 624 Q
-(AD27 / BLM 17N \(ftUS\))-.35 E(<epsg32074> : N)110.5 636 Q
-(AD27 / BLM 14N \(feet\) \(deprecated\))-.35 E(<epsg32075> : N)110.5 648
-Q(AD27 / BLM 15N \(feet\) \(deprecated\))-.35 E(<epsg32076> : N)110.5
-660 Q(AD27 / BLM 16N \(feet\) \(deprecated\))-.35 E(<epsg32077> : N)
-110.5 672 Q(AD27 / BLM 17N \(feet\) \(deprecated\))-.35 E
-(<epsg32081> : N)110.5 684 Q(AD27 / MTM zone 1)-.35 E(<epsg32082> : N)
-110.5 696 Q(AD27 / MTM zone 2)-.35 E(<epsg32083> : N)110.5 708 Q
-(AD27 / MTM zone 3)-.35 E(<epsg32084> : N)110.5 720 Q(AD27 / MTM zone 4)
--.35 E(MB-System 5.0)72 768 Q(29 No)132.205 E -.15(ve)-.15 G(mber 2014)
-.15 E(78)185.545 E 0 Cg EP
-%%Page: 79 79
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<epsg32085> : N)110.5 84 Q(AD27 / MTM zone 5)-.35
-E(<epsg32086> : N)110.5 96 Q(AD27 / MTM zone 6)-.35 E(<epsg32098> : N)
-110.5 108 Q(AD27 / Quebec Lambert)-.35 E(<epsg32099> : N)110.5 120 Q
-(AD27 / Louisiana Of)-.35 E(fshore)-.25 E(<epsg32100> : N)110.5 132 Q
-(AD83 / Montana)-.35 E(<epsg32104> : N)110.5 144 Q(AD83 / Nebraska)-.35
-E(<epsg32107> : N)110.5 156 Q(AD83 / Ne)-.35 E -.25(va)-.25 G(da East)
-.25 E(<epsg32108> : N)110.5 168 Q(AD83 / Ne)-.35 E -.25(va)-.25 G
-(da Central).25 E(<epsg32109> : N)110.5 180 Q(AD83 / Ne)-.35 E -.25(va)
--.25 G(da W).25 E(est)-.8 E(<epsg32110> : N)110.5 192 Q(AD83 / Ne)-.35 E
-2.5(wH)-.25 G(ampshire)-2.5 E(<epsg32111> : N)110.5 204 Q(AD83 / Ne)-.35
-E 2.5(wJ)-.25 G(erse)-2.5 E(y)-.15 E(<epsg32112> : N)110.5 216 Q
-(AD83 / Ne)-.35 E 2.5(wM)-.25 G -.15(ex)-2.5 G(ico East).15 E
-(<epsg32113> : N)110.5 228 Q(AD83 / Ne)-.35 E 2.5(wM)-.25 G -.15(ex)-2.5
-G(ico Central).15 E(<epsg32114> : N)110.5 240 Q(AD83 / Ne)-.35 E 2.5(wM)
--.25 G -.15(ex)-2.5 G(ico W).15 E(est)-.8 E(<epsg32115> : N)110.5 252 Q
-(AD83 / Ne)-.35 E 2.5(wY)-.25 G(ork East)-3.6 E(<epsg32116> : N)110.5
-264 Q(AD83 / Ne)-.35 E 2.5(wY)-.25 G(ork Central)-3.6 E(<epsg32117> : N)
-110.5 276 Q(AD83 / Ne)-.35 E 2.5(wY)-.25 G(ork W)-3.6 E(est)-.8 E
-(<epsg32118> : N)110.5 288 Q(AD83 / Ne)-.35 E 2.5(wY)-.25 G
-(ork Long Island)-3.6 E(<epsg32119> : N)110.5 300 Q
-(AD83 / North Carolina)-.35 E(<epsg32120> : N)110.5 312 Q
-(AD83 / North Dak)-.35 E(ota North)-.1 E(<epsg32121> : N)110.5 324 Q
-(AD83 / North Dak)-.35 E(ota South)-.1 E(<epsg32122> : N)110.5 336 Q
-(AD83 / Ohio North)-.35 E(<epsg32123> : N)110.5 348 Q(AD83 / Ohio South)
--.35 E(<epsg32124> : N)110.5 360 Q(AD83 / Oklahoma North)-.35 E
-(<epsg32125> : N)110.5 372 Q(AD83 / Oklahoma South)-.35 E
-(<epsg32126> : N)110.5 384 Q(AD83 / Ore)-.35 E(gon North)-.15 E
-(<epsg32127> : N)110.5 396 Q(AD83 / Ore)-.35 E(gon South)-.15 E
-(<epsg32128> : N)110.5 408 Q(AD83 / Pennsylv)-.35 E(ania North)-.25 E
-(<epsg32129> : N)110.5 420 Q(AD83 / Pennsylv)-.35 E(ania South)-.25 E
-(<epsg32130> : N)110.5 432 Q(AD83 / Rhode Island)-.35 E(<epsg32133> : N)
-110.5 444 Q(AD83 / South Carolina)-.35 E(<epsg32134> : N)110.5 456 Q
-(AD83 / South Dak)-.35 E(ota North)-.1 E(<epsg32135> : N)110.5 468 Q
-(AD83 / South Dak)-.35 E(ota South)-.1 E(<epsg32136> : N)110.5 480 Q
-(AD83 / T)-.35 E(ennessee)-.7 E(<epsg32137> : N)110.5 492 Q(AD83 / T)
--.35 E -.15(ex)-.7 G(as North).15 E(<epsg32138> : N)110.5 504 Q
-(AD83 / T)-.35 E -.15(ex)-.7 G(as North Central).15 E(<epsg32139> : N)
-110.5 516 Q(AD83 / T)-.35 E -.15(ex)-.7 G(as Central).15 E
-(<epsg32140> : N)110.5 528 Q(AD83 / T)-.35 E -.15(ex)-.7 G
-(as South Central).15 E(<epsg32141> : N)110.5 540 Q(AD83 / T)-.35 E -.15
-(ex)-.7 G(as South).15 E(<epsg32142> : N)110.5 552 Q(AD83 / Utah North)
--.35 E(<epsg32143> : N)110.5 564 Q(AD83 / Utah Central)-.35 E
-(<epsg32144> : N)110.5 576 Q(AD83 / Utah South)-.35 E(<epsg32145> : N)
-110.5 588 Q(AD83 / V)-.35 E(ermont)-1.11 E(<epsg32146> : N)110.5 600 Q
-(AD83 / V)-.35 E(ir)-.6 E(ginia North)-.18 E(<epsg32147> : N)110.5 612 Q
-(AD83 / V)-.35 E(ir)-.6 E(ginia South)-.18 E(<epsg32148> : N)110.5 624 Q
-(AD83 / W)-.35 E(ashington North)-.8 E(<epsg32149> : N)110.5 636 Q
-(AD83 / W)-.35 E(ashington South)-.8 E(<epsg32150> : N)110.5 648 Q
-(AD83 / W)-.35 E(est V)-.8 E(ir)-.6 E(ginia North)-.18 E
-(<epsg32151> : N)110.5 660 Q(AD83 / W)-.35 E(est V)-.8 E(ir)-.6 E
-(ginia South)-.18 E(<epsg32152> : N)110.5 672 Q(AD83 / W)-.35 E
-(isconsin North)-.4 E(<epsg32153> : N)110.5 684 Q(AD83 / W)-.35 E
-(isconsin Central)-.4 E(<epsg32154> : N)110.5 696 Q(AD83 / W)-.35 E
-(isconsin South)-.4 E(<epsg32155> : N)110.5 708 Q(AD83 / W)-.35 E
-(yoming East)-.73 E(<epsg32156> : N)110.5 720 Q(AD83 / W)-.35 E
-(yoming East Central)-.73 E(MB-System 5.0)72 768 Q(29 No)132.205 E -.15
-(ve)-.15 G(mber 2014).15 E(79)185.545 E 0 Cg EP
-%%Page: 80 80
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<epsg32157> : N)110.5 84 Q(AD83 / W)-.35 E
-(yoming W)-.73 E(est Central)-.8 E(<epsg32158> : N)110.5 96 Q(AD83 / W)
--.35 E(yoming W)-.73 E(est)-.8 E(<epsg32161> : N)110.5 108 Q
-(AD83 / Puerto Rico & V)-.35 E(ir)-.6 E(gin Is.)-.18 E(<epsg32164> : N)
-110.5 120 Q(AD83 / BLM 14N \(ftUS\))-.35 E(<epsg32165> : N)110.5 132 Q
-(AD83 / BLM 15N \(ftUS\))-.35 E(<epsg32166> : N)110.5 144 Q
-(AD83 / BLM 16N \(ftUS\))-.35 E(<epsg32167> : N)110.5 156 Q
-(AD83 / BLM 17N \(ftUS\))-.35 E(<epsg32180> : N)110.5 168 Q
-(AD83 / SCoPQ zone 2)-.35 E(<epsg32181> : N)110.5 180 Q
-(AD83 / MTM zone 1)-.35 E(<epsg32182> : N)110.5 192 Q(AD83 / MTM zone 2)
--.35 E(<epsg32183> : N)110.5 204 Q(AD83 / MTM zone 3)-.35 E
-(<epsg32184> : N)110.5 216 Q(AD83 / MTM zone 4)-.35 E(<epsg32185> : N)
-110.5 228 Q(AD83 / MTM zone 5)-.35 E(<epsg32186> : N)110.5 240 Q
-(AD83 / MTM zone 6)-.35 E(<epsg32187> : N)110.5 252 Q(AD83 / MTM zone 7)
--.35 E(<epsg32188> : N)110.5 264 Q(AD83 / MTM zone 8)-.35 E
-(<epsg32189> : N)110.5 276 Q(AD83 / MTM zone 9)-.35 E(<epsg32190> : N)
-110.5 288 Q(AD83 / MTM zone 10)-.35 E(<epsg32191> : N)110.5 300 Q
-(AD83 / MTM zone 11)-.35 E(<epsg32192> : N)110.5 312 Q
-(AD83 / MTM zone 12)-.35 E(<epsg32193> : N)110.5 324 Q
-(AD83 / MTM zone 13)-.35 E(<epsg32194> : N)110.5 336 Q
-(AD83 / MTM zone 14)-.35 E(<epsg32195> : N)110.5 348 Q
-(AD83 / MTM zone 15)-.35 E(<epsg32196> : N)110.5 360 Q
-(AD83 / MTM zone 16)-.35 E(<epsg32197> : N)110.5 372 Q
-(AD83 / MTM zone 17)-.35 E(<epsg32198> : N)110.5 384 Q
-(AD83 / Quebec Lambert)-.35 E(<epsg32199> : N)110.5 396 Q
-(AD83 / Louisiana Of)-.35 E(fshore)-.25 E
-(<epsg32201> : WGS 72 / UTM zone 1N)110.5 408 Q
-(<epsg32202> : WGS 72 / UTM zone 2N)110.5 420 Q
-(<epsg32203> : WGS 72 / UTM zone 3N)110.5 432 Q
-(<epsg32204> : WGS 72 / UTM zone 4N)110.5 444 Q
-(<epsg32205> : WGS 72 / UTM zone 5N)110.5 456 Q
-(<epsg32206> : WGS 72 / UTM zone 6N)110.5 468 Q
-(<epsg32207> : WGS 72 / UTM zone 7N)110.5 480 Q
-(<epsg32208> : WGS 72 / UTM zone 8N)110.5 492 Q
-(<epsg32209> : WGS 72 / UTM zone 9N)110.5 504 Q
-(<epsg32210> : WGS 72 / UTM zone 10N)110.5 516 Q
-(<epsg32211> : WGS 72 / UTM zone 11N)110.5 528 Q
-(<epsg32212> : WGS 72 / UTM zone 12N)110.5 540 Q
-(<epsg32213> : WGS 72 / UTM zone 13N)110.5 552 Q
-(<epsg32214> : WGS 72 / UTM zone 14N)110.5 564 Q
-(<epsg32215> : WGS 72 / UTM zone 15N)110.5 576 Q
-(<epsg32216> : WGS 72 / UTM zone 16N)110.5 588 Q
-(<epsg32217> : WGS 72 / UTM zone 17N)110.5 600 Q
-(<epsg32218> : WGS 72 / UTM zone 18N)110.5 612 Q
-(<epsg32219> : WGS 72 / UTM zone 19N)110.5 624 Q
-(<epsg32220> : WGS 72 / UTM zone 20N)110.5 636 Q
-(<epsg32221> : WGS 72 / UTM zone 21N)110.5 648 Q
-(<epsg32222> : WGS 72 / UTM zone 22N)110.5 660 Q
-(<epsg32223> : WGS 72 / UTM zone 23N)110.5 672 Q
-(<epsg32224> : WGS 72 / UTM zone 24N)110.5 684 Q
-(<epsg32225> : WGS 72 / UTM zone 25N)110.5 696 Q
-(<epsg32226> : WGS 72 / UTM zone 26N)110.5 708 Q
-(<epsg32227> : WGS 72 / UTM zone 27N)110.5 720 Q(MB-System 5.0)72 768 Q
-(29 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E(80)185.545 E 0 Cg EP
-%%Page: 81 81
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<epsg32228> : WGS 72 / UTM zone 28N)110.5 84 Q
-(<epsg32229> : WGS 72 / UTM zone 29N)110.5 96 Q
-(<epsg32230> : WGS 72 / UTM zone 30N)110.5 108 Q
-(<epsg32231> : WGS 72 / UTM zone 31N)110.5 120 Q
-(<epsg32232> : WGS 72 / UTM zone 32N)110.5 132 Q
-(<epsg32233> : WGS 72 / UTM zone 33N)110.5 144 Q
-(<epsg32234> : WGS 72 / UTM zone 34N)110.5 156 Q
-(<epsg32235> : WGS 72 / UTM zone 35N)110.5 168 Q
-(<epsg32236> : WGS 72 / UTM zone 36N)110.5 180 Q
-(<epsg32237> : WGS 72 / UTM zone 37N)110.5 192 Q
-(<epsg32238> : WGS 72 / UTM zone 38N)110.5 204 Q
-(<epsg32239> : WGS 72 / UTM zone 39N)110.5 216 Q
-(<epsg32240> : WGS 72 / UTM zone 40N)110.5 228 Q
-(<epsg32241> : WGS 72 / UTM zone 41N)110.5 240 Q
-(<epsg32242> : WGS 72 / UTM zone 42N)110.5 252 Q
-(<epsg32243> : WGS 72 / UTM zone 43N)110.5 264 Q
-(<epsg32244> : WGS 72 / UTM zone 44N)110.5 276 Q
-(<epsg32245> : WGS 72 / UTM zone 45N)110.5 288 Q
-(<epsg32246> : WGS 72 / UTM zone 46N)110.5 300 Q
-(<epsg32247> : WGS 72 / UTM zone 47N)110.5 312 Q
-(<epsg32248> : WGS 72 / UTM zone 48N)110.5 324 Q
-(<epsg32249> : WGS 72 / UTM zone 49N)110.5 336 Q
-(<epsg32250> : WGS 72 / UTM zone 50N)110.5 348 Q
-(<epsg32251> : WGS 72 / UTM zone 51N)110.5 360 Q
-(<epsg32252> : WGS 72 / UTM zone 52N)110.5 372 Q
-(<epsg32253> : WGS 72 / UTM zone 53N)110.5 384 Q
-(<epsg32254> : WGS 72 / UTM zone 54N)110.5 396 Q
-(<epsg32255> : WGS 72 / UTM zone 55N)110.5 408 Q
-(<epsg32256> : WGS 72 / UTM zone 56N)110.5 420 Q
-(<epsg32257> : WGS 72 / UTM zone 57N)110.5 432 Q
-(<epsg32258> : WGS 72 / UTM zone 58N)110.5 444 Q
-(<epsg32259> : WGS 72 / UTM zone 59N)110.5 456 Q
-(<epsg32260> : WGS 72 / UTM zone 60N)110.5 468 Q
-(<epsg32301> : WGS 72 / UTM zone 1S)110.5 480 Q
-(<epsg32302> : WGS 72 / UTM zone 2S)110.5 492 Q
-(<epsg32303> : WGS 72 / UTM zone 3S)110.5 504 Q
-(<epsg32304> : WGS 72 / UTM zone 4S)110.5 516 Q
-(<epsg32305> : WGS 72 / UTM zone 5S)110.5 528 Q
-(<epsg32306> : WGS 72 / UTM zone 6S)110.5 540 Q
-(<epsg32307> : WGS 72 / UTM zone 7S)110.5 552 Q
-(<epsg32308> : WGS 72 / UTM zone 8S)110.5 564 Q
-(<epsg32309> : WGS 72 / UTM zone 9S)110.5 576 Q
-(<epsg32310> : WGS 72 / UTM zone 10S)110.5 588 Q
-(<epsg32311> : WGS 72 / UTM zone 11S)110.5 600 Q
-(<epsg32312> : WGS 72 / UTM zone 12S)110.5 612 Q
-(<epsg32313> : WGS 72 / UTM zone 13S)110.5 624 Q
-(<epsg32314> : WGS 72 / UTM zone 14S)110.5 636 Q
-(<epsg32315> : WGS 72 / UTM zone 15S)110.5 648 Q
-(<epsg32316> : WGS 72 / UTM zone 16S)110.5 660 Q
-(<epsg32317> : WGS 72 / UTM zone 17S)110.5 672 Q
-(<epsg32318> : WGS 72 / UTM zone 18S)110.5 684 Q
-(<epsg32319> : WGS 72 / UTM zone 19S)110.5 696 Q
-(<epsg32320> : WGS 72 / UTM zone 20S)110.5 708 Q
-(<epsg32321> : WGS 72 / UTM zone 21S)110.5 720 Q(MB-System 5.0)72 768 Q
-(29 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E(81)185.545 E 0 Cg EP
-%%Page: 82 82
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<epsg32322> : WGS 72 / UTM zone 22S)110.5 84 Q
-(<epsg32323> : WGS 72 / UTM zone 23S)110.5 96 Q
-(<epsg32324> : WGS 72 / UTM zone 24S)110.5 108 Q
-(<epsg32325> : WGS 72 / UTM zone 25S)110.5 120 Q
-(<epsg32326> : WGS 72 / UTM zone 26S)110.5 132 Q
-(<epsg32327> : WGS 72 / UTM zone 27S)110.5 144 Q
-(<epsg32328> : WGS 72 / UTM zone 28S)110.5 156 Q
-(<epsg32329> : WGS 72 / UTM zone 29S)110.5 168 Q
-(<epsg32330> : WGS 72 / UTM zone 30S)110.5 180 Q
-(<epsg32331> : WGS 72 / UTM zone 31S)110.5 192 Q
-(<epsg32332> : WGS 72 / UTM zone 32S)110.5 204 Q
-(<epsg32333> : WGS 72 / UTM zone 33S)110.5 216 Q
-(<epsg32334> : WGS 72 / UTM zone 34S)110.5 228 Q
-(<epsg32335> : WGS 72 / UTM zone 35S)110.5 240 Q
-(<epsg32336> : WGS 72 / UTM zone 36S)110.5 252 Q
-(<epsg32337> : WGS 72 / UTM zone 37S)110.5 264 Q
-(<epsg32338> : WGS 72 / UTM zone 38S)110.5 276 Q
-(<epsg32339> : WGS 72 / UTM zone 39S)110.5 288 Q
-(<epsg32340> : WGS 72 / UTM zone 40S)110.5 300 Q
-(<epsg32341> : WGS 72 / UTM zone 41S)110.5 312 Q
-(<epsg32342> : WGS 72 / UTM zone 42S)110.5 324 Q
-(<epsg32343> : WGS 72 / UTM zone 43S)110.5 336 Q
-(<epsg32344> : WGS 72 / UTM zone 44S)110.5 348 Q
-(<epsg32345> : WGS 72 / UTM zone 45S)110.5 360 Q
-(<epsg32346> : WGS 72 / UTM zone 46S)110.5 372 Q
-(<epsg32347> : WGS 72 / UTM zone 47S)110.5 384 Q
-(<epsg32348> : WGS 72 / UTM zone 48S)110.5 396 Q
-(<epsg32349> : WGS 72 / UTM zone 49S)110.5 408 Q
-(<epsg32350> : WGS 72 / UTM zone 50S)110.5 420 Q
-(<epsg32351> : WGS 72 / UTM zone 51S)110.5 432 Q
-(<epsg32352> : WGS 72 / UTM zone 52S)110.5 444 Q
-(<epsg32353> : WGS 72 / UTM zone 53S)110.5 456 Q
-(<epsg32354> : WGS 72 / UTM zone 54S)110.5 468 Q
-(<epsg32355> : WGS 72 / UTM zone 55S)110.5 480 Q
-(<epsg32356> : WGS 72 / UTM zone 56S)110.5 492 Q
-(<epsg32357> : WGS 72 / UTM zone 57S)110.5 504 Q
-(<epsg32358> : WGS 72 / UTM zone 58S)110.5 516 Q
-(<epsg32359> : WGS 72 / UTM zone 59S)110.5 528 Q
-(<epsg32360> : WGS 72 / UTM zone 60S)110.5 540 Q
-(<epsg32401> : WGS 72BE / UTM zone 1N)110.5 552 Q
-(<epsg32402> : WGS 72BE / UTM zone 2N)110.5 564 Q
-(<epsg32403> : WGS 72BE / UTM zone 3N)110.5 576 Q
-(<epsg32404> : WGS 72BE / UTM zone 4N)110.5 588 Q
-(<epsg32405> : WGS 72BE / UTM zone 5N)110.5 600 Q
-(<epsg32406> : WGS 72BE / UTM zone 6N)110.5 612 Q
-(<epsg32407> : WGS 72BE / UTM zone 7N)110.5 624 Q
-(<epsg32408> : WGS 72BE / UTM zone 8N)110.5 636 Q
-(<epsg32409> : WGS 72BE / UTM zone 9N)110.5 648 Q
-(<epsg32410> : WGS 72BE / UTM zone 10N)110.5 660 Q
-(<epsg32411> : WGS 72BE / UTM zone 11N)110.5 672 Q
-(<epsg32412> : WGS 72BE / UTM zone 12N)110.5 684 Q
-(<epsg32413> : WGS 72BE / UTM zone 13N)110.5 696 Q
-(<epsg32414> : WGS 72BE / UTM zone 14N)110.5 708 Q
-(<epsg32415> : WGS 72BE / UTM zone 15N)110.5 720 Q(MB-System 5.0)72 768
-Q(29 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E(82)185.545 E 0 Cg EP
-%%Page: 83 83
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<epsg32416> : WGS 72BE / UTM zone 16N)110.5 84 Q
-(<epsg32417> : WGS 72BE / UTM zone 17N)110.5 96 Q
-(<epsg32418> : WGS 72BE / UTM zone 18N)110.5 108 Q
-(<epsg32419> : WGS 72BE / UTM zone 19N)110.5 120 Q
-(<epsg32420> : WGS 72BE / UTM zone 20N)110.5 132 Q
-(<epsg32421> : WGS 72BE / UTM zone 21N)110.5 144 Q
-(<epsg32422> : WGS 72BE / UTM zone 22N)110.5 156 Q
-(<epsg32423> : WGS 72BE / UTM zone 23N)110.5 168 Q
-(<epsg32424> : WGS 72BE / UTM zone 24N)110.5 180 Q
-(<epsg32425> : WGS 72BE / UTM zone 25N)110.5 192 Q
-(<epsg32426> : WGS 72BE / UTM zone 26N)110.5 204 Q
-(<epsg32427> : WGS 72BE / UTM zone 27N)110.5 216 Q
-(<epsg32428> : WGS 72BE / UTM zone 28N)110.5 228 Q
-(<epsg32429> : WGS 72BE / UTM zone 29N)110.5 240 Q
-(<epsg32430> : WGS 72BE / UTM zone 30N)110.5 252 Q
-(<epsg32431> : WGS 72BE / UTM zone 31N)110.5 264 Q
-(<epsg32432> : WGS 72BE / UTM zone 32N)110.5 276 Q
-(<epsg32433> : WGS 72BE / UTM zone 33N)110.5 288 Q
-(<epsg32434> : WGS 72BE / UTM zone 34N)110.5 300 Q
-(<epsg32435> : WGS 72BE / UTM zone 35N)110.5 312 Q
-(<epsg32436> : WGS 72BE / UTM zone 36N)110.5 324 Q
-(<epsg32437> : WGS 72BE / UTM zone 37N)110.5 336 Q
-(<epsg32438> : WGS 72BE / UTM zone 38N)110.5 348 Q
-(<epsg32439> : WGS 72BE / UTM zone 39N)110.5 360 Q
-(<epsg32440> : WGS 72BE / UTM zone 40N)110.5 372 Q
-(<epsg32441> : WGS 72BE / UTM zone 41N)110.5 384 Q
-(<epsg32442> : WGS 72BE / UTM zone 42N)110.5 396 Q
-(<epsg32443> : WGS 72BE / UTM zone 43N)110.5 408 Q
-(<epsg32444> : WGS 72BE / UTM zone 44N)110.5 420 Q
-(<epsg32445> : WGS 72BE / UTM zone 45N)110.5 432 Q
-(<epsg32446> : WGS 72BE / UTM zone 46N)110.5 444 Q
-(<epsg32447> : WGS 72BE / UTM zone 47N)110.5 456 Q
-(<epsg32448> : WGS 72BE / UTM zone 48N)110.5 468 Q
-(<epsg32449> : WGS 72BE / UTM zone 49N)110.5 480 Q
-(<epsg32450> : WGS 72BE / UTM zone 50N)110.5 492 Q
-(<epsg32451> : WGS 72BE / UTM zone 51N)110.5 504 Q
-(<epsg32452> : WGS 72BE / UTM zone 52N)110.5 516 Q
-(<epsg32453> : WGS 72BE / UTM zone 53N)110.5 528 Q
-(<epsg32454> : WGS 72BE / UTM zone 54N)110.5 540 Q
-(<epsg32455> : WGS 72BE / UTM zone 55N)110.5 552 Q
-(<epsg32456> : WGS 72BE / UTM zone 56N)110.5 564 Q
-(<epsg32457> : WGS 72BE / UTM zone 57N)110.5 576 Q
-(<epsg32458> : WGS 72BE / UTM zone 58N)110.5 588 Q
-(<epsg32459> : WGS 72BE / UTM zone 59N)110.5 600 Q
-(<epsg32460> : WGS 72BE / UTM zone 60N)110.5 612 Q
-(<epsg32501> : WGS 72BE / UTM zone 1S)110.5 624 Q
-(<epsg32502> : WGS 72BE / UTM zone 2S)110.5 636 Q
-(<epsg32503> : WGS 72BE / UTM zone 3S)110.5 648 Q
-(<epsg32504> : WGS 72BE / UTM zone 4S)110.5 660 Q
-(<epsg32505> : WGS 72BE / UTM zone 5S)110.5 672 Q
-(<epsg32506> : WGS 72BE / UTM zone 6S)110.5 684 Q
-(<epsg32507> : WGS 72BE / UTM zone 7S)110.5 696 Q
-(<epsg32508> : WGS 72BE / UTM zone 8S)110.5 708 Q
-(<epsg32509> : WGS 72BE / UTM zone 9S)110.5 720 Q(MB-System 5.0)72 768 Q
-(29 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E(83)185.545 E 0 Cg EP
-%%Page: 84 84
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<epsg32510> : WGS 72BE / UTM zone 10S)110.5 84 Q
-(<epsg32511> : WGS 72BE / UTM zone 11S)110.5 96 Q
-(<epsg32512> : WGS 72BE / UTM zone 12S)110.5 108 Q
-(<epsg32513> : WGS 72BE / UTM zone 13S)110.5 120 Q
-(<epsg32514> : WGS 72BE / UTM zone 14S)110.5 132 Q
-(<epsg32515> : WGS 72BE / UTM zone 15S)110.5 144 Q
-(<epsg32516> : WGS 72BE / UTM zone 16S)110.5 156 Q
-(<epsg32517> : WGS 72BE / UTM zone 17S)110.5 168 Q
-(<epsg32518> : WGS 72BE / UTM zone 18S)110.5 180 Q
-(<epsg32519> : WGS 72BE / UTM zone 19S)110.5 192 Q
-(<epsg32520> : WGS 72BE / UTM zone 20S)110.5 204 Q
-(<epsg32521> : WGS 72BE / UTM zone 21S)110.5 216 Q
-(<epsg32522> : WGS 72BE / UTM zone 22S)110.5 228 Q
-(<epsg32523> : WGS 72BE / UTM zone 23S)110.5 240 Q
-(<epsg32524> : WGS 72BE / UTM zone 24S)110.5 252 Q
-(<epsg32525> : WGS 72BE / UTM zone 25S)110.5 264 Q
-(<epsg32526> : WGS 72BE / UTM zone 26S)110.5 276 Q
-(<epsg32527> : WGS 72BE / UTM zone 27S)110.5 288 Q
-(<epsg32528> : WGS 72BE / UTM zone 28S)110.5 300 Q
-(<epsg32529> : WGS 72BE / UTM zone 29S)110.5 312 Q
-(<epsg32530> : WGS 72BE / UTM zone 30S)110.5 324 Q
-(<epsg32531> : WGS 72BE / UTM zone 31S)110.5 336 Q
-(<epsg32532> : WGS 72BE / UTM zone 32S)110.5 348 Q
-(<epsg32533> : WGS 72BE / UTM zone 33S)110.5 360 Q
-(<epsg32534> : WGS 72BE / UTM zone 34S)110.5 372 Q
-(<epsg32535> : WGS 72BE / UTM zone 35S)110.5 384 Q
-(<epsg32536> : WGS 72BE / UTM zone 36S)110.5 396 Q
-(<epsg32537> : WGS 72BE / UTM zone 37S)110.5 408 Q
-(<epsg32538> : WGS 72BE / UTM zone 38S)110.5 420 Q
-(<epsg32539> : WGS 72BE / UTM zone 39S)110.5 432 Q
-(<epsg32540> : WGS 72BE / UTM zone 40S)110.5 444 Q
-(<epsg32541> : WGS 72BE / UTM zone 41S)110.5 456 Q
-(<epsg32542> : WGS 72BE / UTM zone 42S)110.5 468 Q
-(<epsg32543> : WGS 72BE / UTM zone 43S)110.5 480 Q
-(<epsg32544> : WGS 72BE / UTM zone 44S)110.5 492 Q
-(<epsg32545> : WGS 72BE / UTM zone 45S)110.5 504 Q
-(<epsg32546> : WGS 72BE / UTM zone 46S)110.5 516 Q
-(<epsg32547> : WGS 72BE / UTM zone 47S)110.5 528 Q
-(<epsg32548> : WGS 72BE / UTM zone 48S)110.5 540 Q
-(<epsg32549> : WGS 72BE / UTM zone 49S)110.5 552 Q
-(<epsg32550> : WGS 72BE / UTM zone 50S)110.5 564 Q
-(<epsg32551> : WGS 72BE / UTM zone 51S)110.5 576 Q
-(<epsg32552> : WGS 72BE / UTM zone 52S)110.5 588 Q
-(<epsg32553> : WGS 72BE / UTM zone 53S)110.5 600 Q
-(<epsg32554> : WGS 72BE / UTM zone 54S)110.5 612 Q
-(<epsg32555> : WGS 72BE / UTM zone 55S)110.5 624 Q
-(<epsg32556> : WGS 72BE / UTM zone 56S)110.5 636 Q
-(<epsg32557> : WGS 72BE / UTM zone 57S)110.5 648 Q
-(<epsg32558> : WGS 72BE / UTM zone 58S)110.5 660 Q
-(<epsg32559> : WGS 72BE / UTM zone 59S)110.5 672 Q
-(<epsg32560> : WGS 72BE / UTM zone 60S)110.5 684 Q
-(<epsg32601> : WGS 84 / UTM zone 1N)110.5 696 Q
-(<epsg32602> : WGS 84 / UTM zone 2N)110.5 708 Q
-(<epsg32603> : WGS 84 / UTM zone 3N)110.5 720 Q(MB-System 5.0)72 768 Q
-(29 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E(84)185.545 E 0 Cg EP
-%%Page: 85 85
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<epsg32604> : WGS 84 / UTM zone 4N)110.5 84 Q
-(<epsg32605> : WGS 84 / UTM zone 5N)110.5 96 Q
-(<epsg32606> : WGS 84 / UTM zone 6N)110.5 108 Q
-(<epsg32607> : WGS 84 / UTM zone 7N)110.5 120 Q
-(<epsg32608> : WGS 84 / UTM zone 8N)110.5 132 Q
-(<epsg32609> : WGS 84 / UTM zone 9N)110.5 144 Q
-(<epsg32610> : WGS 84 / UTM zone 10N)110.5 156 Q
-(<epsg32611> : WGS 84 / UTM zone 11N)110.5 168 Q
-(<epsg32612> : WGS 84 / UTM zone 12N)110.5 180 Q
-(<epsg32613> : WGS 84 / UTM zone 13N)110.5 192 Q
-(<epsg32614> : WGS 84 / UTM zone 14N)110.5 204 Q
-(<epsg32615> : WGS 84 / UTM zone 15N)110.5 216 Q
-(<epsg32616> : WGS 84 / UTM zone 16N)110.5 228 Q
-(<epsg32617> : WGS 84 / UTM zone 17N)110.5 240 Q
-(<epsg32618> : WGS 84 / UTM zone 18N)110.5 252 Q
-(<epsg32619> : WGS 84 / UTM zone 19N)110.5 264 Q
-(<epsg32620> : WGS 84 / UTM zone 20N)110.5 276 Q
-(<epsg32621> : WGS 84 / UTM zone 21N)110.5 288 Q
-(<epsg32622> : WGS 84 / UTM zone 22N)110.5 300 Q
-(<epsg32623> : WGS 84 / UTM zone 23N)110.5 312 Q
-(<epsg32624> : WGS 84 / UTM zone 24N)110.5 324 Q
-(<epsg32625> : WGS 84 / UTM zone 25N)110.5 336 Q
-(<epsg32626> : WGS 84 / UTM zone 26N)110.5 348 Q
-(<epsg32627> : WGS 84 / UTM zone 27N)110.5 360 Q
-(<epsg32628> : WGS 84 / UTM zone 28N)110.5 372 Q
-(<epsg32629> : WGS 84 / UTM zone 29N)110.5 384 Q
-(<epsg32630> : WGS 84 / UTM zone 30N)110.5 396 Q
-(<epsg32631> : WGS 84 / UTM zone 31N)110.5 408 Q
-(<epsg32632> : WGS 84 / UTM zone 32N)110.5 420 Q
-(<epsg32633> : WGS 84 / UTM zone 33N)110.5 432 Q
-(<epsg32634> : WGS 84 / UTM zone 34N)110.5 444 Q
-(<epsg32635> : WGS 84 / UTM zone 35N)110.5 456 Q
-(<epsg32636> : WGS 84 / UTM zone 36N)110.5 468 Q
-(<epsg32637> : WGS 84 / UTM zone 37N)110.5 480 Q
-(<epsg32638> : WGS 84 / UTM zone 38N)110.5 492 Q
-(<epsg32639> : WGS 84 / UTM zone 39N)110.5 504 Q
-(<epsg32640> : WGS 84 / UTM zone 40N)110.5 516 Q
-(<epsg32641> : WGS 84 / UTM zone 41N)110.5 528 Q
-(<epsg32642> : WGS 84 / UTM zone 42N)110.5 540 Q
-(<epsg32643> : WGS 84 / UTM zone 43N)110.5 552 Q
-(<epsg32644> : WGS 84 / UTM zone 44N)110.5 564 Q
-(<epsg32645> : WGS 84 / UTM zone 45N)110.5 576 Q
-(<epsg32646> : WGS 84 / UTM zone 46N)110.5 588 Q
-(<epsg32647> : WGS 84 / UTM zone 47N)110.5 600 Q
-(<epsg32648> : WGS 84 / UTM zone 48N)110.5 612 Q
-(<epsg32649> : WGS 84 / UTM zone 49N)110.5 624 Q
-(<epsg32650> : WGS 84 / UTM zone 50N)110.5 636 Q
-(<epsg32651> : WGS 84 / UTM zone 51N)110.5 648 Q
-(<epsg32652> : WGS 84 / UTM zone 52N)110.5 660 Q
-(<epsg32653> : WGS 84 / UTM zone 53N)110.5 672 Q
-(<epsg32654> : WGS 84 / UTM zone 54N)110.5 684 Q
-(<epsg32655> : WGS 84 / UTM zone 55N)110.5 696 Q
-(<epsg32656> : WGS 84 / UTM zone 56N)110.5 708 Q
-(<epsg32657> : WGS 84 / UTM zone 57N)110.5 720 Q(MB-System 5.0)72 768 Q
-(29 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E(85)185.545 E 0 Cg EP
-%%Page: 86 86
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<epsg32658> : WGS 84 / UTM zone 58N)110.5 84 Q
-(<epsg32659> : WGS 84 / UTM zone 59N)110.5 96 Q
-(<epsg32660> : WGS 84 / UTM zone 60N)110.5 108 Q
-(<epsg32661> : WGS 84 / UPS North)110.5 120 Q
-(<epsg32662> : WGS 84 / Plate Carree)110.5 132 Q
-(<epsg32664> : WGS 84 / BLM 14N \(ftUS\))110.5 144 Q
-(<epsg32665> : WGS 84 / BLM 15N \(ftUS\))110.5 156 Q
-(<epsg32666> : WGS 84 / BLM 16N \(ftUS\))110.5 168 Q
-(<epsg32667> : WGS 84 / BLM 17N \(ftUS\))110.5 180 Q
-(<epsg32701> : WGS 84 / UTM zone 1S)110.5 192 Q
-(<epsg32702> : WGS 84 / UTM zone 2S)110.5 204 Q
-(<epsg32703> : WGS 84 / UTM zone 3S)110.5 216 Q
-(<epsg32704> : WGS 84 / UTM zone 4S)110.5 228 Q
-(<epsg32705> : WGS 84 / UTM zone 5S)110.5 240 Q
-(<epsg32706> : WGS 84 / UTM zone 6S)110.5 252 Q
-(<epsg32707> : WGS 84 / UTM zone 7S)110.5 264 Q
-(<epsg32708> : WGS 84 / UTM zone 8S)110.5 276 Q
-(<epsg32709> : WGS 84 / UTM zone 9S)110.5 288 Q
-(<epsg32710> : WGS 84 / UTM zone 10S)110.5 300 Q
-(<epsg32711> : WGS 84 / UTM zone 11S)110.5 312 Q
-(<epsg32712> : WGS 84 / UTM zone 12S)110.5 324 Q
-(<epsg32713> : WGS 84 / UTM zone 13S)110.5 336 Q
-(<epsg32714> : WGS 84 / UTM zone 14S)110.5 348 Q
-(<epsg32715> : WGS 84 / UTM zone 15S)110.5 360 Q
-(<epsg32716> : WGS 84 / UTM zone 16S)110.5 372 Q
-(<epsg32717> : WGS 84 / UTM zone 17S)110.5 384 Q
-(<epsg32718> : WGS 84 / UTM zone 18S)110.5 396 Q
-(<epsg32719> : WGS 84 / UTM zone 19S)110.5 408 Q
-(<epsg32720> : WGS 84 / UTM zone 20S)110.5 420 Q
-(<epsg32721> : WGS 84 / UTM zone 21S)110.5 432 Q
-(<epsg32722> : WGS 84 / UTM zone 22S)110.5 444 Q
-(<epsg32723> : WGS 84 / UTM zone 23S)110.5 456 Q
-(<epsg32724> : WGS 84 / UTM zone 24S)110.5 468 Q
-(<epsg32725> : WGS 84 / UTM zone 25S)110.5 480 Q
-(<epsg32726> : WGS 84 / UTM zone 26S)110.5 492 Q
-(<epsg32727> : WGS 84 / UTM zone 27S)110.5 504 Q
-(<epsg32728> : WGS 84 / UTM zone 28S)110.5 516 Q
-(<epsg32729> : WGS 84 / UTM zone 29S)110.5 528 Q
-(<epsg32730> : WGS 84 / UTM zone 30S)110.5 540 Q
-(<epsg32731> : WGS 84 / UTM zone 31S)110.5 552 Q
-(<epsg32732> : WGS 84 / UTM zone 32S)110.5 564 Q
-(<epsg32733> : WGS 84 / UTM zone 33S)110.5 576 Q
-(<epsg32734> : WGS 84 / UTM zone 34S)110.5 588 Q
-(<epsg32735> : WGS 84 / UTM zone 35S)110.5 600 Q
-(<epsg32736> : WGS 84 / UTM zone 36S)110.5 612 Q
-(<epsg32737> : WGS 84 / UTM zone 37S)110.5 624 Q
-(<epsg32738> : WGS 84 / UTM zone 38S)110.5 636 Q
-(<epsg32739> : WGS 84 / UTM zone 39S)110.5 648 Q
-(<epsg32740> : WGS 84 / UTM zone 40S)110.5 660 Q
-(<epsg32741> : WGS 84 / UTM zone 41S)110.5 672 Q
-(<epsg32742> : WGS 84 / UTM zone 42S)110.5 684 Q
-(<epsg32743> : WGS 84 / UTM zone 43S)110.5 696 Q
-(<epsg32744> : WGS 84 / UTM zone 44S)110.5 708 Q
-(<epsg32745> : WGS 84 / UTM zone 45S)110.5 720 Q(MB-System 5.0)72 768 Q
-(29 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E(86)185.545 E 0 Cg EP
-%%Page: 87 87
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<epsg32746> : WGS 84 / UTM zone 46S)110.5 84 Q
-(<epsg32747> : WGS 84 / UTM zone 47S)110.5 96 Q
-(<epsg32748> : WGS 84 / UTM zone 48S)110.5 108 Q
-(<epsg32749> : WGS 84 / UTM zone 49S)110.5 120 Q
-(<epsg32750> : WGS 84 / UTM zone 50S)110.5 132 Q
-(<epsg32751> : WGS 84 / UTM zone 51S)110.5 144 Q
-(<epsg32752> : WGS 84 / UTM zone 52S)110.5 156 Q
-(<epsg32753> : WGS 84 / UTM zone 53S)110.5 168 Q
-(<epsg32754> : WGS 84 / UTM zone 54S)110.5 180 Q
-(<epsg32755> : WGS 84 / UTM zone 55S)110.5 192 Q
-(<epsg32756> : WGS 84 / UTM zone 56S)110.5 204 Q
-(<epsg32757> : WGS 84 / UTM zone 57S)110.5 216 Q
-(<epsg32758> : WGS 84 / UTM zone 58S)110.5 228 Q
-(<epsg32759> : WGS 84 / UTM zone 59S)110.5 240 Q
-(<epsg32760> : WGS 84 / UTM zone 60S)110.5 252 Q
-(<epsg32761> : WGS 84 / UPS South)110.5 264 Q
-(<epsg32766> : WGS 84 / TM 36 SE)110.5 276 Q
-(\255--------------------------------------------------------)110.5 300
-Q(Additional EPSG-lik)110.5 312 Q 2.5(ep)-.1 G(rojection de\214nitions)
--2.5 E(\255--------------------------------------------------------)
-110.5 324 Q(OGC-de\214ned e)110.5 336 Q(xtended codes)-.15 E
-(\(41000--41999\) see http://www)5 E(.digitalearth.go)-.65 E
-(v/wmt/auto.html)-.15 E
-(\255--------------------------------------------------------)110.5 348
-Q(<epsg41001> : WGS84 / Simple Mercator)110.5 360 Q
-(\255--------------------------------------------------------)110.5 384
-Q(CubeW)110.5 396 Q(erx-de\214ned e)-.8 E(xtended codes)-.15 E
-(\(42100--42199\))5 E
-(\255--------------------------------------------------------)110.5 408
-Q(<epsg42101> : WGS 84 / LCC Canada)110.5 420 Q(<epsg42102> : N)110.5
-432 Q(AD83 / BC Albers \(this has been superceeded b)-.35 E(ut is k)-.2
-E(ept for compatibility\))-.1 E(<epsg42103> : WGS 84 / LCC USA)110.5 444
-Q(<epsg42103> : N)110.5 456 Q(AD83 / MTM zone 8 Qu\303\251bec)-.35 E
-(<epsg42105> : WGS84 / Merc NorthAm)110.5 468 Q
-(<epsg42106> : WGS84 / Lambert Azim Mozambique)110.5 480 Q
-(\255--------------------------------------------------------)110.5 504
-Q(CubeW)110.5 516 Q(erx-customer de\214nitions)-.8 E(\(42300--42399\))5
-E(\255--------------------------------------------------------)110.5 528
-Q(<epsg42301> : N)110.5 540 Q(AD27 / Polar Stereographic / CM=\25598)
--.35 E(<epsg42302>JapanOrtho.09 09)110.5 552 Q(<epsg42303> : N)110.5 564
-Q(AD83 / Albers NorthAm)-.35 E(<epsg42304> : N)110.5 576 Q
-(AD83 / NRCan LCC Canada)-.35 E(<epsg42305> : France_II)110.5 588 Q
-(<epsg42306> : N)110.5 600 Q(AD83/QC_LCC)-.35 E(<epsg42307> : N)110.5
-612 Q(AD83 / T)-.35 E -.15(ex)-.7 G(as Central \255 feet).15 E
-(<epsg42308> : N)110.5 624 Q(AD27 / California Albers)-.35 E
-(<epsg42309> : N)110.5 636 Q(AD 83 / LCC Canada A)-.35 E(VHRR-2)-1.35 E
-(<epsg42310> : WGS84+GRS80 / Mercator)110.5 648 Q(<epsg42311> : N)110.5
-660 Q(AD83 / LCC Statcan)-.35 E
-(\255--------------------------------------------------------)110.5 684
-Q(ESRI projection de\214nitions)110.5 696 Q
-(\255--------------------------------------------------------)110.5 708
-Q(<esri2000> : Anguilla 1957 / British W)110.5 720 Q(est Indies Grid)-.8
-E(MB-System 5.0)72 768 Q(29 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E
-(87)185.545 E 0 Cg EP
-%%Page: 88 88
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<esri2001> : Antigua 1943 / British W)110.5 84 Q
-(est Indies Grid)-.8 E(<esri2002> : Dominica 1945 / British W)110.5 96 Q
-(est Indies Grid)-.8 E(<esri2003> : Grenada 1953 / British W)110.5 108 Q
-(est Indies Grid)-.8 E(<esri2004> : Montserrat 58 / British W)110.5 120
-Q(est Indies Grid)-.8 E(<esri2005> : St Kitts 1955 / British W)110.5 132
-Q(est Indies Grid)-.8 E(<esri2006> : St Lucia 1955 / British W)110.5 144
-Q(est Indies Grid)-.8 E(<esri2007> : St V)110.5 156 Q
-(incent 45 / British W)-.6 E(est Indies Grid)-.8 E(<esri2008> : N)110.5
-168 Q(AD27\(CGQ77\) / SCoPQ zone 2)-.35 E(<esri2009> : N)110.5 180 Q
-(AD27\(CGQ77\) / SCoPQ zone 3)-.35 E(<esri2010> : N)110.5 192 Q
-(AD27\(CGQ77\) / SCoPQ zone 4)-.35 E(<esri2011> : N)110.5 204 Q
-(AD27\(CGQ77\) / SCoPQ zone 5)-.35 E(<esri2012> : N)110.5 216 Q
-(AD27\(CGQ77\) / SCoPQ zone 6)-.35 E(<esri2013> : N)110.5 228 Q
-(AD27\(CGQ77\) / SCoPQ zone 7)-.35 E(<esri2014> : N)110.5 240 Q
-(AD27\(CGQ77\) / SCoPQ zone 8)-.35 E(<esri2015> : N)110.5 252 Q
-(AD27\(CGQ77\) / SCoPQ zone 9)-.35 E(<esri2016> : N)110.5 264 Q
-(AD27\(CGQ77\) / SCoPQ zone 10)-.35 E(<esri2017> : N)110.5 276 Q
-(AD27\(76\) / MTM zone 8)-.35 E(<esri2018> : N)110.5 288 Q
-(AD27\(76\) / MTM zone 9)-.35 E(<esri2019> : N)110.5 300 Q
-(AD27\(76\) / MTM zone 10)-.35 E(<esri2020> : N)110.5 312 Q
-(AD27\(76\) / MTM zone 11)-.35 E(<esri2021> : N)110.5 324 Q
-(AD27\(76\) / MTM zone 12)-.35 E(<esri2022> : N)110.5 336 Q
-(AD27\(76\) / MTM zone 13)-.35 E(<esri2023> : N)110.5 348 Q
-(AD27\(76\) / MTM zone 14)-.35 E(<esri2024> : N)110.5 360 Q
-(AD27\(76\) / MTM zone 15)-.35 E(<esri2025> : N)110.5 372 Q
-(AD27\(76\) / MTM zone 16)-.35 E(<esri2026> : N)110.5 384 Q
-(AD27\(76\) / MTM zone 17)-.35 E(<esri2027> : N)110.5 396 Q
-(AD27\(76\) / UTM zone 15N)-.35 E(<esri2028> : N)110.5 408 Q
-(AD27\(76\) / UTM zone 16N)-.35 E(<esri2029> : N)110.5 420 Q
-(AD27\(76\) / UTM zone 17N)-.35 E(<esri2030> : N)110.5 432 Q
-(AD27\(76\) / UTM zone 18N)-.35 E(<esri2031> : N)110.5 444 Q
-(AD27\(CGQ77\) / UTM zone 17N)-.35 E(<esri2032> : N)110.5 456 Q
-(AD27\(CGQ77\) / UTM zone 18N)-.35 E(<esri2033> : N)110.5 468 Q
-(AD27\(CGQ77\) / UTM zone 19N)-.35 E(<esri2034> : N)110.5 480 Q
-(AD27\(CGQ77\) / UTM zone 20N)-.35 E(<esri2035> : N)110.5 492 Q
-(AD27\(CGQ77\) / UTM zone 21N)-.35 E(<esri2036> : N)110.5 504 Q
-(AD83\(CSRS98\) / Ne)-.35 E 2.5(wB)-.25 G(runswick Stereo)-2.5 E
-(<esri2037> : N)110.5 516 Q(AD83\(CSRS98\) / UTM zone 19N)-.35 E
-(<esri2038> : N)110.5 528 Q(AD83\(CSRS98\) / UTM zone 20N)-.35 E
-(<esri2039> : Israel / Israeli TM Grid)110.5 540 Q
-(<esri2040> : Locodjo 1965 / UTM zone 30N)110.5 552 Q
-(<esri2041> : Abidjan 1987 / UTM zone 30N)110.5 564 Q
-(<esri2042> : Locodjo 1965 / UTM zone 29N)110.5 576 Q
-(<esri2043> : Abidjan 1987 / UTM zone 29N)110.5 588 Q
-(<esri2044> : Hanoi 1972 / Gauss-Kruger zone 18)110.5 600 Q
-(<esri2045> : Hanoi 1972 / Gauss-Kruger zone 19)110.5 612 Q
-(<esri2056> : CH1903+ / L)110.5 624 Q(V95)-1 E
-(<esri2057> : Rassadiran / Nakhl e T)110.5 636 Q(aqi)-.8 E
-(<esri2058> : ED50\(ED77\) / UTM zone 38N)110.5 648 Q
-(<esri2059> : ED50\(ED77\) / UTM zone 39N)110.5 660 Q
-(<esri2060> : ED50\(ED77\) / UTM zone 40N)110.5 672 Q
-(<esri2061> : ED50\(ED77\) / UTM zone 41N)110.5 684 Q
-(<esri2062> : Madrid 1870 \(Madrid\) / Spain)110.5 696 Q
-(<esri2063> : Dabola 1981 / UTM zone 28N)110.5 708 Q
-(<esri2064> : Dabola 1981 / UTM zone 29N)110.5 720 Q(MB-System 5.0)72
-768 Q(29 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E(88)185.545 E 0 Cg
-EP
-%%Page: 89 89
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<esri2065> : S-JTSK \(Ferro\) / Kro)110.5 84 Q
--.25(va)-.15 G(k).25 E(<esri2066> : Mount Dillon / T)110.5 96 Q
-(obago Grid)-.8 E(<esri2067> : Naparima 1955 / UTM zone 20N)110.5 108 Q
-(<esri2068> : ELD79 / Libya zone 5)110.5 120 Q
-(<esri2069> : ELD79 / Libya zone 6)110.5 132 Q
-(<esri2070> : ELD79 / Libya zone 7)110.5 144 Q
-(<esri2071> : ELD79 / Libya zone 8)110.5 156 Q
-(<esri2072> : ELD79 / Libya zone 9)110.5 168 Q
-(<esri2073> : ELD79 / Libya zone 10)110.5 180 Q
-(<esri2074> : ELD79 / Libya zone 11)110.5 192 Q
-(<esri2075> : ELD79 / Libya zone 12)110.5 204 Q
-(<esri2076> : ELD79 / Libya zone 13)110.5 216 Q
-(<esri2077> : ELD79 / UTM zone 32N)110.5 228 Q
-(<esri2078> : ELD79 / UTM zone 33N)110.5 240 Q
-(<esri2079> : ELD79 / UTM zone 34N)110.5 252 Q
-(<esri2080> : ELD79 / UTM zone 35N)110.5 264 Q
-(<esri2081> : Chos Malal 1914 / Ar)110.5 276 Q(gentina zone 2)-.18 E
-(<esri2082> : P)110.5 288 Q(ampa del Castillo / Ar)-.15 E
-(gentina zone 2)-.18 E(<esri2083> : Hito XVIII 1963 / Ar)110.5 300 Q
-(gentina zone 2)-.18 E(<esri2084> : Hito XVIII 1963 / UTM zone 19S)110.5
-312 Q(<esri2085> : N)110.5 324 Q(AD27 / Cuba Norte)-.35 E
-(<esri2086> : N)110.5 336 Q(AD27 / Cuba Sur)-.35 E
-(<esri2087> : ELD79 / TM 12 NE)110.5 348 Q
-(<esri2088> : Carthage / TM 11 NE)110.5 360 Q(<esri2089> : Y)110.5 372 Q
-(emen NGN96 / UTM zone 38N)-1 E(<esri2090> : Y)110.5 384 Q
-(emen NGN96 / UTM zone 39N)-1 E(<esri2091> : South Y)110.5 396 Q
-(emen / Gauss Kruger zone 8)-1 E(<esri2092> : South Y)110.5 408 Q
-(emen / Gauss Kruger zone 9)-1 E(<esri2093> : Hanoi 1972 / GK 106 NE)
-110.5 420 Q(<esri2094> : WGS 72BE / TM 106 NE)110.5 432 Q
-(<esri2095> : Bissau / UTM zone 28N)110.5 444 Q(<esri2096> : K)110.5 456
-Q(orean 1985 / K)-.35 E(orea East Belt)-.35 E(<esri2097> : K)110.5 468 Q
-(orean 1985 / K)-.35 E(orea Central Belt)-.35 E(<esri2098> : K)110.5 480
-Q(orean 1985 / K)-.35 E(orea W)-.35 E(est Belt)-.8 E
-(<esri2099> : Qatar 1948 / Qatar Grid)110.5 492 Q
-(<esri2100> : GGRS87 / Greek Grid)110.5 504 Q(<esri2101> : Lak)110.5 516
-Q 2.5(e/M)-.1 G(aracaibo Grid M1)-2.5 E(<esri2102> : Lak)110.5 528 Q 2.5
-(e/M)-.1 G(aracaibo Grid)-2.5 E(<esri2103> : Lak)110.5 540 Q 2.5(e/M)-.1
-G(aracaibo Grid M3)-2.5 E(<esri2104> : Lak)110.5 552 Q 2.5(e/M)-.1 G
-(aracaibo La Rosa Grid)-2.5 E
-(<esri2105> : NZGD2000 / Mount Eden Circuit 2000)110.5 564 Q
-(<esri2106> : NZGD2000 / Bay of Plenty Circuit 2000)110.5 576 Q
-(<esri2107> : NZGD2000 / Po)110.5 588 Q -.15(ve)-.15 G
-(rty Bay Circuit 2000).15 E(<esri2108> : NZGD2000 / Ha)110.5 600 Q(wk)
--.15 E(es Bay Circuit 2000)-.1 E(<esri2109> : NZGD2000 / T)110.5 612 Q
-(aranaki Circuit 2000)-.8 E(<esri2110> : NZGD2000 / T)110.5 624 Q
-(uhirangi Circuit 2000)-.45 E(<esri2111> : NZGD2000 / W)110.5 636 Q(ang)
--.8 E(anui Circuit 2000)-.05 E(<esri2112> : NZGD2000 / W)110.5 648 Q
-(airarapa Circuit 2000)-.8 E(<esri2113> : NZGD2000 / W)110.5 660 Q
-(ellington Circuit 2000)-.8 E(<esri2114> : NZGD2000 / Collingw)110.5 672
-Q(ood Circuit 2000)-.1 E(<esri2115> : NZGD2000 / Nelson Circuit 2000)
-110.5 684 Q(<esri2116> : NZGD2000 / Karamea Circuit 2000)110.5 696 Q
-(<esri2117> : NZGD2000 / Buller Circuit 2000)110.5 708 Q
-(<esri2118> : NZGD2000 / Gre)110.5 720 Q 2.5(yC)-.15 G(ircuit 2000)-2.5
-E(MB-System 5.0)72 768 Q(29 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E
-(89)185.545 E 0 Cg EP
-%%Page: 90 90
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<esri2119> : NZGD2000 / Amuri Circuit 2000)110.5
-84 Q(<esri2120> : NZGD2000 / Marlborough Circuit 2000)110.5 96 Q
-(<esri2121> : NZGD2000 / Hokitika Circuit 2000)110.5 108 Q
-(<esri2122> : NZGD2000 / Okarito Circuit 2000)110.5 120 Q
-(<esri2123> : NZGD2000 / Jacksons Bay Circuit 2000)110.5 132 Q
-(<esri2124> : NZGD2000 / Mount Pleasant Circuit 2000)110.5 144 Q
-(<esri2125> : NZGD2000 / Ga)110.5 156 Q(wler Circuit 2000)-.15 E
-(<esri2126> : NZGD2000 / T)110.5 168 Q(imaru Circuit 2000)-.35 E
-(<esri2127> : NZGD2000 / Lindis Peak Circuit 2000)110.5 180 Q
-(<esri2128> : NZGD2000 / Mount Nicholas Circuit 2000)110.5 192 Q
-(<esri2129> : NZGD2000 / Mount Y)110.5 204 Q(ork Circuit 2000)-1.1 E
-(<esri2130> : NZGD2000 / Observ)110.5 216 Q(ation Point Circuit 2000)
--.25 E(<esri2131> : NZGD2000 / North T)110.5 228 Q(aieri Circuit 2000)
--.8 E(<esri2132> : NZGD2000 / Bluf)110.5 240 Q 2.5(fC)-.25 G
-(ircuit 2000)-2.5 E(<esri2133> : NZGD2000 / UTM zone 58S)110.5 252 Q
-(<esri2134> : NZGD2000 / UTM zone 59S)110.5 264 Q
-(<esri2135> : NZGD2000 / UTM zone 60S)110.5 276 Q
-(<esri2136> : Accra / Ghana National Grid)110.5 288 Q
-(<esri2137> : Accra / TM 1 NW)110.5 300 Q(<esri2138> : N)110.5 312 Q
-(AD27\(CGQ77\) / Quebec Lambert)-.35 E(<esri2139> : N)110.5 324 Q
-(AD83\(CSRS98\) / SCoPQ zone 2)-.35 E(<esri2140> : N)110.5 336 Q
-(AD83\(CSRS98\) / MTM zone 3)-.35 E(<esri2141> : N)110.5 348 Q
-(AD83\(CSRS98\) / MTM zone 4)-.35 E(<esri2142> : N)110.5 360 Q
-(AD83\(CSRS98\) / MTM zone 5)-.35 E(<esri2143> : N)110.5 372 Q
-(AD83\(CSRS98\) / MTM zone 6)-.35 E(<esri2144> : N)110.5 384 Q
-(AD83\(CSRS98\) / MTM zone 7)-.35 E(<esri2145> : N)110.5 396 Q
-(AD83\(CSRS98\) / MTM zone 8)-.35 E(<esri2146> : N)110.5 408 Q
-(AD83\(CSRS98\) / MTM zone 9)-.35 E(<esri2147> : N)110.5 420 Q
-(AD83\(CSRS98\) / MTM zone 10)-.35 E(<esri2148> : N)110.5 432 Q
-(AD83\(CSRS98\) / UTM zone 21N)-.35 E(<esri2149> : N)110.5 444 Q
-(AD83\(CSRS98\) / UTM zone 18N)-.35 E(<esri2150> : N)110.5 456 Q
-(AD83\(CSRS98\) / UTM zone 17N)-.35 E(<esri2151> : N)110.5 468 Q
-(AD83\(CSRS98\) / UTM zone 13N)-.35 E(<esri2152> : N)110.5 480 Q
-(AD83\(CSRS98\) / UTM zone 12N)-.35 E(<esri2153> : N)110.5 492 Q
-(AD83\(CSRS98\) / UTM zone 11N)-.35 E(<esri2154> : RGF93 / Lambert-93)
-110.5 504 Q(<esri2155> : American Samoa 1962 / American Samoa Lambert)
-110.5 516 Q(<esri2156> : N)110.5 528 Q(AD83\(HARN\) / UTM zone 59S)-.35
-E(<esri2157> : IRENET95 / Irish T)110.5 540 Q(ransv)-.35 E
-(erse Mercator)-.15 E(<esri2158> : IRENET95 / UTM zone 29N)110.5 552 Q
-(<esri2159> : Sierra Leone 1924 / Ne)110.5 564 Q 2.5(wC)-.25 G(olon)-2.5
-E 2.5(yG)-.15 G(rid)-2.5 E(<esri2160> : Sierra Leone 1924 / Ne)110.5 576
-Q 2.5(wW)-.25 G(ar Of)-3.3 E(\214ce Grid)-.25 E
-(<esri2161> : Sierra Leone 1968 / UTM zone 28N)110.5 588 Q
-(<esri2162> : Sierra Leone 1968 / UTM zone 29N)110.5 600 Q
-(<esri2163> : US National Atlas Equal Area)110.5 612 Q
-(<esri2164> : Locodjo 1965 / TM 5 NW)110.5 624 Q
-(<esri2165> : Abidjan 1987 / TM 5 NW)110.5 636 Q(<esri2166> : Pulk)110.5
-648 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942\(83\) / Gauss Kruger zone 3)-2.5 E
-(<esri2167> : Pulk)110.5 660 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942\(83\) / Gauss Kruger zone 4)-2.5 E(<esri2168> : Pulk)110.5 672 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(942\(83\) / Gauss Kruger zone 5)-2.5 E
-(<esri2169> : Lux)110.5 684 Q(embour)-.15 E 2.5(g1)-.18 G(930 / Gauss)
--2.5 E(<esri2170> : MGI / Slo)110.5 696 Q -.15(ve)-.15 G(nia Grid).15 E
-(<esri2171> : Pulk)110.5 708 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942\(58\) / Poland zone I)-2.5 E(<esri2172> : Pulk)110.5 720 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942\(58\) / Poland zone II)-2.5 E(MB-System 5.0)72
-768 Q(29 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E(90)185.545 E 0 Cg
-EP
-%%Page: 91 91
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<esri2173> : Pulk)110.5 84 Q -.15(ov)-.1 G 2.5
-(o1)-.05 G(942\(58\) / Poland zone III)-2.5 E(<esri2174> : Pulk)110.5 96
-Q -.15(ov)-.1 G 2.5(o1)-.05 G(942\(58\) / Poland zone IV)-2.5 E
-(<esri2175> : Pulk)110.5 108 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942\(58\) / Poland zone V)-2.5 E
-(<esri2176> : ETRS89 / Poland CS2000 zone 5)110.5 120 Q
-(<esri2177> : ETRS89 / Poland CS2000 zone 6)110.5 132 Q
-(<esri2178> : ETRS89 / Poland CS2000 zone 7)110.5 144 Q
-(<esri2179> : ETRS89 / Poland CS2000 zone 8)110.5 156 Q
-(<esri2180> : ETRS89 / Poland CS92)110.5 168 Q
-(<esri2188> : Azores Occidental 1939 / UTM zone 25N)110.5 180 Q
-(<esri2189> : Azores Central 1948 / UTM zone 26N)110.5 192 Q
-(<esri2190> : Azores Oriental 1940 / UTM zone 26N)110.5 204 Q
-(<esri2191> : Madeira 1936 / UTM zone 28N)110.5 216 Q
-(<esri2192> : ED50 / France EuroLambert)110.5 228 Q
-(<esri2193> : NZGD2000 / Ne)110.5 240 Q 2.5(wZ)-.25 G(ealand T)-2.5 E
-(ransv)-.35 E(erse Mercator)-.15 E
-(<esri2194> : American Samoa 1962 / American Samoa Lambert)110.5 252 Q
-(<esri2195> : N)110.5 264 Q(AD83\(HARN\) / UTM zone 2S)-.35 E
-(<esri2196> : ETRS89 / Kp2000 Jutland)110.5 276 Q
-(<esri2197> : ETRS89 / Kp2000 Zealand)110.5 288 Q
-(<esri2198> : ETRS89 / Kp2000 Bornholm)110.5 300 Q
-(<esri2199> : Albanian 1987 / Gauss Kruger zone 4)110.5 312 Q
-(<esri2200> : A)110.5 324 Q(TS77 / Ne)-1.11 E 2.5(wB)-.25 G
-(runswick Stereographic \(A)-2.5 E(TS77\))-1.11 E
-(<esri2201> : REGVEN / UTM zone 18N)110.5 336 Q
-(<esri2202> : REGVEN / UTM zone 19N)110.5 348 Q
-(<esri2203> : REGVEN / UTM zone 20N)110.5 360 Q(<esri2204> : N)110.5 372
-Q(AD27 / T)-.35 E(ennessee)-.7 E(<esri2205> : N)110.5 384 Q(AD83 / K)
--.35 E(entuck)-.25 E 2.5(yN)-.15 G(orth)-2.5 E(<esri2206> : ED50 / 3-de)
-110.5 396 Q(gree Gauss-Kruger zone 9)-.15 E(<esri2207> : ED50 / 3-de)
-110.5 408 Q(gree Gauss-Kruger zone 10)-.15 E(<esri2208> : ED50 / 3-de)
-110.5 420 Q(gree Gauss-Kruger zone 11)-.15 E(<esri2209> : ED50 / 3-de)
-110.5 432 Q(gree Gauss-Kruger zone 12)-.15 E(<esri2210> : ED50 / 3-de)
-110.5 444 Q(gree Gauss-Kruger zone 13)-.15 E(<esri2211> : ED50 / 3-de)
-110.5 456 Q(gree Gauss-Kruger zone 14)-.15 E(<esri2212> : ED50 / 3-de)
-110.5 468 Q(gree Gauss-Kruger zone 15)-.15 E
-(<esri2213> : ETRS89 / TM 30 NE)110.5 480 Q
-(<esri2214> : Douala 1948 / A)110.5 492 Q(OF west)-.55 E
-(<esri2215> : Manoca 1962 / UTM zone 32N)110.5 504 Q
-(<esri2216> : Qornoq 1927 / UTM zone 22N)110.5 516 Q
-(<esri2217> : Qornoq 1927 / UTM zone 23N)110.5 528 Q(<esri2219> : A)
-110.5 540 Q(TS77 / UTM zone 19N)-1.11 E(<esri2220> : A)110.5 552 Q
-(TS77 / UTM zone 20N)-1.11 E(<esri2222> : N)110.5 564 Q
-(AD83 / Arizona East \(ft\))-.35 E(<esri2223> : N)110.5 576 Q
-(AD83 / Arizona Central \(ft\))-.35 E(<esri2224> : N)110.5 588 Q
-(AD83 / Arizona W)-.35 E(est \(ft\))-.8 E(<esri2225> : N)110.5 600 Q
-(AD83 / California zone 1 \(ftUS\))-.35 E(<esri2226> : N)110.5 612 Q
-(AD83 / California zone 2 \(ftUS\))-.35 E(<esri2227> : N)110.5 624 Q
-(AD83 / California zone 3 \(ftUS\))-.35 E(<esri2228> : N)110.5 636 Q
-(AD83 / California zone 4 \(ftUS\))-.35 E(<esri2229> : N)110.5 648 Q
-(AD83 / California zone 5 \(ftUS\))-.35 E(<esri2230> : N)110.5 660 Q
-(AD83 / California zone 6 \(ftUS\))-.35 E(<esri2231> : N)110.5 672 Q
-(AD83 / Colorado North \(ftUS\))-.35 E(<esri2232> : N)110.5 684 Q
-(AD83 / Colorado Central \(ftUS\))-.35 E(<esri2233> : N)110.5 696 Q
-(AD83 / Colorado South \(ftUS\))-.35 E(<esri2234> : N)110.5 708 Q
-(AD83 / Connecticut \(ftUS\))-.35 E(<esri2235> : N)110.5 720 Q
-(AD83 / Dela)-.35 E -.1(wa)-.15 G(re \(ftUS\)).1 E(MB-System 5.0)72 768
-Q(29 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E(91)185.545 E 0 Cg EP
-%%Page: 92 92
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<esri2236> : N)110.5 84 Q
-(AD83 / Florida East \(ftUS\))-.35 E(<esri2237> : N)110.5 96 Q
-(AD83 / Florida W)-.35 E(est \(ftUS\))-.8 E(<esri2238> : N)110.5 108 Q
-(AD83 / Florida North \(ftUS\))-.35 E(<esri2239> : N)110.5 120 Q
-(AD83 / Geor)-.35 E(gia East \(ftUS\))-.18 E(<esri2240> : N)110.5 132 Q
-(AD83 / Geor)-.35 E(gia W)-.18 E(est \(ftUS\))-.8 E(<esri2241> : N)110.5
-144 Q(AD83 / Idaho East \(ftUS\))-.35 E(<esri2242> : N)110.5 156 Q
-(AD83 / Idaho Central \(ftUS\))-.35 E(<esri2243> : N)110.5 168 Q
-(AD83 / Idaho W)-.35 E(est \(ftUS\))-.8 E(<esri2244> : N)110.5 180 Q
-(AD83 / Indiana East \(ftUS\))-.35 E(<esri2245> : N)110.5 192 Q
-(AD83 / Indiana W)-.35 E(est \(ftUS\))-.8 E(<esri2246> : N)110.5 204 Q
-(AD83 / K)-.35 E(entuck)-.25 E 2.5(yN)-.15 G(orth \(ftUS\))-2.5 E
-(<esri2247> : N)110.5 216 Q(AD83 / K)-.35 E(entuck)-.25 E 2.5(yS)-.15 G
-(outh \(ftUS\))-2.5 E(<esri2248> : N)110.5 228 Q
-(AD83 / Maryland \(ftUS\))-.35 E(<esri2249> : N)110.5 240 Q
-(AD83 / Massachusetts Mainland \(ftUS\))-.35 E(<esri2250> : N)110.5 252
-Q(AD83 / Massachusetts Island \(ftUS\))-.35 E(<esri2251> : N)110.5 264 Q
-(AD83 / Michig)-.35 E(an North \(ft\))-.05 E(<esri2252> : N)110.5 276 Q
-(AD83 / Michig)-.35 E(an Central \(ft\))-.05 E(<esri2253> : N)110.5 288
-Q(AD83 / Michig)-.35 E(an South \(ft\))-.05 E(<esri2254> : N)110.5 300 Q
-(AD83 / Mississippi East \(ftUS\))-.35 E(<esri2255> : N)110.5 312 Q
-(AD83 / Mississippi W)-.35 E(est \(ftUS\))-.8 E(<esri2256> : N)110.5 324
-Q(AD83 / Montana \(ft\))-.35 E(<esri2257> : N)110.5 336 Q(AD83 / Ne)-.35
-E 2.5(wM)-.25 G -.15(ex)-2.5 G(ico East \(ftUS\)).15 E(<esri2258> : N)
-110.5 348 Q(AD83 / Ne)-.35 E 2.5(wM)-.25 G -.15(ex)-2.5 G
-(ico Central \(ftUS\)).15 E(<esri2259> : N)110.5 360 Q(AD83 / Ne)-.35 E
-2.5(wM)-.25 G -.15(ex)-2.5 G(ico W).15 E(est \(ftUS\))-.8 E
-(<esri2260> : N)110.5 372 Q(AD83 / Ne)-.35 E 2.5(wY)-.25 G
-(ork East \(ftUS\))-3.6 E(<esri2261> : N)110.5 384 Q(AD83 / Ne)-.35 E
-2.5(wY)-.25 G(ork Central \(ftUS\))-3.6 E(<esri2262> : N)110.5 396 Q
-(AD83 / Ne)-.35 E 2.5(wY)-.25 G(ork W)-3.6 E(est \(ftUS\))-.8 E
-(<esri2263> : N)110.5 408 Q(AD83 / Ne)-.35 E 2.5(wY)-.25 G
-(ork Long Island \(ftUS\))-3.6 E(<esri2264> : N)110.5 420 Q
-(AD83 / North Carolina \(ftUS\))-.35 E(<esri2265> : N)110.5 432 Q
-(AD83 / North Dak)-.35 E(ota North \(ft\))-.1 E(<esri2266> : N)110.5 444
-Q(AD83 / North Dak)-.35 E(ota South \(ft\))-.1 E(<esri2267> : N)110.5
-456 Q(AD83 / Oklahoma North \(ftUS\))-.35 E(<esri2268> : N)110.5 468 Q
-(AD83 / Oklahoma South \(ftUS\))-.35 E(<esri2269> : N)110.5 480 Q
-(AD83 / Ore)-.35 E(gon North \(ft\))-.15 E(<esri2270> : N)110.5 492 Q
-(AD83 / Ore)-.35 E(gon South \(ft\))-.15 E(<esri2271> : N)110.5 504 Q
-(AD83 / Pennsylv)-.35 E(ania North \(ftUS\))-.25 E(<esri2272> : N)110.5
-516 Q(AD83 / Pennsylv)-.35 E(ania South \(ftUS\))-.25 E(<esri2273> : N)
-110.5 528 Q(AD83 / South Carolina \(ft\))-.35 E(<esri2274> : N)110.5 540
-Q(AD83 / T)-.35 E(ennessee \(ftUS\))-.7 E(<esri2275> : N)110.5 552 Q
-(AD83 / T)-.35 E -.15(ex)-.7 G(as North \(ftUS\)).15 E(<esri2276> : N)
-110.5 564 Q(AD83 / T)-.35 E -.15(ex)-.7 G(as North Central \(ftUS\)).15
-E(<esri2277> : N)110.5 576 Q(AD83 / T)-.35 E -.15(ex)-.7 G
-(as Central \(ftUS\)).15 E(<esri2278> : N)110.5 588 Q(AD83 / T)-.35 E
--.15(ex)-.7 G(as South Central \(ftUS\)).15 E(<esri2279> : N)110.5 600 Q
-(AD83 / T)-.35 E -.15(ex)-.7 G(as South \(ftUS\)).15 E(<esri2280> : N)
-110.5 612 Q(AD83 / Utah North \(ft\))-.35 E(<esri2281> : N)110.5 624 Q
-(AD83 / Utah Central \(ft\))-.35 E(<esri2282> : N)110.5 636 Q
-(AD83 / Utah South \(ft\))-.35 E(<esri2283> : N)110.5 648 Q(AD83 / V)
--.35 E(ir)-.6 E(ginia North \(ftUS\))-.18 E(<esri2284> : N)110.5 660 Q
-(AD83 / V)-.35 E(ir)-.6 E(ginia South \(ftUS\))-.18 E(<esri2285> : N)
-110.5 672 Q(AD83 / W)-.35 E(ashington North \(ftUS\))-.8 E
-(<esri2286> : N)110.5 684 Q(AD83 / W)-.35 E(ashington South \(ftUS\))-.8
-E(<esri2287> : N)110.5 696 Q(AD83 / W)-.35 E(isconsin North \(ftUS\))-.4
-E(<esri2288> : N)110.5 708 Q(AD83 / W)-.35 E(isconsin Central \(ftUS\))
--.4 E(<esri2289> : N)110.5 720 Q(AD83 / W)-.35 E
-(isconsin South \(ftUS\))-.4 E(MB-System 5.0)72 768 Q(29 No)132.205 E
--.15(ve)-.15 G(mber 2014).15 E(92)185.545 E 0 Cg EP
-%%Page: 93 93
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<esri2290> : A)110.5 84 Q(TS77 / Prince Edw)-1.11
-E(ard Isl. Stereographic \(A)-.1 E(TS77\))-1.11 E(<esri2291> : N)110.5
-96 Q(AD83\(CSRS98\) / Prince Edw)-.35 E(ard Isl. Stereographic \(N)-.1 E
-(AD83\))-.35 E(<esri2292> : N)110.5 108 Q(AD83\(CSRS98\) / Prince Edw)
--.35 E(ard Isl. Stereographic \(N)-.1 E(AD83\))-.35 E(<esri2294> : A)
-110.5 120 Q(TS77 / MTM No)-1.11 E .5 -.25(va S)-.15 H(cotia zone 4).25 E
-(<esri2295> : A)110.5 132 Q(TS77 / MTM No)-1.11 E .5 -.25(va S)-.15 H
-(cotia zone 5).25 E(<esri2308> : Bata)110.5 144 Q(via / TM 109 SE)-.2 E
-(<esri2309> : WGS 84 / TM 116 SE)110.5 156 Q
-(<esri2310> : WGS 84 / TM 132 SE)110.5 168 Q
-(<esri2311> : WGS 84 / TM 6 NE)110.5 180 Q
-(<esri2312> : Garoua / UTM zone 33N)110.5 192 Q(<esri2313> : K)110.5 204
-Q(ousseri / UTM zone 33N)-.35 E(<esri2314> : T)110.5 216 Q
-(rinidad 1903 / T)-.35 E(rinidad Grid \(ftCla\))-.35 E
-(<esri2315> : Campo Inchauspe / UTM zone 19S)110.5 228 Q
-(<esri2316> : Campo Inchauspe / UTM zone 20S)110.5 240 Q
-(<esri2317> : PSAD56 / ICN Re)110.5 252 Q(gional)-.15 E
-(<esri2318> : Ain el Abd / Aramco Lambert)110.5 264 Q
-(<esri2319> : ED50 / TM27)110.5 276 Q(<esri2320> : ED50 / TM30)110.5 288
-Q(<esri2321> : ED50 / TM33)110.5 300 Q(<esri2322> : ED50 / TM36)110.5
-312 Q(<esri2323> : ED50 / TM39)110.5 324 Q(<esri2324> : ED50 / TM42)
-110.5 336 Q(<esri2325> : ED50 / TM45)110.5 348 Q(<esri2326> : Hong K)
-110.5 360 Q(ong 1980 Grid System)-.35 E
-(<esri2327> : Xian 1980 / Gauss-Kruger zone 13)110.5 372 Q
-(<esri2328> : Xian 1980 / Gauss-Kruger zone 14)110.5 384 Q
-(<esri2329> : Xian 1980 / Gauss-Kruger zone 15)110.5 396 Q
-(<esri2330> : Xian 1980 / Gauss-Kruger zone 16)110.5 408 Q
-(<esri2331> : Xian 1980 / Gauss-Kruger zone 17)110.5 420 Q
-(<esri2332> : Xian 1980 / Gauss-Kruger zone 18)110.5 432 Q
-(<esri2333> : Xian 1980 / Gauss-Kruger zone 19)110.5 444 Q
-(<esri2334> : Xian 1980 / Gauss-Kruger zone 20)110.5 456 Q
-(<esri2335> : Xian 1980 / Gauss-Kruger zone 21)110.5 468 Q
-(<esri2336> : Xian 1980 / Gauss-Kruger zone 22)110.5 480 Q
-(<esri2337> : Xian 1980 / Gauss-Kruger zone 23)110.5 492 Q
-(<esri2338> : Xian 1980 / Gauss-Kruger CM 75E)110.5 504 Q
-(<esri2339> : Xian 1980 / Gauss-Kruger CM 81E)110.5 516 Q
-(<esri2340> : Xian 1980 / Gauss-Kruger CM 87E)110.5 528 Q
-(<esri2341> : Xian 1980 / Gauss-Kruger CM 93E)110.5 540 Q
-(<esri2342> : Xian 1980 / Gauss-Kruger CM 99E)110.5 552 Q
-(<esri2343> : Xian 1980 / Gauss-Kruger CM 105E)110.5 564 Q
-(<esri2344> : Xian 1980 / Gauss-Kruger CM 111E)110.5 576 Q
-(<esri2345> : Xian 1980 / Gauss-Kruger CM 117E)110.5 588 Q
-(<esri2346> : Xian 1980 / Gauss-Kruger CM 123E)110.5 600 Q
-(<esri2347> : Xian 1980 / Gauss-Kruger CM 129E)110.5 612 Q
-(<esri2348> : Xian 1980 / Gauss-Kruger CM 135E)110.5 624 Q
-(<esri2349> : Xian 1980 / 3-de)110.5 636 Q(gree Gauss-Kruger zone 25)
--.15 E(<esri2350> : Xian 1980 / 3-de)110.5 648 Q
-(gree Gauss-Kruger zone 26)-.15 E(<esri2351> : Xian 1980 / 3-de)110.5
-660 Q(gree Gauss-Kruger zone 27)-.15 E(<esri2352> : Xian 1980 / 3-de)
-110.5 672 Q(gree Gauss-Kruger zone 28)-.15 E
-(<esri2353> : Xian 1980 / 3-de)110.5 684 Q(gree Gauss-Kruger zone 29)
--.15 E(<esri2354> : Xian 1980 / 3-de)110.5 696 Q
-(gree Gauss-Kruger zone 30)-.15 E(<esri2355> : Xian 1980 / 3-de)110.5
-708 Q(gree Gauss-Kruger zone 31)-.15 E(<esri2356> : Xian 1980 / 3-de)
-110.5 720 Q(gree Gauss-Kruger zone 32)-.15 E(MB-System 5.0)72 768 Q
-(29 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E(93)185.545 E 0 Cg EP
-%%Page: 94 94
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<esri2357> : Xian 1980 / 3-de)110.5 84 Q
-(gree Gauss-Kruger zone 33)-.15 E(<esri2358> : Xian 1980 / 3-de)110.5 96
-Q(gree Gauss-Kruger zone 34)-.15 E(<esri2359> : Xian 1980 / 3-de)110.5
-108 Q(gree Gauss-Kruger zone 35)-.15 E(<esri2360> : Xian 1980 / 3-de)
-110.5 120 Q(gree Gauss-Kruger zone 36)-.15 E
-(<esri2361> : Xian 1980 / 3-de)110.5 132 Q(gree Gauss-Kruger zone 37)
--.15 E(<esri2362> : Xian 1980 / 3-de)110.5 144 Q
-(gree Gauss-Kruger zone 38)-.15 E(<esri2363> : Xian 1980 / 3-de)110.5
-156 Q(gree Gauss-Kruger zone 39)-.15 E(<esri2364> : Xian 1980 / 3-de)
-110.5 168 Q(gree Gauss-Kruger zone 40)-.15 E
-(<esri2365> : Xian 1980 / 3-de)110.5 180 Q(gree Gauss-Kruger zone 41)
--.15 E(<esri2366> : Xian 1980 / 3-de)110.5 192 Q
-(gree Gauss-Kruger zone 42)-.15 E(<esri2367> : Xian 1980 / 3-de)110.5
-204 Q(gree Gauss-Kruger zone 43)-.15 E(<esri2368> : Xian 1980 / 3-de)
-110.5 216 Q(gree Gauss-Kruger zone 44)-.15 E
-(<esri2369> : Xian 1980 / 3-de)110.5 228 Q(gree Gauss-Kruger zone 45)
--.15 E(<esri2370> : Xian 1980 / 3-de)110.5 240 Q
-(gree Gauss-Kruger CM 75E)-.15 E(<esri2371> : Xian 1980 / 3-de)110.5 252
-Q(gree Gauss-Kruger CM 78E)-.15 E(<esri2372> : Xian 1980 / 3-de)110.5
-264 Q(gree Gauss-Kruger CM 81E)-.15 E(<esri2373> : Xian 1980 / 3-de)
-110.5 276 Q(gree Gauss-Kruger CM 84E)-.15 E
-(<esri2374> : Xian 1980 / 3-de)110.5 288 Q(gree Gauss-Kruger CM 87E)-.15
-E(<esri2375> : Xian 1980 / 3-de)110.5 300 Q(gree Gauss-Kruger CM 90E)
--.15 E(<esri2376> : Xian 1980 / 3-de)110.5 312 Q
-(gree Gauss-Kruger CM 93E)-.15 E(<esri2377> : Xian 1980 / 3-de)110.5 324
-Q(gree Gauss-Kruger CM 96E)-.15 E(<esri2378> : Xian 1980 / 3-de)110.5
-336 Q(gree Gauss-Kruger CM 99E)-.15 E(<esri2379> : Xian 1980 / 3-de)
-110.5 348 Q(gree Gauss-Kruger CM 102E)-.15 E
-(<esri2380> : Xian 1980 / 3-de)110.5 360 Q(gree Gauss-Kruger CM 105E)
--.15 E(<esri2381> : Xian 1980 / 3-de)110.5 372 Q
-(gree Gauss-Kruger CM 108E)-.15 E(<esri2382> : Xian 1980 / 3-de)110.5
-384 Q(gree Gauss-Kruger CM 111E)-.15 E(<esri2383> : Xian 1980 / 3-de)
-110.5 396 Q(gree Gauss-Kruger CM 114E)-.15 E
-(<esri2384> : Xian 1980 / 3-de)110.5 408 Q(gree Gauss-Kruger CM 117E)
--.15 E(<esri2385> : Xian 1980 / 3-de)110.5 420 Q
-(gree Gauss-Kruger CM 120E)-.15 E(<esri2386> : Xian 1980 / 3-de)110.5
-432 Q(gree Gauss-Kruger CM 123E)-.15 E(<esri2387> : Xian 1980 / 3-de)
-110.5 444 Q(gree Gauss-Kruger CM 126E)-.15 E
-(<esri2388> : Xian 1980 / 3-de)110.5 456 Q(gree Gauss-Kruger CM 129E)
--.15 E(<esri2389> : Xian 1980 / 3-de)110.5 468 Q
-(gree Gauss-Kruger CM 132E)-.15 E(<esri2390> : Xian 1980 / 3-de)110.5
-480 Q(gree Gauss-Kruger CM 135E)-.15 E
-(<esri2391> : KKJ / Finland zone 1)110.5 492 Q
-(<esri2392> : KKJ / Finland zone 2)110.5 504 Q
-(<esri2393> : KKJ / Finland Uniform Coordinate System)110.5 516 Q
-(<esri2394> : KKJ / Finland zone 4)110.5 528 Q(<esri2395> : South Y)
-110.5 540 Q(emen / Gauss-Kruger zone 8)-1 E(<esri2396> : South Y)110.5
-552 Q(emen / Gauss-Kruger zone 9)-1 E(<esri2397> : Pulk)110.5 564 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(942\(83\) / Gauss-Kruger zone 3)-2.5 E
-(<esri2398> : Pulk)110.5 576 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942\(83\) / Gauss-Kruger zone 4)-2.5 E(<esri2399> : Pulk)110.5 588 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(942\(83\) / Gauss-Kruger zone 5)-2.5 E
-(<esri2400> : R)110.5 600 Q(T90 2.5 gon W)-.6 E
-(<esri2401> : Beijing 1954 / 3-de)110.5 612 Q(gree Gauss-Kruger zone 25)
--.15 E(<esri2402> : Beijing 1954 / 3-de)110.5 624 Q
-(gree Gauss-Kruger zone 26)-.15 E(<esri2403> : Beijing 1954 / 3-de)110.5
-636 Q(gree Gauss-Kruger zone 27)-.15 E(<esri2404> : Beijing 1954 / 3-de)
-110.5 648 Q(gree Gauss-Kruger zone 28)-.15 E
-(<esri2405> : Beijing 1954 / 3-de)110.5 660 Q(gree Gauss-Kruger zone 29)
--.15 E(<esri2406> : Beijing 1954 / 3-de)110.5 672 Q
-(gree Gauss-Kruger zone 30)-.15 E(<esri2407> : Beijing 1954 / 3-de)110.5
-684 Q(gree Gauss-Kruger zone 31)-.15 E(<esri2408> : Beijing 1954 / 3-de)
-110.5 696 Q(gree Gauss-Kruger zone 32)-.15 E
-(<esri2409> : Beijing 1954 / 3-de)110.5 708 Q(gree Gauss-Kruger zone 33)
--.15 E(<esri2410> : Beijing 1954 / 3-de)110.5 720 Q
-(gree Gauss-Kruger zone 34)-.15 E(MB-System 5.0)72 768 Q(29 No)132.205 E
--.15(ve)-.15 G(mber 2014).15 E(94)185.545 E 0 Cg EP
-%%Page: 95 95
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<esri2411> : Beijing 1954 / 3-de)110.5 84 Q
-(gree Gauss-Kruger zone 35)-.15 E(<esri2412> : Beijing 1954 / 3-de)110.5
-96 Q(gree Gauss-Kruger zone 36)-.15 E(<esri2413> : Beijing 1954 / 3-de)
-110.5 108 Q(gree Gauss-Kruger zone 37)-.15 E
-(<esri2414> : Beijing 1954 / 3-de)110.5 120 Q(gree Gauss-Kruger zone 38)
--.15 E(<esri2415> : Beijing 1954 / 3-de)110.5 132 Q
-(gree Gauss-Kruger zone 39)-.15 E(<esri2416> : Beijing 1954 / 3-de)110.5
-144 Q(gree Gauss-Kruger zone 40)-.15 E(<esri2417> : Beijing 1954 / 3-de)
-110.5 156 Q(gree Gauss-Kruger zone 41)-.15 E
-(<esri2418> : Beijing 1954 / 3-de)110.5 168 Q(gree Gauss-Kruger zone 42)
--.15 E(<esri2419> : Beijing 1954 / 3-de)110.5 180 Q
-(gree Gauss-Kruger zone 43)-.15 E(<esri2420> : Beijing 1954 / 3-de)110.5
-192 Q(gree Gauss-Kruger zone 44)-.15 E(<esri2421> : Beijing 1954 / 3-de)
-110.5 204 Q(gree Gauss-Kruger zone 45)-.15 E
-(<esri2422> : Beijing 1954 / 3-de)110.5 216 Q(gree Gauss-Kruger CM 75E)
--.15 E(<esri2423> : Beijing 1954 / 3-de)110.5 228 Q
-(gree Gauss-Kruger CM 78E)-.15 E(<esri2424> : Beijing 1954 / 3-de)110.5
-240 Q(gree Gauss-Kruger CM 81E)-.15 E(<esri2425> : Beijing 1954 / 3-de)
-110.5 252 Q(gree Gauss-Kruger CM 84E)-.15 E
-(<esri2426> : Beijing 1954 / 3-de)110.5 264 Q(gree Gauss-Kruger CM 87E)
--.15 E(<esri2427> : Beijing 1954 / 3-de)110.5 276 Q
-(gree Gauss-Kruger CM 90E)-.15 E(<esri2428> : Beijing 1954 / 3-de)110.5
-288 Q(gree Gauss-Kruger CM 93E)-.15 E(<esri2429> : Beijing 1954 / 3-de)
-110.5 300 Q(gree Gauss-Kruger CM 96E)-.15 E
-(<esri2430> : Beijing 1954 / 3-de)110.5 312 Q(gree Gauss-Kruger CM 99E)
--.15 E(<esri2431> : Beijing 1954 / 3-de)110.5 324 Q
-(gree Gauss-Kruger CM 102E)-.15 E(<esri2432> : Beijing 1954 / 3-de)110.5
-336 Q(gree Gauss-Kruger CM 105E)-.15 E(<esri2433> : Beijing 1954 / 3-de)
-110.5 348 Q(gree Gauss-Kruger CM 108E)-.15 E
-(<esri2434> : Beijing 1954 / 3-de)110.5 360 Q(gree Gauss-Kruger CM 111E)
--.15 E(<esri2435> : Beijing 1954 / 3-de)110.5 372 Q
-(gree Gauss-Kruger CM 114E)-.15 E(<esri2436> : Beijing 1954 / 3-de)110.5
-384 Q(gree Gauss-Kruger CM 117E)-.15 E(<esri2437> : Beijing 1954 / 3-de)
-110.5 396 Q(gree Gauss-Kruger CM 120E)-.15 E
-(<esri2438> : Beijing 1954 / 3-de)110.5 408 Q(gree Gauss-Kruger CM 123E)
--.15 E(<esri2439> : Beijing 1954 / 3-de)110.5 420 Q
-(gree Gauss-Kruger CM 126E)-.15 E(<esri2440> : Beijing 1954 / 3-de)110.5
-432 Q(gree Gauss-Kruger CM 129E)-.15 E(<esri2441> : Beijing 1954 / 3-de)
-110.5 444 Q(gree Gauss-Kruger CM 132E)-.15 E
-(<esri2442> : Beijing 1954 / 3-de)110.5 456 Q(gree Gauss-Kruger CM 135E)
--.15 E(<esri2443> : JGD2000 / Japan Plane Rectangular CS I)110.5 468 Q
-(<esri2444> : JGD2000 / Japan Plane Rectangular CS II)110.5 480 Q
-(<esri2445> : JGD2000 / Japan Plane Rectangular CS III)110.5 492 Q
-(<esri2446> : JGD2000 / Japan Plane Rectangular CS IV)110.5 504 Q
-(<esri2447> : JGD2000 / Japan Plane Rectangular CS V)110.5 516 Q
-(<esri2448> : JGD2000 / Japan Plane Rectangular CS VI)110.5 528 Q
-(<esri2449> : JGD2000 / Japan Plane Rectangular CS VII)110.5 540 Q
-(<esri2450> : JGD2000 / Japan Plane Rectangular CS VIII)110.5 552 Q
-(<esri2451> : JGD2000 / Japan Plane Rectangular CS IX)110.5 564 Q
-(<esri2452> : JGD2000 / Japan Plane Rectangular CS X)110.5 576 Q
-(<esri2453> : JGD2000 / Japan Plane Rectangular CS XI)110.5 588 Q
-(<esri2454> : JGD2000 / Japan Plane Rectangular CS XII)110.5 600 Q
-(<esri2455> : JGD2000 / Japan Plane Rectangular CS XIII)110.5 612 Q
-(<esri2456> : JGD2000 / Japan Plane Rectangular CS XIV)110.5 624 Q
-(<esri2457> : JGD2000 / Japan Plane Rectangular CS XV)110.5 636 Q
-(<esri2458> : JGD2000 / Japan Plane Rectangular CS XVI)110.5 648 Q
-(<esri2459> : JGD2000 / Japan Plane Rectangular CS XVII)110.5 660 Q
-(<esri2460> : JGD2000 / Japan Plane Rectangular CS XVIII)110.5 672 Q
-(<esri2461> : JGD2000 / Japan Plane Rectangular CS XIX)110.5 684 Q
-(<esri2462> : Albanian 1987 / Gauss-Kruger zone 4)110.5 696 Q
-(<esri2463> : Pulk)110.5 708 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger CM 21E)-2.5 E(<esri2464> : Pulk)110.5 720 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger CM 27E)-2.5 E(MB-System 5.0)72
-768 Q(29 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E(95)185.545 E 0 Cg
-EP
-%%Page: 96 96
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<esri2465> : Pulk)110.5 84 Q -.15(ov)-.1 G 2.5
-(o1)-.05 G(995 / Gauss-Kruger CM 33E)-2.5 E(<esri2466> : Pulk)110.5 96 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger CM 39E)-2.5 E
-(<esri2467> : Pulk)110.5 108 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger CM 45E)-2.5 E(<esri2468> : Pulk)110.5 120 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger CM 51E)-2.5 E(<esri2469> : Pulk)
-110.5 132 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger CM 57E)-2.5 E
-(<esri2470> : Pulk)110.5 144 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger CM 63E)-2.5 E(<esri2471> : Pulk)110.5 156 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger CM 69E)-2.5 E(<esri2472> : Pulk)
-110.5 168 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger CM 75E)-2.5 E
-(<esri2473> : Pulk)110.5 180 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger CM 81E)-2.5 E(<esri2474> : Pulk)110.5 192 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger CM 87E)-2.5 E(<esri2475> : Pulk)
-110.5 204 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger CM 93E)-2.5 E
-(<esri2476> : Pulk)110.5 216 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger CM 99E)-2.5 E(<esri2477> : Pulk)110.5 228 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger CM 105E)-2.5 E(<esri2478> : Pulk)
-110.5 240 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger CM 111E)-2.5
-E(<esri2479> : Pulk)110.5 252 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger CM 117E)-2.5 E(<esri2480> : Pulk)110.5 264 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger CM 123E)-2.5 E
-(<esri2481> : Pulk)110.5 276 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger CM 129E)-2.5 E(<esri2482> : Pulk)110.5 288 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger CM 135E)-2.5 E
-(<esri2483> : Pulk)110.5 300 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger CM 141E)-2.5 E(<esri2484> : Pulk)110.5 312 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger CM 147E)-2.5 E
-(<esri2485> : Pulk)110.5 324 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger CM 153E)-2.5 E(<esri2486> : Pulk)110.5 336 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger CM 159E)-2.5 E
-(<esri2487> : Pulk)110.5 348 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger CM 165E)-2.5 E(<esri2488> : Pulk)110.5 360 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger CM 171E)-2.5 E
-(<esri2489> : Pulk)110.5 372 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger CM 177E)-2.5 E(<esri2490> : Pulk)110.5 384 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger CM 177W)-2.5 E
-(<esri2491> : Pulk)110.5 396 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger CM 171W)-2.5 E(<esri2492> : Pulk)110.5 408 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger CM 9E)-2.5 E
-(<esri2493> : Pulk)110.5 420 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger CM 15E)-2.5 E(<esri2494> : Pulk)110.5 432 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger CM 21E)-2.5 E(<esri2495> : Pulk)
-110.5 444 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger CM 27E)-2.5 E
-(<esri2496> : Pulk)110.5 456 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger CM 33E)-2.5 E(<esri2497> : Pulk)110.5 468 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger CM 39E)-2.5 E(<esri2498> : Pulk)
-110.5 480 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger CM 45E)-2.5 E
-(<esri2499> : Pulk)110.5 492 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger CM 51E)-2.5 E(<esri2500> : Pulk)110.5 504 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger CM 57E)-2.5 E(<esri2501> : Pulk)
-110.5 516 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger CM 63E)-2.5 E
-(<esri2502> : Pulk)110.5 528 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger CM 69E)-2.5 E(<esri2503> : Pulk)110.5 540 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger CM 75E)-2.5 E(<esri2504> : Pulk)
-110.5 552 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger CM 81E)-2.5 E
-(<esri2505> : Pulk)110.5 564 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger CM 87E)-2.5 E(<esri2506> : Pulk)110.5 576 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger CM 93E)-2.5 E(<esri2507> : Pulk)
-110.5 588 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger CM 99E)-2.5 E
-(<esri2508> : Pulk)110.5 600 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger CM 105E)-2.5 E(<esri2509> : Pulk)110.5 612 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger CM 111E)-2.5 E
-(<esri2510> : Pulk)110.5 624 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger CM 117E)-2.5 E(<esri2511> : Pulk)110.5 636 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger CM 123E)-2.5 E
-(<esri2512> : Pulk)110.5 648 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger CM 129E)-2.5 E(<esri2513> : Pulk)110.5 660 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger CM 135E)-2.5 E
-(<esri2514> : Pulk)110.5 672 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger CM 141E)-2.5 E(<esri2515> : Pulk)110.5 684 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger CM 147E)-2.5 E
-(<esri2516> : Pulk)110.5 696 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger CM 153E)-2.5 E(<esri2517> : Pulk)110.5 708 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger CM 159E)-2.5 E
-(<esri2518> : Pulk)110.5 720 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger CM 165E)-2.5 E(MB-System 5.0)72 768 Q(29 No)132.205
-E -.15(ve)-.15 G(mber 2014).15 E(96)185.545 E 0 Cg EP
-%%Page: 97 97
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<esri2519> : Pulk)110.5 84 Q -.15(ov)-.1 G 2.5
-(o1)-.05 G(942 / Gauss-Kruger CM 171E)-2.5 E(<esri2520> : Pulk)110.5 96
-Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger CM 177E)-2.5 E
-(<esri2521> : Pulk)110.5 108 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger CM 177W)-2.5 E(<esri2522> : Pulk)110.5 120 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger CM 171W)-2.5 E
-(<esri2523> : Pulk)110.5 132 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)
--2.5 E(gree Gauss-Kruger zone 7)-.15 E(<esri2524> : Pulk)110.5 144 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 8)
--.15 E(<esri2525> : Pulk)110.5 156 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 9)-.15 E(<esri2526> : Pulk)
-110.5 168 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E
-(gree Gauss-Kruger zone 10)-.15 E(<esri2527> : Pulk)110.5 180 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 11)-.15 E
-(<esri2528> : Pulk)110.5 192 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)
--2.5 E(gree Gauss-Kruger zone 12)-.15 E(<esri2529> : Pulk)110.5 204 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 13)
--.15 E(<esri2530> : Pulk)110.5 216 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 14)-.15 E(<esri2531> : Pulk)
-110.5 228 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E
-(gree Gauss-Kruger zone 15)-.15 E(<esri2532> : Pulk)110.5 240 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 16)-.15 E
-(<esri2533> : Pulk)110.5 252 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)
--2.5 E(gree Gauss-Kruger zone 17)-.15 E(<esri2534> : Pulk)110.5 264 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 18)
--.15 E(<esri2535> : Pulk)110.5 276 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 19)-.15 E(<esri2536> : Pulk)
-110.5 288 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E
-(gree Gauss-Kruger zone 20)-.15 E(<esri2537> : Pulk)110.5 300 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 21)-.15 E
-(<esri2538> : Pulk)110.5 312 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)
--2.5 E(gree Gauss-Kruger zone 22)-.15 E(<esri2539> : Pulk)110.5 324 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 23)
--.15 E(<esri2540> : Pulk)110.5 336 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 24)-.15 E(<esri2541> : Pulk)
-110.5 348 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E
-(gree Gauss-Kruger zone 25)-.15 E(<esri2542> : Pulk)110.5 360 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 26)-.15 E
-(<esri2543> : Pulk)110.5 372 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)
--2.5 E(gree Gauss-Kruger zone 27)-.15 E(<esri2544> : Pulk)110.5 384 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 28)
--.15 E(<esri2545> : Pulk)110.5 396 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 29)-.15 E(<esri2546> : Pulk)
-110.5 408 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E
-(gree Gauss-Kruger zone 30)-.15 E(<esri2547> : Pulk)110.5 420 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 31)-.15 E
-(<esri2548> : Pulk)110.5 432 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)
--2.5 E(gree Gauss-Kruger zone 32)-.15 E(<esri2549> : Pulk)110.5 444 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 33)
--.15 E(<esri2550> : Samboja / UTM zone 50S)110.5 456 Q
-(<esri2551> : Pulk)110.5 468 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)
--2.5 E(gree Gauss-Kruger zone 34)-.15 E(<esri2552> : Pulk)110.5 480 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 35)
--.15 E(<esri2553> : Pulk)110.5 492 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 36)-.15 E(<esri2554> : Pulk)
-110.5 504 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E
-(gree Gauss-Kruger zone 37)-.15 E(<esri2555> : Pulk)110.5 516 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 38)-.15 E
-(<esri2556> : Pulk)110.5 528 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)
--2.5 E(gree Gauss-Kruger zone 39)-.15 E(<esri2557> : Pulk)110.5 540 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 40)
--.15 E(<esri2558> : Pulk)110.5 552 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 41)-.15 E(<esri2559> : Pulk)
-110.5 564 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E
-(gree Gauss-Kruger zone 42)-.15 E(<esri2560> : Pulk)110.5 576 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 43)-.15 E
-(<esri2561> : Pulk)110.5 588 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)
--2.5 E(gree Gauss-Kruger zone 44)-.15 E(<esri2562> : Pulk)110.5 600 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 45)
--.15 E(<esri2563> : Pulk)110.5 612 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 46)-.15 E(<esri2564> : Pulk)
-110.5 624 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E
-(gree Gauss-Kruger zone 47)-.15 E(<esri2565> : Pulk)110.5 636 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 48)-.15 E
-(<esri2566> : Pulk)110.5 648 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)
--2.5 E(gree Gauss-Kruger zone 49)-.15 E(<esri2567> : Pulk)110.5 660 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 50)
--.15 E(<esri2568> : Pulk)110.5 672 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 51)-.15 E(<esri2569> : Pulk)
-110.5 684 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E
-(gree Gauss-Kruger zone 52)-.15 E(<esri2570> : Pulk)110.5 696 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 53)-.15 E
-(<esri2571> : Pulk)110.5 708 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)
--2.5 E(gree Gauss-Kruger zone 54)-.15 E(<esri2572> : Pulk)110.5 720 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 55)
--.15 E(MB-System 5.0)72 768 Q(29 No)132.205 E -.15(ve)-.15 G(mber 2014)
-.15 E(97)185.545 E 0 Cg EP
-%%Page: 98 98
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<esri2573> : Pulk)110.5 84 Q -.15(ov)-.1 G 2.5
-(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 56)-.15 E
-(<esri2574> : Pulk)110.5 96 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)
--2.5 E(gree Gauss-Kruger zone 57)-.15 E(<esri2575> : Pulk)110.5 108 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 58)
--.15 E(<esri2576> : Pulk)110.5 120 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 59)-.15 E(<esri2577> : Pulk)
-110.5 132 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E
-(gree Gauss-Kruger zone 60)-.15 E(<esri2578> : Pulk)110.5 144 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 61)-.15 E
-(<esri2579> : Pulk)110.5 156 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)
--2.5 E(gree Gauss-Kruger zone 62)-.15 E(<esri2580> : Pulk)110.5 168 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 63)
--.15 E(<esri2581> : Pulk)110.5 180 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 64)-.15 E(<esri2582> : Pulk)
-110.5 192 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E
-(gree Gauss-Kruger CM 21E)-.15 E(<esri2583> : Pulk)110.5 204 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 24E)-.15 E
-(<esri2584> : Pulk)110.5 216 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)
--2.5 E(gree Gauss-Kruger CM 27E)-.15 E(<esri2585> : Pulk)110.5 228 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 30E)
--.15 E(<esri2586> : Pulk)110.5 240 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 33E)-.15 E(<esri2587> : Pulk)
-110.5 252 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E
-(gree Gauss-Kruger CM 36E)-.15 E(<esri2588> : Pulk)110.5 264 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 39E)-.15 E
-(<esri2589> : Pulk)110.5 276 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)
--2.5 E(gree Gauss-Kruger CM 42E)-.15 E(<esri2590> : Pulk)110.5 288 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 45E)
--.15 E(<esri2591> : Pulk)110.5 300 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 48E)-.15 E(<esri2592> : Pulk)
-110.5 312 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E
-(gree Gauss-Kruger CM 51E)-.15 E(<esri2593> : Pulk)110.5 324 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 54E)-.15 E
-(<esri2594> : Pulk)110.5 336 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)
--2.5 E(gree Gauss-Kruger CM 57E)-.15 E(<esri2595> : Pulk)110.5 348 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 60E)
--.15 E(<esri2596> : Pulk)110.5 360 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 63E)-.15 E(<esri2597> : Pulk)
-110.5 372 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E
-(gree Gauss-Kruger CM 66E)-.15 E(<esri2598> : Pulk)110.5 384 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 69E)-.15 E
-(<esri2599> : Pulk)110.5 396 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)
--2.5 E(gree Gauss-Kruger CM 72E)-.15 E(<esri2600> : Lietuv)110.5 408 Q
-(os K)-.2 E(oordinoei Sistema 1994)-.35 E(<esri2601> : Pulk)110.5 420 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 75E)
--.15 E(<esri2602> : Pulk)110.5 432 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 78E)-.15 E(<esri2603> : Pulk)
-110.5 444 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E
-(gree Gauss-Kruger CM 81E)-.15 E(<esri2604> : Pulk)110.5 456 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 84E)-.15 E
-(<esri2605> : Pulk)110.5 468 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)
--2.5 E(gree Gauss-Kruger CM 87E)-.15 E(<esri2606> : Pulk)110.5 480 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 90E)
--.15 E(<esri2607> : Pulk)110.5 492 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 93E)-.15 E(<esri2608> : Pulk)
-110.5 504 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E
-(gree Gauss-Kruger CM 96E)-.15 E(<esri2609> : Pulk)110.5 516 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 99E)-.15 E
-(<esri2610> : Pulk)110.5 528 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)
--2.5 E(gree Gauss-Kruger CM 102E)-.15 E(<esri2611> : Pulk)110.5 540 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 105E)
--.15 E(<esri2612> : Pulk)110.5 552 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 108E)-.15 E(<esri2613> : Pulk)
-110.5 564 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E
-(gree Gauss-Kruger CM 111E)-.15 E(<esri2614> : Pulk)110.5 576 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 114E)-.15 E
-(<esri2615> : Pulk)110.5 588 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)
--2.5 E(gree Gauss-Kruger CM 117E)-.15 E(<esri2616> : Pulk)110.5 600 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 120E)
--.15 E(<esri2617> : Pulk)110.5 612 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 123E)-.15 E(<esri2618> : Pulk)
-110.5 624 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E
-(gree Gauss-Kruger CM 126E)-.15 E(<esri2619> : Pulk)110.5 636 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 129E)-.15 E
-(<esri2620> : Pulk)110.5 648 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)
--2.5 E(gree Gauss-Kruger CM 132E)-.15 E(<esri2621> : Pulk)110.5 660 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 135E)
--.15 E(<esri2622> : Pulk)110.5 672 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 138E)-.15 E(<esri2623> : Pulk)
-110.5 684 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E
-(gree Gauss-Kruger CM 141E)-.15 E(<esri2624> : Pulk)110.5 696 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 144E)-.15 E
-(<esri2625> : Pulk)110.5 708 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)
--2.5 E(gree Gauss-Kruger CM 147E)-.15 E(<esri2626> : Pulk)110.5 720 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 150E)
--.15 E(MB-System 5.0)72 768 Q(29 No)132.205 E -.15(ve)-.15 G(mber 2014)
-.15 E(98)185.545 E 0 Cg EP
-%%Page: 99 99
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<esri2627> : Pulk)110.5 84 Q -.15(ov)-.1 G 2.5
-(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 153E)-.15 E
-(<esri2628> : Pulk)110.5 96 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)
--2.5 E(gree Gauss-Kruger CM 156E)-.15 E(<esri2629> : Pulk)110.5 108 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 159E)
--.15 E(<esri2630> : Pulk)110.5 120 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 162E)-.15 E(<esri2631> : Pulk)
-110.5 132 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E
-(gree Gauss-Kruger CM 165E)-.15 E(<esri2632> : Pulk)110.5 144 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 168E)-.15 E
-(<esri2633> : Pulk)110.5 156 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)
--2.5 E(gree Gauss-Kruger CM 171E)-.15 E(<esri2634> : Pulk)110.5 168 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 174E)
--.15 E(<esri2635> : Pulk)110.5 180 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 177E)-.15 E(<esri2636> : Pulk)
-110.5 192 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E
-(gree Gauss-Kruger CM 180E)-.15 E(<esri2637> : Pulk)110.5 204 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 177W)-.15 E
-(<esri2638> : Pulk)110.5 216 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)
--2.5 E(gree Gauss-Kruger CM 174W)-.15 E(<esri2639> : Pulk)110.5 228 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 171W)
--.15 E(<esri2640> : Pulk)110.5 240 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 168W)-.15 E(<esri2641> : Pulk)
-110.5 252 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E
-(gree Gauss-Kruger zone 7)-.15 E(<esri2642> : Pulk)110.5 264 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 8)-.15 E
-(<esri2643> : Pulk)110.5 276 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)
--2.5 E(gree Gauss-Kruger zone 9)-.15 E(<esri2644> : Pulk)110.5 288 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 10)
--.15 E(<esri2645> : Pulk)110.5 300 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 11)-.15 E(<esri2646> : Pulk)
-110.5 312 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E
-(gree Gauss-Kruger zone 12)-.15 E(<esri2647> : Pulk)110.5 324 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 13)-.15 E
-(<esri2648> : Pulk)110.5 336 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)
--2.5 E(gree Gauss-Kruger zone 14)-.15 E(<esri2649> : Pulk)110.5 348 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 15)
--.15 E(<esri2650> : Pulk)110.5 360 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 16)-.15 E(<esri2651> : Pulk)
-110.5 372 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E
-(gree Gauss-Kruger zone 17)-.15 E(<esri2652> : Pulk)110.5 384 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 18)-.15 E
-(<esri2653> : Pulk)110.5 396 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)
--2.5 E(gree Gauss-Kruger zone 19)-.15 E(<esri2654> : Pulk)110.5 408 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 20)
--.15 E(<esri2655> : Pulk)110.5 420 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 21)-.15 E(<esri2656> : Pulk)
-110.5 432 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E
-(gree Gauss-Kruger zone 22)-.15 E(<esri2657> : Pulk)110.5 444 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 23)-.15 E
-(<esri2658> : Pulk)110.5 456 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)
--2.5 E(gree Gauss-Kruger zone 24)-.15 E(<esri2659> : Pulk)110.5 468 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 25)
--.15 E(<esri2660> : Pulk)110.5 480 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 26)-.15 E(<esri2661> : Pulk)
-110.5 492 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E
-(gree Gauss-Kruger zone 27)-.15 E(<esri2662> : Pulk)110.5 504 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 28)-.15 E
-(<esri2663> : Pulk)110.5 516 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)
--2.5 E(gree Gauss-Kruger zone 29)-.15 E(<esri2664> : Pulk)110.5 528 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 30)
--.15 E(<esri2665> : Pulk)110.5 540 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 31)-.15 E(<esri2666> : Pulk)
-110.5 552 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E
-(gree Gauss-Kruger zone 32)-.15 E(<esri2667> : Pulk)110.5 564 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 33)-.15 E
-(<esri2668> : Pulk)110.5 576 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)
--2.5 E(gree Gauss-Kruger zone 34)-.15 E(<esri2669> : Pulk)110.5 588 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 35)
--.15 E(<esri2670> : Pulk)110.5 600 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 36)-.15 E(<esri2671> : Pulk)
-110.5 612 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E
-(gree Gauss-Kruger zone 37)-.15 E(<esri2672> : Pulk)110.5 624 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 38)-.15 E
-(<esri2673> : Pulk)110.5 636 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)
--2.5 E(gree Gauss-Kruger zone 39)-.15 E(<esri2674> : Pulk)110.5 648 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 40)
--.15 E(<esri2675> : Pulk)110.5 660 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 41)-.15 E(<esri2676> : Pulk)
-110.5 672 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E
-(gree Gauss-Kruger zone 42)-.15 E(<esri2677> : Pulk)110.5 684 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 43)-.15 E
-(<esri2678> : Pulk)110.5 696 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)
--2.5 E(gree Gauss-Kruger zone 44)-.15 E(<esri2679> : Pulk)110.5 708 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 45)
--.15 E(<esri2680> : Pulk)110.5 720 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 46)-.15 E(MB-System 5.0)72 768
-Q(29 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E(99)185.545 E 0 Cg EP
-%%Page: 100 100
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<esri2681> : Pulk)110.5 84 Q -.15(ov)-.1 G 2.5
-(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 47)-.15 E
-(<esri2682> : Pulk)110.5 96 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)
--2.5 E(gree Gauss-Kruger zone 48)-.15 E(<esri2683> : Pulk)110.5 108 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 49)
--.15 E(<esri2684> : Pulk)110.5 120 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 50)-.15 E(<esri2685> : Pulk)
-110.5 132 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E
-(gree Gauss-Kruger zone 51)-.15 E(<esri2686> : Pulk)110.5 144 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 52)-.15 E
-(<esri2687> : Pulk)110.5 156 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)
--2.5 E(gree Gauss-Kruger zone 53)-.15 E(<esri2688> : Pulk)110.5 168 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 54)
--.15 E(<esri2689> : Pulk)110.5 180 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 55)-.15 E(<esri2690> : Pulk)
-110.5 192 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E
-(gree Gauss-Kruger zone 56)-.15 E(<esri2691> : Pulk)110.5 204 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 57)-.15 E
-(<esri2692> : Pulk)110.5 216 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)
--2.5 E(gree Gauss-Kruger zone 58)-.15 E(<esri2693> : Pulk)110.5 228 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 59)
--.15 E(<esri2694> : Pulk)110.5 240 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 60)-.15 E(<esri2695> : Pulk)
-110.5 252 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E
-(gree Gauss-Kruger zone 61)-.15 E(<esri2696> : Pulk)110.5 264 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 62)-.15 E
-(<esri2697> : Pulk)110.5 276 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)
--2.5 E(gree Gauss-Kruger zone 63)-.15 E(<esri2698> : Pulk)110.5 288 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 64)
--.15 E(<esri2699> : Pulk)110.5 300 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 21E)-.15 E(<esri2700> : Pulk)
-110.5 312 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E
-(gree Gauss-Kruger CM 24E)-.15 E(<esri2701> : Pulk)110.5 324 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 27E)-.15 E
-(<esri2702> : Pulk)110.5 336 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)
--2.5 E(gree Gauss-Kruger CM 30E)-.15 E(<esri2703> : Pulk)110.5 348 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 33E)
--.15 E(<esri2704> : Pulk)110.5 360 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 36E)-.15 E(<esri2705> : Pulk)
-110.5 372 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E
-(gree Gauss-Kruger CM 39E)-.15 E(<esri2706> : Pulk)110.5 384 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 42E)-.15 E
-(<esri2707> : Pulk)110.5 396 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)
--2.5 E(gree Gauss-Kruger CM 45E)-.15 E(<esri2708> : Pulk)110.5 408 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 48E)
--.15 E(<esri2709> : Pulk)110.5 420 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 51E)-.15 E(<esri2710> : Pulk)
-110.5 432 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E
-(gree Gauss-Kruger CM 54E)-.15 E(<esri2711> : Pulk)110.5 444 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 57E)-.15 E
-(<esri2712> : Pulk)110.5 456 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)
--2.5 E(gree Gauss-Kruger CM 60E)-.15 E(<esri2713> : Pulk)110.5 468 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 63E)
--.15 E(<esri2714> : Pulk)110.5 480 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 66E)-.15 E(<esri2715> : Pulk)
-110.5 492 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E
-(gree Gauss-Kruger CM 69E)-.15 E(<esri2716> : Pulk)110.5 504 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 72E)-.15 E
-(<esri2717> : Pulk)110.5 516 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)
--2.5 E(gree Gauss-Kruger CM 75E)-.15 E(<esri2718> : Pulk)110.5 528 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 78E)
--.15 E(<esri2719> : Pulk)110.5 540 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 81E)-.15 E(<esri2720> : Pulk)
-110.5 552 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E
-(gree Gauss-Kruger CM 84E)-.15 E(<esri2721> : Pulk)110.5 564 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 87E)-.15 E
-(<esri2722> : Pulk)110.5 576 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)
--2.5 E(gree Gauss-Kruger CM 90E)-.15 E(<esri2723> : Pulk)110.5 588 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 93E)
--.15 E(<esri2724> : Pulk)110.5 600 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 96E)-.15 E(<esri2725> : Pulk)
-110.5 612 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E
-(gree Gauss-Kruger CM 99E)-.15 E(<esri2726> : Pulk)110.5 624 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 102E)-.15 E
-(<esri2727> : Pulk)110.5 636 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)
--2.5 E(gree Gauss-Kruger CM 105E)-.15 E(<esri2728> : Pulk)110.5 648 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 108E)
--.15 E(<esri2729> : Pulk)110.5 660 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 111E)-.15 E(<esri2730> : Pulk)
-110.5 672 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E
-(gree Gauss-Kruger CM 114E)-.15 E(<esri2731> : Pulk)110.5 684 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 117E)-.15 E
-(<esri2732> : Pulk)110.5 696 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)
--2.5 E(gree Gauss-Kruger CM 120E)-.15 E(<esri2733> : Pulk)110.5 708 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 123E)
--.15 E(<esri2734> : Pulk)110.5 720 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 126E)-.15 E(MB-System 5.0)72 768
-Q(29 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E(100)180.545 E 0 Cg EP
-%%Page: 101 101
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<esri2735> : Pulk)110.5 84 Q -.15(ov)-.1 G 2.5
-(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 129E)-.15 E
-(<esri2736> : T)110.5 96 Q(ete / UTM zone 36S)-.7 E(<esri2737> : T)110.5
-108 Q(ete / UTM zone 37S)-.7 E(<esri2738> : Pulk)110.5 120 Q -.15(ov)-.1
-G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 132E)-.15 E
-(<esri2739> : Pulk)110.5 132 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)
--2.5 E(gree Gauss-Kruger CM 135E)-.15 E(<esri2740> : Pulk)110.5 144 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 138E)
--.15 E(<esri2741> : Pulk)110.5 156 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 141E)-.15 E(<esri2742> : Pulk)
-110.5 168 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E
-(gree Gauss-Kruger CM 144E)-.15 E(<esri2743> : Pulk)110.5 180 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 147E)-.15 E
-(<esri2744> : Pulk)110.5 192 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)
--2.5 E(gree Gauss-Kruger CM 150E)-.15 E(<esri2745> : Pulk)110.5 204 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 153E)
--.15 E(<esri2746> : Pulk)110.5 216 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 156E)-.15 E(<esri2747> : Pulk)
-110.5 228 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E
-(gree Gauss-Kruger CM 159E)-.15 E(<esri2748> : Pulk)110.5 240 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 162E)-.15 E
-(<esri2749> : Pulk)110.5 252 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)
--2.5 E(gree Gauss-Kruger CM 165E)-.15 E(<esri2750> : Pulk)110.5 264 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 168E)
--.15 E(<esri2751> : Pulk)110.5 276 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 171E)-.15 E(<esri2752> : Pulk)
-110.5 288 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E
-(gree Gauss-Kruger CM 174E)-.15 E(<esri2753> : Pulk)110.5 300 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 177E)-.15 E
-(<esri2754> : Pulk)110.5 312 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)
--2.5 E(gree Gauss-Kruger CM 180E)-.15 E(<esri2755> : Pulk)110.5 324 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 177W)
--.15 E(<esri2756> : Pulk)110.5 336 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 174W)-.15 E(<esri2757> : Pulk)
-110.5 348 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E
-(gree Gauss-Kruger CM 171W)-.15 E(<esri2758> : Pulk)110.5 360 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 168W)-.15 E
-(<esri2759> : N)110.5 372 Q(AD83\(HARN\) / Alabama East)-.35 E
-(<esri2760> : N)110.5 384 Q(AD83\(HARN\) / Alabama W)-.35 E(est)-.8 E
-(<esri2761> : N)110.5 396 Q(AD83\(HARN\) / Arizona East)-.35 E
-(<esri2762> : N)110.5 408 Q(AD83\(HARN\) / Arizona Central)-.35 E
-(<esri2763> : N)110.5 420 Q(AD83\(HARN\) / Arizona W)-.35 E(est)-.8 E
-(<esri2764> : N)110.5 432 Q(AD83\(HARN\) / Arkansas North)-.35 E
-(<esri2765> : N)110.5 444 Q(AD83\(HARN\) / Arkansas South)-.35 E
-(<esri2766> : N)110.5 456 Q(AD83\(HARN\) / California zone 1)-.35 E
-(<esri2767> : N)110.5 468 Q(AD83\(HARN\) / California zone 2)-.35 E
-(<esri2768> : N)110.5 480 Q(AD83\(HARN\) / California zone 3)-.35 E
-(<esri2769> : N)110.5 492 Q(AD83\(HARN\) / California zone 4)-.35 E
-(<esri2770> : N)110.5 504 Q(AD83\(HARN\) / California zone 5)-.35 E
-(<esri2771> : N)110.5 516 Q(AD83\(HARN\) / California zone 6)-.35 E
-(<esri2772> : N)110.5 528 Q(AD83\(HARN\) / Colorado North)-.35 E
-(<esri2773> : N)110.5 540 Q(AD83\(HARN\) / Colorado Central)-.35 E
-(<esri2774> : N)110.5 552 Q(AD83\(HARN\) / Colorado South)-.35 E
-(<esri2775> : N)110.5 564 Q(AD83\(HARN\) / Connecticut)-.35 E
-(<esri2776> : N)110.5 576 Q(AD83\(HARN\) / Dela)-.35 E -.1(wa)-.15 G(re)
-.1 E(<esri2777> : N)110.5 588 Q(AD83\(HARN\) / Florida East)-.35 E
-(<esri2778> : N)110.5 600 Q(AD83\(HARN\) / Florida W)-.35 E(est)-.8 E
-(<esri2779> : N)110.5 612 Q(AD83\(HARN\) / Florida North)-.35 E
-(<esri2780> : N)110.5 624 Q(AD83\(HARN\) / Geor)-.35 E(gia East)-.18 E
-(<esri2781> : N)110.5 636 Q(AD83\(HARN\) / Geor)-.35 E(gia W)-.18 E(est)
--.8 E(<esri2782> : N)110.5 648 Q(AD83\(HARN\) / Ha)-.35 E -.1(wa)-.15 G
-(ii zone 1).1 E(<esri2783> : N)110.5 660 Q(AD83\(HARN\) / Ha)-.35 E -.1
-(wa)-.15 G(ii zone 2).1 E(<esri2784> : N)110.5 672 Q(AD83\(HARN\) / Ha)
--.35 E -.1(wa)-.15 G(ii zone 3).1 E(<esri2785> : N)110.5 684 Q
-(AD83\(HARN\) / Ha)-.35 E -.1(wa)-.15 G(ii zone 4).1 E(<esri2786> : N)
-110.5 696 Q(AD83\(HARN\) / Ha)-.35 E -.1(wa)-.15 G(ii zone 5).1 E
-(<esri2787> : N)110.5 708 Q(AD83\(HARN\) / Idaho East)-.35 E
-(<esri2788> : N)110.5 720 Q(AD83\(HARN\) / Idaho Central)-.35 E
-(MB-System 5.0)72 768 Q(29 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E
-(101)180.545 E 0 Cg EP
-%%Page: 102 102
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<esri2789> : N)110.5 84 Q(AD83\(HARN\) / Idaho W)
--.35 E(est)-.8 E(<esri2790> : N)110.5 96 Q(AD83\(HARN\) / Illinois East)
--.35 E(<esri2791> : N)110.5 108 Q(AD83\(HARN\) / Illinois W)-.35 E(est)
--.8 E(<esri2792> : N)110.5 120 Q(AD83\(HARN\) / Indiana East)-.35 E
-(<esri2793> : N)110.5 132 Q(AD83\(HARN\) / Indiana W)-.35 E(est)-.8 E
-(<esri2794> : N)110.5 144 Q(AD83\(HARN\) / Io)-.35 E .2 -.1(wa N)-.25 H
-(orth).1 E(<esri2795> : N)110.5 156 Q(AD83\(HARN\) / Io)-.35 E .2 -.1
-(wa S)-.25 H(outh).1 E(<esri2796> : N)110.5 168 Q
-(AD83\(HARN\) / Kansas North)-.35 E(<esri2797> : N)110.5 180 Q
-(AD83\(HARN\) / Kansas South)-.35 E(<esri2798> : N)110.5 192 Q
-(AD83\(HARN\) / K)-.35 E(entuck)-.25 E 2.5(yN)-.15 G(orth)-2.5 E
-(<esri2799> : N)110.5 204 Q(AD83\(HARN\) / K)-.35 E(entuck)-.25 E 2.5
-(yS)-.15 G(outh)-2.5 E(<esri2800> : N)110.5 216 Q
-(AD83\(HARN\) / Louisiana North)-.35 E(<esri2801> : N)110.5 228 Q
-(AD83\(HARN\) / Louisiana South)-.35 E(<esri2802> : N)110.5 240 Q
-(AD83\(HARN\) / Maine East)-.35 E(<esri2803> : N)110.5 252 Q
-(AD83\(HARN\) / Maine W)-.35 E(est)-.8 E(<esri2804> : N)110.5 264 Q
-(AD83\(HARN\) / Maryland)-.35 E(<esri2805> : N)110.5 276 Q
-(AD83\(HARN\) / Massachusetts Mainland)-.35 E(<esri2806> : N)110.5 288 Q
-(AD83\(HARN\) / Massachusetts Island)-.35 E(<esri2807> : N)110.5 300 Q
-(AD83\(HARN\) / Michig)-.35 E(an North)-.05 E(<esri2808> : N)110.5 312 Q
-(AD83\(HARN\) / Michig)-.35 E(an Central)-.05 E(<esri2809> : N)110.5 324
-Q(AD83\(HARN\) / Michig)-.35 E(an South)-.05 E(<esri2810> : N)110.5 336
-Q(AD83\(HARN\) / Minnesota North)-.35 E(<esri2811> : N)110.5 348 Q
-(AD83\(HARN\) / Minnesota Central)-.35 E(<esri2812> : N)110.5 360 Q
-(AD83\(HARN\) / Minnesota South)-.35 E(<esri2813> : N)110.5 372 Q
-(AD83\(HARN\) / Mississippi East)-.35 E(<esri2814> : N)110.5 384 Q
-(AD83\(HARN\) / Mississippi W)-.35 E(est)-.8 E(<esri2815> : N)110.5 396
-Q(AD83\(HARN\) / Missouri East)-.35 E(<esri2816> : N)110.5 408 Q
-(AD83\(HARN\) / Missouri Central)-.35 E(<esri2817> : N)110.5 420 Q
-(AD83\(HARN\) / Missouri W)-.35 E(est)-.8 E(<esri2818> : N)110.5 432 Q
-(AD83\(HARN\) / Montana)-.35 E(<esri2819> : N)110.5 444 Q
-(AD83\(HARN\) / Nebraska)-.35 E(<esri2820> : N)110.5 456 Q
-(AD83\(HARN\) / Ne)-.35 E -.25(va)-.25 G(da East).25 E(<esri2821> : N)
-110.5 468 Q(AD83\(HARN\) / Ne)-.35 E -.25(va)-.25 G(da Central).25 E
-(<esri2822> : N)110.5 480 Q(AD83\(HARN\) / Ne)-.35 E -.25(va)-.25 G
-(da W).25 E(est)-.8 E(<esri2823> : N)110.5 492 Q(AD83\(HARN\) / Ne)-.35
-E 2.5(wH)-.25 G(ampshire)-2.5 E(<esri2824> : N)110.5 504 Q
-(AD83\(HARN\) / Ne)-.35 E 2.5(wJ)-.25 G(erse)-2.5 E(y)-.15 E
-(<esri2825> : N)110.5 516 Q(AD83\(HARN\) / Ne)-.35 E 2.5(wM)-.25 G -.15
-(ex)-2.5 G(ico East).15 E(<esri2826> : N)110.5 528 Q(AD83\(HARN\) / Ne)
--.35 E 2.5(wM)-.25 G -.15(ex)-2.5 G(ico Central).15 E(<esri2827> : N)
-110.5 540 Q(AD83\(HARN\) / Ne)-.35 E 2.5(wM)-.25 G -.15(ex)-2.5 G(ico W)
-.15 E(est)-.8 E(<esri2828> : N)110.5 552 Q(AD83\(HARN\) / Ne)-.35 E 2.5
-(wY)-.25 G(ork East)-3.6 E(<esri2829> : N)110.5 564 Q(AD83\(HARN\) / Ne)
--.35 E 2.5(wY)-.25 G(ork Central)-3.6 E(<esri2830> : N)110.5 576 Q
-(AD83\(HARN\) / Ne)-.35 E 2.5(wY)-.25 G(ork W)-3.6 E(est)-.8 E
-(<esri2831> : N)110.5 588 Q(AD83\(HARN\) / Ne)-.35 E 2.5(wY)-.25 G
-(ork Long Island)-3.6 E(<esri2832> : N)110.5 600 Q
-(AD83\(HARN\) / North Dak)-.35 E(ota North)-.1 E(<esri2833> : N)110.5
-612 Q(AD83\(HARN\) / North Dak)-.35 E(ota South)-.1 E(<esri2834> : N)
-110.5 624 Q(AD83\(HARN\) / Ohio North)-.35 E(<esri2835> : N)110.5 636 Q
-(AD83\(HARN\) / Ohio South)-.35 E(<esri2836> : N)110.5 648 Q
-(AD83\(HARN\) / Oklahoma North)-.35 E(<esri2837> : N)110.5 660 Q
-(AD83\(HARN\) / Oklahoma South)-.35 E(<esri2838> : N)110.5 672 Q
-(AD83\(HARN\) / Ore)-.35 E(gon North)-.15 E(<esri2839> : N)110.5 684 Q
-(AD83\(HARN\) / Ore)-.35 E(gon South)-.15 E(<esri2840> : N)110.5 696 Q
-(AD83\(HARN\) / Rhode Island)-.35 E(<esri2841> : N)110.5 708 Q
-(AD83\(HARN\) / South Dak)-.35 E(ota North)-.1 E(<esri2842> : N)110.5
-720 Q(AD83\(HARN\) / South Dak)-.35 E(ota South)-.1 E(MB-System 5.0)72
-768 Q(29 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E(102)180.545 E 0 Cg
-EP
-%%Page: 103 103
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<esri2843> : N)110.5 84 Q(AD83\(HARN\) / T)-.35 E
-(ennessee)-.7 E(<esri2844> : N)110.5 96 Q(AD83\(HARN\) / T)-.35 E -.15
-(ex)-.7 G(as North).15 E(<esri2845> : N)110.5 108 Q(AD83\(HARN\) / T)
--.35 E -.15(ex)-.7 G(as North Central).15 E(<esri2846> : N)110.5 120 Q
-(AD83\(HARN\) / T)-.35 E -.15(ex)-.7 G(as Central).15 E(<esri2847> : N)
-110.5 132 Q(AD83\(HARN\) / T)-.35 E -.15(ex)-.7 G(as South Central).15 E
-(<esri2848> : N)110.5 144 Q(AD83\(HARN\) / T)-.35 E -.15(ex)-.7 G
-(as South).15 E(<esri2849> : N)110.5 156 Q(AD83\(HARN\) / Utah North)
--.35 E(<esri2850> : N)110.5 168 Q(AD83\(HARN\) / Utah Central)-.35 E
-(<esri2851> : N)110.5 180 Q(AD83\(HARN\) / Utah South)-.35 E
-(<esri2852> : N)110.5 192 Q(AD83\(HARN\) / V)-.35 E(ermont)-1.11 E
-(<esri2853> : N)110.5 204 Q(AD83\(HARN\) / V)-.35 E(ir)-.6 E
-(ginia North)-.18 E(<esri2854> : N)110.5 216 Q(AD83\(HARN\) / V)-.35 E
-(ir)-.6 E(ginia South)-.18 E(<esri2855> : N)110.5 228 Q
-(AD83\(HARN\) / W)-.35 E(ashington North)-.8 E(<esri2856> : N)110.5 240
-Q(AD83\(HARN\) / W)-.35 E(ashington South)-.8 E(<esri2857> : N)110.5 252
-Q(AD83\(HARN\) / W)-.35 E(est V)-.8 E(ir)-.6 E(ginia North)-.18 E
-(<esri2858> : N)110.5 264 Q(AD83\(HARN\) / W)-.35 E(est V)-.8 E(ir)-.6 E
-(ginia South)-.18 E(<esri2859> : N)110.5 276 Q(AD83\(HARN\) / W)-.35 E
-(isconsin North)-.4 E(<esri2860> : N)110.5 288 Q(AD83\(HARN\) / W)-.35 E
-(isconsin Central)-.4 E(<esri2861> : N)110.5 300 Q(AD83\(HARN\) / W)-.35
-E(isconsin South)-.4 E(<esri2862> : N)110.5 312 Q(AD83\(HARN\) / W)-.35
-E(yoming East)-.73 E(<esri2863> : N)110.5 324 Q(AD83\(HARN\) / W)-.35 E
-(yoming East Central)-.73 E(<esri2864> : N)110.5 336 Q(AD83\(HARN\) / W)
--.35 E(yoming W)-.73 E(est Central)-.8 E(<esri2865> : N)110.5 348 Q
-(AD83\(HARN\) / W)-.35 E(yoming W)-.73 E(est)-.8 E(<esri2866> : N)110.5
-360 Q(AD83\(HARN\) / Puerto Rico & V)-.35 E(ir)-.6 E(gin Is.)-.18 E
-(<esri2867> : N)110.5 372 Q(AD83\(HARN\) / Arizona East \(ft\))-.35 E
-(<esri2868> : N)110.5 384 Q(AD83\(HARN\) / Arizona Central \(ft\))-.35 E
-(<esri2869> : N)110.5 396 Q(AD83\(HARN\) / Arizona W)-.35 E(est \(ft\))
--.8 E(<esri2870> : N)110.5 408 Q
-(AD83\(HARN\) / California zone 1 \(ftUS\))-.35 E(<esri2871> : N)110.5
-420 Q(AD83\(HARN\) / California zone 2 \(ftUS\))-.35 E(<esri2872> : N)
-110.5 432 Q(AD83\(HARN\) / California zone 3 \(ftUS\))-.35 E
-(<esri2873> : N)110.5 444 Q(AD83\(HARN\) / California zone 4 \(ftUS\))
--.35 E(<esri2874> : N)110.5 456 Q
-(AD83\(HARN\) / California zone 5 \(ftUS\))-.35 E(<esri2875> : N)110.5
-468 Q(AD83\(HARN\) / California zone 6 \(ftUS\))-.35 E(<esri2876> : N)
-110.5 480 Q(AD83\(HARN\) / Colorado North \(ftUS\))-.35 E
-(<esri2877> : N)110.5 492 Q(AD83\(HARN\) / Colorado Central \(ftUS\))
--.35 E(<esri2878> : N)110.5 504 Q
-(AD83\(HARN\) / Colorado South \(ftUS\))-.35 E(<esri2879> : N)110.5 516
-Q(AD83\(HARN\) / Connecticut \(ftUS\))-.35 E(<esri2880> : N)110.5 528 Q
-(AD83\(HARN\) / Dela)-.35 E -.1(wa)-.15 G(re \(ftUS\)).1 E
-(<esri2881> : N)110.5 540 Q(AD83\(HARN\) / Florida East \(ftUS\))-.35 E
-(<esri2882> : N)110.5 552 Q(AD83\(HARN\) / Florida W)-.35 E
-(est \(ftUS\))-.8 E(<esri2883> : N)110.5 564 Q
-(AD83\(HARN\) / Florida North \(ftUS\))-.35 E(<esri2884> : N)110.5 576 Q
-(AD83\(HARN\) / Geor)-.35 E(gia East \(ftUS\))-.18 E(<esri2885> : N)
-110.5 588 Q(AD83\(HARN\) / Geor)-.35 E(gia W)-.18 E(est \(ftUS\))-.8 E
-(<esri2886> : N)110.5 600 Q(AD83\(HARN\) / Idaho East \(ftUS\))-.35 E
-(<esri2887> : N)110.5 612 Q(AD83\(HARN\) / Idaho Central \(ftUS\))-.35 E
-(<esri2888> : N)110.5 624 Q(AD83\(HARN\) / Idaho W)-.35 E(est \(ftUS\))
--.8 E(<esri2889> : N)110.5 636 Q(AD83\(HARN\) / Indiana East \(ftUS\))
--.35 E(<esri2890> : N)110.5 648 Q(AD83\(HARN\) / Indiana W)-.35 E
-(est \(ftUS\))-.8 E(<esri2891> : N)110.5 660 Q(AD83\(HARN\) / K)-.35 E
-(entuck)-.25 E 2.5(yN)-.15 G(orth \(ftUS\))-2.5 E(<esri2892> : N)110.5
-672 Q(AD83\(HARN\) / K)-.35 E(entuck)-.25 E 2.5(yS)-.15 G(outh \(ftUS\))
--2.5 E(<esri2893> : N)110.5 684 Q(AD83\(HARN\) / Maryland \(ftUS\))-.35
-E(<esri2894> : N)110.5 696 Q
-(AD83\(HARN\) / Massachusetts Mainland \(ftUS\))-.35 E(<esri2895> : N)
-110.5 708 Q(AD83\(HARN\) / Massachusetts Island \(ftUS\))-.35 E
-(<esri2896> : N)110.5 720 Q(AD83\(HARN\) / Michig)-.35 E
-(an North \(ft\))-.05 E(MB-System 5.0)72 768 Q(29 No)132.205 E -.15(ve)
--.15 G(mber 2014).15 E(103)180.545 E 0 Cg EP
-%%Page: 104 104
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<esri2897> : N)110.5 84 Q(AD83\(HARN\) / Michig)
--.35 E(an Central \(ft\))-.05 E(<esri2898> : N)110.5 96 Q
-(AD83\(HARN\) / Michig)-.35 E(an South \(ft\))-.05 E(<esri2899> : N)
-110.5 108 Q(AD83\(HARN\) / Mississippi East \(ftUS\))-.35 E
-(<esri2900> : N)110.5 120 Q(AD83\(HARN\) / Mississippi W)-.35 E
-(est \(ftUS\))-.8 E(<esri2901> : N)110.5 132 Q
-(AD83\(HARN\) / Montana \(ft\))-.35 E(<esri2902> : N)110.5 144 Q
-(AD83\(HARN\) / Ne)-.35 E 2.5(wM)-.25 G -.15(ex)-2.5 G
-(ico East \(ftUS\)).15 E(<esri2903> : N)110.5 156 Q(AD83\(HARN\) / Ne)
--.35 E 2.5(wM)-.25 G -.15(ex)-2.5 G(ico Central \(ftUS\)).15 E
-(<esri2904> : N)110.5 168 Q(AD83\(HARN\) / Ne)-.35 E 2.5(wM)-.25 G -.15
-(ex)-2.5 G(ico W).15 E(est \(ftUS\))-.8 E(<esri2905> : N)110.5 180 Q
-(AD83\(HARN\) / Ne)-.35 E 2.5(wY)-.25 G(ork East \(ftUS\))-3.6 E
-(<esri2906> : N)110.5 192 Q(AD83\(HARN\) / Ne)-.35 E 2.5(wY)-.25 G
-(ork Central \(ftUS\))-3.6 E(<esri2907> : N)110.5 204 Q
-(AD83\(HARN\) / Ne)-.35 E 2.5(wY)-.25 G(ork W)-3.6 E(est \(ftUS\))-.8 E
-(<esri2908> : N)110.5 216 Q(AD83\(HARN\) / Ne)-.35 E 2.5(wY)-.25 G
-(ork Long Island \(ftUS\))-3.6 E(<esri2909> : N)110.5 228 Q
-(AD83\(HARN\) / North Dak)-.35 E(ota North \(ft\))-.1 E(<esri2910> : N)
-110.5 240 Q(AD83\(HARN\) / North Dak)-.35 E(ota South \(ft\))-.1 E
-(<esri2911> : N)110.5 252 Q(AD83\(HARN\) / Oklahoma North \(ftUS\))-.35
-E(<esri2912> : N)110.5 264 Q(AD83\(HARN\) / Oklahoma South \(ftUS\))-.35
-E(<esri2913> : N)110.5 276 Q(AD83\(HARN\) / Ore)-.35 E(gon North \(ft\))
--.15 E(<esri2914> : N)110.5 288 Q(AD83\(HARN\) / Ore)-.35 E
-(gon South \(ft\))-.15 E(<esri2915> : N)110.5 300 Q(AD83\(HARN\) / T)
--.35 E(ennessee \(ftUS\))-.7 E(<esri2916> : N)110.5 312 Q
-(AD83\(HARN\) / T)-.35 E -.15(ex)-.7 G(as North \(ftUS\)).15 E
-(<esri2917> : N)110.5 324 Q(AD83\(HARN\) / T)-.35 E -.15(ex)-.7 G
-(as North Central \(ftUS\)).15 E(<esri2918> : N)110.5 336 Q
-(AD83\(HARN\) / T)-.35 E -.15(ex)-.7 G(as Central \(ftUS\)).15 E
-(<esri2919> : N)110.5 348 Q(AD83\(HARN\) / T)-.35 E -.15(ex)-.7 G
-(as South Central \(ftUS\)).15 E(<esri2920> : N)110.5 360 Q
-(AD83\(HARN\) / T)-.35 E -.15(ex)-.7 G(as South \(ftUS\)).15 E
-(<esri2921> : N)110.5 372 Q(AD83\(HARN\) / Utah North \(ft\))-.35 E
-(<esri2922> : N)110.5 384 Q(AD83\(HARN\) / Utah Central \(ft\))-.35 E
-(<esri2923> : N)110.5 396 Q(AD83\(HARN\) / Utah South \(ft\))-.35 E
-(<esri2924> : N)110.5 408 Q(AD83\(HARN\) / V)-.35 E(ir)-.6 E
-(ginia North \(ftUS\))-.18 E(<esri2925> : N)110.5 420 Q
-(AD83\(HARN\) / V)-.35 E(ir)-.6 E(ginia South \(ftUS\))-.18 E
-(<esri2926> : N)110.5 432 Q(AD83\(HARN\) / W)-.35 E
-(ashington North \(ftUS\))-.8 E(<esri2927> : N)110.5 444 Q
-(AD83\(HARN\) / W)-.35 E(ashington South \(ftUS\))-.8 E(<esri2928> : N)
-110.5 456 Q(AD83\(HARN\) / W)-.35 E(isconsin North \(ftUS\))-.4 E
-(<esri2929> : N)110.5 468 Q(AD83\(HARN\) / W)-.35 E
-(isconsin Central \(ftUS\))-.4 E(<esri2930> : N)110.5 480 Q
-(AD83\(HARN\) / W)-.35 E(isconsin South \(ftUS\))-.4 E
-(<esri2931> : Beduaram / TM 13 NE)110.5 492 Q
-(<esri2932> : QND95 / Qatar National Grid)110.5 504 Q(<esri2933> : Se)
-110.5 516 Q -.05(ga)-.15 G(ra / UTM zone 50S).05 E(<esri2934> : Se)110.5
-528 Q -.05(ga)-.15 G(ra \(Jakarta\) / NEIEZ).05 E(<esri2935> : Pulk)
-110.5 540 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / CS63 zone A1)-2.5 E
-(<esri2936> : Pulk)110.5 552 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / CS63 zone A2)-2.5 E(<esri2937> : Pulk)110.5 564 Q -.15(ov)-.1 G
-2.5(o1)-.05 G(942 / CS63 zone A3)-2.5 E(<esri2938> : Pulk)110.5 576 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(942 / CS63 zone A4)-2.5 E(<esri2939> : Pulk)
-110.5 588 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / CS63 zone K2)-2.5 E
-(<esri2940> : Pulk)110.5 600 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / CS63 zone K3)-2.5 E(<esri2941> : Pulk)110.5 612 Q -.15(ov)-.1 G
-2.5(o1)-.05 G(942 / CS63 zone K4)-2.5 E
-(<esri2942> : Porto Santo / UTM zone 28N)110.5 624 Q(<esri2943> : Selv)
-110.5 636 Q(agem Grande / UTM zone 28N)-.25 E(<esri2944> : N)110.5 648 Q
-(AD83\(CSRS\) / SCoPQ zone 2)-.35 E(<esri2945> : N)110.5 660 Q
-(AD83\(CSRS\) / MTM zone 3)-.35 E(<esri2946> : N)110.5 672 Q
-(AD83\(CSRS\) / MTM zone 4)-.35 E(<esri2947> : N)110.5 684 Q
-(AD83\(CSRS\) / MTM zone 5)-.35 E(<esri2948> : N)110.5 696 Q
-(AD83\(CSRS\) / MTM zone 6)-.35 E(<esri2949> : N)110.5 708 Q
-(AD83\(CSRS\) / MTM zone 7)-.35 E(<esri2950> : N)110.5 720 Q
-(AD83\(CSRS\) / MTM zone 8)-.35 E(MB-System 5.0)72 768 Q(29 No)132.205 E
--.15(ve)-.15 G(mber 2014).15 E(104)180.545 E 0 Cg EP
-%%Page: 105 105
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<esri2951> : N)110.5 84 Q
-(AD83\(CSRS\) / MTM zone 9)-.35 E(<esri2952> : N)110.5 96 Q
-(AD83\(CSRS\) / MTM zone 10)-.35 E(<esri2953> : N)110.5 108 Q
-(AD83\(CSRS\) / Ne)-.35 E 2.5(wB)-.25 G(runswick Stereo)-2.5 E
-(<esri2954> : N)110.5 120 Q(AD83\(CSRS\) / Prince Edw)-.35 E
-(ard Isl. Stereographic \(N)-.1 E(AD83\))-.35 E(<esri2955> : N)110.5 132
-Q(AD83\(CSRS\) / UTM zone 11N)-.35 E(<esri2956> : N)110.5 144 Q
-(AD83\(CSRS\) / UTM zone 12N)-.35 E(<esri2957> : N)110.5 156 Q
-(AD83\(CSRS\) / UTM zone 13N)-.35 E(<esri2958> : N)110.5 168 Q
-(AD83\(CSRS\) / UTM zone 17N)-.35 E(<esri2959> : N)110.5 180 Q
-(AD83\(CSRS\) / UTM zone 18N)-.35 E(<esri2960> : N)110.5 192 Q
-(AD83\(CSRS\) / UTM zone 19N)-.35 E(<esri2961> : N)110.5 204 Q
-(AD83\(CSRS\) / UTM zone 20N)-.35 E(<esri2962> : N)110.5 216 Q
-(AD83\(CSRS\) / UTM zone 21N)-.35 E(<esri3036> : Moznet / UTM zone 36S)
-110.5 228 Q(<esri3037> : Moznet / UTM zone 37S)110.5 240 Q
-(<esri3148> : Indian 1960 / UTM zone 48N)110.5 252 Q
-(<esri3149> : Indian 1960 / UTM zone 49N)110.5 264 Q
-(<esri3176> : Indian 1960 / TM 106 NE)110.5 276 Q
-(<esri3200> : FD58 / Iraq zone)110.5 288 Q
-(<esri3300> : Estonian Coordinate System of 1992)110.5 300 Q
-(<esri3301> : Estonian Coordinate System of 1997)110.5 312 Q
-(<esri3439> : PSD93 / UTM zone 39N)110.5 324 Q
-(<esri3440> : PSD93 / UTM zone 40N)110.5 336 Q(<esri3561> : Old Ha)110.5
-348 Q -.1(wa)-.15 G(iian / Ha).1 E -.1(wa)-.15 G(ii zone 1).1 E
-(<esri3562> : Old Ha)110.5 360 Q -.1(wa)-.15 G(iian / Ha).1 E -.1(wa)
--.15 G(ii zone 2).1 E(<esri3563> : Old Ha)110.5 372 Q -.1(wa)-.15 G
-(iian / Ha).1 E -.1(wa)-.15 G(ii zone 3).1 E(<esri3564> : Old Ha)110.5
-384 Q -.1(wa)-.15 G(iian / Ha).1 E -.1(wa)-.15 G(ii zone 4).1 E
-(<esri3565> : Old Ha)110.5 396 Q -.1(wa)-.15 G(iian / Ha).1 E -.1(wa)
--.15 G(ii zone 5).1 E(<esri3920> : Puerto Rico / UTM zone 20N)110.5 408
-Q(<esri3991> : Puerto Rico State Plane CS of 1927)110.5 420 Q
-(<esri3992> : Puerto Rico / St. Croix)110.5 432 Q(<esri4001> : Unkno)
-110.5 444 Q(wn datum based upon the Airy 1830 ellipsoid)-.25 E
-(<esri4002> : Unkno)110.5 456 Q
-(wn datum based upon the Airy Modi\214ed 1849 ellipsoid)-.25 E
-(<esri4003> : Unkno)110.5 468 Q
-(wn datum based upon the Australian National Spheroid)-.25 E
-(<esri4004> : Unkno)110.5 480 Q
-(wn datum based upon the Bessel 1841 ellipsoid)-.25 E
-(<esri4005> : Unkno)110.5 492 Q
-(wn datum based upon the Bessel Modi\214ed ellipsoid)-.25 E
-(<esri4006> : Unkno)110.5 504 Q
-(wn datum based upon the Bessel Namibia ellipsoid)-.25 E
-(<esri4007> : Unkno)110.5 516 Q(wn datum based upon the Clark)-.25 E 2.5
-(e1)-.1 G(858 ellipsoid)-2.5 E(<esri4008> : Unkno)110.5 528 Q
-(wn datum based upon the Clark)-.25 E 2.5(e1)-.1 G(866 ellipsoid)-2.5 E
-(<esri4009> : Unkno)110.5 540 Q(wn datum based upon the Clark)-.25 E 2.5
-(e1)-.1 G(866 Michig)-2.5 E(an ellipsoid)-.05 E(<esri4010> : Unkno)110.5
-552 Q(wn datum based upon the Clark)-.25 E 2.5(e1)-.1 G
-(880 \(Benoit\) ellipsoid)-2.5 E(<esri4011> : Unkno)110.5 564 Q
-(wn datum based upon the Clark)-.25 E 2.5(e1)-.1 G
-(880 \(IGN\) ellipsoid)-2.5 E(<esri4012> : Unkno)110.5 576 Q
-(wn datum based upon the Clark)-.25 E 2.5(e1)-.1 G
-(880 \(RGS\) ellipsoid)-2.5 E(<esri4013> : Unkno)110.5 588 Q
-(wn datum based upon the Clark)-.25 E 2.5(e1)-.1 G
-(880 \(Arc\) ellipsoid)-2.5 E(<esri4014> : Unkno)110.5 600 Q
-(wn datum based upon the Clark)-.25 E 2.5(e1)-.1 G
-(880 \(SGA 1922\) ellipsoid)-2.5 E(<esri4015> : Unkno)110.5 612 Q
-(wn datum based upon the Ev)-.25 E
-(erest 1830 \(1937 Adjustment\) ellipsoid)-.15 E(<esri4016> : Unkno)
-110.5 624 Q(wn datum based upon the Ev)-.25 E
-(erest 1830 \(1967 De\214nition\) ellipsoid)-.15 E(<esri4018> : Unkno)
-110.5 636 Q(wn datum based upon the Ev)-.25 E
-(erest 1830 Modi\214ed ellipsoid)-.15 E(<esri4019> : Unkno)110.5 648 Q
-(wn datum based upon the GRS 1980 ellipsoid)-.25 E(<esri4020> : Unkno)
-110.5 660 Q(wn datum based upon the Helmert 1906 ellipsoid)-.25 E
-(<esri4021> : Unkno)110.5 672 Q
-(wn datum based upon the Indonesian National Spheroid)-.25 E
-(<esri4022> : Unkno)110.5 684 Q
-(wn datum based upon the International 1924 ellipsoid)-.25 E
-(<esri4024> : Unkno)110.5 696 Q(wn datum based upon the Krasso)-.25 E
-(wsk)-.25 E 2.5(y1)-.15 G(940 ellipsoid)-2.5 E(<esri4025> : Unkno)110.5
-708 Q(wn datum based upon the NWL 9D ellipsoid)-.25 E
-(<esri4027> : Unkno)110.5 720 Q
-(wn datum based upon the Plessis 1817 ellipsoid)-.25 E(MB-System 5.0)72
-768 Q(29 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E(105)180.545 E 0 Cg
-EP
-%%Page: 106 106
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<esri4028> : Unkno)110.5 84 Q
-(wn datum based upon the Struv)-.25 E 2.5(e1)-.15 G(860 ellipsoid)-2.5 E
-(<esri4029> : Unkno)110.5 96 Q(wn datum based upon the W)-.25 E(ar Of)
--.8 E(\214ce ellipsoid)-.25 E(<esri4030> : Unkno)110.5 108 Q
-(wn datum based upon the WGS 84 ellipsoid)-.25 E(<esri4031> : Unkno)
-110.5 120 Q(wn datum based upon the GEM 10C ellipsoid)-.25 E
-(<esri4032> : Unkno)110.5 132 Q
-(wn datum based upon the OSU86F ellipsoid)-.25 E(<esri4033> : Unkno)
-110.5 144 Q(wn datum based upon the OSU91A ellipsoid)-.25 E
-(<esri4034> : Unkno)110.5 156 Q(wn datum based upon the Clark)-.25 E 2.5
-(e1)-.1 G(880 ellipsoid)-2.5 E(<esri4035> : Unkno)110.5 168 Q
-(wn datum based upon the Authalic Sphere)-.25 E(<esri4036> : Unkno)110.5
-180 Q(wn datum based upon the GRS 1967 ellipsoid)-.25 E
-(<esri4041> : Unkno)110.5 192 Q(wn datum based upon the A)-.25 E -.15
-(ve)-.74 G(rage T).15 E(errestrial System 1977 ellipsoid)-.7 E
-(<esri4042> : Unkno)110.5 204 Q(wn datum based upon the Ev)-.25 E
-(erest \(1830 De\214nition\) ellipsoid)-.15 E(<esri4043> : Unkno)110.5
-216 Q(wn datum based upon the WGS 72 ellipsoid)-.25 E
-(<esri4044> : Unkno)110.5 228 Q(wn datum based upon the Ev)-.25 E
-(erest 1830 \(1962 De\214nition\) ellipsoid)-.15 E(<esri4045> : Unkno)
-110.5 240 Q(wn datum based upon the Ev)-.25 E
-(erest 1830 \(1975 De\214nition\) ellipsoid)-.15 E
-(<esri4047> : Unspeci\214ed based upon the GRS 1980 Authalic Sphere)
-110.5 252 Q(<esri4120> : Greek)110.5 264 Q(<esri4121> : GGRS87)110.5 276
-Q(<esri4122> : A)110.5 288 Q(TS77)-1.11 E(<esri4123> : KKJ)110.5 300 Q
-(<esri4124> : R)110.5 312 Q(T90)-.6 E(<esri4125> : Samboja)110.5 324 Q
-(<esri4126> : LKS94 \(ETRS89\))110.5 336 Q(<esri4127> : T)110.5 348 Q
-(ete)-.7 E(<esri4128> : Madzansua)110.5 360 Q(<esri4129> : Observ)110.5
-372 Q(atario)-.25 E(<esri4130> : Moznet)110.5 384 Q
-(<esri4131> : Indian 1960)110.5 396 Q(<esri4132> : FD58)110.5 408 Q
-(<esri4133> : EST92)110.5 420 Q(<esri4134> : PDO Surv)110.5 432 Q .3
--.15(ey D)-.15 H(atum 1993).15 E(<esri4135> : Old Ha)110.5 444 Q -.1(wa)
--.15 G(iian).1 E(<esri4136> : St. La)110.5 456 Q(wrence Island)-.15 E
-(<esri4137> : St. P)110.5 468 Q(aul Island)-.15 E(<esri4138> : St. Geor)
-110.5 480 Q(ge Island)-.18 E(<esri4139> : Puerto Rico)110.5 492 Q
-(<esri4140> : N)110.5 504 Q(AD83\(CSRS98\))-.35 E(<esri4141> : Israel)
-110.5 516 Q(<esri4142> : Locodjo 1965)110.5 528 Q
-(<esri4143> : Abidjan 1987)110.5 540 Q(<esri4144> : Kalianpur 1937)110.5
-552 Q(<esri4145> : Kalianpur 1962)110.5 564 Q
-(<esri4146> : Kalianpur 1975)110.5 576 Q(<esri4147> : Hanoi 1972)110.5
-588 Q(<esri4148> : Hartebeesthoek94)110.5 600 Q(<esri4149> : CH1903)
-110.5 612 Q(<esri4150> : CH1903+)110.5 624 Q(<esri4151> : CHTRF95)110.5
-636 Q(<esri4152> : N)110.5 648 Q(AD83\(HARN\))-.35 E
-(<esri4153> : Rassadiran)110.5 660 Q(<esri4154> : ED50\(ED77\))110.5 672
-Q(<esri4155> : Dabola 1981)110.5 684 Q(<esri4156> : S-JTSK)110.5 696 Q
-(<esri4157> : Mount Dillon)110.5 708 Q(<esri4158> : Naparima 1955)110.5
-720 Q(MB-System 5.0)72 768 Q(29 No)132.205 E -.15(ve)-.15 G(mber 2014)
-.15 E(106)180.545 E 0 Cg EP
-%%Page: 107 107
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<esri4159> : ELD79)110.5 84 Q
-(<esri4160> : Chos Malal 1914)110.5 96 Q(<esri4161> : P)110.5 108 Q
-(ampa del Castillo)-.15 E(<esri4162> : K)110.5 120 Q(orean 1985)-.35 E
-(<esri4163> : Y)110.5 132 Q(emen NGN96)-1 E(<esri4164> : South Y)110.5
-144 Q(emen)-1 E(<esri4165> : Bissau)110.5 156 Q(<esri4166> : K)110.5 168
-Q(orean 1995)-.35 E(<esri4167> : NZGD2000)110.5 180 Q
-(<esri4168> : Accra)110.5 192 Q(<esri4169> : American Samoa 1962)110.5
-204 Q(<esri4170> : SIRGAS)110.5 216 Q(<esri4171> : RGF93)110.5 228 Q
-(<esri4172> : POSGAR)110.5 240 Q(<esri4173> : IRENET95)110.5 252 Q
-(<esri4174> : Sierra Leone 1924)110.5 264 Q
-(<esri4175> : Sierra Leone 1968)110.5 276 Q
-(<esri4176> : Australian Antarctic)110.5 288 Q(<esri4178> : Pulk)110.5
-300 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942\(83\))-2.5 E(<esri4179> : Pulk)
-110.5 312 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942\(58\))-2.5 E
-(<esri4180> : EST97)110.5 324 Q(<esri4181> : Lux)110.5 336 Q(embour)-.15
-E 2.5(g1)-.18 G(930)-2.5 E(<esri4182> : Azores Occidental 1939)110.5 348
-Q(<esri4183> : Azores Central 1948)110.5 360 Q
-(<esri4184> : Azores Oriental 1940)110.5 372 Q
-(<esri4185> : Madeira 1936)110.5 384 Q(<esri4188> : OSNI 1952)110.5 396
-Q(<esri4189> : REGVEN)110.5 408 Q(<esri4190> : POSGAR 98)110.5 420 Q
-(<esri4191> : Albanian 1987)110.5 432 Q(<esri4192> : Douala 1948)110.5
-444 Q(<esri4193> : Manoca 1962)110.5 456 Q(<esri4194> : Qornoq 1927)
-110.5 468 Q(<esri4195> : Scoresbysund 1952)110.5 480 Q
-(<esri4196> : Ammassalik 1958)110.5 492 Q(<esri4197> : Garoua)110.5 504
-Q(<esri4198> : K)110.5 516 Q(ousseri)-.35 E(<esri4199> : Egypt 1930)
-110.5 528 Q(<esri4200> : Pulk)110.5 540 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995)-2.5 E(<esri4201> : Adindan)110.5 552 Q(<esri4202> : A)110.5 564 Q
-(GD66)-.4 E(<esri4203> : A)110.5 576 Q(GD84)-.4 E
-(<esri4204> : Ain el Abd)110.5 588 Q(<esri4205> : Afgoo)110.5 600 Q(ye)
--.1 E(<esri4206> : Ag)110.5 612 Q(adez)-.05 E(<esri4207> : Lisbon)110.5
-624 Q(<esri4208> : Aratu)110.5 636 Q(<esri4209> : Arc 1950)110.5 648 Q
-(<esri4210> : Arc 1960)110.5 660 Q(<esri4211> : Bata)110.5 672 Q(via)-.2
-E(<esri4212> : Barbados 1938)110.5 684 Q(<esri4213> : Beduaram)110.5 696
-Q(<esri4214> : Beijing 1954)110.5 708 Q(<esri4215> : Belge 1950)110.5
-720 Q(MB-System 5.0)72 768 Q(29 No)132.205 E -.15(ve)-.15 G(mber 2014)
-.15 E(107)180.545 E 0 Cg EP
-%%Page: 108 108
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<esri4216> : Bermuda 1957)110.5 84 Q
-(<esri4218> : Bogota 1975)110.5 96 Q(<esri4219> : Bukit Rimpah)110.5 108
-Q(<esri4220> : Camacupa)110.5 120 Q(<esri4221> : Campo Inchauspe)110.5
-132 Q(<esri4222> : Cape)110.5 144 Q(<esri4223> : Carthage)110.5 156 Q
-(<esri4224> : Chua)110.5 168 Q(<esri4225> : Corre)110.5 180 Q(go Ale)
--.15 E(gre)-.15 E(<esri4226> : Cote d'Iv)110.5 192 Q(oire)-.2 E
-(<esri4227> : Deir ez Zor)110.5 204 Q(<esri4228> : Douala)110.5 216 Q
-(<esri4229> : Egypt 1907)110.5 228 Q(<esri4230> : ED50)110.5 240 Q
-(<esri4231> : ED87)110.5 252 Q(<esri4232> : F)110.5 264 Q(ahud)-.15 E
-(<esri4233> : Gandajika 1970)110.5 276 Q(<esri4234> : Garoua)110.5 288 Q
-(<esri4235> : Guyane Francaise)110.5 300 Q(<esri4236> : Hu Tzu Shan)
-110.5 312 Q(<esri4237> : HD72)110.5 324 Q(<esri4238> : ID74)110.5 336 Q
-(<esri4239> : Indian 1954)110.5 348 Q(<esri4240> : Indian 1975)110.5 360
-Q(<esri4241> : Jamaica 1875)110.5 372 Q(<esri4242> : J)110.5 384 Q(AD69)
--.6 E(<esri4243> : Kalianpur 1880)110.5 396 Q(<esri4244> : Kanda)110.5
-408 Q -.1(wa)-.15 G(la).1 E(<esri4245> : K)110.5 420 Q(ertau)-.25 E
-(<esri4246> : K)110.5 432 Q(OC)-.3 E(<esri4247> : La Canoa)110.5 444 Q
-(<esri4248> : PSAD56)110.5 456 Q(<esri4249> : Lak)110.5 468 Q(e)-.1 E
-(<esri4250> : Leigon)110.5 480 Q(<esri4251> : Liberia 1964)110.5 492 Q
-(<esri4252> : Lome)110.5 504 Q(<esri4253> : Luzon 1911)110.5 516 Q
-(<esri4254> : Hito XVIII 1963)110.5 528 Q(<esri4255> : Herat North)110.5
-540 Q(<esri4256> : Mahe 1971)110.5 552 Q(<esri4257> : Makassar)110.5 564
-Q(<esri4258> : ETRS89)110.5 576 Q(<esri4259> : Malongo 1987)110.5 588 Q
-(<esri4260> : Manoca)110.5 600 Q(<esri4261> : Merchich)110.5 612 Q
-(<esri4262> : Massa)110.5 624 Q -.1(wa)-.15 G(<esri4263> : Minna)110.5
-636 Q(<esri4264> : Mhast)110.5 648 Q(<esri4265> : Monte Mario)110.5 660
-Q(<esri4266> : M'poralok)110.5 672 Q(o)-.1 E(<esri4267> : N)110.5 684 Q
-(AD27)-.35 E(<esri4268> : N)110.5 696 Q(AD27 Michig)-.35 E(an)-.05 E
-(<esri4269> : N)110.5 708 Q(AD83)-.35 E(<esri4270> : Nahrw)110.5 720 Q
-(an 1967)-.1 E(MB-System 5.0)72 768 Q(29 No)132.205 E -.15(ve)-.15 G
-(mber 2014).15 E(108)180.545 E 0 Cg EP
-%%Page: 109 109
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<esri4271> : Naparima 1972)110.5 84 Q
-(<esri4272> : NZGD49)110.5 96 Q(<esri4273> : NGO 1948)110.5 108 Q
-(<esri4274> : Datum 73)110.5 120 Q(<esri4275> : NTF)110.5 132 Q
-(<esri4276> : NSWC 9Z-2)110.5 144 Q(<esri4277> : OSGB 1936)110.5 156 Q
-(<esri4278> : OSGB70)110.5 168 Q(<esri4279> : OS\(SN\)80)110.5 180 Q
-(<esri4280> : P)110.5 192 Q(adang)-.15 E(<esri4281> : P)110.5 204 Q
-(alestine 1923)-.15 E(<esri4282> : Pointe Noire)110.5 216 Q
-(<esri4283> : GD)110.5 228 Q(A94)-.4 E(<esri4284> : Pulk)110.5 240 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(942)-2.5 E(<esri4285> : Qatar 1974)110.5 252
-Q(<esri4286> : Qatar 1948)110.5 264 Q(<esri4287> : Qornoq)110.5 276 Q
-(<esri4288> : Loma Quintana)110.5 288 Q(<esri4289> : Amersfoort)110.5
-300 Q(<esri4291> : SAD69)110.5 312 Q(<esri4292> : Sapper Hill 1943)110.5
-324 Q(<esri4293> : Schw)110.5 336 Q(arzeck)-.1 E(<esri4294> : Se)110.5
-348 Q(gora)-.15 E(<esri4295> : Serindung)110.5 360 Q(<esri4296> : Sudan)
-110.5 372 Q(<esri4297> : T)110.5 384 Q(ananari)-.8 E -.15(ve)-.25 G
-(<esri4298> : T)110.5 396 Q(imbalai 1948)-.35 E(<esri4299> : TM65)110.5
-408 Q(<esri4300> : TM75)110.5 420 Q(<esri4301> : T)110.5 432 Q(ok)-.8 E
-(yo)-.15 E(<esri4302> : T)110.5 444 Q(rinidad 1903)-.35 E
-(<esri4303> : TC\(1948\))110.5 456 Q(<esri4304> : V)110.5 468 Q
-(oirol 1875)-1.29 E(<esri4306> : Bern 1938)110.5 480 Q
-(<esri4307> : Nord Sahara 1959)110.5 492 Q(<esri4308> : R)110.5 504 Q
-(T38)-.6 E(<esri4309> : Y)110.5 516 Q(acare)-1 E(<esri4310> : Y)110.5
-528 Q(of)-1.1 E(f)-.25 E(<esri4311> : Zanderij)110.5 540 Q
-(<esri4312> : MGI)110.5 552 Q(<esri4313> : Belge 1972)110.5 564 Q
-(<esri4314> : DHDN)110.5 576 Q(<esri4315> : Conakry 1905)110.5 588 Q
-(<esri4316> : Dealul Piscului 1933)110.5 600 Q
-(<esri4317> : Dealul Piscului 1970)110.5 612 Q(<esri4318> : NGN)110.5
-624 Q(<esri4319> : KUD)110.5 636 Q(AMS)-.4 E(<esri4322> : WGS 72)110.5
-648 Q(<esri4324> : WGS 72BE)110.5 660 Q(<esri4326> : WGS 84)110.5 672 Q
-(<esri4600> : Anguilla 1957)110.5 684 Q(<esri4601> : Antigua 1943)110.5
-696 Q(<esri4602> : Dominica 1945)110.5 708 Q(<esri4603> : Grenada 1953)
-110.5 720 Q(MB-System 5.0)72 768 Q(29 No)132.205 E -.15(ve)-.15 G
-(mber 2014).15 E(109)180.545 E 0 Cg EP
-%%Page: 110 110
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<esri4604> : Montserrat 1958)110.5 84 Q
-(<esri4605> : St. Kitts 1955)110.5 96 Q(<esri4606> : St. Lucia 1955)
-110.5 108 Q(<esri4607> : St. V)110.5 120 Q(incent 1945)-.6 E
-(<esri4608> : N)110.5 132 Q(AD27\(76\))-.35 E(<esri4609> : N)110.5 144 Q
-(AD27\(CGQ77\))-.35 E(<esri4610> : Xian 1980)110.5 156 Q
-(<esri4611> : Hong K)110.5 168 Q(ong 1980)-.35 E(<esri4612> : JGD2000)
-110.5 180 Q(<esri4613> : Se)110.5 192 Q -.05(ga)-.15 G(ra).05 E
-(<esri4614> : QND95)110.5 204 Q(<esri4615> : Porto Santo)110.5 216 Q
-(<esri4616> : Selv)110.5 228 Q(agem Grande)-.25 E(<esri4617> : N)110.5
-240 Q(AD83\(CSRS\))-.35 E(<esri4801> : Bern 1898 \(Bern\))110.5 252 Q
-(<esri4802> : Bogota 1975 \(Bogota\))110.5 264 Q
-(<esri4803> : Lisbon \(Lisbon\))110.5 276 Q
-(<esri4804> : Makassar \(Jakarta\))110.5 288 Q
-(<esri4805> : MGI \(Ferro\))110.5 300 Q
-(<esri4806> : Monte Mario \(Rome\))110.5 312 Q(<esri4807> : NTF \(P)
-110.5 324 Q(aris\))-.15 E(<esri4808> : P)110.5 336 Q(adang \(Jakarta\))
--.15 E(<esri4809> : Belge 1950 \(Brussels\))110.5 348 Q(<esri4810> : T)
-110.5 360 Q(ananari)-.8 E .3 -.15(ve \()-.25 H -.15(Pa).15 G(ris\)).15 E
-(<esri4811> : V)110.5 372 Q(oirol 1875 \(P)-1.29 E(aris\))-.15 E
-(<esri4813> : Bata)110.5 384 Q(via \(Jakarta\))-.2 E(<esri4814> : R)
-110.5 396 Q(T38 \(Stockholm\))-.6 E(<esri4815> : Greek \(Athens\))110.5
-408 Q(<esri4816> : Carthage \(P)110.5 420 Q(aris\))-.15 E
-(<esri4817> : NGO 1948 \(Oslo\))110.5 432 Q
-(<esri4818> : S-JTSK \(Ferro\))110.5 444 Q
-(<esri4819> : Nord Sahara 1959 \(P)110.5 456 Q(aris\))-.15 E
-(<esri4820> : Se)110.5 468 Q -.05(ga)-.15 G(ra \(Jakarta\)).05 E
-(<esri4901> : A)110.5 480 Q(TF \(P)-1.11 E(aris\))-.15 E
-(<esri4902> : NDG \(P)110.5 492 Q(aris\))-.15 E
-(<esri4903> : Madrid 1870 \(Madrid\))110.5 504 Q
-(<esri4904> : Lisbon 1890 \(Lisbon\))110.5 516 Q(<esri20004> : Pulk)
-110.5 528 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger zone 4)-2.5 E
-(<esri20005> : Pulk)110.5 540 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger zone 5)-2.5 E(<esri20006> : Pulk)110.5 552 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger zone 6)-2.5 E
-(<esri20007> : Pulk)110.5 564 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger zone 7)-2.5 E(<esri20008> : Pulk)110.5 576 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger zone 8)-2.5 E
-(<esri20009> : Pulk)110.5 588 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger zone 9)-2.5 E(<esri20010> : Pulk)110.5 600 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger zone 10)-2.5 E
-(<esri20011> : Pulk)110.5 612 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger zone 11)-2.5 E(<esri20012> : Pulk)110.5 624 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger zone 12)-2.5 E
-(<esri20013> : Pulk)110.5 636 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger zone 13)-2.5 E(<esri20014> : Pulk)110.5 648 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger zone 14)-2.5 E
-(<esri20015> : Pulk)110.5 660 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger zone 15)-2.5 E(<esri20016> : Pulk)110.5 672 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger zone 16)-2.5 E
-(<esri20017> : Pulk)110.5 684 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger zone 17)-2.5 E(<esri20018> : Pulk)110.5 696 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger zone 18)-2.5 E
-(<esri20019> : Pulk)110.5 708 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger zone 19)-2.5 E(<esri20020> : Pulk)110.5 720 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger zone 20)-2.5 E(MB-System 5.0)
-72 768 Q(29 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E(110)180.545 E 0
-Cg EP
-%%Page: 111 111
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<esri20021> : Pulk)110.5 84 Q -.15(ov)-.1 G 2.5
-(o1)-.05 G(995 / Gauss-Kruger zone 21)-2.5 E(<esri20022> : Pulk)110.5 96
-Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger zone 22)-2.5 E
-(<esri20023> : Pulk)110.5 108 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger zone 23)-2.5 E(<esri20024> : Pulk)110.5 120 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger zone 24)-2.5 E
-(<esri20025> : Pulk)110.5 132 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger zone 25)-2.5 E(<esri20026> : Pulk)110.5 144 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger zone 26)-2.5 E
-(<esri20027> : Pulk)110.5 156 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger zone 27)-2.5 E(<esri20028> : Pulk)110.5 168 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger zone 28)-2.5 E
-(<esri20029> : Pulk)110.5 180 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger zone 29)-2.5 E(<esri20030> : Pulk)110.5 192 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger zone 30)-2.5 E
-(<esri20031> : Pulk)110.5 204 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger zone 31)-2.5 E(<esri20032> : Pulk)110.5 216 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger zone 32)-2.5 E
-(<esri20064> : Pulk)110.5 228 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger 4N)-2.5 E(<esri20065> : Pulk)110.5 240 Q -.15(ov)-.1
-G 2.5(o1)-.05 G(995 / Gauss-Kruger 5N)-2.5 E(<esri20066> : Pulk)110.5
-252 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger 6N)-2.5 E
-(<esri20067> : Pulk)110.5 264 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger 7N)-2.5 E(<esri20068> : Pulk)110.5 276 Q -.15(ov)-.1
-G 2.5(o1)-.05 G(995 / Gauss-Kruger 8N)-2.5 E(<esri20069> : Pulk)110.5
-288 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger 9N)-2.5 E
-(<esri20070> : Pulk)110.5 300 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger 10N)-2.5 E(<esri20071> : Pulk)110.5 312 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger 11N)-2.5 E(<esri20072> : Pulk)
-110.5 324 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger 12N)-2.5 E
-(<esri20073> : Pulk)110.5 336 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger 13N)-2.5 E(<esri20074> : Pulk)110.5 348 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger 14N)-2.5 E(<esri20075> : Pulk)
-110.5 360 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger 15N)-2.5 E
-(<esri20076> : Pulk)110.5 372 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger 16N)-2.5 E(<esri20077> : Pulk)110.5 384 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger 17N)-2.5 E(<esri20078> : Pulk)
-110.5 396 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger 18N)-2.5 E
-(<esri20079> : Pulk)110.5 408 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger 19N)-2.5 E(<esri20080> : Pulk)110.5 420 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger 20N)-2.5 E(<esri20081> : Pulk)
-110.5 432 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger 21N)-2.5 E
-(<esri20082> : Pulk)110.5 444 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger 22N)-2.5 E(<esri20083> : Pulk)110.5 456 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger 23N)-2.5 E(<esri20084> : Pulk)
-110.5 468 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger 24N)-2.5 E
-(<esri20085> : Pulk)110.5 480 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger 25N)-2.5 E(<esri20086> : Pulk)110.5 492 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger 26N)-2.5 E(<esri20087> : Pulk)
-110.5 504 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger 27N)-2.5 E
-(<esri20088> : Pulk)110.5 516 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger 28N)-2.5 E(<esri20089> : Pulk)110.5 528 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger 29N)-2.5 E(<esri20090> : Pulk)
-110.5 540 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger 30N)-2.5 E
-(<esri20091> : Pulk)110.5 552 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger 31N)-2.5 E(<esri20092> : Pulk)110.5 564 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger 32N)-2.5 E
-(<esri20137> : Adindan / UTM zone 37N)110.5 576 Q
-(<esri20138> : Adindan / UTM zone 38N)110.5 588 Q(<esri20248> : A)110.5
-600 Q(GD66 / AMG zone 48)-.4 E(<esri20249> : A)110.5 612 Q
-(GD66 / AMG zone 49)-.4 E(<esri20250> : A)110.5 624 Q
-(GD66 / AMG zone 50)-.4 E(<esri20251> : A)110.5 636 Q
-(GD66 / AMG zone 51)-.4 E(<esri20252> : A)110.5 648 Q
-(GD66 / AMG zone 52)-.4 E(<esri20253> : A)110.5 660 Q
-(GD66 / AMG zone 53)-.4 E(<esri20254> : A)110.5 672 Q
-(GD66 / AMG zone 54)-.4 E(<esri20255> : A)110.5 684 Q
-(GD66 / AMG zone 55)-.4 E(<esri20256> : A)110.5 696 Q
-(GD66 / AMG zone 56)-.4 E(<esri20257> : A)110.5 708 Q
-(GD66 / AMG zone 57)-.4 E(<esri20258> : A)110.5 720 Q
-(GD66 / AMG zone 58)-.4 E(MB-System 5.0)72 768 Q(29 No)132.205 E -.15
-(ve)-.15 G(mber 2014).15 E(111)180.545 E 0 Cg EP
-%%Page: 112 112
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<esri20348> : A)110.5 84 Q(GD84 / AMG zone 48)-.4
-E(<esri20349> : A)110.5 96 Q(GD84 / AMG zone 49)-.4 E(<esri20350> : A)
-110.5 108 Q(GD84 / AMG zone 50)-.4 E(<esri20351> : A)110.5 120 Q
-(GD84 / AMG zone 51)-.4 E(<esri20352> : A)110.5 132 Q
-(GD84 / AMG zone 52)-.4 E(<esri20353> : A)110.5 144 Q
-(GD84 / AMG zone 53)-.4 E(<esri20354> : A)110.5 156 Q
-(GD84 / AMG zone 54)-.4 E(<esri20355> : A)110.5 168 Q
-(GD84 / AMG zone 55)-.4 E(<esri20356> : A)110.5 180 Q
-(GD84 / AMG zone 56)-.4 E(<esri20357> : A)110.5 192 Q
-(GD84 / AMG zone 57)-.4 E(<esri20358> : A)110.5 204 Q
-(GD84 / AMG zone 58)-.4 E(<esri20437> : Ain el Abd / UTM zone 37N)110.5
-216 Q(<esri20438> : Ain el Abd / UTM zone 38N)110.5 228 Q
-(<esri20439> : Ain el Abd / UTM zone 39N)110.5 240 Q
-(<esri20499> : Ain el Abd / Bahrain Grid)110.5 252 Q
-(<esri20538> : Afgoo)110.5 264 Q(ye / UTM zone 38N)-.1 E
-(<esri20539> : Afgoo)110.5 276 Q(ye / UTM zone 39N)-.1 E
-(<esri20790> : Lisbon \(Lisbon\)/Portuguese National Grid)110.5 288 Q
-(<esri20791> : Lisbon \(Lisbon\)/Portuguese Grid)110.5 300 Q
-(<esri20822> : Aratu / UTM zone 22S)110.5 312 Q
-(<esri20823> : Aratu / UTM zone 23S)110.5 324 Q
-(<esri20824> : Aratu / UTM zone 24S)110.5 336 Q
-(<esri20934> : Arc 1950 / UTM zone 34S)110.5 348 Q
-(<esri20935> : Arc 1950 / UTM zone 35S)110.5 360 Q
-(<esri20936> : Arc 1950 / UTM zone 36S)110.5 372 Q
-(<esri21035> : Arc 1960 / UTM zone 35S)110.5 384 Q
-(<esri21036> : Arc 1960 / UTM zone 36S)110.5 396 Q
-(<esri21037> : Arc 1960 / UTM zone 37S)110.5 408 Q
-(<esri21095> : Arc 1960 / UTM zone 35N)110.5 420 Q
-(<esri21096> : Arc 1960 / UTM zone 36N)110.5 432 Q
-(<esri21097> : Arc 1960 / UTM zone 37N)110.5 444 Q(<esri21100> : Bata)
-110.5 456 Q(via \(Jakarta\) / NEIEZ)-.2 E(<esri21148> : Bata)110.5 468 Q
-(via / UTM zone 48S)-.2 E(<esri21149> : Bata)110.5 480 Q
-(via / UTM zone 49S)-.2 E(<esri21150> : Bata)110.5 492 Q
-(via / UTM zone 50S)-.2 E(<esri21291> : Barbados 1938 / British W)110.5
-504 Q(est Indies Grid)-.8 E
-(<esri21292> : Barbados 1938 / Barbados National Grid)110.5 516 Q
-(<esri21413> : Beijing 1954 / Gauss-Kruger zone 13)110.5 528 Q
-(<esri21414> : Beijing 1954 / Gauss-Kruger zone 14)110.5 540 Q
-(<esri21415> : Beijing 1954 / Gauss-Kruger zone 15)110.5 552 Q
-(<esri21416> : Beijing 1954 / Gauss-Kruger zone 16)110.5 564 Q
-(<esri21417> : Beijing 1954 / Gauss-Kruger zone 17)110.5 576 Q
-(<esri21418> : Beijing 1954 / Gauss-Kruger zone 18)110.5 588 Q
-(<esri21419> : Beijing 1954 / Gauss-Kruger zone 19)110.5 600 Q
-(<esri21420> : Beijing 1954 / Gauss-Kruger zone 20)110.5 612 Q
-(<esri21421> : Beijing 1954 / Gauss-Kruger zone 21)110.5 624 Q
-(<esri21422> : Beijing 1954 / Gauss-Kruger zone 22)110.5 636 Q
-(<esri21423> : Beijing 1954 / Gauss-Kruger zone 23)110.5 648 Q
-(<esri21453> : Beijing 1954 / Gauss-Kruger CM 75E)110.5 660 Q
-(<esri21454> : Beijing 1954 / Gauss-Kruger CM 81E)110.5 672 Q
-(<esri21455> : Beijing 1954 / Gauss-Kruger CM 87E)110.5 684 Q
-(<esri21456> : Beijing 1954 / Gauss-Kruger CM 93E)110.5 696 Q
-(<esri21457> : Beijing 1954 / Gauss-Kruger CM 99E)110.5 708 Q
-(<esri21458> : Beijing 1954 / Gauss-Kruger CM 105E)110.5 720 Q
-(MB-System 5.0)72 768 Q(29 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E
-(112)180.545 E 0 Cg EP
-%%Page: 113 113
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F
-(<esri21459> : Beijing 1954 / Gauss-Kruger CM 111E)110.5 84 Q
-(<esri21460> : Beijing 1954 / Gauss-Kruger CM 117E)110.5 96 Q
-(<esri21461> : Beijing 1954 / Gauss-Kruger CM 123E)110.5 108 Q
-(<esri21462> : Beijing 1954 / Gauss-Kruger CM 129E)110.5 120 Q
-(<esri21463> : Beijing 1954 / Gauss-Kruger CM 135E)110.5 132 Q
-(<esri21473> : Beijing 1954 / Gauss-Kruger 13N)110.5 144 Q
-(<esri21474> : Beijing 1954 / Gauss-Kruger 14N)110.5 156 Q
-(<esri21475> : Beijing 1954 / Gauss-Kruger 15N)110.5 168 Q
-(<esri21476> : Beijing 1954 / Gauss-Kruger 16N)110.5 180 Q
-(<esri21477> : Beijing 1954 / Gauss-Kruger 17N)110.5 192 Q
-(<esri21478> : Beijing 1954 / Gauss-Kruger 18N)110.5 204 Q
-(<esri21479> : Beijing 1954 / Gauss-Kruger 19N)110.5 216 Q
-(<esri21480> : Beijing 1954 / Gauss-Kruger 20N)110.5 228 Q
-(<esri21481> : Beijing 1954 / Gauss-Kruger 21N)110.5 240 Q
-(<esri21482> : Beijing 1954 / Gauss-Kruger 22N)110.5 252 Q
-(<esri21483> : Beijing 1954 / Gauss-Kruger 23N)110.5 264 Q
-(<esri21500> : Belge 1950 \(Brussels\) / Belge Lambert 50)110.5 276 Q
-(<esri21780> : Bern 1898 \(Bern\) / L)110.5 288 Q(V03C)-1 E
-(<esri21781> : CH1903 / L)110.5 300 Q(V03)-1 E
-(<esri21817> : Bogota 1975 / UTM zone 17N)110.5 312 Q
-(<esri21818> : Bogota 1975 / UTM zone 18N)110.5 324 Q
-(<esri21891> : Bogota 1975 / Colombia W)110.5 336 Q(est zone)-.8 E
-(<esri21892> : Bogota 1975 / Colombia Bogota zone)110.5 348 Q
-(<esri21893> : Bogota 1975 / Colombia East Central zone)110.5 360 Q
-(<esri21894> : Bogota 1975 / Colombia East)110.5 372 Q
-(<esri22032> : Camacupa / UTM zone 32S)110.5 384 Q
-(<esri22033> : Camacupa / UTM zone 33S)110.5 396 Q
-(<esri22091> : Camacupa / TM 11.30 SE)110.5 408 Q
-(<esri22092> : Camacupa / TM 12 SE)110.5 420 Q
-(<esri22191> : Campo Inchauspe / Ar)110.5 432 Q(gentina 1)-.18 E
-(<esri22192> : Campo Inchauspe / Ar)110.5 444 Q(gentina 2)-.18 E
-(<esri22193> : Campo Inchauspe / Ar)110.5 456 Q(gentina 3)-.18 E
-(<esri22194> : Campo Inchauspe / Ar)110.5 468 Q(gentina 4)-.18 E
-(<esri22195> : Campo Inchauspe / Ar)110.5 480 Q(gentina 5)-.18 E
-(<esri22196> : Campo Inchauspe / Ar)110.5 492 Q(gentina 6)-.18 E
-(<esri22197> : Campo Inchauspe / Ar)110.5 504 Q(gentina 7)-.18 E
-(<esri22234> : Cape / UTM zone 34S)110.5 516 Q
-(<esri22235> : Cape / UTM zone 35S)110.5 528 Q
-(<esri22236> : Cape / UTM zone 36S)110.5 540 Q
-(<esri22332> : Carthage / UTM zone 32N)110.5 552 Q
-(<esri22391> : Carthage / Nord T)110.5 564 Q(unisie)-.45 E
-(<esri22392> : Carthage / Sud T)110.5 576 Q(unisie)-.45 E
-(<esri22523> : Corre)110.5 588 Q(go Ale)-.15 E(gre / UTM zone 23S)-.15 E
-(<esri22524> : Corre)110.5 600 Q(go Ale)-.15 E(gre / UTM zone 24S)-.15 E
-(<esri22700> : Deir ez Zor / Le)110.5 612 Q -.25(va)-.25 G(nt Zone).25 E
-(<esri22770> : Deir ez Zor / Syria Lambert)110.5 624 Q
-(<esri22780> : Deir ez Zor / Le)110.5 636 Q -.25(va)-.25 G
-(nt Stereographic).25 E(<esri22832> : Douala / UTM zone 32N)110.5 648 Q
-(<esri22991> : Egypt 1907 / Blue Belt)110.5 660 Q
-(<esri22992> : Egypt 1907 / Red Belt)110.5 672 Q
-(<esri22993> : Egypt 1907 / Purple Belt)110.5 684 Q
-(<esri22994> : Egypt 1907 / Extended Purple Belt)110.5 696 Q
-(<esri23028> : ED50 / UTM zone 28N)110.5 708 Q
-(<esri23029> : ED50 / UTM zone 29N)110.5 720 Q(MB-System 5.0)72 768 Q
-(29 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E(113)180.545 E 0 Cg EP
-%%Page: 114 114
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<esri23030> : ED50 / UTM zone 30N)110.5 84 Q
-(<esri23031> : ED50 / UTM zone 31N)110.5 96 Q
-(<esri23032> : ED50 / UTM zone 32N)110.5 108 Q
-(<esri23033> : ED50 / UTM zone 33N)110.5 120 Q
-(<esri23034> : ED50 / UTM zone 34N)110.5 132 Q
-(<esri23035> : ED50 / UTM zone 35N)110.5 144 Q
-(<esri23036> : ED50 / UTM zone 36N)110.5 156 Q
-(<esri23037> : ED50 / UTM zone 37N)110.5 168 Q
-(<esri23038> : ED50 / UTM zone 38N)110.5 180 Q
-(<esri23090> : ED50 / TM 0 N)110.5 192 Q(<esri23095> : ED50 / TM 5 NE)
-110.5 204 Q(<esri23239> : F)110.5 216 Q(ahud / UTM zone 39N)-.15 E
-(<esri23240> : F)110.5 228 Q(ahud / UTM zone 40N)-.15 E
-(<esri23433> : Garoua / UTM zone 33N)110.5 240 Q
-(<esri23700> : HD72 / EO)110.5 252 Q(V)-.5 E
-(<esri23846> : ID74 / UTM zone 46N)110.5 264 Q
-(<esri23847> : ID74 / UTM zone 47N)110.5 276 Q
-(<esri23848> : ID74 / UTM zone 48N)110.5 288 Q
-(<esri23849> : ID74 / UTM zone 49N)110.5 300 Q
-(<esri23850> : ID74 / UTM zone 50N)110.5 312 Q
-(<esri23851> : ID74 / UTM zone 51N)110.5 324 Q
-(<esri23852> : ID74 / UTM zone 52N)110.5 336 Q
-(<esri23853> : ID74 / UTM zone 53N)110.5 348 Q
-(<esri23886> : ID74 / UTM zone 46S)110.5 360 Q
-(<esri23887> : ID74 / UTM zone 47S)110.5 372 Q
-(<esri23888> : ID74 / UTM zone 48S)110.5 384 Q
-(<esri23889> : ID74 / UTM zone 49S)110.5 396 Q
-(<esri23890> : ID74 / UTM zone 50S)110.5 408 Q
-(<esri23891> : ID74 / UTM zone 51S)110.5 420 Q
-(<esri23892> : ID74 / UTM zone 52S)110.5 432 Q
-(<esri23893> : ID74 / UTM zone 53S)110.5 444 Q
-(<esri23894> : ID74 / UTM zone 54S)110.5 456 Q
-(<esri23946> : Indian 1954 / UTM zone 46N)110.5 468 Q
-(<esri23947> : Indian 1954 / UTM zone 47N)110.5 480 Q
-(<esri23948> : Indian 1954 / UTM zone 48N)110.5 492 Q
-(<esri24047> : Indian 1975 / UTM zone 47N)110.5 504 Q
-(<esri24048> : Indian 1975 / UTM zone 48N)110.5 516 Q
-(<esri24100> : Jamaica 1875 / Jamaica \(Old Grid\))110.5 528 Q
-(<esri24200> : J)110.5 540 Q(AD69 / Jamaica National Grid)-.6 E
-(<esri24305> : Kalianpur 1937 / UTM zone 45N)110.5 552 Q
-(<esri24306> : Kalianpur 1937 / UTM zone 46N)110.5 564 Q
-(<esri24311> : Kalianpur 1962 / UTM zone 41N)110.5 576 Q
-(<esri24312> : Kalianpur 1962 / UTM zone 42N)110.5 588 Q
-(<esri24313> : Kalianpur 1962 / UTM zone 43N)110.5 600 Q
-(<esri24342> : Kalianpur 1975 / UTM zone 42N)110.5 612 Q
-(<esri24343> : Kalianpur 1975 / UTM zone 43N)110.5 624 Q
-(<esri24344> : Kalianpur 1975 / UTM zone 44N)110.5 636 Q
-(<esri24345> : Kalianpur 1975 / UTM zone 45N)110.5 648 Q
-(<esri24346> : Kalianpur 1975 / UTM zone 46N)110.5 660 Q
-(<esri24347> : Kalianpur 1975 / UTM zone 47N)110.5 672 Q
-(<esri24370> : Kalianpur 1880 / India zone 0)110.5 684 Q
-(<esri24371> : Kalianpur 1880 / India zone I)110.5 696 Q
-(<esri24372> : Kalianpur 1880 / India zone IIa)110.5 708 Q
-(<esri24373> : Kalianpur 1880 / India zone III)110.5 720 Q
-(MB-System 5.0)72 768 Q(29 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E
-(114)180.545 E 0 Cg EP
-%%Page: 115 115
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<esri24374> : Kalianpur 1880 / India zone IV)
-110.5 84 Q(<esri24375> : Kalianpur 1937 / India zone IIb)110.5 96 Q
-(<esri24376> : Kalianpur 1962 / India zone I)110.5 108 Q
-(<esri24377> : Kalianpur 1962 / India zone IIa)110.5 120 Q
-(<esri24378> : Kalianpur 1975 / India zone I)110.5 132 Q
-(<esri24379> : Kalianpur 1975 / India zone IIa)110.5 144 Q
-(<esri24380> : Kalianpur 1975 / India zone IIb)110.5 156 Q
-(<esri24381> : Kalianpur 1975 / India zone III)110.5 168 Q
-(<esri24382> : Kalianpur 1880 / India zone IIb)110.5 180 Q
-(<esri24383> : Kalianpur 1975 / India zone IV)110.5 192 Q
-(<esri24500> : K)110.5 204 Q(ertau / Sing)-.25 E(apore Grid)-.05 E
-(<esri24547> : K)110.5 216 Q(ertau / UTM zone 47N)-.25 E
-(<esri24548> : K)110.5 228 Q(ertau / UTM zone 48N)-.25 E
-(<esri24571> : K)110.5 240 Q(ertau / R.S.O. Malaya \(ch\))-.25 E
-(<esri24600> : K)110.5 252 Q(OC Lambert)-.3 E
-(<esri24718> : La Canoa / UTM zone 18N)110.5 264 Q
-(<esri24719> : La Canoa / UTM zone 19N)110.5 276 Q
-(<esri24720> : La Canoa / UTM zone 20N)110.5 288 Q
-(<esri24818> : PSAD56 / UTM zone 18N)110.5 300 Q
-(<esri24819> : PSAD56 / UTM zone 19N)110.5 312 Q
-(<esri24820> : PSAD56 / UTM zone 20N)110.5 324 Q
-(<esri24821> : PSAD56 / UTM zone 21N)110.5 336 Q
-(<esri24877> : PSAD56 / UTM zone 17S)110.5 348 Q
-(<esri24878> : PSAD56 / UTM zone 18S)110.5 360 Q
-(<esri24879> : PSAD56 / UTM zone 19S)110.5 372 Q
-(<esri24880> : PSAD56 / UTM zone 20S)110.5 384 Q
-(<esri24882> : PSAD56 / UTM zone 22S)110.5 396 Q
-(<esri24891> : PSAD56 / Peru west zone)110.5 408 Q
-(<esri24892> : PSAD56 / Peru central zone)110.5 420 Q
-(<esri24893> : PSAD56 / Peru east zone)110.5 432 Q
-(<esri25000> : Leigon / Ghana Metre Grid)110.5 444 Q
-(<esri25231> : Lome / UTM zone 31N)110.5 456 Q
-(<esri25391> : Luzon 1911 / Philippines zone I)110.5 468 Q
-(<esri25392> : Luzon 1911 / Philippines zone II)110.5 480 Q
-(<esri25393> : Luzon 1911 / Philippines zone III)110.5 492 Q
-(<esri25394> : Luzon 1911 / Philippines zone IV)110.5 504 Q
-(<esri25395> : Luzon 1911 / Philippines zone V)110.5 516 Q
-(<esri25700> : Makassar \(Jakarta\) / NEIEZ)110.5 528 Q
-(<esri25828> : ETRS89 / UTM zone 28N)110.5 540 Q
-(<esri25829> : ETRS89 / UTM zone 29N)110.5 552 Q
-(<esri25830> : ETRS89 / UTM zone 30N)110.5 564 Q
-(<esri25831> : ETRS89 / UTM zone 31N)110.5 576 Q
-(<esri25832> : ETRS89 / UTM zone 32N)110.5 588 Q
-(<esri25833> : ETRS89 / UTM zone 33N)110.5 600 Q
-(<esri25834> : ETRS89 / UTM zone 34N)110.5 612 Q
-(<esri25835> : ETRS89 / UTM zone 35N)110.5 624 Q
-(<esri25836> : ETRS89 / UTM zone 36N)110.5 636 Q
-(<esri25837> : ETRS89 / UTM zone 37N)110.5 648 Q
-(<esri25838> : ETRS89 / UTM zone 38N)110.5 660 Q
-(<esri25884> : ETRS89 / TM Baltic93)110.5 672 Q
-(<esri25932> : Malongo 1987 / UTM zone 32S)110.5 684 Q
-(<esri26191> : Merchich / Nord Maroc)110.5 696 Q
-(<esri26192> : Merchich / Sud Maroc)110.5 708 Q
-(<esri26193> : Merchich / Sahara)110.5 720 Q(MB-System 5.0)72 768 Q
-(29 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E(115)180.545 E 0 Cg EP
-%%Page: 116 116
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<esri26237> : Massa)110.5 84 Q .2 -.1(wa / U)-.15
-H(TM zone 37N).1 E(<esri26331> : Minna / UTM zone 31N)110.5 96 Q
-(<esri26332> : Minna / UTM zone 32N)110.5 108 Q
-(<esri26391> : Minna / Nigeria W)110.5 120 Q(est Belt)-.8 E
-(<esri26392> : Minna / Nigeria Mid Belt)110.5 132 Q
-(<esri26393> : Minna / Nigeria East Belt)110.5 144 Q
-(<esri26432> : Mhast / UTM zone 32S)110.5 156 Q
-(<esri26591> : Monte Mario \(Rome\) / Italy zone 1)110.5 168 Q
-(<esri26592> : Monte Mario \(Rome\) / Italy zone 2)110.5 180 Q
-(<esri26632> : M'poralok)110.5 192 Q 2.5(o/U)-.1 G(TM zone 32N)-2.5 E
-(<esri26692> : M'poralok)110.5 204 Q 2.5(o/U)-.1 G(TM zone 32S)-2.5 E
-(<esri26703> : N)110.5 216 Q(AD27 / UTM zone 3N)-.35 E(<esri26704> : N)
-110.5 228 Q(AD27 / UTM zone 4N)-.35 E(<esri26705> : N)110.5 240 Q
-(AD27 / UTM zone 5N)-.35 E(<esri26706> : N)110.5 252 Q
-(AD27 / UTM zone 6N)-.35 E(<esri26707> : N)110.5 264 Q
-(AD27 / UTM zone 7N)-.35 E(<esri26708> : N)110.5 276 Q
-(AD27 / UTM zone 8N)-.35 E(<esri26709> : N)110.5 288 Q
-(AD27 / UTM zone 9N)-.35 E(<esri26710> : N)110.5 300 Q
-(AD27 / UTM zone 10N)-.35 E(<esri26711> : N)110.5 312 Q
-(AD27 / UTM zone 11N)-.35 E(<esri26712> : N)110.5 324 Q
-(AD27 / UTM zone 12N)-.35 E(<esri26713> : N)110.5 336 Q
-(AD27 / UTM zone 13N)-.35 E(<esri26714> : N)110.5 348 Q
-(AD27 / UTM zone 14N)-.35 E(<esri26715> : N)110.5 360 Q
-(AD27 / UTM zone 15N)-.35 E(<esri26716> : N)110.5 372 Q
-(AD27 / UTM zone 16N)-.35 E(<esri26717> : N)110.5 384 Q
-(AD27 / UTM zone 17N)-.35 E(<esri26718> : N)110.5 396 Q
-(AD27 / UTM zone 18N)-.35 E(<esri26719> : N)110.5 408 Q
-(AD27 / UTM zone 19N)-.35 E(<esri26720> : N)110.5 420 Q
-(AD27 / UTM zone 20N)-.35 E(<esri26721> : N)110.5 432 Q
-(AD27 / UTM zone 21N)-.35 E(<esri26722> : N)110.5 444 Q
-(AD27 / UTM zone 22N)-.35 E(<esri26729> : N)110.5 456 Q
-(AD27 / Alabama East)-.35 E(<esri26730> : N)110.5 468 Q
-(AD27 / Alabama W)-.35 E(est)-.8 E(<esri26731> : N)110.5 480 Q
-(AD27 / Alaska zone 1)-.35 E(<esri26732> : N)110.5 492 Q
-(AD27 / Alaska zone 2)-.35 E(<esri26733> : N)110.5 504 Q
-(AD27 / Alaska zone 3)-.35 E(<esri26734> : N)110.5 516 Q
-(AD27 / Alaska zone 4)-.35 E(<esri26735> : N)110.5 528 Q
-(AD27 / Alaska zone 5)-.35 E(<esri26736> : N)110.5 540 Q
-(AD27 / Alaska zone 6)-.35 E(<esri26737> : N)110.5 552 Q
-(AD27 / Alaska zone 7)-.35 E(<esri26738> : N)110.5 564 Q
-(AD27 / Alaska zone 8)-.35 E(<esri26739> : N)110.5 576 Q
-(AD27 / Alaska zone 9)-.35 E(<esri26740> : N)110.5 588 Q
-(AD27 / Alaska zone 10)-.35 E(<esri26741> : N)110.5 600 Q
-(AD27 / California zone I)-.35 E(<esri26742> : N)110.5 612 Q
-(AD27 / California zone II)-.35 E(<esri26743> : N)110.5 624 Q
-(AD27 / California zone III)-.35 E(<esri26744> : N)110.5 636 Q
-(AD27 / California zone IV)-.35 E(<esri26745> : N)110.5 648 Q
-(AD27 / California zone V)-.35 E(<esri26746> : N)110.5 660 Q
-(AD27 / California zone VI)-.35 E(<esri26747> : N)110.5 672 Q
-(AD27 / California zone VII)-.35 E(<esri26748> : N)110.5 684 Q
-(AD27 / Arizona East)-.35 E(<esri26749> : N)110.5 696 Q
-(AD27 / Arizona Central)-.35 E(<esri26750> : N)110.5 708 Q
-(AD27 / Arizona W)-.35 E(est)-.8 E(<esri26751> : N)110.5 720 Q
-(AD27 / Arkansas North)-.35 E(MB-System 5.0)72 768 Q(29 No)132.205 E
--.15(ve)-.15 G(mber 2014).15 E(116)180.545 E 0 Cg EP
-%%Page: 117 117
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<esri26752> : N)110.5 84 Q(AD27 / Arkansas South)
--.35 E(<esri26753> : N)110.5 96 Q(AD27 / Colorado North)-.35 E
-(<esri26754> : N)110.5 108 Q(AD27 / Colorado Central)-.35 E
-(<esri26755> : N)110.5 120 Q(AD27 / Colorado South)-.35 E
-(<esri26756> : N)110.5 132 Q(AD27 / Connecticut)-.35 E(<esri26757> : N)
-110.5 144 Q(AD27 / Dela)-.35 E -.1(wa)-.15 G(re).1 E(<esri26758> : N)
-110.5 156 Q(AD27 / Florida East)-.35 E(<esri26759> : N)110.5 168 Q
-(AD27 / Florida W)-.35 E(est)-.8 E(<esri26760> : N)110.5 180 Q
-(AD27 / Florida North)-.35 E(<esri26766> : N)110.5 192 Q(AD27 / Geor)
--.35 E(gia East)-.18 E(<esri26767> : N)110.5 204 Q(AD27 / Geor)-.35 E
-(gia W)-.18 E(est)-.8 E(<esri26768> : N)110.5 216 Q(AD27 / Idaho East)
--.35 E(<esri26769> : N)110.5 228 Q(AD27 / Idaho Central)-.35 E
-(<esri26770> : N)110.5 240 Q(AD27 / Idaho W)-.35 E(est)-.8 E
-(<esri26771> : N)110.5 252 Q(AD27 / Illinois East)-.35 E
-(<esri26772> : N)110.5 264 Q(AD27 / Illinois W)-.35 E(est)-.8 E
-(<esri26773> : N)110.5 276 Q(AD27 / Indiana East)-.35 E(<esri26774> : N)
-110.5 288 Q(AD27 / Indiana W)-.35 E(est)-.8 E(<esri26775> : N)110.5 300
-Q(AD27 / Io)-.35 E .2 -.1(wa N)-.25 H(orth).1 E(<esri26776> : N)110.5
-312 Q(AD27 / Io)-.35 E .2 -.1(wa S)-.25 H(outh).1 E(<esri26777> : N)
-110.5 324 Q(AD27 / Kansas North)-.35 E(<esri26778> : N)110.5 336 Q
-(AD27 / Kansas South)-.35 E(<esri26779> : N)110.5 348 Q(AD27 / K)-.35 E
-(entuck)-.25 E 2.5(yN)-.15 G(orth)-2.5 E(<esri26780> : N)110.5 360 Q
-(AD27 / K)-.35 E(entuck)-.25 E 2.5(yS)-.15 G(outh)-2.5 E
-(<esri26781> : N)110.5 372 Q(AD27 / Louisiana North)-.35 E
-(<esri26782> : N)110.5 384 Q(AD27 / Louisiana South)-.35 E
-(<esri26783> : N)110.5 396 Q(AD27 / Maine East)-.35 E(<esri26784> : N)
-110.5 408 Q(AD27 / Maine W)-.35 E(est)-.8 E(<esri26785> : N)110.5 420 Q
-(AD27 / Maryland)-.35 E(<esri26786> : N)110.5 432 Q
-(AD27 / Massachusetts Mainland)-.35 E(<esri26787> : N)110.5 444 Q
-(AD27 / Massachusetts Island)-.35 E(<esri26791> : N)110.5 456 Q
-(AD27 / Minnesota North)-.35 E(<esri26792> : N)110.5 468 Q
-(AD27 / Minnesota Central)-.35 E(<esri26793> : N)110.5 480 Q
-(AD27 / Minnesota South)-.35 E(<esri26794> : N)110.5 492 Q
-(AD27 / Mississippi East)-.35 E(<esri26795> : N)110.5 504 Q
-(AD27 / Mississippi W)-.35 E(est)-.8 E(<esri26796> : N)110.5 516 Q
-(AD27 / Missouri East)-.35 E(<esri26797> : N)110.5 528 Q
-(AD27 / Missouri Central)-.35 E(<esri26798> : N)110.5 540 Q
-(AD27 / Missouri W)-.35 E(est)-.8 E(<esri26801> : N)110.5 552 Q
-(AD Michig)-.35 E(an / Michig)-.05 E(an East)-.05 E(<esri26802> : N)
-110.5 564 Q(AD Michig)-.35 E(an / Michig)-.05 E(an Old Central)-.05 E
-(<esri26803> : N)110.5 576 Q(AD Michig)-.35 E(an / Michig)-.05 E(an W)
--.05 E(est)-.8 E(<esri26811> : N)110.5 588 Q(AD Michig)-.35 E
-(an / Michig)-.05 E(an North)-.05 E(<esri26812> : N)110.5 600 Q
-(AD Michig)-.35 E(an / Michig)-.05 E(an Central)-.05 E(<esri26813> : N)
-110.5 612 Q(AD Michig)-.35 E(an / Michig)-.05 E(an South)-.05 E
-(<esri26903> : N)110.5 624 Q(AD83 / UTM zone 3N)-.35 E(<esri26904> : N)
-110.5 636 Q(AD83 / UTM zone 4N)-.35 E(<esri26905> : N)110.5 648 Q
-(AD83 / UTM zone 5N)-.35 E(<esri26906> : N)110.5 660 Q
-(AD83 / UTM zone 6N)-.35 E(<esri26907> : N)110.5 672 Q
-(AD83 / UTM zone 7N)-.35 E(<esri26908> : N)110.5 684 Q
-(AD83 / UTM zone 8N)-.35 E(<esri26909> : N)110.5 696 Q
-(AD83 / UTM zone 9N)-.35 E(<esri26910> : N)110.5 708 Q
-(AD83 / UTM zone 10N)-.35 E(<esri26911> : N)110.5 720 Q
-(AD83 / UTM zone 11N)-.35 E(MB-System 5.0)72 768 Q(29 No)132.205 E -.15
-(ve)-.15 G(mber 2014).15 E(117)180.545 E 0 Cg EP
-%%Page: 118 118
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<esri26912> : N)110.5 84 Q(AD83 / UTM zone 12N)
--.35 E(<esri26913> : N)110.5 96 Q(AD83 / UTM zone 13N)-.35 E
-(<esri26914> : N)110.5 108 Q(AD83 / UTM zone 14N)-.35 E(<esri26915> : N)
-110.5 120 Q(AD83 / UTM zone 15N)-.35 E(<esri26916> : N)110.5 132 Q
-(AD83 / UTM zone 16N)-.35 E(<esri26917> : N)110.5 144 Q
-(AD83 / UTM zone 17N)-.35 E(<esri26918> : N)110.5 156 Q
-(AD83 / UTM zone 18N)-.35 E(<esri26919> : N)110.5 168 Q
-(AD83 / UTM zone 19N)-.35 E(<esri26920> : N)110.5 180 Q
-(AD83 / UTM zone 20N)-.35 E(<esri26921> : N)110.5 192 Q
-(AD83 / UTM zone 21N)-.35 E(<esri26922> : N)110.5 204 Q
-(AD83 / UTM zone 22N)-.35 E(<esri26923> : N)110.5 216 Q
-(AD83 / UTM zone 23N)-.35 E(<esri26929> : N)110.5 228 Q
-(AD83 / Alabama East)-.35 E(<esri26930> : N)110.5 240 Q
-(AD83 / Alabama W)-.35 E(est)-.8 E(<esri26931> : N)110.5 252 Q
-(AD83 / Alaska zone 1)-.35 E(<esri26932> : N)110.5 264 Q
-(AD83 / Alaska zone 2)-.35 E(<esri26933> : N)110.5 276 Q
-(AD83 / Alaska zone 3)-.35 E(<esri26934> : N)110.5 288 Q
-(AD83 / Alaska zone 4)-.35 E(<esri26935> : N)110.5 300 Q
-(AD83 / Alaska zone 5)-.35 E(<esri26936> : N)110.5 312 Q
-(AD83 / Alaska zone 6)-.35 E(<esri26937> : N)110.5 324 Q
-(AD83 / Alaska zone 7)-.35 E(<esri26938> : N)110.5 336 Q
-(AD83 / Alaska zone 8)-.35 E(<esri26939> : N)110.5 348 Q
-(AD83 / Alaska zone 9)-.35 E(<esri26940> : N)110.5 360 Q
-(AD83 / Alaska zone 10)-.35 E(<esri26941> : N)110.5 372 Q
-(AD83 / California zone 1)-.35 E(<esri26942> : N)110.5 384 Q
-(AD83 / California zone 2)-.35 E(<esri26943> : N)110.5 396 Q
-(AD83 / California zone 3)-.35 E(<esri26944> : N)110.5 408 Q
-(AD83 / California zone 4)-.35 E(<esri26945> : N)110.5 420 Q
-(AD83 / California zone 5)-.35 E(<esri26946> : N)110.5 432 Q
-(AD83 / California zone 6)-.35 E(<esri26948> : N)110.5 444 Q
-(AD83 / Arizona East)-.35 E(<esri26949> : N)110.5 456 Q
-(AD83 / Arizona Central)-.35 E(<esri26950> : N)110.5 468 Q
-(AD83 / Arizona W)-.35 E(est)-.8 E(<esri26951> : N)110.5 480 Q
-(AD83 / Arkansas North)-.35 E(<esri26952> : N)110.5 492 Q
-(AD83 / Arkansas South)-.35 E(<esri26953> : N)110.5 504 Q
-(AD83 / Colorado North)-.35 E(<esri26954> : N)110.5 516 Q
-(AD83 / Colorado Central)-.35 E(<esri26955> : N)110.5 528 Q
-(AD83 / Colorado South)-.35 E(<esri26956> : N)110.5 540 Q
-(AD83 / Connecticut)-.35 E(<esri26957> : N)110.5 552 Q(AD83 / Dela)-.35
-E -.1(wa)-.15 G(re).1 E(<esri26958> : N)110.5 564 Q(AD83 / Florida East)
--.35 E(<esri26959> : N)110.5 576 Q(AD83 / Florida W)-.35 E(est)-.8 E
-(<esri26960> : N)110.5 588 Q(AD83 / Florida North)-.35 E
-(<esri26961> : N)110.5 600 Q(AD83 / Ha)-.35 E -.1(wa)-.15 G(ii zone 1).1
-E(<esri26962> : N)110.5 612 Q(AD83 / Ha)-.35 E -.1(wa)-.15 G(ii zone 2)
-.1 E(<esri26963> : N)110.5 624 Q(AD83 / Ha)-.35 E -.1(wa)-.15 G
-(ii zone 3).1 E(<esri26964> : N)110.5 636 Q(AD83 / Ha)-.35 E -.1(wa)-.15
-G(ii zone 4).1 E(<esri26965> : N)110.5 648 Q(AD83 / Ha)-.35 E -.1(wa)
--.15 G(ii zone 5).1 E(<esri26966> : N)110.5 660 Q(AD83 / Geor)-.35 E
-(gia East)-.18 E(<esri26967> : N)110.5 672 Q(AD83 / Geor)-.35 E(gia W)
--.18 E(est)-.8 E(<esri26968> : N)110.5 684 Q(AD83 / Idaho East)-.35 E
-(<esri26969> : N)110.5 696 Q(AD83 / Idaho Central)-.35 E
-(<esri26970> : N)110.5 708 Q(AD83 / Idaho W)-.35 E(est)-.8 E
-(<esri26971> : N)110.5 720 Q(AD83 / Illinois East)-.35 E(MB-System 5.0)
-72 768 Q(29 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E(118)180.545 E 0
-Cg EP
-%%Page: 119 119
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<esri26972> : N)110.5 84 Q(AD83 / Illinois W)-.35
-E(est)-.8 E(<esri26973> : N)110.5 96 Q(AD83 / Indiana East)-.35 E
-(<esri26974> : N)110.5 108 Q(AD83 / Indiana W)-.35 E(est)-.8 E
-(<esri26975> : N)110.5 120 Q(AD83 / Io)-.35 E .2 -.1(wa N)-.25 H(orth).1
-E(<esri26976> : N)110.5 132 Q(AD83 / Io)-.35 E .2 -.1(wa S)-.25 H(outh)
-.1 E(<esri26977> : N)110.5 144 Q(AD83 / Kansas North)-.35 E
-(<esri26978> : N)110.5 156 Q(AD83 / Kansas South)-.35 E(<esri26979> : N)
-110.5 168 Q(AD83 / K)-.35 E(entuck)-.25 E 2.5(yN)-.15 G(orth)-2.5 E
-(<esri26980> : N)110.5 180 Q(AD83 / K)-.35 E(entuck)-.25 E 2.5(yS)-.15 G
-(outh)-2.5 E(<esri26981> : N)110.5 192 Q(AD83 / Louisiana North)-.35 E
-(<esri26982> : N)110.5 204 Q(AD83 / Louisiana South)-.35 E
-(<esri26983> : N)110.5 216 Q(AD83 / Maine East)-.35 E(<esri26984> : N)
-110.5 228 Q(AD83 / Maine W)-.35 E(est)-.8 E(<esri26985> : N)110.5 240 Q
-(AD83 / Maryland)-.35 E(<esri26986> : N)110.5 252 Q
-(AD83 / Massachusetts Mainland)-.35 E(<esri26987> : N)110.5 264 Q
-(AD83 / Massachusetts Island)-.35 E(<esri26988> : N)110.5 276 Q
-(AD83 / Michig)-.35 E(an North)-.05 E(<esri26989> : N)110.5 288 Q
-(AD83 / Michig)-.35 E(an Central)-.05 E(<esri26990> : N)110.5 300 Q
-(AD83 / Michig)-.35 E(an South)-.05 E(<esri26991> : N)110.5 312 Q
-(AD83 / Minnesota North)-.35 E(<esri26992> : N)110.5 324 Q
-(AD83 / Minnesota Central)-.35 E(<esri26993> : N)110.5 336 Q
-(AD83 / Minnesota South)-.35 E(<esri26994> : N)110.5 348 Q
-(AD83 / Mississippi East)-.35 E(<esri26995> : N)110.5 360 Q
-(AD83 / Mississippi W)-.35 E(est)-.8 E(<esri26996> : N)110.5 372 Q
-(AD83 / Missouri East)-.35 E(<esri26997> : N)110.5 384 Q
-(AD83 / Missouri Central)-.35 E(<esri26998> : N)110.5 396 Q
-(AD83 / Missouri W)-.35 E(est)-.8 E(<esri27038> : Nahrw)110.5 408 Q
-(an 1967 / UTM zone 38N)-.1 E(<esri27039> : Nahrw)110.5 420 Q
-(an 1967 / UTM zone 39N)-.1 E(<esri27040> : Nahrw)110.5 432 Q
-(an 1967 / UTM zone 40N)-.1 E
-(<esri27120> : Naparima 1972 / UTM zone 20N)110.5 444 Q
-(<esri27200> : NZGD49 / Ne)110.5 456 Q 2.5(wZ)-.25 G(ealand Map Grid)
--2.5 E(<esri27205> : NZGD49 / Mount Eden Circuit)110.5 468 Q
-(<esri27206> : NZGD49 / Bay of Plenty Circuit)110.5 480 Q
-(<esri27207> : NZGD49 / Po)110.5 492 Q -.15(ve)-.15 G(rty Bay Circuit)
-.15 E(<esri27208> : NZGD49 / Ha)110.5 504 Q(wk)-.15 E(es Bay Circuit)-.1
-E(<esri27209> : NZGD49 / T)110.5 516 Q(aranaki Circuit)-.8 E
-(<esri27210> : NZGD49 / T)110.5 528 Q(uhirangi Circuit)-.45 E
-(<esri27211> : NZGD49 / W)110.5 540 Q(ang)-.8 E(anui Circuit)-.05 E
-(<esri27212> : NZGD49 / W)110.5 552 Q(airarapa Circuit)-.8 E
-(<esri27213> : NZGD49 / W)110.5 564 Q(ellington Circuit)-.8 E
-(<esri27214> : NZGD49 / Collingw)110.5 576 Q(ood Circuit)-.1 E
-(<esri27215> : NZGD49 / Nelson Circuit)110.5 588 Q
-(<esri27216> : NZGD49 / Karamea Circuit)110.5 600 Q
-(<esri27217> : NZGD49 / Buller Circuit)110.5 612 Q
-(<esri27218> : NZGD49 / Gre)110.5 624 Q 2.5(yC)-.15 G(ircuit)-2.5 E
-(<esri27219> : NZGD49 / Amuri Circuit)110.5 636 Q
-(<esri27220> : NZGD49 / Marlborough Circuit)110.5 648 Q
-(<esri27221> : NZGD49 / Hokitika Circuit)110.5 660 Q
-(<esri27222> : NZGD49 / Okarito Circuit)110.5 672 Q
-(<esri27223> : NZGD49 / Jacksons Bay Circuit)110.5 684 Q
-(<esri27224> : NZGD49 / Mount Pleasant Circuit)110.5 696 Q
-(<esri27225> : NZGD49 / Ga)110.5 708 Q(wler Circuit)-.15 E
-(<esri27226> : NZGD49 / T)110.5 720 Q(imaru Circuit)-.35 E
-(MB-System 5.0)72 768 Q(29 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E
-(119)180.545 E 0 Cg EP
-%%Page: 120 120
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<esri27227> : NZGD49 / Lindis Peak Circuit)110.5
-84 Q(<esri27228> : NZGD49 / Mount Nicholas Circuit)110.5 96 Q
-(<esri27229> : NZGD49 / Mount Y)110.5 108 Q(ork Circuit)-1.1 E
-(<esri27230> : NZGD49 / Observ)110.5 120 Q(ation Point Circuit)-.25 E
-(<esri27231> : NZGD49 / North T)110.5 132 Q(aieri Circuit)-.8 E
-(<esri27232> : NZGD49 / Bluf)110.5 144 Q 2.5(fC)-.25 G(ircuit)-2.5 E
-(<esri27258> : NZGD49 / UTM zone 58S)110.5 156 Q
-(<esri27259> : NZGD49 / UTM zone 59S)110.5 168 Q
-(<esri27260> : NZGD49 / UTM zone 60S)110.5 180 Q
-(<esri27291> : NZGD49 / North Island Grid)110.5 192 Q
-(<esri27292> : NZGD49 / South Island Grid)110.5 204 Q
-(<esri27391> : NGO 1948 \(Oslo\) / NGO zone I)110.5 216 Q
-(<esri27392> : NGO 1948 \(Oslo\) / NGO zone II)110.5 228 Q
-(<esri27393> : NGO 1948 \(Oslo\) / NGO zone III)110.5 240 Q
-(<esri27394> : NGO 1948 \(Oslo\) / NGO zone IV)110.5 252 Q
-(<esri27395> : NGO 1948 \(Oslo\) / NGO zone V)110.5 264 Q
-(<esri27396> : NGO 1948 \(Oslo\) / NGO zone VI)110.5 276 Q
-(<esri27397> : NGO 1948 \(Oslo\) / NGO zone VII)110.5 288 Q
-(<esri27398> : NGO 1948 \(Oslo\) / NGO zone VIII)110.5 300 Q
-(<esri27429> : Datum 73 / UTM zone 29N)110.5 312 Q
-(<esri27492> : Datum 73 / Modi\214ed Portuguese Grid)110.5 324 Q
-(<esri27500> : A)110.5 336 Q(TF \(P)-1.11 E(aris\) / Nord de Guerre)-.15
-E(<esri27561> : NTF \(P)110.5 348 Q(aris\) / Lambert Nord France)-.15 E
-(<esri27562> : NTF \(P)110.5 360 Q(aris\) / Lambert Centre France)-.15 E
-(<esri27563> : NTF \(P)110.5 372 Q(aris\) / Lambert Sud France)-.15 E
-(<esri27564> : NTF \(P)110.5 384 Q(aris\) / Lambert Corse)-.15 E
-(<esri27571> : NTF \(P)110.5 396 Q(aris\) / Lambert zone I)-.15 E
-(<esri27572> : NTF \(P)110.5 408 Q(aris\) / Lambert zone II)-.15 E
-(<esri27573> : NTF \(P)110.5 420 Q(aris\) / Lambert zone III)-.15 E
-(<esri27574> : NTF \(P)110.5 432 Q(aris\) / Lambert zone IV)-.15 E
-(<esri27581> : NTF \(P)110.5 444 Q(aris\) / France I)-.15 E
-(<esri27582> : NTF \(P)110.5 456 Q(aris\) / France II)-.15 E
-(<esri27583> : NTF \(P)110.5 468 Q(aris\) / France III)-.15 E
-(<esri27584> : NTF \(P)110.5 480 Q(aris\) / France IV)-.15 E
-(<esri27591> : NTF \(P)110.5 492 Q(aris\) / Nord France)-.15 E
-(<esri27592> : NTF \(P)110.5 504 Q(aris\) / Centre France)-.15 E
-(<esri27593> : NTF \(P)110.5 516 Q(aris\) / Sud France)-.15 E
-(<esri27594> : NTF \(P)110.5 528 Q(aris\) / Corse)-.15 E
-(<esri27700> : OSGB 1936 / British National Grid)110.5 540 Q
-(<esri28191> : P)110.5 552 Q(alestine 1923 / P)-.15 E(alestine Grid)-.15
-E(<esri28192> : P)110.5 564 Q(alestine 1923 / P)-.15 E(alestine Belt)
--.15 E(<esri28193> : P)110.5 576 Q(alestine 1923 / Israeli CS Grid)-.15
-E(<esri28232> : Pointe Noire / UTM zone 32S)110.5 588 Q
-(<esri28348> : GD)110.5 600 Q(A94 / MGA zone 48)-.4 E(<esri28349> : GD)
-110.5 612 Q(A94 / MGA zone 49)-.4 E(<esri28350> : GD)110.5 624 Q
-(A94 / MGA zone 50)-.4 E(<esri28351> : GD)110.5 636 Q(A94 / MGA zone 51)
--.4 E(<esri28352> : GD)110.5 648 Q(A94 / MGA zone 52)-.4 E
-(<esri28353> : GD)110.5 660 Q(A94 / MGA zone 53)-.4 E(<esri28354> : GD)
-110.5 672 Q(A94 / MGA zone 54)-.4 E(<esri28355> : GD)110.5 684 Q
-(A94 / MGA zone 55)-.4 E(<esri28356> : GD)110.5 696 Q(A94 / MGA zone 56)
--.4 E(<esri28357> : GD)110.5 708 Q(A94 / MGA zone 57)-.4 E
-(<esri28358> : GD)110.5 720 Q(A94 / MGA zone 58)-.4 E(MB-System 5.0)72
-768 Q(29 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E(120)180.545 E 0 Cg
-EP
-%%Page: 121 121
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<esri28402> : Pulk)110.5 84 Q -.15(ov)-.1 G 2.5
-(o1)-.05 G(942 / Gauss-Kruger zone 2)-2.5 E(<esri28403> : Pulk)110.5 96
-Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger zone 3)-2.5 E
-(<esri28404> : Pulk)110.5 108 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger zone 4)-2.5 E(<esri28405> : Pulk)110.5 120 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger zone 5)-2.5 E
-(<esri28406> : Pulk)110.5 132 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger zone 6)-2.5 E(<esri28407> : Pulk)110.5 144 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger zone 7)-2.5 E
-(<esri28408> : Pulk)110.5 156 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger zone 8)-2.5 E(<esri28409> : Pulk)110.5 168 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger zone 9)-2.5 E
-(<esri28410> : Pulk)110.5 180 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger zone 10)-2.5 E(<esri28411> : Pulk)110.5 192 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger zone 11)-2.5 E
-(<esri28412> : Pulk)110.5 204 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger zone 12)-2.5 E(<esri28413> : Pulk)110.5 216 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger zone 13)-2.5 E
-(<esri28414> : Pulk)110.5 228 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger zone 14)-2.5 E(<esri28415> : Pulk)110.5 240 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger zone 15)-2.5 E
-(<esri28416> : Pulk)110.5 252 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger zone 16)-2.5 E(<esri28417> : Pulk)110.5 264 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger zone 17)-2.5 E
-(<esri28418> : Pulk)110.5 276 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger zone 18)-2.5 E(<esri28419> : Pulk)110.5 288 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger zone 19)-2.5 E
-(<esri28420> : Pulk)110.5 300 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger zone 20)-2.5 E(<esri28421> : Pulk)110.5 312 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger zone 21)-2.5 E
-(<esri28422> : Pulk)110.5 324 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger zone 22)-2.5 E(<esri28423> : Pulk)110.5 336 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger zone 23)-2.5 E
-(<esri28424> : Pulk)110.5 348 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger zone 24)-2.5 E(<esri28425> : Pulk)110.5 360 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger zone 25)-2.5 E
-(<esri28426> : Pulk)110.5 372 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger zone 26)-2.5 E(<esri28427> : Pulk)110.5 384 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger zone 27)-2.5 E
-(<esri28428> : Pulk)110.5 396 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger zone 28)-2.5 E(<esri28429> : Pulk)110.5 408 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger zone 29)-2.5 E
-(<esri28430> : Pulk)110.5 420 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger zone 30)-2.5 E(<esri28431> : Pulk)110.5 432 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger zone 31)-2.5 E
-(<esri28432> : Pulk)110.5 444 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger zone 32)-2.5 E(<esri28462> : Pulk)110.5 456 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger 2N)-2.5 E(<esri28463> : Pulk)
-110.5 468 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger 3N)-2.5 E
-(<esri28464> : Pulk)110.5 480 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger 4N)-2.5 E(<esri28465> : Pulk)110.5 492 Q -.15(ov)-.1
-G 2.5(o1)-.05 G(942 / Gauss-Kruger 5N)-2.5 E(<esri28466> : Pulk)110.5
-504 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger 6N)-2.5 E
-(<esri28467> : Pulk)110.5 516 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger 7N)-2.5 E(<esri28468> : Pulk)110.5 528 Q -.15(ov)-.1
-G 2.5(o1)-.05 G(942 / Gauss-Kruger 8N)-2.5 E(<esri28469> : Pulk)110.5
-540 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger 9N)-2.5 E
-(<esri28470> : Pulk)110.5 552 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger 10N)-2.5 E(<esri28471> : Pulk)110.5 564 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger 11N)-2.5 E(<esri28472> : Pulk)
-110.5 576 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger 12N)-2.5 E
-(<esri28473> : Pulk)110.5 588 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger 13N)-2.5 E(<esri28474> : Pulk)110.5 600 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger 14N)-2.5 E(<esri28475> : Pulk)
-110.5 612 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger 15N)-2.5 E
-(<esri28476> : Pulk)110.5 624 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger 16N)-2.5 E(<esri28477> : Pulk)110.5 636 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger 17N)-2.5 E(<esri28478> : Pulk)
-110.5 648 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger 18N)-2.5 E
-(<esri28479> : Pulk)110.5 660 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger 19N)-2.5 E(<esri28480> : Pulk)110.5 672 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger 20N)-2.5 E(<esri28481> : Pulk)
-110.5 684 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger 21N)-2.5 E
-(<esri28482> : Pulk)110.5 696 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger 22N)-2.5 E(<esri28483> : Pulk)110.5 708 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger 23N)-2.5 E(<esri28484> : Pulk)
-110.5 720 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger 24N)-2.5 E
-(MB-System 5.0)72 768 Q(29 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E
-(121)180.545 E 0 Cg EP
-%%Page: 122 122
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<esri28485> : Pulk)110.5 84 Q -.15(ov)-.1 G 2.5
-(o1)-.05 G(942 / Gauss-Kruger 25N)-2.5 E(<esri28486> : Pulk)110.5 96 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger 26N)-2.5 E
-(<esri28487> : Pulk)110.5 108 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger 27N)-2.5 E(<esri28488> : Pulk)110.5 120 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger 28N)-2.5 E(<esri28489> : Pulk)
-110.5 132 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger 29N)-2.5 E
-(<esri28490> : Pulk)110.5 144 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger 30N)-2.5 E(<esri28491> : Pulk)110.5 156 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger 31N)-2.5 E(<esri28492> : Pulk)
-110.5 168 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger 32N)-2.5 E
-(<esri28600> : Qatar 1974 / Qatar National Grid)110.5 180 Q
-(<esri28991> : Amersfoort / RD Old)110.5 192 Q
-(<esri28992> : Amersfoort / RD Ne)110.5 204 Q(w)-.25 E
-(<esri29100> : SAD69 / Brazil Polyconic)110.5 216 Q
-(<esri29118> : SAD69 / UTM zone 18N)110.5 228 Q
-(<esri29119> : SAD69 / UTM zone 19N)110.5 240 Q
-(<esri29120> : SAD69 / UTM zone 20N)110.5 252 Q
-(<esri29121> : SAD69 / UTM zone 21N)110.5 264 Q
-(<esri29122> : SAD69 / UTM zone 22N)110.5 276 Q
-(<esri29177> : SAD69 / UTM zone 17S)110.5 288 Q
-(<esri29178> : SAD69 / UTM zone 18S)110.5 300 Q
-(<esri29179> : SAD69 / UTM zone 19S)110.5 312 Q
-(<esri29180> : SAD69 / UTM zone 20S)110.5 324 Q
-(<esri29181> : SAD69 / UTM zone 21S)110.5 336 Q
-(<esri29182> : SAD69 / UTM zone 22S)110.5 348 Q
-(<esri29183> : SAD69 / UTM zone 23S)110.5 360 Q
-(<esri29184> : SAD69 / UTM zone 24S)110.5 372 Q
-(<esri29185> : SAD69 / UTM zone 25S)110.5 384 Q
-(<esri29220> : Sapper Hill 1943 / UTM zone 20S)110.5 396 Q
-(<esri29221> : Sapper Hill 1943 / UTM zone 21S)110.5 408 Q
-(<esri29333> : Schw)110.5 420 Q(arzeck / UTM zone 33S)-.1 E
-(<esri29635> : Sudan / UTM zone 35N)110.5 432 Q
-(<esri29636> : Sudan / UTM zone 36N)110.5 444 Q(<esri29700> : T)110.5
-456 Q(ananari)-.8 E .3 -.15(ve \()-.25 H -.15(Pa).15 G
-(ris\) / Laborde Grid).15 E(<esri29738> : T)110.5 468 Q(ananari)-.8 E .3
--.15(ve / U)-.25 H(TM zone 38S).15 E(<esri29739> : T)110.5 480 Q
-(ananari)-.8 E .3 -.15(ve / U)-.25 H(TM zone 39S).15 E(<esri29849> : T)
-110.5 492 Q(imbalai 1948 / UTM zone 49N)-.35 E(<esri29850> : T)110.5 504
-Q(imbalai 1948 / UTM zone 50N)-.35 E(<esri29871> : T)110.5 516 Q
-(imbalai 1948 / R.S.O. Borneo \(ch\))-.35 E(<esri29872> : T)110.5 528 Q
-(imbalai 1948 / R.S.O. Borneo \(ft\))-.35 E(<esri29873> : T)110.5 540 Q
-(imbalai 1948 / R.S.O. Borneo \(m\))-.35 E
-(<esri29900> : TM65 / Irish National Grid)110.5 552 Q
-(<esri29901> : OSNI 1952 / Irish National Grid)110.5 564 Q
-(<esri29902> : TM65 / Irish Grid)110.5 576 Q
-(<esri29903> : TM75 / Irish Grid)110.5 588 Q(<esri30161> : T)110.5 600 Q
-(ok)-.8 E(yo / Japan Plane Rectangular CS I)-.15 E(<esri30162> : T)110.5
-612 Q(ok)-.8 E(yo / Japan Plane Rectangular CS II)-.15 E
-(<esri30163> : T)110.5 624 Q(ok)-.8 E
-(yo / Japan Plane Rectangular CS III)-.15 E(<esri30164> : T)110.5 636 Q
-(ok)-.8 E(yo / Japan Plane Rectangular CS IV)-.15 E(<esri30165> : T)
-110.5 648 Q(ok)-.8 E(yo / Japan Plane Rectangular CS V)-.15 E
-(<esri30166> : T)110.5 660 Q(ok)-.8 E
-(yo / Japan Plane Rectangular CS VI)-.15 E(<esri30167> : T)110.5 672 Q
-(ok)-.8 E(yo / Japan Plane Rectangular CS VII)-.15 E(<esri30168> : T)
-110.5 684 Q(ok)-.8 E(yo / Japan Plane Rectangular CS VIII)-.15 E
-(<esri30169> : T)110.5 696 Q(ok)-.8 E
-(yo / Japan Plane Rectangular CS IX)-.15 E(<esri30170> : T)110.5 708 Q
-(ok)-.8 E(yo / Japan Plane Rectangular CS X)-.15 E(<esri30171> : T)110.5
-720 Q(ok)-.8 E(yo / Japan Plane Rectangular CS XI)-.15 E(MB-System 5.0)
-72 768 Q(29 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E(122)180.545 E 0
-Cg EP
-%%Page: 123 123
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<esri30172> : T)110.5 84 Q(ok)-.8 E
-(yo / Japan Plane Rectangular CS XII)-.15 E(<esri30173> : T)110.5 96 Q
-(ok)-.8 E(yo / Japan Plane Rectangular CS XIII)-.15 E(<esri30174> : T)
-110.5 108 Q(ok)-.8 E(yo / Japan Plane Rectangular CS XIV)-.15 E
-(<esri30175> : T)110.5 120 Q(ok)-.8 E
-(yo / Japan Plane Rectangular CS XV)-.15 E(<esri30176> : T)110.5 132 Q
-(ok)-.8 E(yo / Japan Plane Rectangular CS XVI)-.15 E(<esri30177> : T)
-110.5 144 Q(ok)-.8 E(yo / Japan Plane Rectangular CS XVII)-.15 E
-(<esri30178> : T)110.5 156 Q(ok)-.8 E
-(yo / Japan Plane Rectangular CS XVIII)-.15 E(<esri30179> : T)110.5 168
-Q(ok)-.8 E(yo / Japan Plane Rectangular CS XIX)-.15 E(<esri30200> : T)
-110.5 180 Q(rinidad 1903 / T)-.35 E(rinidad Grid)-.35 E
-(<esri30339> : TC\(1948\) / UTM zone 39N)110.5 192 Q
-(<esri30340> : TC\(1948\) / UTM zone 40N)110.5 204 Q(<esri30491> : V)
-110.5 216 Q(oirol 1875 / Nord Algerie \(ancienne\))-1.29 E
-(<esri30492> : V)110.5 228 Q(oirol 1875 / Sud Algerie \(ancienne\))-1.29
-E(<esri30729> : Nord Sahara 1959 / UTM zone 29N)110.5 240 Q
-(<esri30730> : Nord Sahara 1959 / UTM zone 30N)110.5 252 Q
-(<esri30731> : Nord Sahara 1959 / UTM zone 31N)110.5 264 Q
-(<esri30732> : Nord Sahara 1959 / UTM zone 32N)110.5 276 Q
-(<esri30791> : Nord Sahara 1959 / V)110.5 288 Q(oirol Uni\214e Nord)
--1.29 E(<esri30792> : Nord Sahara 1959 / V)110.5 300 Q
-(oirol Uni\214e Sud)-1.29 E(<esri30800> : R)110.5 312 Q(T38 2.5 gon W)
--.6 E(<esri31028> : Y)110.5 324 Q(of)-1.1 E 2.5(f/U)-.25 G(TM zone 28N)
--2.5 E(<esri31121> : Zanderij / UTM zone 21N)110.5 336 Q
-(<esri31154> : Zanderij / TM 54 NW)110.5 348 Q
-(<esri31170> : Zanderij / Suriname Old TM)110.5 360 Q
-(<esri31171> : Zanderij / Suriname TM)110.5 372 Q
-(<esri31265> : MGI / 3-de)110.5 384 Q(gree Gauss zone 5)-.15 E
-(<esri31266> : MGI / 3-de)110.5 396 Q(gree Gauss zone 6)-.15 E
-(<esri31267> : MGI / 3-de)110.5 408 Q(gree Gauss zone 7)-.15 E
-(<esri31268> : MGI / 3-de)110.5 420 Q(gree Gauss zone 8)-.15 E
-(<esri31275> : MGI / Balkans zone 5)110.5 432 Q
-(<esri31276> : MGI / Balkans zone 6)110.5 444 Q
-(<esri31277> : MGI / Balkans zone 7)110.5 456 Q
-(<esri31278> : MGI / Balkans zone 8)110.5 468 Q
-(<esri31279> : MGI / Balkans zone 8)110.5 480 Q
-(<esri31281> : MGI \(Ferro\) / Austria W)110.5 492 Q(est Zone)-.8 E
-(<esri31282> : MGI \(Ferro\) / Austria Central Zone)110.5 504 Q
-(<esri31283> : MGI \(Ferro\) / Austria East Zone)110.5 516 Q
-(<esri31284> : MGI / M28)110.5 528 Q(<esri31285> : MGI / M31)110.5 540 Q
-(<esri31286> : MGI / M34)110.5 552 Q
-(<esri31287> : MGI / Austria Lambert)110.5 564 Q
-(<esri31291> : MGI \(Ferro\) / Austria W)110.5 576 Q(est Zone)-.8 E
-(<esri31292> : MGI \(Ferro\) / Austria Central Zone)110.5 588 Q
-(<esri31293> : MGI \(Ferro\) / Austria East Zone)110.5 600 Q
-(<esri31294> : MGI / M28)110.5 612 Q(<esri31295> : MGI / M31)110.5 624 Q
-(<esri31296> : MGI / M34)110.5 636 Q
-(<esri31297> : MGI / Austria Lambert)110.5 648 Q
-(<esri31300> : Belge 1972 / Belge Lambert 72)110.5 660 Q
-(<esri31370> : Belge 1972 / Belgian Lambert 72)110.5 672 Q
-(<esri31461> : DHDN / 3-de)110.5 684 Q(gree Gauss zone 1)-.15 E
-(<esri31462> : DHDN / 3-de)110.5 696 Q(gree Gauss zone 2)-.15 E
-(<esri31463> : DHDN / 3-de)110.5 708 Q(gree Gauss zone 3)-.15 E
-(<esri31464> : DHDN / 3-de)110.5 720 Q(gree Gauss zone 4)-.15 E
-(MB-System 5.0)72 768 Q(29 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E
-(123)180.545 E 0 Cg EP
-%%Page: 124 124
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<esri31465> : DHDN / 3-de)110.5 84 Q
-(gree Gauss zone 5)-.15 E(<esri31466> : DHDN / Gauss-Kruger zone 2)110.5
-96 Q(<esri31467> : DHDN / Gauss-Kruger zone 3)110.5 108 Q
-(<esri31468> : DHDN / Gauss-Kruger zone 4)110.5 120 Q
-(<esri31469> : DHDN / Gauss-Kruger zone 5)110.5 132 Q
-(<esri31528> : Conakry 1905 / UTM zone 28N)110.5 144 Q
-(<esri31529> : Conakry 1905 / UTM zone 29N)110.5 156 Q
-(<esri31600> : Dealul Piscului 1933/ Stereo 33)110.5 168 Q
-(<esri31700> : Dealul Piscului 1970/ Stereo 70)110.5 180 Q
-(<esri31838> : NGN / UTM zone 38N)110.5 192 Q
-(<esri31839> : NGN / UTM zone 39N)110.5 204 Q(<esri31900> : KUD)110.5
-216 Q(AMS / KTM)-.4 E(<esri31986> : SIRGAS / UTM zone 17N)110.5 228 Q
-(<esri31987> : SIRGAS / UTM zone 18N)110.5 240 Q
-(<esri31988> : SIRGAS / UTM zone 19N)110.5 252 Q
-(<esri31989> : SIRGAS / UTM zone 20N)110.5 264 Q
-(<esri31990> : SIRGAS / UTM zone 21N)110.5 276 Q
-(<esri31991> : SIRGAS / UTM zone 22N)110.5 288 Q
-(<esri31992> : SIRGAS / UTM zone 17S)110.5 300 Q
-(<esri31993> : SIRGAS / UTM zone 18S)110.5 312 Q
-(<esri31994> : SIRGAS / UTM zone 19S)110.5 324 Q
-(<esri31995> : SIRGAS / UTM zone 20S)110.5 336 Q
-(<esri31996> : SIRGAS / UTM zone 21S)110.5 348 Q
-(<esri31997> : SIRGAS / UTM zone 22S)110.5 360 Q
-(<esri31998> : SIRGAS / UTM zone 23S)110.5 372 Q
-(<esri31999> : SIRGAS / UTM zone 24S)110.5 384 Q
-(<esri32000> : SIRGAS / UTM zone 25S)110.5 396 Q(<esri32001> : N)110.5
-408 Q(AD27 / Montana North)-.35 E(<esri32002> : N)110.5 420 Q
-(AD27 / Montana Central)-.35 E(<esri32003> : N)110.5 432 Q
-(AD27 / Montana South)-.35 E(<esri32005> : N)110.5 444 Q
-(AD27 / Nebraska North)-.35 E(<esri32006> : N)110.5 456 Q
-(AD27 / Nebraska South)-.35 E(<esri32007> : N)110.5 468 Q(AD27 / Ne)-.35
-E -.25(va)-.25 G(da East).25 E(<esri32008> : N)110.5 480 Q(AD27 / Ne)
--.35 E -.25(va)-.25 G(da Central).25 E(<esri32009> : N)110.5 492 Q
-(AD27 / Ne)-.35 E -.25(va)-.25 G(da W).25 E(est)-.8 E(<esri32010> : N)
-110.5 504 Q(AD27 / Ne)-.35 E 2.5(wH)-.25 G(ampshire)-2.5 E
-(<esri32011> : N)110.5 516 Q(AD27 / Ne)-.35 E 2.5(wJ)-.25 G(erse)-2.5 E
-(y)-.15 E(<esri32012> : N)110.5 528 Q(AD27 / Ne)-.35 E 2.5(wM)-.25 G
--.15(ex)-2.5 G(ico East).15 E(<esri32013> : N)110.5 540 Q(AD27 / Ne)-.35
-E 2.5(wM)-.25 G -.15(ex)-2.5 G(ico Central).15 E(<esri32014> : N)110.5
-552 Q(AD27 / Ne)-.35 E 2.5(wM)-.25 G -.15(ex)-2.5 G(ico W).15 E(est)-.8
-E(<esri32015> : N)110.5 564 Q(AD27 / Ne)-.35 E 2.5(wY)-.25 G(ork East)
--3.6 E(<esri32016> : N)110.5 576 Q(AD27 / Ne)-.35 E 2.5(wY)-.25 G
-(ork Central)-3.6 E(<esri32017> : N)110.5 588 Q(AD27 / Ne)-.35 E 2.5(wY)
--.25 G(ork W)-3.6 E(est)-.8 E(<esri32018> : N)110.5 600 Q(AD27 / Ne)-.35
-E 2.5(wY)-.25 G(ork Long Island)-3.6 E(<esri32019> : N)110.5 612 Q
-(AD27 / North Carolina)-.35 E(<esri32020> : N)110.5 624 Q
-(AD27 / North Dak)-.35 E(ota North)-.1 E(<esri32021> : N)110.5 636 Q
-(AD27 / North Dak)-.35 E(ota South)-.1 E(<esri32022> : N)110.5 648 Q
-(AD27 / Ohio North)-.35 E(<esri32023> : N)110.5 660 Q(AD27 / Ohio South)
--.35 E(<esri32024> : N)110.5 672 Q(AD27 / Oklahoma North)-.35 E
-(<esri32025> : N)110.5 684 Q(AD27 / Oklahoma South)-.35 E
-(<esri32026> : N)110.5 696 Q(AD27 / Ore)-.35 E(gon North)-.15 E
-(<esri32027> : N)110.5 708 Q(AD27 / Ore)-.35 E(gon South)-.15 E
-(<esri32028> : N)110.5 720 Q(AD27 / Pennsylv)-.35 E(ania North)-.25 E
-(MB-System 5.0)72 768 Q(29 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E
-(124)180.545 E 0 Cg EP
-%%Page: 125 125
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<esri32029> : N)110.5 84 Q(AD27 / Pennsylv)-.35 E
-(ania South)-.25 E(<esri32030> : N)110.5 96 Q(AD27 / Rhode Island)-.35 E
-(<esri32031> : N)110.5 108 Q(AD27 / South Carolina North)-.35 E
-(<esri32033> : N)110.5 120 Q(AD27 / South Carolina South)-.35 E
-(<esri32034> : N)110.5 132 Q(AD27 / South Dak)-.35 E(ota North)-.1 E
-(<esri32035> : N)110.5 144 Q(AD27 / South Dak)-.35 E(ota South)-.1 E
-(<esri32036> : N)110.5 156 Q(AD27 / T)-.35 E(ennessee)-.7 E
-(<esri32037> : N)110.5 168 Q(AD27 / T)-.35 E -.15(ex)-.7 G(as North).15
-E(<esri32038> : N)110.5 180 Q(AD27 / T)-.35 E -.15(ex)-.7 G
-(as North Central).15 E(<esri32039> : N)110.5 192 Q(AD27 / T)-.35 E -.15
-(ex)-.7 G(as Central).15 E(<esri32040> : N)110.5 204 Q(AD27 / T)-.35 E
--.15(ex)-.7 G(as South Central).15 E(<esri32041> : N)110.5 216 Q
-(AD27 / T)-.35 E -.15(ex)-.7 G(as South).15 E(<esri32042> : N)110.5 228
-Q(AD27 / Utah North)-.35 E(<esri32043> : N)110.5 240 Q
-(AD27 / Utah Central)-.35 E(<esri32044> : N)110.5 252 Q
-(AD27 / Utah South)-.35 E(<esri32045> : N)110.5 264 Q(AD27 / V)-.35 E
-(ermont)-1.11 E(<esri32046> : N)110.5 276 Q(AD27 / V)-.35 E(ir)-.6 E
-(ginia North)-.18 E(<esri32047> : N)110.5 288 Q(AD27 / V)-.35 E(ir)-.6 E
-(ginia South)-.18 E(<esri32048> : N)110.5 300 Q(AD27 / W)-.35 E
-(ashington North)-.8 E(<esri32049> : N)110.5 312 Q(AD27 / W)-.35 E
-(ashington South)-.8 E(<esri32050> : N)110.5 324 Q(AD27 / W)-.35 E
-(est V)-.8 E(ir)-.6 E(ginia North)-.18 E(<esri32051> : N)110.5 336 Q
-(AD27 / W)-.35 E(est V)-.8 E(ir)-.6 E(ginia South)-.18 E
-(<esri32052> : N)110.5 348 Q(AD27 / W)-.35 E(isconsin North)-.4 E
-(<esri32053> : N)110.5 360 Q(AD27 / W)-.35 E(isconsin Central)-.4 E
-(<esri32054> : N)110.5 372 Q(AD27 / W)-.35 E(isconsin South)-.4 E
-(<esri32055> : N)110.5 384 Q(AD27 / W)-.35 E(yoming East)-.73 E
-(<esri32056> : N)110.5 396 Q(AD27 / W)-.35 E(yoming East Central)-.73 E
-(<esri32057> : N)110.5 408 Q(AD27 / W)-.35 E(yoming W)-.73 E
-(est Central)-.8 E(<esri32058> : N)110.5 420 Q(AD27 / W)-.35 E(yoming W)
--.73 E(est)-.8 E(<esri32061> : N)110.5 432 Q(AD27 / Guatemala Norte)-.35
-E(<esri32062> : N)110.5 444 Q(AD27 / Guatemala Sur)-.35 E
-(<esri32064> : N)110.5 456 Q(AD27 / BLM 14N \(ftUS\))-.35 E
-(<esri32065> : N)110.5 468 Q(AD27 / BLM 15N \(ftUS\))-.35 E
-(<esri32066> : N)110.5 480 Q(AD27 / BLM 16N \(ftUS\))-.35 E
-(<esri32067> : N)110.5 492 Q(AD27 / BLM 17N \(ftUS\))-.35 E
-(<esri32074> : N)110.5 504 Q(AD27 / BLM 14N \(feet\))-.35 E
-(<esri32075> : N)110.5 516 Q(AD27 / BLM 15N \(feet\))-.35 E
-(<esri32076> : N)110.5 528 Q(AD27 / BLM 16N \(feet\))-.35 E
-(<esri32077> : N)110.5 540 Q(AD27 / BLM 17N \(feet\))-.35 E
-(<esri32081> : N)110.5 552 Q(AD27 / MTM zone 1)-.35 E(<esri32082> : N)
-110.5 564 Q(AD27 / MTM zone 2)-.35 E(<esri32083> : N)110.5 576 Q
-(AD27 / MTM zone 3)-.35 E(<esri32084> : N)110.5 588 Q(AD27 / MTM zone 4)
--.35 E(<esri32085> : N)110.5 600 Q(AD27 / MTM zone 5)-.35 E
-(<esri32086> : N)110.5 612 Q(AD27 / MTM zone 6)-.35 E(<esri32098> : N)
-110.5 624 Q(AD27 / Quebec Lambert)-.35 E(<esri32100> : N)110.5 636 Q
-(AD83 / Montana)-.35 E(<esri32104> : N)110.5 648 Q(AD83 / Nebraska)-.35
-E(<esri32107> : N)110.5 660 Q(AD83 / Ne)-.35 E -.25(va)-.25 G(da East)
-.25 E(<esri32108> : N)110.5 672 Q(AD83 / Ne)-.35 E -.25(va)-.25 G
-(da Central).25 E(<esri32109> : N)110.5 684 Q(AD83 / Ne)-.35 E -.25(va)
--.25 G(da W).25 E(est)-.8 E(<esri32110> : N)110.5 696 Q(AD83 / Ne)-.35 E
-2.5(wH)-.25 G(ampshire)-2.5 E(<esri32111> : N)110.5 708 Q(AD83 / Ne)-.35
-E 2.5(wJ)-.25 G(erse)-2.5 E(y)-.15 E(<esri32112> : N)110.5 720 Q
-(AD83 / Ne)-.35 E 2.5(wM)-.25 G -.15(ex)-2.5 G(ico East).15 E
-(MB-System 5.0)72 768 Q(29 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E
-(125)180.545 E 0 Cg EP
-%%Page: 126 126
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<esri32113> : N)110.5 84 Q(AD83 / Ne)-.35 E 2.5
-(wM)-.25 G -.15(ex)-2.5 G(ico Central).15 E(<esri32114> : N)110.5 96 Q
-(AD83 / Ne)-.35 E 2.5(wM)-.25 G -.15(ex)-2.5 G(ico W).15 E(est)-.8 E
-(<esri32115> : N)110.5 108 Q(AD83 / Ne)-.35 E 2.5(wY)-.25 G(ork East)
--3.6 E(<esri32116> : N)110.5 120 Q(AD83 / Ne)-.35 E 2.5(wY)-.25 G
-(ork Central)-3.6 E(<esri32117> : N)110.5 132 Q(AD83 / Ne)-.35 E 2.5(wY)
--.25 G(ork W)-3.6 E(est)-.8 E(<esri32118> : N)110.5 144 Q(AD83 / Ne)-.35
-E 2.5(wY)-.25 G(ork Long Island)-3.6 E(<esri32119> : N)110.5 156 Q
-(AD83 / North Carolina)-.35 E(<esri32120> : N)110.5 168 Q
-(AD83 / North Dak)-.35 E(ota North)-.1 E(<esri32121> : N)110.5 180 Q
-(AD83 / North Dak)-.35 E(ota South)-.1 E(<esri32122> : N)110.5 192 Q
-(AD83 / Ohio North)-.35 E(<esri32123> : N)110.5 204 Q(AD83 / Ohio South)
--.35 E(<esri32124> : N)110.5 216 Q(AD83 / Oklahoma North)-.35 E
-(<esri32125> : N)110.5 228 Q(AD83 / Oklahoma South)-.35 E
-(<esri32126> : N)110.5 240 Q(AD83 / Ore)-.35 E(gon North)-.15 E
-(<esri32127> : N)110.5 252 Q(AD83 / Ore)-.35 E(gon South)-.15 E
-(<esri32128> : N)110.5 264 Q(AD83 / Pennsylv)-.35 E(ania North)-.25 E
-(<esri32129> : N)110.5 276 Q(AD83 / Pennsylv)-.35 E(ania South)-.25 E
-(<esri32130> : N)110.5 288 Q(AD83 / Rhode Island)-.35 E(<esri32133> : N)
-110.5 300 Q(AD83 / South Carolina)-.35 E(<esri32134> : N)110.5 312 Q
-(AD83 / South Dak)-.35 E(ota North)-.1 E(<esri32135> : N)110.5 324 Q
-(AD83 / South Dak)-.35 E(ota South)-.1 E(<esri32136> : N)110.5 336 Q
-(AD83 / T)-.35 E(ennessee)-.7 E(<esri32137> : N)110.5 348 Q(AD83 / T)
--.35 E -.15(ex)-.7 G(as North).15 E(<esri32138> : N)110.5 360 Q
-(AD83 / T)-.35 E -.15(ex)-.7 G(as North Central).15 E(<esri32139> : N)
-110.5 372 Q(AD83 / T)-.35 E -.15(ex)-.7 G(as Central).15 E
-(<esri32140> : N)110.5 384 Q(AD83 / T)-.35 E -.15(ex)-.7 G
-(as South Central).15 E(<esri32141> : N)110.5 396 Q(AD83 / T)-.35 E -.15
-(ex)-.7 G(as South).15 E(<esri32142> : N)110.5 408 Q(AD83 / Utah North)
--.35 E(<esri32143> : N)110.5 420 Q(AD83 / Utah Central)-.35 E
-(<esri32144> : N)110.5 432 Q(AD83 / Utah South)-.35 E(<esri32145> : N)
-110.5 444 Q(AD83 / V)-.35 E(ermont)-1.11 E(<esri32146> : N)110.5 456 Q
-(AD83 / V)-.35 E(ir)-.6 E(ginia North)-.18 E(<esri32147> : N)110.5 468 Q
-(AD83 / V)-.35 E(ir)-.6 E(ginia South)-.18 E(<esri32148> : N)110.5 480 Q
-(AD83 / W)-.35 E(ashington North)-.8 E(<esri32149> : N)110.5 492 Q
-(AD83 / W)-.35 E(ashington South)-.8 E(<esri32150> : N)110.5 504 Q
-(AD83 / W)-.35 E(est V)-.8 E(ir)-.6 E(ginia North)-.18 E
-(<esri32151> : N)110.5 516 Q(AD83 / W)-.35 E(est V)-.8 E(ir)-.6 E
-(ginia South)-.18 E(<esri32152> : N)110.5 528 Q(AD83 / W)-.35 E
-(isconsin North)-.4 E(<esri32153> : N)110.5 540 Q(AD83 / W)-.35 E
-(isconsin Central)-.4 E(<esri32154> : N)110.5 552 Q(AD83 / W)-.35 E
-(isconsin South)-.4 E(<esri32155> : N)110.5 564 Q(AD83 / W)-.35 E
-(yoming East)-.73 E(<esri32156> : N)110.5 576 Q(AD83 / W)-.35 E
-(yoming East Central)-.73 E(<esri32157> : N)110.5 588 Q(AD83 / W)-.35 E
-(yoming W)-.73 E(est Central)-.8 E(<esri32158> : N)110.5 600 Q(AD83 / W)
--.35 E(yoming W)-.73 E(est)-.8 E(<esri32161> : N)110.5 612 Q
-(AD83 / Puerto Rico & V)-.35 E(ir)-.6 E(gin Is.)-.18 E(<esri32180> : N)
-110.5 624 Q(AD83 / SCoPQ zone 2)-.35 E(<esri32181> : N)110.5 636 Q
-(AD83 / MTM zone 1)-.35 E(<esri32182> : N)110.5 648 Q(AD83 / MTM zone 2)
--.35 E(<esri32183> : N)110.5 660 Q(AD83 / MTM zone 3)-.35 E
-(<esri32184> : N)110.5 672 Q(AD83 / MTM zone 4)-.35 E(<esri32185> : N)
-110.5 684 Q(AD83 / MTM zone 5)-.35 E(<esri32186> : N)110.5 696 Q
-(AD83 / MTM zone 6)-.35 E(<esri32187> : N)110.5 708 Q(AD83 / MTM zone 7)
--.35 E(<esri32188> : N)110.5 720 Q(AD83 / MTM zone 8)-.35 E
-(MB-System 5.0)72 768 Q(29 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E
-(126)180.545 E 0 Cg EP
-%%Page: 127 127
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<esri32189> : N)110.5 84 Q(AD83 / MTM zone 9)-.35
-E(<esri32190> : N)110.5 96 Q(AD83 / MTM zone 10)-.35 E(<esri32191> : N)
-110.5 108 Q(AD83 / MTM zone 11)-.35 E(<esri32192> : N)110.5 120 Q
-(AD83 / MTM zone 12)-.35 E(<esri32193> : N)110.5 132 Q
-(AD83 / MTM zone 13)-.35 E(<esri32194> : N)110.5 144 Q
-(AD83 / MTM zone 14)-.35 E(<esri32195> : N)110.5 156 Q
-(AD83 / MTM zone 15)-.35 E(<esri32196> : N)110.5 168 Q
-(AD83 / MTM zone 16)-.35 E(<esri32197> : N)110.5 180 Q
-(AD83 / MTM zone 17)-.35 E(<esri32198> : N)110.5 192 Q
-(AD83 / Quebec Lambert)-.35 E(<esri32201> : WGS 72 / UTM zone 1N)110.5
-204 Q(<esri32202> : WGS 72 / UTM zone 2N)110.5 216 Q
-(<esri32203> : WGS 72 / UTM zone 3N)110.5 228 Q
-(<esri32204> : WGS 72 / UTM zone 4N)110.5 240 Q
-(<esri32205> : WGS 72 / UTM zone 5N)110.5 252 Q
-(<esri32206> : WGS 72 / UTM zone 6N)110.5 264 Q
-(<esri32207> : WGS 72 / UTM zone 7N)110.5 276 Q
-(<esri32208> : WGS 72 / UTM zone 8N)110.5 288 Q
-(<esri32209> : WGS 72 / UTM zone 9N)110.5 300 Q
-(<esri32210> : WGS 72 / UTM zone 10N)110.5 312 Q
-(<esri32211> : WGS 72 / UTM zone 11N)110.5 324 Q
-(<esri32212> : WGS 72 / UTM zone 12N)110.5 336 Q
-(<esri32213> : WGS 72 / UTM zone 13N)110.5 348 Q
-(<esri32214> : WGS 72 / UTM zone 14N)110.5 360 Q
-(<esri32215> : WGS 72 / UTM zone 15N)110.5 372 Q
-(<esri32216> : WGS 72 / UTM zone 16N)110.5 384 Q
-(<esri32217> : WGS 72 / UTM zone 17N)110.5 396 Q
-(<esri32218> : WGS 72 / UTM zone 18N)110.5 408 Q
-(<esri32219> : WGS 72 / UTM zone 19N)110.5 420 Q
-(<esri32220> : WGS 72 / UTM zone 20N)110.5 432 Q
-(<esri32221> : WGS 72 / UTM zone 21N)110.5 444 Q
-(<esri32222> : WGS 72 / UTM zone 22N)110.5 456 Q
-(<esri32223> : WGS 72 / UTM zone 23N)110.5 468 Q
-(<esri32224> : WGS 72 / UTM zone 24N)110.5 480 Q
-(<esri32225> : WGS 72 / UTM zone 25N)110.5 492 Q
-(<esri32226> : WGS 72 / UTM zone 26N)110.5 504 Q
-(<esri32227> : WGS 72 / UTM zone 27N)110.5 516 Q
-(<esri32228> : WGS 72 / UTM zone 28N)110.5 528 Q
-(<esri32229> : WGS 72 / UTM zone 29N)110.5 540 Q
-(<esri32230> : WGS 72 / UTM zone 30N)110.5 552 Q
-(<esri32231> : WGS 72 / UTM zone 31N)110.5 564 Q
-(<esri32232> : WGS 72 / UTM zone 32N)110.5 576 Q
-(<esri32233> : WGS 72 / UTM zone 33N)110.5 588 Q
-(<esri32234> : WGS 72 / UTM zone 34N)110.5 600 Q
-(<esri32235> : WGS 72 / UTM zone 35N)110.5 612 Q
-(<esri32236> : WGS 72 / UTM zone 36N)110.5 624 Q
-(<esri32237> : WGS 72 / UTM zone 37N)110.5 636 Q
-(<esri32238> : WGS 72 / UTM zone 38N)110.5 648 Q
-(<esri32239> : WGS 72 / UTM zone 39N)110.5 660 Q
-(<esri32240> : WGS 72 / UTM zone 40N)110.5 672 Q
-(<esri32241> : WGS 72 / UTM zone 41N)110.5 684 Q
-(<esri32242> : WGS 72 / UTM zone 42N)110.5 696 Q
-(<esri32243> : WGS 72 / UTM zone 43N)110.5 708 Q
-(<esri32244> : WGS 72 / UTM zone 44N)110.5 720 Q(MB-System 5.0)72 768 Q
-(29 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E(127)180.545 E 0 Cg EP
-%%Page: 128 128
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<esri32245> : WGS 72 / UTM zone 45N)110.5 84 Q
-(<esri32246> : WGS 72 / UTM zone 46N)110.5 96 Q
-(<esri32247> : WGS 72 / UTM zone 47N)110.5 108 Q
-(<esri32248> : WGS 72 / UTM zone 48N)110.5 120 Q
-(<esri32249> : WGS 72 / UTM zone 49N)110.5 132 Q
-(<esri32250> : WGS 72 / UTM zone 50N)110.5 144 Q
-(<esri32251> : WGS 72 / UTM zone 51N)110.5 156 Q
-(<esri32252> : WGS 72 / UTM zone 52N)110.5 168 Q
-(<esri32253> : WGS 72 / UTM zone 53N)110.5 180 Q
-(<esri32254> : WGS 72 / UTM zone 54N)110.5 192 Q
-(<esri32255> : WGS 72 / UTM zone 55N)110.5 204 Q
-(<esri32256> : WGS 72 / UTM zone 56N)110.5 216 Q
-(<esri32257> : WGS 72 / UTM zone 57N)110.5 228 Q
-(<esri32258> : WGS 72 / UTM zone 58N)110.5 240 Q
-(<esri32259> : WGS 72 / UTM zone 59N)110.5 252 Q
-(<esri32260> : WGS 72 / UTM zone 60N)110.5 264 Q
-(<esri32301> : WGS 72 / UTM zone 1S)110.5 276 Q
-(<esri32302> : WGS 72 / UTM zone 2S)110.5 288 Q
-(<esri32303> : WGS 72 / UTM zone 3S)110.5 300 Q
-(<esri32304> : WGS 72 / UTM zone 4S)110.5 312 Q
-(<esri32305> : WGS 72 / UTM zone 5S)110.5 324 Q
-(<esri32306> : WGS 72 / UTM zone 6S)110.5 336 Q
-(<esri32307> : WGS 72 / UTM zone 7S)110.5 348 Q
-(<esri32308> : WGS 72 / UTM zone 8S)110.5 360 Q
-(<esri32309> : WGS 72 / UTM zone 9S)110.5 372 Q
-(<esri32310> : WGS 72 / UTM zone 10S)110.5 384 Q
-(<esri32311> : WGS 72 / UTM zone 11S)110.5 396 Q
-(<esri32312> : WGS 72 / UTM zone 12S)110.5 408 Q
-(<esri32313> : WGS 72 / UTM zone 13S)110.5 420 Q
-(<esri32314> : WGS 72 / UTM zone 14S)110.5 432 Q
-(<esri32315> : WGS 72 / UTM zone 15S)110.5 444 Q
-(<esri32316> : WGS 72 / UTM zone 16S)110.5 456 Q
-(<esri32317> : WGS 72 / UTM zone 17S)110.5 468 Q
-(<esri32318> : WGS 72 / UTM zone 18S)110.5 480 Q
-(<esri32319> : WGS 72 / UTM zone 19S)110.5 492 Q
-(<esri32320> : WGS 72 / UTM zone 20S)110.5 504 Q
-(<esri32321> : WGS 72 / UTM zone 21S)110.5 516 Q
-(<esri32322> : WGS 72 / UTM zone 22S)110.5 528 Q
-(<esri32323> : WGS 72 / UTM zone 23S)110.5 540 Q
-(<esri32324> : WGS 72 / UTM zone 24S)110.5 552 Q
-(<esri32325> : WGS 72 / UTM zone 25S)110.5 564 Q
-(<esri32326> : WGS 72 / UTM zone 26S)110.5 576 Q
-(<esri32327> : WGS 72 / UTM zone 27S)110.5 588 Q
-(<esri32328> : WGS 72 / UTM zone 28S)110.5 600 Q
-(<esri32329> : WGS 72 / UTM zone 29S)110.5 612 Q
-(<esri32330> : WGS 72 / UTM zone 30S)110.5 624 Q
-(<esri32331> : WGS 72 / UTM zone 31S)110.5 636 Q
-(<esri32332> : WGS 72 / UTM zone 32S)110.5 648 Q
-(<esri32333> : WGS 72 / UTM zone 33S)110.5 660 Q
-(<esri32334> : WGS 72 / UTM zone 34S)110.5 672 Q
-(<esri32335> : WGS 72 / UTM zone 35S)110.5 684 Q
-(<esri32336> : WGS 72 / UTM zone 36S)110.5 696 Q
-(<esri32337> : WGS 72 / UTM zone 37S)110.5 708 Q
-(<esri32338> : WGS 72 / UTM zone 38S)110.5 720 Q(MB-System 5.0)72 768 Q
-(29 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E(128)180.545 E 0 Cg EP
-%%Page: 129 129
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<esri32339> : WGS 72 / UTM zone 39S)110.5 84 Q
-(<esri32340> : WGS 72 / UTM zone 40S)110.5 96 Q
-(<esri32341> : WGS 72 / UTM zone 41S)110.5 108 Q
-(<esri32342> : WGS 72 / UTM zone 42S)110.5 120 Q
-(<esri32343> : WGS 72 / UTM zone 43S)110.5 132 Q
-(<esri32344> : WGS 72 / UTM zone 44S)110.5 144 Q
-(<esri32345> : WGS 72 / UTM zone 45S)110.5 156 Q
-(<esri32346> : WGS 72 / UTM zone 46S)110.5 168 Q
-(<esri32347> : WGS 72 / UTM zone 47S)110.5 180 Q
-(<esri32348> : WGS 72 / UTM zone 48S)110.5 192 Q
-(<esri32349> : WGS 72 / UTM zone 49S)110.5 204 Q
-(<esri32350> : WGS 72 / UTM zone 50S)110.5 216 Q
-(<esri32351> : WGS 72 / UTM zone 51S)110.5 228 Q
-(<esri32352> : WGS 72 / UTM zone 52S)110.5 240 Q
-(<esri32353> : WGS 72 / UTM zone 53S)110.5 252 Q
-(<esri32354> : WGS 72 / UTM zone 54S)110.5 264 Q
-(<esri32355> : WGS 72 / UTM zone 55S)110.5 276 Q
-(<esri32356> : WGS 72 / UTM zone 56S)110.5 288 Q
-(<esri32357> : WGS 72 / UTM zone 57S)110.5 300 Q
-(<esri32358> : WGS 72 / UTM zone 58S)110.5 312 Q
-(<esri32359> : WGS 72 / UTM zone 59S)110.5 324 Q
-(<esri32360> : WGS 72 / UTM zone 60S)110.5 336 Q
-(<esri32401> : WGS 72BE / UTM zone 1N)110.5 348 Q
-(<esri32402> : WGS 72BE / UTM zone 2N)110.5 360 Q
-(<esri32403> : WGS 72BE / UTM zone 3N)110.5 372 Q
-(<esri32404> : WGS 72BE / UTM zone 4N)110.5 384 Q
-(<esri32405> : WGS 72BE / UTM zone 5N)110.5 396 Q
-(<esri32406> : WGS 72BE / UTM zone 6N)110.5 408 Q
-(<esri32407> : WGS 72BE / UTM zone 7N)110.5 420 Q
-(<esri32408> : WGS 72BE / UTM zone 8N)110.5 432 Q
-(<esri32409> : WGS 72BE / UTM zone 9N)110.5 444 Q
-(<esri32410> : WGS 72BE / UTM zone 10N)110.5 456 Q
-(<esri32411> : WGS 72BE / UTM zone 11N)110.5 468 Q
-(<esri32412> : WGS 72BE / UTM zone 12N)110.5 480 Q
-(<esri32413> : WGS 72BE / UTM zone 13N)110.5 492 Q
-(<esri32414> : WGS 72BE / UTM zone 14N)110.5 504 Q
-(<esri32415> : WGS 72BE / UTM zone 15N)110.5 516 Q
-(<esri32416> : WGS 72BE / UTM zone 16N)110.5 528 Q
-(<esri32417> : WGS 72BE / UTM zone 17N)110.5 540 Q
-(<esri32418> : WGS 72BE / UTM zone 18N)110.5 552 Q
-(<esri32419> : WGS 72BE / UTM zone 19N)110.5 564 Q
-(<esri32420> : WGS 72BE / UTM zone 20N)110.5 576 Q
-(<esri32421> : WGS 72BE / UTM zone 21N)110.5 588 Q
-(<esri32422> : WGS 72BE / UTM zone 22N)110.5 600 Q
-(<esri32423> : WGS 72BE / UTM zone 23N)110.5 612 Q
-(<esri32424> : WGS 72BE / UTM zone 24N)110.5 624 Q
-(<esri32425> : WGS 72BE / UTM zone 25N)110.5 636 Q
-(<esri32426> : WGS 72BE / UTM zone 26N)110.5 648 Q
-(<esri32427> : WGS 72BE / UTM zone 27N)110.5 660 Q
-(<esri32428> : WGS 72BE / UTM zone 28N)110.5 672 Q
-(<esri32429> : WGS 72BE / UTM zone 29N)110.5 684 Q
-(<esri32430> : WGS 72BE / UTM zone 30N)110.5 696 Q
-(<esri32431> : WGS 72BE / UTM zone 31N)110.5 708 Q
-(<esri32432> : WGS 72BE / UTM zone 32N)110.5 720 Q(MB-System 5.0)72 768
-Q(29 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E(129)180.545 E 0 Cg EP
-%%Page: 130 130
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<esri32433> : WGS 72BE / UTM zone 33N)110.5 84 Q
-(<esri32434> : WGS 72BE / UTM zone 34N)110.5 96 Q
-(<esri32435> : WGS 72BE / UTM zone 35N)110.5 108 Q
-(<esri32436> : WGS 72BE / UTM zone 36N)110.5 120 Q
-(<esri32437> : WGS 72BE / UTM zone 37N)110.5 132 Q
-(<esri32438> : WGS 72BE / UTM zone 38N)110.5 144 Q
-(<esri32439> : WGS 72BE / UTM zone 39N)110.5 156 Q
-(<esri32440> : WGS 72BE / UTM zone 40N)110.5 168 Q
-(<esri32441> : WGS 72BE / UTM zone 41N)110.5 180 Q
-(<esri32442> : WGS 72BE / UTM zone 42N)110.5 192 Q
-(<esri32443> : WGS 72BE / UTM zone 43N)110.5 204 Q
-(<esri32444> : WGS 72BE / UTM zone 44N)110.5 216 Q
-(<esri32445> : WGS 72BE / UTM zone 45N)110.5 228 Q
-(<esri32446> : WGS 72BE / UTM zone 46N)110.5 240 Q
-(<esri32447> : WGS 72BE / UTM zone 47N)110.5 252 Q
-(<esri32448> : WGS 72BE / UTM zone 48N)110.5 264 Q
-(<esri32449> : WGS 72BE / UTM zone 49N)110.5 276 Q
-(<esri32450> : WGS 72BE / UTM zone 50N)110.5 288 Q
-(<esri32451> : WGS 72BE / UTM zone 51N)110.5 300 Q
-(<esri32452> : WGS 72BE / UTM zone 52N)110.5 312 Q
-(<esri32453> : WGS 72BE / UTM zone 53N)110.5 324 Q
-(<esri32454> : WGS 72BE / UTM zone 54N)110.5 336 Q
-(<esri32455> : WGS 72BE / UTM zone 55N)110.5 348 Q
-(<esri32456> : WGS 72BE / UTM zone 56N)110.5 360 Q
-(<esri32457> : WGS 72BE / UTM zone 57N)110.5 372 Q
-(<esri32458> : WGS 72BE / UTM zone 58N)110.5 384 Q
-(<esri32459> : WGS 72BE / UTM zone 59N)110.5 396 Q
-(<esri32460> : WGS 72BE / UTM zone 60N)110.5 408 Q
-(<esri32501> : WGS 72BE / UTM zone 1S)110.5 420 Q
-(<esri32502> : WGS 72BE / UTM zone 2S)110.5 432 Q
-(<esri32503> : WGS 72BE / UTM zone 3S)110.5 444 Q
-(<esri32504> : WGS 72BE / UTM zone 4S)110.5 456 Q
-(<esri32505> : WGS 72BE / UTM zone 5S)110.5 468 Q
-(<esri32506> : WGS 72BE / UTM zone 6S)110.5 480 Q
-(<esri32507> : WGS 72BE / UTM zone 7S)110.5 492 Q
-(<esri32508> : WGS 72BE / UTM zone 8S)110.5 504 Q
-(<esri32509> : WGS 72BE / UTM zone 9S)110.5 516 Q
-(<esri32510> : WGS 72BE / UTM zone 10S)110.5 528 Q
-(<esri32511> : WGS 72BE / UTM zone 11S)110.5 540 Q
-(<esri32512> : WGS 72BE / UTM zone 12S)110.5 552 Q
-(<esri32513> : WGS 72BE / UTM zone 13S)110.5 564 Q
-(<esri32514> : WGS 72BE / UTM zone 14S)110.5 576 Q
-(<esri32515> : WGS 72BE / UTM zone 15S)110.5 588 Q
-(<esri32516> : WGS 72BE / UTM zone 16S)110.5 600 Q
-(<esri32517> : WGS 72BE / UTM zone 17S)110.5 612 Q
-(<esri32518> : WGS 72BE / UTM zone 18S)110.5 624 Q
-(<esri32519> : WGS 72BE / UTM zone 19S)110.5 636 Q
-(<esri32520> : WGS 72BE / UTM zone 20S)110.5 648 Q
-(<esri32521> : WGS 72BE / UTM zone 21S)110.5 660 Q
-(<esri32522> : WGS 72BE / UTM zone 22S)110.5 672 Q
-(<esri32523> : WGS 72BE / UTM zone 23S)110.5 684 Q
-(<esri32524> : WGS 72BE / UTM zone 24S)110.5 696 Q
-(<esri32525> : WGS 72BE / UTM zone 25S)110.5 708 Q
-(<esri32526> : WGS 72BE / UTM zone 26S)110.5 720 Q(MB-System 5.0)72 768
-Q(29 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E(130)180.545 E 0 Cg EP
-%%Page: 131 131
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<esri32527> : WGS 72BE / UTM zone 27S)110.5 84 Q
-(<esri32528> : WGS 72BE / UTM zone 28S)110.5 96 Q
-(<esri32529> : WGS 72BE / UTM zone 29S)110.5 108 Q
-(<esri32530> : WGS 72BE / UTM zone 30S)110.5 120 Q
-(<esri32531> : WGS 72BE / UTM zone 31S)110.5 132 Q
-(<esri32532> : WGS 72BE / UTM zone 32S)110.5 144 Q
-(<esri32533> : WGS 72BE / UTM zone 33S)110.5 156 Q
-(<esri32534> : WGS 72BE / UTM zone 34S)110.5 168 Q
-(<esri32535> : WGS 72BE / UTM zone 35S)110.5 180 Q
-(<esri32536> : WGS 72BE / UTM zone 36S)110.5 192 Q
-(<esri32537> : WGS 72BE / UTM zone 37S)110.5 204 Q
-(<esri32538> : WGS 72BE / UTM zone 38S)110.5 216 Q
-(<esri32539> : WGS 72BE / UTM zone 39S)110.5 228 Q
-(<esri32540> : WGS 72BE / UTM zone 40S)110.5 240 Q
-(<esri32541> : WGS 72BE / UTM zone 41S)110.5 252 Q
-(<esri32542> : WGS 72BE / UTM zone 42S)110.5 264 Q
-(<esri32543> : WGS 72BE / UTM zone 43S)110.5 276 Q
-(<esri32544> : WGS 72BE / UTM zone 44S)110.5 288 Q
-(<esri32545> : WGS 72BE / UTM zone 45S)110.5 300 Q
-(<esri32546> : WGS 72BE / UTM zone 46S)110.5 312 Q
-(<esri32547> : WGS 72BE / UTM zone 47S)110.5 324 Q
-(<esri32548> : WGS 72BE / UTM zone 48S)110.5 336 Q
-(<esri32549> : WGS 72BE / UTM zone 49S)110.5 348 Q
-(<esri32550> : WGS 72BE / UTM zone 50S)110.5 360 Q
-(<esri32551> : WGS 72BE / UTM zone 51S)110.5 372 Q
-(<esri32552> : WGS 72BE / UTM zone 52S)110.5 384 Q
-(<esri32553> : WGS 72BE / UTM zone 53S)110.5 396 Q
-(<esri32554> : WGS 72BE / UTM zone 54S)110.5 408 Q
-(<esri32555> : WGS 72BE / UTM zone 55S)110.5 420 Q
-(<esri32556> : WGS 72BE / UTM zone 56S)110.5 432 Q
-(<esri32557> : WGS 72BE / UTM zone 57S)110.5 444 Q
-(<esri32558> : WGS 72BE / UTM zone 58S)110.5 456 Q
-(<esri32559> : WGS 72BE / UTM zone 59S)110.5 468 Q
-(<esri32560> : WGS 72BE / UTM zone 60S)110.5 480 Q
-(<esri32601> : WGS 84 / UTM zone 1N)110.5 492 Q
-(<esri32602> : WGS 84 / UTM zone 2N)110.5 504 Q
-(<esri32603> : WGS 84 / UTM zone 3N)110.5 516 Q
-(<esri32604> : WGS 84 / UTM zone 4N)110.5 528 Q
-(<esri32605> : WGS 84 / UTM zone 5N)110.5 540 Q
-(<esri32606> : WGS 84 / UTM zone 6N)110.5 552 Q
-(<esri32607> : WGS 84 / UTM zone 7N)110.5 564 Q
-(<esri32608> : WGS 84 / UTM zone 8N)110.5 576 Q
-(<esri32609> : WGS 84 / UTM zone 9N)110.5 588 Q
-(<esri32610> : WGS 84 / UTM zone 10N)110.5 600 Q
-(<esri32611> : WGS 84 / UTM zone 11N)110.5 612 Q
-(<esri32612> : WGS 84 / UTM zone 12N)110.5 624 Q
-(<esri32613> : WGS 84 / UTM zone 13N)110.5 636 Q
-(<esri32614> : WGS 84 / UTM zone 14N)110.5 648 Q
-(<esri32615> : WGS 84 / UTM zone 15N)110.5 660 Q
-(<esri32616> : WGS 84 / UTM zone 16N)110.5 672 Q
-(<esri32617> : WGS 84 / UTM zone 17N)110.5 684 Q
-(<esri32618> : WGS 84 / UTM zone 18N)110.5 696 Q
-(<esri32619> : WGS 84 / UTM zone 19N)110.5 708 Q
-(<esri32620> : WGS 84 / UTM zone 20N)110.5 720 Q(MB-System 5.0)72 768 Q
-(29 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E(131)180.545 E 0 Cg EP
-%%Page: 132 132
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<esri32621> : WGS 84 / UTM zone 21N)110.5 84 Q
-(<esri32622> : WGS 84 / UTM zone 22N)110.5 96 Q
-(<esri32623> : WGS 84 / UTM zone 23N)110.5 108 Q
-(<esri32624> : WGS 84 / UTM zone 24N)110.5 120 Q
-(<esri32625> : WGS 84 / UTM zone 25N)110.5 132 Q
-(<esri32626> : WGS 84 / UTM zone 26N)110.5 144 Q
-(<esri32627> : WGS 84 / UTM zone 27N)110.5 156 Q
-(<esri32628> : WGS 84 / UTM zone 28N)110.5 168 Q
-(<esri32629> : WGS 84 / UTM zone 29N)110.5 180 Q
-(<esri32630> : WGS 84 / UTM zone 30N)110.5 192 Q
-(<esri32631> : WGS 84 / UTM zone 31N)110.5 204 Q
-(<esri32632> : WGS 84 / UTM zone 32N)110.5 216 Q
-(<esri32633> : WGS 84 / UTM zone 33N)110.5 228 Q
-(<esri32634> : WGS 84 / UTM zone 34N)110.5 240 Q
-(<esri32635> : WGS 84 / UTM zone 35N)110.5 252 Q
-(<esri32636> : WGS 84 / UTM zone 36N)110.5 264 Q
-(<esri32637> : WGS 84 / UTM zone 37N)110.5 276 Q
-(<esri32638> : WGS 84 / UTM zone 38N)110.5 288 Q
-(<esri32639> : WGS 84 / UTM zone 39N)110.5 300 Q
-(<esri32640> : WGS 84 / UTM zone 40N)110.5 312 Q
-(<esri32641> : WGS 84 / UTM zone 41N)110.5 324 Q
-(<esri32642> : WGS 84 / UTM zone 42N)110.5 336 Q
-(<esri32643> : WGS 84 / UTM zone 43N)110.5 348 Q
-(<esri32644> : WGS 84 / UTM zone 44N)110.5 360 Q
-(<esri32645> : WGS 84 / UTM zone 45N)110.5 372 Q
-(<esri32646> : WGS 84 / UTM zone 46N)110.5 384 Q
-(<esri32647> : WGS 84 / UTM zone 47N)110.5 396 Q
-(<esri32648> : WGS 84 / UTM zone 48N)110.5 408 Q
-(<esri32649> : WGS 84 / UTM zone 49N)110.5 420 Q
-(<esri32650> : WGS 84 / UTM zone 50N)110.5 432 Q
-(<esri32651> : WGS 84 / UTM zone 51N)110.5 444 Q
-(<esri32652> : WGS 84 / UTM zone 52N)110.5 456 Q
-(<esri32653> : WGS 84 / UTM zone 53N)110.5 468 Q
-(<esri32654> : WGS 84 / UTM zone 54N)110.5 480 Q
-(<esri32655> : WGS 84 / UTM zone 55N)110.5 492 Q
-(<esri32656> : WGS 84 / UTM zone 56N)110.5 504 Q
-(<esri32657> : WGS 84 / UTM zone 57N)110.5 516 Q
-(<esri32658> : WGS 84 / UTM zone 58N)110.5 528 Q
-(<esri32659> : WGS 84 / UTM zone 59N)110.5 540 Q
-(<esri32660> : WGS 84 / UTM zone 60N)110.5 552 Q
-(<esri32661> : WGS 84 / UPS North)110.5 564 Q
-(<esri32701> : WGS 84 / UTM zone 1S)110.5 576 Q
-(<esri32702> : WGS 84 / UTM zone 2S)110.5 588 Q
-(<esri32703> : WGS 84 / UTM zone 3S)110.5 600 Q
-(<esri32704> : WGS 84 / UTM zone 4S)110.5 612 Q
-(<esri32705> : WGS 84 / UTM zone 5S)110.5 624 Q
-(<esri32706> : WGS 84 / UTM zone 6S)110.5 636 Q
-(<esri32707> : WGS 84 / UTM zone 7S)110.5 648 Q
-(<esri32708> : WGS 84 / UTM zone 8S)110.5 660 Q
-(<esri32709> : WGS 84 / UTM zone 9S)110.5 672 Q
-(<esri32710> : WGS 84 / UTM zone 10S)110.5 684 Q
-(<esri32711> : WGS 84 / UTM zone 11S)110.5 696 Q
-(<esri32712> : WGS 84 / UTM zone 12S)110.5 708 Q
-(<esri32713> : WGS 84 / UTM zone 13S)110.5 720 Q(MB-System 5.0)72 768 Q
-(29 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E(132)180.545 E 0 Cg EP
-%%Page: 133 133
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<esri32714> : WGS 84 / UTM zone 14S)110.5 84 Q
-(<esri32715> : WGS 84 / UTM zone 15S)110.5 96 Q
-(<esri32716> : WGS 84 / UTM zone 16S)110.5 108 Q
-(<esri32717> : WGS 84 / UTM zone 17S)110.5 120 Q
-(<esri32718> : WGS 84 / UTM zone 18S)110.5 132 Q
-(<esri32719> : WGS 84 / UTM zone 19S)110.5 144 Q
-(<esri32720> : WGS 84 / UTM zone 20S)110.5 156 Q
-(<esri32721> : WGS 84 / UTM zone 21S)110.5 168 Q
-(<esri32722> : WGS 84 / UTM zone 22S)110.5 180 Q
-(<esri32723> : WGS 84 / UTM zone 23S)110.5 192 Q
-(<esri32724> : WGS 84 / UTM zone 24S)110.5 204 Q
-(<esri32725> : WGS 84 / UTM zone 25S)110.5 216 Q
-(<esri32726> : WGS 84 / UTM zone 26S)110.5 228 Q
-(<esri32727> : WGS 84 / UTM zone 27S)110.5 240 Q
-(<esri32728> : WGS 84 / UTM zone 28S)110.5 252 Q
-(<esri32729> : WGS 84 / UTM zone 29S)110.5 264 Q
-(<esri32730> : WGS 84 / UTM zone 30S)110.5 276 Q
-(<esri32731> : WGS 84 / UTM zone 31S)110.5 288 Q
-(<esri32732> : WGS 84 / UTM zone 32S)110.5 300 Q
-(<esri32733> : WGS 84 / UTM zone 33S)110.5 312 Q
-(<esri32734> : WGS 84 / UTM zone 34S)110.5 324 Q
-(<esri32735> : WGS 84 / UTM zone 35S)110.5 336 Q
-(<esri32736> : WGS 84 / UTM zone 36S)110.5 348 Q
-(<esri32737> : WGS 84 / UTM zone 37S)110.5 360 Q
-(<esri32738> : WGS 84 / UTM zone 38S)110.5 372 Q
-(<esri32739> : WGS 84 / UTM zone 39S)110.5 384 Q
-(<esri32740> : WGS 84 / UTM zone 40S)110.5 396 Q
-(<esri32741> : WGS 84 / UTM zone 41S)110.5 408 Q
-(<esri32742> : WGS 84 / UTM zone 42S)110.5 420 Q
-(<esri32743> : WGS 84 / UTM zone 43S)110.5 432 Q
-(<esri32744> : WGS 84 / UTM zone 44S)110.5 444 Q
-(<esri32745> : WGS 84 / UTM zone 45S)110.5 456 Q
-(<esri32746> : WGS 84 / UTM zone 46S)110.5 468 Q
-(<esri32747> : WGS 84 / UTM zone 47S)110.5 480 Q
-(<esri32748> : WGS 84 / UTM zone 48S)110.5 492 Q
-(<esri32749> : WGS 84 / UTM zone 49S)110.5 504 Q
-(<esri32750> : WGS 84 / UTM zone 50S)110.5 516 Q
-(<esri32751> : WGS 84 / UTM zone 51S)110.5 528 Q
-(<esri32752> : WGS 84 / UTM zone 52S)110.5 540 Q
-(<esri32753> : WGS 84 / UTM zone 53S)110.5 552 Q
-(<esri32754> : WGS 84 / UTM zone 54S)110.5 564 Q
-(<esri32755> : WGS 84 / UTM zone 55S)110.5 576 Q
-(<esri32756> : WGS 84 / UTM zone 56S)110.5 588 Q
-(<esri32757> : WGS 84 / UTM zone 57S)110.5 600 Q
-(<esri32758> : WGS 84 / UTM zone 58S)110.5 612 Q
-(<esri32759> : WGS 84 / UTM zone 59S)110.5 624 Q
-(<esri32760> : WGS 84 / UTM zone 60S)110.5 636 Q
-(<esri32761> : WGS 84 / UPS South)110.5 648 Q
-(<esri32766> : WGS 84 / TM 36 SE)110.5 660 Q(<esri20002> : Pulk)110.5
-672 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 GK Zone 2)-2.5 E
-(<esri20003> : Pulk)110.5 684 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 GK Zone 3)-2.5 E(<esri20062> : Pulk)110.5 696 Q -.15(ov)-.1 G 2.5
-(o1)-.05 G(995 GK Zone 2N)-2.5 E(<esri20063> : Pulk)110.5 708 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 GK Zone 3N)-2.5 E
-(<esri24721> : La Canoa UTM Zone 21N)110.5 720 Q(MB-System 5.0)72 768 Q
-(29 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E(133)180.545 E 0 Cg EP
-%%Page: 134 134
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<esri26761> : N)110.5 84 Q(AD 1927 StatePlane Ha)
--.35 E -.1(wa)-.15 G(ii 1 FIPS 5101).1 E(<esri26762> : N)110.5 96 Q
-(AD 1927 StatePlane Ha)-.35 E -.1(wa)-.15 G(ii 2 FIPS 5102).1 E
-(<esri26763> : N)110.5 108 Q(AD 1927 StatePlane Ha)-.35 E -.1(wa)-.15 G
-(ii 3 FIPS 5103).1 E(<esri26764> : N)110.5 120 Q(AD 1927 StatePlane Ha)
--.35 E -.1(wa)-.15 G(ii 4 FIPS 5104).1 E(<esri26765> : N)110.5 132 Q
-(AD 1927 StatePlane Ha)-.35 E -.1(wa)-.15 G(ii 5 FIPS 5105).1 E
-(<esri26788> : N)110.5 144 Q(AD 1927 StatePlane Michig)-.35 E
-(an North FIPS 2111)-.05 E(<esri26789> : N)110.5 156 Q
-(AD 1927 StatePlane Michig)-.35 E(an Central FIPS 2112)-.05 E
-(<esri26790> : N)110.5 168 Q(AD 1927 StatePlane Michig)-.35 E
-(an South FIPS 2113)-.05 E(<esri30591> : Nord Algerie)110.5 180 Q
-(<esri30592> : Sud Algerie)110.5 192 Q(<esri31491> : German)110.5 204 Q
-2.5(yZ)-.15 G(one 1)-2.5 E(<esri31492> : German)110.5 216 Q 2.5(yZ)-.15
-G(one 2)-2.5 E(<esri31493> : German)110.5 228 Q 2.5(yZ)-.15 G(one 3)-2.5
-E(<esri31494> : German)110.5 240 Q 2.5(yZ)-.15 G(one 4)-2.5 E
-(<esri31495> : German)110.5 252 Q 2.5(yZ)-.15 G(one 5)-2.5 E
-(<esri32059> : N)110.5 264 Q(AD 1927 StatePlane Puerto Rico FIPS 5201)
--.35 E(<esri32060> : N)110.5 276 Q(AD 1927 StatePlane V)-.35 E(ir)-.6 E
-(gin Islands St Croix FIPS 5202)-.18 E
-(<esri53001> : Sphere Plate Carree)110.5 288 Q
-(<esri53002> : Sphere Equidistant Cylindrical)110.5 300 Q
-(<esri53003> : Sphere Miller Cylindrical)110.5 312 Q
-(<esri53004> : Sphere Mercator)110.5 324 Q
-(<esri53008> : Sphere Sinusoidal)110.5 336 Q(<esri53009> : Sphere Moll)
-110.5 348 Q(weide)-.1 E(<esri53010> : Sphere Eck)110.5 360 Q(ert VI)-.1
-E(<esri53011> : Sphere Eck)110.5 372 Q(ert V)-.1 E
-(<esri53012> : Sphere Eck)110.5 384 Q(ert IV)-.1 E
-(<esri53013> : Sphere Eck)110.5 396 Q(ert III)-.1 E
-(<esri53014> : Sphere Eck)110.5 408 Q(ert II)-.1 E
-(<esri53015> : Sphere Eck)110.5 420 Q(ert I)-.1 E
-(<esri53016> : Sphere Gall Stereographic)110.5 432 Q
-(<esri53017> : Sphere Behrmann)110.5 444 Q(<esri53018> : Sphere W)110.5
-456 Q(ink)-.4 E(el I)-.1 E(<esri53019> : Sphere W)110.5 468 Q(ink)-.4 E
-(el II)-.1 E(<esri53021> : Sphere Polyconic)110.5 480 Q
-(<esri53022> : Sphere Quartic Authalic)110.5 492 Q
-(<esri53023> : Sphere Loximuthal)110.5 504 Q(<esri53024> : Sphere Bonne)
-110.5 516 Q(<esri53025> : Sphere Hotine)110.5 528 Q
-(<esri53026> : Sphere Stereographic)110.5 540 Q
-(<esri53027> : Sphere Equidistant Conic)110.5 552 Q
-(<esri53028> : Sphere Cassini)110.5 564 Q(<esri53029> : Sphere V)110.5
-576 Q(an der Grinten I)-1.11 E(<esri53030> : Sphere Robinson)110.5 588 Q
-(<esri53031> : Sphere T)110.5 600 Q .2 -.1(wo P)-.8 H(oint Equidistant)
-.1 E(<esri53032> : Sphere Azimuthal Equidistant)110.5 612 Q
-(<esri54001> : W)110.5 624 Q(orld Plate Carree)-.8 E(<esri54002> : W)
-110.5 636 Q(orld Equidistant Cylindrical)-.8 E(<esri54003> : W)110.5 648
-Q(orld Miller Cylindrical)-.8 E(<esri54004> : W)110.5 660 Q
-(orld Mercator)-.8 E(<esri54008> : W)110.5 672 Q(orld Sinusoidal)-.8 E
-(<esri54009> : W)110.5 684 Q(orld Moll)-.8 E(weide)-.1 E
-(<esri54010> : W)110.5 696 Q(orld Eck)-.8 E(ert VI)-.1 E
-(<esri54011> : W)110.5 708 Q(orld Eck)-.8 E(ert V)-.1 E(<esri54012> : W)
-110.5 720 Q(orld Eck)-.8 E(ert IV)-.1 E(MB-System 5.0)72 768 Q(29 No)
-132.205 E -.15(ve)-.15 G(mber 2014).15 E(134)180.545 E 0 Cg EP
-%%Page: 135 135
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<esri54013> : W)110.5 84 Q(orld Eck)-.8 E
-(ert III)-.1 E(<esri54014> : W)110.5 96 Q(orld Eck)-.8 E(ert II)-.1 E
-(<esri54015> : W)110.5 108 Q(orld Eck)-.8 E(ert I)-.1 E(<esri54016> : W)
-110.5 120 Q(orld Gall Stereographic)-.8 E(<esri54017> : W)110.5 132 Q
-(orld Behrmann)-.8 E(<esri54018> : W)110.5 144 Q(orld W)-.8 E(ink)-.4 E
-(el I)-.1 E(<esri54019> : W)110.5 156 Q(orld W)-.8 E(ink)-.4 E(el II)-.1
-E(<esri54021> : W)110.5 168 Q(orld Polyconic)-.8 E(<esri54022> : W)110.5
-180 Q(orld Quartic Authalic)-.8 E(<esri54023> : W)110.5 192 Q
-(orld Loximuthal)-.8 E(<esri54024> : W)110.5 204 Q(orld Bonne)-.8 E
-(<esri54025> : W)110.5 216 Q(orld Hotine)-.8 E(<esri54026> : W)110.5 228
-Q(orld Stereographic)-.8 E(<esri54027> : W)110.5 240 Q
-(orld Equidistant Conic)-.8 E(<esri54028> : W)110.5 252 Q(orld Cassini)
--.8 E(<esri54029> : W)110.5 264 Q(orld V)-.8 E(an der Grinten I)-1.11 E
-(<esri54030> : W)110.5 276 Q(orld Robinson)-.8 E(<esri54031> : W)110.5
-288 Q(orld T)-.8 E .2 -.1(wo P)-.8 H(oint Equidistant).1 E
-(<esri54032> : W)110.5 300 Q(orld Azimuthal Equidistant)-.8 E
-(<esri65061> : N)110.5 312 Q(AD 1927 StatePlane Guam FIPS 5400)-.35 E
-(<esri65161> : N)110.5 324 Q(AD 1983 StatePlane Guam FIPS 5400)-.35 E
-(<esri102001> : Canada Albers Equal Area Conic)110.5 336 Q
-(<esri102002> : Canada Lambert Conformal Conic)110.5 348 Q
-(<esri102003> : USA Contiguous Albers Equal Area Conic)110.5 360 Q
-(<esri102004> : USA Contiguous Lambert Conformal Conic)110.5 372 Q
-(<esri102005> : USA Contiguous Equidistant Conic)110.5 384 Q
-(<esri102006> : Alaska Albers Equal Area Conic)110.5 396 Q
-(<esri102007> : Ha)110.5 408 Q -.1(wa)-.15 G(ii Albers Equal Area Conic)
-.1 E(<esri102008> : North America Albers Equal Area Conic)110.5 420 Q
-(<esri102009> : North America Lambert Conformal Conic)110.5 432 Q
-(<esri102010> : North America Equidistant Conic)110.5 444 Q
-(<esri102011> : Africa Sinusoidal)110.5 456 Q
-(<esri102012> : Asia Lambert Conformal Conic)110.5 468 Q
-(<esri102013> : Europe Albers Equal Area Conic)110.5 480 Q
-(<esri102014> : Europe Lambert Conformal Conic)110.5 492 Q
-(<esri102015> : South America Lambert Conformal Conic)110.5 504 Q
-(<esri102016> : North Pole Azimuthal Equidistant)110.5 516 Q
-(<esri102017> : North Pole Lambert Azimuthal Equal Area)110.5 528 Q
-(<esri102018> : North Pole Stereographic)110.5 540 Q
-(<esri102019> : South Pole Azimuthal Equidistant)110.5 552 Q
-(<esri102020> : South Pole Lambert Azimuthal Equal Area)110.5 564 Q
-(<esri102021> : South Pole Stereographic)110.5 576 Q
-(<esri102022> : Africa Albers Equal Area Conic)110.5 588 Q
-(<esri102023> : Africa Equidistant Conic)110.5 600 Q
-(<esri102024> : Africa Lambert Conformal Conic)110.5 612 Q
-(<esri102025> : Asia North Albers Equal Area Conic)110.5 624 Q
-(<esri102026> : Asia North Equidistant Conic)110.5 636 Q
-(<esri102027> : Asia North Lambert Conformal Conic)110.5 648 Q
-(<esri102028> : Asia South Albers Equal Area Conic)110.5 660 Q
-(<esri102029> : Asia South Equidistant Conic)110.5 672 Q
-(<esri102030> : Asia South Lambert Conformal Conic)110.5 684 Q
-(<esri102031> : Europe Equidistant Conic)110.5 696 Q
-(<esri102032> : South America Equidistant Conic)110.5 708 Q
-(<esri102033> : South America Albers Equal Area Conic)110.5 720 Q
-(MB-System 5.0)72 768 Q(29 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E
-(135)180.545 E 0 Cg EP
-%%Page: 136 136
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<esri102065> : S-JTSK Kro)110.5 84 Q -.25(va)-.15
-G(k).25 E(<esri102066> : S-JTSK Ferro Kro)110.5 96 Q -.25(va)-.15 G 2.5
-(kE).25 G(ast North)-2.5 E(<esri102067> : S-JTSK Kro)110.5 108 Q -.25
-(va)-.15 G 2.5(kE).25 G(ast North)-2.5 E
-(<esri102091> : Monte Mario Italy 1)110.5 120 Q
-(<esri102092> : Monte Mario Italy 2)110.5 132 Q
-(<esri102101> : NGO 1948 Norw)110.5 144 Q(ay Zone 1)-.1 E
-(<esri102102> : NGO 1948 Norw)110.5 156 Q(ay Zone 2)-.1 E
-(<esri102103> : NGO 1948 Norw)110.5 168 Q(ay Zone 3)-.1 E
-(<esri102104> : NGO 1948 Norw)110.5 180 Q(ay Zone 4)-.1 E
-(<esri102105> : NGO 1948 Norw)110.5 192 Q(ay Zone 5)-.1 E
-(<esri102106> : NGO 1948 Norw)110.5 204 Q(ay Zone 6)-.1 E
-(<esri102107> : NGO 1948 Norw)110.5 216 Q(ay Zone 7)-.1 E
-(<esri102108> : NGO 1948 Norw)110.5 228 Q(ay Zone 8)-.1 E
-(<esri102110> : RGF 1993 Lambert 93)110.5 240 Q(<esri102114> : Old Ha)
-110.5 252 Q -.1(wa)-.15 G(iian UTM Zone 4N).1 E(<esri102115> : Old Ha)
-110.5 264 Q -.1(wa)-.15 G(iian UTM Zone 5N).1 E(<esri102120> : N)110.5
-276 Q(AD 1927 Michig)-.35 E(an GeoRef Feet US)-.05 E(<esri102121> : N)
-110.5 288 Q(AD 1983 Michig)-.35 E(an GeoRef Feet US)-.05 E
-(<esri102122> : N)110.5 300 Q(AD 1927 Michig)-.35 E(an GeoRef Meters)
--.05 E(<esri102123> : N)110.5 312 Q(AD 1983 Michig)-.35 E
-(an GeoRef Meters)-.05 E(<esri102132> : NGO 1948 UTM Zone 32N)110.5 324
-Q(<esri102133> : NGO 1948 UTM Zone 33N)110.5 336 Q
-(<esri102134> : NGO 1948 UTM Zone 34N)110.5 348 Q
-(<esri102135> : NGO 1948 UTM Zone 35N)110.5 360 Q(<esri102140> : Hong K)
-110.5 372 Q(ong 1980 Grid)-.35 E(<esri102141> : Hong K)110.5 384 Q
-(ong 1980 UTM Zone 49N)-.35 E(<esri102142> : Hong K)110.5 396 Q
-(ong 1980 UTM Zone 50N)-.35 E(<esri102151> : T)110.5 408 Q(ok)-.8 E
-(yo UTM Zone 51N)-.15 E(<esri102152> : T)110.5 420 Q(ok)-.8 E
-(yo UTM Zone 52N)-.15 E(<esri102153> : T)110.5 432 Q(ok)-.8 E
-(yo UTM Zone 53N)-.15 E(<esri102154> : T)110.5 444 Q(ok)-.8 E
-(yo UTM Zone 54N)-.15 E(<esri102155> : T)110.5 456 Q(ok)-.8 E
-(yo UTM Zone 55N)-.15 E(<esri102156> : T)110.5 468 Q(ok)-.8 E
-(yo UTM Zone 56N)-.15 E(<esri102160> : Datum 73 Hayford Gauss IGeoE)
-110.5 480 Q(<esri102161> : Datum 73 Hayford Gauss IPCC)110.5 492 Q
-(<esri102162> : Graciosa Base SW 1948 UTM Zone 26N)110.5 504 Q
-(<esri102163> : Lisboa Bessel Bonne)110.5 516 Q
-(<esri102164> : Lisboa Hayford Gauss IGeoE)110.5 528 Q
-(<esri102165> : Lisboa Hayford Gauss IPCC)110.5 540 Q
-(<esri102166> : Observ Meteorologico 1939 UTM Zone 25N)110.5 552 Q
-(<esri102167> : Porto Santo 1936 UTM Zone 28N)110.5 564 Q
-(<esri102168> : Sao Braz UTM Zone 26N)110.5 576 Q(<esri102169> : Selv)
-110.5 588 Q(agem Grande 1938 UTM Zone 28N)-.25 E
-(<esri102191> : Nord Maroc De)110.5 600 Q(gree)-.15 E
-(<esri102192> : Sud Maroc De)110.5 612 Q(gree)-.15 E
-(<esri102193> : Sahara De)110.5 624 Q(gree)-.15 E(<esri102229> : N)110.5
-636 Q(AD 1983 HARN StatePlane Alabama East FIPS 0101)-.35 E
-(<esri102230> : N)110.5 648 Q(AD 1983 HARN StatePlane Alabama W)-.35 E
-(est FIPS 0102)-.8 E(<esri102241> : N)110.5 660 Q
-(AD 1983 HARN StatePlane California I FIPS 0401)-.35 E(<esri102242> : N)
-110.5 672 Q(AD 1983 HARN StatePlane California II FIPS 0402)-.35 E
-(<esri102243> : N)110.5 684 Q
-(AD 1983 HARN StatePlane California III FIPS 0403)-.35 E
-(<esri102244> : N)110.5 696 Q
-(AD 1983 HARN StatePlane California IV FIPS 0404)-.35 E
-(<esri102245> : N)110.5 708 Q
-(AD 1983 HARN StatePlane California V FIPS 0405)-.35 E(<esri102246> : N)
-110.5 720 Q(AD 1983 HARN StatePlane California VI FIPS 0406)-.35 E
-(MB-System 5.0)72 768 Q(29 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E
-(136)180.545 E 0 Cg EP
-%%Page: 137 137
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<esri102248> : N)110.5 84 Q
-(AD 1983 HARN StatePlane Arizona East FIPS 0201)-.35 E(<esri102249> : N)
-110.5 96 Q(AD 1983 HARN StatePlane Arizona Central FIPS 0202)-.35 E
-(<esri102250> : N)110.5 108 Q(AD 1983 HARN StatePlane Arizona W)-.35 E
-(est FIPS 0203)-.8 E(<esri102251> : N)110.5 120 Q
-(AD 1983 HARN StatePlane Arkansas North FIPS 0301)-.35 E
-(<esri102252> : N)110.5 132 Q
-(AD 1983 HARN StatePlane Arkansas South FIPS 0302)-.35 E
-(<esri102253> : N)110.5 144 Q
-(AD 1983 HARN StatePlane Colorado North FIPS 0501)-.35 E
-(<esri102254> : N)110.5 156 Q
-(AD 1983 HARN StatePlane Colorado Central FIPS 0502)-.35 E
-(<esri102255> : N)110.5 168 Q
-(AD 1983 HARN StatePlane Colorado South FIPS 0503)-.35 E
-(<esri102256> : N)110.5 180 Q
-(AD 1983 HARN StatePlane Connecticut FIPS 0600)-.35 E(<esri102257> : N)
-110.5 192 Q(AD 1983 HARN StatePlane Dela)-.35 E -.1(wa)-.15 G
-(re FIPS 0700).1 E(<esri102258> : N)110.5 204 Q
-(AD 1983 HARN StatePlane Florida East FIPS 0901)-.35 E(<esri102259> : N)
-110.5 216 Q(AD 1983 HARN StatePlane Florida W)-.35 E(est FIPS 0902)-.8 E
-(<esri102260> : N)110.5 228 Q
-(AD 1983 HARN StatePlane Florida North FIPS 0903)-.35 E
-(<esri102261> : N)110.5 240 Q(AD 1983 HARN StatePlane Ha)-.35 E -.1(wa)
--.15 G(ii 1 FIPS 5101).1 E(<esri102262> : N)110.5 252 Q
-(AD 1983 HARN StatePlane Ha)-.35 E -.1(wa)-.15 G(ii 2 FIPS 5102).1 E
-(<esri102263> : N)110.5 264 Q(AD 1983 HARN StatePlane Ha)-.35 E -.1(wa)
--.15 G(ii 3 FIPS 5103).1 E(<esri102264> : N)110.5 276 Q
-(AD 1983 HARN StatePlane Ha)-.35 E -.1(wa)-.15 G(ii 4 FIPS 5104).1 E
-(<esri102265> : N)110.5 288 Q(AD 1983 HARN StatePlane Ha)-.35 E -.1(wa)
--.15 G(ii 5 FIPS 5105).1 E(<esri102266> : N)110.5 300 Q
-(AD 1983 HARN StatePlane Geor)-.35 E(gia East FIPS 1001)-.18 E
-(<esri102267> : N)110.5 312 Q(AD 1983 HARN StatePlane Geor)-.35 E(gia W)
--.18 E(est FIPS 1002)-.8 E(<esri102268> : N)110.5 324 Q
-(AD 1983 HARN StatePlane Idaho East FIPS 1101)-.35 E(<esri102269> : N)
-110.5 336 Q(AD 1983 HARN StatePlane Idaho Central FIPS 1102)-.35 E
-(<esri102270> : N)110.5 348 Q(AD 1983 HARN StatePlane Idaho W)-.35 E
-(est FIPS 1103)-.8 E(<esri102271> : N)110.5 360 Q
-(AD 1983 HARN StatePlane Illinois East FIPS 1201)-.35 E
-(<esri102272> : N)110.5 372 Q(AD 1983 HARN StatePlane Illinois W)-.35 E
-(est FIPS 1202)-.8 E(<esri102273> : N)110.5 384 Q
-(AD 1983 HARN StatePlane Indiana East FIPS 1301)-.35 E(<esri102274> : N)
-110.5 396 Q(AD 1983 HARN StatePlane Indiana W)-.35 E(est FIPS 1302)-.8 E
-(<esri102277> : N)110.5 408 Q
-(AD 1983 HARN StatePlane Kansas North FIPS 1501)-.35 E(<esri102278> : N)
-110.5 420 Q(AD 1983 HARN StatePlane Kansas South FIPS 1502)-.35 E
-(<esri102279> : N)110.5 432 Q(AD 1983 HARN StatePlane K)-.35 E(entuck)
--.25 E 2.5(yN)-.15 G(orth FIPS 1601)-2.5 E(<esri102280> : N)110.5 444 Q
-(AD 1983 HARN StatePlane K)-.35 E(entuck)-.25 E 2.5(yS)-.15 G
-(outh FIPS 1602)-2.5 E(<esri102281> : N)110.5 456 Q
-(AD 1983 HARN StatePlane Louisiana North FIPS 1701)-.35 E
-(<esri102282> : N)110.5 468 Q
-(AD 1983 HARN StatePlane Louisiana South FIPS 1702)-.35 E
-(<esri102283> : N)110.5 480 Q
-(AD 1983 HARN StatePlane Maine East FIPS 1801)-.35 E(<esri102284> : N)
-110.5 492 Q(AD 1983 HARN StatePlane Maine W)-.35 E(est FIPS 1802)-.8 E
-(<esri102285> : N)110.5 504 Q
-(AD 1983 HARN StatePlane Maryland FIPS 1900)-.35 E(<esri102286> : N)
-110.5 516 Q(AD 1983 HARN StatePlane Massachusetts Mainland FIPS 2001)
--.35 E(<esri102287> : N)110.5 528 Q
-(AD 1983 HARN StatePlane Massachusetts Island FIPS 2002)-.35 E
-(<esri102288> : N)110.5 540 Q(AD 1983 HARN StatePlane Michig)-.35 E
-(an North FIPS 2111)-.05 E(<esri102289> : N)110.5 552 Q
-(AD 1983 HARN StatePlane Michig)-.35 E(an Central FIPS 2112)-.05 E
-(<esri102290> : N)110.5 564 Q(AD 1983 HARN StatePlane Michig)-.35 E
-(an South FIPS 2113)-.05 E(<esri102291> : N)110.5 576 Q
-(AD 1983 HARN StatePlane Minnesota North FIPS 2201)-.35 E
-(<esri102292> : N)110.5 588 Q
-(AD 1983 HARN StatePlane Minnesota Central FIPS 2202)-.35 E
-(<esri102293> : N)110.5 600 Q
-(AD 1983 HARN StatePlane Minnesota South FIPS 2203)-.35 E
-(<esri102294> : N)110.5 612 Q
-(AD 1983 HARN StatePlane Mississippi East FIPS 2301)-.35 E
-(<esri102295> : N)110.5 624 Q(AD 1983 HARN StatePlane Mississippi W)-.35
-E(est FIPS 2302)-.8 E(<esri102296> : N)110.5 636 Q
-(AD 1983 HARN StatePlane Missouri East FIPS 2401)-.35 E
-(<esri102297> : N)110.5 648 Q
-(AD 1983 HARN StatePlane Missouri Central FIPS 2402)-.35 E
-(<esri102298> : N)110.5 660 Q(AD 1983 HARN StatePlane Missouri W)-.35 E
-(est FIPS 2403)-.8 E(<esri102300> : N)110.5 672 Q
-(AD 1983 HARN StatePlane Montana FIPS 2500)-.35 E(<esri102304> : N)110.5
-684 Q(AD 1983 HARN StatePlane Nebraska FIPS 2600)-.35 E
-(<esri102307> : N)110.5 696 Q(AD 1983 HARN StatePlane Ne)-.35 E -.25(va)
--.25 G(da East FIPS 2701).25 E(<esri102308> : N)110.5 708 Q
-(AD 1983 HARN StatePlane Ne)-.35 E -.25(va)-.25 G(da Central FIPS 2702)
-.25 E(<esri102309> : N)110.5 720 Q(AD 1983 HARN StatePlane Ne)-.35 E
--.25(va)-.25 G(da W).25 E(est FIPS 2703)-.8 E(MB-System 5.0)72 768 Q
-(29 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E(137)180.545 E 0 Cg EP
-%%Page: 138 138
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<esri102310> : N)110.5 84 Q
-(AD 1983 HARN StatePlane Ne)-.35 E 2.5(wH)-.25 G(ampshire FIPS 2800)-2.5
-E(<esri102311> : N)110.5 96 Q(AD 1983 HARN StatePlane Ne)-.35 E 2.5(wJ)
--.25 G(erse)-2.5 E 2.5(yF)-.15 G(IPS 2900)-2.5 E(<esri102312> : N)110.5
-108 Q(AD 1983 HARN StatePlane Ne)-.35 E 2.5(wM)-.25 G -.15(ex)-2.5 G
-(ico East FIPS 3001).15 E(<esri102313> : N)110.5 120 Q
-(AD 1983 HARN StatePlane Ne)-.35 E 2.5(wM)-.25 G -.15(ex)-2.5 G
-(ico Central FIPS 3002).15 E(<esri102314> : N)110.5 132 Q
-(AD 1983 HARN StatePlane Ne)-.35 E 2.5(wM)-.25 G -.15(ex)-2.5 G(ico W)
-.15 E(est FIPS 3003)-.8 E(<esri102315> : N)110.5 144 Q
-(AD 1983 HARN StatePlane Ne)-.35 E 2.5(wY)-.25 G(ork East FIPS 3101)-3.6
-E(<esri102316> : N)110.5 156 Q(AD 1983 HARN StatePlane Ne)-.35 E 2.5(wY)
--.25 G(ork Central FIPS 3102)-3.6 E(<esri102317> : N)110.5 168 Q
-(AD 1983 HARN StatePlane Ne)-.35 E 2.5(wY)-.25 G(ork W)-3.6 E
-(est FIPS 3103)-.8 E(<esri102318> : N)110.5 180 Q
-(AD 1983 HARN StatePlane Ne)-.35 E 2.5(wY)-.25 G
-(ork Long Island FIPS 3104)-3.6 E(<esri102320> : N)110.5 192 Q
-(AD 1983 HARN StatePlane North Dak)-.35 E(ota North FIPS 3301)-.1 E
-(<esri102321> : N)110.5 204 Q(AD 1983 HARN StatePlane North Dak)-.35 E
-(ota South FIPS 3302)-.1 E(<esri102322> : N)110.5 216 Q
-(AD 1983 HARN StatePlane Ohio North FIPS 3401)-.35 E(<esri102323> : N)
-110.5 228 Q(AD 1983 HARN StatePlane Ohio South FIPS 3402)-.35 E
-(<esri102324> : N)110.5 240 Q
-(AD 1983 HARN StatePlane Oklahoma North FIPS 3501)-.35 E
-(<esri102325> : N)110.5 252 Q
-(AD 1983 HARN StatePlane Oklahoma South FIPS 3502)-.35 E
-(<esri102326> : N)110.5 264 Q(AD 1983 HARN StatePlane Ore)-.35 E
-(gon North FIPS 3601)-.15 E(<esri102327> : N)110.5 276 Q
-(AD 1983 HARN StatePlane Ore)-.35 E(gon South FIPS 3602)-.15 E
-(<esri102330> : N)110.5 288 Q
-(AD 1983 HARN StatePlane Rhode Island FIPS 3800)-.35 E(<esri102334> : N)
-110.5 300 Q(AD 1983 HARN StatePlane South Dak)-.35 E
-(ota North FIPS 4001)-.1 E(<esri102335> : N)110.5 312 Q
-(AD 1983 HARN StatePlane South Dak)-.35 E(ota South FIPS 4002)-.1 E
-(<esri102336> : N)110.5 324 Q(AD 1983 HARN StatePlane T)-.35 E
-(ennessee FIPS 4100)-.7 E(<esri102337> : N)110.5 336 Q
-(AD 1983 HARN StatePlane T)-.35 E -.15(ex)-.7 G(as North FIPS 4201).15 E
-(<esri102338> : N)110.5 348 Q(AD 1983 HARN StatePlane T)-.35 E -.15(ex)
--.7 G(as North Central FIPS 4202).15 E(<esri102339> : N)110.5 360 Q
-(AD 1983 HARN StatePlane T)-.35 E -.15(ex)-.7 G(as Central FIPS 4203).15
-E(<esri102340> : N)110.5 372 Q(AD 1983 HARN StatePlane T)-.35 E -.15(ex)
--.7 G(as South Central FIPS 4204).15 E(<esri102341> : N)110.5 384 Q
-(AD 1983 HARN StatePlane T)-.35 E -.15(ex)-.7 G(as South FIPS 4205).15 E
-(<esri102342> : N)110.5 396 Q
-(AD 1983 HARN StatePlane Utah North FIPS 4301)-.35 E(<esri102343> : N)
-110.5 408 Q(AD 1983 HARN StatePlane Utah Central FIPS 4302)-.35 E
-(<esri102344> : N)110.5 420 Q
-(AD 1983 HARN StatePlane Utah South FIPS 4303)-.35 E(<esri102345> : N)
-110.5 432 Q(AD 1983 HARN StatePlane V)-.35 E(ermont FIPS 4400)-1.11 E
-(<esri102346> : N)110.5 444 Q(AD 1983 HARN StatePlane V)-.35 E(ir)-.6 E
-(ginia North FIPS 4501)-.18 E(<esri102347> : N)110.5 456 Q
-(AD 1983 HARN StatePlane V)-.35 E(ir)-.6 E(ginia South FIPS 4502)-.18 E
-(<esri102348> : N)110.5 468 Q(AD 1983 HARN StatePlane W)-.35 E
-(ashington North FIPS 4601)-.8 E(<esri102349> : N)110.5 480 Q
-(AD 1983 HARN StatePlane W)-.35 E(ashington South FIPS 4602)-.8 E
-(<esri102350> : N)110.5 492 Q(AD 1983 HARN StatePlane W)-.35 E(est V)-.8
-E(ir)-.6 E(ginia North FIPS 4701)-.18 E(<esri102351> : N)110.5 504 Q
-(AD 1983 HARN StatePlane W)-.35 E(est V)-.8 E(ir)-.6 E
-(ginia South FIPS 4702)-.18 E(<esri102352> : N)110.5 516 Q
-(AD 1983 HARN StatePlane W)-.35 E(isconsin North FIPS 4801)-.4 E
-(<esri102353> : N)110.5 528 Q(AD 1983 HARN StatePlane W)-.35 E
-(isconsin Central FIPS 4802)-.4 E(<esri102354> : N)110.5 540 Q
-(AD 1983 HARN StatePlane W)-.35 E(isconsin South FIPS 4803)-.4 E
-(<esri102355> : N)110.5 552 Q(AD 1983 HARN StatePlane W)-.35 E
-(yoming East FIPS 4901)-.73 E(<esri102356> : N)110.5 564 Q
-(AD 1983 HARN StatePlane W)-.35 E(yoming East Central FIPS 4902)-.73 E
-(<esri102357> : N)110.5 576 Q(AD 1983 HARN StatePlane W)-.35 E(yoming W)
--.73 E(est Central FIPS 4903)-.8 E(<esri102358> : N)110.5 588 Q
-(AD 1983 HARN StatePlane W)-.35 E(yoming W)-.73 E(est FIPS 4904)-.8 E
-(<esri102361> : N)110.5 600 Q(AD 1983 HARN StatePlane Puerto Rico V)-.35
-E(ir)-.6 E(gin Islands FIPS 5200)-.18 E
-(<esri102491> : Nord Algerie Ancienne De)110.5 612 Q(gree)-.15 E
-(<esri102492> : Sud Algerie Ancienne De)110.5 624 Q(gree)-.15 E
-(<esri102581> : NTF France I de)110.5 636 Q(grees)-.15 E
-(<esri102582> : NTF France II de)110.5 648 Q(grees)-.15 E
-(<esri102583> : NTF France III de)110.5 660 Q(grees)-.15 E
-(<esri102584> : NTF France IV de)110.5 672 Q(grees)-.15 E
-(<esri102591> : Nord Algerie De)110.5 684 Q(gree)-.15 E
-(<esri102592> : Sud Algerie De)110.5 696 Q(gree)-.15 E(<esri102629> : N)
-110.5 708 Q(AD 1983 StatePlane Alabama East FIPS 0101 Feet)-.35 E
-(<esri102630> : N)110.5 720 Q(AD 1983 StatePlane Alabama W)-.35 E
-(est FIPS 0102 Feet)-.8 E(MB-System 5.0)72 768 Q(29 No)132.205 E -.15
-(ve)-.15 G(mber 2014).15 E(138)180.545 E 0 Cg EP
-%%Page: 139 139
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<esri102631> : N)110.5 84 Q
-(AD 1983 StatePlane Alaska 1 FIPS 5001 Feet)-.35 E(<esri102632> : N)
-110.5 96 Q(AD 1983 StatePlane Alaska 2 FIPS 5002 Feet)-.35 E
-(<esri102633> : N)110.5 108 Q
-(AD 1983 StatePlane Alaska 3 FIPS 5003 Feet)-.35 E(<esri102634> : N)
-110.5 120 Q(AD 1983 StatePlane Alaska 4 FIPS 5004 Feet)-.35 E
-(<esri102635> : N)110.5 132 Q
-(AD 1983 StatePlane Alaska 5 FIPS 5005 Feet)-.35 E(<esri102636> : N)
-110.5 144 Q(AD 1983 StatePlane Alaska 6 FIPS 5006 Feet)-.35 E
-(<esri102637> : N)110.5 156 Q
-(AD 1983 StatePlane Alaska 7 FIPS 5007 Feet)-.35 E(<esri102638> : N)
-110.5 168 Q(AD 1983 StatePlane Alaska 8 FIPS 5008 Feet)-.35 E
-(<esri102639> : N)110.5 180 Q
-(AD 1983 StatePlane Alaska 9 FIPS 5009 Feet)-.35 E(<esri102640> : N)
-110.5 192 Q(AD 1983 StatePlane Alaska 10 FIPS 5010 Feet)-.35 E
-(<esri102641> : N)110.5 204 Q
-(AD 1983 StatePlane California I FIPS 0401 Feet)-.35 E(<esri102642> : N)
-110.5 216 Q(AD 1983 StatePlane California II FIPS 0402 Feet)-.35 E
-(<esri102643> : N)110.5 228 Q
-(AD 1983 StatePlane California III FIPS 0403 Feet)-.35 E
-(<esri102644> : N)110.5 240 Q
-(AD 1983 StatePlane California IV FIPS 0404 Feet)-.35 E
-(<esri102645> : N)110.5 252 Q
-(AD 1983 StatePlane California V FIPS 0405 Feet)-.35 E(<esri102646> : N)
-110.5 264 Q(AD 1983 StatePlane California VI FIPS 0406 Feet)-.35 E
-(<esri102648> : N)110.5 276 Q
-(AD 1983 StatePlane Arizona East FIPS 0201 Feet)-.35 E(<esri102649> : N)
-110.5 288 Q(AD 1983 StatePlane Arizona Central FIPS 0202 Feet)-.35 E
-(<esri102650> : N)110.5 300 Q(AD 1983 StatePlane Arizona W)-.35 E
-(est FIPS 0203 Feet)-.8 E(<esri102651> : N)110.5 312 Q
-(AD 1983 StatePlane Arkansas North FIPS 0301 Feet)-.35 E
-(<esri102652> : N)110.5 324 Q
-(AD 1983 StatePlane Arkansas South FIPS 0302 Feet)-.35 E
-(<esri102653> : N)110.5 336 Q
-(AD 1983 StatePlane Colorado North FIPS 0501 Feet)-.35 E
-(<esri102654> : N)110.5 348 Q
-(AD 1983 StatePlane Colorado Central FIPS 0502 Feet)-.35 E
-(<esri102655> : N)110.5 360 Q
-(AD 1983 StatePlane Colorado South FIPS 0503 Feet)-.35 E
-(<esri102656> : N)110.5 372 Q
-(AD 1983 StatePlane Connecticut FIPS 0600 Feet)-.35 E(<esri102657> : N)
-110.5 384 Q(AD 1983 StatePlane Dela)-.35 E -.1(wa)-.15 G
-(re FIPS 0700 Feet).1 E(<esri102658> : N)110.5 396 Q
-(AD 1983 StatePlane Florida East FIPS 0901 Feet)-.35 E(<esri102659> : N)
-110.5 408 Q(AD 1983 StatePlane Florida W)-.35 E(est FIPS 0902 Feet)-.8 E
-(<esri102660> : N)110.5 420 Q
-(AD 1983 StatePlane Florida North FIPS 0903 Feet)-.35 E
-(<esri102661> : N)110.5 432 Q(AD 1983 StatePlane Ha)-.35 E -.1(wa)-.15 G
-(ii 1 FIPS 5101 Feet).1 E(<esri102662> : N)110.5 444 Q
-(AD 1983 StatePlane Ha)-.35 E -.1(wa)-.15 G(ii 2 FIPS 5102 Feet).1 E
-(<esri102663> : N)110.5 456 Q(AD 1983 StatePlane Ha)-.35 E -.1(wa)-.15 G
-(ii 3 FIPS 5103 Feet).1 E(<esri102664> : N)110.5 468 Q
-(AD 1983 StatePlane Ha)-.35 E -.1(wa)-.15 G(ii 4 FIPS 5104 Feet).1 E
-(<esri102665> : N)110.5 480 Q(AD 1983 StatePlane Ha)-.35 E -.1(wa)-.15 G
-(ii 5 FIPS 5105 Feet).1 E(<esri102666> : N)110.5 492 Q
-(AD 1983 StatePlane Geor)-.35 E(gia East FIPS 1001 Feet)-.18 E
-(<esri102667> : N)110.5 504 Q(AD 1983 StatePlane Geor)-.35 E(gia W)-.18
-E(est FIPS 1002 Feet)-.8 E(<esri102668> : N)110.5 516 Q
-(AD 1983 StatePlane Idaho East FIPS 1101 Feet)-.35 E(<esri102669> : N)
-110.5 528 Q(AD 1983 StatePlane Idaho Central FIPS 1102 Feet)-.35 E
-(<esri102670> : N)110.5 540 Q(AD 1983 StatePlane Idaho W)-.35 E
-(est FIPS 1103 Feet)-.8 E(<esri102671> : N)110.5 552 Q
-(AD 1983 StatePlane Illinois East FIPS 1201 Feet)-.35 E
-(<esri102672> : N)110.5 564 Q(AD 1983 StatePlane Illinois W)-.35 E
-(est FIPS 1202 Feet)-.8 E(<esri102673> : N)110.5 576 Q
-(AD 1983 StatePlane Indiana East FIPS 1301 Feet)-.35 E(<esri102674> : N)
-110.5 588 Q(AD 1983 StatePlane Indiana W)-.35 E(est FIPS 1302 Feet)-.8 E
-(<esri102675> : N)110.5 600 Q(AD 1983 StatePlane Io)-.35 E .2 -.1(wa N)
--.25 H(orth FIPS 1401 Feet).1 E(<esri102676> : N)110.5 612 Q
-(AD 1983 StatePlane Io)-.35 E .2 -.1(wa S)-.25 H(outh FIPS 1402 Feet).1
-E(<esri102677> : N)110.5 624 Q
-(AD 1983 StatePlane Kansas North FIPS 1501 Feet)-.35 E(<esri102678> : N)
-110.5 636 Q(AD 1983 StatePlane Kansas South FIPS 1502 Feet)-.35 E
-(<esri102679> : N)110.5 648 Q(AD 1983 StatePlane K)-.35 E(entuck)-.25 E
-2.5(yN)-.15 G(orth FIPS 1601 Feet)-2.5 E(<esri102680> : N)110.5 660 Q
-(AD 1983 StatePlane K)-.35 E(entuck)-.25 E 2.5(yS)-.15 G
-(outh FIPS 1602 Feet)-2.5 E(<esri102681> : N)110.5 672 Q
-(AD 1983 StatePlane Louisiana North FIPS 1701 Feet)-.35 E
-(<esri102682> : N)110.5 684 Q
-(AD 1983 StatePlane Louisiana South FIPS 1702 Feet)-.35 E
-(<esri102683> : N)110.5 696 Q
-(AD 1983 StatePlane Maine East FIPS 1801 Feet)-.35 E(<esri102684> : N)
-110.5 708 Q(AD 1983 StatePlane Maine W)-.35 E(est FIPS 1802 Feet)-.8 E
-(<esri102685> : N)110.5 720 Q
-(AD 1983 StatePlane Maryland FIPS 1900 Feet)-.35 E(MB-System 5.0)72 768
-Q(29 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E(139)180.545 E 0 Cg EP
-%%Page: 140 140
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<esri102686> : N)110.5 84 Q
-(AD 1983 StatePlane Massachusetts Mainland FIPS 2001 Feet)-.35 E
-(<esri102687> : N)110.5 96 Q
-(AD 1983 StatePlane Massachusetts Island FIPS 2002 Feet)-.35 E
-(<esri102688> : N)110.5 108 Q(AD 1983 StatePlane Michig)-.35 E
-(an North FIPS 2111 Feet)-.05 E(<esri102689> : N)110.5 120 Q
-(AD 1983 StatePlane Michig)-.35 E(an Central FIPS 2112 Feet)-.05 E
-(<esri102690> : N)110.5 132 Q(AD 1983 StatePlane Michig)-.35 E
-(an South FIPS 2113 Feet)-.05 E(<esri102691> : N)110.5 144 Q
-(AD 1983 StatePlane Minnesota North FIPS 2201 Feet)-.35 E
-(<esri102692> : N)110.5 156 Q
-(AD 1983 StatePlane Minnesota Central FIPS 2202 Feet)-.35 E
-(<esri102693> : N)110.5 168 Q
-(AD 1983 StatePlane Minnesota South FIPS 2203 Feet)-.35 E
-(<esri102694> : N)110.5 180 Q
-(AD 1983 StatePlane Mississippi East FIPS 2301 Feet)-.35 E
-(<esri102695> : N)110.5 192 Q(AD 1983 StatePlane Mississippi W)-.35 E
-(est FIPS 2302 Feet)-.8 E(<esri102696> : N)110.5 204 Q
-(AD 1983 StatePlane Missouri East FIPS 2401 Feet)-.35 E
-(<esri102697> : N)110.5 216 Q
-(AD 1983 StatePlane Missouri Central FIPS 2402 Feet)-.35 E
-(<esri102698> : N)110.5 228 Q(AD 1983 StatePlane Missouri W)-.35 E
-(est FIPS 2403 Feet)-.8 E(<esri102700> : N)110.5 240 Q
-(AD 1983 StatePlane Montana FIPS 2500 Feet)-.35 E(<esri102704> : N)110.5
-252 Q(AD 1983 StatePlane Nebraska FIPS 2600 Feet)-.35 E
-(<esri102707> : N)110.5 264 Q(AD 1983 StatePlane Ne)-.35 E -.25(va)-.25
-G(da East FIPS 2701 Feet).25 E(<esri102708> : N)110.5 276 Q
-(AD 1983 StatePlane Ne)-.35 E -.25(va)-.25 G(da Central FIPS 2702 Feet)
-.25 E(<esri102709> : N)110.5 288 Q(AD 1983 StatePlane Ne)-.35 E -.25(va)
--.25 G(da W).25 E(est FIPS 2703 Feet)-.8 E(<esri102710> : N)110.5 300 Q
-(AD 1983 StatePlane Ne)-.35 E 2.5(wH)-.25 G(ampshire FIPS 2800 Feet)-2.5
-E(<esri102711> : N)110.5 312 Q(AD 1983 StatePlane Ne)-.35 E 2.5(wJ)-.25
-G(erse)-2.5 E 2.5(yF)-.15 G(IPS 2900 Feet)-2.5 E(<esri102712> : N)110.5
-324 Q(AD 1983 StatePlane Ne)-.35 E 2.5(wM)-.25 G -.15(ex)-2.5 G
-(ico East FIPS 3001 Feet).15 E(<esri102713> : N)110.5 336 Q
-(AD 1983 StatePlane Ne)-.35 E 2.5(wM)-.25 G -.15(ex)-2.5 G
-(ico Central FIPS 3002 Feet).15 E(<esri102714> : N)110.5 348 Q
-(AD 1983 StatePlane Ne)-.35 E 2.5(wM)-.25 G -.15(ex)-2.5 G(ico W).15 E
-(est FIPS 3003 Feet)-.8 E(<esri102715> : N)110.5 360 Q
-(AD 1983 StatePlane Ne)-.35 E 2.5(wY)-.25 G(ork East FIPS 3101 Feet)-3.6
-E(<esri102716> : N)110.5 372 Q(AD 1983 StatePlane Ne)-.35 E 2.5(wY)-.25
-G(ork Central FIPS 3102 Feet)-3.6 E(<esri102717> : N)110.5 384 Q
-(AD 1983 StatePlane Ne)-.35 E 2.5(wY)-.25 G(ork W)-3.6 E
-(est FIPS 3103 Feet)-.8 E(<esri102718> : N)110.5 396 Q
-(AD 1983 StatePlane Ne)-.35 E 2.5(wY)-.25 G
-(ork Long Island FIPS 3104 Feet)-3.6 E(<esri102719> : N)110.5 408 Q
-(AD 1983 StatePlane North Carolina FIPS 3200 Feet)-.35 E
-(<esri102720> : N)110.5 420 Q(AD 1983 StatePlane North Dak)-.35 E
-(ota North FIPS 3301 Feet)-.1 E(<esri102721> : N)110.5 432 Q
-(AD 1983 StatePlane North Dak)-.35 E(ota South FIPS 3302 Feet)-.1 E
-(<esri102722> : N)110.5 444 Q
-(AD 1983 StatePlane Ohio North FIPS 3401 Feet)-.35 E(<esri102723> : N)
-110.5 456 Q(AD 1983 StatePlane Ohio South FIPS 3402 Feet)-.35 E
-(<esri102724> : N)110.5 468 Q
-(AD 1983 StatePlane Oklahoma North FIPS 3501 Feet)-.35 E
-(<esri102725> : N)110.5 480 Q
-(AD 1983 StatePlane Oklahoma South FIPS 3502 Feet)-.35 E
-(<esri102726> : N)110.5 492 Q(AD 1983 StatePlane Ore)-.35 E
-(gon North FIPS 3601 Feet)-.15 E(<esri102727> : N)110.5 504 Q
-(AD 1983 StatePlane Ore)-.35 E(gon South FIPS 3602 Feet)-.15 E
-(<esri102728> : N)110.5 516 Q(AD 1983 StatePlane Pennsylv)-.35 E
-(ania North FIPS 3701 Feet)-.25 E(<esri102729> : N)110.5 528 Q
-(AD 1983 StatePlane Pennsylv)-.35 E(ania South FIPS 3702 Feet)-.25 E
-(<esri102730> : N)110.5 540 Q
-(AD 1983 StatePlane Rhode Island FIPS 3800 Feet)-.35 E(<esri102733> : N)
-110.5 552 Q(AD 1983 StatePlane South Carolina FIPS 3900 Feet)-.35 E
-(<esri102734> : N)110.5 564 Q(AD 1983 StatePlane South Dak)-.35 E
-(ota North FIPS 4001 Feet)-.1 E(<esri102735> : N)110.5 576 Q
-(AD 1983 StatePlane South Dak)-.35 E(ota South FIPS 4002 Feet)-.1 E
-(<esri102736> : N)110.5 588 Q(AD 1983 StatePlane T)-.35 E
-(ennessee FIPS 4100 Feet)-.7 E(<esri102737> : N)110.5 600 Q
-(AD 1983 StatePlane T)-.35 E -.15(ex)-.7 G(as North FIPS 4201 Feet).15 E
-(<esri102738> : N)110.5 612 Q(AD 1983 StatePlane T)-.35 E -.15(ex)-.7 G
-(as North Central FIPS 4202 Feet).15 E(<esri102739> : N)110.5 624 Q
-(AD 1983 StatePlane T)-.35 E -.15(ex)-.7 G(as Central FIPS 4203 Feet).15
-E(<esri102740> : N)110.5 636 Q(AD 1983 StatePlane T)-.35 E -.15(ex)-.7 G
-(as South Central FIPS 4204 Feet).15 E(<esri102741> : N)110.5 648 Q
-(AD 1983 StatePlane T)-.35 E -.15(ex)-.7 G(as South FIPS 4205 Feet).15 E
-(<esri102742> : N)110.5 660 Q
-(AD 1983 StatePlane Utah North FIPS 4301 Feet)-.35 E(<esri102743> : N)
-110.5 672 Q(AD 1983 StatePlane Utah Central FIPS 4302 Feet)-.35 E
-(<esri102744> : N)110.5 684 Q
-(AD 1983 StatePlane Utah South FIPS 4303 Feet)-.35 E(<esri102745> : N)
-110.5 696 Q(AD 1983 StatePlane V)-.35 E(ermont FIPS 4400 Feet)-1.11 E
-(<esri102746> : N)110.5 708 Q(AD 1983 StatePlane V)-.35 E(ir)-.6 E
-(ginia North FIPS 4501 Feet)-.18 E(<esri102747> : N)110.5 720 Q
-(AD 1983 StatePlane V)-.35 E(ir)-.6 E(ginia South FIPS 4502 Feet)-.18 E
-(MB-System 5.0)72 768 Q(29 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E
-(140)180.545 E 0 Cg EP
-%%Page: 141 141
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<esri102748> : N)110.5 84 Q(AD 1983 StatePlane W)
--.35 E(ashington North FIPS 4601 Feet)-.8 E(<esri102749> : N)110.5 96 Q
-(AD 1983 StatePlane W)-.35 E(ashington South FIPS 4602 Feet)-.8 E
-(<esri102750> : N)110.5 108 Q(AD 1983 StatePlane W)-.35 E(est V)-.8 E
-(ir)-.6 E(ginia North FIPS 4701 Feet)-.18 E(<esri102751> : N)110.5 120 Q
-(AD 1983 StatePlane W)-.35 E(est V)-.8 E(ir)-.6 E
-(ginia South FIPS 4702 Feet)-.18 E(<esri102752> : N)110.5 132 Q
-(AD 1983 StatePlane W)-.35 E(isconsin North FIPS 4801 Feet)-.4 E
-(<esri102753> : N)110.5 144 Q(AD 1983 StatePlane W)-.35 E
-(isconsin Central FIPS 4802 Feet)-.4 E(<esri102754> : N)110.5 156 Q
-(AD 1983 StatePlane W)-.35 E(isconsin South FIPS 4803 Feet)-.4 E
-(<esri102755> : N)110.5 168 Q(AD 1983 StatePlane W)-.35 E
-(yoming East FIPS 4901 Feet)-.73 E(<esri102756> : N)110.5 180 Q
-(AD 1983 StatePlane W)-.35 E(yoming East Central FIPS 4902 Feet)-.73 E
-(<esri102757> : N)110.5 192 Q(AD 1983 StatePlane W)-.35 E(yoming W)-.73
-E(est Central FIPS 4903 Feet)-.8 E(<esri102758> : N)110.5 204 Q
-(AD 1983 StatePlane W)-.35 E(yoming W)-.73 E(est FIPS 4904 Feet)-.8 E
-(<esri102761> : N)110.5 216 Q(AD 1983 StatePlane Puerto Rico V)-.35 E
-(ir)-.6 E(gin Islands FIPS 5200 Feet)-.18 E(<esri102766> : N)110.5 228 Q
-(AD 1983 StatePlane Guam FIPS 5400 Feet)-.35 E
-(<esri103300> : Belge Lambert 1972)110.5 240 Q
-(<esri4023> : GCS International 1967)110.5 252 Q
-(<esri4217> : GCS Bern 1898)110.5 264 Q(<esri4305> : GCS V)110.5 276 Q
-(oirol Uni\214e 1960)-1.29 E(<esri4404> : GCS Montserrat 1958)110.5 288
-Q(<esri4812> : GCS V)110.5 300 Q(oirol Uni\214e 1960 P)-1.29 E(aris)-.15
-E(<esri37001> : GCS WGS 1966)110.5 312 Q(<esri37002> : GCS Fischer 1960)
-110.5 324 Q(<esri37003> : GCS Fischer 1968)110.5 336 Q
-(<esri37004> : GCS Fischer Modi\214ed)110.5 348 Q
-(<esri37005> : GCS Hough 1960)110.5 360 Q(<esri37006> : GCS Ev)110.5 372
-Q(erest Modi\214ed 1969)-.15 E(<esri37007> : GCS W)110.5 384 Q(albeck)
--.8 E(<esri37008> : GCS Sphere ARC INFO)110.5 396 Q
-(<esri37201> : GCS European 1979)110.5 408 Q(<esri37202> : GCS Ev)110.5
-420 Q(erest Bangladesh)-.15 E(<esri37203> : GCS Ev)110.5 432 Q
-(erest India Nepal)-.15 E(<esri37204> : GCS Hjorse)110.5 444 Q 2.5(y1)
--.15 G(955)-2.5 E(<esri37205> : GCS Hong K)110.5 456 Q(ong 1963)-.35 E
-(<esri37206> : GCS Oman)110.5 468 Q(<esri37207> : GCS South Asia Sing)
-110.5 480 Q(apore)-.05 E(<esri37208> : GCS A)110.5 492 Q(yabelle)-.92 E
-(<esri37211> : GCS Point 58)110.5 504 Q(<esri37212> : GCS Beacon E 1945)
-110.5 516 Q(<esri37213> : GCS T)110.5 528 Q(ern Island 1961)-.7 E
-(<esri37214> : GCS Astro 1952)110.5 540 Q(<esri37215> : GCS Belle)110.5
-552 Q(vue IGN)-.25 E(<esri37216> : GCS Canton 1966)110.5 564 Q
-(<esri37217> : GCS Chatham Island 1971)110.5 576 Q
-(<esri37218> : GCS DOS 1968)110.5 588 Q
-(<esri37219> : GCS Easter Island 1967)110.5 600 Q
-(<esri37220> : GCS Guam 1963)110.5 612 Q(<esri37221> : GCS GUX 1)110.5
-624 Q(<esri37222> : GCS Johnston Island 1961)110.5 636 Q
-(<esri37223> : GCS Carthage De)110.5 648 Q(gree)-.15 E
-(<esri37224> : GCS Midw)110.5 660 Q(ay 1961)-.1 E
-(<esri37226> : GCS Pitcairn 1967)110.5 672 Q
-(<esri37227> : GCS Santo DOS 1965)110.5 684 Q(<esri37228> : GCS V)110.5
-696 Q(iti Le)-.6 E(vu 1916)-.25 E(<esri37229> : GCS W)110.5 708 Q(ak)-.8
-E 2.5(eE)-.1 G(niwetok 1960)-2.5 E(<esri37230> : GCS W)110.5 720 Q(ak)
--.8 E 2.5(eI)-.1 G(sland 1952)-2.5 E(MB-System 5.0)72 768 Q(29 No)
-132.205 E -.15(ve)-.15 G(mber 2014).15 E(141)180.545 E 0 Cg EP
-%%Page: 142 142
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<esri37231> : GCS Anna 1 1965)110.5 84 Q
-(<esri37232> : GCS Gan 1970)110.5 96 Q(<esri37233> : GCS ISTS 073 1969)
-110.5 108 Q(<esri37234> : GCS K)110.5 120 Q(er)-.25 E
-(guelen Island 1949)-.18 E(<esri37235> : GCS Reunion)110.5 132 Q
-(<esri37237> : GCS Ascension Island 1958)110.5 144 Q
-(<esri37238> : GCS DOS 71 4)110.5 156 Q(<esri37239> : GCS Cape Cana)
-110.5 168 Q -.15(ve)-.2 G(ral).15 E(<esri37240> : GCS F)110.5 180 Q
-(ort Thomas 1955)-.15 E(<esri37241> : GCS Graciosa Base SW 1948)110.5
-192 Q(<esri37242> : GCS ISTS 061 1968)110.5 204 Q
-(<esri37243> : GCS LC5 1961)110.5 216 Q
-(<esri37245> : GCS Observ Meteorologico 1939)110.5 228 Q
-(<esri37246> : GCS Pico de Las Nie)110.5 240 Q -.15(ve)-.25 G(s).15 E
-(<esri37247> : GCS Porto Santo 1936)110.5 252 Q
-(<esri37249> : GCS Sao Braz)110.5 264 Q(<esri37250> : GCS Selv)110.5 276
-Q(agem Grande 1938)-.25 E(<esri37251> : GCS T)110.5 288 Q(ristan 1968)
--.35 E(<esri37252> : GCS Samoa 1962)110.5 300 Q
-(<esri37253> : GCS Camp Area)110.5 312 Q
-(<esri37254> : GCS Deception Island)110.5 324 Q
-(<esri37255> : GCS Gunung Se)110.5 336 Q -.05(ga)-.15 G(ra).05 E
-(<esri37257> : GCS S42 Hung)110.5 348 Q(ary)-.05 E(<esri37259> : GCS K)
-110.5 360 Q(usaie 1951)-.15 E(<esri37260> : GCS Alaskan Islands)110.5
-372 Q(<esri104000> : GCS Assumed Geographic 1)110.5 384 Q
-(<esri104101> : GCS Estonia 1937)110.5 396 Q
-(<esri104102> : GCS Hermannsk)110.5 408 Q(ogel)-.1 E
-(<esri104103> : GCS Sierra Leone 1960)110.5 420 Q
-(<esri104104> : GCS Hong K)110.5 432 Q(ong 1980)-.35 E
-(<esri104105> : GCS Datum Lisboa Bessel)110.5 444 Q
-(<esri104106> : GCS Datum Lisboa Hayford)110.5 456 Q
-(<esri104107> : GCS RGF 1993)110.5 468 Q(<esri104108> : GCS NZGD 2000)
-110.5 480 Q(<esri104261> : GCS Merchich De)110.5 492 Q(gree)-.15 E
-(<esri104304> : GCS V)110.5 504 Q(oirol 1875 De)-1.29 E(gree)-.15 E
-(<esri104305> : GCS V)110.5 516 Q(oirol Uni\214e 1960 De)-1.29 E(gree)
--.15 E(\255--------------------------------------------------------)
-110.5 540 Q(Google mercator)110.5 552 Q
-(\255--------------------------------------------------------)110.5 564
-Q(<900913> Chris' funn)110.5 576 Q 2.5(ye)-.15 G
-(psgish code for the google mercator)-2.5 E
-(\255--------------------------------------------------------)110.5 600
-Q(IGNF \(French Mapping Agenc)110.5 612 Q(y\) projection de\214nitions)
--.15 E(\255--------------------------------------------------------)
-110.5 624 Q(<AN)110.5 636 Q(AA92> : MOP92 \(Anaa\) T)-.35 E(uamotu)-.45
-E(<AP)110.5 648 Q -1.11(AT)-.92 G(86> : MOP86 \(Apataki, Rapa, Hao\) T)
-1.11 E(uamotu)-.45 E(<A)110.5 660 Q(TI> : Ancienne T)-1.11 E
-(riangulation des Ingenieurs)-.35 E(<CAD97> : Cadastre 1997)110.5 672 Q
-(<CIOBIH> : CIO-BIH)110.5 684 Q(<CR)110.5 696 Q(OZ63> : Crozet 1963)-.4
-E(<CSG67> : Guyane CSG67)110.5 708 Q(<ED50> : ED50)110.5 720 Q
-(MB-System 5.0)72 768 Q(29 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E
-(142)180.545 E 0 Cg EP
-%%Page: 143 143
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<EF)110.5 84 Q -1.11(AT)-.74 G(E57> : EF)1.11 E
--1.11(AT)-.74 G(E-IGN 1957)1.11 E(<F)110.5 96 Q(ANGA84> : MOP84 \(F)-.74
-E(ang)-.15 E(atauf)-.05 E 2.5(a1)-.1 G(984\))-2.5 E(<GU)110.5 108 Q
-(AD48> : Guadeloupe Ste Anne)-.4 E(<GU)110.5 120 Q
-(ADFM49> : Guadeloupe F)-.4 E(ort Marigot)-.15 E
-(<IGN63> : IGN 1963 \(Hi)110.5 132 Q .5 -.25(va O)-.25 H(a, T).25 E
-(ahuata, Mohotani\))-.8 E(<IGN72> : IGN 1972 Grande-T)110.5 144 Q
-(erre / Ile des Pins)-.7 E(<KA)110.5 156 Q(UE70> : MHPF70 \(Kauehi\) T)
--.55 E(uamotu)-.45 E(<KERG62CAR> : K)110.5 168 Q(er)-.25 E
-(guelen \255 K0)-.18 E(<LIFOU56> : Lifou \255 Iles Lo)110.5 180 Q
-(yaute \(IGN56\))-.1 E(<LUREF> : Nouv)110.5 192 Q(elle T)-.15 E
-(riangulation du Grand Duche du Lux)-.35 E(embour)-.15 E(g)-.18 E
-(<MARE53> : Mare \255 Iles Lo)110.5 204 Q(yaute \(IGN53\))-.1 E(<MARQ)
-110.5 216 Q(UI72> : IGN 1972 \(Eiao, Hi)-.1 E .5 -.25(va O)-.25 H
-(a, Mohotani\) Marquises).25 E(<MAR)110.5 228 Q(T38> : Martinique F)-.6
-E(ort-Desaix)-.15 E(<MA)110.5 240 Q -.3(YO)-1.05 G
-(50> : Mayotte Combani).3 E(<MHEFO55F> : MHEFO 1955 \(F)110.5 252 Q
-(atu Huku\))-.15 E(<MHPF67> : MHPF67 \(Mang)110.5 264 Q(are)-.05 E -.25
-(va)-.25 G 2.5(,A).25 G -.05(ga)-2.5 G(kauitai, Auk).05 E
-(ena, Mekiro\) Gambiers \(Iles\))-.1 E(<MOOREA87> : Moorea 1987)110.5
-276 Q(<MOP90> : MOP90 \(T)110.5 288 Q(etiaroa\) Iles de la Societe)-.7 E
-(<NTF> : Nouv)110.5 300 Q(elle T)-.15 E(riangulation Francaise)-.35 E
-(<NUKU72> : IGN 1972 Nuku Hi)110.5 312 Q -.25(va)-.25 G(<NUKU94> : SA)
-110.5 324 Q(T94 \(Nukuta)-1.11 E -.25(va)-.2 G -.1(ke).25 G 2.5(\)T).1 G
-(uamotu)-2.95 E(<OUVEA72CAR> : Ouv)110.5 336 Q(ea \255 Iles Lo)-.15 E
-(yaute \(MHNC 1972 \255 OUVEA\))-.1 E
-(<PETRELS72> : Petrels \255 IGN 1972)110.5 348 Q
-(<RAIA53> : IGN53 \(IGN Raiatea-T)110.5 360 Q(ahaa\) Raiatea-T)-.8 E
-(ahaa-Bora Bora-Huahine)-.8 E(<REUN47> : Reunion 1947)110.5 372 Q
-(<RGF93> : Reseau geodesique francais 1993)110.5 384 Q
-(<RGFG95> : Reseau geodesique francais de Guyane 1995)110.5 396 Q
-(<RGM04> : RGM04 \(Reseau Geodesique de Mayotte 2004\))110.5 408 Q
-(<RGNC> : Reseau Geodesique de Nouv)110.5 420 Q(elle-Caledonie)-.15 E
-(<RGPF> : RGPF \(Reseau Geodesique de Polynesie Francaise\))110.5 432 Q
-(<RGR92> : Reseau geodesique Reunion 1992)110.5 444 Q
-(<RGSPM06> : Reseau Geodesique Saint-Pierre-et-Miquelon \(2006\))110.5
-456 Q
-(<RRAF91> : RRAF 1991 \(Reseau de Reference des Antilles Francaises\))
-110.5 468 Q(<SA)110.5 480 Q(T84> : SA)-1.11 E
-(T84 \(Rurutu\) Iles Australes)-1.11 E
-(<SHOM84> : SHOM 1984 Martinique Montagne Du V)110.5 492 Q(auclin)-1.11
-E(<STPM50> : St Pierre et Miquelon 1950)110.5 504 Q(<T)110.5 516 Q
-(AHAA> : Raiatea \255 T)-.93 E(ahaa 51-54 \(T)-.8 E(ahaa, Base T)-.8 E
-(erme Est\))-.7 E(<T)110.5 528 Q(AHI51> : T)-.93 E(ahiti-T)-.8 E
-(erme Nord 1951)-.7 E(<T)110.5 540 Q(AHI79> : IGN79 \(T)-.93 E
-(ahiti\) Iles de la Societe)-.8 E(<T)110.5 552 Q(ANN)-.93 E(A> : T)-.35
-E(anna Bloc Sud)-.8 E(<TERA50> : Pointe Geologie \255 Perroud 1950)110.5
-564 Q(<TUB)110.5 576 Q(U69> : MHPF 1969 \(T)-.1 E(ub)-.45 E
-(uai\) Iles Australes)-.2 E(<W)110.5 588 Q(ALL78> : W)-1.2 E(allis-Uv)
--.8 E(ea 1978 \(MOP78\))-.15 E(<WGS72> : W)110.5 600 Q
-(orld Geodetic System 1972)-.8 E(<WGS84> : W)110.5 612 Q
-(orld Geodetic System 1984)-.8 E(<AN)110.5 624 Q
-(AA92GEO> : MOP92 \(Anaa\) T)-.35 E(uamotu)-.45 E(<AP)110.5 636 Q -1.11
-(AT)-.92 G(86GEO> : MOP86 \(Apataki, Rapa, Hao\) T)1.11 E(uamotu)-.45 E
-(<A)110.5 648 Q(TIGEO> : Ancienne T)-1.11 E(riangulation des Ingenieurs)
--.35 E(<CAD97GEO> : Cadastre 1997)110.5 660 Q(<CR)110.5 672 Q
-(OZ63GEO> : Crozet 1963)-.4 E(<CSG67GEO> : Guyane CSG67 UTM fuseau 21)
-110.5 684 Q(<ED50G> : ED50)110.5 696 Q(<EF)110.5 708 Q -1.11(AT)-.74 G
-(E57GEO> : EF)1.11 E -1.11(AT)-.74 G(E-IGN 1957)1.11 E(<F)110.5 720 Q
-(ANGA84GEO> : MOP84 \(F)-.74 E(ang)-.15 E(atauf)-.05 E 2.5(a1)-.1 G
-(984\))-2.5 E(MB-System 5.0)72 768 Q(29 No)132.205 E -.15(ve)-.15 G
-(mber 2014).15 E(143)180.545 E 0 Cg EP
-%%Page: 144 144
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<GU)110.5 84 Q(AD48GEO> : Guadeloupe Ste Anne)-.4
-E(<GU)110.5 96 Q(ADFM49GEO> : Guadeloupe F)-.4 E(ort Marigot)-.15 E
-(<IGN63GEO> : IGN 1963 \(Hi)110.5 108 Q .5 -.25(va O)-.25 H(a, T).25 E
-(ahuata, Mohotani\))-.8 E(<IGN72GEO> : IGN 1972 Grande-T)110.5 120 Q
-(erre / Ile des Pins)-.7 E(<KA)110.5 132 Q
-(UE70GEO> : MHPF70 \(Kauehi\) T)-.55 E(uamotu)-.45 E(<KERG62GEO> : K)
-110.5 144 Q(er)-.25 E(guelen \255 K0)-.18 E
-(<LIFOU56GEO> : Lifou \255 Iles Lo)110.5 156 Q(yaute \(IGN56\))-.1 E
-(<LUXGEO> : Nouv)110.5 168 Q(elle T)-.15 E
-(riangulation du Grand Duche du Lux)-.35 E(embour)-.15 E(g)-.18 E
-(<MARE53GEO> : Mare \255 Iles Lo)110.5 180 Q(yaute \(IGN53\))-.1 E
-(<MARQ)110.5 192 Q(UI72GEO> : IGN 1972 \(Eiao, Hi)-.1 E .5 -.25(va O)
--.25 H(a, Mohotani\) Marquises).25 E(<MAR)110.5 204 Q
-(T38GEO> : Martinique F)-.6 E(ort-Desaix)-.15 E(<MA)110.5 216 Q -.3(YO)
--1.05 G(50GEO> : Mayotte Combani).3 E(<MHEFO55FGEO> : MHEFO 1955 \(F)
-110.5 228 Q(atu Huku\))-.15 E(<MHPF67GEO> : MHPF67 \(Mang)110.5 240 Q
-(are)-.05 E -.25(va)-.25 G 2.5(,A).25 G -.05(ga)-2.5 G(kauitai, Auk).05
-E(ena, Mekiro\) Gambiers \(Iles\))-.1 E(<MOOREA87GEO> : Moorea 1987)
-110.5 252 Q(<MOP90GEO> : MOP90 \(T)110.5 264 Q
-(etiaroa\) Iles de la Societe)-.7 E(<NTFG> : Nouv)110.5 276 Q(elle T)
--.15 E(riangulation Francaise Greenwich de)-.35 E(gres se)-.15 E
-(xagesimaux)-.15 E(<NTFP> : Nouv)110.5 288 Q(elle T)-.15 E
-(riangulation Francaise P)-.35 E(aris grades)-.15 E
-(<NUKU72GEO> : IGN 1972 Nuku Hi)110.5 300 Q -.25(va)-.25 G
-(<NUKU94GEO> : SA)110.5 312 Q(T94 \(Nukuta)-1.11 E -.25(va)-.2 G -.1(ke)
-.25 G 2.5(\)T).1 G(uamotu)-2.95 E(<OUVEA72GEO> : Ouv)110.5 324 Q
-(ea \255 Iles Lo)-.15 E(yaute \(MHNC 1972 \255 OUVEA\))-.1 E
-(<RAIA53GEO> : IGN53 \(IGN Raiatea-T)110.5 336 Q(ahaa\) Raiatea-T)-.8 E
-(ahaa-Bora Bora-Huahine)-.8 E(<REUN47GEO> : Reunion 1947)110.5 348 Q
-(<RGF93G> : Reseau geodesique francais 1993)110.5 360 Q
-(<RGFG95GEO> : Reseau geodesique francais de Guyane 1995)110.5 372 Q
-(<RGM04GEO> : RGM04 \(Reseau Geodesique de Mayotte 2004\))110.5 384 Q
-(<RGNCGEO> : Reseau Geodesique de Nouv)110.5 396 Q(elle-Caledonie)-.15 E
-(<RGPFGEO> : RGPF \(Reseau Geodesique de Polynesie Francaise\))110.5 408
-Q(<RGR92GEO> : Reseau geodesique de la Reunion 1992)110.5 420 Q
-(<RGSPM06GEO> : Saint-Pierre-et-Miquelon \(2006\))110.5 432 Q(<SA)110.5
-444 Q(T84GEO> : SA)-1.11 E(T84 \(Rurutu\) Iles Australes)-1.11 E
-(<SHOM84GEO> : SHOM 1984 Martinique Montagne Du V)110.5 456 Q(auclin)
--1.11 E(<STPM50GEO> : St Pierre et Miquelon 1950)110.5 468 Q(<T)110.5
-480 Q(AHAA)-.93 E(GEO> : Raiatea \255 T)-.4 E(ahaa 51-54 \(T)-.8 E
-(ahaa, Base T)-.8 E(erme Est\))-.7 E(<T)110.5 492 Q(AHI51GEO> : T)-.93 E
-(ahiti-T)-.8 E(erme Nord 1951)-.7 E(<T)110.5 504 Q
-(AHI79GEO> : IGN79 \(T)-.93 E(ahiti\) Iles de la Societe)-.8 E(<T)110.5
-516 Q(ANN)-.93 E -.4(AG)-.35 G(EO> : T).4 E(anna Bloc Sud)-.8 E
-(<TERA50GEO> : Pointe Geologie \255 Perroud 1950)110.5 528 Q(<TUB)110.5
-540 Q(U69GEO> : MHPF 1969 \(T)-.1 E(ub)-.45 E(uai\) Iles Australes)-.2 E
-(<W)110.5 552 Q(ALL78GEO> : W)-1.2 E(allis \255 Uv)-.8 E
-(ea 1978 \(MOP78\))-.15 E(<WGS72G> : WGS72)110.5 564 Q(<WGS84G> : W)
-110.5 576 Q(orld Geodetic System 1984)-.8 E(<WGS84RRAFGEO> : Reseau de \
-reference des Antilles francaises \(1988-1991\))110.5 588 Q
-(<XGEO> : Systeme CIO-BIH)110.5 600 Q(<AN)110.5 612 Q
-(AA92UTM6S> : MOP92 \(Anaa\) T)-.35 E(uamotu \255 UTM fuseau 6 Sud)-.45
-E(<AP)110.5 624 Q -1.11(AT)-.92 G
-(86UTM6S> : MOP86 \(Apataki, Rapa, Hao\) T)1.11 E
-(uamotu \255 UTM fuseau 6 Sud)-.45 E(<AP)110.5 636 Q -1.11(AT)-.92 G
-(86UTM7S> : MOP86 \(Apataki, Rapa, Hao\) T)1.11 E
-(uamotu \255 UTM fuseau 7 Sud)-.45 E
-(<CAD97UTM38S> : Cadastre 1997 \255 UTM fuseau 38 Sud)110.5 648 Q(<CR)
-110.5 660 Q(OZ63UTM39S> : Crozet 1963)-.4 E
-(<CSG67UTM21> : Guyane CSG67 UTM fuseau 21)110.5 672 Q
-(<CSG67UTM22> : Guyane CSG67 UTM fuseau 22)110.5 684 Q(<EF)110.5 696 Q
--1.11(AT)-.74 G(E57UT59S> : EF)1.11 E -1.11(AT)-.74 G
-(E-IGN 1957 \255 UTM fuseau 59 Sud)1.11 E(<F)110.5 708 Q
-(ANGA84UTM7S> : F)-.74 E(ang)-.15 E(atauf)-.05 E 2.5(a1)-.1 G
-(984 \255 UTM fuseau 7 Sud)-2.5 E(<GEOPOR)110.5 720 Q -.93(TA)-.6 G
-(LANF> : Geoportail \255 Antilles francaises).93 E(MB-System 5.0)72 768
-Q(29 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E(144)180.545 E 0 Cg EP
-%%Page: 145 145
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<GEOPOR)110.5 84 Q -.93(TA)-.6 G
-(LCRZ> : Geoportail \255 Crozet).93 E(<GEOPOR)110.5 96 Q -.93(TA)-.6 G
-(LFXX> : Geoportail \255 France metropolitaine).93 E(<GEOPOR)110.5 108 Q
--.93(TA)-.6 G(LGUF> : Geoportail \255 Guyane).93 E(<GEOPOR)110.5 120 Q
--.93(TA)-.6 G(LKER> : Geoportail \255 K).93 E(er)-.25 E(guelen)-.18 E
-(<GEOPOR)110.5 132 Q -.93(TA)-.6 G(LMYT> : Geoportail \255 Mayotte).93 E
-(<GEOPOR)110.5 144 Q -.93(TA)-.6 G(LNCL> : Geoportail \255 Nouv).93 E
-(elle-Caledonie)-.15 E(<GEOPOR)110.5 156 Q -.93(TA)-.6 G
-(LPYF> : Geoportail \255 Polynesie francaise).93 E(<GEOPOR)110.5 168 Q
--.93(TA)-.6 G(LREU> : Geoportail \255 Reunion et dependances).93 E
-(<GEOPOR)110.5 180 Q -.93(TA)-.6 G
-(LSPM> : Geoportail \255 Saint-Pierre et Miquelon).93 E(<GEOPOR)110.5
-192 Q -.93(TA)-.6 G -.74(LW).93 G(LF> : Geoportail \255 W).74 E
-(allis et Futuna)-.8 E(<GU)110.5 204 Q(AD48UTM20> : Guadeloupe Ste Anne)
--.4 E(<GU)110.5 216 Q(ADFM49U20> : Guadeloupe F)-.4 E(ort Marigot)-.15 E
-(<IGN63UTM7S> : IGN 1963 \255 Hi)110.5 228 Q .5 -.25(va O)-.25 H(a, T)
-.25 E(ahuata, Mohotani \255 UTM fuseau 7 Sud)-.8 E
-(<IGN72LAM> : IGN 1972 \255 Lambert Nouv)110.5 240 Q(elle Caledonie)-.15
-E(<IGN72UTM58S> : IGN 1972 \255 UTM fuseau 58 Sud)110.5 252 Q(<KA)110.5
-264 Q(UE70UTM6S> : MHPF70 \(Kauehi\) T)-.55 E
-(uamotu \255 UTM fuseau 6 Sud)-.45 E(<KERG62UTM42S> : K)110.5 276 Q(er)
--.25 E(guelen 1962)-.18 E(<LAMB1> : Lambert I)110.5 288 Q
-(<LAMB1C> : Lambert I Carto)110.5 300 Q(<LAMB2> : Lambert II)110.5 312 Q
-(<LAMB2C> : Lambert II Carto)110.5 324 Q(<LAMB3> : Lambert III)110.5 336
-Q(<LAMB3C> : Lambert III Carto)110.5 348 Q(<LAMB4> : Lambert IV)110.5
-360 Q(<LAMB4C> : Lambert IV Carto)110.5 372 Q(<LAMB93> : Lambert 93)
-110.5 384 Q(<LAMBE> : Lambert II etendu)110.5 396 Q
-(<LAMBGC> : Lambert grand champ)110.5 408 Q(<LUXGA)110.5 420 Q
-(USSK> : Lux)-.55 E(embour)-.15 E 2.5(g1)-.18 G(929)-2.5 E
-(<MARE53UTM58S> : Mare \255 Iles Lo)110.5 432 Q
-(yaute \255 UTM fuseau 58 Sud)-.1 E(<MAR)110.5 444 Q
-(T38UTM20> : Martinique F)-.6 E(ort-Desaix)-.15 E(<MA)110.5 456 Q -.3
-(YO)-1.05 G(50UTM38S> : Mayotte Combani).3 E
-(<MHPF67UTM8S> : MHPF67 \(Mang)110.5 468 Q(are)-.05 E -.25(va)-.25 G 2.5
-(,A).25 G -.05(ga)-2.5 G(kauitai, Auk).05 E
-(ena, Mekiro\) Gambiers \(Iles\) \255 UTM 8 S)-.1 E
-(<MILLER> : Geoportail \255 Monde)110.5 480 Q
-(<MOOREA87U6S> : Moorea 1987 \255 UTM fuseau 6 Sud)110.5 492 Q
-(<MOP90UTM6S> : MOP90 \(T)110.5 504 Q
-(etiaroa\) Iles de la Societe \255 UTM fuseau 6 Sud)-.7 E
-(<NUKU72U7S> : IGN 1972 Nuku Hi)110.5 516 Q .5 -.25(va \255 U)-.25 H
-(TM fuseau 7 Sud).25 E(<NUKU94UTM7S> : IGN 1994 Nuku Hi)110.5 528 Q .5
--.25(va \255 U)-.25 H(TM fuseau 7 Sud).25 E(<OUVEA72U58S> : Ouv)110.5
-540 Q(ea \255 Iles Lo)-.15 E(yaute \255 UTM fuseau 58 Sud)-.1 E
-(<RAIA53UTM5S> : IGN53 \(IGN Raiatea-T)110.5 552 Q(ahaa\) Raiatea-T)-.8
-E(ahaa-Bora Bora-Huahine \255 UTM fuseau 5)-.8 E(<REUN47GA)110.5 564 Q
-(USSL> : Reunion Gauss Laborde)-.55 E
-(<RGF93CC42> : Projection conique conforme Zone 1)110.5 576 Q
-(<RGF93CC43> : Projection conique conforme Zone 2)110.5 588 Q
-(<RGF93CC44> : Projection conique conforme Zone 3)110.5 600 Q
-(<RGF93CC45> : Projection conique conforme Zone 4)110.5 612 Q
-(<RGF93CC46> : Projection conique conforme Zone 5)110.5 624 Q
-(<RGF93CC47> : Projection conique conforme Zone 6)110.5 636 Q
-(<RGF93CC48> : Projection conique conforme Zone 7)110.5 648 Q
-(<RGF93CC49> : Projection conique conforme Zone 8)110.5 660 Q
-(<RGF93CC50> : Projection conique conforme Zone 9)110.5 672 Q(<RGM04UTM\
-38S> : UTM fuseau 38 Sud \(Reseau Geodesique de Mayotte 2004\))110.5 684
-Q(<RGNCLAM> : Reseau Geodesique de Nouv)110.5 696 Q
-(elle-Caledonie \255 Lambert Nouv)-.15 E(elle Caledonie)-.15 E
-(<RGNCUTM57S> : Reseau Geodesique de Nouv)110.5 708 Q
-(elle-Caledonie \255 UTM fuseau 57 Sud)-.15 E
-(<RGNCUTM58S> : Reseau Geodesique de Nouv)110.5 720 Q
-(elle-Caledonie \255 UTM fuseau 58 Sud)-.15 E(MB-System 5.0)72 768 Q
-(29 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E(145)180.545 E 0 Cg EP
-%%Page: 146 146
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<RGNCUTM59S> : Reseau Geodesique de Nouv)110.5 84
-Q(elle-Caledonie \255 UTM fuseau 59 Sud)-.15 E
-(<RGPFUTM5S> : RGPF \255 UTM fuseau 5 Sud)110.5 96 Q
-(<RGPFUTM6S> : RGPF \255 UTM fuseau 6 Sud)110.5 108 Q
-(<RGPFUTM7S> : RGPF \255 UTM fuseau 7 Sud)110.5 120 Q
-(<RGR92UTM40S> : RGR92 UTM fuseau 40 Sud)110.5 132 Q
-(<RGSPM06U21> : Saint-Pierre-et-Miquelon \(2006\) UTM Fuseau 21 Nord)
-110.5 144 Q(<SA)110.5 156 Q(T84UTM5S> : SA)-1.11 E
-(T84 \(Rurutu\) Iles Australes \255 UTM fuseau 5 Sud)-1.11 E
-(<STEREOSX> : Stereographique polaire Sud)110.5 168 Q
-(<STPM50UTM21> : St Pierre et Miquelon 1950)110.5 180 Q(<T)110.5 192 Q
-(AHAA)-.93 E(UTM05S> : T)-.55 E(ahaa 1951)-.8 E(<T)110.5 204 Q
-(AHI51UTM06S> : T)-.93 E(ahiti-T)-.8 E(erme Nord UTM fuseau 6 Sud)-.7 E
-(<T)110.5 216 Q(AHI79UTM6S> : T)-.93 E(ahiti 1979)-.8 E(<T)110.5 228 Q
-(ANN)-.93 E -.55(AU)-.35 G(TM59S> : T).55 E
-(anna Bloc Sud \255 UTM fuseau 59 Sud)-.8 E(<TERA50SPT)110.5 240 Q
-(A> : T)-.93 E(erre Adelie Stereo polaire T)-.7 E(erre Adelie)-.7 E
-(<TERA50STEREO> : T)110.5 252 Q(erre Adelie 1950)-.7 E(<TUB)110.5 264 Q
-(U69UTM6S> : T)-.1 E(ub)-.45 E
-(uai \255 Iles Australes \255 UTM fuseau 6 Sud)-.2 E(<UTM01SW72> : W)
-110.5 276 Q(orld Geodetic System 1972 UTM fuseau 01 Sud)-.8 E
-(<UTM01SW84> : W)110.5 288 Q
-(orld Geodetic System 1984 UTM fuseau 01 Sud)-.8 E(<UTM01W84> : W)110.5
-300 Q(orld Geodetic System 1984 UTM fuseau 01)-.8 E(<UTM02SW84> : W)
-110.5 312 Q(orld Geodetic System 1984 UTM fuseau 02 Sud)-.8 E
-(<UTM02W84> : W)110.5 324 Q(orld Geodetic System 1984 UTM fuseau 02)-.8
-E(<UTM03SW84> : W)110.5 336 Q
-(orld Geodetic System 1984 UTM fuseau 03 Sud)-.8 E(<UTM03W84> : W)110.5
-348 Q(orld Geodetic System 1984 UTM fuseau 03)-.8 E(<UTM04SW84> : W)
-110.5 360 Q(orld Geodetic System 1984 UTM fuseau 04 Sud)-.8 E
-(<UTM04W84> : W)110.5 372 Q(orld Geodetic System 1984 UTM fuseau 04)-.8
-E(<UTM05SW84> : W)110.5 384 Q
-(orld Geodetic System 1984 UTM fuseau 05 Sud)-.8 E(<UTM05W84> : W)110.5
-396 Q(orld Geodetic System 1984 UTM fuseau 05)-.8 E(<UTM06SW84> : W)
-110.5 408 Q(orld Geodetic System 1984 UTM fuseau 06 Sud)-.8 E
-(<UTM06W84> : W)110.5 420 Q(orld Geodetic System 1984 UTM fuseau 06)-.8
-E(<UTM07SW84> : W)110.5 432 Q
-(orld Geodetic System 1984 UTM fuseau 07 Sud)-.8 E(<UTM07W84> : W)110.5
-444 Q(orld Geodetic System 1984 UTM fuseau 07)-.8 E(<UTM08SW84> : W)
-110.5 456 Q(orld Geodetic System 1984 UTM fuseau 08 Sud)-.8 E
-(<UTM08W84> : W)110.5 468 Q(orld Geodetic System 1984 UTM fuseau 08)-.8
-E(<UTM09SW84> : W)110.5 480 Q
-(orld Geodetic System 1984 UTM fuseau 09 Sud)-.8 E(<UTM09W84> : W)110.5
-492 Q(orld Geodetic System 1984 UTM fuseau 09)-.8 E(<UTM10SW84> : W)
-110.5 504 Q(orld Geodetic System 1984 UTM fuseau 10 Sud)-.8 E
-(<UTM10W84> : W)110.5 516 Q(orld Geodetic System 1984 UTM fuseau 10)-.8
-E(<UTM11SW84> : W)110.5 528 Q
-(orld Geodetic System 1984 UTM fuseau 11 Sud)-.8 E(<UTM11W84> : W)110.5
-540 Q(orld Geodetic System 1984 UTM fuseau 11)-.8 E(<UTM12SW84> : W)
-110.5 552 Q(orld Geodetic System 1984 UTM fuseau 12 Sud)-.8 E
-(<UTM12W84> : W)110.5 564 Q(orld Geodetic System 1984 UTM fuseau 12)-.8
-E(<UTM13SW84> : W)110.5 576 Q
-(orld Geodetic System 1984 UTM fuseau 13 Sud)-.8 E(<UTM13W84> : W)110.5
-588 Q(orld Geodetic System 1984 UTM fuseau 13)-.8 E(<UTM14SW84> : W)
-110.5 600 Q(orld Geodetic System 1984 UTM fuseau 14 Sud)-.8 E
-(<UTM14W84> : W)110.5 612 Q(orld Geodetic System 1984 UTM fuseau 14)-.8
-E(<UTM15SW84> : W)110.5 624 Q
-(orld Geodetic System 1984 UTM fuseau 15 Sud)-.8 E(<UTM15W84> : W)110.5
-636 Q(orld Geodetic System 1984 UTM fuseau 15)-.8 E(<UTM16SW84> : W)
-110.5 648 Q(orld Geodetic System 1984 UTM fuseau 16 Sud)-.8 E
-(<UTM16W84> : W)110.5 660 Q(orld Geodetic System 1984 UTM fuseau 16)-.8
-E(<UTM17SW84> : W)110.5 672 Q
-(orld Geodetic System 1984 UTM fuseau 17 Sud)-.8 E(<UTM17W84> : W)110.5
-684 Q(orld Geodetic System 1984 UTM fuseau 17)-.8 E(<UTM18SW84> : W)
-110.5 696 Q(orld Geodetic System 1984 UTM fuseau 18 Sud)-.8 E
-(<UTM18W84> : W)110.5 708 Q(orld Geodetic System 1984 UTM fuseau 18)-.8
-E(<UTM19SW84> : W)110.5 720 Q
-(orld Geodetic System 1984 UTM fuseau 19 Sud)-.8 E(MB-System 5.0)72 768
-Q(29 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E(146)180.545 E 0 Cg EP
-%%Page: 147 147
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<UTM19W84> : W)110.5 84 Q
-(orld Geodetic System 1984 UTM fuseau 19)-.8 E(<UTM20SW84> : W)110.5 96
-Q(orld Geodetic System 1984 UTM fuseau 20 Sud)-.8 E(<UTM20W84> : W)110.5
-108 Q(orld Geodetic System 1984 UTM fuseau 20)-.8 E(<UTM20W84GU)110.5
-120 Q(AD> : W)-.4 E
-(orld Geodetic System 1984 UTM fuseau 20 Nord-Guadeloupe)-.8 E
-(<UTM20W84MAR)110.5 132 Q(T> : W)-.6 E
-(orld Geodetic System 1984 UTM fuseau 20 Nord-Martinique)-.8 E
-(<UTM21SW84> : W)110.5 144 Q
-(orld Geodetic System 1984 UTM fuseau 21 Sud)-.8 E(<UTM21W84> : W)110.5
-156 Q(orld Geodetic System 1984 UTM fuseau 21)-.8 E
-(<UTM22RGFG95> : RGFG95 UTM fuseau 22 Nord-Guyane)110.5 168 Q
-(<UTM22SW84> : W)110.5 180 Q
-(orld Geodetic System 1984 UTM fuseau 22 Sud)-.8 E(<UTM22W84> : W)110.5
-192 Q(orld Geodetic System 1984 UTM fuseau 22)-.8 E(<UTM23SW84> : W)
-110.5 204 Q(orld Geodetic System 1984 UTM fuseau 23 Sud)-.8 E
-(<UTM23W84> : W)110.5 216 Q(orld Geodetic System 1984 UTM fuseau 23)-.8
-E(<UTM24SW84> : W)110.5 228 Q
-(orld Geodetic System 1984 UTM fuseau 24 Sud)-.8 E(<UTM24W84> : W)110.5
-240 Q(orld Geodetic System 1984 UTM fuseau 24)-.8 E(<UTM25SW84> : W)
-110.5 252 Q(orld Geodetic System 1984 UTM fuseau 25 Sud)-.8 E
-(<UTM25W84> : W)110.5 264 Q(orld Geodetic System 1984 UTM fuseau 25)-.8
-E(<UTM26SW84> : W)110.5 276 Q
-(orld Geodetic System 1984 UTM fuseau 26 Sud)-.8 E(<UTM26W84> : W)110.5
-288 Q(orld Geodetic System 1984 UTM fuseau 26)-.8 E(<UTM27SW84> : W)
-110.5 300 Q(orld Geodetic System 1984 UTM fuseau 27 Sud)-.8 E
-(<UTM27W84> : W)110.5 312 Q(orld Geodetic System 1984 UTM fuseau 27)-.8
-E(<UTM28SW84> : W)110.5 324 Q
-(orld Geodetic System 1984 UTM fuseau 28 Sud)-.8 E(<UTM28W84> : W)110.5
-336 Q(orld Geodetic System 1984 UTM fuseau 28)-.8 E(<UTM29SW84> : W)
-110.5 348 Q(orld Geodetic System 1984 UTM fuseau 29 Sud)-.8 E
-(<UTM29W84> : W)110.5 360 Q(orld Geodetic System 1984 UTM fuseau 29)-.8
-E(<UTM30> : European Datum 1950 UTM fuseau 30)110.5 372 Q
-(<UTM30RGF93> : RGF93 UTM fuseau 30)110.5 384 Q(<UTM30SW84> : W)110.5
-396 Q(orld Geodetic System 1984 UTM fuseau 30 Sud)-.8 E(<UTM30W72> : W)
-110.5 408 Q(orld Geodetic System 1972 UTM fuseau 30)-.8 E
-(<UTM30W84> : W)110.5 420 Q(orld Geodetic System 1984 UTM fuseau 30)-.8
-E(<UTM31> : European Datum 1950 UTM fuseau 31)110.5 432 Q
-(<UTM31RGF93> : RGF93 UTM fuseau 31)110.5 444 Q(<UTM31SW84> : W)110.5
-456 Q(orld Geodetic System 1984 UTM fuseau 31 Sud)-.8 E(<UTM31W72> : W)
-110.5 468 Q(orld Geodetic System 1972 UTM fuseau 31)-.8 E
-(<UTM31W84> : W)110.5 480 Q(orld Geodetic System 1984 UTM fuseau 31)-.8
-E(<UTM32> : European Datum 1950 UTM fuseau 32)110.5 492 Q
-(<UTM32RGF93> : RGF93 UTM fuseau 32)110.5 504 Q(<UTM32SW84> : W)110.5
-516 Q(orld Geodetic System 1984 UTM fuseau 32 Sud)-.8 E(<UTM32W72> : W)
-110.5 528 Q(orld Geodetic System 1972 UTM fuseau 32)-.8 E
-(<UTM32W84> : W)110.5 540 Q(orld Geodetic System 1984 UTM fuseau 32)-.8
-E(<UTM33SW84> : W)110.5 552 Q
-(orld Geodetic System 1984 UTM fuseau 33 Sud)-.8 E(<UTM33W84> : W)110.5
-564 Q(orld Geodetic System 1984 UTM fuseau 33)-.8 E(<UTM34SW84> : W)
-110.5 576 Q(orld Geodetic System 1984 UTM fuseau 34 Sud)-.8 E
-(<UTM34W84> : W)110.5 588 Q(orld Geodetic System 1984 UTM fuseau 34)-.8
-E(<UTM35SW84> : W)110.5 600 Q
-(orld Geodetic System 1984 UTM fuseau 35 Sud)-.8 E(<UTM35W84> : W)110.5
-612 Q(orld Geodetic System 1984 UTM fuseau 35)-.8 E(<UTM36SW84> : W)
-110.5 624 Q(orld Geodetic System 1984 UTM fuseau 36 Sud)-.8 E
-(<UTM36W84> : W)110.5 636 Q(orld Geodetic System 1984 UTM fuseau 36)-.8
-E(<UTM37SW84> : W)110.5 648 Q
-(orld Geodetic System 1984 UTM fuseau 37 Sud)-.8 E(<UTM37W84> : W)110.5
-660 Q(orld Geodetic System 1984 UTM fuseau 37)-.8 E(<UTM38SW84> : W)
-110.5 672 Q(orld Geodetic System 1984 UTM fuseau 38 Sud)-.8 E
-(<UTM38W84> : W)110.5 684 Q(orld Geodetic System 1984 UTM fuseau 38)-.8
-E(<UTM39SW84> : W)110.5 696 Q
-(orld Geodetic System 1984 UTM fuseau 39 Sud)-.8 E(<UTM39W84> : W)110.5
-708 Q(orld Geodetic System 1984 UTM fuseau 39)-.8 E(<UTM40SW84> : W)
-110.5 720 Q(orld Geodetic System 1984 UTM fuseau 40 Sud)-.8 E
-(MB-System 5.0)72 768 Q(29 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E
-(147)180.545 E 0 Cg EP
-%%Page: 148 148
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<UTM40W84> : W)110.5 84 Q
-(orld Geodetic System 1984 UTM fuseau 40)-.8 E(<UTM41SW84> : W)110.5 96
-Q(orld Geodetic System 1984 UTM fuseau 41 Sud)-.8 E(<UTM41W84> : W)110.5
-108 Q(orld Geodetic System 1984 UTM fuseau 41)-.8 E(<UTM42SW84> : W)
-110.5 120 Q(orld Geodetic System 1984 UTM fuseau 42 Sud)-.8 E
-(<UTM42W84> : W)110.5 132 Q(orld Geodetic System 1984 UTM fuseau 42)-.8
-E(<UTM43SW84> : W)110.5 144 Q
-(orld Geodetic System 1984 UTM fuseau 43 Sud)-.8 E(<UTM43W84> : W)110.5
-156 Q(orld Geodetic System 1984 UTM fuseau 43)-.8 E(<UTM44SW84> : W)
-110.5 168 Q(orld Geodetic System 1984 UTM fuseau 44 Sud)-.8 E
-(<UTM44W84> : W)110.5 180 Q(orld Geodetic System 1984 UTM fuseau 44)-.8
-E(<UTM45SW84> : W)110.5 192 Q
-(orld Geodetic System 1984 UTM fuseau 45 Sud)-.8 E(<UTM45W84> : W)110.5
-204 Q(orld Geodetic System 1984 UTM fuseau 45)-.8 E(<UTM46SW84> : W)
-110.5 216 Q(orld Geodetic System 1984 UTM fuseau 46 Sud)-.8 E
-(<UTM46W84> : W)110.5 228 Q(orld Geodetic System 1984 UTM fuseau 46)-.8
-E(<UTM47SW84> : W)110.5 240 Q
-(orld Geodetic System 1984 UTM fuseau 47 Sud)-.8 E(<UTM47W84> : W)110.5
-252 Q(orld Geodetic System 1984 UTM fuseau 47)-.8 E(<UTM48SW84> : W)
-110.5 264 Q(orld Geodetic System 1984 UTM fuseau 48 Sud)-.8 E
-(<UTM48W84> : W)110.5 276 Q(orld Geodetic System 1984 UTM fuseau 48)-.8
-E(<UTM49SW84> : W)110.5 288 Q
-(orld Geodetic System 1984 UTM fuseau 49 Sud)-.8 E(<UTM49W84> : W)110.5
-300 Q(orld Geodetic System 1984 UTM fuseau 49)-.8 E(<UTM50SW84> : W)
-110.5 312 Q(orld Geodetic System 1984 UTM fuseau 50 Sud)-.8 E
-(<UTM50W84> : W)110.5 324 Q(orld Geodetic System 1984 UTM fuseau 50)-.8
-E(<UTM51SW84> : W)110.5 336 Q
-(orld Geodetic System 1984 UTM fuseau 51 Sud)-.8 E(<UTM51W84> : W)110.5
-348 Q(orld Geodetic System 1984 UTM fuseau 51)-.8 E(<UTM52SW84> : W)
-110.5 360 Q(orld Geodetic System 1984 UTM fuseau 52 Sud)-.8 E
-(<UTM52W84> : W)110.5 372 Q(orld Geodetic System 1984 UTM fuseau 52)-.8
-E(<UTM53SW84> : W)110.5 384 Q
-(orld Geodetic System 1984 UTM fuseau 53 Sud)-.8 E(<UTM53W84> : W)110.5
-396 Q(orld Geodetic System 1984 UTM fuseau 53)-.8 E(<UTM54SW84> : W)
-110.5 408 Q(orld Geodetic System 1984 UTM fuseau 54 Sud)-.8 E
-(<UTM54W84> : W)110.5 420 Q(orld Geodetic System 1984 UTM fuseau 54)-.8
-E(<UTM55SW84> : W)110.5 432 Q
-(orld Geodetic System 1984 UTM fuseau 55 Sud)-.8 E(<UTM55W84> : W)110.5
-444 Q(orld Geodetic System 1984 UTM fuseau 55)-.8 E(<UTM56SW84> : W)
-110.5 456 Q(orld Geodetic System 1984 UTM fuseau 56 Sud)-.8 E
-(<UTM56W84> : W)110.5 468 Q(orld Geodetic System 1984 UTM fuseau 56)-.8
-E(<UTM57SW84> : W)110.5 480 Q
-(orld Geodetic System 1984 UTM fuseau 57 Sud)-.8 E(<UTM57W84> : W)110.5
-492 Q(orld Geodetic System 1984 UTM fuseau 57)-.8 E(<UTM58SW84> : W)
-110.5 504 Q(orld Geodetic System 1984 UTM fuseau 58 Sud)-.8 E
-(<UTM58W84> : W)110.5 516 Q(orld Geodetic System 1984 UTM fuseau 58)-.8
-E(<UTM59SW84> : W)110.5 528 Q
-(orld Geodetic System 1984 UTM fuseau 59 Sud)-.8 E(<UTM59W84> : W)110.5
-540 Q(orld Geodetic System 1984 UTM fuseau 59)-.8 E(<UTM60SW84> : W)
-110.5 552 Q(orld Geodetic System 1984 UTM fuseau 60 Sud)-.8 E
-(<UTM60W84> : W)110.5 564 Q(orld Geodetic System 1984 UTM fuseau 60)-.8
-E(<W)110.5 576 Q(ALL78UTM1S> : W)-1.2 E(allis-Uv)-.8 E
-(ea 1978 \(MOP78\) UTM 1 SUD)-.15 E
-(\255--------------------------------------------------------)110.5 600
-Q -1.11(Va)110.5 612 S(rious Non-U.S. Coordinate Systems,)1.11 E
-(\255--------------------------------------------------------)110.5 624
-Q(<CH1903> : Swiss Coordinate System)110.5 636 Q(<madag)110.5 648 Q
-(ascar> : Laborde grid for Madag)-.05 E(ascar)-.05 E(<ne)110.5 660 Q
-(w_zealand> : Ne)-.25 E 2.5(wZ)-.25 G
-(ealand Map Grid \(NZMG\) \255 Projection unique to N.Z. so all f)-2.5 E
-(actors \214x)-.1 E(ed)-.15 E
-(\255--------------------------------------------------------)110.5 672
-Q(Secondary grids DMA TM8358.1, p. 4.3)110.5 684 Q
-(\255--------------------------------------------------------)110.5 696
-Q(<bwi> : British W)110.5 708 Q(est Indies)-.8 E
-(<costa-n> : Costa Rica Norte)110.5 720 Q(MB-System 5.0)72 768 Q(29 No)
-132.205 E -.15(ve)-.15 G(mber 2014).15 E(148)180.545 E 0 Cg EP
-%%Page: 149 149
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbgrid\(1\) MB-System)72 48 R 159.28
-(5.0 mbgrid\(1\))2.5 F(<costa-s> : Costa Rica Sud)110.5 84 Q
-(<cuba-n> : Cuba Norte)110.5 96 Q(<cuba-s> : Cuba Sud)110.5 108 Q
-(<domin_rep> : Dominican Republic)110.5 120 Q(<e)110.5 132 Q
-(gypt-1> : Egypt)-.15 E(<e)110.5 144 Q(gypt-2> : Egypt)-.15 E(<e)110.5
-156 Q(gypt-3> : Egypt)-.15 E(<e)110.5 168 Q(gypt-4> : Egypt)-.15 E(<e)
-110.5 180 Q(gypt-5> : Egypt)-.15 E(<el_sal> : El Salv)110.5 192 Q(ador)
--.25 E(<guat-n> : Guatemala Norte)110.5 204 Q(<guat-s> : Guatemala Sud)
-110.5 216 Q(<haiti> : Haiti)110.5 228 Q(<hond-n> : Honduras Norte)110.5
-240 Q(<hond-s> : Honduras Sud)110.5 252 Q(<le)110.5 264 Q -.25(va)-.25 G
-(nt> : Le).25 E -.25(va)-.25 G(nt).25 E(<nica-n> : Nicaragua Norte)110.5
-276 Q(<nica-s> : Nicaragua Sud)110.5 288 Q
-(<nw-africa> : Northwest Africa)110.5 300 Q(<palestine> : P)110.5 312 Q
-(alestine)-.15 E(<panama> : P)110.5 324 Q(anama)-.15 E
-(\255--------------------------------------------------------)110.5 348
-Q(other grids in DMA TM8358.1)110.5 360 Q
-(\255--------------------------------------------------------)110.5 372
-Q(<bng> : British National Grid)110.5 384 Q(<malay> : W)110.5 396 Q
-(est Malaysian RSO Grid)-.8 E(<india-I> : India Zone I)110.5 408 Q
-(<india-IIA> : India Zone IIA)110.5 420 Q(<india-IIB> : India Zone IIB)
-110.5 432 Q(<india-IIIA> : India Zone IIIA)110.5 444 Q
-(<india-IIIB> : India Zone IIIB)110.5 456 Q(<india-IV)110.5 468 Q
-(A> : India Zone IV)-1.35 E(A)-1.35 E(<india-IVB> : India Zone IVB)110.5
-480 Q(<ce)110.5 492 Q(ylon> : Ce)-.15 E(ylon Belt)-.15 E
-(<irish> : Irish T)110.5 504 Q(ransv)-.35 E(erse Mercator Grid)-.15 E
-(<neiez> : Netherlands East Indies Equitorial Zone)110.5 516 Q
-(<n-alger> : Nord Algerie Grid)110.5 528 Q(<n-maroc> : Nord Maroc Grid)
-110.5 540 Q(<n-tunis> : Nord T)110.5 552 Q(unisie Grid)-.45 E
-(<s-alger> : Sud Algerie Grid)110.5 564 Q(<s-maroc> : Sud Maroc Grid)
-110.5 576 Q(<s-tunis> : Sud T)110.5 588 Q(unisie Grid)-.45 E
-(\255--------------------------------------------------------)110.5 612
-Q(Gauss Krue)110.5 624 Q(ger Grids for German)-.15 E(y)-.15 E
-(\255--------------------------------------------------------)110.5 636
-Q(<gk2-d> : Gauss Krue)110.5 648 Q(ger Grid for German)-.15 E(y)-.15 E
-(<gk3-d> : Gauss Krue)110.5 660 Q(ger Grid for German)-.15 E(y)-.15 E
-(<gk4-d> : Gauss Krue)110.5 672 Q(ger Grid for German)-.15 E(y)-.15 E
-(MB-System 5.0)72 768 Q(29 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E
-(149)180.545 E 0 Cg EP
-%%Trailer
-end
-%%EOF
diff --git a/src/ps/mbhistogram.ps b/src/ps/mbhistogram.ps
deleted file mode 100644
index 2846856..0000000
--- a/src/ps/mbhistogram.ps
+++ /dev/null
@@ -1,467 +0,0 @@
-%!PS-Adobe-3.0
-%%Creator: groff version 1.19.2
-%%CreationDate: Wed Jul  1 12:29:27 2015
-%%DocumentNeededResources: font Times-Roman
-%%+ font Times-Bold
-%%+ font Times-Italic
-%%DocumentSuppliedResources: procset grops 1.19 2
-%%Pages: 4
-%%PageOrder: Ascend
-%%DocumentMedia: Default 612 792 0 () ()
-%%Orientation: Portrait
-%%EndComments
-%%BeginDefaults
-%%PageMedia: Default
-%%EndDefaults
-%%BeginProlog
-%%BeginResource: procset grops 1.19 2
-%!PS-Adobe-3.0 Resource-ProcSet
-/setpacking where{
-pop
-currentpacking
-true setpacking
-}if
-/grops 120 dict dup begin
-/SC 32 def
-/A/show load def
-/B{0 SC 3 -1 roll widthshow}bind def
-/C{0 exch ashow}bind def
-/D{0 exch 0 SC 5 2 roll awidthshow}bind def
-/E{0 rmoveto show}bind def
-/F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def
-/G{0 rmoveto 0 exch ashow}bind def
-/H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/I{0 exch rmoveto show}bind def
-/J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def
-/K{0 exch rmoveto 0 exch ashow}bind def
-/L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/M{rmoveto show}bind def
-/N{rmoveto 0 SC 3 -1 roll widthshow}bind def
-/O{rmoveto 0 exch ashow}bind def
-/P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/Q{moveto show}bind def
-/R{moveto 0 SC 3 -1 roll widthshow}bind def
-/S{moveto 0 exch ashow}bind def
-/T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/SF{
-findfont exch
-[exch dup 0 exch 0 exch neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/MF{
-findfont
-[5 2 roll
-0 3 1 roll
-neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/level0 0 def
-/RES 0 def
-/PL 0 def
-/LS 0 def
-/MANUAL{
-statusdict begin/manualfeed true store end
-}bind def
-/PLG{
-gsave newpath clippath pathbbox grestore
-exch pop add exch pop
-}bind def
-/BP{
-/level0 save def
-1 setlinecap
-1 setlinejoin
-72 RES div dup scale
-LS{
-90 rotate
-}{
-0 PL translate
-}ifelse
-1 -1 scale
-}bind def
-/EP{
-level0 restore
-showpage
-}def
-/DA{
-newpath arcn stroke
-}bind def
-/SN{
-transform
-.25 sub exch .25 sub exch
-round .25 add exch round .25 add exch
-itransform
-}bind def
-/DL{
-SN
-moveto
-SN
-lineto stroke
-}bind def
-/DC{
-newpath 0 360 arc closepath
-}bind def
-/TM matrix def
-/DE{
-TM currentmatrix pop
-translate scale newpath 0 0 .5 0 360 arc closepath
-TM setmatrix
-}bind def
-/RC/rcurveto load def
-/RL/rlineto load def
-/ST/stroke load def
-/MT/moveto load def
-/CL/closepath load def
-/Fr{
-setrgbcolor fill
-}bind def
-/setcmykcolor where{
-pop
-/Fk{
-setcmykcolor fill
-}bind def
-}if
-/Fg{
-setgray fill
-}bind def
-/FL/fill load def
-/LW/setlinewidth load def
-/Cr/setrgbcolor load def
-/setcmykcolor where{
-pop
-/Ck/setcmykcolor load def
-}if
-/Cg/setgray load def
-/RE{
-findfont
-dup maxlength 1 index/FontName known not{1 add}if dict begin
-{
-1 index/FID ne{def}{pop pop}ifelse
-}forall
-/Encoding exch def
-dup/FontName exch def
-currentdict end definefont pop
-}bind def
-/DEFS 0 def
-/EBEGIN{
-moveto
-DEFS begin
-}bind def
-/EEND/end load def
-/CNT 0 def
-/level1 0 def
-/PBEGIN{
-/level1 save def
-translate
-div 3 1 roll div exch scale
-neg exch neg exch translate
-0 setgray
-0 setlinecap
-1 setlinewidth
-0 setlinejoin
-10 setmiterlimit
-[]0 setdash
-/setstrokeadjust where{
-pop
-false setstrokeadjust
-}if
-/setoverprint where{
-pop
-false setoverprint
-}if
-newpath
-/CNT countdictstack def
-userdict begin
-/showpage{}def
-/setpagedevice{}def
-}bind def
-/PEND{
-countdictstack CNT sub{end}repeat
-level1 restore
-}bind def
-end def
-/setpacking where{
-pop
-setpacking
-}if
-%%EndResource
-%%EndProlog
-%%BeginSetup
-%%BeginFeature: *PageSize Default
-<< /PageSize [ 612 792 ] /ImagingBBox null >> setpagedevice
-%%EndFeature
-%%IncludeResource: font Times-Roman
-%%IncludeResource: font Times-Bold
-%%IncludeResource: font Times-Italic
-grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72
-def/PL 792 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron/Zcaron
-/scaron/zcaron/Ydieresis/trademark/quotesingle/Euro/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/space/exclam/quotedbl/numbersign/dollar/percent
-/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen
-/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon
-/semicolon/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O
-/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright/circumflex
-/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y
-/z/braceleft/bar/braceright/tilde/.notdef/quotesinglbase/guillemotleft
-/guillemotright/bullet/florin/fraction/perthousand/dagger/daggerdbl
-/endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut
-/dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash
-/quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen
-/brokenbar/section/dieresis/copyright/ordfeminine/guilsinglleft
-/logicalnot/minus/registered/macron/degree/plusminus/twosuperior
-/threesuperior/acute/mu/paragraph/periodcentered/cedilla/onesuperior
-/ordmasculine/guilsinglright/onequarter/onehalf/threequarters
-/questiondown/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE
-/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex
-/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis
-/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn
-/germandbls/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla
-/egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis
-/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide/oslash
-/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis]def
-/Times-Italic at 0 ENC0/Times-Italic RE/Times-Bold at 0 ENC0/Times-Bold RE
-/Times-Roman at 0 ENC0/Times-Roman RE
-%%EndSetup
-%%Page: 1 1
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 135.39(mbhistogram\(1\) MB-System)72 48 R 135.39
-(5.0 mbhistogram\(1\))2.5 F/F1 10.95/Times-Bold at 0 SF -.219(NA)72 84 S
-(ME).219 E/F2 10/Times-Bold at 0 SF(mbhistogram)108 96 Q F0 2.995<ad47>
-2.995 G .495(enerate a histogram of bath)-2.995 F(ymetry)-.05 E 2.995
-(,a)-.65 G .495(mplitude, or sidescan v)-2.995 F .495(alues from sw)-.25
-F .495(ath sonar data)-.1 F(\214les.)108 108 Q F1(VERSION)72 136.8 Q F0
--1.11(Ve)108 148.8 S(rsion 5.0)1.11 E F1(SYNOPSIS)72 177.6 Q F2
-(mbhistogram)108 189.6 Q F0([)3.926 E F2<ad41>A/F3 10/Times-Italic at 0 SF
-(kind)A F2<ad42>3.926 E F3(yr/mo/da/hr/mn/sc)A F2 1.426<ad4320ad44>3.926
-F F3(min/max)A F2<ad45>3.926 E F3(yr/mo/da/hr/mn/sc)A F2<ad46>3.926 E F3
-(format)A F2 1.427<ad4720ad49>3.927 F F3(\214le-)A(name)108 201.6 Q F2
-<ad4c>2.5 E F3(lon\215ip)A F2<ad4d>2.5 E F3(nintervals)A F2<ad4e>2.5 E
-F3(nbins)A F2<ad50>2.5 E F3(ping)A F2<ad52>2.5 E F3
-(west/east/south/north)A F2<ad53>2.5 E F3(speed)A F2(\255V \255H])2.5 E
-F1(DESCRIPTION)72 230.4 Q F2(mbhistogram)108 242.4 Q F0 1.136
-(reads a sw)3.636 F 1.136
-(ath sonar data \214le and generates a histogram of the bath)-.1 F
-(ymetry)-.05 E 6.136(,a)-.65 G 3.636(mplitude, or)-6.136 F .382
-(sidescan v)108 254.4 R .382(alues. Alternati)-.25 F -.15(ve)-.25 G(ly)
-.15 E 2.882(,m)-.65 G .382(bhistogram can output a list of v)-2.882 F
-.382(alues which break up the distrib)-.25 F .382(ution into)-.2 F .57
-(equal sized re)108 266.4 R .57(gions. These v)-.15 F .57(alues can be \
-used to construct a color table, producing an image which is his-)-.25 F
-.732(togram equalized. If desired, the histogram can be recast into a G\
-aussian distrib)108 278.4 R .733(ution before output or the)-.2 F .581(\
-calculation of the histrogram equalization This feature is similar to t\
-he Gaussian option of)108 290.4 R F2(grdhisteq)3.08 E F0 3.08(.T)C(he)
--3.08 E 1.239(linear histogram equalization is most appropriate for use\
- with grayscale images, such as those produced)108 302.4 R .596
-(from amplitude or sidescan data, and is used by the macro)108 314.4 R
-F2(mbm_plot)3.095 E F0 .595(for that purpose. The Gaussian his-)3.095 F
-.129(togram equalization is well suited for shading of images, and is u\
-sed by)108 326.4 R F2(mbm_plot)2.63 E F0 .13(for shading of color ba-)
-2.63 F(th)108 338.4 Q(ymetry with amplitude data.)-.05 E
-(The results are dumped to stdout.)5 E F1 -.548(AU)72 367.2 S(THORSHIP)
-.548 E F0(Da)108 379.2 Q(vid W)-.2 E 2.5(.C)-.92 G
-(aress \(caress at mbari.or)-2.5 E(g\))-.18 E(Montere)113 391.2 Q 2.5(yB)
--.15 G(ay Aquarium Research Institute)-2.5 E
-(Dale N. Chayes \(dale at ldeo.columbia.edu\))108 403.2 Q
-(Lamont-Doherty Earth Observ)113 415.2 Q(atory)-.25 E F1(OPTIONS)72 444
-Q F2<ad41>108 456 Q F3(kind)23.08 E F0
-(Sets the kind of data to be processed, where)144 468 Q F3(kind)180 480
-Q F0 2.5(=0:h)2.5 G(istogram of bath)-2.5 E(ymetry data)-.05 E F3(kind)
-180 492 Q F0 2.5(=1:h)2.5 G(istogram of beam amplitude data)-2.5 E F3
-(kind)180 504 Q F0 2.5(=2:h)2.5 G(istogram of sidescan data Def)-2.5 E
-(ault:)-.1 E F3(kind)2.5 E F0 2.5(=2)2.5 G(.)-2.5 E F2<ad42>108 520.8 Q
-F3(yr/mo/da/hr/mn/sc)23.63 E F0 .155
-(This option sets the starting time for data allo)144 532.8 R .155
-(wed in the input data.)-.25 F(The)5.155 E F2<ad45>2.655 E F0 .155
-(option sets the ending)2.655 F .195
-(time for data. If the starting time is before the ending time, then an)
-144 544.8 R 2.695(yd)-.15 G .196(ata with a time stamp before)-2.695 F
-.444(the starting time or after the ending time is ignored. If instead \
-the starting time is after the ending)144 556.8 R .194(time, then an)144
-568.8 R 2.694(yd)-.15 G .194(ata between the ending and starting time w\
-ill be ignored. This scheme allo)-2.694 F .195(ws time)-.25 F(windo)144
-580.8 Q 5.376(wing both inside and outside a speci\214ed interv)-.25 F
-7.876(al. Def)-.25 F(ault:)-.1 E F3(yr/mo/da/hr/mn/sc)7.876 E F0(=)7.876
-E(1962/2/21/10/30/0.)144 592.8 Q F2<ad44>108 609.6 Q F3(min/max)23.08 E
-F0 .333(Speci\214es the minimum and maximum data v)144 621.6 R .333
-(alues used for constructing the histogram.)-.25 F .334(The width)5.333
-F .552(of the bins is determined by \()144 633.6 R F3(max)A F0<ad>3.052
-E F3(min)3.052 E F0 3.052(\)d)C -.25(iv)-3.052 G .552(ided by).25 F F3
-(nbins)3.052 E F0 .551(\(see the)3.051 F F2<ad4e>3.051 E F0 3.051
-(option\). The)3.051 F F3(min)3.051 E F0 -.25(va)3.051 G .551(lue is).25
-F .069(the center of the \214rst histogram bin, and the)144 645.6 R F3
-(max)2.569 E F0 -.25(va)2.569 G .069
-(lue is the center of the last histogram bin.).25 F(Data)5.069 E -.25
-(va)144 657.6 S(lues f).25 E
-(alling outside the range of the bins are ignored.)-.1 E F2<ad45>108
-674.4 Q F3(yr/mo/da/hr/mn/sc)23.63 E F0 .155
-(This option sets the ending time for data allo)144 686.4 R .155
-(wed in the input data.)-.25 F(The)5.155 E F2<ad42>2.655 E F0 .155
-(option sets the starting)2.655 F .195
-(time for data. If the starting time is before the ending time, then an)
-144 698.4 R 2.695(yd)-.15 G .196(ata with a time stamp before)-2.695 F
-.444(the starting time or after the ending time is ignored. If instead \
-the starting time is after the ending)144 710.4 R .194(time, then an)144
-722.4 R 2.694(yd)-.15 G .194(ata between the ending and starting time w\
-ill be ignored. This scheme allo)-2.694 F .195(ws time)-.25 F
-(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(1)204.835 E 0
-Cg EP
-%%Page: 2 2
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 135.39(mbhistogram\(1\) MB-System)72 48 R 135.39
-(5.0 mbhistogram\(1\))2.5 F(windo)144 84 Q 5.376
-(wing both inside and outside a speci\214ed interv)-.25 F 7.876(al. Def)
--.25 F(ault:)-.1 E/F1 10/Times-Italic at 0 SF(yr/mo/da/hr/mn/sc)7.876 E F0
-(=)7.876 E(2062/2/21/10/30/0.)144 96 Q/F2 10/Times-Bold at 0 SF<ad46>108
-112.8 Q F1(format)24.19 E F0 .22(Sets the data format used if the input\
- is read from stdin or from a \214le. If)144 124.8 R F1(format)2.72 E F0
-2.72(<0)2.72 G 2.72(,t)-2.72 G .22(hen the input)-2.72 F .008
-(\214le speci\214ed with the)144 136.8 R F2<ad49>2.508 E F0 .008
-(option will actually contain a list of input sw)2.508 F .007
-(ath sonar data \214les. This pro-)-.1 F .011(gram uses the)144 148.8 R
-F2(MBIO)2.511 E F0 .012(library and will read or write an)2.511 F 2.512
-(ys)-.15 G -.1(wa)-2.512 G .012(th sonar format supported by).1 F F2
-(MBIO)2.512 E F0 2.512(.A)C 1.297(list of the sw)144 160.8 R 1.297
-(ath sonar data formats currently supported by)-.1 F F2(MBIO)3.797 E F0
-1.296(and their identi\214er v)3.796 F 1.296(alues is)-.25 F(gi)144
-172.8 Q -.15(ve)-.25 G 2.5(ni).15 G 2.5(nt)-2.5 G(he)-2.5 E F2(MBIO)2.5
-E F0(manual page. Def)2.5 E(ault:)-.1 E F1(format)2.5 E F0 2.5(=1)2.5 G
-(1.)-2.5 E F2<ad47>108 189.6 Q F0(This option causes the data histogram\
- to be recast into a Gaussian distrib)22.52 E(ution.)-.2 E F2<ad49>108
-206.4 Q F1(\214lename)26.41 E F0 .467(Sets the input \214lename. If)144
-218.4 R F1(format)2.967 E F0 2.967(>0\()2.967 G .467(set with the)-2.967
-F F2<ad66>2.967 E F0 .467(option\) then the sw)2.967 F .468
-(ath sonar data contained)-.1 F(in)144 230.4 Q F1(in\214le)2.937 E F0
-.437(is read and processed. If)2.937 F F1(format)2.937 E F0 2.937(<0)
-2.937 G 2.937(,t)-2.937 G(hen)-2.937 E F1(in\214le)2.937 E F0 .437
-(is assumed to be an ascii \214le containing a)2.937 F .002
-(list of the input sw)144 242.4 R .003
-(ath sonar data \214les to be processed and their formats.)-.1 F .003
-(The program will read the)5.003 F .275
-(data in each one of these \214les.)144 254.4 R .275(In the)5.275 F F1
-(in\214le)2.775 E F0 .274(\214le, each data \214le should be follo)2.775
-F .274(wed by a data format)-.25 F(identi\214er)144 266.4 Q 2.5(,e)-.4 G
-(.g.:)-2.5 E(data\214le1 11)180 278.4 Q(data\214le2 24)180 290.4 Q .568
-(This program uses the)144 302.4 R F2(MBIO)3.068 E F0 .568
-(library and will read or write an)3.068 F 3.068(ys)-.15 G -.1(wa)-3.068
-G .568(th sonar format supported by).1 F F2(MBIO)144 314.4 Q F0 3.428
-(.Al)C .928(ist of the sw)-3.428 F .928
-(ath sonar data formats currently supported by)-.1 F F2(MBIO)3.428 E F0
-.928(and their identi\214er)3.428 F -.25(va)144 326.4 S(lues is gi).25 E
--.15(ve)-.25 G 2.5(ni).15 G 2.5(nt)-2.5 G(he)-2.5 E F2(MBIO)2.5 E F0
-(manual page. Def)2.5 E(ault:)-.1 E F1(in\214le)2.5 E F0 2.5(=")2.5 G
-(stdin".)-2.5 E F2<ad4c>108 343.2 Q F1(lon\215ip)23.63 E F0 .572
-(Sets the range of the longitude v)144 355.2 R .572(alues returned.)-.25
-F(If)5.572 E F1(lon\215ip)3.072 E F0 .572(=\2551 then the longitude v)B
-.572(alues will be in)-.25 F .489(the range from \255360 to 0 de)144
-367.2 R .488(grees. If)-.15 F F1(lon\215ip)2.988 E F0 .488
-(=0 then the longitude v)B .488(alues will be in the range from)-.25 F
-1.382(\255180 to 180 de)144 379.2 R 1.382(grees. If)-.15 F F1(lon\215ip)
-3.882 E F0 1.382(=1 then the longitude v)B 1.382
-(alues will be in the range from 0 to 360)-.25 F(de)144 391.2 Q 2.5
-(grees. Def)-.15 F(ault:)-.1 E F1(lon\215ip)2.5 E F0 2.5(=0)2.5 G(.)-2.5
-E F2<ad4d>108 408 Q F1(nintervals)20.86 E F0(If)144 420 Q F1(nintervals)
-3.176 E F0 3.176(>0t)3.176 G(hen)-3.176 E F2(mbhistogram)3.176 E F0 .676
-(will calculate and output a list of v)3.176 F .676
-(alues which break up the)-.25 F .814(data distrib)144 432 R .814
-(ution into equal sized re)-.2 F 3.314(gions. This)-.15 F .815
-(can be useful for constructing color tables which)3.314 F .919
-(accentuate features in amplitude and sidescan data \(the macro)144 444
-R F2(mbm_plot)3.418 E F0(mak)3.418 E .918(es use of this fea-)-.1 F
-(ture\). If this option is enabled, then the ra)144 456 Q 2.5(wh)-.15 G
-(istogram is not output.)-2.5 E F2<ad4e>108 472.8 Q F1(nbins)23.08 E F0
-(Sets the number of bins used to calculate the histogram.)144 484.8 Q F2
-<ad50>108 501.6 Q F1(pings)24.19 E F0 1.219(Sets the ping a)144 513.6 R
--.15(ve)-.2 G 1.219(raging of the input data. If).15 F F1(pings)3.719 E
-F0 3.72(=1)3.719 G 3.72(,t)-3.72 G 1.22(hen no ping a)-3.72 F -.15(ve)
--.2 G 1.22(raging is performed. If).15 F F1(pings)144 525.6 Q F0 2.652
-(>0)2.652 G 2.652(,t)-2.652 G .152
-(hen that number of input pings will be a)-2.652 F -.15(ve)-.2 G .151
-(raged to produce one output ping.).15 F(If)5.151 E F1(pings)2.651 E F0
-(=)2.651 E .313(0, then the ping a)144 537.6 R -.15(ve)-.2 G .313(ragin\
-g will automatically be done so that the along-track ping spacing is eq\
-ual).15 F(to the across-track beam spacing.)144 549.6 Q(Def)5 E(ault:)
--.1 E F1(pings)2.5 E F0 2.5(=1\()2.5 G(no ping a)-2.5 E -.15(ve)-.2 G
-(raging\).).15 E F2<ad52>108 566.4 Q F1(west/east/south/north)23.08 E F0
-.679(Sets the longitude and latitude bounds within which sw)144 578.4 R
-.679(ath sonar data will be read. Only the data)-.1 F .097
-(which lies within these bounds will be read.)144 590.4 R(Def)5.098 E
-(ault:)-.1 E F1(west)2.598 E F0 .098(=\255360, east)B F1(=360)A F0(,)A
-F1(south)2.598 E F0(=\25590,)A F1(north)2.598 E F0(=90.)A F2<ad53>108
-607.2 Q F1(speed)24.74 E F0 .532
-(Sets the minimum speed in km/hr \(5.5 kts ~ 10 km/hr\) allo)144 619.2 R
-.531(wed in the input data; pings associated)-.25 F
-(with a smaller ship speed will not be copied. Def)144 631.2 Q(ault:)-.1
-E F1(speed)2.5 E F0 2.5(=0)2.5 G(.)-2.5 E F2<ad54>108 648 Q F1(time)
-23.63 E(gap)-.4 E F0 .478(Sets the maximum time g)144 660 R .479
-(ap in minutes between adjacent pings allo)-.05 F .479
-(wed before the data is consid-)-.25 F(ered to ha)144 672 Q .3 -.15
-(ve a g)-.2 H(ap. Def).1 E(ault:)-.1 E F1(time)2.5 E(gap)-.4 E F0 2.5
-(=1)2.5 G(.)-2.5 E F2<ad56>108 688.8 Q F0(Normally)23.08 E(,)-.65 E F2
-(mbhistogram)2.51 E F0 .009
-(only prints out the statistics obtained by reading all of the data.)
-2.51 F .009(If the)5.009 F F2<ad56>2.509 E F0 .764(\215ag is gi)144
-700.8 R -.15(ve)-.25 G .764(n, then).15 F F2(MBCOPY)3.264 E F0 -.1(wo)
-3.264 G .764(rks in a "v).1 F .764
-(erbose" mode and outputs the program v)-.15 F .764(ersion being)-.15 F
-(used and all read error status messages.)144 712.8 Q(MB-System 5.0)72
-768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(2)204.835 E 0 Cg EP
-%%Page: 3 3
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 135.39(mbhistogram\(1\) MB-System)72 48 R 135.39
-(5.0 mbhistogram\(1\))2.5 F/F1 10/Times-Bold at 0 SF<ad48>108 84 Q F0 .162
-(This "help" \215ag cause the program to print out a description of its\
- operation and then e)22.52 F .161(xit immedi-)-.15 F(ately)144 96 Q(.)
--.65 E/F2 10.95/Times-Bold at 0 SF(EXAMPLES)72 124.8 Q F0 .328(Suppose one\
- wishes to obtain a histogram of the sidescan data in a \214le called m\
-be)108 136.8 R .329(xample.mb41 containing)-.15 F(ra)108 148.8 Q 2.5(wd)
--.15 G(ata from a SeaBeam 2112 sonar \(format 41\). The follo)-2.5 E
-(wing will suf)-.25 E(\214ce:)-.25 E
-(mbhistogram \255F41 \255I sb199411211212.rec \255D0.0/45000 \255N25)
-110.5 160.8 Q(to yield the follo)108 172.8 Q(wing histogram:)-.25 E
-(0.000000 183814)110.5 184.8 Q(1875.000000 30845)110.5 196.8 Q
-(3750.000000 5365)110.5 208.8 Q(5625.000000 1918)110.5 220.8 Q
-(7500.000000 951)110.5 232.8 Q(9375.000000 591)110.5 244.8 Q
-(11250.000000 403)110.5 256.8 Q(13125.000000 232)110.5 268.8 Q
-(15000.000000 189)110.5 280.8 Q(16875.000000 127)110.5 292.8 Q
-(18750.000000 108)110.5 304.8 Q(20625.000000 75)110.5 316.8 Q
-(22500.000000 85)110.5 328.8 Q(24375.000000 48)110.5 340.8 Q
-(26250.000000 30)110.5 352.8 Q(28125.000000 31)110.5 364.8 Q
-(30000.000000 28)110.5 376.8 Q(31875.000000 21)110.5 388.8 Q
-(33750.000000 10)110.5 400.8 Q(35625.000000 9)110.5 412.8 Q
-(37500.000000 4)110.5 424.8 Q(39375.000000 2)110.5 436.8 Q
-(41250.000000 2)110.5 448.8 Q(43125.000000 2)110.5 460.8 Q
-(45000.000000 1)110.5 472.8 Q(In order to obtain 16 v)108 484.8 Q
-(alues breaking up the distrib)-.25 E(ution into equal sized re)-.2 E
-(gions, use the)-.15 E F1<ad4d>2.5 E F0(option:)2.5 E(mbhistogram \255F\
-41 \255I sb199411211212.rec \255D0.0/45000 \255N45000 \255M25)110.5
-496.8 Q(gi)108 508.8 Q(ving:)-.25 E(\2550.500011)113 520.8 Q(110.657221)
-110.5 532.8 Q(137.446811)110.5 544.8 Q(165.916284)110.5 556.8 Q
-(199.635469)110.5 568.8 Q(239.900007)110.5 580.8 Q(287.726270)110.5
-592.8 Q(345.615610)110.5 604.8 Q(418.142114)110.5 616.8 Q(513.487776)
-110.5 628.8 Q(639.986551)110.5 640.8 Q(824.475879)110.5 652.8 Q
-(1140.372280)110.5 664.8 Q(1994.280032)110.5 676.8 Q(44803.495633)110.5
-688.8 Q(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(3)
-204.835 E 0 Cg EP
-%%Page: 4 4
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 135.39(mbhistogram\(1\) MB-System)72 48 R 135.39
-(5.0 mbhistogram\(1\))2.5 F/F1 10.95/Times-Bold at 0 SF(SEE ALSO)72 84 Q/F2
-10/Times-Bold at 0 SF(mbsystem)108 96 Q F0(\(1\),)A F2(mbm_plot)2.5 E F0
-(\(1\), grdhisteq\(1\))A F1 -.11(BU)72 124.8 S(GS).11 E F0 -1.1(Yo)108
-136.8 S 2.5<758c>1.1 G(nd em, we \214x 'em...)-2.5 E(MB-System 5.0)72
-768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(4)204.835 E 0 Cg EP
-%%Trailer
-end
-%%EOF
diff --git a/src/ps/mbhsdump.ps b/src/ps/mbhsdump.ps
deleted file mode 100644
index a6aa1a2..0000000
--- a/src/ps/mbhsdump.ps
+++ /dev/null
@@ -1,310 +0,0 @@
-%!PS-Adobe-3.0
-%%Creator: groff version 1.19.2
-%%CreationDate: Wed Jul  1 12:29:27 2015
-%%DocumentNeededResources: font Times-Roman
-%%+ font Times-Bold
-%%+ font Times-Italic
-%%DocumentSuppliedResources: procset grops 1.19 2
-%%Pages: 2
-%%PageOrder: Ascend
-%%DocumentMedia: Default 612 792 0 () ()
-%%Orientation: Portrait
-%%EndComments
-%%BeginDefaults
-%%PageMedia: Default
-%%EndDefaults
-%%BeginProlog
-%%BeginResource: procset grops 1.19 2
-%!PS-Adobe-3.0 Resource-ProcSet
-/setpacking where{
-pop
-currentpacking
-true setpacking
-}if
-/grops 120 dict dup begin
-/SC 32 def
-/A/show load def
-/B{0 SC 3 -1 roll widthshow}bind def
-/C{0 exch ashow}bind def
-/D{0 exch 0 SC 5 2 roll awidthshow}bind def
-/E{0 rmoveto show}bind def
-/F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def
-/G{0 rmoveto 0 exch ashow}bind def
-/H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/I{0 exch rmoveto show}bind def
-/J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def
-/K{0 exch rmoveto 0 exch ashow}bind def
-/L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/M{rmoveto show}bind def
-/N{rmoveto 0 SC 3 -1 roll widthshow}bind def
-/O{rmoveto 0 exch ashow}bind def
-/P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/Q{moveto show}bind def
-/R{moveto 0 SC 3 -1 roll widthshow}bind def
-/S{moveto 0 exch ashow}bind def
-/T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/SF{
-findfont exch
-[exch dup 0 exch 0 exch neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/MF{
-findfont
-[5 2 roll
-0 3 1 roll
-neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/level0 0 def
-/RES 0 def
-/PL 0 def
-/LS 0 def
-/MANUAL{
-statusdict begin/manualfeed true store end
-}bind def
-/PLG{
-gsave newpath clippath pathbbox grestore
-exch pop add exch pop
-}bind def
-/BP{
-/level0 save def
-1 setlinecap
-1 setlinejoin
-72 RES div dup scale
-LS{
-90 rotate
-}{
-0 PL translate
-}ifelse
-1 -1 scale
-}bind def
-/EP{
-level0 restore
-showpage
-}def
-/DA{
-newpath arcn stroke
-}bind def
-/SN{
-transform
-.25 sub exch .25 sub exch
-round .25 add exch round .25 add exch
-itransform
-}bind def
-/DL{
-SN
-moveto
-SN
-lineto stroke
-}bind def
-/DC{
-newpath 0 360 arc closepath
-}bind def
-/TM matrix def
-/DE{
-TM currentmatrix pop
-translate scale newpath 0 0 .5 0 360 arc closepath
-TM setmatrix
-}bind def
-/RC/rcurveto load def
-/RL/rlineto load def
-/ST/stroke load def
-/MT/moveto load def
-/CL/closepath load def
-/Fr{
-setrgbcolor fill
-}bind def
-/setcmykcolor where{
-pop
-/Fk{
-setcmykcolor fill
-}bind def
-}if
-/Fg{
-setgray fill
-}bind def
-/FL/fill load def
-/LW/setlinewidth load def
-/Cr/setrgbcolor load def
-/setcmykcolor where{
-pop
-/Ck/setcmykcolor load def
-}if
-/Cg/setgray load def
-/RE{
-findfont
-dup maxlength 1 index/FontName known not{1 add}if dict begin
-{
-1 index/FID ne{def}{pop pop}ifelse
-}forall
-/Encoding exch def
-dup/FontName exch def
-currentdict end definefont pop
-}bind def
-/DEFS 0 def
-/EBEGIN{
-moveto
-DEFS begin
-}bind def
-/EEND/end load def
-/CNT 0 def
-/level1 0 def
-/PBEGIN{
-/level1 save def
-translate
-div 3 1 roll div exch scale
-neg exch neg exch translate
-0 setgray
-0 setlinecap
-1 setlinewidth
-0 setlinejoin
-10 setmiterlimit
-[]0 setdash
-/setstrokeadjust where{
-pop
-false setstrokeadjust
-}if
-/setoverprint where{
-pop
-false setoverprint
-}if
-newpath
-/CNT countdictstack def
-userdict begin
-/showpage{}def
-/setpagedevice{}def
-}bind def
-/PEND{
-countdictstack CNT sub{end}repeat
-level1 restore
-}bind def
-end def
-/setpacking where{
-pop
-setpacking
-}if
-%%EndResource
-%%EndProlog
-%%BeginSetup
-%%BeginFeature: *PageSize Default
-<< /PageSize [ 612 792 ] /ImagingBBox null >> setpagedevice
-%%EndFeature
-%%IncludeResource: font Times-Roman
-%%IncludeResource: font Times-Bold
-%%IncludeResource: font Times-Italic
-grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72
-def/PL 792 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron/Zcaron
-/scaron/zcaron/Ydieresis/trademark/quotesingle/Euro/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/space/exclam/quotedbl/numbersign/dollar/percent
-/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen
-/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon
-/semicolon/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O
-/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright/circumflex
-/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y
-/z/braceleft/bar/braceright/tilde/.notdef/quotesinglbase/guillemotleft
-/guillemotright/bullet/florin/fraction/perthousand/dagger/daggerdbl
-/endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut
-/dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash
-/quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen
-/brokenbar/section/dieresis/copyright/ordfeminine/guilsinglleft
-/logicalnot/minus/registered/macron/degree/plusminus/twosuperior
-/threesuperior/acute/mu/paragraph/periodcentered/cedilla/onesuperior
-/ordmasculine/guilsinglright/onequarter/onehalf/threequarters
-/questiondown/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE
-/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex
-/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis
-/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn
-/germandbls/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla
-/egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis
-/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide/oslash
-/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis]def
-/Times-Italic at 0 ENC0/Times-Italic RE/Times-Bold at 0 ENC0/Times-Bold RE
-/Times-Roman at 0 ENC0/Times-Roman RE
-%%EndSetup
-%%Page: 1 1
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 143.72(mbhsdump\(1\) MB-System)72 48 R 143.72
-(5.0 mbhsdump\(1\))2.5 F/F1 10.95/Times-Bold at 0 SF -.219(NA)72 84 S(ME)
-.219 E/F2 10/Times-Bold at 0 SF(mbhsdump)108 96 Q F0 2.5<ad6c>2.5 G
-(ists the information contained in Hydrosweep DS data \214les.)-2.5 E F1
-(VERSION)72 124.8 Q F0 -1.11(Ve)108 136.8 S(rsion 5.0)1.11 E F1
-(SYNOPSIS)72 165.6 Q F2(mbhsdump)108 177.6 Q F0([)2.5 E F2<ad46>A/F3 10
-/Times-Italic at 0 SF(format)A F2<ad49>2.5 E F3(in\214le)A F2<ad4f>2.5 E F3
-(kind)A F2<ad5620ad48>2.5 E F3(])A F1(DESCRIPTION)72 206.4 Q F2
-(mbhsdump)108 218.4 Q F0 .371(lists the information contained in data r\
-ecords on Hydrosweep DS data \214les, including surv)2.872 F -.15(ey)
--.15 G(,)-.5 E .888(calibrate, w)108 230.4 R .888(ater v)-.1 F .889
-(elocity and comment records. The def)-.15 F .889
-(ault input stream is stdin. Prior to v)-.1 F .889(ersion 5.4 this)-.15
-F(program w)108 242.4 Q(as named hsdump.)-.1 E F1 -.548(AU)72 271.2 S
-(THORSHIP).548 E F0(Da)108 283.2 Q(vid W)-.2 E 2.5(.C)-.92 G
-(aress \(caress at mbari.or)-2.5 E(g\))-.18 E(Montere)113 295.2 Q 2.5(yB)
--.15 G(ay Aquarium Research Institute)-2.5 E
-(Dale N. Chayes \(dale at ldeo.columbia.edu\))108 307.2 Q
-(Lamont-Doherty Earth Observ)113 319.2 Q(atory)-.25 E F1(OPTIONS)72 348
-Q F2<ad46>108 360 Q F3(format)24.19 E F0 .716
-(Sets the format for the input and output sw)144 372 R .715
-(ath sonar data using)-.1 F F2(MBIO)3.215 E F0(inte)3.215 E .715
-(ger format identi\214ers.)-.15 F 1.204(This program is speci\214c to H\
-ydrosweep DS data, and cannot be used with data from an)144 384 R 3.705
-(yo)-.15 G(ther)-3.705 E(sw)144 396 Q 1.594(ath sonar system or with da\
-ta in a Hydrosweep format that does not include w)-.1 F 1.594(ater v)-.1
-F(elocity)-.15 E .151(records. Currently)144 408 R 2.651(,t)-.65 G .151
-(he tw)-2.651 F 2.651(of)-.1 G .151(ormats which can be used are the ra)
--2.651 F 2.652(wH)-.15 G .152(ydrosweep DS format \()-2.652 F F2(MBIO)A
-F0(id 21\) and the L-DEO in-house binary Hydrosweep format \()144 420 Q
-F2(MBIO)A F0(id 24\).)2.5 E(Def)5 E(ault:)-.1 E F3(format)2.5 E F0 2.5
-(=5)2.5 G(.)-2.5 E F2<ad48>108 436.8 Q F0 .391(This "help" \215ag cause\
-s the program to print out a description of its operation and then e)
-22.52 F .39(xit imme-)-.15 F(diately)144 448.8 Q(.)-.65 E F2<ad49>108
-465.6 Q F3(in\214le)26.41 E F0 .33(Data \214le from which the input dat\
-a will be read. If no input \214le is speci\214ed, the input will be re\
-ad)144 477.6 R(from stdin. Def)144 489.6 Q(ault:)-.1 E F3(in\214le)2.5 E
-F0 2.5(=s)2.5 G(tdin.)-2.5 E F2<ad4f>108 506.4 Q F3(kind)22.52 E F0(Set\
-s the kind of data record which will be listed, where the choices for k\
-ind include:)144 518.4 Q 25.72(1: Surv)180 530.4 R .3 -.15(ey d)-.15 H
-(ata record).15 E 25.72(2: Comment)180 542.4 R(record)2.5 E 25.72
-(3: Calibrate)180 554.4 R(data record)2.5 E 25.72(4: Mean)180 566.4 R
--.15(ve)2.5 G(locity data record).15 E 25.72(5: V)180 578.4 R
-(elocity pro\214le data record)-1.11 E 25.72(6: Standby)180 590.4 R
-(data record)2.5 E 25.72(7: Na)180 602.4 R(vig)-.2 E
-(ation source data record)-.05 E(This option can be gi)144 614.4 Q -.15
-(ve)-.25 G 2.5(nm).15 G
-(ultiple times to set more than one kind of data record for listing.)
--2.5 E F2<ad56>108 631.2 Q F0(Normally)23.08 E(,)-.65 E F2(mbhsdump)
-3.047 E F0 .547(lists only the contents of the data records which are s\
-peci\214ed with the)3.047 F F2<ad4f>3.046 E F0 3.024(option. If)144
-643.2 R(the)3.024 E F2<ad56>3.024 E F0 .524(\215ag is gi)3.024 F -.15
-(ve)-.25 G .525(n, then).15 F F2(mbhsdump)3.025 E F0 -.1(wo)3.025 G .525
-(rks in a "v).1 F .525(erbose" mode and outputs the pro-)-.15 F .222
-(gram v)144 655.2 R .222(ersion being used, an)-.15 F 2.722(yc)-.15 G
-.222
-(omment records encountered in the data stream, and all error status)
--2.722 F(messages.)144 667.2 Q F1(EXAMPLES)72 696 Q F0 .292
-(Suppose one wishes to list out the w)108 708 R .292(ater v)-.1 F .292
-(elocity records contained in the ra)-.15 F 2.793(wH)-.15 G .293
-(ydrosweep \(format 21\) \214le)-2.793 F(hsra)108 720 Q 3.8 -.65(w. T)
--.15 H(he follo).65 E(wing will suf)-.25 E(\214ce:)-.25 E(MB-System 5.0)
-72 768 Q 2.5(7J)146.495 G(une 2013)-2.5 E(1)204.835 E 0 Cg EP
-%%Page: 2 2
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 143.72(mbhsdump\(1\) MB-System)72 48 R 143.72
-(5.0 mbhsdump\(1\))2.5 F(mbhsdump \255F21 \255O4 \255O5 \255Ihsra)144 84
-Q(w)-.15 E/F1 10.95/Times-Bold at 0 SF(SEE ALSO)72 112.8 Q/F2 10
-/Times-Bold at 0 SF(mbsystem)108 124.8 Q F0(\(1\),)A F2(mbinf)2.5 E(o)-.25
-E F0(\(1\),)A F2(mblist)2.5 E F0(\(1\))A F1 -.11(BU)72 153.6 S(GS).11 E
-F0(Other than the name change, this program hasn')108 165.6 Q 2.5(tb)
--.18 G(een altered in this century)-2.5 E 5(.I)-.65 G 2.5(ti)-5 G 2.5
-(sp)-2.5 G(robably stale.)-2.5 E(MB-System 5.0)72 768 Q 2.5(7J)146.495 G
-(une 2013)-2.5 E(2)204.835 E 0 Cg EP
-%%Trailer
-end
-%%EOF
diff --git a/src/ps/mbhysweeppreprocess.ps b/src/ps/mbhysweeppreprocess.ps
deleted file mode 100644
index 165ef4c..0000000
--- a/src/ps/mbhysweeppreprocess.ps
+++ /dev/null
@@ -1,573 +0,0 @@
-%!PS-Adobe-3.0
-%%Creator: groff version 1.19.2
-%%CreationDate: Wed Jul  1 12:29:27 2015
-%%DocumentNeededResources: font Times-Roman
-%%+ font Times-Bold
-%%+ font Times-Italic
-%%DocumentSuppliedResources: procset grops 1.19 2
-%%Pages: 5
-%%PageOrder: Ascend
-%%DocumentMedia: Default 612 792 0 () ()
-%%Orientation: Portrait
-%%EndComments
-%%BeginDefaults
-%%PageMedia: Default
-%%EndDefaults
-%%BeginProlog
-%%BeginResource: procset grops 1.19 2
-%!PS-Adobe-3.0 Resource-ProcSet
-/setpacking where{
-pop
-currentpacking
-true setpacking
-}if
-/grops 120 dict dup begin
-/SC 32 def
-/A/show load def
-/B{0 SC 3 -1 roll widthshow}bind def
-/C{0 exch ashow}bind def
-/D{0 exch 0 SC 5 2 roll awidthshow}bind def
-/E{0 rmoveto show}bind def
-/F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def
-/G{0 rmoveto 0 exch ashow}bind def
-/H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/I{0 exch rmoveto show}bind def
-/J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def
-/K{0 exch rmoveto 0 exch ashow}bind def
-/L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/M{rmoveto show}bind def
-/N{rmoveto 0 SC 3 -1 roll widthshow}bind def
-/O{rmoveto 0 exch ashow}bind def
-/P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/Q{moveto show}bind def
-/R{moveto 0 SC 3 -1 roll widthshow}bind def
-/S{moveto 0 exch ashow}bind def
-/T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/SF{
-findfont exch
-[exch dup 0 exch 0 exch neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/MF{
-findfont
-[5 2 roll
-0 3 1 roll
-neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/level0 0 def
-/RES 0 def
-/PL 0 def
-/LS 0 def
-/MANUAL{
-statusdict begin/manualfeed true store end
-}bind def
-/PLG{
-gsave newpath clippath pathbbox grestore
-exch pop add exch pop
-}bind def
-/BP{
-/level0 save def
-1 setlinecap
-1 setlinejoin
-72 RES div dup scale
-LS{
-90 rotate
-}{
-0 PL translate
-}ifelse
-1 -1 scale
-}bind def
-/EP{
-level0 restore
-showpage
-}def
-/DA{
-newpath arcn stroke
-}bind def
-/SN{
-transform
-.25 sub exch .25 sub exch
-round .25 add exch round .25 add exch
-itransform
-}bind def
-/DL{
-SN
-moveto
-SN
-lineto stroke
-}bind def
-/DC{
-newpath 0 360 arc closepath
-}bind def
-/TM matrix def
-/DE{
-TM currentmatrix pop
-translate scale newpath 0 0 .5 0 360 arc closepath
-TM setmatrix
-}bind def
-/RC/rcurveto load def
-/RL/rlineto load def
-/ST/stroke load def
-/MT/moveto load def
-/CL/closepath load def
-/Fr{
-setrgbcolor fill
-}bind def
-/setcmykcolor where{
-pop
-/Fk{
-setcmykcolor fill
-}bind def
-}if
-/Fg{
-setgray fill
-}bind def
-/FL/fill load def
-/LW/setlinewidth load def
-/Cr/setrgbcolor load def
-/setcmykcolor where{
-pop
-/Ck/setcmykcolor load def
-}if
-/Cg/setgray load def
-/RE{
-findfont
-dup maxlength 1 index/FontName known not{1 add}if dict begin
-{
-1 index/FID ne{def}{pop pop}ifelse
-}forall
-/Encoding exch def
-dup/FontName exch def
-currentdict end definefont pop
-}bind def
-/DEFS 0 def
-/EBEGIN{
-moveto
-DEFS begin
-}bind def
-/EEND/end load def
-/CNT 0 def
-/level1 0 def
-/PBEGIN{
-/level1 save def
-translate
-div 3 1 roll div exch scale
-neg exch neg exch translate
-0 setgray
-0 setlinecap
-1 setlinewidth
-0 setlinejoin
-10 setmiterlimit
-[]0 setdash
-/setstrokeadjust where{
-pop
-false setstrokeadjust
-}if
-/setoverprint where{
-pop
-false setoverprint
-}if
-newpath
-/CNT countdictstack def
-userdict begin
-/showpage{}def
-/setpagedevice{}def
-}bind def
-/PEND{
-countdictstack CNT sub{end}repeat
-level1 restore
-}bind def
-end def
-/setpacking where{
-pop
-setpacking
-}if
-%%EndResource
-%%EndProlog
-%%BeginSetup
-%%BeginFeature: *PageSize Default
-<< /PageSize [ 612 792 ] /ImagingBBox null >> setpagedevice
-%%EndFeature
-%%IncludeResource: font Times-Roman
-%%IncludeResource: font Times-Bold
-%%IncludeResource: font Times-Italic
-grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72
-def/PL 792 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron/Zcaron
-/scaron/zcaron/Ydieresis/trademark/quotesingle/Euro/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/space/exclam/quotedbl/numbersign/dollar/percent
-/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen
-/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon
-/semicolon/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O
-/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright/circumflex
-/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y
-/z/braceleft/bar/braceright/tilde/.notdef/quotesinglbase/guillemotleft
-/guillemotright/bullet/florin/fraction/perthousand/dagger/daggerdbl
-/endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut
-/dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash
-/quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen
-/brokenbar/section/dieresis/copyright/ordfeminine/guilsinglleft
-/logicalnot/minus/registered/macron/degree/plusminus/twosuperior
-/threesuperior/acute/mu/paragraph/periodcentered/cedilla/onesuperior
-/ordmasculine/guilsinglright/onequarter/onehalf/threequarters
-/questiondown/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE
-/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex
-/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis
-/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn
-/germandbls/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla
-/egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis
-/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide/oslash
-/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis]def
-/Times-Italic at 0 ENC0/Times-Italic RE/Times-Bold at 0 ENC0/Times-Bold RE
-/Times-Roman at 0 ENC0/Times-Roman RE
-%%EndSetup
-%%Page: 1 1
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mbh)72 48 Q 97.69
-(ysweeppreprocess\(1\) MB-System)-.05 F 97.69(5.0 mbh)2.5 F
-(ysweeppreprocess\(1\))-.05 E/F1 10.95/Times-Bold at 0 SF -.219(NA)72 84 S
-(ME).219 E/F2 10/Times-Bold at 0 SF(mbh)108 96 Q(ysweeppr)-.15 E(epr)-.18 E
-(ocess)-.18 E F0 3.032<ad70>3.032 G .532
-(erforms preprocessing of multibeam data in the Hysweep HSX format \()
--3.032 F F2(MBIO)A F0(format 201\).)108 108 Q F1(VERSION)72 136.8 Q F0
--1.11(Ve)108 148.8 S(rsion 5.0)1.11 E F1(SYNOPSIS)72 177.6 Q F2(mbh)108
-189.6 Q(ysweeppr)-.15 E(epr)-.18 E(ocess)-.18 E F0([)2.99 E F2<ad41>A/F3
-10/Times-Italic at 0 SF(of)A(fsettype/x/y/z/t)-.18 E F2<ad42>2.99 E F3 -.45
-(ro)C(llbias/pitc).45 E(hbias/headingbias)-.15 E F2<ad44>2.99 E F3
-(sonar)A(depth\214le)-.37 E F2<ad49>2.99 E F3(datalist)A F2<ad4a>108
-201.6 Q F3(pr)A(ojection)-.45 E F2<ad4c20ad4d>5 E F3(navformat)A F2
-<ad4e>2.5 E F3(nav\214le)A F2<ad54>2.5 E F3(timela)A(g)-.1 E F2
-<ad4820ad56>2.5 E F0(])A F1(DESCRIPTION)72 230.4 Q F2(mbh)108 242.4 Q
-(ysweeppr)-.15 E(epr)-.18 E(ocess)-.18 E F0 .611(reads a Hysweep HSX \(\
-format 201\) \214le, interpolates the asynchronous na)3.111 F(vig)-.2 E
-(ation)-.05 E .404
-(and attitude onto the multibeam data, and writes a ne)108 254.4 R 2.904
-(wH)-.25 G .405(SX \214le with that information correctly embedded)
--2.904 F .439(in the multibeam data. The user must specify a projection\
- for the easting-northing na)108 266.4 R(vig)-.2 E .438
-(ation used in HSX)-.05 F .428(\214les. This program can also \214x v)
-108 278.4 R .428(arious problems with multibeam data, and allo)-.25 F
-.428(ws for le)-.25 F -.15(ve)-.25 G 2.929(ra).15 G .429(rm correction)
--2.929 F 1.178(of of)108 290.4 R 1.178(fsets between the sonar)-.25 F
-3.678(,t)-.4 G 1.178(he motion sensor)-3.678 F 3.678(,a)-.4 G 1.178
-(nd the positioning sensor \(pro)-3.678 F 1.178(vided the na)-.15 F(vig)
--.2 E 1.178(ation and)-.05 F
-(attitude data included in the HSX \214le are uncorrected for sensor of)
-108 302.4 Q(fsets\)..)-.25 E F1 -.548(AU)72 331.2 S(THORSHIP).548 E F0
-(Da)108 343.2 Q(vid W)-.2 E 2.5(.C)-.92 G(aress \(caress at mbari.or)-2.5 E
-(g\))-.18 E(Montere)113 355.2 Q 2.5(yB)-.15 G
-(ay Aquarium Research Institute)-2.5 E
-(Dale N. Chayes \(dale at ldeo.columbia.edu\))108 367.2 Q
-(Lamont-Doherty Earth Observ)113 379.2 Q(atory)-.25 E F1(OPTIONS)72 408
-Q F2<ad41>108 420 Q F3(type/of)23.08 E(fsetx/of)-.18 E(fsety/of)-.18 E
-(fsetz/of)-.18 E(fsett)-.18 E F0 .544
-(This option sets the spatial and time of)144 432 R .544
-(fset for a sensor relati)-.25 F .845 -.15(ve t)-.25 H 3.045(oar).15 G
-.545(eference point on the surv)-3.045 F -.15(ey)-.15 G .628
-(platform \(by con)144 444 R -.15(ve)-.4 G .628
-(ntion usually close to the center of mass and rotation\).).15 F(If)
-5.627 E F3(type)3.127 E F0 3.127(=1)3.127 G 3.127(,t)-3.127 G .627
-(he of)-3.127 F(fsets)-.25 E .168(pertain to the surv)144 456 R .468
--.15(ey s)-.15 H(onar).15 E 2.668(.I)-.55 G(f)-2.668 E F3(type)2.668 E
-F0 2.668(=2)2.668 G 2.668(,t)-2.668 G .168(he of)-2.668 F .169
-(fsets pertain to the source of the attitude data, usually)-.25 F .025
-(an MR)144 468 R 2.525(Uo)-.4 G 2.525(rI)-2.525 G .025(NS. If)-2.525 F
-F3(type)2.525 E F0 2.525(=3)2.525 G 2.525(,t)-2.525 G .025(he of)-2.525
-F .024(fsets pertain to the source of the position or na)-.25 F(vig)-.2
-E .024(ation data. The)-.05 F .145(time of)144 480 R .146
-(fsets are referenced ag)-.25 F .146
-(ainst the sonar data, thus the sonar time of)-.05 F .146
-(fset will usually be zero. If)-.25 F(an)144 492 Q 3.837(yo)-.15 G 3.837
-(ft)-3.837 G 1.337(hese of)-3.837 F 1.337(fsets are de\214ned, then)-.25
-F F2(mbh)3.837 E(ysweeppr)-.15 E(epr)-.18 E(ocess)-.18 E F0 1.337
-(will use le)3.837 F -.15(ve)-.25 G 3.837(ra).15 G 1.337
-(rm calculations to)-3.837 F .344(determine the x, y)144 504 R 2.844(,a)
--.65 G .344(nd z of)-2.844 F .345(fsets associated with the platform at\
-titude for each ping, and add those)-.25 F(to the sonar na)144 516 Q
-(vig)-.2 E(ation and depth v)-.05 E(alues.)-.25 E F2<ad42>108 532.8 Q F3
--.45(ro)23.63 G(llbias/pitc).45 E(hbias/headingbias)-.15 E F0 .578
-(This option sets roll, pitch, and heading bias v)144 544.8 R .578
-(alues to be applied before mer)-.25 F .578(ging the attitude and)-.18 F
-(heading data with the sonar data while calculating bath)144 556.8 Q
-(ymetry)-.05 E(.)-.65 E F2<ad44>108 573.6 Q F3(sonar)23.08 E
-(depth\214le)-.37 E F0 .151(This option causes)144 585.6 R F2(mbh)2.651
-E(ysweeppr)-.15 E(epr)-.18 E(ocess)-.18 E F0 .152
-(to read a sonar depth time series from the speci\214ed \214le)2.651 F
-1.103(and use that data in place of an)144 597.6 R 3.602(ys)-.15 G 1.102
-(onar depth \(DFT\) records present in the HSX \214le. The sonar)-3.602
-F(depth data must be in an ascii format of the form:)144 609.6 Q
-(yyyy:mm:dd:hh:mm:ss.sss zzzz.zzz)154 621.6 Q 1.36(where yyyy=year)144
-633.6 R 3.861(,m)-.4 G 1.361(m=month, dd=day)-3.861 F 3.861(,h)-.65 G
-(h=hour)-3.861 E 3.861(,m)-.4 G 1.361
-(m=minute, ss.sss = seconds, and zzzz.zzz =)-3.861 F
-(sonar depth in meters.)144 645.6 Q F2<ad46>108 662.4 Q F3(format)24.19
-E F0 .737(Sets the format of the input \214le speci\214ed with the)144
-674.4 R F2<ad49>3.236 E F0 .736
-(option. This is normally omitted unless the)3.236 F .083
-(input \214lename does not conform to the)144 686.4 R F2(MB-System)2.584
-E F0 .084(\214le naming con)2.584 F -.15(ve)-.4 G .084(ntions. F).15 F
-.084(or this program, the)-.15 F .624(only rele)144 698.4 R -.25(va)-.25
-G .624(nt options are).25 F F3(format)3.124 E F0 3.124(=2)3.124 G .624
-(01 for an HSX format \214le, or)-3.124 F F3(format)3.124 E F0 3.124
-<3dad>C 3.124(1f)-3.124 G .623(or a datalist refer)-3.124 F(-)-.2 E
-(encing multiple format 201 \214les.)144 710.4 Q(MB-System 5.0)72 768 Q
-2.5(3J)146.495 G(une 2013)-2.5 E(1)204.835 E 0 Cg EP
-%%Page: 2 2
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mbh)72 48 Q 97.69
-(ysweeppreprocess\(1\) MB-System)-.05 F 97.69(5.0 mbh)2.5 F
-(ysweeppreprocess\(1\))-.05 E/F1 10/Times-Bold at 0 SF<ad48>108 84 Q F0
-.162(This "help" \215ag cause the program to print out a description of\
- its operation and then e)22.52 F .162(xit immedi-)-.15 F(ately)144 96 Q
-(.)-.65 E F1<ad49>108 112.8 Q/F2 10/Times-Italic at 0 SF(in\214le)26.41 E
-F0 .515(Sets the input \214le path. If)144 124.8 R F2(format)3.015 E F0
-3.015(>0\()3.015 G .515(set with the)-3.015 F F1<ad66>3.015 E F0 .515
-(option or)3.015 F F1(mbdefaults)3.014 E F0 3.014(\)t)C .514(hen the sw)
--3.014 F .514(ath sonar)-.1 F .796(data contained in)144 136.8 R F2
-(in\214le)3.296 E F0 .797(is read and processed. If)3.297 F F2(format)
-3.297 E F0 3.297(<0)3.297 G 3.297(,t)-3.297 G(hen)-3.297 E F2(in\214le)
-3.297 E F0 .797(is assumed to be an ascii)3.297 F .157
-(\214le containing a list of the input sw)144 148.8 R .157
-(ath sonar data \214les to be processed and their formats.)-.1 F .156
-(The pro-)5.156 F .928
-(gram will read the data in each one of these \214les.)144 160.8 R .929
-(In the)5.929 F F2(in\214le)3.429 E F0 .929
-(\214le, each data \214le should be fol-)3.429 F(lo)144 172.8 Q
-(wed by a data format identi\214er)-.25 E 2.5(,e)-.4 G(.g.:)-2.5 E
-(data\214le1 201)154 184.8 Q(data\214le2 201)154 196.8 Q
-(This program only reads Hysweep HSX format data \214les \()144 208.8 Q
-F1(MBIO)A F0(format 201\).)2.5 E F1<ad4a>108 225.6 Q F2(pr)25.3 E
-(ojection)-.45 E F0 .74(The Hypack and Hysweep softw)144 237.6 R .74
-(are packages operate with na)-.1 F(vig)-.2 E .74(ation in a user)-.05 F
-.74(-de\214ned projected)-.2 F .788(coordinate system. Resultantly)144
-249.6 R 3.288(,H)-.65 G .788
-(SX format \214les contain positions in a projected coordinate sys-)
--3.288 F .677(tem rather than longitude and latitude in geographic coor\
-dinates. Generally)144 261.6 R 3.177(,t)-.65 G .677
-(he HSX \214les do not)-3.177 F .893(contain an)144 273.6 R 3.393(yd)
--.15 G .893(escription of the projection used to obtain the eastings an\
-d northings in those \214les.)-3.393 F 1.326(This option allo)144 285.6
-R 1.326(ws a user to speci\214y the projection used to translate the ea\
-stings and northings)-.25 F .753
-(back into longitude and latitude. If this option is not speci\214ed,)
-144 297.6 R F1(MB-System)3.254 E F0 .754(will assume the data)3.254 F
-.589(are associated with UTM zone 1 north. The projection identi\214er \
-must conform to the same usage)144 309.6 R .046
-(as with projections speci\214ed for)144 321.6 R F1(mbgrid)2.546 E F0
-5.046(.F)C 2.546(or instance,)-5.196 F .047
-(to fully specify a particular northern UTM)2.546 F .687
-(zone, set projection = UTMXXN where XX gi)144 333.6 R -.15(ve)-.25 G
-3.187(st).15 G .686(he UTM zone \(de\214ned from 01 to 60\). As an)
--3.187 F -.15(ex)144 345.6 S .343(ample, a northern UTM zone 12 project\
-ion can be speci\214ed using \255JUTM12N.).15 F .344(Southern UTM)5.343
-F 1.003(zones are speci\214ed as UTMXXS. The European Petroleum Surv)144
-357.6 R 1.303 -.15(ey G)-.15 H 1.003(roup \(EPSG\) has de\214ned a).15 F
-(lar)144 369.6 Q .222(ge number of PCS')-.18 F 2.722(su)-.55 G .222
-(sed w)-2.722 F .222(orldwide and assigned number id')-.1 F 2.723(st)
--.55 G 2.723(oe)-2.723 G .223(ach; one can also specify the)-2.723 F
-.435(northern UTM zone 12 projection using its EPSG designation, or \
-\255Jepsg32612. The complete list)144 381.6 R
-(of projected coordinate systems supported by)144 393.6 Q F1(MB-System)
-2.5 E F0(is gi)2.5 E -.15(ve)-.25 G 2.5(ni).15 G 2.5(nt)-2.5 G(he)-2.5 E
-F1(mbgrid)2.5 E F0(manual page.)2.5 E F1<ad4c>108 410.4 Q F0 .836
-(This option causes the program to list the timetags of bath)144 422.4 R
-(ymetry)-.05 E 3.336(,n)-.65 G -.2(av)-3.336 G(ig).2 E .836
-(ation, attitude, and other)-.05 F(data records.)144 434.4 Q F1<ad4d>108
-451.2 Q F2(navformat)20.86 E F0(Sets the input na)144 463.2 Q(vig)-.2 E
-(ation \214le format used by the \214le speci\214ed with the)-.05 E F1
-<ad4e>2.5 E F0(option.)2.5 E(At present, the only option for the na)
-146.5 475.2 Q(vig)-.2 E(ation \214le format is)-.05 E F2(navformat)2.5 E
-F0(=1:)A(yyyy:mm:dd:hh:mm:ss.sss sssss.sss eeeeeeee.eee nnnnnnnn.nnn zz\
-zz.zzz aaa.aaa hhh.hhh)154 487.2 Q 1.207(where yyyy=year)144 499.2 R
-3.707(,m)-.4 G 1.207(m=month, dd=day)-3.707 F 3.707(,h)-.65 G(h=hour)
--3.707 E 3.706(,m)-.4 G 1.206
-(m=minute, ss.sss = seconds, sssss.sss = sec-)-3.706 F 1.254
-(onds from the start of the year)144 511.2 R 3.754(,e)-.4 G 1.254
-(eeeeeee.eee = easting in meters, nnnnnnnnn.nnn = northing in)-3.754 F
-1.606
-(meters, zzzz.zzz = sonar depth in meters, and hhh.hhh = heading in de)
-144 523.2 R 4.105(grees. Def)-.15 F(ault:)-.1 E F2(navfor)4.105 E(-)-.2
-E(mat)144 535.2 Q F0(=1.)A F1<ad4e>108 552 Q F2(nav\214le)23.08 E F0
-.895(The program will read na)144 564 R(vig)-.2 E .895
-(ation from the \214le)-.05 F F2(nav\214le)3.395 E F0 .895(and mer)3.395
-F .896(ge those data with the multibeam)-.18 F .286
-(data in the HSX \214le.)144 576 R .286
-(If a timelag model is speci\214ed using)5.286 F F1<ad54>2.785 E F2
-(timela)A(g)-.1 E F0 2.785(,t)C .285(he time lag will be applied)-2.785
-F .264(to the na)144 588 R(vig)-.2 E .264
-(ation and attitude data before mer)-.05 F .264
-(ging with the sonar data. The na)-.18 F(vig)-.2 E .264
-(ation and attitude)-.05 F 1.164(data from)144 600 R F2(nav\214le)3.664
-E F0 1.163(will also be embedded in asynchronous data records in the ou\
-tput format 201)3.664 F .078(data. An)144 612 R 2.578(yp)-.15 G(re-e)
--2.578 E .078(xisting na)-.15 F(vig)-.2 E .079
-(ation data records will remain unchanged in the data stream. Ho)-.05 F
-(we)-.25 E -.15(ve)-.25 G -.4(r,).15 G .604
-(the HSX \214le header will be altered to sho)144 624 R 3.104(wt)-.25 G
-.603(he ne)-3.104 F .603(wly mer)-.25 F .603
-(ged data as "enabled" and the original,)-.18 F
-(asynchronous data as not enabled.)144 636 Q F1<ad54>108 652.8 Q F2
-(timela)23.63 E(g)-.1 E F0 .831(This option speci\214es a)144 664.8 R F2
-(timela)3.331 E(g)-.1 E F0 -.25(va)3.331 G .831
-(lue in seconds to be applied to the na).25 F(vig)-.2 E .832
-(ation and attitude data)-.05 F 1.067(prior to it being mer)144 676.8 R
-1.067(ged with the bath)-.18 F(ymetry)-.05 E 3.567(.I)-.65 G(f)-3.567 E
-F2(timela)3.567 E(g)-.1 E F0 1.067(is a v)3.567 F 1.066
-(alid path to a \214le containing time)-.25 F .137(stamp and time lag p\
-airs, then these data will be read and the time lag applied to particul\
-ar records)144 688.8 R(will be interpolated by time.)144 700.8 Q F1
-<ad56>108 717.6 Q F0 .129(This option increases the v)23.08 F .129
-(erbosity of)-.15 F F1(mbh)2.629 E(ysweeppr)-.15 E(epr)-.18 E(ocess)-.18
-E F0 .129(with respect to informational output)2.629 F(to the shell.)144
-729.6 Q(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(2)
-204.835 E 0 Cg EP
-%%Page: 3 3
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mbh)72 48 Q 97.69
-(ysweeppreprocess\(1\) MB-System)-.05 F 97.69(5.0 mbh)2.5 F
-(ysweeppreprocess\(1\))-.05 E/F1 10.95/Times-Bold at 0 SF(EXAMPLES)72 84 Q
-F0 .916(Suppose that one has logged a set of \214v)108 96 R 3.416(eH)
--.15 G .916(SX \214les incorporating multibeam sonar data, na)-3.416 F
-(vig)-.2 E .917(ation, atti-)-.05 F .222
-(tude, heading, and altitude data, b)108 108 R .222
-(ut not sonar depth data, all from an R)-.2 F 1.221 -.5(OV p)-.4 H .221
-(latform. Further suppose that a).5 F .402(datalist \214le named datali\
-st_hsx.mb-1 references those \214les, and that a separate te)108 120 R
-.402(xt \214le named)-.15 F -.4(RO)5.403 G(Vna)-.1 E -.65(v.)-.2 G(txt)
-.65 E .63(includes an impro)108 132 R -.15(ve)-.15 G 3.13(dv).15 G .63
-(ehicle na)-3.28 F(vig)-.2 E .629
-(ation, including the sonar depth. Finally)-.05 F 3.129(,s)-.65 G .629
-(uppose that the e)-3.129 F .629(xisting sen-)-.15 F(sor of)108 144 Q
-(fsets are kno)-.25 E(wn, b)-.25 E(ut ha)-.2 E .3 -.15(ve n)-.2 H
-(ot been applied to an).15 E 2.5(yo)-.15 G 2.5(ft)-2.5 G(he e)-2.5 E
-(xisting data)-.15 E .907(In order to mer)108 156 R .907
-(ge the better na)-.18 F(vig)-.2 E .908
-(ation and sonar depth before starting MB-System processing, do some-)
--.05 F(thing lik)108 168 Q(e:)-.1 E(mbh)118 180 Q 37.117
-(ysweeppreprocess \255I datalist_hsx.mb-1)-.05 F
-(\255A1/0.42/2.005/-1.34/0.0)69.616 E 30
-(\255A2/0.46/0.22/0.55/0.0 \255A3/0.46/0.22/0.55/0.0 \255JUTM01N)108 192
-R(\255NR)2.5 E -.5(OV)-.4 G(na).5 E -.65(v.)-.2 G(txt).65 E
-(The program will output something lik)108 204 Q 2.5(et)-.1 G(he follo)
--2.5 E(wing:)-.25 E(Data a)118 216 Q -.25(va)-.2 G(ilable for mer).25 E
-(ging:)-.18 E(Na)128 228 Q(vig)-.2 E
-(ation \(northing easting sonardepth altitude heading\): 120959)-.05 E
-(Sonar depth \(sonardepth\):)128 240 Q(0)85 E -.35(Ti)128 252 S(me lag:)
-.35 E(0)125 E(Of)118 276 Q(fsets to be applied:)-.25 E 2.5(X\()135.5 288
-S 5(m\) Y)-2.5 F 5(\(m\) Z)2.5 F 5(\(m\) T)2.5 F(\(sec\))2.5 E
-(Roll bias:)130.5 300 Q(0.000)17.5 E(Pitch bias:)130.5 312 Q(0.000)15 E
-(Heading bias:)130.5 324 Q(0.000)10 E 7.5(Sonar: 0.420 2.005)130.5 336 R
-7.5(\2551.340 0.000)7.5 F(MR)130.5 348 Q 12.5(U: 0.420)-.4 F 5
-(2.005 \2551.340)10 F(0.000)10 E(Na)130.5 360 Q 12.5(v: 0.420)-.2 F 5
-(2.005 \2551.340)10 F(0.000)10 E(Data records read from: 000_2004.HSX)
-118 384 Q(Positions \(POS\):)130.5 396 Q(2651)47.5 E
-(Positions ignored \(POS\):)130.5 408 Q(0)27.5 E(Heading \(GYR\):)130.5
-420 Q(19486)52.5 E(Attitude \(HCP\):)130.5 432 Q(15752)50 E
-(Echosounder \(altitude\) \(EC1\):)130.5 444 Q(2651)15 E
-(Dynamic draft \(DFT\):)130.5 456 Q(0)37.5 E(Ra)130.5 468 Q 2.5(wm)-.15
-G(ultibeam \(RMB\):)-2.5 E(24438)37.5 E 70(Other: 64978)130.5 480 R
-(Data records read from: 000_2048.HSX)118 504 Q(Positions \(POS\):)130.5
-516 Q(2967)47.5 E(Positions ignored \(POS\):)130.5 528 Q(0)27.5 E
-(Heading \(GYR\):)130.5 540 Q(21942)52.5 E(Attitude \(HCP\):)130.5 552 Q
-(17771)50 E(Echosounder \(altitude\) \(EC1\):)130.5 564 Q(2967)15 E
-(Dynamic draft \(DFT\):)130.5 576 Q(0)37.5 E(Ra)130.5 588 Q 2.5(wm)-.15
-G(ultibeam \(RMB\):)-2.5 E(25363)37.5 E 70(Other: 71010)130.5 600 R
-(Data records read from: 000_2138.HSX)118 624 Q(Positions \(POS\):)130.5
-636 Q(2573)47.5 E(Positions ignored \(POS\):)130.5 648 Q(0)27.5 E
-(Heading \(GYR\):)130.5 660 Q(18936)52.5 E(Attitude \(HCP\):)130.5 672 Q
-(15307)50 E(Echosounder \(altitude\) \(EC1\):)130.5 684 Q(2573)15 E
-(Dynamic draft \(DFT\):)130.5 696 Q(0)37.5 E(Ra)130.5 708 Q 2.5(wm)-.15
-G(ultibeam \(RMB\):)-2.5 E(23398)37.5 E 70(Other: 62787)130.5 720 R
-(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(3)204.835 E 0
-Cg EP
-%%Page: 4 4
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mbh)72 48 Q 97.69
-(ysweeppreprocess\(1\) MB-System)-.05 F 97.69(5.0 mbh)2.5 F
-(ysweeppreprocess\(1\))-.05 E(Data records read from: 000_2221.HSX)118
-84 Q(Positions \(POS\):)130.5 96 Q(2824)47.5 E
-(Positions ignored \(POS\):)130.5 108 Q(0)27.5 E(Heading \(GYR\):)130.5
-120 Q(20863)52.5 E(Attitude \(HCP\):)130.5 132 Q(16907)50 E
-(Echosounder \(altitude\) \(EC1\):)130.5 144 Q(2824)15 E
-(Dynamic draft \(DFT\):)130.5 156 Q(0)37.5 E(Ra)130.5 168 Q 2.5(wm)-.15
-G(ultibeam \(RMB\):)-2.5 E(23993)37.5 E 70(Other: 67411)130.5 180 R
-(Data records read from: 000_2308.HSX)118 204 Q(Positions \(POS\):)130.5
-216 Q(2657)47.5 E(Positions ignored \(POS\):)130.5 228 Q(0)27.5 E
-(Heading \(GYR\):)130.5 240 Q(19571)52.5 E(Attitude \(HCP\):)130.5 252 Q
-(15818)50 E(Echosounder \(altitude\) \(EC1\):)130.5 264 Q(2657)15 E
-(Dynamic draft \(DFT\):)130.5 276 Q(0)37.5 E(Ra)130.5 288 Q 2.5(wm)-.15
-G(ultibeam \(RMB\):)-2.5 E(24009)37.5 E 70(Other: 64712)130.5 300 R -.8
-(To)118 324 S(tal data records read from: datalist_hsx.mb-1).8 E
-(Positions \(POS\):)130.5 336 Q(13672)47.5 E(Positions ignored \(POS\):)
-130.5 348 Q(0)27.5 E(Heading \(GYR\):)130.5 360 Q(100798)52.5 E
-(Attitude \(HCP\):)130.5 372 Q(81555)50 E
-(Echosounder \(altitude\) \(EC1\):)130.5 384 Q(13672)15 E
-(Dynamic draft \(DFT\):)130.5 396 Q(0)37.5 E(Ra)130.5 408 Q 2.5(wm)-.15
-G(ultibeam \(RMB\):)-2.5 E(121201)37.5 E 70(Other: 330898)130.5 420 R
-(Data records written to: 000_2004.mb201)118 444 Q(Positions \(POS\):)
-130.5 456 Q(2651)47.5 E(Positions ignored \(POS\):)130.5 468 Q(0)27.5 E
-(Heading \(GYR\):)130.5 480 Q(19486)52.5 E(Attitude \(HCP\):)130.5 492 Q
-(15752)50 E(Echosounder \(altitude\) \(EC1\):)130.5 504 Q(2651)15 E
-(Dynamic draft \(DFT\):)130.5 516 Q(0)37.5 E(Ra)130.5 528 Q 2.5(wm)-.15
-G(ultibeam \(RMB\):)-2.5 E(24438)37.5 E 70(Other: 0)130.5 540 R
-(Data records written to: 000_2048.mb201)118 564 Q(Positions \(POS\):)
-130.5 576 Q(2967)47.5 E(Positions ignored \(POS\):)130.5 588 Q(0)27.5 E
-(Heading \(GYR\):)130.5 600 Q(21942)52.5 E(Attitude \(HCP\):)130.5 612 Q
-(17771)50 E(Echosounder \(altitude\) \(EC1\):)130.5 624 Q(2967)15 E
-(Dynamic draft \(DFT\):)130.5 636 Q(0)37.5 E(Ra)130.5 648 Q 2.5(wm)-.15
-G(ultibeam \(RMB\):)-2.5 E(25363)37.5 E 70(Other: 0)130.5 660 R
-(Data records written to: 000_2138.mb201)118 684 Q(Positions \(POS\):)
-130.5 696 Q(2573)47.5 E(Positions ignored \(POS\):)130.5 708 Q(0)27.5 E
-(Heading \(GYR\):)130.5 720 Q(18936)52.5 E(MB-System 5.0)72 768 Q 2.5
-(3J)146.495 G(une 2013)-2.5 E(4)204.835 E 0 Cg EP
-%%Page: 5 5
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mbh)72 48 Q 97.69
-(ysweeppreprocess\(1\) MB-System)-.05 F 97.69(5.0 mbh)2.5 F
-(ysweeppreprocess\(1\))-.05 E(Attitude \(HCP\):)130.5 84 Q(15307)50 E
-(Echosounder \(altitude\) \(EC1\):)130.5 96 Q(2573)15 E
-(Dynamic draft \(DFT\):)130.5 108 Q(0)37.5 E(Ra)130.5 120 Q 2.5(wm)-.15
-G(ultibeam \(RMB\):)-2.5 E(23398)37.5 E 70(Other: 0)130.5 132 R
-(Data records written to: 000_2221.mb201)118 156 Q(Positions \(POS\):)
-130.5 168 Q(2824)47.5 E(Positions ignored \(POS\):)130.5 180 Q(0)27.5 E
-(Heading \(GYR\):)130.5 192 Q(20863)52.5 E(Attitude \(HCP\):)130.5 204 Q
-(16907)50 E(Echosounder \(altitude\) \(EC1\):)130.5 216 Q(2824)15 E
-(Dynamic draft \(DFT\):)130.5 228 Q(0)37.5 E(Ra)130.5 240 Q 2.5(wm)-.15
-G(ultibeam \(RMB\):)-2.5 E(23993)37.5 E 70(Other: 0)130.5 252 R
-(Data records written to: 000_2308.mb201)118 276 Q(Positions \(POS\):)
-130.5 288 Q(2657)47.5 E(Positions ignored \(POS\):)130.5 300 Q(0)27.5 E
-(Heading \(GYR\):)130.5 312 Q(19571)52.5 E(Attitude \(HCP\):)130.5 324 Q
-(15818)50 E(Echosounder \(altitude\) \(EC1\):)130.5 336 Q(2657)15 E
-(Dynamic draft \(DFT\):)130.5 348 Q(0)37.5 E(Ra)130.5 360 Q 2.5(wm)-.15
-G(ultibeam \(RMB\):)-2.5 E(24009)37.5 E 70(Other: 0)130.5 372 R -.8(To)
-118 396 S(tal data records written from: datalist_hsx.mb-1).8 E
-(Positions \(POS\):)130.5 408 Q(13672)47.5 E(Positions ignored \(POS\):)
-130.5 420 Q(0)27.5 E(Heading \(GYR\):)130.5 432 Q(100798)52.5 E
-(Attitude \(HCP\):)130.5 444 Q(81555)50 E
-(Echosounder \(altitude\) \(EC1\):)130.5 456 Q(13672)15 E
-(Dynamic draft \(DFT\):)130.5 468 Q(0)37.5 E(Ra)130.5 480 Q 2.5(wm)-.15
-G(ultibeam \(RMB\):)-2.5 E(121201)37.5 E 70(Other: 0)130.5 492 R/F1
-10.95/Times-Bold at 0 SF(SEE ALSO)72 520.8 Q/F2 10/Times-Bold at 0 SF
-(mbsystem)108 532.8 Q F0(\(1\),)A F2(mbf)2.5 E(ormat)-.25 E F0(\(1\),)A
-F2(mbinf)2.5 E(o)-.25 E F0(\(1\))A F1 -.11(BU)72 561.6 S(GS).11 E F0(At\
- this point, the HSX i/o module and preprocessor are only tested with a\
- single surv)108 573.6 Q .3 -.15(ey o)-.15 H 2.5(fR).15 G(2Sonic data.)
--2.5 E(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(5)204.835
-E 0 Cg EP
-%%Trailer
-end
-%%EOF
diff --git a/src/ps/mbinfo.ps b/src/ps/mbinfo.ps
deleted file mode 100644
index 06cc974..0000000
--- a/src/ps/mbinfo.ps
+++ /dev/null
@@ -1,727 +0,0 @@
-%!PS-Adobe-3.0
-%%Creator: groff version 1.19.2
-%%CreationDate: Wed Jul  1 12:29:28 2015
-%%DocumentNeededResources: font Times-Roman
-%%+ font Times-Bold
-%%+ font Times-Italic
-%%DocumentSuppliedResources: procset grops 1.19 2
-%%Pages: 7
-%%PageOrder: Ascend
-%%DocumentMedia: Default 612 792 0 () ()
-%%Orientation: Portrait
-%%EndComments
-%%BeginDefaults
-%%PageMedia: Default
-%%EndDefaults
-%%BeginProlog
-%%BeginResource: procset grops 1.19 2
-%!PS-Adobe-3.0 Resource-ProcSet
-/setpacking where{
-pop
-currentpacking
-true setpacking
-}if
-/grops 120 dict dup begin
-/SC 32 def
-/A/show load def
-/B{0 SC 3 -1 roll widthshow}bind def
-/C{0 exch ashow}bind def
-/D{0 exch 0 SC 5 2 roll awidthshow}bind def
-/E{0 rmoveto show}bind def
-/F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def
-/G{0 rmoveto 0 exch ashow}bind def
-/H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/I{0 exch rmoveto show}bind def
-/J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def
-/K{0 exch rmoveto 0 exch ashow}bind def
-/L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/M{rmoveto show}bind def
-/N{rmoveto 0 SC 3 -1 roll widthshow}bind def
-/O{rmoveto 0 exch ashow}bind def
-/P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/Q{moveto show}bind def
-/R{moveto 0 SC 3 -1 roll widthshow}bind def
-/S{moveto 0 exch ashow}bind def
-/T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/SF{
-findfont exch
-[exch dup 0 exch 0 exch neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/MF{
-findfont
-[5 2 roll
-0 3 1 roll
-neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/level0 0 def
-/RES 0 def
-/PL 0 def
-/LS 0 def
-/MANUAL{
-statusdict begin/manualfeed true store end
-}bind def
-/PLG{
-gsave newpath clippath pathbbox grestore
-exch pop add exch pop
-}bind def
-/BP{
-/level0 save def
-1 setlinecap
-1 setlinejoin
-72 RES div dup scale
-LS{
-90 rotate
-}{
-0 PL translate
-}ifelse
-1 -1 scale
-}bind def
-/EP{
-level0 restore
-showpage
-}def
-/DA{
-newpath arcn stroke
-}bind def
-/SN{
-transform
-.25 sub exch .25 sub exch
-round .25 add exch round .25 add exch
-itransform
-}bind def
-/DL{
-SN
-moveto
-SN
-lineto stroke
-}bind def
-/DC{
-newpath 0 360 arc closepath
-}bind def
-/TM matrix def
-/DE{
-TM currentmatrix pop
-translate scale newpath 0 0 .5 0 360 arc closepath
-TM setmatrix
-}bind def
-/RC/rcurveto load def
-/RL/rlineto load def
-/ST/stroke load def
-/MT/moveto load def
-/CL/closepath load def
-/Fr{
-setrgbcolor fill
-}bind def
-/setcmykcolor where{
-pop
-/Fk{
-setcmykcolor fill
-}bind def
-}if
-/Fg{
-setgray fill
-}bind def
-/FL/fill load def
-/LW/setlinewidth load def
-/Cr/setrgbcolor load def
-/setcmykcolor where{
-pop
-/Ck/setcmykcolor load def
-}if
-/Cg/setgray load def
-/RE{
-findfont
-dup maxlength 1 index/FontName known not{1 add}if dict begin
-{
-1 index/FID ne{def}{pop pop}ifelse
-}forall
-/Encoding exch def
-dup/FontName exch def
-currentdict end definefont pop
-}bind def
-/DEFS 0 def
-/EBEGIN{
-moveto
-DEFS begin
-}bind def
-/EEND/end load def
-/CNT 0 def
-/level1 0 def
-/PBEGIN{
-/level1 save def
-translate
-div 3 1 roll div exch scale
-neg exch neg exch translate
-0 setgray
-0 setlinecap
-1 setlinewidth
-0 setlinejoin
-10 setmiterlimit
-[]0 setdash
-/setstrokeadjust where{
-pop
-false setstrokeadjust
-}if
-/setoverprint where{
-pop
-false setoverprint
-}if
-newpath
-/CNT countdictstack def
-userdict begin
-/showpage{}def
-/setpagedevice{}def
-}bind def
-/PEND{
-countdictstack CNT sub{end}repeat
-level1 restore
-}bind def
-end def
-/setpacking where{
-pop
-setpacking
-}if
-%%EndResource
-%%EndProlog
-%%BeginSetup
-%%BeginFeature: *PageSize Default
-<< /PageSize [ 612 792 ] /ImagingBBox null >> setpagedevice
-%%EndFeature
-%%IncludeResource: font Times-Roman
-%%IncludeResource: font Times-Bold
-%%IncludeResource: font Times-Italic
-grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72
-def/PL 792 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron/Zcaron
-/scaron/zcaron/Ydieresis/trademark/quotesingle/Euro/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/space/exclam/quotedbl/numbersign/dollar/percent
-/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen
-/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon
-/semicolon/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O
-/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright/circumflex
-/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y
-/z/braceleft/bar/braceright/tilde/.notdef/quotesinglbase/guillemotleft
-/guillemotright/bullet/florin/fraction/perthousand/dagger/daggerdbl
-/endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut
-/dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash
-/quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen
-/brokenbar/section/dieresis/copyright/ordfeminine/guilsinglleft
-/logicalnot/minus/registered/macron/degree/plusminus/twosuperior
-/threesuperior/acute/mu/paragraph/periodcentered/cedilla/onesuperior
-/ordmasculine/guilsinglright/onequarter/onehalf/threequarters
-/questiondown/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE
-/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex
-/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis
-/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn
-/germandbls/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla
-/egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis
-/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide/oslash
-/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis]def
-/Times-Italic at 0 ENC0/Times-Italic RE/Times-Bold at 0 ENC0/Times-Bold RE
-/Times-Roman at 0 ENC0/Times-Roman RE
-%%EndSetup
-%%Page: 1 1
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbinfo\(1\) MB-System)72 48 R 159.28
-(5.0 mbinfo\(1\))2.5 F/F1 10.95/Times-Bold at 0 SF -.219(NA)72 84 S(ME).219
-E/F2 10/Times-Bold at 0 SF(mbinf)108 96 Q(o)-.25 E F0 2.5<ad4f>2.5 G
-(utput some basic statistics of sw)-2.5 E(ath sonar data \214les.)-.1 E
-F1(VERSION)72 124.8 Q F0 -1.11(Ve)108 136.8 S(rsion 5.0)1.11 E F1
-(SYNOPSIS)72 165.6 Q F2(mbinf)108 177.6 Q(o)-.25 E F0([)11.366 E F2
-<ad42>A/F3 10/Times-Italic at 0 SF(yr/mo/da/hr/mn/sc)A F2 8.866<ad4320ad45>
-11.366 F F3(yr/mo/da/hr/mn/sc)A F2<ad46>11.366 E F3(format)A F2 8.865
-<ad4720ad49>11.366 F F3(\214lename)A F2<ad4c>11.365 E F3(lon\215ip)A F2
-<ad4d>108 189.6 Q F3(londim/latdim)A F2<ad4e20ad4f20ad50>2.5 E F3(ping)A
-F2<ad52>2.5 E F3(west/east/south/north)A F2<ad53>2.5 E F3(speed)A F2
-<ad5720ad58>2.5 E F3(outputformat)A F2(\255V \255H])2.5 E F1
-(DESCRIPTION)72 218.4 Q F2(MBinf)108 230.4 Q(o)-.25 E F0 .461
-(is a utility for reading a sw)2.961 F .462
-(ath sonar data \214le or \214les and outputting some basic statistics.)
--.1 F .462(The ta-)5.462 F .931(ble generated sho)108 242.4 R .931(ws t\
-he \214lename, the data format id, a brief description of the format, a\
-n)-.25 F 3.43(ym)-.15 G .93(etadata that)-3.43 F(ha)108 254.4 Q .538
--.15(ve b)-.2 H .238(een inserted into the data, data counts, na).15 F
-(vig)-.2 E .238(ation totals, time and na)-.05 F(vig)-.2 E .239
-(ation of the \214rst and last data)-.05 F 1.728
-(records, minimum and maximum data v)108 266.4 R 1.728
-(alues, and the geographic bounding box of the data.)-.25 F 1.728
-(The data)6.728 F .978(counts include the total number of bath)108 278.4
-R(ymetry)-.05 E 3.479(,a)-.65 G .979(mplitude, and sidescan v)-3.479 F
-.979(alues read. These totals may be)-.25 F .302(less than the maximum \
-possible \(number of data records times the maximum number of data supp\
-orted for)108 290.4 R .703
-(the particular data format\) for formats supporting v)108 302.4 R .703
-(ariable numbers of beams or pix)-.25 F 3.204(els. Also)-.15 F .704
-(reported are)3.204 F .628
-(the numbers and percentages of good, zero, and \215agged data v)108
-314.4 R .628(alues \(good v)-.25 F .627(alues are those which are nei-)
--.25 F(ther zero nor \215agged as bad\).)108 326.4 Q .717
-(An important function)108 350.4 R(of)5.717 E F2(mbinf)3.217 E(o)-.25 E
-F0 .718(is to generate ".inf" \214les that may be parsed by other)3.217
-F F2(MB-System)3.218 E F0(pro-)3.218 E .106
-(grams and macros. Programs such as)108 362.4 R F2(mbgrid)2.605 E F0
-(and)2.605 E F2(mbmosaic)2.605 E F0 2.605(,r)C .105
-(ead ".inf" \214les, when a)-2.605 F -.25(va)-.2 G .105
-(ilable, to determine).25 F .476(whether input sw)108 374.4 R .476
-(ath data \214les actually contain an)-.1 F 2.977(yd)-.15 G .477
-(ata in the area of interest. The ef)-2.977 F(\214cienc)-.25 E 2.977(yo)
--.15 G 2.977(ft)-2.977 G .477(hese pro-)-2.977 F .276
-(grams is enhanced by their ability to a)108 386.4 R -.2(vo)-.2 G .276
-(id reading \214les with no data in the area to be gridded or mosaiced.)
-.2 F .576(Programs such as)108 398.4 R F2(mbm_plot)3.076 E F0(and)3.076
-E F2(mbm_grid)3.076 E F0(run)3.076 E F2(mbinf)3.076 E(o)-.25 E F0 .576
-(on input \214les to determine the data bounds. The)3.076 F -.2(av)108
-410.4 S 1.43(ailability of ".inf" \214les allo)-.05 F 1.429
-(ws this information to be determined without ha)-.25 F 1.429
-(ving to read through each)-.2 F(sw)108 422.4 Q .803(ath \214le.T)-.1 F
-3.303(oc)-.8 G .803(reate an ".inf" \214le, simply direct the output of)
--3.303 F F2(mbinf)3.304 E(o)-.25 E F0 .804
-(to a \214le named by adding the suf)3.304 F<8c78>-.25 E .736
-(".inf" to the input sw)108 434.4 R .736
-(ath data \214lename. This can also be accomplished using the)-.1 F F2
-<ad4f>3.235 E F0 .735(option of)3.235 F F2(mbinf)3.235 E(o)-.25 E F0
-3.235(,o)C(r)-3.235 E(the)108 446.4 Q F2<ad4e>2.5 E F0(and)2.5 E F2
-<ad4f>2.5 E F0(options of)2.5 E F2(mbdatalist)2.5 E F0(.)A .393
-(Data archi)108 470.4 R -.15(ve)-.25 G 2.893(su).15 G .393
-(se metadata harv)-2.893 F .393(esting tools that often w)-.15 F .394
-(ork better with information structured for machine)-.1 F .012
-(parsing rather than for easy reading by humans. T)108 482.4 R 2.512(oo)
--.8 G .012(utput a v)-2.512 F .012
-(ariant of "*.inf" \214les in the JSON format \(with)-.25 F .026
-("_inf.json" suf)108 494.4 R<8c78>-.25 E .026(es\), use the)-.15 F F2
-<ad58>2.527 E F3(1)A F0 2.527(option. Similarly)2.527 F 2.527(,s)-.65 G
-.027(pecifying the)-2.527 F F2<ad58>2.527 E F3(2)A F0 .027
-(option will result in XML output in)2.527 F
-(\214les with "_xml.inf" suf)108 506.4 Q<8c78>-.25 E(es.)-.15 E 1.049
-(The program)108 530.4 R F2(mbpr)3.549 E(ocess)-.18 E F0 1.049
-(can insert metadata recognized and printed by)3.549 F F2(mbinf)3.548 E
-(o)-.25 E F0 3.548(.T)C 1.048(hese metadata include)-3.548 F .419
-(items such as the sonar model, the v)108 542.4 R .419
-(essel name, and bias parameters.)-.15 F .42(See the)5.42 F F2(mbpr)2.92
-E(ocess)-.18 E F0(and)2.92 E F2(mbset)2.92 E F0(man-)2.92 E
-(ual pages for details.)108 554.4 Q .574(The data input may be a)108
-578.4 R -.15(ve)-.2 G .574(raged o).15 F -.15(ve)-.15 G 3.074(rs).15 G
--2.15 -.25(ev e)-3.074 H .574(ral pings and/or windo).25 F .574
-(wed in time and space.)-.25 F .574(Comments in the)5.574 F
-(data stream may also be printed out.)108 590.4 Q
-(The results are dumped to stdout.)5 E 1.462(If pings are a)108 614.4 R
--.15(ve)-.2 G 1.462(raged \().15 F F3(pings)A F0 3.962(>2)3.962 G(\))
--3.962 E F2(mbinf)3.962 E(o)-.25 E F0 1.462(estimates the v)3.962 F
-1.463(ariance for each of the bath)-.25 F 1.463(ymetry beams and)-.05 F
-.262(sidescan pix)108 626.4 R .261
-(els by reading a set number of pings and then \214nding the v)-.15 F
-.261(ariance of the v)-.25 F .261(alues for each beam.)-.25 F(The bath)
-108 638.4 Q(ymetry v)-.05 E(alues are detrended before v)-.25 E
-(ariances are calculated.)-.25 E .507(The program output can also be e)
-108 662.4 R .508(xtended to include a coarse mask representing where da\
-ta lies within the)-.15 F(\214le')108 674.4 Q 2.662(sb)-.55 G .162
-(ounding box. This mask is sho)-2.662 F .162(wn as a table of 0')-.25 F
-2.661(sa)-.55 G .161(nd 1')-2.661 F .161(s, where the 1')-.55 F 2.661
-(si)-.55 G .161(ndicate bins with data. The)-2.661 F .617
-(dimensions of the mask are speci\214ed with the)108 686.4 R F2<ad4d>
-3.117 E F3(londim/latdim)A F0 3.117(option. F)3.117 F .618
-(or instance, if the user speci\214es)-.15 F F2<ad4d>108 698.4 Q F3
-(10/10)A F0 3.294(,t)C(hen)-3.294 E F2(mbinf)3.294 E(o)-.25 E F0 .793(w\
-ill read through the data once to establish the usual statistics, inclu\
-ding the data)3.293 F .298(bounding box. Then, the program will initial\
-ize a 10 X 10 grid with the minimum and maximum longitude)108 710.4 R
-.722(and latitude of the bounding box, and read the data a second time.\
- Each bin in which a sounding or pix)108 722.4 R(el)-.15 E
-(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(1)204.835 E 0
-Cg EP
-%%Page: 2 2
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbinfo\(1\) MB-System)72 48 R 159.28
-(5.0 mbinfo\(1\))2.5 F -.1(fa)108 84 S .477(lls will be set to 1. After\
- the second reading pass, the data location mask will be output at the \
-end of the).1 F/F1 10/Times-Bold at 0 SF(mbinf)108 96 Q(o)-.25 E F0
-(output.)2.5 E/F2 10.95/Times-Bold at 0 SF -.548(AU)72 124.8 S(THORSHIP)
-.548 E F0(Da)108 136.8 Q(vid W)-.2 E 2.5(.C)-.92 G
-(aress \(caress at mbari.or)-2.5 E(g\))-.18 E(Montere)113 148.8 Q 2.5(yB)
--.15 G(ay Aquarium Research Institute)-2.5 E
-(Dale N. Chayes \(dale at ldeo.columbia.edu\))108 160.8 Q
-(Lamont-Doherty Earth Observ)113 172.8 Q(atory)-.25 E F2(OPTIONS)72
-201.6 Q F1<ad42>108 213.6 Q/F3 10/Times-Italic at 0 SF(yr/mo/da/hr/mn/sc)
-23.63 E F0 .155(This option sets the starting time for data allo)144
-225.6 R .155(wed in the input data.)-.25 F(The)5.155 E F1<ad45>2.655 E
-F0 .155(option sets the ending)2.655 F .195
-(time for data. If the starting time is before the ending time, then an)
-144 237.6 R 2.695(yd)-.15 G .196(ata with a time stamp before)-2.695 F
-.444(the starting time or after the ending time is ignored. If instead \
-the starting time is after the ending)144 249.6 R .194(time, then an)144
-261.6 R 2.694(yd)-.15 G .194(ata between the ending and starting time w\
-ill be ignored. This scheme allo)-2.694 F .195(ws time)-.25 F(windo)144
-273.6 Q 5.376(wing both inside and outside a speci\214ed interv)-.25 F
-7.876(al. Def)-.25 F(ault:)-.1 E F3(yr/mo/da/hr/mn/sc)7.876 E F0(=)7.876
-E(1962/2/21/10/30/0.)144 285.6 Q F1<ad43>108 302.4 Q F0(Normally)23.08 E
-(,)-.65 E F1(mbinf)2.547 E(o)-.25 E F0 .047
-(ignores comments encountered in the data \214le.)2.547 F .048(If the)
-5.048 F F1<ad43>2.548 E F0 .048(\215ag is gi)2.548 F -.15(ve)-.25 G .048
-(n, all of the).15 F(comments will be printed out.)144 314.4 Q F1<ad45>
-108 331.2 Q F3(yr/mo/da/hr/mn/sc)23.63 E F0 .155
-(This option sets the ending time for data allo)144 343.2 R .155
-(wed in the input data.)-.25 F(The)5.155 E F1<ad42>2.655 E F0 .155
-(option sets the starting)2.655 F .195
-(time for data. If the starting time is before the ending time, then an)
-144 355.2 R 2.695(yd)-.15 G .196(ata with a time stamp before)-2.695 F
-.444(the starting time or after the ending time is ignored. If instead \
-the starting time is after the ending)144 367.2 R .194(time, then an)144
-379.2 R 2.694(yd)-.15 G .194(ata between the ending and starting time w\
-ill be ignored. This scheme allo)-2.694 F .195(ws time)-.25 F(windo)144
-391.2 Q 5.376(wing both inside and outside a speci\214ed interv)-.25 F
-7.876(al. Def)-.25 F(ault:)-.1 E F3(yr/mo/da/hr/mn/sc)7.876 E F0(=)7.876
-E(2062/2/21/10/30/0.)144 403.2 Q F1<ad46>108 420 Q F3(format)24.19 E F0
-.22(Sets the data format used if the input is read from stdin or from a\
- \214le. If)144 432 R F3(format)2.72 E F0 2.72(<0)2.72 G 2.72(,t)-2.72 G
-.22(hen the input)-2.72 F .008(\214le speci\214ed with the)144 444 R F1
-<ad49>2.508 E F0 .008(option will actually contain a list of input sw)
-2.508 F .007(ath sonar data \214les. This pro-)-.1 F .011(gram uses the)
-144 456 R F1(MBIO)2.511 E F0 .012(library and will read or write an)
-2.511 F 2.512(ys)-.15 G -.1(wa)-2.512 G .012
-(th sonar format supported by).1 F F1(MBIO)2.512 E F0 2.512(.A)C 1.297
-(list of the sw)144 468 R 1.297
-(ath sonar data formats currently supported by)-.1 F F1(MBIO)3.797 E F0
-1.296(and their identi\214er v)3.796 F 1.296(alues is)-.25 F(gi)144 480
-Q -.15(ve)-.25 G 2.5(ni).15 G 2.5(nt)-2.5 G(he)-2.5 E F1(MBIO)2.5 E F0
-(manual page. The def)2.5 E(ault format is set using)-.1 E F1
-(mbdefaults)2.5 E F0(.)A F1<ad47>108 496.8 Q F0 .463
-(Enables checking for reasonable na)22.52 F(vig)-.2 E .463
-(ation to be used in calculating the minimum and maximum)-.05 F 1.133
-(longitude and latitude v)144 508.8 R 3.632(alues. This)-.25 F 1.132
-(mode e)3.632 F 1.132(xcludes longitude and latitude v)-.15 F 1.132
-(alues of 0.0 or those)-.25 F -.25(va)144 520.8 S 1.296
-(lues associated with v).25 F 1.296(ery lar)-.15 F 1.297
-(ge apparent speeds between pings \(calculated using distance and)-.18 F
-.709(time dif)144 532.8 R .709(ferences between adjacent pings\). This \
-option is particularly useful when one is trying to)-.25 F
-(obtain reasonable bounds for a plot.)144 544.8 Q F1<ad48>108 561.6 Q F0
-.162(This "help" \215ag cause the program to print out a description of\
- its operation and then e)22.52 F .162(xit immedi-)-.15 F(ately)144
-573.6 Q(.)-.65 E F1<ad49>108 590.4 Q F3(\214lename)26.41 E F0 .468
-(Sets the input \214lename. If)144 602.4 R F3(format)2.967 E F0 2.967
-(>0\()2.967 G .467(set with the)-2.967 F F1<ad66>2.967 E F0 .467
-(option\) then the sw)2.967 F .467(ath sonar data contained)-.1 F(in)144
-614.4 Q F3(in\214le)2.937 E F0 .437(is read and processed. If)2.937 F F3
-(format)2.937 E F0 2.937(<0)2.937 G 2.937(,t)-2.937 G(hen)-2.937 E F3
-(in\214le)2.937 E F0 .437(is assumed to be an ascii \214le containing a)
-2.937 F .003(list of the input sw)144 626.4 R .003
-(ath sonar data \214les to be processed and their formats.)-.1 F .002
-(The program will read the)5.003 F .274
-(data in each one of these \214les.)144 638.4 R .274(In the)5.274 F F3
-(in\214le)2.774 E F0 .275(\214le, each data \214le should be follo)2.774
-F .275(wed by a data format)-.25 F(identi\214er)144 650.4 Q 2.5(,e)-.4 G
-(.g.:)-2.5 E(data\214le1 11)180 662.4 Q(data\214le2 24)180 674.4 Q .569
-(This program uses the)144 686.4 R F1(MBIO)3.068 E F0 .568
-(library and will read or write an)3.068 F 3.068(ys)-.15 G -.1(wa)-3.068
-G .568(th sonar format supported by).1 F F1(MBIO)144 698.4 Q F0 3.428
-(.Al)C .928(ist of the sw)-3.428 F .928
-(ath sonar data formats currently supported by)-.1 F F1(MBIO)3.428 E F0
-.928(and their identi\214er)3.428 F -.25(va)144 710.4 S(lues is gi).25 E
--.15(ve)-.25 G 2.5(ni).15 G 2.5(nt)-2.5 G(he)-2.5 E F1(MBIO)2.5 E F0
-(manual page. Def)2.5 E(ault:)-.1 E F3(in\214le)2.5 E F0 2.5(=")2.5 G
-(stdin".)-2.5 E(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E
-(2)204.835 E 0 Cg EP
-%%Page: 3 3
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbinfo\(1\) MB-System)72 48 R 159.28
-(5.0 mbinfo\(1\))2.5 F/F1 10/Times-Bold at 0 SF<ad4c>108 84 Q/F2 10
-/Times-Italic at 0 SF(lon\215ip)23.63 E F0 .572
-(Sets the range of the longitude v)144 96 R .572(alues returned.)-.25 F
-(If)5.572 E F2(lon\215ip)3.072 E F0 .572(=\2551 then the longitude v)B
-.571(alues will be in)-.25 F .488(the range from \255360 to 0 de)144 108
-R .488(grees. If)-.15 F F2(lon\215ip)2.988 E F0 .488
-(=0 then the longitude v)B .489(alues will be in the range from)-.25 F
-1.383(\255180 to 180 de)144 120 R 1.383(grees. If)-.15 F F2(lon\215ip)
-3.882 E F0 1.382(=1 then the longitude v)B 1.382
-(alues will be in the range from 0 to 360)-.25 F(de)144 132 Q 2.5
-(grees. Def)-.15 F(ault:)-.1 E F1(mbinf)2.5 E(o)-.25 E F0
-(selects the be)2.5 E(xt longitude range based on the \214rst data.)-.15
-E F1<ad4d>108 148.8 Q F2(londim/latdim)20.86 E F0 .397
-(The program output can be e)144 160.8 R .397
-(xtended to include a coarse mask representing where data lies within)
--.15 F .667(the \214le')144 172.8 R 3.167(sb)-.55 G .667
-(ounding box. This mask is sho)-3.167 F .666(wn as a table of 0')-.25 F
-3.166(sa)-.55 G .666(nd 1')-3.166 F .666(s, where the 1')-.55 F 3.166
-(si)-.55 G .666(ndicate bins)-3.166 F
-(with data. The dimensions of the mask are speci\214ed with the)144
-184.8 Q F1<ad4d>2.5 E F2(londim/latdim)A F0(option.)2.5 E F1<ad4e>108
-201.6 Q F0 .533(Extends the program output to include notices. These no\
-tices include three sections. The \214rst is a)144 213.6 R .144
-(list of all of the data record types \(e.g. surv)144 225.6 R -.15(ey)
--.15 G 2.643(,c)-.5 G .143(omment, na)-2.643 F(vig)-.2 E .143
-(ation, parameter\) encountered while)-.05 F 1.128(reading the \214le. \
-Some formats are quite simple and only include surv)144 237.6 R 1.429
--.15(ey r)-.15 H 1.129(ecords and comments.).15 F .653
-(Other formats are comple)144 249.6 R 3.152(xa)-.15 G .652
-(nd may contain man)-3.152 F 3.152(yd)-.15 G(if)-3.152 E .652
-(ferent sorts of data records, including some)-.25 F 1.078
-(that only deri)144 261.6 R 1.378 -.15(ve f)-.25 H 1.078
-(rom a particular sonar model. The second section lists an).15 F 3.578
-(yn)-.15 G(onf)-3.578 E 1.078(atal error mes-)-.1 F 1.948(sages \(e.g. \
-unintelligible record\) generated while reading the \214le. Finally)144
-273.6 R 4.447(,t)-.65 G 1.947(he third section of)-4.447 F .644
-(notices lists an)144 285.6 R 3.144(yp)-.15 G .644
-(articular problems with the data that ha)-3.144 F .944 -.15(ve b)-.2 H
-.645(een identi\214ed \(e.g. some na).15 F(vig)-.2 E(ation)-.05 E
-(is zero or some depths are too lar)144 297.6 Q(ge to be correct\).)-.18
-E F1<ad4f>108 314.4 Q F0 .278(This option causes the program output to \
-be directed to "inf" \214les rather than to stdout. Each "inf")144 326.4
-R
-(\214le is named using the original data \214le path with an ".inf" suf)
-144 338.4 Q(\214x appended.)-.25 E F1<ad50>108 355.2 Q F2(pings)24.19 E
-F0 -.45(Tu)144 367.2 S .05(rns on v).45 F .05
-(ariance calculations for the bath)-.25 F(ymetry)-.05 E 2.551(,a)-.65 G
-.051(mplitude, and sidescan data \(as a)-2.551 F -.25(va)-.2 G .051
-(ilable in the).25 F .111(data stream\).)144 379.2 R(If)5.111 E F2
-(pings)2.611 E F0 2.611(=1)2.611 G 2.611(,t)-2.611 G .111(hen no v)
--2.611 F .111(ariance calculations are made.)-.25 F(If)5.11 E F2(pings)
-2.61 E F0 2.61(>1)2.61 G 2.61(,t)-2.61 G .11(hen v)-2.61 F .11
-(ariances are)-.25 F 1.913(calculated for each beam and pix)144 391.2 R
-1.913(el using groups of)-.15 F F2(pings)4.413 E F0 -.25(va)4.413 G
-4.413(lues. The).25 F(bath)4.413 E 1.913(ymetry v)-.05 F 1.913
-(alues are)-.25 F .04(detrended before the v)144 403.2 R .039
-(ariances are calculated; the amplitude and sidescan v)-.25 F .039
-(alues are not detrended.)-.25 F .192(The v)144 415.2 R .192
-(ariance calculations can pro)-.25 F .193
-(vide crude measures of noise and/or signal as a function of beam)-.15 F
-(and pix)144 427.2 Q(el number)-.15 E 5(.D)-.55 G(ef)-5 E(ault:)-.1 E F2
-(pings)2.5 E F0 2.5(=1\()2.5 G(no v)-2.5 E(ariance calculations\).)-.25
-E F1<ad52>108 444 Q F2(west/east/south/north)23.08 E F0 .679
-(Sets the longitude and latitude bounds within which sw)144 456 R .679
-(ath sonar data will be read. Only the data)-.1 F .097
-(which lies within these bounds will be read.)144 468 R(Def)5.098 E
-(ault:)-.1 E F2(west)2.598 E F0 .098(=\255360, east)B F2(=360)A F0(,)A
-F2(south)2.598 E F0(=\25590,)A F2(north)2.598 E F0(=90.)A F1<ad53>108
-484.8 Q F2(speed)24.74 E F0 .532
-(Sets the minimum speed in km/hr \(5.5 kts ~ 10 km/hr\) allo)144 496.8 R
-.531(wed in the input data; pings associated)-.25 F
-(with a smaller ship speed will not be copied. Def)144 508.8 Q(ault:)-.1
-E F2(speed)2.5 E F0 2.5(=0)2.5 G(.)-2.5 E F1<ad54>108 525.6 Q F2(time)
-23.63 E(gap)-.4 E F0 .478(Sets the maximum time g)144 537.6 R .479
-(ap in minutes between adjacent pings allo)-.05 F .479
-(wed before the data is consid-)-.25 F(ered to ha)144 549.6 Q .3 -.15
-(ve a g)-.2 H(ap. Def).1 E(ault:)-.1 E F2(time)2.5 E(gap)-.4 E F0 2.5
-(=1)2.5 G(.)-2.5 E F1<ad56>108 566.4 Q F0(Normally)23.08 E(,)-.65 E F1
-(mbinf)2.522 E(o)-.25 E F0 .022
-(only prints out the statistics obtained by reading all of the data.)
-2.522 F .021(If the)5.021 F F1<ad56>2.521 E F0 .021(\215ag is)2.521 F
-(gi)144 578.4 Q -.15(ve)-.25 G .124(n, then).15 F F1(mbinf)2.624 E(o)
--.25 E F0 -.1(wo)2.624 G .124(rks in a "v).1 F .124
-(erbose" mode and outputs the program v)-.15 F .125
-(ersion being used and all)-.15 F(read error status messages.)144 590.4
-Q F1<ad57>108 607.2 Q F0(Normally)20.3 E(,)-.65 E F1(mbinf)3.828 E(o)
--.25 E F0 1.328(reports depth v)3.828 F 1.327(alues in meters. If the)
--.25 F F1<ad57>3.827 E F0 1.327(\215ag is gi)3.827 F -.15(ve)-.25 G
-1.327(n, then).15 F F1(mbinf)3.827 E(o)-.25 E F0(reports)3.827 E
-(these v)144 619.2 Q(alues in feet.)-.25 E F1<ad58>108 636 Q F2
-(outputformat)23.08 E F0(Normally)144 648 Q(,)-.65 E F1(mbinf)3.67 E(o)
--.25 E F0 1.17(reports information as te)3.67 F 1.17
-(xt formatted for easy reading. If this option is gi)-.15 F -.15(ve)-.25
-G(n).15 E(with)144 660 Q F2(outputformat)4.065 E F0 1.565
-(=1, then the output will be in the JSON format. If the)B F1<ad4f>4.064
-E F0 1.564(option is used to)4.064 F -.15(ex)144 672 S .298
-(plicitly mak).15 F 2.798(e")-.1 G .298(*.inf" \214les, then the output\
- will be JSON and the output \214lenames will be named)-2.798 F 1.087
-(using the original data \214le path with an "_inf.json" suf)144 684 R
-1.087(\214x appended. If this option is gi)-.25 F -.15(ve)-.25 G 3.586
-(nw).15 G(ith)-3.586 E F2(outputformat)144 696 Q F0 .495
-(=2, then the output will be in the XML format. If the)B F1<ad4f>2.995 E
-F0 .496(option is used to e)2.996 F(xplicitly)-.15 E(mak)144 708 Q 2.952
-(e")-.1 G .452(*.inf" \214les, then the output will be XML and the outp\
-ut \214lenames will be named using the)-2.952 F
-(original data \214le path with an "_inf.xml" suf)144 720 Q
-(\214x appended.)-.25 E(MB-System 5.0)72 768 Q 2.5(3J)146.495 G
-(une 2013)-2.5 E(3)204.835 E 0 Cg EP
-%%Page: 4 4
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbinfo\(1\) MB-System)72 48 R 159.28
-(5.0 mbinfo\(1\))2.5 F/F1 10.95/Times-Bold at 0 SF(EXAMPLES)72 84 Q F0 .57
-(Suppose one wishes to kno)108 96 R 3.07(ws)-.25 G .571(omething about \
-the contents of a Hydrosweep \214le \(format 24\) called e)-3.07 F(xam-)
--.15 E 2.5(ple_hs.mb24. The)108 108 R(follo)2.5 E(wing will suf)-.25 E
-(\214ce:)-.25 E(mbinfo \255F24 \255Ie)144 120 Q(xample_hs.mb24)-.15 E
-(The follo)108 144 Q(wing output is produced:)-.25 E(Sw)110.5 180 Q
-(ath Data File:)-.1 E -.15(ex)15 G(ample_hs.mb24).15 E(MBIO Data F)110.5
-192 Q(ormat ID:)-.15 E(24)5 E -.15(Fo)110.5 204 S(rmat name:).15 E
-(MBF_HSLDEOIH)25 E
-(Informal Description: L-DEO in-house binary Hydrosweep)110.5 216 Q
-(Attrib)110.5 228 Q 25(utes: Hydrosweep)-.2 F(DS, 59 beams, bath)2.5 E
-(ymetry and amplitude,)-.05 E(binary)165.5 240 Q 2.5(,c)-.65 G
-(entered, L-DEO.)-2.5 E(Data T)110.5 264 Q(otals:)-.8 E
-(Number of Records:)110.5 276 Q(263)35 E(Bath)110.5 288 Q
-(ymetry Data \(59 beams\):)-.05 E(Number of Beams:)115.5 300 Q(15517)30
-E(Number of Good Beams:)115.5 312 Q 10(13661 88.04%)17.5 F
-(Number of Zero Beams:)115.5 324 Q 12.5(868 5.59%)22.5 F
-(Number of Flagged Beams:)115.5 336 Q 12.5(988 6.37%)15 F
-(Amplitude Data \(59 beams\):)110.5 348 Q(Number of Beams:)115.5 360 Q
-(15517)30 E(Number of Good Beams:)115.5 372 Q 10(13661 88.04%)17.5 F
-(Number of Zero Beams:)115.5 384 Q 12.5(868 5.59%)22.5 F
-(Number of Flagged Beams:)115.5 396 Q 12.5(988 6.37%)15 F
-(Sidescan Data \(0 pix)110.5 408 Q(els\):)-.15 E(Number of Pix)115.5 420
-Q 35(els: 0)-.15 F(Number of Good Pix)115.5 432 Q 22.5(els: 0)-.15 F
-(0.00%)15 E(Number of Zero Pix)115.5 444 Q 22.5(els: 0)-.15 F(0.00%)15 E
-(Number of Flagged Pix)115.5 456 Q 15(els: 0)-.15 F(0.00%)15 E(Na)110.5
-480 Q(vig)-.2 E(ation T)-.05 E(otals:)-.8 E -.8(To)110.5 492 S(tal T).8
-E 30(ime: 1.2425)-.35 F(hours)2.5 E -.8(To)110.5 504 S(tal T).8 E
-(rack Length:)-.35 E(20.9421 km)10 E -1.17 -.74(Av e)110.5 516 T
-(rage Speed:).74 E(16.8548 km/hr \( 9.1107 knots\))22.5 E
-(Start of Data:)110.5 540 Q -.35(Ti)110.5 552 S 2.5(me: 08).35 F
-(14 1993 18:00:25.000000)2.5 E(JD226)5 E 2.5(Lon: \25549.3011)110.5 564
-R 5(Lat: 12.1444)12.5 F 2.5(Depth: 4920.0000)12.5 F(meters)2.5 E
-(Speed: 18.3600 km/hr \( 9.9243 knots\))110.5 576 Q 2.5
-(Heading: 97.2000)5 F(de)2.5 E(grees)-.15 E(Sonar Depth:)110.5 588 Q
-(0.0000 m)10 E(Sonar Altitude: 4920.0000 m)5 E(End of Data:)110.5 612 Q
--.35(Ti)110.5 624 S 2.5(me: 08).35 F(14 1993 19:14:58.000000)2.5 E
-(JD226)5 E 2.5(Lon: \25549.1111)110.5 636 R 5(Lat: 12.1149)12.5 F 2.5
-(Depth: 5021.0000)12.5 F(meters)2.5 E
-(Speed: 17.2800 km/hr \( 9.3405 knots\))110.5 648 Q 2.5
-(Heading: 97.0000)5 F(de)2.5 E(grees)-.15 E(Sonar Depth:)110.5 660 Q
-(0.0000 m)10 E(Sonar Altitude: 5021.0000 m)5 E(Limits:)110.5 684 Q
-(Minimum Longitude:)110.5 696 Q 5(\25549.3061 Maximum)12.5 F 10
-(Longitude: \25549.1064)2.5 F(Minimum Latitude:)110.5 708 Q 5
-(12.0750 Maximum)17.5 F 15(Latitude: 12.1806)2.5 F(Minimum Sonar Depth:)
-110.5 720 Q 5(0.0000 Maximum)12.5 F(Sonar Depth:)2.5 E(0.0000)12.5 E
-(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(4)204.835 E 0
-Cg EP
-%%Page: 5 5
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbinfo\(1\) MB-System)72 48 R 159.28
-(5.0 mbinfo\(1\))2.5 F(Minimum Altitude:)110.5 84 Q 5(4087.0000 Maximum)
-12.5 F 10(Altitude: 5034.0000)2.5 F(Minimum Depth:)110.5 96 Q 5
-(3726.0000 Maximum)20 F 17.5(Depth: 5190.0000)2.5 F(Minimum Amplitude:)
-110.5 108 Q 5(100.0000 Maximum)12.5 F 7.5(Amplitude: 6380.0000)2.5 F
-(Suppose we w)108 144 Q(anted to kno)-.1 E 2.5(wh)-.25 G .5 -.25(ow n)
--2.5 H(oisy the outer beams are relati).25 E .3 -.15(ve t)-.25 H 2.5(ot)
-.15 G(he inner beams.)-2.5 E 1.6 -.8(We m)5 H(ight try:).8 E
-(mbinfo \255F24 \255P5 \255Ie)144 156 Q(xample_hs.mb24)-.15 E
-(obtaining:)108 180 Q(Sw)110.5 204 Q(ath Data File:)-.1 E -.15(ex)15 G
-(ample_hs.mb24).15 E(MBIO Data F)110.5 216 Q(ormat ID:)-.15 E(24)5 E
--.15(Fo)110.5 228 S(rmat name:).15 E(MBF_HSLDEOIH)25 E
-(Informal Description: L-DEO in-house binary Hydrosweep)110.5 240 Q
-(Attrib)110.5 252 Q 25(utes: Hydrosweep)-.2 F(DS, 59 beams, bath)2.5 E
-(ymetry and amplitude,)-.05 E(binary)165.5 264 Q 2.5(,c)-.65 G
-(entered, L-DEO.)-2.5 E(Data T)110.5 288 Q(otals:)-.8 E
-(Number of Records:)110.5 300 Q(263)35 E(Bath)110.5 312 Q
-(ymetry Data \(59 beams\):)-.05 E(Number of Beams:)115.5 324 Q(15517)30
-E(Number of Good Beams:)115.5 336 Q 10(13661 88.04%)17.5 F
-(Number of Zero Beams:)115.5 348 Q 12.5(868 5.59%)22.5 F
-(Number of Flagged Beams:)115.5 360 Q 12.5(988 6.37%)15 F
-(Amplitude Data \(59 beams\):)110.5 372 Q(Number of Beams:)115.5 384 Q
-(15517)30 E(Number of Good Beams:)115.5 396 Q 10(13661 88.04%)17.5 F
-(Number of Zero Beams:)115.5 408 Q 12.5(868 5.59%)22.5 F
-(Number of Flagged Beams:)115.5 420 Q 12.5(988 6.37%)15 F
-(Sidescan Data \(0 pix)110.5 432 Q(els\):)-.15 E(Number of Pix)115.5 444
-Q 35(els: 0)-.15 F(Number of Good Pix)115.5 456 Q 22.5(els: 0)-.15 F
-(0.00%)15 E(Number of Zero Pix)115.5 468 Q 22.5(els: 0)-.15 F(0.00%)15 E
-(Number of Flagged Pix)115.5 480 Q 15(els: 0)-.15 F(0.00%)15 E(Na)110.5
-504 Q(vig)-.2 E(ation T)-.05 E(otals:)-.8 E -.8(To)110.5 516 S(tal T).8
-E 30(ime: 1.2425)-.35 F(hours)2.5 E -.8(To)110.5 528 S(tal T).8 E
-(rack Length:)-.35 E(20.9421 km)10 E -1.17 -.74(Av e)110.5 540 T
-(rage Speed:).74 E(16.8548 km/hr \( 9.1107 knots\))22.5 E
-(Start of Data:)110.5 564 Q -.35(Ti)110.5 576 S 2.5(me: 08).35 F
-(14 1993 18:00:25.000000)2.5 E(JD226)5 E 2.5(Lon: \25549.3011)110.5 588
-R 5(Lat: 12.1444)12.5 F 2.5(Depth: 4920.0000)12.5 F(meters)2.5 E
-(Speed: 18.3600 km/hr \( 9.9243 knots\))110.5 600 Q 2.5
-(Heading: 97.2000)5 F(de)2.5 E(grees)-.15 E(Sonar Depth:)110.5 612 Q
-(0.0000 m)10 E(Sonar Altitude: 4920.0000 m)5 E(End of Data:)110.5 636 Q
--.35(Ti)110.5 648 S 2.5(me: 08).35 F(14 1993 19:14:58.000000)2.5 E
-(JD226)5 E 2.5(Lon: \25549.1111)110.5 660 R 5(Lat: 12.1149)12.5 F 2.5
-(Depth: 5021.0000)12.5 F(meters)2.5 E
-(Speed: 17.2800 km/hr \( 9.3405 knots\))110.5 672 Q 2.5
-(Heading: 97.0000)5 F(de)2.5 E(grees)-.15 E(Sonar Depth:)110.5 684 Q
-(0.0000 m)10 E(Sonar Altitude: 5021.0000 m)5 E(Limits:)110.5 708 Q
-(Minimum Longitude:)110.5 720 Q 5(\25549.3061 Maximum)12.5 F 10
-(Longitude: \25549.1064)2.5 F(MB-System 5.0)72 768 Q 2.5(3J)146.495 G
-(une 2013)-2.5 E(5)204.835 E 0 Cg EP
-%%Page: 6 6
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbinfo\(1\) MB-System)72 48 R 159.28
-(5.0 mbinfo\(1\))2.5 F(Minimum Latitude:)110.5 84 Q 5(12.0750 Maximum)
-17.5 F 15(Latitude: 12.1806)2.5 F(Minimum Sonar Depth:)110.5 96 Q 5
-(0.0000 Maximum)12.5 F(Sonar Depth:)2.5 E(0.0000)12.5 E
-(Minimum Altitude:)110.5 108 Q 5(4087.0000 Maximum)12.5 F 10
-(Altitude: 5034.0000)2.5 F(Minimum Depth:)110.5 120 Q 5
-(3726.0000 Maximum)20 F 17.5(Depth: 5190.0000)2.5 F(Minimum Amplitude:)
-110.5 132 Q 5(100.0000 Maximum)12.5 F 7.5(Amplitude: 6380.0000)2.5 F
-(Beam Bath)110.5 156 Q(ymetry V)-.05 E(ariances:)-1.11 E(Pings A)110.5
-168 Q -.15(ve)-.74 G(raged: 5).15 E 10(Beam N)113 180 R 10(Mean V)15 F
-7.5(ariance Sigma)-1.11 F 10(\255--- \255)113 192 R 10
-(\255--- \255-------)15 F(\255----)10 E -15 15(00 0)118 204 T 15
-(.00 0.00)-15 F(0.00)15 E -15 15(10 0)118 216 T 15(.00 0.00)-15 F(0.00)
-15 E 10(21)118 228 S 7.5(10 4719.59)-10 F 10(342.69 18.51)12.5 F 10(31)
-118 240 S 7.5(05 4779.49)-10 F 10(399.15 19.98)12.5 F 10(41)118 252 S
-7.5(55 4748.81)-10 F 10(280.18 16.74)12.5 F 10(51)118 264 S 7.5
-(55 4817.12)-10 F 10(194.62 13.95)12.5 F 10(61)118 276 S 7.5(50 4826.44)
--10 F 10(197.76 14.06)12.5 F 10(71)118 288 S 7.5(60 4863.82)-10 F 10
-(155.50 12.47)12.5 F 10(82)118 300 S 7.5(15 4806.08)-10 F 10
-(229.11 15.14)12.5 F 10(92)118 312 S 7.5(35 4807.09)-10 F 10
-(220.23 14.84)12.5 F 7.5(10 240 4766.29)115.5 324 R 10(158.83 12.60)12.5
-F 7.5(11 250 4764.34)115.5 336 R 10(221.09 14.87)12.5 F 7.5
-(12 245 4765.35)115.5 348 R 10(146.24 12.09)12.5 F 7.5(13 250 4782.02)
-115.5 360 R 10(167.34 12.94)12.5 F 7.5(14 240 4798.38)115.5 372 R 12.5
-(92.98 9.64)15 F 7.5(15 245 4775.16)115.5 384 R 12.5(98.27 9.91)15 F 7.5
-(16 225 4782.35)115.5 396 R 10(136.30 11.67)12.5 F 7.5(17 210 4820.37)
-115.5 408 R 12.5(80.70 8.98)15 F 7.5(18 215 4821.15)115.5 420 R 12.5
-(80.97 9.00)15 F 7.5(19 215 4827.71)115.5 432 R 12.5(76.20 8.73)15 F 7.5
-(20 195 4842.65)115.5 444 R 12.5(84.22 9.18)15 F 7.5(21 190 4843.02)
-115.5 456 R 10(155.87 12.48)12.5 F 7.5(22 185 4884.28)115.5 468 R 12.5
-(73.69 8.58)15 F 7.5(23 175 4885.21)115.5 480 R 12.5(69.88 8.36)15 F 7.5
-(24 175 4871.47)115.5 492 R 12.5(52.01 7.21)15 F 7.5(25 180 4871.92)
-115.5 504 R 12.5(34.71 5.89)15 F 7.5(26 200 4830.80)115.5 516 R 12.5
-(36.83 6.07)15 F 7.5(27 205 4835.16)115.5 528 R 12.5(33.47 5.79)15 F 7.5
-(28 210 4809.96)115.5 540 R 12.5(43.07 6.56)15 F 7.5(29 190 4850.77)
-115.5 552 R 12.5(40.97 6.40)15 F 7.5(30 240 4768.69)115.5 564 R 12.5
-(64.23 8.01)15 F 7.5(31 240 4772.90)115.5 576 R 12.5(74.44 8.63)15 F 7.5
-(32 245 4760.11)115.5 588 R 12.5(57.97 7.61)15 F 7.5(33 255 4734.01)
-115.5 600 R 12.5(81.72 9.04)15 F 7.5(34 255 4728.19)115.5 612 R 12.5
-(82.21 9.07)15 F 7.5(35 260 4722.94)115.5 624 R 12.5(83.45 9.14)15 F 7.5
-(36 260 4721.95)115.5 636 R 10(102.02 10.10)12.5 F 7.5(37 260 4713.48)
-115.5 648 R 12.5(83.85 9.16)15 F 7.5(38 250 4715.40)115.5 660 R 10
-(101.33 10.07)12.5 F 7.5(39 255 4722.56)115.5 672 R 10(118.20 10.87)12.5
-F 7.5(40 250 4727.48)115.5 684 R 10(109.13 10.45)12.5 F 7.5
-(41 255 4734.96)115.5 696 R 10(127.97 11.31)12.5 F 7.5(42 255 4724.53)
-115.5 708 R 10(124.06 11.14)12.5 F 7.5(43 230 4744.74)115.5 720 R 10
-(122.96 11.09)12.5 F(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)
--2.5 E(6)204.835 E 0 Cg EP
-%%Page: 7 7
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 159.28(mbinfo\(1\) MB-System)72 48 R 159.28
-(5.0 mbinfo\(1\))2.5 F 7.5(44 225 4752.16)115.5 84 R 12.5(98.22 9.91)15
-F 7.5(45 230 4692.27)115.5 96 R 10(107.96 10.39)12.5 F 7.5
-(46 240 4696.93)115.5 108 R 12.5(95.93 9.79)15 F 7.5(47 230 4699.80)
-115.5 120 R 10(129.08 11.36)12.5 F 7.5(48 225 4696.32)115.5 132 R 10
-(145.20 12.05)12.5 F 7.5(49 220 4681.50)115.5 144 R 10(140.29 11.84)12.5
-F 7.5(50 210 4676.16)115.5 156 R 10(103.35 10.17)12.5 F 7.5
-(51 180 4627.31)115.5 168 R 10(105.22 10.26)12.5 F 7.5(52 200 4654.55)
-115.5 180 R 10(207.85 14.42)12.5 F 7.5(53 130 4665.82)115.5 192 R 10
-(250.97 15.84)12.5 F 7.5(54 185 4704.29)115.5 204 R 10(300.80 17.34)12.5
-F 7.5(55 135 4731.13)115.5 216 R 10(218.16 14.77)12.5 F 7.5
-(56 150 4736.29)115.5 228 R 10(178.16 13.35)12.5 F 7.5(57 115 4691.45)
-115.5 240 R 10(217.31 14.74)12.5 F 12.5(58 0)115.5 252 R 15(0.00 0.00)
-17.5 F(0.00)15 E/F1 10.95/Times-Bold at 0 SF(SEE ALSO)72 280.8 Q/F2 10
-/Times-Bold at 0 SF(mbsystem)108 292.8 Q F0(\(1\))A F1 -.11(BU)72 321.6 S
-(GS).11 E F0(No b)108 333.6 Q(ugs, only features. Maybe too man)-.2 E
-2.5(yf)-.15 G(eatures...)-2.5 E(MB-System 5.0)72 768 Q 2.5(3J)146.495 G
-(une 2013)-2.5 E(7)204.835 E 0 Cg EP
-%%Trailer
-end
-%%EOF
diff --git a/src/ps/mbio.ps b/src/ps/mbio.ps
deleted file mode 100644
index fc9a06a..0000000
--- a/src/ps/mbio.ps
+++ /dev/null
@@ -1,4344 +0,0 @@
-%!PS-Adobe-3.0
-%%Creator: groff version 1.19.2
-%%CreationDate: Wed Jul  1 12:29:31 2015
-%%DocumentNeededResources: font Times-Roman
-%%+ font Times-Bold
-%%+ font Times-Italic
-%%DocumentSuppliedResources: procset grops 1.19 2
-%%Pages: 64
-%%PageOrder: Ascend
-%%DocumentMedia: Default 612 792 0 () ()
-%%Orientation: Portrait
-%%EndComments
-%%BeginDefaults
-%%PageMedia: Default
-%%EndDefaults
-%%BeginProlog
-%%BeginResource: procset grops 1.19 2
-%!PS-Adobe-3.0 Resource-ProcSet
-/setpacking where{
-pop
-currentpacking
-true setpacking
-}if
-/grops 120 dict dup begin
-/SC 32 def
-/A/show load def
-/B{0 SC 3 -1 roll widthshow}bind def
-/C{0 exch ashow}bind def
-/D{0 exch 0 SC 5 2 roll awidthshow}bind def
-/E{0 rmoveto show}bind def
-/F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def
-/G{0 rmoveto 0 exch ashow}bind def
-/H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/I{0 exch rmoveto show}bind def
-/J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def
-/K{0 exch rmoveto 0 exch ashow}bind def
-/L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/M{rmoveto show}bind def
-/N{rmoveto 0 SC 3 -1 roll widthshow}bind def
-/O{rmoveto 0 exch ashow}bind def
-/P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/Q{moveto show}bind def
-/R{moveto 0 SC 3 -1 roll widthshow}bind def
-/S{moveto 0 exch ashow}bind def
-/T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/SF{
-findfont exch
-[exch dup 0 exch 0 exch neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/MF{
-findfont
-[5 2 roll
-0 3 1 roll
-neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/level0 0 def
-/RES 0 def
-/PL 0 def
-/LS 0 def
-/MANUAL{
-statusdict begin/manualfeed true store end
-}bind def
-/PLG{
-gsave newpath clippath pathbbox grestore
-exch pop add exch pop
-}bind def
-/BP{
-/level0 save def
-1 setlinecap
-1 setlinejoin
-72 RES div dup scale
-LS{
-90 rotate
-}{
-0 PL translate
-}ifelse
-1 -1 scale
-}bind def
-/EP{
-level0 restore
-showpage
-}def
-/DA{
-newpath arcn stroke
-}bind def
-/SN{
-transform
-.25 sub exch .25 sub exch
-round .25 add exch round .25 add exch
-itransform
-}bind def
-/DL{
-SN
-moveto
-SN
-lineto stroke
-}bind def
-/DC{
-newpath 0 360 arc closepath
-}bind def
-/TM matrix def
-/DE{
-TM currentmatrix pop
-translate scale newpath 0 0 .5 0 360 arc closepath
-TM setmatrix
-}bind def
-/RC/rcurveto load def
-/RL/rlineto load def
-/ST/stroke load def
-/MT/moveto load def
-/CL/closepath load def
-/Fr{
-setrgbcolor fill
-}bind def
-/setcmykcolor where{
-pop
-/Fk{
-setcmykcolor fill
-}bind def
-}if
-/Fg{
-setgray fill
-}bind def
-/FL/fill load def
-/LW/setlinewidth load def
-/Cr/setrgbcolor load def
-/setcmykcolor where{
-pop
-/Ck/setcmykcolor load def
-}if
-/Cg/setgray load def
-/RE{
-findfont
-dup maxlength 1 index/FontName known not{1 add}if dict begin
-{
-1 index/FID ne{def}{pop pop}ifelse
-}forall
-/Encoding exch def
-dup/FontName exch def
-currentdict end definefont pop
-}bind def
-/DEFS 0 def
-/EBEGIN{
-moveto
-DEFS begin
-}bind def
-/EEND/end load def
-/CNT 0 def
-/level1 0 def
-/PBEGIN{
-/level1 save def
-translate
-div 3 1 roll div exch scale
-neg exch neg exch translate
-0 setgray
-0 setlinecap
-1 setlinewidth
-0 setlinejoin
-10 setmiterlimit
-[]0 setdash
-/setstrokeadjust where{
-pop
-false setstrokeadjust
-}if
-/setoverprint where{
-pop
-false setoverprint
-}if
-newpath
-/CNT countdictstack def
-userdict begin
-/showpage{}def
-/setpagedevice{}def
-}bind def
-/PEND{
-countdictstack CNT sub{end}repeat
-level1 restore
-}bind def
-end def
-/setpacking where{
-pop
-setpacking
-}if
-%%EndResource
-%%EndProlog
-%%BeginSetup
-%%BeginFeature: *PageSize Default
-<< /PageSize [ 612 792 ] /ImagingBBox null >> setpagedevice
-%%EndFeature
-%%IncludeResource: font Times-Roman
-%%IncludeResource: font Times-Bold
-%%IncludeResource: font Times-Italic
-grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72
-def/PL 792 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron/Zcaron
-/scaron/zcaron/Ydieresis/trademark/quotesingle/Euro/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/space/exclam/quotedbl/numbersign/dollar/percent
-/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen
-/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon
-/semicolon/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O
-/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright/circumflex
-/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y
-/z/braceleft/bar/braceright/tilde/.notdef/quotesinglbase/guillemotleft
-/guillemotright/bullet/florin/fraction/perthousand/dagger/daggerdbl
-/endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut
-/dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash
-/quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen
-/brokenbar/section/dieresis/copyright/ordfeminine/guilsinglleft
-/logicalnot/minus/registered/macron/degree/plusminus/twosuperior
-/threesuperior/acute/mu/paragraph/periodcentered/cedilla/onesuperior
-/ordmasculine/guilsinglright/onequarter/onehalf/threequarters
-/questiondown/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE
-/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex
-/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis
-/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn
-/germandbls/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla
-/egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis
-/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide/oslash
-/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis]def
-/Times-Italic at 0 ENC0/Times-Italic RE/Times-Bold at 0 ENC0/Times-Bold RE
-/Times-Roman at 0 ENC0/Times-Roman RE
-%%EndSetup
-%%Page: 1 1
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F/F1 10.95/Times-Bold at 0 SF -.219(NA)72 84 S(ME).219 E
-/F2 10/Times-Bold at 0 SF(mbio)108 96 Q F0 2.5<ad46>2.5 G
-(ormat independent input/output library for sw)-2.65 E
-(ath mapping sonar data.)-.1 E F1(VERSION)72 124.8 Q F0 -1.11(Ve)108
-136.8 S(rsion 5.0)1.11 E F1(DESCRIPTION)72 165.6 Q F2(MBIO)108 177.6 Q
-F0(\()3.843 E F2(M)A F0(ulti)A F2(B)A F0(eam)A F2(I)3.843 E F0(nput/)A
-F2(O)A F0 1.343
-(utput\) is a library of functions used for reading and writing sw)B
-1.342(ath mapping)-.1 F .702(sonar data \214les.)108 189.6 R F2(MBIO)
-5.702 E F0 .702(supports a lar)3.202 F .703
-(ge number of data formats associated with dif)-.18 F .703
-(ferent institutions and)-.25 F(dif)108 201.6 Q .438
-(ferent sonar systems.)-.25 F .438(The purpose of)5.438 F F2(MBIO)2.938
-E F0 .438(is to allo)2.938 F 2.937(wu)-.25 G .437
-(sers to write processing and display programs)-2.937 F 1.434
-(which are independent of particular data formats and to pro)108 213.6 R
-1.434(vide a standard approach to sw)-.15 F 1.434(ath mapping)-.1 F
-(sonar data i/o.)108 225.6 Q F1 -.548(AU)72 254.4 S(THORSHIP).548 E F0
-(Da)108 266.4 Q(vid W)-.2 E 2.5(.C)-.92 G(aress \(caress at mbari.or)-2.5 E
-(g\))-.18 E(Montere)113 278.4 Q 2.5(yB)-.15 G
-(ay Aquarium Research Institute)-2.5 E
-(Dale N. Chayes \(dale at ldeo.columbia.edu\))108 290.4 Q
-(Lamont-Doherty Earth Observ)113 302.4 Q(atory)-.25 E F1 -.383(DA)72
-331.2 S 1.972 -.986(TA T)-.657 H(ERMINOLOGY).986 E F2(MBIO)108 343.2 Q
-F0 .224(handles three types of sw)2.724 F .224(ath mapping data:)-.1 F
-.223(beam bath)5.224 F(ymetry)-.05 E 2.723(,b)-.65 G .223
-(eam amplitude, and sidescan.)-2.723 F(Both)5.223 E .173(amplitude and \
-sidescan represent measures of backscatter strength. Beam amplitudes ar\
-e backscatter v)108 355.2 R(alues)-.25 E .908
-(associated with the same preformed beams used to obtain bath)108 367.2
-R(ymetry;)-.05 E F2(MBIO)3.408 E F0 .907(assumes that a bath)3.408 F
-(ymetry)-.05 E -.25(va)108 379.2 S .138(lue e).25 F .138
-(xists for each amplitude v)-.15 F .138(alue and uses the bath)-.25 F
-.138(ymetry beam location for the amplitude.)-.05 F .139(Sidescan is)
-5.139 F .197
-(generally constructed with a higher spatial resolution than bath)108
-391.2 R(ymetry)-.05 E 2.696(,a)-.65 G .196(nd carries its o)-2.696 F
-.196(wn location parame-)-.25 F 3.811(ters. In)108 403.2 R 1.311
-(the conte)3.811 F 1.311(xt of)-.15 F F2(MB-System)3.811 E F0 1.311
-(documentation, the discrete v)3.811 F 1.312(alues of bath)-.25 F 1.312
-(ymetry and amplitude are)-.05 F .506
-(referred to as "beams", and the discrete v)108 415.2 R .506
-(alues of sidescan are referred to as "pix)-.25 F .505
-(els". An additional dif)-.15 F(fer)-.25 E(-)-.2 E .271
-(ence between "beam" and "pix)108 427.2 R .271(el" data in)-.15 F -.2
-(vo)-.4 G(lv).2 E .271
-(es data \215agging. An array of "beam\215ags" is carried by)-.15 F F2
-(MBIO)2.772 E F0 1.32(functions which allo)108 439.2 R 1.32(ws the bath)
--.25 F 1.32(ymetry \(and by e)-.05 F 1.32
-(xtension the amplitude\) data to be \215agged as bad. The)-.15 F
-(details of the beam\215agging scheme are presented belo)108 451.2 Q
--.65(w.)-.25 G F1(VERSION 5 CHANGES)72 480 Q F0 .426
-(This document describes v)108 492 R .426(ersion 5 releases of)-.15 F F2
-(MBIO)2.926 E F0 5.426(.T)C .426(he source code structure used in v)
--5.426 F .427(ersion 4)-.15 F F2(MBIO)2.927 E F0 1.46(had gro)108 504 R
-1.46(wn comple)-.25 F 3.96(xa)-.15 G 1.46(nd dif)-3.96 F 1.46
-(\214cult to support. In particular)-.25 F 3.959(,t)-.4 G 1.459
-(he addition of ne)-3.959 F 3.959(wi)-.25 G 1.459(/o modules had become)
--3.959 F -.15(ex)108 516 S(cessi).15 E -.15(ve)-.25 G .603
-(ly time consuming.).15 F(Consequently)5.604 E 3.104(,w)-.65 G 3.104(eh)
--3.104 G -2.25 -.2(av e)-3.104 H .604(restructured and re)3.304 F .604
-(written much of the library)-.25 F 5.604(.M)-.65 G(ost)-5.604 E 1.221
-(of the changes are internal, b)108 528 R 1.221(ut tw)-.2 F 6.221(of)-.1
-G 1.221(unction calls ha)-6.221 F 1.521 -.15(ve d)-.2 H 1.22
-(isappeared \().15 F F2(mb_put\(\))A F0(and)3.72 E F2(mb_write\(\))3.72
-E F0 1.22(\), and a)B(number of ne)108 540 Q 2.5(wf)-.25 G(unctions ha)
--2.5 E .3 -.15(ve b)-.2 H(een added.).15 E 3.493(Af)108 564 S .993
-(urther signi\214cant architectural change w)-3.493 F .993
-(as implemented for release 5.0.8 in order to support data for)-.1 F(-)
--.2 E .569(mats that ha)108 576 R .869 -.15(ve n)-.2 H 3.069(oe).15 G
-.569(xplicit maximum number of beams or pix)-3.219 F .568
-(els. The memory management of arrays used)-.15 F 1.486(to hold bath)108
-588 R(ymetry)-.05 E 3.986(,a)-.65 G 1.487
-(mplitude, and sidescan data has been made dynamic. No)-3.986 F 2.787
--.65(w, w)-.25 H 1.487(hen data records are).65 F .565
-(encountered that include lar)108 600 R .565
-(ger numbers of beams or pix)-.18 F .565
-(els than will \214t in the arrays pre)-.15 F .565(viously allocated,)
--.25 F .516(those arrays are reallocated to the required size. This is \
-handled automatically for all of the internal arrays)108 612 R 1.156
-(used by)108 624 R F2(MBIO)3.656 E F0 1.156
-(functions. Of course, applications using)3.656 F F2(MBIO)3.655 E F0
-1.155(must allocate arrays that are passed into)3.655 F .928
-(functions lik)108 636 R(e)-.1 E F2(mb_r)3.428 E(ead)-.18 E F0(,)A F2
-(mb_get_all)3.428 E F0 3.428(,a)C(nd)-3.428 E F2(mb_get)3.428 E F0 .928
-(to be populated by the desired data. In order for these)3.428 F .614
-(arrays to be managed dynamically)108 648 R 3.114(,t)-.65 G .614
-(he application must \214rst re)-3.114 F .613
-(gister each array by passing the location of)-.15 F
-(the array pointer to a ne)108 660 Q 2.5(wf)-.25 G(unction called)-2.5 E
-F2(mb_r)2.5 E(egister_array)-.18 E F0(.)A F1 -.548(OV)72 688.8 S(ER).548
-E(VIEW)-.602 E F2(MBIO)108 700.8 Q F0 .463(opens and initializes sonar \
-data \214les for reading and writing using the functions)2.962 F F2
-(mb_r)2.963 E(ead_init)-.18 E F0(and)2.963 E F2(mb_write_init)108 712.8
-Q F0 4.267(,r)C(especti)-4.267 E -.15(ve)-.25 G(ly).15 E 6.767(.T)-.65 G
-1.767
-(hese functions return a pointer to a data structure including all rele)
--6.767 F -.15(ve)-.25 G(nt).15 E .389(information about the opened \214\
-le, the control parameters which determine ho)108 724.8 R 2.889(wd)-.25
-G .389(ata is read or written, and)-2.889 F(MB-System 5.0)72 768 Q 2.5
-(3J)146.495 G(une 2013)-2.5 E(1)204.835 E 0 Cg EP
-%%Page: 2 2
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F .52
-(the arrays used for processing the data as it is read or written.)108
-84 R .52(This pointer is then passed to the functions)5.52 F .659
-(used for reading or writing.)108 96 R .659(There is no limit on the nu\
-mber of \214les which may be opened for reading or)5.659 F
-(writing at an)108 108 Q 2.5(yg)-.15 G -2.15 -.25(iv e)-2.5 H 2.5(nt).25
-G(ime in a program.)-2.5 E(The)108 132 Q/F1 10/Times-Bold at 0 SF(mb_r)
-4.953 E(ead_init)-.18 E F0(and)4.953 E F1(mb_write_init)4.953 E F0 2.453
-(functions also return initial maximum numbers of bath)4.953 F(ymetry)
--.05 E .54(beams, amplitude beams, and sidescan pix)108 144 R .541
-(els that can be used to allocate data storage arrays of the appro-)-.15
-F .119(priate sizes. Ho)108 156 R(we)-.25 E -.15(ve)-.25 G .919 -.4
-(r, f).15 H .119(or some data formats there are no speci\214ed maximum \
-numbers of beams and pix).4 F(els,)-.15 E .53(and so in general the req\
-uired dimensions may increase as data are read. Applications must pass \
-appropri-)108 168 R .192(ately dimensioned arrays into data e)108 180 R
-.191(xtraction routines such as)-.15 F F1(mb_r)2.691 E(ead)-.18 E F0(,)A
-F1(mb_get)2.691 E F0 2.691(,a)C(nd)-2.691 E F1(mb_get_all)2.691 E F0
-2.691(.I)C 2.691(no)-2.691 G(rder)-2.691 E .615(to enable dynamic memor\
-y management of thse application arrays, the application must \214rst r\
-e)108 192 R .615(gister each)-.15 F
-(array by passing the array pointer location to the function)108 204 Q
-F1(mb_r)2.5 E(egister_array)-.18 E F0(.)A .402
-(Data \214les are closed using the function)108 228 R F1(mb_close)2.901
-E F0 2.901(.A)C .401(ll internal and re)-2.901 F .401
-(gistered arrays are deallocated as part)-.15 F(of closing the \214le.)
-108 240 Q 1.163(When it comes to actually reading and writing sw)108 264
-R 1.164(ath mapping sonar data,)-.1 F F1(MBIO)3.664 E F0 1.164
-(has three le)3.664 F -.15(ve)-.25 G 1.164(ls of i/o).15 F
-(functionality:)108 276 Q 25.72(1: Simple)144 288 R(reading of sw)2.5 E
-(ath data \214les. The primary)-.1 E(functions are:)180 300 Q F1(mb_r)
-216 312 Q(ead\(\))-.18 E(mb_get\(\))216 324 Q F0(The positions of indi)
-180 336 Q(vidual beams and pix)-.25 E(els are)-.15 E
-(returned in longitude and latitude by)180 348 Q F1(mb_r)180 360 Q
-(ead\(\))-.18 E F0(and in acrosstrack and alongtrack)2.5 E(distances by)
-180 372 Q F1(mb_get\(\))2.5 E F0 2.5(.O)C(nly a limited set)-2.5 E
-(of na)180 384 Q(vig)-.2 E(ation information is returned. Comments)-.05
-E(are also returned. These functions can be used)180 396 Q(without an)
-180 408 Q 2.5(ys)-.15 G(pecial include)-2.5 E(\214les or an)5 E(y)-.15 E
-(kno)180 420 Q(wledge of the actual data structures used)-.25 E
-(by the data formats or)180 432 Q F1(MBIO)2.5 E F0(.)A 25.72
-(2: Complete)144 444 R(reading and writing of data structures)2.5 E
-(containing all of the a)180 456 Q -.25(va)-.2 G(ilable information.).25
-E(Data records may be read or written without)180 468 Q -.15(ex)180 480
-S(tracting an).15 E 2.5(yo)-.15 G 2.5(ft)-2.5 G(he information, or the)
--2.5 E(sw)180 492 Q(ath data may be passed with the data structure.)-.1
-E(Se)180 504 Q -.15(ve)-.25 G(ral functions e).15 E(xist to e)-.15 E
-(xtract information)-.15 E(from or insert information into the data)180
-516 Q(structures; otherwise, special include \214les)180 528 Q
-(are required to mak)180 540 Q 2.5(es)-.1 G(ense of the sonar)-2.5 E
-(-speci\214c)-.2 E(data structures passed by le)180 552 Q -.15(ve)-.25 G
-2.5(l2i).15 G(/o functions.)-2.5 E
-(The basic read and write functions that only pass)180 564 Q
-(pointers to internal data structures are:)180 576 Q F1(mb_r)216 588 Q
-(ead_ping\(\))-.18 E(mb_write_ping\(\))216 600 Q F0
-(The read and write routines which also e)180 612 Q(xtract)-.15 E
-(or insert information are:)180 624 Q F1(mb_get_all\(\))216 636 Q
-(mb_put_all\(\))216 648 Q(mb_put_comment\(\))216 660 Q F0
-(The information e)180 672 Q(xtraction and insertion)-.15 E
-(functions are:)180 684 Q F1(mb_insert\(\))216 696 Q(mb_extract\(\))216
-708 Q(mb_extract_na)216 720 Q(v\(\))-.25 E F0(MB-System 5.0)72 768 Q 2.5
-(3J)146.495 G(une 2013)-2.5 E(2)204.835 E 0 Cg EP
-%%Page: 3 3
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F/F1 10/Times-Bold at 0 SF(mb_insert_na)216 84 Q(v\(\))
--.25 E(mb_extract_altitude\(\))216 96 Q(mb_insert_altitude\(\))216 108 Q
-(mb_ttimes\(\))216 120 Q(mb_copyr)216 132 Q(ecord\(\))-.18 E F0 25.72
-(3: Buf)144 144 R(fered reading and writing of data structures)-.25 E
-(containing all of the a)180 156 Q -.25(va)-.2 G(ilable information.).25
-E(The primary functions are:)180 168 Q F1(mb_b)216 180 Q(uffer_init\(\))
--.2 E(mb_b)216 192 Q(uffer_close\(\))-.2 E(mb_b)216 204 Q
-(uffer_load\(\))-.2 E(mb_b)216 216 Q(uffer_dump\(\))-.2 E(mb_b)216 228 Q
-(uffer_inf)-.2 E(o\(\))-.25 E(mb_b)216 240 Q(uffer_get_next_data\(\))-.2
-E(mb_b)216 252 Q(uffer_extract\(\))-.2 E(mb_b)216 264 Q
-(uffer_insert\(\))-.2 E(mb_b)216 276 Q(uffer_get_next_na)-.2 E(v\(\))
--.25 E(mb_b)216 288 Q(uffer_extract_na)-.2 E(v\(\))-.25 E(mb_b)216 300 Q
-(uffer_insert_na)-.2 E(v\(\))-.25 E F0 .519(The le)108 324 R -.15(ve)
--.25 G 3.019(l1).15 G F1(MBIO)A F0 .518(functions allo)3.019 F 3.018(wu)
--.25 G .518(sers to read sonar data independent of format, with the lim\
-itation that)-3.018 F .577(only a limited set of na)108 336 R(vig)-.2 E
-.577(ation information is passed.)-.05 F .577
-(Thus, some of the information contained in certain)5.577 F .457
-(data formats \(e.g. the "hea)108 348 R -.15(ve)-.2 G 2.957("v).15 G
-.457(alue in Hydrosweep DS data\) is not passed by)-3.207 F F1(mb_r)
-2.957 E(ead\(\))-.18 E F0(or)2.957 E F1(mb_get\(\))2.957 E F0 5.457(.I)C
-(n)-5.457 E .292(general, the le)108 360 R -.15(ve)-.25 G 2.792(l1f).15
-G .293(unctions are useful for applications such as graphics which requ\
-ire only the na)-2.792 F(vig)-.2 E(ation)-.05 E
-(and the depth and/or backscatter v)108 372 Q(alues.)-.25 E .555(The le)
-108 396 R -.15(ve)-.25 G 3.055(l2f).15 G .555(unctions \()-3.055 F F1
-(mb_get_all\(\))A F0(and)3.054 E F1(mb_put_all\(\))3.054 E F0 3.054(\)r)
-C .554(ead and write the complete data structures, trans-)-3.054 F .22(\
-late the data to internal data structures associated with each of the s\
-upported sonar systems, and pass point-)108 408 R .049
-(ers to these internal data structures. Additional functions allo)108
-420 R 2.549(wav)-.25 G .048(ariety of information to be e)-2.799 F .048
-(xtracted from)-.15 F 1.794
-(or inserted into the data structures \(e.g. mb_e)108 432 R 1.795
-(xtract\(\) and mb_insert\(\)\). Additional information may be)-.15 F
-1.028(accessed using special include \214les to)108 444 R 1.028
-(decode the data structures.)6.028 F 1.028
-(The great majority of processing pro-)6.028 F(grams use le)108 456 Q
--.15(ve)-.25 G 2.5(l2f).15 G(unctions.)-2.5 E 1.076(The le)108 480 R
--.15(ve)-.25 G 3.576(l3f).15 G 1.076(unctions pro)-3.576 F 1.076(vide b)
--.15 F(uf)-.2 E 1.076(fered reading and writing which is useful for app\
-lications that generate)-.25 F 1.147
-(output \214les and need access to multiple pings at a time.)108 492 R
-1.147(In addition to reading \()6.147 F F1(mb_b)A(uffer_load\(\))-.2 E
-F0 3.646(\)a)C(nd)-3.646 E 8.79(writing \()108 504 R F1(mb_b)A
-(uffer_dump\(\))-.2 E F0 8.79(\), functions e)B 8.79(xist for e)-.15 F
-8.79(xtracting information from the b)-.15 F(uf)-.2 E(fer)-.25 E(\()108
-516 Q F1(mb_b)A(uffer_extract\(\))-.2 E F0 2.5(\)a)C
-(nd inserting information into the b)-2.5 E(uf)-.2 E(fer \()-.25 E F1
-(mb_b)A(uffer_insert\(\))-.2 E F0(\).)A F1(MBIO)108 540 Q F0 1.074
-(supports sw)3.574 F 1.074(ath data in a number of dif)-.1 F 1.073
-(ferent formats, each speci\214ed by a unique id number)-.25 F 3.573(.T)
--.55 G(he)-3.573 E(function)108 552 Q F1(mb_f)3.966 E(ormat\(\))-.25 E
-F0 1.466(determines if a format id is v)3.966 F 1.467
-(alid. A set of similar functions returns information)-.25 F 1.636
-(about the speci\214ed format \(e.g.)108 564 R F1(mb_f)4.136 E
-(ormat_description\(\))-.25 E F0(,)A F1(mb_f)4.135 E(ormat_system\(\))
--.25 E F0(,)A F1(mb_f)4.135 E(ormat_descrip-)-.25 E(tion\(\))108 576 Q
-F0(,)A F1(mb_f)2.827 E(ormat_dimensions\(\))-.25 E F0(,)A F1(mb_f)2.827
-E(ormat_\215ags\(\))-.25 E F0(,)A F1(mb_f)2.828 E(ormat_sour)-.25 E
-(ce\(\))-.18 E F0(,)A F1(mb_f)2.828 E(ormat_beamwidth\(\))-.25 E F0(\).)
-A(Some)108 600 Q F1(MB-System)2.553 E F0 .052(programs can process mult\
-iple data \214les speci\214ed in "datalist" \214les. Each line of a dat\
-al-)2.553 F .707
-(ist \214le contains a \214le path and the corresponding)108 612 R F1
-(MBIO)3.208 E F0 .708(format id. Datalist \214les can be recursi)3.208 F
-1.008 -.15(ve a)-.25 H .708(nd can).15 F 1.523
-(contain comments. The functions used to e)108 624 R 1.523
-(xtract input sw)-.15 F 1.522
-(ath data \214le paths from datalist \214les includes)-.1 F F1
-(mb_datalist_open\(\))108 636 Q F0(,)A F1(mb_datalist_r)2.5 E(ead\(\))
--.18 E F0 2.5(,a)C(nd)-2.5 E F1(mb_datalist_close\(\))2.5 E F0(.)A 3.11
-(An)108 660 S .61(umber of other)-3.11 F F1(MBIO)3.11 E F0 .61
-(functions dealing with def)3.11 F .61(ault v)-.1 F .61
-(alues for important parameters, error messages,)-.25 F
-(memory management, and time con)108 672 Q -.15(ve)-.4 G(rsions also e)
-.15 E(xist and are discussed belo)-.15 E -.65(w.)-.25 G/F2 10.95
-/Times-Bold at 0 SF(SUPPOR)72 700.8 Q(TED SW)-.438 E -1.04(AT)-1.314 G
-2.738(HS)1.04 G(ON)-2.738 E(AR SYSTEMS)-.219 E F0 .402(Each sw)108 712.8
-R .402
-(ath mapping sonar system outputs a data stream which includes some v)
--.1 F .402(alues or parameters unique)-.25 F .288(to that system.)108
-724.8 R .288(In general, a number of dif)5.288 F .288
-(ferent data formats ha)-.25 F .588 -.15(ve c)-.2 H .288
-(ome into use for data from each of the).15 F(MB-System 5.0)72 768 Q 2.5
-(3J)146.495 G(une 2013)-2.5 E(3)204.835 E 0 Cg EP
-%%Page: 4 4
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F .578(sonar systems; man)108 84 R 3.078(yo)-.15 G
-3.078(ft)-3.078 G .577
-(hese formats include only a subset of the original data stream.)-3.078
-F(Internally)5.577 E(,)-.65 E/F1 10/Times-Bold at 0 SF(MBIO)3.077 E F0 .651
-(recognizes which sonar system each data format is associated with and \
-uses a data structure including the)108 96 R .16
-(complete data stream for that sonar)108 108 R 5.16(.C)-.55 G
-(onsequently)-5.16 E 2.66(,i)-.65 G 2.659(ti)-2.66 G 2.659(sp)-2.659 G
-.159(ossible to read and write the complete data stream)-2.659 F .42
-(when using the le)108 120 R -.15(ve)-.25 G 2.92(l2o).15 G 2.92(r3)-2.92
-G F1(MBIO)A F0 2.921(functions. At)2.921 F .421
-(present, formats associated with the follo)2.921 F .421
-(wing sonars are)-.25 F(supported:)108 132 Q
-(SeaBeam "classic" 16 beam multibeam sonar)144 144 Q
-(Hydrosweep DS 59 beam multibeam sonar)144 156 Q
-(Hydrosweep MD 40 beam mid-depth multibeam)144 168 Q(sonar)180 180 Q
-(SeaBeam 2000 multibeam sonar)144 192 Q
-(SeaBeam 2112, 2120, and 2130 multibeam)144 204 Q(sonars)180 216 Q
-(Simrad EM12, EM121, EM950, and EM1000)144 228 Q(multibeam sonars)180
-240 Q(Simrad EM120, EM300, EM1002, and EM3000)144 252 Q
-(multibeam sonars)180 264 Q(Ha)144 276 Q -.1(wa)-.15 G(ii MR-1 shallo).1
-E 2.5(wt)-.25 G .5 -.25(ow i)-2.5 H(nterferometric).25 E(sonar)180 288 Q
-(ELA)144 300 Q 2.5(CB)-.4 G(ottomchart 1180 and 1050 multibeam)-2.5 E
-(sonars)180 312 Q(ELA)144 324 Q(C/SeaBeam Bottomchart Mk2 1180 and)-.4 E
-(1050 multibeam sonars)180 336 Q
-(Reson Seabat 9001/9002 multibeam sonars)144 348 Q
-(Reson Seabat 8101 multibeam sonars)144 360 Q
-(Simrad/Mesotech SM2000 multibeam sonars)144 372 Q
-(WHOI DSL AMS-120 deep to)144 384 Q 2.5(wi)-.25 G(nterferometric)-2.5 E
-36(sonar AMS-60)180 396 R(interferometric sonar)2.5 E/F2 10.95
-/Times-Bold at 0 SF(SUPPOR)72 424.8 Q(TED FORMA)-.438 E(TS)-1.04 E F0
-(The follo)108 436.8 Q(wing sw)-.25 E
-(ath mapping sonar data formats are supported in this v)-.1 E(ersion of)
--.15 E F1(MBIO)2.5 E F0(:)A(MBIO Data F)118 460.8 Q(ormat ID:)-.15 E(11)
-5 E -.15(Fo)118 472.8 S(rmat name:).15 E(MBF_SBSIOMRG)25 E
-(Informal Description: SIO mer)118 484.8 Q(ge Sea Beam)-.18 E(Attrib)118
-496.8 Q 25(utes: Sea)-.2 F(Beam, bath)2.5 E(ymetry)-.05 E 2.5(,1)-.65 G
-2.5(6b)-2.5 G(eams,)-2.5 E(binary)173 508.8 Q 2.5(,u)-.65 G
-(ncentered, SIO.)-2.5 E(MBIO Data F)118 532.8 Q(ormat ID:)-.15 E(12)5 E
--.15(Fo)118 544.8 S(rmat name:).15 E(MBF_SBSIOCEN)25 E
-(Informal Description: SIO centered Sea Beam)118 556.8 Q(Attrib)118
-568.8 Q 25(utes: Sea)-.2 F(Beam, bath)2.5 E(ymetry)-.05 E 2.5(,1)-.65 G
-2.5(9b)-2.5 G(eams,)-2.5 E(binary)173 580.8 Q 2.5(,c)-.65 G
-(entered, SIO.)-2.5 E(MBIO Data F)118 604.8 Q(ormat ID:)-.15 E(13)5 E
--.15(Fo)118 616.8 S(rmat name:).15 E(MBF_SBSIOLSI)25 E
-(Informal Description: SIO LSI Sea Beam)118 628.8 Q(Attrib)118 640.8 Q
-25(utes: Sea)-.2 F(Beam, bath)2.5 E(ymetry)-.05 E 2.5(,1)-.65 G 2.5(9b)
--2.5 G(eams,)-2.5 E(binary)173 652.8 Q 2.5(,c)-.65 G
-(entered, obsolete, SIO.)-2.5 E(MBIO Data F)118 676.8 Q(ormat ID:)-.15 E
-(14)5 E -.15(Fo)118 688.8 S(rmat name:).15 E(MBF_SB)25 E(URICEN)-.1 E
-(Informal Description: URI Sea Beam)118 700.8 Q(Attrib)118 712.8 Q 25
-(utes: Sea)-.2 F(Beam, bath)2.5 E(ymetry)-.05 E 2.5(,1)-.65 G 2.5(9b)
--2.5 G(eams,)-2.5 E(binary)173 724.8 Q 2.5(,c)-.65 G(entered, URI.)-2.5
-E(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(4)204.835 E 0
-Cg EP
-%%Page: 5 5
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F(MBIO Data F)118 84 Q(ormat ID:)-.15 E(15)5 E -.15
-(Fo)118 96 S(rmat name:).15 E(MBF_SB)25 E(URIV)-.1 E(AX)-1.35 E
-(Informal Description: URI Sea Beam from V)118 108 Q(AX)-1.35 E(Attrib)
-118 120 Q 25(utes: Sea)-.2 F(Beam, bath)2.5 E(ymetry)-.05 E 2.5(,1)-.65
-G 2.5(9b)-2.5 G(eams,)-2.5 E(binary)173 132 Q 2.5(,c)-.65 G(entered,)
--2.5 E -1.35(VA)173 144 S 2.5(Xb)1.35 G(yte order)-2.5 E 2.5(,U)-.4 G
-(RI.)-2.5 E(MBIO Data F)118 168 Q(ormat ID:)-.15 E(16)5 E -.15(Fo)118
-180 S(rmat name:).15 E(MBF_SBSIOSWB)25 E(Informal Description: SIO Sw)
-118 192 Q(ath-bath)-.1 E 2.5(yS)-.05 G(eaBeam)-2.5 E(Attrib)118 204 Q 25
-(utes: Sea)-.2 F(Beam, bath)2.5 E(ymetry)-.05 E 2.5(,1)-.65 G 2.5(9b)
--2.5 G(eams,)-2.5 E(binary)173 216 Q 2.5(,c)-.65 G(entered, SIO.)-2.5 E
-(MBIO Data F)118 240 Q(ormat ID:)-.15 E(17)5 E -.15(Fo)118 252 S
-(rmat name:).15 E(MBF_SBIFREMR)25 E(Informal Description: IFREMER Archi)
-118 264 Q .3 -.15(ve S)-.25 H(eaBeam).15 E(Attrib)118 276 Q 25
-(utes: Sea)-.2 F(Beam, bath)2.5 E(ymetry)-.05 E 2.5(,1)-.65 G 2.5(9b)
--2.5 G(eams,)-2.5 E(ascii, centered, IFREMER.)173 288 Q(MBIO Data F)118
-312 Q(ormat ID:)-.15 E(21)5 E -.15(Fo)118 324 S(rmat name:).15 E
-(MBF_HSA)25 E(TLRA)-1.11 E(W)-.9 E(Informal Description: Ra)118 336 Q
-2.5(wH)-.15 G(ydrosweep)-2.5 E(Attrib)118 348 Q 25(utes: Hydrosweep)-.2
-F(DS, bath)2.5 E(ymetry and)-.05 E(amplitude, 59 beams, ascii,)173 360 Q
-(Atlas Electronik.)173 372 Q(MBIO Data F)118 396 Q(ormat ID:)-.15 E(22)5
-E -.15(Fo)118 408 S(rmat name:).15 E(MBF_HSLDEDMB)25 E
-(Informal Description: EDMB Hydrosweep)118 420 Q(Attrib)118 432 Q 25
-(utes: Hydrosweep)-.2 F(DS, bath)2.5 E(ymetry)-.05 E(,)-.65 E
-(59 beams, binary)173 444 Q 2.5(,N)-.65 G(RL.)-2.5 E(MBIO Data F)118 468
-Q(ormat ID:)-.15 E(23)5 E -.15(Fo)118 480 S(rmat name:).15 E
-(MBF_HSURICEN)25 E(Informal Description: URI Hydrosweep)118 492 Q
-(Attrib)118 504 Q 25(utes: Hydrosweep)-.2 F(DS, 59 beams,)2.5 E(bath)173
-516 Q(ymetry)-.05 E 2.5(,b)-.65 G(inary)-2.5 E 2.5(,U)-.65 G(RI.)-2.5 E
-(MBIO Data F)118 540 Q(ormat ID:)-.15 E(24)5 E -.15(Fo)118 552 S
-(rmat name:).15 E(MBF_HSLDEOIH)25 E
-(Informal Description: L-DEO in-house binary Hydrosweep)118 564 Q
-(Attrib)118 576 Q 25(utes: Hydrosweep)-.2 F(DS, 59 beams,)2.5 E(bath)173
-588 Q(ymetry and amplitude,)-.05 E(binary)221 600 Q 2.5(,c)-.65 G
-(entered, L-DEO.)-2.5 E(MBIO Data F)118 624 Q(ormat ID:)-.15 E(25)5 E
--.15(Fo)118 636 S(rmat name:).15 E(MBF_HSURIV)25 E(AX)-1.35 E
-(Informal Description: URI Hydrosweep from V)118 648 Q(AX)-1.35 E
-(Attrib)118 660 Q 25(utes: Hydrosweep)-.2 F(DS, 59 beams,)2.5 E(bath)173
-672 Q(ymetry)-.05 E 2.5(,b)-.65 G(inary)-2.5 E 2.5(,V)-.65 G(AX byte)
--3.85 E(order)173 684 Q 2.5(,U)-.4 G(RI.)-2.5 E(MBIO Data F)118 708 Q
-(ormat ID:)-.15 E(32)5 E -.15(Fo)118 720 S(rmat name:).15 E
-(MBF_SB2000SB)25 E(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)-2.5
-E(5)204.835 E 0 Cg EP
-%%Page: 6 6
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F(Informal Description: SIO Sw)118 84 Q(ath-bath)-.1
-E 2.5(yS)-.05 G(eaBeam 2000)-2.5 E(Attrib)118 96 Q 25(utes: SeaBeam)-.2
-F(2000, bath)2.5 E(ymetry)-.05 E 2.5(,1)-.65 G(21)-2.5 E(beams, binary)
-173 108 Q 5(,S)-.65 G(IO.)-5 E(MBIO Data F)118 132 Q(ormat ID:)-.15 E
-(33)5 E -.15(Fo)118 144 S(rmat name:).15 E(MBF_SB2000SS)25 E
-(Informal Description: SIO Sw)118 156 Q(ath-bath)-.1 E 2.5(yS)-.05 G
-(eaBeam 2000)-2.5 E(Attrib)118 168 Q 25(utes: SeaBeam)-.2 F
-(2000, sidescan,)2.5 E(1000 pix)173 180 Q(els for 4-bit)-.15 E
-(sidescan, 2000 pix)173 192 Q(els for)-.15 E(12+-bit sidescan, binary)
-173 204 Q(,)-.65 E(SIO.)173 216 Q(MBIO Data F)118 240 Q(ormat ID:)-.15 E
-(41)5 E -.15(Fo)118 252 S(rmat name:).15 E(MBF_SB2100R)25 E(W)-.55 E
-(Informal Description: SeaBeam 2100 series v)118 264 Q(ender format)-.15
-E(Attrib)118 276 Q 25(utes: SeaBeam)-.2 F(2100, bath)2.5 E(ymetry)-.05 E
-(,)-.65 E(amplitude and sidescan,)173 288 Q(151 beams and 2000 pix)173
-300 Q(els,)-.15 E(ascii with binary sidescan,)173 312 Q
-(SeaBeam Instruments.)173 324 Q(MBIO Data F)118 348 Q(ormat ID:)-.15 E
-(42)5 E -.15(Fo)118 360 S(rmat name:).15 E(MBF_SB2100B1)25 E
-(Informal Description: SeaBeam 2100 series v)118 372 Q(ender format)-.15
-E(Attrib)118 384 Q 25(utes: SeaBeam)-.2 F(2100, bath)2.5 E(ymetry)-.05 E
-(,)-.65 E(amplitude and sidescan,)173 396 Q(151 beams bath)173 408 Q
-(ymetry)-.05 E(,)-.65 E(2000 pix)173 420 Q(els sidescan, binary)-.15 E
-(,)-.65 E(SeaBeam Instruments and L-DEO.)173 432 Q(MBIO Data F)118 456 Q
-(ormat ID:)-.15 E(43)5 E -.15(Fo)118 468 S(rmat name:).15 E
-(MBF_SB2100B2)25 E(Informal Description: SeaBeam 2100 series v)118 480 Q
-(ender format)-.15 E(Attrib)118 492 Q 25(utes: SeaBeam)-.2 F(2100, bath)
-2.5 E(ymetry and)-.05 E(amplitude, 151 beams bath)173 504 Q(ymetry)-.05
-E(,)-.65 E(binary)173 516 Q 2.5(,S)-.65 G(eaBeam Instruments)-2.5 E
-(and L-DEO.)173 528 Q(MBIO Data F)118 552 Q(ormat ID:)-.15 E(51)5 E -.15
-(Fo)118 564 S(rmat name:).15 E(MBF_EMOLDRA)25 E(W)-.9 E
-(Informal Description: Old Simrad v)118 576 Q(endor multibeam format)
--.15 E(Attrib)118 588 Q 25(utes: Simrad)-.2 F(EM1000, EM12S, EM12D,)2.5
-E(and EM121 multibeam sonars,)173 600 Q(bath)173 612 Q(ymetry)-.05 E 2.5
-(,a)-.65 G(mplitude, and)-2.5 E(sidescan, 60 beams for EM1000,)173 624 Q
-(81 beams for EM12S/D, 121 beams)173 636 Q(for EM121, v)173 648 Q
-(ariable pix)-.25 E(els,)-.15 E(ascii + binary)173 660 Q 2.5(,S)-.65 G
-(imrad.)-2.5 E(MBIO Data F)118 684 Q(ormat ID:)-.15 E(53)5 E -.15(Fo)118
-696 S(rmat name:).15 E(MBF_EM12IFRM)25 E
-(Informal Description: IFREMER TRISMUS format for)118 708 Q(Simrad EM12)
-173 720 Q(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(6)
-204.835 E 0 Cg EP
-%%Page: 7 7
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F(Attrib)118 84 Q 25(utes: Simrad)-.2 F
-(EM12S and EM12D,)2.5 E(bath)173 96 Q(ymetry)-.05 E 2.5(,a)-.65 G
-(mplitude, and)-2.5 E(sidescan 81 beams, v)173 108 Q(ariable)-.25 E(pix)
-173 120 Q(els, binary)-.15 E 2.5(,I)-.65 G(FREMER.)-2.5 E(MBIO Data F)
-118 144 Q(ormat ID:)-.15 E(54)5 E -.15(Fo)118 156 S(rmat name:).15 E
-(MBF_EM12D)25 E(AR)-.4 E(W)-.55 E
-(Informal Description: Simrad EM12S RRS Darwin)118 168 Q
-(processed format)173 180 Q(Attrib)118 192 Q 25(utes: Simrad)-.2 F
-(EM12S, bath)2.5 E(ymetry)-.05 E(and amplitude, 81 beams,)173 204 Q
-(binary)173 216 Q 2.5(,O)-.65 G(xford Uni)-2.5 E -.15(ve)-.25 G(rsity)
-.15 E(.)-.65 E(MBIO Data F)118 240 Q(ormat ID:)-.15 E(56)5 E -.15(Fo)118
-252 S(rmat name:).15 E(MBF_EM300RA)25 E(W)-.9 E
-(Informal Description: Simrad current multibeam)118 264 Q -.15(ve)173
-276 S(ndor format).15 E(Attrib)118 288 Q 25(utes: Simrad)-.2 F
-(EM120, EM300, EM1002,)2.5 E(EM3000, bath)173 300 Q(ymetry)-.05 E 2.5
-(,a)-.65 G(mplitude,)-2.5 E(and sidescan, up to 254 beams,)173 312 Q
--.25(va)173 324 S(riable pix).25 E(els, ascii + binary)-.15 E(,)-.65 E
-(Simrad.)173 336 Q(MBIO Data F)118 360 Q(ormat ID:)-.15 E(57)5 E -.15
-(Fo)118 372 S(rmat name:).15 E(MBF_EM300MB)25 E(A)-.35 E
-(Informal Description: Simrad multibeam processing format)118 384 Q
-(Attrib)118 396 Q 25(utes: Old)-.2 F(and ne)2.5 E 2.5(wS)-.25 G
-(imrad multibeams,)-2.5 E(EM12S, EM12D, EM121, EM120,)221 408 Q
-(EM300, EM100, EM1000, EM950,)173 420 Q(EM1002, EM3000, bath)173 432 Q
-(ymetry)-.05 E(,)-.65 E(amplitude, and sidescan,)173 444 Q
-(up to 254 beams, v)173 456 Q(ariable pix)-.25 E(els,)-.15 E
-(ascii + binary)173 468 Q 2.5(,M)-.65 G -.35(BA)-2.5 G(RI.).35 E
-(MBIO Data F)118 492 Q(ormat ID:)-.15 E(58)5 E -.15(Fo)118 504 S
-(rmat name:).15 E(MBF_EM710RA)25 E(W)-.9 E
-(Informal Description: Simrad current multibeam v)118 516 Q
-(endor format)-.15 E(Attrib)118 528 Q 25(utes: Simrad)-.2 F(EM710,)2.5 E
-(bath)173 540 Q(ymetry)-.05 E 2.5(,a)-.65 G(mplitude, and sidescan,)-2.5
-E(up to 400 beams, v)173 552 Q(ariable pix)-.25 E(els,)-.15 E(binary)221
-564 Q 2.5(,S)-.65 G(imrad.)-2.5 E(MBIO Data F)118 588 Q(ormat ID:)-.15 E
-(59)5 E -.15(Fo)118 600 S(rmat name:).15 E(MBF_EM710MB)25 E(A)-.35 E
-(Informal Description: Simrad current multibeam v)118 612 Q
-(endor format)-.15 E(Attrib)118 624 Q 25(utes: Simrad)-.2 F(EM710,)2.5 E
-(bath)173 636 Q(ymetry)-.05 E 2.5(,a)-.65 G(mplitude, and sidescan,)-2.5
-E(up to 400 beams, v)173 648 Q(ariable pix)-.25 E(els,)-.15 E(binary)221
-660 Q 2.5(,S)-.65 G(imrad.)-2.5 E(MBIO Data F)118 684 Q(ormat ID:)-.15 E
-(61)5 E -.15(Fo)118 696 S(rmat name:).15 E(MBF_MR1PRHIG)25 E
-(Informal Description: SOEST MR1 post processed format)118 708 Q(Attrib)
-118 720 Q 25(utes: SOEST)-.2 F(MR1, bath)2.5 E(ymetry and)-.05 E
-(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(7)204.835 E 0
-Cg EP
-%%Page: 8 8
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F(sidescan, v)173 84 Q(ariable beams and)-.25 E(pix)
-173 96 Q(els, xdr binary)-.15 E 2.5(,S)-.65 G(OEST)-2.5 E(,)-.74 E(Uni)
-173 108 Q -.15(ve)-.25 G(rsity of Ha).15 E -.1(wa)-.15 G(ii.).1 E
-(MBIO Data F)118 132 Q(ormat ID:)-.15 E(62)5 E -.15(Fo)118 144 S
-(rmat name:).15 E(MBF_MR1ALDEO)25 E
-(Informal Description: L-DEO MR1 post processed)118 156 Q
-(format with tra)173 168 Q -.15(ve)-.2 G 2.5(lt).15 G(imes)-2.5 E
-(Attrib)118 180 Q 25(utes: L-DEO)-.2 F(MR1, bath)2.5 E(ymetry and)-.05 E
-(sidescan, v)173 192 Q(ariable beams)-.25 E(and pix)173 204 Q
-(els, xdr binary)-.15 E 2.5(,L)-.65 G(-DEO.)-2.5 E(MBIO Data F)118 228 Q
-(ormat ID:)-.15 E(63)5 E -.15(Fo)118 240 S(rmat name:).15 E
-(MBF_MR1BLDEO)25 E(Informal Description: L-DEO small MR1 post processed)
-118 252 Q(format with tra)173 264 Q -.15(ve)-.2 G 2.5(lt).15 G(imes)-2.5
-E(Attrib)118 276 Q 25(utes: L-DEO)-.2 F(MR1, bath)2.5 E
-(ymetry and sidescan,)-.05 E -.25(va)173 288 S(riable beams and pix).25
-E(els,)-.15 E(xdr binary)173 300 Q 2.5(,L)-.65 G(-DEO.)-2.5 E
-(MBIO Data F)118 324 Q(ormat ID:)-.15 E(64)5 E -.15(Fo)118 336 S
-(rmat name:).15 E(MBF_MR1PR)25 E(VR2)-.8 E
-(Informal Description: SOEST MR1 post processed format)118 348 Q(Attrib)
-118 360 Q 25(utes: SOEST)-.2 F(MR1, bath)2.5 E(ymetry and sidescan,)-.05
-E -.25(va)173 372 S(riable beams and pix).25 E(els, xdr binary)-.15 E(,)
--.65 E(SOEST)173 384 Q 2.5(,U)-.74 G(ni)-2.5 E -.15(ve)-.25 G
-(rsity of Ha).15 E -.1(wa)-.15 G(ii.).1 E(MBIO Data F)118 408 Q
-(ormat ID:)-.15 E(71)5 E -.15(Fo)118 420 S(rmat name:).15 E
-(MBF_MBLDEOIH)25 E
-(Informal Description: L-DEO in-house generic multibeam)118 432 Q
-(Attrib)118 444 Q 25(utes: Data)-.2 F(from all sonar systems,)2.5 E
-(bath)173 456 Q(ymetry)-.05 E 2.5(,a)-.65 G(mplitude and)-2.5 E
-(sidescan, v)173 468 Q(ariable beams and)-.25 E(pix)173 480 Q
-(els, binary)-.15 E 2.5(,c)-.65 G(entered, L-DEO.)-2.5 E(MBIO Data F)118
-504 Q(ormat ID:)-.15 E(75)5 E -.15(Fo)118 516 S(rmat name:).15 E
-(MBF_MBNETCDF)25 E(Informal Description: CARAIBES CDF multibeam)118 528
-Q(Attrib)118 540 Q 25(utes: Data)-.2 F(from all sonar systems,)2.5 E
-(bath)173 552 Q(ymetry only)-.05 E 2.5(,v)-.65 G(ariable)-2.75 E
-(beams, netCDF)173 564 Q 2.5(,I)-.8 G(FREMER.)-2.5 E(MBIO Data F)118 588
-Q(ormat ID:)-.15 E(81)5 E -.15(Fo)118 600 S(rmat name:).15 E(MBF_CB)25 E
--1.11(AT)-.35 G(9001)1.11 E
-(Informal Description: Reson SeaBat 9001 shallo)118 612 Q(w)-.25 E -.1
-(wa)173 624 S(ter multibeam).1 E(Attrib)118 636 Q 25(utes: 60)-.2 F
-(beam bath)2.5 E(ymetry and)-.05 E(amplitude, binary)173 648 Q 2.5(,U)
--.65 G(ni)-2.5 E -.15(ve)-.25 G(rsity).15 E(of Ne)173 660 Q 2.5(wB)-.25
-G(runswick.)-2.5 E(MBIO Data F)118 684 Q(ormat ID:)-.15 E(82)5 E -.15
-(Fo)118 696 S(rmat name:).15 E(MBF_CB)25 E -1.11(AT)-.35 G(8101)1.11 E
-(Informal Description: Reson SeaBat 8101 shallo)118 708 Q(w)-.25 E -.1
-(wa)173 720 S(ter multibeam).1 E(MB-System 5.0)72 768 Q 2.5(3J)146.495 G
-(une 2013)-2.5 E(8)204.835 E 0 Cg EP
-%%Page: 9 9
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F(Attrib)118 84 Q 25(utes: 101)-.2 F(beam bath)2.5 E
-(ymetry and)-.05 E(amplitude, binary)173 96 Q 2.5(,S)-.65 G(eaBeam)-2.5
-E(Instruments.)173 108 Q(MBIO Data F)118 132 Q(ormat ID:)-.15 E(83)5 E
--.15(Fo)118 144 S(rmat name:).15 E(MBF_HYPC8101)25 E
-(Informal Description: Reson SeaBat 8101 shallo)118 156 Q(w)-.25 E -.1
-(wa)173 168 S(ter multibeam).1 E(Attrib)118 180 Q 25(utes: 101)-.2 F
-(beam bath)2.5 E(ymetry)-.05 E(,)-.65 E(ASCII, read-only)173 192 Q 2.5
-(,C)-.65 G(oastal)-2.5 E(Oceanographics.)173 204 Q(MBIO Data F)118 228 Q
-(ormat ID:)-.15 E(84)5 E -.15(Fo)118 240 S(rmat name:).15 E
-(MBF_XTFR8101)25 E(Informal Description: XTF format Reson SeaBat 81XX)
-118 252 Q(Attrib)118 264 Q 25(utes: 240)-.2 F(beam bath)2.5 E
-(ymetry and amplitude,)-.05 E(1024 pix)173 276 Q(el sidescan)-.15 E
-(binary)173 288 Q 2.5(,r)-.65 G(ead-only)-2.5 E(,)-.65 E -.35(Tr)173 300
-S(iton-Elics.).35 E(MBIO Data F)118 324 Q(ormat ID:)-.15 E(88)5 E -.15
-(Fo)118 336 S(rmat name:).15 E(MBF_RESON7KR)25 E
-(Informal Description: Reson 7K multibeam v)118 348 Q(endor format)-.15
-E(Attrib)118 360 Q 25(utes: Reson)-.2 F(7K series multibeam sonars,)2.5
-E(bath)173 372 Q(ymetry)-.05 E 2.5(,a)-.65 G(mplitude, three)-2.5 E
-(channels sidescan, and subbottom)173 384 Q(up to 254 beams, v)173 396 Q
-(ariable pix)-.25 E(els,)-.15 E(binary)173 408 Q 2.5(,R)-.65 G(eson.)
--2.5 E(MBIO Data F)118 432 Q(ormat ID:)-.15 E(91)5 E -.15(Fo)118 444 S
-(rmat name:).15 E(MBF_BCHR)25 E(TUNB)-.6 E
-(Informal Description: Elac BottomChart shallo)118 456 Q(w)-.25 E -.1
-(wa)173 468 S(ter multibeam).1 E(Attrib)118 480 Q 25(utes: 56)-.2 F
-(beam bath)2.5 E(ymetry and)-.05 E(amplitude, binary)173 492 Q 2.5(,U)
--.65 G(ni)-2.5 E -.15(ve)-.25 G(rsity).15 E(of Ne)173 504 Q 2.5(wB)-.25
-G(runswick.)-2.5 E(MBIO Data F)118 528 Q(ormat ID:)-.15 E(92)5 E -.15
-(Fo)118 540 S(rmat name:).15 E(MBF_ELMK2UNB)25 E
-(Informal Description: Elac BottomChart MkII shallo)118 552 Q(w)-.25 E
--.1(wa)173 564 S(ter multibeam).1 E(Attrib)118 576 Q 25(utes: 126)-.2 F
-(beam bath)2.5 E(ymetry and)-.05 E(amplitude, binary)173 588 Q 2.5(,U)
--.65 G(ni)-2.5 E -.15(ve)-.25 G(rsity).15 E(of Ne)173 600 Q 2.5(wB)-.25
-G(runswick.)-2.5 E(MBIO Data F)118 624 Q(ormat ID:)-.15 E(93)5 E -.15
-(Fo)118 636 S(rmat name:).15 E(MBF_BCHRXUNB)25 E
-(Informal Description: Elac BottomChart shallo)118 648 Q(w)-.25 E -.1
-(wa)173 660 S(ter multibeam).1 E(Attrib)118 672 Q 25(utes: 56)-.2 F
-(beam bath)2.5 E(ymetry and)-.05 E(amplitude, binary)173 684 Q 2.5(,U)
--.65 G(ni)-2.5 E -.15(ve)-.25 G(rsity).15 E(of Ne)173 696 Q 2.5(wB)-.25
-G(runswick.)-2.5 E(MBIO Data F)118 720 Q(ormat ID:)-.15 E(94)5 E
-(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(9)204.835 E 0
-Cg EP
-%%Page: 10 10
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F -.15(Fo)118 84 S(rmat name:).15 E(MBF_L3XSERA)25 E
-(W)-.9 E(Informal Description: ELA)118 96 Q(C/SeaBeam XSE v)-.4 E
-(endor format)-.15 E(Attrib)118 108 Q 25(utes: Bottomchart)-.2 F
-(MkII 50 kHz and)2.5 E(180 kHz multibeam, SeaBeam 2120)173 120 Q
-(20 KHz multibeam, bath)173 132 Q(ymetry)-.05 E(,)-.65 E
-(amplitude and sidescan, v)173 144 Q(ariable)-.25 E(beams and pix)173
-156 Q(els, binary)-.15 E 2.5(,L)-.65 G(3)-2.5 E
-(Communications \(Elac Nautik)173 168 Q(and SeaBeam Instruments\).)173
-180 Q(MBIO Data F)118 204 Q(ormat ID:)-.15 E(101)5 E -.15(Fo)118 216 S
-(rmat name:).15 E(MBF_HSMD)25 E(ARA)-.4 E(W)-.9 E
-(Informal Description: Atlas HSMD medium depth)118 228 Q(multibeam ra)
-173 240 Q 2.5(wf)-.15 G(ormat)-2.5 E(Attrib)118 252 Q 25(utes: 40)-.2 F
-(beam bath)2.5 E(ymetry)-.05 E 2.5(,1)-.65 G(60 pix)-2.5 E(el)-.15 E
-(sidescan, XDR \(binary\),)173 264 Q(STN Atlas Elektronik.)173 276 Q
-(MBIO Data F)118 300 Q(ormat ID:)-.15 E(102)5 E -.15(Fo)118 312 S
-(rmat name:).15 E(MBF_HSMDLDIH)25 E
-(Informal Description: Atlas HSMD medium depth)118 324 Q
-(multibeam processed format)173 336 Q(Attrib)118 348 Q 25(utes: 40)-.2 F
-(beam bath)2.5 E(ymetry)-.05 E 2.5(,1)-.65 G(60 pix)-2.5 E(el)-.15 E
-(sidescan, XDR \(binary\), L-DEO.)173 360 Q(MBIO Data F)118 384 Q
-(ormat ID:)-.15 E(111)5 E -.15(Fo)118 396 S(rmat name:).15 E
-(MBF_DSL120SF)25 E
-(Informal Description: WHOI DSL AMS-120 processed format)118 408 Q
-(Attrib)118 420 Q 25(utes: 2048)-.2 F(beam bath)2.5 E(ymetry)-.05 E(,)
--.65 E(8192 pix)173 432 Q(el sidescan,)-.15 E(binary)173 444 Q 2.5(,s)
--.65 G(ingle \214les, WHOI DSL.)-2.5 E(MBIO Data F)118 468 Q(ormat ID:)
--.15 E(112)5 E -.15(Fo)118 480 S(rmat name:).15 E(MBF_DSL120PF)25 E
-(Informal Description: WHOI DSL AMS-120 processed)118 492 Q(format)173
-504 Q(Attrib)118 516 Q 25(utes: 2048)-.2 F(beam bath)2.5 E(ymetry)-.05 E
-(,)-.65 E(8192 pix)173 528 Q(el sidescan,)-.15 E(binary)173 540 Q 2.5
-(,p)-.65 G(arallel bath)-2.5 E(ymetry)-.05 E
-(and amplitude \214les, WHOI DSL.)173 552 Q(MBIO Data F)118 576 Q
-(ormat ID:)-.15 E(121)5 E -.15(Fo)118 588 S(rmat name:).15 E
-(MBF_GSFGENMB)25 E(Informal Description: SAIC Generic Sensor F)118 600 Q
-(ormat \(GSF\))-.15 E(Attrib)118 612 Q 25(utes: v)-.2 F(ariable beams,)
--.25 E(bath)5 E(ymetry)-.05 E(and amplitude, binary)173 624 Q(,)-.65 E
-(single \214les, SAIC.)173 636 Q(MBIO Data F)118 660 Q(ormat ID:)-.15 E
-(131)5 E -.15(Fo)118 672 S(rmat name:).15 E(MBF_MSTIFFSS)25 E
-(Informal Description: MSTIFF sidescan format)118 684 Q(Attrib)118 696 Q
-25(utes: v)-.2 F(ariable pix)-.25 E 2.5(els, sidescan,)-.15 F
-(binary TIFF v)173 708 Q(ariant,)-.25 E(single \214les, Sea Scan.)173
-720 Q(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(10)199.835
-E 0 Cg EP
-%%Page: 11 11
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F(MBIO Data F)118 84 Q(ormat ID:)-.15 E(132)5 E -.15
-(Fo)118 96 S(rmat name:).15 E(MBF_EDGJST)25 E(AR)-.93 E
-(Informal Description: Edgetech Jstar format)118 108 Q(Attrib)118 120 Q
-25(utes: v)-.2 F(ariable pix)-.25 E(els, dual frequenc)-.15 E(y)-.15 E
-(sidescan and subbottom,)173 132 Q(binary SEGY v)173 144 Q
-(ariant, single \214les,)-.25 E(lo)173 156 Q 2.5(wf)-.25 G(requenc)-2.5
-E 2.5(ys)-.15 G(idescan returned as)-2.5 E(surv)173 168 Q .3 -.15(ey d)
--.15 H(ata, Edgetech.).15 E(MBIO Data F)118 192 Q(ormat ID:)-.15 E(133)5
-E -.15(Fo)118 204 S(rmat name:).15 E(MBF_EDGJSTR2)25 E
-(Informal Description: Edgetech Jstar format)118 216 Q(Attrib)118 228 Q
-25(utes: v)-.2 F(ariable pix)-.25 E(els, dual frequenc)-.15 E(y)-.15 E
-(sidescan and subbottom,)173 240 Q(binary SEGY v)173 252 Q
-(ariant, single \214les,)-.25 E(high frequenc)173 264 Q 2.5(ys)-.15 G
-(idescan returned as)-2.5 E(surv)173 276 Q .3 -.15(ey d)-.15 H
-(ata, Edgetech.).15 E(MBIO Data F)118 312 Q(ormat ID:)-.15 E(141)5 E
--.15(Fo)118 324 S(rmat name:).15 E(MBF_OICGEOD)25 E(A)-.4 E
-(Informal Description: OIC sw)118 336 Q(ath sonar format)-.1 E(Attrib)
-118 348 Q 25(utes: v)-.2 F(ariable beam bath)-.25 E(ymetry and)-.05 E
-(amplitude, v)221 360 Q(ariable pix)-.25 E(el)-.15 E(sidescan, binary)
-173 372 Q(,)-.65 E(Oceanic Imaging Consultants)221 384 Q(MBIO Data F)118
-408 Q(ormat ID:)-.15 E(142)5 E -.15(Fo)118 420 S(rmat name:).15 E
-(MBF_OICMB)25 E(ARI)-.35 E(Informal Description: OIC-style e)118 432 Q
-(xtended sw)-.15 E(ath)-.1 E(sonar format)173 444 Q(Attrib)118 456 Q 25
-(utes: v)-.2 F(ariable beam bath)-.25 E(ymetry and)-.05 E(amplitude, v)
-173 468 Q(ariable pix)-.25 E(el)-.15 E(sidescan, binary)173 480 Q 2.5
-(,M)-.65 G -.35(BA)-2.5 G(RI).35 E(MBIO Data F)118 504 Q(ormat ID:)-.15
-E(151)5 E -.15(Fo)118 516 S(rmat name:).15 E(MBF_OMGHDCSJ)25 E
-(Informal Description: UNB OMG HDCS format)118 528 Q
-(\(the John Hughes Clark)173 540 Q 2.5(ef)-.1 G(ormat\))-2.5 E(Attrib)
-118 552 Q 25(utes: v)-.2 F(ariable beam bath)-.25 E(ymetry and)-.05 E
-(amplitude, v)173 564 Q(ariable pix)-.25 E(el)-.15 E(sidescan, binary)
-173 576 Q 2.5(,U)-.65 G(NB)-2.5 E(MBIO Data F)118 600 Q(ormat ID:)-.15 E
-(160)5 E -.15(Fo)118 612 S(rmat name:).15 E(MBF_SEGYSEGY)25 E
-(Informal Description: SEGY seismic data format)118 624 Q(Attrib)118 636
-Q 25(utes: seismic)-.2 F(or subbottom trace data,)2.5 E
-(single beam bath)173 648 Q(ymetry)-.05 E 2.5(,n)-.65 G -.2(av)-2.5 G(,)
--.45 E(binary)173 660 Q 2.5(,S)-.65 G(EG \(SIOSEIS v)-2.5 E(ariant\))
--.25 E(MBIO Data F)118 684 Q(ormat ID:)-.15 E(161)5 E -.15(Fo)118 696 S
-(rmat name:).15 E(MBF_MGD77D)25 E -1.11(AT)-.4 G
-(Informal Description: NGDC MGD77 underw)118 708 Q(ay geoph)-.1 E(ysics)
--.05 E(format)173 720 Q(MB-System 5.0)72 768 Q 2.5(3J)146.495 G
-(une 2013)-2.5 E(11)199.835 E 0 Cg EP
-%%Page: 12 12
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F(Attrib)118 84 Q 25(utes: single)-.2 F(beam bath)2.5
-E(ymetry)-.05 E 2.5(,n)-.65 G -.2(av)-2.5 G(,)-.45 E(magnetics, gra)173
-96 Q(vity)-.2 E 2.5(,a)-.65 G(scii,)-2.5 E(NO)173 108 Q(AA NGDC)-.35 E
-(MBIO Data F)118 132 Q(ormat ID:)-.15 E(162)5 E -.15(Fo)118 144 S
-(rmat name:).15 E(MBF_ASCIIXYZ)25 E
-(Informal Description: Generic XYZ sounding format)118 156 Q(Attrib)118
-168 Q 25(utes: XYZ)-.2 F(\(lon lat depth\) ASCII)2.5 E
-(soundings, generic)173 180 Q(MBIO Data F)118 204 Q(ormat ID:)-.15 E
-(163)5 E -.15(Fo)118 216 S(rmat name:).15 E(MBF_ASCIIYXZ)25 E
-(Informal Description: Generic YXZ sounding format)118 228 Q(Attrib)118
-240 Q 25(utes: YXZ)-.2 F(\(lat lon depth\) ASCII)2.5 E
-(soundings, generic)173 252 Q(MBIO Data F)118 276 Q(ormat ID:)-.15 E
-(164)5 E -.15(Fo)118 288 S(rmat name:).15 E(MBF_HYDR)22.5 E(OB93)-.4 E
-(Informal Description: NGDC binary h)118 300 Q(ydrographic)-.05 E
-(sounding format)173 312 Q(Attrib)118 324 Q 25(utes: XYZ)-.2 F
-(\(lon lat depth\) binary)2.5 E(soundings)173 336 Q(MBIO Data F)118 360
-Q(ormat ID:)-.15 E(165)5 E -.15(Fo)118 372 S(rmat name:).15 E(MBF_MB)25
-E(ARIR)-.35 E -.5(OV)-.4 G(Informal Description: MB)118 384 Q(ARI R)-.35
-E 1 -.5(OV n)-.4 H -.2(av).5 G(ig).2 E(ation format)-.05 E(Attrib)118
-396 Q 25(utes: R)-.2 F 1 -.5(OV n)-.4 H -.2(av).5 G(ig).2 E(ation, MB)
--.05 E(ARI)-.35 E(MBIO Data F)118 420 Q(ormat ID:)-.15 E(166)5 E -.15
-(Fo)118 432 S(rmat name:).15 E(MBF_MBPR)25 E(ON)-.4 E -1.35(AV)-.35 G
-(Informal Description: MB-System simple na)118 444 Q(vig)-.2 E(ation)
--.05 E(format)173 456 Q(Attrib)118 468 Q 25(utes: na)-.2 F(vig)-.2 E
-(ation, MB)-.05 E(ARI)-.35 E(MBIO Data F)118 492 Q(ormat ID:)-.15 E(167)
-5 E -.15(Fo)118 504 S(rmat name:).15 E(MBF_MBNETCDF)25 E
-(Informal Description: CARAIBES CDF na)118 516 Q(vig)-.2 E(ation)-.05 E
-(Attrib)118 528 Q 25(utes: netCDF)-.2 F 2.5(,I)-.8 G(FREMER.)-2.5 E
-(MBIO Data F)118 552 Q(ormat ID:)-.15 E(168)5 E -.15(Fo)118 564 S
-(rmat name:).15 E(MBF_ASCIIXYT)25 E
-(Informal Description: Generic XYT sounding format)118 576 Q(Attrib)118
-588 Q 25(utes: XYT)-.2 F(\(lon lat topograph)2.5 E(y\) ASCII)-.05 E
-(soundings, generic)173 600 Q(MBIO Data F)118 624 Q(ormat ID:)-.15 E
-(169)5 E -.15(Fo)118 636 S(rmat name:).15 E(MBF_ASCIIYXT)25 E
-(Informal Description: Generic YXT sounding format)118 648 Q(Attrib)118
-660 Q 25(utes: YXT)-.2 F(\(lat lon topograp)2.5 E(y\) ASCII)-.1 E
-(soundings, generic)173 672 Q(MBIO Data F)118 696 Q(ormat ID:)-.15 E
-(170)5 E -.15(Fo)118 708 S(rmat name:).15 E(MBF_MB)25 E(ARR)-.35 E -.5
-(OV)-.4 G(2).5 E(Informal Description: MB)118 720 Q(ARI R)-.35 E 1 -.5
-(OV n)-.4 H -.2(av).5 G(ig).2 E(ation format)-.05 E(MB-System 5.0)72 768
-Q 2.5(3J)146.495 G(une 2013)-2.5 E(12)199.835 E 0 Cg EP
-%%Page: 13 13
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F(Attrib)118 84 Q 25(utes: R)-.2 F 1 -.5(OV n)-.4 H
--.2(av).5 G(ig).2 E(ation, MB)-.05 E(ARI)-.35 E(MBIO Data F)118 108 Q
-(ormat ID:)-.15 E(171)5 E -.15(Fo)118 120 S(rmat name:).15 E(MBF_HS10J)
-25 E(AMS)-.6 E(Informal Description: Furuno HS-10 multibeam format,)118
-132 Q(Attrib)118 144 Q 25(utes: 45)-.2 F(beams bath)2.5 E
-(ymetry and amplitude,)-.05 E(ascii, J)173 156 Q(AMSTEC)-.6 E
-(MBIO Data F)118 180 Q(ormat ID:)-.15 E(181)5 E -.15(Fo)118 192 S
-(rmat name:).15 E(MBF_SAMESURF)25 E
-(Informal Description: SAM Electronics SURF format.)118 204 Q(Attrib)118
-216 Q 25(utes: v)-.2 F(ariable beams,)-.25 E(bath)5 E(ymetry)-.05 E(,)
--.65 E 2.5(amplitude, and)221 228 R(sidescan,)2.5 E(binary)173 240 Q
-4.439(,s)-.65 G 1.939(ingle \214les, SAM Electronics)-4.439 F 1.938
-(\(formerly Krupp-Atlas)119.376 F(Electronik\).)108 252 Q(MBIO Data F)
-118 276 Q(ormat ID:)-.15 E(182)5 E -.15(Fo)118 288 S(rmat name:).15 E
-(MBF_HSDS2RA)25 E(W)-.9 E(Informal Description: STN Atlas ra)118 300 Q
-2.5(wm)-.15 G(ultibeam format)-2.5 E(Attrib)118 312 Q 25(utes: STN)-.2 F
-(Atlas multibeam sonars,)2.5 E(Hydrosweep DS2, Hydrosweep MD,)221 324 Q
--.15(Fa)221 336 S(nsweep 10, F).15 E(answeep 20,)-.15 E(bath)221 348 Q
-(ymetry)-.05 E 2.5(,a)-.65 G(mplitude, and sidescan,)-2.5 E
-(up to 1440 beams and 4096 pix)221 360 Q(els,)-.15 E(XDR binary)221 372
-Q 2.5(,S)-.65 G(TN Atlas.)-2.5 E(MBIO Data F)118 396 Q(ormat ID:)-.15 E
-(183)5 E -.15(Fo)118 408 S(rmat name:).15 E(MBF_HSDS2LAM)25 E
-(Informal Description: L-DEO HSDS2 processing format)118 420 Q(Attrib)
-118 432 Q 25(utes: STN)-.2 F(Atlas multibeam sonars,)2.5 E
-(Hydrosweep DS2, Hydrosweep MD,)221 444 Q -.15(Fa)221 456 S
-(nsweep 10, F).15 E(answeep 20,)-.15 E(bath)221 468 Q(ymetry)-.05 E 2.5
-(,a)-.65 G(mplitude, and sidescan,)-2.5 E(up to 1440 beams and 4096 pix)
-221 480 Q(els,)-.15 E(XDR binary)221 492 Q 2.5(,L)-.65 G(-DEO.)-2.5 E
-(MBIO Data F)118 516 Q(ormat ID:)-.15 E(222)5 E -.15(Fo)118 528 S
-(rmat name:).15 E(MBF_SWPLSSXP)25 E
-(Informal Description: SEA interferometric processed data format)118 540
-Q(Attrib)118 552 Q 25(utes: Submetrix)-.2 F(Interferometers,)2.5 E(SW)
-153 564 Q -1.11(AT)-1.2 G(Hplus-L, SW)1.11 E -1.11(AT)-1.2 G
-(Hplus-M, SW)1.11 E -1.11(AT)-1.2 G(Hplus-H,)1.11 E(Bath)153 576 Q(ysw)
--.05 E(ath-1, Bath)-.1 E(ysw)-.05 E(ath-2,)-.1 E(bath)153 588 Q
-(ymetry and amplitude, SXP binary)-.05 E(.)-.65 E
-(The institutional acron)108 612 Q(yms used abo)-.15 E .3 -.15(ve h)-.15
-H -2.25 -.2(av e).15 H(the follo)2.7 E(wing meanings:)-.25 E 3.51
-(L-DEO Lamont-Doherty)144 624 R(Earth Observ)2.5 E(atory)-.25 E(MB)144
-636 Q 1.07(ARI Montere)-.35 F 2.5(yB)-.15 G
-(ay Aquarium Research Institute)-2.5 E 17.39(SIO Scripps)144 648 R
-(Institution of Oceanograph)2.5 E(y)-.05 E 6.29(WHOI W)144 660 R
-(oods Hole Oceanographic Institution)-.8 E 16.28(URI Uni)144 672 R -.15
-(ve)-.25 G(rsity of Rhode Island).15 E 13.5(NRL Na)144 684 R -.25(va)-.2
-G 2.5(lR).25 G(esearch Laboratory)-2.5 E 12.39(UNB Uni)144 696 R -.15
-(ve)-.25 G(rsity of Ne).15 E 2.5(wB)-.25 G(runswick)-2.5 E 19.06(UH Uni)
-144 708 R -.15(ve)-.25 G(rsity of Ha).15 E -.1(wa)-.15 G(ii).1 E(NO)144
-720 Q 4.97(AA National)-.35 F(Oceans and Atmospheres Agenc)2.5 E(y)-.15
-E(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(13)199.835 E 0
-Cg EP
-%%Page: 14 14
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F 5.17(NGDC National)144 84 R(Geoph)2.5 E
-(ysical Data Center)-.05 E 7.94(USGS United)144 96 R
-(States Geological Surv)2.5 E -.15(ey)-.15 G 26.16(IFREMER French)144
-108 R(go)2.5 E -.15(ve)-.15 G(rnment agenc).15 E 2.5(yr)-.15 G
-(esponsible)-2.5 E(for operation of French oceanographic)180 120 Q
-(research \215eet.)180 132 Q/F1 10.95/Times-Bold at 0 SF(FUNCTION ST)72
-160.8 Q -1.04(AT)-.986 G(US AND ERR)1.04 E(OR CODES)-.329 E F0
-(All of the)108 172.8 Q/F2 10/Times-Bold at 0 SF(MBIO)2.5 E F0
-(functions return an inte)2.5 E(ger status v)-.15 E(alue with the con)
--.25 E -.15(ve)-.4 G(ntion that:).15 E(status = 1:)144 184.8 Q(success)
-30.8 E(status = 0:)144 196.8 Q -.1(fa)30.8 G(ilure).1 E(All)108 208.8 Q
-F2(MBIO)4.112 E F0 1.613(functions also pass an error v)4.112 F 1.613
-(alue ar)-.25 F 1.613(gument which gi)-.18 F -.15(ve)-.25 G 4.113(ss).15
-G(ome)-4.113 E 1.613(what more information about)-.25 F 1.064
-(problems than the status v)108 220.8 R 3.564(alue. The)-.25 F 1.064
-(full suite of possible error v)3.564 F 1.063
-(alues and the associated error messages)-.25 F(are:)108 232.8 Q
-(error = 0:)144 244.8 Q("No error",)34.15 E(error = \2551:)144 256.8 Q
-("T)28.51 E(ime g)-.35 E(ap in data",)-.05 E(error = \2552:)144 268.8 Q
-("Data outside speci\214ed location)28.51 E(bounds",)216 280.8 Q
-(error = \2553:)144 292.8 Q("Data outside speci\214ed time interv)28.51
-E(al",)-.25 E(error = \2554:)144 304.8 Q("Ship speed too small",)28.51 E
-(error = \2555:)144 316.8 Q("Comment record",)28.51 E(error = \2556:)144
-328.8 Q("Neither a data record nor a comment)28.51 E(record",)216 340.8
-Q(error = \2557:)144 352.8 Q("Unintelligible data record",)28.51 E
-(error = \2558:)144 364.8 Q("Ignore this data",)28.51 E(error = \2559:)
-144 376.8 Q("No data requested for b)28.51 E(uf)-.2 E(fer load",)-.25 E
-(error = \25510:)144 388.8 Q("Data b)23.51 E(uf)-.2 E(fer is full",)-.25
-E(error = \25511:)144 400.8 Q("No data w)23.51 E(as loaded into the b)
--.1 E(uf)-.2 E(fer",)-.25 E(error = \25512:)144 412.8 Q("Data b)23.51 E
-(uf)-.2 E(fer is empty",)-.25 E(error = \25513:)144 424.8 Q("No data w)
-23.51 E(as dumped from the b)-.1 E(uf)-.2 E(fer")-.25 E(error = \25514:)
-144 436.8 Q("No more surv)23.51 E .3 -.15(ey d)-.15 H(ata records in b)
-.15 E(uf)-.2 E(fer")-.25 E(error = \25515:)144 448.8 Q
-("Data inconsistencies pre)23.51 E -.15(ve)-.25 G(nted).15 E
-(inserting data into storage structure")216 460.8 Q(error = 1:)144 472.8
-Q("Unable to allocate memory)34.15 E(,)-.65 E(initialization f)216 484.8
-Q(ailed",)-.1 E(error = 2:)144 496.8 Q("Unable to open \214le,)34.15 E
-(initialization f)216 508.8 Q(ailed",)-.1 E(error = 3:)144 520.8 Q
-("Ille)34.15 E -.05(ga)-.15 G 2.5(lf).05 G(ormat identi\214er)-2.5 E(,)
--.4 E(initialization f)216 532.8 Q(ailed",)-.1 E(error = 4:)144 544.8 Q
-("Read error)34.15 E 2.5(,p)-.4 G(robably end-of-\214le",)-2.5 E
-(error = 5:)144 556.8 Q("Write error",)34.15 E(error = 6:)144 568.8 Q
-("No data in speci\214ed location bounds",)34.15 E(error = 7:)144 580.8
-Q("No data in speci\214ed time interv)34.15 E(al",)-.25 E(error = 8:)144
-592.8 Q("In)34.15 E -.25(va)-.4 G(lid MBIO descriptor",).25 E
-(error = 9:)144 604.8 Q("Inconsistent usage of MBIO descriptor",)34.15 E
-(error = 10:)144 616.8 Q("No pings binned b)29.15 E(ut no f)-.2 E
-(atal error)-.1 E 2.5(-t)216 628.8 S(his should not happen!",)-2.5 E
-(error = 11:)144 640.8 Q("In)29.15 E -.25(va)-.4 G
-(lid data record type speci\214ed).25 E(for writing",)216 652.8 Q
-(error = 12:)144 664.8 Q("In)29.15 E -.25(va)-.4 G
-(lid control parameter speci\214ed).25 E(by user",)216 676.8 Q
-(error = 13:)144 688.8 Q("In)29.15 E -.25(va)-.4 G(lid b).25 E(uf)-.2 E
-(fer id",)-.25 E(error = 14:)144 700.8 Q("In)29.15 E -.25(va)-.4 G
-(lid system id \255 this should).25 E(not happen!")216 712.8 Q
-(error = 15:)144 724.8 Q
-("This data \214le is not in the speci\214ed format!")29.15 E
-(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(14)199.835 E 0
-Cg EP
-%%Page: 15 15
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F .463(In general, programs should treat ne)108 84 R
--.05(ga)-.15 G(ti).05 E .763 -.15(ve e)-.25 H .463(rror v).15 F .463
-(alues as non-f)-.25 F .464
-(atal \(reading and writing can continue\) and)-.1 F(positi)108 96 Q .3
--.15(ve e)-.25 H(rror v).15 E(alues as f)-.25 E
-(atal \(the data \214les should be closed and the program terminated\).)
--.1 E/F1 10.95/Times-Bold at 0 SF(FUNCTION VERBOSITY)72 112.8 Q F0 .595
-(All of the)108 124.8 R/F2 10/Times-Bold at 0 SF(MBIO)3.095 E F0 .595
-(functions are passed a)3.095 F/F3 10/Times-Italic at 0 SF(verbose)3.095 E
-F0 .594(parameter which controls ho)3.095 F 3.094(wm)-.25 G .594
-(uch deb)-3.094 F .594(ugging informa-)-.2 F .016
-(tion is output to standard error)108 136.8 R 5.017(.I)-.55 G(f)-5.017 E
-F3(verbose)2.517 E F0 .017(is 0 or 1, the)2.517 F F2(MBIO)2.517 E F0
-.017(functions will be silent.)2.517 F(If)5.017 E F3(verbose)2.517 E F0
-.017(is 2, then)2.517 F 1.378(each function will output information as \
-it is entered and as it returns, along with the parameter v)108 148.8 R
-(alues)-.25 E .18(passed into and returned out of the function.)108
-160.8 R .18(Greater v)5.18 F .18(alues of)-.25 F F3(verbose)2.68 E F0
-.18(will cause additional information to)2.68 F .734
-(be output, including v)108 172.8 R .734(alues at v)-.25 F .734
-(arious stages of data processing during read and write operations.)-.25
-F .733(In gen-)5.733 F(eral, programs using)108 184.8 Q F2(MBIO)2.5 E F0
-(functions should adopt the follo)2.5 E(wing v)-.25 E(erbosity con)-.15
-E -.15(ve)-.4 G(ntions:).15 E F3(verbose)144 196.8 Q F0 2.5(=0)2.5 G
-22.48(:")-2.5 G(silent" or near)-22.48 E(-"silent" e)-.2 E -.15(xe)-.15
-G(cution).15 E F3(verbose)144 208.8 Q F0 2.5(=1)2.5 G 22.48(:s)-2.5 G
-(imple output including)-22.48 E(program name, v)252 220.8 Q(ersion)-.15
-E(and simple progress updates)252 232.8 Q F3(verbose)144 244.8 Q F0
-(>= 2:)2.5 E(deb)16.84 E(ug mode with copious output)-.2 E(including e)
-252 256.8 Q -.15(ve)-.25 G(ry function call).15 E(and status listings)
-252 268.8 Q F1(INITIALIZA)72 285.6 Q(TION AND CLOSING FUNCTIONS)-1.04 E
-F0(int)108 297.6 Q F2(mb_r)2.5 E(ead_init)-.18 E F0(\()A(int)180 309.6 Q
-F3(verbose)2.5 E F0(,)A(char)180 321.6 Q F3(*\214le)2.5 E F0(,)A(int)180
-333.6 Q F3(format)2.5 E F0(,)A(int)180 345.6 Q F3(pings)2.5 E F0(,)A
-(int)180 357.6 Q F3(lon\215ip)2.5 E F0(,)A(double)180 369.6 Q F3
-(bounds[4])2.5 E F0(,)A(int)180 381.6 Q F3(btime_i[7])2.5 E F0(,)A(int)
-180 393.6 Q F3(etime_i[7])2.5 E F0(,)A(double)180 405.6 Q F3(speedmin)
-2.5 E F0(,)A(double)180 417.6 Q F3(time)2.5 E(gap)-.4 E F0(,)A(char)180
-429.6 Q F3(**mbio_ptr)2.5 E F0(,)A(double)180 441.6 Q F3(*btime_d)2.5 E
-F0(,)A(double)180 453.6 Q F3(*etime_d)2.5 E F0(,)A(int)180 465.6 Q F3
-(*beams_bath)2.5 E F0(,)A(int)180 477.6 Q F3(*beams_amp)2.5 E F0(,)A
-(int)180 489.6 Q F3(*pixels_ss)2.5 E F0(,)A(int)180 501.6 Q F3(*err)2.5
-E(or)-.45 E F0(\);)A .835(The function)108 525.6 R F2(mb_r)3.335 E
-(ead_init)-.18 E F0 .836(initializes the data \214le to be read and the\
- data structures required for reading)3.335 F(the data. The)108 537.6 Q
-F3(verbose)2.5 E F0 -.25(va)2.5 G
-(lue controls the standard error output v).25 E
-(erbosity of the function.)-.15 E(The input control parameters ha)108
-561.6 Q .3 -.15(ve t)-.2 H(he follo).15 E(wing signi\214cance:)-.25 E F3
-(\214le)144 573.6 Q F0 57(:i)C(nput \214lename)-57 E F3(format)144 585.6
-Q F0 42.55(:i)C(nput)-42.55 E F2(MBIO)2.5 E F0(data format id)2.5 E F3
-(pings)144 597.6 Q F0 47.55(:p)C(ing a)-47.55 E -.15(ve)-.2 G(raging).15
-E F3(lon\215ip)144 609.6 Q F0 43.66(:l)C(ongitude \215ipping)-43.66 E F3
-(bounds)144 621.6 Q F0 40.33(:l)C(ocation bounds of acceptable data)
--40.33 E F3(btime_i)144 633.6 Q F0 39.22(:b)C -.15(eg)-39.22 G
-(inning time of acceptable data).15 E F3(etime_i)144 645.6 Q F0 39.78
-(:e)C(nding time of acceptable data)-39.78 E F3(speedmin)144 657.6 Q F0
-67.45(:m)C(inimum ship speed of acceptable data)-67.45 E F3(time)144
-669.6 Q(gap)-.4 E F0 37.4(:m)C(aximum time allo)-37.4 E
-(wed before data g)-.25 E(ap)-.05 E .281(The format identi\214er)108
-693.6 R F3(format)2.781 E F0 .28(speci\214es which of the supported dat\
-a formats is being read or written; the cur)2.781 F(-)-.2 E
-(rently supported formats are listed in the "SUPPOR)108 705.6 Q
-(TED FORMA)-.6 E(TS" section.)-1.11 E(The)108 729.6 Q F3(pings)2.843 E
-F0 .343(parameter determines whether and ho)2.843 F 2.843(wp)-.25 G .343
-(ings are a)-2.843 F -.15(ve)-.2 G .343(raged as part of data input.).15
-F .344(This parameter)5.344 F(MB-System 5.0)72 768 Q 2.5(3J)146.495 G
-(une 2013)-2.5 E(15)199.835 E 0 Cg EP
-%%Page: 16 16
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F 1.706(is used only by the functions)108 84 R/F1 10
-/Times-Bold at 0 SF(mb_r)4.206 E(ead)-.18 E F0(and)4.206 E F1(mb_get)4.206
-E F0(;)A F1(mb_get_all)4.206 E F0(and)4.206 E F1(mb_b)4.205 E
-(uffer_load)-.2 E F0 1.705(do not a)4.205 F -.15(ve)-.2 G(rage).15 E
-3.103(pings. If)108 96 R/F2 10/Times-Italic at 0 SF(pings)3.103 E F0 3.103
-(=1)3.103 G 3.103(,t)-3.103 G .603(hen no ping a)-3.103 F -.15(ve)-.2 G
-.603
-(raging will be done and each ping read will be returned unaltered by)
-.15 F .02(the reading function.)108 108 R(If)5.02 E F2(pings)2.52 E F0
-2.52(>1)2.52 G 2.52(,t)-2.52 G .02(hen the na)-2.52 F(vig)-.2 E .019
-(ation and beam data for)-.05 F F2(pings)2.519 E F0 .019
-(pings will be read, a)2.519 F -.15(ve)-.2 G(raged,).15 E .711
-(and returned as the data for a single ping.)108 120 R(If)5.711 E F2
-(pings)3.211 E F0 3.211(=0)3.211 G 3.211(,t)-3.211 G .711
-(hen the ping a)-3.211 F -.15(ve)-.2 G .711(raging will be v).15 F .711
-(aried so that the)-.25 F 1.208(along-track distance between a)108 132 R
--.15(ve)-.2 G 1.207(raged pings is as close as possible to the across-t\
-rack distance between).15 F(beams.)108 144 Q(The)108 168 Q F2(lon\215ip)
-2.5 E F0(paramenter determines the range in which longitude v)2.5 E
-(alues are returned:)-.25 E F2(lon\215ip)144 180 Q F0 2.5<3dad>2.5 G 2.5
-(1:\255)-2.5 G(360 to)-2.5 E(0)7.5 E F2(lon\215ip)144 192 Q F0 5(=0)2.5
-G 2.5<3aad>-2.5 G(180 to 180)-2.5 E F2(lon\215ip)144 204 Q F0 5(=1)2.5 G
-10(:0)-2.5 G(to 360)-7.5 E(The)108 228 Q F2(bounds)2.987 E F0 .487
-(array sets the area within which data are desired.)2.987 F .488
-(Data which lie outside the area speci\214ed by)5.487 F F2(bounds)108
-240 Q F0 2.039(will be returned with an error by the reading function.)
-4.539 F 2.038(The functions)7.038 F F1(mb_r)4.538 E(ead)-.18 E F0(,)A F1
-(mb_get)4.538 E F0(and)4.538 E F1(mb_get_all)108 252 Q F0(use the)2.5 E
-F2(bounds)2.5 E F0(array; the function)2.5 E F1(mb_b)2.5 E(uffer_load)
--.2 E F0(does no location checking.)2.5 E F2(bounds)144 264 Q F0
-([0] : minimum longitude)A F2(bounds)144 276 Q F0
-([1] : maximum longitude)A F2(bounds)144 288 Q F0
-([2] : minimum latitude)A F2(bounds)144 300 Q F0([3] : maximum latitude)
-A(The)108 324 Q F2(btime_i)2.871 E F0 .371(array sets the desired be)
-2.871 F .371(ginning time for the data and the)-.15 F F2(etime_i)2.871 E
-F0 .371(array sets the desired ending)2.871 F 3.882(time. If)108 336 R
-1.381(the be)3.881 F 1.381
-(ginning time is earlier than the ending time, then an)-.15 F 3.881(yd)
--.15 G 1.381(ata with a time stamp before the)-3.881 F(be)108 348 Q
-1.155
-(ginning time or after the ending time will be returned with an MB_ERR)
--.15 F 1.155(OR_OUT_TIME error by the)-.4 F 1.012(reading function.)108
-360 R 1.012(If the be)6.012 F 1.012(ginning time is after the ending ti\
-me, then data with time stamps between the)-.15 F .081(ending and be)108
-372 R .082(ginning time are returned with an error)-.15 F 2.582(.T)-.55
-G .082(his scheme allo)-2.582 F .082(ws time windo)-.25 F .082
-(wing outside or inside)-.25 F 3.055(as)108 384 S .555
-(peci\214ed interv)-3.055 F 3.055(al. The)-.25 F(functions)3.055 E F1
-(mb_r)3.055 E(ead)-.18 E F0(,)A F1(mb_get)3.055 E F0(and)3.055 E F1
-(mb_get_all)3.055 E F0 .555(use the)3.055 F F2(btime_i)3.055 E F0(and)
-3.055 E F2(btime_i)3.055 E F0(arrays;)3.055 E(the function)108 396 Q F1
-(mb_b)2.5 E(uffer_load)-.2 E F0(does no time checking.)2.5 E F2(btime)
-144 408 Q F0([0] : year)A F2(btime)144 420 Q F0([1] : month)A F2(btime)
-144 432 Q F0([2] : day)A F2(btime)144 444 Q F0([3] : hour)A F2(btime)144
-456 Q F0([4] : minute)A F2(btime)144 468 Q F0([5] : second)A F2(btime)
-144 480 Q F0([6] : microsecond)A F2(etime)144 492 Q F0([0] : year)A F2
-(etime)144 504 Q F0([1] : month)A F2(etime)144 516 Q F0([2] : day)A F2
-(etime)144 528 Q F0([3] : hour)A F2(etime)144 540 Q F0([4] : minute)A F2
-(etime)144 552 Q F0([5] : second)A F2(etime)144 564 Q F0
-([6] : microsecond)A(The)108 588 Q F2(speedmin)2.873 E F0 .374
-(parameter sets the minimum acceptable ship speed for the data.)2.873 F
-.374(If the ship speed associated)5.374 F .716(with an)108 600 R 3.216
-(yp)-.15 G .716(ing is less than)-3.216 F F2(speedmin)3.216 E F0 3.216
-(,t)C .716
-(hen that data will be returned with an error by the reading function.)
--3.216 F .404(This is used to eliminate data collected while a ship is \
-on station is a simple w)108 612 R(ay)-.1 E 2.905(.T)-.65 G .405
-(he functions)-2.905 F F1(mb_r)2.905 E(ead)-.18 E F0(,)A F1(mb_get)108
-624 Q F0(and)2.5 E F1(mb_get_all)2.5 E F0(use the)2.5 E F2(speedmin)2.5
-E F0 -.25(va)2.5 G(lue; the function).25 E F1(mb_b)2.5 E(uffer_load)-.2
-E F0(does no speed checking.)2.5 E(The)108 648 Q F2(time)2.781 E(gap)-.4
-E F0 .281(parameter sets the minimum time g)2.781 F .281(ap allo)-.05 F
-.281(wed before a g)-.25 F .28(ap in the data is declared.)-.05 F .28
-(Ping a)5.28 F -.15(ve)-.2 G -.2(r-).15 G 1.191
-(aging is not done across data g)108 660 R 1.191
-(aps; an error is returned when time g)-.05 F 1.191
-(aps are encountered.)-.05 F 1.192(The functions)6.192 F F1(mb_r)108 672
-Q(ead)-.18 E F0(and)3.473 E F1(mb_get)3.473 E F0 .973(use the)3.473 F F2
-(time)3.473 E(gap)-.4 E F0 -.25(va)3.473 G .973(lue; the functions).25 F
-F1(mb_get_all)3.473 E F0(and)3.473 E F1(mb_b)3.473 E(uffer_load)-.2 E F0
-.972(do no ping)3.473 F -2.25 -.2(av e)108 684 T(raging and thus ha).2 E
-.3 -.15(ve n)-.2 H 2.5(on).15 G(eed to check for time g)-2.5 E(aps.)-.05
-E(The returned v)108 708 Q(alues are:)-.25 E F2(mbio_ptr)144 720 Q F0
-32.55(:p)C(ointer to an)-32.55 E F1(MBIO)2.5 E F0(descriptor structure)
-2.5 E(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(16)199.835
-E 0 Cg EP
-%%Page: 17 17
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F/F1 10/Times-Italic at 0 SF(btime_d)144 84 Q F0 37(:d)C
-(esired be)-37 E(ginning time in seconds)-.15 E(since 1/1/70 00:00:0)288
-96 Q F1(etime_d)144 108 Q F0 37.56(:d)C(esired ending time in seconds)
--37.56 E(since 1/1/70 00:00:0)288 120 Q F1(beams_bath)144 132 Q F0 20.89
-(:m)C(aximum number of bath)-20.89 E(ymetry beams)-.05 E F1(beams_amp)
-144 144 Q F0 21.45(:m)C(aximum number of amplitude beams)-21.45 E F1
-(pixels_ss)144 156 Q F0 33.11(:m)C(aximum number of sidescan pix)-33.11
-E(els)-.15 E F1(err)144 168 Q(or)-.45 E F0 48.56(:e)C(rror v)-48.56 E
-(alue)-.25 E .473(The structure pointed to by)108 180 R F1(mbio_ptr)
-2.973 E F0 .473
-(holds the \214le descriptor and all of the control parameters which go)
-2.973 F(v-)-.15 E .416(ern ho)108 192 R 2.916(wt)-.25 G .416
-(he data is read; this pointer must be pro)-2.916 F .416
-(vided to the functions)-.15 F/F2 10/Times-Bold at 0 SF(mb_r)2.916 E(ead)
--.18 E F0(,)A F2(mb_get)2.916 E F0(,)A F2(mb_get_all)2.915 E F0 2.915
-(,o)C(r)-2.915 E F2(mb_b)108 204 Q(uffer_load)-.2 E F0 .107
-(to read data. The v)2.606 F(alues)-.25 E F1(beams_bath)2.607 E F0(,)A
-F1(beams_amp)2.607 E F0 2.607(,a)C(nd)-2.607 E F1(pixels_ss)2.607 E F0
-.107(return initial estimates of)2.607 F .316
-(the maximum number of bath)108 216 R .316
-(ymetry and amplitude beams and sidescan pix)-.05 F .315(els, respecti)
--.15 F -.15(ve)-.25 G(ly).15 E 2.815(,t)-.65 G .315(hat the speci-)
--2.815 F .562(\214ed data format may contain. In general,)108 228 R F1
-(beams_amp)3.062 E F0 .562(will either be zero or equal to)3.062 F F1
-(beams_bath)3.063 E F0 3.063(.T)C .563(he v)-3.063 F(al-)-.25 E(ues)108
-240 Q F1(btime_d)3.292 E F0(and)3.292 E F1(etime_d)3.292 E F0(gi)3.291 E
-1.091 -.15(ve t)-.25 H .791(he desired be).15 F .791
-(ginning and end times of the data con)-.15 F -.15(ve)-.4 G .791
-(rted to seconds since).15 F(00:00:00 on January 1, 1970;)108 252 Q F2
-(MBIO)2.5 E F0(uses these units to calculate time internally)2.5 E(.)
--.65 E -.15(Fo)108 276 S 3.283(rm).15 G .783
-(ost data formats, the initial maximum beam and pix)-3.283 F .783
-(el dimensions will not change.)-.15 F(Ho)5.783 E(we)-.25 E -.15(ve)-.25
-G 1.584 -.4(r, a f).15 H -.25(ew).4 G 1.479(formats support both v)108
-288 R 1.479(ariable and arbitrarily lar)-.25 F 1.478
-(ge numbers of beams and/or pix)-.18 F 1.478(els, and so applications)
--.15 F 1.094(must be capable of handling dynamic changes in the numbers\
- of beams and pix)108 300 R 1.095(els. The arrays allocated)-.15 F .629
-(internally in the)108 312 R F1(mbio_ptr)3.129 E F0 .629
-(structure are automatically increased when necessary)3.129 F 3.128(.H)
--.65 G -.25(ow)-3.128 G -2.15 -.25(ev e).25 H 1.428 -.4(r, i).25 H 3.128
-(no).4 G .628(rder to suc-)-3.128 F 1.038(cessfully e)108 324 R 1.038
-(xtract sw)-.15 F 1.038(ath data using)-.1 F F1(mb_g)3.538 E(et)-.1 E F0
-(,)A F1(mb_g)3.538 E(et_all)-.1 E F0(,)A F1(mb_r)3.538 E(ead)-.37 E F0
-3.539(,o)C(r)-3.539 E F1(mb_e)3.539 E(xtr)-.2 E(act)-.15 E F0 3.539(,a)C
-3.539(na)-3.539 G 1.039(pplication must also)-3.539 F(pro)108 336 Q .089
-(vide pointers to arrays lar)-.15 F .089
-(ge enough to hold the current maximum numbers of bath)-.18 F .088
-(ymetry beams, ampli-)-.05 F 1.544(tude beams, and sidescan pix)108 348
-R 1.544(els. The function)-.15 F F1(mb_r)4.044 E -.4(eg)-.37 G
-(ister_ioarr).4 E(ay)-.15 E F0(allo)4.044 E 1.544(ws applications to re)
--.25 F 1.545(gister array)-.15 F .193
-(pointers so that these arrays are also dynamically allocated by)108 360
-R F1(MBIO)2.692 E F0 2.692(.R)C -.15(eg)-2.692 G .192
-(istered arrays will be managed as).15 F
-(data are read and then freed when)108 372 Q F2(mb_close)2.5 E F0
-(is called.)2.5 E 2.831(As)108 396 S .331(tatus v)-2.831 F .331
-(alue indicating success or f)-.25 F .331
-(ailure is returned; an error v)-.1 F .331(alue ar)-.25 F .332
-(gument passes more detailed infor)-.18 F(-)-.2 E
-(mation about initialization f)108 408 Q(ailures.)-.1 E
-(\255--------------------------------------------------------)108 432 Q
-(int)108 444 Q F2(mb_write_init)2.5 E F0(\()A(int)180 456 Q F1(verbose)
-2.5 E F0(,)A(char)180 468 Q F1(*\214le)2.5 E F0(,)A(int)180 480 Q F1
-(format)2.5 E F0(,)A(char)180 492 Q F1(**mbio_ptr)2.5 E F0(,)A(int)180
-504 Q F1(*beams_bath)2.5 E F0(,)A(int)180 516 Q F1(*beams_amp)2.5 E F0
-(,)A(int)180 528 Q F1(*pixels_ss)2.5 E F0(,)A(int)180 540 Q F1(*err)2.5
-E(or)-.45 E F0(\);)A .025(The function)108 564 R F2(mb_write_init)2.525
-E F0 .025(initializes the data \214le to be written and the data struct\
-ures required for writing)2.525 F(the data. The)108 576 Q F1(verbose)2.5
-E F0 -.25(va)2.5 G(lue controls the standard error output v).25 E
-(erbosity of the function.)-.15 E(The input control parameters ha)108
-600 Q .3 -.15(ve t)-.2 H(he follo).15 E(wing signi\214cance:)-.25 E F1
-(\214le)144 612 Q F0 57(:o)C(utput \214lename)-57 E F1(format)144 624 Q
-F0 42.55(:o)C(utput)-42.55 E F2(MBIO)2.5 E F0(data format id)2.5 E
-(The returned v)108 648 Q(alues are:)-.25 E F1(mbio_ptr)144 660 Q F0
-32.55(:p)C(ointer to a structure describing)-32.55 E(the output \214le)
-288 672 Q F1(beams_bath)144 684 Q F0 20.89(:m)C(aximum number of bath)
--20.89 E(ymetry beams)-.05 E F1(beams_bac)144 696 Q(k)-.2 E F0 19.99(:m)
-C(aximum number of backscatter beams)-19.99 E F1(err)144 708 Q(or)-.45 E
-F0 48.56(:e)C(rror v)-48.56 E(alue)-.25 E(MB-System 5.0)72 768 Q 2.5(3J)
-146.495 G(une 2013)-2.5 E(17)199.835 E 0 Cg EP
-%%Page: 18 18
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F .731(The structure pointed to by)108 84 R/F1 10
-/Times-Italic at 0 SF(mbio_ptr)3.232 E F0 .732
-(holds the output \214le descriptor; this pointer must be pro)3.232 F
-.732(vided to the)-.15 F(functions)108 96 Q/F2 10/Times-Bold at 0 SF
-(mb_write)3.735 E F0(,)A F2(mb_put)3.735 E F0(,)A F2(mb_put_all)3.735 E
-F0 3.735(,o)C(r)-3.735 E F2(mb_b)3.735 E(uffer_dump)-.2 E F0 1.234
-(to write data. The v)3.735 F(alues)-.25 E F1(beams_bath)3.734 E F0(,)A
-F1(beams_amp)108 108 Q F0 3.217(,a)C(nd)-3.217 E F1(pixels_ss)3.217 E F0
-.718(return the maximum number of bath)3.217 F .718
-(ymetry and amplitude beams and sidescan)-.05 F(pix)108 120 Q .516
-(els, respecti)-.15 F -.15(ve)-.25 G(ly).15 E 3.016(,t)-.65 G .516
-(hat the speci\214ed data format may contain.)-3.016 F .515(In general,)
-5.515 F F1(beams_amp)3.015 E F0 .515(will either be zero)3.015 F .745
-(or equal to)108 132 R F1(beams_bath)3.245 E F0 5.745(.I)C 3.245(no)
--5.745 G .746
-(rder to successfully write data, the calling program must pro)-3.245 F
-.746(vide pointers to)-.15 F 1.251(arrays lar)108 144 R 1.251
-(ge enough to hold)-.18 F F1(beams_bath)3.751 E F0(bath)3.751 E 1.251
-(ymetry v)-.05 F(alues,)-.25 E F1(beams_amp)3.751 E F0 1.251
-(amplitude v)3.751 F 1.25(alues, and)-.25 F F1(pixels_ss)3.75 E F0
-(sidescan v)108 156 Q(alues.)-.25 E -.15(Fo)108 180 S 3.283(rm).15 G
-.783(ost data formats, the initial maximum beam and pix)-3.283 F .783
-(el dimensions will not change.)-.15 F(Ho)5.783 E(we)-.25 E -.15(ve)-.25
-G 1.584 -.4(r, a f).15 H -.25(ew).4 G 1.479(formats support both v)108
-192 R 1.479(ariable and arbitrarily lar)-.25 F 1.478
-(ge numbers of beams and/or pix)-.18 F 1.478(els, and so applications)
--.15 F 1.094(must be capable of handling dynamic changes in the numbers\
- of beams and pix)108 204 R 1.095(els. The arrays allocated)-.15 F .629
-(internally in the)108 216 R F1(mbio_ptr)3.129 E F0 .629
-(structure are automatically increased when necessary)3.129 F 3.128(.H)
--.65 G -.25(ow)-3.128 G -2.15 -.25(ev e).25 H 1.428 -.4(r, i).25 H 3.128
-(no).4 G .628(rder to suc-)-3.128 F .33(cessfully insert modi\214ed sw)
-108 228 R .33(ath data using)-.1 F F1(mb_put)2.83 E F0(,)A F1
-(mb_put_all)2.83 E F0 2.83(,o)C(r)-2.83 E F1(mb_insert)2.83 E F0 2.83
-(,a)C 2.83(na)-2.83 G .33(pplication must also pro-)-2.83 F .042
-(vide pointers to arrays lar)108 240 R .041
-(ge enough to hold the current maximum numbers of bath)-.18 F .041
-(ymetry beams, amplitude)-.05 F .294(beams, and sidescan pix)108 252 R
-.294(els. The function)-.15 F F1(mb_r)2.794 E -.4(eg)-.37 G(ister_ioarr)
-.4 E(ay)-.15 E F0(allo)2.794 E .294(ws applications to re)-.25 F .295
-(gister array pointers)-.15 F .231
-(so that these arrays are also dynamically allocated by)108 264 R F1
-(MBIO)2.731 E F0 2.731(.R)C -.15(eg)-2.731 G .231
-(istered arrays will be managed as data are).15 F
-(read and written and then freed when)108 276 Q F2(mb_close)2.5 E F0
-(is called.)2.5 E 2.831(As)108 300 S .331(tatus v)-2.831 F .331
-(alue indicating success or f)-.25 F .331
-(ailure is returned; an error v)-.1 F .331(alue ar)-.25 F .332
-(gument passes more detailed infor)-.18 F(-)-.2 E
-(mation about initialization f)108 312 Q(ailures.)-.1 E
-(\255--------------------------------------------------------)108 336 Q
-(int)108 348 Q F2(mb_r)2.5 E(egister_array)-.18 E F0(\()A(int)180 360 Q
-F1(verbose)2.5 E F0(,)A -.2(vo)180 372 S(id *).2 E F1(mbio_ptr)A F0(,)A
-(int)180 384 Q F1(type)2.5 E F0(,)A(int)180 396 Q F1(size)2.5 E F0(,)A
--.2(vo)180 408 S(id **).2 E F1(handle)A F0(,)A(int)180 420 Q F1(*err)2.5
-E(or)-.45 E F0(\))A(Re)108 444 Q .835(gisters an array pointer *)-.15 F
-F1(handle)A F0 .835
-(so that the size of the allocated array can be managed dynamically by)
-3.335 F F2(MBIO)108 456 Q F0 5.356(.N)C .356(ote that the location)
--5.356 F F1 .356(**handle of the arr)2.856 F .357
-(ay pointer must be supplied, not the pointer value *han-)-.15 F(dle)108
-468 Q 5.283(.T)-.15 G .283
-(he pointer value *handle should initially be NULL.)-5.283 F .282
-(The type value indicates whether this arr)5.282 F .282(ay is to)-.15 F
-.231(be dimensioned accor)108 480 R .231(ding to the maximum number of \
-bathymetry beams \(type = 1\), amplitude beams \(type)-.37 F 3.082(=2)
-108 492 S .582(\), or sidescan pixels \(type = 3\). The size value indi\
-cates the size of eac)-3.082 F 3.082(he)-.15 G .582(lement arr)-3.082 F
-.582(ay in bytes \(e)-.15 F(.g)-.15 E 3.081(.a)-.15 G -.15(ch)108 504 S
-.043(ar arr).15 F .043(ay has size = 1, a short arr)-.15 F .043
-(ay has size = 2, an int arr)-.15 F .043(ay or a \215oat arr)-.15 F .043
-(ay have size = 4, and a double)-.15 F(arr)108 516 Q 2.097
-(ay has size = 8\). The arr)-.15 F 2.097(ay is associated with the)-.15
-F F2(MBIO)4.596 E F1 2.096(descriptor mbio_ptr)4.596 F 4.596(,a)-1.11 G
-2.096(nd is fr)-4.596 F 2.096(eed when)-.37 F
-(mb_close is called for this particular mbio_ptr)108 528 Q(.)-1.11 E
-(\255--------------------------------------------------------)108 552 Q
-(int)108 564 Q F2(mb_close)2.5 E F1(\()A(int verbose)180 576 Q(,)-.1 E
--.15(ch)180 588 S(ar *mbio_ptr).15 E(,)-1.11 E(int *err)180 600 Q(or\))
--.45 E .809(Closes the data \214le listed in the)108 624 R F2(MBIO)3.309
-E F1 .81(descriptor pointed to by mbio_ptr and r)3.309 F .81
-(eleases all specially allo-)-.37 F 1.103(cated memory)108 636 R 3.603
-(,i)-.55 G 1.103(ncluding all application arr)-3.603 F 1.103(ays r)-.15
-F -.4(eg)-.37 G(ister).4 E 1.103(ed using)-.37 F F2(mb_r)3.603 E
-(egister_array)-.18 E F1 3.602(.. The)B 1.102(verbose value)3.602 F
-(contr)108 648 Q .661(ols the standar)-.45 F 3.161(de)-.37 G(rr)-3.161 E
-.661(or output verbosity of the function. A status value indicating suc\
-cess or failur)-.45 F 3.162(ei)-.37 G(s)-3.162 E -.37(re)108 660 S
-(turned; an err).37 E(or value ar)-.45 E(gument passes mor)-.37 E 2.5
-(ed)-.37 G(etailed information about failur)-2.5 E(es.)-.37 E/F3 10.95
-/Times-Bold at 0 SF(LEVEL 1 FUNCTIONS)72 676.8 Q F0
-(\255--------------------------------------------------------)108 688.8
-Q(int)108 700.8 Q F2(mb_r)2.5 E(ead)-.18 E F0(\()A(int)180 712.8 Q F1
-(verbose)2.5 E F0(,)A(char)180 724.8 Q F1(*mbio_ptr)2.5 E F0(,)A
-(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(18)199.835 E 0
-Cg EP
-%%Page: 19 19
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F(int)180 84 Q/F1 10/Times-Italic at 0 SF(*kind)2.5 E F0
-(,)A(int)180 96 Q F1(*pings)2.5 E F0(,)A(int)180 108 Q F1(time_i[7])2.5
-E F0(,)A(double)180 120 Q F1(*time_d)2.5 E F0(,)A(double)180 132 Q F1
-(*navlon)2.5 E F0(,)A(double)180 144 Q F1(*navlat)2.5 E F0(,)A(double)
-180 156 Q F1(*speed)2.5 E F0(,)A(double)180 168 Q F1(*heading)2.5 E F0
-(,)A(double)180 180 Q F1(*distance)2.5 E F0(,)A(double)180 192 Q F1
-(*altitude)2.5 E F0(,)A(double)180 204 Q F1(*sonar)2.5 E(depth)-.37 E F0
-(,)A(int)180 216 Q F1(*nbath)2.5 E F0(,)A(int)180 228 Q F1(*namp)2.5 E
-F0(,)A(int)180 240 Q F1(*nss)2.5 E F0(,)A(char)180 252 Q F1(*beam\215a)
-2.5 E(g)-.1 E F0(,)A(double)180 264 Q F1(*bath)2.5 E F0(,)A(double)180
-276 Q F1(*amp)2.5 E F0(,)A(double)180 288 Q F1(*bathlon)2.5 E F0(,)A
-(double)180 300 Q F1(*bathlat)2.5 E F0(,)A(double)180 312 Q F1(*ss)2.5 E
-F0(,)A(double)180 324 Q F1(*sslon)2.5 E F0(,)A(double)180 336 Q F1
-(*sslat)2.5 E F0(,)A(char)180 348 Q F1(*comment)2.5 E F0(,)A(int)180 360
-Q F1(*err)2.5 E(or)-.45 E F0(\);)A .559(The function)108 384 R/F2 10
-/Times-Bold at 0 SF(mb_r)3.059 E(ead)-.18 E F0 .559
-(reads, processes, and returns sonar data according to the)3.059 F F2
-(MBIO)3.058 E F0 .558(descriptor pointed)3.058 F .622(to by)108 396 R F1
-(mbio_ptr)3.122 E F0 5.622(.T)C(he)-5.622 E F1(verbose)3.122 E F0 -.25
-(va)3.122 G .622(lue controls the standard error output v).25 F .623
-(erbosity of the function. A number)-.15 F .388(of dif)108 408 R .388
-(ferent data record types are recognized by)-.25 F F2(MB-System)2.888 E
-F0 2.888(,b)C(ut)-3.088 E F2(mb_r)2.888 E(ead\(\))-.18 E F0 .388
-(only returns surv)2.888 F .688 -.15(ey a)-.15 H .388(nd com-).15 F .354
-(ment data records. The)108 420 R F1(kind)2.854 E F0 -.25(va)2.854 G
-.354(lue indicates which type of record has been read.).25 F .354
-(The data is in the form of)5.354 F(bath)108 432 Q(ymetry)-.05 E 3.389
-(,a)-.65 G .889(mplitude, and sidescan v)-3.389 F .888
-(alues combined with the longitude and latitude locations of the ba-)
--.25 F(th)108 444 Q(ymetry and sidescan measurements \(amplitudes are c\
-oincident with the bath)-.05 E(ymetry\).)-.05 E(The return v)108 468 Q
-(alues are:)-.25 E F1(kind)144 480 Q F0 52(:k)C(ind of data record read)
--52 E 31(1s)288 492 S(urv)-31 E .3 -.15(ey d)-.15 H(ata).15 E 31(2c)288
-504 S(omment)-31 E 17.22(>=3 other)288 516 R(data that cannot)2.5 E
-(be passed by)324 528 Q F2(mb_r)2.5 E(ead)-.18 E F1(pings)144 540 Q F0
-47.55(:n)C(umber of pings a)-47.55 E -.15(ve)-.2 G(raged to gi).15 E .3
--.15(ve c)-.25 H(urrent data).15 E F1(time_i)144 552 Q F0 44.22(:t)C
-(ime of current ping)-44.22 E F1(time_i)216 564 Q F0([0]: year)A F1
-(time_i)216 576 Q F0([1]: month)A F1(time_i)216 588 Q F0([2]: day)A F1
-(time_i)216 600 Q F0([3]: hour)A F1(time_i)216 612 Q F0([4]: minute)A F1
-(time_i)216 624 Q F0([5]: second)A F1(time_i)216 636 Q F0
-([6]: microsecond)A F1(time_d)144 648 Q F0 42(:t)C
-(ime of current ping in seconds)-42 E(since 1/1/70 00:00:00)216 660 Q F1
-(navlon)144 672 Q F0 42(:l)C(ongitude)-42 E F1(navlat)144 684 Q F0 44.22
-(:l)C(atitude)-44.22 E F1(speed)144 696 Q F0 46.45(:s)C
-(hip speed in km/s)-46.45 E F1(heading)144 708 Q F0 37(:s)C
-(hip heading in de)-37 E(grees)-.15 E F1(distance)144 720 Q F0 71.89(:d)
-C(istance along shiptrack since last)-71.89 E(MB-System 5.0)72 768 Q 2.5
-(3J)146.495 G(une 2013)-2.5 E(19)199.835 E 0 Cg EP
-%%Page: 20 20
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F(ping in km)216 84 Q/F1 10/Times-Italic at 0 SF
-(altitude)144 96 Q F0 38.66(:a)C(ltitude of sonar abo)-38.66 E .3 -.15
-(ve s)-.15 H(ea\215oor).15 E(in m)216 108 Q F1(sonar)144 120 Q(depth)
--.37 E F0 24.59(:d)C(epth of sonar in m)-24.59 E F1(nbath)144 132 Q F0
-46.44(:n)C(umber of bath)-46.44 E(ymetry v)-.05 E(alues)-.25 E F1(namp)
-144 144 Q F0 47(:n)C(umber of amplitude v)-47 E(alues)-.25 E F1(nss)144
-156 Q F0 56.44(:n)C(umber of sidescan v)-56.44 E(alues)-.25 E F1
-(beam\215a)144 168 Q(g)-.1 E F0 68.66(:a)C(rray of bath)-68.66 E
-(ymetry \215ags)-.05 E F1(bath)144 180 Q F0 51.44(:a)C(rray of bath)
--51.44 E(ymetry v)-.05 E(alues in meters)-.25 E F1(amp)144 192 Q F0 52
-(:a)C(rray of amplitude v)-52 E(alues in unkno)-.25 E(wn units)-.25 E F1
-(bathlon)144 204 Q F0 38.66(:a)C(rray of of longitude v)-38.66 E
-(alues corresponding)-.25 E(to bath)216 216 Q(ymetry)-.05 E F1(bathlat)
-144 228 Q F0 40.88(:a)C(rray of of latitude v)-40.88 E
-(alues corresponding)-.25 E(to bath)216 240 Q(ymetry)-.05 E F1(ss)144
-252 Q F0 61.44(:a)C(rray of sidescan v)-61.44 E(alues in unkno)-.25 E
-(wn units)-.25 E F1(sslon)144 264 Q F0 48.66(:a)C
-(rray of of longitude v)-48.66 E(alues corresponding)-.25 E(to sidescan)
-216 276 Q F1(sslat)144 288 Q F0 50.88(:a)C(rray of of latitude v)-50.88
-E(alues corresponding)-.25 E(to sidescan)216 300 Q F1(comment)144 312 Q
-F0 33.12(:c)C(omment string)-33.12 E F1(err)144 324 Q(or)-.45 E F0 48.56
-(:e)C(rror v)-48.56 E(alue)-.25 E 2.776(As)108 348 S .276(tatus v)-2.776
-F .277(alue indicating success or f)-.25 F .277
-(ailure is returned; the error v)-.1 F .277(alue ar)-.25 F(gument)-.18 E
-F1(err)2.777 E(or)-.45 E F0 .277(passes more detailed)2.777 F
-(information about read f)108 360 Q(ailures.)-.1 E
-(\255--------------------------------------------------------)108 384 Q
-(int)108 396 Q/F2 10/Times-Bold at 0 SF(mb_get)2.5 E F0(\()A(int)180 408 Q
-F1(verbose)2.5 E F0(,)A(char)180 420 Q F1(*mbio_ptr)2.5 E F0(,)A(int)180
-432 Q F1(*kind)2.5 E F0(,)A(int)180 444 Q F1(*pings)2.5 E F0(,)A(int)180
-456 Q F1(time_i[7])2.5 E F0(,)A(double)180 468 Q F1(*time_d)2.5 E F0(,)A
-(double)180 480 Q F1(*navlon)2.5 E F0(,)A(double)180 492 Q F1(*navlat)
-2.5 E F0(,)A(double)180 504 Q F1(*speed)2.5 E F0(,)A(double)180 516 Q F1
-(*heading)2.5 E F0(,)A(double)180 528 Q F1(*distance)2.5 E F0(,)A
-(double)180 540 Q F1(*altitude)2.5 E F0(,)A(double)180 552 Q F1(*sonar)
-2.5 E(depth)-.37 E F0(,)A(int)180 564 Q F1(*nbath)2.5 E F0(,)A(int)180
-576 Q F1(*namp)2.5 E F0(,)A(int)180 588 Q F1(*nss)2.5 E F0(,)A(char)180
-600 Q F1(*beam\215a)2.5 E(g)-.1 E F0(,)A(double)180 612 Q F1(*bath)2.5 E
-F0(,)A(double)180 624 Q F1(*amp)2.5 E F0(,)A(double)180 636 Q F1
-(*bathacr)2.5 E(osstr)-.45 E(ac)-.15 E(k)-.2 E F0(,)A(double)180 648 Q
-F1(*bathalongtr)2.5 E(ac)-.15 E(k)-.2 E F0(,)A(double)180 660 Q F1(*ss)
-2.5 E F0(,)A(double)180 672 Q F1(*ssacr)2.5 E(osstr)-.45 E(ac)-.15 E(k)
--.2 E F0(,)A(double)180 684 Q F1(*ssalongtr)2.5 E(ac)-.15 E(k)-.2 E F0
-(,)A(char)180 696 Q F1(*comment)2.5 E F0(,)A(int)180 708 Q F1(*err)2.5 E
-(or)-.45 E F0(\);)A(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)
--2.5 E(20)199.835 E 0 Cg EP
-%%Page: 21 21
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F .269(The function)108 84 R/F1 10/Times-Bold at 0 SF
-(mb_get)2.769 E F0 .269
-(reads, processes, and returns sonar data according to the)2.769 F F1
-(MBIO)2.768 E F0 .268(descriptor pointed to)2.768 F(by)108 96 Q/F2 10
-/Times-Italic at 0 SF(mbio_ptr)3.088 E F0 5.588(.T)C(he)-5.588 E F2
-(verbose)3.088 E F0 -.25(va)3.088 G .588
-(lue controls the standard error output v).25 F .588
-(erbosity of the function. A number of)-.15 F(dif)108 108 Q .462
-(ferent data record types are recognized by)-.25 F F1(MB-System)2.962 E
-F0 2.962(,b)C(ut)-3.162 E F1(mb_get\(\))2.962 E F0 .462
-(only returns surv)2.962 F .762 -.15(ey a)-.15 H .462(nd comment).15 F
-.715(data records. The)108 120 R F2(kind)3.215 E F0 -.25(va)3.215 G .715
-(lue indicates which type of record has been read.).25 F .716
-(The data is in the form of ba-)5.716 F(th)108 132 Q(ymetry)-.05 E 2.529
-(,a)-.65 G .029(mplitude, and sidescan v)-2.529 F .028
-(alues combined with the acrosstrack and alongtrack distances relati)
--.25 F .328 -.15(ve t)-.25 H(o).15 E .378(the na)108 144 R(vig)-.2 E
-.378(ation of the bath)-.05 F .379(ymetry and sidescan measurements \(a\
-mplitudes are coincident with the bath)-.05 F(yme-)-.05 E(try v)108 156
-Q(alues\).)-.25 E(The return v)108 180 Q(alues are:)-.25 E F2(kind)144
-192 Q F0 52(:k)C(ind of data record read)-52 E 31(1s)288 204 S(urv)-31 E
-.3 -.15(ey d)-.15 H(ata).15 E 31(2c)288 216 S(omment)-31 E 17.22
-(>=3 other)288 228 R(data that cannot)2.5 E(be passed by)324 240 Q F1
-(mb_get)2.5 E F2(pings)144 252 Q F0 47.55(:n)C(umber of pings a)-47.55 E
--.15(ve)-.2 G(raged to gi).15 E .3 -.15(ve c)-.25 H(urrent data).15 E F2
-(time_i)144 264 Q F0 44.22(:t)C(ime of current ping)-44.22 E F2(time_i)
-216 276 Q F0([0]: year)A F2(time_i)216 288 Q F0([1]: month)A F2(time_i)
-216 300 Q F0([2]: day)A F2(time_i)216 312 Q F0([3]: hour)A F2(time_i)216
-324 Q F0([4]: minute)A F2(time_i)216 336 Q F0([5]: second)A F2(time_i)
-216 348 Q F0([6]: microsecond)A F2(time_d)144 360 Q F0 42(:t)C
-(ime of current ping in seconds)-42 E(since 1/1/70 00:00:00)216 372 Q F2
-(navlon)144 384 Q F0 42(:l)C(ongitude)-42 E F2(navlat)144 396 Q F0 44.22
-(:l)C(atitude)-44.22 E F2(speed)144 408 Q F0 46.45(:s)C
-(hip speed in km/s)-46.45 E F2(heading)144 420 Q F0 37(:s)C
-(hip heading in de)-37 E(grees)-.15 E F2(distance)144 432 Q F0 35.89(:d)
-C(istance along shiptrack since last)-35.89 E(ping in km)216 444 Q F2
-(altitude)144 456 Q F0 38.66(:a)C(ltitude of sonar abo)-38.66 E .3 -.15
-(ve s)-.15 H(ea\215oor).15 E(in m)216 468 Q F2(sonar)144 480 Q(depth)
--.37 E F0 24.59(:d)C(epth of sonar in m)-24.59 E F2(nbath)144 492 Q F0
-46.44(:n)C(umber of bath)-46.44 E(ymetry v)-.05 E(alues)-.25 E F2(namp)
-144 504 Q F0 47(:n)C(umber of amplitude v)-47 E(alues)-.25 E F2(nss)144
-516 Q F0 56.44(:n)C(umber of sidescan v)-56.44 E(alues)-.25 E F2
-(beam\215a)144 528 Q(g)-.1 E F0 68.66(:a)C(rray of bath)-68.66 E
-(ymetry \215ags)-.05 E F2(bath)144 540 Q F0 51.44(:a)C(rray of bath)
--51.44 E(ymetry v)-.05 E(alues in meters)-.25 E F2(amp)144 552 Q F0 52
-(:a)C(rray of amplitude v)-52 E(alues in unkno)-.25 E(wn units)-.25 E F2
-(bathacr)144 564 Q(osstr)-.45 E(ac)-.15 E(k)-.2 E F0 5.58(:a)C
-(rray of of acrosstrack distances)-5.58 E
-(in meters corresponding to bath)216 576 Q(ymetry)-.05 E F2(bathalongtr)
-144 588 Q(ac)-.15 E(k)-.2 E F0 8.46(:a)C
-(rray of of alongtrack distances)-8.46 E
-(in meters corresponding to bath)216 600 Q(ymetry)-.05 E F2(ss)144 612 Q
-F0 61.44(:a)C(rray of sidescan v)-61.44 E(alues in unkno)-.25 E
-(wn units)-.25 E F2(ssacr)144 624 Q(osstr)-.45 E(ac)-.15 E(k)-.2 E F0
-15.58(:a)C(rray of of acrosstrack distances)-15.58 E
-(in meters corresponding to sidescan)216 636 Q F2(ssacr)144 648 Q(osstr)
--.45 E(ac)-.15 E(k)-.2 E F0 15.58(:a)C(rray of of alongtrack distances)
--15.58 E(in meters corresponding to sidescan)216 660 Q F2(comment)144
-672 Q F0 69.12(:c)C(omment string)-69.12 E F2(err)144 684 Q(or)-.45 E F0
-48.56(:e)C(rror v)-48.56 E(alue)-.25 E 2.777(As)108 708 S .277(tatus v)
--2.777 F .277(alue indicating success or f)-.25 F .277
-(ailure is returned; the error v)-.1 F .277(alue ar)-.25 F(gument)-.18 E
-F2(err)2.777 E(or)-.45 E F0 .276(passes more detailed)2.777 F
-(information about read f)108 720 Q(ailures.)-.1 E(MB-System 5.0)72 768
-Q 2.5(3J)146.495 G(une 2013)-2.5 E(21)199.835 E 0 Cg EP
-%%Page: 22 22
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F/F1 10.95/Times-Bold at 0 SF(LEVEL 2 FUNCTIONS)72 84 Q
-F0(int)108 96 Q/F2 10/Times-Bold at 0 SF(mb_r)2.5 E(ead_ping)-.18 E F0(\()A
-(int)180 108 Q/F3 10/Times-Italic at 0 SF(verbose)2.5 E F0(,)A(char)180 120
-Q F3(*mbio_ptr)2.5 E F0(,)A(char)180 132 Q F3(*stor)2.5 E(e_ptr)-.37 E
-F0(,)A(int)180 144 Q F3(*kind)2.5 E F0(,)A(int)180 156 Q F3(*err)2.5 E
-(or)-.45 E F0(\);)A .464(The function)108 180 R F2(mb_r)2.964 E
-(ead_ping)-.18 E F0 .464(reads and returns sonar data according to the)
-2.964 F F2(MBIO)2.964 E F0 .464(descriptor pointed to by)2.964 F F3
-(mbio_ptr)108 192 Q F0 6.776(.T)C(he)-6.776 E F3(verbose)4.276 E F0 -.25
-(va)4.276 G 1.775(lue controls the standard error output v).25 F 1.775
-(erbosity of the function.)-.15 F 1.775(The data is)6.775 F .231
-(returned one record at a time; no a)108 204 R -.15(ve)-.2 G .231
-(raging is performed.).15 F 2.731(Ap)5.231 G .231
-(ointer to a data structure containing all of the)-2.731 F .599
-(data read is returned as)108 216 R F3(stor)3.099 E(e_ptr)-.37 E F0
-3.099(;t)C .599(he form of the data structure is determined by the sona\
-r system associ-)-3.099 F .154
-(ated with the format of the data being read. A number of dif)108 228 R
-.154(ferent data record types are recognized by)-.25 F F2(MB-)2.655 E
-(System)108 240 Q F0 2.5(;t)C(he)-2.5 E F3(kind)2.5 E F0 -.25(va)2.5 G
-(lue indicates which type of record has been read.).25 E(The return v)
-108 264 Q(alues are:)-.25 E F3(stor)144 276 Q(e_ptr)-.37 E F0 32.92(:p)C
-(ointer to complete data structure)-32.92 E F3(kind)144 288 Q F0 52(:k)C
-(ind of data record read)-52 E 31(1s)288 300 S(urv)-31 E .3 -.15(ey d)
--.15 H(ata).15 E 31(2c)288 312 S(omment)-31 E 31(3h)288 324 S(eader)-31
-E 31(4c)288 336 S(alibrate)-31 E 31(5m)288 348 S(ean sound speed)-31 E
-31(6S)288 360 S(VP)-31 E 31(7s)288 372 S(tandby)-31 E 31(8n)288 384 S .4
--.2(av s)-31 H(ource).2 E 31(9p)288 396 S(arameter)-31 E 23.5(10 start)
-288 408 R 23.5(11 stop)288 420 R 23.5(12 na)288 432 R(v)-.2 E 23.5
-(13 run)288 444 R(parameter)2.5 E 23.5(14 clock)288 456 R 23.5(15 tide)
-288 468 R 23.5(16 height)288 480 R 23.5(17 heading)288 492 R 23.5
-(18 attitude)288 504 R 23.5(19 ssv)288 516 R 23.5(20 angle)288 528 R
-23.5(21 e)288 540 R -.15(ve)-.25 G(nt).15 E 23.5(22 history)288 552 R
-23.5(23 summary)288 564 R 23.5(24 processing)288 576 R(parameters)2.5 E
-23.5(25 sensor)288 588 R(parameters)2.5 E 23.5(26 na)288 600 R(vig)-.2 E
-(ation error)-.05 E 23.5(27 uninterpretable)288 612 R(line)2.5 E F3(err)
-144 624 Q(or)-.45 E F0 48.56(:e)C(rror v)-48.56 E(alue)-.25 E 2.777(As)
-108 648 S .277(tatus v)-2.777 F .277(alue indicating success or f)-.25 F
-.277(ailure is returned; the error v)-.1 F .277(alue ar)-.25 F(gument)
--.18 E F3(err)2.777 E(or)-.45 E F0 .276(passes more detailed)2.777 F
-(information about read f)108 660 Q(ailures.)-.1 E
-(\255--------------------------------------------------------)108 684 Q
-(int)108 696 Q F2(mb_write_ping)2.5 E F0(\()A(int)180 708 Q F3(verbose)
-2.5 E F0(,)A(char)180 720 Q F3(*mbio_ptr)2.5 E F0(,)A(MB-System 5.0)72
-768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(22)199.835 E 0 Cg EP
-%%Page: 23 23
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F(char)180 84 Q/F1 10/Times-Italic at 0 SF(*stor)2.5 E
-(e_ptr)-.37 E F0(,)A(int)180 96 Q F1(*err)2.5 E(or)-.45 E F0(\);)A 1.585
-(The function)108 120 R/F2 10/Times-Bold at 0 SF(mb_write_ping)4.085 E F0
-1.585(writes sonar data to the \214le listed in the)4.085 F F2(MBIO)
-4.085 E F0 1.585(descriptor pointed to by)4.085 F F1(MBIO_ptr)108 132 Q
-F0 5.641(.T)C(he)-5.641 E F1(verbose)3.141 E F0 -.25(va)3.141 G .641
-(lue controls the standard error output v).25 F .64
-(erbosity of the function.)-.15 F 3.14(Ap)5.64 G .64(ointer to a)-3.14 F
-.622(data structure containing all of the data read is passed as)108 144
-R F1(stor)3.122 E(e_ptr)-.37 E F0 3.122(;t)C .622
-(he form of the data structure is deter)-3.122 F(-)-.2 E .9(mined by th\
-e sonar system associated with the format of the data being written.)108
-156 R .899(The v)5.899 F .899(alues to be output)-.25 F(are:)108 168 Q
-F1(stor)144 180 Q(e_ptr)-.37 E F0 32.92(:p)C
-(ointer to complete data structure)-32.92 E(The return v)108 204 Q
-(alues are:)-.25 E F1(err)144 216 Q(or)-.45 E F0 48.56(:e)C(rror v)
--48.56 E(alue)-.25 E 2.776(As)108 240 S .276(tatus v)-2.776 F .277
-(alue indicating success or f)-.25 F .277
-(ailure is returned; the error v)-.1 F .277(alue ar)-.25 F(gument)-.18 E
-F1(err)2.777 E(or)-.45 E F0 .277(passes more detailed)2.777 F
-(information about write f)108 252 Q(ailures.)-.1 E
-(\255--------------------------------------------------------)108 276 Q
-(int)108 288 Q F2(mb_get_stor)2.5 E(e)-.18 E F0(\()A(int)180 300 Q F1
-(verbose)2.5 E F0(,)A(char)180 312 Q F1(*mbio_ptr)2.5 E F0(,)A(char)180
-324 Q F1(**stor)2.5 E(e_ptr)-.37 E F0(,)A(int)180 336 Q F1(*err)2.5 E
-(or)-.45 E F0(\);)A 1.3(The function)108 360 R F2(mb_get_stor)3.8 E
-(e\(\))-.18 E F0 1.3(returns a pointer)3.8 F F1(*stor)3.799 E(e_ptr)-.37
-E F0 1.299(to the data storage structure associated with a)3.799 F
-(particular)108 372 Q F2(MBIO)3.918 E F0(descriptor)3.918 E F1(mbio_ptr)
-3.918 E F0 3.918(.T)C(he)-3.918 E F2(mb_r)3.918 E(ead_init\(\))-.18 E F0
-(and)3.918 E F2(mb_write_init\(\))3.918 E F0 1.418
-(functions both allocate)3.918 F .874(one of these internal storage str\
-uctures. The form of the data structure is determined by the sonar syst\
-em)108 384 R .232(associated with the format of the data being written.)
-108 396 R .233(Storage structure pointers must be passed to le)5.232 F
--.15(ve)-.25 G 2.733(lt).15 G -.1(wo)-2.733 G F2(MBIO)108 408 Q F0 .073
-(functions such as)2.573 F F2(mb_write_ping\(\))2.573 E F0(and)2.572 E
-F2(mb_insert\(\))2.572 E F0 5.072(.T)C(he)-5.072 E F1(verbose)2.572 E F0
--.25(va)2.572 G .072(lue controls the standard error).25 F(output v)108
-420 Q(erbosity of the function.)-.15 E(The return v)108 444 Q
-(alues are:)-.25 E F1(stor)144 456 Q(e_ptr)-.37 E F0 32.92(:p)C
-(ointer to complete data structure)-32.92 E F1(err)144 468 Q(or)-.45 E
-F0 48.56(:e)C(rror v)-48.56 E(alue)-.25 E 2.776(As)108 492 S .276
-(tatus v)-2.776 F .277(alue indicating success or f)-.25 F .277
-(ailure is returned; the error v)-.1 F .277(alue ar)-.25 F(gument)-.18 E
-F1(err)2.777 E(or)-.45 E F0 .277(passes more detailed)2.777 F
-(information about f)108 504 Q(ailures.)-.1 E
-(\255--------------------------------------------------------)108 528 Q
-(int)108 540 Q F2(mb_get_all)2.5 E F0(\()A(int)180 552 Q F1(verbose)2.5
-E F0(,)A(char)180 564 Q F1(*mbio_ptr)2.5 E F0(,)A(char)180 576 Q F1
-(**stor)2.5 E(e_ptr)-.37 E F0(,)A(int)180 588 Q F1(*kind)2.5 E F0(,)A
-(int)180 600 Q F1(time_i[7])2.5 E F0(,)A(double)180 612 Q F1(*time_d)2.5
-E F0(,)A(double)180 624 Q F1(*navlon)2.5 E F0(,)A(double)180 636 Q F1
-(*navlat)2.5 E F0(,)A(double)180 648 Q F1(*speed)2.5 E F0(,)A(double)180
-660 Q F1(*heading)2.5 E F0(,)A(double)180 672 Q F1(*distance)2.5 E F0(,)
-A(double)180 684 Q F1(*altitude)2.5 E F0(,)A(double)180 696 Q F1(*sonar)
-2.5 E(depth)-.37 E F0(,)A(int)180 708 Q F1(*nbath)2.5 E F0(,)A(int)180
-720 Q F1(*namp)2.5 E F0(,)A(MB-System 5.0)72 768 Q 2.5(3J)146.495 G
-(une 2013)-2.5 E(23)199.835 E 0 Cg EP
-%%Page: 24 24
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F(int)180 84 Q/F1 10/Times-Italic at 0 SF(*nss)2.5 E F0
-(,)A(char)180 96 Q F1(*beam\215a)2.5 E(g)-.1 E F0(,)A(double)180 108 Q
-F1(*bath)2.5 E F0(,)A(double)180 120 Q F1(*amp)2.5 E F0(,)A(double)180
-132 Q F1(*bathacr)2.5 E(osstr)-.45 E(ac)-.15 E(k)-.2 E F0(,)A(double)180
-144 Q F1(*bathalongtr)2.5 E(ac)-.15 E(k)-.2 E F0(,)A(double)180 156 Q F1
-(*ss)2.5 E F0(,)A(double)180 168 Q F1(*ssacr)2.5 E(osstr)-.45 E(ac)-.15
-E(k)-.2 E F0(,)A(double)180 180 Q F1(*ssalongtr)2.5 E(ac)-.15 E(k)-.2 E
-F0(,)A(char)180 192 Q F1(*comment)2.5 E F0(,)A(int)180 204 Q F1(*err)2.5
-E(or)-.45 E F0(\);)A 1.453(The function)108 228 R/F2 10/Times-Bold at 0 SF
-(mb_get_all)3.953 E F0 1.453
-(reads and returns sonar data according to the)3.953 F F2(MBIO)3.952 E
-F0 1.452(descriptor pointed to by)3.952 F F1(mbio_ptr)108 240 Q F0 6.775
-(.T)C(he)-6.775 E F1(verbose)4.275 E F0 -.25(va)4.275 G 1.775
-(lue controls the standard error output v).25 F 1.776
-(erbosity of the function.)-.15 F 1.776(The data is)6.776 F .231
-(returned one record at a time; no a)108 252 R -.15(ve)-.2 G .231
-(raging is performed.).15 F 2.731(Ap)5.231 G .231
-(ointer to a data structure containing all of the)-2.731 F .598
-(data read is returned as)108 264 R F1(stor)3.099 E(e_ptr)-.37 E F0
-3.099(;t)C .599(he form of the data structure is determined by the sona\
-r system associ-)-3.099 F .154
-(ated with the format of the data being read. A number of dif)108 276 R
-.154(ferent data record types are recognized by)-.25 F F2(MB-)2.654 E
-(System)108 288 Q F0 2.8(;t)C(he)-2.8 E F1(kind)2.8 E F0 -.25(va)2.8 G
-.3(lue indicates which type of record has been read. Additional data is\
- returned if the data).25 F .62(record is surv)108 300 R .919 -.15(ey d)
--.15 H .619(ata \(na).15 F(vig)-.2 E .619(ation, bath)-.05 F(ymetry)-.05
-E 3.119(,a)-.65 G .619(mplitude, and sidescan\), na)-3.119 F(vig)-.2 E
-.619(ation data \(na)-.05 F(vig)-.2 E .619(ation only\),)-.05 F
-(or comment data \(comment only\).)108 312 Q(The return v)108 336 Q
-(alues are:)-.25 E F1(stor)144 348 Q(e_ptr)-.37 E F0 32.92(:p)C
-(ointer to complete data structure)-32.92 E F1(kind)144 360 Q F0 52(:k)C
-(ind of data record read)-52 E 31(1s)288 372 S(urv)-31 E .3 -.15(ey d)
--.15 H(ata).15 E 31(2c)288 384 S(omment)-31 E 31(3h)288 396 S(eader)-31
-E 31(4c)288 408 S(alibrate)-31 E 31(5m)288 420 S(ean sound speed)-31 E
-31(6S)288 432 S(VP)-31 E 31(7s)288 444 S(tandby)-31 E 31(8n)288 456 S .4
--.2(av s)-31 H(ource).2 E 31(9p)288 468 S(arameter)-31 E 23.5(10 start)
-288 480 R 23.5(11 stop)288 492 R 23.5(12 na)288 504 R(v)-.2 E 23.5
-(13 run)288 516 R(parameter)2.5 E 23.5(14 clock)288 528 R 23.5(15 tide)
-288 540 R 23.5(16 height)288 552 R 23.5(17 heading)288 564 R 23.5
-(18 attitude)288 576 R 23.5(19 ssv)288 588 R 23.5(20 angle)288 600 R
-23.5(21 e)288 612 R -.15(ve)-.25 G(nt).15 E 23.5(22 history)288 624 R
-23.5(23 summary)288 636 R 23.5(24 processing)288 648 R(parameters)2.5 E
-23.5(25 sensor)288 660 R(parameters)2.5 E 23.5(26 na)288 672 R(vig)-.2 E
-(ation error)-.05 E 23.5(27 uninterpretable)288 684 R(line)2.5 E F1
-(time_i)144 696 Q F0 44.22(:t)C(ime of current ping)-44.22 E F1(time_i)
-216 708 Q F0([0]: year)A F1(time_i)216 720 Q F0([1]: month)A
-(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(24)199.835 E 0
-Cg EP
-%%Page: 25 25
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F/F1 10/Times-Italic at 0 SF(time_i)216 84 Q F0
-([2]: day)A F1(time_i)216 96 Q F0([3]: hour)A F1(time_i)216 108 Q F0
-([4]: minute)A F1(time_i)216 120 Q F0([5]: second)A F1(time_i)216 132 Q
-F0([6]: microsecond)A F1(time_d)144 144 Q F0 42(:t)C
-(ime of current ping in seconds)-42 E(since 1/1/70 00:00:00)216 156 Q F1
-(navlon)144 168 Q F0 42(:l)C(ongitude)-42 E F1(navlat)144 180 Q F0 44.22
-(:l)C(atitude)-44.22 E F1(speed)144 192 Q F0 46.45(:s)C
-(hip speed in km/s)-46.45 E F1(heading)144 204 Q F0 37(:s)C
-(hip heading in de)-37 E(grees)-.15 E F1(distance)144 216 Q F0 35.89(:d)
-C(istance along shiptrack since last)-35.89 E(ping in km)216 228 Q F1
-(altitude)144 240 Q F0 38.66(:a)C(ltitude of sonar abo)-38.66 E .3 -.15
-(ve s)-.15 H(ea\215oor).15 E(in m)216 252 Q F1(sonar)144 264 Q(depth)
--.37 E F0 24.59(:d)C(epth of sonar in m)-24.59 E F1(nbath)144 276 Q F0
-46.44(:n)C(umber of bath)-46.44 E(ymetry v)-.05 E(alues)-.25 E F1(namp)
-144 288 Q F0 47(:n)C(umber of amplitude v)-47 E(alues)-.25 E F1(nss)144
-300 Q F0 56.44(:n)C(umber of sidescan v)-56.44 E(alues)-.25 E F1
-(beam\215a)144 312 Q(g)-.1 E F0 68.66(:a)C(rray of bath)-68.66 E
-(ymetry \215ags)-.05 E F1(bath)144 324 Q F0 51.44(:a)C(rray of bath)
--51.44 E(ymetry v)-.05 E(alues in meters)-.25 E F1(amp)144 336 Q F0 52
-(:a)C(rray of amplitude v)-52 E(alues in unkno)-.25 E(wn units)-.25 E F1
-(bathacr)144 348 Q(osstr)-.45 E(ac)-.15 E(k)-.2 E F0 5.58(:a)C
-(rray of of acrosstrack distances)-5.58 E
-(in meters corresponding to bath)216 360 Q(ymetry)-.05 E F1(bathalongtr)
-144 372 Q(ac)-.15 E(k)-.2 E F0 8.46(:a)C
-(rray of of alongtrack distances)-8.46 E
-(in meters corresponding to bath)216 384 Q(ymetry)-.05 E F1(ss)144 396 Q
-F0 61.44(:a)C(rray of sidescan v)-61.44 E(alues in unkno)-.25 E
-(wn units)-.25 E F1(ssacr)144 408 Q(osstr)-.45 E(ac)-.15 E(k)-.2 E F0
-15.58(:a)C(rray of of acrosstrack distances)-15.58 E
-(in meters corresponding to sidescan)216 420 Q F1(ssacr)144 432 Q(osstr)
--.45 E(ac)-.15 E(k)-.2 E F0 15.58(:a)C(rray of of alongtrack distances)
--15.58 E(in meters corresponding to sidescan)216 444 Q F1(comment)144
-456 Q F0 33.12(:c)C(omment string)-33.12 E F1(err)144 468 Q(or)-.45 E F0
-48.56(:e)C(rror v)-48.56 E(alue)-.25 E 2.776(As)108 492 S .276(tatus v)
--2.776 F .277(alue indicating success or f)-.25 F .277
-(ailure is returned; the error v)-.1 F .277(alue ar)-.25 F(gument)-.18 E
-F1(err)2.777 E(or)-.45 E F0 .277(passes more detailed)2.777 F
-(information about read f)108 504 Q(ailures.)-.1 E
-(\255--------------------------------------------------------)108 528 Q
-(int)108 540 Q/F2 10/Times-Bold at 0 SF(mb_put_all)2.5 E F0(\()A(int)180
-552 Q F1(verbose)2.5 E F0(,)A(char)180 564 Q F1(*mbio_ptr)2.5 E F0(,)A
-(char)180 576 Q F1(*stor)2.5 E(e_ptr)-.37 E F0(,)A(int)180 588 Q F1(use)
-2.5 E(values)-.15 E F0(,)A(int)180 600 Q F1(kind)2.5 E F0(,)A(int)180
-612 Q F1(time_i[7])2.5 E F0(,)A(double)180 624 Q F1(time_d)2.5 E F0(,)A
-(double)180 636 Q F1(navlon)2.5 E F0(,)A(double)180 648 Q F1(navlat)2.5
-E F0(,)A(double)180 660 Q F1(speed)2.5 E F0(,)A(double)180 672 Q F1
-(heading)2.5 E F0(,)A(int)180 684 Q F1(nbath)2.5 E F0(,)A(int)180 696 Q
-F1(namp)2.5 E F0(,)A(int)180 708 Q F1(nss)2.5 E F0(,)A(char)180 720 Q F1
-(*beam\215a)2.5 E(g)-.1 E F0(,)A(MB-System 5.0)72 768 Q 2.5(3J)146.495 G
-(une 2013)-2.5 E(25)199.835 E 0 Cg EP
-%%Page: 26 26
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F(double)180 84 Q/F1 10/Times-Italic at 0 SF(*bath)2.5 E
-F0(,)A(double)180 96 Q F1(*amp)2.5 E F0(,)A(double)180 108 Q F1
-(*bathacr)2.5 E(osstr)-.45 E(ac)-.15 E(k)-.2 E F0(,)A(double)180 120 Q
-F1(*bathalongtr)2.5 E(ac)-.15 E(k)-.2 E F0(,)A(double)180 132 Q F1(*ss)
-2.5 E F0(,)A(double)180 144 Q F1(*ssacr)2.5 E(osstr)-.45 E(ac)-.15 E(k)
--.2 E F0(,)A(double)180 156 Q F1(*ssalongtr)2.5 E(ac)-.15 E(k)-.2 E F0
-(,)A(char)180 168 Q F1(*comment)2.5 E F0(,)A(int)180 180 Q F1(*err)2.5 E
-(or)-.45 E F0(\);)A 2.592(The function)108 204 R/F2 10/Times-Bold at 0 SF
-(mb_put_all)5.092 E F0 2.591
-(writes sonar data to the \214le listed in the)5.092 F F2(MBIO)5.091 E
-F0 2.591(descriptor pointed to by)5.091 F F1(MBIO_ptr)108 216 Q F0 5.64
-(.T)C(he)-5.64 E F1(verbose)3.14 E F0 -.25(va)3.14 G .64
-(lue controls the standard error output v).25 F .641
-(erbosity of the function.)-.15 F 3.141(Ap)5.641 G .641(ointer to a)
--3.141 F .622
-(data structure containing all of the data read is passed as)108 228 R
-F1(stor)3.122 E(e_ptr)-.37 E F0 3.122(;t)C .622
-(he form of the data structure is deter)-3.122 F(-)-.2 E .052(mined by \
-the sonar system associated with the format of the data being written.)
-108 240 R .053(Additional data is passed if)5.052 F .915
-(the data record is surv)108 252 R 1.215 -.15(ey d)-.15 H .915(ata \(na)
-.15 F(vig)-.2 E .915(ation, bath)-.05 F(ymetry)-.05 E 3.415(,a)-.65 G
-.914(mplitude, and sidescan\), na)-3.415 F(vig)-.2 E .914
-(ation data \(na)-.05 F(vig)-.2 E(a-)-.05 E .094
-(tion only\), or comment data \(comment only\).)108 264 R .094(If the)
-5.094 F F1(use)2.594 E(values)-.15 E F0 .095
-(\215ag is set to 1, then the passed v)2.594 F .095(alues will be)-.25 F
-.101(inserted in the data structure pointed to by)108 276 R F1(stor)
-2.601 E(e_ptr)-.37 E F0 .101(before the data is written.)2.601 F .101
-(If the)5.101 F F1(use)2.601 E(values)-.15 E F0 .101(\215ag is set to)
-2.601 F .645(0, the data structure pointed to by)108 288 R F1(stor)3.145
-E(e_ptr)-.37 E F0 .645(will be written without modi\214cation.)3.145 F
-.646(The v)5.646 F .646(alues to be output)-.25 F(are:)108 300 Q F1
-(stor)144 312 Q(e_ptr)-.37 E F0 32.92(:p)C
-(ointer to complete data structure)-32.92 E F1(use)144 324 Q(values)-.15
-E F0 30.49<3a8d>C(ag controlling use of data passed by v)-30.49 E(alue)
--.25 E 31(0d)288 336 S 2.5(on)-31 G(ot insert into data)-2.5 E
-(structure before writing)324 348 Q(the data)324 360 Q 31(1i)288 372 S
-(nsert into data structure)-31 E(before writing the data)324 384 Q F1
-(kind)144 396 Q F0 52(:k)C(ind of data record to be written)-52 E 31(1s)
-288 408 S(urv)-31 E .3 -.15(ey d)-.15 H(ata).15 E 31(2c)288 420 S
-(omment)-31 E 31(3h)288 432 S(eader)-31 E 31(4c)288 444 S(alibrate)-31 E
-31(5m)288 456 S(ean sound speed)-31 E 31(6S)288 468 S(VP)-31 E 31(7s)288
-480 S(tandby)-31 E 31(8n)288 492 S .4 -.2(av s)-31 H(ource).2 E 31(9p)
-288 504 S(arameter)-31 E 23.5(10 start)288 516 R 23.5(11 stop)288 528 R
-23.5(12 na)288 540 R(v)-.2 E 23.5(13 run)288 552 R(parameter)2.5 E 23.5
-(14 clock)288 564 R 23.5(15 tide)288 576 R 23.5(16 height)288 588 R 23.5
-(17 heading)288 600 R 23.5(18 attitude)288 612 R 23.5(19 ssv)288 624 R
-23.5(20 angle)288 636 R 23.5(21 e)288 648 R -.15(ve)-.25 G(nt).15 E 23.5
-(22 history)288 660 R 23.5(23 summary)288 672 R 23.5(24 processing)288
-684 R(parameters)2.5 E 23.5(25 sensor)288 696 R(parameters)2.5 E 23.5
-(26 na)288 708 R(vig)-.2 E(ation error)-.05 E 23.5(27 uninterpretable)
-288 720 R(line)2.5 E(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)
--2.5 E(26)199.835 E 0 Cg EP
-%%Page: 27 27
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F/F1 10/Times-Italic at 0 SF(time_i)144 84 Q F0 44.22
-(:t)C(ime of current ping \(used if)-44.22 E F1(time_i)2.5 E F0
-([0] != 0\))A F1(time_i)216 96 Q F0([0]: year)A F1(time_i)216 108 Q F0
-([1]: month)A F1(time_i)216 120 Q F0([2]: day)A F1(time_i)216 132 Q F0
-([3]: hour)A F1(time_i)216 144 Q F0([4]: minute)A F1(time_i)216 156 Q F0
-([5]: second)A F1(time_i)216 168 Q F0([6]: microsecond)A F1(time_d)144
-180 Q F0 42(:t)C(ime of current ping in seconds since)-42 E
-(1/1/70 00:00:00 \(used if)252 192 Q F1(time_i)2.5 E F0([0] = 0\))A F1
-(navlon)144 204 Q F0 42(:l)C(ongitude)-42 E F1(navlat)144 216 Q F0 44.22
-(:l)C(atitude)-44.22 E F1(speed)144 228 Q F0 46.45(:s)C
-(hip speed in km/s)-46.45 E F1(heading)144 240 Q F0 37(:s)C
-(hip heading in de)-37 E(grees)-.15 E F1(nbath)144 252 Q F0 46.44(:n)C
-(umber of bath)-46.44 E(ymetry v)-.05 E(alues)-.25 E F1(namp)144 264 Q
-F0 47(:n)C(umber of amplitude v)-47 E(alues)-.25 E F1(nss)144 276 Q F0
-56.44(:n)C(umber of sidescan v)-56.44 E(alues)-.25 E F1(beam\215a)144
-288 Q(g)-.1 E F0 68.66(:a)C(rray of bath)-68.66 E(ymetry \215ags)-.05 E
-F1(bath)144 300 Q F0 51.44(:a)C(rray of bath)-51.44 E(ymetry v)-.05 E
-(alues in meters)-.25 E F1(amp)144 312 Q F0 52(:a)C(rray of amplitude v)
--52 E(alues in unkno)-.25 E(wn units)-.25 E F1(bathacr)144 324 Q(osstr)
--.45 E(ac)-.15 E(k)-.2 E F0 5.58(:a)C(rray of of acrosstrack distances)
--5.58 E(in meters corresponding to bath)216 336 Q(ymetry)-.05 E F1
-(bathalongtr)144 348 Q(ac)-.15 E(k)-.2 E F0 8.46(:a)C
-(rray of of alongtrack distances)-8.46 E
-(in meters corresponding to bath)216 360 Q(ymetry)-.05 E F1(ss)144 372 Q
-F0 61.44(:a)C(rray of sidescan v)-61.44 E(alues in unkno)-.25 E
-(wn units)-.25 E F1(ssacr)144 384 Q(osstr)-.45 E(ac)-.15 E(k)-.2 E F0
-15.58(:a)C(rray of of acrosstrack distances)-15.58 E
-(in meters corresponding to sidescan)216 396 Q F1(ssacr)144 408 Q(osstr)
--.45 E(ac)-.15 E(k)-.2 E F0 15.58(:a)C(rray of of alongtrack distances)
--15.58 E(in meters corresponding to sidescan)216 420 Q F1(comment)144
-432 Q F0 33.12(:c)C(omment string)-33.12 E(The return v)108 456 Q
-(alues are:)-.25 E F1(err)144 468 Q(or)-.45 E F0 48.56(:e)C(rror v)
--48.56 E(alue)-.25 E 2.777(As)108 492 S .277(tatus v)-2.777 F .277
-(alue indicating success or f)-.25 F .277
-(ailure is returned; the error v)-.1 F .277(alue ar)-.25 F(gument)-.18 E
-F1(err)2.777 E(or)-.45 E F0 .276(passes more detailed)2.777 F
-(information about write f)108 504 Q(ailures.)-.1 E
-(\255--------------------------------------------------------)108 528 Q
-(int)108 540 Q/F2 10/Times-Bold at 0 SF(mb_put_comment)2.5 E F0(\()A(int)
-180 552 Q F1(verbose)2.5 E F0(,)A(char)180 564 Q F1(*mbio_ptr)2.5 E F0
-(,)A(char)180 576 Q F1(*comment)2.5 E F0(,)A(int)180 588 Q F1(*err)2.5 E
-(or)-.45 E F0(\);)A .578(The function)108 612 R F2(mb_put_comment)3.078
-E F0 .578(writes a comment to the \214le listed in the)3.078 F F2(MBIO)
-3.078 E F0 .579(descriptor pointed to by)3.078 F F1(MBIO_ptr)108 624 Q
-F0 5.71(.T)C(he)-5.71 E F1(verbose)3.21 E F0 -.25(va)3.21 G .71
-(lue controls the standard error output v).25 F .71
-(erbosity of the function.)-.15 F .71(The data is in)5.71 F .507
-(the form of a null terminated string. The maximum length of comments v)
-108 636 R .507(aries with dif)-.25 F .507(ferent data formats.)-.25 F
-.504(In general indi)108 648 R .503(vidual comments should be less than\
- 80 characters long to insure compatibility with all for)-.25 F(-)-.2 E
-2.5(mats. The)108 660 R -.25(va)2.5 G(lues to be output are:).25 E F1
-(comment)144 672 Q F0 69.12(:c)C(omment string)-69.12 E(The return v)108
-696 Q(alues are:)-.25 E F1(err)144 708 Q(or)-.45 E F0 48.56(:e)C(rror v)
--48.56 E(alue)-.25 E(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)
--2.5 E(27)199.835 E 0 Cg EP
-%%Page: 28 28
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F 2.776(As)108 84 S .276(tatus v)-2.776 F .277
-(alue indicating success or f)-.25 F .277
-(ailure is returned; the error v)-.1 F .277(alue ar)-.25 F(gument)-.18 E
-/F1 10/Times-Italic at 0 SF(err)2.777 E(or)-.45 E F0 .277
-(passes more detailed)2.777 F(information about write f)108 96 Q
-(ailures.)-.1 E
-(\255--------------------------------------------------------)108 120 Q
-(int)108 132 Q/F2 10/Times-Bold at 0 SF(mb_extract)2.5 E F0(\()A(int)180
-144 Q F1(verbose)2.5 E F0(,)A(char)180 156 Q F1(*mbio_ptr)2.5 E F0(,)A
-(char)180 168 Q F1(*stor)2.5 E(e_ptr)-.37 E F0(,)A(int)180 180 Q F1
-(*kind)2.5 E F0(,)A(int)180 192 Q F1(time_i[7])2.5 E F0(,)A(double)180
-204 Q F1(*time_d)2.5 E F0(,)A(double)180 216 Q F1(*navlon)2.5 E F0(,)A
-(double)180 228 Q F1(*navlat)2.5 E F0(,)A(double)180 240 Q F1(*speed)2.5
-E F0(,)A(double)180 252 Q F1(*heading)2.5 E F0(,)A(int)180 264 Q F1
-(*nbath)2.5 E F0(,)A(int)180 276 Q F1(*namp)2.5 E F0(,)A(int)180 288 Q
-F1(*nss)2.5 E F0(,)A(char)180 300 Q F1(*beam\215a)2.5 E(g)-.1 E F0(,)A
-(double)180 312 Q F1(*bath)2.5 E F0(,)A(double)180 324 Q F1(*amp)2.5 E
-F0(,)A(double)180 336 Q F1(*bathacr)2.5 E(osstr)-.45 E(ac)-.15 E(k)-.2 E
-F0(,)A(double)180 348 Q F1(*bathalongtr)2.5 E(ac)-.15 E(k)-.2 E F0(,)A
-(double)180 360 Q F1(*ss)2.5 E F0(,)A(double)180 372 Q F1(*ssacr)2.5 E
-(osstr)-.45 E(ac)-.15 E(k)-.2 E F0(,)A(double)180 384 Q F1(*ssalongtr)
-2.5 E(ac)-.15 E(k)-.2 E F0(,)A(char)180 396 Q F1(*comment)2.5 E F0(,)A
-(int)180 408 Q F1(*err)2.5 E(or)-.45 E F0(\);)A .822(The function)108
-432 R F2(mb_extract)3.322 E F0 -.15(ex)3.322 G .821
-(tracts sonar data from the structure pointed to by).15 F F1(*stor)3.321
-E(e_ptr)-.37 E F0 .821(according to the)3.321 F F2(MBIO)108 444 Q F0
-.034(descriptor pointed to by)2.534 F F1(mbio_ptr)2.534 E F0 5.034(.T)C
-(he)-5.034 E F1(verbose)2.534 E F0 -.25(va)2.534 G .034
-(lue controls the standard error output v).25 F .034(erbosity of)-.15 F
-.629(the function.)108 456 R .628(The form of the data structure is det\
-ermined by the sonar system associated with the format)5.629 F 1.087
-(of the data being read. A number of dif)108 468 R 1.087
-(ferent data record types are recognized by)-.25 F F2(MB-System)3.587 E
-F0 3.587(;t)C(he)-3.587 E F1(kind)3.588 E F0 -.25(va)108 480 S .15
-(lue indicates which type of record is stored in).25 F F1(*stor)2.649 E
-(e_ptr)-.37 E F0 5.149(.A)C .149
-(dditional data is returned if the data record is)-5.149 F(surv)108 492
-Q 1.196 -.15(ey d)-.15 H .896(ata \(na).15 F(vig)-.2 E .896(ation, bath)
--.05 F(ymetry)-.05 E 3.396(,a)-.65 G .897(mplitude, and sidescan\), na)
--3.396 F(vig)-.2 E .897(ation data \(na)-.05 F(vig)-.2 E .897
-(ation only\), or com-)-.05 F(ment data \(comment only\).)108 504 Q
-(The return v)108 528 Q(alues are:)-.25 E F1(kind)144 540 Q F0 52(:k)C
-(ind of data record read)-52 E 31(1s)288 552 S(urv)-31 E .3 -.15(ey d)
--.15 H(ata).15 E 31(2c)288 564 S(omment)-31 E 23.5(12 na)288 576 R(vig)
--.2 E(ation)-.05 E F1(time_i)144 588 Q F0 44.22(:t)C
-(ime of current ping)-44.22 E F1(time_i)216 600 Q F0([0]: year)A F1
-(time_i)216 612 Q F0([1]: month)A F1(time_i)216 624 Q F0([2]: day)A F1
-(time_i)216 636 Q F0([3]: hour)A F1(time_i)216 648 Q F0([4]: minute)A F1
-(time_i)216 660 Q F0([5]: second)A F1(time_i)216 672 Q F0
-([6]: microsecond)A F1(time_d)144 684 Q F0 42(:t)C
-(ime of current ping in seconds)-42 E(since 1/1/70 00:00:00)216 696 Q F1
-(navlon)144 708 Q F0 42(:l)C(ongitude)-42 E F1(navlat)144 720 Q F0 44.22
-(:l)C(atitude)-44.22 E(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)
--2.5 E(28)199.835 E 0 Cg EP
-%%Page: 29 29
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F/F1 10/Times-Italic at 0 SF(speed)144 84 Q F0 46.45(:s)
-C(hip speed in km/s)-46.45 E F1(heading)144 96 Q F0 37(:s)C
-(hip heading in de)-37 E(grees)-.15 E F1(distance)144 108 Q F0 71.89(:d)
-C(istance along shiptrack since last)-71.89 E(ping in km)216 120 Q F1
-(altitude)144 132 Q F0 38.66(:a)C(ltitude of sonar abo)-38.66 E .3 -.15
-(ve s)-.15 H(ea\215oor).15 E(in m)216 144 Q F1(sonar)144 156 Q(depth)
--.37 E F0 24.59(:d)C(epth of sonar in m)-24.59 E F1(nbath)144 168 Q F0
-46.44(:n)C(umber of bath)-46.44 E(ymetry v)-.05 E(alues)-.25 E F1(namp)
-144 180 Q F0 47(:n)C(umber of amplitude v)-47 E(alues)-.25 E F1(nss)144
-192 Q F0 56.44(:n)C(umber of sidescan v)-56.44 E(alues)-.25 E F1
-(beam\215a)144 204 Q(g)-.1 E F0 68.66(:a)C(rray of bath)-68.66 E
-(ymetry \215ags)-.05 E F1(bath)144 216 Q F0 51.44(:a)C(rray of bath)
--51.44 E(ymetry v)-.05 E(alues in meters)-.25 E F1(amp)144 228 Q F0 52
-(:a)C(rray of amplitude v)-52 E(alues in unkno)-.25 E(wn units)-.25 E F1
-(bathacr)144 240 Q(osstr)-.45 E(ac)-.15 E(k)-.2 E F0 5.58(:a)C
-(rray of of acrosstrack distances)-5.58 E
-(in meters corresponding to bath)216 252 Q(ymetry)-.05 E F1(bathalongtr)
-144 264 Q(ac)-.15 E(k)-.2 E F0 8.46(:a)C
-(rray of of alongtrack distances)-8.46 E
-(in meters corresponding to bath)216 276 Q(ymetry)-.05 E F1(ss)144 288 Q
-F0 61.44(:a)C(rray of sidescan v)-61.44 E(alues in unkno)-.25 E
-(wn units)-.25 E F1(ssacr)144 300 Q(osstr)-.45 E(ac)-.15 E(k)-.2 E F0
-15.58(:a)C(rray of of acrosstrack distances)-15.58 E
-(in meters corresponding to sidescan)216 312 Q F1(ssacr)144 324 Q(osstr)
--.45 E(ac)-.15 E(k)-.2 E F0 15.58(:a)C(rray of of alongtrack distances)
--15.58 E(in meters corresponding to sidescan)216 336 Q F1(comment)144
-348 Q F0 33.12(:c)C(omment string)-33.12 E F1(err)144 360 Q(or)-.45 E F0
-48.56(:e)C(rror v)-48.56 E(alue)-.25 E 2.777(As)108 384 S .277(tatus v)
--2.777 F .277(alue indicating success or f)-.25 F .277
-(ailure is returned; the error v)-.1 F .277(alue ar)-.25 F(gument)-.18 E
-F1(err)2.777 E(or)-.45 E F0 .276(passes more detailed)2.777 F
-(information about e)108 396 Q(xtract f)-.15 E(ailures.)-.1 E
-(\255--------------------------------------------------------)108 420 Q
-(int)108 432 Q/F2 10/Times-Bold at 0 SF(mb_insert)2.5 E F0(\()A(int)180 444
-Q F1(verbose)2.5 E F0(,)A(char)180 456 Q F1(*mbio_ptr)2.5 E F0(,)A(char)
-180 468 Q F1(*stor)2.5 E(e_ptr)-.37 E F0(,)A(int)180 480 Q F1(kind)2.5 E
-F0(,)A(int)180 492 Q F1(time_i[7])2.5 E F0(,)A(double)180 504 Q F1
-(time_d)2.5 E F0(,)A(double)180 516 Q F1(navlon)2.5 E F0(,)A(double)180
-528 Q F1(navlat)2.5 E F0(,)A(double)180 540 Q F1(speed)2.5 E F0(,)A
-(double)180 552 Q F1(heading)2.5 E F0(,)A(int)180 564 Q F1(nbath)2.5 E
-F0(,)A(int)180 576 Q F1(namp)2.5 E F0(,)A(int)180 588 Q F1(nss)2.5 E F0
-(,)A(char)180 600 Q F1(*beam\215a)2.5 E(g)-.1 E F0(,)A(double)180 612 Q
-F1(*bath)2.5 E F0(,)A(double)180 624 Q F1(*amp)2.5 E F0(,)A(double)180
-636 Q F1(*bathacr)2.5 E(osstr)-.45 E(ac)-.15 E(k)-.2 E F0(,)A(double)180
-648 Q F1(*bathalongtr)2.5 E(ac)-.15 E(k)-.2 E F0(,)A(double)180 660 Q F1
-(*ss)2.5 E F0(,)A(double)180 672 Q F1(*ssacr)2.5 E(osstr)-.45 E(ac)-.15
-E(k)-.2 E F0(,)A(double)180 684 Q F1(*ssalongtr)2.5 E(ac)-.15 E(k)-.2 E
-F0(,)A(char)180 696 Q F1(*comment)2.5 E F0(,)A(int)180 708 Q F1(*err)2.5
-E(or)-.45 E F0(\);)A(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)
--2.5 E(29)199.835 E 0 Cg EP
-%%Page: 30 30
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F 1.772(The function)108 84 R/F1 10/Times-Bold at 0 SF
-(mb_insert)4.272 E F0 1.772
-(inserts sonar data into the structure pointed to by)4.272 F/F2 10
-/Times-Italic at 0 SF(*stor)4.272 E(e_ptr)-.37 E F0 1.772(according to the)
-4.272 F F1(MBIO)108 96 Q F0 .034(descriptor pointed to by)2.534 F F2
-(mbio_ptr)2.534 E F0 5.034(.T)C(he)-5.034 E F2(verbose)2.534 E F0 -.25
-(va)2.534 G .034(lue controls the standard error output v).25 F .034
-(erbosity of)-.15 F .628(the function.)108 108 R .628(The form of the d\
-ata structure is determined by the sonar system associated with the for\
-mat)5.628 F 1.087(of the data being read. A number of dif)108 120 R
-1.087(ferent data record types are recognized by)-.25 F F1(MB-System)
-3.587 E F0 3.587(;t)C(he)-3.587 E F2(kind)3.587 E F0 -.25(va)108 132 S
-1.12(lue indicates which type of record is to be stored in).25 F F2
-(*stor)3.621 E(e_ptr)-.37 E F0 6.121(.D)C 1.121
-(ata will be inserted only if the data)-6.121 F .62(record is surv)108
-144 R .919 -.15(ey d)-.15 H .619(ata \(na).15 F(vig)-.2 E .619
-(ation, bath)-.05 F(ymetry)-.05 E 3.119(,a)-.65 G .619
-(mplitude, and sidescan\), na)-3.119 F(vig)-.2 E .619(ation data \(na)
--.05 F(vig)-.2 E .619(ation only\),)-.05 F
-(or comment data \(comment only\).)108 156 Q(The v)5 E
-(alues to be inserted are:)-.25 E F2(kind)144 168 Q F0 52(:k)C
-(ind of data record inserted)-52 E 31(1s)288 180 S(urv)-31 E .3 -.15
-(ey d)-.15 H(ata).15 E 31(2c)288 192 S(omment)-31 E 23.5(12 na)288 204 R
-(vig)-.2 E(ation)-.05 E F2(time_i)144 216 Q F0 44.22(:t)C
-(ime of current ping)-44.22 E F2(time_i)216 228 Q F0([0]: year)A F2
-(time_i)216 240 Q F0([1]: month)A F2(time_i)216 252 Q F0([2]: day)A F2
-(time_i)216 264 Q F0([3]: hour)A F2(time_i)216 276 Q F0([4]: minute)A F2
-(time_i)216 288 Q F0([5]: second)A F2(time_i)216 300 Q F0
-([6]: microsecond)A F2(time_d)144 312 Q F0 42(:t)C
-(ime of current ping in seconds)-42 E(since 1/1/70 00:00:00)216 324 Q F2
-(navlon)144 336 Q F0 42(:l)C(ongitude)-42 E F2(navlat)144 348 Q F0 44.22
-(:l)C(atitude)-44.22 E F2(speed)144 360 Q F0 46.45(:s)C
-(hip speed in km/s)-46.45 E F2(heading)144 372 Q F0 37(:s)C
-(hip heading in de)-37 E(grees)-.15 E F2(distance)144 384 Q F0 71.89(:d)
-C(istance along shiptrack since last)-71.89 E(ping in km)216 396 Q F2
-(altitude)144 408 Q F0 38.66(:a)C(ltitude of sonar abo)-38.66 E .3 -.15
-(ve s)-.15 H(ea\215oor).15 E(in m)216 420 Q F2(sonar)144 432 Q(depth)
--.37 E F0 24.59(:d)C(epth of sonar in m)-24.59 E F2(nbath)144 444 Q F0
-46.44(:n)C(umber of bath)-46.44 E(ymetry v)-.05 E(alues)-.25 E F2(namp)
-144 456 Q F0 47(:n)C(umber of amplitude v)-47 E(alues)-.25 E F2(nss)144
-468 Q F0 56.44(:n)C(umber of sidescan v)-56.44 E(alues)-.25 E F2
-(beam\215a)144 480 Q(g)-.1 E F0 68.66(:a)C(rray of bath)-68.66 E
-(ymetry \215ags)-.05 E F2(bath)144 492 Q F0 51.44(:a)C(rray of bath)
--51.44 E(ymetry v)-.05 E(alues in meters)-.25 E F2(amp)144 504 Q F0 52
-(:a)C(rray of amplitude v)-52 E(alues in unkno)-.25 E(wn units)-.25 E F2
-(bathacr)144 516 Q(osstr)-.45 E(ac)-.15 E(k)-.2 E F0 5.58(:a)C
-(rray of of acrosstrack distances)-5.58 E
-(in meters corresponding to bath)216 528 Q(ymetry)-.05 E F2(bathalongtr)
-144 540 Q(ac)-.15 E(k)-.2 E F0 8.46(:a)C
-(rray of of alongtrack distances)-8.46 E
-(in meters corresponding to bath)216 552 Q(ymetry)-.05 E F2(ss)144 564 Q
-F0 61.44(:a)C(rray of sidescan v)-61.44 E(alues in unkno)-.25 E
-(wn units)-.25 E F2(ssacr)144 576 Q(osstr)-.45 E(ac)-.15 E(k)-.2 E F0
-15.58(:a)C(rray of of acrosstrack distances)-15.58 E
-(in meters corresponding to sidescan)216 588 Q F2(ssacr)144 600 Q(osstr)
--.45 E(ac)-.15 E(k)-.2 E F0 15.58(:a)C(rray of of alongtrack distances)
--15.58 E(in meters corresponding to sidescan)216 612 Q F2(comment)144
-624 Q F0 33.12(:c)C(omment string)-33.12 E(The return v)108 648 Q
-(alues are:)-.25 E F2(err)144 660 Q(or)-.45 E F0 48.56(:e)C(rror v)
--48.56 E(alue)-.25 E 2.776(As)108 684 S .276(tatus v)-2.776 F .277
-(alue indicating success or f)-.25 F .277
-(ailure is returned; the error v)-.1 F .277(alue ar)-.25 F(gument)-.18 E
-F2(err)2.777 E(or)-.45 E F0 .277(passes more detailed)2.777 F
-(information about insert f)108 696 Q(ailures.)-.1 E
-(\255--------------------------------------------------------)108 720 Q
-(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(30)199.835 E 0
-Cg EP
-%%Page: 31 31
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F(int)108 84 Q/F1 10/Times-Bold at 0 SF(mb_extract_na)
-2.5 E(v)-.25 E F0(\()A(int)180 96 Q/F2 10/Times-Italic at 0 SF(verbose)2.5
-E F0(,)A(char)180 108 Q F2(*mbio_ptr)2.5 E F0(,)A(char)180 120 Q F2
-(*stor)2.5 E(e_ptr)-.37 E F0(,)A(int)180 132 Q F2(*kind)2.5 E F0(,)A
-(int)180 144 Q F2(time_i[7])2.5 E F0(,)A(double)180 156 Q F2(*time_d)2.5
-E F0(,)A(double)180 168 Q F2(*navlon)2.5 E F0(,)A(double)180 180 Q F2
-(*navlat)2.5 E F0(,)A(double)180 192 Q F2(*speed)2.5 E F0(,)A(double)180
-204 Q F2(*heading)2.5 E F0(,)A(double)180 216 Q F2(*dr)2.5 E(aft)-.15 E
-F0(,)A(double)180 228 Q F2(*r)2.5 E(oll)-.45 E F0(,)A(double)180 240 Q
-F2(*pitc)2.5 E(h)-.15 E F0(,)A(double)180 252 Q F2(*heave)2.5 E F0(,)A
-(int)180 264 Q F2(*err)2.5 E(or)-.45 E F0(\);)A .474(The function)108
-288 R F1(mb_extract_na)2.973 E(v)-.25 E F0 -.15(ex)2.973 G .473
-(tracts na).15 F(vig)-.2 E .473
-(ation data from the structure pointed to by)-.05 F F2(*stor)2.973 E
-(e_ptr)-.37 E F0(accord-)2.973 E .664(ing to the)108 300 R F1(MBIO)3.164
-E F0 .664(descriptor pointed to by)3.164 F F2(mbio_ptr)3.164 E F0 5.664
-(.T)C(he)-5.664 E F2(verbose)3.164 E F0 -.25(va)3.165 G .665
-(lue controls the standard error output).25 F -.15(ve)108 312 S .245
-(rbosity of the function.).15 F .245(The form of the data structure is \
-determined by the sonar system associated with)5.245 F .532
-(the format of the data being read. A number of dif)108 324 R .532
-(ferent data record types are recognized by)-.25 F F1(MB-System)3.032 E
-F0(;)A(the)108 336 Q F2(kind)2.725 E F0 -.25(va)2.725 G .225
-(lue indicates which type of record is stored in).25 F F2(*stor)2.725 E
-(e_ptr)-.37 E F0 5.225(.N)C -.2(av)-5.225 G(ig).2 E .225
-(ation data is returned if the data)-.05 F 2.1(record is surv)108 348 R
-2.401 -.15(ey d)-.15 H 2.101(ata \(na).15 F(vig)-.2 E 2.101(ation, bath)
--.05 F(ymetry)-.05 E 4.601(,a)-.65 G 2.101
-(mplitude, and sidescan\) or na)-4.601 F(vig)-.2 E 2.101
-(ation data \(na)-.05 F(vig)-.2 E(ation)-.05 E(only\).)108 360 Q
-(The return v)108 384 Q(alues are:)-.25 E F2(kind)144 396 Q F0 52(:k)C
-(ind of data record read)-52 E 31(1s)252 408 S(urv)-31 E .3 -.15(ey d)
--.15 H(ata).15 E 23.5(12 na)252 420 R(vig)-.2 E(ation)-.05 E F2(time_i)
-144 432 Q F0 44.22(:t)C(ime of current ping)-44.22 E F2(time_i)216 444 Q
-F0([0]: year)A F2(time_i)216 456 Q F0([1]: month)A F2(time_i)216 468 Q
-F0([2]: day)A F2(time_i)216 480 Q F0([3]: hour)A F2(time_i)216 492 Q F0
-([4]: minute)A F2(time_i)216 504 Q F0([5]: second)A F2(time_i)216 516 Q
-F0([6]: microsecond)A F2(time_d)144 528 Q F0 42(:t)C
-(ime of current ping in seconds)-42 E(since 1/1/70 00:00:00)216 540 Q F2
-(navlon)144 552 Q F0 42(:l)C(ongitude)-42 E F2(navlat)144 564 Q F0 44.22
-(:l)C(atitude)-44.22 E F2(speed)144 576 Q F0 46.45(:s)C
-(hip speed in km/s)-46.45 E F2(heading)144 588 Q F0 37(:s)C
-(hip heading in de)-37 E(grees)-.15 E F2(dr)144 600 Q(aft)-.15 E F0
-49.92(:s)C(onar depth in meters)-49.92 E F2 -.45(ro)144 612 S(ll).45 E
-F0 55.22(:s)C(onar roll in de)-55.22 E(grees)-.15 E F2(pitc)144 624 Q(h)
--.15 E F0 49.37(:s)C(onar pitch in de)-49.37 E(grees)-.15 E F2(heave)144
-636 Q F0 45.9(:s)C(onar hea)-45.9 E .3 -.15(ve i)-.2 H 2.5(nm).15 G
-(eters)-2.5 E 2.777(As)108 660 S .277(tatus v)-2.777 F .277
-(alue indicating success or f)-.25 F .277
-(ailure is returned; the error v)-.1 F .277(alue ar)-.25 F(gument)-.18 E
-F2(err)2.777 E(or)-.45 E F0 .276(passes more detailed)2.777 F
-(information about e)108 672 Q(xtract f)-.15 E(ailures.)-.1 E
-(\255--------------------------------------------------------)108 696 Q
-(int)108 708 Q F1(mb_insert_na)2.5 E(v)-.25 E F0(\()A(int)180 720 Q F2
-(verbose)2.5 E F0(,)A(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)
--2.5 E(31)199.835 E 0 Cg EP
-%%Page: 32 32
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F(char)180 84 Q/F1 10/Times-Italic at 0 SF(*mbio_ptr)2.5
-E F0(,)A(char)180 96 Q F1(*stor)2.5 E(e_ptr)-.37 E F0(,)A(int)180 108 Q
-F1(time_i[7])2.5 E F0(,)A(double)180 120 Q F1(time_d)2.5 E F0(,)A
-(double)180 132 Q F1(navlon)2.5 E F0(,)A(double)180 144 Q F1(navlat)2.5
-E F0(,)A(double)180 156 Q F1(speed)2.5 E F0(,)A(double)180 168 Q F1
-(heading)2.5 E F0(,)A(double)180 180 Q F1(dr)2.5 E(aft)-.15 E F0(,)A
-(double)180 192 Q F1 -.45(ro)2.5 G(ll).45 E F0(,)A(double)180 204 Q F1
-(pitc)2.5 E(h)-.15 E F0(,)A(double)180 216 Q F1(heave)2.5 E F0(,)A(int)
-180 228 Q F1(*err)2.5 E(or)-.45 E F0(\);)A .048(The function)108 252 R
-/F2 10/Times-Bold at 0 SF(mb_insert_na)2.548 E(v)-.25 E F0 .048(inserts na)
-2.548 F(vig)-.2 E .049(ation data into the structure pointed to by)-.05
-F F1(*stor)2.549 E(e_ptr)-.37 E F0 .049(according to)2.549 F(the)108 264
-Q F2(MBIO)3.696 E F0 1.196(descriptor pointed to by)3.696 F F1(mbio_ptr)
-3.696 E F0 6.196(.T)C(he)-6.196 E F1(verbose)3.696 E F0 -.25(va)3.696 G
-1.196(lue controls the standard error output v).25 F(er)-.15 E(-)-.2 E
-.114(bosity of the function.)108 276 R .115(The form of the data struct\
-ure is determined by the sonar system associated with the)5.114 F .532
-(format of the data being read. A number of dif)108 288 R .532
-(ferent data record types are recognized by)-.25 F F2(MB-System)3.031 E
-F0 3.031(;t)C(he)-3.031 E F1(kind)108 300 Q F0 -.25(va)2.578 G .078
-(lue indicates which type of record is to be stored in).25 F F1(*stor)
-2.579 E(e_ptr)-.37 E F0 5.079(.D)C .079
-(ata will be inserted only if the data)-5.079 F 1.893(record is surv)108
-312 R 2.193 -.15(ey d)-.15 H 1.893(ata \(na).15 F(vig)-.2 E 1.893
-(ation, bath)-.05 F(ymetry)-.05 E 4.393(,a)-.65 G 1.892
-(mplitude, and sidescan\), or na)-4.393 F(vig)-.2 E 1.892
-(ation data \(na)-.05 F(vig)-.2 E(ation)-.05 E 2.5(only\). The)108 324 R
--.25(va)2.5 G(lues to be inserted are:).25 E F1(time_i)144 336 Q F0
-44.22(:t)C(ime of current ping)-44.22 E F1(time_i)216 348 Q F0
-([0]: year)A F1(time_i)216 360 Q F0([1]: month)A F1(time_i)216 372 Q F0
-([2]: day)A F1(time_i)216 384 Q F0([3]: hour)A F1(time_i)216 396 Q F0
-([4]: minute)A F1(time_i)216 408 Q F0([5]: second)A F1(time_i)216 420 Q
-F0([6]: microsecond)A F1(time_d)144 432 Q F0 42(:t)C
-(ime of current ping in seconds)-42 E(since 1/1/70 00:00:00)216 444 Q F1
-(navlon)144 456 Q F0 42(:l)C(ongitude)-42 E F1(navlat)144 468 Q F0 44.22
-(:l)C(atitude)-44.22 E F1(speed)144 480 Q F0 46.45(:s)C
-(hip speed in km/s)-46.45 E F1(heading)144 492 Q F0 37(:s)C
-(hip heading in de)-37 E(grees)-.15 E F1(dr)144 504 Q(aft)-.15 E F0
-49.92(:s)C(onar depth in meters)-49.92 E F1 -.45(ro)144 516 S(ll).45 E
-F0 55.22(:s)C(onar roll in de)-55.22 E(grees)-.15 E F1(pitc)144 528 Q(h)
--.15 E F0 49.37(:s)C(onar pitch in de)-49.37 E(grees)-.15 E F1(heave)144
-540 Q F0 45.9(:s)C(onar hea)-45.9 E .3 -.15(ve i)-.2 H 2.5(nm).15 G
-(eters)-2.5 E(The return v)108 564 Q(alues are:)-.25 E F1(err)144 576 Q
-(or)-.45 E F0 48.56(:e)C(rror v)-48.56 E(alue)-.25 E 2.776(As)108 600 S
-.276(tatus v)-2.776 F .277(alue indicating success or f)-.25 F .277
-(ailure is returned; the error v)-.1 F .277(alue ar)-.25 F(gument)-.18 E
-F1(err)2.777 E(or)-.45 E F0 .277(passes more detailed)2.777 F
-(information about insert f)108 612 Q(ailures.)-.1 E
-(\255--------------------------------------------------------)108 636 Q
-(int)108 648 Q F2(mb_extract_altitude)2.5 E F0(\()A(int)180 660 Q F1
-(verbose)2.5 E F0(,)A(char)180 672 Q F1(*mbio_ptr)2.5 E F0(,)A(char)180
-684 Q F1(*stor)2.5 E(e_ptr)-.37 E F0(,)A(int)180 696 Q F1(*kind)2.5 E F0
-(,)A(double)180 708 Q F1(*tr)2.5 E(ansducer_depth)-.15 E F0(,)A(double)
-180 720 Q F1(*altitude)2.5 E F0(,)A(MB-System 5.0)72 768 Q 2.5(3J)
-146.495 G(une 2013)-2.5 E(32)199.835 E 0 Cg EP
-%%Page: 33 33
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F(int)180 84 Q/F1 10/Times-Italic at 0 SF(*err)2.5 E(or)
--.45 E F0(\);)A .757(The function)108 108 R/F2 10/Times-Bold at 0 SF
-(mb_extract_altitude)3.257 E F0 -.15(ex)3.257 G .756
-(tracts the sonar transducer depth \().15 F F2(transducer_depth)A F0
-3.256(\)b)C(elo)-3.256 E 3.256(wt)-.25 G .756(he sea)-3.256 F(surf)108
-120 Q .406(ace and the the sonar transducer)-.1 F F2(altitude)2.907 E F0
-(abo)2.907 E .707 -.15(ve t)-.15 H .407(he sea\215oor according to the)
-.15 F F2(MBIO)2.907 E F0 .407(descriptor pointed)2.907 F .577(to by)108
-132 R F1(mbio_ptr)3.077 E F0 5.577(.T)C .577
-(his function is not de\214ned for all data formats.)-5.577 F(The)5.576
-E F1(verbose)3.076 E F0 -.25(va)3.076 G .576(lue controls the standard)
-.25 F 1.061(error output v)108 144 R 1.061(erbosity of the function.)
--.15 F 1.062
-(The form of the data structure is determined by the sonar system)6.062
-F .024
-(associated with the format of the data being read. A number of dif)108
-156 R .024(ferent data record types are recognized by)-.25 F F2
-(MB-System)108 168 Q F0 2.877(;t)C(he)-2.877 E F1(kind)2.877 E F0 -.25
-(va)2.877 G .377(lue indicates which type of record is stored in).25 F
-F1(*stor)2.878 E(e_ptr)-.37 E F0 5.378(.T)C .378(hese data are returned)
--5.378 F .912(only if the data record is surv)108 180 R 1.211 -.15(ey d)
--.15 H 3.411(ata. These).15 F -.25(va)3.411 G .911
-(lues are useful for sidescan processing applications. Both).25 F
-(transducer depths and altitudes are reported in meters.)108 192 Q
-(The return v)108 216 Q(alues are:)-.25 E F1(kind)144 228 Q F0 52(:k)C
-(ind of data record read \(error)-52 E(if not surv)252 240 Q .3 -.15
-(ey d)-.15 H(ata\):).15 E 31(1s)288 252 S(urv)-31 E .3 -.15(ey d)-.15 H
-(ata).15 E F1(tr)144 264 Q(ansducer_depth)-.15 E F0 34.82(:d)C
-(epth of sonar in meters)-34.82 E F1(altitude)144 276 Q F0 38.66(:a)C
-(ltitude of sonar abo)-38.66 E .3 -.15(ve s)-.15 H(ea\215oor).15 E
-(in meters.)216 288 Q F1(err)144 300 Q(or)-.45 E F0 48.56(:e)C(rror v)
--48.56 E(alue)-.25 E 2.776(As)108 324 S .276(tatus v)-2.776 F .277
-(alue indicating success or f)-.25 F .277
-(ailure is returned; the error v)-.1 F .277(alue ar)-.25 F(gument)-.18 E
-F1(err)2.777 E(or)-.45 E F0 .277(passes more detailed)2.777 F
-(information about data e)108 336 Q(xtraction f)-.15 E(ailures.)-.1 E
-(\255--------------------------------------------------------)108 360 Q
-(int)108 372 Q F2(mb_insert_altitude)2.5 E F0(\()A(int)180 384 Q F1
-(verbose)2.5 E F0(,)A(char)180 396 Q F1(*mbio_ptr)2.5 E F0(,)A(char)180
-408 Q F1(*stor)2.5 E(e_ptr)-.37 E F0(,)A(double)180 420 Q F1(tr)2.5 E
-(ansducer_depth)-.15 E F0(,)A(double)180 432 Q F1(altitude)2.5 E F0(,)A
-(int)180 444 Q F1(*err)2.5 E(or)-.45 E F0(\);)A 1.813(The function)108
-468 R F2(mb_insert_altitude)4.313 E F0 1.812
-(inserts sonar depth and altitude data into the structure pointed to by)
-4.312 F F1(*stor)108 480 Q(e_ptr)-.37 E F0 .774(according to the)3.274 F
-F2(MBIO)3.274 E F0 .774(descriptor pointed to by)3.274 F F1(mbio_ptr)
-3.274 E F0 5.774(.T)C .775(his function is not de\214ned for all)-5.774
-F .572(data formats.)108 492 R(The)5.572 E F1(verbose)3.072 E F0 -.25
-(va)3.072 G .572(lue controls the standard error output v).25 F .572
-(erbosity of the function.)-.15 F .571(The form of)5.572 F .872(the dat\
-a structure is determined by the sonar system associated with the forma\
-t of the data being read. A)108 504 R .221(number of dif)108 516 R .221
-(ferent data record types are recognized by)-.25 F F2(MB-System)2.721 E
-F0 5.221(.D)C .22(ata will be inserted only if the data)-5.221 F
-(record is surv)108 528 Q .3 -.15(ey d)-.15 H(ata \(na).15 E(vig)-.2 E
-(ation, bath)-.05 E(ymetry)-.05 E 2.5(,a)-.65 G
-(mplitude, and sidescan\).)-2.5 E(The v)5 E(alues to be inserted are:)
--.25 E F1(tr)144 540 Q(ansducer_depth)-.15 E F0 34.82(:d)C
-(epth of sonar in meters)-34.82 E F1(altitude)144 552 Q F0 38.66(:a)C
-(ltitude of sonar in meters)-38.66 E(The return v)108 576 Q(alues are:)
--.25 E F1(err)144 588 Q(or)-.45 E F0 48.56(:e)C(rror v)-48.56 E(alue)
--.25 E 2.776(As)108 612 S .276(tatus v)-2.776 F .277
-(alue indicating success or f)-.25 F .277
-(ailure is returned; the error v)-.1 F .277(alue ar)-.25 F(gument)-.18 E
-F1(err)2.777 E(or)-.45 E F0 .277(passes more detailed)2.777 F
-(information about insert f)108 624 Q(ailures.)-.1 E
-(\255--------------------------------------------------------)108 648 Q
-(int)108 660 Q F2(mb_extract_svp)2.5 E F0(\()A(int)180 672 Q F1(verbose)
-2.5 E F0(,)A(char)180 684 Q F1(*mbio_ptr)2.5 E F0(,)A(char)180 696 Q F1
-(*stor)2.5 E(e_ptr)-.37 E F0(,)A(int)180 708 Q F1(*kind)2.5 E F0(,)A
-(int)180 720 Q F1(*nsvp)2.5 E F0(,)A(MB-System 5.0)72 768 Q 2.5(3J)
-146.495 G(une 2013)-2.5 E(33)199.835 E 0 Cg EP
-%%Page: 34 34
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F(double)180 84 Q/F1 10/Times-Italic at 0 SF(*depth)2.5
-E F0(,)A(double)180 96 Q F1(*velocity)2.5 E F0(,)A(int)180 108 Q F1
-(*err)2.5 E(or)-.45 E F0(\);)A 1.195(The function)108 132 R/F2 10
-/Times-Bold at 0 SF(mb_extract_svp)3.695 E F0 -.15(ex)3.695 G 1.195
-(tracts a w).15 F 1.195(ater sound v)-.1 F 1.194
-(elocity pro\214le according to the)-.15 F F2(MBIO)3.694 E F0
-(descriptor)3.694 E .804(pointed to by)108 144 R F1(mbio_ptr)3.304 E F0
-5.804(.T)C .805(his function is not de\214ned for all data formats.)
--5.804 F(The)5.805 E F1(verbose)3.305 E F0 -.25(va)3.305 G .805
-(lue controls the).25 F .703(standard error output v)108 156 R .703
-(erbosity of the function.)-.15 F .703
-(The form of the data structure is determined by the sonar)5.703 F .054
-(system associated with the format of the data being read. A number of \
-dif)108 168 R .055(ferent data record types are recog-)-.25 F .306
-(nized by)108 180 R F2(MB-System)2.806 E F0 2.806(;t)C(he)-2.806 E F1
-(kind)2.806 E F0 -.25(va)2.806 G .306
-(lue indicates which type of record is stored in).25 F F1(*stor)2.806 E
-(e_ptr)-.37 E F0 5.306(.T)C .305(hese data are)-5.306 F
-(returned only if the data record is a sound v)108 192 Q .001
-(elocity pro\214le record. These v)-.15 F .001
-(alues are useful for calculating ba-)-.25 F(th)108 204 Q
-(ymetry from tra)-.05 E -.15(ve)-.2 G 2.5(lt).15 G
-(imes and beam angles.)-2.5 E(The return v)108 228 Q(alues are:)-.25 E
-F1(kind)144 240 Q F0 52(:k)C(ind of data record read \(error)-52 E
-(if not SVP data\):)252 252 Q 31(6S)288 264 S(VP data)-31 E F1(nsvp)144
-276 Q F0 50.89(:n)C(umber of depth and sound speed)-50.89 E
-(data in the pro\214le)252 288 Q F1(depth)144 300 Q F0 47(:a)C
-(rray of depths in meters)-47 E F1(velocity)144 312 Q F0 38.12(:a)C
-(rray of sound speeds in m/sec)-38.12 E F1(err)144 324 Q(or)-.45 E F0
-48.56(:e)C(rror v)-48.56 E(alue)-.25 E 2.777(As)108 348 S .277(tatus v)
--2.777 F .277(alue indicating success or f)-.25 F .277
-(ailure is returned; the error v)-.1 F .277(alue ar)-.25 F(gument)-.18 E
-F1(err)2.777 E(or)-.45 E F0 .276(passes more detailed)2.777 F
-(information about data e)108 360 Q(xtraction f)-.15 E(ailures.)-.1 E
-(\255--------------------------------------------------------)108 384 Q
-(int)108 396 Q F2(mb_insert_svp)2.5 E F0(\()A(int)180 408 Q F1(verbose)
-2.5 E F0(,)A(char)180 420 Q F1(*mbio_ptr)2.5 E F0(,)A(char)180 432 Q F1
-(*stor)2.5 E(e_ptr)-.37 E F0(,)A(int)180 444 Q F1(nsvp)2.5 E F0(,)A
-(double)180 456 Q F1(*depth)2.5 E F0(,)A(double)180 468 Q F1(*velocity)
-2.5 E F0(,)A(int)180 480 Q F1(*err)2.5 E(or)-.45 E F0(\);)A 1.993
-(The function)108 504 R F2(mb_insert_svp)4.493 E F0 1.993(inserts a w)
-4.493 F 1.993(ater sound v)-.1 F 1.993
-(elocity pro\214le according to the)-.15 F F2(MBIO)4.493 E F0
-(descriptor)4.494 E .805(pointed to by)108 516 R F1(mbio_ptr)3.305 E F0
-5.805(.T)C .805(his function is not de\214ned for all data formats.)
--5.805 F(The)5.804 E F1(verbose)3.304 E F0 -.25(va)3.304 G .804
-(lue controls the).25 F .703(standard error output v)108 528 R .703
-(erbosity of the function.)-.15 F .703
-(The form of the data structure is determined by the sonar)5.703 F .055
-(system associated with the format of the data being read. A number of \
-dif)108 540 R .054(ferent data record types are recog-)-.25 F 1.112
-(nized by)108 552 R F2(MB-System)3.612 E F0 6.112(.T)C 1.112
-(hese data are inserted only if the data record is a sound v)-6.112 F
-1.113(elocity pro\214le record.)-.15 F .33(These v)108 564 R .33
-(alues are useful for calculating bath)-.25 F .329(ymetry from tra)-.05
-F -.15(ve)-.2 G 2.829(lt).15 G .329(imes and beam angles.)-2.829 F .329
-(The inserted v)5.329 F(alues)-.25 E(are:)108 576 Q F1(nsvp)144 588 Q F0
-50.89(:n)C(umber of depth and sound speed)-50.89 E
-(data in the pro\214le)252 600 Q F1(depth)144 612 Q F0 47(:a)C
-(rray of depths in meters)-47 E F1(velocity)144 624 Q F0 38.12(:a)C
-(rray of sound speeds in m/sec)-38.12 E(The return v)108 648 Q
-(alues are:)-.25 E F1(err)144 660 Q(or)-.45 E F0 48.56(:e)C(rror v)
--48.56 E(alue)-.25 E 2.776(As)108 684 S .276(tatus v)-2.776 F .277
-(alue indicating success or f)-.25 F .277
-(ailure is returned; the error v)-.1 F .277(alue ar)-.25 F(gument)-.18 E
-F1(err)2.777 E(or)-.45 E F0 .277(passes more detailed)2.777 F
-(information about data insertion f)108 696 Q(ailures.)-.1 E
-(\255--------------------------------------------------------)108 720 Q
-(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(34)199.835 E 0
-Cg EP
-%%Page: 35 35
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F(int)108 84 Q/F1 10/Times-Bold at 0 SF(mb_ttimes)2.5 E
-F0(\()A(int)180 96 Q/F2 10/Times-Italic at 0 SF(verbose)2.5 E F0(,)A(char)
-180 108 Q F2(*mbio_ptr)2.5 E F0(,)A(char)180 120 Q F2(*stor)2.5 E(e_ptr)
--.37 E F0(,)A(int)180 132 Q F2(*kind)2.5 E F0(,)A(int)180 144 Q F2
-(*nbeams)2.5 E F0(,)A(double)180 156 Q F2(*ttimes)2.5 E F0(,)A(double)
-180 168 Q F2(*angles)8.78 E F0(,)A(double)180 180 Q F2(*angles_forwar)
-2.5 E(d)-.37 E F0(,)A(double)180 192 Q F2(*angles_null)2.5 E F0(,)A
-(double)180 204 Q F2(*heave)2.5 E F0(,)A(double)180 216 Q F2(*alongtr)
-2.5 E(ac)-.15 E(k_of)-.2 E(fset)-.18 E F0(,)A(double)180 228 Q F2(*dr)
-2.5 E(aft)-.15 E F0(,)A(double)180 240 Q F2(*ssv)2.5 E F0(,)A(int)180
-252 Q F2(*err)2.5 E(or)-.45 E F0(\);)A .398(The function)108 276 R F1
-(mb_ttimes)2.898 E F0 -.15(ex)2.898 G .398(tracts tra).15 F -.15(ve)-.2
-G 2.898(lt).15 G .398(imes and beam angles from a sonar)-2.898 F .397
-(-speci\214c data structure pointed)-.2 F 1.305(to by)108 288 R F2(stor)
-3.805 E(e_ptr)-.37 E F0 3.805(.T)C 1.305(hese v)-3.805 F 1.305
-(alues are used for calculating sw)-.25 F 1.305(ath bath)-.1 F(ymetry)
--.05 E 3.806(.T)-.65 G(he)-3.806 E F2(verbose)3.806 E F0 -.25(va)3.806 G
-1.306(lue controls the).25 F .295(standard error output v)108 300 R .295
-(erbosity of the function.)-.15 F .295
-(The coordinates of the beam angles can be a bit confusing.)5.295 F .249
-(The angles are returned in "tak)108 312 R(eof)-.1 E 2.749(fa)-.25 G
-.249(ngle coordinates" appropriate for raytracing. The array angles con\
-tains)-2.749 F .745(the angle from v)108 324 R .744
-(ertical and the array angles_forw)-.15 F .744
-(ard contains the angle from acrosstrack. This coordinate)-.1 F .155(sy\
-stem is distinct from the roll-pitch coordinates appropriate for correc\
-ting roll and pitch v)108 336 R .155(alues. A descrip-)-.25 F .091
-(tion of these rele)108 348 R -.15(ve)-.25 G .091
-(nt coordinate systems is gi).15 F -.15(ve)-.25 G 2.591(nb).15 G(elo)
--2.591 E 3.891 -.65(w. T)-.25 H(he).65 E F1(angles_null)2.591 E F0 .09
-(array contains the ef)2.59 F(fecti)-.25 E .39 -.15(ve s)-.25 H(onar).15
-E .807(array orientation for each beam. The)108 360 R F1(angles_null)
-3.307 E F0 .807(array may be used to correct beam angles using Snell')
-3.307 F(s)-.55 E(la)108 372 Q 4.276(wi)-.15 G 4.276(ft)-4.276 G(he)
--4.276 E F1(ssv)4.276 E F0 1.776(is changed.)4.276 F(The)6.775 E F1
-(angles_null)4.275 E F0 -.25(va)4.275 G 1.775
-(lues re\215ect the sonar con\214guration.).25 F -.15(Fo)6.775 G 4.275
-(re).15 G 1.775(xample, some)-4.425 F .103(multibeam sonars ha)108 384 R
-.403 -.15(ve a \215)-.2 H .103(at transducer array).15 F 2.603(,a)-.65 G
-.103(nd so the)-2.603 F F1(angles_null)2.603 E F0 .103
-(array consists of)2.603 F F1(nbeams)2.603 E F0 .104(zero v)2.604 F
-(alues.)-.25 E .749(Other multibeams ha)108 396 R 1.049 -.15(ve c)-.2 H
-.749(ircular arrays so that the).15 F F1(angles_null)3.249 E F0 -.25(va)
-3.249 G .749(lues equal the).25 F F1(angles)3.248 E F0 -.25(va)3.248 G
-.748(lues. The).25 F F1(along-)3.248 E(track_offset)108 408 Q F0 .726
-(array accommodates sonars which report multiple pings in a single surv)
-3.226 F 1.027 -.15(ey r)-.15 H .727(ecord; each ping).15 F .29
-(occurs at a dif)108 420 R .289
-(ferent position along the shiptrack, producing alongtrack of)-.25 F
-.289(fsets relati)-.25 F .589 -.15(ve t)-.25 H 2.789(ot).15 G .289
-(he na)-2.789 F(vig)-.2 E .289(ation for)-.05 F .499(some beam v)108 432
-R .499(alues. The sum of the)-.25 F F1(draft)2.999 E F0 -.25(va)2.999 G
-.499(lue and the).25 F F1(hea)2.999 E -.1(ve)-.25 G F0 .499(array v)
-3.099 F .499(alues gi)-.25 F -.15(ve)-.25 G 2.999(st).15 G .499
-(he depth of the sonar for)-2.999 F .272(each beam. F)108 444 R .271
-(or hull mounted installations the)-.15 F F1(draft)2.771 E F0 -.25(va)
-2.771 G .271(lue is generally static b).25 F .271(ut the)-.2 F F1(hea)
-2.771 E -.1(ve)-.25 G F0 -.25(va)2.871 G .271(lues v).25 F .271
-(ary with)-.25 F .97(time. F)108 456 R .97(or to)-.15 F .97
-(wed sonars the)-.25 F F1(draft)3.47 E F0 -.25(va)3.47 G .97
-(ries with time and the).25 F F1(hea)3.47 E -.1(ve)-.25 G F0 -.25(va)
-3.57 G .97(lues are typically zero. The).25 F F1(ssv)3.47 E F0 -.25(va)
-3.47 G(lue).25 E(gi)108 468 Q -.15(ve)-.25 G 2.5(st).15 G(he w)-2.5 E
-(ater sound v)-.1 E(elocity at the sonar array)-.15 E(.)-.65 E
-(The return v)108 492 Q(alues are:)-.25 E F2(kind)144 504 Q F0 52(:k)C
-(ind of data record read \(error)-52 E(if not surv)252 516 Q .3 -.15
-(ey d)-.15 H(ata\):).15 E 31(1s)288 528 S(urv)-31 E .3 -.15(ey d)-.15 H
-(ata).15 E F2(nbeams)144 540 Q F0 38.67(:n)C(umber of beams)-38.67 E F2
-(ttimes)144 552 Q F0 45.33(:a)C(rray of tw)-45.33 E(o-w)-.1 E(ay tra)-.1
-E -.15(ve)-.2 G 2.5(lt).15 G(imes in seconds)-2.5 E F2(angles)144 564 Q
-F0 43.11(:a)C(rray of angles from v)-43.11 E(ertical in de)-.15 E(grees)
--.15 E F2(angles_forwar)144 576 Q(d)-.37 E F0 6.25(:a)C
-(rray of angles from acrosstrack in de)-6.25 E(grees)-.15 E F2
-(angles_null)144 588 Q F0 22.55(:a)C
-(rray of sonar array orientation in de)-22.55 E(grees)-.15 E F2(heave)
-144 600 Q F0 45.9(:a)C(rray of hea)-45.9 E .3 -.15(ve v)-.2 H
-(alues for each beam in meters)-.1 E F2(alongtr)144 612 Q(ac)-.15 E
-(k_of)-.2 E(fset)-.18 E F0(:array of alongtrack distance of)A(fsets for)
--.25 E(each beam in meters)252 624 Q F2(dr)144 636 Q(aft)-.15 E F0 49.92
-(:d)C(raft of sonar in meters)-49.92 E F2(ssv)144 648 Q F0 57(:w)C
-(ater sound v)-57.1 E(elocity at sonar in m/seconds)-.15 E F2(err)144
-660 Q(or)-.45 E F0 48.56(:e)C(rror v)-48.56 E(alue)-.25 E 2.777(As)108
-684 S .277(tatus v)-2.777 F .277(alue indicating success or f)-.25 F
-.277(ailure is returned; the error v)-.1 F .277(alue ar)-.25 F(gument)
--.18 E F2(err)2.777 E(or)-.45 E F0 .276(passes more detailed)2.777 F
-(information about data e)108 696 Q(xtraction f)-.15 E(ailures.)-.1 E
-(\255--------------------------------------------------------)108 720 Q
-(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(35)199.835 E 0
-Cg EP
-%%Page: 36 36
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F(int)108 84 Q/F1 10/Times-Bold at 0 SF(mb_detects)2.5 E
-F0(\()A(int)180 96 Q/F2 10/Times-Italic at 0 SF(verbose)2.5 E F0(,)A -.2
-(vo)180 108 S(id).2 E F2(*mbio_ptr)2.5 E F0(,)A -.2(vo)180 120 S(id).2 E
-F2(*stor)2.5 E(e_ptr)-.37 E F0(,)A(int)180 132 Q F2(*kind)2.5 E F0(,)A
-(int)180 144 Q F2(*nbeams)2.5 E F0(,)A(int)180 156 Q F2(*detects)2.5 E
-F0(,)A(int)180 168 Q F2(*err)2.5 E(or)-.45 E F0(\);)A .372(The function)
-108 192 R F1(mb_detects)2.872 E F0 -.15(ex)2.872 G .372
-(tracts beam bottom detect types from a sonar).15 F .372
-(-speci\214c data structure pointed to)-.2 F(by)108 204 Q F2(stor)3.909
-E(e_ptr)-.37 E F0 3.909(.T)C 1.409(hese v)-3.909 F 1.409
-(alues indicate whether the depth v)-.25 F 1.408
-(alue associated with a particular beam i deri)-.25 F -.15(ve)-.25 G(d)
-.15 E 1.897(from an amplitude detect \(e.g. detects[i] = 1\), a phase d\
-etect \(e.g. detects[i] = 2\), or the algorithm is)108 216 R(unkno)108
-228 Q .843(wn \(e.g. detects[i] = 0\). The)-.25 F F2(verbose)3.343 E F0
--.25(va)3.343 G .843(lue controls the standard error output v).25 F .843
-(erbosity of the func-)-.15 F(tion.)108 240 Q(The return v)108 264 Q
-(alues are:)-.25 E F2(kind)144 276 Q F0 52(:k)C
-(ind of data record read \(error)-52 E(if not surv)252 288 Q .3 -.15
-(ey d)-.15 H(ata\):).15 E 31(1s)288 300 S(urv)-31 E .3 -.15(ey d)-.15 H
-(ata).15 E F2(nbeams)144 312 Q F0 38.67(:n)C(umber of beams)-38.67 E F2
-(detects)144 324 Q F0 41.45(:a)C(rray of)-41.45 E F2(nbeams)2.5 E F0
-(bottom detect algorithm \215ags)2.5 E 3.437(0=u)288 336 S(nkno)-3.437 E
-180.938(wn 1)-.25 F(=)3.438 E(amplitude detect)108 348 Q 2.5(2=p)182.5 G
-(hase detect)-2.5 E F2(err)144 360 Q(or)-.45 E F0 48.56(:e)C(rror v)
--48.56 E(alue)-.25 E 2.777(As)108 384 S .277(tatus v)-2.777 F .277
-(alue indicating success or f)-.25 F .277
-(ailure is returned; the error v)-.1 F .277(alue ar)-.25 F(gument)-.18 E
-F2(err)2.777 E(or)-.45 E F0 .276(passes more detailed)2.777 F .406
-(information about data e)108 396 R .406(xtraction f)-.15 F .406
-(ailures. This functionality is a)-.1 F -.25(va)-.2 G .406
-(ilable for only a subset of the supported).25 F .475
-(sonars. If the corresponding lo)108 408 R 2.975(wl)-.25 G -2.15 -.25
-(ev e)-2.975 H 2.975(lr).25 G .475(outine is unde\214ned,)-2.975 F F2
-(*err)2.975 E(or)-.45 E F0 .475(will be set to MB_ERR)2.975 F(OR_B)-.4 E
-(AD_SYS-)-.35 E(TEM \(14\).)108 420 Q
-(\255--------------------------------------------------------)108 444 Q
-(int)108 456 Q F1(mb_gains)2.5 E F0(\()A(int)180 468 Q F2(verbose)2.5 E
-F0(,)A -.2(vo)180 480 S(id).2 E F2(*mbio_ptr)2.5 E F0(,)A -.2(vo)180 492
-S(id).2 E F2(*stor)2.5 E(e_ptr)-.37 E F0(,)A(int)180 504 Q F2(*kind)2.5
-E F0(,)A(double)180 516 Q F2(*tr)2.5 E(ansmit_gain)-.15 E F0(,)A(double)
-180 528 Q F2(*pulse_length)2.5 E F0(,)A(double)180 540 Q F2(*r)2.5 E
-(eceive_gain)-.37 E F0(,)A(int)180 552 Q F2(*err)2.5 E(or)-.45 E F0(\);)
-A .33(The function)108 576 R F1(mb_gains)2.83 E F0 -.15(ex)2.83 G .33
-(tracts the most basic g).15 F .33(ain settings from a sonar)-.05 F .33
-(-speci\214c data structure pointed to)-.2 F(by)108 588 Q F2(stor)3.107
-E(e_ptr)-.37 E F0 3.107(.I)C 3.107(nm)-3.107 G(an)-3.107 E 3.107(yc)-.15
-G .607(ases, sonars ha)-3.107 F .907 -.15(ve m)-.2 H .607
-(ore complicated g).15 F .606
-(ain functions, particularly with respect to the)-.05 F(recei)108 600 Q
--.15(ve)-.25 G 2.833(rT).15 G .633 -.15(VG f)-2.833 H .333
-(unction. In those cases, the recei).15 F .633 -.15(ve g)-.25 H .334
-(ain returned here refers to the constant g).1 F .334(ain setting and)
--.05 F .088(does not include an)108 612 R 2.588(yT)-.15 G .388 -.15
-(VG p)-2.588 H .088(arameters. The).15 F F2(verbose)2.588 E F0 -.25(va)
-2.588 G .087(lue controls the standard error output v).25 F .087
-(erbosity of the)-.15 F(function.)108 624 Q(The return v)108 648 Q
-(alues are:)-.25 E F2(kind)144 660 Q F0 52(:k)C
-(ind of data record read \(error)-52 E(if not surv)252 672 Q .3 -.15
-(ey d)-.15 H(ata\):).15 E 31(1s)288 684 S(urv)-31 E .3 -.15(ey d)-.15 H
-(ata).15 E F2(tr)144 696 Q(ansmit_gain)-.15 E F0 13.25(:t)C(ransmit g)
--13.25 E(ain \(dB\))-.05 E F2(pulse_length)144 708 Q F0 18.11(:t)C
-(ransmit pulse length \(sec\))-18.11 E F2 -.37(re)144 720 S(ceive_gain)
-.37 E F0 17.94(:r)C(ecei)-17.94 E .3 -.15(ve g)-.25 H(ain \(dB\)).1 E
-(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(36)199.835 E 0
-Cg EP
-%%Page: 37 37
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F/F1 10/Times-Italic at 0 SF(err)144 84 Q(or)-.45 E F0
-48.56(:e)C(rror v)-48.56 E(alue)-.25 E 2.776(As)108 108 S .276(tatus v)
--2.776 F .277(alue indicating success or f)-.25 F .277
-(ailure is returned; the error v)-.1 F .277(alue ar)-.25 F(gument)-.18 E
-F1(err)2.777 E(or)-.45 E F0 .277(passes more detailed)2.777 F .24
-(information about data e)108 120 R .24(xtraction f)-.15 F 2.74
-(ailures. This)-.1 F .239(functionality is a)2.739 F -.25(va)-.2 G .239
-(ilable for only a subset of the supported).25 F .475
-(sonars. If the corresponding lo)108 132 R 2.975(wl)-.25 G -2.15 -.25
-(ev e)-2.975 H 2.975(lr).25 G .475(outine is unde\214ned,)-2.975 F F1
-(*err)2.975 E(or)-.45 E F0 .475(will be set to MB_ERR)2.975 F(OR_B)-.4 E
-(AD_SYS-)-.35 E(TEM \(14\).)108 144 Q
-(\255--------------------------------------------------------)108 168 Q
-(int)108 180 Q/F2 10/Times-Bold at 0 SF(mb_extract_rawss)2.5 E F0(\()A(int)
-180 192 Q F1(verbose)2.5 E F0(,)A(char)180 204 Q F1(*mbio_ptr)2.5 E F0
-(,)A(char)180 216 Q F1(*stor)2.5 E(e_ptr)-.37 E F0(,)A(int)180 228 Q F1
-(*kind)2.5 E F0(,)A(int)180 240 Q F1(*nr)2.5 E(awss)-.15 E F0(,)A
-(double)180 252 Q F1(*r)2.5 E(awss)-.15 E F0(,)A(double)180 264 Q F1(*r)
-2.5 E(awssacr)-.15 E(osstr)-.45 E(ac)-.15 E(k)-.2 E F0(,)A(double)180
-276 Q F1(*r)2.5 E(awssalongtr)-.15 E(ac)-.15 E(k)-.2 E F0(,)A(int)180
-288 Q F1(*err)2.5 E(or)-.45 E F0(\);)A 1.159
-(This function has not yet been implemented for an)108 312 R 3.659(yd)
--.15 G 1.159(ata format.)-3.659 F 1.159
-(The notion is that since some formats)6.159 F .006(carry both "ra)108
-324 R .007(w" and "processed" sidescan imagery)-.15 F 2.507(,t)-.65 G
-.007(here should be functions to e)-2.507 F .007
-(xtract and insert the "ra)-.15 F(w")-.15 E .518(sidescan. Gi)108 336 R
--.15(ve)-.25 G 3.018(nt).15 G .518(hat the meaning of "ra)-3.018 F .518
-(w" sidescan v)-.15 F .518
-(aries greatly among sonars, the processing one might)-.25 F .807
-(apply to the data will depend on the sonar source. The de\214nition of)
-108 348 R F2(mb_extract_rawss)3.307 E F0 .807(may well change)3.307 F
-(when we actually implement it.)108 360 Q
-(\255--------------------------------------------------------)108 384 Q
-(int)108 396 Q F2(mb_insert_rawss)2.5 E F0(\()A(int)180 408 Q F1
-(verbose)2.5 E F0(,)A(char)180 420 Q F1(*mbio_ptr)2.5 E F0(,)A(char)180
-432 Q F1(*stor)2.5 E(e_ptr)-.37 E F0(,)A(int)180 444 Q F1(nr)2.5 E(awss)
--.15 E F0(,)A(double)180 456 Q F1(*r)2.5 E(awss)-.15 E F0(,)A(double)180
-468 Q F1(*r)2.5 E(awssacr)-.15 E(osstr)-.45 E(ac)-.15 E(k)-.2 E F0(,)A
-(double)180 480 Q F1(*r)2.5 E(awssalongtr)-.15 E(ac)-.15 E(k)-.2 E F0(,)
-A(int)180 492 Q F1(*err)2.5 E(or)-.45 E F0(\);)A 1.159
-(This function has not yet been implemented for an)108 516 R 3.659(yd)
--.15 G 1.159(ata format.)-3.659 F 1.159
-(The notion is that since some formats)6.159 F .006(carry both "ra)108
-528 R .007(w" and "processed" sidescan imagery)-.15 F 2.507(,t)-.65 G
-.007(here should be functions to e)-2.507 F .007
-(xtract and insert the "ra)-.15 F(w")-.15 E .518(sidescan. Gi)108 540 R
--.15(ve)-.25 G 3.018(nt).15 G .518(hat the meaning of "ra)-3.018 F .518
-(w" sidescan v)-.15 F .518
-(aries greatly among sonars, the processing one might)-.25 F 1.153
-(apply to the data will depend on the sonar source. The de\214nition of)
-108 552 R F2(mb_insert_rawss)3.653 E F0 1.154(may well change)3.653 F
-(when we actually implement it.)108 564 Q
-(\255--------------------------------------------------------)108 588 Q
-(int)108 600 Q F2(mb_copyr)2.5 E(ecord)-.18 E F0(\()A(int)180 612 Q F1
-(verbose)2.5 E F0(,)A(char)180 624 Q F1(*mbio_ptr)2.5 E F0(,)A(char)180
-636 Q F1(*stor)2.5 E(e_ptr)-.37 E F0(,)A(char)180 648 Q F1(*copy_ptr)2.5
-E F0(,)A(int)180 660 Q F1(*err)2.5 E(or)-.45 E F0(\);)A .558
-(The function)108 684 R F2(mb_copyr)3.058 E(ecord)-.18 E F0 .558
-(copies the sonar)3.058 F .558(-speci\214c data structure pointed to by)
--.2 F F1(stor)3.058 E(e_ptr)-.37 E F0 .557(into the data)3.058 F
-(structure pointed to by)108 696 Q F1(*copy_ptr)2.5 E F0 5(.T)C
-(he data structures must already ha)-5 E .3 -.15(ve b)-.2 H
-(een allocated.).15 E(The return v)108 720 Q(alues are:)-.25 E
-(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(37)199.835 E 0
-Cg EP
-%%Page: 38 38
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F/F1 10/Times-Italic at 0 SF(err)144 84 Q(or)-.45 E F0
-48.56(:e)C(rror v)-48.56 E(alue)-.25 E 2.776(As)108 108 S .276(tatus v)
--2.776 F .277(alue indicating success or f)-.25 F .277
-(ailure is returned; the error v)-.1 F .277(alue ar)-.25 F(gument)-.18 E
-F1(err)2.777 E(or)-.45 E F0 .277(passes more detailed)2.777 F
-(information about data cop)108 120 Q 2.5(yf)-.1 G(ailures.)-2.6 E/F2
-10.95/Times-Bold at 0 SF(LEVEL 3 FUNCTIONS)72 148.8 Q F0(int)108 160.8 Q/F3
-10/Times-Bold at 0 SF(mb_b)2.5 E(uffer_init)-.2 E F0(\()A(int)180 172.8 Q
-F1(verbose)2.5 E F0(,)A(char)180 184.8 Q F1(**b)2.5 E(uf)-.2 E(f_ptr)
--.18 E F0(,)A(int)180 196.8 Q F1(*err)2.5 E(or)-.45 E F0(\);)A .212
-(The function)108 220.8 R F3(mb_b)2.712 E(uffer_init)-.2 E F0 .212
-(initializes the data structures required for b)2.712 F(uf)-.2 E .212
-(fered i/0. A pointer to the b)-.25 F(uf)-.2 E(fer)-.25 E .074
-(data structure is returned as *)108 232.8 R F1 -.2(bu)C -.18(ff).2 G
-(_ptr).18 E F0 5.074(.T)C(he)-5.074 E F1(verbose)2.574 E F0 -.25(va)
-2.574 G .075(lue controls the standard error output v).25 F .075
-(erbosity of the)-.15 F(function.)108 244.8 Q(The return v)108 268.8 Q
-(alues are:)-.25 E(*)144 280.8 Q F1 -.2(bu)C -.18(ff).2 G(_ptr).18 E F0
-32.37(:p)C(ointer to b)-32.37 E(uf)-.2 E(fer structure)-.25 E F1(err)144
-292.8 Q(or)-.45 E F0 48.56(:e)C(rror v)-48.56 E(alue)-.25 E 2.777(As)108
-316.8 S .277(tatus v)-2.777 F .277(alue indicating success or f)-.25 F
-.277(ailure is returned; the error v)-.1 F .277(alue ar)-.25 F(gument)
--.18 E F1(err)2.777 E(or)-.45 E F0 .276(passes more detailed)2.777 F
-(information about b)108 328.8 Q(uf)-.2 E(fer initialization f)-.25 E
-(ailures.)-.1 E
-(\255--------------------------------------------------------)108 352.8
-Q(int)108 364.8 Q F3(mb_b)2.5 E(uffer_close)-.2 E F0(\()A(int)180 376.8
-Q F1(verbose)2.5 E F0(,)A(char)180 388.8 Q F1(**b)2.5 E(uf)-.2 E(f_ptr)
--.18 E F0(,)A(char)180 400.8 Q F1(*mbio_ptr)2.5 E F0(,)A(int)180 412.8 Q
-F1(*err)2.5 E(or)-.45 E F0(\);)A 2.334(The function)108 436.8 R F3(mb_b)
-4.834 E(uffer_close)-.2 E F0 2.334(releases all memory allocated for b)
-4.834 F(uf)-.2 E 2.334(fered i/0, including the structure)-.25 F
-(pointed to by *)108 448.8 Q F1 -.2(bu)C -.18(ff).2 G(_ptr).18 E F0 5
-(.T)C(he)-5 E F1(verbose)2.5 E F0 -.25(va)2.5 G
-(lue controls the standard error output v).25 E
-(erbosity of the function.)-.15 E(The return v)108 472.8 Q(alues are:)
--.25 E F1(err)144 484.8 Q(or)-.45 E F0 48.56(:e)C(rror v)-48.56 E(alue)
--.25 E 2.777(As)108 508.8 S .277(tatus v)-2.777 F .277
-(alue indicating success or f)-.25 F .277
-(ailure is returned; the error v)-.1 F .277(alue ar)-.25 F(gument)-.18 E
-F1(err)2.777 E(or)-.45 E F0 .276(passes more detailed)2.777 F
-(information about b)108 520.8 Q(uf)-.2 E(fer deallocation f)-.25 E
-(ailures.)-.1 E
-(\255--------------------------------------------------------)108 544.8
-Q(int)108 556.8 Q F3(mb_b)2.5 E(uffer_load)-.2 E F0(\()A(int)180 568.8 Q
-F1(verbose)2.5 E F0(,)A(char)180 580.8 Q F1(*b)2.5 E(uf)-.2 E(f_ptr)-.18
-E F0(,char)A F1(*mbio_ptr)2.5 E F0(,)A(int)180 592.8 Q F1(nwant)2.5 E F0
-(,)A(int)180 604.8 Q F1(*nload)2.5 E F0(,)A(int)180 616.8 Q F1(*nb)2.5 E
-(uf)-.2 E(f)-.18 E F0(,)A(int)180 628.8 Q F1(*err)2.5 E(or)-.45 E F0
-(\);)A .016(The function)108 652.8 R F3(mb_b)2.516 E(uffer_load)-.2 E F0
-.017(loads data into the b)2.517 F(uf)-.2 E .017(fer pointed to by)-.25
-F F1 -.2(bu)2.517 G -.18(ff).2 G(_ptr).18 E F0 .017
-(from the input \214le initialized)2.517 F .479(in the)108 664.8 R F3
-(MBIO)2.979 E F0 .479(descriptor pointed to by)2.979 F F1(mbio_ptr)2.979
-E F0 5.479(.T)C(he)-5.479 E F1(verbose)2.979 E F0 -.25(va)2.979 G .478
-(lue controls the standard error output v).25 F(er)-.15 E(-)-.2 E
-(bosity of the function.)108 676.8 Q(The input control parameters ha)108
-700.8 Q .3 -.15(ve t)-.2 H(he follo).15 E(wing signi\214cance:)-.25 E F1
-(nwant)144 712.8 Q F0 44.77(:T)C(he number of data records desired)
--44.77 E(in the b)252 724.8 Q(uf)-.2 E(fer)-.25 E(.)-.55 E
-(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(38)199.835 E 0
-Cg EP
-%%Page: 39 39
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F(The returned v)108 84 Q(alues are:)-.25 E/F1 10
-/Times-Italic at 0 SF(nload)144 96 Q F0 46.44(:T)C
-(he number of data records loaded into the b)-46.44 E(uf)-.2 E(fer)-.25
-E(.)-.55 E F1(nb)144 108 Q(uf)-.2 E(f)-.18 E F0 49.04(:T)C
-(he total number of data records in the b)-49.04 E(uf)-.2 E
-(fer after loading.)-.25 E F1(err)144 120 Q(or)-.45 E F0 48.56(:e)C
-(rror v)-48.56 E(alue)-.25 E .374(The b)108 144 R(uf)-.2 E .374
-(fer may already contain data records when the)-.25 F/F2 10/Times-Bold at 0
-SF(mb_b)2.874 E(uffer_load)-.2 E F0 .374
-(call is made; if the number of pre-)2.874 F .371
-(viously loaded records is less than)108 156 R F1(nwant)2.871 E F0 2.871
-(,t)C .37
-(he function will attempt to read and load records until a total of)
--2.871 F F1(nwant)108 168 Q F0 .236(records are loaded. The)2.735 F F1
-(nload)2.736 E F0 -.25(va)2.736 G .236
-(lue is the number of data records loaded during the current function)
-.25 F 3.833(call, and the)108 180 R F1(nb)6.333 E(uf)-.2 E(f)-.18 E F0
--.25(va)6.333 G 3.832(lue is the number of data records in the b).25 F
-(uf)-.2 E 3.832(fer at the completion of the)-.25 F F2(mb_b)108 192 Q
-(uffer_load)-.2 E F0 3.908(call. A)3.908 F 1.408(status v)3.908 F 1.408
-(alue indicating success or f)-.25 F 1.409
-(ailure is returned; the error v)-.1 F 1.409(alue ar)-.25 F(gument)-.18
-E F1(err)108 204 Q(or)-.45 E F0
-(passes more detailed information about b)2.5 E(uf)-.2 E
-(fer deallocation f)-.25 E(ailures.)-.1 E
-(\255--------------------------------------------------------)108 228 Q
-(int)108 240 Q F2(mb_b)2.5 E(uffer_dump)-.2 E F0(\()A(int)180 252 Q F1
-(verbose)2.5 E F0(,)A(char)180 264 Q F1(*b)2.5 E(uf)-.2 E(f_ptr)-.18 E
-F0(,)A(char)180 276 Q F1(*mbio_ptr)2.5 E F0(,)A(char)180 288 Q F1
-(*ombio_ptr)2.5 E F0(,)A(int)180 300 Q F1(nhold)2.5 E F0(,)A(int)180 312
-Q F1(*ndump)2.5 E F0(,)A(int)180 324 Q F1(*nb)2.5 E(uf)-.2 E(f)-.18 E F0
-(,)A(int)180 336 Q F1(*err)2.5 E(or)-.45 E F0(\);)A .26(The function)108
-360 R F2(mb_b)2.76 E(uffer_dump)-.2 E F0 .26(dumps data from the b)2.76
-F(uf)-.2 E .259(fer pointed to by *)-.25 F F1 -.2(bu)C -.18(ff).2 G
-(_ptr).18 E F0 .259(into the output \214le ini-)2.759 F .71
-(tialized in the)108 372 R F2(MBIO)3.21 E F0 .71
-(descriptor pointed to by)3.21 F F1(ombio_ptr)3.21 E F0 3.211(.T)C .711
-(he data in the b)-3.211 F(uf)-.2 E .711(fer were read from the input)
--.25 F 1.208(\214le initialized in the)108 384 R F2(MBIO)3.708 E F0
-1.208(descriptor pointed to by)3.708 F F1(mbio_ptr)3.708 E F0 6.208(.T)C
-(he)-6.208 E F1(verbose)3.708 E F0 -.25(va)3.708 G 1.208
-(lue controls the standard).25 F(error output v)108 396 Q
-(erbosity of the function.)-.15 E(The input control parameters ha)108
-420 Q .3 -.15(ve t)-.2 H(he follo).15 E(wing signi\214cance:)-.25 E F1
-(nhold)144 432 Q F0 46.44(:T)C
-(he number of data records desired to be held)-46.44 E(in the b)252 444
-Q(uf)-.2 E(fer)-.25 E(.)-.55 E(The returned v)108 468 Q(alues are:)-.25
-E F1(nload)144 480 Q F0 46.44(:T)C
-(he number of data records dumped from the b)-46.44 E(uf)-.2 E(fer)-.25
-E(.)-.55 E F1(nb)144 492 Q(uf)-.2 E(f)-.18 E F0 49.04(:T)C
-(he total number of data records in the b)-49.04 E(uf)-.2 E
-(fer after dumping.)-.25 E F1(err)144 504 Q(or)-.45 E F0 48.56(:e)C
-(rror v)-48.56 E(alue)-.25 E .401
-(If the number of loaded records is more than)108 528 R F1(nhold)2.901 E
-F0 2.901(,t)C .401
-(he function will attempt to write out records from the)-2.901 F(be)108
-540 Q 1.026(ginning of the b)-.15 F(uf)-.2 E 1.026(fer until)-.25 F F1
-(nhold)3.526 E F0 1.026(records are left in the b)3.526 F(uf)-.2 E(fer)
--.25 E 3.526(.T)-.55 G(he)-3.526 E F1(ndump)3.526 E F0 -.25(va)3.526 G
-1.025(lue is the number of data).25 F .906
-(records dumped during the current function call, and the)108 552 R F1
-(nb)3.407 E(uf)-.2 E(f)-.18 E F0 -.25(va)3.407 G .907
-(lue is the number of data records in the).25 F -.2(bu)108 564 S -.25
-(ff).2 G 1.889(er at the completion of the).25 F F2(mb_b)4.389 E
-(uffer_dump)-.2 E F0 4.389(call. A)4.389 F 1.889(status v)4.389 F 1.888
-(alue indicating success or f)-.25 F 1.888(ailure is)-.1 F 1.19
-(returned; the error v)108 576 R 1.19(alue ar)-.25 F(gument)-.18 E F1
-(err)3.69 E(or)-.45 E F0 1.19(passes more detailed information about b)
-3.69 F(uf)-.2 E 1.19(fer deallocation f)-.25 F(ail-)-.1 E(ures.)108 588
-Q(\255--------------------------------------------------------)108 612 Q
-(int)108 624 Q F2(mb_b)2.5 E(uffer_clear)-.2 E F0(\()A(int)180 636 Q F1
-(verbose)2.5 E F0(,)A(char)180 648 Q F1(*b)2.5 E(uf)-.2 E(f_ptr)-.18 E
-F0(,)A(char)180 660 Q F1(*mbio_ptr)2.5 E F0(,)A(int)180 672 Q F1(nhold)
-2.5 E F0(,)A(int)180 684 Q F1(*ndump)2.5 E F0(,)A(int)180 696 Q F1(*nb)
-2.5 E(uf)-.2 E(f)-.18 E F0(,)A(int)180 708 Q F1(*err)2.5 E(or)-.45 E F0
-(\);)A(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(39)
-199.835 E 0 Cg EP
-%%Page: 40 40
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F .4(The function)108 84 R/F1 10/Times-Bold at 0 SF
-(mb_b)2.9 E(uffer_clear)-.2 E F0(remo)2.9 E -.15(ve)-.15 G 2.9(sd).15 G
-.4(ata from the b)-2.9 F(uf)-.2 E .4(fer pointed to by *)-.25 F/F2 10
-/Times-Italic at 0 SF -.2(bu)C -.18(ff).2 G(_ptr).18 E F0 .4
-(without writing those)2.9 F .691(data records to an output \214le. An)
-108 96 R F1(MBIO)3.192 E F0 .692(descriptor pointed to by)3.192 F F2
-(mbio_ptr)3.192 E F0 .692(is still required, and generally)3.192 F .742
-(represents the)108 108 R F1(MBIO)3.242 E F0 .742
-(descriptor used to read and load the data originally)3.242 F 5.742(.T)
--.65 G(he)-5.742 E F2(verbose)3.242 E F0 -.25(va)3.242 G .741
-(lue controls the).25 F(standard error output v)108 120 Q
-(erbosity of the function.)-.15 E(The input control parameters ha)108
-144 Q .3 -.15(ve t)-.2 H(he follo).15 E(wing signi\214cance:)-.25 E F2
-(nwant)144 156 Q F0 44.77(:T)C
-(he number of data records desired to be held)-44.77 E(in the b)252 168
-Q(uf)-.2 E(fer)-.25 E(.)-.55 E(The returned v)108 192 Q(alues are:)-.25
-E F2(nload)144 204 Q F0 46.44(:T)C
-(he number of data records cleared from the b)-46.44 E(uf)-.2 E(fer)-.25
-E(.)-.55 E F2(nb)144 216 Q(uf)-.2 E(f)-.18 E F0 49.04(:T)C
-(he total number of data records in the b)-49.04 E(uf)-.2 E
-(fer after dumping.)-.25 E F2(err)144 228 Q(or)-.45 E F0 48.56(:e)C
-(rror v)-48.56 E(alue)-.25 E .46
-(If the number of loaded records is more than)108 252 R F2(nhold)2.96 E
-F0 2.96(,t)C .46(he function will attempt to clear out records from the)
--2.96 F(be)108 264 Q 1.026(ginning of the b)-.15 F(uf)-.2 E 1.026
-(fer until)-.25 F F2(nhold)3.526 E F0 1.026(records are left in the b)
-3.526 F(uf)-.2 E(fer)-.25 E 3.526(.T)-.55 G(he)-3.526 E F2(ndump)3.526 E
-F0 -.25(va)3.526 G 1.025(lue is the number of data).25 F 1.092
-(records cleared during the current function call, and the)108 276 R F2
-(nb)3.593 E(uf)-.2 E(f)-.18 E F0 -.25(va)3.593 G 1.093
-(lue is the number of data records in the).25 F -.2(bu)108 288 S -.25
-(ff).2 G 1.889(er at the completion of the).25 F F1(mb_b)4.389 E
-(uffer_dump)-.2 E F0 4.389(call. A)4.389 F 1.889(status v)4.389 F 1.888
-(alue indicating success or f)-.25 F 1.888(ailure is)-.1 F 1.19
-(returned; the error v)108 300 R 1.19(alue ar)-.25 F(gument)-.18 E F2
-(err)3.69 E(or)-.45 E F0 1.19(passes more detailed information about b)
-3.69 F(uf)-.2 E 1.19(fer deallocation f)-.25 F(ail-)-.1 E(ures.)108 312
-Q(\255--------------------------------------------------------)108 336 Q
-(int)108 348 Q F1(mb_b)2.5 E(uffer_inf)-.2 E(o)-.25 E F0(\()A(int)180
-360 Q F2(verbose)2.5 E F0(,)A(char)180 372 Q F2(*b)2.5 E(uf)-.2 E(f_ptr)
--.18 E F0(,)A(char)180 384 Q F2(*mbio_ptr)2.5 E F0(,)A(int)180 396 Q F2
-(id)2.5 E F0(,)A(int)180 408 Q F2(*system)2.5 E F0(,)A(int)180 420 Q F2
-(*kind)2.5 E F0(,)A(int)180 432 Q F2(*err)2.5 E(or)-.45 E F0(\);)A .4
-(The function)108 456 R F1(mb_b)2.9 E(uffer_clear)-.2 E F0(remo)2.9 E
--.15(ve)-.15 G 2.9(sd).15 G .4(ata from the b)-2.9 F(uf)-.2 E .4
-(fer pointed to by *)-.25 F F2 -.2(bu)C -.18(ff).2 G(_ptr).18 E F0 .4
-(without writing those)2.9 F .691(data records to an output \214le. An)
-108 468 R F1(MBIO)3.192 E F0 .692(descriptor pointed to by)3.192 F F2
-(mbio_ptr)3.192 E F0 .692(is still required, and generally)3.192 F .742
-(represents the)108 480 R F1(MBIO)3.242 E F0 .742
-(descriptor used to read and load the data originally)3.242 F 5.742(.T)
--.65 G(he)-5.742 E F2(verbose)3.242 E F0 -.25(va)3.242 G .741
-(lue controls the).25 F(standard error output v)108 492 Q
-(erbosity of the function.)-.15 E(The input control parameters ha)108
-516 Q .3 -.15(ve t)-.2 H(he follo).15 E(wing signi\214cance:)-.25 E F2
-(nwant)144 528 Q F0 44.77(:T)C
-(he number of data records desired to be held)-44.77 E(in the b)252 540
-Q(uf)-.2 E(fer)-.25 E(.)-.55 E(The returned v)108 564 Q(alues are:)-.25
-E F2(nload)144 576 Q F0 46.44(:T)C
-(he number of data records cleared from the b)-46.44 E(uf)-.2 E(fer)-.25
-E(.)-.55 E F2(nb)144 588 Q(uf)-.2 E(f)-.18 E F0 49.04(:T)C
-(he total number of data records in the b)-49.04 E(uf)-.2 E
-(fer after dumping.)-.25 E F2(err)144 600 Q(or)-.45 E F0 48.56(:e)C
-(rror v)-48.56 E(alue)-.25 E .46
-(If the number of loaded records is more than)108 624 R F2(nhold)2.96 E
-F0 2.96(,t)C .46(he function will attempt to clear out records from the)
--2.96 F(be)108 636 Q 1.026(ginning of the b)-.15 F(uf)-.2 E 1.026
-(fer until)-.25 F F2(nhold)3.526 E F0 1.026(records are left in the b)
-3.526 F(uf)-.2 E(fer)-.25 E 3.526(.T)-.55 G(he)-3.526 E F2(ndump)3.526 E
-F0 -.25(va)3.526 G 1.025(lue is the number of data).25 F 1.092
-(records cleared during the current function call, and the)108 648 R F2
-(nb)3.593 E(uf)-.2 E(f)-.18 E F0 -.25(va)3.593 G 1.093
-(lue is the number of data records in the).25 F -.2(bu)108 660 S -.25
-(ff).2 G 1.889(er at the completion of the).25 F F1(mb_b)4.389 E
-(uffer_dump)-.2 E F0 4.389(call. A)4.389 F 1.889(status v)4.389 F 1.888
-(alue indicating success or f)-.25 F 1.888(ailure is)-.1 F 1.19
-(returned; the error v)108 672 R 1.19(alue ar)-.25 F(gument)-.18 E F2
-(err)3.69 E(or)-.45 E F0 1.19(passes more detailed information about b)
-3.69 F(uf)-.2 E 1.19(fer deallocation f)-.25 F(ail-)-.1 E(ures.)108 684
-Q(\255--------------------------------------------------------)108 708 Q
-(int)108 720 Q F1(mb_b)2.5 E(uffer_get_next_data)-.2 E F0(\()A
-(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(40)199.835 E 0
-Cg EP
-%%Page: 41 41
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F(int)180 84 Q/F1 10/Times-Italic at 0 SF(verbose)2.5 E
-F0(,)A(char)180 96 Q F1(*b)2.5 E(uf)-.2 E(f_ptr)-.18 E F0(,)A(char)180
-108 Q F1(*mbio_ptr)2.5 E F0(,)A(int)180 120 Q F1(start)2.5 E F0(,)A(int)
-180 132 Q F1(*id)2.5 E F0(,)A(int)180 144 Q F1(time_i[7])2.5 E F0(,)A
-(double)180 156 Q F1(*time_d)2.5 E F0(,)A(double)180 168 Q F1(*navlon)
-2.5 E F0(,)A(double)180 180 Q F1(*navlat)2.5 E F0(,)A(double)180 192 Q
-F1(*speed)2.5 E F0(,)A(double)180 204 Q F1(*heading)2.5 E F0(,)A(int)180
-216 Q F1(*nbath)2.5 E F0(,)A(int)180 228 Q F1(*namp)2.5 E F0(,)A(int)180
-240 Q F1(*nss)2.5 E F0(,)A(char)180 252 Q F1(*beam\215a)2.5 E(g)-.1 E F0
-(,)A(double)180 264 Q F1(*bath)2.5 E F0(,)A(double)180 276 Q F1(*amp)2.5
-E F0(,)A(double)180 288 Q F1(*bathacr)2.5 E(osstr)-.45 E(ac)-.15 E(k)-.2
-E F0(,)A(double)180 300 Q F1(*bathalongtr)2.5 E(ac)-.15 E(k)-.2 E F0(,)A
-(double)180 312 Q F1(*ss)2.5 E F0(,)A(double)180 324 Q F1(*ssacr)2.5 E
-(osstr)-.45 E(ac)-.15 E(k)-.2 E F0(,)A(double)180 336 Q F1(*ssalongtr)
-2.5 E(ac)-.15 E(k)-.2 E F0(,)A(int)180 348 Q F1(*err)2.5 E(or)-.45 E F0
-(\);)A .09(The function)108 372 R/F2 10/Times-Bold at 0 SF(mb_b)2.59 E
-(uffer_get_next_data)-.2 E F0 .089(searches for the ne)2.59 F .089
-(xt surv)-.15 F .389 -.15(ey d)-.15 H .089(ata record in the b).15 F(uf)
--.2 E(fer)-.25 E 2.589(,b)-.4 G -.15(eg)-2.589 G .089(inning at).15 F
--.2(bu)108 384 S -.25(ff).2 G .588(er inde).25 F(x)-.15 E F1(start)3.088
-E F0 3.088(.S)C .588(ince b)-3.088 F(uf)-.2 E .588(fer inde)-.25 F -.15
-(xe)-.15 G 3.089(sb).15 G -.15(eg)-3.089 G .589
-(in at 0, the \214rst call to).15 F F2(mb_b)3.089 E(uffer_get_next_data)
--.2 E F0 .589(should ha)3.089 F -.15(ve)-.2 G F1(start)108 396 Q F0
-2.846(=0)2.846 G 5.346(.I)-2.846 G 2.846(fas)-5.346 G(urv)-2.846 E .645
--.15(ey d)-.15 H .345(ata record is found at or be).15 F(yond)-.15 E F1
-(start)2.845 E F0(,)A F2(mb_b)2.845 E(uffer_get_next_data)-.2 E F0 .345
-(returns the b)2.845 F(uf)-.2 E(fer)-.25 E(inde)108 408 Q 2.879(xo)-.15
-G 2.879(ft)-2.879 G .379(hat record in)-2.879 F F1(id)2.879 E F0 2.879
-(.D)C .379(ata is also returned in the forms of bath)-2.879 F(ymetry)
--.05 E 2.88(,a)-.65 G .38(mplitude, and sidescan surv)-2.88 F -.15(ey)
--.15 G .363(data. No comments or other non-surv)108 420 R .663 -.15
-(ey d)-.15 H .363(ata records are returned.).15 F(The)5.363 E F1
-(verbose)2.862 E F0 -.25(va)2.862 G .362(lue controls the standard).25 F
-(error output v)108 432 Q(erbosity of the function.)-.15 E
-(The input control parameters ha)108 456 Q .3 -.15(ve t)-.2 H(he follo)
-.15 E(wing signi\214cance:)-.25 E F1(start)144 468 Q F0 50.88(:T)C(he b)
--50.88 E(uf)-.2 E(fer inde)-.25 E 2.5(xa)-.15 G 2.5(tw)-2.5 G
-(hich to start)-2.5 E(searching for a surv)216 480 Q .3 -.15(ey d)-.15 H
-(ata record.).15 E(The returned v)108 504 Q(alues are:)-.25 E F1(id)144
-516 Q F0 61.44(:T)C(he b)-61.44 E(uf)-.2 E(fer inde)-.25 E 2.5(xo)-.15 G
-2.5(ft)-2.5 G(he \214rst surv)-2.5 E -.15(ey)-.15 G
-(data record at or after)216 528 Q F1(start)2.5 E F0(.)A F1(time_i)144
-540 Q F0 44.22(:t)C(ime of current ping)-44.22 E F1(time_i)216 552 Q F0
-([0]: year)A F1(time_i)216 564 Q F0([1]: month)A F1(time_i)216 576 Q F0
-([2]: day)A F1(time_i)216 588 Q F0([3]: hour)A F1(time_i)216 600 Q F0
-([4]: minute)A F1(time_i)216 612 Q F0([5]: second)A F1(time_i)216 624 Q
-F0([6]: microsecond)A F1(time_d)144 636 Q F0 42(:t)C
-(ime of current ping in seconds)-42 E(since 1/1/70 00:00:00)216 648 Q F1
-(navlon)144 660 Q F0 42(:l)C(ongitude)-42 E F1(navlat)144 672 Q F0 44.22
-(:l)C(atitude)-44.22 E F1(speed)144 684 Q F0 46.45(:s)C
-(hip speed in km/s)-46.45 E F1(heading)144 696 Q F0 37(:s)C
-(hip heading in de)-37 E(grees)-.15 E F1(nbath)144 708 Q F0 46.44(:n)C
-(umber of bath)-46.44 E(ymetry v)-.05 E(alues)-.25 E F1(namp)144 720 Q
-F0 47(:n)C(umber of amplitude v)-47 E(alues)-.25 E(MB-System 5.0)72 768
-Q 2.5(3J)146.495 G(une 2013)-2.5 E(41)199.835 E 0 Cg EP
-%%Page: 42 42
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F/F1 10/Times-Italic at 0 SF(nss)144 84 Q F0 56.44(:n)C
-.058(umber of sidescan v)-56.44 F(alues)-.25 E F1(beam\215a)38.558 E(g)
--.1 E F0 68.66(:a)C .059(rray of bath)-68.66 F(yme-)-.05 E(try \215ags)
-108 96 Q F1(bath)144 108 Q F0 51.44(:a)C(rray of bath)-51.44 E(ymetry v)
--.05 E(alues in meters)-.25 E F1(amp)144 120 Q F0 52(:a)C
-(rray of amplitude v)-52 E(alues in unkno)-.25 E(wn units)-.25 E F1
-(bathacr)144 132 Q(osstr)-.45 E(ac)-.15 E(k)-.2 E F0 5.58(:a)C
-(rray of of acrosstrack distances)-5.58 E
-(in meters corresponding to bath)216 144 Q(ymetry)-.05 E F1(bathalongtr)
-144 156 Q(ac)-.15 E(k)-.2 E F0 8.46(:a)C
-(rray of of alongtrack distances)-8.46 E
-(in meters corresponding to bath)216 168 Q(ymetry)-.05 E F1(ss)144 180 Q
-F0 61.44(:a)C(rray of sidescan v)-61.44 E(alues in unkno)-.25 E
-(wn units)-.25 E F1(ssacr)144 192 Q(osstr)-.45 E(ac)-.15 E(k)-.2 E F0
-15.58(:a)C(rray of of acrosstrack distances)-15.58 E
-(in meters corresponding to sidescan)216 204 Q F1(ssacr)144 216 Q(osstr)
--.45 E(ac)-.15 E(k)-.2 E F0 15.58(:a)C(rray of of alongtrack distances)
--15.58 E(in meters corresponding to sidescan)216 228 Q F1(err)144 240 Q
-(or)-.45 E F0 48.56(:e)C(rror v)-48.56 E(alue)-.25 E 2.777(As)108 264 S
-.277(tatus v)-2.777 F .277(alue indicating success or f)-.25 F .277
-(ailure is returned; the error v)-.1 F .277(alue ar)-.25 F(gument)-.18 E
-F1(err)2.777 E(or)-.45 E F0 .276(passes more detailed)2.777 F .311
-(information about f)108 276 R .312
-(ailures. The most common error occurs when no more surv)-.1 F .612 -.15
-(ey d)-.15 H .312(ata records remain to be).15 F(found in the b)108 288
-Q(uf)-.2 E(fer; in this case,)-.25 E F1(err)2.5 E(or)-.45 E F0 2.5<3dad>
-2.5 G(14.)-2.5 E
-(\255--------------------------------------------------------)108 312 Q
-(int)108 324 Q/F2 10/Times-Bold at 0 SF(mb_b)2.5 E(uffer_extract)-.2 E F0
-(\()A(int)180 336 Q F1(verbose)2.5 E F0(,)A(char)180 348 Q F1(*b)2.5 E
-(uf)-.2 E(f_ptr)-.18 E F0(,)A(char)180 360 Q F1(*mbio_ptr)2.5 E F0(,)A
-(int)180 372 Q F1(id)2.5 E F0(,)A(int)180 384 Q F1(*kind)2.5 E F0(,)A
-(int)180 396 Q F1(time_i[7])2.5 E F0(,)A(double)180 408 Q F1(*time_d)2.5
-E F0(,)A(double)180 420 Q F1(*navlon)2.5 E F0(,)A(double)180 432 Q F1
-(*navlat)2.5 E F0(,)A(double)180 444 Q F1(*speed)2.5 E F0(,)A(double)180
-456 Q F1(*heading)2.5 E F0(,)A(int)180 468 Q F1(*nbath)2.5 E F0(,)A(int)
-180 480 Q F1(*namp)2.5 E F0(,)A(int)180 492 Q F1(*nss)2.5 E F0(,)A(char)
-180 504 Q F1(*beam\215a)2.5 E(g)-.1 E F0(,)A(double)180 516 Q F1(*bath)
-2.5 E F0(,)A(double)180 528 Q F1(*amp)2.5 E F0(,)A(double)180 540 Q F1
-(*bathacr)2.5 E(osstr)-.45 E(ac)-.15 E(k)-.2 E F0(,)A(double)180 552 Q
-F1(*bathalongtr)2.5 E(ac)-.15 E(k)-.2 E F0(,)A(double)180 564 Q F1(*ss)
-2.5 E F0(,)A(double)180 576 Q F1(*ssacr)2.5 E(osstr)-.45 E(ac)-.15 E(k)
--.2 E F0(,)A(double)180 588 Q F1(*ssalongtr)2.5 E(ac)-.15 E(k)-.2 E F0
-(,)A(char)180 600 Q F1(*comment)2.5 E F0(,)A(int)180 612 Q F1(*err)2.5 E
-(or)-.45 E F0(\);)A .6(The function)108 636 R F2(mb_b)3.1 E
-(uffer_extract)-.2 E F0 -.15(ex)3.1 G .599
-(tracts and returns a subset of the data in a b).15 F(uf)-.2 E .599
-(fer record.)-.25 F(The)5.599 E F1(verbose)3.099 E F0 -.25(va)108 648 S
-.877(lue controls the standard error output v).25 F .877
-(erbosity of the function.)-.15 F .878(The b)5.878 F(uf)-.2 E .878
-(fer record is speci\214ed with the)-.25 F -.2(bu)108 660 S -.25(ff).2 G
-.224(er inde).25 F(x)-.15 E F1(id)2.724 E F0 2.724(.T)C .223
-(he data is either in the form of bath)-2.724 F(ymetry)-.05 E 2.723(,a)
--.65 G .223(mplitude, and sidescan surv)-2.723 F .523 -.15(ey d)-.15 H
-.223(ata or a com-).15 F(ment string.)108 672 Q
-(The input control parameters ha)108 696 Q .3 -.15(ve t)-.2 H(he follo)
-.15 E(wing signi\214cance:)-.25 E F1(id)144 708 Q F0 61.44(:T)C(he b)
--61.44 E(uf)-.2 E(fer inde)-.25 E 2.5(xo)-.15 G 2.5(ft)-2.5 G(he data)
--2.5 E(record to e)216 720 Q(xtract.)-.15 E(MB-System 5.0)72 768 Q 2.5
-(3J)146.495 G(une 2013)-2.5 E(42)199.835 E 0 Cg EP
-%%Page: 43 43
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F(The returned v)108 84 Q(alues are:)-.25 E/F1 10
-/Times-Italic at 0 SF(kind)144 96 Q F0 52(:k)C(ind of data record e)-52 E
-(xtracted)-.15 E 31(1s)288 108 S(urv)-31 E .3 -.15(ey d)-.15 H(ata).15 E
-31(2c)288 120 S(omment)-31 E 17.22(>=3 other)288 132 R(data that cannot)
-2.5 E(be passed by)324 144 Q/F2 10/Times-Bold at 0 SF(mb_b)2.5 E
-(uffer_extract)-.2 E F1(time_i)144 156 Q F0 44.22(:t)C
-(ime of current ping)-44.22 E F1(time_i)216 168 Q F0([0]: year)A F1
-(time_i)216 180 Q F0([1]: month)A F1(time_i)216 192 Q F0([2]: day)A F1
-(time_i)216 204 Q F0([3]: hour)A F1(time_i)216 216 Q F0([4]: minute)A F1
-(time_i)216 228 Q F0([5]: second)A F1(time_i)216 240 Q F0
-([6]: microsecond)A F1(time_d)144 252 Q F0 42(:t)C
-(ime of current ping in seconds)-42 E(since 1/1/70 00:00:00)216 264 Q F1
-(navlon)144 276 Q F0 42(:l)C(ongitude)-42 E F1(navlat)144 288 Q F0 44.22
-(:l)C(atitude)-44.22 E F1(speed)144 300 Q F0 46.45(:s)C
-(hip speed in km/s)-46.45 E F1(heading)144 312 Q F0 37(:s)C
-(hip heading in de)-37 E(grees)-.15 E F1(nbath)144 324 Q F0 46.44(:n)C
-(umber of bath)-46.44 E(ymetry v)-.05 E(alues)-.25 E F1(namp)144 336 Q
-F0 47(:n)C(umber of amplitude v)-47 E(alues)-.25 E F1(nss)144 348 Q F0
-56.44(:n)C(umber of sidescan v)-56.44 E(alues)-.25 E F1(beam\215a)144
-360 Q(g)-.1 E F0 68.66(:a)C(rray of bath)-68.66 E(ymetry \215ags)-.05 E
-F1(bath)144 372 Q F0 51.44(:a)C(rray of bath)-51.44 E(ymetry v)-.05 E
-(alues in meters)-.25 E F1(amp)144 384 Q F0 52(:a)C(rray of amplitude v)
--52 E(alues in unkno)-.25 E(wn units)-.25 E F1(bathacr)144 396 Q(osstr)
--.45 E(ac)-.15 E(k)-.2 E F0 5.58(:a)C(rray of of acrosstrack distances)
--5.58 E(in meters corresponding to bath)216 408 Q(ymetry)-.05 E F1
-(bathalongtr)144 420 Q(ac)-.15 E(k)-.2 E F0 8.46(:a)C
-(rray of of alongtrack distances)-8.46 E
-(in meters corresponding to bath)216 432 Q(ymetry)-.05 E F1(ss)144 444 Q
-F0 61.44(:a)C(rray of sidescan v)-61.44 E(alues in unkno)-.25 E
-(wn units)-.25 E F1(ssacr)144 456 Q(osstr)-.45 E(ac)-.15 E(k)-.2 E F0
-15.58(:a)C(rray of of acrosstrack distances)-15.58 E
-(in meters corresponding to sidescan)216 468 Q F1(ssacr)144 480 Q(osstr)
--.45 E(ac)-.15 E(k)-.2 E F0 15.58(:a)C(rray of of alongtrack distances)
--15.58 E(in meters corresponding to sidescan)216 492 Q F1(comment)144
-504 Q F0 69.12(:c)C(omment string)-69.12 E F1(err)144 516 Q(or)-.45 E F0
-48.56(:e)C(rror v)-48.56 E(alue)-.25 E 2.776(As)108 540 S .276(tatus v)
--2.776 F .277(alue indicating success or f)-.25 F .277
-(ailure is returned; the error v)-.1 F .277(alue ar)-.25 F(gument)-.18 E
-F1(err)2.777 E(or)-.45 E F0 .277(passes more detailed)2.777 F
-(information about e)108 552 Q(xtract f)-.15 E(ailures.)-.1 E
-(\255--------------------------------------------------------)108 576 Q
-(int)108 588 Q F2(mb_b)2.5 E(uffer_insert)-.2 E F0(\()A(int)180 600 Q F1
-(verbose)2.5 E F0(,)A(char)180 612 Q F1(*b)2.5 E(uf)-.2 E(f_ptr)-.18 E
-F0(,)A(char)180 624 Q F1(*mbio_ptr)2.5 E F0(,)A(int)180 636 Q F1(id)2.5
-E F0(,)A(int)180 648 Q F1(time_i[7])2.5 E F0(,)A(double)180 660 Q F1
-(time_d)2.5 E F0(,)A(double)180 672 Q F1(navlon)2.5 E F0(,)A(double)180
-684 Q F1(navlat)2.5 E F0(,)A(double)180 696 Q F1(speed)2.5 E F0(,)A
-(double)180 708 Q F1(heading)2.5 E F0(,)A(int)180 720 Q F1(nbath)2.5 E
-F0(,)A(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(43)
-199.835 E 0 Cg EP
-%%Page: 44 44
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F(int)180 84 Q/F1 10/Times-Italic at 0 SF(namp)2.5 E F0
-(,)A(int)180 96 Q F1(nss)2.5 E F0(,)A(char)180 108 Q F1(*beam\215a)2.5 E
-(g)-.1 E F0(,)A(double)180 120 Q F1(*bath)2.5 E F0(,)A(double)180 132 Q
-F1(*amp)2.5 E F0(,)A(double)180 144 Q F1(*bathacr)2.5 E(osstr)-.45 E(ac)
--.15 E(k)-.2 E F0(,)A(double)180 156 Q F1(*bathalongtr)2.5 E(ac)-.15 E
-(k)-.2 E F0(,)A(double)180 168 Q F1(*ss)2.5 E F0(,)A(double)180 180 Q F1
-(*ssacr)2.5 E(osstr)-.45 E(ac)-.15 E(k)-.2 E F0(,)A(double)180 192 Q F1
-(*ssalongtr)2.5 E(ac)-.15 E(k)-.2 E F0(,)A(char)180 204 Q F1(*comment)
-2.5 E F0(,)A(int)180 216 Q F1(*err)2.5 E(or)-.45 E F0(\);)A .662
-(The function)108 240 R/F2 10/Times-Bold at 0 SF(mb_b)3.162 E(uffer_insert)
--.2 E F0 .662(inserts data into a b)3.162 F(uf)-.2 E .662
-(fer record, replacing a subset of the original v)-.25 F(alues.)-.25 E
-(The)108 252 Q F1(verbose)3.066 E F0 -.25(va)3.066 G .566
-(lue controls the standard error output v).25 F .566
-(erbosity of the function.)-.15 F .567(The b)5.566 F(uf)-.2 E .567
-(fer record is speci-)-.25 F .652(\214ed with the b)108 264 R(uf)-.2 E
-.651(fer inde)-.25 F(x)-.15 E F1(id)3.151 E F0 3.151(.T)C .651
-(he data is either in the form of bath)-3.151 F(ymetry)-.05 E 3.151(,a)
--.65 G .651(mplitude, and sidescan surv)-3.151 F -.15(ey)-.15 G
-(data or a comment string.)108 276 Q(The input control parameters ha)108
-300 Q .3 -.15(ve t)-.2 H(he follo).15 E(wing signi\214cance:)-.25 E F1
-(id)144 312 Q F0 61.44(:T)C(he b)-61.44 E(uf)-.2 E(fer inde)-.25 E 2.5
-(xo)-.15 G 2.5(ft)-2.5 G(he data)-2.5 E(record to insert.)216 324 Q
-(The returned v)108 348 Q(alues are:)-.25 E F1(kind)144 360 Q F0 52(:k)C
-(ind of data record inserted)-52 E 31(1s)288 372 S(urv)-31 E .3 -.15
-(ey d)-.15 H(ata).15 E 31(2c)288 384 S(omment)-31 E 17.22(>=3 other)288
-396 R(data that cannot)2.5 E(be passed by)324 408 Q F2(mb_b)2.5 E
-(uffer_insert)-.2 E F1(time_i)144 420 Q F0 44.22(:t)C
-(ime of current ping)-44.22 E F1(time_i)216 432 Q F0([0]: year)A F1
-(time_i)216 444 Q F0([1]: month)A F1(time_i)216 456 Q F0([2]: day)A F1
-(time_i)216 468 Q F0([3]: hour)A F1(time_i)216 480 Q F0([4]: minute)A F1
-(time_i)216 492 Q F0([5]: second)A F1(time_i)216 504 Q F0
-([6]: microsecond)A F1(time_d)144 516 Q F0 42(:t)C
-(ime of current ping in seconds)-42 E(since 1/1/70 00:00:00)216 528 Q F1
-(navlon)144 540 Q F0 42(:l)C(ongitude)-42 E F1(navlat)144 552 Q F0 44.22
-(:l)C(atitude)-44.22 E F1(speed)144 564 Q F0 46.45(:s)C
-(hip speed in km/s)-46.45 E F1(heading)144 576 Q F0 37(:s)C
-(hip heading in de)-37 E(grees)-.15 E F1(nbath)144 588 Q F0 46.44(:n)C
-(umber of bath)-46.44 E(ymetry v)-.05 E(alues)-.25 E F1(namp)144 600 Q
-F0 47(:n)C(umber of amplitude v)-47 E(alues)-.25 E F1(nss)144 612 Q F0
-56.44(:n)C(umber of sidescan v)-56.44 E(alues)-.25 E F1(beam\215a)144
-624 Q(g)-.1 E F0 68.66(:a)C(rray of bath)-68.66 E(ymetry \215ags)-.05 E
-F1(bath)144 636 Q F0 51.44(:a)C(rray of bath)-51.44 E(ymetry v)-.05 E
-(alues in meters)-.25 E F1(amp)144 648 Q F0 52(:a)C(rray of amplitude v)
--52 E(alues in unkno)-.25 E(wn units)-.25 E F1(bathacr)144 660 Q(osstr)
--.45 E(ac)-.15 E(k)-.2 E F0 5.58(:a)C(rray of of acrosstrack distances)
--5.58 E(in meters corresponding to bath)216 672 Q(ymetry)-.05 E F1
-(bathalongtr)144 684 Q(ac)-.15 E(k)-.2 E F0 8.46(:a)C
-(rray of of alongtrack distances)-8.46 E
-(in meters corresponding to bath)216 696 Q(ymetry)-.05 E F1(ss)144 708 Q
-F0 61.44(:a)C(rray of sidescan v)-61.44 E(alues in unkno)-.25 E
-(wn units)-.25 E F1(ssacr)144 720 Q(osstr)-.45 E(ac)-.15 E(k)-.2 E F0
-15.58(:a)C(rray of of acrosstrack distances)-15.58 E(MB-System 5.0)72
-768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(44)199.835 E 0 Cg EP
-%%Page: 45 45
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F(in meters corresponding to sidescan)216 84 Q/F1 10
-/Times-Italic at 0 SF(ssacr)144 96 Q(osstr)-.45 E(ac)-.15 E(k)-.2 E F0
-15.58(:a)C(rray of of alongtrack distances)-15.58 E
-(in meters corresponding to sidescan)216 108 Q F1(comment)144 120 Q F0
-69.12(:c)C(omment string)-69.12 E(The returned v)108 144 Q(alues are:)
--.25 E F1(err)144 156 Q(or)-.45 E F0 48.56(:e)C(rror v)-48.56 E(alue)
--.25 E 2.776(As)108 180 S .276(tatus v)-2.776 F .277
-(alue indicating success or f)-.25 F .277
-(ailure is returned; the error v)-.1 F .277(alue ar)-.25 F(gument)-.18 E
-F1(err)2.777 E(or)-.45 E F0 .277(passes more detailed)2.777 F
-(information about insert f)108 192 Q(ailures.)-.1 E
-(\255--------------------------------------------------------)108 216 Q
-(int)108 228 Q/F2 10/Times-Bold at 0 SF(mb_b)2.5 E(uffer_get_next_na)-.2 E
-(v)-.25 E F0(\()A(int)180 240 Q F1(verbose)2.5 E F0(,)A(char)180 252 Q
-F1(*b)2.5 E(uf)-.2 E(f_ptr)-.18 E F0(,)A(char)180 264 Q F1(*mbio_ptr)2.5
-E F0(,)A(int)180 276 Q F1(start)2.5 E F0(,)A(int)180 288 Q F1(*id)2.5 E
-F0(,)A(int)180 300 Q F1(time_i[7])2.5 E F0(,)A(double)180 312 Q F1
-(*time_d)2.5 E F0(,)A(double)180 324 Q F1(*navlon)2.5 E F0(,)A(double)
-180 336 Q F1(*navlat)2.5 E F0(,)A(double)180 348 Q F1(*speed)2.5 E F0(,)
-A(double)180 360 Q F1(*heading)2.5 E F0(,)A(double)180 372 Q F1(*dr)2.5
-E(aft)-.15 E F0(,)A(double)180 384 Q F1(*r)2.5 E(oll)-.45 E F0(,)A
-(double)180 396 Q F1(*pitc)2.5 E(h)-.15 E F0(,)A(double)180 408 Q F1
-(*heave)2.5 E F0(,)A(int)180 420 Q F1(*err)2.5 E(or)-.45 E F0(\);)A .345
-(The function)108 444 R F2(mb_b)2.845 E(uffer_get_next_na)-.2 E(v)-.25 E
-F0 .345(searches for the ne)2.845 F .345(xt surv)-.15 F .645 -.15(ey d)
--.15 H .345(ata record in the b).15 F(uf)-.2 E(fer)-.25 E 2.845(,b)-.4 G
--.15(eg)-2.845 G .345(inning at).15 F -.2(bu)108 456 S -.25(ff).2 G .827
-(er inde).25 F(x)-.15 E F1(start)3.327 E F0 3.327(.S)C .827(ince b)
--3.327 F(uf)-.2 E .827(fer inde)-.25 F -.15(xe)-.15 G 3.327(sb).15 G
--.15(eg)-3.327 G .827(in at 0, the \214rst call to).15 F F2(mb_b)3.328 E
-(uffer_get_next_na)-.2 E(v)-.25 E F0 .828(should ha)3.328 F -.15(ve)-.2
-G F1(start)108 468 Q F0 3.056(=0)3.056 G 5.556(.I)-3.056 G 3.056(fas)
--5.556 G(urv)-3.056 E .856 -.15(ey d)-.15 H .556
-(ata record is found at or be).15 F(yond)-.15 E F1(start)3.056 E F0(,)A
-F2(mb_b)3.056 E(uffer_get_next_na)-.2 E(v)-.25 E F0 .555(returns the b)
-3.056 F(uf)-.2 E(fer)-.25 E(inde)108 480 Q 3.227(xo)-.15 G 3.227(ft)
--3.227 G .727(hat record in)-3.227 F F1(id)3.227 E F0 3.227(.N)C -.2(av)
--3.227 G(ig).2 E .728(ation and v)-.05 F .728
-(ertical reference sensor data is also returned. No comments or)-.15 F
-.479(other non-surv)108 492 R .779 -.15(ey d)-.15 H .479
-(ata records are returned.).15 F(The)5.479 E F1(verbose)2.979 E F0 -.25
-(va)2.979 G .478(lue controls the standard error output v).25 F
-(erbosity)-.15 E(of the function.)108 504 Q
-(The input control parameters ha)108 528 Q .3 -.15(ve t)-.2 H(he follo)
-.15 E(wing signi\214cance:)-.25 E F1(start)144 540 Q F0 50.88(:T)C(he b)
--50.88 E(uf)-.2 E(fer inde)-.25 E 2.5(xa)-.15 G 2.5(tw)-2.5 G
-(hich to start)-2.5 E(searching for a surv)216 552 Q .3 -.15(ey d)-.15 H
-(ata record.).15 E(The returned v)108 576 Q(alues are:)-.25 E F1(id)144
-588 Q F0 61.44(:T)C(he b)-61.44 E(uf)-.2 E(fer inde)-.25 E 2.5(xo)-.15 G
-2.5(ft)-2.5 G(he \214rst surv)-2.5 E .3 -.15(ey d)-.15 H
-(ata record at or after).15 E F1(start)2.5 E F0(.)A F1(time_i)144 600 Q
-F0 44.22(:t)C(ime of current ping)-44.22 E F1(time_i)216 612 Q F0
-([0]: year)A F1(time_i)216 624 Q F0([1]: month)A F1(time_i)216 636 Q F0
-([2]: day)A F1(time_i)216 648 Q F0([3]: hour)A F1(time_i)216 660 Q F0
-([4]: minute)A F1(time_i)216 672 Q F0([5]: second)A F1(time_i)216 684 Q
-F0([6]: microsecond)A F1(time_d)144 696 Q F0 42(:t)C
-(ime of current ping in seconds)-42 E(since 1/1/70 00:00:00)216 708 Q F1
-(navlon)144 720 Q F0 42(:l)C(ongitude)-42 E(MB-System 5.0)72 768 Q 2.5
-(3J)146.495 G(une 2013)-2.5 E(45)199.835 E 0 Cg EP
-%%Page: 46 46
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F/F1 10/Times-Italic at 0 SF(navlat)144 84 Q F0 44.22
-(:l)C(atitude)-44.22 E F1(speed)144 96 Q F0 46.45(:s)C
-(hip speed in km/s)-46.45 E F1(heading)144 108 Q F0 37(:s)C
-(hip heading in de)-37 E(grees)-.15 E F1 -.45(ro)144 120 S(ll).45 E F0
-55.22(:s)C(hip roll in de)-55.22 E(grees)-.15 E F1(pitc)144 132 Q(h)-.15
-E F0 49.37(:s)C(hip pitch in de)-49.37 E(grees)-.15 E F1(heave)144 144 Q
-F0 45.9(:s)C(hip hea)-45.9 E .3 -.15(ve i)-.2 H 2.5(nm).15 G(eters)-2.5
-E 2.776(As)108 168 S .276(tatus v)-2.776 F .277
-(alue indicating success or f)-.25 F .277
-(ailure is returned; the error v)-.1 F .277(alue ar)-.25 F(gument)-.18 E
-F1(err)2.777 E(or)-.45 E F0 .277(passes more detailed)2.777 F .312
-(information about f)108 180 R .312
-(ailures. The most common error occurs when no more surv)-.1 F .612 -.15
-(ey d)-.15 H .312(ata records remain to be).15 F(found in the b)108 192
-Q(uf)-.2 E(fer; in this case,)-.25 E F1(err)2.5 E(or)-.45 E F0 2.5<3dad>
-2.5 G(14.)-2.5 E
-(\255--------------------------------------------------------)108 216 Q
-(int)108 228 Q/F2 10/Times-Bold at 0 SF(mb_b)2.5 E(uffer_extract_na)-.2 E
-(v)-.25 E F0(\()A(int)180 240 Q F1(verbose)2.5 E F0(,)A(char)180 252 Q
-F1(*b)2.5 E(uf)-.2 E(f_ptr)-.18 E F0(,)A(char)180 264 Q F1(*mbio_ptr)2.5
-E F0(,)A(int)180 276 Q F1(id)2.5 E F0(,)A(int)180 288 Q F1(*kind)2.5 E
-F0(,)A(int)180 300 Q F1(time_i[7])2.5 E F0(,)A(double)180 312 Q F1
-(*time_d)2.5 E F0(,)A(double)180 324 Q F1(*navlon)2.5 E F0(,)A(double)
-180 336 Q F1(*navlat)2.5 E F0(,)A(double)180 348 Q F1(*speed)2.5 E F0(,)
-A(double)180 360 Q F1(*heading)2.5 E F0(,)A(double)180 372 Q F1(*dr)2.5
-E(aft)-.15 E F0(,)A(double)180 384 Q F1(*r)2.5 E(oll)-.45 E F0(,)A
-(double)180 396 Q F1(*pitc)2.5 E(h)-.15 E F0(,)A(double)180 408 Q F1
-(*heave)2.5 E F0(,)A(int)180 420 Q F1(*err)2.5 E(or)-.45 E F0(\);)A .28
-(The function)108 444 R F2(mb_b)2.78 E(uffer_extract_na)-.2 E(v)-.25 E
-F0 -.15(ex)2.78 G .28(tracts and returns a subset of the data in a b).15
-F(uf)-.2 E .28(fer record.)-.25 F(The)5.28 E F1(ver)2.78 E(-)-.2 E(bose)
-108 456 Q F0 -.25(va)2.996 G .496
-(lue controls the standard error output v).25 F .496
-(erbosity of the function.)-.15 F .495(The b)5.495 F(uf)-.2 E .495
-(fer record is speci\214ed with)-.25 F(the b)108 468 Q(uf)-.2 E
-(fer inde)-.25 E(x)-.15 E F1(id)2.5 E F0 2.5(.T)C
-(he data returned consists of na)-2.5 E(vig)-.2 E(ation and v)-.05 E
-(ertical reference sensor data.)-.15 E(The input control parameters ha)
-108 492 Q .3 -.15(ve t)-.2 H(he follo).15 E(wing signi\214cance:)-.25 E
-F1(id)144 504 Q F0 61.44(:T)C(he b)-61.44 E(uf)-.2 E(fer inde)-.25 E 2.5
-(xo)-.15 G 2.5(ft)-2.5 G(he data)-2.5 E(record to e)216 516 Q(xtract.)
--.15 E(The returned v)108 540 Q(alues are:)-.25 E F1(kind)144 552 Q F0
-52(:k)C(ind of data record e)-52 E(xtracted)-.15 E 31(1s)288 564 S(urv)
--31 E .3 -.15(ey d)-.15 H(ata).15 E 31(2c)288 576 S(omment)-31 E 17.22
-(>=3 other)288 588 R(data that cannot)2.5 E(be passed by)324 600 Q F2
-(mb_b)2.5 E(uffer_extract_na)-.2 E(v)-.25 E F1(time_i)144 612 Q F0 44.22
-(:t)C(ime of current ping)-44.22 E F1(time_i)216 624 Q F0([0]: year)A F1
-(time_i)216 636 Q F0([1]: month)A F1(time_i)216 648 Q F0([2]: day)A F1
-(time_i)216 660 Q F0([3]: hour)A F1(time_i)216 672 Q F0([4]: minute)A F1
-(time_i)216 684 Q F0([5]: second)A F1(time_i)216 696 Q F0
-([6]: microsecond)A F1(time_d)144 708 Q F0 42(:t)C
-(ime of current ping in seconds)-42 E(since 1/1/70 00:00:00)216 720 Q
-(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(46)199.835 E 0
-Cg EP
-%%Page: 47 47
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F/F1 10/Times-Italic at 0 SF(navlon)144 84 Q F0 42(:l)C
-(ongitude)-42 E F1(navlat)144 96 Q F0 44.22(:l)C(atitude)-44.22 E F1
-(speed)144 108 Q F0 46.45(:s)C(hip speed in km/s)-46.45 E F1(heading)144
-120 Q F0 37(:s)C(hip heading in de)-37 E(grees)-.15 E F1 -.45(ro)144 132
-S(ll).45 E F0 55.22(:s)C(hip roll in de)-55.22 E(grees)-.15 E F1(pitc)
-144 144 Q(h)-.15 E F0 49.37(:s)C(hip pitch in de)-49.37 E(grees)-.15 E
-F1(heave)144 156 Q F0 45.9(:s)C(hip hea)-45.9 E .3 -.15(ve i)-.2 H 2.5
-(nm).15 G(eters)-2.5 E 2.776(As)108 180 S .276(tatus v)-2.776 F .277
-(alue indicating success or f)-.25 F .277
-(ailure is returned; the error v)-.1 F .277(alue ar)-.25 F(gument)-.18 E
-F1(err)2.777 E(or)-.45 E F0 .277(passes more detailed)2.777 F
-(information about e)108 192 Q(xtract f)-.15 E(ailures.)-.1 E
-(\255--------------------------------------------------------)108 216 Q
-(int)108 228 Q/F2 10/Times-Bold at 0 SF(mb_b)2.5 E(uffer_insert_na)-.2 E(v)
--.25 E F0(\()A(int)180 240 Q F1(verbose)2.5 E F0(,)A(char)180 252 Q F1
-(*b)2.5 E(uf)-.2 E(f_ptr)-.18 E F0(,)A(char)180 264 Q F1(*mbio_ptr)2.5 E
-F0(,)A(int)180 276 Q F1(id)2.5 E F0(,)A(int)180 288 Q F1(time_i[7])2.5 E
-F0(,)A(double)180 300 Q F1(time_d)2.5 E F0(,)A(double)180 312 Q F1
-(navlon)2.5 E F0(,)A(double)180 324 Q F1(navlat)2.5 E F0(,)A(double)180
-336 Q F1(speed)2.5 E F0(,)A(double)180 348 Q F1(heading)2.5 E F0(,)A
-(double)180 360 Q F1(dr)2.5 E(aft)-.15 E F0(,)A(double)180 372 Q F1 -.45
-(ro)2.5 G(ll).45 E F0(,)A(double)180 384 Q F1(pitc)2.5 E(h)-.15 E F0(,)A
-(double)180 396 Q F1(heave)2.5 E F0(,)A(int)180 408 Q F1(*err)2.5 E(or)
--.45 E F0(\);)A 1.857(The function)108 432 R F2(mb_b)4.357 E
-(uffer_insert_na)-.2 E(v)-.25 E F0 1.857(inserts na)4.357 F(vig)-.2 E
-1.857(ation and v)-.05 F 1.856(ertical reference sensor data into a b)
--.15 F(uf)-.2 E(fer)-.25 E .514
-(record, replacing a subset of the original v)108 444 R 3.014
-(alues. The)-.25 F F1(verbose)3.014 E F0 -.25(va)3.014 G .515
-(lue controls the standard error output v).25 F(er)-.15 E(-)-.2 E
-(bosity of the function.)108 456 Q(The b)5 E(uf)-.2 E
-(fer record is speci\214ed with the b)-.25 E(uf)-.2 E(fer inde)-.25 E(x)
--.15 E F1(id)2.5 E F0(.)A(The input control parameters ha)108 480 Q .3
--.15(ve t)-.2 H(he follo).15 E(wing signi\214cance:)-.25 E F1(id)144 492
-Q F0 61.44(:T)C(he b)-61.44 E(uf)-.2 E(fer inde)-.25 E 2.5(xo)-.15 G 2.5
-(ft)-2.5 G(he data)-2.5 E(record to insert.)216 504 Q(The returned v)108
-528 Q(alues are:)-.25 E F1(kind)144 540 Q F0 52(:k)C
-(ind of data record inserted)-52 E 31(1s)288 552 S(urv)-31 E .3 -.15
-(ey d)-.15 H(ata).15 E 31(2c)288 564 S(omment)-31 E 17.22(>=3 other)288
-576 R(data that cannot)2.5 E(be passed by)324 588 Q F2(mb_b)2.5 E
-(uffer_insert_na)-.2 E(v)-.25 E F1(time_i)144 600 Q F0 44.22(:t)C
-(ime of current ping)-44.22 E F1(time_i)216 612 Q F0([0]: year)A F1
-(time_i)216 624 Q F0([1]: month)A F1(time_i)216 636 Q F0([2]: day)A F1
-(time_i)216 648 Q F0([3]: hour)A F1(time_i)216 660 Q F0([4]: minute)A F1
-(time_i)216 672 Q F0([5]: second)A F1(time_i)216 684 Q F0
-([6]: microsecond)A F1(time_d)144 696 Q F0 42(:t)C
-(ime of current ping in seconds)-42 E(since 1/1/70 00:00:00)216 708 Q F1
-(navlon)144 720 Q F0 42(:l)C(ongitude)-42 E(MB-System 5.0)72 768 Q 2.5
-(3J)146.495 G(une 2013)-2.5 E(47)199.835 E 0 Cg EP
-%%Page: 48 48
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F/F1 10/Times-Italic at 0 SF(navlat)144 84 Q F0 44.22
-(:l)C(atitude)-44.22 E F1(speed)144 96 Q F0 46.45(:s)C
-(hip speed in km/s)-46.45 E F1(heading)144 108 Q F0 37(:s)C
-(hip heading in de)-37 E(grees)-.15 E F1 -.45(ro)144 120 S(ll).45 E F0
-55.22(:s)C(hip roll in de)-55.22 E(grees)-.15 E F1(pitc)144 132 Q(h)-.15
-E F0 49.37(:s)C(hip pitch in de)-49.37 E(grees)-.15 E F1(heave)144 144 Q
-F0 45.9(:s)C(hip hea)-45.9 E .3 -.15(ve i)-.2 H 2.5(nm).15 G(eters)-2.5
-E 2.777(As)108 168 S .277(tatus v)-2.777 F .277
-(alue indicating success or f)-.25 F .277
-(ailure is returned; the error v)-.1 F .277(alue ar)-.25 F(gument)-.18 E
-F1(err)2.777 E(or)-.45 E F0 .276(passes more detailed)2.777 F
-(information about insert f)108 180 Q(ailures.)-.1 E
-(\255--------------------------------------------------------)108 204 Q
-(int)108 216 Q/F2 10/Times-Bold at 0 SF(mb_b)2.5 E(uffer_get_ptr)-.2 E F0
-(\()A(int)180 228 Q F1(verbose)2.5 E F0(,)A(char)180 240 Q F1(*b)2.5 E
-(uf)-.2 E(f_ptr)-.18 E F0(,)A(char)180 252 Q F1(*mbio_ptr)2.5 E F0(,)A
-(int)180 264 Q F1(id)2.5 E F0(,)A(char)180 276 Q F1(**stor)2.5 E(e_ptr)
--.37 E F0(,)A(int)180 288 Q F1(*err)2.5 E(or)-.45 E F0(\);)A 1.239
-(The function)108 312 R F2(mb_b)3.739 E(uffer_get_ptr)-.2 E F0 1.239
-(returns a pointer to the data structure in a b)3.739 F(uf)-.2 E 1.24
-(fer record.)-.25 F(The)6.24 E F1(verbose)3.74 E F0 -.25(va)108 324 S
-.878(lue controls the standard error output v).25 F .878
-(erbosity of the function.)-.15 F .877(The b)5.877 F(uf)-.2 E .877
-(fer record is speci\214ed with the)-.25 F -.2(bu)108 336 S -.25(ff).2 G
-.93(er inde).25 F(x)-.15 E F1(id)3.43 E F0 3.43(.T)C .931(he data retur\
-ned consists of a pointer to the data structure stored in the speci\214\
-ed b)-3.43 F(uf)-.2 E(fer)-.25 E(record.)108 348 Q
-(The input control parameters ha)108 372 Q .3 -.15(ve t)-.2 H(he follo)
-.15 E(wing signi\214cance:)-.25 E F1(id)144 384 Q F0 61.44(:T)C(he b)
--61.44 E(uf)-.2 E(fer inde)-.25 E 2.5(xo)-.15 G 2.5(ft)-2.5 G(he data)
--2.5 E(record to locate.)252 396 Q(The return v)108 420 Q(alues are:)
--.25 E F1(*stor)144 432 Q(e_ptr)-.37 E F0 27.92(:p)C
-(ointer to data in speci\214ed)-27.92 E -.2(bu)252 444 S -.25(ff).2 G
-(er record).25 E F1(err)144 456 Q(or)-.45 E F0 48.56(:e)C(rror v)-48.56
-E(alue)-.25 E 2.777(As)108 480 S .277(tatus v)-2.777 F .277
-(alue indicating success or f)-.25 F .277
-(ailure is returned; the error v)-.1 F .277(alue ar)-.25 F(gument)-.18 E
-F1(err)2.777 E(or)-.45 E F0 .276(passes more detailed)2.777 F
-(information about b)108 492 Q(uf)-.2 E(fer f)-.25 E(ailures.)-.1 E/F3
-10.95/Times-Bold at 0 SF(MISCELLANEOUS FUNCTIONS)72 520.8 Q F0(int)108
-532.8 Q F2(mb_defaults)2.5 E F0(\()A(int)180 544.8 Q F1(verbose)2.5 E F0
-(,)A(int)180 556.8 Q F1(*format)2.5 E F0(,)A(int)180 568.8 Q F1(*pings)
-2.5 E F0(,)A(int)180 580.8 Q F1(*lon\215ip)2.5 E F0(,)A(double)180 592.8
-Q F1(bounds[4])2.5 E F0(,)A(int)180 604.8 Q F1(*btime_i)2.5 E F0(,)A
-(int)180 616.8 Q F1(*etime_i)2.5 E F0(,)A(double)180 628.8 Q F1
-(*speedmin)2.5 E F0(,)A(double)180 640.8 Q F1(*time)2.5 E(gap)-.4 E F0
-(\);)A .412(The function)108 664.8 R F2(mb_defaults)2.912 E F0(pro)2.912
-E .412(vides def)-.15 F .412(ault v)-.1 F .412
-(alues of control parameters used by some of the)-.25 F F2(MBIO)2.912 E
-F0(func-)2.912 E .351(tions. The)108 676.8 R F1(verbose)2.851 E F0 -.25
-(va)2.851 G .351(lue controls the standard error output v).25 F .35
-(erbosity of the function.)-.15 F .35(The other parameters)5.35 F 2.163
-(are set by the function; the meaning of these parameters is discussed \
-in the listings of the functions)108 688.8 R F2(mb_r)108 700.8 Q
-(ead_init)-.18 E F0(and)2.96 E F2(mb_write_init)2.96 E F0 5.46(.I)C 2.96
-(fa)-5.46 G 2.96(n.)-2.96 G(mbio_def)-2.96 E .46(aults \214le e)-.1 F
-.46(xists in the user')-.15 F 2.96(sh)-.55 G .46(ome directory)-2.96 F
-2.96(,t)-.65 G .46(he lon\215ip)-2.96 F(and time)108 712.8 Q -.05(ga)
--.15 G 2.5(pd).05 G(ef)-2.5 E(aults are read from this \214le.)-.1 E
-(Otherwise, the v)5 E(alues are set as:)-.25 E F1(*lon\215ip)144 724.8 Q
-F0 2.5(=0)2.5 G(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E
-(48)199.835 E 0 Cg EP
-%%Page: 49 49
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F/F1 10/Times-Italic at 0 SF(*time)144 84 Q(gap)-.4 E F0
-2.5(=1)2.5 G(The other v)108 96 Q(alues are simply set as:)-.25 E F1
-(*format)144 108 Q F0 2.5(=0)2.5 G F1(*pings)144 120 Q F0 2.5(=1)2.5 G
-F1(bounds[0])144 132 Q F0 2.5<3dad>2.5 G(360.)-2.5 E F1(bounds[1])144
-144 Q F0 2.5(=3)2.5 G(60.)-2.5 E F1(bounds[2])144 156 Q F0 2.5<3dad>2.5
-G(90.)-2.5 E F1(bounds[3])144 168 Q F0 2.5(=9)2.5 G(0.)-2.5 E F1
-(btime_i[0])144 180 Q F0 2.5(=1)2.5 G(962;)-2.5 E F1(btime_i[1])144 192
-Q F0 2.5(=2)2.5 G(;)-2.5 E F1(btime_i[2])144 204 Q F0 2.5(=2)2.5 G(1;)
--2.5 E F1(btime_i[3])144 216 Q F0 2.5(=1)2.5 G(0;)-2.5 E F1(btime_i[4])
-144 228 Q F0 2.5(=3)2.5 G(0;)-2.5 E F1(btime_i[5])144 240 Q F0 2.5(=0)
-2.5 G(;)-2.5 E F1(btime_i[6])144 252 Q F0 2.5(=0)2.5 G(;)-2.5 E F1
-(etime_i[0])144 264 Q F0 2.5(=2)2.5 G(062;)-2.5 E F1(etime_i[1])144 276
-Q F0 2.5(=2)2.5 G(;)-2.5 E F1(etime_i[2])144 288 Q F0 2.5(=2)2.5 G(1;)
--2.5 E F1(etime_i[3])144 300 Q F0 2.5(=1)2.5 G(0;)-2.5 E F1(etime_i[4])
-144 312 Q F0 2.5(=3)2.5 G(0;)-2.5 E F1(etime_i[5])144 324 Q F0 2.5(=0)
-2.5 G(;)-2.5 E F1(etime_i[6])144 336 Q F0 2.5(=0)2.5 G(;)-2.5 E F1
-(*speedmin)144 348 Q F0 2.5(=0)2.5 G(.0)-2.5 E 2.5(As)108 372 S(tatus v)
--2.5 E(alue is returned to indicate success or f)-.25 E(ailure.)-.1 E
-(\255--------------------------------------------------------)108 396 Q
-(int)108 408 Q/F2 10/Times-Bold at 0 SF(mb_en)2.5 E(v)-.4 E F0(\()A(int)180
-420 Q F1(verbose)2.5 E F0(,)A(char)180 432 Q F1(*psdisplay)2.5 E F0(,)A
-(char)180 444 Q F1(*imgdisplay)2.5 E F0(,)A(char)180 456 Q F1(*mbpr)2.5
-E(oject)-.45 E F0(\);)A .815(The function)108 480 R F2(mb_en)3.315 E(v)
--.4 E F0(pro)3.315 E .815(vides def)-.15 F .816(ault v)-.1 F .816
-(alues of Postscript and image display programs in)-.25 F -.2(vo)-.4 G
--.1(ke).2 G 3.316(db).1 G 3.316(ys)-3.316 G(ome)-3.316 E F2(MB-System)
-108 492 Q F0 1.228(programs and macros, and a def)3.728 F 1.228(ault v)
--.1 F 1.228(alue for a w)-.25 F 1.227
-(orking project name that will be used by)-.1 F 1.091
-(future applications. The)108 504 R F1(verbose)3.591 E F0 -.25(va)3.591
-G 1.091(lue controls the standard error output v).25 F 1.092
-(erbosity of the function.)-.15 F 1.092(If an)6.092 F(.mbio_def)108 516
-Q .247(aults \214le e)-.1 F .247(xists in the user')-.15 F 2.747(sh)-.55
-G .247(ome directory)-2.747 F 2.747(,t)-.65 G(he)-2.747 E F1(*psdisplay)
-2.747 E F0(,)A F1(*imgdisplay)2.747 E F0(,)A F1(*mbpr)2.747 E(oject)-.45
-E F0(def)2.747 E .246(aults are)-.1 F(read from this \214le.)108 528 Q
-(Otherwise, the v)5 E(alues are set as:)-.25 E F1(psdisplay)144 540 Q F0
-5(=")2.5 G(xpsvie)-5 E(w" \(IRIX OS\))-.25 E("page)191.5 552 Q(vie)-.25
-E(w" \(Solaris OS\))-.25 E("gv" \(other OS\))191.5 564 Q("ghostvie)191.5
-576 Q(w" \(other OS\))-.25 E F1(imgdisplay)144 588 Q F0 2.5(=")2.5 G
-(gimp" \(Linux OS\))-2.5 E("xv" \(other than Linux OS\))191.5 600 Q F1
-(mbpr)144 612 Q(oject)-.45 E F0 5(=")2.5 G(none")-5 E
-(\255--------------------------------------------------------)108 636 Q
-(int)108 648 Q F2(mb_f)2.5 E(ormat)-.25 E F0(\()A(int)180 660 Q F1
-(verbose)2.5 E F0(,)A(int)180 672 Q F1(*format)2.5 E F0(,)A(int)180 684
-Q F1(*err)2.5 E(or)-.45 E F0(\);)A(Gi)108 708 Q -.15(ve)-.25 G 2.511(nt)
-.15 G .011(he format identi\214er)-2.511 F F1(format)2.511 E F0(,)A F2
-(mb_f)2.511 E(ormat)-.25 E F0 .011(checks if the format is v)2.511 F
-2.511(alid. If)-.25 F .012(the format id corresponds to)2.511 F 4.222
-(av)108 720 S 1.722(alue used in pre)-4.472 F 1.722(vious \(<4.00\) v)
--.25 F 1.722(ersions of)-.15 F F2(MB-System)4.222 E F0 4.222(,t)C 1.722
-(hen the format v)-4.222 F 1.721(alue will be aliased to the)-.25 F
-(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(49)199.835 E 0
-Cg EP
-%%Page: 50 50
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F(current corresponding v)108 84 Q(alue.)-.25 E
-(The return v)108 108 Q(alues are:)-.25 E/F1 10/Times-Italic at 0 SF
-(format)144 120 Q F0(:)A/F2 10/Times-Bold at 0 SF(MBIO)42.55 E F0
-(format id)2.5 E F1(err)144 132 Q(or)-.45 E F0 48.56(:e)C(rror v)-48.56
-E(alue)-.25 E 2.776(As)108 156 S .276(tatus v)-2.776 F .277
-(alue indicating success or f)-.25 F .277
-(ailure is returned; the error v)-.1 F .277(alue ar)-.25 F(gument)-.18 E
-F1(err)2.777 E(or)-.45 E F0 .277(passes more detailed)2.777 F
-(information about f)108 168 Q(ailures.)-.1 E
-(\255--------------------------------------------------------)108 192 Q
-(int)108 204 Q F2(mb_f)2.5 E(ormat_r)-.25 E(egister)-.18 E F0(\()A(int)
-180 216 Q F1(verbose)2.5 E F0(,)A(int)180 228 Q F1(*format)2.5 E F0(,)A
-(char)180 240 Q F1(*mbio_ptr)2.5 E F0(,)A(int)180 252 Q F1(*err)2.5 E
-(or)-.45 E F0(\);)A .069(The function)108 276 R F2(mb_f)2.569 E(ormat_r)
--.25 E(egister)-.18 E F0 .069(is called by)2.569 F F2(mb_r)2.569 E
-(ead_init)-.18 E F0(and)2.568 E F2(mb_write_init)2.568 E F0 .068
-(and serv)2.568 F .068(es to load format)-.15 F .218
-(speci\214c parameters and function parameters into the)108 288 R F2
-(MBIO)2.719 E F0 .219(control structure pointed to by)2.719 F F1(*err)
-2.719 E(or)-.45 E F0 2.719(.T)C .219(he for)-2.719 F(-)-.2 E .192
-(mat id)108 300 R F1(*format)2.692 E F0 .191(is \214rst check)2.691 F
-.191(ed for v)-.1 F(alidity)-.25 E 2.691(.I)-.65 G 2.691(ns)-2.691 G
-.191(ome cases, formerly v)-2.691 F .191(alid b)-.25 F .191(ut no)-.2 F
-2.691(wo)-.25 G .191(bsolete format id v)-2.691 F(alues)-.25 E
-(are mapped to current v)108 312 Q(alues.)-.25 E(The input v)108 336 Q
-(alues are:)-.25 E F1(*format)144 348 Q F0(:)A F2(MBIO)37.55 E F0
-(format id)2.5 E F1(*mbio_ptr)144 360 Q F0 27.55(:p)C
-(ointer to data in speci\214ed)-27.55 E -.2(bu)252 372 S -.25(ff).2 G
-(er record).25 E(The return v)108 396 Q(alues are:)-.25 E F1(err)144 408
-Q(or)-.45 E F0 48.56(:e)C(rror v)-48.56 E(alue)-.25 E 2.776(As)108 432 S
-.276(tatus v)-2.776 F .277(alue indicating success or f)-.25 F .277
-(ailure is returned; the error v)-.1 F .277(alue ar)-.25 F(gument)-.18 E
-F1(err)2.777 E(or)-.45 E F0 .277(passes more detailed)2.777 F
-(information about f)108 444 Q(ailures.)-.1 E
-(\255--------------------------------------------------------)108 468 Q
-(int)108 480 Q F2(mb_f)2.5 E(ormat_inf)-.25 E(o)-.25 E F0(\()A(int)180
-492 Q F1(verbose)2.5 E F0(,)A(int)180 504 Q F1(*format)2.5 E F0(,)A(int)
-180 516 Q F1(*system)2.5 E F0(,)A(int)180 528 Q F1(*beams_bath_max)2.5 E
-F0(,)A(int)180 540 Q F1(*beams_amp_max)2.5 E F0(,)A(int)180 552 Q F1
-(*pixels_ss_max)2.5 E F0(,)A(char)180 564 Q F1(*format_name)2.5 E F0(,)A
-(char)180 576 Q F1(*system_name)2.5 E F0(,)A(char)180 588 Q F1
-(*format_description)2.5 E F0(,)A(int)180 600 Q F1(*num\214le)2.5 E F0
-(,)A(int)180 612 Q F1(*\214letype)2.5 E F0(,)A(int)180 624 Q F1
-(*variable_beams)2.5 E F0(,)A(int)180 636 Q F1(*tr)2.5 E(aveltime)-.15 E
-F0(,)A(int)180 648 Q F1(*beam_\215a)2.5 E -.1(gg)-.1 G(ing).1 E F0(,)A
-(int)180 660 Q F1(*nav_sour)2.5 E(ce)-.37 E F0(,)A(int)180 672 Q F1
-(*heading_sour)2.5 E(ce)-.37 E F0(,)A(int)180 684 Q F1(*vru_sour)2.5 E
-(ce)-.37 E F0(,)A(double)180 696 Q F1(*beamwidth_xtr)2.5 E(ac)-.15 E(k)
--.2 E F0(,)A(double)180 708 Q F1(*beamwidth_ltr)2.5 E(ac)-.15 E(k)-.2 E
-F0(,)A(int)180 720 Q F1(*err)2.5 E(or)-.45 E F0(\);)A(MB-System 5.0)72
-768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(50)199.835 E 0 Cg EP
-%%Page: 51 51
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F .62(The function)108 84 R/F1 10/Times-Bold at 0 SF
-(mb_f)3.12 E(ormat_inf)-.25 E(o)-.25 E F0 .62(returns a v)3.12 F .619
-(ariety of data format speci\214c parameters. The format id)-.25 F/F2 10
-/Times-Italic at 0 SF(*format)3.119 E F0 .346(is \214rst check)108 96 R
-.346(ed for v)-.1 F(alidity)-.25 E 2.846(.I)-.65 G 2.846(ns)-2.846 G
-.347(ome cases, formerly v)-2.846 F .347(alid b)-.25 F .347(ut no)-.2 F
-2.847(wo)-.25 G .347(bsolete format id v)-2.847 F .347
-(alues are mapped to)-.25 F(current v)108 108 Q(alues.)-.25 E
-(The input v)108 132 Q(alues are:)-.25 E F2(*format)144 144 Q F0(:)A F1
-(MBIO)37.55 E F0(format id)2.5 E(The return v)108 168 Q(alues are:)-.25
-E F2(*format)144 180 Q F0(:)A F1(MBIO)37.55 E F0(format id)2.5 E F2
-(*system)144 192 Q F0(:)A F1(MBIO)37.56 E F0(sonar system id)2.5 E F2
-(*beams_bath_max)144 204 Q F0 30.23(:m)C(aximum number of bath)-30.23 E
-(ymetry beams)-.05 E F2(*beams_amp_max)144 216 Q F0 30.79(:m)C
-(aximum number of amplitude beams)-30.79 E F2(*pixels_ss_max)144 228 Q
-F0 6.45(:m)C(aximum number of sidescan pix)-6.45 E(els)-.15 E F2
-(*format_name)144 240 Q F0(:)A F1(MBIO)10.89 E F0(format name)2.5 E F2
-(*system_name)144 252 Q F0(:)A F1(MBIO)10.9 E F0(sonar system name)2.5 E
-F2(*format_description)144 264 Q F0(:)A F1(MBIO)23.55 E F0
-(format description)2.5 E F2(*num\214le)144 276 Q F0 70.78(:n)C
-(umber of parallel data \214les used in format)-70.78 E F2(*\214letype)
-144 288 Q F0 35.34(:t)C(ype of data \214les)-35.34 E F2(*variable_beams)
-144 300 Q F0 .34(:n)C(umber of beams can v)-.34 E(ary [boolean])-.25 E
-F2(*tr)144 312 Q(aveltime)-.15 E F0 23.82(:t)C(ra)-23.82 E -.15(ve)-.2 G
-2.5(lt).15 G(ime data a)-2.5 E -.25(va)-.2 G(ilable [boolean]).25 E F2
-(*beam_\215a)144 324 Q -.1(gg)-.1 G(ing).1 E F0 4.98(:b)C
-(eam \215agging supported [boolean])-4.98 E F2(*nav_sour)144 336 Q(ce)
--.37 E F0 18.49(:k)C(ind of data records containing na)-18.49 E(vig)-.2
-E(ation)-.05 E F2(*heading_sour)144 348 Q(ce)-.37 E F0 .71(:k)C
-(ind of data records containing)-.71 E(heading)252 360 Q F2(*vru_sour)
-144 372 Q(ce)-.37 E F0 19.6(:k)C(ind of data records containing)-19.6 E
-(attitude)252 384 Q F2(*beamwidth_xtr)144 396 Q(ac)-.15 E(k)-.2 E F0
-26.69(:t)C(ypical athw)-26.69 E(artships beam)-.1 E(width [de)288 408 Q
-(grees])-.15 E F2(*beamwidth_ltr)144 420 Q(ac)-.15 E(k)-.2 E F0 28.35
-(:t)C(ypical alongtrack beam)-28.35 E(width [de)288 432 Q(grees])-.15 E
-F2(err)144 444 Q(or)-.45 E F0 48.56(:e)C(rror v)-48.56 E(alue)-.25 E
-2.777(As)108 468 S .277(tatus v)-2.777 F .277
-(alue indicating success or f)-.25 F .277
-(ailure is returned; the error v)-.1 F .277(alue ar)-.25 F(gument)-.18 E
-F2(err)2.777 E(or)-.45 E F0 .276(passes more detailed)2.777 F
-(information about f)108 480 Q(ailures.)-.1 E
-(\255--------------------------------------------------------)108 504 Q
-(int)108 516 Q F1(mb_f)2.5 E(ormat_system)-.25 E F0(\()A(int)180 528 Q
-F2(verbose)2.5 E F0(,)A(int)180 540 Q F2(*format)2.5 E F0(,)A(int)180
-552 Q F2(*system)2.5 E F0(,)A(int)180 564 Q F2(*err)2.5 E(or)-.45 E F0
-(\);)A 2.485(The function)108 588 R F1(mb_f)4.985 E(ormat_system)-.25 E
-F0 2.485(returns the)4.985 F F1(MBIO)4.985 E F0 2.485
-(sonar system id. The format id)4.985 F F2(*format)4.985 E F0 2.485
-(is \214rst)4.985 F(check)108 600 Q .807(ed for v)-.1 F(alidity)-.25 E
-3.307(.I)-.65 G 3.307(ns)-3.307 G .807(ome cases, formerly v)-3.307 F
-.807(alid b)-.25 F .807(ut no)-.2 F 3.307(wo)-.25 G .807
-(attintbsolete format id v)-3.307 F .806(alues are mapped to)-.25 F
-(current v)108 612 Q(alues. The input v)-.25 E(alues are:)-.25 E F2
-(*format)144 624 Q F0(:)A F1(MBIO)37.55 E F0(format id)2.5 E
-(The return v)108 636 Q(alues are:)-.25 E F2(*format)144 648 Q F0(:)A F1
-(MBIO)37.55 E F0(format id)2.5 E F2(*system)144 660 Q F0(:)A F1(MBIO)
-37.56 E F0(sonar system id)2.5 E F2(err)144 672 Q(or)-.45 E F0 48.56(:e)
-C(rror v)-48.56 E(alue)-.25 E 2.776(As)108 684 S .276(tatus v)-2.776 F
-.277(alue indicating success or f)-.25 F .277
-(ailure is returned; the error v)-.1 F .277(alue ar)-.25 F(gument)-.18 E
-F2(err)2.777 E(or)-.45 E F0 .277(passes more detailed)2.777 F
-(information about f)108 696 Q(ailures.)-.1 E
-(\255--------------------------------------------------------)108 720 Q
-(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(51)199.835 E 0
-Cg EP
-%%Page: 52 52
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F(int)108 84 Q/F1 10/Times-Bold at 0 SF(mb_f)2.5 E
-(ormat_description)-.25 E F0(\()A(int)180 96 Q/F2 10/Times-Italic at 0 SF
-(verbose)2.5 E F0(,)A(int)180 108 Q F2(*format)2.5 E F0(,)A(char)180 120
-Q F2(*description)2.5 E F0(,)A(int)180 132 Q F2(*err)2.5 E(or)-.45 E F0
-(\);)A .818(The function)108 156 R F1(mb_f)3.318 E(ormat_description)
--.25 E F0 .818(returns a short description of the format in the string)
-3.318 F F2(*description)3.317 E F0(.)A .085(The format id)108 168 R F2
-(*format)2.585 E F0 .085(is \214rst check)2.585 F .085(ed for v)-.1 F
-(alidity)-.25 E 2.585(.I)-.65 G 2.585(ns)-2.585 G .085
-(ome cases, formerly v)-2.585 F .085(alid b)-.25 F .085(ut no)-.2 F
-2.585(wo)-.25 G .085(bsolete format id)-2.585 F -.25(va)108 180 S
-(lues are mapped to current v).25 E(alues. The input v)-.25 E
-(alues are:)-.25 E F2(*format)144 192 Q F0(:)A F1(MBIO)37.55 E F0
-(format id)2.5 E(The return v)108 204 Q(alues are:)-.25 E F2(*format)144
-216 Q F0(:)A F1(MBIO)37.55 E F0(format id)2.5 E F2(*format_description)
-144 228 Q F0(:)A F1(MBIO)23.55 E F0(format description)2.5 E F2(err)144
-240 Q(or)-.45 E F0 48.56(:e)C(rror v)-48.56 E(alue)-.25 E 2.777(As)108
-252 S .277(tatus v)-2.777 F .277(alue indicating success or f)-.25 F
-.277(ailure is returned; the error v)-.1 F .277(alue ar)-.25 F(gument)
--.18 E F2(err)2.777 E(or)-.45 E F0 .276(passes more detailed)2.777 F
-(information about f)108 264 Q(ailures.)-.1 E
-(\255--------------------------------------------------------)108 288 Q
-(int)108 300 Q F1(mb_f)2.5 E(ormat_dimensions)-.25 E F0(\()A(int)180 312
-Q F2(verbose)2.5 E F0(,)A(int)180 324 Q F2(*format)2.5 E F0(,)A(int)180
-336 Q F2(*beams_bath_max)2.5 E F0(,)A(int)180 348 Q F2(*beams_amp_max)
-2.5 E F0(,)A(int)180 360 Q F2(*pixels_ss_max)2.5 E F0(,)A(int)180 372 Q
-F2(*err)2.5 E(or)-.45 E F0(\);)A .527(The function)108 396 R F1(mb_f)
-3.027 E(ormat_dimensions)-.25 E F0 .528
-(returns the maximum numbers of beams and pix)3.027 F .528
-(els associated with)-.15 F 3.252(ap)108 408 S .751
-(articular data format. The format id)-3.252 F F2(*format)3.251 E F0
-.751(is \214rst check)3.251 F .751(ed for v)-.1 F(alidity)-.25 E 3.251
-(.I)-.65 G 3.251(ns)-3.251 G .751(ome cases, formerly v)-3.251 F(alid)
--.25 E -.2(bu)108 420 S 2.5(tn).2 G .5 -.25(ow o)-2.5 H
-(bsolete format id v).25 E(alues are mapped to current v)-.25 E
-(alues. The input v)-.25 E(alues are:)-.25 E F2(*format)144 432 Q F0(:)A
-F1(MBIO)37.55 E F0(format id)2.5 E(The return v)108 444 Q(alues are:)
--.25 E F2(*format)144 456 Q F0(:)A F1(MBIO)37.55 E F0(format id)2.5 E F2
-(*beams_bath_max)144 468 Q F0 30.23(:m)C(aximum number of bath)-30.23 E
-(ymetry beams)-.05 E F2(*beams_amp_max)144 480 Q F0 30.79(:m)C
-(aximum number of amplitude beams)-30.79 E F2(*pixels_ss_max)144 492 Q
-F0 6.45(:m)C(aximum number of sidescan pix)-6.45 E(els)-.15 E F2(err)144
-504 Q(or)-.45 E F0 48.56(:e)C(rror v)-48.56 E(alue)-.25 E 2.776(As)108
-516 S .276(tatus v)-2.776 F .277(alue indicating success or f)-.25 F
-.277(ailure is returned; the error v)-.1 F .277(alue ar)-.25 F(gument)
--.18 E F2(err)2.777 E(or)-.45 E F0 .277(passes more detailed)2.777 F
-(information about f)108 528 Q(ailures.)-.1 E
-(\255--------------------------------------------------------)108 552 Q
-(int)108 564 Q F1(mb_f)2.5 E(ormat_\215ags)-.25 E F0(\()A(int)180 576 Q
-F2(verbose)2.5 E F0(,)A(int)180 588 Q F2(*format)2.5 E F0(,)A(int)180
-600 Q F2(*variable_beams)2.5 E F0(,)A(int)180 612 Q F2(*tr)2.5 E
-(aveltime)-.15 E F0(,)A(int)180 624 Q F2(*beam_\215a)2.5 E -.1(gg)-.1 G
-(ing).1 E F0(,)A(int)180 636 Q F2(*err)2.5 E(or)-.45 E F0(\);)A .635
-(The function)108 660 R F1(mb_f)3.135 E(ormat_\215ags)-.25 E F0 .634(re\
-turns \215ags indicating certain characteristics of the speci\214ed dat\
-a format.)3.134 F .085(The format id)108 672 R F2(*format)2.585 E F0
-.085(is \214rst check)2.585 F .085(ed for v)-.1 F(alidity)-.25 E 2.585
-(.I)-.65 G 2.585(ns)-2.585 G .085(ome cases, formerly v)-2.585 F .085
-(alid b)-.25 F .085(ut no)-.2 F 2.585(wo)-.25 G .085(bsolete format id)
--2.585 F -.25(va)108 684 S(lues are mapped to current v).25 E
-(alues. The input v)-.25 E(alues are:)-.25 E F2(*format)144 696 Q F0(:)A
-F1(MBIO)37.55 E F0(format id)2.5 E(The return v)108 708 Q(alues are:)
--.25 E F2(*format)144 720 Q F0(:)A F1(MBIO)37.55 E F0(format id)2.5 E
-(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(52)199.835 E 0
-Cg EP
-%%Page: 53 53
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F/F1 10/Times-Italic at 0 SF(*variable_beams)144 84 Q F0
-.34(:n)C(umber of beams can v)-.34 E(ary [boolean])-.25 E F1(*tr)144 96
-Q(aveltime)-.15 E F0 23.82(:t)C(ra)-23.82 E -.15(ve)-.2 G 2.5(lt).15 G
-(ime data a)-2.5 E -.25(va)-.2 G(ilable [boolean]).25 E F1(*beam_\215a)
-144 108 Q -.1(gg)-.1 G(ing).1 E F0 4.98(:b)C
-(eam \215agging supported [boolean])-4.98 E F1(err)144 120 Q(or)-.45 E
-F0 48.56(:e)C(rror v)-48.56 E(alue)-.25 E 2.777(As)108 132 S .277
-(tatus v)-2.777 F .277(alue indicating success or f)-.25 F .277
-(ailure is returned; the error v)-.1 F .277(alue ar)-.25 F(gument)-.18 E
-F1(err)2.777 E(or)-.45 E F0 .276(passes more detailed)2.777 F
-(information about f)108 144 Q(ailures.)-.1 E
-(\255--------------------------------------------------------)108 168 Q
-(int)108 180 Q/F2 10/Times-Bold at 0 SF(mb_f)2.5 E(ormat_sour)-.25 E(ce)
--.18 E F0(\()A(int)180 192 Q F1(verbose)2.5 E F0(,)A(int)180 204 Q F1
-(*format)2.5 E F0(,)A(int)180 216 Q F1(*nav_sour)2.5 E(ce)-.37 E F0(,)A
-(int)180 228 Q F1(*heading_sour)2.5 E(ce)-.37 E F0(,)A(int)180 240 Q F1
-(*vru_sour)2.5 E(ce)-.37 E F0(,)A(int)180 252 Q F1(*err)2.5 E(or)-.45 E
-F0(\);)A 1.363(The function)108 276 R F2(mb_f)3.863 E(ormat_sour)-.25 E
-(ce)-.18 E F0 1.363
-(returns \215ags indicating what kinds of data records contain na)3.863
-F(vig)-.2 E(ation,)-.05 E .227(heading, and attitude v)108 288 R .227
-(alues in the speci\214ed data format. The format id)-.25 F F1(*format)
-2.727 E F0 .227(is \214rst check)2.727 F .227(ed for v)-.1 F(alidity)
--.25 E(.)-.65 E .895(In some cases, formerly v)108 300 R .895(alid b)
--.25 F .895(ut no)-.2 F 3.395(wo)-.25 G .895(bsolete format id v)-3.395
-F .896(alues are mapped to current v)-.25 F .896(alues. The input)-.25 F
--.25(va)108 312 S(lues are:).25 E F1(*format)144 324 Q F0(:)A F2(MBIO)
-37.55 E F0(format id)2.5 E(The return v)108 336 Q(alues are:)-.25 E F1
-(*format)144 348 Q F0(:)A F2(MBIO)37.55 E F0(format id)2.5 E F1
-(*nav_sour)144 360 Q(ce)-.37 E F0 18.49(:k)C
-(ind of data records containing)-18.49 E(na)252 372 Q(vig)-.2 E(ation)
--.05 E F1(*heading_sour)144 384 Q(ce)-.37 E F0 .71(:k)C
-(ind of data records containing)-.71 E(heading)252 396 Q F1(*vru_sour)
-144 408 Q(ce)-.37 E F0 19.6(:k)C(ind of data records containing)-19.6 E
-(attitude)252 420 Q F1(err)144 432 Q(or)-.45 E F0 48.56(:e)C(rror v)
--48.56 E(alue)-.25 E 2.777(As)108 444 S .277(tatus v)-2.777 F .277
-(alue indicating success or f)-.25 F .277
-(ailure is returned; the error v)-.1 F .277(alue ar)-.25 F(gument)-.18 E
-F1(err)2.777 E(or)-.45 E F0 .276(passes more detailed)2.777 F
-(information about f)108 456 Q(ailures.)-.1 E
-(\255--------------------------------------------------------)108 480 Q
-(int)108 492 Q F2(mb_f)2.5 E(ormat_beamwidth)-.25 E F0(\()A(int)180 504
-Q F1(verbose)2.5 E F0(,)A(int)180 516 Q F1(*format)2.5 E F0(,)A(double)
-180 528 Q F1(*beamwidth_xtr)2.5 E(ac)-.15 E(k)-.2 E F0(,)A(double)180
-540 Q F1(*beamwidth_ltr)2.5 E(ac)-.15 E(k)-.2 E F0(,)A(int)180 552 Q F1
-(*err)2.5 E(or)-.45 E F0(\);)A .495(The function)108 576 R F2(mb_f)2.995
-E(ormat_beamwidth)-.25 E F0 .495(returns typical, upper bound v)2.995 F
-.496(alues for athw)-.25 F .496(artships and alongtrack)-.1 F 1.234
-(beam widths. The format id)108 588 R F1(*format)3.734 E F0 1.234
-(is \214rst check)3.734 F 1.234(ed for v)-.1 F(alidity)-.25 E 3.733(.I)
--.65 G 3.733(ns)-3.733 G 1.233(ome cases, formerly v)-3.733 F 1.233
-(alid b)-.25 F 1.233(ut no)-.2 F(w)-.25 E(obsolete format id v)108 600 Q
-(alues are mapped to current v)-.25 E(alues. The input v)-.25 E
-(alues are:)-.25 E F1(*format)144 612 Q F0(:)A F2(MBIO)37.55 E F0
-(format id)2.5 E(The return v)108 624 Q(alues are:)-.25 E F1(*format)144
-636 Q F0(:)A F2(MBIO)37.55 E F0(format id)2.5 E F1(*beamwidth_xtr)144
-648 Q(ac)-.15 E(k)-.2 E F0 26.69(:t)C(ypical athw)-26.69 E
-(artships beam)-.1 E(width [de)288 660 Q(grees])-.15 E F1
-(*beamwidth_ltr)144 672 Q(ac)-.15 E(k)-.2 E F0 28.35(:t)C
-(ypical alongtrack beam)-28.35 E(width [de)288 684 Q(grees])-.15 E F1
-(err)144 696 Q(or)-.45 E F0 48.56(:e)C(rror v)-48.56 E(alue)-.25 E 2.776
-(As)108 708 S .276(tatus v)-2.776 F .277(alue indicating success or f)
--.25 F .277(ailure is returned; the error v)-.1 F .277(alue ar)-.25 F
-(gument)-.18 E F1(err)2.777 E(or)-.45 E F0 .277(passes more detailed)
-2.777 F(information about f)108 720 Q(ailures.)-.1 E(MB-System 5.0)72
-768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(53)199.835 E 0 Cg EP
-%%Page: 54 54
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F
-(\255--------------------------------------------------------)108 84 Q
-(int)108 96 Q/F1 10/Times-Bold at 0 SF(mb_datalist_open)2.5 E F0(\()A(int)
-180 108 Q/F2 10/Times-Italic at 0 SF(verbose)2.5 E F0(,)A(char)180 120 Q F2
-(**datalist)2.5 E F0(,)A(char)180 132 Q F2(*path)2.5 E F0(,)A(int)180
-144 Q F2(look_pr)2.5 E(ocessed)-.45 E F0(,)A(int)180 156 Q F2(*err)2.5 E
-(or)-.45 E F0(\);)A .665(The function)108 180 R F1(mb_datalist_open)
-3.165 E F0 .665(initializes reading from a datalist tree. The string)
-3.165 F F2(*path)3.165 E F0 .665(is the path to the)3.165 F .414(top le)
-108 192 R -.15(ve)-.25 G 2.914(ld).15 G .414
-(atalist \214le to be opened.)-2.914 F .414(The v)5.414 F(alue)-.25 E F2
-(look_pr)2.914 E(ocessed)-.45 E F0 .414
-(indicates whether the datalist parsing should)2.914 F .018
-(look for or ignore processed data \214les \(see the)108 204 R F1(mbpr)
-2.517 E(ocess)-.18 E F0(and)2.517 E F1(mbdatalist)2.517 E F0 .017
-(manual pages\).)2.517 F .017(The input v)5.017 F(alues)-.25 E(are:)108
-216 Q F2(*path)144 228 Q F0 46.44(:d)C(atalist \214le to be opened)
--46.44 E F2(look_pr)144 240 Q(ocessed)-.45 E F0 7.46(:p)C
-(rocessed \214le beha)-7.46 E(vior)-.2 E 2.5(0:u)288 252 S(nset)-2.5 E
-2.5(1:i)288 264 S(gnore processed \214les)-2.5 E 2.5(2:r)288 276 S
-(eturn processed \214les)-2.5 E(The return v)108 288 Q(alues are:)-.25 E
-F2(**datalist)144 300 Q F0 29.21(:p)C(ointer to datalist)-29.21 E
-(structure)252 312 Q F2(err)144 324 Q(or)-.45 E F0 48.56(:e)C(rror v)
--48.56 E(alue)-.25 E 2.776(As)108 336 S .276(tatus v)-2.776 F .277
-(alue indicating success or f)-.25 F .277
-(ailure is returned; the error v)-.1 F .277(alue ar)-.25 F(gument)-.18 E
-F2(err)2.777 E(or)-.45 E F0 .277(passes more detailed)2.777 F
-(information about f)108 348 Q(ailures.)-.1 E
-(\255--------------------------------------------------------)108 372 Q
-(int)108 384 Q F1(mb_datalist_r)2.5 E(ead)-.18 E F0(\()A(int)180 396 Q
-F2(verbose)2.5 E F0(,)A(char)180 408 Q F2(*datalist)2.5 E F0(,)A(char)
-180 420 Q F2(*path)2.5 E F0(,)A(int)180 432 Q F2(*format)2.5 E F0(,)A
-(double)180 444 Q F2(*weight)2.5 E F0(,)A(int)180 456 Q F2(*err)2.5 E
-(or)-.45 E F0(\);)A 1.015(The function)108 480 R F1(mb_datalist_r)3.515
-E(ead)-.18 E F0 1.015
-(reads from a datalist tree, attempting to return the path to the ne)
-3.515 F 1.015(xt v)-.15 F(alid)-.25 E(sw)108 492 Q .007(ath data \214le\
-, the corresponding data format id, and a gridding weight \(see the)-.1
-F F1(mbpr)2.508 E(ocess)-.18 E F0(and)2.508 E F1(mbdatalist)2.508 E F0
-.528(manual pages\).)108 504 R .527(Information about the datalist tree\
- is embedded in a data structure pointed to by)5.528 F F2(*datalist)
-3.027 E F0(.)A(The input v)108 516 Q(alues are:)-.25 E F2(*datalist)144
-528 Q F0 34.21(:p)C(ointer to datalist)-34.21 E(structure)252 540 Q
-(The return v)108 552 Q(alues are:)-.25 E F2(*path)144 564 Q F0 46.44
-(:s)C -.1(wa)-46.44 G(th data \214le).1 E F2(*format)144 576 Q F0(:)A F1
-(MBIO)37.55 E F0(format id)2.5 E F2(*weight)144 588 Q F0(:)A F1(mbgrid)
-37.55 E F0(gridding weight)2.5 E F2(err)144 600 Q(or)-.45 E F0 48.56(:e)
-C(rror v)-48.56 E(alue)-.25 E 2.776(As)108 612 S .276(tatus v)-2.776 F
-.277(alue indicating success or f)-.25 F .277
-(ailure is returned; the error v)-.1 F .277(alue ar)-.25 F(gument)-.18 E
-F2(err)2.777 E(or)-.45 E F0 .277(passes more detailed)2.777 F
-(information about f)108 624 Q(ailures.)-.1 E
-(\255--------------------------------------------------------)108 648 Q
-(int)108 660 Q F1(mb_datalist_close)2.5 E F0(\()A(int)180 672 Q F2
-(verbose)2.5 E F0(,)A(char)180 684 Q F2(**datalist)2.5 E F0(,)A(int)180
-696 Q F2(*err)2.5 E(or)-.45 E F0(\);)A .843(The function)108 720 R F1
-(mb_datalist_close)3.343 E F0 .842(closes an open datalist tree, and de\
-allocates the data structure pointed to)3.342 F(MB-System 5.0)72 768 Q
-2.5(3J)146.495 G(une 2013)-2.5 E(54)199.835 E 0 Cg EP
-%%Page: 55 55
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F(by)108 84 Q/F1 10/Times-Italic at 0 SF(*datalist)2.5 E
-F0 2.5(.T)C(he input v)-2.5 E(alues are:)-.25 E F1(*datalist)144 96 Q F0
-34.21(:p)C(ointer to datalist)-34.21 E(structure)252 108 Q(The return v)
-108 120 Q(alues are:)-.25 E F1(err)144 132 Q(or)-.45 E F0 48.56(:e)C
-(rror v)-48.56 E(alue)-.25 E 2.776(As)108 144 S .276(tatus v)-2.776 F
-.277(alue indicating success or f)-.25 F .277
-(ailure is returned; the error v)-.1 F .277(alue ar)-.25 F(gument)-.18 E
-F1(err)2.777 E(or)-.45 E F0 .277(passes more detailed)2.777 F
-(information about f)108 156 Q(ailures.)-.1 E
-(\255--------------------------------------------------------)108 180 Q
-(int)108 192 Q/F2 10/Times-Bold at 0 SF(mb_alloc)2.5 E F0(\()A(int)180 204
-Q F1(verbose)2.5 E F0(,)A(char)180 216 Q F1(*mbio_ptr)2.5 E F0(,)A(char)
-180 228 Q F1(**stor)2.5 E(e_ptr)-.37 E F0(,)A(int)180 240 Q F1(*err)2.5
-E(or)-.45 E F0(\);)A 1.596(The function)108 264 R F2(mb_alloc)4.096 E F0
-1.596(allocates a data structure for internal storage of sw)4.096 F
-1.595(ath sonar data and returns a)-.1 F 1.432
-(pointer to this structure in)108 276 R F1(*stor)3.932 E(e_ptr)-.37 E F0
-6.432(.T)C 1.433
-(he data structure is speci\214c to the data format identi\214ed in the)
--6.432 F F2(MBIO)108 288 Q F0(data structure pointed to by)2.5 E F1
-(*mbio_ptr)2.5 E F0 5(.T)C(he input v)-5 E(alues are:)-.25 E F1
-(*mbio_ptr)144 300 Q F0 27.55(:p)C(ointer to)-27.55 E F2(MBIO)2.5 E F0
-(structure)2.5 E(The return v)108 312 Q(alues are:)-.25 E F1(**stor)144
-324 Q(e_ptr)-.37 E F0 22.92(:p)C(ointer to storage data)-22.92 E
-(structure)252 336 Q F1(err)144 348 Q(or)-.45 E F0 48.56(:e)C(rror v)
--48.56 E(alue)-.25 E 2.777(As)108 360 S .277(tatus v)-2.777 F .277
-(alue indicating success or f)-.25 F .277
-(ailure is returned; the error v)-.1 F .277(alue ar)-.25 F(gument)-.18 E
-F1(err)2.777 E(or)-.45 E F0 .276(passes more detailed)2.777 F
-(information about f)108 372 Q(ailures.)-.1 E
-(\255--------------------------------------------------------)108 396 Q
-(int)108 408 Q F2(mb_deall)2.5 E F0(\()A(int)180 420 Q F1(verbose)2.5 E
-F0(,)A(char)180 432 Q F1(*mbio_ptr)2.5 E F0(,)A(char)180 444 Q F1
-(**stor)2.5 E(e_ptr)-.37 E F0(,)A(int)180 456 Q F1(*err)2.5 E(or)-.45 E
-F0(\);)A 1.033(The function)108 480 R F2(mb_deall)3.533 E F0 1.033
-(deallocates a format speci\214c sw)3.533 F 1.034
-(ath sonar data structure pointed to by)-.1 F F1(*stor)3.534 E(e_ptr)
--.37 E F0(.)A(The input v)108 492 Q(alues are:)-.25 E F1(*mbio_ptr)144
-504 Q F0 27.55(:p)C(ointer to)-27.55 E F2(MBIO)2.5 E F0(structure)2.5 E
-F1(*stor)144 516 Q(e_ptr)-.37 E F0 27.92(:p)C(ointer to storage data)
--27.92 E(structure)252 528 Q(The return v)108 540 Q(alues are:)-.25 E F1
-(err)144 552 Q(or)-.45 E F0 48.56(:e)C(rror v)-48.56 E(alue)-.25 E 2.777
-(As)108 564 S .277(tatus v)-2.777 F .277(alue indicating success or f)
--.25 F .277(ailure is returned; the error v)-.1 F .277(alue ar)-.25 F
-(gument)-.18 E F1(err)2.777 E(or)-.45 E F0 .276(passes more detailed)
-2.777 F(information about f)108 576 Q(ailures.)-.1 E
-(\255--------------------------------------------------------)108 600 Q
-(int)108 612 Q F2(mb_err)2.5 E(or)-.18 E F0(\()A(int)180 624 Q F1(err)
-2.5 E(or)-.45 E F0(,)A(int)180 636 Q F1(err)2.5 E(or)-.45 E F0(,)A(char)
-180 648 Q F1(**messa)2.5 E -.1(ge)-.1 G F0(\);).1 E(Gi)108 672 Q -.15
-(ve)-.25 G 2.566(nt).15 G .066(he error v)-2.566 F(alue)-.25 E F1(err)
-2.567 E(or)-.45 E F0(,)A F2(mb_f)2.567 E(ormat_inf)-.25 E F0 .067
-(returns a short error message in the string **)2.567 F F1(messa)A -.1
-(ge)-.1 G F0 2.567(.T).1 G(he)-2.567 E F1(ver)2.567 E(-)-.2 E(bose)108
-684 Q F0 -.25(va)2.809 G .309(lue controls the standard error output v)
-.25 F .309(erbosity of the function.)-.15 F .308(The return status v)
-5.309 F .308(alue signals suc-)-.25 F(cess if)108 696 Q F1(format)2.5 E
-F0(is v)2.5 E(alid and f)-.25 E(ailure otherwise.)-.1 E
-(\255--------------------------------------------------------)108 720 Q
-(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(55)199.835 E 0
-Cg EP
-%%Page: 56 56
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F(int)108 84 Q/F1 10/Times-Bold at 0 SF(mb_na)2.5 E
-(vint_add)-.25 E F0(\()A(int)180 96 Q/F2 10/Times-Italic at 0 SF(verbose)
-2.5 E F0(,)A(char)180 108 Q F2(*mbio_ptr)2.5 E F0(,)A(double)180 120 Q
-F2(time_d)2.5 E F0(,)A(double)180 132 Q F2(lon)2.5 E F0(,)A(double)180
-144 Q F2(lat)2.5 E F0(,)A(int)180 156 Q F2(*err)2.5 E(or)-.45 E F0(\);)A
-.584(The function)108 180 R F1(mb_na)3.084 E(vint_add)-.25 E F0 .584
-(adds a na)3.084 F(vig)-.2 E .585(ation \214x to a circular b)-.05 F(uf)
--.2 E .585(fer of na)-.25 F(vig)-.2 E .585(ation v)-.05 F .585
-(alues maintained in)-.25 F(the)108 192 Q F1(MBIO)3.436 E F0 .936
-(data structure pointed to by)3.436 F F1(*mbio_ptr)3.436 E F0 5.936(.T)C
-.936(his b)-5.936 F(uf)-.2 E .935(fer is used to interpolate na)-.25 F
-(vig)-.2 E .935(ation for data)-.05 F .977(formats where the na)108 204
-R(vig)-.2 E .978(ation is asynchronous \(where na)-.05 F(vig)-.2 E .978
-(ation and surv)-.05 F 1.278 -.15(ey p)-.15 H .978(ings come in dif).15
-F .978(ferent data)-.25 F 2.5(records\). The)108 216 R(input v)2.5 E
-(alues are:)-.25 E F2(*mbio_ptr)144 228 Q F0 27.55(:p)C(ointer to)-27.55
-E F1(MBIO)2.5 E F0(structure)2.5 E F2(time_d)144 240 Q F0 42(:t)C
-(ime of na)-42 E(vig)-.2 E(ation \214x in seconds)-.05 E
-(since 1/1/70 00:00:00)216 252 Q F2(lon)144 264 Q F0 56.44(:l)C
-(ongitude \(de)-56.44 E(grees\))-.15 E F2(lat)144 276 Q F0 58.66(:l)C
-(atitude \(de)-58.66 E(grees\))-.15 E(The return v)108 288 Q(alues are:)
--.25 E F2(err)144 300 Q(or)-.45 E F0 48.56(:e)C(rror v)-48.56 E(alue)
--.25 E 2.777(As)108 312 S .277(tatus v)-2.777 F .277
-(alue indicating success or f)-.25 F .277
-(ailure is returned; the error v)-.1 F .277(alue ar)-.25 F(gument)-.18 E
-F2(err)2.777 E(or)-.45 E F0 .276(passes more detailed)2.777 F
-(information about f)108 324 Q(ailures.)-.1 E
-(\255--------------------------------------------------------)108 348 Q
-(int)108 360 Q F1(mb_na)2.5 E(vint_inter)-.25 E(p)-.1 E F0(\()A(int)180
-372 Q F2(verbose)2.5 E F0(,)A(char)180 384 Q F2(*mbio_ptr)2.5 E F0(,)A
-(double)180 396 Q F2(time_d)2.5 E F0(,)A(double)180 408 Q F2(heading)2.5
-E F0(,)A(double)180 420 Q F2 -.15(ra)2.5 G(wspeed).15 E F0(,)A(double)
-180 432 Q F2(*lon)2.5 E F0(,)A(double)180 444 Q F2(*lat)2.5 E F0(,)A
-(double)180 456 Q F2(*speed)2.5 E F0(,)A(int)180 468 Q F2(*err)2.5 E(or)
--.45 E F0(\);)A .592(The function)108 492 R F1(mb_na)3.092 E(vint_inter)
--.25 E(p)-.1 E F0 .593(interpolates na)3.093 F(vig)-.2 E .593
-(ation to the time)-.05 F F2(time_d)3.093 E F0 .593(using a circular b)
-3.093 F(uf)-.2 E .593(fer of na)-.25 F(vi-)-.2 E -.05(ga)108 504 S .095
-(tion v).05 F .094(alues maintained in the)-.25 F F1(MBIO)2.594 E F0
-.094(data structure pointed to by)2.594 F F1(*mbio_ptr)2.594 E F0 5.094
-(.T)C .094(his b)-5.094 F(uf)-.2 E .094(fer is used to inter)-.25 F(-)
--.2 E 1.8(polate na)108 516 R(vig)-.2 E 1.801
-(ation for data formats where the na)-.05 F(vig)-.2 E 1.801
-(ation is asynchronous \(where na)-.05 F(vig)-.2 E 1.801(ation and surv)
--.05 F -.15(ey)-.15 G(pings come in dif)108 528 Q
-(ferent data records\).)-.25 E(The input v)5 E(alues are:)-.25 E F2
-(*mbio_ptr)144 540 Q F0 27.55(:p)C(ointer to)-27.55 E F1(MBIO)2.5 E F0
-(structure)2.5 E F2(time_d)144 552 Q F0 42(:t)C
-(ime of current ping in seconds)-42 E(since 1/1/70 00:00:00)216 564 Q F2
-(heading)144 576 Q F0 37(:h)C(eading in de)-37 E(grees)-.15 E F2 -.15
-(ra)144 588 S(wspeed).15 E F0 67.04(:s)C(peed in km/hr)-67.04 E
-(\(zero if not kno)252 600 Q(wn\))-.25 E(The return v)108 612 Q
-(alues are:)-.25 E F2(*lon)144 624 Q F0 51.44(:l)C(ongitude \(de)-51.44
-E(grees\))-.15 E F2(*lat)144 636 Q F0 53.66(:l)C(atitude \(de)-53.66 E
-(grees\))-.15 E F2(*speed)144 648 Q F0 41.45(:s)C
-(peed made good in km/hr)-41.45 E F2(err)144 660 Q(or)-.45 E F0 48.56
-(:e)C(rror v)-48.56 E(alue)-.25 E 2.777(As)108 672 S .277(tatus v)-2.777
-F .277(alue indicating success or f)-.25 F .277
-(ailure is returned; the error v)-.1 F .277(alue ar)-.25 F(gument)-.18 E
-F2(err)2.777 E(or)-.45 E F0 .276(passes more detailed)2.777 F
-(information about f)108 684 Q(ailures.)-.1 E
-(\255--------------------------------------------------------)108 708 Q
-(int)108 720 Q F1(mb_attint_add)2.5 E F0(\()A(MB-System 5.0)72 768 Q 2.5
-(3J)146.495 G(une 2013)-2.5 E(56)199.835 E 0 Cg EP
-%%Page: 57 57
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F(int)180 84 Q/F1 10/Times-Italic at 0 SF(verbose)2.5 E
-F0(,)A(char)180 96 Q F1(*mbio_ptr)2.5 E F0(,)A(double)180 108 Q F1
-(time_d)2.5 E F0(,)A(double)180 120 Q F1(heave)2.5 E F0(,)A(double)180
-132 Q F1 -.45(ro)2.5 G(ll).45 E F0(,)A(double)180 144 Q F1(pitc)2.5 E(h)
--.15 E F0(,)A(int)180 156 Q F1(*err)2.5 E(or)-.45 E F0(\);)A .7
-(The function)108 180 R/F2 10/Times-Bold at 0 SF(mb_attint_add)3.2 E F0 .7
-(adds an attitude \(hea)3.2 F -.15(ve)-.2 G 3.2(,r).15 G .7
-(oll, pitch\) data point to a circular b)-3.2 F(uf)-.2 E .7
-(fer of attitude)-.25 F -.25(va)108 192 S .484(lues maintained in the)
-.25 F F2(MBIO)2.984 E F0 .484(data structure pointed to by)2.984 F F2
-(*mbio_ptr)2.984 E F0 5.484(.T)C .484(his b)-5.484 F(uf)-.2 E .483
-(fer is used to interpolate)-.25 F .004(attitude for data formats where\
- the attitude is asynchronous \(where attitude and surv)108 204 R .304
--.15(ey p)-.15 H .004(ings come in dif).15 F(fer)-.25 E(-)-.2 E
-(ent data records\).)108 216 Q(The input v)5 E(alues are:)-.25 E F1
-(*mbio_ptr)144 228 Q F0 27.55(:p)C(ointer to)-27.55 E F2(MBIO)2.5 E F0
-(structure)2.5 E F1(time_d)144 240 Q F0 42(:t)C
-(ime of attitude in seconds)-42 E(since 1/1/70 00:00:00)216 252 Q F1
-(heave)144 264 Q F0 45.9(:h)C(ea)-45.9 E .3 -.15(ve \()-.2 H
-(meters, up +\)).15 E F1 -.45(ro)144 276 S(ll).45 E F0 55.22(:r)C
-(oll \(de)-55.22 E(grees, starboard up +\))-.15 E F1(pitc)144 288 Q(h)
--.15 E F0 49.37(:p)C(itch \(de)-49.37 E(grees, forw)-.15 E(ard up +\))
--.1 E(The return v)108 300 Q(alues are:)-.25 E F1(err)144 312 Q(or)-.45
-E F0 48.56(:e)C(rror v)-48.56 E(alue)-.25 E 2.777(As)108 324 S .277
-(tatus v)-2.777 F .277(alue indicating success or f)-.25 F .277
-(ailure is returned; the error v)-.1 F .277(alue ar)-.25 F(gument)-.18 E
-F1(err)2.777 E(or)-.45 E F0 .276(passes more detailed)2.777 F
-(information about f)108 336 Q(ailures.)-.1 E
-(\255--------------------------------------------------------)108 360 Q
-(int)108 372 Q F2(mb_attint_inter)2.5 E(p)-.1 E F0(\()A(int)180 384 Q F1
-(verbose)2.5 E F0(,)A(char)180 396 Q F1(*mbio_ptr)2.5 E F0(,)A(double)
-180 408 Q F1(time_d)2.5 E F0(,)A(double)180 420 Q F1(*heave)2.5 E F0(,)A
-(double)180 432 Q F1(*r)2.5 E(oll)-.45 E F0(,)A(double)180 444 Q F1
-(*pitc)2.5 E(h)-.15 E F0(,)A(int)180 456 Q F1(*err)2.5 E(or)-.45 E F0
-(\);)A .384(The function)108 480 R F2(mb_attint_inter)2.884 E(p)-.1 E F0
-.384(interpolates attitude \(hea)2.884 F -.15(ve)-.2 G 2.884(,r).15 G
-.384(oll, pitch\) data to the time)-2.884 F F1(time_d)2.884 E F0 .384
-(using a cir)2.884 F(-)-.2 E .062(cular b)108 492 R(uf)-.2 E .062
-(fer of attitude v)-.25 F .062(alues maintained in the)-.25 F F2(MBIO)
-2.562 E F0 .062(data structure pointed to by)2.562 F F2(*mbio_ptr)2.562
-E F0 5.061(.T)C .061(his b)-5.061 F(uf)-.2 E(fer)-.25 E .044(is used to\
- interpolate attitude for data formats where the attitude is asynchrono\
-us \(where attitude and surv)108 504 R -.15(ey)-.15 G(pings come in dif)
-108 516 Q(ferent data records\).)-.25 E(The input v)5 E(alues are:)-.25
-E F1(*mbio_ptr)144 528 Q F0 27.55(:p)C(ointer to)-27.55 E F2(MBIO)2.5 E
-F0(structure)2.5 E F1(time_d)144 540 Q F0 42(:t)C
-(ime of current ping in seconds)-42 E(since 1/1/70 00:00:00)216 552 Q
-(The return v)108 564 Q(alues are:)-.25 E F1(*heave)144 576 Q F0 40.9
-(:h)C(ea)-40.9 E .3 -.15(ve \()-.2 H(meters, up +\)).15 E F1(*r)144 588
-Q(oll)-.45 E F0 50.22(:r)C(oll \(de)-50.22 E(grees, starboard up +\))
--.15 E F1(*pitc)144 600 Q(h)-.15 E F0 44.37(:p)C(itch \(de)-44.37 E
-(grees, forw)-.15 E(ard up +\))-.1 E F1(err)144 612 Q(or)-.45 E F0 48.56
-(:e)C(rror v)-48.56 E(alue)-.25 E 2.777(As)108 624 S .277(tatus v)-2.777
-F .277(alue indicating success or f)-.25 F .277
-(ailure is returned; the error v)-.1 F .277(alue ar)-.25 F(gument)-.18 E
-F1(err)2.777 E(or)-.45 E F0 .276(passes more detailed)2.777 F
-(information about f)108 636 Q(ailures.)-.1 E
-(\255--------------------------------------------------------)108 660 Q
-(int)108 672 Q F2(mb_hedint_add)2.5 E F0(\()A(int)180 684 Q F1(verbose)
-2.5 E F0(,)A(char)180 696 Q F1(*mbio_ptr)2.5 E F0(,)A(double)180 708 Q
-F1(time_d)2.5 E F0(,)A(double)180 720 Q F1(heading)2.5 E F0(,)A
-(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(57)199.835 E 0
-Cg EP
-%%Page: 58 58
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F(int)180 84 Q/F1 10/Times-Italic at 0 SF(*err)2.5 E(or)
--.45 E F0(\);)A .276(The function)108 108 R/F2 10/Times-Bold at 0 SF
-(mb_hedint_add)2.776 E F0 .276(adds a heading point to a circular b)
-2.776 F(uf)-.2 E .276(fer of heading v)-.25 F .277
-(alues maintained in the)-.25 F F2(MBIO)108 120 Q F0 .435
-(data structure pointed to by)2.935 F F2(*mbio_ptr)2.935 E F0 5.434(.T)C
-.434(his b)-5.434 F(uf)-.2 E .434
-(fer is used to interpolate heading for data formats)-.25 F .603
-(where the heading is asynchronous \(where heading and surv)108 132 R
-.903 -.15(ey p)-.15 H .604(ings come in dif).15 F .604
-(ferent data records\).)-.25 F(The)5.604 E(input v)108 144 Q(alues are:)
--.25 E F1(*mbio_ptr)144 156 Q F0 27.55(:p)C(ointer to)-27.55 E F2(MBIO)
-2.5 E F0(structure)2.5 E F1(time_d)144 168 Q F0 42(:t)C
-(ime of heading v)-42 E(alue in seconds)-.25 E(since 1/1/70 00:00:00)216
-180 Q F1(heading)144 192 Q F0 37(:h)C(eading \(de)-37 E(grees\))-.15 E
-(The return v)108 204 Q(alues are:)-.25 E F1(err)144 216 Q(or)-.45 E F0
-48.56(:e)C(rror v)-48.56 E(alue)-.25 E 2.777(As)108 228 S .277(tatus v)
--2.777 F .277(alue indicating success or f)-.25 F .277
-(ailure is returned; the error v)-.1 F .277(alue ar)-.25 F(gument)-.18 E
-F1(err)2.777 E(or)-.45 E F0 .276(passes more detailed)2.777 F
-(information about f)108 240 Q(ailures.)-.1 E
-(\255--------------------------------------------------------)108 264 Q
-(int)108 276 Q F2(mb_hedint_inter)2.5 E(p)-.1 E F0(\()A(int)180 288 Q F1
-(verbose)2.5 E F0(,)A(char)180 300 Q F1(*mbio_ptr)2.5 E F0(,)A(double)
-180 312 Q F1(time_d)2.5 E F0(,)A(double)180 324 Q F1(*heading)2.5 E F0
-(,)A(int)180 336 Q F1(*err)2.5 E(or)-.45 E F0(\);)A .503(The function)
-108 360 R F2(mb_hedint_inter)3.003 E(p)-.1 E F0 .503
-(interpolates heading to the time)3.003 F F1(time_d)3.004 E F0 .504
-(using a circular b)3.004 F(uf)-.2 E .504(fer of heading)-.25 F -.25(va)
-108 372 S .484(lues maintained in the).25 F F2(MBIO)2.984 E F0 .484
-(data structure pointed to by)2.984 F F2(*mbio_ptr)2.984 E F0 5.484(.T)C
-.484(his b)-5.484 F(uf)-.2 E .483(fer is used to interpolate)-.25 F .358
-(heading for data formats where the heading is asynchronous \(where hea\
-ding and surv)108 384 R .658 -.15(ey p)-.15 H .359(ings come in dif-).15
-F(ferent data records\).)108 396 Q(The input v)5 E(alues are:)-.25 E F1
-(*mbio_ptr)144 408 Q F0 27.55(:p)C(ointer to)-27.55 E F2(MBIO)2.5 E F0
-(structure)2.5 E F1(time_d)144 420 Q F0 42(:t)C
-(ime of current ping in seconds)-42 E(since 1/1/70 00:00:00)216 432 Q
-(The return v)108 444 Q(alues are:)-.25 E F1(*heading)144 456 Q F0 68
-(:h)C(eading in de)-68 E(grees)-.15 E F1(err)144 468 Q(or)-.45 E F0
-48.56(:e)C(rror v)-48.56 E(alue)-.25 E 2.777(As)108 480 S .277(tatus v)
--2.777 F .277(alue indicating success or f)-.25 F .277
-(ailure is returned; the error v)-.1 F .277(alue ar)-.25 F(gument)-.18 E
-F1(err)2.777 E(or)-.45 E F0 .276(passes more detailed)2.777 F
-(information about f)108 492 Q(ailures.)-.1 E
-(\255--------------------------------------------------------)108 516 Q
-(int)108 528 Q F2(mb_get_double)2.5 E F0(\()A(double)180 540 Q F1
-(*value)2.5 E F0(,)A(char)180 552 Q F1(*str)2.5 E F0(,)A(int)180 564 Q
-F1(nc)2.5 E(har)-.15 E F0(\);)A .691(The function)108 588 R F2
-(mb_get_double)3.191 E F0 .691(parses the \214rst)3.191 F F1(nc)3.191 E
-(har)-.15 E F0 .691(characters of the string)3.191 F F1(*str)3.191 E F0
-.692(for a \215oating point v)3.191 F(alue,)-.25 E(storing this v)108
-600 Q(alue as a double in)-.25 E F1(*value)2.5 E F0(.)A
-(\255--------------------------------------------------------)108 624 Q
-(int)108 636 Q F2(mb_get_int)2.5 E F0(\()A(int)180 648 Q F1(*value)2.5 E
-F0(,)A(char)180 660 Q F1(*str)2.5 E F0(,)A(int)180 672 Q F1(nc)2.5 E
-(har)-.15 E F0(\);)A .122(The function)108 696 R F2(mb_get_int)2.622 E
-F0 .121(parses the \214rst)2.622 F F1(nc)2.621 E(har)-.15 E F0 .121
-(characters of the string)2.621 F F1(*str)2.621 E F0 .121(for an inte)
-2.621 F .121(ger v)-.15 F .121(alue, storing this)-.25 F -.25(va)108 708
-S(lue as a int in).25 E F1(*value)2.5 E F0(.)A(MB-System 5.0)72 768 Q
-2.5(3J)146.495 G(une 2013)-2.5 E(58)199.835 E 0 Cg EP
-%%Page: 59 59
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F
-(\255--------------------------------------------------------)108 84 Q
-(int)108 96 Q/F1 10/Times-Bold at 0 SF(mb_get_binary_short)2.5 E F0(\()A
-(int)180 108 Q/F2 10/Times-Italic at 0 SF(swapped)2.5 E F0(,)A -.2(vo)180
-120 S(id).2 E F2(*b)2.5 E(uf)-.2 E(fer)-.18 E F0(,)A(short)180 132 Q F2
-(*value)2.5 E F0(\);)A .095(The function)108 156 R F1
-(mb_get_binary_short)2.595 E F0 -.15(ex)2.595 G .095
-(tracts a short int v).15 F .095(alue from the \214rst tw)-.25 F 2.595
-(ob)-.1 G .095(ytes pointed to by)-2.595 F F2(*b)2.595 E(uf)-.2 E(fer)
--.18 E F0(.)A(If the boolean)108 168 Q F2(swapped)2.5 E F0
-(is true, the byte order of)2.5 E F2(*value)2.5 E F0(is sw)2.5 E(apped.)
--.1 E(\255--------------------------------------------------------)108
-192 Q(int)108 204 Q F1(mb_get_binary_int)2.5 E F0(\()A(int)180 216 Q F2
-(swapped)2.5 E F0(,)A -.2(vo)180 228 S(id).2 E F2(*b)2.5 E(uf)-.2 E(fer)
--.18 E F0(,)A(int)180 240 Q F2(*value)2.5 E F0(\);)A .232(The function)
-108 264 R F1(mb_get_binary_int)2.732 E F0 -.15(ex)2.732 G .231
-(tracts an int v).15 F .231
-(alue from the \214rst four bytes pointed to by)-.25 F F2(*b)2.731 E(uf)
--.2 E(fer)-.18 E F0 2.731(.I)C 2.731(ft)-2.731 G(he)-2.731 E(boolean)108
-276 Q F2(swapped)2.5 E F0(is true, the byte order of)2.5 E F2(*value)2.5
-E F0(is sw)2.5 E(apped.)-.1 E
-(\255--------------------------------------------------------)108 300 Q
-(int)108 312 Q F1(mb_get_binary_\215oat)2.5 E F0(\()A(int)180 324 Q F2
-(swapped)2.5 E F0(,)A -.2(vo)180 336 S(id).2 E F2(*b)2.5 E(uf)-.2 E(fer)
--.18 E F0(,)A(\215oat *v)180 348 Q(alue)-.25 E F2(\);)A .813
-(The function)108 372 R F1(mb_get_binary_\215oat)3.313 E F2 -.2(ex)3.313
-G(tr).2 E .813(acts a \215oat value fr)-.15 F .813(om the \214r)-.45 F
-.813(st four bytes pointed to by *b)-.1 F(uf)-.2 E(fer)-.18 E 3.314(.I)
--1.11 G(f)-3.314 E(the boolean swapped is true)108 384 Q 2.5(,t)-.1 G
-(he byte or)-2.5 E(der of *value is swapped.)-.37 E
-(\255--------------------------------------------------------)108 408 Q
-(int)108 420 Q F1(mb_get_binary_double)2.5 E F2(\()A(int swapped,)180
-432 Q(void *b)180 444 Q(uf)-.2 E(fer)-.18 E(,)-1.11 E(double *value\);)
-180 456 Q 2.232(The function)108 480 R F1(mb_get_binary_double)4.732 E
-F2 -.2(ex)4.732 G(tr).2 E 2.232(acts a double value fr)-.15 F 2.231
-(om the \214r)-.45 F 2.231(st eight bytes pointed to by)-.1 F(*b)108 492
-Q(uf)-.2 E(fer)-.18 E 2.5(.I)-1.11 G 2.5(ft)-2.5 G
-(he boolean swapped is true)-2.5 E 2.5(,t)-.1 G(he byte or)-2.5 E
-(der of *value is swapped.)-.37 E
-(\255--------------------------------------------------------)108 516 Q
-(int)108 528 Q F1(mb_put_binary_short)2.5 E F2(\()A(int swapped,)180 540
-Q(short value)180 552 Q(,)-.1 E(void *b)180 564 Q(uf)-.2 E(fer\);)-.18 E
-.111(The function)108 588 R F1(mb_put_binary_short)2.611 E F2 .112
-(inserts a short int value into the \214r)2.611 F .112
-(st two bytes pointed to by *b)-.1 F(uf)-.2 E(fer)-.18 E 2.612(.I)-1.11
-G(f)-2.612 E(the boolean swapped is true)108 600 Q 2.5(,t)-.1 G
-(he byte or)-2.5 E(der of value is swapped.)-.37 E
-(\255--------------------------------------------------------)108 624 Q
-(int)108 636 Q F1(mb_put_binary_int)2.5 E F2(\()A(int swapped,)180 648 Q
-(int value)180 660 Q(,)-.1 E(void *b)180 672 Q(uf)-.2 E(fer\);)-.18 E
-.799(The function)108 696 R F1(mb_put_binary_int)3.299 E F2 .798
-(inserts an int value into the \214r)3.299 F .798
-(st four bytes pointed to by *b)-.1 F(uf)-.2 E(fer)-.18 E 3.298(.I)-1.11
-G 3.298(ft)-3.298 G(he)-3.298 E(boolean swapped is true)108 708 Q 2.5
-(,t)-.1 G(he byte or)-2.5 E(der of value is swapped.)-.37 E F0
-(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(59)199.835 E 0
-Cg EP
-%%Page: 60 60
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F/F1 10/Times-Italic at 0 SF
-(\255--------------------------------------------------------)108 84 Q
-(int)108 96 Q/F2 10/Times-Bold at 0 SF(mb_put_binary_\215oat)2.5 E F1(\()A
-(int swapped,)180 108 Q(\215oat value)180 120 Q(,)-.1 E(void *b)180 132
-Q(uf)-.2 E(fer\);)-.18 E .242(The function)108 156 R F2
-(mb_put_binary_\215oat)2.743 E F1 .243
-(inserts a \215oat value into the \214r)2.743 F .243
-(st four bytes pointed to by *b)-.1 F(uf)-.2 E(fer)-.18 E 2.743(.I)-1.11
-G 2.743(ft)-2.743 G(he)-2.743 E(boolean swapped is true)108 168 Q 2.5
-(,t)-.1 G(he byte or)-2.5 E(der of value is swapped.)-.37 E
-(\255--------------------------------------------------------)108 192 Q
-(int)108 204 Q F2(mb_put_binary_double)2.5 E F1(\()A(int swapped,)180
-216 Q(double value)180 228 Q(,)-.1 E(void *b)180 240 Q(uf)-.2 E(fer\);)
--.18 E .312(The function)108 264 R F2(mb_put_binary_double)2.812 E F1
-.312(inserts a double value into the \214r)2.812 F .312
-(st eight bytes pointed to by *b)-.1 F(uf)-.2 E(fer)-.18 E(.)-1.11 E
-(If the boolean swapped is true)108 276 Q 2.5(,t)-.1 G(he byte or)-2.5 E
-(der of value is swapped.)-.37 E
-(\255--------------------------------------------------------)108 300 Q
-(int)108 312 Q F2(mb_get_bounds)2.5 E F1(\()A -.15(ch)180 324 S(ar *te)
-.15 E(xt,)-.2 E(double *bounds\);)180 336 Q 1.776(The function)108 360 R
-F2(mb_get_bounds)4.276 E F1(par)4.276 E 1.776(ses the string *te)-.1 F
-1.776(xt and e)-.2 F(xtr)-.2 E 1.776(acts g)-.15 F(eo)-.1 E(gr)-.1 E
-1.776(aphic bounds of a r)-.15 F(ectangular)-.37 E -.37(re)108 372 S
-(gion in the form:)-.03 E(bounds[0]: minimum longitude)180 384 Q
-(bounds[1]: maximum longitude)180 396 Q(bounds[2]: minimum latitude)180
-408 Q(bounds[3]: maximum latitude)180 420 Q(wher)108 432 Q 2.996(e*)-.37
-G(te)-2.996 E .496(xt is in the standar)-.2 F(d)-.37 E F2(GMT)2.995 E F1
-.495(bounds form.)2.995 F .495(The longitude and latitude values in *te)
-5.495 F .495(xt should sepa-)-.2 F -.15(ra)108 444 S 1.236
-(ted by a '/' c).15 F(har)-.15 E(acter)-.15 E 3.737(,a)-1.11 G 1.237
-(nd individual values may be r)-3.737 F(epr)-.37 E 1.237
-(esented in decimal de)-.37 F(gr)-.4 E 1.237(ees or in "dd:mm:ss")-.37 F
-(form \(dd=de)108 456 Q(gr)-.4 E(ees, mm=minutes, ss=seconds\).)-.37 E
-(double)108 480 Q F2(mb_ddmmss_to_degr)2.5 E(ee)-.18 E F1(\()A -.15(ch)
-180 492 S(ar *te).15 E(xt\);)-.2 E .754(The function)108 516 R F2
-(mb_ddmmss_to_degr)3.253 E(ee)-.18 E F1(par)3.253 E .753
-(ses the string *te)-.1 F .753(xt and e)-.2 F(xtr)-.2 E .753
-(acts a decimal longitude or latitude)-.15 F(value fr)108 528 Q
-(om a "dd:mm:ss" \(dd=de)-.45 E(gr)-.4 E
-(ees, mm=minutes, ss=seconds\) value)-.37 E(.)-.15 E
-(\255--------------------------------------------------------)108 552 Q
-(int)108 564 Q F2(mb_tak)2.5 E(eoff_to_r)-.1 E(ollpitch)-.18 E F1(\()A
-(int verbose)180 576 Q(,)-.1 E(double theta,)180 588 Q(double phi,)180
-600 Q(double *alpha,)180 612 Q(double *beta,)180 624 Q(int *err)180 636
-Q(or\);)-.45 E .979(The function)108 660 R F2(mb_tak)3.479 E(eoff_to_r)
--.1 E(ollpitch)-.18 E F1(tr)3.479 E .979(anslates angles fr)-.15 F .979
-(om the "tak)-.45 F(eof)-.1 E .979(f" coor)-.18 F .979(dinate r)-.37 F
-(efer)-.37 E .979(ence fr)-.37 F .98(ame to)-.15 F(the "r)108 672 Q
-(ollpitc)-.45 E(h" coor)-.15 E(dinate system.)-.37 E
-(See the discussion of coor)5 E(dinate systems below)-.37 E(.)-.74 E
-(\255--------------------------------------------------------)108 696 Q
-(int)108 708 Q F2(mb_r)2.5 E(ollpitch_to_tak)-.18 E(eoff)-.1 E F1(\()A
-(int verbose)180 720 Q(,)-.1 E F0(MB-System 5.0)72 768 Q 2.5(3J)146.495
-G(une 2013)-2.5 E(60)199.835 E 0 Cg EP
-%%Page: 61 61
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F/F1 10/Times-Italic at 0 SF(double alpha,)180 84 Q
-(double beta,)180 96 Q(double *theta,)180 108 Q(double *phi,)180 120 Q
-(int *err)180 132 Q(or\);)-.45 E .351(The function)108 156 R/F2 10
-/Times-Bold at 0 SF(mb_r)2.851 E(ollpitch_to_tak)-.18 E(eoff)-.1 E F1(tr)
-2.851 E .351(anslates angles fr)-.15 F .351(om the "r)-.45 F(ollpitc)
--.45 E .351(h" coor)-.15 F .351(dinate r)-.37 F(efer)-.37 E .351
-(ence fr)-.37 F .35(ame to)-.15 F(the "tak)108 168 Q(eof)-.1 E(f" coor)
--.18 E(dinate system.)-.37 E(See the discussion of coor)5 E
-(dinate systems below)-.37 E(.)-.74 E
-(\255--------------------------------------------------------)108 192 Q
-(int)108 204 Q F2(mb_double_compar)2.5 E(e)-.18 E F1(\(double *a,)A
-(double *b\);)180 216 Q .131(The function)108 240 R F2(mb_double_compar)
-2.631 E(e)-.18 E F1 .131(is used with the)2.631 F F2(qsort)2.631 E F1
-2.631(function. This)2.631 F .131(function r)2.631 F .131
-(eturns 1 if a > b and \2551)-.37 F(if a <= b)108 252 Q(.)-.4 E
-(\255--------------------------------------------------------)108 276 Q
-(int)108 288 Q F2(mb_int_compar)2.5 E(e)-.18 E F1(\()A(int *a,)180 300 Q
-(int *b\);)180 312 Q .202(The function)108 336 R F2(mb_int_compar)2.702
-E(e)-.18 E F1 .202(is used with the)2.702 F F2(qsort)2.702 E F1 2.702
-(function. This)2.702 F .201(function r)2.702 F .201
-(eturns 1 if a > b and \2551 if a)-.37 F(<= b)108 348 Q(.)-.4 E/F3 10.95
-/Times-Bold at 0 SF(COORDIN)72 376.8 Q -1.04(AT)-.219 G 2.738(ES)1.04 G
-(YSTEMS USED IN MB-SYSTEM)-2.738 E F0(I. Introduction)108 388.8 Q .93
-(The coordinate systems described belo)108 400.8 R 3.43(wa)-.25 G .93
-(re used within)-3.43 F F2(MB-System)3.43 E F0 .93(for calculations in)
-3.43 F -.2(vo)-.4 G .93(lving the loca-).2 F .367(tion in space of dept\
-h, amplitude, or sidescan data. In all cases the origin of the coordina\
-te system is at the)108 412.8 R(center of the sonar transducers.)108
-424.8 Q(II. Cartesian Coordinates)108 448.8 Q .84
-(The cartesian coordinate system used in)108 460.8 R F2(MB-System)3.34 E
-F0 .841(is a bit odd because it is left-handed, as opposed to)3.34 F
-.721(the right-handed x-y-z space con)108 472.8 R -.15(ve)-.4 G .721
-(ntionally used in most circumstances. W).15 F .72
-(ith respect to the sonar \(or the)-.4 F .022
-(ship on which the sonar is mounted\), the x-axis is athw)108 484.8 R
-.022(artships with positi)-.1 F .322 -.15(ve t)-.25 H 2.522(os).15 G
-.022(tarboard \(to the right if f)-2.522 F(ac-)-.1 E(ing forw)108 496.8
-Q(ard\), the y-axis is fore-aft with positi)-.1 E .3 -.15(ve f)-.25 H
-(orw).15 E(ard, and the z-axis is positi)-.1 E .3 -.15(ve d)-.25 H -.25
-(ow).15 G(n.).25 E(III. Spherical Coordinates)108 520.8 Q .594
-(There are tw)108 532.8 R 3.094(on)-.1 G .594
-(on-traditional spherical coordinate systems used in)-3.094 F F2
-(MB-System)3.093 E F0 3.093(.T)C .593(he \214rst, referred to here)
--3.093 F .202(as tak)108 544.8 R(eof)-.1 E 2.702(fa)-.25 G .202
-(ngle coordinates, is useful for raytracing.)-2.702 F .202
-(The second, referred to here as roll-pitch coordinates,)5.202 F
-(is useful for taking account of corrections to roll and pitch angles.)
-108 556.8 Q(III.1. T)108 580.8 Q(ak)-.8 E(eof)-.1 E 2.5(fA)-.25 G
-(ngle Coordinates)-2.5 E .82(The three parameters are r)108 604.8 R 3.32
-(,t)-.4 G .819(heta, and phi, where r is the distance from the origin, \
-theta is the angle from)-3.32 F -.15(ve)108 616.8 S .027(rtical do).15 F
-.027(wn \(that is, from the positi)-.25 F .327 -.15(ve z)-.25 H .027
-(-axis\), and phi is the angle from acrosstrack \(the positi).15 F .328
--.15(ve x)-.25 H .028(-axis\) in).15 F .38(the x-y plane.)108 628.8 R
-.38(Note that theta is al)5.38 F -.1(wa)-.1 G .38(ys positi).1 F -.15
-(ve)-.25 G 2.88(;t).15 G .379(he direction in the x-y plane is gi)-2.88
-F -.15(ve)-.25 G 2.879(nb).15 G 2.879(yp)-2.879 G 2.879(hi. Raytracing)
--2.879 F 1.004(is simple in these coordinates because the ray tak)108
-640.8 R(eof)-.1 E 3.505(fa)-.25 G 1.005(ngle is just theta. Ho)-3.505 F
-(we)-.25 E -.15(ve)-.25 G 1.805 -.4(r, a).15 H 1.005
-(pplying roll or pitch).4 F
-(corrections is complicated because roll and pitch ha)108 652.8 Q .3
--.15(ve c)-.2 H(omponents in both theta and phi.).15 E 2.5(0<)144 676.8
-S 2.5(=t)-2.5 G(heta <= PI/2)-2.5 E(-PI/2 <= phi <= 3*PI/2)144 688.8 Q
-2.5(x=r)144 712.8 S(SIN\(theta\)COS\(phi\))-2.5 E 2.5(y=r)144 724.8 S
-(SIN\(theta\)SIN\(phi\))-2.5 E(MB-System 5.0)72 768 Q 2.5(3J)146.495 G
-(une 2013)-2.5 E(61)199.835 E 0 Cg EP
-%%Page: 62 62
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F 2.5(z=r)144 84 S(COS\(theta\))-2.5 E(theta = 0)144
-108 Q(\255--> v)10 E(ertical, along positi)-.15 E .3 -.15(ve z)-.25 H
-(-axis).15 E(theta = PI/2 \255--> horizontal, in x-y plane)144 120 Q
-(phi = \255PI/2)144 132 Q(\255--> aft, in y-z plane with y ne)5 E -.05
-(ga)-.15 G(ti).05 E -.15(ve)-.25 G(phi = 0)144 144 Q
-(\255--> port, in x-z plane with x positi)15 E -.15(ve)-.25 G
-(phi = PI/2)144 156 Q(\255--> forw)7.5 E
-(ard, in y-z plane with y positi)-.1 E -.15(ve)-.25 G(phi = PI)144 168 Q
-(\255--> starboard, in x-z plane with x ne)12.5 E -.05(ga)-.15 G(ti).05
-E -.15(ve)-.25 G(phi = 3*PI/2 \255--> aft, in y-z plane with y ne)144
-180 Q -.05(ga)-.15 G(ti).05 E -.15(ve)-.25 G
-(III.2. Roll-Pitch Coordinates)108 204 Q .636
-(The three parameters are r)108 228 R 3.136(,a)-.4 G .636(lpha, and bet\
-a, where r is the distance from the origin, alpha is the angle for)
--3.136 F(-)-.2 E -.1(wa)108 240 S .222(rd \(ef).1 F(fecti)-.25 E -.15
-(ve)-.25 G .223(ly pitch angle\), and beta is the angle from horizontal\
- in the x-z plane \(ef).15 F(fecti)-.25 E -.15(ve)-.25 G .223
-(ly roll angle\).).15 F .414(Applying a roll or pitch correction is sim\
-ple in these coordinates because pitch is just alpha and roll is just)
-108 252 R 1.3(beta. Ho)108 264 R(we)-.25 E -.15(ve)-.25 G 2.1 -.4(r, r)
-.15 H 1.3(aytracing is complicated because de\215ection from v).4 F 1.3
-(ertical has components in both alpha)-.15 F(and beta.)108 276 Q
-(-PI/2 <= alpha <= PI/2)144 300 Q 2.5(0<)144 312 S 2.5(=b)-2.5 G
-(eta <= PI)-2.5 E 2.5(x=r)144 336 S(COS\(alpha\)COS\(beta\))-2.5 E 2.5
-(y=r)144 348 S(SIN\(alpha\))-2.5 E 2.5(z=r)144 360 S
-(COS\(alpha\)SIN\(beta\))-2.5 E
-(alpha = \255PI/2 \255--> horizontal, in x-y plane with y ne)144 384 Q
--.05(ga)-.15 G(ti).05 E -.15(ve)-.25 G(alpha = 0)144 396 Q
-(\255--> ship le)12.5 E -.15(ve)-.25 G(l, zero pitch, in x-z plane).15 E
-(alpha = PI/2)144 408 Q(\255--> horizontal, in x-y plane with y positi)5
-E -.15(ve)-.25 G(beta = 0)144 420 Q(\255--> starboard, along positi)15 E
-.3 -.15(ve x)-.25 H(-axis).15 E(beta = PI/2)144 432 Q
-(\255--> in y-z plane rotated by alpha)7.5 E(beta = PI)144 444 Q
-(\255--> port, along ne)12.5 E -.05(ga)-.15 G(ti).05 E .3 -.15(ve x)-.25
-H(-axis).15 E(IV)108 468 Q 2.5(.S)-1.29 G(eaBeam Coordinates)-2.5 E .099
-(The per)108 492 R .098
-(-beam parameters in the SB2100 data format include angle-from-v)-.2 F
-.098(ertical and angle-forw)-.15 F .098(ard. Angle-)-.1 F(from-v)108 504
-Q .134(ertical is the same as theta e)-.15 F .135
-(xcept that it is signed based on the acrosstrack direction \(positi)
--.15 F .435 -.15(ve t)-.25 H 2.635(os).15 G(tar)-2.635 E(-)-.2 E 1.441
-(board, ne)108 516 R -.05(ga)-.15 G(ti).05 E 1.741 -.15(ve t)-.25 H
-3.941(op).15 G 1.441(ort\). The angle-forw)-3.941 F 1.441(ard v)-.1 F
-1.441(alues are also de\214ned slightly dif)-.25 F 1.44
-(ferently from phi, in that)-.25 F(angle-forw)108 528 Q .757
-(ard is signed dif)-.1 F .758(ferently on the port and starboard sides.\
- The SeaBeam 2100 External Interf)-.25 F(ace)-.1 E .474(Speci\214cation\
-s document includes both discussion and \214gures illustrating the angl\
-e-forw)108 540 R .474(ard v)-.1 F .474(alue. T)-.25 F 2.974(os)-.8 G
-(um-)-2.974 E(marize:)108 552 Q(Port:)118 576 Q(theta = absolute v)144
-600 Q(alue of angle-from-v)-.25 E(ertical)-.15 E(-PI/2 <= phi <= PI/2)
-144 624 Q(is equi)144 636 Q -.25(va)-.25 G(lent to).25 E
-(-PI/2 <= angle-forw)144 648 Q(ard <= PI/2)-.1 E
-(phi = \255PI/2 \255--> angle-forw)144 672 Q(ard = \255PI/2 \(aft\))-.1
-E(phi = 0)144 684 Q(\255--> angle-forw)12.5 E(ard = 0)-.1 E
-(\(starboard\))12.5 E(phi = PI/2)144 696 Q(\255--> angle-forw)5 E
-(ard = PI/2)-.1 E(\(forw)5 E(ard\))-.1 E(Starboard:)118 720 Q
-(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(62)199.835 E 0
-Cg EP
-%%Page: 63 63
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F(theta = angle-from-v)144 84 Q(ertical)-.15 E
-(PI/2 <= phi <= 3*PI/2)144 108 Q(is equi)144 120 Q -.25(va)-.25 G
-(lent to).25 E(-PI/2 <= angle-forw)144 132 Q(ard <= PI/2)-.1 E
-(phi = PI/2)144 156 Q(\255--> angle-forw)7.5 E(ard = \255PI/2 \(forw)-.1
-E(ard\))-.1 E(phi = PI)144 168 Q(\255--> angle-forw)12.5 E(ard = 0)-.1 E
-(\(port\))12.5 E(phi = 3*PI/2 \255--> angle-forw)144 180 Q(ard = PI/2)
--.1 E(\(aft\))5 E 2.58 -1.29(V. U)108 204 T
-(sage of Coordinate Systems in)1.29 E/F1 10/Times-Bold at 0 SF(MB-System)
-2.5 E F0 .598(Some sonar data formats pro)108 228 R .598(vide angle v)
--.15 F .598(alues along with tra)-.25 F -.15(ve)-.2 G 3.098(lt).15 G
-.598(imes. The angles are con)-3.098 F -.15(ve)-.4 G .599(rted to tak)
-.15 F(of)-.1 E(f-)-.25 E .234(angle coordinates re)108 240 R -.05(ga)
--.15 G .234(rdless of the).05 F .233
-(storage form of the particular data format. Currently)5.234 F 2.733(,m)
--.65 G .233(ost data formats)-2.733 F .296
-(do not contain an alongtrack component to the position v)108 252 R .297
-(alues; in these cases the con)-.25 F -.15(ve)-.4 G .297(rsion is tri)
-.15 F .297(vial since)-.25 F .566
-(phi = beta = 0 and theta = alpha. The angle and tra)108 264 R -.15(ve)
--.2 G 3.066(lt).15 G .566(ime v)-3.066 F .565
-(alues can be accessed using the)-.25 F F1(MBIO)3.065 E F0(func-)3.065 E
-(tion)108 276 Q F1(mb_ttimes)2.5 E F0 5(.A)C(ll angle v)-5 E
-(alues passed by)-.25 E F1(MB-System)2.5 E F0(functions are in de)2.5 E
-(grees rather than radians.)-.15 E .37(The programs)108 300 R F1(mb)2.87
-E(bath)-.1 E F0(and)2.87 E F1(mb)2.87 E -.1(ve)-.15 G(locitytool).1 E F0
-.371(use angles in tak)2.87 F(e-of)-.1 E 2.871(fa)-.25 G .371
-(ngle coordinates to do the raytracing. If)-2.871 F .992
-(roll and/or pitch corrections are to be made, the angles are con)108
-312 R -.15(ve)-.4 G .992(rted to roll-pitch coordinates, corrected,).15
-F(and then con)108 324 Q -.15(ve)-.4 G(rted back prior to raytracing.)
-.15 E/F2 10.95/Times-Bold at 0 SF(BEAM FLA)72 364.8 Q(GS USED IN MB-SYSTEM)
--.602 E F1(MB-System)108 376.8 Q F0 .449
-(uses arrays of 1-byte "beam\215ag" v)2.949 F .449
-(alues to indicate beam data quality)-.25 F 2.95(.E)-.65 G .45
-(ach beam\215ag v)-2.95 F .45(alue is)-.25 F .587
-(actually an eight bit mask allo)108 388.8 R .587(wing f)-.25 F .587
-(airly complicated information to be stored re)-.1 F -.05(ga)-.15 G .587
-(rding each bath).05 F(ymetry)-.05 E -.25(va)108 400.8 S .079
-(lue. In particular).25 F 2.579(,b)-.4 G .079
-(eams may be \215agged as bad, the)-2.579 F 2.579(ym)-.15 G .08
-(ay be selected as being of special interest, and one)-2.579 F .604
-(or more reasons for \215agging or selection may be indicated.)108 412.8
-R .603(This scheme is v)5.603 F .603(ery similar to the con)-.15 F -.15
-(ve)-.4 G(ntion).15 E .032(used in the HMPS h)108 424.8 R .032(ydrograp\
-hic data processing package and the SAIC Hydrobat package. The beam sel\
-ec-)-.05 F(tion mechanism is not currently used by an)108 436.8 Q(y)-.15
-E F1(MB-System)2.5 E F0(programs.)2.5 E(The \215ag and select bits:)108
-460.8 Q(xxxxxx00 => This beam is neither \215agged nor selected.)113
-472.8 Q
-(xxxxxx01 => This beam is \215agged as bad and should be ignored.)113
-484.8 Q(xxxxxx10 => This beam has been selected.)113 496.8 Q
-(Flagging modes:)108 520.8 Q(00000001 => Flagged because no detection w)
-113 532.8 Q(as made by the sonar)-.1 E(.)-.55 E
-(xxxxx101 => Flagged by manual editing.)113 544.8 Q
-(xxxx1x01 => Flagged by automatic \214lter)113 556.8 Q(.)-.55 E
-(xxx1xx01 => Flagged because uncertainty e)113 568.8 Q
-(xceeds 1 X IHO standard.)-.15 E
-(xx1xxx01 => Flagged because uncertainty e)113 580.8 Q
-(xceeds 2 X IHO standard.)-.15 E
-(x1xxxx01 => Flagged because footprint is too lar)113 592.8 Q(ge)-.18 E
-(1xxxxx01 => Flagged by sonar as unreliable.)113 604.8 Q
-(Selection modes:)108 628.8 Q
-(00000010 => Selected, no reason speci\214ed.)113 640.8 Q
-(xxxxx110 => Selected as least depth.)113 652.8 Q
-(xxxx1x10 => Selected as a)113 664.8 Q -.15(ve)-.2 G(rage depth.).15 E
-(xxx1xx10 => Selected as maximum depth.)113 676.8 Q
-(xx1xxx10 => Selected as location of sidescan contact.)113 688.8 Q
-(x1xxxx10 => Selected, spare.)113 700.8 Q(1xxxxx10 => Selected, spare.)
-113 712.8 Q(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(63)
-199.835 E 0 Cg EP
-%%Page: 64 64
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 167.61(mbio\(3\) MB-System)72 48 R 167.61
-(5.0 mbio\(3\))2.5 F/F1 10.95/Times-Bold at 0 SF(SEE ALSO)72 84 Q/F2 10
-/Times-Bold at 0 SF(mbsystem)108 96 Q F0(\(l\),)A F2(mbf)2.5 E(ormat)-.25 E
-F0(\(l\))A F1 -.11(BU)72 124.8 S(GS).11 E F0
-(What could go wrong in a mere 204,289 lines of code?)108 136.8 Q
-(Let us kno)108 148.8 Q -.65(w.)-.25 G(..).65 E(MB-System 5.0)72 768 Q
-2.5(3J)146.495 G(une 2013)-2.5 E(64)199.835 E 0 Cg EP
-%%Trailer
-end
-%%EOF
diff --git a/src/ps/mbkongsbergpreprocess.ps b/src/ps/mbkongsbergpreprocess.ps
deleted file mode 100644
index 4b658ca..0000000
--- a/src/ps/mbkongsbergpreprocess.ps
+++ /dev/null
@@ -1,619 +0,0 @@
-%!PS-Adobe-3.0
-%%Creator: groff version 1.19.2
-%%CreationDate: Wed Jul  1 12:29:28 2015
-%%DocumentNeededResources: font Times-Roman
-%%+ font Times-Bold
-%%+ font Times-Italic
-%%DocumentSuppliedResources: procset grops 1.19 2
-%%Pages: 5
-%%PageOrder: Ascend
-%%DocumentMedia: Default 612 792 0 () ()
-%%Orientation: Portrait
-%%EndComments
-%%BeginDefaults
-%%PageMedia: Default
-%%EndDefaults
-%%BeginProlog
-%%BeginResource: procset grops 1.19 2
-%!PS-Adobe-3.0 Resource-ProcSet
-/setpacking where{
-pop
-currentpacking
-true setpacking
-}if
-/grops 120 dict dup begin
-/SC 32 def
-/A/show load def
-/B{0 SC 3 -1 roll widthshow}bind def
-/C{0 exch ashow}bind def
-/D{0 exch 0 SC 5 2 roll awidthshow}bind def
-/E{0 rmoveto show}bind def
-/F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def
-/G{0 rmoveto 0 exch ashow}bind def
-/H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/I{0 exch rmoveto show}bind def
-/J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def
-/K{0 exch rmoveto 0 exch ashow}bind def
-/L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/M{rmoveto show}bind def
-/N{rmoveto 0 SC 3 -1 roll widthshow}bind def
-/O{rmoveto 0 exch ashow}bind def
-/P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/Q{moveto show}bind def
-/R{moveto 0 SC 3 -1 roll widthshow}bind def
-/S{moveto 0 exch ashow}bind def
-/T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/SF{
-findfont exch
-[exch dup 0 exch 0 exch neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/MF{
-findfont
-[5 2 roll
-0 3 1 roll
-neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/level0 0 def
-/RES 0 def
-/PL 0 def
-/LS 0 def
-/MANUAL{
-statusdict begin/manualfeed true store end
-}bind def
-/PLG{
-gsave newpath clippath pathbbox grestore
-exch pop add exch pop
-}bind def
-/BP{
-/level0 save def
-1 setlinecap
-1 setlinejoin
-72 RES div dup scale
-LS{
-90 rotate
-}{
-0 PL translate
-}ifelse
-1 -1 scale
-}bind def
-/EP{
-level0 restore
-showpage
-}def
-/DA{
-newpath arcn stroke
-}bind def
-/SN{
-transform
-.25 sub exch .25 sub exch
-round .25 add exch round .25 add exch
-itransform
-}bind def
-/DL{
-SN
-moveto
-SN
-lineto stroke
-}bind def
-/DC{
-newpath 0 360 arc closepath
-}bind def
-/TM matrix def
-/DE{
-TM currentmatrix pop
-translate scale newpath 0 0 .5 0 360 arc closepath
-TM setmatrix
-}bind def
-/RC/rcurveto load def
-/RL/rlineto load def
-/ST/stroke load def
-/MT/moveto load def
-/CL/closepath load def
-/Fr{
-setrgbcolor fill
-}bind def
-/setcmykcolor where{
-pop
-/Fk{
-setcmykcolor fill
-}bind def
-}if
-/Fg{
-setgray fill
-}bind def
-/FL/fill load def
-/LW/setlinewidth load def
-/Cr/setrgbcolor load def
-/setcmykcolor where{
-pop
-/Ck/setcmykcolor load def
-}if
-/Cg/setgray load def
-/RE{
-findfont
-dup maxlength 1 index/FontName known not{1 add}if dict begin
-{
-1 index/FID ne{def}{pop pop}ifelse
-}forall
-/Encoding exch def
-dup/FontName exch def
-currentdict end definefont pop
-}bind def
-/DEFS 0 def
-/EBEGIN{
-moveto
-DEFS begin
-}bind def
-/EEND/end load def
-/CNT 0 def
-/level1 0 def
-/PBEGIN{
-/level1 save def
-translate
-div 3 1 roll div exch scale
-neg exch neg exch translate
-0 setgray
-0 setlinecap
-1 setlinewidth
-0 setlinejoin
-10 setmiterlimit
-[]0 setdash
-/setstrokeadjust where{
-pop
-false setstrokeadjust
-}if
-/setoverprint where{
-pop
-false setoverprint
-}if
-newpath
-/CNT countdictstack def
-userdict begin
-/showpage{}def
-/setpagedevice{}def
-}bind def
-/PEND{
-countdictstack CNT sub{end}repeat
-level1 restore
-}bind def
-end def
-/setpacking where{
-pop
-setpacking
-}if
-%%EndResource
-%%EndProlog
-%%BeginSetup
-%%BeginFeature: *PageSize Default
-<< /PageSize [ 612 792 ] /ImagingBBox null >> setpagedevice
-%%EndFeature
-%%IncludeResource: font Times-Roman
-%%IncludeResource: font Times-Bold
-%%IncludeResource: font Times-Italic
-grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72
-def/PL 792 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron/Zcaron
-/scaron/zcaron/Ydieresis/trademark/quotesingle/Euro/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/space/exclam/quotedbl/numbersign/dollar/percent
-/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen
-/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon
-/semicolon/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O
-/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright/circumflex
-/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y
-/z/braceleft/bar/braceright/tilde/.notdef/quotesinglbase/guillemotleft
-/guillemotright/bullet/florin/fraction/perthousand/dagger/daggerdbl
-/endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut
-/dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash
-/quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen
-/brokenbar/section/dieresis/copyright/ordfeminine/guilsinglleft
-/logicalnot/minus/registered/macron/degree/plusminus/twosuperior
-/threesuperior/acute/mu/paragraph/periodcentered/cedilla/onesuperior
-/ordmasculine/guilsinglright/onequarter/onehalf/threequarters
-/questiondown/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE
-/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex
-/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis
-/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn
-/germandbls/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla
-/egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis
-/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide/oslash
-/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis]def
-/Times-Italic at 0 ENC0/Times-Italic RE/Times-Bold at 0 ENC0/Times-Bold RE
-/Times-Roman at 0 ENC0/Times-Roman RE
-%%EndSetup
-%%Page: 1 1
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mbk)72 48 Q(ongsber)-.1 E 91.25
-(gpreprocess\(1\) MB-System)-.18 F 91.25(5.0 mbk)2.5 F(ongsber)-.1 E
-(gpreprocess\(1\))-.18 E/F1 10.95/Times-Bold at 0 SF -.219(NA)72 84 S(ME)
-.219 E/F2 10/Times-Bold at 0 SF(mbk)108 96 Q(ongsber)-.15 E(gpr)-.1 E(epr)
--.18 E(ocess)-.18 E F0 3.923<ad70>3.923 G 1.423
-(erforms preprocessing of data from third generation K)-3.923 F(ongsber)
--.35 E 3.923(gm)-.18 G(ultibeam)-3.923 E
-(sonars \(e.g. EM122, EM302, EM710, EM2040, M3\).)108 108 Q F1(VERSION)
-72 136.8 Q F0 -1.11(Ve)108 148.8 S(rsion 5.0)1.11 E F1(SYNOPSIS)72 177.6
-Q F2(mbk)108 189.6 Q(ongsber)-.15 E(gpr)-.1 E(epr)-.18 E(ocess)-.18 E F0
-([)3.93 E F2 1.43<ad4320ad44>B/F3 10/Times-Italic at 0 SF(outputdir)A
-(ectory)-.37 E F2<ad45>3.93 E F3(of)A(fx/of)-.18 E(fy[/of)-.18 E
-(fdepth])-.18 E F2<ad46>3.93 E F3(format)A F2<ad49>3.93 E F3(\214le)A F2
-<ad4f>3.93 E F3(out\214le)A F2<ad50>3.93 E F3(\214l-)A
-(terlength/\214lter)108 201.6 Q(depth)-.37 E F2<ad53>2.5 E F3
-(datatype/sour)A(ce)-.37 E F2<ad54>2.5 E F3(timela)A(g)-.1 E F2
-<ad5720ad4820ad56>2.5 E F3(])A F1(DESCRIPTION)72 230.4 Q F2(mbk)108
-242.4 Q(ongsber)-.15 E(gpr)-.1 E(epr)-.18 E(ocess)-.18 E F0 1.807
-(reads data from a third generation K)4.307 F(ongsber)-.35 E 4.306(gm)
--.18 G 1.806(ultibeam sonar \(e.g. EM122,)-4.306 F 1.07
-(EM302, EM710, EM2040, M3\), interpolates the asynchronous na)108 254.4
-R(vig)-.2 E 1.07(ation, heading, and attitude onto the)-.05 F .952
-(multibeam data, and writes a ne)108 266.4 R 3.451<778c>-.25 G .951
-(le with that information correctly embedded in the multibeam surv)
--3.451 F -.15(ey)-.15 G 1.183(data. The input \214les may be in the v)
-108 278.4 R 1.183(endor format MBF_EM710RA)-.15 F 3.683(W\()-.9 G 1.183
-(format id 58\) or the)-3.683 F F2(MB-System)3.684 E F0 -.15(ex)108
-290.4 S 1.783(tended format MBF_EM710MB).15 F 4.282(A\()-.35 G 1.782
-(format id 59\); the output \214les will al)-4.282 F -.1(wa)-.1 G 1.782
-(ys be in the).1 F F2(MB-System)4.282 E F0 -.15(ex)108 302.4 S
-(tended format MBF_EM710MB).15 E 2.5(A\()-.35 G(format id 59\).)-2.5 E
-(Lik)108 326.4 Q 2.841(em)-.1 G .341(ost modern sw)-2.841 F .341
-(ath surv)-.1 F .641 -.15(ey d)-.15 H .341(ata streams, K).15 F(ongsber)
--.35 E 2.842(gm)-.18 G .342(ultibeam data includes na)-2.842 F(vig)-.2 E
-.342(ation, attitude, and)-.05 F .26
-(heading data logged in separate data records as output by the respecti)
-108 338.4 R .56 -.15(ve s)-.25 H .26(ensors. Since each of these v).15 F
-(alues)-.25 E .196(is time stamped according to its origin rather than \
-synced with multibeam pings, these v)108 350.4 R .197
-(alues are asynchro-)-.25 F .965(nous relati)108 362.4 R 1.265 -.15
-(ve t)-.25 H 3.465(ot).15 G .965(he surv)-3.465 F 1.265 -.15(ey p)-.15 H
-.965(ing data. When multiple sources of na).15 F(vig)-.2 E .964
-(ation, heading, and/or attitude ha)-.05 F -.15(ve)-.2 G .995
-(been recorded in a data stream,)108 374.4 R F2(mbk)3.495 E(ongsber)-.15
-E(gpr)-.1 E(epr)-.18 E(ocess)-.18 E F0(allo)3.495 E .996
-(ws the user to specify which asynchronous)-.25 F(data are e)108 386.4 Q
-(xtracted and interpolated onto the surv)-.15 E .3 -.15(ey d)-.15 H
-(ata using the).15 E F2<ad53>2.5 E F0(option.)2.5 E .074
-(This program allo)108 410.4 R .073(ws the correction of a time latenc)
--.25 F 2.573(y\()-.15 G .073(or time lag\))-2.573 F .073
-(error between the sonar data and the atti-)5.073 F(tude and na)108
-422.4 Q(vig)-.2 E(ation data using the)-.05 E F2<ad54>2.5 E F0(option.)
-2.5 E .211(The format 58 \214les This program also creates four ancilli\
-ary \214les containing the full asynchronous attitude,)108 446.4 R .301
-(sonar depth, and heading data and the synchronous attitude data in par\
-allel with each output format 59 \214le.)108 458.4 R .56
-(These \214les are used, when present, by)108 470.4 R F2(mbeditviz)3.06
-E F0 .56(to f)3.06 F .56(acillitate interacti)-.1 F .86 -.15(ve a)-.25 H
-.56(nalysis of time lag issues. Each).15 F .582(of these are te)108
-482.4 R .581(xt \214les with white-space delimited columns; the \214rst\
- column is al)-.15 F -.1(wa)-.1 G .581(ys time in decimal unix).1 F
-(seconds. These ha)108 494.4 Q .3 -.15(ve t)-.2 H(he follo).15 E
-(wing suf)-.25 E<8c78>-.25 E(es:)-.15 E
-(asynchronous attitude \(roll and pitch\):)118 506.4 Q(*.ata)17.24 E
-(asynchronous heading:)118 518.4 Q(*.ath)78.07 E
-(asynchronous sonar depth:)118 530.4 Q(*.ats)99.35 E
-(synchronous attitude \(roll and pitch\):)118 542.4 Q(*.sta)21.68 E .791
-(By def)108 566.4 R(ault,)-.1 E F2(mbk)3.291 E(ongsber)-.15 E(gpr)-.1 E
-(epr)-.18 E(ocess)-.18 E F0 .791(ignores w)3.291 F .792
-(ater column records and does not pass these lar)-.1 F .792(ge records)
--.18 F .259(into the output format 59 \214les. The)108 578.4 R F2(-W)
-2.759 E F3(1)A F0 .259(option causes the w)2.759 F .259
-(ater column records to be written in the output)-.1 F(\214les.)108
-590.4 Q F1 -.548(AU)72 619.2 S(THORSHIP).548 E F0(Da)108 631.2 Q(vid W)
--.2 E 2.5(.C)-.92 G(aress \(caress at mbari.or)-2.5 E(g\))-.18 E(Montere)
-113 643.2 Q 2.5(yB)-.15 G(ay Aquarium Research Institute)-2.5 E
-(Dale N. Chayes \(dale at ldeo.columbia.edu\))108 655.2 Q
-(Lamont-Doherty Earth Observ)113 667.2 Q(atory)-.25 E F1(OPTIONS)72 696
-Q F2<ad43>108 708 Q F0 1.745(This option causes)144 720 R F2(mbk)4.246 E
-(ongsber)-.15 E(gpr)-.1 E(epr)-.18 E(ocess)-.18 E F0 1.746
-(to print counts of the man)4.246 F 4.246(yd)-.15 G(if)-4.246 E 1.746
-(ferent data record)-.25 F(MB-System 5.0)72 768 Q(12 No)132.205 E -.15
-(ve)-.15 G(mber 2014).15 E(1)190.545 E 0 Cg EP
-%%Page: 2 2
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mbk)72 48 Q(ongsber)-.1 E 91.25
-(gpreprocess\(1\) MB-System)-.18 F 91.25(5.0 mbk)2.5 F(ongsber)-.1 E
-(gpreprocess\(1\))-.18 E .779(types compising a K)144 84 R(ongsber)-.35
-E 3.278(gd)-.18 G .778
-(ata stream. The data record counts are output for each \214le and as)
--3.278 F(totals from all \214les processed.)144 96 Q/F1 10/Times-Bold at 0
-SF<ad44>108 112.8 Q/F2 10/Times-Italic at 0 SF(outputdir)23.08 E(ectory)
--.37 E F0 .223(This option causes all format 59 output \214les to be pl\
-aced in the speci\214ed directory)144 124.8 R F2(outputdir)2.724 E
-(ectory)-.37 E F0(rather than parallel to the original "ra)144 136.8 Q
-(w" \214les.)-.15 E F1<ad45>108 153.6 Q F2(of)23.63 E(fx/of)-.18 E
-(fz[/of)-.18 E(fdepth])-.18 E F0 1.086
-(This option is for data from submer)144 165.6 R 1.085
-(ged platforms such as R)-.18 F -.5(OV)-.4 G 3.585(so).5 G 3.585(rA)
--3.585 G 3.585(UVs. This)-4.135 F 1.085(sets horizontal)3.585 F .221
-(and v)144 177.6 R .221(ertical.distance of)-.15 F .221
-(fsets between the v)-.25 F(ehicle')-.15 E 2.721(sd)-.55 G .222
-(epth sensor and the multibeam recei)-2.721 F .522 -.15(ve h)-.25 H .222
-(ead. If).15 F 1.429(speci\214ed, these v)144 189.6 R 1.429
-(alues are used in a le)-.25 F -.15(ve)-.25 G -.2(r-).15 G 1.428
-(arm calculation to determine the sonar depth change).2 F .378
-(associated with v)144 201.6 R .378(ehicle pitch. The)-.15 F F2(of)2.878
-E(fdepth)-.18 E F0 -.25(va)2.878 G .378
-(lue, if speci\214ed, is a static depth of).25 F .379
-(fset to be applied)-.25 F(to the v)144 213.6 Q(ehicle depth data.)-.15
-E F1<ad46>108 230.4 Q F2(format)24.19 E F0 .22(Sets the data format use\
-d if the input is read from stdin or from a \214le. If)144 242.4 R F2
-(format)2.72 E F0 2.72(<0)2.72 G 2.72(,t)-2.72 G .22(hen the input)-2.72
-F .007(\214le speci\214ed with the)144 254.4 R F1<ad49>2.507 E F0 .008
-(option will actually contain a list of input sw)2.508 F .008
-(ath sonar data \214les. This pro-)-.1 F .827
-(gram only reads third generation K)144 266.4 R(ongsber)-.35 E 3.327(gm)
--.18 G .827(ultibeam format data \214les \()-3.327 F F1(MBIO)A F0 .827
-(formats 58 and)3.327 F(59\).)144 278.4 Q F1<ad48>108 295.2 Q F0 .162(T\
-his "help" \215ag cause the program to print out a description of its o\
-peration and then e)22.52 F .162(xit immedi-)-.15 F(ately)144 307.2 Q(.)
--.65 E F1<ad49>108 324 Q F2(in\214le)26.41 E F0 .515
-(Sets the input \214le path. If)144 336 R F2(format)3.015 E F0 3.015
-(>0\()3.015 G .515(set with the)-3.015 F F1<ad66>3.015 E F0 .515
-(option or)3.015 F F1(mbdefaults)3.014 E F0 3.014(\)t)C .514(hen the sw)
--3.014 F .514(ath sonar)-.1 F .796(data contained in)144 348 R F2
-(in\214le)3.296 E F0 .797(is read and processed. If)3.297 F F2(format)
-3.297 E F0 3.297(<0)3.297 G 3.297(,t)-3.297 G(hen)-3.297 E F2(in\214le)
-3.297 E F0 .797(is assumed to be an ascii)3.297 F .157
-(\214le containing a list of the input sw)144 360 R .157
-(ath sonar data \214les to be processed and their formats.)-.1 F .156
-(The pro-)5.156 F .928
-(gram will read the data in each one of these \214les.)144 372 R .929
-(In the)5.929 F F2(in\214le)3.429 E F0 .929
-(\214le, each data \214le should be fol-)3.429 F(lo)144 384 Q
-(wed by a data format identi\214er)-.25 E 2.5(,e)-.4 G(.g.:)-2.5 E
-(data\214le.all 58)180 396 Q(data\214le.all 58)180 408 Q .549
-(This program only reads third generation K)144 420 R(ongsber)-.35 E
-3.048(gm)-.18 G .548(ultibeam format data \214les \()-3.048 F F1(MBIO)A
-F0(formats)3.048 E(58 and 59\).)144 432 Q F1<ad4f>108 448.8 Q F2
-(out\214le)22.52 E F0 .532(This option causes)144 460.8 R F1(mbk)3.033 E
-(ongsber)-.15 E(gpr)-.1 E(epr)-.18 E(ocess)-.18 E F0 .533
-(to output all data to a single \214le speci\214ed as)3.033 F F2
-(out\214le)3.033 E F0(.)A .592(By def)144 472.8 R .591
-(ault, the program creates output \214les for each input \214le. If the)
--.1 F F1<ad44>3.091 E F2(outputdir)A(ectory)-.37 E F0 .591(option is)
-3.091 F(also used, then the output \214le)144 484.8 Q F2(out\214le)2.5 E
-F0(will be in)2.5 E F2(outputdir)2.5 E(ectory)-.37 E F0(.)A F1<ad50>108
-501.6 Q F2(\214lterlength/\214lter)24.19 E(depth)-.37 E F0 1.415(This o\
-ption speci\214es Gaussian tapered time domain \214ltering of the sonar)
-3.914 F .134(depth data to be mer)144 513.6 R .134(ged with the surv)
--.18 F .434 -.15(ey d)-.15 H .134(ata, re).15 F -.05(ga)-.15 G .134
-(rdless of source.).05 F(The)5.134 E F2(\214lterlength)2.634 E F0 -.25
-(va)2.634 G .134(lue speci\214es).25 F .348(the \214lter windo)144 525.6
-R 2.848(wl)-.25 G .348(ength in seconds, and the)-2.848 F F2(\214lter)
-2.849 E(depth)-.37 E F0 -.25(va)2.849 G .349
-(lue controls the depths to which \214ltering).25 F .651(is applied. Th\
-e \214ltered sonar depth is used to depths up to twice the)144 537.6 R
-F2(\214lter)3.151 E(depth)-.37 E F0 -.25(va)3.151 G .651(lue. Belo).25 F
-3.151(wt)-.25 G(hat)-3.151 E .076(threshold, the v)144 549.6 R .076
-(alue used transitions to un\214ltered with an e)-.25 F .076
-(xponential taper)-.15 F 2.576(.T)-.55 G .076
-(his \214ltering is used in)-2.576 F(tw)144 561.6 Q 3.047(ow)-.1 G .546
-(ays. First, one can apply short period smoothing of noisy sonar depth \
-at all by specifying a)-3.147 F(small)144 573.6 Q F2(\214lterlength)
-3.266 E F0 .766(\(e.g. 2 seconds\) and a)3.266 F F2(\214lter)3.266 E
-(depth)-.37 E F0 -.25(va)3.266 G .767(lue deeper than the v).25 F
-(ehicle')-.15 E 3.267(st)-.55 G .767(rack. Second,)-3.267 F .519
-(when an A)144 585.6 R .519(UV or R)-.55 F 1.519 -.5(OV i)-.4 H 3.019
-(so).5 G .519(perated at shallo)-3.019 F 3.019(wd)-.25 G .519
-(epths, the pressure v)-3.019 F .518(alues used to determine depth)-.25
-F .39(are af)144 597.6 R .39(fected by w)-.25 F -2.25 -.2(av e)-.1 H
-2.89(sa).2 G 2.89(tt)-2.89 G .39(he sea surf)-2.89 F .391
-(ace. In this case, a longer period)-.1 F F2(\214lterlength)2.891 E F0
-.391(\(e.g. 10 seconds\))2.891 F .08(and a shallo)144 609.6 R(wer)-.25 E
-F2(\214lter)2.58 E(depth)-.37 E F0 .079
-(\(e.g. 50 meters\) may be used to lessen the artif)2.58 F .079
-(acts due to surf)-.1 F .079(ace swell.)-.1 F F1<ad53>108 626.4 Q F2
-(datatype/sour)24.74 E(ce)-.37 E F0 1.267(This option speci\214es which\
- data records should be the source of the na)144 638.4 R(vig)-.2 E 1.267
-(ation \()-.05 F F2(datatype)A F0 3.767(=1)3.767 G(\),)-3.767 E .322
-(heading \()144 650.4 R F2(datatype)A F0 2.822(=2)2.822 G .322
-(\), attitude \()-2.822 F F2(datatype)A F0 2.822(=3)2.822 G .322
-(\), and sonar depth)-2.822 F(\()5.322 E F2(datatype)A F0 2.822(=4)2.822
-G 2.821(\)d)-2.822 G .321(ata that are inter)-2.821 F(-)-.2 E .33
-(polated onto the surv)144 662.4 R .63 -.15(ey p)-.15 H .33
-(ing times. In each case the).15 F F2(sour)2.831 E(ce)-.37 E F0 -.25(va)
-2.831 G .331(lue speci\214es a data record type. The).25 F
-(possibilities for K)144 674.4 Q(ongsber)-.35 E 2.5(gd)-.18 G
-(ata include:)-2.5 E(MB_D)156.5 686.4 Q -1.21 -1.11(AT A)-.4 H(_D)1.11 E
--1.21 -1.11(AT A)-.4 H(1)56.39 E(MB_D)156.5 698.4 Q -1.21 -1.11(AT A)-.4
-H(_N)1.11 E 60.85 -1.35(AV 1)-.35 H(2)1.35 E(MB_D)156.5 710.4 Q -1.21
--1.11(AT A)-.4 H 40.9(_HEIGHT 16)1.11 F(MB_D)156.5 722.4 Q -1.21 -1.11
-(AT A)-.4 H 68.57(_HEADING 17)1.11 F(MB-System 5.0)72 768 Q(12 No)
-132.205 E -.15(ve)-.15 G(mber 2014).15 E(2)190.545 E 0 Cg EP
-%%Page: 3 3
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mbk)72 48 Q(ongsber)-.1 E 91.25
-(gpreprocess\(1\) MB-System)-.18 F 91.25(5.0 mbk)2.5 F(ongsber)-.1 E
-(gpreprocess\(1\))-.18 E(MB_D)156.5 84 Q -1.21 -1.11(AT A)-.4 H(_A)1.11
-E 65.79(TTITUDE 18)-1.11 F(MB_D)156.5 96 Q -1.21 -1.11(AT A)-.4 H(_N)
-1.11 E -1.35(AV)-.35 G 55.65(12)1.35 G(8)-55.65 E(MB_D)156.5 108 Q -1.21
--1.11(AT A)-.4 H(_N)1.11 E -1.35(AV)-.35 G 55.65(22)1.35 G(9)-55.65 E
-(MB_D)156.5 120 Q -1.21 -1.11(AT A)-.4 H(_N)1.11 E -1.35(AV)-.35 G 55.65
-(33)1.35 G(0)-55.65 E(MB_D)156.5 132 Q -1.21 -1.11(AT A)-.4 H(_A)1.11 E
-60.79(TTITUDE1 55)-1.11 F(MB_D)156.5 144 Q -1.21 -1.11(AT A)-.4 H(_A)
-1.11 E 60.79(TTITUDE2 56)-1.11 F(MB_D)156.5 156 Q -1.21 -1.11(AT A)-.4 H
-(_A)1.11 E 60.79(TTITUDE3 57)-1.11 F(The def)144 168 Q(ault v)-.1 E
-(alues are:)-.25 E(na)156.5 180 Q(v_source = MB_D)-.2 E -1.21 -1.11
-(AT A)-.4 H(_N)1.11 E -1.35(AV)-.35 G(attitude_source = MB_D)156.5 192 Q
--1.21 -1.11(AT A)-.4 H(_A)1.11 E(TTITUDE)-1.11 E(heading_source = MB_D)
-156.5 204 Q -1.21 -1.11(AT A)-.4 H(_N)1.11 E -1.35(AV)-.35 G
-(sonardepth_source = MB_D)156.5 216 Q -1.21 -1.11(AT A)-.4 H(_D)1.11 E
--1.21 -1.11(AT A)-.4 H/F1 10/Times-Bold at 0 SF<ad54>108 232.8 Q/F2 10
-/Times-Italic at 0 SF(timela)23.63 E(g)-.1 E F0 .832
-(This option speci\214es a)144 244.8 R F2(timela)3.332 E(g)-.1 E F0 -.25
-(va)3.331 G .831(lue in seconds to be applied to the na).25 F(vig)-.2 E
-.831(ation and attitude data)-.05 F 1.066(prior to it being mer)144
-256.8 R 1.066(ged with the bath)-.18 F(ymetry)-.05 E 3.567(.I)-.65 G(f)
--3.567 E F2(timela)3.567 E(g)-.1 E F0 1.067(is a v)3.567 F 1.067
-(alid path to a \214le containing time)-.25 F .137(stamp and time lag p\
-airs, then these data will be read and the time lag applied to particul\
-ar records)144 268.8 R(will be interpolated by time.)144 280.8 Q F1
-<ad57>108 297.6 Q F2(mode)20.3 E F0 .518(By def)144 309.6 R(ault,)-.1 E
-F1(mbk)3.018 E(ongsber)-.15 E(gpr)-.1 E(epr)-.18 E(ocess)-.18 E F0 .518
-(ignores w)3.018 F .518(ater column records and does not pass these lar)
--.1 F(ge)-.18 E .542(records into the output format 59 \214les. If)144
-321.6 R F1(-W)3.042 E F2(1)A F0 .542(is speci\214ed, then the w)3.042 F
-.541(ater column records will be)-.1 F(written to the output \214les.)
-144 333.6 Q/F3 10.95/Times-Bold at 0 SF(EXAMPLES)72 362.4 Q F0
-(Suppose that one has collected a set of three K)108 374.4 Q(ongsber)
--.35 E 2.5(gE)-.18 G(M122 data \214les named:)-2.5 E
-(0000_20111219_154640_METEOR_EM122.all)118 386.4 Q
-(0001_20111219_163703_METEOR_EM122.all)118 398.4 Q
-(0002_20111219_175708_METEOR_EM122.all)118 410.4 Q(First, we w)108 422.4
-Q(ant to generate a "datalist" \214le referencing the ra)-.1 E 2.5(ws)
--.15 G(urv)-2.5 E .3 -.15(ey \214)-.15 H(les. The follo).15 E
-(wing will suf)-.25 E(\214ce:)-.25 E(/bin/ls \2551 *all | a)118 434.4 Q
-(wk '{print $1" 58"}' > datalist_ra)-.15 E -.65(w.)-.15 G(mb-1).65 E
-2.755 -.8(We w)108 446.4 T 1.155(ant to use).7 F F1(mbk)3.655 E(ongsber)
--.15 E(gpr)-.1 E(epr)-.18 E(ocess)-.18 E F0 1.156
-(to gracefully interpolate the asynchronous na)3.655 F(vig)-.2 E 1.156
-(ation, heading)-.05 F .248(and attitude data onto the surv)108 458.4 R
-.548 -.15(ey d)-.15 H .248(ata and to generate data \214les in the e).15
-F .248(xtended format \(MBF_EM710MB)-.15 F(A)-.35 E 3.132(=5)108 470.4 S
-.632(9\). T)-3.132 F 3.132(ol)-.8 G .632
-(earn which potential sources of na)-3.132 F(vig)-.2 E .633
-(ation, heading and attitude are a)-.05 F -.25(va)-.2 G .633
-(ilable, use).25 F F1(mbinf)3.133 E(o)-.25 E F0(with)3.133 E(the)108
-482.4 Q F1<ad4e>2.5 E F0(option:)2.5 E 2.5($m)118 494.4 S
-(binfo \255I 0000_20111219_154640_METEOR_EM122.all \255N)-2.5 E(The)108
-518.4 Q F1<ad4e>2.704 E F0 .204(option causes)2.704 F F1(mbinf)2.704 E
-(o)-.25 E F0 .203(to generate a list of the data record types read in t\
-he \214le at the end of the \214le)2.704 F(statistics:)108 530.4 Q(Sw)
-118 542.4 Q(ath Data File:)-.1 E(0000_20111219_154640_METEOR_EM122.all)
-15 E(MBIO Data F)118 554.4 Q(ormat ID:)-.15 E(58)5 E -.15(Fo)118 566.4 S
-(rmat name:).15 E(MBF_EM710RA)25 E(W)-.9 E(Informal Description: K)118
-578.4 Q(ongsber)-.35 E 2.5(gc)-.18 G(urrent multibeam v)-2.5 E
-(endor format)-.15 E(Attrib)118 590.4 Q 25(utes: K)-.2 F(ongsber)-.35 E
-2.5(gE)-.18 G(M122, EM302, EM710,)-2.5 E(bath)221 602.4 Q(ymetry)-.05 E
-2.5(,a)-.65 G(mplitude, and sidescan,)-2.5 E(up to 400 beams, v)221
-614.4 Q(ariable pix)-.25 E(els, binary)-.15 E 2.5(,K)-.65 G(ongsber)
--2.85 E(g.)-.18 E(Data T)118 638.4 Q(otals:)-.8 E(Number of Records:)118
-650.4 Q(334)62.5 E(Bath)118 662.4 Q(ymetry Data \(432 beams\):)-.05 E
-(Number of Beams:)123 674.4 Q(144288)27.5 E(Number of Good Beams:)123
-686.4 Q 10(129951 90.06%)15 F(Number of Zero Beams:)123 698.4 Q 15(00)
-27.5 G(.00%)-15 E(Number of Flagged Beams:)123 710.4 Q 12.5(14337 9.94%)
-10 F(Amplitude Data \(432 beams\):)118 722.4 Q(MB-System 5.0)72 768 Q
-(12 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E(3)190.545 E 0 Cg EP
-%%Page: 4 4
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mbk)72 48 Q(ongsber)-.1 E 91.25
-(gpreprocess\(1\) MB-System)-.18 F 91.25(5.0 mbk)2.5 F(ongsber)-.1 E
-(gpreprocess\(1\))-.18 E(Number of Beams:)123 84 Q(144288)27.5 E
-(Number of Good Beams:)123 96 Q 10(129951 90.06%)15 F
-(Number of Zero Beams:)123 108 Q 15(00)27.5 G(.00%)-15 E
-(Number of Flagged Beams:)123 120 Q 12.5(14337 9.94%)10 F
-(Sidescan Data \(1024 pix)118 132 Q(els\):)-.15 E(Number of Pix)123 144
-Q 22.5(els: 342016)-.15 F(Number of Good Pix)123 156 Q 10
-(els: 289910 84.77%)-.15 F(Number of Zero Pix)123 168 Q 22.5(els: 0)-.15
-F(0.00%)15 E(Number of Flagged Pix)123 180 Q 5(els: 52106)-.15 F(15.23%)
-12.5 E(Na)118 204 Q(vig)-.2 E(ation T)-.05 E(otals:)-.8 E -.8(To)118 216
-S(tal T).8 E 30(ime: 0.8327)-.35 F(hours)2.5 E -.8(To)118 228 S(tal T).8
-E(rack Length:)-.35 E(13.6418 km)10 E -1.17 -.74(Av e)118 240 T
-(rage Speed:).74 E(16.3823 km/hr \( 8.8553 knots\))22.5 E
-(Start of Data:)118 264 Q -.35(Ti)118 276 S 2.5(me: 12).35 F
-(19 2011 15:46:27.537000)2.5 E(JD353 \(2011-12-19T15:46:27.537000\))5 E
-5(Lon: \25511.562232000)118 288 R 7.5(Lat: 36.848179850)12.5 F 2.5
-(Depth: 4931.4829)12.5 F(meters)2.5 E
-(Speed: 17.6040 km/hr \( 9.5157 knots\))118 300 Q(Heading: 129.1900 de)5
-E(grees)-.15 E(Sonar Depth:)118 312 Q(5.6975 m)10 E
-(Sonar Altitude: 5025.2964 m)5 E(End of Data:)118 336 Q -.35(Ti)118 348
-S 2.5(me: 12).35 F(19 2011 16:36:25.308000)2.5 E
-(JD353 \(2011-12-19T16:36:25.308000\))5 E 5(Lon: \25511.489473500)118
-360 R 7.5(Lat: 36.771997400)12.5 F 2.5(Depth: 3242.5244)12.5 F(meters)
-2.5 E(Speed: 12.7800 km/hr \( 6.9081 knots\))118 372 Q
-(Heading: 274.9200 de)5 E(grees)-.15 E(Sonar Depth:)118 384 Q(6.4334 m)
-10 E(Sonar Altitude: 3236.0911 m)5 E(Limits:)118 408 Q
-(Minimum Longitude:)118 420 Q 5(\25511.635798757 Maximum)12.5 F 10
-(Longitude: \25511.391532562)2.5 F(Minimum Latitude:)118 432 Q 5
-(36.723994163 Maximum)17.5 F 15(Latitude: 36.919907119)2.5 F
-(Minimum Sonar Depth:)118 444 Q 5(5.0135 Maximum)12.5 F(Sonar Depth:)2.5
-E(6.9798)12.5 E(Minimum Altitude:)118 456 Q 5(3175.1121 Maximum)12.5 F
-10(Altitude: 5027.8770)2.5 F(Minimum Depth:)118 468 Q 5
-(2391.9229 Maximum)20 F 17.5(Depth: 5121.0713)2.5 F(Minimum Amplitude:)
-118 480 Q 5(\25559.2000 Maximum)12.5 F 12.5(Amplitude: \2559.1000)2.5 F
-(Minimum Sidescan:)118 492 Q 5(\25590.1300 Maximum)15 F 15
-(Sidescan: \2550.4700)2.5 F(Data Record T)118 516 Q(ype Notices:)-.8 E
-(DN: 334 MB_D)118 528 Q -1.21 -1.11(AT A)-.4 H(_D)1.11 E -1.21 -1.11
-(AT A)-.4 H(\(ID=1\): surv)3.61 E .3 -.15(ey d)-.15 H(ata).15 E
-(DN: 1 MB_D)118 540 Q -1.21 -1.11(AT A)-.4 H(_VELOCITY_PR)1.11 E
-(OFILE \(ID=6\): SVP)-.4 E(DN: 1 MB_D)118 552 Q -1.21 -1.11(AT A)-.4 H
-(_ST)1.11 E(AR)-.93 E 2.5(T\()-.6 G(ID=10\): Simrad start datagram)-2.5
-E(DN: 1 MB_D)118 564 Q -1.21 -1.11(AT A)-.4 H(_ST)1.11 E
-(OP \(ID=11\): Simrad stop datagram)-.18 E(DN: 3023 MB_D)118 576 Q -1.21
--1.11(AT A)-.4 H(_N)1.11 E 2.7 -1.35(AV \()-.35 H(ID=12\): Na)1.35 E
-(vig)-.2 E(ation record)-.05 E(DN: 287 MB_D)118 588 Q -1.21 -1.11(AT A)
--.4 H(_R)1.11 E(UN_P)-.4 E
-(ARAMETER \(ID=13\): Simrad runtime parameter datagram)-.92 E
-(DN: 3022 MB_D)118 600 Q -1.21 -1.11(AT A)-.4 H
-(_CLOCK \(ID=14\): Simrad clock datagram)1.11 E(DN: 2964 MB_D)118 612 Q
--1.21 -1.11(AT A)-.4 H(_A)1.11 E(TTITUDE \(ID=18\): Attitude record)
--1.11 E(DN: 731 MB_D)118 624 Q -1.21 -1.11(AT A)-.4 H
-(_SSV \(ID=19\): Surf)1.11 E(ace sound speed record)-.1 E(DN: 3022 MB_D)
-118 636 Q -1.21 -1.11(AT A)-.4 H(_N)1.11 E -1.35(AV)-.35 G 2.5(3\()1.35
-G(ID=30\): Auxiliary na)-2.5 E 2.5(vs)-.2 G(ystem 3)-2.5 E
-(DN: 3023 MB_D)118 648 Q -1.21 -1.11(AT A)-.4 H(_ST)1.11 E -1.11(AT)-.93
-G(US \(ID=46\): Status record)1.11 E(DN: 2964 MB_D)118 660 Q -1.21 -1.11
-(AT A)-.4 H(_A)1.11 E(TTITUDE1 \(55\): ancillary attitude system 1)-1.11
-E(DN: 1512 MB_D)118 672 Q -1.21 -1.11(AT A)-.4 H(_A)1.11 E
-(TTITUDE2 \(56\): ancillary attitude system 2)-1.11 E(Nonf)118 696 Q
-(atal Error Notices:)-.1 E(EN: 20551 MB_ERR)118 708 Q(OR_NO_D)-.4 E
--1.21 -1.11(AT A)-.4 H(_REQ)1.11 E
-(UESTED \(ID=\25511\): No data requested for b)-.1 E(uf)-.2 E(fer load)
--.25 E(MB-System 5.0)72 768 Q(12 No)132.205 E -.15(ve)-.15 G(mber 2014)
-.15 E(4)190.545 E 0 Cg EP
-%%Page: 5 5
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mbk)72 48 Q(ongsber)-.1 E 91.25
-(gpreprocess\(1\) MB-System)-.18 F 91.25(5.0 mbk)2.5 F(ongsber)-.1 E
-(gpreprocess\(1\))-.18 E(Problem Notices:)118 84 Q .695
-(This listing sho)108 108 R .696
-(ws that the format 58 \214le includes MB_D)-.25 F -1.21 -1.11(AT A)-.4
-H(_N)1.11 E 3.396 -1.35(AV \()-.35 H/F1 10/Times-Italic at 0 SF(sour)1.35 E
-(ce)-.37 E F0 3.196(=1)3.196 G .696(2\) and MB_D)-3.196 F -1.21 -1.11
-(AT A)-.4 H(_N)1.11 E -1.35(AV)-.35 G(3)1.35 E(\()108 120 Q F1(sour)A
-(ce)-.37 E F0 4.419(=3)4.419 G 1.918(0\) records, both of which include\
- both position and heading data. Also included are three)-4.419 F 1.012
-(sources of attitude data: MB_D)108 132 R -1.21 -1.11(AT A)-.4 H(_A)1.11
-E 1.013(TTITUDE \()-1.11 F F1(sour)A(ce)-.37 E F0 3.513(=1)3.513 G 1.013
-(8\), MB_D)-3.513 F -1.21 -1.11(AT A)-.4 H(_A)1.11 E 1.013(TTITUDE1 \()
--1.11 F F1(sour)A(ce)-.37 E F0 3.513(=5)3.513 G(5\),)-3.513 E(and MB_D)
-108 144 Q -1.21 -1.11(AT A)-.4 H(_A)1.11 E(TTITUDE2 \()-1.11 E F1(sour)A
-(ce)-.37 E F0 2.5(=5)2.5 G(6\).)-2.5 E 1.6 -.8(To e)108 168 T
-(xtract and use the def).65 E(ault na)-.1 E(vig)-.2 E
-(ation, heading, and attitude data, the follo)-.05 E(wing will suf)-.25
-E(\214ce:)-.25 E(mbk)118 180 Q(ongsber)-.1 E
-(gpreprocess \255I datalist_ra)-.18 E -.65(w.)-.15 G(mb-1 \255V).65 E
-1.132(An equi)108 204 R -.25(va)-.25 G 1.132(lent command that e).25 F
-1.132(xplicitly speci\214es the def)-.15 F 1.131
-(ault asynchronous data sources using)-.1 F/F2 10/Times-Bold at 0 SF<ad53>
-3.631 E F1(1/sour)A(ce)-.37 E F0(for na)108 216 Q(vig)-.2 E(ation,)-.05
-E F2<ad53>2.5 E F1(2/sour)A(ce)-.37 E F0(for heading, and)2.5 E F2<ad53>
-2.5 E F1(3/sour)A(ce)-.37 E F0(for attitude is:)2.5 E(mbk)118 228 Q
-(ongsber)-.1 E(gpreprocess \255I datalist_ra)-.18 E -.65(w.)-.15 G
-(mb-1 \255V).65 E F2<ad53>2.5 E F1(1/12)A F2<ad53>2.5 E F1(2/12)A F2
-<ad53>2.5 E F1(3/18)A F0 1.6 -.8(To i)108 252 T(nterpolate na).8 E(vig)
--.2 E(ation and heading from the secondary na)-.05 E(vig)-.2 E
-(ation source, use)-.05 E F2<ad53>118 264 Q F1(1/30)A F2<ad53>2.5 E F1
-(2/30)A F0 1.6 -.8(To i)108 288 T
-(nterpolate attitude from ancillary attitude system 2, use:).8 E F2
-<ad53>118 300 Q F1(3/56)A/F3 10.95/Times-Bold at 0 SF(SEE ALSO)72 328.8 Q
-F2(mbsystem)108 340.8 Q F0(\(1\),)A F2(mbf)2.5 E(ormat)-.25 E F0(\(1\),)
-A F2(mbinf)2.5 E(o)-.25 E F0(\(1\))A F3 -.11(BU)72 369.6 S(GS).11 E F0
-(Not true b)108 381.6 Q(ugs. More lik)-.2 E 2.5(ea)-.1 G(rachnids.)-2.5
-E(MB-System 5.0)72 768 Q(12 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E
-(5)190.545 E 0 Cg EP
-%%Trailer
-end
-%%EOF
diff --git a/src/ps/mblevitus.ps b/src/ps/mblevitus.ps
deleted file mode 100644
index 65abd23..0000000
--- a/src/ps/mblevitus.ps
+++ /dev/null
@@ -1,447 +0,0 @@
-%!PS-Adobe-3.0
-%%Creator: groff version 1.19.2
-%%CreationDate: Wed Jul  1 12:29:28 2015
-%%DocumentNeededResources: font Times-Roman
-%%+ font Times-Bold
-%%+ font Times-Italic
-%%DocumentSuppliedResources: procset grops 1.19 2
-%%Pages: 4
-%%PageOrder: Ascend
-%%DocumentMedia: Default 612 792 0 () ()
-%%Orientation: Portrait
-%%EndComments
-%%BeginDefaults
-%%PageMedia: Default
-%%EndDefaults
-%%BeginProlog
-%%BeginResource: procset grops 1.19 2
-%!PS-Adobe-3.0 Resource-ProcSet
-/setpacking where{
-pop
-currentpacking
-true setpacking
-}if
-/grops 120 dict dup begin
-/SC 32 def
-/A/show load def
-/B{0 SC 3 -1 roll widthshow}bind def
-/C{0 exch ashow}bind def
-/D{0 exch 0 SC 5 2 roll awidthshow}bind def
-/E{0 rmoveto show}bind def
-/F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def
-/G{0 rmoveto 0 exch ashow}bind def
-/H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/I{0 exch rmoveto show}bind def
-/J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def
-/K{0 exch rmoveto 0 exch ashow}bind def
-/L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/M{rmoveto show}bind def
-/N{rmoveto 0 SC 3 -1 roll widthshow}bind def
-/O{rmoveto 0 exch ashow}bind def
-/P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/Q{moveto show}bind def
-/R{moveto 0 SC 3 -1 roll widthshow}bind def
-/S{moveto 0 exch ashow}bind def
-/T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/SF{
-findfont exch
-[exch dup 0 exch 0 exch neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/MF{
-findfont
-[5 2 roll
-0 3 1 roll
-neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/level0 0 def
-/RES 0 def
-/PL 0 def
-/LS 0 def
-/MANUAL{
-statusdict begin/manualfeed true store end
-}bind def
-/PLG{
-gsave newpath clippath pathbbox grestore
-exch pop add exch pop
-}bind def
-/BP{
-/level0 save def
-1 setlinecap
-1 setlinejoin
-72 RES div dup scale
-LS{
-90 rotate
-}{
-0 PL translate
-}ifelse
-1 -1 scale
-}bind def
-/EP{
-level0 restore
-showpage
-}def
-/DA{
-newpath arcn stroke
-}bind def
-/SN{
-transform
-.25 sub exch .25 sub exch
-round .25 add exch round .25 add exch
-itransform
-}bind def
-/DL{
-SN
-moveto
-SN
-lineto stroke
-}bind def
-/DC{
-newpath 0 360 arc closepath
-}bind def
-/TM matrix def
-/DE{
-TM currentmatrix pop
-translate scale newpath 0 0 .5 0 360 arc closepath
-TM setmatrix
-}bind def
-/RC/rcurveto load def
-/RL/rlineto load def
-/ST/stroke load def
-/MT/moveto load def
-/CL/closepath load def
-/Fr{
-setrgbcolor fill
-}bind def
-/setcmykcolor where{
-pop
-/Fk{
-setcmykcolor fill
-}bind def
-}if
-/Fg{
-setgray fill
-}bind def
-/FL/fill load def
-/LW/setlinewidth load def
-/Cr/setrgbcolor load def
-/setcmykcolor where{
-pop
-/Ck/setcmykcolor load def
-}if
-/Cg/setgray load def
-/RE{
-findfont
-dup maxlength 1 index/FontName known not{1 add}if dict begin
-{
-1 index/FID ne{def}{pop pop}ifelse
-}forall
-/Encoding exch def
-dup/FontName exch def
-currentdict end definefont pop
-}bind def
-/DEFS 0 def
-/EBEGIN{
-moveto
-DEFS begin
-}bind def
-/EEND/end load def
-/CNT 0 def
-/level1 0 def
-/PBEGIN{
-/level1 save def
-translate
-div 3 1 roll div exch scale
-neg exch neg exch translate
-0 setgray
-0 setlinecap
-1 setlinewidth
-0 setlinejoin
-10 setmiterlimit
-[]0 setdash
-/setstrokeadjust where{
-pop
-false setstrokeadjust
-}if
-/setoverprint where{
-pop
-false setoverprint
-}if
-newpath
-/CNT countdictstack def
-userdict begin
-/showpage{}def
-/setpagedevice{}def
-}bind def
-/PEND{
-countdictstack CNT sub{end}repeat
-level1 restore
-}bind def
-end def
-/setpacking where{
-pop
-setpacking
-}if
-%%EndResource
-%%EndProlog
-%%BeginSetup
-%%BeginFeature: *PageSize Default
-<< /PageSize [ 612 792 ] /ImagingBBox null >> setpagedevice
-%%EndFeature
-%%IncludeResource: font Times-Roman
-%%IncludeResource: font Times-Bold
-%%IncludeResource: font Times-Italic
-grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72
-def/PL 792 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron/Zcaron
-/scaron/zcaron/Ydieresis/trademark/quotesingle/Euro/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/space/exclam/quotedbl/numbersign/dollar/percent
-/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen
-/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon
-/semicolon/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O
-/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright/circumflex
-/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y
-/z/braceleft/bar/braceright/tilde/.notdef/quotesinglbase/guillemotleft
-/guillemotright/bullet/florin/fraction/perthousand/dagger/daggerdbl
-/endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut
-/dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash
-/quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen
-/brokenbar/section/dieresis/copyright/ordfeminine/guilsinglleft
-/logicalnot/minus/registered/macron/degree/plusminus/twosuperior
-/threesuperior/acute/mu/paragraph/periodcentered/cedilla/onesuperior
-/ordmasculine/guilsinglright/onequarter/onehalf/threequarters
-/questiondown/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE
-/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex
-/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis
-/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn
-/germandbls/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla
-/egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis
-/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide/oslash
-/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis]def
-/Times-Italic at 0 ENC0/Times-Italic RE/Times-Bold at 0 ENC0/Times-Bold RE
-/Times-Roman at 0 ENC0/Times-Roman RE
-%%EndSetup
-%%Page: 1 1
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mble)72 48 Q 148.97(vitus\(1\) MB-System)-.25 F
-148.97(5.0 mble)2.5 F(vitus\(1\))-.25 E/F1 10.95/Times-Bold at 0 SF -.219
-(NA)72 84 S(ME).219 E/F2 10/Times-Bold at 0 SF(mble)108 96 Q(vitus)-.15 E
-F0 2.949<ad43>2.949 G .449(reate a w)-2.949 F .449(ater v)-.1 F .449
-(elocity pro\214le which is representati)-.15 F .749 -.15(ve o)-.25 H
-2.949(ft).15 G .449(he mean annual w)-2.949 F .448(ater column for a)-.1
-F(speci\214ed 1 de)108 108 Q(gree by 1 de)-.15 E(gree re)-.15 E(gion.)
--.15 E F1(VERSION)72 136.8 Q F0 -1.11(Ve)108 148.8 S(rsion 5.0)1.11 E F1
-(SYNOPSIS)72 177.6 Q F2(mble)108 189.6 Q(vitus)-.15 E F0([)2.5 E F2
-<ad52>A/F3 10/Times-Italic at 0 SF(lon/lat)A F2<ad4f>2.5 E F3(out\214le)A
-F2<ad5620ad48>2.5 E F3(])A F1(DESCRIPTION)72 218.4 Q F2(mble)108 230.4 Q
-(vitus)-.15 E F0 1.407(generates a mean w)3.907 F 1.407(ater sound v)-.1
-F 1.407
-(elocity pro\214le for a speci\214ed location using temperature and)-.15
-F .78(salinity data from the 1982 Climatological Atlas of the W)108
-242.4 R .779(orld Ocean [Le)-.8 F .779(vitus, 1982].)-.25 F .779(The w)
-5.779 F .779(ater v)-.1 F(elocity)-.15 E 1.2(pro\214le is representati)
-108 254.4 R 1.5 -.15(ve o)-.25 H 3.7(ft).15 G 1.2(he mean annual w)-3.7
-F 1.201(ater column structure for a speci\214ed 1 de)-.1 F 1.201
-(gree by 1 de)-.15 F(gree)-.15 E(re)108 266.4 Q 3.28(gion. The)-.15 F
-.779(pro\214le is output to a speci\214ed \214le which can be read and \
-used by programs \(e.g.)3.28 F F2(mb)3.279 E(bath)-.1 E F0(or)3.279 E F2
-(mb)108 278.4 Q -.1(ve)-.15 G(locitytool).1 E F0 3.423(\)w)C .923
-(hich calculate sw)-3.423 F .923(ath sonar sonar bath)-.1 F .923
-(ymetry from tra)-.05 F -.15(ve)-.2 G 3.423(lt).15 G .923
-(imes by raytracing through a)-3.423 F -.1(wa)108 290.4 S(ter v).1 E
-(elocity model.)-.15 E(The Le)108 314.4 Q(vitus [1982] reference is:)
--.25 E(Le)120.5 326.4 Q(vitus, S, Climatological Atlas of the W)-.25 E
-(orld Ocean,)-.8 E(NO)120.5 338.4 Q(AA Professional P)-.35 E
-(aper 13, U.S. Go)-.15 E -.15(ve)-.15 G(rnment Printing Of).15 E
-(\214ce,)-.25 E -.8(Wa)120.5 350.4 S(shington D.C., 173pp, 1982.).8 E
-(The w)108 362.4 Q(ater sound v)-.1 E(elocity v)-.15 E
-(alues are calculated using the DelGrosso equations, follo)-.25 E(wing:)
--.25 E(Dusha, B. D., P)120.5 374.4 Q 2.5(.F)-1.11 G 2.5(.W)-3.3 G
-(orcester)-3.3 E 2.5(,B)-.4 G 2.5(.D)-2.5 G 2.5(.C)-2.5 G(ornuelle,)-2.5
-E(B. M. Ho)125.5 386.4 Q(we, "On equations for the speed of)-.25 E
-(sound in sea)125.5 398.4 Q -.1(wa)-.15 G
-(ter", J. Acoust. Soc. Am., 93,).1 E(255-275, 1993)125.5 410.4 Q .223
-(The implementation of these equations follo)108 422.4 R .223
-(ws code written at the Ocean Data F)-.25 F .223
-(acility of the Scripps Insti-)-.15 F 2.485(tution of Oceanograph)108
-434.4 R 6.285 -.65(y. T)-.05 H 2.485(he depth to which the Le).65 F
-2.485(vitus database de\214nes the w)-.25 F 2.485
-(ater column re\215ects)-.1 F(re)108 446.4 Q .592(gional w)-.15 F .592
-(ater depths which may be e)-.1 F .591(xceeded in places.)-.15 F F2
-(mble)5.591 E(vitus)-.15 E F0 -.15(ex)3.091 G .591(tends the w).15 F
-.591(ater sound v)-.1 F .591(elocity pro-)-.15 F .293(\214les to a dept\
-h of 12000 meters using the deepest salinity and temperature v)108 458.4
-R .294(alues a)-.25 F -.25(va)-.2 G .294(ilable in the database.).25 F
-(If the speci\214ed location is subaerial, then no w)108 470.4 Q(ater v)
--.1 E(elocity pro\214le is calculated.)-.15 E F1 -.548(AU)72 499.2 S
-(THORSHIP).548 E F0(Da)108 511.2 Q(vid W)-.2 E 2.5(.C)-.92 G
-(aress \(caress at mbari.or)-2.5 E(g\))-.18 E(Montere)113 523.2 Q 2.5(yB)
--.15 G(ay Aquarium Research Institute)-2.5 E
-(Dale N. Chayes \(dale at ldeo.columbia.edu\))108 535.2 Q
-(Lamont-Doherty Earth Observ)113 547.2 Q(atory)-.25 E F1(OPTIONS)72 576
-Q F2<ad48>108 588 Q F0 .162(This "help" \215ag cause the program to pri\
-nt out a description of its operation and then e)22.52 F .161
-(xit immedi-)-.15 F(ately)144 600 Q(.)-.65 E F2<ad4f>108 616.8 Q F3
-(out\214le)22.52 E F0(Sets the output \214le for the w)144 628.8 Q
-(ater v)-.1 E(elocity pro\214le.)-.15 E(Def)5 E(ault:)-.1 E F3
-(out\214le)2.5 E F0 2.5(=")2.5 G -.15(ve)-2.5 G(locity".).15 E F2<ad52>
-108 645.6 Q F3(lon/lat)23.08 E F0 .337
-(Sets the longitude and latitude of the location of the w)144 657.6 R
-.338(ater v)-.1 F .338(elocity pro\214le.)-.15 F .338(Whole de)5.338 F
-.338(grees should)-.15 F(be used, as the database has a 1 de)144 669.6 Q
-(gree by 1 de)-.15 E(gree resolution.)-.15 E(Def)5 E(ault:)-.1 E F3(lon)
-2.5 E F0(=0,)A F3(lat)2.5 E F0(=0.)A F2<ad56>108 686.4 Q F0(Normally)
-23.08 E(,)-.65 E F2(mble)2.533 E(vitus)-.15 E F0 .032
-(outputs only a minor bit of information to the stdout stream.)2.533 F
-.032(If the)5.032 F F2<ad56>2.532 E F0 .032(\215ag is)2.532 F(gi)144
-698.4 Q -.15(ve)-.25 G .107(n, then).15 F F2(mble)2.607 E(vitus)-.15 E
-F0 -.1(wo)2.607 G .107(rks in a "v).1 F .107
-(erbose" mode and also outputs the program v)-.15 F .108
-(ersion being used)-.15 F(and the complete w)144 710.4 Q
-(ater column structure used to calculate the w)-.1 E(ater v)-.1 E
-(elocity pro\214le.)-.15 E(MB-System 5.0)72 768 Q 2.5(3J)146.495 G
-(une 2013)-2.5 E(1)204.835 E 0 Cg EP
-%%Page: 2 2
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mble)72 48 Q 148.97(vitus\(1\) MB-System)-.25 F
-148.97(5.0 mble)2.5 F(vitus\(1\))-.25 E/F1 10.95/Times-Bold at 0 SF
-(EXAMPLES)72 84 Q F0 .319
-(Suppose that one wishes to obtain a mean annual w)108 96 R .319(ater v)
--.1 F .318(elocity pro\214le for processing Hydrosweep DS ba-)-.15 F(th)
-108 108 Q .717(ymetry data collected on the Cocos-Nazca spreading cente\
-r at 95W longitude and 2N latitude.)-.05 F .717(The fol-)5.717 F(lo)108
-120 Q(wing will suf)-.25 E(\214ce:)-.25 E(mble)144 132 Q
-(vitus \255R-95/2 \255Ov)-.25 E(elocity_pro\214le \255V)-.15 E
-(The output will be:)108 144 Q(Program MBLEVITUS)110.5 168 Q
-(MB-system V)110.5 180 Q(ersion 4.5)-1.11 E(Location for mean annual w)
-110.5 204 Q(ater v)-.1 E(elocity pro\214le:)-.15 E 2.5
-(Requested: \25595.0000)115.5 216 R 5(longitude 2.0000)2.5 F(latitude)
-2.5 E 15(Used: 265.5000)115.5 228 R 5(longitude 2.5000)2.5 F(latitude)
-2.5 E -1.11(Va)110.5 240 S(lues de\214ned directly by Le)1.11 E
-(vitus database:)-.25 E(27)15 E -1.11(Va)110.5 252 S
-(lues assuming deepest salinity and temperature: 19)1.11 E -1.11(Ve)
-110.5 264 S(locity points written:)1.11 E(46)65 E(Output \214le: v)110.5
-276 Q(elocity_pro\214le)-.15 E(Mean annual w)110.5 300 Q
-(ater column pro\214le:)-.1 E(Depth T)123 312 Q(emperature Salinity)-.7
-E -1.11(Ve)7.5 G(locity)1.11 E 5(0.0000 25.6560 33.8830 1534.6998)120.5
-324 R 5(10.0000 25.4080 33.8230 1534.2112)118 336 R 5
-(20.0000 24.5410 34.0190 1532.5010)118 348 R 5
-(30.0000 23.3290 34.2400 1529.9032)118 360 R 5
-(50.0000 19.7940 34.7450 1521.4298)118 372 R 5
-(75.0000 15.9700 34.9210 1510.8373)118 384 R 5
-(100.0000 14.5630 34.9400 1506.8495)115.5 396 R 5
-(125.0000 13.9500 34.9320 1505.2728)115.5 408 R 5
-(150.0000 13.5920 34.9270 1504.5077)115.5 420 R 5
-(200.0000 13.0430 34.9100 1503.4935)115.5 432 R 5
-(250.0000 12.4510 34.8780 1502.2893)115.5 444 R 5
-(300.0000 11.4720 34.8190 1499.6840)115.5 456 R 7.5(400.0000 9.4060)
-115.5 468 R 5(34.6990 1493.8119)7.5 F 7.5(500.0000 8.0400)115.5 480 R 5
-(34.6390 1490.2903)7.5 F 7.5(600.0000 7.0330)115.5 492 R 5
-(34.5950 1488.0126)7.5 F 7.5(700.0000 6.2200)115.5 504 R 5
-(34.5740 1486.4380)7.5 F 7.5(800.0000 5.5640)115.5 516 R 5
-(34.5620 1485.4464)7.5 F 7.5(900.0000 5.0280)115.5 528 R 5
-(34.5620 1484.9211)7.5 F 7.5(1000.0000 4.5840)113 540 R 5
-(34.5650 1484.7546)7.5 F 7.5(1100.0000 4.1950)113 552 R 5
-(34.5730 1484.8076)7.5 F 7.5(1200.0000 3.8570)113 564 R 5
-(34.5820 1485.0649)7.5 F 7.5(1300.0000 3.5860)113 576 R 5
-(34.5970 1485.6061)7.5 F 7.5(1400.0000 3.3320)113 588 R 5
-(34.6090 1486.2123)7.5 F 7.5(1500.0000 3.1020)113 600 R 5
-(34.6140 1486.9097)7.5 F 7.5(1750.0000 2.6290)113 612 R 5
-(34.6280 1489.0920)7.5 F 7.5(2000.0000 2.3010)113 624 R 5
-(34.6440 1491.9139)7.5 F 7.5(2500.0000 1.8770)113 636 R 5
-(34.6670 1498.6154)7.5 F 7.5(3000.0000 0.0000 0.0000)113 648 R
-(1507.2345)7.5 E 7.5(3500.0000 0.0000 0.0000)113 660 R(1515.9406)7.5 E
-7.5(4000.0000 0.0000 0.0000)113 672 R(1524.7273)7.5 E 7.5
-(4500.0000 0.0000 0.0000)113 684 R(1533.5883)7.5 E 7.5
-(5000.0000 0.0000 0.0000)113 696 R(1542.5173)7.5 E 7.5
-(5500.0000 0.0000 0.0000)113 708 R(1551.5078)7.5 E 7.5
-(6000.0000 0.0000 0.0000)113 720 R(1560.5533)7.5 E(MB-System 5.0)72 768
-Q 2.5(3J)146.495 G(une 2013)-2.5 E(2)204.835 E 0 Cg EP
-%%Page: 3 3
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mble)72 48 Q 148.97(vitus\(1\) MB-System)-.25 F
-148.97(5.0 mble)2.5 F(vitus\(1\))-.25 E 7.5(6500.0000 0.0000 0.0000)113
-84 R(1569.6471)7.5 E 7.5(7000.0000 0.0000 0.0000)113 96 R(1578.7823)7.5
-E 7.5(7500.0000 0.0000 0.0000)113 108 R(1587.9523)7.5 E 7.5
-(8000.0000 0.0000 0.0000)113 120 R(1597.1499)7.5 E 7.5
-(8500.0000 0.0000 0.0000)113 132 R(1606.3682)7.5 E 7.5
-(9000.0000 0.0000 0.0000)113 144 R(1615.6001)7.5 E 7.5
-(9500.0000 0.0000 0.0000)113 156 R(1624.8383)7.5 E 7.5
-(10000.0000 0.0000 0.0000)110.5 168 R(1634.0754)7.5 E 7.5
-(10500.0000 0.0000 0.0000)110.5 180 R(1643.3042)7.5 E 7.5
-(11000.0000 0.0000 0.0000)110.5 192 R(1652.5171)7.5 E 7.5
-(11500.0000 0.0000 0.0000)110.5 204 R(1661.7062)7.5 E 7.5
-(12000.0000 0.0000 0.0000)110.5 216 R(1670.8641)7.5 E
-(The contents of the output \214le v)108 240 Q(elocity_pro\214le are:)
--.15 E 2.5(#W)110.5 252 S(ater v)-3.3 E
-(elocity pro\214le created by program MBLEVITUS)-.15 E 2.5(#M)110.5 264
-S(B-system V)-2.5 E(ersion 4.5)-1.11 E 2.5(#R)110.5 276 S
-(un by user <caress> on cpu <menard> at <W)-2.5 E
-(ed Mar 26 15:43:53 1997>)-.8 E 2.5(#W)110.5 288 S(ater v)-3.3 E
-(elocity pro\214le deri)-.15 E -.15(ve)-.25 G 2.5(df).15 G(rom Le)-2.5 E
-(vitus)-.25 E 2.5(#t)110.5 300 S(emperature and salinity database.)-2.5
-E(This pro\214le)5 E 2.5(#r)110.5 312 S(epresents the annual a)-2.5 E
--.15(ve)-.2 G(rage w).15 E(ater v)-.1 E(elocity)-.15 E 2.5(#s)110.5 324
-S(tructure for a 1 de)-2.5 E(gree X 1 de)-.15 E(gree area centered)-.15
-E 2.5(#a)110.5 336 S 2.5(t2)-2.5 G
-(65.5000 longitude and 2.5000 latitude.)-2.5 E 2.5(#T)110.5 348 S(his w)
--2.5 E(ater v)-.1 E(elocity pro\214le is in the form)-.15 E 2.5(#o)110.5
-360 S 2.5(fd)-2.5 G(iscrete \(depth, v)-2.5 E(elocity\) points where)
--.15 E 2.5(#t)110.5 372 S(he depth is in meters and the v)-2.5 E
-(elocity in)-.15 E 2.5(#m)110.5 384 S(eters/second.)-2.5 E 2.5(#T)110.5
-396 S(he \214rst 27 v)-2.5 E(elocity v)-.15 E
-(alues are de\214ned using the)-.25 E 2.5(#s)110.5 408 S
-(alinity and temperature v)-2.5 E(alues a)-.25 E -.25(va)-.2 G
-(ilable in the).25 E 2.5(#L)110.5 420 S -.25(ev)-2.5 G
-(itus database; the remaining 19 v).25 E(elocity v)-.15 E(alues are)-.25
-E 2.5(#c)110.5 432 S(alculated using the deepest temperature)-2.5 E 2.5
-(#a)110.5 444 S(nd salinity v)-2.5 E(alue a)-.25 E -.25(va)-.2 G
-(ilable.).25 E(0.000000 1534.699829)110.5 456 Q(10.000000 1534.211182)
-110.5 468 Q(20.000000 1532.500977)110.5 480 Q(30.000000 1529.903198)
-110.5 492 Q(50.000000 1521.429810)110.5 504 Q(75.000000 1510.837280)
-110.5 516 Q(100.000000 1506.849487)110.5 528 Q(125.000000 1505.272827)
-110.5 540 Q(150.000000 1504.507690)110.5 552 Q(200.000000 1503.493530)
-110.5 564 Q(250.000000 1502.289307)110.5 576 Q(300.000000 1499.683960)
-110.5 588 Q(400.000000 1493.811890)110.5 600 Q(500.000000 1490.290283)
-110.5 612 Q(600.000000 1488.012573)110.5 624 Q(700.000000 1486.437988)
-110.5 636 Q(800.000000 1485.446411)110.5 648 Q(900.000000 1484.921143)
-110.5 660 Q(1000.000000 1484.754639)110.5 672 Q(1100.000000 1484.807617)
-110.5 684 Q(1200.000000 1485.064941)110.5 696 Q(1300.000000 1485.606079)
-110.5 708 Q(1400.000000 1486.212280)110.5 720 Q(MB-System 5.0)72 768 Q
-2.5(3J)146.495 G(une 2013)-2.5 E(3)204.835 E 0 Cg EP
-%%Page: 4 4
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mble)72 48 Q 148.97(vitus\(1\) MB-System)-.25 F
-148.97(5.0 mble)2.5 F(vitus\(1\))-.25 E(1500.000000 1486.909668)110.5 84
-Q(1750.000000 1489.092041)110.5 96 Q(2000.000000 1491.913940)110.5 108 Q
-(2500.000000 1498.615356)110.5 120 Q(3000.000000 1507.234497)110.5 132 Q
-(3500.000000 1515.940552)110.5 144 Q(4000.000000 1524.727295)110.5 156 Q
-(4500.000000 1533.588257)110.5 168 Q(5000.000000 1542.517334)110.5 180 Q
-(5500.000000 1551.507812)110.5 192 Q(6000.000000 1560.553345)110.5 204 Q
-(6500.000000 1569.647095)110.5 216 Q(7000.000000 1578.782349)110.5 228 Q
-(7500.000000 1587.952271)110.5 240 Q(8000.000000 1597.149902)110.5 252 Q
-(8500.000000 1606.368164)110.5 264 Q(9000.000000 1615.600098)110.5 276 Q
-(9500.000000 1624.838257)110.5 288 Q(10000.000000 1634.075439)110.5 300
-Q(10500.000000 1643.304199)110.5 312 Q(11000.000000 1652.517090)110.5
-324 Q(11500.000000 1661.706177)110.5 336 Q(12000.000000 1670.864136)
-110.5 348 Q/F1 10.95/Times-Bold at 0 SF(SEE ALSO)72 376.8 Q/F2 10
-/Times-Bold at 0 SF(mbsystem)108 388.8 Q F0(\(1\),)A F2(mb)2.5 E -.1(ve)
--.15 G(locitytool).1 E F0(\(1\),)A F2(mbpr)2.5 E(ocess)-.18 E F0(\(1\),)
-A F2(mbset)2.5 E F0(\(1\),)A F2(mbm_xbt)2.5 E F0(\(1\))A F1 -.11(BU)72
-417.6 S(GS).11 E F0(None kno)108 429.6 Q(wn.)-.25 E(MB-System 5.0)72 768
-Q 2.5(3J)146.495 G(une 2013)-2.5 E(4)204.835 E 0 Cg EP
-%%Trailer
-end
-%%EOF
diff --git a/src/ps/mblist.ps b/src/ps/mblist.ps
deleted file mode 100644
index 1ed4ef4..0000000
--- a/src/ps/mblist.ps
+++ /dev/null
@@ -1,895 +0,0 @@
-%!PS-Adobe-3.0
-%%Creator: groff version 1.19.2
-%%CreationDate: Wed Jul  1 12:29:28 2015
-%%DocumentNeededResources: font Times-Roman
-%%+ font Times-Bold
-%%+ font Times-Italic
-%%DocumentSuppliedResources: procset grops 1.19 2
-%%Pages: 9
-%%PageOrder: Ascend
-%%DocumentMedia: Default 612 792 0 () ()
-%%Orientation: Portrait
-%%EndComments
-%%BeginDefaults
-%%PageMedia: Default
-%%EndDefaults
-%%BeginProlog
-%%BeginResource: procset grops 1.19 2
-%!PS-Adobe-3.0 Resource-ProcSet
-/setpacking where{
-pop
-currentpacking
-true setpacking
-}if
-/grops 120 dict dup begin
-/SC 32 def
-/A/show load def
-/B{0 SC 3 -1 roll widthshow}bind def
-/C{0 exch ashow}bind def
-/D{0 exch 0 SC 5 2 roll awidthshow}bind def
-/E{0 rmoveto show}bind def
-/F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def
-/G{0 rmoveto 0 exch ashow}bind def
-/H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/I{0 exch rmoveto show}bind def
-/J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def
-/K{0 exch rmoveto 0 exch ashow}bind def
-/L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/M{rmoveto show}bind def
-/N{rmoveto 0 SC 3 -1 roll widthshow}bind def
-/O{rmoveto 0 exch ashow}bind def
-/P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/Q{moveto show}bind def
-/R{moveto 0 SC 3 -1 roll widthshow}bind def
-/S{moveto 0 exch ashow}bind def
-/T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/SF{
-findfont exch
-[exch dup 0 exch 0 exch neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/MF{
-findfont
-[5 2 roll
-0 3 1 roll
-neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/level0 0 def
-/RES 0 def
-/PL 0 def
-/LS 0 def
-/MANUAL{
-statusdict begin/manualfeed true store end
-}bind def
-/PLG{
-gsave newpath clippath pathbbox grestore
-exch pop add exch pop
-}bind def
-/BP{
-/level0 save def
-1 setlinecap
-1 setlinejoin
-72 RES div dup scale
-LS{
-90 rotate
-}{
-0 PL translate
-}ifelse
-1 -1 scale
-}bind def
-/EP{
-level0 restore
-showpage
-}def
-/DA{
-newpath arcn stroke
-}bind def
-/SN{
-transform
-.25 sub exch .25 sub exch
-round .25 add exch round .25 add exch
-itransform
-}bind def
-/DL{
-SN
-moveto
-SN
-lineto stroke
-}bind def
-/DC{
-newpath 0 360 arc closepath
-}bind def
-/TM matrix def
-/DE{
-TM currentmatrix pop
-translate scale newpath 0 0 .5 0 360 arc closepath
-TM setmatrix
-}bind def
-/RC/rcurveto load def
-/RL/rlineto load def
-/ST/stroke load def
-/MT/moveto load def
-/CL/closepath load def
-/Fr{
-setrgbcolor fill
-}bind def
-/setcmykcolor where{
-pop
-/Fk{
-setcmykcolor fill
-}bind def
-}if
-/Fg{
-setgray fill
-}bind def
-/FL/fill load def
-/LW/setlinewidth load def
-/Cr/setrgbcolor load def
-/setcmykcolor where{
-pop
-/Ck/setcmykcolor load def
-}if
-/Cg/setgray load def
-/RE{
-findfont
-dup maxlength 1 index/FontName known not{1 add}if dict begin
-{
-1 index/FID ne{def}{pop pop}ifelse
-}forall
-/Encoding exch def
-dup/FontName exch def
-currentdict end definefont pop
-}bind def
-/DEFS 0 def
-/EBEGIN{
-moveto
-DEFS begin
-}bind def
-/EEND/end load def
-/CNT 0 def
-/level1 0 def
-/PBEGIN{
-/level1 save def
-translate
-div 3 1 roll div exch scale
-neg exch neg exch translate
-0 setgray
-0 setlinecap
-1 setlinewidth
-0 setlinejoin
-10 setmiterlimit
-[]0 setdash
-/setstrokeadjust where{
-pop
-false setstrokeadjust
-}if
-/setoverprint where{
-pop
-false setoverprint
-}if
-newpath
-/CNT countdictstack def
-userdict begin
-/showpage{}def
-/setpagedevice{}def
-}bind def
-/PEND{
-countdictstack CNT sub{end}repeat
-level1 restore
-}bind def
-end def
-/setpacking where{
-pop
-setpacking
-}if
-%%EndResource
-%%EndProlog
-%%BeginSetup
-%%BeginFeature: *PageSize Default
-<< /PageSize [ 612 792 ] /ImagingBBox null >> setpagedevice
-%%EndFeature
-%%IncludeResource: font Times-Roman
-%%IncludeResource: font Times-Bold
-%%IncludeResource: font Times-Italic
-grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72
-def/PL 792 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron/Zcaron
-/scaron/zcaron/Ydieresis/trademark/quotesingle/Euro/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/space/exclam/quotedbl/numbersign/dollar/percent
-/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen
-/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon
-/semicolon/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O
-/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright/circumflex
-/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y
-/z/braceleft/bar/braceright/tilde/.notdef/quotesinglbase/guillemotleft
-/guillemotright/bullet/florin/fraction/perthousand/dagger/daggerdbl
-/endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut
-/dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash
-/quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen
-/brokenbar/section/dieresis/copyright/ordfeminine/guilsinglleft
-/logicalnot/minus/registered/macron/degree/plusminus/twosuperior
-/threesuperior/acute/mu/paragraph/periodcentered/cedilla/onesuperior
-/ordmasculine/guilsinglright/onequarter/onehalf/threequarters
-/questiondown/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE
-/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex
-/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis
-/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn
-/germandbls/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla
-/egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis
-/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide/oslash
-/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis]def
-/Times-Italic at 0 ENC0/Times-Italic RE/Times-Bold at 0 ENC0/Times-Bold RE
-/Times-Roman at 0 ENC0/Times-Roman RE
-%%EndSetup
-%%Page: 1 1
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 163.16(mblist\(1\) MB-System)72 48 R 163.16
-(5.0 mblist\(1\))2.5 F/F1 10.95/Times-Bold at 0 SF -.219(NA)72 84 S(ME).219
-E/F2 10/Times-Bold at 0 SF(mblist)108 96 Q F0 2.5<ad4c>2.5 G
-(ist data in sw)-2.5 E(ath data \214les.)-.1 E F1(VERSION)72 124.8 Q F0
--1.11(Ve)108 136.8 S(rsion 5.0)1.11 E F1(SYNOPSIS)72 165.6 Q F2(mblist)
-108 177.6 Q F0([)2.733 E F2 .233<ad4120ad42>B/F3 10/Times-Italic at 0 SF
-(yr/mo/da/hr/mn/sc)A F2 .232<ad4320ad44>2.732 F F3(dumpmode)A F2<ad45>
-2.732 E F3(yr/mo/da/hr/mn/sc)A F2<ad46>2.732 E F3(format)A F2<ad47>2.732
-E F3(delimiter)A F2 .232<ad4820ad49>2.732 F F3(in-)A(\214lename)108
-189.6 Q F2<ad4b>5.033 E F3(decimate)A F2<ad4c>5.033 E F3(lon\215ip)A F2
-<ad4d>5.034 E F0([)A F3(start_beam/end_beam)A F0(|)5.034 E F2(A)5.034 E
-F0(|)5.034 E F2(X)5.034 E F3(per)A(centa)-.37 E -.1(ge)-.1 G F0(]).1 E
-F2<ad4e>5.034 E F3(start_pixel/end_pixel)A F2<ad4f>108 201.6 Q F3
-(output_format)A F2<ad50>3.973 E F3(pings)A F2 1.472<ad5120ad52>3.973 F
-F3(west/east/south/north)A F2<ad53>3.972 E F3(speed)A F2<ad54>3.972 E F3
-(time)A(gap)-.4 E F2<ad55>3.972 E F3 -.15(ch)C(ec).15 E(k)-.2 E F2 1.472
-<ad5620ad5720ad58>3.972 F F3(out\214le)A F2<ad5a>108 213.6 Q F3(se)A
-(gment)-.4 E F0(])A F1(DESCRIPTION)72 242.4 Q F2(mblist)108 254.4 Q F0
-1.249(is a utility to list the contents of a sw)3.749 F 1.249
-(ath data \214le or \214les to stdout. By def)-.1 F(ault,)-.1 E F2
-(mblist)3.749 E F0(produces)3.749 E .916(ASCII \214les in spreadsheet s\
-tyle, with data columns separated by tabs. Alternati)108 266.4 R -.15
-(ve)-.25 G(ly).15 E 3.415(,o)-.65 G .915(ther column delim-)-3.415 F
-.209(iters can be used \()108 278.4 R F2<ad47>A F0 .209
-(option\), or the output can be binary)2.709 F 2.71(,w)-.65 G .21
-(ith each \214eld represented as a double precision)-2.71 F .436
-(\215oat \()108 290.4 R F2<ad41>A F0 2.936(option\). Output)2.936 F .435
-(can also be in netCDF CDL \()2.936 F F2<ad43>A F0 .435
-(option\) format, or as a binary netCDF \214le \()2.935 F F2<ad43>A
-<ad41>108 302.4 Q F0 2.916(\). The)B .416(output of)2.916 F F2(mblist)
-2.916 E F0 .416
-(can be piped to plotting and data analysis programs. The option)2.916 F
-F2<ad4f>2.917 E F3(output_for)A(-)-.2 E(mat)108 314.4 Q F0 .338
-(can be used to control the data types that are sent to stdout. The def)
-2.839 F .338(ault is to output a single record for)-.1 F .288(each surv)
-108 326.4 R .588 -.15(ey p)-.15 H .289(ing, and for an).15 F 2.789(yo)
--.15 G .289(utput na)-2.789 F(vig)-.2 E .289(ation v)-.05 F .289
-(alues to re\215ect the sonar or ship na)-.25 F(vig)-.2 E .289
-(ation. In this mode,)-.05 F(an)108 338.4 Q 3.054(yo)-.15 G .554
-(utput depth, amplitude, or sidescan v)-3.054 F .554(alues are deri)-.25
-F -.15(ve)-.25 G 3.054(df).15 G .553(rom the beam and pix)-3.054 F .553
-(el located closest to the)-.15 F(na)108 350.4 Q(vig)-.2 E 1.154
-(ation \(the most v)-.05 F 1.154
-(ertical position under the sonar\). If the)-.15 F F2<ad4d>3.654 E F0
-(or)3.655 E F2<ad4e>3.655 E F0 1.155(options are used to set speci\214c)
-3.655 F .467(ranges of beams or pix)108 362.4 R .467(els to be used, th\
-en records are output for each of the speci\214ed beams or pix)-.15 F
-.467(els and)-.15 F(an)108 374.4 Q 3.431(yn)-.15 G -.2(av)-3.431 G(ig).2
-E .931(ation, depth or sidescan v)-.05 F .931
-(alues output re\215ect the positions and v)-.25 F .932
-(alues of the speci\214ed beams or)-.25 F(pix)108 386.4 Q 2.564
-(els. The)-.15 F .064(data input may be a)2.564 F -.15(ve)-.2 G .063
-(raged or windo).15 F .063(wed in time and space before it is listed.)
--.25 F .063(Complete dumps)5.063 F(of bath)108 398.4 Q(ymetry)-.05 E 2.5
-(,a)-.65 G(mplitude, or sidescan data are possible as well.)-2.5 E F1
--.548(AU)72 427.2 S(THORSHIP).548 E F0(Da)108 439.2 Q(vid W)-.2 E 2.5
-(.C)-.92 G(aress \(caress at mbari.or)-2.5 E(g\))-.18 E(Montere)113 451.2 Q
-2.5(yB)-.15 G(ay Aquarium Research Institute)-2.5 E
-(Dale N. Chayes \(dale at ldeo.columbia.edu\))108 463.2 Q
-(Lamont-Doherty Earth Observ)113 475.2 Q(atory)-.25 E(Alberto Malin)108
-487.2 Q -.15(ve)-.4 G(rno).15 E(Schlumber)113 499.2 Q(ger)-.18 E(-Doll)
--.2 E F1(OPTIONS)72 528 Q F2<ad41>108 540 Q F0 1.035
-(Causes the output to be binary \(nati)144 552 R 1.335 -.15(ve d)-.25 H
-1.035(ouble precision \215oating point\) rather than ASCII. Some).15 F
-.032
-(output options cannot be represented as single binary \215oats \(e.g.)
-144 564 R .032(time strings and longitude or lati-)5.032 F 1.063
-(tude brok)144 576 R 1.063(en into de)-.1 F 1.063
-(grees and minutes. These v)-.15 F 1.064
-(alues are output as multiple \214elds as appropriate.)-.25 F(Def)144
-588 Q .325(ault: ASCII output with \214elds separated by tabs, or by an\
-other delimiter speci\214ed with the)-.1 F F2<ad47>2.825 E F0(option.)
-144 600 Q F2<ad42>108 616.8 Q F3(yr/mo/da/hr/mn/sc)23.63 E F0 .155
-(This option sets the starting time for data allo)144 628.8 R .155
-(wed in the input data.)-.25 F(The)5.155 E F2<ad45>2.655 E F0 .155
-(option sets the ending)2.655 F .195
-(time for data. If the starting time is before the ending time, then an)
-144 640.8 R 2.695(yd)-.15 G .195(ata with a time stamp before)-2.695 F
-.444(the starting time or after the ending time is ignored. If instead \
-the starting time is after the ending)144 652.8 R .195(time, then an)144
-664.8 R 2.695(yd)-.15 G .194(ata between the ending and starting time w\
-ill be ignored. This scheme allo)-2.695 F .194(ws time)-.25 F(windo)144
-676.8 Q 5.376(wing both inside and outside a speci\214ed interv)-.25 F
-7.876(al. Def)-.25 F(ault:)-.1 E F3(yr/mo/da/hr/mn/sc)7.876 E F0(=)7.876
-E(1962/2/21/10/30/0.)144 688.8 Q F2<ad43>108 705.6 Q F0 .487
-(Causes netCDF CDL format output to be generated \(see)144 717.6 R F2
-(ncgen)2.987 E F0 2.987(\). When)B(the)2.986 E F2<ad41>2.986 E F0 .486
-(\(binary\) option is)2.986 F 1.018(also set)144 729.6 R F2(mblist)3.518
-E F0 1.019(will call)3.519 F F2(ncgen)3.519 E F0 1.019(to con)3.519 F
--.15(ve)-.4 G 1.019(rt the CDL \214le to a binary netCDF \214le \(def)
-.15 F 1.019(ault name is)-.1 F(MB-System 5.0)72 768 Q(17 May 2014)
-143.995 E(1)202.335 E 0 Cg EP
-%%Page: 2 2
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 163.16(mblist\(1\) MB-System)72 48 R 163.16
-(5.0 mblist\(1\))2.5 F/F1 10/Times-Italic at 0 SF(mblist.nc)144 84 Q F0
-(\), if successful the CDL \214le will be remo)A -.15(ve)-.15 G(d.).15 E
-/F2 10/Times-Bold at 0 SF<ad44>108 100.8 Q F1(dumpmode)23.08 E F0(Normally)
-144 112.8 Q 3.734(,t)-.65 G 1.234(he output format is controlled by the)
--3.734 F F2<ad4f>3.734 E F0 1.233(option and the number of beams or pix)
-3.734 F(els)-.15 E .32(which are output is controlled by the)144 124.8 R
-F2<ad4d>2.82 E F0(and)2.82 E F2<ad4e>2.82 E F0 2.82(options. The)2.82 F
-F2<ad44>2.82 E F0 .32(option pro)2.82 F .32(vides a short cut for)-.15 F
-1.235(producing complete dumps of the longtitude and latitude locations\
- of all beams or pix)144 136.8 R 1.235(els along)-.15 F 1.44
-(with the associated bath)144 148.8 R(ymetry)-.05 E 3.941(,t)-.65 G
-(opograph)-3.941 E 2.741 -.65(y, a)-.05 H 1.441(mplitude, or sidescan v)
-.65 F 3.941(alues. The)-.25 F 1.441("lon lat v)3.941 F(alue")-.25 E .386
-(triples are often useful for input into gridding programs \(e.g. the)
-144 160.8 R F2(GMT)2.886 E F0(program)2.886 E F2(surface)2.886 E F0
-2.886(\)o)C 2.886(ro)-2.886 G(ther)-2.886 E .993(utilities. All v)144
-172.8 R .993(alid \(positi)-.25 F -.15(ve)-.25 G 3.493(\)v).15 G .993
-(alues will be output, unless the)-3.743 F F2<ad51>3.493 E F0 .993
-(option is used to disable v)3.493 F(alue)-.25 E 2.5(checking. The)144
-184.8 R F1(dumpmode)2.5 E F0(options are:)2.5 E F1(dumpmode)144 201.6 Q
-F0 2.5(=1)2.5 G 5(:f)-2.5 G(ormat controlled by)-5 E F2<ad4f>2.5 E F0
-(option)2.5 E F1(dumpmode)144 218.4 Q F0 2.5(=2)2.5 G 5(:l)-2.5 G
-(ongitude latitude depth)-5 E F1(dumpmode)144 235.2 Q F0 2.5(=3)2.5 G 5
-(:l)-2.5 G(ongitude latitude topograph)-5 E(y)-.05 E F1(dumpmode)144 252
-Q F0 2.5(=4)2.5 G 5(:l)-2.5 G(ongitude latitude amplitude)-5 E F1
-(dumpmode)144 268.8 Q F0 2.5(=5)2.5 G 5(:l)-2.5 G
-(ongitude latitude sidescan)-5 E(Use of the)144 280.8 Q F2<ad44>2.5 E F0
-(option supercedes the)2.5 E F2<ad4f>2.5 E F0(,)A F2<ad4d>2.5 E F0 2.5
-(,a)C(nd)-2.5 E F2<ad4e>2.5 E F0 2.5(options. Def)2.5 F(ault:)-.1 E F1
-(mode)2.5 E F0 2.5(=1)2.5 G(.)-2.5 E F2<ad45>108 297.6 Q F1
-(yr/mo/da/hr/mn/sc)23.63 E F0 .155
-(This option sets the ending time for data allo)144 309.6 R .155
-(wed in the input data.)-.25 F(The)5.155 E F2<ad42>2.655 E F0 .155
-(option sets the starting)2.655 F .195
-(time for data. If the starting time is before the ending time, then an)
-144 321.6 R 2.695(yd)-.15 G .196(ata with a time stamp before)-2.695 F
-.444(the starting time or after the ending time is ignored. If instead \
-the starting time is after the ending)144 333.6 R .194(time, then an)144
-345.6 R 2.694(yd)-.15 G .194(ata between the ending and starting time w\
-ill be ignored. This scheme allo)-2.694 F .195(ws time)-.25 F(windo)144
-357.6 Q 5.376(wing both inside and outside a speci\214ed interv)-.25 F
-7.876(al. Def)-.25 F(ault:)-.1 E F1(yr/mo/da/hr/mn/sc)7.876 E F0(=)7.876
-E(2062/2/21/10/30/0.)144 369.6 Q F2<ad46>108 386.4 Q F1(format)24.19 E
-F0 .067(Sets the format for the input sw)144 398.4 R .067
-(ath data using)-.1 F F2(MBIO)2.567 E F0(inte)2.567 E .068
-(ger format identi\214ers.)-.15 F .068(This program uses)5.068 F(the)144
-410.4 Q F2(MBIO)3.432 E F0 .932(library and will read an)3.432 F 3.432
-(ys)-.15 G -.1(wa)-3.432 G .932(th format supported by).1 F F2(MBIO)
-3.432 E F0 3.432(.Al)C .931(ist of the sw)-3.432 F .931(ath data)-.1 F
-1.231(formats currently supported by)144 422.4 R F2(MBIO)3.731 E F0
-1.231(and their identi\214er v)3.731 F 1.232(alues is gi)-.25 F -.15(ve)
--.25 G 3.732(ni).15 G 3.732(nt)-3.732 G(he)-3.732 E F2(MBIO)3.732 E F0
-(manual)3.732 E(page. Def)144 434.4 Q(ault:)-.1 E F1(format)2.5 E F0 2.5
-(=1)2.5 G(1.)-2.5 E F2<ad47>108 451.2 Q F1(delimiter)22.52 E F0 .079(Se\
-ts the character\(s\) used to separate output \214elds when ascii colum\
-ns are output. Def)144 463.2 R .078(ault: tabs are)-.1 F
-(used as delimiters.)144 475.2 Q F2<ad48>108 492 Q F0 .162(This "help" \
-\215ag cause the program to print out a description of its operation an\
-d then e)22.52 F .162(xit immedi-)-.15 F(ately)144 504 Q(.)-.65 E F2
-<ad49>108 520.8 Q F1(\214lename)26.41 E F0 1.084
-(Sets the input \214lename. If)144 532.8 R F1(format)3.584 E F0 3.584
-(>0\()3.584 G 1.084(set with the)-3.584 F F2<ad46>3.584 E F0 1.084
-(option\) then the sw)3.584 F 1.083(ath data contained in)-.1 F F1
-(in\214le)144 544.8 Q F0 .214(is read and processed. If)2.714 F F1
-(format)2.714 E F0 2.714(<0)2.714 G 2.714(,t)-2.714 G(hen)-2.714 E F1
-(in\214le)2.714 E F0 .215
-(is assumed to be an ascii \214le containing a list)2.715 F .528
-(of the input sw)144 556.8 R .528
-(ath data \214les to be processed and their formats.)-.1 F .527
-(The program will read the data in)5.528 F .332
-(each one of these \214les.)144 568.8 R .332(In the)5.332 F F1(in\214le)
-2.832 E F0 .333(\214le, each data \214le should be follo)2.833 F .333
-(wed by a data format identi-)-.25 F(\214er)144 580.8 Q 2.5(,e)-.4 G
-(.g.:)-2.5 E(data\214le1 11)180 592.8 Q(data\214le2 24)180 604.8 Q .619
-(This program uses the)144 616.8 R F2(MBIO)3.119 E F0 .619
-(library and will read an)3.119 F 3.119(ys)-.15 G -.1(wa)-3.119 G .619
-(th format supported by).1 F F2(MBIO)3.118 E F0 3.118(.Al)C(ist)-3.118 E
-.563(of the sw)144 628.8 R .564(ath data formats currently supported by)
--.1 F F2(MBIO)3.064 E F0 .564(and their identi\214er v)3.064 F .564
-(alues is gi)-.25 F -.15(ve)-.25 G 3.064(ni).15 G 3.064(nt)-3.064 G(he)
--3.064 E F2(MBIO)144 640.8 Q F0(manual page.)2.5 E(Def)5 E(ault:)-.1 E
-F1(in\214le)2.5 E F0 2.5(=")2.5 G(datalist.mb-1".)-2.5 E F2<ad4b>108
-657.6 Q F1(decimate)22.52 E F0 .408
-(Sets the decimation of the output data. By def)144 669.6 R .407
-(ault \(i.e.)-.1 F F1(decimate)2.907 E F0 .407(=1\), e)B -.15(ve)-.25 G
-.407(ry a).15 F -.25(va)-.2 G .407(ilable data record is).25 F
-(output. If)144 681.6 Q F1(decimate)2.5 E F0(>1, then only e)A -.15(ve)
--.25 G(ry ").15 E F1(decimate)A F0("th record will be output. Def)A
-(ault:)-.1 E F1(decimate)2.5 E F0(=1.)A F2<ad4c>108 698.4 Q F1
-(lon\215ip)23.63 E F0 .572(Sets the range of the longitude v)144 710.4 R
-.572(alues returned.)-.25 F(If)5.572 E F1(lon\215ip)3.072 E F0 .572
-(=\2551 then the longitude v)B .572(alues will be in)-.25 F .489
-(the range from \255360 to 0 de)144 722.4 R .488(grees. If)-.15 F F1
-(lon\215ip)2.988 E F0 .488(=0 then the longitude v)B .488
-(alues will be in the range from)-.25 F(MB-System 5.0)72 768 Q
-(17 May 2014)143.995 E(2)202.335 E 0 Cg EP
-%%Page: 3 3
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 163.16(mblist\(1\) MB-System)72 48 R 163.16
-(5.0 mblist\(1\))2.5 F 1.382(\255180 to 180 de)144 84 R 1.382(grees. If)
--.15 F/F1 10/Times-Italic at 0 SF(lon\215ip)3.882 E F0 1.382
-(=1 then the longitude v)B 1.382
-(alues will be in the range from 0 to 360)-.25 F(de)144 96 Q 2.5
-(grees. Def)-.15 F(ault:)-.1 E F1(lon\215ip)2.5 E F0 2.5(=0)2.5 G(.)-2.5
-E/F2 10/Times-Bold at 0 SF<ad4d>108 112.8 Q F1(start_beam/end_beam)20.86 E
-F0(or)2.5 E F2(A)2.5 E F0(or)2.5 E F2(X)2.5 E F1 -.2(ex)C(cludeper).2 E
-(cent)-.37 E F0 .052(Determines the range of bath)144 124.8 R .052
-(ymetry beams for which records will be output.)-.05 F .052
-(If this option is used,)5.052 F .574(then an)144 136.8 R 3.074(yl)-.15
-G .574(ongitude and latitude v)-3.074 F .574
-(alues output will re\215ect the positions of indi)-.25 F .574
-(vidual beams on the)-.25 F(sea\215oor)144 148.8 Q 10.605(.I)-.55 G(f)
--10.605 E F2(\255MA)8.105 E F0 5.605(is gi)8.105 F -.15(ve)-.25 G 5.605
-(n, then a record will be output for each v).15 F 5.604(alid beam. If)
--.25 F F1(start_beam/end_beam)144 160.8 Q F0 .352(is speci\214ed, then \
-records will be output only for beams in this range. Beam)2.852 F .137
-(numbers start with zero on the port side.)144 172.8 R(If)5.136 E F2
-(\255MX)2.636 E F1 -.2(ex)C(cludeper).2 E(cent)-.37 E F0 .136(is gi)
-2.636 F -.15(ve)-.25 G .136(n, then records will be out-).15 F 1.23
-(put for each v)144 184.8 R 1.23(alid, non-e)-.25 F 1.23
-(xcluded beam where the outer)-.15 F F1 -.2(ex)3.73 G(cludeper).2 E
-(cent)-.37 E F0 1.23(percentage of beams are)3.73 F -.15(ex)144 196.8 S
-3.485(cluded. The).15 F(def)3.485 E .984(ault is to output a single rec\
-ord for each ping in which longitude and latitude)-.1 F -.25(va)144
-208.8 S 1.067(lues re\215ect the sonar na).25 F(vig)-.2 E 1.067
-(ation, the depth, topograph)-.05 F 2.367 -.65(y, a)-.05 H 1.067
-(nd amplitude v).65 F 1.067(alues re\215ect the v)-.25 F(alid)-.25 E
-(beam nearest to v)144 220.8 Q(ertical, and the sidescan v)-.15 E
-(alue re\215ects the pix)-.25 E(el nearest to v)-.15 E(ertical.)-.15 E
-F2<ad4e>108 237.6 Q F1(start_pixel/end_pixel)23.08 E F0(or)2.5 E F1(A)
-2.5 E F0 .372(Determines the range of sidescan pix)144 249.6 R .371
-(els for which records will be output.)-.15 F(If)5.371 E F1
-(start_pixel/end_pixel)2.871 E F0 .258
-(is speci\214ed, then records will be output only for pix)144 261.6 R
-.258(els in this range. Pix)-.15 F .259(el numbers start with zero)-.15
-F .689(on the port side. The def)144 273.6 R .689
-(ault is to not output records associated with sidescan pix)-.1 F .688
-(els. Instead, the)-.15 F(def)144 285.6 Q .426(ault is to output a sing\
-le record for each ping in which longitude and latitude v)-.1 F .426
-(alues re\215ect the)-.25 F .027(sonar na)144 297.6 R(vig)-.2 E .027
-(ation, the depth, topograph)-.05 F 1.327 -.65(y, a)-.05 H .027
-(nd amplitude v).65 F .026(alues re\215ect the v)-.25 F .026
-(alid beam nearest to v)-.25 F(er)-.15 E(-)-.2 E .027
-(tical, and the sidescan v)144 309.6 R .028(alue re\215ects the pix)-.25
-F .028(el nearest to v)-.15 F .028(ertical. If)-.15 F F2<ad4e>2.528 E F1
-(A)A F0 .028(is gi)2.528 F -.15(ve)-.25 G .028(n, then a record will).15
-F(be output for all sidescan pix)144 321.6 Q(els.)-.15 E F2<ad4f>108
-338.4 Q F1(output_format)22.52 E F0 .389
-(Determines the form of the output.)144 350.4 R F1(Output_format)2.888 E
-F0 .388(is a string composed of one or more of the fol-)2.888 F(lo)144
-362.4 Q(wing characters:)-.25 E F2(/)144 379.2 Q F0 1.969
-(special character: this causes the v)4.469 F 1.969
-(alue indicated by the ne)-.25 F 1.97(xt character to be)-.15 F(in)6.97
-E -.15(ve)-.4 G 1.97(rted. This).15 F .014
-(applies only to simple numeric v)144 391.2 R .014
-(alues such as depth and heading and not to v)-.25 F .014(alues lik)-.25
-F 2.514(et)-.1 G .014(ime strings)-2.514 F
-(or positions with hemisphere characters.)144 403.2 Q F2<ad>144 420 Q F0
-.928(special character: this causes the v)3.428 F .929
-(alue indicated by the ne)-.25 F .929
-(xt character to be multiplied by \2551.)-.15 F .537
-(This applies only to simple numeric v)144 432 R .537
-(alues such as depth and heading and not to v)-.25 F .537(alues lik)-.25
-F 3.037(et)-.1 G(ime)-3.037 E
-(strings or positions with hemisphere characters.)144 444 Q F2(=)144
-460.8 Q F0 .804(special character: this causes the v)3.304 F .804
-(alue indicated by the ne)-.25 F .805(xt character to deri)-.15 F 1.105
--.15(ve f)-.25 H .805(rom the port-).15 F .439
-(most non-null beam or pix)144 472.8 R .439
-(el. This applies only to numeric v)-.15 F .438
-(alues associated with beams or pix)-.25 F(els)-.15 E
-(such as depth, longitude, or latitude.)144 484.8 Q F2(+)144 501.6 Q F0
-.921(special character: this causes the v)3.421 F .921
-(alue indicated by the ne)-.25 F .921(xt character to deri)-.15 F 1.222
--.15(ve f)-.25 H .922(rom the star).15 F(-)-.2 E .48
-(board-most non-null beam or pix)144 513.6 R .48
-(el. This applies only to numeric v)-.15 F .48
-(alues associated with beams or)-.25 F(pix)144 525.6 Q
-(els such as depth, longitude, or latitude.)-.15 E F2(A)144 542.4 Q F0
-1.755(for apparent sea\215oor crosstrack slope \(de)4.255 F 1.755
-(grees from horizontal with positi)-.15 F 2.055 -.15(ve s)-.25 H 1.755
-(lopes dipping).15 F(to)144 554.4 Q -.1(wa)-.25 G
-(rd port.\) Calculated by \214tting a line to the the bath).1 E
-(ymetry data of each ping.)-.05 E F2(a)144 571.2 Q F0 1.94
-(for apparent sea\215oor crosstrack slope \(de)4.44 F 1.94
-(grees from horizontal with positi)-.15 F 2.24 -.15(ve s)-.25 H 1.94
-(lopes dipping).15 F(to)144 583.2 Q -.1(wa)-.25 G
-(rd port.\) Calculated by interpolation for each beam or pix).1 E(el.)
--.15 E F2(B)144 600 Q F0(for amplitude)2.5 E F2(b)144 616.8 Q F0
-(for sidescan)2.5 E F2(C)144 633.6 Q F0(for sonar altitude abo)2.5 E .3
--.15(ve t)-.15 H(he bottom \(m\)).15 E F2(c)144 650.4 Q F0
-(for sonar tranducer depth \(m\))2.5 E F2(D)144 667.2 Q F0(for bath)2.5
-E(ymetry acrosstrack distance \(m\))-.05 E F2(d)144 684 Q F0
-(for sidescan acrosstrack distance \(m\))2.5 E F2(E)144 700.8 Q F0
-(for bath)2.5 E(ymetry alongtrack distance \(m\))-.05 E F2(e)144 717.6 Q
-F0(for sidescan alongtrack distance \(m\))2.5 E(MB-System 5.0)72 768 Q
-(17 May 2014)143.995 E(3)202.335 E 0 Cg EP
-%%Page: 4 4
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 163.16(mblist\(1\) MB-System)72 48 R 163.16
-(5.0 mblist\(1\))2.5 F/F1 10/Times-Bold at 0 SF(F)144 84 Q F0
-(for beam\215ag numeric v)2.5 E
-(alue \(1=null, 0=good, 5=manual, 9=\214lter)-.25 E 2.5(,1)-.4 G
-(29=sonar\).)-2.5 E F1(f)144 100.8 Q F0(for beam\215ag character v)2.5 E
-(alue \('-'=null, 'G'=good, 'M'=manual, 'F'=\214lter)-.25 E 2.5(,')-.4 G
-(S'=sonar\).)-2.5 E F1(G)144 117.6 Q F0
-(for \215at bottom grazing angle \(de)2.5 E(grees\))-.15 E F1(g)144
-134.4 Q F0(for grazing angle using sea\215oor slope \(de)2.5 E(grees\))
--.15 E F1(H)144 151.2 Q F0(for heading \(de)2.5 E(grees\))-.15 E F1(h)
-144 168 Q F0(for course made good \(de)2.5 E(grees\))-.15 E F1(J)144
-184.8 Q F0(for a time string \(yyyy jd hh mm ss.ssssss\) where jd is th\
-e day of the year)2.5 E F1(j)144 201.6 Q F0 .666(for a time string \(yy\
-yy jd dm ss.ssssss\) where jd is the day of the year and dm is the minu\
-te of)3.165 F(the day)144 213.6 Q F1(L)144 230.4 Q F0(for cumulati)2.5 E
-.3 -.15(ve a)-.25 H(long-track distance \(km\)).15 E F1(l)144 247.2 Q F0
-(for cumulati)2.5 E .3 -.15(ve a)-.25 H(long-track distance \(m\)).15 E
-F1(M)144 264 Q F0
-(for unix \(epoch\) time in decimal seconds since 1/1/70 00:00:00)2.5 E
-F1(m)144 280.8 Q F0(for time in decimal seconds since \214rst record)2.5
-E F1(N)144 297.6 Q F0(for ping count)2.5 E F1(P)144 314.4 Q F0
-(for pitch in de)5 E(grees)-.15 E F1(p)144 331.2 Q F0
-(for draft in meters)5 E F1(Q)144 348 Q F0
-(for bottom detection type as letter \(A=amplitude, P=phase, U=unkno)5 E
-(wn\))-.25 E F1(q)144 364.8 Q F0
-(for bottom detection type as number \(1=amplitude, 2=phase, 0=unkno)5 E
-(wn\))-.25 E F1(R)144 381.6 Q F0(for roll in de)5 E(grees)-.15 E F1(r)
-144 398.4 Q F0(for hea)5 E .3 -.15(ve i)-.2 H 2.5(nm).15 G(eters)-2.5 E
-F1(S)144 415.2 Q F0(for speed \(km/hr\))5 E F1(s)144 432 Q F0
-(for speed made good \(km/hr\))5 E F1(T)144 448.8 Q F0
-(for a time string \(yyyy/mm/dd/hh/mm/ss\))5 E F1(t)144 465.6 Q F0
-(for a time string \(yyyy mm dd hh mm ss\))5 E F1(U)144 482.4 Q F0
-(for unix time in inte)5 E(ger seconds since 1/1/70 00:00:00)-.15 E F1
-(u)144 499.2 Q F0(for time in inte)5 E(ger seconds since \214rst record)
--.15 E F1(V)144 516 Q F0(for ping interv)5 E(al \(decimal seconds\))-.25
-E F1(X)144 532.8 Q F0(for longitude \(decimal de)5 E(grees\))-.15 E F1
-(x)144 549.6 Q F0(for longitude \(de)5 E
-(grees + decimal minutes + E/W\))-.15 E F1(Y)144 566.4 Q F0
-(for latitude \(decimal de)5 E(grees\))-.15 E F1(y)144 583.2 Q F0
-(for latitude \(de)5 E(grees + decimal minutes + N/S\))-.15 E F1(Z)144
-600 Q F0(for topograph)5 E 2.5(y\()-.05 G(positi)-2.5 E .3 -.15(ve u)
--.25 H(pw).15 E(ards\) \(m\))-.1 E F1(z)144 616.8 Q F0
-(for depth \(positi)5 E .3 -.15(ve d)-.25 H -.25(ow).15 G(nw).25 E
-(ards\) \(m\))-.1 E F1(#)144 633.6 Q F0(for beam or pix)5 E(el number)
--.15 E F1(.)146.5 650.4 Q F0 .544(special character: this causes the ne)
-5.544 F .544(xt character to be interpretted from the follo)-.15 F .544
-(wing list rather)-.25 F .328(than the abo)144 662.4 R .628 -.15(ve l)
--.15 H 2.828(ist. These).15 F(allo)2.828 E 2.828(wa)-.25 G .328
-(ccess to ra)-2.828 F 2.828(wv)-.15 G .329
-(alues in format speci\214c form and may not be sup-)-3.078 F
-(ported by all formats.)144 674.4 Q F1(.A)146.5 691.2 Q F0(Amplitude \(\
-backscatter\) in dB \(formats 56 & 67 \255 Simrad multibeam only\))5 E
-F1(.a)146.5 708 Q F0 .949(Mean absorption coef)5.949 F .948
-(\214cient in dB/km \(formats 56 & 67 \255 Simrad multibeam some v)-.25
-F(ersions)-.15 E(only\))144 720 Q(MB-System 5.0)72 768 Q(17 May 2014)
-143.995 E(4)202.335 E 0 Cg EP
-%%Page: 5 5
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 163.16(mblist\(1\) MB-System)72 48 R 163.16
-(5.0 mblist\(1\))2.5 F/F1 10/Times-Bold at 0 SF(.B)146.5 84 Q F0(Normal in\
-cidence backscatter in dB \(formats 56 & 67 \255 Simrad multibeam only\
-\))5 E F1(.b)146.5 100.8 Q F0(Oblique backscatter in dB \(formats 56 & \
-67 \255 Simrad multibeam only\))5 E F1(.c)146.5 117.6 Q F0
-(Mean backscatter)5 E 2.5(,o)-.4 G(ne v)-2.5 E
-(alue per ping \(formats 56 & 67 \255 Simrad multibeam only\))-.25 E F1
-(.d)146.5 134.4 Q F0
-(Beam depression angle \(formats 56 & 67 \255 Simrad multibeam only\))5
-E F1(.F)146.5 151.2 Q F0(Filename)5 E F1(.f)146.5 168 Q F0(File format)5
-E F1(.G)146.5 184.8 Q F0(Start of TV)5 E 2.5(Gr)-.15 G
-(amp in samples \(formats 56 & 67 \255 Simrad multibeam only\))-2.5 E F1
-(.g)146.5 201.6 Q F0(Stop of TV)5 E 2.5(Gr)-.15 G
-(amp in samples \(formats 56 & 67 \255 Simrad multibeam only\))-2.5 E F1
-(.L)146.5 218.4 Q F0 -.35(Tr)5 G(ansmit pulse length \(usec\) \(formats\
- 56 & 67 \255 Simrad multibeam only\)).35 E F1(.l)146.5 235.2 Q F0 -.35
-(Tr)5 G(ansmit pulse length \(sec\)).35 E F1(.M)146.5 252 Q F0
-(Sounder mode \(formats 56 & 67 \255 Simrad multibeam only\))5 E F1(.N)
-146.5 268.8 Q F0(Ping number according to sounder \(formats 56 & 67 \
-\255 Simrad multibeam only\))5 E F1(.p)146.5 285.6 Q F0(Ra)5.367 E 2.867
-(ws)-.15 G .367(idescan pix)-2.867 F .368
-(els in dB \(formats 56 & 67 \255 Simrad multibeam only\).)-.15 F .368
-(May be preceded by)5.368 F 3.008(an)144 297.6 S .508(umber to gi)-3.008
-F .808 -.15(ve t)-.25 H .508(he \214rst n pix).15 F .508
-(els \(NaN padded\) of the beam, for e)-.15 F(xample)-.15 E F1(.30p)
-3.008 E F0 .508(will gi)3.008 F .807 -.15(ve t)-.25 H .507(he \214rst)
-.15 F(30 sidescan pix)144 309.6 Q(els of each beam.)-.15 E F1(.R)146.5
-326.4 Q F0
-(Range in samples \(formats 56 & 67 \255 Simrad multibeam only\))5 E F1
-(.r)146.5 343.2 Q F0
-(Sampling rate in Hz \(formats 56 & 67 \255 Simrad multibeam only\))5 E
-F1(.S)146.5 360 Q F0(Number of ra)5 E 2.5(ws)-.15 G(idescan pix)-2.5 E
-(els per ping \(formats 56 & 67 \255 Simrad multibeam only\))-.15 E F1
-(.s)146.5 376.8 Q F0(Number of ra)5 E 2.5(ws)-.15 G(idescan pix)-2.5 E
-(els per beam \(formats 56 & 67 \255 Simrad multibeam only\))-.15 E F1
-(.T)146.5 393.6 Q F0 -.35(Tr)5 G(ansmit g).35 E(ain \(dB\))-.05 E F1(.t)
-146.5 410.4 Q F0(Recei)5 E .3 -.15(ve g)-.25 H(ain \(dB\)).1 E(Def)144
-434.4 Q(ault)-.1 E/F2 10/Times-Italic at 0 SF(output_format)2.5 E F0(=)2.5
-E F1(YXLZ)2.5 E F0(\(latitude, longitude, cumulati)2.5 E .3 -.15(ve a)
--.25 H(long-track distance, and depth\).).15 E F1<ad50>108 451.2 Q F2
-(pings)24.19 E F0 1.219(Sets the ping a)144 463.2 R -.15(ve)-.2 G 1.219
-(raging of the input data. If).15 F F2(pings)3.719 E F0 3.72(=1)3.719 G
-3.72(,t)-3.72 G 1.22(hen no ping a)-3.72 F -.15(ve)-.2 G 1.22
-(raging is performed. If).15 F F2(pings)144 475.2 Q F0 2.652(>0)2.652 G
-2.652(,t)-2.652 G .152(hen that number of input pings will be a)-2.652 F
--.15(ve)-.2 G .151(raged to produce one output ping.).15 F(If)5.151 E F2
-(pings)2.651 E F0(=)2.651 E .313(0, then the ping a)144 487.2 R -.15(ve)
--.2 G .313(raging will automatically be done so that the along-track pi\
-ng spacing is equal).15 F(to the across-track beam spacing.)144 499.2 Q
-(Def)5 E(ault:)-.1 E F2(pings)2.5 E F0 2.5(=1\()2.5 G(no ping a)-2.5 E
--.15(ve)-.2 G(raging\).).15 E F1<ad51>108 516 Q F0 .335(Disables v)22.52
-F .335(alue checking for v)-.25 F .335(alidity \(only positi)-.25 F .635
--.15(ve b)-.25 H(ath).15 E(ymetry)-.05 E 2.835(,a)-.65 G .335
-(mplitude, and sidescan v)-2.835 F .335(alues are)-.25 F -.25(va)144 528
-S 4.011(lid\). This).25 F(allo)4.011 E 1.511
-(ws dumps of all of the data, including null or \215agged beams and pix)
--.25 F 4.012(els. The)-.15 F .304(\215agged v)144 540 R .304
-(alues are output without change. Null v)-.25 F .303
-(alues are output as zero. This option is equi)-.25 F -.25(va)-.25 G
-(lent).25 E(to)144 552 Q F1<ad55>2.5 E F2(2)A F0(.)A F1<ad52>108 568.8 Q
-F2(west/east/south/north)23.08 E F0 .505
-(Sets the longitude and latitude bounds within which sw)144 580.8 R .505
-(ath data will be read. Only the data which)-.1 F
-(lies within these bounds will be read.)144 592.8 Q(Def)5 E(ault:)-.1 E
-F2(west)2.5 E F0(=\255360, east)A F2(=360)A F0(,)A F2(south)2.5 E F0
-(=\25590,)A F2(north)2.5 E F0(=90.)A F1<ad53>108 609.6 Q F2(speed)24.74
-E F0 .532(Sets the minimum speed in km/hr \(5.5 kts ~ 10 km/hr\) allo)
-144 621.6 R .531(wed in the input data; pings associated)-.25 F
-(with a smaller ship speed will not be copied. Def)144 633.6 Q(ault:)-.1
-E F2(speed)2.5 E F0 2.5(=0)2.5 G(.)-2.5 E F1<ad54>108 650.4 Q F2(time)
-23.63 E(gap)-.4 E F0 .478(Sets the maximum time g)144 662.4 R .479
-(ap in minutes between adjacent pings allo)-.05 F .479
-(wed before the data is consid-)-.25 F(ered to ha)144 674.4 Q .3 -.15
-(ve a g)-.2 H(ap. Def).1 E(ault:)-.1 E F2(time)2.5 E(gap)-.4 E F0 2.5
-(=1)2.5 G(.)-2.5 E F1<ad55>108 691.2 Q F2 -.15(ch)23.08 G(ec).15 E(k)-.2
-E F0 1.352(Sets the manner in which)144 703.2 R F1(mblist)3.852 E F0
-1.351(handles \215agged and null bath)3.852 F(ymetry)-.05 E 3.851(,a)
--.65 G 1.351(mplitude, and sidescan)-3.851 F -.25(va)144 715.2 S .342
-(lues. By def).25 F(ault,)-.1 E F1(mblist)2.842 E F0 .342
-(omits lines of output if the)2.842 F 2.843(yc)-.15 G .343
-(ontain \215agged or null v)-2.843 F .343(alues. This def)-.25 F(ault)
--.1 E 1.253(corresponds to)144 727.2 R F2 -.15(ch)3.753 G(ec).15 E(k)-.2
-E F0 3.753(=0)3.753 G 6.253(.I)-3.753 G(f)-6.253 E F2 -.15(ch)3.753 G
-(ec).15 E(k)-.2 E F0 3.753(=1)3.753 G 3.753(,t)-3.753 G 1.253
-(hen \215agged v)-3.753 F 1.253(alues will be output unchanged and null)
--.25 F(MB-System 5.0)72 768 Q(17 May 2014)143.995 E(5)202.335 E 0 Cg EP
-%%Page: 6 6
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 163.16(mblist\(1\) MB-System)72 48 R 163.16
-(5.0 mblist\(1\))2.5 F -.25(va)144 84 S .253(lues will be ignored.).25 F
-(If)5.253 E/F1 10/Times-Italic at 0 SF -.15(ch)2.753 G(ec).15 E(k)-.2 E F0
-2.753(=2)2.753 G 2.753(,t)-2.753 G .253(hen \215agged v)-2.753 F .253
-(alues will be output unchanged and null v)-.25 F(alues)-.25 E .465
-(will be output as zero \(This corresponds to the)144 96 R/F2 10
-/Times-Bold at 0 SF<ad51>2.965 E F0 2.965(option\). If)2.965 F F1 -.15(ch)
-2.965 G(ec).15 E(k)-.2 E F0 2.965(=3)2.965 G 2.965(,t)-2.965 G .465
-(hen \215agged v)-2.965 F .465(alues will)-.25 F .869
-(be output unchanged and null v)144 108 R .869
-(alues will be output as "NaN".)-.25 F(If)5.87 E F1 -.15(ch)3.37 G(ec)
-.15 E(k)-.2 E F0 3.37(=4)3.37 G 3.37(,t)-3.37 G .87(hen \215agged v)
--3.37 F(alues)-.25 E(and null v)144 120 Q
-(alues will be output as "NaN".)-.25 E F2<ad56>108 136.8 Q F0(Normally)
-23.08 E(,)-.65 E F2(mblist)2.818 E F0 -.1(wo)2.818 G .317
-(rks "silently" without outputting an).1 F .317
-(ything to the stderr stream.)-.15 F .317(If the)5.317 F F2<ad56>2.817 E
-F0(\215ag)2.817 E .56(is gi)144 148.8 R -.15(ve)-.25 G .56(n, then).15 F
-F2(mblist)3.06 E F0 -.1(wo)3.06 G .56(rks in a "v).1 F .56
-(erbose" mode and outputs the program v)-.15 F .56
-(ersion being used and)-.15 F(all error status messages.)144 160.8 Q F2
-<ad57>108 177.6 Q F0(Normally)20.3 E(,)-.65 E F2(mblist)3.389 E F0 .889
-(outputs bath)3.389 F .889
-(ymetry and across and along track distances in meters.)-.05 F .888
-(If the)5.888 F F2<ad57>3.388 E F0(\215ag is gi)144 189.6 Q -.15(ve)-.25
-G(n, then).15 E F2(mblist)2.5 E F0(outputs these v)2.5 E(alues in feet.)
--.25 E F2<ad58>108 206.4 Q F1(out\214le)23.08 E F0(Normally)144 218.4 Q
-(,)-.65 E F2(mblist)3.2 E F0 .7(outputs to stdout.)3.2 F .7(If the)5.7 F
-F2<ad58>3.2 E F0 .7(\215ag is gi)3.2 F -.15(ve)-.25 G .7(n, then).15 F
-F2(mblist)3.2 E F0 .7(creates a ne)3.2 F 3.2<778c>-.25 G(le)-3.2 E F1
-(out\214le)3.2 E F0(and outputs to it.)144 230.4 Q
-(An output \214le must be speci\214ed if a netCDF \214le \()5 E F2
-<ad4320ad41>A F0 2.5(\)i)C 2.5(sr)-2.5 G(equired.)-2.5 E F2<ad5a>108
-247.2 Q F1(se)23.63 E(gment)-.4 E F0 .678
-(Causes the ascii output of dif)144 259.2 R .678(ferent input sw)-.25 F
-.677(ath \214les \(e.g. when a datalist is speci\214ed with the)-.1 F F2
-<ad49>3.177 E F0 .372(option\) to be separated by lines with)144 271.2 R
-F1(se)2.873 E(gment)-.4 E F0 2.873(.I)C(f)-2.873 E F1(se)2.873 E(gment)
--.4 E F0 .373(is a single character)2.873 F 2.873(,t)-.4 G .373
-(hen the output is a)-2.873 F 1.252(multiple se)144 283.2 R 1.252
-(gment \214le of the sort accepted by the)-.15 F F2(GMT)3.751 E F0
-(program)3.751 E F2(psxy)3.751 E F0 6.251(.T)C 1.251(his option only w)
--6.251 F(orks)-.1 E .1(with ascii output, and is thus disabled when the)
-144 295.2 R F2<ad41>2.6 E F0 .1
-(option is speci\214ed. The most common usage is)2.6 F F2<ad5a>144 307.2
-Q F0(I>)A F2(.)A/F3 10.95/Times-Bold at 0 SF(EXAMPLES)72 336 Q F0 1.268
-(Suppose one wishes to obtain a centerbeam pro\214le from a ra)108 348 R
-3.768(wH)-.15 G 1.267(ydrosweep \214le \(format 21\) in a re)-3.768 F
-(gion)-.15 E(between 105W and 103W longitude and between 10S and 8S lat\
-itude. The follo)108 360 Q(wing will suf)-.25 E(\214ce:)-.25 E
-(mblist \255Iin\214le.mb21 \255F21 \255R-105/-103/-10/-8 \255OLz)144 384
-Q(The output will be as follo)108 408 Q(ws:)-.25 E 2.5(0.000 4378)144
-432 R 2.5(0.085 4370)144 444 R 2.5(0.166 4370)144 456 R 2.5(0.247 4351)
-144 468 R 2.5(0.330 4353)144 480 R 2.5(0.407 4337)144 492 R 2.5
-(0.492 4334)144 504 R 2.5(0.571 4323)144 516 R 2.5(0.651 4316)144 528 R
-2.5(0.737 4307)144 540 R(.....)144 552 Q .816(Here the depth v)108 576 R
-.817(alues will correspond to the beam in each ping which is located cl\
-osest to v)-.25 F .817(ertical under)-.15 F(the ship.)108 588 Q .487(Su\
-ppose one wishes instead to obtain time, heading and speed data in the \
-same \214le from 8AM to 9AM on)108 612 R(August 10 1991. The follo)108
-624 Q(wing is appropriate:)-.25 E
-(mblist \255Iin\214le.mb21 \255F21 \255B1991/8/10/8/0/0)144 648 Q
-(-E1991/8/10/9/0/0 \255O)144 660 Q(THS)-.4 E
-(The output will be as follo)108 684 Q(ws:)-.25 E 10
-(1991/08/10/08/00/05 283.9)144 708 R(41.29)7.5 E 10
-(1991/08/10/08/00/19 283.4)144 720 R(20.36)7.5 E(MB-System 5.0)72 768 Q
-(17 May 2014)143.995 E(6)202.335 E 0 Cg EP
-%%Page: 7 7
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 163.16(mblist\(1\) MB-System)72 48 R 163.16
-(5.0 mblist\(1\))2.5 F 10(1991/08/10/08/00/33 285.1)144 84 R(20.36)7.5 E
-10(1991/08/10/08/00/48 286.7)144 96 R(20.09)7.5 E 10
-(1991/08/10/08/01/02 284.9)144 108 R(20.08)7.5 E 10
-(1991/08/10/08/01/16 285.2)144 120 R(20.02)7.5 E 10
-(1991/08/10/08/01/44 284.2)144 132 R(20.20)7.5 E 10
-(1991/08/10/08/02/12 283.7)144 144 R(20.50)7.5 E 10
-(1991/08/10/08/02/41 283.6)144 156 R(20.75)7.5 E 10
-(1991/08/10/08/03/09 285.1)144 168 R(21.19)7.5 E(.....)144 180 Q .57
-(Suppose one wishes a data series with along-track distance, topograph)
-108 204 R 3.07(ya)-.05 G .57(nd across-track distance of beam)-3.07 F
-(number 15 for the same \214le and time limits as abo)108 216 Q -.15(ve)
--.15 G(:).15 E(mblist \255Iin\214le.mb21 \255F21 \255B1991/8/10/7/0/0)
-144 240 Q(-E1991/8/10/9/0/0 \255OLZD \255M15/15)144 252 Q
-(The output will be as follo)108 276 Q(ws:)-.25 E 2.5(0.000 4510)149 300
-R(\2551704)7.5 E 2.5(0.172 4494)149 312 R(\2551692)7.5 E 2.5(0.260 4486)
-149 324 R(\2551689)7.5 E 2.5(0.343 4471)149 336 R(\2551683)7.5 E 2.5
-(0.427 4491)149 348 R(\2551691)7.5 E 2.5(0.506 4490)149 360 R(\2551690)
-7.5 E 2.5(0.591 4478)149 372 R(\2551686)7.5 E 2.5(0.676 4505)149 384 R
-(\2551697)7.5 E 2.5(0.763 4488)149 396 R(\2551695)7.5 E 2.5(0.849 4495)
-149 408 R(\2551699)7.5 E(.....)149 420 Q .628(Supppose one wishes to ob\
-tain longitude, latitude, and depth at the centerbeam as x-y-z data for\
- the same)108 444 R(re)108 456 Q(gion as in the \214rst e)-.15 E
-(xample:)-.15 E
-(mblist \255Iin\214le.mb21 \255F21 \255R-105/-103/-10/-8 \255O)144 480 Q
-(XYz)-.4 E(The output will be as follo)108 504 Q(ws:)-.25 E 12.5
-(-103.000236 \2559.577439)144 528 R(4378)17.5 E 12.5
-(-103.000943 \2559.577229)144 540 R(4370)17.5 E 12.5
-(-103.001651 \2559.577020)144 552 R(4370)17.5 E 12.5
-(-103.002372 \2559.576794)144 564 R(4351)17.5 E 12.5
-(-103.003041 \2559.576584)144 576 R(4353)17.5 E 12.5
-(-103.003771 \2559.576338)144 588 R(4337)17.5 E 12.5
-(-103.004456 \2559.576105)144 600 R(4334)17.5 E 12.5
-(-103.005153 \2559.575895)144 612 R(4323)17.5 E 12.5
-(-103.005903 \2559.575679)144 624 R(4316)17.5 E 12.5
-(-103.006586 \2559.575449)144 636 R(4307)17.5 E(.....)144 648 Q .206(Su\
-ppose one wishes to obtain a dump of longitude, latitude, and depth for\
- all good beams in a Hydrosweep)108 672 R .558
-(data \214le. There are tw)108 684 R 3.057(ow)-.1 G .557
-(ays to obtain this output. One can e)-3.157 F .557
-(xplicitly specify the output format as)-.15 F/F1 10/Times-Bold at 0 SF
-<ad4f>3.057 E/F2 10/Times-Italic at 0 SF(XYz)A F0(and the output beams as)
-108 696 Q F1<ad4d>2.5 E F2(0/58)A F0(:)A
-(mblist \255Iin\214le.mb21 \255F21 \255O)144 720 Q(XYz \255M0/58)-.4 E
-(MB-System 5.0)72 768 Q(17 May 2014)143.995 E(7)202.335 E 0 Cg EP
-%%Page: 8 8
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 163.16(mblist\(1\) MB-System)72 48 R 163.16
-(5.0 mblist\(1\))2.5 F(or one can use the equi)108 84 Q -.25(va)-.25 G
-(lent).25 E/F1 10/Times-Bold at 0 SF<ad44>2.5 E/F2 10/Times-Italic at 0 SF(2)A
-F0(shortcut:)2.5 E(mblist \255Iin\214le.mb21 \255F21 \255D2)144 108 Q
-(Either w)108 132 Q(ay)-.1 E 2.5(,t)-.65 G(he output is as follo)-2.5 E
-(ws:)-.25 E 28.67(-49.296454 12.180552)144 156 R(4866)29.5 E 28.67
-(-49.296695 12.178668)144 168 R(4858)29.5 E 28.67(-49.296923 12.176893)
-144 180 R(4855)29.5 E 28.67(-49.297123 12.175341)144 192 R(4877)29.5 E
-28.67(-49.297319 12.173808)144 204 R(4895)29.5 E 28.67
-(-49.297536 12.172122)144 216 R(4879)29.5 E 28.67(-49.297744 12.170498)
-144 228 R(4865)29.5 E 28.67(-49.297909 12.169216)144 240 R(4904)29.5 E
-28.67(-49.298100 12.167727)144 252 R(4899)29.5 E 28.67
-(-49.298299 12.166175)144 264 R(4871)29.5 E 28.67(-49.298476 12.164803)
-144 276 R(4873)29.5 E 28.67(-49.298639 12.163530)144 288 R(4891)29.5 E
-(.....)144 300 Q 1.363(Suppose one wishes to obtain a dump of longitude\
-, latitude, and depth for all beams, v)108 324 R 1.363
-(alid or not, in a)-.25 F 1.047(Hydrosweep data \214le.)108 336 R 1.047
-(The approach is the same as the preceding e)6.047 F 1.046(xample, e)
--.15 F 1.046(xcept that the)-.15 F F1<ad51>3.546 E F0 1.046(option is)
-3.546 F .906(used to disable v)108 348 R .906
-(alidity checking of beam v)-.25 F .906(alues. One can e)-.25 F .907
-(xplicitly specify the output format as)-.15 F F1<ad4f>3.407 E F2(XYz)A
-F0(and the output beams as)108 360 Q F1<ad4d>2.5 E F2(0/58)A F0(:)A
-(mblist \255Iin\214le.mb21 \255F21 \255O)144 384 Q(XYz \255M0/58 \255Q)
--.4 E(or one can use the equi)108 408 Q -.25(va)-.25 G(lent).25 E F1
-<ad44>2.5 E F2(2)A F0(shortcut:)2.5 E
-(mblist \255Iin\214le.mb21 \255F21 \255D2 \255Q)144 432 Q .529(Either w)
-108 456 R(ay)-.1 E 3.029(,t)-.65 G .528
-(he output includes both zero beams \(no data\) and beams with ne)-3.029
-F -.05(ga)-.15 G(ti).05 E .828 -.15(ve d)-.25 H .528
-(epths \(\215agged as bad).15 F(data\):)108 468 Q 28.67
-(-49.301094 12.144409)144 492 R(0)37 E 28.67(-49.301094 12.144409)144
-504 R(0)37 E 28.67(-49.296454 12.180552)144 516 R(4866)29.5 E 28.67
-(-49.296695 12.178668)144 528 R(4858)29.5 E 28.67(-49.296923 12.176893)
-144 540 R(4855)29.5 E 28.67(-49.297123 12.175341)144 552 R(4877)29.5 E
-28.67(-49.297319 12.173808)144 564 R(4895)29.5 E 28.67
-(-49.297536 12.172122)144 576 R(4879)29.5 E 28.67(-49.297744 12.170498)
-144 588 R(4865)29.5 E 28.67(-49.297909 12.169216)144 600 R(4904)29.5 E
-28.67(-49.298100 12.167727)144 612 R(4899)29.5 E 28.67
-(-49.298100 12.167727)144 624 R(\2554144)27 E 28.67
-(-49.298299 12.166175)144 636 R(4871)29.5 E 28.67(-49.298476 12.164803)
-144 648 R(4873)29.5 E 28.67(-49.298639 12.163530)144 660 R(4891)29.5 E
-(.....)144 672 Q(Finally)108 696 Q 2.941(,s)-.65 G .442(uppose one wish\
-es to obtain a dump of longitude, latitude, and amplitude for all good \
-beams in a)-2.941 F .661(Hydrosweep data \214le. There are tw)108 708 R
-3.161(ow)-.1 G .661(ays to obtain this output. One can e)-3.261 F .66
-(xplicitly specify the output for)-.15 F(-)-.2 E(mat as)108 720 Q F1
-<ad4f>2.5 E F2(XYB)A F0(and the output beams as)2.5 E F1<ad4d>2.5 E F2
-(0/58)A F0(:)A(MB-System 5.0)72 768 Q(17 May 2014)143.995 E(8)202.335 E
-0 Cg EP
-%%Page: 9 9
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 163.16(mblist\(1\) MB-System)72 48 R 163.16
-(5.0 mblist\(1\))2.5 F(mblist \255Iin\214le.mb21 \255F21 \255O)144 84 Q
-(XYB \255M0/58)-.4 E(or one can use the equi)108 108 Q -.25(va)-.25 G
-(lent).25 E/F1 10/Times-Bold at 0 SF<ad44>2.5 E/F2 10/Times-Italic at 0 SF(4)A
-F0(shortcut:)2.5 E(mblist \255Iin\214le.mb21 \255F21 \255D4)144 132 Q
-(Either w)108 156 Q(ay)-.1 E 2.5(,t)-.65 G(he output is as follo)-2.5 E
-(ws:)-.25 E 28.67(-49.296454 12.180552)144 180 R(13)34.5 E 28.67
-(-49.296695 12.178668)144 192 R(17)34.5 E 28.67(-49.296923 12.176893)144
-204 R(16)34.5 E 28.67(-49.297123 12.175341)144 216 R(14)34.5 E 28.67
-(-49.297319 12.173808)144 228 R(17)34.5 E 28.67(-49.297536 12.172122)144
-240 R(9)37 E 28.67(-49.297744 12.170498)144 252 R(14)34.5 E 28.67
-(-49.297909 12.169216)144 264 R(15)34.5 E 28.67(-49.298100 12.167727)144
-276 R(12)34.5 E 28.67(-49.298299 12.166175)144 288 R(12)34.5 E 28.67
-(-49.298476 12.164803)144 300 R(28)34.5 E 28.67(-49.298639 12.163530)144
-312 R(14)34.5 E(.....)144 324 Q .169(Suppose one wishes to e)108 348 R
-.169(xamine the number of ra)-.15 F 2.669(ws)-.15 G .169(idescan pix)
--2.669 F .17(els in Simrad EM1002 data \214le and the \214rst)-.15 F 2.5
-(5p)108 360 S(ix)-2.5 E(els of each beam:)-.15 E
-(mblist \255i 0044_20000425_093808.mb57 \255MA \255ON#.S.s.5p)144 384 Q
-(The output will be as follo)108 408 Q(ws:)-.25 E -10 17.5(10 1)120.5
-432 T 10(1278 286)-17.5 F 5
-(\25531.5 \25532.0 \25532.0 \25532.5 \25533.0)15 F -10 17.5(11 1)120.5
-444 T 10(1278 133)-17.5 F 5
-(\25534.5 \25534.5 \25534.5 \25534.5 \25533.5)15 F -10 17.5(12 1)120.5
-456 T 10(1278 142)-17.5 F 5
-(\25540.0 \25540.0 \25540.0 \25540.0 \25540.0)15 F -10 17.5(13 1)120.5
-468 T 10(1278 139)-17.5 F 5
-(\25540.0 \25540.5 \25540.5 \25540.5 \25540.5)15 F -10 17.5(14 1)120.5
-480 T 10(1278 159)-17.5 F 5
-(\25539.5 \25538.5 \25538.5 \25539.0 \25538.5)15 F(...)120.5 492 Q 15
-(15)120.5 504 S 27.5(41)-15 G 10(1278 1)-27.5 F 2.5(\25527.00 NaN)20 F
-10(NaN NaN NaN)12.5 F(.....)120.5 516 Q/F3 10.95/Times-Bold at 0 SF
-(SEE ALSO)72 544.8 Q F1(mbsystem)108 556.8 Q F0(\(1\),)A F1(mbinf)2.5 E
-(o)-.25 E F0(\(1\))A F3 -.11(BU)72 585.6 S(GS).11 E F1(mblist)108 597.6
-Q F0(is not able to list all of the information a)2.5 E -.25(va)-.2 G
-(ilable in some sw).25 E(ath data formats.)-.1 E(MB-System 5.0)72 768 Q
-(17 May 2014)143.995 E(9)202.335 E 0 Cg EP
-%%Trailer
-end
-%%EOF
diff --git a/src/ps/mbm_arc2grd.ps b/src/ps/mbm_arc2grd.ps
deleted file mode 100644
index b069bc9..0000000
--- a/src/ps/mbm_arc2grd.ps
+++ /dev/null
@@ -1,300 +0,0 @@
-%!PS-Adobe-3.0
-%%Creator: groff version 1.19.2
-%%CreationDate: Wed Jul  1 12:29:28 2015
-%%DocumentNeededResources: font Times-Roman
-%%+ font Times-Bold
-%%+ font Times-Italic
-%%DocumentSuppliedResources: procset grops 1.19 2
-%%Pages: 2
-%%PageOrder: Ascend
-%%DocumentMedia: Default 612 792 0 () ()
-%%Orientation: Portrait
-%%EndComments
-%%BeginDefaults
-%%PageMedia: Default
-%%EndDefaults
-%%BeginProlog
-%%BeginResource: procset grops 1.19 2
-%!PS-Adobe-3.0 Resource-ProcSet
-/setpacking where{
-pop
-currentpacking
-true setpacking
-}if
-/grops 120 dict dup begin
-/SC 32 def
-/A/show load def
-/B{0 SC 3 -1 roll widthshow}bind def
-/C{0 exch ashow}bind def
-/D{0 exch 0 SC 5 2 roll awidthshow}bind def
-/E{0 rmoveto show}bind def
-/F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def
-/G{0 rmoveto 0 exch ashow}bind def
-/H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/I{0 exch rmoveto show}bind def
-/J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def
-/K{0 exch rmoveto 0 exch ashow}bind def
-/L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/M{rmoveto show}bind def
-/N{rmoveto 0 SC 3 -1 roll widthshow}bind def
-/O{rmoveto 0 exch ashow}bind def
-/P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/Q{moveto show}bind def
-/R{moveto 0 SC 3 -1 roll widthshow}bind def
-/S{moveto 0 exch ashow}bind def
-/T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/SF{
-findfont exch
-[exch dup 0 exch 0 exch neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/MF{
-findfont
-[5 2 roll
-0 3 1 roll
-neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/level0 0 def
-/RES 0 def
-/PL 0 def
-/LS 0 def
-/MANUAL{
-statusdict begin/manualfeed true store end
-}bind def
-/PLG{
-gsave newpath clippath pathbbox grestore
-exch pop add exch pop
-}bind def
-/BP{
-/level0 save def
-1 setlinecap
-1 setlinejoin
-72 RES div dup scale
-LS{
-90 rotate
-}{
-0 PL translate
-}ifelse
-1 -1 scale
-}bind def
-/EP{
-level0 restore
-showpage
-}def
-/DA{
-newpath arcn stroke
-}bind def
-/SN{
-transform
-.25 sub exch .25 sub exch
-round .25 add exch round .25 add exch
-itransform
-}bind def
-/DL{
-SN
-moveto
-SN
-lineto stroke
-}bind def
-/DC{
-newpath 0 360 arc closepath
-}bind def
-/TM matrix def
-/DE{
-TM currentmatrix pop
-translate scale newpath 0 0 .5 0 360 arc closepath
-TM setmatrix
-}bind def
-/RC/rcurveto load def
-/RL/rlineto load def
-/ST/stroke load def
-/MT/moveto load def
-/CL/closepath load def
-/Fr{
-setrgbcolor fill
-}bind def
-/setcmykcolor where{
-pop
-/Fk{
-setcmykcolor fill
-}bind def
-}if
-/Fg{
-setgray fill
-}bind def
-/FL/fill load def
-/LW/setlinewidth load def
-/Cr/setrgbcolor load def
-/setcmykcolor where{
-pop
-/Ck/setcmykcolor load def
-}if
-/Cg/setgray load def
-/RE{
-findfont
-dup maxlength 1 index/FontName known not{1 add}if dict begin
-{
-1 index/FID ne{def}{pop pop}ifelse
-}forall
-/Encoding exch def
-dup/FontName exch def
-currentdict end definefont pop
-}bind def
-/DEFS 0 def
-/EBEGIN{
-moveto
-DEFS begin
-}bind def
-/EEND/end load def
-/CNT 0 def
-/level1 0 def
-/PBEGIN{
-/level1 save def
-translate
-div 3 1 roll div exch scale
-neg exch neg exch translate
-0 setgray
-0 setlinecap
-1 setlinewidth
-0 setlinejoin
-10 setmiterlimit
-[]0 setdash
-/setstrokeadjust where{
-pop
-false setstrokeadjust
-}if
-/setoverprint where{
-pop
-false setoverprint
-}if
-newpath
-/CNT countdictstack def
-userdict begin
-/showpage{}def
-/setpagedevice{}def
-}bind def
-/PEND{
-countdictstack CNT sub{end}repeat
-level1 restore
-}bind def
-end def
-/setpacking where{
-pop
-setpacking
-}if
-%%EndResource
-%%EndProlog
-%%BeginSetup
-%%BeginFeature: *PageSize Default
-<< /PageSize [ 612 792 ] /ImagingBBox null >> setpagedevice
-%%EndFeature
-%%IncludeResource: font Times-Roman
-%%IncludeResource: font Times-Bold
-%%IncludeResource: font Times-Italic
-grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72
-def/PL 792 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron/Zcaron
-/scaron/zcaron/Ydieresis/trademark/quotesingle/Euro/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/space/exclam/quotedbl/numbersign/dollar/percent
-/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen
-/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon
-/semicolon/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O
-/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright/circumflex
-/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y
-/z/braceleft/bar/braceright/tilde/.notdef/quotesinglbase/guillemotleft
-/guillemotright/bullet/florin/fraction/perthousand/dagger/daggerdbl
-/endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut
-/dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash
-/quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen
-/brokenbar/section/dieresis/copyright/ordfeminine/guilsinglleft
-/logicalnot/minus/registered/macron/degree/plusminus/twosuperior
-/threesuperior/acute/mu/paragraph/periodcentered/cedilla/onesuperior
-/ordmasculine/guilsinglright/onequarter/onehalf/threequarters
-/questiondown/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE
-/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex
-/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis
-/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn
-/germandbls/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla
-/egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis
-/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide/oslash
-/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis]def
-/Times-Italic at 0 ENC0/Times-Italic RE/Times-Bold at 0 ENC0/Times-Bold RE
-/Times-Roman at 0 ENC0/Times-Roman RE
-%%EndSetup
-%%Page: 1 1
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 132.07(mbm_arc2grd\(1\) MB-System)72 48 R 132.07
-(5.0 mbm_arc2grd\(1\))2.5 F/F1 10.95/Times-Bold at 0 SF -.219(NA)72 84 S
-(ME).219 E/F2 10/Times-Bold at 0 SF(mbm_ar)108 96 Q(c2grd)-.18 E F0 3.145
-<ad4d>3.145 G .645(acro to con)-3.145 F -.15(ve)-.4 G .645(rt an ArcV)
-.15 F(ie)-.6 E 3.145(wA)-.25 G .645(SCII grid to a GMT)-3.145 F .645
-(grid \214le in the GMT NetCDF grid)5.645 F(format.)108 108 Q F1
-(VERSION)72 136.8 Q F0 -1.11(Ve)108 148.8 S(rsion 5.0)1.11 E F1
-(SYNOPSIS)72 177.6 Q F0(mbm_arc2grd)108 189.6 Q F2<ad49>2.5 E/F3 10
-/Times-Italic at 0 SF(ar)A(c\214le)-.37 E F2<ad4f>2.5 E F3(gr)A(d\214le)
--.37 E F0([)2.5 E F2<ad4820ad56>A F0(])A F1(DESCRIPTION)72 218.4 Q F2
-(mbm_ar)108 230.4 Q(c2grd)-.18 E F0 .381(is a macro to con)2.881 F -.15
-(ve)-.4 G .381(rt a ArcV).15 F(ie)-.6 E 2.881(wA)-.25 G .382
-(SCII grid to an GMT grid \214le in the GMT NetCDF grid)-2.881 F .966
-(format. This allo)108 242.4 R .965
-(ws users to import the grid into GMT)-.25 F 3.465(.T)-.74 G .965
-(he grid will ha)-3.465 F 1.265 -.15(ve t)-.2 H .965
-(he same grid interv).15 F .965(al in both)-.25 F 1.083
-(longitude and latitude.)108 254.4 R 1.084(The macro \214rst obtains th\
-e bounds, dimensions, and grid cell size of the grid by)6.083 F .665
-(parsing the six line header)108 266.4 R 5.665(.T)-.55 G .665(he macro \
-then reformats the gridded data as xyz data, writing it to a tempo-)
--5.665 F .545
-(rary \214le. This temporary \214le is processed using the GMT program)
-108 278.4 R F2(xyz2grd)3.045 E F0 3.045(,y)C .545
-(ielding a GMT GRD format)-3.045 F(grid \214le.)108 290.4 Q F1 -.548(AU)
-72 319.2 S(THORSHIP).548 E F0(Da)108 331.2 Q(vid W)-.2 E 2.5(.C)-.92 G
-(aress \(caress at mbari.or)-2.5 E(g\))-.18 E(Montere)113 343.2 Q 2.5(yB)
--.15 G(ay Aquarium Research Institute)-2.5 E
-(Dale N. Chayes \(dale at ldeo.columbia.edu\))108 355.2 Q
-(Lamont-Doherty Earth Observ)113 367.2 Q(atory)-.25 E F1(OPTIONS)72 396
-Q F2<ad48>108 408 Q F0 .162(This "help" \215ag cause the program to pri\
-nt out a description of its operation and then e)22.52 F .161
-(xit immedi-)-.15 F(ately)144 420 Q(.)-.65 E F2<ad49>108 436.8 Q F3(ar)
-26.41 E(c\214le)-.37 E F0(Sets the \214lename of the input ArcV)144
-448.8 Q(ie)-.6 E 2.5(wA)-.25 G(SCII grid.)-2.5 E F2<ad4f>108 465.6 Q F3
-(gr)22.52 E(dname)-.37 E F0(Sets the \214lename of the output GMT grid \
-\214le. This \214le will be in the GMT NetCDF GRD format.)144 477.6 Q F2
-<ad56>108 494.4 Q F0(The)23.08 E F2<ad56>2.5 E F0(option causes)2.5 E F2
-(mbm_ar)2.5 E(c2grd)-.18 E F0(to print out status messages.)2.5 E F1
-(EXAMPLES)72 523.2 Q F0 .1(Suppose that we ha)108 535.2 R .4 -.15(ve o)
--.2 H .1(btained an ascii ArcV).15 F(ie)-.6 E 2.6(wg)-.25 G .1
-(rid called k)-2.6 F(ohalab)-.1 E .1(.asc. T)-.4 F 2.6(ot)-.8 G .1
-(ranslate this \214le to a GMT grd)-2.6 F(\214le, the follo)108 547.2 Q
-(wing will suf)-.25 E(\214ce:)-.25 E(mbm_arc2grd \255I k)144 559.2 Q
-(ohalab)-.1 E(.asc \255O k)-.4 E(ohalab)-.1 E(.grd \255V)-.4 E
-(Running the e)108 571.2 Q(xample abo)-.15 E .3 -.15(ve p)-.15 H
-(roduced the follo).15 E(wing output:)-.25 E
-(Program mbm_arc2grd status:)144 583.2 Q(Input ArcV)180 595.2 Q(ie)-.6 E
-2.5(wA)-.25 G 2.5(SCII \214le:)-2.5 F -.1(ko)2.5 G(halab).1 E(.asc)-.4 E
-(Output GRD \214le:)180 607.2 Q -.1(ko)27.5 G(halab).1 E(.grd)-.4 E
-(Grid dimensions:)180 619.2 Q 2.5(1597 1431)5 F(Grid cell sizes:)180
-631.2 Q 2.5(0.0001914456033 0.0001914456033)5 F(Grid bounds:)180 643.2 Q
-2.5(\255155.72855 \255155.423002817133)15 F 2.5(20.1318 20.405567212719)
-10 F(Running xyz2grd...)144 667.2 Q(xyz2grd: nx = 1597)144 679.2 Q .3
--.15(ny = 1)5 H(431).15 E(MB-System 5.0)72 768 Q 2.5(3J)146.495 G
-(une 2013)-2.5 E(1)204.835 E 0 Cg EP
-%%Page: 2 2
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 132.07(mbm_arc2grd\(1\) MB-System)72 48 R 132.07
-(5.0 mbm_arc2grd\(1\))2.5 F/F1 10.95/Times-Bold at 0 SF(SEE ALSO)72 84 Q/F2
-10/Times-Bold at 0 SF(mbsystem)108 96 Q F0(\(1\),)A F2(mbm_grd2ar)2.5 E(c)
--.18 E F0(\(1\),)A F2(mbm_grid)2.5 E F0(\(1\))A F1 -.11(BU)72 124.8 S
-(GS).11 E F0(Perhaps.)108 136.8 Q(MB-System 5.0)72 768 Q 2.5(3J)146.495
-G(une 2013)-2.5 E(2)204.835 E 0 Cg EP
-%%Trailer
-end
-%%EOF
diff --git a/src/ps/mbm_bpr.ps b/src/ps/mbm_bpr.ps
deleted file mode 100644
index e195c7d..0000000
--- a/src/ps/mbm_bpr.ps
+++ /dev/null
@@ -1,486 +0,0 @@
-%!PS-Adobe-3.0
-%%Creator: groff version 1.19.2
-%%CreationDate: Wed Jul  1 12:29:28 2015
-%%DocumentNeededResources: font Times-Roman
-%%+ font Times-Bold
-%%+ font Times-Italic
-%%DocumentSuppliedResources: procset grops 1.19 2
-%%Pages: 4
-%%PageOrder: Ascend
-%%DocumentMedia: Default 612 792 0 () ()
-%%Orientation: Portrait
-%%EndComments
-%%BeginDefaults
-%%PageMedia: Default
-%%EndDefaults
-%%BeginProlog
-%%BeginResource: procset grops 1.19 2
-%!PS-Adobe-3.0 Resource-ProcSet
-/setpacking where{
-pop
-currentpacking
-true setpacking
-}if
-/grops 120 dict dup begin
-/SC 32 def
-/A/show load def
-/B{0 SC 3 -1 roll widthshow}bind def
-/C{0 exch ashow}bind def
-/D{0 exch 0 SC 5 2 roll awidthshow}bind def
-/E{0 rmoveto show}bind def
-/F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def
-/G{0 rmoveto 0 exch ashow}bind def
-/H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/I{0 exch rmoveto show}bind def
-/J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def
-/K{0 exch rmoveto 0 exch ashow}bind def
-/L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/M{rmoveto show}bind def
-/N{rmoveto 0 SC 3 -1 roll widthshow}bind def
-/O{rmoveto 0 exch ashow}bind def
-/P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/Q{moveto show}bind def
-/R{moveto 0 SC 3 -1 roll widthshow}bind def
-/S{moveto 0 exch ashow}bind def
-/T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/SF{
-findfont exch
-[exch dup 0 exch 0 exch neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/MF{
-findfont
-[5 2 roll
-0 3 1 roll
-neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/level0 0 def
-/RES 0 def
-/PL 0 def
-/LS 0 def
-/MANUAL{
-statusdict begin/manualfeed true store end
-}bind def
-/PLG{
-gsave newpath clippath pathbbox grestore
-exch pop add exch pop
-}bind def
-/BP{
-/level0 save def
-1 setlinecap
-1 setlinejoin
-72 RES div dup scale
-LS{
-90 rotate
-}{
-0 PL translate
-}ifelse
-1 -1 scale
-}bind def
-/EP{
-level0 restore
-showpage
-}def
-/DA{
-newpath arcn stroke
-}bind def
-/SN{
-transform
-.25 sub exch .25 sub exch
-round .25 add exch round .25 add exch
-itransform
-}bind def
-/DL{
-SN
-moveto
-SN
-lineto stroke
-}bind def
-/DC{
-newpath 0 360 arc closepath
-}bind def
-/TM matrix def
-/DE{
-TM currentmatrix pop
-translate scale newpath 0 0 .5 0 360 arc closepath
-TM setmatrix
-}bind def
-/RC/rcurveto load def
-/RL/rlineto load def
-/ST/stroke load def
-/MT/moveto load def
-/CL/closepath load def
-/Fr{
-setrgbcolor fill
-}bind def
-/setcmykcolor where{
-pop
-/Fk{
-setcmykcolor fill
-}bind def
-}if
-/Fg{
-setgray fill
-}bind def
-/FL/fill load def
-/LW/setlinewidth load def
-/Cr/setrgbcolor load def
-/setcmykcolor where{
-pop
-/Ck/setcmykcolor load def
-}if
-/Cg/setgray load def
-/RE{
-findfont
-dup maxlength 1 index/FontName known not{1 add}if dict begin
-{
-1 index/FID ne{def}{pop pop}ifelse
-}forall
-/Encoding exch def
-dup/FontName exch def
-currentdict end definefont pop
-}bind def
-/DEFS 0 def
-/EBEGIN{
-moveto
-DEFS begin
-}bind def
-/EEND/end load def
-/CNT 0 def
-/level1 0 def
-/PBEGIN{
-/level1 save def
-translate
-div 3 1 roll div exch scale
-neg exch neg exch translate
-0 setgray
-0 setlinecap
-1 setlinewidth
-0 setlinejoin
-10 setmiterlimit
-[]0 setdash
-/setstrokeadjust where{
-pop
-false setstrokeadjust
-}if
-/setoverprint where{
-pop
-false setoverprint
-}if
-newpath
-/CNT countdictstack def
-userdict begin
-/showpage{}def
-/setpagedevice{}def
-}bind def
-/PEND{
-countdictstack CNT sub{end}repeat
-level1 restore
-}bind def
-end def
-/setpacking where{
-pop
-setpacking
-}if
-%%EndResource
-%%EndProlog
-%%BeginSetup
-%%BeginFeature: *PageSize Default
-<< /PageSize [ 612 792 ] /ImagingBBox null >> setpagedevice
-%%EndFeature
-%%IncludeResource: font Times-Roman
-%%IncludeResource: font Times-Bold
-%%IncludeResource: font Times-Italic
-grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72
-def/PL 792 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron/Zcaron
-/scaron/zcaron/Ydieresis/trademark/quotesingle/Euro/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/space/exclam/quotedbl/numbersign/dollar/percent
-/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen
-/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon
-/semicolon/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O
-/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright/circumflex
-/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y
-/z/braceleft/bar/braceright/tilde/.notdef/quotesinglbase/guillemotleft
-/guillemotright/bullet/florin/fraction/perthousand/dagger/daggerdbl
-/endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut
-/dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash
-/quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen
-/brokenbar/section/dieresis/copyright/ordfeminine/guilsinglleft
-/logicalnot/minus/registered/macron/degree/plusminus/twosuperior
-/threesuperior/acute/mu/paragraph/periodcentered/cedilla/onesuperior
-/ordmasculine/guilsinglright/onequarter/onehalf/threequarters
-/questiondown/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE
-/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex
-/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis
-/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn
-/germandbls/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla
-/egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis
-/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide/oslash
-/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis]def
-/Times-Italic at 0 ENC0/Times-Italic RE/Times-Bold at 0 ENC0/Times-Bold RE
-/Times-Roman at 0 ENC0/Times-Roman RE
-%%EndSetup
-%%Page: 1 1
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 148.125(mbm_bpr\(1\) MB\255System)72 48 R
-148.125(5.0 mbm_bpr\(1\))2.5 F/F1 10.95/Times-Bold at 0 SF -.219(NA)72 84 S
-(ME).219 E/F2 10/Times-Bold at 0 SF(mbm_bpr)108 96 Q F0 3.069<ad4d>3.069 G
-.568(B\255System macro to process data from a Seabird SBE53 pressure se\
-nsor into a tidal model)-3.069 F(for use by mbprocess.)108 108 Q F1
-(VERSION)72 136.8 Q F0 -1.11(Ve)108 148.8 S(rsion 5.0)1.11 E F1
-(SYNOPSIS)72 177.6 Q F2(mbm_bpr \255I)108 189.6 Q/F3 10/Times-Italic at 0
-SF(bpr\214le)A F2<ad4f>2.5 E F3(tide\214le)A F0([)2.5 E F2<ad44>A F3(of)
-A(fset)-.18 E F2(R)2.5 E F3(lon/lat)A F2<ad5420ad4820ad56>2.5 E F3(])A
-F1(DESCRIPTION)72 218.4 Q F2(mbm_bpr)108 230.4 Q F0 .04(is a perl shell\
-script used to translate pressure data from a Seabird SBE53 pressure se\
-nsor used as)2.54 F 3.285(aB)108 242.4 S .784(ottom Pressure Recorder \
-\(BPR\) into tidal data that can be used to correct sw)-3.285 F .784
-(ath bath)-.1 F .784(ymetry data. The)-.05 F .628(user speci\214es an i\
-nput BPR data \214le in the *.tid format produced by Seabird softw)108
-254.4 R .629(are and the output path)-.1 F
-(for the resulting tide\214le.)108 266.4 Q(By def)108 290.4 Q
-(ault, the output tide\214le will be in the form of a te)-.1 E
-(xt \214le with tw)-.15 E 2.5(oc)-.1 G(olumns:)-2.5 E(time_d tide.)123
-302.4 Q 1.036(Here time_d are time v)108 314.4 R 1.035(alues in decimal\
- epoch seconds \(seconds since 1970 Jan 1 00:00:00\) and the tide)-.25 F
--.25(va)108 326.4 S .52(lues are in meters. In this case, the tide\214l\
-e is in format 1 as supported by).25 F F2(mbpr)3.02 E(ocess)-.18 E F0
-3.02(,s)C 3.02(ot)-3.02 G 3.02(om)-3.02 G(ak)-3.02 E 3.02(eu)-.1 G .52
-(se of)-3.02 F(this tide data to correct sw)108 338.4 Q(ath bath)-.1 E
-(ymetry)-.05 E 2.5(,u)-.65 G(se)-2.5 E F2(mbset)2.5 E F0(as follo)2.5 E
-(ws:)-.25 E(mbset \255Idatalist.mb\2551 \255PTIDEFILE:tide\214lename \
-\255PTIDEFORMA)123 350.4 Q -.5(T:)-1.11 G(1).5 E .573(where datalist.mb\
-\2551 is the datalist referring to the data \214les to be processed. Af\
-ter using)108 362.4 R F2(mbset)3.072 E F0 .572(to turn on)3.072 F
-(tide correction, run)108 374.4 Q F2(mbpr)2.5 E(ocess)-.18 E F0(:)A
-(mbprocess \255Idatalist.mb\2551)123 386.4 Q(If the)108 410.4 Q F2<ad54>
-2.5 E F0(option is speci\214ed, then the output \214le will ha)2.5 E .3
--.15(ve t)-.2 H(he form of:).15 E(year month day hour min sec tide)123
-422.4 Q .055
-(In this case, the tide\214le is in format 2 as supported by)108 434.4 R
-F2(mbpr)2.555 E(ocess)-.18 E F0 2.556(,s)C 2.556(ot)-2.556 G 2.556(om)
--2.556 G(ak)-2.556 E 2.556(eu)-.1 G .056
-(se of this tide data to correct)-2.556 F(sw)108 446.4 Q(ath bath)-.1 E
-(ymetry)-.05 E 2.5(,u)-.65 G(se)-2.5 E F2(mbset)2.5 E F0(as follo)2.5 E
-(ws:)-.25 E(mbset \255Idatalist.mb\2551 \255PTIDEFILE:tide\214lename \
-\255PTIDEFORMA)123 458.4 Q -.5(T:)-1.11 G(2).5 E .573(where datalist.mb\
-\2551 is the datalist referring to the data \214les to be processed. Af\
-ter using)108 470.4 R F2(mbset)3.072 E F0 .572(to turn on)3.072 F
-(tide correction, run)108 482.4 Q F2(mbpr)2.5 E(ocess)-.18 E F0(.)A .365
-(The macro)108 506.4 R F2(mbm_bpr)2.865 E F0 .366(calculates depth from\
- pressure and latitude using the empirical formula for sea)2.865 F -.1
-(wa)-.15 G(ter).1 E(in:)108 518.4 Q(N. P)128 530.4 Q 2.5(.F)-1.11 G
-(ofonof)-2.65 E 2.5(fa)-.25 G(nd R. C. Millard, Jr)-2.5 E
-(., Algorithms for computation of fundamental)-.55 E(properties of sea)
-128 542.4 Q -.1(wa)-.15 G(ter).1 E 2.5(,U)-.4 G(nesco T)-2.5 E(ech. P)
--.7 E(apers in Mar)-.15 E 2.5(.S)-.55 G(ci., No. 44 1983.)-2.5 E .126
-(and then calculates tidal data as the dif)108 554.4 R .126
-(ference between the observ)-.25 F .126(ed depth and a v)-.15 F .125
-(ertical reference depth. If)-.15 F 3.59(al)108 566.4 S 1.09
-(ocation is supplied using the)-3.59 F F2<ad52>3.59 E F0(option,)3.59 E
-F2(mbm_bpr)3.591 E F0 1.091
-(uses the latitude in the depth calculation and also)3.591 F -.15(ex)108
-578.4 S .448(tracts a tidal model corresponding the to BPR deplo).15 F
-.448(yment site and timespan using the program)-.1 F F2(mbotps)2.948 E
-F0(.)A .849(The v)108 590.4 R .849(ertical reference is then the a)-.15
-F -.15(ve)-.2 G .849(rage dif).15 F .85
-(ference between the tidal model and the observ)-.25 F .85(ed depths.)
--.15 F(If)5.85 E .387(the user does not supply a location using the)108
-602.4 R F2<ad52>2.887 E F0 .386
-(option, a location on the equator is assumed for the depth)2.887 F
-1.328(calculation and the v)108 614.4 R 1.328(ertical reference is the \
-mean depth of the middle half of the depth time series \(i.e.)-.15 F
-.282(depths from 1/4 to 3/4 of the total time span\).)108 626.4 R .281
-(The user can specify an additional of)5.281 F .281
-(fset to apply to the tide)-.25 F(data using the)108 638.4 Q F2<ad44>2.5
-E F3(of)A(fset)-.18 E F0(option.)2.5 E .495(If the)108 662.4 R F2<ad54>
-2.995 E F0 .495(option is not used, then)2.995 F F2(mbm_bpr)2.995 E F0
-.495(will also output a shellscript that will, if e)2.995 F -.15(xe)-.15
-G .496(cuted, generate a).15 F .566(GMT postscript plot of the tide dat\
-a output. If a location has been speci\214ed so that a tidal model w)108
-674.4 R .565(as also)-.1 F
-(generated, the model will be plotted with the tide data.)108 686.4 Q
-(MB\255System 5.0)72 768 Q 2.5(3J)144.185 G(une 2013)-2.5 E(1)204.835 E
-0 Cg EP
-%%Page: 2 2
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 148.125(mbm_bpr\(1\) MB\255System)72 48 R
-148.125(5.0 mbm_bpr\(1\))2.5 F/F1 10.95/Times-Bold at 0 SF -.548(AU)72 84 S
-(THORSHIP).548 E F0(Da)108 96 Q(vid W)-.2 E 2.5(.C)-.92 G
-(aress \(caress at mbari.or)-2.5 E(g\))-.18 E(Montere)113 108 Q 2.5(yB)-.15
-G(ay Aquarium Research Institute)-2.5 E
-(Dale N. Chayes \(dale at ldeo.columbia.edu\))108 120 Q
-(Lamont\255Doherty Earth Observ)113 132 Q(atory)-.25 E
-(Suzanne H. O'Hara \(sohara at ldeo.columbia.edu\))108 144 Q
-(Lamont\255Doherty Earth Observ)113 156 Q(atory)-.25 E F1(OPTIONS)72
-184.8 Q/F2 10/Times-Bold at 0 SF<ad44>108 196.8 Q/F3 10/Times-Italic at 0 SF
-(of)23.08 E(fset)-.18 E F0(An of)144 208.8 Q
-(fset to be added to the calculated tidal data, in meters. Def)-.25 E
-(ault:)-.1 E F3(of)2.5 E(fset)-.18 E F0(=0.)A F2<ad48>108 225.6 Q F0
-.162(This "help" \215ag cause the program to print out a description of\
- its operation and then e)22.52 F .162(xit immedi-)-.15 F(ately)144
-237.6 Q(.)-.65 E F2<ad49>108 254.4 Q F3(bpr\214le)26.41 E F0(Input pres\
-sure data from the SBE53 pressure sensor in the Sea\255Bird *.tid forma\
-t.)144 266.4 Q F2<ad4f>108 283.2 Q F3(tide\214le)22.52 E F0 1.334(Outpu\
-t tide data \214le path. The format of the tide data controlled by the \
-use \(or not\) of the)144 295.2 R F2<ad54>3.834 E F0(option.)144 307.2 Q
-F2<ad52>108 324 Q F3(longitude/latitude)23.08 E F0
-(Sets the location of the BPR deplo)144 336 Q(yment. Here)-.1 E F3
-(longitude)2.5 E F0(and)2.5 E F3(latitude)2.5 E F0(are in decimal de)2.5
-E(grees.)-.15 E F2<ad54>108 352.8 Q F0 .298(Changes the tide data forma\
-t output. The format of the tide data are normally in the form of a te)
-23.63 F(xt)-.15 E(\214le with tw)144 364.8 Q 2.5(oc)-.1 G(olumns:)-2.5 E
-(time_d tide)159 376.8 Q .588(where time_d are time v)144 388.8 R .588(\
-alues in decimal epoch seconds \(seconds since 1970 Jan 1 00:00:00\) an\
-d)-.25 F .02(the tide v)144 400.8 R .02(alues are in meters.)-.25 F .02
-(If the)5.02 F F2<ad54>2.52 E F0 .02
-(option is speci\214ed, then the output \214le will instead ha)2.52 F
-.32 -.15(ve t)-.2 H(he).15 E(form of:)144 412.8 Q
-(year month day hour min sec tide)159 424.8 Q F2<ad56>108 441.6 Q F0
-(Causes)23.08 E F2(mbm_bpr)2.5 E F0(to operate in "v)2.5 E
-(erbose" mode so that it outputs more information than usual.)-.15 E F1
-(Examples)72 470.4 Q F0 .934(Suppose one has deplo)108 482.4 R .934
-(yed an SBE53 at 110 de)-.1 F 3.434(g4)-.15 G .934(0.92220'W 26de)-3.434
-F 3.434(g2)-.15 G .933(7.18960'N at about 1200 m depth.)-3.434 F
-(The Sea\255Bird processing softw)108 494.4 Q
-(are outputs data in *.tid \214les with output something lik)-.1 E(e:)
--.1 E 7.5(10)120.5 506.4 S(3/14/2012 16:27:21 99999.9999)-7.5 E(20.2731)
-10 E 7.5(20)120.5 518.4 S(3/14/2012 16:28:21 99999.9999)-7.5 E(20.2696)
-10 E 7.5(30)120.5 530.4 S(3/14/2012 16:29:21 99999.9999)-7.5 E(20.2589)
-10 E 7.5(40)120.5 542.4 S(3/14/2012 16:30:21 99999.9999)-7.5 E(20.2537)
-10 E 7.5(50)120.5 554.4 S(3/14/2012 16:31:21 99999.9999)-7.5 E(20.2448)
-10 E 7.5(60)120.5 566.4 S(3/14/2012 16:32:21 99999.9999)-7.5 E(20.2322)
-10 E 7.5(70)120.5 578.4 S(3/14/2012 16:33:21 99999.9999)-7.5 E(20.2188)
-10 E 7.5(80)120.5 590.4 S(3/14/2012 16:34:21 99999.9999)-7.5 E(20.2656)
-10 E 7.5(90)120.5 602.4 S(3/14/2012 16:35:21 99999.9999)-7.5 E(20.3567)
-10 E 5(10 03/14/2012)118 614.4 R(16:36:21 99999.9999)2.5 E(20.4316)10 E
-5(11 03/14/2012)118 626.4 R(16:37:21 99999.9999)2.5 E(20.4929)10 E 5
-(12 03/14/2012)118 638.4 R(16:38:21 99999.9999)2.5 E(20.5661)10 E 5
-(13 03/14/2012)118 650.4 R(16:39:21 99999.9999)2.5 E(20.6242)10 E 5
-(14 03/14/2012)118 662.4 R(16:40:21 99999.9999)2.5 E(20.6891)10 E 5
-(15 03/14/2012)118 674.4 R(16:41:21 99999.9999)2.5 E(20.7590)10 E 5
-(16 03/14/2012)118 686.4 R(16:42:21 99999.9999)2.5 E(19.8901)10 E 5
-(17 03/14/2012)118 698.4 R(16:43:21 99999.9999)2.5 E(18.1037)10 E 5
-(18 03/14/2012)118 710.4 R(16:44:21 99999.9999)2.5 E(17.2487)10 E 5
-(19 03/14/2012)118 722.4 R(16:45:21 99999.9999)2.5 E(15.9275)10 E
-(MB\255System 5.0)72 768 Q 2.5(3J)144.185 G(une 2013)-2.5 E(2)204.835 E
-0 Cg EP
-%%Page: 3 3
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 148.125(mbm_bpr\(1\) MB\255System)72 48 R
-148.125(5.0 mbm_bpr\(1\))2.5 F 5(20 03/14/2012)118 84 R
-(16:46:21 99999.9999)2.5 E(14.7406)10 E 5(21 03/14/2012)118 96 R
-(16:47:21 99999.9999)2.5 E(13.7798)10 E 5(22 03/14/2012)118 108 R
-(16:48:21 99999.9999)2.5 E(13.0540)10 E 5(23 03/14/2012)118 120 R
-(16:49:21 99999.9999)2.5 E(12.3869)10 E 5(24 03/14/2012)118 132 R
-(16:50:21 99999.9999)2.5 E(11.8464)10 E 5(25 03/14/2012)118 144 R
-(16:51:21 99999.9999)2.5 E(11.1999)10 E 5(26 03/14/2012)118 156 R 5
-(16:52:21 528.8065)2.5 F(10.5061)10 E 5(27 03/14/2012)118 168 R 5
-(16:53:21 583.2633)2.5 F(9.9686)12.5 E 5(28 03/14/2012)118 180 R 5
-(16:54:21 637.7951)2.5 F(9.3547)12.5 E 5(29 03/14/2012)118 192 R 5
-(16:55:21 693.5947)2.5 F(8.8287)12.5 E 5(30 03/14/2012)118 204 R 5
-(16:56:21 748.5921)2.5 F(8.3998)12.5 E 5(31 03/14/2012)118 216 R 5
-(16:57:21 804.0302)2.5 F(8.0251)12.5 E 5(32 03/14/2012)118 228 R 5
-(16:58:21 859.5471)2.5 F(7.6560)12.5 E 5(33 03/14/2012)118 240 R 5
-(16:59:21 914.8043)2.5 F(7.3006)12.5 E 5(34 03/14/2012)118 252 R 5
-(17:00:21 969.7692)2.5 F(7.0322)12.5 E 5(35 03/14/2012)118 264 R 2.5
-(17:01:21 1023.0636)2.5 F(6.6673)12.5 E 5(36 03/14/2012)118 276 R 2.5
-(17:02:21 1077.7238)2.5 F(6.3327)12.5 E 5(37 03/14/2012)118 288 R 2.5
-(17:03:21 1132.0991)2.5 F(6.0528)12.5 E 5(38 03/14/2012)118 300 R 2.5
-(17:04:21 1186.9391)2.5 F(5.8203)12.5 E 5(39 03/14/2012)118 312 R 2.5
-(17:05:21 1241.4040)2.5 F(5.6089)12.5 E 5(40 03/14/2012)118 324 R 2.5
-(17:06:21 1295.6002)2.5 F(5.4167)12.5 E 5(41 03/14/2012)118 336 R 2.5
-(17:07:21 1350.1353)2.5 F(5.2188)12.5 E 5(42 03/14/2012)118 348 R 2.5
-(17:08:21 1404.8882)2.5 F(5.0195)12.5 E 5(43 03/14/2012)118 360 R 2.5
-(17:09:21 1460.2095)2.5 F(4.9215)12.5 E 5(44 03/14/2012)118 372 R 2.5
-(17:10:21 1514.6683)2.5 F(4.7630)12.5 E 5(45 03/14/2012)118 384 R 2.5
-(17:11:21 1568.9270)2.5 F(4.5651)12.5 E 5(46 03/14/2012)118 396 R 2.5
-(17:12:21 1623.3903)2.5 F(4.4452)12.5 E 5(47 03/14/2012)118 408 R 2.5
-(17:13:21 1678.6771)2.5 F(4.3075)12.5 E 5(48 03/14/2012)118 420 R 2.5
-(17:14:21 1733.7411)2.5 F(4.1910)12.5 E 5(49 03/14/2012)118 432 R 2.5
-(17:15:21 1789.1549)2.5 F(4.0284)12.5 E 5(50 03/14/2012)118 444 R 2.5
-(17:16:21 1844.5557)2.5 F(3.8760)12.5 E 5(51 03/14/2012)118 456 R 2.5
-(17:17:21 1869.8892)2.5 F(3.7976)12.5 E 5(52 03/14/2012)118 468 R 2.5
-(17:18:21 1869.8176)2.5 F(3.7534)12.5 E 5(53 03/14/2012)118 480 R 2.5
-(17:19:21 1869.8197)2.5 F(3.7088)12.5 E 5(54 03/14/2012)118 492 R 2.5
-(17:20:21 1869.8224)2.5 F(3.6828)12.5 E 5(55 03/14/2012)118 504 R 2.5
-(17:21:21 1869.8241)2.5 F(3.6682)12.5 E .015(where the third column is \
-the pressure in dbar and the fourth column is temperature in de)108 516
-R .016(grees C.)-.15 F .016(The pres-)5.016 F .377(sure increases and t\
-he temperature decreases as the sensor sinks to the sea\215oor follo)108
-528 R .377(wing deplo)-.25 F .376(yment of)-.1 F 2.876(fa)-.25 G
-(ship. Once the sensor is on the sea\215oor)108 540 Q 2.5(,p)-.4 G
-(ressure v)-2.5 E(ariations re\215ect the tides.)-.25 E 1.6 -.8(To e)108
-564 T(xtract a tidal model, use).65 E/F1 10/Times-Bold at 0 SF(mbm_bpr)2.5
-E F0(as follo)2.5 E(ws:)-.25 E
-(mbm_bpr \255I BPR.tid \255OBPR.tde \255R\255110.682037/27.453160 \255V)
-118 576 Q(The output to the shell looks lik)108 588 Q(e:)-.1 E 2.5
-(Program Status:)118 600 R(1771 pressure v)123 612 Q
-(alues read from BPR.tid)-.25 E -1.11(Ve)123 624 S
-(rtical reference to tidal model for position \255110.682037 27.453160)
-1.11 E -.35(Ti)123 636 S(de will be output as <time_d tide> v).35 E
-(alues)-.25 E 2.5(Ap)123 648 S(lot will be generated)-2.5 E(Ex)123 660 Q
-14.842(ecuting: mbotps \255A1 \255D1200 \255R\255110.682037/27.453160 \
-\255B2012/03/14/16/52/21)-.15 F
-(\255E2012/03/15/22/22/21 \255OBPR.tid_tidemodel.txt)108 672 Q
-(Results are really in BPR.tid_tidemodel.txt)123 684 Q(1690 pressure v)
-123 696 Q(alues output to BPR.tde)-.25 E -1.11(Ve)123 708 S
-(rtical reference: 1267.31678290355 m)1.11 E(Ex)123 720 Q 37.095(ecutin\
-g mbm_xyplot \255R1331743941.000000/1331850141.000000/\2550.5071/0.5071)
--.15 F(MB\255System 5.0)72 768 Q 2.5(3J)144.185 G(une 2013)-2.5 E(3)
-204.835 E 0 Cg EP
-%%Page: 4 4
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 148.125(mbm_bpr\(1\) MB\255System)72 48 R
-148.125(5.0 mbm_bpr\(1\))2.5 F 4.465(\255IW0/0/0:BPR.tde \255IW255/0/0:\
-BPR.tid_tidemodel.txt \255OBPR.tde_tideplot \255L"T)108 84 R 4.465
-(ide Data from BPR)-.35 F(<BPR.tde> \(black\) & T)108 96 Q
-(ide Model \(red\):Seconds:T)-.35 E(ide \(meters\)" \255V)-.35 E(Ex)123
-108 Q(ecuting <BPR.tde_tideplot.cmd> also in)-.15 E -.2(vo)-.4 G -.1(ke)
-.2 G 2.5(sg).1 G 2.5(vt)-2.5 G 2.5(ov)-2.5 G(ie)-2.5 E 2.5(wt)-.25 G
-(he plot on the screen.)-2.5 E
-(The output tidal data \214le BPR.tde has the form:)108 120 Q
-(1331745441.000000 \2550.0803109226781089)118 132 Q
-(1331745501.000000 \2550.129052283649798)118 144 Q
-(1331745561.000000 \2550.127622718432121)118 156 Q
-(1331745621.000000 \2550.125784706023751)118 168 Q
-(1331745681.000000 \2550.124627438960488)118 180 Q
-(1331745741.000000 \2550.123334022838208)118 192 Q
-(1331745801.000000 \2550.12285750111073)118 204 Q
-(1331745861.000000 \2550.121768308595847)118 216 Q 1.364(where the \214\
-rst column is time in seconds since January 1, 1970 \(epoch seconds, ak\
-a unix seconds, aka)108 228 R .088(time_d v)108 240 R .088(alues within)
--.25 F/F1 10/Times-Bold at 0 SF(MB\255System)2.589 E F0 .089(\), and the s\
-econd column is the tidal signal in meters. In this case the ref-)B 3.22
-(erence tidal model is pro)108 252 R 3.22(vided by)-.15 F F1(mbotps)5.72
-E F0 5.72(,a)C 3.22
-(nd the plot created by running the output shellscript)-5.72 F .234
-(BPR.tde_tideplot.cmd plots both the tidal data calculated by)108 264 R
-F1(mbm_bpr)2.734 E F0 .235(and the tidal model e)2.734 F .235
-(xtracted using)-.15 F F1(mbotps)108 276 Q F0(.)A/F2 10.95/Times-Bold at 0
-SF(SEE ALSO)72 304.8 Q F1(mbsystem)108 316.8 Q F0(\(1\),)A F1(mbpr)2.5 E
-(ocess)-.18 E F0(\(1\),)A F1(mbset)2.5 E F0(\(1\))A F2(REFERENCES)72
-345.6 Q F0 1.003(N. P)108 357.6 R 3.503(.F)-1.11 G(ofonof)-3.653 E 3.503
-(fa)-.25 G 1.003(nd R. C. Millard, Jr)-3.503 F 1.002
-(., Algorithms for computation of fundamental properties of sea)-.55 F
--.1(wa)-.15 G(ter).1 E(,)-.4 E(Unesco T)108 369.6 Q(ech. P)-.7 E
-(apers in Mar)-.15 E 2.5(.S)-.55 G(ci., No. 44 1983.)-2.5 E F2 -.11(BU)
-72 398.4 S(GS).11 E F0(Lobsters, really)108 410.4 Q(.)-.65 E
-(MB\255System 5.0)72 768 Q 2.5(3J)144.185 G(une 2013)-2.5 E(4)204.835 E
-0 Cg EP
-%%Trailer
-end
-%%EOF
diff --git a/src/ps/mbm_copy.ps b/src/ps/mbm_copy.ps
deleted file mode 100644
index 7964fe5..0000000
--- a/src/ps/mbm_copy.ps
+++ /dev/null
@@ -1,366 +0,0 @@
-%!PS-Adobe-3.0
-%%Creator: groff version 1.19.2
-%%CreationDate: Wed Jul  1 12:29:28 2015
-%%DocumentNeededResources: font Times-Roman
-%%+ font Times-Bold
-%%+ font Times-Italic
-%%DocumentSuppliedResources: procset grops 1.19 2
-%%Pages: 2
-%%PageOrder: Ascend
-%%DocumentMedia: Default 612 792 0 () ()
-%%Orientation: Portrait
-%%EndComments
-%%BeginDefaults
-%%PageMedia: Default
-%%EndDefaults
-%%BeginProlog
-%%BeginResource: procset grops 1.19 2
-%!PS-Adobe-3.0 Resource-ProcSet
-/setpacking where{
-pop
-currentpacking
-true setpacking
-}if
-/grops 120 dict dup begin
-/SC 32 def
-/A/show load def
-/B{0 SC 3 -1 roll widthshow}bind def
-/C{0 exch ashow}bind def
-/D{0 exch 0 SC 5 2 roll awidthshow}bind def
-/E{0 rmoveto show}bind def
-/F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def
-/G{0 rmoveto 0 exch ashow}bind def
-/H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/I{0 exch rmoveto show}bind def
-/J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def
-/K{0 exch rmoveto 0 exch ashow}bind def
-/L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/M{rmoveto show}bind def
-/N{rmoveto 0 SC 3 -1 roll widthshow}bind def
-/O{rmoveto 0 exch ashow}bind def
-/P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/Q{moveto show}bind def
-/R{moveto 0 SC 3 -1 roll widthshow}bind def
-/S{moveto 0 exch ashow}bind def
-/T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/SF{
-findfont exch
-[exch dup 0 exch 0 exch neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/MF{
-findfont
-[5 2 roll
-0 3 1 roll
-neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/level0 0 def
-/RES 0 def
-/PL 0 def
-/LS 0 def
-/MANUAL{
-statusdict begin/manualfeed true store end
-}bind def
-/PLG{
-gsave newpath clippath pathbbox grestore
-exch pop add exch pop
-}bind def
-/BP{
-/level0 save def
-1 setlinecap
-1 setlinejoin
-72 RES div dup scale
-LS{
-90 rotate
-}{
-0 PL translate
-}ifelse
-1 -1 scale
-}bind def
-/EP{
-level0 restore
-showpage
-}def
-/DA{
-newpath arcn stroke
-}bind def
-/SN{
-transform
-.25 sub exch .25 sub exch
-round .25 add exch round .25 add exch
-itransform
-}bind def
-/DL{
-SN
-moveto
-SN
-lineto stroke
-}bind def
-/DC{
-newpath 0 360 arc closepath
-}bind def
-/TM matrix def
-/DE{
-TM currentmatrix pop
-translate scale newpath 0 0 .5 0 360 arc closepath
-TM setmatrix
-}bind def
-/RC/rcurveto load def
-/RL/rlineto load def
-/ST/stroke load def
-/MT/moveto load def
-/CL/closepath load def
-/Fr{
-setrgbcolor fill
-}bind def
-/setcmykcolor where{
-pop
-/Fk{
-setcmykcolor fill
-}bind def
-}if
-/Fg{
-setgray fill
-}bind def
-/FL/fill load def
-/LW/setlinewidth load def
-/Cr/setrgbcolor load def
-/setcmykcolor where{
-pop
-/Ck/setcmykcolor load def
-}if
-/Cg/setgray load def
-/RE{
-findfont
-dup maxlength 1 index/FontName known not{1 add}if dict begin
-{
-1 index/FID ne{def}{pop pop}ifelse
-}forall
-/Encoding exch def
-dup/FontName exch def
-currentdict end definefont pop
-}bind def
-/DEFS 0 def
-/EBEGIN{
-moveto
-DEFS begin
-}bind def
-/EEND/end load def
-/CNT 0 def
-/level1 0 def
-/PBEGIN{
-/level1 save def
-translate
-div 3 1 roll div exch scale
-neg exch neg exch translate
-0 setgray
-0 setlinecap
-1 setlinewidth
-0 setlinejoin
-10 setmiterlimit
-[]0 setdash
-/setstrokeadjust where{
-pop
-false setstrokeadjust
-}if
-/setoverprint where{
-pop
-false setoverprint
-}if
-newpath
-/CNT countdictstack def
-userdict begin
-/showpage{}def
-/setpagedevice{}def
-}bind def
-/PEND{
-countdictstack CNT sub{end}repeat
-level1 restore
-}bind def
-end def
-/setpacking where{
-pop
-setpacking
-}if
-%%EndResource
-%%EndProlog
-%%BeginSetup
-%%BeginFeature: *PageSize Default
-<< /PageSize [ 612 792 ] /ImagingBBox null >> setpagedevice
-%%EndFeature
-%%IncludeResource: font Times-Roman
-%%IncludeResource: font Times-Bold
-%%IncludeResource: font Times-Italic
-grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72
-def/PL 792 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron/Zcaron
-/scaron/zcaron/Ydieresis/trademark/quotesingle/Euro/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/space/exclam/quotedbl/numbersign/dollar/percent
-/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen
-/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon
-/semicolon/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O
-/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright/circumflex
-/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y
-/z/braceleft/bar/braceright/tilde/.notdef/quotesinglbase/guillemotleft
-/guillemotright/bullet/florin/fraction/perthousand/dagger/daggerdbl
-/endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut
-/dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash
-/quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen
-/brokenbar/section/dieresis/copyright/ordfeminine/guilsinglleft
-/logicalnot/minus/registered/macron/degree/plusminus/twosuperior
-/threesuperior/acute/mu/paragraph/periodcentered/cedilla/onesuperior
-/ordmasculine/guilsinglright/onequarter/onehalf/threequarters
-/questiondown/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE
-/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex
-/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis
-/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn
-/germandbls/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla
-/egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis
-/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide/oslash
-/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis]def
-/Times-Italic at 0 ENC0/Times-Italic RE/Times-Bold at 0 ENC0/Times-Bold RE
-/Times-Roman at 0 ENC0/Times-Roman RE
-%%EndSetup
-%%Page: 1 1
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mbm_cop)72 48 Q 143.27(y\(1\) MB-System)-.1 F
-143.27(5.0 mbm_cop)2.5 F(y\(1\))-.1 E/F1 10.95/Times-Bold at 0 SF -.219(NA)
-72 84 S(ME).219 E/F2 10/Times-Bold at 0 SF(mbm_copy)108 96 Q F0 2.696<ad41>
-2.696 G .196(pply mbcop)-2.696 F 2.696(yt)-.1 G 2.696(oa)-2.696 G .196(\
-ll \214les referenced through a datalist, using the MB-System \214le su\
-f)-2.696 F .195(\214x con-)-.25 F -.15(ve)108 108 S
-(ntion to name the output \214les).15 E F1(VERSION)72 136.8 Q F0 -1.11
-(Ve)108 148.8 S(rsion 5.0)1.11 E F1(SYNOPSIS)72 177.6 Q F2
-(mbm_copy \255F)108 189.6 Q/F3 10/Times-Italic at 0 SF(outputformat)A F2
-<ad49>2.5 E F3(datalist)A F0([)2.5 E F2<ad4820ad4320ad5420ad56>A F0(])A
-F1(DESCRIPTION)72 218.4 Q F2(mbm_copy)108 230.4 Q F0 1.34
-(is a macro used to cop)3.84 F 3.84(yl)-.1 G(ar)-3.84 E 1.34
-(ge numbers of sw)-.18 F 1.34
-(ath data \214les from one data format to another)-.1 F .515
-(using the program)108 242.4 R F2(mbcopy)3.015 E F0 5.515(.T)C .515
-(he input is a datalist \214le referencing all of the tar)-5.515 F .515
-(get sw)-.18 F .515(ath \214les. The output)-.1 F(sw)108 254.4 Q .386
-(ath \214le format is speci\214ed with the)-.1 F F2<ad46>2.887 E F0 .387
-(option. If the output sw)2.887 F .387
-(ath \214le format is not speci\214ed, the output)-.1 F
-(format will be the same as the input format.)108 266.4 Q .846
-(The macro identi\214es a \214lename root for each input sw)108 290.4 R
-.846(ath \214le. F)-.1 F .846(or \214les with recognized \214lename suf)
--.15 F<8c78>-.25 E(es)-.15 E .194(\(e.g. ".mb61" for a format 61 \214le\
-\), the \214lename root is the part of the \214lename that comes before\
- the suf)108 302.4 R(\214x.)-.25 E -.15(Fo)108 314.4 S 3.083<728c>.15 G
-.582(les without a recognized suf)-3.083 F .582
-(\214x, the \214lename root is the entire \214lename.)-.25 F .582
-(So, for a format 57 data \214le)5.582 F .724(called "0007_20020425_060\
-531.mb57", the \214lename root is "0007_20020425_060531". F)108 326.4 R
-.724(or a format 121)-.15 F
-(\214le named "009_1659", the \214lename root "009_1659".)108 338.4 Q
-1.274(The output \214lenames are automatically constructed by adding th\
-e standard MB-System \214le suf)108 362.4 R 1.274(\214x to the)-.25 F
-.214(\214lename root. This suf)108 374.4 R .215
-(\214x is ".mbXXX" where XXX is the tw)-.25 F 2.715(oo)-.1 G 2.715(rt)
--2.715 G .215(hree digit format id number)-2.715 F 2.715(.I)-.55 G 2.715
-(nt)-2.715 G .215(he e)-2.715 F -.15(ve)-.25 G(nt).15 E .292
-(that the output \214lename is the same as the input \214lename \(lik)
-108 386.4 R .291(ely only if the)-.1 F F2<ad46>2.791 E F0 .291
-(option is not used to set the)2.791 F
-(output format\), a "c" will be placed at the be)108 398.4 Q
-(ginning of the output \214le suf)-.15 E(\214x, making it "c.mbXXX".)
--.25 E(The)108 422.4 Q F2<ad54>4.406 E F0 1.907
-(option causes this macro to print out the)4.406 F F2(mbcopy)4.407 E F0
-1.907(commands it will e)4.407 F -.15(xe)-.15 G 1.907
-(cute without actually).15 F -.15(exe)108 434.4 S .546
-(cuting them. This test option allo).15 F .545
-(ws users to check the consequences of their command before actually)
--.25 F(running it.)108 446.4 Q F1 -.548(AU)72 475.2 S(THORSHIP).548 E F0
-(Da)108 487.2 Q(vid W)-.2 E 2.5(.C)-.92 G(aress \(caress at mbari.or)-2.5 E
-(g\))-.18 E(Montere)113 499.2 Q 2.5(yB)-.15 G
-(ay Aquarium Research Institute)-2.5 E
-(Dale N. Chayes \(dale at ldeo.columbia.edu\))108 511.2 Q
-(Lamont-Doherty Earth Observ)113 523.2 Q(atory)-.25 E F1
-(SIMPLE DESCRIPTION OF B)72 552 Q(ASIC OPTIONS)-.329 E F2<ad48>108 564 Q
-F0 .162(This "help" \215ag cause the program to print out a description\
- of its operation and then e)22.52 F .162(xit immedi-)-.15 F(ately)144
-576 Q(.)-.65 E F2<ad43>108 592.8 Q F0 1.013(This option causes the prog\
-ram to check if each output \214le already e)144 604.8 R 1.013
-(xists, and to for)-.15 F 1.013(go cop)-.18 F(ying)-.1 E
-(those that do e)144 616.8 Q(xist.)-.15 E F2<ad46>108 633.6 Q F3
-(outputformat)24.19 E F0 .008(This option sets the output sw)144 645.6 R
-.008(ath format. All of the sw)-.1 F .009
-(ath data \214les referenced in the datalist speci-)-.1 F .826
-(\214ed with the)144 657.6 R F2<ad49>3.326 E F0 .826
-(option will be copied to format)3.326 F F3(outputformat)3.326 E F0
-(using)3.326 E F2(mbcopy)3.326 E F0 3.326(.I)C 3.326(ft)-3.326 G(he)
--3.326 E F2<ad46>3.326 E F0 .825(option is)3.325 F(not gi)144 669.6 Q
--.15(ve)-.25 G
-(n, then the input \214les will be copied to their input formats.).15 E
-F2<ad49>108 686.4 Q F3(datalist)26.41 E F0 .417(Sets the input datalist\
- \214lename. A datalist is an ascii \214le containing a list of the inp\
-ut sw)144 698.4 R .417(ath sonar)-.1 F 1.005
-(data \214les to be copied and their formats.)144 710.4 R 1.005(In the)
-6.005 F F3(datalist)3.505 E F0 1.005(\214le, each sw)3.505 F 1.005
-(ath data \214le should be fol-)-.1 F(lo)144 722.4 Q
-(wed by a data format identi\214er)-.25 E 2.5(,e)-.4 G(.g.:)-2.5 E
-(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(1)204.835 E 0
-Cg EP
-%%Page: 2 2
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mbm_cop)72 48 Q 143.27(y\(1\) MB-System)-.1 F
-143.27(5.0 mbm_cop)2.5 F(y\(1\))-.1 E(data\214le1 11)180 84 Q
-(data\214le2 24)180 96 Q 1.498(As discussed in the)144 108 R/F1 10
-/Times-Bold at 0 SF(MB-System)3.998 E F0 1.499
-(manual page, datalists may reference other datalists, allo)3.998 F
-(wing)-.25 E .303(users to construct recursi)144 120 R .603 -.15(ve d)
--.25 H .303(atalist structures.).15 F .303(This program uses the)5.303 F
-F1(MBIO)2.803 E F0 .302(library and will read)2.803 F .65(or write an)
-144 132 R 3.15(ys)-.15 G -.1(wa)-3.15 G .65
-(th sonar format supported by).1 F F1(MBIO)3.151 E F0 3.151(.Al)C .651
-(ist of the sw)-3.151 F .651(ath sonar data formats cur)-.1 F(-)-.2 E
-(rently supported by)144 144 Q F1(MBIO)2.5 E F0
-(and their identi\214er v)2.5 E(alues is gi)-.25 E -.15(ve)-.25 G 2.5
-(ni).15 G 2.5(nt)-2.5 G(he)-2.5 E F1(MBIO)2.5 E F0(manual page.)2.5 E F1
-<ad54>108 160.8 Q F0 .134(This option causes)144 172.8 R F1(mbm_copy)
-2.634 E F0 .134(to print out the)2.634 F F1(mbcopy)2.634 E F0 .133
-(commands it will e)2.633 F -.15(xe)-.15 G .133(cute without actually)
-.15 F -.15(exe)144 184.8 S .453(cuting them. This test option allo).15 F
-.453(ws users to check the consequences of their command before)-.25 F
-(actually running it.)144 196.8 Q F1<ad56>108 213.6 Q F0(Causes)23.08 E
-F1(mbm_copy)2.5 E F0(to operate in "v)2.5 E
-(erbose" mode so that it outputs more information than usual.)-.15 E/F2
-10.95/Times-Bold at 0 SF(EXAMPLES)72 242.4 Q F0(Suppose one has three ra)
-108 254.4 Q 2.5(w\()-.15 G(format 56\) Simrad EM300 data \214les:)-2.5 E
-(0001_20020424_212920_ra)144 266.4 Q -.65(w.)-.15 G(all).65 E
-(0002_20020425_011607_ra)144 278.4 Q -.65(w.)-.15 G(all).65 E
-(0003_20020425_022926_ra)144 290.4 Q -.65(w.)-.15 G(all).65 E .236
-(One can generate a datalist called datalistr)108 302.4 R .236
-(.mb-1 referencing these three sw)-.55 F .236(ath \214les using a te)-.1
-F .235(xt editor or by)-.15 F(using)108 314.4 Q F1(awk)2.5 E F0(:)A
-(ls \2551 *all | a)144 326.4 Q(wk '{print $1" 56"}' > datalistr)-.15 E
-(.mb-1)-.55 E .47(In order to translate all three \214les in the proces\
-sing format for Simrad multibeam data \(format 57\), use the)108 338.4 R
-F1(mbm_copy)108 350.4 Q F0(macro:)2.5 E(mbm_cop)144 362.4 Q 2.5<79ad>-.1
-G 2.5(Id)-2.5 G(atalistr)-2.5 E(.mb-1 \255F 57 \255T \255V)-.55 E
-(The macro prints out the follo)108 374.4 Q
-(wing as it translates the sw)-.25 E(ath data:)-.1 E(Running: mbcop)144
-386.4 Q 2.5<79ad>-.1 G(F56/57)-2.5 E(-I0001_20020424_212920_ra)180 398.4
-Q -.65(w.)-.15 G(all).65 E(-O0001_20020424_212920.mb57)180 410.4 Q
-(Running: mbcop)144 422.4 Q 2.5<79ad>-.1 G(F56/57)-2.5 E
-(-I0002_20020425_011607_ra)180 434.4 Q -.65(w.)-.15 G(all).65 E
-(-O0002_20020425_011607.mb57)180 446.4 Q(Running: mbcop)144 458.4 Q 2.5
-<79ad>-.1 G(F56/57)-2.5 E(-I0003_20020425_022926_ra)180 470.4 Q -.65(w.)
--.15 G(all).65 E(-O0003_20020425_022926.mb57)180 482.4 Q F2(SEE ALSO)72
-511.2 Q F1(mbsystem)108 523.2 Q F0(\(1\),)A F1(mbcopy)2.5 E F0(\(1\),)A
-F1(mbdatalist)2.5 E F0(\(1\))A F2 -.11(BU)72 552 S(GS).11 E F0(Perhaps.)
-108 564 Q(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(2)
-204.835 E 0 Cg EP
-%%Trailer
-end
-%%EOF
diff --git a/src/ps/mbm_dslnavfix.ps b/src/ps/mbm_dslnavfix.ps
deleted file mode 100644
index a64277d..0000000
--- a/src/ps/mbm_dslnavfix.ps
+++ /dev/null
@@ -1,393 +0,0 @@
-%!PS-Adobe-3.0
-%%Creator: groff version 1.19.2
-%%CreationDate: Wed Jul  1 12:29:28 2015
-%%DocumentNeededResources: font Times-Roman
-%%+ font Times-Bold
-%%+ font Times-Italic
-%%DocumentSuppliedResources: procset grops 1.19 2
-%%Pages: 3
-%%PageOrder: Ascend
-%%DocumentMedia: Default 612 792 0 () ()
-%%Orientation: Portrait
-%%EndComments
-%%BeginDefaults
-%%PageMedia: Default
-%%EndDefaults
-%%BeginProlog
-%%BeginResource: procset grops 1.19 2
-%!PS-Adobe-3.0 Resource-ProcSet
-/setpacking where{
-pop
-currentpacking
-true setpacking
-}if
-/grops 120 dict dup begin
-/SC 32 def
-/A/show load def
-/B{0 SC 3 -1 roll widthshow}bind def
-/C{0 exch ashow}bind def
-/D{0 exch 0 SC 5 2 roll awidthshow}bind def
-/E{0 rmoveto show}bind def
-/F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def
-/G{0 rmoveto 0 exch ashow}bind def
-/H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/I{0 exch rmoveto show}bind def
-/J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def
-/K{0 exch rmoveto 0 exch ashow}bind def
-/L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/M{rmoveto show}bind def
-/N{rmoveto 0 SC 3 -1 roll widthshow}bind def
-/O{rmoveto 0 exch ashow}bind def
-/P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/Q{moveto show}bind def
-/R{moveto 0 SC 3 -1 roll widthshow}bind def
-/S{moveto 0 exch ashow}bind def
-/T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/SF{
-findfont exch
-[exch dup 0 exch 0 exch neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/MF{
-findfont
-[5 2 roll
-0 3 1 roll
-neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/level0 0 def
-/RES 0 def
-/PL 0 def
-/LS 0 def
-/MANUAL{
-statusdict begin/manualfeed true store end
-}bind def
-/PLG{
-gsave newpath clippath pathbbox grestore
-exch pop add exch pop
-}bind def
-/BP{
-/level0 save def
-1 setlinecap
-1 setlinejoin
-72 RES div dup scale
-LS{
-90 rotate
-}{
-0 PL translate
-}ifelse
-1 -1 scale
-}bind def
-/EP{
-level0 restore
-showpage
-}def
-/DA{
-newpath arcn stroke
-}bind def
-/SN{
-transform
-.25 sub exch .25 sub exch
-round .25 add exch round .25 add exch
-itransform
-}bind def
-/DL{
-SN
-moveto
-SN
-lineto stroke
-}bind def
-/DC{
-newpath 0 360 arc closepath
-}bind def
-/TM matrix def
-/DE{
-TM currentmatrix pop
-translate scale newpath 0 0 .5 0 360 arc closepath
-TM setmatrix
-}bind def
-/RC/rcurveto load def
-/RL/rlineto load def
-/ST/stroke load def
-/MT/moveto load def
-/CL/closepath load def
-/Fr{
-setrgbcolor fill
-}bind def
-/setcmykcolor where{
-pop
-/Fk{
-setcmykcolor fill
-}bind def
-}if
-/Fg{
-setgray fill
-}bind def
-/FL/fill load def
-/LW/setlinewidth load def
-/Cr/setrgbcolor load def
-/setcmykcolor where{
-pop
-/Ck/setcmykcolor load def
-}if
-/Cg/setgray load def
-/RE{
-findfont
-dup maxlength 1 index/FontName known not{1 add}if dict begin
-{
-1 index/FID ne{def}{pop pop}ifelse
-}forall
-/Encoding exch def
-dup/FontName exch def
-currentdict end definefont pop
-}bind def
-/DEFS 0 def
-/EBEGIN{
-moveto
-DEFS begin
-}bind def
-/EEND/end load def
-/CNT 0 def
-/level1 0 def
-/PBEGIN{
-/level1 save def
-translate
-div 3 1 roll div exch scale
-neg exch neg exch translate
-0 setgray
-0 setlinecap
-1 setlinewidth
-0 setlinejoin
-10 setmiterlimit
-[]0 setdash
-/setstrokeadjust where{
-pop
-false setstrokeadjust
-}if
-/setoverprint where{
-pop
-false setoverprint
-}if
-newpath
-/CNT countdictstack def
-userdict begin
-/showpage{}def
-/setpagedevice{}def
-}bind def
-/PEND{
-countdictstack CNT sub{end}repeat
-level1 restore
-}bind def
-end def
-/setpacking where{
-pop
-setpacking
-}if
-%%EndResource
-%%EndProlog
-%%BeginSetup
-%%BeginFeature: *PageSize Default
-<< /PageSize [ 612 792 ] /ImagingBBox null >> setpagedevice
-%%EndFeature
-%%IncludeResource: font Times-Roman
-%%IncludeResource: font Times-Bold
-%%IncludeResource: font Times-Italic
-grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72
-def/PL 792 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron/Zcaron
-/scaron/zcaron/Ydieresis/trademark/quotesingle/Euro/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/space/exclam/quotedbl/numbersign/dollar/percent
-/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen
-/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon
-/semicolon/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O
-/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright/circumflex
-/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y
-/z/braceleft/bar/braceright/tilde/.notdef/quotesinglbase/guillemotleft
-/guillemotright/bullet/florin/fraction/perthousand/dagger/daggerdbl
-/endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut
-/dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash
-/quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen
-/brokenbar/section/dieresis/copyright/ordfeminine/guilsinglleft
-/logicalnot/minus/registered/macron/degree/plusminus/twosuperior
-/threesuperior/acute/mu/paragraph/periodcentered/cedilla/onesuperior
-/ordmasculine/guilsinglright/onequarter/onehalf/threequarters
-/questiondown/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE
-/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex
-/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis
-/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn
-/germandbls/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla
-/egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis
-/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide/oslash
-/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis]def
-/Times-Italic at 0 ENC0/Times-Italic RE/Times-Bold at 0 ENC0/Times-Bold RE
-/Times-Roman at 0 ENC0/Times-Roman RE
-%%EndSetup
-%%Page: 1 1
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mbm_dslna)72 48 Q 126.14(v\214x\(1\) MB-System)
--.2 F 126.14(5.0 mbm_dslna)2.5 F(v\214x\(1\))-.2 E/F1 10.95/Times-Bold at 0
-SF -.219(NA)72 84 S(ME).219 E/F2 10/Times-Bold at 0 SF(mbm_dslna)108 96 Q
-(v\214x)-.25 E F0 2.95<ad54>2.95 G .449(ranslate WHOI DSL AMS-120 na)
--3.3 F(vig)-.2 E .449(ation from UTM eastings and northings to longi-)
--.05 F(tude and latitude.)108 108 Q F1(VERSION)72 136.8 Q F0 -1.11(Ve)
-108 148.8 S(rsion 5.0)1.11 E F1(SYNOPSIS)72 177.6 Q F2(mbm_dslna)108
-189.6 Q(v\214x \255F)-.25 E/F3 10/Times-Italic at 0 SF(navformat)A F2<ad49>
-2.5 E F3(in\214le)A F2<ad4a>2.5 E F3(utm_zone)A F2<ad4f>2.5 E F3
-(out\214le)A F0([)2.5 E F2<ad44>A F3(decimate)A F2<ad45>2.5 E F3
-(ellipsoid)A F2<ad4820ad56>2.5 E F0(])A F1(DESCRIPTION)72 218.4 Q F2
-(mbm_dslna)108 230.4 Q(v\214x)-.25 E F0 1.505
-(is a macro to translate WHOI DSL AMS-120 na)4.005 F(vig)-.2 E 1.505
-(ation from UTM eastings and nor)-.05 F(-)-.2 E .337
-(things to longitude and latitude.)108 242.4 R .337
-(The WHOI DSL group typically pro)5.337 F .337
-(vides processed AMS-120 na)-.15 F(vig)-.2 E(ation)-.05 E .408
-(is \214les separate from the bath)108 254.4 R .409
-(ymetry and sidescan data. Moreo)-.05 F -.15(ve)-.15 G 1.209 -.4(r, t)
-.15 H .409(he na).4 F(vig)-.2 E .409(ation is generally sampled less)
--.05 F .301(frequently than the sonar pings, and is reported in UTM eas\
-ting and northing meters.)108 266.4 R(The)5.3 E F2(mbm_dslna)2.8 E
-(v\214x)-.25 E F0 1.081(macro is used to translate the eastings and nor\
-things into the geographic coordinates \(longitude and lati-)108 278.4 R
-.476(tude\) used by MB-System programs. The program)108 290.4 R F2(mbpr)
-2.975 E(ocess)-.18 E F0 .475(can be used to mer)2.975 F .475
-(ge the translated na)-.18 F(vig)-.2 E(a-)-.05 E(tion in with the bath)
-108 302.4 Q(ymetry and sidescan.)-.05 E .313(The DSL AMS-120 bath)108
-326.4 R .313(ymetry and sidescan are pro)-.05 F .314
-(vided in either a set of parallel \214les supported as)-.15 F F2(MB-)
-2.814 E(System)108 338.4 Q F0 .432(format 111 \(the old scheme\) or in \
-the OIC single \214le format supported as)2.932 F F2(MB-System)2.931 E
-F0 .431(format 141)2.931 F .593(\(the ne)108 350.4 R 3.093(ws)-.25 G
-3.093(cheme\). In)-3.093 F .593
-(either case, we recommend translating the data to similar b)3.093 F
-.594(ut enhanced formats 112)-.2 F(and 142, respecti)108 362.4 Q -.15
-(ve)-.25 G(ly).15 E 2.5(,t)-.65 G 2.5(oe)-2.5 G(ase processing.)-2.5 E
-1.6 -.8(We r)108 386.4 T(ecommend the follo).8 E
-(wing procedure when processing WHOI DSL AMS-120 data with MB-System:)
--.25 E(1\) Concatenate all of the processed na)144 398.4 Q(vig)-.2 E
-(ation)-.05 E(\214les into a single \214le.)151.5 410.4 Q(cat *.na)180
-422.4 Q 2.5(v>c)-.2 G(ruise.rna)-2.5 E(v)-.2 E(2\) T)144 434.4 Q
-(ranslate the DSL UTM na)-.35 E(vig)-.2 E(ation into geographic)-.05 E
-(coordinates. In the "old" case the na)151.5 446.4 Q(vig)-.2 E(ation is)
--.05 E(in a format designated by)135.5 458.4 Q F2<ad46>2.5 E F3(1)A F0
-(and)2.5 E(in the ne)135.5 470.4 Q 2.5(wc)-.25 G(ase by)-2.5 E F2<ad46>
-2.5 E F3(2)A F0 2.5(.N)C(ote that)-2.5 E(you must kno)135.5 482.4 Q 2.5
-(wt)-.25 G(he UTM zone used \255 here we assume)-2.5 E(the zone is +27.)
-135.5 494.4 Q(mbm_dslna)180 506.4 Q(v\214x \255Icruise.rna)-.2 E 2.5
-(v\\)-.2 G(-Ocruise.mr)216 518.4 Q(g2 \255F1 \255J27 \255V)-.18 E
-(3\) Cop)144 530.4 Q 2.5(yt)-.1 G(he bath)-2.5 E
-(ymetry and sidescan data in each)-.05 E
-(\214le from format 111 to format 112 or from)151.5 542.4 Q
-(format 141 to 142.)135.5 554.4 Q(mbcop)180 566.4 Q 2.5<79ad>-.1 G
-(F111/112 \\)-2.5 E(-IDSL120.940630_1100.bat.dat \\)216 578.4 Q
-(-ODSL120.940630_1100.mb112)216 590.4 Q(4\) Set the translated na)144
-602.4 Q(vig)-.2 E(ation to be mer)-.05 E(ged with)-.18 E
-(each of the format 112 or 142 \214les using)135.5 614.4 Q F2(mbset)
-135.5 626.4 Q F0(:)A(mbset \255I DSL120.940630_1100.mb112 \\)180 638.4 Q
-(-P N)216 650.4 Q -1.35(AV)-.35 G(FORMA)1.35 E -.5(T:)-1.11 G 2.5(2\\).5
-G(-P N)216 662.4 Q -1.35(AV)-.35 G(FILE:cruise.mr)1.35 E(g2 \\)-.18 E
-(-V)216 674.4 Q(4\) Process the data using)144 686.4 Q F2(mbpr)2.5 E
-(ocess)-.18 E F0(,)A(producing a processed \214le called)135.5 698.4 Q
-(DSL120.940630_1100p.mb112 with longitude and)135.5 710.4 Q(latitude na)
-135.5 722.4 Q(vig)-.2 E(ation.)-.05 E(MB-System 5.0)72 768 Q 2.5(3J)
-146.495 G(une 2013)-2.5 E(1)204.835 E 0 Cg EP
-%%Page: 2 2
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mbm_dslna)72 48 Q 126.14(v\214x\(1\) MB-System)
--.2 F 126.14(5.0 mbm_dslna)2.5 F(v\214x\(1\))-.2 E
-(mbprocess \255I DSL120.940630_1100.mb112)180 84 Q/F1 10.95/Times-Bold at 0
-SF -.548(AU)72 112.8 S(THORSHIP).548 E F0(Da)108 124.8 Q(vid W)-.2 E 2.5
-(.C)-.92 G(aress \(caress at mbari.or)-2.5 E(g\))-.18 E(Montere)113 136.8 Q
-2.5(yB)-.15 G(ay Aquarium Research Institute)-2.5 E
-(Dale N. Chayes \(dale at ldeo.columbia.edu\))108 148.8 Q
-(Lamont-Doherty Earth Observ)113 160.8 Q(atory)-.25 E F1(OPTIONS)72
-189.6 Q/F2 10/Times-Bold at 0 SF<ad44>108 201.6 Q/F3 10/Times-Italic at 0 SF
-(decimate)23.08 E F0 .963(This option allo)144 213.6 R .962
-(ws the user to decimate the input na)-.25 F(vig)-.2 E 3.462(ation. The)
--.05 F F3(decimate)3.462 E F0 -.25(va)3.462 G .962(lue represents the)
-.25 F(decimation f)144 225.6 Q(actor)-.1 E 5(.T)-.55 G(he def)-5 E
-(ault is)-.1 E F3(decimate)2.5 E F0 2.5(=1)2.5 G 2.5(,o)-2.5 G 2.5(rn)
--2.5 G 2.5(od)-2.5 G(ecimation.)-2.5 E F2<ad45>108 242.4 Q F3(ellipsoid)
-23.63 E F0(This option sets the ellipsoid used in the UTM projection.)
-144 254.4 Q(The choices are:)5 E 33.95(WGS-84 1984)180 266.4 R -.8(Wo)
-2.5 G(rld Geodetic System).8 E 36.72(GRS-80 1980)180 278.4 R
-(International Geodetic Reference System)2.5 E 33.95(WGS-72 1972)180
-290.4 R -.8(Wo)2.5 G(rld Geodetic System).8 E 27.84(Australian 1965)180
-302.4 R(Used do)2.5 E(wn under)-.25 E(Kraso)180 314.4 Q(vsk)-.15 E 29.53
-(y1)-.15 G(940 Used in the So)-29.53 E(viet Union)-.15 E 18.4
-(International 1924)180 326.4 R -.8(Wo)2.5 G(rldwide use).8 E 12.85
-(Hayford-1909 1909)180 338.4 R(Same as the International 1924)2.5 E
-(Clark)180 350.4 Q 19.61(e-1880 1880)-.1 F(Most of Africa, France)2.5 E
-(Clark)180 362.4 Q 19.61(e-1866 1866)-.1 F
-(North America, the Phillipines)2.5 E 51.17(Airy 1830)180 374.4 R
-(Great Britain)2.5 E 43.39(Bessel 1841)180 386.4 R
-(Central Europe, Chile, Indonesia)2.5 E(Ev)180 398.4 Q 39.66(erest 1830)
--.15 F(India, Burma, P)2.5 E 2.5(akistan, etc.)-.15 F 41.73(Sphere 1980)
-180 410.4 R(The mean radius in GRS-80)2.5 E(Def)144 422.4 Q(ault: Clark)
--.1 E(e-1866 as per USGS standard.)-.1 E F2<ad46>108 439.2 Q F3
-(navformat)24.19 E F0 .254(Sets the input na)144 451.2 R(vig)-.2 E .254
-(ation format. The a)-.05 F -.25(va)-.2 G .254
-(ilable formats include the old, pre-OIC format \().25 F F2<ad46>A F3(1)
-A F0 .255(\), the)B(ne)144 463.2 Q 1.447 -.65(w, O)-.25 H .146
-(IC associated formats \().65 F F2<ad46>A F3(2)A F0 .146(\), and na)B
-(vig)-.2 E .146(ation obtained using)-.05 F F2(mblist)2.646 E F0 .146
-(with the)2.646 F F2(\255OtXY)2.646 E F0(option.)2.646 E F2<ad48>108 480
-Q F0 .162(This "help" \215ag cause the program to print out a descripti\
-on of its operation and then e)22.52 F .162(xit immedi-)-.15 F(ately)144
-492 Q(.)-.65 E F2<ad49>108 508.8 Q F3(\214lename)26.41 E F0
-(Sets the input WHOI DSL AMS-120 na)144 520.8 Q(vig)-.2 E
-(ation \214lename.)-.05 E F2<ad4a>108 537.6 Q F3(utm_zone)25.3 E F0 .53
-(Sets the UTM zone used for the translation. The UTM zones are 6 de)144
-549.6 R .529(grees wide in longitude and)-.15 F(be)144 561.6 Q .5
-(gin with zone 1 e)-.15 F .5(xtending from 180 W to 174 W)-.15 F 3.001
-(,z)-.92 G .501(one 2 e)-3.001 F .501(xtending from 174 W to 168 W)-.15
-F 3.001(,a)-.92 G(nd)-3.001 E(so on through zone 60. Ne)144 573.6 Q -.05
-(ga)-.15 G(ti).05 E .3 -.15(ve z)-.25 H(one v).15 E
-(alues are used for the Southern Hemisphere.)-.25 E F2<ad4f>108 590.4 Q
-F3(out\214le)22.52 E F0
-(Sets the output \214lename for the translated na)144 602.4 Q(vig)-.2 E
-(ation.)-.05 E F2<ad56>108 619.2 Q F0(Causes)23.08 E F2(mbm_plot)2.5 E
-F0(to operate in "v)2.5 E
-(erbose" mode so that it outputs more information than usual.)-.15 E F1
-(EXAMPLES)72 648 Q F0 .798(Suppose we ha)108 660 R 1.098 -.15(ve o)-.2 H
-.798(btained a WHOI DSL na).15 F(vig)-.2 E .798
-(ation \214le as outlined abo)-.05 F 1.097 -.15(ve a)-.15 H .797(nd e)
-.15 F -.15(xe)-.15 G .797(cute the macro as sug-).15 F(gested:)108 672 Q
-(mbm_dslna)180 684 Q(v\214x \255Icruise.rna)-.2 E 2.5(v\\)-.2 G
-(-Ocruise.mr)216 696 Q(g2 \255F1 \255J27 \255V)-.18 E
-(The output will appear as follo)108 708 Q(ws:)-.25 E(MB-System 5.0)72
-768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(2)204.835 E 0 Cg EP
-%%Page: 3 3
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mbm_dslna)72 48 Q 126.14(v\214x\(1\) MB-System)
--.2 F 126.14(5.0 mbm_dslna)2.5 F(v\214x\(1\))-.2 E(Running mbm_dslna)
-110.5 84 Q(v\214x...)-.2 E(Program Status:)110.5 108 Q
-(\255-------------)110.5 120 Q(Input DSL na)115.5 144 Q(vig)-.2 E
-(ation format:)-.05 E(1)7.5 E(Input DSL na)115.5 156 Q(vig)-.2 E
-(ation \214le:)-.05 E(dsl.na)12.5 E(v)-.2 E(Output na)115.5 168 Q(vig)
--.2 E(ation \214le:)-.05 E(dsl.mr)20 E(g2)-.18 E -.7(Te)115.5 180 S
-(mporary projected na).7 E 2.5<768c>-.2 G 2.5(le: tmp_proj_8044.na)-2.5
-F(v)-.2 E -.7(Te)115.5 192 S(mporary geographic na).7 E 2.5<768c>-.2 G
-(le: tmp_geo_8044.na)-2.5 E(v)-.2 E(\255-----------)115.5 216 Q 47.5
-(Projection: UTM)115.5 240 R(Zone 27)2.5 E(Projection units:)115.5 252 Q
-(meters)35 E(\255-----------)115.5 276 Q(586 na)110.5 300 Q(vig)-.2 E
-(ation records read...)-.05 E(Running mapproject...)110.5 324 Q
-(mapproject tmp_proj_8044.na)110.5 336 Q 2.5<76ad>-.2 G
-(Ju27/1:1000000 \255I \\)-2.5 E
-(-R-20:0/0:0/-19:0/1:0r > tmp_geo_8044.na)144 348 Q(v)-.2 E
-(Deleting tmp_proj_8044.na)110.5 372 Q 1.3 -.65(v, t)-.2 H
-(mp_geo_8044.na).65 E -.65(v.)-.2 G(..).65 E(Done...)110.5 396 Q/F1
-10.95/Times-Bold at 0 SF -.11(BU)72 424.8 S(GS).11 E F0(Let us kno)108
-436.8 Q -.65(w.)-.25 G(..).65 E(MB-System 5.0)72 768 Q 2.5(3J)146.495 G
-(une 2013)-2.5 E(3)204.835 E 0 Cg EP
-%%Trailer
-end
-%%EOF
diff --git a/src/ps/mbm_fmtvel.ps b/src/ps/mbm_fmtvel.ps
deleted file mode 100644
index 2a35c38..0000000
--- a/src/ps/mbm_fmtvel.ps
+++ /dev/null
@@ -1,271 +0,0 @@
-%!PS-Adobe-3.0
-%%Creator: groff version 1.19.2
-%%CreationDate: Wed Jul  1 12:29:28 2015
-%%DocumentNeededResources: font Times-Roman
-%%+ font Times-Bold
-%%+ font Times-Italic
-%%DocumentSuppliedResources: procset grops 1.19 2
-%%Pages: 1
-%%PageOrder: Ascend
-%%DocumentMedia: Default 612 792 0 () ()
-%%Orientation: Portrait
-%%EndComments
-%%BeginDefaults
-%%PageMedia: Default
-%%EndDefaults
-%%BeginProlog
-%%BeginResource: procset grops 1.19 2
-%!PS-Adobe-3.0 Resource-ProcSet
-/setpacking where{
-pop
-currentpacking
-true setpacking
-}if
-/grops 120 dict dup begin
-/SC 32 def
-/A/show load def
-/B{0 SC 3 -1 roll widthshow}bind def
-/C{0 exch ashow}bind def
-/D{0 exch 0 SC 5 2 roll awidthshow}bind def
-/E{0 rmoveto show}bind def
-/F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def
-/G{0 rmoveto 0 exch ashow}bind def
-/H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/I{0 exch rmoveto show}bind def
-/J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def
-/K{0 exch rmoveto 0 exch ashow}bind def
-/L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/M{rmoveto show}bind def
-/N{rmoveto 0 SC 3 -1 roll widthshow}bind def
-/O{rmoveto 0 exch ashow}bind def
-/P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/Q{moveto show}bind def
-/R{moveto 0 SC 3 -1 roll widthshow}bind def
-/S{moveto 0 exch ashow}bind def
-/T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/SF{
-findfont exch
-[exch dup 0 exch 0 exch neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/MF{
-findfont
-[5 2 roll
-0 3 1 roll
-neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/level0 0 def
-/RES 0 def
-/PL 0 def
-/LS 0 def
-/MANUAL{
-statusdict begin/manualfeed true store end
-}bind def
-/PLG{
-gsave newpath clippath pathbbox grestore
-exch pop add exch pop
-}bind def
-/BP{
-/level0 save def
-1 setlinecap
-1 setlinejoin
-72 RES div dup scale
-LS{
-90 rotate
-}{
-0 PL translate
-}ifelse
-1 -1 scale
-}bind def
-/EP{
-level0 restore
-showpage
-}def
-/DA{
-newpath arcn stroke
-}bind def
-/SN{
-transform
-.25 sub exch .25 sub exch
-round .25 add exch round .25 add exch
-itransform
-}bind def
-/DL{
-SN
-moveto
-SN
-lineto stroke
-}bind def
-/DC{
-newpath 0 360 arc closepath
-}bind def
-/TM matrix def
-/DE{
-TM currentmatrix pop
-translate scale newpath 0 0 .5 0 360 arc closepath
-TM setmatrix
-}bind def
-/RC/rcurveto load def
-/RL/rlineto load def
-/ST/stroke load def
-/MT/moveto load def
-/CL/closepath load def
-/Fr{
-setrgbcolor fill
-}bind def
-/setcmykcolor where{
-pop
-/Fk{
-setcmykcolor fill
-}bind def
-}if
-/Fg{
-setgray fill
-}bind def
-/FL/fill load def
-/LW/setlinewidth load def
-/Cr/setrgbcolor load def
-/setcmykcolor where{
-pop
-/Ck/setcmykcolor load def
-}if
-/Cg/setgray load def
-/RE{
-findfont
-dup maxlength 1 index/FontName known not{1 add}if dict begin
-{
-1 index/FID ne{def}{pop pop}ifelse
-}forall
-/Encoding exch def
-dup/FontName exch def
-currentdict end definefont pop
-}bind def
-/DEFS 0 def
-/EBEGIN{
-moveto
-DEFS begin
-}bind def
-/EEND/end load def
-/CNT 0 def
-/level1 0 def
-/PBEGIN{
-/level1 save def
-translate
-div 3 1 roll div exch scale
-neg exch neg exch translate
-0 setgray
-0 setlinecap
-1 setlinewidth
-0 setlinejoin
-10 setmiterlimit
-[]0 setdash
-/setstrokeadjust where{
-pop
-false setstrokeadjust
-}if
-/setoverprint where{
-pop
-false setoverprint
-}if
-newpath
-/CNT countdictstack def
-userdict begin
-/showpage{}def
-/setpagedevice{}def
-}bind def
-/PEND{
-countdictstack CNT sub{end}repeat
-level1 restore
-}bind def
-end def
-/setpacking where{
-pop
-setpacking
-}if
-%%EndResource
-%%EndProlog
-%%BeginSetup
-%%BeginFeature: *PageSize Default
-<< /PageSize [ 612 792 ] /ImagingBBox null >> setpagedevice
-%%EndFeature
-%%IncludeResource: font Times-Roman
-%%IncludeResource: font Times-Bold
-%%IncludeResource: font Times-Italic
-grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72
-def/PL 792 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron/Zcaron
-/scaron/zcaron/Ydieresis/trademark/quotesingle/Euro/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/space/exclam/quotedbl/numbersign/dollar/percent
-/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen
-/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon
-/semicolon/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O
-/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright/circumflex
-/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y
-/z/braceleft/bar/braceright/tilde/.notdef/quotesinglbase/guillemotleft
-/guillemotright/bullet/florin/fraction/perthousand/dagger/daggerdbl
-/endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut
-/dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash
-/quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen
-/brokenbar/section/dieresis/copyright/ordfeminine/guilsinglleft
-/logicalnot/minus/registered/macron/degree/plusminus/twosuperior
-/threesuperior/acute/mu/paragraph/periodcentered/cedilla/onesuperior
-/ordmasculine/guilsinglright/onequarter/onehalf/threequarters
-/questiondown/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE
-/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex
-/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis
-/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn
-/germandbls/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla
-/egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis
-/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide/oslash
-/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis]def
-/Times-Italic at 0 ENC0/Times-Italic RE/Times-Bold at 0 ENC0/Times-Bold RE
-/Times-Roman at 0 ENC0/Times-Roman RE
-%%EndSetup
-%%Page: 1 1
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mbm_fmtv)72 48 Q 136.65(el\(1\) MB-System)-.15 F
-136.65(5.0 mbm_fmtv)2.5 F(el\(1\))-.15 E/F1 10.95/Times-Bold at 0 SF -.219
-(NA)72 84 S(ME).219 E/F2 10/Times-Bold at 0 SF(mbm_fmtv)108 96 Q(el)-.1 E
-F0 2.626<ad45>2.626 G .126(xtract sound v)-2.626 F .126
-(elocity info from Hydrosweep data \214les and create output in tab)-.15
-F .126(ular format.)-.2 F F1(VERSION)72 124.8 Q F0 -1.11(Ve)108 136.8 S
-(rsion 5.0)1.11 E F1(SYNOPSIS)72 165.6 Q F2(mbm_fmtv)108 177.6 Q(el)-.1
-E F0([)2.5 E F2<ad46>A/F3 10/Times-Italic at 0 SF(format)A F2<ad49>2.5 E F3
-(in\214lename)A F2(])2.5 E F1(DESCRIPTION)72 206.4 Q F2(mbm_fmtv)108
-218.4 Q(el)-.1 E F0 .315(is a macro that scans a Hydrosweep sw)2.815 F
-.315(ath sonar data \214le using the program)-.1 F F2(mbhsdump)2.815 E
-F0(and)2.815 E .865(generates a list in columnar format with time, date\
-, latitude, longitude, C-mean, and C-k)108 230.4 R .865
-(eel entrys. Com-)-.1 F 1.698
-(ment records \(lines\) at the top of the output be)108 242.4 R 1.698
-(gin with '#'.)-.15 F 1.699(The columns are tab-delimited. The only)
-6.698 F(allo)108 254.4 Q(wed formats are 21 \(ra)-.25 E 2.5(wH)-.15 G
-(ydrosweep data\) and 24 \(L-DEO in-house binary Hydrosweep data\).)-2.5
-E F1 -.548(AU)72 283.2 S(THORSHIP).548 E F0(Da)108 295.2 Q(vid W)-.2 E
-2.5(.C)-.92 G(aress \(caress at mbari.or)-2.5 E(g\))-.18 E(Montere)113
-307.2 Q 2.5(yB)-.15 G(ay Aquarium Research Institute)-2.5 E
-(Dale N. Chayes \(dale at ldeo.columbia.edu\))108 319.2 Q
-(Lamont-Doherty Earth Observ)113 331.2 Q(atory)-.25 E
-(Suzanne H. O'Hara \(sohara at ldeo.columbia.edu\))108 343.2 Q
-(Lamont-Doherty Earth Observ)113 355.2 Q(atory)-.25 E F1(OPTIONS)72 384
-Q F2<ad46>108 396 Q F3(format)24.19 E F0 1.16
-(Sets the format for the input sw)144 408 R 1.16(ath sonar data using)
--.1 F F2(MBIO)3.66 E F0(inte)3.66 E 1.16
-(ger format identi\214ers. The only)-.15 F(allo)144 420 Q 2.07
-(wed formats are 21 \(ra)-.25 F 4.57(wH)-.15 G 2.07
-(ydrosweep data\) and 24 \(L-DEO in-house binary Hydrosweep)-4.57 F
-(data\).)144 432 Q F2<ad49>108 448.8 Q F3(in\214lename)26.41 E F0
-(Data \214le from which the input data will be read.)144 460.8 Q F1
-(SEE ALSO)72 489.6 Q F2(mbsystem)108 501.6 Q F0(\(1\))A F1 -.11(BU)72
-530.4 S(GS).11 E F0(Only one output format is currently supported.)108
-542.4 Q(MB-System 5.0)72 768 Q 2.5(7J)146.495 G(une 2013)-2.5 E(1)
-204.835 E 0 Cg EP
-%%Trailer
-end
-%%EOF
diff --git a/src/ps/mbm_grd2arc.ps b/src/ps/mbm_grd2arc.ps
deleted file mode 100644
index c4c15af..0000000
--- a/src/ps/mbm_grd2arc.ps
+++ /dev/null
@@ -1,331 +0,0 @@
-%!PS-Adobe-3.0
-%%Creator: groff version 1.19.2
-%%CreationDate: Wed Jul  1 12:29:28 2015
-%%DocumentNeededResources: font Times-Roman
-%%+ font Times-Bold
-%%+ font Times-Italic
-%%DocumentSuppliedResources: procset grops 1.19 2
-%%Pages: 2
-%%PageOrder: Ascend
-%%DocumentMedia: Default 612 792 0 () ()
-%%Orientation: Portrait
-%%EndComments
-%%BeginDefaults
-%%PageMedia: Default
-%%EndDefaults
-%%BeginProlog
-%%BeginResource: procset grops 1.19 2
-%!PS-Adobe-3.0 Resource-ProcSet
-/setpacking where{
-pop
-currentpacking
-true setpacking
-}if
-/grops 120 dict dup begin
-/SC 32 def
-/A/show load def
-/B{0 SC 3 -1 roll widthshow}bind def
-/C{0 exch ashow}bind def
-/D{0 exch 0 SC 5 2 roll awidthshow}bind def
-/E{0 rmoveto show}bind def
-/F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def
-/G{0 rmoveto 0 exch ashow}bind def
-/H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/I{0 exch rmoveto show}bind def
-/J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def
-/K{0 exch rmoveto 0 exch ashow}bind def
-/L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/M{rmoveto show}bind def
-/N{rmoveto 0 SC 3 -1 roll widthshow}bind def
-/O{rmoveto 0 exch ashow}bind def
-/P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/Q{moveto show}bind def
-/R{moveto 0 SC 3 -1 roll widthshow}bind def
-/S{moveto 0 exch ashow}bind def
-/T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/SF{
-findfont exch
-[exch dup 0 exch 0 exch neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/MF{
-findfont
-[5 2 roll
-0 3 1 roll
-neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/level0 0 def
-/RES 0 def
-/PL 0 def
-/LS 0 def
-/MANUAL{
-statusdict begin/manualfeed true store end
-}bind def
-/PLG{
-gsave newpath clippath pathbbox grestore
-exch pop add exch pop
-}bind def
-/BP{
-/level0 save def
-1 setlinecap
-1 setlinejoin
-72 RES div dup scale
-LS{
-90 rotate
-}{
-0 PL translate
-}ifelse
-1 -1 scale
-}bind def
-/EP{
-level0 restore
-showpage
-}def
-/DA{
-newpath arcn stroke
-}bind def
-/SN{
-transform
-.25 sub exch .25 sub exch
-round .25 add exch round .25 add exch
-itransform
-}bind def
-/DL{
-SN
-moveto
-SN
-lineto stroke
-}bind def
-/DC{
-newpath 0 360 arc closepath
-}bind def
-/TM matrix def
-/DE{
-TM currentmatrix pop
-translate scale newpath 0 0 .5 0 360 arc closepath
-TM setmatrix
-}bind def
-/RC/rcurveto load def
-/RL/rlineto load def
-/ST/stroke load def
-/MT/moveto load def
-/CL/closepath load def
-/Fr{
-setrgbcolor fill
-}bind def
-/setcmykcolor where{
-pop
-/Fk{
-setcmykcolor fill
-}bind def
-}if
-/Fg{
-setgray fill
-}bind def
-/FL/fill load def
-/LW/setlinewidth load def
-/Cr/setrgbcolor load def
-/setcmykcolor where{
-pop
-/Ck/setcmykcolor load def
-}if
-/Cg/setgray load def
-/RE{
-findfont
-dup maxlength 1 index/FontName known not{1 add}if dict begin
-{
-1 index/FID ne{def}{pop pop}ifelse
-}forall
-/Encoding exch def
-dup/FontName exch def
-currentdict end definefont pop
-}bind def
-/DEFS 0 def
-/EBEGIN{
-moveto
-DEFS begin
-}bind def
-/EEND/end load def
-/CNT 0 def
-/level1 0 def
-/PBEGIN{
-/level1 save def
-translate
-div 3 1 roll div exch scale
-neg exch neg exch translate
-0 setgray
-0 setlinecap
-1 setlinewidth
-0 setlinejoin
-10 setmiterlimit
-[]0 setdash
-/setstrokeadjust where{
-pop
-false setstrokeadjust
-}if
-/setoverprint where{
-pop
-false setoverprint
-}if
-newpath
-/CNT countdictstack def
-userdict begin
-/showpage{}def
-/setpagedevice{}def
-}bind def
-/PEND{
-countdictstack CNT sub{end}repeat
-level1 restore
-}bind def
-end def
-/setpacking where{
-pop
-setpacking
-}if
-%%EndResource
-%%EndProlog
-%%BeginSetup
-%%BeginFeature: *PageSize Default
-<< /PageSize [ 612 792 ] /ImagingBBox null >> setpagedevice
-%%EndFeature
-%%IncludeResource: font Times-Roman
-%%IncludeResource: font Times-Bold
-%%IncludeResource: font Times-Italic
-grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72
-def/PL 792 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron/Zcaron
-/scaron/zcaron/Ydieresis/trademark/quotesingle/Euro/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/space/exclam/quotedbl/numbersign/dollar/percent
-/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen
-/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon
-/semicolon/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O
-/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright/circumflex
-/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y
-/z/braceleft/bar/braceright/tilde/.notdef/quotesinglbase/guillemotleft
-/guillemotright/bullet/florin/fraction/perthousand/dagger/daggerdbl
-/endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut
-/dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash
-/quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen
-/brokenbar/section/dieresis/copyright/ordfeminine/guilsinglleft
-/logicalnot/minus/registered/macron/degree/plusminus/twosuperior
-/threesuperior/acute/mu/paragraph/periodcentered/cedilla/onesuperior
-/ordmasculine/guilsinglright/onequarter/onehalf/threequarters
-/questiondown/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE
-/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex
-/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis
-/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn
-/germandbls/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla
-/egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis
-/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide/oslash
-/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis]def
-/Times-Italic at 0 ENC0/Times-Italic RE/Times-Bold at 0 ENC0/Times-Bold RE
-/Times-Roman at 0 ENC0/Times-Roman RE
-%%EndSetup
-%%Page: 1 1
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 132.07(mbm_grd2arc\(1\) MB-System)72 48 R 132.07
-(5.0 mbm_grd2arc\(1\))2.5 F/F1 10.95/Times-Bold at 0 SF -.219(NA)72 84 S
-(ME).219 E/F2 10/Times-Bold at 0 SF(mbm_grd2ar)108 96 Q(c)-.18 E F0 2.698
-<ad4d>2.698 G .198(acro to con)-2.698 F -.15(ve)-.4 G .198
-(rt a GMT grid \214le in the GMT NetCDF grid format to an ArcV).15 F(ie)
--.6 E 2.697(wA)-.25 G(SCII)-2.697 E(grid.)108 108 Q F1(VERSION)72 136.8
-Q F0 -1.11(Ve)108 148.8 S(rsion 5.0)1.11 E F1(SYNOPSIS)72 177.6 Q F0
-(mbm_grd2arc)108 189.6 Q F2<ad49>2.5 E/F3 10/Times-Italic at 0 SF(gr)A
-(d\214le)-.37 E F2<ad4f>2.5 E F3(ar)A(c\214le)-.37 E F0([)2.5 E F2
-<ad4820ad4e>A F3(nodata)A F2<ad56>2.5 E F0(])A F1(DESCRIPTION)72 218.4 Q
-F2(mbm_grd2ar)108 230.4 Q(c)-.18 E F0 1.406(is a macro to con)3.906 F
--.15(ve)-.4 G 1.406
-(rt a GMT grid \214le in the GMT NetCDF grid format to an ArcV).15 F(ie)
--.6 E(w)-.25 E .385(ASCII grid. This allo)108 242.4 R .385
-(ws users to import the grid into Arc/Info and ArcV)-.25 F(ie)-.6 E
-1.685 -.65(w. T)-.25 H .385(he grids must ha).65 F .685 -.15(ve t)-.2 H
-.385(he same).15 F 1.259(grid interv)108 254.4 R 1.259
-(al in both longitude and latitude. If the grid w)-.25 F 1.26
-(as created using)-.1 F F2(mbgrid)3.76 E F0(or)3.76 E F2(mbmosaic)3.76 E
-F0 3.76(,t)C(he)-3.76 E F2<ad45>3.76 E F0 .609(option must ha)108 266.4
-R .909 -.15(ve b)-.2 H .609(een used in that program to set the grid ce\
-ll sizes equal \(see the mbgrid and mbmosaic).15 F(manual pages\).)108
-278.4 Q 1.509(The macro \214rst obtains the bounds, dimensions, and gri\
-d cell size of the grid using the GMT program)108 290.4 R F2(grdinf)108
-302.4 Q(o)-.25 E F0 5.267(.T)C .267(he grid dimensions, the lo)-5.267 F
-.266(wer left position, and the grid cell size are written to the heade\
-r of the)-.25 F .131(output ArcV)108 314.4 R(ie)-.6 E 2.631(wA)-.25 G
-.131(SCII grid \214le.)-2.631 F .131
-(The macro then uses the GMT program)5.131 F F2(grd2xyz)2.631 E F0 .131
-(to dump each of the grid)2.631 F -.25(va)108 326.4 S .094
-(lues to a temporary ASCII \214le.).25 F .094
-(This temporary \214le is read and parsed one v)5.094 F .093
-(alue at a time.)-.25 F(An)5.093 E 2.593(yN)-.15 G .093(aN v)-2.593 F
-(al-)-.25 E .39(ues are replaced by the)108 338.4 R F3(nodata)2.89 E F0
--.25(va)2.89 G .39(lue speci\214ed with the).25 F F2<ad4e>2.89 E F0 .39
-(option. Each \214nal v)2.89 F .39(alue is printed to the output)-.25 F
-(\214le.)108 350.4 Q F1 -.548(AU)72 379.2 S(THORSHIP).548 E F0(Da)108
-391.2 Q(vid W)-.2 E 2.5(.C)-.92 G(aress \(caress at mbari.or)-2.5 E(g\))
--.18 E(Montere)113 403.2 Q 2.5(yB)-.15 G(ay Aquarium Research Institute)
--2.5 E(Dale N. Chayes \(dale at ldeo.columbia.edu\))108 415.2 Q
-(Lamont-Doherty Earth Observ)113 427.2 Q(atory)-.25 E F1(OPTIONS)72 456
-Q F2<ad48>108 468 Q F0 .162(This "help" \215ag cause the program to pri\
-nt out a description of its operation and then e)22.52 F .161
-(xit immedi-)-.15 F(ately)144 480 Q(.)-.65 E F2<ad49>108 496.8 Q F3(gr)
-26.41 E(dname)-.37 E F0(Sets the \214lename of the input GMT grid \214l\
-e. This \214le must be in the GMT NetCDF GRD format.)144 508.8 Q F2
-<ad4e>108 525.6 Q F3(nodata)23.08 E F0(Sets the "no data" v)144 537.6 Q
-(alue used in the output ASCII \214le.)-.25 E(Def)5 E(ault:)-.1 E F3
-(nodata)2.5 E F0 2.5<3dad>2.5 G(99999.)-2.5 E F2<ad4f>108 554.4 Q F3(ar)
-22.52 E(c\214le)-.37 E F0(Sets the \214lename of the output ArcV)144
-566.4 Q(ie)-.6 E 2.5(wA)-.25 G(SCII grid.)-2.5 E F2<ad56>108 583.2 Q F0
-(The)23.08 E F2<ad56>2.5 E F0(option causes)2.5 E F2(mbm_grd2ar)2.5 E(c)
--.18 E F0(to print out status messages.)2.5 E F1(EXAMPLES)72 612 Q F0
-.713(Suppose that we ha)108 624 R 1.013 -.15(ve u)-.2 H(sed).15 E F2
-(mbgrid)3.213 E F0 .713(to obtain a topograph)3.213 F 3.213(yg)-.05 G
-.713(rid \214le called K)-3.213 F .714(ohalaA_bath.grd in the GMT)-.35 F
-(NetCDF GRD format:)108 636 Q(mbgrid \255Idatalist \\)144 648 Q(-OK)180
-660 Q(ohalaA_bath \\)-.35 E
-(-R-155.72855/-155.31928/20.09488/20.47645 \\)180 672 Q
-(-E30.0/0m! \255A2 \255N \255G3 \255C1 \255V)180 684 Q .184
-(In this case, the)108 696 R F2<ad45>2.684 E F0 .184(option w)2.684 F
-.184(as used to force)-.1 F F2(mbgrid)2.684 E F0 .183
-(to use equal longitude and latitude grid cell sizes. See)2.683 F(the)
-108 708 Q F2(mbgrid)2.5 E F0(or)2.5 E F2(mbmosaic)2.5 E F0
-(manual pages for details on the usage of the)2.5 E F2<ad45>2.5 E F0
-(option in those programs.)2.5 E(MB-System 5.0)72 768 Q 2.5(3J)146.495 G
-(une 2013)-2.5 E(1)204.835 E 0 Cg EP
-%%Page: 2 2
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 132.07(mbm_grd2arc\(1\) MB-System)72 48 R 132.07
-(5.0 mbm_grd2arc\(1\))2.5 F .629(In order to con)108 84 R -.15(ve)-.4 G
-.629(rt K).15 F .629(ohalaA_bath.grd to an ArcV)-.35 F(ie)-.6 E 3.129
-(wA)-.25 G .63(SCII grid so that the data can be imported into the)
--3.129 F(Arc/Info or ArcV)108 96 Q(ie)-.6 E 2.5(wG)-.25 G
-(IS packages, we use the)-2.5 E/F1 10/Times-Bold at 0 SF(mbm_grd2ar)2.5 E
-(c)-.18 E F0(macro:)2.5 E(mbm_grd2arc \255IK)144 108 Q
-(ohalaA_bath.grd \\)-.35 E(-OK)180 120 Q(ohalaA_bath.asc \255V)-.35 E
-(Running the e)108 132 Q(xample abo)-.15 E .3 -.15(ve p)-.15 H
-(roduced the follo).15 E(wing output:)-.25 E
-(Program mbm_grd2arc status:)144 156 Q(Input GRD \214le:)164 168 Q -.35
-(Ko)30 G(halaA_bath.grd).35 E(Output ArcV)164 180 Q(ie)-.6 E 2.5(wA)-.25
-G(SCII \214le: K)-2.5 E(ohalaA_bath.asc)-.35 E(Grid dimensions:)164 192
-Q 2.5(1426 1329)5 F(Grid cell sizes:)164 204 Q 2.5
-(0.0002871995719 0.0002871995719)5 F(Grid bounds:)164 216 Q 2.5
-(\255155.72855 \255155.3192906)15 F 2.5(20.09488 20.47628103)10 F
-(Generating temporary \214le...)144 240 Q -.15(Pa)144 252 S
-(rsing temporary \214le...).15 E(10% complete)144 264 Q(20% complete)144
-276 Q(30% complete)144 288 Q(40% complete)144 300 Q(50% complete)144 312
-Q(60% complete)144 324 Q(70% complete)144 336 Q(80% complete)144 348 Q
-(90% complete)144 360 Q(100% complete)144 372 Q/F2 10.95/Times-Bold at 0 SF
-(SEE ALSO)72 400.8 Q F1(mbsystem)108 412.8 Q F0(\(1\),)A F1(mbgrid)2.5 E
-F0(\(1\),)A F1(mbmosaic)2.5 E F0(\(1\),)A F1(mbm_ar)2.5 E(c2grd)-.18 E
-F0(\(1\),)A F1(mbm_grid)2.5 E F0(\(1\))A F2 -.11(BU)72 441.6 S(GS).11 E
-F0(Maybe. Maybe not.)108 453.6 Q(MB-System 5.0)72 768 Q 2.5(3J)146.495 G
-(une 2013)-2.5 E(2)204.835 E 0 Cg EP
-%%Trailer
-end
-%%EOF
diff --git a/src/ps/mbm_grd2geovrml.ps b/src/ps/mbm_grd2geovrml.ps
deleted file mode 100644
index 101b909..0000000
--- a/src/ps/mbm_grd2geovrml.ps
+++ /dev/null
@@ -1,622 +0,0 @@
-%!PS-Adobe-3.0
-%%Creator: groff version 1.19.2
-%%CreationDate: Wed Jul  1 12:29:28 2015
-%%DocumentNeededResources: font Times-Roman
-%%+ font Times-Bold
-%%+ font Times-Italic
-%%DocumentSuppliedResources: procset grops 1.19 2
-%%Pages: 5
-%%PageOrder: Ascend
-%%DocumentMedia: Default 612 792 0 () ()
-%%Orientation: Portrait
-%%EndComments
-%%BeginDefaults
-%%PageMedia: Default
-%%EndDefaults
-%%BeginProlog
-%%BeginResource: procset grops 1.19 2
-%!PS-Adobe-3.0 Resource-ProcSet
-/setpacking where{
-pop
-currentpacking
-true setpacking
-}if
-/grops 120 dict dup begin
-/SC 32 def
-/A/show load def
-/B{0 SC 3 -1 roll widthshow}bind def
-/C{0 exch ashow}bind def
-/D{0 exch 0 SC 5 2 roll awidthshow}bind def
-/E{0 rmoveto show}bind def
-/F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def
-/G{0 rmoveto 0 exch ashow}bind def
-/H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/I{0 exch rmoveto show}bind def
-/J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def
-/K{0 exch rmoveto 0 exch ashow}bind def
-/L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/M{rmoveto show}bind def
-/N{rmoveto 0 SC 3 -1 roll widthshow}bind def
-/O{rmoveto 0 exch ashow}bind def
-/P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/Q{moveto show}bind def
-/R{moveto 0 SC 3 -1 roll widthshow}bind def
-/S{moveto 0 exch ashow}bind def
-/T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/SF{
-findfont exch
-[exch dup 0 exch 0 exch neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/MF{
-findfont
-[5 2 roll
-0 3 1 roll
-neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/level0 0 def
-/RES 0 def
-/PL 0 def
-/LS 0 def
-/MANUAL{
-statusdict begin/manualfeed true store end
-}bind def
-/PLG{
-gsave newpath clippath pathbbox grestore
-exch pop add exch pop
-}bind def
-/BP{
-/level0 save def
-1 setlinecap
-1 setlinejoin
-72 RES div dup scale
-LS{
-90 rotate
-}{
-0 PL translate
-}ifelse
-1 -1 scale
-}bind def
-/EP{
-level0 restore
-showpage
-}def
-/DA{
-newpath arcn stroke
-}bind def
-/SN{
-transform
-.25 sub exch .25 sub exch
-round .25 add exch round .25 add exch
-itransform
-}bind def
-/DL{
-SN
-moveto
-SN
-lineto stroke
-}bind def
-/DC{
-newpath 0 360 arc closepath
-}bind def
-/TM matrix def
-/DE{
-TM currentmatrix pop
-translate scale newpath 0 0 .5 0 360 arc closepath
-TM setmatrix
-}bind def
-/RC/rcurveto load def
-/RL/rlineto load def
-/ST/stroke load def
-/MT/moveto load def
-/CL/closepath load def
-/Fr{
-setrgbcolor fill
-}bind def
-/setcmykcolor where{
-pop
-/Fk{
-setcmykcolor fill
-}bind def
-}if
-/Fg{
-setgray fill
-}bind def
-/FL/fill load def
-/LW/setlinewidth load def
-/Cr/setrgbcolor load def
-/setcmykcolor where{
-pop
-/Ck/setcmykcolor load def
-}if
-/Cg/setgray load def
-/RE{
-findfont
-dup maxlength 1 index/FontName known not{1 add}if dict begin
-{
-1 index/FID ne{def}{pop pop}ifelse
-}forall
-/Encoding exch def
-dup/FontName exch def
-currentdict end definefont pop
-}bind def
-/DEFS 0 def
-/EBEGIN{
-moveto
-DEFS begin
-}bind def
-/EEND/end load def
-/CNT 0 def
-/level1 0 def
-/PBEGIN{
-/level1 save def
-translate
-div 3 1 roll div exch scale
-neg exch neg exch translate
-0 setgray
-0 setlinecap
-1 setlinewidth
-0 setlinejoin
-10 setmiterlimit
-[]0 setdash
-/setstrokeadjust where{
-pop
-false setstrokeadjust
-}if
-/setoverprint where{
-pop
-false setoverprint
-}if
-newpath
-/CNT countdictstack def
-userdict begin
-/showpage{}def
-/setpagedevice{}def
-}bind def
-/PEND{
-countdictstack CNT sub{end}repeat
-level1 restore
-}bind def
-end def
-/setpacking where{
-pop
-setpacking
-}if
-%%EndResource
-%%EndProlog
-%%BeginSetup
-%%BeginFeature: *PageSize Default
-<< /PageSize [ 612 792 ] /ImagingBBox null >> setpagedevice
-%%EndFeature
-%%IncludeResource: font Times-Roman
-%%IncludeResource: font Times-Bold
-%%IncludeResource: font Times-Italic
-grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72
-def/PL 792 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron/Zcaron
-/scaron/zcaron/Ydieresis/trademark/quotesingle/Euro/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/space/exclam/quotedbl/numbersign/dollar/percent
-/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen
-/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon
-/semicolon/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O
-/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright/circumflex
-/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y
-/z/braceleft/bar/braceright/tilde/.notdef/quotesinglbase/guillemotleft
-/guillemotright/bullet/florin/fraction/perthousand/dagger/daggerdbl
-/endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut
-/dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash
-/quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen
-/brokenbar/section/dieresis/copyright/ordfeminine/guilsinglleft
-/logicalnot/minus/registered/macron/degree/plusminus/twosuperior
-/threesuperior/acute/mu/paragraph/periodcentered/cedilla/onesuperior
-/ordmasculine/guilsinglright/onequarter/onehalf/threequarters
-/questiondown/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE
-/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex
-/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis
-/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn
-/germandbls/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla
-/egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis
-/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide/oslash
-/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis]def
-/Times-Italic at 0 ENC0/Times-Italic RE/Times-Bold at 0 ENC0/Times-Bold RE
-/Times-Roman at 0 ENC0/Times-Roman RE
-%%EndSetup
-%%Page: 1 1
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mbm_grd2geo)72 48 Q 111.1(vrml\(1\) MB-System)
--.15 F 111.1(5.0 mbm_grd2geo)2.5 F(vrml\(1\))-.15 E/F1 10.95
-/Times-Bold at 0 SF -.219(NA)72 84 S(ME).219 E/F2 10/Times-Bold at 0 SF
-(mbm_grd2geo)108 96 Q(vrml)-.1 E F0 3.041<ad43>3.041 G .541(reate and e)
--3.041 F -.15(xe)-.15 G .541(cute commands which generate a T).15 F
-(erraV)-.7 E .54(ision tileset and GeoVRML)-.6 F
-(terrain set that can be combined with other geospatial data for vie)108
-108 Q(wing in a web bro)-.25 E(wser)-.25 E(.)-.55 E F1(VERSION)72 136.8
-Q F0 -1.11(Ve)108 148.8 S(rsion 5.0)1.11 E F1(SYNOPSIS)72 177.6 Q F2
-(mbm_grd2geo)108 189.6 Q(vrml)-.1 E/F3 10/Times-Italic at 0 SF(bath_\214le)
-2.5 E F2(\255tvdir)2.5 E F3(tvpar)2.5 E(ent)-.37 E F2(\255vrmldir)2.5 E
-F3(vrmlpar)2.5 E(ent)-.37 E F2(\255olat)2.5 E F3(lat)2.5 E F2(\255olon)
-2.5 E F3(lon)2.5 E F2(\255vrmlurl)2.5 E F3(url)2.5 E F0
-(Additional Options:)108 225.6 Q F2(\255ele)108 249.6 Q(vscale)-.15 E F3
-(vert_e)3.276 E(xa)-.2 E(g)-.1 E F2(\255no)3.276 E .776(wrz \255no)-.1 F
-.776(view \255pallette)-.1 F F3(pal)3.276 E F2(\255newimage)3.276 E F3
-(type|\214le)3.276 E F2 .777(\255white \255zmax)3.277 F F3(maxclip)3.277
-E F2(\255zmin)3.277 E F3(minclip)108 261.6 Q F2(\255basename)2.5 E F3
-(basename)2.5 E F1(DESCRIPTION)72 290.4 Q F2(mbm_grd2geo)108 302.4 Q
-(vrml)-.1 E F0 1.995(is a macro that tak)4.495 F 1.995
-(es as input a GMT geographic-coordinate bath)-.1 F 1.994
-(ymetry grid \214le)-.05 F(\()108 314.4 Q F3(bath_\214le)A F0 2.967(\)a)
-C .468(nd produces a terrain tile set that may be vie)-2.967 F .468
-(wed in a web bro)-.25 F .468(wser with an appropriate plugin.)-.25 F
-1.265(The bath)108 326.4 R 1.265
-(ymetry \(geometry\) is paired with imagery \(te)-.05 F 1.264
-(xture\) to produce arti\214cially illuminated terrain or)-.15 F 1.876
-(slope shaded terrain. Alternati)108 338.4 R -.15(ve)-.25 G(ly).15 E
-4.376(,ac)-.65 G(o-re)-4.376 E 1.877(gistered image may be pro)-.15 F
-1.877(vided as a substitute to the latter)-.15 F .992
-(imagery which is generated from the bath)108 350.4 R .991(ymetry data.)
--.05 F .991(This may be used to, for instance, draping a side)5.991 F
-(scan sonar image o)108 362.4 Q -.15(ve)-.15 G 2.5(rt).15 G(he bath)-2.5
-E(ymetry)-.05 E(.)-.65 E 1.289
-(Before the geoVRML \214les can be created an intermediate T)108 386.4 R
-(erraV)-.7 E 1.289(ision tile set must be created from the)-.6 F .046
-(input GMT bath)108 398.4 R .045
-(ymetry \214le and a TIFF image that is either generated from the bath)
--.05 F .045(ymetry or speci\214ed from)-.05 F(an e)108 410.4 Q
-(xisting \214le with the)-.15 E F3(-ne)2.5 E(wima)-.15 E -.1(ge)-.1 G F0
-(option.)2.6 E .235(This tileset is then used to generate a GeoVRML qua\
-dtree multi-resolution set of \214les.)108 434.4 R .235
-(The resulting set of)5.235 F 1.281(\214les will be created in)108 446.4
-R F3(vrmlpar)3.781 E(ent)-.37 E F0 1.281
-(/<basename>, where <basename> is the same as)B F3(bath_\214le)3.78 E F0
-1.28(without the)3.78 F .628(usual '.grd' e)108 458.4 R 3.128
-(xtension. This)-.15 F(beha)3.128 E .628(vior may be o)-.2 F -.15(ve)
--.15 G .628(rridded with the).15 F F2(\255basename)3.128 E F0 3.128
-(option. This)3.128 F .629(is useful if an)3.128 F -.15(ex)108 470.4 S
-1.264(isting image \214le is speci\214ed with the).15 F F2(\255newimage)
-3.764 E F3(\214le)3.764 E F0 1.264
-(option, in which case the image \214le base name)3.764 F
-(should be used with)108 482.4 Q F2(\255basename)2.5 E F0
-(\(see second e)2.5 E(xample belo)-.15 E(w\).)-.25 E .081(The inde)108
-506.4 R .081(x.html \214le produced in this directory can be loaded int\
-o Netscape 4.7 on a PC \(properly con\214gured)-.15 F .591
-(with CosmoPlayer and GeoVRML 1.1\) for interacti)108 518.4 R .891 -.15
-(ve v)-.25 H .59(isualization. The resulting terrain can be used as a)
-.15 F .617(3D basemap for use in visualizing other georeferenced data t\
-hat has also been placed in GeoVRML using)108 530.4 R(the same)108 542.4
-Q F2(\255olat)2.5 E F0(and)2.5 E F2(\255olon)2.5 E F0(settings.)2.5 E
-1.518(GeoVRML \(and T)108 566.4 R(erraV)-.7 E 1.518(ision\) e)-.6 F
-1.518(xpects rectangular gridded ele)-.15 F -.25(va)-.25 G 1.517
-(tion data and bro).25 F 1.517(wsers render all terrain)-.25 F .862
-(data within the rectangle.)108 578.4 R .862
-(This presents a problem for ocean bath)5.862 F .862
-(ymetric data which often ha)-.05 F 1.162 -.15(ve i)-.2 H(rre).15 E
-(gular)-.15 E 2.261(\(not rectangular\) boundaries.)108 590.4 R 2.261
-(Before con)7.261 F -.15(ve)-.4 G 2.261(rting a grid \214le to T).15 F
-(erraV)-.7 E 2.261(ision format)-.6 F F2(mbm_grd2geo)4.76 E(vrml)-.1 E
-F0 .254(replaces all no-data ele)108 602.4 R -.25(va)-.25 G .254(tion v)
-.25 F .254(alues with a coarse resolution spline-\214lled e)-.25 F .254
-(xtrapolation from the data in the)-.15 F(irre)108 614.4 Q .031(gular a\
-rea. This results in a rectangular grid with smooth transitions from ar\
-eas of ele)-.15 F -.25(va)-.25 G .03(tion data to areas).25 F .161
-(of no data.)108 626.4 R .161(In the resulting GeoVRML the no data area\
-s are colored black \(or white if)5.161 F F2(\255white)2.661 E F0 .162
-(is speci\214ed\).)2.661 F(If)108 638.4 Q F2(\255newimage)2.5 E F3
-(\214le)2.5 E F0(is speci\214ed then the outer boundaries will stay the\
- same color as in the image.)2.5 E F1 -.548(AU)72 667.2 S(THORSHIP).548
-E F0(Mik)108 679.2 Q 2.5(eM)-.1 G(cCann \(mccann at mbari.or)-2.5 E(g\))
--.18 E(Montere)113 691.2 Q 2.5(yB)-.15 G(ay Aquarium Research Institute)
--2.5 E(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(1)204.835
-E 0 Cg EP
-%%Page: 2 2
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mbm_grd2geo)72 48 Q 111.1(vrml\(1\) MB-System)
--.15 F 111.1(5.0 mbm_grd2geo)2.5 F(vrml\(1\))-.15 E/F1 10.95
-/Times-Bold at 0 SF(SIMPLE DESCRIPTION OF B)72 84 Q(ASIC OPTIONS)-.329 E/F2
-10/Times-Italic at 0 SF(bath_\214le)108 96 Q F0 3.944(AG)144 108 S 1.444
-(MT gridded bath)-3.944 F 1.444
-(ymetry \214le in geographic \(lat/lon\) coordinates.)-.05 F 1.444
-(The \214le can be e)6.444 F(xpressed)-.15 E .457
-(with just the base name without the .grd e)144 120 R .458
-(xtension, in which case the macro will append '.grd.gz')-.15 F(to)144
-132 Q F2(bath_\214le)3.53 E F0 1.029(and uncompress the data upon input\
-. If the compressed data \214le does not e)3.53 F 1.029(xist then)-.15 F
-('.grd' will be appended to)144 144 Q F2(bath_\214le)2.5 E F0
-(and it will be used, if it e)2.5 E(xists.)-.15 E/F3 10/Times-Bold at 0 SF
-(\255tvdir)108 172.8 Q F2(tvpar)9.19 E(ent)-.37 E F0 1.535(The T)144
-196.8 R(erraV)-.7 E 1.535(ision tileset destination directory)-.6 F
-6.535(.A)-.65 G 1.536(subdirectory named)-2.5 F F2(bath_\214le)4.036 E
-F0 1.536(\(without the .grd)4.036 F -.15(ex)144 208.8 S
-(tension\) will be created here.).15 E F3(\255vrmldir)108 225.6 Q F2
-(vrmlpar)144 237.6 Q(ent)-.37 E F0 1.669
-(The GeoVRML tileset destination directory)144 249.6 R 6.669(.A)-.65 G
-1.669(subdirectory named)-2.5 F F2(bath_\214le)4.169 E F0 1.669
-(\(without the .grd)4.169 F -.15(ex)144 261.6 S
-(tension\) will be created here.).15 E F3(\255olat)108 290.4 Q F2(lat)
-14.19 E F3(\255olon)108 307.2 Q F2(lon)11.96 E F0 .178
-(The geoOrigin latitude and longitude in decimal de)144 331.2 R .179
-(grees. Because of single precision arithmetic in)-.15 F .016
-(VRML97 it is necessary to de\214ne a geoOrigin from which of)144 343.2
-R .015(fsets are computed before coordinates)-.25 F .368
-(are passed into the visualization pipeline.)144 355.2 R .368
-(The geoOrigin should be within 5 de)5.368 F .368(grees of the e)-.15 F
-(xtent)-.15 E .817(of the grid \214le in order to ha)144 367.2 R 1.117
--.15(ve s)-.2 H .817
-(ubmeter precision in the location of objects within the resulting).15 F
-(GeoVRML output.)144 379.2 Q(See the GeoVRML spec for more details.)5 E
-.493
-(The GeoOrigin of the terrain must be the same as the GeoOrigin of an)
-144 403.2 R 2.993(yo)-.15 G .494(ther GeoVRML content)-2.993 F
-(\(e.g. na)144 415.2 Q(vig)-.2 E(ation tracks, sample locations\) that \
-you wish to combine with the terrain.)-.05 E F3(\255vrmlurl)108 444 Q F2
-(url)144 456 Q F0 .317(All def)144 468 R .317
-(ault URLs that are placed in the VRML \214les will be relati)-.1 F -.15
-(ve)-.25 G 5.316(.H).15 G -.25(ow)-5.316 G -2.15 -.25(ev e).25 H 1.116
--.4(r, y).25 H .316(ou should use the).4 F F3(\255vrmlurl)144 480 Q F0
-1.099(option to specify an absolute URL for the set of tiles.)3.599 F
-1.1(Then all of the URLs that are)6.1 F .674
-(used in the VRML \214les \(image te)144 492 R .674
-(xture links and childUrls in the GeoLOD node\) will use this as)-.15 F
-1.854(their base URL.)144 504 R 1.855(This is generally not desirable b\
-ecause hardcoding absolute URLs into your)6.854 F .681
-(datasets means that the dataset is nonportable to another serv)144 516
-R(er)-.15 E 3.181(,o)-.4 G 3.18(rd)-3.181 G(if)-3.18 E .68
-(ferent location on the same)-.25 F(serv)144 528 Q(er)-.15 E 3.491(.H)
--.55 G -.25(ow)-3.491 G -2.15 -.25(ev e).25 H 1.791 -.4(r, i).25 H 3.492
-(tm).4 G .992(ay be necessary to write absolute URLs in your tile \214l\
-es, especially if you)-3.492 F(ha)144 540 Q 1.425 -.15(ve m)-.2 H(an).15
-E 3.625(yl)-.15 G -2.15 -.25(ev e)-3.625 H 1.125
-(ls because some VRML bro).25 F 1.125(wsers ha)-.25 F 1.425 -.15(ve p)
--.2 H 1.124(roblems with relati).15 F 1.424 -.15(ve l)-.25 H 1.124
-(inks, resulting in).15 F(tiles and images that will not load.)144 552 Q
-F1(DESCRIPTION OF OPTION)72 580.8 Q(AL OPTIONS)-.219 E F3(\255ele)108
-592.8 Q(vscale)-.15 E F2(vert_e)144 604.8 Q(xa)-.2 E(g)-.1 E F0 -.15(Fa)
-144 616.8 S 1.135(ctor with which to multiply ele).15 F -.25(va)-.25 G
-1.135(tions resulting in a v).25 F 1.135(ertical e)-.15 F 1.135
-(xaggeration of the terrain.)-.15 F(The)6.135 E(def)144 628.8 Q(ault v)
--.1 E(alue is 1.0. F)-.25 E(actors greater than 1.0 increase v)-.15 E
-(ertical e)-.15 E(xaggeration.)-.15 E F3(\255no)108 657.6 Q(wrz)-.1 E F0
-1.196(By def)144 669.6 R 1.196
-(ault vrml output \214les are gzipped and sa)-.1 F -.15(ve)-.2 G 3.695
-(dw).15 G 1.195(ith the .wrz e)-3.695 F 3.695(xtension. Specify)-.15 F
-(\255no)3.695 E 1.195(wrz to)-.25 F -.15(ove)144 681.6 S
-(rride this and sa).15 E .3 -.15(ve t)-.2 H
-(he \214les uncompressed with the .wrl e).15 E(xtension.)-.15 E
-(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(2)204.835 E 0
-Cg EP
-%%Page: 3 3
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mbm_grd2geo)72 48 Q 111.1(vrml\(1\) MB-System)
--.15 F 111.1(5.0 mbm_grd2geo)2.5 F(vrml\(1\))-.15 E/F1 10/Times-Bold at 0
-SF(\255no)108 84 Q(view)-.1 E F0 1.2(By def)144 96 R 1.2(ault a GeoV)-.1
-F(ie)-.6 E 1.201
-(wpoint node with description 'home' is included with each GeoVRML tile)
--.25 F 2.67(\214le. These)144 108 R(vie)2.67 E .169
-(wpoints are helpful for creating terrain-only visualizations, b)-.25 F
-.169(ut the)-.2 F 2.669(ya)-.15 G .169(lso quickly \214ll)-2.669 F .611
-(up the vie)144 120 R .612(wpoint list when man)-.25 F 3.112(yt)-.15 G
-.612(iles are loaded.)-3.112 F .612
-(If you are creating GeoVRML tilesets to com-)5.612 F .764
-(bine with other GeoVRML content that contain vie)144 132 R .764
-(wpoints then you may w)-.25 F .764(ant to not ha)-.1 F 1.064 -.15(ve t)
--.2 H(hese).15 E('home' vie)144 144 Q 2.5(wpoints. Specify)-.25 F
-(\255no)2.5 E(vie)-.15 E 2.5(wt)-.25 G 2.5(on)-2.5 G(ot include a GeoV)
--2.5 E(ie)-.6 E(wpoint with each tile.)-.25 E F1(\255newimage)108 172.8
-Q/F2 10/Times-Italic at 0 SF(type|\214le)144 184.8 Q F0 1.031(By def)144
-196.8 R 1.031(ault an orthorecti\214ed image for the bath)-.1 F 1.032
-(ymetry is created by running mbm_grdtif)-.05 F 1.032(f\(1\) and)-.25 F
-.854(then quadrupling the image size using ImageMagick mogrify\(1\). \(\
-The quadrupling together with)144 208.8 R .598(the '-numpix)144 220.8 R
-.598(els 16' ar)-.15 F .598(gument in the mak)-.18 F(e_geo)-.1 E .599
-(vrml\(1\) command results in identical resolution of)-.15 F .526
-(the highest le)144 232.8 R -.15(ve)-.25 G 3.026(lG).15 G .526
-(eoVRML tiles and the original bath)-3.026 F .526(ymetric data.\))-.05 F
-.526(Making this image can be a)5.526 F 1.15(time consuming process.)144
-244.8 R 1.15(By def)6.15 F 1.15(ault, if a \214le with '.tif)-.1 F 3.65
-('a).55 G 1.15(ppended to)-3.65 F F2(bath_\214le)3.65 E F0 1.15
-(\(without the .grd)3.65 F -.15(ex)144 256.8 S .454
-(tension\) or appended to).15 F F2(basename)2.954 E F0(\(if)2.954 E F2
-(-basename)2.954 E F0 .453(option is speci\214ed\) e)2.954 F .453
-(xists in $TMPDIR then a)-.15 F(ne)144 268.8 Q 3.705(wi)-.25 G 1.205
-(mage is not created.)-3.705 F 2.805 -.8(To o)6.205 H -.15(ve).65 G
-1.205(rride this either remo).15 F 1.505 -.15(ve t)-.15 H 1.205
-(he .tif \214le or specify the \255ne).15 F(wimage)-.25 E(option.)144
-280.8 Q F2(type|\214le)144 304.8 Q F0 .781
-(is the type used in the \255G option of mbm_grdtif)3.282 F .781
-(f\(1\) or the name of a TIFF \214le that you)-.25 F(wish draped o)144
-316.8 Q -.15(ve)-.15 G 2.5(rt).15 G(he bath)-2.5 E(ymetry)-.05 E(.)-.65
-E .225(The def)144 340.8 R .225(ault type v)-.1 F .225(alue is 2 for sy\
-nthetic illumination with Haxby color map \(this may be modi\214ed)-.25
-F .206(with the)144 352.8 R F1(\255pallette)2.706 E F0 .206
-(option\). Use 5 to shade the image by slope v)2.706 F 2.705(alue. If)
--.25 F .205(<type|\214le> is an image \214le)2.705 F .335(name then tha\
-t \214le is assumed to be orthorecti\214ed TIFF image \(ending in .tif\
-\) that is co-re)144 364.8 R(gistered)-.15 E .469(with the bath)144
-376.8 R .469(ymetry \214le.)-.05 F .469(This can be used to for e)5.469
-F .469(xample drape a side-scan sonar image o)-.15 F -.15(ve)-.15 G
-2.968(rt).15 G(he)-2.968 E(ele)144 388.8 Q -.25(va)-.25 G .705
-(tion data.).25 F .706(It is up to the user to con\214rm the co-re)5.705
-F .706(gistration between the terrain data and the)-.15 F(image data.)
-144 400.8 Q F1(\255white)108 429.6 Q F0 .394(By def)144 441.6 R .394
-(ault a black background is generated for the orthorecti\214ed image.)
--.1 F .394(If a white background is)5.394 F .994(desired \(for e)144
-453.6 R .995(xample, for printing purposes\) then use this option.)-.15
-F -.8(Ty)5.995 G(pically).8 E 3.495(,f)-.65 G .995(or computer visual)
--3.495 F(display a black background w)144 465.6 Q(orks best.)-.1 E F1
-(\255zmax)108 494.4 Q F2(maxclip)7.53 E F1(\255zmin)108 511.2 Q F2
-(minclip)9.19 E F0 .001(Maxclip and minclip may be used clip the ele)144
-535.2 R -.25(va)-.25 G .001(tion data at set v).25 F 2.5(alues. F)-.25 F
-(or instance, to clip the ele-)-.15 E -.25(va)144 547.2 S .042
-(tion data at seale).25 F -.15(ve)-.25 G 2.542(la).15 G .043
-(nd tile only bath)-2.542 F .043(ymetry use)-.05 F F1 .043(\255zmax 0)
-2.543 F F0 5.043(.T)C 2.543(of)-5.843 G .043
-(orce a color map of the standard)-2.543 F
-(Haxby colors between 4000 and 3000 meters depth use)144 559.2 Q F1
-(\255zmin \2554000 \255zmax \2553000)2.5 E F0(.)A F1(\255pallette)108
-588 Q F2(pal)144 600 Q F0 .473(The number of Color Lookup T)144 624 R
-.472(able that is passed on to the \255W1/ option of mbm_grdtif)-.8 F
-2.972(f\(1\). The)-.25 F(def)144 636 Q(ault v)-.1 E
-(alue is 1 \255 the Haxby color map.)-.25 E -.15(Fo)5 G 2.5(rr).15 G
-(eference, the color tables v)-2.5 E(alues are:)-.25 E F2(pallette)164
-648 Q F0 2.5(=1)2.5 G 12.5(:H)-2.5 G(axby colors [def)-12.5 E(ault])-.1
-E F2(pallette)164 660 Q F0 2.5(=2)2.5 G 12.5(:h)-2.5 G
-(igh Intensity colors)-12.5 E F2(pallette)164 672 Q F0 2.5(=3)2.5 G 12.5
-(:l)-2.5 G .5 -.25(ow I)-12.5 H(ntensity colors).25 E F2(pallette)164
-684 Q F0 2.5(=4)2.5 G 12.5(:g)-2.5 G(rayscale)-12.5 E F2(pallette)164
-696 Q F0 2.5(=5)2.5 G 12.5(:u)-2.5 G(niform grayscale)-12.5 E
-(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(3)204.835 E 0
-Cg EP
-%%Page: 4 4
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mbm_grd2geo)72 48 Q 111.1(vrml\(1\) MB-System)
--.15 F 111.1(5.0 mbm_grd2geo)2.5 F(vrml\(1\))-.15 E/F1 10.95
-/Times-Bold at 0 SF(ENVIR)72 84 Q(ONMENT V)-.329 E(ARIABLE AND LOG FILE)
--1.478 E F0 6.845(The en)108 96 R 6.845(vironment v)-.4 F 6.845
-(ariable TMPDIR must be de\214ned.)-.25 F 6.845
-(It speci\214es the directory in which)11.845 F/F2 10/Times-Bold at 0 SF
-(mbm_grd2geo)108 108 Q(vrml)-.1 E F0 .363(does its w)2.863 F 2.862
-(ork. $TMPDIR)-.1 F .362(should ha)2.862 F .662 -.15(ve s)-.2 H(uf).15 E
-.362(\214cient space to hold the temporary grid and)-.25 F .293
-(image \214les that get created.)108 120 R .293
-(The resulting 4 times magni\214ed tif)5.293 F 2.794(fi)-.25 G .294
-(mages are left in $TMPDIR.)-2.794 F .294(These lar)5.294 F(ge)-.18 E
-(image \214les are reused unless the)108 132 Q F2(\255newimage)2.5 E F0
-(option is speci\214ed.)2.5 E 3.222(Al)108 156 S .721(og \214le is sa)
--3.222 F -.15(ve)-.2 G 3.221(da).15 G 3.221(tt)-3.221 G .721
-(he end of processing in the)-3.221 F/F3 10/Times-Italic at 0 SF(vrmlpar)
-3.221 E(ent)-.37 E F0(directory)3.221 E 5.721(.I)-.65 G 3.221(ti)-5.721
-G .721(ncludes all the commands and)-3.221 F(their output.)108 168 Q
-(This \214le may be edited and e)5 E -.15(xe)-.15 G(cuted ag).15 E
-(ain in order to produce customized output.)-.05 E F1(EXAMPLES)72 196.8
-Q F0 1.106(This e)108 208.8 R 1.106
-(xample creates a GeoVRML set of terrain tiles from the bath)-.15 F
-1.106(ymetry data in \214le P)-.05 F(apauA_bath.grd.)-.15 E
-(The geometry \214les will not be compressed and vie)108 220.8 Q
-(wpoints will be included with each tile.)-.25 E(mbm_grd2geo)113 244.8 Q
-(vrml P)-.15 E(apauA_bath \\)-.15 E(\255olat 21 \255olon \255157 \\)118
-256.8 Q(\255tvdir ~/T)118 268.8 Q(ileSets/Pyramids/ha)-.35 E -.1(wa)-.15
-G(ii \\).1 E(\255vrmldir ~/T)118 280.8 Q(ileSets/geoVRML/ha)-.35 E -.1
-(wa)-.15 G(ii \\).1 E(\255no)118 292.8 Q(wrz \255vrmlurl \\)-.25 E
-(http://menard/vrml/terrain/ha)118 304.8 Q -.1(wa)-.15 G(ii/P).1 E
-(apauA_bath)-.15 E .059(This e)108 340.8 R .058
-(xample creates a grid \214le of the Northeast P)-.15 F .058
-(aci\214c at one minute resolution and creates the GeoVRML)-.15 F .074
-(tiles of it with the ele)108 352.8 R -.25(va)-.25 G .074
-(tions clipped at sea le).25 F -.15(ve)-.25 G 2.574(l. A).15 F(ne)2.574
-E 2.574(ws)-.25 G .074(ynthetic illuminated Haxby-colored image is gen-)
--2.574 F(erated from the ele)108 364.8 Q -.25(va)-.25 G(tion data.).25 E
-2.5(#E)113 388.8 S(xtract 1 minute data for Northeastern P)-2.5 E
-(aci\214c Ocean)-.15 E 2.5(#a)113 400.8 S(nd con)-2.5 E -.15(ve)-.4 G
-(rt it to GeoVRML terrain).15 E(#)113 412.8 Q
-(grdraster 4 \255R-165/-105/15/50\\)113 424.8 Q(\255GNEP)128 436.8 Q
-(aci\214c.grd \\)-.15 E(\255I1m \255V)128 448.8 Q(mbm_grd2geo)113 472.8
-Q(vrml NEP)-.15 E(aci\214c.grd \\)-.15 E(\255tvdir ~/T)118 484.8 Q
-(ileSets/Pyramids/paci\214c \\)-.35 E(\255vrmldir ~/T)118 496.8 Q 2.5
-(ileSets/geoVRML/paci\214c \\)-.35 F(\255vrmlurl \\)118 508.8 Q
-(http://menard/vrml/terrain/ha)118 520.8 Q -.1(wa)-.15 G(ii/NEP).1 E
-(aci\214c \\)-.15 E(\255zmax 0 \255olat 35 \255olon \255135 \255ne)118
-532.8 Q(wimage)-.25 E .537(This e)108 568.8 R .537
-(xample generates a slope-shaded image from the bath)-.15 F .536
-(ymetry data in P)-.05 F .536(apauA_bath.grd and sa)-.15 F -.15(ve)-.2 G
-3.036(st).15 G(he)-3.036 E(geoVRML \214le in the directory ~/T)108 580.8
-Q(ileSets/geoVRML/ha)-.35 E -.1(wa)-.15 G(ii/P).1 E 2.5(apauA_slope. No)
--.15 F(vie)2.5 E(wpoints are speci\214ed.)-.25 E(mbm_grd2geo)113 616.8 Q
-(vrml P)-.15 E(apauA_bath \\)-.15 E(\255olat 21 \255olon \255157 \\)123
-628.8 Q(\255tvdir ~/T)123 640.8 Q(ileSets/Pyramids/ha)-.35 E -.1(wa)-.15
-G(ii \\).1 E(\255vrmldir ~/T)123 652.8 Q(ileSets/geoVRML/ha)-.35 E -.1
-(wa)-.15 G(ii \\).1 E(\255vrmlurl \\)123 664.8 Q
-(http://menard/vrml/terrain/ha)123 676.8 Q -.1(wa)-.15 G(ii/P).1 E
-(apauA_slope \\)-.15 E(\255no)123 688.8 Q(vie)-.15 E 2.5(w\\)-.25 G
-(\255ne)123 700.8 Q(wimage 5 \\)-.25 E(\255basename P)123 712.8 Q
-(apauA_slope)-.15 E(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)
--2.5 E(4)204.835 E 0 Cg EP
-%%Page: 5 5
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mbm_grd2geo)72 48 Q 111.1(vrml\(1\) MB-System)
--.15 F 111.1(5.0 mbm_grd2geo)2.5 F(vrml\(1\))-.15 E .891(This e)108 84 R
-.891
-(xample uses a pre-generated side-scan sonar TIFF image and drapes it o)
--.15 F -.15(ve)-.15 G 3.392(rt).15 G .892(he bath)-3.392 F .892
-(ymetry data in)-.05 F -.15(Pa)108 96 S 20.408(pauA_bath.grd. V).15 F
-(ie)-.6 E 17.908(wpoints are e)-.25 F 20.408(xcluded. Ouptut)-.15 F
-17.907(is written to ~/T)20.407 F(ile-)-.35 E(Sets/geoVRML/ha)108 108 Q
--.1(wa)-.15 G(ii/P).1 E(apauA_ssdtl.)-.15 E(mbm_grd2geo)113 144 Q
-(vrml P)-.15 E(apauA_bath \\)-.15 E(\255olat 21 \255olon \255157 \\)123
-156 Q(\255tvdir ~/T)123 168 Q(ileSets/Pyramids/ha)-.35 E -.1(wa)-.15 G
-(ii \\).1 E(\255vrmldir ~/T)123 180 Q(ileSets/geoVRML/ha)-.35 E -.1(wa)
--.15 G(ii \\).1 E(\255vrmlurl \\)123 192 Q
-(http://menard/vrml/terrain/ha)123 204 Q -.1(wa)-.15 G(ii/P).1 E
-(apauA_ssdtl \\)-.15 E(\255no)123 216 Q(vie)-.15 E 2.5(w\\)-.25 G
-(\255ne)123 228 Q(wimage P)-.25 E(apauA_ssdtl.tif \\)-.15 E
-(\255basename P)123 240 Q(apauA_ssdtl)-.15 E/F1 10.95/Times-Bold at 0 SF
-(SEE ALSO)72 304.8 Q F0 2.108(This macro is b)108 316.8 R 2.108
-(uilt upon some pretty strong shoulders.)-.2 F 2.108
-(It uses all of these programs which must be)7.108 F
-(installed on your system.)108 328.8 Q 3.383(GMT programs:)108 352.8 R
-/F2 10/Times-Bold at 0 SF(grdclip)5.883 E F0(\(1\),)A F2(grdsample)5.883 E
-F0(\(1\),)A F2(grd2xyz)5.883 E F0(\(1\),)A F2(blockmean)5.882 E F0
-(\(1\),)A F2(surface)5.882 E F0(\(1\),)A F2(grdedit)5.882 E F0(\(1\),)A
-F2(grd-)5.882 E(math)108 364.8 Q F0(\(1\),)A F2(grdclip)2.5 E F0(\(1\),)
-A(mb-system macro:)108 388.8 Q F2(mbm_grdtiff)2.5 E F0(\(1\))A
-(mb-system utility:)108 412.8 Q F2(mbstripNaN)2.5 E F0(\(1\))A
-(tsmApi-2.3 \(http://www)108 436.8 Q(.tsmapi.com\) programs:)-.65 E F2
-(mak)2.5 E(e_dem)-.1 E F0(\(1\),)A F2(mak)2.5 E(e_oi)-.1 E F0(\(1\))A F2
-(mak)2.5 E(e_geo)-.1 E(vrml)-.1 E F0(\(1\))A 1.119(Note that after you')
-108 460.8 R 1.419 -.15(ve c)-.5 H 1.119(reated the T).15 F(erraV)-.7 E
-1.12(ision tile sets with this macro you may rerun mak)-.6 F(e_geo)-.1 E
-(vrml\(1\))-.15 E .398(with dif)108 472.8 R .397
-(ferent options, for instance to mak)-.25 F 2.897<658c>-.1 G .397
-(les for a dif)-2.897 F .397(ferent serv)-.25 F .397(er or with a dif)
--.15 F .397(ferent v)-.25 F .397(ertical e)-.15 F(xaggera-)-.15 E .254
-(tion or background color)108 484.8 R 5.254(.T)-.55 G .254(his can sa)
--5.254 F .554 -.15(ve a l)-.2 H .254(ot of processing time if you don')
-.15 F 2.754(tn)-.18 G .254(eed to generate a ne)-2.754 F 2.754(wi)-.25 G
-(mage)-2.754 E(from the bath)108 496.8 Q(ymetric data.)-.05 E
-(ImageMagick \(http://www)108 520.8 Q(.imagemagick.or)-.65 E
-(g\) program:)-.18 E F2(mogrify)2.5 E F0(\(1\))A .413
-(Please see http://www)108 544.8 R(.mbari.or)-.65 E(g/~mccann/vrml/R)
--.18 E -.5(OV)-.4 G(DataV).5 E .412(is for e)-.6 F .412
-(xample content and more information on)-.15 F(the project that de)108
-556.8 Q -.15(ve)-.25 G(loped this macro.).15 E F1 -.11(BU)72 573.6 S(GS)
-.11 E F0 -1.1(Yo)108 585.6 S 2.5(un)1.1 G
-(eed to manually clean up the lefto)-2.5 E -.15(ve)-.15 G 2.5<728c>.15 G
-(les that get created in $TMPDIR.)-2.5 E(The)108 609.6 Q F2(\255vrmlurl)
-2.66 E F0 .16(option must be speci\214ed.)2.66 F .16
-(As of 19 March 2003 there is a b)5.16 F .16(ug in)-.2 F F2(mak)2.66 E
-(e_geo)-.1 E(vrml)-.1 E F0 .16(\(1\) where if)B(the)108 621.6 Q F2
-(\255vrmlurl)2.538 E F0 2.538(option is)2.538 F .038(not speci\214ed in)
-2.538 F -.25(va)-.4 G .038(lid VRML is generated.).25 F .037
-(This is generally not a problem.)5.037 F(Because)5.037 E(of b)108 633.6
-Q(ugs in VRML bro)-.2 E(wsers all URLs must be absolute an)-.25 E(yw)
--.15 E(ay)-.1 E(.)-.65 E .802
-(The GeoVRML content produced by this macro may be vie)108 657.6 R .803
-(wed using Internet Explorer with the Cortona)-.25 F 1.268
-(4.0 VRML plugin or in Netscape 4.7 with the CosmoPlayer plugin.)108
-669.6 R 1.267(Both bro)6.267 F 1.267(wsers ha)-.25 F 1.567 -.15(ve p)-.2
-H 1.267(roblems with).15 F 1.002(loading a second w)108 681.6 R 1.002
-(orld after you ha)-.1 F 1.302 -.15(ve v)-.2 H(ie).15 E 1.002(wed one.)
--.25 F 1.002(Netscape 4.7 often must be closed by killing it with)6.002
-F -.4(Wi)108 693.6 S(ndo).4 E .461(ws T)-.25 F .461(ask Manager)-.8 F
-5.461(.S)-.55 G .461
-(ometimes the CosmoPlayer plugin will refuse to load at all.)-5.461 F
-.46(If this happens try)5.46 F(remo)108 705.6 Q .427
-(ving all cp* \214les in %TEMP% or logging in with another W)-.15 F
-(indo)-.4 E .427(ws account so that a dif)-.25 F .428(ferent pro\214le)
--.25 F(is used.)108 717.6 Q(MB-System 5.0)72 768 Q 2.5(3J)146.495 G
-(une 2013)-2.5 E(5)204.835 E 0 Cg EP
-%%Trailer
-end
-%%EOF
diff --git a/src/ps/mbm_grd3dplot.ps b/src/ps/mbm_grd3dplot.ps
deleted file mode 100644
index 35ed2a8..0000000
--- a/src/ps/mbm_grd3dplot.ps
+++ /dev/null
@@ -1,1181 +0,0 @@
-%!PS-Adobe-3.0
-%%Creator: groff version 1.19.2
-%%CreationDate: Wed Jul  1 12:29:28 2015
-%%DocumentNeededResources: font Times-Roman
-%%+ font Times-Bold
-%%+ font Times-Italic
-%%DocumentSuppliedResources: procset grops 1.19 2
-%%Pages: 12
-%%PageOrder: Ascend
-%%DocumentMedia: Default 612 792 0 () ()
-%%Orientation: Portrait
-%%EndComments
-%%BeginDefaults
-%%PageMedia: Default
-%%EndDefaults
-%%BeginProlog
-%%BeginResource: procset grops 1.19 2
-%!PS-Adobe-3.0 Resource-ProcSet
-/setpacking where{
-pop
-currentpacking
-true setpacking
-}if
-/grops 120 dict dup begin
-/SC 32 def
-/A/show load def
-/B{0 SC 3 -1 roll widthshow}bind def
-/C{0 exch ashow}bind def
-/D{0 exch 0 SC 5 2 roll awidthshow}bind def
-/E{0 rmoveto show}bind def
-/F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def
-/G{0 rmoveto 0 exch ashow}bind def
-/H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/I{0 exch rmoveto show}bind def
-/J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def
-/K{0 exch rmoveto 0 exch ashow}bind def
-/L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/M{rmoveto show}bind def
-/N{rmoveto 0 SC 3 -1 roll widthshow}bind def
-/O{rmoveto 0 exch ashow}bind def
-/P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/Q{moveto show}bind def
-/R{moveto 0 SC 3 -1 roll widthshow}bind def
-/S{moveto 0 exch ashow}bind def
-/T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/SF{
-findfont exch
-[exch dup 0 exch 0 exch neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/MF{
-findfont
-[5 2 roll
-0 3 1 roll
-neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/level0 0 def
-/RES 0 def
-/PL 0 def
-/LS 0 def
-/MANUAL{
-statusdict begin/manualfeed true store end
-}bind def
-/PLG{
-gsave newpath clippath pathbbox grestore
-exch pop add exch pop
-}bind def
-/BP{
-/level0 save def
-1 setlinecap
-1 setlinejoin
-72 RES div dup scale
-LS{
-90 rotate
-}{
-0 PL translate
-}ifelse
-1 -1 scale
-}bind def
-/EP{
-level0 restore
-showpage
-}def
-/DA{
-newpath arcn stroke
-}bind def
-/SN{
-transform
-.25 sub exch .25 sub exch
-round .25 add exch round .25 add exch
-itransform
-}bind def
-/DL{
-SN
-moveto
-SN
-lineto stroke
-}bind def
-/DC{
-newpath 0 360 arc closepath
-}bind def
-/TM matrix def
-/DE{
-TM currentmatrix pop
-translate scale newpath 0 0 .5 0 360 arc closepath
-TM setmatrix
-}bind def
-/RC/rcurveto load def
-/RL/rlineto load def
-/ST/stroke load def
-/MT/moveto load def
-/CL/closepath load def
-/Fr{
-setrgbcolor fill
-}bind def
-/setcmykcolor where{
-pop
-/Fk{
-setcmykcolor fill
-}bind def
-}if
-/Fg{
-setgray fill
-}bind def
-/FL/fill load def
-/LW/setlinewidth load def
-/Cr/setrgbcolor load def
-/setcmykcolor where{
-pop
-/Ck/setcmykcolor load def
-}if
-/Cg/setgray load def
-/RE{
-findfont
-dup maxlength 1 index/FontName known not{1 add}if dict begin
-{
-1 index/FID ne{def}{pop pop}ifelse
-}forall
-/Encoding exch def
-dup/FontName exch def
-currentdict end definefont pop
-}bind def
-/DEFS 0 def
-/EBEGIN{
-moveto
-DEFS begin
-}bind def
-/EEND/end load def
-/CNT 0 def
-/level1 0 def
-/PBEGIN{
-/level1 save def
-translate
-div 3 1 roll div exch scale
-neg exch neg exch translate
-0 setgray
-0 setlinecap
-1 setlinewidth
-0 setlinejoin
-10 setmiterlimit
-[]0 setdash
-/setstrokeadjust where{
-pop
-false setstrokeadjust
-}if
-/setoverprint where{
-pop
-false setoverprint
-}if
-newpath
-/CNT countdictstack def
-userdict begin
-/showpage{}def
-/setpagedevice{}def
-}bind def
-/PEND{
-countdictstack CNT sub{end}repeat
-level1 restore
-}bind def
-end def
-/setpacking where{
-pop
-setpacking
-}if
-%%EndResource
-%%EndProlog
-%%BeginSetup
-%%BeginFeature: *PageSize Default
-<< /PageSize [ 612 792 ] /ImagingBBox null >> setpagedevice
-%%EndFeature
-%%IncludeResource: font Times-Roman
-%%IncludeResource: font Times-Bold
-%%IncludeResource: font Times-Italic
-grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72
-def/PL 792 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron/Zcaron
-/scaron/zcaron/Ydieresis/trademark/quotesingle/Euro/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/space/exclam/quotedbl/numbersign/dollar/percent
-/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen
-/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon
-/semicolon/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O
-/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright/circumflex
-/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y
-/z/braceleft/bar/braceright/tilde/.notdef/quotesinglbase/guillemotleft
-/guillemotright/bullet/florin/fraction/perthousand/dagger/daggerdbl
-/endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut
-/dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash
-/quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen
-/brokenbar/section/dieresis/copyright/ordfeminine/guilsinglleft
-/logicalnot/minus/registered/macron/degree/plusminus/twosuperior
-/threesuperior/acute/mu/paragraph/periodcentered/cedilla/onesuperior
-/ordmasculine/guilsinglright/onequarter/onehalf/threequarters
-/questiondown/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE
-/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex
-/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis
-/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn
-/germandbls/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla
-/egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis
-/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide/oslash
-/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis]def
-/Times-Italic at 0 ENC0/Times-Italic RE/Times-Bold at 0 ENC0/Times-Bold RE
-/Times-Roman at 0 ENC0/Times-Roman RE
-%%EndSetup
-%%Page: 1 1
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 123.72(mbm_grd3dplot\(1\) MB-System)72 48 R
-123.72(5.0 mbm_grd3dplot\(1\))2.5 F/F1 10.95/Times-Bold at 0 SF -.219(NA)72
-84 S(ME).219 E/F2 10/Times-Bold at 0 SF(mbm_grd3dplot)108 96 Q F0 4.002
-<ad43>4.002 G 1.502(reate an e)-4.002 F -.15(xe)-.15 G 1.501
-(cutable shellscript which will generate a GMT 3D perspecti).15 F 1.801
--.15(ve p)-.25 H 1.501(lot of).15 F(gridded data in a GMT grd \214le.)
-108 108 Q F1(VERSION)72 136.8 Q F0 -1.11(Ve)108 148.8 S(rsion 5.0)1.11 E
-F1(SYNOPSIS)72 177.6 Q F2 3(mbm_grd3dplot \255I)108 189.6 R/F3 10
-/Times-Italic at 0 SF(\214le)A F0([)5.5 E F2<ad41>A F0([)A F3(ma)A(gnitude)
--.1 E F0([)A F3(/azimuth/ele)A(vation)-.15 E F0(])A F2<ad44>5.5 E F0([)A
-F3(\215ipcolor/\215ipshade)A F0(])A F2<ad45>5.5 E F0([)A F3(vie)A
-(w_az/vie)-.15 E(w_el)-.15 E F0(])A F2<ad46>108 201.6 Q F3 -.2(ex)C -.1
-(agge).2 G -.15(ra).1 G(tion).15 E F2<ad47>4.775 E F3(color_mode)A F2
-2.274<ad4820ad4b>4.775 F F3(intensity_\214le)A F2<ad4e>4.774 E F3(dr)A
-(ape_\214le)-.15 E F2<ad4f>4.774 E F3 -.45(ro)C(ot).45 E F2<ad50>4.774 E
-F3(pa)A -.1(ge)-.1 G(size).1 E F2<ad53>4.774 E F3([color/shade])A F2
-<ad55>108 213.6 Q F3(orientation)A F2<ad5620ad57>2.5 E F0([)A F3
-(color_style)A F0([)A F3(/palette)A F0([)A F3(ncolor)A(s)-.1 E F0(]] |)A
-F3(cpt\214le)2.5 E F0 2.5(]])C(Additional Options:)108 237.6 Q([)108
-249.6 Q F2<ad42>A F3(tic)A(kinfo)-.2 E F2<ad4a>2.5 E F3(pr)A(ojection)
--.45 E F0([)A F3(/scale | width)A F0(])A F2<ad4c>2.5 E F3(title)A F0([)A
-F3(:scale_label)A F0(])A F2<ad4d>2.5 E F3(misc)A F2<ad5120ad52>2.5 E F3
-(w/e/s/n)A F2<ad5820ad5920ad5a>2.5 E F3(min/max)A F0(])2.5 E
-(Miscellaneous Options:)108 273.6 Q([)108 285.6 Q F2(\255MGD)A F3
-(gmtdef/value)A F2(\255MGF)16.01 E F3(scale_loc)A F2(\255MGL)13.51 E F0
-([)A F3(f)A F0(][)A F3(x)A F0(])A F3(lon0/lat0/slat/length)A F0([)A F3
-(units)A F0(][)A F3(+llabel)A F0(])A F2(\255MGQ)13.51 E F3(dpi)A F2
-(\255MGS)108 297.6 Q F3(scalefactor)A F2(\255MGT)19.997 E F3
-(x/y/size/angle/font/just/te)A(xt)-.2 E F2(\255MGU[)19.997 E F3(/dx/dy/)
-A F2(][)A F3(label)A F2 19.996<5dad>C(MVM)-19.996 E F3(mesh_pen)A F2
-(\255MVN[)108 309.6 Q F3(null[/r/g/b])A F2 2.5(]])C F1(DESCRIPTION)72
-338.4 Q F2(mbm_grd3dplot)108 350.4 Q F0 .042
-(is a macro to generate a shellscript of GMT commands which, when e)
-2.542 F -.15(xe)-.15 G .042(cuted, will gener).15 F(-)-.2 E 1.274
-(ate a 3D perspecti)108 362.4 R 1.573 -.15(ve P)-.25 H 1.273
-(ostscript plot of gridded data.).15 F(Se)6.273 E -.15(ve)-.25 G 1.273
-(ral styles of plots can be generated, including).15 F .098
-(color \214ll vie)108 374.4 R .099(ws, color shaded relief vie)-.25 F
-.099(ws, mesh plot vie)-.25 F .099(ws, and te)-.25 F .099(xt labels. Fi)
--.15 F .399 -.15(ve d)-.25 H(if).15 E .099(ferent color schemes are)-.25
-F .858(included. The plot will be scaled to \214t on the speci\214ed pa\
-ge size or)108 386.4 R 3.358(,i)-.4 G 3.358(ft)-3.358 G .858
-(he scale is user de\214ned, the page)-3.358 F .778
-(size will be chosen in accordance with the plot size. The v)108 398.4 R
-.778(ertical e)-.15 F .779(xaggeration may be speci\214ed. The pri-)-.15
-F .331(mary purpose of this macro is to allo)108 410.4 R 2.831(wt)-.25 G
-.33(he simple, semi-automated production of nice looking maps with a)
--2.831 F(fe)108 422.4 Q 3.033(wc)-.25 G .533(ommand line ar)-3.033 F
-.533(guments. F)-.18 F .533(or users seeking more control o)-.15 F -.15
-(ve)-.15 G 3.033(rt).15 G .533(he plot appearance, a number of addi-)
--3.033 F .872(tional optional ar)108 434.4 R .872(guments are pro)-.18 F
-.872(vided. T)-.15 F .871
-(ruly ambitious users may edit the plot shellscript to tak)-.35 F 3.371
-(ea)-.1 G(dv)-3.371 E(an-)-.25 E
-(tage of GMT capabilities not supported by this macro.)108 446.4 Q .083
-(By def)108 470.4 R .083
-(ault the output plot generation shellscript includes lines which e)-.1
-F -.15(xe)-.15 G .083(cute a program to display the Post-).15 F .807(sc\
-ript image on the screen. The program to be used to display the Postscr\
-ipt is set using)108 482.4 R F2(mbdefaults)3.307 E F0 3.307(;t)C(he)
--3.307 E(def)108 494.4 Q .325(ault v)-.1 F .325(alue can be o)-.25 F
--.15(ve)-.15 G .325(rridden by setting the en).15 F .326(vironment v)-.4
-F .326(ariable $MB_PS_VIEWER.)-.25 F(In)5.326 E -.2(vo)-.4 G .326
-(king the plot).2 F(generation shellscript with a)108 506.4 Q F2(-N)2.5
-E F0(command line ar)2.5 E
-(gument suppresses the screen display of the plot.)-.18 E .305
-(The plot scripts generated by this macro will w)108 530.4 R .305
-(ork with GMT v)-.1 F .305(ersion 5.0 and later)-.15 F 2.805(,a)-.4 G
-.305(nd are not compatible)-2.805 F(with earlier v)108 542.4 Q
-(ersions of GMT)-.15 E(.)-.74 E F1 -.548(AU)72 571.2 S(THORSHIP).548 E
-F0(Da)108 583.2 Q(vid W)-.2 E 2.5(.C)-.92 G(aress \(caress at mbari.or)-2.5
-E(g\))-.18 E(Montere)113 595.2 Q 2.5(yB)-.15 G
-(ay Aquarium Research Institute)-2.5 E
-(Dale N. Chayes \(dale at ldeo.columbia.edu\))108 607.2 Q
-(Lamont-Doherty Earth Observ)113 619.2 Q(atory)-.25 E F1
-(SIMPLE DESCRIPTION OF B)72 648 Q(ASIC OPTIONS)-.329 E F2<ad41>108 660 Q
-F3(ma)23.08 E(gnitude[/azimuth/ele)-.1 E(vation])-.15 E F0 1.15(Sets th\
-e parameters which control the synthetic illumination of the gridded da\
-ta \(shaded relief\).)144 672 R .051(The v)144 684 R(alue)-.25 E F3(ma)
-2.551 E(gnitude)-.1 E F0 .051(is an ef)2.551 F(fecti)-.25 E .351 -.15
-(ve ve)-.25 H .051(rtical e).15 F .05
-(xageration which modulates the intensity of the shad-)-.15 F .881
-(ing; typical v)144 696 R .881(alues are in the 0.1 to 10 range.)-.25 F
-.882(The v)5.882 F(alue)-.25 E F3(azimuth)3.382 E F0 .882
-(is the azimuth in de)3.382 F .882(grees from)-.15 F .629
-(north from which the data is illuminated.)144 708 R .629(The v)5.629 F
-(alue)-.25 E F3(ele)3.129 E(vation)-.15 E F0 .628(is the ele)3.129 F
--.25(va)-.25 G .628(tion of the illumination).25 F(in de)144 720 Q
-(grees from horizontal.)-.15 E(Def)5 E(aults:)-.1 E F3(ma)2.5 E(gnitude)
--.1 E F0 2.5(=0)2.5 G(.2;)-2.5 E F3(azimuth)2.5 E F0 2.5(=0)2.5 G(.0;)
--2.5 E F3(ele)2.5 E(vation)-.15 E F0 2.5(=3)2.5 G(0.0;)-2.5 E
-(MB-System 5.0)72 768 Q 2.5(9J)140.11 G(anuary 2015)-2.5 E(1)198.45 E 0
-Cg EP
-%%Page: 2 2
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 123.72(mbm_grd3dplot\(1\) MB-System)72 48 R
-123.72(5.0 mbm_grd3dplot\(1\))2.5 F/F1 10/Times-Bold at 0 SF<ad44>108 84 Q
-/F2 10/Times-Italic at 0 SF([\215ipcolor/\215ipshade])23.08 E F0(Normally)
-144 96 Q 3.32(,t)-.65 G .821(he color or grayscale tables used for colo\
-r maps run from cool colors \(or dark grays\))-3.32 F 1.29(for lo)144
-108 R 3.79(wg)-.25 G 1.29(rid v)-3.79 F 1.289
-(alues to hot colors \(or light grays\) for high grid v)-.25 F 3.789
-(alues. This)-.25 F 1.289(option re)3.789 F -.15(ve)-.25 G 1.289
-(rses the).15 F .028
-(color table so that cool colors \(dark grays\) correspond to high v)144
-120 R .029(alues and hot colors \(light grays\) to)-.25 F(lo)144 132 Q
-3.955(wv)-.25 G 3.955(alues. If)-4.205 F F1<ad44>3.955 E F0 1.454(is gi)
-3.955 F -.15(ve)-.25 G 3.954(na).15 G 1.454(lone, it applies to the col\
-or table used for color or gray \214ll plots,)-3.954 F .216
-(shaded or unshaded. If the plot is to be shaded,)144 144 R .216
-(either by synthetic illumination \()5.216 F F1<ad47>A F2(2)A F0 2.716
-(\)o)C 2.716(ru)-2.716 G .216(sing an)-2.716 F .022(intensity \214le \()
-144 156 R F1<ad4b>A F0(and)2.522 E F1<ad47>2.522 E F2(3)A F0 .022
-(options\), then setting)2.522 F F2(\215ipshade)2.522 E F0 2.522(=1w)
-2.522 G .022(ill cause the shading con)-2.522 F -.15(ve)-.4 G .021
-(ntion to).15 F .087(be re)144 168 R -.15(ve)-.25 G .087
-(rsed \(e.g. high intensities o).15 F -.15(ve)-.15 G .087
-(rlaid as light shading\).).15 F(Using)5.087 E F1<ad44>2.587 E F2(0/1)A
-F0 .088(will \215ip the shading con-)2.588 F -.15(ve)144 180 S(ntion b)
-.15 E(ut lea)-.2 E .3 -.15(ve t)-.2 H(he def).15 E(ault color con)-.1 E
--.15(ve)-.4 G(ntion.).15 E F1<ad45>108 196.8 Q F0([)23.63 E F2(vie)A
-(w_az/vie)-.15 E(w_el)-.15 E F0(])A .462(Sets the azimuth and ele)144
-208.8 R -.25(va)-.25 G .462(tion in de).25 F .462(grees of the vie)-.15
-F .462(wpoint for 3D perspecti)-.25 F .762 -.15(ve v)-.25 H(ie).15 E
-2.962(ws. An)-.25 F F2(vie)2.962 E(w_az)-.15 E F0 1.526
-(of 0 represents a vie)144 220.8 R 4.026(wf)-.25 G 1.527
-(rom the north, and)-4.026 F F2(vie)4.027 E(w_az)-.15 E F0 4.027(=9)
-4.027 G 4.027(0r)-4.027 G 1.527(epresents a vie)-4.027 F 4.027(wf)-.25 G
-1.527(rom the east.)-4.027 F(An)6.527 E F2(vie)144 232.8 Q(w_el)-.15 E
-F0(of 0 represents a horizontal vie)2.5 E 3.8 -.65(w. D)-.25 H(ef).65 E
-(ault:)-.1 E F2(vie)2.5 E(w_az)-.15 E F0 2.5(=2)2.5 G(00.; ele)-2.5 E
--.25(va)-.25 G(tion = 40.).25 E F1<ad46>108 249.6 Q F0([)24.19 E F2 -.2
-(ex)C -.1(agge).2 G -.15(ra).1 G(tion).15 E F0(])A .513(Sets the v)144
-261.6 R .513(ertical e)-.15 F .513(xaggeration of the perspecti)-.15 F
-.813 -.15(ve p)-.25 H 3.013(lot. By).15 F(def)3.013 E .513(ault the v)
--.1 F .513(ertical e)-.15 F .512(xaggeration is cho-)-.15 F .966
-(sen so that the plot \214ts nicely on the page. This option w)144 273.6
-R .967(orks only if the data are in geographic)-.1 F
-(coordinates \(longitude and latitude\).)144 285.6 Q F1<ad47>108 302.4 Q
-F2(color_mode)22.52 E F0 -.45(Tu)144 314.4 S
-(rns on color \214ll plot and sets the style of the plot.).45 E F2
-(color_mode)164 326.4 Q F0 2.5(=1)2.5 G 2.5(:3)-2.5 G 2.5(Dc)-2.5 G
-(olor/gray \214ll.)-2.5 E F2(color_mode)164 338.4 Q F0 2.5(=2)2.5 G 2.5
-(:3)-2.5 G 2.5(Dc)-2.5 G(olor/gray \214ll shaded by)-2.5 E
-(synthetic illumination.)204 350.4 Q F2(color_mode)164 362.4 Q F0 2.5
-(=3)2.5 G 2.5(:3)-2.5 G 2.5(Dc)-2.5 G(olor/gray \214ll shaded by)-2.5 E
-(an intensity \214le. The)204 374.4 Q F1<ad4b>2.5 E F0
-(option must be used to specify)204 386.4 Q(the intensity \214le.)252
-398.4 Q F2(color_mode)164 410.4 Q F0 2.5(=4)2.5 G 2.5(:3)-2.5 G 2.5(DC)
--2.5 G(olor/gray \214ll of slope)-2.5 E(magnitude.)252 422.4 Q F2
-(color_mode)164 434.4 Q F0 2.5(=5)2.5 G 2.5(:3)-2.5 G 2.5(DC)-2.5 G
-(olor/gray \214ll shaded by)-2.5 E(slope magnitude.)204 446.4 Q F2
-(color_mode)164 458.4 Q F0 2.5(=6)2.5 G 2.5(:3)-2.5 G 2.5(Dm)-2.5 G
-(esh plot.)-2.5 E F2(color_mode)164 470.4 Q F0 2.5(=7)2.5 G 2.5(:3)-2.5
-G 2.5(Dm)-2.5 G(esh plot with contours.)-2.5 E F1<ad48>108 487.2 Q F0
-.162(This "help" \215ag cause the program to print out a description of\
- its operation and then e)22.52 F .161(xit immedi-)-.15 F(ately)144
-499.2 Q(.)-.65 E F1<ad49>108 516 Q F2(gr)26.41 E(d\214le)-.37 E F0 .158
-(Sets the name of the gridded data \214le to be plotted.)144 528 R
-(Alternati)5.158 E -.15(ve)-.25 G(ly).15 E(,)-.65 E F2(gr)2.659 E
-(d\214le)-.37 E F0 .159(may be a list of grid \214les)2.659 F
-(\(one \214lename on each line\) to be plotted together)144 540 Q(.)-.55
-E F1<ad4b>108 556.8 Q F2(intensity_\214le)22.52 E F0
-(Sets the name of the gridded data \214le containing instensity v)144
-568.8 Q(alues to be used for shading the map.)-.25 E F1<ad4e>108 585.6 Q
-F2(dr)23.08 E(ape_\214le)-.15 E F0 .312(Sets the name of the gridded da\
-ta \214le to be draped on the relief pro)144 597.6 R .312
-(vided by the \214le speci\214ed with)-.15 F(the)144 609.6 Q F1<ad49>
-3.156 E F0 .656(option. If)3.156 F F1<ad4e>3.156 E F2(dr)A(ape_\214le)
--.15 E F0 .657(is speci\214ed, then all color control options will appl\
-y to the data in)3.156 F(\\fIdrape_\214le)144 621.6 Q F2(.)A F1<ad4f>108
-638.4 Q F2 -.45(ro)22.52 G(ot).45 E F0 .423(Sets the root used to const\
-ruct the \214lename of the output shellscript \()144 650.4 R F2 -.45(ro)
-C(ot).45 E F0 .422(.cmd\) and names of \214les)B .156
-(created when the shellscript is run.)144 662.4 R .157
-(Normally the name of the input grid \214le or grid \214le list is used)
-5.157 F(as the)144 674.4 Q F2 -.45(ro)2.5 G(ot).45 E F0(.)A F1<ad50>108
-691.2 Q F2(pa)24.19 E -.1(ge)-.1 G(size).1 E F0 .632(This option sets t\
-he size of the page the plot will be centered on. If the user does not \
-set the plot)144 703.2 R .125(scale, the plot will be sized as lar)144
-715.2 R .125(ge as will \214t on the designated page. If the user sets \
-the plot scale)-.18 F .948
-(such that the plot will not \214t on the designated page, a lar)144
-727.2 R .948(ger page will be used.)-.18 F .947(The supported)5.947 F
-(MB-System 5.0)72 768 Q 2.5(9J)140.11 G(anuary 2015)-2.5 E(2)198.45 E 0
-Cg EP
-%%Page: 3 3
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 123.72(mbm_grd3dplot\(1\) MB-System)72 48 R
-123.72(5.0 mbm_grd3dplot\(1\))2.5 F 1.342
-(page sizes include ANSI A, B, C, D, E, F)144 84 R 3.842(,a)-.8 G 1.343
-(nd E1, as well as most metric page sizes. See the)-3.842 F 1.31
-(COMPLETE DESCRIPTION OF OPTIONS section belo)144 96 R 3.81(wf)-.25 G
-1.31(or a complete list of the supported)-3.81 F(page sizes. The def)144
-108 Q(ault page size is A.)-.1 E/F1 10/Times-Bold at 0 SF<ad53>108 124.8 Q
-/F2 10/Times-Italic at 0 SF([color/shade])24.74 E F0 1.392
-(This option enables ef)144 136.8 R(fecti)-.25 E 1.692 -.15(ve h)-.25 H
-1.392(istogram equalization of the color and/or shading of the gridded)
-.15 F .628(data. The equalization is not achie)144 148.8 R -.15(ve)-.25
-G 3.128(db).15 G 3.128(yc)-3.128 G .628(hanging the data v)-3.128 F .628
-(alues, b)-.25 F .628(ut rather by constructing the)-.2 F .518(color or\
- shading tables so that the boundaries in the tables encompass equal fr\
-actions of the data-)144 160.8 R .19(points. This serv)144 172.8 R .19
-(es to focus color or shading contrasts in v)-.15 F .19
-(alue ranges corresponding to the b)-.25 F .19(ulk of)-.2 F .837
-(the data v)144 184.8 R 3.338(alues. If)-.25 F F1<ad53>3.338 E F0 .838
-(is gi)3.338 F -.15(ve)-.25 G 3.338(na).15 G .838(lone or with)-3.338 F
-F2(color)3.338 E F0 3.338(=1)3.338 G 3.338(,i)-3.338 G 3.338(te)-3.338 G
-.838(nables equalization of the color table)-3.338 F .991
-(used for color or gray \214ll plots,)144 196.8 R .991
-(shaded or unshaded. If the plot is to be shaded,)5.991 F .991
-(either by syn-)5.991 F .637(thetic illumination \()144 208.8 R F1<ad47>
-A F2(2)A F0 3.137(\)o)C 3.137(ru)-3.137 G .637
-(sing an intensity \214le \()-3.137 F F1<ad4b>A F0(and)3.138 E F1<ad47>
-3.138 E F2(3)A F0 .638(options\), then setting)3.138 F F2(shade)3.138 E
-F0 3.138(=1)3.138 G .5(will cause the shading to be equalized.)144 220.8
-R(Using)5.5 E F1<ad53>3 E F2(0/1)A F0 .5
-(will equalize the shading without equalizing)3 F(the color table.)144
-232.8 Q F1<ad55>108 249.6 Q F2(orientation)23.08 E F0 .2(Normally the o\
-rientation of the plot \(portrait or landscape\) is selected automatica\
-lly so as to maxi-)144 261.6 R .334(mize the plot scale.)144 273.6 R
-(The)5.333 E F1<ad55>2.833 E F0 .333(option allo)2.833 F .333
-(ws the user to set the plot orientation. If)-.25 F F2(orientation)2.833
-E F0 2.833(=1)2.833 G 2.833(,a)-2.833 G
-(portrait plot will be produced; if)144 285.6 Q F2(orientation)2.5 E F0
-2.5(=2)2.5 G 2.5(,al)-2.5 G(andscape plot will be produced.)-2.5 E F1
-<ad56>108 302.4 Q F0(Causes)23.08 E F1(mbm_grd3dplot)3.693 E F0 1.193
-(to operate in "v)3.693 F 1.193
-(erbose" mode so that it outputs more information than)-.15 F(usual.)144
-314.4 Q F1<ad57>108 331.2 Q F2([color_style)20.3 E F0([)A F2(/palette)A
-F0([)A F2(ncolor)A(s)-.1 E F0(]] | cpt\214le])A
-(This option controls the color scheme used for color \214ll plots.)144
-343.2 Q(If)144 367.2 Q F2(color_style)3.136 E F0 3.136(=1[)3.136 G(def)
--3.136 E .636(ault], then the color scheme used will be a continuous gr\
-ading of colors. If)-.1 F F2(color_style)144 379.2 Q F0 2.815(=2)2.815 G
-2.815(,t)-2.815 G .315
-(he color scheme will be a set of discrete color interv)-2.815 F .316
-(als. The color palette used is)-.25 F(set using)144 391.2 Q F2(palette)
-2.5 E F0 2.5(.F)C -2.15 -.25(iv e)-2.5 H(palettes are a)2.75 E -.25(va)
--.2 G(ilable:).25 E F2(palette)180 403.2 Q F0 2.5(=1)2.5 G 26.36(:H)-2.5
-G(axby colors [def)-26.36 E(ault])-.1 E F2(palette)180 415.2 Q F0 2.5
-(=2)2.5 G 26.36(:h)-2.5 G(igh Intensity colors)-26.36 E F2(palette)180
-427.2 Q F0 2.5(=3)2.5 G 26.36(:l)-2.5 G .5 -.25(ow I)-26.36 H
-(ntensity colors).25 E F2(palette)180 439.2 Q F0 2.5(=4)2.5 G 26.36(:g)
--2.5 G(rayscale)-26.36 E F2(palette)180 451.2 Q F0 2.5(=5)2.5 G 26.36
-(:u)-2.5 G(niform grayscale)-26.36 E 4.384(Ac)144 463.2 S 1.883
-(omplete description of the color palettes is gi)-4.384 F -.15(ve)-.25 G
-4.383(ni).15 G 4.383(nt)-4.383 G 1.883(he COMPLETE DESCRIPTION OF)-4.383
-F(OPTIONS section belo)144 475.2 Q -.65(w.)-.25 G(The)144 487.2 Q F2
-(ncolor)2.606 E(s)-.1 E F0 .107(parameter sets the number of color v)
-2.606 F .107(alues used in plotting, whether the colors are rep-)-.25 F
-(resented in a continuous color scale or a stepped, discrete color scal\
-e [def)144 499.2 Q(ault is 11].)-.1 E .523(If the option ar)144 523.2 R
-.522(gument is the path to an e)-.18 F(xisting)-.15 E F1(GMT)3.022 E F0
-.522(color palette \(CPT\) \214le, then that CPT \214le)3.022 F
-(and its color scheme will be used for the plot)144 535.2 Q/F3 10.95
-/Times-Bold at 0 SF(COMPLETE DESCRIPTION OF OPTIONS)72 564 Q F1<ad41>108
-576 Q F2(ma)23.08 E(gnitude[/azimuth])-.1 E F0 1.15(Sets the parameters\
- which control the synthetic illumination of the gridded data \(shaded \
-relief\).)144 588 R .051(The v)144 600 R(alue)-.25 E F2(ma)2.551 E
-(gnitude)-.1 E F0 .051(is an ef)2.551 F(fecti)-.25 E .351 -.15(ve ve)
--.25 H .051(rtical e).15 F .05
-(xageration which modulates the intensity of the shad-)-.15 F .826
-(ing; typical v)144 612 R .826(alues are in the 0.1 to 0.5 range.)-.25 F
-.827(The v)5.827 F(alue)-.25 E F2(azimuth)3.327 E F0 .827
-(is the azimuth from which the)3.327 F(data is illuminated.)144 624 Q
-(Def)5 E(aults:)-.1 E F2(ma)2.5 E(gnitude)-.1 E F0 2.5(=0)2.5 G(.2;)-2.5
-E F2(azimuth)2.5 E F0 2.5(=0)2.5 G(.0;)-2.5 E F1<ad42>108 640.8 Q F2
-(tic)23.63 E(kinfo)-.2 E F0 .219(Sets map boundary tickmark interv)144
-652.8 R .219(als. See the)-.25 F F1(psbasemap)2.719 E F0 .218
-(manual page for details. By def)2.719 F .218(ault the)-.1 F
-(program chooses basemap annotations based on the map boundaries.)144
-664.8 Q F1<ad44>108 681.6 Q F2([\215ipcolor/\215ipshade])23.08 E F0
-(Normally)144 693.6 Q 3.32(,t)-.65 G .821(he color or grayscale tables \
-used for color maps run from cool colors \(or dark grays\))-3.32 F 1.29
-(for lo)144 705.6 R 3.79(wg)-.25 G 1.29(rid v)-3.79 F 1.289
-(alues to hot colors \(or light grays\) for high grid v)-.25 F 3.789
-(alues. This)-.25 F 1.289(option re)3.789 F -.15(ve)-.25 G 1.289
-(rses the).15 F .028
-(color table so that cool colors \(dark grays\) correspond to high v)144
-717.6 R .029(alues and hot colors \(light grays\) to)-.25 F(lo)144 729.6
-Q 3.955(wv)-.25 G 3.955(alues. If)-4.205 F F1<ad44>3.955 E F0 1.454
-(is gi)3.955 F -.15(ve)-.25 G 3.954(na).15 G 1.454(lone, it applies to \
-the color table used for color or gray \214ll plots,)-3.954 F
-(MB-System 5.0)72 768 Q 2.5(9J)140.11 G(anuary 2015)-2.5 E(3)198.45 E 0
-Cg EP
-%%Page: 4 4
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 123.72(mbm_grd3dplot\(1\) MB-System)72 48 R
-123.72(5.0 mbm_grd3dplot\(1\))2.5 F .216
-(shaded or unshaded. If the plot is to be shaded,)144 84 R .216
-(either by synthetic illumination \()5.216 F/F1 10/Times-Bold at 0 SF<ad47>
-A/F2 10/Times-Italic at 0 SF(2)A F0 2.716(\)o)C 2.716(ru)-2.716 G .216
-(sing an)-2.716 F .022(intensity \214le \()144 96 R F1<ad4b>A F0(and)
-2.522 E F1<ad47>2.522 E F2(3)A F0 .022(options\), then setting)2.522 F
-F2(\215ipshade)2.522 E F0 2.522(=1w)2.522 G .022
-(ill cause the shading con)-2.522 F -.15(ve)-.4 G .021(ntion to).15 F
-.087(be re)144 108 R -.15(ve)-.25 G .087(rsed \(e.g. high intensities o)
-.15 F -.15(ve)-.15 G .087(rlaid as light shading\).).15 F(Using)5.087 E
-F1<ad44>2.587 E F2(0/1)A F0 .088(will \215ip the shading con-)2.588 F
--.15(ve)144 120 S(ntion b).15 E(ut lea)-.2 E .3 -.15(ve t)-.2 H(he def)
-.15 E(ault color con)-.1 E -.15(ve)-.4 G(ntion.).15 E F1<ad45>108 136.8
-Q F0([)23.63 E F2(vie)A(w_az/vie)-.15 E(w_el)-.15 E F0(])A .462
-(Sets the azimuth and ele)144 148.8 R -.25(va)-.25 G .462(tion in de).25
-F .462(grees of the vie)-.15 F .462(wpoint for 3D perspecti)-.25 F .762
--.15(ve v)-.25 H(ie).15 E 2.962(ws. An)-.25 F F2(vie)2.962 E(w_az)-.15 E
-F0 1.526(of 0 represents a vie)144 160.8 R 4.026(wf)-.25 G 1.527
-(rom the north, and)-4.026 F F2(vie)4.027 E(w_az)-.15 E F0 4.027(=9)
-4.027 G 4.027(0r)-4.027 G 1.527(epresents a vie)-4.027 F 4.027(wf)-.25 G
-1.527(rom the east.)-4.027 F(An)6.527 E F2(vie)144 172.8 Q(w_el)-.15 E
-F0(of 0 represents a horizontal vie)2.5 E 3.8 -.65(w. D)-.25 H(ef).65 E
-(ault:)-.1 E F2(vie)2.5 E(w_az)-.15 E F0 2.5(=2)2.5 G(00.; ele)-2.5 E
--.25(va)-.25 G(tion = 40.).25 E F1<ad47>108 189.6 Q F2(color_mode)22.52
-E F0 -.45(Tu)144 201.6 S
-(rns on color \214ll plot and sets the style of the plot.).45 E F2
-(color_mode)164 213.6 Q F0 2.5(=1)2.5 G 2.5(:3)-2.5 G 2.5(Dc)-2.5 G
-(olor/gray \214ll.)-2.5 E F2(color_mode)164 225.6 Q F0 2.5(=2)2.5 G 2.5
-(:3)-2.5 G 2.5(Dc)-2.5 G(olor/gray \214ll shaded by)-2.5 E
-(synthetic illumination.)204 237.6 Q F2(color_mode)164 249.6 Q F0 2.5
-(=3)2.5 G 2.5(:3)-2.5 G 2.5(Dc)-2.5 G(olor/gray \214ll shaded by)-2.5 E
-(an intensity \214le. The)204 261.6 Q F1<ad4b>2.5 E F0
-(option must be used to specify)204 273.6 Q(the intensity \214le.)252
-285.6 Q F2(color_mode)164 297.6 Q F0 2.5(=4)2.5 G 2.5(:3)-2.5 G 2.5(DC)
--2.5 G(olor/gray \214ll of slope)-2.5 E(magnitude.)252 309.6 Q F2
-(color_mode)164 321.6 Q F0 2.5(=5)2.5 G 2.5(:3)-2.5 G 2.5(DC)-2.5 G
-(olor/gray \214ll shaded by)-2.5 E(slope magnitude.)204 333.6 Q F2
-(color_mode)164 345.6 Q F0 2.5(=6)2.5 G 2.5(:3)-2.5 G 2.5(Dm)-2.5 G
-(esh plot.)-2.5 E F2(color_mode)164 357.6 Q F0 2.5(=7)2.5 G 2.5(:3)-2.5
-G 2.5(Dm)-2.5 G(esh plot with contours.)-2.5 E(See the)144 369.6 Q F1
-(grdimage)2.5 E F0
-(manual page for information on shading with intensity \214les)2.5 E F1
-<ad48>108 386.4 Q F0 .162(This "help" \215ag cause the program to print\
- out a description of its operation and then e)22.52 F .161(xit immedi-)
--.15 F(ately)144 398.4 Q(.)-.65 E F1<ad49>108 415.2 Q F2(gr)26.41 E
-(d\214le)-.37 E F0 1.298
-(Sets the name of the gridded data \214le to be plotted.)144 427.2 R
-1.299(The data must be in a form acceptable to)6.298 F F1(GMT)144 439.2
-Q F0 -.15(ve)2.5 G(rsion 3 programs \(see the).15 E F1(GMT)2.5 E F0
-(Cookbook & T)2.5 E(echnical Reference\).)-.7 E F1<ad4a>108 456 Q F2(pr)
-25.3 E(ojection)-.45 E F0([)A F2(/scale | /width)A F0(])A .368
-(Selects the map projection. By def)144 468 R .367
-(ault the map projection is Mercator and the plot scale is chosen)-.1 F
-.667(to \214t on the selected page size \(see)144 480 R F1<ad50>3.168 E
-F0 .668(option\). The user may specify a dif)3.168 F .668
-(ferent projection to be)-.25 F .768(used, in which case the plot scale\
- is still automatically chosen to \214t the page. The user may also)144
-492 R .034(specify both the projection and the plot scale. If the proje\
-ction specifying character is upper case, a)144 504 R 1.509
-(plot width rather than a plot scale is used.)144 516 R 1.508
-(The scale v)6.508 F 1.508(alues are speci\214ed in inch/de)-.25 F 1.508
-(gree or in)-.15 F .829(1:xxxxx ratios. Plot widths are speci\214ed in \
-inches. If the user speci\214es a plot scale such that the)144 528 R
-(plot will not \214t on the def)144 540 Q
-(ault A size page, a appropriately lar)-.1 E
-(ger page size will be chosen.)-.18 E F1(CYLINDRICAL PR)144 564 Q
-(OJECTIONS:)-.3 E(\255Jc)144 588 Q F2(lon0/lat0/scale)A F0(\(Cassini\))
-2.5 E F1(\255Jm)144 600 Q F2(scale)A F0(\(Mercator\))2.5 E F1<ad4a>144
-612 Q(oa)-.15 E F2(lon0/lat0/azimuth/scale)A F0
-(\(Oblique Mercator \255 point and azimuth\))2.5 E F1<ad4a>144 624 Q(ob)
--.15 E F2(lon0/lat0/lon1/lat1/scale)A F0(\(Oblique Mercator \255 tw)2.5
-E 2.5(op)-.1 G(oints\))-2.5 E F1<ad4a>144 636 Q(oc)-.15 E F2
-(lon0/lat0/lonp/latp/scale)A F0
-(\(Oblique Mercator \255 point and pole\))2.5 E F1(\255Jq)144 648 Q F2
-(lon0/scale)A F0
-(\(Equidistant Cylindrical Projection \(Plate Carree\)\))2.5 E F1
-(\255Jt)144 660 Q F2(lon0/scale)A F0(\(TM \255 T)2.5 E(ransv)-.35 E
-(erse Mercator\))-.15 E F1<ad4a>144 672 Q(u)-.15 E F2(zone/scale)A F0
-(\(UTM \255 Uni)2.5 E -.15(ve)-.25 G(rsal T).15 E(ransv)-.35 E
-(erse Mercator\))-.15 E F1(\255Jy)144 684 Q F2(lon0/lats/scale)A F0
-(\(Basic Cylindrical Projection\))2.5 E F1(AZIMUTHAL PR)144 708 Q
-(OJECTIONS:)-.3 E F0(MB-System 5.0)72 768 Q 2.5(9J)140.11 G(anuary 2015)
--2.5 E(4)198.45 E 0 Cg EP
-%%Page: 5 5
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 123.72(mbm_grd3dplot\(1\) MB-System)72 48 R
-123.72(5.0 mbm_grd3dplot\(1\))2.5 F/F1 10/Times-Bold at 0 SF<ad4a>144 84 Q
-(a)-.15 E/F2 10/Times-Italic at 0 SF(lon0/lat0/scale)A F0(\(Lambert\).)2.5
-E F1<ad4a>144 96 Q(e)-.15 E F2(lon0/lat0/scale)A F0(\(Equidistant\).)2.5
-E F1(\255Jg)144 108 Q F2(lon0/lat0/scale)A F0(\(Orthographic\).)2.5 E F1
-(\255Js)144 120 Q F2(lon0/lat0/scale)A F0(\(General Stereographic\))2.5
-E F1(CONIC PR)144 144 Q(OJECTIONS:)-.3 E(\255Jb)144 168 Q F2
-(lon0/lat0/lat1/lat2/scale)A F0(\(Albers\))2.5 E F1(\255Jl)144 180 Q F2
-(lon0/lat0/lat1/lat2/scale)A F0(\(Lambert\))2.5 E F1(MISCELLANEOUS PR)
-144 204 Q(OJECTIONS:)-.3 E(\255Jh)144 228 Q F2(lon0/scale)A F0
-(\(Hammer\))2.5 E F1(\255Ji)144 240 Q F2(lon0/scale)A F0(\(Sinusoidal\))
-2.5 E F1(\255Jk)144 252 Q F2(lon0/scale)A F0(\(Eck)2.5 E(ert VI\))-.1 E
-F1(\255Jn)144 264 Q F2(lon0/scale)A F0(\(Robinson\))2.5 E F1(\255Jr)144
-276 Q F2(lon0/scale)A F0(\(W)2.5 E(ink)-.4 E(el T)-.1 E(ripel\))-.35 E
-F1(\255Jw)144 288 Q F2(lon0/scale)A F0(\(Moll)2.5 E(weide\))-.1 E F1
-(NON-GEOGRAPHICAL PR)144 312 Q(OJECTIONS:)-.3 E(\255Jp)144 336 Q F2
-(scale)A F0(\(Linear projection for polar \(theta,r\) coordinates\))2.5
-E F1(\255Jx)144 348 Q F2(x-scale)A F0([)A F1(l|p)A F2(pow)A F0(][)A F2
-(/y-scale)A F0([)A F1(l|p)A F2(pow)A F0(]] \(Linear)A 2.5(,l)-.4 G
-(og, and po)-2.5 E(wer scaling\))-.25 E
-(More details can be found in the)144 360 Q F1(psbasemap)2.5 E F0
-(manpages.)2.5 E F1<ad4b>108 376.8 Q F2(intensity_\214le)22.52 E F0
-(Sets the name of the gridded data \214le containing instensity v)144
-388.8 Q(alues to be used for shading the map.)-.25 E F1<ad4c>108 405.6 Q
-F2(title:scalelabel)23.63 E F0 .157(Sets the title and the label for th\
-e colorscale \(if used\) of the plot. Note that a colon \(:\) rather th\
-an a)144 417.6 R 1.557(slash \(/\) is used to separate the labels. Colo\
-ns cannot be used in the labels themselv)144 429.6 R 1.557(es. If this)
--.15 F 1.367(option is not used, then a def)144 441.6 R 1.367
-(ault title and colorscale label are pro)-.1 F 1.367
-(vided. If the title is supplied)-.15 F .741(alone, a def)144 453.6 R
-.741(ault colorscale label will be pro)-.1 F .741(vided. T)-.15 F 3.242
-(of)-.8 G .742(orce no title use)-3.242 F F1<ad4c>3.242 E F0 3.242("")C
-3.242(;t)-3.242 G 3.242(of)-3.242 G .742(orce no title or)-3.242 F
-(colorscale label use)144 465.6 Q F1<ad4c>2.5 E F0 2.5(":")C(.)-2.5 E F1
-<ad4d>108 482.4 Q F0 3.055(As)20.86 G .555
-(eries of "miscellaneous" options are pro)-3.055 F .555
-(vided which are gi)-.15 F -.15(ve)-.25 G 3.055(na).15 G(s)-3.055 E F1
-<ad4d>3.055 E F0(follo)3.055 E .555(wed by a tw)-.25 F 3.055(oc)-.1 G
-(har)-3.055 E(-)-.2 E 1.328(acter identi\214er)144 494.4 R 3.828(,f)-.4
-G(ollo)-3.828 E 1.328(wed by an)-.25 F 3.828(yo)-.15 G 1.329
-(ther parameters associated with that option.)-3.828 F(The)6.329 E F1
-<ad4d>3.829 E F0(options)3.829 E .61(may be strung together separated b\
-y colons, e.g. "-MGQ100:GU", which is equi)144 506.4 R -.25(va)-.25 G
-.61(lent to "-MGQ).25 F(\255MGU".)144 518.4 Q F1<ad4e>108 535.2 Q F2(dr)
-23.08 E(ape_\214le)-.15 E F0 .312(Sets the name of the gridded data \
-\214le to be draped on the relief pro)144 547.2 R .312
-(vided by the \214le speci\214ed with)-.15 F(the)144 559.2 Q F1<ad49>
-3.157 E F0 .657(option. If)3.157 F F1<ad4e>3.157 E F2(dr)A(ape_\214le)
--.15 E F0 .656(is speci\214ed, then all color control options will appl\
-y to the data in)3.157 F(\\fIdrape_\214le)144 571.2 Q F2(.)A F1(\255MGD)
-108 588 Q F2(gmtdef/value)5.86 E F0(Allo)144 600 Q .227
-(ws the user to set the)-.25 F F1(GMT)2.727 E F0(def)2.727 E .227
-(ault v)-.1 F .227
-(alues used as the plot is constructed. This command may)-.25 F 1.134
-(be gi)144 612 R -.15(ve)-.25 G 3.634(nr).15 G 1.133
-(epeatedly to set as man)-3.634 F(y)-.15 E F1(GMT)3.633 E F0(def)3.633 E
-1.133(aults as required. F)-.1 F 1.133(or e)-.15 F 1.133
-(xample, to set the basemap)-.15 F(annotation font to Courier)144 624 Q
-2.5(,u)-.4 G(se "-MGD)-2.5 E(ANO)-.4 E(T_FONT/Courier".)-.4 E F1
-(\255MGF)108 640.8 Q F2(scale_loc)6.97 E F0
-(Sets the location of the color scale. The possible v)144 652.8 Q
-(alues of)-.25 E F2(scale_loc)2.5 E F0(are:)2.5 E F2(scale_loc)180 664.8
-Q F0 2.5(=b)2.5 G 15.81(:b)-2.5 G(ottom of plot)-15.81 E F2(scale_loc)
-180 676.8 Q F0 2.5(=t)2.5 G 18.03(:t)-2.5 G(op of plot)-18.03 E F2
-(scale_loc)180 688.8 Q F0 2.5(=l)2.5 G 18.03(:l)-2.5 G(eft of plot)
--18.03 E F2(scale_loc)180 700.8 Q F0 2.5(=r)2.5 G 17.48(:r)-2.5 G
-(ight of plot)-17.48 E([Def)144 712.8 Q(ault)-.1 E F2(scale_loc)2.5 E F0
-2.5(=b)2.5 G(])-2.5 E(MB-System 5.0)72 768 Q 2.5(9J)140.11 G
-(anuary 2015)-2.5 E(5)198.45 E 0 Cg EP
-%%Page: 6 6
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 123.72(mbm_grd3dplot\(1\) MB-System)72 48 R
-123.72(5.0 mbm_grd3dplot\(1\))2.5 F/F1 10/Times-Bold at 0 SF(\255MGL)108 84
-Q F0([)6.41 E/F2 10/Times-Italic at 0 SF(f)A F0(][)A F2(x)A F0(])A F2
-(lon0/lat0/slat/length)A F0([)A F2(units)A F0(][)A F2(+llabel)A F0(])A
-(Dra)144 96 Q .16(ws a simple map scale centered on)-.15 F F2(lon0/lat0)
-2.66 E F0 5.16(.U)C(se)-5.16 E F1(\255Lf)2.66 E F0 .16(to get a "f)2.66
-F(anc)-.1 E .16(y" scale [Def)-.15 F .16(ault is plain].)-.1 F(Use)144
-108 Q F1(\255Lx)2.962 E F0 .461
-(to specify the position in inches instead of map units.)2.962 F .461
-(The scale is calculated at latitude)5.461 F F2(slat)144 120 Q F0 2.928
-(;i)C 2.928(ft)-2.928 G .428
-(he string "center" is used instead of a numerical v)-2.928 F .429
-(alue for)-.25 F F2(slat)2.929 E F0 2.929(,t)C .429
-(hen the macro will set the)-2.929 F 1.596
-(scaling according to the center of the plot bounds.)144 132 R 1.596
-(The scale length v)6.596 F(alue)-.25 E F2(length)4.096 E F0 1.595
-(is in km by)4.096 F(def)144 144 Q .278(ault, b)-.1 F .279(ut the units\
- can be speci\214ed as one of e|f|k|M|n|u, where e = meters, f = feet, \
-k = kilome-)-.2 F .912
-(ters, M = statue miles, n = nautical miles, and u = US surv)144 156 R
-1.211 -.15(ey f)-.15 H .911(eet. Append).15 F F2(+l)3.411 E F0 .911
-(to label the scale)3.411 F(with the rele)144 168 Q -.25(va)-.25 G
-(nt units, or append).25 E F2(+l"label")2.5 E F0(to set a dif)2.5 E
-(ferent label string.)-.25 E F1(\255MGQ)108 184.8 Q F2(dpi)5.3 E F0 .839
-(Sets the resolution in dots per inch of the raster image used for colo\
-r \214ll maps. Lar)144 196.8 R .839(ger v)-.18 F .839(alues of)-.25 F F2
-(dpi)144 208.8 Q F0(produce lar)2.5 E(ger Postscript plot \214les. [Def)
--.18 E(ault is 100].)-.1 E F1(\255MGS)108 225.6 Q F2(scalefactor)7.52 E
-F0 .729(The gridded data is multiplied by)144 237.6 R F2(scalefactor)
-3.229 E F0 5.729(.T)C .729
-(his option is most often used \215ip the sign of the)-5.729 F(data \()
-144 249.6 Q F2(scalefactor)A F0 2.5<3dad>2.5 G(1\). [Def)-2.5 E
-(ault no scaling])-.1 E F1(\255MGT)108 266.4 Q F2
-(x/y/size/angle/font/just/te)6.41 E(xt)-.2 E F0 .487(Causes a te)144
-278.4 R .487(xt label to plotted on the map.)-.15 F F2(size)5.487 E F0
-.487(is te)2.987 F .488(xt size in points,)-.15 F F2(angle)2.988 E F0
-.488(is measured in de)2.988 F(grees)-.15 E(counter)144 290.4 Q .8
-(-clockwise from horizontal,)-.2 F F2(fontno)3.3 E F0 .8
-(sets the font type,)3.3 F F2(justify)3.3 E F0 .8(sets the alignment.)
-3.3 F(If)5.8 E F2(fontno)3.3 E F0 1.614(starts with a leading h)144
-302.4 R 1.615(yphen, then the remainder of)-.05 F F2(fontno)4.115 E F0
-1.615(is tak)4.115 F 1.615(en to be a te)-.1 F 1.615(xtstring with the)
--.15 F 1.023(desired fontname.)144 314.4 R 1.022(See the)6.023 F F1
-(gmtdefaults)3.522 E F0 1.022(man page for names and numbers of a)3.522
-F -.25(va)-.2 G 1.022(ilable fonts \(or).25 F(run)144 326.4 Q F1 .111
-(pstext \255L)2.611 F F0 2.611(\). The)B .111
-(alignment number refers to the part of the te)2.611 F .112
-(xtstring that will be mapped onto)-.15 F .29(the \()144 338.4 R F2(x,y)
-A F0 2.79(\)p)C .289(oint: 1 = Lo)-2.79 F .289(wer Left corner)-.25 F
-2.789(,2=L)-.4 G -.25(ow)-2.789 G .289(er Center).25 F 2.789(,3=L)-.4 G
--.25(ow)-2.789 G .289(er Right, 5 = Mid Left, 6 = Mid).25 F(Center)144
-350.4 Q 2.783(,7=M)-.4 G .283
-(id Right, 9 = Upper Left, 10 = Upper Center)-2.783 F 2.783(,1)-.4 G
-2.783(1=U)-2.783 G .283(pper Right. This option may be)-2.783 F(gi)144
-362.4 Q -.15(ve)-.25 G 2.5(na).15 G 2.5(sm)-2.5 G(an)-2.5 E 2.5(yt)-.15
-G(imes as needed.)-2.5 E F1 3.36(\255MGU [)108 379.2 R F2(/dx/dy/)A F1
-(][)A F2(label)A F1(])A .581(Draw Unix System time stamp on plot.)144
-391.2 R .581(User may specify wher)5.581 F 3.08(et)-.18 G .58(he lo)
--3.08 F .58(wer left cor)-.1 F .58(ner of the)-.15 F 2.777
-(stamp should fall on the page r)144 403.2 R(elati)-.18 E 2.977 -.1
-(ve t)-.1 H 5.277(ol).1 G -.1(ow)-5.277 G 2.777(er left cor).1 F 2.777
-(ner of plot in inch [Default is)-.15 F 2.5
-(\(-0.75,-0.75\)]. Optionally)144 415.2 R 2.5(,a)-.55 G
-(ppend a label, or c \(which will plot the command string)-2.5 E(.\))
--.15 E(\255MVM)108 432 Q F2(mesh_pen)144 444 Q F0 .228(Set pen attrib)
-144 456 R .227(utes for mesh plot.)-.2 F .227
-(The mesh plot must be speci\214ed with the)5.227 F F1<ad47>2.727 E F0
-.227(option. See chapter)2.727 F .718(4.12 in the GMT T)144 468 R .718
-(echnical reference for a discussion of GMT pen v)-.7 F 3.218
-(alues. [Def)-.25 F .719(aults: width = 1,)-.1 F(color = 0/0/0, te)144
-480 Q(xture = solid].)-.15 E F1(\255MVN)108 496.8 Q F0([)6.42 E F2
-(null[/r/g/b])A F0(])A(Dra)144 508.8 Q .482(ws a plane at the le)-.15 F
--.15(ve)-.25 G 2.982(lo).15 G 2.982(ft)-2.982 G(he)-2.982 E F2(null)
-2.982 E F0 -.25(va)2.982 G .482
-(lue \(with respect to the data in the grid \214le speci\214ed with).25
-F(the)144 520.8 Q F1<ad49>3.271 E F0 .772
-(option. If the optional r/g/b is pro)3.271 F .772(vided, the frontal f)
--.15 F .772(acade between the plane and the data)-.1 F 1.067
-(perimeter is \214lled with this color)144 532.8 R 3.567(.I)-.55 G(f)
--3.567 E F1(\255MVN)3.567 E F0 1.067(is gi)3.567 F -.15(ve)-.25 G 3.567
-(nb).15 G 3.566(yi)-3.567 G 1.066(tself, then)-3.566 F F1(mbm_grd3dplot)
-3.566 E F0 1.066(causes the)3.566 F 2.862(null plane to be dra)144 544.8
-R 2.862(wn at the minimum z-le)-.15 F -.15(ve)-.25 G 5.362(la).15 G
-2.862(nd the f)-5.362 F 2.863(acade to be colored a light gray)-.1 F
-(\(r=g=b=200\).)144 556.8 Q F1<ad4f>108 573.6 Q F2 -.45(ro)22.52 G(ot)
-.45 E F0 .423(Sets the root used to construct the \214lename of the out\
-put shellscript \()144 585.6 R F2 -.45(ro)C(ot).45 E F0 .422
-(.cmd\) and names of \214les)B .156
-(created when the shellscript is run.)144 597.6 R .157
-(Normally the name of the input grid \214le or grid \214le list is used)
-5.157 F(as the)144 609.6 Q F2 -.45(ro)2.5 G(ot).45 E F0(.)A F1<ad50>108
-626.4 Q F2(pa)24.19 E -.1(ge)-.1 G(size).1 E F0 .632(This option sets t\
-he size of the page the plot will be centered on. If the user does not \
-set the plot)144 638.4 R .125(scale, the plot will be sized as lar)144
-650.4 R .125(ge as will \214t on the designated page. If the user sets \
-the plot scale)-.18 F .948
-(such that the plot will not \214t on the designated page, a lar)144
-662.4 R .948(ger page will be used.)-.18 F .947(The supported)5.947 F
-(page sizes are:)144 674.4 Q(American ANSI sizes:)169 698.4 Q 12.5(A8)
-169 710.4 S(.5 x 11.0 in.)-12.5 E 2.5(\(2)10 G(15.9 x)-2.5 E(279.4 mm\))
-5 E 10(B1)169 722.4 S(1.0 x 17.0 in.)-10 E 2.5(\(2)10 G(79.4 x)-2.5 E
-(431.8 mm\))5 E(MB-System 5.0)72 768 Q 2.5(9J)140.11 G(anuary 2015)-2.5
-E(6)198.45 E 0 Cg EP
-%%Page: 7 7
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 123.72(mbm_grd3dplot\(1\) MB-System)72 48 R
-123.72(5.0 mbm_grd3dplot\(1\))2.5 F 10(C1)169 84 S(7.0 x 22.0 in.)-10 E
-2.5(\(4)10 G(31.8 x)-2.5 E(558.8 mm\))5 E 10(D2)169 96 S(2.0 x 34.0 in.)
--10 E 2.5(\(5)10 G(58.8 x)-2.5 E(863.6 mm\))5 E 10(E3)169 108 S
-(4.0 x 44.0 in.)-10 E 2.5(\(8)10 G(63.6 x 1117.6 mm\))-2.5 E 10(F2)169
-120 S(8.0 x 40.0 in.)-10 E 2.5(\(7)10 G(11.2 x 1016.0 mm\))-2.5 E 5
-(E1 44.0)169 132 R 2.5(x6)2.5 G(8.0 in.)-2.5 E(\(1117.6 x 1727.2 mm\))10
-E(Metric ISO A sizes:)169 156 Q 5(A0 841.0)169 168 R 2.5(x1)2.5 G
-(189.0 mm)-2.5 E(\(33.11 x 46.81 in.\))5 E 5(A1 594.0)169 180 R 5(x8)2.5
-G(41.0 mm)-5 E(\(23.39 x 33.11 in.\))5 E 5(A2 420.0)169 192 R 5(x5)2.5 G
-(94.0 mm)-5 E(\(16.54 x 23.39 in.\))5 E 5(A3 297.0)169 204 R 5(x4)2.5 G
-(20.0 mm)-5 E(\(11.69 x 16.54 in.\))5 E 5(A4 210.0)169 216 R 5(x2)2.5 G
-(97.0 mm)-5 E 2.5(\(8)5 G(.27 x 11.69 in.\))-2.5 E 5(A5 148.0)169 228 R
-5(x2)2.5 G(10.0 mm)-5 E 2.5(\(5)5 G(.83 x)-2.5 E(8.27 in.\))5 E 5
-(A6 105.0)169 240 R 5(x1)2.5 G(48.0 mm)-5 E 2.5(\(4)5 G(.13 x)-2.5 E
-(5.83 in.\))5 E 7.5(A7 74.0)169 252 R 5(x1)2.5 G(05.0 mm)-5 E 2.5(\(2)5
-G(.91 x)-2.5 E(4.13 in.\))5 E 7.5(A8 52.0)169 264 R 7.5(x7)2.5 G(4.0 mm)
--7.5 E 2.5(\(2)5 G(.05 x)-2.5 E(2.91 in.\))5 E 7.5(A9 37.0)169 276 R 7.5
-(x5)2.5 G(2.0 mm)-7.5 E 2.5(\(1)5 G(.46 x)-2.5 E(2.05 in.\))5 E 5
-(A10 26.0)169 288 R 7.5(x3)2.5 G(7.0 mm)-7.5 E 2.5(\(1)5 G(.02 x)-2.5 E
-(1.46 in.\))5 E(Metric ISO B sizes:)169 312 Q 5(B0 1000.0x)169 324 R
-(1414.0 mm)2.5 E(\(39.37 x 55.67 in.\))5 E 5(B1 707.0)169 336 R 2.5(x1)
-2.5 G(000.0 mm)-2.5 E(\(27.83 x 39.37 in.\))5 E 5(B2 500.0)169 348 R 5
-(x7)2.5 G(07.0 mm)-5 E(\(19.68 x 27.83 in.\))5 E 5(B3 353.0)169 360 R 5
-(x5)2.5 G(00.0 mm)-5 E(\(13.90 x 19.68 in.\))5 E 5(B4 250.0)169 372 R 5
-(x3)2.5 G(53.0 mm)-5 E 2.5(\(9)5 G(.84 x 13.90 in.\))-2.5 E 5(B5 176.0)
-169 384 R 5(x2)2.5 G(50.0 mm)-5 E 2.5(\(6)5 G(.93 x)-2.5 E(9.84 in.\))5
-E 5(B6 125.0)169 396 R 5(x1)2.5 G(76.0 mm)-5 E 2.5(\(4)5 G(.92 x)-2.5 E
-(6.93 in.\))5 E 7.5(B7 88.0)169 408 R 5(x1)2.5 G(25.0 mm)-5 E 2.5(\(3)5
-G(.46 x)-2.5 E(4.92 in.\))5 E 7.5(B8 62.0)169 420 R 7.5(x8)2.5 G(8.0 mm)
--7.5 E 2.5(\(2)5 G(.44 x)-2.5 E(3.46 in.\))5 E 7.5(B9 44.0)169 432 R 7.5
-(x6)2.5 G(2.0 mm)-7.5 E 2.5(\(1)5 G(.73 x)-2.5 E(2.44 in.\))5 E 5
-(B10 31.0)169 444 R 7.5(x4)2.5 G(4.0 mm)-7.5 E 2.5(\(1)5 G(.22 x)-2.5 E
-(1.73 in.\))5 E(Metric ISO C sizes:)169 468 Q 5(C0 914.4)169 480 R 2.5
-(x1)2.5 G(300.5 mm)-2.5 E(\(36.00 x 51.20 in.\))5 E 5(C1 650.2)169 492 R
-5(x9)2.5 G(14.4 mm)-5 E(\(25.60 x 36.00 in.\))5 E 5(C2 457.2)169 504 R 5
-(x6)2.5 G(50.2 mm)-5 E(\(18.00 x 25.60 in.\))5 E 5(C3 325.1)169 516 R 5
-(x4)2.5 G(57.2 mm)-5 E(\(12.80 x 18.00 in.\))5 E 5(C4 228.6)169 528 R 5
-(x3)2.5 G(25.1 mm)-5 E 2.5(\(9)5 G(.00 x 12.80 in.\))-2.5 E 5(C5 162.6)
-169 540 R 5(x2)2.5 G(28.6 mm)-5 E 2.5(\(6)5 G(.40 x)-2.5 E(9.00 in.\))5
-E 5(C6 114.3)169 552 R 5(x1)2.5 G(62.6 mm)-5 E 2.5(\(4)5 G(.50 x)-2.5 E
-(6.40 in.\))5 E 7.5(C7 81.3)169 564 R 5(x1)2.5 G(14.3 mm)-5 E 2.5(\(3)5
-G(.20 x)-2.5 E(4.50 in.\))5 E(MB-System lar)185 588 Q(ge format sizes:)
--.18 E 2.5(m1 1371.6)169 600 R 2.5(x1)2.5 G(828.8 mm)-2.5 E
-(\(54.00 x 72.00 in.\))5 E 2.5(m2 1371.6)169 612 R 2.5(x2)2.5 G
-(133.6 mm)-2.5 E(\(54.00 x 84.00 in.\))5 E 2.5(m3 1371.6)169 624 R 2.5
-(x2)2.5 G(438.4 mm)-2.5 E(\(54.00 x 96.00 in.\))5 E 2.5(m4 1524.0)169
-636 R 2.5(x1)2.5 G(828.8 mm)-2.5 E(\(60.00 x 72.00 in.\))5 E 2.5
-(m5 1524.0)169 648 R 2.5(x2)2.5 G(133.6 mm)-2.5 E(\(60.00 x 84.00 in.\))
-5 E 2.5(m6 1524.0)169 660 R 2.5(x2)2.5 G(438.4 mm)-2.5 E
-(\(60.00 x 96.00 in.\))5 E(The def)144 684 Q(ault page size is A.)-.1 E
-/F1 10/Times-Bold at 0 SF<ad51>108 700.8 Q F0(Normally)22.52 E 2.866(,t)
--.65 G .367
-(he output plot generation shellscript includes lines which e)-2.866 F
--.15(xe)-.15 G .367(cute a program to display).15 F 1.072
-(the Postscript image on the screen.)144 712.8 R 1.071
-(This option causes those lines to be commented out so that)6.071 F -.15
-(exe)144 724.8 S .147
-(cuting the shellscript produces a Postscript plot b).15 F .148
-(ut does not attempt to display it on the screen.)-.2 F(MB-System 5.0)72
-768 Q 2.5(9J)140.11 G(anuary 2015)-2.5 E(7)198.45 E 0 Cg EP
-%%Page: 8 8
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 123.72(mbm_grd3dplot\(1\) MB-System)72 48 R
-123.72(5.0 mbm_grd3dplot\(1\))2.5 F(Alternati)144 84 Q -.15(ve)-.25 G
-(ly).15 E 2.892(,i)-.65 G -1.9 -.4(nv o)-2.892 H .392
-(king the plot generation shellscript with a).4 F/F1 10/Times-Bold at 0 SF
-(-N)2.891 E F0 .391(command line ar)2.891 F .391(gument also sup-)-.18 F
-.227(presses the screen display of the plot. The program to be used to \
-display the Postscript is set using)144 96 R F1(mbdefaults)144 108 Q F0
-7.891(;t)C 5.391(he def)-7.891 F 5.391(ault v)-.1 F 5.391(alue can be o)
--.25 F -.15(ve)-.15 G 5.391(rridden by setting the en).15 F 5.39
-(vironment v)-.4 F(ariable)-.25 E($MB_PS_VIEWER.)144 120 Q F1<ad52>108
-136.8 Q/F2 10/Times-Italic at 0 SF(west/east/south/north)23.08 E .736
-(west, east, south,)144 148.8 R F0(and)3.236 E F2(north)3.236 E F0 .736
-(specify the Re)3.236 F .736(gion of interest.)-.15 F 2.336 -.8(To s)
-5.736 H .736(pecify boundaries in de).8 F .736(grees and)-.15 F 1.162
-(minutes [and seconds], use the dd:mm[:ss] format.)144 160.8 R(Append)
-6.161 E F1(r)3.661 E F0 1.161(if lo)3.661 F 1.161
-(wer left and upper right map)-.25 F .208(coordinates are gi)144 172.8 R
--.15(ve)-.25 G 2.708(ni).15 G .208(nstead of wesn.)-2.708 F -1.1(Yo)
-5.208 G 2.708(um)1.1 G .208(ay ask for a lar)-2.708 F(ger)-.18 E F2
-(w/e/s/n)2.708 E F0(re)2.708 E .209(gion to ha)-.15 F .509 -.15(ve m)-.2
-H .209(ore room).15 F .199(between the image and the ax)144 184.8 R
-2.699(es. A)-.15 F .199(smaller re)2.699 F .199
-(gion than speci\214ed in the grd\214le will result in a sub-)-.15 F
-(set of the grid [Def)144 196.8 Q(ault is re)-.1 E(gion gi)-.15 E -.15
-(ve)-.25 G 2.5(nb).15 G 2.5(yt)-2.5 G(he grd\214le].)-2.5 E F1<ad53>108
-213.6 Q F2([color/shade])24.74 E F0 1.392(This option enables ef)144
-225.6 R(fecti)-.25 E 1.692 -.15(ve h)-.25 H 1.392
-(istogram equalization of the color and/or shading of the gridded).15 F
-.628(data. The equalization is not achie)144 237.6 R -.15(ve)-.25 G
-3.128(db).15 G 3.128(yc)-3.128 G .628(hanging the data v)-3.128 F .628
-(alues, b)-.25 F .628(ut rather by constructing the)-.2 F .518(color or\
- shading tables so that the boundaries in the tables encompass equal fr\
-actions of the data-)144 249.6 R .19(points. This serv)144 261.6 R .19
-(es to focus color or shading contrasts in v)-.15 F .19
-(alue ranges corresponding to the b)-.25 F .19(ulk of)-.2 F .837
-(the data v)144 273.6 R 3.338(alues. If)-.25 F F1<ad53>3.338 E F0 .838
-(is gi)3.338 F -.15(ve)-.25 G 3.338(na).15 G .838(lone or with)-3.338 F
-F2(color)3.338 E F0 3.338(=1)3.338 G 3.338(,i)-3.338 G 3.338(te)-3.338 G
-.838(nables equalization of the color table)-3.338 F .991
-(used for color or gray \214ll plots,)144 285.6 R .991
-(shaded or unshaded. If the plot is to be shaded,)5.991 F .991
-(either by syn-)5.991 F .637(thetic illumination \()144 297.6 R F1<ad47>
-A F2(2)A F0 3.137(\)o)C 3.137(ru)-3.137 G .637
-(sing an intensity \214le \()-3.137 F F1<ad4b>A F0(and)3.138 E F1<ad47>
-3.138 E F2(3)A F0 .638(options\), then setting)3.138 F F2(shade)3.138 E
-F0 3.138(=1)3.138 G .5(will cause the shading to be equalized.)144 309.6
-R(Using)5.5 E F1<ad53>3 E F2(0/1)A F0 .5
-(will equalize the shading without equalizing)3 F(the color table.)144
-321.6 Q F1<ad55>108 338.4 Q F2(orientation)23.08 E F0 .2(Normally the o\
-rientation of the plot \(portrait or landscape\) is selected automatica\
-lly so as to maxi-)144 350.4 R .334(mize the plot scale.)144 362.4 R
-(The)5.333 E F1<ad55>2.833 E F0 .333(option allo)2.833 F .333
-(ws the user to set the plot orientation. If)-.25 F F2(orientation)2.833
-E F0 2.833(=1)2.833 G 2.833(,a)-2.833 G
-(portrait plot will be produced; if)144 374.4 Q F2(orientation)2.5 E F0
-2.5(=2)2.5 G 2.5(,al)-2.5 G(andscape plot will be produced.)-2.5 E F1
-<ad57>108 391.2 Q F2([color_style)20.3 E F0([)A F2(/palette)A F0([)A F2
-(ncolor)A(s)-.1 E F0(]] | cpt\214le])A
-(This option controls the color scheme used for color \214ll plots.)144
-403.2 Q(If)144 427.2 Q F2(color_style)3.135 E F0 3.136(=1[)3.135 G(def)
--3.136 E .636(ault], then the color scheme used will be a continuous gr\
-ading of colors. If)-.1 F F2(color_style)144 439.2 Q F0 2.816(=2)2.816 G
-2.816(,t)-2.816 G .316
-(he color scheme will be a set of discrete color interv)-2.816 F .315
-(als. The color palette used is)-.25 F(set using)144 451.2 Q F2(palette)
-2.5 E F0 2.5(.S)C -2.15 -.25(ev e)-2.5 H 2.5(np).25 G(alettes are a)-2.5
-E -.25(va)-.2 G(ilable:).25 E F2(palette)180 463.2 Q F0 2.5(=1)2.5 G
-26.36(:H)-2.5 G(axby colors [def)-26.36 E(ault])-.1 E F2(palette)180
-475.2 Q F0 2.5(=2)2.5 G 26.36(:h)-2.5 G(igh Intensity colors)-26.36 E F2
-(palette)180 487.2 Q F0 2.5(=3)2.5 G 26.36(:l)-2.5 G .5 -.25(ow I)-26.36
-H(ntensity colors).25 E F2(palette)180 499.2 Q F0 2.5(=4)2.5 G 26.36(:g)
--2.5 G(rayscale)-26.36 E F2(palette)180 511.2 Q F0 2.5(=5)2.5 G 26.36
-(:u)-2.5 G(niform grayscale)-26.36 E F2(palette)180 523.2 Q F0 2.5(=6)
-2.5 G 26.36(:u)-2.5 G(niform black)-26.36 E F2(palette)180 535.2 Q F0
-2.5(=7)2.5 G 26.36(:u)-2.5 G(niform white)-26.36 E
-(The RGB de\214nitions of the color palettes are:)144 559.2 Q
-(color palette 1 \255 Haxby Color T)144 583.2 Q(able)-.8 E 5(red: 255)
-149 595.2 R(255 255 255 240 205 138 106)2.5 E 2.5(50 40 37)5 F
-(green: 255 186 161 189 236 255 236 235 190 127)149 607.2 Q(57)5 E 2.5
-(blue: 255)149 619.2 R 2.5(133 68 87)2.5 F(121 162 174 255 255 251 175)
-2.5 E(color palette 2 \255 High Intensity Colors)144 643.2 Q 5(red: 255)
-149 655.2 R(255 255 255 128)2.5 E 7.5(0000)7.5 G(128 255)-5 E 5
-(green: 0)149 667.2 R(64 128 255 255 255 255 128)5 E 7.5(000)7.5 G 7.5
-(blue: 0)149 679.2 R 7.5(00000)7.5 G(255 255 255 255 255)-5 E
-(color palette 3 \255 Lo)144 703.2 Q 2.5(wI)-.25 G(ntensity Colors)-2.5
-E 5(red: 200)149 715.2 R(194 179 141)2.5 E 5(90 0 0 0 0)5 F(90 141)5 E 5
-(green: 0)149 727.2 R 2.5(49 90)5 F(141 179 200 141)2.5 E 5(90 0 0 0)5 F
-(MB-System 5.0)72 768 Q 2.5(9J)140.11 G(anuary 2015)-2.5 E(8)198.45 E 0
-Cg EP
-%%Page: 9 9
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 123.72(mbm_grd3dplot\(1\) MB-System)72 48 R
-123.72(5.0 mbm_grd3dplot\(1\))2.5 F 7.5(blue: 0)149 84 R 7.5(00000)7.5 G
-(141 179 200 179 141)-5 E(color palette 4 \255 Grayscale)144 108 Q 5
-(red: 255)149 120 R(230 204 179 153 128 102)2.5 E 2.5(77 51 26)5 F(0)7.5
-E(green: 255 230 204 179 153 128 102)149 132 Q 2.5(77 51 26)5 F(0)7.5 E
-2.5(blue: 255)149 144 R(230 204 179 153 128 102)2.5 E 2.5(77 51 26)5 F
-(0)7.5 E(color palette 5 \255 Uniform Grayscale)144 168 Q 5(red: 128)149
-180 R(128 128 128 128 128 128 128 128 128 128)2.5 E
-(green: 128 128 128 128 128 128 128 128 128 128 128)149 192 Q 2.5
-(blue: 128)149 204 R(128 128 128 128 128 128 128 128 128 128)2.5 E
-(color palette 6 \255 Uniform Black)144 228 Q 10(red: 0)149 240 R 7.5
-(0000000000)7.5 G 5(green: 0 0 0 0 0 0 0 0 0 0 0)149 252 R 7.5(blue: 0)
-149 264 R 7.5(0000000000)7.5 G(color palette 7 \255 Uniform White)144
-288 Q 5(red: 255)149 300 R(255 255 255 255 255 255 255 255 255 255)2.5 E
-(green: 255 255 255 255 255 255 255 255 255 255 255)149 312 Q 2.5
-(blue: 255)149 324 R(255 255 255 255 255 255 255 255 255 255)2.5 E .365
-(The Haxby colors ha)144 348 R .665 -.15(ve b)-.2 H .366
-(een adapted from a palette de).15 F -.15(ve)-.25 G .366(loped by Dr).15
-F 2.866(.W)-.55 G .366(illiam Haxby of the Lam-)-3.266 F .32
-(ont-Doherty Earth Observ)144 360 R .319
-(atory; this palette is pleasing to the e)-.25 F .319
-(ye and well suited for shading. The)-.15 F .309(high intensity colors \
-describe linear paths through RGB space from red to blue to green to pu\
-rple;)144 372 R .438(because the colors are high intensity the)144 384 R
-2.938(ya)-.15 G .437(re not well suited to shading.)-2.938 F .437
-(The lo)5.437 F 2.937(wi)-.25 G .437(ntensity colors)-2.937 F .517
-(are similar to the high intensity)144 396 R 3.017(,b)-.65 G .517
-(ut muted and thus well suited to shading.)-3.217 F .517
-(The grayscale palette)5.517 F .499(runs linearly from white to black a\
-nd is commonly used for plots of sidescan and amplitude data.)144 408 R
-(The uniform grayscale is useful for non-color shaded relief plots.)144
-420 Q(The)144 444 Q/F1 10/Times-Italic at 0 SF(ncolor)2.606 E(s)-.1 E F0
-.107(parameter sets the number of color v)2.606 F .107
-(alues used in plotting, whether the colors are rep-)-.25 F(resented in\
- a continuous color scale or a stepped, discrete color scale [def)144
-456 Q(ault is 11].)-.1 E .523(If the option ar)144 480 R .522
-(gument is the path to an e)-.18 F(xisting)-.15 E/F2 10/Times-Bold at 0 SF
-(GMT)3.022 E F0 .522(color palette \(CPT\) \214le, then that CPT \214le)
-3.022 F(and its color scheme will be used for the plot)144 492 Q F2
-<ad56>108 508.8 Q F0(Causes)23.08 E F2(mbm_grd3dplot)3.693 E F0 1.193
-(to operate in "v)3.693 F 1.193
-(erbose" mode so that it outputs more information than)-.15 F(usual.)144
-520.8 Q F2<ad58>108 537.6 Q F0(Normally)23.08 E(,)-.65 E F2
-(mbm_grd3dplot)4.664 E F0 2.164(creates an e)4.664 F -.15(xe)-.15 G
-2.164(cutable shellscript and then e).15 F 4.663(xits. This)-.15 F 2.163
-(option will)4.663 F(cause the shellscript to be e)144 549.6 Q -.15(xe)
--.15 G(cuted in the background before).15 E F2(mbm_grd3dplot)2.5 E F0
--.15(ex)2.5 G(its.).15 E F2<ad59>108 566.4 Q F0(Normally)23.08 E(,)-.65
-E F2(mbm_grd3dplot)4.372 E F0 1.873
-(generates nicely rounded numbers for the boundaries of the color)4.372
-F .655(palette. Often, the resulting color bounds e)144 578.4 R .655
-(xtend well outside the range of the gridded data.)-.15 F(This)5.654 E
-1.014(option causes the color boundaries to be uniformly distrib)144
-590.4 R 1.014(uted between the minimum and maxi-)-.2 F(mum v)144 602.4 Q
-(alues of the grid.)-.25 E F2<ad5a>108 619.2 Q F1(min/max)23.63 E F0
-.787(This option o)144 631.2 R -.15(ve)-.15 G .787
-(rrides the minimum and maximum v).15 F .786
-(alues of the gridded data, af)-.25 F .786(fecting the color)-.25 F
-(palette and the contour interv)144 643.2 Q
-(al if those parameters are not speci\214ed by the user)-.25 E(.)-.55 E
-/F3 10.95/Times-Bold at 0 SF(EXAMPLES)72 672 Q F0 .106(Suppose we ha)108
-684 R .406 -.15(ve o)-.2 H .106(btained tw).15 F 2.606(oG)-.1 G .106
-(RD \214les with dimensions of 127 by 194, one containing gridded bath)
--2.606 F(yme-)-.05 E .369(try \(grd_sb2112_e)108 696 R .368
-(xample_bath\) and the other gridded sidescan \(grd_sb2112_e)-.15 F .368
-(xample_ss\). In order to gen-)-.15 F .599(erate a shellscript which wi\
-ll in turn generate a 3D color shaded relief vie)108 708 R 3.099(wo)-.25
-G 3.099(ft)-3.099 G .599(he bath)-3.099 F(ymetry)-.05 E 3.099(,w)-.65 G
-3.099(eu)-3.099 G .599(se the)-3.099 F F2<ad47>108 720 Q F1(2)A F0 4.409
-(option. The)4.409 F 1.908(grid \214le is in bath)4.408 F 1.908
-(ymetry \(positi)-.05 F 2.208 -.15(ve d)-.25 H -.25(ow).15 G 1.908
-(n\) rather in topograph).25 F 4.408(y\()-.05 G(positi)-4.408 E 2.208
--.15(ve u)-.25 H 1.908(p\), so the).15 F(MB-System 5.0)72 768 Q 2.5(9J)
-140.11 G(anuary 2015)-2.5 E(9)198.45 E 0 Cg EP
-%%Page: 10 10
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 123.72(mbm_grd3dplot\(1\) MB-System)72 48 R
-123.72(5.0 mbm_grd3dplot\(1\))2.5 F(bath)108 84 Q .214
-(ymetry needs to be rescaled by multiplying by \2551 \()-.05 F/F1 10
-/Times-Bold at 0 SF(\255MGS)A/F2 10/Times-Italic at 0 SF(-1)A F0 .215(\). W)B
-2.715(ec)-.8 G .215(hoose an illumination magnitude of)-2.715 F 1.021
-(0.4 and an illumination azimuth of 45 de)108 96 R 1.021(grees \()-.15 F
-F1<ad41>A F2(0.4/45)A F0 1.021(\). W)B 3.521(ea)-.8 G 1.02
-(lso choose a perspecti)-3.521 F 1.32 -.15(ve a)-.25 H 1.02
-(zimuth of 250).15 F(de)108 108 Q(grees and an ele)-.15 E -.25(va)-.25 G
-(tion of 30 de).25 E(grees \()-.15 E F1<ad45>A F2(240/30)A F0(\):)A
-(mbm_grd3dplot \255Igrd_sb2112_e)144 132 Q(xample_bath \\)-.15 E
-(\255G2 \255A0.4/45 \255E250/30 \255MGS-1 \255X \255V \\)154 144 Q
-(\255Osb2112_e)154 156 Q(xample_bath3d)-.15 E(No)108 180 Q 1.704 -.65
-(w, t)-.25 H 2.904(og).65 G .404(enerate a 3D perspecti)-2.904 F .704
--.15(ve v)-.25 H(ie).15 E 2.904(wo)-.25 G 2.904(ft)-2.904 G .404
-(he gridded bath)-2.904 F .405
-(ymetry shaded using the gridded sidescan data,)-.05 F .674(we use the)
-108 192 R F1<ad47>3.174 E F2(3)A F0(and)3.174 E F1<ad4b>3.174 E F0 3.174
-(options. W)3.174 F 3.174(ew)-.8 G .674
-(ant the sidescan data to be histogram equalized, so we use)-3.274 F F1
-<ad53>3.173 E F2(0/1)A F0(.)A 2.063 -.8(We a)108 204 T .463(lso w).8 F
-.463(ant the shading to be more prominent than the def)-.1 F .464
-(ault shading magnitude of 0.2 w)-.1 F .464(ould produce,)-.1 F
-(so we use)108 216 Q F1<ad41>2.5 E F2(0.5)A F0(:)A
-(mbm_grd3dplot \255Igrd_sb2112_e)144 240 Q(xample_bath \\)-.15 E
-(\255Kgrd_sb2112_e)154 252 Q(xample_ss \\)-.15 E
-(\255G3 \255A0.5 \255E250/30 \255D0/1 \\)154 264 Q
-(\255S0/1 \255MGS-1 \255X \255V \\)154 276 Q(\255Osb2112_e)154 288 Q
-(xample_bathss3d)-.15 E .749(The \214rst e)108 312 R .748
-(xample produces and e)-.15 F -.15(xe)-.15 G .748
-(cutes a plot generation shellscript called sb2112_e).15 F
-(xample_bath3d.cmd)-.15 E .614
-(and the second produces a shellscript called sb2112_e)108 324 R 3.114
-(xample_bathss3d.cmd. As)-.15 F .614(an e)3.114 F .615
-(xample, the contents)-.15 F(of the plotting shellscript "sb2112_e)108
-336 Q(xample_bathss3d.cmd" are:)-.15 E(#)110.5 360 Q 2.5(#S)110.5 372 S
-(hellscript to create Postscript plot of data in grd \214le)-2.5 E 2.5
-(#C)110.5 384 S(reated by macro mbm_grd3dplot)-2.5 E(#)110.5 396 Q 2.5
-(#T)110.5 408 S(his shellscript created by follo)-2.5 E
-(wing command line:)-.25 E 2.5(#m)110.5 420 S
-(bm_grd3dplot \255Igrd_sb2112_e)-2.5 E(xample_bath \\)-.15 E 15<23ad>
-110.5 432 S(Kgrd_sb2112_e)-15 E(xample_ss \255G3 \255A0.5 \\)-.15 E 15
-<23ad>110.5 444 S(E250/30 \255D0/1 \255S0/1 \255MGS-1 \255X \255V \\)-15
-E 15<23ad>110.5 456 S(Osb2112_e)-15 E(xample_bathss3d)-.15 E(#)110.5 468
-Q 2.5(#S)110.5 480 S -2.25 -.2(av e)-2.5 H -.15(ex)2.7 G(isting GMT def)
-.15 E(aults)-.1 E(echo Sa)110.5 492 Q(ving GMT def)-.2 E(aults...)-.1 E
-(gmtdef)110.5 504 Q(aults \255L > gmtdef)-.1 E(aults$$)-.1 E(#)110.5 516
-Q 2.5(#S)110.5 528 S(et ne)-2.5 E 2.5(wG)-.25 G(MT def)-2.5 E(aults)-.1
-E(echo Setting ne)110.5 540 Q 2.5(wG)-.25 G(MT def)-2.5 E(aults...)-.1 E
-(gmtset ANO)110.5 552 Q(T_FONT Helv)-.4 E(etica)-.15 E
-(gmtset LABEL_FONT Helv)110.5 564 Q(etica)-.15 E
-(gmtset HEADER_FONT Helv)110.5 576 Q(etica)-.15 E(gmtset ANO)110.5 588 Q
-(T_FONT_SIZE 8)-.4 E(gmtset LABEL_FONT_SIZE 8)110.5 600 Q
-(gmtset HEADER_FONT_SIZE 10)110.5 612 Q
-(gmtset FRAME_WIDTH 0.074999999999999997)110.5 624 Q
-(gmtset TICK_LENGTH 0.074999999999999997)110.5 636 Q(gmtset P)110.5 648
-Q -.4(AG)-.92 G(E_ORIENT).4 E -1.11(AT)-.93 G(ION LANDSCAPE)1.11 E
-(gmtset COLOR_B)110.5 660 Q -.4(AC)-.35 G(KGR).4 E(OUND 0/0/0)-.4 E
-(gmtset COLOR_FOREGR)110.5 672 Q(OUND 255/255/255)-.4 E(gmtset COLOR_N)
-110.5 684 Q(AN 255/255/255)-.35 E(#)110.5 696 Q 2.5(#M)110.5 708 S(ak)
--2.5 E 2.5(ec)-.1 G(olor palette table \214le)-2.5 E
-(echo Making color palette table \214le...)110.5 720 Q(MB-System 5.0)72
-768 Q 2.5(9J)140.11 G(anuary 2015)-2.5 E(10)193.45 E 0 Cg EP
-%%Page: 11 11
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 123.72(mbm_grd3dplot\(1\) MB-System)72 48 R
-123.72(5.0 mbm_grd3dplot\(1\))2.5 F 2.5(echo \2554500 37 57)110.5 84 R
-2.5(175 \2554350 40)2.5 F(127 251 > \\)2.5 E(sb2112_e)144 96 Q
-(xample_bathss3d.cpt)-.15 E 2.5(echo \2554350 40)110.5 108 R(127 251)2.5
-E 2.5(\2554200 50)5 F(190 255 >> \\)2.5 E(sb2112_e)144 120 Q
-(xample_bathss3d.cpt)-.15 E 2.5(echo \2554200 50)110.5 132 R(190 255)2.5
-E(\2554050 106 235 255 >> \\)5 E(sb2112_e)144 144 Q(xample_bathss3d.cpt)
--.15 E 2.5(echo \2554050)110.5 156 R(106 235 255)2.5 E
-(\2553900 138 236 174 >> \\)5 E(sb2112_e)144 168 Q(xample_bathss3d.cpt)
--.15 E 2.5(echo \2553900)110.5 180 R(138 236 174)2.5 E
-(\2553750 205 255 162 >> \\)5 E(sb2112_e)144 192 Q(xample_bathss3d.cpt)
--.15 E 2.5(echo \2553750)110.5 204 R(205 255 162)2.5 E
-(\2553600 240 236 121 >> \\)5 E(sb2112_e)144 216 Q(xample_bathss3d.cpt)
--.15 E 2.5(echo \2553600)110.5 228 R(240 236 121)2.5 E(\2553450 255 189)
-5 E(87 >> \\)5 E(sb2112_e)144 240 Q(xample_bathss3d.cpt)-.15 E 2.5
-(echo \2553450)110.5 252 R(255 189)2.5 E 2.5(87 \2553300)5 F(255 161)2.5
-E(68 >> \\)5 E(sb2112_e)144 264 Q(xample_bathss3d.cpt)-.15 E 2.5
-(echo \2553300)110.5 276 R(255 161)2.5 E 2.5(68 \2553150)5 F
-(255 186 133 >> \\)2.5 E(sb2112_e)144 288 Q(xample_bathss3d.cpt)-.15 E
-2.5(echo \2553150)110.5 300 R(255 186 133)2.5 E
-(\2553000 255 255 255 >> \\)5 E(sb2112_e)144 312 Q(xample_bathss3d.cpt)
--.15 E(#)110.5 324 Q 2.5(#R)110.5 336 S(escale data)-2.5 E
-(echo Rescaling data by \2551...)110.5 348 Q(echo Running grdmath...)
-110.5 360 Q(grdmath grd_sb2112_e)110.5 372 Q(xample_bath \2551 x = \\)
--.15 E(grd_sb2112_e)144 384 Q(xample_bath.scale)-.15 E(#)110.5 396 Q 2.5
-(#G)110.5 408 S(et shading array)-2.5 E(echo Getting shading array)110.5
-420 Q(...)-.65 E(echo Running grdhisteq...)110.5 432 Q
-(grdhisteq grd_sb2112_e)110.5 444 Q(xample_ss \\)-.15 E(-Ggrd_sb2112_e)
-144 456 Q(xample_ss.eq \255N)-.15 E(echo Running grdmath...)110.5 468 Q
-(grdmath grd_sb2112_e)110.5 480 Q(xample_ss.eq \2550.5 x \\)-.15 E 2.5
-(=g)144 492 S(rd_sb2112_e)-2.5 E(xample_ss.int)-.15 E
-(rm \255f grd_sb2112_e)110.5 504 Q(xample_ss.eq)-.15 E(#)110.5 516 Q 2.5
-(#M)110.5 528 S(ak)-2.5 E 2.5(e3)-.1 G 2.5(Dv)-2.5 G(ie)-2.5 E(w)-.25 E
-(echo Running grdvie)110.5 540 Q -.65(w.)-.25 G(..).65 E(grdvie)110.5
-552 Q 2.5(wg)-.25 G(rd_sb2112_e)-2.5 E(xample_bath.scale \\)-.15 E
-(-Jm13.678801784792578 \\)144 564 Q(-Jz0.0014760910157720331 \\)144 576
-Q(-E250/30 \\)144 588 Q(-R114.221/114.421/-31.9001/-31.6377 \\)144 600 Q
-(-Csb2112_e)144 612 Q(xample_bathss3d.cpt \\)-.15 E
-(-N-4499.4399999999996/200/200/200 \\)144 624 Q(-Igrd_sb2112_e)144 636 Q
-(xample_ss.int \\)-.15 E(-Qi \\)144 648 Q
-(-P \255X1.8081565710006675 \255Y2 \255K \255V \\)144 660 Q 2.5(>s)144
-672 S(b2112_e)-2.5 E(xample_bathss3d.ps)-.15 E(#)110.5 684 Q 2.5(#M)
-110.5 696 S(ak)-2.5 E 2.5(ec)-.1 G(olor scale)-2.5 E
-(echo Running psscale...)110.5 708 Q(psscale \255Csb2112_e)110.5 720 Q
-(xample_bathss3d.cpt \\)-.15 E(MB-System 5.0)72 768 Q 2.5(9J)140.11 G
-(anuary 2015)-2.5 E(11)193.45 E 0 Cg EP
-%%Page: 12 12
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 123.72(mbm_grd3dplot\(1\) MB-System)72 48 R
-123.72(5.0 mbm_grd3dplot\(1\))2.5 F(-D2.4418/-0.5000/4.8837/0.1500h \\)
-144 84 Q(-B":.Data V)144 96 Q(alues:" \\)-1.11 E
-(-P \255K \255O \255V >> sb2112_e)144 108 Q(xample_bathss3d.ps)-.15 E(#)
-110.5 120 Q 2.5(#M)110.5 132 S(ak)-2.5 E 2.5(eb)-.1 G(asemap)-2.5 E
-(echo Running psbasemap...)110.5 144 Q
-(psbasemap \255Jm13.678801784792578 \\)110.5 156 Q
-(-Jz0.0014760910157720331 \\)144 168 Q(-E250/30 \\)144 180 Q
-(-R114.221/114.421/-31.9001/-31.6377 \\)144 192 Q
-(-B5m/5m:."Data File grd_sb2112_e)144 204 Q(xample_bath":WSZ \\)-.15 E
-(-P \255O \255V >> sb2112_e)144 216 Q(xample_bathss3d.ps)-.15 E(#)110.5
-228 Q 2.5(#D)110.5 240 S(elete surplus \214les)-2.5 E
-(echo Deleting surplus \214les...)110.5 252 Q(rm \255f sb2112_e)110.5
-264 Q(xample_bathss3d.cpt)-.15 E(rm \255f grd_sb2112_e)110.5 276 Q
-(xample_bath.scale)-.15 E(#)110.5 288 Q 2.5(#R)110.5 300 S(eset GMT def)
--2.5 E(ault fonts)-.1 E(echo Resetting GMT fonts...)110.5 312 Q
-(mv gmtdef)110.5 324 Q(aults$$ .gmtdef)-.1 E(aults)-.1 E(#)110.5 336 Q
-2.5(#R)110.5 348 S(un xpsvie)-2.5 E(w)-.25 E(echo Running xpsvie)110.5
-360 Q 2.5(wi)-.25 G 2.5(nb)-2.5 G(ackground...)-2.5 E(xpsvie)110.5 372 Q
-2.5<77ad>-.25 G(ps a \255maxp 4m sb2112_e)-2.5 E(xample_bathss3d.ps &)
--.15 E(#)110.5 384 Q 2.5(#A)110.5 396 S(ll done!)-2.5 E(echo All done!)
-110.5 408 Q/F1 10.95/Times-Bold at 0 SF(SEE ALSO)72 436.8 Q/F2 10
-/Times-Bold at 0 SF(grdimage)108 448.8 Q F0(\(1\),)A F2(grdcontour)13.298 E
-F0(\(1\),)A F2(mbdefaults)13.298 E F0(\(1\),)A F2(mbgrid)13.298 E F0
-(\(1\),)A F2(mbsystem)13.298 E F0(\(1\),)A F2(mbm_grd3dplot)13.298 E F0
-(\(1\),)A F2(mbm_plot)108 460.8 Q F0(\(1\),)A F2(psbasemap)2.5 E F0
-(\(1\),)A F2(pstext)2.5 E F0(\(1\),)A F2(psxy)2.5 E F0(\(1\))A F1 -.11
-(BU)72 489.6 S(GS).11 E F0(By making this macro more useful, we ha)108
-501.6 Q .3 -.15(ve a)-.2 H(lso made it more comple).15 E(x.)-.15 E
-(MB-System 5.0)72 768 Q 2.5(9J)140.11 G(anuary 2015)-2.5 E(12)193.45 E 0
-Cg EP
-%%Trailer
-end
-%%EOF
diff --git a/src/ps/mbm_grdcut.ps b/src/ps/mbm_grdcut.ps
deleted file mode 100644
index 53a9002..0000000
--- a/src/ps/mbm_grdcut.ps
+++ /dev/null
@@ -1,326 +0,0 @@
-%!PS-Adobe-3.0
-%%Creator: groff version 1.19.2
-%%CreationDate: Wed Jul  1 12:29:28 2015
-%%DocumentNeededResources: font Times-Roman
-%%+ font Times-Bold
-%%+ font Times-Italic
-%%DocumentSuppliedResources: procset grops 1.19 2
-%%Pages: 2
-%%PageOrder: Ascend
-%%DocumentMedia: Default 612 792 0 () ()
-%%Orientation: Portrait
-%%EndComments
-%%BeginDefaults
-%%PageMedia: Default
-%%EndDefaults
-%%BeginProlog
-%%BeginResource: procset grops 1.19 2
-%!PS-Adobe-3.0 Resource-ProcSet
-/setpacking where{
-pop
-currentpacking
-true setpacking
-}if
-/grops 120 dict dup begin
-/SC 32 def
-/A/show load def
-/B{0 SC 3 -1 roll widthshow}bind def
-/C{0 exch ashow}bind def
-/D{0 exch 0 SC 5 2 roll awidthshow}bind def
-/E{0 rmoveto show}bind def
-/F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def
-/G{0 rmoveto 0 exch ashow}bind def
-/H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/I{0 exch rmoveto show}bind def
-/J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def
-/K{0 exch rmoveto 0 exch ashow}bind def
-/L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/M{rmoveto show}bind def
-/N{rmoveto 0 SC 3 -1 roll widthshow}bind def
-/O{rmoveto 0 exch ashow}bind def
-/P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/Q{moveto show}bind def
-/R{moveto 0 SC 3 -1 roll widthshow}bind def
-/S{moveto 0 exch ashow}bind def
-/T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/SF{
-findfont exch
-[exch dup 0 exch 0 exch neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/MF{
-findfont
-[5 2 roll
-0 3 1 roll
-neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/level0 0 def
-/RES 0 def
-/PL 0 def
-/LS 0 def
-/MANUAL{
-statusdict begin/manualfeed true store end
-}bind def
-/PLG{
-gsave newpath clippath pathbbox grestore
-exch pop add exch pop
-}bind def
-/BP{
-/level0 save def
-1 setlinecap
-1 setlinejoin
-72 RES div dup scale
-LS{
-90 rotate
-}{
-0 PL translate
-}ifelse
-1 -1 scale
-}bind def
-/EP{
-level0 restore
-showpage
-}def
-/DA{
-newpath arcn stroke
-}bind def
-/SN{
-transform
-.25 sub exch .25 sub exch
-round .25 add exch round .25 add exch
-itransform
-}bind def
-/DL{
-SN
-moveto
-SN
-lineto stroke
-}bind def
-/DC{
-newpath 0 360 arc closepath
-}bind def
-/TM matrix def
-/DE{
-TM currentmatrix pop
-translate scale newpath 0 0 .5 0 360 arc closepath
-TM setmatrix
-}bind def
-/RC/rcurveto load def
-/RL/rlineto load def
-/ST/stroke load def
-/MT/moveto load def
-/CL/closepath load def
-/Fr{
-setrgbcolor fill
-}bind def
-/setcmykcolor where{
-pop
-/Fk{
-setcmykcolor fill
-}bind def
-}if
-/Fg{
-setgray fill
-}bind def
-/FL/fill load def
-/LW/setlinewidth load def
-/Cr/setrgbcolor load def
-/setcmykcolor where{
-pop
-/Ck/setcmykcolor load def
-}if
-/Cg/setgray load def
-/RE{
-findfont
-dup maxlength 1 index/FontName known not{1 add}if dict begin
-{
-1 index/FID ne{def}{pop pop}ifelse
-}forall
-/Encoding exch def
-dup/FontName exch def
-currentdict end definefont pop
-}bind def
-/DEFS 0 def
-/EBEGIN{
-moveto
-DEFS begin
-}bind def
-/EEND/end load def
-/CNT 0 def
-/level1 0 def
-/PBEGIN{
-/level1 save def
-translate
-div 3 1 roll div exch scale
-neg exch neg exch translate
-0 setgray
-0 setlinecap
-1 setlinewidth
-0 setlinejoin
-10 setmiterlimit
-[]0 setdash
-/setstrokeadjust where{
-pop
-false setstrokeadjust
-}if
-/setoverprint where{
-pop
-false setoverprint
-}if
-newpath
-/CNT countdictstack def
-userdict begin
-/showpage{}def
-/setpagedevice{}def
-}bind def
-/PEND{
-countdictstack CNT sub{end}repeat
-level1 restore
-}bind def
-end def
-/setpacking where{
-pop
-setpacking
-}if
-%%EndResource
-%%EndProlog
-%%BeginSetup
-%%BeginFeature: *PageSize Default
-<< /PageSize [ 612 792 ] /ImagingBBox null >> setpagedevice
-%%EndFeature
-%%IncludeResource: font Times-Roman
-%%IncludeResource: font Times-Bold
-%%IncludeResource: font Times-Italic
-grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72
-def/PL 792 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron/Zcaron
-/scaron/zcaron/Ydieresis/trademark/quotesingle/Euro/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/space/exclam/quotedbl/numbersign/dollar/percent
-/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen
-/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon
-/semicolon/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O
-/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright/circumflex
-/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y
-/z/braceleft/bar/braceright/tilde/.notdef/quotesinglbase/guillemotleft
-/guillemotright/bullet/florin/fraction/perthousand/dagger/daggerdbl
-/endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut
-/dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash
-/quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen
-/brokenbar/section/dieresis/copyright/ordfeminine/guilsinglleft
-/logicalnot/minus/registered/macron/degree/plusminus/twosuperior
-/threesuperior/acute/mu/paragraph/periodcentered/cedilla/onesuperior
-/ordmasculine/guilsinglright/onequarter/onehalf/threequarters
-/questiondown/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE
-/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex
-/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis
-/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn
-/germandbls/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla
-/egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis
-/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide/oslash
-/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis]def
-/Times-Italic at 0 ENC0/Times-Italic RE/Times-Bold at 0 ENC0/Times-Bold RE
-/Times-Roman at 0 ENC0/Times-Roman RE
-%%EndSetup
-%%Page: 1 1
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 137.06(mbm_grdcut\(1\) MB-System)72 48 R 137.06
-(5.0 mbm_grdcut\(1\))2.5 F/F1 10.95/Times-Bold at 0 SF -.219(NA)72 84 S(ME)
-.219 E/F2 10/Times-Bold at 0 SF(mbm_grdcut)108 96 Q F0 2.5<ad4d>2.5 G
-(acro to e)-2.5 E(xtract a speci\214ed subarea of a GMT GRD grid \214le\
- as another GRD \214le.)-.15 E F1(VERSION)72 124.8 Q F0 -1.11(Ve)108
-136.8 S(rsion 5.0)1.11 E F1(SYNOPSIS)72 165.6 Q F0(mbm_grdcut)108 177.6
-Q F2<ad49>2.5 E/F3 10/Times-Italic at 0 SF(in\214le)A F2<ad4f>2.5 E F3
-(out\214le)A F2<ad52>2.5 E F3(w/e/s/n)A F0([)2.5 E F2<ad4820ad56>A F0(])
-A F1(DESCRIPTION)72 206.4 Q F2(mbm_grdcut)108 218.4 Q F0 .043
-(is a macro to painlessly cut out a re)2.544 F .043
-(gion from a GMT GRD grid \214le.)-.15 F .043(The GMT program grd-)5.043
-F .046(cut requires that one specify bounds which e)108 230.4 R .046
-(xactly match grid cell boundaries. Frequently)-.15 F 2.547(,o)-.65 G
-.047(ne just w)-2.547 F .047(ants to)-.1 F -.15(ex)108 242.4 S 1.749
-(tract an approximate re).15 F 1.749(gion quickly)-.15 F 4.249(,w)-.65 G
-1.748(ithout calculating grid cell sizes and boundary locations. This)
--4.249 F(macro does the the calculations and e)108 254.4 Q
-(xtracts the subre)-.15 E(gion closest to that speci\214ed by the user)
--.15 E(.)-.55 E F1 -.548(AU)72 283.2 S(THORSHIP).548 E F0(Da)108 295.2 Q
-(vid W)-.2 E 2.5(.C)-.92 G(aress \(caress at mbari.or)-2.5 E(g\))-.18 E
-(Montere)113 307.2 Q 2.5(yB)-.15 G(ay Aquarium Research Institute)-2.5 E
-(Dale N. Chayes \(dale at ldeo.columbia.edu\))108 319.2 Q
-(Lamont-Doherty Earth Observ)113 331.2 Q(atory)-.25 E F1(OPTIONS)72 360
-Q F2<ad48>108 372 Q F0 .162(This "help" \215ag cause the program to pri\
-nt out a description of its operation and then e)22.52 F .162
-(xit immedi-)-.15 F(ately)144 384 Q(.)-.65 E F2<ad49>108 400.8 Q F3
-(in\214le)26.41 E F0(Sets the \214lename of the input GMT grid \214le. \
-This \214le must be in the GMT NetCDF GRD format.)144 412.8 Q F2<ad4f>
-108 429.6 Q F3(out\214le)22.52 E F0(Sets the \214lename of the output G\
-MT grid \214le. This \214le will be in the GMT NetCDF GRD format.)144
-441.6 Q F2<ad52>108 458.4 Q F3(w/e/s/n)23.08 E F0
-(Sets the bounds of the area to be e)144 470.4 Q
-(xtracted from the input grid \214le.)-.15 E F2<ad56>108 487.2 Q F0(The)
-23.08 E F2<ad56>2.5 E F0(option causes)2.5 E F2(mbm_grdcut)2.5 E F0
-(to print out status messages.)2.5 E F1(EXAMPLES)72 516 Q F0 .714
-(Suppose that we ha)108 528 R 1.013 -.15(ve u)-.2 H(sed).15 E F2(mbgrid)
-3.213 E F0 .713(to obtain a topograph)3.213 F 3.213(yg)-.05 G .713
-(rid \214le called K)-3.213 F .713(ohalaA_bath.grd in the GMT)-.35 F
-(NetCDF GRD format:)108 540 Q(mbgrid \255Idatalist \\)118 552 Q(\255OK)
-128 564 Q(ohalaA_bath \\)-.35 E
-(\255R-155.72855/-155.31928/20.09488/20.47645 \\)128 576 Q
-(\255E30.0/0m! \255A2 \255N \255G3 \255C1 \255V)128 588 Q .372
-(Further suppose that one wishes to e)108 600 R .372
-(xtract a smaller grid with bounds of 155 de)-.15 F .372
-(grees 31 minutes W to 155)-.15 F(de)108 612 Q .862
-(grees 26 minutes W in longitude and 20 de)-.15 F .862
-(grees 13 minutes N to 20 de)-.15 F .862
-(grees 18 minutes N in latitude.)-.15 F .982(This can be done using the)
-108 624 R F2(GMT)3.482 E F0(program)3.482 E F2(grdcut)3.482 E F0 3.482
-(,b)C(ut)-3.682 E F2(grdcut)3.482 E F0 .983
-(requires that the user specify bounds that)3.482 F -.15(ex)108 636 S
-.224(actly match the grid cell boundaries in the \214le.).15 F(The)5.224
-E F2(mbm_grdcut)2.724 E F0 .224(macros allo)2.724 F .223
-(ws one to specify approxi-)-.25 F .762
-(mate desired bounds, calculates the e)108 648 R .762
-(xact, nearest bounds that)-.15 F F2(grdcut)3.262 E F0 .762
-(will accept, and then e)3.262 F -.15(xe)-.15 G(cutes).15 E F2(grd-)
-3.262 E(cut)108 660 Q F0(.)A 1.6 -.8(To o)108 684 T
-(btain the desired sub-grid, the follo).8 E(wing will suf)-.25 E
-(\214ce:)-.25 E 3.55(mbm_grdcut \255I K)118 696 R 23.55
-(ohalaA_bath.grd \255O)-.35 F -.35(Ko)6.05 G 23.55
-(hala_plunge.grd \255R-155:31/-155:26/20:13/20:18).35 F<ad56>108 708 Q
-(The resulting output is:)108 720 Q(MB-System 5.0)72 768 Q 2.5(9N)
-134.705 G -.15(ove)-2.5 G(mber 2014).15 E(1)193.045 E 0 Cg EP
-%%Page: 2 2
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 137.06(mbm_grdcut\(1\) MB-System)72 48 R 137.06
-(5.0 mbm_grdcut\(1\))2.5 F(Program mbm_grdcut status:)118 84 Q
-(Input GRD \214le:)128 96 Q -.35(Ko)22.5 G(halaA_bath.grd).35 E
-(Output GRD \214le:)128 108 Q -.35(Ko)20 G(hala_plunge.grd).35 E
-(Input Grid bounds:)128 120 Q(\255155.72855 \255155.3192906)15 E
-(20.09488 20.47628103)5 E(Input grid dimensions:)128 132 Q 2.5
-(1426 1329)5 F(Grid cell sizes:)128 144 Q 2.5
-(0.0002871995719 0.0002871995719)20 F(Requested Grid bounds:)128 156 Q
-(\255155.516667 \255155.433333)5 E(20.216667 20.3)5 E
-(Output Grid bounds:)128 168 Q(\255155.516884 \255155.433596)12.5 E
-(20.216653 20.299940)5 E(Output grid dimensions: 291)128 180 Q(291)5 E
-(Running grdcut...)118 204 Q(grdcut K)118 216 Q(ohalaA_bath.grd \255GK)
--.35 E(ohala_plunge.grd \255R-155.516884/-155.433596/20.216653/20.29994\
-0 \255V)-.35 E(grdcut: File spec:)118 228 Q 2.5(WESNd)10 G 2.5(xd)-2.5 G
-2.5(yn)-2.5 G 2.5(xn)-2.5 G(y:)-2.65 E(grdcut: Old: \255155.729 \255155\
-.319 20.0949 20.4763 0.0002872 0.0002872 1426 1329)118 240 Q(grdcut: Ne)
-118 252 Q
-(w: \255155.517 \255155.434 20.2167 20.2999 0.0002872 0.0002872)-.25 E
-2.5(291 291)5 F/F1 10.95/Times-Bold at 0 SF(SEE ALSO)72 292.8 Q/F2 10
-/Times-Bold at 0 SF(mbsystem)108 304.8 Q F0(\(1\),)A F2(mbgrid)2.5 E F0
-(\(1\),)A F2(mbmosaic)2.5 E F0(\(1\),)A F2(mbm_grid)2.5 E F0(\(1\),)A F2
-(mbm_grdplot)2.5 E F0(\(1\))A F1 -.11(BU)72 333.6 S(GS).11 E F0
-(Probably)108 345.6 Q(.)-.65 E(MB-System 5.0)72 768 Q 2.5(9N)134.705 G
--.15(ove)-2.5 G(mber 2014).15 E(2)193.045 E 0 Cg EP
-%%Trailer
-end
-%%EOF
diff --git a/src/ps/mbm_grdinfo.ps b/src/ps/mbm_grdinfo.ps
deleted file mode 100644
index 2c36c3e..0000000
--- a/src/ps/mbm_grdinfo.ps
+++ /dev/null
@@ -1,298 +0,0 @@
-%!PS-Adobe-3.0
-%%Creator: groff version 1.19.2
-%%CreationDate: Wed Jul  1 12:29:28 2015
-%%DocumentNeededResources: font Times-Roman
-%%+ font Times-Bold
-%%+ font Times-Italic
-%%DocumentSuppliedResources: procset grops 1.19 2
-%%Pages: 2
-%%PageOrder: Ascend
-%%DocumentMedia: Default 612 792 0 () ()
-%%Orientation: Portrait
-%%EndComments
-%%BeginDefaults
-%%PageMedia: Default
-%%EndDefaults
-%%BeginProlog
-%%BeginResource: procset grops 1.19 2
-%!PS-Adobe-3.0 Resource-ProcSet
-/setpacking where{
-pop
-currentpacking
-true setpacking
-}if
-/grops 120 dict dup begin
-/SC 32 def
-/A/show load def
-/B{0 SC 3 -1 roll widthshow}bind def
-/C{0 exch ashow}bind def
-/D{0 exch 0 SC 5 2 roll awidthshow}bind def
-/E{0 rmoveto show}bind def
-/F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def
-/G{0 rmoveto 0 exch ashow}bind def
-/H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/I{0 exch rmoveto show}bind def
-/J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def
-/K{0 exch rmoveto 0 exch ashow}bind def
-/L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/M{rmoveto show}bind def
-/N{rmoveto 0 SC 3 -1 roll widthshow}bind def
-/O{rmoveto 0 exch ashow}bind def
-/P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/Q{moveto show}bind def
-/R{moveto 0 SC 3 -1 roll widthshow}bind def
-/S{moveto 0 exch ashow}bind def
-/T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/SF{
-findfont exch
-[exch dup 0 exch 0 exch neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/MF{
-findfont
-[5 2 roll
-0 3 1 roll
-neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/level0 0 def
-/RES 0 def
-/PL 0 def
-/LS 0 def
-/MANUAL{
-statusdict begin/manualfeed true store end
-}bind def
-/PLG{
-gsave newpath clippath pathbbox grestore
-exch pop add exch pop
-}bind def
-/BP{
-/level0 save def
-1 setlinecap
-1 setlinejoin
-72 RES div dup scale
-LS{
-90 rotate
-}{
-0 PL translate
-}ifelse
-1 -1 scale
-}bind def
-/EP{
-level0 restore
-showpage
-}def
-/DA{
-newpath arcn stroke
-}bind def
-/SN{
-transform
-.25 sub exch .25 sub exch
-round .25 add exch round .25 add exch
-itransform
-}bind def
-/DL{
-SN
-moveto
-SN
-lineto stroke
-}bind def
-/DC{
-newpath 0 360 arc closepath
-}bind def
-/TM matrix def
-/DE{
-TM currentmatrix pop
-translate scale newpath 0 0 .5 0 360 arc closepath
-TM setmatrix
-}bind def
-/RC/rcurveto load def
-/RL/rlineto load def
-/ST/stroke load def
-/MT/moveto load def
-/CL/closepath load def
-/Fr{
-setrgbcolor fill
-}bind def
-/setcmykcolor where{
-pop
-/Fk{
-setcmykcolor fill
-}bind def
-}if
-/Fg{
-setgray fill
-}bind def
-/FL/fill load def
-/LW/setlinewidth load def
-/Cr/setrgbcolor load def
-/setcmykcolor where{
-pop
-/Ck/setcmykcolor load def
-}if
-/Cg/setgray load def
-/RE{
-findfont
-dup maxlength 1 index/FontName known not{1 add}if dict begin
-{
-1 index/FID ne{def}{pop pop}ifelse
-}forall
-/Encoding exch def
-dup/FontName exch def
-currentdict end definefont pop
-}bind def
-/DEFS 0 def
-/EBEGIN{
-moveto
-DEFS begin
-}bind def
-/EEND/end load def
-/CNT 0 def
-/level1 0 def
-/PBEGIN{
-/level1 save def
-translate
-div 3 1 roll div exch scale
-neg exch neg exch translate
-0 setgray
-0 setlinecap
-1 setlinewidth
-0 setlinejoin
-10 setmiterlimit
-[]0 setdash
-/setstrokeadjust where{
-pop
-false setstrokeadjust
-}if
-/setoverprint where{
-pop
-false setoverprint
-}if
-newpath
-/CNT countdictstack def
-userdict begin
-/showpage{}def
-/setpagedevice{}def
-}bind def
-/PEND{
-countdictstack CNT sub{end}repeat
-level1 restore
-}bind def
-end def
-/setpacking where{
-pop
-setpacking
-}if
-%%EndResource
-%%EndProlog
-%%BeginSetup
-%%BeginFeature: *PageSize Default
-<< /PageSize [ 612 792 ] /ImagingBBox null >> setpagedevice
-%%EndFeature
-%%IncludeResource: font Times-Roman
-%%IncludeResource: font Times-Bold
-%%IncludeResource: font Times-Italic
-grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72
-def/PL 792 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron/Zcaron
-/scaron/zcaron/Ydieresis/trademark/quotesingle/Euro/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/space/exclam/quotedbl/numbersign/dollar/percent
-/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen
-/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon
-/semicolon/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O
-/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright/circumflex
-/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y
-/z/braceleft/bar/braceright/tilde/.notdef/quotesinglbase/guillemotleft
-/guillemotright/bullet/florin/fraction/perthousand/dagger/daggerdbl
-/endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut
-/dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash
-/quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen
-/brokenbar/section/dieresis/copyright/ordfeminine/guilsinglleft
-/logicalnot/minus/registered/macron/degree/plusminus/twosuperior
-/threesuperior/acute/mu/paragraph/periodcentered/cedilla/onesuperior
-/ordmasculine/guilsinglright/onequarter/onehalf/threequarters
-/questiondown/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE
-/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex
-/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis
-/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn
-/germandbls/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla
-/egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis
-/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide/oslash
-/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis]def
-/Times-Italic at 0 ENC0/Times-Italic RE/Times-Bold at 0 ENC0/Times-Bold RE
-/Times-Roman at 0 ENC0/Times-Roman RE
-%%EndSetup
-%%Page: 1 1
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 133.17(mbm_grdinfo\(1\) MB-System)72 48 R 133.17
-(5.0 mbm_grdinfo\(1\))2.5 F/F1 10.95/Times-Bold at 0 SF -.219(NA)72 84 S
-(ME).219 E/F2 10/Times-Bold at 0 SF(mbm_grdinf)108 96 Q(o)-.25 E F0 2.798
-<ad4d>2.798 G .298(acro to get information re)-2.798 F -.05(ga)-.15 G
-.297(rding a GMT grd \214le when the re).05 F .297
-(gion of interest is a subset)-.15 F(of the area co)108 108 Q -.15(ve)
--.15 G(red in the input \214le.).15 E F1(VERSION)72 136.8 Q F0 -1.11(Ve)
-108 148.8 S(rsion 5.0)1.11 E F1(SYNOPSIS)72 177.6 Q F0(mbm_grdinfo)108
-189.6 Q F2<ad49>2.5 E/F3 10/Times-Italic at 0 SF(in\214le)A F0([)2.5 E F2
-<ad52>A F3(w/e/s/n)A F2<ad4820ad56>2.5 E F0(])A F1(DESCRIPTION)72 218.4
-Q F2(mbm_grdinf)108 230.4 Q(o)-.25 E F0 .33
-(is a macro to get information re)2.83 F -.05(ga)-.15 G .33
-(rding a GMT grd \214le when the re).05 F .33
-(gion of interest is a sub-)-.15 F .152(set of the area co)108 242.4 R
--.15(ve)-.15 G .152(red in the input \214le. If no bounds are speci\214\
-ed, the program grdinfo is called directly).15 F 5.152(.I)-.65 G(f)
--5.152 E 1.174
-(longitude and latitude bounds are speci\214ed, then the speci\214ed re)
-108 254.4 R 1.174(gion is cut from the input \214le using the)-.15 F(ma\
-cro mbm_grdinfo, and the information is obtained from the subset tempor\
-ary grd \214le using grdinfo.)108 266.4 Q F1 -.548(AU)72 295.2 S
-(THORSHIP).548 E F0(Da)108 307.2 Q(vid W)-.2 E 2.5(.C)-.92 G
-(aress \(caress at mbari.or)-2.5 E(g\))-.18 E(Montere)113 319.2 Q 2.5(yB)
--.15 G(ay Aquarium Research Institute)-2.5 E
-(Dale N. Chayes \(dale at ldeo.columbia.edu\))108 331.2 Q
-(Lamont-Doherty Earth Observ)113 343.2 Q(atory)-.25 E F1(OPTIONS)72 372
-Q F2<ad48>108 384 Q F0 .162(This "help" \215ag cause the program to pri\
-nt out a description of its operation and then e)22.52 F .161
-(xit immedi-)-.15 F(ately)144 396 Q(.)-.65 E F2<ad49>108 412.8 Q F3
-(in\214le)26.41 E F0(Sets the \214lename of the input GMT grid \214le. \
-This \214le must be in the GMT NetCDF GRD format.)144 424.8 Q F2<ad52>
-108 441.6 Q F3(w/e/s/n)23.08 E F0 .289(Sets the bounds of the area of i\
-nterest in the grid \214le. The information reported will pertain to th\
-is)144 453.6 R(area only)144 465.6 Q(.)-.65 E F2<ad56>108 482.4 Q F0
-(The)23.08 E F2<ad56>2.5 E F0(option causes)2.5 E F2(mbm_grdinf)2.5 E(o)
--.25 E F0(to print out status messages.)2.5 E F1(EXAMPLES)72 511.2 Q F0
-.714(Suppose that we ha)108 523.2 R 1.013 -.15(ve u)-.2 H(sed).15 E F2
-(mbgrid)3.213 E F0 .713(to obtain a topograph)3.213 F 3.213(yg)-.05 G
-.713(rid \214le called K)-3.213 F .713(ohalaA_bath.grd in the GMT)-.35 F
-(NetCDF GRD format:)108 535.2 Q(mbgrid \255Idatalist \\)144 547.2 Q(-OK)
-180 559.2 Q(ohalaA_bath \\)-.35 E
-(-R-155.72855/-155.31928/20.09488/20.47645 \\)180 571.2 Q
-(-E30.0/0m! \255A2 \255N \255G3 \255C1 \255V)180 583.2 Q .309(Further s\
-uppose that one wishes to determine the depth range in a smaller area w\
-ith bounds of 155 de)108 595.2 R(grees)-.15 E .958
-(31 minutes W to 155 de)108 607.2 R .958
-(grees 26 minutes W in longitude and 20 de)-.15 F .958
-(grees 13 minutes N to 20 de)-.15 F .958(grees 18)-.15 F
-(minutes N in latitude. The follo)108 619.2 Q(wing will suf)-.25 E
-(\214ce:)-.25 E 17.96(mbm_grdinfo \255I K)144 631.2 R 88.69
-(ohalaA_bath.grd -R-155:31/-155:26/20:13/20:18)-.35 F(-V)159.38 643.2 Q
-F1(SEE ALSO)72 672 Q F2(mbsystem)108 684 Q F0(\(1\),)A F2(mbm_grdplot)
-2.5 E F0(\(1\),)A F2(mbm_grdinf)2.5 E(o)-.25 E F0(\(1\))A(MB-System 5.0)
-72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(1)204.835 E 0 Cg EP
-%%Page: 2 2
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 133.17(mbm_grdinfo\(1\) MB-System)72 48 R 133.17
-(5.0 mbm_grdinfo\(1\))2.5 F/F1 10.95/Times-Bold at 0 SF -.11(BU)72 84 S(GS)
-.11 E F0(This macro is ne)108 96 Q 2.5(wa)-.25 G(nd hasn')-2.5 E 2.5(tb)
--.18 G(een tested in serious usage yet \255 let us kno)-2.5 E 2.5(ww)
--.25 G(hat to \214x, add, or change!.)-2.5 E(MB-System 5.0)72 768 Q 2.5
-(3J)146.495 G(une 2013)-2.5 E(2)204.835 E 0 Cg EP
-%%Trailer
-end
-%%EOF
diff --git a/src/ps/mbm_grdplot.ps b/src/ps/mbm_grdplot.ps
deleted file mode 100644
index cb3a0ad..0000000
--- a/src/ps/mbm_grdplot.ps
+++ /dev/null
@@ -1,1644 +0,0 @@
-%!PS-Adobe-3.0
-%%Creator: groff version 1.19.2
-%%CreationDate: Wed Jul  1 12:29:28 2015
-%%DocumentNeededResources: font Times-Roman
-%%+ font Times-Bold
-%%+ font Times-Italic
-%%DocumentSuppliedResources: procset grops 1.19 2
-%%Pages: 16
-%%PageOrder: Ascend
-%%DocumentMedia: Default 612 792 0 () ()
-%%Orientation: Portrait
-%%EndComments
-%%BeginDefaults
-%%PageMedia: Default
-%%EndDefaults
-%%BeginProlog
-%%BeginResource: procset grops 1.19 2
-%!PS-Adobe-3.0 Resource-ProcSet
-/setpacking where{
-pop
-currentpacking
-true setpacking
-}if
-/grops 120 dict dup begin
-/SC 32 def
-/A/show load def
-/B{0 SC 3 -1 roll widthshow}bind def
-/C{0 exch ashow}bind def
-/D{0 exch 0 SC 5 2 roll awidthshow}bind def
-/E{0 rmoveto show}bind def
-/F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def
-/G{0 rmoveto 0 exch ashow}bind def
-/H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/I{0 exch rmoveto show}bind def
-/J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def
-/K{0 exch rmoveto 0 exch ashow}bind def
-/L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/M{rmoveto show}bind def
-/N{rmoveto 0 SC 3 -1 roll widthshow}bind def
-/O{rmoveto 0 exch ashow}bind def
-/P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/Q{moveto show}bind def
-/R{moveto 0 SC 3 -1 roll widthshow}bind def
-/S{moveto 0 exch ashow}bind def
-/T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/SF{
-findfont exch
-[exch dup 0 exch 0 exch neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/MF{
-findfont
-[5 2 roll
-0 3 1 roll
-neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/level0 0 def
-/RES 0 def
-/PL 0 def
-/LS 0 def
-/MANUAL{
-statusdict begin/manualfeed true store end
-}bind def
-/PLG{
-gsave newpath clippath pathbbox grestore
-exch pop add exch pop
-}bind def
-/BP{
-/level0 save def
-1 setlinecap
-1 setlinejoin
-72 RES div dup scale
-LS{
-90 rotate
-}{
-0 PL translate
-}ifelse
-1 -1 scale
-}bind def
-/EP{
-level0 restore
-showpage
-}def
-/DA{
-newpath arcn stroke
-}bind def
-/SN{
-transform
-.25 sub exch .25 sub exch
-round .25 add exch round .25 add exch
-itransform
-}bind def
-/DL{
-SN
-moveto
-SN
-lineto stroke
-}bind def
-/DC{
-newpath 0 360 arc closepath
-}bind def
-/TM matrix def
-/DE{
-TM currentmatrix pop
-translate scale newpath 0 0 .5 0 360 arc closepath
-TM setmatrix
-}bind def
-/RC/rcurveto load def
-/RL/rlineto load def
-/ST/stroke load def
-/MT/moveto load def
-/CL/closepath load def
-/Fr{
-setrgbcolor fill
-}bind def
-/setcmykcolor where{
-pop
-/Fk{
-setcmykcolor fill
-}bind def
-}if
-/Fg{
-setgray fill
-}bind def
-/FL/fill load def
-/LW/setlinewidth load def
-/Cr/setrgbcolor load def
-/setcmykcolor where{
-pop
-/Ck/setcmykcolor load def
-}if
-/Cg/setgray load def
-/RE{
-findfont
-dup maxlength 1 index/FontName known not{1 add}if dict begin
-{
-1 index/FID ne{def}{pop pop}ifelse
-}forall
-/Encoding exch def
-dup/FontName exch def
-currentdict end definefont pop
-}bind def
-/DEFS 0 def
-/EBEGIN{
-moveto
-DEFS begin
-}bind def
-/EEND/end load def
-/CNT 0 def
-/level1 0 def
-/PBEGIN{
-/level1 save def
-translate
-div 3 1 roll div exch scale
-neg exch neg exch translate
-0 setgray
-0 setlinecap
-1 setlinewidth
-0 setlinejoin
-10 setmiterlimit
-[]0 setdash
-/setstrokeadjust where{
-pop
-false setstrokeadjust
-}if
-/setoverprint where{
-pop
-false setoverprint
-}if
-newpath
-/CNT countdictstack def
-userdict begin
-/showpage{}def
-/setpagedevice{}def
-}bind def
-/PEND{
-countdictstack CNT sub{end}repeat
-level1 restore
-}bind def
-end def
-/setpacking where{
-pop
-setpacking
-}if
-%%EndResource
-%%EndProlog
-%%BeginSetup
-%%BeginFeature: *PageSize Default
-<< /PageSize [ 612 792 ] /ImagingBBox null >> setpagedevice
-%%EndFeature
-%%IncludeResource: font Times-Roman
-%%IncludeResource: font Times-Bold
-%%IncludeResource: font Times-Italic
-grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72
-def/PL 792 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron/Zcaron
-/scaron/zcaron/Ydieresis/trademark/quotesingle/Euro/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/space/exclam/quotedbl/numbersign/dollar/percent
-/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen
-/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon
-/semicolon/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O
-/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright/circumflex
-/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y
-/z/braceleft/bar/braceright/tilde/.notdef/quotesinglbase/guillemotleft
-/guillemotright/bullet/florin/fraction/perthousand/dagger/daggerdbl
-/endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut
-/dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash
-/quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen
-/brokenbar/section/dieresis/copyright/ordfeminine/guilsinglleft
-/logicalnot/minus/registered/macron/degree/plusminus/twosuperior
-/threesuperior/acute/mu/paragraph/periodcentered/cedilla/onesuperior
-/ordmasculine/guilsinglright/onequarter/onehalf/threequarters
-/questiondown/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE
-/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex
-/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis
-/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn
-/germandbls/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla
-/egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis
-/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide/oslash
-/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis]def
-/Times-Italic at 0 ENC0/Times-Italic RE/Times-Bold at 0 ENC0/Times-Bold RE
-/Times-Roman at 0 ENC0/Times-Roman RE
-%%EndSetup
-%%Page: 1 1
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 133.72(mbm_grdplot\(1\) MB-System)72 48 R 133.72
-(5.0 mbm_grdplot\(1\))2.5 F/F1 10.95/Times-Bold at 0 SF -.219(NA)72 84 S
-(ME).219 E/F2 10/Times-Bold at 0 SF(mbm_grdplot)108 96 Q F0 3.929<ad43>
-3.929 G 1.428(reate an e)-3.929 F -.15(xe)-.15 G 1.428
-(cutable shellscript which will generate a GMT map of gridded data in a)
-.15 F(GMT grd \214le.)108 108 Q F1(VERSION)72 136.8 Q F0 -1.11(Ve)108
-148.8 S(rsion 5.0)1.11 E F1(SYNOPSIS)72 177.6 Q F2 5.677
-(mbm_grdplot \255I)108 189.6 R/F3 10/Times-Italic at 0 SF(\214le)A F0([)
-8.177 E F2<ad41>A F0([)A F3(ma)A(gnitude)-.1 E F0([)A F3(/azimuth/ele)A
-(vation)-.15 E F0(])A F2<ad43>8.178 E F0([)A F3(contour_contr)A(ol)-.45
-E F0(])A F2<ad44>8.178 E F0([)A F3(\215ipcolor/\215ipshade)A F0(])A F2
-<ad47>108 201.6 Q F3(color_mode)A F2 6.002<ad4820ad4b>8.502 F F3
-(intensity_\214le)A F2<ad4f>8.501 E F3 -.45(ro)C(ot).45 E F2<ad50>8.501
-E F3(pa)A -.1(ge)-.1 G(size).1 E F2<ad53>8.501 E F3([color/shade])A F2
-6.001<ad5420ad55>8.501 F F3(orientation)A F2<ad56>8.501 E<ad57>108 213.6
-Q F3([color_style)A F0([)A F3(/palette)A F0([)A F3(ncolor)A(s)-.1 E F0
-(]] |)A F3(cpt\214le])2.5 E F0(])2.5 E(Additional Options:)108 237.6 Q
-([)108 249.6 Q F2<ad42>A F3(tic)A(kinfo)-.2 E F2<ad46>3.687 E F3
-(contour_\214le)A F2<ad4a>3.687 E F3(pr)A 1.188
-(ojection[/scale | width])-.45 F F2<ad4c>3.688 E F3(title[:scale_label])
-A F2<ad4d>3.688 E F3(misc)A F2 1.188<ad5120ad52>3.688 F F3(w/e/s/n)A F2
-<ad58>3.688 E<ad5920ad5a>108 261.6 Q F3(min/max[/mode] ])A
-(Miscellaneous Options:)108 285.6 Q([)108 297.6 Q F2(\255MGD)A F3
-(gmtdef/value)A F2(\255MGF)14.33 E F3(scale_loc)A F2(\255MGL)11.83 E F3
-([f][x]lon0/lat0/slat/length[units][+llabel])A F2(\255MGQ)11.83 E F3
-(dpi)A F2(\255MGS)108 309.6 Q F3(scalefactor)A F2(\255MGT)65.89 E F3
-(x/y/size/angle/font/just/te)A(xt)-.2 E F2(\255MGU[)65.89 E F3(/dx/dy/)A
-F2(][)A F3(label)A F2(])A(\255MCA)108 321.6 Q F3(anot_int/)A F2([)A F3
--.18(ff)C(ont_size).18 E F2(][)A F3(aangle)A F2(][)A F3(/r/g/b)A F2(][)A
-F3(o)A F2 .994(]] \255MCG)B F3(gap/width)A F2(\255MCQ)3.493 E F3(cut)A
-F2(\255MCT[)3.493 E F3(+|-)A F2(][)A F3(gap/length)A F2(][)A F3(:LH)A F2
-(])A(\255MCW)108 333.6 Q F3(type)A F2([)A F3(pen)A F2 9.92<5dad>C(MN)
--9.92 E(A)-.2 E F3 7.42([nhgt[/P] | P])B F2(\255MNF)9.92 E F3(format)A
-F2(\255MNI)9.92 E F3(swathdata)A F2(\255MNN[)9.92 E F3(ttic)A
-(k/tannot/dan-)-.2 E(not/tlen)108 345.6 Q F2([)A F3(/nhgt)A F2 6.569(]|)
-C F3(F)A F2(|)6.568 E F3(FP)6.568 E F2 6.568<5dad>C(MNP[)-6.568 E F3
-(pingnumber_tic)A(k/pingnumber_annot/pingnumber_tic)-.2 E(k_len)-.2 E F2
-6.568<5dad>C(MTC)-6.568 E F3(\214ll)A F2(\255MTD)108 357.6 Q F3 -.37(re)
-C(solution).37 E F2(\255MTG)7.788 E F3(\214ll)A F2(\255MTI)7.788 E F3
-(river[/pen])A F2(\255MTN)7.788 E F3(bor)A(der[/pen])-.37 E F2(\255MTS)
-7.788 E F3(\214ll)A F2(\255MTW)7.789 E F3(pen)A F2(\255MXG)7.789 E F3
-(\214ll)A F2(\255MXI)108 369.6 Q F3(xy_\214le)A F2(\255MXM \255MXS)2.5 E
-F3(symbol/size)A F2(\255MXW)2.5 E F3(pen)A F2(])A F1(DESCRIPTION)72
-398.4 Q F2(mbm_grdplot)108 410.4 Q F0 .399
-(is a macro that generates a shellscript of)2.899 F F2(GMT)2.899 E F0
-.398(commands which, when e)2.899 F -.15(xe)-.15 G .398
-(cuted, will gen-).15 F .716(erate a Postscript plot of gridded data.)
-108 422.4 R(Se)5.716 E -.15(ve)-.25 G .717
-(ral styles of plots can be generated, including color \214ll maps,).15
-F 1.636(contour maps, color \214ll maps o)108 434.4 R -.15(ve)-.15 G
-1.636
-(rlaid with contours, shaded relief color maps, slope magnitude maps,)
-.15 F .266(coastline maps, te)108 446.4 R .266
-(xt labels, and xy data in lines or symbols. Fi)-.15 F .567 -.15(ve d)
--.25 H(if).15 E .267(ferent color schemes are included.)-.25 F(The)5.267
-E .313(plot will be scaled to \214t on the speci\214ed page size or)108
-458.4 R 2.813(,i)-.4 G 2.813(ft)-2.813 G .312
-(he scale is user de\214ned, the page size will be cho-)-2.813 F .56(se\
-n in accordance with the plot size. The primary purpose of this macro i\
-s to allo)108 470.4 R 3.061(wt)-.25 G .561(he simple, semi-auto-)-3.061
-F .565(mated production of nice looking maps with a fe)108 482.4 R 3.064
-(wc)-.25 G .564(ommand line ar)-3.064 F .564(guments. F)-.18 F .564
-(or users seeking more con-)-.15 F 1.527(trol o)108 494.4 R -.15(ve)-.15
-G 4.027(rt).15 G 1.527
-(he plot appearance, a number of additional optional ar)-4.027 F 1.527
-(guments are pro)-.18 F 1.528(vided. T)-.15 F 1.528(ruly ambitious)-.35
-F .827(users may edit the plot shellscript to tak)108 506.4 R 3.327(ea)
--.1 G(dv)-3.327 E .827(antage of)-.25 F F2(GMT)3.327 E F0 .827
-(capabilities not supported by this macro. A)3.327 F .055
-(companion macro)108 518.4 R F2(mbm_grd3dplot)2.555 E F0 .056
-(can be used similarly to generate 3D perspecti)2.555 F .356 -.15(ve v)
--.25 H(ie).15 E .056(ws of gridded data.)-.25 F .084(By def)108 542.4 R
-.083(ault the output plot generation shellscript includes lines which e)
--.1 F -.15(xe)-.15 G .083(cute a program to display the Post-).15 F .807
-(script image on the screen. The program to be used to display the Post\
-script is set using)108 554.4 R F2(mbdefaults)3.308 E F0 3.308(;t)C(he)
--3.308 E(def)108 566.4 Q .326(ault v)-.1 F .326(alue can be o)-.25 F
--.15(ve)-.15 G .325(rridden by setting the en).15 F .325(vironment v)-.4
-F .325(ariable $MB_PS_VIEWER.)-.25 F(In)5.325 E -.2(vo)-.4 G .325
-(king the plot).2 F(generation shellscript with a)108 578.4 Q F2(-N)2.5
-E F0(command line ar)2.5 E
-(gument suppresses the screen display of the plot.)-.18 E .305
-(The plot scripts generated by this macro will w)108 602.4 R .305
-(ork with GMT v)-.1 F .305(ersion 5.0 and later)-.15 F 2.805(,a)-.4 G
-.305(nd are not compatible)-2.805 F(with earlier v)108 614.4 Q
-(ersions of GMT)-.15 E(.)-.74 E F1 -.548(AU)72 643.2 S(THORSHIP).548 E
-F0(Da)108 655.2 Q(vid W)-.2 E 2.5(.C)-.92 G(aress \(caress at mbari.or)-2.5
-E(g\))-.18 E(Montere)113 667.2 Q 2.5(yB)-.15 G
-(ay Aquarium Research Institute)-2.5 E
-(Dale N. Chayes \(dale at ldeo.columbia.edu\))108 679.2 Q
-(Lamont-Doherty Earth Observ)113 691.2 Q(atory)-.25 E(MB-System 5.0)72
-768 Q 2.5(9J)140.11 G(anuary 2015)-2.5 E(1)198.45 E 0 Cg EP
-%%Page: 2 2
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 133.72(mbm_grdplot\(1\) MB-System)72 48 R 133.72
-(5.0 mbm_grdplot\(1\))2.5 F/F1 10.95/Times-Bold at 0 SF
-(SIMPLE DESCRIPTION OF B)72 84 Q(ASIC OPTIONS)-.329 E/F2 10/Times-Bold at 0
-SF<ad41>108 96 Q/F3 10/Times-Italic at 0 SF(ma)23.08 E
-(gnitude[/azimuth/ele)-.1 E(vation])-.15 E F0 1.15(Sets the parameters \
-which control the synthetic illumination of the gridded data \(shaded r\
-elief\).)144 108 R .05(The v)144 120 R(alue)-.25 E F3(ma)2.55 E(gnitude)
--.1 E F0 .05(is an ef)2.55 F(fecti)-.25 E .351 -.15(ve ve)-.25 H .051
-(rtical e).15 F .051
-(xageration which modulates the intensity of the shad-)-.15 F .882
-(ing; typical v)144 132 R .882(alues are in the 0.1 to 10 range.)-.25 F
-.882(The v)5.882 F(alue)-.25 E F3(azimuth)3.382 E F0 .881
-(is the azimuth in de)3.381 F .881(grees from)-.15 F .628
-(north from which the data is illuminated.)144 144 R .629(The v)5.629 F
-(alue)-.25 E F3(ele)3.129 E(vation)-.15 E F0 .629(is the ele)3.129 F
--.25(va)-.25 G .629(tion of the illumination).25 F(in de)144 156 Q
-(grees from horizontal.)-.15 E(Def)5 E(aults:)-.1 E F3(ma)2.5 E(gnitude)
--.1 E F0 2.5(=0)2.5 G(.2;)-2.5 E F3(azimuth)2.5 E F0 2.5(=0)2.5 G(.0;)
--2.5 E F3(ele)2.5 E(vation)-.15 E F0 2.5(=3)2.5 G(0.0;)-2.5 E F2<ad43>
-108 172.8 Q F3(contour_contr)23.08 E(ol)-.45 E F0(If)144 184.8 Q F2
-<ad43>3.459 E F0 .959(is gi)3.459 F -.15(ve)-.25 G 3.459(na).15 G .959
-(lone, it causes unannotated contours to be dra)-3.459 F .958
-(wn using a contour interv)-.15 F .958(al calcu-)-.25 F .214
-(lated from the data. The user may also use)144 196.8 R F3
-(contour_contr)2.714 E(ol)-.45 E F0 .215(to specify the contour interv)
-2.714 F .215(al. See the)-.25 F
-(COMPLETE DESCRIPTION OF OPTIONS section belo)144 208.8 Q 2.5(wf)-.25 G
-(or a more complete discussion.)-2.5 E F2<ad44>108 225.6 Q F3
-([\215ipcolor/\215ipshade])23.08 E F0(Normally)144 237.6 Q 3.321(,t)-.65
-G .821(he color or grayscale tables used for color maps run from cool c\
-olors \(or dark grays\))-3.321 F 1.289(for lo)144 249.6 R 3.789(wg)-.25
-G 1.289(rid v)-3.789 F 1.289
-(alues to hot colors \(or light grays\) for high grid v)-.25 F 3.79
-(alues. This)-.25 F 1.29(option re)3.79 F -.15(ve)-.25 G 1.29(rses the)
-.15 F .028
-(color table so that cool colors \(dark grays\) correspond to high v)144
-261.6 R .028(alues and hot colors \(light grays\) to)-.25 F(lo)144 273.6
-Q 3.954(wv)-.25 G 3.954(alues. If)-4.204 F F2<ad44>3.954 E F0 1.454
-(is gi)3.954 F -.15(ve)-.25 G 3.954(na).15 G 1.454(lone, it applies to \
-the color table used for color or gray \214ll plots,)-3.954 F .216
-(shaded or unshaded. If the plot is to be shaded,)144 285.6 R .216
-(either by synthetic illumination \()5.216 F F2<ad47>A F3(2)A F0 2.716
-(\)o)C 2.715(ru)-2.716 G .215(sing an)-2.715 F .021(intensity \214le \()
-144 297.6 R F2<ad4b>A F0(and)2.522 E F2<ad47>2.522 E F3(3)A F0 .022
-(options\), then setting)2.522 F F3(\215ipshade)2.522 E F0 2.522(=1w)
-2.522 G .022(ill cause the shading con)-2.522 F -.15(ve)-.4 G .022
-(ntion to).15 F .088(be re)144 309.6 R -.15(ve)-.25 G .088
-(rsed \(e.g. high intensities o).15 F -.15(ve)-.15 G .087
-(rlaid as light shading\).).15 F(Using)5.087 E F2<ad44>2.587 E F3(0/1)A
-F0 .087(will \215ip the shading con-)2.587 F -.15(ve)144 321.6 S
-(ntion b).15 E(ut lea)-.2 E .3 -.15(ve t)-.2 H(he def).15 E
-(ault color con)-.1 E -.15(ve)-.4 G(ntion.).15 E F2<ad47>108 338.4 Q F3
-(color_mode)22.52 E F0 -.45(Tu)144 350.4 S
-(rns on color \214ll plot and sets the style of the plot.).45 E F3
-(color_mode)164 362.4 Q F0 2.5(=1)2.5 G 2.5(:C)-2.5 G(olor/gray \214ll.)
--2.5 E F3(color_mode)164 374.4 Q F0 2.5(=2)2.5 G 2.5(:C)-2.5 G
-(olor/gray \214ll shaded by)-2.5 E(synthetic illumination.)204 386.4 Q
-F3(color_mode)164 398.4 Q F0 2.5(=3)2.5 G 2.5(:C)-2.5 G
-(olor/gray \214ll shaded by)-2.5 E(an intensity \214le. The)204 410.4 Q
-F2<ad4b>2.5 E F0(option must be used to specify)204 422.4 Q
-(the intensity \214le.)252 434.4 Q F3(color_mode)164 446.4 Q F0 2.5(=4)
-2.5 G 2.5(:C)-2.5 G(olor/gray \214ll of slope)-2.5 E(magnitude.)252
-458.4 Q F3(color_mode)164 470.4 Q F0 2.5(=5)2.5 G 2.5(:C)-2.5 G
-(olor/gray \214ll shaded by)-2.5 E(slope magnitude.)204 482.4 Q F2<ad48>
-108 499.2 Q F0 .162(This "help" \215ag cause the program to print out a\
- description of its operation and then e)22.52 F .162(xit immedi-)-.15 F
-(ately)144 511.2 Q(.)-.65 E F2<ad49>108 528 Q F3(gr)26.41 E(d\214le)-.37
-E F0 .159(Sets the name of the gridded data \214le to be plotted.)144
-540 R(Alternati)5.158 E -.15(ve)-.25 G(ly).15 E(,)-.65 E F3(gr)2.658 E
-(d\214le)-.37 E F0 .158(may be a list of grid \214les)2.658 F
-(\(one \214lename on each line\) to be plotted together)144 552 Q(.)-.55
-E F2<ad4b>108 568.8 Q F3(intensity_\214le)22.52 E F0 .599
-(Sets the name of the gridded data \214le containing intensity v)144
-580.8 R .599(alues to be used for shading the map.)-.25 F(Alternati)144
-592.8 Q -.15(ve)-.25 G(ly).15 E(,)-.65 E F3(gr)2.704 E(d\214le)-.37 E F0
-.204(may be a list of grid \214les \(one \214lename on each line\) to b\
-e used together)2.704 F 2.703(.I)-.55 G 2.703(fa)-2.703 G 1.499(list of\
- \214le is supplied, the intensity \214les must conform in order to the\
- data grid \214les the)144 604.8 R 3.999(yw)-.15 G(ill)-3.999 E(shade.)
-144 616.8 Q F2<ad4f>108 633.6 Q F3 -.45(ro)22.52 G(ot).45 E F0 .423(Set\
-s the root used to construct the \214lename of the output shellscript \
-\()144 645.6 R F3 -.45(ro)C(ot).45 E F0 .422
-(.cmd\) and names of \214les)B .156
-(created when the shellscript is run.)144 657.6 R .157
-(Normally the name of the input grid \214le or grid \214le list is used)
-5.157 F(as the)144 669.6 Q F3 -.45(ro)2.5 G(ot).45 E F0(.)A F2<ad50>108
-686.4 Q F3(pa)24.19 E -.1(ge)-.1 G(size).1 E F0 .632(This option sets t\
-he size of the page the plot will be centered on. If the user does not \
-set the plot)144 698.4 R .125(scale, the plot will be sized as lar)144
-710.4 R .125(ge as will \214t on the designated page. If the user sets \
-the plot scale)-.18 F .948
-(such that the plot will not \214t on the designated page, a lar)144
-722.4 R .948(ger page will be used.)-.18 F .947(The supported)5.947 F
-(MB-System 5.0)72 768 Q 2.5(9J)140.11 G(anuary 2015)-2.5 E(2)198.45 E 0
-Cg EP
-%%Page: 3 3
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 133.72(mbm_grdplot\(1\) MB-System)72 48 R 133.72
-(5.0 mbm_grdplot\(1\))2.5 F 1.342
-(page sizes include ANSI A, B, C, D, E, F)144 84 R 3.842(,a)-.8 G 1.343
-(nd E1, as well as most metric page sizes. See the)-3.842 F 1.31
-(COMPLETE DESCRIPTION OF OPTIONS section belo)144 96 R 3.81(wf)-.25 G
-1.31(or a complete list of the supported)-3.81 F(page sizes. The def)144
-108 Q(ault page size is A.)-.1 E/F1 10/Times-Bold at 0 SF<ad53>108 124.8 Q
-/F2 10/Times-Italic at 0 SF([color/shade])24.74 E F0 1.392
-(This option enables ef)144 136.8 R(fecti)-.25 E 1.692 -.15(ve h)-.25 H
-1.392(istogram equalization of the color and/or shading of the gridded)
-.15 F .628(data. The equalization is not achie)144 148.8 R -.15(ve)-.25
-G 3.128(db).15 G 3.128(yc)-3.128 G .628(hanging the data v)-3.128 F .628
-(alues, b)-.25 F .628(ut rather by constructing the)-.2 F .518(color or\
- shading tables so that the boundaries in the tables encompass equal fr\
-actions of the data-)144 160.8 R .19(points. This serv)144 172.8 R .19
-(es to focus color or shading contrasts in v)-.15 F .19
-(alue ranges corresponding to the b)-.25 F .19(ulk of)-.2 F .837
-(the data v)144 184.8 R 3.338(alues. If)-.25 F F1<ad53>3.338 E F0 .838
-(is gi)3.338 F -.15(ve)-.25 G 3.338(na).15 G .838(lone or with)-3.338 F
-F2(color)3.338 E F0 3.338(=1)3.338 G 3.338(,i)-3.338 G 3.338(te)-3.338 G
-.838(nables equalization of the color table)-3.338 F .991
-(used for color or gray \214ll plots,)144 196.8 R .991
-(shaded or unshaded. If the plot is to be shaded,)5.991 F .991
-(either by syn-)5.991 F .637(thetic illumination \()144 208.8 R F1<ad47>
-A F2(2)A F0 3.137(\)o)C 3.137(ru)-3.137 G .637
-(sing an intensity \214le \()-3.137 F F1<ad4b>A F0(and)3.138 E F1<ad47>
-3.138 E F2(3)A F0 .638(options\), then setting)3.138 F F2(shade)3.138 E
-F0 3.138(=1)3.138 G .5(will cause the shading to be equalized.)144 220.8
-R(Using)5.5 E F1<ad53>3 E F2(0/1)A F0 .5
-(will equalize the shading without equalizing)3 F(the color table.)144
-232.8 Q F1<ad54>108 249.6 Q F0(If)23.63 E F1<ad54>2.7 E F0 .201(is gi)
-2.701 F -.15(ve)-.25 G .201(n, it causes a coastline to be dra).15 F
-.201(wn on the map. The def)-.15 F .201(ault is to dra)-.1 F 2.701(wt)
--.15 G .201(he coastline as)-2.701 F .629(the thinnest possible line. T)
-144 261.6 R 3.129(oe)-.8 G -.15(xe)-3.279 G .628(rcise greater control \
-of the coastline plotting, including color \214ll).15 F 2.068
-(of "dry" areas and display of lak)144 273.6 R 2.068(es, ri)-.1 F -.15
-(ve)-.25 G 2.068(rs, and political boundaries, use the).15 F F1(\255MTC)
-4.568 E F0(,)A F1(\255MTD)4.568 E F0(,)A F1(\255MTG)144 285.6 Q F0(,)A
-F1(\255MTI)3.915 E F0(,)A F1(\255MTN)3.915 E F0(,)A F1(\255MTS)3.915 E
-F0 3.915(,a)C(nd)-3.915 E F1(\255MTW)3.915 E F0 1.414
-(options described in the COMPLETE DESCRIP-)3.915 F
-(TION OF OPTIONS section belo)144 297.6 Q -.65(w.)-.25 G F1<ad55>108
-314.4 Q F2(orientation)23.08 E F0 .2(Normally the orientation of the pl\
-ot \(portrait or landscape\) is selected automatically so as to maxi-)
-144 326.4 R .334(mize the plot scale.)144 338.4 R(The)5.333 E F1<ad55>
-2.833 E F0 .333(option allo)2.833 F .333
-(ws the user to set the plot orientation. If)-.25 F F2(orientation)2.833
-E F0 2.833(=1)2.833 G 2.833(,a)-2.833 G
-(portrait plot will be produced; if)144 350.4 Q F2(orientation)2.5 E F0
-2.5(=2)2.5 G 2.5(,al)-2.5 G(andscape plot will be produced.)-2.5 E F1
-<ad56>108 367.2 Q F0(Causes)23.08 E F1(mbm_grdplot)4.505 E F0 2.005
-(to operate in "v)4.505 F 2.006
-(erbose" mode so that it outputs more information than)-.15 F(usual.)144
-379.2 Q F1<ad57>108 396 Q F2([color_style)20.3 E F0([)A F2(/palette)A F0
-([)A F2(ncolor)A(s)-.1 E F0(]] | cpt\214le])A
-(This option controls the color scheme used for color \214ll plots.)144
-408 Q(If)144 432 Q F2(color_style)3.136 E F0 3.136(=1[)3.136 G(def)
--3.136 E .636(ault], then the color scheme used will be a continuous gr\
-ading of colors. If)-.1 F F2(color_style)144 444 Q F0 2.815(=2)2.815 G
-2.815(,t)-2.815 G .315
-(he color scheme will be a set of discrete color interv)-2.815 F .316
-(als. The color palette used is)-.25 F(set using)144 456 Q F2(palette)
-2.5 E F0 2.5(.F)C -2.15 -.25(iv e)-2.5 H(palettes are a)2.75 E -.25(va)
--.2 G(ilable:).25 E F2(palette)180 468 Q F0 2.5(=1)2.5 G 26.36(:H)-2.5 G
-(axby colors [def)-26.36 E(ault])-.1 E F2(palette)180 480 Q F0 2.5(=2)
-2.5 G 26.36(:h)-2.5 G(igh Intensity colors)-26.36 E F2(palette)180 492 Q
-F0 2.5(=3)2.5 G 26.36(:l)-2.5 G .5 -.25(ow I)-26.36 H(ntensity colors)
-.25 E F2(palette)180 504 Q F0 2.5(=4)2.5 G 26.36(:g)-2.5 G(rayscale)
--26.36 E F2(palette)180 516 Q F0 2.5(=5)2.5 G 26.36(:u)-2.5 G
-(niform grayscale)-26.36 E 4.384(Ac)144 528 S 1.883
-(omplete description of the color palettes is gi)-4.384 F -.15(ve)-.25 G
-4.383(ni).15 G 4.383(nt)-4.383 G 1.883(he COMPLETE DESCRIPTION OF)-4.383
-F(OPTIONS section belo)144 540 Q -.65(w.)-.25 G(The)144 564 Q F2(ncolor)
-2.606 E(s)-.1 E F0 .107(parameter sets the number of color v)2.606 F
-.107(alues used in plotting, whether the colors are rep-)-.25 F(resente\
-d in a continuous color scale or a stepped, discrete color scale [def)
-144 576 Q(ault is 11].)-.1 E .523(If the option ar)144 600 R .522
-(gument is the path to an e)-.18 F(xisting)-.15 E F1(GMT)3.022 E F0 .522
-(color palette \(CPT\) \214le, then that CPT \214le)3.022 F
-(and its color scheme will be used for the plot)144 612 Q/F3 10.95
-/Times-Bold at 0 SF(COMPLETE DESCRIPTION OF OPTIONS)72 640.8 Q F1<ad41>108
-652.8 Q F2(ma)23.08 E(gnitude[/azimuth])-.1 E F0 1.15(Sets the paramete\
-rs which control the synthetic illumination of the gridded data \(shade\
-d relief\).)144 664.8 R .051(The v)144 676.8 R(alue)-.25 E F2(ma)2.551 E
-(gnitude)-.1 E F0 .051(is an ef)2.551 F(fecti)-.25 E .351 -.15(ve ve)
--.25 H .051(rtical e).15 F .05
-(xageration which modulates the intensity of the shad-)-.15 F .826
-(ing; typical v)144 688.8 R .826(alues are in the 0.1 to 0.5 range.)-.25
-F .827(The v)5.827 F(alue)-.25 E F2(azimuth)3.327 E F0 .827
-(is the azimuth from which the)3.327 F(data is illuminated.)144 700.8 Q
-(Def)5 E(aults:)-.1 E F2(ma)2.5 E(gnitude)-.1 E F0 2.5(=0)2.5 G(.2;)-2.5
-E F2(azimuth)2.5 E F0 2.5(=0)2.5 G(.0;)-2.5 E F1<ad42>108 717.6 Q F2
-(tic)23.63 E(kinfo)-.2 E F0 .219(Sets map boundary tickmark interv)144
-729.6 R .219(als. See the)-.25 F F1(psbasemap)2.719 E F0 .218
-(manual page for details. By def)2.719 F .218(ault the)-.1 F
-(MB-System 5.0)72 768 Q 2.5(9J)140.11 G(anuary 2015)-2.5 E(3)198.45 E 0
-Cg EP
-%%Page: 4 4
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 133.72(mbm_grdplot\(1\) MB-System)72 48 R 133.72
-(5.0 mbm_grdplot\(1\))2.5 F
-(program chooses basemap annotations based on the map boundaries.)144 84
-Q/F1 10/Times-Bold at 0 SF<ad43>108 100.8 Q/F2 10/Times-Italic at 0 SF
-(contour_contr)23.08 E(ol)-.45 E F0(If)144 112.8 Q F1<ad43>3.458 E F0
-.958(is gi)3.458 F -.15(ve)-.25 G 3.458(na).15 G .959
-(lone, it causes unannotated contours to be dra)-3.458 F .959
-(wn using a contour interv)-.15 F .959(al calcu-)-.25 F 1.281
-(lated from the data. If)144 124.8 R F2(contour_contr)3.781 E(ol)-.45 E
-F0 1.281(is gi)3.781 F -.15(ve)-.25 G 1.28
-(n, it speci\214es the contours to be dra).15 F 1.28(wn in one of)-.15 F
-(three possible w)144 136.8 Q(ays:)-.1 E(If)144 160.8 Q F2
-(contour_contr)3.697 E(ol)-.45 E F0 1.198(has the suf)3.697 F 1.198(\
-\214x ".cpt" and can be opened as a \214le, it is assumed to be a color)
--.25 F 1.006(palette table.)144 172.8 R 1.006
-(The color boundaries are then used as contour le)6.006 F -.15(ve)-.25 G
-3.506(ls. If).15 F 1.006(the cpt-\214le has anotation)3.506 F .557
-(\215ags in the last column then those contours will be anotated.)144
-184.8 R .558(By def)5.558 F .558(ault no contours are labeled;)-.1 F
-(use)144 196.8 Q F1(\255MCA)2.5 E F0(to anotate all contours.)2.5 E(If)
-144 220.8 Q F2(contour_contr)3.288 E(ol)-.45 E F0 .788(is a \214le b)
-3.288 F .787(ut not a cpt-\214le, it is e)-.2 F .787
-(xpected to contain contour le)-.15 F -.15(ve)-.25 G .787
-(ls in column 1).15 F 1.391(and a C\(ontour\) OR A\(nnotate\) in col 2.)
-144 232.8 R 1.391(The le)6.391 F -.15(ve)-.25 G 1.391(ls mark).15 F
-1.391(ed C \(or c\) are contoured, the le)-.1 F -.15(ve)-.25 G(ls).15 E
-(mark)144 244.8 Q .202(ed A \(or a\) are contoured and annotated.)-.1 F
-(Optionally)5.202 E 2.702(,at)-.65 G .202
-(hird column may be present and con-)-2.702 F(tain the \214x)144 256.8 Q
-(ed anotation angle for this contour le)-.15 E -.15(ve)-.25 G(l.).15 E
-(If no \214le is found, then)144 280.8 Q F2(contour_contr)2.5 E(ol)-.45
-E F0(is interpreted as a constant contour interv)2.5 E(al.)-.25 E .824
-(If a \214le is gi)144 304.8 R -.15(ve)-.25 G 3.324(na).15 G(nd)-3.324 E
-F1(\255MCT)3.324 E F0 .824(is set, then only contours mark)3.324 F .824
-(ed with upper case C or A will ha)-.1 F -.15(ve)-.2 G(tickmarks.)144
-316.8 Q F1<ad44>108 333.6 Q F2([\215ipcolor/\215ipshade])23.08 E F0
-(Normally)144 345.6 Q 3.321(,t)-.65 G .821(he color or grayscale tables\
- used for color maps run from cool colors \(or dark grays\))-3.321 F
-1.289(for lo)144 357.6 R 3.789(wg)-.25 G 1.289(rid v)-3.789 F 1.289
-(alues to hot colors \(or light grays\) for high grid v)-.25 F 3.79
-(alues. This)-.25 F 1.29(option re)3.79 F -.15(ve)-.25 G 1.29(rses the)
-.15 F .028
-(color table so that cool colors \(dark grays\) correspond to high v)144
-369.6 R .028(alues and hot colors \(light grays\) to)-.25 F(lo)144 381.6
-Q 3.954(wv)-.25 G 3.954(alues. If)-4.204 F F1<ad44>3.954 E F0 1.454
-(is gi)3.954 F -.15(ve)-.25 G 3.954(na).15 G 1.454(lone, it applies to \
-the color table used for color or gray \214ll plots,)-3.954 F .216
-(shaded or unshaded. If the plot is to be shaded,)144 393.6 R .216
-(either by synthetic illumination \()5.216 F F1<ad47>A F2(2)A F0 2.716
-(\)o)C 2.715(ru)-2.716 G .215(sing an)-2.715 F .021(intensity \214le \()
-144 405.6 R F1<ad4b>A F0(and)2.522 E F1<ad47>2.522 E F2(3)A F0 .022
-(options\), then setting)2.522 F F2(\215ipshade)2.522 E F0 2.522(=1w)
-2.522 G .022(ill cause the shading con)-2.522 F -.15(ve)-.4 G .022
-(ntion to).15 F .088(be re)144 417.6 R -.15(ve)-.25 G .088
-(rsed \(e.g. high intensities o).15 F -.15(ve)-.15 G .087
-(rlaid as light shading\).).15 F(Using)5.087 E F1<ad44>2.587 E F2(0/1)A
-F0 .087(will \215ip the shading con-)2.587 F -.15(ve)144 429.6 S
-(ntion b).15 E(ut lea)-.2 E .3 -.15(ve t)-.2 H(he def).15 E
-(ault color con)-.1 E -.15(ve)-.4 G(ntion.).15 E F1<ad46>108 446.4 Q F2
-(contour_\214le)24.19 E F0 .893
-(Sets the name of the \214le to use for generating contour lines.)144
-458.4 R .894(The def)5.894 F .894(ault is to use the \214le being)-.1 F
-.288(plotted, b)144 470.4 R .287(ut in some situations, it can be usefu\
-l to specify a separate \214le for contouring. F)-.2 F .287(or e)-.15 F
-(xam-)-.15 E 1.224(ple, one might wish to o)144 482.4 R -.15(ve)-.15 G
-1.224(rlay a backscatter mosaic with bath).15 F 1.224
-(ymetry contours, or a shaded ba-)-.05 F(th)144 494.4 Q
-(ymetry map with gra)-.05 E(vity anomaly contours.)-.2 E F1<ad47>108
-511.2 Q F2(color_mode)22.52 E F0 -.45(Tu)144 523.2 S
-(rns on color \214ll plot and sets the style of the plot.).45 E F2
-(color_mode)164 535.2 Q F0 2.5(=1)2.5 G 2.5(:C)-2.5 G(olor/gray \214ll.)
--2.5 E F2(color_mode)164 547.2 Q F0 2.5(=2)2.5 G 2.5(:C)-2.5 G
-(olor/gray \214ll shaded by)-2.5 E(synthetic illumination.)204 559.2 Q
-F2(color_mode)164 571.2 Q F0 2.5(=3)2.5 G 2.5(:C)-2.5 G
-(olor/gray \214ll shaded by)-2.5 E(an intensity \214le. The)204 583.2 Q
-F1<ad4b>2.5 E F0(option must be used to specify)204 595.2 Q
-(the intensity \214le.)252 607.2 Q F2(color_mode)164 619.2 Q F0 2.5(=4)
-2.5 G 2.5(:C)-2.5 G(olor/gray \214ll of slope)-2.5 E(magnitude.)252
-631.2 Q F2(color_mode)164 643.2 Q F0 2.5(=5)2.5 G 2.5(:C)-2.5 G
-(olor/gray \214ll shaded by)-2.5 E(slope magnitude.)204 655.2 Q(See the)
-144 667.2 Q F1(grdimage)2.5 E F0
-(manual page for information on shading with intensity \214les)2.5 E F1
-<ad48>108 684 Q F0 .162(This "help" \215ag cause the program to print o\
-ut a description of its operation and then e)22.52 F .161(xit immedi-)
--.15 F(ately)144 696 Q(.)-.65 E F1<ad49>108 712.8 Q F2(gr)26.41 E
-(d\214le)-.37 E F0 1.298
-(Sets the name of the gridded data \214le to be plotted.)144 724.8 R
-1.299(The data must be in a form acceptable to)6.298 F(MB-System 5.0)72
-768 Q 2.5(9J)140.11 G(anuary 2015)-2.5 E(4)198.45 E 0 Cg EP
-%%Page: 5 5
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 133.72(mbm_grdplot\(1\) MB-System)72 48 R 133.72
-(5.0 mbm_grdplot\(1\))2.5 F/F1 10/Times-Bold at 0 SF(GMT)144 84 Q F0 -.15
-(ve)2.57 G .07(rsion 3 programs \(see the).15 F F1(GMT)2.57 E F0 .07
-(Cookbook & T)2.57 F .07(echnical Reference\).)-.7 F(Alternati)5.07 E
--.15(ve)-.25 G(ly).15 E(,)-.65 E/F2 10/Times-Italic at 0 SF(gr)2.57 E
-(d\214le)-.37 E F0 .786(may be a list of grid \214les \(one \214lename \
-on each line\) to be plotted together)144 96 R 3.286(.T)-.55 G .786
-(his is useful when)-3.286 F(data from a re)144 108 Q(gion is brok)-.15
-E(en up into se)-.1 E -.15(ve)-.25 G
-(ral grid \214les rather than a single v).15 E(ery lar)-.15 E
-(ge grid \214le.)-.18 E F1<ad4a>108 124.8 Q F2(pr)25.3 E(ojection)-.45 E
-F0([)A F2(/scale | /width)A F0(])A .368
-(Selects the map projection. By def)144 136.8 R .367
-(ault the map projection is Mercator and the plot scale is chosen)-.1 F
-.667(to \214t on the selected page size \(see)144 148.8 R F1<ad50>3.168
-E F0 .668(option\). The user may specify a dif)3.168 F .668
-(ferent projection to be)-.25 F .768(used, in which case the plot scale\
- is still automatically chosen to \214t the page. The user may also)144
-160.8 R .034(specify both the projection and the plot scale. If the pro\
-jection specifying character is upper case, a)144 172.8 R 1.509
-(plot width rather than a plot scale is used.)144 184.8 R 1.508
-(The scale v)6.508 F 1.508(alues are speci\214ed in inch/de)-.25 F 1.508
-(gree or in)-.15 F .829(1:xxxxx ratios. Plot widths are speci\214ed in \
-inches. If the user speci\214es a plot scale such that the)144 196.8 R
-(plot will not \214t on the def)144 208.8 Q
-(ault A size page, a appropriately lar)-.1 E
-(ger page size will be chosen.)-.18 E F1(CYLINDRICAL PR)144 232.8 Q
-(OJECTIONS:)-.3 E(\255Jc)144 256.8 Q F2(lon0/lat0/scale)A F0
-(\(Cassini\))2.5 E F1(\255Jm)144 268.8 Q F2(scale)A F0(\(Mercator\))2.5
-E F1<ad4a>144 280.8 Q(oa)-.15 E F2(lon0/lat0/azimuth/scale)A F0
-(\(Oblique Mercator \255 point and azimuth\))2.5 E F1<ad4a>144 292.8 Q
-(ob)-.15 E F2(lon0/lat0/lon1/lat1/scale)A F0(\(Oblique Mercator \255 tw)
-2.5 E 2.5(op)-.1 G(oints\))-2.5 E F1<ad4a>144 304.8 Q(oc)-.15 E F2
-(lon0/lat0/lonp/latp/scale)A F0
-(\(Oblique Mercator \255 point and pole\))2.5 E F1(\255Jq)144 316.8 Q F2
-(lon0/scale)A F0
-(\(Equidistant Cylindrical Projection \(Plate Carree\)\))2.5 E F1
-(\255Jt)144 328.8 Q F2(lon0/scale)A F0(\(TM \255 T)2.5 E(ransv)-.35 E
-(erse Mercator\))-.15 E F1<ad4a>144 340.8 Q(u)-.15 E F2(zone/scale)A F0
-(\(UTM \255 Uni)2.5 E -.15(ve)-.25 G(rsal T).15 E(ransv)-.35 E
-(erse Mercator\))-.15 E F1(\255Jy)144 352.8 Q F2(lon0/lats/scale)A F0
-(\(Basic Cylindrical Projection\))2.5 E F1(AZIMUTHAL PR)144 376.8 Q
-(OJECTIONS:)-.3 E<ad4a>144 400.8 Q(a)-.15 E F2(lon0/lat0/scale)A F0
-(\(Lambert\).)2.5 E F1<ad4a>144 412.8 Q(e)-.15 E F2(lon0/lat0/scale)A F0
-(\(Equidistant\).)2.5 E F1(\255Jg)144 424.8 Q F2(lon0/lat0/scale)A F0
-(\(Orthographic\).)2.5 E F1(\255Js)144 436.8 Q F2(lon0/lat0/scale)A F0
-(\(General Stereographic\))2.5 E F1(CONIC PR)144 460.8 Q(OJECTIONS:)-.3
-E(\255Jb)144 484.8 Q F2(lon0/lat0/lat1/lat2/scale)A F0(\(Albers\))2.5 E
-F1(\255Jl)144 496.8 Q F2(lon0/lat0/lat1/lat2/scale)A F0(\(Lambert\))2.5
-E F1(MISCELLANEOUS PR)144 520.8 Q(OJECTIONS:)-.3 E(\255Jh)144 544.8 Q F2
-(lon0/scale)A F0(\(Hammer\))2.5 E F1(\255Ji)144 556.8 Q F2(lon0/scale)A
-F0(\(Sinusoidal\))2.5 E F1(\255Jk)144 568.8 Q F2(lon0/scale)A F0(\(Eck)
-2.5 E(ert VI\))-.1 E F1(\255Jn)144 580.8 Q F2(lon0/scale)A F0
-(\(Robinson\))2.5 E F1(\255Jr)144 592.8 Q F2(lon0/scale)A F0(\(W)2.5 E
-(ink)-.4 E(el T)-.1 E(ripel\))-.35 E F1(\255Jw)144 604.8 Q F2
-(lon0/scale)A F0(\(Moll)2.5 E(weide\))-.1 E F1(NON-GEOGRAPHICAL PR)144
-628.8 Q(OJECTIONS:)-.3 E(\255Jp)144 652.8 Q F2(scale)A F0
-(\(Linear projection for polar \(theta,r\) coordinates\))2.5 E F1
-(\255Jx)144 664.8 Q F2(x-scale)A F0([)A F1(l|p)A F2(pow)A F0(][)A F2
-(/y-scale)A F0([)A F1(l|p)A F2(pow)A F0(]] \(Linear)A 2.5(,l)-.4 G
-(og, and po)-2.5 E(wer scaling\))-.25 E
-(More details can be found in the)144 676.8 Q F1(psbasemap)2.5 E F0
-(manpages.)2.5 E F1<ad4b>108 693.6 Q F2(intensity_\214le)22.52 E F0 .599
-(Sets the name of the gridded data \214le containing intensity v)144
-705.6 R .599(alues to be used for shading the map.)-.25 F(Alternati)144
-717.6 Q -.15(ve)-.25 G(ly).15 E(,)-.65 E F2(gr)2.703 E(d\214le)-.37 E F0
-.204(may be a list of grid \214les \(one \214lename on each line\) to b\
-e used together)2.703 F 2.704(.I)-.55 G 2.704(fa)-2.704 G .821(list of \
-\214les is supplied, the intensity \214les must conform in order to the\
- list of data grid \214les the)144 729.6 R(y)-.15 E(MB-System 5.0)72 768
-Q 2.5(9J)140.11 G(anuary 2015)-2.5 E(5)198.45 E 0 Cg EP
-%%Page: 6 6
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 133.72(mbm_grdplot\(1\) MB-System)72 48 R 133.72
-(5.0 mbm_grdplot\(1\))2.5 F(will shade.)144 84 Q/F1 10/Times-Bold at 0 SF
-<ad4c>108 100.8 Q/F2 10/Times-Italic at 0 SF(title:scalelabel)23.63 E F0
-.157(Sets the title and the label for the colorscale \(if used\) of the\
- plot. Note that a colon \(:\) rather than a)144 112.8 R 1.557(slash \(\
-/\) is used to separate the labels. Colons cannot be used in the labels\
- themselv)144 124.8 R 1.557(es. If this)-.15 F 1.367
-(option is not used, then a def)144 136.8 R 1.367
-(ault title and colorscale label are pro)-.1 F 1.367
-(vided. If the title is supplied)-.15 F .742(alone, a def)144 148.8 R
-.742(ault colorscale label will be pro)-.1 F .742(vided. T)-.15 F 3.242
-(of)-.8 G .742(orce no title use)-3.242 F F1<ad4c>3.241 E F0 3.241("")C
-3.241(;t)-3.241 G 3.241(of)-3.241 G .741(orce no title or)-3.241 F
-(colorscale label use)144 160.8 Q F1<ad4c>2.5 E F0 2.5(":")C(.)-2.5 E F1
-<ad4d>108 177.6 Q F0 3.055(As)20.86 G .555
-(eries of "miscellaneous" options are pro)-3.055 F .555
-(vided which are gi)-.15 F -.15(ve)-.25 G 3.055(na).15 G(s)-3.055 E F1
-<ad4d>3.055 E F0(follo)3.055 E .555(wed by a tw)-.25 F 3.055(oc)-.1 G
-(har)-3.055 E(-)-.2 E 1.329(acter identi\214er)144 189.6 R 3.829(,f)-.4
-G(ollo)-3.829 E 1.329(wed by an)-.25 F 3.829(yo)-.15 G 1.328
-(ther parameters associated with that option.)-3.829 F(The)6.328 E F1
-<ad4d>3.828 E F0(options)3.828 E .636(may be strung together separated \
-by colons, e.g. "-MGQ100:GU:CA200/10", which is equi)144 201.6 R -.25
-(va)-.25 G(lent).25 E(to "-MGQ \255MGU \255MCA200/10".)144 213.6 Q F1
-(\255MGD)108 230.4 Q F2(gmtdef/value)5.86 E F0(Allo)144 242.4 Q .227
-(ws the user to set the)-.25 F F1(GMT)2.727 E F0(def)2.727 E .227
-(ault v)-.1 F .227
-(alues used as the plot is constructed. This command may)-.25 F 1.133
-(be gi)144 254.4 R -.15(ve)-.25 G 3.633(nr).15 G 1.133
-(epeatedly to set as man)-3.633 F(y)-.15 E F1(GMT)3.633 E F0(def)3.633 E
-1.133(aults as required. F)-.1 F 1.133(or e)-.15 F 1.133
-(xample, to set the basemap)-.15 F(annotation font to Courier)144 266.4
-Q 2.5(,u)-.4 G(se "-MGD)-2.5 E(ANO)-.4 E(T_FONT/Courier".)-.4 E F1
-(\255MGF)108 283.2 Q F2(scale_loc)6.97 E F0
-(Sets the location of the color scale. The possible v)144 295.2 Q
-(alues of)-.25 E F2(scale_loc)2.5 E F0(are:)2.5 E F2(scale_loc)180 307.2
-Q F0 2.5(=b)2.5 G 15.81(:b)-2.5 G(ottom of plot)-15.81 E F2(scale_loc)
-180 319.2 Q F0 2.5(=t)2.5 G 18.03(:t)-2.5 G(op of plot)-18.03 E F2
-(scale_loc)180 331.2 Q F0 2.5(=l)2.5 G 18.03(:l)-2.5 G(eft of plot)
--18.03 E F2(scale_loc)180 343.2 Q F0 2.5(=r)2.5 G 17.48(:r)-2.5 G
-(ight of plot)-17.48 E([Def)144 355.2 Q(ault)-.1 E F2(scale_loc)2.5 E F0
-2.5(=b)2.5 G(])-2.5 E F1(\255MGL)108 372 Q F0([)6.41 E F2(f)A F0(][)A F2
-(x)A F0(])A F2(lon0/lat0/slat/length)A F0([)A F2(units)A F0(][)A F2
-(+llabel)A F0(])A(Dra)144 384 Q .16(ws a simple map scale centered on)
--.15 F F2(lon0/lat0)2.66 E F0 5.16(.U)C(se)-5.16 E F1(\255Lf)2.66 E F0
-.16(to get a "f)2.66 F(anc)-.1 E .16(y" scale [Def)-.15 F .16
-(ault is plain].)-.1 F(Use)144 396 Q F1(\255Lx)2.961 E F0 .461
-(to specify the position in inches instead of map units.)2.961 F .462
-(The scale is calculated at latitude)5.461 F F2(slat)144 408 Q F0 2.929
-(;i)C 2.929(ft)-2.929 G .429
-(he string "center" is used instead of a numerical v)-2.929 F .428
-(alue for)-.25 F F2(slat)2.928 E F0 2.928(,t)C .428
-(hen the macro will set the)-2.928 F 1.596
-(scaling according to the center of the plot bounds.)144 420 R 1.596
-(The scale length v)6.596 F(alue)-.25 E F2(length)4.096 E F0 1.596
-(is in km by)4.096 F(def)144 432 Q .279(ault, b)-.1 F .278(ut the units\
- can be speci\214ed as one of e|f|k|M|n|u, where e = meters, f = feet, \
-k = kilome-)-.2 F .911
-(ters, M = statue miles, n = nautical miles, and u = US surv)144 444 R
-1.212 -.15(ey f)-.15 H .912(eet. Append).15 F F2(+l)3.412 E F0 .912
-(to label the scale)3.412 F(with the rele)144 456 Q -.25(va)-.25 G
-(nt units, or append).25 E F2(+l"label")2.5 E F0(to set a dif)2.5 E
-(ferent label string.)-.25 E F1(\255MGQ)108 472.8 Q F2(dpi)5.3 E F0 .839
-(Sets the resolution in dots per inch of the raster image used for colo\
-r \214ll maps. Lar)144 484.8 R .838(ger v)-.18 F .838(alues of)-.25 F F2
-(dpi)144 496.8 Q F0(produce lar)2.5 E(ger Postscript plot \214les. [Def)
--.18 E(ault is 100].)-.1 E F1(\255MGS)108 513.6 Q F2(scalefactor)7.52 E
-F0 .728(The gridded data is multiplied by)144 525.6 R F2(scalefactor)
-3.229 E F0 5.729(.T)C .729
-(his option is most often used \215ip the sign of the)-5.729 F(data \()
-144 537.6 Q F2(scalefactor)A F0 2.5<3dad>2.5 G(1\). [Def)-2.5 E
-(ault no scaling])-.1 E F1(\255MGT)108 554.4 Q F2
-(x/y/size/angle/font/just/te)6.41 E(xt)-.2 E F0 .488(Causes a te)144
-566.4 R .488(xt label to plotted on the map.)-.15 F F2(size)5.487 E F0
-.487(is te)2.987 F .487(xt size in points,)-.15 F F2(angle)2.987 E F0
-.487(is measured in de)2.987 F(grees)-.15 E(counter)144 578.4 Q .8
-(-clockwise from horizontal,)-.2 F F2(fontno)3.3 E F0 .8
-(sets the font type,)3.3 F F2(justify)3.3 E F0 .8(sets the alignment.)
-3.3 F(If)5.8 E F2(fontno)3.3 E F0 1.615(starts with a leading h)144
-590.4 R 1.615(yphen, then the remainder of)-.05 F F2(fontno)4.115 E F0
-1.615(is tak)4.115 F 1.614(en to be a te)-.1 F 1.614(xtstring with the)
--.15 F 1.022(desired fontname.)144 602.4 R 1.022(See the)6.022 F F1
-(gmtdefaults)3.522 E F0 1.022(man page for names and numbers of a)3.522
-F -.25(va)-.2 G 1.023(ilable fonts \(or).25 F(run)144 614.4 Q F1 .112
-(pstext \255L)2.612 F F0 2.612(\). The)B .111
-(alignment number refers to the part of the te)2.611 F .111
-(xtstring that will be mapped onto)-.15 F .289(the \()144 626.4 R F2
-(x,y)A F0 2.789(\)p)C .289(oint: 1 = Lo)-2.789 F .289(wer Left corner)
--.25 F 2.789(,2=L)-.4 G -.25(ow)-2.789 G .289(er Center).25 F 2.789
-(,3=L)-.4 G -.25(ow)-2.789 G .289(er Right, 5 = Mid Left, 6 = Mid).25 F
-(Center)144 638.4 Q 2.783(,7=M)-.4 G .283
-(id Right, 9 = Upper Left, 10 = Upper Center)-2.783 F 2.783(,1)-.4 G
-2.783(1=U)-2.783 G .283(pper Right. This option may be)-2.783 F(gi)144
-650.4 Q -.15(ve)-.25 G 2.5(na).15 G 2.5(sm)-2.5 G(an)-2.5 E 2.5(yt)-.15
-G(imes as needed.)-2.5 E F1(\255MGU)108 667.2 Q F0([)5.86 E F2(/dx/dy/)A
-F0(][)A F2(label)A F0(])A(Dra)144 679.2 Q 2.635(wU)-.15 G .135
-(nix System time stamp on plot.)-2.635 F .135
-(User may specify where the lo)5.135 F .136
-(wer left corner of the stamp)-.25 F 1.926(should f)144 691.2 R 1.926
-(all on the page relati)-.1 F 2.226 -.15(ve t)-.25 H 4.426(ol).15 G -.25
-(ow)-4.426 G 1.925(er left corner of plot in inch [Def).25 F 1.925
-(ault is \(-0.75,-0.75\)].)-.1 F(Optionally)144 703.2 Q 2.5(,a)-.65 G
-(ppend a label, or)-2.5 E F1(c)2.5 E F0
-(\(which will plot the command string.\))2.5 E(MB-System 5.0)72 768 Q
-2.5(9J)140.11 G(anuary 2015)-2.5 E(6)198.45 E 0 Cg EP
-%%Page: 7 7
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 133.72(mbm_grdplot\(1\) MB-System)72 48 R 133.72
-(5.0 mbm_grdplot\(1\))2.5 F/F1 10/Times-Bold at 0 SF(\255MCA)108 84 Q/F2 10
-/Times-Italic at 0 SF(anot_int/)6.42 E F0([)A F2 -.18(ff)C(ont_size).18 E
-F0(][)A F2(aangle)A F0(][)A F2(/r/g/b)A F0(][)A F2(o)A F0(]])A F2
-(anot_int)144 96 Q F0 .415(is annotation interv)2.915 F .415
-(al in data units.)-.25 F .415(Ignored if contour le)5.415 F -.15(ve)
--.25 G .415(ls are gi).15 F -.15(ve)-.25 G 2.915(ni).15 G 2.915(na\214)
--2.915 G 2.915(le. [Def)-2.915 F(ault)-.1 E 1.744(is no annotations].)
-144 108 R(Se)6.744 E -.15(ve)-.25 G 1.744
-(ral options can be set to modify the form of the annotation.).15 F
-(Append)6.744 E(f)144 120 Q F2(font_size)A F0 .519
-(to change font size [9], append)3.019 F F2(/r/g/b)3.019 E F0 .519
-(to change color of te)3.019 F .52(xt \214ll box [P)-.15 F -.4(AG)-.92 G
-(E_COLOR],).4 E .698(append a)144 132 R F2(angle)A F0 .698
-(to \214x annotation angle [Def)3.198 F .697(ault follo)-.1 F .697
-(ws contour], and append 'o' to dra)-.25 F 3.197(wt)-.15 G .697(he out-)
--3.197 F(line of the surrounding te)144 144 Q(xt box [Def)-.15 E
-(ault is no outline].)-.1 E F1(\255MCG)108 160.8 Q F2(gap/width)5.86 E
-F1(\255MCQ)2.5 E F2(cut)A(gap)144 172.8 Q F0 .03
-(is distance in inch between each annotation along the same contour)2.53
-F(.)-.55 E F2(width)5.03 E F0 .03(is number of points)2.53 F -.15(ove)
-144 184.8 S 2.5(rw).15 G
-(hich to estimate the best \214tting slope for contour labels)-2.5 E
-([Def)5 E(ault is 4/10].)-.1 E F1(\255MCQ)108 201.6 Q F2(cut)5.86 E F0
-(Do not dra)144 213.6 Q 2.5(wc)-.15 G(ontours with less than)-2.5 E F2
-(cut)2.5 E F0(number of points [Dra)2.5 E 2.5(wa)-.15 G(ll contours].)
--2.5 E F1(\255MCT)108 230.4 Q F0([)6.97 E F2(+|-)A F0(][)A F2
-(gap/length)A F0(][)A F2(:LH)A F0(])A -.4(Wi)144 242.4 S 1.484(ll dra).4
-F 3.984(wt)-.15 G 1.484(ickmarks pointing in the do)-3.984 F(wnw)-.25 E
-1.484(ard direction e)-.1 F -.15(ve)-.25 G(ry).15 E F2(gap)3.984 E F0
-1.483(along the innermost closed)3.984 F 2.98(contours. Append)144 254.4
-R F2(gap)2.98 E F0 .48(and tickmark length \(in inch\) or use def)2.98 F
-.48(aults [0.2/0.05].)-.1 F .48(User may choose)5.48 F .263
-(to tick only local highs or local lo)144 266.4 R .263(ws by specifying)
--.25 F F1(\255T+)2.762 E F0(or)2.762 E F1<ad54>2.762 E(-)-.92 E F0 2.762
-(,r)C(especti)-2.762 E -.15(ve)-.25 G(ly).15 E 5.262(.A)-.65 G .262
-(ppending :LH will)-5.262 F .78(plot the characters L and H at the cent\
-er of closed innermost contours \(local lo)144 278.4 R .781
-(ws and highs\).)-.25 F(L)5.781 E .534(and H can be an)144 290.4 R 3.033
-(ys)-.15 G .533(ingle character \(e.g., LH, \255+, etc.\))-3.033 F .533
-(If a \214le is gi)5.533 F -.15(ve)-.25 G 3.033(nb).15 G(y)-3.033 E F1
-<ad43>3.033 E F0(and)3.033 E F1<ad54>3.033 E F0 .533(is set, then)3.033
-F(only contours mark)144 302.4 Q(ed with upper case C or A will ha)-.1 E
-.3 -.15(ve t)-.2 H(ickmarks [and anotation].).15 E F1(\255MCW)108 319.2
-Q F2(type)144 331.2 Q F0([)A F2(pen)A F0(])A F2(type)144 343.2 Q F0
-2.531(,i)C 2.531(fp)-2.531 G .032
-(resent, can be 'a' for annotated contours or 'c' for re)-2.531 F .032
-(gular contours [Def)-.15 F(ault].)-.1 E F2(pen)5.032 E F0 .032
-(sets the)2.532 F(attrib)144 355.2 Q .671(utes for the particular line.)
--.2 F(Def)5.671 E .671(ault v)-.1 F .67
-(alues for annotated contours: width = 3, color = black,)-.25 F(te)144
-367.2 Q(xture = solid.)-.15 E(Re)5 E(gular contours ha)-.15 E .3 -.15
-(ve d)-.2 H(ef).15 E(ault width = 1.)-.1 E F1(\255MN)108 384 Q(A)-.2 E
-F2([nhgt[/P] | P])6.62 E F0 -.45(Tu)144 396 S .426
-(rns on \214lename annotation of na).45 F(vig)-.2 E .426
-(ation tracks. If)-.05 F F1(\255MN)2.926 E(A)-.2 E F0 .427(is gi)2.927 F
--.15(ve)-.25 G 2.927(nw).15 G .427(ithout specifying an)-2.927 F 2.927
-(yc)-.15 G(on-)-2.927 E .681
-(trolling parameters, then the lettering height)144 408 R F2(nhgt)3.181
-E F0 .68(is 0.15 and the \214lenames are plotted parallel to)3.181 F
-.794(the na)144 420 R(vig)-.2 E .794(ation track from the start of the \
-track. The lettering height can be speci\214ed using either)-.05 F F1
-(\255MN)144 432 Q(A)-.2 E F2(nhgt)A F0(or)2.897 E F1(\255MN)2.897 E(A)
--.2 E F2(nhgt/P)A F0 5.397(.I)C(f)-5.397 E F1(\255MN)2.897 E(A)-.2 E F2
-(P)A F0(or)2.897 E F1(\255MN)2.897 E(A)-.2 E F2(nhgt/P)A F0 .397
-(is speci\214ed, the \214lename will be plot-)2.897 F .4
-(ted perpendicular to the na)144 444 R(vig)-.2 E .401(ation track.)-.05
-F .401(Filename annotation can also be speci\214ed using the)5.401 F F1
-<ad4e>2.901 E F0 2.5(option. Def)144 456 R
-(aults: Filename annotation of)-.1 E(f.)-.25 E F1(\255MNF)108 472.8 Q F2
-(format)7.53 E F0 .606(Sets the data format for the input sw)144 484.8 R
-.606(ath data speci\214ed with the)-.1 F F1(\255MNI)3.106 E F0 .606
-(option. If)3.106 F F2(format)3.106 E F0 3.106(<0)3.106 G 3.106(,t)
--3.106 G(hen)-3.106 E .4(the input \214le speci\214ed with the)144 496.8
-R F1(\255MNI)2.9 E F0 .401
-(option will actually contain a list of input sw)2.9 F .401
-(ath sonar data)-.1 F 1.384(\214les. This program uses the)144 508.8 R
-F1(MBIO)3.884 E F0 1.384(library and will read or write an)3.884 F 3.883
-(ys)-.15 G -.1(wa)-3.883 G 1.383(th sonar format sup-).1 F .748
-(ported by)144 520.8 R F1(MBIO)3.248 E F0 3.248(.Al)C .749
-(ist of the sw)-3.248 F .749
-(ath sonar data formats currently supported by)-.1 F F1(MBIO)3.249 E F0
-.749(and their)3.249 F(identi\214er v)144 532.8 Q(alues is gi)-.25 E
--.15(ve)-.25 G 2.5(ni).15 G 2.5(nt)-2.5 G(he)-2.5 E F1(MBIO)2.5 E F0
-(manual page.)2.5 E(Def)5 E(ault:)-.1 E F2(format)2.5 E F0 2.5<3dad>2.5
-G(1.)-2.5 E F1(\255MNI)108 549.6 Q F2(swathdata)9.75 E F0 1.042
-(This option causes the na)144 561.6 R(vig)-.2 E 1.041
-(ation track of sw)-.05 F 1.041(ath data to be plotted. Here)-.1 F F2
-(swathdata)3.541 E F0 1.041(is the input)3.541 F .222
-(\214le, and may be either a single sw)144 573.6 R .223
-(ath \214le or a list of sw)-.1 F .223(ath \214les. If)-.1 F F2(format)
-2.723 E F0 2.723(>0\()2.723 G .223(set with the)-2.723 F F1(\255MNF)
-2.723 E F0 .357(option\) then the sw)144 585.6 R .357
-(ath sonar data contained in)-.1 F F2(swathdata)2.857 E F0 .357
-(is read and processed. If)2.857 F F2(format)2.857 E F0 2.857(<0\()2.857
-G(the)-2.857 E(def)144 597.6 Q 3.405(ault\), then)-.1 F F2(swathdata)
-3.405 E F0 .905
-(is assumed to be an ascii \214le containing a list of the input sw)
-3.405 F .906(ath sonar)-.1 F .678
-(data \214les to be processed and their formats.)144 609.6 R .678
-(The program will read the data in each one of these)5.678 F 2.5
-(\214les. In)144 621.6 R(the)2.5 E F2(swathdata)2.5 E F0
-(\214le, each data \214le should be follo)2.5 E
-(wed by a data format identi\214er)-.25 E 2.5(,e)-.4 G(.g.:)-2.5 E
-(data\214le1 11)180 633.6 Q(data\214le2 24)180 645.6 Q .568
-(This program uses the)144 657.6 R F1(MBIO)3.068 E F0 .568
-(library and will read or write an)3.068 F 3.068(ys)-.15 G -.1(wa)-3.068
-G .568(th sonar format supported by).1 F F1(MBIO)144 669.6 Q F0 3.428
-(.Al)C .928(ist of the sw)-3.428 F .928
-(ath sonar data formats currently supported by)-.1 F F1(MBIO)3.428 E F0
-.928(and their identi\214er)3.428 F -.25(va)144 681.6 S(lues is gi).25 E
--.15(ve)-.25 G 2.5(ni).15 G 2.5(nt)-2.5 G(he)-2.5 E F1(MBIO)2.5 E F0
-(manual page.)2.5 E F1(\255MNN)108 698.4 Q F0([)6.42 E F2(ttic)A
-(k/tannot/dannot/tlen)-.2 E F0([)A F2(/nhgt/nperp)A F0 2.5(]|)C F2(F)A
-F0(|)2.5 E F2(FP)2.5 E F0(])A .525
-(This option sets the annotation of the sw)144 710.4 R .525
-(ath \214le na)-.1 F(vig)-.2 E .526(ation plot speci\214ed using the)
--.05 F F1(\255MNI)3.026 E F0(option.)3.026 E -.35(Ti)144 722.4 S .357(m\
-e marks are made with "X" marks along the shiptrack; annotated time mar\
-ks sho).35 F 2.857(wt)-.25 G .356(he time in)-2.857 F(MB-System 5.0)72
-768 Q 2.5(9J)140.11 G(anuary 2015)-2.5 E(7)198.45 E 0 Cg EP
-%%Page: 8 8
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 133.72(mbm_grdplot\(1\) MB-System)72 48 R 133.72
-(5.0 mbm_grdplot\(1\))2.5 F .689(HH:MM format ne)144 84 R .689
-(xt to the time mark and annotated date marks sho)-.15 F 3.19(wt)-.25 G
-.69(he time and julian day in)-3.19 F .712(HH:MM/DDD format.)144 96 R
-.712(The "X" marks are)5.712 F/F1 10/Times-Italic at 0 SF(tlen)3.211 E F0
-.711(inches high for normal time marks and 1.5 times)3.211 F F1(tlen)144
-108 Q F0 .22(inches high for annotated time or date marks.)2.72 F .22
-(The interv)5.22 F .22(al of time ticks, annotated time ticks,)-.25 F
-.742(and annotated date ticks are gi)144 120 R -.15(ve)-.25 G 3.242(ni)
-.15 G 3.242(nh)-3.242 G .742(ours by)-3.242 F F1(ttic)3.242 E(k)-.2 E F0
-(,)A F1(tannot)3.242 E F0 3.242(,a)C(nd)-3.242 E F1(dannot)3.242 E F0
-3.242(,r)C(especti)-3.242 E -.15(ve)-.25 G(ly).15 E 5.742(.I)-.65 G
-3.241(ft)-5.742 G(he)-3.241 E F1(nhgt)3.241 E F0 .839
-(parameter is not gi)144 132 R -.15(ve)-.25 G 3.339(nw).15 G .839(hen t\
-he other parameters are speci\214ed, then no \214lename annotation will)
--3.339 F .657(be done. If gi)144 144 R -.15(ve)-.25 G(n,).15 E F1(nhgt)
-3.157 E F0 .657(sets the height in inches of the \214lename annotation \
-and turns that annota-)3.157 F 1.028(tion on. If gi)144 156 R -.15(ve)
--.25 G 3.528(na).15 G 3.529(s1)-3.528 G(,)-3.529 E F1(nperp)3.529 E F0
-1.029
-(causes the \214lename annotation to be perpendicular to the shiptrack)
-3.529 F .055(rather than parallel \(the def)144 168 R 2.555(ault\). If)
--.1 F(the)2.555 E/F2 10/Times-Bold at 0 SF(\255MNN)2.554 E F1(F)A F0 .054
-(is gi)2.554 F -.15(ve)-.25 G .054(n, then a na).15 F(vig)-.2 E .054
-(ation track will be generated)-.05 F 3.123(using the def)144 180 R
-3.123(ault parameters and also with \214lename annotation along the shi\
-ptrack. If the)-.1 F F2(\255MNN)144 192 Q F1(FP)A F0 .409(is gi)2.909 F
--.15(ve)-.25 G .409(n, then a na).15 F(vig)-.2 E .409
-(ation track will be generated with the def)-.05 F .408
-(ault parameters and also)-.1 F .4
-(with \214lename annotation perpendicular to the shiptrack.)144 204 R
-(Def)5.401 E(aults:)-.1 E F1(ttic)2.901 E(k)-.2 E F0 2.901(=0)2.901 G
-(.25;)-2.901 E F1(tannot)2.901 E F0 2.901(=1)2.901 G(.0;)-2.901 E F1
-(dan-)2.901 E(not)144 216 Q F0 2.5(=4)2.5 G(.0;)-2.5 E F1(tlen)2.5 E F0
-2.5(=0)2.5 G(.1;)-2.5 E F1(nhgt)2.5 E F0 2.5(=0)2.5 G(.1;)-2.5 E F1
-(nperp)2.5 E F0 2.5(=0)2.5 G(.)-2.5 E F2(\255MNP)108 232.8 Q F1
-([pingnumber_tic)7.53 E(k/pingnumber_annot/pingnumber_tic)-.2 E(k_len])
--.2 E F0 -.45(Tu)144 244.8 S 1.421
-(rns on ping number \(or shot number\) annotation of na).45 F(vig)-.2 E
-1.421(ation tracks.)-.05 F -.35(Ti)6.42 G 1.42(ck marks are made).35 F
-.287(along the shiptrack at)144 256.8 R F1(pingnumber_tic)2.787 E(k)-.2
-E F0(interv)2.787 E .287(als; these are)-.25 F F1(tlen)2.787 E F0 .287
-(inches long. Longer tick marks are)2.787 F 1.745
-(made along the shiptrack at)144 268.8 R F1(pingnumber_annot)4.245 E F0
-(interv)4.245 E 1.745(als; these are 1.5 times)-.25 F F1(tlen)4.244 E F0
-1.744(inches long.)4.244 F(Def)144 280.8 Q .34
-(aults: Pingnumber annotation of)-.1 F .34(f. If the)-.25 F F2(\255MNP)
-2.84 E F0 .34(option is gi)2.84 F -.15(ve)-.25 G 2.84(nw).15 G .34
-(ithout specifying the control-)-2.84 F .766(ling parameters, then)144
-292.8 R F1(pingnumber_tic)3.266 E(k)-.2 E F0 3.266(=5)3.266 G(0,)-3.266
-E F1(pingnumber_annot)3.266 E F0 3.266(=1)3.266 G .766(00, and)-3.266 F
-F1(pingnumber_tic)3.266 E(k_len)-.2 E F0 2.5(=0)144 304.8 S(.1.)-2.5 E
-F2(\255MTC)108 321.6 Q F1(\214ll)6.97 E F0 2.234
-(Coastline plotting option.)144 333.6 R 2.234(Set the shade \(0-255\), \
-color \(r/g/b\), or pattern \(p|Pdpi/pattern; see)7.234 F F2(\255MTG)144
-345.6 Q F0 2.5(\)f)C(or lak)-2.5 E 2.5(es [Def)-.1 F
-(ault is the \214ll chosen for "wet" areas \(-S\)].)-.1 E F2(\255MTD)108
-362.4 Q F1 -.37(re)6.97 G(solution).37 E F0 1.621
-(Coastline plotting option.)144 374.4 R 1.621(Selects the resolution of\
- the coastline data set to use \(\(f\)ull, \(h\)igh,)6.621 F .693
-(\(i\)ntermediate, \(1\)o)144 386.4 R 1.993 -.65(w, a)-.25 H .694
-(nd \(c\)rude\).).65 F .694(The resolution drops of)5.694 F 3.194(fb)
--.25 G 3.194(y8)-3.194 G .694(0% between data sets. [Def)-3.194 F(ault)
--.1 E(is l].)144 398.4 Q F2(\255MTG)108 415.2 Q F1(\214ll)6.41 E F0 .592
-(Coastline plotting option.)144 427.2 R .592
-(Select painting or clipping of "dry" areas.)5.592 F .591
-(Append a shade, color)5.591 F 3.091(,p)-.4 G(at-)-3.091 E .998
-(tern, or c for clipping.)144 439.2 R .999
-(Specify the shade \(0-255\) or color \(r/g/b\), or)5.998 F F2(\255MTG)
-3.499 E F1(pdpi/pattern)A F0 3.499(,w)C(here)-3.499 E .132(pattern gi)
-144 451.2 R -.15(ve)-.25 G 2.632(st).15 G .132(he number of the b)-2.632
-F .131
-(uilt-in pattern \(1-90\) OR the name of a Sun 1-, 8-, or 24-bit raster)
--.2 F 2.982(\214le. dpi)144 463.2 R .482
-(sets the resolution of the image.)2.982 F(See)5.482 E F2(GMT)2.982 E F0
-.482(Cookbook & T)2.982 F .483(echnical Reference Appendix)-.7 F 2.5(Ef)
-144 475.2 S(or information on indi)-2.5 E(vidual patterns.)-.25 E F2
-(\255MTI)108 492 Q F1(river[/pen])10.3 E F0 1.457
-(Coastline plotting option.)144 504 R(Dra)6.457 E 3.957(wr)-.15 G -2.15
--.25(iv e)-3.957 H 3.957(rs. Specify).25 F 1.457(the type of ri)3.957 F
--.15(ve)-.25 G 1.457(rs and [optionally] append pen).15 F(attrib)144 516
-Q 3.478(utes [Def)-.2 F .978(ault pen: width = 1, color = 0/0/0, te)-.1
-F .978(xture = solid].)-.15 F .979(Choose from the list of ri)5.978 F
--.15(ve)-.25 G(r).15 E(types belo)144 528 Q 3.8 -.65(w. R)-.25 H
-(epeat option \255I as often as necessary).65 E(.)-.65 E 2.5(1=P)156.5
-540 S(ermanent major ri)-2.5 E -.15(ve)-.25 G(rs).15 E 2.5(2=A)156.5 552
-S(dditional major ri)-2.5 E -.15(ve)-.25 G(rs).15 E 2.5(3=A)156.5 564 S
-(dditional ri)-2.5 E -.15(ve)-.25 G(rs).15 E 2.5(4=M)156.5 576 S
-(inor ri)-2.5 E -.15(ve)-.25 G(rs).15 E 2.5(5=I)156.5 588 S
-(ntermittent ri)-2.5 E -.15(ve)-.25 G(rs \255 major).15 E 2.5(6=I)156.5
-600 S(ntermittent ri)-2.5 E -.15(ve)-.25 G(rs \255 additional).15 E 2.5
-(7=I)156.5 612 S(ntermittent ri)-2.5 E -.15(ve)-.25 G(rs \255 minor).15
-E 2.5(8=M)156.5 624 S(ajor canals)-2.5 E 2.5(9=M)156.5 636 S
-(inor canals)-2.5 E(10 = Irrig)156.5 648 Q(ation canals)-.05 E 2.5(a=A)
-156.5 660 S(ll ri)-2.5 E -.15(ve)-.25 G(rs and canals \(1-10\)).15 E 2.5
-(r=A)156.5 672 S(ll permanent ri)-2.5 E -.15(ve)-.25 G(rs \(1-4\)).15 E
-2.5(i=A)156.5 684 S(ll intermittent ri)-2.5 E -.15(ve)-.25 G(rs \(5-7\))
-.15 E 2.5(c=A)156.5 696 S(ll canals \(8-10\))-2.5 E F2(\255MTN)108 712.8
-Q F1(bor)6.97 E(der[/pen])-.37 E F0 4.072(Coastline plotting option.)144
-724.8 R(Dra)9.072 E 6.572(wp)-.15 G 4.072(olitical boundaries.)-6.572 F
-4.072(Specify the type of boundary and)9.072 F(MB-System 5.0)72 768 Q
-2.5(9J)140.11 G(anuary 2015)-2.5 E(8)198.45 E 0 Cg EP
-%%Page: 9 9
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 133.72(mbm_grdplot\(1\) MB-System)72 48 R 133.72
-(5.0 mbm_grdplot\(1\))2.5 F .119([optionally] append pen attrib)144 84 R
-.119(utes [Def)-.2 F .119(ault pen:)-.1 F .119
-(width = 1, color = 0/0/0, te)5.119 F .12(xture = solid].)-.15 F(Choose)
-5.12 E(from the list of boundaries belo)144 96 Q 3.8 -.65(w. R)-.25 H
-(epeat option).65 E/F1 10/Times-Bold at 0 SF(\255MTN)2.5 E F0
-(as often as necessary)2.5 E(.)-.65 E 2.5(1=N)156.5 108 S
-(ational boundaries)-2.5 E 2.5(2=S)156.5 120 S
-(tate boundaries within the Americas)-2.5 E 2.5(3=M)156.5 132 S
-(arine boundaries)-2.5 E 2.5(a=A)156.5 144 S(ll boundaries \(1-3\))-2.5
-E F1(\255MTS)108 160.8 Q/F2 10/Times-Italic at 0 SF(\214ll)8.63 E F0 .777
-(Coastline plotting option.)144 172.8 R .777
-(Select painting or clipping of "wet" areas.)5.777 F .777
-(Append the shade \(0-255\),)5.777 F(color \(r/g/b\), pattern \(see)144
-184.8 Q F1(\255MTG)2.5 E F0(\), or c for clipping.)A F1(\255MTW)108
-201.6 Q F2(pen)144 213.6 Q F0 1.078(Coastline plotting option.)144 225.6
-R 1.078(Append pen attrib)6.078 F 3.578(utes [Def)-.2 F 3.579
-(aults: width)-.1 F 3.579(=1)3.579 G 3.579(,c)-3.579 G 1.079
-(olor = 0/0/0, te)-3.579 F 1.079(xture =)-.15 F(solid].)144 237.6 Q F1
-(\255MXG)108 254.4 Q F2(\214ll)5.86 E F0 .393
-(Select \214lling of symbols for xy plotting.)144 266.4 R .393
-(Set the shade \(0-255\) or color \(r/g/b\) [Def)5.393 F .393
-(ault is no \214ll].)-.1 F 2.548 -.8(To r)144 278.4 T .948
-(eset no \214ll, use).8 F F2(\214ll)3.448 E F0 3.449(=")3.448 G 3.449
-(N". F)-3.449 F .949(or polygons, you may optionally specify)-.15 F F1
-(\255Gp)3.449 E F2(icon_size/pattern)A F0(,)A(where)144 290.4 Q F2
-(pattern)3.652 E F0(gi)3.652 E -.15(ve)-.25 G 3.652(st).15 G 1.151(he n\
-umber of the image pattern \(1-32\) OR the name of a icon-format \214le\
-.)-3.652 F F2(icon_size)144 302.4 Q F0 1.128
-(sets the unit size in inch.)3.628 F 2.728 -.8(To i)6.128 H -1.85 -.4
-(nv e).8 H 1.128(rt black and white pix).4 F 1.128(els, use)-.15 F F1
-(\255GP)3.629 E F0 1.129(instead of)3.629 F F1(\255Gp)3.629 E F0(.)A
-(See)144 314.4 Q F1(GMTs)2.5 E F0(Cookbook & T)2.5 E
-(echnical Reference Appendix E for information on indi)-.7 E
-(vidual patterns.)-.25 E F1(\255MXI)108 331.2 Q F2(xy_\214le)9.75 E F0
-.481(Speci\214es a \214le containing \(x,y\) pairs to be plotted as lin\
-es or symbols. The line and symbol char)144 343.2 R(-)-.2 E .533
-(acteristics are set using the last)144 355.2 R F1(\255MXG)3.033 E F0(,)
-A F1(\255MXS)3.033 E F0 3.033(,a)C(nd)-3.033 E F1(\255MXW)3.033 E F0
-.533(options used. All of the)3.033 F F1(\255MX)3.034 E F0(com-)3.034 E
-.143(mands can be gi)144 367.2 R -.15(ve)-.25 G 2.643(nm).15 G .142(ult\
-iple times, so by stringing series of these commands together the user \
-can)-2.643 F(plot dif)144 379.2 Q(ferent \214les using dif)-.25 E
-(ferent line or symbol characteristics.)-.25 E([Def)5 E
-(ault is a solid black line].)-.1 E F1(\255MXM)108 396 Q F0 -.8(To)144
-408 S 1.24(ggles e).8 F 1.24(xpectation for xy data \214les ha)-.15 F
-1.24(ving multiple se)-.2 F 1.24(gments, in which each se)-.15 F 1.24
-(gment is to be)-.15 F 1.506(plotted separately)144 420 R 4.006(.S)-.65
-G -.15(eg)-4.006 G 1.506
-(ments are separated by a record whose \214rst character is '>'. By def)
-.15 F(ault,)-.1 E(unse)144 432 Q 1.878(gmented \214les are e)-.15 F
-1.878(xpected. Users may gi)-.15 F 2.178 -.15(ve t)-.25 H 1.879
-(his command multiple times, allo).15 F 1.879(wing some)-.25 F
-(input \214les to be handled as se)144 444 Q(gmented and others not.)
--.15 E F1(\255MXS)108 460.8 Q F2(symbol/size)8.08 E F0 .333
-(Selects symbol to be used for plotting the ne)144 472.8 R .332
-(xt xy data \214le. Setting)-.15 F F2(symbol)2.832 E F0 2.832(=")2.832 G
-.332(N" causes line plot-)-2.832 F 2.5(ting. Choose)144 484.8 R
-(between:)2.5 E F1(\255MXSa)108 501.6 Q F0(st)144 513.6 Q F1(a)A F0 -.55
-(r.)C F2(size)5.55 E F0(is radius of circumscribing circle.)2.5 E F1
-(\255MXSb)108 530.4 Q(b)144 542.4 Q F0 .921(ar e)B .921(xtending from)
--.15 F F2(base)3.421 E F0 .921(to y)3.421 F(.)-.65 E F2(size)5.921 E F0
-.921(is bar width.)3.421 F .921(By def)5.921 F(ault,)-.1 E F2(base)3.421
-E F0 3.421(=0)3.421 G 5.921(.A)-3.421 G .921(ppend /)-5.921 F F2(base)A
-F0 .922(to change)3.422 F(this v)144 554.4 Q 2.5(alue. Append)-.25 F F1
-(u)2.5 E F0(if)2.5 E F2(size)2.5 E F0(is in x-units [Def)2.5 E
-(ault is inch].)-.1 E F1(\255MXSc)108 571.2 Q(c)144 583.2 Q F0(ircle.)A
-F2(size)5 E F0(is diameter of circle.)2.5 E F1(\255MXSd)108 600 Q(d)144
-612 Q F0(iamond.)A F2(size)5 E F0(is side of diamond.)2.5 E F1(\255MXSe)
-108 628.8 Q(e)144 640.8 Q F0 5.678(llipse. Direction)B 3.178(\(in de)
-5.678 F 3.178
-(grees counterclockwise from horizontal\), major_axis \(in inch\), and)
--.15 F(minor_axis \(in inch\) must be found in columns 3, 4, and 5.)144
-652.8 Q F1(\255MXSf)108 669.6 Q(f)144 681.6 Q F0 2.528(ault. Gi)B .328
--.15(ve d)-.25 H .028(istance g).15 F .029
-(ap between ticks and ticklength in inch.)-.05 F .029(If g)5.029 F .029
-(ap is ne)-.05 F -.05(ga)-.15 G(ti).05 E -.15(ve)-.25 G 2.529(,i).15 G
-2.529(ti)-2.529 G 2.529(si)-2.529 G .029(nterpreted to)-2.529 F .399
-(mean number of ticks instead.)144 693.6 R(Append)5.399 E F1(l)2.899 E
-F0(or)2.899 E F1(r)2.899 E F0 .399(to dra)2.899 F 2.899(wt)-.15 G .399
-(ick on the left or right side of line [Def)-2.899 F(ault)-.1 E
-(is centered].)144 705.6 Q(Upper case)5 E F1(L)2.5 E F0(or)2.5 E F1(R)
-2.5 E F0(dra)2.5 E(ws a triangle instead of line se)-.15 E(gment.)-.15 E
-(MB-System 5.0)72 768 Q 2.5(9J)140.11 G(anuary 2015)-2.5 E(9)198.45 E 0
-Cg EP
-%%Page: 10 10
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 133.72(mbm_grdplot\(1\) MB-System)72 48 R 133.72
-(5.0 mbm_grdplot\(1\))2.5 F/F1 10/Times-Bold at 0 SF(\255MXSh)108 84 Q(h)
-144 96 Q F0 -.15(ex)C 2.5(agon. Gi).15 F .3 -.15(ve s)-.25 H
-(ide in inch.).15 E F1 2.8(\255MXSi i)108 112.8 R F0 -1.85 -.4(nv e)D
-(rted triangle.).4 E(Gi)5 E .3 -.15(ve s)-.25 H(ide in inch.).15 E F1
-2.8(\255MXSl l)108 129.6 R F0 .405(etter or te)B .405(xt string.)-.15 F
-(Gi)5.405 E .706 -.15(ve s)-.25 H .406(ize in inch, and append /).15 F
-/F2 10/Times-Italic at 0 SF(string)A F0 .406(after the size.)2.906 F .406
-(Note that the size is only)5.406 F .92(approximate; no indi)144 141.6 R
-.919(vidual scaling is done for dif)-.25 F .919(ferent characters.)-.25
-F .919(Remember to escape special)5.919 F(characters lik)144 153.6 Q 2.5
-(e*)-.1 G(.)-2.5 E F1(\255MXSp)108 170.4 Q(p)144 182.4 Q F0 2.5
-(oint. No)B(size needs to be speci\214ed \(1 pix)2.5 E(el is used\).)
--.15 E F1(\255MXSs)108 199.2 Q(s)144 211.2 Q F0 2.5(quare. Gi)B .3 -.15
-(ve s)-.25 H(ide in inch.).15 E F1(\255MXSt)108 228 Q(t)144 240 Q F0 2.5
-(riangle. Gi)B .3 -.15(ve s)-.25 H(ide in inch.).15 E F1(\255MXSv)108
-256.8 Q(v)144 268.8 Q F0(ector)A 7(.D)-.55 G 2(irection \(in de)-7 F 2(\
-grees counterclockwise from horizontal\) and length \(in inch\) must be)
--.15 F .036(found in columns 3 and 4.)144 280.8 R F2(size)5.036 E F0
-2.536(,i)C 2.536(fp)-2.536 G .036(resent, will be interpreted as arro)
--2.536 F(wwidth/headlength/headwidth)-.25 E 2.103(\(in inch\) [Def)144
-292.8 R 2.104(ault is 0.03/0.12/0.1 inch].)-.1 F 2.104(By def)7.104 F
-2.104(ault arro)-.1 F 4.604(wa)-.25 G(ttrib)-4.604 E 2.104
-(utes remains in)-.2 F -.25(va)-.4 G 2.104(riant to the).25 F .029
-(length of the arro)144 304.8 R 3.829 -.65(w. T)-.25 H 2.529(oh)-.15 G
--2.25 -.2(av e)-2.529 H .029(the size of the v)2.729 F .029
-(ector scale do)-.15 F .028(wn with decreasing size, append n)-.25 F F2
-(norm)A F0(,)A(where v)144 316.8 Q(ectors shorter than)-.15 E F2(norm)
-2.5 E F0(will ha)2.5 E .3 -.15(ve t)-.2 H(heir attrib).15 E
-(utes scaled by length/)-.2 E F2(norm)A F0(.)A F1(\255MXSV)108 333.6 Q
-F0 .793(Same as)144 345.6 R F1(\255MXSv)3.293 E F0 3.293(,e)C .793
-(xcept azimuth \(in de)-3.443 F .793(grees east of north\) should be gi)
--.15 F -.15(ve)-.25 G 3.294(ni).15 G .794(nstead of direction.)-3.294 F
-.079(The azimuth will be mapped into an angle based on the chosen map p\
-rojection \()144 357.6 R F1(\255MXSv)A F0(lea)2.579 E -.15(ve)-.2 G
-2.579(st).15 G(he)-2.579 E(directions unchanged.\))144 369.6 Q F1
-(\255MXSx)108 386.4 Q F0 2.5(cross. Gi)144 398.4 R .3 -.15(ve l)-.25 H
-(ength in inch.).15 E F1(\255MXW)108 415.2 Q F2(pen)144 427.2 Q F0 .783
-(Set pen attrib)144 439.2 R .784
-(utes for xy plotting. See chapter 4.12 in the GMT T)-.2 F .784
-(echnical reference for a discus-)-.7 F(sion of GMT pen v)144 451.2 Q
-2.5(alues. [Def)-.25 F(aults: width = 1, color = 0/0/0, te)-.1 E
-(xture = solid].)-.15 E F1<ad4f>108 468 Q F2 -.45(ro)22.52 G(ot).45 E F0
-.423(Sets the root used to construct the \214lename of the output shell\
-script \()144 480 R F2 -.45(ro)C(ot).45 E F0 .422
-(.cmd\) and names of \214les)B .156
-(created when the shellscript is run.)144 492 R .157
-(Normally the name of the input grid \214le or grid \214le list is used)
-5.157 F(as the)144 504 Q F2 -.45(ro)2.5 G(ot).45 E F0(.)A F1<ad50>108
-520.8 Q F2(pa)24.19 E -.1(ge)-.1 G(size).1 E F0 .632(This option sets t\
-he size of the page the plot will be centered on. If the user does not \
-set the plot)144 532.8 R .125(scale, the plot will be sized as lar)144
-544.8 R .125(ge as will \214t on the designated page. If the user sets \
-the plot scale)-.18 F .948
-(such that the plot will not \214t on the designated page, a lar)144
-556.8 R .948(ger page will be used.)-.18 F .947(The supported)5.947 F
-(page sizes are:)144 568.8 Q(American ANSI sizes:)169 592.8 Q 12.5(A8)
-169 604.8 S(.5 x 11.0 in.)-12.5 E 2.5(\(2)10 G(15.9 x)-2.5 E(279.4 mm\))
-5 E 10(B1)169 616.8 S(1.0 x 17.0 in.)-10 E 2.5(\(2)10 G(79.4 x)-2.5 E
-(431.8 mm\))5 E 10(C1)169 628.8 S(7.0 x 22.0 in.)-10 E 2.5(\(4)10 G
-(31.8 x)-2.5 E(558.8 mm\))5 E 10(D2)169 640.8 S(2.0 x 34.0 in.)-10 E 2.5
-(\(5)10 G(58.8 x)-2.5 E(863.6 mm\))5 E 10(E3)169 652.8 S(4.0 x 44.0 in.)
--10 E 2.5(\(8)10 G(63.6 x 1117.6 mm\))-2.5 E 10(F2)169 664.8 S
-(8.0 x 40.0 in.)-10 E 2.5(\(7)10 G(11.2 x 1016.0 mm\))-2.5 E 5(E1 44.0)
-169 676.8 R 2.5(x6)2.5 G(8.0 in.)-2.5 E(\(1117.6 x 1727.2 mm\))10 E
-(Metric ISO A sizes:)169 700.8 Q 5(A0 841.0)169 712.8 R 2.5(x1)2.5 G
-(189.0 mm)-2.5 E(\(33.11 x 46.81 in.\))5 E 5(A1 594.0)169 724.8 R 5(x8)
-2.5 G(41.0 mm)-5 E(\(23.39 x 33.11 in.\))5 E(MB-System 5.0)72 768 Q 2.5
-(9J)140.11 G(anuary 2015)-2.5 E(10)193.45 E 0 Cg EP
-%%Page: 11 11
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 133.72(mbm_grdplot\(1\) MB-System)72 48 R 133.72
-(5.0 mbm_grdplot\(1\))2.5 F 5(A2 420.0)169 84 R 5(x5)2.5 G(94.0 mm)-5 E
-(\(16.54 x 23.39 in.\))5 E 5(A3 297.0)169 96 R 5(x4)2.5 G(20.0 mm)-5 E
-(\(11.69 x 16.54 in.\))5 E 5(A4 210.0)169 108 R 5(x2)2.5 G(97.0 mm)-5 E
-2.5(\(8)5 G(.27 x 11.69 in.\))-2.5 E 5(A5 148.0)169 120 R 5(x2)2.5 G
-(10.0 mm)-5 E 2.5(\(5)5 G(.83 x)-2.5 E(8.27 in.\))5 E 5(A6 105.0)169 132
-R 5(x1)2.5 G(48.0 mm)-5 E 2.5(\(4)5 G(.13 x)-2.5 E(5.83 in.\))5 E 7.5
-(A7 74.0)169 144 R 5(x1)2.5 G(05.0 mm)-5 E 2.5(\(2)5 G(.91 x)-2.5 E
-(4.13 in.\))5 E 7.5(A8 52.0)169 156 R 7.5(x7)2.5 G(4.0 mm)-7.5 E 2.5
-(\(2)5 G(.05 x)-2.5 E(2.91 in.\))5 E 7.5(A9 37.0)169 168 R 7.5(x5)2.5 G
-(2.0 mm)-7.5 E 2.5(\(1)5 G(.46 x)-2.5 E(2.05 in.\))5 E 5(A10 26.0)169
-180 R 7.5(x3)2.5 G(7.0 mm)-7.5 E 2.5(\(1)5 G(.02 x)-2.5 E(1.46 in.\))5 E
-(Metric ISO B sizes:)169 204 Q 5(B0 1000.0x)169 216 R(1414.0 mm)2.5 E
-(\(39.37 x 55.67 in.\))5 E 5(B1 707.0)169 228 R 2.5(x1)2.5 G(000.0 mm)
--2.5 E(\(27.83 x 39.37 in.\))5 E 5(B2 500.0)169 240 R 5(x7)2.5 G
-(07.0 mm)-5 E(\(19.68 x 27.83 in.\))5 E 5(B3 353.0)169 252 R 5(x5)2.5 G
-(00.0 mm)-5 E(\(13.90 x 19.68 in.\))5 E 5(B4 250.0)169 264 R 5(x3)2.5 G
-(53.0 mm)-5 E 2.5(\(9)5 G(.84 x 13.90 in.\))-2.5 E 5(B5 176.0)169 276 R
-5(x2)2.5 G(50.0 mm)-5 E 2.5(\(6)5 G(.93 x)-2.5 E(9.84 in.\))5 E 5
-(B6 125.0)169 288 R 5(x1)2.5 G(76.0 mm)-5 E 2.5(\(4)5 G(.92 x)-2.5 E
-(6.93 in.\))5 E 7.5(B7 88.0)169 300 R 5(x1)2.5 G(25.0 mm)-5 E 2.5(\(3)5
-G(.46 x)-2.5 E(4.92 in.\))5 E 7.5(B8 62.0)169 312 R 7.5(x8)2.5 G(8.0 mm)
--7.5 E 2.5(\(2)5 G(.44 x)-2.5 E(3.46 in.\))5 E 7.5(B9 44.0)169 324 R 7.5
-(x6)2.5 G(2.0 mm)-7.5 E 2.5(\(1)5 G(.73 x)-2.5 E(2.44 in.\))5 E 5
-(B10 31.0)169 336 R 7.5(x4)2.5 G(4.0 mm)-7.5 E 2.5(\(1)5 G(.22 x)-2.5 E
-(1.73 in.\))5 E(Metric ISO C sizes:)169 360 Q 5(C0 914.4)169 372 R 2.5
-(x1)2.5 G(300.5 mm)-2.5 E(\(36.00 x 51.20 in.\))5 E 5(C1 650.2)169 384 R
-5(x9)2.5 G(14.4 mm)-5 E(\(25.60 x 36.00 in.\))5 E 5(C2 457.2)169 396 R 5
-(x6)2.5 G(50.2 mm)-5 E(\(18.00 x 25.60 in.\))5 E 5(C3 325.1)169 408 R 5
-(x4)2.5 G(57.2 mm)-5 E(\(12.80 x 18.00 in.\))5 E 5(C4 228.6)169 420 R 5
-(x3)2.5 G(25.1 mm)-5 E 2.5(\(9)5 G(.00 x 12.80 in.\))-2.5 E 5(C5 162.6)
-169 432 R 5(x2)2.5 G(28.6 mm)-5 E 2.5(\(6)5 G(.40 x)-2.5 E(9.00 in.\))5
-E 5(C6 114.3)169 444 R 5(x1)2.5 G(62.6 mm)-5 E 2.5(\(4)5 G(.50 x)-2.5 E
-(6.40 in.\))5 E 7.5(C7 81.3)169 456 R 5(x1)2.5 G(14.3 mm)-5 E 2.5(\(3)5
-G(.20 x)-2.5 E(4.50 in.\))5 E(MB-System lar)185 480 Q(ge format sizes:)
--.18 E 2.5(m1 1371.6)169 492 R 2.5(x1)2.5 G(828.8 mm)-2.5 E
-(\(54.00 x 72.00 in.\))5 E 2.5(m2 1371.6)169 504 R 2.5(x2)2.5 G
-(133.6 mm)-2.5 E(\(54.00 x 84.00 in.\))5 E 2.5(m3 1371.6)169 516 R 2.5
-(x2)2.5 G(438.4 mm)-2.5 E(\(54.00 x 96.00 in.\))5 E 2.5(m4 1524.0)169
-528 R 2.5(x1)2.5 G(828.8 mm)-2.5 E(\(60.00 x 72.00 in.\))5 E 2.5
-(m5 1524.0)169 540 R 2.5(x2)2.5 G(133.6 mm)-2.5 E(\(60.00 x 84.00 in.\))
-5 E 2.5(m6 1524.0)169 552 R 2.5(x2)2.5 G(438.4 mm)-2.5 E
-(\(60.00 x 96.00 in.\))5 E(The def)144 576 Q(ault page size is A.)-.1 E
-/F1 10/Times-Bold at 0 SF<ad51>108 592.8 Q F0(Normally)22.52 E 2.866(,t)
--.65 G .367
-(he output plot generation shellscript includes lines which e)-2.866 F
--.15(xe)-.15 G .367(cute a program to display).15 F 1.072
-(the Postscript image on the screen.)144 604.8 R 1.071
-(This option causes those lines to be commented out so that)6.071 F -.15
-(exe)144 616.8 S .147
-(cuting the shellscript produces a Postscript plot b).15 F .148
-(ut does not attempt to display it on the screen.)-.2 F(Alternati)144
-628.8 Q -.15(ve)-.25 G(ly).15 E 2.892(,i)-.65 G -1.9 -.4(nv o)-2.892 H
-.392(king the plot generation shellscript with a).4 F F1(-N)2.891 E F0
-.391(command line ar)2.891 F .391(gument also sup-)-.18 F .088
-(presses the screen display of the plot.)144 640.8 R .089
-(The program to be used to display the Postscript is set using)5.088 F
-F1(mbdefaults)144 652.8 Q F0 7.891(;t)C 5.391(he def)-7.891 F 5.391
-(ault v)-.1 F 5.391(alue can be o)-.25 F -.15(ve)-.15 G 5.391
-(rridden by setting the en).15 F 5.39(vironment v)-.4 F(ariable)-.25 E
-($MB_PS_VIEWER.)144 664.8 Q F1<ad52>108 681.6 Q/F2 10/Times-Italic at 0 SF
-(west/east/south/north)23.08 E .736(west, east, south,)144 693.6 R F0
-(and)3.236 E F2(north)3.236 E F0 .736(specify the Re)3.236 F .736
-(gion of interest.)-.15 F 2.336 -.8(To s)5.736 H .736
-(pecify boundaries in de).8 F .736(grees and)-.15 F 1.162
-(minutes [and seconds], use the dd:mm[:ss] format.)144 705.6 R(Append)
-6.161 E F1(r)3.661 E F0 1.161(if lo)3.661 F 1.161
-(wer left and upper right map)-.25 F .208(coordinates are gi)144 717.6 R
--.15(ve)-.25 G 2.708(ni).15 G .208(nstead of wesn.)-2.708 F -1.1(Yo)
-5.208 G 2.708(um)1.1 G .208(ay ask for a lar)-2.708 F(ger)-.18 E F2
-(w/e/s/n)2.708 E F0(re)2.708 E .209(gion to ha)-.15 F .509 -.15(ve m)-.2
-H .209(ore room).15 F 1.371(between the image and the ax)144 729.6 R
-3.871(es. A)-.15 F 1.371(smaller re)3.871 F 1.37
-(gion than speci\214ed in the grd\214le will result in a)-.15 F
-(MB-System 5.0)72 768 Q 2.5(9J)140.11 G(anuary 2015)-2.5 E(11)193.45 E 0
-Cg EP
-%%Page: 12 12
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 133.72(mbm_grdplot\(1\) MB-System)72 48 R 133.72
-(5.0 mbm_grdplot\(1\))2.5 F(subset of the grid [Def)144 84 Q(ault is re)
--.1 E(gion gi)-.15 E -.15(ve)-.25 G 2.5(nb).15 G 2.5(yt)-2.5 G
-(he grd\214le].)-2.5 E/F1 10/Times-Bold at 0 SF<ad53>108 100.8 Q/F2 10
-/Times-Italic at 0 SF([color/shade])24.74 E F0 1.392
-(This option enables ef)144 112.8 R(fecti)-.25 E 1.692 -.15(ve h)-.25 H
-1.392(istogram equalization of the color and/or shading of the gridded)
-.15 F .628(data. The equalization is not achie)144 124.8 R -.15(ve)-.25
-G 3.128(db).15 G 3.128(yc)-3.128 G .628(hanging the data v)-3.128 F .628
-(alues, b)-.25 F .628(ut rather by constructing the)-.2 F .518(color or\
- shading tables so that the boundaries in the tables encompass equal fr\
-actions of the data-)144 136.8 R .19(points. This serv)144 148.8 R .19
-(es to focus color or shading contrasts in v)-.15 F .19
-(alue ranges corresponding to the b)-.25 F .19(ulk of)-.2 F .837
-(the data v)144 160.8 R 3.338(alues. If)-.25 F F1<ad53>3.338 E F0 .838
-(is gi)3.338 F -.15(ve)-.25 G 3.338(na).15 G .838(lone or with)-3.338 F
-F2(color)3.338 E F0 3.338(=1)3.338 G 3.338(,i)-3.338 G 3.338(te)-3.338 G
-.838(nables equalization of the color table)-3.338 F .991
-(used for color or gray \214ll plots,)144 172.8 R .991
-(shaded or unshaded. If the plot is to be shaded,)5.991 F .991
-(either by syn-)5.991 F .637(thetic illumination \()144 184.8 R F1<ad47>
-A F2(2)A F0 3.137(\)o)C 3.137(ru)-3.137 G .637
-(sing an intensity \214le \()-3.137 F F1<ad4b>A F0(and)3.138 E F1<ad47>
-3.138 E F2(3)A F0 .638(options\), then setting)3.138 F F2(shade)3.138 E
-F0 3.138(=1)3.138 G .5(will cause the shading to be equalized.)144 196.8
-R(Using)5.5 E F1<ad53>3 E F2(0/1)A F0 .5
-(will equalize the shading without equalizing)3 F(the color table.)144
-208.8 Q F1<ad54>108 225.6 Q F0(If)23.63 E F1<ad54>2.7 E F0 .201(is gi)
-2.701 F -.15(ve)-.25 G .201(n, it causes a coastline to be dra).15 F
-.201(wn on the map. The def)-.15 F .201(ault is to dra)-.1 F 2.701(wt)
--.15 G .201(he coastline as)-2.701 F .629(the thinnest possible line. T)
-144 237.6 R 3.129(oe)-.8 G -.15(xe)-3.279 G .628(rcise greater control \
-of the coastline plotting, including color \214ll).15 F 2.068
-(of "dry" areas and display of lak)144 249.6 R 2.068(es, ri)-.1 F -.15
-(ve)-.25 G 2.068(rs, and political boundaries, use the).15 F F1(\255MTC)
-4.568 E F0(,)A F1(\255MTD)4.568 E F0(,)A F1(\255MTG)144 261.6 Q F0(,)A
-F1(\255MTI)2.5 E F0(,)A F1(\255MTN)2.5 E F0(,)A F1(\255MTS)2.5 E F0 2.5
-(,a)C(nd)-2.5 E F1(\255MTW)2.5 E F0(options.)2.5 E F1<ad55>108 278.4 Q
-F2(orientation)23.08 E F0 .2(Normally the orientation of the plot \(por\
-trait or landscape\) is selected automatically so as to maxi-)144 290.4
-R .333(mize the plot scale.)144 302.4 R(The)5.333 E F1<ad55>2.833 E F0
-.333(option allo)2.833 F .333
-(ws the user to set the plot orientation. If)-.25 F F2(orientation)2.833
-E F0 2.834(=1)2.834 G 2.834(,a)-2.834 G
-(portrait plot will be produced; if)144 314.4 Q F2(orientation)2.5 E F0
-2.5(=2)2.5 G 2.5(,al)-2.5 G(andscape plot will be produced.)-2.5 E F1
-<ad56>108 331.2 Q F0(Causes)23.08 E F1(mbm_grdplot)4.506 E F0 2.006
-(to operate in "v)4.506 F 2.005
-(erbose" mode so that it outputs more information than)-.15 F(usual.)144
-343.2 Q F1<ad57>108 360 Q F2([color_style)20.3 E F0([)A F2(/palette)A F0
-([)A F2(ncolor)A(s)-.1 E F0(]] | cpt\214le])A
-(This option controls the color scheme used for color \214ll plots.)144
-372 Q(If)144 396 Q F2(color_style)3.135 E F0 3.136(=1[)3.135 G(def)
--3.136 E .636(ault], then the color scheme used will be a continuous gr\
-ading of colors. If)-.1 F F2(color_style)144 408 Q F0 2.816(=2)2.816 G
-2.816(,t)-2.816 G .316
-(he color scheme will be a set of discrete color interv)-2.816 F .315
-(als. The color palette used is)-.25 F(set using)144 420 Q F2(palette)
-2.5 E F0 2.5(.S)C -2.15 -.25(ev e)-2.5 H 2.5(np).25 G(alettes are a)-2.5
-E -.25(va)-.2 G(ilable:).25 E F2(palette)180 432 Q F0 2.5(=1)2.5 G 26.36
-(:H)-2.5 G(axby colors [def)-26.36 E(ault])-.1 E F2(palette)180 444 Q F0
-2.5(=2)2.5 G 26.36(:h)-2.5 G(igh Intensity colors)-26.36 E F2(palette)
-180 456 Q F0 2.5(=3)2.5 G 26.36(:l)-2.5 G .5 -.25(ow I)-26.36 H
-(ntensity colors).25 E F2(palette)180 468 Q F0 2.5(=4)2.5 G 26.36(:g)
--2.5 G(rayscale)-26.36 E F2(palette)180 480 Q F0 2.5(=5)2.5 G 26.36(:u)
--2.5 G(niform grayscale)-26.36 E F2(palette)180 492 Q F0 2.5(=6)2.5 G
-26.36(:u)-2.5 G(niform black)-26.36 E F2(palette)180 504 Q F0 2.5(=7)2.5
-G 26.36(:u)-2.5 G(niform white)-26.36 E F2(palette)180 516 Q F0 2.5(=8)
-2.5 G 26.36(:s)-2.5 G(eale)-26.36 E -.15(ve)-.25 G 2.5(l1).15 G F2
-(palette)180 528 Q F0 2.5(=9)2.5 G 26.36(:s)-2.5 G(eale)-26.36 E -.15
-(ve)-.25 G 2.5(l2).15 G
-(The RGB de\214nitions of the color palettes are:)144 552 Q
-(color palette 1 \255 Haxby Color T)144 576 Q(able)-.8 E 5(red: 255)149
-588 R(255 255 255 240 205 138 106)2.5 E 2.5(50 40 37)5 F
-(green: 255 186 161 189 236 255 236 235 190 127)149 600 Q(57)5 E 2.5
-(blue: 255)149 612 R 2.5(133 68 87)2.5 F(121 162 174 255 255 251 175)2.5
-E(color palette 2 \255 High Intensity Colors)144 636 Q 5(red: 255)149
-648 R(255 255 255 128)2.5 E 7.5(0000)7.5 G(128 255)-5 E 5(green: 0)149
-660 R(64 128 255 255 255 255 128)5 E 7.5(000)7.5 G 7.5(blue: 0)149 672 R
-7.5(00000)7.5 G(255 255 255 255 255)-5 E(color palette 3 \255 Lo)144 696
-Q 2.5(wI)-.25 G(ntensity Colors)-2.5 E 5(red: 200)149 708 R(194 179 141)
-2.5 E 5(90 0 0 0 0)5 F(90 141)5 E 5(green: 0)149 720 R 2.5(49 90)5 F
-(141 179 200 141)2.5 E 5(90 0 0 0)5 F(MB-System 5.0)72 768 Q 2.5(9J)
-140.11 G(anuary 2015)-2.5 E(12)193.45 E 0 Cg EP
-%%Page: 13 13
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 133.72(mbm_grdplot\(1\) MB-System)72 48 R 133.72
-(5.0 mbm_grdplot\(1\))2.5 F 7.5(blue: 0)149 84 R 7.5(00000)7.5 G
-(141 179 200 179 141)-5 E(color palette 4 \255 Grayscale)144 108 Q 5
-(red: 255)149 120 R(230 204 179 153 128 102)2.5 E 2.5(77 51 26)5 F(0)7.5
-E(green: 255 230 204 179 153 128 102)149 132 Q 2.5(77 51 26)5 F(0)7.5 E
-2.5(blue: 255)149 144 R(230 204 179 153 128 102)2.5 E 2.5(77 51 26)5 F
-(0)7.5 E(color palette 5 \255 Uniform Grayscale)144 168 Q 5(red: 128)149
-180 R(128 128 128 128 128 128 128 128 128 128)2.5 E
-(green: 128 128 128 128 128 128 128 128 128 128 128)149 192 Q 2.5
-(blue: 128)149 204 R(128 128 128 128 128 128 128 128 128 128)2.5 E
-(color palette 6 \255 Uniform Black)144 228 Q 10(red: 0)149 240 R 7.5
-(0000000000)7.5 G 5(green: 0 0 0 0 0 0 0 0 0 0 0)149 252 R 7.5(blue: 0)
-149 264 R 7.5(0000000000)7.5 G(color palette 7 \255 Uniform White)144
-288 Q 5(red: 255)149 300 R(255 255 255 255 255 255 255 255 255 255)2.5 E
-(green: 255 255 255 255 255 255 255 255 255 255 255)149 312 Q 2.5
-(blue: 255)149 324 R(255 255 255 255 255 255 255 255 255 255)2.5 E
-(color pallette 8 \255 Seale)144 348 Q -.15(ve)-.25 G 2.5(l1).15 G
-(\(colors here used abo)149 360 Q .3 -.15(ve z)-.15 H
-(ero Haxby colors belo).15 E(w\))-.25 E 5(red: 250)149 372 R
-(245 240 235 230 221 212 211 210 205 200)2.5 E
-(green: 250 240 230 221 212 201 190 180 170 160 150)149 384 Q 2.5
-(blue: 120)149 396 R(112 104)2.5 E 2.5(96 88 80 72 64 56 48 40)5 F
-(color pallette 9 \255 Seale)144 420 Q -.15(ve)-.25 G 2.5(l2).15 G
-(\(colors here used abo)149 432 Q .3 -.15(ve z)-.15 H
-(ero Haxby colors belo).15 E(w\))-.25 E 5(red: 255)149 444 R
-(210 170 145 120 120 104)2.5 E 2.5(67 33)5 F 7.5(00)7.5 G
-(green: 255 200 160 145 130 100 107 123 140 160 230)149 456 Q 2.5
-(blue: 100 75 50 45 40 30 24)149 468 R 7.5(7000)7.5 G .365
-(The Haxby colors ha)144 492 R .665 -.15(ve b)-.2 H .366
-(een adapted from a palette de).15 F -.15(ve)-.25 G .366(loped by Dr).15
-F 2.866(.W)-.55 G .366(illiam Haxby of the Lam-)-3.266 F .32
-(ont-Doherty Earth Observ)144 504 R .319
-(atory; this palette is pleasing to the e)-.25 F .319
-(ye and well suited for shading. The)-.15 F .309(high intensity colors \
-describe linear paths through RGB space from red to blue to green to pu\
-rple;)144 516 R .438(because the colors are high intensity the)144 528 R
-2.938(ya)-.15 G .437(re not well suited to shading.)-2.938 F .437
-(The lo)5.437 F 2.937(wi)-.25 G .437(ntensity colors)-2.937 F .517
-(are similar to the high intensity)144 540 R 3.017(,b)-.65 G .517
-(ut muted and thus well suited to shading.)-3.217 F .517
-(The grayscale palette)5.517 F .499(runs linearly from white to black a\
-nd is commonly used for plots of sidescan and amplitude data.)144 552 R
-(The uniform grayscale is useful for non-color shaded relief plots.)144
-564 Q(The)144 588 Q/F1 10/Times-Italic at 0 SF(ncolor)2.606 E(s)-.1 E F0
-.107(parameter sets the number of color v)2.606 F .107
-(alues used in plotting, whether the colors are rep-)-.25 F(resented in\
- a continuous color scale or a stepped, discrete color scale [def)144
-600 Q(ault is 11].)-.1 E .523(If the option ar)144 624 R .522
-(gument is the path to an e)-.18 F(xisting)-.15 E/F2 10/Times-Bold at 0 SF
-(GMT)3.022 E F0 .522(color palette \(CPT\) \214le, then that CPT \214le)
-3.022 F(and its color scheme will be used for the plot)144 636 Q F2
-<ad58>108 652.8 Q F0(Normally)23.08 E(,)-.65 E F2(mbm_grdplot)3.304 E F0
-.804(creates an e)3.304 F -.15(xe)-.15 G .804
-(cutable shellscript and then e).15 F 3.304(xits. This)-.15 F .805
-(option will cause)3.304 F(the shellscript to be e)144 664.8 Q -.15(xe)
--.15 G(cuted in the background before).15 E F2(mbm_grdplot)2.5 E F0 -.15
-(ex)2.5 G(its.).15 E F2<ad59>108 681.6 Q F0(Normally)23.08 E(,)-.65 E F2
-(mbm_grdplot)5.333 E F0 2.833
-(generates nicely rounded numbers for the boundaries of the color)5.333
-F .654(palette. Often, the resulting color bounds e)144 693.6 R .655
-(xtend well outside the range of the gridded data.)-.15 F(This)5.655 E
-.923(option causes the minimum and maximum color boundaries to e)144
-705.6 R .923(xactly conform to the minimum)-.15 F .495(and maximum v)144
-717.6 R .496(alues of the grid, or)-.25 F 2.996(,i)-.4 G 2.996(ft)-2.996
-G(he)-2.996 E F2<ad5a>2.996 E F0 .496
-(option is used, the minimum and maximum v)2.996 F(alues)-.25 E
-(speci\214ed by the user)144 729.6 Q(.)-.55 E(MB-System 5.0)72 768 Q 2.5
-(9J)140.11 G(anuary 2015)-2.5 E(13)193.45 E 0 Cg EP
-%%Page: 14 14
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 133.72(mbm_grdplot\(1\) MB-System)72 48 R 133.72
-(5.0 mbm_grdplot\(1\))2.5 F/F1 10/Times-Bold at 0 SF<ad5a>108 84 Q/F2 10
-/Times-Italic at 0 SF(min/max[/mode])23.63 E F0 .787(This option o)144 96 R
--.15(ve)-.15 G .787(rrides the minimum and maximum v).15 F .786
-(alues of the gridded data, af)-.25 F .786(fecting the color)-.25 F .905
-(palette and the contour interv)144 108 R .905
-(al if those parameters are not speci\214ed by the user)-.25 F 3.405(.B)
--.55 G 3.405(yd)-3.405 G(ef)-3.405 E .905(ault \(i.e.)-.1 F F2(mode)144
-120 Q F0 .528(is omitted or equal to 0\), the macro selects the color p\
-alette bounds so that the)3.029 F 3.028(ye)-.15 G(ncompass)-3.028 E F2
-(min)144 132 Q F0(and)2.836 E F2(max)2.836 E F0 .336
-(while using nicely rounded numbers. If)2.836 F F2(mode)2.836 E F0 .336
-(is omitted or equal to 0, then the color)2.836 F .272
-(palette will end near)144 144 R F2(min)2.771 E F0(and)2.771 E F2(max)
-2.771 E F0 .271(whether it is linear stretched or histogram equalized.)
-2.771 F(If)5.271 E F2(mode)2.771 E F0(=)2.771 E .315
-(1, then the color stretching calculations will be done using)144 156 R
-F2(min)2.816 E F0(and)2.816 E F2(max)2.816 E F0 2.816(,b)C .316
-(ut then the \214rst and last)-3.016 F -.25(va)144 168 S .776(lues in t\
-he color palette will be set to the actual minimum and maximum v).25 F
-.775(alues.so that all the)-.25 F(data are displayed.)144 180 Q/F3 10.95
-/Times-Bold at 0 SF(EXAMPLES)72 208.8 Q F0 .106(Suppose we ha)108 220.8 R
-.406 -.15(ve o)-.2 H .106(btained tw).15 F 2.606(oG)-.1 G .106
-(RD \214les with dimensions of 127 by 194, one containing gridded bath)
--2.606 F(yme-)-.05 E .369(try \(grd_sb2112_e)108 232.8 R .368
-(xample_bath\) and the other gridded sidescan \(grd_sb2112_e)-.15 F .368
-(xample_ss\). In order to gen-)-.15 F(erate a shellscript which will in\
- turn generate a contour plot of the bath)108 244.8 Q(ymetry)-.05 E 2.5
-(,t)-.65 G(he follo)-2.5 E(wing will suf)-.25 E(\214ce:)-.25 E
-(mbm_grdplot \255Igrd_sb2112_e)144 268.8 Q(xample_bath \255C \\)-.15 E
-(\255V \255Ogrd_sb2112_e)154 280.8 Q(xample_bathcont)-.15 E .012
-(In order to generate a color \214ll plot o)108 304.8 R -.15(ve)-.15 G
-.013(rlaid by contours, we use both the \255G1 and \255C options.).15 F
-.013(Because the)5.013 F 1.111(data has been gridded as bath)108 316.8 R
-1.111(ymetry \(positi)-.05 F 1.411 -.15(ve d)-.25 H -.25(ow).15 G 1.111
-(n\) rather than as topograph).25 F 3.61(y\()-.05 G(positi)-3.61 E 1.41
--.15(ve u)-.25 H 1.11(p\), the def).15 F(ault)-.1 E .158(plot will ha)
-108 328.8 R .458 -.15(ve ")-.2 H .158(hot" colors for deep re).15 F .158
-(gions and "cold" colors for shallo)-.15 F 2.659(wr)-.25 G -.15(eg)
--2.659 G .159(ions; this is the opposite of the).15 F(con)108 340.8 Q
--.15(ve)-.4 G .58
-(ntion we usually use. In order to \214x the colors, we ha).15 F .88
--.15(ve t)-.2 H 3.08(oe).15 G .58
-(ither rescale the data by multiplying the)-3.08 F(bath)108 352.8 Q .566
-(ymetry by \2551 \(accomplished with \255MGS-1\), or \215ip the color p\
-alette \(accomplished with \255D\). W)-.05 F 3.066(eu)-.8 G(se)-3.066 E
-(the latter approach:)108 364.8 Q(mbm_grdplot \255Igrd_sb2112_e)144
-388.8 Q(xample_bath \255G1 \255C \255D \\)-.15 E
-(\255V \255Ogrd_sb2112_e)154 400.8 Q(xample_bath\214ll)-.15 E .51(In or\
-der to generate a grayscale plot of the sidescan grid, we use \255G1 an\
-d \255W1/4. W)108 424.8 R 3.009(ea)-.8 G .509(lso use \255D so that)
--3.009 F(high sidescan amplitudes are sho)108 436.8 Q(wn as dark.)-.25 E
-(mbm_grdplot \255Igrd_sb2112_e)144 460.8 Q(xample_ss \255G1 \255D \\)
--.15 E(\255V \255Ogrd_sb2112_e)154 472.8 Q(xample_ss\214ll)-.15 E(No)108
-496.8 Q 3.224(wc)-.25 G .724(onsider generating a shaded relief vie)
--3.224 F 3.224(wo)-.25 G 3.224(ft)-3.224 G .724(he gridded bath)-3.224 F
-(ymetry)-.05 E 3.225(.W)-.65 G 3.225(ec)-4.025 G .725
-(hoose to illuminate the ba-)-3.225 F(th)108 508.8 Q 1.305
-(ymetry from the northeast \(azimuth of 45 de)-.05 F 1.305
-(grees\) and to use a shading magnitude of 0.4 \(-A0.4/45\).)-.15 F .428
-(Because this grid is so small, the def)108 520.8 R .428
-(ault shaded relief image is lik)-.1 F .428(ely to be grain)-.1 F 1.728
--.65(y. T)-.15 H 2.928<6f8c>-.15 G 2.928(xt)-2.928 G .428
-(his problem, we)-2.928 F .62
-(specify a dots per inch resolution of 72 \(-MGQ72\); this will tak)108
-532.8 R 3.12(el)-.1 G .62(onger and generate a lar)-3.12 F .62
-(ger plot\214le, b)-.18 F(ut)-.2 E .124(the plot will look better)108
-544.8 R 2.624(.W)-.55 G 2.624(ea)-3.424 G .124(lso use the \255L option\
- to specify the title and color scale label for the plot.)-2.624 F -.8
-(We)5.125 G .856(also use the \255X \215ag this so that the plot genera\
-tion shellscript is e)108 556.8 R -.15(xe)-.15 G .856(cuted immediately)
-.15 F 3.356(.H)-.65 G .856(ere is the com-)-3.356 F(mand:)108 568.8 Q
-(mbm_grdplot \255Igrd_sb2112_e)144 592.8 Q(xample_bath \\)-.15 E
-(\255G2 \255A0.4/45 \255D \255MGQ72 \255X \255V \\)154 604.8 Q
-(\255L"Shaded Relief Bath)154 616.8 Q(ymetry":"Depth \(meters\)" \\)-.05
-E(\255Osb2112_e)154 628.8 Q(xample_bathshade)-.15 E(No)108 652.8 Q 1.32
--.65(w, c)-.25 H .02(onsider generating a plot of the bath).65 F .02
-(ymetry o)-.05 F -.15(ve)-.15 G .02(rlaid with the gridded sidescan.).15
-F .02(The sidescan o)5.02 F -.15(ve)-.15 G(rlay).15 E .939
-(is speci\214ed using the \255K option.)108 664.8 R 2.539 -.8(We w)5.939
-H .939(ant the colors for the bath).7 F .938
-(ymetry to be chosen without histogram)-.05 F .703(equalization, b)108
-676.8 R .703(ut we also w)-.2 F .703(ant histogram equalization to be a\
-pplied to the sidescan data used for shading.)-.1 F 2.125 -.8(To d)108
-688.8 T 3.025(ot).8 G .524(his, we use \255S0/1, where the \214rst numb\
-er \(0\) speci\214es no histogram equalization of the color scale)-3.025
-F .583(and the second number \(1\) causes histogram equalization of the\
- shading sidescan data to be implemented.)108 700.8 R .709
-(In order to maintain the con)108 712.8 R -.15(ve)-.4 G .709(ntion that\
- high sidescan amplitudes are black, we \215ip both the color palette)
-.15 F .037(\(as in the pre)108 724.8 R .037(vious e)-.25 F .037
-(xample\) and the shading scale with \255D1/1. W)-.15 F 2.537(ec)-.8 G
-.038(ould also \215ip the shading by specifying)-2.537 F(MB-System 5.0)
-72 768 Q 2.5(9J)140.11 G(anuary 2015)-2.5 E(14)193.45 E 0 Cg EP
-%%Page: 15 15
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 133.72(mbm_grdplot\(1\) MB-System)72 48 R 133.72
-(5.0 mbm_grdplot\(1\))2.5 F 2.912(an)108 84 S -2.25 -.15(eg a)-2.912 H
-(ti).15 E .712 -.15(ve s)-.25 H .412(hading magnitude \(-A-0.4\).).15 F
-.412(In this case, we for)5.412 F .412
-(go specifying the image resolution, resulting in)-.18 F 2.5(ag)108 96 S
-(rain)-2.5 E 2.5(yp)-.15 G(lot:)-2.5 E(mbm_grdplot \255Igrd_sb2112_e)144
-120 Q(xample_bath \\)-.15 E(\255G3 \255Kgrd_sb2112_e)154 132 Q
-(xample_ss \\)-.15 E(\255S0/1 \255D1/1 \255A0.4 \255X \255V \\)154 144 Q
-(\255L"Bath)154 156 Q(ymetry Ov)-.05 E(erlaid W)-.15 E
-(ith Sidescan":"Depth \(meters\)" \\)-.4 E(\255Osb2112_e)154 168 Q
-(xample_bathss)-.15 E(As an e)108 192 Q
-(xample, the contents of the plotting shellscript "grd_sb2112_e)-.15 E
-(xample_bath\214ll.cmd" are:)-.15 E(#)110.5 216 Q 2.5(#S)110.5 228 S
-(hellscript to create Postscript plot of data in grd \214le)-2.5 E 2.5
-(#C)110.5 240 S(reated by macro mbm_grdplot)-2.5 E(#)110.5 252 Q 2.5(#T)
-110.5 264 S(his shellscript created by follo)-2.5 E(wing command line:)
--.25 E 2.5(#m)110.5 276 S(bm_grdplot \255Igrd_sb2112_e)-2.5 E
-(xample_bath \255G1 \255C \255D \\)-.15 E 28.5(#-)110.5 288 S 2.5<56ad>
--28.5 G(Ogrd_sb2112_e)-2.5 E(xample_bath\214ll)-.15 E(#)110.5 300 Q 2.5
-(#S)110.5 312 S -2.25 -.2(av e)-2.5 H -.15(ex)2.7 G(isting GMT def).15 E
-(aults)-.1 E(echo Sa)110.5 324 Q(ving GMT def)-.2 E(aults...)-.1 E
-(gmtdef)110.5 336 Q(aults \255L > gmtdef)-.1 E(aults$$)-.1 E(#)110.5 348
-Q 2.5(#S)110.5 360 S(et ne)-2.5 E 2.5(wG)-.25 G(MT def)-2.5 E(aults)-.1
-E(echo Setting ne)110.5 372 Q 2.5(wG)-.25 G(MT def)-2.5 E(aults...)-.1 E
-(gmtset ANO)110.5 384 Q(T_FONT Helv)-.4 E(etica)-.15 E
-(gmtset LABEL_FONT Helv)110.5 396 Q(etica)-.15 E
-(gmtset HEADER_FONT Helv)110.5 408 Q(etica)-.15 E(gmtset ANO)110.5 420 Q
-(T_FONT_SIZE 8)-.4 E(gmtset LABEL_FONT_SIZE 8)110.5 432 Q
-(gmtset HEADER_FONT_SIZE 10)110.5 444 Q
-(gmtset FRAME_WIDTH 0.074999999999999997)110.5 456 Q
-(gmtset TICK_LENGTH 0.074999999999999997)110.5 468 Q(gmtset P)110.5 480
-Q -.4(AG)-.92 G(E_ORIENT).4 E -1.11(AT)-.93 G(ION LANDSCAPE)1.11 E
-(gmtset COLOR_B)110.5 492 Q -.4(AC)-.35 G(KGR).4 E(OUND 0/0/0)-.4 E
-(gmtset COLOR_FOREGR)110.5 504 Q(OUND 255/255/255)-.4 E(gmtset COLOR_N)
-110.5 516 Q(AN 255/255/255)-.35 E(#)110.5 528 Q 2.5(#M)110.5 540 S(ak)
--2.5 E 2.5(ec)-.1 G(olor palette table \214le)-2.5 E
-(echo Making color palette table \214le...)110.5 552 Q 5(echo 3000)110.5
-564 R(255 255 255)2.5 E(3150 255 186 133 > \\)7.5 E(grd_sb2112_e)74.5 E
-(xample_bath\214ll.cpt)-.15 E 5(echo 3150)110.5 576 R(255 186 133)2.5 E
-(3300 255 161)7.5 E(68 >> \\)5 E(grd_sb2112_e)74.5 E
-(xample_bath\214ll.cpt)-.15 E 5(echo 3300)110.5 588 R(255 161)2.5 E 5
-(68 3450)5 F(255 189)2.5 E(87 >> \\)5 E(grd_sb2112_e)74.5 E
-(xample_bath\214ll.cpt)-.15 E 5(echo 3450)110.5 600 R(255 189)2.5 E 5
-(87 3600)5 F(240 236 121 >> \\)2.5 E(grd_sb2112_e)74.5 E
-(xample_bath\214ll.cpt)-.15 E 5(echo 3600)110.5 612 R(240 236 121)2.5 E
-(3750 205 255 162 >> \\)7.5 E(grd_sb2112_e)74.5 E(xample_bath\214ll.cpt)
--.15 E 5(echo 3750)110.5 624 R(205 255 162)2.5 E(3900 138 236 174 >> \\)
-7.5 E(grd_sb2112_e)74.5 E(xample_bath\214ll.cpt)-.15 E 5(echo 3900)110.5
-636 R(138 236 174)2.5 E(4050 106 235 255 >> \\)7.5 E(grd_sb2112_e)74.5 E
-(xample_bath\214ll.cpt)-.15 E 5(echo 4050)110.5 648 R(106 235 255)2.5 E
-2.5(4200 50)7.5 F(190 255 >> \\)2.5 E(grd_sb2112_e)74.5 E
-(xample_bath\214ll.cpt)-.15 E 5(echo 4200)110.5 660 R(50 190 255)5 E 2.5
-(4350 40)7.5 F(127 251 >> \\)2.5 E(grd_sb2112_e)74.5 E
-(xample_bath\214ll.cpt)-.15 E 5(echo 4350)110.5 672 R(40 127 251)5 E 2.5
-(4500 37 57)7.5 F(175 >> \\)2.5 E(grd_sb2112_e)74.5 E
-(xample_bath\214ll.cpt)-.15 E(#)110.5 684 Q 2.5(#M)110.5 696 S(ak)-2.5 E
-2.5(ec)-.1 G(olor image)-2.5 E(echo Running grdimage...)110.5 708 Q
-(grdimage grd_sb2112_e)110.5 720 Q
-(xample_bath \255Jm24.418434289993325 \\)-.15 E(MB-System 5.0)72 768 Q
-2.5(9J)140.11 G(anuary 2015)-2.5 E(15)193.45 E 0 Cg EP
-%%Page: 16 16
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 133.72(mbm_grdplot\(1\) MB-System)72 48 R 133.72
-(5.0 mbm_grdplot\(1\))2.5 F(\255R114.221/114.421/-31.9001/-31.6377 \\)
-128 84 Q(\255Cgrd_sb2112_e)128 96 Q(xample_bath\214ll.cpt \\)-.15 E
-(\255P \255X1.8081565710006675 \255Y2 \255K \255V \\)128 108 Q 2.5(>g)
-128 120 S(rd_sb2112_e)-2.5 E(xample_bath\214ll.ps)-.15 E(#)110.5 132 Q
-2.5(#M)110.5 144 S(ak)-2.5 E 2.5(ec)-.1 G(ontour plot)-2.5 E
-(echo Running grdcontour)110.5 156 Q(...)-.55 E(grdcontour grd_sb2112_e)
-110.5 168 Q(xample_bath \255Jm24.418434289993325 \\)-.15 E
-(\255R114.221/114.421/-31.9001/-31.6377 \\)128 180 Q(\255C50 \\)128 192
-Q(\255L3144.51/4499.44 \255Wc1p \\)128 204 Q
-(\255P \255K \255O \255V >> grd_sb2112_e)128 216 Q(xample_bath\214ll.ps)
--.15 E(#)110.5 228 Q 2.5(#M)110.5 240 S(ak)-2.5 E 2.5(ec)-.1 G
-(olor scale)-2.5 E(echo Running psscale...)110.5 252 Q
-(psscale \255Cgrd_sb2112_e)110.5 264 Q(xample_bath\214ll.cpt \\)-.15 E
-(\255D2.4418/-0.5000/4.8837/0.1500h \\)128 276 Q(\255B":.Data V)128 288
-Q(alues:" \\)-1.11 E(\255P \255K \255O \255V >> grd_sb2112_e)128 300 Q
-(xample_bath\214ll.ps)-.15 E(#)110.5 312 Q 2.5(#M)110.5 324 S(ak)-2.5 E
-2.5(eb)-.1 G(asemap)-2.5 E(echo Running psbasemap...)110.5 336 Q
-(psbasemap \255Jm24.418434289993325 \\)110.5 348 Q
-(\255R114.221/114.421/-31.9001/-31.6377 \\)128 360 Q
-(\255B5m/5m:."Data File grd_sb2112_e)128 372 Q(xample_bath": \\)-.15 E
-(\255P \255O \255V >> grd_sb2112_e)128 384 Q(xample_bath\214ll.ps)-.15 E
-(#)110.5 396 Q 2.5(#D)110.5 408 S(elete surplus \214les)-2.5 E
-(echo Deleting surplus \214les...)110.5 420 Q(rm \255f grd_sb2112_e)
-110.5 432 Q(xample_bath\214ll.cpt)-.15 E(#)110.5 444 Q 2.5(#R)110.5 456
-S(eset GMT def)-2.5 E(ault fonts)-.1 E(echo Resetting GMT fonts...)110.5
-468 Q(mv gmtdef)110.5 480 Q(aults$$ .gmtdef)-.1 E(aults)-.1 E(#)110.5
-492 Q 2.5(#R)110.5 504 S(un xpsvie)-2.5 E(w)-.25 E(echo Running xpsvie)
-110.5 516 Q 2.5(wi)-.25 G 2.5(nb)-2.5 G(ackground...)-2.5 E(xpsvie)110.5
-528 Q 2.5<77ad>-.25 G(ps a \255maxp 4m grd_sb2112_e)-2.5 E
-(xample_bath\214ll.ps &)-.15 E(#)110.5 540 Q 2.5(#A)110.5 552 S
-(ll done!)-2.5 E(echo All done!)110.5 564 Q/F1 10.95/Times-Bold at 0 SF
-(SEE ALSO)72 592.8 Q/F2 10/Times-Bold at 0 SF(grdimage)108 604.8 Q F0
-(\(1\),)A F2(grdcontour)13.298 E F0(\(1\),)A F2(mbdefaults)13.298 E F0
-(\(1\),)A F2(mbgrid)13.298 E F0(\(1\),)A F2(mbsystem)13.298 E F0(\(1\),)
-A F2(mbm_grd3dplot)13.298 E F0(\(1\),)A F2(mbm_plot)108 616.8 Q F0
-(\(1\),)A F2(psbasemap)2.5 E F0(\(1\),)A F2(pstext)2.5 E F0(\(1\),)A F2
-(psxy)2.5 E F0(\(1\))A F1 -.11(BU)72 645.6 S(GS).11 E F0
-(By making this macro more useful, we ha)108 657.6 Q .3 -.15(ve a)-.2 H
-(lso made it more comple).15 E(x.)-.15 E(MB-System 5.0)72 768 Q 2.5(9J)
-140.11 G(anuary 2015)-2.5 E(16)193.45 E 0 Cg EP
-%%Trailer
-end
-%%EOF
diff --git a/src/ps/mbm_grdtiff.ps b/src/ps/mbm_grdtiff.ps
deleted file mode 100644
index 2adeb94..0000000
--- a/src/ps/mbm_grdtiff.ps
+++ /dev/null
@@ -1,863 +0,0 @@
-%!PS-Adobe-3.0
-%%Creator: groff version 1.19.2
-%%CreationDate: Wed Jul  1 12:29:28 2015
-%%DocumentNeededResources: font Times-Roman
-%%+ font Times-Bold
-%%+ font Times-Italic
-%%DocumentSuppliedResources: procset grops 1.19 2
-%%Pages: 8
-%%PageOrder: Ascend
-%%DocumentMedia: Default 612 792 0 () ()
-%%Orientation: Portrait
-%%EndComments
-%%BeginDefaults
-%%PageMedia: Default
-%%EndDefaults
-%%BeginProlog
-%%BeginResource: procset grops 1.19 2
-%!PS-Adobe-3.0 Resource-ProcSet
-/setpacking where{
-pop
-currentpacking
-true setpacking
-}if
-/grops 120 dict dup begin
-/SC 32 def
-/A/show load def
-/B{0 SC 3 -1 roll widthshow}bind def
-/C{0 exch ashow}bind def
-/D{0 exch 0 SC 5 2 roll awidthshow}bind def
-/E{0 rmoveto show}bind def
-/F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def
-/G{0 rmoveto 0 exch ashow}bind def
-/H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/I{0 exch rmoveto show}bind def
-/J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def
-/K{0 exch rmoveto 0 exch ashow}bind def
-/L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/M{rmoveto show}bind def
-/N{rmoveto 0 SC 3 -1 roll widthshow}bind def
-/O{rmoveto 0 exch ashow}bind def
-/P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/Q{moveto show}bind def
-/R{moveto 0 SC 3 -1 roll widthshow}bind def
-/S{moveto 0 exch ashow}bind def
-/T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/SF{
-findfont exch
-[exch dup 0 exch 0 exch neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/MF{
-findfont
-[5 2 roll
-0 3 1 roll
-neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/level0 0 def
-/RES 0 def
-/PL 0 def
-/LS 0 def
-/MANUAL{
-statusdict begin/manualfeed true store end
-}bind def
-/PLG{
-gsave newpath clippath pathbbox grestore
-exch pop add exch pop
-}bind def
-/BP{
-/level0 save def
-1 setlinecap
-1 setlinejoin
-72 RES div dup scale
-LS{
-90 rotate
-}{
-0 PL translate
-}ifelse
-1 -1 scale
-}bind def
-/EP{
-level0 restore
-showpage
-}def
-/DA{
-newpath arcn stroke
-}bind def
-/SN{
-transform
-.25 sub exch .25 sub exch
-round .25 add exch round .25 add exch
-itransform
-}bind def
-/DL{
-SN
-moveto
-SN
-lineto stroke
-}bind def
-/DC{
-newpath 0 360 arc closepath
-}bind def
-/TM matrix def
-/DE{
-TM currentmatrix pop
-translate scale newpath 0 0 .5 0 360 arc closepath
-TM setmatrix
-}bind def
-/RC/rcurveto load def
-/RL/rlineto load def
-/ST/stroke load def
-/MT/moveto load def
-/CL/closepath load def
-/Fr{
-setrgbcolor fill
-}bind def
-/setcmykcolor where{
-pop
-/Fk{
-setcmykcolor fill
-}bind def
-}if
-/Fg{
-setgray fill
-}bind def
-/FL/fill load def
-/LW/setlinewidth load def
-/Cr/setrgbcolor load def
-/setcmykcolor where{
-pop
-/Ck/setcmykcolor load def
-}if
-/Cg/setgray load def
-/RE{
-findfont
-dup maxlength 1 index/FontName known not{1 add}if dict begin
-{
-1 index/FID ne{def}{pop pop}ifelse
-}forall
-/Encoding exch def
-dup/FontName exch def
-currentdict end definefont pop
-}bind def
-/DEFS 0 def
-/EBEGIN{
-moveto
-DEFS begin
-}bind def
-/EEND/end load def
-/CNT 0 def
-/level1 0 def
-/PBEGIN{
-/level1 save def
-translate
-div 3 1 roll div exch scale
-neg exch neg exch translate
-0 setgray
-0 setlinecap
-1 setlinewidth
-0 setlinejoin
-10 setmiterlimit
-[]0 setdash
-/setstrokeadjust where{
-pop
-false setstrokeadjust
-}if
-/setoverprint where{
-pop
-false setoverprint
-}if
-newpath
-/CNT countdictstack def
-userdict begin
-/showpage{}def
-/setpagedevice{}def
-}bind def
-/PEND{
-countdictstack CNT sub{end}repeat
-level1 restore
-}bind def
-end def
-/setpacking where{
-pop
-setpacking
-}if
-%%EndResource
-%%EndProlog
-%%BeginSetup
-%%BeginFeature: *PageSize Default
-<< /PageSize [ 612 792 ] /ImagingBBox null >> setpagedevice
-%%EndFeature
-%%IncludeResource: font Times-Roman
-%%IncludeResource: font Times-Bold
-%%IncludeResource: font Times-Italic
-grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72
-def/PL 792 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron/Zcaron
-/scaron/zcaron/Ydieresis/trademark/quotesingle/Euro/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/space/exclam/quotedbl/numbersign/dollar/percent
-/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen
-/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon
-/semicolon/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O
-/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright/circumflex
-/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y
-/z/braceleft/bar/braceright/tilde/.notdef/quotesinglbase/guillemotleft
-/guillemotright/bullet/florin/fraction/perthousand/dagger/daggerdbl
-/endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut
-/dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash
-/quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen
-/brokenbar/section/dieresis/copyright/ordfeminine/guilsinglleft
-/logicalnot/minus/registered/macron/degree/plusminus/twosuperior
-/threesuperior/acute/mu/paragraph/periodcentered/cedilla/onesuperior
-/ordmasculine/guilsinglright/onequarter/onehalf/threequarters
-/questiondown/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE
-/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex
-/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis
-/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn
-/germandbls/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla
-/egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis
-/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide/oslash
-/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis]def
-/Times-Italic at 0 ENC0/Times-Italic RE/Times-Bold at 0 ENC0/Times-Bold RE
-/Times-Roman at 0 ENC0/Times-Roman RE
-%%EndSetup
-%%Page: 1 1
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mbm_grdtif)72 48 Q 137.31(f\(1\) MB-System)-.25
-F 137.31(5.0 mbm_grdtif)2.5 F(f\(1\))-.25 E/F1 10.95/Times-Bold at 0 SF
--.219(NA)72 84 S(ME).219 E/F2 10/Times-Bold at 0 SF(mbm_grdtiff)108 96 Q F0
-3.825<ad43>3.825 G 1.325(reate an e)-3.825 F -.15(xe)-.15 G 1.324(cutab\
-le shellscript which will generate a TIFF image of gridded data in a).15
-F(GMT grd \214le.)108 108 Q F1(VERSION)72 136.8 Q F0 -1.11(Ve)108 148.8
-S(rsion 5.0)1.11 E F1(SYNOPSIS)72 177.6 Q F2 5.215(mbm_grdtiff \255I)108
-189.6 R/F3 10/Times-Italic at 0 SF(\214le)A F0([)7.715 E F2<ad41>A F3(ma)A
-(gnitude[/azimuth/ele)-.1 E(vation])-.15 E F2<ad47>7.715 E F3
-(color_mode)A F2 5.215<ad4820ad4b>7.715 F F3(intensity_\214le)A F2<ad4f>
-7.715 E F3 -.45(ro)C(ot).45 E F2<ad53>108 201.6 Q F3([color/shade])A F2
-<ad5620ad57>2.5 E F3([color_style)A F0([)A F3(/palette)A F0([)A F3
-(ncolor)A(s)-.1 E F0(]] |)A F3(cpt\214le])2.5 E F0(])2.5 E
-(Additional Options:)108 237.6 Q([)108 249.6 Q F2<ad44>A F3
-(\215ipcolor/\215ipshade)A F2(\255MGS)2.5 E F3(scalefactor)A F2
-(\255MGW \255Q \255R)2.5 E F3(w/e/s/n)A F2<ad5820ad5920ad5a>2.5 E F3
-(min/max[/mode])A F0(])A F1(DESCRIPTION)72 278.4 Q F2(mbm_grdtiff)108
-290.4 Q F0 .184(is a macro to generate a shellscript which, when e)2.684
-F -.15(xe)-.15 G .184(cuted, will use the program).15 F F2(mbgrdtiff)
-2.683 E F0(to)2.683 E 1.328(generate a geographically located TIFF imag\
-e of gridded data. The primary purpose of this macro is to)108 302.4 R
-(allo)108 314.4 Q 2.775(wt)-.25 G .275
-(he simple, semi-automated production of a nice looking image with a fe)
--2.775 F 2.774(wc)-.25 G .274(ommand line ar)-2.774 F(guments.)-.18 E
-(Se)108 326.4 Q -.15(ve)-.25 G .079(ral styles of images can be generat\
-ed, including color \214ll and shaded relief maps. The a).15 F -.25(va)
--.2 G .079(ilable options).25 F(mirror a subset of the options in)108
-338.4 Q F2(mbm_grdplot)2.5 E F0 2.5(,a)C(llo)-2.5 E
-(wing users to easily generate equi)-.25 E -.25(va)-.25 G
-(lent Postscript plots).25 E 2.231
-(and TIFF images of gridded data. The program)108 350.4 R F2(mbgrdtiff)
-4.731 E F0 2.232(recognizes the coordinate system used by)4.732 F F2
-(mbgrid)108 362.4 Q F0(or)3.097 E F2(mbmosaic)3.097 E F0 .597(to genera\
-te a grid \214le, and then embeds the projection and grid bounds inform\
-ation)3.097 F .259(into the TIFF image in accordance with the GeoTIFF s\
-tandard. A number of GIS softw)108 374.4 R .259(are packages recog-)-.1
-F 1.666(nize the georeferencing information in GeoTIFF images.)108 386.4
-R 1.666(In particular)6.666 F 4.166(,i)-.4 G 1.666(mages generated by)
--4.166 F F2(mbgrdtiff)4.165 E F0 1.497(from grids created using)108
-398.4 R F2(mbgrid)3.997 E F0(or)3.997 E F2(mbmosaic)3.997 E F0 1.498
-(can be loaded into the GRASS, ArcInfo, ArcV)3.997 F(ie)-.6 E 2.798 -.65
-(w, a)-.25 H(nd).65 E .1
-(ArcGIS GIS packages as geographically located co)108 410.4 R -.15(ve)
--.15 G .1(rages. The).15 F F2(mbgrid)2.6 E F0(and)2.6 E F2(mbmosaic)2.6
-E F0 .1(manual pages each)2.6 F .399(contain an appendix with a complet\
-e list of the projected coordinate systems that may used in grid genera\
--)108 422.4 R 1.012(tion. Some softw)108 434.4 R 1.012
-(are packages \(e.g. W)-.1 F 1.011
-(infrog\) do not recognize the embedded coordinate system informa-)-.4 F
-1.36(tion, and install require a parallel "w)108 446.4 R 1.36
-(orld" \214le to specify the bounds and resolution. The)-.1 F F2(-MGW)
-3.86 E F0(option)3.86 E(causes a w)108 458.4 Q
-(orld \214le to be generated with a ".tfw" suf)-.1 E(\214x.)-.25 E F1
--.548(AU)72 487.2 S(THORSHIP).548 E F0(Da)108 499.2 Q(vid W)-.2 E 2.5
-(.C)-.92 G(aress \(caress at mbari.or)-2.5 E(g\))-.18 E(Montere)113 511.2 Q
-2.5(yB)-.15 G(ay Aquarium Research Institute)-2.5 E
-(Dale N. Chayes \(dale at ldeo.columbia.edu\))108 523.2 Q
-(Lamont-Doherty Earth Observ)113 535.2 Q(atory)-.25 E F1
-(SIMPLE DESCRIPTION OF B)72 564 Q(ASIC OPTIONS)-.329 E F2<ad41>108 576 Q
-F3(ma)23.08 E(gnitude[/azimuth/ele)-.1 E(vation])-.15 E F0 1.15(Sets th\
-e parameters which control the synthetic illumination of the gridded da\
-ta \(shaded relief\).)144 588 R .05(The v)144 600 R(alue)-.25 E F3(ma)
-2.55 E(gnitude)-.1 E F0 .05(is an ef)2.55 F(fecti)-.25 E .351 -.15
-(ve ve)-.25 H .051(rtical e).15 F .051
-(xageration which modulates the intensity of the shad-)-.15 F .882
-(ing; typical v)144 612 R .882(alues are in the 0.1 to 10 range.)-.25 F
-.882(The v)5.882 F(alue)-.25 E F3(azimuth)3.382 E F0 .881
-(is the azimuth in de)3.381 F .881(grees from)-.15 F .628
-(north from which the data is illuminated.)144 624 R .629(The v)5.629 F
-(alue)-.25 E F3(ele)3.129 E(vation)-.15 E F0 .629(is the ele)3.129 F
--.25(va)-.25 G .629(tion of the illumination).25 F(in de)144 636 Q
-(grees from horizontal.)-.15 E(Def)5 E(aults:)-.1 E F3(ma)2.5 E(gnitude)
--.1 E F0 2.5(=0)2.5 G(.2;)-2.5 E F3(azimuth)2.5 E F0 2.5(=0)2.5 G(.0;)
--2.5 E F3(ele)2.5 E(vation)-.15 E F0 2.5(=3)2.5 G(0.0;)-2.5 E F2<ad43>
-108 652.8 Q F3(contour_contr)23.08 E(ol)-.45 E F0(If)144 664.8 Q F2
-<ad43>3.459 E F0 .959(is gi)3.459 F -.15(ve)-.25 G 3.459(na).15 G .959
-(lone, it causes unannotated contours to be dra)-3.459 F .958
-(wn using a contour interv)-.15 F .958(al calcu-)-.25 F .214
-(lated from the data. The user may also use)144 676.8 R F3
-(contour_contr)2.714 E(ol)-.45 E F0 .215(to specify the contour interv)
-2.714 F .215(al. See the)-.25 F
-(COMPLETE DESCRIPTION OF OPTIONS section belo)144 688.8 Q 2.5(wf)-.25 G
-(or a more complete discussion.)-2.5 E F2<ad44>108 705.6 Q F3
-([\215ipcolor/\215ipshade])23.08 E F0(Normally)144 717.6 Q 3.321(,t)-.65
-G .821(he color or grayscale tables used for color maps run from cool c\
-olors \(or dark grays\))-3.321 F 1.289(for lo)144 729.6 R 3.789(wg)-.25
-G 1.289(rid v)-3.789 F 1.289
-(alues to hot colors \(or light grays\) for high grid v)-.25 F 3.79
-(alues. This)-.25 F 1.29(option re)3.79 F -.15(ve)-.25 G 1.29(rses the)
-.15 F(MB-System 5.0)72 768 Q(28 September 2013)131.775 E(1)190.115 E 0
-Cg EP
-%%Page: 2 2
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mbm_grdtif)72 48 Q 137.31(f\(1\) MB-System)-.25
-F 137.31(5.0 mbm_grdtif)2.5 F(f\(1\))-.25 E .028
-(color table so that cool colors \(dark grays\) correspond to high v)144
-84 R .028(alues and hot colors \(light grays\) to)-.25 F(lo)144 96 Q
-3.954(wv)-.25 G 3.954(alues. If)-4.204 F/F1 10/Times-Bold at 0 SF<ad44>
-3.954 E F0 1.454(is gi)3.954 F -.15(ve)-.25 G 3.954(na).15 G 1.454(lone\
-, it applies to the color table used for color or gray \214ll plots,)
--3.954 F .216(shaded or unshaded. If the plot is to be shaded,)144 108 R
-.216(either by synthetic illumination \()5.216 F F1<ad47>A/F2 10
-/Times-Italic at 0 SF(2)A F0 2.716(\)o)C 2.715(ru)-2.716 G .215(sing an)
--2.715 F .021(intensity \214le \()144 120 R F1<ad4b>A F0(and)2.522 E F1
-<ad47>2.522 E F2(3)A F0 .022(options\), then setting)2.522 F F2
-(\215ipshade)2.522 E F0 2.522(=1w)2.522 G .022
-(ill cause the shading con)-2.522 F -.15(ve)-.4 G .022(ntion to).15 F
-.088(be re)144 132 R -.15(ve)-.25 G .088(rsed \(e.g. high intensities o)
-.15 F -.15(ve)-.15 G .087(rlaid as light shading\).).15 F(Using)5.087 E
-F1<ad44>2.587 E F2(0/1)A F0 .087(will \215ip the shading con-)2.587 F
--.15(ve)144 144 S(ntion b).15 E(ut lea)-.2 E .3 -.15(ve t)-.2 H(he def)
-.15 E(ault color con)-.1 E -.15(ve)-.4 G(ntion.).15 E F1<ad47>108 160.8
-Q F2(color_mode)22.52 E F0 -.45(Tu)144 172.8 S
-(rns on color \214ll plot and sets the style of the plot.).45 E F2
-(color_mode)164 184.8 Q F0 2.5(=1)2.5 G 2.5(:C)-2.5 G(olor/gray \214ll.)
--2.5 E F2(color_mode)164 196.8 Q F0 2.5(=2)2.5 G 2.5(:C)-2.5 G
-(olor/gray \214ll shaded by)-2.5 E(synthetic illumination.)204 208.8 Q
-F2(color_mode)164 220.8 Q F0 2.5(=3)2.5 G 2.5(:C)-2.5 G
-(olor/gray \214ll shaded by)-2.5 E(an intensity \214le. The)204 232.8 Q
-F1<ad4b>2.5 E F0(option must be used to specify)204 244.8 Q
-(the intensity \214le.)252 256.8 Q F2(color_mode)164 268.8 Q F0 2.5(=4)
-2.5 G 2.5(:C)-2.5 G(olor/gray \214ll of slope)-2.5 E(magnitude.)252
-280.8 Q F2(color_mode)164 292.8 Q F0 2.5(=5)2.5 G 2.5(:C)-2.5 G
-(olor/gray \214ll shaded by)-2.5 E(slope magnitude.)204 304.8 Q F1<ad48>
-108 321.6 Q F0 .162(This "help" \215ag cause the program to print out a\
- description of its operation and then e)22.52 F .162(xit immedi-)-.15 F
-(ately)144 333.6 Q(.)-.65 E F1<ad49>108 350.4 Q F2(gr)26.41 E(d\214le)
--.37 E F0 .159(Sets the name of the gridded data \214le to be plotted.)
-144 362.4 R(Alternati)5.158 E -.15(ve)-.25 G(ly).15 E(,)-.65 E F2(gr)
-2.658 E(d\214le)-.37 E F0 .158(may be a list of grid \214les)2.658 F
-(\(one \214lename on each line\) to be plotted together)144 374.4 Q(.)
--.55 E F1<ad4b>108 391.2 Q F2(intensity_\214le)22.52 E F0 .37
-(Sets the name of the gridded data \214le containing instensity v)144
-403.2 R .37(alues to be used for shading the map.)-.25 F(Alternati)144
-415.2 Q -.15(ve)-.25 G(ly).15 E(,)-.65 E F2(gr)2.704 E(d\214le)-.37 E F0
-.204(may be a list of grid \214les \(one \214lename on each line\) to b\
-e used together)2.704 F 2.703(.I)-.55 G 2.703(fa)-2.703 G 1.499(list of\
- \214le is supplied, the intensity \214les must conform in order to the\
- data grid \214les the)144 427.2 R 3.999(yw)-.15 G(ill)-3.999 E(shade.)
-144 439.2 Q F1<ad4f>108 456 Q F2 -.45(ro)22.52 G(ot).45 E F0 .423(Sets \
-the root used to construct the \214lename of the output shellscript \()
-144 468 R F2 -.45(ro)C(ot).45 E F0 .422(.cmd\) and names of \214les)B
-.156(created when the shellscript is run.)144 480 R .157
-(Normally the name of the input grid \214le or grid \214le list is used)
-5.157 F(as the)144 492 Q F2 -.45(ro)2.5 G(ot).45 E F0(.)A F1<ad53>108
-508.8 Q F2([color/shade])24.74 E F0 1.393(This option enables ef)144
-520.8 R(fecti)-.25 E 1.693 -.15(ve h)-.25 H 1.392
-(istogram equalization of the color and/or shading of the gridded).15 F
-.628(data. The equalization is not achie)144 532.8 R -.15(ve)-.25 G
-3.128(db).15 G 3.128(yc)-3.128 G .628(hanging the data v)-3.128 F .628
-(alues, b)-.25 F .628(ut rather by constructing the)-.2 F .518(color or\
- shading tables so that the boundaries in the tables encompass equal fr\
-actions of the data-)144 544.8 R .19(points. This serv)144 556.8 R .19
-(es to focus color or shading contrasts in v)-.15 F .19
-(alue ranges corresponding to the b)-.25 F .19(ulk of)-.2 F .838
-(the data v)144 568.8 R 3.338(alues. If)-.25 F F1<ad53>3.338 E F0 .838
-(is gi)3.338 F -.15(ve)-.25 G 3.338(na).15 G .838(lone or with)-3.338 F
-F2(color)3.338 E F0 3.338(=1)3.338 G 3.338(,i)-3.338 G 3.338(te)-3.338 G
-.838(nables equalization of the color table)-3.338 F .991
-(used for color or gray \214ll plots,)144 580.8 R .991
-(shaded or unshaded. If the plot is to be shaded,)5.991 F .991
-(either by syn-)5.991 F .638(thetic illumination \()144 592.8 R F1<ad47>
-A F2(2)A F0 3.138(\)o)C 3.138(ru)-3.138 G .638
-(sing an intensity \214le \()-3.138 F F1<ad4b>A F0(and)3.137 E F1<ad47>
-3.137 E F2(3)A F0 .637(options\), then setting)3.137 F F2(shade)3.137 E
-F0 3.137(=1)3.137 G .5(will cause the shading to be equalized.)144 604.8
-R(Using)5.5 E F1<ad53>3 E F2(0/1)A F0 .5
-(will equalize the shading without equalizing)3 F(the color table.)144
-616.8 Q F1<ad55>108 633.6 Q F2(orientation)23.08 E F0 .2(Normally the o\
-rientation of the plot \(portrait or landscape\) is selected automatica\
-lly so as to maxi-)144 645.6 R .333(mize the plot scale.)144 657.6 R
-(The)5.333 E F1<ad55>2.833 E F0 .333(option allo)2.833 F .333
-(ws the user to set the plot orientation. If)-.25 F F2(orientation)2.833
-E F0 2.834(=1)2.834 G 2.834(,a)-2.834 G
-(portrait plot will be produced; if)144 669.6 Q F2(orientation)2.5 E F0
-2.5(=2)2.5 G 2.5(,al)-2.5 G(andscape plot will be produced.)-2.5 E F1
-<ad56>108 686.4 Q F0(Causes)23.08 E F1(mbm_grdtiff)2.776 E F0 .276
-(to operate in "v)2.776 F .276
-(erbose" mode so that it outputs more information than usual.)-.15 F F1
-<ad57>108 703.2 Q F2([color_style)20.3 E F0([)A F2(/palette)A F0([)A F2
-(ncolor)A(s)-.1 E F0(]] | cpt\214le])A
-(This option controls the color scheme used for color \214ll plots.)144
-715.2 Q(MB-System 5.0)72 768 Q(28 September 2013)131.775 E(2)190.115 E 0
-Cg EP
-%%Page: 3 3
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mbm_grdtif)72 48 Q 137.31(f\(1\) MB-System)-.25
-F 137.31(5.0 mbm_grdtif)2.5 F(f\(1\))-.25 E(If)144 84 Q/F1 10
-/Times-Italic at 0 SF(color_style)3.135 E F0 3.136(=1[)3.135 G(def)-3.136 E
-.636(ault], then the color scheme used will be a continuous grading of \
-colors. If)-.1 F F1(color_style)144 96 Q F0 2.816(=2)2.816 G 2.816(,t)
--2.816 G .316(he color scheme will be a set of discrete color interv)
--2.816 F .315(als. The color palette used is)-.25 F(set using)144 108 Q
-F1(palette)2.5 E F0 2.5(.F)C -2.15 -.25(iv e)-2.5 H(palettes are a)2.75
-E -.25(va)-.2 G(ilable:).25 E F1(palette)180 120 Q F0 2.5(=1)2.5 G 26.36
-(:H)-2.5 G(axby colors [def)-26.36 E(ault])-.1 E F1(palette)180 132 Q F0
-2.5(=2)2.5 G 26.36(:h)-2.5 G(igh Intensity colors)-26.36 E F1(palette)
-180 144 Q F0 2.5(=3)2.5 G 26.36(:l)-2.5 G .5 -.25(ow I)-26.36 H
-(ntensity colors).25 E F1(palette)180 156 Q F0 2.5(=4)2.5 G 26.36(:g)
--2.5 G(rayscale)-26.36 E F1(palette)180 168 Q F0 2.5(=5)2.5 G 26.36(:u)
--2.5 G(niform grayscale)-26.36 E 4.383(Ac)144 180 S 1.883
-(omplete description of the color palettes is gi)-4.383 F -.15(ve)-.25 G
-4.383(ni).15 G 4.383(nt)-4.383 G 1.883(he COMPLETE DESCRIPTION OF)-4.383
-F(OPTIONS section belo)144 192 Q -.65(w.)-.25 G(The)144 216 Q F1(ncolor)
-2.607 E(s)-.1 E F0 .107(parameter sets the number of color v)2.607 F
-.107(alues used in plotting, whether the colors are rep-)-.25 F(resente\
-d in a continuous color scale or a stepped, discrete color scale [def)
-144 228 Q(ault is 11].)-.1 E .522(If the option ar)144 252 R .522
-(gument is the path to an e)-.18 F(xisting)-.15 E/F2 10/Times-Bold at 0 SF
-(GMT)3.022 E F0 .523(color palette \(CPT\) \214le, then that CPT \214le)
-3.022 F(and its color scheme will be used for the plot)144 264 Q/F3
-10.95/Times-Bold at 0 SF(COMPLETE DESCRIPTION OF OPTIONS)72 292.8 Q F2
-<ad41>108 304.8 Q F1(ma)23.08 E(gnitude[/azimuth])-.1 E F0 1.15(Sets th\
-e parameters which control the synthetic illumination of the gridded da\
-ta \(shaded relief\).)144 316.8 R .05(The v)144 328.8 R(alue)-.25 E F1
-(ma)2.55 E(gnitude)-.1 E F0 .05(is an ef)2.55 F(fecti)-.25 E .351 -.15
-(ve ve)-.25 H .051(rtical e).15 F .051
-(xageration which modulates the intensity of the shad-)-.15 F .827
-(ing; typical v)144 340.8 R .827(alues are in the 0.1 to 0.5 range.)-.25
-F .827(The v)5.827 F(alue)-.25 E F1(azimuth)3.327 E F0 .826
-(is the azimuth from which the)3.326 F(data is illuminated.)144 352.8 Q
-(Def)5 E(aults:)-.1 E F1(ma)2.5 E(gnitude)-.1 E F0 2.5(=0)2.5 G(.2;)-2.5
-E F1(azimuth)2.5 E F0 2.5(=0)2.5 G(.0;)-2.5 E F2<ad44>108 369.6 Q F1
-([\215ipcolor/\215ipshade])23.08 E F0(Normally)144 381.6 Q 3.32(,t)-.65
-G .821(he color or grayscale tables used for color maps run from cool c\
-olors \(or dark grays\))-3.32 F 1.29(for lo)144 393.6 R 3.79(wg)-.25 G
-1.29(rid v)-3.79 F 1.289
-(alues to hot colors \(or light grays\) for high grid v)-.25 F 3.789
-(alues. This)-.25 F 1.289(option re)3.789 F -.15(ve)-.25 G 1.289
-(rses the).15 F .028
-(color table so that cool colors \(dark grays\) correspond to high v)144
-405.6 R .029(alues and hot colors \(light grays\) to)-.25 F(lo)144 417.6
-Q 3.955(wv)-.25 G 3.955(alues. If)-4.205 F F2<ad44>3.955 E F0 1.454
-(is gi)3.955 F -.15(ve)-.25 G 3.954(na).15 G 1.454(lone, it applies to \
-the color table used for color or gray \214ll plots,)-3.954 F .216
-(shaded or unshaded. If the plot is to be shaded,)144 429.6 R .216
-(either by synthetic illumination \()5.216 F F2<ad47>A F1(2)A F0 2.716
-(\)o)C 2.716(ru)-2.716 G .216(sing an)-2.716 F .022(intensity \214le \()
-144 441.6 R F2<ad4b>A F0(and)2.522 E F2<ad47>2.522 E F1(3)A F0 .022
-(options\), then setting)2.522 F F1(\215ipshade)2.522 E F0 2.522(=1w)
-2.522 G .022(ill cause the shading con)-2.522 F -.15(ve)-.4 G .021
-(ntion to).15 F .087(be re)144 453.6 R -.15(ve)-.25 G .087
-(rsed \(e.g. high intensities o).15 F -.15(ve)-.15 G .087
-(rlaid as light shading\).).15 F(Using)5.087 E F2<ad44>2.587 E F1(0/1)A
-F0 .088(will \215ip the shading con-)2.588 F -.15(ve)144 465.6 S
-(ntion b).15 E(ut lea)-.2 E .3 -.15(ve t)-.2 H(he def).15 E
-(ault color con)-.1 E -.15(ve)-.4 G(ntion.).15 E F2<ad47>108 482.4 Q F1
-(color_mode)22.52 E F0 -.45(Tu)144 494.4 S
-(rns on color \214ll plot and sets the style of the plot.).45 E F1
-(color_mode)164 506.4 Q F0 2.5(=1)2.5 G 2.5(:C)-2.5 G(olor/gray \214ll.)
--2.5 E F1(color_mode)164 518.4 Q F0 2.5(=2)2.5 G 2.5(:C)-2.5 G
-(olor/gray \214ll shaded by)-2.5 E(synthetic illumination.)204 530.4 Q
-F1(color_mode)164 542.4 Q F0 2.5(=3)2.5 G 2.5(:C)-2.5 G
-(olor/gray \214ll shaded by)-2.5 E(an intensity \214le. The)204 554.4 Q
-F2<ad4b>2.5 E F0(option must be used to specify)204 566.4 Q
-(the intensity \214le.)252 578.4 Q F1(color_mode)164 590.4 Q F0 2.5(=4)
-2.5 G 2.5(:C)-2.5 G(olor/gray \214ll of slope)-2.5 E(magnitude.)252
-602.4 Q F1(color_mode)164 614.4 Q F0 2.5(=5)2.5 G 2.5(:C)-2.5 G
-(olor/gray \214ll shaded by)-2.5 E(slope magnitude.)204 626.4 Q(See the)
-144 638.4 Q F2(mbgrdtiff)2.5 E F0(and)2.5 E F2(grdimage)2.5 E F0
-(manual pages for information on shading with intensity \214les)2.5 E F2
-<ad48>108 655.2 Q F0 .162(This "help" \215ag cause the program to print\
- out a description of its operation and then e)22.52 F .161(xit immedi-)
--.15 F(ately)144 667.2 Q(.)-.65 E F2<ad49>108 684 Q F1(gr)26.41 E
-(d\214le)-.37 E F0 1.298
-(Sets the name of the gridded data \214le to be plotted.)144 696 R 1.299
-(The data must be in a form acceptable to)6.298 F F2(GMT)144 708 Q F0
--.15(ve)2.57 G .07(rsion 3 programs \(see the).15 F F2(GMT)2.57 E F0 .07
-(Cookbook & T)2.57 F .07(echnical Reference\).)-.7 F(Alternati)5.07 E
--.15(ve)-.25 G(ly).15 E(,)-.65 E F1(gr)2.57 E(d\214le)-.37 E F0 .786(ma\
-y be a list of grid \214les \(one \214lename on each line\) to be plott\
-ed together)144 720 R 3.286(.T)-.55 G .786(his is useful when)-3.286 F
-(MB-System 5.0)72 768 Q(28 September 2013)131.775 E(3)190.115 E 0 Cg EP
-%%Page: 4 4
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mbm_grdtif)72 48 Q 137.31(f\(1\) MB-System)-.25
-F 137.31(5.0 mbm_grdtif)2.5 F(f\(1\))-.25 E(data from a re)144 84 Q
-(gion is brok)-.15 E(en up into se)-.1 E -.15(ve)-.25 G
-(ral grid \214les rather than a single v).15 E(ery lar)-.15 E
-(ge grid \214le.)-.18 E/F1 10/Times-Bold at 0 SF<ad4b>108 100.8 Q/F2 10
-/Times-Italic at 0 SF(intensity_\214le)22.52 E F0 .37
-(Sets the name of the gridded data \214le containing instensity v)144
-112.8 R .37(alues to be used for shading the map.)-.25 F(Alternati)144
-124.8 Q -.15(ve)-.25 G(ly).15 E(,)-.65 E F2(gr)2.703 E(d\214le)-.37 E F0
-.204(may be a list of grid \214les \(one \214lename on each line\) to b\
-e used together)2.703 F 2.704(.I)-.55 G 2.704(fa)-2.704 G .821(list of \
-\214les is supplied, the intensity \214les must conform in order to the\
- list of data grid \214les the)144 136.8 R(y)-.15 E(will shade.)144
-148.8 Q F1<ad4d>108 165.6 Q F0 3.055(As)20.86 G .555
-(eries of "miscellaneous" options are pro)-3.055 F .555
-(vided which are gi)-.15 F -.15(ve)-.25 G 3.055(na).15 G(s)-3.055 E F1
-<ad4d>3.055 E F0(follo)3.055 E .555(wed by a tw)-.25 F 3.055(oc)-.1 G
-(har)-3.055 E(-)-.2 E 1.329(acter identi\214er)144 177.6 R 3.829(,f)-.4
-G(ollo)-3.829 E 1.329(wed by an)-.25 F 3.829(yo)-.15 G 1.328
-(ther parameters associated with that option.)-3.829 F(The)6.328 E F1
-<ad4d>3.828 E F0(options)3.828 E .636(may be strung together separated \
-by colons, e.g. "-MGQ100:GU:CA200/10", which is equi)144 189.6 R -.25
-(va)-.25 G(lent).25 E(to "-MGQ \255MGU \255MCA200/10".)144 201.6 Q F1
-(\255MGD)108 218.4 Q F2(gmtdef/value)5.86 E F0(Allo)144 230.4 Q .227
-(ws the user to set the)-.25 F F1(GMT)2.727 E F0(def)2.727 E .227
-(ault v)-.1 F .227
-(alues used as the plot is constructed. This command may)-.25 F 1.133
-(be gi)144 242.4 R -.15(ve)-.25 G 3.633(nr).15 G 1.133
-(epeatedly to set as man)-3.633 F(y)-.15 E F1(GMT)3.633 E F0(def)3.633 E
-1.133(aults as required. F)-.1 F 1.133(or e)-.15 F 1.133
-(xample, to set the basemap)-.15 F(annotation font to Courier)144 254.4
-Q 2.5(,u)-.4 G(se "-MGD)-2.5 E(ANO)-.4 E(T_FONT/Courier".)-.4 E F1
-(\255MGS)108 271.2 Q F2(scalefactor)7.52 E F0 .729
-(The gridded data is multiplied by)144 283.2 R F2(scalefactor)3.229 E F0
-5.729(.T)C .729(his option is most often used \215ip the sign of the)
--5.729 F(data \()144 295.2 Q F2(scalefactor)A F0 2.5<3dad>2.5 G
-(1\). [Def)-2.5 E(ault no scaling])-.1 E F1(\255MGW)108 312 Q F0(The)144
-324 Q F1(-MGW)4.08 E F0 1.58(option causes a "w)4.08 F 1.58
-(orld" \214le to be generated parallel to the GeoT)-.1 F(if)-.35 E 4.08
-(fi)-.25 G 1.58(mage with a)-4.08 F .445(".tfw" suf)144 336 R .445
-(\214x. Some softw)-.25 F .445(are packages \(e.g. W)-.1 F .445
-(infrog\) do not recognize the coordinate information)-.4 F
-(embedded in the GeoT)144 348 Q(if)-.35 E 2.5<668c>-.25 G
-(le, and look for a w)-2.5 E(orld \214le.)-.1 E F1<ad4f>108 364.8 Q F2
--.45(ro)22.52 G(ot).45 E F0 .422(Sets the root used to construct the \
-\214lename of the output shellscript \()144 376.8 R F2 -.45(ro)C(ot).45
-E F0 .423(.cmd\) and names of \214les)B .157
-(created when the shellscript is run.)144 388.8 R .157
-(Normally the name of the input grid \214le or grid \214le list is used)
-5.157 F(as the)144 400.8 Q F2 -.45(ro)2.5 G(ot).45 E F0(.)A F1<ad51>108
-417.6 Q F0(Normally)22.52 E 3.721(,t)-.65 G 1.221
-(he output plot generation shellscript includes lines which e)-3.721 F
--.15(xe)-.15 G 1.222(cute the program).15 F F1(xv)3.722 E F0(to)3.722 E
-.273(display the TIFF image on the screen.)144 429.6 R .273
-(This option causes those lines to be commented out so that)5.273 F -.15
-(exe)144 441.6 S(cuting the shellscript produces a TIFF image b).15 E
-(ut does not attempt to display it on the screen.)-.2 E F1<ad52>108
-458.4 Q F2(west/east/south/north)23.08 E .736(west, east, south,)144
-470.4 R F0(and)3.236 E F2(north)3.236 E F0 .736(specify the Re)3.236 F
-.736(gion of interest.)-.15 F 2.336 -.8(To s)5.736 H .736
-(pecify boundaries in de).8 F .736(grees and)-.15 F 1.162
-(minutes [and seconds], use the dd:mm[:ss] format.)144 482.4 R(Append)
-6.161 E F1(r)3.661 E F0 1.161(if lo)3.661 F 1.161
-(wer left and upper right map)-.25 F .208(coordinates are gi)144 494.4 R
--.15(ve)-.25 G 2.708(ni).15 G .208(nstead of wesn.)-2.708 F -1.1(Yo)
-5.208 G 2.708(um)1.1 G .208(ay ask for a lar)-2.708 F(ger)-.18 E F2
-(w/e/s/n)2.708 E F0(re)2.708 E .209(gion to ha)-.15 F .509 -.15(ve m)-.2
-H .209(ore room).15 F .199(between the image and the ax)144 506.4 R
-2.699(es. A)-.15 F .199(smaller re)2.699 F .199
-(gion than speci\214ed in the grd\214le will result in a sub-)-.15 F
-(set of the grid [Def)144 518.4 Q(ault is re)-.1 E(gion gi)-.15 E -.15
-(ve)-.25 G 2.5(nb).15 G 2.5(yt)-2.5 G(he grd\214le].)-2.5 E F1<ad53>108
-535.2 Q F2([color/shade])24.74 E F0 1.392(This option enables ef)144
-547.2 R(fecti)-.25 E 1.692 -.15(ve h)-.25 H 1.392
-(istogram equalization of the color and/or shading of the gridded).15 F
-.628(data. The equalization is not achie)144 559.2 R -.15(ve)-.25 G
-3.128(db).15 G 3.128(yc)-3.128 G .628(hanging the data v)-3.128 F .628
-(alues, b)-.25 F .628(ut rather by constructing the)-.2 F .518(color or\
- shading tables so that the boundaries in the tables encompass equal fr\
-actions of the data-)144 571.2 R .19(points. This serv)144 583.2 R .19
-(es to focus color or shading contrasts in v)-.15 F .19
-(alue ranges corresponding to the b)-.25 F .19(ulk of)-.2 F .837
-(the data v)144 595.2 R 3.338(alues. If)-.25 F F1<ad53>3.338 E F0 .838
-(is gi)3.338 F -.15(ve)-.25 G 3.338(na).15 G .838(lone or with)-3.338 F
-F2(color)3.338 E F0 3.338(=1)3.338 G 3.338(,i)-3.338 G 3.338(te)-3.338 G
-.838(nables equalization of the color table)-3.338 F .991
-(used for color or gray \214ll plots,)144 607.2 R .991
-(shaded or unshaded. If the plot is to be shaded,)5.991 F .991
-(either by syn-)5.991 F .637(thetic illumination \()144 619.2 R F1<ad47>
-A F2(2)A F0 3.137(\)o)C 3.137(ru)-3.137 G .637
-(sing an intensity \214le \()-3.137 F F1<ad4b>A F0(and)3.138 E F1<ad47>
-3.138 E F2(3)A F0 .638(options\), then setting)3.138 F F2(shade)3.138 E
-F0 3.138(=1)3.138 G .5(will cause the shading to be equalized.)144 631.2
-R(Using)5.5 E F1<ad53>3 E F2(0/1)A F0 .5
-(will equalize the shading without equalizing)3 F(the color table.)144
-643.2 Q F1<ad56>108 660 Q F0(Causes)23.08 E F1(mbm_grdtiff)2.775 E F0
-.275(to operate in "v)2.775 F .276
-(erbose" mode so that it outputs more information than usual.)-.15 F F1
-<ad57>108 676.8 Q F2([color_style)20.3 E F0([)A F2(/palette)A F0([)A F2
-(ncolor)A(s)-.1 E F0(]] | cpt\214le])A
-(This option controls the color scheme used for color \214ll plots.)144
-688.8 Q(If)144 712.8 Q F2(color_style)3.136 E F0 3.136(=1[)3.136 G(def)
--3.136 E .636(ault], then the color scheme used will be a continuous gr\
-ading of colors. If)-.1 F F2(color_style)144 724.8 Q F0 2.815(=2)2.815 G
-2.815(,t)-2.815 G .315
-(he color scheme will be a set of discrete color interv)-2.815 F .316
-(als. The color palette used is)-.25 F(MB-System 5.0)72 768 Q
-(28 September 2013)131.775 E(4)190.115 E 0 Cg EP
-%%Page: 5 5
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mbm_grdtif)72 48 Q 137.31(f\(1\) MB-System)-.25
-F 137.31(5.0 mbm_grdtif)2.5 F(f\(1\))-.25 E(set using)144 84 Q/F1 10
-/Times-Italic at 0 SF(palette)2.5 E F0 2.5(.S)C -2.15 -.25(ev e)-2.5 H 2.5
-(np).25 G(alettes are a)-2.5 E -.25(va)-.2 G(ilable:).25 E F1(palette)
-180 96 Q F0 2.5(=1)2.5 G 26.36(:H)-2.5 G(axby colors [def)-26.36 E
-(ault])-.1 E F1(palette)180 108 Q F0 2.5(=2)2.5 G 26.36(:h)-2.5 G
-(igh Intensity colors)-26.36 E F1(palette)180 120 Q F0 2.5(=3)2.5 G
-26.36(:l)-2.5 G .5 -.25(ow I)-26.36 H(ntensity colors).25 E F1(palette)
-180 132 Q F0 2.5(=4)2.5 G 26.36(:g)-2.5 G(rayscale)-26.36 E F1(palette)
-180 144 Q F0 2.5(=5)2.5 G 26.36(:u)-2.5 G(niform grayscale)-26.36 E F1
-(palette)180 156 Q F0 2.5(=6)2.5 G 26.36(:u)-2.5 G(niform black)-26.36 E
-F1(palette)180 168 Q F0 2.5(=7)2.5 G 26.36(:u)-2.5 G(niform white)-26.36
-E(The RGB de\214nitions of the color palettes are:)144 192 Q
-(color palette 1 \255 Haxby Color T)144 216 Q(able)-.8 E 5(red: 255)149
-228 R(255 255 255 240 205 138 106)2.5 E 2.5(50 40 37)5 F
-(green: 255 186 161 189 236 255 236 235 190 127)149 240 Q(57)5 E 2.5
-(blue: 255)149 252 R 2.5(133 68 87)2.5 F(121 162 174 255 255 251 175)2.5
-E(color palette 2 \255 High Intensity Colors)144 276 Q 5(red: 255)149
-288 R(255 255 255 128)2.5 E 7.5(0000)7.5 G(128 255)-5 E 5(green: 0)149
-300 R(64 128 255 255 255 255 128)5 E 7.5(000)7.5 G 7.5(blue: 0)149 312 R
-7.5(00000)7.5 G(255 255 255 255 255)-5 E(color palette 3 \255 Lo)144 336
-Q 2.5(wI)-.25 G(ntensity Colors)-2.5 E 5(red: 200)149 348 R(194 179 141)
-2.5 E 5(90 0 0 0 0)5 F(90 141)5 E 5(green: 0)149 360 R 2.5(49 90)5 F
-(141 179 200 141)2.5 E 5(90 0 0 0)5 F 7.5(blue: 0)149 372 R 7.5(00000)
-7.5 G(141 179 200 179 141)-5 E(color palette 4 \255 Grayscale)144 396 Q
-5(red: 255)149 408 R(230 204 179 153 128 102)2.5 E 2.5(77 51 26)5 F(0)
-7.5 E(green: 255 230 204 179 153 128 102)149 420 Q 2.5(77 51 26)5 F(0)
-7.5 E 2.5(blue: 255)149 432 R(230 204 179 153 128 102)2.5 E 2.5
-(77 51 26)5 F(0)7.5 E(color palette 5 \255 Uniform Grayscale)144 456 Q 5
-(red: 128)149 468 R(128 128 128 128 128 128 128 128 128 128)2.5 E
-(green: 128 128 128 128 128 128 128 128 128 128 128)149 480 Q 2.5
-(blue: 128)149 492 R(128 128 128 128 128 128 128 128 128 128)2.5 E
-(color palette 6 \255 Uniform Black)144 516 Q 10(red: 0)149 528 R 7.5
-(0000000000)7.5 G 5(green: 0 0 0 0 0 0 0 0 0 0 0)149 540 R 7.5(blue: 0)
-149 552 R 7.5(0000000000)7.5 G(color palette 7 \255 Uniform White)144
-576 Q 5(red: 255)149 588 R(255 255 255 255 255 255 255 255 255 255)2.5 E
-(green: 255 255 255 255 255 255 255 255 255 255 255)149 600 Q 2.5
-(blue: 255)149 612 R(255 255 255 255 255 255 255 255 255 255)2.5 E .366
-(The Haxby colors ha)144 636 R .666 -.15(ve b)-.2 H .366
-(een adapted from a palette de).15 F -.15(ve)-.25 G .366(loped by Dr).15
-F 2.865(.W)-.55 G .365(illiam Haxby of the Lam-)-3.265 F .319
-(ont-Doherty Earth Observ)144 648 R .319
-(atory; this palette is pleasing to the e)-.25 F .32
-(ye and well suited for shading. The)-.15 F .309(high intensity colors \
-describe linear paths through RGB space from red to blue to green to pu\
-rple;)144 660 R .437(because the colors are high intensity the)144 672 R
-2.937(ya)-.15 G .438(re not well suited to shading.)-2.937 F .438
-(The lo)5.438 F 2.938(wi)-.25 G .438(ntensity colors)-2.938 F .517
-(are similar to the high intensity)144 684 R 3.017(,b)-.65 G .517
-(ut muted and thus well suited to shading.)-3.217 F .516
-(The grayscale palette)5.517 F .499(runs linearly from white to black a\
-nd is commonly used for plots of sidescan and amplitude data.)144 696 R
-(The uniform grayscale is useful for non-color shaded relief plots.)144
-708 Q(MB-System 5.0)72 768 Q(28 September 2013)131.775 E(5)190.115 E 0
-Cg EP
-%%Page: 6 6
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mbm_grdtif)72 48 Q 137.31(f\(1\) MB-System)-.25
-F 137.31(5.0 mbm_grdtif)2.5 F(f\(1\))-.25 E(The)144 84 Q/F1 10
-/Times-Italic at 0 SF(ncolor)2.607 E(s)-.1 E F0 .107
-(parameter sets the number of color v)2.607 F .107
-(alues used in plotting, whether the colors are rep-)-.25 F(resented in\
- a continuous color scale or a stepped, discrete color scale [def)144 96
-Q(ault is 11].)-.1 E .522(If the option ar)144 120 R .522
-(gument is the path to an e)-.18 F(xisting)-.15 E/F2 10/Times-Bold at 0 SF
-(GMT)3.022 E F0 .523(color palette \(CPT\) \214le, then that CPT \214le)
-3.022 F(and its color scheme will be used for the plot)144 132 Q F2
-<ad58>108 148.8 Q F0(Normally)23.08 E(,)-.65 E F2(mbm_grdtiff)3.63 E F0
-1.129(creates an e)3.63 F -.15(xe)-.15 G 1.129
-(cutable shellscript and then e).15 F 3.629(xits. This)-.15 F 1.129
-(option will cause)3.629 F(the shellscript to be e)144 160.8 Q -.15(xe)
--.15 G(cuted in the background before).15 E F2(mbm_grdtiff)2.5 E F0 -.15
-(ex)2.5 G(its.).15 E F2<ad59>108 177.6 Q F0(Normally)23.08 E(,)-.65 E F2
-(mbm_grdplot)5.332 E F0 2.833
-(generates nicely rounded numbers for the boundaries of the color)5.332
-F .655(palette. Often, the resulting color bounds e)144 189.6 R .655
-(xtend well outside the range of the gridded data.)-.15 F(This)5.654 E
-.923(option causes the minimum and maximum color boundaries to e)144
-201.6 R .923(xactly conform to the minimum)-.15 F .496(and maximum v)144
-213.6 R .496(alues of the grid, or)-.25 F 2.996(,i)-.4 G 2.996(ft)-2.996
-G(he)-2.996 E F2<ad5a>2.996 E F0 .496
-(option is used, the minimum and maximum v)2.996 F(alues)-.25 E
-(speci\214ed by the user)144 225.6 Q(.)-.55 E F2<ad5a>108 242.4 Q F1
-(min/max[/mode])23.63 E F0 .786(This option o)144 254.4 R -.15(ve)-.15 G
-.786(rrides the minimum and maximum v).15 F .787
-(alues of the gridded data, af)-.25 F .787(fecting the color)-.25 F .905
-(palette and the contour interv)144 266.4 R .905
-(al if those parameters are not speci\214ed by the user)-.25 F 3.405(.B)
--.55 G 3.405(yd)-3.405 G(ef)-3.405 E .905(ault \(i.e.)-.1 F F1(mode)144
-278.4 Q F0 .528(is omitted or equal to 0\), the macro selects the color\
- palette bounds so that the)3.028 F 3.029(ye)-.15 G(ncompass)-3.029 E F1
-(min)144 290.4 Q F0(and)2.837 E F1(max)2.837 E F0 .336
-(while using nicely rounded numbers. If)2.836 F F1(mode)2.836 E F0 .336
-(is omitted or equal to 0, then the color)2.836 F .271
-(palette will end near)144 302.4 R F1(min)2.771 E F0(and)2.771 E F1(max)
-2.771 E F0 .271(whether it is linear stretched or histogram equalized.)
-2.771 F(If)5.272 E F1(mode)2.772 E F0(=)2.772 E .316
-(1, then the color stretching calculations will be done using)144 314.4
-R F1(min)2.816 E F0(and)2.815 E F1(max)2.815 E F0 2.815(,b)C .315
-(ut then the \214rst and last)-3.015 F -.25(va)144 326.4 S .776(lues in\
- the color palette will be set to the actual minimum and maximum v).25 F
-.776(alues.so that all the)-.25 F(data are displayed.)144 338.4 Q/F3
-10.95/Times-Bold at 0 SF(EXAMPLES)72 367.2 Q F0 .699(Suppose we ha)108
-379.2 R .999 -.15(ve o)-.2 H .699(btained tw).15 F 3.199(oG)-.1 G .699
-(RD \214les, one containing gridded bath)-3.199 F .698
-(ymetry \(testbath.grd\) and the other)-.05 F 1.113
-(mosaiced amplitude \(testamp.grd\).)108 391.2 R 1.113(In order to gene\
-rate a color \214ll TIFF image, we use the \255G1 option.)6.113 F .734
-(Because the data has been gridded as bath)108 403.2 R .734
-(ymetry \(positi)-.05 F 1.034 -.15(ve d)-.25 H -.25(ow).15 G .734
-(n\) rather than as topograph).25 F 3.234(y\()-.05 G(positi)-3.234 E
-1.034 -.15(ve u)-.25 H(p\),).15 E 1.114(the def)108 415.2 R 1.114
-(ault plot will ha)-.1 F 1.414 -.15(ve ")-.2 H 1.114
-(hot" colors for deep re).15 F 1.115(gions and "cold" colors for shallo)
--.15 F 3.615(wr)-.25 G -.15(eg)-3.615 G 1.115(ions; this is the).15 F
-.649(opposite of the con)108 427.2 R -.15(ve)-.4 G .649
-(ntion we usually use. In order to \214x the colors, we ha).15 F .949
--.15(ve t)-.2 H 3.149(oe).15 G .649(ither rescale the data by)-3.149 F
-1.343(multiplying the bath)108 439.2 R 1.344(ymetry by \2551 \(accompli\
-shed with \255MGS-1\), or \215ip the color palette \(accomplished)-.05 F
-(with \255D\). W)108 451.2 Q 2.5(eu)-.8 G(se the latter approach:)-2.5 E
-(mbm_grdtif)144 475.2 Q 2.5<66ad>-.25 G(Itestbath.grd \255G1 \255D \\)
--2.5 E(\255V \255Obath_\214ll)154 487.2 Q .493(In order to generate a g\
-rayscale plot of the amplitude mosaic, we use \255G1 and \255W1/4. W)108
-511.2 R 2.993(ea)-.8 G .493(lso use \255D so)-2.993 F
-(that high amplitude amplitudes are sho)108 523.2 Q(wn as dark.)-.25 E
-(mbm_grdtif)144 547.2 Q 2.5<66ad>-.25 G
-(Itestamp.grd \255G1 \255D \255W1/4 \\)-2.5 E(\255V \255Oamp_\214ll)154
-559.2 Q(No)108 583.2 Q 3.224(wc)-.25 G .724
-(onsider generating a shaded relief vie)-3.224 F 3.224(wo)-.25 G 3.224
-(ft)-3.224 G .724(he gridded bath)-3.224 F(ymetry)-.05 E 3.225(.W)-.65 G
-3.225(ec)-4.025 G .725(hoose to illuminate the ba-)-3.225 F(th)108 595.2
-Q .165(ymetry from the northeast \(azimuth of 45 de)-.05 F .165
-(grees\) and to use a shading magnitude of 0.4 \(-A0.4/45\).)-.15 F -.8
-(We)5.164 G .856(also use the \255X \215ag this so that the plot genera\
-tion shellscript is e)108 607.2 R -.15(xe)-.15 G .856(cuted immediately)
-.15 F 3.356(.H)-.65 G .857(ere is the com-)-3.356 F(mand:)108 619.2 Q
-(mbm_grdtif)144 643.2 Q 2.5<66ad>-.25 G(Itestbath.grd \\)-2.5 E
-(\255G2 \255A0.4/45 \255D \255X \255V \\)154 655.2 Q(\255Obath_shade)154
-667.2 Q(No)108 691.2 Q 2.231 -.65(w, c)-.25 H .931
-(onsider generating a plot of the bath).65 F .931(ymetry o)-.05 F -.15
-(ve)-.15 G .931(rlaid with the mosaiced amplitude.).15 F .93
-(The amplitude)5.93 F -.15(ove)108 703.2 S .487
-(rlay is speci\214ed using the \255K option.).15 F 2.087 -.8(We w)5.487
-H .487(ant the colors for the bath).7 F .488
-(ymetry to be chosen without his-)-.05 F .651(togram equalization, b)108
-715.2 R .651(ut we also w)-.2 F .65(ant histogram equalization to be ap\
-plied to the amplitude data used for)-.1 F 1.11(shading. T)108 727.2 R
-3.61(od)-.8 G 3.61(ot)-3.61 G 1.11(his, we use \255S0/1, where the \214\
-rst number \(0\) speci\214es no histogram equalization of the)-3.61 F
-(MB-System 5.0)72 768 Q(28 September 2013)131.775 E(6)190.115 E 0 Cg EP
-%%Page: 7 7
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mbm_grdtif)72 48 Q 137.31(f\(1\) MB-System)-.25
-F 137.31(5.0 mbm_grdtif)2.5 F(f\(1\))-.25 E .894(color scale and the se\
-cond number \(1\) causes histogram equalization of the shading amplitud\
-e data to be)108 84 R .057(implemented. In order to maintain the con)108
-96 R -.15(ve)-.4 G .058
-(ntion that high amplitude amplitudes are black, we \215ip both the).15
-F .285(color palette \(as in the pre)108 108 R .285(vious e)-.25 F .284
-(xample\) and the shading scale with \255D1/1. W)-.15 F 2.784(ec)-.8 G
-.284(ould also \215ip the shading)-2.784 F(by specifying a ne)108 120 Q
--.05(ga)-.15 G(ti).05 E .3 -.15(ve s)-.25 H
-(hading magnitude \(-A-0.4\).).15 E(mbm_grdtif)144 144 Q 2.5<66ad>-.25 G
-(Itestbath.grd \\)-2.5 E(\255G3 \255Ktestamp.grd \\)154 156 Q
-(\255S0/1 \255D1/1 \255A0.4 \255X \255V \\)154 168 Q(\255Obath_amp)154
-180 Q(As an e)108 204 Q
-(xample, the contents of the plotting shellscript "bath_\214ll_tif)-.15
-E(f.cmd" are:)-.25 E(#! /bin/csh \255f)108 228 Q(#)108 240 Q 2.5(#S)108
-252 S(hellscript to create TIFF image of data in grd \214le)-2.5 E 2.5
-(#C)108 264 S(reated by macro mbm_grdtif)-2.5 E(f)-.25 E(#)108 276 Q 2.5
-(#T)108 288 S(his shellscript created by follo)-2.5 E
-(wing command line:)-.25 E 2.5(#m)108 300 S(bm_grdtif)-2.5 E 2.5<66ad>
--.25 G(Itestbath.grd \255G1 \255D \255V \255Obath_\214ll)-2.5 E(#)108
-312 Q 2.5(#D)108 324 S(e\214ne shell v)-2.5 E
-(ariables used in this script:)-.25 E(set TIFF_FILE)108 336 Q 2.5(=b)
-17.5 G(ath_\214ll.tif)-2.5 E(set CPT_FILE)108 348 Q 2.5(=b)20 G
-(ath_\214ll.cpt)-2.5 E(set MAP_REGION)108 360 Q 2.5<3dad>15 G
-(49.28/-49.13/12.05/12.2)-2.5 E(#)108 372 Q 2.5(#S)108 384 S -2.25 -.2
-(av e)-2.5 H -.15(ex)2.7 G(isting GMT def).15 E(aults)-.1 E(echo Sa)108
-396 Q(ving GMT def)-.2 E(aults...)-.1 E(gmtdef)108 408 Q
-(aults \255L > gmtdef)-.1 E(aults$$)-.1 E(#)108 420 Q 2.5(#S)108 432 S
-(et ne)-2.5 E 2.5(wG)-.25 G(MT def)-2.5 E(aults)-.1 E(echo Setting ne)
-108 444 Q 2.5(wG)-.25 G(MT def)-2.5 E(aults...)-.1 E(gmtset COLOR_B)108
-456 Q -.4(AC)-.35 G(KGR).4 E(OUND 0/0/0)-.4 E(gmtset COLOR_FOREGR)108
-468 Q(OUND 255/255/255)-.4 E(gmtset COLOR_N)108 480 Q(AN 255/255/255)
--.35 E(gmtset DEGREE_FORMA)108 492 Q 2.5(T3)-1.11 G(#)108 504 Q 2.5(#M)
-108 516 S(ak)-2.5 E 2.5(ec)-.1 G(olor palette table \214le)-2.5 E
-(echo Making color palette table \214le...)108 528 Q 2.5(echo \2555250)
-108 540 R(255 255 255)2.5 E(\2555100 255 186 133 > $CPT_FILE)5 E 2.5
-(echo \2555100)108 552 R(255 186 133)2.5 E(\2554950 255 161)5 E
-(68 >> $CPT_FILE)5 E 2.5(echo \2554950)108 564 R(255 161)2.5 E 2.5
-(68 \2554800)5 F(255 189)2.5 E(87 >> $CPT_FILE)5 E 2.5(echo \2554800)108
-576 R(255 189)2.5 E 2.5(87 \2554650)5 F(240 236 121 >> $CPT_FILE)2.5 E
-2.5(echo \2554650)108 588 R(240 236 121)2.5 E
-(\2554500 205 255 162 >> $CPT_FILE)5 E 2.5(echo \2554500)108 600 R
-(205 255 162)2.5 E(\2554350 138 236 174 >> $CPT_FILE)5 E 2.5
-(echo \2554350)108 612 R(138 236 174)2.5 E
-(\2554200 106 235 255 >> $CPT_FILE)5 E 2.5(echo \2554200)108 624 R
-(106 235 255)2.5 E 2.5(\2554050 50)5 F(190 255 >> $CPT_FILE)2.5 E 2.5
-(echo \2554050 50)108 636 R(190 255)2.5 E 2.5(\2553900 40)5 F
-(127 251 >> $CPT_FILE)2.5 E 2.5(echo \2553900 40)108 648 R(127 251)2.5 E
-2.5(\2553750 37 57)5 F(175 >> $CPT_FILE)2.5 E(#)108 660 Q 2.5(#D)108 672
-S(e\214ne data \214les to be plotted:)-2.5 E(set D)108 684 Q -1.21 -1.11
-(AT A)-.4 H 17.5(_FILE =)1.11 F(testbath.grd)2.5 E(set INTENSITY_FILE)
-108 696 Q(=)7.5 E(#)108 708 Q 2.5(#M)108 720 S(ak)-2.5 E 2.5(et)-.1 G
-(if)-2.5 E 2.5(fi)-.25 G(mage)-2.5 E(MB-System 5.0)72 768 Q
-(28 September 2013)131.775 E(7)190.115 E 0 Cg EP
-%%Page: 8 8
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mbm_grdtif)72 48 Q 137.31(f\(1\) MB-System)-.25
-F 137.31(5.0 mbm_grdtif)2.5 F(f\(1\))-.25 E(echo Running mbgrdtif)108 84
-Q(f...)-.25 E(mbgrdtif)108 96 Q 2.5<66ad>-.25 G 2.5(I$)-2.5 G -.4(DA)
--2.5 G -.93(TA)-.71 G(_FILE .br).93 E(-O $TIFF_FILE .br)38.5 E
-(-C $CPT_FILE .br)38.5 E(-V)38.5 E(#)108 108 Q 2.5(#D)108 120 S
-(elete surplus \214les)-2.5 E(echo Deleting surplus \214les...)108 132 Q
-(/bin/rm \255f $CPT_FILE)108 144 Q(#)108 156 Q 2.5(#R)108 168 S
-(eset GMT def)-2.5 E(ault fonts)-.1 E(echo Resetting GMT fonts...)108
-180 Q(/bin/mv gmtdef)108 192 Q(aults$$ .gmtdef)-.1 E(aults)-.1 E(#)108
-204 Q 2.5(#R)108 216 S(un xv)-2.5 E(echo Running xv in background...)108
-228 Q(xv bath_\214ll.tif &)108 240 Q(#)108 252 Q 2.5(#A)108 264 S
-(ll done!)-2.5 E(echo All done!)108 276 Q/F1 10.95/Times-Bold at 0 SF
-(SEE ALSO)72 304.8 Q/F2 10/Times-Bold at 0 SF(mbsystem)108 316.8 Q F0
-(\(1\),)A F2(mbm_grdplot)6.873 E F0(\(1\),)A F2(mbgrid)6.873 E F0
-(\(1\),)A F2(mbmosaic)6.873 E F0(\(1\),)A F2(mbm_grid)6.873 E F0(\(1\),)
-A F2(mbgrdtiff)6.874 E F0(\(1\),)A F2(gmt)6.874 E F0(\(1\)\(1\),)A F2
-(grdimage)108 328.8 Q F0(\(1\))A F1 -.11(BU)72 357.6 S(GS).11 E F0
-(This macro either has too man)108 369.6 Q 2.5(yo)-.15 G
-(ptions, or not enough options. Y)-2.5 E(ou choose.)-1.1 E
-(MB-System 5.0)72 768 Q(28 September 2013)131.775 E(8)190.115 E 0 Cg EP
-%%Trailer
-end
-%%EOF
diff --git a/src/ps/mbm_grid.ps b/src/ps/mbm_grid.ps
deleted file mode 100644
index 34c2c1a..0000000
--- a/src/ps/mbm_grid.ps
+++ /dev/null
@@ -1,796 +0,0 @@
-%!PS-Adobe-3.0
-%%Creator: groff version 1.19.2
-%%CreationDate: Wed Jul  1 12:29:28 2015
-%%DocumentNeededResources: font Times-Roman
-%%+ font Times-Bold
-%%+ font Times-Italic
-%%DocumentSuppliedResources: procset grops 1.19 2
-%%Pages: 6
-%%PageOrder: Ascend
-%%DocumentMedia: Default 612 792 0 () ()
-%%Orientation: Portrait
-%%EndComments
-%%BeginDefaults
-%%PageMedia: Default
-%%EndDefaults
-%%BeginProlog
-%%BeginResource: procset grops 1.19 2
-%!PS-Adobe-3.0 Resource-ProcSet
-/setpacking where{
-pop
-currentpacking
-true setpacking
-}if
-/grops 120 dict dup begin
-/SC 32 def
-/A/show load def
-/B{0 SC 3 -1 roll widthshow}bind def
-/C{0 exch ashow}bind def
-/D{0 exch 0 SC 5 2 roll awidthshow}bind def
-/E{0 rmoveto show}bind def
-/F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def
-/G{0 rmoveto 0 exch ashow}bind def
-/H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/I{0 exch rmoveto show}bind def
-/J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def
-/K{0 exch rmoveto 0 exch ashow}bind def
-/L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/M{rmoveto show}bind def
-/N{rmoveto 0 SC 3 -1 roll widthshow}bind def
-/O{rmoveto 0 exch ashow}bind def
-/P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/Q{moveto show}bind def
-/R{moveto 0 SC 3 -1 roll widthshow}bind def
-/S{moveto 0 exch ashow}bind def
-/T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/SF{
-findfont exch
-[exch dup 0 exch 0 exch neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/MF{
-findfont
-[5 2 roll
-0 3 1 roll
-neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/level0 0 def
-/RES 0 def
-/PL 0 def
-/LS 0 def
-/MANUAL{
-statusdict begin/manualfeed true store end
-}bind def
-/PLG{
-gsave newpath clippath pathbbox grestore
-exch pop add exch pop
-}bind def
-/BP{
-/level0 save def
-1 setlinecap
-1 setlinejoin
-72 RES div dup scale
-LS{
-90 rotate
-}{
-0 PL translate
-}ifelse
-1 -1 scale
-}bind def
-/EP{
-level0 restore
-showpage
-}def
-/DA{
-newpath arcn stroke
-}bind def
-/SN{
-transform
-.25 sub exch .25 sub exch
-round .25 add exch round .25 add exch
-itransform
-}bind def
-/DL{
-SN
-moveto
-SN
-lineto stroke
-}bind def
-/DC{
-newpath 0 360 arc closepath
-}bind def
-/TM matrix def
-/DE{
-TM currentmatrix pop
-translate scale newpath 0 0 .5 0 360 arc closepath
-TM setmatrix
-}bind def
-/RC/rcurveto load def
-/RL/rlineto load def
-/ST/stroke load def
-/MT/moveto load def
-/CL/closepath load def
-/Fr{
-setrgbcolor fill
-}bind def
-/setcmykcolor where{
-pop
-/Fk{
-setcmykcolor fill
-}bind def
-}if
-/Fg{
-setgray fill
-}bind def
-/FL/fill load def
-/LW/setlinewidth load def
-/Cr/setrgbcolor load def
-/setcmykcolor where{
-pop
-/Ck/setcmykcolor load def
-}if
-/Cg/setgray load def
-/RE{
-findfont
-dup maxlength 1 index/FontName known not{1 add}if dict begin
-{
-1 index/FID ne{def}{pop pop}ifelse
-}forall
-/Encoding exch def
-dup/FontName exch def
-currentdict end definefont pop
-}bind def
-/DEFS 0 def
-/EBEGIN{
-moveto
-DEFS begin
-}bind def
-/EEND/end load def
-/CNT 0 def
-/level1 0 def
-/PBEGIN{
-/level1 save def
-translate
-div 3 1 roll div exch scale
-neg exch neg exch translate
-0 setgray
-0 setlinecap
-1 setlinewidth
-0 setlinejoin
-10 setmiterlimit
-[]0 setdash
-/setstrokeadjust where{
-pop
-false setstrokeadjust
-}if
-/setoverprint where{
-pop
-false setoverprint
-}if
-newpath
-/CNT countdictstack def
-userdict begin
-/showpage{}def
-/setpagedevice{}def
-}bind def
-/PEND{
-countdictstack CNT sub{end}repeat
-level1 restore
-}bind def
-end def
-/setpacking where{
-pop
-setpacking
-}if
-%%EndResource
-%%EndProlog
-%%BeginSetup
-%%BeginFeature: *PageSize Default
-<< /PageSize [ 612 792 ] /ImagingBBox null >> setpagedevice
-%%EndFeature
-%%IncludeResource: font Times-Roman
-%%IncludeResource: font Times-Bold
-%%IncludeResource: font Times-Italic
-grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72
-def/PL 792 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron/Zcaron
-/scaron/zcaron/Ydieresis/trademark/quotesingle/Euro/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/space/exclam/quotedbl/numbersign/dollar/percent
-/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen
-/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon
-/semicolon/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O
-/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright/circumflex
-/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y
-/z/braceleft/bar/braceright/tilde/.notdef/quotesinglbase/guillemotleft
-/guillemotright/bullet/florin/fraction/perthousand/dagger/daggerdbl
-/endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut
-/dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash
-/quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen
-/brokenbar/section/dieresis/copyright/ordfeminine/guilsinglleft
-/logicalnot/minus/registered/macron/degree/plusminus/twosuperior
-/threesuperior/acute/mu/paragraph/periodcentered/cedilla/onesuperior
-/ordmasculine/guilsinglright/onequarter/onehalf/threequarters
-/questiondown/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE
-/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex
-/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis
-/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn
-/germandbls/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla
-/egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis
-/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide/oslash
-/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis]def
-/Times-Italic at 0 ENC0/Times-Italic RE/Times-Bold at 0 ENC0/Times-Bold RE
-/Times-Roman at 0 ENC0/Times-Roman RE
-%%EndSetup
-%%Page: 1 1
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 146.5(mbm_grid\(1\) MB-System)72 48 R 146.5
-(5.0 mbm_grid\(1\))2.5 F/F1 10.95/Times-Bold at 0 SF -.219(NA)72 84 S(ME)
-.219 E/F2 10/Times-Bold at 0 SF(mbm_grid)108 96 Q F0 3.823<ad43>3.823 G
-1.322(reate an e)-3.823 F -.15(xe)-.15 G 1.322
-(cutable shellscript which will generate a grid \(bath).15 F 1.322
-(ymetry or topograph)-.05 F 1.322(y\) or)-.05 F
-(mosaic \(amplitude or sidescan\) of sw)108 108 Q(ath sonar sw)-.1 E
-(ath data.)-.1 E F1(VERSION)72 136.8 Q F0 -1.11(Ve)108 148.8 S
-(rsion 5.0)1.11 E F1(SYNOPSIS)72 177.6 Q F0(mbm_grid)108 189.6 Q F2
-<ad49>3.68 E/F3 10/Times-Italic at 0 SF(\214le)A F2<ad46>3.68 E F3(format)A
-F2<ad4f>3.68 E F3 -.45(ro)C(ot).45 E F2<ad52>3.68 E F3
-(west/east/south/north)A F0([)3.68 E F2<ad41>A F3(datatype)A F2<ad42>
-3.68 E F3(bor)A(der)-.37 E F2<ad43>3.68 E F3(clip)A F2<ad44>3.68 E F3
-(xdim/ydim)A F2<ad45>108 201.6 Q F3(dx/dy/units)A F0({)2.698 E F2<ad66>A
-F3(priority_r)A(ang)-.15 E(e)-.1 E F0(|)2.698 E F2<ad66>2.698 E F3(mode)
-A F0(})A F2<ad47>2.698 E F3(gridkind)A F2 .198<ad4820ad4a>2.698 F F3(pr)
-A(ojection)-.45 E F2<ad4b>2.698 E F3(bac)A(kgr)-.2 E(ound)-.45 E F2
-<ad4c>2.698 E F3(lon\215ip)A F2 .198<ad4d20ad4e>2.698 F<ad50>108 213.6 Q
-F3(pings)A F2<ad53>2.5 E F3(speed)A F2<ad54>2.5 E F3(tension)A F2<ad55>
-2.5 E F3({azimuth/factor | time})A F2<ad5620ad57>2.5 E F3(scale)A F2
-<ad58>2.5 E F3 -.2(ex)C(tend).2 E F2<ad59>2.5 E F3(priority_\214le)A F2
-<ad5a>2.5 E F3(bathdef)A F2(])A F1(DESCRIPTION)72 242.4 Q F2(mbm_grid)
-108 254.4 Q F0 .435(is a macro to generate a shellscript of MB-System c\
-ommands which, when e)2.935 F -.15(xe)-.15 G .436(cuted, will gen-).15 F
-.227(erate a grid or mosaic of the speci\214ed sw)108 266.4 R .226
-(ath sonar data. The grid or mosaic may be of bath)-.1 F .226
-(ymetry \(positi)-.05 F -.15(ve)-.25 G(do)108 278.4 Q(wn,)-.25 E F2
-<ad41>3.445 E F3(1)A F0 .945(\), topograph)B 3.445(y\()-.05 G(positi)
--3.445 E 1.245 -.15(ve u)-.25 H(p,).15 E F2<ad41>3.445 E F3(2)A F0 .945
-(\), amplitude \()B F2<ad41>A F3(3)A F0 .945(\), or sidescan data \()B
-F2<ad41>A F3(4)A F0 3.445(\). The)B .945(primary pur)3.445 F(-)-.2 E
-.188(pose of this macro is to allo)108 290.4 R 2.688(wt)-.25 G .188
-(he simple, semi-automated production of grids and mosaics with a fe)
--2.688 F 2.687(wc)-.25 G(om-)-2.687 E .349(mand line ar)108 302.4 R .349
-(guments. The macro can determine the area co)-.18 F -.15(ve)-.15 G .35
-(red by the sw).15 F .35(ath data and set the grid bounds)-.1 F .901
-(and dimensions accordingly)108 314.4 R 3.401(.F)-.65 G .901
-(or users seeking more control o)-3.551 F -.15(ve)-.15 G 3.401(rt).15 G
-.9(he grid and mosaic parameters, almost)-3.401 F 1.1
-(the full suite of mbgrid and mbmosaic commands are supported.)108 326.4
-R 1.101(See the manual pages for)6.101 F F2(mbgrid)3.601 E F0(and)3.601
-E F2(mbmosaic)108 338.4 Q F0(for complete e)2.5 E(xplanations of ho)-.15
-E 2.5(wt)-.25 G(hese programs w)-2.5 E(ork.)-.1 E 1.768(By def)108 362.4
-R(ault,)-.1 E F2(mbgrid)4.268 E F0(and)4.268 E F2(mbmosaic)4.268 E F0
-1.768
-(generate grids in Geographic coordinates, meaning that position is)
-4.268 F .34(de\214ned in longitude and latitude using the WGS84 horizon\
-tal datum. The)108 374.4 R F2<ad4a>2.84 E F0 .34
-(option can be used to specify)2.84 F .7(an alternate, projected coordi\
-nate system \(PCS\). When a PCS is used, position will be de\214ned in \
-eastings)108 386.4 R 1.262(and northings \(meters\) relati)108 398.4 R
-1.562 -.15(ve t)-.25 H 3.762(ot).15 G 1.262
-(he origin of the particular PCS. Uni)-3.762 F -.15(ve)-.25 G 1.262
-(rsal T).15 F(ransv)-.35 E 1.262(erse Mercator is the)-.15 F .574
-(most commonly used PCS in the oceanographic community)108 410.4 R 3.074
-(,b)-.65 G(ut)-3.274 E F2(mbgrid)3.074 E F0 .574(supports a lar)3.074 F
-.574(ge number of other)-.18 F 1.02
-(PCS as well. A list of the supported PCS')108 422.4 R 3.52(si)-.55 G
-3.52(sp)-3.52 G(ro)-3.52 E 1.02(vided at the end of the)-.15 F F2
-(mbgrid)3.52 E F0(and)3.52 E F2(mbmosaic)3.52 E F0(manual)3.52 E(pages.)
-108 434.4 Q F1 -.548(AU)72 463.2 S(THORSHIP).548 E F0(Da)108 475.2 Q
-(vid W)-.2 E 2.5(.C)-.92 G(aress \(caress at mbari.or)-2.5 E(g\))-.18 E
-(Montere)113 487.2 Q 2.5(yB)-.15 G(ay Aquarium Research Institute)-2.5 E
-(Dale N. Chayes \(dale at ldeo.columbia.edu\))108 499.2 Q
-(Lamont-Doherty Earth Observ)113 511.2 Q(atory)-.25 E F1(OPTIONS)72 540
-Q F2<ad41>108 552 Q F3(datatype)23.08 E F0 .289
-(Sets the type of data to be read and gridded or mosaiced.)144 564 R(If)
-5.288 E F3(datatype)2.788 E F0 2.788(=1)2.788 G 2.788(,b)-2.788 G(ath)
--2.788 E .288(ymetry data will be)-.05 F 1.422(gridded \(positi)144 576
-R 1.722 -.15(ve d)-.25 H -.25(ow).15 G(nw).25 E 3.922(ards\). If)-.1 F
-F3(datatype)3.922 E F0 3.922(=2)3.922 G 3.922(,b)-3.922 G(ath)-3.922 E
-1.423(ymetry data will be gridded as topograph)-.05 F(y)-.05 E(\(positi)
-144 588 Q 1.3 -.15(ve u)-.25 H(pw).15 E 3.5(ards\). If)-.1 F F3
-(datatype)3.5 E F0 3.5(=3)3.5 G 3.5(,a)-3.5 G 1
-(mplitude data will be mosaiced.)-3.5 F(If)6 E F3(datatype)3.5 E F0 3.5
-(=4)3.5 G 3.5(,s)-3.5 G(idescan)-3.5 E(data will be mosaiced.)144 600 Q
-(Def)5 E(ault:)-.1 E F3(datatype)2.5 E F0 2.5(=1\()2.5 G(bath)-2.5 E
-(ymetry\).)-.05 E F2<ad42>108 616.8 Q F3(bor)23.63 E(der)-.37 E F0 1.094
-(Sets the border of a smoothly interpolated grid to the v)144 628.8 R
-(alue)-.25 E F3(bor)3.595 E(der)-.37 E F0(where)3.595 E -.15(ve)-.25 G
-3.595(rn).15 G 3.595(od)-3.595 G 1.095(ata e)-3.595 F 1.095(xist, pro-)
--.15 F(vided)144 640.8 Q F3(bor)2.5 E(der)-.37 E F0 2.5(>0)2.5 G 2.5
-(.0. Def)-2.5 F(ault:)-.1 E F3(bor)2.5 E(der)-.37 E F0 2.5(=0)2.5 G(.0)
--2.5 E F2<ad43>108 657.6 Q F3(clip)23.08 E F0 .999
-(Sets the clipping dimension for the spline interpolation. If)144 669.6
-R F3(clip)3.498 E F0 .998(=0 no spline interpolation will be)B 2.5
-(done. If)144 681.6 R F3(clip)2.5 E F0(>0)A F2<ad4b>108 698.4 Q F3(bac)
-22.52 E(kgr)-.2 E(ound)-.45 E F0 .289
-(Enables \214lling in all unde\214ned grid cells with bath)144 710.4 R
-.289(ymetry or topograph)-.05 F 2.79(yf)-.05 G .29(rom a global or re)
--2.79 F(gional)-.15 E 1.774(database accessed with the)144 722.4 R F2
-(GMT)4.274 E F0(program)4.274 E F2(grdraster)4.274 E F0 4.274(.T)C(he)
--4.274 E F3(bac)4.273 E(kgr)-.2 E(ound)-.45 E F0 1.773
-(speci\214es which locally)4.273 F(MB-System 5.0)72 768 Q 2.5(3J)146.495
-G(une 2013)-2.5 E(1)204.835 E 0 Cg EP
-%%Page: 2 2
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 146.5(mbm_grid\(1\) MB-System)72 48 R 146.5
-(5.0 mbm_grid\(1\))2.5 F(de\214ned database is accessed with)144 84 Q/F1
-10/Times-Bold at 0 SF(grdraster)2.5 E F0(.)A 2.254
-(then the spline interpolation will \214ll data g)146.5 96 R 2.254
-(aps to a distance of)-.05 F/F2 10/Times-Italic at 0 SF(clip)4.755 E F0
-2.255(times the grid spacing.)4.755 F(Def)144 108 Q(ault:)-.1 E F2(clip)
-2.5 E F0 2.5(=0)2.5 G(.)-2.5 E F1<ad44>108 124.8 Q F2(xdim/ydim)23.08 E
-F0 1.349(Sets the dimensions of the output grid.)144 136.8 R 1.349
-(This option is superceded if the user speci\214es the grid)6.349 F
-(spacing with the)144 148.8 Q F1<ad45>2.5 E F0 2.5(option. Def)2.5 F
-(ault:)-.1 E F2(xdim)5 E F0(=)2.5 E F2(ydim)2.5 E F0 2.5(=1)2.5 G(01.)
--2.5 E F1<ad45>108 165.6 Q F2(dx/dy/units)23.63 E F0 .468
-(Sets the grid cell spacing to)144 177.6 R F2(dx)2.968 E F0 .468
-(in longitude and)2.968 F F2(dy)2.968 E F0 .468(in latitude. If)2.968 F
-F2(units)2.968 E F0 .468(is not speci\214ed, the)2.968 F F2(dx)2.968 E
-F0(and)2.968 E F2(dy)144 189.6 Q F0 -.25(va)5.22 G 2.72
-(lues are assumed to be in meters. V).25 F 2.719(alid v)-1.11 F 2.719
-(alues for)-.25 F F2(units)5.219 E F0 2.719(include "km", "meters", and)
-5.219 F("de)144 201.6 Q 3.784(grees". By)-.15 F(def)3.784 E 1.284(ault,\
- the grid spacing is calculated from the grid bounds and the grid dimen\
--)-.1 F .2(sions. When the user uses the)144 213.6 R F1<ad45>2.7 E F0 .2
-(option to set the grid spacing, the grid dimensions are calculated)2.7
-F .564(using the grid bounds and grid cell spacings. Ho)144 225.6 R(we)
--.25 E -.15(ve)-.25 G 1.365 -.4(r, s).15 H .565
-(light adjustments to the grid cell spacing).4 F -.25(va)144 237.6 S
-(lues are usually required to k).25 E
-(eep the grid bounds as speci\214ed.)-.1 E F1<ad46>108 254.4 Q F2
-(format)24.19 E F0 1.358(Sets the data format for the input data.)144
-266.4 R(If)6.358 E F2(format)3.858 E F0 3.858(<0)3.858 G 3.858(,t)-3.858
-G 1.358(hen the input \214le speci\214ed with the)-3.858 F F1<ad49>3.857
-E F0 1.163(option will actually contain a list of input sw)144 278.4 R
-1.164(ath sonar data \214les. This program uses the)-.1 F F1(MBIO)3.664
-E F0 1.292(library and will read or write an)144 290.4 R 3.792(ys)-.15 G
--.1(wa)-3.792 G 1.292(th sonar format supported by).1 F F1(MBIO)3.792 E
-F0 3.792(.A)C 1.291(list of the sw)-.001 F(ath)-.1 E .39
-(sonar data formats currently supported by)144 302.4 R F1(MBIO)2.891 E
-F0 .391(and their identi\214er v)2.891 F .391(alues is gi)-.25 F -.15
-(ve)-.25 G 2.891(ni).15 G 2.891(nt)-2.891 G(he)-2.891 E F1(MBIO)2.891 E
-F0(manual page. Def)144 314.4 Q(ault:)-.1 E F2(format)2.5 E F0 2.5<3dad>
-2.5 G(1.)-2.5 E F1<ad66>108 331.2 Q F2(mode)26.97 E F0
-(Sets the gridding algorithm to be used by)144 343.2 Q F1(mbgrid)2.5 E
-F0(for bath)2.5 E(ymetry \()-.05 E F1<ad41>A F2(1)A F0 2.5(\)o)C 2.5(rt)
--2.5 G(opograph)-2.5 E 2.5(ycd)-.05 G(ata.)-2.5 E F2(mode)180 355.2 Q F0
-2.5(=1)2.5 G 22.5(:G)-2.5 G(aussian W)-22.5 E(eighted Mean)-.8 E F2
-(mode)180 367.2 Q F0 2.5(=2)2.5 G 22.5(:M)-2.5 G(edian Filter)-22.5 E F2
-(mode)180 379.2 Q F0 2.5(=3)2.5 G 22.5(:M)-2.5 G(inimum Filter)-22.5 E
-F2(mode)180 391.2 Q F0 2.5(=4)2.5 G 22.5(:M)-2.5 G
-(aximum Filter The def)-22.5 E(ault is)-.1 E F2(mode)2.5 E F0 2.5(=1\()
-2.5 G(Gaussian W)-2.5 E(eighted Mean\).)-.8 E F1<ad66>108 408 Q F2
-(priority_r)26.97 E(ang)-.15 E(e)-.1 E F0 -.45(Tu)144 420 S .03
-(rns on Gaussian weighted mean mosaicing in).45 F F1(mbmosaic)2.53 E F0
-.03(for amplitude \()2.53 F F1<ad41>A F2(3)A F0 2.53(\)o)C 2.53(rs)-2.53
-G .03(idescan \()-2.53 F F1<ad41>A F2(4)A F0(\))A .388(data. The)144 432
-R F2(priority_r)2.888 E(ang)-.15 E(e)-.1 E F0 -.25(va)2.888 G .389
-(lue determines which data points are used in the mosaicing. The mini-)
-.25 F .531
-(mum priority threshold for each bin is the highest priority v)144 444 R
-.531(alue found among the samples in that)-.25 F 1.079(bin minus the)144
-456 R F2(priority_r)3.579 E(ang)-.15 E(e)-.1 E F0 -.25(va)3.579 G 3.579
-(lue. Only).25 F 1.079
-(samples with priorities greater than this threshold are)3.579 F 1.593
-(used in the Gaussian weighted mean mosaicing.)144 468 R 1.593(The def)
-6.593 F 1.592(ault is to simply set each bin')-.1 F 4.092(sv)-.55 G
-(alue)-4.342 E(equal to the v)144 480 Q
-(alue of the highest priority sample in that bin.)-.25 E F1<ad47>108
-496.8 Q F2(gridkind)22.52 E F0
-(Sets the format of the output grid \214le.)144 508.8 Q F2(gridkind)180
-520.8 Q F0 2.5(=1)2.5 G 19.69(:A)-2.5 G(scii table)-19.69 E F2(gridkind)
-180 532.8 Q F0 2.5(=2)2.5 G 19.69(:b)-2.5 G(inary \214le \(GMT v)-19.69
-E(ersion 1 GRD \214le\))-.15 E F2(gridkind)180 544.8 Q F0 2.5(=3)2.5 G
-19.69(:n)-2.5 G(etCDF \214le \(GMT v)-19.69 E(ersion 2 GRD \214le\))-.15
-E(If)144 556.8 Q F2(gridkind)3.323 E F0 3.323(=3)3.323 G(,)-3.323 E F1
-(mbgrid)3.323 E F0 .823(also outputs shellscripts which run GMT v)3.323
-F .824(ersion 3 programs to pro)-.15 F(vide)-.15 E 3.073(preliminary co\
-lor \214ll maps of the gridded data. These shellscripts are generated u\
-sing the)144 568.8 R F1(mbm_grdplot)144 580.8 Q F0 2.5(macro. Def)2.5 F
-(ault:)-.1 E F2(gridkind)2.5 E F0 2.5(=3)2.5 G(.)-2.5 E F1<ad48>108
-597.6 Q F0 .162(This "help" \215ag cause the program to print out a des\
-cription of its operation and then e)22.52 F .162(xit immedi-)-.15 F
-(ately)144 609.6 Q(.)-.65 E F1<ad49>108 626.4 Q F2(\214lename)26.41 E F0
-.468(Sets the input \214lename. If)144 638.4 R F2(format)2.967 E F0
-2.967(>0\()2.967 G .467(set with the)-2.967 F F1<ad66>2.967 E F0 .467
-(option\) then the sw)2.967 F .467(ath sonar data contained)-.1 F(in)144
-650.4 Q F2(in\214le)2.942 E F0 .442(is read and processed. If)2.942 F F2
-(format)2.942 E F0 2.942(<0\()2.942 G .443(the def)-2.942 F .443
-(ault\), then)-.1 F F2(in\214le)2.943 E F0 .443
-(is assumed to be an ascii \214le)2.943 F .052
-(containing a list of the input sw)144 662.4 R .052
-(ath sonar data \214les to be processed and their formats.)-.1 F .051
-(The program)5.051 F .063
-(will read the data in each one of these \214les.)144 674.4 R .063
-(In the)5.063 F F2(in\214le)2.563 E F0 .063
-(\214le, each data \214le should be follo)2.563 F .063(wed by a)-.25 F
-(data format identi\214er)144 686.4 Q 2.5(,e)-.4 G(.g.:)-2.5 E
-(data\214le1 11)180 698.4 Q(data\214le2 24)180 710.4 Q .569
-(This program uses the)144 722.4 R F1(MBIO)3.068 E F0 .568
-(library and will read or write an)3.068 F 3.068(ys)-.15 G -.1(wa)-3.068
-G .568(th sonar format supported by).1 F(MB-System 5.0)72 768 Q 2.5(3J)
-146.495 G(une 2013)-2.5 E(2)204.835 E 0 Cg EP
-%%Page: 3 3
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 146.5(mbm_grid\(1\) MB-System)72 48 R 146.5
-(5.0 mbm_grid\(1\))2.5 F/F1 10/Times-Bold at 0 SF(MBIO)144 84 Q F0 3.428
-(.Al)C .928(ist of the sw)-3.428 F .928
-(ath sonar data formats currently supported by)-.1 F F1(MBIO)3.428 E F0
-.928(and their identi\214er)3.428 F -.25(va)144 96 S(lues is gi).25 E
--.15(ve)-.25 G 2.5(ni).15 G 2.5(nt)-2.5 G(he)-2.5 E F1(MBIO)2.5 E F0
-(manual page.)2.5 E F1<ad4a>108 112.8 Q/F2 10/Times-Italic at 0 SF(pr)25.3
-E(ojection)-.45 E F0 .475(By def)2.975 F(ault,)-.1 E F1(mbgrid)2.975 E
-F0(and)2.975 E F1(mbmosaic)2.975 E F0 .474
-(generate grids in Geographic coordinates, meaning)2.975 F .548(that po\
-sition is de\214ned in longitude and latitude using the WGS84 geographi\
-c coordinate system.)144 124.8 R(The)144 136.8 Q F1<ad4a>3.803 E F0
-1.303(option can be used to specify an alternate, projected coordinate \
-system \(PCS\). When a)3.803 F .116(PCS is used, position will be de\
-\214ned in eastings and northings \(meters\) relati)144 148.8 R .416
--.15(ve t)-.25 H 2.616(ot).15 G .116(he origin of the)-2.616 F 1.347
-(particular PCS. Uni)144 160.8 R -.15(ve)-.25 G 1.346(rsal T).15 F
-(ransv)-.35 E 1.346
-(erse Mercator is the most commonly used PCS in the oceano-)-.15 F .563
-(graphic community)144 172.8 R 3.063(,b)-.65 G(ut)-3.263 E F1(mbgrid)
-3.063 E F0 .563(supports a lar)3.063 F .564(ge number of other PCS')-.18
-F 3.064(sa)-.55 G 3.064(sw)-3.064 G 3.064(ell. The)-3.064 F(underlying)
-3.064 E .628(projection functions deri)144 184.8 R .927 -.15(ve f)-.25 H
-.627(rom the).15 F F1(PR)3.127 E(OJ)-.3 E(.4)-.2 E F0 .627
-(library written by Gerald Ev)3.127 F .627(enden, then of the U.S.)-.15
-F(Geological Surv)144 196.8 Q -.15(ey)-.15 G(.)-.5 E(The)144 220.8 Q F2
-(pr)2.943 E(ojection)-.45 E F0(ar)2.943 E .443(gument for the)-.18 F F1
-<ad4a>2.943 E F0 .443
-(option can be either a PCS identi\214er from the projection de\214-)
-2.943 F .443(nition list pro)144 232.8 R .443
-(vided at the end of this manual page, or simply)-.15 F F1<ad4a>2.943 E
-F2(U)A F0 .442(to specify using UTM in what-)2.943 F -2.15 -.25(ev e)144
-244.8 T 2.5(rz).25 G
-(one is appropriate for the grid bounds speci\214ed with the)-2.5 E F1
-<ad52>2.5 E F0(option.)2.5 E -.15(Fo)144 268.8 S 3.248(ri).15 G .748
-(nstance, to fully specify a particular northern UTM zone, set)-3.248 F
-F2(pr)3.249 E(ojection)-.45 E F0 3.249(=U)3.249 G .749(TMXXN where)
--3.249 F .122(XX gi)144 280.8 R -.15(ve)-.25 G 2.622(st).15 G .122
-(he UTM zone \(de\214ned from 01 to 60\). As an e)-2.622 F .121
-(xample, a northern UTM zone 12 projec-)-.15 F 1.266
-(tion can be speci\214ed using)144 292.8 R F1<ad4a>3.766 E F2(UTM12N)A
-F0 6.266(.S)C 1.266(outhern UTM zones are speci\214ed as UTMXXS. The)
--6.266 F .617(European Petroleum Surv)144 304.8 R .917 -.15(ey G)-.15 H
-.617(roup \(EPSG\) has de\214ned a lar).15 F .617(ge number of PCS')-.18
-F 3.117(su)-.55 G .616(sed w)-3.117 F(orldwide)-.1 E .031
-(and assigned number id')144 316.8 R 2.532(st)-.55 G 2.532(oe)-2.532 G
-.032
-(ach; one can also specify the northern UTM zone 12 projection using)
--2.532 F .977(its EPSG designation, or)144 328.8 R F1<ad4a>3.477 E F2
-(epsg32612)A F0 5.977(.W)C .976
-(hen the projected coordinate system is fully speci\214ed)-5.977 F .5
-(by the)144 340.8 R F1<ad4a>3 E F0 .5
-(option, then the grid bounds may be speci\214ed using)3 F F1<ad52>3.001
-E F0 .501(in either longitude and latitude)3.001 F
-(or in eastings and northings.)144 352.8 Q(Alternati)144 376.8 Q -.15
-(ve)-.25 G(ly).15 E 3.394(,o)-.65 G .894
-(ne may indicate a UTM projection without specifying the zone by using)
--3.394 F F1<ad4a>3.393 E F2(U)A F0 3.393(.I)C(n)-3.393 E .361(this case\
-, the UTM zone will be inferred from the midpoint of the speci\214ed lo\
-ngitude and latitude)144 388.8 R 1.308
-(bounds, and then the longitude and latitude bounds gi)144 400.8 R -.15
-(ve)-.25 G 3.808(nw).15 G 1.308(ith the)-3.808 F F1(\255fR)3.808 E F0
-1.308(option are translated to)3.808 F(UTM eastings and northings.)144
-412.8 Q .922(All grids and mosaics produced by)144 436.8 R F1(MB-System)
-3.422 E F0 .923(programs contain identi\214ers that are recognized)3.423
-F 3.168(by the plotting macros)144 448.8 R F1(mbm_grdplot)5.668 E F0(,)A
-F1(mbm_grd3dplot)5.668 E F0 5.668(,a)C(nd)-5.668 E F1(mbm_grdtiff)5.668
-E F0 8.167(.T)C 3.167(hese plotting)-8.167 F .403
-(macros automatically use a linear map projection whene)144 460.8 R -.15
-(ve)-.25 G 2.903(rt).15 G(he)-2.903 E 2.903(ye)-.15 G .403
-(ncounter grids and mosaics that)-2.903 F 1.062
-(are already in a projected coordinate system. Also, the program)144
-472.8 R F1(mbgrdtiff)3.561 E F0 1.061(automatically inserts)3.561 F .786
-(the appropriate projection information into the GeoTIFF images it gene\
-rates. As a result, images)144 484.8 R .147(generated by)144 496.8 R F1
-(mbgrdtiff)2.647 E F0 .147(will be properly georeferenced when the)2.647
-F 2.647(ya)-.15 G .147(re imported into GIS softw)-2.647 F(are.)-.1 E F1
-<ad4b>108 513.6 Q F2(bac)22.52 E(kgr)-.2 E(ound)-.45 E F0(The)144 525.6
-Q F1<ad4b>3.406 E F2(bac)A(kgr)-.2 E(ound)-.45 E F0 .906
-(option is used to underlay a bath)3.406 F .906(ymetry or topograph)-.05
-F 3.406(yg)-.05 G .906(rid with a global or)-3.406 F(re)144 537.6 Q
-1.509(gional topograph)-.15 F 4.009(ym)-.05 G 1.508
-(odel. The background data model is accessed from a database using the)
--4.009 F F1(GMT)144 549.6 Q F0 1.497(program grdraster)3.996 F 6.497(.T)
--.55 G(he)-6.497 E F2(bac)3.997 E(kgr)-.2 E(ound)-.45 E F0 -.25(va)3.997
-G 1.497(lue is an identi\214er number used to specify which).25 F 1.032
-(dataset to e)144 561.6 R 1.032(xtract using)-.15 F F1(grdraster)3.532 E
-F0 3.532(.T)C 1.031(hese identi\214ers are user de\214ned and v)-3.532 F
-1.031(ary with installations.)-.25 F .548(When the)144 573.6 R F1<ad4b>
-3.048 E F2(bac)A(kgr)-.2 E(ound)-.45 E F0 .548(option is in)3.048 F -.2
-(vo)-.4 G -.1(ke).2 G(d,).1 E F1(grdraster)3.049 E F0 .549(is used to e)
-3.049 F .549(xtract all of the longitude, lati-)-.15 F 1.01
-(tude, and topograph)144 585.6 R 3.51(yv)-.05 G 1.009(alues within the \
-speci\214ed database that lie within the desired grid. These)-3.76 F
--.25(va)144 597.6 S 1.144(lues are interpolated onto the desired grid l\
-ocations using the thin plate spline algorithm, and).25 F 1.122
-(then mapped onto the grid where)144 609.6 R -.15(ve)-.25 G 3.621(rt).15
-G 1.121(he v)-3.621 F 1.121(alues are unde\214ned by either sw)-.25 F
-1.121(ath data or the spline)-.1 F(interpolation in)144 621.6 Q -.2(vo)
--.4 G -.1(ke).2 G 2.5(dw).1 G(ith the)-2.5 E F1<ad43>2.5 E F0(option.)
-2.5 E F1<ad4c>108 650.4 Q F2(lon\215ip)23.63 E F0 .572
-(Sets the range of the longitude v)144 662.4 R .572(alues returned.)-.25
-F(If)5.572 E F2(lon\215ip)3.072 E F0 .572(=\2551 then the longitude v)B
-.572(alues will be in)-.25 F .489(the range from \255360 to 0 de)144
-674.4 R .488(grees. If)-.15 F F2(lon\215ip)2.988 E F0 .488
-(=0 then the longitude v)B .488(alues will be in the range from)-.25 F
-1.382(\255180 to 180 de)144 686.4 R 1.382(grees. If)-.15 F F2(lon\215ip)
-3.882 E F0 1.382(=1 then the longitude v)B 1.382
-(alues will be in the range from 0 to 360)-.25 F(de)144 698.4 Q 2.5
-(grees. Def)-.15 F(ault:)-.1 E F2(lon\215ip)2.5 E F0 2.5(=0)2.5 G(.)-2.5
-E F1<ad4d>108 715.2 Q F0 1.111(Causes tw)20.86 F 3.611(oa)-.1 G 1.111
-(dditional grids to be output. One is a grid containing the standard de)
--3.611 F 1.11(viation of the)-.25 F .234
-(data within each grid cell relati)144 727.2 R .534 -.15(ve t)-.25 H
-2.734(ot).15 G .234(he grid v)-2.734 F .234
-(alue, the other contains the number of data points in)-.25 F
-(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(3)204.835 E 0
-Cg EP
-%%Page: 4 4
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 146.5(mbm_grid\(1\) MB-System)72 48 R 146.5
-(5.0 mbm_grid\(1\))2.5 F .846(each grid cell. This option is ignored wh\
-en the minimum or maximum \214lter gridding algorithms)144 84 R
-(are used \(see the)144 96 Q/F1 10/Times-Bold at 0 SF(-F)2.5 E F0
-(option\).)2.5 E F1<ad4e>108 112.8 Q F0 1.457
-(Causes grid cells with no data and no interpolation to be set to a v)
-23.08 F 1.458(alue of NaN instead of the)-.25 F(def)144 124.8 Q(ault v)
--.1 E(alue of 99999.9.)-.25 E(The NaN v)5 E(alue is e)-.25 E(xpected by)
--.15 E F1(GMT)2.5 E F0(programs such)2.5 E F1(grdview)2.5 E F0(.)A F1
-<ad4f>108 141.6 Q/F2 10/Times-Italic at 0 SF -.45(ro)22.52 G(ot).45 E F0
-.524(Sets the character string to be used as the root of the output \
-\214lenames. F)144 153.6 R .524(or e)-.15 F .524(xample, if the grid is)
--.15 F .178(output as a GMT v)144 165.6 R .178
-(ersion 2 GRD format \(netCDF\) \214le \(the def)-.15 F .178
-(ault\), then its \214lename is "root.grd".)-.1 F 1.269(If the)144 177.6
-R F1<ad47>3.769 E F2(1)A F0 1.268(option is used to specify an ascii fo\
-rmat grid, then the output grid \214lename will be)3.769 F .083
-("root.asc". If the)144 189.6 R F1<ad47>2.584 E F2(2)A F0 .084
-(option is used to specify a v)2.584 F .084
-(ersion 1 GRD format \(binary\) grid, then the out-)-.15 F .924(put gri\
-d \214lename will be "root.grd1". If the output grid is in the GMT v)144
-201.6 R .924(ersion 2 GRD format, a)-.15 F .268
-(shellscript which will allo)144 213.6 R 2.768(wt)-.25 G .269
-(he contents of the grid to vie)-2.768 F .269
-(wed using GMT programs is also output)-.25 F
-(with the \214lename "root.grd.cmd".)144 225.6 Q F1<ad50>108 242.4 Q F2
-(pings)24.19 E F0 .55(Sets the ping a)3.05 F -.15(ve)-.2 G .55
-(raging of the input data. If).15 F F2(pings)3.05 E F0 3.05(>0)3.05 G
-3.05(,t)-3.05 G .55(hen that number of input pings will)-3.05 F .642
-(be a)144 254.4 R -.15(ve)-.2 G .642(raged to produce one output ping.)
-.15 F(If)5.642 E F2(pings)3.142 E F0 3.143(=0)3.143 G 3.143(,t)-3.143 G
-.643(hen the ping a)-3.143 F -.15(ve)-.2 G .643
-(raging will automatically).15 F 1.041(be done so that the along-track \
-ping spacing is equal to the across-track beam spacing. Def)144 266.4 R
-(ault:)-.1 E F2(pings)144 278.4 Q F0 2.5(=1)2.5 G(.)-2.5 E F1<ad51>108
-295.2 Q F0(Normally)22.52 E 2.511(,b)-.65 G(ath)-2.511 E .011
-(ymetry or topograph)-.05 F 2.511(yd)-.05 G .011
-(ata is gridded in meters. If this option is used, bath)-2.511 F .012
-(ymetry or)-.05 F(topograph)144 307.2 Q 2.5(yd)-.05 G
-(ata is gridded in feet.)-2.5 E F1<ad52>108 324 Q F2
-(west/east/south/north)23.08 E F0 .514(Sets the longitude and latitude \
-bounds of the output grid. If the user uses the)144 336 R F1<ad45>3.013
-E F0 .513(option to set the)3.013 F 1.051(grid spacing, then the dimens\
-ions will be calculated from the grid bounds and spacing. In these)144
-348 R 2.913(circumstances rounding errors will usually require that the\
- eastern and northern bounds be)144 360 R(adjusted to \214t e)144 372 Q
-(xactly with the grid dimensions and spacing.)-.15 E F1<ad53>108 388.8 Q
-F2(speed)24.74 E F0 .532
-(Sets the minimum speed in km/hr \(5.5 kts ~ 10 km/hr\) allo)144 400.8 R
-.532(wed in the input data; pings associated)-.25 F
-(with a smaller ship speed will not be output. Def)144 412.8 Q(ault:)-.1
-E F2(speed)2.5 E F0 2.5(=0)2.5 G(.)-2.5 E F1<ad54>108 429.6 Q F2
-(tension)23.63 E F0(Sets the)144 441.6 Q F2(tension)2.5 E F0 -.25(va)2.5
-G(lue used in the thin plate spline interpolation.).25 E(A)144 465.6 Q
-F2(tension)3.212 E F0 .712(of 0 gi)3.212 F -.15(ve)-.25 G 3.212(sam).15
-G .712(inimum curv)-3.212 F .712(ature surf)-.25 F .712
-(ace with free edges; this is a pure Laplacian solu-)-.1 F .319
-(tion. A nonzero)144 477.6 R F2(tension)2.819 E F0 .319(tends to suppre\
-ss spurious oscillations and \215atten the interpolation to)2.819 F -.1
-(wa)-.25 G(rd).1 E .699(the edges; a)144 489.6 R F2(tension)3.199 E F0
-.698(of in\214nity yields a pure spline solution. The)3.199 F F2
-(tension)3.198 E F0 .698(must be zero or greater)3.198 F(.)-.55 E(Def)
-144 501.6 Q(ault:)-.1 E F2(tension)2.5 E F0 2.5(=1)2.5 G
-(.0e10 \(pure spline solution\).)-2.5 E F1<ad55>108 518.4 Q F2(time)
-23.08 E F0 -.15(Fo)144 530.4 S(rces).15 E F1(mbgrid)4.226 E F0 1.727
-(to a)4.227 F -.2(vo)-.2 G 1.727(id a).2 F -.15(ve)-.2 G 1.727(raging o)
-.15 F -.15(ve)-.15 G 1.727(rlapping sw).15 F 1.727
-(aths by ignoring the data from later sw)-.1 F(aths.)-.1 E .242
-("Later" data is identi\214ed using the)144 542.4 R F2(time)2.742 E F0
--.25(va)2.742 G .242(lue. The time of the \214rst data point is sa).25 F
--.15(ve)-.2 G 2.742(df).15 G .242(or each bin)-2.742 F .468
-(in the grid; an)144 554.4 R 2.969(yo)-.15 G .469
-(ther data points which are more than)-2.969 F F2(time)2.969 E F0 .469
-(minutes before or after the initial data)2.969 F .519
-(point in the rele)144 566.4 R -.15(ve)-.25 G .519
-(nt bin are ignored. If).15 F F2(time)3.019 E F0 .519(is ne)3.019 F -.05
-(ga)-.15 G(ti).05 E -.15(ve)-.25 G 3.019(,t).15 G .519
-(he last data in a bin \(within the time lag)-3.019 F
-(criterea\) will be sa)144 578.4 Q -.15(ve)-.2 G 2.5(da).15 G
-(nd used instead of the \214rst data.)-2.5 E F1<ad55>108 595.2 Q F2
-(azimuth/factor)23.08 E F0 .28(Enables prioritizing data points accordi\
-ng to their look azimuth \(data on the port side of the sw)144 607.2 R
-(ath)-.1 E(ha)144 619.2 Q .632 -.15(ve a l)-.2 H .331
-(ook azimuth equal to the heading \255 90 de).15 F .331
-(grees, and data on the starboard side ha)-.15 F .631 -.15(ve a l)-.2 H
-(ook).15 E .436(azimuth equal to the heading + 90 de)144 631.2 R 2.936
-(grees\). Here)-.15 F F2(azimuth)2.936 E F0 .437
-(is the preferred look azimuth, and)2.936 F F2(fac-)2.937 E(tor)144
-643.2 Q F0 .396(modulates ho)2.896 F 2.896(wr)-.25 G .396
-(apidly the priority de)-2.896 F .396(grades a)-.15 F -.1(wa)-.15 G
-2.896(yf).1 G .395(rom the preferred look azimuth. The prior)-2.896 F(-)
--.2 E(ity \(p\) for a data point is assigned as follo)144 655.2 Q(ws:)
--.25 E 2.5(p=c)164 667.2 S(os\(f * \(Ap \255 Al\)\))-2.5 E
-(when \25590 < \(f * \(Ap \255 Al\)\) < 90 and)144 679.2 Q 2.5(p=0)164
-691.2 S .025(otherwise, where f =)144 703.2 R F2(factor)2.525 E F0 2.525
-(,A)C 2.525(p=)-2.525 G F2(azimuth)A F0 2.525(,a)C .026
-(nd Al is the look azimuth of the data point.)-2.525 F(If)5.026 E F2
-(factor)2.526 E F0(=)2.526 E .156(1.0, the priority will be 1.0 at)144
-715.2 R F2(azimuth)2.656 E F0 .156(and will f)2.656 F .156
-(all to zero for look azimuths more than 90 de)-.1 F(grees)-.15 E -2.3
--.15(aw a)144 727.2 T 3.027(yf).15 G(rom)-3.027 E F2(azimuth)3.027 E F0
-5.527(.I)C(f)-5.527 E F2(factor)3.027 E F0 3.027(>1)3.027 G .528
-(.0, the range of nonzero priorities will shrink to azimuths closer)
--3.027 F(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(4)
-204.835 E 0 Cg EP
-%%Page: 5 5
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 146.5(mbm_grid\(1\) MB-System)72 48 R 146.5
-(5.0 mbm_grid\(1\))2.5 F(to)144 84 Q/F1 10/Times-Italic at 0 SF(azimuth)
-3.774 E F0 1.274(\(e.g. if)3.774 F F1(factor)3.774 E F0 3.774(=2)3.774 G
-1.274
-(.0, nonzero priorities will be restricted to look azimuths within 45)
--3.774 F(de)144 96 Q 1.018(grees of)-.15 F F1(azimuth)3.518 E F0 1.018
-(\). If)B F1(factor)3.518 E F0 3.518(<1)3.518 G 1.018
-(.0, the range of nonzero priorities will e)-3.518 F 1.019
-(xpand \(e.g. if)-.15 F F1(factor)3.519 E F0(=)3.519 E
-(0.5, only look azimuths 180 de)144 108 Q(grees a)-.15 E -.1(wa)-.15 G
-2.5(yf).1 G(rom)-2.5 E F1(azimuth)2.5 E F0(will ha)2.5 E .3 -.15(ve a z)
--.2 H(ero priority\).).15 E/F2 10/Times-Bold at 0 SF<ad56>108 124.8 Q F0
-(The)23.08 E F2<ad56>2.5 E F0(option causes)2.5 E F2(mbm_grid)2.5 E F0
-(to print out statements indicating its progress.)2.5 E F2<ad57>108
-141.6 Q F1(scale)20.3 E F0 .179(Sets the width of the g)144 153.6 R .178
-(aussian weighting function in terms of the grid spacing.)-.05 F .178
-(The distance to the)5.178 F .303
-(1/e point of the weighting function is gi)144 165.6 R -.15(ve)-.25 G
-2.803(nb).15 G 2.803(yh)-2.803 G .303(alf of the grid spacing times)
--2.803 F F1(scale)2.803 E F0 5.303(.D)C(ef)-5.303 E(ault:)-.1 E F1
-(scale)2.803 E F0 2.5(=1)144 177.6 S(.0)-2.5 E F2<ad58>108 194.4 Q F1
--.2(ex)23.08 G(tend).2 E F0 .646(Extends the size of the internal grid \
-so that the output grid is a subset from the center of a lar)144 206.4 R
-(ger)-.18 E 5.273(grid. This)144 218.4 R(allo)2.773 E .274(ws data outs\
-ide the output grid to guide the spline interpolation of data g)-.25 F
-.274(aps which)-.05 F .498
-(happen to lie at the the edge of the output grid.)144 230.4 R .497
-(The amount of e)5.497 F .497(xtension is)-.15 F F1 -.2(ex)2.997 G(tend)
-.2 E F0 .497(times the grid)2.997 F .881(width/height to each side.)144
-242.4 R .881(Thus, if)5.881 F F1 -.2(ex)3.381 G(tend).2 E F0 .882
-(=1.0, then the internal grid will ha)B 1.182 -.15(ve d)-.2 H .882
-(imensions three).15 F(times the output grid.)144 254.4 Q(Def)5 E(ault:)
--.1 E F1 -.2(ex)2.5 G(tend).2 E F0 2.5(=0)2.5 G(.0)-2.5 E F2<ad59>108
-271.2 Q F1(priority_\214le)23.08 E F0 1.127(Enables priortization of da\
-ta points based on their apparent grazing angle \(this angle is the arc\
--)144 283.2 R .045(tan\(x/z\) where x is acrosstrack distance and z is \
-depth, so that the center of the sw)144 295.2 R .045(ath has an appar)
--.1 F(-)-.2 E .531(ent grazing angle of zero, the port sw)144 307.2 R
-.531(ath edge has a lar)-.1 F .531(ge ne)-.18 F -.05(ga)-.15 G(ti).05 E
-.831 -.15(ve a)-.25 H .531(ngle, and the starboard sw).15 F(ath)-.1 E
-1.337(edge has a lar)144 319.2 R 1.337(ge positi)-.18 F 1.637 -.15(ve a)
--.25 H 1.337(ngle\). The \214le).15 F F1(priority_\214le)3.838 E F0
-1.338(must contain a list of data priorities as a)3.838 F .551(function\
- of apparent grazing angle. The \214rst line of the \214le should conta\
-in the minimum, or port-)144 331.2 R .083(most grazing angle follo)144
-343.2 R .084(wed by the associated priority)-.25 F 2.584(.T)-.65 G .084
-(he follo)-2.584 F .084(wing lines should contain increas-)-.25 F .374
-(ingly lar)144 355.2 R .374(ge grazing angles \(and associated prioriti\
-es\) up to the maximum, or starboard-most, graz-)-.18 F .272(ing angle.)
-144 367.2 R .272
-(The highest priority assigned should be one, and the lo)5.272 F .272
-(west zero.)-.25 F .272(Priorities for grazing)5.272 F .49(angles less \
-than the minimum or greater than the maximum will be zero. See the e)144
-379.2 R .49(xamples belo)-.15 F(w)-.25 E(for a further e)144 391.2 Q
-(xplanation of the use of)-.15 E F1(priority_\214le)2.5 E F0(.)A F2
-<ad5a>108 408 Q F1(bath_default)23.63 E F0 .657(Sets the def)144 420 R
-.658(ault depth used for calculating grazing angles for amplitude or si\
-descan v)-.1 F .658(alues where)-.25 F(depths are not a)144 432 Q -.25
-(va)-.2 G 2.5(ilable. Def).25 F(ault:)-.1 E F1(scale)2.5 E F0 2.5(=1)2.5
-G(000.0)-2.5 E/F3 10.95/Times-Bold at 0 SF(EXAMPLES)72 460.8 Q F0 .03
-(Suppose we ha)108 472.8 R .33 -.15(ve o)-.2 H .03(btained a sw).15 F
-.03(ath sonar data \214le called e)-.1 F .03
-(xample_hs.mb24 collected using a SeaBeam 2112)-.15 F(sonar)108 484.8 Q
-5.782(.T)-.55 G .783(his \214le contains bath)-5.782 F(ymetry)-.05 E
-3.283(,b)-.65 G .783
-(eam amplitude, and sidescan data. In order to obtain a \214rst cut ba-)
--3.283 F(th)108 496.8 Q 1.638
-(ymetry grid and \214rst cut amplitude and sidescan mosaics, we use)-.05
-F F2(mbm_grid)4.138 E F0 1.637(to generate shellscripts)4.138 F .109
-(which in turn run)108 508.8 R F2(mbgrid)2.609 E F0(or)2.609 E F2
-(mbmosaic)2.609 E F0 .109(to generate grids and mosaics.)2.609 F .11
-(The follo)5.11 F .11(wing four commands gen-)-.25 F
-(erate gridding shellscripts for bath)108 520.8 Q(ymetry)-.05 E 2.5(,t)
--.65 G(opograph)-2.5 E 1.3 -.65(y, a)-.05 H
-(mplitude, and sidescan, respecti).65 E -.15(ve)-.25 G(ly:).15 E
-(mbm_grid \255F24 \255I e)144 544.8 Q(xample_hs.mb24 \\)-.15 E
-(-A1 \255V \255Obath)74.5 E(mbm_grid \255F24 \255I e)144 556.8 Q
-(xample_hs.mb24 \\)-.15 E(-A2 \255V \255Otopo)180 568.8 Q
-(mbm_grid \255F24 \255I e)144 580.8 Q(xample_hs.mb24 \\)-.15 E
-(-A3 \255V \255Oamp)180 592.8 Q(mbm_grid \255F24 \255I e)144 604.8 Q
-(xample_hs.mb24 \\)-.15 E(-A4 \255V \255Oss)180 616.8 Q .348
-(When the follo)108 640.8 R .348(wing shellscripts are e)-.25 F -.15(xe)
--.15 G .348(cuted, each will generate a both a grid \(or mosaic\) \214l\
-e and an addi-).15 F(tional shellscript which in turn will \(when run\)\
- generate and display a postscript plot \214le:)108 652.8 Q
-(bath_mbgrid.cmd)144 676.8 Q(topo_mbgrid.cmd)144 688.8 Q
-(amp_mbmosaic.cmd)144 700.8 Q(ss_mbmosaic.cmd)144 712.8 Q(MB-System 5.0)
-72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(5)204.835 E 0 Cg EP
-%%Page: 6 6
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 146.5(mbm_grid\(1\) MB-System)72 48 R 146.5
-(5.0 mbm_grid\(1\))2.5 F 1.793(The program)108 84 R/F1 10/Times-Bold at 0
-SF(mbinf)4.293 E(o)-.25 E F0 1.793(is e)4.293 F -.15(xe)-.15 G 1.793
-(cuted by).15 F F1(mbm_grid)4.293 E F0 1.793
-(to obtain the \214le statistics used to determine the grid)4.293 F .373
-(bounds and bin size. The macro)108 96 R F1(mbm_grdplot)2.873 E F0 .373
-(is e)2.873 F -.15(xe)-.15 G .372(cuted by).15 F F1(mbgrid)2.872 E F0
-(or)2.872 E F1(mbmosaic)2.872 E F0 .372(to generate the initial)2.872 F
-(plots of the gridded data.)108 108 Q(As an e)108 132 Q(xample, the con\
-tents of the gridding shellscript "bath_mbgrid.cmd" are:)-.15 E
-(#! /bin/csh \255f)110.5 156 Q(#)110.5 168 Q 2.5(#S)110.5 180 S
-(hellscript to grid or mosaic sw)-2.5 E(ath sonar data)-.1 E 2.5(#C)
-110.5 192 S(reated by macro mbm_grid)-2.5 E(#)110.5 204 Q 2.5(#T)110.5
-216 S(his shellscript created by follo)-2.5 E(wing command line:)-.25 E
-2.5(#m)110.5 228 S(bm_grid \255F24 \255I e)-2.5 E
-(xample_hs.mb24 \255A1 \255V \255Obath)-.15 E(#)110.5 240 Q 2.5(#D)110.5
-252 S(e\214ne shell v)-2.5 E(ariables used in this script:)-.25 E
-(set REGION)110.5 264 Q 2.5<3dad>17.5 G
-(49.316085/-49.096415/12.06972/12.18588)-2.5 E(set INPUT_FILE)110.5 276
-Q 2.5(=e)7.5 G(xample_hs.mb24)-2.65 E(set INPUT_FORMA)110.5 288 Q 2.5
-(T=2)-1.11 G(4)-2.5 E(set R)110.5 300 Q(OO)-.4 E 22.5(T=)-.4 G(bath)-20
-E(#)110.5 312 Q 2.5(#M)110.5 324 S(ak)-2.5 E 2.5(ed)-.1 G
-(atalist \214le)-2.5 E(echo Making datalist \214le...)110.5 336 Q
-(echo $INPUT_FILE $INPUT_FORMA)110.5 348 Q 2.5(T>)-1.11 G 2.5(!d)-2.5 G
-(atalist$$)-2.5 E(#)110.5 360 Q 2.5(#R)110.5 372 S(un mbgrid)-2.5 E
-(echo Running mbgrid...)110.5 384 Q(mbgrid \255Idatalist$$ \\)110.5 396
-Q(-R$REGION \\)144 408 Q(-O$R)144 420 Q(OO)-.4 E 2.5(T\\)-.4 G
-(-A1 \255N \\)144 432 Q(-E363.3/363.3/meters \\)144 444 Q(#)110.5 456 Q
-2.5(#A)110.5 468 S(ll done!)-2.5 E(echo All done!)110.5 480 Q/F2 10.95
-/Times-Bold at 0 SF(SEE ALSO)72 508.8 Q F1(mbsystem)108 520.8 Q F0(\(1\),)A
-F1(mbgrid)2.5 E F0(\(1\),)A F1(mbmosaic)2.5 E F0(\(1\),)A F1(mbinf)2.5 E
-(o)-.25 E F0(\(1\),)A F1(mbm_grdplot)2.5 E F0(\(1\))A F2 -.11(BU)72
-549.6 S(GS).11 E F0(This macro is ne)108 561.6 Q 2.5(wa)-.25 G(nd hasn')
--2.5 E 2.5(tb)-.18 G(een tested in serious usage yet \255 let us kno)
--2.5 E 2.5(ww)-.25 G(hat to \214x, add, or change!.)-2.5 E
-(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(6)204.835 E 0
-Cg EP
-%%Trailer
-end
-%%EOF
diff --git a/src/ps/mbm_histplot.ps b/src/ps/mbm_histplot.ps
deleted file mode 100644
index 0436dc5..0000000
--- a/src/ps/mbm_histplot.ps
+++ /dev/null
@@ -1,515 +0,0 @@
-%!PS-Adobe-3.0
-%%Creator: groff version 1.19.2
-%%CreationDate: Wed Jul  1 12:29:29 2015
-%%DocumentNeededResources: font Times-Roman
-%%+ font Times-Bold
-%%+ font Times-Italic
-%%DocumentSuppliedResources: procset grops 1.19 2
-%%Pages: 4
-%%PageOrder: Ascend
-%%DocumentMedia: Default 612 792 0 () ()
-%%Orientation: Portrait
-%%EndComments
-%%BeginDefaults
-%%PageMedia: Default
-%%EndDefaults
-%%BeginProlog
-%%BeginResource: procset grops 1.19 2
-%!PS-Adobe-3.0 Resource-ProcSet
-/setpacking where{
-pop
-currentpacking
-true setpacking
-}if
-/grops 120 dict dup begin
-/SC 32 def
-/A/show load def
-/B{0 SC 3 -1 roll widthshow}bind def
-/C{0 exch ashow}bind def
-/D{0 exch 0 SC 5 2 roll awidthshow}bind def
-/E{0 rmoveto show}bind def
-/F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def
-/G{0 rmoveto 0 exch ashow}bind def
-/H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/I{0 exch rmoveto show}bind def
-/J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def
-/K{0 exch rmoveto 0 exch ashow}bind def
-/L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/M{rmoveto show}bind def
-/N{rmoveto 0 SC 3 -1 roll widthshow}bind def
-/O{rmoveto 0 exch ashow}bind def
-/P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/Q{moveto show}bind def
-/R{moveto 0 SC 3 -1 roll widthshow}bind def
-/S{moveto 0 exch ashow}bind def
-/T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/SF{
-findfont exch
-[exch dup 0 exch 0 exch neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/MF{
-findfont
-[5 2 roll
-0 3 1 roll
-neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/level0 0 def
-/RES 0 def
-/PL 0 def
-/LS 0 def
-/MANUAL{
-statusdict begin/manualfeed true store end
-}bind def
-/PLG{
-gsave newpath clippath pathbbox grestore
-exch pop add exch pop
-}bind def
-/BP{
-/level0 save def
-1 setlinecap
-1 setlinejoin
-72 RES div dup scale
-LS{
-90 rotate
-}{
-0 PL translate
-}ifelse
-1 -1 scale
-}bind def
-/EP{
-level0 restore
-showpage
-}def
-/DA{
-newpath arcn stroke
-}bind def
-/SN{
-transform
-.25 sub exch .25 sub exch
-round .25 add exch round .25 add exch
-itransform
-}bind def
-/DL{
-SN
-moveto
-SN
-lineto stroke
-}bind def
-/DC{
-newpath 0 360 arc closepath
-}bind def
-/TM matrix def
-/DE{
-TM currentmatrix pop
-translate scale newpath 0 0 .5 0 360 arc closepath
-TM setmatrix
-}bind def
-/RC/rcurveto load def
-/RL/rlineto load def
-/ST/stroke load def
-/MT/moveto load def
-/CL/closepath load def
-/Fr{
-setrgbcolor fill
-}bind def
-/setcmykcolor where{
-pop
-/Fk{
-setcmykcolor fill
-}bind def
-}if
-/Fg{
-setgray fill
-}bind def
-/FL/fill load def
-/LW/setlinewidth load def
-/Cr/setrgbcolor load def
-/setcmykcolor where{
-pop
-/Ck/setcmykcolor load def
-}if
-/Cg/setgray load def
-/RE{
-findfont
-dup maxlength 1 index/FontName known not{1 add}if dict begin
-{
-1 index/FID ne{def}{pop pop}ifelse
-}forall
-/Encoding exch def
-dup/FontName exch def
-currentdict end definefont pop
-}bind def
-/DEFS 0 def
-/EBEGIN{
-moveto
-DEFS begin
-}bind def
-/EEND/end load def
-/CNT 0 def
-/level1 0 def
-/PBEGIN{
-/level1 save def
-translate
-div 3 1 roll div exch scale
-neg exch neg exch translate
-0 setgray
-0 setlinecap
-1 setlinewidth
-0 setlinejoin
-10 setmiterlimit
-[]0 setdash
-/setstrokeadjust where{
-pop
-false setstrokeadjust
-}if
-/setoverprint where{
-pop
-false setoverprint
-}if
-newpath
-/CNT countdictstack def
-userdict begin
-/showpage{}def
-/setpagedevice{}def
-}bind def
-/PEND{
-countdictstack CNT sub{end}repeat
-level1 restore
-}bind def
-end def
-/setpacking where{
-pop
-setpacking
-}if
-%%EndResource
-%%EndProlog
-%%BeginSetup
-%%BeginFeature: *PageSize Default
-<< /PageSize [ 612 792 ] /ImagingBBox null >> setpagedevice
-%%EndFeature
-%%IncludeResource: font Times-Roman
-%%IncludeResource: font Times-Bold
-%%IncludeResource: font Times-Italic
-grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72
-def/PL 792 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron/Zcaron
-/scaron/zcaron/Ydieresis/trademark/quotesingle/Euro/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/space/exclam/quotedbl/numbersign/dollar/percent
-/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen
-/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon
-/semicolon/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O
-/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright/circumflex
-/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y
-/z/braceleft/bar/braceright/tilde/.notdef/quotesinglbase/guillemotleft
-/guillemotright/bullet/florin/fraction/perthousand/dagger/daggerdbl
-/endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut
-/dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash
-/quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen
-/brokenbar/section/dieresis/copyright/ordfeminine/guilsinglleft
-/logicalnot/minus/registered/macron/degree/plusminus/twosuperior
-/threesuperior/acute/mu/paragraph/periodcentered/cedilla/onesuperior
-/ordmasculine/guilsinglright/onequarter/onehalf/threequarters
-/questiondown/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE
-/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex
-/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis
-/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn
-/germandbls/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla
-/egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis
-/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide/oslash
-/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis]def
-/Times-Italic at 0 ENC0/Times-Italic RE/Times-Bold at 0 ENC0/Times-Bold RE
-/Times-Roman at 0 ENC0/Times-Roman RE
-%%EndSetup
-%%Page: 1 1
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 132.6(mbm_histplot\(1\) MB-System)72 48 R 132.6
-(5.0 mbm_histplot\(1\))2.5 F/F1 10.95/Times-Bold at 0 SF -.219(NA)72 84 S
-(ME).219 E/F2 10/Times-Bold at 0 SF(mbm_histplot)108 96 Q F0 2.5<ad43>2.5 G
-(reate an e)-2.5 E -.15(xe)-.15 G(cutable shellscript which will genera\
-te a GMT histogram plot of a dataset.).15 E F1(VERSION)72 124.8 Q F0
--1.11(Ve)108 136.8 S(rsion 5.0)1.11 E F1(SYNOPSIS)72 165.6 Q F2
-(mbm_histplot \255I)108 177.6 Q/F3 10/Times-Italic at 0 SF(\214le)A F0([)
-2.5 E F2<ad47>A F3(\214ll)A F2<ad4820ad4f>2.5 E F3 -.45(ro)C(ot).45 E F2
-<ad50>2.5 E F3(pa)A -.1(ge)-.1 G(size).1 E F2<ad55>2.5 E F3(orientation)
-A F2<ad5620ad57>2.5 E F3(pen)A F0(])2.5 E(Additional Options:)108 201.6
-Q([)108 213.6 Q F2<ad42>A F3(tic)A(kinfo)-.2 E F2<ad4a>2.5 E F3(pr)A
-(ojection[/scale | width])-.45 E F2<ad4c>2.5 E F3(title[:xlabel:ylabel])
-A F2<ad4d>2.5 E F3(misc)A F2<ad5120ad52>2.5 E F3(w/e/s/n)A F2
-<ad5820ad5a>2.5 E F3(])A F1(DESCRIPTION)72 242.4 Q F2(mbm_histplot)108
-254.4 Q F0 .14
-(is a macro to generate a shellscript of GMT commands which, when e)2.64
-F -.15(xe)-.15 G .14(cuted, will generate).15 F 3.045(aP)108 266.4 S
-.545(ostscript histogram plot of a set of data v)-3.045 F 3.046
-(alues. The)-.25 F .546
-(plot will be scaled to \214t on the speci\214ed page size)3.046 F(or)
-108 278.4 Q 3.25(,i)-.4 G 3.25(ft)-3.25 G .749(he scale is user de\214n\
-ed, the page size will be chosen in accordance with the plot size. The \
-primary)-3.25 F .77(purpose of this macro is to allo)108 290.4 R 3.27
-(wt)-.25 G .77
-(he simple, semi-automated production of nice looking plots with a fe)
--3.27 F(w)-.25 E .422(command line ar)108 302.4 R .422(guments. F)-.18 F
-.421(or users seeking more control o)-.15 F -.15(ve)-.15 G 2.921(rt).15
-G .421(he plot appearance, a number of additional)-2.921 F .946
-(optional ar)108 314.4 R .946(guments are pro)-.18 F .946(vided. T)-.15
-F .946(ruly ambitious users may edit the plot shellscript to tak)-.35 F
-3.446(ea)-.1 G(dv)-3.446 E .946(antage of)-.25 F
-(GMT capabilities not supported by this macro.)108 326.4 Q .084(By def)
-108 350.4 R .083
-(ault the output plot generation shellscript includes lines which e)-.1
-F -.15(xe)-.15 G .083(cute a program to display the Post-).15 F .807(sc\
-ript image on the screen. The program to be used to display the Postscr\
-ipt is set using)108 362.4 R F2(mbdefaults)3.308 E F0 3.308(;t)C(he)
--3.308 E(def)108 374.4 Q .326(ault v)-.1 F .326(alue can be o)-.25 F
--.15(ve)-.15 G .325(rridden by setting the en).15 F .325(vironment v)-.4
-F .325(ariable $MB_PS_VIEWER.)-.25 F(In)5.325 E -.2(vo)-.4 G .325
-(king the plot).2 F(generation shellscript with a)108 386.4 Q F2(-N)2.5
-E F0(command line ar)2.5 E
-(gument suppresses the screen display of the plot.)-.18 E .305
-(The plot scripts generated by this macro will w)108 410.4 R .305
-(ork with GMT v)-.1 F .305(ersion 5.0 and later)-.15 F 2.805(,a)-.4 G
-.305(nd are not compatible)-2.805 F(with earlier v)108 422.4 Q
-(ersions of GMT)-.15 E(.)-.74 E F1 -.548(AU)72 451.2 S(THORSHIP).548 E
-F0(Da)108 463.2 Q(vid W)-.2 E 2.5(.C)-.92 G(aress \(caress at mbari.or)-2.5
-E(g\))-.18 E(Montere)113 475.2 Q 2.5(yB)-.15 G
-(ay Aquarium Research Institute)-2.5 E
-(Dale N. Chayes \(dale at ldeo.columbia.edu\))108 487.2 Q
-(Lamont-Doherty Earth Observ)113 499.2 Q(atory)-.25 E
-(Suzanne H. O'Hara \(sohara at ldeo.columbia.edu\))108 511.2 Q
-(Lamont-Doherty Earth Observ)113 523.2 Q(atory)-.25 E F1(OPTIONS)72 552
-Q F2<ad42>108 564 Q F3(tic)23.63 E(kinfo)-.2 E F0 .219
-(Sets map boundary tickmark interv)144 576 R .219(als. See the)-.25 F F2
-(psbasemap)2.719 E F0 .218(manual page for details. By def)2.719 F .218
-(ault the)-.1 F
-(program chooses basemap annotations based on the map boundaries.)144
-588 Q F2<ad43>108 604.8 Q F3(cellwidth)23.08 E F0 .236(Sets the width o\
-f the cells into which the data are binned to form the histogram. The d\
-ef)144 616.8 R .236(ault is use)-.1 F 2.5(ac)144 628.8 S
-(ell width that is 1/10 the data range.)-2.5 E F2<ad47>108 645.6 Q F3
-(\214ll)22.52 E F0 .638(Select \214lling of the histogram.)144 657.6 R
-.638(Set the shade \(0-255\) or color \(r/g/b\) [Def)5.638 F .637
-(ault is a light gray]. T)-.1 F(o)-.8 E .096(reset no \214ll, use)144
-669.6 R F3(\214ll)2.596 E F0 2.596(=")2.596 G 2.596(N". Y)-2.596 F .097
-(ou may optionally specify)-1.1 F F2(\255Gp)2.597 E F3
-(icon_size/pattern)A F0 2.597(,w)C(here)-2.597 E F3(pattern)2.597 E F0
-(gi)2.597 E -.15(ve)-.25 G(s).15 E .438(the number of the image pattern\
- \(1-32\) OR the name of a icon-format \214le.)144 681.6 R F3(icon_size)
-5.438 E F0 .438(sets the unit)2.938 F .294(size in inch.)144 693.6 R
-1.894 -.8(To i)5.294 H -1.85 -.4(nv e).8 H .295(rt black and white pix)
-.4 F .295(els, use)-.15 F F2(\255GP)2.795 E F0 .295(instead of)2.795 F
-F2(\255Gp)2.795 E F0 5.295(.S)C(ee)-5.295 E F2(GMTs)2.795 E F0 .295
-(Cookbook &)2.795 F -.7(Te)144 705.6 S
-(chnical Reference Appendix E for information on indi).7 E
-(vidual patterns.)-.25 E(MB-System 5.0)72 768 Q 2.5(9J)140.11 G
-(anuary 2015)-2.5 E(1)198.45 E 0 Cg EP
-%%Page: 2 2
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 132.6(mbm_histplot\(1\) MB-System)72 48 R 132.6
-(5.0 mbm_histplot\(1\))2.5 F/F1 10/Times-Bold at 0 SF<ad48>108 84 Q F0 .162
-(This "help" \215ag cause the program to print out a description of its\
- operation and then e)22.52 F .161(xit immedi-)-.15 F(ately)144 96 Q(.)
--.65 E F1<ad49>108 112.8 Q/F2 10/Times-Italic at 0 SF([\214lepar)26.41 E
-(s:]xy_\214le)-.1 E F0 1.694(Speci\214es the \214le containing the data\
- to be plotted in a histogram. A single column of data is)144 136.8 R
--.15(ex)144 148.8 S(pected.).15 E F1<ad4a>108 165.6 Q F2(pr)25.3 E
-(ojection)-.45 E F0([)A F2(/width/height)A F0(])A .993
-(Sets the plot scale. The projection is linear \()144 177.6 R F1<ad4a>A
-F2 .993(X\), and the user can optionally specify the width)B
-(and height.)144 189.6 Q F1<ad4c>108 206.4 Q F2(title[:xlabel[:ylabel]])
-23.63 E F0 .173(Sets the title and the labels for the x and y ax)144
-218.4 R .174
-(es of the plot. Note that a colon \(:\) rather than a slash)-.15 F .652
-(\(/\) is used to separate the labels. Colons cannot be used in the lab\
-els themselv)144 230.4 R .652(es. If this option is)-.15 F .156
-(not used, then a def)144 242.4 R .157
-(ault title and colorscale label are pro)-.1 F .157
-(vided. If the title is supplied alone, no x or)-.15 F
-(y-axis labels will be pro)144 254.4 Q(vided.)-.15 E F1<ad4f>108 271.2 Q
-F2 -.45(ro)22.52 G(ot).45 E F0 .423(Sets the root used to construct the\
- \214lename of the output shellscript \()144 283.2 R F2 -.45(ro)C(ot).45
-E F0 .422(.cmd\) and names of \214les)B .156
-(created when the shellscript is run.)144 295.2 R .157
-(Normally the name of the input grid \214le or grid \214le list is used)
-5.157 F(as the)144 307.2 Q F2 -.45(ro)2.5 G(ot).45 E F0(.)A F1<ad50>108
-324 Q F2(pa)24.19 E -.1(ge)-.1 G(size).1 E F0 .632(This option sets the\
- size of the page the plot will be centered on. If the user does not se\
-t the plot)144 336 R .125(scale, the plot will be sized as lar)144 348 R
-.125(ge as will \214t on the designated page. If the user sets the plot\
- scale)-.18 F .948
-(such that the plot will not \214t on the designated page, a lar)144 360
-R .948(ger page will be used.)-.18 F .947(The supported)5.947 F
-(page sizes are:)144 372 Q(American ANSI sizes:)169 396 Q 12.5(A8)169
-408 S(.5 x 11.0 in.)-12.5 E 2.5(\(2)10 G(15.9 x)-2.5 E(279.4 mm\))5 E 10
-(B1)169 420 S(1.0 x 17.0 in.)-10 E 2.5(\(2)10 G(79.4 x)-2.5 E
-(431.8 mm\))5 E 10(C1)169 432 S(7.0 x 22.0 in.)-10 E 2.5(\(4)10 G
-(31.8 x)-2.5 E(558.8 mm\))5 E 10(D2)169 444 S(2.0 x 34.0 in.)-10 E 2.5
-(\(5)10 G(58.8 x)-2.5 E(863.6 mm\))5 E 10(E3)169 456 S(4.0 x 44.0 in.)
--10 E 2.5(\(8)10 G(63.6 x 1117.6 mm\))-2.5 E 10(F2)169 468 S
-(8.0 x 40.0 in.)-10 E 2.5(\(7)10 G(11.2 x 1016.0 mm\))-2.5 E 5(E1 44.0)
-169 480 R 2.5(x6)2.5 G(8.0 in.)-2.5 E(\(1117.6 x 1727.2 mm\))10 E
-(Metric ISO A sizes:)169 504 Q 5(A0 841.0)169 516 R 2.5(x1)2.5 G
-(189.0 mm)-2.5 E(\(33.11 x 46.81 in.\))5 E 5(A1 594.0)169 528 R 5(x8)2.5
-G(41.0 mm)-5 E(\(23.39 x 33.11 in.\))5 E 5(A2 420.0)169 540 R 5(x5)2.5 G
-(94.0 mm)-5 E(\(16.54 x 23.39 in.\))5 E 5(A3 297.0)169 552 R 5(x4)2.5 G
-(20.0 mm)-5 E(\(11.69 x 16.54 in.\))5 E 5(A4 210.0)169 564 R 5(x2)2.5 G
-(97.0 mm)-5 E 2.5(\(8)5 G(.27 x 11.69 in.\))-2.5 E 5(A5 148.0)169 576 R
-5(x2)2.5 G(10.0 mm)-5 E 2.5(\(5)5 G(.83 x)-2.5 E(8.27 in.\))5 E 5
-(A6 105.0)169 588 R 5(x1)2.5 G(48.0 mm)-5 E 2.5(\(4)5 G(.13 x)-2.5 E
-(5.83 in.\))5 E 7.5(A7 74.0)169 600 R 5(x1)2.5 G(05.0 mm)-5 E 2.5(\(2)5
-G(.91 x)-2.5 E(4.13 in.\))5 E 7.5(A8 52.0)169 612 R 7.5(x7)2.5 G(4.0 mm)
--7.5 E 2.5(\(2)5 G(.05 x)-2.5 E(2.91 in.\))5 E 7.5(A9 37.0)169 624 R 7.5
-(x5)2.5 G(2.0 mm)-7.5 E 2.5(\(1)5 G(.46 x)-2.5 E(2.05 in.\))5 E 5
-(A10 26.0)169 636 R 7.5(x3)2.5 G(7.0 mm)-7.5 E 2.5(\(1)5 G(.02 x)-2.5 E
-(1.46 in.\))5 E(Metric ISO B sizes:)169 660 Q 5(B0 1000.0x)169 672 R
-(1414.0 mm)2.5 E(\(39.37 x 55.67 in.\))5 E 5(B1 707.0)169 684 R 2.5(x1)
-2.5 G(000.0 mm)-2.5 E(\(27.83 x 39.37 in.\))5 E 5(B2 500.0)169 696 R 5
-(x7)2.5 G(07.0 mm)-5 E(\(19.68 x 27.83 in.\))5 E 5(B3 353.0)169 708 R 5
-(x5)2.5 G(00.0 mm)-5 E(\(13.90 x 19.68 in.\))5 E 5(B4 250.0)169 720 R 5
-(x3)2.5 G(53.0 mm)-5 E 2.5(\(9)5 G(.84 x 13.90 in.\))-2.5 E
-(MB-System 5.0)72 768 Q 2.5(9J)140.11 G(anuary 2015)-2.5 E(2)198.45 E 0
-Cg EP
-%%Page: 3 3
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 132.6(mbm_histplot\(1\) MB-System)72 48 R 132.6
-(5.0 mbm_histplot\(1\))2.5 F 5(B5 176.0)169 84 R 5(x2)2.5 G(50.0 mm)-5 E
-2.5(\(6)5 G(.93 x)-2.5 E(9.84 in.\))5 E 5(B6 125.0)169 96 R 5(x1)2.5 G
-(76.0 mm)-5 E 2.5(\(4)5 G(.92 x)-2.5 E(6.93 in.\))5 E 7.5(B7 88.0)169
-108 R 5(x1)2.5 G(25.0 mm)-5 E 2.5(\(3)5 G(.46 x)-2.5 E(4.92 in.\))5 E
-7.5(B8 62.0)169 120 R 7.5(x8)2.5 G(8.0 mm)-7.5 E 2.5(\(2)5 G(.44 x)-2.5
-E(3.46 in.\))5 E 7.5(B9 44.0)169 132 R 7.5(x6)2.5 G(2.0 mm)-7.5 E 2.5
-(\(1)5 G(.73 x)-2.5 E(2.44 in.\))5 E 5(B10 31.0)169 144 R 7.5(x4)2.5 G
-(4.0 mm)-7.5 E 2.5(\(1)5 G(.22 x)-2.5 E(1.73 in.\))5 E
-(Metric ISO C sizes:)169 168 Q 5(C0 914.4)169 180 R 2.5(x1)2.5 G
-(300.5 mm)-2.5 E(\(36.00 x 51.20 in.\))5 E 5(C1 650.2)169 192 R 5(x9)2.5
-G(14.4 mm)-5 E(\(25.60 x 36.00 in.\))5 E 5(C2 457.2)169 204 R 5(x6)2.5 G
-(50.2 mm)-5 E(\(18.00 x 25.60 in.\))5 E 5(C3 325.1)169 216 R 5(x4)2.5 G
-(57.2 mm)-5 E(\(12.80 x 18.00 in.\))5 E 5(C4 228.6)169 228 R 5(x3)2.5 G
-(25.1 mm)-5 E 2.5(\(9)5 G(.00 x 12.80 in.\))-2.5 E 5(C5 162.6)169 240 R
-5(x2)2.5 G(28.6 mm)-5 E 2.5(\(6)5 G(.40 x)-2.5 E(9.00 in.\))5 E 5
-(C6 114.3)169 252 R 5(x1)2.5 G(62.6 mm)-5 E 2.5(\(4)5 G(.50 x)-2.5 E
-(6.40 in.\))5 E 7.5(C7 81.3)169 264 R 5(x1)2.5 G(14.3 mm)-5 E 2.5(\(3)5
-G(.20 x)-2.5 E(4.50 in.\))5 E(MB-System lar)185 288 Q(ge format sizes:)
--.18 E 2.5(m1 1371.6)169 300 R 2.5(x1)2.5 G(828.8 mm)-2.5 E
-(\(54.00 x 72.00 in.\))5 E 2.5(m2 1371.6)169 312 R 2.5(x2)2.5 G
-(133.6 mm)-2.5 E(\(54.00 x 84.00 in.\))5 E 2.5(m3 1371.6)169 324 R 2.5
-(x2)2.5 G(438.4 mm)-2.5 E(\(54.00 x 96.00 in.\))5 E 2.5(m4 1524.0)169
-336 R 2.5(x1)2.5 G(828.8 mm)-2.5 E(\(60.00 x 72.00 in.\))5 E 2.5
-(m5 1524.0)169 348 R 2.5(x2)2.5 G(133.6 mm)-2.5 E(\(60.00 x 84.00 in.\))
-5 E 2.5(m6 1524.0)169 360 R 2.5(x2)2.5 G(438.4 mm)-2.5 E
-(\(60.00 x 96.00 in.\))5 E(The def)144 384 Q(ault page size is A.)-.1 E
-/F1 10/Times-Bold at 0 SF<ad51>108 400.8 Q F0(Normally)22.52 E 2.866(,t)
--.65 G .367
-(he output plot generation shellscript includes lines which e)-2.866 F
--.15(xe)-.15 G .367(cute a program to display).15 F 1.072
-(the Postscript image on the screen.)144 412.8 R 1.071
-(This option causes those lines to be commented out so that)6.071 F -.15
-(exe)144 424.8 S .147
-(cuting the shellscript produces a Postscript plot b).15 F .148
-(ut does not attempt to display it on the screen.)-.2 F(Alternati)144
-436.8 Q -.15(ve)-.25 G(ly).15 E 2.892(,i)-.65 G -1.9 -.4(nv o)-2.892 H
-.392(king the plot generation shellscript with a).4 F F1(-N)2.891 E F0
-.391(command line ar)2.891 F .391(gument also sup-)-.18 F .227(presses \
-the screen display of the plot. The program to be used to display the P\
-ostscript is set using)144 448.8 R F1(mbdefaults)144 460.8 Q F0 7.891
-(;t)C 5.391(he def)-7.891 F 5.391(ault v)-.1 F 5.391(alue can be o)-.25
-F -.15(ve)-.15 G 5.391(rridden by setting the en).15 F 5.39(vironment v)
--.4 F(ariable)-.25 E($MB_PS_VIEWER.)144 472.8 Q F1<ad52>108 489.6 Q/F2
-10/Times-Italic at 0 SF(west/east/south/north)23.08 E .196
-(west, east, south,)144 501.6 R F0(and)2.696 E F2(north)2.696 E F0 .196
-(specify the Re)2.696 F .196(gion of interest. [Def)-.15 F .196
-(ault is the range of the data and the)-.1 F(histogram distrib)144 513.6
-Q(ution].)-.2 E F1<ad55>108 530.4 Q F2(orientation)23.08 E F0 .2(Normal\
-ly the orientation of the plot \(portrait or landscape\) is selected au\
-tomatically so as to maxi-)144 542.4 R .333(mize the plot scale.)144
-554.4 R(The)5.333 E F1<ad55>2.833 E F0 .333(option allo)2.833 F .333
-(ws the user to set the plot orientation. If)-.25 F F2(orientation)2.833
-E F0 2.834(=1)2.834 G 2.834(,a)-2.834 G
-(portrait plot will be produced; if)144 566.4 Q F2(orientation)2.5 E F0
-2.5(=2)2.5 G 2.5(,al)-2.5 G(andscape plot will be produced.)-2.5 E F1
-<ad56>108 583.2 Q F0(Causes)23.08 E F1(mbm_histplot)4.463 E F0 1.963
-(to operate in "v)4.463 F 1.962
-(erbose" mode so that it outputs more information than)-.15 F(usual.)144
-595.2 Q F1<ad57>108 612 Q F2(pen)20.3 E F0 .054(Set pen attrib)144 624 R
-.054(utes for plotting. See chapter 4.12 in the GMT T)-.2 F .055
-(echnical reference for a discussion of)-.7 F(GMT pen v)144 636 Q 2.5
-(alues. [Def)-.25 F(aults: width = 1, color = 0/0/0, te)-.1 E
-(xture = solid].)-.15 E F1<ad58>108 652.8 Q F0(Normally)23.08 E(,)-.65 E
-F1(mbm_histplot)3.258 E F0 .758(creates an e)3.258 F -.15(xe)-.15 G .758
-(cutable shellscript and then e).15 F 3.257(xits. This)-.15 F .757
-(option will cause)3.257 F(the shellscript to be e)144 664.8 Q -.15(xe)
--.15 G(cuted in the background before).15 E F1(mbm_histplot)2.5 E F0
--.15(ex)2.5 G(its.).15 E/F3 10.95/Times-Bold at 0 SF(EXAMPLES)72 693.6 Q F0
-.2(Suppose we ha)108 705.6 R .5 -.15(ve a s)-.2 H .201(ingle column asc\
-ii \214le of time lag estimates called timelag.dat. In order to generat\
-e a 6).15 F
-(inch wide and 4 inches high simple histogram plot of these data, use:)
-108 717.6 Q .971(mbm_histplot \255Itimelag.dat \255Otimelaghist \255JX6\
-/4 \255V to generate a GMT plot shellscript called)144 729.6 R
-(MB-System 5.0)72 768 Q 2.5(9J)140.11 G(anuary 2015)-2.5 E(3)198.45 E 0
-Cg EP
-%%Page: 4 4
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 132.6(mbm_histplot\(1\) MB-System)72 48 R 132.6
-(5.0 mbm_histplot\(1\))2.5 F(timelaghist.cmd.)108 84 Q(As an e)108 108 Q
-(xample, the contents of the plotting shellscript "timelaghist.cmd" are\
-:)-.15 E .152(#! /bin/csh \255f # # Shellscript to create Postscript pl\
-ot of data in grd \214le # Created by macro mbm_histplot #)108 132 R
-2.69(#T)108 144 S .19(his shellscript created by follo)-2.69 F .19(wing\
- command line: # mbm_histplot \255Itimelag.dat \255Otimelaghist \255JX6\
-/4)-.25 F .003(\255V # # De\214ne shell v)108 156 R .003
-(ariables used in this script: set PS_FILE)-.25 F 2.503(=t)22.503 G .003
-(imelaghist.ps set CPT_FILE)-2.503 F 2.503(=s)20.003 G(et)-2.503 E
-(MAP_PR)108 168 Q 5.339(OJECTION =)-.4 F 5.338(Xs)5.339 G 2.838
-(et MAP_SCALE)-5.338 F 5.338(=6)20.338 G 2.838(/4 set MAP_REGION)-5.338
-F 5.338<3dad>17.838 G 2.838(0.57/0.12/0/50 set)-5.338 F 18.99
-(X_OFFSET =)108 180 R 1.49(2.5 set Y_OFFSET)3.99 F 3.991(=2)21.49 G
-1.491(.375 # # Sa)-3.991 F 1.791 -.15(ve ex)-.2 H 1.491(isting GMT def)
-.15 F 1.491(aults echo Sa)-.1 F 1.491(ving GMT)-.2 F(def)108 192 Q 3.174
-(aults... gmtdef)-.1 F .674(aults \255L >! gmtdef)-.1 F .673
-(aults$$ # # Set ne)-.1 F 3.173(wG)-.25 G .673(MT def)-3.173 F .673
-(aults echo Setting ne)-.1 F 3.173(wG)-.25 G .673(MT def)-3.173 F
-(aults...)-.1 E 1.583(gmtset MEASURE_UNIT inch gmtset P)108 204 R 1.583
-(APER_MEDIA archA+ gmtset ANO)-.92 F 1.584(T_FONT Helv)-.4 F 1.584
-(etica gmtset)-.15 F 3.884(LABEL_FONT Helv)108 216 R 3.884
-(etica gmtset HEADER_FONT Helv)-.15 F 3.884(etica gmtset ANO)-.15 F
-3.883(T_FONT_SIZE 8 gmtset)-.4 F 4.314(LABEL_FONT_SIZE 8 gmtset HEADER_\
-FONT_SIZE 10 gmtset FRAME_WIDTH 0.075 gmtset)108 228 R 1.692
-(TICK_LENGTH 0.075 gmtset P)108 240 R -.4(AG)-.92 G(E_ORIENT).4 E -1.11
-(AT)-.93 G 1.691(ION LANDSCAPE gmtset COLOR_B)1.11 F -.4(AC)-.35 G(KGR)
-.4 E(OUND)-.4 E 6.541(0/0/0 gmtset COLOR_FOREGR)108 252 R 6.541
-(OUND 255/255/255 gmtset COLOR_N)-.4 F 6.542(AN 255/255/255 gmtset)-.35
-F(DEGREE_FORMA)108 264 Q 6.35(T3##M)-1.11 G(ak)-6.35 E 6.35(eh)-.1 G
-3.85(istogram echo Running pshistogram...)-6.35 F 3.85
-(pshistogram timelag.dat)8.85 F(-J$MAP_PR)117.39 276 Q 27.066
-(OJECTION$MAP_SCALE -R$MAP_REGION)-.4 F 11.397(-B0.05:" ":/5:"Frequenc)
-39.957 F(y)-.15 E(%"::."Frequenc)108 288 Q 6.84(yH)-.15 G 4.34
-(istogram of timelag.dat":)-6.84 F 4.34(-W0.069 \255Z1)17.49 F 18.4
-(-L1p -Ggray)21.82 F(-X$X_OFFSET)12.02 E 2.698(\255Y$Y_OFFSET \255V >! \
-$PS_FILE # # Delete surplus \214les echo Deleting surplus \214les...)108
-300 R 2.699(/bin/rm \255f)7.699 F .093($CPT_FILE # # Reset GMT def)108
-312 R .092(ault fonts echo Resetting GMT fonts...)-.1 F .092
-(/bin/mv gmtdef)5.092 F .092(aults$$ .gmtdef)-.1 F(aults)-.1 E 3.017
-(##R)108 324 S .517(un gv echo Running gv in background...)-3.017 F .517
-(gv \255-orientation=landscape \255-media=BBox $PS_FILE & #)5.517 F 2.5
-(#A)108 336 S(ll done!)-2.5 E(echo All done!)5 E/F1 10.95/Times-Bold at 0
-SF(SEE ALSO)72 364.8 Q/F2 10/Times-Bold at 0 SF(mbsystem)108 376.8 Q F0
-(\(1\),)A F2(mbdefaults)2.5 E F0(\(1\),)A F2(mbm_grdplot)2.5 E F0
-(\(1\),)A F2(mbm_grd3dplot)2.5 E F0(\(1\),)A F2(mbm_plot)2.5 E F0(\(1\))
-A F1 -.11(BU)72 405.6 S(GS).11 E F0(Please let us kno)108 417.6 Q -.65
-(w.)-.25 G(MB-System 5.0)72 768 Q 2.5(9J)140.11 G(anuary 2015)-2.5 E(4)
-198.45 E 0 Cg EP
-%%Trailer
-end
-%%EOF
diff --git a/src/ps/mbm_makedatalist.ps b/src/ps/mbm_makedatalist.ps
deleted file mode 100644
index 676693c..0000000
--- a/src/ps/mbm_makedatalist.ps
+++ /dev/null
@@ -1,306 +0,0 @@
-%!PS-Adobe-3.0
-%%Creator: groff version 1.19.2
-%%CreationDate: Wed Jul  1 12:29:29 2015
-%%DocumentNeededResources: font Times-Roman
-%%+ font Times-Bold
-%%+ font Times-Italic
-%%DocumentSuppliedResources: procset grops 1.19 2
-%%Pages: 2
-%%PageOrder: Ascend
-%%DocumentMedia: Default 612 792 0 () ()
-%%Orientation: Portrait
-%%EndComments
-%%BeginDefaults
-%%PageMedia: Default
-%%EndDefaults
-%%BeginProlog
-%%BeginResource: procset grops 1.19 2
-%!PS-Adobe-3.0 Resource-ProcSet
-/setpacking where{
-pop
-currentpacking
-true setpacking
-}if
-/grops 120 dict dup begin
-/SC 32 def
-/A/show load def
-/B{0 SC 3 -1 roll widthshow}bind def
-/C{0 exch ashow}bind def
-/D{0 exch 0 SC 5 2 roll awidthshow}bind def
-/E{0 rmoveto show}bind def
-/F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def
-/G{0 rmoveto 0 exch ashow}bind def
-/H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/I{0 exch rmoveto show}bind def
-/J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def
-/K{0 exch rmoveto 0 exch ashow}bind def
-/L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/M{rmoveto show}bind def
-/N{rmoveto 0 SC 3 -1 roll widthshow}bind def
-/O{rmoveto 0 exch ashow}bind def
-/P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/Q{moveto show}bind def
-/R{moveto 0 SC 3 -1 roll widthshow}bind def
-/S{moveto 0 exch ashow}bind def
-/T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/SF{
-findfont exch
-[exch dup 0 exch 0 exch neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/MF{
-findfont
-[5 2 roll
-0 3 1 roll
-neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/level0 0 def
-/RES 0 def
-/PL 0 def
-/LS 0 def
-/MANUAL{
-statusdict begin/manualfeed true store end
-}bind def
-/PLG{
-gsave newpath clippath pathbbox grestore
-exch pop add exch pop
-}bind def
-/BP{
-/level0 save def
-1 setlinecap
-1 setlinejoin
-72 RES div dup scale
-LS{
-90 rotate
-}{
-0 PL translate
-}ifelse
-1 -1 scale
-}bind def
-/EP{
-level0 restore
-showpage
-}def
-/DA{
-newpath arcn stroke
-}bind def
-/SN{
-transform
-.25 sub exch .25 sub exch
-round .25 add exch round .25 add exch
-itransform
-}bind def
-/DL{
-SN
-moveto
-SN
-lineto stroke
-}bind def
-/DC{
-newpath 0 360 arc closepath
-}bind def
-/TM matrix def
-/DE{
-TM currentmatrix pop
-translate scale newpath 0 0 .5 0 360 arc closepath
-TM setmatrix
-}bind def
-/RC/rcurveto load def
-/RL/rlineto load def
-/ST/stroke load def
-/MT/moveto load def
-/CL/closepath load def
-/Fr{
-setrgbcolor fill
-}bind def
-/setcmykcolor where{
-pop
-/Fk{
-setcmykcolor fill
-}bind def
-}if
-/Fg{
-setgray fill
-}bind def
-/FL/fill load def
-/LW/setlinewidth load def
-/Cr/setrgbcolor load def
-/setcmykcolor where{
-pop
-/Ck/setcmykcolor load def
-}if
-/Cg/setgray load def
-/RE{
-findfont
-dup maxlength 1 index/FontName known not{1 add}if dict begin
-{
-1 index/FID ne{def}{pop pop}ifelse
-}forall
-/Encoding exch def
-dup/FontName exch def
-currentdict end definefont pop
-}bind def
-/DEFS 0 def
-/EBEGIN{
-moveto
-DEFS begin
-}bind def
-/EEND/end load def
-/CNT 0 def
-/level1 0 def
-/PBEGIN{
-/level1 save def
-translate
-div 3 1 roll div exch scale
-neg exch neg exch translate
-0 setgray
-0 setlinecap
-1 setlinewidth
-0 setlinejoin
-10 setmiterlimit
-[]0 setdash
-/setstrokeadjust where{
-pop
-false setstrokeadjust
-}if
-/setoverprint where{
-pop
-false setoverprint
-}if
-newpath
-/CNT countdictstack def
-userdict begin
-/showpage{}def
-/setpagedevice{}def
-}bind def
-/PEND{
-countdictstack CNT sub{end}repeat
-level1 restore
-}bind def
-end def
-/setpacking where{
-pop
-setpacking
-}if
-%%EndResource
-%%EndProlog
-%%BeginSetup
-%%BeginFeature: *PageSize Default
-<< /PageSize [ 612 792 ] /ImagingBBox null >> setpagedevice
-%%EndFeature
-%%IncludeResource: font Times-Roman
-%%IncludeResource: font Times-Bold
-%%IncludeResource: font Times-Italic
-grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72
-def/PL 792 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron/Zcaron
-/scaron/zcaron/Ydieresis/trademark/quotesingle/Euro/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/space/exclam/quotedbl/numbersign/dollar/percent
-/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen
-/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon
-/semicolon/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O
-/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright/circumflex
-/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y
-/z/braceleft/bar/braceright/tilde/.notdef/quotesinglbase/guillemotleft
-/guillemotright/bullet/florin/fraction/perthousand/dagger/daggerdbl
-/endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut
-/dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash
-/quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen
-/brokenbar/section/dieresis/copyright/ordfeminine/guilsinglleft
-/logicalnot/minus/registered/macron/degree/plusminus/twosuperior
-/threesuperior/acute/mu/paragraph/periodcentered/cedilla/onesuperior
-/ordmasculine/guilsinglright/onequarter/onehalf/threequarters
-/questiondown/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE
-/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex
-/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis
-/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn
-/germandbls/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla
-/egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis
-/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide/oslash
-/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis]def
-/Times-Italic at 0 ENC0/Times-Italic RE/Times-Bold at 0 ENC0/Times-Bold RE
-/Times-Roman at 0 ENC0/Times-Roman RE
-%%EndSetup
-%%Page: 1 1
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mbm_mak)72 48 Q 112.16(edatalist\(1\) MB-System)
--.1 F 112.16(5.0 mbm_mak)2.5 F(edatalist\(1\))-.1 E/F1 10.95
-/Times-Bold at 0 SF -.219(NA)72 84 S(ME).219 E/F2 10/Times-Bold at 0 SF
-(mbm_mak)108 96 Q(edatalist)-.1 E F0 2.5<ad4d>2.5 G
-(acro to generate a datalist of the sw)-2.5 E
-(ath \214les in a speci\214ed directory)-.1 E(.)-.65 E F1(VERSION)72
-124.8 Q F0 -1.11(Ve)108 136.8 S(rsion 5.0)1.11 E F1(SYNOPSIS)72 165.6 Q
-F2(mbm_mak)108 177.6 Q(edatalist)-.1 E F0([)2.5 E F2<ad49>A/F3 10
-/Times-Italic at 0 SF(dir)A(ectory)-.37 E F2<ad4f>2.5 E F3(datalist)A F2
-<ad4820ad56>2.5 E F0(])A F1(DESCRIPTION)72 206.4 Q F2(Mbm_mak)108 218.4
-Q(edatalist)-.1 E F0 1.178(is a macro to generate an MB-System datalist\
- \214le referencing all identi\214able sw)3.678 F(ath)-.1 E
-(\214les in the speci\214ed tar)108 230.4 Q(get directory)-.18 E(.)-.65
-E 1.581(The output datalist will be placed in the current w)108 254.4 R
-1.581(orking directory)-.1 F 4.081(.T)-.65 G 1.582
-(he output datalist is named datal-)-4.081 F .454(ist.mb-1 by def)108
-266.4 R .454(ault, b)-.1 F .454(ut can be speci\214ed with the)-.2 F F2
-<ad4f>2.954 E F0 2.954(option. If)2.954 F .454(no tar)2.954 F .453
-(get directory is speci\214ed with the)-.18 F F2<ad49>2.953 E F0 .311
-(option, then the current w)108 278.4 R .312
-(orking directory is used. In order for sw)-.1 F .312
-(ath \214les to be recognized and included in)-.1 F .115
-(the datalist, the)108 290.4 R 2.615(ym)-.15 G .115
-(ust conform to the MB-System sw)-2.615 F .115(ath \214le naming con)-.1
-F -.15(ve)-.4 G .114(ntion \(see the).15 F F2(mbsystem)2.614 E F0
-(manual)2.614 E(page for details\).)108 302.4 Q F1 -.548(AU)72 331.2 S
-(THORSHIP).548 E F0(Da)108 343.2 Q(vid W)-.2 E 2.5(.C)-.92 G
-(aress \(caress at mbari.or)-2.5 E(g\))-.18 E(Montere)113 355.2 Q 2.5(yB)
--.15 G(ay Aquarium Research Institute)-2.5 E
-(Dale N. Chayes \(dale at ldeo.columbia.edu\))108 367.2 Q
-(Lamont-Doherty Earth Observ)113 379.2 Q(atory)-.25 E F1(OPTIONS)72 408
-Q F2<ad48>108 420 Q F0 .162(This "help" \215ag cause the program to pri\
-nt out a description of its operation and then e)22.52 F .162
-(xit immedi-)-.15 F(ately)144 432 Q(.)-.65 E F2<ad49>108 448.8 Q F3(dir)
-26.41 E(ectory)-.37 E F0(Sets the path of the tar)144 460.8 Q
-(get directory)-.18 E(.)-.65 E F2<ad4f>108 477.6 Q F3(datalist)22.52 E
-F0(Sets the name of the output datalist \214le. Def)144 489.6 Q
-(ault: datalist.mb-1)-.1 E F2<ad56>108 506.4 Q F0(The)23.08 E F2<ad56>
-2.5 E F0(option causes)2.5 E F2(mbm_mak)2.5 E(edatalist)-.1 E F0
-(to print out status messages.)2.5 E F1(EXAMPLES)72 535.2 Q F0 .937
-(Suppose we ha)108 547.2 R 1.237 -.15(ve a s)-.2 H .937(et of sw).15 F
-.937(ath \214les in a directory and we w)-.1 F .937
-(ant to construct a datalist referring to those)-.1 F
-(\214les. A simple directory listing sho)108 559.2 Q(ws four \214les:)
--.25 E(20051019_154030.mb88)144 571.2 Q(20051019_162540.mb88)144 583.2 Q
-(20051019_171756.mb88)144 595.2 Q(junk.txt)144 607.2 Q .196
-(of which three are identi\214able as sw)108 619.2 R .197
-(ath \214les because of the ".mb88" \214le suf)-.1 F .197
-(\214x. Running)-.25 F F2(mbm_mak)2.697 E(edatal-)-.1 E(ist)108 631.2 Q
-F0(in this directory with no ar)2.5 E(guments other than v)-.18 E
-(erbosity:)-.15 E(mbm_mak)144 643.2 Q(edatalist \255V)-.1 E(produces a \
-datalist \214le named datalist.mb-1. The contents of this \214le are:)
-108 655.2 Q(./20051019_154030.mb88 88)144 667.2 Q
-(./20051019_162540.mb88 88)144 679.2 Q(./20051019_171756.mb88 88)144
-691.2 Q(where the \214le junk.txt has been ignored.)108 703.2 Q
-(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(1)204.835 E 0
-Cg EP
-%%Page: 2 2
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mbm_mak)72 48 Q 112.16(edatalist\(1\) MB-System)
--.1 F 112.16(5.0 mbm_mak)2.5 F(edatalist\(1\))-.1 E/F1 10.95
-/Times-Bold at 0 SF(SEE ALSO)72 84 Q/F2 10/Times-Bold at 0 SF(mbsystem)108 96
-Q F0(\(1\),)A F2(mbdatalist)2.5 E F0(\(1\),)A F2(mbinf)2.5 E(o)-.25 E F0
-(\(1\))A F1 -.11(BU)72 124.8 S(GS).11 E F0 2(This macro doesn')108 136.8
-R 4.5(ty)-.18 G 2(et recognize when one sw)-4.5 F 1.999(ath \214le deri)
--.1 F -.15(ve)-.25 G 4.499(sf).15 G 1.999
-(rom another \(e.g. line1p.mb57 can be)-4.499 F
-(inferred to be a processed v)108 148.8 Q(ersion of line1.mb57\).)-.15 E
-(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(2)204.835 E 0
-Cg EP
-%%Trailer
-end
-%%EOF
diff --git a/src/ps/mbm_makesvp.ps b/src/ps/mbm_makesvp.ps
deleted file mode 100644
index 421fca8..0000000
--- a/src/ps/mbm_makesvp.ps
+++ /dev/null
@@ -1,350 +0,0 @@
-%!PS-Adobe-3.0
-%%Creator: groff version 1.19.2
-%%CreationDate: Wed Jul  1 12:29:29 2015
-%%DocumentNeededResources: font Times-Roman
-%%+ font Times-Bold
-%%+ font Times-Italic
-%%DocumentSuppliedResources: procset grops 1.19 2
-%%Pages: 2
-%%PageOrder: Ascend
-%%DocumentMedia: Default 612 792 0 () ()
-%%Orientation: Portrait
-%%EndComments
-%%BeginDefaults
-%%PageMedia: Default
-%%EndDefaults
-%%BeginProlog
-%%BeginResource: procset grops 1.19 2
-%!PS-Adobe-3.0 Resource-ProcSet
-/setpacking where{
-pop
-currentpacking
-true setpacking
-}if
-/grops 120 dict dup begin
-/SC 32 def
-/A/show load def
-/B{0 SC 3 -1 roll widthshow}bind def
-/C{0 exch ashow}bind def
-/D{0 exch 0 SC 5 2 roll awidthshow}bind def
-/E{0 rmoveto show}bind def
-/F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def
-/G{0 rmoveto 0 exch ashow}bind def
-/H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/I{0 exch rmoveto show}bind def
-/J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def
-/K{0 exch rmoveto 0 exch ashow}bind def
-/L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/M{rmoveto show}bind def
-/N{rmoveto 0 SC 3 -1 roll widthshow}bind def
-/O{rmoveto 0 exch ashow}bind def
-/P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/Q{moveto show}bind def
-/R{moveto 0 SC 3 -1 roll widthshow}bind def
-/S{moveto 0 exch ashow}bind def
-/T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/SF{
-findfont exch
-[exch dup 0 exch 0 exch neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/MF{
-findfont
-[5 2 roll
-0 3 1 roll
-neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/level0 0 def
-/RES 0 def
-/PL 0 def
-/LS 0 def
-/MANUAL{
-statusdict begin/manualfeed true store end
-}bind def
-/PLG{
-gsave newpath clippath pathbbox grestore
-exch pop add exch pop
-}bind def
-/BP{
-/level0 save def
-1 setlinecap
-1 setlinejoin
-72 RES div dup scale
-LS{
-90 rotate
-}{
-0 PL translate
-}ifelse
-1 -1 scale
-}bind def
-/EP{
-level0 restore
-showpage
-}def
-/DA{
-newpath arcn stroke
-}bind def
-/SN{
-transform
-.25 sub exch .25 sub exch
-round .25 add exch round .25 add exch
-itransform
-}bind def
-/DL{
-SN
-moveto
-SN
-lineto stroke
-}bind def
-/DC{
-newpath 0 360 arc closepath
-}bind def
-/TM matrix def
-/DE{
-TM currentmatrix pop
-translate scale newpath 0 0 .5 0 360 arc closepath
-TM setmatrix
-}bind def
-/RC/rcurveto load def
-/RL/rlineto load def
-/ST/stroke load def
-/MT/moveto load def
-/CL/closepath load def
-/Fr{
-setrgbcolor fill
-}bind def
-/setcmykcolor where{
-pop
-/Fk{
-setcmykcolor fill
-}bind def
-}if
-/Fg{
-setgray fill
-}bind def
-/FL/fill load def
-/LW/setlinewidth load def
-/Cr/setrgbcolor load def
-/setcmykcolor where{
-pop
-/Ck/setcmykcolor load def
-}if
-/Cg/setgray load def
-/RE{
-findfont
-dup maxlength 1 index/FontName known not{1 add}if dict begin
-{
-1 index/FID ne{def}{pop pop}ifelse
-}forall
-/Encoding exch def
-dup/FontName exch def
-currentdict end definefont pop
-}bind def
-/DEFS 0 def
-/EBEGIN{
-moveto
-DEFS begin
-}bind def
-/EEND/end load def
-/CNT 0 def
-/level1 0 def
-/PBEGIN{
-/level1 save def
-translate
-div 3 1 roll div exch scale
-neg exch neg exch translate
-0 setgray
-0 setlinecap
-1 setlinewidth
-0 setlinejoin
-10 setmiterlimit
-[]0 setdash
-/setstrokeadjust where{
-pop
-false setstrokeadjust
-}if
-/setoverprint where{
-pop
-false setoverprint
-}if
-newpath
-/CNT countdictstack def
-userdict begin
-/showpage{}def
-/setpagedevice{}def
-}bind def
-/PEND{
-countdictstack CNT sub{end}repeat
-level1 restore
-}bind def
-end def
-/setpacking where{
-pop
-setpacking
-}if
-%%EndResource
-%%EndProlog
-%%BeginSetup
-%%BeginFeature: *PageSize Default
-<< /PageSize [ 612 792 ] /ImagingBBox null >> setpagedevice
-%%EndFeature
-%%IncludeResource: font Times-Roman
-%%IncludeResource: font Times-Bold
-%%IncludeResource: font Times-Italic
-grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72
-def/PL 792 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron/Zcaron
-/scaron/zcaron/Ydieresis/trademark/quotesingle/Euro/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/space/exclam/quotedbl/numbersign/dollar/percent
-/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen
-/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon
-/semicolon/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O
-/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright/circumflex
-/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y
-/z/braceleft/bar/braceright/tilde/.notdef/quotesinglbase/guillemotleft
-/guillemotright/bullet/florin/fraction/perthousand/dagger/daggerdbl
-/endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut
-/dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash
-/quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen
-/brokenbar/section/dieresis/copyright/ordfeminine/guilsinglleft
-/logicalnot/minus/registered/macron/degree/plusminus/twosuperior
-/threesuperior/acute/mu/paragraph/periodcentered/cedilla/onesuperior
-/ordmasculine/guilsinglright/onequarter/onehalf/threequarters
-/questiondown/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE
-/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex
-/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis
-/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn
-/germandbls/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla
-/egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis
-/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide/oslash
-/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis]def
-/Times-Italic at 0 ENC0/Times-Italic RE/Times-Bold at 0 ENC0/Times-Bold RE
-/Times-Roman at 0 ENC0/Times-Roman RE
-%%EndSetup
-%%Page: 1 1
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mbm_mak)72 48 Q 127.16(esvp\(1\) MB-System)-.1 F
-127.16(5.0 mbm_mak)2.5 F(esvp\(1\))-.1 E/F1 10.95/Times-Bold at 0 SF -.219
-(NA)72 84 S(ME).219 E/F2 10/Times-Bold at 0 SF(mbm_mak)108 96 Q(esvp)-.1 E
-F0 2.867<ad4d>2.867 G .367(acro to e)-2.867 F .366
-(xtract sound speed and depth data from a datalist of sw)-.15 F .366
-(ath \214les, and generate)-.1 F 2.5(as)108 108 S(ound v)-2.5 E
-(elocity pro\214le model from a)-.15 E -.15(ve)-.2 G
-(rages of the sound speed v).15 E(alues in re)-.25 E
-(gular depth ranges.)-.15 E F1(VERSION)72 136.8 Q F0 -1.11(Ve)108 148.8
-S(rsion 5.0)1.11 E F1(SYNOPSIS)72 177.6 Q F2(mbm_mak)108 189.6 Q
-(esvp \255I)-.1 E/F3 10/Times-Italic at 0 SF(input\214le)A F0([)2.5 E F2
-<ad4820ad5620ad44>A F3(depthinterval)A F2<ad4f>2.5 E F3(output\214le)A
-F0(])A F1(DESCRIPTION)72 218.4 Q F2(mbm_mak)108 230.4 Q(esvp)-.1 E F0
-.439(is a macro to e)2.938 F .439
-(xtract sound speed and depth data from a datalist of sw)-.15 F .439
-(ath \214les, and gener)-.1 F(-)-.2 E(ate a sound v)108 242.4 Q
-(elocity pro\214le model from a)-.15 E -.15(ve)-.2 G
-(rages of the sound speed v).15 E(alues in re)-.25 E
-(gular depth ranges.)-.15 E .625(This macro uses)108 266.4 R F2
-(mbctdlist)3.124 E F0 .624(to e)3.124 F .624(xtract the sound speed v)
--.15 F .624(alues embedded in sw)-.25 F .624(ath data \214les.)-.1 F
-.624(This macro is)5.624 F 1.191
-(intended for use with mapping data from submer)108 278.4 R 1.191
-(ged platforms \(e.g. R)-.18 F -.5(OV)-.4 G 3.692(sa).5 G 1.192(nd A)
--3.692 F 1.192(UVs\) carrying CTD or)-.55 F .741
-(sound speed sensors. Since the sound speed v)108 290.4 R .74
-(alues are generally recorded during the entire R)-.25 F 1.74 -.5(OV o)
--.4 H 3.24(rA).5 G(UV)-3.79 E(surv)108 302.4 Q -.15(ey)-.15 G 3.082(,t)
--.5 G .582(hese v)-3.082 F .582(alues can be used to construct a model \
-for sound speed as a function of depth at the surv)-.25 F -.15(ey)-.15 G
-2.679(location. The)108 314.4 R .179(sound speed and sonar depth v)2.679
-F .179(alue pairs are binned according to the)-.25 F F3(depthinterval)
-2.678 E F0 -.25(va)2.678 G .178(lue, and).25 F -2.25 -.2(av e)108 326.4
-T .494(rage sound speed v).2 F .494
-(alues are reported for bins with at least one v)-.25 F 2.995(alue. The)
--.25 F F2<ad4f>2.995 E F0 .495(option speci\214es the out-)2.995 F
-(put \214lename; by def)108 338.4 Q
-(ault the model is output to the stdout stream.)-.1 E F1 -.548(AU)72
-367.2 S(THORSHIP).548 E F0(Da)108 379.2 Q(vid W)-.2 E 2.5(.C)-.92 G
-(aress \(caress at mbari.or)-2.5 E(g\))-.18 E(Montere)113 391.2 Q 2.5(yB)
--.15 G(ay Aquarium Research Institute)-2.5 E
-(Dale N. Chayes \(dale at ldeo.columbia.edu\))108 403.2 Q
-(Lamont-Doherty Earth Observ)113 415.2 Q(atory)-.25 E F1(OPTIONS)72 444
-Q F2<ad44>108 456 Q F3(depthinterval)23.08 E F0 1.122
-(Sets the size in meters of the depth bins used to calculate an a)144
-468 R -.15(ve)-.2 G 1.121(rage sound speed v).15 F 1.121(ersus depth)
--.15 F(model. The def)144 480 Q(ault v)-.1 E(alue is 25 meters.)-.25 E
-F2<ad46>108 496.8 Q F3(format)24.19 E F0 1.358
-(Sets the data format for the input data.)144 508.8 R(If)6.358 E F3
-(format)3.858 E F0 3.858(<0)3.858 G 3.858(,t)-3.858 G 1.358
-(hen the input \214le speci\214ed with the)-3.858 F F2<ad49>3.858 E F0
-1.164(option will actually contain a list of input sw)144 520.8 R 1.164
-(ath sonar data \214les. This program uses the)-.1 F F2(MBIO)3.663 E F0
-1.291(library and will read or write an)144 532.8 R 3.792(ys)-.15 G -.1
-(wa)-3.792 G 1.292(th sonar format supported by).1 F F2(MBIO)3.792 E F0
-3.792(.Al)C 1.292(ist of the sw)-3.792 F(ath)-.1 E .391
-(sonar data formats currently supported by)144 544.8 R F2(MBIO)2.891 E
-F0 .391(and their identi\214er v)2.891 F .39(alues is gi)-.25 F -.15(ve)
--.25 G 2.89(ni).15 G 2.89(nt)-2.89 G(he)-2.89 E F2(MBIO)2.89 E F0
-(manual page. Def)144 556.8 Q(ault:)-.1 E F3(format)2.5 E F0 2.5<3dad>
-2.5 G(1.)-2.5 E F2<ad48>108 573.6 Q F0 .162(This "help" \215ag cause th\
-e program to print out a description of its operation and then e)22.52 F
-.162(xit immedi-)-.15 F(ately)144 585.6 Q(.)-.65 E F2<ad49>108 602.4 Q
-F3(input\214le)26.41 E F0 .468(Sets the input \214lename. If)144 614.4 R
-F3(format)2.967 E F0 2.967(>0\()2.967 G .467(set with the)-2.967 F F2
-<ad66>2.967 E F0 .467(option\) then the sw)2.967 F .467
-(ath sonar data contained)-.1 F(in)144 626.4 Q F3(in\214le)2.942 E F0
-.442(is read and processed. If)2.942 F F3(format)2.942 E F0 2.942(<0\()
-2.942 G .443(the def)-2.942 F .443(ault\), then)-.1 F F3(in\214le)2.943
-E F0 .443(is assumed to be an ascii \214le)2.943 F .052
-(containing a list of the input sw)144 638.4 R .052
-(ath sonar data \214les to be processed and their formats.)-.1 F .051
-(The program)5.051 F .42
-(will read the data in each one of these \214les.)144 650.4 R .42
-(In the)5.42 F F3(input\214le)2.92 E F0 .42
-(\214le, each data \214le should be follo)2.92 F(wed)-.25 E
-(by a data format identi\214er)144 662.4 Q 2.5(,e)-.4 G(.g.:)-2.5 E
-(data\214le1 11)180 674.4 Q(data\214le2 24)180 686.4 Q .68
-(This program uses the)144 698.4 R F2(MBIO)3.18 E F0 .679
-(library and will read an)3.18 F 3.179(ys)-.15 G -.1(wa)-3.179 G .679
-(th sonar format supported by).1 F F2(MBIO)3.179 E F0(.)A(Ho)144 710.4 Q
-(we)-.25 E -.15(ve)-.25 G 1.255 -.4(r, n).15 H .455(ot all formats cont\
-ain sound speed or CTD information, and useful results can only be).4 F
--.15(ex)144 722.4 S .75(pected from data actually including the rele).15
-F -.25(va)-.25 G .749(nt v).25 F 3.249(alues. A)-.25 F .749
-(list of the sw)3.249 F .749(ath sonar data formats)-.1 F(MB-System 5.0)
-72 768 Q(13 October 2013)137.055 E(1)195.395 E 0 Cg EP
-%%Page: 2 2
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mbm_mak)72 48 Q 127.16(esvp\(1\) MB-System)-.1 F
-127.16(5.0 mbm_mak)2.5 F(esvp\(1\))-.1 E .557(currently supported by)144
-84 R/F1 10/Times-Bold at 0 SF(MBIO)3.057 E F0 .557
-(and their identi\214er v)3.057 F .557(alues is gi)-.25 F -.15(ve)-.25 G
-3.057(ni).15 G 3.058(nt)-3.057 G(he)-3.058 E F1(MBIO)3.058 E F0 .558
-(manual page. The)3.058 F(def)144 96 Q
-(ault input \214lename is "datalist.mb-1".)-.1 E F1<ad4f>108 112.8 Q/F2
-10/Times-Italic at 0 SF(output)22.52 E F0 .565
-(Sets the name of the output \214le for the sound speed v)144 124.8 R
-.565(ersus depth model. By def)-.15 F .565(ault, the model is)-.1 F
-(output to the stdout stream.)144 136.8 Q F1<ad56>108 153.6 Q F0(The)
-23.08 E F1<ad56>2.5 E F0(option causes)2.5 E F1(mbm_mak)2.5 E(esvp)-.1 E
-F0(to print out status messages.)2.5 E/F3 10.95/Times-Bold at 0 SF
-(EXAMPLES)72 182.4 Q F0 .252(Suppose we ha)108 194.4 R .552 -.15(ve a s)
--.2 H .252(et of sw).15 F .252(ath \214les from an A)-.1 F(UV)-.55 E
-.253(-based surv)-1 F .553 -.15(ey i)-.15 H 2.753(nad).15 G .253
-(irectory and we w)-2.753 F .253(ant to construct an)-.1 F -2.25 -.2
-(av e)108 206.4 T(rage sound speed v).2 E
-(ersus depth model from these data. The command:)-.15 E(mbm_mak)144
-218.4 Q 1.498(esvp -Idatalist.mb-1 -D25 -Osvp.txt -V will generate a mo\
-del of sound speed v)-.1 F(ersus)-.15 E
-(depth in the output \214le "svp.txt".)108 230.4 Q F3(SEE ALSO)72 259.2
-Q F1(mbsystem)108 271.2 Q F0(\(1\),)A F1(mbctdlist)2.5 E F0(\(1\))A F3
--.11(BU)72 300 S(GS).11 E F0(Lik)108 312 Q(ely yes.)-.1 E(MB-System 5.0)
-72 768 Q(13 October 2013)137.055 E(2)195.395 E 0 Cg EP
-%%Trailer
-end
-%%EOF
diff --git a/src/ps/mbm_multicopy.ps b/src/ps/mbm_multicopy.ps
deleted file mode 100644
index b69526a..0000000
--- a/src/ps/mbm_multicopy.ps
+++ /dev/null
@@ -1,392 +0,0 @@
-%!PS-Adobe-3.0
-%%Creator: groff version 1.19.2
-%%CreationDate: Wed Jul  1 12:29:29 2015
-%%DocumentNeededResources: font Times-Roman
-%%+ font Times-Bold
-%%+ font Times-Italic
-%%DocumentSuppliedResources: procset grops 1.19 2
-%%Pages: 3
-%%PageOrder: Ascend
-%%DocumentMedia: Default 612 792 0 () ()
-%%Orientation: Portrait
-%%EndComments
-%%BeginDefaults
-%%PageMedia: Default
-%%EndDefaults
-%%BeginProlog
-%%BeginResource: procset grops 1.19 2
-%!PS-Adobe-3.0 Resource-ProcSet
-/setpacking where{
-pop
-currentpacking
-true setpacking
-}if
-/grops 120 dict dup begin
-/SC 32 def
-/A/show load def
-/B{0 SC 3 -1 roll widthshow}bind def
-/C{0 exch ashow}bind def
-/D{0 exch 0 SC 5 2 roll awidthshow}bind def
-/E{0 rmoveto show}bind def
-/F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def
-/G{0 rmoveto 0 exch ashow}bind def
-/H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/I{0 exch rmoveto show}bind def
-/J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def
-/K{0 exch rmoveto 0 exch ashow}bind def
-/L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/M{rmoveto show}bind def
-/N{rmoveto 0 SC 3 -1 roll widthshow}bind def
-/O{rmoveto 0 exch ashow}bind def
-/P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/Q{moveto show}bind def
-/R{moveto 0 SC 3 -1 roll widthshow}bind def
-/S{moveto 0 exch ashow}bind def
-/T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/SF{
-findfont exch
-[exch dup 0 exch 0 exch neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/MF{
-findfont
-[5 2 roll
-0 3 1 roll
-neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/level0 0 def
-/RES 0 def
-/PL 0 def
-/LS 0 def
-/MANUAL{
-statusdict begin/manualfeed true store end
-}bind def
-/PLG{
-gsave newpath clippath pathbbox grestore
-exch pop add exch pop
-}bind def
-/BP{
-/level0 save def
-1 setlinecap
-1 setlinejoin
-72 RES div dup scale
-LS{
-90 rotate
-}{
-0 PL translate
-}ifelse
-1 -1 scale
-}bind def
-/EP{
-level0 restore
-showpage
-}def
-/DA{
-newpath arcn stroke
-}bind def
-/SN{
-transform
-.25 sub exch .25 sub exch
-round .25 add exch round .25 add exch
-itransform
-}bind def
-/DL{
-SN
-moveto
-SN
-lineto stroke
-}bind def
-/DC{
-newpath 0 360 arc closepath
-}bind def
-/TM matrix def
-/DE{
-TM currentmatrix pop
-translate scale newpath 0 0 .5 0 360 arc closepath
-TM setmatrix
-}bind def
-/RC/rcurveto load def
-/RL/rlineto load def
-/ST/stroke load def
-/MT/moveto load def
-/CL/closepath load def
-/Fr{
-setrgbcolor fill
-}bind def
-/setcmykcolor where{
-pop
-/Fk{
-setcmykcolor fill
-}bind def
-}if
-/Fg{
-setgray fill
-}bind def
-/FL/fill load def
-/LW/setlinewidth load def
-/Cr/setrgbcolor load def
-/setcmykcolor where{
-pop
-/Ck/setcmykcolor load def
-}if
-/Cg/setgray load def
-/RE{
-findfont
-dup maxlength 1 index/FontName known not{1 add}if dict begin
-{
-1 index/FID ne{def}{pop pop}ifelse
-}forall
-/Encoding exch def
-dup/FontName exch def
-currentdict end definefont pop
-}bind def
-/DEFS 0 def
-/EBEGIN{
-moveto
-DEFS begin
-}bind def
-/EEND/end load def
-/CNT 0 def
-/level1 0 def
-/PBEGIN{
-/level1 save def
-translate
-div 3 1 roll div exch scale
-neg exch neg exch translate
-0 setgray
-0 setlinecap
-1 setlinewidth
-0 setlinejoin
-10 setmiterlimit
-[]0 setdash
-/setstrokeadjust where{
-pop
-false setstrokeadjust
-}if
-/setoverprint where{
-pop
-false setoverprint
-}if
-newpath
-/CNT countdictstack def
-userdict begin
-/showpage{}def
-/setpagedevice{}def
-}bind def
-/PEND{
-countdictstack CNT sub{end}repeat
-level1 restore
-}bind def
-end def
-/setpacking where{
-pop
-setpacking
-}if
-%%EndResource
-%%EndProlog
-%%BeginSetup
-%%BeginFeature: *PageSize Default
-<< /PageSize [ 612 792 ] /ImagingBBox null >> setpagedevice
-%%EndFeature
-%%IncludeResource: font Times-Roman
-%%IncludeResource: font Times-Bold
-%%IncludeResource: font Times-Italic
-grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72
-def/PL 792 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron/Zcaron
-/scaron/zcaron/Ydieresis/trademark/quotesingle/Euro/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/space/exclam/quotedbl/numbersign/dollar/percent
-/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen
-/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon
-/semicolon/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O
-/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright/circumflex
-/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y
-/z/braceleft/bar/braceright/tilde/.notdef/quotesinglbase/guillemotleft
-/guillemotright/bullet/florin/fraction/perthousand/dagger/daggerdbl
-/endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut
-/dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash
-/quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen
-/brokenbar/section/dieresis/copyright/ordfeminine/guilsinglleft
-/logicalnot/minus/registered/macron/degree/plusminus/twosuperior
-/threesuperior/acute/mu/paragraph/periodcentered/cedilla/onesuperior
-/ordmasculine/guilsinglright/onequarter/onehalf/threequarters
-/questiondown/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE
-/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex
-/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis
-/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn
-/germandbls/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla
-/egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis
-/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide/oslash
-/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis]def
-/Times-Italic at 0 ENC0/Times-Italic RE/Times-Bold at 0 ENC0/Times-Bold RE
-/Times-Roman at 0 ENC0/Times-Roman RE
-%%EndSetup
-%%Page: 1 1
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mbm_multicop)72 48 Q 122.15(y\(1\) MB-System)-.1
-F 122.15(5.0 mbm_multicop)2.5 F(y\(1\))-.1 E/F1 10.95/Times-Bold at 0 SF
--.219(NA)72 84 S(ME).219 E/F2 10/Times-Bold at 0 SF(mbm_multicopy)108 96 Q
-F0 3.898<ad41>3.898 G 1.398(pply mbcop)-3.898 F 3.898(yt)-.1 G 3.898(oa)
--3.898 G 1.398
-(ll \214les referenced through a datalist using parallel processes. As)
--3.898 F(with mbm_cop)108 108 Q 1.3 -.65(y, t)-.1 H
-(he MB-System \214le suf).65 E(\214x con)-.25 E -.15(ve)-.4 G
-(ntion is used to name the output \214les.).15 E F1(VERSION)72 136.8 Q
-F0 -1.11(Ve)108 148.8 S(rsion 5.0)1.11 E F1(SYNOPSIS)72 177.6 Q F2
-(mbm_multicopy \255F)108 189.6 Q/F3 10/Times-Italic at 0 SF(outputformat)A
-F2<ad49>2.5 E F3(datalist)A F0([)2.5 E F2<ad4820ad4320ad5420ad5620ad58>A
-F3(npr)A(ocesses)-.45 E F0(])A F1(DESCRIPTION)72 218.4 Q F2
-(mbm_multicopy)108 230.4 Q F0 .074(is a macro used to cop)2.574 F 2.574
-(yl)-.1 G(ar)-2.574 E .074(ge numbers of sw)-.18 F .075
-(ath data \214les from one data format to another)-.1 F .982
-(using the program)108 242.4 R F2(mbcopy)3.482 E F0 5.981(.T)C .981
-(his macro is the same as)-5.981 F F2(mbm_copy)3.481 E F0 -.15(ex)3.481
-G .981(cept that it can e).15 F -.15(xe)-.15 G .981(cute more than).15 F
-(one instance of)108 254.4 Q F2(mbcopy)2.5 E F0(simultaneously)2.5 E(.)
--.65 E .449(The input is a datalist \214le referencing all of the tar)
-108 278.4 R .45(get sw)-.18 F .45(ath \214les. The output sw)-.1 F .45
-(ath \214le format is speci\214ed)-.1 F .108(with the)108 290.4 R F2
-<ad46>2.608 E F0 .108(option. If the output sw)2.608 F .107(ath \214le \
-format is not speci\214ed, the output format will be the same as the)-.1
-F(input format.)108 302.4 Q .846
-(The macro identi\214es a \214lename root for each input sw)108 326.4 R
-.846(ath \214le. F)-.1 F .847(or \214les with recognized \214lename suf)
--.15 F<8c78>-.25 E(es)-.15 E .194(\(e.g. ".mb61" for a format 61 \214le\
-\), the \214lename root is the part of the \214lename that comes before\
- the suf)108 338.4 R(\214x.)-.25 E -.15(Fo)108 350.4 S 3.082<728c>.15 G
-.582(les without a recognized suf)-3.082 F .582
-(\214x, the \214lename root is the entire \214lename.)-.25 F .582
-(So, for a format 57 data \214le)5.582 F .724(called "0007_20020425_060\
-531.mb57", the \214lename root is "0007_20020425_060531". F)108 362.4 R
-.724(or a format 121)-.15 F
-(\214le named "009_1659", the \214lename root "009_1659".)108 374.4 Q
-1.274(The output \214lenames are automatically constructed by adding th\
-e standard MB-System \214le suf)108 398.4 R 1.275(\214x to the)-.25 F
-.215(\214lename root. This suf)108 410.4 R .215
-(\214x is ".mbXXX" where XXX is the tw)-.25 F 2.715(oo)-.1 G 2.715(rt)
--2.715 G .215(hree digit format id number)-2.715 F 2.714(.I)-.55 G 2.714
-(nt)-2.714 G .214(he e)-2.714 F -.15(ve)-.25 G(nt).15 E .291
-(that the output \214lename is the same as the input \214lename \(lik)
-108 422.4 R .291(ely only if the)-.1 F F2<ad46>2.792 E F0 .292
-(option is not used to set the)2.792 F
-(output format\), a "c" will be placed at the be)108 434.4 Q
-(ginning of the output \214le suf)-.15 E(\214x, making it "c.mbXXX".)
--.25 E(The)108 458.4 Q F2<ad58>2.955 E F3(npr)A(ocesses)-.45 E F0 .455
-(option sets the number of parallel processes that can be started by)
-2.955 F F2(mbm_multicopy)2.954 E F0 2.954(.I)C(n)-2.954 E 1.25
-(general, the most ef)108 470.4 R 1.25(\214cient \(f)-.25 F 1.25
-(astest\) e)-.1 F -.15(xe)-.15 G 1.25(cution of the o).15 F -.15(ve)-.15
-G 1.25(rall command will be achie).15 F -.15(ve)-.25 G 3.75(dw).15 G
-(hen)-3.75 E F3(npr)3.75 E(ocesses)-.45 E F0(equals the number of a)108
-482.4 Q -.25(va)-.2 G(ilable CPUs or cores.).25 E(The)108 506.4 Q F2
-<ad54>4.407 E F0 1.907(option causes this macro to print out the)4.407 F
-F2(mbcopy)4.407 E F0 1.907(commands it will e)4.407 F -.15(xe)-.15 G
-1.906(cute without actually).15 F -.15(exe)108 518.4 S .545
-(cuting them. This test option allo).15 F .545
-(ws users to check the consequences of their command before actually)
--.25 F(running it.)108 530.4 Q F1 -.548(AU)72 559.2 S(THORSHIP).548 E F0
-(Christian Ferreira)108 571.2 Q(MAR)113 583.2 Q(UM, Uni)-.4 E -.15(ve)
--.25 G(rsity of Bremen).15 E(Da)108 595.2 Q(vid W)-.2 E 2.5(.C)-.92 G
-(aress \(caress at mbari.or)-2.5 E(g\))-.18 E(Montere)113 607.2 Q 2.5(yB)
--.15 G(ay Aquarium Research Institute)-2.5 E
-(Dale N. Chayes \(dale at ldeo.columbia.edu\))108 619.2 Q
-(Lamont-Doherty Earth Observ)113 631.2 Q(atory)-.25 E F1
-(SIMPLE DESCRIPTION OF B)72 660 Q(ASIC OPTIONS)-.329 E F2<ad48>108 672 Q
-F0 .162(This "help" \215ag cause the program to print out a description\
- of its operation and then e)22.52 F .161(xit immedi-)-.15 F(ately)144
-684 Q(.)-.65 E F2<ad43>108 700.8 Q F0 1.013(This option causes the prog\
-ram to check if each output \214le already e)144 712.8 R 1.013
-(xists, and to for)-.15 F 1.014(go cop)-.18 F(ying)-.1 E
-(those that do e)144 724.8 Q(xist.)-.15 E(MB-System 5.0)72 768 Q 2.5(3J)
-146.495 G(une 2013)-2.5 E(1)204.835 E 0 Cg EP
-%%Page: 2 2
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mbm_multicop)72 48 Q 122.15(y\(1\) MB-System)-.1
-F 122.15(5.0 mbm_multicop)2.5 F(y\(1\))-.1 E/F1 10/Times-Bold at 0 SF<ad46>
-108 84 Q/F2 10/Times-Italic at 0 SF(outputformat)24.19 E F0 .009
-(This option sets the output sw)144 96 R .008(ath format. All of the sw)
--.1 F .008(ath data \214les referenced in the datalist speci-)-.1 F .825
-(\214ed with the)144 108 R F1<ad49>3.326 E F0 .826
-(option will be copied to format)3.326 F F2(outputformat)3.326 E F0
-(using)3.326 E F1(mbcopy)3.326 E F0 3.326(.I)C 3.326(ft)-3.326 G(he)
--3.326 E F1<ad46>3.326 E F0 .826(option is)3.326 F(not gi)144 120 Q -.15
-(ve)-.25 G
-(n, then the input \214les will be copied to their input formats.).15 E
-F1<ad49>108 136.8 Q F2(datalist)26.41 E F0 .417(Sets the input datalist\
- \214lename. A datalist is an ascii \214le containing a list of the inp\
-ut sw)144 148.8 R .416(ath sonar)-.1 F 1.005
-(data \214les to be copied and their formats.)144 160.8 R 1.005(In the)
-6.005 F F2(datalist)3.505 E F0 1.005(\214le, each sw)3.505 F 1.005
-(ath data \214le should be fol-)-.1 F(lo)144 172.8 Q
-(wed by a data format identi\214er)-.25 E 2.5(,e)-.4 G(.g.:)-2.5 E
-(data\214le1 11)180 184.8 Q(data\214le2 24)180 196.8 Q 1.499
-(As discussed in the)144 208.8 R F1(MB-System)3.999 E F0 1.498
-(manual page, datalists may reference other datalists, allo)3.998 F
-(wing)-.25 E .302(users to construct recursi)144 220.8 R .603 -.15(ve d)
--.25 H .303(atalist structures.).15 F .303(This program uses the)5.303 F
-F1(MBIO)2.803 E F0 .303(library and will read)2.803 F .651(or write an)
-144 232.8 R 3.151(ys)-.15 G -.1(wa)-3.151 G .651
-(th sonar format supported by).1 F F1(MBIO)3.151 E F0 3.151(.Al)C .65
-(ist of the sw)-3.151 F .65(ath sonar data formats cur)-.1 F(-)-.2 E
-(rently supported by)144 244.8 Q F1(MBIO)2.5 E F0
-(and their identi\214er v)2.5 E(alues is gi)-.25 E -.15(ve)-.25 G 2.5
-(ni).15 G 2.5(nt)-2.5 G(he)-2.5 E F1(MBIO)2.5 E F0(manual page.)2.5 E F1
-<ad54>108 261.6 Q F0 1.019(This option causes)144 273.6 R F1
-(mbm_multicopy)3.519 E F0 1.019(to print out the)3.519 F F1(mbcopy)3.519
-E F0 1.02(commands it will e)3.519 F -.15(xe)-.15 G 1.02(cute without)
-.15 F .016(actually e)144 285.6 R -.15(xe)-.15 G .016
-(cuting them. This test option allo).15 F .016
-(ws users to check the consequences of their command)-.25 F
-(before actually running it.)144 297.6 Q F1<ad56>108 314.4 Q F0(Causes)
-23.08 E F1(mbm_multicopy)3.65 E F0 1.151(to operate in "v)3.65 F 1.151
-(erbose" mode so that it outputs more information than)-.15 F(usual.)144
-326.4 Q F1<ad58>108 343.2 Q F2(npr)23.08 E(ocesses)-.45 E F0
-(This option sets the number of parallel, simultaneous)144 355.2 Q F1
-(mbcopy)2.5 E F0(processes that may be run.)2.5 E/F3 10.95/Times-Bold at 0
-SF(EXAMPLES)72 384 Q F0(Suppose one has three ra)108 396 Q 2.5(w\()-.15
-G(format 56\) Simrad EM300 data \214les:)-2.5 E(0001_20020424_212920_ra)
-144 408 Q -.65(w.)-.15 G(all).65 E(0002_20020425_011607_ra)144 420 Q
--.65(w.)-.15 G(all).65 E(0003_20020425_022926_ra)144 432 Q -.65(w.)-.15
-G(all).65 E .236(One can generate a datalist called datalistr)108 444 R
-.236(.mb-1 referencing these three sw)-.55 F .236
-(ath \214les using a te)-.1 F .235(xt editor or by)-.15 F(using)108 456
-Q F1(awk)2.5 E F0(:)A(ls \2551 *all | a)144 468 Q
-(wk '{print $1" 56"}' > datalistr)-.15 E(.mb-1)-.55 E .47(In order to t\
-ranslate all three \214les in the processing format for Simrad multibea\
-m data \(format 57\), use the)108 480 R F1(mbm_multicopy)108 492 Q F0
-(macro:)2.5 E(mbm_multicop)144 504 Q 2.5<79ad>-.1 G 2.5(Id)-2.5 G
-(atalistr)-2.5 E(.mb-1 \255F 57 \255T \255X2 \255V)-.55 E
-(The macro prints out the follo)108 516 Q(wing as it translates the sw)
--.25 E(ath data:)-.1 E(Running mbm_multicop)144 528 Q -.65(y.)-.1 G(..)
-.65 E(Getting \214le list using mbdatalist...)144 540 Q
-(Initializing parallel processing with as man)144 552 Q 2.5(ya)-.15 G
-2.5(s2p)-2.5 G(rocesses)-2.5 E(Running: mbcop)144 576 Q 2.5<79ad>-.1 G
-(F56/57)-2.5 E(-I0001_20020424_212920_ra)180 588 Q -.65(w.)-.15 G(all)
-.65 E(-O0001_20020424_212920.mb57)180 600 Q(Running: mbcop)144 612 Q 2.5
-<79ad>-.1 G(F56/57)-2.5 E(-I0002_20020425_011607_ra)180 624 Q -.65(w.)
--.15 G(all).65 E(-O0002_20020425_011607.mb57)180 636 Q(Running: mbcop)
-144 648 Q 2.5<79ad>-.1 G(F56/57)-2.5 E(-I0003_20020425_022926_ra)180 660
-Q -.65(w.)-.15 G(all).65 E(-O0003_20020425_022926.mb57)180 672 Q F3
-(SEE ALSO)72 700.8 Q F1(mbsystem)108 712.8 Q F0(\(1\),)A F1(mbm_copy)2.5
-E F0(\(1\),)A F1(mbcopy)2.5 E F0(\(1\),)A F1(mbdatalist)2.5 E F0(\(1\))A
-(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(2)204.835 E 0
-Cg EP
-%%Page: 3 3
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mbm_multicop)72 48 Q 122.15(y\(1\) MB-System)-.1
-F 122.15(5.0 mbm_multicop)2.5 F(y\(1\))-.1 E/F1 10.95/Times-Bold at 0 SF
--.11(BU)72 84 S(GS).11 E F0(Perhaps.)108 96 Q(MB-System 5.0)72 768 Q 2.5
-(3J)146.495 G(une 2013)-2.5 E(3)204.835 E 0 Cg EP
-%%Trailer
-end
-%%EOF
diff --git a/src/ps/mbm_multidatalist.ps b/src/ps/mbm_multidatalist.ps
deleted file mode 100644
index 09a7fcb..0000000
--- a/src/ps/mbm_multidatalist.ps
+++ /dev/null
@@ -1,367 +0,0 @@
-%!PS-Adobe-3.0
-%%Creator: groff version 1.19.2
-%%CreationDate: Wed Jul  1 12:29:29 2015
-%%DocumentNeededResources: font Times-Roman
-%%+ font Times-Bold
-%%+ font Times-Italic
-%%DocumentSuppliedResources: procset grops 1.19 2
-%%Pages: 2
-%%PageOrder: Ascend
-%%DocumentMedia: Default 612 792 0 () ()
-%%Orientation: Portrait
-%%EndComments
-%%BeginDefaults
-%%PageMedia: Default
-%%EndDefaults
-%%BeginProlog
-%%BeginResource: procset grops 1.19 2
-%!PS-Adobe-3.0 Resource-ProcSet
-/setpacking where{
-pop
-currentpacking
-true setpacking
-}if
-/grops 120 dict dup begin
-/SC 32 def
-/A/show load def
-/B{0 SC 3 -1 roll widthshow}bind def
-/C{0 exch ashow}bind def
-/D{0 exch 0 SC 5 2 roll awidthshow}bind def
-/E{0 rmoveto show}bind def
-/F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def
-/G{0 rmoveto 0 exch ashow}bind def
-/H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/I{0 exch rmoveto show}bind def
-/J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def
-/K{0 exch rmoveto 0 exch ashow}bind def
-/L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/M{rmoveto show}bind def
-/N{rmoveto 0 SC 3 -1 roll widthshow}bind def
-/O{rmoveto 0 exch ashow}bind def
-/P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/Q{moveto show}bind def
-/R{moveto 0 SC 3 -1 roll widthshow}bind def
-/S{moveto 0 exch ashow}bind def
-/T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/SF{
-findfont exch
-[exch dup 0 exch 0 exch neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/MF{
-findfont
-[5 2 roll
-0 3 1 roll
-neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/level0 0 def
-/RES 0 def
-/PL 0 def
-/LS 0 def
-/MANUAL{
-statusdict begin/manualfeed true store end
-}bind def
-/PLG{
-gsave newpath clippath pathbbox grestore
-exch pop add exch pop
-}bind def
-/BP{
-/level0 save def
-1 setlinecap
-1 setlinejoin
-72 RES div dup scale
-LS{
-90 rotate
-}{
-0 PL translate
-}ifelse
-1 -1 scale
-}bind def
-/EP{
-level0 restore
-showpage
-}def
-/DA{
-newpath arcn stroke
-}bind def
-/SN{
-transform
-.25 sub exch .25 sub exch
-round .25 add exch round .25 add exch
-itransform
-}bind def
-/DL{
-SN
-moveto
-SN
-lineto stroke
-}bind def
-/DC{
-newpath 0 360 arc closepath
-}bind def
-/TM matrix def
-/DE{
-TM currentmatrix pop
-translate scale newpath 0 0 .5 0 360 arc closepath
-TM setmatrix
-}bind def
-/RC/rcurveto load def
-/RL/rlineto load def
-/ST/stroke load def
-/MT/moveto load def
-/CL/closepath load def
-/Fr{
-setrgbcolor fill
-}bind def
-/setcmykcolor where{
-pop
-/Fk{
-setcmykcolor fill
-}bind def
-}if
-/Fg{
-setgray fill
-}bind def
-/FL/fill load def
-/LW/setlinewidth load def
-/Cr/setrgbcolor load def
-/setcmykcolor where{
-pop
-/Ck/setcmykcolor load def
-}if
-/Cg/setgray load def
-/RE{
-findfont
-dup maxlength 1 index/FontName known not{1 add}if dict begin
-{
-1 index/FID ne{def}{pop pop}ifelse
-}forall
-/Encoding exch def
-dup/FontName exch def
-currentdict end definefont pop
-}bind def
-/DEFS 0 def
-/EBEGIN{
-moveto
-DEFS begin
-}bind def
-/EEND/end load def
-/CNT 0 def
-/level1 0 def
-/PBEGIN{
-/level1 save def
-translate
-div 3 1 roll div exch scale
-neg exch neg exch translate
-0 setgray
-0 setlinecap
-1 setlinewidth
-0 setlinejoin
-10 setmiterlimit
-[]0 setdash
-/setstrokeadjust where{
-pop
-false setstrokeadjust
-}if
-/setoverprint where{
-pop
-false setoverprint
-}if
-newpath
-/CNT countdictstack def
-userdict begin
-/showpage{}def
-/setpagedevice{}def
-}bind def
-/PEND{
-countdictstack CNT sub{end}repeat
-level1 restore
-}bind def
-end def
-/setpacking where{
-pop
-setpacking
-}if
-%%EndResource
-%%EndProlog
-%%BeginSetup
-%%BeginFeature: *PageSize Default
-<< /PageSize [ 612 792 ] /ImagingBBox null >> setpagedevice
-%%EndFeature
-%%IncludeResource: font Times-Roman
-%%IncludeResource: font Times-Bold
-%%IncludeResource: font Times-Italic
-grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72
-def/PL 792 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron/Zcaron
-/scaron/zcaron/Ydieresis/trademark/quotesingle/Euro/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/space/exclam/quotedbl/numbersign/dollar/percent
-/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen
-/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon
-/semicolon/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O
-/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright/circumflex
-/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y
-/z/braceleft/bar/braceright/tilde/.notdef/quotesinglbase/guillemotleft
-/guillemotright/bullet/florin/fraction/perthousand/dagger/daggerdbl
-/endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut
-/dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash
-/quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen
-/brokenbar/section/dieresis/copyright/ordfeminine/guilsinglleft
-/logicalnot/minus/registered/macron/degree/plusminus/twosuperior
-/threesuperior/acute/mu/paragraph/periodcentered/cedilla/onesuperior
-/ordmasculine/guilsinglright/onequarter/onehalf/threequarters
-/questiondown/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE
-/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex
-/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis
-/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn
-/germandbls/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla
-/egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis
-/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide/oslash
-/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis]def
-/Times-Italic at 0 ENC0/Times-Italic RE/Times-Bold at 0 ENC0/Times-Bold RE
-/Times-Roman at 0 ENC0/Times-Roman RE
-%%EndSetup
-%%Page: 1 1
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 112.6(mbm_multidatalist\(1\) MB-System)72 48 R
-112.6(5.0 mbm_multidatalist\(1\))2.5 F/F1 10.95/Times-Bold at 0 SF -.219
-(NA)72 84 S(ME).219 E/F2 10/Times-Bold at 0 SF(mbm_multidatalist)108 96 Q
-F0 3.7<ad4d>3.7 G 1.2(acro to use mbdatalist with the)-3.7 F F2<ad4f>3.7
-E F0 1.2(option to generate standard)3.7 F 1.2(ancilliary \214les,)6.2 F
-(using parallel processes.)108 108 Q F1(VERSION)72 136.8 Q F0 -1.11(Ve)
-108 148.8 S(rsion 5.0)1.11 E F1(SYNOPSIS)72 177.6 Q F2
-(mbm_multidatalist \255I)108 189.6 Q/F3 10/Times-Italic at 0 SF(datalist)A
-F0([)2.5 E F2<ad58>A F3(npr)A(ocesses)-.45 E F0([)2.5 E F2
-<ad4e20ad4820ad56>A F0(])A F1(DESCRIPTION)72 218.4 Q F2
-(mbm_multidatalist)108 230.4 Q F0 1.304(is a macro used to ef)3.804 F
-1.305(\214ciently generate ancilliary \214les for the sw)-.25 F 1.305
-(ath data \214les refer)-.1 F(-)-.2 E .19
-(enced in the input datalist \214le. This is accomplished by e)108 242.4
-R -.15(xe)-.15 G(cuting).15 E F2(mbdatalist)2.69 E F0 .19(with the)2.69
-F F2<ad4f>2.69 E F0(or)2.69 E F2<ad4e>2.69 E F0 .19(option for)2.69 F
-(each sw)108 254.4 Q(ath \214le.)-.1 E .586(Programs such as)108 278.4 R
-F2(mbgrid)3.086 E F0 .586(try to check statistics or "inf" \214les to s\
-ee if the corresponding data \214les include)3.086 F .029(data within t\
-he speci\214ed geographic bounds. Other programs look for "f)108 290.4 R
-.029(ast bath)-.1 F .029(ymetry" or "f)-.05 F .029(ast na)-.1 F(vig)-.2
-E(ation")-.05 E .75(\("fbt" or "fn)108 302.4 R .75
-(v"\) \214les in order to read the data more quickly)-.4 F 3.25(.T)-.65
-G(he)-3.25 E F2<ad4e>3.25 E F0 .75(option causes)3.25 F F2
-(mbm_multidatalist)3.25 E F0(to)3.25 E .838
-(create these three types of ancillary \214les for each sw)108 314.4 R
-.838(ath data \214le. By def)-.1 F(ault,)-.1 E F2(mbm_multidatalist)
-3.338 E F0(creates)3.338 E 1.007(the "inf", "fbt", and "fn)108 326.4 R
-1.007(v" \214les only when the)-.4 F 3.507(yd)-.15 G(on')-3.507 E 3.507
-(ta)-.18 G 1.007(lready e)-3.507 F 1.007
-(xist or are out of date \(older than the data)-.15 F 3.582
-(\214le\). The)108 338.4 R F2<ad4e>3.582 E F0 1.082(option causes)3.582
-F F2(mbm_multidatalist)3.582 E F0 1.081
-(to create \(or recreate\) the ancillary \214les for each sw)3.581 F
-(ath)-.1 E(data \214le.)108 350.4 Q(The)108 374.4 Q F2<ad58>2.927 E F3
-(npr)A(ocesses)-.45 E F0 .427
-(option sets the number of parallel processes that can be started by)
-2.927 F F2(mbm_multidatalist)2.928 E F0(.)A .445
-(In general, the most ef)108 386.4 R .445(\214cient \(f)-.25 F .445
-(astest\) e)-.1 F -.15(xe)-.15 G .445(cution of the o).15 F -.15(ve)-.15
-G .444(rall command will be achie).15 F -.15(ve)-.25 G 2.944(dw).15 G
-(hen)-2.944 E F3(npr)2.944 E(ocesses)-.45 E F0(equals the number of a)
-108 398.4 Q -.25(va)-.2 G(ilable CPUs or cores.).25 E F1 -.548(AU)72
-427.2 S(THORSHIP).548 E F0(Christian Ferreira)108 439.2 Q(MAR)113 451.2
-Q(UM, Uni)-.4 E -.15(ve)-.25 G(rsity of Bremen).15 E(Da)108 463.2 Q
-(vid W)-.2 E 2.5(.C)-.92 G(aress \(caress at mbari.or)-2.5 E(g\))-.18 E
-(Montere)113 475.2 Q 2.5(yB)-.15 G(ay Aquarium Research Institute)-2.5 E
-(Dale N. Chayes \(dale at ldeo.columbia.edu\))108 487.2 Q
-(Lamont-Doherty Earth Observ)113 499.2 Q(atory)-.25 E F1
-(SIMPLE DESCRIPTION OF B)72 528 Q(ASIC OPTIONS)-.329 E F2<ad48>108 540 Q
-F0 .162(This "help" \215ag cause the program to print out a description\
- of its operation and then e)22.52 F .162(xit immedi-)-.15 F(ately)144
-552 Q(.)-.65 E F2<ad43>108 568.8 Q F0 1.013(This option causes the prog\
-ram to check if each output \214le already e)144 580.8 R 1.013
-(xists, and to for)-.15 F 1.013(go cop)-.18 F(ying)-.1 E
-(those that do e)144 592.8 Q(xist.)-.15 E F2<ad49>108 609.6 Q F3
-(datalist)26.41 E F0 .417(Sets the input datalist \214lename. A datalis\
-t is an ascii \214le containing a list of the input sw)144 621.6 R .417
-(ath sonar)-.1 F 1.005(data \214les to be copied and their formats.)144
-633.6 R 1.005(In the)6.005 F F3(datalist)3.505 E F0 1.005
-(\214le, each sw)3.505 F 1.005(ath data \214le should be fol-)-.1 F(lo)
-144 645.6 Q(wed by a data format identi\214er)-.25 E 2.5(,e)-.4 G(.g.:)
--2.5 E(data\214le1 11)180 657.6 Q(data\214le2 24)180 669.6 Q 1.498
-(As discussed in the)144 681.6 R F2(MB-System)3.998 E F0 1.499
-(manual page, datalists may reference other datalists, allo)3.998 F
-(wing)-.25 E .303(users to construct recursi)144 693.6 R .603 -.15(ve d)
--.25 H .303(atalist structures.).15 F .303(This program uses the)5.303 F
-F2(MBIO)2.803 E F0 .302(library and will read)2.803 F .65(or write an)
-144 705.6 R 3.15(ys)-.15 G -.1(wa)-3.15 G .65
-(th sonar format supported by).1 F F2(MBIO)3.151 E F0 3.151(.Al)C .651
-(ist of the sw)-3.151 F .651(ath sonar data formats cur)-.1 F(-)-.2 E
-(rently supported by)144 717.6 Q F2(MBIO)2.5 E F0
-(and their identi\214er v)2.5 E(alues is gi)-.25 E -.15(ve)-.25 G 2.5
-(ni).15 G 2.5(nt)-2.5 G(he)-2.5 E F2(MBIO)2.5 E F0(manual page.)2.5 E
-(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(1)204.835 E 0
-Cg EP
-%%Page: 2 2
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 112.6(mbm_multidatalist\(1\) MB-System)72 48 R
-112.6(5.0 mbm_multidatalist\(1\))2.5 F/F1 10/Times-Bold at 0 SF<ad4e>108 84
-Q F0 1.151(This ar)23.08 F 1.151(gument causes)-.18 F F1
-(mbm_multidatalist)3.651 E F0 1.151
-(to generate the three ancillary data \214les \("inf", "fbt",)3.651 F
-(and "fn)144 96 Q(v"\) e)-.4 E -.15(ve)-.25 G 2.5(ni).15 G 2.5(ft)-2.5 G
-(he)-2.5 E 2.5(ya)-.15 G(lready e)-2.5 E(xist and are up to date.)-.15 E
-F1<ad56>108 112.8 Q F0(Causes)23.08 E F1(mbm_multidatalist)2.753 E F0
-.253(to operate in "v)2.753 F .253
-(erbose" mode so that it outputs more information than)-.15 F(usual.)144
-124.8 Q F1<ad58>108 141.6 Q/F2 10/Times-Italic at 0 SF(npr)23.08 E(ocesses)
--.45 E F0(This option sets the number of parallel, simultaneous)144
-153.6 Q F1(mbdatalist)2.5 E F0(processes that may be run.)2.5 E/F3 10.95
-/Times-Bold at 0 SF(EXAMPLES)72 182.4 Q F0(Suppose one has tw)108 194.4 Q
-2.5(of)-.1 G(ormat 88 Reson 7125 data \214les:)-2.5 E
-(20110805_053612.mb88)144 206.4 Q(20110805_054149.mb88)144 218.4 Q .236
-(One can generate a datalist called datalistr)108 230.4 R .236
-(.mb-1 referencing these three sw)-.55 F .236(ath \214les using a te)-.1
-F .235(xt editor or by)-.15 F(using)108 242.4 Q F1(awk)2.5 E F0(:)A
-(ls \2551 *.mb88 | a)144 254.4 Q(wk '{print $1" 88"}' > datalist.mb-1)
--.15 E 1.867(In order to generate the usual ancilliary \214les \(*.inf,\
- *.fbt, and *.fn)108 266.4 R 4.368<768c>-.4 G 1.868(les\) use the)-4.368
-F F1(mbm_multidatalist)4.368 E F0(macro:)108 278.4 Q
-(mbm_multidatalist \255I datalist.mb-1 \255X2 \255V)144 290.4 Q
-(The macro prints out the follo)108 302.4 Q
-(wing as it generates the *.inf, *.fbt, and *.fn)-.25 E 2.5<768c>-.4 G
-(les for each sw)-2.5 E(ath data \214le:)-.1 E
-(Running mbm_multidatalist...)144 326.4 Q(Ex)144 338.4 Q
-(ecuting mbdatalist \255I20110805_053612.mb88 \255O \255V)-.15 E(Ex)144
-350.4 Q(ecuting mbdatalist \255I20110805_054149.mb88 \255O \255V)-.15 E
-(Program mbdatalist)144 374.4 Q -1.11(Ve)144 398.4 S
-(rsion $Id: mbm_multidatalist.ps 2252 2015-07-01 19:35:37Z caress $)1.11
-E(Program mbdatalist)144 410.4 Q(MB-system V)144 422.4 Q
-(ersion 5.3.1904)-1.11 E -1.11(Ve)144 434.4 S
-(rsion $Id: mbm_multidatalist.ps 2252 2015-07-01 19:35:37Z caress $)1.11
-E(MB-system V)144 446.4 Q(ersion 5.3.1904)-1.11 E
-(Generating inf \214le for 20110805_054149.mb88)144 470.4 Q
-(Generating inf \214le for 20110805_053612.mb88)144 494.4 Q
-(Generating fbt \214le for 20110805_054149.mb88)144 506.4 Q
-(Generating fbt \214le for 20110805_053612.mb88)144 518.4 Q
-(Generating fn)144 530.4 Q 2.5<768c>-.4 G(le for 20110805_054149.mb88)
--2.5 E(Generating fn)144 542.4 Q 2.5<768c>-.4 G
-(le for 20110805_053612.mb88)-2.5 E -.8(To)144 566.4 S(tal sw).8 E
-(ath \214les:)-.1 E(1)22.5 E -.8(To)144 590.4 S(tal sw).8 E
-(ath \214les:)-.1 E(1)22.5 E .99
-(Note that the terminal messages from the tw)108 614.4 R(o)-.1 E F1
-(mbdatalist)3.489 E F0 .989(processes are mix)3.489 F .989
-(ed because the processes are)-.15 F -.15(exe)108 626.4 S
-(cuted in parallel.).15 E F3(SEE ALSO)72 655.2 Q F1(mbsystem)108 667.2 Q
-F0(\(1\),)A F1(mbdatalist)2.5 E F0(\(1\),)A F1(mbcopy)2.5 E F0(\(1\),)A
-F1(mbdatalist)2.5 E F0(\(1\))A F3 -.11(BU)72 696 S(GS).11 E F0(Perhaps.)
-108 708 Q(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(2)
-204.835 E 0 Cg EP
-%%Trailer
-end
-%%EOF
diff --git a/src/ps/mbm_multiprocess.ps b/src/ps/mbm_multiprocess.ps
deleted file mode 100644
index bbaefbf..0000000
--- a/src/ps/mbm_multiprocess.ps
+++ /dev/null
@@ -1,341 +0,0 @@
-%!PS-Adobe-3.0
-%%Creator: groff version 1.19.2
-%%CreationDate: Wed Jul  1 12:29:29 2015
-%%DocumentNeededResources: font Times-Roman
-%%+ font Times-Bold
-%%+ font Times-Italic
-%%DocumentSuppliedResources: procset grops 1.19 2
-%%Pages: 2
-%%PageOrder: Ascend
-%%DocumentMedia: Default 612 792 0 () ()
-%%Orientation: Portrait
-%%EndComments
-%%BeginDefaults
-%%PageMedia: Default
-%%EndDefaults
-%%BeginProlog
-%%BeginResource: procset grops 1.19 2
-%!PS-Adobe-3.0 Resource-ProcSet
-/setpacking where{
-pop
-currentpacking
-true setpacking
-}if
-/grops 120 dict dup begin
-/SC 32 def
-/A/show load def
-/B{0 SC 3 -1 roll widthshow}bind def
-/C{0 exch ashow}bind def
-/D{0 exch 0 SC 5 2 roll awidthshow}bind def
-/E{0 rmoveto show}bind def
-/F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def
-/G{0 rmoveto 0 exch ashow}bind def
-/H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/I{0 exch rmoveto show}bind def
-/J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def
-/K{0 exch rmoveto 0 exch ashow}bind def
-/L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/M{rmoveto show}bind def
-/N{rmoveto 0 SC 3 -1 roll widthshow}bind def
-/O{rmoveto 0 exch ashow}bind def
-/P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/Q{moveto show}bind def
-/R{moveto 0 SC 3 -1 roll widthshow}bind def
-/S{moveto 0 exch ashow}bind def
-/T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/SF{
-findfont exch
-[exch dup 0 exch 0 exch neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/MF{
-findfont
-[5 2 roll
-0 3 1 roll
-neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/level0 0 def
-/RES 0 def
-/PL 0 def
-/LS 0 def
-/MANUAL{
-statusdict begin/manualfeed true store end
-}bind def
-/PLG{
-gsave newpath clippath pathbbox grestore
-exch pop add exch pop
-}bind def
-/BP{
-/level0 save def
-1 setlinecap
-1 setlinejoin
-72 RES div dup scale
-LS{
-90 rotate
-}{
-0 PL translate
-}ifelse
-1 -1 scale
-}bind def
-/EP{
-level0 restore
-showpage
-}def
-/DA{
-newpath arcn stroke
-}bind def
-/SN{
-transform
-.25 sub exch .25 sub exch
-round .25 add exch round .25 add exch
-itransform
-}bind def
-/DL{
-SN
-moveto
-SN
-lineto stroke
-}bind def
-/DC{
-newpath 0 360 arc closepath
-}bind def
-/TM matrix def
-/DE{
-TM currentmatrix pop
-translate scale newpath 0 0 .5 0 360 arc closepath
-TM setmatrix
-}bind def
-/RC/rcurveto load def
-/RL/rlineto load def
-/ST/stroke load def
-/MT/moveto load def
-/CL/closepath load def
-/Fr{
-setrgbcolor fill
-}bind def
-/setcmykcolor where{
-pop
-/Fk{
-setcmykcolor fill
-}bind def
-}if
-/Fg{
-setgray fill
-}bind def
-/FL/fill load def
-/LW/setlinewidth load def
-/Cr/setrgbcolor load def
-/setcmykcolor where{
-pop
-/Ck/setcmykcolor load def
-}if
-/Cg/setgray load def
-/RE{
-findfont
-dup maxlength 1 index/FontName known not{1 add}if dict begin
-{
-1 index/FID ne{def}{pop pop}ifelse
-}forall
-/Encoding exch def
-dup/FontName exch def
-currentdict end definefont pop
-}bind def
-/DEFS 0 def
-/EBEGIN{
-moveto
-DEFS begin
-}bind def
-/EEND/end load def
-/CNT 0 def
-/level1 0 def
-/PBEGIN{
-/level1 save def
-translate
-div 3 1 roll div exch scale
-neg exch neg exch translate
-0 setgray
-0 setlinecap
-1 setlinewidth
-0 setlinejoin
-10 setmiterlimit
-[]0 setdash
-/setstrokeadjust where{
-pop
-false setstrokeadjust
-}if
-/setoverprint where{
-pop
-false setoverprint
-}if
-newpath
-/CNT countdictstack def
-userdict begin
-/showpage{}def
-/setpagedevice{}def
-}bind def
-/PEND{
-countdictstack CNT sub{end}repeat
-level1 restore
-}bind def
-end def
-/setpacking where{
-pop
-setpacking
-}if
-%%EndResource
-%%EndProlog
-%%BeginSetup
-%%BeginFeature: *PageSize Default
-<< /PageSize [ 612 792 ] /ImagingBBox null >> setpagedevice
-%%EndFeature
-%%IncludeResource: font Times-Roman
-%%IncludeResource: font Times-Bold
-%%IncludeResource: font Times-Italic
-grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72
-def/PL 792 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron/Zcaron
-/scaron/zcaron/Ydieresis/trademark/quotesingle/Euro/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/space/exclam/quotedbl/numbersign/dollar/percent
-/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen
-/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon
-/semicolon/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O
-/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright/circumflex
-/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y
-/z/braceleft/bar/braceright/tilde/.notdef/quotesinglbase/guillemotleft
-/guillemotright/bullet/florin/fraction/perthousand/dagger/daggerdbl
-/endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut
-/dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash
-/quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen
-/brokenbar/section/dieresis/copyright/ordfeminine/guilsinglleft
-/logicalnot/minus/registered/macron/degree/plusminus/twosuperior
-/threesuperior/acute/mu/paragraph/periodcentered/cedilla/onesuperior
-/ordmasculine/guilsinglright/onequarter/onehalf/threequarters
-/questiondown/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE
-/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex
-/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis
-/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn
-/germandbls/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla
-/egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis
-/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide/oslash
-/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis]def
-/Times-Italic at 0 ENC0/Times-Italic RE/Times-Bold at 0 ENC0/Times-Bold RE
-/Times-Roman at 0 ENC0/Times-Roman RE
-%%EndSetup
-%%Page: 1 1
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 111.5(mbm_multiprocess\(1\) MB-System)72 48 R
-111.5(5.0 mbm_multiprocess\(1\))2.5 F/F1 10.95/Times-Bold at 0 SF -.219(NA)
-72 84 S(ME).219 E/F2 10/Times-Bold at 0 SF(mbm_multipr)108 96 Q(ocess)-.18
-E F0 3.707<ad4d>3.707 G 1.207(acro to run mbprocess on the sw)-3.707 F
-1.206(ath \214les referenced by a datalist using parallel)-.1 F
-(processes.)108 108 Q F1(VERSION)72 136.8 Q F0 -1.11(Ve)108 148.8 S
-(rsion 5.0)1.11 E F1(SYNOPSIS)72 177.6 Q F2(mbm_multipr)108 189.6 Q
-(ocess \255I)-.18 E/F3 10/Times-Italic at 0 SF(datalist)A F0([)2.5 E F2
-<ad58>A F3(npr)A(ocesses)-.45 E F2<ad4820ad56>2.5 E F0(])A F1
-(DESCRIPTION)72 218.4 Q F2(mbm_multipr)108 230.4 Q(ocess)-.18 E F0 .706
-(is a macro used to ef)3.206 F .706(feciently process lar)-.25 F .706
-(ge numbers of sw)-.18 F .706(ath data \214les by e)-.1 F -.15(xe)-.15 G
-(cuting).15 E .218(parallel instances of the program)108 242.4 R F2
-(mbpr)2.718 E(ocess)-.18 E F0 2.718(.S)C .218(ee the)-2.718 F F2(mbpr)
-2.718 E(ocess)-.18 E F0 .217(manual page for a description of its oper)
-2.717 F(-)-.2 E(ation.)108 254.4 Q(The)108 278.4 Q F2<ad58>2.94 E F3
-(npr)A(ocesses)-.45 E F0 .441
-(option sets the number of parallel processes that can be started by)
-2.94 F F2(mbm_multipr)2.941 E(ocess)-.18 E F0(.)A .445
-(In general, the most ef)108 290.4 R .445(\214cient \(f)-.25 F .445
-(astest\) e)-.1 F -.15(xe)-.15 G .445(cution of the o).15 F -.15(ve)-.15
-G .444(rall command will be achie).15 F -.15(ve)-.25 G 2.944(dw).15 G
-(hen)-2.944 E F3(npr)2.944 E(ocesses)-.45 E F0(equals the number of a)
-108 302.4 Q -.25(va)-.2 G(ilable CPUs or cores.).25 E F1 -.548(AU)72
-331.2 S(THORSHIP).548 E F0(Christian Ferreira)108 343.2 Q(MAR)113 355.2
-Q(UM, Uni)-.4 E -.15(ve)-.25 G(rsity of Bremen).15 E(Da)108 367.2 Q
-(vid W)-.2 E 2.5(.C)-.92 G(aress \(caress at mbari.or)-2.5 E(g\))-.18 E
-(Montere)113 379.2 Q 2.5(yB)-.15 G(ay Aquarium Research Institute)-2.5 E
-(Dale N. Chayes \(dale at ldeo.columbia.edu\))108 391.2 Q
-(Lamont-Doherty Earth Observ)113 403.2 Q(atory)-.25 E F1
-(SIMPLE DESCRIPTION OF B)72 432 Q(ASIC OPTIONS)-.329 E F2<ad48>108 444 Q
-F0 .162(This "help" \215ag cause the program to print out a description\
- of its operation and then e)22.52 F .162(xit immedi-)-.15 F(ately)144
-456 Q(.)-.65 E F2<ad49>108 472.8 Q F3(datalist)26.41 E F0 .417(Sets the\
- input datalist \214lename. A datalist is an ascii \214le containing a \
-list of the input sw)144 484.8 R .416(ath sonar)-.1 F 1.005
-(data \214les to be copied and their formats.)144 496.8 R 1.005(In the)
-6.005 F F3(datalist)3.505 E F0 1.005(\214le, each sw)3.505 F 1.005
-(ath data \214le should be fol-)-.1 F(lo)144 508.8 Q
-(wed by a data format identi\214er)-.25 E 2.5(,e)-.4 G(.g.:)-2.5 E
-(data\214le1 11)180 520.8 Q(data\214le2 24)180 532.8 Q 1.499
-(As discussed in the)144 544.8 R F2(MB-System)3.999 E F0 1.498
-(manual page, datalists may reference other datalists, allo)3.998 F
-(wing)-.25 E .302(users to construct recursi)144 556.8 R .603 -.15(ve d)
--.25 H .303(atalist structures.).15 F .303(This program uses the)5.303 F
-F2(MBIO)2.803 E F0 .303(library and will read)2.803 F .651(or write an)
-144 568.8 R 3.151(ys)-.15 G -.1(wa)-3.151 G .651
-(th sonar format supported by).1 F F2(MBIO)3.151 E F0 3.151(.Al)C .65
-(ist of the sw)-3.151 F .65(ath sonar data formats cur)-.1 F(-)-.2 E
-(rently supported by)144 580.8 Q F2(MBIO)2.5 E F0
-(and their identi\214er v)2.5 E(alues is gi)-.25 E -.15(ve)-.25 G 2.5
-(ni).15 G 2.5(nt)-2.5 G(he)-2.5 E F2(MBIO)2.5 E F0(manual page.)2.5 E F2
-<ad56>108 597.6 Q F0(Causes)23.08 E F2(mbm_multipr)2.767 E(ocess)-.18 E
-F0 .267(to operate in "v)2.767 F .268
-(erbose" mode so that it outputs more information than)-.15 F(usual.)144
-609.6 Q F2<ad58>108 626.4 Q F3(npr)23.08 E(ocesses)-.45 E F0
-(This option sets the number of parallel, simultaneous)144 638.4 Q F2
-(mbcopy)2.5 E F0(processes that may be run.)2.5 E F1(EXAMPLES)72 667.2 Q
-F0(Suppose one has tw)108 679.2 Q 2.5(of)-.1 G
-(ormat 88 Reson 7125 data \214les:)-2.5 E(20110805_053612.mb88)144 691.2
-Q(20110805_054149.mb88)144 703.2 Q 1.148
-(and that these \214les are ready to be processed with)108 715.2 R F2
-(mbpr)3.648 E(ocess)-.18 E F0 6.148(.I)C 3.647(no)-6.148 G 1.147
-(rder to e)-3.647 F -.15(xe)-.15 G 1.147(cute the processing using).15 F
-1.647(multiple, parallel processes, use the macro mbm_multiprocess with\
- a datalist \214le referencing the tar)108 727.2 R(get)-.18 E
-(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(1)204.835 E 0
-Cg EP
-%%Page: 2 2
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 111.5(mbm_multiprocess\(1\) MB-System)72 48 R
-111.5(5.0 mbm_multiprocess\(1\))2.5 F(sw)108 84 Q(ath \214les as input:)
--.1 E(mbm_multiprocess \255Idatalist.mb-1 \255V \255X2)144 96 Q
-(The macro prints out the follo)108 108 Q
-(wing as the processing proceeds:)-.25 E(Running mbm_multiprocess...)144
-132 Q(Program <mbprocess>)144 156 Q(Program <mbprocess>)144 180 Q -1.11
-(Ve)144 192 S
-(rsion $Id: mbm_multiprocess.ps 2252 2015-07-01 19:35:37Z caress $)1.11 E
--1.11(Ve)144 204 S
-(rsion $Id: mbm_multiprocess.ps 2252 2015-07-01 19:35:37Z caress $)1.11 E
-(MB-system V)144 216 Q(ersion 5.3.1904)-1.11 E(MB-system V)144 228 Q
-(ersion 5.3.1904)-1.11 E(Program Operation:)144 252 Q
-(Program Operation:)144 276 Q(Input \214le:)149 288 Q
-(20110805_053612.mb88)15 E(Input \214le:)149 300 Q(20110805_054149.mb88)
-15 E -.15(Fo)149 312 S 22.5(rmat: 88).15 F -.15(Fo)149 324 S 22.5
-(rmat: 88).15 F(Files processed only if out of date.)149 336 Q
-(Files processed only if out of date.)149 348 Q
-(Comments embedded in output.)149 360 Q(Comments embedded in output.)149
-384 Q(**: Data processed \255 out of date \255 unlock)144 408 Q(ed:)-.1
-E 2.5(Input: /V)180 420 R(olumes/MappingA)-1.29 E(UV)-.55 E
-(Ops2011/test/20110805_054149.mb88)-.4 E(Output: /V)180 432 Q
-(olumes/MappingA)-1.29 E(UV)-.55 E(Ops2011/test/20110805_054149p.mb88)
--.4 E(**: Data processed \255 out of date \255 unlock)144 444 Q(ed:)-.1
-E 2.5(Input: /V)180 456 R(olumes/MappingA)-1.29 E(UV)-.55 E
-(Ops2011/test/20110805_053612.mb88)-.4 E(Output: /V)180 468 Q
-(olumes/MappingA)-1.29 E(UV)-.55 E(Ops2011/test/20110805_053612p.mb88)
--.4 E 1.113(Note that the terminal messages from the tw)108 492 R(o)-.1
-E/F1 10/Times-Bold at 0 SF(mbpr)3.613 E(ocess)-.18 E F0 1.113
-(instances are mix)3.613 F 1.112(ed because the processes are)-.15 F
--.15(exe)108 504 S(cuted in parallel.).15 E/F2 10.95/Times-Bold at 0 SF
-(SEE ALSO)72 532.8 Q F1(mbsystem)108 544.8 Q F0(\(1\),)A F1(mbpr)2.5 E
-(ocess)-.18 E F0(\(1\))A F2 -.11(BU)72 573.6 S(GS).11 E F0
-(In insetos sao permitidos.)108 585.6 Q -.25(Ke)5 G
-(ine insekten hier gestattet ist.).25 E(MB-System 5.0)72 768 Q 2.5(3J)
-146.495 G(une 2013)-2.5 E(2)204.835 E 0 Cg EP
-%%Trailer
-end
-%%EOF
diff --git a/src/ps/mbm_plot.ps b/src/ps/mbm_plot.ps
deleted file mode 100644
index 2da2953..0000000
--- a/src/ps/mbm_plot.ps
+++ /dev/null
@@ -1,1692 +0,0 @@
-%!PS-Adobe-3.0
-%%Creator: groff version 1.19.2
-%%CreationDate: Wed Jul  1 12:29:29 2015
-%%DocumentNeededResources: font Times-Roman
-%%+ font Times-Bold
-%%+ font Times-Italic
-%%DocumentSuppliedResources: procset grops 1.19 2
-%%Pages: 16
-%%PageOrder: Ascend
-%%DocumentMedia: Default 612 792 0 () ()
-%%Orientation: Portrait
-%%EndComments
-%%BeginDefaults
-%%PageMedia: Default
-%%EndDefaults
-%%BeginProlog
-%%BeginResource: procset grops 1.19 2
-%!PS-Adobe-3.0 Resource-ProcSet
-/setpacking where{
-pop
-currentpacking
-true setpacking
-}if
-/grops 120 dict dup begin
-/SC 32 def
-/A/show load def
-/B{0 SC 3 -1 roll widthshow}bind def
-/C{0 exch ashow}bind def
-/D{0 exch 0 SC 5 2 roll awidthshow}bind def
-/E{0 rmoveto show}bind def
-/F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def
-/G{0 rmoveto 0 exch ashow}bind def
-/H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/I{0 exch rmoveto show}bind def
-/J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def
-/K{0 exch rmoveto 0 exch ashow}bind def
-/L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/M{rmoveto show}bind def
-/N{rmoveto 0 SC 3 -1 roll widthshow}bind def
-/O{rmoveto 0 exch ashow}bind def
-/P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/Q{moveto show}bind def
-/R{moveto 0 SC 3 -1 roll widthshow}bind def
-/S{moveto 0 exch ashow}bind def
-/T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/SF{
-findfont exch
-[exch dup 0 exch 0 exch neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/MF{
-findfont
-[5 2 roll
-0 3 1 roll
-neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/level0 0 def
-/RES 0 def
-/PL 0 def
-/LS 0 def
-/MANUAL{
-statusdict begin/manualfeed true store end
-}bind def
-/PLG{
-gsave newpath clippath pathbbox grestore
-exch pop add exch pop
-}bind def
-/BP{
-/level0 save def
-1 setlinecap
-1 setlinejoin
-72 RES div dup scale
-LS{
-90 rotate
-}{
-0 PL translate
-}ifelse
-1 -1 scale
-}bind def
-/EP{
-level0 restore
-showpage
-}def
-/DA{
-newpath arcn stroke
-}bind def
-/SN{
-transform
-.25 sub exch .25 sub exch
-round .25 add exch round .25 add exch
-itransform
-}bind def
-/DL{
-SN
-moveto
-SN
-lineto stroke
-}bind def
-/DC{
-newpath 0 360 arc closepath
-}bind def
-/TM matrix def
-/DE{
-TM currentmatrix pop
-translate scale newpath 0 0 .5 0 360 arc closepath
-TM setmatrix
-}bind def
-/RC/rcurveto load def
-/RL/rlineto load def
-/ST/stroke load def
-/MT/moveto load def
-/CL/closepath load def
-/Fr{
-setrgbcolor fill
-}bind def
-/setcmykcolor where{
-pop
-/Fk{
-setcmykcolor fill
-}bind def
-}if
-/Fg{
-setgray fill
-}bind def
-/FL/fill load def
-/LW/setlinewidth load def
-/Cr/setrgbcolor load def
-/setcmykcolor where{
-pop
-/Ck/setcmykcolor load def
-}if
-/Cg/setgray load def
-/RE{
-findfont
-dup maxlength 1 index/FontName known not{1 add}if dict begin
-{
-1 index/FID ne{def}{pop pop}ifelse
-}forall
-/Encoding exch def
-dup/FontName exch def
-currentdict end definefont pop
-}bind def
-/DEFS 0 def
-/EBEGIN{
-moveto
-DEFS begin
-}bind def
-/EEND/end load def
-/CNT 0 def
-/level1 0 def
-/PBEGIN{
-/level1 save def
-translate
-div 3 1 roll div exch scale
-neg exch neg exch translate
-0 setgray
-0 setlinecap
-1 setlinewidth
-0 setlinejoin
-10 setmiterlimit
-[]0 setdash
-/setstrokeadjust where{
-pop
-false setstrokeadjust
-}if
-/setoverprint where{
-pop
-false setoverprint
-}if
-newpath
-/CNT countdictstack def
-userdict begin
-/showpage{}def
-/setpagedevice{}def
-}bind def
-/PEND{
-countdictstack CNT sub{end}repeat
-level1 restore
-}bind def
-end def
-/setpacking where{
-pop
-setpacking
-}if
-%%EndResource
-%%EndProlog
-%%BeginSetup
-%%BeginFeature: *PageSize Default
-<< /PageSize [ 612 792 ] /ImagingBBox null >> setpagedevice
-%%EndFeature
-%%IncludeResource: font Times-Roman
-%%IncludeResource: font Times-Bold
-%%IncludeResource: font Times-Italic
-grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72
-def/PL 792 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron/Zcaron
-/scaron/zcaron/Ydieresis/trademark/quotesingle/Euro/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/space/exclam/quotedbl/numbersign/dollar/percent
-/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen
-/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon
-/semicolon/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O
-/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright/circumflex
-/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y
-/z/braceleft/bar/braceright/tilde/.notdef/quotesinglbase/guillemotleft
-/guillemotright/bullet/florin/fraction/perthousand/dagger/daggerdbl
-/endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut
-/dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash
-/quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen
-/brokenbar/section/dieresis/copyright/ordfeminine/guilsinglleft
-/logicalnot/minus/registered/macron/degree/plusminus/twosuperior
-/threesuperior/acute/mu/paragraph/periodcentered/cedilla/onesuperior
-/ordmasculine/guilsinglright/onequarter/onehalf/threequarters
-/questiondown/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE
-/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex
-/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis
-/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn
-/germandbls/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla
-/egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis
-/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide/oslash
-/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis]def
-/Times-Italic at 0 ENC0/Times-Italic RE/Times-Bold at 0 ENC0/Times-Bold RE
-/Times-Roman at 0 ENC0/Times-Roman RE
-%%EndSetup
-%%Page: 1 1
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.05(mbm_plot\(1\) MB-System)72 48 R 147.05
-(5.0 mbm_plot\(1\))2.5 F/F1 10.95/Times-Bold at 0 SF -.219(NA)72 84 S(ME)
-.219 E/F2 10/Times-Bold at 0 SF(mbm_plot)108 96 Q F0 2.5<ad43>2.5 G
-(reate an e)-2.5 E -.15(xe)-.15 G
-(cutable shellscript which will generate a GMT plot of sw).15 E
-(ath sonar sw)-.1 E(ath data.)-.1 E F1(VERSION)72 124.8 Q F0 -1.11(Ve)
-108 136.8 S(rsion 5.0)1.11 E F1(SYNOPSIS)72 165.6 Q F2 2.043
-(mbm_plot \255F)108 177.6 R/F3 10/Times-Italic at 0 SF(format)A F2<ad49>
-4.543 E F3(\214le)A F0([)4.542 E F2<ad41>A F0([)A F3(ma)A(gnitude)-.1 E
-F0([)A F3(/azimuth)A F0(])A F2<ad43>4.542 E F3
-([cont_int/col_int/tic_int/lab_int/tic_len/lab_hgt])A F2<ad44>108 189.6
-Q F0([)A F3(\215ipcolor/\215ipshade)A F0(])A F2<ad47>3.29 E F3
-(color_mode[F])A F2 .79<ad4820ad4e>3.29 F F3([ttic)A .79
-(k/tannot/dannot/tlen[/nhgt] | F | FP])-.2 F F2<ad4f>3.29 E F3 -.45(ro)C
-(ot).45 E F2<ad50>3.29 E F3(pa-)A -.1(ge)108 201.6 S(size).1 E F2<ad53>
-2.5 E F3([color/shade])A F2<ad5420ad55>2.5 E F3(orientation)A F2
-<ad5620ad57>2.5 E F3([color_style)A F0([)A F3(/palette)A F0([)A F3
-(ncolor)A(s)-.1 E F0(]] |)A F3(cpt\214le])2.5 E F0(])2.5 E
-(Additional Options:)108 225.6 Q([)108 237.6 Q F2<ad42>A F3(tic)A(kinfo)
--.2 E F2<ad4a>2.5 E F3(pr)A(ojection)-.45 E F0([)A F3(/scale | width)A
-F0(])A F2<ad4c>2.5 E F3(title)A F0([)A F3(:scale_label)A F0(])A F2<ad4d>
-2.5 E F3(misc)A F2<ad5120ad52>2.5 E F3(w/e/s/n)A F2<ad5820ad5920ad5a>2.5
-E F3(min/max)A F0(])2.5 E(Miscellaneous Options:)108 261.6 Q([)108 273.6
-Q F2(\255MGD)A F3(gmtdef/value)A F2(\255MGF)14.344 E F3(scale_loc)A F2
-(\255MGL)14.343 E F0([)A F3(f)A F0(][)A F3(x)A F0(])A F3
-(lon0/lat0/slat/length)A F0([)A F3(units)A F0(][)A F3(+llabel)A F0(])A
-F2(\255MGQ)14.343 E F3(dpi)A F2(\255MGT)108 285.6 Q F3
-(x/y/size/angle/font/just/te)A(xt)-.2 E F2(\255MGU[)49.785 E F3(/dx/dy/)
-A F2(][)A F3(label)A F2 49.785<5dad>C(MMA)-49.785 E F3
-(factor/mode/depth)A F2(\255MMB)108 297.6 Q F3(yr/mo/da/hr/mn/sc)A F2
-(\255MMD)14.374 E F3(mode/scale[/min/max])A F2(\255MME)14.373 E F3
-(yr/mo/da/hr/mn/sc)A F2(\255MML)14.373 E F3(lon\215ip)A F2(\255MMN)108
-309.6 Q F3(nplot)A F2(\255MMP)6.447 E F3(pings)A F2(\255MMS)6.447 E F3
-(speedmin)A F2(\255MMT)6.447 E F3(time)A(gap)-.4 E F2(\255MMZ)6.447 E F3
-(algorithm)A F2(\255MN)6.447 E(A)-.2 E F3 3.947([nhgt[/P] | P])B F2
-(\255MNP)108 321.6 Q F3([pingnumber_tic)A
-(k/pingnumber_annot/pingnumber_tic)-.2 E(k_len])-.2 E F2(\255MTC)4.254 E
-F3(\214ll)A F2(\255MTD)4.253 E F3 -.37(re)C(solution).37 E F2(\255MTG)
-4.253 E F3(\214ll)A F2(\255MTI)108 333.6 Q F3(river[/pen])A F2(\255MTN)
-3.592 E F3(bor)A(der[/pen])-.37 E F2(\255MTS)3.593 E F3(\214ll)A F2
-(\255MTW)3.593 E F3(pen)A F2(\255MXG)3.593 E F3(\214ll)A F2(\255MXI)
-3.593 E F3(xy_\214le)A F2 1.093(\255MXM \255MXS)3.593 F F3(sym-)A
-(bol/size)108 345.6 Q F2(\255MXW)2.5 E F3(pen)A F2(])A F1(DESCRIPTION)72
-374.4 Q F2(mbm_plot)108 386.4 Q F0 .287(is a macro to generate a shells\
-cript of MB-System and GMT commands which, when e)2.788 F -.15(xe)-.15 G
-(cuted,).15 E .325
-(will generate a Postscript plot of the speci\214ed sw)108 398.4 R .325
-(ath sonar data. The plot may include bath)-.1 F .326
-(ymetry color \214ll)-.05 F(\()108 410.4 Q F2<ad47>A F3(1)A F0 1.476
-(\), bath)B 1.476(ymetry color shaded relief \()-.05 F F2<ad47>A F3(2)A
-F0 1.476(\), bath)B 1.476(ymetry shaded with amplitudes \()-.05 F F2
-<ad47>A F3(3)A F0 1.475(\), gre)B 1.475(yshade \214ll)-.15 F .544
-(amplitude \()108 422.4 R F2<ad47>A F3(4)A F0 .544(\), gre)B .544
-(yshade \214ll sidescan \()-.15 F F2<ad47>A F3(5)A F0 .544
-(\), contoured bath)B .544(ymetry \()-.05 F F2<ad43>A F0 .544
-(\), or annotated na)B(vig)-.2 E .545(ation. The)-.05 F .194
-(plot may also include na)108 434.4 R(vig)-.2 E .194(ation tracks, te)
--.05 F .193(xt labels, xy data in lines or symbols, and coastlines.)-.15
-F(Fi)5.193 E .493 -.15(ve d)-.25 H(if).15 E(fer)-.25 E(-)-.2 E .898(ent\
- color schemes are included. The plot will be scaled to \214t on the sp\
-eci\214ed page size or)108 446.4 R 3.398(,i)-.4 G 3.398(ft)-3.398 G .899
-(he scale is)-3.398 F 1.165(user de\214ned, the page size will be chose\
-n in accordance with the plot size. The primary purpose of this)108
-458.4 R .87(macro is to allo)108 470.4 R 3.37(wt)-.25 G .871
-(he simple, semi-automated production of nice looking maps with a fe)
--3.37 F 3.371(wc)-.25 G .871(ommand line)-3.371 F(ar)108 482.4 Q .471
-(guments. F)-.18 F .471(or users seeking more control o)-.15 F -.15(ve)
--.15 G 2.971(rt).15 G .47
-(he plot appearance, a number of additional optional ar)-2.971 F(gu-)
--.18 E 1.081(ments are pro)108 494.4 R 1.081(vided. T)-.15 F 1.081
-(ruly ambitious users may edit the plot shellscript to tak)-.35 F 3.582
-(ea)-.1 G(dv)-3.582 E 1.082(antage of MB-System)-.25 F
-(and GMT capabilities not supported by this macro.)108 506.4 Q .084
-(By def)108 530.4 R .083
-(ault the output plot generation shellscript includes lines which e)-.1
-F -.15(xe)-.15 G .083(cute a program to display the Post-).15 F .807(sc\
-ript image on the screen. The program to be used to display the Postscr\
-ipt is set using)108 542.4 R F2(mbdefaults)3.308 E F0 3.308(;t)C(he)
--3.308 E(def)108 554.4 Q .326(ault v)-.1 F .326(alue can be o)-.25 F
--.15(ve)-.15 G .325(rridden by setting the en).15 F .325(vironment v)-.4
-F .325(ariable $MB_PS_VIEWER.)-.25 F(In)5.325 E -.2(vo)-.4 G .325
-(king the plot).2 F(generation shellscript with a)108 566.4 Q F2(-N)2.5
-E F0(command line ar)2.5 E
-(gument suppresses the screen display of the plot.)-.18 E .305
-(The plot scripts generated by this macro will w)108 590.4 R .305
-(ork with GMT v)-.1 F .305(ersion 5.0 and later)-.15 F 2.805(,a)-.4 G
-.305(nd are not compatible)-2.805 F(with earlier v)108 602.4 Q
-(ersions of GMT)-.15 E(.)-.74 E F1 -.548(AU)72 631.2 S(THORSHIP).548 E
-F0(Da)108 643.2 Q(vid W)-.2 E 2.5(.C)-.92 G(aress \(caress at mbari.or)-2.5
-E(g\))-.18 E(Montere)113 655.2 Q 2.5(yB)-.15 G
-(ay Aquarium Research Institute)-2.5 E
-(Dale N. Chayes \(dale at ldeo.columbia.edu\))108 667.2 Q
-(Lamont-Doherty Earth Observ)113 679.2 Q(atory)-.25 E
-(Suzanne H. O'Hara \(sohara at ldeo.columbia.edu\))113 691.2 Q
-(Lamont-Doherty Earth Observ)113 703.2 Q(atory)-.25 E(MB-System 5.0)72
-768 Q 2.5(9J)140.11 G(anuary 2015)-2.5 E(1)198.45 E 0 Cg EP
-%%Page: 2 2
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.05(mbm_plot\(1\) MB-System)72 48 R 147.05
-(5.0 mbm_plot\(1\))2.5 F/F1 10.95/Times-Bold at 0 SF
-(SIMPLE DESCRIPTION OF B)72 84 Q(ASIC OPTIONS)-.329 E/F2 10/Times-Bold at 0
-SF<ad41>108 96 Q/F3 10/Times-Italic at 0 SF(ma)23.08 E(gnitude/azimuth)-.1
-E F0(or)2.5 E F3(ma)2.5 E(gnitude/median)-.1 E F0 .535
-(Sets the parameters which control ho)144 108 R(w)-.25 E F2(mbswath)
-3.035 E F0 .534(generates simulated illumination of bath)3.034 F(ymetry)
--.05 E(,)-.65 E .521(which can be either shaded relief bath)144 120 R
-.521(ymetry or bath)-.05 F .522(ymetry draped with amplitude data.)-.05
-F(If)5.522 E F3(mode)3.022 E F0 .181(is set to 2 \(shaded relief bath)
-144 132 R .181(ymetry\) using the)-.05 F F2<ad47>2.681 E F0 .18
-(option, then the v)2.681 F(alue)-.25 E F3(ma)2.68 E(gnitude)-.1 E F0
-.18(is an ef)2.68 F(fecti)-.25 E -.15(ve)-.25 G -.15(ve)144 144 S 1.424
-(rtical e).15 F 1.424
-(xageration which modulates the intensity of the shading; typical v)-.15
-F 1.425(alues are in the 1-5)-.25 F 2.758(range. The)144 156 R -.25(va)
-2.758 G(lue).25 E F3(azimuth)2.758 E F0 .258
-(is the azimuth from which the bath)2.758 F .257(ymetry is illuminated.)
--.05 F(If)5.257 E F3(mode)2.757 E F0 .257(is set)2.757 F .587
-(to 3 \(bath)144 168 R .587(ymetry shaded using amplitudes\) using the)
--.05 F F2<ad47>3.087 E F0 .587(option, then the v)3.087 F(alue)-.25 E F3
-(ma)3.088 E(gnitude)-.1 E F0(modu-)3.088 E .94
-(lates the intensity of the shading; the v)144 180 R(alue)-.25 E F3
-(median)3.439 E F0 .939(sets the amplitude v)3.439 F .939
-(alue which serv)-.25 F .939(es as the)-.15 F(zero or neutral le)144 192
-Q -.15(ve)-.25 G(l.).15 E F2<ad43>108 208.8 Q F0(Gi)23.08 E -.15(ve)-.25
-G 2.657(nb).15 G 2.657(yi)-2.657 G .157(tself, the)-2.657 F F2<ad43>
-2.657 E F0 .157(option produces a contour plot of the bath)2.657 F .157
-(ymetry data with a contour inter)-.05 F(-)-.2 E -.25(va)144 220.8 S
-3.166(lc).25 G .665
-(hosen according to the data in the \214le or \214les. If the)-3.166 F
-F2<ad47>3.165 E F0 .665(option is used, the def)3.165 F .665
-(ault contours)-.1 F 1.046(will be dra)144 232.8 R 1.047
-(wn in black; otherwise, the def)-.15 F 1.047(ault contours will be dra)
--.1 F 1.047(wn in four colors \(black, red,)-.15 F 1.764
-(green, and blue\) with color changes, annotations, and tickmarks e)144
-244.8 R -.15(ve)-.25 G 1.764(ry fourth contour interv).15 F(al.)-.25 E
-.826(Additional optional parameters are described in the COMPLETE DESCR\
-IPTION OF OPTIONS)144 256.8 R(section belo)144 268.8 Q -.65(w.)-.25 G F2
-<ad44>108 285.6 Q F3([\215ipcolor/\215ipshade])23.08 E F0 1.131
-(This option \215ips the color and shading con)144 297.6 R -.15(ve)-.4 G
-1.131(ntions used by).15 F F2(mbm_plot)3.631 E F0 6.13(.N)C(ormally)
--6.13 E 3.63(,t)-.65 G 1.13(he color or)-3.63 F 1.329
-(grayscale tables used for color bath)144 309.6 R 1.329
-(ymetry maps run from cool colors \(or dark grays\) for lar)-.05 F(ge)
--.18 E .636(depth v)144 321.6 R .636
-(alues to hot colors \(or light grays\) for small depth v)-.25 F 3.135
-(alues. In)-.25 F .635(contrast, sidescan and beam)3.135 F .531(amplitu\
-de data is normally plotted using light grays \(or hot colors\) for sma\
-ll amplitudes and dark)144 333.6 R .279
-(grays \(or cool colors\) for lar)144 345.6 R .279(ge amplitudes.)-.18 F
-(If)5.279 E F2<ad44>2.779 E F0 .278(is gi)2.778 F -.15(ve)-.25 G 2.778
-(na).15 G .278(lone or with)-2.778 F F3(\215ipcolor)2.778 E F0 2.778(=1)
-2.778 G 2.778(,i)-2.778 G 2.778(ta)-2.778 G .278(pplies to)-2.778 F
-1.006(the color table used for color or gray \214ll plots,)144 357.6 R
-1.006(shaded or unshaded. If the plot is to be shaded,)6.006 F .464
-(either by synthetic illumination \()144 369.6 R F2<ad47>A F3(2)A F0
-2.964(\)o)C 2.964(rb)-2.964 G 2.964(yo)-2.964 G -.15(ve)-3.114 G .464
-(rlaying amplitude data \().15 F F2<ad47>A F3(3)A F0 .463
-(option\), then setting)2.964 F F3(\215ipshade)144 381.6 Q F0 3.555(=1w)
-3.555 G 1.055(ill cause the shading con)-3.555 F -.15(ve)-.4 G 1.055
-(ntion to be re).15 F -.15(ve)-.25 G 1.056
-(rsed \(e.g. high amplitudes o).15 F -.15(ve)-.15 G 1.056(rlaid as).15 F
-.863(light shading\).)144 393.6 R(Using)5.863 E F2<ad44>3.363 E F3(0/1)A
-F0 .863(will \215ip the shading con)3.363 F -.15(ve)-.4 G .863(ntion b)
-.15 F .863(ut lea)-.2 F 1.163 -.15(ve t)-.2 H .863(he def).15 F .862
-(ault color con)-.1 F -.15(ve)-.4 G(n-).15 E(tion.)144 405.6 Q F2<ad46>
-108 422.4 Q F3(format)24.19 E F0 1.358
-(Sets the data format for the input data.)144 434.4 R(If)6.358 E F3
-(format)3.858 E F0 3.858(<0)3.858 G 3.858(,t)-3.858 G 1.358
-(hen the input \214le speci\214ed with the)-3.858 F F2<ad49>3.858 E F0
-1.164(option will actually contain a list of input sw)144 446.4 R 1.164
-(ath sonar data \214les. This program uses the)-.1 F F2(MBIO)3.663 E F0
-1.291(library and will read or write an)144 458.4 R 3.792(ys)-.15 G -.1
-(wa)-3.792 G 1.292(th sonar format supported by).1 F F2(MBIO)3.792 E F0
-3.792(.Al)C 1.292(ist of the sw)-3.792 F(ath)-.1 E .391
-(sonar data formats currently supported by)144 470.4 R F2(MBIO)2.891 E
-F0 .391(and their identi\214er v)2.891 F .39(alues is gi)-.25 F -.15(ve)
--.25 G 2.89(ni).15 G 2.89(nt)-2.89 G(he)-2.89 E F2(MBIO)2.89 E F0
-(manual page. Def)144 482.4 Q(ault:)-.1 E F3(format)2.5 E F0 2.5<3dad>
-2.5 G(1.)-2.5 E F2<ad47>108 499.2 Q F3(mode[F])22.52 E F0 -.45(Tu)144
-511.2 S(rns on color \214ll sw).45 E
-(ath plot and sets the style of the plot.)-.1 E F3(mode)180 523.2 Q F0
-2.5(=1)2.5 G 31.92(:C)-2.5 G(olor \214ll of bath)-31.92 E(ymetry data.)
--.05 E F3(mode)180 535.2 Q F0 2.5(=2)2.5 G 31.92(:C)-2.5 G
-(olor shaded relief bath)-31.92 E(ymetry)-.05 E(.)-.65 E F3(mode)180
-547.2 Q F0 2.5(=3)2.5 G 31.92(:B)-2.5 G(ath)-31.92 E
-(ymetry shaded using amplitude data.)-.05 E F3(mode)180 559.2 Q F0 2.5
-(=4)2.5 G 31.92(:G)-2.5 G(rayscale \214ll of amplitude data.)-31.92 E F3
-(mode)180 571.2 Q F0 2.5(=5)2.5 G 31.92(:G)-2.5 G
-(rayscale \214ll of sidescan data.)-31.92 E .925(If "F" is appended to)
-144 583.2 R F3(mode)3.425 E F0 3.425(,t)C(hen)-3.425 E F2(mbm_plot)3.426
-E F0 .926(will attempt to plot amplitude or sidescan data that)3.426 F
-(ha)144 595.2 Q 1.49 -.15(ve b)-.2 H 1.19(een \214ltered with).15 F F2
-(mb\214lter)3.69 E F0 6.19(.I)C 3.69(ft)-6.19 G 1.19
-(he desired \214ltered data \214les do not e)-3.69 F 1.19
-(xist, then the plotting)-.15 F 2.023(script generated by)144 607.2 R F2
-(mbm_plot)4.523 E F0 2.023(will f)4.523 F 2.023(ail when)-.1 F F2
-(mbswath)4.523 E F0 -.15(ex)4.523 G 2.023
-(its with an error message. Filtered).15 F 1.235
-(amplitude data are stored in ancilliary \214les ending with ".f)144
-619.2 R -.1(fa)-.25 G 1.234(", and \214ltered sidescan \214les end in).1
-F(".f)144 631.2 Q .061(fs". Filtering of bath)-.25 F .061
-(ymetry data is not supported, and so appending "F" to)-.05 F F3(mode)
-2.561 E F0 -.25(va)2.561 G .061(lues of 1 or 2).25 F(will ha)144 643.2 Q
-.3 -.15(ve n)-.2 H 2.5(oe).15 G -.25(ff)-2.5 G(ect.).25 E F2<ad48>108
-660 Q F0 .162(This "help" \215ag cause the program to print out a descr\
-iption of its operation and then e)22.52 F .161(xit immedi-)-.15 F
-(ately)144 672 Q(.)-.65 E F2<ad49>108 688.8 Q F3(\214lename)26.41 E F0
-.467(Sets the input \214lename. If)144 700.8 R F3(format)2.967 E F0
-2.967(>0\()2.967 G .467(set with the)-2.967 F F2<ad66>2.967 E F0 .467
-(option\) then the sw)2.967 F .468(ath sonar data contained)-.1 F(in)144
-712.8 Q F3(in\214le)2.943 E F0 .443(is read and processed. If)2.943 F F3
-(format)2.943 E F0 2.943(<0\()2.943 G .442(the def)-2.943 F .442
-(ault\), then)-.1 F F3(in\214le)2.942 E F0 .442
-(is assumed to be an ascii \214le)2.942 F .051
-(containing a list of the input sw)144 724.8 R .052
-(ath sonar data \214les to be processed and their formats.)-.1 F .052
-(The program)5.052 F(MB-System 5.0)72 768 Q 2.5(9J)140.11 G(anuary 2015)
--2.5 E(2)198.45 E 0 Cg EP
-%%Page: 3 3
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.05(mbm_plot\(1\) MB-System)72 48 R 147.05
-(5.0 mbm_plot\(1\))2.5 F .063
-(will read the data in each one of these \214les.)144 84 R .063(In the)
-5.063 F/F1 10/Times-Italic at 0 SF(in\214le)2.563 E F0 .063
-(\214le, each data \214le should be follo)2.563 F .062(wed by a)-.25 F
-(data format identi\214er)144 96 Q 2.5(,e)-.4 G(.g.:)-2.5 E
-(data\214le1 11)180 108 Q(data\214le2 24)180 120 Q .568
-(This program uses the)144 132 R/F2 10/Times-Bold at 0 SF(MBIO)3.068 E F0
-.568(library and will read or write an)3.068 F 3.068(ys)-.15 G -.1(wa)
--3.068 G .568(th sonar format supported by).1 F F2(MBIO)144 144 Q F0
-3.428(.Al)C .928(ist of the sw)-3.428 F .928
-(ath sonar data formats currently supported by)-.1 F F2(MBIO)3.428 E F0
-.928(and their identi\214er)3.428 F -.25(va)144 156 S(lues is gi).25 E
--.15(ve)-.25 G 2.5(ni).15 G 2.5(nt)-2.5 G(he)-2.5 E F2(MBIO)2.5 E F0
-(manual page. The def)2.5 E(ault input \214lename is "datalist.mb-1".)
--.1 E F2<ad4e>108 172.8 Q F0(Gi)23.08 E -.15(ve)-.25 G 3.91(nb).15 G
-3.91(yi)-3.91 G 1.41(tself, this option causes a na)-3.91 F(vig)-.2 E
-1.41(ation track plot to be generated.)-.05 F 1.41(Additional optional)
-6.41 F 1.271(parameters, including annotation control, are described in\
- the COMPLETE DESCRIPTION OF)144 184.8 R(OPTIONS section belo)144 196.8
-Q -.65(w.)-.25 G F2<ad4f>108 213.6 Q F1 -.45(ro)22.52 G(ot).45 E F0 .422
-(Sets the root used to construct the \214lename of the output shellscri\
-pt \()144 225.6 R F1 -.45(ro)C(ot).45 E F0 .423
-(.cmd\) and names of \214les)B .21(created when the shellscript is run.)
-144 237.6 R .21(By def)5.21 F .21
-(ault, the name of the input data \214le or list \214le is used as)-.1 F
-(the)144 249.6 Q F1 -.45(ro)2.5 G(ot).45 E F0(.)A F2<ad50>108 266.4 Q F1
-(pa)24.19 E -.1(ge)-.1 G(size).1 E F0 .632(This option sets the size of\
- the page the plot will be centered on. If the user does not set the pl\
-ot)144 278.4 R .126(scale, the plot will be sized as lar)144 290.4 R
-.125(ge as will \214t on the designated page. If the user sets the plot\
- scale)-.18 F .948
-(such that the plot will not \214t on the designated page, a lar)144
-302.4 R .948(ger page will be used.)-.18 F .948(The supported)5.948 F
-1.343(page sizes include ANSI A, B, C, D, E, F)144 314.4 R 3.843(,a)-.8
-G 1.342(nd E1, as well as most metric page sizes. See the)-3.843 F 1.31
-(COMPLETE DESCRIPTION OF OPTIONS section belo)144 326.4 R 3.81(wf)-.25 G
-1.31(or a complete list of the supported)-3.81 F(page sizes. The def)144
-338.4 Q(ault page size is A.)-.1 E F2<ad53>108 355.2 Q F1([color/shade])
-24.74 E F0 1.073(This option enables ef)144 367.2 R(fecti)-.25 E 1.373
--.15(ve h)-.25 H 1.072
-(istogram equalization of the color and/or shading of thedata. The).15 F
-1.016(equalization is not achie)144 379.2 R -.15(ve)-.25 G 3.516(db).15
-G 3.516(yc)-3.516 G 1.017(hanging the data v)-3.516 F 1.017(alues, b)
--.25 F 1.017(ut rather by constructing the color or)-.2 F 1.325(shading\
- tables so that the boundaries in the tables encompass equal fractions \
-of the datapoints.)144 391.2 R 1.11(This serv)144 403.2 R 1.11
-(es to focus color or shading contrasts in v)-.15 F 1.111
-(alue ranges corresponding to the b)-.25 F 1.111(ulk of the)-.2 F .71
-(data v)144 415.2 R .71(alues, and is particularly useful for enhancing\
- the contrast of sidescan and beam amplitude)-.25 F 3.587(plots. If)144
-427.2 R F2<ad53>3.587 E F0 1.087(is gi)3.587 F -.15(ve)-.25 G 3.587(na)
-.15 G 1.087(lone or with)-3.587 F F1(color)3.587 E F0 3.587(=1)3.587 G
-3.587(,i)-3.587 G 3.587(te)-3.587 G 1.088
-(nables equalization of the color table used for)-3.587 F .289
-(color or gray \214ll plots,)144 439.2 R .289
-(shaded or unshaded. If the plot is to be shaded,)5.289 F .288
-(either by synthetic illumi-)5.289 F .459(nation \()144 451.2 R F2<ad47>
-A F1(2)A F0 2.959(\)o)C 2.959(rb)-2.959 G 2.959(yo)-2.959 G -.15(ve)
--3.109 G .459(rlaying amplitude data \().15 F F2<ad47>A F1(3)A F0 .459
-(option\), then setting)2.959 F F1(shade)2.96 E F0 2.96(=1w)2.96 G .46
-(ill cause the)-2.96 F .163(shading to be equalized.)144 463.2 R(Using)
-5.163 E F2<ad53>2.663 E F1(0/1)A F0 .163
-(will equalize the shading without equalizing the color table.)2.663 F
-F2<ad54>108 480 Q F0(If)23.63 E F2<ad54>3.252 E F0 .752(is gi)3.252 F
--.15(ve)-.25 G .752(n, it causes a coastline to be dra).15 F .753
-(wn on the map. The def)-.15 F .753(ault is to dra)-.1 F 3.253(wt)-.15 G
-.753(he coastline)-3.253 F .314(and shade all dry land a uniform gray)
-144 492 R 2.814(.T)-.65 G 2.814(oe)-3.614 G -.15(xe)-2.964 G .313
-(rcise greater control of the coastline plotting, use the).15 F F2
-(\255MTC)144 504 Q F0(,)A F2(\255MTD)4.26 E F0(,)A F2(\255MTG)4.26 E F0
-(,)A F2(\255MTI)4.26 E F0(,)A F2(\255MTN)4.26 E F0(,)A F2(\255MTS)4.26 E
-F0 4.26(,a)C(nd)-4.26 E F2(\255MTW)4.26 E F0 1.76
-(options described in the COM-)4.26 F
-(PLETE DESCRIPTION OF OPTIONS section belo)144 516 Q -.65(w.)-.25 G F2
-<ad55>108 532.8 Q F1(orientation)23.08 E F0 .2(Normally the orientation\
- of the plot \(portrait or landscape\) is selected automatically so as \
-to maxi-)144 544.8 R .333(mize the plot scale.)144 556.8 R(The)5.333 E
-F2<ad55>2.833 E F0 .333(option allo)2.833 F .333
-(ws the user to set the plot orientation. If)-.25 F F1(orientation)2.833
-E F0 2.834(=1)2.834 G 2.834(,a)-2.834 G
-(portrait plot will be produced; if)144 568.8 Q F1(orientation)2.5 E F0
-2.5(=2)2.5 G 2.5(,al)-2.5 G(andscape plot will be produced.)-2.5 E F2
-<ad56>108 585.6 Q F0(Causes)23.08 E F2(mbm_plot)2.5 E F0
-(to operate in "v)2.5 E
-(erbose" mode so that it outputs more information than usual.)-.15 E F2
-<ad57>108 602.4 Q F1([color_style)20.3 E F0([)A F1(/palette)A F0([)A F1
-(ncolor)A(s)-.1 E F0(]] | cpt\214le])A
-(This option controls the color scheme used for color \214ll plots.)144
-614.4 Q(If)144 638.4 Q F1(color_style)3.136 E F0 3.136(=1[)3.136 G(def)
--3.136 E .636(ault], then the color scheme used will be a continuous gr\
-ading of colors. If)-.1 F F1(color_style)144 650.4 Q F0 2.815(=2)2.815 G
-2.815(,t)-2.815 G .315
-(he color scheme will be a set of discrete color interv)-2.815 F .316
-(als. The color palette used is)-.25 F(set using)144 662.4 Q F1(palette)
-2.5 E F0 2.5(.F)C -2.15 -.25(iv e)-2.5 H(palettes are a)2.75 E -.25(va)
--.2 G(ilable:).25 E F1(palette)180 674.4 Q F0 2.5(=1)2.5 G 26.36(:H)-2.5
-G(axby colors [def)-26.36 E(ault])-.1 E F1(palette)180 686.4 Q F0 2.5
-(=2)2.5 G 26.36(:h)-2.5 G(igh Intensity colors)-26.36 E F1(palette)180
-698.4 Q F0 2.5(=3)2.5 G 26.36(:l)-2.5 G .5 -.25(ow I)-26.36 H
-(ntensity colors).25 E F1(palette)180 710.4 Q F0 2.5(=4)2.5 G 26.36(:g)
--2.5 G(rayscale)-26.36 E F1(palette)180 722.4 Q F0 2.5(=5)2.5 G 26.36
-(:u)-2.5 G(niform grayscale)-26.36 E(MB-System 5.0)72 768 Q 2.5(9J)
-140.11 G(anuary 2015)-2.5 E(3)198.45 E 0 Cg EP
-%%Page: 4 4
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.05(mbm_plot\(1\) MB-System)72 48 R 147.05
-(5.0 mbm_plot\(1\))2.5 F 4.384(Ac)144 84 S 1.883
-(omplete description of the color palettes is gi)-4.384 F -.15(ve)-.25 G
-4.383(ni).15 G 4.383(nt)-4.383 G 1.883(he COMPLETE DESCRIPTION OF)-4.383
-F(OPTIONS section belo)144 96 Q -.65(w.)-.25 G(The)144 120 Q/F1 10
-/Times-Italic at 0 SF(ncolor)2.606 E(s)-.1 E F0 .107
-(parameter sets the number of color v)2.606 F .107
-(alues used in plotting, whether the colors are rep-)-.25 F(resented in\
- a continuous color scale or a stepped, discrete color scale [def)144
-132 Q(ault is 11].)-.1 E .523(If the option ar)144 156 R .522
-(gument is the path to an e)-.18 F(xisting)-.15 E/F2 10/Times-Bold at 0 SF
-(GMT)3.022 E F0 .522(color palette \(CPT\) \214le, then that CPT \214le)
-3.022 F(and its color scheme will be used for the plot)144 168 Q/F3
-10.95/Times-Bold at 0 SF(COMPLETE DESCRIPTION OF OPTIONS)72 196.8 Q F2
-<ad41>108 208.8 Q F1(ma)23.08 E(gnitude/azimuth)-.1 E F0(or)2.5 E F1(ma)
-2.5 E(gnitude/median)-.1 E F0 .08(Sets the parameters which control ho)
-144 220.8 R(w)-.25 E F2(mbm_plot)2.58 E F0 .08
-(generates simulated illumination of bath)2.58 F(ymetry)-.05 E(,)-.65 E
-.522(which can be either shaded relief bath)144 232.8 R .521
-(ymetry or bath)-.05 F .521(ymetry draped with amplitude data.)-.05 F
-(If)5.521 E F1(mode)3.021 E F0 .18(is set to 2 \(shaded relief bath)144
-244.8 R .18(ymetry\) using the)-.05 F F2<ad47>2.681 E F0 .181
-(option, then the v)2.681 F(alue)-.25 E F1(ma)2.681 E(gnitude)-.1 E F0
-.181(is an ef)2.681 F(fecti)-.25 E -.15(ve)-.25 G -.15(ve)144 256.8 S
-1.425(rtical e).15 F 1.424
-(xageration which modulates the intensity of the shading; typical v)-.15
-F 1.424(alues are in the 1-5)-.25 F 2.757(range. The)144 268.8 R -.25
-(va)2.757 G(lue).25 E F1(azimuth)2.757 E F0 .257
-(is the azimuth from which the bath)2.757 F .258(ymetry is illuminated.)
--.05 F(If)5.258 E F1(mode)2.758 E F0 .258(is set)2.758 F .588
-(to 3 \(bath)144 280.8 R .587
-(ymetry shaded using amplitudes\) using the)-.05 F F2<ad47>3.087 E F0
-.587(option, then the v)3.087 F(alue)-.25 E F1(ma)3.087 E(gnitude)-.1 E
-F0(modu-)3.087 E .939(lates the intensity of the shading; the v)144
-292.8 R(alue)-.25 E F1(median)3.439 E F0 .94(sets the amplitude v)3.439
-F .94(alue which serv)-.25 F .94(es as the)-.15 F(zero or neutral le)144
-304.8 Q -.15(ve)-.25 G(l.).15 E F2<ad42>108 321.6 Q F1(tic)23.63 E
-(kinfo)-.2 E F0 .219(Sets map boundary tickmark interv)144 333.6 R .219
-(als. See the)-.25 F F2(psbasemap)2.719 E F0 .218
-(manual page for details. By def)2.719 F .218(ault the)-.1 F
-(program chooses basemap annotations based on the map boundaries.)144
-345.6 Q F2<ad43>108 362.4 Q F1
-([cont_int/col_int/tic_int/lab_int/tic_len/lab_hgt])23.08 E F0(Gi)144
-374.4 Q -.15(ve)-.25 G 2.657(nb).15 G 2.657(yi)-2.657 G .157(tself, the)
--2.657 F F2<ad43>2.657 E F0 .157
-(option produces a contour plot of the bath)2.657 F .157
-(ymetry data with a contour inter)-.05 F(-)-.2 E -.25(va)144 386.4 S
-3.166(lc).25 G .665
-(hosen according to the data in the \214le or \214les. If the)-3.166 F
-F2<ad47>3.165 E F0 .665(option is used, the def)3.165 F .665
-(ault contours)-.1 F 1.046(will be dra)144 398.4 R 1.047
-(wn in black; otherwise, the def)-.15 F 1.047(ault contours will be dra)
--.1 F 1.047(wn in four colors \(black, red,)-.15 F .732
-(green, and blue\) with color changes, annotations, and tickmarks e)144
-410.4 R -.15(ve)-.25 G .731(ry fourth contour interv).15 F 3.231(al. If)
--.25 F(an)144 422.4 Q 3.873(yo)-.15 G 3.873(ft)-3.873 G 1.373
-(he optional parameters are appended, these v)-3.873 F 1.374
-(alues will control the contour interv)-.25 F 1.374(al and)-.25 F 1.128
-(other contour characteristics.)144 434.4 R 1.128
-(Contours will be generated at in)6.128 F -.15(ve)-.4 G(rv).15 E 1.127
-(als of)-.25 F F1(cont_int)3.627 E F0 3.627(meters. Color)3.627 F 1.072
-(changes will occur at interv)144 446.4 R 1.072(als of)-.25 F F1
-(col_int)3.572 E F0 3.572(meters. Contours)3.572 F 1.073(will ha)3.572 F
-1.373 -.15(ve d)-.2 H -.25(ow).15 G 1.073(nhill f).25 F 1.073
-(acing tickmarks)-.1 F F1(tic_len)144 458.4 Q F0 .297(inches long e)
-2.797 F -.15(ve)-.25 G(ry).15 E F1(tic_int)2.796 E F0 .296
-(meters. Contours will ha)2.796 F .596 -.15(ve a)-.2 H(nnotations).15 E
-F1(lab_hgt)2.796 E F0 .296(inches high e)2.796 F -.15(ve)-.25 G(ry).15 E
-F1(lab_int)144 470.4 Q F0(meters.)2.5 E F2<ad44>108 487.2 Q F1
-([\215ipcolor/\215ipshade])23.08 E F0 1.13
-(This option \215ips the color and shading con)144 499.2 R -.15(ve)-.4 G
-1.131(ntions used by).15 F F2(mbm_plot)3.631 E F0 6.131(.N)C(ormally)
--6.131 E 3.631(,t)-.65 G 1.131(he color or)-3.631 F 1.33
-(grayscale tables used for color bath)144 511.2 R 1.329
-(ymetry maps run from cool colors \(or dark grays\) for lar)-.05 F(ge)
--.18 E .635(depth v)144 523.2 R .635
-(alues to hot colors \(or light grays\) for small depth v)-.25 F 3.136
-(alues. In)-.25 F .636(contrast, sidescan and beam)3.136 F .309(amplitu\
-de data is normally plotted using \(light grays \(or hot colors\) for s\
-mall amplitudes and dark)144 535.2 R .278
-(grays \(or cool colors\) for lar)144 547.2 R .278(ge amplitudes.)-.18 F
-(If)5.278 E F2<ad44>2.778 E F0 .278(is gi)2.778 F -.15(ve)-.25 G 2.778
-(na).15 G .279(lone or with)-2.778 F F1(\215ipcolor)2.779 E F0 2.779(=1)
-2.779 G 2.779(,i)-2.779 G 2.779(ta)-2.779 G .279(pplies to)-2.779 F
-1.006(the color table used for color or gray \214ll plots,)144 559.2 R
-1.006(shaded or unshaded. If the plot is to be shaded,)6.006 F .463
-(either by synthetic illumination \()144 571.2 R F2<ad47>A F1(2)A F0
-2.964(\)o)C 2.964(rb)-2.964 G 2.964(yo)-2.964 G -.15(ve)-3.114 G .464
-(rlaying amplitude data \().15 F F2<ad47>A F1(3)A F0 .464
-(option\), then setting)2.964 F F1(\215ipshade)144 583.2 Q F0 3.556(=1w)
-3.556 G 1.056(ill cause the shading con)-3.556 F -.15(ve)-.4 G 1.055
-(ntion to be re).15 F -.15(ve)-.25 G 1.055
-(rsed \(e.g. high amplitudes o).15 F -.15(ve)-.15 G 1.055(rlaid as).15 F
-.862(light shading\).)144 595.2 R(Using)5.862 E F2<ad44>3.363 E F1(0/1)A
-F0 .863(will \215ip the shading con)3.363 F -.15(ve)-.4 G .863(ntion b)
-.15 F .863(ut lea)-.2 F 1.163 -.15(ve t)-.2 H .863(he def).15 F .863
-(ault color con)-.1 F -.15(ve)-.4 G(n-).15 E(tion.)144 607.2 Q F2<ad46>
-108 624 Q F1(format)24.19 E F0 1.358
-(Sets the data format for the input data.)144 636 R(If)6.358 E F1
-(format)3.858 E F0 3.858(<0)3.858 G 3.858(,t)-3.858 G 1.358
-(hen the input \214le speci\214ed with the)-3.858 F F2<ad49>3.857 E F0
-1.163(option will actually contain a list of input sw)144 648 R 1.164
-(ath sonar data \214les. This program uses the)-.1 F F2(MBIO)3.664 E F0
-1.292(library and will read or write an)144 660 R 3.792(ys)-.15 G -.1
-(wa)-3.792 G 1.292(th sonar format supported by).1 F F2(MBIO)3.792 E F0
-3.792(.A)C 1.291(list of the sw)-.001 F(ath)-.1 E .39
-(sonar data formats currently supported by)144 672 R F2(MBIO)2.891 E F0
-.391(and their identi\214er v)2.891 F .391(alues is gi)-.25 F -.15(ve)
--.25 G 2.891(ni).15 G 2.891(nt)-2.891 G(he)-2.891 E F2(MBIO)2.891 E F0
-(manual page. Def)144 684 Q(ault:)-.1 E F1(format)2.5 E F0 2.5<3dad>2.5
-G(1.)-2.5 E F2<ad47>108 700.8 Q F1(mode)22.52 E F0 -.45(Tu)144 712.8 S
-(rns on color \214ll sw).45 E(ath plot and sets the style of the plot.)
--.1 E F1(mode)180 724.8 Q F0 2.5(=1)2.5 G 31.92(:C)-2.5 G
-(olor \214ll of bath)-31.92 E(ymetry data.)-.05 E(MB-System 5.0)72 768 Q
-2.5(9J)140.11 G(anuary 2015)-2.5 E(4)198.45 E 0 Cg EP
-%%Page: 5 5
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.05(mbm_plot\(1\) MB-System)72 48 R 147.05
-(5.0 mbm_plot\(1\))2.5 F/F1 10/Times-Italic at 0 SF(mode)180 84 Q F0 2.5
-(=2)2.5 G 31.92(:C)-2.5 G(olor shaded relief bath)-31.92 E(ymetry)-.05 E
-(.)-.65 E F1(mode)180 96 Q F0 2.5(=3)2.5 G 31.92(:B)-2.5 G(ath)-31.92 E
-(ymetry shaded using amplitude data.)-.05 E F1(mode)180 108 Q F0 2.5(=4)
-2.5 G 31.92(:G)-2.5 G(rayscale \214ll of amplitude data.)-31.92 E F1
-(mode)180 120 Q F0 2.5(=5)2.5 G 31.92(:G)-2.5 G
-(rayscale \214ll of sidescan data.)-31.92 E/F2 10/Times-Bold at 0 SF<ad48>
-108 136.8 Q F0 .162(This "help" \215ag cause the program to print out a\
- description of its operation and then e)22.52 F .161(xit immedi-)-.15 F
-(ately)144 148.8 Q(.)-.65 E F2<ad49>108 165.6 Q F1(\214lename)26.41 E F0
-.467(Sets the input \214lename. If)144 177.6 R F1(format)2.967 E F0
-2.967(>0\()2.967 G .467(set with the)-2.967 F F2<ad66>2.967 E F0 .467
-(option\) then the sw)2.967 F .468(ath sonar data contained)-.1 F(in)144
-189.6 Q F1(in\214le)2.943 E F0 .443(is read and processed. If)2.943 F F1
-(format)2.943 E F0 2.943(<0\()2.943 G .442(the def)-2.943 F .442
-(ault\), then)-.1 F F1(in\214le)2.942 E F0 .442
-(is assumed to be an ascii \214le)2.942 F .051
-(containing a list of the input sw)144 201.6 R .052
-(ath sonar data \214les to be processed and their formats.)-.1 F .052
-(The program)5.052 F .063
-(will read the data in each one of these \214les.)144 213.6 R .063
-(In the)5.063 F F1(in\214le)2.563 E F0 .063
-(\214le, each data \214le should be follo)2.563 F .062(wed by a)-.25 F
-(data format identi\214er)144 225.6 Q 2.5(,e)-.4 G(.g.:)-2.5 E
-(data\214le1 11)180 237.6 Q(data\214le2 24)180 249.6 Q .568
-(This program uses the)144 261.6 R F2(MBIO)3.068 E F0 .568
-(library and will read or write an)3.068 F 3.068(ys)-.15 G -.1(wa)-3.068
-G .568(th sonar format supported by).1 F F2(MBIO)144 273.6 Q F0 3.428
-(.Al)C .928(ist of the sw)-3.428 F .928
-(ath sonar data formats currently supported by)-.1 F F2(MBIO)3.428 E F0
-.928(and their identi\214er)3.428 F -.25(va)144 285.6 S(lues is gi).25 E
--.15(ve)-.25 G 2.5(ni).15 G 2.5(nt)-2.5 G(he)-2.5 E F2(MBIO)2.5 E F0
-(manual page.)2.5 E F2<ad4a>108 302.4 Q F1(pr)25.3 E(ojection)-.45 E F0
-([)A F1(/scale | /width)A F0(])A .367
-(Selects the map projection. By def)144 314.4 R .368
-(ault the map projection is Mercator and the plot scale is chosen)-.1 F
-.668(to \214t on the selected page size \(see)144 326.4 R F2<ad50>3.168
-E F0 .668(option\). The user may specify a dif)3.168 F .667
-(ferent projection to be)-.25 F .768(used, in which case the plot scale\
- is still automatically chosen to \214t the page. The user may also)144
-338.4 R .034(specify both the projection and the plot scale. If the pro\
-jection specifying character is upper case, a)144 350.4 R 1.508
-(plot width rather than a plot scale is used.)144 362.4 R 1.508
-(The scale v)6.508 F 1.508(alues are speci\214ed in inch/de)-.25 F 1.509
-(gree or in)-.15 F .829(1:xxxxx ratios. Plot widths are speci\214ed in \
-inches. If the user speci\214es a plot scale such that the)144 374.4 R
-(plot will not \214t on the def)144 386.4 Q
-(ault A size page, a appropriately lar)-.1 E
-(ger page size will be chosen.)-.18 E F2(CYLINDRICAL PR)144 410.4 Q
-(OJECTIONS:)-.3 E(\255Jc)144 434.4 Q F1(lon0/lat0/scale)A F0
-(\(Cassini\))2.5 E F2(\255Jm)144 446.4 Q F1(scale)A F0(\(Mercator\))2.5
-E F2<ad4a>144 458.4 Q(oa)-.15 E F1(lon0/lat0/azimuth/scale)A F0
-(\(Oblique Mercator \255 point and azimuth\))2.5 E F2<ad4a>144 470.4 Q
-(ob)-.15 E F1(lon0/lat0/lon1/lat1/scale)A F0(\(Oblique Mercator \255 tw)
-2.5 E 2.5(op)-.1 G(oints\))-2.5 E F2<ad4a>144 482.4 Q(oc)-.15 E F1
-(lon0/lat0/lonp/latp/scale)A F0
-(\(Oblique Mercator \255 point and pole\))2.5 E F2(\255Jq)144 494.4 Q F1
-(lon0/scale)A F0
-(\(Equidistant Cylindrical Projection \(Plate Carree\)\))2.5 E F2
-(\255Jt)144 506.4 Q F1(lon0/scale)A F0(\(TM \255 T)2.5 E(ransv)-.35 E
-(erse Mercator\))-.15 E F2<ad4a>144 518.4 Q(u)-.15 E F1(zone/scale)A F0
-(\(UTM \255 Uni)2.5 E -.15(ve)-.25 G(rsal T).15 E(ransv)-.35 E
-(erse Mercator\))-.15 E F2(\255Jy)144 530.4 Q F1(lon0/lats/scale)A F0
-(\(Basic Cylindrical Projection\))2.5 E F2(AZIMUTHAL PR)144 554.4 Q
-(OJECTIONS:)-.3 E<ad4a>144 578.4 Q(a)-.15 E F1(lon0/lat0/scale)A F0
-(\(Lambert\).)2.5 E F2<ad4a>144 590.4 Q(e)-.15 E F1(lon0/lat0/scale)A F0
-(\(Equidistant\).)2.5 E F2(\255Jg)144 602.4 Q F1(lon0/lat0/scale)A F0
-(\(Orthographic\).)2.5 E F2(\255Js)144 614.4 Q F1(lon0/lat0/scale)A F0
-(\(General Stereographic\))2.5 E F2(CONIC PR)144 638.4 Q(OJECTIONS:)-.3
-E(\255Jb)144 662.4 Q F1(lon0/lat0/lat1/lat2/scale)A F0(\(Albers\))2.5 E
-F2(\255Jl)144 674.4 Q F1(lon0/lat0/lat1/lat2/scale)A F0(\(Lambert\))2.5
-E F2(MISCELLANEOUS PR)144 698.4 Q(OJECTIONS:)-.3 E(\255Jh)144 722.4 Q F1
-(lon0/scale)A F0(\(Hammer\))2.5 E(MB-System 5.0)72 768 Q 2.5(9J)140.11 G
-(anuary 2015)-2.5 E(5)198.45 E 0 Cg EP
-%%Page: 6 6
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.05(mbm_plot\(1\) MB-System)72 48 R 147.05
-(5.0 mbm_plot\(1\))2.5 F/F1 10/Times-Bold at 0 SF(\255Ji)144 84 Q/F2 10
-/Times-Italic at 0 SF(lon0/scale)A F0(\(Sinusoidal\))2.5 E F1(\255Jk)144 96
-Q F2(lon0/scale)A F0(\(Eck)2.5 E(ert VI\))-.1 E F1(\255Jn)144 108 Q F2
-(lon0/scale)A F0(\(Robinson\))2.5 E F1(\255Jr)144 120 Q F2(lon0/scale)A
-F0(\(W)2.5 E(ink)-.4 E(el T)-.1 E(ripel\))-.35 E F1(\255Jw)144 132 Q F2
-(lon0/scale)A F0(\(Moll)2.5 E(weide\))-.1 E F1(NON-GEOGRAPHICAL PR)144
-156 Q(OJECTIONS:)-.3 E(\255Jp)144 180 Q F2(scale)A F0
-(\(Linear projection for polar \(theta,r\) coordinates\))2.5 E F1
-(\255Jx)144 192 Q F2(x-scale)A F0([)A F1(l|p)A F2(pow)A F0(][)A F2
-(/y-scale)A F0([)A F1(l|p)A F2(pow)A F0(]] \(Linear)A 2.5(,l)-.4 G
-(og, and po)-2.5 E(wer scaling\))-.25 E
-(More details can be found in the)144 204 Q F1(psbasemap)2.5 E F0
-(manpages.)2.5 E F1<ad4c>108 220.8 Q F2(title:scalelabel)23.63 E F0 .157
-(Sets the title and the label for the colorscale \(if used\) of the plo\
-t. Note that a colon \(:\) rather than a)144 232.8 R 1.557(slash \(/\) \
-is used to separate the labels. Colons cannot be used in the labels the\
-mselv)144 244.8 R 1.557(es. If this)-.15 F 1.367
-(option is not used, then a def)144 256.8 R 1.367
-(ault title and colorscale label are pro)-.1 F 1.367
-(vided. If the title is supplied)-.15 F .742(alone, a def)144 268.8 R
-.742(ault colorscale label will be pro)-.1 F .742(vided. T)-.15 F 3.242
-(of)-.8 G .742(orce no title use)-3.242 F F1<ad4c>3.241 E F0 3.241("")C
-3.241(;t)-3.241 G 3.241(of)-3.241 G .741(orce no title or)-3.241 F
-(colorscale label use)144 280.8 Q F1<ad4c>2.5 E F0 2.5(":")C(.)-2.5 E F1
-<ad4d>108 297.6 Q F0 3.055(As)20.86 G .555
-(eries of "miscellaneous" options are pro)-3.055 F .555
-(vided which are gi)-.15 F -.15(ve)-.25 G 3.055(na).15 G(s)-3.055 E F1
-<ad4d>3.055 E F0(follo)3.055 E .555(wed by a tw)-.25 F 3.055(oc)-.1 G
-(har)-3.055 E(-)-.2 E 1.329(acter identi\214er)144 309.6 R 3.829(,f)-.4
-G(ollo)-3.829 E 1.329(wed by an)-.25 F 3.829(yo)-.15 G 1.328
-(ther parameters associated with that option.)-3.829 F(The)6.328 E F1
-<ad4d>3.828 E F0(options)3.828 E .61(may be strung together separated b\
-y colons, e.g. "-MGQ100:GU", which is equi)144 321.6 R -.25(va)-.25 G
-.61(lent to "-MGQ).25 F(\255MGU".)144 333.6 Q F1(\255MGD)108 350.4 Q F2
-(gmtdef/value)5.86 E F0(Allo)144 362.4 Q .227(ws the user to set the)
--.25 F F1(GMT)2.727 E F0(def)2.727 E .227(ault v)-.1 F .227
-(alues used as the plot is constructed. This command may)-.25 F 1.133
-(be gi)144 374.4 R -.15(ve)-.25 G 3.633(nr).15 G 1.133
-(epeatedly to set as man)-3.633 F(y)-.15 E F1(GMT)3.633 E F0(def)3.633 E
-1.133(aults as required. F)-.1 F 1.133(or e)-.15 F 1.133
-(xample, to set the basemap)-.15 F(annotation font to Courier)144 386.4
-Q 2.5(,u)-.4 G(se "-MGD)-2.5 E(ANO)-.4 E(T_FONT/Courier".)-.4 E F1
-(\255MGF)108 403.2 Q F2(scale_loc)6.97 E F0
-(Sets the location of the color scale. The possible v)144 415.2 Q
-(alues of)-.25 E F2(scale_loc)2.5 E F0(are:)2.5 E F2(scale_loc)180 427.2
-Q F0 2.5(=b)2.5 G 15.81(:b)-2.5 G(ottom of plot)-15.81 E F2(scale_loc)
-180 439.2 Q F0 2.5(=t)2.5 G 18.03(:t)-2.5 G(op of plot)-18.03 E F2
-(scale_loc)180 451.2 Q F0 2.5(=l)2.5 G 18.03(:l)-2.5 G(eft of plot)
--18.03 E F2(scale_loc)180 463.2 Q F0 2.5(=r)2.5 G 17.48(:r)-2.5 G
-(ight of plot)-17.48 E([Def)144 475.2 Q(ault)-.1 E F2(scale_loc)2.5 E F0
-2.5(=b)2.5 G(])-2.5 E F1(\255MGL)108 492 Q F0([)6.41 E F2(f)A F0(][)A F2
-(x)A F0(])A F2(lon0/lat0/slat/length)A F0([)A F2(units)A F0(][)A F2
-(+llabel)A F0(])A(Dra)144 504 Q .16(ws a simple map scale centered on)
--.15 F F2(lon0/lat0)2.66 E F0 5.16(.U)C(se)-5.16 E F1(\255Lf)2.66 E F0
-.16(to get a "f)2.66 F(anc)-.1 E .16(y" scale [Def)-.15 F .16
-(ault is plain].)-.1 F(Use)144 516 Q F1(\255Lx)2.961 E F0 .461
-(to specify the position in inches instead of map units.)2.961 F .462
-(The scale is calculated at latitude)5.461 F F2(slat)144 528 Q F0 2.929
-(;i)C 2.929(ft)-2.929 G .429
-(he string "center" is used instead of a numerical v)-2.929 F .428
-(alue for)-.25 F F2(slat)2.928 E F0 2.928(,t)C .428
-(hen the macro will set the)-2.928 F 1.596
-(scaling according to the center of the plot bounds.)144 540 R 1.596
-(The scale length v)6.596 F(alue)-.25 E F2(length)4.096 E F0 1.596
-(is in km by)4.096 F(def)144 552 Q .279(ault, b)-.1 F .278(ut the units\
- can be speci\214ed as one of e|f|k|M|n|u, where e = meters, f = feet, \
-k = kilome-)-.2 F .911
-(ters, M = statue miles, n = nautical miles, and u = US surv)144 564 R
-1.212 -.15(ey f)-.15 H .912(eet. Append).15 F F2(+l)3.412 E F0 .912
-(to label the scale)3.412 F(with the rele)144 576 Q -.25(va)-.25 G
-(nt units, or append).25 E F2(+l"label")2.5 E F0(to set a dif)2.5 E
-(ferent label string.)-.25 E F1(\255MGQ)108 592.8 Q F2(dpi)5.3 E F0 .839
-(Sets the resolution in dots per inch of the raster image used for colo\
-r \214ll maps. Lar)144 604.8 R .838(ger v)-.18 F .838(alues of)-.25 F F2
-(dpi)144 616.8 Q F0(produce lar)2.5 E(ger Postscript plot \214les. [Def)
--.18 E(ault is 100].)-.1 E F1(\255MGT)108 633.6 Q F2
-(x/y/size/angle/font/just/te)6.41 E(xt)-.2 E F0 .487(Causes a te)144
-645.6 R .487(xt label to plotted on the map.)-.15 F F2(size)5.487 E F0
-.487(is te)2.987 F .488(xt size in points,)-.15 F F2(angle)2.988 E F0
-.488(is measured in de)2.988 F(grees)-.15 E(counter)144 657.6 Q .8
-(-clockwise from horizontal,)-.2 F F2(fontno)3.3 E F0 .8
-(sets the font type,)3.3 F F2(justify)3.3 E F0 .8(sets the alignment.)
-3.3 F(If)5.8 E F2(fontno)3.3 E F0 1.614(starts with a leading h)144
-669.6 R 1.615(yphen, then the remainder of)-.05 F F2(fontno)4.115 E F0
-1.615(is tak)4.115 F 1.615(en to be a te)-.1 F 1.615(xtstring with the)
--.15 F 1.023(desired fontname.)144 681.6 R 1.022(See the)6.023 F F1
-(gmtdefaults)3.522 E F0 1.022(man page for names and numbers of a)3.522
-F -.25(va)-.2 G 1.022(ilable fonts \(or).25 F(run)144 693.6 Q F1 .111
-(pstext \255L)2.611 F F0 2.611(\). The)B .111
-(alignment number refers to the part of the te)2.611 F .112
-(xtstring that will be mapped onto)-.15 F .29(the \()144 705.6 R F2(x,y)
-A F0 2.79(\)p)C .289(oint: 1 = Lo)-2.79 F .289(wer Left corner)-.25 F
-2.789(,2=L)-.4 G -.25(ow)-2.789 G .289(er Center).25 F 2.789(,3=L)-.4 G
--.25(ow)-2.789 G .289(er Right, 5 = Mid Left, 6 = Mid).25 F(Center)144
-717.6 Q 2.783(,7=M)-.4 G .283
-(id Right, 9 = Upper Left, 10 = Upper Center)-2.783 F 2.783(,1)-.4 G
-2.783(1=U)-2.783 G .283(pper Right. This option may be)-2.783 F(gi)144
-729.6 Q -.15(ve)-.25 G 2.5(na).15 G 2.5(sm)-2.5 G(an)-2.5 E 2.5(yt)-.15
-G(imes as needed.)-2.5 E(MB-System 5.0)72 768 Q 2.5(9J)140.11 G
-(anuary 2015)-2.5 E(6)198.45 E 0 Cg EP
-%%Page: 7 7
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.05(mbm_plot\(1\) MB-System)72 48 R 147.05
-(5.0 mbm_plot\(1\))2.5 F/F1 10/Times-Bold at 0 SF(\255MGU)108 84 Q F0([)
-5.86 E/F2 10/Times-Italic at 0 SF(/dx/dy/)A F0(][)A F2(label)A F0(])A(Dra)
-144 96 Q 2.636(wU)-.15 G .136(nix System time stamp on plot.)-2.636 F
-.135(User may specify where the lo)5.135 F .135
-(wer left corner of the stamp)-.25 F 1.925(should f)144 108 R 1.925
-(all on the page relati)-.1 F 2.225 -.15(ve t)-.25 H 4.426(ol).15 G -.25
-(ow)-4.426 G 1.926(er left corner of plot in inch [Def).25 F 1.926
-(ault is \(-0.75,-0.75\)].)-.1 F(Optionally)144 120 Q 2.5(,a)-.65 G
-(ppend a label, or)-2.5 E F1(c)2.5 E F0
-(\(which will plot the command string.\))2.5 E F1(\255MMA)108 136.8 Q F2
-(factor/mode/depth)A F0 1.215(This option determines ho)144 148.8 R
-3.715(wt)-.25 G 1.214(he along-track dimension of the beam or pix)-3.715
-F 1.214(el footprints is calcu-)-.15 F 1.762(lated. If)144 160.8 R F2
-(mode)4.262 E F0 4.262(=1)4.262 G 4.262(,t)-4.262 G 1.762(hen the fore-\
-aft beam angle width of the sonar is used so that the width)-4.262 F
-.403(increases to)144 172.8 R -.1(wa)-.25 G .403
-(rds the outer parts of the sw).1 F 2.903(ath. The)-.1 F .403
-(fore-aft beam angle width \()2.903 F F1(MB-System)A F0(inter)2.902 E(-)
--.2 E .529(nally stores a v)144 184.8 R .529
-(alue for each format/sonar\) is multiplied by the)-.25 F F2(factor)3.03
-E F0 -.25(va)3.03 G .53(lue; a).25 F F2(factor)3.03 E F0 3.03(<1)3.03 G
-.53(.0 can be)-3.03 F .388(useful if the data highly o)144 196.8 R -.15
-(ve)-.15 G .388(rsamples the sea\215oor and a).15 F F2(factor)2.888 E F0
-2.888(>1)2.888 G .388(.0 can \214ll in plots of data which)-2.888 F .064
-(undersample the sea\215oor)144 208.8 R 2.564(.I)-.55 G 2.564(ft)-2.564
-G .064(he data stream does not include depth v)-2.564 F .065
-(alues \(e.g. one is plotting pure)-.25 F 1.019
-(sidescan data\), then the)144 220.8 R F2(depth)3.518 E F0 -.25(va)3.518
-G 1.018(lue sets the depth v).25 F 1.018
-(alue in meters used in the footprint calcula-)-.25 F 2.515(tions. If)
-144 232.8 R F2(mode)2.515 E F0 2.515(=2)2.515 G 2.515(,t)-2.515 G .015
-(hen the along-track dimension of the beam or pix)-2.515 F .015
-(el footprints is just the along-)-.15 F .627
-(track distance between pings multiplied by the)144 244.8 R F2(factor)
-3.127 E F0 -.25(va)3.127 G 3.127(lue. If).25 F .627
-(mode = 3, then each data point is)3.127 F .424
-(plotted as a point, and the f)144 256.8 R .425
-(actor and depth parameters are ignored.)-.1 F(Def)5.425 E(ault:)-.1 E
-F2(factor)2.925 E F0 2.925(=1)2.925 G(.0,)-2.925 E F2(mode)2.925 E F0(=)
-2.925 E(1,)144 268.8 Q F2(depth)2.5 E F0 2.5(=3)2.5 G(000.0.)-2.5 E F1
-(\255MMB)108 285.6 Q F2(yr/mo/da/hr/mn/sc)A F0 .614
-(Sets the starting time for data allo)144 297.6 R .614
-(wed in the input data; pings with times before the starting time)-.25 F
-(will be ignored.)144 309.6 Q(Def)5 E(ault:)-.1 E F2(yr/mo/da/hr/mn/sc)
-2.5 E F0 2.5(=1)2.5 G(962/2/21/10/30/0.)-2.5 E F1(\255MMD)108 326.4 Q F2
-(mode/scale[/min/max])A F0 .875
-(Sets scaling of beam amplitude or sidescan pix)144 338.4 R .875(el v)
--.15 F .876(alues which can be applied before plotting. If)-.25 F F2
-(mode)144 350.4 Q F0 2.5(=1o)2.5 G 2.5(r2)-2.5 G 2.5(,t)-2.5 G
-(hen a linear scaling of the form:)-2.5 E(scaled_v)180 362.4 Q
-(alue = scale * \(v)-.25 E(alue \255 min\) / \(max \255 min\))-.25 E
-(is applied.)144 374.4 Q(If)5 E F2(mode)2.5 E F0 2.5(=3o)2.5 G 2.5(r4)
--2.5 G 2.5(,t)-2.5 G(hen a log10 scaling of the form:)-2.5 E(scaled_v)
-180 386.4 Q(alue = scale * \(20 * log10\(v)-.25 E
-(alue\) \255 min\) / \(max \255 min\))-.25 E 1.143(is applied.)144 398.4
-R(If)6.143 E F2(mode)3.643 E F0 3.643(=2o)3.643 G 3.643(r4)-3.643 G
-3.643(,t)-3.643 G 1.143(hen the v)-3.643 F 1.142(alue \(or 20*log10\(v)
--.25 F 1.142(alue\)\) will be clipped to)-.25 F F2(min)3.642 E F0 1.142
-(if it is)3.642 F .501(smaller than)144 410.4 R F2(min)3.001 E F0(or)
-3.001 E F2(max)3.001 E F0 .502(if it is greater than)3.002 F F2(max)
-3.002 E F0 3.002(;t)C .502
-(his clipping happens prior to the multiplication)-3.002 F(by)144 422.4
-Q F2(scale)2.5 E F0 2.5(.D)C(ef)-2.5 E(ault:)-.1 E F2(mode)2.5 E F0 2.5
-(=1)2.5 G(,)-2.5 E F2(scale)2.5 E F0 2.5(=1)2.5 G(.0,)-2.5 E F2(min)2.5
-E F0 2.5(=0)2.5 G(.0,)-2.5 E F2(max)2.5 E F0 2.5(=1)2.5 G(.0.)-2.5 E F1
-(\255MME)108 439.2 Q F2(yr/mo/da/hr/mn/sc)A F0 .287
-(Sets the ending time for data allo)144 451.2 R .287
-(wed in the input data; pings with times after the ending time will)-.25
-F(be ignored.)144 463.2 Q(Def)5 E(ault:)-.1 E F2(yr/mo/da/hr/mn/sc)2.5 E
-F0 2.5(=2)2.5 G(062/2/21/10/30/0.)-2.5 E F1(\255MML)108 480 Q F2
-(lon\215ip)A F0 .05(If the)144 492 R F1<ad52>2.55 E F0 .05
-(option is not used to e)2.55 F .05
-(xplicitly set the plot bounds, then the)-.15 F F2(lon\215ip)2.55 E F0
--.25(va)2.55 G .05(lue sets the range of).25 F 1.197(the longitude v)144
-504 R 1.197(alues used for calculating the desired bounds.)-.25 F 3.697
-(If lon\215ip=\2551)6.197 F 3.697(then the longitude)3.697 F -.25(va)144
-516 S .655(lues will be in the range from \255360 to 0 de).25 F .656
-(grees. If lon\215ip=0 then the longitude v)-.15 F .656(alues will be)
--.25 F 2.772(in the)144 528 R 2.772(range from)2.772 F .272
-(\255180 to 180 de)2.772 F .272
-(grees. If lon\215ip=1 then the longitude v)-.15 F .271
-(alues will be in the range)-.25 F(from 0)144 540 Q 2.5(to 360 de)5 F 5
-(grees. Def)-.15 F(ault:)-.1 E F1(mbm_plot)2.5 E F0(uses the)2.5 E F2
-(lon\215ip)2.5 E F0 -.25(va)2.5 G(lue set by).25 E F1(mbdefaults)2.5 E
-F0(.)A F1(\255MMN)108 556.8 Q F2(nplot)A F0 .586(Sets the number of pin\
-gs to be read in before each contouring episode. See the description of\
- the)144 568.8 R F1(\255MMZ)144 580.8 Q F2(algorithm)A F0 1.126
-(option for advice on reasonable v)3.626 F 1.125(alues Def)-.25 F(ault:)
--.1 E F2(nplot)3.625 E F0 3.625(=5)3.625 G 3.625(0u)-3.625 G(nless)
--3.625 E F1(\255MMZ)3.625 E F2(1)A F0(is)3.625 E
-(speci\214ed, in which case the def)144 592.8 Q(ault is)-.1 E F2(nplot)
-2.5 E F0 2.5(=5)2.5 G(.)-2.5 E F1(\255MMP)108 609.6 Q F2(pings)A F0 .498
-(Sets the ping a)144 621.6 R -.15(ve)-.2 G .498(raging of the input sw)
-.15 F .498(ath sonar data. If)-.1 F F2(pings)2.998 E F0 2.999(=1)2.999 G
-2.999(,t)-2.999 G .499(hen no ping a)-2.999 F -.15(ve)-.2 G .499
-(raging is per).15 F(-)-.2 E .212(formed. If)144 633.6 R F2(pings)2.712
-E F0 2.712(>0)2.712 G 2.712(,t)-2.712 G .212
-(hen that number of input pings will be a)-2.712 F -.15(ve)-.2 G .211
-(raged to produce one output ping.).15 F(If)144 645.6 Q F2(pings)2.871 E
-F0 2.871(=0)2.871 G 2.871(,t)-2.871 G .372(hen the ping a)-2.871 F -.15
-(ve)-.2 G .372
-(raging will automatically be done so that the along-track ping spac-)
-.15 F(ing is equal to the across-track beam spacing.)144 657.6 Q(Def)5 E
-(ault:)-.1 E F2(pings)2.5 E F0 2.5(=1\()2.5 G(no ping a)-2.5 E -.15(ve)
--.2 G(raging\).).15 E F1(\255MMS)108 674.4 Q F2(speedmin)A F0 .532
-(Sets the minimum speed in km/hr \(5.5 kts ~ 10 km/hr\) allo)144 686.4 R
-.531(wed in the input data; pings associated)-.25 F
-(with a smaller ship speed will not be processed. Def)144 698.4 Q(ault:)
--.1 E F2(speed)2.5 E F0 2.5(=0)2.5 G(.)-2.5 E(MB-System 5.0)72 768 Q 2.5
-(9J)140.11 G(anuary 2015)-2.5 E(7)198.45 E 0 Cg EP
-%%Page: 8 8
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.05(mbm_plot\(1\) MB-System)72 48 R 147.05
-(5.0 mbm_plot\(1\))2.5 F/F1 10/Times-Bold at 0 SF(\255MMT)108 84 Q/F2 10
-/Times-Italic at 0 SF(time)144 96 Q(gap)-.4 E F0 .478
-(Sets the maximum time g)144 108 R .479
-(ap in minutes between adjacent pings allo)-.05 F .479
-(wed before the data is consid-)-.25 F(ered to ha)144 120 Q .3 -.15
-(ve a g)-.2 H(ap. Def).1 E(ault:)-.1 E F2(time)2.5 E(gap)-.4 E F0 2.5
-(=1)2.5 G(.)-2.5 E F1(\255MMZ)108 136.8 Q F2(algorithm)144 148.8 Q F0
-2.487(Sets the contouring algorithm to be used. If)144 160.8 R F2
-(algorithm)4.986 E F0 2.486(=0, a simple ping to ping contouring)B .885
-(approach is used; this algorithm is f)144 172.8 R .885(ast b)-.1 F .886
-(ut produces poor looking contours when used with data)-.2 F .377
-(where beams from one ping may lie "behind" beams from pre)144 184.8 R
-.376(vious pings \(this happens for sonars)-.25 F .355(that ping at non\
-null pitch angles or for the "inside" beams when ships mak)144 196.8 R
-2.856(es)-.1 G .356(harp turns\).)-2.856 F(If)5.356 E F2(algo-)2.856 E
-(rithm)144 208.8 Q F0 .473(=1 then a triangular netw)B .472
-(ork is constructed from the a)-.1 F -.25(va)-.2 G .472
-(ilable soundings and this netw).25 F .472(ork is)-.1 F .837
-(in turn contoured; this algorithm is slo)144 220.8 R 3.337(wb)-.25 G
-.838(ut produces good looking contours in most cases. It is)-3.537 F
-.915(important to note that the time required for "triangle" algorithm \
-increases with the square of the)144 232.8 R .804
-(number of beams to be contoured; thus it is sensible to k)144 244.8 R
-.805(eep the number of pings contoured at a)-.1 F .395
-(time small \(e.g. use)144 256.8 R F1<ad4e>2.895 E F2(5)A F0 2.895
-(\). The)B .395(time required for the "ping to ping" algorithm v)2.895 F
-.395(aries linearly with)-.25 F 1.138
-(the number of pings contoured; thus lar)144 268.8 R 1.139
-(ger numbers of pings may be reasonably contoured at a)-.18 F
-(time \(e.g. use)144 280.8 Q F1<ad4e>2.5 E F2(50)A F0 2.5(\). Def)B
-(ault:)-.1 E F2(algorithm)2.5 E F0 2.5(=0u)2.5 G(nless)-2.5 E F2(format)
-2.5 E F0 2.5(=4)2.5 G(1.)-2.5 E F1(\255MN)108 297.6 Q(A)-.2 E F2
-([nhgt[/P] | P])6.62 E F0 -.45(Tu)144 309.6 S .427
-(rns on \214lename annotation of na).45 F(vig)-.2 E .427
-(ation tracks. If)-.05 F F1(\255MN)2.926 E(A)-.2 E F0 .426(is gi)2.926 F
--.15(ve)-.25 G 2.926(nw).15 G .426(ithout specifying an)-2.926 F 2.926
-(yc)-.15 G(on-)-2.926 E .68
-(trolling parameters, then the lettering height)144 321.6 R F2(nhgt)
-3.181 E F0 .681(is 0.15 and the \214lenames are plotted parallel to)
-3.181 F .795(the na)144 333.6 R(vig)-.2 E .794(ation track from the sta\
-rt of the track. The lettering height can be speci\214ed using either)
--.05 F F1(\255MN)144 345.6 Q(A)-.2 E F2(nhgt)A F0(or)2.896 E F1(\255MN)
-2.897 E(A)-.2 E F2(nhgt/P)A F0 5.397(.I)C(f)-5.397 E F1(\255MN)2.897 E
-(A)-.2 E F2(P)A F0(or)2.897 E F1(\255MN)2.897 E(A)-.2 E F2(nhgt/P)A F0
-.397(is speci\214ed, the \214lename will be plot-)2.897 F .401
-(ted perpendicular to the na)144 357.6 R(vig)-.2 E .401(ation track.)
--.05 F .401(Filename annotation can also be speci\214ed using the)5.401
-F F1<ad4e>2.9 E F0 2.5(option. Def)144 369.6 R
-(aults: Filename annotation of)-.1 E(f.)-.25 E F1(\255MNP)108 386.4 Q F2
-([pingnumber_tic)7.53 E(k/pingnumber_annot/pingnumber_tic)-.2 E(k_len])
--.2 E F0 -.45(Tu)144 398.4 S 1.421
-(rns on ping number \(or shot number\) annotation of na).45 F(vig)-.2 E
-1.421(ation tracks.)-.05 F -.35(Ti)6.421 G 1.421(ck marks are made).35 F
-.288(along the shiptrack at)144 410.4 R F2(pingnumber_tic)2.787 E(k)-.2
-E F0(interv)2.787 E .287(als; these are)-.25 F F2(tlen)2.787 E F0 .287
-(inches long. Longer tick marks are)2.787 F 1.744
-(made along the shiptrack at)144 422.4 R F2(pingnumber_annot)4.244 E F0
-(interv)4.245 E 1.745(als; these are 1.5 times)-.25 F F2(tlen)4.245 E F0
-1.745(inches long.)4.245 F(Def)144 434.4 Q .34
-(aults: Pingnumber annotation of)-.1 F .34(f. If the)-.25 F F1(\255MNP)
-2.84 E F0 .34(option is gi)2.84 F -.15(ve)-.25 G 2.84(nw).15 G .34
-(ithout specifying the control-)-2.84 F .766(ling parameters, then)144
-446.4 R F2(pingnumber_tic)3.266 E(k)-.2 E F0 3.266(=5)3.266 G(0,)-3.266
-E F2(pingnumber_annot)3.266 E F0 3.266(=1)3.266 G .766(00, and)-3.266 F
-F2(pingnumber_tic)3.266 E(k_len)-.2 E F0 2.5(=0)144 458.4 S(.1.)-2.5 E
-F1(\255MTC)108 475.2 Q F2(\214ll)6.97 E F0 2.235
-(Coastline plotting option.)144 487.2 R 2.234(Set the shade \(0-255\), \
-color \(r/g/b\), or pattern \(p|Pdpi/pattern; see)7.234 F F1(\255MTG)144
-499.2 Q F0 2.5(\)f)C(or lak)-2.5 E 2.5(es [Def)-.1 F
-(ault is the \214ll chosen for "wet" areas \(-S\)].)-.1 E F1(\255MTD)108
-516 Q F2 -.37(re)6.97 G(solution).37 E F0 1.62
-(Coastline plotting option.)144 528 R 1.621(Selects the resolution of t\
-he coastline data set to use \(\(f\)ull, \(h\)igh,)6.62 F .694
-(\(i\)ntermediate, \(1\)o)144 540 R 1.994 -.65(w, a)-.25 H .694
-(nd \(c\)rude\).).65 F .694(The resolution drops of)5.694 F 3.194(fb)
--.25 G 3.194(y8)-3.194 G .694(0% between data sets. [Def)-3.194 F(ault)
--.1 E(is l].)144 552 Q F1(\255MTG)108 568.8 Q F2(\214ll)6.41 E F0 .591
-(Coastline plotting option.)144 580.8 R .591
-(Select painting or clipping of "dry" areas.)5.591 F .592
-(Append a shade, color)5.592 F 3.092(,p)-.4 G(at-)-3.092 E .999
-(tern, or c for clipping.)144 592.8 R .998
-(Specify the shade \(0-255\) or color \(r/g/b\), or)5.999 F F1(\255MTG)
-3.498 E F2(pdpi/pattern)A F0 3.498(,w)C(here)-3.498 E .131(pattern gi)
-144 604.8 R -.15(ve)-.25 G 2.631(st).15 G .131(he number of the b)-2.631
-F .132
-(uilt-in pattern \(1-90\) OR the name of a Sun 1-, 8-, or 24-bit raster)
--.2 F 2.983(\214le. dpi)144 616.8 R .482
-(sets the resolution of the image.)2.983 F(See)5.482 E F1(GMT)2.982 E F0
-.482(Cookbook & T)2.982 F .482(echnical Reference Appendix)-.7 F 2.5(Ef)
-144 628.8 S(or information on indi)-2.5 E(vidual patterns.)-.25 E F1
-(\255MTI)108 645.6 Q F2(river[/pen])10.3 E F0 1.456
-(Coastline plotting option.)144 657.6 R(Dra)6.457 E 3.957(wr)-.15 G
--2.15 -.25(iv e)-3.957 H 3.957(rs. Specify).25 F 1.457(the type of ri)
-3.957 F -.15(ve)-.25 G 1.457(rs and [optionally] append pen).15 F
-(attrib)144 669.6 Q 3.479(utes [Def)-.2 F .978
-(ault pen: width = 1, color = 0/0/0, te)-.1 F .978(xture = solid].)-.15
-F .978(Choose from the list of ri)5.978 F -.15(ve)-.25 G(r).15 E
-(types belo)144 681.6 Q 3.8 -.65(w. R)-.25 H
-(epeat option \255I as often as necessary).65 E(.)-.65 E 2.5(1=P)156.5
-693.6 S(ermanent major ri)-2.5 E -.15(ve)-.25 G(rs).15 E 2.5(2=A)156.5
-705.6 S(dditional major ri)-2.5 E -.15(ve)-.25 G(rs).15 E 2.5(3=A)156.5
-717.6 S(dditional ri)-2.5 E -.15(ve)-.25 G(rs).15 E 2.5(4=M)156.5 729.6
-S(inor ri)-2.5 E -.15(ve)-.25 G(rs).15 E(MB-System 5.0)72 768 Q 2.5(9J)
-140.11 G(anuary 2015)-2.5 E(8)198.45 E 0 Cg EP
-%%Page: 9 9
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.05(mbm_plot\(1\) MB-System)72 48 R 147.05
-(5.0 mbm_plot\(1\))2.5 F 2.5(5=I)156.5 84 S(ntermittent ri)-2.5 E -.15
-(ve)-.25 G(rs \255 major).15 E 2.5(6=I)156.5 96 S(ntermittent ri)-2.5 E
--.15(ve)-.25 G(rs \255 additional).15 E 2.5(7=I)156.5 108 S
-(ntermittent ri)-2.5 E -.15(ve)-.25 G(rs \255 minor).15 E 2.5(8=M)156.5
-120 S(ajor canals)-2.5 E 2.5(9=M)156.5 132 S(inor canals)-2.5 E
-(10 = Irrig)156.5 144 Q(ation canals)-.05 E 2.5(a=A)156.5 156 S(ll ri)
--2.5 E -.15(ve)-.25 G(rs and canals \(1-10\)).15 E 2.5(r=A)156.5 168 S
-(ll permanent ri)-2.5 E -.15(ve)-.25 G(rs \(1-4\)).15 E 2.5(i=A)156.5
-180 S(ll intermittent ri)-2.5 E -.15(ve)-.25 G(rs \(5-7\)).15 E 2.5(c=A)
-156.5 192 S(ll canals \(8-10\))-2.5 E/F1 10/Times-Bold at 0 SF(\255MTN)108
-208.8 Q/F2 10/Times-Italic at 0 SF(bor)6.97 E(der[/pen])-.37 E F0 .839
-(Coastline plotting option.)144 220.8 R(Dra)5.839 E 3.339(wp)-.15 G .839
-(olitical boundaries.)-3.339 F .839
-(Specify the type of boundary and [option-)5.839 F .547
-(ally] append pen attrib)144 232.8 R .547(utes [Def)-.2 F .546
-(ault pen:)-.1 F .546(width = 1, color = 0/0/0, te)5.546 F .546
-(xture = solid].)-.15 F .546(Choose from)5.546 F
-(the list of boundaries belo)144 244.8 Q 3.8 -.65(w. R)-.25 H
-(epeat option).65 E F1(\255MTN)2.5 E F0(as often as necessary)2.5 E(.)
--.65 E 2.5(1=N)156.5 256.8 S(ational boundaries)-2.5 E 2.5(2=S)156.5
-268.8 S(tate boundaries within the Americas)-2.5 E 2.5(3=M)156.5 280.8 S
-(arine boundaries)-2.5 E 2.5(a=A)156.5 292.8 S(ll boundaries \(1-3\))
--2.5 E F1(\255MTS)108 309.6 Q F2(\214ll)8.63 E F0 .776
-(Coastline plotting option.)144 321.6 R .777
-(Select painting or clipping of "wet" areas.)5.777 F .777
-(Append the shade \(0-255\),)5.777 F(color \(r/g/b\), pattern \(see)144
-333.6 Q F1(\255MTG)2.5 E F0(\), or c for clipping.)A F1(\255MTW)108
-350.4 Q F2(pen)144 362.4 Q F0 1.079(Coastline plotting option.)144 374.4
-R 1.079(Append pen attrib)6.079 F 3.579(utes [Def)-.2 F 3.579
-(aults: width)-.1 F 3.578(=1)3.579 G 3.578(,c)-3.578 G 1.078
-(olor = 0/0/0, te)-3.578 F 1.078(xture =)-.15 F(solid].)144 386.4 Q F1
-(\255MXG)108 403.2 Q F2(\214ll)5.86 E F0 .393
-(Select \214lling of symbols for xy plotting.)144 415.2 R .393
-(Set the shade \(0-255\) or color \(r/g/b\) [Def)5.393 F .393
-(ault is no \214ll].)-.1 F 2.549 -.8(To r)144 427.2 T .949
-(eset no \214ll, use).8 F F2(\214ll)3.449 E F0 3.449(=")3.449 G 3.449
-(N". F)-3.449 F .948(or polygons, you may optionally specify)-.15 F F1
-(\255Gp)3.448 E F2(icon_size/pattern)A F0(,)A(where)144 439.2 Q F2
-(pattern)3.651 E F0(gi)3.651 E -.15(ve)-.25 G 3.651(st).15 G 1.151(he n\
-umber of the image pattern \(1-32\) OR the name of a icon-format \214le\
-.)-3.651 F F2(icon_size)144 451.2 Q F0 1.129
-(sets the unit size in inch.)3.629 F 2.728 -.8(To i)6.128 H -1.85 -.4
-(nv e).8 H 1.128(rt black and white pix).4 F 1.128(els, use)-.15 F F1
-(\255GP)3.628 E F0 1.128(instead of)3.628 F F1(\255Gp)3.628 E F0(.)A
-(See)144 463.2 Q F1(GMTs)2.5 E F0(Cookbook & T)2.5 E
-(echnical Reference Appendix E for information on indi)-.7 E
-(vidual patterns.)-.25 E F1(\255MXI)108 480 Q F2(xy_\214le)9.75 E F0
-.481(Speci\214es a \214le containing \(x,y\) pairs to be plotted as lin\
-es or symbols. The line and symbol char)144 492 R(-)-.2 E .533
-(acteristics are set using the last)144 504 R F1(\255MXG)3.033 E F0(,)A
-F1(\255MXS)3.033 E F0 3.033(,a)C(nd)-3.033 E F1(\255MXW)3.033 E F0 .533
-(options used. All of the)3.033 F F1(\255MX)3.033 E F0(com-)3.033 E .142
-(mands can be gi)144 516 R -.15(ve)-.25 G 2.642(nm).15 G .143(ultiple t\
-imes, so by stringing series of these commands together the user can)
--2.642 F(plot dif)144 528 Q(ferent \214les using dif)-.25 E
-(ferent line or symbol characteristics.)-.25 E([Def)5 E
-(ault is a solid black line].)-.1 E F1(\255MXM)108 544.8 Q F0 -.8(To)144
-556.8 S 1.24(ggles e).8 F 1.24(xpectation for xy data \214les ha)-.15 F
-1.24(ving multiple se)-.2 F 1.24(gments, in which each se)-.15 F 1.24
-(gment is to be)-.15 F 1.505(plotted separately)144 568.8 R 4.005(.S)
--.65 G -.15(eg)-4.005 G 1.506
-(ments are separated by a record whose \214rst character is '>'. By def)
-.15 F(ault,)-.1 E(unse)144 580.8 Q 1.879(gmented \214les are e)-.15 F
-1.878(xpected. Users may gi)-.15 F 2.178 -.15(ve t)-.25 H 1.878
-(his command multiple times, allo).15 F 1.878(wing some)-.25 F
-(input \214les to be handled as se)144 592.8 Q(gmented and others not.)
--.15 E F1(\255MXS)108 609.6 Q F2(symbol/size)8.08 E F0 .332
-(Selects symbol to be used for plotting the ne)144 621.6 R .332
-(xt xy data \214le. Setting)-.15 F F2(symbol)2.832 E F0 2.833(=")2.832 G
-.333(N" causes line plot-)-2.833 F 2.5(ting. Choose)144 633.6 R
-(between:)2.5 E F1(\255MXSa)108 650.4 Q F0(st)144 662.4 Q F1(a)A F0 -.55
-(r.)C F2(size)5.55 E F0(is radius of circumscribing circle.)2.5 E F1
-(\255MXSb)108 679.2 Q(b)144 691.2 Q F0 .922(ar e)B .922(xtending from)
--.15 F F2(base)3.421 E F0 .921(to y)3.421 F(.)-.65 E F2(size)5.921 E F0
-.921(is bar width.)3.421 F .921(By def)5.921 F(ault,)-.1 E F2(base)3.421
-E F0 3.421(=0)3.421 G 5.921(.A)-3.421 G .921(ppend /)-5.921 F F2(base)A
-F0 .921(to change)3.421 F(this v)144 703.2 Q 2.5(alue. Append)-.25 F F1
-(u)2.5 E F0(if)2.5 E F2(size)2.5 E F0(is in x-units [Def)2.5 E
-(ault is inch].)-.1 E(MB-System 5.0)72 768 Q 2.5(9J)140.11 G
-(anuary 2015)-2.5 E(9)198.45 E 0 Cg EP
-%%Page: 10 10
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.05(mbm_plot\(1\) MB-System)72 48 R 147.05
-(5.0 mbm_plot\(1\))2.5 F/F1 10/Times-Bold at 0 SF(\255MXSc)108 84 Q(c)144
-96 Q F0(ircle.)A/F2 10/Times-Italic at 0 SF(size)5 E F0
-(is diameter of circle.)2.5 E F1(\255MXSd)108 112.8 Q(d)144 124.8 Q F0
-(iamond.)A F2(size)5 E F0(is side of diamond.)2.5 E F1(\255MXSe)108
-141.6 Q(e)144 153.6 Q F0 5.678(llipse. Direction)B 3.178(\(in de)5.678 F
-3.178
-(grees counterclockwise from horizontal\), major_axis \(in inch\), and)
--.15 F(minor_axis \(in inch\) must be found in columns 3, 4, and 5.)144
-165.6 Q F1(\255MXSf)108 182.4 Q(f)144 194.4 Q F0 2.529(ault. Gi)B .329
--.15(ve d)-.25 H .029(istance g).15 F .029
-(ap between ticks and ticklength in inch.)-.05 F .029(If g)5.029 F .029
-(ap is ne)-.05 F -.05(ga)-.15 G(ti).05 E -.15(ve)-.25 G 2.529(,i).15 G
-2.528(ti)-2.529 G 2.528(si)-2.528 G .028(nterpreted to)-2.528 F .399
-(mean number of ticks instead.)144 206.4 R(Append)5.399 E F1(l)2.899 E
-F0(or)2.899 E F1(r)2.899 E F0 .399(to dra)2.899 F 2.899(wt)-.15 G .399
-(ick on the left or right side of line [Def)-2.899 F(ault)-.1 E
-(is centered].)144 218.4 Q(Upper case)5 E F1(L)2.5 E F0(or)2.5 E F1(R)
-2.5 E F0(dra)2.5 E(ws a triangle instead of line se)-.15 E(gment.)-.15 E
-F1(\255MXSh)108 235.2 Q(h)144 247.2 Q F0 -.15(ex)C 2.5(agon. Gi).15 F .3
--.15(ve s)-.25 H(ide in inch.).15 E F1 2.8(\255MXSi i)108 264 R F0 -1.85
--.4(nv e)D(rted triangle.).4 E(Gi)5 E .3 -.15(ve s)-.25 H(ide in inch.)
-.15 E F1 2.8(\255MXSl l)108 280.8 R F0 .406(etter or te)B .406
-(xt string.)-.15 F(Gi)5.406 E .706 -.15(ve s)-.25 H .406
-(ize in inch, and append /).15 F F2(string)A F0 .406(after the size.)
-2.906 F .405(Note that the size is only)5.406 F .919
-(approximate; no indi)144 292.8 R .919(vidual scaling is done for dif)
--.25 F .919(ferent characters.)-.25 F .92(Remember to escape special)
-5.919 F(characters lik)144 304.8 Q 2.5(e*)-.1 G(.)-2.5 E F1(\255MXSp)108
-321.6 Q(p)144 333.6 Q F0 2.5(oint. No)B
-(size needs to be speci\214ed \(1 pix)2.5 E(el is used\).)-.15 E F1
-(\255MXSs)108 350.4 Q(s)144 362.4 Q F0 2.5(quare. Gi)B .3 -.15(ve s)-.25
-H(ide in inch.).15 E F1(\255MXSt)108 379.2 Q(t)144 391.2 Q F0 2.5
-(riangle. Gi)B .3 -.15(ve s)-.25 H(ide in inch.).15 E F1(\255MXSv)108
-408 Q(v)144 420 Q F0(ector)A 7(.D)-.55 G 2(irection \(in de)-7 F 2(gree\
-s counterclockwise from horizontal\) and length \(in inch\) must be)-.15
-F .036(found in columns 3 and 4.)144 432 R F2(size)5.036 E F0 2.536(,i)C
-2.536(fp)-2.536 G .036(resent, will be interpreted as arro)-2.536 F
-(wwidth/headlength/headwidth)-.25 E 2.104(\(in inch\) [Def)144 444 R
-2.104(ault is 0.03/0.12/0.1 inch].)-.1 F 2.104(By def)7.104 F 2.104
-(ault arro)-.1 F 4.604(wa)-.25 G(ttrib)-4.604 E 2.104(utes remains in)
--.2 F -.25(va)-.4 G 2.103(riant to the).25 F .028(length of the arro)144
-456 R 3.829 -.65(w. T)-.25 H 2.529(oh)-.15 G -2.25 -.2(av e)-2.529 H
-.029(the size of the v)2.729 F .029(ector scale do)-.15 F .029
-(wn with decreasing size, append n)-.25 F F2(norm)A F0(,)A(where v)144
-468 Q(ectors shorter than)-.15 E F2(norm)2.5 E F0(will ha)2.5 E .3 -.15
-(ve t)-.2 H(heir attrib).15 E(utes scaled by length/)-.2 E F2(norm)A F0
-(.)A F1(\255MXSV)108 484.8 Q F0 .794(Same as)144 496.8 R F1(\255MXSv)
-3.294 E F0 3.294(,e)C .794(xcept azimuth \(in de)-3.444 F .793
-(grees east of north\) should be gi)-.15 F -.15(ve)-.25 G 3.293(ni).15 G
-.793(nstead of direction.)-3.293 F .079(The azimuth will be mapped into\
- an angle based on the chosen map projection \()144 508.8 R F1(\255MXSv)
-A F0(lea)2.58 E -.15(ve)-.2 G 2.58(st).15 G(he)-2.58 E
-(directions unchanged.\))144 520.8 Q F1(\255MXSx)108 537.6 Q F0 2.5
-(cross. Gi)144 549.6 R .3 -.15(ve l)-.25 H(ength in inch.).15 E F1
-(\255MXW)108 566.4 Q F2(pen)144 578.4 Q F0 .784(Set pen attrib)144 590.4
-R .784(utes for xy plotting. See chapter 4.12 in the GMT T)-.2 F .783
-(echnical reference for a discus-)-.7 F(sion of GMT pen v)144 602.4 Q
-2.5(alues. [Def)-.25 F(aults: width = 1, color = 0/0/0, te)-.1 E
-(xture = solid].)-.15 E F1<ad4e>108 619.2 Q F2([ttic)23.08 E
-(k/tannot/dannot/tlen[/nhgt/nperp]] | F | FP])-.2 E F0 .341
-(This option causes a na)144 631.2 R(vig)-.2 E .342(ation track plot to\
- be generated, and can also set the start of each sw)-.05 F(ath)-.1 E
-.957(\214le to be annotated with the \214lename. If the)144 643.2 R F1
-<ad4e>3.457 E F0 .957(option is gi)3.457 F -.15(ve)-.25 G 3.457(na).15 G
-.957(lone, then the na)-3.457 F(vig)-.2 E .957(ation track)-.05 F .499
-(will be plotted without an)144 655.2 R 2.999(ya)-.15 G 2.999
-(nnotation, The)-2.999 F .499(optional parameters allo)2.999 F 2.999(wu)
--.25 G .5(sers to control the details)-2.999 F 1.659(of the na)144 667.2
-R(vig)-.2 E 1.659(ation track annotation. T)-.05 F 1.658
-(ime marks are made with "X" marks along the shiptrack;)-.35 F .576
-(annotated time marks sho)144 679.2 R 3.076(wt)-.25 G .576
-(he time in HH:MM format ne)-3.076 F .577
-(xt to the time mark and annotated date)-.15 F .266(marks sho)144 691.2
-R 2.766(wt)-.25 G .266(he time and julian day in HH:MM/DDD format.)
--2.766 F .265(The "X" marks are)5.266 F F2(tlen)2.765 E F0 .265
-(inches high)2.765 F .27(for normal time marks and 1.5 times)144 703.2 R
-F2(tlen)2.77 E F0 .27(inches high for annotated time or date marks.)2.77
-F .27(The inter)5.27 F(-)-.2 E -.25(va)144 715.2 S 2.824(lo).25 G 2.824
-(ft)-2.824 G .324
-(ime ticks, annotated time ticks, and annotated date ticks are gi)-2.824
-F -.15(ve)-.25 G 2.823(ni).15 G 2.823(nh)-2.823 G .323(ours by)-2.823 F
-F2(ttic)2.823 E(k)-.2 E F0(,)A F2(tannot)2.823 E F0(,)A(and)144 727.2 Q
-F2(dannot)5.042 E F0 5.042(,r)C(especti)-5.042 E -.15(ve)-.25 G(ly).15 E
-7.542(.I)-.65 G 5.042(ft)-7.542 G(he)-5.042 E F2(nhgt)5.042 E F0 2.542
-(parameter is not gi)5.042 F -.15(ve)-.25 G 5.042(nw).15 G 2.542
-(hen the other parameters are)-5.042 F(MB-System 5.0)72 768 Q 2.5(9J)
-140.11 G(anuary 2015)-2.5 E(10)193.45 E 0 Cg EP
-%%Page: 11 11
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.05(mbm_plot\(1\) MB-System)72 48 R 147.05
-(5.0 mbm_plot\(1\))2.5 F .575
-(speci\214ed, then no \214lename annotation will be done. If gi)144 84 R
--.15(ve)-.25 G(n,).15 E/F1 10/Times-Italic at 0 SF(nhgt)3.075 E F0 .574
-(sets the height in inches of the)3.075 F .486
-(\214lename annotation and turns that annotation on. If gi)144 96 R -.15
-(ve)-.25 G 2.986(na).15 G 2.986(s1)-2.986 G(,)-2.986 E F1(nperp)2.986 E
-F0 .486(causes the \214lename annota-)2.986 F .199(tion to be perpendic\
-ular to the shiptrack rather than parallel \(the def)144 108 R .199
-(ault\). If the)-.1 F/F2 10/Times-Bold at 0 SF<ad4e>2.699 E F1(F)A F0 .198
-(is gi)2.698 F -.15(ve)-.25 G .198(n, then).15 F 2.522(an)144 120 S -.2
-(av)-2.522 G(ig).2 E .022(ation track will be generated using the def)
--.05 F .022(ault parameters and also with \214lename annotation)-.1 F
-1.869(along the shiptrack. If the)144 132 R F2<ad4e>4.369 E F1(FP)A F0
-1.869(is gi)4.369 F -.15(ve)-.25 G 1.869(n, then a na).15 F(vig)-.2 E
-1.868(ation track will be generated with the)-.05 F(def)144 144 Q 1.078
-(ault parameters and also with \214lename annotation perpendicular to t\
-he shiptrack.)-.1 F(Def)6.079 E 1.079(aults if)-.1 F
-(annotation is enabled:)144 156 Q F1(ttic)2.5 E(k)-.2 E F0 2.5(=0)2.5 G
-(.25;)-2.5 E F1(tannot)2.5 E F0 2.5(=1)2.5 G(.0;)-2.5 E F1(dannot)2.5 E
-F0 2.5(=4)2.5 G(.0;)-2.5 E F1(tlen)2.5 E F0 2.5(=0)2.5 G(.1;)-2.5 E F1
-(nhgt)2.5 E F0 2.5(=0)2.5 G(.1;)-2.5 E F1(nperp)2.5 E F0 2.5(=0)2.5 G(.)
--2.5 E F2<ad4f>108 172.8 Q F1 -.45(ro)22.52 G(ot).45 E F0 .423(Sets the\
- root used to construct the \214lename of the output shellscript \()144
-184.8 R F1 -.45(ro)C(ot).45 E F0 .422(.cmd\) and names of \214les)B .21
-(created when the shellscript is run.)144 196.8 R .21(By def)5.21 F .21
-(ault, the name of the input data \214le or list \214le is used as)-.1 F
-(the)144 208.8 Q F1 -.45(ro)2.5 G(ot).45 E F0(.)A F2<ad50>108 225.6 Q F1
-(pa)24.19 E -.1(ge)-.1 G(size).1 E F0 .632(This option sets the size of\
- the page the plot will be centered on. If the user does not set the pl\
-ot)144 237.6 R .125(scale, the plot will be sized as lar)144 249.6 R
-.125(ge as will \214t on the designated page. If the user sets the plot\
- scale)-.18 F .948
-(such that the plot will not \214t on the designated page, a lar)144
-261.6 R .948(ger page will be used.)-.18 F .947(The supported)5.947 F
-(page sizes are:)144 273.6 Q(American ANSI sizes:)169 297.6 Q 12.5(A8)
-169 309.6 S(.5 x 11.0 in.)-12.5 E 2.5(\(2)10 G(15.9 x)-2.5 E(279.4 mm\))
-5 E 10(B1)169 321.6 S(1.0 x 17.0 in.)-10 E 2.5(\(2)10 G(79.4 x)-2.5 E
-(431.8 mm\))5 E 10(C1)169 333.6 S(7.0 x 22.0 in.)-10 E 2.5(\(4)10 G
-(31.8 x)-2.5 E(558.8 mm\))5 E 10(D2)169 345.6 S(2.0 x 34.0 in.)-10 E 2.5
-(\(5)10 G(58.8 x)-2.5 E(863.6 mm\))5 E 10(E3)169 357.6 S(4.0 x 44.0 in.)
--10 E 2.5(\(8)10 G(63.6 x 1117.6 mm\))-2.5 E 10(F2)169 369.6 S
-(8.0 x 40.0 in.)-10 E 2.5(\(7)10 G(11.2 x 1016.0 mm\))-2.5 E 5(E1 44.0)
-169 381.6 R 2.5(x6)2.5 G(8.0 in.)-2.5 E(\(1117.6 x 1727.2 mm\))10 E
-(Metric ISO A sizes:)169 405.6 Q 5(A0 841.0)169 417.6 R 2.5(x1)2.5 G
-(189.0 mm)-2.5 E(\(33.11 x 46.81 in.\))5 E 5(A1 594.0)169 429.6 R 5(x8)
-2.5 G(41.0 mm)-5 E(\(23.39 x 33.11 in.\))5 E 5(A2 420.0)169 441.6 R 5
-(x5)2.5 G(94.0 mm)-5 E(\(16.54 x 23.39 in.\))5 E 5(A3 297.0)169 453.6 R
-5(x4)2.5 G(20.0 mm)-5 E(\(11.69 x 16.54 in.\))5 E 5(A4 210.0)169 465.6 R
-5(x2)2.5 G(97.0 mm)-5 E 2.5(\(8)5 G(.27 x 11.69 in.\))-2.5 E 5(A5 148.0)
-169 477.6 R 5(x2)2.5 G(10.0 mm)-5 E 2.5(\(5)5 G(.83 x)-2.5 E(8.27 in.\))
-5 E 5(A6 105.0)169 489.6 R 5(x1)2.5 G(48.0 mm)-5 E 2.5(\(4)5 G(.13 x)
--2.5 E(5.83 in.\))5 E 7.5(A7 74.0)169 501.6 R 5(x1)2.5 G(05.0 mm)-5 E
-2.5(\(2)5 G(.91 x)-2.5 E(4.13 in.\))5 E 7.5(A8 52.0)169 513.6 R 7.5(x7)
-2.5 G(4.0 mm)-7.5 E 2.5(\(2)5 G(.05 x)-2.5 E(2.91 in.\))5 E 7.5(A9 37.0)
-169 525.6 R 7.5(x5)2.5 G(2.0 mm)-7.5 E 2.5(\(1)5 G(.46 x)-2.5 E
-(2.05 in.\))5 E 5(A10 26.0)169 537.6 R 7.5(x3)2.5 G(7.0 mm)-7.5 E 2.5
-(\(1)5 G(.02 x)-2.5 E(1.46 in.\))5 E(Metric ISO B sizes:)169 561.6 Q 5
-(B0 1000.0x)169 573.6 R(1414.0 mm)2.5 E(\(39.37 x 55.67 in.\))5 E 5
-(B1 707.0)169 585.6 R 2.5(x1)2.5 G(000.0 mm)-2.5 E
-(\(27.83 x 39.37 in.\))5 E 5(B2 500.0)169 597.6 R 5(x7)2.5 G(07.0 mm)-5
-E(\(19.68 x 27.83 in.\))5 E 5(B3 353.0)169 609.6 R 5(x5)2.5 G(00.0 mm)-5
-E(\(13.90 x 19.68 in.\))5 E 5(B4 250.0)169 621.6 R 5(x3)2.5 G(53.0 mm)-5
-E 2.5(\(9)5 G(.84 x 13.90 in.\))-2.5 E 5(B5 176.0)169 633.6 R 5(x2)2.5 G
-(50.0 mm)-5 E 2.5(\(6)5 G(.93 x)-2.5 E(9.84 in.\))5 E 5(B6 125.0)169
-645.6 R 5(x1)2.5 G(76.0 mm)-5 E 2.5(\(4)5 G(.92 x)-2.5 E(6.93 in.\))5 E
-7.5(B7 88.0)169 657.6 R 5(x1)2.5 G(25.0 mm)-5 E 2.5(\(3)5 G(.46 x)-2.5 E
-(4.92 in.\))5 E 7.5(B8 62.0)169 669.6 R 7.5(x8)2.5 G(8.0 mm)-7.5 E 2.5
-(\(2)5 G(.44 x)-2.5 E(3.46 in.\))5 E 7.5(B9 44.0)169 681.6 R 7.5(x6)2.5
-G(2.0 mm)-7.5 E 2.5(\(1)5 G(.73 x)-2.5 E(2.44 in.\))5 E 5(B10 31.0)169
-693.6 R 7.5(x4)2.5 G(4.0 mm)-7.5 E 2.5(\(1)5 G(.22 x)-2.5 E(1.73 in.\))5
-E(Metric ISO C sizes:)169 717.6 Q 5(C0 914.4)169 729.6 R 2.5(x1)2.5 G
-(300.5 mm)-2.5 E(\(36.00 x 51.20 in.\))5 E(MB-System 5.0)72 768 Q 2.5
-(9J)140.11 G(anuary 2015)-2.5 E(11)193.45 E 0 Cg EP
-%%Page: 12 12
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.05(mbm_plot\(1\) MB-System)72 48 R 147.05
-(5.0 mbm_plot\(1\))2.5 F 5(C1 650.2)169 84 R 5(x9)2.5 G(14.4 mm)-5 E
-(\(25.60 x 36.00 in.\))5 E 5(C2 457.2)169 96 R 5(x6)2.5 G(50.2 mm)-5 E
-(\(18.00 x 25.60 in.\))5 E 5(C3 325.1)169 108 R 5(x4)2.5 G(57.2 mm)-5 E
-(\(12.80 x 18.00 in.\))5 E 5(C4 228.6)169 120 R 5(x3)2.5 G(25.1 mm)-5 E
-2.5(\(9)5 G(.00 x 12.80 in.\))-2.5 E 5(C5 162.6)169 132 R 5(x2)2.5 G
-(28.6 mm)-5 E 2.5(\(6)5 G(.40 x)-2.5 E(9.00 in.\))5 E 5(C6 114.3)169 144
-R 5(x1)2.5 G(62.6 mm)-5 E 2.5(\(4)5 G(.50 x)-2.5 E(6.40 in.\))5 E 7.5
-(C7 81.3)169 156 R 5(x1)2.5 G(14.3 mm)-5 E 2.5(\(3)5 G(.20 x)-2.5 E
-(4.50 in.\))5 E(MB-System lar)185 180 Q(ge format sizes:)-.18 E 2.5
-(m1 1371.6)169 192 R 2.5(x1)2.5 G(828.8 mm)-2.5 E(\(54.00 x 72.00 in.\))
-5 E 2.5(m2 1371.6)169 204 R 2.5(x2)2.5 G(133.6 mm)-2.5 E
-(\(54.00 x 84.00 in.\))5 E 2.5(m3 1371.6)169 216 R 2.5(x2)2.5 G
-(438.4 mm)-2.5 E(\(54.00 x 96.00 in.\))5 E 2.5(m4 1524.0)169 228 R 2.5
-(x1)2.5 G(828.8 mm)-2.5 E(\(60.00 x 72.00 in.\))5 E 2.5(m5 1524.0)169
-240 R 2.5(x2)2.5 G(133.6 mm)-2.5 E(\(60.00 x 84.00 in.\))5 E 2.5
-(m6 1524.0)169 252 R 2.5(x2)2.5 G(438.4 mm)-2.5 E(\(60.00 x 96.00 in.\))
-5 E(The def)144 276 Q(ault page size is A.)-.1 E/F1 10/Times-Bold at 0 SF
-<ad51>108 292.8 Q F0(Normally)22.52 E 2.866(,t)-.65 G .367
-(he output plot generation shellscript includes lines which e)-2.866 F
--.15(xe)-.15 G .367(cute a program to display).15 F 1.072
-(the Postscript image on the screen.)144 304.8 R 1.071
-(This option causes those lines to be commented out so that)6.071 F -.15
-(exe)144 316.8 S .147
-(cuting the shellscript produces a Postscript plot b).15 F .148
-(ut does not attempt to display it on the screen.)-.2 F(Alternati)144
-328.8 Q -.15(ve)-.25 G(ly).15 E 2.892(,i)-.65 G -1.9 -.4(nv o)-2.892 H
-.392(king the plot generation shellscript with a).4 F F1(-N)2.891 E F0
-.391(command line ar)2.891 F .391(gument also sup-)-.18 F .227(presses \
-the screen display of the plot. The program to be used to display the P\
-ostscript is set using)144 340.8 R F1(mbdefaults)144 352.8 Q F0 7.891
-(;t)C 5.391(he def)-7.891 F 5.391(ault v)-.1 F 5.391(alue can be o)-.25
-F -.15(ve)-.15 G 5.391(rridden by setting the en).15 F 5.39(vironment v)
--.4 F(ariable)-.25 E($MB_PS_VIEWER.)144 364.8 Q F1<ad52>108 381.6 Q/F2
-10/Times-Italic at 0 SF(west/east/south/north)23.08 E F0 .779
-(Sets the longitude and latitude bounds within which sw)144 393.6 R .78
-(ath sonar data will be read. Normally the)-.1 F
-(bounds are automatically chosen to include all of the input data.)144
-405.6 Q F1<ad53>108 422.4 Q F2([color/shade])24.74 E F0 1.073
-(This option enables ef)144 434.4 R(fecti)-.25 E 1.373 -.15(ve h)-.25 H
-1.072(istogram equalization of the color and/or shading of thedata. The)
-.15 F 1.016(equalization is not achie)144 446.4 R -.15(ve)-.25 G 3.516
-(db).15 G 3.516(yc)-3.516 G 1.017(hanging the data v)-3.516 F 1.017
-(alues, b)-.25 F 1.017(ut rather by constructing the color or)-.2 F
-1.325(shading tables so that the boundaries in the tables encompass equ\
-al fractions of the datapoints.)144 458.4 R 1.11(This serv)144 470.4 R
-1.11(es to focus color or shading contrasts in v)-.15 F 1.111
-(alue ranges corresponding to the b)-.25 F 1.111(ulk of the)-.2 F .71
-(data v)144 482.4 R .71(alues, and is particularly useful for enhancing\
- the contrast of sidescan and beam amplitude)-.25 F 3.587(plots. If)144
-494.4 R F1<ad53>3.587 E F0 1.087(is gi)3.587 F -.15(ve)-.25 G 3.587(na)
-.15 G 1.087(lone or with)-3.587 F F2(color)3.587 E F0 3.587(=1)3.587 G
-3.587(,i)-3.587 G 3.587(te)-3.587 G 1.088
-(nables equalization of the color table used for)-3.587 F .289
-(color or gray \214ll plots,)144 506.4 R .289
-(shaded or unshaded. If the plot is to be shaded,)5.289 F .288
-(either by synthetic illumi-)5.289 F .459(nation \()144 518.4 R F1<ad47>
-A F2(2)A F0 2.959(\)o)C 2.959(rb)-2.959 G 2.959(yo)-2.959 G -.15(ve)
--3.109 G .459(rlaying amplitude data \().15 F F1<ad47>A F2(3)A F0 .459
-(option\), then setting)2.959 F F2(shade)2.96 E F0 2.96(=1w)2.96 G .46
-(ill cause the)-2.96 F .163(shading to be equalized.)144 530.4 R(Using)
-5.163 E F1<ad53>2.663 E F2(0/1)A F0 .163
-(will equalize the shading without equalizing the color table.)2.663 F
-F1<ad54>108 547.2 Q F0(If)23.63 E F1<ad54>3.252 E F0 .752(is gi)3.252 F
--.15(ve)-.25 G .752(n, it causes a coastline to be dra).15 F .753
-(wn on the map. The def)-.15 F .753(ault is to dra)-.1 F 3.253(wt)-.15 G
-.753(he coastline)-3.253 F .314(and shade all dry land a uniform gray)
-144 559.2 R 2.814(.T)-.65 G 2.814(oe)-3.614 G -.15(xe)-2.964 G .313
-(rcise greater control of the coastline plotting, use the).15 F F1
-(\255MTC)144 571.2 Q F0(,)A F1(\255MTD)2.5 E F0(,)A F1(\255MTG)2.5 E F0
-(,)A F1(\255MTI)2.5 E F0(,)A F1(\255MTN)2.5 E F0(,)A F1(\255MTS)2.5 E F0
-2.5(,a)C(nd)-2.5 E F1(\255MTW)2.5 E F0(options described in the)2.5 E F1
-<ad55>108 588 Q F2(orientation)23.08 E F0 .2(Normally the orientation o\
-f the plot \(portrait or landscape\) is selected automatically so as to\
- maxi-)144 600 R .334(mize the plot scale.)144 612 R(The)5.333 E F1
-<ad55>2.833 E F0 .333(option allo)2.833 F .333
-(ws the user to set the plot orientation. If)-.25 F F2(orientation)2.833
-E F0 2.833(=1)2.833 G 2.833(,a)-2.833 G
-(portrait plot will be produced; if)144 624 Q F2(orientation)2.5 E F0
-2.5(=2)2.5 G 2.5(,al)-2.5 G(andscape plot will be produced.)-2.5 E F1
-<ad56>108 640.8 Q F0(Causes)23.08 E F1(mbm_plot)2.5 E F0
-(to operate in "v)2.5 E
-(erbose" mode so that it outputs more information than usual.)-.15 E F1
-<ad57>108 657.6 Q F2([color_style)20.3 E F0([)A F2(/palette)A F0([)A F2
-(ncolor)A(s)-.1 E F0(]] | cpt\214le])A
-(This option controls the color scheme used for color \214ll plots.)144
-669.6 Q(If)144 693.6 Q F2(color_style)3.135 E F0 3.136(=1[)3.135 G(def)
--3.136 E .636(ault], then the color scheme used will be a continuous gr\
-ading of colors. If)-.1 F F2(color_style)144 705.6 Q F0 2.816(=2)2.816 G
-2.816(,t)-2.816 G .316
-(he color scheme will be a set of discrete color interv)-2.816 F .315
-(als. The color palette used is)-.25 F(set using)144 717.6 Q F2(palette)
-2.5 E F0 2.5(.S)C -2.15 -.25(ev e)-2.5 H 2.5(np).25 G(alettes are a)-2.5
-E -.25(va)-.2 G(ilable:).25 E F2(palette)180 729.6 Q F0 2.5(=1)2.5 G
-26.36(:H)-2.5 G(axby colors [def)-26.36 E(ault])-.1 E(MB-System 5.0)72
-768 Q 2.5(9J)140.11 G(anuary 2015)-2.5 E(12)193.45 E 0 Cg EP
-%%Page: 13 13
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.05(mbm_plot\(1\) MB-System)72 48 R 147.05
-(5.0 mbm_plot\(1\))2.5 F/F1 10/Times-Italic at 0 SF(palette)180 84 Q F0 2.5
-(=2)2.5 G 26.36(:h)-2.5 G(igh Intensity colors)-26.36 E F1(palette)180
-96 Q F0 2.5(=3)2.5 G 26.36(:l)-2.5 G .5 -.25(ow I)-26.36 H
-(ntensity colors).25 E F1(palette)180 108 Q F0 2.5(=4)2.5 G 26.36(:g)
--2.5 G(rayscale)-26.36 E F1(palette)180 120 Q F0 2.5(=5)2.5 G 26.36(:u)
--2.5 G(niform grayscale)-26.36 E F1(palette)180 132 Q F0 2.5(=6)2.5 G
-26.36(:u)-2.5 G(niform black)-26.36 E F1(palette)180 144 Q F0 2.5(=7)2.5
-G 26.36(:u)-2.5 G(niform white)-26.36 E
-(The RGB de\214nitions of the color palettes are:)144 168 Q
-(color palette 1 \255 Haxby Color T)144 192 Q(able)-.8 E 5(red: 255)149
-204 R(255 255 255 240 205 138 106)2.5 E 2.5(50 40 37)5 F
-(green: 255 186 161 189 236 255 236 235 190 127)149 216 Q(57)5 E 2.5
-(blue: 255)149 228 R 2.5(133 68 87)2.5 F(121 162 174 255 255 251 175)2.5
-E(color palette 2 \255 High Intensity Colors)144 252 Q 5(red: 255)149
-264 R(255 255 255 128)2.5 E 7.5(0000)7.5 G(128 255)-5 E 5(green: 0)149
-276 R(64 128 255 255 255 255 128)5 E 7.5(000)7.5 G 7.5(blue: 0)149 288 R
-7.5(00000)7.5 G(255 255 255 255 255)-5 E(color palette 3 \255 Lo)144 312
-Q 2.5(wI)-.25 G(ntensity Colors)-2.5 E 5(red: 200)149 324 R(194 179 141)
-2.5 E 5(90 0 0 0 0)5 F(90 141)5 E 5(green: 0)149 336 R 2.5(49 90)5 F
-(141 179 200 141)2.5 E 5(90 0 0 0)5 F 7.5(blue: 0)149 348 R 7.5(00000)
-7.5 G(141 179 200 179 141)-5 E(color palette 4 \255 Grayscale)144 372 Q
-5(red: 255)149 384 R(230 204 179 153 128 102)2.5 E 2.5(77 51 26)5 F(0)
-7.5 E(green: 255 230 204 179 153 128 102)149 396 Q 2.5(77 51 26)5 F(0)
-7.5 E 2.5(blue: 255)149 408 R(230 204 179 153 128 102)2.5 E 2.5
-(77 51 26)5 F(0)7.5 E(color palette 5 \255 Uniform Grayscale)144 432 Q 5
-(red: 128)149 444 R(128 128 128 128 128 128 128 128 128 128)2.5 E
-(green: 128 128 128 128 128 128 128 128 128 128 128)149 456 Q 2.5
-(blue: 128)149 468 R(128 128 128 128 128 128 128 128 128 128)2.5 E
-(color palette 6 \255 Uniform Black)144 492 Q 10(red: 0)149 504 R 7.5
-(0000000000)7.5 G 5(green: 0 0 0 0 0 0 0 0 0 0 0)149 516 R 7.5(blue: 0)
-149 528 R 7.5(0000000000)7.5 G(color palette 7 \255 Uniform White)144
-552 Q 5(red: 255)149 564 R(255 255 255 255 255 255 255 255 255 255)2.5 E
-(green: 255 255 255 255 255 255 255 255 255 255 255)149 576 Q 2.5
-(blue: 255)149 588 R(255 255 255 255 255 255 255 255 255 255)2.5 E .365
-(The Haxby colors ha)144 612 R .665 -.15(ve b)-.2 H .366
-(een adapted from a palette de).15 F -.15(ve)-.25 G .366(loped by Dr).15
-F 2.866(.W)-.55 G .366(illiam Haxby of the Lam-)-3.266 F .32
-(ont-Doherty Earth Observ)144 624 R .319
-(atory; this palette is pleasing to the e)-.25 F .319
-(ye and well suited for shading. The)-.15 F .309(high intensity colors \
-describe linear paths through RGB space from red to blue to green to pu\
-rple;)144 636 R .438(because the colors are high intensity the)144 648 R
-2.938(ya)-.15 G .437(re not well suited to shading.)-2.938 F .437
-(The lo)5.437 F 2.937(wi)-.25 G .437(ntensity colors)-2.937 F .517
-(are similar to the high intensity)144 660 R 3.017(,b)-.65 G .517
-(ut muted and thus well suited to shading.)-3.217 F .517
-(The grayscale palette)5.517 F .499(runs linearly from white to black a\
-nd is commonly used for plots of sidescan and amplitude data.)144 672 R
-(The uniform grayscale is useful for non-color shaded relief plots.)144
-684 Q(The)144 708 Q F1(ncolor)2.606 E(s)-.1 E F0 .107
-(parameter sets the number of color v)2.606 F .107
-(alues used in plotting, whether the colors are rep-)-.25 F(resented in\
- a continuous color scale or a stepped, discrete color scale [def)144
-720 Q(ault is 11].)-.1 E(MB-System 5.0)72 768 Q 2.5(9J)140.11 G
-(anuary 2015)-2.5 E(13)193.45 E 0 Cg EP
-%%Page: 14 14
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.05(mbm_plot\(1\) MB-System)72 48 R 147.05
-(5.0 mbm_plot\(1\))2.5 F .523(If the option ar)144 84 R .522
-(gument is the path to an e)-.18 F(xisting)-.15 E/F1 10/Times-Bold at 0 SF
-(GMT)3.022 E F0 .522(color palette \(CPT\) \214le, then that CPT \214le)
-3.022 F(and its color scheme will be used for the plot)144 96 Q F1<ad58>
-108 112.8 Q F0(Normally)23.08 E(,)-.65 E F1(mbm_plot)3.263 E F0 .764
-(creates an e)3.263 F -.15(xe)-.15 G .764
-(cutable shellscript and then e).15 F 3.264(xits. This)-.15 F .764
-(option will cause the)3.264 F(shellscript to be e)144 124.8 Q -.15(xe)
--.15 G(cuted in the background before).15 E F1(mbm_plot)2.5 E F0 -.15
-(ex)2.5 G(its.).15 E F1<ad59>108 141.6 Q F0(Normally)23.08 E(,)-.65 E F1
-(mbm_plot)3.709 E F0 1.208(generates nicely rounded numbers for the bou\
-ndaries of the color palette.)3.709 F .894
-(Often, the resulting color bounds e)144 153.6 R .895
-(xtend well outside the range of the gridded data.)-.15 F .895
-(This option)5.895 F .478
-(causes the color boundaries to be uniformly distrib)144 165.6 R .477
-(uted between the minimum and maximum v)-.2 F(al-)-.25 E
-(ues of the grid.)144 177.6 Q F1<ad5a>108 194.4 Q/F2 10/Times-Italic at 0
-SF(min/max)23.63 E F0 .829(This option o)144 206.4 R -.15(ve)-.15 G .829
-(rrides the minimum and maximum v).15 F .829(alues of bath)-.25 F .829
-(ymetry data, af)-.05 F .83(fecting the color)-.25 F
-(palette and the contour interv)144 218.4 Q
-(al if those parameters are not speci\214ed by the user)-.25 E(.)-.55 E
-/F3 10.95/Times-Bold at 0 SF(EXAMPLES)72 247.2 Q F0 .211(Suppose we ha)108
-259.2 R .511 -.15(ve o)-.2 H .211(btained a sw).15 F .211
-(ath sonar data \214le called sb2112_e)-.1 F .21
-(xample.mb41 collected using a SeaBeam)-.15 F 1.33(2112 sonar)108 271.2
-R 6.33(.T)-.55 G 1.33(his \214le contains bath)-6.33 F(ymetry)-.05 E
-3.831(,b)-.65 G 1.331
-(eam amplitude, and sidescan data. In order to obtain initial)-3.831 F
-(vie)108 283.2 Q .7(ws of the data in the \214le, we use)-.25 F F1
-(mbm_plot)3.199 E F0 .699
-(to generate shellscripts which in turn generate plots when)3.199 F -.15
-(exe)108 295.2 S 4.008(cuted. The).15 F(follo)4.008 E 1.508(wing \214v)
--.25 F 4.008(ec)-.15 G 1.508
-(ommands generate plotting shellscripts for color \214ll bath)-4.008 F
-1.509(ymetry o)-.05 F -.15(ve)-.15 G(rlaid).15 E 1.579
-(with contours, color shaded relief bath)108 307.2 R(ymetry)-.05 E 4.078
-(,c)-.65 G 1.578(olor \214ll bath)-4.078 F 1.578(ymetry o)-.05 F -.15
-(ve)-.15 G 1.578(rlaid with amplitudes, grayscale).15 F
-(amplitudes, and grayscale sidescan, respecti)108 319.2 Q -.15(ve)-.25 G
-(ly:).15 E(mbm_plot \255F41 \255I sb2112_e)144 343.2 Q
-(xample.mb41 \255G1 \255C)-.15 E(\\)10 E(-N \255V \255Obathcont)180
-355.2 Q(mbm_plot \255F41 \255I sb2112_e)144 367.2 Q(xample.mb41 \255G2)
--.15 E(\\)17.5 E(-N \255V \255Obathshade)180 379.2 Q
-(mbm_plot \255F41 \255I sb2112_e)144 391.2 Q
-(xample.mb41 \255G3 \255S0/1 \\)-.15 E(-N \255V \255Obathamp)180 403.2 Q
-(mbm_plot \255F41 \255I sb2112_e)144 415.2 Q(xample.mb41 \255G4 \255S)
--.15 E(\\)10 E(-N \255V \255Oamp)180 427.2 Q
-(mbm_plot \255F41 \255I sb2112_e)144 439.2 Q(xample.mb41 \255G5 \255S)
--.15 E(\\)10 E(-N \255V \255Oss)180 451.2 Q .632(When the follo)108
-475.2 R .632(wing shellscripts are e)-.25 F -.15(xe)-.15 G .633(cuted, \
-each will generate a postscript plot \214le and then display the).15 F
-(plot on the screen:)108 487.2 Q(bathcont.cmd)144 511.2 Q(bathshade.cmd)
-144 523.2 Q(bathamp.cmd)144 535.2 Q(amp.cmd)144 547.2 Q(ss.cmd)144 559.2
-Q .379(Note that we use the)108 583.2 R F1<ad53>2.879 E F0 .378(option \
-to apply histogram equalization to the amplitude and sidescan data, b)
-2.879 F .378(ut not)-.2 F .628(the bath)108 595.2 R .629
-(ymetry data. Also note that by specifying)-.05 F F1<ad4e>3.129 E F0
-.629(we obtain a track plot of the ship')3.129 F 3.129(sn)-.55 G -.2(av)
--3.129 G(ig).2 E .629(ation o)-.05 F -.15(ve)-.15 G -.2(r-).15 G
-(laid on the color or grayscale \214le plots.)108 607.2 Q(No)108 631.2 Q
-2.959(ws)-.25 G .459(uppose we ha)-2.959 F .759 -.15(ve a s)-.2 H .459
-(et of SeaBeam 2112 data \214les comprising a short surv).15 F .759 -.15
-(ey a)-.15 H .459(nd that we w).15 F .459(ant a plot)-.1 F .156
-(of all the data together)108 643.2 R 5.156(.W)-.55 G 2.656(ec)-5.956 G
-.156(reate an ASCII te)-2.656 F .156
-(xt \214le which has a list of the \214lenames, each follo)-.15 F .157
-(wed by the)-.25 F(appropriate)108 655.2 Q F1(MBIO)2.5 E F0
-(format id number)2.5 E 2.5(,e)-.4 G(.g.:)-2.5 E(sb2112_e)144 679.2 Q
-(xample_1.mb41 41)-.15 E(sb2112_e)144 691.2 Q(xample_2.mb41 41)-.15 E
-(sb2112_e)144 703.2 Q(xample_3.mb41 41)-.15 E .202
-(If the name of the data \214le list is "datalist", then using ")108
-727.2 R F1<ad46>A F2(-1)A F1<ad49>2.702 E F2(datalist)A F0 2.702("w)C
-.202(ill cause the macro to operate on)-2.702 F(MB-System 5.0)72 768 Q
-2.5(9J)140.11 G(anuary 2015)-2.5 E(14)193.45 E 0 Cg EP
-%%Page: 15 15
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.05(mbm_plot\(1\) MB-System)72 48 R 147.05
-(5.0 mbm_plot\(1\))2.5 F .923(all of the \214les together)108 84 R 5.923
-(.W)-.55 G 3.423(ed)-6.723 G .923
-(esire a plot including color \214ll bath)-3.423 F .923(ymetry o)-.05 F
--.15(ve)-.15 G .923(rlaid with 25 meter contours).15 F .103
-(and the ship')108 96 R 2.603(sn)-.55 G -.2(av)-2.603 G(ig).2 E 2.603
-(ation. F)-.05 F .103(or this plot, we w)-.15 F .103(ant a v)-.1 F .103
-(ery bright colortable and we w)-.15 F .103(ould lik)-.1 F 2.603(et)-.1
-G .103(he colors to be)-2.603 F .265
-(discretely stepped rather than continuous; thus we use)108 108 R/F1 10
-/Times-Bold at 0 SF<ad57>2.765 E/F2 10/Times-Italic at 0 SF(2/2)A F0 2.765(.W)
-C 2.765(ea)-3.565 G .265(lso choose to use the)-2.765 F F1<ad58>2.766 E
-F0 .266(option, which)2.766 F(causes)108 120 Q F1(mbm_plot)3.93 E F0
-1.43(to e)3.93 F -.15(xe)-.15 G 1.43
-(cute the shellscript it creates in the background before e).15 F 1.43
-(xiting. The)-.15 F F1(mbm_plot)3.93 E F0(command is:)108 132 Q
-(mbm_plot \255F-1 \255Idatalist \255G1 \255C25 \255N \\)144 156 Q
-(-X \255V \255Obathtest)216 168 Q(As an e)108 192 Q
-(xample, the contents of the plotting shellscript "bathtest.cmd" are:)
--.15 E(#)110.5 216 Q 2.5(#S)110.5 228 S
-(hellscript to create Postscript plot of sw)-2.5 E(ath sonar data)-.1 E
-2.5(#C)110.5 240 S(reated by macro mbm_plot)-2.5 E(#)110.5 252 Q 2.5(#T)
-110.5 264 S(his shellscript created by follo)-2.5 E(wing command line:)
--.25 E 2.5(#m)110.5 276 S
-(bm_plot \255F-1 \255Idatalist \255G1 \255C25 \255N \255V \255Obathtest)
--2.5 E(#)110.5 288 Q 2.5(#S)110.5 300 S -2.25 -.2(av e)-2.5 H -.15(ex)
-2.7 G(isting GMT def).15 E(aults)-.1 E(echo Sa)110.5 312 Q(ving GMT def)
--.2 E(aults...)-.1 E(gmtdef)110.5 324 Q(aults \255L > gmtdef)-.1 E
-(aults$$)-.1 E(#)110.5 336 Q 2.5(#S)110.5 348 S(et ne)-2.5 E 2.5(wG)-.25
-G(MT def)-2.5 E(aults)-.1 E(echo Setting ne)110.5 360 Q 2.5(wG)-.25 G
-(MT def)-2.5 E(aults...)-.1 E(gmtset ANO)110.5 372 Q(T_FONT Helv)-.4 E
-(etica)-.15 E(gmtset LABEL_FONT Helv)110.5 384 Q(etica)-.15 E
-(gmtset HEADER_FONT Helv)110.5 396 Q(etica)-.15 E(gmtset ANO)110.5 408 Q
-(T_FONT_SIZE 8)-.4 E(gmtset LABEL_FONT_SIZE 8)110.5 420 Q
-(gmtset HEADER_FONT_SIZE 10)110.5 432 Q
-(gmtset FRAME_WIDTH 0.074999999999999997)110.5 444 Q
-(gmtset TICK_LENGTH 0.074999999999999997)110.5 456 Q(gmtset P)110.5 468
-Q -.4(AG)-.92 G(E_ORIENT).4 E -1.11(AT)-.93 G(ION LANDSCAPE)1.11 E
-(gmtset COLOR_B)110.5 480 Q -.4(AC)-.35 G(KGR).4 E(OUND 0/0/0)-.4 E
-(gmtset COLOR_FOREGR)110.5 492 Q(OUND 255/255/255)-.4 E(gmtset COLOR_N)
-110.5 504 Q(AN 255/255/255)-.35 E(#)110.5 516 Q 2.5(#M)110.5 528 S(ak)
--2.5 E 2.5(ec)-.1 G(olor palette table \214le)-2.5 E
-(echo Making color palette table \214le...)110.5 540 Q 5(echo 2975)110.5
-552 R(255 255 255)2.5 E(3150 255 186 133 > bathtest.cpt)7.5 E 5
-(echo 3150)110.5 564 R(255 186 133)2.5 E(3325 255 161)7.5 E
-(68 >> bathtest.cpt)5 E 5(echo 3325)110.5 576 R(255 161)2.5 E 5(68 3500)
-5 F(255 189)2.5 E(87 >> bathtest.cpt)5 E 5(echo 3500)110.5 588 R
-(255 189)2.5 E 5(87 3675)5 F(240 236 121 >> bathtest.cpt)2.5 E 5
-(echo 3675)110.5 600 R(240 236 121)2.5 E
-(3850 205 255 162 >> bathtest.cpt)7.5 E 5(echo 3850)110.5 612 R
-(205 255 162)2.5 E(4025 138 236 174 >> bathtest.cpt)7.5 E 5(echo 4025)
-110.5 624 R(138 236 174)2.5 E(4200 106 235 255 >> bathtest.cpt)7.5 E 5
-(echo 4200)110.5 636 R(106 235 255)2.5 E 2.5(4375 50)7.5 F
-(190 255 >> bathtest.cpt)2.5 E 5(echo 4375)110.5 648 R(50 190 255)5 E
-2.5(4550 40)7.5 F(127 251 >> bathtest.cpt)2.5 E 5(echo 4550)110.5 660 R
-(40 127 251)5 E 2.5(4725 37 57)7.5 F(175 >> bathtest.cpt)2.5 E(#)110.5
-672 Q 2.5(#R)110.5 684 S(un mbsw)-2.5 E(ath)-.1 E(echo Running mbsw)
-110.5 696 Q(ath...)-.1 E(mbsw)110.5 708 Q(ath \255f-1 \255Idatalist \\)
--.1 E(-Jm22.198543775528325 \\)144 720 Q(MB-System 5.0)72 768 Q 2.5(9J)
-140.11 G(anuary 2015)-2.5 E(15)193.45 E 0 Cg EP
-%%Page: 16 16
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.05(mbm_plot\(1\) MB-System)72 48 R 147.05
-(5.0 mbm_plot\(1\))2.5 F(-R114.210795/114.430905/-31.91322/-31.62458 \\)
-144 84 Q(-Cbathtest.cpt \\)144 96 Q(-p1 \255A1 \255Z1 \\)144 108 Q
-(-p1 \\)144 120 Q
-(-P \255X1.8069392647842304 \255Y2 \255K \255V > bathtest.ps)144 132 Q
-(#)110.5 144 Q 2.5(#R)110.5 156 S(un mbcontour)-2.5 E
-(echo Running mbcontour)110.5 168 Q(...)-.55 E
-(mbcontour \255f-1 \255Idatalist \\)110.5 180 Q
-(-Jm22.198543775528325 \\)144 192 Q
-(-R114.210795/114.430905/-31.91322/-31.62458 \\)144 204 Q
-(-A50/100000/100000/100000/0.01/0.1 \\)144 216 Q(-D0.25/1/4/0.15 \\)144
-228 Q(-p1 \\)144 240 Q(-P \255K \255O \255V >> bathtest.ps)144 252 Q(#)
-110.5 264 Q 2.5(#M)110.5 276 S(ak)-2.5 E 2.5(ec)-.1 G(olor scale)-2.5 E
-(echo Running psscale...)110.5 288 Q(psscale \255Cbathtest.cpt \\)110.5
-300 Q(-D2.4431/-0.5000/4.8861/0.1500h \\)144 312 Q
-(-B":.Depth \(meters\):" \\)144 324 Q
-(-P \255K \255O \255V >> bathtest.ps)144 336 Q(#)110.5 348 Q 2.5(#M)
-110.5 360 S(ak)-2.5 E 2.5(eb)-.1 G(asemap)-2.5 E
-(echo Running psbasemap...)110.5 372 Q
-(psbasemap \255Jm22.198543775528325 \\)110.5 384 Q
-(-R114.210795/114.430905/-31.91322/-31.62458 \\)144 396 Q
-(-B5m/5m:."Data List File datalist": \\)144 408 Q
-(-P \255O \255V >> bathtest.ps)144 420 Q(#)110.5 432 Q 2.5(#D)110.5 444
-S(elete surplus \214les)-2.5 E(echo Deleting surplus \214les...)110.5
-456 Q(rm \255f bathtest.cpt)110.5 468 Q(#)110.5 480 Q 2.5(#R)110.5 492 S
-(eset GMT def)-2.5 E(ault fonts)-.1 E(echo Resetting GMT fonts...)110.5
-504 Q(mv gmtdef)110.5 516 Q(aults$$ .gmtdef)-.1 E(aults)-.1 E(#)110.5
-528 Q 2.5(#R)110.5 540 S(un xpsvie)-2.5 E(w)-.25 E(echo Running xpsvie)
-110.5 552 Q 2.5(wi)-.25 G 2.5(nb)-2.5 G(ackground...)-2.5 E(xpsvie)110.5
-564 Q 2.5<77ad>-.25 G(ps a \255maxp 4m bathtest.ps &)-2.5 E(#)110.5 576
-Q 2.5(#A)110.5 588 S(ll done!)-2.5 E(echo All done!)110.5 600 Q/F1 10.95
-/Times-Bold at 0 SF(SEE ALSO)72 628.8 Q/F2 10/Times-Bold at 0 SF(mbsystem)108
-640.8 Q F0(\(1\),)A F2(mbcontour)2.746 E F0(\(1\),)A F2(mbswath)2.746 E
-F0(\(1\),)A F2(mbdefaults)2.747 E F0(\(1\),)A F2(mbm_grdplot)2.747 E F0
-(\(1\),)A F2(mbm_grd3dplot)2.747 E F0(\(1\),)A F2(mb\214l-)2.747 E(ter)
-108 652.8 Q F0(\(1\))A F1 -.11(BU)72 681.6 S(GS).11 E F0
-(By making this macro more useful, we ha)108 693.6 Q .3 -.15(ve a)-.2 H
-(lso made it more comple).15 E(x.)-.15 E(MB-System 5.0)72 768 Q 2.5(9J)
-140.11 G(anuary 2015)-2.5 E(16)193.45 E 0 Cg EP
-%%Trailer
-end
-%%EOF
diff --git a/src/ps/mbm_route2mission.ps b/src/ps/mbm_route2mission.ps
deleted file mode 100644
index e6c4771..0000000
--- a/src/ps/mbm_route2mission.ps
+++ /dev/null
@@ -1,820 +0,0 @@
-%!PS-Adobe-3.0
-%%Creator: groff version 1.19.2
-%%CreationDate: Wed Jul  1 12:29:29 2015
-%%DocumentNeededResources: font Times-Roman
-%%+ font Times-Bold
-%%+ font Times-Italic
-%%DocumentSuppliedResources: procset grops 1.19 2
-%%Pages: 7
-%%PageOrder: Ascend
-%%DocumentMedia: Default 612 792 0 () ()
-%%Orientation: Portrait
-%%EndComments
-%%BeginDefaults
-%%PageMedia: Default
-%%EndDefaults
-%%BeginProlog
-%%BeginResource: procset grops 1.19 2
-%!PS-Adobe-3.0 Resource-ProcSet
-/setpacking where{
-pop
-currentpacking
-true setpacking
-}if
-/grops 120 dict dup begin
-/SC 32 def
-/A/show load def
-/B{0 SC 3 -1 roll widthshow}bind def
-/C{0 exch ashow}bind def
-/D{0 exch 0 SC 5 2 roll awidthshow}bind def
-/E{0 rmoveto show}bind def
-/F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def
-/G{0 rmoveto 0 exch ashow}bind def
-/H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/I{0 exch rmoveto show}bind def
-/J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def
-/K{0 exch rmoveto 0 exch ashow}bind def
-/L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/M{rmoveto show}bind def
-/N{rmoveto 0 SC 3 -1 roll widthshow}bind def
-/O{rmoveto 0 exch ashow}bind def
-/P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/Q{moveto show}bind def
-/R{moveto 0 SC 3 -1 roll widthshow}bind def
-/S{moveto 0 exch ashow}bind def
-/T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/SF{
-findfont exch
-[exch dup 0 exch 0 exch neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/MF{
-findfont
-[5 2 roll
-0 3 1 roll
-neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/level0 0 def
-/RES 0 def
-/PL 0 def
-/LS 0 def
-/MANUAL{
-statusdict begin/manualfeed true store end
-}bind def
-/PLG{
-gsave newpath clippath pathbbox grestore
-exch pop add exch pop
-}bind def
-/BP{
-/level0 save def
-1 setlinecap
-1 setlinejoin
-72 RES div dup scale
-LS{
-90 rotate
-}{
-0 PL translate
-}ifelse
-1 -1 scale
-}bind def
-/EP{
-level0 restore
-showpage
-}def
-/DA{
-newpath arcn stroke
-}bind def
-/SN{
-transform
-.25 sub exch .25 sub exch
-round .25 add exch round .25 add exch
-itransform
-}bind def
-/DL{
-SN
-moveto
-SN
-lineto stroke
-}bind def
-/DC{
-newpath 0 360 arc closepath
-}bind def
-/TM matrix def
-/DE{
-TM currentmatrix pop
-translate scale newpath 0 0 .5 0 360 arc closepath
-TM setmatrix
-}bind def
-/RC/rcurveto load def
-/RL/rlineto load def
-/ST/stroke load def
-/MT/moveto load def
-/CL/closepath load def
-/Fr{
-setrgbcolor fill
-}bind def
-/setcmykcolor where{
-pop
-/Fk{
-setcmykcolor fill
-}bind def
-}if
-/Fg{
-setgray fill
-}bind def
-/FL/fill load def
-/LW/setlinewidth load def
-/Cr/setrgbcolor load def
-/setcmykcolor where{
-pop
-/Ck/setcmykcolor load def
-}if
-/Cg/setgray load def
-/RE{
-findfont
-dup maxlength 1 index/FontName known not{1 add}if dict begin
-{
-1 index/FID ne{def}{pop pop}ifelse
-}forall
-/Encoding exch def
-dup/FontName exch def
-currentdict end definefont pop
-}bind def
-/DEFS 0 def
-/EBEGIN{
-moveto
-DEFS begin
-}bind def
-/EEND/end load def
-/CNT 0 def
-/level1 0 def
-/PBEGIN{
-/level1 save def
-translate
-div 3 1 roll div exch scale
-neg exch neg exch translate
-0 setgray
-0 setlinecap
-1 setlinewidth
-0 setlinejoin
-10 setmiterlimit
-[]0 setdash
-/setstrokeadjust where{
-pop
-false setstrokeadjust
-}if
-/setoverprint where{
-pop
-false setoverprint
-}if
-newpath
-/CNT countdictstack def
-userdict begin
-/showpage{}def
-/setpagedevice{}def
-}bind def
-/PEND{
-countdictstack CNT sub{end}repeat
-level1 restore
-}bind def
-end def
-/setpacking where{
-pop
-setpacking
-}if
-%%EndResource
-%%EndProlog
-%%BeginSetup
-%%BeginFeature: *PageSize Default
-<< /PageSize [ 612 792 ] /ImagingBBox null >> setpagedevice
-%%EndFeature
-%%IncludeResource: font Times-Roman
-%%IncludeResource: font Times-Bold
-%%IncludeResource: font Times-Italic
-grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72
-def/PL 792 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron/Zcaron
-/scaron/zcaron/Ydieresis/trademark/quotesingle/Euro/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/space/exclam/quotedbl/numbersign/dollar/percent
-/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen
-/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon
-/semicolon/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O
-/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright/circumflex
-/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y
-/z/braceleft/bar/braceright/tilde/.notdef/quotesinglbase/guillemotleft
-/guillemotright/bullet/florin/fraction/perthousand/dagger/daggerdbl
-/endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut
-/dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash
-/quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen
-/brokenbar/section/dieresis/copyright/ordfeminine/guilsinglleft
-/logicalnot/minus/registered/macron/degree/plusminus/twosuperior
-/threesuperior/acute/mu/paragraph/periodcentered/cedilla/onesuperior
-/ordmasculine/guilsinglright/onequarter/onehalf/threequarters
-/questiondown/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE
-/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex
-/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis
-/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn
-/germandbls/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla
-/egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis
-/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide/oslash
-/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis]def
-/Times-Italic at 0 ENC0/Times-Italic RE/Times-Bold at 0 ENC0/Times-Bold RE
-/Times-Roman at 0 ENC0/Times-Roman RE
-%%EndSetup
-%%Page: 1 1
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 105.94(mbm_route2mission\(1\) MB-System)72 48 R
-105.94(5.0 mbm_route2mission\(1\))2.5 F/F1 10.95/Times-Bold at 0 SF -.219
-(NA)72 84 S(ME).219 E/F2 10/Times-Bold at 0 SF(mbm_r)108 96 Q(oute2mission)
--.18 E F0 2.5<ad4d>2.5 G(acro to con)-2.5 E -.15(ve)-.4 G(rt an).15 E F2
-(mbgrdviz)2.5 E F0(route \214le into an MB)2.5 E(ARI A)-.35 E
-(UV mission script.)-.55 E F1(VERSION)72 124.8 Q F0 -1.11(Ve)108 136.8 S
-(rsion 5.0)1.11 E F1(SYNOPSIS)72 165.6 Q F2(mbm_r)108 177.6 Q 3.227
-(oute2mission \255I)-.18 F/F3 10/Times-Italic at 0 SF -.45(ro)C(ute\214le)
-.45 E F0([)5.727 E F2<ad41>A F3(altmin/altabort[/altdesir)A
-(ed[/altdesir)-.37 E(ed2[/altdesir)-.37 E(ed3]]])-.37 E F2<ad42>5.726 E
-F3(behavior)A F2<ad43>108 189.6 Q F3(missiontime)A F2<ad44>8.442 E F3
-(depthconstant[/depthconstant2])A F2<ad46>8.442 E F3(forwar)A(ddistance)
--.37 E F2<ad47>8.443 E F3(gpsmode)A F2<ad4a>8.443 E F3(depthpr)A
-(o\214le\214le)-.45 E F2<ad4c>108 201.6 Q F3(appr)A(oac)-.45 E(hdepth)
--.15 E F2<ad4d>4.042 E F3([sensorlist])A F2<ad4e>4.042 E F0([)A F3(spir)
-A(aldescentaltitude)-.15 E F0(])A F2<ad4f>4.042 E F3(mission\214le)A F2
-<ad50>4.042 E F3 1.541([startlon/startlat | startdis-)B(tance])108 213.6
-Q F2<ad52>9.475 E F3(tr)A(ansmitpower/r)-.15 E(eceive)-.37 E(gain[/r)-.4
-E(ang)-.15 E(eminfr)-.1 E(action[/pulse)-.15 E(width]])-.15 E F2<ad53>
-9.475 E F3(speed)A F2<ad54>9.475 E F3(starttime)A F2<ad55>9.475 E F3
-(max-)A(climbr)108 225.6 Q(ate)-.15 E F2<ad57>2.5 E F3(waypointspacing)A
-F2<ad5620ad48>2.5 E F0(])A F1(DESCRIPTION)72 254.4 Q F2(mbm_r)108 266.4
-Q(oute2mission)-.18 E F0 2.5<ad4d>2.5 G(acro to con)-2.5 E -.15(ve)-.4 G
-(rt an).15 E F2(mbgrdviz)2.5 E F0(route \214le into an MB)2.5 E(ARI A)
--.35 E(UV mission script.)-.55 E(MB)108 290.4 Q .075
-(ARI Autonomous Underw)-.35 F .075(ater V)-.1 F .075(ehicles, or A)-1.11
-F .075(UVs, are controlled using a layered beha)-.55 F .075
-(vior system that is)-.2 F .085
-(speci\214ed using a mission script. This macro generates an MB)108
-302.4 R .085(ARI A)-.35 F .086(UV mission script from an)-.55 F F2
-(MB-System)2.586 E F0 .186
-(route \214le such as those generated interacti)108 314.4 R -.15(ve)-.25
-G .185(ly using).15 F F2(MBgrdviz)2.685 E F0 2.685(.T)C .185
-(he output MB)-2.685 F .185(ARI A)-.35 F .185(UV mission script is)-.55
-F 1.131(named using a ".cfg" suf)108 326.4 R 1.132(\214x. A W)-.25 F
-1.132(infrog w)-.4 F 1.132
-(aypoint \214le \(ending in ".pts"\) is also output which mirrors the)
--.1 F -.1(wa)108 338.4 S(ypoints in the input route \214le.).1 E .675
-(The output A)108 362.4 R .675(UV mission script includes safety beha)
--.55 F .675(viors that operate throughout a mission \(e.g. mission-)-.2
-F -.35(Ti)108 374.4 S 1.028
-(mer sets a mission timeout duration, and depthEn).35 F -.15(ve)-.4 G
-1.028(lope sets depth and altitude limits\). The script also).15 F 1.789
-(includes the sequential beha)108 386.4 R 1.789(viors required to tak)
--.2 F 4.289(eav)-.1 G 1.789
-(ehicle from the start of a mission at the surf)-4.439 F(ace,)-.1 E
-1.991(obtaining the initial position from GPS, descent to depth, \215yi\
-ng to the starting w)108 398.4 R 1.992(aypoint, running the)-.1 F .364
-(desired surv)108 410.4 R .664 -.15(ey l)-.15 H .363
-(ines with a desired depth or altitude pro\214le, ascent to the surf).15
-F .363(ace, and reacquiring position-)-.1 F .962(ing from GPS. F)108
-422.4 R .962(or sea\215oor mapping surv)-.15 F -.15(ey)-.15 G .962
-(s, sonar settings and data logging are also controlled through).15 F
-(the mission script.)108 434.4 Q .368
-(The input route \214le speci\214es a surv)108 458.4 R .667 -.15(ey m)
--.15 H .367(ission as a set of sequential w).15 F .367
-(aypoints, and also includes the depth)-.1 F .334
-(pro\214le between those w)108 470.4 R .334(aypoints. W)-.1 F .334
-(aypoints may be ordinary)-.8 F 2.834(,t)-.65 G .334(he start of a surv)
--2.834 F .634 -.15(ey l)-.15 H .335(ine, or the end of a sur).15 F(-)-.2
-E .612 -.15(vey l)108 482.4 T .311(ine \(the start and end line w).15 F
-.311(aypoints are generated using the surv)-.1 F .611 -.15(ey r)-.15 H
-.311(oute planning feature of).15 F F2(MBgrd-)2.811 E(viz)108 494.4 Q F0
-.198(\). The spacing)B .198(of the depth pro\214le points between the w)
-5.198 F .198(aypoints deri)-.1 F -.15(ve)-.25 G 2.698(sf).15 G .198
-(rom the bath)-2.698 F .199(ymetric grid used)-.05 F
-(to generate the route.)108 506.4 Q .116
-(The output mission speci\214es a lar)108 530.4 R .116(ger number of w)
--.18 F .115(aypoints than the input route \214le.)-.1 F .115
-(The mission w)5.115 F(aypoints)-.1 E .006(are generated e)108 542.4 R
--.15(ve)-.25 G(ry).15 E F3(waypointspacing)2.506 E F0 .007
-(meters \(speci\214ed with the)2.506 F F2<ad57>2.507 E F0 .007
-(option\), and the A)2.507 F .007(UV is commanded to)-.55 F .262
-(\215y at particular depths \(or depth pro\214les\) between each w)108
-554.4 R .262(aypoint. By def)-.1 F .262(ault, the A)-.1 F .261
-(UV will be \215o)-.55 F .261(wn using)-.25 F 2.629(ac)108 566.4 S .129
-(ontrol beha)-2.629 F .129(vior called W)-.2 F .129
-(aypointDepth in which the commanded v)-.8 F .129(ehicle depth follo)
--.15 F .13(ws a linearly interpo-)-.25 F .525
-(lated pro\214le between the depth at the starting w)108 578.4 R .525
-(aypoint and the depth at the ending w)-.1 F .524(aypoint. The simpler)
--.1 F(alternati)108 590.4 Q .811 -.15(ve w)-.25 H .511(aypoint beha).05
-F .511(vior speci\214es a single v)-.2 F .511
-(ehicle depth while \215ying to the ne)-.15 F .512(xt mission; as it be)
--.15 F(gins)-.15 E 1.049(each se)108 602.4 R 1.049(gment the v)-.15 F
-1.049(ehicle will ascend or descend sharply to the desired depth and th\
-en \215y le)-.15 F -.15(ve)-.25 G 3.548(lu).15 G 1.048(ntil the)-3.548 F
-(ne)108 614.4 Q(xt w)-.15 E(aypoint is reached.)-.1 E(The)108 638.4 Q F2
-<ad41>3.142 E F0 .643(option allo)3.143 F .643
-(ws the user to set the basic v)-.25 F .643
-(ehicle altitude control. The v)-.15 F(ehicle')-.15 E 3.143(sv)-.55 G
-.643(ertical position will)-3.293 F .881
-(be simulatneously controlled in terms of both altitude abo)108 650.4 R
-1.181 -.15(ve t)-.15 H .88(he bottom and depth belo).15 F 3.38(wt)-.25 G
-.88(he sea surf)-3.38 F(ace.)-.1 E .616
-(The commanded depth between each w)108 662.4 R .617
-(aypoint is calculated by)-.1 F F2(mbm_r)3.117 E(oute2mission)-.18 E F0
-.617(\(using the bath)3.117 F(yme-)-.05 E .42
-(try pro\214les in the input route \214le\) to produce a v)108 674.4 R
-.42(ehicle altitude that is)-.15 F F3(altdesir)2.92 E(ed)-.37 E F0 .42
-(meters abo)2.92 F .72 -.15(ve t)-.15 H .42(he shallo).15 F(w-)-.25 E
-.196(est depth looking)108 686.4 R F3(forwar)2.696 E(ddistance)-.37 E F0
-.196(meters ahead. The forw)2.696 F .196(ard looking feature allo)-.1 F
-.196(ws the v)-.25 F .196(ehicle to be com-)-.15 F .125
-(manded to ascend prior to reaching lar)108 698.4 R .124
-(ge scarps. As the mission commences, the A)-.18 F .124
-(UV attempts to \215y at the)-.55 F .55(commanded depth unless that w)
-108 710.4 R .551(ould result in an altitude less than)-.1 F F3(altmin)
-3.051 E F0 .551(meters. In that circumstance, the)3.051 F -.15(ve)108
-722.4 S .013(hicle \215ies in an altitude-follo).15 F .013
-(wing mode. Thus, for consistent bottom-follo)-.25 F .013
-(wing, a common approach is to)-.25 F(MB-System 5.0)72 768 Q
-(22 February 2015)135.11 E(1)193.45 E 0 Cg EP
-%%Page: 2 2
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 105.94(mbm_route2mission\(1\) MB-System)72 48 R
-105.94(5.0 mbm_route2mission\(1\))2.5 F(set)108 84 Q/F1 10
-/Times-Italic at 0 SF(altmin)2.963 E F0 .463
-(to the desired altitude and to set)2.963 F F1(altdesir)2.963 E(ed)-.37
-E F0 .463(to a v)2.963 F .464(alue slightly smaller than)-.25 F F1
-(altmin)2.964 E F0 5.464(.T)C .464(his strate)-5.464 F(gy)-.15 E(allo)
-108 96 Q .036(ws the look-ahead feature to bring the v)-.25 F .036
-(ehicle safely o)-.15 F -.15(ve)-.15 G 2.536(rs).15 G .035
-(teep rises while otherwise maintaining a con-)-2.536 F(stant altitude.)
-108 108 Q(The)108 132 Q/F2 10/Times-Bold at 0 SF<ad47>3.081 E F0 .581
-(option allo)3.081 F .582(ws the user to specify that the v)-.25 F .582
-(ehicle ascend to the surf)-.15 F .582(ace and reset positioning)-.1 F
-(with)5.582 E(GPS at the be)108 144 Q(ginning and/or end of surv)-.15 E
-.3 -.15(ey l)-.15 H(ines.).15 E(The)108 168 Q F2<ad4e>2.746 E F0 .246
-(option allo)2.746 F .245(ws the user to specify that the v)-.25 F .245
-(ehicle \214rst mo)-.15 F .545 -.15(ve t)-.15 H 2.745(ot).15 G .245
-(he initial surv)-2.745 F .545 -.15(ey w)-.15 H .245(aypoint, and then)
-.05 F(follo)108 180 Q 2.943(was)-.25 G .444
-(piral descent to the desired surv)-2.943 F .744 -.15(ey d)-.15 H 2.944
-(epth. The).15 F F2<ad4c>2.944 E F1(appr)A(oac)-.45 E(hdepth)-.15 E F0
-.444(option sets the v)2.944 F .444(ehicle depth as)-.15 F .35
-(it approaches the \214rst w)108 192 R .349
-(aypoint before the spiral descent. The optional)-.1 F F1(spir)2.849 E
-(aldescentaltitude)-.15 E F0 .349(parameter sets)2.849 F 1.436
-(the altitude at which the spiral descent is terminated; if)108 204 R F2
-<ad4e>3.937 E F0 1.437(is gi)3.937 F -.15(ve)-.25 G 3.937(na).15 G 1.437
-(lone then)-3.937 F F1(altdesir)3.937 E(ed)-.37 E F0 1.437(from the)
-3.937 F F2<ad41>3.937 E F0 .715(option is used.)108 216 R .715
-(These options are used for deepw)5.715 F .715
-(ater missions in which the v)-.1 F .715(ehicle na)-.15 F(vig)-.2 E .715
-(ation is updated)-.05 F
-(by acoustic modem during the free inertial descents.)108 228 Q .154
-(The mission script must also allo)108 252 R 2.654(ws)-.25 G(uf)-2.654 E
-.154(\214cient time for the v)-.25 F .154
-(ehicle to transit from its starting point to the \214rst)-.15 F -.1(wa)
-108 264 S .647(ypoint in the surv).1 F .947 -.15(ey m)-.15 H .647
-(ission. The).15 F F2<ad54>3.147 E F0(and)3.147 E F2<ad50>3.147 E F0
-.646(options allo)3.146 F 3.146(wt)-.25 G .646(he user specify the A)
--3.146 F .646(UV starting position,)-.55 F
-(the distance to the \214rst w)108 276 Q
-(aypoint, or the time required to reach the \214rst w)-.1 E(aypoint.)-.1
-E .098(The MB)108 300 R .098(ARI Mapping A)-.35 F .099
-(UV is equipped with a 200 kHz multibeam sonar)-.55 F 2.599(,a2)-.4 G
-.099(-16 kHz chirp subbottom pro-)-2.599 F(\214ler)108 312 Q 2.853(,a1)
--.4 G .353(10 kHz chirp sidescan, and a 410 kHz chirp sidescan. The)
--2.853 F F2<ad4d>2.853 E F0 .353(option is used to enable these map-)
-2.853 F .688(ping sonars in the A)108 324 R .689
-(UV mission script. If the route \214le contains w)-.55 F .689
-(aypoints identi\214ed as line start and line)-.1 F .38(end points, the\
- subbottom pro\214ler \(if enabled\) will be turned on and of)108 336 R
-2.88(fa)-.25 G 2.88(tt)-2.88 G .38(hese points. The w)-2.88 F .38
-(aypoint type)-.1 F -.25(va)108 348 S(lue can be set interacti).25 E
--.15(ve)-.25 G(ly within).15 E F2(mbgrdviz)2.5 E F0(.)A .943(The MB)108
-372 R .943(ARI Benthic Imaging A)-.35 F .943
-(UV is equipped with dual strobes and a do)-.55 F(wnw)-.25 E .944
-(ard pointed camera.)-.1 F(The)5.944 E F2(\255MC)108 384 Q F0 .919
-(option is used to enable control of the camera in the A)3.419 F .919
-(UV mission script. If the route \214le contains)-.55 F -.1(wa)108 396 S
-.829(ypoints identi\214ed as line start and line end points, the camera\
- \(if enabled\) will be turned on and of).1 F 3.329(fa)-.25 G(t)-3.329 E
-(these points. The w)108 408 Q(aypoint type v)-.1 E
-(alue can be set interacti)-.25 E -.15(ve)-.25 G(ly within).15 E F2
-(mbgrdviz)2.5 E F0(.)A/F3 10.95/Times-Bold at 0 SF -.548(AU)72 436.8 S
-(THORSHIP).548 E F0(Da)108 448.8 Q(vid W)-.2 E 2.5(.C)-.92 G
-(aress \(caress at mbari.or)-2.5 E(g\))-.18 E(Montere)113 460.8 Q 2.5(yB)
--.15 G(ay Aquarium Research Institute)-2.5 E
-(Dale N. Chayes \(dale at ldeo.columbia.edu\))108 472.8 Q
-(Lamont-Doherty Earth Observ)113 484.8 Q(atory)-.25 E F3(OPTIONS)72
-513.6 Q F2<ad41>108 525.6 Q F1(altmin/altabort[/altdesir)23.08 E
-(ed[/altdesir)-.37 E(ed2[/altdesir)-.37 E(ed3]]])-.37 E F0 .209
-(Sets the A)144 537.6 R .208(UV altitude control parameters. The missio\
-ns generated by this script directly command)-.55 F .349(the A)144 549.6
-R(UV')-.55 E 2.849(sd)-.55 G .349(epth. Ho)-2.849 F(we)-.25 E -.15(ve)
--.25 G 1.149 -.4(r, t).15 H .349(he commanded depth will be o).4 F -.15
-(ve)-.15 G .35(rridden by the minimum altitude, or).15 F F1(altmin)144
-561.6 Q F0 -.25(va)2.977 G .477(lue; the v).25 F .477
-(ehicle will adjust it')-.15 F 2.976(sd)-.55 G .476
-(epth so that it does not \215y an)-2.976 F 2.976(yc)-.15 G .476
-(loser to the bottom than)-2.976 F F1(altmin)144 573.6 Q F0 .185
-(meters. If the v)2.685 F .185
-(ehicle reaches an altitude equal to or less than)-.15 F F1(altabort)
-2.686 E F0 .186(meters, then the mis-)2.686 F .435
-(sion will be aborted. The user may specify a desired altitude \()144
-585.6 R F1(altdesir)A(ed)-.37 E F0 2.935(\)t)C .435(hat is dif)-2.935 F
-.435(ferent than)-.25 F F1(alt-)2.935 E(min)144 597.6 Q F0 2.902(,s)C
-2.902(ot)-2.902 G .402(hat the commanded depths do not directly corresp\
-ond to the minimum altitude.)-2.902 F .402(The user)5.402 F 2.359
-(can also specify second or third desired altitude v)144 609.6 R(alues)
--.25 E F1(altdesir)4.858 E 2.358(ed2 altdesir)-.37 F(ed3)-.37 E F0 2.358
-(that are used)4.858 F .157(between w)144 621.6 R .158
-(aypoints of type ST)-.1 F(AR)-.93 E .158(T2 and END2, or ST)-.6 F(AR)
--.93 E .158(T3 and END3, respecti)-.6 F -.15(ve)-.25 G(ly).15 E 2.658
-(,a)-.65 G 2.658(sd)-2.658 G .158(e\214ned in)-2.658 F F2(MBgrdviz)144
-633.6 Q F0(routes.)2.5 E F2<ad42>108 650.4 Q F1(behavior)23.63 E F0 .509
-(Sets the A)144 662.4 R .509(UV beha)-.55 F .509
-(vior used to \215y the mission. If)-.2 F F1(behavior)3.009 E F0 3.009
-(=0)3.009 G 3.009(,t)-3.009 G .509(hen the A)-3.009 F .508
-(UV uses the W)-.55 F(ayPoint)-.8 E(beha)144 674.4 Q .46
-(vior in which a single v)-.2 F .461
-(ehicle depth is speci\214ed for the approach to each w)-.15 F .461
-(aypoint. If)-.1 F F1(behav-)2.961 E(ior)144 686.4 Q F0 2.927(=1)2.927 G
-2.927(,t)-2.927 G .427(hen the A)-2.927 F .426(UV uses the W)-.55 F .426
-(ayPointDepth beha)-.8 F .426(vior in which each mission se)-.2 F .426
-(gment has both)-.15 F 2.581(as)144 698.4 S .081
-(tarting and an ending depth speci\214ed, and the v)-2.581 F .082
-(ehicle is commanded to \215y a depth pro\214le that is)-.15 F 2.5(al)
-144 710.4 S(inear ramp between the tw)-2.5 E 2.5(od)-.1 G(epths. Def)
--2.5 E(ault:)-.1 E F1(behavior)2.5 E F0 2.5(=1)2.5 G(;)-2.5 E
-(MB-System 5.0)72 768 Q(22 February 2015)135.11 E(2)193.45 E 0 Cg EP
-%%Page: 3 3
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 105.94(mbm_route2mission\(1\) MB-System)72 48 R
-105.94(5.0 mbm_route2mission\(1\))2.5 F/F1 10/Times-Bold at 0 SF<ad43>108
-84 Q/F2 10/Times-Italic at 0 SF(missiontime)23.08 E F0 1.003
-(Sets the maximum time allo)144 96 R 1.003(wed for the A)-.25 F 1.003
-(UV mission. If the)-.55 F F2(missiontime)3.502 E F0 1.002(is e)3.502 F
-1.002(xceeded, the A)-.15 F(UV)-.55 E 1.816(will transition to it')144
-108 R 4.316(si)-.55 G 1.816(nternal abort plan.)-4.316 F(Def)6.816 E
-1.816(ault: mission abort time calculated from mission)-.1 F
-(parameters.)144 120 Q F1<ad44>108 136.8 Q F2
-(depthconstant[/depthconstant2])23.08 E F0 1.362(Sets constant depth v)
-144 148.8 R 1.361(alues that will be used between w)-.25 F 1.361
-(aypoints of typ ST)-.1 F(AR)-.93 E 1.361(T4 and END4 for)-.6 F F2
-(depthconstant)144 160.8 Q F0 .755(and ST)3.255 F(AR)-.93 E .756
-(T5 and END5 for)-.6 F F2(depthconstant2)3.256 E F0 3.256(.T)C .756
-(hese are the w)-3.256 F .756(aypoint types de\214ned)-.1 F(in)144 172.8
-Q F1(MBgrdviz)2.919 E F0 .419(routes. While these w)2.919 F .419
-(aypoint types are acti)-.1 F -.15(ve)-.25 G 2.919(,t).15 G .419(he A)
--2.919 F .418(UV is commanded to the speci-)-.55 F
-(\214ed constant depth v)144 184.8 Q(alue.)-.25 E F1<ad46>108 201.6 Q F2
-(forwar)24.19 E(ddistance)-.37 E F0 1.453(The program looks)144 213.6 R
-F2(forwar)3.954 E(ddistance)-.37 E F0 3.954(ma)3.954 G 1.454
-(head for the shallo)-3.954 F 1.454(west bottom depth along the surv)
--.25 F -.15(ey)-.15 G(route, and then commands the v)144 225.6 Q
-(ehicle to \215y at least)-.15 E F2(altmin)2.5 E F0(abo)2.5 E .3 -.15
-(ve t)-.15 H(hat depth.).15 E F1<ad47>108 242.4 Q F2(gpsmode)22.52 E F0
-1.099(Sets the frequenc)144 254.4 R 3.599(yw)-.15 G 1.099
-(ith which the A)-3.599 F 1.099(UV will surf)-.55 F 1.099
-(ace between surv)-.1 F 1.399 -.15(ey l)-.15 H 1.098
-(ines to get GPS \214x).15 F 1.098(es. By)-.15 F(def)144 266.4 Q .433
-(ault, the v)-.1 F .434(ehicle only get GPS \214x)-.15 F .434
-(es at the surf)-.15 F .434(ace at the be)-.1 F .434
-(ginning and end of the mission, and)-.15 F .833(not surf)144 278.4 R
-.833(ace during the mission.)-.1 F(If)5.832 E F2(gpsmode)3.332 E F0
-3.332(=1)3.332 G 3.332(,t)-3.332 G .832(hen the v)-3.332 F .832
-(ehicle will ascend for gps \214x)-.15 F .832(es at the)-.15 F .774
-(start of each surv)144 290.4 R 1.074 -.15(ey l)-.15 H .774(ine. If).15
-F F2(gpsmode)3.274 E F0 3.274(=2)3.274 G 3.274(,t)-3.274 G .774
-(hen the v)-3.274 F .774(ehicle will ascend for gps \214x)-.15 F .774
-(es at the end of)-.15 F .344(each surv)144 302.4 R .644 -.15(ey l)-.15
-H .344(ine. If).15 F F2(gpsmode)2.844 E F0 2.844(=3)2.844 G 2.844(,t)
--2.844 G .344(hen the v)-2.844 F .344(ehicle will)-.15 F .343
-(ascend for gps \214x)5.343 F .343(es at the start and end of)-.15 F
-(each surv)144 314.4 Q .3 -.15(ey l)-.15 H(ine).15 E F1<ad48>108 331.2 Q
-F0 .162(This "help" \215ag cause the program to print out a description\
- of its operation and then e)22.52 F .162(xit immedi-)-.15 F(ately)144
-343.2 Q(.)-.65 E F1<ad49>108 360 Q F2 -.45(ro)26.41 G(ute\214le).45 E F0
-.357(Sets the \214lename of the input)144 372 R F1(mbgrdviz)2.857 E F0
-.357(route \214le.)2.857 F 2.857(Ar)5.357 G .357
-(oute \214le speci\214es a desired surv)-2.857 F .657 -.15(ey r)-.15 H
-.357(oute as).15 F 2.72(as)144 384 S .22(et of lines between w)-2.72 F
-.22(aypoints. In addition to the w)-.1 F .22
-(aypoints, the \214le also includes the depth pro-)-.1 F
-(\214les along those lines.)144 396 Q F1<ad4a>108 412.8 Q F2(depthpr)
-25.3 E(o\214le\214le)-.45 E F0 1.082(Sets the \214lename of an input de\
-sired depth pro\214le \214le. This is the depth pro\214le that the v)144
-424.8 R(ehicle)-.15 E 1.304(should follo)144 436.8 R 3.804(ww)-.25 G
-1.305(hen \215ying the mission \(as opposed to follo)-3.804 F 1.305
-(wing the bottom at a particular alti-)-.25 F(tude\).)144 448.8 Q F1
-<ad4c>108 465.6 Q F2(appr)23.63 E(oac)-.45 E(hdepth)-.15 E F0 .616
-(Sets the v)144 477.6 R .616
-(ehicle depth during the approach to the \214rst w)-.15 F .616
-(aypoint when a spiral descent to depth at)-.1 F(the \214rst w)144 489.6
-Q(aypoint is speci\214ed)-.1 E(using the)5 E F1<ad4e>2.5 E F0(option.)
-2.5 E F1<ad4d>108 506.4 Q F2([sensorlist])20.86 E F0 .228
-(This option enables control of the Mapping A)2.727 F(UV')-.55 E 2.728
-(sm)-.55 G .228(apping sonars and other possible)-2.728 F .381
-(sensors. By def)144 518.4 R .381(ault, the A)-.1 F .381
-(UV mission is generated without turning on the mapping sonars.)-.55 F
-(If)5.38 E F1<ad4d>2.88 E F0 2.052(is gi)144 530.4 R -.15(ve)-.25 G
-4.552(na).15 G 2.052(lone, the multibeam, subbottom pro\214ler)-4.552 F
-4.552(,a)-.4 G 2.052(nd both lo)-4.552 F 4.553(wa)-.25 G 2.053
-(nd high frequenc)-4.553 F 4.553(ys)-.15 G(idescan)-4.553 E .137
-(sonars will be enabled. The)144 542.4 R F2(sonarlist)2.637 E F0 .136
-(parameter can optionally specify which sonars are enabled in)2.637 F
-.333(addition to the multibeam \(the multibeam serv)144 554.4 R .334
-(es as the ping timing master for all sonars, and thus)-.15 F 1.296
-(must be enabled if an)144 566.4 R 3.796(ym)-.15 G 1.295
-(apping sonars are enabled\). The)-3.796 F F2(sonarlist)3.795 E F0 -.25
-(va)3.795 G 1.295(lue is made up of one or).25 F(more of the follo)144
-578.4 Q(wing characters:)-.25 E 27.11(Mm)216 590.4 S(ultibeam sonar)
--27.11 E 30.44(Ss)216 602.4 S(ubbottom pro\214ler \(and multibeam\))
--30.44 E 29.89(Ll)216 614.4 S .5 -.25(ow f)-29.89 H(requenc).25 E 2.5
-(ys)-.15 G(idescan \(and multibeam\))-2.5 E 28.78(Hh)216 626.4 S
-(igh frequenc)-28.78 E 2.5(ys)-.15 G(idescan \(and multibeam\))-2.5 E
-29.33(Bm)216 638.4 S(ultibeam beam \(w)-29.33 E(ater column\) data)-.1 E
-29.33(Cb)216 650.4 S(enthic imaging camera and strobes)-29.33 E(Thus,)
-144 662.4 Q F1<ad4d>3.117 E F2(SL)A F0 .617
-(will cause the multibeam, the subbottom pro\214ler)3.117 F 3.117(,a)-.4
-G .617(nd the lo)-3.117 F 3.117(wf)-.25 G(requenc)-3.117 E 3.118(ys)-.15
-G .618(idescan to)-3.118 F(be enabled while lea)144 674.4 Q
-(ving the high frequenc)-.2 E 2.5(ys)-.15 G(idescan of)-2.5 E(f.)-.25 E
-F1<ad4e>108 691.2 Q F2(spir)23.08 E(aldescentaltitude)-.15 E F0 .125
-(Sets the mission to include a shallo)2.625 F 2.625(wt)-.25 G .125
-(ransit to the \214rst w)-2.625 F .125(aypoint follo)-.1 F .125(wed by)
--.25 F 2.86(as)144 703.2 S .36(piral descent to depth to start the surv)
--2.86 F -.15(ey)-.15 G 2.861(.T)-.5 G .361
-(he descent is terminated at the altitude)-2.861 F F2(spir)2.861 E
-(aldescen-)-.15 E(taltitude)144 715.2 Q F0 .737(if speci\214ed here. Ot\
-herwise, the descent is terminated at the altitude)3.237 F F2(altdesir)
-3.236 E(ed)-.37 E F0 .736(from the)3.236 F F1<ad41>144 727.2 Q F0
-(option.)2.5 E(MB-System 5.0)72 768 Q(22 February 2015)135.11 E(3)193.45
-E 0 Cg EP
-%%Page: 4 4
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 105.94(mbm_route2mission\(1\) MB-System)72 48 R
-105.94(5.0 mbm_route2mission\(1\))2.5 F/F1 10/Times-Bold at 0 SF<ad4f>108
-84 Q/F2 10/Times-Italic at 0 SF(mission\214le)22.52 E F0
-(Sets the \214lename of the output MB)144 96 Q(ARI A)-.35 E
-(UV mission script.)-.55 E F1<ad50>108 112.8 Q F2(lon/lat)24.19 E F0
-1.133(This sets the e)144 124.8 R 1.133(xpected starting position \()
--.15 F F2(lon)A F0 1.133(longitude and)3.633 F F2(lat)3.633 E F0 1.134
-(latitude\) of the Mapping A)3.633 F 1.134(UV so)-.55 F .083(that the e)
-144 136.8 R .082(xpected time to run to the \214rst w)-.15 F .082
-(aypoint can be estimated. If neither the)-.1 F F1<ad50>2.582 E F0(or)
-2.582 E F1<ad54>2.582 E F0(options)2.582 E
-(are speci\214ed, a distance of 500 meters to the \214rst w)144 148.8 Q
-(aypoint is assumed.)-.1 E F1<ad52>108 165.6 Q F2(tr)23.08 E
-(ansmitpower/r)-.15 E(eceive)-.37 E(gain[/r)-.4 E(ang)-.15 E(eminfr)-.1
-E(action[/pulse)-.15 E(width]])-.15 E F0 1.172(This sets the k)144 177.6
-R 1.473 -.15(ey m)-.1 H 1.173(ultibeam sonar parameters. Here).15 F F2
-(tr)3.673 E(ansmitpower)-.15 E F0 1.173(is the transmit po)3.673 F 1.173
-(wer of the)-.25 F .624
-(multibeam in dB, with a range of 0-220 dB. The multibeam recei)144
-189.6 R .924 -.15(ve g)-.25 H .624(ain has a range of 0-83 dB.).1 F(The)
-144 201.6 Q F2 -.15(ra)2.956 G(ng).15 E(eminfr)-.1 E(action)-.15 E F0
--.25(va)2.957 G .457
-(riable sets the minimum range at which the multibeam will mak).25 F
-2.957(eb)-.1 G(ottom)-2.957 E .071(picks; this pre)144 213.6 R -.15(ve)
--.25 G .071(nts the multibeam from picking on near\214eld arri).15 F
--.25(va)-.25 G .07(ls usually re\215ecting interference).25 F .733(from\
- other sonars. If the sonar is operating with an altitude of 50 m and)
-144 225.6 R F2 -.15(ra)3.234 G(ng).15 E(eminfr)-.1 E(action)-.15 E F0
-3.234(=0)3.234 G(.2,)-3.234 E .351(then the range g)144 237.6 R .351
-(ating minimum range will be 0.2 * 50 m = 10 m. The)-.05 F F2(pulse)
-2.851 E(width)-.15 E F0 -.25(va)2.851 G .351(riable sets the).25 F .203
-(multibeam sonar transmit pulse width in microseconds. Def)144 249.6 R
-(ault:)-.1 E F2(tr)2.704 E(ansmitpower)-.15 E F0 2.704(=2)2.704 G(20,)
--2.704 E F2 -.37(re)2.704 G(ceive).37 E(gain)-.4 E F0 2.5(=2)144 261.6 S
-(20,)-2.5 E F2 -.15(ra)2.5 G(ng).15 E(eminfr)-.1 E(action)-.15 E F0 2.5
-(=0)2.5 G(.2,)-2.5 E F2(pulse)2.5 E(width)-.15 E F0 2.5(=6)2.5 G(0.)-2.5
-E F1<ad53>108 278.4 Q F2(speed)24.74 E F0(This sets the commanded A)144
-290.4 Q(UV speed in meters/second. Def)-.55 E(ault:)-.1 E F2(speed)2.5 E
-F0 2.5(=1)2.5 G(.5 m/s.)-2.5 E F1<ad54>108 307.2 Q F2(starttime)23.63 E
-F0 .16(This sets the e)144 319.2 R .16(xpected time required for the A)
--.15 F .159(UV to reach the \214rst w)-.55 F .159(aypoint in the surv)
--.1 F .459 -.15(ey m)-.15 H(ission.).15 E 1.421(If neither the)144 331.2
-R F1<ad50>3.921 E F0(or)3.921 E F1<ad54>3.921 E F0 1.421
-(options are speci\214ed, a distance of 500 meters to the \214rst w)
-3.921 F 1.422(aypoint is)-.1 F(assumed.)144 343.2 Q F1<ad55>108 360 Q F2
-(maxclimbr)23.08 E(ate)-.15 E F0 .837
-(This sets the maximum climb rate in de)144 372 R .837(grees allo)-.15 F
-.836(wed to be planned for the A)-.25 F .836(UV mission. If the)-.55 F
-(topograph)144 384 Q 3.698(yh)-.05 G 1.198(as a greater slope, the A)
--3.698 F 1.198(UV will be brought up earlier so the planned climb angle)
--.55 F(ne)144 396 Q -.15(ve)-.25 G 2.5(re).15 G(xceed)-2.65 E F2
-(maxclimbr)2.5 E(ate)-.15 E F0 5(.D)C(ef)-5 E(ault:)-.1 E F2(maxclimbr)
-2.5 E(ate)-.15 E F0 2.5(=2)2.5 G 2.5(5d)-2.5 G -.15(eg)-2.5 G(rees.).15
-E F1<ad57>108 412.8 Q F2(waypointspacing)20.3 E F0
-(Sets the spacing in meters of the w)144 424.8 Q
-(aypoints output to the mission script.)-.1 E F1<ad56>108 441.6 Q F0
-(The)23.08 E F1<ad56>2.5 E F0(option causes)2.5 E F1(mbm_r)2.5 E
-(oute2mission)-.18 E F0(to print out status messages.)2.5 E/F3 10.95
-/Times-Bold at 0 SF(EXAMPLES)72 470.4 Q F0 1.345
-(Suppose you are going to run the MB)108 482.4 R 1.345(ARI Mapping A)
--.35 F 1.344(UV on the Coaxial Se)-.55 F 1.344
-(gment of the Juan de Fuca)-.15 F 1.532(Ridge. Y)108 494.4 R 1.532
-(ou ha)-1.1 F 1.832 -.15(ve c)-.2 H 1.532
-(reated a route \214le called Coaxial2009_1v3.rte using).15 F F1
-(mbgrdviz)4.032 E F0 4.032(.I)C 4.032(no)-4.032 G 1.532
-(rder to create an)-4.032 F(MB)108 506.4 Q .108(ARI A)-.35 F .108
-(UV mission script for mission be)-.55 F .107
-(ginning with a spiral descent to an altitude of 50 m, follo)-.15 F .107
-(wed by)-.25 F 2.5(as)108 518.4 S(urv)-2.5 E .3 -.15(ey r)-.15 H
-(un at a 75 m altitude, the follo).15 E(wing will suf)-.25 E(\214ce:)
--.25 E 4.09(mbm_route2mission \255I Coaxial2009_1v3.rte)144 530.4 R 4.09
-(-A75/30/75 \255B1)75.73 F(-G0)46.17 E(\255MSL \255N50 \255R220/83/0.3)
-108 542.4 Q(-O Coaxial2009_1v3.cfg)70.57 E(-S1.5 \255L30 \255W100 \255V)
-44.57 E(The resulting mission script has the follo)108 554.4 Q
-(wing header:)-.25 E 2.5(#T)120.5 578.4 S(his MB)-2.5 E(ARI Mapping A)
--.35 E(UV mission \214le has been generated)-.55 E 2.5(#b)120.5 590.4 S
-2.5(yt)-2.5 G(he MB-System program mbm_route2mission run by)-2.5 E 2.5
-(#u)120.5 602.4 S
-(ser <caress> on cpu <shepard> at <Thu Jul 30 11:36:47 PDT 2009>)-2.5 E
-(#)120.5 614.4 Q 2.5(#M)120.5 626.4 S(ission Summary:)-2.5 E 12.5(#R)
-120.5 638.4 S(oute File:)-12.5 E(Coaxial2009_1v3.rte)37.5 E 12.5(#M)
-120.5 650.4 S(ission File:)-12.5 E(Coaxial2009_1v3.cfg)32.5 E 12.5(#D)
-120.5 662.4 S 40(istance: 79501.503455)-12.5 F(\(m\))2.5 E 12.5(#E)120.5
-674.4 S(stimated T)-12.5 E 25(ime: 57203)-.35 F 2.5(\(s\) 15.890)2.5 F
-(\(hr\))2.5 E 12.5(#A)120.5 686.4 S(bort T)-12.5 E 35(ime: 60067)-.35 F
-(\(s\))2.5 E 12.5(#M)120.5 698.4 S(ax battery life:)-12.5 E(64800 \(s\))
-22.5 E 12.5(#S)120.5 710.4 S(afety mar)-12.5 E 27.5(gin: 1800)-.18 F
-(\(s\))2.5 E 12.5(#A)120.5 722.4 S(scend time:)-12.5 E(2932 \(s\))35 E
-(MB-System 5.0)72 768 Q(22 February 2015)135.11 E(4)193.45 E 0 Cg EP
-%%Page: 5 5
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 105.94(mbm_route2mission\(1\) MB-System)72 48 R
-105.94(5.0 mbm_route2mission\(1\))2.5 F 12.5(#W)120.5 84 S(ay Points:)
--13.3 E(44)37.5 E 12.5(#R)120.5 96 S(oute Points:)-12.5 E(550)32.5 E
-12.5(#S)120.5 108 S(urv)-12.5 E .3 -.15(ey b)-.15 H(eha).15 E 22.5
-(vior: W)-.2 F(aypointDepth)-.8 E 12.5(#D)120.5 120 S(escent style:)
--12.5 E(Spiral descent)30 E 12.5(#M)120.5 132 S
-(apping sonar control enabled:)-12.5 E 77.5(#M)120.5 144 S
-(ultibeam enabled)-77.5 E 82.5(#M)120.5 156 S(ultibeam recei)-82.5 E .3
--.15(ve g)-.25 H 25(ain: 83).1 F 82.5(#M)120.5 168 S
-(ultibeam transmit g)-82.5 E 22.5(ain: 220)-.05 F 82.5(#M)120.5 180 S
-(ultibeam minimum range fraction: 0.3)-82.5 E 77.5(#S)120.5 192 S
-(ubbottom enabled)-77.5 E 77.5(#L)120.5 204 S .5 -.25(ow s)-77.5 H
-(idescan enabled).25 E 77.5(#H)120.5 216 S(igh sidescan disabled)-77.5 E
-(#)120.5 228 Q 2.5(#M)120.5 240 S(ission P)-2.5 E(arameters:)-.15 E 12.5
-(#V)120.5 252 S(ehicle Speed:)-13.61 E
-(1.500000 \(m/s\) 2.915769 \(knots\))30 E 12.5(#D)120.5 264 S(esired V)
--12.5 E(ehicle Altitude: 75 \(m\))-1.11 E 12.5(#M)120.5 276 S(inimum V)
--12.5 E(ehicle Altitude: 75 \(m\))-1.11 E 12.5(#A)120.5 288 S(bort V)
--12.5 E(ehicle Altitude:)-1.11 E(30 \(m\))7.5 E 12.5(#M)120.5 300 S
-(aximum V)-12.5 E(ehicle Depth:)-1.11 E(2525.307922 \(m\))10 E 12.5(#A)
-120.5 312 S(bort V)-12.5 E(ehicle Depth:)-1.11 E(2562.807922 \(m\))15 E
-12.5(#D)120.5 324 S(escent V)-12.5 E(ehicle Depth:)-1.11 E 2.5(3\()10 G
-(m\))-2.5 E 12.5(#S)120.5 336 S(piral descent depth:)-12.5 E
-(2324.917643 m)12.5 E 12.5(#S)120.5 348 S(piral descent altitude:)-12.5
-E(50 m)5 E 12.5(#F)120.5 360 S(orw)-12.65 E(ard Looking Distance:)-.1 E
-(\(m\))5 E 12.5(#W)120.5 372 S(aypoint Spacing:)-13.3 E(100 \(m\))22.5 E
-12.5(#G)120.5 384 S(PS Duration:)-12.5 E(600 \(s\))32.5 E 12.5(#D)120.5
-396 S(escend Rate:)-12.5 E(0.417 \(m/s\))32.5 E 12.5(#A)120.5 408 S
-(scend Rate:)-12.5 E 2.5(1\()35 G(m/s\))-2.5 E 12.5(#I)120.5 420 S
-(nitial descend Duration: 300 \(s\))-12.5 E 12.5(#S)120.5 432 S
-(etpoint Duration:)-12.5 E(30 \(s\))20 E(#)120.5 444 Q 2.5(#T)120.5 456
-S(he primary w)-2.5 E(aypoints from the route \214le are:)-.1 E 7.5(#<)
-120.5 468 S(number> <longitude \(de)-7.5 E(g\)> <latitude \(de)-.15 E
-(g\)> <topograph)-.15 E 2.5(y\()-.05 G(m\)> <distance \(m\)> <type>)-2.5
-E 7.5(#0)120.5 480 S
-(\255129.588618 46.504590 \2552384.917643 0.000000 3)-5 E 7.5(#1)120.5
-492 S(\255129.583151 46.507559 \2552412.977865 533.709482 3)-5 E 7.5(#2)
-120.5 504 S(\255129.569223 46.503420 \2552548.389974 1697.143568 1)-5 E
-7.5(#3)120.5 516 S
-(\255129.566359 46.501080 \2552494.963053 2037.557099 3)-5 E 7.5(#4)
-120.5 528 S(\255129.548611 46.529852 \2552539.510864 5512.537193 4)-5 E
-7.5(#5)120.5 540 S
-(\255129.551250 46.530628 \2552562.807922 5732.537193 3)-5 E 7.5(#6)
-120.5 552 S(\255129.568962 46.501924 \2552531.034424 9199.497998 4)-5 E
-7.5(#7)120.5 564 S
-(\255129.571600 46.502699 \2552519.138489 9419.497998 3)-5 E 7.5(#8)
-120.5 576 S(\255129.553889 46.531404 \2552547.114624 12886.458803 4)-5 E
-7.5(#9)120.5 588 S
-(\255129.556529 46.532180 \2552514.533569 13106.458803 3)-5 E 7.5(#1)
-120.5 600 S 2.5<30ad>-7.5 G
-(129.574238 46.503475 \2552470.815735 16573.419607 4)-2.5 E 7.5(#1)120.5
-612 S 2.5<31ad>-7.5 G
-(129.576876 46.504250 \2552444.596313 16793.419607 3)-2.5 E 7.5(#1)120.5
-624 S 2.5<32ad>-7.5 G
-(129.559168 46.532956 \2552521.781921 20260.380412 4)-2.5 E 7.5(#1)120.5
-636 S 2.5<33ad>-7.5 G
-(129.561807 46.533732 \2552537.382141 20480.380412 3)-2.5 E 7.5(#1)120.5
-648 S 2.5<34ad>-7.5 G
-(129.579514 46.505026 \2552429.459961 23947.341216 4)-2.5 E 7.5(#1)120.5
-660 S 2.5<35ad>-7.5 G
-(129.582152 46.505801 \2552412.764343 24167.341217 3)-2.5 E 7.5(#1)120.5
-672 S 2.5<36ad>-7.5 G
-(129.564447 46.534508 \2552545.397705 27634.302021 4)-2.5 E 7.5(#1)120.5
-684 S 2.5<37ad>-7.5 G
-(129.567086 46.535284 \2552534.068665 27854.302021 3)-2.5 E 7.5(#1)120.5
-696 S 2.5<38ad>-7.5 G
-(129.584791 46.506576 \2552398.283020 31321.262826 4)-2.5 E 7.5(#1)120.5
-708 S 2.5<39ad>-7.5 G
-(129.587429 46.507352 \2552390.671509 31541.262826 3)-2.5 E 7.5(#2)120.5
-720 S 2.5<30ad>-7.5 G
-(129.569726 46.536059 \2552489.889282 35008.223630 4)-2.5 E
-(MB-System 5.0)72 768 Q(22 February 2015)135.11 E(5)193.45 E 0 Cg EP
-%%Page: 6 6
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 105.94(mbm_route2mission\(1\) MB-System)72 48 R
-105.94(5.0 mbm_route2mission\(1\))2.5 F 7.5(#2)120.5 84 S 2.5<31ad>-7.5
-G(129.572365 46.536835 \2552465.280823 35228.223630 3)-2.5 E 7.5(#2)
-120.5 96 S 2.5<32ad>-7.5 G
-(129.590068 46.508127 \2552389.067017 38695.184435 4)-2.5 E 7.5(#2)120.5
-108 S 2.5<33ad>-7.5 G
-(129.592706 46.508902 \2552409.290771 38915.184435 3)-2.5 E 7.5(#2)120.5
-120 S 2.5<34ad>-7.5 G
-(129.575005 46.537610 \2552466.533142 42382.145240 4)-2.5 E 7.5(#2)120.5
-132 S 2.5<35ad>-7.5 G
-(129.577645 46.538386 \2552491.371094 42602.145240 3)-2.5 E 7.5(#2)120.5
-144 S 2.5<36ad>-7.5 G
-(129.595345 46.509677 \2552397.609253 46069.106044 4)-2.5 E 7.5(#2)120.5
-156 S 2.5<37ad>-7.5 G
-(129.597984 46.510452 \2552413.315918 46289.106044 3)-2.5 E 7.5(#2)120.5
-168 S 2.5<38ad>-7.5 G
-(129.580285 46.539161 \2552499.048889 49756.066849 4)-2.5 E 7.5(#2)120.5
-180 S 2.5<39ad>-7.5 G
-(129.582925 46.539937 \2552523.030640 49976.066849 3)-2.5 E 7.5(#3)120.5
-192 S 2.5<30ad>-7.5 G
-(129.600622 46.511227 \2552443.481018 53443.027653 4)-2.5 E 7.5(#3)120.5
-204 S 2.5<31ad>-7.5 G
-(129.603261 46.512002 \2552419.008240 53663.027653 3)-2.5 E 7.5(#3)120.5
-216 S 2.5<32ad>-7.5 G
-(129.585565 46.540712 \2552518.522400 57129.988458 4)-2.5 E 7.5(#3)120.5
-228 S 2.5<33ad>-7.5 G
-(129.588205 46.541487 \2552498.521301 57349.988458 3)-2.5 E 7.5(#3)120.5
-240 S 2.5<34ad>-7.5 G
-(129.605900 46.512777 \2552450.386536 60816.949263 4)-2.5 E 7.5(#3)120.5
-252 S 2.5<35ad>-7.5 G
-(129.608539 46.513552 \2552473.623230 61036.949263 3)-2.5 E 7.5(#3)120.5
-264 S 2.5<36ad>-7.5 G
-(129.590845 46.542262 \2552487.422180 64503.910067 4)-2.5 E 7.5(#3)120.5
-276 S 2.5<37ad>-7.5 G
-(129.593485 46.543038 \2552491.040466 64723.910067 3)-2.5 E 7.5(#3)120.5
-288 S 2.5<38ad>-7.5 G
-(129.611178 46.514327 \2552472.610657 68190.870872 3)-2.5 E 7.5(#3)120.5
-300 S 2.5<39ad>-7.5 G
-(129.606711 46.517999 \2552485.114583 68723.704236 3)-2.5 E 7.5(#4)120.5
-312 S 2.5<30ad>-7.5 G
-(129.557338 46.509809 \2552488.398743 72619.152031 3)-2.5 E 7.5(#4)120.5
-324 S 2.5<31ad>-7.5 G
-(129.550415 46.521262 \2552545.285828 73998.189601 3)-2.5 E 7.5(#4)120.5
-336 S 2.5<32ad>-7.5 G
-(129.600724 46.536447 \2552470.920736 78209.372536 3)-2.5 E 7.5(#4)120.5
-348 S 2.5<33ad>-7.5 G
-(129.606972 46.525648 \2552443.988281 79501.503455 4)-2.5 E(#)120.5 360
-Q 2.5(#At)120.5 372 S(otal of 550 mission points ha)-2.5 E .3 -.15(ve b)
--.2 H(een de\214ned.).15 E(#)120.5 384 Q 2.5(#D)120.5 396 S
-(e\214ne Mission parameters:)-2.5 E(#de\214ne MISSION_SPEED)120.5 408 Q
-(1.500000)15 E(#de\214ne MISSION_DIST)120.5 420 Q 5(ANCE 79501.503455)
--.93 F(#de\214ne MISSION_TIME)120.5 432 Q(57203)17.5 E
-(#de\214ne MISSION_TIMEOUT)120.5 444 Q(60067)10 E(#de\214ne DEPTH_MAX)
-120.5 456 Q(2525.307922)25 E(#de\214ne DEPTH_ABOR)120.5 468 Q 20(T2)-.6
-G(562.807922)-20 E(#de\214ne AL)120.5 480 Q 5(TITUDE_DESIRED 75.000000)
--.92 F(#de\214ne AL)120.5 492 Q 15(TITUDE_MIN 75.000000)-.92 F
-(#de\214ne AL)120.5 504 Q(TITUDE_ABOR)-.92 E 12.5(T3)-.6 G(0.000000)
--12.5 E(#de\214ne GPS_DURA)120.5 516 Q 15(TION 600)-1.11 F
-(#de\214ne DESCENT_DEPTH)120.5 528 Q(3.000000)15 E
-(#de\214ne SPIRAL_DESCENT_DEPTH)120.5 540 Q(2324.917643)15 E
-(#de\214ne SPIRAL_DESCENT_AL)120.5 552 Q 5(TITUDE 50.000000)-.92 F
-(#de\214ne DESCEND_DURA)120.5 564 Q 5(TION 300)-1.11 F
-(#de\214ne SETPOINT_DURA)120.5 576 Q 2.5(TION 30)-1.11 F
-(#de\214ne GPSMINHITS)120.5 588 Q(10)22.5 E(#de\214ne ASCENDR)120.5 600
-Q 15(UDDER 3.000000)-.4 F(#de\214ne ASCENDPITCH)120.5 612 Q(45.000000)20
-E(#de\214ne ASCENDENDDEPTH)120.5 624 Q(2.000000)12.5 E
-(#de\214ne DESCENDR)120.5 636 Q 12.5(UDDER 3.000000)-.4 F
-(#de\214ne DESCENDPITCH)120.5 648 Q(\25530.000000)17.5 E
-(#de\214ne MAXCR)120.5 660 Q(OSSTRA)-.4 E(CKERR)-.4 E(OR 30)-.4 E
-(#de\214ne RESON_DURA)120.5 672 Q 10(TION 6)-1.11 F(#q)120.5 684 Q
-(MB-System 5.0)72 768 Q(22 February 2015)135.11 E(6)193.45 E 0 Cg EP
-%%Page: 7 7
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 105.94(mbm_route2mission\(1\) MB-System)72 48 R
-105.94(5.0 mbm_route2mission\(1\))2.5 F/F1 10.95/Times-Bold at 0 SF
-(SEE ALSO)72 84 Q/F2 10/Times-Bold at 0 SF(mbsystem)108 96 Q F0(\(1\),)A F2
-(mbgrdviz)2.5 E F0(\(1\))A F1 -.11(BU)72 124.8 S(GS).11 E F0(Perhaps.)
-108 136.8 Q(MB-System 5.0)72 768 Q(22 February 2015)135.11 E(7)193.45 E
-0 Cg EP
-%%Trailer
-end
-%%EOF
diff --git a/src/ps/mbm_stat.ps b/src/ps/mbm_stat.ps
deleted file mode 100644
index 6e7bbbb..0000000
--- a/src/ps/mbm_stat.ps
+++ /dev/null
@@ -1,272 +0,0 @@
-%!PS-Adobe-3.0
-%%Creator: groff version 1.19.2
-%%CreationDate: Wed Jul  1 12:29:29 2015
-%%DocumentNeededResources: font Times-Roman
-%%+ font Times-Bold
-%%+ font Times-Italic
-%%DocumentSuppliedResources: procset grops 1.19 2
-%%Pages: 1
-%%PageOrder: Ascend
-%%DocumentMedia: Default 612 792 0 () ()
-%%Orientation: Portrait
-%%EndComments
-%%BeginDefaults
-%%PageMedia: Default
-%%EndDefaults
-%%BeginProlog
-%%BeginResource: procset grops 1.19 2
-%!PS-Adobe-3.0 Resource-ProcSet
-/setpacking where{
-pop
-currentpacking
-true setpacking
-}if
-/grops 120 dict dup begin
-/SC 32 def
-/A/show load def
-/B{0 SC 3 -1 roll widthshow}bind def
-/C{0 exch ashow}bind def
-/D{0 exch 0 SC 5 2 roll awidthshow}bind def
-/E{0 rmoveto show}bind def
-/F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def
-/G{0 rmoveto 0 exch ashow}bind def
-/H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/I{0 exch rmoveto show}bind def
-/J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def
-/K{0 exch rmoveto 0 exch ashow}bind def
-/L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/M{rmoveto show}bind def
-/N{rmoveto 0 SC 3 -1 roll widthshow}bind def
-/O{rmoveto 0 exch ashow}bind def
-/P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/Q{moveto show}bind def
-/R{moveto 0 SC 3 -1 roll widthshow}bind def
-/S{moveto 0 exch ashow}bind def
-/T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/SF{
-findfont exch
-[exch dup 0 exch 0 exch neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/MF{
-findfont
-[5 2 roll
-0 3 1 roll
-neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/level0 0 def
-/RES 0 def
-/PL 0 def
-/LS 0 def
-/MANUAL{
-statusdict begin/manualfeed true store end
-}bind def
-/PLG{
-gsave newpath clippath pathbbox grestore
-exch pop add exch pop
-}bind def
-/BP{
-/level0 save def
-1 setlinecap
-1 setlinejoin
-72 RES div dup scale
-LS{
-90 rotate
-}{
-0 PL translate
-}ifelse
-1 -1 scale
-}bind def
-/EP{
-level0 restore
-showpage
-}def
-/DA{
-newpath arcn stroke
-}bind def
-/SN{
-transform
-.25 sub exch .25 sub exch
-round .25 add exch round .25 add exch
-itransform
-}bind def
-/DL{
-SN
-moveto
-SN
-lineto stroke
-}bind def
-/DC{
-newpath 0 360 arc closepath
-}bind def
-/TM matrix def
-/DE{
-TM currentmatrix pop
-translate scale newpath 0 0 .5 0 360 arc closepath
-TM setmatrix
-}bind def
-/RC/rcurveto load def
-/RL/rlineto load def
-/ST/stroke load def
-/MT/moveto load def
-/CL/closepath load def
-/Fr{
-setrgbcolor fill
-}bind def
-/setcmykcolor where{
-pop
-/Fk{
-setcmykcolor fill
-}bind def
-}if
-/Fg{
-setgray fill
-}bind def
-/FL/fill load def
-/LW/setlinewidth load def
-/Cr/setrgbcolor load def
-/setcmykcolor where{
-pop
-/Ck/setcmykcolor load def
-}if
-/Cg/setgray load def
-/RE{
-findfont
-dup maxlength 1 index/FontName known not{1 add}if dict begin
-{
-1 index/FID ne{def}{pop pop}ifelse
-}forall
-/Encoding exch def
-dup/FontName exch def
-currentdict end definefont pop
-}bind def
-/DEFS 0 def
-/EBEGIN{
-moveto
-DEFS begin
-}bind def
-/EEND/end load def
-/CNT 0 def
-/level1 0 def
-/PBEGIN{
-/level1 save def
-translate
-div 3 1 roll div exch scale
-neg exch neg exch translate
-0 setgray
-0 setlinecap
-1 setlinewidth
-0 setlinejoin
-10 setmiterlimit
-[]0 setdash
-/setstrokeadjust where{
-pop
-false setstrokeadjust
-}if
-/setoverprint where{
-pop
-false setoverprint
-}if
-newpath
-/CNT countdictstack def
-userdict begin
-/showpage{}def
-/setpagedevice{}def
-}bind def
-/PEND{
-countdictstack CNT sub{end}repeat
-level1 restore
-}bind def
-end def
-/setpacking where{
-pop
-setpacking
-}if
-%%EndResource
-%%EndProlog
-%%BeginSetup
-%%BeginFeature: *PageSize Default
-<< /PageSize [ 612 792 ] /ImagingBBox null >> setpagedevice
-%%EndFeature
-%%IncludeResource: font Times-Roman
-%%IncludeResource: font Times-Bold
-%%IncludeResource: font Times-Italic
-grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72
-def/PL 792 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron/Zcaron
-/scaron/zcaron/Ydieresis/trademark/quotesingle/Euro/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/space/exclam/quotedbl/numbersign/dollar/percent
-/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen
-/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon
-/semicolon/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O
-/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright/circumflex
-/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y
-/z/braceleft/bar/braceright/tilde/.notdef/quotesinglbase/guillemotleft
-/guillemotright/bullet/florin/fraction/perthousand/dagger/daggerdbl
-/endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut
-/dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash
-/quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen
-/brokenbar/section/dieresis/copyright/ordfeminine/guilsinglleft
-/logicalnot/minus/registered/macron/degree/plusminus/twosuperior
-/threesuperior/acute/mu/paragraph/periodcentered/cedilla/onesuperior
-/ordmasculine/guilsinglright/onequarter/onehalf/threequarters
-/questiondown/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE
-/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex
-/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis
-/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn
-/germandbls/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla
-/egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis
-/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide/oslash
-/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis]def
-/Times-Italic at 0 ENC0/Times-Italic RE/Times-Bold at 0 ENC0/Times-Bold RE
-/Times-Roman at 0 ENC0/Times-Roman RE
-%%EndSetup
-%%Page: 1 1
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 148.72(mbm_stat\(1\) MB-System)72 48 R 148.72
-(5.0 mbm_stat\(1\))2.5 F/F1 10.95/Times-Bold at 0 SF -.219(NA)72 84 S(ME)
-.219 E/F2 10/Times-Bold at 0 SF(mbm_stat)108 96 Q F0 2.5<ad45>2.5 G
-(xtract beam statistics from output generated by mbinfo.)-2.5 E F1
-(VERSION)72 124.8 Q F0 -1.11(Ve)108 136.8 S(rsion 5.0)1.11 E F1
-(SYNOPSIS)72 165.6 Q F2(mbm_stat \255I)108 177.6 Q/F3 10/Times-Italic at 0
-SF(\214le)A F2([\255V \255H])2.5 E F1(DESCRIPTION)72 206.4 Q F2
-(mbm_stat)108 218.4 Q F0 .667(is a perl shellscript that e)3.167 F .666
-(xtracts beam statistics from the output of)-.15 F F2(mbinf)3.166 E(o)
--.25 E F0 3.166(.T)C .666(he output of con-)-3.166 F 1.091(tains the ba\
-se name of the data \214le, then number of hours of data in the data \
-\214le, and the percentage of)108 230.4 R .168
-(dropped and \215agged beams. One line of output for each run of)108
-242.4 R F2(mbinf)2.667 E(o)-.25 E F0 .167(is generated. This allo)2.667
-F(ws)-.25 E F2(mbm_stat)2.667 E F0 .283(to be run on accumulated data s\
-uch as might be generated by logging the daily mail statistics. Columns\
- are)108 254.4 R(tab delimited.)108 266.4 Q F1 -.548(AU)72 295.2 S
-(THORSHIP).548 E F0(Da)108 307.2 Q(vid W)-.2 E 2.5(.C)-.92 G
-(aress \(caress at mbari.or)-2.5 E(g\))-.18 E(Montere)113 319.2 Q 2.5(yB)
--.15 G(ay Aquarium Research Institute)-2.5 E
-(Dale N. Chayes \(dale at ldeo.columbia.edu\))108 331.2 Q
-(Lamont-Doherty Earth Observ)113 343.2 Q(atory)-.25 E
-(Suzanne H. O'Hara \(sohara at ldeo.columbia.edu\))108 355.2 Q
-(Lamont-Doherty Earth Observ)113 367.2 Q(atory)-.25 E F1(OPTIONS)72 396
-Q F2<ad48>108 408 Q F0 .162(This "help" \215ag cause the program to pri\
-nt out a description of its operation and then e)22.52 F .161
-(xit immedi-)-.15 F(ately)144 420 Q(.)-.65 E F2<ad49>108 436.8 Q F3
-(\214le)26.41 E F0
-(Data \214le to be processed which contains the output of one or more e)
-144 448.8 Q -.15(xe)-.15 G(cutions of).15 E F2(mbinf)2.5 E(o)-.25 E F0
-(.)A F2<ad56>108 465.6 Q F0(Causes)23.08 E F2(mbm_stat)2.5 E F0
-(to operate in "v)2.5 E
-(erbose" mode so that it outputs more information than usual.)-.15 E F1
-(SEE ALSO)72 494.4 Q F2(mbsystem)108 506.4 Q F0(\(1\),)A F2(mbinf)2.5 E
-(o)-.25 E F0(\(1\))A F1 -.11(BU)72 535.2 S(GS).11 E F0 -.8(To)108 547.2
-S 2.5(os).8 G(imple to ha)-2.5 E .3 -.15(ve a)-.2 H .3 -.15(ny r).15 H
-(eally interesting b).15 E(ugs.)-.2 E(MB-System 5.0)72 768 Q 2.5(3J)
-146.495 G(une 2013)-2.5 E(1)204.835 E 0 Cg EP
-%%Trailer
-end
-%%EOF
diff --git a/src/ps/mbm_utm.ps b/src/ps/mbm_utm.ps
deleted file mode 100644
index 8a463b1..0000000
--- a/src/ps/mbm_utm.ps
+++ /dev/null
@@ -1,321 +0,0 @@
-%!PS-Adobe-3.0
-%%Creator: groff version 1.19.2
-%%CreationDate: Wed Jul  1 12:29:29 2015
-%%DocumentNeededResources: font Times-Roman
-%%+ font Times-Bold
-%%+ font Times-Italic
-%%DocumentSuppliedResources: procset grops 1.19 2
-%%Pages: 2
-%%PageOrder: Ascend
-%%DocumentMedia: Default 612 792 0 () ()
-%%Orientation: Portrait
-%%EndComments
-%%BeginDefaults
-%%PageMedia: Default
-%%EndDefaults
-%%BeginProlog
-%%BeginResource: procset grops 1.19 2
-%!PS-Adobe-3.0 Resource-ProcSet
-/setpacking where{
-pop
-currentpacking
-true setpacking
-}if
-/grops 120 dict dup begin
-/SC 32 def
-/A/show load def
-/B{0 SC 3 -1 roll widthshow}bind def
-/C{0 exch ashow}bind def
-/D{0 exch 0 SC 5 2 roll awidthshow}bind def
-/E{0 rmoveto show}bind def
-/F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def
-/G{0 rmoveto 0 exch ashow}bind def
-/H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/I{0 exch rmoveto show}bind def
-/J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def
-/K{0 exch rmoveto 0 exch ashow}bind def
-/L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/M{rmoveto show}bind def
-/N{rmoveto 0 SC 3 -1 roll widthshow}bind def
-/O{rmoveto 0 exch ashow}bind def
-/P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/Q{moveto show}bind def
-/R{moveto 0 SC 3 -1 roll widthshow}bind def
-/S{moveto 0 exch ashow}bind def
-/T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/SF{
-findfont exch
-[exch dup 0 exch 0 exch neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/MF{
-findfont
-[5 2 roll
-0 3 1 roll
-neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/level0 0 def
-/RES 0 def
-/PL 0 def
-/LS 0 def
-/MANUAL{
-statusdict begin/manualfeed true store end
-}bind def
-/PLG{
-gsave newpath clippath pathbbox grestore
-exch pop add exch pop
-}bind def
-/BP{
-/level0 save def
-1 setlinecap
-1 setlinejoin
-72 RES div dup scale
-LS{
-90 rotate
-}{
-0 PL translate
-}ifelse
-1 -1 scale
-}bind def
-/EP{
-level0 restore
-showpage
-}def
-/DA{
-newpath arcn stroke
-}bind def
-/SN{
-transform
-.25 sub exch .25 sub exch
-round .25 add exch round .25 add exch
-itransform
-}bind def
-/DL{
-SN
-moveto
-SN
-lineto stroke
-}bind def
-/DC{
-newpath 0 360 arc closepath
-}bind def
-/TM matrix def
-/DE{
-TM currentmatrix pop
-translate scale newpath 0 0 .5 0 360 arc closepath
-TM setmatrix
-}bind def
-/RC/rcurveto load def
-/RL/rlineto load def
-/ST/stroke load def
-/MT/moveto load def
-/CL/closepath load def
-/Fr{
-setrgbcolor fill
-}bind def
-/setcmykcolor where{
-pop
-/Fk{
-setcmykcolor fill
-}bind def
-}if
-/Fg{
-setgray fill
-}bind def
-/FL/fill load def
-/LW/setlinewidth load def
-/Cr/setrgbcolor load def
-/setcmykcolor where{
-pop
-/Ck/setcmykcolor load def
-}if
-/Cg/setgray load def
-/RE{
-findfont
-dup maxlength 1 index/FontName known not{1 add}if dict begin
-{
-1 index/FID ne{def}{pop pop}ifelse
-}forall
-/Encoding exch def
-dup/FontName exch def
-currentdict end definefont pop
-}bind def
-/DEFS 0 def
-/EBEGIN{
-moveto
-DEFS begin
-}bind def
-/EEND/end load def
-/CNT 0 def
-/level1 0 def
-/PBEGIN{
-/level1 save def
-translate
-div 3 1 roll div exch scale
-neg exch neg exch translate
-0 setgray
-0 setlinecap
-1 setlinewidth
-0 setlinejoin
-10 setmiterlimit
-[]0 setdash
-/setstrokeadjust where{
-pop
-false setstrokeadjust
-}if
-/setoverprint where{
-pop
-false setoverprint
-}if
-newpath
-/CNT countdictstack def
-userdict begin
-/showpage{}def
-/setpagedevice{}def
-}bind def
-/PEND{
-countdictstack CNT sub{end}repeat
-level1 restore
-}bind def
-end def
-/setpacking where{
-pop
-setpacking
-}if
-%%EndResource
-%%EndProlog
-%%BeginSetup
-%%BeginFeature: *PageSize Default
-<< /PageSize [ 612 792 ] /ImagingBBox null >> setpagedevice
-%%EndFeature
-%%IncludeResource: font Times-Roman
-%%IncludeResource: font Times-Bold
-%%IncludeResource: font Times-Italic
-grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72
-def/PL 792 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron/Zcaron
-/scaron/zcaron/Ydieresis/trademark/quotesingle/Euro/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/space/exclam/quotedbl/numbersign/dollar/percent
-/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen
-/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon
-/semicolon/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O
-/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright/circumflex
-/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y
-/z/braceleft/bar/braceright/tilde/.notdef/quotesinglbase/guillemotleft
-/guillemotright/bullet/florin/fraction/perthousand/dagger/daggerdbl
-/endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut
-/dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash
-/quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen
-/brokenbar/section/dieresis/copyright/ordfeminine/guilsinglleft
-/logicalnot/minus/registered/macron/degree/plusminus/twosuperior
-/threesuperior/acute/mu/paragraph/periodcentered/cedilla/onesuperior
-/ordmasculine/guilsinglright/onequarter/onehalf/threequarters
-/questiondown/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE
-/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex
-/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis
-/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn
-/germandbls/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla
-/egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis
-/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide/oslash
-/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis]def
-/Times-Italic at 0 ENC0/Times-Italic RE/Times-Bold at 0 ENC0/Times-Bold RE
-/Times-Roman at 0 ENC0/Times-Roman RE
-%%EndSetup
-%%Page: 1 1
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 134.84(mbm_project\(1\) MB-System)72 48 R 134.84
-(5.0 mbm_project\(1\))2.5 F/F1 10.95/Times-Bold at 0 SF -.219(NA)72 84 S
-(ME).219 E/F2 10/Times-Bold at 0 SF(mbm_utm)108 96 Q F0 2.5<ad4d>2.5 G
-(acro to perform forw)-2.5 E(ard and in)-.1 E -.15(ve)-.4 G
-(rse UTM projections of ASCII data triples.).15 E F1(VERSION)72 124.8 Q
-F0 -1.11(Ve)108 136.8 S(rsion 5.0)1.11 E F1(SYNOPSIS)72 165.6 Q F0
-(mbm_utm)108 177.6 Q F2<ad49>2.5 E/F3 10/Times-Italic at 0 SF(in\214le)A F2
-<ad4f>2.5 E F3(out\214le)A F2<ad5a>2.5 E F3(zone)A F2<ad45>2.5 E F3
-(ellipsoid)A F0([)2.5 E F2<ad4620ad5120ad4820ad56>A F0(])A F1
-(DESCRIPTION)72 206.4 Q F2(mbm_utm)108 218.4 Q F0 1.282
-(is a macro to perform forw)3.782 F 1.281(ard and in)-.1 F -.15(ve)-.4 G
-1.281(rse UTM projections of ASCII data triples using the).15 F 1.16
-(GMT program mapproject.)108 230.4 R -.15(Fo)6.16 G(rw).15 E 1.16
-(ard projections translate from geographic data \(lon, lat, v)-.1 F 1.16
-(alue\) to UTM)-.25 F 1.096(eastings and northings \(x, y)108 242.4 R
-3.596(,v)-.65 G 3.596(alue\). In)-3.846 F -.15(ve)-.4 G 1.096
-(rse projections translate from \(x, y).15 F 3.595(,z)-.65 G 3.595(\)t)
--3.595 G 3.595(o\()-3.595 G 1.095(lon, lat, z\).)-3.595 F 1.095
-(Both the)6.095 F(input and output \214les must be speci\214ed.)108
-254.4 Q F1 -.548(AU)72 283.2 S(THORSHIP).548 E F0(Da)108 295.2 Q(vid W)
--.2 E 2.5(.C)-.92 G(aress \(caress at mbari.or)-2.5 E(g\))-.18 E(Montere)
-113 307.2 Q 2.5(yB)-.15 G(ay Aquarium Research Institute)-2.5 E
-(Dale N. Chayes \(dale at ldeo.columbia.edu\))108 319.2 Q
-(Lamont-Doherty Earth Observ)113 331.2 Q(atory)-.25 E F1
-(SIMPLE DESCRIPTION OF B)72 360 Q(ASIC OPTIONS)-.329 E F2<ad48>108 372 Q
-F0 .162(This "help" \215ag cause the program to print out a description\
- of its operation and then e)22.52 F .162(xit immedi-)-.15 F(ately)144
-384 Q(.)-.65 E F2<ad45>108 400.8 Q F3(ellipsoid)A F0 .803
-(Sets the ellipsoid to be used. The def)144 412.8 R .802
-(ault is to use the WGS-84 ellipsoid, in accordance with the)-.1 F -.35
-(NA)144 424.8 S .135(D-83 datum. If ellipsoid = "Clark).35 F .135
-(e-1866", then the Clark)-.1 F .135
-(e-1866 ellipsoid will be used in accor)-.1 F(-)-.2 E .87
-(dance with the N)144 436.8 R .869(AD-27 datum. Note that this macro ca\
-nnot be used to accomplish a true datum)-.35 F 1.053(shift between N)144
-448.8 R 1.054(AD-27 and N)-.35 F 1.054
-(AD-83 because the 1986 transition to N)-.35 F 1.054(AD-83 also in)-.35
-F -.2(vo)-.4 G(lv).2 E 1.054(ed addi-)-.15 F
-(tional adjustments to positions.)144 460.8 Q F2<ad46>108 477.6 Q F0
-(Causes)24.19 E F2(mbm_utm)2.5 E F0
-(to use or generate eastings and northings in feet rather than meters.)
-2.5 E F2<ad49>108 494.4 Q F3(in\214le)A F0 1.391
-(Sets the name of the data \214le to be processed.)6.41 F 1.39
-(The \214rst tw)6.391 F 3.89(oc)-.1 G 1.39
-(olumns of the ASCII input data)-3.89 F .208
-(stream must be either longitude and latitude v)144 506.4 R .209
-(alues \(for geographic to projected transformation\) or)-.25 F .36
-(easting and northing v)144 518.4 R .36
-(alues \(for projected to geographic transformation\).)-.25 F(An)5.36 E
-2.86(ya)-.15 G .36(dditional columns)-2.86 F
-(of data are passed unaltered to the output.)144 530.4 Q F2<ad4f>108
-547.2 Q F3(out\214le)A F0 .649
-(Sets the name of the output data \214le to be generated.)144 559.2 R
-.65(The \214rst tw)5.65 F 3.15(oc)-.1 G .65(olumns of the ASCII output)
--3.15 F .295(data stream will be either easting and northing v)144 571.2
-R .294(alues \(for geographic to projected transformation\))-.25 F .492
-(or longitude and latitude v)144 583.2 R .493
-(alues \(for projected to geographic transformation\).)-.25 F(An)5.493 E
-2.993(ya)-.15 G .493(dditional col-)-2.993 F
-(umns of data are passed unaltered to the output.)144 595.2 Q F2<ad51>
-108 612 Q F0 .316(This option causes the transformation to be from proj\
-ected coordinates \(eastings and northings\) to)22.52 F 1.115
-(geographic coordinates \(longitude and latitude\).)144 624 R 1.116
-(The def)6.116 F 1.116(ault is to transform from geographic to)-.1 F
-(projected coordinates.)144 636 Q F2<ad5a>108 652.8 Q F3(zone)A F0
-(Sets the UTM zone.)5.3 E F1(EXAMPLES)72 681.6 Q F0 .04(Suppose we ha)
-108 693.6 R .34 -.15(ve a \214)-.2 H .039
-(le containing longitude, latitude, and depth triples called llz.dat. T)
-.15 F 2.539(ot)-.8 G .039(ransform the coor)-2.539 F(-)-.2 E
-(dinates to eastings and northings in the UTM Zone 10 projection, use:)
-108 705.6 Q(mbm_utm \255Illz.dat \255Z10 \255Oenz.dat)144 717.6 Q .817(\
-The \214le enz.dat will contain eastings and northings instead of longi\
-tude and latitude v)108 729.6 R .818(alues. T)-.25 F 3.318(ot)-.8 G
-(ransform)-3.318 E(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)-2.5
-E(1)204.835 E 0 Cg EP
-%%Page: 2 2
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 134.84(mbm_project\(1\) MB-System)72 48 R 134.84
-(5.0 mbm_project\(1\))2.5 F(back to geographic coordinates, use:)108 84
-Q(mbm_utm \255Ienz.dat \255Z10 \255Q \255Ollz2.dat)144 96 Q/F1 10.95
-/Times-Bold at 0 SF(SEE ALSO)72 124.8 Q/F2 10/Times-Bold at 0 SF(mbsystem)108
-136.8 Q F0(\(1\),)A F2(pr)2.5 E(oject)-.18 E F1 -.11(BU)72 165.6 S(GS)
-.11 E F0 -.8(To)108 177.6 S 2.5(on).8 G .5 -.25(ew t)-2.5 H 2.5(oh).25 G
--2.25 -.2(av e)-2.5 H -.2(bu)2.7 G(gs.).2 E(MB-System 5.0)72 768 Q 2.5
-(3J)146.495 G(une 2013)-2.5 E(2)204.835 E 0 Cg EP
-%%Trailer
-end
-%%EOF
diff --git a/src/ps/mbm_vrefcheck.ps b/src/ps/mbm_vrefcheck.ps
deleted file mode 100644
index 2ed7895..0000000
--- a/src/ps/mbm_vrefcheck.ps
+++ /dev/null
@@ -1,326 +0,0 @@
-%!PS-Adobe-3.0
-%%Creator: groff version 1.19.2
-%%CreationDate: Wed Jul  1 12:29:29 2015
-%%DocumentNeededResources: font Times-Roman
-%%+ font Times-Bold
-%%+ font Times-Italic
-%%DocumentSuppliedResources: procset grops 1.19 2
-%%Pages: 2
-%%PageOrder: Ascend
-%%DocumentMedia: Default 612 792 0 () ()
-%%Orientation: Portrait
-%%EndComments
-%%BeginDefaults
-%%PageMedia: Default
-%%EndDefaults
-%%BeginProlog
-%%BeginResource: procset grops 1.19 2
-%!PS-Adobe-3.0 Resource-ProcSet
-/setpacking where{
-pop
-currentpacking
-true setpacking
-}if
-/grops 120 dict dup begin
-/SC 32 def
-/A/show load def
-/B{0 SC 3 -1 roll widthshow}bind def
-/C{0 exch ashow}bind def
-/D{0 exch 0 SC 5 2 roll awidthshow}bind def
-/E{0 rmoveto show}bind def
-/F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def
-/G{0 rmoveto 0 exch ashow}bind def
-/H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/I{0 exch rmoveto show}bind def
-/J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def
-/K{0 exch rmoveto 0 exch ashow}bind def
-/L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/M{rmoveto show}bind def
-/N{rmoveto 0 SC 3 -1 roll widthshow}bind def
-/O{rmoveto 0 exch ashow}bind def
-/P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/Q{moveto show}bind def
-/R{moveto 0 SC 3 -1 roll widthshow}bind def
-/S{moveto 0 exch ashow}bind def
-/T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/SF{
-findfont exch
-[exch dup 0 exch 0 exch neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/MF{
-findfont
-[5 2 roll
-0 3 1 roll
-neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/level0 0 def
-/RES 0 def
-/PL 0 def
-/LS 0 def
-/MANUAL{
-statusdict begin/manualfeed true store end
-}bind def
-/PLG{
-gsave newpath clippath pathbbox grestore
-exch pop add exch pop
-}bind def
-/BP{
-/level0 save def
-1 setlinecap
-1 setlinejoin
-72 RES div dup scale
-LS{
-90 rotate
-}{
-0 PL translate
-}ifelse
-1 -1 scale
-}bind def
-/EP{
-level0 restore
-showpage
-}def
-/DA{
-newpath arcn stroke
-}bind def
-/SN{
-transform
-.25 sub exch .25 sub exch
-round .25 add exch round .25 add exch
-itransform
-}bind def
-/DL{
-SN
-moveto
-SN
-lineto stroke
-}bind def
-/DC{
-newpath 0 360 arc closepath
-}bind def
-/TM matrix def
-/DE{
-TM currentmatrix pop
-translate scale newpath 0 0 .5 0 360 arc closepath
-TM setmatrix
-}bind def
-/RC/rcurveto load def
-/RL/rlineto load def
-/ST/stroke load def
-/MT/moveto load def
-/CL/closepath load def
-/Fr{
-setrgbcolor fill
-}bind def
-/setcmykcolor where{
-pop
-/Fk{
-setcmykcolor fill
-}bind def
-}if
-/Fg{
-setgray fill
-}bind def
-/FL/fill load def
-/LW/setlinewidth load def
-/Cr/setrgbcolor load def
-/setcmykcolor where{
-pop
-/Ck/setcmykcolor load def
-}if
-/Cg/setgray load def
-/RE{
-findfont
-dup maxlength 1 index/FontName known not{1 add}if dict begin
-{
-1 index/FID ne{def}{pop pop}ifelse
-}forall
-/Encoding exch def
-dup/FontName exch def
-currentdict end definefont pop
-}bind def
-/DEFS 0 def
-/EBEGIN{
-moveto
-DEFS begin
-}bind def
-/EEND/end load def
-/CNT 0 def
-/level1 0 def
-/PBEGIN{
-/level1 save def
-translate
-div 3 1 roll div exch scale
-neg exch neg exch translate
-0 setgray
-0 setlinecap
-1 setlinewidth
-0 setlinejoin
-10 setmiterlimit
-[]0 setdash
-/setstrokeadjust where{
-pop
-false setstrokeadjust
-}if
-/setoverprint where{
-pop
-false setoverprint
-}if
-newpath
-/CNT countdictstack def
-userdict begin
-/showpage{}def
-/setpagedevice{}def
-}bind def
-/PEND{
-countdictstack CNT sub{end}repeat
-level1 restore
-}bind def
-end def
-/setpacking where{
-pop
-setpacking
-}if
-%%EndResource
-%%EndProlog
-%%BeginSetup
-%%BeginFeature: *PageSize Default
-<< /PageSize [ 612 792 ] /ImagingBBox null >> setpagedevice
-%%EndFeature
-%%IncludeResource: font Times-Roman
-%%IncludeResource: font Times-Bold
-%%IncludeResource: font Times-Italic
-grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72
-def/PL 792 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron/Zcaron
-/scaron/zcaron/Ydieresis/trademark/quotesingle/Euro/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/space/exclam/quotedbl/numbersign/dollar/percent
-/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen
-/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon
-/semicolon/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O
-/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright/circumflex
-/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y
-/z/braceleft/bar/braceright/tilde/.notdef/quotesinglbase/guillemotleft
-/guillemotright/bullet/florin/fraction/perthousand/dagger/daggerdbl
-/endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut
-/dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash
-/quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen
-/brokenbar/section/dieresis/copyright/ordfeminine/guilsinglleft
-/logicalnot/minus/registered/macron/degree/plusminus/twosuperior
-/threesuperior/acute/mu/paragraph/periodcentered/cedilla/onesuperior
-/ordmasculine/guilsinglright/onequarter/onehalf/threequarters
-/questiondown/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE
-/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex
-/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis
-/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn
-/germandbls/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla
-/egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis
-/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide/oslash
-/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis]def
-/Times-Italic at 0 ENC0/Times-Italic RE/Times-Bold at 0 ENC0/Times-Bold RE
-/Times-Roman at 0 ENC0/Times-Roman RE
-%%EndSetup
-%%Page: 1 1
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 123.19(mbm_vrefcheck\(1\) MB-System)72 48 R
-123.19(5.0 mbm_vrefcheck\(1\))2.5 F/F1 10.95/Times-Bold at 0 SF -.219(NA)72
-84 S(ME).219 E/F2 10/Times-Bold at 0 SF(mbm_vr)108 96 Q(efcheck)-.18 E F0
-3.095<ad4d>3.095 G .594
-(acro to generate plot of crosstrack sea\215oor slope from a sw)-3.095 F
-.594(ath sonar \214le.)-.1 F .594(The noise)5.594 F
-(in this time series lar)108 108 Q(gely re\215ects noise in the v)-.18 E
-(ertical reference used by the sonar)-.15 E(.)-.55 E F1(VERSION)72 136.8
-Q F0 -1.11(Ve)108 148.8 S(rsion 5.0)1.11 E F1(SYNOPSIS)72 177.6 Q F2
-(mbm_vr)108 189.6 Q(efcheck \255F)-.18 E/F3 10/Times-Italic at 0 SF(format)
-A F2<ad49>2.5 E F3(\214le)A F2([\255S)2.5 E F3(scale)A F2<ad58>2.5 E F3
-(xaxis)A F2<ad41>2.5 E F3(xmin)A F2<ad42>2.5 E F3(xmax)A F2(])A F1
-(DESCRIPTION)72 218.4 Q F2(mbm_vr)108 230.4 Q(efcheck)-.18 E F0 .374(is\
- a macro which generates a plot of high pass \214ltered apparent crosst\
-rack sea\215oor slope.)2.874 F .775
-(The noise in this signal appears to be dominated by noise in the v)108
-242.4 R .775(ertical reference data used by the sonar)-.15 F 2.575
-(system. The)108 254.4 R .075(crosstrack slopes are obtained by running)
-2.575 F F2(mblist)2.576 E F0 2.576(.T)C .076
-(he resulting time series is \214ltered using the)-2.576 F F2(GMT)108
-266.4 Q F0(utility)2.874 E F2(\214lter1d)2.874 E F0 2.874(,w)C .374(hic\
-h uses a time domain median \214lter with a time width of 5 minutes.)
--2.874 F .373(The \214ltered)5.373 F 1.398
-(signal contains little of the actual bath)108 278.4 R 1.398
-(ymetric signal, and thus represents a combination of noise in the)-.05
-F .147(sea\215oor re\215ection tra)108 290.4 R -.15(ve)-.2 G 2.647(lt)
-.15 G .147(imes and the v)-2.647 F .146(ertical reference data stream.)
--.15 F .146(Close inspection of Hydrosweep data)5.146 F 1.348
-(collected on the R/V Ewing with an interacti)108 302.4 R 1.648 -.15
-(ve e)-.25 H 1.348(ditor \().15 F F2(mbedit)A F0 3.848(\)r)C -2.15 -.25
-(ev e)-3.848 H 1.348(als clear v).25 F 1.348(ariability in the observ)
--.25 F(ed)-.15 E .035(crosstrack slope, e)108 314.4 R -.15(ve)-.25 G
-2.535(nw).15 G .035(hen surv)-2.535 F -.15(ey)-.15 G .035
-(ing essentially \215at sea\215oor).15 F 5.035(.T)-.55 G .034
-(his suggests that the \214ltered signal is prob-)-5.035 F .278
-(ably dominated by v)108 326.4 R .278
-(ertical reference noise on the Ewing.)-.15 F .278
-(The plot is automatically rasterized and sent to a)5.278 F(No)108 338.4
-Q -.25(va)-.15 G(jet plotter \(assuming one is on the R/V Ewing\).).25 E
-F1 -.548(AU)72 367.2 S(THORSHIP).548 E F0(Da)108 379.2 Q(vid W)-.2 E 2.5
-(.C)-.92 G(aress \(caress at mbari.or)-2.5 E(g\))-.18 E(Montere)113 391.2 Q
-2.5(yB)-.15 G(ay Aquarium Research Institute)-2.5 E
-(Dale N. Chayes \(dale at ldeo.columbia.edu\))108 403.2 Q
-(Lamont-Doherty Earth Observ)113 415.2 Q(atory)-.25 E
-(Suzanne H. O'Hara \(sohara at ldeo.columbia.edu\))108 427.2 Q
-(Lamont-Doherty Earth Observ)113 439.2 Q(atory)-.25 E F1(OPTIONS)72 468
-Q F2<ad41>108 480 Q F3(xmin)23.08 E F0 1.1
-(Sets the start time of the plot in hours from the be)144 492 R 1.099
-(ginning of the input \214le. If not speci\214ed, the)-.15 F(be)144 504
-Q(ginning of the input \214le will be used as)-.15 E F3(xmin)2.5 E F0(.)
-A F2<ad42>108 520.8 Q F3(xmax)23.63 E F0 .336
-(Sets the end time of the plot in hours from the be)144 532.8 R .337
-(ginning of the input \214le. If not speci\214ed, the end)-.15 F
-(of the input \214le will be used as)144 544.8 Q F3(xmax)2.5 E F0(.)A F2
-<ad46>108 561.6 Q F3(format)24.19 E F0 .364
-(Sets the format for the input sw)144 573.6 R .364(ath sonar data using)
--.1 F F2(MBIO)2.864 E F0(inte)2.864 E .364(ger format identi\214ers.)
--.15 F .364(This macro)5.364 F .991(uses the)144 585.6 R F2(MBIO)3.491 E
-F0 .991(library and will read an)3.491 F 3.491(ys)-.15 G -.1(wa)-3.491 G
-.991(th sonar format supported by).1 F F2(MBIO)3.491 E F0 -5.99 3.491
-(.A l)D .992(ist of the)-3.491 F(sw)144 597.6 Q .694
-(ath sonar data formats currently supported by)-.1 F F2(MBIO)3.194 E F0
-.694(and their identi\214er v)3.194 F .694(alues is gi)-.25 F -.15(ve)
--.25 G 3.194(ni).15 G 3.194(nt)-3.194 G(he)-3.194 E F2(MBIO)144 609.6 Q
-F0(manual page.)2.5 E(Def)5 E(ault:)-.1 E F3(format)2.5 E F0 2.5(=2)2.5
-G(4.)-2.5 E F2<ad49>108 626.4 Q F3(\214le)26.41 E F0
-(Data \214le from which the input data will be read.)144 638.4 Q F2
-<ad53>108 655.2 Q F3(xscale)24.74 E F0
-(Sets the x-axis scale of the plot in inches/hour)144 667.2 Q 5(.D)-.55
-G(ef)-5 E(ault:)-.1 E F3(xscale)2.5 E F0 2.5(=1)2.5 G(.2.)-2.5 E F2
-<ad58>108 684 Q F3(xaxis)23.08 E F0
-(Sets the length of the x-axis in inches.)144 696 Q(MB-System 5.0)72 768
-Q 2.5(3J)146.495 G(une 2013)-2.5 E(1)204.835 E 0 Cg EP
-%%Page: 2 2
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 123.19(mbm_vrefcheck\(1\) MB-System)72 48 R
-123.19(5.0 mbm_vrefcheck\(1\))2.5 F/F1 10.95/Times-Bold at 0 SF(EXAMPLES)72
-84 Q F0 .033(Suppose one has obtained a Hydrosweep DS sw)108 96 R .034
-(ath sonar data \214le called hs_e)-.1 F .034
-(w9302_157_bcen.mb24 in the)-.25 F(L-DEO binary in-house format \(forma\
-t id 24\). In order to generate a v)108 108 Q
-(ertical reference noise plot:)-.15 E(mbm_vrefcheck \255F24 \255Ihs_e)
-144 120 Q(w9302_157_bcen.mb24)-.25 E F1(SEE ALSO)72 148.8 Q/F2 10
-/Times-Bold at 0 SF(mbsystem)108 160.8 Q F0(\(1\),)A F2(mblist)2.5 E F0
-(\(1\))A F1 -.11(BU)72 189.6 S(GS).11 E F0 .571
-(This script is hard wired for the R/V Ewing installation. This will ha)
-108 201.6 R .87 -.15(ve t)-.2 H 3.07(ob).15 G 3.07<658c>-3.07 G -.15(xe)
--3.07 G 3.07(df).15 G .57(or it to be useful else-)-3.07 F(where.)108
-213.6 Q(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(2)
-204.835 E 0 Cg EP
-%%Trailer
-end
-%%EOF
diff --git a/src/ps/mbm_xbt.ps b/src/ps/mbm_xbt.ps
deleted file mode 100644
index 824ab00..0000000
--- a/src/ps/mbm_xbt.ps
+++ /dev/null
@@ -1,298 +0,0 @@
-%!PS-Adobe-3.0
-%%Creator: groff version 1.19.2
-%%CreationDate: Wed Jul  1 12:29:29 2015
-%%DocumentNeededResources: font Times-Roman
-%%+ font Times-Bold
-%%+ font Times-Italic
-%%DocumentSuppliedResources: procset grops 1.19 2
-%%Pages: 2
-%%PageOrder: Ascend
-%%DocumentMedia: Default 612 792 0 () ()
-%%Orientation: Portrait
-%%EndComments
-%%BeginDefaults
-%%PageMedia: Default
-%%EndDefaults
-%%BeginProlog
-%%BeginResource: procset grops 1.19 2
-%!PS-Adobe-3.0 Resource-ProcSet
-/setpacking where{
-pop
-currentpacking
-true setpacking
-}if
-/grops 120 dict dup begin
-/SC 32 def
-/A/show load def
-/B{0 SC 3 -1 roll widthshow}bind def
-/C{0 exch ashow}bind def
-/D{0 exch 0 SC 5 2 roll awidthshow}bind def
-/E{0 rmoveto show}bind def
-/F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def
-/G{0 rmoveto 0 exch ashow}bind def
-/H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/I{0 exch rmoveto show}bind def
-/J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def
-/K{0 exch rmoveto 0 exch ashow}bind def
-/L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/M{rmoveto show}bind def
-/N{rmoveto 0 SC 3 -1 roll widthshow}bind def
-/O{rmoveto 0 exch ashow}bind def
-/P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/Q{moveto show}bind def
-/R{moveto 0 SC 3 -1 roll widthshow}bind def
-/S{moveto 0 exch ashow}bind def
-/T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/SF{
-findfont exch
-[exch dup 0 exch 0 exch neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/MF{
-findfont
-[5 2 roll
-0 3 1 roll
-neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/level0 0 def
-/RES 0 def
-/PL 0 def
-/LS 0 def
-/MANUAL{
-statusdict begin/manualfeed true store end
-}bind def
-/PLG{
-gsave newpath clippath pathbbox grestore
-exch pop add exch pop
-}bind def
-/BP{
-/level0 save def
-1 setlinecap
-1 setlinejoin
-72 RES div dup scale
-LS{
-90 rotate
-}{
-0 PL translate
-}ifelse
-1 -1 scale
-}bind def
-/EP{
-level0 restore
-showpage
-}def
-/DA{
-newpath arcn stroke
-}bind def
-/SN{
-transform
-.25 sub exch .25 sub exch
-round .25 add exch round .25 add exch
-itransform
-}bind def
-/DL{
-SN
-moveto
-SN
-lineto stroke
-}bind def
-/DC{
-newpath 0 360 arc closepath
-}bind def
-/TM matrix def
-/DE{
-TM currentmatrix pop
-translate scale newpath 0 0 .5 0 360 arc closepath
-TM setmatrix
-}bind def
-/RC/rcurveto load def
-/RL/rlineto load def
-/ST/stroke load def
-/MT/moveto load def
-/CL/closepath load def
-/Fr{
-setrgbcolor fill
-}bind def
-/setcmykcolor where{
-pop
-/Fk{
-setcmykcolor fill
-}bind def
-}if
-/Fg{
-setgray fill
-}bind def
-/FL/fill load def
-/LW/setlinewidth load def
-/Cr/setrgbcolor load def
-/setcmykcolor where{
-pop
-/Ck/setcmykcolor load def
-}if
-/Cg/setgray load def
-/RE{
-findfont
-dup maxlength 1 index/FontName known not{1 add}if dict begin
-{
-1 index/FID ne{def}{pop pop}ifelse
-}forall
-/Encoding exch def
-dup/FontName exch def
-currentdict end definefont pop
-}bind def
-/DEFS 0 def
-/EBEGIN{
-moveto
-DEFS begin
-}bind def
-/EEND/end load def
-/CNT 0 def
-/level1 0 def
-/PBEGIN{
-/level1 save def
-translate
-div 3 1 roll div exch scale
-neg exch neg exch translate
-0 setgray
-0 setlinecap
-1 setlinewidth
-0 setlinejoin
-10 setmiterlimit
-[]0 setdash
-/setstrokeadjust where{
-pop
-false setstrokeadjust
-}if
-/setoverprint where{
-pop
-false setoverprint
-}if
-newpath
-/CNT countdictstack def
-userdict begin
-/showpage{}def
-/setpagedevice{}def
-}bind def
-/PEND{
-countdictstack CNT sub{end}repeat
-level1 restore
-}bind def
-end def
-/setpacking where{
-pop
-setpacking
-}if
-%%EndResource
-%%EndProlog
-%%BeginSetup
-%%BeginFeature: *PageSize Default
-<< /PageSize [ 612 792 ] /ImagingBBox null >> setpagedevice
-%%EndFeature
-%%IncludeResource: font Times-Roman
-%%IncludeResource: font Times-Bold
-%%IncludeResource: font Times-Italic
-grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72
-def/PL 792 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron/Zcaron
-/scaron/zcaron/Ydieresis/trademark/quotesingle/Euro/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/space/exclam/quotedbl/numbersign/dollar/percent
-/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen
-/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon
-/semicolon/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O
-/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright/circumflex
-/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y
-/z/braceleft/bar/braceright/tilde/.notdef/quotesinglbase/guillemotleft
-/guillemotright/bullet/florin/fraction/perthousand/dagger/daggerdbl
-/endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut
-/dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash
-/quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen
-/brokenbar/section/dieresis/copyright/ordfeminine/guilsinglleft
-/logicalnot/minus/registered/macron/degree/plusminus/twosuperior
-/threesuperior/acute/mu/paragraph/periodcentered/cedilla/onesuperior
-/ordmasculine/guilsinglright/onequarter/onehalf/threequarters
-/questiondown/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE
-/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex
-/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis
-/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn
-/germandbls/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla
-/egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis
-/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide/oslash
-/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis]def
-/Times-Italic at 0 ENC0/Times-Italic RE/Times-Bold at 0 ENC0/Times-Bold RE
-/Times-Roman at 0 ENC0/Times-Roman RE
-%%EndSetup
-%%Page: 1 1
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 149.83(mbm_xbt\(1\) MB-System)72 48 R 149.83
-(5.0 mbm_xbt\(1\))2.5 F/F1 10.95/Times-Bold at 0 SF -.219(NA)72 84 S(ME)
-.219 E/F2 10/Times-Bold at 0 SF(mbm_xbt)108 96 Q F0 2.5<ad43>2.5 G
-(alculate sound speed from XBT data.)-2.5 E F1(VERSION)72 124.8 Q F0
--1.11(Ve)108 136.8 S(rsion 5.0)1.11 E F1(SYNOPSIS)72 165.6 Q F2
-(mbm_xbt \255I)108 177.6 Q/F3 10/Times-Italic at 0 SF(in\214le)A F2([\255F)
-2.5 E F3(format)A F2<ad4c>2.5 E F3(latitude)A F2<ad53>2.5 E F3(salinity)
-A F2(\255V \255H])2.5 E F1(DESCRIPTION)72 206.4 Q F2(mbm_xbt)108 218.4 Q
-F0 .12(is a perl shellscript to translate v)2.62 F .119
-(arious XBT data sets from depth and temperature into depth and)-.25 F
-.912(sound speed.)108 230.4 R .913(Header lines are)5.912 F .913
-(turned into comments be)5.913 F .913
-(ginning with '#' characters. The output \214lename)-.15 F .046
-(consists of the input \214lename with the suf)108 242.4 R .046
-(\214x ".sv".)-.25 F .046(The con)5.046 F -.15(ve)-.4 G .046
-(rsion is done using the DelGrosso equation as).15 F
-(referenced in Dusha et al. [1993] \(reference belo)108 254.4 Q(w\).)
--.25 E F1 -.548(AU)72 283.2 S(THORSHIP).548 E F0(Da)108 295.2 Q(vid W)
--.2 E 2.5(.C)-.92 G(aress \(caress at mbari.or)-2.5 E(g\))-.18 E(Montere)
-113 307.2 Q 2.5(yB)-.15 G(ay Aquarium Research Institute)-2.5 E
-(Dale N. Chayes \(dale at ldeo.columbia.edu\))108 319.2 Q
-(Lamont-Doherty Earth Observ)113 331.2 Q(atory)-.25 E
-(Suzanne H. O'Hara \(sohara at ldeo.columbia.edu\))108 343.2 Q
-(Lamont-Doherty Earth Observ)113 355.2 Q(atory)-.25 E F1(OPTIONS)72 384
-Q F2<ad46>108 396 Q F3(format)24.19 E F0(Allo)144 408 Q .099(ws the use\
-r to select the type of XBT data. Currently supported formats are: 1 = \
-Sparton XBT)-.25 F(,)-.74 E 2.5(2=S)144 420 S(ippican MK12 XBT)-2.5 E
-2.5(,3=S)-.74 G(ippican MK21.)-2.5 E(Def)5 E(ault:)-.1 E F3(format)2.5 E
-F0 2.5(=2)2.5 G(.)-2.5 E F2<ad48>108 436.8 Q F0 .162(This "help" \215ag\
- cause the program to print out a description of its operation and then\
- e)22.52 F .161(xit immedi-)-.15 F(ately)144 448.8 Q(.)-.65 E F2<ad49>
-108 465.6 Q F3(\214le)26.41 E F0
-(Data \214le from which the input data will be read.)144 477.6 Q F2
-<ad4c>108 494.4 Q F3(latitude)23.63 E F0(Latitude of the XBT cast.)144
-506.4 Q F2<ad53>108 523.2 Q F3(salinity)24.74 E F0 .002(Sets the salini\
-ty used to calculate sound speed from temperature and depth. The def)144
-535.2 R .002(ault v)-.1 F .002(alue of 35)-.25 F
-(ppt may be signi\214cantly in error in some areas.)144 547.2 Q(Def)5 E
-(ault:)-.1 E F3(salinity)2.5 E F0 2.5(=3)2.5 G(5.)-2.5 E F2<ad56>108 564
-Q F0(Causes)23.08 E F2(mbm_xbt)2.5 E F0(to operate in "v)2.5 E
-(erbose" mode so that it outputs more information than usual.)-.15 E F1
-(NO)72 592.8 Q(TES)-.438 E F0 .178
-(There is a hard limit in the code that pre)108 604.8 R -.15(ve)-.25 G
-.177(nts temperatures less than \2552.0 de).15 F .177
-(grees C from being used. Input)-.15 F
-(lines containing temperatures less than \2552.0 will be ignored.)108
-616.8 Q F1(SEE ALSO)72 645.6 Q F2(mbsystem)108 657.6 Q F0(\(1\),)A F2
-(mbpr)2.5 E(ocess)-.18 E F0(\(1\),)A F2(mbset)2.5 E F0(\(1\),)A F2(mb)
-2.5 E -.1(ve)-.15 G(locitytool).1 E F0(\(1\),)A F2(mble)2.5 E(vitus)-.15
-E F0(\(1\))A F1(REFERENCES)72 686.4 Q F0 .757(Dusha, B. D., P)108 698.4
-R 3.257(.F)-1.11 G 3.257(.W)-4.057 G(orcester)-4.057 E 3.257(,B)-.4 G
-3.257(.D)-3.257 G 3.257(.C)-3.257 G .757(ornuelle, B. M. Ho)-3.257 F
-.757(we, On equations for the speed of sound in sea-)-.25 F -.1(wa)108
-710.4 S(ter).1 E 2.5(,J)-.4 G 2.5(.A)-2.5 G
-(coust. Soc. Am., 93, 255-275, 1993.)-2.5 E(MB-System 5.0)72 768 Q 2.5
-(3J)146.495 G(une 2013)-2.5 E(1)204.835 E 0 Cg EP
-%%Page: 2 2
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 149.83(mbm_xbt\(1\) MB-System)72 48 R 149.83
-(5.0 mbm_xbt\(1\))2.5 F/F1 10.95/Times-Bold at 0 SF -.11(BU)72 84 S(GS).11
-E F0(Let us kno)108 96 Q -.65(w.)-.25 G(MB-System 5.0)72 768 Q 2.5(3J)
-146.495 G(une 2013)-2.5 E(2)204.835 E 0 Cg EP
-%%Trailer
-end
-%%EOF
diff --git a/src/ps/mbm_xyplot.ps b/src/ps/mbm_xyplot.ps
deleted file mode 100644
index fdc3b8e..0000000
--- a/src/ps/mbm_xyplot.ps
+++ /dev/null
@@ -1,1022 +0,0 @@
-%!PS-Adobe-3.0
-%%Creator: groff version 1.19.2
-%%CreationDate: Wed Jul  1 12:29:29 2015
-%%DocumentNeededResources: font Times-Roman
-%%+ font Times-Bold
-%%+ font Times-Italic
-%%DocumentSuppliedResources: procset grops 1.19 2
-%%Pages: 10
-%%PageOrder: Ascend
-%%DocumentMedia: Default 612 792 0 () ()
-%%Orientation: Portrait
-%%EndComments
-%%BeginDefaults
-%%PageMedia: Default
-%%EndDefaults
-%%BeginProlog
-%%BeginResource: procset grops 1.19 2
-%!PS-Adobe-3.0 Resource-ProcSet
-/setpacking where{
-pop
-currentpacking
-true setpacking
-}if
-/grops 120 dict dup begin
-/SC 32 def
-/A/show load def
-/B{0 SC 3 -1 roll widthshow}bind def
-/C{0 exch ashow}bind def
-/D{0 exch 0 SC 5 2 roll awidthshow}bind def
-/E{0 rmoveto show}bind def
-/F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def
-/G{0 rmoveto 0 exch ashow}bind def
-/H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/I{0 exch rmoveto show}bind def
-/J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def
-/K{0 exch rmoveto 0 exch ashow}bind def
-/L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/M{rmoveto show}bind def
-/N{rmoveto 0 SC 3 -1 roll widthshow}bind def
-/O{rmoveto 0 exch ashow}bind def
-/P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/Q{moveto show}bind def
-/R{moveto 0 SC 3 -1 roll widthshow}bind def
-/S{moveto 0 exch ashow}bind def
-/T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/SF{
-findfont exch
-[exch dup 0 exch 0 exch neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/MF{
-findfont
-[5 2 roll
-0 3 1 roll
-neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/level0 0 def
-/RES 0 def
-/PL 0 def
-/LS 0 def
-/MANUAL{
-statusdict begin/manualfeed true store end
-}bind def
-/PLG{
-gsave newpath clippath pathbbox grestore
-exch pop add exch pop
-}bind def
-/BP{
-/level0 save def
-1 setlinecap
-1 setlinejoin
-72 RES div dup scale
-LS{
-90 rotate
-}{
-0 PL translate
-}ifelse
-1 -1 scale
-}bind def
-/EP{
-level0 restore
-showpage
-}def
-/DA{
-newpath arcn stroke
-}bind def
-/SN{
-transform
-.25 sub exch .25 sub exch
-round .25 add exch round .25 add exch
-itransform
-}bind def
-/DL{
-SN
-moveto
-SN
-lineto stroke
-}bind def
-/DC{
-newpath 0 360 arc closepath
-}bind def
-/TM matrix def
-/DE{
-TM currentmatrix pop
-translate scale newpath 0 0 .5 0 360 arc closepath
-TM setmatrix
-}bind def
-/RC/rcurveto load def
-/RL/rlineto load def
-/ST/stroke load def
-/MT/moveto load def
-/CL/closepath load def
-/Fr{
-setrgbcolor fill
-}bind def
-/setcmykcolor where{
-pop
-/Fk{
-setcmykcolor fill
-}bind def
-}if
-/Fg{
-setgray fill
-}bind def
-/FL/fill load def
-/LW/setlinewidth load def
-/Cr/setrgbcolor load def
-/setcmykcolor where{
-pop
-/Ck/setcmykcolor load def
-}if
-/Cg/setgray load def
-/RE{
-findfont
-dup maxlength 1 index/FontName known not{1 add}if dict begin
-{
-1 index/FID ne{def}{pop pop}ifelse
-}forall
-/Encoding exch def
-dup/FontName exch def
-currentdict end definefont pop
-}bind def
-/DEFS 0 def
-/EBEGIN{
-moveto
-DEFS begin
-}bind def
-/EEND/end load def
-/CNT 0 def
-/level1 0 def
-/PBEGIN{
-/level1 save def
-translate
-div 3 1 roll div exch scale
-neg exch neg exch translate
-0 setgray
-0 setlinecap
-1 setlinewidth
-0 setlinejoin
-10 setmiterlimit
-[]0 setdash
-/setstrokeadjust where{
-pop
-false setstrokeadjust
-}if
-/setoverprint where{
-pop
-false setoverprint
-}if
-newpath
-/CNT countdictstack def
-userdict begin
-/showpage{}def
-/setpagedevice{}def
-}bind def
-/PEND{
-countdictstack CNT sub{end}repeat
-level1 restore
-}bind def
-end def
-/setpacking where{
-pop
-setpacking
-}if
-%%EndResource
-%%EndProlog
-%%BeginSetup
-%%BeginFeature: *PageSize Default
-<< /PageSize [ 612 792 ] /ImagingBBox null >> setpagedevice
-%%EndFeature
-%%IncludeResource: font Times-Roman
-%%IncludeResource: font Times-Bold
-%%IncludeResource: font Times-Italic
-grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72
-def/PL 792 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron/Zcaron
-/scaron/zcaron/Ydieresis/trademark/quotesingle/Euro/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/space/exclam/quotedbl/numbersign/dollar/percent
-/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen
-/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon
-/semicolon/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O
-/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright/circumflex
-/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y
-/z/braceleft/bar/braceright/tilde/.notdef/quotesinglbase/guillemotleft
-/guillemotright/bullet/florin/fraction/perthousand/dagger/daggerdbl
-/endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut
-/dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash
-/quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen
-/brokenbar/section/dieresis/copyright/ordfeminine/guilsinglleft
-/logicalnot/minus/registered/macron/degree/plusminus/twosuperior
-/threesuperior/acute/mu/paragraph/periodcentered/cedilla/onesuperior
-/ordmasculine/guilsinglright/onequarter/onehalf/threequarters
-/questiondown/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE
-/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex
-/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis
-/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn
-/germandbls/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla
-/egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis
-/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide/oslash
-/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis]def
-/Times-Italic at 0 ENC0/Times-Italic RE/Times-Bold at 0 ENC0/Times-Bold RE
-/Times-Roman at 0 ENC0/Times-Roman RE
-%%EndSetup
-%%Page: 1 1
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 137.05(mbm_xyplot\(1\) MB-System)72 48 R 137.05
-(5.0 mbm_xyplot\(1\))2.5 F/F1 10.95/Times-Bold at 0 SF -.219(NA)72 84 S(ME)
-.219 E/F2 10/Times-Bold at 0 SF(mbm_xyplot)108 96 Q F0 2.5<ad43>2.5 G
-(reate an e)-2.5 E -.15(xe)-.15 G
-(cutable shellscript which will generate a GMT plot of xy data.).15 E F1
-(VERSION)72 124.8 Q F0 -1.11(Ve)108 136.8 S(rsion 5.0)1.11 E F1
-(SYNOPSIS)72 165.6 Q F2 .142(mbm_xyplot \255I)108 177.6 R/F3 10
-/Times-Italic at 0 SF([\214lepar)A(s:]\214le)-.1 E F0([)2.642 E F2<ad49>A
-F3([\214lepar)A(s:]\214le)-.1 E F2<ad47>2.641 E F3(\214ll)A F2 .141
-<ad4820ad4f>2.641 F F3 -.45(ro)C(ot).45 E F2<ad50>2.641 E F3(pa)A -.1
-(ge)-.1 G(size).1 E F2<ad53>2.641 E F3(symbol/size)A F2<ad55>2.641 E F3
-(orientation)A F2<ad5620ad57>108 189.6 Q F3(pen)A F0(])2.5 E
-(Additional Options:)108 213.6 Q([)108 225.6 Q F2<ad42>A F3(tic)A(kinfo)
--.2 E F2<ad4a>2.5 E F3(pr)A(ojection[/scale | width])-.45 E F2<ad4c>2.5
-E F3(title[:xlabel:ylabel])A F2<ad4d>2.5 E F3(misc)A F2<ad5120ad52>2.5 E
-F3(w/e/s/n)A F2<ad5820ad5a>2.5 E F3(])A(Miscellaneous Options:)108 249.6
-Q([)108 261.6 Q F2(\255MGD)A F3(gmtdef/value)A F2(\255MGL)5.825 E F3
-([f][x]lon0/lat0/slat/length[units][+llabel])A F2(\255MGT)5.825 E F3
-(x/y/size/angle/font/just/te)A(xt)-.2 E F2(\255MGU[)108 273.6 Q F3
-(/dx/dy/)A F2(][)A F3(label)A F2 2.5(]])C F1(DESCRIPTION)72 302.4 Q F2
-(mbm_xyplot)108 314.4 Q F0 .045
-(is a macro to generate a shellscript of GMT commands which, when e)
-2.545 F -.15(xe)-.15 G .045(cuted, will generate a).15 F .361
-(Postscript plot of xy data.)108 326.4 R(Ax)5.361 E .362
-(es may be linear)-.15 F 2.862(,l)-.4 G 2.862(og, or)-2.862 F(an)2.862 E
-2.862(yo)-.15 G 2.862(fs)-2.862 G -2.15 -.25(ev e)-2.862 H .362
-(ral geographic projections. Data may be).25 F .629
-(plotted as symbols or lines.)108 338.4 R .629
-(The plot will be scaled to \214t on the speci\214ed page size or)5.629
-F 3.128(,i)-.4 G 3.128(ft)-3.128 G .628(he scale is user)-3.128 F .183(\
-de\214ned, the page size will be chosen in accordance with the plot siz\
-e. The primary purpose of this macro is)108 350.4 R(to allo)108 362.4 Q
-2.5(wt)-.25 G
-(he simple, semi-automated production of nice looking plots with a fe)
--2.5 E 2.5(wc)-.25 G(ommand line ar)-2.5 E(guments.)-.18 E .023(By def)
-108 386.4 R(ault)-.1 E F2(mbm_xyplot)2.523 E F0 -.15(ex)2.523 G .023
-(pects the input data \214les to ha).15 F .322 -.15(ve v)-.2 H .022
-(alues or)-.1 F -.05(ga)-.18 G .022(nized in columns separated by white)
-.05 F .284(space. Ho)108 398.4 R(we)-.25 E -.15(ve)-.25 G 1.084 -.4
-(r, u).15 H .284(sers may optionally specify a non-white-space delimite\
-r for each \214le. Input data \214les can).4 F(ha)108 410.4 Q .378 -.15
-(ve a)-.2 H 2.578(na).15 G .077(rbitrary number of columns. When tw)
--2.578 F 2.577(oo)-.1 G 2.577(rm)-2.577 G .077(ore columns e)-2.577 F
-.077(xist the one may specify which tw)-.15 F 2.577(oc)-.1 G(ol-)-2.577
-E .126(umns to plot \(the \214rst vs second is the def)108 422.4 R .127
-(ault\). In addition, users may optionally specify a single column to)
--.1 F(be plotted v)108 434.4 Q(ersus data-point-number)-.15 E(.)-.55 E
-1.782(The standard syntax with which one selects columns to plot may al\
-so be embedded into a lar)108 458.4 R 1.781(ger Perl)-.18 F -.15(ex)108
-470.4 S .241(pression, which will be e).15 F -.25(va)-.25 G .242
-(luated for each line of the data \214le. In this w).25 F(ay)-.1 E 2.742
-(,o)-.65 G .242(ne may do on-the-\215y mathe-)-2.742 F .909
-(matics or substring e)108 482.4 R .909(xtractions as required.)-.15 F
-.909(Indeed, one may specify most an)5.909 F 3.408(yP)-.15 G .908(erl e)
--3.408 F .908(xpression that when)-.15 F -.25(eva)108 494.4 S .426
-(luated, will be a numeric result for plotting. F).25 F .426(or e)-.15 F
-.426(xample, one can multiply the v)-.15 F .427(alues in a column by a)
--.25 F .109(constant, add the v)108 506.4 R .108(alues of tw)-.25 F
-2.608(oc)-.1 G .108(olumns together or e)-2.608 F -.15(ve)-.25 G 2.608
-(ne).15 G .108(xtract latitude and longitude de)-2.758 F .108
-(grees and minutes)-.15 F .204(in a \214le of NMEA strings and con)108
-518.4 R -.15(ve)-.4 G .204(rt the results to decimal de).15 F .205
-(grees for plotting. The macro uses the speci-)-.15 F .352
-(\214ed delimter to e)108 530.4 R .352(xtract the v)-.15 F .352
-(alues from each column, e)-.25 F -.25(va)-.25 G .352(luate the e).25 F
-.352(xpressions, and then lea)-.15 F -.15(ve)-.2 G 2.851(st).15 G .351
-(he result in)-2.851 F .116(temporary data in \214les to be read by the\
- plotting shellscript. The temporary \214les are deleted on e)108 542.4
-R -.15(xe)-.15 G .117(cution of).15 F(the shell script by def)108 554.4
-Q(ault, b)-.1 E(ut can optionally be retained for deb)-.2 E
-(ugging purposes.)-.2 E -.15(Fo)108 578.4 S 3.718(ru).15 G 1.218
-(sers seeking more control o)-3.718 F -.15(ve)-.15 G 3.718(rt).15 G
-1.218(he plot appearance, a number of additional optional ar)-3.718 F
-1.218(guments are)-.18 F(pro)108 590.4 Q .024(vided. T)-.15 F .024
-(ruly ambitious users may edit the plot shellscript to tak)-.35 F 2.525
-(ea)-.1 G(dv)-2.525 E .025(antage of GMT capabilities not sup-)-.25 F
-(ported by this macro.)108 602.4 Q .084(By def)108 626.4 R .083
-(ault the output plot generation shellscript includes lines which e)-.1
-F -.15(xe)-.15 G .083(cute a program to display the Post-).15 F .807(sc\
-ript image on the screen. The program to be used to display the Postscr\
-ipt is set using)108 638.4 R F2(mbdefaults)3.308 E F0 3.308(;t)C(he)
--3.308 E(def)108 650.4 Q .326(ault v)-.1 F .326(alue can be o)-.25 F
--.15(ve)-.15 G .325(rridden by setting the en).15 F .325(vironment v)-.4
-F .325(ariable $MB_PS_VIEWER.)-.25 F(In)5.325 E -.2(vo)-.4 G .325
-(king the plot).2 F(generation shellscript with a)108 662.4 Q F2(-N)2.5
-E F0(command line ar)2.5 E
-(gument suppresses the screen display of the plot.)-.18 E .305
-(The plot scripts generated by this macro will w)108 686.4 R .305
-(ork with GMT v)-.1 F .305(ersion 5.0 and later)-.15 F 2.805(,a)-.4 G
-.305(nd are not compatible)-2.805 F(with earlier v)108 698.4 Q
-(ersions of GMT)-.15 E(.)-.74 E(MB-System 5.0)72 768 Q 2.5(9J)140.11 G
-(anuary 2015)-2.5 E(1)198.45 E 0 Cg EP
-%%Page: 2 2
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 137.05(mbm_xyplot\(1\) MB-System)72 48 R 137.05
-(5.0 mbm_xyplot\(1\))2.5 F/F1 10.95/Times-Bold at 0 SF -.548(AU)72 84 S
-(THORSHIP).548 E F0(Da)108 96 Q(vid W)-.2 E 2.5(.C)-.92 G
-(aress \(caress at mbari.or)-2.5 E(g\))-.18 E(Montere)113 108 Q 2.5(yB)-.15
-G(ay Aquarium Research Institute)-2.5 E
-(Dale N. Chayes \(dale at ldeo.columbia.edu\))108 120 Q
-(Lamont-Doherty Earth Observ)113 132 Q(atory)-.25 E
-(Suzanne H. O'Hara \(sohara at ldeo.columbia.edu\))108 144 Q
-(Lamont-Doherty Earth Observ)113 156 Q(atory)-.25 E F1
-(SIMPLE DESCRIPTION OF B)72 184.8 Q(ASIC OPTIONS)-.329 E/F2 10
-/Times-Bold at 0 SF<ad47>108 196.8 Q/F3 10/Times-Italic at 0 SF(\214ll)22.52 E
-F0 .393(Select \214lling of symbols for xy plotting.)144 208.8 R .393
-(Set the shade \(0-255\) or color \(r/g/b\) [Def)5.393 F .393
-(ault is no \214ll].)-.1 F 2.548 -.8(To r)144 220.8 T .948
-(eset no \214ll, use).8 F F3(\214ll)3.448 E F0 3.449(=")3.448 G 3.449
-(N". F)-3.449 F .949(or polygons, you may optionally specify)-.15 F F2
-(\255Gp)3.449 E F3(icon_size/pattern)A F0(,)A(where)144 232.8 Q F3
-(pattern)3.652 E F0(gi)3.652 E -.15(ve)-.25 G 3.652(st).15 G 1.151(he n\
-umber of the image pattern \(1-32\) OR the name of a icon-format \214le\
-.)-3.652 F F3(icon_size)144 244.8 Q F0 1.128
-(sets the unit size in inch.)3.628 F 2.728 -.8(To i)6.128 H -1.85 -.4
-(nv e).8 H 1.128(rt black and white pix).4 F 1.128(els, use)-.15 F F2
-(\255GP)3.629 E F0 1.129(instead of)3.629 F F2(\255Gp)3.629 E F0(.)A
-(See)144 256.8 Q F2(GMTs)2.5 E F0(Cookbook & T)2.5 E
-(echnical Reference Appendix E for information on indi)-.7 E
-(vidual patterns.)-.25 E F2<ad48>108 273.6 Q F0 .162(This "help" \215ag\
- cause the program to print out a description of its operation and then\
- e)22.52 F .161(xit immedi-)-.15 F(ately)144 285.6 Q(.)-.65 E F2<ad49>
-108 302.4 Q F3([\214lepar)26.41 E(s:]xy_\214le)-.1 E F0 .866(Speci\214e\
-s a \214le containing \(x,y\) pairs to be plotted as lines or symbols. \
-Optional parameters pre-)144 314.4 R .598
-(ceed the \214le name and consist of a list of \215ag-ar)144 326.4 R
-.598(gument pairs, strung together with colons. These)-.18 F(ar)144
-338.4 Q .402(guments may include the column delimiter)-.18 F 2.902(,w)
--.4 G .403(hich columns to plot, line and symbol characteris-)-2.902 F
-.057(tics and a \215ag to specify when multiple data se)144 350.4 R .056
-(gments are embedded in a single \214le. The looks lik)-.15 F(e)-.1 E
-(the follo)144 362.4 Q(wing.:)-.25 E F2(\255ID)146.5 386.4 Q F3
-(delimiter)A F0(:)A F2(C)A F3(columnse)A(xpr)-.2 E(ession)-.37 E F0(:)A
-F2(G)A F3(color)A F0(:)A F2(S)A F3(symbol)A F0(:)A F2(W)A F3(weight)A F0
-(:)A F2(M)A F0(:)A F2(xy\214le)A F0(Def)144 410.4 Q 1.111(ault paramete\
-rs are whitespace [ D\(\\s+\) ], column 1 vs column 2 [ Cc[1]_c[2] ], b\
-lack lines)-.1 F
-(without symbols [ SN ], [ GN ], [ W1 ], and no multiple se)144 422.4 Q
-(gments \(omitted M \215ag\).)-.15 E
-(Please see the "Complete Description of Options" belo)144 446.4 Q 2.5
-(wf)-.25 G(or details.)-2.5 E F2<ad4f>108 463.2 Q F3 -.45(ro)22.52 G(ot)
-.45 E F0 .423(Sets the root used to construct the \214lename of the out\
-put shellscript \()144 475.2 R F3 -.45(ro)C(ot).45 E F0 .422
-(.cmd\) and names of \214les)B .156
-(created when the shellscript is run.)144 487.2 R .157
-(Normally the name of the input grid \214le or grid \214le list is used)
-5.157 F(as the)144 499.2 Q F3 -.45(ro)2.5 G(ot).45 E F0(.)A F2<ad50>108
-516 Q F3(pa)24.19 E -.1(ge)-.1 G(size).1 E F0 .632(This option sets the\
- size of the page the plot will be centered on. If the user does not se\
-t the plot)144 528 R .125(scale, the plot will be sized as lar)144 540 R
-.125(ge as will \214t on the designated page. If the user sets the plot\
- scale)-.18 F .948
-(such that the plot will not \214t on the designated page, a lar)144 552
-R .948(ger page will be used.)-.18 F .947(The supported)5.947 F 1.342
-(page sizes include ANSI A, B, C, D, E, F)144 564 R 3.842(,a)-.8 G 1.343
-(nd E1, as well as most metric page sizes. See the)-3.842 F 1.31
-(COMPLETE DESCRIPTION OF OPTIONS section belo)144 576 R 3.81(wf)-.25 G
-1.31(or a complete list of the supported)-3.81 F(page sizes. The def)144
-588 Q(ault page size is A.)-.1 E F2<ad53>108 604.8 Q F3(symbol/size)
-24.74 E F0 .332(Selects symbol to be used for plotting the ne)144 616.8
-R .332(xt xy data \214le. Setting)-.15 F F3(symbol)2.832 E F0 2.833(=")
-2.832 G .333(N" causes line plot-)-2.833 F 3.775(ting. The)144 628.8 R
-1.275(list of a)3.775 F -.25(va)-.2 G 1.275(ilable symbols is gi).25 F
--.15(ve)-.25 G 3.775(ni).15 G 3.774(nt)-3.775 G 1.274
-(he COMPLETE DESCRIPTION OF OPTIONS)-3.774 F(section belo)144 640.8 Q
--.65(w.)-.25 G F2<ad55>108 657.6 Q F3(orientation)23.08 E F0 .2(Normall\
-y the orientation of the plot \(portrait or landscape\) is selected aut\
-omatically so as to maxi-)144 669.6 R .334(mize the plot scale.)144
-681.6 R(The)5.333 E F2<ad55>2.833 E F0 .333(option allo)2.833 F .333
-(ws the user to set the plot orientation. If)-.25 F F3(orientation)2.833
-E F0 2.833(=1)2.833 G 2.833(,a)-2.833 G
-(portrait plot will be produced; if)144 693.6 Q F3(orientation)2.5 E F0
-2.5(=2)2.5 G 2.5(,al)-2.5 G(andscape plot will be produced.)-2.5 E F2
-<ad56>108 710.4 Q F0(Causes)23.08 E F2(mbm_grdplot)4.505 E F0 2.005
-(to operate in "v)4.505 F 2.006
-(erbose" mode so that it outputs more information than)-.15 F(usual.)144
-722.4 Q(MB-System 5.0)72 768 Q 2.5(9J)140.11 G(anuary 2015)-2.5 E(2)
-198.45 E 0 Cg EP
-%%Page: 3 3
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 137.05(mbm_xyplot\(1\) MB-System)72 48 R 137.05
-(5.0 mbm_xyplot\(1\))2.5 F/F1 10/Times-Bold at 0 SF<ad57>108 84 Q/F2 10
-/Times-Italic at 0 SF(pen)20.3 E F0 .784(Set pen attrib)144 96 R .784
-(utes for xy plotting. See chapter 4.12 in the GMT T)-.2 F .783
-(echnical reference for a discus-)-.7 F(sion of GMT pen v)144 108 Q 2.5
-(alues. [Def)-.25 F(aults: width = 1, color = 0/0/0, te)-.1 E
-(xture = solid].)-.15 E/F3 10.95/Times-Bold at 0 SF
-(COMPLETE DESCRIPTION OF OPTIONS)72 136.8 Q F1<ad42>108 148.8 Q F2(tic)
-23.63 E(kinfo)-.2 E F0 .218(Sets map boundary tickmark interv)144 160.8
-R .218(als. See the)-.25 F F1(psbasemap)2.719 E F0 .219
-(manual page for details. By def)2.719 F .219(ault the)-.1 F
-(program chooses basemap annotations based on the map boundaries.)144
-172.8 Q F1<ad47>108 189.6 Q F2(\214ll)22.52 E F0 .393
-(Select \214lling of symbols for xy plotting.)144 201.6 R .393
-(Set the shade \(0-255\) or color \(r/g/b\) [Def)5.393 F .393
-(ault is no \214ll].)-.1 F 2.548 -.8(To r)144 213.6 T .948
-(eset no \214ll, use).8 F F2(\214ll)3.448 E F0 3.449(=")3.448 G 3.449
-(N". F)-3.449 F .949(or polygons, you may optionally specify)-.15 F F1
-(\255Gp)3.449 E F2(icon_size/pattern)A F0(,)A(where)144 225.6 Q F2
-(pattern)3.652 E F0(gi)3.652 E -.15(ve)-.25 G 3.652(st).15 G 1.151(he n\
-umber of the image pattern \(1-32\) OR the name of a icon-format \214le\
-.)-3.652 F F2(icon_size)144 237.6 Q F0 1.128
-(sets the unit size in inch.)3.628 F 2.728 -.8(To i)6.128 H -1.85 -.4
-(nv e).8 H 1.128(rt black and white pix).4 F 1.128(els, use)-.15 F F1
-(\255GP)3.629 E F0 1.129(instead of)3.629 F F1(\255Gp)3.629 E F0(.)A
-(See)144 249.6 Q F1(GMTs)2.5 E F0(Cookbook & T)2.5 E
-(echnical Reference Appendix E for information on indi)-.7 E
-(vidual patterns.)-.25 E F1<ad48>108 266.4 Q F0 .162(This "help" \215ag\
- cause the program to print out a description of its operation and then\
- e)22.52 F .161(xit immedi-)-.15 F(ately)144 278.4 Q(.)-.65 E F1<ad49>
-108 295.2 Q F2([\214lepar)26.41 E(s:]xy_\214le)-.1 E F0 .089(Speci\214e\
-s the \214les containing the data to be plotted, and for each \214le, a\
- list of \214le parameters which)144 319.2 R .166
-(are comprised of the rules used by)144 331.2 R F1(mbm_xyplot)2.666 E F0
-.165(to parse and manipulate the x and y v)2.666 F .165(alues on the)
--.25 F<8d79>144 343.2 Q 2.5(,a)-.65 G 2.5(sw)-2.5 G
-(ell as the line and symbol characters used for plotting the results.)
--2.5 E 2.192
-(The \214le parameters are an optional list of \215ags and their ar)144
-367.2 R 2.193(guments concatinated and strung)-.18 F 1.679
-(together with colons. A full speci\214cation has the follo)144 379.2 R
-1.678(wing general syntax although indi)-.25 F(vidual)-.25 E .336
-(\215ags and their ar)144 391.2 R .336(guments need not appear in an)
--.18 F 2.836(yp)-.15 G .336(articular order as long as ar)-2.836 F .337
-(gument follo)-.18 F .337(ws cor)-.25 F(-)-.2 E(responding \215ag.:)144
-403.2 Q F1(\255ID)146.5 439.2 Q F2(delimiter)A F0(:)A F1(C)A F2
-(columnse)A(xpr)-.2 E(ession)-.37 E F0(:)A F1(G)A F2(color)A F0(:)A F1
-(S)A F2(symbol)A F0(:)A F1(W)A F2(weight)A F0(:)A F1(M)A F0(:)A F1
-(xy\214le)A F0(The delimiter may be an)144 463.2 Q 2.5(yc)-.15 G
-(haracter string. The def)-2.5 E(ault delimiter is whitespace.)-.1 E
-.107(By def)144 487.2 R(ault,)-.1 E F1(mbm_xyplot)2.607 E F0 .107
-(uses the \214rst column as the x v)2.607 F .106
-(alue and the second column as the y v)-.25 F(alue)-.25 E .261
-(for the plot. Ho)144 499.2 R(we)-.25 E -.15(ve)-.25 G 1.061 -.4(r, t)
-.15 H(he).4 E F1(C)2.762 E F0 .262(\215ag and column e)2.762 F .262
-(xpression allo)-.15 F .262(ws the user to chose other columns to)-.25 F
-(plot. The general syntax is)144 511.2 Q F1(C)144 535.2 Q F2
-(c[xcol]_c[ycol])2.5 E F0 .529
-(where 'xcol' and 'ycol' designate the x and y columns respecti)144
-559.2 R -.15(ve)-.25 G(ly).15 E 3.029(.C)-.65 G .529
-(olumns are numbered start-)-3.029 F .777(ing at '1' one the left most \
-column in the \214le. In addition, either c[] e)144 571.2 R .778
-(xpression may be replaced)-.15 F
-(with a single '#' symbol to plot the other v)144 583.2 Q
-(ariable vs. line number)-.25 E 2.5(.F)-.55 G(or e)-2.65 E(xample,)-.15
-E F1(C)144 607.2 Q F2(#_c[ycol])2.5 E F0(will plot the v)144 631.2 Q
-(alues in column 'ycol' vs their line number in the \214le.)-.25 E .057
-(Other v)144 655.2 R .057(alid Perl e)-.25 F .056
-(xpressions may be substituted for either column e)-.15 F .056
-(xpression as well. F)-.15 F .056(or e)-.15 F(xample,)-.15 E .214(to pl\
-ot in kilometers, a \214le whose columns contain x and y coordinates in\
- meters, one w)144 667.2 R .215(ould spec-)-.1 F(ify)144 679.2 Q F1(C)
-144 703.2 Q F2(c[0]/1000_c[1]/1000)2.5 E F0 1.733
-(The line and symbol characteristics are set using the)144 727.2 R F1(G)
-4.233 E F0(,)A F1(S)4.233 E F0 4.233(,a)C(nd)-4.233 E F1(W)4.233 E F0
-4.233(options. F)4.233 F 1.733(or e)-.15 F 1.733(xample, the)-.15 F
-(MB-System 5.0)72 768 Q 2.5(9J)140.11 G(anuary 2015)-2.5 E(3)198.45 E 0
-Cg EP
-%%Page: 4 4
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 137.05(mbm_xyplot\(1\) MB-System)72 48 R 137.05
-(5.0 mbm_xyplot\(1\))2.5 F(command)144 84 Q/F1 10/Times-Bold at 0 SF
-(\255IG)4.215 E/F2 10/Times-Italic at 0 SF(255/0/0:)A F1(S)A F2(a/0.1:xy)A
-(.dat)-.55 E F0 1.716(will plot the \(x,y\) data pairs in the \214le xy)
-4.215 F 1.716(.dat as 0.1 inch)-.65 F(diameter red stars.)144 96 Q([Def)
-5 E
-(ault is a solid black line]. See the psxy man page for more details.)
--.1 E .662(When multiple data \214les are speci\214ed \(with multiple)
-144 120 R F1<ad49>3.162 E F0 .662(statements, the last)3.162 F F1(G)
-3.162 E F0(,)A F1(S)3.162 E F0 3.162(,a)C(nd)-3.162 E F1(W)3.161 E F0
-(options)3.161 E .024
-(speci\214ed are for subsequent \214les. In order to plot dif)144 132 R
-.024(ferent \214les using dif)-.25 F .024(ferent line or symbol char)
--.25 F(-)-.2 E(acteristics, ne)144 144 Q 2.5(ws)-.25 G
-(ets of commands can be speci\214ed for each \214le.)-2.5 E(Finally)144
-168 Q 3.377(,n)-.65 G .876(ote that there are tw)-3.377 F 3.376(ow)-.1 G
-.876(ays in which one may plot multiple data sets on the same plot.)
--3.476 F .82(One may specify multiple sets of \214le ar)144 180 R .821
-(guments [i.e.)-.18 F F1<ad49>3.321 E F2([\214lepar)A(s:]xy_\214le)-.1 E
-F0 .821(], one for each \214le to be)B .993(plotted. This allo)144 192 R
-.993(ws the most \215e)-.25 F(xibility)-.15 E 3.493(,i)-.65 G .993
-(ncluding dif)-3.493 F .992
-(ferent one-the-\215y manipulations and colors)-.25 F
-(for each xy series.)144 204 Q .658(An alternati)144 228 R .958 -.15
-(ve i)-.25 H 3.158(st).15 G 3.159(ou)-3.158 G .659
-(tilize the "multiple se)-3.159 F .659(gments" feature of)-.15 F F1
-(psxy)3.159 E F0 3.159(.S)C .659(pecify the)-3.159 F F1(M)3.159 E F0
-.659(\215ag in the \214le)3.159 F(ar)144 240 Q .293(gument list to in)
--.18 F -.2(vo)-.4 G .493 -.1(ke t).2 H .293(his feature. A single \214l\
-e may then contain all the data, one series after the).1 F(ne)144 252 Q
-1.225(xt, with lines containing a single ">" and nothing more to deline\
-ate breaks in data se)-.15 F(gments.)-.15 E .939(This is the def)144 264
-R .939(ault break character for psxy)-.1 F 3.439(,a)-.65 G .938
-(nd currently the only break character supported by)-3.439 F 1.607
-(mbm_xyplot. F)144 276 R 1.607(or e)-.15 F(xample)-.15 E F1(\255IM)4.107
-E F0(:xy)A 1.607(.dat w)-.65 F 1.608
-(ould plot multiple data series in the \214le xy)-.1 F 1.608(.dat whose)
--.65 F(se)144 288 Q(gements were separated as in the follo)-.15 E
-(wing snippet:)-.25 E 5(1.2 3)144 312 R 5(1.3 5)144 324 R(>)144 336 Q
-12.5(0.)144 348 S(1)-12.5 E 5(0.1 .4)144 360 R F1<ad4a>108 388.8 Q F2
-(pr)25.3 E(ojection)-.45 E F0([)A F2(/scale | /width)A F0(])A .368
-(Selects the map projection. By def)144 400.8 R .367
-(ault the map projection is Mercator and the plot scale is chosen)-.1 F
-.667(to \214t on the selected page size \(see)144 412.8 R F1<ad50>3.168
-E F0 .668(option\). The user may specify a dif)3.168 F .668
-(ferent projection to be)-.25 F .768(used, in which case the plot scale\
- is still automatically chosen to \214t the page. The user may also)144
-424.8 R .034(specify both the projection and the plot scale. If the pro\
-jection specifying character is upper case, a)144 436.8 R 1.509
-(plot width rather than a plot scale is used.)144 448.8 R 1.508
-(The scale v)6.508 F 1.508(alues are speci\214ed in inch/de)-.25 F 1.508
-(gree or in)-.15 F .829(1:xxxxx ratios. Plot widths are speci\214ed in \
-inches. If the user speci\214es a plot scale such that the)144 460.8 R
-(plot will not \214t on the def)144 472.8 Q
-(ault A size page, a appropriately lar)-.1 E
-(ger page size will be chosen.)-.18 E F1(CYLINDRICAL PR)144 496.8 Q
-(OJECTIONS:)-.3 E(\255Jc)144 520.8 Q F2(lon0/lat0/scale)A F0
-(\(Cassini\))2.5 E F1(\255Jm)144 532.8 Q F2(scale)A F0(\(Mercator\))2.5
-E F1<ad4a>144 544.8 Q(oa)-.15 E F2(lon0/lat0/azimuth/scale)A F0
-(\(Oblique Mercator \255 point and azimuth\))2.5 E F1<ad4a>144 556.8 Q
-(ob)-.15 E F2(lon0/lat0/lon1/lat1/scale)A F0(\(Oblique Mercator \255 tw)
-2.5 E 2.5(op)-.1 G(oints\))-2.5 E F1<ad4a>144 568.8 Q(oc)-.15 E F2
-(lon0/lat0/lonp/latp/scale)A F0
-(\(Oblique Mercator \255 point and pole\))2.5 E F1(\255Jq)144 580.8 Q F2
-(lon0/scale)A F0
-(\(Equidistant Cylindrical Projection \(Plate Carree\)\))2.5 E F1
-(\255Jt)144 592.8 Q F2(lon0/scale)A F0(\(TM \255 T)2.5 E(ransv)-.35 E
-(erse Mercator\))-.15 E F1<ad4a>144 604.8 Q(u)-.15 E F2(zone/scale)A F0
-(\(UTM \255 Uni)2.5 E -.15(ve)-.25 G(rsal T).15 E(ransv)-.35 E
-(erse Mercator\))-.15 E F1(\255Jy)144 616.8 Q F2(lon0/lats/scale)A F0
-(\(Basic Cylindrical Projection\))2.5 E F1(AZIMUTHAL PR)144 640.8 Q
-(OJECTIONS:)-.3 E<ad4a>144 664.8 Q(a)-.15 E F2(lon0/lat0/scale)A F0
-(\(Lambert\).)2.5 E F1<ad4a>144 676.8 Q(e)-.15 E F2(lon0/lat0/scale)A F0
-(\(Equidistant\).)2.5 E F1(\255Jg)144 688.8 Q F2(lon0/lat0/scale)A F0
-(\(Orthographic\).)2.5 E F1(\255Js)144 700.8 Q F2(lon0/lat0/scale)A F0
-(\(General Stereographic\))2.5 E F1(CONIC PR)144 724.8 Q(OJECTIONS:)-.3
-E F0(MB-System 5.0)72 768 Q 2.5(9J)140.11 G(anuary 2015)-2.5 E(4)198.45
-E 0 Cg EP
-%%Page: 5 5
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 137.05(mbm_xyplot\(1\) MB-System)72 48 R 137.05
-(5.0 mbm_xyplot\(1\))2.5 F/F1 10/Times-Bold at 0 SF(\255Jb)144 84 Q/F2 10
-/Times-Italic at 0 SF(lon0/lat0/lat1/lat2/scale)A F0(\(Albers\))2.5 E F1
-(\255Jl)144 96 Q F2(lon0/lat0/lat1/lat2/scale)A F0(\(Lambert\))2.5 E F1
-(MISCELLANEOUS PR)144 120 Q(OJECTIONS:)-.3 E(\255Jh)144 144 Q F2
-(lon0/scale)A F0(\(Hammer\))2.5 E F1(\255Ji)144 156 Q F2(lon0/scale)A F0
-(\(Sinusoidal\))2.5 E F1(\255Jk)144 168 Q F2(lon0/scale)A F0(\(Eck)2.5 E
-(ert VI\))-.1 E F1(\255Jn)144 180 Q F2(lon0/scale)A F0(\(Robinson\))2.5
-E F1(\255Jr)144 192 Q F2(lon0/scale)A F0(\(W)2.5 E(ink)-.4 E(el T)-.1 E
-(ripel\))-.35 E F1(\255Jw)144 204 Q F2(lon0/scale)A F0(\(Moll)2.5 E
-(weide\))-.1 E F1(NON-GEOGRAPHICAL PR)144 228 Q(OJECTIONS:)-.3 E(\255Jp)
-144 252 Q F2(scale)A F0
-(\(Linear projection for polar \(theta,r\) coordinates\))2.5 E F1
-(\255Jx)144 264 Q F2(x-scale)A F0([)A F1(l|p)A F2(pow)A F0(][)A F2
-(/y-scale)A F0([)A F1(l|p)A F2(pow)A F0(]] \(Linear)A 2.5(,l)-.4 G
-(og, and po)-2.5 E(wer scaling\))-.25 E
-(More details can be found in the)144 276 Q F1(psbasemap)2.5 E F0
-(manpages.)2.5 E F1<ad4c>108 292.8 Q F2(title[:xlabel[:ylabel]])23.63 E
-F0 .174(Sets the title and the labels for the x and y ax)144 304.8 R
-.173(es of the plot. Note that a colon \(:\) rather than a slash)-.15 F
-.652(\(/\) is used to separate the labels. Colons cannot be used in the\
- labels themselv)144 316.8 R .653(es. If this option is)-.15 F .157
-(not used, then a def)144 328.8 R .157
-(ault title and colorscale label are pro)-.1 F .157
-(vided. If the title is supplied alone, no x or)-.15 F
-(y-axis labels will be pro)144 340.8 Q(vided.)-.15 E F1<ad4d>108 357.6 Q
-F0 3.055(As)20.86 G .555(eries of "miscellaneous" options are pro)-3.055
-F .555(vided which are gi)-.15 F -.15(ve)-.25 G 3.055(na).15 G(s)-3.055
-E F1<ad4d>3.055 E F0(follo)3.055 E .555(wed by a tw)-.25 F 3.055(oc)-.1
-G(har)-3.055 E(-)-.2 E 1.329(acter identi\214er)144 369.6 R 3.829(,f)-.4
-G(ollo)-3.829 E 1.329(wed by an)-.25 F 3.829(yo)-.15 G 1.328
-(ther parameters associated with that option.)-3.829 F(The)6.328 E F1
-<ad4d>3.828 E F0(options)3.828 E .636(may be strung together separated \
-by colons, e.g. "-MGQ100:GU:CA200/10", which is equi)144 381.6 R -.25
-(va)-.25 G(lent).25 E(to "-MGQ \255MGU \255MCA200/10".)144 393.6 Q F1
-(\255MGD)108 410.4 Q F2(gmtdef/value)5.86 E F0(Allo)144 422.4 Q .227
-(ws the user to set the)-.25 F F1(GMT)2.727 E F0(def)2.727 E .227
-(ault v)-.1 F .227
-(alues used as the plot is constructed. This command may)-.25 F 1.133
-(be gi)144 434.4 R -.15(ve)-.25 G 3.633(nr).15 G 1.133
-(epeatedly to set as man)-3.633 F(y)-.15 E F1(GMT)3.633 E F0(def)3.633 E
-1.133(aults as required. F)-.1 F 1.133(or e)-.15 F 1.133
-(xample, to set the basemap)-.15 F(annotation font to Courier)144 446.4
-Q 2.5(,u)-.4 G(se "-MGD)-2.5 E(ANO)-.4 E(T_FONT/Courier".)-.4 E F1
-(\255MGL)108 463.2 Q F0([)6.41 E F2(f)A F0(][)A F2(x)A F0(])A F2
-(lon0/lat0/slat/length)A F0([)A F2(units)A F0(][)A F2(+llabel)A F0(])A
-(Dra)144 475.2 Q .16(ws a simple map scale centered on)-.15 F F2
-(lon0/lat0)2.66 E F0 5.16(.U)C(se)-5.16 E F1(\255Lf)2.66 E F0 .16
-(to get a "f)2.66 F(anc)-.1 E .16(y" scale [Def)-.15 F .16
-(ault is plain].)-.1 F(Use)144 487.2 Q F1(\255Lx)2.961 E F0 .461
-(to specify the position in inches instead of map units.)2.961 F .462
-(The scale is calculated at latitude)5.461 F F2(slat)144 499.2 Q F0
-2.929(;i)C 2.929(ft)-2.929 G .429
-(he string "center" is used instead of a numerical v)-2.929 F .428
-(alue for)-.25 F F2(slat)2.928 E F0 2.928(,t)C .428
-(hen the macro will set the)-2.928 F 1.596
-(scaling according to the center of the plot bounds.)144 511.2 R 1.596
-(The scale length v)6.596 F(alue)-.25 E F2(length)4.096 E F0 1.596
-(is in km by)4.096 F(def)144 523.2 Q .279(ault, b)-.1 F .278(ut the uni\
-ts can be speci\214ed as one of e|f|k|M|n|u, where e = meters, f = feet\
-, k = kilome-)-.2 F .911
-(ters, M = statue miles, n = nautical miles, and u = US surv)144 535.2 R
-1.212 -.15(ey f)-.15 H .912(eet. Append).15 F F2(+l)3.412 E F0 .912
-(to label the scale)3.412 F(with the rele)144 547.2 Q -.25(va)-.25 G
-(nt units, or append).25 E F2(+l"label")2.5 E F0(to set a dif)2.5 E
-(ferent label string.)-.25 E F1(\255MGT)108 564 Q F2
-(x/y/size/angle/font/just/te)6.41 E(xt)-.2 E F0 .488(Causes a te)144 576
-R .488(xt label to plotted on the map.)-.15 F F2(size)5.487 E F0 .487
-(is te)2.987 F .487(xt size in points,)-.15 F F2(angle)2.987 E F0 .487
-(is measured in de)2.987 F(grees)-.15 E(counter)144 588 Q .8
-(-clockwise from horizontal,)-.2 F F2(fontno)3.3 E F0 .8
-(sets the font type,)3.3 F F2(justify)3.3 E F0 .8(sets the alignment.)
-3.3 F(If)5.8 E F2(fontno)3.3 E F0 1.615(starts with a leading h)144 600
-R 1.615(yphen, then the remainder of)-.05 F F2(fontno)4.115 E F0 1.615
-(is tak)4.115 F 1.614(en to be a te)-.1 F 1.614(xtstring with the)-.15 F
-1.022(desired fontname.)144 612 R 1.022(See the)6.022 F F1(gmtdefaults)
-3.522 E F0 1.022(man page for names and numbers of a)3.522 F -.25(va)-.2
-G 1.023(ilable fonts \(or).25 F(run)144 624 Q F1 .112(pstext \255L)2.612
-F F0 2.612(\). The)B .111(alignment number refers to the part of the te)
-2.611 F .111(xtstring that will be mapped onto)-.15 F .289(the \()144
-636 R F2(x,y)A F0 2.789(\)p)C .289(oint: 1 = Lo)-2.789 F .289
-(wer Left corner)-.25 F 2.789(,2=L)-.4 G -.25(ow)-2.789 G .289
-(er Center).25 F 2.789(,3=L)-.4 G -.25(ow)-2.789 G .289
-(er Right, 5 = Mid Left, 6 = Mid).25 F(Center)144 648 Q 2.783(,7=M)-.4 G
-.283(id Right, 9 = Upper Left, 10 = Upper Center)-2.783 F 2.783(,1)-.4 G
-2.783(1=U)-2.783 G .283(pper Right. This option may be)-2.783 F(gi)144
-660 Q -.15(ve)-.25 G 2.5(na).15 G 2.5(sm)-2.5 G(an)-2.5 E 2.5(yt)-.15 G
-(imes as needed.)-2.5 E F1(\255MGU)108 676.8 Q F0([)5.86 E F2(/dx/dy/)A
-F0(][)A F2(label)A F0(])A(Dra)144 688.8 Q 2.635(wU)-.15 G .135
-(nix System time stamp on plot.)-2.635 F .135
-(User may specify where the lo)5.135 F .136
-(wer left corner of the stamp)-.25 F 1.926(should f)144 700.8 R 1.926
-(all on the page relati)-.1 F 2.226 -.15(ve t)-.25 H 4.426(ol).15 G -.25
-(ow)-4.426 G 1.925(er left corner of plot in inch [Def).25 F 1.925
-(ault is \(-0.75,-0.75\)].)-.1 F(Optionally)144 712.8 Q 2.5(,a)-.65 G
-(ppend a label, or)-2.5 E F1(c)2.5 E F0
-(\(which will plot the command string.\))2.5 E(MB-System 5.0)72 768 Q
-2.5(9J)140.11 G(anuary 2015)-2.5 E(5)198.45 E 0 Cg EP
-%%Page: 6 6
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 137.05(mbm_xyplot\(1\) MB-System)72 48 R 137.05
-(5.0 mbm_xyplot\(1\))2.5 F/F1 10/Times-Bold at 0 SF<ad4f>108 84 Q/F2 10
-/Times-Italic at 0 SF -.45(ro)22.52 G(ot).45 E F0 .422(Sets the root used \
-to construct the \214lename of the output shellscript \()144 96 R F2
--.45(ro)C(ot).45 E F0 .423(.cmd\) and names of \214les)B .157
-(created when the shellscript is run.)144 108 R .157
-(Normally the name of the input grid \214le or grid \214le list is used)
-5.157 F(as the)144 120 Q F2 -.45(ro)2.5 G(ot).45 E F0(.)A F1<ad50>108
-136.8 Q F2(pa)24.19 E -.1(ge)-.1 G(size).1 E F0 .632(This option sets t\
-he size of the page the plot will be centered on. If the user does not \
-set the plot)144 148.8 R .126(scale, the plot will be sized as lar)144
-160.8 R .125(ge as will \214t on the designated page. If the user sets \
-the plot scale)-.18 F .948
-(such that the plot will not \214t on the designated page, a lar)144
-172.8 R .948(ger page will be used.)-.18 F .948(The supported)5.948 F
-(page sizes are:)144 184.8 Q(American ANSI sizes:)169 208.8 Q 12.5(A8)
-169 220.8 S(.5 x 11.0 in.)-12.5 E 2.5(\(2)10 G(15.9 x)-2.5 E(279.4 mm\))
-5 E 10(B1)169 232.8 S(1.0 x 17.0 in.)-10 E 2.5(\(2)10 G(79.4 x)-2.5 E
-(431.8 mm\))5 E 10(C1)169 244.8 S(7.0 x 22.0 in.)-10 E 2.5(\(4)10 G
-(31.8 x)-2.5 E(558.8 mm\))5 E 10(D2)169 256.8 S(2.0 x 34.0 in.)-10 E 2.5
-(\(5)10 G(58.8 x)-2.5 E(863.6 mm\))5 E 10(E3)169 268.8 S(4.0 x 44.0 in.)
--10 E 2.5(\(8)10 G(63.6 x 1117.6 mm\))-2.5 E 10(F2)169 280.8 S
-(8.0 x 40.0 in.)-10 E 2.5(\(7)10 G(11.2 x 1016.0 mm\))-2.5 E 5(E1 44.0)
-169 292.8 R 2.5(x6)2.5 G(8.0 in.)-2.5 E(\(1117.6 x 1727.2 mm\))10 E
-(Metric ISO A sizes:)169 316.8 Q 5(A0 841.0)169 328.8 R 2.5(x1)2.5 G
-(189.0 mm)-2.5 E(\(33.11 x 46.81 in.\))5 E 5(A1 594.0)169 340.8 R 5(x8)
-2.5 G(41.0 mm)-5 E(\(23.39 x 33.11 in.\))5 E 5(A2 420.0)169 352.8 R 5
-(x5)2.5 G(94.0 mm)-5 E(\(16.54 x 23.39 in.\))5 E 5(A3 297.0)169 364.8 R
-5(x4)2.5 G(20.0 mm)-5 E(\(11.69 x 16.54 in.\))5 E 5(A4 210.0)169 376.8 R
-5(x2)2.5 G(97.0 mm)-5 E 2.5(\(8)5 G(.27 x 11.69 in.\))-2.5 E 5(A5 148.0)
-169 388.8 R 5(x2)2.5 G(10.0 mm)-5 E 2.5(\(5)5 G(.83 x)-2.5 E(8.27 in.\))
-5 E 5(A6 105.0)169 400.8 R 5(x1)2.5 G(48.0 mm)-5 E 2.5(\(4)5 G(.13 x)
--2.5 E(5.83 in.\))5 E 7.5(A7 74.0)169 412.8 R 5(x1)2.5 G(05.0 mm)-5 E
-2.5(\(2)5 G(.91 x)-2.5 E(4.13 in.\))5 E 7.5(A8 52.0)169 424.8 R 7.5(x7)
-2.5 G(4.0 mm)-7.5 E 2.5(\(2)5 G(.05 x)-2.5 E(2.91 in.\))5 E 7.5(A9 37.0)
-169 436.8 R 7.5(x5)2.5 G(2.0 mm)-7.5 E 2.5(\(1)5 G(.46 x)-2.5 E
-(2.05 in.\))5 E 5(A10 26.0)169 448.8 R 7.5(x3)2.5 G(7.0 mm)-7.5 E 2.5
-(\(1)5 G(.02 x)-2.5 E(1.46 in.\))5 E(Metric ISO B sizes:)169 472.8 Q 5
-(B0 1000.0x)169 484.8 R(1414.0 mm)2.5 E(\(39.37 x 55.67 in.\))5 E 5
-(B1 707.0)169 496.8 R 2.5(x1)2.5 G(000.0 mm)-2.5 E
-(\(27.83 x 39.37 in.\))5 E 5(B2 500.0)169 508.8 R 5(x7)2.5 G(07.0 mm)-5
-E(\(19.68 x 27.83 in.\))5 E 5(B3 353.0)169 520.8 R 5(x5)2.5 G(00.0 mm)-5
-E(\(13.90 x 19.68 in.\))5 E 5(B4 250.0)169 532.8 R 5(x3)2.5 G(53.0 mm)-5
-E 2.5(\(9)5 G(.84 x 13.90 in.\))-2.5 E 5(B5 176.0)169 544.8 R 5(x2)2.5 G
-(50.0 mm)-5 E 2.5(\(6)5 G(.93 x)-2.5 E(9.84 in.\))5 E 5(B6 125.0)169
-556.8 R 5(x1)2.5 G(76.0 mm)-5 E 2.5(\(4)5 G(.92 x)-2.5 E(6.93 in.\))5 E
-7.5(B7 88.0)169 568.8 R 5(x1)2.5 G(25.0 mm)-5 E 2.5(\(3)5 G(.46 x)-2.5 E
-(4.92 in.\))5 E 7.5(B8 62.0)169 580.8 R 7.5(x8)2.5 G(8.0 mm)-7.5 E 2.5
-(\(2)5 G(.44 x)-2.5 E(3.46 in.\))5 E 7.5(B9 44.0)169 592.8 R 7.5(x6)2.5
-G(2.0 mm)-7.5 E 2.5(\(1)5 G(.73 x)-2.5 E(2.44 in.\))5 E 5(B10 31.0)169
-604.8 R 7.5(x4)2.5 G(4.0 mm)-7.5 E 2.5(\(1)5 G(.22 x)-2.5 E(1.73 in.\))5
-E(Metric ISO C sizes:)169 628.8 Q 5(C0 914.4)169 640.8 R 2.5(x1)2.5 G
-(300.5 mm)-2.5 E(\(36.00 x 51.20 in.\))5 E 5(C1 650.2)169 652.8 R 5(x9)
-2.5 G(14.4 mm)-5 E(\(25.60 x 36.00 in.\))5 E 5(C2 457.2)169 664.8 R 5
-(x6)2.5 G(50.2 mm)-5 E(\(18.00 x 25.60 in.\))5 E 5(C3 325.1)169 676.8 R
-5(x4)2.5 G(57.2 mm)-5 E(\(12.80 x 18.00 in.\))5 E 5(C4 228.6)169 688.8 R
-5(x3)2.5 G(25.1 mm)-5 E 2.5(\(9)5 G(.00 x 12.80 in.\))-2.5 E 5(C5 162.6)
-169 700.8 R 5(x2)2.5 G(28.6 mm)-5 E 2.5(\(6)5 G(.40 x)-2.5 E(9.00 in.\))
-5 E 5(C6 114.3)169 712.8 R 5(x1)2.5 G(62.6 mm)-5 E 2.5(\(4)5 G(.50 x)
--2.5 E(6.40 in.\))5 E 7.5(C7 81.3)169 724.8 R 5(x1)2.5 G(14.3 mm)-5 E
-2.5(\(3)5 G(.20 x)-2.5 E(4.50 in.\))5 E(MB-System 5.0)72 768 Q 2.5(9J)
-140.11 G(anuary 2015)-2.5 E(6)198.45 E 0 Cg EP
-%%Page: 7 7
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 137.05(mbm_xyplot\(1\) MB-System)72 48 R 137.05
-(5.0 mbm_xyplot\(1\))2.5 F(MB-System lar)185 84 Q(ge format sizes:)-.18
-E 2.5(m1 1371.6)169 96 R 2.5(x1)2.5 G(828.8 mm)-2.5 E
-(\(54.00 x 72.00 in.\))5 E 2.5(m2 1371.6)169 108 R 2.5(x2)2.5 G
-(133.6 mm)-2.5 E(\(54.00 x 84.00 in.\))5 E 2.5(m3 1371.6)169 120 R 2.5
-(x2)2.5 G(438.4 mm)-2.5 E(\(54.00 x 96.00 in.\))5 E 2.5(m4 1524.0)169
-132 R 2.5(x1)2.5 G(828.8 mm)-2.5 E(\(60.00 x 72.00 in.\))5 E 2.5
-(m5 1524.0)169 144 R 2.5(x2)2.5 G(133.6 mm)-2.5 E(\(60.00 x 84.00 in.\))
-5 E 2.5(m6 1524.0)169 156 R 2.5(x2)2.5 G(438.4 mm)-2.5 E
-(\(60.00 x 96.00 in.\))5 E(The def)144 180 Q(ault page size is A.)-.1 E
-/F1 10/Times-Bold at 0 SF<ad51>108 196.8 Q F0(Normally)22.52 E 2.867(,t)
--.65 G .367
-(he output plot generation shellscript includes lines which e)-2.867 F
--.15(xe)-.15 G .367(cute a program to display).15 F 1.071
-(the Postscript image on the screen.)144 208.8 R 1.071
-(This option causes those lines to be commented out so that)6.071 F -.15
-(exe)144 220.8 S .148
-(cuting the shellscript produces a Postscript plot b).15 F .147
-(ut does not attempt to display it on the screen.)-.2 F(Alternati)144
-232.8 Q -.15(ve)-.25 G(ly).15 E 2.891(,i)-.65 G -1.9 -.4(nv o)-2.891 H
-.391(king the plot generation shellscript with a).4 F F1(-N)2.892 E F0
-.392(command line ar)2.892 F .392(gument also sup-)-.18 F .089
-(presses the screen display of the plot.)144 244.8 R .088
-(The program to be used to display the Postscript is set using)5.088 F
-F1(mbdefaults)144 256.8 Q F0 7.89(;t)C 5.391(he def)-7.89 F 5.391
-(ault v)-.1 F 5.391(alue can be o)-.25 F -.15(ve)-.15 G 5.391
-(rridden by setting the en).15 F 5.391(vironment v)-.4 F(ariable)-.25 E
-($MB_PS_VIEWER.)144 268.8 Q F1<ad52>108 285.6 Q/F2 10/Times-Italic at 0 SF
-(west/east/south/north)23.08 E .736(west, east, south,)144 297.6 R F0
-(and)3.236 E F2(north)3.236 E F0 .736(specify the Re)3.236 F .736
-(gion of interest.)-.15 F 2.336 -.8(To s)5.736 H .736
-(pecify boundaries in de).8 F .736(grees and)-.15 F 1.161
-(minutes [and seconds], use the dd:mm[:ss] format.)144 309.6 R(Append)
-6.161 E F1(r)3.661 E F0 1.161(if lo)3.661 F 1.162
-(wer left and upper right map)-.25 F .209(coordinates are gi)144 321.6 R
--.15(ve)-.25 G 2.709(ni).15 G .209(nstead of wesn.)-2.709 F -1.1(Yo)
-5.208 G 2.708(um)1.1 G .208(ay ask for a lar)-2.708 F(ger)-.18 E F2
-(w/e/s/n)2.708 E F0(re)2.708 E .208(gion to ha)-.15 F .508 -.15(ve m)-.2
-H .208(ore room).15 F .199(between the image and the ax)144 333.6 R
-2.699(es. A)-.15 F .199(smaller re)2.699 F .199
-(gion than speci\214ed in the grd\214le will result in a sub-)-.15 F
-(set of the grid [Def)144 345.6 Q(ault is re)-.1 E(gion gi)-.15 E -.15
-(ve)-.25 G 2.5(nb).15 G 2.5(yt)-2.5 G(he grd\214le].)-2.5 E F1<ad53>108
-362.4 Q F2(symbol/size)24.74 E F0 .333
-(Selects symbol to be used for plotting the ne)144 374.4 R .332
-(xt xy data \214le. Setting)-.15 F F2(symbol)2.832 E F0 2.832(=")2.832 G
-.332(N" causes line plot-)-2.832 F 2.5(ting. Choose)144 386.4 R
-(between:)2.5 E F1(\255Sa)108 403.2 Q F0(st)19.74 E F1(a)A F0 -.55(r.)C
-F2(size)5.55 E F0(is radius of circumscribing circle.)2.5 E F1 16.68
-(\255Sb b)108 420 R F0 .921(ar e)B .921(xtending from)-.15 F F2(base)
-3.421 E F0 .921(to y)3.421 F(.)-.65 E F2(size)5.921 E F0 .921
-(is bar width.)3.421 F .921(By def)5.921 F(ault,)-.1 E F2(base)3.421 E
-F0 3.421(=0)3.421 G 5.921(.A)-3.421 G .921(ppend /)-5.921 F F2(base)A F0
-.922(to change)3.422 F(this v)144 432 Q 2.5(alue. Append)-.25 F F1(u)2.5
-E F0(if)2.5 E F2(size)2.5 E F0(is in x-units [Def)2.5 E(ault is inch].)
--.1 E F1 17.8(\255Sc c)108 448.8 R F0(ircle.)A F2(size)5 E F0
-(is diameter of circle.)2.5 E F1 16.68(\255Sd d)108 465.6 R F0(iamond.)A
-F2(size)5 E F0(is side of diamond.)2.5 E F1 17.8(\255Se e)108 482.4 R F0
-5.678(llipse. Direction)B 3.178(\(in de)5.678 F 3.178
-(grees counterclockwise from horizontal\), major_axis \(in inch\), and)
--.15 F(minor_axis \(in inch\) must be found in columns 3, 4, and 5.)144
-494.4 Q F1 18.91(\255Sf f)108 511.2 R F0 2.528(ault. Gi)B .328 -.15
-(ve d)-.25 H .028(istance g).15 F .029
-(ap between ticks and ticklength in inch.)-.05 F .029(If g)5.029 F .029
-(ap is ne)-.05 F -.05(ga)-.15 G(ti).05 E -.15(ve)-.25 G 2.529(,i).15 G
-2.529(ti)-2.529 G 2.529(si)-2.529 G .029(nterpreted to)-2.529 F .399
-(mean number of ticks instead.)144 523.2 R(Append)5.399 E F1(l)2.899 E
-F0(or)2.899 E F1(r)2.899 E F0 .399(to dra)2.899 F 2.899(wt)-.15 G .399
-(ick on the left or right side of line [Def)-2.899 F(ault)-.1 E
-(is centered].)144 535.2 Q(Upper case)5 E F1(L)2.5 E F0(or)2.5 E F1(R)
-2.5 E F0(dra)2.5 E(ws a triangle instead of line se)-.15 E(gment.)-.15 E
-F1 16.68(\255Sh h)108 552 R F0 -.15(ex)C 2.5(agon. Gi).15 F .3 -.15
-(ve s)-.25 H(ide in inch.).15 E F1 19.46(\255Si i)108 568.8 R F0 -1.85
--.4(nv e)D(rted triangle.).4 E(Gi)5 E .3 -.15(ve s)-.25 H(ide in inch.)
-.15 E F1 19.46(\255Sl l)108 585.6 R F0 .405(etter or te)B .405
-(xt string.)-.15 F(Gi)5.405 E .706 -.15(ve s)-.25 H .406
-(ize in inch, and append /).15 F F2(string)A F0 .406(after the size.)
-2.906 F .406(Note that the size is only)5.406 F .92
-(approximate; no indi)144 597.6 R .919(vidual scaling is done for dif)
--.25 F .919(ferent characters.)-.25 F .919(Remember to escape special)
-5.919 F(characters lik)144 609.6 Q 2.5(e*)-.1 G(.)-2.5 E F1 16.68
-(\255Sp p)108 626.4 R F0 2.5(oint. No)B
-(size needs to be speci\214ed \(1 pix)2.5 E(el is used\).)-.15 E F1
-18.35(\255Ss s)108 643.2 R F0 2.5(quare. Gi)B .3 -.15(ve s)-.25 H
-(ide in inch.).15 E F1 18.91(\255St t)108 660 R F0 2.5(riangle. Gi)B .3
--.15(ve s)-.25 H(ide in inch.).15 E F1 17.24(\255Sv v)108 676.8 R F0
-(ector)A 7(.D)-.55 G 2(irection \(in de)-7 F 2(grees counterclockwise f\
-rom horizontal\) and length \(in inch\) must be)-.15 F .036
-(found in columns 3 and 4.)144 688.8 R F2(size)5.036 E F0 2.536(,i)C
-2.536(fp)-2.536 G .036(resent, will be interpreted as arro)-2.536 F
-(wwidth/headlength/headwidth)-.25 E 2.103(\(in inch\) [Def)144 700.8 R
-2.104(ault is 0.03/0.12/0.1 inch].)-.1 F 2.104(By def)7.104 F 2.104
-(ault arro)-.1 F 4.604(wa)-.25 G(ttrib)-4.604 E 2.104(utes remains in)
--.2 F -.25(va)-.4 G 2.104(riant to the).25 F .029(length of the arro)144
-712.8 R 3.829 -.65(w. T)-.25 H 2.529(oh)-.15 G -2.25 -.2(av e)-2.529 H
-.029(the size of the v)2.729 F .029(ector scale do)-.15 F .028
-(wn with decreasing size, append n)-.25 F F2(norm)A F0(,)A(where v)144
-724.8 Q(ectors shorter than)-.15 E F2(norm)2.5 E F0(will ha)2.5 E .3
--.15(ve t)-.2 H(heir attrib).15 E(utes scaled by length/)-.2 E F2(norm)A
-F0(.)A(MB-System 5.0)72 768 Q 2.5(9J)140.11 G(anuary 2015)-2.5 E(7)
-198.45 E 0 Cg EP
-%%Page: 8 8
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 137.05(mbm_xyplot\(1\) MB-System)72 48 R 137.05
-(5.0 mbm_xyplot\(1\))2.5 F/F1 10/Times-Bold at 0 SF(\255SV)108 84 Q F0 .5
-(Same as)17.52 F F1(\255Sv)3 E F0 3(,e)C .5(xcept azimuth \(in de)-3.15
-F .501(grees east of north\) should be gi)-.15 F -.15(ve)-.25 G 3.001
-(ni).15 G .501(nstead of direction.)-3.001 F(The)5.501 E .635(azimuth w\
-ill be mapped into an angle based on the chosen map projection \()144 96
-R F1(\255Sv)A F0(lea)3.135 E -.15(ve)-.2 G 3.135(st).15 G .635
-(he direc-)-3.135 F(tions unchanged.\))144 108 Q F1(\255Sx)108 124.8 Q
-F0 2.5(cross. Gi)19.74 F .3 -.15(ve l)-.25 H(ength in inch.).15 E F1
-<ad55>108 141.6 Q/F2 10/Times-Italic at 0 SF(orientation)23.08 E F0 .2(Nor\
-mally the orientation of the plot \(portrait or landscape\) is selected\
- automatically so as to maxi-)144 153.6 R .334(mize the plot scale.)144
-165.6 R(The)5.333 E F1<ad55>2.833 E F0 .333(option allo)2.833 F .333
-(ws the user to set the plot orientation. If)-.25 F F2(orientation)2.833
-E F0 2.833(=1)2.833 G 2.833(,a)-2.833 G
-(portrait plot will be produced; if)144 177.6 Q F2(orientation)2.5 E F0
-2.5(=2)2.5 G 2.5(,al)-2.5 G(andscape plot will be produced.)-2.5 E F1
-<ad56>108 194.4 Q F0(Causes)23.08 E F1(mbm_xyplot)2.854 E F0 .354
-(to operate in "v)2.854 F .354
-(erbose" mode so that it outputs more information than usual.)-.15 F F1
-<ad57>108 211.2 Q F2(pen)20.3 E F0 .784(Set pen attrib)144 223.2 R .784
-(utes for xy plotting. See chapter 4.12 in the GMT T)-.2 F .783
-(echnical reference for a discus-)-.7 F(sion of GMT pen v)144 235.2 Q
-2.5(alues. [Def)-.25 F(aults: width = 1, color = 0/0/0, te)-.1 E
-(xture = solid].)-.15 E F1<ad58>108 252 Q F0(Normally)23.08 E(,)-.65 E
-F1(mbm_xyplot)3.72 E F0 1.221(creates an e)3.72 F -.15(xe)-.15 G 1.221
-(cutable shellscript and then e).15 F 3.721(xits. This)-.15 F 1.221
-(option will cause)3.721 F(the shellscript to be e)144 264 Q -.15(xe)
--.15 G(cuted in the background before).15 E F1(mbm_xyplot)2.5 E F0 -.15
-(ex)2.5 G(its.).15 E F1 21.13(\255Z mbm_xyplot)108 280.8 R F0 -.15(ex)
-2.6 G .099(tracts the desired columns of the input data and creates sec\
-ondary \214les with the xy).15 F -.25(va)144 292.8 S .38
-(lues to be plotted.).25 F .38(Normally these \214les are left in place\
- by the plot shellscript to be used multi-)5.38 F(ple times. The)144
-304.8 Q F1<ad5a>2.5 E F0
-(option causes the shellscript to delete those secondary \214les.)2.5 E
-/F3 10.95/Times-Bold at 0 SF(EXAMPLES)72 333.6 Q F0 .211(Suppose we ha)108
-345.6 R .511 -.15(ve o)-.2 H .211(btained a sw).15 F .211
-(ath sonar data \214le called sb2112_e)-.1 F .21
-(xample.mb41 collected using a SeaBeam)-.15 F .826(2112 sonar)108 357.6
-R 5.826(.I)-.55 G 3.326(no)-5.826 G .826
-(rder to obtain an xy plot of the center beam depth v)-3.326 F .827
-(ersus time, we \214rst e)-.15 F .827(xtract the time-)-.15 F
-(depth xy doubles from the sw)108 369.6 Q(ath sonar \214le using)-.1 E
-F1(mblist)2.5 E F0(:)A(mblist \255F41 \255Isb2112_e)144 393.6 Q
-(xample.mb41 \255OmZ > mz.dat)-.15 E .372(Here time is in seconds from \
-the start of the \214le and the depths are in meters, positi)108 417.6 R
-.671 -.15(ve u)-.25 H(pw).15 E .371(ard \(topograph)-.1 F(y)-.05 E 1.029
-(rather than bath)108 429.6 R 3.529(ymetry\). No)-.05 F 2.329 -.65(w, w)
--.25 H 3.529(eu).65 G(se)-3.529 E F1(mbm_xyplot)3.529 E F0 1.03
-(to generate shellscripts which in turn generate plots)3.529 F(when e)
-108 441.6 Q -.15(xe)-.15 G 2.5(cuted. First,).15 F
-(we generate a simple black line plot:)2.5 E
-(mbm_xyplot \255Imz.dat \255Omz)144 465.6 Q .242(The abo)108 489.6 R
-.542 -.15(ve c)-.15 H .242(ommand generates an e).15 F -.15(xe)-.15 G
-.242(cutable shellscript mz_line.cmd; e).15 F -.15(xe)-.15 G .241
-(cuting this shellscript will gener).15 F(-)-.2 E
-(ate a Postscript plot and display it on the screen.)108 501.6 Q .39
-(Suppose we also ha)108 525.6 R .69 -.15(ve a s)-.2 H .39
-(parse set of depth estimates in a \214le called sr).15 F .39
-(.dat obtained by picking the sea\215oor)-.55 F .293
-(on a seismic re\215ection record, and we wish to compare the tw)108
-537.6 R 2.793(os)-.1 G .293(ets of depths. W)-2.793 F 2.793(ec)-.8 G
-.293(an plot the sw)-2.793 F .293(ath sonar)-.1 F(deri)108 549.6 Q -.15
-(ve)-.25 G 2.5(dd).15 G(epths as a black line and the seismic deri)-2.5
-E -.15(ve)-.25 G 2.5(dd).15 G(epths as red stars as follo)-2.5 E(ws:)
--.25 E(mbm_xyplot \255Omz_sr \255Imz.dat \\)144 573.6 Q
-(-IG255/0/0:Sa/0.1:sr)180 585.6 Q(.dat)-.55 E(As an e)108 609.6 Q
-(xample, the contents of the plotting shellscript "mz.cmd" are:)-.15 E
-(#)110.5 633.6 Q 2.5(#S)110.5 645.6 S
-(hellscript to create Postscript plot of data in grd \214le)-2.5 E 2.5
-(#C)110.5 657.6 S(reated by macro mbm_xyplot)-2.5 E(#)110.5 669.6 Q 2.5
-(#T)110.5 681.6 S(his shellscript created by follo)-2.5 E
-(wing command line:)-.25 E 2.5(#m)110.5 693.6 S
-(bm_xyplot \255Imz.dat \255Omz)-2.5 E(#)110.5 705.6 Q 2.5(#S)110.5 717.6
-S -2.25 -.2(av e)-2.5 H -.15(ex)2.7 G(isting GMT def).15 E(aults)-.1 E
-(echo Sa)110.5 729.6 Q(ving GMT def)-.2 E(aults...)-.1 E(MB-System 5.0)
-72 768 Q 2.5(9J)140.11 G(anuary 2015)-2.5 E(8)198.45 E 0 Cg EP
-%%Page: 9 9
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 137.05(mbm_xyplot\(1\) MB-System)72 48 R 137.05
-(5.0 mbm_xyplot\(1\))2.5 F(gmtdef)110.5 84 Q(aults \255L > gmtdef)-.1 E
-(aults$$)-.1 E(#)110.5 96 Q 2.5(#S)110.5 108 S(et ne)-2.5 E 2.5(wG)-.25
-G(MT def)-2.5 E(aults)-.1 E(echo Setting ne)110.5 120 Q 2.5(wG)-.25 G
-(MT def)-2.5 E(aults...)-.1 E(gmtset ANO)110.5 132 Q(T_FONT Helv)-.4 E
-(etica)-.15 E(gmtset LABEL_FONT Helv)110.5 144 Q(etica)-.15 E
-(gmtset HEADER_FONT Helv)110.5 156 Q(etica)-.15 E(gmtset ANO)110.5 168 Q
-(T_FONT_SIZE 8)-.4 E(gmtset LABEL_FONT_SIZE 8)110.5 180 Q
-(gmtset HEADER_FONT_SIZE 10)110.5 192 Q
-(gmtset FRAME_WIDTH 0.074999999999999997)110.5 204 Q
-(gmtset TICK_LENGTH 0.074999999999999997)110.5 216 Q(gmtset P)110.5 228
-Q -.4(AG)-.92 G(E_ORIENT).4 E -1.11(AT)-.93 G(ION LANDSCAPE)1.11 E
-(gmtset COLOR_B)110.5 240 Q -.4(AC)-.35 G(KGR).4 E(OUND 0/0/0)-.4 E
-(gmtset COLOR_FOREGR)110.5 252 Q(OUND 255/255/255)-.4 E(gmtset COLOR_N)
-110.5 264 Q(AN 255/255/255)-.35 E(#)110.5 276 Q 2.5(#M)110.5 288 S(ak)
--2.5 E 2.5(ex)-.1 G 2.5(yd)-2.5 G(ata plot)-2.5 E(echo Running psxy)
-110.5 300 Q(...)-.65 E(psxy mz.dat \\)110.5 312 Q
-(-Jx0.0011071486125582637/0.0062732342007434947 \\)144 324 Q
-(-R0/8128.99/-4382/-3306 \\)144 336 Q(-X1 \255Y0.5 \255K \255V > mz.ps)
-144 348 Q 2.5(##M)110.5 360 S(ak)-2.5 E 2.5(eb)-.1 G(asemap)-2.5 E
-(echo Running psbasemap...)110.5 372 Q
-(psbasemap \255Jx0.0011071486125582637/0.0062732342007434947 \\)110.5
-384 Q(-R0/8128.99/-4382/-3306 \\)144 396 Q
-(-B500/100:."Data File mz.dat": \\)144 408 Q(-O \255V >> mz.ps)144 420 Q
-(#)110.5 432 Q 2.5(#D)110.5 444 S(elete surplus \214les)-2.5 E
-(echo Deleting surplus \214les...)110.5 456 Q(rm \255f)110.5 468 Q(#)
-110.5 480 Q 2.5(#R)110.5 492 S(eset GMT def)-2.5 E(ault fonts)-.1 E
-(echo Resetting GMT fonts...)110.5 504 Q(mv gmtdef)110.5 516 Q
-(aults$$ .gmtdef)-.1 E(aults)-.1 E(#)110.5 528 Q 2.5(#R)110.5 540 S
-(un xpsvie)-2.5 E(w)-.25 E(echo Running xpsvie)110.5 552 Q 2.5(wi)-.25 G
-2.5(nb)-2.5 G(ackground...)-2.5 E(xpsvie)110.5 564 Q 2.5<77ad>-.25 G
-(ps a \255or landscape \255maxp 4m mz.ps &)-2.5 E(#)110.5 576 Q 2.5(#A)
-110.5 588 S(ll done!)-2.5 E(echo All done!)110.5 600 Q/F1 10.95
-/Times-Bold at 0 SF(AD)72 628.8 Q -1.478(VA)-.438 G(NCED EXAMPLES)1.478 E
-F0 .548(Suppose we ha)108 640.8 R .848 -.15(ve a \214)-.2 H .548
-(le of NMEA GGA strings logged from a GPS recei).15 F -.15(ve)-.25 G
-3.049(rw).15 G .549(hose data looks lik)-3.049 F 3.049(et)-.1 G .549
-(he fol-)-3.049 F(lo)108 652.8 Q(wing:)-.25 E(\214lename: gps.ra)108
-676.8 Q(w:)-.15 E($GPGGA,23.0,5427.89080,N,14600.29458,W)110.5 700.8 Q
-(,1,10,0.9,19.01,M,6.40,M,,*70)-.92 E
-($GPGGA,24.0,5427.89248,N,14600.30088,W)110.5 712.8 Q
-(,1,10,0.9,19.39,M,6.40,M,,*7B)-.92 E
-($GPGGA,25.0,5427.89424,N,14600.30713,W)110.5 724.8 Q
-(,1,10,0.9,19.72,M,6.40,M,,*7C)-.92 E(MB-System 5.0)72 768 Q 2.5(9J)
-140.11 G(anuary 2015)-2.5 E(9)198.45 E 0 Cg EP
-%%Page: 10 10
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 137.05(mbm_xyplot\(1\) MB-System)72 48 R 137.05
-(5.0 mbm_xyplot\(1\))2.5 F 2.153 -.8(We c)108 84 T .553
-(an specify a comma delimited \214le and con).8 F -.15(ve)-.4 G .553
-(rt the latitude and longitude \214elds to decimal de).15 F .552
-(grees on)-.15 F(the \215y with the follo)108 96 Q(wing:)-.25 E 20.485
-(mbm_xyplot \255ID,:C')120.5 120 R 37.985(substr\(c[5],0,3\)+substr\(c[\
-5],3,length\(c[5]\)\) /60_substr\(c[3],0,2\)+sub-)-.55 F
-(str\(c[3],2,length\(c[3]\)\)/60':gps.ra)108 132 Q(w)-.15 E .098
-(This is about as ugly as it gets. Ho)108 156 R(we)-.25 E -.15(ve)-.25 G
-.898 -.4(r, i).15 H 2.598(ti).4 G 2.598(sq)-2.598 G .098
-(uite straightforw)-2.598 F .098(ard and v)-.1 F .097(ery handy)-.15 F
-2.597(,s)-.65 G 2.597(ol)-2.597 G .097(et us pick this apart.)-2.597 F
-.701(The \255I \215ag speci\214es the \214le to plot and its parameters\
-. The D sub\214eld follo)108 168 R .701(wed by ',)-.25 F 3.201('i)-.7 G
-.701(ndicates the \214le is)-3.201 F 1.453
-(comma delimited. The C sub\214eld follo)108 180 R 1.453
-(wed by the Perl e)-.25 F 1.453(xpression e)-.15 F 1.453
-(xtracts \214elds to plot. There are tw)-.15 F(o)-.1 E -.15(ex)108 192 S
-.53(pressions here, the x v).15 F .53(alues, \(longitude\) and the x v)
--.25 F .53(alues \(latitude\) separated by an "_". In the longitude)-.25
-F -.15(ex)108 204 S .85(pression, the de).15 F .85
-(gree portion of the longitude, which is the 5th \214eld \(c[5]\) is e)
--.15 F .85(xtracted and added to the)-.15 F
-(minute portion of the longitude di)108 216 Q
-(vided by 60. The same is done with the latitude \214eld, \(c[3]\).)-.25
-E 1.35(Note the single quotes surrounding the C e)108 240 R 1.351
-(xpression. These are required to ensure comple)-.15 F 3.851(xe)-.15 G
-(xpressions)-4.001 E(such as these are not inadv)108 252 Q
-(ertently interpreted by the shell.)-.15 E/F1 10.95/Times-Bold at 0 SF
-(SEE ALSO)72 304.8 Q/F2 10/Times-Bold at 0 SF(mbsystem)108 316.8 Q F0
-(\(1\),)A F2(mbcontour)8.408 E F0(\(1\),)A F2(mbswath)8.408 E F0(\(1\),)
-A F2(mbdefaults)8.408 E F0(\(1\),)A F2(mbm_grdplot)8.408 E F0(\(1\),)A
-F2(mbm_grd3dplot)8.408 E F0(\(1\),)A F2(mbm_plot)108 328.8 Q F0(\(1\))A
-F1 -.11(BU)72 357.6 S(GS).11 E F0(Please let us kno)108 369.6 Q -.65(w.)
--.25 G(MB-System 5.0)72 768 Q 2.5(9J)140.11 G(anuary 2015)-2.5 E(10)
-193.45 E 0 Cg EP
-%%Trailer
-end
-%%EOF
diff --git a/src/ps/mbmosaic.ps b/src/ps/mbmosaic.ps
deleted file mode 100644
index fa0e8e7..0000000
--- a/src/ps/mbmosaic.ps
+++ /dev/null
@@ -1,10323 +0,0 @@
-%!PS-Adobe-3.0
-%%Creator: groff version 1.19.2
-%%CreationDate: Wed Jul  1 12:29:29 2015
-%%DocumentNeededResources: font Times-Roman
-%%+ font Times-Bold
-%%+ font Times-Italic
-%%DocumentSuppliedResources: procset grops 1.19 2
-%%Pages: 152
-%%PageOrder: Ascend
-%%DocumentMedia: Default 612 792 0 () ()
-%%Orientation: Portrait
-%%EndComments
-%%BeginDefaults
-%%PageMedia: Default
-%%EndDefaults
-%%BeginProlog
-%%BeginResource: procset grops 1.19 2
-%!PS-Adobe-3.0 Resource-ProcSet
-/setpacking where{
-pop
-currentpacking
-true setpacking
-}if
-/grops 120 dict dup begin
-/SC 32 def
-/A/show load def
-/B{0 SC 3 -1 roll widthshow}bind def
-/C{0 exch ashow}bind def
-/D{0 exch 0 SC 5 2 roll awidthshow}bind def
-/E{0 rmoveto show}bind def
-/F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def
-/G{0 rmoveto 0 exch ashow}bind def
-/H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/I{0 exch rmoveto show}bind def
-/J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def
-/K{0 exch rmoveto 0 exch ashow}bind def
-/L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/M{rmoveto show}bind def
-/N{rmoveto 0 SC 3 -1 roll widthshow}bind def
-/O{rmoveto 0 exch ashow}bind def
-/P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/Q{moveto show}bind def
-/R{moveto 0 SC 3 -1 roll widthshow}bind def
-/S{moveto 0 exch ashow}bind def
-/T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/SF{
-findfont exch
-[exch dup 0 exch 0 exch neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/MF{
-findfont
-[5 2 roll
-0 3 1 roll
-neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/level0 0 def
-/RES 0 def
-/PL 0 def
-/LS 0 def
-/MANUAL{
-statusdict begin/manualfeed true store end
-}bind def
-/PLG{
-gsave newpath clippath pathbbox grestore
-exch pop add exch pop
-}bind def
-/BP{
-/level0 save def
-1 setlinecap
-1 setlinejoin
-72 RES div dup scale
-LS{
-90 rotate
-}{
-0 PL translate
-}ifelse
-1 -1 scale
-}bind def
-/EP{
-level0 restore
-showpage
-}def
-/DA{
-newpath arcn stroke
-}bind def
-/SN{
-transform
-.25 sub exch .25 sub exch
-round .25 add exch round .25 add exch
-itransform
-}bind def
-/DL{
-SN
-moveto
-SN
-lineto stroke
-}bind def
-/DC{
-newpath 0 360 arc closepath
-}bind def
-/TM matrix def
-/DE{
-TM currentmatrix pop
-translate scale newpath 0 0 .5 0 360 arc closepath
-TM setmatrix
-}bind def
-/RC/rcurveto load def
-/RL/rlineto load def
-/ST/stroke load def
-/MT/moveto load def
-/CL/closepath load def
-/Fr{
-setrgbcolor fill
-}bind def
-/setcmykcolor where{
-pop
-/Fk{
-setcmykcolor fill
-}bind def
-}if
-/Fg{
-setgray fill
-}bind def
-/FL/fill load def
-/LW/setlinewidth load def
-/Cr/setrgbcolor load def
-/setcmykcolor where{
-pop
-/Ck/setcmykcolor load def
-}if
-/Cg/setgray load def
-/RE{
-findfont
-dup maxlength 1 index/FontName known not{1 add}if dict begin
-{
-1 index/FID ne{def}{pop pop}ifelse
-}forall
-/Encoding exch def
-dup/FontName exch def
-currentdict end definefont pop
-}bind def
-/DEFS 0 def
-/EBEGIN{
-moveto
-DEFS begin
-}bind def
-/EEND/end load def
-/CNT 0 def
-/level1 0 def
-/PBEGIN{
-/level1 save def
-translate
-div 3 1 roll div exch scale
-neg exch neg exch translate
-0 setgray
-0 setlinecap
-1 setlinewidth
-0 setlinejoin
-10 setmiterlimit
-[]0 setdash
-/setstrokeadjust where{
-pop
-false setstrokeadjust
-}if
-/setoverprint where{
-pop
-false setoverprint
-}if
-newpath
-/CNT countdictstack def
-userdict begin
-/showpage{}def
-/setpagedevice{}def
-}bind def
-/PEND{
-countdictstack CNT sub{end}repeat
-level1 restore
-}bind def
-end def
-/setpacking where{
-pop
-setpacking
-}if
-%%EndResource
-%%EndProlog
-%%BeginSetup
-%%BeginFeature: *PageSize Default
-<< /PageSize [ 612 792 ] /ImagingBBox null >> setpagedevice
-%%EndFeature
-%%IncludeResource: font Times-Roman
-%%IncludeResource: font Times-Bold
-%%IncludeResource: font Times-Italic
-grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72
-def/PL 792 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron/Zcaron
-/scaron/zcaron/Ydieresis/trademark/quotesingle/Euro/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/space/exclam/quotedbl/numbersign/dollar/percent
-/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen
-/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon
-/semicolon/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O
-/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright/circumflex
-/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y
-/z/braceleft/bar/braceright/tilde/.notdef/quotesinglbase/guillemotleft
-/guillemotright/bullet/florin/fraction/perthousand/dagger/daggerdbl
-/endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut
-/dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash
-/quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen
-/brokenbar/section/dieresis/copyright/ordfeminine/guilsinglleft
-/logicalnot/minus/registered/macron/degree/plusminus/twosuperior
-/threesuperior/acute/mu/paragraph/periodcentered/cedilla/onesuperior
-/ordmasculine/guilsinglright/onequarter/onehalf/threequarters
-/questiondown/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE
-/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex
-/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis
-/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn
-/germandbls/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla
-/egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis
-/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide/oslash
-/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis]def
-/Times-Italic at 0 ENC0/Times-Italic RE/Times-Bold at 0 ENC0/Times-Bold RE
-/Times-Roman at 0 ENC0/Times-Roman RE
-%%EndSetup
-%%Page: 1 1
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F/F1 10.95/Times-Bold at 0 SF -.219(NA)72 84 S(ME)
-.219 E/F2 10/Times-Bold at 0 SF(mbmosaic)108 96 Q F0 2.5<ad4d>2.5 G
-(osaic amplitude or sidescan data from sw)-2.5 E
-(ath mapping sonar data \214les.)-.1 E F1(VERSION)72 124.8 Q F0 -1.11
-(Ve)108 136.8 S(rsion 5.0)1.11 E F1(SYNOPSIS)72 165.6 Q F2 1.97
-(mbmosaic \255I)108 177.6 R/F3 10/Times-Italic at 0 SF(\214lelist)A F2
-<ad4f>4.47 E F3 -.45(ro)C(ot).45 E F2([\255A)4.47 E F3(datatype[F])A F2
-<ad42>4.47 E F3(bor)A(der)-.37 E F2<ad43>4.47 E F3(clip)A F2<ad44>4.47 E
-F3(xdim/ydim)A F2<ad45>4.47 E F3(dx/dy/units[!])A F2<ad46>4.47 E F3
-(prior)A(-)-.2 E(ity_r)108 189.6 Q(ang)-.15 E(e[/weight])-.1 E F2<ad47>
-5.502 E F3(gridkind)A F2<ad4a>8.002 E F3(pr)A(ojection)-.45 E F2 3.002
-<ad4820ad4c>5.502 F F3(lon\215ip)A F2 3.003<ad4d20ad4e20ad50>5.503 F F3
-(pings)A F2<ad52>5.503 E F3(west/east/south/north)A F2<ad52>108 201.6 Q
-F3(factor)A F2<ad53>7.746 E F3(speed)A F2<ad54>7.746 E F3(tension)A F2
-<ad55>7.746 E F3(bearing/factor[/mode])A F2 5.246<ad5620ad57>7.746 F F3
-(scale)A F2<ad58>7.745 E F3 -.2(ex)C(tend).2 E F2<ad59>7.745 E F3
-(priority_sour)A(ce)-.37 E F2<ad5a>108 213.6 Q F3(bath_default)A F2(])A
-F1(DESCRIPTION)72 242.4 Q F2(mbmosaic)108 254.4 Q F0 .084(is a utility \
-used to mosaic amplitude or sidescan data contained in a set of sw)2.583
-F .084(ath sonar data \214les.)-.1 F .077(This program allo)108 266.4 R
-.076(ws users to prioritize data according to the associated grazing an\
-gle and according to look)-.25 F .088(azimuth. Indi)108 278.4 R .089
-(vidual mosaic bin v)-.25 F .089(alues can be either the v)-.25 F .089
-(alue of the highest priority sample in the bin or the)-.25 F .649(Gaus\
-sian weighted mean of the highest priority samples in the neighborhood \
-of the bin \(the samples used)108 290.4 R .416(here are those with prio\
-rities within a speci\214ed range of the highest priority sample found\
-\). Users can thus)108 302.4 R .56(construct mosaics which are dominant\
-ly from a particular part of the sw)108 314.4 R .559
-(ath \(e.g. prioritize the outer sw)-.1 F(ath)-.1 E .112
-(higher than the inner sw)108 326.4 R .112(ath\) or which are dominantl\
-y from a particular look azimuth \(e.g. construct an east-)-.1 F
-(looking mosaic by specifying a preferred look azimuth of 90 de)108
-338.4 Q(grees\).)-.15 E .605(The user must specify a \214le containing \
-a list of the data \214les to be used and their data formats \()108
-362.4 R F2<ad49>A F0 .605(\), and a)B .166
-(character string to be used as the root of the output \214lenames \()
-108 374.4 R F2<ad4f>A F0 .166
-(\). The user may specify the bounds of the)B(re)108 386.4 Q .006
-(gion to be gridded \()-.15 F F2<ad52>A F0 .006
-(\), and either the dimensions \()B F2<ad44>A F0 2.506(\)o)C 2.506(rn)
--2.506 G .006(ode spacing)-2.506 F F2<ad45>2.506 E F0 .006
-(of the grid, If the bounds and)2.506 F .78(grid dimensions \(or spacin\
-g\) are not speci\214ed, the program will select the re)108 398.4 R .781
-(gion encompassing all of the)-.15 F .119
-(data in the input \214les and a grid spacing equi)108 410.4 R -.25(va)
--.25 G .118
-(lent to 0.02 times the maximum sonar altitude. If the bounds).25 F .642
-(and grid dimensions \(or spacing\) are not speci\214ed, the program wi\
-ll select the re)108 422.4 R .642(gion encompassing all of)-.15 F .09
-(the data in the input \214les and a grid spacing equi)108 434.4 R -.25
-(va)-.25 G .089
-(lent to 0.02 times the maximum sonar altitude. The auto-).25 F 1.143
-(matically calculated grid bounds will e)108 446.4 R 1.143
-(xactly correspond to the smallest rectangular re)-.15 F 1.143
-(gion including the)-.15 F .556(data unless the user speci\214es a lar)
-108 458.4 R .556(ger re)-.18 F .556(gion using)-.15 F F2<ad52>3.056 E F3
-(factor)A F0 3.056(.T)C .556(he v)-3.056 F(alue)-.25 E F3(factor)3.056 E
-F0 .556(must be greater than one; if)3.056 F F3(factor)108 470.4 Q F0
-3.169(=1)3.169 G .669(.1 then the grid bounds will be e)-3.169 F .669
-(xpanded to the east and west by an amount 0.05 times the data)-.15 F
-.75(bounds east-west e)108 482.4 R .749(xtend and to the north and sout\
-h by an amount 0.05 times the data bounds north-south)-.15 F -.15(ex)108
-494.4 S 3.201(tent. The).15 F .701(input data type \(beam amplitude or \
-sidescan\) is speci\214ed using the)3.201 F F2<ad41>3.202 E F0 .702
-(option. Depending on)3.202 F .636
-(the input datalist, the amplitude or sidescan data may be ra)108 506.4
-R 3.135(wo)-.15 G 3.135(rc)-3.135 G .635(orrected for v)-3.135 F .635
-(ariations in amplitude with)-.25 F .216(grazing angle \(see)108 518.4 R
-F2(mb)2.716 E(backangle)-.1 E F0(and)2.716 E F2(mbpr)2.716 E(ocess)-.18
-E F0 .217(\), and may be un\214ltered or ha)B .517 -.15(ve b)-.2 H .217
-(een \214ltered using).15 F F2(mb\214l-)2.717 E(ter)108 530.4 Q F0 5.237
-(.T)C .236(he user can also specify the range of allo)-5.237 F -.1(wa)
--.25 G .236(ble sample priorities used in the mosaicing \().1 F F2<ad46>
-A F0 .236(\), the pre-)B .04(ferred look azimuth \()108 542.4 R F2<ad55>
-A F0 .041(\), the maximum distance from data points that the spline int\
-erpolation is used \()B F2<ad43>A F0(\),)A
-(the format of the output \214les, and other parameters.)108 554.4 Q
-1.213(By def)108 578.4 R(ault,)-.1 E F2(mbmosaic)3.713 E F0 1.212(gener\
-ates mosiacs in Geographic coordinates, meaning that position is de\214\
-ned in)3.713 F .744
-(longitude and latitude using the WGS84 horizontal datum. The)108 590.4
-R F2<ad4a>3.245 E F0 .745(option can be used to specify an alter)3.245 F
-(-)-.2 E .295(nate, projected coordinate system \(PCS\). When a PCS is \
-used, position will be de\214ned in eastings and nor)108 602.4 R(-)-.2 E
-.262(things \(meters\) relati)108 614.4 R .562 -.15(ve t)-.25 H 2.762
-(ot).15 G .262(he origin of the particular PCS. Uni)-2.762 F -.15(ve)
--.25 G .263(rsal T).15 F(ransv)-.35 E .263
-(erse Mercator is the most com-)-.15 F .313
-(monly used PCS in the oceanographic community)108 626.4 R 2.813(,b)-.65
-G(ut)-3.013 E F2(mbmosaic)2.813 E F0 .312(supports a lar)2.812 F .312
-(ge number of other PCS as)-.18 F(well. A list of the supported PCS')108
-638.4 Q 2.5(si)-.55 G 2.5(sp)-2.5 G(ro)-2.5 E
-(vided at the end of this manual page.)-.15 E .208
-(Before opening an input sw)108 662.4 R .209(ath data \214le,)-.1 F F2
-(mbmosaic)2.709 E F0 .209
-(checks for an ascii \214le in the same directory ha)2.709 F .209
-(ving the)-.2 F .627(same name e)108 674.4 R .626(xcept that ".inf" is \
-appended to the end. The program assumes that this ascii \214le contain\
-s the)-.15 F .487(output of the program)108 686.4 R F2(mbinf)2.988 E(o)
--.25 E F0 .488(run on the input data \214le. If the ".inf" \214le e)
-2.988 F(xists,)-.15 E F2(mbmosaic)2.988 E F0 .488(reads the mini-)2.988
-F .01(mum and maximum longitude and latitude bounds from the)108 698.4 R
-F2(mbinf)2.509 E(o)-.25 E F0 .009(output and compares those to the w)
-2.509 F(ork-)-.1 E .231(ing bounds for the grid. If the ".inf" \214le i\
-ndicates that none of the data in the input \214le lies inside the w)108
-710.4 R(ork-)-.1 E .28
-(ing grid bounds, that input \214le is skipped. This allo)108 722.4 R
-.279(ws users to maintain a single master list of data \214les for)-.25
-F(MB-System 5.0)72 768 Q(13 March 2014)140.11 E(1)198.45 E 0 Cg EP
-%%Page: 2 2
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F .935
-(use in all gridding without the performance penalty of)108 84 R/F1 10
-/Times-Bold at 0 SF(mbmosaic)3.435 E F0 .935
-(reading through all the data \214les, e)3.435 F -.15(ve)-.25 G(n).15 E
-.115(those with no rele)108 96 R -.15(ve)-.25 G .115(nt data. W).15 F
-2.614(er)-.8 G .114
-(ecommend that users maintain a ".inf" \214le for each sw)-2.614 F .114
-(ath data \214le used for)-.1 F 1.312
-(gridding or plotting. The programs)108 108 R F1(mbgrid)3.812 E F0(,)A
-F1(mbswath)3.813 E F0 3.813(,a)C(nd)-3.813 E F1(mbcontour)3.813 E F0
-1.313(also use ".inf" \214les in the same)3.813 F -.1(fa)108 120 S
-(shion.).1 E(Usually)108 144 Q 3.965(,t)-.65 G 1.465(he internal w)
--3.965 F 1.464
-(orking grid has the same boundaries as the output grid. Ho)-.1 F(we)
--.25 E -.15(ve)-.25 G 2.264 -.4(r, t).15 H(he).4 E F1<ad58>3.964 E F0
-(option)3.964 E(allo)108 156 Q 1.05(ws the size of the internal grid to\
- be increased so that data outside the grid can be used to guide the)
--.25 F .283(spline interpolation of data g)108 168 R .282
-(aps which happen to lie at the the edge of the grid.)-.05 F .282
-(This is particularly impor)5.282 F(-)-.2 E .301(tant when adjacent gri\
-ds are created which should match along the edges.)108 180 R .301
-(The data input bounds are set to)5.301 F 3.843(ar)108 192 S -.15(eg)
--3.843 G 1.343(ion three times as lar).15 F 1.342(ge as the w)-.18 F
-1.342(orking grid in both longitude and latitude.)-.1 F 1.342
-(The program reads all)6.342 F .369
-(pings which lie within the data input bounds, and accepts all data v)
-108 204 R .369(alues with locations within the w)-.25 F(orking)-.1 E
-(grid.)108 216 Q .701
-(The sample priorities are set according to three criteria.)108 240 R .7
-(The \214rst criteria is set by using the)5.701 F F1<ad59>3.2 E F0 .7
-(option to)3.2 F .076(specify a \214le containing a list of data priori\
-ties as a function of apparent grazing angle \(this angle is the arc-)
-108 252 R .236(tan\(x/z\) where x is acrosstrack distance and z is dept\
-h, so that the center of the sw)108 264 R .236
-(ath has an apparent graz-)-.1 F .525(ing angle of zero, the port sw)108
-276 R .525(ath edge has a lar)-.1 F .525(ge ne)-.18 F -.05(ga)-.15 G(ti)
-.05 E .825 -.15(ve a)-.25 H .525(ngle, and the starboard sw).15 F .525
-(ath edge has a lar)-.1 F(ge)-.18 E(positi)108 288 Q .3 -.15(ve a)-.25 H
-(ngle\). The highest priority assigned should be one, and the lo).15 E
-(west zero.)-.25 E .402(The second criteria is set by using the)108 312
-R F1<ad55>2.902 E F0 .402
-(option to specify a preferred look azimuth \(data on the port side)
-2.902 F .537(of the sw)108 324 R .537(ath ha)-.1 F .837 -.15(ve a l)-.2
-H .538(ook azimuth equal to the heading \255 90 de).15 F .538
-(grees, and data on the starboard side ha)-.15 F .838 -.15(ve a)-.2 H
-1.091(look azimuth equal to the heading + 90 de)108 336 R 3.591
-(grees\). The)-.15 F 1.09(second parameter in the)3.591 F F1<ad55>3.59 E
-F0 1.09(option is a f)3.59 F 1.09(actor \(f\))-.1 F .478
-(which modulates ho)108 348 R 2.978(wr)-.25 G .478
-(apidly the priority de)-2.978 F .479(grades a)-.15 F -.1(wa)-.15 G
-2.979(yf).1 G .479(rom the preferred look azimuth. The priority \(p\))
--2.979 F(is assigned as follo)108 360 Q(ws:)-.25 E 2.5(p=c)128 372 S
-(os\( f * \(Ap \255 Aa\)\))-2.5 E .141(where Ap is the preferred look a\
-zimuth and Aa is the actual look azimuth. If f = 1.0, the priority will\
- be 1.0)108 384 R .735(at the preferred look azimuth and will f)108 396
-R .736(all to zero for look azimuths more than 90 de)-.1 F .736(grees a)
--.15 F -.1(wa)-.15 G 3.236(yf).1 G .736(rom the)-3.236 F .961(preferred\
- look azimuth. If f > 1.0, the range of nonzero priorities will shrink \
-closer to the preferred look)108 408 R .507(azimuth \(e.g. if f = 2.0, \
-nonzero priorities will be restricted to look azimuths within 45 de)108
-420 R .507(grees of the pre-)-.15 F 1.645(ferred look azimuth\). If f <\
- 1.0, the range of nonzero priorities will e)108 432 R 1.644
-(xpand \(e.g. if f = 0.5, only look)-.15 F(azimuths 180 de)108 444 Q
-(grees a)-.15 E -.1(wa)-.15 G 2.5(yf).1 G
-(rom the preferred look azimuth will ha)-2.5 E .3 -.15(ve a z)-.2 H
-(ero priority\).).15 E .204(The third criteria is set by using the)108
-468 R F1<ad55>2.705 E F0 .205(option to specify a preferred heading.)
-2.705 F .205(The second parameter in the)5.205 F F1<ad55>108 480 Q F0
-.405(option is a f)2.905 F .405(actor \(f\) which modulates ho)-.1 F
-2.905(wr)-.25 G .405(apidly the priority de)-2.905 F .404(grades a)-.15
-F -.1(wa)-.15 G 2.904(yf).1 G .404(rom the preferred head-)-2.904 F
-(ing. The priority \(p\) is assigned as follo)108 492 Q(ws:)-.25 E 2.5
-(p=c)128 504 S(os\( f * \(Hp \255 Ha\)\))-2.5 E .076(where Hp is the pr\
-eferred heading and Ha is the actual heading. If f = 1.0, the priority \
-will be 1.0 at the pre-)108 516 R .108(ferred heading and will f)108 528
-R .107(all to zero for heading more than 90 de)-.1 F .107(grees a)-.15 F
--.1(wa)-.15 G 2.607(yf).1 G .107(rom the heading.)-2.607 F .107
-(If f > 1.0, the)5.107 F .204(range of nonzero priorities will shrink c\
-loser to the preferred heading \(e.g. if f = 2.0, nonzero priorities wi\
-ll)108 540 R .145(be restricted to headings within 45 de)108 552 R .144
-(grees of the preferred heading\). If f < 1.0, the range of nonzero pri\
-ori-)-.15 F .035(ties will e)108 564 R .035
-(xpand \(e.g. if f = 0.5, only headings 180 de)-.15 F .035(grees a)-.15
-F -.1(wa)-.15 G 2.535(yf).1 G .035(rom the preferred heading will ha)
--2.535 F .335 -.15(ve a z)-.2 H(ero).15 E(priority\).)108 576 Q .232(Th\
-e priorities used in the mosaicing are found by multiplying the grazing\
- angle, look azimuth, and heading)108 600 R .454(priorities together)108
-612 R 2.954(.O)-.55 G 2.954(fc)-2.954 G .455(ourse, the priority associ\
-ated with a criteria that is not used because it has not been)-2.954 F
-(speci\214ed will be simply 1.0.)108 624 Q .336(The def)108 648 R .336
-(ault beha)-.1 F .336(vior is to set each bin to the v)-.2 F .335
-(alue of the highest priority sample found in that bin. If more)-.25 F
-.052(than one sample has the same highest priority)108 660 R 2.552(,t)
--.65 G .052(he \214rst such sample is used.)-2.552 F .052(If the)5.052 F
-F1<ad46>2.552 E F0 .053(option is used to set a)2.553 F .564(range of a\
-cceptable priorities, then the mosaicing is done using a Gaussian weigh\
-ted mean algorithm. The)108 672 R .521
-(samples used are those with priorities lar)108 684 R .522
-(ger than the highest priority found minus the range v)-.18 F 3.022
-(alue. In)-.25 F(this)3.022 E .585(scheme, each sample')108 696 R 3.085
-(sc)-.55 G(ontrib)-3.085 E .585(ution to a Gaussian weighted a)-.2 F
--.15(ve)-.2 G .584(rage for each nearby grid cell is calculated).15 F
-(using this weighting function:)108 708 Q(W\(r\) = Ae)144 720 Q
-(xp\(r**2/a**2\))-.15 E(MB-System 5.0)72 768 Q(13 March 2014)140.11 E(2)
-198.45 E 0 Cg EP
-%%Page: 3 3
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F .385(where r is the distance from the center o\
-f the bin to the data point, a is the distance at which the weighting)
-108 84 R 1.336(function f)108 96 R 1.336(alls to 1/e of its maximum v)
--.1 F 1.335(alue, and A is a normalizing f)-.25 F 1.335
-(actor set so that the sum of all the)-.1 F .603(weights adds to a v)108
-108 R .604(alue of 1.)-.25 F(Normally)5.604 E 3.104(,t)-.65 G .604
-(he distance a is set to be half the a)-3.104 F -.15(ve)-.2 G .604
-(rage grid point spacing, b).15 F(ut)-.2 E(this can be v)108 120 Q
-(aried using the)-.25 E/F1 10/Times-Bold at 0 SF<ad57>2.5 E F0(option.)2.5
-E .266(If the weight parameter is used on the)108 144 R F1<ad46>2.766 E
-F0 .266(option then for weight = 0 [def)2.766 F .265(ault] the abo)-.1 F
-.565 -.15(ve w)-.15 H .265(eight is used, for).15 F .864
-(weight = 1 the abo)108 156 R 1.164 -.15(ve w)-.15 H .864
-(eight is multiplied by the sample priority).15 F 3.364(,a)-.65 G .864
-(nd for weight = 2 the abo)-3.364 F 1.164 -.15(ve w)-.15 H .864
-(eight is).15 F .591(multiplied by the square of the sample priority)108
-168 R 5.591(.U)-.65 G(sing)-5.591 E F1(\255F1/1)3.091 E F0 .591
-(causes the priorities to be treated as weights)3.091 F
-(rather than priorities.)108 180 Q .142(If the)108 204 R F1<ad43>2.642 E
-F0 .143(option is used to set clipping to a v)2.643 F .143
-(alue > 0, then a 2D thin plate spline algorithm is applied to the)-.25
-F .447(successfully calculated grid v)108 216 R .447
-(alues to \214ll in, or interpolate, g)-.25 F .446(aps in the data.)-.05
-F(Ne)5.446 E 2.946(wv)-.25 G .446(alues are assigned only)-3.196 F .484
-(at grid points within a speci\214ed distance from the nearest data poi\
-nts \(this distance is speci\214ed in terms of)108 228 R .848
-(grid point spacing using the)108 240 R F1<ad43>3.348 E F0 3.348
-(command\). Thus,)3.348 F .848(small g)3.348 F .848
-(aps in the data can be \214lled, or the whole grid)-.05 F
-(can be \214lled in with a smooth interpolation.)108 252 Q .936
-(The output grid will by def)108 276 R .936(ault contain v)-.1 F .936
-(alues of 99999.9 at cells containing no data; if the)-.25 F F1<ad4e>
-3.437 E F0 .937(option is)3.437 F(used then the \215agging v)108 288 Q
-(alue used is NaN, or not-a-number)-.25 E(.)-.55 E .452(The names of th\
-e output \214les are based on the root character string speci\214ed usi\
-ng the)108 312 R F1<ad4f>2.951 E F0 .451(option. A num-)2.951 F .337(be\
-r of grid formats are supported, including all of the grid formats supp\
-orted by)108 324 R F1(GMT)2.837 E F0 5.338(.S)C .338(ee the)-5.338 F F1
-<ad47>2.838 E F0(option)2.838 E(belo)108 336 Q 2.821(wf)-.25 G .321
-(or a list of the a)-2.821 F -.25(va)-.2 G .321(ilable formats.).25 F
-.321(If the grid is output in an)5.321 F 2.821(yo)-.15 G 2.821(ft)-2.821
-G(he)-2.821 E F1(GMT)2.821 E F0 .321(grid formats, then its \214le-)
-2.821 F .07(name is "root.grd", and a shellscript which will allo)108
-348 R 2.57(wt)-.25 G .07(he contents of the grid to be vie)-2.57 F .07
-(wed using)-.25 F F1(GMT)2.57 E F0(pro-)2.57 E .331
-(grams is also output with the \214lename "root.grd.cmd".)108 360 R .331
-(If the)5.331 F F1<ad47>2.831 E/F2 10/Times-Italic at 0 SF(1)A F0 .33
-(option is used to specify an ascii format)2.83 F
-(grid, then the output grid \214lename will be "root.asc", b)108 372 Q
-(ut no plotting shellscript will be created.)-.2 E 3.016(Ad)108 396 S
-.516(atalist \214le containing references to all of the sw)-3.016 F .517
-(ath \214les actually contib)-.1 F .517
-(uting to the grid is also created.)-.2 F
-(This \214le is named by adding a ".mb-1" suf)108 408 Q
-(\214x to the root string.)-.25 E(The)108 432 Q F1<ad4d>2.848 E F0 .348
-(option causes)2.848 F F1(mbmosaic)2.848 E F0 .347(to output tw)2.848 F
-2.847(oa)-.1 G .347
-(dditional grids, the \214rst \("root_num.grd"\) being the num-)-2.847 F
-1.32(ber of high priority data points used within each bin, and the sec\
-ond \("root_sd.grd"\) being the standard)108 444 R(de)108 456 Q .738
-(viation of the data points used within each bin.)-.25 F(The)5.737 E F1
-<ad4d>3.237 E F0 .737(option can only be used if Gaussian weighted)3.237
-F 2.624(mean mosaicing is enabled with the)108 468 R F1<ad46>5.124 E F0
-5.124(option. Plotting)5.124 F 2.625
-(shellscripts called "root_num.grd.cmd" and)5.124 F
-("root_sd.grd.cmd" are also output if the grids are in a)108 480 Q F1
-(GMT)2.5 E F0(grid format.)2.5 E(The)108 504 Q F1<ad4a>3.78 E F0 1.279(\
-option can be used to specify grids in UTM eastings and northings \(met\
-ers\) rather than in geo-)3.78 F
-(graphic coordinates \(longitude and latitude de)108 516 Q(grees\).)-.15
-E/F3 10.95/Times-Bold at 0 SF -.548(AU)72 544.8 S(THORSHIP).548 E F0(Da)108
-556.8 Q(vid W)-.2 E 2.5(.C)-.92 G(aress \(caress at mbari.or)-2.5 E(g\))
--.18 E(Montere)113 568.8 Q 2.5(yB)-.15 G(ay Aquarium Research Institute)
--2.5 E(Dale N. Chayes \(dale at ldeo.columbia.edu\))108 580.8 Q
-(Lamont-Doherty Earth Observ)113 592.8 Q(atory)-.25 E F3(OPTIONS)72
-621.6 Q F1<ad41>108 633.6 Q F2(datatype)23.08 E F0
-(Sets the type of data to be read and mosaiced.)144 645.6 Q F2(datatype)
-180 657.6 Q F0 2.5(=3)2.5 G 2.5(,a)-2.5 G
-(mplitude data will be mosaiced.)-2.5 E F2(datatype)180 669.6 Q F0 2.5
-(=4)2.5 G 2.5(,s)-2.5 G(idescan data will be mosaiced.)-2.5 E F2
-(datatype)180 681.6 Q F0 2.5(=5)2.5 G 2.5<2c8d>-2.5 G
-(at bottom grazing angle will be mosaiced.)-2.5 E F2(datatype)180 693.6
-Q F0 2.5(=6)2.5 G 2.5(,a)-2.5 G
-(crosstrack grazing angle will be mosaiced.)-2.5 E F2(datatype)180 705.6
-Q F0 2.5(=7)2.5 G 2.5(,a)-2.5 G(crosstrack slope will be mosaiced.)-2.5
-E .241(Mosaicing of bath)144 717.6 R .241
-(ymetry is not supported, and so)-.05 F F2(datatype)2.741 E F0 -.25(va)
-2.741 G .242(lues of 1 \(bath).25 F .242(ymetry\) and 2 \(topog-)-.05 F
-(raph)144 729.6 Q 1.485(y\) are not allo)-.05 F 1.485(wed. Bath)-.25 F
-1.484(ymetry and topograph)-.05 F 3.984(ys)-.05 G 1.484
-(hould be gridded with)-3.984 F F1(mbgrid)3.984 E F0 6.484(.I)C 3.984
-(f")-6.484 G 1.484(F" is)-3.984 F(MB-System 5.0)72 768 Q(13 March 2014)
-140.11 E(3)198.45 E 0 Cg EP
-%%Page: 4 4
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F .238(appended to)144 84 R/F1 10/Times-Italic at 0
-SF(datatype)2.738 E F0 2.738(,t)C(hen)-2.738 E/F2 10/Times-Bold at 0 SF
-(mbmosaic)2.738 E F0 .239
-(will attempt to mosaic amplitude or sidescan data that ha)2.738 F -.15
-(ve)-.2 G .893(been \214ltered with)144 96 R F2(mb\214lter)3.393 E F0
-5.893(.I)C 3.393(ft)-5.893 G .893
-(he desired \214ltered data \214les do not e)-3.393 F .893
-(xist, data input will f)-.15 F .892(ail and)-.1 F F2(mbmosiac)144 108 Q
-F0 1.256(will e)3.756 F 1.256(xit with an error message. Filtered ampli\
-tude data are stored in ancilliary \214les)-.15 F .846(ending with ".f)
-144 120 R -.1(fa)-.25 G .846
-(", and \214ltered sidescan \214les end in ".f).1 F .845
-(fs". Appending "F" to)-.25 F F1(mode)3.345 E F0 -.25(va)3.345 G .845
-(lues of 5-7).25 F(will ha)144 132 Q .3 -.15(ve n)-.2 H 2.5(oe).15 G
--.25(ff)-2.5 G 2.5(ect. Def).25 F(ault:)-.1 E F1(datatype)2.5 E F0 2.5
-(=4\()2.5 G(sidescan\).)-2.5 E F2<ad42>108 148.8 Q F1(bor)23.63 E(der)
--.37 E F0 1.094
-(Sets the border of a smoothly interpolated grid to the v)144 160.8 R
-(alue)-.25 E F1(bor)3.595 E(der)-.37 E F0(where)3.595 E -.15(ve)-.25 G
-3.595(rn).15 G 3.595(od)-3.595 G 1.095(ata e)-3.595 F 1.095(xist, pro-)
--.15 F(vided)144 172.8 Q F1(bor)2.5 E(der)-.37 E F0 2.5(>0)2.5 G 2.5
-(.0. Def)-2.5 F(ault:)-.1 E F1(bor)2.5 E(der)-.37 E F0 2.5(=0)2.5 G(.0)
--2.5 E F2<ad43>108 189.6 Q F1(clip)23.08 E F0 .999
-(Sets the clipping dimension for the spline interpolation. If)144 201.6
-R F1(clip)3.498 E F0 .998(=0 no spline interpolation will be)B 3.048
-(done. If)144 213.6 R F1(clip)3.048 E F0 .549
-(>0 then the spline interpolation will \214ll data g)B .549
-(aps to a distance of)-.05 F F1(clip)3.049 E F0 .549(times the grid)
-3.049 F 2.5(spacing. Def)144 225.6 R(ault:)-.1 E F1(clip)2.5 E F0 2.5
-(=0)2.5 G(.)-2.5 E F2<ad44>108 242.4 Q F1(xdim/ydim)23.08 E F0 1.349
-(Sets the dimensions of the output grid.)144 254.4 R 1.349
-(This option is superceded if the user speci\214es the grid)6.349 F
-(spacing with the)144 266.4 Q F2<ad45>2.5 E F0 2.5(option. Def)2.5 F
-(ault:)-.1 E F1(xdim)5 E F0(=)2.5 E F1(ydim)2.5 E F0 2.5(=1)2.5 G(01.)
--2.5 E F2<ad45>108 283.2 Q F1(dx/dy/units[!])23.63 E F0 .468
-(Sets the grid cell spacing to)144 295.2 R F1(dx)2.968 E F0 .468
-(in longitude and)2.968 F F1(dy)2.968 E F0 .468(in latitude. If)2.968 F
-F1(units)2.968 E F0 .468(is not speci\214ed, the)2.968 F F1(dx)2.968 E
-F0(and)2.968 E F1(dy)144 307.2 Q F0 -.25(va)5.22 G 2.72
-(lues are assumed to be in meters. V).25 F 2.719(alid v)-1.11 F 2.719
-(alues for)-.25 F F1(units)5.219 E F0 2.719(include "km", "meters", and)
-5.219 F("de)144 319.2 Q 2.71(grees". If)-.15 F .21(not in de)2.71 F .21
-(grees, the grid cell spacing v)-.15 F .21(alues are con)-.25 F -.15(ve)
--.4 G .21(rted to de).15 F .21(grees using the central)-.15 F .284
-(latitude of the grid. If)144 331.2 R F1(dy)2.784 E F0 2.784(=0)2.784 G
-.284(.0, then the latitude cell spacing will be set equal to the longit\
-ude cell)-2.784 F .294(spacing \(after con)144 343.2 R -.15(ve)-.4 G
-.294(rsion to de).15 F .294(grees, if necessary\).)-.15 F .294(By def)
-5.294 F .295(ault, the grid spacing is calculated from)-.1 F .019
-(the grid bounds and the grid dimensions. When the user uses the)144
-355.2 R F2<ad45>2.518 E F0 .018(option to set the cell spacings,)2.518 F
-.944(the grid dimensions are calculated using the grid bounds and grid \
-cell spacings. Ho)144 367.2 R(we)-.25 E -.15(ve)-.25 G 1.744 -.4(r, s)
-.15 H(light).4 E 1.41
-(adjustments to the grid cell spacings are usually required to k)144
-379.2 R 1.41(eep the grid bounds as speci\214ed.)-.1 F .1
-(Appending an ! to the end of the)144 391.2 R F2<ad45>2.6 E F0(ar)2.601
-E .101(guments forces)-.18 F F2(mbmosaic)2.601 E F0 .101(to use the e)
-2.601 F .101(xact grid cell spacing)-.15 F -.25(va)144 403.2 S .487
-(lues speci\214ed by adjusting the grid bounds.).25 F(Def)5.486 E .486
-(ault: If neither the)-.1 F F2<ad45>2.986 E F0(or)2.986 E F2<ad44>2.986
-E F0 .486(options are speci-)2.986 F 1.221(\214ed, the program sets the\
- grid cell spacing to be 0.02 times the maximum sonar altitude in the)
-144 415.2 R(input \214les.)144 427.2 Q F2<ad46>108 444 Q F1(priority_r)
-24.19 E(ang)-.15 E(e[/weight])-.1 E F0 -.45(Tu)144 456 S 1.496
-(rns on Gaussian weighted mean mosaicing. The).45 F F1(priority_r)3.995
-E(ang)-.15 E(e)-.1 E F0 -.25(va)3.995 G 1.495(lue determines which data)
-.25 F .164(points are used in the mosaicing. The minimum priority thres\
-hold for each bin is the highest prior)144 468 R(-)-.2 E .284(ity v)144
-480 R .284(alue found among the samples in that bin minus the)-.25 F F1
-(priority_r)2.784 E(ang)-.15 E(e)-.1 E F0 -.25(va)2.784 G 2.784
-(lue. Only).25 F .284(samples with)2.784 F 1.812(priorities greater tha\
-n this threshold are used in the Gaussian weighted mean mosaicing.)144
-492 R(The)6.813 E(def)144 504 Q .986(ault is to simply set each bin')-.1
-F 3.486(sv)-.55 G .986(alue equal to the v)-3.736 F .985
-(alue of the highest priority sample in that)-.25 F 2.817(bin. The)144
-516 R F1(weight)2.817 E F0 -.25(va)2.817 G .317
-(lue, if present, causes priorities to be also used to weight v).25 F
-.318(alues. A)-.25 F F1(weight)2.818 E F0 .318(of 0)2.818 F 1.559
-(\(the def)144 528 R 1.559
-(ault\) indicates priorities are not used as weights. A)-.1 F F1(weight)
-4.059 E F0 1.558(of 1 indicates the Gaussian)4.058 F .686
-(weight of each v)144 540 R .687
-(alue is multiplied by its priority to get the v)-.25 F .687
-(alue weight. A)-.25 F F1(weight)3.187 E F0 .687(of 2 indicates)3.187 F
-1.872(the Gaussian weight of each v)144 552 R 1.872
-(alue is multiplied by the square of its priority to get the v)-.25 F
-(alue)-.25 E(weight.)144 564 Q F2<ad47>108 580.8 Q F1(gridkind)22.52 E
-F0 .37(This option sets the format of the output grid \214le.)144 592.8
-R .371(The def)5.371 F .371(ault is to output a GMT netCDF 4-byte)-.1 F
-.51(\215oat grid.)144 604.8 R .51(The user may specify the grid format \
-either by using an identi\214er number)5.51 F 3.01(,o)-.4 G 3.01(rb)
--3.01 G 3.01(yu)-3.01 G(sing)-3.01 E(the)144 616.8 Q F2(GMT)2.5 E F0
-(grid format syntax, which allo)2.5 E(ws for scaling and of)-.25 E
-(fsets of the data.)-.25 E
-(First, the simple grid format identi\214ers are:)144 640.8 Q F1
-(gridkind)180 652.8 Q F0 2.5(=1)2.5 G 19.69(:A)-2.5 G(SCII table)-19.69
-E F1(gridkind)180 664.8 Q F0 2.5(=2)2.5 G 19.69(:b)-2.5 G
-(inary \214le \()-19.69 E F2(GMT)A F0 -.15(ve)2.5 G
-(rsion 1 GRD \214le\)).15 E F1(gridkind)180 676.8 Q F0 2.5(=3)2.5 G
-19.69(:n)-2.5 G(etCDF \214le \()-19.69 E F2(GMT)A F0 -.15(ve)2.5 G
-(rsion 2 GRD \214le\)).15 E F1(gridkind)180 688.8 Q F0 2.5(=4)2.5 G
-19.69(:A)-2.5 G(rc/Info and ArcV)-19.69 E(ie)-.6 E 2.5(wA)-.25 G
-(SCII grid)-2.5 E F1(gridkind)180 700.8 Q F0 2.5(=1)2.5 G 7.19(00: GMT)
--2.5 F(netCDF 4-byte \215oat format [Def)2.5 E(ault])-.1 E F1(gridkind)
-180 712.8 Q F0 4.907(=1)4.907 G 7.19(01: Nati)-4.907 F 2.707 -.15(ve b)
--.25 H 2.407
-(inary single precision \215oats in scanlines with leading grd).15 F
-(header)144 724.8 Q(MB-System 5.0)72 768 Q(13 March 2014)140.11 E(4)
-198.45 E 0 Cg EP
-%%Page: 5 5
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F/F1 10/Times-Italic at 0 SF(gridkind)180 84 Q F0
-2.5(=1)2.5 G 7.19(02: Nati)-2.5 F .3 -.15(ve b)-.25 H(inary short inte)
-.15 E(gers in scanlines with leading grd header)-.15 E F1(gridkind)180
-96 Q F0 2.5(=1)2.5 G 7.19(03: 8-bit)-2.5 F
-(standard Sun raster\214le \(colormap ignored\))2.5 E F1(gridkind)180
-108 Q F0 2.5(=1)2.5 G 7.19(04: Nati)-2.5 F .3 -.15(ve b)-.25 H
-(inary unsigned char in scanlines with leading grd header).15 E F1
-(gridkind)180 120 Q F0 2.5(=1)2.5 G 7.19(05: Nati)-2.5 F .3 -.15(ve b)
--.25 H(inary bits in scanlines with leading grd header).15 E F1
-(gridkind)180 132 Q F0 2.5(=1)2.5 G 7.19(06: Nati)-2.5 F .3 -.15(ve b)
--.25 H(inary `).15 E(`surfer')-.74 E 2.5('g)-.74 G(rid \214les)-2.5 E F1
-(gridkind)180 144 Q F0 2.5(=1)2.5 G 7.19(07: netCDF)-2.5 F
-(1-byte byte format)2.5 E F1(gridkind)180 156 Q F0 2.5(=1)2.5 G 7.19
-(08: netCDF)-2.5 F(1-byte char format)2.5 E F1(gridkind)180 168 Q F0 2.5
-(=1)2.5 G 7.19(09: netCDF)-2.5 F(2-byte int format)2.5 E F1(gridkind)180
-180 Q F0 2.5(=1)2.5 G 7.19(10: netCDF)-2.5 F(4-byte int format)2.5 E F1
-(gridkind)180 192 Q F0 2.5(=1)2.5 G 7.19(11: netCDF)-2.5 F
-(8-byte double format)2.5 E(Second, a)144 216 Q/F2 10/Times-Bold at 0 SF
-(GMT)2.5 E F0(grid format string has the form:)2.5 E(=id[/scale/of)180
-228 Q(fset[/nan]])-.25 E .247(where id is the)144 240 R F2(GMT)2.747 E
-F0 .246(format id, and the other v)2.747 F .246(alues are optional. If)
--.25 F F1(scale)2.746 E F0(and)2.746 E F1(of)2.746 E(fset)-.18 E F0 .246
-(are gi)2.746 F -.15(ve)-.25 G .246(n, the).15 F .696
-(data will be multiplied by)144 252 R F1(scale)3.196 E F0 .697(and of)
-3.196 F .697(fset by)-.25 F F1(of)3.197 E(fset)-.18 E F0 .697
-(prior to being output. The)3.197 F F1(nan)3.197 E F0 -.25(va)3.197 G
-.697(lue sets the).25 F -.25(va)144 264 S
-(lue used for "not-a-number". The).25 E F2(GMT)2.5 E F0(format id')2.5 E
-2.5(sf)-.55 G(or these format strings are:)-2.5 E F1(id)180 276 Q F0 2.5
-(=0)2.5 G 9.8(:G)-2.5 G(MT netCDF 4-byte \215oat format [Def)-9.8 E
-(ault])-.1 E F1(id)180 288 Q F0 2.5(=1)2.5 G 9.8(:N)-2.5 G(ati)-9.8 E .3
--.15(ve b)-.25 H
-(inary single precision \215oats in scanlines with leading grd header)
-.15 E F1(id)180 300 Q F0 2.5(=2)2.5 G 9.8(:N)-2.5 G(ati)-9.8 E .3 -.15
-(ve b)-.25 H(inary short inte).15 E
-(gers in scanlines with leading grd header)-.15 E F1(id)180 312 Q F0 2.5
-(=3)2.5 G 9.8(:8)-2.5 G
-(-bit standard Sun raster\214le \(colormap ignored\))-9.8 E F1(id)180
-324 Q F0 2.5(=4)2.5 G 9.8(:N)-2.5 G(ati)-9.8 E .3 -.15(ve b)-.25 H
-(inary unsigned char in scanlines with leading grd header).15 E F1(id)
-180 336 Q F0 2.5(=5)2.5 G 9.8(:N)-2.5 G(ati)-9.8 E .3 -.15(ve b)-.25 H
-(inary bits in scanlines with leading grd header).15 E F1(id)180 348 Q
-F0 2.5(=6)2.5 G 9.8(:N)-2.5 G(ati)-9.8 E .3 -.15(ve b)-.25 H(inary `).15
-E(`surfer')-.74 E 2.5('g)-.74 G(rid \214les)-2.5 E F1(id)180 360 Q F0
-2.5(=7)2.5 G 9.8(:n)-2.5 G(etCDF 1-byte byte format)-9.8 E F1(id)180 372
-Q F0 2.5(=8)2.5 G 9.8(:n)-2.5 G(etCDF 1-byte char format)-9.8 E F1(id)
-180 384 Q F0 2.5(=9)2.5 G 9.8(:n)-2.5 G(etCDF 2-byte int format)-9.8 E
-F1(id)180 396 Q F0 2.5(=1)2.5 G 2.3(0: netCDF)-2.5 F(4-byte int format)
-2.5 E F1(id)180 408 Q F0 2.5(=1)2.5 G 2.3(1: netCDF)-2.5 F
-(8-byte double format)2.5 E 2.324(Note that the follo)144 420 R 2.324
-(wing ar)-.25 F 2.324(guments are equi)-.18 F -.25(va)-.25 G 2.324
-(lent because the).25 F 4.824(ya)-.15 G 2.324(ll produce a standard)
--4.824 F F2(GMT)4.823 E F0(netCDF 4-byte \215oat grid:)144 432 Q F2
-<ad47>180 444 Q F1(3)A F2<ad47>180 456 Q F1(100)A F2<ad47>180 468 Q F1
-(=0)A F0 .834(Should the user wish to produce a grid in nati)144 480 R
-1.134 -.15(ve b)-.25 H .835(inary \215oats, then the follo).15 F .835
-(wing tw)-.25 F 3.335(oa)-.1 G -.18(rg)-3.335 G(uments).18 E(will w)144
-492 Q(ork:)-.1 E F2<ad47>180 504 Q F1(101)A F2<ad47>180 516 Q F1(=1)A F0
-.077(Should the user wish to produce a grid in nati)144 528 R .377 -.15
-(ve s)-.25 H .076(hort int format with a scaling f).15 F .076
-(actor of 10, an of)-.1 F(f-)-.25 E(set of 32000, and a NaN v)144 540 Q
-(alue of 32767, then the follo)-.25 E(wing ar)-.25 E(guments will suf)
--.18 E(\214ce:)-.25 E F2<ad47>180 552 Q F1(=2/10/32000/32767)A F0(If)144
-576 Q F1(gridkind)2.773 E F0 2.773(=3o)2.773 G(r)-2.773 E F1(gridkind)
-2.773 E F0 .273(>= 100,)2.773 F F2(mbgrid)2.773 E F0 .273
-(also outputs shellscripts which run)2.773 F F2(GMT)2.773 E F0 .274
-(programs to)2.774 F(pro)144 588 Q .504(vide preliminary color \214ll m\
-aps of the gridded data. These shellscripts are generated using the)-.15
-F F2(mbm_grdplot)144 600 Q F0(macro.)2.5 E(If)144 624 Q F1(gridkind)
-2.981 E F0 2.981(=4)2.981 G 2.981(,t)-2.981 G .481
-(he output grids will be in the Arc/Info ASCII grid format.)-2.981 F
-.482(Arc/Info ASCII grids)5.482 F 1.396(use "square" bins, meaning that\
- the longitude and latitude grid cell spacings must be identical.)144
-636 R .58(Thus, whene)144 648 R -.15(ve)-.25 G 3.08(rt).15 G(he)-3.08 E
-F1(gridkind)3.08 E F0 3.08(=4o)3.08 G .58(ption is used, the)-3.08 F F2
-<ad45>3.08 E F0 .58(option must also be used in a w)3.08 F .58(ay which)
--.1 F(ensures equal grid cell spacings \(see the)144 660 Q F2<ad45>2.5 E
-F0(documentation abo)2.5 E -.15(ve)-.15 G 2.5(\). Def).15 F(ault:)-.1 E
-F1(gridkind)2.5 E F0 2.5(=1)2.5 G(00.)-2.5 E F2<ad48>108 676.8 Q F0 .162
-(This "help" \215ag cause the program to print out a description of its\
- operation and then e)22.52 F .161(xit immedi-)-.15 F(ately)144 688.8 Q
-(.)-.65 E F2<ad49>108 705.6 Q F1(datalist)26.41 E F0 .572
-(Sets the \214lename of the \214le containing a list of the input sw)144
-717.6 R .573(ath sonar data \214les and their formats.)-.1 F(In the)144
-729.6 Q F1(datalist)2.5 E F0(\214le, each data \214le should be follo)
-2.5 E(wed by a data format identi\214er)-.25 E 2.5(,e)-.4 G(.g.:)-2.5 E
-(MB-System 5.0)72 768 Q(13 March 2014)140.11 E(5)198.45 E 0 Cg EP
-%%Page: 6 6
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(data\214le1 11)180 84 Q(data\214le2 24)180 96 Q
-.569(This program uses the)144 108 R/F1 10/Times-Bold at 0 SF(MBIO)3.068 E
-F0 .568(library and will read or write an)3.068 F 3.068(ys)-.15 G -.1
-(wa)-3.068 G .568(th sonar format supported by).1 F F1(MBIO)144 120 Q F0
-3.428(.Al)C .928(ist of the sw)-3.428 F .928
-(ath sonar data formats currently supported by)-.1 F F1(MBIO)3.428 E F0
-.928(and their identi\214er)3.428 F -.25(va)144 132 S(lues is gi).25 E
--.15(ve)-.25 G 2.5(ni).15 G 2.5(nt)-2.5 G(he)-2.5 E F1(MBIO)2.5 E F0
-(manual page.)2.5 E(Def)5 E(ault:)-.1 E/F2 10/Times-Italic at 0 SF
-(datalist)2.5 E F0 2.5(=d)2.5 G(atalist.mb-1)-2.5 E F1<ad4a>108 148.8 Q
-F2(pr)25.3 E(ojection)-.45 E F0 .225(By def)2.725 F(ault,)-.1 E F1
-(mbgrid)2.725 E F0 .225
-(generates grids in Geographic coordinates, meaning that position is)
-2.725 F .517(de\214ned in longitude and latitude using the WGS84 geogra\
-phic coordinate system.)144 160.8 R(The)5.517 E F1<ad4a>3.017 E F0
-(option)3.017 E .223(can be used to specify an alternate, projected coo\
-rdinate system \(PCS\). When a PCS is used, posi-)144 172.8 R .489
-(tion will be de\214ned in eastings and northings \(meters\) relati)144
-184.8 R .789 -.15(ve t)-.25 H 2.989(ot).15 G .489
-(he origin of the particular PCS.)-2.989 F(Uni)144 196.8 Q -.15(ve)-.25
-G .379(rsal T).15 F(ransv)-.35 E .378(erse Mercator is the most commonl\
-y used PCS in the oceanographic community)-.15 F(,)-.65 E -.2(bu)144
-208.8 S(t).2 E F1(mbgrid)3.037 E F0 .537(supports a lar)3.037 F .537
-(ge number of other PCS')-.18 F 3.037(sa)-.55 G 3.037(sw)-3.037 G 3.037
-(ell. The)-3.037 F .538(underlying projection functions)3.037 F(deri)144
-220.8 Q .3 -.15(ve f)-.25 H(rom the).15 E F1(PR)2.5 E(OJ)-.3 E(.4)-.2 E
-F0(library written by Gerald Ev)2.5 E
-(enden, then of the U.S. Geological Surv)-.15 E -.15(ey)-.15 G(.)-.5 E
-(The)144 244.8 Q F2(pr)2.944 E(ojection)-.45 E F0(ar)2.944 E .443
-(gument for the)-.18 F F1<ad4a>2.943 E F0 .443
-(option can be either a PCS identi\214er from the projection de\214-)
-2.943 F .442(nition list pro)144 256.8 R .443
-(vided at the end of this manual page, or simply)-.15 F F1<ad4a>2.943 E
-F2(U)A F0 .443(to specify using UTM in what-)2.943 F -2.15 -.25(ev e)144
-268.8 T 2.5(rz).25 G
-(one is appropriate for the grid bounds speci\214ed with the)-2.5 E F1
-<ad52>2.5 E F0(option.)2.5 E -.15(Fo)144 292.8 S 3.249(ri).15 G .749
-(nstance, to fully specify a particular northern UTM zone, set)-3.249 F
-F2(pr)3.248 E(ojection)-.45 E F0 3.248(=U)3.248 G .748(TMXXN where)
--3.248 F .121(XX gi)144 304.8 R -.15(ve)-.25 G 2.621(st).15 G .122
-(he UTM zone \(de\214ned from 01 to 60\). As an e)-2.621 F .122
-(xample, a northern UTM zone 12 projec-)-.15 F 1.267
-(tion can be speci\214ed using)144 316.8 R F1<ad4a>3.766 E F2(UTM12N)A
-F0 6.266(.S)C 1.266(outhern UTM zones are speci\214ed as UTMXXS. The)
--6.266 F .616(European Petroleum Surv)144 328.8 R .917 -.15(ey G)-.15 H
-.617(roup \(EPSG\) has de\214ned a lar).15 F .617(ge number of PCS')-.18
-F 3.117(su)-.55 G .617(sed w)-3.117 F(orldwide)-.1 E .032
-(and assigned number id')144 340.8 R 2.532(st)-.55 G 2.532(oe)-2.532 G
-.032
-(ach; one can also specify the northern UTM zone 12 projection using)
--2.532 F .976(its EPSG designation, or)144 352.8 R F1<ad4a>3.476 E F2
-(epsg32612)A F0 5.977(.W)C .977
-(hen the projected coordinate system is fully speci\214ed)-5.977 F .501
-(by the)144 364.8 R F1<ad4a>3.001 E F0 .501
-(option, then the grid bounds may be speci\214ed using)3.001 F F1<ad52>3
-E F0 .5(in either longitude and latitude)3 F
-(or in eastings and northings.)144 376.8 Q(Alternati)144 400.8 Q -.15
-(ve)-.25 G(ly).15 E 3.393(,o)-.65 G .894
-(ne may indicate a UTM projection without specifying the zone by using)
--3.393 F F1<ad4a>3.394 E F2(U)A F0 3.394(.I)C(n)-3.394 E .361(this case\
-, the UTM zone will be inferred from the midpoint of the speci\214ed lo\
-ngitude and latitude)144 412.8 R 1.308
-(bounds, and then the longitude and latitude bounds gi)144 424.8 R -.15
-(ve)-.25 G 3.808(nw).15 G 1.308(ith the)-3.808 F F1(\255fR)3.808 E F0
-1.308(option are translated to)3.808 F(UTM eastings and northings.)144
-436.8 Q .923(All grids and mosaics produced by)144 460.8 R F1(MB-System)
-3.423 E F0 .922(programs contain identi\214ers that are recognized)3.422
-F 3.167(by the plotting macros)144 472.8 R F1(mbm_grdplot)5.668 E F0(,)A
-F1(mbm_grd3dplot)5.668 E F0 5.668(,a)C(nd)-5.668 E F1(mbm_grdtiff)5.668
-E F0 8.168(.T)C 3.168(hese plotting)-8.168 F .403
-(macros automatically use a linear map projection whene)144 484.8 R -.15
-(ve)-.25 G 2.903(rt).15 G(he)-2.903 E 2.903(ye)-.15 G .403
-(ncounter grids and mosaics that)-2.903 F 1.062
-(are already in a projected coordinate system. Also, the program)144
-496.8 R F1(mbgrdtiff)3.562 E F0 1.062(automatically inserts)3.562 F .786
-(the appropriate projection information into the GeoTIFF images it gene\
-rates. As a result, images)144 508.8 R .146(generated by)144 520.8 R F1
-(mbgrdtiff)2.647 E F0 .147(will be properly georeferenced when the)2.647
-F 2.647(ya)-.15 G .147(re imported into GIS softw)-2.647 F(are.)-.1 E F1
-<ad4c>108 537.6 Q F2(lon\215ip)23.63 E F0 .572
-(Sets the range of the longitude v)144 549.6 R .572(alues returned.)-.25
-F(If)5.572 E F2(lon\215ip)3.072 E F0 .572(=\2551 then the longitude v)B
-.571(alues will be in)-.25 F .488(the range from \255360 to 0 de)144
-561.6 R .488(grees. If)-.15 F F2(lon\215ip)2.988 E F0 .488
-(=0 then the longitude v)B .489(alues will be in the range from)-.25 F
-1.383(\255180 to 180 de)144 573.6 R 1.383(grees. If)-.15 F F2(lon\215ip)
-3.882 E F0 1.382(=1 then the longitude v)B 1.382
-(alues will be in the range from 0 to 360)-.25 F(de)144 585.6 Q 2.5
-(grees. Def)-.15 F(ault:)-.1 E F2(lon\215ip)2.5 E F0 2.5(=0)2.5 G(.)-2.5
-E F1<ad4d>108 602.4 Q F0 1.11(Causes tw)20.86 F 3.61(oa)-.1 G 1.111
-(dditional grids to be output. One is a grid containing the standard de)
--3.61 F 1.111(viation of the)-.25 F .234
-(data within each grid cell relati)144 614.4 R .534 -.15(ve t)-.25 H
-2.734(ot).15 G .234(he grid v)-2.734 F .234
-(alue, the other contains the number of data points in)-.25 F 1.285(eac\
-h grid cell. This option is ignored unless the Gaussian weighted mean m\
-osaicing is enabled)144 626.4 R(with the)144 638.4 Q F1(-F)2.5 E F0
-(option.)2.5 E F1<ad4e>108 655.2 Q F0 1.458
-(Causes grid cells with no data and no interpolation to be set to a v)
-23.08 F 1.457(alue of NaN instead of the)-.25 F(def)144 667.2 Q(ault v)
--.1 E(alue of 99999.9.)-.25 E(The NaN v)5 E(alue is e)-.25 E(xpected by)
--.15 E F1(GMT)2.5 E F0(programs such)2.5 E F1(grdview)2.5 E F0(.)A F1
-<ad4f>108 684 Q F2 -.45(ro)22.52 G(ot).45 E F0 .524(Sets the character \
-string to be used as the root of the output \214lenames. F)144 696 R
-.524(or e)-.15 F .525(xample, if the grid is)-.15 F .074(output as a)144
-708 R F1(GMT)2.574 E F0 -.15(ve)2.574 G .074
-(rsion 2 GRD format \(netCDF\) \214le \(the def).15 F .073
-(ault\), then its \214lename is "root.grd".)-.1 F 1.268(If the)144 720 R
-F1<ad47>3.768 E F2(1)A F0 1.268(option is used to specify an ascii form\
-at grid, then the output grid \214lename will be)3.768 F(MB-System 5.0)
-72 768 Q(13 March 2014)140.11 E(6)198.45 E 0 Cg EP
-%%Page: 7 7
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F .084("root.asc". If the)144 84 R/F1 10
-/Times-Bold at 0 SF<ad47>2.584 E/F2 10/Times-Italic at 0 SF(2)A F0 .084
-(option is used to specify a v)2.584 F .084
-(ersion 1 GRD format \(binary\) grid, then the out-)-.15 F .831
-(put grid \214lename will be "root.grd1". If the output grid is in the)
-144 96 R F1(GMT)3.331 E F0 -.15(ve)3.331 G .831(rsion 2 GRD format, a)
-.15 F .165(shellscript which will allo)144 108 R 2.665(wt)-.25 G .164
-(he contents of the grid to vie)-2.665 F .164(wed using)-.25 F F1(GMT)
-2.664 E F0 .164(programs is also output)2.664 F
-(with the \214lename "root.grd.cmd".)144 120 Q F1<ad50>108 136.8 Q F2
-(pings)24.19 E F0 .009(Sets the ping a)144 148.8 R -.15(ve)-.2 G .009
-(raging of the input data. If).15 F F2(pings)2.509 E F0 2.51(>0)2.509 G
-2.51(,t)-2.51 G .01(hen that number of input pings will be a)-2.51 F
--.15(ve)-.2 G -.2(r-).15 G .306(aged to produce one output ping.)144
-160.8 R(If)5.306 E F2(pings)2.806 E F0 2.806(=0)2.806 G 2.806(,t)-2.806
-G .306(hen the ping a)-2.806 F -.15(ve)-.2 G .306
-(raging will automatically be done).15 F(so that the along-track ping s\
-pacing is equal to the across-track beam spacing. Def)144 172.8 Q(ault:)
--.1 E F2(pings)2.5 E F0 2.5(=1)2.5 G(.)-2.5 E F1<ad52>108 189.6 Q F2
-(west/east/south/north)23.08 E(factor)144 201.6 Q F0 2.431(The \214rst \
-form sets the longitude and latitude bounds of the output grid.)144
-213.6 R 2.432(By def)7.432 F 2.432(ault \(if the)-.1 F F1<ad52>144 225.6
-Q F2(west/east/south/north)A F0 .003(option is not speci\214ed\) the pr\
-ogram will set the grid bounds to be the area)2.503 F .367
-(encompassing all of the data in the input \214les. The second form \()
-144 237.6 R F1<ad52>A F2(factor)A F0 2.867(\)e)C .367
-(xpands the automati-)-3.017 F .737
-(cally calculated bounds by the multiplicati)144 249.6 R -.15(ve)-.25 G
-F2(factor)3.387 E F0 .736(.The v)B(alue)-.25 E F2(factor)3.236 E F0 .736
-(must be greater than one; if)3.236 F F2(factor)144 261.6 Q F0 3.127(=1)
-3.127 G .628(.1 then the grid bounds will be e)-3.127 F .628
-(xpanded to the east and west by an amount 0.05 times)-.15 F 1.345
-(the data bounds east-west e)144 273.6 R 1.345
-(xtend and to the north and south by an amount 0.05 times the data)-.15
-F .485(bounds north-south e)144 285.6 R 2.986(xtent. If)-.15 F .486
-(the user uses the)2.986 F F1<ad45>2.986 E F0 .486
-(option to set the grid spacing, then the dimen-)2.986 F .414(sions wil\
-l be calculated from the grid bounds and spacing. In these circumstance\
-s rounding errors)144 297.6 R 1.047(will usually require that the easte\
-rn and northern bounds be adjusted to \214t e)144 309.6 R 1.047
-(xactly with the grid)-.15 F .706(dimensions and spacing.)144 321.6 R
-(Def)5.706 E .706(ault: If the)-.1 F F1<ad52>3.206 E F2
-(west/east/south/north)A F0 .706(option is not speci\214ed, the pro-)
-3.206 F(gram will set the grid bounds to be the area encompassing all o\
-f the data in the input \214les.)144 333.6 Q F1<ad53>108 350.4 Q F2
-(speed)24.74 E F0 .532
-(Sets the minimum speed in km/hr \(5.5 kts ~ 10 km/hr\) allo)144 362.4 R
-.532(wed in the input data; pings associated)-.25 F
-(with a smaller ship speed will not be output. Def)144 374.4 Q(ault:)-.1
-E F2(speed)2.5 E F0 2.5(=0)2.5 G(.)-2.5 E F1<ad54>108 391.2 Q F2
-(tension)23.63 E F0 .441(Sets the)144 403.2 R F2(tension)2.941 E F0 -.25
-(va)2.941 G .441(lue used in the thin plate spline interpolation.).25 F
-(A)5.44 E F2(tension)2.94 E F0 .44(of 0 gi)2.94 F -.15(ve)-.25 G 2.94
-(sam).15 G(inimum)-2.94 E(curv)144 415.2 Q 1.243(ature surf)-.25 F 1.243
-(ace with free edges; this is a pure Laplacian solution. A nonzero)-.1 F
-F2(tension)3.744 E F0 1.244(tends to)3.744 F .853
-(suppress spurious oscillations and \215atten the interpolation to)144
-427.2 R -.1(wa)-.25 G .853(rd the edges; a).1 F F2(tension)3.353 E F0
-.853(of in\214nity)3.353 F .31(yields a pure spline solution. The)144
-439.2 R F2(tension)2.81 E F0 .31(must be zero or greater)2.81 F 5.31(.D)
--.55 G(ef)-5.31 E(ault:)-.1 E F2(tension)2.81 E F0 2.81(=1)2.81 G .31
-(.0e10 \(pure)-2.81 F(spline solution\).)144 451.2 Q F1<ad55>108 468 Q
-F2(bearing/factor[/mode])23.08 E F0 .384(Enables prioritizing data poin\
-ts according to their look azimuth or to the platform heading at ping)
-144 480 R(time.)144 492 Q(If)144 516 Q F2(mode)3.128 E F0 -5.627 3.128
-(=0 o)3.128 H 3.129(ri)-3.128 G 3.129(sa)-3.129 G .629
-(bsent, then the look azimuth criteria is applied, with)-3.129 F F2
-(bearing)3.129 E F0 .629(being interpreted)3.129 F .781
-(as the desired look azimuth. Data on the port side of the sw)144 528 R
-.781(ath ha)-.1 F 1.081 -.15(ve a l)-.2 H .781(ook azimuth equal to the)
-.15 F .68(heading \255 90 de)144 540 R .68
-(grees, and data on the starboard side ha)-.15 F .98 -.15(ve a l)-.2 H
-.68(ook azimuth equal to the heading +).15 F .055(90 de)144 552 R .055
-(grees\). The)-.15 F F2(factor)2.555 E F0 -.25(va)2.555 G .054
-(lue modulates ho).25 F 2.554(wr)-.25 G .054(apidly the priority de)
--2.554 F .054(grades a)-.15 F -.1(wa)-.15 G 2.554(yf).1 G .054
-(rom the preferred)-2.554 F
-(look azimuth. The priority \(p\) for a data point is assigned as follo)
-144 564 Q(ws:)-.25 E 2.5(p=c)164 576 S(os\(f * \(Ap \255 Aa\)\))-2.5 E
-(when \25590 < \(f * \(Ap \255 Aa\)\) < 90 and)144 588 Q 2.5(p=0)164 600
-S .397(otherwise, where f =)144 612 R F2(factor)2.898 E F0 2.898(,A)C
-2.898(p=)-2.898 G F2(bearing)A F0 2.898(,a)C .398
-(nd Aa is the actual look azimuth of the data point.)-2.898 F(If)5.398 E
-F2(factor)144 624 Q F0 2.594(=1)2.594 G .094
-(.0, the priority will be 1.0 at)-2.594 F F2(bearing)2.594 E F0 .094
-(and will f)2.594 F .094(all to zero for look azimuths more than 90)-.1
-F(de)144 636 Q .92(grees a)-.15 F -.1(wa)-.15 G 3.42(yf).1 G(rom)-3.42 E
-F2(bearing)3.42 E F0 5.92(.I)C(f)-5.92 E F2(factor)3.42 E F0 3.42(>1)
-3.42 G .92(.0, the range of nonzero priorities will shrink closer to)
--3.42 F F2(bearing)144 648 Q F0 2.082(\(e.g. if)4.582 F F2(factor)4.582
-E F0 4.582(=2)4.582 G 2.081
-(.0, nonzero priorities will be restricted to look azimuths within 45)
--4.582 F(de)144 660 Q .02(grees of)-.15 F F2(bearing)2.52 E F0 .02
-(\). If)B F2(factor)2.52 E F0 2.52(<1)2.52 G .021
-(.0, the range of nonzero priorities will e)-2.52 F .021
-(xpand \(e.g. if)-.15 F F2(factor)2.521 E F0 2.521(=0)2.521 G(.5,)-2.521
-E(only look azimuths 180 de)144 672 Q(grees a)-.15 E -.1(wa)-.15 G 2.5
-(yf).1 G(rom)-2.5 E F2(bearing)2.5 E F0(will ha)2.5 E .3 -.15(ve a z)-.2
-H(ero priority\).).15 E(If)144 696 Q F2(mode)2.526 E F0 2.526(=1t)2.526
-G .026(hen the heading criteria is applied, with)-2.526 F F2(bearing)
-2.526 E F0 .026(being interpreted as the desired head-)2.526 F .677
-(ing. The)144 708 R F2(factor)3.177 E F0 -.25(va)3.178 G .678
-(lue modulates ho).25 F 3.178(wr)-.25 G .678(apidly the priority de)
--3.178 F .678(grades a)-.15 F -.1(wa)-.15 G 3.178(yf).1 G .678
-(rom the preferred head-)-3.178 F
-(ing. The priority \(p\) for a data point is assigned as follo)144 720 Q
-(ws:)-.25 E(MB-System 5.0)72 768 Q(13 March 2014)140.11 E(7)198.45 E 0
-Cg EP
-%%Page: 8 8
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F 2.5(p=c)164 84 S(os\(f * \(Hp \255 Ha\)\))-2.5
-E(when \25590 < \(f * \(Hp \255 Ha\)\) < 90 and)144 96 Q 2.5(p=0)164 108
-S .106(otherwise, where f =)144 120 R/F1 10/Times-Italic at 0 SF(factor)
-2.606 E F0 2.606(,A)C 2.606(p=)-2.606 G F1(bearing)A F0 2.606(,a)C .106
-(nd Aa is the actual heading of the data point.)-2.606 F(If)5.105 E F1
-(factor)2.605 E F0 3.353(=1)144 132 S .853
-(.0, the priority will be 1.0 at)-3.353 F F1(bearing)3.354 E F0 .854
-(and will f)3.354 F .854(all to zero for headings more than 90 de)-.1 F
-(grees)-.15 E -2.3 -.15(aw a)144 144 T 3.375(yf).15 G(rom)-3.375 E F1
-(bearing)3.375 E F0 5.875(.I)C(f)-5.875 E F1(factor)3.375 E F0 3.375(>1)
-3.375 G .875(.0, the range of nonzero priorities will shrink closer to)
--3.375 F F1(bearing)3.375 E F0 .156(\(e.g. if)144 156 R F1(factor)2.656
-E F0 2.657(=2)2.657 G .157
-(.0, nonzero priorities will be restricted to headings within 45 de)
--2.657 F .157(grees of)-.15 F F1(bearing)2.657 E F0(\).)A(If)144 168 Q
-F1(factor)2.928 E F0 2.928(<1)2.928 G .428
-(.0, the range of nonzero priorities will e)-2.928 F .428
-(xpand \(e.g. if)-.15 F F1(factor)2.928 E F0 2.927(=0)2.928 G .427
-(.5, only headings 180)-2.927 F(de)144 180 Q(grees a)-.15 E -.1(wa)-.15
-G 2.5(yf).1 G(rom)-2.5 E F1(bearing)2.5 E F0(will ha)2.5 E .3 -.15
-(ve a z)-.2 H(ero priority\).).15 E/F2 10/Times-Bold at 0 SF<ad56>108 196.8
-Q F0(Normally)23.08 E(,)-.65 E F2(mbmosaic)2.691 E F0 .191
-(prints out information re)2.691 F -.05(ga)-.15 G .191
-(rding its controlling parameters during e).05 F -.15(xe)-.15 G(cution;)
-.15 E(the)144 208.8 Q F2<ad56>2.5 E F0(option causes the program to als\
-o print out statements indicating its progress.)2.5 E F2<ad57>108 225.6
-Q F1(scale)20.3 E F0 .179(Sets the width of the g)144 237.6 R .178
-(aussian weighting function in terms of the grid spacing.)-.05 F .178
-(The distance to the)5.178 F .303
-(1/e point of the weighting function is gi)144 249.6 R -.15(ve)-.25 G
-2.803(nb).15 G 2.803(yh)-2.803 G .303(alf of the grid spacing times)
--2.803 F F1(scale)2.803 E F0 5.303(.D)C(ef)-5.303 E(ault:)-.1 E F1
-(scale)2.803 E F0 2.5(=1)144 261.6 S(.0)-2.5 E F2<ad58>108 278.4 Q F1
--.2(ex)23.08 G(tend).2 E F0 .646(Extends the size of the internal grid \
-so that the output grid is a subset from the center of a lar)144 290.4 R
-(ger)-.18 E 5.273(grid. This)144 302.4 R(allo)2.773 E .274(ws data outs\
-ide the output grid to guide the spline interpolation of data g)-.25 F
-.274(aps which)-.05 F .498
-(happen to lie at the the edge of the output grid.)144 314.4 R .497
-(The amount of e)5.497 F .497(xtension is)-.15 F F1 -.2(ex)2.997 G(tend)
-.2 E F0 .497(times the grid)2.997 F .881(width/height to each side.)144
-326.4 R .881(Thus, if)5.881 F F1 -.2(ex)3.381 G(tend).2 E F0 .882
-(=1.0, then the internal grid will ha)B 1.182 -.15(ve d)-.2 H .882
-(imensions three).15 F(times the output grid.)144 338.4 Q(Def)5 E(ault:)
--.1 E F1 -.2(ex)2.5 G(tend).2 E F0 2.5(=0)2.5 G(.0)-2.5 E F2<ad59>108
-355.2 Q F1(priority_sour)23.08 E(ce)-.37 E F0 .276(Enables priortizatio\
-n of data points based on their apparent grazing angle \(this angle is \
-arctan\(x/z\))144 367.2 R .132(where x is acrosstrack distance and z is\
- sonar altitude, so that the center of the sw)144 379.2 R .133
-(ath has an appar)-.1 F(-)-.2 E .531
-(ent grazing angle of zero, the port sw)144 391.2 R .531
-(ath edge has a lar)-.1 F .531(ge ne)-.18 F -.05(ga)-.15 G(ti).05 E .831
--.15(ve a)-.25 H .531(ngle, and the starboard sw).15 F(ath)-.1 E .845
-(edge has a lar)144 403.2 R .845(ge positi)-.18 F 1.145 -.15(ve a)-.25 H
-.845(ngle\). A number of prede\214ned priority tables are a).15 F -.25
-(va)-.2 G .845(ilable and can be).25 F(accessed by setting)144 415.2 Q
-F1(priority_sour)2.5 E(ce)-.37 E F0
-(to a number from 1 to 8. These priority tables include:)2.5 E F1
-(priority_sour)144 451.2 Q(ce)-.37 E F0 2.5(=1)2.5 G(:)-2.5 E
-(Angle \(de)159 463.2 Q 2.5(g\) Priority)-.15 F
-(\255--------------------)159 475.2 Q 22.5(\25560 1.0)185 487.2 R 25(00)
-190 499.2 S(.0)-25 E 22.5(60 1.0)187.5 511.2 R F1(priority_sour)144
-547.2 Q(ce)-.37 E F0 2.5(=2)2.5 G(:)-2.5 E(Angle \(de)159 559.2 Q 2.5
-(g\) Priority)-.15 F(\255--------------------)159 571.2 Q 22.5
-(\25567 1.0)185 583.2 R 25(00)190 595.2 S(.0)-25 E 22.5(67 1.0)187.5
-607.2 R F1(priority_sour)144 643.2 Q(ce)-.37 E F0 2.5(=3)2.5 G(:)-2.5 E
-(Angle \(de)159 655.2 Q 2.5(g\) Priority)-.15 F
-(\255--------------------)159 667.2 Q 22.5(\25575 1.0)185 679.2 R 25(00)
-190 691.2 S(.0)-25 E 22.5(75 1.0)187.5 703.2 R(MB-System 5.0)72 768 Q
-(13 March 2014)140.11 E(8)198.45 E 0 Cg EP
-%%Page: 9 9
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F/F1 10/Times-Italic at 0 SF(priority_sour)144 84 Q
-(ce)-.37 E F0 2.5(=4)2.5 G(:)-2.5 E(Angle \(de)159 96 Q 2.5
-(g\) Priority)-.15 F(\255--------------------)159 108 Q 22.5(\25585 1.0)
-185 120 R 25(00)190 132 S(.0)-25 E 22.5(85 1.0)187.5 144 R F1
-(priority_sour)144 180 Q(ce)-.37 E F0 2.5(=5)2.5 G(:)-2.5 E(Angle \(de)
-159 192 Q 2.5(g\) Priority)-.15 F(\255--------------------)159 204 Q
-22.5(\25560 0.0)185 216 R 25(01)190 228 S(.0)-25 E 22.5(60 0.0)187.5 240
-R F1(priority_sour)144 276 Q(ce)-.37 E F0 2.5(=6)2.5 G(:)-2.5 E
-(Angle \(de)159 288 Q 2.5(g\) Priority)-.15 F(\255--------------------)
-159 300 Q 22.5(\25567 0.0)185 312 R 25(01)190 324 S(.0)-25 E 22.5
-(67 0.0)187.5 336 R F1(priority_sour)144 372 Q(ce)-.37 E F0 2.5(=7)2.5 G
-(:)-2.5 E(Angle \(de)159 384 Q 2.5(g\) Priority)-.15 F
-(\255--------------------)159 396 Q 22.5(\25575 0.0)185 408 R 25(01)190
-420 S(.0)-25 E 22.5(75 0.0)187.5 432 R F1(priority_sour)144 468 Q(ce)
--.37 E F0 2.5(=8)2.5 G(:)-2.5 E(Angle \(de)159 480 Q 2.5(g\) Priority)
--.15 F(\255--------------------)159 492 Q 22.5(\25585 0.0)185 504 R 25
-(01)190 516 S(.0)-25 E 22.5(85 0.0)187.5 528 R(Alternati)144 564 Q -.15
-(ve)-.25 G(ly).15 E 2.721(,i)-.65 G(f)-2.721 E F1(priority_sour)2.721 E
-(ce)-.37 E F0 .221(speci\214es a \214le name, then the data priority ta\
-ble will be read from)2.721 F 1.084(this \214le.)144 576 R 1.084
-(The priority \214le should contain tw)6.084 F 3.584(oc)-.1 G 1.085
-(olumns: apparent grazing angles in de)-3.584 F 1.085(grees from)-.15 F
--.15(ve)144 588 S .428(rtical follo).15 F .427(wed by data priority v)
--.25 F .427
-(alues between 0.0 and 1.0. The \214rst line of the \214le should con-)
--.25 F .873(tain the minimum, or port-most grazing angle follo)144 600 R
-.873(wed by the associated priority)-.25 F 3.373(.T)-.65 G .874
-(he follo)-3.373 F(wing)-.25 E .972
-(lines should contain increasingly lar)144 612 R .971
-(ge grazing angles \(and associated priorities\) up to the maxi-)-.18 F
-.271(mum, or starboard-most, grazing angle.)144 624 R .272
-(The highest priority assigned should be one, and the lo)5.271 F(w-)-.25
-E .274(est zero.)144 636 R .274(Priorities for grazing angles less than\
- the minimum or greater than the maximum will be)5.274 F
-(zero. See the e)144 648 Q(xamples belo)-.15 E 2.5(wf)-.25 G
-(or a further e)-2.5 E(xplanation of the use of)-.15 E F1(priority_sour)
-2.5 E(ce)-.37 E F0(.)A/F2 10/Times-Bold at 0 SF<ad5a>108 664.8 Q F1
-(bath_default)23.63 E F0 .657(Sets the def)144 676.8 R .658(ault depth \
-used for calculating grazing angles for amplitude or sidescan v)-.1 F
-.658(alues where)-.25 F(depths are not a)144 688.8 Q -.25(va)-.2 G 2.5
-(ilable. Def).25 F(ault:)-.1 E F1(scale)2.5 E F0 2.5(=1)2.5 G(000.0)-2.5
-E/F3 10.95/Times-Bold at 0 SF(EXAMPLES)72 705.6 Q F0 .638(Suppose you w)108
-717.6 R .638
-(ant to mosaic some SeaBeam 2112 sidescan data in six data \214les o)-.1
-F -.15(ve)-.15 G 3.137(rar).15 G -.15(eg)-3.137 G .637(ion with longi-)
-.15 F .329(tude bounds of 113.4833E to 115.4333E and latitude bounds of\
- 32.1166S to 31.5500S, and you w)108 729.6 R .329(ould lik)-.1 F(e)-.1 E
-(MB-System 5.0)72 768 Q(13 March 2014)140.11 E(9)198.45 E 0 Cg EP
-%%Page: 10 10
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F 3.084(a1)108 84 S .584(00 m grid spacing.)
--3.084 F .584(First, create a datalist \214le using a te)5.584 F .583
-(xt editor which contains the data \214lenames fol-)-.15 F(lo)108 96 Q
-(wed by the appropriate format identi\214er:)-.25 E(kn_perth_01.mb41 41)
-144 120 Q(kn_perth_05.mb41 41)144 132 Q(kn_perth_09.mb41 41)144 144 Q
-(kn_perth_13.mb41 41)144 156 Q(kn_perth_17.mb41 41)144 168 Q
-(kn_perth_03.mb41 41)144 180 Q .5(The nadir re)108 204 R .5
-(gion of the sidescan sw)-.15 F .5(ath is generally of little use becau\
-se it is dominated by specular re\215ec-)-.1 F 1.055
-(tion rather than backscatter)108 216 R 3.555(.I)-.55 G 3.555(no)-3.555
-G 1.055(rder to allo)-3.555 F(w)-.25 E/F1 10/Times-Bold at 0 SF(mbmosaic)
-3.555 E F0 1.055(to preferentially use data from the outer sw)3.555 F
-(ath,)-.1 E(where possible, create another \214le containing a list of \
-data priority as a function of apparent grazing angle:)108 228 Q
-(-60.0 0.2)144 252 Q(-45.0 1.0)144 264 Q(-15.0 0.8)144 276 Q(-14.9 0.1)
-144 288 Q(14.9 0.1)144 300 Q(15.0 0.8)144 312 Q(45.0 1.0)144 324 Q
-(60.0 0.2)144 336 Q .331(Here the ne)108 360 R -.05(ga)-.15 G(ti).05 E
-.631 -.15(ve a)-.25 H .331(ngles denote the port side of the sw).15 F
-.331(ath and the positi)-.1 F .631 -.15(ve a)-.25 H .331
-(ngles denote the starboard side).15 F .09(of the sw)108 372 R 2.59
-(ath. The)-.1 F .09(priorities are linearly interpolated between the di\
-screet angle/priority pairs.)2.59 F .09(Note that the)5.09 F 1.54
-(nadir re)108 384 R 1.54(gion \(angles less than +/- 15 de)-.15 F 1.54
-(grees\) has lo)-.15 F 4.041(wp)-.25 G(riority)-4.041 E 4.041(,a)-.65 G
-1.541(nd that the highest priority is gi)-4.041 F -.15(ve)-.25 G 4.041
-(nt).15 G(o)-4.041 E(angles of 45 de)108 396 Q
-(grees. No data with angle magnitudes greater than 60 de)-.15 E
-(grees will be used.)-.15 E(Then, run)108 420 Q F1(mbmosaic)2.5 E F0
-(as follo)2.5 E(ws:)-.25 E(mbmosaic \255Idatalist \\)144 432 Q
-(-R114.1333/114.7833/-32.1166/-31.55 \\)180 444 Q
-(-A4 \255E100/100/meters \255N \\)180 456 Q(-Y)180 468 Q(angle_priority)
--1 E(.dat \255F0.10 \255C10 \\)-.65 E(-Operth_ss \255V)180 480 Q(The)108
-504 Q F1<ad45>3.215 E F0 .715(option speci\214es grid spacings of 100 m\
-eters in both the longitude and latitude; the dimensions of)3.215 F
-1.229(the output grid are calculated according by)108 516 R F1(mbmosaic)
-3.729 E F0 3.729(.T)C(he)-3.729 E F1<ad46>3.729 E F0 1.23
-(option enables Gaussian weighted mean)3.729 F .722(mosaicing and the p\
-riority range of 0.10 means that for each bin, all data with priorities\
- within 0.1 of the)108 528 R .393(highest priority will be used.)108 540
-R .393(By specifying a clipping dimension of 10 we cause small g)5.393 F
-.394(aps in the mosaic)-.05 F
-(to be \214lled in through spine interpolation .)108 552 Q
-(The output looks lik)5 E(e:)-.1 E(Program mbmosaic)110.5 576 Q -1.11
-(Ve)110.5 588 S
-(rsion $Id: mbmosaic.ps 2252 2015-07-01 19:35:37Z caress $)1.11 E
-(MB-system V)110.5 600 Q(ersion 4.5)-1.11 E(MBMOSAIC P)110.5 624 Q
-(arameters:)-.15 E(List of input \214les: datalist)110.5 636 Q
-(Output \214leroot:)110.5 648 Q(perth_ss)12.5 E(Input Data T)110.5 660 Q
-10(ype: Sidescan)-.8 F(Grid projection: Geographic)110.5 672 Q
-(Grid dimensions: 616 629)110.5 684 Q(Grid bounds:)110.5 696 Q 2.5
-(Longitude: 114.1333 114.7833)115.5 708 R 5(Latitude: \25532.1166)115.5
-720 R(\25531.5500)5 E(MB-System 5.0)72 768 Q(13 March 2014)140.11 E(10)
-193.45 E 0 Cg EP
-%%Page: 11 11
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F -.8(Wo)110.5 84 S
-(rking grid dimensions: 616 629).8 E -.8(Wo)110.5 96 S
-(rking Grid bounds:).8 E 2.5(Longitude: 114.1333 114.7833)115.5 108 R 5
-(Latitude: \25532.1166)115.5 120 R(\25531.5500)5 E(Longitude interv)
-110.5 132 Q(al: 0.001057 de)-.25 E(grees or 100.051035 m)-.15 E
-(Latitude interv)110.5 144 Q 2.5(al: 0.000902)-.25 F(de)2.5 E
-(grees or 100.042679 m)-.15 E(Speci\214ed Longitude interv)110.5 156 Q
-(al: 100.000000 meters)-.25 E(Speci\214ed Latitude interv)110.5 168 Q
-2.5(al: 100.000000)-.25 F(meters)2.5 E(Input data bounds:)110.5 180 Q
-2.5(Longitude: 113.4833 115.4333)115.5 192 R 5(Latitude: \25532.6832)
-115.5 204 R(\25530.9834)5 E(Mosaicing algorithm:)110.5 216 Q -1.17 -.74
-(Av e)115.5 228 T(rage of highest weighted pix).74 E(els)-.15 E(Pix)
-115.5 240 Q(el weighting range: 0.100000)-.15 E(Pix)115.5 252 Q
-(els weighted by look azimuth)-.15 E(Preferred look azimuth: 90.000000)
-115.5 264 Q(Look azimuth f)115.5 276 Q 7.5(actor: 2.000000)-.1 F
-(Spline interpolation applied with clipping dimension: 10)115.5 288 Q
-(Spline tension \(range 0.0 to in\214nity\): 10000000000.000000)115.5
-300 Q(Grid format 3:)110.5 312 Q(GMT v)5 E(ersion 2 grd \(netCDF\))-.15
-E(NaN v)110.5 324 Q(alues used to \215ag re)-.25 E(gions with no data)
--.15 E(MBIO parameters:)110.5 336 Q(Ping a)115.5 348 Q -.15(ve)-.2 G 15
-(raging: 1).15 F(Longitude \215ipping:)115.5 360 Q(1)7.5 E
-(Speed minimum:)115.5 372 Q(0.0 km/hr)17.5 E
-(330814 data points processed in kn_perth_01.mb41)110.5 396 Q
-(239709 data points processed in kn_perth_05.mb41)110.5 408 Q
-(234034 data points processed in kn_perth_09.mb41)110.5 420 Q
-(310066 data points processed in kn_perth_13.mb41)110.5 432 Q
-(297318 data points processed in kn_perth_17.mb41)110.5 444 Q
-(336504 data points processed in kn_perth_03.mb41)110.5 456 Q
-(1748445 total data points processed in highest weight pass)110.5 480 Q
-(330814 data points processed in kn_perth_01.mb41)110.5 504 Q
-(239709 data points processed in kn_perth_05.mb41)110.5 516 Q
-(234034 data points processed in kn_perth_09.mb41)110.5 528 Q
-(310066 data points processed in kn_perth_13.mb41)110.5 540 Q
-(297318 data points processed in kn_perth_17.mb41)110.5 552 Q
-(336504 data points processed in kn_perth_03.mb41)110.5 564 Q
-(1748445 total data points processed in a)110.5 588 Q -.15(ve)-.2 G
-(raging pass).15 E(Making ra)110.5 612 Q 2.5(wg)-.15 G(rid...)-2.5 E
-(Doing spline interpolation with 86414 data points...)110.5 636 Q -.8
-(To)110.5 660 S(tal number of bins:).8 E(387464)30 E
-(Bins set using data:)110.5 672 Q(86414)32.5 E
-(Bins set using interpolation:)110.5 684 Q(58051)10 E(Bins not set:)
-110.5 696 Q(242999)50 E(Maximum number of data in a bin: 121)110.5 708 Q
-(Minimum v)110.5 720 Q 5(alue: \2556573.12 Maximum)-.25 F -.25(va)2.5 G
-5(lue: 97704.64).25 F(MB-System 5.0)72 768 Q(13 March 2014)140.11 E(11)
-193.45 E 0 Cg EP
-%%Page: 12 12
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(Minimum sigma:)110.5 84 Q 5(4.50125 Maximum)10
-F(sigma: 42979.49567)2.5 E(Outputting results...)110.5 108 Q -.15(exe)
-110.5 132 S(cuting mbm_grdplot...).15 E(Running grdhisteq...)110.5 144 Q
-(Program Status:)110.5 168 Q(\255-------------)110.5 180 Q(Plot Style:)
-115.5 204 Q(Color Fill)120.5 216 Q(Horizontal Color Scale)120.5 228 Q
-(Input Files:)115.5 252 Q(Data GRD File:)120.5 264 Q(perth_ss.grd)30 E
-(Intensity GRD List File:)120.5 276 Q(Output Files:)115.5 300 Q
-(Output plot name root:)120.5 312 Q(perth_ss.grd)10 E
-(Color palette table:)120.5 324 Q(perth_ss.grd.cpt)15 E
-(Plotting shellscript:)120.5 336 Q(perth_ss.grd.cmd)12.5 E(Plot \214le:)
-120.5 348 Q(perth_ss.grd.ps)40 E(Plot Attrib)115.5 372 Q(utes:)-.2 E
-(Plot width:)120.5 384 Q(6.5000)37.5 E(Plot height:)120.5 396 Q(6.6369)
-35 E -.15(Pa)120.5 408 S(ge size:).15 E(a)40 E -.15(Pa)120.5 420 S
-(ge width:).15 E(8.5)37.5 E -.15(Pa)120.5 432 S(ge height:).15 E(11)35 E
-35(Projection: \255Jm10)120.5 444 R(Ax)120.5 456 Q(es annotation:)-.15 E
-(10m/10m)25 E 32.5(Orientation: portrait)120.5 468 R(Number of colors:)
-120.5 480 Q(11)22.5 E(Color P)120.5 492 Q 27.5(alette: Grayscale)-.15 F
-(Colors re)120.5 504 Q -.15(ve)-.25 G(rsed).15 E(Grid Data Attrib)115.5
-528 Q(utes:)-.2 E(Longitude min max:)120.5 540 Q 5(114.1330 114.7830)
-22.5 F(Latitude min max:)120.5 552 Q 5(\25532.1166 \25531.5500)25 F
-(Data min max:)120.5 564 Q 5(\2556573 9.77e+04)42.5 F
-(Primary Grid Plotting Controls:)115.5 588 Q(Color start datum:)120.5
-600 Q(\25512500.000000)20 E(Color end datum:)120.5 612 Q(112500.000000)
-25 E(Histogram stretch applied to color palette)120.5 624 Q(GMT Def)
-115.5 648 Q(ault V)-.1 E(alues Reset in Script:)-1.11 E -.92(PA)120.5
-660 S 35(PER_WIDTH 8.5).92 F(ANO)120.5 672 Q 40(T_FONT Helv)-.4 F(etica)
--.15 E 37.5(LABEL_FONT Helv)120.5 684 R(etica)-.15 E 35
-(HEADER_FONT Helv)120.5 696 R(etica)-.15 E(ANO)120.5 708 Q 27.5
-(T_FONT_SIZE 8)-.4 F 25(LABEL_FONT_SIZE 8)120.5 720 R(MB-System 5.0)72
-768 Q(13 March 2014)140.11 E(12)193.45 E 0 Cg EP
-%%Page: 13 13
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F 22.5(HEADER_FONT_SIZE 10)120.5 84 R 35
-(FRAME_WIDTH 0.074999999999999997)120.5 96 R 35
-(TICK_LENGTH 0.074999999999999997)120.5 108 R -1.06 -.92(PA G)120.5 120
-T(E_ORIENT).92 E -1.11(AT)-.93 G 22.5(ION LANDSCAPE)1.11 F(COLOR_B)120.5
-132 Q -.4(AC)-.35 G(KGR).4 E 22.5(OUND 0/0/0)-.4 F(COLOR_FOREGR)120.5
-144 Q 22.5(OUND 255/255/255)-.4 F(COLOR_N)120.5 156 Q 40(AN 255/255/255)
--.35 F(\255-------------)110.5 180 Q
-(Plot generation shellscript <perth_ss.grd.cmd> created.)110.5 204 Q
-(Instructions:)110.5 228 Q(Ex)115.5 240 Q
-(ecute <perth_ss.grd.cmd> to generate)-.15 E
-(Postscript plot <perth_ss.grd.ps>.)128 252 Q(Ex)115.5 264 Q
-(ecuting <perth_ss.grd.cmd> also in)-.15 E -.2(vo)-.4 G -.1(ke).2 G(s).1
-E(xpsvie)128 276 Q 2.5(wt)-.25 G 2.5(ov)-2.5 G(ie)-2.5 E 2.5(wt)-.25 G
-(he plot on the screen.)-2.5 E(\255-------------)110.5 300 Q(Done.)110.5
-336 Q .816(The names of the output \214les are based on the root charac\
-ter string speci\214ed using the)108 360 R/F1 10/Times-Bold at 0 SF<ad4f>
-3.316 E F0 3.316(option. Since)3.316 F .043(the grid is output as a net\
-CDF GRD format \214le, its \214lename is "perth_ss.grd"; a shellscript \
-which will allo)108 372 R(w)-.25 E 5.318
-(the contents of the grid to vie)108 384 R 5.318(wed using)-.25 F F1
-(GMT)7.818 E F0 5.318(programs is also output with the \214lename)7.818
-F("perth_ss.grd.cmd".)108 396 Q 1.391(Suppose that one w)108 420 R 1.391
-(ants to produce a mosaic composed only of data with a more or less eas\
-tw)-.1 F 1.392(ard look)-.1 F .261(azimuth. Then add the)108 432 R F1
-<ad55>2.761 E F0 .261(option with a preferred azimuth of 90 de)2.761 F
-.261(grees. A look azimuth f)-.15 F .261(actor of 2.0 will)-.1 F(cause)
-108 444 Q F1(mbmosaic)2.645 E F0 .145(to reject an)2.645 F 2.645(yd)-.15
-G .146(ata with look azimuths outside a range of 45 to 135 de)-2.645 F
-2.646(grees. The)-.15 F(follo)2.646 E(wing)-.25 E(will suf)108 456 Q
-(\214ce:)-.25 E(mbmosaic \255Idatalist \\)144 468 Q
-(-R114.1333/114.7833/-32.1166/-31.55 \\)180 480 Q
-(-A4 \255E100/100/meters \255N \\)180 492 Q(-Y)180 504 Q(angle_priority)
--1 E(.dat \255F0.10 \255C10 \\)-.65 E(-Operth_ss \255U90/2.0 \255V)180
-516 Q/F2 10.95/Times-Bold at 0 SF(SEE ALSO)72 544.8 Q F1(mbsystem)108 556.8
-Q F0(\(1\),)A F1(mbgrid)2.5 E F0(\(1\),)A F1(mbm_grid)2.5 E F0(\(1\),)A
-F1(mbm_grd2ar)2.5 E(c)-.18 E F0(\(1\))A F2 -.11(BU)72 585.6 S(GS).11 E
-F0 .064(The options for this program ha)108 597.6 R .364 -.15(ve g)-.2 H
-(ro).15 E .063(wn a bit complicated.)-.25 F .063(If you ha)5.063 F .363
--.15(ve o)-.2 H .063(ther problems, please let us kno).15 F -.65(w.)-.25
-G F2(APPENDIX 1: PR)72 638.4 Q(OJECTED COORDIN)-.329 E -1.04(AT)-.219 G
-2.738(ES)1.04 G(YSTEM IDENTIFIERS)-2.738 E F0 .541(The follo)108 650.4 R
-.542(wing is a list of the projected coordinate systems \(PCS')-.25 F
-.542(s\) that are supported by MB-System. The)-.55 F 2.27(full PCS de\
-\214nitions are found in the \214le mbsystem/share/Projections.dat. The\
-se de\214nitions are in the)108 662.4 R F1(PR)108 674.4 Q(OJ)-.3 E(.4)
--.2 E F0 .734(format and deri)3.234 F 1.034 -.15(ve f)-.25 H .734
-(rom the).15 F F1(PR)3.234 E(OJ)-.3 E(.4)-.2 E F0 .734(4.6.1 distrib)
-3.234 F .734(ution obtained from http://trac.osgeo.or)-.2 F .735
-(g/proj/ in)-.18 F .288(September 2008. The proj library source code ha\
-s been incorporated unchanged into the MB-System pack-)108 686.4 R(age.)
-108 698.4 Q .692
-(The \214rst item on each line is the PCS identi\214er inside brack)108
-722.4 R .692(ets, such as <UTM10N> or <epsg32749>. T)-.1 F(o)-.8 E
-(MB-System 5.0)72 768 Q(13 March 2014)140.11 E(13)193.45 E 0 Cg EP
-%%Page: 14 14
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(specify using one of these PCS')108 84 Q
-(s, use the)-.55 E/F1 10/Times-Bold at 0 SF<ad4a>2.5 E F0(option, e.g.)2.5
-E F1<ad4a>2.5 E/F2 10/Times-Italic at 0 SF(UTM10N)A F0(or)2.5 E F1<ad4a>2.5
-E F2(epsg32749)A F0(.)A
-(\255--------------------------------------------------------)110.5 108
-Q(Standard Uni)110.5 120 Q -.15(ve)-.25 G(rsal T).15 E(ransv)-.35 E
-(erse Mercator \(UTM\))-.15 E(and Uni)120.5 132 Q -.15(ve)-.25 G
-(rsal Polar Stereographic \(UPS\)).15 E
-(projected coordinate systems for MB-System)120.5 144 Q
-(\255--------------------------------------------------------)110.5 156
-Q(<UTM01N> : WGS 84 / UTM zone 1N)110.5 180 Q
-(<UTM02N> : WGS 84 / UTM zone 2N)110.5 192 Q
-(<UTM03N> : WGS 84 / UTM zone 3N)110.5 204 Q
-(<UTM04N> : WGS 84 / UTM zone 4N)110.5 216 Q
-(<UTM05N> : WGS 84 / UTM zone 5N)110.5 228 Q
-(<UTM06N> : WGS 84 / UTM zone 6N)110.5 240 Q
-(<UTM07N> : WGS 84 / UTM zone 7N)110.5 252 Q
-(<UTM08N> : WGS 84 / UTM zone 8N)110.5 264 Q
-(<UTM09N> : WGS 84 / UTM zone 9N)110.5 276 Q
-(<UTM10N> : WGS 84 / UTM zone 10N)110.5 288 Q
-(<UTM11N> : WGS 84 / UTM zone 11N)110.5 300 Q
-(<UTM12N> : WGS 84 / UTM zone 12N)110.5 312 Q
-(<UTM13N> : WGS 84 / UTM zone 13N)110.5 324 Q
-(<UTM14N> : WGS 84 / UTM zone 14N)110.5 336 Q
-(<UTM15N> : WGS 84 / UTM zone 15N)110.5 348 Q
-(<UTM16N> : WGS 84 / UTM zone 16N)110.5 360 Q
-(<UTM17N> : WGS 84 / UTM zone 17N)110.5 372 Q
-(<UTM18N> : WGS 84 / UTM zone 18N)110.5 384 Q
-(<UTM19N> : WGS 84 / UTM zone 19N)110.5 396 Q
-(<UTM20N> : WGS 84 / UTM zone 20N)110.5 408 Q
-(<UTM21N> : WGS 84 / UTM zone 21N)110.5 420 Q
-(<UTM22N> : WGS 84 / UTM zone 22N)110.5 432 Q
-(<UTM23N> : WGS 84 / UTM zone 23N)110.5 444 Q
-(<UTM24N> : WGS 84 / UTM zone 24N)110.5 456 Q
-(<UTM25N> : WGS 84 / UTM zone 25N)110.5 468 Q
-(<UTM26N> : WGS 84 / UTM zone 26N)110.5 480 Q
-(<UTM27N> : WGS 84 / UTM zone 27N)110.5 492 Q
-(<UTM28N> : WGS 84 / UTM zone 28N)110.5 504 Q
-(<UTM29N> : WGS 84 / UTM zone 29N)110.5 516 Q
-(<UTM30N> : WGS 84 / UTM zone 30N)110.5 528 Q
-(<UTM31N> : WGS 84 / UTM zone 31N)110.5 540 Q
-(<UTM32N> : WGS 84 / UTM zone 32N)110.5 552 Q
-(<UTM33N> : WGS 84 / UTM zone 33N)110.5 564 Q
-(<UTM34N> : WGS 84 / UTM zone 34N)110.5 576 Q
-(<UTM35N> : WGS 84 / UTM zone 35N)110.5 588 Q
-(<UTM36N> : WGS 84 / UTM zone 36N)110.5 600 Q
-(<UTM37N> : WGS 84 / UTM zone 37N)110.5 612 Q
-(<UTM38N> : WGS 84 / UTM zone 38N)110.5 624 Q
-(<UTM39N> : WGS 84 / UTM zone 39N)110.5 636 Q
-(<UTM40N> : WGS 84 / UTM zone 40N)110.5 648 Q
-(<UTM41N> : WGS 84 / UTM zone 41N)110.5 660 Q
-(<UTM42N> : WGS 84 / UTM zone 42N)110.5 672 Q
-(<UTM43N> : WGS 84 / UTM zone 43N)110.5 684 Q
-(<UTM44N> : WGS 84 / UTM zone 44N)110.5 696 Q
-(<UTM45N> : WGS 84 / UTM zone 45N)110.5 708 Q
-(<UTM46N> : WGS 84 / UTM zone 46N)110.5 720 Q(MB-System 5.0)72 768 Q
-(13 March 2014)140.11 E(14)193.45 E 0 Cg EP
-%%Page: 15 15
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<UTM47N> : WGS 84 / UTM zone 47N)110.5 84 Q
-(<UTM48N> : WGS 84 / UTM zone 48N)110.5 96 Q
-(<UTM49N> : WGS 84 / UTM zone 49N)110.5 108 Q
-(<UTM50N> : WGS 84 / UTM zone 50N)110.5 120 Q
-(<UTM51N> : WGS 84 / UTM zone 51N)110.5 132 Q
-(<UTM52N> : WGS 84 / UTM zone 52N)110.5 144 Q
-(<UTM53N> : WGS 84 / UTM zone 53N)110.5 156 Q
-(<UTM54N> : WGS 84 / UTM zone 54N)110.5 168 Q
-(<UTM55N> : WGS 84 / UTM zone 55N)110.5 180 Q
-(<UTM56N> : WGS 84 / UTM zone 56N)110.5 192 Q
-(<UTM57N> : WGS 84 / UTM zone 57N)110.5 204 Q
-(<UTM58N> : WGS 84 / UTM zone 58N)110.5 216 Q
-(<UTM59N> : WGS 84 / UTM zone 59N)110.5 228 Q
-(<UTM60N> : WGS 84 / UTM zone 60N)110.5 240 Q
-(<UTM01S> : WGS 84 / UTM zone 1S)110.5 252 Q
-(<UTM02S> : WGS 84 / UTM zone 2S)110.5 264 Q
-(<UTM03S> : WGS 84 / UTM zone 3S)110.5 276 Q
-(<UTM04S> : WGS 84 / UTM zone 4S)110.5 288 Q
-(<UTM05S> : WGS 84 / UTM zone 5S)110.5 300 Q
-(<UTM06S> : WGS 84 / UTM zone 6S)110.5 312 Q
-(<UTM07S> : WGS 84 / UTM zone 7S)110.5 324 Q
-(<UTM08S> : WGS 84 / UTM zone 8S)110.5 336 Q
-(<UTM09S> : WGS 84 / UTM zone 9S)110.5 348 Q
-(<UTM10S> : WGS 84 / UTM zone 10S)110.5 360 Q
-(<UTM11S> : WGS 84 / UTM zone 11S)110.5 372 Q
-(<UTM12S> : WGS 84 / UTM zone 12S)110.5 384 Q
-(<UTM13S> : WGS 84 / UTM zone 13S)110.5 396 Q
-(<UTM14S> : WGS 84 / UTM zone 14S)110.5 408 Q
-(<UTM15S> : WGS 84 / UTM zone 15S)110.5 420 Q
-(<UTM16S> : WGS 84 / UTM zone 16S)110.5 432 Q
-(<UTM17S> : WGS 84 / UTM zone 17S)110.5 444 Q
-(<UTM18S> : WGS 84 / UTM zone 18S)110.5 456 Q
-(<UTM19S> : WGS 84 / UTM zone 19S)110.5 468 Q
-(<UTM20S> : WGS 84 / UTM zone 20S)110.5 480 Q
-(<UTM21S> : WGS 84 / UTM zone 21S)110.5 492 Q
-(<UTM22S> : WGS 84 / UTM zone 22S)110.5 504 Q
-(<UTM23S> : WGS 84 / UTM zone 23S)110.5 516 Q
-(<UTM24S> : WGS 84 / UTM zone 24S)110.5 528 Q
-(<UTM25S> : WGS 84 / UTM zone 25S)110.5 540 Q
-(<UTM26S> : WGS 84 / UTM zone 26S)110.5 552 Q
-(<UTM27S> : WGS 84 / UTM zone 27S)110.5 564 Q
-(<UTM28S> : WGS 84 / UTM zone 28S)110.5 576 Q
-(<UTM29S> : WGS 84 / UTM zone 29S)110.5 588 Q
-(<UTM30S> : WGS 84 / UTM zone 30S)110.5 600 Q
-(<UTM31S> : WGS 84 / UTM zone 31S)110.5 612 Q
-(<UTM32S> : WGS 84 / UTM zone 32S)110.5 624 Q
-(<UTM33S> : WGS 84 / UTM zone 33S)110.5 636 Q
-(<UTM34S> : WGS 84 / UTM zone 34S)110.5 648 Q
-(<UTM35S> : WGS 84 / UTM zone 35S)110.5 660 Q
-(<UTM36S> : WGS 84 / UTM zone 36S)110.5 672 Q
-(<UTM37S> : WGS 84 / UTM zone 37S)110.5 684 Q
-(<UTM38S> : WGS 84 / UTM zone 38S)110.5 696 Q
-(<UTM39S> : WGS 84 / UTM zone 39S)110.5 708 Q
-(<UTM40S> : WGS 84 / UTM zone 40S)110.5 720 Q(MB-System 5.0)72 768 Q
-(13 March 2014)140.11 E(15)193.45 E 0 Cg EP
-%%Page: 16 16
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<UTM41S> : WGS 84 / UTM zone 41S)110.5 84 Q
-(<UTM42S> : WGS 84 / UTM zone 42S)110.5 96 Q
-(<UTM43S> : WGS 84 / UTM zone 43S)110.5 108 Q
-(<UTM44S> : WGS 84 / UTM zone 44S)110.5 120 Q
-(<UTM45S> : WGS 84 / UTM zone 45S)110.5 132 Q
-(<UTM46S> : WGS 84 / UTM zone 46S)110.5 144 Q
-(<UTM47S> : WGS 84 / UTM zone 47S)110.5 156 Q
-(<UTM48S> : WGS 84 / UTM zone 48S)110.5 168 Q
-(<UTM49S> : WGS 84 / UTM zone 49S)110.5 180 Q
-(<UTM50S> : WGS 84 / UTM zone 50S)110.5 192 Q
-(<UTM51S> : WGS 84 / UTM zone 51S)110.5 204 Q
-(<UTM52S> : WGS 84 / UTM zone 52S)110.5 216 Q
-(<UTM53S> : WGS 84 / UTM zone 53S)110.5 228 Q
-(<UTM54S> : WGS 84 / UTM zone 54S)110.5 240 Q
-(<UTM55S> : WGS 84 / UTM zone 55S)110.5 252 Q
-(<UTM56S> : WGS 84 / UTM zone 56S)110.5 264 Q
-(<UTM57S> : WGS 84 / UTM zone 57S)110.5 276 Q
-(<UTM58S> : WGS 84 / UTM zone 58S)110.5 288 Q
-(<UTM59S> : WGS 84 / UTM zone 59S)110.5 300 Q
-(<UTM60S> : WGS 84 / UTM zone 60S)110.5 312 Q
-(<UPSN> : WGS 84 / UPS North)110.5 324 Q(<UPSS> : WGS 84 / UPS South)
-110.5 336 Q
-(\255--------------------------------------------------------)110.5 360
-Q(Listing of State Plane North American Datum Zones)110.5 372 Q
-(\255--------------------------------------------------------)110.5 384
-Q(MB-System projection ids are the zone number)115.5 396 Q(pre\214x)
-115.5 408 Q(ed by either "nad27sp" or "nad83sp")-.15 E
-(\255---------------------------------------------)110.5 420 Q
-(NGS zone number)188 432 Q(State and zone)110.5 444 Q 10(1927 1983)45 F
-(\255---------------------------------------------)110.5 456 Q
-(Alabama east ..................)110.5 468 Q 12.5(101 101)5 F
-(Alabama west ..................)110.5 480 Q 12.5(102 102)5 F
-(Alaska zone no. 1 ............. 5001)110.5 492 Q(5001)12.5 E
-(Alaska zone no. 2 ............. 5002)110.5 504 Q(5002)12.5 E
-(Alaska zone no. 3 ............. 5003)110.5 516 Q(5003)12.5 E
-(Alaska zone no. 4 ............. 5004)110.5 528 Q(5004)12.5 E
-(Alaska zone no. 5 ............. 5005)110.5 540 Q(5005)12.5 E
-(Alaska zone no. 6 ............. 5006)110.5 552 Q(5006)12.5 E
-(Alaska zone no. 7 ............. 5007)110.5 564 Q(5007)12.5 E
-(Alaska zone no. 8 ............. 5008)110.5 576 Q(5008)12.5 E
-(Alaska zone no. 9 ............. 5009)110.5 588 Q(5009)12.5 E
-(Alaska zone no. 10 ............ 5010)110.5 600 Q(5010)12.5 E
-(American Samoa ................ 5300)110.5 612 Q
-(Arizona central ...............)110.5 624 Q 12.5(202 202)5 F
-(Arizona east ..................)110.5 636 Q 12.5(201 201)5 F
-(Arizona west ..................)110.5 648 Q 12.5(203 203)5 F
-(Arkansas north ................)110.5 660 Q 12.5(301 301)5 F
-(Arkansas south ................)110.5 672 Q 12.5(302 302)5 F
-(California I ..................)110.5 684 Q 12.5(401 401)5 F
-(California II .................)110.5 696 Q 12.5(402 402)5 F
-(California III ................)110.5 708 Q 12.5(403 403)5 F
-(California IV .................)110.5 720 Q 12.5(404 404)5 F
-(MB-System 5.0)72 768 Q(13 March 2014)140.11 E(16)193.45 E 0 Cg EP
-%%Page: 17 17
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(California V ..................)110.5 84 Q 12.5
-(405 405)5 F(California VI .................)110.5 96 Q 12.5(406 406)5 F
-(California VII ................)110.5 108 Q(407)5 E
-(Colorado central ..............)110.5 120 Q 12.5(502 502)5 F
-(Colorado north ................)110.5 132 Q 12.5(501 501)5 F
-(Colorado south ................)110.5 144 Q 12.5(503 503)5 F
-(Connecticut ...................)110.5 156 Q 12.5(600 600)5 F(Dela)110.5
-168 Q -.1(wa)-.15 G(re ......................).1 E 12.5(700 700)5 F
-(Florida east ..................)110.5 180 Q 12.5(901 901)5 F
-(Florida north .................)110.5 192 Q 12.5(903 903)5 F
-(Florida west ..................)110.5 204 Q 12.5(902 902)5 F(Geor)110.5
-216 Q(gia east .................. 1001)-.18 E(1001)12.5 E(Geor)110.5 228
-Q(gia west .................. 1002)-.18 E(1002)12.5 E
-(Guam Island ................... 5400)110.5 240 Q(Ha)110.5 252 Q -.1(wa)
--.15 G(ii 1 ...................... 5101).1 E(5101)12.5 E(Ha)110.5 264 Q
--.1(wa)-.15 G(ii 2 ...................... 5102).1 E(5102)12.5 E(Ha)110.5
-276 Q -.1(wa)-.15 G(ii 3 ...................... 5103).1 E(5103)12.5 E
-(Ha)110.5 288 Q -.1(wa)-.15 G(ii 4 ...................... 5104).1 E
-(5104)12.5 E(Ha)110.5 300 Q -.1(wa)-.15 G
-(ii 5 ...................... 5105).1 E(5105)12.5 E
-(Idaho central ................. 1102)110.5 312 Q(1102)12.5 E
-(Idaho east .................... 1101)110.5 324 Q(1101)12.5 E
-(Idaho west .................... 1103)110.5 336 Q(1103)12.5 E
-(Illinois east ................. 1201)110.5 348 Q(1201)12.5 E
-(Illinois west ................. 1202)110.5 360 Q(1202)12.5 E
-(Indiana east .................. 1301)110.5 372 Q(1301)12.5 E
-(Indiana west .................. 1302)110.5 384 Q(1302)12.5 E(Io)110.5
-396 Q .2 -.1(wa n)-.25 H(orth .................... 1401).1 E(1401)12.5 E
-(Io)110.5 408 Q .2 -.1(wa s)-.25 H(outh .................... 1402).1 E
-(1402)12.5 E(Kansas north .................. 1501)110.5 420 Q(1501)12.5
-E(Kansas south .................. 1502)110.5 432 Q(1502)12.5 E -.25(Ke)
-110.5 444 S(ntuck).25 E 2.5(yn)-.15 G(orth ................ 1601)-2.5 E
-(1601)12.5 E -.25(Ke)110.5 456 S(ntuck).25 E 2.5(ys)-.15 G
-(outh ................ 1602)-2.5 E(1602)12.5 E
-(Louisiana north ............... 1701)110.5 468 Q(1701)12.5 E
-(Louisiana of)110.5 480 Q(fshore ............ 1703)-.25 E(1703)12.5 E
-(Louisiana south ............... 1702)110.5 492 Q(1702)12.5 E
-(Maine east .................... 1801)110.5 504 Q(1801)12.5 E
-(Maine west .................... 1802)110.5 516 Q(1802)12.5 E
-(Maryland ...................... 1900)110.5 528 Q(1900)12.5 E
-(Massachusetts island .......... 2002)110.5 540 Q(2002)12.5 E
-(Massachusetts mainland ........ 2001)110.5 552 Q(2001)12.5 E(Michig)
-110.5 564 Q(an central/l ............ 2112)-.05 E(2112 current)12.5 E
-(Michig)110.5 576 Q(an central/m ............ 2102)-.05 E(old)25 E
-(Michig)110.5 588 Q(an east ................. 2101)-.05 E(old)25 E
-(Michig)110.5 600 Q(an north ................ 2111)-.05 E(2111 current)
-12.5 E(Michig)110.5 612 Q(an south ................ 2113)-.05 E
-(2113 current)12.5 E(Michig)110.5 624 Q(an west ................. 2103)
--.05 E(old)25 E(Minnesota central ............. 2202)110.5 636 Q(2202)
-12.5 E(Minnesota north ............... 2201)110.5 648 Q(2201)12.5 E
-(Minnesota south ............... 2203)110.5 660 Q(2203)12.5 E
-(Mississippi east .............. 2301)110.5 672 Q(2301)12.5 E
-(Mississippi west .............. 2302)110.5 684 Q(2302)12.5 E
-(Missouri central .............. 2402)110.5 696 Q(2402)12.5 E
-(Missouri east ................. 2401)110.5 708 Q(2401)12.5 E
-(Missouri west ................. 2403)110.5 720 Q(2403)12.5 E
-(MB-System 5.0)72 768 Q(13 March 2014)140.11 E(17)193.45 E 0 Cg EP
-%%Page: 18 18
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(Montana .......................)110.5 84 Q
-(2500)25 E(Montana central ............... 2502)110.5 96 Q
-(Montana north ................. 2501)110.5 108 Q
-(Montana south ................. 2503)110.5 120 Q
-(Nebraska ......................)110.5 132 Q(2600)25 E
-(Nebraska north ................ 2601)110.5 144 Q
-(Nebraska south ................ 2602)110.5 156 Q(Ne)110.5 168 Q -.25
-(va)-.25 G(da central ................ 2702).25 E(2702)12.5 E(Ne)110.5
-180 Q -.25(va)-.25 G(da east ................... 2701).25 E(2701)12.5 E
-(Ne)110.5 192 Q -.25(va)-.25 G(da west ................... 2703).25 E
-(2703)12.5 E(Ne)110.5 204 Q 2.5(wh)-.25 G
-(ampshire ................. 2800)-2.5 E(2800)12.5 E(Ne)110.5 216 Q 2.5
-(wj)-.25 G(erse)-2.5 E 2.5(y.)-.15 G(................... 2900)-2.5 E
-(2900)12.5 E(Ne)110.5 228 Q 2.5(wm)-.25 G -.15(ex)-2.5 G
-(ico central ............ 3002).15 E(3002)12.5 E(Ne)110.5 240 Q 2.5(wm)
--.25 G -.15(ex)-2.5 G(ico east ............... 3001).15 E(3001)12.5 E
-(Ne)110.5 252 Q 2.5(wm)-.25 G -.15(ex)-2.5 G
-(ico west ............... 3003).15 E(3003)12.5 E(Ne)110.5 264 Q 2.5(wy)
--.25 G(ork central .............. 3102)-2.5 E(3102)12.5 E(Ne)110.5 276 Q
-2.5(wy)-.25 G(ork east ................. 3101)-2.5 E(3101)12.5 E(Ne)
-110.5 288 Q 2.5(wy)-.25 G(ork long island .......... 3104)-2.5 E(3104)
-12.5 E(Ne)110.5 300 Q 2.5(wy)-.25 G(ork west ................. 3103)-2.5
-E(3103)12.5 E(North carolina ................ 3200)110.5 312 Q(3200)12.5
-E(North dak)110.5 324 Q(ota north ............ 3301)-.1 E(3301)12.5 E
-(North dak)110.5 336 Q(ota south ............ 3302)-.1 E(3302)12.5 E
-(Ohio north .................... 3401)110.5 348 Q(3401)12.5 E
-(Ohio south .................... 3402)110.5 360 Q(3402)12.5 E
-(Oklahoma north ................ 3501)110.5 372 Q(3501)12.5 E
-(Oklahoma south ................ 3502)110.5 384 Q(3502)12.5 E(Ore)110.5
-396 Q(gon north .................. 3601)-.15 E(3601)12.5 E(Ore)110.5 408
-Q(gon south .................. 3602)-.15 E(3602)12.5 E(Pennsylv)110.5
-420 Q(ania north ............ 3701)-.25 E(3701)12.5 E(Pennsylv)110.5 432
-Q(ania south ............ 3702)-.25 E(3702)12.5 E(Puerto Rico, V)110.5
-444 Q(ir)-.6 E(gin Islands ... 5201)-.18 E(5200)12.5 E
-(Rhode Island .................. 3800)110.5 456 Q(3800)12.5 E
-(South Carolina ................)110.5 468 Q(3900)25 E
-(South Carolina north .......... 3901)110.5 480 Q
-(South Carolina south .......... 3902)110.5 492 Q(South Dak)110.5 504 Q
-(ota north ............ 4001)-.1 E(4001)12.5 E(South Dak)110.5 516 Q
-(ota south ............ 4002)-.1 E(4002)12.5 E -.7(Te)110.5 528 S
-(nnessee ..................... 4100).7 E(4100)12.5 E -1.25 -.7(Te x)
-110.5 540 T(as central ................. 4203).7 E(4203)12.5 E -1.25 -.7
-(Te x)110.5 552 T(as north ................... 4201).7 E(4201)12.5 E
--1.25 -.7(Te x)110.5 564 T(as north central ........... 4202).7 E(4202)
-12.5 E -1.25 -.7(Te x)110.5 576 T(as south ................... 4205).7 E
-(4205)12.5 E -1.25 -.7(Te x)110.5 588 T
-(as south central ........... 4204).7 E(4204)12.5 E
-(Utah central .................. 4302)110.5 600 Q(4302)12.5 E
-(Utah north .................... 4301)110.5 612 Q(4301)12.5 E
-(Utah south .................... 4303)110.5 624 Q(4303)12.5 E -1.11(Ve)
-110.5 636 S(rmont ....................... 4400)1.11 E(4400)12.5 E -.6
-(Vi)110.5 648 S -.18(rg).6 G(in Islands, St. Croix ..... 5202).18 E -.6
-(Vi)110.5 660 S -.18(rg).6 G(inia north ................ 4501).18 E
-(4501)12.5 E -.6(Vi)110.5 672 S -.18(rg).6 G
-(inia south ................ 4502).18 E(4502)12.5 E -.8(Wa)110.5 684 S
-(shington north .............. 4601).8 E(4601)12.5 E -.8(Wa)110.5 696 S
-(shington south .............. 4602).8 E(4602)12.5 E -.8(We)110.5 708 S
-(st V).8 E(ir)-.6 E(ginia north ........... 4701)-.18 E(4701)12.5 E -.8
-(We)110.5 720 S(st V).8 E(ir)-.6 E(ginia south ........... 4702)-.18 E
-(4702)12.5 E(MB-System 5.0)72 768 Q(13 March 2014)140.11 E(18)193.45 E 0
-Cg EP
-%%Page: 19 19
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F -.4(Wi)110.5 84 S
-(sconsin central ............. 4802).4 E(4802)12.5 E -.4(Wi)110.5 96 S
-(sconsin north ............... 4801).4 E(4801)12.5 E -.4(Wi)110.5 108 S
-(sconsin south ............... 4803).4 E(4803)12.5 E -.73(Wy)110.5 120 S
-(oming east .................. 4901).73 E(4901)12.5 E -.73(Wy)110.5 132
-S(oming east central .......... 4902).73 E(4902)12.5 E -.73(Wy)110.5 144
-S(oming west .................. 4904).73 E(4904)12.5 E -.73(Wy)110.5 156
-S(oming west central .......... 4903).73 E(4903)12.5 E
-(\255---------------------------------------------)110.5 168 Q
-(\255--------------------------------------------------------)110.5 192
-Q(State Plane Coordinate Systems)110.5 204 Q(North American Datum 1927)
-110.5 216 Q
-(\255--------------------------------------------------------)110.5 228
-Q(<nad27sp101> : alabama east> : nad27sp)110.5 240 Q
-(<nad27sp102> : alabama west> : nad27sp)110.5 252 Q
-(<nad27sp5010> : alaska zone no. 10> : nad27sp)110.5 264 Q
-(<nad27sp5300> : american samoa> : nad27sp)110.5 276 Q
-(<nad27sp201> : arizona east> : nad27sp)110.5 288 Q
-(<nad27sp202> : arizona central> : nad27sp)110.5 300 Q
-(<nad27sp203> : arizona west> : nad27sp)110.5 312 Q
-(<nad27sp301> : arkansas north> : nad27sp)110.5 324 Q
-(<nad27sp302> : arkansas south> : nad27sp)110.5 336 Q
-(<nad27sp401> : california i> : nad27sp)110.5 348 Q
-(<nad27sp402> : california ii> : nad27sp)110.5 360 Q
-(<nad27sp403> : california iii> : nad27sp)110.5 372 Q
-(<nad27sp404> : california i)110.5 384 Q(v> : nad27sp)-.25 E
-(<nad27sp405> : california v> : nad27sp)110.5 396 Q
-(<nad27sp406> : california vi> : nad27sp)110.5 408 Q
-(<nad27sp407> : california vii> : nad27sp)110.5 420 Q
-(<nad27sp501> : colorado north> : nad27sp)110.5 432 Q
-(<nad27sp502> : colorado central> : nad27sp)110.5 444 Q
-(<nad27sp503> : colorado south> : nad27sp)110.5 456 Q
-(<nad27sp600> : connecticut \255--> : nad27sp)110.5 468 Q
-(<nad27sp700> : dela)110.5 480 Q -.1(wa)-.15 G(re \255--> : nad27sp).1 E
-(<nad27sp901> : \215orida east> : nad27sp)110.5 492 Q
-(<nad27sp902> : \215orida west> : nad27sp)110.5 504 Q
-(<nad27sp903> : \215orida north> : nad27sp)110.5 516 Q
-(<nad27sp1001> : geor)110.5 528 Q(gia east> : nad27sp)-.18 E
-(<nad27sp1002> : geor)110.5 540 Q(gia west> : nad27sp)-.18 E
-(<nad27sp5101> : ha)110.5 552 Q -.1(wa)-.15 G(ii 1> : nad27sp).1 E
-(<nad27sp5102> : ha)110.5 564 Q -.1(wa)-.15 G(ii 2> : nad27sp).1 E
-(<nad27sp5103> : ha)110.5 576 Q -.1(wa)-.15 G(ii 3> : nad27sp).1 E
-(<nad27sp5104> : ha)110.5 588 Q -.1(wa)-.15 G(ii 4> : nad27sp).1 E
-(<nad27sp5105> : ha)110.5 600 Q -.1(wa)-.15 G(ii 5> : nad27sp).1 E
-(<nad27sp1101> : idaho east> : nad27sp)110.5 612 Q
-(<nad27sp1102> : idaho central> : nad27sp)110.5 624 Q
-(<nad27sp1103> : idaho west> : nad27sp)110.5 636 Q
-(<nad27sp1201> : illinois east> : nad27sp)110.5 648 Q
-(<nad27sp1202> : illinois west> : nad27sp)110.5 660 Q
-(<nad27sp1301> : indiana east> : nad27sp)110.5 672 Q
-(<nad27sp1302> : indiana west> : nad27sp)110.5 684 Q(<nad27sp1401> : io)
-110.5 696 Q .2 -.1(wa n)-.25 H(orth> : nad27sp).1 E(<nad27sp1402> : io)
-110.5 708 Q .2 -.1(wa s)-.25 H(outh> : nad27sp).1 E
-(<nad27sp1501> : kansas north> : nad27sp)110.5 720 Q(MB-System 5.0)72
-768 Q(13 March 2014)140.11 E(19)193.45 E 0 Cg EP
-%%Page: 20 20
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<nad27sp1502> : kansas south> : nad27sp)110.5
-84 Q(<nad27sp1601> : k)110.5 96 Q(entuck)-.1 E 2.5(yn)-.15 G
-(orth> : nad27sp)-2.5 E(<nad27sp1602> : k)110.5 108 Q(entuck)-.1 E 2.5
-(ys)-.15 G(outh> : nad27sp)-2.5 E
-(<nad27sp1701> : louisiana north> : nad27sp)110.5 120 Q
-(<nad27sp1702> : louisiana south> : nad27sp)110.5 132 Q
-(<nad27sp1703> : louisiana of)110.5 144 Q(fshore> : nad27sp)-.25 E
-(<nad27sp1801> : maine east> : nad27sp)110.5 156 Q
-(<nad27sp1802> : maine west> : nad27sp)110.5 168 Q
-(<nad27sp1900> : maryland \255--> : nad27sp)110.5 180 Q
-(<nad27sp2001> : massachusetts mainland> : nad27sp)110.5 192 Q
-(<nad27sp2002> : massachusetts island> : nad27sp)110.5 204 Q
-(<nad27sp2101> : michig)110.5 216 Q(an east> : nad27sp)-.05 E
-(<nad27sp2102> : michig)110.5 228 Q(an central/m> : nad27sp)-.05 E
-(<nad27sp2103> : michig)110.5 240 Q(an west> : nad27sp)-.05 E
-(<nad27sp2111> : michig)110.5 252 Q(an north> : nad27sp)-.05 E
-(<nad27sp2112> : michig)110.5 264 Q(an central/l> : nad27sp)-.05 E
-(<nad27sp2113> : michig)110.5 276 Q(an south> : nad27sp)-.05 E
-(<nad27sp2201> : minnesota north> : nad27sp)110.5 288 Q
-(<nad27sp2202> : minnesota central> : nad27sp)110.5 300 Q
-(<nad27sp2203> : minnesota south> : nad27sp)110.5 312 Q
-(<nad27sp2301> : mississippi east> : nad27sp)110.5 324 Q
-(<nad27sp2302> : mississippi west> : nad27sp)110.5 336 Q
-(<nad27sp2401> : missouri east> : nad27sp)110.5 348 Q
-(<nad27sp2402> : missouri central> : nad27sp)110.5 360 Q
-(<nad27sp2403> : missouri west> : nad27sp)110.5 372 Q
-(<nad27sp2501> : montana north> : nad27sp)110.5 384 Q
-(<nad27sp2502> : montana central> : nad27sp)110.5 396 Q
-(<nad27sp2503> : montana south> : nad27sp)110.5 408 Q
-(<nad27sp2601> : nebraska north> : nad27sp)110.5 420 Q
-(<nad27sp2602> : nebraska south> : nad27sp)110.5 432 Q
-(<nad27sp2701> : ne)110.5 444 Q -.25(va)-.25 G(da east> : nad27sp).25 E
-(<nad27sp2702> : ne)110.5 456 Q -.25(va)-.25 G(da central> : nad27sp).25
-E(<nad27sp2703> : ne)110.5 468 Q -.25(va)-.25 G(da west> : nad27sp).25 E
-(<nad27sp2800> : ne)110.5 480 Q 2.5(wh)-.25 G
-(ampshire \255--> : nad27sp)-2.5 E(<nad27sp2900> : ne)110.5 492 Q 2.5
-(wj)-.25 G(erse)-2.5 E 2.5<79ad>-.15 G(--> : nad27sp)-2.5 E
-(<nad27sp3001> : ne)110.5 504 Q 2.5(wm)-.25 G -.15(ex)-2.5 G
-(ico east> : nad27sp).15 E(<nad27sp3002> : ne)110.5 516 Q 2.5(wm)-.25 G
--.15(ex)-2.5 G(ico central> : nad27sp).15 E(<nad27sp3003> : ne)110.5 528
-Q 2.5(wm)-.25 G -.15(ex)-2.5 G(ico west> : nad27sp).15 E
-(<nad27sp3101> : ne)110.5 540 Q 2.5(wy)-.25 G(ork east> : nad27sp)-2.5 E
-(<nad27sp3102> : ne)110.5 552 Q 2.5(wy)-.25 G(ork central> : nad27sp)
--2.5 E(<nad27sp3103> : ne)110.5 564 Q 2.5(wy)-.25 G(ork west> : nad27sp)
--2.5 E(<nad27sp3104> : ne)110.5 576 Q 2.5(wy)-.25 G
-(ork long island> : nad27sp)-2.5 E
-(<nad27sp3200> : north carolina \255--> : nad27sp)110.5 588 Q
-(<nad27sp3301> : north dak)110.5 600 Q(ota north> : nad27sp)-.1 E
-(<nad27sp3302> : north dak)110.5 612 Q(ota south> : nad27sp)-.1 E
-(<nad27sp3401> : ohio north> : nad27sp)110.5 624 Q
-(<nad27sp3402> : ohio south> : nad27sp)110.5 636 Q
-(<nad27sp3501> : oklahoma north> : nad27sp)110.5 648 Q
-(<nad27sp3502> : oklahoma south> : nad27sp)110.5 660 Q
-(<nad27sp3601> : ore)110.5 672 Q(gon north> : nad27sp)-.15 E
-(<nad27sp3602> : ore)110.5 684 Q(gon south> : nad27sp)-.15 E
-(<nad27sp3701> : pennsylv)110.5 696 Q(ania north> : nad27sp)-.25 E
-(<nad27sp3702> : pennsylv)110.5 708 Q(ania south> : nad27sp)-.25 E
-(<nad27sp3800> : rhode island \255--> : nad27sp)110.5 720 Q
-(MB-System 5.0)72 768 Q(13 March 2014)140.11 E(20)193.45 E 0 Cg EP
-%%Page: 21 21
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F
-(<nad27sp3901> : south carolina north> : nad27sp)110.5 84 Q
-(<nad27sp3902> : south carolina south> : nad27sp)110.5 96 Q
-(<nad27sp4001> : south dak)110.5 108 Q(ota north> : nad27sp)-.1 E
-(<nad27sp4002> : south dak)110.5 120 Q(ota south> : nad27sp)-.1 E
-(<nad27sp4100> : tennessee \255--> : nad27sp)110.5 132 Q
-(<nad27sp4201> : te)110.5 144 Q(xas north> : nad27sp)-.15 E
-(<nad27sp4202> : te)110.5 156 Q(xas north central> : nad27sp)-.15 E
-(<nad27sp4203> : te)110.5 168 Q(xas central> : nad27sp)-.15 E
-(<nad27sp4204> : te)110.5 180 Q(xas south central> : nad27sp)-.15 E
-(<nad27sp4205> : te)110.5 192 Q(xas south> : nad27sp)-.15 E
-(<nad27sp4301> : utah north> : nad27sp)110.5 204 Q
-(<nad27sp4302> : utah central> : nad27sp)110.5 216 Q
-(<nad27sp4303> : utah south> : nad27sp)110.5 228 Q(<nad27sp4400> : v)
-110.5 240 Q(ermont \255--> : nad27sp)-.15 E(<nad27sp4501> : vir)110.5
-252 Q(ginia north> : nad27sp)-.18 E(<nad27sp4502> : vir)110.5 264 Q
-(ginia south> : nad27sp)-.18 E(<nad27sp4601> : w)110.5 276 Q
-(ashington north> : nad27sp)-.1 E(<nad27sp4602> : w)110.5 288 Q
-(ashington south> : nad27sp)-.1 E(<nad27sp4701> : west vir)110.5 300 Q
-(ginia north> : nad27sp)-.18 E(<nad27sp4702> : west vir)110.5 312 Q
-(ginia south> : nad27sp)-.18 E
-(<nad27sp4801> : wisconsin north> : nad27sp)110.5 324 Q
-(<nad27sp4802> : wisconsin central> : nad27sp)110.5 336 Q
-(<nad27sp4803> : wisconsin south> : nad27sp)110.5 348 Q
-(<nad27sp4901> : wyoming east> : nad27sp)110.5 360 Q
-(<nad27sp4902> : wyoming east central> : nad27sp)110.5 372 Q
-(<nad27sp4903> : wyoming west central> : nad27sp)110.5 384 Q
-(<nad27sp4904> : wyoming west> : nad27sp)110.5 396 Q
-(<nad27sp5001> : alaska zone no. 1> : nad27sp)110.5 408 Q
-(<nad27sp5002> : alaska zone no. 2> : nad27sp)110.5 420 Q
-(<nad27sp5003> : alaska zone no. 3> : nad27sp)110.5 432 Q
-(<nad27sp5004> : alaska zone no. 4> : nad27sp)110.5 444 Q
-(<nad27sp5005> : alaska zone no. 5> : nad27sp)110.5 456 Q
-(<nad27sp5006> : alaska zone no. 6> : nad27sp)110.5 468 Q
-(<nad27sp5007> : alaska zone no. 7> : nad27sp)110.5 480 Q
-(<nad27sp5008> : alaska zone no. 8> : nad27sp)110.5 492 Q
-(<nad27sp5009> : alaska zone no. 9> : nad27sp)110.5 504 Q
-(<nad27sp5201> : puerto rico and vir)110.5 516 Q(gin islands> : nad27sp)
--.18 E(<nad27sp5202> : vir)110.5 528 Q(gin islands st. croix> : nad27sp)
--.18 E(<nad27sp5400> : guam island> : nad27sp)110.5 540 Q
-(\255--------------------------------------------------------)110.5 564
-Q(State Plane Coordinate Systems)110.5 576 Q(North American Datum 1983)
-110.5 588 Q
-(\255--------------------------------------------------------)110.5 600
-Q(<nad83sp101> : alabama east> : nad83)110.5 612 Q
-(<nad83sp102> : alabama west> : nad83)110.5 624 Q
-(<nad83sp5010> : alaska zone no. 10> : nad83)110.5 636 Q
-(<nad83sp201> : arizona east> : nad83)110.5 648 Q
-(<nad83sp202> : arizona central> : nad83)110.5 660 Q
-(<nad83sp203> : arizona west> : nad83)110.5 672 Q
-(<nad83sp301> : arkansas north> : nad83)110.5 684 Q
-(<nad83sp302> : arkansas south> : nad83)110.5 696 Q
-(<nad83sp401> : california i> : nad83)110.5 708 Q
-(<nad83sp402> : california ii> : nad83)110.5 720 Q(MB-System 5.0)72 768
-Q(13 March 2014)140.11 E(21)193.45 E 0 Cg EP
-%%Page: 22 22
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<nad83sp403> : california iii> : nad83)110.5 84
-Q(<nad83sp404> : california i)110.5 96 Q(v> : nad83)-.25 E
-(<nad83sp405> : california v> : nad83)110.5 108 Q
-(<nad83sp406> : california vi> : nad83)110.5 120 Q
-(<nad83sp501> : colorado north> : nad83)110.5 132 Q
-(<nad83sp502> : colorado central> : nad83)110.5 144 Q
-(<nad83sp503> : colorado south> : nad83)110.5 156 Q
-(<nad83sp600> : connecticut \255--> : nad83)110.5 168 Q
-(<nad83sp700> : dela)110.5 180 Q -.1(wa)-.15 G(re \255--> : nad83).1 E
-(<nad83sp901> : \215orida east> : nad83)110.5 192 Q
-(<nad83sp902> : \215orida west> : nad83)110.5 204 Q
-(<nad83sp903> : \215orida north> : nad83)110.5 216 Q
-(<nad83sp1001> : geor)110.5 228 Q(gia east> : nad83)-.18 E
-(<nad83sp1002> : geor)110.5 240 Q(gia west> : nad83)-.18 E
-(<nad83sp5101> : ha)110.5 252 Q -.1(wa)-.15 G(ii 1> : nad83).1 E
-(<nad83sp5102> : ha)110.5 264 Q -.1(wa)-.15 G(ii 2> : nad83).1 E
-(<nad83sp5103> : ha)110.5 276 Q -.1(wa)-.15 G(ii 3> : nad83).1 E
-(<nad83sp5104> : ha)110.5 288 Q -.1(wa)-.15 G(ii 4> : nad83).1 E
-(<nad83sp5105> : ha)110.5 300 Q -.1(wa)-.15 G(ii 5> : nad83).1 E
-(<nad83sp1101> : idaho east> : nad83)110.5 312 Q
-(<nad83sp1102> : idaho central> : nad83)110.5 324 Q
-(<nad83sp1103> : idaho west> : nad83)110.5 336 Q
-(<nad83sp1201> : illinois east> : nad83)110.5 348 Q
-(<nad83sp1202> : illinois west> : nad83)110.5 360 Q
-(<nad83sp1301> : indiana east> : nad83)110.5 372 Q
-(<nad83sp1302> : indiana west> : nad83)110.5 384 Q(<nad83sp1401> : io)
-110.5 396 Q .2 -.1(wa n)-.25 H(orth> : nad83).1 E(<nad83sp1402> : io)
-110.5 408 Q .2 -.1(wa s)-.25 H(outh> : nad83).1 E
-(<nad83sp1501> : kansas north> : nad83)110.5 420 Q
-(<nad83sp1502> : kansas south> : nad83)110.5 432 Q(<nad83sp1601> : k)
-110.5 444 Q(entuck)-.1 E 2.5(yn)-.15 G(orth> : nad83)-2.5 E
-(<nad83sp1602> : k)110.5 456 Q(entuck)-.1 E 2.5(ys)-.15 G(outh> : nad83)
--2.5 E(<nad83sp1701> : louisiana north> : nad83)110.5 468 Q
-(<nad83sp1702> : louisiana south> : nad83)110.5 480 Q
-(<nad83sp1703> : louisiana of)110.5 492 Q(fshore> : nad83)-.25 E
-(<nad83sp1801> : maine east> : nad83)110.5 504 Q
-(<nad83sp1802> : maine west> : nad83)110.5 516 Q
-(<nad83sp1900> : maryland \255--> : nad83)110.5 528 Q
-(<nad83sp2001> : massachusetts mainland> : nad83)110.5 540 Q
-(<nad83sp2002> : massachusetts island> : nad83)110.5 552 Q
-(<nad83sp2111> : michig)110.5 564 Q(an north> : nad83)-.05 E
-(<nad83sp2112> : michig)110.5 576 Q(an central/l> : nad83)-.05 E
-(<nad83sp2113> : michig)110.5 588 Q(an south> : nad83)-.05 E
-(<nad83sp2201> : minnesota north> : nad83)110.5 600 Q
-(<nad83sp2202> : minnesota central> : nad83)110.5 612 Q
-(<nad83sp2203> : minnesota south> : nad83)110.5 624 Q
-(<nad83sp2301> : mississippi east> : nad83)110.5 636 Q
-(<nad83sp2302> : mississippi west> : nad83)110.5 648 Q
-(<nad83sp2401> : missouri east> : nad83)110.5 660 Q
-(<nad83sp2402> : missouri central> : nad83)110.5 672 Q
-(<nad83sp2403> : missouri west> : nad83)110.5 684 Q
-(<nad83sp2500> : montana> : nad83)110.5 696 Q
-(<nad83sp2600> : nebraska> : nad83)110.5 708 Q(<nad83sp2701> : ne)110.5
-720 Q -.25(va)-.25 G(da east> : nad83).25 E(MB-System 5.0)72 768 Q
-(13 March 2014)140.11 E(22)193.45 E 0 Cg EP
-%%Page: 23 23
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<nad83sp2702> : ne)110.5 84 Q -.25(va)-.25 G
-(da central> : nad83).25 E(<nad83sp2703> : ne)110.5 96 Q -.25(va)-.25 G
-(da west> : nad83).25 E(<nad83sp2800> : ne)110.5 108 Q 2.5(wh)-.25 G
-(ampshire \255--> : nad83)-2.5 E(<nad83sp2900> : ne)110.5 120 Q 2.5(wj)
--.25 G(erse)-2.5 E 2.5<79ad>-.15 G(--> : nad83)-2.5 E
-(<nad83sp3001> : ne)110.5 132 Q 2.5(wm)-.25 G -.15(ex)-2.5 G
-(ico east> : nad83).15 E(<nad83sp3002> : ne)110.5 144 Q 2.5(wm)-.25 G
--.15(ex)-2.5 G(ico central> : nad83).15 E(<nad83sp3003> : ne)110.5 156 Q
-2.5(wm)-.25 G -.15(ex)-2.5 G(ico west> : nad83).15 E(<nad83sp3101> : ne)
-110.5 168 Q 2.5(wy)-.25 G(ork east> : nad83)-2.5 E(<nad83sp3102> : ne)
-110.5 180 Q 2.5(wy)-.25 G(ork central> : nad83)-2.5 E
-(<nad83sp3103> : ne)110.5 192 Q 2.5(wy)-.25 G(ork west> : nad83)-2.5 E
-(<nad83sp3104> : ne)110.5 204 Q 2.5(wy)-.25 G(ork long island> : nad83)
--2.5 E(<nad83sp3200> : north carolina \255--> : nad83)110.5 216 Q
-(<nad83sp3301> : north dak)110.5 228 Q(ota north> : nad83)-.1 E
-(<nad83sp3302> : north dak)110.5 240 Q(ota south> : nad83)-.1 E
-(<nad83sp3401> : ohio north> : nad83)110.5 252 Q
-(<nad83sp3402> : ohio south> : nad83)110.5 264 Q
-(<nad83sp3501> : oklahoma north> : nad83)110.5 276 Q
-(<nad83sp3502> : oklahoma south> : nad83)110.5 288 Q
-(<nad83sp3601> : ore)110.5 300 Q(gon north> : nad83)-.15 E
-(<nad83sp3602> : ore)110.5 312 Q(gon south> : nad83)-.15 E
-(<nad83sp3701> : pennsylv)110.5 324 Q(ania north> : nad83)-.25 E
-(<nad83sp3702> : pennsylv)110.5 336 Q(ania south> : nad83)-.25 E
-(<nad83sp3800> : rhode island \255--> : nad83)110.5 348 Q
-(<nad83sp3900> : south carolina> : nad83)110.5 360 Q
-(<nad83sp4001> : south dak)110.5 372 Q(ota north> : nad83)-.1 E
-(<nad83sp4002> : south dak)110.5 384 Q(ota south> : nad83)-.1 E
-(<nad83sp4100> : tennessee \255--> : nad83)110.5 396 Q
-(<nad83sp4201> : te)110.5 408 Q(xas north> : nad83)-.15 E
-(<nad83sp4202> : te)110.5 420 Q(xas north central> : nad83)-.15 E
-(<nad83sp4203> : te)110.5 432 Q(xas central> : nad83)-.15 E
-(<nad83sp4204> : te)110.5 444 Q(xas south central> : nad83)-.15 E
-(<nad83sp4205> : te)110.5 456 Q(xas south> : nad83)-.15 E
-(<nad83sp4301> : utah north> : nad83)110.5 468 Q
-(<nad83sp4302> : utah central> : nad83)110.5 480 Q
-(<nad83sp4303> : utah south> : nad83)110.5 492 Q(<nad83sp4400> : v)110.5
-504 Q(ermont \255--> : nad83)-.15 E(<nad83sp4501> : vir)110.5 516 Q
-(ginia north> : nad83)-.18 E(<nad83sp4502> : vir)110.5 528 Q
-(ginia south> : nad83)-.18 E(<nad83sp4601> : w)110.5 540 Q
-(ashington north> : nad83)-.1 E(<nad83sp4602> : w)110.5 552 Q
-(ashington south> : nad83)-.1 E(<nad83sp4701> : west vir)110.5 564 Q
-(ginia north> : nad83)-.18 E(<nad83sp4702> : west vir)110.5 576 Q
-(ginia south> : nad83)-.18 E(<nad83sp4801> : wisconsin north> : nad83)
-110.5 588 Q(<nad83sp4802> : wisconsin central> : nad83)110.5 600 Q
-(<nad83sp4803> : wisconsin south> : nad83)110.5 612 Q
-(<nad83sp4901> : wyoming east> : nad83)110.5 624 Q
-(<nad83sp4902> : wyoming east central> : nad83)110.5 636 Q
-(<nad83sp4903> : wyoming west central> : nad83)110.5 648 Q
-(<nad83sp4904> : wyoming west> : nad83)110.5 660 Q
-(<nad83sp5001> : alaska zone no. 1> : nad83)110.5 672 Q
-(<nad83sp5002> : alaska zone no. 2> : nad83)110.5 684 Q
-(<nad83sp5003> : alaska zone no. 3> : nad83)110.5 696 Q
-(<nad83sp5004> : alaska zone no. 4> : nad83)110.5 708 Q
-(<nad83sp5005> : alaska zone no. 5> : nad83)110.5 720 Q(MB-System 5.0)72
-768 Q(13 March 2014)140.11 E(23)193.45 E 0 Cg EP
-%%Page: 24 24
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<nad83sp5006> : alaska zone no. 6> : nad83)
-110.5 84 Q(<nad83sp5007> : alaska zone no. 7> : nad83)110.5 96 Q
-(<nad83sp5008> : alaska zone no. 8> : nad83)110.5 108 Q
-(<nad83sp5009> : alaska zone no. 9> : nad83)110.5 120 Q
-(<nad83sp5200> : puerto rico and vir)110.5 132 Q(gin islands> : nad83)
--.18 E(\255--------------------------------------------------------)
-110.5 156 Q(Great Lak)110.5 168 Q(es Grids using Clark)-.1 E 2.5(e1)-.1
-G(866 ellipsoid)-2.5 E
-(\255--------------------------------------------------------)110.5 180
-Q(<erie-etal> : Lak)110.5 192 Q 2.5(eE)-.1 G(rie, Ontario and St. La)
--2.5 E(wrence Ri)-.15 E -.15(ve)-.25 G -.55(r.).15 G(<huron> : Lak)110.5
-204 Q 2.5(eH)-.1 G(uron)-2.5 E(<michig)110.5 216 Q(an> : Lak)-.05 E 2.5
-(eM)-.1 G(ichig)-2.5 E(an)-.05 E(<superior> : Lak)110.5 228 Q 2.5(eS)-.1
-G(uperior)-2.5 E 2.5(,L)-.4 G(ak)-2.5 E 2.5(eo)-.1 G 2.5(ft)-2.5 G(he W)
--2.5 E(oods)-.8 E
-(\255--------------------------------------------------------)110.5 252
-Q(EPSG projection de\214nitions)110.5 264 Q
-(\255--------------------------------------------------------)110.5 276
-Q(<epsg4001> : Unkno)110.5 288 Q
-(wn datum based upon the Airy 1830 ellipsoid)-.25 E(<epsg4002> : Unkno)
-110.5 300 Q(wn datum based upon the Airy Modi\214ed 1849 ellipsoid)-.25
-E(<epsg4003> : Unkno)110.5 312 Q
-(wn datum based upon the Australian National Spheroid)-.25 E
-(<epsg4004> : Unkno)110.5 324 Q
-(wn datum based upon the Bessel 1841 ellipsoid)-.25 E
-(<epsg4005> : Unkno)110.5 336 Q
-(wn datum based upon the Bessel Modi\214ed ellipsoid)-.25 E
-(<epsg4006> : Unkno)110.5 348 Q
-(wn datum based upon the Bessel Namibia ellipsoid)-.25 E
-(<epsg4007> : Unkno)110.5 360 Q(wn datum based upon the Clark)-.25 E 2.5
-(e1)-.1 G(858 ellipsoid)-2.5 E(<epsg4008> : Unkno)110.5 372 Q
-(wn datum based upon the Clark)-.25 E 2.5(e1)-.1 G(866 ellipsoid)-2.5 E
-(<epsg4009> : Unkno)110.5 384 Q(wn datum based upon the Clark)-.25 E 2.5
-(e1)-.1 G(866 Michig)-2.5 E(an ellipsoid)-.05 E(<epsg4010> : Unkno)110.5
-396 Q(wn datum based upon the Clark)-.25 E 2.5(e1)-.1 G
-(880 \(Benoit\) ellipsoid)-2.5 E(<epsg4011> : Unkno)110.5 408 Q
-(wn datum based upon the Clark)-.25 E 2.5(e1)-.1 G
-(880 \(IGN\) ellipsoid)-2.5 E(<epsg4012> : Unkno)110.5 420 Q
-(wn datum based upon the Clark)-.25 E 2.5(e1)-.1 G
-(880 \(RGS\) ellipsoid)-2.5 E(<epsg4013> : Unkno)110.5 432 Q
-(wn datum based upon the Clark)-.25 E 2.5(e1)-.1 G
-(880 \(Arc\) ellipsoid)-2.5 E(<epsg4014> : Unkno)110.5 444 Q
-(wn datum based upon the Clark)-.25 E 2.5(e1)-.1 G
-(880 \(SGA 1922\) ellipsoid)-2.5 E(<epsg4015> : Unkno)110.5 456 Q
-(wn datum based upon the Ev)-.25 E
-(erest 1830 \(1937 Adjustment\) ellipsoid)-.15 E(<epsg4016> : Unkno)
-110.5 468 Q(wn datum based upon the Ev)-.25 E
-(erest 1830 \(1967 De\214nition\) ellipsoid)-.15 E(<epsg4018> : Unkno)
-110.5 480 Q(wn datum based upon the Ev)-.25 E
-(erest 1830 Modi\214ed ellipsoid)-.15 E(<epsg4019> : Unkno)110.5 492 Q
-(wn datum based upon the GRS 1980 ellipsoid)-.25 E(<epsg4020> : Unkno)
-110.5 504 Q(wn datum based upon the Helmert 1906 ellipsoid)-.25 E
-(<epsg4021> : Unkno)110.5 516 Q
-(wn datum based upon the Indonesian National Spheroid)-.25 E
-(<epsg4022> : Unkno)110.5 528 Q
-(wn datum based upon the International 1924 ellipsoid)-.25 E
-(<epsg4024> : Unkno)110.5 540 Q(wn datum based upon the Krasso)-.25 E
-(wsk)-.25 E 2.5(y1)-.15 G(940 ellipsoid)-2.5 E(<epsg4025> : Unkno)110.5
-552 Q(wn datum based upon the NWL 9D ellipsoid)-.25 E
-(<epsg4027> : Unkno)110.5 564 Q
-(wn datum based upon the Plessis 1817 ellipsoid)-.25 E
-(<epsg4028> : Unkno)110.5 576 Q(wn datum based upon the Struv)-.25 E 2.5
-(e1)-.15 G(860 ellipsoid)-2.5 E(<epsg4029> : Unkno)110.5 588 Q
-(wn datum based upon the W)-.25 E(ar Of)-.8 E(\214ce ellipsoid)-.25 E
-(<epsg4030> : Unkno)110.5 600 Q
-(wn datum based upon the WGS 84 ellipsoid)-.25 E(<epsg4031> : Unkno)
-110.5 612 Q(wn datum based upon the GEM 10C ellipsoid)-.25 E
-(<epsg4032> : Unkno)110.5 624 Q
-(wn datum based upon the OSU86F ellipsoid)-.25 E(<epsg4033> : Unkno)
-110.5 636 Q(wn datum based upon the OSU91A ellipsoid)-.25 E
-(<epsg4034> : Unkno)110.5 648 Q(wn datum based upon the Clark)-.25 E 2.5
-(e1)-.1 G(880 ellipsoid)-2.5 E(<epsg4035> : Unkno)110.5 660 Q
-(wn datum based upon the Authalic Sphere)-.25 E(<epsg4036> : Unkno)110.5
-672 Q(wn datum based upon the GRS 1967 ellipsoid)-.25 E
-(<epsg4041> : Unkno)110.5 684 Q(wn datum based upon the A)-.25 E -.15
-(ve)-.74 G(rage T).15 E(errestrial System 1977 ellipsoid)-.7 E
-(<epsg4042> : Unkno)110.5 696 Q(wn datum based upon the Ev)-.25 E
-(erest \(1830 De\214nition\) ellipsoid)-.15 E(<epsg4043> : Unkno)110.5
-708 Q(wn datum based upon the WGS 72 ellipsoid)-.25 E
-(<epsg4044> : Unkno)110.5 720 Q(wn datum based upon the Ev)-.25 E
-(erest 1830 \(1962 De\214nition\) ellipsoid)-.15 E(MB-System 5.0)72 768
-Q(13 March 2014)140.11 E(24)193.45 E 0 Cg EP
-%%Page: 25 25
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<epsg4045> : Unkno)110.5 84 Q
-(wn datum based upon the Ev)-.25 E
-(erest 1830 \(1975 De\214nition\) ellipsoid)-.15 E(<epsg4047> : Unspeci\
-\214ed datum based upon the GRS 1980 Authalic Sphere)110.5 96 Q
-(<epsg4052> : Unspeci\214ed datum based upon the Clark)110.5 108 Q 2.5
-(e1)-.1 G(866 Authalic Sphere)-2.5 E(<epsg4053> : Unspeci\214ed datum b\
-ased upon the International 1924 Authalic Sphere)110.5 120 Q
-(<epsg4054> : Unspeci\214ed datum based upon the Hughes 1980 ellipsoid)
-110.5 132 Q(<epsg4120> : Greek)110.5 144 Q(<epsg4121> : GGRS87)110.5 156
-Q(<epsg4122> : A)110.5 168 Q(TS77)-1.11 E(<epsg4123> : KKJ)110.5 180 Q
-(<epsg4124> : R)110.5 192 Q(T90)-.6 E(<epsg4125> : Samboja)110.5 204 Q
-(<epsg4126> : LKS94 \(ETRS89\))110.5 216 Q(<epsg4127> : T)110.5 228 Q
-(ete)-.7 E(<epsg4128> : Madzansua)110.5 240 Q(<epsg4129> : Observ)110.5
-252 Q(atario)-.25 E(<epsg4130> : Moznet)110.5 264 Q
-(<epsg4131> : Indian 1960)110.5 276 Q(<epsg4132> : FD58)110.5 288 Q
-(<epsg4133> : EST92)110.5 300 Q(<epsg4134> : PDO Surv)110.5 312 Q .3
--.15(ey D)-.15 H(atum 1993).15 E(<epsg4135> : Old Ha)110.5 324 Q -.1(wa)
--.15 G(iian).1 E(<epsg4136> : St. La)110.5 336 Q(wrence Island)-.15 E
-(<epsg4137> : St. P)110.5 348 Q(aul Island)-.15 E(<epsg4138> : St. Geor)
-110.5 360 Q(ge Island)-.18 E(<epsg4139> : Puerto Rico)110.5 372 Q
-(<epsg4140> : N)110.5 384 Q(AD83\(CSRS98\))-.35 E(<epsg4141> : Israel)
-110.5 396 Q(<epsg4142> : Locodjo 1965)110.5 408 Q
-(<epsg4143> : Abidjan 1987)110.5 420 Q(<epsg4144> : Kalianpur 1937)110.5
-432 Q(<epsg4145> : Kalianpur 1962)110.5 444 Q
-(<epsg4146> : Kalianpur 1975)110.5 456 Q(<epsg4147> : Hanoi 1972)110.5
-468 Q(<epsg4148> : Hartebeesthoek94)110.5 480 Q(<epsg4149> : CH1903)
-110.5 492 Q(<epsg4150> : CH1903+)110.5 504 Q(<epsg4151> : CHTRF95)110.5
-516 Q(<epsg4152> : N)110.5 528 Q(AD83\(HARN\))-.35 E
-(<epsg4153> : Rassadiran)110.5 540 Q(<epsg4154> : ED50\(ED77\))110.5 552
-Q(<epsg4155> : Dabola 1981)110.5 564 Q(<epsg4156> : S-JTSK)110.5 576 Q
-(<epsg4157> : Mount Dillon)110.5 588 Q(<epsg4158> : Naparima 1955)110.5
-600 Q(<epsg4159> : ELD79)110.5 612 Q(<epsg4160> : Chos Malal 1914)110.5
-624 Q(<epsg4161> : P)110.5 636 Q(ampa del Castillo)-.15 E
-(<epsg4162> : K)110.5 648 Q(orean 1985)-.35 E(<epsg4163> : Y)110.5 660 Q
-(emen NGN96)-1 E(<epsg4164> : South Y)110.5 672 Q(emen)-1 E
-(<epsg4165> : Bissau)110.5 684 Q(<epsg4166> : K)110.5 696 Q(orean 1995)
--.35 E(<epsg4167> : NZGD2000)110.5 708 Q(<epsg4168> : Accra)110.5 720 Q
-(MB-System 5.0)72 768 Q(13 March 2014)140.11 E(25)193.45 E 0 Cg EP
-%%Page: 26 26
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<epsg4169> : American Samoa 1962)110.5 84 Q
-(<epsg4170> : SIRGAS)110.5 96 Q(<epsg4171> : RGF93)110.5 108 Q
-(<epsg4172> : POSGAR)110.5 120 Q(<epsg4173> : IRENET95)110.5 132 Q
-(<epsg4174> : Sierra Leone 1924)110.5 144 Q
-(<epsg4175> : Sierra Leone 1968)110.5 156 Q
-(<epsg4176> : Australian Antarctic)110.5 168 Q(<epsg4178> : Pulk)110.5
-180 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942\(83\))-2.5 E(<epsg4179> : Pulk)
-110.5 192 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942\(58\))-2.5 E
-(<epsg4180> : EST97)110.5 204 Q(<epsg4181> : Lux)110.5 216 Q(embour)-.15
-E 2.5(g1)-.18 G(930)-2.5 E(<epsg4182> : Azores Occidental 1939)110.5 228
-Q(<epsg4183> : Azores Central 1948)110.5 240 Q
-(<epsg4184> : Azores Oriental 1940)110.5 252 Q
-(<epsg4185> : Madeira 1936)110.5 264 Q(<epsg4188> : OSNI 1952)110.5 276
-Q(<epsg4189> : REGVEN)110.5 288 Q(<epsg4190> : POSGAR 98)110.5 300 Q
-(<epsg4191> : Albanian 1987)110.5 312 Q(<epsg4192> : Douala 1948)110.5
-324 Q(<epsg4193> : Manoca 1962)110.5 336 Q(<epsg4194> : Qornoq 1927)
-110.5 348 Q(<epsg4195> : Scoresbysund 1952)110.5 360 Q
-(<epsg4196> : Ammassalik 1958)110.5 372 Q(<epsg4197> : Garoua)110.5 384
-Q(<epsg4198> : K)110.5 396 Q(ousseri)-.35 E(<epsg4199> : Egypt 1930)
-110.5 408 Q(<epsg4200> : Pulk)110.5 420 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995)-2.5 E(<epsg4201> : Adindan)110.5 432 Q(<epsg4202> : A)110.5 444 Q
-(GD66)-.4 E(<epsg4203> : A)110.5 456 Q(GD84)-.4 E
-(<epsg4204> : Ain el Abd)110.5 468 Q(<epsg4205> : Afgoo)110.5 480 Q(ye)
--.1 E(<epsg4206> : Ag)110.5 492 Q(adez)-.05 E(<epsg4207> : Lisbon)110.5
-504 Q(<epsg4208> : Aratu)110.5 516 Q(<epsg4209> : Arc 1950)110.5 528 Q
-(<epsg4210> : Arc 1960)110.5 540 Q(<epsg4211> : Bata)110.5 552 Q(via)-.2
-E(<epsg4212> : Barbados 1938)110.5 564 Q(<epsg4213> : Beduaram)110.5 576
-Q(<epsg4214> : Beijing 1954)110.5 588 Q(<epsg4215> : Belge 1950)110.5
-600 Q(<epsg4216> : Bermuda 1957)110.5 612 Q(<epsg4218> : Bogota 1975)
-110.5 624 Q(<epsg4219> : Bukit Rimpah)110.5 636 Q(<epsg4220> : Camacupa)
-110.5 648 Q(<epsg4221> : Campo Inchauspe)110.5 660 Q(<epsg4222> : Cape)
-110.5 672 Q(<epsg4223> : Carthage)110.5 684 Q(<epsg4224> : Chua)110.5
-696 Q(<epsg4225> : Corre)110.5 708 Q(go Ale)-.15 E(gre)-.15 E
-(<epsg4226> : Cote d'Iv)110.5 720 Q(oire)-.2 E(MB-System 5.0)72 768 Q
-(13 March 2014)140.11 E(26)193.45 E 0 Cg EP
-%%Page: 27 27
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<epsg4227> : Deir ez Zor)110.5 84 Q
-(<epsg4228> : Douala)110.5 96 Q(<epsg4229> : Egypt 1907)110.5 108 Q
-(<epsg4230> : ED50)110.5 120 Q(<epsg4231> : ED87)110.5 132 Q
-(<epsg4232> : F)110.5 144 Q(ahud)-.15 E(<epsg4233> : Gandajika 1970)
-110.5 156 Q(<epsg4234> : Garoua)110.5 168 Q
-(<epsg4235> : Guyane Francaise)110.5 180 Q(<epsg4236> : Hu Tzu Shan)
-110.5 192 Q(<epsg4237> : HD72)110.5 204 Q(<epsg4238> : ID74)110.5 216 Q
-(<epsg4239> : Indian 1954)110.5 228 Q(<epsg4240> : Indian 1975)110.5 240
-Q(<epsg4241> : Jamaica 1875)110.5 252 Q(<epsg4242> : J)110.5 264 Q(AD69)
--.6 E(<epsg4243> : Kalianpur 1880)110.5 276 Q(<epsg4244> : Kanda)110.5
-288 Q -.1(wa)-.15 G(la).1 E(<epsg4245> : K)110.5 300 Q(ertau 1968)-.25 E
-(<epsg4246> : K)110.5 312 Q(OC)-.3 E(<epsg4247> : La Canoa)110.5 324 Q
-(<epsg4248> : PSAD56)110.5 336 Q(<epsg4249> : Lak)110.5 348 Q(e)-.1 E
-(<epsg4250> : Leigon)110.5 360 Q(<epsg4251> : Liberia 1964)110.5 372 Q
-(<epsg4252> : Lome)110.5 384 Q(<epsg4253> : Luzon 1911)110.5 396 Q
-(<epsg4254> : Hito XVIII 1963)110.5 408 Q(<epsg4255> : Herat North)110.5
-420 Q(<epsg4256> : Mahe 1971)110.5 432 Q(<epsg4257> : Makassar)110.5 444
-Q(<epsg4258> : ETRS89)110.5 456 Q(<epsg4259> : Malongo 1987)110.5 468 Q
-(<epsg4260> : Manoca)110.5 480 Q(<epsg4261> : Merchich)110.5 492 Q
-(<epsg4262> : Massa)110.5 504 Q -.1(wa)-.15 G(<epsg4263> : Minna)110.5
-516 Q(<epsg4264> : Mhast)110.5 528 Q(<epsg4265> : Monte Mario)110.5 540
-Q(<epsg4266> : M'poralok)110.5 552 Q(o)-.1 E(<epsg4267> : N)110.5 564 Q
-(AD27)-.35 E(<epsg4268> : N)110.5 576 Q(AD27 Michig)-.35 E(an)-.05 E
-(<epsg4269> : N)110.5 588 Q(AD83)-.35 E(<epsg4270> : Nahrw)110.5 600 Q
-(an 1967)-.1 E(<epsg4271> : Naparima 1972)110.5 612 Q
-(<epsg4272> : NZGD49)110.5 624 Q(<epsg4273> : NGO 1948)110.5 636 Q
-(<epsg4274> : Datum 73)110.5 648 Q(<epsg4275> : NTF)110.5 660 Q
-(<epsg4276> : NSWC 9Z-2)110.5 672 Q(<epsg4277> : OSGB 1936)110.5 684 Q
-(<epsg4278> : OSGB70)110.5 696 Q(<epsg4279> : OS\(SN\)80)110.5 708 Q
-(<epsg4280> : P)110.5 720 Q(adang)-.15 E(MB-System 5.0)72 768 Q
-(13 March 2014)140.11 E(27)193.45 E 0 Cg EP
-%%Page: 28 28
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<epsg4281> : P)110.5 84 Q(alestine 1923)-.15 E
-(<epsg4282> : Pointe Noire)110.5 96 Q(<epsg4283> : GD)110.5 108 Q(A94)
--.4 E(<epsg4284> : Pulk)110.5 120 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942)-2.5
-E(<epsg4285> : Qatar 1974)110.5 132 Q(<epsg4286> : Qatar 1948)110.5 144
-Q(<epsg4287> : Qornoq)110.5 156 Q(<epsg4288> : Loma Quintana)110.5 168 Q
-(<epsg4289> : Amersfoort)110.5 180 Q(<epsg4291> : SAD69)110.5 192 Q
-(<epsg4292> : Sapper Hill 1943)110.5 204 Q(<epsg4293> : Schw)110.5 216 Q
-(arzeck)-.1 E(<epsg4294> : Se)110.5 228 Q(gora)-.15 E
-(<epsg4295> : Serindung)110.5 240 Q(<epsg4296> : Sudan)110.5 252 Q
-(<epsg4297> : T)110.5 264 Q(ananari)-.8 E -.15(ve)-.25 G(<epsg4298> : T)
-110.5 276 Q(imbalai 1948)-.35 E(<epsg4299> : TM65)110.5 288 Q
-(<epsg4300> : TM75)110.5 300 Q(<epsg4301> : T)110.5 312 Q(ok)-.8 E(yo)
--.15 E(<epsg4302> : T)110.5 324 Q(rinidad 1903)-.35 E
-(<epsg4303> : TC\(1948\))110.5 336 Q(<epsg4304> : V)110.5 348 Q
-(oirol 1875)-1.29 E(<epsg4306> : Bern 1938)110.5 360 Q
-(<epsg4307> : Nord Sahara 1959)110.5 372 Q(<epsg4308> : R)110.5 384 Q
-(T38)-.6 E(<epsg4309> : Y)110.5 396 Q(acare)-1 E(<epsg4310> : Y)110.5
-408 Q(of)-1.1 E(f)-.25 E(<epsg4311> : Zanderij)110.5 420 Q
-(<epsg4312> : MGI)110.5 432 Q(<epsg4313> : Belge 1972)110.5 444 Q
-(<epsg4314> : DHDN)110.5 456 Q(<epsg4315> : Conakry 1905)110.5 468 Q
-(<epsg4316> : Dealul Piscului 1933)110.5 480 Q
-(<epsg4317> : Dealul Piscului 1970)110.5 492 Q(<epsg4318> : NGN)110.5
-504 Q(<epsg4319> : KUD)110.5 516 Q(AMS)-.4 E(<epsg4322> : WGS 72)110.5
-528 Q(<epsg4324> : WGS 72BE)110.5 540 Q(<epsg4326> : WGS 84)110.5 552 Q
-(<epsg4600> : Anguilla 1957)110.5 564 Q(<epsg4601> : Antigua 1943)110.5
-576 Q(<epsg4602> : Dominica 1945)110.5 588 Q(<epsg4603> : Grenada 1953)
-110.5 600 Q(<epsg4604> : Montserrat 1958)110.5 612 Q
-(<epsg4605> : St. Kitts 1955)110.5 624 Q(<epsg4606> : St. Lucia 1955)
-110.5 636 Q(<epsg4607> : St. V)110.5 648 Q(incent 1945)-.6 E
-(<epsg4608> : N)110.5 660 Q(AD27\(76\))-.35 E(<epsg4609> : N)110.5 672 Q
-(AD27\(CGQ77\))-.35 E(<epsg4610> : Xian 1980)110.5 684 Q
-(<epsg4611> : Hong K)110.5 696 Q(ong 1980)-.35 E(<epsg4612> : JGD2000)
-110.5 708 Q(<epsg4613> : Se)110.5 720 Q -.05(ga)-.15 G(ra).05 E
-(MB-System 5.0)72 768 Q(13 March 2014)140.11 E(28)193.45 E 0 Cg EP
-%%Page: 29 29
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<epsg4614> : QND95)110.5 84 Q
-(<epsg4615> : Porto Santo)110.5 96 Q(<epsg4616> : Selv)110.5 108 Q
-(agem Grande)-.25 E(<epsg4617> : N)110.5 120 Q(AD83\(CSRS\))-.35 E
-(<epsg4618> : SAD69)110.5 132 Q(<epsg4619> : SWEREF99)110.5 144 Q
-(<epsg4620> : Point 58)110.5 156 Q(<epsg4621> : F)110.5 168 Q
-(ort Marigot)-.15 E(<epsg4622> : Guadeloupe 1948)110.5 180 Q
-(<epsg4623> : CSG67)110.5 192 Q(<epsg4624> : RGFG95)110.5 204 Q
-(<epsg4625> : Martinique 1938)110.5 216 Q(<epsg4626> : Reunion 1947)
-110.5 228 Q(<epsg4627> : RGR92)110.5 240 Q(<epsg4628> : T)110.5 252 Q
-(ahiti 52)-.8 E(<epsg4629> : T)110.5 264 Q(ahaa 54)-.8 E
-(<epsg4630> : IGN72 Nuku Hi)110.5 276 Q -.25(va)-.25 G
-(<epsg4631> : K0 1949)110.5 288 Q(<epsg4632> : Combani 1950)110.5 300 Q
-(<epsg4633> : IGN56 Lifou)110.5 312 Q(<epsg4634> : IGN72 Grand T)110.5
-324 Q(erre)-.7 E(<epsg4635> : ST87 Ouv)110.5 336 Q(ea)-.15 E
-(<epsg4636> : Petrels 1972)110.5 348 Q(<epsg4637> : Perroud 1950)110.5
-360 Q(<epsg4638> : Saint Pierre et Miquelon 1950)110.5 372 Q
-(<epsg4639> : MOP78)110.5 384 Q(<epsg4640> : RRAF 1991)110.5 396 Q
-(<epsg4641> : IGN53 Mare)110.5 408 Q(<epsg4642> : ST84 Ile des Pins)
-110.5 420 Q(<epsg4643> : ST71 Belep)110.5 432 Q
-(<epsg4644> : NEA74 Noumea)110.5 444 Q(<epsg4645> : RGNC 1991)110.5 456
-Q(<epsg4646> : Grand Comoros)110.5 468 Q(<epsg4657> : Re)110.5 480 Q
-(ykja)-.15 E(vik 1900)-.2 E(<epsg4658> : Hjorse)110.5 492 Q 2.5(y1)-.15
-G(955)-2.5 E(<epsg4659> : ISN93)110.5 504 Q(<epsg4660> : Helle 1954)
-110.5 516 Q(<epsg4661> : LKS92)110.5 528 Q(<epsg4662> : IGN72 Grande T)
-110.5 540 Q(erre)-.7 E(<epsg4663> : Porto Santo 1995)110.5 552 Q
-(<epsg4664> : Azores Oriental 1995)110.5 564 Q
-(<epsg4665> : Azores Central 1995)110.5 576 Q(<epsg4666> : Lisbon 1890)
-110.5 588 Q(<epsg4667> : IKBD-92)110.5 600 Q(<epsg4668> : ED79)110.5 612
-Q(<epsg4669> : LKS94)110.5 624 Q(<epsg4670> : IGM95)110.5 636 Q
-(<epsg4671> : V)110.5 648 Q(oirol 1879)-1.29 E(<epsg4672> : CI1971)110.5
-660 Q(<epsg4673> : CI1979)110.5 672 Q(<epsg4674> : SIRGAS 2000)110.5 684
-Q(<epsg4675> : Guam 1963)110.5 696 Q(<epsg4676> : V)110.5 708 Q
-(ientiane 1982)-.6 E(<epsg4677> : Lao 1993)110.5 720 Q(MB-System 5.0)72
-768 Q(13 March 2014)140.11 E(29)193.45 E 0 Cg EP
-%%Page: 30 30
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<epsg4678> : Lao 1997)110.5 84 Q
-(<epsg4679> : Jouik 1961)110.5 96 Q(<epsg4680> : Nouakchott 1965)110.5
-108 Q(<epsg4681> : Mauritania 1999)110.5 120 Q(<epsg4682> : Gulshan 303)
-110.5 132 Q(<epsg4683> : PRS92)110.5 144 Q(<epsg4684> : Gan 1970)110.5
-156 Q(<epsg4685> : Gandajika)110.5 168 Q(<epsg4686> : MA)110.5 180 Q(GN)
--.4 E(A-SIRGAS)-.35 E(<epsg4687> : RGPF)110.5 192 Q(<epsg4688> : F)110.5
-204 Q(atu Iv)-.15 E 2.5(a7)-.25 G(2)-2.5 E(<epsg4689> : IGN63 Hi)110.5
-216 Q .5 -.25(va O)-.25 H(a).25 E(<epsg4690> : T)110.5 228 Q(ahiti 79)
--.8 E(<epsg4691> : Moorea 87)110.5 240 Q(<epsg4692> : Maupiti 83)110.5
-252 Q(<epsg4693> : Nakhl-e Ghanem)110.5 264 Q(<epsg4694> : POSGAR 94)
-110.5 276 Q(<epsg4695> : Katang)110.5 288 Q 2.5(a1)-.05 G(955)-2.5 E
-(<epsg4696> : Kasai 1953)110.5 300 Q(<epsg4697> : IGC 1962 6th P)110.5
-312 Q(arallel South)-.15 E(<epsg4698> : IGN 1962 K)110.5 324 Q(er)-.25 E
-(guelen)-.18 E(<epsg4699> : Le Pouce 1934)110.5 336 Q
-(<epsg4700> : IGN Astro 1960)110.5 348 Q(<epsg4701> : IGCB 1955)110.5
-360 Q(<epsg4702> : Mauritania 1999)110.5 372 Q(<epsg4703> : Mhast 1951)
-110.5 384 Q(<epsg4704> : Mhast \(onshore\))110.5 396 Q
-(<epsg4705> : Mhast \(of)110.5 408 Q(fshore\))-.25 E
-(<epsg4706> : Egypt Gulf of Suez S-650 TL)110.5 420 Q(<epsg4707> : T)
-110.5 432 Q(ern Island 1961)-.7 E(<epsg4708> : Cocos Islands 1965)110.5
-444 Q(<epsg4709> : Iw)110.5 456 Q 2.5(oJ)-.1 G(ima 1945)-2.5 E
-(<epsg4710> : St. Helena 1971)110.5 468 Q
-(<epsg4711> : Marcus Island 1952)110.5 480 Q
-(<epsg4712> : Ascension Island 1958)110.5 492 Q(<epsg4713> : A)110.5 504
-Q(yabelle Lighthouse)-.92 E(<epsg4714> : Belle)110.5 516 Q(vue)-.25 E
-(<epsg4715> : Camp Area Astro)110.5 528 Q
-(<epsg4716> : Phoenix Islands 1966)110.5 540 Q(<epsg4717> : Cape Cana)
-110.5 552 Q -.15(ve)-.2 G(ral).15 E(<epsg4718> : Solomon 1968)110.5 564
-Q(<epsg4719> : Easter Island 1967)110.5 576 Q(<epsg4720> : Fiji 1986)
-110.5 588 Q(<epsg4721> : Fiji 1956)110.5 600 Q(<epsg4722> : South Geor)
-110.5 612 Q(gia 1968)-.18 E(<epsg4723> : Grand Cayman 1959)110.5 624 Q
-(<epsg4724> : Die)110.5 636 Q(go Garcia 1969)-.15 E
-(<epsg4725> : Johnston Island 1961)110.5 648 Q
-(<epsg4726> : Little Cayman 1961)110.5 660 Q(<epsg4727> : Midw)110.5 672
-Q(ay 1961)-.1 E(<epsg4728> : Pico de la Nie)110.5 684 Q -.15(ve)-.25 G
-(s).15 E(<epsg4729> : Pitcairn 1967)110.5 696 Q(<epsg4730> : Santo 1965)
-110.5 708 Q(<epsg4731> : V)110.5 720 Q(iti Le)-.6 E(vu 1916)-.25 E
-(MB-System 5.0)72 768 Q(13 March 2014)140.11 E(30)193.45 E 0 Cg EP
-%%Page: 31 31
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<epsg4732> : Marshall Islands 1960)110.5 84 Q
-(<epsg4733> : W)110.5 96 Q(ak)-.8 E 2.5(eI)-.1 G(sland 1952)-2.5 E
-(<epsg4734> : T)110.5 108 Q(ristan 1968)-.35 E(<epsg4735> : K)110.5 120
-Q(usaie 1951)-.15 E(<epsg4736> : Deception Island)110.5 132 Q
-(<epsg4737> : K)110.5 144 Q(orea 2000)-.35 E(<epsg4738> : Hong K)110.5
-156 Q(ong 1963)-.35 E(<epsg4739> : Hong K)110.5 168 Q(ong 1963\(67\))
--.35 E(<epsg4740> : PZ-90)110.5 180 Q(<epsg4741> : FD54)110.5 192 Q
-(<epsg4742> : GDM2000)110.5 204 Q
-(<epsg4743> : Karbala 1979 \(Polservice\))110.5 216 Q
-(<epsg4744> : Nahrw)110.5 228 Q(an 1934)-.1 E(<epsg4745> : RD/83)110.5
-240 Q(<epsg4746> : PD/83)110.5 252 Q(<epsg4747> : GR96)110.5 264 Q
-(<epsg4748> : V)110.5 276 Q(anua Le)-1.11 E(vu 1915)-.25 E
-(<epsg4749> : RGNC91-93)110.5 288 Q(<epsg4750> : ST87 Ouv)110.5 300 Q
-(ea)-.15 E(<epsg4751> : K)110.5 312 Q(ertau \(RSO\))-.25 E
-(<epsg4752> : V)110.5 324 Q(iti Le)-.6 E(vu 1912)-.25 E
-(<epsg4753> : fk89)110.5 336 Q(<epsg4754> : LGD2006)110.5 348 Q
-(<epsg4755> : DGN95)110.5 360 Q(<epsg4756> : VN-2000)110.5 372 Q
-(<epsg4757> : SVY21)110.5 384 Q(<epsg4758> : J)110.5 396 Q(AD2001)-.6 E
-(<epsg4759> : N)110.5 408 Q(AD83\(NSRS2007\))-.35 E(<epsg4760> : WGS 66)
-110.5 420 Q(<epsg4801> : Bern 1898 \(Bern\))110.5 432 Q
-(<epsg4802> : Bogota 1975 \(Bogota\))110.5 444 Q
-(<epsg4803> : Lisbon \(Lisbon\))110.5 456 Q
-(<epsg4804> : Makassar \(Jakarta\))110.5 468 Q
-(<epsg4805> : MGI \(Ferro\))110.5 480 Q
-(<epsg4806> : Monte Mario \(Rome\))110.5 492 Q(<epsg4807> : NTF \(P)
-110.5 504 Q(aris\))-.15 E(<epsg4808> : P)110.5 516 Q(adang \(Jakarta\))
--.15 E(<epsg4809> : Belge 1950 \(Brussels\))110.5 528 Q(<epsg4810> : T)
-110.5 540 Q(ananari)-.8 E .3 -.15(ve \()-.25 H -.15(Pa).15 G(ris\)).15 E
-(<epsg4811> : V)110.5 552 Q(oirol 1875 \(P)-1.29 E(aris\))-.15 E
-(<epsg4813> : Bata)110.5 564 Q(via \(Jakarta\))-.2 E(<epsg4814> : R)
-110.5 576 Q(T38 \(Stockholm\))-.6 E(<epsg4815> : Greek \(Athens\))110.5
-588 Q(<epsg4816> : Carthage \(P)110.5 600 Q(aris\))-.15 E
-(<epsg4817> : NGO 1948 \(Oslo\))110.5 612 Q
-(<epsg4818> : S-JTSK \(Ferro\))110.5 624 Q
-(<epsg4819> : Nord Sahara 1959 \(P)110.5 636 Q(aris\))-.15 E
-(<epsg4820> : Se)110.5 648 Q -.05(ga)-.15 G(ra \(Jakarta\)).05 E
-(<epsg4821> : V)110.5 660 Q(oirol 1879 \(P)-1.29 E(aris\))-.15 E
-(<epsg4901> : A)110.5 672 Q(TF \(P)-1.11 E(aris\))-.15 E
-(<epsg4902> : NDG \(P)110.5 684 Q(aris\))-.15 E
-(<epsg4903> : Madrid 1870 \(Madrid\))110.5 696 Q
-(<epsg4904> : Lisbon 1890 \(Lisbon\))110.5 708 Q
-(<epsg2000> : Anguilla 1957 / British W)110.5 720 Q(est Indies Grid)-.8
-E(MB-System 5.0)72 768 Q(13 March 2014)140.11 E(31)193.45 E 0 Cg EP
-%%Page: 32 32
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<epsg2001> : Antigua 1943 / British W)110.5 84
-Q(est Indies Grid)-.8 E(<epsg2002> : Dominica 1945 / British W)110.5 96
-Q(est Indies Grid)-.8 E(<epsg2003> : Grenada 1953 / British W)110.5 108
-Q(est Indies Grid)-.8 E(<epsg2004> : Montserrat 1958 / British W)110.5
-120 Q(est Indies Grid)-.8 E(<epsg2005> : St. Kitts 1955 / British W)
-110.5 132 Q(est Indies Grid)-.8 E
-(<epsg2006> : St. Lucia 1955 / British W)110.5 144 Q(est Indies Grid)-.8
-E(<epsg2007> : St. V)110.5 156 Q(incent 45 / British W)-.6 E
-(est Indies Grid)-.8 E(<epsg2008> : N)110.5 168 Q
-(AD27\(CGQ77\) / SCoPQ zone 2)-.35 E(<epsg2009> : N)110.5 180 Q
-(AD27\(CGQ77\) / SCoPQ zone 3)-.35 E(<epsg2010> : N)110.5 192 Q
-(AD27\(CGQ77\) / SCoPQ zone 4)-.35 E(<epsg2011> : N)110.5 204 Q
-(AD27\(CGQ77\) / SCoPQ zone 5)-.35 E(<epsg2012> : N)110.5 216 Q
-(AD27\(CGQ77\) / SCoPQ zone 6)-.35 E(<epsg2013> : N)110.5 228 Q
-(AD27\(CGQ77\) / SCoPQ zone 7)-.35 E(<epsg2014> : N)110.5 240 Q
-(AD27\(CGQ77\) / SCoPQ zone 8)-.35 E(<epsg2015> : N)110.5 252 Q
-(AD27\(CGQ77\) / SCoPQ zone 9)-.35 E(<epsg2016> : N)110.5 264 Q
-(AD27\(CGQ77\) / SCoPQ zone 10)-.35 E(<epsg2017> : N)110.5 276 Q
-(AD27\(76\) / MTM zone 8)-.35 E(<epsg2018> : N)110.5 288 Q
-(AD27\(76\) / MTM zone 9)-.35 E(<epsg2019> : N)110.5 300 Q
-(AD27\(76\) / MTM zone 10)-.35 E(<epsg2020> : N)110.5 312 Q
-(AD27\(76\) / MTM zone 11)-.35 E(<epsg2021> : N)110.5 324 Q
-(AD27\(76\) / MTM zone 12)-.35 E(<epsg2022> : N)110.5 336 Q
-(AD27\(76\) / MTM zone 13)-.35 E(<epsg2023> : N)110.5 348 Q
-(AD27\(76\) / MTM zone 14)-.35 E(<epsg2024> : N)110.5 360 Q
-(AD27\(76\) / MTM zone 15)-.35 E(<epsg2025> : N)110.5 372 Q
-(AD27\(76\) / MTM zone 16)-.35 E(<epsg2026> : N)110.5 384 Q
-(AD27\(76\) / MTM zone 17)-.35 E(<epsg2027> : N)110.5 396 Q
-(AD27\(76\) / UTM zone 15N)-.35 E(<epsg2028> : N)110.5 408 Q
-(AD27\(76\) / UTM zone 16N)-.35 E(<epsg2029> : N)110.5 420 Q
-(AD27\(76\) / UTM zone 17N)-.35 E(<epsg2030> : N)110.5 432 Q
-(AD27\(76\) / UTM zone 18N)-.35 E(<epsg2031> : N)110.5 444 Q
-(AD27\(CGQ77\) / UTM zone 17N)-.35 E(<epsg2032> : N)110.5 456 Q
-(AD27\(CGQ77\) / UTM zone 18N)-.35 E(<epsg2033> : N)110.5 468 Q
-(AD27\(CGQ77\) / UTM zone 19N)-.35 E(<epsg2034> : N)110.5 480 Q
-(AD27\(CGQ77\) / UTM zone 20N)-.35 E(<epsg2035> : N)110.5 492 Q
-(AD27\(CGQ77\) / UTM zone 21N)-.35 E(<epsg2036> : N)110.5 504 Q
-(AD83\(CSRS98\) / Ne)-.35 E 2.5(wB)-.25 G
-(runswick Stereo \(deprecated\))-2.5 E(<epsg2037> : N)110.5 516 Q
-(AD83\(CSRS98\) / UTM zone 19N \(deprecated\))-.35 E(<epsg2038> : N)
-110.5 528 Q(AD83\(CSRS98\) / UTM zone 20N \(deprecated\))-.35 E
-(<epsg2039> : Israel / Israeli TM Grid)110.5 540 Q
-(<epsg2040> : Locodjo 1965 / UTM zone 30N)110.5 552 Q
-(<epsg2041> : Abidjan 1987 / UTM zone 30N)110.5 564 Q
-(<epsg2042> : Locodjo 1965 / UTM zone 29N)110.5 576 Q
-(<epsg2043> : Abidjan 1987 / UTM zone 29N)110.5 588 Q
-(<epsg2044> : Hanoi 1972 / Gauss-Kruger zone 18)110.5 600 Q
-(<epsg2045> : Hanoi 1972 / Gauss-Kruger zone 19)110.5 612 Q
-(<epsg2056> : CH1903+ / L)110.5 624 Q(V95)-1 E
-(<epsg2057> : Rassadiran / Nakhl e T)110.5 636 Q(aqi)-.8 E
-(<epsg2058> : ED50\(ED77\) / UTM zone 38N)110.5 648 Q
-(<epsg2059> : ED50\(ED77\) / UTM zone 39N)110.5 660 Q
-(<epsg2060> : ED50\(ED77\) / UTM zone 40N)110.5 672 Q
-(<epsg2061> : ED50\(ED77\) / UTM zone 41N)110.5 684 Q
-(<epsg2062> : Madrid 1870 \(Madrid\) / Spain)110.5 696 Q
-(<epsg2063> : Dabola 1981 / UTM zone 28N \(deprecated\))110.5 708 Q
-(<epsg2064> : Dabola 1981 / UTM zone 29N \(deprecated\))110.5 720 Q
-(MB-System 5.0)72 768 Q(13 March 2014)140.11 E(32)193.45 E 0 Cg EP
-%%Page: 33 33
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<epsg2065> : S-JTSK \(Ferro\) / Kro)110.5 84 Q
--.25(va)-.15 G(k).25 E(<epsg2066> : Mount Dillon / T)110.5 96 Q
-(obago Grid)-.8 E(<epsg2067> : Naparima 1955 / UTM zone 20N)110.5 108 Q
-(<epsg2068> : ELD79 / Libya zone 5)110.5 120 Q
-(<epsg2069> : ELD79 / Libya zone 6)110.5 132 Q
-(<epsg2070> : ELD79 / Libya zone 7)110.5 144 Q
-(<epsg2071> : ELD79 / Libya zone 8)110.5 156 Q
-(<epsg2072> : ELD79 / Libya zone 9)110.5 168 Q
-(<epsg2073> : ELD79 / Libya zone 10)110.5 180 Q
-(<epsg2074> : ELD79 / Libya zone 11)110.5 192 Q
-(<epsg2075> : ELD79 / Libya zone 12)110.5 204 Q
-(<epsg2076> : ELD79 / Libya zone 13)110.5 216 Q
-(<epsg2077> : ELD79 / UTM zone 32N)110.5 228 Q
-(<epsg2078> : ELD79 / UTM zone 33N)110.5 240 Q
-(<epsg2079> : ELD79 / UTM zone 34N)110.5 252 Q
-(<epsg2080> : ELD79 / UTM zone 35N)110.5 264 Q
-(<epsg2081> : Chos Malal 1914 / Ar)110.5 276 Q(gentina zone 2)-.18 E
-(<epsg2082> : P)110.5 288 Q(ampa del Castillo / Ar)-.15 E
-(gentina zone 2)-.18 E(<epsg2083> : Hito XVIII 1963 / Ar)110.5 300 Q
-(gentina zone 2)-.18 E(<epsg2084> : Hito XVIII 1963 / UTM zone 19S)110.5
-312 Q(<epsg2085> : N)110.5 324 Q(AD27 / Cuba Norte)-.35 E
-(<epsg2086> : N)110.5 336 Q(AD27 / Cuba Sur)-.35 E
-(<epsg2087> : ELD79 / TM 12 NE)110.5 348 Q
-(<epsg2088> : Carthage / TM 11 NE)110.5 360 Q(<epsg2089> : Y)110.5 372 Q
-(emen NGN96 / UTM zone 38N)-1 E(<epsg2090> : Y)110.5 384 Q
-(emen NGN96 / UTM zone 39N)-1 E(<epsg2091> : South Y)110.5 396 Q
-(emen / Gauss Kruger zone 8 \(deprecated\))-1 E(<epsg2092> : South Y)
-110.5 408 Q(emen / Gauss Kruger zone 9 \(deprecated\))-1 E
-(<epsg2093> : Hanoi 1972 / GK 106 NE)110.5 420 Q
-(<epsg2094> : WGS 72BE / TM 106 NE)110.5 432 Q
-(<epsg2095> : Bissau / UTM zone 28N)110.5 444 Q(<epsg2096> : K)110.5 456
-Q(orean 1985 / K)-.35 E(orea East Belt)-.35 E(<epsg2097> : K)110.5 468 Q
-(orean 1985 / K)-.35 E(orea Central Belt)-.35 E(<epsg2098> : K)110.5 480
-Q(orean 1985 / K)-.35 E(orea W)-.35 E(est Belt)-.8 E
-(<epsg2099> : Qatar 1948 / Qatar Grid)110.5 492 Q
-(<epsg2100> : GGRS87 / Greek Grid)110.5 504 Q(<epsg2101> : Lak)110.5 516
-Q 2.5(e/M)-.1 G(aracaibo Grid M1)-2.5 E(<epsg2102> : Lak)110.5 528 Q 2.5
-(e/M)-.1 G(aracaibo Grid)-2.5 E(<epsg2103> : Lak)110.5 540 Q 2.5(e/M)-.1
-G(aracaibo Grid M3)-2.5 E(<epsg2104> : Lak)110.5 552 Q 2.5(e/M)-.1 G
-(aracaibo La Rosa Grid)-2.5 E
-(<epsg2105> : NZGD2000 / Mount Eden Circuit 2000)110.5 564 Q
-(<epsg2106> : NZGD2000 / Bay of Plenty Circuit 2000)110.5 576 Q
-(<epsg2107> : NZGD2000 / Po)110.5 588 Q -.15(ve)-.15 G
-(rty Bay Circuit 2000).15 E(<epsg2108> : NZGD2000 / Ha)110.5 600 Q(wk)
--.15 E(es Bay Circuit 2000)-.1 E(<epsg2109> : NZGD2000 / T)110.5 612 Q
-(aranaki Circuit 2000)-.8 E(<epsg2110> : NZGD2000 / T)110.5 624 Q
-(uhirangi Circuit 2000)-.45 E(<epsg2111> : NZGD2000 / W)110.5 636 Q(ang)
--.8 E(anui Circuit 2000)-.05 E(<epsg2112> : NZGD2000 / W)110.5 648 Q
-(airarapa Circuit 2000)-.8 E(<epsg2113> : NZGD2000 / W)110.5 660 Q
-(ellington Circuit 2000)-.8 E(<epsg2114> : NZGD2000 / Collingw)110.5 672
-Q(ood Circuit 2000)-.1 E(<epsg2115> : NZGD2000 / Nelson Circuit 2000)
-110.5 684 Q(<epsg2116> : NZGD2000 / Karamea Circuit 2000)110.5 696 Q
-(<epsg2117> : NZGD2000 / Buller Circuit 2000)110.5 708 Q
-(<epsg2118> : NZGD2000 / Gre)110.5 720 Q 2.5(yC)-.15 G(ircuit 2000)-2.5
-E(MB-System 5.0)72 768 Q(13 March 2014)140.11 E(33)193.45 E 0 Cg EP
-%%Page: 34 34
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<epsg2119> : NZGD2000 / Amuri Circuit 2000)
-110.5 84 Q(<epsg2120> : NZGD2000 / Marlborough Circuit 2000)110.5 96 Q
-(<epsg2121> : NZGD2000 / Hokitika Circuit 2000)110.5 108 Q
-(<epsg2122> : NZGD2000 / Okarito Circuit 2000)110.5 120 Q
-(<epsg2123> : NZGD2000 / Jacksons Bay Circuit 2000)110.5 132 Q
-(<epsg2124> : NZGD2000 / Mount Pleasant Circuit 2000)110.5 144 Q
-(<epsg2125> : NZGD2000 / Ga)110.5 156 Q(wler Circuit 2000)-.15 E
-(<epsg2126> : NZGD2000 / T)110.5 168 Q(imaru Circuit 2000)-.35 E
-(<epsg2127> : NZGD2000 / Lindis Peak Circuit 2000)110.5 180 Q
-(<epsg2128> : NZGD2000 / Mount Nicholas Circuit 2000)110.5 192 Q
-(<epsg2129> : NZGD2000 / Mount Y)110.5 204 Q(ork Circuit 2000)-1.1 E
-(<epsg2130> : NZGD2000 / Observ)110.5 216 Q(ation Point Circuit 2000)
--.25 E(<epsg2131> : NZGD2000 / North T)110.5 228 Q(aieri Circuit 2000)
--.8 E(<epsg2132> : NZGD2000 / Bluf)110.5 240 Q 2.5(fC)-.25 G
-(ircuit 2000)-2.5 E(<epsg2133> : NZGD2000 / UTM zone 58S)110.5 252 Q
-(<epsg2134> : NZGD2000 / UTM zone 59S)110.5 264 Q
-(<epsg2135> : NZGD2000 / UTM zone 60S)110.5 276 Q
-(<epsg2136> : Accra / Ghana National Grid)110.5 288 Q
-(<epsg2137> : Accra / TM 1 NW)110.5 300 Q(<epsg2138> : N)110.5 312 Q
-(AD27\(CGQ77\) / Quebec Lambert)-.35 E(<epsg2139> : N)110.5 324 Q
-(AD83\(CSRS98\) / SCoPQ zone 2 \(deprecated\))-.35 E(<epsg2140> : N)
-110.5 336 Q(AD83\(CSRS98\) / MTM zone 3 \(deprecated\))-.35 E
-(<epsg2141> : N)110.5 348 Q(AD83\(CSRS98\) / MTM zone 4 \(deprecated\))
--.35 E(<epsg2142> : N)110.5 360 Q
-(AD83\(CSRS98\) / MTM zone 5 \(deprecated\))-.35 E(<epsg2143> : N)110.5
-372 Q(AD83\(CSRS98\) / MTM zone 6 \(deprecated\))-.35 E(<epsg2144> : N)
-110.5 384 Q(AD83\(CSRS98\) / MTM zone 7 \(deprecated\))-.35 E
-(<epsg2145> : N)110.5 396 Q(AD83\(CSRS98\) / MTM zone 8 \(deprecated\))
--.35 E(<epsg2146> : N)110.5 408 Q
-(AD83\(CSRS98\) / MTM zone 9 \(deprecated\))-.35 E(<epsg2147> : N)110.5
-420 Q(AD83\(CSRS98\) / MTM zone 10 \(deprecated\))-.35 E(<epsg2148> : N)
-110.5 432 Q(AD83\(CSRS98\) / UTM zone 21N \(deprecated\))-.35 E
-(<epsg2149> : N)110.5 444 Q
-(AD83\(CSRS98\) / UTM zone 18N \(deprecated\))-.35 E(<epsg2150> : N)
-110.5 456 Q(AD83\(CSRS98\) / UTM zone 17N \(deprecated\))-.35 E
-(<epsg2151> : N)110.5 468 Q
-(AD83\(CSRS98\) / UTM zone 13N \(deprecated\))-.35 E(<epsg2152> : N)
-110.5 480 Q(AD83\(CSRS98\) / UTM zone 12N \(deprecated\))-.35 E
-(<epsg2153> : N)110.5 492 Q
-(AD83\(CSRS98\) / UTM zone 11N \(deprecated\))-.35 E
-(<epsg2154> : RGF93 / Lambert-93)110.5 504 Q(<epsg2155> : American Samo\
-a 1962 / American Samoa Lambert \(deprecated\))110.5 516 Q
-(<epsg2156> : N)110.5 528 Q(AD83\(HARN\) / UTM zone 59S \(deprecated\))
--.35 E(<epsg2157> : IRENET95 / Irish T)110.5 540 Q(ransv)-.35 E
-(erse Mercator)-.15 E(<epsg2158> : IRENET95 / UTM zone 29N)110.5 552 Q
-(<epsg2159> : Sierra Leone 1924 / Ne)110.5 564 Q 2.5(wC)-.25 G(olon)-2.5
-E 2.5(yG)-.15 G(rid)-2.5 E(<epsg2160> : Sierra Leone 1924 / Ne)110.5 576
-Q 2.5(wW)-.25 G(ar Of)-3.3 E(\214ce Grid)-.25 E
-(<epsg2161> : Sierra Leone 1968 / UTM zone 28N)110.5 588 Q
-(<epsg2162> : Sierra Leone 1968 / UTM zone 29N)110.5 600 Q
-(<epsg2163> : US National Atlas Equal Area)110.5 612 Q
-(<epsg2164> : Locodjo 1965 / TM 5 NW)110.5 624 Q
-(<epsg2165> : Abidjan 1987 / TM 5 NW)110.5 636 Q(<epsg2166> : Pulk)110.5
-648 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942\(83\) / Gauss Kruger zone 3 \(deprecated\))-2.5 E
-(<epsg2167> : Pulk)110.5 660 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942\(83\) / Gauss Kruger zone 4 \(deprecated\))-2.5 E
-(<epsg2168> : Pulk)110.5 672 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942\(83\) / Gauss Kruger zone 5 \(deprecated\))-2.5 E(<epsg2169> : Lux)
-110.5 684 Q(embour)-.15 E 2.5(g1)-.18 G(930 / Gauss)-2.5 E
-(<epsg2170> : MGI / Slo)110.5 696 Q -.15(ve)-.15 G(nia Grid).15 E
-(<epsg2171> : Pulk)110.5 708 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942\(58\) / Poland zone I \(deprecated\))-2.5 E(<epsg2172> : Pulk)110.5
-720 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942\(58\) / Poland zone II)-2.5 E
-(MB-System 5.0)72 768 Q(13 March 2014)140.11 E(34)193.45 E 0 Cg EP
-%%Page: 35 35
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<epsg2173> : Pulk)110.5 84 Q -.15(ov)-.1 G 2.5
-(o1)-.05 G(942\(58\) / Poland zone III)-2.5 E(<epsg2174> : Pulk)110.5 96
-Q -.15(ov)-.1 G 2.5(o1)-.05 G(942\(58\) / Poland zone IV)-2.5 E
-(<epsg2175> : Pulk)110.5 108 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942\(58\) / Poland zone V)-2.5 E
-(<epsg2176> : ETRS89 / Poland CS2000 zone 5)110.5 120 Q
-(<epsg2177> : ETRS89 / Poland CS2000 zone 6)110.5 132 Q
-(<epsg2178> : ETRS89 / Poland CS2000 zone 7)110.5 144 Q
-(<epsg2179> : ETRS89 / Poland CS2000 zone 8)110.5 156 Q
-(<epsg2180> : ETRS89 / Poland CS92)110.5 168 Q
-(<epsg2188> : Azores Occidental 1939 / UTM zone 25N)110.5 180 Q
-(<epsg2189> : Azores Central 1948 / UTM zone 26N)110.5 192 Q
-(<epsg2190> : Azores Oriental 1940 / UTM zone 26N)110.5 204 Q
-(<epsg2191> : Madeira 1936 / UTM zone 28N \(deprecated\))110.5 216 Q
-(<epsg2192> : ED50 / France EuroLambert)110.5 228 Q
-(<epsg2193> : NZGD2000 / Ne)110.5 240 Q 2.5(wZ)-.25 G(ealand T)-2.5 E
-(ransv)-.35 E(erse Mercator)-.15 E(<epsg2194> : American Samoa 1962 / A\
-merican Samoa Lambert \(deprecated\))110.5 252 Q(<epsg2195> : N)110.5
-264 Q(AD83\(HARN\) / UTM zone 2S)-.35 E
-(<epsg2196> : ETRS89 / Kp2000 Jutland)110.5 276 Q
-(<epsg2197> : ETRS89 / Kp2000 Zealand)110.5 288 Q
-(<epsg2198> : ETRS89 / Kp2000 Bornholm)110.5 300 Q
-(<epsg2199> : Albanian 1987 / Gauss Kruger zone 4 \(deprecated\))110.5
-312 Q(<epsg2200> : A)110.5 324 Q(TS77 / Ne)-1.11 E 2.5(wB)-.25 G
-(runswick Stereographic \(A)-2.5 E(TS77\))-1.11 E
-(<epsg2201> : REGVEN / UTM zone 18N)110.5 336 Q
-(<epsg2202> : REGVEN / UTM zone 19N)110.5 348 Q
-(<epsg2203> : REGVEN / UTM zone 20N)110.5 360 Q(<epsg2204> : N)110.5 372
-Q(AD27 / T)-.35 E(ennessee)-.7 E(<epsg2205> : N)110.5 384 Q(AD83 / K)
--.35 E(entuck)-.25 E 2.5(yN)-.15 G(orth)-2.5 E(<epsg2206> : ED50 / 3-de)
-110.5 396 Q(gree Gauss-Kruger zone 9)-.15 E(<epsg2207> : ED50 / 3-de)
-110.5 408 Q(gree Gauss-Kruger zone 10)-.15 E(<epsg2208> : ED50 / 3-de)
-110.5 420 Q(gree Gauss-Kruger zone 11)-.15 E(<epsg2209> : ED50 / 3-de)
-110.5 432 Q(gree Gauss-Kruger zone 12)-.15 E(<epsg2210> : ED50 / 3-de)
-110.5 444 Q(gree Gauss-Kruger zone 13)-.15 E(<epsg2211> : ED50 / 3-de)
-110.5 456 Q(gree Gauss-Kruger zone 14)-.15 E(<epsg2212> : ED50 / 3-de)
-110.5 468 Q(gree Gauss-Kruger zone 15)-.15 E
-(<epsg2213> : ETRS89 / TM 30 NE)110.5 480 Q
-(<epsg2214> : Douala 1948 / A)110.5 492 Q(OF west \(deprecated\))-.55 E
-(<epsg2215> : Manoca 1962 / UTM zone 32N)110.5 504 Q
-(<epsg2216> : Qornoq 1927 / UTM zone 22N)110.5 516 Q
-(<epsg2217> : Qornoq 1927 / UTM zone 23N)110.5 528 Q(<epsg2219> : A)
-110.5 540 Q(TS77 / UTM zone 19N)-1.11 E(<epsg2220> : A)110.5 552 Q
-(TS77 / UTM zone 20N)-1.11 E(<epsg2222> : N)110.5 564 Q
-(AD83 / Arizona East \(ft\))-.35 E(<epsg2223> : N)110.5 576 Q
-(AD83 / Arizona Central \(ft\))-.35 E(<epsg2224> : N)110.5 588 Q
-(AD83 / Arizona W)-.35 E(est \(ft\))-.8 E(<epsg2225> : N)110.5 600 Q
-(AD83 / California zone 1 \(ftUS\))-.35 E(<epsg2226> : N)110.5 612 Q
-(AD83 / California zone 2 \(ftUS\))-.35 E(<epsg2227> : N)110.5 624 Q
-(AD83 / California zone 3 \(ftUS\))-.35 E(<epsg2228> : N)110.5 636 Q
-(AD83 / California zone 4 \(ftUS\))-.35 E(<epsg2229> : N)110.5 648 Q
-(AD83 / California zone 5 \(ftUS\))-.35 E(<epsg2230> : N)110.5 660 Q
-(AD83 / California zone 6 \(ftUS\))-.35 E(<epsg2231> : N)110.5 672 Q
-(AD83 / Colorado North \(ftUS\))-.35 E(<epsg2232> : N)110.5 684 Q
-(AD83 / Colorado Central \(ftUS\))-.35 E(<epsg2233> : N)110.5 696 Q
-(AD83 / Colorado South \(ftUS\))-.35 E(<epsg2234> : N)110.5 708 Q
-(AD83 / Connecticut \(ftUS\))-.35 E(<epsg2235> : N)110.5 720 Q
-(AD83 / Dela)-.35 E -.1(wa)-.15 G(re \(ftUS\)).1 E(MB-System 5.0)72 768
-Q(13 March 2014)140.11 E(35)193.45 E 0 Cg EP
-%%Page: 36 36
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<epsg2236> : N)110.5 84 Q
-(AD83 / Florida East \(ftUS\))-.35 E(<epsg2237> : N)110.5 96 Q
-(AD83 / Florida W)-.35 E(est \(ftUS\))-.8 E(<epsg2238> : N)110.5 108 Q
-(AD83 / Florida North \(ftUS\))-.35 E(<epsg2239> : N)110.5 120 Q
-(AD83 / Geor)-.35 E(gia East \(ftUS\))-.18 E(<epsg2240> : N)110.5 132 Q
-(AD83 / Geor)-.35 E(gia W)-.18 E(est \(ftUS\))-.8 E(<epsg2241> : N)110.5
-144 Q(AD83 / Idaho East \(ftUS\))-.35 E(<epsg2242> : N)110.5 156 Q
-(AD83 / Idaho Central \(ftUS\))-.35 E(<epsg2243> : N)110.5 168 Q
-(AD83 / Idaho W)-.35 E(est \(ftUS\))-.8 E(<epsg2244> : N)110.5 180 Q
-(AD83 / Indiana East \(ftUS\) \(deprecated\))-.35 E(<epsg2245> : N)110.5
-192 Q(AD83 / Indiana W)-.35 E(est \(ftUS\) \(deprecated\))-.8 E
-(<epsg2246> : N)110.5 204 Q(AD83 / K)-.35 E(entuck)-.25 E 2.5(yN)-.15 G
-(orth \(ftUS\))-2.5 E(<epsg2247> : N)110.5 216 Q(AD83 / K)-.35 E(entuck)
--.25 E 2.5(yS)-.15 G(outh \(ftUS\))-2.5 E(<epsg2248> : N)110.5 228 Q
-(AD83 / Maryland \(ftUS\))-.35 E(<epsg2249> : N)110.5 240 Q
-(AD83 / Massachusetts Mainland \(ftUS\))-.35 E(<epsg2250> : N)110.5 252
-Q(AD83 / Massachusetts Island \(ftUS\))-.35 E(<epsg2251> : N)110.5 264 Q
-(AD83 / Michig)-.35 E(an North \(ft\))-.05 E(<epsg2252> : N)110.5 276 Q
-(AD83 / Michig)-.35 E(an Central \(ft\))-.05 E(<epsg2253> : N)110.5 288
-Q(AD83 / Michig)-.35 E(an South \(ft\))-.05 E(<epsg2254> : N)110.5 300 Q
-(AD83 / Mississippi East \(ftUS\))-.35 E(<epsg2255> : N)110.5 312 Q
-(AD83 / Mississippi W)-.35 E(est \(ftUS\))-.8 E(<epsg2256> : N)110.5 324
-Q(AD83 / Montana \(ft\))-.35 E(<epsg2257> : N)110.5 336 Q(AD83 / Ne)-.35
-E 2.5(wM)-.25 G -.15(ex)-2.5 G(ico East \(ftUS\)).15 E(<epsg2258> : N)
-110.5 348 Q(AD83 / Ne)-.35 E 2.5(wM)-.25 G -.15(ex)-2.5 G
-(ico Central \(ftUS\)).15 E(<epsg2259> : N)110.5 360 Q(AD83 / Ne)-.35 E
-2.5(wM)-.25 G -.15(ex)-2.5 G(ico W).15 E(est \(ftUS\))-.8 E
-(<epsg2260> : N)110.5 372 Q(AD83 / Ne)-.35 E 2.5(wY)-.25 G
-(ork East \(ftUS\))-3.6 E(<epsg2261> : N)110.5 384 Q(AD83 / Ne)-.35 E
-2.5(wY)-.25 G(ork Central \(ftUS\))-3.6 E(<epsg2262> : N)110.5 396 Q
-(AD83 / Ne)-.35 E 2.5(wY)-.25 G(ork W)-3.6 E(est \(ftUS\))-.8 E
-(<epsg2263> : N)110.5 408 Q(AD83 / Ne)-.35 E 2.5(wY)-.25 G
-(ork Long Island \(ftUS\))-3.6 E(<epsg2264> : N)110.5 420 Q
-(AD83 / North Carolina \(ftUS\))-.35 E(<epsg2265> : N)110.5 432 Q
-(AD83 / North Dak)-.35 E(ota North \(ft\))-.1 E(<epsg2266> : N)110.5 444
-Q(AD83 / North Dak)-.35 E(ota South \(ft\))-.1 E(<epsg2267> : N)110.5
-456 Q(AD83 / Oklahoma North \(ftUS\))-.35 E(<epsg2268> : N)110.5 468 Q
-(AD83 / Oklahoma South \(ftUS\))-.35 E(<epsg2269> : N)110.5 480 Q
-(AD83 / Ore)-.35 E(gon North \(ft\))-.15 E(<epsg2270> : N)110.5 492 Q
-(AD83 / Ore)-.35 E(gon South \(ft\))-.15 E(<epsg2271> : N)110.5 504 Q
-(AD83 / Pennsylv)-.35 E(ania North \(ftUS\))-.25 E(<epsg2272> : N)110.5
-516 Q(AD83 / Pennsylv)-.35 E(ania South \(ftUS\))-.25 E(<epsg2273> : N)
-110.5 528 Q(AD83 / South Carolina \(ft\))-.35 E(<epsg2274> : N)110.5 540
-Q(AD83 / T)-.35 E(ennessee \(ftUS\))-.7 E(<epsg2275> : N)110.5 552 Q
-(AD83 / T)-.35 E -.15(ex)-.7 G(as North \(ftUS\)).15 E(<epsg2276> : N)
-110.5 564 Q(AD83 / T)-.35 E -.15(ex)-.7 G(as North Central \(ftUS\)).15
-E(<epsg2277> : N)110.5 576 Q(AD83 / T)-.35 E -.15(ex)-.7 G
-(as Central \(ftUS\)).15 E(<epsg2278> : N)110.5 588 Q(AD83 / T)-.35 E
--.15(ex)-.7 G(as South Central \(ftUS\)).15 E(<epsg2279> : N)110.5 600 Q
-(AD83 / T)-.35 E -.15(ex)-.7 G(as South \(ftUS\)).15 E(<epsg2280> : N)
-110.5 612 Q(AD83 / Utah North \(ft\))-.35 E(<epsg2281> : N)110.5 624 Q
-(AD83 / Utah Central \(ft\))-.35 E(<epsg2282> : N)110.5 636 Q
-(AD83 / Utah South \(ft\))-.35 E(<epsg2283> : N)110.5 648 Q(AD83 / V)
--.35 E(ir)-.6 E(ginia North \(ftUS\))-.18 E(<epsg2284> : N)110.5 660 Q
-(AD83 / V)-.35 E(ir)-.6 E(ginia South \(ftUS\))-.18 E(<epsg2285> : N)
-110.5 672 Q(AD83 / W)-.35 E(ashington North \(ftUS\))-.8 E
-(<epsg2286> : N)110.5 684 Q(AD83 / W)-.35 E(ashington South \(ftUS\))-.8
-E(<epsg2287> : N)110.5 696 Q(AD83 / W)-.35 E(isconsin North \(ftUS\))-.4
-E(<epsg2288> : N)110.5 708 Q(AD83 / W)-.35 E(isconsin Central \(ftUS\))
--.4 E(<epsg2289> : N)110.5 720 Q(AD83 / W)-.35 E
-(isconsin South \(ftUS\))-.4 E(MB-System 5.0)72 768 Q(13 March 2014)
-140.11 E(36)193.45 E 0 Cg EP
-%%Page: 37 37
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<epsg2290> : A)110.5 84 Q(TS77 / Prince Edw)
--1.11 E(ard Isl. Stereographic \(A)-.1 E(TS77\))-1.11 E(<epsg2291> : N)
-110.5 96 Q(AD83\(CSRS98\) / Prince Edw)-.35 E
-(ard Isl. Stereographic \(N)-.1 E(AD83\) \(deprecated\))-.35 E
-(<epsg2292> : N)110.5 108 Q(AD83\(CSRS98\) / Prince Edw)-.35 E
-(ard Isl. Stereographic \(N)-.1 E(AD83\) \(deprecated\))-.35 E
-(<epsg2294> : A)110.5 120 Q(TS77 / MTM No)-1.11 E .5 -.25(va S)-.15 H
-(cotia zone 4).25 E(<epsg2295> : A)110.5 132 Q(TS77 / MTM No)-1.11 E .5
--.25(va S)-.15 H(cotia zone 5).25 E(<epsg2308> : Bata)110.5 144 Q
-(via / TM 109 SE)-.2 E(<epsg2309> : WGS 84 / TM 116 SE)110.5 156 Q
-(<epsg2310> : WGS 84 / TM 132 SE)110.5 168 Q
-(<epsg2311> : WGS 84 / TM 6 NE)110.5 180 Q
-(<epsg2312> : Garoua / UTM zone 33N)110.5 192 Q(<epsg2313> : K)110.5 204
-Q(ousseri / UTM zone 33N)-.35 E(<epsg2314> : T)110.5 216 Q
-(rinidad 1903 / T)-.35 E(rinidad Grid \(ftCla\))-.35 E
-(<epsg2315> : Campo Inchauspe / UTM zone 19S)110.5 228 Q
-(<epsg2316> : Campo Inchauspe / UTM zone 20S)110.5 240 Q
-(<epsg2317> : PSAD56 / ICN Re)110.5 252 Q(gional)-.15 E
-(<epsg2318> : Ain el Abd / Aramco Lambert)110.5 264 Q
-(<epsg2319> : ED50 / TM27)110.5 276 Q(<epsg2320> : ED50 / TM30)110.5 288
-Q(<epsg2321> : ED50 / TM33)110.5 300 Q(<epsg2322> : ED50 / TM36)110.5
-312 Q(<epsg2323> : ED50 / TM39)110.5 324 Q(<epsg2324> : ED50 / TM42)
-110.5 336 Q(<epsg2325> : ED50 / TM45)110.5 348 Q(<epsg2326> : Hong K)
-110.5 360 Q(ong 1980 Grid System)-.35 E
-(<epsg2327> : Xian 1980 / Gauss-Kruger zone 13)110.5 372 Q
-(<epsg2328> : Xian 1980 / Gauss-Kruger zone 14)110.5 384 Q
-(<epsg2329> : Xian 1980 / Gauss-Kruger zone 15)110.5 396 Q
-(<epsg2330> : Xian 1980 / Gauss-Kruger zone 16)110.5 408 Q
-(<epsg2331> : Xian 1980 / Gauss-Kruger zone 17)110.5 420 Q
-(<epsg2332> : Xian 1980 / Gauss-Kruger zone 18)110.5 432 Q
-(<epsg2333> : Xian 1980 / Gauss-Kruger zone 19)110.5 444 Q
-(<epsg2334> : Xian 1980 / Gauss-Kruger zone 20)110.5 456 Q
-(<epsg2335> : Xian 1980 / Gauss-Kruger zone 21)110.5 468 Q
-(<epsg2336> : Xian 1980 / Gauss-Kruger zone 22)110.5 480 Q
-(<epsg2337> : Xian 1980 / Gauss-Kruger zone 23)110.5 492 Q
-(<epsg2338> : Xian 1980 / Gauss-Kruger CM 75E)110.5 504 Q
-(<epsg2339> : Xian 1980 / Gauss-Kruger CM 81E)110.5 516 Q
-(<epsg2340> : Xian 1980 / Gauss-Kruger CM 87E)110.5 528 Q
-(<epsg2341> : Xian 1980 / Gauss-Kruger CM 93E)110.5 540 Q
-(<epsg2342> : Xian 1980 / Gauss-Kruger CM 99E)110.5 552 Q
-(<epsg2343> : Xian 1980 / Gauss-Kruger CM 105E)110.5 564 Q
-(<epsg2344> : Xian 1980 / Gauss-Kruger CM 111E)110.5 576 Q
-(<epsg2345> : Xian 1980 / Gauss-Kruger CM 117E)110.5 588 Q
-(<epsg2346> : Xian 1980 / Gauss-Kruger CM 123E)110.5 600 Q
-(<epsg2347> : Xian 1980 / Gauss-Kruger CM 129E)110.5 612 Q
-(<epsg2348> : Xian 1980 / Gauss-Kruger CM 135E)110.5 624 Q
-(<epsg2349> : Xian 1980 / 3-de)110.5 636 Q(gree Gauss-Kruger zone 25)
--.15 E(<epsg2350> : Xian 1980 / 3-de)110.5 648 Q
-(gree Gauss-Kruger zone 26)-.15 E(<epsg2351> : Xian 1980 / 3-de)110.5
-660 Q(gree Gauss-Kruger zone 27)-.15 E(<epsg2352> : Xian 1980 / 3-de)
-110.5 672 Q(gree Gauss-Kruger zone 28)-.15 E
-(<epsg2353> : Xian 1980 / 3-de)110.5 684 Q(gree Gauss-Kruger zone 29)
--.15 E(<epsg2354> : Xian 1980 / 3-de)110.5 696 Q
-(gree Gauss-Kruger zone 30)-.15 E(<epsg2355> : Xian 1980 / 3-de)110.5
-708 Q(gree Gauss-Kruger zone 31)-.15 E(<epsg2356> : Xian 1980 / 3-de)
-110.5 720 Q(gree Gauss-Kruger zone 32)-.15 E(MB-System 5.0)72 768 Q
-(13 March 2014)140.11 E(37)193.45 E 0 Cg EP
-%%Page: 38 38
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<epsg2357> : Xian 1980 / 3-de)110.5 84 Q
-(gree Gauss-Kruger zone 33)-.15 E(<epsg2358> : Xian 1980 / 3-de)110.5 96
-Q(gree Gauss-Kruger zone 34)-.15 E(<epsg2359> : Xian 1980 / 3-de)110.5
-108 Q(gree Gauss-Kruger zone 35)-.15 E(<epsg2360> : Xian 1980 / 3-de)
-110.5 120 Q(gree Gauss-Kruger zone 36)-.15 E
-(<epsg2361> : Xian 1980 / 3-de)110.5 132 Q(gree Gauss-Kruger zone 37)
--.15 E(<epsg2362> : Xian 1980 / 3-de)110.5 144 Q
-(gree Gauss-Kruger zone 38)-.15 E(<epsg2363> : Xian 1980 / 3-de)110.5
-156 Q(gree Gauss-Kruger zone 39)-.15 E(<epsg2364> : Xian 1980 / 3-de)
-110.5 168 Q(gree Gauss-Kruger zone 40)-.15 E
-(<epsg2365> : Xian 1980 / 3-de)110.5 180 Q(gree Gauss-Kruger zone 41)
--.15 E(<epsg2366> : Xian 1980 / 3-de)110.5 192 Q
-(gree Gauss-Kruger zone 42)-.15 E(<epsg2367> : Xian 1980 / 3-de)110.5
-204 Q(gree Gauss-Kruger zone 43)-.15 E(<epsg2368> : Xian 1980 / 3-de)
-110.5 216 Q(gree Gauss-Kruger zone 44)-.15 E
-(<epsg2369> : Xian 1980 / 3-de)110.5 228 Q(gree Gauss-Kruger zone 45)
--.15 E(<epsg2370> : Xian 1980 / 3-de)110.5 240 Q
-(gree Gauss-Kruger CM 75E)-.15 E(<epsg2371> : Xian 1980 / 3-de)110.5 252
-Q(gree Gauss-Kruger CM 78E)-.15 E(<epsg2372> : Xian 1980 / 3-de)110.5
-264 Q(gree Gauss-Kruger CM 81E)-.15 E(<epsg2373> : Xian 1980 / 3-de)
-110.5 276 Q(gree Gauss-Kruger CM 84E)-.15 E
-(<epsg2374> : Xian 1980 / 3-de)110.5 288 Q(gree Gauss-Kruger CM 87E)-.15
-E(<epsg2375> : Xian 1980 / 3-de)110.5 300 Q(gree Gauss-Kruger CM 90E)
--.15 E(<epsg2376> : Xian 1980 / 3-de)110.5 312 Q
-(gree Gauss-Kruger CM 93E)-.15 E(<epsg2377> : Xian 1980 / 3-de)110.5 324
-Q(gree Gauss-Kruger CM 96E)-.15 E(<epsg2378> : Xian 1980 / 3-de)110.5
-336 Q(gree Gauss-Kruger CM 99E)-.15 E(<epsg2379> : Xian 1980 / 3-de)
-110.5 348 Q(gree Gauss-Kruger CM 102E)-.15 E
-(<epsg2380> : Xian 1980 / 3-de)110.5 360 Q(gree Gauss-Kruger CM 105E)
--.15 E(<epsg2381> : Xian 1980 / 3-de)110.5 372 Q
-(gree Gauss-Kruger CM 108E)-.15 E(<epsg2382> : Xian 1980 / 3-de)110.5
-384 Q(gree Gauss-Kruger CM 111E)-.15 E(<epsg2383> : Xian 1980 / 3-de)
-110.5 396 Q(gree Gauss-Kruger CM 114E)-.15 E
-(<epsg2384> : Xian 1980 / 3-de)110.5 408 Q(gree Gauss-Kruger CM 117E)
--.15 E(<epsg2385> : Xian 1980 / 3-de)110.5 420 Q
-(gree Gauss-Kruger CM 120E)-.15 E(<epsg2386> : Xian 1980 / 3-de)110.5
-432 Q(gree Gauss-Kruger CM 123E)-.15 E(<epsg2387> : Xian 1980 / 3-de)
-110.5 444 Q(gree Gauss-Kruger CM 126E)-.15 E
-(<epsg2388> : Xian 1980 / 3-de)110.5 456 Q(gree Gauss-Kruger CM 129E)
--.15 E(<epsg2389> : Xian 1980 / 3-de)110.5 468 Q
-(gree Gauss-Kruger CM 132E)-.15 E(<epsg2390> : Xian 1980 / 3-de)110.5
-480 Q(gree Gauss-Kruger CM 135E)-.15 E
-(<epsg2391> : KKJ / Finland zone 1)110.5 492 Q
-(<epsg2392> : KKJ / Finland zone 2)110.5 504 Q
-(<epsg2393> : KKJ / Finland Uniform Coordinate System)110.5 516 Q
-(<epsg2394> : KKJ / Finland zone 4)110.5 528 Q(<epsg2395> : South Y)
-110.5 540 Q(emen / Gauss-Kruger zone 8)-1 E(<epsg2396> : South Y)110.5
-552 Q(emen / Gauss-Kruger zone 9)-1 E(<epsg2397> : Pulk)110.5 564 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(942\(83\) / Gauss-Kruger zone 3)-2.5 E
-(<epsg2398> : Pulk)110.5 576 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942\(83\) / Gauss-Kruger zone 4)-2.5 E(<epsg2399> : Pulk)110.5 588 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(942\(83\) / Gauss-Kruger zone 5)-2.5 E
-(<epsg2400> : R)110.5 600 Q(T90 2.5 gon W \(deprecated\))-.6 E
-(<epsg2401> : Beijing 1954 / 3-de)110.5 612 Q(gree Gauss-Kruger zone 25)
--.15 E(<epsg2402> : Beijing 1954 / 3-de)110.5 624 Q
-(gree Gauss-Kruger zone 26)-.15 E(<epsg2403> : Beijing 1954 / 3-de)110.5
-636 Q(gree Gauss-Kruger zone 27)-.15 E(<epsg2404> : Beijing 1954 / 3-de)
-110.5 648 Q(gree Gauss-Kruger zone 28)-.15 E
-(<epsg2405> : Beijing 1954 / 3-de)110.5 660 Q(gree Gauss-Kruger zone 29)
--.15 E(<epsg2406> : Beijing 1954 / 3-de)110.5 672 Q
-(gree Gauss-Kruger zone 30)-.15 E(<epsg2407> : Beijing 1954 / 3-de)110.5
-684 Q(gree Gauss-Kruger zone 31)-.15 E(<epsg2408> : Beijing 1954 / 3-de)
-110.5 696 Q(gree Gauss-Kruger zone 32)-.15 E
-(<epsg2409> : Beijing 1954 / 3-de)110.5 708 Q(gree Gauss-Kruger zone 33)
--.15 E(<epsg2410> : Beijing 1954 / 3-de)110.5 720 Q
-(gree Gauss-Kruger zone 34)-.15 E(MB-System 5.0)72 768 Q(13 March 2014)
-140.11 E(38)193.45 E 0 Cg EP
-%%Page: 39 39
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<epsg2411> : Beijing 1954 / 3-de)110.5 84 Q
-(gree Gauss-Kruger zone 35)-.15 E(<epsg2412> : Beijing 1954 / 3-de)110.5
-96 Q(gree Gauss-Kruger zone 36)-.15 E(<epsg2413> : Beijing 1954 / 3-de)
-110.5 108 Q(gree Gauss-Kruger zone 37)-.15 E
-(<epsg2414> : Beijing 1954 / 3-de)110.5 120 Q(gree Gauss-Kruger zone 38)
--.15 E(<epsg2415> : Beijing 1954 / 3-de)110.5 132 Q
-(gree Gauss-Kruger zone 39)-.15 E(<epsg2416> : Beijing 1954 / 3-de)110.5
-144 Q(gree Gauss-Kruger zone 40)-.15 E(<epsg2417> : Beijing 1954 / 3-de)
-110.5 156 Q(gree Gauss-Kruger zone 41)-.15 E
-(<epsg2418> : Beijing 1954 / 3-de)110.5 168 Q(gree Gauss-Kruger zone 42)
--.15 E(<epsg2419> : Beijing 1954 / 3-de)110.5 180 Q
-(gree Gauss-Kruger zone 43)-.15 E(<epsg2420> : Beijing 1954 / 3-de)110.5
-192 Q(gree Gauss-Kruger zone 44)-.15 E(<epsg2421> : Beijing 1954 / 3-de)
-110.5 204 Q(gree Gauss-Kruger zone 45)-.15 E
-(<epsg2422> : Beijing 1954 / 3-de)110.5 216 Q(gree Gauss-Kruger CM 75E)
--.15 E(<epsg2423> : Beijing 1954 / 3-de)110.5 228 Q
-(gree Gauss-Kruger CM 78E)-.15 E(<epsg2424> : Beijing 1954 / 3-de)110.5
-240 Q(gree Gauss-Kruger CM 81E)-.15 E(<epsg2425> : Beijing 1954 / 3-de)
-110.5 252 Q(gree Gauss-Kruger CM 84E)-.15 E
-(<epsg2426> : Beijing 1954 / 3-de)110.5 264 Q(gree Gauss-Kruger CM 87E)
--.15 E(<epsg2427> : Beijing 1954 / 3-de)110.5 276 Q
-(gree Gauss-Kruger CM 90E)-.15 E(<epsg2428> : Beijing 1954 / 3-de)110.5
-288 Q(gree Gauss-Kruger CM 93E)-.15 E(<epsg2429> : Beijing 1954 / 3-de)
-110.5 300 Q(gree Gauss-Kruger CM 96E)-.15 E
-(<epsg2430> : Beijing 1954 / 3-de)110.5 312 Q(gree Gauss-Kruger CM 99E)
--.15 E(<epsg2431> : Beijing 1954 / 3-de)110.5 324 Q
-(gree Gauss-Kruger CM 102E)-.15 E(<epsg2432> : Beijing 1954 / 3-de)110.5
-336 Q(gree Gauss-Kruger CM 105E)-.15 E(<epsg2433> : Beijing 1954 / 3-de)
-110.5 348 Q(gree Gauss-Kruger CM 108E)-.15 E
-(<epsg2434> : Beijing 1954 / 3-de)110.5 360 Q(gree Gauss-Kruger CM 111E)
--.15 E(<epsg2435> : Beijing 1954 / 3-de)110.5 372 Q
-(gree Gauss-Kruger CM 114E)-.15 E(<epsg2436> : Beijing 1954 / 3-de)110.5
-384 Q(gree Gauss-Kruger CM 117E)-.15 E(<epsg2437> : Beijing 1954 / 3-de)
-110.5 396 Q(gree Gauss-Kruger CM 120E)-.15 E
-(<epsg2438> : Beijing 1954 / 3-de)110.5 408 Q(gree Gauss-Kruger CM 123E)
--.15 E(<epsg2439> : Beijing 1954 / 3-de)110.5 420 Q
-(gree Gauss-Kruger CM 126E)-.15 E(<epsg2440> : Beijing 1954 / 3-de)110.5
-432 Q(gree Gauss-Kruger CM 129E)-.15 E(<epsg2441> : Beijing 1954 / 3-de)
-110.5 444 Q(gree Gauss-Kruger CM 132E)-.15 E
-(<epsg2442> : Beijing 1954 / 3-de)110.5 456 Q(gree Gauss-Kruger CM 135E)
--.15 E(<epsg2443> : JGD2000 / Japan Plane Rectangular CS I)110.5 468 Q
-(<epsg2444> : JGD2000 / Japan Plane Rectangular CS II)110.5 480 Q
-(<epsg2445> : JGD2000 / Japan Plane Rectangular CS III)110.5 492 Q
-(<epsg2446> : JGD2000 / Japan Plane Rectangular CS IV)110.5 504 Q
-(<epsg2447> : JGD2000 / Japan Plane Rectangular CS V)110.5 516 Q
-(<epsg2448> : JGD2000 / Japan Plane Rectangular CS VI)110.5 528 Q
-(<epsg2449> : JGD2000 / Japan Plane Rectangular CS VII)110.5 540 Q
-(<epsg2450> : JGD2000 / Japan Plane Rectangular CS VIII)110.5 552 Q
-(<epsg2451> : JGD2000 / Japan Plane Rectangular CS IX)110.5 564 Q
-(<epsg2452> : JGD2000 / Japan Plane Rectangular CS X)110.5 576 Q
-(<epsg2453> : JGD2000 / Japan Plane Rectangular CS XI)110.5 588 Q
-(<epsg2454> : JGD2000 / Japan Plane Rectangular CS XII)110.5 600 Q
-(<epsg2455> : JGD2000 / Japan Plane Rectangular CS XIII)110.5 612 Q
-(<epsg2456> : JGD2000 / Japan Plane Rectangular CS XIV)110.5 624 Q
-(<epsg2457> : JGD2000 / Japan Plane Rectangular CS XV)110.5 636 Q
-(<epsg2458> : JGD2000 / Japan Plane Rectangular CS XVI)110.5 648 Q
-(<epsg2459> : JGD2000 / Japan Plane Rectangular CS XVII)110.5 660 Q
-(<epsg2460> : JGD2000 / Japan Plane Rectangular CS XVIII)110.5 672 Q
-(<epsg2461> : JGD2000 / Japan Plane Rectangular CS XIX)110.5 684 Q
-(<epsg2462> : Albanian 1987 / Gauss-Kruger zone 4)110.5 696 Q
-(<epsg2463> : Pulk)110.5 708 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger CM 21E)-2.5 E(<epsg2464> : Pulk)110.5 720 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger CM 27E)-2.5 E(MB-System 5.0)72
-768 Q(13 March 2014)140.11 E(39)193.45 E 0 Cg EP
-%%Page: 40 40
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<epsg2465> : Pulk)110.5 84 Q -.15(ov)-.1 G 2.5
-(o1)-.05 G(995 / Gauss-Kruger CM 33E)-2.5 E(<epsg2466> : Pulk)110.5 96 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger CM 39E)-2.5 E
-(<epsg2467> : Pulk)110.5 108 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger CM 45E)-2.5 E(<epsg2468> : Pulk)110.5 120 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger CM 51E)-2.5 E(<epsg2469> : Pulk)
-110.5 132 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger CM 57E)-2.5 E
-(<epsg2470> : Pulk)110.5 144 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger CM 63E)-2.5 E(<epsg2471> : Pulk)110.5 156 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger CM 69E)-2.5 E(<epsg2472> : Pulk)
-110.5 168 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger CM 75E)-2.5 E
-(<epsg2473> : Pulk)110.5 180 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger CM 81E)-2.5 E(<epsg2474> : Pulk)110.5 192 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger CM 87E)-2.5 E(<epsg2475> : Pulk)
-110.5 204 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger CM 93E)-2.5 E
-(<epsg2476> : Pulk)110.5 216 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger CM 99E)-2.5 E(<epsg2477> : Pulk)110.5 228 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger CM 105E)-2.5 E(<epsg2478> : Pulk)
-110.5 240 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger CM 111E)-2.5
-E(<epsg2479> : Pulk)110.5 252 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger CM 117E)-2.5 E(<epsg2480> : Pulk)110.5 264 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger CM 123E)-2.5 E
-(<epsg2481> : Pulk)110.5 276 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger CM 129E)-2.5 E(<epsg2482> : Pulk)110.5 288 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger CM 135E)-2.5 E
-(<epsg2483> : Pulk)110.5 300 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger CM 141E)-2.5 E(<epsg2484> : Pulk)110.5 312 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger CM 147E)-2.5 E
-(<epsg2485> : Pulk)110.5 324 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger CM 153E)-2.5 E(<epsg2486> : Pulk)110.5 336 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger CM 159E)-2.5 E
-(<epsg2487> : Pulk)110.5 348 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger CM 165E)-2.5 E(<epsg2488> : Pulk)110.5 360 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger CM 171E)-2.5 E
-(<epsg2489> : Pulk)110.5 372 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger CM 177E)-2.5 E(<epsg2490> : Pulk)110.5 384 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger CM 177W)-2.5 E
-(<epsg2491> : Pulk)110.5 396 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger CM 171W)-2.5 E(<epsg2492> : Pulk)110.5 408 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger CM 9E)-2.5 E
-(<epsg2493> : Pulk)110.5 420 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger CM 15E)-2.5 E(<epsg2494> : Pulk)110.5 432 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger CM 21E)-2.5 E(<epsg2495> : Pulk)
-110.5 444 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger CM 27E)-2.5 E
-(<epsg2496> : Pulk)110.5 456 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger CM 33E)-2.5 E(<epsg2497> : Pulk)110.5 468 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger CM 39E)-2.5 E(<epsg2498> : Pulk)
-110.5 480 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger CM 45E)-2.5 E
-(<epsg2499> : Pulk)110.5 492 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger CM 51E)-2.5 E(<epsg2500> : Pulk)110.5 504 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger CM 57E)-2.5 E(<epsg2501> : Pulk)
-110.5 516 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger CM 63E)-2.5 E
-(<epsg2502> : Pulk)110.5 528 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger CM 69E)-2.5 E(<epsg2503> : Pulk)110.5 540 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger CM 75E)-2.5 E(<epsg2504> : Pulk)
-110.5 552 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger CM 81E)-2.5 E
-(<epsg2505> : Pulk)110.5 564 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger CM 87E)-2.5 E(<epsg2506> : Pulk)110.5 576 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger CM 93E)-2.5 E(<epsg2507> : Pulk)
-110.5 588 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger CM 99E)-2.5 E
-(<epsg2508> : Pulk)110.5 600 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger CM 105E)-2.5 E(<epsg2509> : Pulk)110.5 612 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger CM 111E)-2.5 E
-(<epsg2510> : Pulk)110.5 624 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger CM 117E)-2.5 E(<epsg2511> : Pulk)110.5 636 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger CM 123E)-2.5 E
-(<epsg2512> : Pulk)110.5 648 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger CM 129E)-2.5 E(<epsg2513> : Pulk)110.5 660 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger CM 135E)-2.5 E
-(<epsg2514> : Pulk)110.5 672 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger CM 141E)-2.5 E(<epsg2515> : Pulk)110.5 684 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger CM 147E)-2.5 E
-(<epsg2516> : Pulk)110.5 696 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger CM 153E)-2.5 E(<epsg2517> : Pulk)110.5 708 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger CM 159E)-2.5 E
-(<epsg2518> : Pulk)110.5 720 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger CM 165E)-2.5 E(MB-System 5.0)72 768 Q(13 March 2014)
-140.11 E(40)193.45 E 0 Cg EP
-%%Page: 41 41
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<epsg2519> : Pulk)110.5 84 Q -.15(ov)-.1 G 2.5
-(o1)-.05 G(942 / Gauss-Kruger CM 171E)-2.5 E(<epsg2520> : Pulk)110.5 96
-Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger CM 177E)-2.5 E
-(<epsg2521> : Pulk)110.5 108 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger CM 177W)-2.5 E(<epsg2522> : Pulk)110.5 120 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger CM 171W)-2.5 E
-(<epsg2523> : Pulk)110.5 132 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)
--2.5 E(gree Gauss-Kruger zone 7)-.15 E(<epsg2524> : Pulk)110.5 144 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 8)
--.15 E(<epsg2525> : Pulk)110.5 156 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 9)-.15 E(<epsg2526> : Pulk)
-110.5 168 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E
-(gree Gauss-Kruger zone 10)-.15 E(<epsg2527> : Pulk)110.5 180 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 11)-.15 E
-(<epsg2528> : Pulk)110.5 192 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)
--2.5 E(gree Gauss-Kruger zone 12)-.15 E(<epsg2529> : Pulk)110.5 204 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 13)
--.15 E(<epsg2530> : Pulk)110.5 216 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 14)-.15 E(<epsg2531> : Pulk)
-110.5 228 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E
-(gree Gauss-Kruger zone 15)-.15 E(<epsg2532> : Pulk)110.5 240 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 16)-.15 E
-(<epsg2533> : Pulk)110.5 252 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)
--2.5 E(gree Gauss-Kruger zone 17)-.15 E(<epsg2534> : Pulk)110.5 264 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 18)
--.15 E(<epsg2535> : Pulk)110.5 276 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 19)-.15 E(<epsg2536> : Pulk)
-110.5 288 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E
-(gree Gauss-Kruger zone 20)-.15 E(<epsg2537> : Pulk)110.5 300 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 21)-.15 E
-(<epsg2538> : Pulk)110.5 312 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)
--2.5 E(gree Gauss-Kruger zone 22)-.15 E(<epsg2539> : Pulk)110.5 324 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 23)
--.15 E(<epsg2540> : Pulk)110.5 336 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 24)-.15 E(<epsg2541> : Pulk)
-110.5 348 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E
-(gree Gauss-Kruger zone 25)-.15 E(<epsg2542> : Pulk)110.5 360 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 26)-.15 E
-(<epsg2543> : Pulk)110.5 372 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)
--2.5 E(gree Gauss-Kruger zone 27)-.15 E(<epsg2544> : Pulk)110.5 384 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 28)
--.15 E(<epsg2545> : Pulk)110.5 396 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 29)-.15 E(<epsg2546> : Pulk)
-110.5 408 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E
-(gree Gauss-Kruger zone 30)-.15 E(<epsg2547> : Pulk)110.5 420 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 31)-.15 E
-(<epsg2548> : Pulk)110.5 432 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)
--2.5 E(gree Gauss-Kruger zone 32)-.15 E(<epsg2549> : Pulk)110.5 444 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 33)
--.15 E(<epsg2550> : Samboja / UTM zone 50S \(deprecated\))110.5 456 Q
-(<epsg2551> : Pulk)110.5 468 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)
--2.5 E(gree Gauss-Kruger zone 34)-.15 E(<epsg2552> : Pulk)110.5 480 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 35)
--.15 E(<epsg2553> : Pulk)110.5 492 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 36)-.15 E(<epsg2554> : Pulk)
-110.5 504 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E
-(gree Gauss-Kruger zone 37)-.15 E(<epsg2555> : Pulk)110.5 516 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 38)-.15 E
-(<epsg2556> : Pulk)110.5 528 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)
--2.5 E(gree Gauss-Kruger zone 39)-.15 E(<epsg2557> : Pulk)110.5 540 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 40)
--.15 E(<epsg2558> : Pulk)110.5 552 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 41)-.15 E(<epsg2559> : Pulk)
-110.5 564 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E
-(gree Gauss-Kruger zone 42)-.15 E(<epsg2560> : Pulk)110.5 576 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 43)-.15 E
-(<epsg2561> : Pulk)110.5 588 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)
--2.5 E(gree Gauss-Kruger zone 44)-.15 E(<epsg2562> : Pulk)110.5 600 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 45)
--.15 E(<epsg2563> : Pulk)110.5 612 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 46)-.15 E(<epsg2564> : Pulk)
-110.5 624 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E
-(gree Gauss-Kruger zone 47)-.15 E(<epsg2565> : Pulk)110.5 636 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 48)-.15 E
-(<epsg2566> : Pulk)110.5 648 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)
--2.5 E(gree Gauss-Kruger zone 49)-.15 E(<epsg2567> : Pulk)110.5 660 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 50)
--.15 E(<epsg2568> : Pulk)110.5 672 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 51)-.15 E(<epsg2569> : Pulk)
-110.5 684 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E
-(gree Gauss-Kruger zone 52)-.15 E(<epsg2570> : Pulk)110.5 696 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 53)-.15 E
-(<epsg2571> : Pulk)110.5 708 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)
--2.5 E(gree Gauss-Kruger zone 54)-.15 E(<epsg2572> : Pulk)110.5 720 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 55)
--.15 E(MB-System 5.0)72 768 Q(13 March 2014)140.11 E(41)193.45 E 0 Cg EP
-%%Page: 42 42
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<epsg2573> : Pulk)110.5 84 Q -.15(ov)-.1 G 2.5
-(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 56)-.15 E
-(<epsg2574> : Pulk)110.5 96 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)
--2.5 E(gree Gauss-Kruger zone 57)-.15 E(<epsg2575> : Pulk)110.5 108 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 58)
--.15 E(<epsg2576> : Pulk)110.5 120 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 59)-.15 E(<epsg2577> : Pulk)
-110.5 132 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E
-(gree Gauss-Kruger zone 60 \(deprecated\))-.15 E(<epsg2578> : Pulk)110.5
-144 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E
-(gree Gauss-Kruger zone 61)-.15 E(<epsg2579> : Pulk)110.5 156 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 62)-.15 E
-(<epsg2580> : Pulk)110.5 168 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)
--2.5 E(gree Gauss-Kruger zone 63)-.15 E(<epsg2581> : Pulk)110.5 180 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 64)
--.15 E(<epsg2582> : Pulk)110.5 192 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 21E)-.15 E(<epsg2583> : Pulk)
-110.5 204 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E
-(gree Gauss-Kruger CM 24E)-.15 E(<epsg2584> : Pulk)110.5 216 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 27E)-.15 E
-(<epsg2585> : Pulk)110.5 228 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)
--2.5 E(gree Gauss-Kruger CM 30E)-.15 E(<epsg2586> : Pulk)110.5 240 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 33E)
--.15 E(<epsg2587> : Pulk)110.5 252 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 36E)-.15 E(<epsg2588> : Pulk)
-110.5 264 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E
-(gree Gauss-Kruger CM 39E)-.15 E(<epsg2589> : Pulk)110.5 276 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 42E)-.15 E
-(<epsg2590> : Pulk)110.5 288 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)
--2.5 E(gree Gauss-Kruger CM 45E)-.15 E(<epsg2591> : Pulk)110.5 300 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 48E)
--.15 E(<epsg2592> : Pulk)110.5 312 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 51E)-.15 E(<epsg2593> : Pulk)
-110.5 324 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E
-(gree Gauss-Kruger CM 54E)-.15 E(<epsg2594> : Pulk)110.5 336 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 57E)-.15 E
-(<epsg2595> : Pulk)110.5 348 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)
--2.5 E(gree Gauss-Kruger CM 60E)-.15 E(<epsg2596> : Pulk)110.5 360 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 63E)
--.15 E(<epsg2597> : Pulk)110.5 372 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 66E)-.15 E(<epsg2598> : Pulk)
-110.5 384 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E
-(gree Gauss-Kruger CM 69E)-.15 E(<epsg2599> : Pulk)110.5 396 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 72E)-.15 E
-(<epsg2600> : Lietuv)110.5 408 Q(os K)-.2 E
-(oordinoei Sistema 1994 \(deprecated\))-.35 E(<epsg2601> : Pulk)110.5
-420 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E
-(gree Gauss-Kruger CM 75E)-.15 E(<epsg2602> : Pulk)110.5 432 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 78E)-.15 E
-(<epsg2603> : Pulk)110.5 444 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)
--2.5 E(gree Gauss-Kruger CM 81E)-.15 E(<epsg2604> : Pulk)110.5 456 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 84E)
--.15 E(<epsg2605> : Pulk)110.5 468 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 87E)-.15 E(<epsg2606> : Pulk)
-110.5 480 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E
-(gree Gauss-Kruger CM 90E)-.15 E(<epsg2607> : Pulk)110.5 492 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 93E)-.15 E
-(<epsg2608> : Pulk)110.5 504 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)
--2.5 E(gree Gauss-Kruger CM 96E)-.15 E(<epsg2609> : Pulk)110.5 516 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 99E)
--.15 E(<epsg2610> : Pulk)110.5 528 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 102E)-.15 E(<epsg2611> : Pulk)
-110.5 540 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E
-(gree Gauss-Kruger CM 105E)-.15 E(<epsg2612> : Pulk)110.5 552 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 108E)-.15 E
-(<epsg2613> : Pulk)110.5 564 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)
--2.5 E(gree Gauss-Kruger CM 111E)-.15 E(<epsg2614> : Pulk)110.5 576 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 114E)
--.15 E(<epsg2615> : Pulk)110.5 588 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 117E)-.15 E(<epsg2616> : Pulk)
-110.5 600 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E
-(gree Gauss-Kruger CM 120E)-.15 E(<epsg2617> : Pulk)110.5 612 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 123E)-.15 E
-(<epsg2618> : Pulk)110.5 624 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)
--2.5 E(gree Gauss-Kruger CM 126E)-.15 E(<epsg2619> : Pulk)110.5 636 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 129E)
--.15 E(<epsg2620> : Pulk)110.5 648 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 132E)-.15 E(<epsg2621> : Pulk)
-110.5 660 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E
-(gree Gauss-Kruger CM 135E)-.15 E(<epsg2622> : Pulk)110.5 672 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 138E)-.15 E
-(<epsg2623> : Pulk)110.5 684 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)
--2.5 E(gree Gauss-Kruger CM 141E)-.15 E(<epsg2624> : Pulk)110.5 696 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 144E)
--.15 E(<epsg2625> : Pulk)110.5 708 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 147E)-.15 E(<epsg2626> : Pulk)
-110.5 720 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E
-(gree Gauss-Kruger CM 150E)-.15 E(MB-System 5.0)72 768 Q(13 March 2014)
-140.11 E(42)193.45 E 0 Cg EP
-%%Page: 43 43
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<epsg2627> : Pulk)110.5 84 Q -.15(ov)-.1 G 2.5
-(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 153E)-.15 E
-(<epsg2628> : Pulk)110.5 96 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)
--2.5 E(gree Gauss-Kruger CM 156E)-.15 E(<epsg2629> : Pulk)110.5 108 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 159E)
--.15 E(<epsg2630> : Pulk)110.5 120 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 162E)-.15 E(<epsg2631> : Pulk)
-110.5 132 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E
-(gree Gauss-Kruger CM 165E)-.15 E(<epsg2632> : Pulk)110.5 144 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 168E)-.15 E
-(<epsg2633> : Pulk)110.5 156 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)
--2.5 E(gree Gauss-Kruger CM 171E)-.15 E(<epsg2634> : Pulk)110.5 168 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 174E)
--.15 E(<epsg2635> : Pulk)110.5 180 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 177E)-.15 E(<epsg2636> : Pulk)
-110.5 192 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E
-(gree Gauss-Kruger CM 180E)-.15 E(<epsg2637> : Pulk)110.5 204 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 177W)-.15 E
-(<epsg2638> : Pulk)110.5 216 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)
--2.5 E(gree Gauss-Kruger CM 174W)-.15 E(<epsg2639> : Pulk)110.5 228 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 171W)
--.15 E(<epsg2640> : Pulk)110.5 240 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 168W)-.15 E(<epsg2641> : Pulk)
-110.5 252 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E
-(gree Gauss-Kruger zone 7)-.15 E(<epsg2642> : Pulk)110.5 264 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 8)-.15 E
-(<epsg2643> : Pulk)110.5 276 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)
--2.5 E(gree Gauss-Kruger zone 9)-.15 E(<epsg2644> : Pulk)110.5 288 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 10)
--.15 E(<epsg2645> : Pulk)110.5 300 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 11)-.15 E(<epsg2646> : Pulk)
-110.5 312 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E
-(gree Gauss-Kruger zone 12)-.15 E(<epsg2647> : Pulk)110.5 324 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 13)-.15 E
-(<epsg2648> : Pulk)110.5 336 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)
--2.5 E(gree Gauss-Kruger zone 14)-.15 E(<epsg2649> : Pulk)110.5 348 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 15)
--.15 E(<epsg2650> : Pulk)110.5 360 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 16)-.15 E(<epsg2651> : Pulk)
-110.5 372 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E
-(gree Gauss-Kruger zone 17)-.15 E(<epsg2652> : Pulk)110.5 384 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 18)-.15 E
-(<epsg2653> : Pulk)110.5 396 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)
--2.5 E(gree Gauss-Kruger zone 19)-.15 E(<epsg2654> : Pulk)110.5 408 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 20)
--.15 E(<epsg2655> : Pulk)110.5 420 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 21)-.15 E(<epsg2656> : Pulk)
-110.5 432 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E
-(gree Gauss-Kruger zone 22)-.15 E(<epsg2657> : Pulk)110.5 444 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 23)-.15 E
-(<epsg2658> : Pulk)110.5 456 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)
--2.5 E(gree Gauss-Kruger zone 24)-.15 E(<epsg2659> : Pulk)110.5 468 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 25)
--.15 E(<epsg2660> : Pulk)110.5 480 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 26)-.15 E(<epsg2661> : Pulk)
-110.5 492 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E
-(gree Gauss-Kruger zone 27)-.15 E(<epsg2662> : Pulk)110.5 504 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 28)-.15 E
-(<epsg2663> : Pulk)110.5 516 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)
--2.5 E(gree Gauss-Kruger zone 29)-.15 E(<epsg2664> : Pulk)110.5 528 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 30)
--.15 E(<epsg2665> : Pulk)110.5 540 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 31)-.15 E(<epsg2666> : Pulk)
-110.5 552 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E
-(gree Gauss-Kruger zone 32)-.15 E(<epsg2667> : Pulk)110.5 564 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 33)-.15 E
-(<epsg2668> : Pulk)110.5 576 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)
--2.5 E(gree Gauss-Kruger zone 34)-.15 E(<epsg2669> : Pulk)110.5 588 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 35)
--.15 E(<epsg2670> : Pulk)110.5 600 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 36)-.15 E(<epsg2671> : Pulk)
-110.5 612 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E
-(gree Gauss-Kruger zone 37)-.15 E(<epsg2672> : Pulk)110.5 624 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 38)-.15 E
-(<epsg2673> : Pulk)110.5 636 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)
--2.5 E(gree Gauss-Kruger zone 39)-.15 E(<epsg2674> : Pulk)110.5 648 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 40)
--.15 E(<epsg2675> : Pulk)110.5 660 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 41)-.15 E(<epsg2676> : Pulk)
-110.5 672 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E
-(gree Gauss-Kruger zone 42)-.15 E(<epsg2677> : Pulk)110.5 684 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 43)-.15 E
-(<epsg2678> : Pulk)110.5 696 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)
--2.5 E(gree Gauss-Kruger zone 44)-.15 E(<epsg2679> : Pulk)110.5 708 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 45)
--.15 E(<epsg2680> : Pulk)110.5 720 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 46)-.15 E(MB-System 5.0)72 768
-Q(13 March 2014)140.11 E(43)193.45 E 0 Cg EP
-%%Page: 44 44
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<epsg2681> : Pulk)110.5 84 Q -.15(ov)-.1 G 2.5
-(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 47)-.15 E
-(<epsg2682> : Pulk)110.5 96 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)
--2.5 E(gree Gauss-Kruger zone 48)-.15 E(<epsg2683> : Pulk)110.5 108 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 49)
--.15 E(<epsg2684> : Pulk)110.5 120 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 50)-.15 E(<epsg2685> : Pulk)
-110.5 132 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E
-(gree Gauss-Kruger zone 51)-.15 E(<epsg2686> : Pulk)110.5 144 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 52)-.15 E
-(<epsg2687> : Pulk)110.5 156 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)
--2.5 E(gree Gauss-Kruger zone 53)-.15 E(<epsg2688> : Pulk)110.5 168 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 54)
--.15 E(<epsg2689> : Pulk)110.5 180 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 55)-.15 E(<epsg2690> : Pulk)
-110.5 192 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E
-(gree Gauss-Kruger zone 56)-.15 E(<epsg2691> : Pulk)110.5 204 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 57)-.15 E
-(<epsg2692> : Pulk)110.5 216 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)
--2.5 E(gree Gauss-Kruger zone 58)-.15 E(<epsg2693> : Pulk)110.5 228 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 59)
--.15 E(<epsg2694> : Pulk)110.5 240 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 60 \(deprecated\))-.15 E
-(<epsg2695> : Pulk)110.5 252 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)
--2.5 E(gree Gauss-Kruger zone 61)-.15 E(<epsg2696> : Pulk)110.5 264 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 62)
--.15 E(<epsg2697> : Pulk)110.5 276 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 63)-.15 E(<epsg2698> : Pulk)
-110.5 288 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E
-(gree Gauss-Kruger zone 64)-.15 E(<epsg2699> : Pulk)110.5 300 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 21E)-.15 E
-(<epsg2700> : Pulk)110.5 312 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)
--2.5 E(gree Gauss-Kruger CM 24E)-.15 E(<epsg2701> : Pulk)110.5 324 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 27E)
--.15 E(<epsg2702> : Pulk)110.5 336 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 30E)-.15 E(<epsg2703> : Pulk)
-110.5 348 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E
-(gree Gauss-Kruger CM 33E)-.15 E(<epsg2704> : Pulk)110.5 360 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 36E)-.15 E
-(<epsg2705> : Pulk)110.5 372 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)
--2.5 E(gree Gauss-Kruger CM 39E)-.15 E(<epsg2706> : Pulk)110.5 384 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 42E)
--.15 E(<epsg2707> : Pulk)110.5 396 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 45E)-.15 E(<epsg2708> : Pulk)
-110.5 408 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E
-(gree Gauss-Kruger CM 48E)-.15 E(<epsg2709> : Pulk)110.5 420 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 51E)-.15 E
-(<epsg2710> : Pulk)110.5 432 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)
--2.5 E(gree Gauss-Kruger CM 54E)-.15 E(<epsg2711> : Pulk)110.5 444 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 57E)
--.15 E(<epsg2712> : Pulk)110.5 456 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 60E)-.15 E(<epsg2713> : Pulk)
-110.5 468 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E
-(gree Gauss-Kruger CM 63E)-.15 E(<epsg2714> : Pulk)110.5 480 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 66E)-.15 E
-(<epsg2715> : Pulk)110.5 492 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)
--2.5 E(gree Gauss-Kruger CM 69E)-.15 E(<epsg2716> : Pulk)110.5 504 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 72E)
--.15 E(<epsg2717> : Pulk)110.5 516 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 75E)-.15 E(<epsg2718> : Pulk)
-110.5 528 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E
-(gree Gauss-Kruger CM 78E)-.15 E(<epsg2719> : Pulk)110.5 540 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 81E)-.15 E
-(<epsg2720> : Pulk)110.5 552 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)
--2.5 E(gree Gauss-Kruger CM 84E)-.15 E(<epsg2721> : Pulk)110.5 564 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 87E)
--.15 E(<epsg2722> : Pulk)110.5 576 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 90E)-.15 E(<epsg2723> : Pulk)
-110.5 588 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E
-(gree Gauss-Kruger CM 93E)-.15 E(<epsg2724> : Pulk)110.5 600 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 96E)-.15 E
-(<epsg2725> : Pulk)110.5 612 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)
--2.5 E(gree Gauss-Kruger CM 99E)-.15 E(<epsg2726> : Pulk)110.5 624 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 102E)
--.15 E(<epsg2727> : Pulk)110.5 636 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 105E)-.15 E(<epsg2728> : Pulk)
-110.5 648 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E
-(gree Gauss-Kruger CM 108E)-.15 E(<epsg2729> : Pulk)110.5 660 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 111E)-.15 E
-(<epsg2730> : Pulk)110.5 672 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)
--2.5 E(gree Gauss-Kruger CM 114E)-.15 E(<epsg2731> : Pulk)110.5 684 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 117E)
--.15 E(<epsg2732> : Pulk)110.5 696 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 120E)-.15 E(<epsg2733> : Pulk)
-110.5 708 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E
-(gree Gauss-Kruger CM 123E)-.15 E(<epsg2734> : Pulk)110.5 720 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 126E)-.15 E
-(MB-System 5.0)72 768 Q(13 March 2014)140.11 E(44)193.45 E 0 Cg EP
-%%Page: 45 45
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<epsg2735> : Pulk)110.5 84 Q -.15(ov)-.1 G 2.5
-(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 129E)-.15 E
-(<epsg2736> : T)110.5 96 Q(ete / UTM zone 36S)-.7 E(<epsg2737> : T)110.5
-108 Q(ete / UTM zone 37S)-.7 E(<epsg2738> : Pulk)110.5 120 Q -.15(ov)-.1
-G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 132E)-.15 E
-(<epsg2739> : Pulk)110.5 132 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)
--2.5 E(gree Gauss-Kruger CM 135E)-.15 E(<epsg2740> : Pulk)110.5 144 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 138E)
--.15 E(<epsg2741> : Pulk)110.5 156 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 141E)-.15 E(<epsg2742> : Pulk)
-110.5 168 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E
-(gree Gauss-Kruger CM 144E)-.15 E(<epsg2743> : Pulk)110.5 180 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 147E)-.15 E
-(<epsg2744> : Pulk)110.5 192 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)
--2.5 E(gree Gauss-Kruger CM 150E)-.15 E(<epsg2745> : Pulk)110.5 204 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 153E)
--.15 E(<epsg2746> : Pulk)110.5 216 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 156E)-.15 E(<epsg2747> : Pulk)
-110.5 228 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E
-(gree Gauss-Kruger CM 159E)-.15 E(<epsg2748> : Pulk)110.5 240 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 162E)-.15 E
-(<epsg2749> : Pulk)110.5 252 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)
--2.5 E(gree Gauss-Kruger CM 165E)-.15 E(<epsg2750> : Pulk)110.5 264 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 168E)
--.15 E(<epsg2751> : Pulk)110.5 276 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 171E)-.15 E(<epsg2752> : Pulk)
-110.5 288 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E
-(gree Gauss-Kruger CM 174E)-.15 E(<epsg2753> : Pulk)110.5 300 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 177E)-.15 E
-(<epsg2754> : Pulk)110.5 312 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)
--2.5 E(gree Gauss-Kruger CM 180E)-.15 E(<epsg2755> : Pulk)110.5 324 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 177W)
--.15 E(<epsg2756> : Pulk)110.5 336 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 174W)-.15 E(<epsg2757> : Pulk)
-110.5 348 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E
-(gree Gauss-Kruger CM 171W)-.15 E(<epsg2758> : Pulk)110.5 360 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 168W)-.15 E
-(<epsg2759> : N)110.5 372 Q(AD83\(HARN\) / Alabama East)-.35 E
-(<epsg2760> : N)110.5 384 Q(AD83\(HARN\) / Alabama W)-.35 E(est)-.8 E
-(<epsg2761> : N)110.5 396 Q(AD83\(HARN\) / Arizona East)-.35 E
-(<epsg2762> : N)110.5 408 Q(AD83\(HARN\) / Arizona Central)-.35 E
-(<epsg2763> : N)110.5 420 Q(AD83\(HARN\) / Arizona W)-.35 E(est)-.8 E
-(<epsg2764> : N)110.5 432 Q(AD83\(HARN\) / Arkansas North)-.35 E
-(<epsg2765> : N)110.5 444 Q(AD83\(HARN\) / Arkansas South)-.35 E
-(<epsg2766> : N)110.5 456 Q(AD83\(HARN\) / California zone 1)-.35 E
-(<epsg2767> : N)110.5 468 Q(AD83\(HARN\) / California zone 2)-.35 E
-(<epsg2768> : N)110.5 480 Q(AD83\(HARN\) / California zone 3)-.35 E
-(<epsg2769> : N)110.5 492 Q(AD83\(HARN\) / California zone 4)-.35 E
-(<epsg2770> : N)110.5 504 Q(AD83\(HARN\) / California zone 5)-.35 E
-(<epsg2771> : N)110.5 516 Q(AD83\(HARN\) / California zone 6)-.35 E
-(<epsg2772> : N)110.5 528 Q(AD83\(HARN\) / Colorado North)-.35 E
-(<epsg2773> : N)110.5 540 Q(AD83\(HARN\) / Colorado Central)-.35 E
-(<epsg2774> : N)110.5 552 Q(AD83\(HARN\) / Colorado South)-.35 E
-(<epsg2775> : N)110.5 564 Q(AD83\(HARN\) / Connecticut)-.35 E
-(<epsg2776> : N)110.5 576 Q(AD83\(HARN\) / Dela)-.35 E -.1(wa)-.15 G(re)
-.1 E(<epsg2777> : N)110.5 588 Q(AD83\(HARN\) / Florida East)-.35 E
-(<epsg2778> : N)110.5 600 Q(AD83\(HARN\) / Florida W)-.35 E(est)-.8 E
-(<epsg2779> : N)110.5 612 Q(AD83\(HARN\) / Florida North)-.35 E
-(<epsg2780> : N)110.5 624 Q(AD83\(HARN\) / Geor)-.35 E(gia East)-.18 E
-(<epsg2781> : N)110.5 636 Q(AD83\(HARN\) / Geor)-.35 E(gia W)-.18 E(est)
--.8 E(<epsg2782> : N)110.5 648 Q(AD83\(HARN\) / Ha)-.35 E -.1(wa)-.15 G
-(ii zone 1).1 E(<epsg2783> : N)110.5 660 Q(AD83\(HARN\) / Ha)-.35 E -.1
-(wa)-.15 G(ii zone 2).1 E(<epsg2784> : N)110.5 672 Q(AD83\(HARN\) / Ha)
--.35 E -.1(wa)-.15 G(ii zone 3).1 E(<epsg2785> : N)110.5 684 Q
-(AD83\(HARN\) / Ha)-.35 E -.1(wa)-.15 G(ii zone 4).1 E(<epsg2786> : N)
-110.5 696 Q(AD83\(HARN\) / Ha)-.35 E -.1(wa)-.15 G(ii zone 5).1 E
-(<epsg2787> : N)110.5 708 Q(AD83\(HARN\) / Idaho East)-.35 E
-(<epsg2788> : N)110.5 720 Q(AD83\(HARN\) / Idaho Central)-.35 E
-(MB-System 5.0)72 768 Q(13 March 2014)140.11 E(45)193.45 E 0 Cg EP
-%%Page: 46 46
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<epsg2789> : N)110.5 84 Q
-(AD83\(HARN\) / Idaho W)-.35 E(est)-.8 E(<epsg2790> : N)110.5 96 Q
-(AD83\(HARN\) / Illinois East)-.35 E(<epsg2791> : N)110.5 108 Q
-(AD83\(HARN\) / Illinois W)-.35 E(est)-.8 E(<epsg2792> : N)110.5 120 Q
-(AD83\(HARN\) / Indiana East)-.35 E(<epsg2793> : N)110.5 132 Q
-(AD83\(HARN\) / Indiana W)-.35 E(est)-.8 E(<epsg2794> : N)110.5 144 Q
-(AD83\(HARN\) / Io)-.35 E .2 -.1(wa N)-.25 H(orth).1 E(<epsg2795> : N)
-110.5 156 Q(AD83\(HARN\) / Io)-.35 E .2 -.1(wa S)-.25 H(outh).1 E
-(<epsg2796> : N)110.5 168 Q(AD83\(HARN\) / Kansas North)-.35 E
-(<epsg2797> : N)110.5 180 Q(AD83\(HARN\) / Kansas South)-.35 E
-(<epsg2798> : N)110.5 192 Q(AD83\(HARN\) / K)-.35 E(entuck)-.25 E 2.5
-(yN)-.15 G(orth)-2.5 E(<epsg2799> : N)110.5 204 Q(AD83\(HARN\) / K)-.35
-E(entuck)-.25 E 2.5(yS)-.15 G(outh)-2.5 E(<epsg2800> : N)110.5 216 Q
-(AD83\(HARN\) / Louisiana North)-.35 E(<epsg2801> : N)110.5 228 Q
-(AD83\(HARN\) / Louisiana South)-.35 E(<epsg2802> : N)110.5 240 Q
-(AD83\(HARN\) / Maine East)-.35 E(<epsg2803> : N)110.5 252 Q
-(AD83\(HARN\) / Maine W)-.35 E(est)-.8 E(<epsg2804> : N)110.5 264 Q
-(AD83\(HARN\) / Maryland)-.35 E(<epsg2805> : N)110.5 276 Q
-(AD83\(HARN\) / Massachusetts Mainland)-.35 E(<epsg2806> : N)110.5 288 Q
-(AD83\(HARN\) / Massachusetts Island)-.35 E(<epsg2807> : N)110.5 300 Q
-(AD83\(HARN\) / Michig)-.35 E(an North)-.05 E(<epsg2808> : N)110.5 312 Q
-(AD83\(HARN\) / Michig)-.35 E(an Central)-.05 E(<epsg2809> : N)110.5 324
-Q(AD83\(HARN\) / Michig)-.35 E(an South)-.05 E(<epsg2810> : N)110.5 336
-Q(AD83\(HARN\) / Minnesota North)-.35 E(<epsg2811> : N)110.5 348 Q
-(AD83\(HARN\) / Minnesota Central)-.35 E(<epsg2812> : N)110.5 360 Q
-(AD83\(HARN\) / Minnesota South)-.35 E(<epsg2813> : N)110.5 372 Q
-(AD83\(HARN\) / Mississippi East)-.35 E(<epsg2814> : N)110.5 384 Q
-(AD83\(HARN\) / Mississippi W)-.35 E(est)-.8 E(<epsg2815> : N)110.5 396
-Q(AD83\(HARN\) / Missouri East)-.35 E(<epsg2816> : N)110.5 408 Q
-(AD83\(HARN\) / Missouri Central)-.35 E(<epsg2817> : N)110.5 420 Q
-(AD83\(HARN\) / Missouri W)-.35 E(est)-.8 E(<epsg2818> : N)110.5 432 Q
-(AD83\(HARN\) / Montana)-.35 E(<epsg2819> : N)110.5 444 Q
-(AD83\(HARN\) / Nebraska)-.35 E(<epsg2820> : N)110.5 456 Q
-(AD83\(HARN\) / Ne)-.35 E -.25(va)-.25 G(da East).25 E(<epsg2821> : N)
-110.5 468 Q(AD83\(HARN\) / Ne)-.35 E -.25(va)-.25 G(da Central).25 E
-(<epsg2822> : N)110.5 480 Q(AD83\(HARN\) / Ne)-.35 E -.25(va)-.25 G
-(da W).25 E(est)-.8 E(<epsg2823> : N)110.5 492 Q(AD83\(HARN\) / Ne)-.35
-E 2.5(wH)-.25 G(ampshire)-2.5 E(<epsg2824> : N)110.5 504 Q
-(AD83\(HARN\) / Ne)-.35 E 2.5(wJ)-.25 G(erse)-2.5 E(y)-.15 E
-(<epsg2825> : N)110.5 516 Q(AD83\(HARN\) / Ne)-.35 E 2.5(wM)-.25 G -.15
-(ex)-2.5 G(ico East).15 E(<epsg2826> : N)110.5 528 Q(AD83\(HARN\) / Ne)
--.35 E 2.5(wM)-.25 G -.15(ex)-2.5 G(ico Central).15 E(<epsg2827> : N)
-110.5 540 Q(AD83\(HARN\) / Ne)-.35 E 2.5(wM)-.25 G -.15(ex)-2.5 G(ico W)
-.15 E(est)-.8 E(<epsg2828> : N)110.5 552 Q(AD83\(HARN\) / Ne)-.35 E 2.5
-(wY)-.25 G(ork East)-3.6 E(<epsg2829> : N)110.5 564 Q(AD83\(HARN\) / Ne)
--.35 E 2.5(wY)-.25 G(ork Central)-3.6 E(<epsg2830> : N)110.5 576 Q
-(AD83\(HARN\) / Ne)-.35 E 2.5(wY)-.25 G(ork W)-3.6 E(est)-.8 E
-(<epsg2831> : N)110.5 588 Q(AD83\(HARN\) / Ne)-.35 E 2.5(wY)-.25 G
-(ork Long Island)-3.6 E(<epsg2832> : N)110.5 600 Q
-(AD83\(HARN\) / North Dak)-.35 E(ota North)-.1 E(<epsg2833> : N)110.5
-612 Q(AD83\(HARN\) / North Dak)-.35 E(ota South)-.1 E(<epsg2834> : N)
-110.5 624 Q(AD83\(HARN\) / Ohio North)-.35 E(<epsg2835> : N)110.5 636 Q
-(AD83\(HARN\) / Ohio South)-.35 E(<epsg2836> : N)110.5 648 Q
-(AD83\(HARN\) / Oklahoma North)-.35 E(<epsg2837> : N)110.5 660 Q
-(AD83\(HARN\) / Oklahoma South)-.35 E(<epsg2838> : N)110.5 672 Q
-(AD83\(HARN\) / Ore)-.35 E(gon North)-.15 E(<epsg2839> : N)110.5 684 Q
-(AD83\(HARN\) / Ore)-.35 E(gon South)-.15 E(<epsg2840> : N)110.5 696 Q
-(AD83\(HARN\) / Rhode Island)-.35 E(<epsg2841> : N)110.5 708 Q
-(AD83\(HARN\) / South Dak)-.35 E(ota North)-.1 E(<epsg2842> : N)110.5
-720 Q(AD83\(HARN\) / South Dak)-.35 E(ota South)-.1 E(MB-System 5.0)72
-768 Q(13 March 2014)140.11 E(46)193.45 E 0 Cg EP
-%%Page: 47 47
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<epsg2843> : N)110.5 84 Q(AD83\(HARN\) / T)-.35
-E(ennessee)-.7 E(<epsg2844> : N)110.5 96 Q(AD83\(HARN\) / T)-.35 E -.15
-(ex)-.7 G(as North).15 E(<epsg2845> : N)110.5 108 Q(AD83\(HARN\) / T)
--.35 E -.15(ex)-.7 G(as North Central).15 E(<epsg2846> : N)110.5 120 Q
-(AD83\(HARN\) / T)-.35 E -.15(ex)-.7 G(as Central).15 E(<epsg2847> : N)
-110.5 132 Q(AD83\(HARN\) / T)-.35 E -.15(ex)-.7 G(as South Central).15 E
-(<epsg2848> : N)110.5 144 Q(AD83\(HARN\) / T)-.35 E -.15(ex)-.7 G
-(as South).15 E(<epsg2849> : N)110.5 156 Q(AD83\(HARN\) / Utah North)
--.35 E(<epsg2850> : N)110.5 168 Q(AD83\(HARN\) / Utah Central)-.35 E
-(<epsg2851> : N)110.5 180 Q(AD83\(HARN\) / Utah South)-.35 E
-(<epsg2852> : N)110.5 192 Q(AD83\(HARN\) / V)-.35 E(ermont)-1.11 E
-(<epsg2853> : N)110.5 204 Q(AD83\(HARN\) / V)-.35 E(ir)-.6 E
-(ginia North)-.18 E(<epsg2854> : N)110.5 216 Q(AD83\(HARN\) / V)-.35 E
-(ir)-.6 E(ginia South)-.18 E(<epsg2855> : N)110.5 228 Q
-(AD83\(HARN\) / W)-.35 E(ashington North)-.8 E(<epsg2856> : N)110.5 240
-Q(AD83\(HARN\) / W)-.35 E(ashington South)-.8 E(<epsg2857> : N)110.5 252
-Q(AD83\(HARN\) / W)-.35 E(est V)-.8 E(ir)-.6 E(ginia North)-.18 E
-(<epsg2858> : N)110.5 264 Q(AD83\(HARN\) / W)-.35 E(est V)-.8 E(ir)-.6 E
-(ginia South)-.18 E(<epsg2859> : N)110.5 276 Q(AD83\(HARN\) / W)-.35 E
-(isconsin North)-.4 E(<epsg2860> : N)110.5 288 Q(AD83\(HARN\) / W)-.35 E
-(isconsin Central)-.4 E(<epsg2861> : N)110.5 300 Q(AD83\(HARN\) / W)-.35
-E(isconsin South)-.4 E(<epsg2862> : N)110.5 312 Q(AD83\(HARN\) / W)-.35
-E(yoming East)-.73 E(<epsg2863> : N)110.5 324 Q(AD83\(HARN\) / W)-.35 E
-(yoming East Central)-.73 E(<epsg2864> : N)110.5 336 Q(AD83\(HARN\) / W)
--.35 E(yoming W)-.73 E(est Central)-.8 E(<epsg2865> : N)110.5 348 Q
-(AD83\(HARN\) / W)-.35 E(yoming W)-.73 E(est)-.8 E(<epsg2866> : N)110.5
-360 Q(AD83\(HARN\) / Puerto Rico & V)-.35 E(ir)-.6 E(gin Is.)-.18 E
-(<epsg2867> : N)110.5 372 Q(AD83\(HARN\) / Arizona East \(ft\))-.35 E
-(<epsg2868> : N)110.5 384 Q(AD83\(HARN\) / Arizona Central \(ft\))-.35 E
-(<epsg2869> : N)110.5 396 Q(AD83\(HARN\) / Arizona W)-.35 E(est \(ft\))
--.8 E(<epsg2870> : N)110.5 408 Q
-(AD83\(HARN\) / California zone 1 \(ftUS\))-.35 E(<epsg2871> : N)110.5
-420 Q(AD83\(HARN\) / California zone 2 \(ftUS\))-.35 E(<epsg2872> : N)
-110.5 432 Q(AD83\(HARN\) / California zone 3 \(ftUS\))-.35 E
-(<epsg2873> : N)110.5 444 Q(AD83\(HARN\) / California zone 4 \(ftUS\))
--.35 E(<epsg2874> : N)110.5 456 Q
-(AD83\(HARN\) / California zone 5 \(ftUS\))-.35 E(<epsg2875> : N)110.5
-468 Q(AD83\(HARN\) / California zone 6 \(ftUS\))-.35 E(<epsg2876> : N)
-110.5 480 Q(AD83\(HARN\) / Colorado North \(ftUS\))-.35 E
-(<epsg2877> : N)110.5 492 Q(AD83\(HARN\) / Colorado Central \(ftUS\))
--.35 E(<epsg2878> : N)110.5 504 Q
-(AD83\(HARN\) / Colorado South \(ftUS\))-.35 E(<epsg2879> : N)110.5 516
-Q(AD83\(HARN\) / Connecticut \(ftUS\))-.35 E(<epsg2880> : N)110.5 528 Q
-(AD83\(HARN\) / Dela)-.35 E -.1(wa)-.15 G(re \(ftUS\)).1 E
-(<epsg2881> : N)110.5 540 Q(AD83\(HARN\) / Florida East \(ftUS\))-.35 E
-(<epsg2882> : N)110.5 552 Q(AD83\(HARN\) / Florida W)-.35 E
-(est \(ftUS\))-.8 E(<epsg2883> : N)110.5 564 Q
-(AD83\(HARN\) / Florida North \(ftUS\))-.35 E(<epsg2884> : N)110.5 576 Q
-(AD83\(HARN\) / Geor)-.35 E(gia East \(ftUS\))-.18 E(<epsg2885> : N)
-110.5 588 Q(AD83\(HARN\) / Geor)-.35 E(gia W)-.18 E(est \(ftUS\))-.8 E
-(<epsg2886> : N)110.5 600 Q(AD83\(HARN\) / Idaho East \(ftUS\))-.35 E
-(<epsg2887> : N)110.5 612 Q(AD83\(HARN\) / Idaho Central \(ftUS\))-.35 E
-(<epsg2888> : N)110.5 624 Q(AD83\(HARN\) / Idaho W)-.35 E(est \(ftUS\))
--.8 E(<epsg2889> : N)110.5 636 Q
-(AD83\(HARN\) / Indiana East \(ftUS\) \(deprecated\))-.35 E
-(<epsg2890> : N)110.5 648 Q(AD83\(HARN\) / Indiana W)-.35 E
-(est \(ftUS\) \(deprecated\))-.8 E(<epsg2891> : N)110.5 660 Q
-(AD83\(HARN\) / K)-.35 E(entuck)-.25 E 2.5(yN)-.15 G(orth \(ftUS\))-2.5
-E(<epsg2892> : N)110.5 672 Q(AD83\(HARN\) / K)-.35 E(entuck)-.25 E 2.5
-(yS)-.15 G(outh \(ftUS\))-2.5 E(<epsg2893> : N)110.5 684 Q
-(AD83\(HARN\) / Maryland \(ftUS\))-.35 E(<epsg2894> : N)110.5 696 Q
-(AD83\(HARN\) / Massachusetts Mainland \(ftUS\))-.35 E(<epsg2895> : N)
-110.5 708 Q(AD83\(HARN\) / Massachusetts Island \(ftUS\))-.35 E
-(<epsg2896> : N)110.5 720 Q(AD83\(HARN\) / Michig)-.35 E
-(an North \(ft\))-.05 E(MB-System 5.0)72 768 Q(13 March 2014)140.11 E
-(47)193.45 E 0 Cg EP
-%%Page: 48 48
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<epsg2897> : N)110.5 84 Q
-(AD83\(HARN\) / Michig)-.35 E(an Central \(ft\))-.05 E(<epsg2898> : N)
-110.5 96 Q(AD83\(HARN\) / Michig)-.35 E(an South \(ft\))-.05 E
-(<epsg2899> : N)110.5 108 Q(AD83\(HARN\) / Mississippi East \(ftUS\))
--.35 E(<epsg2900> : N)110.5 120 Q(AD83\(HARN\) / Mississippi W)-.35 E
-(est \(ftUS\))-.8 E(<epsg2901> : N)110.5 132 Q
-(AD83\(HARN\) / Montana \(ft\))-.35 E(<epsg2902> : N)110.5 144 Q
-(AD83\(HARN\) / Ne)-.35 E 2.5(wM)-.25 G -.15(ex)-2.5 G
-(ico East \(ftUS\)).15 E(<epsg2903> : N)110.5 156 Q(AD83\(HARN\) / Ne)
--.35 E 2.5(wM)-.25 G -.15(ex)-2.5 G(ico Central \(ftUS\)).15 E
-(<epsg2904> : N)110.5 168 Q(AD83\(HARN\) / Ne)-.35 E 2.5(wM)-.25 G -.15
-(ex)-2.5 G(ico W).15 E(est \(ftUS\))-.8 E(<epsg2905> : N)110.5 180 Q
-(AD83\(HARN\) / Ne)-.35 E 2.5(wY)-.25 G(ork East \(ftUS\))-3.6 E
-(<epsg2906> : N)110.5 192 Q(AD83\(HARN\) / Ne)-.35 E 2.5(wY)-.25 G
-(ork Central \(ftUS\))-3.6 E(<epsg2907> : N)110.5 204 Q
-(AD83\(HARN\) / Ne)-.35 E 2.5(wY)-.25 G(ork W)-3.6 E(est \(ftUS\))-.8 E
-(<epsg2908> : N)110.5 216 Q(AD83\(HARN\) / Ne)-.35 E 2.5(wY)-.25 G
-(ork Long Island \(ftUS\))-3.6 E(<epsg2909> : N)110.5 228 Q
-(AD83\(HARN\) / North Dak)-.35 E(ota North \(ft\))-.1 E(<epsg2910> : N)
-110.5 240 Q(AD83\(HARN\) / North Dak)-.35 E(ota South \(ft\))-.1 E
-(<epsg2911> : N)110.5 252 Q(AD83\(HARN\) / Oklahoma North \(ftUS\))-.35
-E(<epsg2912> : N)110.5 264 Q(AD83\(HARN\) / Oklahoma South \(ftUS\))-.35
-E(<epsg2913> : N)110.5 276 Q(AD83\(HARN\) / Ore)-.35 E(gon North \(ft\))
--.15 E(<epsg2914> : N)110.5 288 Q(AD83\(HARN\) / Ore)-.35 E
-(gon South \(ft\))-.15 E(<epsg2915> : N)110.5 300 Q(AD83\(HARN\) / T)
--.35 E(ennessee \(ftUS\))-.7 E(<epsg2916> : N)110.5 312 Q
-(AD83\(HARN\) / T)-.35 E -.15(ex)-.7 G(as North \(ftUS\)).15 E
-(<epsg2917> : N)110.5 324 Q(AD83\(HARN\) / T)-.35 E -.15(ex)-.7 G
-(as North Central \(ftUS\)).15 E(<epsg2918> : N)110.5 336 Q
-(AD83\(HARN\) / T)-.35 E -.15(ex)-.7 G(as Central \(ftUS\)).15 E
-(<epsg2919> : N)110.5 348 Q(AD83\(HARN\) / T)-.35 E -.15(ex)-.7 G
-(as South Central \(ftUS\)).15 E(<epsg2920> : N)110.5 360 Q
-(AD83\(HARN\) / T)-.35 E -.15(ex)-.7 G(as South \(ftUS\)).15 E
-(<epsg2921> : N)110.5 372 Q(AD83\(HARN\) / Utah North \(ft\))-.35 E
-(<epsg2922> : N)110.5 384 Q(AD83\(HARN\) / Utah Central \(ft\))-.35 E
-(<epsg2923> : N)110.5 396 Q(AD83\(HARN\) / Utah South \(ft\))-.35 E
-(<epsg2924> : N)110.5 408 Q(AD83\(HARN\) / V)-.35 E(ir)-.6 E
-(ginia North \(ftUS\))-.18 E(<epsg2925> : N)110.5 420 Q
-(AD83\(HARN\) / V)-.35 E(ir)-.6 E(ginia South \(ftUS\))-.18 E
-(<epsg2926> : N)110.5 432 Q(AD83\(HARN\) / W)-.35 E
-(ashington North \(ftUS\))-.8 E(<epsg2927> : N)110.5 444 Q
-(AD83\(HARN\) / W)-.35 E(ashington South \(ftUS\))-.8 E(<epsg2928> : N)
-110.5 456 Q(AD83\(HARN\) / W)-.35 E(isconsin North \(ftUS\))-.4 E
-(<epsg2929> : N)110.5 468 Q(AD83\(HARN\) / W)-.35 E
-(isconsin Central \(ftUS\))-.4 E(<epsg2930> : N)110.5 480 Q
-(AD83\(HARN\) / W)-.35 E(isconsin South \(ftUS\))-.4 E
-(<epsg2931> : Beduaram / TM 13 NE)110.5 492 Q
-(<epsg2932> : QND95 / Qatar National Grid)110.5 504 Q(<epsg2933> : Se)
-110.5 516 Q -.05(ga)-.15 G(ra / UTM zone 50S).05 E(<epsg2934> : Se)110.5
-528 Q -.05(ga)-.15 G(ra \(Jakarta\) / NEIEZ \(deprecated\)).05 E
-(<epsg2935> : Pulk)110.5 540 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / CS63 zone A1)-2.5 E(<epsg2936> : Pulk)110.5 552 Q -.15(ov)-.1 G
-2.5(o1)-.05 G(942 / CS63 zone A2)-2.5 E(<epsg2937> : Pulk)110.5 564 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(942 / CS63 zone A3)-2.5 E(<epsg2938> : Pulk)
-110.5 576 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / CS63 zone A4)-2.5 E
-(<epsg2939> : Pulk)110.5 588 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / CS63 zone K2)-2.5 E(<epsg2940> : Pulk)110.5 600 Q -.15(ov)-.1 G
-2.5(o1)-.05 G(942 / CS63 zone K3)-2.5 E(<epsg2941> : Pulk)110.5 612 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(942 / CS63 zone K4)-2.5 E
-(<epsg2942> : Porto Santo / UTM zone 28N)110.5 624 Q(<epsg2943> : Selv)
-110.5 636 Q(agem Grande / UTM zone 28N)-.25 E(<epsg2944> : N)110.5 648 Q
-(AD83\(CSRS\) / SCoPQ zone 2)-.35 E(<epsg2945> : N)110.5 660 Q
-(AD83\(CSRS\) / MTM zone 3)-.35 E(<epsg2946> : N)110.5 672 Q
-(AD83\(CSRS\) / MTM zone 4)-.35 E(<epsg2947> : N)110.5 684 Q
-(AD83\(CSRS\) / MTM zone 5)-.35 E(<epsg2948> : N)110.5 696 Q
-(AD83\(CSRS\) / MTM zone 6)-.35 E(<epsg2949> : N)110.5 708 Q
-(AD83\(CSRS\) / MTM zone 7)-.35 E(<epsg2950> : N)110.5 720 Q
-(AD83\(CSRS\) / MTM zone 8)-.35 E(MB-System 5.0)72 768 Q(13 March 2014)
-140.11 E(48)193.45 E 0 Cg EP
-%%Page: 49 49
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<epsg2951> : N)110.5 84 Q
-(AD83\(CSRS\) / MTM zone 9)-.35 E(<epsg2952> : N)110.5 96 Q
-(AD83\(CSRS\) / MTM zone 10)-.35 E(<epsg2953> : N)110.5 108 Q
-(AD83\(CSRS\) / Ne)-.35 E 2.5(wB)-.25 G(runswick Stereo)-2.5 E
-(<epsg2954> : N)110.5 120 Q(AD83\(CSRS\) / Prince Edw)-.35 E
-(ard Isl. Stereographic \(N)-.1 E(AD83\))-.35 E(<epsg2955> : N)110.5 132
-Q(AD83\(CSRS\) / UTM zone 11N)-.35 E(<epsg2956> : N)110.5 144 Q
-(AD83\(CSRS\) / UTM zone 12N)-.35 E(<epsg2957> : N)110.5 156 Q
-(AD83\(CSRS\) / UTM zone 13N)-.35 E(<epsg2958> : N)110.5 168 Q
-(AD83\(CSRS\) / UTM zone 17N)-.35 E(<epsg2959> : N)110.5 180 Q
-(AD83\(CSRS\) / UTM zone 18N)-.35 E(<epsg2960> : N)110.5 192 Q
-(AD83\(CSRS\) / UTM zone 19N)-.35 E(<epsg2961> : N)110.5 204 Q
-(AD83\(CSRS\) / UTM zone 20N)-.35 E(<epsg2962> : N)110.5 216 Q
-(AD83\(CSRS\) / UTM zone 21N)-.35 E(<epsg2964> : N)110.5 228 Q
-(AD27 / Alaska Albers)-.35 E(<epsg2965> : N)110.5 240 Q
-(AD83 / Indiana East \(ftUS\))-.35 E(<epsg2966> : N)110.5 252 Q
-(AD83 / Indiana W)-.35 E(est \(ftUS\))-.8 E(<epsg2967> : N)110.5 264 Q
-(AD83\(HARN\) / Indiana East \(ftUS\))-.35 E(<epsg2968> : N)110.5 276 Q
-(AD83\(HARN\) / Indiana W)-.35 E(est \(ftUS\))-.8 E(<epsg2969> : F)110.5
-288 Q(ort Marigot / UTM zone 20N)-.15 E
-(<epsg2970> : Guadeloupe 1948 / UTM zone 20N)110.5 300 Q
-(<epsg2971> : CSG67 / UTM zone 22N)110.5 312 Q
-(<epsg2972> : RGFG95 / UTM zone 22N)110.5 324 Q
-(<epsg2973> : Martinique 1938 / UTM zone 20N)110.5 336 Q
-(<epsg2975> : RGR92 / UTM zone 40S)110.5 348 Q(<epsg2976> : T)110.5 360
-Q(ahiti 52 / UTM zone 6S)-.8 E(<epsg2977> : T)110.5 372 Q
-(ahaa 54 / UTM zone 5S)-.8 E(<epsg2978> : IGN72 Nuku Hi)110.5 384 Q .5
--.25(va / U)-.25 H(TM zone 7S).25 E
-(<epsg2979> : K0 1949 / UTM zone 42S \(deprecated\))110.5 396 Q
-(<epsg2980> : Combani 1950 / UTM zone 38S)110.5 408 Q
-(<epsg2981> : IGN56 Lifou / UTM zone 58S)110.5 420 Q
-(<epsg2982> : IGN72 Grand T)110.5 432 Q
-(erre / UTM zone 58S \(deprecated\))-.7 E(<epsg2983> : ST87 Ouv)110.5
-444 Q(ea / UTM zone 58S \(deprecated\))-.15 E
-(<epsg2984> : RGNC 1991 / Lambert Ne)110.5 456 Q 2.5(wC)-.25 G
-(aledonia \(deprecated\))-2.5 E
-(<epsg2987> : Saint Pierre et Miquelon 1950 / UTM zone 21N)110.5 468 Q
-(<epsg2988> : MOP78 / UTM zone 1S)110.5 480 Q
-(<epsg2989> : RRAF 1991 / UTM zone 20N)110.5 492 Q
-(<epsg2990> : Reunion 1947 / TM Reunion \(deprecated\))110.5 504 Q
-(<epsg2991> : N)110.5 516 Q(AD83 / Ore)-.35 E(gon Lambert)-.15 E
-(<epsg2992> : N)110.5 528 Q(AD83 / Ore)-.35 E(gon Lambert \(ft\))-.15 E
-(<epsg2993> : N)110.5 540 Q(AD83\(HARN\) / Ore)-.35 E(gon Lambert)-.15 E
-(<epsg2994> : N)110.5 552 Q(AD83\(HARN\) / Ore)-.35 E
-(gon Lambert \(ft\))-.15 E(<epsg2995> : IGN53 Mare / UTM zone 58S)110.5
-564 Q(<epsg2996> : ST84 Ile des Pins / UTM zone 58S)110.5 576 Q
-(<epsg2997> : ST71 Belep / UTM zone 58S)110.5 588 Q
-(<epsg2998> : NEA74 Noumea / UTM zone 58S)110.5 600 Q
-(<epsg2999> : Grand Comoros / UTM zone 38S)110.5 612 Q(<epsg3000> : Se)
-110.5 624 Q -.05(ga)-.15 G(ra / NEIEZ).05 E(<epsg3001> : Bata)110.5 636
-Q(via / NEIEZ)-.2 E(<epsg3002> : Makassar / NEIEZ)110.5 648 Q
-(<epsg3003> : Monte Mario / Italy zone 1)110.5 660 Q
-(<epsg3004> : Monte Mario / Italy zone 2)110.5 672 Q(<epsg3005> : N)
-110.5 684 Q(AD83 / BC Albers)-.35 E(<epsg3006> : SWEREF99 TM)110.5 696 Q
-(<epsg3007> : SWEREF99 12 00)110.5 708 Q(<epsg3008> : SWEREF99 13 30)
-110.5 720 Q(MB-System 5.0)72 768 Q(13 March 2014)140.11 E(49)193.45 E 0
-Cg EP
-%%Page: 50 50
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<epsg3009> : SWEREF99 15 00)110.5 84 Q
-(<epsg3010> : SWEREF99 16 30)110.5 96 Q(<epsg3011> : SWEREF99 18 00)
-110.5 108 Q(<epsg3012> : SWEREF99 14 15)110.5 120 Q
-(<epsg3013> : SWEREF99 15 45)110.5 132 Q(<epsg3014> : SWEREF99 17 15)
-110.5 144 Q(<epsg3015> : SWEREF99 18 45)110.5 156 Q
-(<epsg3016> : SWEREF99 20 15)110.5 168 Q(<epsg3017> : SWEREF99 21 45)
-110.5 180 Q(<epsg3018> : SWEREF99 23 15)110.5 192 Q(<epsg3019> : R)110.5
-204 Q(T90 7.5 gon V)-.6 E(<epsg3020> : R)110.5 216 Q(T90 5 gon V)-.6 E
-(<epsg3021> : R)110.5 228 Q(T90 2.5 gon V)-.6 E(<epsg3022> : R)110.5 240
-Q(T90 0 gon)-.6 E(<epsg3023> : R)110.5 252 Q(T90 2.5 gon O)-.6 E
-(<epsg3024> : R)110.5 264 Q(T90 5 gon O)-.6 E(<epsg3025> : R)110.5 276 Q
-(T38 7.5 gon V)-.6 E(<epsg3026> : R)110.5 288 Q(T38 5 gon V)-.6 E
-(<epsg3027> : R)110.5 300 Q(T38 2.5 gon V)-.6 E(<epsg3028> : R)110.5 312
-Q(T38 0 gon)-.6 E(<epsg3029> : R)110.5 324 Q(T38 2.5 gon O)-.6 E
-(<epsg3030> : R)110.5 336 Q(T38 5 gon O)-.6 E
-(<epsg3031> : WGS 84 / Antarctic Polar Stereographic)110.5 348 Q
-(<epsg3032> : WGS 84 / Australian Antarctic Polar Stereographic)110.5
-360 Q(<epsg3033> : WGS 84 / Australian Antarctic Lambert)110.5 372 Q
-(<epsg3034> : ETRS89 / ETRS-LCC)110.5 384 Q
-(<epsg3035> : ETRS89 / ETRS-LAEA)110.5 396 Q
-(<epsg3036> : Moznet / UTM zone 36S)110.5 408 Q
-(<epsg3037> : Moznet / UTM zone 37S)110.5 420 Q
-(<epsg3038> : ETRS89 / ETRS-TM26)110.5 432 Q
-(<epsg3039> : ETRS89 / ETRS-TM27)110.5 444 Q
-(<epsg3040> : ETRS89 / ETRS-TM28)110.5 456 Q
-(<epsg3041> : ETRS89 / ETRS-TM29)110.5 468 Q
-(<epsg3042> : ETRS89 / ETRS-TM30)110.5 480 Q
-(<epsg3043> : ETRS89 / ETRS-TM31)110.5 492 Q
-(<epsg3044> : ETRS89 / ETRS-TM32)110.5 504 Q
-(<epsg3045> : ETRS89 / ETRS-TM33)110.5 516 Q
-(<epsg3046> : ETRS89 / ETRS-TM34)110.5 528 Q
-(<epsg3047> : ETRS89 / ETRS-TM35)110.5 540 Q
-(<epsg3048> : ETRS89 / ETRS-TM36)110.5 552 Q
-(<epsg3049> : ETRS89 / ETRS-TM37)110.5 564 Q
-(<epsg3050> : ETRS89 / ETRS-TM38)110.5 576 Q
-(<epsg3051> : ETRS89 / ETRS-TM39)110.5 588 Q(<epsg3054> : Hjorse)110.5
-600 Q 2.5(y1)-.15 G(955 / UTM zone 26N)-2.5 E(<epsg3055> : Hjorse)110.5
-612 Q 2.5(y1)-.15 G(955 / UTM zone 27N)-2.5 E(<epsg3056> : Hjorse)110.5
-624 Q 2.5(y1)-.15 G(955 / UTM zone 28N)-2.5 E
-(<epsg3057> : ISN93 / Lambert 1993)110.5 636 Q
-(<epsg3058> : Helle 1954 / Jan Mayen Grid)110.5 648 Q
-(<epsg3059> : LKS92 / Latvia TM)110.5 660 Q(<epsg3060> : IGN72 Grande T)
-110.5 672 Q(erre / UTM zone 58S)-.7 E
-(<epsg3061> : Porto Santo 1995 / UTM zone 28N)110.5 684 Q
-(<epsg3062> : Azores Oriental 1995 / UTM zone 26N)110.5 696 Q
-(<epsg3063> : Azores Central 1995 / UTM zone 26N)110.5 708 Q
-(<epsg3064> : IGM95 / UTM zone 32N)110.5 720 Q(MB-System 5.0)72 768 Q
-(13 March 2014)140.11 E(50)193.45 E 0 Cg EP
-%%Page: 51 51
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<epsg3065> : IGM95 / UTM zone 33N)110.5 84 Q
-(<epsg3066> : ED50 / Jordan TM)110.5 96 Q
-(<epsg3067> : ETRS89 / ETRS-TM35FIN)110.5 108 Q
-(<epsg3068> : DHDN / Soldner Berlin)110.5 120 Q(<epsg3069> : N)110.5 132
-Q(AD27 / W)-.35 E(isconsin T)-.4 E(ransv)-.35 E(erse Mercator)-.15 E
-(<epsg3070> : N)110.5 144 Q(AD83 / W)-.35 E(isconsin T)-.4 E(ransv)-.35
-E(erse Mercator)-.15 E(<epsg3071> : N)110.5 156 Q(AD83\(HARN\) / W)-.35
-E(isconsin T)-.4 E(ransv)-.35 E(erse Mercator)-.15 E(<epsg3072> : N)
-110.5 168 Q(AD83 / Maine CS2000 East)-.35 E(<epsg3073> : N)110.5 180 Q
-(AD83 / Maine CS2000 Central \(deprecated\))-.35 E(<epsg3074> : N)110.5
-192 Q(AD83 / Maine CS2000 W)-.35 E(est)-.8 E(<epsg3075> : N)110.5 204 Q
-(AD83\(HARN\) / Maine CS2000 East)-.35 E(<epsg3076> : N)110.5 216 Q
-(AD83\(HARN\) / Maine CS2000 Central \(deprecated\))-.35 E
-(<epsg3077> : N)110.5 228 Q(AD83\(HARN\) / Maine CS2000 W)-.35 E(est)-.8
-E(<epsg3078> : N)110.5 240 Q(AD83 / Michig)-.35 E(an Oblique Mercator)
--.05 E(<epsg3079> : N)110.5 252 Q(AD83\(HARN\) / Michig)-.35 E
-(an Oblique Mercator)-.05 E(<epsg3080> : N)110.5 264 Q
-(AD27 / Shackleford)-.35 E(<epsg3081> : N)110.5 276 Q(AD83 / T)-.35 E
--.15(ex)-.7 G(as State Mapping System).15 E(<epsg3082> : N)110.5 288 Q
-(AD83 / T)-.35 E -.15(ex)-.7 G(as Centric Lambert Conformal).15 E
-(<epsg3083> : N)110.5 300 Q(AD83 / T)-.35 E -.15(ex)-.7 G
-(as Centric Albers Equal Area).15 E(<epsg3084> : N)110.5 312 Q
-(AD83\(HARN\) / T)-.35 E -.15(ex)-.7 G(as Centric Lambert Conformal).15
-E(<epsg3085> : N)110.5 324 Q(AD83\(HARN\) / T)-.35 E -.15(ex)-.7 G
-(as Centric Albers Equal Area).15 E(<epsg3086> : N)110.5 336 Q
-(AD83 / Florida GDL Albers)-.35 E(<epsg3087> : N)110.5 348 Q
-(AD83\(HARN\) / Florida GDL Albers)-.35 E(<epsg3088> : N)110.5 360 Q
-(AD83 / K)-.35 E(entuck)-.25 E 2.5(yS)-.15 G(ingle Zone)-2.5 E
-(<epsg3089> : N)110.5 372 Q(AD83 / K)-.35 E(entuck)-.25 E 2.5(yS)-.15 G
-(ingle Zone \(ftUS\))-2.5 E(<epsg3090> : N)110.5 384 Q(AD83\(HARN\) / K)
--.35 E(entuck)-.25 E 2.5(yS)-.15 G(ingle Zone)-2.5 E(<epsg3091> : N)
-110.5 396 Q(AD83\(HARN\) / K)-.35 E(entuck)-.25 E 2.5(yS)-.15 G
-(ingle Zone \(ftUS\))-2.5 E(<epsg3092> : T)110.5 408 Q(ok)-.8 E
-(yo / UTM zone 51N)-.15 E(<epsg3093> : T)110.5 420 Q(ok)-.8 E
-(yo / UTM zone 52N)-.15 E(<epsg3094> : T)110.5 432 Q(ok)-.8 E
-(yo / UTM zone 53N)-.15 E(<epsg3095> : T)110.5 444 Q(ok)-.8 E
-(yo / UTM zone 54N)-.15 E(<epsg3096> : T)110.5 456 Q(ok)-.8 E
-(yo / UTM zone 55N)-.15 E(<epsg3097> : JGD2000 / UTM zone 51N)110.5 468
-Q(<epsg3098> : JGD2000 / UTM zone 52N)110.5 480 Q
-(<epsg3099> : JGD2000 / UTM zone 53N)110.5 492 Q
-(<epsg3100> : JGD2000 / UTM zone 54N)110.5 504 Q
-(<epsg3101> : JGD2000 / UTM zone 55N)110.5 516 Q
-(<epsg3102> : American Samoa 1962 / American Samoa Lambert)110.5 528 Q
-(<epsg3103> : Mauritania 1999 / UTM zone 28N \(deprecated\))110.5 540 Q
-(<epsg3104> : Mauritania 1999 / UTM zone 29N \(deprecated\))110.5 552 Q
-(<epsg3105> : Mauritania 1999 / UTM zone 30N \(deprecated\))110.5 564 Q
-(<epsg3106> : Gulshan 303 / Bangladesh T)110.5 576 Q(ransv)-.35 E
-(erse Mercator)-.15 E(<epsg3107> : GD)110.5 588 Q(A94 / SA Lambert)-.4 E
-(<epsg3108> : ETRS89 / Guernse)110.5 600 Q 2.5(yG)-.15 G(rid)-2.5 E
-(<epsg3109> : ETRS89 / Jerse)110.5 612 Q 2.5(yT)-.15 G(ransv)-2.85 E
-(erse Mercator)-.15 E(<epsg3110> : A)110.5 624 Q(GD66 / V)-.4 E
-(icgrid66)-.6 E(<epsg3111> : GD)110.5 636 Q(A94 / V)-.4 E(icgrid94)-.6 E
-(<epsg3112> : GD)110.5 648 Q(A94 / Geoscience Australia Lambert)-.4 E
-(<epsg3113> : GD)110.5 660 Q(A94 / BCSG02)-.4 E(<epsg3114> : MA)110.5
-672 Q(GN)-.4 E(A-SIRGAS / Colombia F)-.35 E(ar W)-.15 E(est zone)-.8 E
-(<epsg3115> : MA)110.5 684 Q(GN)-.4 E(A-SIRGAS / Colombia W)-.35 E
-(est zone)-.8 E(<epsg3116> : MA)110.5 696 Q(GN)-.4 E
-(A-SIRGAS / Colombia Bogota zone)-.35 E(<epsg3117> : MA)110.5 708 Q(GN)
--.4 E(A-SIRGAS / Colombia East Central zone)-.35 E(<epsg3118> : MA)110.5
-720 Q(GN)-.4 E(A-SIRGAS / Colombia East zone)-.35 E(MB-System 5.0)72 768
-Q(13 March 2014)140.11 E(51)193.45 E 0 Cg EP
-%%Page: 52 52
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<epsg3119> : Douala 1948 / AEF west)110.5 84 Q
-(<epsg3120> : Pulk)110.5 96 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942\(58\) / Poland zone I)-2.5 E
-(<epsg3121> : PRS92 / Philippines zone 1)110.5 108 Q
-(<epsg3122> : PRS92 / Philippines zone 2)110.5 120 Q
-(<epsg3123> : PRS92 / Philippines zone 3)110.5 132 Q
-(<epsg3124> : PRS92 / Philippines zone 4)110.5 144 Q
-(<epsg3125> : PRS92 / Philippines zone 5)110.5 156 Q
-(<epsg3126> : ETRS89 / ETRS-GK19FIN)110.5 168 Q
-(<epsg3127> : ETRS89 / ETRS-GK20FIN)110.5 180 Q
-(<epsg3128> : ETRS89 / ETRS-GK21FIN)110.5 192 Q
-(<epsg3129> : ETRS89 / ETRS-GK22FIN)110.5 204 Q
-(<epsg3130> : ETRS89 / ETRS-GK23FIN)110.5 216 Q
-(<epsg3131> : ETRS89 / ETRS-GK24FIN)110.5 228 Q
-(<epsg3132> : ETRS89 / ETRS-GK25FIN)110.5 240 Q
-(<epsg3133> : ETRS89 / ETRS-GK26FIN)110.5 252 Q
-(<epsg3134> : ETRS89 / ETRS-GK27FIN)110.5 264 Q
-(<epsg3135> : ETRS89 / ETRS-GK28FIN)110.5 276 Q
-(<epsg3136> : ETRS89 / ETRS-GK29FIN)110.5 288 Q
-(<epsg3137> : ETRS89 / ETRS-GK30FIN)110.5 300 Q
-(<epsg3138> : ETRS89 / ETRS-GK31FIN)110.5 312 Q(<epsg3140> : V)110.5 324
-Q(iti Le)-.6 E(vu 1912 / V)-.25 E(iti Le)-.6 E(vu Grid)-.25 E
-(<epsg3141> : Fiji 1956 / UTM zone 60S)110.5 336 Q
-(<epsg3142> : Fiji 1956 / UTM zone 1S)110.5 348 Q
-(<epsg3143> : Fiji 1986 / Fiji Map Grid \(deprecated\))110.5 360 Q
-(<epsg3146> : Pulk)110.5 372 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)
--2.5 E(gree Gauss-Kruger zone 6)-.15 E(<epsg3147> : Pulk)110.5 384 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 18E)
--.15 E(<epsg3148> : Indian 1960 / UTM zone 48N)110.5 396 Q
-(<epsg3149> : Indian 1960 / UTM zone 49N)110.5 408 Q(<epsg3150> : Pulk)
-110.5 420 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E
-(gree Gauss-Kruger zone 6)-.15 E(<epsg3151> : Pulk)110.5 432 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 18E)-.15 E
-(<epsg3152> : ST74)110.5 444 Q(<epsg3153> : N)110.5 456 Q
-(AD83\(CSRS\) / BC Albers)-.35 E(<epsg3154> : N)110.5 468 Q
-(AD83\(CSRS\) / UTM zone 7N)-.35 E(<epsg3155> : N)110.5 480 Q
-(AD83\(CSRS\) / UTM zone 8N)-.35 E(<epsg3156> : N)110.5 492 Q
-(AD83\(CSRS\) / UTM zone 9N)-.35 E(<epsg3157> : N)110.5 504 Q
-(AD83\(CSRS\) / UTM zone 10N)-.35 E(<epsg3158> : N)110.5 516 Q
-(AD83\(CSRS\) / UTM zone 14N)-.35 E(<epsg3159> : N)110.5 528 Q
-(AD83\(CSRS\) / UTM zone 15N)-.35 E(<epsg3160> : N)110.5 540 Q
-(AD83\(CSRS\) / UTM zone 16N)-.35 E(<epsg3161> : N)110.5 552 Q
-(AD83 / Ontario MNR Lambert)-.35 E(<epsg3162> : N)110.5 564 Q
-(AD83\(CSRS\) / Ontario MNR Lambert)-.35 E
-(<epsg3163> : RGNC91-93 / Lambert Ne)110.5 576 Q 2.5(wC)-.25 G(aledonia)
--2.5 E(<epsg3164> : ST87 Ouv)110.5 588 Q(ea / UTM zone 58S)-.15 E
-(<epsg3165> : NEA74 Noumea / Noumea Lambert)110.5 600 Q
-(<epsg3166> : NEA74 Noumea / Noumea Lambert 2)110.5 612 Q
-(<epsg3167> : K)110.5 624 Q(ertau \(RSO\) / RSO Malaya \(ch\))-.25 E
-(<epsg3168> : K)110.5 636 Q(ertau \(RSO\) / RSO Malaya \(m\))-.25 E
-(<epsg3169> : RGNC91-93 / UTM zone 57S)110.5 648 Q
-(<epsg3170> : RGNC91-93 / UTM zone 58S)110.5 660 Q
-(<epsg3171> : RGNC91-93 / UTM zone 59S)110.5 672 Q
-(<epsg3172> : IGN53 Mare / UTM zone 59S)110.5 684 Q(<epsg3174> : N)110.5
-696 Q(AD83 / Great Lak)-.35 E(es Albers)-.1 E(<epsg3175> : N)110.5 708 Q
-(AD83 / Great Lak)-.35 E(es and St La)-.1 E(wrence Albers)-.15 E
-(<epsg3176> : Indian 1960 / TM 106 NE)110.5 720 Q(MB-System 5.0)72 768 Q
-(13 March 2014)140.11 E(52)193.45 E 0 Cg EP
-%%Page: 53 53
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<epsg3177> : LGD2006 / Libya TM)110.5 84 Q
-(<epsg3178> : GR96 / UTM zone 18N)110.5 96 Q
-(<epsg3179> : GR96 / UTM zone 19N)110.5 108 Q
-(<epsg3180> : GR96 / UTM zone 20N)110.5 120 Q
-(<epsg3181> : GR96 / UTM zone 21N)110.5 132 Q
-(<epsg3182> : GR96 / UTM zone 22N)110.5 144 Q
-(<epsg3183> : GR96 / UTM zone 23N)110.5 156 Q
-(<epsg3184> : GR96 / UTM zone 24N)110.5 168 Q
-(<epsg3185> : GR96 / UTM zone 25N)110.5 180 Q
-(<epsg3186> : GR96 / UTM zone 26N)110.5 192 Q
-(<epsg3187> : GR96 / UTM zone 27N)110.5 204 Q
-(<epsg3188> : GR96 / UTM zone 28N)110.5 216 Q
-(<epsg3189> : GR96 / UTM zone 29N)110.5 228 Q
-(<epsg3190> : LGD2006 / Libya TM zone 5)110.5 240 Q
-(<epsg3191> : LGD2006 / Libya TM zone 6)110.5 252 Q
-(<epsg3192> : LGD2006 / Libya TM zone 7)110.5 264 Q
-(<epsg3193> : LGD2006 / Libya TM zone 8)110.5 276 Q
-(<epsg3194> : LGD2006 / Libya TM zone 9)110.5 288 Q
-(<epsg3195> : LGD2006 / Libya TM zone 10)110.5 300 Q
-(<epsg3196> : LGD2006 / Libya TM zone 11)110.5 312 Q
-(<epsg3197> : LGD2006 / Libya TM zone 12)110.5 324 Q
-(<epsg3198> : LGD2006 / Libya TM zone 13)110.5 336 Q
-(<epsg3199> : LGD2006 / UTM zone 32N)110.5 348 Q
-(<epsg3200> : FD58 / Iraq zone)110.5 360 Q
-(<epsg3201> : LGD2006 / UTM zone 33N)110.5 372 Q
-(<epsg3202> : LGD2006 / UTM zone 34N)110.5 384 Q
-(<epsg3203> : LGD2006 / UTM zone 35N)110.5 396 Q
-(<epsg3204> : WGS 84 / SCAR IMW SP19-20)110.5 408 Q
-(<epsg3205> : WGS 84 / SCAR IMW SP21-22)110.5 420 Q
-(<epsg3206> : WGS 84 / SCAR IMW SP23-24)110.5 432 Q
-(<epsg3207> : WGS 84 / SCAR IMW SQ01-02)110.5 444 Q
-(<epsg3208> : WGS 84 / SCAR IMW SQ19-20)110.5 456 Q
-(<epsg3209> : WGS 84 / SCAR IMW SQ21-22)110.5 468 Q
-(<epsg3210> : WGS 84 / SCAR IMW SQ37-38)110.5 480 Q
-(<epsg3211> : WGS 84 / SCAR IMW SQ39-40)110.5 492 Q
-(<epsg3212> : WGS 84 / SCAR IMW SQ41-42)110.5 504 Q
-(<epsg3213> : WGS 84 / SCAR IMW SQ43-44)110.5 516 Q
-(<epsg3214> : WGS 84 / SCAR IMW SQ45-46)110.5 528 Q
-(<epsg3215> : WGS 84 / SCAR IMW SQ47-48)110.5 540 Q
-(<epsg3216> : WGS 84 / SCAR IMW SQ49-50)110.5 552 Q
-(<epsg3217> : WGS 84 / SCAR IMW SQ51-52)110.5 564 Q
-(<epsg3218> : WGS 84 / SCAR IMW SQ53-54)110.5 576 Q
-(<epsg3219> : WGS 84 / SCAR IMW SQ55-56)110.5 588 Q
-(<epsg3220> : WGS 84 / SCAR IMW SQ57-58)110.5 600 Q
-(<epsg3221> : WGS 84 / SCAR IMW SR13-14)110.5 612 Q
-(<epsg3222> : WGS 84 / SCAR IMW SR15-16)110.5 624 Q
-(<epsg3223> : WGS 84 / SCAR IMW SR17-18)110.5 636 Q
-(<epsg3224> : WGS 84 / SCAR IMW SR19-20)110.5 648 Q
-(<epsg3225> : WGS 84 / SCAR IMW SR27-28)110.5 660 Q
-(<epsg3226> : WGS 84 / SCAR IMW SR29-30)110.5 672 Q
-(<epsg3227> : WGS 84 / SCAR IMW SR31-32)110.5 684 Q
-(<epsg3228> : WGS 84 / SCAR IMW SR33-34)110.5 696 Q
-(<epsg3229> : WGS 84 / SCAR IMW SR35-36)110.5 708 Q
-(<epsg3230> : WGS 84 / SCAR IMW SR37-38)110.5 720 Q(MB-System 5.0)72 768
-Q(13 March 2014)140.11 E(53)193.45 E 0 Cg EP
-%%Page: 54 54
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<epsg3231> : WGS 84 / SCAR IMW SR39-40)110.5 84
-Q(<epsg3232> : WGS 84 / SCAR IMW SR41-42)110.5 96 Q
-(<epsg3233> : WGS 84 / SCAR IMW SR43-44)110.5 108 Q
-(<epsg3234> : WGS 84 / SCAR IMW SR45-46)110.5 120 Q
-(<epsg3235> : WGS 84 / SCAR IMW SR47-48)110.5 132 Q
-(<epsg3236> : WGS 84 / SCAR IMW SR49-50)110.5 144 Q
-(<epsg3237> : WGS 84 / SCAR IMW SR51-52)110.5 156 Q
-(<epsg3238> : WGS 84 / SCAR IMW SR53-54)110.5 168 Q
-(<epsg3239> : WGS 84 / SCAR IMW SR55-56)110.5 180 Q
-(<epsg3240> : WGS 84 / SCAR IMW SR57-58)110.5 192 Q
-(<epsg3241> : WGS 84 / SCAR IMW SR59-60)110.5 204 Q
-(<epsg3242> : WGS 84 / SCAR IMW SS04-06)110.5 216 Q
-(<epsg3243> : WGS 84 / SCAR IMW SS07-09)110.5 228 Q
-(<epsg3244> : WGS 84 / SCAR IMW SS10-12)110.5 240 Q
-(<epsg3245> : WGS 84 / SCAR IMW SS13-15)110.5 252 Q
-(<epsg3246> : WGS 84 / SCAR IMW SS16-18)110.5 264 Q
-(<epsg3247> : WGS 84 / SCAR IMW SS19-21)110.5 276 Q
-(<epsg3248> : WGS 84 / SCAR IMW SS25-27)110.5 288 Q
-(<epsg3249> : WGS 84 / SCAR IMW SS28-30)110.5 300 Q
-(<epsg3250> : WGS 84 / SCAR IMW SS31-33)110.5 312 Q
-(<epsg3251> : WGS 84 / SCAR IMW SS34-36)110.5 324 Q
-(<epsg3252> : WGS 84 / SCAR IMW SS37-39)110.5 336 Q
-(<epsg3253> : WGS 84 / SCAR IMW SS40-42)110.5 348 Q
-(<epsg3254> : WGS 84 / SCAR IMW SS43-45)110.5 360 Q
-(<epsg3255> : WGS 84 / SCAR IMW SS46-48)110.5 372 Q
-(<epsg3256> : WGS 84 / SCAR IMW SS49-51)110.5 384 Q
-(<epsg3257> : WGS 84 / SCAR IMW SS52-54)110.5 396 Q
-(<epsg3258> : WGS 84 / SCAR IMW SS55-57)110.5 408 Q
-(<epsg3259> : WGS 84 / SCAR IMW SS58-60)110.5 420 Q
-(<epsg3260> : WGS 84 / SCAR IMW ST01-04)110.5 432 Q
-(<epsg3261> : WGS 84 / SCAR IMW ST05-08)110.5 444 Q
-(<epsg3262> : WGS 84 / SCAR IMW ST09-12)110.5 456 Q
-(<epsg3263> : WGS 84 / SCAR IMW ST13-16)110.5 468 Q
-(<epsg3264> : WGS 84 / SCAR IMW ST17-20)110.5 480 Q
-(<epsg3265> : WGS 84 / SCAR IMW ST21-24)110.5 492 Q
-(<epsg3266> : WGS 84 / SCAR IMW ST25-28)110.5 504 Q
-(<epsg3267> : WGS 84 / SCAR IMW ST29-32)110.5 516 Q
-(<epsg3268> : WGS 84 / SCAR IMW ST33-36)110.5 528 Q
-(<epsg3269> : WGS 84 / SCAR IMW ST37-40)110.5 540 Q
-(<epsg3270> : WGS 84 / SCAR IMW ST41-44)110.5 552 Q
-(<epsg3271> : WGS 84 / SCAR IMW ST45-48)110.5 564 Q
-(<epsg3272> : WGS 84 / SCAR IMW ST49-52)110.5 576 Q
-(<epsg3273> : WGS 84 / SCAR IMW ST53-56)110.5 588 Q
-(<epsg3274> : WGS 84 / SCAR IMW ST57-60)110.5 600 Q
-(<epsg3275> : WGS 84 / SCAR IMW SU01-05)110.5 612 Q
-(<epsg3276> : WGS 84 / SCAR IMW SU06-10)110.5 624 Q
-(<epsg3277> : WGS 84 / SCAR IMW SU11-15)110.5 636 Q
-(<epsg3278> : WGS 84 / SCAR IMW SU16-20)110.5 648 Q
-(<epsg3279> : WGS 84 / SCAR IMW SU21-25)110.5 660 Q
-(<epsg3280> : WGS 84 / SCAR IMW SU26-30)110.5 672 Q
-(<epsg3281> : WGS 84 / SCAR IMW SU31-35)110.5 684 Q
-(<epsg3282> : WGS 84 / SCAR IMW SU36-40)110.5 696 Q
-(<epsg3283> : WGS 84 / SCAR IMW SU41-45)110.5 708 Q
-(<epsg3284> : WGS 84 / SCAR IMW SU46-50)110.5 720 Q(MB-System 5.0)72 768
-Q(13 March 2014)140.11 E(54)193.45 E 0 Cg EP
-%%Page: 55 55
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<epsg3285> : WGS 84 / SCAR IMW SU51-55)110.5 84
-Q(<epsg3286> : WGS 84 / SCAR IMW SU56-60)110.5 96 Q
-(<epsg3287> : WGS 84 / SCAR IMW SV01-10)110.5 108 Q
-(<epsg3288> : WGS 84 / SCAR IMW SV11-20)110.5 120 Q
-(<epsg3289> : WGS 84 / SCAR IMW SV21-30)110.5 132 Q
-(<epsg3290> : WGS 84 / SCAR IMW SV31-40)110.5 144 Q
-(<epsg3291> : WGS 84 / SCAR IMW SV41-50)110.5 156 Q
-(<epsg3292> : WGS 84 / SCAR IMW SV51-60)110.5 168 Q
-(<epsg3293> : WGS 84 / SCAR IMW SW01-60)110.5 180 Q
-(<epsg3294> : WGS 84 / USGS T)110.5 192 Q(ransantarctic Mountains)-.35 E
-(<epsg3296> : RGPF / UTM zone 5S)110.5 204 Q
-(<epsg3297> : RGPF / UTM zone 6S)110.5 216 Q
-(<epsg3298> : RGPF / UTM zone 7S)110.5 228 Q
-(<epsg3299> : RGPF / UTM zone 8S)110.5 240 Q
-(<epsg3300> : Estonian Coordinate System of 1992)110.5 252 Q
-(<epsg3301> : Estonian Coordinate System of 1997)110.5 264 Q
-(<epsg3302> : IGN63 Hi)110.5 276 Q .5 -.25(va O)-.25 H 2.5(a/U).25 G
-(TM zone 7S)-2.5 E(<epsg3303> : F)110.5 288 Q(atu Iv)-.15 E 2.5(a7)-.25
-G 2.5(2/U)-2.5 G(TM zone 7S)-2.5 E(<epsg3304> : T)110.5 300 Q
-(ahiti 79 / UTM zone 6S)-.8 E(<epsg3305> : Moorea 87 / UTM zone 6S)110.5
-312 Q(<epsg3306> : Maupiti 83 / UTM zone 5S)110.5 324 Q
-(<epsg3307> : Nakhl-e Ghanem / UTM zone 39N)110.5 336 Q(<epsg3308> : GD)
-110.5 348 Q(A94 / NSW Lambert)-.4 E(<epsg3309> : N)110.5 360 Q
-(AD27 / California Albers)-.35 E(<epsg3310> : N)110.5 372 Q
-(AD83 / California Albers)-.35 E(<epsg3311> : N)110.5 384 Q
-(AD83\(HARN\) / California Albers)-.35 E
-(<epsg3312> : CSG67 / UTM zone 21N)110.5 396 Q
-(<epsg3313> : RGFG95 / UTM zone 21N)110.5 408 Q(<epsg3314> : Katang)
-110.5 420 Q 2.5(a1)-.05 G(955 / Katang)-2.5 E 2.5(aL)-.05 G(ambert)-2.5
-E(<epsg3315> : Katang)110.5 432 Q 2.5(a1)-.05 G(955 / Katang)-2.5 E 2.5
-(aT)-.05 G(M)-2.5 E(<epsg3316> : Kasai 1953 / Congo TM zone 22)110.5 444
-Q(<epsg3317> : Kasai 1953 / Congo TM zone 24)110.5 456 Q
-(<epsg3318> : IGC 1962 / Congo TM zone 12)110.5 468 Q
-(<epsg3319> : IGC 1962 / Congo TM zone 14)110.5 480 Q
-(<epsg3320> : IGC 1962 / Congo TM zone 16)110.5 492 Q
-(<epsg3321> : IGC 1962 / Congo TM zone 18)110.5 504 Q
-(<epsg3322> : IGC 1962 / Congo TM zone 20)110.5 516 Q
-(<epsg3323> : IGC 1962 / Congo TM zone 22)110.5 528 Q
-(<epsg3324> : IGC 1962 / Congo TM zone 24)110.5 540 Q
-(<epsg3325> : IGC 1962 / Congo TM zone 26)110.5 552 Q
-(<epsg3326> : IGC 1962 / Congo TM zone 28)110.5 564 Q
-(<epsg3327> : IGC 1962 / Congo TM zone 30)110.5 576 Q(<epsg3328> : Pulk)
-110.5 588 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942\(58\) / GUGiK-80)-2.5 E
-(<epsg3329> : Pulk)110.5 600 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942\(58\) / 3-de)-2.5 E(gree Gauss-Kruger zone 5)-.15 E
-(<epsg3330> : Pulk)110.5 612 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942\(58\) / 3-de)-2.5 E(gree Gauss-Kruger zone 6)-.15 E
-(<epsg3331> : Pulk)110.5 624 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942\(58\) / 3-de)-2.5 E(gree Gauss-Kruger zone 7)-.15 E
-(<epsg3332> : Pulk)110.5 636 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942\(58\) / 3-de)-2.5 E(gree Gauss-Kruger zone 8)-.15 E
-(<epsg3333> : Pulk)110.5 648 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942\(58\) / Gauss-Kruger zone 3)-2.5 E(<epsg3334> : Pulk)110.5 660 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(942\(58\) / Gauss-Kruger zone 4)-2.5 E
-(<epsg3335> : Pulk)110.5 672 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942\(58\) / Gauss-Kruger zone 5)-2.5 E(<epsg3336> : IGN 1962 K)110.5
-684 Q(er)-.25 E(guelen / UTM zone 42S)-.18 E
-(<epsg3337> : Le Pouce 1934 / Mauritius Grid)110.5 696 Q(<epsg3338> : N)
-110.5 708 Q(AD83 / Alaska Albers)-.35 E
-(<epsg3339> : IGCB 1955 / Congo TM zone 12)110.5 720 Q(MB-System 5.0)72
-768 Q(13 March 2014)140.11 E(55)193.45 E 0 Cg EP
-%%Page: 56 56
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<epsg3340> : IGCB 1955 / Congo TM zone 14)110.5
-84 Q(<epsg3341> : IGCB 1955 / Congo TM zone 16)110.5 96 Q
-(<epsg3342> : IGCB 1955 / UTM zone 33S)110.5 108 Q
-(<epsg3343> : Mauritania 1999 / UTM zone 28N)110.5 120 Q
-(<epsg3344> : Mauritania 1999 / UTM zone 29N)110.5 132 Q
-(<epsg3345> : Mauritania 1999 / UTM zone 30N)110.5 144 Q
-(<epsg3346> : LKS94 / Lithuania TM)110.5 156 Q(<epsg3347> : N)110.5 168
-Q(AD83 / Statistics Canada Lambert)-.35 E(<epsg3348> : N)110.5 180 Q
-(AD83\(CSRS\) / Statistics Canada Lambert)-.35 E
-(<epsg3349> : WGS 84 / PDC Mercator)110.5 192 Q(<epsg3350> : Pulk)110.5
-204 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / CS63 zone C0)-2.5 E
-(<epsg3351> : Pulk)110.5 216 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / CS63 zone C1)-2.5 E(<epsg3352> : Pulk)110.5 228 Q -.15(ov)-.1 G
-2.5(o1)-.05 G(942 / CS63 zone C2)-2.5 E
-(<epsg3353> : Mhast \(onshore\) / UTM zone 32S)110.5 240 Q
-(<epsg3354> : Mhast \(of)110.5 252 Q(fshore\) / UTM zone 32S)-.25 E
-(<epsg3355> : Egypt Gulf of Suez S-650 TL / Red Belt)110.5 264 Q
-(<epsg3356> : Grand Cayman 1959 / UTM zone 17N)110.5 276 Q
-(<epsg3357> : Little Cayman 1961 / UTM zone 17N)110.5 288 Q
-(<epsg3358> : N)110.5 300 Q(AD83\(HARN\) / North Carolina)-.35 E
-(<epsg3359> : N)110.5 312 Q
-(AD83\(HARN\) / North Carolina \(ftUS\) \(deprecated\))-.35 E
-(<epsg3360> : N)110.5 324 Q(AD83\(HARN\) / South Carolina)-.35 E
-(<epsg3361> : N)110.5 336 Q(AD83\(HARN\) / South Carolina \(ft\))-.35 E
-(<epsg3362> : N)110.5 348 Q(AD83\(HARN\) / Pennsylv)-.35 E(ania North)
--.25 E(<epsg3363> : N)110.5 360 Q(AD83\(HARN\) / Pennsylv)-.35 E
-(ania North \(ftUS\))-.25 E(<epsg3364> : N)110.5 372 Q
-(AD83\(HARN\) / Pennsylv)-.35 E(ania South)-.25 E(<epsg3365> : N)110.5
-384 Q(AD83\(HARN\) / Pennsylv)-.35 E(ania South \(ftUS\))-.25 E
-(<epsg3366> : Hong K)110.5 396 Q(ong 1963 Grid System \(deprecated\))
--.35 E(<epsg3367> : IGN Astro 1960 / UTM zone 28N)110.5 408 Q
-(<epsg3368> : IGN Astro 1960 / UTM zone 29N)110.5 420 Q
-(<epsg3369> : IGN Astro 1960 / UTM zone 30N)110.5 432 Q(<epsg3370> : N)
-110.5 444 Q(AD27 / UTM zone 59N)-.35 E(<epsg3371> : N)110.5 456 Q
-(AD27 / UTM zone 60N)-.35 E(<epsg3372> : N)110.5 468 Q
-(AD83 / UTM zone 59N)-.35 E(<epsg3373> : N)110.5 480 Q
-(AD83 / UTM zone 60N)-.35 E(<epsg3374> : FD54 / UTM zone 29N)110.5 492 Q
-(<epsg3375> : GDM2000 / Peninsula RSO)110.5 504 Q
-(<epsg3376> : GDM2000 / East Malaysia BRSO)110.5 516 Q
-(<epsg3377> : GDM2000 / Johor Grid)110.5 528 Q
-(<epsg3378> : GDM2000 / Sembilan and Melaka Grid)110.5 540 Q
-(<epsg3379> : GDM2000 / P)110.5 552 Q(ahangGrid)-.15 E
-(<epsg3380> : GDM2000 / Selangor Grid)110.5 564 Q
-(<epsg3381> : GDM2000 / T)110.5 576 Q(erengg)-.7 E(anu Grid)-.05 E
-(<epsg3382> : GDM2000 / Pinang Grid)110.5 588 Q
-(<epsg3383> : GDM2000 / K)110.5 600 Q(edah and Perlis Grid)-.25 E
-(<epsg3384> : GDM2000 / Perak Grid)110.5 612 Q(<epsg3385> : GDM2000 / K)
-110.5 624 Q(elantan Grid)-.25 E(<epsg3386> : KKJ / Finland zone 0)110.5
-636 Q(<epsg3387> : KKJ / Finland zone 5)110.5 648 Q(<epsg3388> : Pulk)
-110.5 660 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / Caspian Sea Mercator)-2.5
-E(<epsg3389> : Pulk)110.5 672 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)
--2.5 E(gree Gauss-Kruger zone 60)-.15 E(<epsg3390> : Pulk)110.5 684 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 60)
--.15 E(<epsg3391> : Karbala 1979 \(Polservice\) / UTM zone 37N)110.5 696
-Q(<epsg3392> : Karbala 1979 \(Polservice\) / UTM zone 38N)110.5 708 Q
-(<epsg3393> : Karbala 1979 \(Polservice\) / UTM zone 39N)110.5 720 Q
-(MB-System 5.0)72 768 Q(13 March 2014)140.11 E(56)193.45 E 0 Cg EP
-%%Page: 57 57
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<epsg3394> : Nahrw)110.5 84 Q
-(an 1934 / Iraq zone)-.1 E(<epsg3395> : WGS 84 / W)110.5 96 Q
-(orld Mercator)-.8 E(<epsg3396> : PD/83 / Gauss-Kruger zone 3)110.5 108
-Q(<epsg3397> : PD/83 / Gauss-Kruger zone 4)110.5 120 Q
-(<epsg3398> : RD/83 / Gauss-Kruger zone 4)110.5 132 Q
-(<epsg3399> : RD/83 / Gauss-Kruger zone 5)110.5 144 Q(<epsg3400> : N)
-110.5 156 Q(AD83 / Alberta 10-TM \(F)-.35 E(orest\))-.15 E
-(<epsg3401> : N)110.5 168 Q(AD83 / Alberta 10-TM \(Resource\))-.35 E
-(<epsg3402> : N)110.5 180 Q(AD83\(CSRS\) / Alberta 10-TM \(F)-.35 E
-(orest\))-.15 E(<epsg3403> : N)110.5 192 Q
-(AD83\(CSRS\) / Alberta 10-TM \(Resource\))-.35 E(<epsg3404> : N)110.5
-204 Q(AD83\(HARN\) / North Carolina \(ftUS\))-.35 E
-(<epsg3405> : VN-2000 / UTM zone 48N)110.5 216 Q
-(<epsg3406> : VN-2000 / UTM zone 49N)110.5 228 Q(<epsg3407> : Hong K)
-110.5 240 Q(ong 1963 Grid System)-.35 E
-(<epsg3408> : NSIDC EASE-Grid North)110.5 252 Q
-(<epsg3409> : NSIDC EASE-Grid South)110.5 264 Q
-(<epsg3411> : NSIDC Sea Ice Polar Stereographic North)110.5 276 Q
-(<epsg3412> : NSIDC Sea Ice Polar Stereographic South)110.5 288 Q
-(<epsg3413> : WGS 84 / NSIDC Sea Ice Polar Stereographic North)110.5 300
-Q(<epsg3414> : SVY21 / Sing)110.5 312 Q(apore TM)-.05 E
-(<epsg3415> : WGS 72BE / South China Sea Lambert)110.5 324 Q
-(<epsg3416> : ETRS89 / Austria Lambert)110.5 336 Q(<epsg3417> : N)110.5
-348 Q(AD83 / Io)-.35 E .2 -.1(wa N)-.25 H(orth \(ft US\)).1 E
-(<epsg3418> : N)110.5 360 Q(AD83 / Io)-.35 E .2 -.1(wa S)-.25 H
-(outh \(ft US\)).1 E(<epsg3419> : N)110.5 372 Q
-(AD83 / Kansas North \(ft US\))-.35 E(<epsg3420> : N)110.5 384 Q
-(AD83 / Kansas South \(ft US\))-.35 E(<epsg3421> : N)110.5 396 Q
-(AD83 / Ne)-.35 E -.25(va)-.25 G(da East \(ft US\)).25 E(<epsg3422> : N)
-110.5 408 Q(AD83 / Ne)-.35 E -.25(va)-.25 G(da Central \(ft US\)).25 E
-(<epsg3423> : N)110.5 420 Q(AD83 / Ne)-.35 E -.25(va)-.25 G(da W).25 E
-(est \(ft US\))-.8 E(<epsg3424> : N)110.5 432 Q(AD83 / Ne)-.35 E 2.5(wJ)
--.25 G(erse)-2.5 E 2.5(y\()-.15 G(ft US\))-2.5 E(<epsg3425> : N)110.5
-444 Q(AD83\(HARN\) / Io)-.35 E .2 -.1(wa N)-.25 H(orth \(ft US\)).1 E
-(<epsg3426> : N)110.5 456 Q(AD83\(HARN\) / Io)-.35 E .2 -.1(wa S)-.25 H
-(outh \(ft US\)).1 E(<epsg3427> : N)110.5 468 Q
-(AD83\(HARN\) / Kansas North \(ft US\))-.35 E(<epsg3428> : N)110.5 480 Q
-(AD83\(HARN\) / Kansas South \(ft US\))-.35 E(<epsg3429> : N)110.5 492 Q
-(AD83\(HARN\) / Ne)-.35 E -.25(va)-.25 G(da East \(ft US\)).25 E
-(<epsg3430> : N)110.5 504 Q(AD83\(HARN\) / Ne)-.35 E -.25(va)-.25 G
-(da Central \(ft US\)).25 E(<epsg3431> : N)110.5 516 Q
-(AD83\(HARN\) / Ne)-.35 E -.25(va)-.25 G(da W).25 E(est \(ft US\))-.8 E
-(<epsg3432> : N)110.5 528 Q(AD83\(HARN\) / Ne)-.35 E 2.5(wJ)-.25 G(erse)
--2.5 E 2.5(y\()-.15 G(ft US\))-2.5 E(<epsg3433> : N)110.5 540 Q
-(AD83 / Arkansas North \(ftUS\))-.35 E(<epsg3434> : N)110.5 552 Q
-(AD83 / Arkansas South \(ftUS\))-.35 E(<epsg3435> : N)110.5 564 Q
-(AD83 / Illinois East \(ftUS\))-.35 E(<epsg3436> : N)110.5 576 Q
-(AD83 / Illinois W)-.35 E(est \(ftUS\))-.8 E(<epsg3437> : N)110.5 588 Q
-(AD83 / Ne)-.35 E 2.5(wH)-.25 G(ampshire \(ftUS\))-2.5 E(<epsg3438> : N)
-110.5 600 Q(AD83 / Rhode Island \(ftUS\))-.35 E
-(<epsg3439> : PSD93 / UTM zone 39N)110.5 612 Q
-(<epsg3440> : PSD93 / UTM zone 40N)110.5 624 Q(<epsg3441> : N)110.5 636
-Q(AD83\(HARN\) / Arkansas North \(ftUS\))-.35 E(<epsg3442> : N)110.5 648
-Q(AD83\(HARN\) / Arkansas South \(ftUS\))-.35 E(<epsg3443> : N)110.5 660
-Q(AD83\(HARN\) / Illinois East \(ftUS\))-.35 E(<epsg3444> : N)110.5 672
-Q(AD83\(HARN\) / Illinois W)-.35 E(est \(ftUS\))-.8 E(<epsg3445> : N)
-110.5 684 Q(AD83\(HARN\) / Ne)-.35 E 2.5(wH)-.25 G(ampshire \(ftUS\))
--2.5 E(<epsg3446> : N)110.5 696 Q(AD83\(HARN\) / Rhode Island \(ftUS\))
--.35 E(<epsg3447> : ETRS89 / Belgian Lambert 2005)110.5 708 Q
-(<epsg3448> : J)110.5 720 Q(AD2001 / Jamaica Metric Grid)-.6 E
-(MB-System 5.0)72 768 Q(13 March 2014)140.11 E(57)193.45 E 0 Cg EP
-%%Page: 58 58
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<epsg3449> : J)110.5 84 Q
-(AD2001 / UTM zone 17N)-.6 E(<epsg3450> : J)110.5 96 Q
-(AD2001 / UTM zone 18N)-.6 E(<epsg3451> : N)110.5 108 Q
-(AD83 / Louisiana North \(ftUS\))-.35 E(<epsg3452> : N)110.5 120 Q
-(AD83 / Louisiana South \(ftUS\))-.35 E(<epsg3453> : N)110.5 132 Q
-(AD83 / Louisiana Of)-.35 E(fshore \(ftUS\))-.25 E(<epsg3454> : N)110.5
-144 Q(AD83 / South Dak)-.35 E(ota North \(ftUS\))-.1 E(<epsg3455> : N)
-110.5 156 Q(AD83 / South Dak)-.35 E(ota South \(ftUS\))-.1 E
-(<epsg3456> : N)110.5 168 Q(AD83\(HARN\) / Louisiana North \(ftUS\))-.35
-E(<epsg3457> : N)110.5 180 Q(AD83\(HARN\) / Louisiana South \(ftUS\))
--.35 E(<epsg3458> : N)110.5 192 Q(AD83\(HARN\) / South Dak)-.35 E
-(ota North \(ftUS\))-.1 E(<epsg3459> : N)110.5 204 Q
-(AD83\(HARN\) / South Dak)-.35 E(ota South \(ftUS\))-.1 E
-(<epsg3460> : Fiji 1986 / Fiji Map Grid)110.5 216 Q
-(<epsg3461> : Dabola 1981 / UTM zone 28N)110.5 228 Q
-(<epsg3462> : Dabola 1981 / UTM zone 29N)110.5 240 Q(<epsg3463> : N)
-110.5 252 Q(AD83 / Maine CS2000 Central)-.35 E(<epsg3464> : N)110.5 264
-Q(AD83\(HARN\) / Maine CS2000 Central)-.35 E(<epsg3465> : N)110.5 276 Q
-(AD83\(NSRS2007\) / Alabama East)-.35 E(<epsg3466> : N)110.5 288 Q
-(AD83\(NSRS2007\) / Alabama W)-.35 E(est)-.8 E(<epsg3467> : N)110.5 300
-Q(AD83\(NSRS2007\) / Alaska Albers)-.35 E(<epsg3468> : N)110.5 312 Q
-(AD83\(NSRS2007\) / Alaska zone 1)-.35 E(<epsg3469> : N)110.5 324 Q
-(AD83\(NSRS2007\) / Alaska zone 2)-.35 E(<epsg3470> : N)110.5 336 Q
-(AD83\(NSRS2007\) / Alaska zone 3)-.35 E(<epsg3471> : N)110.5 348 Q
-(AD83\(NSRS2007\) / Alaska zone 4)-.35 E(<epsg3472> : N)110.5 360 Q
-(AD83\(NSRS2007\) / Alaska zone 5)-.35 E(<epsg3473> : N)110.5 372 Q
-(AD83\(NSRS2007\) / Alaska zone 6)-.35 E(<epsg3474> : N)110.5 384 Q
-(AD83\(NSRS2007\) / Alaska zone 7)-.35 E(<epsg3475> : N)110.5 396 Q
-(AD83\(NSRS2007\) / Alaska zone 8)-.35 E(<epsg3476> : N)110.5 408 Q
-(AD83\(NSRS2007\) / Alaska zone 9)-.35 E(<epsg3477> : N)110.5 420 Q
-(AD83\(NSRS2007\) / Alaska zone 10)-.35 E(<epsg3478> : N)110.5 432 Q
-(AD83\(NSRS2007\) / Arizona Central)-.35 E(<epsg3479> : N)110.5 444 Q
-(AD83\(NSRS2007\) / Arizona Central \(ft\))-.35 E(<epsg3480> : N)110.5
-456 Q(AD83\(NSRS2007\) / Arizona East)-.35 E(<epsg3481> : N)110.5 468 Q
-(AD83\(NSRS2007\) / Arizona East \(ft\))-.35 E(<epsg3482> : N)110.5 480
-Q(AD83\(NSRS2007\) / Arizona W)-.35 E(est)-.8 E(<epsg3483> : N)110.5 492
-Q(AD83\(NSRS2007\) / Arizona W)-.35 E(est \(ft\))-.8 E(<epsg3484> : N)
-110.5 504 Q(AD83\(NSRS2007\) / Arkansas North)-.35 E(<epsg3485> : N)
-110.5 516 Q(AD83\(NSRS2007\) / Arkansas North \(ftUS\))-.35 E
-(<epsg3486> : N)110.5 528 Q(AD83\(NSRS2007\) / Arkansas South)-.35 E
-(<epsg3487> : N)110.5 540 Q(AD83\(NSRS2007\) / Arkansas South \(ftUS\))
--.35 E(<epsg3488> : N)110.5 552 Q(AD83\(NSRS2007\) / California Albers)
--.35 E(<epsg3489> : N)110.5 564 Q(AD83\(NSRS2007\) / California zone 1)
--.35 E(<epsg3490> : N)110.5 576 Q
-(AD83\(NSRS2007\) / California zone 1 \(ftUS\))-.35 E(<epsg3491> : N)
-110.5 588 Q(AD83\(NSRS2007\) / California zone 2)-.35 E(<epsg3492> : N)
-110.5 600 Q(AD83\(NSRS2007\) / California zone 2 \(ftUS\))-.35 E
-(<epsg3493> : N)110.5 612 Q(AD83\(NSRS2007\) / California zone 3)-.35 E
-(<epsg3494> : N)110.5 624 Q
-(AD83\(NSRS2007\) / California zone 3 \(ftUS\))-.35 E(<epsg3495> : N)
-110.5 636 Q(AD83\(NSRS2007\) / California zone 4)-.35 E(<epsg3496> : N)
-110.5 648 Q(AD83\(NSRS2007\) / California zone 4 \(ftUS\))-.35 E
-(<epsg3497> : N)110.5 660 Q(AD83\(NSRS2007\) / California zone 5)-.35 E
-(<epsg3498> : N)110.5 672 Q
-(AD83\(NSRS2007\) / California zone 5 \(ftUS\))-.35 E(<epsg3499> : N)
-110.5 684 Q(AD83\(NSRS2007\) / California zone 6)-.35 E(<epsg3500> : N)
-110.5 696 Q(AD83\(NSRS2007\) / California zone 6 \(ftUS\))-.35 E
-(<epsg3501> : N)110.5 708 Q(AD83\(NSRS2007\) / Colorado Central)-.35 E
-(<epsg3502> : N)110.5 720 Q
-(AD83\(NSRS2007\) / Colorado Central \(ftUS\))-.35 E(MB-System 5.0)72
-768 Q(13 March 2014)140.11 E(58)193.45 E 0 Cg EP
-%%Page: 59 59
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<epsg3503> : N)110.5 84 Q
-(AD83\(NSRS2007\) / Colorado North)-.35 E(<epsg3504> : N)110.5 96 Q
-(AD83\(NSRS2007\) / Colorado North \(ftUS\))-.35 E(<epsg3505> : N)110.5
-108 Q(AD83\(NSRS2007\) / Colorado South)-.35 E(<epsg3506> : N)110.5 120
-Q(AD83\(NSRS2007\) / Colorado South \(ftUS\))-.35 E(<epsg3507> : N)110.5
-132 Q(AD83\(NSRS2007\) / Connecticut)-.35 E(<epsg3508> : N)110.5 144 Q
-(AD83\(NSRS2007\) / Connecticut \(ftUS\))-.35 E(<epsg3509> : N)110.5 156
-Q(AD83\(NSRS2007\) / Dela)-.35 E -.1(wa)-.15 G(re).1 E(<epsg3510> : N)
-110.5 168 Q(AD83\(NSRS2007\) / Dela)-.35 E -.1(wa)-.15 G(re \(ftUS\)).1
-E(<epsg3511> : N)110.5 180 Q(AD83\(NSRS2007\) / Florida East)-.35 E
-(<epsg3512> : N)110.5 192 Q(AD83\(NSRS2007\) / Florida East \(ftUS\))
--.35 E(<epsg3513> : N)110.5 204 Q(AD83\(NSRS2007\) / Florida GDL Albers)
--.35 E(<epsg3514> : N)110.5 216 Q(AD83\(NSRS2007\) / Florida North)-.35
-E(<epsg3515> : N)110.5 228 Q(AD83\(NSRS2007\) / Florida North \(ftUS\))
--.35 E(<epsg3516> : N)110.5 240 Q(AD83\(NSRS2007\) / Florida W)-.35 E
-(est)-.8 E(<epsg3517> : N)110.5 252 Q(AD83\(NSRS2007\) / Florida W)-.35
-E(est \(ftUS\))-.8 E(<epsg3518> : N)110.5 264 Q(AD83\(NSRS2007\) / Geor)
--.35 E(gia East)-.18 E(<epsg3519> : N)110.5 276 Q
-(AD83\(NSRS2007\) / Geor)-.35 E(gia East \(ftUS\))-.18 E(<epsg3520> : N)
-110.5 288 Q(AD83\(NSRS2007\) / Geor)-.35 E(gia W)-.18 E(est)-.8 E
-(<epsg3521> : N)110.5 300 Q(AD83\(NSRS2007\) / Geor)-.35 E(gia W)-.18 E
-(est \(ftUS\))-.8 E(<epsg3522> : N)110.5 312 Q
-(AD83\(NSRS2007\) / Idaho Central)-.35 E(<epsg3523> : N)110.5 324 Q
-(AD83\(NSRS2007\) / Idaho Central \(ftUS\))-.35 E(<epsg3524> : N)110.5
-336 Q(AD83\(NSRS2007\) / Idaho East)-.35 E(<epsg3525> : N)110.5 348 Q
-(AD83\(NSRS2007\) / Idaho East \(ftUS\))-.35 E(<epsg3526> : N)110.5 360
-Q(AD83\(NSRS2007\) / Idaho W)-.35 E(est)-.8 E(<epsg3527> : N)110.5 372 Q
-(AD83\(NSRS2007\) / Idaho W)-.35 E(est \(ftUS\))-.8 E(<epsg3528> : N)
-110.5 384 Q(AD83\(NSRS2007\) / Illinois East)-.35 E(<epsg3529> : N)110.5
-396 Q(AD83\(NSRS2007\) / Illinois East \(ftUS\))-.35 E(<epsg3530> : N)
-110.5 408 Q(AD83\(NSRS2007\) / Illinois W)-.35 E(est)-.8 E
-(<epsg3531> : N)110.5 420 Q(AD83\(NSRS2007\) / Illinois W)-.35 E
-(est \(ftUS\))-.8 E(<epsg3532> : N)110.5 432 Q
-(AD83\(NSRS2007\) / Indiana East)-.35 E(<epsg3533> : N)110.5 444 Q
-(AD83\(NSRS2007\) / Indiana East \(ftUS\))-.35 E(<epsg3534> : N)110.5
-456 Q(AD83\(NSRS2007\) / Indiana W)-.35 E(est)-.8 E(<epsg3535> : N)110.5
-468 Q(AD83\(NSRS2007\) / Indiana W)-.35 E(est \(ftUS\))-.8 E
-(<epsg3536> : N)110.5 480 Q(AD83\(NSRS2007\) / Io)-.35 E .2 -.1(wa N)
--.25 H(orth).1 E(<epsg3537> : N)110.5 492 Q(AD83\(NSRS2007\) / Io)-.35 E
-.2 -.1(wa N)-.25 H(orth \(ft US\)).1 E(<epsg3538> : N)110.5 504 Q
-(AD83\(NSRS2007\) / Io)-.35 E .2 -.1(wa S)-.25 H(outh).1 E
-(<epsg3539> : N)110.5 516 Q(AD83\(NSRS2007\) / Io)-.35 E .2 -.1(wa S)
--.25 H(outh \(ft US\)).1 E(<epsg3540> : N)110.5 528 Q
-(AD83\(NSRS2007\) / Kansas North)-.35 E(<epsg3541> : N)110.5 540 Q
-(AD83\(NSRS2007\) / Kansas North \(ft US\))-.35 E(<epsg3542> : N)110.5
-552 Q(AD83\(NSRS2007\) / Kansas South)-.35 E(<epsg3543> : N)110.5 564 Q
-(AD83\(NSRS2007\) / Kansas South \(ft US\))-.35 E(<epsg3544> : N)110.5
-576 Q(AD83\(NSRS2007\) / K)-.35 E(entuck)-.25 E 2.5(yN)-.15 G(orth)-2.5
-E(<epsg3545> : N)110.5 588 Q(AD83\(NSRS2007\) / K)-.35 E(entuck)-.25 E
-2.5(yN)-.15 G(orth \(ftUS\))-2.5 E(<epsg3546> : N)110.5 600 Q
-(AD83\(NSRS2007\) / K)-.35 E(entuck)-.25 E 2.5(yS)-.15 G(ingle Zone)-2.5
-E(<epsg3547> : N)110.5 612 Q(AD83\(NSRS2007\) / K)-.35 E(entuck)-.25 E
-2.5(yS)-.15 G(ingle Zone \(ftUS\))-2.5 E(<epsg3548> : N)110.5 624 Q
-(AD83\(NSRS2007\) / K)-.35 E(entuck)-.25 E 2.5(yS)-.15 G(outh)-2.5 E
-(<epsg3549> : N)110.5 636 Q(AD83\(NSRS2007\) / K)-.35 E(entuck)-.25 E
-2.5(yS)-.15 G(outh \(ftUS\))-2.5 E(<epsg3550> : N)110.5 648 Q
-(AD83\(NSRS2007\) / Louisiana North)-.35 E(<epsg3551> : N)110.5 660 Q
-(AD83\(NSRS2007\) / Louisiana North \(ftUS\))-.35 E(<epsg3552> : N)110.5
-672 Q(AD83\(NSRS2007\) / Louisiana South)-.35 E(<epsg3553> : N)110.5 684
-Q(AD83\(NSRS2007\) / Louisiana South \(ftUS\))-.35 E(<epsg3554> : N)
-110.5 696 Q(AD83\(NSRS2007\) / Maine CS2000 Central)-.35 E
-(<epsg3555> : N)110.5 708 Q(AD83\(NSRS2007\) / Maine CS2000 East)-.35 E
-(<epsg3556> : N)110.5 720 Q(AD83\(NSRS2007\) / Maine CS2000 W)-.35 E
-(est)-.8 E(MB-System 5.0)72 768 Q(13 March 2014)140.11 E(59)193.45 E 0
-Cg EP
-%%Page: 60 60
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<epsg3557> : N)110.5 84 Q
-(AD83\(NSRS2007\) / Maine East)-.35 E(<epsg3558> : N)110.5 96 Q
-(AD83\(NSRS2007\) / Maine W)-.35 E(est)-.8 E(<epsg3559> : N)110.5 108 Q
-(AD83\(NSRS2007\) / Maryland)-.35 E(<epsg3560> : N)110.5 120 Q
-(AD83 / Utah North \(ftUS\))-.35 E(<epsg3561> : Old Ha)110.5 132 Q -.1
-(wa)-.15 G(iian / Ha).1 E -.1(wa)-.15 G(ii zone 1).1 E
-(<epsg3562> : Old Ha)110.5 144 Q -.1(wa)-.15 G(iian / Ha).1 E -.1(wa)
--.15 G(ii zone 2).1 E(<epsg3563> : Old Ha)110.5 156 Q -.1(wa)-.15 G
-(iian / Ha).1 E -.1(wa)-.15 G(ii zone 3).1 E(<epsg3564> : Old Ha)110.5
-168 Q -.1(wa)-.15 G(iian / Ha).1 E -.1(wa)-.15 G(ii zone 4).1 E
-(<epsg3565> : Old Ha)110.5 180 Q -.1(wa)-.15 G(iian / Ha).1 E -.1(wa)
--.15 G(ii zone 5).1 E(<epsg3566> : N)110.5 192 Q
-(AD83 / Utah Central \(ftUS\))-.35 E(<epsg3567> : N)110.5 204 Q
-(AD83 / Utah South \(ftUS\))-.35 E(<epsg3568> : N)110.5 216 Q
-(AD83\(HARN\) / Utah North \(ftUS\))-.35 E(<epsg3569> : N)110.5 228 Q
-(AD83\(HARN\) / Utah Central \(ftUS\))-.35 E(<epsg3570> : N)110.5 240 Q
-(AD83\(HARN\) / Utah South \(ftUS\))-.35 E
-(<epsg3571> : WGS 84 / North Pole LAEA Bering Sea)110.5 252 Q
-(<epsg3572> : WGS 84 / North Pole LAEA Alaska)110.5 264 Q
-(<epsg3573> : WGS 84 / North Pole LAEA Canada)110.5 276 Q
-(<epsg3574> : WGS 84 / North Pole LAEA Atlantic)110.5 288 Q
-(<epsg3575> : WGS 84 / North Pole LAEA Europe)110.5 300 Q
-(<epsg3576> : WGS 84 / North Pole LAEA Russia)110.5 312 Q
-(<epsg3577> : GD)110.5 324 Q(A94 / Australian Albers)-.4 E
-(<epsg3578> : N)110.5 336 Q(AD83 / Y)-.35 E(uk)-1.11 E(on Albers)-.1 E
-(<epsg3579> : N)110.5 348 Q(AD83\(CSRS\) / Y)-.35 E(uk)-1.11 E
-(on Albers)-.1 E(<epsg3580> : N)110.5 360 Q(AD83 / NWT Lambert)-.35 E
-(<epsg3581> : N)110.5 372 Q(AD83\(CSRS\) / NWT Lambert)-.35 E
-(<epsg3582> : N)110.5 384 Q(AD83\(NSRS2007\) / Maryland \(ftUS\))-.35 E
-(<epsg3583> : N)110.5 396 Q(AD83\(NSRS2007\) / Massachusetts Island)-.35
-E(<epsg3584> : N)110.5 408 Q
-(AD83\(NSRS2007\) / Massachusetts Island \(ftUS\))-.35 E(<epsg3585> : N)
-110.5 420 Q(AD83\(NSRS2007\) / Massachusetts Mainland)-.35 E
-(<epsg3586> : N)110.5 432 Q
-(AD83\(NSRS2007\) / Massachusetts Mainland \(ftUS\))-.35 E
-(<epsg3587> : N)110.5 444 Q(AD83\(NSRS2007\) / Michig)-.35 E(an Central)
--.05 E(<epsg3588> : N)110.5 456 Q(AD83\(NSRS2007\) / Michig)-.35 E
-(an Central \(ft\))-.05 E(<epsg3589> : N)110.5 468 Q
-(AD83\(NSRS2007\) / Michig)-.35 E(an North)-.05 E(<epsg3590> : N)110.5
-480 Q(AD83\(NSRS2007\) / Michig)-.35 E(an North \(ft\))-.05 E
-(<epsg3591> : N)110.5 492 Q(AD83\(NSRS2007\) / Michig)-.35 E
-(an Oblique Mercator)-.05 E(<epsg3592> : N)110.5 504 Q
-(AD83\(NSRS2007\) / Michig)-.35 E(an South)-.05 E(<epsg3593> : N)110.5
-516 Q(AD83\(NSRS2007\) / Michig)-.35 E(an South \(ft\))-.05 E
-(<epsg3594> : N)110.5 528 Q(AD83\(NSRS2007\) / Minnesota Central)-.35 E
-(<epsg3595> : N)110.5 540 Q(AD83\(NSRS2007\) / Minnesota North)-.35 E
-(<epsg3596> : N)110.5 552 Q(AD83\(NSRS2007\) / Minnesota South)-.35 E
-(<epsg3597> : N)110.5 564 Q(AD83\(NSRS2007\) / Mississippi East)-.35 E
-(<epsg3598> : N)110.5 576 Q
-(AD83\(NSRS2007\) / Mississippi East \(ftUS\))-.35 E(<epsg3599> : N)
-110.5 588 Q(AD83\(NSRS2007\) / Mississippi W)-.35 E(est)-.8 E
-(<epsg3600> : N)110.5 600 Q(AD83\(NSRS2007\) / Mississippi W)-.35 E
-(est \(ftUS\))-.8 E(<epsg3601> : N)110.5 612 Q
-(AD83\(NSRS2007\) / Missouri Central)-.35 E(<epsg3602> : N)110.5 624 Q
-(AD83\(NSRS2007\) / Missouri East)-.35 E(<epsg3603> : N)110.5 636 Q
-(AD83\(NSRS2007\) / Missouri W)-.35 E(est)-.8 E(<epsg3604> : N)110.5 648
-Q(AD83\(NSRS2007\) / Montana)-.35 E(<epsg3605> : N)110.5 660 Q
-(AD83\(NSRS2007\) / Montana \(ft\))-.35 E(<epsg3606> : N)110.5 672 Q
-(AD83\(NSRS2007\) / Nebraska)-.35 E(<epsg3607> : N)110.5 684 Q
-(AD83\(NSRS2007\) / Ne)-.35 E -.25(va)-.25 G(da Central).25 E
-(<epsg3608> : N)110.5 696 Q(AD83\(NSRS2007\) / Ne)-.35 E -.25(va)-.25 G
-(da Central \(ft US\)).25 E(<epsg3609> : N)110.5 708 Q
-(AD83\(NSRS2007\) / Ne)-.35 E -.25(va)-.25 G(da East).25 E
-(<epsg3610> : N)110.5 720 Q(AD83\(NSRS2007\) / Ne)-.35 E -.25(va)-.25 G
-(da East \(ft US\)).25 E(MB-System 5.0)72 768 Q(13 March 2014)140.11 E
-(60)193.45 E 0 Cg EP
-%%Page: 61 61
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<epsg3611> : N)110.5 84 Q
-(AD83\(NSRS2007\) / Ne)-.35 E -.25(va)-.25 G(da W).25 E(est)-.8 E
-(<epsg3612> : N)110.5 96 Q(AD83\(NSRS2007\) / Ne)-.35 E -.25(va)-.25 G
-(da W).25 E(est \(ft US\))-.8 E(<epsg3613> : N)110.5 108 Q
-(AD83\(NSRS2007\) / Ne)-.35 E 2.5(wH)-.25 G(ampshire)-2.5 E
-(<epsg3614> : N)110.5 120 Q(AD83\(NSRS2007\) / Ne)-.35 E 2.5(wH)-.25 G
-(ampshire \(ftUS\))-2.5 E(<epsg3615> : N)110.5 132 Q
-(AD83\(NSRS2007\) / Ne)-.35 E 2.5(wJ)-.25 G(erse)-2.5 E(y)-.15 E
-(<epsg3616> : N)110.5 144 Q(AD83\(NSRS2007\) / Ne)-.35 E 2.5(wJ)-.25 G
-(erse)-2.5 E 2.5(y\()-.15 G(ft US\))-2.5 E(<epsg3617> : N)110.5 156 Q
-(AD83\(NSRS2007\) / Ne)-.35 E 2.5(wM)-.25 G -.15(ex)-2.5 G(ico Central)
-.15 E(<epsg3618> : N)110.5 168 Q(AD83\(NSRS2007\) / Ne)-.35 E 2.5(wM)
--.25 G -.15(ex)-2.5 G(ico Central \(ftUS\)).15 E(<epsg3619> : N)110.5
-180 Q(AD83\(NSRS2007\) / Ne)-.35 E 2.5(wM)-.25 G -.15(ex)-2.5 G
-(ico East).15 E(<epsg3620> : N)110.5 192 Q(AD83\(NSRS2007\) / Ne)-.35 E
-2.5(wM)-.25 G -.15(ex)-2.5 G(ico East \(ftUS\)).15 E(<epsg3621> : N)
-110.5 204 Q(AD83\(NSRS2007\) / Ne)-.35 E 2.5(wM)-.25 G -.15(ex)-2.5 G
-(ico W).15 E(est)-.8 E(<epsg3622> : N)110.5 216 Q(AD83\(NSRS2007\) / Ne)
--.35 E 2.5(wM)-.25 G -.15(ex)-2.5 G(ico W).15 E(est \(ftUS\))-.8 E
-(<epsg3623> : N)110.5 228 Q(AD83\(NSRS2007\) / Ne)-.35 E 2.5(wY)-.25 G
-(ork Central)-3.6 E(<epsg3624> : N)110.5 240 Q(AD83\(NSRS2007\) / Ne)
--.35 E 2.5(wY)-.25 G(ork Central \(ftUS\))-3.6 E(<epsg3625> : N)110.5
-252 Q(AD83\(NSRS2007\) / Ne)-.35 E 2.5(wY)-.25 G(ork East)-3.6 E
-(<epsg3626> : N)110.5 264 Q(AD83\(NSRS2007\) / Ne)-.35 E 2.5(wY)-.25 G
-(ork East \(ftUS\))-3.6 E(<epsg3627> : N)110.5 276 Q
-(AD83\(NSRS2007\) / Ne)-.35 E 2.5(wY)-.25 G(ork Long Island)-3.6 E
-(<epsg3628> : N)110.5 288 Q(AD83\(NSRS2007\) / Ne)-.35 E 2.5(wY)-.25 G
-(ork Long Island \(ftUS\))-3.6 E(<epsg3629> : N)110.5 300 Q
-(AD83\(NSRS2007\) / Ne)-.35 E 2.5(wY)-.25 G(ork W)-3.6 E(est)-.8 E
-(<epsg3630> : N)110.5 312 Q(AD83\(NSRS2007\) / Ne)-.35 E 2.5(wY)-.25 G
-(ork W)-3.6 E(est \(ftUS\))-.8 E(<epsg3631> : N)110.5 324 Q
-(AD83\(NSRS2007\) / North Carolina)-.35 E(<epsg3632> : N)110.5 336 Q
-(AD83\(NSRS2007\) / North Carolina \(ftUS\))-.35 E(<epsg3633> : N)110.5
-348 Q(AD83\(NSRS2007\) / North Dak)-.35 E(ota North)-.1 E
-(<epsg3634> : N)110.5 360 Q(AD83\(NSRS2007\) / North Dak)-.35 E
-(ota North \(ft\))-.1 E(<epsg3635> : N)110.5 372 Q
-(AD83\(NSRS2007\) / North Dak)-.35 E(ota South)-.1 E(<epsg3636> : N)
-110.5 384 Q(AD83\(NSRS2007\) / North Dak)-.35 E(ota South \(ft\))-.1 E
-(<epsg3637> : N)110.5 396 Q(AD83\(NSRS2007\) / Ohio North)-.35 E
-(<epsg3638> : N)110.5 408 Q(AD83\(NSRS2007\) / Ohio South)-.35 E
-(<epsg3639> : N)110.5 420 Q(AD83\(NSRS2007\) / Oklahoma North)-.35 E
-(<epsg3640> : N)110.5 432 Q(AD83\(NSRS2007\) / Oklahoma North \(ftUS\))
--.35 E(<epsg3641> : N)110.5 444 Q(AD83\(NSRS2007\) / Oklahoma South)-.35
-E(<epsg3642> : N)110.5 456 Q(AD83\(NSRS2007\) / Oklahoma South \(ftUS\))
--.35 E(<epsg3643> : N)110.5 468 Q(AD83\(NSRS2007\) / Ore)-.35 E
-(gon Lambert)-.15 E(<epsg3644> : N)110.5 480 Q(AD83\(NSRS2007\) / Ore)
--.35 E(gon Lambert \(ft\))-.15 E(<epsg3645> : N)110.5 492 Q
-(AD83\(NSRS2007\) / Ore)-.35 E(gon North)-.15 E(<epsg3646> : N)110.5 504
-Q(AD83\(NSRS2007\) / Ore)-.35 E(gon North \(ft\))-.15 E(<epsg3647> : N)
-110.5 516 Q(AD83\(NSRS2007\) / Ore)-.35 E(gon South)-.15 E
-(<epsg3648> : N)110.5 528 Q(AD83\(NSRS2007\) / Ore)-.35 E
-(gon South \(ft\))-.15 E(<epsg3649> : N)110.5 540 Q
-(AD83\(NSRS2007\) / Pennsylv)-.35 E(ania North)-.25 E(<epsg3650> : N)
-110.5 552 Q(AD83\(NSRS2007\) / Pennsylv)-.35 E(ania North \(ftUS\))-.25
-E(<epsg3651> : N)110.5 564 Q(AD83\(NSRS2007\) / Pennsylv)-.35 E
-(ania South)-.25 E(<epsg3652> : N)110.5 576 Q
-(AD83\(NSRS2007\) / Pennsylv)-.35 E(ania South \(ftUS\))-.25 E
-(<epsg3653> : N)110.5 588 Q(AD83\(NSRS2007\) / Rhode Island)-.35 E
-(<epsg3654> : N)110.5 600 Q(AD83\(NSRS2007\) / Rhode Island \(ftUS\))
--.35 E(<epsg3655> : N)110.5 612 Q(AD83\(NSRS2007\) / South Carolina)-.35
-E(<epsg3656> : N)110.5 624 Q(AD83\(NSRS2007\) / South Carolina \(ft\))
--.35 E(<epsg3657> : N)110.5 636 Q(AD83\(NSRS2007\) / South Dak)-.35 E
-(ota North)-.1 E(<epsg3658> : N)110.5 648 Q
-(AD83\(NSRS2007\) / South Dak)-.35 E(ota North \(ftUS\))-.1 E
-(<epsg3659> : N)110.5 660 Q(AD83\(NSRS2007\) / South Dak)-.35 E
-(ota South)-.1 E(<epsg3660> : N)110.5 672 Q
-(AD83\(NSRS2007\) / South Dak)-.35 E(ota South \(ftUS\))-.1 E
-(<epsg3661> : N)110.5 684 Q(AD83\(NSRS2007\) / T)-.35 E(ennessee)-.7 E
-(<epsg3662> : N)110.5 696 Q(AD83\(NSRS2007\) / T)-.35 E
-(ennessee \(ftUS\))-.7 E(<epsg3663> : N)110.5 708 Q
-(AD83\(NSRS2007\) / T)-.35 E -.15(ex)-.7 G(as Central).15 E
-(<epsg3664> : N)110.5 720 Q(AD83\(NSRS2007\) / T)-.35 E -.15(ex)-.7 G
-(as Central \(ftUS\)).15 E(MB-System 5.0)72 768 Q(13 March 2014)140.11 E
-(61)193.45 E 0 Cg EP
-%%Page: 62 62
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<epsg3665> : N)110.5 84 Q(AD83\(NSRS2007\) / T)
--.35 E -.15(ex)-.7 G(as Centric Albers Equal Area).15 E(<epsg3666> : N)
-110.5 96 Q(AD83\(NSRS2007\) / T)-.35 E -.15(ex)-.7 G
-(as Centric Lambert Conformal).15 E(<epsg3667> : N)110.5 108 Q
-(AD83\(NSRS2007\) / T)-.35 E -.15(ex)-.7 G(as North).15 E
-(<epsg3668> : N)110.5 120 Q(AD83\(NSRS2007\) / T)-.35 E -.15(ex)-.7 G
-(as North \(ftUS\)).15 E(<epsg3669> : N)110.5 132 Q
-(AD83\(NSRS2007\) / T)-.35 E -.15(ex)-.7 G(as North Central).15 E
-(<epsg3670> : N)110.5 144 Q(AD83\(NSRS2007\) / T)-.35 E -.15(ex)-.7 G
-(as North Central \(ftUS\)).15 E(<epsg3671> : N)110.5 156 Q
-(AD83\(NSRS2007\) / T)-.35 E -.15(ex)-.7 G(as South).15 E
-(<epsg3672> : N)110.5 168 Q(AD83\(NSRS2007\) / T)-.35 E -.15(ex)-.7 G
-(as South \(ftUS\)).15 E(<epsg3673> : N)110.5 180 Q
-(AD83\(NSRS2007\) / T)-.35 E -.15(ex)-.7 G(as South Central).15 E
-(<epsg3674> : N)110.5 192 Q(AD83\(NSRS2007\) / T)-.35 E -.15(ex)-.7 G
-(as South Central \(ftUS\)).15 E(<epsg3675> : N)110.5 204 Q
-(AD83\(NSRS2007\) / Utah Central)-.35 E(<epsg3676> : N)110.5 216 Q
-(AD83\(NSRS2007\) / Utah Central \(ft\))-.35 E(<epsg3677> : N)110.5 228
-Q(AD83\(NSRS2007\) / Utah Central \(ftUS\))-.35 E(<epsg3678> : N)110.5
-240 Q(AD83\(NSRS2007\) / Utah North)-.35 E(<epsg3679> : N)110.5 252 Q
-(AD83\(NSRS2007\) / Utah North \(ft\))-.35 E(<epsg3680> : N)110.5 264 Q
-(AD83\(NSRS2007\) / Utah North \(ftUS\))-.35 E(<epsg3681> : N)110.5 276
-Q(AD83\(NSRS2007\) / Utah South)-.35 E(<epsg3682> : N)110.5 288 Q
-(AD83\(NSRS2007\) / Utah South \(ft\))-.35 E(<epsg3683> : N)110.5 300 Q
-(AD83\(NSRS2007\) / Utah South \(ftUS\))-.35 E(<epsg3684> : N)110.5 312
-Q(AD83\(NSRS2007\) / V)-.35 E(ermont)-1.11 E(<epsg3685> : N)110.5 324 Q
-(AD83\(NSRS2007\) / V)-.35 E(ir)-.6 E(ginia North)-.18 E(<epsg3686> : N)
-110.5 336 Q(AD83\(NSRS2007\) / V)-.35 E(ir)-.6 E(ginia North \(ftUS\))
--.18 E(<epsg3687> : N)110.5 348 Q(AD83\(NSRS2007\) / V)-.35 E(ir)-.6 E
-(ginia South)-.18 E(<epsg3688> : N)110.5 360 Q(AD83\(NSRS2007\) / V)-.35
-E(ir)-.6 E(ginia South \(ftUS\))-.18 E(<epsg3689> : N)110.5 372 Q
-(AD83\(NSRS2007\) / W)-.35 E(ashington North)-.8 E(<epsg3690> : N)110.5
-384 Q(AD83\(NSRS2007\) / W)-.35 E(ashington North \(ftUS\))-.8 E
-(<epsg3691> : N)110.5 396 Q(AD83\(NSRS2007\) / W)-.35 E(ashington South)
--.8 E(<epsg3692> : N)110.5 408 Q(AD83\(NSRS2007\) / W)-.35 E
-(ashington South \(ftUS\))-.8 E(<epsg3693> : N)110.5 420 Q
-(AD83\(NSRS2007\) / W)-.35 E(est V)-.8 E(ir)-.6 E(ginia North)-.18 E
-(<epsg3694> : N)110.5 432 Q(AD83\(NSRS2007\) / W)-.35 E(est V)-.8 E(ir)
--.6 E(ginia South)-.18 E(<epsg3695> : N)110.5 444 Q
-(AD83\(NSRS2007\) / W)-.35 E(isconsin Central)-.4 E(<epsg3696> : N)110.5
-456 Q(AD83\(NSRS2007\) / W)-.35 E(isconsin Central \(ftUS\))-.4 E
-(<epsg3697> : N)110.5 468 Q(AD83\(NSRS2007\) / W)-.35 E(isconsin North)
--.4 E(<epsg3698> : N)110.5 480 Q(AD83\(NSRS2007\) / W)-.35 E
-(isconsin North \(ftUS\))-.4 E(<epsg3699> : N)110.5 492 Q
-(AD83\(NSRS2007\) / W)-.35 E(isconsin South)-.4 E(<epsg3700> : N)110.5
-504 Q(AD83\(NSRS2007\) / W)-.35 E(isconsin South \(ftUS\))-.4 E
-(<epsg3701> : N)110.5 516 Q(AD83\(NSRS2007\) / W)-.35 E(isconsin T)-.4 E
-(ransv)-.35 E(erse Mercator)-.15 E(<epsg3702> : N)110.5 528 Q
-(AD83\(NSRS2007\) / W)-.35 E(yoming East)-.73 E(<epsg3703> : N)110.5 540
-Q(AD83\(NSRS2007\) / W)-.35 E(yoming East Central)-.73 E(<epsg3704> : N)
-110.5 552 Q(AD83\(NSRS2007\) / W)-.35 E(yoming W)-.73 E(est Central)-.8
-E(<epsg3705> : N)110.5 564 Q(AD83\(NSRS2007\) / W)-.35 E(yoming W)-.73 E
-(est)-.8 E(<epsg3706> : N)110.5 576 Q(AD83\(NSRS2007\) / UTM zone 59N)
--.35 E(<epsg3707> : N)110.5 588 Q(AD83\(NSRS2007\) / UTM zone 60N)-.35 E
-(<epsg3708> : N)110.5 600 Q(AD83\(NSRS2007\) / UTM zone 1N)-.35 E
-(<epsg3709> : N)110.5 612 Q(AD83\(NSRS2007\) / UTM zone 2N)-.35 E
-(<epsg3710> : N)110.5 624 Q(AD83\(NSRS2007\) / UTM zone 3N)-.35 E
-(<epsg3711> : N)110.5 636 Q(AD83\(NSRS2007\) / UTM zone 4N)-.35 E
-(<epsg3712> : N)110.5 648 Q(AD83\(NSRS2007\) / UTM zone 5N)-.35 E
-(<epsg3713> : N)110.5 660 Q(AD83\(NSRS2007\) / UTM zone 6N)-.35 E
-(<epsg3714> : N)110.5 672 Q(AD83\(NSRS2007\) / UTM zone 7N)-.35 E
-(<epsg3715> : N)110.5 684 Q(AD83\(NSRS2007\) / UTM zone 8N)-.35 E
-(<epsg3716> : N)110.5 696 Q(AD83\(NSRS2007\) / UTM zone 9N)-.35 E
-(<epsg3717> : N)110.5 708 Q(AD83\(NSRS2007\) / UTM zone 10N)-.35 E
-(<epsg3718> : N)110.5 720 Q(AD83\(NSRS2007\) / UTM zone 11N)-.35 E
-(MB-System 5.0)72 768 Q(13 March 2014)140.11 E(62)193.45 E 0 Cg EP
-%%Page: 63 63
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<epsg3719> : N)110.5 84 Q
-(AD83\(NSRS2007\) / UTM zone 12N)-.35 E(<epsg3720> : N)110.5 96 Q
-(AD83\(NSRS2007\) / UTM zone 13N)-.35 E(<epsg3721> : N)110.5 108 Q
-(AD83\(NSRS2007\) / UTM zone 14N)-.35 E(<epsg3722> : N)110.5 120 Q
-(AD83\(NSRS2007\) / UTM zone 15N)-.35 E(<epsg3723> : N)110.5 132 Q
-(AD83\(NSRS2007\) / UTM zone 16N)-.35 E(<epsg3724> : N)110.5 144 Q
-(AD83\(NSRS2007\) / UTM zone 17N)-.35 E(<epsg3725> : N)110.5 156 Q
-(AD83\(NSRS2007\) / UTM zone 18N)-.35 E(<epsg3726> : N)110.5 168 Q
-(AD83\(NSRS2007\) / UTM zone 19N)-.35 E
-(<epsg3727> : Reunion 1947 / TM Reunion)110.5 180 Q(<epsg3728> : N)110.5
-192 Q(AD83\(NSRS2007\) / Ohio North \(ftUS\))-.35 E(<epsg3729> : N)110.5
-204 Q(AD83\(NSRS2007\) / Ohio South \(ftUS\))-.35 E(<epsg3730> : N)110.5
-216 Q(AD83\(NSRS2007\) / W)-.35 E(yoming East \(ftUS\))-.73 E
-(<epsg3731> : N)110.5 228 Q(AD83\(NSRS2007\) / W)-.35 E
-(yoming East Central \(ftUS\))-.73 E(<epsg3732> : N)110.5 240 Q
-(AD83\(NSRS2007\) / W)-.35 E(yoming W)-.73 E(est Central \(ftUS\))-.8 E
-(<epsg3733> : N)110.5 252 Q(AD83\(NSRS2007\) / W)-.35 E(yoming W)-.73 E
-(est \(ftUS\))-.8 E(<epsg3734> : N)110.5 264 Q
-(AD83 / Ohio North \(ftUS\))-.35 E(<epsg3735> : N)110.5 276 Q
-(AD83 / Ohio South \(ftUS\))-.35 E(<epsg3736> : N)110.5 288 Q(AD83 / W)
--.35 E(yoming East \(ftUS\))-.73 E(<epsg3737> : N)110.5 300 Q(AD83 / W)
--.35 E(yoming East Central \(ftUS\))-.73 E(<epsg3738> : N)110.5 312 Q
-(AD83 / W)-.35 E(yoming W)-.73 E(est Central \(ftUS\))-.8 E
-(<epsg3739> : N)110.5 324 Q(AD83 / W)-.35 E(yoming W)-.73 E
-(est \(ftUS\))-.8 E(<epsg3740> : N)110.5 336 Q
-(AD83\(HARN\) / UTM zone 10N)-.35 E(<epsg3741> : N)110.5 348 Q
-(AD83\(HARN\) / UTM zone 11N)-.35 E(<epsg3742> : N)110.5 360 Q
-(AD83\(HARN\) / UTM zone 12N)-.35 E(<epsg3743> : N)110.5 372 Q
-(AD83\(HARN\) / UTM zone 13N)-.35 E(<epsg3744> : N)110.5 384 Q
-(AD83\(HARN\) / UTM zone 14N)-.35 E(<epsg3745> : N)110.5 396 Q
-(AD83\(HARN\) / UTM zone 15N)-.35 E(<epsg3746> : N)110.5 408 Q
-(AD83\(HARN\) / UTM zone 16N)-.35 E(<epsg3747> : N)110.5 420 Q
-(AD83\(HARN\) / UTM zone 17N)-.35 E(<epsg3748> : N)110.5 432 Q
-(AD83\(HARN\) / UTM zone 18N)-.35 E(<epsg3749> : N)110.5 444 Q
-(AD83\(HARN\) / UTM zone 19N)-.35 E(<epsg3750> : N)110.5 456 Q
-(AD83\(HARN\) / UTM zone 4N)-.35 E(<epsg3751> : N)110.5 468 Q
-(AD83\(HARN\) / UTM zone 5N)-.35 E(<epsg3752> : WGS 84 / Mercator 41)
-110.5 480 Q(<epsg3753> : N)110.5 492 Q
-(AD83\(HARN\) / Ohio North \(ftUS\))-.35 E(<epsg3754> : N)110.5 504 Q
-(AD83\(HARN\) / Ohio South \(ftUS\))-.35 E(<epsg3755> : N)110.5 516 Q
-(AD83\(HARN\) / W)-.35 E(yoming East \(ftUS\))-.73 E(<epsg3756> : N)
-110.5 528 Q(AD83\(HARN\) / W)-.35 E(yoming East Central \(ftUS\))-.73 E
-(<epsg3757> : N)110.5 540 Q(AD83\(HARN\) / W)-.35 E(yoming W)-.73 E
-(est Central \(ftUS\))-.8 E(<epsg3758> : N)110.5 552 Q(AD83\(HARN\) / W)
--.35 E(yoming W)-.73 E(est \(ftUS\))-.8 E(<epsg3759> : N)110.5 564 Q
-(AD83 / Ha)-.35 E -.1(wa)-.15 G(ii zone 3 \(ftUS\)).1 E(<epsg3760> : N)
-110.5 576 Q(AD83\(HARN\) / Ha)-.35 E -.1(wa)-.15 G(ii zone 3 \(ftUS\)).1
-E(<epsg3761> : N)110.5 588 Q(AD83\(CSRS\) / UTM zone 22N)-.35 E
-(<epsg3762> : WGS 84 / South Geor)110.5 600 Q(gia Lambert)-.18 E
-(<epsg3920> : Puerto Rico / UTM zone 20N)110.5 612 Q
-(<epsg3991> : Puerto Rico State Plane CS of 1927)110.5 624 Q
-(<epsg3992> : Puerto Rico / St. Croix)110.5 636 Q(<epsg20004> : Pulk)
-110.5 648 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger zone 4)-2.5 E
-(<epsg20005> : Pulk)110.5 660 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger zone 5)-2.5 E(<epsg20006> : Pulk)110.5 672 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger zone 6)-2.5 E
-(<epsg20007> : Pulk)110.5 684 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger zone 7)-2.5 E(<epsg20008> : Pulk)110.5 696 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger zone 8)-2.5 E
-(<epsg20009> : Pulk)110.5 708 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger zone 9)-2.5 E(<epsg20010> : Pulk)110.5 720 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger zone 10)-2.5 E(MB-System 5.0)
-72 768 Q(13 March 2014)140.11 E(63)193.45 E 0 Cg EP
-%%Page: 64 64
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<epsg20011> : Pulk)110.5 84 Q -.15(ov)-.1 G 2.5
-(o1)-.05 G(995 / Gauss-Kruger zone 11)-2.5 E(<epsg20012> : Pulk)110.5 96
-Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger zone 12)-2.5 E
-(<epsg20013> : Pulk)110.5 108 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger zone 13)-2.5 E(<epsg20014> : Pulk)110.5 120 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger zone 14)-2.5 E
-(<epsg20015> : Pulk)110.5 132 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger zone 15)-2.5 E(<epsg20016> : Pulk)110.5 144 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger zone 16)-2.5 E
-(<epsg20017> : Pulk)110.5 156 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger zone 17)-2.5 E(<epsg20018> : Pulk)110.5 168 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger zone 18)-2.5 E
-(<epsg20019> : Pulk)110.5 180 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger zone 19)-2.5 E(<epsg20020> : Pulk)110.5 192 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger zone 20)-2.5 E
-(<epsg20021> : Pulk)110.5 204 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger zone 21)-2.5 E(<epsg20022> : Pulk)110.5 216 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger zone 22)-2.5 E
-(<epsg20023> : Pulk)110.5 228 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger zone 23)-2.5 E(<epsg20024> : Pulk)110.5 240 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger zone 24)-2.5 E
-(<epsg20025> : Pulk)110.5 252 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger zone 25)-2.5 E(<epsg20026> : Pulk)110.5 264 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger zone 26)-2.5 E
-(<epsg20027> : Pulk)110.5 276 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger zone 27)-2.5 E(<epsg20028> : Pulk)110.5 288 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger zone 28)-2.5 E
-(<epsg20029> : Pulk)110.5 300 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger zone 29)-2.5 E(<epsg20030> : Pulk)110.5 312 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger zone 30)-2.5 E
-(<epsg20031> : Pulk)110.5 324 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger zone 31)-2.5 E(<epsg20032> : Pulk)110.5 336 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger zone 32)-2.5 E
-(<epsg20064> : Pulk)110.5 348 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger 4N \(deprecated\))-2.5 E(<epsg20065> : Pulk)110.5
-360 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger 5N \(deprecated\))
--2.5 E(<epsg20066> : Pulk)110.5 372 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger 6N \(deprecated\))-2.5 E(<epsg20067> : Pulk)110.5
-384 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger 7N \(deprecated\))
--2.5 E(<epsg20068> : Pulk)110.5 396 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger 8N \(deprecated\))-2.5 E(<epsg20069> : Pulk)110.5
-408 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger 9N \(deprecated\))
--2.5 E(<epsg20070> : Pulk)110.5 420 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger 10N \(deprecated\))-2.5 E(<epsg20071> : Pulk)110.5
-432 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger 11N \(deprecated\))
--2.5 E(<epsg20072> : Pulk)110.5 444 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger 12N \(deprecated\))-2.5 E(<epsg20073> : Pulk)110.5
-456 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger 13N \(deprecated\))
--2.5 E(<epsg20074> : Pulk)110.5 468 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger 14N \(deprecated\))-2.5 E(<epsg20075> : Pulk)110.5
-480 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger 15N \(deprecated\))
--2.5 E(<epsg20076> : Pulk)110.5 492 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger 16N \(deprecated\))-2.5 E(<epsg20077> : Pulk)110.5
-504 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger 17N \(deprecated\))
--2.5 E(<epsg20078> : Pulk)110.5 516 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger 18N \(deprecated\))-2.5 E(<epsg20079> : Pulk)110.5
-528 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger 19N \(deprecated\))
--2.5 E(<epsg20080> : Pulk)110.5 540 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger 20N \(deprecated\))-2.5 E(<epsg20081> : Pulk)110.5
-552 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger 21N \(deprecated\))
--2.5 E(<epsg20082> : Pulk)110.5 564 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger 22N \(deprecated\))-2.5 E(<epsg20083> : Pulk)110.5
-576 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger 23N \(deprecated\))
--2.5 E(<epsg20084> : Pulk)110.5 588 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger 24N \(deprecated\))-2.5 E(<epsg20085> : Pulk)110.5
-600 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger 25N \(deprecated\))
--2.5 E(<epsg20086> : Pulk)110.5 612 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger 26N \(deprecated\))-2.5 E(<epsg20087> : Pulk)110.5
-624 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger 27N \(deprecated\))
--2.5 E(<epsg20088> : Pulk)110.5 636 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger 28N \(deprecated\))-2.5 E(<epsg20089> : Pulk)110.5
-648 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger 29N \(deprecated\))
--2.5 E(<epsg20090> : Pulk)110.5 660 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger 30N \(deprecated\))-2.5 E(<epsg20091> : Pulk)110.5
-672 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger 31N \(deprecated\))
--2.5 E(<epsg20092> : Pulk)110.5 684 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger 32N \(deprecated\))-2.5 E
-(<epsg20135> : Adindan / UTM zone 35N)110.5 696 Q
-(<epsg20136> : Adindan / UTM zone 36N)110.5 708 Q
-(<epsg20137> : Adindan / UTM zone 37N)110.5 720 Q(MB-System 5.0)72 768 Q
-(13 March 2014)140.11 E(64)193.45 E 0 Cg EP
-%%Page: 65 65
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<epsg20138> : Adindan / UTM zone 38N)110.5 84 Q
-(<epsg20248> : A)110.5 96 Q(GD66 / AMG zone 48)-.4 E(<epsg20249> : A)
-110.5 108 Q(GD66 / AMG zone 49)-.4 E(<epsg20250> : A)110.5 120 Q
-(GD66 / AMG zone 50)-.4 E(<epsg20251> : A)110.5 132 Q
-(GD66 / AMG zone 51)-.4 E(<epsg20252> : A)110.5 144 Q
-(GD66 / AMG zone 52)-.4 E(<epsg20253> : A)110.5 156 Q
-(GD66 / AMG zone 53)-.4 E(<epsg20254> : A)110.5 168 Q
-(GD66 / AMG zone 54)-.4 E(<epsg20255> : A)110.5 180 Q
-(GD66 / AMG zone 55)-.4 E(<epsg20256> : A)110.5 192 Q
-(GD66 / AMG zone 56)-.4 E(<epsg20257> : A)110.5 204 Q
-(GD66 / AMG zone 57)-.4 E(<epsg20258> : A)110.5 216 Q
-(GD66 / AMG zone 58)-.4 E(<epsg20348> : A)110.5 228 Q
-(GD84 / AMG zone 48)-.4 E(<epsg20349> : A)110.5 240 Q
-(GD84 / AMG zone 49)-.4 E(<epsg20350> : A)110.5 252 Q
-(GD84 / AMG zone 50)-.4 E(<epsg20351> : A)110.5 264 Q
-(GD84 / AMG zone 51)-.4 E(<epsg20352> : A)110.5 276 Q
-(GD84 / AMG zone 52)-.4 E(<epsg20353> : A)110.5 288 Q
-(GD84 / AMG zone 53)-.4 E(<epsg20354> : A)110.5 300 Q
-(GD84 / AMG zone 54)-.4 E(<epsg20355> : A)110.5 312 Q
-(GD84 / AMG zone 55)-.4 E(<epsg20356> : A)110.5 324 Q
-(GD84 / AMG zone 56)-.4 E(<epsg20357> : A)110.5 336 Q
-(GD84 / AMG zone 57)-.4 E(<epsg20358> : A)110.5 348 Q
-(GD84 / AMG zone 58)-.4 E(<epsg20436> : Ain el Abd / UTM zone 36N)110.5
-360 Q(<epsg20437> : Ain el Abd / UTM zone 37N)110.5 372 Q
-(<epsg20438> : Ain el Abd / UTM zone 38N)110.5 384 Q
-(<epsg20439> : Ain el Abd / UTM zone 39N)110.5 396 Q
-(<epsg20440> : Ain el Abd / UTM zone 40N)110.5 408 Q
-(<epsg20499> : Ain el Abd / Bahrain Grid)110.5 420 Q
-(<epsg20538> : Afgoo)110.5 432 Q(ye / UTM zone 38N)-.1 E
-(<epsg20539> : Afgoo)110.5 444 Q(ye / UTM zone 39N)-.1 E
-(<epsg20790> : Lisbon \(Lisbon\)/Portuguese National Grid)110.5 456 Q
-(<epsg20791> : Lisbon \(Lisbon\)/Portuguese Grid)110.5 468 Q
-(<epsg20822> : Aratu / UTM zone 22S)110.5 480 Q
-(<epsg20823> : Aratu / UTM zone 23S)110.5 492 Q
-(<epsg20824> : Aratu / UTM zone 24S)110.5 504 Q
-(<epsg20934> : Arc 1950 / UTM zone 34S)110.5 516 Q
-(<epsg20935> : Arc 1950 / UTM zone 35S)110.5 528 Q
-(<epsg20936> : Arc 1950 / UTM zone 36S)110.5 540 Q
-(<epsg21035> : Arc 1960 / UTM zone 35S)110.5 552 Q
-(<epsg21036> : Arc 1960 / UTM zone 36S)110.5 564 Q
-(<epsg21037> : Arc 1960 / UTM zone 37S)110.5 576 Q
-(<epsg21095> : Arc 1960 / UTM zone 35N)110.5 588 Q
-(<epsg21096> : Arc 1960 / UTM zone 36N)110.5 600 Q
-(<epsg21097> : Arc 1960 / UTM zone 37N)110.5 612 Q(<epsg21100> : Bata)
-110.5 624 Q(via \(Jakarta\) / NEIEZ \(deprecated\))-.2 E
-(<epsg21148> : Bata)110.5 636 Q(via / UTM zone 48S)-.2 E
-(<epsg21149> : Bata)110.5 648 Q(via / UTM zone 49S)-.2 E
-(<epsg21150> : Bata)110.5 660 Q(via / UTM zone 50S)-.2 E
-(<epsg21291> : Barbados 1938 / British W)110.5 672 Q(est Indies Grid)-.8
-E(<epsg21292> : Barbados 1938 / Barbados National Grid)110.5 684 Q
-(<epsg21413> : Beijing 1954 / Gauss-Kruger zone 13)110.5 696 Q
-(<epsg21414> : Beijing 1954 / Gauss-Kruger zone 14)110.5 708 Q
-(<epsg21415> : Beijing 1954 / Gauss-Kruger zone 15)110.5 720 Q
-(MB-System 5.0)72 768 Q(13 March 2014)140.11 E(65)193.45 E 0 Cg EP
-%%Page: 66 66
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F
-(<epsg21416> : Beijing 1954 / Gauss-Kruger zone 16)110.5 84 Q
-(<epsg21417> : Beijing 1954 / Gauss-Kruger zone 17)110.5 96 Q
-(<epsg21418> : Beijing 1954 / Gauss-Kruger zone 18)110.5 108 Q
-(<epsg21419> : Beijing 1954 / Gauss-Kruger zone 19)110.5 120 Q
-(<epsg21420> : Beijing 1954 / Gauss-Kruger zone 20)110.5 132 Q
-(<epsg21421> : Beijing 1954 / Gauss-Kruger zone 21)110.5 144 Q
-(<epsg21422> : Beijing 1954 / Gauss-Kruger zone 22)110.5 156 Q
-(<epsg21423> : Beijing 1954 / Gauss-Kruger zone 23)110.5 168 Q
-(<epsg21453> : Beijing 1954 / Gauss-Kruger CM 75E)110.5 180 Q
-(<epsg21454> : Beijing 1954 / Gauss-Kruger CM 81E)110.5 192 Q
-(<epsg21455> : Beijing 1954 / Gauss-Kruger CM 87E)110.5 204 Q
-(<epsg21456> : Beijing 1954 / Gauss-Kruger CM 93E)110.5 216 Q
-(<epsg21457> : Beijing 1954 / Gauss-Kruger CM 99E)110.5 228 Q
-(<epsg21458> : Beijing 1954 / Gauss-Kruger CM 105E)110.5 240 Q
-(<epsg21459> : Beijing 1954 / Gauss-Kruger CM 111E)110.5 252 Q
-(<epsg21460> : Beijing 1954 / Gauss-Kruger CM 117E)110.5 264 Q
-(<epsg21461> : Beijing 1954 / Gauss-Kruger CM 123E)110.5 276 Q
-(<epsg21462> : Beijing 1954 / Gauss-Kruger CM 129E)110.5 288 Q
-(<epsg21463> : Beijing 1954 / Gauss-Kruger CM 135E)110.5 300 Q
-(<epsg21473> : Beijing 1954 / Gauss-Kruger 13N \(deprecated\))110.5 312
-Q(<epsg21474> : Beijing 1954 / Gauss-Kruger 14N \(deprecated\))110.5 324
-Q(<epsg21475> : Beijing 1954 / Gauss-Kruger 15N \(deprecated\))110.5 336
-Q(<epsg21476> : Beijing 1954 / Gauss-Kruger 16N \(deprecated\))110.5 348
-Q(<epsg21477> : Beijing 1954 / Gauss-Kruger 17N \(deprecated\))110.5 360
-Q(<epsg21478> : Beijing 1954 / Gauss-Kruger 18N \(deprecated\))110.5 372
-Q(<epsg21479> : Beijing 1954 / Gauss-Kruger 19N \(deprecated\))110.5 384
-Q(<epsg21480> : Beijing 1954 / Gauss-Kruger 20N \(deprecated\))110.5 396
-Q(<epsg21481> : Beijing 1954 / Gauss-Kruger 21N \(deprecated\))110.5 408
-Q(<epsg21482> : Beijing 1954 / Gauss-Kruger 22N \(deprecated\))110.5 420
-Q(<epsg21483> : Beijing 1954 / Gauss-Kruger 23N \(deprecated\))110.5 432
-Q(<epsg21500> : Belge 1950 \(Brussels\) / Belge Lambert 50)110.5 444 Q
-(<epsg21780> : Bern 1898 \(Bern\) / L)110.5 456 Q(V03C)-1 E
-(<epsg21781> : CH1903 / L)110.5 468 Q(V03)-1 E
-(<epsg21817> : Bogota 1975 / UTM zone 17N \(deprecated\))110.5 480 Q
-(<epsg21818> : Bogota 1975 / UTM zone 18N)110.5 492 Q
-(<epsg21891> : Bogota 1975 / Colombia W)110.5 504 Q
-(est zone \(deprecated\))-.8 E
-(<epsg21892> : Bogota 1975 / Colombia Bogota zone \(deprecated\))110.5
-516 Q
-(<epsg21893> : Bogota 1975 / Colombia East Central zone \(deprecated\))
-110.5 528 Q(<epsg21894> : Bogota 1975 / Colombia East \(deprecated\))
-110.5 540 Q(<epsg21896> : Bogota 1975 / Colombia W)110.5 552 Q(est zone)
--.8 E(<epsg21897> : Bogota 1975 / Colombia Bogota zone)110.5 564 Q
-(<epsg21898> : Bogota 1975 / Colombia East Central zone)110.5 576 Q
-(<epsg21899> : Bogota 1975 / Colombia East)110.5 588 Q
-(<epsg22032> : Camacupa / UTM zone 32S)110.5 600 Q
-(<epsg22033> : Camacupa / UTM zone 33S)110.5 612 Q
-(<epsg22091> : Camacupa / TM 11.30 SE)110.5 624 Q
-(<epsg22092> : Camacupa / TM 12 SE)110.5 636 Q
-(<epsg22171> : POSGAR 98 / Ar)110.5 648 Q(gentina 1)-.18 E
-(<epsg22172> : POSGAR 98 / Ar)110.5 660 Q(gentina 2)-.18 E
-(<epsg22173> : POSGAR 98 / Ar)110.5 672 Q(gentina 3)-.18 E
-(<epsg22174> : POSGAR 98 / Ar)110.5 684 Q(gentina 4)-.18 E
-(<epsg22175> : POSGAR 98 / Ar)110.5 696 Q(gentina 5)-.18 E
-(<epsg22176> : POSGAR 98 / Ar)110.5 708 Q(gentina 6)-.18 E
-(<epsg22177> : POSGAR 98 / Ar)110.5 720 Q(gentina 7)-.18 E
-(MB-System 5.0)72 768 Q(13 March 2014)140.11 E(66)193.45 E 0 Cg EP
-%%Page: 67 67
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<epsg22181> : POSGAR 94 / Ar)110.5 84 Q
-(gentina 1)-.18 E(<epsg22182> : POSGAR 94 / Ar)110.5 96 Q(gentina 2)-.18
-E(<epsg22183> : POSGAR 94 / Ar)110.5 108 Q(gentina 3)-.18 E
-(<epsg22184> : POSGAR 94 / Ar)110.5 120 Q(gentina 4)-.18 E
-(<epsg22185> : POSGAR 94 / Ar)110.5 132 Q(gentina 5)-.18 E
-(<epsg22186> : POSGAR 94 / Ar)110.5 144 Q(gentina 6)-.18 E
-(<epsg22187> : POSGAR 94 / Ar)110.5 156 Q(gentina 7)-.18 E
-(<epsg22191> : Campo Inchauspe / Ar)110.5 168 Q(gentina 1)-.18 E
-(<epsg22192> : Campo Inchauspe / Ar)110.5 180 Q(gentina 2)-.18 E
-(<epsg22193> : Campo Inchauspe / Ar)110.5 192 Q(gentina 3)-.18 E
-(<epsg22194> : Campo Inchauspe / Ar)110.5 204 Q(gentina 4)-.18 E
-(<epsg22195> : Campo Inchauspe / Ar)110.5 216 Q(gentina 5)-.18 E
-(<epsg22196> : Campo Inchauspe / Ar)110.5 228 Q(gentina 6)-.18 E
-(<epsg22197> : Campo Inchauspe / Ar)110.5 240 Q(gentina 7)-.18 E
-(<epsg22234> : Cape / UTM zone 34S)110.5 252 Q
-(<epsg22235> : Cape / UTM zone 35S)110.5 264 Q
-(<epsg22236> : Cape / UTM zone 36S)110.5 276 Q
-(<epsg22332> : Carthage / UTM zone 32N)110.5 288 Q
-(<epsg22391> : Carthage / Nord T)110.5 300 Q(unisie)-.45 E
-(<epsg22392> : Carthage / Sud T)110.5 312 Q(unisie)-.45 E
-(<epsg22521> : Corre)110.5 324 Q(go Ale)-.15 E(gre / UTM zone 21S)-.15 E
-(<epsg22522> : Corre)110.5 336 Q(go Ale)-.15 E(gre / UTM zone 22S)-.15 E
-(<epsg22523> : Corre)110.5 348 Q(go Ale)-.15 E(gre / UTM zone 23S)-.15 E
-(<epsg22524> : Corre)110.5 360 Q(go Ale)-.15 E(gre / UTM zone 24S)-.15 E
-(<epsg22525> : Corre)110.5 372 Q(go Ale)-.15 E(gre / UTM zone 25S)-.15 E
-(<epsg22700> : Deir ez Zor / Le)110.5 384 Q -.25(va)-.25 G(nt Zone).25 E
-(<epsg22770> : Deir ez Zor / Syria Lambert)110.5 396 Q
-(<epsg22780> : Deir ez Zor / Le)110.5 408 Q -.25(va)-.25 G
-(nt Stereographic).25 E
-(<epsg22832> : Douala / UTM zone 32N \(deprecated\))110.5 420 Q
-(<epsg22991> : Egypt 1907 / Blue Belt)110.5 432 Q
-(<epsg22992> : Egypt 1907 / Red Belt)110.5 444 Q
-(<epsg22993> : Egypt 1907 / Purple Belt)110.5 456 Q
-(<epsg22994> : Egypt 1907 / Extended Purple Belt)110.5 468 Q
-(<epsg23028> : ED50 / UTM zone 28N)110.5 480 Q
-(<epsg23029> : ED50 / UTM zone 29N)110.5 492 Q
-(<epsg23030> : ED50 / UTM zone 30N)110.5 504 Q
-(<epsg23031> : ED50 / UTM zone 31N)110.5 516 Q
-(<epsg23032> : ED50 / UTM zone 32N)110.5 528 Q
-(<epsg23033> : ED50 / UTM zone 33N)110.5 540 Q
-(<epsg23034> : ED50 / UTM zone 34N)110.5 552 Q
-(<epsg23035> : ED50 / UTM zone 35N)110.5 564 Q
-(<epsg23036> : ED50 / UTM zone 36N)110.5 576 Q
-(<epsg23037> : ED50 / UTM zone 37N)110.5 588 Q
-(<epsg23038> : ED50 / UTM zone 38N)110.5 600 Q
-(<epsg23090> : ED50 / TM 0 N)110.5 612 Q(<epsg23095> : ED50 / TM 5 NE)
-110.5 624 Q(<epsg23239> : F)110.5 636 Q(ahud / UTM zone 39N)-.15 E
-(<epsg23240> : F)110.5 648 Q(ahud / UTM zone 40N)-.15 E
-(<epsg23433> : Garoua / UTM zone 33N \(deprecated\))110.5 660 Q
-(<epsg23700> : HD72 / EO)110.5 672 Q(V)-.5 E
-(<epsg23830> : DGN95 / Indonesia TM-3 zone 46.2)110.5 684 Q
-(<epsg23831> : DGN95 / Indonesia TM-3 zone 47.1)110.5 696 Q
-(<epsg23832> : DGN95 / Indonesia TM-3 zone 47.2)110.5 708 Q
-(<epsg23833> : DGN95 / Indonesia TM-3 zone 48.1)110.5 720 Q
-(MB-System 5.0)72 768 Q(13 March 2014)140.11 E(67)193.45 E 0 Cg EP
-%%Page: 68 68
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<epsg23834> : DGN95 / Indonesia TM-3 zone 48.2)
-110.5 84 Q(<epsg23835> : DGN95 / Indonesia TM-3 zone 49.1)110.5 96 Q
-(<epsg23836> : DGN95 / Indonesia TM-3 zone 49.2)110.5 108 Q
-(<epsg23837> : DGN95 / Indonesia TM-3 zone 50.1)110.5 120 Q
-(<epsg23838> : DGN95 / Indonesia TM-3 zone 50.2)110.5 132 Q
-(<epsg23839> : DGN95 / Indonesia TM-3 zone 51.1)110.5 144 Q
-(<epsg23840> : DGN95 / Indonesia TM-3 zone 51.2)110.5 156 Q
-(<epsg23841> : DGN95 / Indonesia TM-3 zone 52.1)110.5 168 Q
-(<epsg23842> : DGN95 / Indonesia TM-3 zone 52.2)110.5 180 Q
-(<epsg23843> : DGN95 / Indonesia TM-3 zone 53.1)110.5 192 Q
-(<epsg23844> : DGN95 / Indonesia TM-3 zone 53.2)110.5 204 Q
-(<epsg23845> : DGN95 / Indonesia TM-3 zone 54.1)110.5 216 Q
-(<epsg23846> : ID74 / UTM zone 46N)110.5 228 Q
-(<epsg23847> : ID74 / UTM zone 47N)110.5 240 Q
-(<epsg23848> : ID74 / UTM zone 48N)110.5 252 Q
-(<epsg23849> : ID74 / UTM zone 49N)110.5 264 Q
-(<epsg23850> : ID74 / UTM zone 50N)110.5 276 Q
-(<epsg23851> : ID74 / UTM zone 51N)110.5 288 Q
-(<epsg23852> : ID74 / UTM zone 52N)110.5 300 Q
-(<epsg23853> : ID74 / UTM zone 53N \(deprecated\))110.5 312 Q
-(<epsg23866> : DGN95 / UTM zone 46N)110.5 324 Q
-(<epsg23867> : DGN95 / UTM zone 47N)110.5 336 Q
-(<epsg23868> : DGN95 / UTM zone 48N)110.5 348 Q
-(<epsg23869> : DGN95 / UTM zone 49N)110.5 360 Q
-(<epsg23870> : DGN95 / UTM zone 50N)110.5 372 Q
-(<epsg23871> : DGN95 / UTM zone 51N)110.5 384 Q
-(<epsg23872> : DGN95 / UTM zone 52N)110.5 396 Q
-(<epsg23877> : DGN95 / UTM zone 47S)110.5 408 Q
-(<epsg23878> : DGN95 / UTM zone 48S)110.5 420 Q
-(<epsg23879> : DGN95 / UTM zone 49S)110.5 432 Q
-(<epsg23880> : DGN95 / UTM zone 50S)110.5 444 Q
-(<epsg23881> : DGN95 / UTM zone 51S)110.5 456 Q
-(<epsg23882> : DGN95 / UTM zone 52S)110.5 468 Q
-(<epsg23883> : DGN95 / UTM zone 53S)110.5 480 Q
-(<epsg23884> : DGN95 / UTM zone 54S)110.5 492 Q
-(<epsg23886> : ID74 / UTM zone 46S \(deprecated\))110.5 504 Q
-(<epsg23887> : ID74 / UTM zone 47S)110.5 516 Q
-(<epsg23888> : ID74 / UTM zone 48S)110.5 528 Q
-(<epsg23889> : ID74 / UTM zone 49S)110.5 540 Q
-(<epsg23890> : ID74 / UTM zone 50S)110.5 552 Q
-(<epsg23891> : ID74 / UTM zone 51S)110.5 564 Q
-(<epsg23892> : ID74 / UTM zone 52S)110.5 576 Q
-(<epsg23893> : ID74 / UTM zone 53S)110.5 588 Q
-(<epsg23894> : ID74 / UTM zone 54S)110.5 600 Q
-(<epsg23946> : Indian 1954 / UTM zone 46N)110.5 612 Q
-(<epsg23947> : Indian 1954 / UTM zone 47N)110.5 624 Q
-(<epsg23948> : Indian 1954 / UTM zone 48N)110.5 636 Q
-(<epsg24047> : Indian 1975 / UTM zone 47N)110.5 648 Q
-(<epsg24048> : Indian 1975 / UTM zone 48N)110.5 660 Q
-(<epsg24100> : Jamaica 1875 / Jamaica \(Old Grid\))110.5 672 Q
-(<epsg24200> : J)110.5 684 Q(AD69 / Jamaica National Grid)-.6 E
-(<epsg24305> : Kalianpur 1937 / UTM zone 45N)110.5 696 Q
-(<epsg24306> : Kalianpur 1937 / UTM zone 46N)110.5 708 Q
-(<epsg24311> : Kalianpur 1962 / UTM zone 41N)110.5 720 Q(MB-System 5.0)
-72 768 Q(13 March 2014)140.11 E(68)193.45 E 0 Cg EP
-%%Page: 69 69
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<epsg24312> : Kalianpur 1962 / UTM zone 42N)
-110.5 84 Q(<epsg24313> : Kalianpur 1962 / UTM zone 43N)110.5 96 Q
-(<epsg24342> : Kalianpur 1975 / UTM zone 42N)110.5 108 Q
-(<epsg24343> : Kalianpur 1975 / UTM zone 43N)110.5 120 Q
-(<epsg24344> : Kalianpur 1975 / UTM zone 44N)110.5 132 Q
-(<epsg24345> : Kalianpur 1975 / UTM zone 45N)110.5 144 Q
-(<epsg24346> : Kalianpur 1975 / UTM zone 46N)110.5 156 Q
-(<epsg24347> : Kalianpur 1975 / UTM zone 47N)110.5 168 Q
-(<epsg24370> : Kalianpur 1880 / India zone 0)110.5 180 Q
-(<epsg24371> : Kalianpur 1880 / India zone I)110.5 192 Q
-(<epsg24372> : Kalianpur 1880 / India zone IIa)110.5 204 Q
-(<epsg24373> : Kalianpur 1880 / India zone III)110.5 216 Q
-(<epsg24374> : Kalianpur 1880 / India zone IV)110.5 228 Q
-(<epsg24375> : Kalianpur 1937 / India zone IIb)110.5 240 Q
-(<epsg24376> : Kalianpur 1962 / India zone I)110.5 252 Q
-(<epsg24377> : Kalianpur 1962 / India zone IIa)110.5 264 Q
-(<epsg24378> : Kalianpur 1975 / India zone I)110.5 276 Q
-(<epsg24379> : Kalianpur 1975 / India zone IIa)110.5 288 Q
-(<epsg24380> : Kalianpur 1975 / India zone IIb)110.5 300 Q
-(<epsg24381> : Kalianpur 1975 / India zone III)110.5 312 Q
-(<epsg24382> : Kalianpur 1880 / India zone IIb)110.5 324 Q
-(<epsg24383> : Kalianpur 1975 / India zone IV)110.5 336 Q
-(<epsg24500> : K)110.5 348 Q(ertau 1968 / Sing)-.25 E(apore Grid)-.05 E
-(<epsg24547> : K)110.5 360 Q(ertau 1968 / UTM zone 47N)-.25 E
-(<epsg24548> : K)110.5 372 Q(ertau 1968 / UTM zone 48N)-.25 E
-(<epsg24571> : K)110.5 384 Q
-(ertau / R.S.O. Malaya \(ch\) \(deprecated\))-.25 E(<epsg24600> : K)
-110.5 396 Q(OC Lambert)-.3 E(<epsg24718> : La Canoa / UTM zone 18N)110.5
-408 Q(<epsg24719> : La Canoa / UTM zone 19N)110.5 420 Q
-(<epsg24720> : La Canoa / UTM zone 20N)110.5 432 Q
-(<epsg24817> : PSAD56 / UTM zone 17N)110.5 444 Q
-(<epsg24818> : PSAD56 / UTM zone 18N)110.5 456 Q
-(<epsg24819> : PSAD56 / UTM zone 19N)110.5 468 Q
-(<epsg24820> : PSAD56 / UTM zone 20N)110.5 480 Q
-(<epsg24821> : PSAD56 / UTM zone 21N)110.5 492 Q
-(<epsg24877> : PSAD56 / UTM zone 17S)110.5 504 Q
-(<epsg24878> : PSAD56 / UTM zone 18S)110.5 516 Q
-(<epsg24879> : PSAD56 / UTM zone 19S)110.5 528 Q
-(<epsg24880> : PSAD56 / UTM zone 20S)110.5 540 Q
-(<epsg24881> : PSAD56 / UTM zone 21S)110.5 552 Q
-(<epsg24882> : PSAD56 / UTM zone 22S)110.5 564 Q
-(<epsg24891> : PSAD56 / Peru west zone)110.5 576 Q
-(<epsg24892> : PSAD56 / Peru central zone)110.5 588 Q
-(<epsg24893> : PSAD56 / Peru east zone)110.5 600 Q
-(<epsg25000> : Leigon / Ghana Metre Grid)110.5 612 Q
-(<epsg25231> : Lome / UTM zone 31N)110.5 624 Q
-(<epsg25391> : Luzon 1911 / Philippines zone I)110.5 636 Q
-(<epsg25392> : Luzon 1911 / Philippines zone II)110.5 648 Q
-(<epsg25393> : Luzon 1911 / Philippines zone III)110.5 660 Q
-(<epsg25394> : Luzon 1911 / Philippines zone IV)110.5 672 Q
-(<epsg25395> : Luzon 1911 / Philippines zone V)110.5 684 Q
-(<epsg25700> : Makassar \(Jakarta\) / NEIEZ \(deprecated\))110.5 696 Q
-(<epsg25828> : ETRS89 / UTM zone 28N)110.5 708 Q
-(<epsg25829> : ETRS89 / UTM zone 29N)110.5 720 Q(MB-System 5.0)72 768 Q
-(13 March 2014)140.11 E(69)193.45 E 0 Cg EP
-%%Page: 70 70
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<epsg25830> : ETRS89 / UTM zone 30N)110.5 84 Q
-(<epsg25831> : ETRS89 / UTM zone 31N)110.5 96 Q
-(<epsg25832> : ETRS89 / UTM zone 32N)110.5 108 Q
-(<epsg25833> : ETRS89 / UTM zone 33N)110.5 120 Q
-(<epsg25834> : ETRS89 / UTM zone 34N)110.5 132 Q
-(<epsg25835> : ETRS89 / UTM zone 35N)110.5 144 Q
-(<epsg25836> : ETRS89 / UTM zone 36N)110.5 156 Q
-(<epsg25837> : ETRS89 / UTM zone 37N)110.5 168 Q
-(<epsg25838> : ETRS89 / UTM zone 38N)110.5 180 Q
-(<epsg25884> : ETRS89 / TM Baltic93)110.5 192 Q
-(<epsg25932> : Malongo 1987 / UTM zone 32S)110.5 204 Q
-(<epsg26191> : Merchich / Nord Maroc)110.5 216 Q
-(<epsg26192> : Merchich / Sud Maroc)110.5 228 Q
-(<epsg26193> : Merchich / Sahara \(deprecated\))110.5 240 Q
-(<epsg26194> : Merchich / Sahara Nord)110.5 252 Q
-(<epsg26195> : Merchich / Sahara Sud)110.5 264 Q(<epsg26237> : Massa)
-110.5 276 Q .2 -.1(wa / U)-.15 H(TM zone 37N).1 E
-(<epsg26331> : Minna / UTM zone 31N)110.5 288 Q
-(<epsg26332> : Minna / UTM zone 32N)110.5 300 Q
-(<epsg26391> : Minna / Nigeria W)110.5 312 Q(est Belt)-.8 E
-(<epsg26392> : Minna / Nigeria Mid Belt)110.5 324 Q
-(<epsg26393> : Minna / Nigeria East Belt)110.5 336 Q
-(<epsg26432> : Mhast / UTM zone 32S \(deprecated\))110.5 348 Q
-(<epsg26591> : Monte Mario \(Rome\) / Italy zone 1 \(deprecated\))110.5
-360 Q(<epsg26592> : Monte Mario \(Rome\) / Italy zone 2 \(deprecated\))
-110.5 372 Q(<epsg26632> : M'poralok)110.5 384 Q 2.5(o/U)-.1 G
-(TM zone 32N)-2.5 E(<epsg26692> : M'poralok)110.5 396 Q 2.5(o/U)-.1 G
-(TM zone 32S)-2.5 E(<epsg26701> : N)110.5 408 Q(AD27 / UTM zone 1N)-.35
-E(<epsg26702> : N)110.5 420 Q(AD27 / UTM zone 2N)-.35 E(<epsg26703> : N)
-110.5 432 Q(AD27 / UTM zone 3N)-.35 E(<epsg26704> : N)110.5 444 Q
-(AD27 / UTM zone 4N)-.35 E(<epsg26705> : N)110.5 456 Q
-(AD27 / UTM zone 5N)-.35 E(<epsg26706> : N)110.5 468 Q
-(AD27 / UTM zone 6N)-.35 E(<epsg26707> : N)110.5 480 Q
-(AD27 / UTM zone 7N)-.35 E(<epsg26708> : N)110.5 492 Q
-(AD27 / UTM zone 8N)-.35 E(<epsg26709> : N)110.5 504 Q
-(AD27 / UTM zone 9N)-.35 E(<epsg26710> : N)110.5 516 Q
-(AD27 / UTM zone 10N)-.35 E(<epsg26711> : N)110.5 528 Q
-(AD27 / UTM zone 11N)-.35 E(<epsg26712> : N)110.5 540 Q
-(AD27 / UTM zone 12N)-.35 E(<epsg26713> : N)110.5 552 Q
-(AD27 / UTM zone 13N)-.35 E(<epsg26714> : N)110.5 564 Q
-(AD27 / UTM zone 14N)-.35 E(<epsg26715> : N)110.5 576 Q
-(AD27 / UTM zone 15N)-.35 E(<epsg26716> : N)110.5 588 Q
-(AD27 / UTM zone 16N)-.35 E(<epsg26717> : N)110.5 600 Q
-(AD27 / UTM zone 17N)-.35 E(<epsg26718> : N)110.5 612 Q
-(AD27 / UTM zone 18N)-.35 E(<epsg26719> : N)110.5 624 Q
-(AD27 / UTM zone 19N)-.35 E(<epsg26720> : N)110.5 636 Q
-(AD27 / UTM zone 20N)-.35 E(<epsg26721> : N)110.5 648 Q
-(AD27 / UTM zone 21N)-.35 E(<epsg26722> : N)110.5 660 Q
-(AD27 / UTM zone 22N)-.35 E(<epsg26729> : N)110.5 672 Q
-(AD27 / Alabama East)-.35 E(<epsg26730> : N)110.5 684 Q
-(AD27 / Alabama W)-.35 E(est)-.8 E(<epsg26731> : N)110.5 696 Q
-(AD27 / Alaska zone 1)-.35 E(<epsg26732> : N)110.5 708 Q
-(AD27 / Alaska zone 2)-.35 E(<epsg26733> : N)110.5 720 Q
-(AD27 / Alaska zone 3)-.35 E(MB-System 5.0)72 768 Q(13 March 2014)140.11
-E(70)193.45 E 0 Cg EP
-%%Page: 71 71
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<epsg26734> : N)110.5 84 Q
-(AD27 / Alaska zone 4)-.35 E(<epsg26735> : N)110.5 96 Q
-(AD27 / Alaska zone 5)-.35 E(<epsg26736> : N)110.5 108 Q
-(AD27 / Alaska zone 6)-.35 E(<epsg26737> : N)110.5 120 Q
-(AD27 / Alaska zone 7)-.35 E(<epsg26738> : N)110.5 132 Q
-(AD27 / Alaska zone 8)-.35 E(<epsg26739> : N)110.5 144 Q
-(AD27 / Alaska zone 9)-.35 E(<epsg26740> : N)110.5 156 Q
-(AD27 / Alaska zone 10)-.35 E(<epsg26741> : N)110.5 168 Q
-(AD27 / California zone I)-.35 E(<epsg26742> : N)110.5 180 Q
-(AD27 / California zone II)-.35 E(<epsg26743> : N)110.5 192 Q
-(AD27 / California zone III)-.35 E(<epsg26744> : N)110.5 204 Q
-(AD27 / California zone IV)-.35 E(<epsg26745> : N)110.5 216 Q
-(AD27 / California zone V)-.35 E(<epsg26746> : N)110.5 228 Q
-(AD27 / California zone VI)-.35 E(<epsg26747> : N)110.5 240 Q
-(AD27 / California zone VII \(deprecated\))-.35 E(<epsg26748> : N)110.5
-252 Q(AD27 / Arizona East)-.35 E(<epsg26749> : N)110.5 264 Q
-(AD27 / Arizona Central)-.35 E(<epsg26750> : N)110.5 276 Q
-(AD27 / Arizona W)-.35 E(est)-.8 E(<epsg26751> : N)110.5 288 Q
-(AD27 / Arkansas North)-.35 E(<epsg26752> : N)110.5 300 Q
-(AD27 / Arkansas South)-.35 E(<epsg26753> : N)110.5 312 Q
-(AD27 / Colorado North)-.35 E(<epsg26754> : N)110.5 324 Q
-(AD27 / Colorado Central)-.35 E(<epsg26755> : N)110.5 336 Q
-(AD27 / Colorado South)-.35 E(<epsg26756> : N)110.5 348 Q
-(AD27 / Connecticut)-.35 E(<epsg26757> : N)110.5 360 Q(AD27 / Dela)-.35
-E -.1(wa)-.15 G(re).1 E(<epsg26758> : N)110.5 372 Q(AD27 / Florida East)
--.35 E(<epsg26759> : N)110.5 384 Q(AD27 / Florida W)-.35 E(est)-.8 E
-(<epsg26760> : N)110.5 396 Q(AD27 / Florida North)-.35 E
-(<epsg26766> : N)110.5 408 Q(AD27 / Geor)-.35 E(gia East)-.18 E
-(<epsg26767> : N)110.5 420 Q(AD27 / Geor)-.35 E(gia W)-.18 E(est)-.8 E
-(<epsg26768> : N)110.5 432 Q(AD27 / Idaho East)-.35 E(<epsg26769> : N)
-110.5 444 Q(AD27 / Idaho Central)-.35 E(<epsg26770> : N)110.5 456 Q
-(AD27 / Idaho W)-.35 E(est)-.8 E(<epsg26771> : N)110.5 468 Q
-(AD27 / Illinois East)-.35 E(<epsg26772> : N)110.5 480 Q
-(AD27 / Illinois W)-.35 E(est)-.8 E(<epsg26773> : N)110.5 492 Q
-(AD27 / Indiana East)-.35 E(<epsg26774> : N)110.5 504 Q
-(AD27 / Indiana W)-.35 E(est)-.8 E(<epsg26775> : N)110.5 516 Q
-(AD27 / Io)-.35 E .2 -.1(wa N)-.25 H(orth).1 E(<epsg26776> : N)110.5 528
-Q(AD27 / Io)-.35 E .2 -.1(wa S)-.25 H(outh).1 E(<epsg26777> : N)110.5
-540 Q(AD27 / Kansas North)-.35 E(<epsg26778> : N)110.5 552 Q
-(AD27 / Kansas South)-.35 E(<epsg26779> : N)110.5 564 Q(AD27 / K)-.35 E
-(entuck)-.25 E 2.5(yN)-.15 G(orth)-2.5 E(<epsg26780> : N)110.5 576 Q
-(AD27 / K)-.35 E(entuck)-.25 E 2.5(yS)-.15 G(outh)-2.5 E
-(<epsg26781> : N)110.5 588 Q(AD27 / Louisiana North)-.35 E
-(<epsg26782> : N)110.5 600 Q(AD27 / Louisiana South)-.35 E
-(<epsg26783> : N)110.5 612 Q(AD27 / Maine East)-.35 E(<epsg26784> : N)
-110.5 624 Q(AD27 / Maine W)-.35 E(est)-.8 E(<epsg26785> : N)110.5 636 Q
-(AD27 / Maryland)-.35 E(<epsg26786> : N)110.5 648 Q
-(AD27 / Massachusetts Mainland)-.35 E(<epsg26787> : N)110.5 660 Q
-(AD27 / Massachusetts Island)-.35 E(<epsg26791> : N)110.5 672 Q
-(AD27 / Minnesota North)-.35 E(<epsg26792> : N)110.5 684 Q
-(AD27 / Minnesota Central)-.35 E(<epsg26793> : N)110.5 696 Q
-(AD27 / Minnesota South)-.35 E(<epsg26794> : N)110.5 708 Q
-(AD27 / Mississippi East)-.35 E(<epsg26795> : N)110.5 720 Q
-(AD27 / Mississippi W)-.35 E(est)-.8 E(MB-System 5.0)72 768 Q
-(13 March 2014)140.11 E(71)193.45 E 0 Cg EP
-%%Page: 72 72
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<epsg26796> : N)110.5 84 Q
-(AD27 / Missouri East)-.35 E(<epsg26797> : N)110.5 96 Q
-(AD27 / Missouri Central)-.35 E(<epsg26798> : N)110.5 108 Q
-(AD27 / Missouri W)-.35 E(est)-.8 E(<epsg26799> : N)110.5 120 Q
-(AD27 / California zone VII)-.35 E(<epsg26801> : N)110.5 132 Q
-(AD Michig)-.35 E(an / Michig)-.05 E(an East)-.05 E(<epsg26802> : N)
-110.5 144 Q(AD Michig)-.35 E(an / Michig)-.05 E(an Old Central)-.05 E
-(<epsg26803> : N)110.5 156 Q(AD Michig)-.35 E(an / Michig)-.05 E(an W)
--.05 E(est)-.8 E(<epsg26811> : N)110.5 168 Q(AD Michig)-.35 E
-(an / Michig)-.05 E(an North)-.05 E(<epsg26812> : N)110.5 180 Q
-(AD Michig)-.35 E(an / Michig)-.05 E(an Central)-.05 E(<epsg26813> : N)
-110.5 192 Q(AD Michig)-.35 E(an / Michig)-.05 E(an South)-.05 E
-(<epsg26901> : N)110.5 204 Q(AD83 / UTM zone 1N)-.35 E(<epsg26902> : N)
-110.5 216 Q(AD83 / UTM zone 2N)-.35 E(<epsg26903> : N)110.5 228 Q
-(AD83 / UTM zone 3N)-.35 E(<epsg26904> : N)110.5 240 Q
-(AD83 / UTM zone 4N)-.35 E(<epsg26905> : N)110.5 252 Q
-(AD83 / UTM zone 5N)-.35 E(<epsg26906> : N)110.5 264 Q
-(AD83 / UTM zone 6N)-.35 E(<epsg26907> : N)110.5 276 Q
-(AD83 / UTM zone 7N)-.35 E(<epsg26908> : N)110.5 288 Q
-(AD83 / UTM zone 8N)-.35 E(<epsg26909> : N)110.5 300 Q
-(AD83 / UTM zone 9N)-.35 E(<epsg26910> : N)110.5 312 Q
-(AD83 / UTM zone 10N)-.35 E(<epsg26911> : N)110.5 324 Q
-(AD83 / UTM zone 11N)-.35 E(<epsg26912> : N)110.5 336 Q
-(AD83 / UTM zone 12N)-.35 E(<epsg26913> : N)110.5 348 Q
-(AD83 / UTM zone 13N)-.35 E(<epsg26914> : N)110.5 360 Q
-(AD83 / UTM zone 14N)-.35 E(<epsg26915> : N)110.5 372 Q
-(AD83 / UTM zone 15N)-.35 E(<epsg26916> : N)110.5 384 Q
-(AD83 / UTM zone 16N)-.35 E(<epsg26917> : N)110.5 396 Q
-(AD83 / UTM zone 17N)-.35 E(<epsg26918> : N)110.5 408 Q
-(AD83 / UTM zone 18N)-.35 E(<epsg26919> : N)110.5 420 Q
-(AD83 / UTM zone 19N)-.35 E(<epsg26920> : N)110.5 432 Q
-(AD83 / UTM zone 20N)-.35 E(<epsg26921> : N)110.5 444 Q
-(AD83 / UTM zone 21N)-.35 E(<epsg26922> : N)110.5 456 Q
-(AD83 / UTM zone 22N)-.35 E(<epsg26923> : N)110.5 468 Q
-(AD83 / UTM zone 23N)-.35 E(<epsg26929> : N)110.5 480 Q
-(AD83 / Alabama East)-.35 E(<epsg26930> : N)110.5 492 Q
-(AD83 / Alabama W)-.35 E(est)-.8 E(<epsg26931> : N)110.5 504 Q
-(AD83 / Alaska zone 1)-.35 E(<epsg26932> : N)110.5 516 Q
-(AD83 / Alaska zone 2)-.35 E(<epsg26933> : N)110.5 528 Q
-(AD83 / Alaska zone 3)-.35 E(<epsg26934> : N)110.5 540 Q
-(AD83 / Alaska zone 4)-.35 E(<epsg26935> : N)110.5 552 Q
-(AD83 / Alaska zone 5)-.35 E(<epsg26936> : N)110.5 564 Q
-(AD83 / Alaska zone 6)-.35 E(<epsg26937> : N)110.5 576 Q
-(AD83 / Alaska zone 7)-.35 E(<epsg26938> : N)110.5 588 Q
-(AD83 / Alaska zone 8)-.35 E(<epsg26939> : N)110.5 600 Q
-(AD83 / Alaska zone 9)-.35 E(<epsg26940> : N)110.5 612 Q
-(AD83 / Alaska zone 10)-.35 E(<epsg26941> : N)110.5 624 Q
-(AD83 / California zone 1)-.35 E(<epsg26942> : N)110.5 636 Q
-(AD83 / California zone 2)-.35 E(<epsg26943> : N)110.5 648 Q
-(AD83 / California zone 3)-.35 E(<epsg26944> : N)110.5 660 Q
-(AD83 / California zone 4)-.35 E(<epsg26945> : N)110.5 672 Q
-(AD83 / California zone 5)-.35 E(<epsg26946> : N)110.5 684 Q
-(AD83 / California zone 6)-.35 E(<epsg26948> : N)110.5 696 Q
-(AD83 / Arizona East)-.35 E(<epsg26949> : N)110.5 708 Q
-(AD83 / Arizona Central)-.35 E(<epsg26950> : N)110.5 720 Q
-(AD83 / Arizona W)-.35 E(est)-.8 E(MB-System 5.0)72 768 Q(13 March 2014)
-140.11 E(72)193.45 E 0 Cg EP
-%%Page: 73 73
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<epsg26951> : N)110.5 84 Q
-(AD83 / Arkansas North)-.35 E(<epsg26952> : N)110.5 96 Q
-(AD83 / Arkansas South)-.35 E(<epsg26953> : N)110.5 108 Q
-(AD83 / Colorado North)-.35 E(<epsg26954> : N)110.5 120 Q
-(AD83 / Colorado Central)-.35 E(<epsg26955> : N)110.5 132 Q
-(AD83 / Colorado South)-.35 E(<epsg26956> : N)110.5 144 Q
-(AD83 / Connecticut)-.35 E(<epsg26957> : N)110.5 156 Q(AD83 / Dela)-.35
-E -.1(wa)-.15 G(re).1 E(<epsg26958> : N)110.5 168 Q(AD83 / Florida East)
--.35 E(<epsg26959> : N)110.5 180 Q(AD83 / Florida W)-.35 E(est)-.8 E
-(<epsg26960> : N)110.5 192 Q(AD83 / Florida North)-.35 E
-(<epsg26961> : N)110.5 204 Q(AD83 / Ha)-.35 E -.1(wa)-.15 G(ii zone 1).1
-E(<epsg26962> : N)110.5 216 Q(AD83 / Ha)-.35 E -.1(wa)-.15 G(ii zone 2)
-.1 E(<epsg26963> : N)110.5 228 Q(AD83 / Ha)-.35 E -.1(wa)-.15 G
-(ii zone 3).1 E(<epsg26964> : N)110.5 240 Q(AD83 / Ha)-.35 E -.1(wa)-.15
-G(ii zone 4).1 E(<epsg26965> : N)110.5 252 Q(AD83 / Ha)-.35 E -.1(wa)
--.15 G(ii zone 5).1 E(<epsg26966> : N)110.5 264 Q(AD83 / Geor)-.35 E
-(gia East)-.18 E(<epsg26967> : N)110.5 276 Q(AD83 / Geor)-.35 E(gia W)
--.18 E(est)-.8 E(<epsg26968> : N)110.5 288 Q(AD83 / Idaho East)-.35 E
-(<epsg26969> : N)110.5 300 Q(AD83 / Idaho Central)-.35 E
-(<epsg26970> : N)110.5 312 Q(AD83 / Idaho W)-.35 E(est)-.8 E
-(<epsg26971> : N)110.5 324 Q(AD83 / Illinois East)-.35 E
-(<epsg26972> : N)110.5 336 Q(AD83 / Illinois W)-.35 E(est)-.8 E
-(<epsg26973> : N)110.5 348 Q(AD83 / Indiana East)-.35 E(<epsg26974> : N)
-110.5 360 Q(AD83 / Indiana W)-.35 E(est)-.8 E(<epsg26975> : N)110.5 372
-Q(AD83 / Io)-.35 E .2 -.1(wa N)-.25 H(orth).1 E(<epsg26976> : N)110.5
-384 Q(AD83 / Io)-.35 E .2 -.1(wa S)-.25 H(outh).1 E(<epsg26977> : N)
-110.5 396 Q(AD83 / Kansas North)-.35 E(<epsg26978> : N)110.5 408 Q
-(AD83 / Kansas South)-.35 E(<epsg26979> : N)110.5 420 Q(AD83 / K)-.35 E
-(entuck)-.25 E 2.5(yN)-.15 G(orth \(deprecated\))-2.5 E(<epsg26980> : N)
-110.5 432 Q(AD83 / K)-.35 E(entuck)-.25 E 2.5(yS)-.15 G(outh)-2.5 E
-(<epsg26981> : N)110.5 444 Q(AD83 / Louisiana North)-.35 E
-(<epsg26982> : N)110.5 456 Q(AD83 / Louisiana South)-.35 E
-(<epsg26983> : N)110.5 468 Q(AD83 / Maine East)-.35 E(<epsg26984> : N)
-110.5 480 Q(AD83 / Maine W)-.35 E(est)-.8 E(<epsg26985> : N)110.5 492 Q
-(AD83 / Maryland)-.35 E(<epsg26986> : N)110.5 504 Q
-(AD83 / Massachusetts Mainland)-.35 E(<epsg26987> : N)110.5 516 Q
-(AD83 / Massachusetts Island)-.35 E(<epsg26988> : N)110.5 528 Q
-(AD83 / Michig)-.35 E(an North)-.05 E(<epsg26989> : N)110.5 540 Q
-(AD83 / Michig)-.35 E(an Central)-.05 E(<epsg26990> : N)110.5 552 Q
-(AD83 / Michig)-.35 E(an South)-.05 E(<epsg26991> : N)110.5 564 Q
-(AD83 / Minnesota North)-.35 E(<epsg26992> : N)110.5 576 Q
-(AD83 / Minnesota Central)-.35 E(<epsg26993> : N)110.5 588 Q
-(AD83 / Minnesota South)-.35 E(<epsg26994> : N)110.5 600 Q
-(AD83 / Mississippi East)-.35 E(<epsg26995> : N)110.5 612 Q
-(AD83 / Mississippi W)-.35 E(est)-.8 E(<epsg26996> : N)110.5 624 Q
-(AD83 / Missouri East)-.35 E(<epsg26997> : N)110.5 636 Q
-(AD83 / Missouri Central)-.35 E(<epsg26998> : N)110.5 648 Q
-(AD83 / Missouri W)-.35 E(est)-.8 E(<epsg27037> : Nahrw)110.5 660 Q
-(an 1967 / UTM zone 37N)-.1 E(<epsg27038> : Nahrw)110.5 672 Q
-(an 1967 / UTM zone 38N)-.1 E(<epsg27039> : Nahrw)110.5 684 Q
-(an 1967 / UTM zone 39N)-.1 E(<epsg27040> : Nahrw)110.5 696 Q
-(an 1967 / UTM zone 40N)-.1 E
-(<epsg27120> : Naparima 1972 / UTM zone 20N)110.5 708 Q
-(<epsg27200> : NZGD49 / Ne)110.5 720 Q 2.5(wZ)-.25 G(ealand Map Grid)
--2.5 E(MB-System 5.0)72 768 Q(13 March 2014)140.11 E(73)193.45 E 0 Cg EP
-%%Page: 74 74
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<epsg27205> : NZGD49 / Mount Eden Circuit)110.5
-84 Q(<epsg27206> : NZGD49 / Bay of Plenty Circuit)110.5 96 Q
-(<epsg27207> : NZGD49 / Po)110.5 108 Q -.15(ve)-.15 G(rty Bay Circuit)
-.15 E(<epsg27208> : NZGD49 / Ha)110.5 120 Q(wk)-.15 E(es Bay Circuit)-.1
-E(<epsg27209> : NZGD49 / T)110.5 132 Q(aranaki Circuit)-.8 E
-(<epsg27210> : NZGD49 / T)110.5 144 Q(uhirangi Circuit)-.45 E
-(<epsg27211> : NZGD49 / W)110.5 156 Q(ang)-.8 E(anui Circuit)-.05 E
-(<epsg27212> : NZGD49 / W)110.5 168 Q(airarapa Circuit)-.8 E
-(<epsg27213> : NZGD49 / W)110.5 180 Q(ellington Circuit)-.8 E
-(<epsg27214> : NZGD49 / Collingw)110.5 192 Q(ood Circuit)-.1 E
-(<epsg27215> : NZGD49 / Nelson Circuit)110.5 204 Q
-(<epsg27216> : NZGD49 / Karamea Circuit)110.5 216 Q
-(<epsg27217> : NZGD49 / Buller Circuit)110.5 228 Q
-(<epsg27218> : NZGD49 / Gre)110.5 240 Q 2.5(yC)-.15 G(ircuit)-2.5 E
-(<epsg27219> : NZGD49 / Amuri Circuit)110.5 252 Q
-(<epsg27220> : NZGD49 / Marlborough Circuit)110.5 264 Q
-(<epsg27221> : NZGD49 / Hokitika Circuit)110.5 276 Q
-(<epsg27222> : NZGD49 / Okarito Circuit)110.5 288 Q
-(<epsg27223> : NZGD49 / Jacksons Bay Circuit)110.5 300 Q
-(<epsg27224> : NZGD49 / Mount Pleasant Circuit)110.5 312 Q
-(<epsg27225> : NZGD49 / Ga)110.5 324 Q(wler Circuit)-.15 E
-(<epsg27226> : NZGD49 / T)110.5 336 Q(imaru Circuit)-.35 E
-(<epsg27227> : NZGD49 / Lindis Peak Circuit)110.5 348 Q
-(<epsg27228> : NZGD49 / Mount Nicholas Circuit)110.5 360 Q
-(<epsg27229> : NZGD49 / Mount Y)110.5 372 Q(ork Circuit)-1.1 E
-(<epsg27230> : NZGD49 / Observ)110.5 384 Q(ation Point Circuit)-.25 E
-(<epsg27231> : NZGD49 / North T)110.5 396 Q(aieri Circuit)-.8 E
-(<epsg27232> : NZGD49 / Bluf)110.5 408 Q 2.5(fC)-.25 G(ircuit)-2.5 E
-(<epsg27258> : NZGD49 / UTM zone 58S)110.5 420 Q
-(<epsg27259> : NZGD49 / UTM zone 59S)110.5 432 Q
-(<epsg27260> : NZGD49 / UTM zone 60S)110.5 444 Q
-(<epsg27291> : NZGD49 / North Island Grid)110.5 456 Q
-(<epsg27292> : NZGD49 / South Island Grid)110.5 468 Q
-(<epsg27391> : NGO 1948 \(Oslo\) / NGO zone I)110.5 480 Q
-(<epsg27392> : NGO 1948 \(Oslo\) / NGO zone II)110.5 492 Q
-(<epsg27393> : NGO 1948 \(Oslo\) / NGO zone III)110.5 504 Q
-(<epsg27394> : NGO 1948 \(Oslo\) / NGO zone IV)110.5 516 Q
-(<epsg27395> : NGO 1948 \(Oslo\) / NGO zone V)110.5 528 Q
-(<epsg27396> : NGO 1948 \(Oslo\) / NGO zone VI)110.5 540 Q
-(<epsg27397> : NGO 1948 \(Oslo\) / NGO zone VII)110.5 552 Q
-(<epsg27398> : NGO 1948 \(Oslo\) / NGO zone VIII)110.5 564 Q
-(<epsg27429> : Datum 73 / UTM zone 29N)110.5 576 Q
-(<epsg27492> : Datum 73 / Modi\214ed Portuguese Grid)110.5 588 Q
-(<epsg27500> : A)110.5 600 Q(TF \(P)-1.11 E(aris\) / Nord de Guerre)-.15
-E(<epsg27561> : NTF \(P)110.5 612 Q(aris\) / Lambert Nord France)-.15 E
-(<epsg27562> : NTF \(P)110.5 624 Q(aris\) / Lambert Centre France)-.15 E
-(<epsg27563> : NTF \(P)110.5 636 Q(aris\) / Lambert Sud France)-.15 E
-(<epsg27564> : NTF \(P)110.5 648 Q(aris\) / Lambert Corse)-.15 E
-(<epsg27571> : NTF \(P)110.5 660 Q(aris\) / Lambert zone I)-.15 E
-(<epsg27572> : NTF \(P)110.5 672 Q(aris\) / Lambert zone II)-.15 E
-(<epsg27573> : NTF \(P)110.5 684 Q(aris\) / Lambert zone III)-.15 E
-(<epsg27574> : NTF \(P)110.5 696 Q(aris\) / Lambert zone IV)-.15 E
-(<epsg27581> : NTF \(P)110.5 708 Q(aris\) / France I \(deprecated\))-.15
-E(<epsg27582> : NTF \(P)110.5 720 Q(aris\) / France II \(deprecated\))
--.15 E(MB-System 5.0)72 768 Q(13 March 2014)140.11 E(74)193.45 E 0 Cg EP
-%%Page: 75 75
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<epsg27583> : NTF \(P)110.5 84 Q
-(aris\) / France III \(deprecated\))-.15 E(<epsg27584> : NTF \(P)110.5
-96 Q(aris\) / France IV \(deprecated\))-.15 E(<epsg27591> : NTF \(P)
-110.5 108 Q(aris\) / Nord France \(deprecated\))-.15 E
-(<epsg27592> : NTF \(P)110.5 120 Q
-(aris\) / Centre France \(deprecated\))-.15 E(<epsg27593> : NTF \(P)
-110.5 132 Q(aris\) / Sud France \(deprecated\))-.15 E
-(<epsg27594> : NTF \(P)110.5 144 Q(aris\) / Corse \(deprecated\))-.15 E
-(<epsg27700> : OSGB 1936 / British National Grid)110.5 156 Q
-(<epsg28191> : P)110.5 168 Q(alestine 1923 / P)-.15 E(alestine Grid)-.15
-E(<epsg28192> : P)110.5 180 Q(alestine 1923 / P)-.15 E(alestine Belt)
--.15 E(<epsg28193> : P)110.5 192 Q(alestine 1923 / Israeli CS Grid)-.15
-E(<epsg28232> : Pointe Noire / UTM zone 32S)110.5 204 Q
-(<epsg28348> : GD)110.5 216 Q(A94 / MGA zone 48)-.4 E(<epsg28349> : GD)
-110.5 228 Q(A94 / MGA zone 49)-.4 E(<epsg28350> : GD)110.5 240 Q
-(A94 / MGA zone 50)-.4 E(<epsg28351> : GD)110.5 252 Q(A94 / MGA zone 51)
--.4 E(<epsg28352> : GD)110.5 264 Q(A94 / MGA zone 52)-.4 E
-(<epsg28353> : GD)110.5 276 Q(A94 / MGA zone 53)-.4 E(<epsg28354> : GD)
-110.5 288 Q(A94 / MGA zone 54)-.4 E(<epsg28355> : GD)110.5 300 Q
-(A94 / MGA zone 55)-.4 E(<epsg28356> : GD)110.5 312 Q(A94 / MGA zone 56)
--.4 E(<epsg28357> : GD)110.5 324 Q(A94 / MGA zone 57)-.4 E
-(<epsg28358> : GD)110.5 336 Q(A94 / MGA zone 58)-.4 E
-(<epsg28402> : Pulk)110.5 348 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger zone 2)-2.5 E(<epsg28403> : Pulk)110.5 360 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger zone 3)-2.5 E
-(<epsg28404> : Pulk)110.5 372 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger zone 4)-2.5 E(<epsg28405> : Pulk)110.5 384 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger zone 5)-2.5 E
-(<epsg28406> : Pulk)110.5 396 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger zone 6)-2.5 E(<epsg28407> : Pulk)110.5 408 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger zone 7)-2.5 E
-(<epsg28408> : Pulk)110.5 420 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger zone 8)-2.5 E(<epsg28409> : Pulk)110.5 432 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger zone 9)-2.5 E
-(<epsg28410> : Pulk)110.5 444 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger zone 10)-2.5 E(<epsg28411> : Pulk)110.5 456 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger zone 11)-2.5 E
-(<epsg28412> : Pulk)110.5 468 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger zone 12)-2.5 E(<epsg28413> : Pulk)110.5 480 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger zone 13)-2.5 E
-(<epsg28414> : Pulk)110.5 492 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger zone 14)-2.5 E(<epsg28415> : Pulk)110.5 504 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger zone 15)-2.5 E
-(<epsg28416> : Pulk)110.5 516 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger zone 16)-2.5 E(<epsg28417> : Pulk)110.5 528 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger zone 17)-2.5 E
-(<epsg28418> : Pulk)110.5 540 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger zone 18)-2.5 E(<epsg28419> : Pulk)110.5 552 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger zone 19)-2.5 E
-(<epsg28420> : Pulk)110.5 564 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger zone 20)-2.5 E(<epsg28421> : Pulk)110.5 576 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger zone 21)-2.5 E
-(<epsg28422> : Pulk)110.5 588 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger zone 22)-2.5 E(<epsg28423> : Pulk)110.5 600 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger zone 23)-2.5 E
-(<epsg28424> : Pulk)110.5 612 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger zone 24)-2.5 E(<epsg28425> : Pulk)110.5 624 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger zone 25)-2.5 E
-(<epsg28426> : Pulk)110.5 636 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger zone 26)-2.5 E(<epsg28427> : Pulk)110.5 648 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger zone 27)-2.5 E
-(<epsg28428> : Pulk)110.5 660 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger zone 28)-2.5 E(<epsg28429> : Pulk)110.5 672 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger zone 29)-2.5 E
-(<epsg28430> : Pulk)110.5 684 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger zone 30)-2.5 E(<epsg28431> : Pulk)110.5 696 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger zone 31)-2.5 E
-(<epsg28432> : Pulk)110.5 708 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger zone 32)-2.5 E(<epsg28462> : Pulk)110.5 720 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger 2N \(deprecated\))-2.5 E
-(MB-System 5.0)72 768 Q(13 March 2014)140.11 E(75)193.45 E 0 Cg EP
-%%Page: 76 76
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<epsg28463> : Pulk)110.5 84 Q -.15(ov)-.1 G 2.5
-(o1)-.05 G(942 / Gauss-Kruger 3N \(deprecated\))-2.5 E
-(<epsg28464> : Pulk)110.5 96 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger 4N \(deprecated\))-2.5 E(<epsg28465> : Pulk)110.5
-108 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger 5N \(deprecated\))
--2.5 E(<epsg28466> : Pulk)110.5 120 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger 6N \(deprecated\))-2.5 E(<epsg28467> : Pulk)110.5
-132 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger 7N \(deprecated\))
--2.5 E(<epsg28468> : Pulk)110.5 144 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger 8N \(deprecated\))-2.5 E(<epsg28469> : Pulk)110.5
-156 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger 9N \(deprecated\))
--2.5 E(<epsg28470> : Pulk)110.5 168 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger 10N \(deprecated\))-2.5 E(<epsg28471> : Pulk)110.5
-180 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger 11N \(deprecated\))
--2.5 E(<epsg28472> : Pulk)110.5 192 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger 12N \(deprecated\))-2.5 E(<epsg28473> : Pulk)110.5
-204 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger 13N \(deprecated\))
--2.5 E(<epsg28474> : Pulk)110.5 216 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger 14N \(deprecated\))-2.5 E(<epsg28475> : Pulk)110.5
-228 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger 15N \(deprecated\))
--2.5 E(<epsg28476> : Pulk)110.5 240 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger 16N \(deprecated\))-2.5 E(<epsg28477> : Pulk)110.5
-252 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger 17N \(deprecated\))
--2.5 E(<epsg28478> : Pulk)110.5 264 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger 18N \(deprecated\))-2.5 E(<epsg28479> : Pulk)110.5
-276 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger 19N \(deprecated\))
--2.5 E(<epsg28480> : Pulk)110.5 288 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger 20N \(deprecated\))-2.5 E(<epsg28481> : Pulk)110.5
-300 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger 21N \(deprecated\))
--2.5 E(<epsg28482> : Pulk)110.5 312 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger 22N \(deprecated\))-2.5 E(<epsg28483> : Pulk)110.5
-324 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger 23N \(deprecated\))
--2.5 E(<epsg28484> : Pulk)110.5 336 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger 24N \(deprecated\))-2.5 E(<epsg28485> : Pulk)110.5
-348 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger 25N \(deprecated\))
--2.5 E(<epsg28486> : Pulk)110.5 360 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger 26N \(deprecated\))-2.5 E(<epsg28487> : Pulk)110.5
-372 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger 27N \(deprecated\))
--2.5 E(<epsg28488> : Pulk)110.5 384 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger 28N \(deprecated\))-2.5 E(<epsg28489> : Pulk)110.5
-396 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger 29N \(deprecated\))
--2.5 E(<epsg28490> : Pulk)110.5 408 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger 30N \(deprecated\))-2.5 E(<epsg28491> : Pulk)110.5
-420 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger 31N \(deprecated\))
--2.5 E(<epsg28492> : Pulk)110.5 432 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger 32N \(deprecated\))-2.5 E
-(<epsg28600> : Qatar 1974 / Qatar National Grid)110.5 444 Q
-(<epsg28991> : Amersfoort / RD Old)110.5 456 Q
-(<epsg28992> : Amersfoort / RD Ne)110.5 468 Q(w)-.25 E
-(<epsg29100> : SAD69 / Brazil Polyconic \(deprecated\))110.5 480 Q
-(<epsg29101> : SAD69 / Brazil Polyconic)110.5 492 Q
-(<epsg29118> : SAD69 / UTM zone 18N \(deprecated\))110.5 504 Q
-(<epsg29119> : SAD69 / UTM zone 19N \(deprecated\))110.5 516 Q
-(<epsg29120> : SAD69 / UTM zone 20N \(deprecated\))110.5 528 Q
-(<epsg29121> : SAD69 / UTM zone 21N \(deprecated\))110.5 540 Q
-(<epsg29122> : SAD69 / UTM zone 22N \(deprecated\))110.5 552 Q
-(<epsg29168> : SAD69 / UTM zone 18N)110.5 564 Q
-(<epsg29169> : SAD69 / UTM zone 19N)110.5 576 Q
-(<epsg29170> : SAD69 / UTM zone 20N)110.5 588 Q
-(<epsg29171> : SAD69 / UTM zone 21N)110.5 600 Q
-(<epsg29172> : SAD69 / UTM zone 22N)110.5 612 Q
-(<epsg29177> : SAD69 / UTM zone 17S \(deprecated\))110.5 624 Q
-(<epsg29178> : SAD69 / UTM zone 18S \(deprecated\))110.5 636 Q
-(<epsg29179> : SAD69 / UTM zone 19S \(deprecated\))110.5 648 Q
-(<epsg29180> : SAD69 / UTM zone 20S \(deprecated\))110.5 660 Q
-(<epsg29181> : SAD69 / UTM zone 21S \(deprecated\))110.5 672 Q
-(<epsg29182> : SAD69 / UTM zone 22S \(deprecated\))110.5 684 Q
-(<epsg29183> : SAD69 / UTM zone 23S \(deprecated\))110.5 696 Q
-(<epsg29184> : SAD69 / UTM zone 24S \(deprecated\))110.5 708 Q
-(<epsg29185> : SAD69 / UTM zone 25S \(deprecated\))110.5 720 Q
-(MB-System 5.0)72 768 Q(13 March 2014)140.11 E(76)193.45 E 0 Cg EP
-%%Page: 77 77
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<epsg29187> : SAD69 / UTM zone 17S)110.5 84 Q
-(<epsg29188> : SAD69 / UTM zone 18S)110.5 96 Q
-(<epsg29189> : SAD69 / UTM zone 19S)110.5 108 Q
-(<epsg29190> : SAD69 / UTM zone 20S)110.5 120 Q
-(<epsg29191> : SAD69 / UTM zone 21S)110.5 132 Q
-(<epsg29192> : SAD69 / UTM zone 22S)110.5 144 Q
-(<epsg29193> : SAD69 / UTM zone 23S)110.5 156 Q
-(<epsg29194> : SAD69 / UTM zone 24S)110.5 168 Q
-(<epsg29195> : SAD69 / UTM zone 25S)110.5 180 Q
-(<epsg29220> : Sapper Hill 1943 / UTM zone 20S)110.5 192 Q
-(<epsg29221> : Sapper Hill 1943 / UTM zone 21S)110.5 204 Q
-(<epsg29333> : Schw)110.5 216 Q(arzeck / UTM zone 33S)-.1 E
-(<epsg29635> : Sudan / UTM zone 35N \(deprecated\))110.5 228 Q
-(<epsg29636> : Sudan / UTM zone 36N \(deprecated\))110.5 240 Q
-(<epsg29700> : T)110.5 252 Q(ananari)-.8 E .3 -.15(ve \()-.25 H -.15(Pa)
-.15 G(ris\) / Laborde Grid \(deprecated\)).15 E(<epsg29702> : T)110.5
-264 Q(ananari)-.8 E .3 -.15(ve \()-.25 H -.15(Pa).15 G
-(ris\) / Laborde Grid approximation).15 E(<epsg29738> : T)110.5 276 Q
-(ananari)-.8 E .3 -.15(ve / U)-.25 H(TM zone 38S).15 E(<epsg29739> : T)
-110.5 288 Q(ananari)-.8 E .3 -.15(ve / U)-.25 H(TM zone 39S).15 E
-(<epsg29849> : T)110.5 300 Q(imbalai 1948 / UTM zone 49N)-.35 E
-(<epsg29850> : T)110.5 312 Q(imbalai 1948 / UTM zone 50N)-.35 E
-(<epsg29871> : T)110.5 324 Q(imbalai 1948 / RSO Borneo \(ch\))-.35 E
-(<epsg29872> : T)110.5 336 Q(imbalai 1948 / RSO Borneo \(ft\))-.35 E
-(<epsg29873> : T)110.5 348 Q(imbalai 1948 / RSO Borneo \(m\))-.35 E
-(<epsg29900> : TM65 / Irish National Grid \(deprecated\))110.5 360 Q
-(<epsg29901> : OSNI 1952 / Irish National Grid)110.5 372 Q
-(<epsg29902> : TM65 / Irish Grid)110.5 384 Q
-(<epsg29903> : TM75 / Irish Grid)110.5 396 Q(<epsg30161> : T)110.5 408 Q
-(ok)-.8 E(yo / Japan Plane Rectangular CS I)-.15 E(<epsg30162> : T)110.5
-420 Q(ok)-.8 E(yo / Japan Plane Rectangular CS II)-.15 E
-(<epsg30163> : T)110.5 432 Q(ok)-.8 E
-(yo / Japan Plane Rectangular CS III)-.15 E(<epsg30164> : T)110.5 444 Q
-(ok)-.8 E(yo / Japan Plane Rectangular CS IV)-.15 E(<epsg30165> : T)
-110.5 456 Q(ok)-.8 E(yo / Japan Plane Rectangular CS V)-.15 E
-(<epsg30166> : T)110.5 468 Q(ok)-.8 E
-(yo / Japan Plane Rectangular CS VI)-.15 E(<epsg30167> : T)110.5 480 Q
-(ok)-.8 E(yo / Japan Plane Rectangular CS VII)-.15 E(<epsg30168> : T)
-110.5 492 Q(ok)-.8 E(yo / Japan Plane Rectangular CS VIII)-.15 E
-(<epsg30169> : T)110.5 504 Q(ok)-.8 E
-(yo / Japan Plane Rectangular CS IX)-.15 E(<epsg30170> : T)110.5 516 Q
-(ok)-.8 E(yo / Japan Plane Rectangular CS X)-.15 E(<epsg30171> : T)110.5
-528 Q(ok)-.8 E(yo / Japan Plane Rectangular CS XI)-.15 E
-(<epsg30172> : T)110.5 540 Q(ok)-.8 E
-(yo / Japan Plane Rectangular CS XII)-.15 E(<epsg30173> : T)110.5 552 Q
-(ok)-.8 E(yo / Japan Plane Rectangular CS XIII)-.15 E(<epsg30174> : T)
-110.5 564 Q(ok)-.8 E(yo / Japan Plane Rectangular CS XIV)-.15 E
-(<epsg30175> : T)110.5 576 Q(ok)-.8 E
-(yo / Japan Plane Rectangular CS XV)-.15 E(<epsg30176> : T)110.5 588 Q
-(ok)-.8 E(yo / Japan Plane Rectangular CS XVI)-.15 E(<epsg30177> : T)
-110.5 600 Q(ok)-.8 E(yo / Japan Plane Rectangular CS XVII)-.15 E
-(<epsg30178> : T)110.5 612 Q(ok)-.8 E
-(yo / Japan Plane Rectangular CS XVIII)-.15 E(<epsg30179> : T)110.5 624
-Q(ok)-.8 E(yo / Japan Plane Rectangular CS XIX)-.15 E(<epsg30200> : T)
-110.5 636 Q(rinidad 1903 / T)-.35 E(rinidad Grid)-.35 E
-(<epsg30339> : TC\(1948\) / UTM zone 39N)110.5 648 Q
-(<epsg30340> : TC\(1948\) / UTM zone 40N)110.5 660 Q(<epsg30491> : V)
-110.5 672 Q(oirol 1875 / Nord Algerie \(ancienne\))-1.29 E
-(<epsg30492> : V)110.5 684 Q(oirol 1875 / Sud Algerie \(ancienne\))-1.29
-E(<epsg30493> : V)110.5 696 Q(oirol 1879 / Nord Algerie \(ancienne\))
--1.29 E(<epsg30494> : V)110.5 708 Q
-(oirol 1879 / Sud Algerie \(ancienne\))-1.29 E
-(<epsg30729> : Nord Sahara 1959 / UTM zone 29N)110.5 720 Q
-(MB-System 5.0)72 768 Q(13 March 2014)140.11 E(77)193.45 E 0 Cg EP
-%%Page: 78 78
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<epsg30730> : Nord Sahara 1959 / UTM zone 30N)
-110.5 84 Q(<epsg30731> : Nord Sahara 1959 / UTM zone 31N)110.5 96 Q
-(<epsg30732> : Nord Sahara 1959 / UTM zone 32N)110.5 108 Q
-(<epsg30791> : Nord Sahara 1959 / V)110.5 120 Q(oirol Uni\214e Nord)
--1.29 E(<epsg30792> : Nord Sahara 1959 / V)110.5 132 Q
-(oirol Uni\214e Sud)-1.29 E(<epsg30800> : R)110.5 144 Q
-(T38 2.5 gon W \(deprecated\))-.6 E(<epsg31028> : Y)110.5 156 Q(of)-1.1
-E 2.5(f/U)-.25 G(TM zone 28N)-2.5 E
-(<epsg31121> : Zanderij / UTM zone 21N)110.5 168 Q
-(<epsg31154> : Zanderij / TM 54 NW)110.5 180 Q
-(<epsg31170> : Zanderij / Suriname Old TM)110.5 192 Q
-(<epsg31171> : Zanderij / Suriname TM)110.5 204 Q
-(<epsg31251> : MGI \(Ferro\) / Austria GK W)110.5 216 Q(est Zone)-.8 E
-(<epsg31252> : MGI \(Ferro\) / Austria GK Central Zone)110.5 228 Q
-(<epsg31253> : MGI \(Ferro\) / Austria GK East Zone)110.5 240 Q
-(<epsg31254> : MGI / Austria GK W)110.5 252 Q(est)-.8 E
-(<epsg31255> : MGI / Austria GK Central)110.5 264 Q
-(<epsg31256> : MGI / Austria GK East)110.5 276 Q
-(<epsg31257> : MGI / Austria GK M28)110.5 288 Q
-(<epsg31258> : MGI / Austria GK M31)110.5 300 Q
-(<epsg31259> : MGI / Austria GK M34)110.5 312 Q
-(<epsg31265> : MGI / 3-de)110.5 324 Q(gree Gauss zone 5 \(deprecated\))
--.15 E(<epsg31266> : MGI / 3-de)110.5 336 Q
-(gree Gauss zone 6 \(deprecated\))-.15 E(<epsg31267> : MGI / 3-de)110.5
-348 Q(gree Gauss zone 7 \(deprecated\))-.15 E(<epsg31268> : MGI / 3-de)
-110.5 360 Q(gree Gauss zone 8 \(deprecated\))-.15 E
-(<epsg31275> : MGI / Balkans zone 5)110.5 372 Q
-(<epsg31276> : MGI / Balkans zone 6)110.5 384 Q
-(<epsg31277> : MGI / Balkans zone 7)110.5 396 Q
-(<epsg31278> : MGI / Balkans zone 8 \(deprecated\))110.5 408 Q
-(<epsg31279> : MGI / Balkans zone 8)110.5 420 Q
-(<epsg31281> : MGI \(Ferro\) / Austria W)110.5 432 Q(est Zone)-.8 E
-(<epsg31282> : MGI \(Ferro\) / Austria Central Zone)110.5 444 Q
-(<epsg31283> : MGI \(Ferro\) / Austria East Zone)110.5 456 Q
-(<epsg31284> : MGI / Austria M28)110.5 468 Q
-(<epsg31285> : MGI / Austria M31)110.5 480 Q
-(<epsg31286> : MGI / Austria M34)110.5 492 Q
-(<epsg31287> : MGI / Austria Lambert)110.5 504 Q
-(<epsg31288> : MGI \(Ferro\) / M28)110.5 516 Q
-(<epsg31289> : MGI \(Ferro\) / M31)110.5 528 Q
-(<epsg31290> : MGI \(Ferro\) / M34)110.5 540 Q
-(<epsg31291> : MGI \(Ferro\) / Austria W)110.5 552 Q
-(est Zone \(deprecated\))-.8 E
-(<epsg31292> : MGI \(Ferro\) / Austria Central Zone \(deprecated\))110.5
-564 Q(<epsg31293> : MGI \(Ferro\) / Austria East Zone \(deprecated\))
-110.5 576 Q(<epsg31294> : MGI / M28 \(deprecated\))110.5 588 Q
-(<epsg31295> : MGI / M31 \(deprecated\))110.5 600 Q
-(<epsg31296> : MGI / M34 \(deprecated\))110.5 612 Q
-(<epsg31297> : MGI / Austria Lambert \(deprecated\))110.5 624 Q
-(<epsg31300> : Belge 1972 / Belge Lambert 72)110.5 636 Q
-(<epsg31370> : Belge 1972 / Belgian Lambert 72)110.5 648 Q
-(<epsg31461> : DHDN / 3-de)110.5 660 Q(gree Gauss zone 1 \(deprecated\))
--.15 E(<epsg31462> : DHDN / 3-de)110.5 672 Q
-(gree Gauss zone 2 \(deprecated\))-.15 E(<epsg31463> : DHDN / 3-de)110.5
-684 Q(gree Gauss zone 3 \(deprecated\))-.15 E(<epsg31464> : DHDN / 3-de)
-110.5 696 Q(gree Gauss zone 4 \(deprecated\))-.15 E
-(<epsg31465> : DHDN / 3-de)110.5 708 Q(gree Gauss zone 5 \(deprecated\))
--.15 E(<epsg31466> : DHDN / Gauss-Kruger zone 2)110.5 720 Q
-(MB-System 5.0)72 768 Q(13 March 2014)140.11 E(78)193.45 E 0 Cg EP
-%%Page: 79 79
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<epsg31467> : DHDN / Gauss-Kruger zone 3)110.5
-84 Q(<epsg31468> : DHDN / Gauss-Kruger zone 4)110.5 96 Q
-(<epsg31469> : DHDN / Gauss-Kruger zone 5)110.5 108 Q
-(<epsg31528> : Conakry 1905 / UTM zone 28N)110.5 120 Q
-(<epsg31529> : Conakry 1905 / UTM zone 29N)110.5 132 Q
-(<epsg31600> : Dealul Piscului 1933/ Stereo 33)110.5 144 Q
-(<epsg31700> : Dealul Piscului 1970/ Stereo 70)110.5 156 Q
-(<epsg31838> : NGN / UTM zone 38N)110.5 168 Q
-(<epsg31839> : NGN / UTM zone 39N)110.5 180 Q(<epsg31900> : KUD)110.5
-192 Q(AMS / KTM \(deprecated\))-.4 E(<epsg31901> : KUD)110.5 204 Q
-(AMS / KTM)-.4 E(<epsg31965> : SIRGAS 2000 / UTM zone 11N)110.5 216 Q
-(<epsg31966> : SIRGAS 2000 / UTM zone 12N)110.5 228 Q
-(<epsg31967> : SIRGAS 2000 / UTM zone 13N)110.5 240 Q
-(<epsg31968> : SIRGAS 2000 / UTM zone 14N)110.5 252 Q
-(<epsg31969> : SIRGAS 2000 / UTM zone 15N)110.5 264 Q
-(<epsg31970> : SIRGAS 2000 / UTM zone 16N)110.5 276 Q
-(<epsg31971> : SIRGAS 2000 / UTM zone 17N)110.5 288 Q
-(<epsg31972> : SIRGAS 2000 / UTM zone 18N)110.5 300 Q
-(<epsg31973> : SIRGAS 2000 / UTM zone 19N)110.5 312 Q
-(<epsg31974> : SIRGAS 2000 / UTM zone 20N)110.5 324 Q
-(<epsg31975> : SIRGAS 2000 / UTM zone 21N)110.5 336 Q
-(<epsg31976> : SIRGAS 2000 / UTM zone 22N)110.5 348 Q
-(<epsg31977> : SIRGAS 2000 / UTM zone 17S)110.5 360 Q
-(<epsg31978> : SIRGAS 2000 / UTM zone 18S)110.5 372 Q
-(<epsg31979> : SIRGAS 2000 / UTM zone 19S)110.5 384 Q
-(<epsg31980> : SIRGAS 2000 / UTM zone 20S)110.5 396 Q
-(<epsg31981> : SIRGAS 2000 / UTM zone 21S)110.5 408 Q
-(<epsg31982> : SIRGAS 2000 / UTM zone 22S)110.5 420 Q
-(<epsg31983> : SIRGAS 2000 / UTM zone 23S)110.5 432 Q
-(<epsg31984> : SIRGAS 2000 / UTM zone 24S)110.5 444 Q
-(<epsg31985> : SIRGAS 2000 / UTM zone 25S)110.5 456 Q
-(<epsg31986> : SIRGAS / UTM zone 17N)110.5 468 Q
-(<epsg31987> : SIRGAS / UTM zone 18N)110.5 480 Q
-(<epsg31988> : SIRGAS / UTM zone 19N)110.5 492 Q
-(<epsg31989> : SIRGAS / UTM zone 20N)110.5 504 Q
-(<epsg31990> : SIRGAS / UTM zone 21N)110.5 516 Q
-(<epsg31991> : SIRGAS / UTM zone 22N)110.5 528 Q
-(<epsg31992> : SIRGAS / UTM zone 17S)110.5 540 Q
-(<epsg31993> : SIRGAS / UTM zone 18S)110.5 552 Q
-(<epsg31994> : SIRGAS / UTM zone 19S)110.5 564 Q
-(<epsg31995> : SIRGAS / UTM zone 20S)110.5 576 Q
-(<epsg31996> : SIRGAS / UTM zone 21S)110.5 588 Q
-(<epsg31997> : SIRGAS / UTM zone 22S)110.5 600 Q
-(<epsg31998> : SIRGAS / UTM zone 23S)110.5 612 Q
-(<epsg31999> : SIRGAS / UTM zone 24S)110.5 624 Q
-(<epsg32000> : SIRGAS / UTM zone 25S)110.5 636 Q(<epsg32001> : N)110.5
-648 Q(AD27 / Montana North)-.35 E(<epsg32002> : N)110.5 660 Q
-(AD27 / Montana Central)-.35 E(<epsg32003> : N)110.5 672 Q
-(AD27 / Montana South)-.35 E(<epsg32005> : N)110.5 684 Q
-(AD27 / Nebraska North)-.35 E(<epsg32006> : N)110.5 696 Q
-(AD27 / Nebraska South)-.35 E(<epsg32007> : N)110.5 708 Q(AD27 / Ne)-.35
-E -.25(va)-.25 G(da East).25 E(<epsg32008> : N)110.5 720 Q(AD27 / Ne)
--.35 E -.25(va)-.25 G(da Central).25 E(MB-System 5.0)72 768 Q
-(13 March 2014)140.11 E(79)193.45 E 0 Cg EP
-%%Page: 80 80
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<epsg32009> : N)110.5 84 Q(AD27 / Ne)-.35 E
--.25(va)-.25 G(da W).25 E(est)-.8 E(<epsg32010> : N)110.5 96 Q
-(AD27 / Ne)-.35 E 2.5(wH)-.25 G(ampshire)-2.5 E(<epsg32011> : N)110.5
-108 Q(AD27 / Ne)-.35 E 2.5(wJ)-.25 G(erse)-2.5 E(y)-.15 E
-(<epsg32012> : N)110.5 120 Q(AD27 / Ne)-.35 E 2.5(wM)-.25 G -.15(ex)-2.5
-G(ico East).15 E(<epsg32013> : N)110.5 132 Q(AD27 / Ne)-.35 E 2.5(wM)
--.25 G -.15(ex)-2.5 G(ico Central).15 E(<epsg32014> : N)110.5 144 Q
-(AD27 / Ne)-.35 E 2.5(wM)-.25 G -.15(ex)-2.5 G(ico W).15 E(est)-.8 E
-(<epsg32015> : N)110.5 156 Q(AD27 / Ne)-.35 E 2.5(wY)-.25 G(ork East)
--3.6 E(<epsg32016> : N)110.5 168 Q(AD27 / Ne)-.35 E 2.5(wY)-.25 G
-(ork Central)-3.6 E(<epsg32017> : N)110.5 180 Q(AD27 / Ne)-.35 E 2.5(wY)
--.25 G(ork W)-3.6 E(est)-.8 E(<epsg32018> : N)110.5 192 Q(AD27 / Ne)-.35
-E 2.5(wY)-.25 G(ork Long Island)-3.6 E(<epsg32019> : N)110.5 204 Q
-(AD27 / North Carolina)-.35 E(<epsg32020> : N)110.5 216 Q
-(AD27 / North Dak)-.35 E(ota North)-.1 E(<epsg32021> : N)110.5 228 Q
-(AD27 / North Dak)-.35 E(ota South)-.1 E(<epsg32022> : N)110.5 240 Q
-(AD27 / Ohio North)-.35 E(<epsg32023> : N)110.5 252 Q(AD27 / Ohio South)
--.35 E(<epsg32024> : N)110.5 264 Q(AD27 / Oklahoma North)-.35 E
-(<epsg32025> : N)110.5 276 Q(AD27 / Oklahoma South)-.35 E
-(<epsg32026> : N)110.5 288 Q(AD27 / Ore)-.35 E(gon North)-.15 E
-(<epsg32027> : N)110.5 300 Q(AD27 / Ore)-.35 E(gon South)-.15 E
-(<epsg32028> : N)110.5 312 Q(AD27 / Pennsylv)-.35 E(ania North)-.25 E
-(<epsg32029> : N)110.5 324 Q(AD27 / Pennsylv)-.35 E(ania South)-.25 E
-(<epsg32030> : N)110.5 336 Q(AD27 / Rhode Island)-.35 E(<epsg32031> : N)
-110.5 348 Q(AD27 / South Carolina North)-.35 E(<epsg32033> : N)110.5 360
-Q(AD27 / South Carolina South)-.35 E(<epsg32034> : N)110.5 372 Q
-(AD27 / South Dak)-.35 E(ota North)-.1 E(<epsg32035> : N)110.5 384 Q
-(AD27 / South Dak)-.35 E(ota South)-.1 E(<epsg32036> : N)110.5 396 Q
-(AD27 / T)-.35 E(ennessee \(deprecated\))-.7 E(<epsg32037> : N)110.5 408
-Q(AD27 / T)-.35 E -.15(ex)-.7 G(as North).15 E(<epsg32038> : N)110.5 420
-Q(AD27 / T)-.35 E -.15(ex)-.7 G(as North Central).15 E(<epsg32039> : N)
-110.5 432 Q(AD27 / T)-.35 E -.15(ex)-.7 G(as Central).15 E
-(<epsg32040> : N)110.5 444 Q(AD27 / T)-.35 E -.15(ex)-.7 G
-(as South Central).15 E(<epsg32041> : N)110.5 456 Q(AD27 / T)-.35 E -.15
-(ex)-.7 G(as South).15 E(<epsg32042> : N)110.5 468 Q(AD27 / Utah North)
--.35 E(<epsg32043> : N)110.5 480 Q(AD27 / Utah Central)-.35 E
-(<epsg32044> : N)110.5 492 Q(AD27 / Utah South)-.35 E(<epsg32045> : N)
-110.5 504 Q(AD27 / V)-.35 E(ermont)-1.11 E(<epsg32046> : N)110.5 516 Q
-(AD27 / V)-.35 E(ir)-.6 E(ginia North)-.18 E(<epsg32047> : N)110.5 528 Q
-(AD27 / V)-.35 E(ir)-.6 E(ginia South)-.18 E(<epsg32048> : N)110.5 540 Q
-(AD27 / W)-.35 E(ashington North)-.8 E(<epsg32049> : N)110.5 552 Q
-(AD27 / W)-.35 E(ashington South)-.8 E(<epsg32050> : N)110.5 564 Q
-(AD27 / W)-.35 E(est V)-.8 E(ir)-.6 E(ginia North)-.18 E
-(<epsg32051> : N)110.5 576 Q(AD27 / W)-.35 E(est V)-.8 E(ir)-.6 E
-(ginia South)-.18 E(<epsg32052> : N)110.5 588 Q(AD27 / W)-.35 E
-(isconsin North)-.4 E(<epsg32053> : N)110.5 600 Q(AD27 / W)-.35 E
-(isconsin Central)-.4 E(<epsg32054> : N)110.5 612 Q(AD27 / W)-.35 E
-(isconsin South)-.4 E(<epsg32055> : N)110.5 624 Q(AD27 / W)-.35 E
-(yoming East)-.73 E(<epsg32056> : N)110.5 636 Q(AD27 / W)-.35 E
-(yoming East Central)-.73 E(<epsg32057> : N)110.5 648 Q(AD27 / W)-.35 E
-(yoming W)-.73 E(est Central)-.8 E(<epsg32058> : N)110.5 660 Q(AD27 / W)
--.35 E(yoming W)-.73 E(est)-.8 E(<epsg32061> : N)110.5 672 Q
-(AD27 / Guatemala Norte)-.35 E(<epsg32062> : N)110.5 684 Q
-(AD27 / Guatemala Sur)-.35 E(<epsg32064> : N)110.5 696 Q
-(AD27 / BLM 14N \(ftUS\))-.35 E(<epsg32065> : N)110.5 708 Q
-(AD27 / BLM 15N \(ftUS\))-.35 E(<epsg32066> : N)110.5 720 Q
-(AD27 / BLM 16N \(ftUS\))-.35 E(MB-System 5.0)72 768 Q(13 March 2014)
-140.11 E(80)193.45 E 0 Cg EP
-%%Page: 81 81
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<epsg32067> : N)110.5 84 Q
-(AD27 / BLM 17N \(ftUS\))-.35 E(<epsg32074> : N)110.5 96 Q
-(AD27 / BLM 14N \(feet\) \(deprecated\))-.35 E(<epsg32075> : N)110.5 108
-Q(AD27 / BLM 15N \(feet\) \(deprecated\))-.35 E(<epsg32076> : N)110.5
-120 Q(AD27 / BLM 16N \(feet\) \(deprecated\))-.35 E(<epsg32077> : N)
-110.5 132 Q(AD27 / BLM 17N \(feet\) \(deprecated\))-.35 E
-(<epsg32081> : N)110.5 144 Q(AD27 / MTM zone 1)-.35 E(<epsg32082> : N)
-110.5 156 Q(AD27 / MTM zone 2)-.35 E(<epsg32083> : N)110.5 168 Q
-(AD27 / MTM zone 3)-.35 E(<epsg32084> : N)110.5 180 Q(AD27 / MTM zone 4)
--.35 E(<epsg32085> : N)110.5 192 Q(AD27 / MTM zone 5)-.35 E
-(<epsg32086> : N)110.5 204 Q(AD27 / MTM zone 6)-.35 E(<epsg32098> : N)
-110.5 216 Q(AD27 / Quebec Lambert)-.35 E(<epsg32099> : N)110.5 228 Q
-(AD27 / Louisiana Of)-.35 E(fshore)-.25 E(<epsg32100> : N)110.5 240 Q
-(AD83 / Montana)-.35 E(<epsg32104> : N)110.5 252 Q(AD83 / Nebraska)-.35
-E(<epsg32107> : N)110.5 264 Q(AD83 / Ne)-.35 E -.25(va)-.25 G(da East)
-.25 E(<epsg32108> : N)110.5 276 Q(AD83 / Ne)-.35 E -.25(va)-.25 G
-(da Central).25 E(<epsg32109> : N)110.5 288 Q(AD83 / Ne)-.35 E -.25(va)
--.25 G(da W).25 E(est)-.8 E(<epsg32110> : N)110.5 300 Q(AD83 / Ne)-.35 E
-2.5(wH)-.25 G(ampshire)-2.5 E(<epsg32111> : N)110.5 312 Q(AD83 / Ne)-.35
-E 2.5(wJ)-.25 G(erse)-2.5 E(y)-.15 E(<epsg32112> : N)110.5 324 Q
-(AD83 / Ne)-.35 E 2.5(wM)-.25 G -.15(ex)-2.5 G(ico East).15 E
-(<epsg32113> : N)110.5 336 Q(AD83 / Ne)-.35 E 2.5(wM)-.25 G -.15(ex)-2.5
-G(ico Central).15 E(<epsg32114> : N)110.5 348 Q(AD83 / Ne)-.35 E 2.5(wM)
--.25 G -.15(ex)-2.5 G(ico W).15 E(est)-.8 E(<epsg32115> : N)110.5 360 Q
-(AD83 / Ne)-.35 E 2.5(wY)-.25 G(ork East)-3.6 E(<epsg32116> : N)110.5
-372 Q(AD83 / Ne)-.35 E 2.5(wY)-.25 G(ork Central)-3.6 E(<epsg32117> : N)
-110.5 384 Q(AD83 / Ne)-.35 E 2.5(wY)-.25 G(ork W)-3.6 E(est)-.8 E
-(<epsg32118> : N)110.5 396 Q(AD83 / Ne)-.35 E 2.5(wY)-.25 G
-(ork Long Island)-3.6 E(<epsg32119> : N)110.5 408 Q
-(AD83 / North Carolina)-.35 E(<epsg32120> : N)110.5 420 Q
-(AD83 / North Dak)-.35 E(ota North)-.1 E(<epsg32121> : N)110.5 432 Q
-(AD83 / North Dak)-.35 E(ota South)-.1 E(<epsg32122> : N)110.5 444 Q
-(AD83 / Ohio North)-.35 E(<epsg32123> : N)110.5 456 Q(AD83 / Ohio South)
--.35 E(<epsg32124> : N)110.5 468 Q(AD83 / Oklahoma North)-.35 E
-(<epsg32125> : N)110.5 480 Q(AD83 / Oklahoma South)-.35 E
-(<epsg32126> : N)110.5 492 Q(AD83 / Ore)-.35 E(gon North)-.15 E
-(<epsg32127> : N)110.5 504 Q(AD83 / Ore)-.35 E(gon South)-.15 E
-(<epsg32128> : N)110.5 516 Q(AD83 / Pennsylv)-.35 E(ania North)-.25 E
-(<epsg32129> : N)110.5 528 Q(AD83 / Pennsylv)-.35 E(ania South)-.25 E
-(<epsg32130> : N)110.5 540 Q(AD83 / Rhode Island)-.35 E(<epsg32133> : N)
-110.5 552 Q(AD83 / South Carolina)-.35 E(<epsg32134> : N)110.5 564 Q
-(AD83 / South Dak)-.35 E(ota North)-.1 E(<epsg32135> : N)110.5 576 Q
-(AD83 / South Dak)-.35 E(ota South)-.1 E(<epsg32136> : N)110.5 588 Q
-(AD83 / T)-.35 E(ennessee)-.7 E(<epsg32137> : N)110.5 600 Q(AD83 / T)
--.35 E -.15(ex)-.7 G(as North).15 E(<epsg32138> : N)110.5 612 Q
-(AD83 / T)-.35 E -.15(ex)-.7 G(as North Central).15 E(<epsg32139> : N)
-110.5 624 Q(AD83 / T)-.35 E -.15(ex)-.7 G(as Central).15 E
-(<epsg32140> : N)110.5 636 Q(AD83 / T)-.35 E -.15(ex)-.7 G
-(as South Central).15 E(<epsg32141> : N)110.5 648 Q(AD83 / T)-.35 E -.15
-(ex)-.7 G(as South).15 E(<epsg32142> : N)110.5 660 Q(AD83 / Utah North)
--.35 E(<epsg32143> : N)110.5 672 Q(AD83 / Utah Central)-.35 E
-(<epsg32144> : N)110.5 684 Q(AD83 / Utah South)-.35 E(<epsg32145> : N)
-110.5 696 Q(AD83 / V)-.35 E(ermont)-1.11 E(<epsg32146> : N)110.5 708 Q
-(AD83 / V)-.35 E(ir)-.6 E(ginia North)-.18 E(<epsg32147> : N)110.5 720 Q
-(AD83 / V)-.35 E(ir)-.6 E(ginia South)-.18 E(MB-System 5.0)72 768 Q
-(13 March 2014)140.11 E(81)193.45 E 0 Cg EP
-%%Page: 82 82
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<epsg32148> : N)110.5 84 Q(AD83 / W)-.35 E
-(ashington North)-.8 E(<epsg32149> : N)110.5 96 Q(AD83 / W)-.35 E
-(ashington South)-.8 E(<epsg32150> : N)110.5 108 Q(AD83 / W)-.35 E
-(est V)-.8 E(ir)-.6 E(ginia North)-.18 E(<epsg32151> : N)110.5 120 Q
-(AD83 / W)-.35 E(est V)-.8 E(ir)-.6 E(ginia South)-.18 E
-(<epsg32152> : N)110.5 132 Q(AD83 / W)-.35 E(isconsin North)-.4 E
-(<epsg32153> : N)110.5 144 Q(AD83 / W)-.35 E(isconsin Central)-.4 E
-(<epsg32154> : N)110.5 156 Q(AD83 / W)-.35 E(isconsin South)-.4 E
-(<epsg32155> : N)110.5 168 Q(AD83 / W)-.35 E(yoming East)-.73 E
-(<epsg32156> : N)110.5 180 Q(AD83 / W)-.35 E(yoming East Central)-.73 E
-(<epsg32157> : N)110.5 192 Q(AD83 / W)-.35 E(yoming W)-.73 E
-(est Central)-.8 E(<epsg32158> : N)110.5 204 Q(AD83 / W)-.35 E(yoming W)
--.73 E(est)-.8 E(<epsg32161> : N)110.5 216 Q(AD83 / Puerto Rico & V)-.35
-E(ir)-.6 E(gin Is.)-.18 E(<epsg32164> : N)110.5 228 Q
-(AD83 / BLM 14N \(ftUS\))-.35 E(<epsg32165> : N)110.5 240 Q
-(AD83 / BLM 15N \(ftUS\))-.35 E(<epsg32166> : N)110.5 252 Q
-(AD83 / BLM 16N \(ftUS\))-.35 E(<epsg32167> : N)110.5 264 Q
-(AD83 / BLM 17N \(ftUS\))-.35 E(<epsg32180> : N)110.5 276 Q
-(AD83 / SCoPQ zone 2)-.35 E(<epsg32181> : N)110.5 288 Q
-(AD83 / MTM zone 1)-.35 E(<epsg32182> : N)110.5 300 Q(AD83 / MTM zone 2)
--.35 E(<epsg32183> : N)110.5 312 Q(AD83 / MTM zone 3)-.35 E
-(<epsg32184> : N)110.5 324 Q(AD83 / MTM zone 4)-.35 E(<epsg32185> : N)
-110.5 336 Q(AD83 / MTM zone 5)-.35 E(<epsg32186> : N)110.5 348 Q
-(AD83 / MTM zone 6)-.35 E(<epsg32187> : N)110.5 360 Q(AD83 / MTM zone 7)
--.35 E(<epsg32188> : N)110.5 372 Q(AD83 / MTM zone 8)-.35 E
-(<epsg32189> : N)110.5 384 Q(AD83 / MTM zone 9)-.35 E(<epsg32190> : N)
-110.5 396 Q(AD83 / MTM zone 10)-.35 E(<epsg32191> : N)110.5 408 Q
-(AD83 / MTM zone 11)-.35 E(<epsg32192> : N)110.5 420 Q
-(AD83 / MTM zone 12)-.35 E(<epsg32193> : N)110.5 432 Q
-(AD83 / MTM zone 13)-.35 E(<epsg32194> : N)110.5 444 Q
-(AD83 / MTM zone 14)-.35 E(<epsg32195> : N)110.5 456 Q
-(AD83 / MTM zone 15)-.35 E(<epsg32196> : N)110.5 468 Q
-(AD83 / MTM zone 16)-.35 E(<epsg32197> : N)110.5 480 Q
-(AD83 / MTM zone 17)-.35 E(<epsg32198> : N)110.5 492 Q
-(AD83 / Quebec Lambert)-.35 E(<epsg32199> : N)110.5 504 Q
-(AD83 / Louisiana Of)-.35 E(fshore)-.25 E
-(<epsg32201> : WGS 72 / UTM zone 1N)110.5 516 Q
-(<epsg32202> : WGS 72 / UTM zone 2N)110.5 528 Q
-(<epsg32203> : WGS 72 / UTM zone 3N)110.5 540 Q
-(<epsg32204> : WGS 72 / UTM zone 4N)110.5 552 Q
-(<epsg32205> : WGS 72 / UTM zone 5N)110.5 564 Q
-(<epsg32206> : WGS 72 / UTM zone 6N)110.5 576 Q
-(<epsg32207> : WGS 72 / UTM zone 7N)110.5 588 Q
-(<epsg32208> : WGS 72 / UTM zone 8N)110.5 600 Q
-(<epsg32209> : WGS 72 / UTM zone 9N)110.5 612 Q
-(<epsg32210> : WGS 72 / UTM zone 10N)110.5 624 Q
-(<epsg32211> : WGS 72 / UTM zone 11N)110.5 636 Q
-(<epsg32212> : WGS 72 / UTM zone 12N)110.5 648 Q
-(<epsg32213> : WGS 72 / UTM zone 13N)110.5 660 Q
-(<epsg32214> : WGS 72 / UTM zone 14N)110.5 672 Q
-(<epsg32215> : WGS 72 / UTM zone 15N)110.5 684 Q
-(<epsg32216> : WGS 72 / UTM zone 16N)110.5 696 Q
-(<epsg32217> : WGS 72 / UTM zone 17N)110.5 708 Q
-(<epsg32218> : WGS 72 / UTM zone 18N)110.5 720 Q(MB-System 5.0)72 768 Q
-(13 March 2014)140.11 E(82)193.45 E 0 Cg EP
-%%Page: 83 83
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<epsg32219> : WGS 72 / UTM zone 19N)110.5 84 Q
-(<epsg32220> : WGS 72 / UTM zone 20N)110.5 96 Q
-(<epsg32221> : WGS 72 / UTM zone 21N)110.5 108 Q
-(<epsg32222> : WGS 72 / UTM zone 22N)110.5 120 Q
-(<epsg32223> : WGS 72 / UTM zone 23N)110.5 132 Q
-(<epsg32224> : WGS 72 / UTM zone 24N)110.5 144 Q
-(<epsg32225> : WGS 72 / UTM zone 25N)110.5 156 Q
-(<epsg32226> : WGS 72 / UTM zone 26N)110.5 168 Q
-(<epsg32227> : WGS 72 / UTM zone 27N)110.5 180 Q
-(<epsg32228> : WGS 72 / UTM zone 28N)110.5 192 Q
-(<epsg32229> : WGS 72 / UTM zone 29N)110.5 204 Q
-(<epsg32230> : WGS 72 / UTM zone 30N)110.5 216 Q
-(<epsg32231> : WGS 72 / UTM zone 31N)110.5 228 Q
-(<epsg32232> : WGS 72 / UTM zone 32N)110.5 240 Q
-(<epsg32233> : WGS 72 / UTM zone 33N)110.5 252 Q
-(<epsg32234> : WGS 72 / UTM zone 34N)110.5 264 Q
-(<epsg32235> : WGS 72 / UTM zone 35N)110.5 276 Q
-(<epsg32236> : WGS 72 / UTM zone 36N)110.5 288 Q
-(<epsg32237> : WGS 72 / UTM zone 37N)110.5 300 Q
-(<epsg32238> : WGS 72 / UTM zone 38N)110.5 312 Q
-(<epsg32239> : WGS 72 / UTM zone 39N)110.5 324 Q
-(<epsg32240> : WGS 72 / UTM zone 40N)110.5 336 Q
-(<epsg32241> : WGS 72 / UTM zone 41N)110.5 348 Q
-(<epsg32242> : WGS 72 / UTM zone 42N)110.5 360 Q
-(<epsg32243> : WGS 72 / UTM zone 43N)110.5 372 Q
-(<epsg32244> : WGS 72 / UTM zone 44N)110.5 384 Q
-(<epsg32245> : WGS 72 / UTM zone 45N)110.5 396 Q
-(<epsg32246> : WGS 72 / UTM zone 46N)110.5 408 Q
-(<epsg32247> : WGS 72 / UTM zone 47N)110.5 420 Q
-(<epsg32248> : WGS 72 / UTM zone 48N)110.5 432 Q
-(<epsg32249> : WGS 72 / UTM zone 49N)110.5 444 Q
-(<epsg32250> : WGS 72 / UTM zone 50N)110.5 456 Q
-(<epsg32251> : WGS 72 / UTM zone 51N)110.5 468 Q
-(<epsg32252> : WGS 72 / UTM zone 52N)110.5 480 Q
-(<epsg32253> : WGS 72 / UTM zone 53N)110.5 492 Q
-(<epsg32254> : WGS 72 / UTM zone 54N)110.5 504 Q
-(<epsg32255> : WGS 72 / UTM zone 55N)110.5 516 Q
-(<epsg32256> : WGS 72 / UTM zone 56N)110.5 528 Q
-(<epsg32257> : WGS 72 / UTM zone 57N)110.5 540 Q
-(<epsg32258> : WGS 72 / UTM zone 58N)110.5 552 Q
-(<epsg32259> : WGS 72 / UTM zone 59N)110.5 564 Q
-(<epsg32260> : WGS 72 / UTM zone 60N)110.5 576 Q
-(<epsg32301> : WGS 72 / UTM zone 1S)110.5 588 Q
-(<epsg32302> : WGS 72 / UTM zone 2S)110.5 600 Q
-(<epsg32303> : WGS 72 / UTM zone 3S)110.5 612 Q
-(<epsg32304> : WGS 72 / UTM zone 4S)110.5 624 Q
-(<epsg32305> : WGS 72 / UTM zone 5S)110.5 636 Q
-(<epsg32306> : WGS 72 / UTM zone 6S)110.5 648 Q
-(<epsg32307> : WGS 72 / UTM zone 7S)110.5 660 Q
-(<epsg32308> : WGS 72 / UTM zone 8S)110.5 672 Q
-(<epsg32309> : WGS 72 / UTM zone 9S)110.5 684 Q
-(<epsg32310> : WGS 72 / UTM zone 10S)110.5 696 Q
-(<epsg32311> : WGS 72 / UTM zone 11S)110.5 708 Q
-(<epsg32312> : WGS 72 / UTM zone 12S)110.5 720 Q(MB-System 5.0)72 768 Q
-(13 March 2014)140.11 E(83)193.45 E 0 Cg EP
-%%Page: 84 84
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<epsg32313> : WGS 72 / UTM zone 13S)110.5 84 Q
-(<epsg32314> : WGS 72 / UTM zone 14S)110.5 96 Q
-(<epsg32315> : WGS 72 / UTM zone 15S)110.5 108 Q
-(<epsg32316> : WGS 72 / UTM zone 16S)110.5 120 Q
-(<epsg32317> : WGS 72 / UTM zone 17S)110.5 132 Q
-(<epsg32318> : WGS 72 / UTM zone 18S)110.5 144 Q
-(<epsg32319> : WGS 72 / UTM zone 19S)110.5 156 Q
-(<epsg32320> : WGS 72 / UTM zone 20S)110.5 168 Q
-(<epsg32321> : WGS 72 / UTM zone 21S)110.5 180 Q
-(<epsg32322> : WGS 72 / UTM zone 22S)110.5 192 Q
-(<epsg32323> : WGS 72 / UTM zone 23S)110.5 204 Q
-(<epsg32324> : WGS 72 / UTM zone 24S)110.5 216 Q
-(<epsg32325> : WGS 72 / UTM zone 25S)110.5 228 Q
-(<epsg32326> : WGS 72 / UTM zone 26S)110.5 240 Q
-(<epsg32327> : WGS 72 / UTM zone 27S)110.5 252 Q
-(<epsg32328> : WGS 72 / UTM zone 28S)110.5 264 Q
-(<epsg32329> : WGS 72 / UTM zone 29S)110.5 276 Q
-(<epsg32330> : WGS 72 / UTM zone 30S)110.5 288 Q
-(<epsg32331> : WGS 72 / UTM zone 31S)110.5 300 Q
-(<epsg32332> : WGS 72 / UTM zone 32S)110.5 312 Q
-(<epsg32333> : WGS 72 / UTM zone 33S)110.5 324 Q
-(<epsg32334> : WGS 72 / UTM zone 34S)110.5 336 Q
-(<epsg32335> : WGS 72 / UTM zone 35S)110.5 348 Q
-(<epsg32336> : WGS 72 / UTM zone 36S)110.5 360 Q
-(<epsg32337> : WGS 72 / UTM zone 37S)110.5 372 Q
-(<epsg32338> : WGS 72 / UTM zone 38S)110.5 384 Q
-(<epsg32339> : WGS 72 / UTM zone 39S)110.5 396 Q
-(<epsg32340> : WGS 72 / UTM zone 40S)110.5 408 Q
-(<epsg32341> : WGS 72 / UTM zone 41S)110.5 420 Q
-(<epsg32342> : WGS 72 / UTM zone 42S)110.5 432 Q
-(<epsg32343> : WGS 72 / UTM zone 43S)110.5 444 Q
-(<epsg32344> : WGS 72 / UTM zone 44S)110.5 456 Q
-(<epsg32345> : WGS 72 / UTM zone 45S)110.5 468 Q
-(<epsg32346> : WGS 72 / UTM zone 46S)110.5 480 Q
-(<epsg32347> : WGS 72 / UTM zone 47S)110.5 492 Q
-(<epsg32348> : WGS 72 / UTM zone 48S)110.5 504 Q
-(<epsg32349> : WGS 72 / UTM zone 49S)110.5 516 Q
-(<epsg32350> : WGS 72 / UTM zone 50S)110.5 528 Q
-(<epsg32351> : WGS 72 / UTM zone 51S)110.5 540 Q
-(<epsg32352> : WGS 72 / UTM zone 52S)110.5 552 Q
-(<epsg32353> : WGS 72 / UTM zone 53S)110.5 564 Q
-(<epsg32354> : WGS 72 / UTM zone 54S)110.5 576 Q
-(<epsg32355> : WGS 72 / UTM zone 55S)110.5 588 Q
-(<epsg32356> : WGS 72 / UTM zone 56S)110.5 600 Q
-(<epsg32357> : WGS 72 / UTM zone 57S)110.5 612 Q
-(<epsg32358> : WGS 72 / UTM zone 58S)110.5 624 Q
-(<epsg32359> : WGS 72 / UTM zone 59S)110.5 636 Q
-(<epsg32360> : WGS 72 / UTM zone 60S)110.5 648 Q
-(<epsg32401> : WGS 72BE / UTM zone 1N)110.5 660 Q
-(<epsg32402> : WGS 72BE / UTM zone 2N)110.5 672 Q
-(<epsg32403> : WGS 72BE / UTM zone 3N)110.5 684 Q
-(<epsg32404> : WGS 72BE / UTM zone 4N)110.5 696 Q
-(<epsg32405> : WGS 72BE / UTM zone 5N)110.5 708 Q
-(<epsg32406> : WGS 72BE / UTM zone 6N)110.5 720 Q(MB-System 5.0)72 768 Q
-(13 March 2014)140.11 E(84)193.45 E 0 Cg EP
-%%Page: 85 85
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<epsg32407> : WGS 72BE / UTM zone 7N)110.5 84 Q
-(<epsg32408> : WGS 72BE / UTM zone 8N)110.5 96 Q
-(<epsg32409> : WGS 72BE / UTM zone 9N)110.5 108 Q
-(<epsg32410> : WGS 72BE / UTM zone 10N)110.5 120 Q
-(<epsg32411> : WGS 72BE / UTM zone 11N)110.5 132 Q
-(<epsg32412> : WGS 72BE / UTM zone 12N)110.5 144 Q
-(<epsg32413> : WGS 72BE / UTM zone 13N)110.5 156 Q
-(<epsg32414> : WGS 72BE / UTM zone 14N)110.5 168 Q
-(<epsg32415> : WGS 72BE / UTM zone 15N)110.5 180 Q
-(<epsg32416> : WGS 72BE / UTM zone 16N)110.5 192 Q
-(<epsg32417> : WGS 72BE / UTM zone 17N)110.5 204 Q
-(<epsg32418> : WGS 72BE / UTM zone 18N)110.5 216 Q
-(<epsg32419> : WGS 72BE / UTM zone 19N)110.5 228 Q
-(<epsg32420> : WGS 72BE / UTM zone 20N)110.5 240 Q
-(<epsg32421> : WGS 72BE / UTM zone 21N)110.5 252 Q
-(<epsg32422> : WGS 72BE / UTM zone 22N)110.5 264 Q
-(<epsg32423> : WGS 72BE / UTM zone 23N)110.5 276 Q
-(<epsg32424> : WGS 72BE / UTM zone 24N)110.5 288 Q
-(<epsg32425> : WGS 72BE / UTM zone 25N)110.5 300 Q
-(<epsg32426> : WGS 72BE / UTM zone 26N)110.5 312 Q
-(<epsg32427> : WGS 72BE / UTM zone 27N)110.5 324 Q
-(<epsg32428> : WGS 72BE / UTM zone 28N)110.5 336 Q
-(<epsg32429> : WGS 72BE / UTM zone 29N)110.5 348 Q
-(<epsg32430> : WGS 72BE / UTM zone 30N)110.5 360 Q
-(<epsg32431> : WGS 72BE / UTM zone 31N)110.5 372 Q
-(<epsg32432> : WGS 72BE / UTM zone 32N)110.5 384 Q
-(<epsg32433> : WGS 72BE / UTM zone 33N)110.5 396 Q
-(<epsg32434> : WGS 72BE / UTM zone 34N)110.5 408 Q
-(<epsg32435> : WGS 72BE / UTM zone 35N)110.5 420 Q
-(<epsg32436> : WGS 72BE / UTM zone 36N)110.5 432 Q
-(<epsg32437> : WGS 72BE / UTM zone 37N)110.5 444 Q
-(<epsg32438> : WGS 72BE / UTM zone 38N)110.5 456 Q
-(<epsg32439> : WGS 72BE / UTM zone 39N)110.5 468 Q
-(<epsg32440> : WGS 72BE / UTM zone 40N)110.5 480 Q
-(<epsg32441> : WGS 72BE / UTM zone 41N)110.5 492 Q
-(<epsg32442> : WGS 72BE / UTM zone 42N)110.5 504 Q
-(<epsg32443> : WGS 72BE / UTM zone 43N)110.5 516 Q
-(<epsg32444> : WGS 72BE / UTM zone 44N)110.5 528 Q
-(<epsg32445> : WGS 72BE / UTM zone 45N)110.5 540 Q
-(<epsg32446> : WGS 72BE / UTM zone 46N)110.5 552 Q
-(<epsg32447> : WGS 72BE / UTM zone 47N)110.5 564 Q
-(<epsg32448> : WGS 72BE / UTM zone 48N)110.5 576 Q
-(<epsg32449> : WGS 72BE / UTM zone 49N)110.5 588 Q
-(<epsg32450> : WGS 72BE / UTM zone 50N)110.5 600 Q
-(<epsg32451> : WGS 72BE / UTM zone 51N)110.5 612 Q
-(<epsg32452> : WGS 72BE / UTM zone 52N)110.5 624 Q
-(<epsg32453> : WGS 72BE / UTM zone 53N)110.5 636 Q
-(<epsg32454> : WGS 72BE / UTM zone 54N)110.5 648 Q
-(<epsg32455> : WGS 72BE / UTM zone 55N)110.5 660 Q
-(<epsg32456> : WGS 72BE / UTM zone 56N)110.5 672 Q
-(<epsg32457> : WGS 72BE / UTM zone 57N)110.5 684 Q
-(<epsg32458> : WGS 72BE / UTM zone 58N)110.5 696 Q
-(<epsg32459> : WGS 72BE / UTM zone 59N)110.5 708 Q
-(<epsg32460> : WGS 72BE / UTM zone 60N)110.5 720 Q(MB-System 5.0)72 768
-Q(13 March 2014)140.11 E(85)193.45 E 0 Cg EP
-%%Page: 86 86
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<epsg32501> : WGS 72BE / UTM zone 1S)110.5 84 Q
-(<epsg32502> : WGS 72BE / UTM zone 2S)110.5 96 Q
-(<epsg32503> : WGS 72BE / UTM zone 3S)110.5 108 Q
-(<epsg32504> : WGS 72BE / UTM zone 4S)110.5 120 Q
-(<epsg32505> : WGS 72BE / UTM zone 5S)110.5 132 Q
-(<epsg32506> : WGS 72BE / UTM zone 6S)110.5 144 Q
-(<epsg32507> : WGS 72BE / UTM zone 7S)110.5 156 Q
-(<epsg32508> : WGS 72BE / UTM zone 8S)110.5 168 Q
-(<epsg32509> : WGS 72BE / UTM zone 9S)110.5 180 Q
-(<epsg32510> : WGS 72BE / UTM zone 10S)110.5 192 Q
-(<epsg32511> : WGS 72BE / UTM zone 11S)110.5 204 Q
-(<epsg32512> : WGS 72BE / UTM zone 12S)110.5 216 Q
-(<epsg32513> : WGS 72BE / UTM zone 13S)110.5 228 Q
-(<epsg32514> : WGS 72BE / UTM zone 14S)110.5 240 Q
-(<epsg32515> : WGS 72BE / UTM zone 15S)110.5 252 Q
-(<epsg32516> : WGS 72BE / UTM zone 16S)110.5 264 Q
-(<epsg32517> : WGS 72BE / UTM zone 17S)110.5 276 Q
-(<epsg32518> : WGS 72BE / UTM zone 18S)110.5 288 Q
-(<epsg32519> : WGS 72BE / UTM zone 19S)110.5 300 Q
-(<epsg32520> : WGS 72BE / UTM zone 20S)110.5 312 Q
-(<epsg32521> : WGS 72BE / UTM zone 21S)110.5 324 Q
-(<epsg32522> : WGS 72BE / UTM zone 22S)110.5 336 Q
-(<epsg32523> : WGS 72BE / UTM zone 23S)110.5 348 Q
-(<epsg32524> : WGS 72BE / UTM zone 24S)110.5 360 Q
-(<epsg32525> : WGS 72BE / UTM zone 25S)110.5 372 Q
-(<epsg32526> : WGS 72BE / UTM zone 26S)110.5 384 Q
-(<epsg32527> : WGS 72BE / UTM zone 27S)110.5 396 Q
-(<epsg32528> : WGS 72BE / UTM zone 28S)110.5 408 Q
-(<epsg32529> : WGS 72BE / UTM zone 29S)110.5 420 Q
-(<epsg32530> : WGS 72BE / UTM zone 30S)110.5 432 Q
-(<epsg32531> : WGS 72BE / UTM zone 31S)110.5 444 Q
-(<epsg32532> : WGS 72BE / UTM zone 32S)110.5 456 Q
-(<epsg32533> : WGS 72BE / UTM zone 33S)110.5 468 Q
-(<epsg32534> : WGS 72BE / UTM zone 34S)110.5 480 Q
-(<epsg32535> : WGS 72BE / UTM zone 35S)110.5 492 Q
-(<epsg32536> : WGS 72BE / UTM zone 36S)110.5 504 Q
-(<epsg32537> : WGS 72BE / UTM zone 37S)110.5 516 Q
-(<epsg32538> : WGS 72BE / UTM zone 38S)110.5 528 Q
-(<epsg32539> : WGS 72BE / UTM zone 39S)110.5 540 Q
-(<epsg32540> : WGS 72BE / UTM zone 40S)110.5 552 Q
-(<epsg32541> : WGS 72BE / UTM zone 41S)110.5 564 Q
-(<epsg32542> : WGS 72BE / UTM zone 42S)110.5 576 Q
-(<epsg32543> : WGS 72BE / UTM zone 43S)110.5 588 Q
-(<epsg32544> : WGS 72BE / UTM zone 44S)110.5 600 Q
-(<epsg32545> : WGS 72BE / UTM zone 45S)110.5 612 Q
-(<epsg32546> : WGS 72BE / UTM zone 46S)110.5 624 Q
-(<epsg32547> : WGS 72BE / UTM zone 47S)110.5 636 Q
-(<epsg32548> : WGS 72BE / UTM zone 48S)110.5 648 Q
-(<epsg32549> : WGS 72BE / UTM zone 49S)110.5 660 Q
-(<epsg32550> : WGS 72BE / UTM zone 50S)110.5 672 Q
-(<epsg32551> : WGS 72BE / UTM zone 51S)110.5 684 Q
-(<epsg32552> : WGS 72BE / UTM zone 52S)110.5 696 Q
-(<epsg32553> : WGS 72BE / UTM zone 53S)110.5 708 Q
-(<epsg32554> : WGS 72BE / UTM zone 54S)110.5 720 Q(MB-System 5.0)72 768
-Q(13 March 2014)140.11 E(86)193.45 E 0 Cg EP
-%%Page: 87 87
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<epsg32555> : WGS 72BE / UTM zone 55S)110.5 84
-Q(<epsg32556> : WGS 72BE / UTM zone 56S)110.5 96 Q
-(<epsg32557> : WGS 72BE / UTM zone 57S)110.5 108 Q
-(<epsg32558> : WGS 72BE / UTM zone 58S)110.5 120 Q
-(<epsg32559> : WGS 72BE / UTM zone 59S)110.5 132 Q
-(<epsg32560> : WGS 72BE / UTM zone 60S)110.5 144 Q
-(<epsg32601> : WGS 84 / UTM zone 1N)110.5 156 Q
-(<epsg32602> : WGS 84 / UTM zone 2N)110.5 168 Q
-(<epsg32603> : WGS 84 / UTM zone 3N)110.5 180 Q
-(<epsg32604> : WGS 84 / UTM zone 4N)110.5 192 Q
-(<epsg32605> : WGS 84 / UTM zone 5N)110.5 204 Q
-(<epsg32606> : WGS 84 / UTM zone 6N)110.5 216 Q
-(<epsg32607> : WGS 84 / UTM zone 7N)110.5 228 Q
-(<epsg32608> : WGS 84 / UTM zone 8N)110.5 240 Q
-(<epsg32609> : WGS 84 / UTM zone 9N)110.5 252 Q
-(<epsg32610> : WGS 84 / UTM zone 10N)110.5 264 Q
-(<epsg32611> : WGS 84 / UTM zone 11N)110.5 276 Q
-(<epsg32612> : WGS 84 / UTM zone 12N)110.5 288 Q
-(<epsg32613> : WGS 84 / UTM zone 13N)110.5 300 Q
-(<epsg32614> : WGS 84 / UTM zone 14N)110.5 312 Q
-(<epsg32615> : WGS 84 / UTM zone 15N)110.5 324 Q
-(<epsg32616> : WGS 84 / UTM zone 16N)110.5 336 Q
-(<epsg32617> : WGS 84 / UTM zone 17N)110.5 348 Q
-(<epsg32618> : WGS 84 / UTM zone 18N)110.5 360 Q
-(<epsg32619> : WGS 84 / UTM zone 19N)110.5 372 Q
-(<epsg32620> : WGS 84 / UTM zone 20N)110.5 384 Q
-(<epsg32621> : WGS 84 / UTM zone 21N)110.5 396 Q
-(<epsg32622> : WGS 84 / UTM zone 22N)110.5 408 Q
-(<epsg32623> : WGS 84 / UTM zone 23N)110.5 420 Q
-(<epsg32624> : WGS 84 / UTM zone 24N)110.5 432 Q
-(<epsg32625> : WGS 84 / UTM zone 25N)110.5 444 Q
-(<epsg32626> : WGS 84 / UTM zone 26N)110.5 456 Q
-(<epsg32627> : WGS 84 / UTM zone 27N)110.5 468 Q
-(<epsg32628> : WGS 84 / UTM zone 28N)110.5 480 Q
-(<epsg32629> : WGS 84 / UTM zone 29N)110.5 492 Q
-(<epsg32630> : WGS 84 / UTM zone 30N)110.5 504 Q
-(<epsg32631> : WGS 84 / UTM zone 31N)110.5 516 Q
-(<epsg32632> : WGS 84 / UTM zone 32N)110.5 528 Q
-(<epsg32633> : WGS 84 / UTM zone 33N)110.5 540 Q
-(<epsg32634> : WGS 84 / UTM zone 34N)110.5 552 Q
-(<epsg32635> : WGS 84 / UTM zone 35N)110.5 564 Q
-(<epsg32636> : WGS 84 / UTM zone 36N)110.5 576 Q
-(<epsg32637> : WGS 84 / UTM zone 37N)110.5 588 Q
-(<epsg32638> : WGS 84 / UTM zone 38N)110.5 600 Q
-(<epsg32639> : WGS 84 / UTM zone 39N)110.5 612 Q
-(<epsg32640> : WGS 84 / UTM zone 40N)110.5 624 Q
-(<epsg32641> : WGS 84 / UTM zone 41N)110.5 636 Q
-(<epsg32642> : WGS 84 / UTM zone 42N)110.5 648 Q
-(<epsg32643> : WGS 84 / UTM zone 43N)110.5 660 Q
-(<epsg32644> : WGS 84 / UTM zone 44N)110.5 672 Q
-(<epsg32645> : WGS 84 / UTM zone 45N)110.5 684 Q
-(<epsg32646> : WGS 84 / UTM zone 46N)110.5 696 Q
-(<epsg32647> : WGS 84 / UTM zone 47N)110.5 708 Q
-(<epsg32648> : WGS 84 / UTM zone 48N)110.5 720 Q(MB-System 5.0)72 768 Q
-(13 March 2014)140.11 E(87)193.45 E 0 Cg EP
-%%Page: 88 88
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<epsg32649> : WGS 84 / UTM zone 49N)110.5 84 Q
-(<epsg32650> : WGS 84 / UTM zone 50N)110.5 96 Q
-(<epsg32651> : WGS 84 / UTM zone 51N)110.5 108 Q
-(<epsg32652> : WGS 84 / UTM zone 52N)110.5 120 Q
-(<epsg32653> : WGS 84 / UTM zone 53N)110.5 132 Q
-(<epsg32654> : WGS 84 / UTM zone 54N)110.5 144 Q
-(<epsg32655> : WGS 84 / UTM zone 55N)110.5 156 Q
-(<epsg32656> : WGS 84 / UTM zone 56N)110.5 168 Q
-(<epsg32657> : WGS 84 / UTM zone 57N)110.5 180 Q
-(<epsg32658> : WGS 84 / UTM zone 58N)110.5 192 Q
-(<epsg32659> : WGS 84 / UTM zone 59N)110.5 204 Q
-(<epsg32660> : WGS 84 / UTM zone 60N)110.5 216 Q
-(<epsg32661> : WGS 84 / UPS North)110.5 228 Q
-(<epsg32662> : WGS 84 / Plate Carree)110.5 240 Q
-(<epsg32664> : WGS 84 / BLM 14N \(ftUS\))110.5 252 Q
-(<epsg32665> : WGS 84 / BLM 15N \(ftUS\))110.5 264 Q
-(<epsg32666> : WGS 84 / BLM 16N \(ftUS\))110.5 276 Q
-(<epsg32667> : WGS 84 / BLM 17N \(ftUS\))110.5 288 Q
-(<epsg32701> : WGS 84 / UTM zone 1S)110.5 300 Q
-(<epsg32702> : WGS 84 / UTM zone 2S)110.5 312 Q
-(<epsg32703> : WGS 84 / UTM zone 3S)110.5 324 Q
-(<epsg32704> : WGS 84 / UTM zone 4S)110.5 336 Q
-(<epsg32705> : WGS 84 / UTM zone 5S)110.5 348 Q
-(<epsg32706> : WGS 84 / UTM zone 6S)110.5 360 Q
-(<epsg32707> : WGS 84 / UTM zone 7S)110.5 372 Q
-(<epsg32708> : WGS 84 / UTM zone 8S)110.5 384 Q
-(<epsg32709> : WGS 84 / UTM zone 9S)110.5 396 Q
-(<epsg32710> : WGS 84 / UTM zone 10S)110.5 408 Q
-(<epsg32711> : WGS 84 / UTM zone 11S)110.5 420 Q
-(<epsg32712> : WGS 84 / UTM zone 12S)110.5 432 Q
-(<epsg32713> : WGS 84 / UTM zone 13S)110.5 444 Q
-(<epsg32714> : WGS 84 / UTM zone 14S)110.5 456 Q
-(<epsg32715> : WGS 84 / UTM zone 15S)110.5 468 Q
-(<epsg32716> : WGS 84 / UTM zone 16S)110.5 480 Q
-(<epsg32717> : WGS 84 / UTM zone 17S)110.5 492 Q
-(<epsg32718> : WGS 84 / UTM zone 18S)110.5 504 Q
-(<epsg32719> : WGS 84 / UTM zone 19S)110.5 516 Q
-(<epsg32720> : WGS 84 / UTM zone 20S)110.5 528 Q
-(<epsg32721> : WGS 84 / UTM zone 21S)110.5 540 Q
-(<epsg32722> : WGS 84 / UTM zone 22S)110.5 552 Q
-(<epsg32723> : WGS 84 / UTM zone 23S)110.5 564 Q
-(<epsg32724> : WGS 84 / UTM zone 24S)110.5 576 Q
-(<epsg32725> : WGS 84 / UTM zone 25S)110.5 588 Q
-(<epsg32726> : WGS 84 / UTM zone 26S)110.5 600 Q
-(<epsg32727> : WGS 84 / UTM zone 27S)110.5 612 Q
-(<epsg32728> : WGS 84 / UTM zone 28S)110.5 624 Q
-(<epsg32729> : WGS 84 / UTM zone 29S)110.5 636 Q
-(<epsg32730> : WGS 84 / UTM zone 30S)110.5 648 Q
-(<epsg32731> : WGS 84 / UTM zone 31S)110.5 660 Q
-(<epsg32732> : WGS 84 / UTM zone 32S)110.5 672 Q
-(<epsg32733> : WGS 84 / UTM zone 33S)110.5 684 Q
-(<epsg32734> : WGS 84 / UTM zone 34S)110.5 696 Q
-(<epsg32735> : WGS 84 / UTM zone 35S)110.5 708 Q
-(<epsg32736> : WGS 84 / UTM zone 36S)110.5 720 Q(MB-System 5.0)72 768 Q
-(13 March 2014)140.11 E(88)193.45 E 0 Cg EP
-%%Page: 89 89
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<epsg32737> : WGS 84 / UTM zone 37S)110.5 84 Q
-(<epsg32738> : WGS 84 / UTM zone 38S)110.5 96 Q
-(<epsg32739> : WGS 84 / UTM zone 39S)110.5 108 Q
-(<epsg32740> : WGS 84 / UTM zone 40S)110.5 120 Q
-(<epsg32741> : WGS 84 / UTM zone 41S)110.5 132 Q
-(<epsg32742> : WGS 84 / UTM zone 42S)110.5 144 Q
-(<epsg32743> : WGS 84 / UTM zone 43S)110.5 156 Q
-(<epsg32744> : WGS 84 / UTM zone 44S)110.5 168 Q
-(<epsg32745> : WGS 84 / UTM zone 45S)110.5 180 Q
-(<epsg32746> : WGS 84 / UTM zone 46S)110.5 192 Q
-(<epsg32747> : WGS 84 / UTM zone 47S)110.5 204 Q
-(<epsg32748> : WGS 84 / UTM zone 48S)110.5 216 Q
-(<epsg32749> : WGS 84 / UTM zone 49S)110.5 228 Q
-(<epsg32750> : WGS 84 / UTM zone 50S)110.5 240 Q
-(<epsg32751> : WGS 84 / UTM zone 51S)110.5 252 Q
-(<epsg32752> : WGS 84 / UTM zone 52S)110.5 264 Q
-(<epsg32753> : WGS 84 / UTM zone 53S)110.5 276 Q
-(<epsg32754> : WGS 84 / UTM zone 54S)110.5 288 Q
-(<epsg32755> : WGS 84 / UTM zone 55S)110.5 300 Q
-(<epsg32756> : WGS 84 / UTM zone 56S)110.5 312 Q
-(<epsg32757> : WGS 84 / UTM zone 57S)110.5 324 Q
-(<epsg32758> : WGS 84 / UTM zone 58S)110.5 336 Q
-(<epsg32759> : WGS 84 / UTM zone 59S)110.5 348 Q
-(<epsg32760> : WGS 84 / UTM zone 60S)110.5 360 Q
-(<epsg32761> : WGS 84 / UPS South)110.5 372 Q
-(<epsg32766> : WGS 84 / TM 36 SE)110.5 384 Q
-(\255--------------------------------------------------------)110.5 408
-Q(Additional EPSG-lik)110.5 420 Q 2.5(ep)-.1 G(rojection de\214nitions)
--2.5 E(\255--------------------------------------------------------)
-110.5 432 Q(OGC-de\214ned e)110.5 444 Q(xtended codes)-.15 E
-(\(41000--41999\) see http://www)5 E(.digitalearth.go)-.65 E
-(v/wmt/auto.html)-.15 E
-(\255--------------------------------------------------------)110.5 456
-Q(<epsg41001> : WGS84 / Simple Mercator)110.5 468 Q
-(\255--------------------------------------------------------)110.5 492
-Q(CubeW)110.5 504 Q(erx-de\214ned e)-.8 E(xtended codes)-.15 E
-(\(42100--42199\))5 E
-(\255--------------------------------------------------------)110.5 516
-Q(<epsg42101> : WGS 84 / LCC Canada)110.5 528 Q(<epsg42102> : N)110.5
-540 Q(AD83 / BC Albers \(this has been superceeded b)-.35 E(ut is k)-.2
-E(ept for compatibility\))-.1 E(<epsg42103> : WGS 84 / LCC USA)110.5 552
-Q(<epsg42103> : N)110.5 564 Q(AD83 / MTM zone 8 Qu\303\251bec)-.35 E
-(<epsg42105> : WGS84 / Merc NorthAm)110.5 576 Q
-(<epsg42106> : WGS84 / Lambert Azim Mozambique)110.5 588 Q
-(\255--------------------------------------------------------)110.5 612
-Q(CubeW)110.5 624 Q(erx-customer de\214nitions)-.8 E(\(42300--42399\))5
-E(\255--------------------------------------------------------)110.5 636
-Q(<epsg42301> : N)110.5 648 Q(AD27 / Polar Stereographic / CM=\25598)
--.35 E(<epsg42302>JapanOrtho.09 09)110.5 660 Q(<epsg42303> : N)110.5 672
-Q(AD83 / Albers NorthAm)-.35 E(<epsg42304> : N)110.5 684 Q
-(AD83 / NRCan LCC Canada)-.35 E(<epsg42305> : France_II)110.5 696 Q
-(<epsg42306> : N)110.5 708 Q(AD83/QC_LCC)-.35 E(<epsg42307> : N)110.5
-720 Q(AD83 / T)-.35 E -.15(ex)-.7 G(as Central \255 feet).15 E
-(MB-System 5.0)72 768 Q(13 March 2014)140.11 E(89)193.45 E 0 Cg EP
-%%Page: 90 90
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<epsg42308> : N)110.5 84 Q
-(AD27 / California Albers)-.35 E(<epsg42309> : N)110.5 96 Q
-(AD 83 / LCC Canada A)-.35 E(VHRR-2)-1.35 E
-(<epsg42310> : WGS84+GRS80 / Mercator)110.5 108 Q(<epsg42311> : N)110.5
-120 Q(AD83 / LCC Statcan)-.35 E
-(\255--------------------------------------------------------)110.5 144
-Q(ESRI projection de\214nitions)110.5 156 Q
-(\255--------------------------------------------------------)110.5 168
-Q(<esri2000> : Anguilla 1957 / British W)110.5 180 Q(est Indies Grid)-.8
-E(<esri2001> : Antigua 1943 / British W)110.5 192 Q(est Indies Grid)-.8
-E(<esri2002> : Dominica 1945 / British W)110.5 204 Q(est Indies Grid)-.8
-E(<esri2003> : Grenada 1953 / British W)110.5 216 Q(est Indies Grid)-.8
-E(<esri2004> : Montserrat 58 / British W)110.5 228 Q(est Indies Grid)-.8
-E(<esri2005> : St Kitts 1955 / British W)110.5 240 Q(est Indies Grid)-.8
-E(<esri2006> : St Lucia 1955 / British W)110.5 252 Q(est Indies Grid)-.8
-E(<esri2007> : St V)110.5 264 Q(incent 45 / British W)-.6 E
-(est Indies Grid)-.8 E(<esri2008> : N)110.5 276 Q
-(AD27\(CGQ77\) / SCoPQ zone 2)-.35 E(<esri2009> : N)110.5 288 Q
-(AD27\(CGQ77\) / SCoPQ zone 3)-.35 E(<esri2010> : N)110.5 300 Q
-(AD27\(CGQ77\) / SCoPQ zone 4)-.35 E(<esri2011> : N)110.5 312 Q
-(AD27\(CGQ77\) / SCoPQ zone 5)-.35 E(<esri2012> : N)110.5 324 Q
-(AD27\(CGQ77\) / SCoPQ zone 6)-.35 E(<esri2013> : N)110.5 336 Q
-(AD27\(CGQ77\) / SCoPQ zone 7)-.35 E(<esri2014> : N)110.5 348 Q
-(AD27\(CGQ77\) / SCoPQ zone 8)-.35 E(<esri2015> : N)110.5 360 Q
-(AD27\(CGQ77\) / SCoPQ zone 9)-.35 E(<esri2016> : N)110.5 372 Q
-(AD27\(CGQ77\) / SCoPQ zone 10)-.35 E(<esri2017> : N)110.5 384 Q
-(AD27\(76\) / MTM zone 8)-.35 E(<esri2018> : N)110.5 396 Q
-(AD27\(76\) / MTM zone 9)-.35 E(<esri2019> : N)110.5 408 Q
-(AD27\(76\) / MTM zone 10)-.35 E(<esri2020> : N)110.5 420 Q
-(AD27\(76\) / MTM zone 11)-.35 E(<esri2021> : N)110.5 432 Q
-(AD27\(76\) / MTM zone 12)-.35 E(<esri2022> : N)110.5 444 Q
-(AD27\(76\) / MTM zone 13)-.35 E(<esri2023> : N)110.5 456 Q
-(AD27\(76\) / MTM zone 14)-.35 E(<esri2024> : N)110.5 468 Q
-(AD27\(76\) / MTM zone 15)-.35 E(<esri2025> : N)110.5 480 Q
-(AD27\(76\) / MTM zone 16)-.35 E(<esri2026> : N)110.5 492 Q
-(AD27\(76\) / MTM zone 17)-.35 E(<esri2027> : N)110.5 504 Q
-(AD27\(76\) / UTM zone 15N)-.35 E(<esri2028> : N)110.5 516 Q
-(AD27\(76\) / UTM zone 16N)-.35 E(<esri2029> : N)110.5 528 Q
-(AD27\(76\) / UTM zone 17N)-.35 E(<esri2030> : N)110.5 540 Q
-(AD27\(76\) / UTM zone 18N)-.35 E(<esri2031> : N)110.5 552 Q
-(AD27\(CGQ77\) / UTM zone 17N)-.35 E(<esri2032> : N)110.5 564 Q
-(AD27\(CGQ77\) / UTM zone 18N)-.35 E(<esri2033> : N)110.5 576 Q
-(AD27\(CGQ77\) / UTM zone 19N)-.35 E(<esri2034> : N)110.5 588 Q
-(AD27\(CGQ77\) / UTM zone 20N)-.35 E(<esri2035> : N)110.5 600 Q
-(AD27\(CGQ77\) / UTM zone 21N)-.35 E(<esri2036> : N)110.5 612 Q
-(AD83\(CSRS98\) / Ne)-.35 E 2.5(wB)-.25 G(runswick Stereo)-2.5 E
-(<esri2037> : N)110.5 624 Q(AD83\(CSRS98\) / UTM zone 19N)-.35 E
-(<esri2038> : N)110.5 636 Q(AD83\(CSRS98\) / UTM zone 20N)-.35 E
-(<esri2039> : Israel / Israeli TM Grid)110.5 648 Q
-(<esri2040> : Locodjo 1965 / UTM zone 30N)110.5 660 Q
-(<esri2041> : Abidjan 1987 / UTM zone 30N)110.5 672 Q
-(<esri2042> : Locodjo 1965 / UTM zone 29N)110.5 684 Q
-(<esri2043> : Abidjan 1987 / UTM zone 29N)110.5 696 Q
-(<esri2044> : Hanoi 1972 / Gauss-Kruger zone 18)110.5 708 Q
-(<esri2045> : Hanoi 1972 / Gauss-Kruger zone 19)110.5 720 Q
-(MB-System 5.0)72 768 Q(13 March 2014)140.11 E(90)193.45 E 0 Cg EP
-%%Page: 91 91
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<esri2056> : CH1903+ / L)110.5 84 Q(V95)-1 E
-(<esri2057> : Rassadiran / Nakhl e T)110.5 96 Q(aqi)-.8 E
-(<esri2058> : ED50\(ED77\) / UTM zone 38N)110.5 108 Q
-(<esri2059> : ED50\(ED77\) / UTM zone 39N)110.5 120 Q
-(<esri2060> : ED50\(ED77\) / UTM zone 40N)110.5 132 Q
-(<esri2061> : ED50\(ED77\) / UTM zone 41N)110.5 144 Q
-(<esri2062> : Madrid 1870 \(Madrid\) / Spain)110.5 156 Q
-(<esri2063> : Dabola 1981 / UTM zone 28N)110.5 168 Q
-(<esri2064> : Dabola 1981 / UTM zone 29N)110.5 180 Q
-(<esri2065> : S-JTSK \(Ferro\) / Kro)110.5 192 Q -.25(va)-.15 G(k).25 E
-(<esri2066> : Mount Dillon / T)110.5 204 Q(obago Grid)-.8 E
-(<esri2067> : Naparima 1955 / UTM zone 20N)110.5 216 Q
-(<esri2068> : ELD79 / Libya zone 5)110.5 228 Q
-(<esri2069> : ELD79 / Libya zone 6)110.5 240 Q
-(<esri2070> : ELD79 / Libya zone 7)110.5 252 Q
-(<esri2071> : ELD79 / Libya zone 8)110.5 264 Q
-(<esri2072> : ELD79 / Libya zone 9)110.5 276 Q
-(<esri2073> : ELD79 / Libya zone 10)110.5 288 Q
-(<esri2074> : ELD79 / Libya zone 11)110.5 300 Q
-(<esri2075> : ELD79 / Libya zone 12)110.5 312 Q
-(<esri2076> : ELD79 / Libya zone 13)110.5 324 Q
-(<esri2077> : ELD79 / UTM zone 32N)110.5 336 Q
-(<esri2078> : ELD79 / UTM zone 33N)110.5 348 Q
-(<esri2079> : ELD79 / UTM zone 34N)110.5 360 Q
-(<esri2080> : ELD79 / UTM zone 35N)110.5 372 Q
-(<esri2081> : Chos Malal 1914 / Ar)110.5 384 Q(gentina zone 2)-.18 E
-(<esri2082> : P)110.5 396 Q(ampa del Castillo / Ar)-.15 E
-(gentina zone 2)-.18 E(<esri2083> : Hito XVIII 1963 / Ar)110.5 408 Q
-(gentina zone 2)-.18 E(<esri2084> : Hito XVIII 1963 / UTM zone 19S)110.5
-420 Q(<esri2085> : N)110.5 432 Q(AD27 / Cuba Norte)-.35 E
-(<esri2086> : N)110.5 444 Q(AD27 / Cuba Sur)-.35 E
-(<esri2087> : ELD79 / TM 12 NE)110.5 456 Q
-(<esri2088> : Carthage / TM 11 NE)110.5 468 Q(<esri2089> : Y)110.5 480 Q
-(emen NGN96 / UTM zone 38N)-1 E(<esri2090> : Y)110.5 492 Q
-(emen NGN96 / UTM zone 39N)-1 E(<esri2091> : South Y)110.5 504 Q
-(emen / Gauss Kruger zone 8)-1 E(<esri2092> : South Y)110.5 516 Q
-(emen / Gauss Kruger zone 9)-1 E(<esri2093> : Hanoi 1972 / GK 106 NE)
-110.5 528 Q(<esri2094> : WGS 72BE / TM 106 NE)110.5 540 Q
-(<esri2095> : Bissau / UTM zone 28N)110.5 552 Q(<esri2096> : K)110.5 564
-Q(orean 1985 / K)-.35 E(orea East Belt)-.35 E(<esri2097> : K)110.5 576 Q
-(orean 1985 / K)-.35 E(orea Central Belt)-.35 E(<esri2098> : K)110.5 588
-Q(orean 1985 / K)-.35 E(orea W)-.35 E(est Belt)-.8 E
-(<esri2099> : Qatar 1948 / Qatar Grid)110.5 600 Q
-(<esri2100> : GGRS87 / Greek Grid)110.5 612 Q(<esri2101> : Lak)110.5 624
-Q 2.5(e/M)-.1 G(aracaibo Grid M1)-2.5 E(<esri2102> : Lak)110.5 636 Q 2.5
-(e/M)-.1 G(aracaibo Grid)-2.5 E(<esri2103> : Lak)110.5 648 Q 2.5(e/M)-.1
-G(aracaibo Grid M3)-2.5 E(<esri2104> : Lak)110.5 660 Q 2.5(e/M)-.1 G
-(aracaibo La Rosa Grid)-2.5 E
-(<esri2105> : NZGD2000 / Mount Eden Circuit 2000)110.5 672 Q
-(<esri2106> : NZGD2000 / Bay of Plenty Circuit 2000)110.5 684 Q
-(<esri2107> : NZGD2000 / Po)110.5 696 Q -.15(ve)-.15 G
-(rty Bay Circuit 2000).15 E(<esri2108> : NZGD2000 / Ha)110.5 708 Q(wk)
--.15 E(es Bay Circuit 2000)-.1 E(<esri2109> : NZGD2000 / T)110.5 720 Q
-(aranaki Circuit 2000)-.8 E(MB-System 5.0)72 768 Q(13 March 2014)140.11
-E(91)193.45 E 0 Cg EP
-%%Page: 92 92
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<esri2110> : NZGD2000 / T)110.5 84 Q
-(uhirangi Circuit 2000)-.45 E(<esri2111> : NZGD2000 / W)110.5 96 Q(ang)
--.8 E(anui Circuit 2000)-.05 E(<esri2112> : NZGD2000 / W)110.5 108 Q
-(airarapa Circuit 2000)-.8 E(<esri2113> : NZGD2000 / W)110.5 120 Q
-(ellington Circuit 2000)-.8 E(<esri2114> : NZGD2000 / Collingw)110.5 132
-Q(ood Circuit 2000)-.1 E(<esri2115> : NZGD2000 / Nelson Circuit 2000)
-110.5 144 Q(<esri2116> : NZGD2000 / Karamea Circuit 2000)110.5 156 Q
-(<esri2117> : NZGD2000 / Buller Circuit 2000)110.5 168 Q
-(<esri2118> : NZGD2000 / Gre)110.5 180 Q 2.5(yC)-.15 G(ircuit 2000)-2.5
-E(<esri2119> : NZGD2000 / Amuri Circuit 2000)110.5 192 Q
-(<esri2120> : NZGD2000 / Marlborough Circuit 2000)110.5 204 Q
-(<esri2121> : NZGD2000 / Hokitika Circuit 2000)110.5 216 Q
-(<esri2122> : NZGD2000 / Okarito Circuit 2000)110.5 228 Q
-(<esri2123> : NZGD2000 / Jacksons Bay Circuit 2000)110.5 240 Q
-(<esri2124> : NZGD2000 / Mount Pleasant Circuit 2000)110.5 252 Q
-(<esri2125> : NZGD2000 / Ga)110.5 264 Q(wler Circuit 2000)-.15 E
-(<esri2126> : NZGD2000 / T)110.5 276 Q(imaru Circuit 2000)-.35 E
-(<esri2127> : NZGD2000 / Lindis Peak Circuit 2000)110.5 288 Q
-(<esri2128> : NZGD2000 / Mount Nicholas Circuit 2000)110.5 300 Q
-(<esri2129> : NZGD2000 / Mount Y)110.5 312 Q(ork Circuit 2000)-1.1 E
-(<esri2130> : NZGD2000 / Observ)110.5 324 Q(ation Point Circuit 2000)
--.25 E(<esri2131> : NZGD2000 / North T)110.5 336 Q(aieri Circuit 2000)
--.8 E(<esri2132> : NZGD2000 / Bluf)110.5 348 Q 2.5(fC)-.25 G
-(ircuit 2000)-2.5 E(<esri2133> : NZGD2000 / UTM zone 58S)110.5 360 Q
-(<esri2134> : NZGD2000 / UTM zone 59S)110.5 372 Q
-(<esri2135> : NZGD2000 / UTM zone 60S)110.5 384 Q
-(<esri2136> : Accra / Ghana National Grid)110.5 396 Q
-(<esri2137> : Accra / TM 1 NW)110.5 408 Q(<esri2138> : N)110.5 420 Q
-(AD27\(CGQ77\) / Quebec Lambert)-.35 E(<esri2139> : N)110.5 432 Q
-(AD83\(CSRS98\) / SCoPQ zone 2)-.35 E(<esri2140> : N)110.5 444 Q
-(AD83\(CSRS98\) / MTM zone 3)-.35 E(<esri2141> : N)110.5 456 Q
-(AD83\(CSRS98\) / MTM zone 4)-.35 E(<esri2142> : N)110.5 468 Q
-(AD83\(CSRS98\) / MTM zone 5)-.35 E(<esri2143> : N)110.5 480 Q
-(AD83\(CSRS98\) / MTM zone 6)-.35 E(<esri2144> : N)110.5 492 Q
-(AD83\(CSRS98\) / MTM zone 7)-.35 E(<esri2145> : N)110.5 504 Q
-(AD83\(CSRS98\) / MTM zone 8)-.35 E(<esri2146> : N)110.5 516 Q
-(AD83\(CSRS98\) / MTM zone 9)-.35 E(<esri2147> : N)110.5 528 Q
-(AD83\(CSRS98\) / MTM zone 10)-.35 E(<esri2148> : N)110.5 540 Q
-(AD83\(CSRS98\) / UTM zone 21N)-.35 E(<esri2149> : N)110.5 552 Q
-(AD83\(CSRS98\) / UTM zone 18N)-.35 E(<esri2150> : N)110.5 564 Q
-(AD83\(CSRS98\) / UTM zone 17N)-.35 E(<esri2151> : N)110.5 576 Q
-(AD83\(CSRS98\) / UTM zone 13N)-.35 E(<esri2152> : N)110.5 588 Q
-(AD83\(CSRS98\) / UTM zone 12N)-.35 E(<esri2153> : N)110.5 600 Q
-(AD83\(CSRS98\) / UTM zone 11N)-.35 E(<esri2154> : RGF93 / Lambert-93)
-110.5 612 Q(<esri2155> : American Samoa 1962 / American Samoa Lambert)
-110.5 624 Q(<esri2156> : N)110.5 636 Q(AD83\(HARN\) / UTM zone 59S)-.35
-E(<esri2157> : IRENET95 / Irish T)110.5 648 Q(ransv)-.35 E
-(erse Mercator)-.15 E(<esri2158> : IRENET95 / UTM zone 29N)110.5 660 Q
-(<esri2159> : Sierra Leone 1924 / Ne)110.5 672 Q 2.5(wC)-.25 G(olon)-2.5
-E 2.5(yG)-.15 G(rid)-2.5 E(<esri2160> : Sierra Leone 1924 / Ne)110.5 684
-Q 2.5(wW)-.25 G(ar Of)-3.3 E(\214ce Grid)-.25 E
-(<esri2161> : Sierra Leone 1968 / UTM zone 28N)110.5 696 Q
-(<esri2162> : Sierra Leone 1968 / UTM zone 29N)110.5 708 Q
-(<esri2163> : US National Atlas Equal Area)110.5 720 Q(MB-System 5.0)72
-768 Q(13 March 2014)140.11 E(92)193.45 E 0 Cg EP
-%%Page: 93 93
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<esri2164> : Locodjo 1965 / TM 5 NW)110.5 84 Q
-(<esri2165> : Abidjan 1987 / TM 5 NW)110.5 96 Q(<esri2166> : Pulk)110.5
-108 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942\(83\) / Gauss Kruger zone 3)-2.5 E
-(<esri2167> : Pulk)110.5 120 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942\(83\) / Gauss Kruger zone 4)-2.5 E(<esri2168> : Pulk)110.5 132 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(942\(83\) / Gauss Kruger zone 5)-2.5 E
-(<esri2169> : Lux)110.5 144 Q(embour)-.15 E 2.5(g1)-.18 G(930 / Gauss)
--2.5 E(<esri2170> : MGI / Slo)110.5 156 Q -.15(ve)-.15 G(nia Grid).15 E
-(<esri2171> : Pulk)110.5 168 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942\(58\) / Poland zone I)-2.5 E(<esri2172> : Pulk)110.5 180 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942\(58\) / Poland zone II)-2.5 E(<esri2173> : Pulk)
-110.5 192 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942\(58\) / Poland zone III)-2.5
-E(<esri2174> : Pulk)110.5 204 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942\(58\) / Poland zone IV)-2.5 E(<esri2175> : Pulk)110.5 216 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(942\(58\) / Poland zone V)-2.5 E
-(<esri2176> : ETRS89 / Poland CS2000 zone 5)110.5 228 Q
-(<esri2177> : ETRS89 / Poland CS2000 zone 6)110.5 240 Q
-(<esri2178> : ETRS89 / Poland CS2000 zone 7)110.5 252 Q
-(<esri2179> : ETRS89 / Poland CS2000 zone 8)110.5 264 Q
-(<esri2180> : ETRS89 / Poland CS92)110.5 276 Q
-(<esri2188> : Azores Occidental 1939 / UTM zone 25N)110.5 288 Q
-(<esri2189> : Azores Central 1948 / UTM zone 26N)110.5 300 Q
-(<esri2190> : Azores Oriental 1940 / UTM zone 26N)110.5 312 Q
-(<esri2191> : Madeira 1936 / UTM zone 28N)110.5 324 Q
-(<esri2192> : ED50 / France EuroLambert)110.5 336 Q
-(<esri2193> : NZGD2000 / Ne)110.5 348 Q 2.5(wZ)-.25 G(ealand T)-2.5 E
-(ransv)-.35 E(erse Mercator)-.15 E
-(<esri2194> : American Samoa 1962 / American Samoa Lambert)110.5 360 Q
-(<esri2195> : N)110.5 372 Q(AD83\(HARN\) / UTM zone 2S)-.35 E
-(<esri2196> : ETRS89 / Kp2000 Jutland)110.5 384 Q
-(<esri2197> : ETRS89 / Kp2000 Zealand)110.5 396 Q
-(<esri2198> : ETRS89 / Kp2000 Bornholm)110.5 408 Q
-(<esri2199> : Albanian 1987 / Gauss Kruger zone 4)110.5 420 Q
-(<esri2200> : A)110.5 432 Q(TS77 / Ne)-1.11 E 2.5(wB)-.25 G
-(runswick Stereographic \(A)-2.5 E(TS77\))-1.11 E
-(<esri2201> : REGVEN / UTM zone 18N)110.5 444 Q
-(<esri2202> : REGVEN / UTM zone 19N)110.5 456 Q
-(<esri2203> : REGVEN / UTM zone 20N)110.5 468 Q(<esri2204> : N)110.5 480
-Q(AD27 / T)-.35 E(ennessee)-.7 E(<esri2205> : N)110.5 492 Q(AD83 / K)
--.35 E(entuck)-.25 E 2.5(yN)-.15 G(orth)-2.5 E(<esri2206> : ED50 / 3-de)
-110.5 504 Q(gree Gauss-Kruger zone 9)-.15 E(<esri2207> : ED50 / 3-de)
-110.5 516 Q(gree Gauss-Kruger zone 10)-.15 E(<esri2208> : ED50 / 3-de)
-110.5 528 Q(gree Gauss-Kruger zone 11)-.15 E(<esri2209> : ED50 / 3-de)
-110.5 540 Q(gree Gauss-Kruger zone 12)-.15 E(<esri2210> : ED50 / 3-de)
-110.5 552 Q(gree Gauss-Kruger zone 13)-.15 E(<esri2211> : ED50 / 3-de)
-110.5 564 Q(gree Gauss-Kruger zone 14)-.15 E(<esri2212> : ED50 / 3-de)
-110.5 576 Q(gree Gauss-Kruger zone 15)-.15 E
-(<esri2213> : ETRS89 / TM 30 NE)110.5 588 Q
-(<esri2214> : Douala 1948 / A)110.5 600 Q(OF west)-.55 E
-(<esri2215> : Manoca 1962 / UTM zone 32N)110.5 612 Q
-(<esri2216> : Qornoq 1927 / UTM zone 22N)110.5 624 Q
-(<esri2217> : Qornoq 1927 / UTM zone 23N)110.5 636 Q(<esri2219> : A)
-110.5 648 Q(TS77 / UTM zone 19N)-1.11 E(<esri2220> : A)110.5 660 Q
-(TS77 / UTM zone 20N)-1.11 E(<esri2222> : N)110.5 672 Q
-(AD83 / Arizona East \(ft\))-.35 E(<esri2223> : N)110.5 684 Q
-(AD83 / Arizona Central \(ft\))-.35 E(<esri2224> : N)110.5 696 Q
-(AD83 / Arizona W)-.35 E(est \(ft\))-.8 E(<esri2225> : N)110.5 708 Q
-(AD83 / California zone 1 \(ftUS\))-.35 E(<esri2226> : N)110.5 720 Q
-(AD83 / California zone 2 \(ftUS\))-.35 E(MB-System 5.0)72 768 Q
-(13 March 2014)140.11 E(93)193.45 E 0 Cg EP
-%%Page: 94 94
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<esri2227> : N)110.5 84 Q
-(AD83 / California zone 3 \(ftUS\))-.35 E(<esri2228> : N)110.5 96 Q
-(AD83 / California zone 4 \(ftUS\))-.35 E(<esri2229> : N)110.5 108 Q
-(AD83 / California zone 5 \(ftUS\))-.35 E(<esri2230> : N)110.5 120 Q
-(AD83 / California zone 6 \(ftUS\))-.35 E(<esri2231> : N)110.5 132 Q
-(AD83 / Colorado North \(ftUS\))-.35 E(<esri2232> : N)110.5 144 Q
-(AD83 / Colorado Central \(ftUS\))-.35 E(<esri2233> : N)110.5 156 Q
-(AD83 / Colorado South \(ftUS\))-.35 E(<esri2234> : N)110.5 168 Q
-(AD83 / Connecticut \(ftUS\))-.35 E(<esri2235> : N)110.5 180 Q
-(AD83 / Dela)-.35 E -.1(wa)-.15 G(re \(ftUS\)).1 E(<esri2236> : N)110.5
-192 Q(AD83 / Florida East \(ftUS\))-.35 E(<esri2237> : N)110.5 204 Q
-(AD83 / Florida W)-.35 E(est \(ftUS\))-.8 E(<esri2238> : N)110.5 216 Q
-(AD83 / Florida North \(ftUS\))-.35 E(<esri2239> : N)110.5 228 Q
-(AD83 / Geor)-.35 E(gia East \(ftUS\))-.18 E(<esri2240> : N)110.5 240 Q
-(AD83 / Geor)-.35 E(gia W)-.18 E(est \(ftUS\))-.8 E(<esri2241> : N)110.5
-252 Q(AD83 / Idaho East \(ftUS\))-.35 E(<esri2242> : N)110.5 264 Q
-(AD83 / Idaho Central \(ftUS\))-.35 E(<esri2243> : N)110.5 276 Q
-(AD83 / Idaho W)-.35 E(est \(ftUS\))-.8 E(<esri2244> : N)110.5 288 Q
-(AD83 / Indiana East \(ftUS\))-.35 E(<esri2245> : N)110.5 300 Q
-(AD83 / Indiana W)-.35 E(est \(ftUS\))-.8 E(<esri2246> : N)110.5 312 Q
-(AD83 / K)-.35 E(entuck)-.25 E 2.5(yN)-.15 G(orth \(ftUS\))-2.5 E
-(<esri2247> : N)110.5 324 Q(AD83 / K)-.35 E(entuck)-.25 E 2.5(yS)-.15 G
-(outh \(ftUS\))-2.5 E(<esri2248> : N)110.5 336 Q
-(AD83 / Maryland \(ftUS\))-.35 E(<esri2249> : N)110.5 348 Q
-(AD83 / Massachusetts Mainland \(ftUS\))-.35 E(<esri2250> : N)110.5 360
-Q(AD83 / Massachusetts Island \(ftUS\))-.35 E(<esri2251> : N)110.5 372 Q
-(AD83 / Michig)-.35 E(an North \(ft\))-.05 E(<esri2252> : N)110.5 384 Q
-(AD83 / Michig)-.35 E(an Central \(ft\))-.05 E(<esri2253> : N)110.5 396
-Q(AD83 / Michig)-.35 E(an South \(ft\))-.05 E(<esri2254> : N)110.5 408 Q
-(AD83 / Mississippi East \(ftUS\))-.35 E(<esri2255> : N)110.5 420 Q
-(AD83 / Mississippi W)-.35 E(est \(ftUS\))-.8 E(<esri2256> : N)110.5 432
-Q(AD83 / Montana \(ft\))-.35 E(<esri2257> : N)110.5 444 Q(AD83 / Ne)-.35
-E 2.5(wM)-.25 G -.15(ex)-2.5 G(ico East \(ftUS\)).15 E(<esri2258> : N)
-110.5 456 Q(AD83 / Ne)-.35 E 2.5(wM)-.25 G -.15(ex)-2.5 G
-(ico Central \(ftUS\)).15 E(<esri2259> : N)110.5 468 Q(AD83 / Ne)-.35 E
-2.5(wM)-.25 G -.15(ex)-2.5 G(ico W).15 E(est \(ftUS\))-.8 E
-(<esri2260> : N)110.5 480 Q(AD83 / Ne)-.35 E 2.5(wY)-.25 G
-(ork East \(ftUS\))-3.6 E(<esri2261> : N)110.5 492 Q(AD83 / Ne)-.35 E
-2.5(wY)-.25 G(ork Central \(ftUS\))-3.6 E(<esri2262> : N)110.5 504 Q
-(AD83 / Ne)-.35 E 2.5(wY)-.25 G(ork W)-3.6 E(est \(ftUS\))-.8 E
-(<esri2263> : N)110.5 516 Q(AD83 / Ne)-.35 E 2.5(wY)-.25 G
-(ork Long Island \(ftUS\))-3.6 E(<esri2264> : N)110.5 528 Q
-(AD83 / North Carolina \(ftUS\))-.35 E(<esri2265> : N)110.5 540 Q
-(AD83 / North Dak)-.35 E(ota North \(ft\))-.1 E(<esri2266> : N)110.5 552
-Q(AD83 / North Dak)-.35 E(ota South \(ft\))-.1 E(<esri2267> : N)110.5
-564 Q(AD83 / Oklahoma North \(ftUS\))-.35 E(<esri2268> : N)110.5 576 Q
-(AD83 / Oklahoma South \(ftUS\))-.35 E(<esri2269> : N)110.5 588 Q
-(AD83 / Ore)-.35 E(gon North \(ft\))-.15 E(<esri2270> : N)110.5 600 Q
-(AD83 / Ore)-.35 E(gon South \(ft\))-.15 E(<esri2271> : N)110.5 612 Q
-(AD83 / Pennsylv)-.35 E(ania North \(ftUS\))-.25 E(<esri2272> : N)110.5
-624 Q(AD83 / Pennsylv)-.35 E(ania South \(ftUS\))-.25 E(<esri2273> : N)
-110.5 636 Q(AD83 / South Carolina \(ft\))-.35 E(<esri2274> : N)110.5 648
-Q(AD83 / T)-.35 E(ennessee \(ftUS\))-.7 E(<esri2275> : N)110.5 660 Q
-(AD83 / T)-.35 E -.15(ex)-.7 G(as North \(ftUS\)).15 E(<esri2276> : N)
-110.5 672 Q(AD83 / T)-.35 E -.15(ex)-.7 G(as North Central \(ftUS\)).15
-E(<esri2277> : N)110.5 684 Q(AD83 / T)-.35 E -.15(ex)-.7 G
-(as Central \(ftUS\)).15 E(<esri2278> : N)110.5 696 Q(AD83 / T)-.35 E
--.15(ex)-.7 G(as South Central \(ftUS\)).15 E(<esri2279> : N)110.5 708 Q
-(AD83 / T)-.35 E -.15(ex)-.7 G(as South \(ftUS\)).15 E(<esri2280> : N)
-110.5 720 Q(AD83 / Utah North \(ft\))-.35 E(MB-System 5.0)72 768 Q
-(13 March 2014)140.11 E(94)193.45 E 0 Cg EP
-%%Page: 95 95
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<esri2281> : N)110.5 84 Q
-(AD83 / Utah Central \(ft\))-.35 E(<esri2282> : N)110.5 96 Q
-(AD83 / Utah South \(ft\))-.35 E(<esri2283> : N)110.5 108 Q(AD83 / V)
--.35 E(ir)-.6 E(ginia North \(ftUS\))-.18 E(<esri2284> : N)110.5 120 Q
-(AD83 / V)-.35 E(ir)-.6 E(ginia South \(ftUS\))-.18 E(<esri2285> : N)
-110.5 132 Q(AD83 / W)-.35 E(ashington North \(ftUS\))-.8 E
-(<esri2286> : N)110.5 144 Q(AD83 / W)-.35 E(ashington South \(ftUS\))-.8
-E(<esri2287> : N)110.5 156 Q(AD83 / W)-.35 E(isconsin North \(ftUS\))-.4
-E(<esri2288> : N)110.5 168 Q(AD83 / W)-.35 E(isconsin Central \(ftUS\))
--.4 E(<esri2289> : N)110.5 180 Q(AD83 / W)-.35 E
-(isconsin South \(ftUS\))-.4 E(<esri2290> : A)110.5 192 Q
-(TS77 / Prince Edw)-1.11 E(ard Isl. Stereographic \(A)-.1 E(TS77\))-1.11
-E(<esri2291> : N)110.5 204 Q(AD83\(CSRS98\) / Prince Edw)-.35 E
-(ard Isl. Stereographic \(N)-.1 E(AD83\))-.35 E(<esri2292> : N)110.5 216
-Q(AD83\(CSRS98\) / Prince Edw)-.35 E(ard Isl. Stereographic \(N)-.1 E
-(AD83\))-.35 E(<esri2294> : A)110.5 228 Q(TS77 / MTM No)-1.11 E .5 -.25
-(va S)-.15 H(cotia zone 4).25 E(<esri2295> : A)110.5 240 Q
-(TS77 / MTM No)-1.11 E .5 -.25(va S)-.15 H(cotia zone 5).25 E
-(<esri2308> : Bata)110.5 252 Q(via / TM 109 SE)-.2 E
-(<esri2309> : WGS 84 / TM 116 SE)110.5 264 Q
-(<esri2310> : WGS 84 / TM 132 SE)110.5 276 Q
-(<esri2311> : WGS 84 / TM 6 NE)110.5 288 Q
-(<esri2312> : Garoua / UTM zone 33N)110.5 300 Q(<esri2313> : K)110.5 312
-Q(ousseri / UTM zone 33N)-.35 E(<esri2314> : T)110.5 324 Q
-(rinidad 1903 / T)-.35 E(rinidad Grid \(ftCla\))-.35 E
-(<esri2315> : Campo Inchauspe / UTM zone 19S)110.5 336 Q
-(<esri2316> : Campo Inchauspe / UTM zone 20S)110.5 348 Q
-(<esri2317> : PSAD56 / ICN Re)110.5 360 Q(gional)-.15 E
-(<esri2318> : Ain el Abd / Aramco Lambert)110.5 372 Q
-(<esri2319> : ED50 / TM27)110.5 384 Q(<esri2320> : ED50 / TM30)110.5 396
-Q(<esri2321> : ED50 / TM33)110.5 408 Q(<esri2322> : ED50 / TM36)110.5
-420 Q(<esri2323> : ED50 / TM39)110.5 432 Q(<esri2324> : ED50 / TM42)
-110.5 444 Q(<esri2325> : ED50 / TM45)110.5 456 Q(<esri2326> : Hong K)
-110.5 468 Q(ong 1980 Grid System)-.35 E
-(<esri2327> : Xian 1980 / Gauss-Kruger zone 13)110.5 480 Q
-(<esri2328> : Xian 1980 / Gauss-Kruger zone 14)110.5 492 Q
-(<esri2329> : Xian 1980 / Gauss-Kruger zone 15)110.5 504 Q
-(<esri2330> : Xian 1980 / Gauss-Kruger zone 16)110.5 516 Q
-(<esri2331> : Xian 1980 / Gauss-Kruger zone 17)110.5 528 Q
-(<esri2332> : Xian 1980 / Gauss-Kruger zone 18)110.5 540 Q
-(<esri2333> : Xian 1980 / Gauss-Kruger zone 19)110.5 552 Q
-(<esri2334> : Xian 1980 / Gauss-Kruger zone 20)110.5 564 Q
-(<esri2335> : Xian 1980 / Gauss-Kruger zone 21)110.5 576 Q
-(<esri2336> : Xian 1980 / Gauss-Kruger zone 22)110.5 588 Q
-(<esri2337> : Xian 1980 / Gauss-Kruger zone 23)110.5 600 Q
-(<esri2338> : Xian 1980 / Gauss-Kruger CM 75E)110.5 612 Q
-(<esri2339> : Xian 1980 / Gauss-Kruger CM 81E)110.5 624 Q
-(<esri2340> : Xian 1980 / Gauss-Kruger CM 87E)110.5 636 Q
-(<esri2341> : Xian 1980 / Gauss-Kruger CM 93E)110.5 648 Q
-(<esri2342> : Xian 1980 / Gauss-Kruger CM 99E)110.5 660 Q
-(<esri2343> : Xian 1980 / Gauss-Kruger CM 105E)110.5 672 Q
-(<esri2344> : Xian 1980 / Gauss-Kruger CM 111E)110.5 684 Q
-(<esri2345> : Xian 1980 / Gauss-Kruger CM 117E)110.5 696 Q
-(<esri2346> : Xian 1980 / Gauss-Kruger CM 123E)110.5 708 Q
-(<esri2347> : Xian 1980 / Gauss-Kruger CM 129E)110.5 720 Q
-(MB-System 5.0)72 768 Q(13 March 2014)140.11 E(95)193.45 E 0 Cg EP
-%%Page: 96 96
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<esri2348> : Xian 1980 / Gauss-Kruger CM 135E)
-110.5 84 Q(<esri2349> : Xian 1980 / 3-de)110.5 96 Q
-(gree Gauss-Kruger zone 25)-.15 E(<esri2350> : Xian 1980 / 3-de)110.5
-108 Q(gree Gauss-Kruger zone 26)-.15 E(<esri2351> : Xian 1980 / 3-de)
-110.5 120 Q(gree Gauss-Kruger zone 27)-.15 E
-(<esri2352> : Xian 1980 / 3-de)110.5 132 Q(gree Gauss-Kruger zone 28)
--.15 E(<esri2353> : Xian 1980 / 3-de)110.5 144 Q
-(gree Gauss-Kruger zone 29)-.15 E(<esri2354> : Xian 1980 / 3-de)110.5
-156 Q(gree Gauss-Kruger zone 30)-.15 E(<esri2355> : Xian 1980 / 3-de)
-110.5 168 Q(gree Gauss-Kruger zone 31)-.15 E
-(<esri2356> : Xian 1980 / 3-de)110.5 180 Q(gree Gauss-Kruger zone 32)
--.15 E(<esri2357> : Xian 1980 / 3-de)110.5 192 Q
-(gree Gauss-Kruger zone 33)-.15 E(<esri2358> : Xian 1980 / 3-de)110.5
-204 Q(gree Gauss-Kruger zone 34)-.15 E(<esri2359> : Xian 1980 / 3-de)
-110.5 216 Q(gree Gauss-Kruger zone 35)-.15 E
-(<esri2360> : Xian 1980 / 3-de)110.5 228 Q(gree Gauss-Kruger zone 36)
--.15 E(<esri2361> : Xian 1980 / 3-de)110.5 240 Q
-(gree Gauss-Kruger zone 37)-.15 E(<esri2362> : Xian 1980 / 3-de)110.5
-252 Q(gree Gauss-Kruger zone 38)-.15 E(<esri2363> : Xian 1980 / 3-de)
-110.5 264 Q(gree Gauss-Kruger zone 39)-.15 E
-(<esri2364> : Xian 1980 / 3-de)110.5 276 Q(gree Gauss-Kruger zone 40)
--.15 E(<esri2365> : Xian 1980 / 3-de)110.5 288 Q
-(gree Gauss-Kruger zone 41)-.15 E(<esri2366> : Xian 1980 / 3-de)110.5
-300 Q(gree Gauss-Kruger zone 42)-.15 E(<esri2367> : Xian 1980 / 3-de)
-110.5 312 Q(gree Gauss-Kruger zone 43)-.15 E
-(<esri2368> : Xian 1980 / 3-de)110.5 324 Q(gree Gauss-Kruger zone 44)
--.15 E(<esri2369> : Xian 1980 / 3-de)110.5 336 Q
-(gree Gauss-Kruger zone 45)-.15 E(<esri2370> : Xian 1980 / 3-de)110.5
-348 Q(gree Gauss-Kruger CM 75E)-.15 E(<esri2371> : Xian 1980 / 3-de)
-110.5 360 Q(gree Gauss-Kruger CM 78E)-.15 E
-(<esri2372> : Xian 1980 / 3-de)110.5 372 Q(gree Gauss-Kruger CM 81E)-.15
-E(<esri2373> : Xian 1980 / 3-de)110.5 384 Q(gree Gauss-Kruger CM 84E)
--.15 E(<esri2374> : Xian 1980 / 3-de)110.5 396 Q
-(gree Gauss-Kruger CM 87E)-.15 E(<esri2375> : Xian 1980 / 3-de)110.5 408
-Q(gree Gauss-Kruger CM 90E)-.15 E(<esri2376> : Xian 1980 / 3-de)110.5
-420 Q(gree Gauss-Kruger CM 93E)-.15 E(<esri2377> : Xian 1980 / 3-de)
-110.5 432 Q(gree Gauss-Kruger CM 96E)-.15 E
-(<esri2378> : Xian 1980 / 3-de)110.5 444 Q(gree Gauss-Kruger CM 99E)-.15
-E(<esri2379> : Xian 1980 / 3-de)110.5 456 Q(gree Gauss-Kruger CM 102E)
--.15 E(<esri2380> : Xian 1980 / 3-de)110.5 468 Q
-(gree Gauss-Kruger CM 105E)-.15 E(<esri2381> : Xian 1980 / 3-de)110.5
-480 Q(gree Gauss-Kruger CM 108E)-.15 E(<esri2382> : Xian 1980 / 3-de)
-110.5 492 Q(gree Gauss-Kruger CM 111E)-.15 E
-(<esri2383> : Xian 1980 / 3-de)110.5 504 Q(gree Gauss-Kruger CM 114E)
--.15 E(<esri2384> : Xian 1980 / 3-de)110.5 516 Q
-(gree Gauss-Kruger CM 117E)-.15 E(<esri2385> : Xian 1980 / 3-de)110.5
-528 Q(gree Gauss-Kruger CM 120E)-.15 E(<esri2386> : Xian 1980 / 3-de)
-110.5 540 Q(gree Gauss-Kruger CM 123E)-.15 E
-(<esri2387> : Xian 1980 / 3-de)110.5 552 Q(gree Gauss-Kruger CM 126E)
--.15 E(<esri2388> : Xian 1980 / 3-de)110.5 564 Q
-(gree Gauss-Kruger CM 129E)-.15 E(<esri2389> : Xian 1980 / 3-de)110.5
-576 Q(gree Gauss-Kruger CM 132E)-.15 E(<esri2390> : Xian 1980 / 3-de)
-110.5 588 Q(gree Gauss-Kruger CM 135E)-.15 E
-(<esri2391> : KKJ / Finland zone 1)110.5 600 Q
-(<esri2392> : KKJ / Finland zone 2)110.5 612 Q
-(<esri2393> : KKJ / Finland Uniform Coordinate System)110.5 624 Q
-(<esri2394> : KKJ / Finland zone 4)110.5 636 Q(<esri2395> : South Y)
-110.5 648 Q(emen / Gauss-Kruger zone 8)-1 E(<esri2396> : South Y)110.5
-660 Q(emen / Gauss-Kruger zone 9)-1 E(<esri2397> : Pulk)110.5 672 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(942\(83\) / Gauss-Kruger zone 3)-2.5 E
-(<esri2398> : Pulk)110.5 684 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942\(83\) / Gauss-Kruger zone 4)-2.5 E(<esri2399> : Pulk)110.5 696 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(942\(83\) / Gauss-Kruger zone 5)-2.5 E
-(<esri2400> : R)110.5 708 Q(T90 2.5 gon W)-.6 E
-(<esri2401> : Beijing 1954 / 3-de)110.5 720 Q(gree Gauss-Kruger zone 25)
--.15 E(MB-System 5.0)72 768 Q(13 March 2014)140.11 E(96)193.45 E 0 Cg EP
-%%Page: 97 97
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<esri2402> : Beijing 1954 / 3-de)110.5 84 Q
-(gree Gauss-Kruger zone 26)-.15 E(<esri2403> : Beijing 1954 / 3-de)110.5
-96 Q(gree Gauss-Kruger zone 27)-.15 E(<esri2404> : Beijing 1954 / 3-de)
-110.5 108 Q(gree Gauss-Kruger zone 28)-.15 E
-(<esri2405> : Beijing 1954 / 3-de)110.5 120 Q(gree Gauss-Kruger zone 29)
--.15 E(<esri2406> : Beijing 1954 / 3-de)110.5 132 Q
-(gree Gauss-Kruger zone 30)-.15 E(<esri2407> : Beijing 1954 / 3-de)110.5
-144 Q(gree Gauss-Kruger zone 31)-.15 E(<esri2408> : Beijing 1954 / 3-de)
-110.5 156 Q(gree Gauss-Kruger zone 32)-.15 E
-(<esri2409> : Beijing 1954 / 3-de)110.5 168 Q(gree Gauss-Kruger zone 33)
--.15 E(<esri2410> : Beijing 1954 / 3-de)110.5 180 Q
-(gree Gauss-Kruger zone 34)-.15 E(<esri2411> : Beijing 1954 / 3-de)110.5
-192 Q(gree Gauss-Kruger zone 35)-.15 E(<esri2412> : Beijing 1954 / 3-de)
-110.5 204 Q(gree Gauss-Kruger zone 36)-.15 E
-(<esri2413> : Beijing 1954 / 3-de)110.5 216 Q(gree Gauss-Kruger zone 37)
--.15 E(<esri2414> : Beijing 1954 / 3-de)110.5 228 Q
-(gree Gauss-Kruger zone 38)-.15 E(<esri2415> : Beijing 1954 / 3-de)110.5
-240 Q(gree Gauss-Kruger zone 39)-.15 E(<esri2416> : Beijing 1954 / 3-de)
-110.5 252 Q(gree Gauss-Kruger zone 40)-.15 E
-(<esri2417> : Beijing 1954 / 3-de)110.5 264 Q(gree Gauss-Kruger zone 41)
--.15 E(<esri2418> : Beijing 1954 / 3-de)110.5 276 Q
-(gree Gauss-Kruger zone 42)-.15 E(<esri2419> : Beijing 1954 / 3-de)110.5
-288 Q(gree Gauss-Kruger zone 43)-.15 E(<esri2420> : Beijing 1954 / 3-de)
-110.5 300 Q(gree Gauss-Kruger zone 44)-.15 E
-(<esri2421> : Beijing 1954 / 3-de)110.5 312 Q(gree Gauss-Kruger zone 45)
--.15 E(<esri2422> : Beijing 1954 / 3-de)110.5 324 Q
-(gree Gauss-Kruger CM 75E)-.15 E(<esri2423> : Beijing 1954 / 3-de)110.5
-336 Q(gree Gauss-Kruger CM 78E)-.15 E(<esri2424> : Beijing 1954 / 3-de)
-110.5 348 Q(gree Gauss-Kruger CM 81E)-.15 E
-(<esri2425> : Beijing 1954 / 3-de)110.5 360 Q(gree Gauss-Kruger CM 84E)
--.15 E(<esri2426> : Beijing 1954 / 3-de)110.5 372 Q
-(gree Gauss-Kruger CM 87E)-.15 E(<esri2427> : Beijing 1954 / 3-de)110.5
-384 Q(gree Gauss-Kruger CM 90E)-.15 E(<esri2428> : Beijing 1954 / 3-de)
-110.5 396 Q(gree Gauss-Kruger CM 93E)-.15 E
-(<esri2429> : Beijing 1954 / 3-de)110.5 408 Q(gree Gauss-Kruger CM 96E)
--.15 E(<esri2430> : Beijing 1954 / 3-de)110.5 420 Q
-(gree Gauss-Kruger CM 99E)-.15 E(<esri2431> : Beijing 1954 / 3-de)110.5
-432 Q(gree Gauss-Kruger CM 102E)-.15 E(<esri2432> : Beijing 1954 / 3-de)
-110.5 444 Q(gree Gauss-Kruger CM 105E)-.15 E
-(<esri2433> : Beijing 1954 / 3-de)110.5 456 Q(gree Gauss-Kruger CM 108E)
--.15 E(<esri2434> : Beijing 1954 / 3-de)110.5 468 Q
-(gree Gauss-Kruger CM 111E)-.15 E(<esri2435> : Beijing 1954 / 3-de)110.5
-480 Q(gree Gauss-Kruger CM 114E)-.15 E(<esri2436> : Beijing 1954 / 3-de)
-110.5 492 Q(gree Gauss-Kruger CM 117E)-.15 E
-(<esri2437> : Beijing 1954 / 3-de)110.5 504 Q(gree Gauss-Kruger CM 120E)
--.15 E(<esri2438> : Beijing 1954 / 3-de)110.5 516 Q
-(gree Gauss-Kruger CM 123E)-.15 E(<esri2439> : Beijing 1954 / 3-de)110.5
-528 Q(gree Gauss-Kruger CM 126E)-.15 E(<esri2440> : Beijing 1954 / 3-de)
-110.5 540 Q(gree Gauss-Kruger CM 129E)-.15 E
-(<esri2441> : Beijing 1954 / 3-de)110.5 552 Q(gree Gauss-Kruger CM 132E)
--.15 E(<esri2442> : Beijing 1954 / 3-de)110.5 564 Q
-(gree Gauss-Kruger CM 135E)-.15 E
-(<esri2443> : JGD2000 / Japan Plane Rectangular CS I)110.5 576 Q
-(<esri2444> : JGD2000 / Japan Plane Rectangular CS II)110.5 588 Q
-(<esri2445> : JGD2000 / Japan Plane Rectangular CS III)110.5 600 Q
-(<esri2446> : JGD2000 / Japan Plane Rectangular CS IV)110.5 612 Q
-(<esri2447> : JGD2000 / Japan Plane Rectangular CS V)110.5 624 Q
-(<esri2448> : JGD2000 / Japan Plane Rectangular CS VI)110.5 636 Q
-(<esri2449> : JGD2000 / Japan Plane Rectangular CS VII)110.5 648 Q
-(<esri2450> : JGD2000 / Japan Plane Rectangular CS VIII)110.5 660 Q
-(<esri2451> : JGD2000 / Japan Plane Rectangular CS IX)110.5 672 Q
-(<esri2452> : JGD2000 / Japan Plane Rectangular CS X)110.5 684 Q
-(<esri2453> : JGD2000 / Japan Plane Rectangular CS XI)110.5 696 Q
-(<esri2454> : JGD2000 / Japan Plane Rectangular CS XII)110.5 708 Q
-(<esri2455> : JGD2000 / Japan Plane Rectangular CS XIII)110.5 720 Q
-(MB-System 5.0)72 768 Q(13 March 2014)140.11 E(97)193.45 E 0 Cg EP
-%%Page: 98 98
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F
-(<esri2456> : JGD2000 / Japan Plane Rectangular CS XIV)110.5 84 Q
-(<esri2457> : JGD2000 / Japan Plane Rectangular CS XV)110.5 96 Q
-(<esri2458> : JGD2000 / Japan Plane Rectangular CS XVI)110.5 108 Q
-(<esri2459> : JGD2000 / Japan Plane Rectangular CS XVII)110.5 120 Q
-(<esri2460> : JGD2000 / Japan Plane Rectangular CS XVIII)110.5 132 Q
-(<esri2461> : JGD2000 / Japan Plane Rectangular CS XIX)110.5 144 Q
-(<esri2462> : Albanian 1987 / Gauss-Kruger zone 4)110.5 156 Q
-(<esri2463> : Pulk)110.5 168 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger CM 21E)-2.5 E(<esri2464> : Pulk)110.5 180 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger CM 27E)-2.5 E(<esri2465> : Pulk)
-110.5 192 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger CM 33E)-2.5 E
-(<esri2466> : Pulk)110.5 204 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger CM 39E)-2.5 E(<esri2467> : Pulk)110.5 216 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger CM 45E)-2.5 E(<esri2468> : Pulk)
-110.5 228 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger CM 51E)-2.5 E
-(<esri2469> : Pulk)110.5 240 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger CM 57E)-2.5 E(<esri2470> : Pulk)110.5 252 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger CM 63E)-2.5 E(<esri2471> : Pulk)
-110.5 264 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger CM 69E)-2.5 E
-(<esri2472> : Pulk)110.5 276 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger CM 75E)-2.5 E(<esri2473> : Pulk)110.5 288 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger CM 81E)-2.5 E(<esri2474> : Pulk)
-110.5 300 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger CM 87E)-2.5 E
-(<esri2475> : Pulk)110.5 312 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger CM 93E)-2.5 E(<esri2476> : Pulk)110.5 324 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger CM 99E)-2.5 E(<esri2477> : Pulk)
-110.5 336 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger CM 105E)-2.5
-E(<esri2478> : Pulk)110.5 348 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger CM 111E)-2.5 E(<esri2479> : Pulk)110.5 360 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger CM 117E)-2.5 E
-(<esri2480> : Pulk)110.5 372 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger CM 123E)-2.5 E(<esri2481> : Pulk)110.5 384 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger CM 129E)-2.5 E
-(<esri2482> : Pulk)110.5 396 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger CM 135E)-2.5 E(<esri2483> : Pulk)110.5 408 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger CM 141E)-2.5 E
-(<esri2484> : Pulk)110.5 420 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger CM 147E)-2.5 E(<esri2485> : Pulk)110.5 432 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger CM 153E)-2.5 E
-(<esri2486> : Pulk)110.5 444 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger CM 159E)-2.5 E(<esri2487> : Pulk)110.5 456 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger CM 165E)-2.5 E
-(<esri2488> : Pulk)110.5 468 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger CM 171E)-2.5 E(<esri2489> : Pulk)110.5 480 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger CM 177E)-2.5 E
-(<esri2490> : Pulk)110.5 492 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger CM 177W)-2.5 E(<esri2491> : Pulk)110.5 504 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger CM 171W)-2.5 E
-(<esri2492> : Pulk)110.5 516 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger CM 9E)-2.5 E(<esri2493> : Pulk)110.5 528 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger CM 15E)-2.5 E(<esri2494> : Pulk)
-110.5 540 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger CM 21E)-2.5 E
-(<esri2495> : Pulk)110.5 552 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger CM 27E)-2.5 E(<esri2496> : Pulk)110.5 564 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger CM 33E)-2.5 E(<esri2497> : Pulk)
-110.5 576 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger CM 39E)-2.5 E
-(<esri2498> : Pulk)110.5 588 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger CM 45E)-2.5 E(<esri2499> : Pulk)110.5 600 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger CM 51E)-2.5 E(<esri2500> : Pulk)
-110.5 612 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger CM 57E)-2.5 E
-(<esri2501> : Pulk)110.5 624 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger CM 63E)-2.5 E(<esri2502> : Pulk)110.5 636 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger CM 69E)-2.5 E(<esri2503> : Pulk)
-110.5 648 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger CM 75E)-2.5 E
-(<esri2504> : Pulk)110.5 660 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger CM 81E)-2.5 E(<esri2505> : Pulk)110.5 672 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger CM 87E)-2.5 E(<esri2506> : Pulk)
-110.5 684 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger CM 93E)-2.5 E
-(<esri2507> : Pulk)110.5 696 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger CM 99E)-2.5 E(<esri2508> : Pulk)110.5 708 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger CM 105E)-2.5 E(<esri2509> : Pulk)
-110.5 720 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger CM 111E)-2.5
-E(MB-System 5.0)72 768 Q(13 March 2014)140.11 E(98)193.45 E 0 Cg EP
-%%Page: 99 99
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<esri2510> : Pulk)110.5 84 Q -.15(ov)-.1 G 2.5
-(o1)-.05 G(942 / Gauss-Kruger CM 117E)-2.5 E(<esri2511> : Pulk)110.5 96
-Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger CM 123E)-2.5 E
-(<esri2512> : Pulk)110.5 108 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger CM 129E)-2.5 E(<esri2513> : Pulk)110.5 120 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger CM 135E)-2.5 E
-(<esri2514> : Pulk)110.5 132 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger CM 141E)-2.5 E(<esri2515> : Pulk)110.5 144 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger CM 147E)-2.5 E
-(<esri2516> : Pulk)110.5 156 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger CM 153E)-2.5 E(<esri2517> : Pulk)110.5 168 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger CM 159E)-2.5 E
-(<esri2518> : Pulk)110.5 180 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger CM 165E)-2.5 E(<esri2519> : Pulk)110.5 192 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger CM 171E)-2.5 E
-(<esri2520> : Pulk)110.5 204 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger CM 177E)-2.5 E(<esri2521> : Pulk)110.5 216 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger CM 177W)-2.5 E
-(<esri2522> : Pulk)110.5 228 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger CM 171W)-2.5 E(<esri2523> : Pulk)110.5 240 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 7)-.15
-E(<esri2524> : Pulk)110.5 252 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)
--2.5 E(gree Gauss-Kruger zone 8)-.15 E(<esri2525> : Pulk)110.5 264 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 9)
--.15 E(<esri2526> : Pulk)110.5 276 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 10)-.15 E(<esri2527> : Pulk)
-110.5 288 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E
-(gree Gauss-Kruger zone 11)-.15 E(<esri2528> : Pulk)110.5 300 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 12)-.15 E
-(<esri2529> : Pulk)110.5 312 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)
--2.5 E(gree Gauss-Kruger zone 13)-.15 E(<esri2530> : Pulk)110.5 324 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 14)
--.15 E(<esri2531> : Pulk)110.5 336 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 15)-.15 E(<esri2532> : Pulk)
-110.5 348 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E
-(gree Gauss-Kruger zone 16)-.15 E(<esri2533> : Pulk)110.5 360 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 17)-.15 E
-(<esri2534> : Pulk)110.5 372 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)
--2.5 E(gree Gauss-Kruger zone 18)-.15 E(<esri2535> : Pulk)110.5 384 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 19)
--.15 E(<esri2536> : Pulk)110.5 396 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 20)-.15 E(<esri2537> : Pulk)
-110.5 408 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E
-(gree Gauss-Kruger zone 21)-.15 E(<esri2538> : Pulk)110.5 420 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 22)-.15 E
-(<esri2539> : Pulk)110.5 432 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)
--2.5 E(gree Gauss-Kruger zone 23)-.15 E(<esri2540> : Pulk)110.5 444 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 24)
--.15 E(<esri2541> : Pulk)110.5 456 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 25)-.15 E(<esri2542> : Pulk)
-110.5 468 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E
-(gree Gauss-Kruger zone 26)-.15 E(<esri2543> : Pulk)110.5 480 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 27)-.15 E
-(<esri2544> : Pulk)110.5 492 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)
--2.5 E(gree Gauss-Kruger zone 28)-.15 E(<esri2545> : Pulk)110.5 504 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 29)
--.15 E(<esri2546> : Pulk)110.5 516 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 30)-.15 E(<esri2547> : Pulk)
-110.5 528 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E
-(gree Gauss-Kruger zone 31)-.15 E(<esri2548> : Pulk)110.5 540 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 32)-.15 E
-(<esri2549> : Pulk)110.5 552 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)
--2.5 E(gree Gauss-Kruger zone 33)-.15 E
-(<esri2550> : Samboja / UTM zone 50S)110.5 564 Q(<esri2551> : Pulk)110.5
-576 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E
-(gree Gauss-Kruger zone 34)-.15 E(<esri2552> : Pulk)110.5 588 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 35)-.15 E
-(<esri2553> : Pulk)110.5 600 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)
--2.5 E(gree Gauss-Kruger zone 36)-.15 E(<esri2554> : Pulk)110.5 612 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 37)
--.15 E(<esri2555> : Pulk)110.5 624 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 38)-.15 E(<esri2556> : Pulk)
-110.5 636 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E
-(gree Gauss-Kruger zone 39)-.15 E(<esri2557> : Pulk)110.5 648 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 40)-.15 E
-(<esri2558> : Pulk)110.5 660 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)
--2.5 E(gree Gauss-Kruger zone 41)-.15 E(<esri2559> : Pulk)110.5 672 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 42)
--.15 E(<esri2560> : Pulk)110.5 684 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 43)-.15 E(<esri2561> : Pulk)
-110.5 696 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E
-(gree Gauss-Kruger zone 44)-.15 E(<esri2562> : Pulk)110.5 708 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 45)-.15 E
-(<esri2563> : Pulk)110.5 720 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)
--2.5 E(gree Gauss-Kruger zone 46)-.15 E(MB-System 5.0)72 768 Q
-(13 March 2014)140.11 E(99)193.45 E 0 Cg EP
-%%Page: 100 100
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<esri2564> : Pulk)110.5 84 Q -.15(ov)-.1 G 2.5
-(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 47)-.15 E
-(<esri2565> : Pulk)110.5 96 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)
--2.5 E(gree Gauss-Kruger zone 48)-.15 E(<esri2566> : Pulk)110.5 108 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 49)
--.15 E(<esri2567> : Pulk)110.5 120 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 50)-.15 E(<esri2568> : Pulk)
-110.5 132 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E
-(gree Gauss-Kruger zone 51)-.15 E(<esri2569> : Pulk)110.5 144 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 52)-.15 E
-(<esri2570> : Pulk)110.5 156 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)
--2.5 E(gree Gauss-Kruger zone 53)-.15 E(<esri2571> : Pulk)110.5 168 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 54)
--.15 E(<esri2572> : Pulk)110.5 180 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 55)-.15 E(<esri2573> : Pulk)
-110.5 192 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E
-(gree Gauss-Kruger zone 56)-.15 E(<esri2574> : Pulk)110.5 204 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 57)-.15 E
-(<esri2575> : Pulk)110.5 216 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)
--2.5 E(gree Gauss-Kruger zone 58)-.15 E(<esri2576> : Pulk)110.5 228 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 59)
--.15 E(<esri2577> : Pulk)110.5 240 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 60)-.15 E(<esri2578> : Pulk)
-110.5 252 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E
-(gree Gauss-Kruger zone 61)-.15 E(<esri2579> : Pulk)110.5 264 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 62)-.15 E
-(<esri2580> : Pulk)110.5 276 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)
--2.5 E(gree Gauss-Kruger zone 63)-.15 E(<esri2581> : Pulk)110.5 288 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger zone 64)
--.15 E(<esri2582> : Pulk)110.5 300 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 21E)-.15 E(<esri2583> : Pulk)
-110.5 312 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E
-(gree Gauss-Kruger CM 24E)-.15 E(<esri2584> : Pulk)110.5 324 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 27E)-.15 E
-(<esri2585> : Pulk)110.5 336 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)
--2.5 E(gree Gauss-Kruger CM 30E)-.15 E(<esri2586> : Pulk)110.5 348 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 33E)
--.15 E(<esri2587> : Pulk)110.5 360 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 36E)-.15 E(<esri2588> : Pulk)
-110.5 372 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E
-(gree Gauss-Kruger CM 39E)-.15 E(<esri2589> : Pulk)110.5 384 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 42E)-.15 E
-(<esri2590> : Pulk)110.5 396 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)
--2.5 E(gree Gauss-Kruger CM 45E)-.15 E(<esri2591> : Pulk)110.5 408 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 48E)
--.15 E(<esri2592> : Pulk)110.5 420 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 51E)-.15 E(<esri2593> : Pulk)
-110.5 432 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E
-(gree Gauss-Kruger CM 54E)-.15 E(<esri2594> : Pulk)110.5 444 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 57E)-.15 E
-(<esri2595> : Pulk)110.5 456 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)
--2.5 E(gree Gauss-Kruger CM 60E)-.15 E(<esri2596> : Pulk)110.5 468 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 63E)
--.15 E(<esri2597> : Pulk)110.5 480 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 66E)-.15 E(<esri2598> : Pulk)
-110.5 492 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E
-(gree Gauss-Kruger CM 69E)-.15 E(<esri2599> : Pulk)110.5 504 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 72E)-.15 E
-(<esri2600> : Lietuv)110.5 516 Q(os K)-.2 E(oordinoei Sistema 1994)-.35
-E(<esri2601> : Pulk)110.5 528 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)
--2.5 E(gree Gauss-Kruger CM 75E)-.15 E(<esri2602> : Pulk)110.5 540 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 78E)
--.15 E(<esri2603> : Pulk)110.5 552 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 81E)-.15 E(<esri2604> : Pulk)
-110.5 564 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E
-(gree Gauss-Kruger CM 84E)-.15 E(<esri2605> : Pulk)110.5 576 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 87E)-.15 E
-(<esri2606> : Pulk)110.5 588 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)
--2.5 E(gree Gauss-Kruger CM 90E)-.15 E(<esri2607> : Pulk)110.5 600 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 93E)
--.15 E(<esri2608> : Pulk)110.5 612 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 96E)-.15 E(<esri2609> : Pulk)
-110.5 624 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E
-(gree Gauss-Kruger CM 99E)-.15 E(<esri2610> : Pulk)110.5 636 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 102E)-.15 E
-(<esri2611> : Pulk)110.5 648 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)
--2.5 E(gree Gauss-Kruger CM 105E)-.15 E(<esri2612> : Pulk)110.5 660 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 108E)
--.15 E(<esri2613> : Pulk)110.5 672 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 111E)-.15 E(<esri2614> : Pulk)
-110.5 684 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E
-(gree Gauss-Kruger CM 114E)-.15 E(<esri2615> : Pulk)110.5 696 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 117E)-.15 E
-(<esri2616> : Pulk)110.5 708 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)
--2.5 E(gree Gauss-Kruger CM 120E)-.15 E(<esri2617> : Pulk)110.5 720 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 123E)
--.15 E(MB-System 5.0)72 768 Q(13 March 2014)140.11 E(100)188.45 E 0 Cg
-EP
-%%Page: 101 101
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<esri2618> : Pulk)110.5 84 Q -.15(ov)-.1 G 2.5
-(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 126E)-.15 E
-(<esri2619> : Pulk)110.5 96 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)
--2.5 E(gree Gauss-Kruger CM 129E)-.15 E(<esri2620> : Pulk)110.5 108 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 132E)
--.15 E(<esri2621> : Pulk)110.5 120 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 135E)-.15 E(<esri2622> : Pulk)
-110.5 132 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E
-(gree Gauss-Kruger CM 138E)-.15 E(<esri2623> : Pulk)110.5 144 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 141E)-.15 E
-(<esri2624> : Pulk)110.5 156 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)
--2.5 E(gree Gauss-Kruger CM 144E)-.15 E(<esri2625> : Pulk)110.5 168 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 147E)
--.15 E(<esri2626> : Pulk)110.5 180 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 150E)-.15 E(<esri2627> : Pulk)
-110.5 192 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E
-(gree Gauss-Kruger CM 153E)-.15 E(<esri2628> : Pulk)110.5 204 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 156E)-.15 E
-(<esri2629> : Pulk)110.5 216 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)
--2.5 E(gree Gauss-Kruger CM 159E)-.15 E(<esri2630> : Pulk)110.5 228 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 162E)
--.15 E(<esri2631> : Pulk)110.5 240 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 165E)-.15 E(<esri2632> : Pulk)
-110.5 252 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E
-(gree Gauss-Kruger CM 168E)-.15 E(<esri2633> : Pulk)110.5 264 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 171E)-.15 E
-(<esri2634> : Pulk)110.5 276 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)
--2.5 E(gree Gauss-Kruger CM 174E)-.15 E(<esri2635> : Pulk)110.5 288 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 177E)
--.15 E(<esri2636> : Pulk)110.5 300 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 180E)-.15 E(<esri2637> : Pulk)
-110.5 312 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E
-(gree Gauss-Kruger CM 177W)-.15 E(<esri2638> : Pulk)110.5 324 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 174W)-.15 E
-(<esri2639> : Pulk)110.5 336 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)
--2.5 E(gree Gauss-Kruger CM 171W)-.15 E(<esri2640> : Pulk)110.5 348 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(942 / 3-de)-2.5 E(gree Gauss-Kruger CM 168W)
--.15 E(<esri2641> : Pulk)110.5 360 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 7)-.15 E(<esri2642> : Pulk)
-110.5 372 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E
-(gree Gauss-Kruger zone 8)-.15 E(<esri2643> : Pulk)110.5 384 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 9)-.15 E
-(<esri2644> : Pulk)110.5 396 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)
--2.5 E(gree Gauss-Kruger zone 10)-.15 E(<esri2645> : Pulk)110.5 408 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 11)
--.15 E(<esri2646> : Pulk)110.5 420 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 12)-.15 E(<esri2647> : Pulk)
-110.5 432 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E
-(gree Gauss-Kruger zone 13)-.15 E(<esri2648> : Pulk)110.5 444 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 14)-.15 E
-(<esri2649> : Pulk)110.5 456 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)
--2.5 E(gree Gauss-Kruger zone 15)-.15 E(<esri2650> : Pulk)110.5 468 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 16)
--.15 E(<esri2651> : Pulk)110.5 480 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 17)-.15 E(<esri2652> : Pulk)
-110.5 492 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E
-(gree Gauss-Kruger zone 18)-.15 E(<esri2653> : Pulk)110.5 504 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 19)-.15 E
-(<esri2654> : Pulk)110.5 516 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)
--2.5 E(gree Gauss-Kruger zone 20)-.15 E(<esri2655> : Pulk)110.5 528 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 21)
--.15 E(<esri2656> : Pulk)110.5 540 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 22)-.15 E(<esri2657> : Pulk)
-110.5 552 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E
-(gree Gauss-Kruger zone 23)-.15 E(<esri2658> : Pulk)110.5 564 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 24)-.15 E
-(<esri2659> : Pulk)110.5 576 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)
--2.5 E(gree Gauss-Kruger zone 25)-.15 E(<esri2660> : Pulk)110.5 588 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 26)
--.15 E(<esri2661> : Pulk)110.5 600 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 27)-.15 E(<esri2662> : Pulk)
-110.5 612 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E
-(gree Gauss-Kruger zone 28)-.15 E(<esri2663> : Pulk)110.5 624 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 29)-.15 E
-(<esri2664> : Pulk)110.5 636 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)
--2.5 E(gree Gauss-Kruger zone 30)-.15 E(<esri2665> : Pulk)110.5 648 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 31)
--.15 E(<esri2666> : Pulk)110.5 660 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 32)-.15 E(<esri2667> : Pulk)
-110.5 672 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E
-(gree Gauss-Kruger zone 33)-.15 E(<esri2668> : Pulk)110.5 684 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 34)-.15 E
-(<esri2669> : Pulk)110.5 696 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)
--2.5 E(gree Gauss-Kruger zone 35)-.15 E(<esri2670> : Pulk)110.5 708 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 36)
--.15 E(<esri2671> : Pulk)110.5 720 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 37)-.15 E(MB-System 5.0)72 768
-Q(13 March 2014)140.11 E(101)188.45 E 0 Cg EP
-%%Page: 102 102
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<esri2672> : Pulk)110.5 84 Q -.15(ov)-.1 G 2.5
-(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 38)-.15 E
-(<esri2673> : Pulk)110.5 96 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)
--2.5 E(gree Gauss-Kruger zone 39)-.15 E(<esri2674> : Pulk)110.5 108 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 40)
--.15 E(<esri2675> : Pulk)110.5 120 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 41)-.15 E(<esri2676> : Pulk)
-110.5 132 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E
-(gree Gauss-Kruger zone 42)-.15 E(<esri2677> : Pulk)110.5 144 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 43)-.15 E
-(<esri2678> : Pulk)110.5 156 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)
--2.5 E(gree Gauss-Kruger zone 44)-.15 E(<esri2679> : Pulk)110.5 168 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 45)
--.15 E(<esri2680> : Pulk)110.5 180 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 46)-.15 E(<esri2681> : Pulk)
-110.5 192 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E
-(gree Gauss-Kruger zone 47)-.15 E(<esri2682> : Pulk)110.5 204 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 48)-.15 E
-(<esri2683> : Pulk)110.5 216 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)
--2.5 E(gree Gauss-Kruger zone 49)-.15 E(<esri2684> : Pulk)110.5 228 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 50)
--.15 E(<esri2685> : Pulk)110.5 240 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 51)-.15 E(<esri2686> : Pulk)
-110.5 252 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E
-(gree Gauss-Kruger zone 52)-.15 E(<esri2687> : Pulk)110.5 264 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 53)-.15 E
-(<esri2688> : Pulk)110.5 276 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)
--2.5 E(gree Gauss-Kruger zone 54)-.15 E(<esri2689> : Pulk)110.5 288 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 55)
--.15 E(<esri2690> : Pulk)110.5 300 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 56)-.15 E(<esri2691> : Pulk)
-110.5 312 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E
-(gree Gauss-Kruger zone 57)-.15 E(<esri2692> : Pulk)110.5 324 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 58)-.15 E
-(<esri2693> : Pulk)110.5 336 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)
--2.5 E(gree Gauss-Kruger zone 59)-.15 E(<esri2694> : Pulk)110.5 348 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 60)
--.15 E(<esri2695> : Pulk)110.5 360 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 61)-.15 E(<esri2696> : Pulk)
-110.5 372 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E
-(gree Gauss-Kruger zone 62)-.15 E(<esri2697> : Pulk)110.5 384 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger zone 63)-.15 E
-(<esri2698> : Pulk)110.5 396 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)
--2.5 E(gree Gauss-Kruger zone 64)-.15 E(<esri2699> : Pulk)110.5 408 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 21E)
--.15 E(<esri2700> : Pulk)110.5 420 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 24E)-.15 E(<esri2701> : Pulk)
-110.5 432 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E
-(gree Gauss-Kruger CM 27E)-.15 E(<esri2702> : Pulk)110.5 444 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 30E)-.15 E
-(<esri2703> : Pulk)110.5 456 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)
--2.5 E(gree Gauss-Kruger CM 33E)-.15 E(<esri2704> : Pulk)110.5 468 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 36E)
--.15 E(<esri2705> : Pulk)110.5 480 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 39E)-.15 E(<esri2706> : Pulk)
-110.5 492 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E
-(gree Gauss-Kruger CM 42E)-.15 E(<esri2707> : Pulk)110.5 504 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 45E)-.15 E
-(<esri2708> : Pulk)110.5 516 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)
--2.5 E(gree Gauss-Kruger CM 48E)-.15 E(<esri2709> : Pulk)110.5 528 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 51E)
--.15 E(<esri2710> : Pulk)110.5 540 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 54E)-.15 E(<esri2711> : Pulk)
-110.5 552 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E
-(gree Gauss-Kruger CM 57E)-.15 E(<esri2712> : Pulk)110.5 564 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 60E)-.15 E
-(<esri2713> : Pulk)110.5 576 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)
--2.5 E(gree Gauss-Kruger CM 63E)-.15 E(<esri2714> : Pulk)110.5 588 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 66E)
--.15 E(<esri2715> : Pulk)110.5 600 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 69E)-.15 E(<esri2716> : Pulk)
-110.5 612 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E
-(gree Gauss-Kruger CM 72E)-.15 E(<esri2717> : Pulk)110.5 624 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 75E)-.15 E
-(<esri2718> : Pulk)110.5 636 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)
--2.5 E(gree Gauss-Kruger CM 78E)-.15 E(<esri2719> : Pulk)110.5 648 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 81E)
--.15 E(<esri2720> : Pulk)110.5 660 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 84E)-.15 E(<esri2721> : Pulk)
-110.5 672 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E
-(gree Gauss-Kruger CM 87E)-.15 E(<esri2722> : Pulk)110.5 684 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 90E)-.15 E
-(<esri2723> : Pulk)110.5 696 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)
--2.5 E(gree Gauss-Kruger CM 93E)-.15 E(<esri2724> : Pulk)110.5 708 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 96E)
--.15 E(<esri2725> : Pulk)110.5 720 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 99E)-.15 E(MB-System 5.0)72 768
-Q(13 March 2014)140.11 E(102)188.45 E 0 Cg EP
-%%Page: 103 103
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<esri2726> : Pulk)110.5 84 Q -.15(ov)-.1 G 2.5
-(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 102E)-.15 E
-(<esri2727> : Pulk)110.5 96 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)
--2.5 E(gree Gauss-Kruger CM 105E)-.15 E(<esri2728> : Pulk)110.5 108 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 108E)
--.15 E(<esri2729> : Pulk)110.5 120 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 111E)-.15 E(<esri2730> : Pulk)
-110.5 132 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E
-(gree Gauss-Kruger CM 114E)-.15 E(<esri2731> : Pulk)110.5 144 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 117E)-.15 E
-(<esri2732> : Pulk)110.5 156 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)
--2.5 E(gree Gauss-Kruger CM 120E)-.15 E(<esri2733> : Pulk)110.5 168 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 123E)
--.15 E(<esri2734> : Pulk)110.5 180 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 126E)-.15 E(<esri2735> : Pulk)
-110.5 192 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E
-(gree Gauss-Kruger CM 129E)-.15 E(<esri2736> : T)110.5 204 Q
-(ete / UTM zone 36S)-.7 E(<esri2737> : T)110.5 216 Q(ete / UTM zone 37S)
--.7 E(<esri2738> : Pulk)110.5 228 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 132E)-.15 E(<esri2739> : Pulk)
-110.5 240 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E
-(gree Gauss-Kruger CM 135E)-.15 E(<esri2740> : Pulk)110.5 252 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 138E)-.15 E
-(<esri2741> : Pulk)110.5 264 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)
--2.5 E(gree Gauss-Kruger CM 141E)-.15 E(<esri2742> : Pulk)110.5 276 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 144E)
--.15 E(<esri2743> : Pulk)110.5 288 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 147E)-.15 E(<esri2744> : Pulk)
-110.5 300 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E
-(gree Gauss-Kruger CM 150E)-.15 E(<esri2745> : Pulk)110.5 312 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 153E)-.15 E
-(<esri2746> : Pulk)110.5 324 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)
--2.5 E(gree Gauss-Kruger CM 156E)-.15 E(<esri2747> : Pulk)110.5 336 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 159E)
--.15 E(<esri2748> : Pulk)110.5 348 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 162E)-.15 E(<esri2749> : Pulk)
-110.5 360 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E
-(gree Gauss-Kruger CM 165E)-.15 E(<esri2750> : Pulk)110.5 372 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 168E)-.15 E
-(<esri2751> : Pulk)110.5 384 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)
--2.5 E(gree Gauss-Kruger CM 171E)-.15 E(<esri2752> : Pulk)110.5 396 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 174E)
--.15 E(<esri2753> : Pulk)110.5 408 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 177E)-.15 E(<esri2754> : Pulk)
-110.5 420 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E
-(gree Gauss-Kruger CM 180E)-.15 E(<esri2755> : Pulk)110.5 432 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 177W)-.15 E
-(<esri2756> : Pulk)110.5 444 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)
--2.5 E(gree Gauss-Kruger CM 174W)-.15 E(<esri2757> : Pulk)110.5 456 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 171W)
--.15 E(<esri2758> : Pulk)110.5 468 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / 3-de)-2.5 E(gree Gauss-Kruger CM 168W)-.15 E(<esri2759> : N)110.5
-480 Q(AD83\(HARN\) / Alabama East)-.35 E(<esri2760> : N)110.5 492 Q
-(AD83\(HARN\) / Alabama W)-.35 E(est)-.8 E(<esri2761> : N)110.5 504 Q
-(AD83\(HARN\) / Arizona East)-.35 E(<esri2762> : N)110.5 516 Q
-(AD83\(HARN\) / Arizona Central)-.35 E(<esri2763> : N)110.5 528 Q
-(AD83\(HARN\) / Arizona W)-.35 E(est)-.8 E(<esri2764> : N)110.5 540 Q
-(AD83\(HARN\) / Arkansas North)-.35 E(<esri2765> : N)110.5 552 Q
-(AD83\(HARN\) / Arkansas South)-.35 E(<esri2766> : N)110.5 564 Q
-(AD83\(HARN\) / California zone 1)-.35 E(<esri2767> : N)110.5 576 Q
-(AD83\(HARN\) / California zone 2)-.35 E(<esri2768> : N)110.5 588 Q
-(AD83\(HARN\) / California zone 3)-.35 E(<esri2769> : N)110.5 600 Q
-(AD83\(HARN\) / California zone 4)-.35 E(<esri2770> : N)110.5 612 Q
-(AD83\(HARN\) / California zone 5)-.35 E(<esri2771> : N)110.5 624 Q
-(AD83\(HARN\) / California zone 6)-.35 E(<esri2772> : N)110.5 636 Q
-(AD83\(HARN\) / Colorado North)-.35 E(<esri2773> : N)110.5 648 Q
-(AD83\(HARN\) / Colorado Central)-.35 E(<esri2774> : N)110.5 660 Q
-(AD83\(HARN\) / Colorado South)-.35 E(<esri2775> : N)110.5 672 Q
-(AD83\(HARN\) / Connecticut)-.35 E(<esri2776> : N)110.5 684 Q
-(AD83\(HARN\) / Dela)-.35 E -.1(wa)-.15 G(re).1 E(<esri2777> : N)110.5
-696 Q(AD83\(HARN\) / Florida East)-.35 E(<esri2778> : N)110.5 708 Q
-(AD83\(HARN\) / Florida W)-.35 E(est)-.8 E(<esri2779> : N)110.5 720 Q
-(AD83\(HARN\) / Florida North)-.35 E(MB-System 5.0)72 768 Q
-(13 March 2014)140.11 E(103)188.45 E 0 Cg EP
-%%Page: 104 104
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<esri2780> : N)110.5 84 Q(AD83\(HARN\) / Geor)
--.35 E(gia East)-.18 E(<esri2781> : N)110.5 96 Q(AD83\(HARN\) / Geor)
--.35 E(gia W)-.18 E(est)-.8 E(<esri2782> : N)110.5 108 Q
-(AD83\(HARN\) / Ha)-.35 E -.1(wa)-.15 G(ii zone 1).1 E(<esri2783> : N)
-110.5 120 Q(AD83\(HARN\) / Ha)-.35 E -.1(wa)-.15 G(ii zone 2).1 E
-(<esri2784> : N)110.5 132 Q(AD83\(HARN\) / Ha)-.35 E -.1(wa)-.15 G
-(ii zone 3).1 E(<esri2785> : N)110.5 144 Q(AD83\(HARN\) / Ha)-.35 E -.1
-(wa)-.15 G(ii zone 4).1 E(<esri2786> : N)110.5 156 Q(AD83\(HARN\) / Ha)
--.35 E -.1(wa)-.15 G(ii zone 5).1 E(<esri2787> : N)110.5 168 Q
-(AD83\(HARN\) / Idaho East)-.35 E(<esri2788> : N)110.5 180 Q
-(AD83\(HARN\) / Idaho Central)-.35 E(<esri2789> : N)110.5 192 Q
-(AD83\(HARN\) / Idaho W)-.35 E(est)-.8 E(<esri2790> : N)110.5 204 Q
-(AD83\(HARN\) / Illinois East)-.35 E(<esri2791> : N)110.5 216 Q
-(AD83\(HARN\) / Illinois W)-.35 E(est)-.8 E(<esri2792> : N)110.5 228 Q
-(AD83\(HARN\) / Indiana East)-.35 E(<esri2793> : N)110.5 240 Q
-(AD83\(HARN\) / Indiana W)-.35 E(est)-.8 E(<esri2794> : N)110.5 252 Q
-(AD83\(HARN\) / Io)-.35 E .2 -.1(wa N)-.25 H(orth).1 E(<esri2795> : N)
-110.5 264 Q(AD83\(HARN\) / Io)-.35 E .2 -.1(wa S)-.25 H(outh).1 E
-(<esri2796> : N)110.5 276 Q(AD83\(HARN\) / Kansas North)-.35 E
-(<esri2797> : N)110.5 288 Q(AD83\(HARN\) / Kansas South)-.35 E
-(<esri2798> : N)110.5 300 Q(AD83\(HARN\) / K)-.35 E(entuck)-.25 E 2.5
-(yN)-.15 G(orth)-2.5 E(<esri2799> : N)110.5 312 Q(AD83\(HARN\) / K)-.35
-E(entuck)-.25 E 2.5(yS)-.15 G(outh)-2.5 E(<esri2800> : N)110.5 324 Q
-(AD83\(HARN\) / Louisiana North)-.35 E(<esri2801> : N)110.5 336 Q
-(AD83\(HARN\) / Louisiana South)-.35 E(<esri2802> : N)110.5 348 Q
-(AD83\(HARN\) / Maine East)-.35 E(<esri2803> : N)110.5 360 Q
-(AD83\(HARN\) / Maine W)-.35 E(est)-.8 E(<esri2804> : N)110.5 372 Q
-(AD83\(HARN\) / Maryland)-.35 E(<esri2805> : N)110.5 384 Q
-(AD83\(HARN\) / Massachusetts Mainland)-.35 E(<esri2806> : N)110.5 396 Q
-(AD83\(HARN\) / Massachusetts Island)-.35 E(<esri2807> : N)110.5 408 Q
-(AD83\(HARN\) / Michig)-.35 E(an North)-.05 E(<esri2808> : N)110.5 420 Q
-(AD83\(HARN\) / Michig)-.35 E(an Central)-.05 E(<esri2809> : N)110.5 432
-Q(AD83\(HARN\) / Michig)-.35 E(an South)-.05 E(<esri2810> : N)110.5 444
-Q(AD83\(HARN\) / Minnesota North)-.35 E(<esri2811> : N)110.5 456 Q
-(AD83\(HARN\) / Minnesota Central)-.35 E(<esri2812> : N)110.5 468 Q
-(AD83\(HARN\) / Minnesota South)-.35 E(<esri2813> : N)110.5 480 Q
-(AD83\(HARN\) / Mississippi East)-.35 E(<esri2814> : N)110.5 492 Q
-(AD83\(HARN\) / Mississippi W)-.35 E(est)-.8 E(<esri2815> : N)110.5 504
-Q(AD83\(HARN\) / Missouri East)-.35 E(<esri2816> : N)110.5 516 Q
-(AD83\(HARN\) / Missouri Central)-.35 E(<esri2817> : N)110.5 528 Q
-(AD83\(HARN\) / Missouri W)-.35 E(est)-.8 E(<esri2818> : N)110.5 540 Q
-(AD83\(HARN\) / Montana)-.35 E(<esri2819> : N)110.5 552 Q
-(AD83\(HARN\) / Nebraska)-.35 E(<esri2820> : N)110.5 564 Q
-(AD83\(HARN\) / Ne)-.35 E -.25(va)-.25 G(da East).25 E(<esri2821> : N)
-110.5 576 Q(AD83\(HARN\) / Ne)-.35 E -.25(va)-.25 G(da Central).25 E
-(<esri2822> : N)110.5 588 Q(AD83\(HARN\) / Ne)-.35 E -.25(va)-.25 G
-(da W).25 E(est)-.8 E(<esri2823> : N)110.5 600 Q(AD83\(HARN\) / Ne)-.35
-E 2.5(wH)-.25 G(ampshire)-2.5 E(<esri2824> : N)110.5 612 Q
-(AD83\(HARN\) / Ne)-.35 E 2.5(wJ)-.25 G(erse)-2.5 E(y)-.15 E
-(<esri2825> : N)110.5 624 Q(AD83\(HARN\) / Ne)-.35 E 2.5(wM)-.25 G -.15
-(ex)-2.5 G(ico East).15 E(<esri2826> : N)110.5 636 Q(AD83\(HARN\) / Ne)
--.35 E 2.5(wM)-.25 G -.15(ex)-2.5 G(ico Central).15 E(<esri2827> : N)
-110.5 648 Q(AD83\(HARN\) / Ne)-.35 E 2.5(wM)-.25 G -.15(ex)-2.5 G(ico W)
-.15 E(est)-.8 E(<esri2828> : N)110.5 660 Q(AD83\(HARN\) / Ne)-.35 E 2.5
-(wY)-.25 G(ork East)-3.6 E(<esri2829> : N)110.5 672 Q(AD83\(HARN\) / Ne)
--.35 E 2.5(wY)-.25 G(ork Central)-3.6 E(<esri2830> : N)110.5 684 Q
-(AD83\(HARN\) / Ne)-.35 E 2.5(wY)-.25 G(ork W)-3.6 E(est)-.8 E
-(<esri2831> : N)110.5 696 Q(AD83\(HARN\) / Ne)-.35 E 2.5(wY)-.25 G
-(ork Long Island)-3.6 E(<esri2832> : N)110.5 708 Q
-(AD83\(HARN\) / North Dak)-.35 E(ota North)-.1 E(<esri2833> : N)110.5
-720 Q(AD83\(HARN\) / North Dak)-.35 E(ota South)-.1 E(MB-System 5.0)72
-768 Q(13 March 2014)140.11 E(104)188.45 E 0 Cg EP
-%%Page: 105 105
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<esri2834> : N)110.5 84 Q
-(AD83\(HARN\) / Ohio North)-.35 E(<esri2835> : N)110.5 96 Q
-(AD83\(HARN\) / Ohio South)-.35 E(<esri2836> : N)110.5 108 Q
-(AD83\(HARN\) / Oklahoma North)-.35 E(<esri2837> : N)110.5 120 Q
-(AD83\(HARN\) / Oklahoma South)-.35 E(<esri2838> : N)110.5 132 Q
-(AD83\(HARN\) / Ore)-.35 E(gon North)-.15 E(<esri2839> : N)110.5 144 Q
-(AD83\(HARN\) / Ore)-.35 E(gon South)-.15 E(<esri2840> : N)110.5 156 Q
-(AD83\(HARN\) / Rhode Island)-.35 E(<esri2841> : N)110.5 168 Q
-(AD83\(HARN\) / South Dak)-.35 E(ota North)-.1 E(<esri2842> : N)110.5
-180 Q(AD83\(HARN\) / South Dak)-.35 E(ota South)-.1 E(<esri2843> : N)
-110.5 192 Q(AD83\(HARN\) / T)-.35 E(ennessee)-.7 E(<esri2844> : N)110.5
-204 Q(AD83\(HARN\) / T)-.35 E -.15(ex)-.7 G(as North).15 E
-(<esri2845> : N)110.5 216 Q(AD83\(HARN\) / T)-.35 E -.15(ex)-.7 G
-(as North Central).15 E(<esri2846> : N)110.5 228 Q(AD83\(HARN\) / T)-.35
-E -.15(ex)-.7 G(as Central).15 E(<esri2847> : N)110.5 240 Q
-(AD83\(HARN\) / T)-.35 E -.15(ex)-.7 G(as South Central).15 E
-(<esri2848> : N)110.5 252 Q(AD83\(HARN\) / T)-.35 E -.15(ex)-.7 G
-(as South).15 E(<esri2849> : N)110.5 264 Q(AD83\(HARN\) / Utah North)
--.35 E(<esri2850> : N)110.5 276 Q(AD83\(HARN\) / Utah Central)-.35 E
-(<esri2851> : N)110.5 288 Q(AD83\(HARN\) / Utah South)-.35 E
-(<esri2852> : N)110.5 300 Q(AD83\(HARN\) / V)-.35 E(ermont)-1.11 E
-(<esri2853> : N)110.5 312 Q(AD83\(HARN\) / V)-.35 E(ir)-.6 E
-(ginia North)-.18 E(<esri2854> : N)110.5 324 Q(AD83\(HARN\) / V)-.35 E
-(ir)-.6 E(ginia South)-.18 E(<esri2855> : N)110.5 336 Q
-(AD83\(HARN\) / W)-.35 E(ashington North)-.8 E(<esri2856> : N)110.5 348
-Q(AD83\(HARN\) / W)-.35 E(ashington South)-.8 E(<esri2857> : N)110.5 360
-Q(AD83\(HARN\) / W)-.35 E(est V)-.8 E(ir)-.6 E(ginia North)-.18 E
-(<esri2858> : N)110.5 372 Q(AD83\(HARN\) / W)-.35 E(est V)-.8 E(ir)-.6 E
-(ginia South)-.18 E(<esri2859> : N)110.5 384 Q(AD83\(HARN\) / W)-.35 E
-(isconsin North)-.4 E(<esri2860> : N)110.5 396 Q(AD83\(HARN\) / W)-.35 E
-(isconsin Central)-.4 E(<esri2861> : N)110.5 408 Q(AD83\(HARN\) / W)-.35
-E(isconsin South)-.4 E(<esri2862> : N)110.5 420 Q(AD83\(HARN\) / W)-.35
-E(yoming East)-.73 E(<esri2863> : N)110.5 432 Q(AD83\(HARN\) / W)-.35 E
-(yoming East Central)-.73 E(<esri2864> : N)110.5 444 Q(AD83\(HARN\) / W)
--.35 E(yoming W)-.73 E(est Central)-.8 E(<esri2865> : N)110.5 456 Q
-(AD83\(HARN\) / W)-.35 E(yoming W)-.73 E(est)-.8 E(<esri2866> : N)110.5
-468 Q(AD83\(HARN\) / Puerto Rico & V)-.35 E(ir)-.6 E(gin Is.)-.18 E
-(<esri2867> : N)110.5 480 Q(AD83\(HARN\) / Arizona East \(ft\))-.35 E
-(<esri2868> : N)110.5 492 Q(AD83\(HARN\) / Arizona Central \(ft\))-.35 E
-(<esri2869> : N)110.5 504 Q(AD83\(HARN\) / Arizona W)-.35 E(est \(ft\))
--.8 E(<esri2870> : N)110.5 516 Q
-(AD83\(HARN\) / California zone 1 \(ftUS\))-.35 E(<esri2871> : N)110.5
-528 Q(AD83\(HARN\) / California zone 2 \(ftUS\))-.35 E(<esri2872> : N)
-110.5 540 Q(AD83\(HARN\) / California zone 3 \(ftUS\))-.35 E
-(<esri2873> : N)110.5 552 Q(AD83\(HARN\) / California zone 4 \(ftUS\))
--.35 E(<esri2874> : N)110.5 564 Q
-(AD83\(HARN\) / California zone 5 \(ftUS\))-.35 E(<esri2875> : N)110.5
-576 Q(AD83\(HARN\) / California zone 6 \(ftUS\))-.35 E(<esri2876> : N)
-110.5 588 Q(AD83\(HARN\) / Colorado North \(ftUS\))-.35 E
-(<esri2877> : N)110.5 600 Q(AD83\(HARN\) / Colorado Central \(ftUS\))
--.35 E(<esri2878> : N)110.5 612 Q
-(AD83\(HARN\) / Colorado South \(ftUS\))-.35 E(<esri2879> : N)110.5 624
-Q(AD83\(HARN\) / Connecticut \(ftUS\))-.35 E(<esri2880> : N)110.5 636 Q
-(AD83\(HARN\) / Dela)-.35 E -.1(wa)-.15 G(re \(ftUS\)).1 E
-(<esri2881> : N)110.5 648 Q(AD83\(HARN\) / Florida East \(ftUS\))-.35 E
-(<esri2882> : N)110.5 660 Q(AD83\(HARN\) / Florida W)-.35 E
-(est \(ftUS\))-.8 E(<esri2883> : N)110.5 672 Q
-(AD83\(HARN\) / Florida North \(ftUS\))-.35 E(<esri2884> : N)110.5 684 Q
-(AD83\(HARN\) / Geor)-.35 E(gia East \(ftUS\))-.18 E(<esri2885> : N)
-110.5 696 Q(AD83\(HARN\) / Geor)-.35 E(gia W)-.18 E(est \(ftUS\))-.8 E
-(<esri2886> : N)110.5 708 Q(AD83\(HARN\) / Idaho East \(ftUS\))-.35 E
-(<esri2887> : N)110.5 720 Q(AD83\(HARN\) / Idaho Central \(ftUS\))-.35 E
-(MB-System 5.0)72 768 Q(13 March 2014)140.11 E(105)188.45 E 0 Cg EP
-%%Page: 106 106
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<esri2888> : N)110.5 84 Q
-(AD83\(HARN\) / Idaho W)-.35 E(est \(ftUS\))-.8 E(<esri2889> : N)110.5
-96 Q(AD83\(HARN\) / Indiana East \(ftUS\))-.35 E(<esri2890> : N)110.5
-108 Q(AD83\(HARN\) / Indiana W)-.35 E(est \(ftUS\))-.8 E(<esri2891> : N)
-110.5 120 Q(AD83\(HARN\) / K)-.35 E(entuck)-.25 E 2.5(yN)-.15 G
-(orth \(ftUS\))-2.5 E(<esri2892> : N)110.5 132 Q(AD83\(HARN\) / K)-.35 E
-(entuck)-.25 E 2.5(yS)-.15 G(outh \(ftUS\))-2.5 E(<esri2893> : N)110.5
-144 Q(AD83\(HARN\) / Maryland \(ftUS\))-.35 E(<esri2894> : N)110.5 156 Q
-(AD83\(HARN\) / Massachusetts Mainland \(ftUS\))-.35 E(<esri2895> : N)
-110.5 168 Q(AD83\(HARN\) / Massachusetts Island \(ftUS\))-.35 E
-(<esri2896> : N)110.5 180 Q(AD83\(HARN\) / Michig)-.35 E
-(an North \(ft\))-.05 E(<esri2897> : N)110.5 192 Q
-(AD83\(HARN\) / Michig)-.35 E(an Central \(ft\))-.05 E(<esri2898> : N)
-110.5 204 Q(AD83\(HARN\) / Michig)-.35 E(an South \(ft\))-.05 E
-(<esri2899> : N)110.5 216 Q(AD83\(HARN\) / Mississippi East \(ftUS\))
--.35 E(<esri2900> : N)110.5 228 Q(AD83\(HARN\) / Mississippi W)-.35 E
-(est \(ftUS\))-.8 E(<esri2901> : N)110.5 240 Q
-(AD83\(HARN\) / Montana \(ft\))-.35 E(<esri2902> : N)110.5 252 Q
-(AD83\(HARN\) / Ne)-.35 E 2.5(wM)-.25 G -.15(ex)-2.5 G
-(ico East \(ftUS\)).15 E(<esri2903> : N)110.5 264 Q(AD83\(HARN\) / Ne)
--.35 E 2.5(wM)-.25 G -.15(ex)-2.5 G(ico Central \(ftUS\)).15 E
-(<esri2904> : N)110.5 276 Q(AD83\(HARN\) / Ne)-.35 E 2.5(wM)-.25 G -.15
-(ex)-2.5 G(ico W).15 E(est \(ftUS\))-.8 E(<esri2905> : N)110.5 288 Q
-(AD83\(HARN\) / Ne)-.35 E 2.5(wY)-.25 G(ork East \(ftUS\))-3.6 E
-(<esri2906> : N)110.5 300 Q(AD83\(HARN\) / Ne)-.35 E 2.5(wY)-.25 G
-(ork Central \(ftUS\))-3.6 E(<esri2907> : N)110.5 312 Q
-(AD83\(HARN\) / Ne)-.35 E 2.5(wY)-.25 G(ork W)-3.6 E(est \(ftUS\))-.8 E
-(<esri2908> : N)110.5 324 Q(AD83\(HARN\) / Ne)-.35 E 2.5(wY)-.25 G
-(ork Long Island \(ftUS\))-3.6 E(<esri2909> : N)110.5 336 Q
-(AD83\(HARN\) / North Dak)-.35 E(ota North \(ft\))-.1 E(<esri2910> : N)
-110.5 348 Q(AD83\(HARN\) / North Dak)-.35 E(ota South \(ft\))-.1 E
-(<esri2911> : N)110.5 360 Q(AD83\(HARN\) / Oklahoma North \(ftUS\))-.35
-E(<esri2912> : N)110.5 372 Q(AD83\(HARN\) / Oklahoma South \(ftUS\))-.35
-E(<esri2913> : N)110.5 384 Q(AD83\(HARN\) / Ore)-.35 E(gon North \(ft\))
--.15 E(<esri2914> : N)110.5 396 Q(AD83\(HARN\) / Ore)-.35 E
-(gon South \(ft\))-.15 E(<esri2915> : N)110.5 408 Q(AD83\(HARN\) / T)
--.35 E(ennessee \(ftUS\))-.7 E(<esri2916> : N)110.5 420 Q
-(AD83\(HARN\) / T)-.35 E -.15(ex)-.7 G(as North \(ftUS\)).15 E
-(<esri2917> : N)110.5 432 Q(AD83\(HARN\) / T)-.35 E -.15(ex)-.7 G
-(as North Central \(ftUS\)).15 E(<esri2918> : N)110.5 444 Q
-(AD83\(HARN\) / T)-.35 E -.15(ex)-.7 G(as Central \(ftUS\)).15 E
-(<esri2919> : N)110.5 456 Q(AD83\(HARN\) / T)-.35 E -.15(ex)-.7 G
-(as South Central \(ftUS\)).15 E(<esri2920> : N)110.5 468 Q
-(AD83\(HARN\) / T)-.35 E -.15(ex)-.7 G(as South \(ftUS\)).15 E
-(<esri2921> : N)110.5 480 Q(AD83\(HARN\) / Utah North \(ft\))-.35 E
-(<esri2922> : N)110.5 492 Q(AD83\(HARN\) / Utah Central \(ft\))-.35 E
-(<esri2923> : N)110.5 504 Q(AD83\(HARN\) / Utah South \(ft\))-.35 E
-(<esri2924> : N)110.5 516 Q(AD83\(HARN\) / V)-.35 E(ir)-.6 E
-(ginia North \(ftUS\))-.18 E(<esri2925> : N)110.5 528 Q
-(AD83\(HARN\) / V)-.35 E(ir)-.6 E(ginia South \(ftUS\))-.18 E
-(<esri2926> : N)110.5 540 Q(AD83\(HARN\) / W)-.35 E
-(ashington North \(ftUS\))-.8 E(<esri2927> : N)110.5 552 Q
-(AD83\(HARN\) / W)-.35 E(ashington South \(ftUS\))-.8 E(<esri2928> : N)
-110.5 564 Q(AD83\(HARN\) / W)-.35 E(isconsin North \(ftUS\))-.4 E
-(<esri2929> : N)110.5 576 Q(AD83\(HARN\) / W)-.35 E
-(isconsin Central \(ftUS\))-.4 E(<esri2930> : N)110.5 588 Q
-(AD83\(HARN\) / W)-.35 E(isconsin South \(ftUS\))-.4 E
-(<esri2931> : Beduaram / TM 13 NE)110.5 600 Q
-(<esri2932> : QND95 / Qatar National Grid)110.5 612 Q(<esri2933> : Se)
-110.5 624 Q -.05(ga)-.15 G(ra / UTM zone 50S).05 E(<esri2934> : Se)110.5
-636 Q -.05(ga)-.15 G(ra \(Jakarta\) / NEIEZ).05 E(<esri2935> : Pulk)
-110.5 648 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / CS63 zone A1)-2.5 E
-(<esri2936> : Pulk)110.5 660 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / CS63 zone A2)-2.5 E(<esri2937> : Pulk)110.5 672 Q -.15(ov)-.1 G
-2.5(o1)-.05 G(942 / CS63 zone A3)-2.5 E(<esri2938> : Pulk)110.5 684 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(942 / CS63 zone A4)-2.5 E(<esri2939> : Pulk)
-110.5 696 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / CS63 zone K2)-2.5 E
-(<esri2940> : Pulk)110.5 708 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / CS63 zone K3)-2.5 E(<esri2941> : Pulk)110.5 720 Q -.15(ov)-.1 G
-2.5(o1)-.05 G(942 / CS63 zone K4)-2.5 E(MB-System 5.0)72 768 Q
-(13 March 2014)140.11 E(106)188.45 E 0 Cg EP
-%%Page: 107 107
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<esri2942> : Porto Santo / UTM zone 28N)110.5
-84 Q(<esri2943> : Selv)110.5 96 Q(agem Grande / UTM zone 28N)-.25 E
-(<esri2944> : N)110.5 108 Q(AD83\(CSRS\) / SCoPQ zone 2)-.35 E
-(<esri2945> : N)110.5 120 Q(AD83\(CSRS\) / MTM zone 3)-.35 E
-(<esri2946> : N)110.5 132 Q(AD83\(CSRS\) / MTM zone 4)-.35 E
-(<esri2947> : N)110.5 144 Q(AD83\(CSRS\) / MTM zone 5)-.35 E
-(<esri2948> : N)110.5 156 Q(AD83\(CSRS\) / MTM zone 6)-.35 E
-(<esri2949> : N)110.5 168 Q(AD83\(CSRS\) / MTM zone 7)-.35 E
-(<esri2950> : N)110.5 180 Q(AD83\(CSRS\) / MTM zone 8)-.35 E
-(<esri2951> : N)110.5 192 Q(AD83\(CSRS\) / MTM zone 9)-.35 E
-(<esri2952> : N)110.5 204 Q(AD83\(CSRS\) / MTM zone 10)-.35 E
-(<esri2953> : N)110.5 216 Q(AD83\(CSRS\) / Ne)-.35 E 2.5(wB)-.25 G
-(runswick Stereo)-2.5 E(<esri2954> : N)110.5 228 Q
-(AD83\(CSRS\) / Prince Edw)-.35 E(ard Isl. Stereographic \(N)-.1 E
-(AD83\))-.35 E(<esri2955> : N)110.5 240 Q(AD83\(CSRS\) / UTM zone 11N)
--.35 E(<esri2956> : N)110.5 252 Q(AD83\(CSRS\) / UTM zone 12N)-.35 E
-(<esri2957> : N)110.5 264 Q(AD83\(CSRS\) / UTM zone 13N)-.35 E
-(<esri2958> : N)110.5 276 Q(AD83\(CSRS\) / UTM zone 17N)-.35 E
-(<esri2959> : N)110.5 288 Q(AD83\(CSRS\) / UTM zone 18N)-.35 E
-(<esri2960> : N)110.5 300 Q(AD83\(CSRS\) / UTM zone 19N)-.35 E
-(<esri2961> : N)110.5 312 Q(AD83\(CSRS\) / UTM zone 20N)-.35 E
-(<esri2962> : N)110.5 324 Q(AD83\(CSRS\) / UTM zone 21N)-.35 E
-(<esri3036> : Moznet / UTM zone 36S)110.5 336 Q
-(<esri3037> : Moznet / UTM zone 37S)110.5 348 Q
-(<esri3148> : Indian 1960 / UTM zone 48N)110.5 360 Q
-(<esri3149> : Indian 1960 / UTM zone 49N)110.5 372 Q
-(<esri3176> : Indian 1960 / TM 106 NE)110.5 384 Q
-(<esri3200> : FD58 / Iraq zone)110.5 396 Q
-(<esri3300> : Estonian Coordinate System of 1992)110.5 408 Q
-(<esri3301> : Estonian Coordinate System of 1997)110.5 420 Q
-(<esri3439> : PSD93 / UTM zone 39N)110.5 432 Q
-(<esri3440> : PSD93 / UTM zone 40N)110.5 444 Q(<esri3561> : Old Ha)110.5
-456 Q -.1(wa)-.15 G(iian / Ha).1 E -.1(wa)-.15 G(ii zone 1).1 E
-(<esri3562> : Old Ha)110.5 468 Q -.1(wa)-.15 G(iian / Ha).1 E -.1(wa)
--.15 G(ii zone 2).1 E(<esri3563> : Old Ha)110.5 480 Q -.1(wa)-.15 G
-(iian / Ha).1 E -.1(wa)-.15 G(ii zone 3).1 E(<esri3564> : Old Ha)110.5
-492 Q -.1(wa)-.15 G(iian / Ha).1 E -.1(wa)-.15 G(ii zone 4).1 E
-(<esri3565> : Old Ha)110.5 504 Q -.1(wa)-.15 G(iian / Ha).1 E -.1(wa)
--.15 G(ii zone 5).1 E(<esri3920> : Puerto Rico / UTM zone 20N)110.5 516
-Q(<esri3991> : Puerto Rico State Plane CS of 1927)110.5 528 Q
-(<esri3992> : Puerto Rico / St. Croix)110.5 540 Q(<esri4001> : Unkno)
-110.5 552 Q(wn datum based upon the Airy 1830 ellipsoid)-.25 E
-(<esri4002> : Unkno)110.5 564 Q
-(wn datum based upon the Airy Modi\214ed 1849 ellipsoid)-.25 E
-(<esri4003> : Unkno)110.5 576 Q
-(wn datum based upon the Australian National Spheroid)-.25 E
-(<esri4004> : Unkno)110.5 588 Q
-(wn datum based upon the Bessel 1841 ellipsoid)-.25 E
-(<esri4005> : Unkno)110.5 600 Q
-(wn datum based upon the Bessel Modi\214ed ellipsoid)-.25 E
-(<esri4006> : Unkno)110.5 612 Q
-(wn datum based upon the Bessel Namibia ellipsoid)-.25 E
-(<esri4007> : Unkno)110.5 624 Q(wn datum based upon the Clark)-.25 E 2.5
-(e1)-.1 G(858 ellipsoid)-2.5 E(<esri4008> : Unkno)110.5 636 Q
-(wn datum based upon the Clark)-.25 E 2.5(e1)-.1 G(866 ellipsoid)-2.5 E
-(<esri4009> : Unkno)110.5 648 Q(wn datum based upon the Clark)-.25 E 2.5
-(e1)-.1 G(866 Michig)-2.5 E(an ellipsoid)-.05 E(<esri4010> : Unkno)110.5
-660 Q(wn datum based upon the Clark)-.25 E 2.5(e1)-.1 G
-(880 \(Benoit\) ellipsoid)-2.5 E(<esri4011> : Unkno)110.5 672 Q
-(wn datum based upon the Clark)-.25 E 2.5(e1)-.1 G
-(880 \(IGN\) ellipsoid)-2.5 E(<esri4012> : Unkno)110.5 684 Q
-(wn datum based upon the Clark)-.25 E 2.5(e1)-.1 G
-(880 \(RGS\) ellipsoid)-2.5 E(<esri4013> : Unkno)110.5 696 Q
-(wn datum based upon the Clark)-.25 E 2.5(e1)-.1 G
-(880 \(Arc\) ellipsoid)-2.5 E(<esri4014> : Unkno)110.5 708 Q
-(wn datum based upon the Clark)-.25 E 2.5(e1)-.1 G
-(880 \(SGA 1922\) ellipsoid)-2.5 E(<esri4015> : Unkno)110.5 720 Q
-(wn datum based upon the Ev)-.25 E
-(erest 1830 \(1937 Adjustment\) ellipsoid)-.15 E(MB-System 5.0)72 768 Q
-(13 March 2014)140.11 E(107)188.45 E 0 Cg EP
-%%Page: 108 108
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<esri4016> : Unkno)110.5 84 Q
-(wn datum based upon the Ev)-.25 E
-(erest 1830 \(1967 De\214nition\) ellipsoid)-.15 E(<esri4018> : Unkno)
-110.5 96 Q(wn datum based upon the Ev)-.25 E
-(erest 1830 Modi\214ed ellipsoid)-.15 E(<esri4019> : Unkno)110.5 108 Q
-(wn datum based upon the GRS 1980 ellipsoid)-.25 E(<esri4020> : Unkno)
-110.5 120 Q(wn datum based upon the Helmert 1906 ellipsoid)-.25 E
-(<esri4021> : Unkno)110.5 132 Q
-(wn datum based upon the Indonesian National Spheroid)-.25 E
-(<esri4022> : Unkno)110.5 144 Q
-(wn datum based upon the International 1924 ellipsoid)-.25 E
-(<esri4024> : Unkno)110.5 156 Q(wn datum based upon the Krasso)-.25 E
-(wsk)-.25 E 2.5(y1)-.15 G(940 ellipsoid)-2.5 E(<esri4025> : Unkno)110.5
-168 Q(wn datum based upon the NWL 9D ellipsoid)-.25 E
-(<esri4027> : Unkno)110.5 180 Q
-(wn datum based upon the Plessis 1817 ellipsoid)-.25 E
-(<esri4028> : Unkno)110.5 192 Q(wn datum based upon the Struv)-.25 E 2.5
-(e1)-.15 G(860 ellipsoid)-2.5 E(<esri4029> : Unkno)110.5 204 Q
-(wn datum based upon the W)-.25 E(ar Of)-.8 E(\214ce ellipsoid)-.25 E
-(<esri4030> : Unkno)110.5 216 Q
-(wn datum based upon the WGS 84 ellipsoid)-.25 E(<esri4031> : Unkno)
-110.5 228 Q(wn datum based upon the GEM 10C ellipsoid)-.25 E
-(<esri4032> : Unkno)110.5 240 Q
-(wn datum based upon the OSU86F ellipsoid)-.25 E(<esri4033> : Unkno)
-110.5 252 Q(wn datum based upon the OSU91A ellipsoid)-.25 E
-(<esri4034> : Unkno)110.5 264 Q(wn datum based upon the Clark)-.25 E 2.5
-(e1)-.1 G(880 ellipsoid)-2.5 E(<esri4035> : Unkno)110.5 276 Q
-(wn datum based upon the Authalic Sphere)-.25 E(<esri4036> : Unkno)110.5
-288 Q(wn datum based upon the GRS 1967 ellipsoid)-.25 E
-(<esri4041> : Unkno)110.5 300 Q(wn datum based upon the A)-.25 E -.15
-(ve)-.74 G(rage T).15 E(errestrial System 1977 ellipsoid)-.7 E
-(<esri4042> : Unkno)110.5 312 Q(wn datum based upon the Ev)-.25 E
-(erest \(1830 De\214nition\) ellipsoid)-.15 E(<esri4043> : Unkno)110.5
-324 Q(wn datum based upon the WGS 72 ellipsoid)-.25 E
-(<esri4044> : Unkno)110.5 336 Q(wn datum based upon the Ev)-.25 E
-(erest 1830 \(1962 De\214nition\) ellipsoid)-.15 E(<esri4045> : Unkno)
-110.5 348 Q(wn datum based upon the Ev)-.25 E
-(erest 1830 \(1975 De\214nition\) ellipsoid)-.15 E
-(<esri4047> : Unspeci\214ed based upon the GRS 1980 Authalic Sphere)
-110.5 360 Q(<esri4120> : Greek)110.5 372 Q(<esri4121> : GGRS87)110.5 384
-Q(<esri4122> : A)110.5 396 Q(TS77)-1.11 E(<esri4123> : KKJ)110.5 408 Q
-(<esri4124> : R)110.5 420 Q(T90)-.6 E(<esri4125> : Samboja)110.5 432 Q
-(<esri4126> : LKS94 \(ETRS89\))110.5 444 Q(<esri4127> : T)110.5 456 Q
-(ete)-.7 E(<esri4128> : Madzansua)110.5 468 Q(<esri4129> : Observ)110.5
-480 Q(atario)-.25 E(<esri4130> : Moznet)110.5 492 Q
-(<esri4131> : Indian 1960)110.5 504 Q(<esri4132> : FD58)110.5 516 Q
-(<esri4133> : EST92)110.5 528 Q(<esri4134> : PDO Surv)110.5 540 Q .3
--.15(ey D)-.15 H(atum 1993).15 E(<esri4135> : Old Ha)110.5 552 Q -.1(wa)
--.15 G(iian).1 E(<esri4136> : St. La)110.5 564 Q(wrence Island)-.15 E
-(<esri4137> : St. P)110.5 576 Q(aul Island)-.15 E(<esri4138> : St. Geor)
-110.5 588 Q(ge Island)-.18 E(<esri4139> : Puerto Rico)110.5 600 Q
-(<esri4140> : N)110.5 612 Q(AD83\(CSRS98\))-.35 E(<esri4141> : Israel)
-110.5 624 Q(<esri4142> : Locodjo 1965)110.5 636 Q
-(<esri4143> : Abidjan 1987)110.5 648 Q(<esri4144> : Kalianpur 1937)110.5
-660 Q(<esri4145> : Kalianpur 1962)110.5 672 Q
-(<esri4146> : Kalianpur 1975)110.5 684 Q(<esri4147> : Hanoi 1972)110.5
-696 Q(<esri4148> : Hartebeesthoek94)110.5 708 Q(<esri4149> : CH1903)
-110.5 720 Q(MB-System 5.0)72 768 Q(13 March 2014)140.11 E(108)188.45 E 0
-Cg EP
-%%Page: 109 109
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<esri4150> : CH1903+)110.5 84 Q
-(<esri4151> : CHTRF95)110.5 96 Q(<esri4152> : N)110.5 108 Q
-(AD83\(HARN\))-.35 E(<esri4153> : Rassadiran)110.5 120 Q
-(<esri4154> : ED50\(ED77\))110.5 132 Q(<esri4155> : Dabola 1981)110.5
-144 Q(<esri4156> : S-JTSK)110.5 156 Q(<esri4157> : Mount Dillon)110.5
-168 Q(<esri4158> : Naparima 1955)110.5 180 Q(<esri4159> : ELD79)110.5
-192 Q(<esri4160> : Chos Malal 1914)110.5 204 Q(<esri4161> : P)110.5 216
-Q(ampa del Castillo)-.15 E(<esri4162> : K)110.5 228 Q(orean 1985)-.35 E
-(<esri4163> : Y)110.5 240 Q(emen NGN96)-1 E(<esri4164> : South Y)110.5
-252 Q(emen)-1 E(<esri4165> : Bissau)110.5 264 Q(<esri4166> : K)110.5 276
-Q(orean 1995)-.35 E(<esri4167> : NZGD2000)110.5 288 Q
-(<esri4168> : Accra)110.5 300 Q(<esri4169> : American Samoa 1962)110.5
-312 Q(<esri4170> : SIRGAS)110.5 324 Q(<esri4171> : RGF93)110.5 336 Q
-(<esri4172> : POSGAR)110.5 348 Q(<esri4173> : IRENET95)110.5 360 Q
-(<esri4174> : Sierra Leone 1924)110.5 372 Q
-(<esri4175> : Sierra Leone 1968)110.5 384 Q
-(<esri4176> : Australian Antarctic)110.5 396 Q(<esri4178> : Pulk)110.5
-408 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942\(83\))-2.5 E(<esri4179> : Pulk)
-110.5 420 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942\(58\))-2.5 E
-(<esri4180> : EST97)110.5 432 Q(<esri4181> : Lux)110.5 444 Q(embour)-.15
-E 2.5(g1)-.18 G(930)-2.5 E(<esri4182> : Azores Occidental 1939)110.5 456
-Q(<esri4183> : Azores Central 1948)110.5 468 Q
-(<esri4184> : Azores Oriental 1940)110.5 480 Q
-(<esri4185> : Madeira 1936)110.5 492 Q(<esri4188> : OSNI 1952)110.5 504
-Q(<esri4189> : REGVEN)110.5 516 Q(<esri4190> : POSGAR 98)110.5 528 Q
-(<esri4191> : Albanian 1987)110.5 540 Q(<esri4192> : Douala 1948)110.5
-552 Q(<esri4193> : Manoca 1962)110.5 564 Q(<esri4194> : Qornoq 1927)
-110.5 576 Q(<esri4195> : Scoresbysund 1952)110.5 588 Q
-(<esri4196> : Ammassalik 1958)110.5 600 Q(<esri4197> : Garoua)110.5 612
-Q(<esri4198> : K)110.5 624 Q(ousseri)-.35 E(<esri4199> : Egypt 1930)
-110.5 636 Q(<esri4200> : Pulk)110.5 648 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995)-2.5 E(<esri4201> : Adindan)110.5 660 Q(<esri4202> : A)110.5 672 Q
-(GD66)-.4 E(<esri4203> : A)110.5 684 Q(GD84)-.4 E
-(<esri4204> : Ain el Abd)110.5 696 Q(<esri4205> : Afgoo)110.5 708 Q(ye)
--.1 E(<esri4206> : Ag)110.5 720 Q(adez)-.05 E(MB-System 5.0)72 768 Q
-(13 March 2014)140.11 E(109)188.45 E 0 Cg EP
-%%Page: 110 110
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<esri4207> : Lisbon)110.5 84 Q
-(<esri4208> : Aratu)110.5 96 Q(<esri4209> : Arc 1950)110.5 108 Q
-(<esri4210> : Arc 1960)110.5 120 Q(<esri4211> : Bata)110.5 132 Q(via)-.2
-E(<esri4212> : Barbados 1938)110.5 144 Q(<esri4213> : Beduaram)110.5 156
-Q(<esri4214> : Beijing 1954)110.5 168 Q(<esri4215> : Belge 1950)110.5
-180 Q(<esri4216> : Bermuda 1957)110.5 192 Q(<esri4218> : Bogota 1975)
-110.5 204 Q(<esri4219> : Bukit Rimpah)110.5 216 Q(<esri4220> : Camacupa)
-110.5 228 Q(<esri4221> : Campo Inchauspe)110.5 240 Q(<esri4222> : Cape)
-110.5 252 Q(<esri4223> : Carthage)110.5 264 Q(<esri4224> : Chua)110.5
-276 Q(<esri4225> : Corre)110.5 288 Q(go Ale)-.15 E(gre)-.15 E
-(<esri4226> : Cote d'Iv)110.5 300 Q(oire)-.2 E(<esri4227> : Deir ez Zor)
-110.5 312 Q(<esri4228> : Douala)110.5 324 Q(<esri4229> : Egypt 1907)
-110.5 336 Q(<esri4230> : ED50)110.5 348 Q(<esri4231> : ED87)110.5 360 Q
-(<esri4232> : F)110.5 372 Q(ahud)-.15 E(<esri4233> : Gandajika 1970)
-110.5 384 Q(<esri4234> : Garoua)110.5 396 Q
-(<esri4235> : Guyane Francaise)110.5 408 Q(<esri4236> : Hu Tzu Shan)
-110.5 420 Q(<esri4237> : HD72)110.5 432 Q(<esri4238> : ID74)110.5 444 Q
-(<esri4239> : Indian 1954)110.5 456 Q(<esri4240> : Indian 1975)110.5 468
-Q(<esri4241> : Jamaica 1875)110.5 480 Q(<esri4242> : J)110.5 492 Q(AD69)
--.6 E(<esri4243> : Kalianpur 1880)110.5 504 Q(<esri4244> : Kanda)110.5
-516 Q -.1(wa)-.15 G(la).1 E(<esri4245> : K)110.5 528 Q(ertau)-.25 E
-(<esri4246> : K)110.5 540 Q(OC)-.3 E(<esri4247> : La Canoa)110.5 552 Q
-(<esri4248> : PSAD56)110.5 564 Q(<esri4249> : Lak)110.5 576 Q(e)-.1 E
-(<esri4250> : Leigon)110.5 588 Q(<esri4251> : Liberia 1964)110.5 600 Q
-(<esri4252> : Lome)110.5 612 Q(<esri4253> : Luzon 1911)110.5 624 Q
-(<esri4254> : Hito XVIII 1963)110.5 636 Q(<esri4255> : Herat North)110.5
-648 Q(<esri4256> : Mahe 1971)110.5 660 Q(<esri4257> : Makassar)110.5 672
-Q(<esri4258> : ETRS89)110.5 684 Q(<esri4259> : Malongo 1987)110.5 696 Q
-(<esri4260> : Manoca)110.5 708 Q(<esri4261> : Merchich)110.5 720 Q
-(MB-System 5.0)72 768 Q(13 March 2014)140.11 E(110)188.45 E 0 Cg EP
-%%Page: 111 111
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<esri4262> : Massa)110.5 84 Q -.1(wa)-.15 G
-(<esri4263> : Minna)110.5 96 Q(<esri4264> : Mhast)110.5 108 Q
-(<esri4265> : Monte Mario)110.5 120 Q(<esri4266> : M'poralok)110.5 132 Q
-(o)-.1 E(<esri4267> : N)110.5 144 Q(AD27)-.35 E(<esri4268> : N)110.5 156
-Q(AD27 Michig)-.35 E(an)-.05 E(<esri4269> : N)110.5 168 Q(AD83)-.35 E
-(<esri4270> : Nahrw)110.5 180 Q(an 1967)-.1 E
-(<esri4271> : Naparima 1972)110.5 192 Q(<esri4272> : NZGD49)110.5 204 Q
-(<esri4273> : NGO 1948)110.5 216 Q(<esri4274> : Datum 73)110.5 228 Q
-(<esri4275> : NTF)110.5 240 Q(<esri4276> : NSWC 9Z-2)110.5 252 Q
-(<esri4277> : OSGB 1936)110.5 264 Q(<esri4278> : OSGB70)110.5 276 Q
-(<esri4279> : OS\(SN\)80)110.5 288 Q(<esri4280> : P)110.5 300 Q(adang)
--.15 E(<esri4281> : P)110.5 312 Q(alestine 1923)-.15 E
-(<esri4282> : Pointe Noire)110.5 324 Q(<esri4283> : GD)110.5 336 Q(A94)
--.4 E(<esri4284> : Pulk)110.5 348 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942)-2.5
-E(<esri4285> : Qatar 1974)110.5 360 Q(<esri4286> : Qatar 1948)110.5 372
-Q(<esri4287> : Qornoq)110.5 384 Q(<esri4288> : Loma Quintana)110.5 396 Q
-(<esri4289> : Amersfoort)110.5 408 Q(<esri4291> : SAD69)110.5 420 Q
-(<esri4292> : Sapper Hill 1943)110.5 432 Q(<esri4293> : Schw)110.5 444 Q
-(arzeck)-.1 E(<esri4294> : Se)110.5 456 Q(gora)-.15 E
-(<esri4295> : Serindung)110.5 468 Q(<esri4296> : Sudan)110.5 480 Q
-(<esri4297> : T)110.5 492 Q(ananari)-.8 E -.15(ve)-.25 G(<esri4298> : T)
-110.5 504 Q(imbalai 1948)-.35 E(<esri4299> : TM65)110.5 516 Q
-(<esri4300> : TM75)110.5 528 Q(<esri4301> : T)110.5 540 Q(ok)-.8 E(yo)
--.15 E(<esri4302> : T)110.5 552 Q(rinidad 1903)-.35 E
-(<esri4303> : TC\(1948\))110.5 564 Q(<esri4304> : V)110.5 576 Q
-(oirol 1875)-1.29 E(<esri4306> : Bern 1938)110.5 588 Q
-(<esri4307> : Nord Sahara 1959)110.5 600 Q(<esri4308> : R)110.5 612 Q
-(T38)-.6 E(<esri4309> : Y)110.5 624 Q(acare)-1 E(<esri4310> : Y)110.5
-636 Q(of)-1.1 E(f)-.25 E(<esri4311> : Zanderij)110.5 648 Q
-(<esri4312> : MGI)110.5 660 Q(<esri4313> : Belge 1972)110.5 672 Q
-(<esri4314> : DHDN)110.5 684 Q(<esri4315> : Conakry 1905)110.5 696 Q
-(<esri4316> : Dealul Piscului 1933)110.5 708 Q
-(<esri4317> : Dealul Piscului 1970)110.5 720 Q(MB-System 5.0)72 768 Q
-(13 March 2014)140.11 E(111)188.45 E 0 Cg EP
-%%Page: 112 112
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<esri4318> : NGN)110.5 84 Q(<esri4319> : KUD)
-110.5 96 Q(AMS)-.4 E(<esri4322> : WGS 72)110.5 108 Q
-(<esri4324> : WGS 72BE)110.5 120 Q(<esri4326> : WGS 84)110.5 132 Q
-(<esri4600> : Anguilla 1957)110.5 144 Q(<esri4601> : Antigua 1943)110.5
-156 Q(<esri4602> : Dominica 1945)110.5 168 Q(<esri4603> : Grenada 1953)
-110.5 180 Q(<esri4604> : Montserrat 1958)110.5 192 Q
-(<esri4605> : St. Kitts 1955)110.5 204 Q(<esri4606> : St. Lucia 1955)
-110.5 216 Q(<esri4607> : St. V)110.5 228 Q(incent 1945)-.6 E
-(<esri4608> : N)110.5 240 Q(AD27\(76\))-.35 E(<esri4609> : N)110.5 252 Q
-(AD27\(CGQ77\))-.35 E(<esri4610> : Xian 1980)110.5 264 Q
-(<esri4611> : Hong K)110.5 276 Q(ong 1980)-.35 E(<esri4612> : JGD2000)
-110.5 288 Q(<esri4613> : Se)110.5 300 Q -.05(ga)-.15 G(ra).05 E
-(<esri4614> : QND95)110.5 312 Q(<esri4615> : Porto Santo)110.5 324 Q
-(<esri4616> : Selv)110.5 336 Q(agem Grande)-.25 E(<esri4617> : N)110.5
-348 Q(AD83\(CSRS\))-.35 E(<esri4801> : Bern 1898 \(Bern\))110.5 360 Q
-(<esri4802> : Bogota 1975 \(Bogota\))110.5 372 Q
-(<esri4803> : Lisbon \(Lisbon\))110.5 384 Q
-(<esri4804> : Makassar \(Jakarta\))110.5 396 Q
-(<esri4805> : MGI \(Ferro\))110.5 408 Q
-(<esri4806> : Monte Mario \(Rome\))110.5 420 Q(<esri4807> : NTF \(P)
-110.5 432 Q(aris\))-.15 E(<esri4808> : P)110.5 444 Q(adang \(Jakarta\))
--.15 E(<esri4809> : Belge 1950 \(Brussels\))110.5 456 Q(<esri4810> : T)
-110.5 468 Q(ananari)-.8 E .3 -.15(ve \()-.25 H -.15(Pa).15 G(ris\)).15 E
-(<esri4811> : V)110.5 480 Q(oirol 1875 \(P)-1.29 E(aris\))-.15 E
-(<esri4813> : Bata)110.5 492 Q(via \(Jakarta\))-.2 E(<esri4814> : R)
-110.5 504 Q(T38 \(Stockholm\))-.6 E(<esri4815> : Greek \(Athens\))110.5
-516 Q(<esri4816> : Carthage \(P)110.5 528 Q(aris\))-.15 E
-(<esri4817> : NGO 1948 \(Oslo\))110.5 540 Q
-(<esri4818> : S-JTSK \(Ferro\))110.5 552 Q
-(<esri4819> : Nord Sahara 1959 \(P)110.5 564 Q(aris\))-.15 E
-(<esri4820> : Se)110.5 576 Q -.05(ga)-.15 G(ra \(Jakarta\)).05 E
-(<esri4901> : A)110.5 588 Q(TF \(P)-1.11 E(aris\))-.15 E
-(<esri4902> : NDG \(P)110.5 600 Q(aris\))-.15 E
-(<esri4903> : Madrid 1870 \(Madrid\))110.5 612 Q
-(<esri4904> : Lisbon 1890 \(Lisbon\))110.5 624 Q(<esri20004> : Pulk)
-110.5 636 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger zone 4)-2.5 E
-(<esri20005> : Pulk)110.5 648 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger zone 5)-2.5 E(<esri20006> : Pulk)110.5 660 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger zone 6)-2.5 E
-(<esri20007> : Pulk)110.5 672 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger zone 7)-2.5 E(<esri20008> : Pulk)110.5 684 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger zone 8)-2.5 E
-(<esri20009> : Pulk)110.5 696 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger zone 9)-2.5 E(<esri20010> : Pulk)110.5 708 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger zone 10)-2.5 E
-(<esri20011> : Pulk)110.5 720 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger zone 11)-2.5 E(MB-System 5.0)72 768 Q(13 March 2014)
-140.11 E(112)188.45 E 0 Cg EP
-%%Page: 113 113
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<esri20012> : Pulk)110.5 84 Q -.15(ov)-.1 G 2.5
-(o1)-.05 G(995 / Gauss-Kruger zone 12)-2.5 E(<esri20013> : Pulk)110.5 96
-Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger zone 13)-2.5 E
-(<esri20014> : Pulk)110.5 108 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger zone 14)-2.5 E(<esri20015> : Pulk)110.5 120 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger zone 15)-2.5 E
-(<esri20016> : Pulk)110.5 132 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger zone 16)-2.5 E(<esri20017> : Pulk)110.5 144 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger zone 17)-2.5 E
-(<esri20018> : Pulk)110.5 156 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger zone 18)-2.5 E(<esri20019> : Pulk)110.5 168 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger zone 19)-2.5 E
-(<esri20020> : Pulk)110.5 180 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger zone 20)-2.5 E(<esri20021> : Pulk)110.5 192 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger zone 21)-2.5 E
-(<esri20022> : Pulk)110.5 204 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger zone 22)-2.5 E(<esri20023> : Pulk)110.5 216 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger zone 23)-2.5 E
-(<esri20024> : Pulk)110.5 228 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger zone 24)-2.5 E(<esri20025> : Pulk)110.5 240 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger zone 25)-2.5 E
-(<esri20026> : Pulk)110.5 252 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger zone 26)-2.5 E(<esri20027> : Pulk)110.5 264 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger zone 27)-2.5 E
-(<esri20028> : Pulk)110.5 276 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger zone 28)-2.5 E(<esri20029> : Pulk)110.5 288 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger zone 29)-2.5 E
-(<esri20030> : Pulk)110.5 300 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger zone 30)-2.5 E(<esri20031> : Pulk)110.5 312 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger zone 31)-2.5 E
-(<esri20032> : Pulk)110.5 324 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger zone 32)-2.5 E(<esri20064> : Pulk)110.5 336 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger 4N)-2.5 E(<esri20065> : Pulk)
-110.5 348 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger 5N)-2.5 E
-(<esri20066> : Pulk)110.5 360 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger 6N)-2.5 E(<esri20067> : Pulk)110.5 372 Q -.15(ov)-.1
-G 2.5(o1)-.05 G(995 / Gauss-Kruger 7N)-2.5 E(<esri20068> : Pulk)110.5
-384 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger 8N)-2.5 E
-(<esri20069> : Pulk)110.5 396 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger 9N)-2.5 E(<esri20070> : Pulk)110.5 408 Q -.15(ov)-.1
-G 2.5(o1)-.05 G(995 / Gauss-Kruger 10N)-2.5 E(<esri20071> : Pulk)110.5
-420 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger 11N)-2.5 E
-(<esri20072> : Pulk)110.5 432 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger 12N)-2.5 E(<esri20073> : Pulk)110.5 444 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger 13N)-2.5 E(<esri20074> : Pulk)
-110.5 456 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger 14N)-2.5 E
-(<esri20075> : Pulk)110.5 468 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger 15N)-2.5 E(<esri20076> : Pulk)110.5 480 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger 16N)-2.5 E(<esri20077> : Pulk)
-110.5 492 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger 17N)-2.5 E
-(<esri20078> : Pulk)110.5 504 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger 18N)-2.5 E(<esri20079> : Pulk)110.5 516 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger 19N)-2.5 E(<esri20080> : Pulk)
-110.5 528 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger 20N)-2.5 E
-(<esri20081> : Pulk)110.5 540 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger 21N)-2.5 E(<esri20082> : Pulk)110.5 552 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger 22N)-2.5 E(<esri20083> : Pulk)
-110.5 564 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger 23N)-2.5 E
-(<esri20084> : Pulk)110.5 576 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger 24N)-2.5 E(<esri20085> : Pulk)110.5 588 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger 25N)-2.5 E(<esri20086> : Pulk)
-110.5 600 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger 26N)-2.5 E
-(<esri20087> : Pulk)110.5 612 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger 27N)-2.5 E(<esri20088> : Pulk)110.5 624 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger 28N)-2.5 E(<esri20089> : Pulk)
-110.5 636 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger 29N)-2.5 E
-(<esri20090> : Pulk)110.5 648 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 / Gauss-Kruger 30N)-2.5 E(<esri20091> : Pulk)110.5 660 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger 31N)-2.5 E(<esri20092> : Pulk)
-110.5 672 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 / Gauss-Kruger 32N)-2.5 E
-(<esri20137> : Adindan / UTM zone 37N)110.5 684 Q
-(<esri20138> : Adindan / UTM zone 38N)110.5 696 Q(<esri20248> : A)110.5
-708 Q(GD66 / AMG zone 48)-.4 E(<esri20249> : A)110.5 720 Q
-(GD66 / AMG zone 49)-.4 E(MB-System 5.0)72 768 Q(13 March 2014)140.11 E
-(113)188.45 E 0 Cg EP
-%%Page: 114 114
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<esri20250> : A)110.5 84 Q(GD66 / AMG zone 50)
--.4 E(<esri20251> : A)110.5 96 Q(GD66 / AMG zone 51)-.4 E
-(<esri20252> : A)110.5 108 Q(GD66 / AMG zone 52)-.4 E(<esri20253> : A)
-110.5 120 Q(GD66 / AMG zone 53)-.4 E(<esri20254> : A)110.5 132 Q
-(GD66 / AMG zone 54)-.4 E(<esri20255> : A)110.5 144 Q
-(GD66 / AMG zone 55)-.4 E(<esri20256> : A)110.5 156 Q
-(GD66 / AMG zone 56)-.4 E(<esri20257> : A)110.5 168 Q
-(GD66 / AMG zone 57)-.4 E(<esri20258> : A)110.5 180 Q
-(GD66 / AMG zone 58)-.4 E(<esri20348> : A)110.5 192 Q
-(GD84 / AMG zone 48)-.4 E(<esri20349> : A)110.5 204 Q
-(GD84 / AMG zone 49)-.4 E(<esri20350> : A)110.5 216 Q
-(GD84 / AMG zone 50)-.4 E(<esri20351> : A)110.5 228 Q
-(GD84 / AMG zone 51)-.4 E(<esri20352> : A)110.5 240 Q
-(GD84 / AMG zone 52)-.4 E(<esri20353> : A)110.5 252 Q
-(GD84 / AMG zone 53)-.4 E(<esri20354> : A)110.5 264 Q
-(GD84 / AMG zone 54)-.4 E(<esri20355> : A)110.5 276 Q
-(GD84 / AMG zone 55)-.4 E(<esri20356> : A)110.5 288 Q
-(GD84 / AMG zone 56)-.4 E(<esri20357> : A)110.5 300 Q
-(GD84 / AMG zone 57)-.4 E(<esri20358> : A)110.5 312 Q
-(GD84 / AMG zone 58)-.4 E(<esri20437> : Ain el Abd / UTM zone 37N)110.5
-324 Q(<esri20438> : Ain el Abd / UTM zone 38N)110.5 336 Q
-(<esri20439> : Ain el Abd / UTM zone 39N)110.5 348 Q
-(<esri20499> : Ain el Abd / Bahrain Grid)110.5 360 Q
-(<esri20538> : Afgoo)110.5 372 Q(ye / UTM zone 38N)-.1 E
-(<esri20539> : Afgoo)110.5 384 Q(ye / UTM zone 39N)-.1 E
-(<esri20790> : Lisbon \(Lisbon\)/Portuguese National Grid)110.5 396 Q
-(<esri20791> : Lisbon \(Lisbon\)/Portuguese Grid)110.5 408 Q
-(<esri20822> : Aratu / UTM zone 22S)110.5 420 Q
-(<esri20823> : Aratu / UTM zone 23S)110.5 432 Q
-(<esri20824> : Aratu / UTM zone 24S)110.5 444 Q
-(<esri20934> : Arc 1950 / UTM zone 34S)110.5 456 Q
-(<esri20935> : Arc 1950 / UTM zone 35S)110.5 468 Q
-(<esri20936> : Arc 1950 / UTM zone 36S)110.5 480 Q
-(<esri21035> : Arc 1960 / UTM zone 35S)110.5 492 Q
-(<esri21036> : Arc 1960 / UTM zone 36S)110.5 504 Q
-(<esri21037> : Arc 1960 / UTM zone 37S)110.5 516 Q
-(<esri21095> : Arc 1960 / UTM zone 35N)110.5 528 Q
-(<esri21096> : Arc 1960 / UTM zone 36N)110.5 540 Q
-(<esri21097> : Arc 1960 / UTM zone 37N)110.5 552 Q(<esri21100> : Bata)
-110.5 564 Q(via \(Jakarta\) / NEIEZ)-.2 E(<esri21148> : Bata)110.5 576 Q
-(via / UTM zone 48S)-.2 E(<esri21149> : Bata)110.5 588 Q
-(via / UTM zone 49S)-.2 E(<esri21150> : Bata)110.5 600 Q
-(via / UTM zone 50S)-.2 E(<esri21291> : Barbados 1938 / British W)110.5
-612 Q(est Indies Grid)-.8 E
-(<esri21292> : Barbados 1938 / Barbados National Grid)110.5 624 Q
-(<esri21413> : Beijing 1954 / Gauss-Kruger zone 13)110.5 636 Q
-(<esri21414> : Beijing 1954 / Gauss-Kruger zone 14)110.5 648 Q
-(<esri21415> : Beijing 1954 / Gauss-Kruger zone 15)110.5 660 Q
-(<esri21416> : Beijing 1954 / Gauss-Kruger zone 16)110.5 672 Q
-(<esri21417> : Beijing 1954 / Gauss-Kruger zone 17)110.5 684 Q
-(<esri21418> : Beijing 1954 / Gauss-Kruger zone 18)110.5 696 Q
-(<esri21419> : Beijing 1954 / Gauss-Kruger zone 19)110.5 708 Q
-(<esri21420> : Beijing 1954 / Gauss-Kruger zone 20)110.5 720 Q
-(MB-System 5.0)72 768 Q(13 March 2014)140.11 E(114)188.45 E 0 Cg EP
-%%Page: 115 115
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F
-(<esri21421> : Beijing 1954 / Gauss-Kruger zone 21)110.5 84 Q
-(<esri21422> : Beijing 1954 / Gauss-Kruger zone 22)110.5 96 Q
-(<esri21423> : Beijing 1954 / Gauss-Kruger zone 23)110.5 108 Q
-(<esri21453> : Beijing 1954 / Gauss-Kruger CM 75E)110.5 120 Q
-(<esri21454> : Beijing 1954 / Gauss-Kruger CM 81E)110.5 132 Q
-(<esri21455> : Beijing 1954 / Gauss-Kruger CM 87E)110.5 144 Q
-(<esri21456> : Beijing 1954 / Gauss-Kruger CM 93E)110.5 156 Q
-(<esri21457> : Beijing 1954 / Gauss-Kruger CM 99E)110.5 168 Q
-(<esri21458> : Beijing 1954 / Gauss-Kruger CM 105E)110.5 180 Q
-(<esri21459> : Beijing 1954 / Gauss-Kruger CM 111E)110.5 192 Q
-(<esri21460> : Beijing 1954 / Gauss-Kruger CM 117E)110.5 204 Q
-(<esri21461> : Beijing 1954 / Gauss-Kruger CM 123E)110.5 216 Q
-(<esri21462> : Beijing 1954 / Gauss-Kruger CM 129E)110.5 228 Q
-(<esri21463> : Beijing 1954 / Gauss-Kruger CM 135E)110.5 240 Q
-(<esri21473> : Beijing 1954 / Gauss-Kruger 13N)110.5 252 Q
-(<esri21474> : Beijing 1954 / Gauss-Kruger 14N)110.5 264 Q
-(<esri21475> : Beijing 1954 / Gauss-Kruger 15N)110.5 276 Q
-(<esri21476> : Beijing 1954 / Gauss-Kruger 16N)110.5 288 Q
-(<esri21477> : Beijing 1954 / Gauss-Kruger 17N)110.5 300 Q
-(<esri21478> : Beijing 1954 / Gauss-Kruger 18N)110.5 312 Q
-(<esri21479> : Beijing 1954 / Gauss-Kruger 19N)110.5 324 Q
-(<esri21480> : Beijing 1954 / Gauss-Kruger 20N)110.5 336 Q
-(<esri21481> : Beijing 1954 / Gauss-Kruger 21N)110.5 348 Q
-(<esri21482> : Beijing 1954 / Gauss-Kruger 22N)110.5 360 Q
-(<esri21483> : Beijing 1954 / Gauss-Kruger 23N)110.5 372 Q
-(<esri21500> : Belge 1950 \(Brussels\) / Belge Lambert 50)110.5 384 Q
-(<esri21780> : Bern 1898 \(Bern\) / L)110.5 396 Q(V03C)-1 E
-(<esri21781> : CH1903 / L)110.5 408 Q(V03)-1 E
-(<esri21817> : Bogota 1975 / UTM zone 17N)110.5 420 Q
-(<esri21818> : Bogota 1975 / UTM zone 18N)110.5 432 Q
-(<esri21891> : Bogota 1975 / Colombia W)110.5 444 Q(est zone)-.8 E
-(<esri21892> : Bogota 1975 / Colombia Bogota zone)110.5 456 Q
-(<esri21893> : Bogota 1975 / Colombia East Central zone)110.5 468 Q
-(<esri21894> : Bogota 1975 / Colombia East)110.5 480 Q
-(<esri22032> : Camacupa / UTM zone 32S)110.5 492 Q
-(<esri22033> : Camacupa / UTM zone 33S)110.5 504 Q
-(<esri22091> : Camacupa / TM 11.30 SE)110.5 516 Q
-(<esri22092> : Camacupa / TM 12 SE)110.5 528 Q
-(<esri22191> : Campo Inchauspe / Ar)110.5 540 Q(gentina 1)-.18 E
-(<esri22192> : Campo Inchauspe / Ar)110.5 552 Q(gentina 2)-.18 E
-(<esri22193> : Campo Inchauspe / Ar)110.5 564 Q(gentina 3)-.18 E
-(<esri22194> : Campo Inchauspe / Ar)110.5 576 Q(gentina 4)-.18 E
-(<esri22195> : Campo Inchauspe / Ar)110.5 588 Q(gentina 5)-.18 E
-(<esri22196> : Campo Inchauspe / Ar)110.5 600 Q(gentina 6)-.18 E
-(<esri22197> : Campo Inchauspe / Ar)110.5 612 Q(gentina 7)-.18 E
-(<esri22234> : Cape / UTM zone 34S)110.5 624 Q
-(<esri22235> : Cape / UTM zone 35S)110.5 636 Q
-(<esri22236> : Cape / UTM zone 36S)110.5 648 Q
-(<esri22332> : Carthage / UTM zone 32N)110.5 660 Q
-(<esri22391> : Carthage / Nord T)110.5 672 Q(unisie)-.45 E
-(<esri22392> : Carthage / Sud T)110.5 684 Q(unisie)-.45 E
-(<esri22523> : Corre)110.5 696 Q(go Ale)-.15 E(gre / UTM zone 23S)-.15 E
-(<esri22524> : Corre)110.5 708 Q(go Ale)-.15 E(gre / UTM zone 24S)-.15 E
-(<esri22700> : Deir ez Zor / Le)110.5 720 Q -.25(va)-.25 G(nt Zone).25 E
-(MB-System 5.0)72 768 Q(13 March 2014)140.11 E(115)188.45 E 0 Cg EP
-%%Page: 116 116
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<esri22770> : Deir ez Zor / Syria Lambert)110.5
-84 Q(<esri22780> : Deir ez Zor / Le)110.5 96 Q -.25(va)-.25 G
-(nt Stereographic).25 E(<esri22832> : Douala / UTM zone 32N)110.5 108 Q
-(<esri22991> : Egypt 1907 / Blue Belt)110.5 120 Q
-(<esri22992> : Egypt 1907 / Red Belt)110.5 132 Q
-(<esri22993> : Egypt 1907 / Purple Belt)110.5 144 Q
-(<esri22994> : Egypt 1907 / Extended Purple Belt)110.5 156 Q
-(<esri23028> : ED50 / UTM zone 28N)110.5 168 Q
-(<esri23029> : ED50 / UTM zone 29N)110.5 180 Q
-(<esri23030> : ED50 / UTM zone 30N)110.5 192 Q
-(<esri23031> : ED50 / UTM zone 31N)110.5 204 Q
-(<esri23032> : ED50 / UTM zone 32N)110.5 216 Q
-(<esri23033> : ED50 / UTM zone 33N)110.5 228 Q
-(<esri23034> : ED50 / UTM zone 34N)110.5 240 Q
-(<esri23035> : ED50 / UTM zone 35N)110.5 252 Q
-(<esri23036> : ED50 / UTM zone 36N)110.5 264 Q
-(<esri23037> : ED50 / UTM zone 37N)110.5 276 Q
-(<esri23038> : ED50 / UTM zone 38N)110.5 288 Q
-(<esri23090> : ED50 / TM 0 N)110.5 300 Q(<esri23095> : ED50 / TM 5 NE)
-110.5 312 Q(<esri23239> : F)110.5 324 Q(ahud / UTM zone 39N)-.15 E
-(<esri23240> : F)110.5 336 Q(ahud / UTM zone 40N)-.15 E
-(<esri23433> : Garoua / UTM zone 33N)110.5 348 Q
-(<esri23700> : HD72 / EO)110.5 360 Q(V)-.5 E
-(<esri23846> : ID74 / UTM zone 46N)110.5 372 Q
-(<esri23847> : ID74 / UTM zone 47N)110.5 384 Q
-(<esri23848> : ID74 / UTM zone 48N)110.5 396 Q
-(<esri23849> : ID74 / UTM zone 49N)110.5 408 Q
-(<esri23850> : ID74 / UTM zone 50N)110.5 420 Q
-(<esri23851> : ID74 / UTM zone 51N)110.5 432 Q
-(<esri23852> : ID74 / UTM zone 52N)110.5 444 Q
-(<esri23853> : ID74 / UTM zone 53N)110.5 456 Q
-(<esri23886> : ID74 / UTM zone 46S)110.5 468 Q
-(<esri23887> : ID74 / UTM zone 47S)110.5 480 Q
-(<esri23888> : ID74 / UTM zone 48S)110.5 492 Q
-(<esri23889> : ID74 / UTM zone 49S)110.5 504 Q
-(<esri23890> : ID74 / UTM zone 50S)110.5 516 Q
-(<esri23891> : ID74 / UTM zone 51S)110.5 528 Q
-(<esri23892> : ID74 / UTM zone 52S)110.5 540 Q
-(<esri23893> : ID74 / UTM zone 53S)110.5 552 Q
-(<esri23894> : ID74 / UTM zone 54S)110.5 564 Q
-(<esri23946> : Indian 1954 / UTM zone 46N)110.5 576 Q
-(<esri23947> : Indian 1954 / UTM zone 47N)110.5 588 Q
-(<esri23948> : Indian 1954 / UTM zone 48N)110.5 600 Q
-(<esri24047> : Indian 1975 / UTM zone 47N)110.5 612 Q
-(<esri24048> : Indian 1975 / UTM zone 48N)110.5 624 Q
-(<esri24100> : Jamaica 1875 / Jamaica \(Old Grid\))110.5 636 Q
-(<esri24200> : J)110.5 648 Q(AD69 / Jamaica National Grid)-.6 E
-(<esri24305> : Kalianpur 1937 / UTM zone 45N)110.5 660 Q
-(<esri24306> : Kalianpur 1937 / UTM zone 46N)110.5 672 Q
-(<esri24311> : Kalianpur 1962 / UTM zone 41N)110.5 684 Q
-(<esri24312> : Kalianpur 1962 / UTM zone 42N)110.5 696 Q
-(<esri24313> : Kalianpur 1962 / UTM zone 43N)110.5 708 Q
-(<esri24342> : Kalianpur 1975 / UTM zone 42N)110.5 720 Q(MB-System 5.0)
-72 768 Q(13 March 2014)140.11 E(116)188.45 E 0 Cg EP
-%%Page: 117 117
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<esri24343> : Kalianpur 1975 / UTM zone 43N)
-110.5 84 Q(<esri24344> : Kalianpur 1975 / UTM zone 44N)110.5 96 Q
-(<esri24345> : Kalianpur 1975 / UTM zone 45N)110.5 108 Q
-(<esri24346> : Kalianpur 1975 / UTM zone 46N)110.5 120 Q
-(<esri24347> : Kalianpur 1975 / UTM zone 47N)110.5 132 Q
-(<esri24370> : Kalianpur 1880 / India zone 0)110.5 144 Q
-(<esri24371> : Kalianpur 1880 / India zone I)110.5 156 Q
-(<esri24372> : Kalianpur 1880 / India zone IIa)110.5 168 Q
-(<esri24373> : Kalianpur 1880 / India zone III)110.5 180 Q
-(<esri24374> : Kalianpur 1880 / India zone IV)110.5 192 Q
-(<esri24375> : Kalianpur 1937 / India zone IIb)110.5 204 Q
-(<esri24376> : Kalianpur 1962 / India zone I)110.5 216 Q
-(<esri24377> : Kalianpur 1962 / India zone IIa)110.5 228 Q
-(<esri24378> : Kalianpur 1975 / India zone I)110.5 240 Q
-(<esri24379> : Kalianpur 1975 / India zone IIa)110.5 252 Q
-(<esri24380> : Kalianpur 1975 / India zone IIb)110.5 264 Q
-(<esri24381> : Kalianpur 1975 / India zone III)110.5 276 Q
-(<esri24382> : Kalianpur 1880 / India zone IIb)110.5 288 Q
-(<esri24383> : Kalianpur 1975 / India zone IV)110.5 300 Q
-(<esri24500> : K)110.5 312 Q(ertau / Sing)-.25 E(apore Grid)-.05 E
-(<esri24547> : K)110.5 324 Q(ertau / UTM zone 47N)-.25 E
-(<esri24548> : K)110.5 336 Q(ertau / UTM zone 48N)-.25 E
-(<esri24571> : K)110.5 348 Q(ertau / R.S.O. Malaya \(ch\))-.25 E
-(<esri24600> : K)110.5 360 Q(OC Lambert)-.3 E
-(<esri24718> : La Canoa / UTM zone 18N)110.5 372 Q
-(<esri24719> : La Canoa / UTM zone 19N)110.5 384 Q
-(<esri24720> : La Canoa / UTM zone 20N)110.5 396 Q
-(<esri24818> : PSAD56 / UTM zone 18N)110.5 408 Q
-(<esri24819> : PSAD56 / UTM zone 19N)110.5 420 Q
-(<esri24820> : PSAD56 / UTM zone 20N)110.5 432 Q
-(<esri24821> : PSAD56 / UTM zone 21N)110.5 444 Q
-(<esri24877> : PSAD56 / UTM zone 17S)110.5 456 Q
-(<esri24878> : PSAD56 / UTM zone 18S)110.5 468 Q
-(<esri24879> : PSAD56 / UTM zone 19S)110.5 480 Q
-(<esri24880> : PSAD56 / UTM zone 20S)110.5 492 Q
-(<esri24882> : PSAD56 / UTM zone 22S)110.5 504 Q
-(<esri24891> : PSAD56 / Peru west zone)110.5 516 Q
-(<esri24892> : PSAD56 / Peru central zone)110.5 528 Q
-(<esri24893> : PSAD56 / Peru east zone)110.5 540 Q
-(<esri25000> : Leigon / Ghana Metre Grid)110.5 552 Q
-(<esri25231> : Lome / UTM zone 31N)110.5 564 Q
-(<esri25391> : Luzon 1911 / Philippines zone I)110.5 576 Q
-(<esri25392> : Luzon 1911 / Philippines zone II)110.5 588 Q
-(<esri25393> : Luzon 1911 / Philippines zone III)110.5 600 Q
-(<esri25394> : Luzon 1911 / Philippines zone IV)110.5 612 Q
-(<esri25395> : Luzon 1911 / Philippines zone V)110.5 624 Q
-(<esri25700> : Makassar \(Jakarta\) / NEIEZ)110.5 636 Q
-(<esri25828> : ETRS89 / UTM zone 28N)110.5 648 Q
-(<esri25829> : ETRS89 / UTM zone 29N)110.5 660 Q
-(<esri25830> : ETRS89 / UTM zone 30N)110.5 672 Q
-(<esri25831> : ETRS89 / UTM zone 31N)110.5 684 Q
-(<esri25832> : ETRS89 / UTM zone 32N)110.5 696 Q
-(<esri25833> : ETRS89 / UTM zone 33N)110.5 708 Q
-(<esri25834> : ETRS89 / UTM zone 34N)110.5 720 Q(MB-System 5.0)72 768 Q
-(13 March 2014)140.11 E(117)188.45 E 0 Cg EP
-%%Page: 118 118
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<esri25835> : ETRS89 / UTM zone 35N)110.5 84 Q
-(<esri25836> : ETRS89 / UTM zone 36N)110.5 96 Q
-(<esri25837> : ETRS89 / UTM zone 37N)110.5 108 Q
-(<esri25838> : ETRS89 / UTM zone 38N)110.5 120 Q
-(<esri25884> : ETRS89 / TM Baltic93)110.5 132 Q
-(<esri25932> : Malongo 1987 / UTM zone 32S)110.5 144 Q
-(<esri26191> : Merchich / Nord Maroc)110.5 156 Q
-(<esri26192> : Merchich / Sud Maroc)110.5 168 Q
-(<esri26193> : Merchich / Sahara)110.5 180 Q(<esri26237> : Massa)110.5
-192 Q .2 -.1(wa / U)-.15 H(TM zone 37N).1 E
-(<esri26331> : Minna / UTM zone 31N)110.5 204 Q
-(<esri26332> : Minna / UTM zone 32N)110.5 216 Q
-(<esri26391> : Minna / Nigeria W)110.5 228 Q(est Belt)-.8 E
-(<esri26392> : Minna / Nigeria Mid Belt)110.5 240 Q
-(<esri26393> : Minna / Nigeria East Belt)110.5 252 Q
-(<esri26432> : Mhast / UTM zone 32S)110.5 264 Q
-(<esri26591> : Monte Mario \(Rome\) / Italy zone 1)110.5 276 Q
-(<esri26592> : Monte Mario \(Rome\) / Italy zone 2)110.5 288 Q
-(<esri26632> : M'poralok)110.5 300 Q 2.5(o/U)-.1 G(TM zone 32N)-2.5 E
-(<esri26692> : M'poralok)110.5 312 Q 2.5(o/U)-.1 G(TM zone 32S)-2.5 E
-(<esri26703> : N)110.5 324 Q(AD27 / UTM zone 3N)-.35 E(<esri26704> : N)
-110.5 336 Q(AD27 / UTM zone 4N)-.35 E(<esri26705> : N)110.5 348 Q
-(AD27 / UTM zone 5N)-.35 E(<esri26706> : N)110.5 360 Q
-(AD27 / UTM zone 6N)-.35 E(<esri26707> : N)110.5 372 Q
-(AD27 / UTM zone 7N)-.35 E(<esri26708> : N)110.5 384 Q
-(AD27 / UTM zone 8N)-.35 E(<esri26709> : N)110.5 396 Q
-(AD27 / UTM zone 9N)-.35 E(<esri26710> : N)110.5 408 Q
-(AD27 / UTM zone 10N)-.35 E(<esri26711> : N)110.5 420 Q
-(AD27 / UTM zone 11N)-.35 E(<esri26712> : N)110.5 432 Q
-(AD27 / UTM zone 12N)-.35 E(<esri26713> : N)110.5 444 Q
-(AD27 / UTM zone 13N)-.35 E(<esri26714> : N)110.5 456 Q
-(AD27 / UTM zone 14N)-.35 E(<esri26715> : N)110.5 468 Q
-(AD27 / UTM zone 15N)-.35 E(<esri26716> : N)110.5 480 Q
-(AD27 / UTM zone 16N)-.35 E(<esri26717> : N)110.5 492 Q
-(AD27 / UTM zone 17N)-.35 E(<esri26718> : N)110.5 504 Q
-(AD27 / UTM zone 18N)-.35 E(<esri26719> : N)110.5 516 Q
-(AD27 / UTM zone 19N)-.35 E(<esri26720> : N)110.5 528 Q
-(AD27 / UTM zone 20N)-.35 E(<esri26721> : N)110.5 540 Q
-(AD27 / UTM zone 21N)-.35 E(<esri26722> : N)110.5 552 Q
-(AD27 / UTM zone 22N)-.35 E(<esri26729> : N)110.5 564 Q
-(AD27 / Alabama East)-.35 E(<esri26730> : N)110.5 576 Q
-(AD27 / Alabama W)-.35 E(est)-.8 E(<esri26731> : N)110.5 588 Q
-(AD27 / Alaska zone 1)-.35 E(<esri26732> : N)110.5 600 Q
-(AD27 / Alaska zone 2)-.35 E(<esri26733> : N)110.5 612 Q
-(AD27 / Alaska zone 3)-.35 E(<esri26734> : N)110.5 624 Q
-(AD27 / Alaska zone 4)-.35 E(<esri26735> : N)110.5 636 Q
-(AD27 / Alaska zone 5)-.35 E(<esri26736> : N)110.5 648 Q
-(AD27 / Alaska zone 6)-.35 E(<esri26737> : N)110.5 660 Q
-(AD27 / Alaska zone 7)-.35 E(<esri26738> : N)110.5 672 Q
-(AD27 / Alaska zone 8)-.35 E(<esri26739> : N)110.5 684 Q
-(AD27 / Alaska zone 9)-.35 E(<esri26740> : N)110.5 696 Q
-(AD27 / Alaska zone 10)-.35 E(<esri26741> : N)110.5 708 Q
-(AD27 / California zone I)-.35 E(<esri26742> : N)110.5 720 Q
-(AD27 / California zone II)-.35 E(MB-System 5.0)72 768 Q(13 March 2014)
-140.11 E(118)188.45 E 0 Cg EP
-%%Page: 119 119
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<esri26743> : N)110.5 84 Q
-(AD27 / California zone III)-.35 E(<esri26744> : N)110.5 96 Q
-(AD27 / California zone IV)-.35 E(<esri26745> : N)110.5 108 Q
-(AD27 / California zone V)-.35 E(<esri26746> : N)110.5 120 Q
-(AD27 / California zone VI)-.35 E(<esri26747> : N)110.5 132 Q
-(AD27 / California zone VII)-.35 E(<esri26748> : N)110.5 144 Q
-(AD27 / Arizona East)-.35 E(<esri26749> : N)110.5 156 Q
-(AD27 / Arizona Central)-.35 E(<esri26750> : N)110.5 168 Q
-(AD27 / Arizona W)-.35 E(est)-.8 E(<esri26751> : N)110.5 180 Q
-(AD27 / Arkansas North)-.35 E(<esri26752> : N)110.5 192 Q
-(AD27 / Arkansas South)-.35 E(<esri26753> : N)110.5 204 Q
-(AD27 / Colorado North)-.35 E(<esri26754> : N)110.5 216 Q
-(AD27 / Colorado Central)-.35 E(<esri26755> : N)110.5 228 Q
-(AD27 / Colorado South)-.35 E(<esri26756> : N)110.5 240 Q
-(AD27 / Connecticut)-.35 E(<esri26757> : N)110.5 252 Q(AD27 / Dela)-.35
-E -.1(wa)-.15 G(re).1 E(<esri26758> : N)110.5 264 Q(AD27 / Florida East)
--.35 E(<esri26759> : N)110.5 276 Q(AD27 / Florida W)-.35 E(est)-.8 E
-(<esri26760> : N)110.5 288 Q(AD27 / Florida North)-.35 E
-(<esri26766> : N)110.5 300 Q(AD27 / Geor)-.35 E(gia East)-.18 E
-(<esri26767> : N)110.5 312 Q(AD27 / Geor)-.35 E(gia W)-.18 E(est)-.8 E
-(<esri26768> : N)110.5 324 Q(AD27 / Idaho East)-.35 E(<esri26769> : N)
-110.5 336 Q(AD27 / Idaho Central)-.35 E(<esri26770> : N)110.5 348 Q
-(AD27 / Idaho W)-.35 E(est)-.8 E(<esri26771> : N)110.5 360 Q
-(AD27 / Illinois East)-.35 E(<esri26772> : N)110.5 372 Q
-(AD27 / Illinois W)-.35 E(est)-.8 E(<esri26773> : N)110.5 384 Q
-(AD27 / Indiana East)-.35 E(<esri26774> : N)110.5 396 Q
-(AD27 / Indiana W)-.35 E(est)-.8 E(<esri26775> : N)110.5 408 Q
-(AD27 / Io)-.35 E .2 -.1(wa N)-.25 H(orth).1 E(<esri26776> : N)110.5 420
-Q(AD27 / Io)-.35 E .2 -.1(wa S)-.25 H(outh).1 E(<esri26777> : N)110.5
-432 Q(AD27 / Kansas North)-.35 E(<esri26778> : N)110.5 444 Q
-(AD27 / Kansas South)-.35 E(<esri26779> : N)110.5 456 Q(AD27 / K)-.35 E
-(entuck)-.25 E 2.5(yN)-.15 G(orth)-2.5 E(<esri26780> : N)110.5 468 Q
-(AD27 / K)-.35 E(entuck)-.25 E 2.5(yS)-.15 G(outh)-2.5 E
-(<esri26781> : N)110.5 480 Q(AD27 / Louisiana North)-.35 E
-(<esri26782> : N)110.5 492 Q(AD27 / Louisiana South)-.35 E
-(<esri26783> : N)110.5 504 Q(AD27 / Maine East)-.35 E(<esri26784> : N)
-110.5 516 Q(AD27 / Maine W)-.35 E(est)-.8 E(<esri26785> : N)110.5 528 Q
-(AD27 / Maryland)-.35 E(<esri26786> : N)110.5 540 Q
-(AD27 / Massachusetts Mainland)-.35 E(<esri26787> : N)110.5 552 Q
-(AD27 / Massachusetts Island)-.35 E(<esri26791> : N)110.5 564 Q
-(AD27 / Minnesota North)-.35 E(<esri26792> : N)110.5 576 Q
-(AD27 / Minnesota Central)-.35 E(<esri26793> : N)110.5 588 Q
-(AD27 / Minnesota South)-.35 E(<esri26794> : N)110.5 600 Q
-(AD27 / Mississippi East)-.35 E(<esri26795> : N)110.5 612 Q
-(AD27 / Mississippi W)-.35 E(est)-.8 E(<esri26796> : N)110.5 624 Q
-(AD27 / Missouri East)-.35 E(<esri26797> : N)110.5 636 Q
-(AD27 / Missouri Central)-.35 E(<esri26798> : N)110.5 648 Q
-(AD27 / Missouri W)-.35 E(est)-.8 E(<esri26801> : N)110.5 660 Q
-(AD Michig)-.35 E(an / Michig)-.05 E(an East)-.05 E(<esri26802> : N)
-110.5 672 Q(AD Michig)-.35 E(an / Michig)-.05 E(an Old Central)-.05 E
-(<esri26803> : N)110.5 684 Q(AD Michig)-.35 E(an / Michig)-.05 E(an W)
--.05 E(est)-.8 E(<esri26811> : N)110.5 696 Q(AD Michig)-.35 E
-(an / Michig)-.05 E(an North)-.05 E(<esri26812> : N)110.5 708 Q
-(AD Michig)-.35 E(an / Michig)-.05 E(an Central)-.05 E(<esri26813> : N)
-110.5 720 Q(AD Michig)-.35 E(an / Michig)-.05 E(an South)-.05 E
-(MB-System 5.0)72 768 Q(13 March 2014)140.11 E(119)188.45 E 0 Cg EP
-%%Page: 120 120
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<esri26903> : N)110.5 84 Q(AD83 / UTM zone 3N)
--.35 E(<esri26904> : N)110.5 96 Q(AD83 / UTM zone 4N)-.35 E
-(<esri26905> : N)110.5 108 Q(AD83 / UTM zone 5N)-.35 E(<esri26906> : N)
-110.5 120 Q(AD83 / UTM zone 6N)-.35 E(<esri26907> : N)110.5 132 Q
-(AD83 / UTM zone 7N)-.35 E(<esri26908> : N)110.5 144 Q
-(AD83 / UTM zone 8N)-.35 E(<esri26909> : N)110.5 156 Q
-(AD83 / UTM zone 9N)-.35 E(<esri26910> : N)110.5 168 Q
-(AD83 / UTM zone 10N)-.35 E(<esri26911> : N)110.5 180 Q
-(AD83 / UTM zone 11N)-.35 E(<esri26912> : N)110.5 192 Q
-(AD83 / UTM zone 12N)-.35 E(<esri26913> : N)110.5 204 Q
-(AD83 / UTM zone 13N)-.35 E(<esri26914> : N)110.5 216 Q
-(AD83 / UTM zone 14N)-.35 E(<esri26915> : N)110.5 228 Q
-(AD83 / UTM zone 15N)-.35 E(<esri26916> : N)110.5 240 Q
-(AD83 / UTM zone 16N)-.35 E(<esri26917> : N)110.5 252 Q
-(AD83 / UTM zone 17N)-.35 E(<esri26918> : N)110.5 264 Q
-(AD83 / UTM zone 18N)-.35 E(<esri26919> : N)110.5 276 Q
-(AD83 / UTM zone 19N)-.35 E(<esri26920> : N)110.5 288 Q
-(AD83 / UTM zone 20N)-.35 E(<esri26921> : N)110.5 300 Q
-(AD83 / UTM zone 21N)-.35 E(<esri26922> : N)110.5 312 Q
-(AD83 / UTM zone 22N)-.35 E(<esri26923> : N)110.5 324 Q
-(AD83 / UTM zone 23N)-.35 E(<esri26929> : N)110.5 336 Q
-(AD83 / Alabama East)-.35 E(<esri26930> : N)110.5 348 Q
-(AD83 / Alabama W)-.35 E(est)-.8 E(<esri26931> : N)110.5 360 Q
-(AD83 / Alaska zone 1)-.35 E(<esri26932> : N)110.5 372 Q
-(AD83 / Alaska zone 2)-.35 E(<esri26933> : N)110.5 384 Q
-(AD83 / Alaska zone 3)-.35 E(<esri26934> : N)110.5 396 Q
-(AD83 / Alaska zone 4)-.35 E(<esri26935> : N)110.5 408 Q
-(AD83 / Alaska zone 5)-.35 E(<esri26936> : N)110.5 420 Q
-(AD83 / Alaska zone 6)-.35 E(<esri26937> : N)110.5 432 Q
-(AD83 / Alaska zone 7)-.35 E(<esri26938> : N)110.5 444 Q
-(AD83 / Alaska zone 8)-.35 E(<esri26939> : N)110.5 456 Q
-(AD83 / Alaska zone 9)-.35 E(<esri26940> : N)110.5 468 Q
-(AD83 / Alaska zone 10)-.35 E(<esri26941> : N)110.5 480 Q
-(AD83 / California zone 1)-.35 E(<esri26942> : N)110.5 492 Q
-(AD83 / California zone 2)-.35 E(<esri26943> : N)110.5 504 Q
-(AD83 / California zone 3)-.35 E(<esri26944> : N)110.5 516 Q
-(AD83 / California zone 4)-.35 E(<esri26945> : N)110.5 528 Q
-(AD83 / California zone 5)-.35 E(<esri26946> : N)110.5 540 Q
-(AD83 / California zone 6)-.35 E(<esri26948> : N)110.5 552 Q
-(AD83 / Arizona East)-.35 E(<esri26949> : N)110.5 564 Q
-(AD83 / Arizona Central)-.35 E(<esri26950> : N)110.5 576 Q
-(AD83 / Arizona W)-.35 E(est)-.8 E(<esri26951> : N)110.5 588 Q
-(AD83 / Arkansas North)-.35 E(<esri26952> : N)110.5 600 Q
-(AD83 / Arkansas South)-.35 E(<esri26953> : N)110.5 612 Q
-(AD83 / Colorado North)-.35 E(<esri26954> : N)110.5 624 Q
-(AD83 / Colorado Central)-.35 E(<esri26955> : N)110.5 636 Q
-(AD83 / Colorado South)-.35 E(<esri26956> : N)110.5 648 Q
-(AD83 / Connecticut)-.35 E(<esri26957> : N)110.5 660 Q(AD83 / Dela)-.35
-E -.1(wa)-.15 G(re).1 E(<esri26958> : N)110.5 672 Q(AD83 / Florida East)
--.35 E(<esri26959> : N)110.5 684 Q(AD83 / Florida W)-.35 E(est)-.8 E
-(<esri26960> : N)110.5 696 Q(AD83 / Florida North)-.35 E
-(<esri26961> : N)110.5 708 Q(AD83 / Ha)-.35 E -.1(wa)-.15 G(ii zone 1).1
-E(<esri26962> : N)110.5 720 Q(AD83 / Ha)-.35 E -.1(wa)-.15 G(ii zone 2)
-.1 E(MB-System 5.0)72 768 Q(13 March 2014)140.11 E(120)188.45 E 0 Cg EP
-%%Page: 121 121
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<esri26963> : N)110.5 84 Q(AD83 / Ha)-.35 E -.1
-(wa)-.15 G(ii zone 3).1 E(<esri26964> : N)110.5 96 Q(AD83 / Ha)-.35 E
--.1(wa)-.15 G(ii zone 4).1 E(<esri26965> : N)110.5 108 Q(AD83 / Ha)-.35
-E -.1(wa)-.15 G(ii zone 5).1 E(<esri26966> : N)110.5 120 Q(AD83 / Geor)
--.35 E(gia East)-.18 E(<esri26967> : N)110.5 132 Q(AD83 / Geor)-.35 E
-(gia W)-.18 E(est)-.8 E(<esri26968> : N)110.5 144 Q(AD83 / Idaho East)
--.35 E(<esri26969> : N)110.5 156 Q(AD83 / Idaho Central)-.35 E
-(<esri26970> : N)110.5 168 Q(AD83 / Idaho W)-.35 E(est)-.8 E
-(<esri26971> : N)110.5 180 Q(AD83 / Illinois East)-.35 E
-(<esri26972> : N)110.5 192 Q(AD83 / Illinois W)-.35 E(est)-.8 E
-(<esri26973> : N)110.5 204 Q(AD83 / Indiana East)-.35 E(<esri26974> : N)
-110.5 216 Q(AD83 / Indiana W)-.35 E(est)-.8 E(<esri26975> : N)110.5 228
-Q(AD83 / Io)-.35 E .2 -.1(wa N)-.25 H(orth).1 E(<esri26976> : N)110.5
-240 Q(AD83 / Io)-.35 E .2 -.1(wa S)-.25 H(outh).1 E(<esri26977> : N)
-110.5 252 Q(AD83 / Kansas North)-.35 E(<esri26978> : N)110.5 264 Q
-(AD83 / Kansas South)-.35 E(<esri26979> : N)110.5 276 Q(AD83 / K)-.35 E
-(entuck)-.25 E 2.5(yN)-.15 G(orth)-2.5 E(<esri26980> : N)110.5 288 Q
-(AD83 / K)-.35 E(entuck)-.25 E 2.5(yS)-.15 G(outh)-2.5 E
-(<esri26981> : N)110.5 300 Q(AD83 / Louisiana North)-.35 E
-(<esri26982> : N)110.5 312 Q(AD83 / Louisiana South)-.35 E
-(<esri26983> : N)110.5 324 Q(AD83 / Maine East)-.35 E(<esri26984> : N)
-110.5 336 Q(AD83 / Maine W)-.35 E(est)-.8 E(<esri26985> : N)110.5 348 Q
-(AD83 / Maryland)-.35 E(<esri26986> : N)110.5 360 Q
-(AD83 / Massachusetts Mainland)-.35 E(<esri26987> : N)110.5 372 Q
-(AD83 / Massachusetts Island)-.35 E(<esri26988> : N)110.5 384 Q
-(AD83 / Michig)-.35 E(an North)-.05 E(<esri26989> : N)110.5 396 Q
-(AD83 / Michig)-.35 E(an Central)-.05 E(<esri26990> : N)110.5 408 Q
-(AD83 / Michig)-.35 E(an South)-.05 E(<esri26991> : N)110.5 420 Q
-(AD83 / Minnesota North)-.35 E(<esri26992> : N)110.5 432 Q
-(AD83 / Minnesota Central)-.35 E(<esri26993> : N)110.5 444 Q
-(AD83 / Minnesota South)-.35 E(<esri26994> : N)110.5 456 Q
-(AD83 / Mississippi East)-.35 E(<esri26995> : N)110.5 468 Q
-(AD83 / Mississippi W)-.35 E(est)-.8 E(<esri26996> : N)110.5 480 Q
-(AD83 / Missouri East)-.35 E(<esri26997> : N)110.5 492 Q
-(AD83 / Missouri Central)-.35 E(<esri26998> : N)110.5 504 Q
-(AD83 / Missouri W)-.35 E(est)-.8 E(<esri27038> : Nahrw)110.5 516 Q
-(an 1967 / UTM zone 38N)-.1 E(<esri27039> : Nahrw)110.5 528 Q
-(an 1967 / UTM zone 39N)-.1 E(<esri27040> : Nahrw)110.5 540 Q
-(an 1967 / UTM zone 40N)-.1 E
-(<esri27120> : Naparima 1972 / UTM zone 20N)110.5 552 Q
-(<esri27200> : NZGD49 / Ne)110.5 564 Q 2.5(wZ)-.25 G(ealand Map Grid)
--2.5 E(<esri27205> : NZGD49 / Mount Eden Circuit)110.5 576 Q
-(<esri27206> : NZGD49 / Bay of Plenty Circuit)110.5 588 Q
-(<esri27207> : NZGD49 / Po)110.5 600 Q -.15(ve)-.15 G(rty Bay Circuit)
-.15 E(<esri27208> : NZGD49 / Ha)110.5 612 Q(wk)-.15 E(es Bay Circuit)-.1
-E(<esri27209> : NZGD49 / T)110.5 624 Q(aranaki Circuit)-.8 E
-(<esri27210> : NZGD49 / T)110.5 636 Q(uhirangi Circuit)-.45 E
-(<esri27211> : NZGD49 / W)110.5 648 Q(ang)-.8 E(anui Circuit)-.05 E
-(<esri27212> : NZGD49 / W)110.5 660 Q(airarapa Circuit)-.8 E
-(<esri27213> : NZGD49 / W)110.5 672 Q(ellington Circuit)-.8 E
-(<esri27214> : NZGD49 / Collingw)110.5 684 Q(ood Circuit)-.1 E
-(<esri27215> : NZGD49 / Nelson Circuit)110.5 696 Q
-(<esri27216> : NZGD49 / Karamea Circuit)110.5 708 Q
-(<esri27217> : NZGD49 / Buller Circuit)110.5 720 Q(MB-System 5.0)72 768
-Q(13 March 2014)140.11 E(121)188.45 E 0 Cg EP
-%%Page: 122 122
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<esri27218> : NZGD49 / Gre)110.5 84 Q 2.5(yC)
--.15 G(ircuit)-2.5 E(<esri27219> : NZGD49 / Amuri Circuit)110.5 96 Q
-(<esri27220> : NZGD49 / Marlborough Circuit)110.5 108 Q
-(<esri27221> : NZGD49 / Hokitika Circuit)110.5 120 Q
-(<esri27222> : NZGD49 / Okarito Circuit)110.5 132 Q
-(<esri27223> : NZGD49 / Jacksons Bay Circuit)110.5 144 Q
-(<esri27224> : NZGD49 / Mount Pleasant Circuit)110.5 156 Q
-(<esri27225> : NZGD49 / Ga)110.5 168 Q(wler Circuit)-.15 E
-(<esri27226> : NZGD49 / T)110.5 180 Q(imaru Circuit)-.35 E
-(<esri27227> : NZGD49 / Lindis Peak Circuit)110.5 192 Q
-(<esri27228> : NZGD49 / Mount Nicholas Circuit)110.5 204 Q
-(<esri27229> : NZGD49 / Mount Y)110.5 216 Q(ork Circuit)-1.1 E
-(<esri27230> : NZGD49 / Observ)110.5 228 Q(ation Point Circuit)-.25 E
-(<esri27231> : NZGD49 / North T)110.5 240 Q(aieri Circuit)-.8 E
-(<esri27232> : NZGD49 / Bluf)110.5 252 Q 2.5(fC)-.25 G(ircuit)-2.5 E
-(<esri27258> : NZGD49 / UTM zone 58S)110.5 264 Q
-(<esri27259> : NZGD49 / UTM zone 59S)110.5 276 Q
-(<esri27260> : NZGD49 / UTM zone 60S)110.5 288 Q
-(<esri27291> : NZGD49 / North Island Grid)110.5 300 Q
-(<esri27292> : NZGD49 / South Island Grid)110.5 312 Q
-(<esri27391> : NGO 1948 \(Oslo\) / NGO zone I)110.5 324 Q
-(<esri27392> : NGO 1948 \(Oslo\) / NGO zone II)110.5 336 Q
-(<esri27393> : NGO 1948 \(Oslo\) / NGO zone III)110.5 348 Q
-(<esri27394> : NGO 1948 \(Oslo\) / NGO zone IV)110.5 360 Q
-(<esri27395> : NGO 1948 \(Oslo\) / NGO zone V)110.5 372 Q
-(<esri27396> : NGO 1948 \(Oslo\) / NGO zone VI)110.5 384 Q
-(<esri27397> : NGO 1948 \(Oslo\) / NGO zone VII)110.5 396 Q
-(<esri27398> : NGO 1948 \(Oslo\) / NGO zone VIII)110.5 408 Q
-(<esri27429> : Datum 73 / UTM zone 29N)110.5 420 Q
-(<esri27492> : Datum 73 / Modi\214ed Portuguese Grid)110.5 432 Q
-(<esri27500> : A)110.5 444 Q(TF \(P)-1.11 E(aris\) / Nord de Guerre)-.15
-E(<esri27561> : NTF \(P)110.5 456 Q(aris\) / Lambert Nord France)-.15 E
-(<esri27562> : NTF \(P)110.5 468 Q(aris\) / Lambert Centre France)-.15 E
-(<esri27563> : NTF \(P)110.5 480 Q(aris\) / Lambert Sud France)-.15 E
-(<esri27564> : NTF \(P)110.5 492 Q(aris\) / Lambert Corse)-.15 E
-(<esri27571> : NTF \(P)110.5 504 Q(aris\) / Lambert zone I)-.15 E
-(<esri27572> : NTF \(P)110.5 516 Q(aris\) / Lambert zone II)-.15 E
-(<esri27573> : NTF \(P)110.5 528 Q(aris\) / Lambert zone III)-.15 E
-(<esri27574> : NTF \(P)110.5 540 Q(aris\) / Lambert zone IV)-.15 E
-(<esri27581> : NTF \(P)110.5 552 Q(aris\) / France I)-.15 E
-(<esri27582> : NTF \(P)110.5 564 Q(aris\) / France II)-.15 E
-(<esri27583> : NTF \(P)110.5 576 Q(aris\) / France III)-.15 E
-(<esri27584> : NTF \(P)110.5 588 Q(aris\) / France IV)-.15 E
-(<esri27591> : NTF \(P)110.5 600 Q(aris\) / Nord France)-.15 E
-(<esri27592> : NTF \(P)110.5 612 Q(aris\) / Centre France)-.15 E
-(<esri27593> : NTF \(P)110.5 624 Q(aris\) / Sud France)-.15 E
-(<esri27594> : NTF \(P)110.5 636 Q(aris\) / Corse)-.15 E
-(<esri27700> : OSGB 1936 / British National Grid)110.5 648 Q
-(<esri28191> : P)110.5 660 Q(alestine 1923 / P)-.15 E(alestine Grid)-.15
-E(<esri28192> : P)110.5 672 Q(alestine 1923 / P)-.15 E(alestine Belt)
--.15 E(<esri28193> : P)110.5 684 Q(alestine 1923 / Israeli CS Grid)-.15
-E(<esri28232> : Pointe Noire / UTM zone 32S)110.5 696 Q
-(<esri28348> : GD)110.5 708 Q(A94 / MGA zone 48)-.4 E(<esri28349> : GD)
-110.5 720 Q(A94 / MGA zone 49)-.4 E(MB-System 5.0)72 768 Q
-(13 March 2014)140.11 E(122)188.45 E 0 Cg EP
-%%Page: 123 123
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<esri28350> : GD)110.5 84 Q(A94 / MGA zone 50)
--.4 E(<esri28351> : GD)110.5 96 Q(A94 / MGA zone 51)-.4 E
-(<esri28352> : GD)110.5 108 Q(A94 / MGA zone 52)-.4 E(<esri28353> : GD)
-110.5 120 Q(A94 / MGA zone 53)-.4 E(<esri28354> : GD)110.5 132 Q
-(A94 / MGA zone 54)-.4 E(<esri28355> : GD)110.5 144 Q(A94 / MGA zone 55)
--.4 E(<esri28356> : GD)110.5 156 Q(A94 / MGA zone 56)-.4 E
-(<esri28357> : GD)110.5 168 Q(A94 / MGA zone 57)-.4 E(<esri28358> : GD)
-110.5 180 Q(A94 / MGA zone 58)-.4 E(<esri28402> : Pulk)110.5 192 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger zone 2)-2.5 E
-(<esri28403> : Pulk)110.5 204 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger zone 3)-2.5 E(<esri28404> : Pulk)110.5 216 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger zone 4)-2.5 E
-(<esri28405> : Pulk)110.5 228 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger zone 5)-2.5 E(<esri28406> : Pulk)110.5 240 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger zone 6)-2.5 E
-(<esri28407> : Pulk)110.5 252 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger zone 7)-2.5 E(<esri28408> : Pulk)110.5 264 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger zone 8)-2.5 E
-(<esri28409> : Pulk)110.5 276 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger zone 9)-2.5 E(<esri28410> : Pulk)110.5 288 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger zone 10)-2.5 E
-(<esri28411> : Pulk)110.5 300 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger zone 11)-2.5 E(<esri28412> : Pulk)110.5 312 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger zone 12)-2.5 E
-(<esri28413> : Pulk)110.5 324 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger zone 13)-2.5 E(<esri28414> : Pulk)110.5 336 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger zone 14)-2.5 E
-(<esri28415> : Pulk)110.5 348 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger zone 15)-2.5 E(<esri28416> : Pulk)110.5 360 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger zone 16)-2.5 E
-(<esri28417> : Pulk)110.5 372 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger zone 17)-2.5 E(<esri28418> : Pulk)110.5 384 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger zone 18)-2.5 E
-(<esri28419> : Pulk)110.5 396 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger zone 19)-2.5 E(<esri28420> : Pulk)110.5 408 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger zone 20)-2.5 E
-(<esri28421> : Pulk)110.5 420 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger zone 21)-2.5 E(<esri28422> : Pulk)110.5 432 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger zone 22)-2.5 E
-(<esri28423> : Pulk)110.5 444 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger zone 23)-2.5 E(<esri28424> : Pulk)110.5 456 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger zone 24)-2.5 E
-(<esri28425> : Pulk)110.5 468 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger zone 25)-2.5 E(<esri28426> : Pulk)110.5 480 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger zone 26)-2.5 E
-(<esri28427> : Pulk)110.5 492 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger zone 27)-2.5 E(<esri28428> : Pulk)110.5 504 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger zone 28)-2.5 E
-(<esri28429> : Pulk)110.5 516 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger zone 29)-2.5 E(<esri28430> : Pulk)110.5 528 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger zone 30)-2.5 E
-(<esri28431> : Pulk)110.5 540 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger zone 31)-2.5 E(<esri28432> : Pulk)110.5 552 Q -.15
-(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger zone 32)-2.5 E
-(<esri28462> : Pulk)110.5 564 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger 2N)-2.5 E(<esri28463> : Pulk)110.5 576 Q -.15(ov)-.1
-G 2.5(o1)-.05 G(942 / Gauss-Kruger 3N)-2.5 E(<esri28464> : Pulk)110.5
-588 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger 4N)-2.5 E
-(<esri28465> : Pulk)110.5 600 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger 5N)-2.5 E(<esri28466> : Pulk)110.5 612 Q -.15(ov)-.1
-G 2.5(o1)-.05 G(942 / Gauss-Kruger 6N)-2.5 E(<esri28467> : Pulk)110.5
-624 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger 7N)-2.5 E
-(<esri28468> : Pulk)110.5 636 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger 8N)-2.5 E(<esri28469> : Pulk)110.5 648 Q -.15(ov)-.1
-G 2.5(o1)-.05 G(942 / Gauss-Kruger 9N)-2.5 E(<esri28470> : Pulk)110.5
-660 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger 10N)-2.5 E
-(<esri28471> : Pulk)110.5 672 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger 11N)-2.5 E(<esri28472> : Pulk)110.5 684 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger 12N)-2.5 E(<esri28473> : Pulk)
-110.5 696 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger 13N)-2.5 E
-(<esri28474> : Pulk)110.5 708 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger 14N)-2.5 E(<esri28475> : Pulk)110.5 720 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger 15N)-2.5 E(MB-System 5.0)72 768 Q
-(13 March 2014)140.11 E(123)188.45 E 0 Cg EP
-%%Page: 124 124
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<esri28476> : Pulk)110.5 84 Q -.15(ov)-.1 G 2.5
-(o1)-.05 G(942 / Gauss-Kruger 16N)-2.5 E(<esri28477> : Pulk)110.5 96 Q
--.15(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger 17N)-2.5 E
-(<esri28478> : Pulk)110.5 108 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger 18N)-2.5 E(<esri28479> : Pulk)110.5 120 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger 19N)-2.5 E(<esri28480> : Pulk)
-110.5 132 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger 20N)-2.5 E
-(<esri28481> : Pulk)110.5 144 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger 21N)-2.5 E(<esri28482> : Pulk)110.5 156 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger 22N)-2.5 E(<esri28483> : Pulk)
-110.5 168 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger 23N)-2.5 E
-(<esri28484> : Pulk)110.5 180 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger 24N)-2.5 E(<esri28485> : Pulk)110.5 192 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger 25N)-2.5 E(<esri28486> : Pulk)
-110.5 204 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger 26N)-2.5 E
-(<esri28487> : Pulk)110.5 216 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger 27N)-2.5 E(<esri28488> : Pulk)110.5 228 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger 28N)-2.5 E(<esri28489> : Pulk)
-110.5 240 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger 29N)-2.5 E
-(<esri28490> : Pulk)110.5 252 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(942 / Gauss-Kruger 30N)-2.5 E(<esri28491> : Pulk)110.5 264 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger 31N)-2.5 E(<esri28492> : Pulk)
-110.5 276 Q -.15(ov)-.1 G 2.5(o1)-.05 G(942 / Gauss-Kruger 32N)-2.5 E
-(<esri28600> : Qatar 1974 / Qatar National Grid)110.5 288 Q
-(<esri28991> : Amersfoort / RD Old)110.5 300 Q
-(<esri28992> : Amersfoort / RD Ne)110.5 312 Q(w)-.25 E
-(<esri29100> : SAD69 / Brazil Polyconic)110.5 324 Q
-(<esri29118> : SAD69 / UTM zone 18N)110.5 336 Q
-(<esri29119> : SAD69 / UTM zone 19N)110.5 348 Q
-(<esri29120> : SAD69 / UTM zone 20N)110.5 360 Q
-(<esri29121> : SAD69 / UTM zone 21N)110.5 372 Q
-(<esri29122> : SAD69 / UTM zone 22N)110.5 384 Q
-(<esri29177> : SAD69 / UTM zone 17S)110.5 396 Q
-(<esri29178> : SAD69 / UTM zone 18S)110.5 408 Q
-(<esri29179> : SAD69 / UTM zone 19S)110.5 420 Q
-(<esri29180> : SAD69 / UTM zone 20S)110.5 432 Q
-(<esri29181> : SAD69 / UTM zone 21S)110.5 444 Q
-(<esri29182> : SAD69 / UTM zone 22S)110.5 456 Q
-(<esri29183> : SAD69 / UTM zone 23S)110.5 468 Q
-(<esri29184> : SAD69 / UTM zone 24S)110.5 480 Q
-(<esri29185> : SAD69 / UTM zone 25S)110.5 492 Q
-(<esri29220> : Sapper Hill 1943 / UTM zone 20S)110.5 504 Q
-(<esri29221> : Sapper Hill 1943 / UTM zone 21S)110.5 516 Q
-(<esri29333> : Schw)110.5 528 Q(arzeck / UTM zone 33S)-.1 E
-(<esri29635> : Sudan / UTM zone 35N)110.5 540 Q
-(<esri29636> : Sudan / UTM zone 36N)110.5 552 Q(<esri29700> : T)110.5
-564 Q(ananari)-.8 E .3 -.15(ve \()-.25 H -.15(Pa).15 G
-(ris\) / Laborde Grid).15 E(<esri29738> : T)110.5 576 Q(ananari)-.8 E .3
--.15(ve / U)-.25 H(TM zone 38S).15 E(<esri29739> : T)110.5 588 Q
-(ananari)-.8 E .3 -.15(ve / U)-.25 H(TM zone 39S).15 E(<esri29849> : T)
-110.5 600 Q(imbalai 1948 / UTM zone 49N)-.35 E(<esri29850> : T)110.5 612
-Q(imbalai 1948 / UTM zone 50N)-.35 E(<esri29871> : T)110.5 624 Q
-(imbalai 1948 / R.S.O. Borneo \(ch\))-.35 E(<esri29872> : T)110.5 636 Q
-(imbalai 1948 / R.S.O. Borneo \(ft\))-.35 E(<esri29873> : T)110.5 648 Q
-(imbalai 1948 / R.S.O. Borneo \(m\))-.35 E
-(<esri29900> : TM65 / Irish National Grid)110.5 660 Q
-(<esri29901> : OSNI 1952 / Irish National Grid)110.5 672 Q
-(<esri29902> : TM65 / Irish Grid)110.5 684 Q
-(<esri29903> : TM75 / Irish Grid)110.5 696 Q(<esri30161> : T)110.5 708 Q
-(ok)-.8 E(yo / Japan Plane Rectangular CS I)-.15 E(<esri30162> : T)110.5
-720 Q(ok)-.8 E(yo / Japan Plane Rectangular CS II)-.15 E(MB-System 5.0)
-72 768 Q(13 March 2014)140.11 E(124)188.45 E 0 Cg EP
-%%Page: 125 125
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<esri30163> : T)110.5 84 Q(ok)-.8 E
-(yo / Japan Plane Rectangular CS III)-.15 E(<esri30164> : T)110.5 96 Q
-(ok)-.8 E(yo / Japan Plane Rectangular CS IV)-.15 E(<esri30165> : T)
-110.5 108 Q(ok)-.8 E(yo / Japan Plane Rectangular CS V)-.15 E
-(<esri30166> : T)110.5 120 Q(ok)-.8 E
-(yo / Japan Plane Rectangular CS VI)-.15 E(<esri30167> : T)110.5 132 Q
-(ok)-.8 E(yo / Japan Plane Rectangular CS VII)-.15 E(<esri30168> : T)
-110.5 144 Q(ok)-.8 E(yo / Japan Plane Rectangular CS VIII)-.15 E
-(<esri30169> : T)110.5 156 Q(ok)-.8 E
-(yo / Japan Plane Rectangular CS IX)-.15 E(<esri30170> : T)110.5 168 Q
-(ok)-.8 E(yo / Japan Plane Rectangular CS X)-.15 E(<esri30171> : T)110.5
-180 Q(ok)-.8 E(yo / Japan Plane Rectangular CS XI)-.15 E
-(<esri30172> : T)110.5 192 Q(ok)-.8 E
-(yo / Japan Plane Rectangular CS XII)-.15 E(<esri30173> : T)110.5 204 Q
-(ok)-.8 E(yo / Japan Plane Rectangular CS XIII)-.15 E(<esri30174> : T)
-110.5 216 Q(ok)-.8 E(yo / Japan Plane Rectangular CS XIV)-.15 E
-(<esri30175> : T)110.5 228 Q(ok)-.8 E
-(yo / Japan Plane Rectangular CS XV)-.15 E(<esri30176> : T)110.5 240 Q
-(ok)-.8 E(yo / Japan Plane Rectangular CS XVI)-.15 E(<esri30177> : T)
-110.5 252 Q(ok)-.8 E(yo / Japan Plane Rectangular CS XVII)-.15 E
-(<esri30178> : T)110.5 264 Q(ok)-.8 E
-(yo / Japan Plane Rectangular CS XVIII)-.15 E(<esri30179> : T)110.5 276
-Q(ok)-.8 E(yo / Japan Plane Rectangular CS XIX)-.15 E(<esri30200> : T)
-110.5 288 Q(rinidad 1903 / T)-.35 E(rinidad Grid)-.35 E
-(<esri30339> : TC\(1948\) / UTM zone 39N)110.5 300 Q
-(<esri30340> : TC\(1948\) / UTM zone 40N)110.5 312 Q(<esri30491> : V)
-110.5 324 Q(oirol 1875 / Nord Algerie \(ancienne\))-1.29 E
-(<esri30492> : V)110.5 336 Q(oirol 1875 / Sud Algerie \(ancienne\))-1.29
-E(<esri30729> : Nord Sahara 1959 / UTM zone 29N)110.5 348 Q
-(<esri30730> : Nord Sahara 1959 / UTM zone 30N)110.5 360 Q
-(<esri30731> : Nord Sahara 1959 / UTM zone 31N)110.5 372 Q
-(<esri30732> : Nord Sahara 1959 / UTM zone 32N)110.5 384 Q
-(<esri30791> : Nord Sahara 1959 / V)110.5 396 Q(oirol Uni\214e Nord)
--1.29 E(<esri30792> : Nord Sahara 1959 / V)110.5 408 Q
-(oirol Uni\214e Sud)-1.29 E(<esri30800> : R)110.5 420 Q(T38 2.5 gon W)
--.6 E(<esri31028> : Y)110.5 432 Q(of)-1.1 E 2.5(f/U)-.25 G(TM zone 28N)
--2.5 E(<esri31121> : Zanderij / UTM zone 21N)110.5 444 Q
-(<esri31154> : Zanderij / TM 54 NW)110.5 456 Q
-(<esri31170> : Zanderij / Suriname Old TM)110.5 468 Q
-(<esri31171> : Zanderij / Suriname TM)110.5 480 Q
-(<esri31265> : MGI / 3-de)110.5 492 Q(gree Gauss zone 5)-.15 E
-(<esri31266> : MGI / 3-de)110.5 504 Q(gree Gauss zone 6)-.15 E
-(<esri31267> : MGI / 3-de)110.5 516 Q(gree Gauss zone 7)-.15 E
-(<esri31268> : MGI / 3-de)110.5 528 Q(gree Gauss zone 8)-.15 E
-(<esri31275> : MGI / Balkans zone 5)110.5 540 Q
-(<esri31276> : MGI / Balkans zone 6)110.5 552 Q
-(<esri31277> : MGI / Balkans zone 7)110.5 564 Q
-(<esri31278> : MGI / Balkans zone 8)110.5 576 Q
-(<esri31279> : MGI / Balkans zone 8)110.5 588 Q
-(<esri31281> : MGI \(Ferro\) / Austria W)110.5 600 Q(est Zone)-.8 E
-(<esri31282> : MGI \(Ferro\) / Austria Central Zone)110.5 612 Q
-(<esri31283> : MGI \(Ferro\) / Austria East Zone)110.5 624 Q
-(<esri31284> : MGI / M28)110.5 636 Q(<esri31285> : MGI / M31)110.5 648 Q
-(<esri31286> : MGI / M34)110.5 660 Q
-(<esri31287> : MGI / Austria Lambert)110.5 672 Q
-(<esri31291> : MGI \(Ferro\) / Austria W)110.5 684 Q(est Zone)-.8 E
-(<esri31292> : MGI \(Ferro\) / Austria Central Zone)110.5 696 Q
-(<esri31293> : MGI \(Ferro\) / Austria East Zone)110.5 708 Q
-(<esri31294> : MGI / M28)110.5 720 Q(MB-System 5.0)72 768 Q
-(13 March 2014)140.11 E(125)188.45 E 0 Cg EP
-%%Page: 126 126
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<esri31295> : MGI / M31)110.5 84 Q
-(<esri31296> : MGI / M34)110.5 96 Q(<esri31297> : MGI / Austria Lambert)
-110.5 108 Q(<esri31300> : Belge 1972 / Belge Lambert 72)110.5 120 Q
-(<esri31370> : Belge 1972 / Belgian Lambert 72)110.5 132 Q
-(<esri31461> : DHDN / 3-de)110.5 144 Q(gree Gauss zone 1)-.15 E
-(<esri31462> : DHDN / 3-de)110.5 156 Q(gree Gauss zone 2)-.15 E
-(<esri31463> : DHDN / 3-de)110.5 168 Q(gree Gauss zone 3)-.15 E
-(<esri31464> : DHDN / 3-de)110.5 180 Q(gree Gauss zone 4)-.15 E
-(<esri31465> : DHDN / 3-de)110.5 192 Q(gree Gauss zone 5)-.15 E
-(<esri31466> : DHDN / Gauss-Kruger zone 2)110.5 204 Q
-(<esri31467> : DHDN / Gauss-Kruger zone 3)110.5 216 Q
-(<esri31468> : DHDN / Gauss-Kruger zone 4)110.5 228 Q
-(<esri31469> : DHDN / Gauss-Kruger zone 5)110.5 240 Q
-(<esri31528> : Conakry 1905 / UTM zone 28N)110.5 252 Q
-(<esri31529> : Conakry 1905 / UTM zone 29N)110.5 264 Q
-(<esri31600> : Dealul Piscului 1933/ Stereo 33)110.5 276 Q
-(<esri31700> : Dealul Piscului 1970/ Stereo 70)110.5 288 Q
-(<esri31838> : NGN / UTM zone 38N)110.5 300 Q
-(<esri31839> : NGN / UTM zone 39N)110.5 312 Q(<esri31900> : KUD)110.5
-324 Q(AMS / KTM)-.4 E(<esri31986> : SIRGAS / UTM zone 17N)110.5 336 Q
-(<esri31987> : SIRGAS / UTM zone 18N)110.5 348 Q
-(<esri31988> : SIRGAS / UTM zone 19N)110.5 360 Q
-(<esri31989> : SIRGAS / UTM zone 20N)110.5 372 Q
-(<esri31990> : SIRGAS / UTM zone 21N)110.5 384 Q
-(<esri31991> : SIRGAS / UTM zone 22N)110.5 396 Q
-(<esri31992> : SIRGAS / UTM zone 17S)110.5 408 Q
-(<esri31993> : SIRGAS / UTM zone 18S)110.5 420 Q
-(<esri31994> : SIRGAS / UTM zone 19S)110.5 432 Q
-(<esri31995> : SIRGAS / UTM zone 20S)110.5 444 Q
-(<esri31996> : SIRGAS / UTM zone 21S)110.5 456 Q
-(<esri31997> : SIRGAS / UTM zone 22S)110.5 468 Q
-(<esri31998> : SIRGAS / UTM zone 23S)110.5 480 Q
-(<esri31999> : SIRGAS / UTM zone 24S)110.5 492 Q
-(<esri32000> : SIRGAS / UTM zone 25S)110.5 504 Q(<esri32001> : N)110.5
-516 Q(AD27 / Montana North)-.35 E(<esri32002> : N)110.5 528 Q
-(AD27 / Montana Central)-.35 E(<esri32003> : N)110.5 540 Q
-(AD27 / Montana South)-.35 E(<esri32005> : N)110.5 552 Q
-(AD27 / Nebraska North)-.35 E(<esri32006> : N)110.5 564 Q
-(AD27 / Nebraska South)-.35 E(<esri32007> : N)110.5 576 Q(AD27 / Ne)-.35
-E -.25(va)-.25 G(da East).25 E(<esri32008> : N)110.5 588 Q(AD27 / Ne)
--.35 E -.25(va)-.25 G(da Central).25 E(<esri32009> : N)110.5 600 Q
-(AD27 / Ne)-.35 E -.25(va)-.25 G(da W).25 E(est)-.8 E(<esri32010> : N)
-110.5 612 Q(AD27 / Ne)-.35 E 2.5(wH)-.25 G(ampshire)-2.5 E
-(<esri32011> : N)110.5 624 Q(AD27 / Ne)-.35 E 2.5(wJ)-.25 G(erse)-2.5 E
-(y)-.15 E(<esri32012> : N)110.5 636 Q(AD27 / Ne)-.35 E 2.5(wM)-.25 G
--.15(ex)-2.5 G(ico East).15 E(<esri32013> : N)110.5 648 Q(AD27 / Ne)-.35
-E 2.5(wM)-.25 G -.15(ex)-2.5 G(ico Central).15 E(<esri32014> : N)110.5
-660 Q(AD27 / Ne)-.35 E 2.5(wM)-.25 G -.15(ex)-2.5 G(ico W).15 E(est)-.8
-E(<esri32015> : N)110.5 672 Q(AD27 / Ne)-.35 E 2.5(wY)-.25 G(ork East)
--3.6 E(<esri32016> : N)110.5 684 Q(AD27 / Ne)-.35 E 2.5(wY)-.25 G
-(ork Central)-3.6 E(<esri32017> : N)110.5 696 Q(AD27 / Ne)-.35 E 2.5(wY)
--.25 G(ork W)-3.6 E(est)-.8 E(<esri32018> : N)110.5 708 Q(AD27 / Ne)-.35
-E 2.5(wY)-.25 G(ork Long Island)-3.6 E(<esri32019> : N)110.5 720 Q
-(AD27 / North Carolina)-.35 E(MB-System 5.0)72 768 Q(13 March 2014)
-140.11 E(126)188.45 E 0 Cg EP
-%%Page: 127 127
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<esri32020> : N)110.5 84 Q(AD27 / North Dak)
--.35 E(ota North)-.1 E(<esri32021> : N)110.5 96 Q(AD27 / North Dak)-.35
-E(ota South)-.1 E(<esri32022> : N)110.5 108 Q(AD27 / Ohio North)-.35 E
-(<esri32023> : N)110.5 120 Q(AD27 / Ohio South)-.35 E(<esri32024> : N)
-110.5 132 Q(AD27 / Oklahoma North)-.35 E(<esri32025> : N)110.5 144 Q
-(AD27 / Oklahoma South)-.35 E(<esri32026> : N)110.5 156 Q(AD27 / Ore)
--.35 E(gon North)-.15 E(<esri32027> : N)110.5 168 Q(AD27 / Ore)-.35 E
-(gon South)-.15 E(<esri32028> : N)110.5 180 Q(AD27 / Pennsylv)-.35 E
-(ania North)-.25 E(<esri32029> : N)110.5 192 Q(AD27 / Pennsylv)-.35 E
-(ania South)-.25 E(<esri32030> : N)110.5 204 Q(AD27 / Rhode Island)-.35
-E(<esri32031> : N)110.5 216 Q(AD27 / South Carolina North)-.35 E
-(<esri32033> : N)110.5 228 Q(AD27 / South Carolina South)-.35 E
-(<esri32034> : N)110.5 240 Q(AD27 / South Dak)-.35 E(ota North)-.1 E
-(<esri32035> : N)110.5 252 Q(AD27 / South Dak)-.35 E(ota South)-.1 E
-(<esri32036> : N)110.5 264 Q(AD27 / T)-.35 E(ennessee)-.7 E
-(<esri32037> : N)110.5 276 Q(AD27 / T)-.35 E -.15(ex)-.7 G(as North).15
-E(<esri32038> : N)110.5 288 Q(AD27 / T)-.35 E -.15(ex)-.7 G
-(as North Central).15 E(<esri32039> : N)110.5 300 Q(AD27 / T)-.35 E -.15
-(ex)-.7 G(as Central).15 E(<esri32040> : N)110.5 312 Q(AD27 / T)-.35 E
--.15(ex)-.7 G(as South Central).15 E(<esri32041> : N)110.5 324 Q
-(AD27 / T)-.35 E -.15(ex)-.7 G(as South).15 E(<esri32042> : N)110.5 336
-Q(AD27 / Utah North)-.35 E(<esri32043> : N)110.5 348 Q
-(AD27 / Utah Central)-.35 E(<esri32044> : N)110.5 360 Q
-(AD27 / Utah South)-.35 E(<esri32045> : N)110.5 372 Q(AD27 / V)-.35 E
-(ermont)-1.11 E(<esri32046> : N)110.5 384 Q(AD27 / V)-.35 E(ir)-.6 E
-(ginia North)-.18 E(<esri32047> : N)110.5 396 Q(AD27 / V)-.35 E(ir)-.6 E
-(ginia South)-.18 E(<esri32048> : N)110.5 408 Q(AD27 / W)-.35 E
-(ashington North)-.8 E(<esri32049> : N)110.5 420 Q(AD27 / W)-.35 E
-(ashington South)-.8 E(<esri32050> : N)110.5 432 Q(AD27 / W)-.35 E
-(est V)-.8 E(ir)-.6 E(ginia North)-.18 E(<esri32051> : N)110.5 444 Q
-(AD27 / W)-.35 E(est V)-.8 E(ir)-.6 E(ginia South)-.18 E
-(<esri32052> : N)110.5 456 Q(AD27 / W)-.35 E(isconsin North)-.4 E
-(<esri32053> : N)110.5 468 Q(AD27 / W)-.35 E(isconsin Central)-.4 E
-(<esri32054> : N)110.5 480 Q(AD27 / W)-.35 E(isconsin South)-.4 E
-(<esri32055> : N)110.5 492 Q(AD27 / W)-.35 E(yoming East)-.73 E
-(<esri32056> : N)110.5 504 Q(AD27 / W)-.35 E(yoming East Central)-.73 E
-(<esri32057> : N)110.5 516 Q(AD27 / W)-.35 E(yoming W)-.73 E
-(est Central)-.8 E(<esri32058> : N)110.5 528 Q(AD27 / W)-.35 E(yoming W)
--.73 E(est)-.8 E(<esri32061> : N)110.5 540 Q(AD27 / Guatemala Norte)-.35
-E(<esri32062> : N)110.5 552 Q(AD27 / Guatemala Sur)-.35 E
-(<esri32064> : N)110.5 564 Q(AD27 / BLM 14N \(ftUS\))-.35 E
-(<esri32065> : N)110.5 576 Q(AD27 / BLM 15N \(ftUS\))-.35 E
-(<esri32066> : N)110.5 588 Q(AD27 / BLM 16N \(ftUS\))-.35 E
-(<esri32067> : N)110.5 600 Q(AD27 / BLM 17N \(ftUS\))-.35 E
-(<esri32074> : N)110.5 612 Q(AD27 / BLM 14N \(feet\))-.35 E
-(<esri32075> : N)110.5 624 Q(AD27 / BLM 15N \(feet\))-.35 E
-(<esri32076> : N)110.5 636 Q(AD27 / BLM 16N \(feet\))-.35 E
-(<esri32077> : N)110.5 648 Q(AD27 / BLM 17N \(feet\))-.35 E
-(<esri32081> : N)110.5 660 Q(AD27 / MTM zone 1)-.35 E(<esri32082> : N)
-110.5 672 Q(AD27 / MTM zone 2)-.35 E(<esri32083> : N)110.5 684 Q
-(AD27 / MTM zone 3)-.35 E(<esri32084> : N)110.5 696 Q(AD27 / MTM zone 4)
--.35 E(<esri32085> : N)110.5 708 Q(AD27 / MTM zone 5)-.35 E
-(<esri32086> : N)110.5 720 Q(AD27 / MTM zone 6)-.35 E(MB-System 5.0)72
-768 Q(13 March 2014)140.11 E(127)188.45 E 0 Cg EP
-%%Page: 128 128
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<esri32098> : N)110.5 84 Q
-(AD27 / Quebec Lambert)-.35 E(<esri32100> : N)110.5 96 Q(AD83 / Montana)
--.35 E(<esri32104> : N)110.5 108 Q(AD83 / Nebraska)-.35 E
-(<esri32107> : N)110.5 120 Q(AD83 / Ne)-.35 E -.25(va)-.25 G(da East).25
-E(<esri32108> : N)110.5 132 Q(AD83 / Ne)-.35 E -.25(va)-.25 G
-(da Central).25 E(<esri32109> : N)110.5 144 Q(AD83 / Ne)-.35 E -.25(va)
--.25 G(da W).25 E(est)-.8 E(<esri32110> : N)110.5 156 Q(AD83 / Ne)-.35 E
-2.5(wH)-.25 G(ampshire)-2.5 E(<esri32111> : N)110.5 168 Q(AD83 / Ne)-.35
-E 2.5(wJ)-.25 G(erse)-2.5 E(y)-.15 E(<esri32112> : N)110.5 180 Q
-(AD83 / Ne)-.35 E 2.5(wM)-.25 G -.15(ex)-2.5 G(ico East).15 E
-(<esri32113> : N)110.5 192 Q(AD83 / Ne)-.35 E 2.5(wM)-.25 G -.15(ex)-2.5
-G(ico Central).15 E(<esri32114> : N)110.5 204 Q(AD83 / Ne)-.35 E 2.5(wM)
--.25 G -.15(ex)-2.5 G(ico W).15 E(est)-.8 E(<esri32115> : N)110.5 216 Q
-(AD83 / Ne)-.35 E 2.5(wY)-.25 G(ork East)-3.6 E(<esri32116> : N)110.5
-228 Q(AD83 / Ne)-.35 E 2.5(wY)-.25 G(ork Central)-3.6 E(<esri32117> : N)
-110.5 240 Q(AD83 / Ne)-.35 E 2.5(wY)-.25 G(ork W)-3.6 E(est)-.8 E
-(<esri32118> : N)110.5 252 Q(AD83 / Ne)-.35 E 2.5(wY)-.25 G
-(ork Long Island)-3.6 E(<esri32119> : N)110.5 264 Q
-(AD83 / North Carolina)-.35 E(<esri32120> : N)110.5 276 Q
-(AD83 / North Dak)-.35 E(ota North)-.1 E(<esri32121> : N)110.5 288 Q
-(AD83 / North Dak)-.35 E(ota South)-.1 E(<esri32122> : N)110.5 300 Q
-(AD83 / Ohio North)-.35 E(<esri32123> : N)110.5 312 Q(AD83 / Ohio South)
--.35 E(<esri32124> : N)110.5 324 Q(AD83 / Oklahoma North)-.35 E
-(<esri32125> : N)110.5 336 Q(AD83 / Oklahoma South)-.35 E
-(<esri32126> : N)110.5 348 Q(AD83 / Ore)-.35 E(gon North)-.15 E
-(<esri32127> : N)110.5 360 Q(AD83 / Ore)-.35 E(gon South)-.15 E
-(<esri32128> : N)110.5 372 Q(AD83 / Pennsylv)-.35 E(ania North)-.25 E
-(<esri32129> : N)110.5 384 Q(AD83 / Pennsylv)-.35 E(ania South)-.25 E
-(<esri32130> : N)110.5 396 Q(AD83 / Rhode Island)-.35 E(<esri32133> : N)
-110.5 408 Q(AD83 / South Carolina)-.35 E(<esri32134> : N)110.5 420 Q
-(AD83 / South Dak)-.35 E(ota North)-.1 E(<esri32135> : N)110.5 432 Q
-(AD83 / South Dak)-.35 E(ota South)-.1 E(<esri32136> : N)110.5 444 Q
-(AD83 / T)-.35 E(ennessee)-.7 E(<esri32137> : N)110.5 456 Q(AD83 / T)
--.35 E -.15(ex)-.7 G(as North).15 E(<esri32138> : N)110.5 468 Q
-(AD83 / T)-.35 E -.15(ex)-.7 G(as North Central).15 E(<esri32139> : N)
-110.5 480 Q(AD83 / T)-.35 E -.15(ex)-.7 G(as Central).15 E
-(<esri32140> : N)110.5 492 Q(AD83 / T)-.35 E -.15(ex)-.7 G
-(as South Central).15 E(<esri32141> : N)110.5 504 Q(AD83 / T)-.35 E -.15
-(ex)-.7 G(as South).15 E(<esri32142> : N)110.5 516 Q(AD83 / Utah North)
--.35 E(<esri32143> : N)110.5 528 Q(AD83 / Utah Central)-.35 E
-(<esri32144> : N)110.5 540 Q(AD83 / Utah South)-.35 E(<esri32145> : N)
-110.5 552 Q(AD83 / V)-.35 E(ermont)-1.11 E(<esri32146> : N)110.5 564 Q
-(AD83 / V)-.35 E(ir)-.6 E(ginia North)-.18 E(<esri32147> : N)110.5 576 Q
-(AD83 / V)-.35 E(ir)-.6 E(ginia South)-.18 E(<esri32148> : N)110.5 588 Q
-(AD83 / W)-.35 E(ashington North)-.8 E(<esri32149> : N)110.5 600 Q
-(AD83 / W)-.35 E(ashington South)-.8 E(<esri32150> : N)110.5 612 Q
-(AD83 / W)-.35 E(est V)-.8 E(ir)-.6 E(ginia North)-.18 E
-(<esri32151> : N)110.5 624 Q(AD83 / W)-.35 E(est V)-.8 E(ir)-.6 E
-(ginia South)-.18 E(<esri32152> : N)110.5 636 Q(AD83 / W)-.35 E
-(isconsin North)-.4 E(<esri32153> : N)110.5 648 Q(AD83 / W)-.35 E
-(isconsin Central)-.4 E(<esri32154> : N)110.5 660 Q(AD83 / W)-.35 E
-(isconsin South)-.4 E(<esri32155> : N)110.5 672 Q(AD83 / W)-.35 E
-(yoming East)-.73 E(<esri32156> : N)110.5 684 Q(AD83 / W)-.35 E
-(yoming East Central)-.73 E(<esri32157> : N)110.5 696 Q(AD83 / W)-.35 E
-(yoming W)-.73 E(est Central)-.8 E(<esri32158> : N)110.5 708 Q(AD83 / W)
--.35 E(yoming W)-.73 E(est)-.8 E(<esri32161> : N)110.5 720 Q
-(AD83 / Puerto Rico & V)-.35 E(ir)-.6 E(gin Is.)-.18 E(MB-System 5.0)72
-768 Q(13 March 2014)140.11 E(128)188.45 E 0 Cg EP
-%%Page: 129 129
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<esri32180> : N)110.5 84 Q(AD83 / SCoPQ zone 2)
--.35 E(<esri32181> : N)110.5 96 Q(AD83 / MTM zone 1)-.35 E
-(<esri32182> : N)110.5 108 Q(AD83 / MTM zone 2)-.35 E(<esri32183> : N)
-110.5 120 Q(AD83 / MTM zone 3)-.35 E(<esri32184> : N)110.5 132 Q
-(AD83 / MTM zone 4)-.35 E(<esri32185> : N)110.5 144 Q(AD83 / MTM zone 5)
--.35 E(<esri32186> : N)110.5 156 Q(AD83 / MTM zone 6)-.35 E
-(<esri32187> : N)110.5 168 Q(AD83 / MTM zone 7)-.35 E(<esri32188> : N)
-110.5 180 Q(AD83 / MTM zone 8)-.35 E(<esri32189> : N)110.5 192 Q
-(AD83 / MTM zone 9)-.35 E(<esri32190> : N)110.5 204 Q
-(AD83 / MTM zone 10)-.35 E(<esri32191> : N)110.5 216 Q
-(AD83 / MTM zone 11)-.35 E(<esri32192> : N)110.5 228 Q
-(AD83 / MTM zone 12)-.35 E(<esri32193> : N)110.5 240 Q
-(AD83 / MTM zone 13)-.35 E(<esri32194> : N)110.5 252 Q
-(AD83 / MTM zone 14)-.35 E(<esri32195> : N)110.5 264 Q
-(AD83 / MTM zone 15)-.35 E(<esri32196> : N)110.5 276 Q
-(AD83 / MTM zone 16)-.35 E(<esri32197> : N)110.5 288 Q
-(AD83 / MTM zone 17)-.35 E(<esri32198> : N)110.5 300 Q
-(AD83 / Quebec Lambert)-.35 E(<esri32201> : WGS 72 / UTM zone 1N)110.5
-312 Q(<esri32202> : WGS 72 / UTM zone 2N)110.5 324 Q
-(<esri32203> : WGS 72 / UTM zone 3N)110.5 336 Q
-(<esri32204> : WGS 72 / UTM zone 4N)110.5 348 Q
-(<esri32205> : WGS 72 / UTM zone 5N)110.5 360 Q
-(<esri32206> : WGS 72 / UTM zone 6N)110.5 372 Q
-(<esri32207> : WGS 72 / UTM zone 7N)110.5 384 Q
-(<esri32208> : WGS 72 / UTM zone 8N)110.5 396 Q
-(<esri32209> : WGS 72 / UTM zone 9N)110.5 408 Q
-(<esri32210> : WGS 72 / UTM zone 10N)110.5 420 Q
-(<esri32211> : WGS 72 / UTM zone 11N)110.5 432 Q
-(<esri32212> : WGS 72 / UTM zone 12N)110.5 444 Q
-(<esri32213> : WGS 72 / UTM zone 13N)110.5 456 Q
-(<esri32214> : WGS 72 / UTM zone 14N)110.5 468 Q
-(<esri32215> : WGS 72 / UTM zone 15N)110.5 480 Q
-(<esri32216> : WGS 72 / UTM zone 16N)110.5 492 Q
-(<esri32217> : WGS 72 / UTM zone 17N)110.5 504 Q
-(<esri32218> : WGS 72 / UTM zone 18N)110.5 516 Q
-(<esri32219> : WGS 72 / UTM zone 19N)110.5 528 Q
-(<esri32220> : WGS 72 / UTM zone 20N)110.5 540 Q
-(<esri32221> : WGS 72 / UTM zone 21N)110.5 552 Q
-(<esri32222> : WGS 72 / UTM zone 22N)110.5 564 Q
-(<esri32223> : WGS 72 / UTM zone 23N)110.5 576 Q
-(<esri32224> : WGS 72 / UTM zone 24N)110.5 588 Q
-(<esri32225> : WGS 72 / UTM zone 25N)110.5 600 Q
-(<esri32226> : WGS 72 / UTM zone 26N)110.5 612 Q
-(<esri32227> : WGS 72 / UTM zone 27N)110.5 624 Q
-(<esri32228> : WGS 72 / UTM zone 28N)110.5 636 Q
-(<esri32229> : WGS 72 / UTM zone 29N)110.5 648 Q
-(<esri32230> : WGS 72 / UTM zone 30N)110.5 660 Q
-(<esri32231> : WGS 72 / UTM zone 31N)110.5 672 Q
-(<esri32232> : WGS 72 / UTM zone 32N)110.5 684 Q
-(<esri32233> : WGS 72 / UTM zone 33N)110.5 696 Q
-(<esri32234> : WGS 72 / UTM zone 34N)110.5 708 Q
-(<esri32235> : WGS 72 / UTM zone 35N)110.5 720 Q(MB-System 5.0)72 768 Q
-(13 March 2014)140.11 E(129)188.45 E 0 Cg EP
-%%Page: 130 130
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<esri32236> : WGS 72 / UTM zone 36N)110.5 84 Q
-(<esri32237> : WGS 72 / UTM zone 37N)110.5 96 Q
-(<esri32238> : WGS 72 / UTM zone 38N)110.5 108 Q
-(<esri32239> : WGS 72 / UTM zone 39N)110.5 120 Q
-(<esri32240> : WGS 72 / UTM zone 40N)110.5 132 Q
-(<esri32241> : WGS 72 / UTM zone 41N)110.5 144 Q
-(<esri32242> : WGS 72 / UTM zone 42N)110.5 156 Q
-(<esri32243> : WGS 72 / UTM zone 43N)110.5 168 Q
-(<esri32244> : WGS 72 / UTM zone 44N)110.5 180 Q
-(<esri32245> : WGS 72 / UTM zone 45N)110.5 192 Q
-(<esri32246> : WGS 72 / UTM zone 46N)110.5 204 Q
-(<esri32247> : WGS 72 / UTM zone 47N)110.5 216 Q
-(<esri32248> : WGS 72 / UTM zone 48N)110.5 228 Q
-(<esri32249> : WGS 72 / UTM zone 49N)110.5 240 Q
-(<esri32250> : WGS 72 / UTM zone 50N)110.5 252 Q
-(<esri32251> : WGS 72 / UTM zone 51N)110.5 264 Q
-(<esri32252> : WGS 72 / UTM zone 52N)110.5 276 Q
-(<esri32253> : WGS 72 / UTM zone 53N)110.5 288 Q
-(<esri32254> : WGS 72 / UTM zone 54N)110.5 300 Q
-(<esri32255> : WGS 72 / UTM zone 55N)110.5 312 Q
-(<esri32256> : WGS 72 / UTM zone 56N)110.5 324 Q
-(<esri32257> : WGS 72 / UTM zone 57N)110.5 336 Q
-(<esri32258> : WGS 72 / UTM zone 58N)110.5 348 Q
-(<esri32259> : WGS 72 / UTM zone 59N)110.5 360 Q
-(<esri32260> : WGS 72 / UTM zone 60N)110.5 372 Q
-(<esri32301> : WGS 72 / UTM zone 1S)110.5 384 Q
-(<esri32302> : WGS 72 / UTM zone 2S)110.5 396 Q
-(<esri32303> : WGS 72 / UTM zone 3S)110.5 408 Q
-(<esri32304> : WGS 72 / UTM zone 4S)110.5 420 Q
-(<esri32305> : WGS 72 / UTM zone 5S)110.5 432 Q
-(<esri32306> : WGS 72 / UTM zone 6S)110.5 444 Q
-(<esri32307> : WGS 72 / UTM zone 7S)110.5 456 Q
-(<esri32308> : WGS 72 / UTM zone 8S)110.5 468 Q
-(<esri32309> : WGS 72 / UTM zone 9S)110.5 480 Q
-(<esri32310> : WGS 72 / UTM zone 10S)110.5 492 Q
-(<esri32311> : WGS 72 / UTM zone 11S)110.5 504 Q
-(<esri32312> : WGS 72 / UTM zone 12S)110.5 516 Q
-(<esri32313> : WGS 72 / UTM zone 13S)110.5 528 Q
-(<esri32314> : WGS 72 / UTM zone 14S)110.5 540 Q
-(<esri32315> : WGS 72 / UTM zone 15S)110.5 552 Q
-(<esri32316> : WGS 72 / UTM zone 16S)110.5 564 Q
-(<esri32317> : WGS 72 / UTM zone 17S)110.5 576 Q
-(<esri32318> : WGS 72 / UTM zone 18S)110.5 588 Q
-(<esri32319> : WGS 72 / UTM zone 19S)110.5 600 Q
-(<esri32320> : WGS 72 / UTM zone 20S)110.5 612 Q
-(<esri32321> : WGS 72 / UTM zone 21S)110.5 624 Q
-(<esri32322> : WGS 72 / UTM zone 22S)110.5 636 Q
-(<esri32323> : WGS 72 / UTM zone 23S)110.5 648 Q
-(<esri32324> : WGS 72 / UTM zone 24S)110.5 660 Q
-(<esri32325> : WGS 72 / UTM zone 25S)110.5 672 Q
-(<esri32326> : WGS 72 / UTM zone 26S)110.5 684 Q
-(<esri32327> : WGS 72 / UTM zone 27S)110.5 696 Q
-(<esri32328> : WGS 72 / UTM zone 28S)110.5 708 Q
-(<esri32329> : WGS 72 / UTM zone 29S)110.5 720 Q(MB-System 5.0)72 768 Q
-(13 March 2014)140.11 E(130)188.45 E 0 Cg EP
-%%Page: 131 131
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<esri32330> : WGS 72 / UTM zone 30S)110.5 84 Q
-(<esri32331> : WGS 72 / UTM zone 31S)110.5 96 Q
-(<esri32332> : WGS 72 / UTM zone 32S)110.5 108 Q
-(<esri32333> : WGS 72 / UTM zone 33S)110.5 120 Q
-(<esri32334> : WGS 72 / UTM zone 34S)110.5 132 Q
-(<esri32335> : WGS 72 / UTM zone 35S)110.5 144 Q
-(<esri32336> : WGS 72 / UTM zone 36S)110.5 156 Q
-(<esri32337> : WGS 72 / UTM zone 37S)110.5 168 Q
-(<esri32338> : WGS 72 / UTM zone 38S)110.5 180 Q
-(<esri32339> : WGS 72 / UTM zone 39S)110.5 192 Q
-(<esri32340> : WGS 72 / UTM zone 40S)110.5 204 Q
-(<esri32341> : WGS 72 / UTM zone 41S)110.5 216 Q
-(<esri32342> : WGS 72 / UTM zone 42S)110.5 228 Q
-(<esri32343> : WGS 72 / UTM zone 43S)110.5 240 Q
-(<esri32344> : WGS 72 / UTM zone 44S)110.5 252 Q
-(<esri32345> : WGS 72 / UTM zone 45S)110.5 264 Q
-(<esri32346> : WGS 72 / UTM zone 46S)110.5 276 Q
-(<esri32347> : WGS 72 / UTM zone 47S)110.5 288 Q
-(<esri32348> : WGS 72 / UTM zone 48S)110.5 300 Q
-(<esri32349> : WGS 72 / UTM zone 49S)110.5 312 Q
-(<esri32350> : WGS 72 / UTM zone 50S)110.5 324 Q
-(<esri32351> : WGS 72 / UTM zone 51S)110.5 336 Q
-(<esri32352> : WGS 72 / UTM zone 52S)110.5 348 Q
-(<esri32353> : WGS 72 / UTM zone 53S)110.5 360 Q
-(<esri32354> : WGS 72 / UTM zone 54S)110.5 372 Q
-(<esri32355> : WGS 72 / UTM zone 55S)110.5 384 Q
-(<esri32356> : WGS 72 / UTM zone 56S)110.5 396 Q
-(<esri32357> : WGS 72 / UTM zone 57S)110.5 408 Q
-(<esri32358> : WGS 72 / UTM zone 58S)110.5 420 Q
-(<esri32359> : WGS 72 / UTM zone 59S)110.5 432 Q
-(<esri32360> : WGS 72 / UTM zone 60S)110.5 444 Q
-(<esri32401> : WGS 72BE / UTM zone 1N)110.5 456 Q
-(<esri32402> : WGS 72BE / UTM zone 2N)110.5 468 Q
-(<esri32403> : WGS 72BE / UTM zone 3N)110.5 480 Q
-(<esri32404> : WGS 72BE / UTM zone 4N)110.5 492 Q
-(<esri32405> : WGS 72BE / UTM zone 5N)110.5 504 Q
-(<esri32406> : WGS 72BE / UTM zone 6N)110.5 516 Q
-(<esri32407> : WGS 72BE / UTM zone 7N)110.5 528 Q
-(<esri32408> : WGS 72BE / UTM zone 8N)110.5 540 Q
-(<esri32409> : WGS 72BE / UTM zone 9N)110.5 552 Q
-(<esri32410> : WGS 72BE / UTM zone 10N)110.5 564 Q
-(<esri32411> : WGS 72BE / UTM zone 11N)110.5 576 Q
-(<esri32412> : WGS 72BE / UTM zone 12N)110.5 588 Q
-(<esri32413> : WGS 72BE / UTM zone 13N)110.5 600 Q
-(<esri32414> : WGS 72BE / UTM zone 14N)110.5 612 Q
-(<esri32415> : WGS 72BE / UTM zone 15N)110.5 624 Q
-(<esri32416> : WGS 72BE / UTM zone 16N)110.5 636 Q
-(<esri32417> : WGS 72BE / UTM zone 17N)110.5 648 Q
-(<esri32418> : WGS 72BE / UTM zone 18N)110.5 660 Q
-(<esri32419> : WGS 72BE / UTM zone 19N)110.5 672 Q
-(<esri32420> : WGS 72BE / UTM zone 20N)110.5 684 Q
-(<esri32421> : WGS 72BE / UTM zone 21N)110.5 696 Q
-(<esri32422> : WGS 72BE / UTM zone 22N)110.5 708 Q
-(<esri32423> : WGS 72BE / UTM zone 23N)110.5 720 Q(MB-System 5.0)72 768
-Q(13 March 2014)140.11 E(131)188.45 E 0 Cg EP
-%%Page: 132 132
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<esri32424> : WGS 72BE / UTM zone 24N)110.5 84
-Q(<esri32425> : WGS 72BE / UTM zone 25N)110.5 96 Q
-(<esri32426> : WGS 72BE / UTM zone 26N)110.5 108 Q
-(<esri32427> : WGS 72BE / UTM zone 27N)110.5 120 Q
-(<esri32428> : WGS 72BE / UTM zone 28N)110.5 132 Q
-(<esri32429> : WGS 72BE / UTM zone 29N)110.5 144 Q
-(<esri32430> : WGS 72BE / UTM zone 30N)110.5 156 Q
-(<esri32431> : WGS 72BE / UTM zone 31N)110.5 168 Q
-(<esri32432> : WGS 72BE / UTM zone 32N)110.5 180 Q
-(<esri32433> : WGS 72BE / UTM zone 33N)110.5 192 Q
-(<esri32434> : WGS 72BE / UTM zone 34N)110.5 204 Q
-(<esri32435> : WGS 72BE / UTM zone 35N)110.5 216 Q
-(<esri32436> : WGS 72BE / UTM zone 36N)110.5 228 Q
-(<esri32437> : WGS 72BE / UTM zone 37N)110.5 240 Q
-(<esri32438> : WGS 72BE / UTM zone 38N)110.5 252 Q
-(<esri32439> : WGS 72BE / UTM zone 39N)110.5 264 Q
-(<esri32440> : WGS 72BE / UTM zone 40N)110.5 276 Q
-(<esri32441> : WGS 72BE / UTM zone 41N)110.5 288 Q
-(<esri32442> : WGS 72BE / UTM zone 42N)110.5 300 Q
-(<esri32443> : WGS 72BE / UTM zone 43N)110.5 312 Q
-(<esri32444> : WGS 72BE / UTM zone 44N)110.5 324 Q
-(<esri32445> : WGS 72BE / UTM zone 45N)110.5 336 Q
-(<esri32446> : WGS 72BE / UTM zone 46N)110.5 348 Q
-(<esri32447> : WGS 72BE / UTM zone 47N)110.5 360 Q
-(<esri32448> : WGS 72BE / UTM zone 48N)110.5 372 Q
-(<esri32449> : WGS 72BE / UTM zone 49N)110.5 384 Q
-(<esri32450> : WGS 72BE / UTM zone 50N)110.5 396 Q
-(<esri32451> : WGS 72BE / UTM zone 51N)110.5 408 Q
-(<esri32452> : WGS 72BE / UTM zone 52N)110.5 420 Q
-(<esri32453> : WGS 72BE / UTM zone 53N)110.5 432 Q
-(<esri32454> : WGS 72BE / UTM zone 54N)110.5 444 Q
-(<esri32455> : WGS 72BE / UTM zone 55N)110.5 456 Q
-(<esri32456> : WGS 72BE / UTM zone 56N)110.5 468 Q
-(<esri32457> : WGS 72BE / UTM zone 57N)110.5 480 Q
-(<esri32458> : WGS 72BE / UTM zone 58N)110.5 492 Q
-(<esri32459> : WGS 72BE / UTM zone 59N)110.5 504 Q
-(<esri32460> : WGS 72BE / UTM zone 60N)110.5 516 Q
-(<esri32501> : WGS 72BE / UTM zone 1S)110.5 528 Q
-(<esri32502> : WGS 72BE / UTM zone 2S)110.5 540 Q
-(<esri32503> : WGS 72BE / UTM zone 3S)110.5 552 Q
-(<esri32504> : WGS 72BE / UTM zone 4S)110.5 564 Q
-(<esri32505> : WGS 72BE / UTM zone 5S)110.5 576 Q
-(<esri32506> : WGS 72BE / UTM zone 6S)110.5 588 Q
-(<esri32507> : WGS 72BE / UTM zone 7S)110.5 600 Q
-(<esri32508> : WGS 72BE / UTM zone 8S)110.5 612 Q
-(<esri32509> : WGS 72BE / UTM zone 9S)110.5 624 Q
-(<esri32510> : WGS 72BE / UTM zone 10S)110.5 636 Q
-(<esri32511> : WGS 72BE / UTM zone 11S)110.5 648 Q
-(<esri32512> : WGS 72BE / UTM zone 12S)110.5 660 Q
-(<esri32513> : WGS 72BE / UTM zone 13S)110.5 672 Q
-(<esri32514> : WGS 72BE / UTM zone 14S)110.5 684 Q
-(<esri32515> : WGS 72BE / UTM zone 15S)110.5 696 Q
-(<esri32516> : WGS 72BE / UTM zone 16S)110.5 708 Q
-(<esri32517> : WGS 72BE / UTM zone 17S)110.5 720 Q(MB-System 5.0)72 768
-Q(13 March 2014)140.11 E(132)188.45 E 0 Cg EP
-%%Page: 133 133
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<esri32518> : WGS 72BE / UTM zone 18S)110.5 84
-Q(<esri32519> : WGS 72BE / UTM zone 19S)110.5 96 Q
-(<esri32520> : WGS 72BE / UTM zone 20S)110.5 108 Q
-(<esri32521> : WGS 72BE / UTM zone 21S)110.5 120 Q
-(<esri32522> : WGS 72BE / UTM zone 22S)110.5 132 Q
-(<esri32523> : WGS 72BE / UTM zone 23S)110.5 144 Q
-(<esri32524> : WGS 72BE / UTM zone 24S)110.5 156 Q
-(<esri32525> : WGS 72BE / UTM zone 25S)110.5 168 Q
-(<esri32526> : WGS 72BE / UTM zone 26S)110.5 180 Q
-(<esri32527> : WGS 72BE / UTM zone 27S)110.5 192 Q
-(<esri32528> : WGS 72BE / UTM zone 28S)110.5 204 Q
-(<esri32529> : WGS 72BE / UTM zone 29S)110.5 216 Q
-(<esri32530> : WGS 72BE / UTM zone 30S)110.5 228 Q
-(<esri32531> : WGS 72BE / UTM zone 31S)110.5 240 Q
-(<esri32532> : WGS 72BE / UTM zone 32S)110.5 252 Q
-(<esri32533> : WGS 72BE / UTM zone 33S)110.5 264 Q
-(<esri32534> : WGS 72BE / UTM zone 34S)110.5 276 Q
-(<esri32535> : WGS 72BE / UTM zone 35S)110.5 288 Q
-(<esri32536> : WGS 72BE / UTM zone 36S)110.5 300 Q
-(<esri32537> : WGS 72BE / UTM zone 37S)110.5 312 Q
-(<esri32538> : WGS 72BE / UTM zone 38S)110.5 324 Q
-(<esri32539> : WGS 72BE / UTM zone 39S)110.5 336 Q
-(<esri32540> : WGS 72BE / UTM zone 40S)110.5 348 Q
-(<esri32541> : WGS 72BE / UTM zone 41S)110.5 360 Q
-(<esri32542> : WGS 72BE / UTM zone 42S)110.5 372 Q
-(<esri32543> : WGS 72BE / UTM zone 43S)110.5 384 Q
-(<esri32544> : WGS 72BE / UTM zone 44S)110.5 396 Q
-(<esri32545> : WGS 72BE / UTM zone 45S)110.5 408 Q
-(<esri32546> : WGS 72BE / UTM zone 46S)110.5 420 Q
-(<esri32547> : WGS 72BE / UTM zone 47S)110.5 432 Q
-(<esri32548> : WGS 72BE / UTM zone 48S)110.5 444 Q
-(<esri32549> : WGS 72BE / UTM zone 49S)110.5 456 Q
-(<esri32550> : WGS 72BE / UTM zone 50S)110.5 468 Q
-(<esri32551> : WGS 72BE / UTM zone 51S)110.5 480 Q
-(<esri32552> : WGS 72BE / UTM zone 52S)110.5 492 Q
-(<esri32553> : WGS 72BE / UTM zone 53S)110.5 504 Q
-(<esri32554> : WGS 72BE / UTM zone 54S)110.5 516 Q
-(<esri32555> : WGS 72BE / UTM zone 55S)110.5 528 Q
-(<esri32556> : WGS 72BE / UTM zone 56S)110.5 540 Q
-(<esri32557> : WGS 72BE / UTM zone 57S)110.5 552 Q
-(<esri32558> : WGS 72BE / UTM zone 58S)110.5 564 Q
-(<esri32559> : WGS 72BE / UTM zone 59S)110.5 576 Q
-(<esri32560> : WGS 72BE / UTM zone 60S)110.5 588 Q
-(<esri32601> : WGS 84 / UTM zone 1N)110.5 600 Q
-(<esri32602> : WGS 84 / UTM zone 2N)110.5 612 Q
-(<esri32603> : WGS 84 / UTM zone 3N)110.5 624 Q
-(<esri32604> : WGS 84 / UTM zone 4N)110.5 636 Q
-(<esri32605> : WGS 84 / UTM zone 5N)110.5 648 Q
-(<esri32606> : WGS 84 / UTM zone 6N)110.5 660 Q
-(<esri32607> : WGS 84 / UTM zone 7N)110.5 672 Q
-(<esri32608> : WGS 84 / UTM zone 8N)110.5 684 Q
-(<esri32609> : WGS 84 / UTM zone 9N)110.5 696 Q
-(<esri32610> : WGS 84 / UTM zone 10N)110.5 708 Q
-(<esri32611> : WGS 84 / UTM zone 11N)110.5 720 Q(MB-System 5.0)72 768 Q
-(13 March 2014)140.11 E(133)188.45 E 0 Cg EP
-%%Page: 134 134
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<esri32612> : WGS 84 / UTM zone 12N)110.5 84 Q
-(<esri32613> : WGS 84 / UTM zone 13N)110.5 96 Q
-(<esri32614> : WGS 84 / UTM zone 14N)110.5 108 Q
-(<esri32615> : WGS 84 / UTM zone 15N)110.5 120 Q
-(<esri32616> : WGS 84 / UTM zone 16N)110.5 132 Q
-(<esri32617> : WGS 84 / UTM zone 17N)110.5 144 Q
-(<esri32618> : WGS 84 / UTM zone 18N)110.5 156 Q
-(<esri32619> : WGS 84 / UTM zone 19N)110.5 168 Q
-(<esri32620> : WGS 84 / UTM zone 20N)110.5 180 Q
-(<esri32621> : WGS 84 / UTM zone 21N)110.5 192 Q
-(<esri32622> : WGS 84 / UTM zone 22N)110.5 204 Q
-(<esri32623> : WGS 84 / UTM zone 23N)110.5 216 Q
-(<esri32624> : WGS 84 / UTM zone 24N)110.5 228 Q
-(<esri32625> : WGS 84 / UTM zone 25N)110.5 240 Q
-(<esri32626> : WGS 84 / UTM zone 26N)110.5 252 Q
-(<esri32627> : WGS 84 / UTM zone 27N)110.5 264 Q
-(<esri32628> : WGS 84 / UTM zone 28N)110.5 276 Q
-(<esri32629> : WGS 84 / UTM zone 29N)110.5 288 Q
-(<esri32630> : WGS 84 / UTM zone 30N)110.5 300 Q
-(<esri32631> : WGS 84 / UTM zone 31N)110.5 312 Q
-(<esri32632> : WGS 84 / UTM zone 32N)110.5 324 Q
-(<esri32633> : WGS 84 / UTM zone 33N)110.5 336 Q
-(<esri32634> : WGS 84 / UTM zone 34N)110.5 348 Q
-(<esri32635> : WGS 84 / UTM zone 35N)110.5 360 Q
-(<esri32636> : WGS 84 / UTM zone 36N)110.5 372 Q
-(<esri32637> : WGS 84 / UTM zone 37N)110.5 384 Q
-(<esri32638> : WGS 84 / UTM zone 38N)110.5 396 Q
-(<esri32639> : WGS 84 / UTM zone 39N)110.5 408 Q
-(<esri32640> : WGS 84 / UTM zone 40N)110.5 420 Q
-(<esri32641> : WGS 84 / UTM zone 41N)110.5 432 Q
-(<esri32642> : WGS 84 / UTM zone 42N)110.5 444 Q
-(<esri32643> : WGS 84 / UTM zone 43N)110.5 456 Q
-(<esri32644> : WGS 84 / UTM zone 44N)110.5 468 Q
-(<esri32645> : WGS 84 / UTM zone 45N)110.5 480 Q
-(<esri32646> : WGS 84 / UTM zone 46N)110.5 492 Q
-(<esri32647> : WGS 84 / UTM zone 47N)110.5 504 Q
-(<esri32648> : WGS 84 / UTM zone 48N)110.5 516 Q
-(<esri32649> : WGS 84 / UTM zone 49N)110.5 528 Q
-(<esri32650> : WGS 84 / UTM zone 50N)110.5 540 Q
-(<esri32651> : WGS 84 / UTM zone 51N)110.5 552 Q
-(<esri32652> : WGS 84 / UTM zone 52N)110.5 564 Q
-(<esri32653> : WGS 84 / UTM zone 53N)110.5 576 Q
-(<esri32654> : WGS 84 / UTM zone 54N)110.5 588 Q
-(<esri32655> : WGS 84 / UTM zone 55N)110.5 600 Q
-(<esri32656> : WGS 84 / UTM zone 56N)110.5 612 Q
-(<esri32657> : WGS 84 / UTM zone 57N)110.5 624 Q
-(<esri32658> : WGS 84 / UTM zone 58N)110.5 636 Q
-(<esri32659> : WGS 84 / UTM zone 59N)110.5 648 Q
-(<esri32660> : WGS 84 / UTM zone 60N)110.5 660 Q
-(<esri32661> : WGS 84 / UPS North)110.5 672 Q
-(<esri32701> : WGS 84 / UTM zone 1S)110.5 684 Q
-(<esri32702> : WGS 84 / UTM zone 2S)110.5 696 Q
-(<esri32703> : WGS 84 / UTM zone 3S)110.5 708 Q
-(<esri32704> : WGS 84 / UTM zone 4S)110.5 720 Q(MB-System 5.0)72 768 Q
-(13 March 2014)140.11 E(134)188.45 E 0 Cg EP
-%%Page: 135 135
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<esri32705> : WGS 84 / UTM zone 5S)110.5 84 Q
-(<esri32706> : WGS 84 / UTM zone 6S)110.5 96 Q
-(<esri32707> : WGS 84 / UTM zone 7S)110.5 108 Q
-(<esri32708> : WGS 84 / UTM zone 8S)110.5 120 Q
-(<esri32709> : WGS 84 / UTM zone 9S)110.5 132 Q
-(<esri32710> : WGS 84 / UTM zone 10S)110.5 144 Q
-(<esri32711> : WGS 84 / UTM zone 11S)110.5 156 Q
-(<esri32712> : WGS 84 / UTM zone 12S)110.5 168 Q
-(<esri32713> : WGS 84 / UTM zone 13S)110.5 180 Q
-(<esri32714> : WGS 84 / UTM zone 14S)110.5 192 Q
-(<esri32715> : WGS 84 / UTM zone 15S)110.5 204 Q
-(<esri32716> : WGS 84 / UTM zone 16S)110.5 216 Q
-(<esri32717> : WGS 84 / UTM zone 17S)110.5 228 Q
-(<esri32718> : WGS 84 / UTM zone 18S)110.5 240 Q
-(<esri32719> : WGS 84 / UTM zone 19S)110.5 252 Q
-(<esri32720> : WGS 84 / UTM zone 20S)110.5 264 Q
-(<esri32721> : WGS 84 / UTM zone 21S)110.5 276 Q
-(<esri32722> : WGS 84 / UTM zone 22S)110.5 288 Q
-(<esri32723> : WGS 84 / UTM zone 23S)110.5 300 Q
-(<esri32724> : WGS 84 / UTM zone 24S)110.5 312 Q
-(<esri32725> : WGS 84 / UTM zone 25S)110.5 324 Q
-(<esri32726> : WGS 84 / UTM zone 26S)110.5 336 Q
-(<esri32727> : WGS 84 / UTM zone 27S)110.5 348 Q
-(<esri32728> : WGS 84 / UTM zone 28S)110.5 360 Q
-(<esri32729> : WGS 84 / UTM zone 29S)110.5 372 Q
-(<esri32730> : WGS 84 / UTM zone 30S)110.5 384 Q
-(<esri32731> : WGS 84 / UTM zone 31S)110.5 396 Q
-(<esri32732> : WGS 84 / UTM zone 32S)110.5 408 Q
-(<esri32733> : WGS 84 / UTM zone 33S)110.5 420 Q
-(<esri32734> : WGS 84 / UTM zone 34S)110.5 432 Q
-(<esri32735> : WGS 84 / UTM zone 35S)110.5 444 Q
-(<esri32736> : WGS 84 / UTM zone 36S)110.5 456 Q
-(<esri32737> : WGS 84 / UTM zone 37S)110.5 468 Q
-(<esri32738> : WGS 84 / UTM zone 38S)110.5 480 Q
-(<esri32739> : WGS 84 / UTM zone 39S)110.5 492 Q
-(<esri32740> : WGS 84 / UTM zone 40S)110.5 504 Q
-(<esri32741> : WGS 84 / UTM zone 41S)110.5 516 Q
-(<esri32742> : WGS 84 / UTM zone 42S)110.5 528 Q
-(<esri32743> : WGS 84 / UTM zone 43S)110.5 540 Q
-(<esri32744> : WGS 84 / UTM zone 44S)110.5 552 Q
-(<esri32745> : WGS 84 / UTM zone 45S)110.5 564 Q
-(<esri32746> : WGS 84 / UTM zone 46S)110.5 576 Q
-(<esri32747> : WGS 84 / UTM zone 47S)110.5 588 Q
-(<esri32748> : WGS 84 / UTM zone 48S)110.5 600 Q
-(<esri32749> : WGS 84 / UTM zone 49S)110.5 612 Q
-(<esri32750> : WGS 84 / UTM zone 50S)110.5 624 Q
-(<esri32751> : WGS 84 / UTM zone 51S)110.5 636 Q
-(<esri32752> : WGS 84 / UTM zone 52S)110.5 648 Q
-(<esri32753> : WGS 84 / UTM zone 53S)110.5 660 Q
-(<esri32754> : WGS 84 / UTM zone 54S)110.5 672 Q
-(<esri32755> : WGS 84 / UTM zone 55S)110.5 684 Q
-(<esri32756> : WGS 84 / UTM zone 56S)110.5 696 Q
-(<esri32757> : WGS 84 / UTM zone 57S)110.5 708 Q
-(<esri32758> : WGS 84 / UTM zone 58S)110.5 720 Q(MB-System 5.0)72 768 Q
-(13 March 2014)140.11 E(135)188.45 E 0 Cg EP
-%%Page: 136 136
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<esri32759> : WGS 84 / UTM zone 59S)110.5 84 Q
-(<esri32760> : WGS 84 / UTM zone 60S)110.5 96 Q
-(<esri32761> : WGS 84 / UPS South)110.5 108 Q
-(<esri32766> : WGS 84 / TM 36 SE)110.5 120 Q(<esri20002> : Pulk)110.5
-132 Q -.15(ov)-.1 G 2.5(o1)-.05 G(995 GK Zone 2)-2.5 E
-(<esri20003> : Pulk)110.5 144 Q -.15(ov)-.1 G 2.5(o1)-.05 G
-(995 GK Zone 3)-2.5 E(<esri20062> : Pulk)110.5 156 Q -.15(ov)-.1 G 2.5
-(o1)-.05 G(995 GK Zone 2N)-2.5 E(<esri20063> : Pulk)110.5 168 Q -.15(ov)
--.1 G 2.5(o1)-.05 G(995 GK Zone 3N)-2.5 E
-(<esri24721> : La Canoa UTM Zone 21N)110.5 180 Q(<esri26761> : N)110.5
-192 Q(AD 1927 StatePlane Ha)-.35 E -.1(wa)-.15 G(ii 1 FIPS 5101).1 E
-(<esri26762> : N)110.5 204 Q(AD 1927 StatePlane Ha)-.35 E -.1(wa)-.15 G
-(ii 2 FIPS 5102).1 E(<esri26763> : N)110.5 216 Q(AD 1927 StatePlane Ha)
--.35 E -.1(wa)-.15 G(ii 3 FIPS 5103).1 E(<esri26764> : N)110.5 228 Q
-(AD 1927 StatePlane Ha)-.35 E -.1(wa)-.15 G(ii 4 FIPS 5104).1 E
-(<esri26765> : N)110.5 240 Q(AD 1927 StatePlane Ha)-.35 E -.1(wa)-.15 G
-(ii 5 FIPS 5105).1 E(<esri26788> : N)110.5 252 Q
-(AD 1927 StatePlane Michig)-.35 E(an North FIPS 2111)-.05 E
-(<esri26789> : N)110.5 264 Q(AD 1927 StatePlane Michig)-.35 E
-(an Central FIPS 2112)-.05 E(<esri26790> : N)110.5 276 Q
-(AD 1927 StatePlane Michig)-.35 E(an South FIPS 2113)-.05 E
-(<esri30591> : Nord Algerie)110.5 288 Q(<esri30592> : Sud Algerie)110.5
-300 Q(<esri31491> : German)110.5 312 Q 2.5(yZ)-.15 G(one 1)-2.5 E
-(<esri31492> : German)110.5 324 Q 2.5(yZ)-.15 G(one 2)-2.5 E
-(<esri31493> : German)110.5 336 Q 2.5(yZ)-.15 G(one 3)-2.5 E
-(<esri31494> : German)110.5 348 Q 2.5(yZ)-.15 G(one 4)-2.5 E
-(<esri31495> : German)110.5 360 Q 2.5(yZ)-.15 G(one 5)-2.5 E
-(<esri32059> : N)110.5 372 Q(AD 1927 StatePlane Puerto Rico FIPS 5201)
--.35 E(<esri32060> : N)110.5 384 Q(AD 1927 StatePlane V)-.35 E(ir)-.6 E
-(gin Islands St Croix FIPS 5202)-.18 E
-(<esri53001> : Sphere Plate Carree)110.5 396 Q
-(<esri53002> : Sphere Equidistant Cylindrical)110.5 408 Q
-(<esri53003> : Sphere Miller Cylindrical)110.5 420 Q
-(<esri53004> : Sphere Mercator)110.5 432 Q
-(<esri53008> : Sphere Sinusoidal)110.5 444 Q(<esri53009> : Sphere Moll)
-110.5 456 Q(weide)-.1 E(<esri53010> : Sphere Eck)110.5 468 Q(ert VI)-.1
-E(<esri53011> : Sphere Eck)110.5 480 Q(ert V)-.1 E
-(<esri53012> : Sphere Eck)110.5 492 Q(ert IV)-.1 E
-(<esri53013> : Sphere Eck)110.5 504 Q(ert III)-.1 E
-(<esri53014> : Sphere Eck)110.5 516 Q(ert II)-.1 E
-(<esri53015> : Sphere Eck)110.5 528 Q(ert I)-.1 E
-(<esri53016> : Sphere Gall Stereographic)110.5 540 Q
-(<esri53017> : Sphere Behrmann)110.5 552 Q(<esri53018> : Sphere W)110.5
-564 Q(ink)-.4 E(el I)-.1 E(<esri53019> : Sphere W)110.5 576 Q(ink)-.4 E
-(el II)-.1 E(<esri53021> : Sphere Polyconic)110.5 588 Q
-(<esri53022> : Sphere Quartic Authalic)110.5 600 Q
-(<esri53023> : Sphere Loximuthal)110.5 612 Q(<esri53024> : Sphere Bonne)
-110.5 624 Q(<esri53025> : Sphere Hotine)110.5 636 Q
-(<esri53026> : Sphere Stereographic)110.5 648 Q
-(<esri53027> : Sphere Equidistant Conic)110.5 660 Q
-(<esri53028> : Sphere Cassini)110.5 672 Q(<esri53029> : Sphere V)110.5
-684 Q(an der Grinten I)-1.11 E(<esri53030> : Sphere Robinson)110.5 696 Q
-(<esri53031> : Sphere T)110.5 708 Q .2 -.1(wo P)-.8 H(oint Equidistant)
-.1 E(<esri53032> : Sphere Azimuthal Equidistant)110.5 720 Q
-(MB-System 5.0)72 768 Q(13 March 2014)140.11 E(136)188.45 E 0 Cg EP
-%%Page: 137 137
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<esri54001> : W)110.5 84 Q(orld Plate Carree)
--.8 E(<esri54002> : W)110.5 96 Q(orld Equidistant Cylindrical)-.8 E
-(<esri54003> : W)110.5 108 Q(orld Miller Cylindrical)-.8 E
-(<esri54004> : W)110.5 120 Q(orld Mercator)-.8 E(<esri54008> : W)110.5
-132 Q(orld Sinusoidal)-.8 E(<esri54009> : W)110.5 144 Q(orld Moll)-.8 E
-(weide)-.1 E(<esri54010> : W)110.5 156 Q(orld Eck)-.8 E(ert VI)-.1 E
-(<esri54011> : W)110.5 168 Q(orld Eck)-.8 E(ert V)-.1 E(<esri54012> : W)
-110.5 180 Q(orld Eck)-.8 E(ert IV)-.1 E(<esri54013> : W)110.5 192 Q
-(orld Eck)-.8 E(ert III)-.1 E(<esri54014> : W)110.5 204 Q(orld Eck)-.8 E
-(ert II)-.1 E(<esri54015> : W)110.5 216 Q(orld Eck)-.8 E(ert I)-.1 E
-(<esri54016> : W)110.5 228 Q(orld Gall Stereographic)-.8 E
-(<esri54017> : W)110.5 240 Q(orld Behrmann)-.8 E(<esri54018> : W)110.5
-252 Q(orld W)-.8 E(ink)-.4 E(el I)-.1 E(<esri54019> : W)110.5 264 Q
-(orld W)-.8 E(ink)-.4 E(el II)-.1 E(<esri54021> : W)110.5 276 Q
-(orld Polyconic)-.8 E(<esri54022> : W)110.5 288 Q(orld Quartic Authalic)
--.8 E(<esri54023> : W)110.5 300 Q(orld Loximuthal)-.8 E(<esri54024> : W)
-110.5 312 Q(orld Bonne)-.8 E(<esri54025> : W)110.5 324 Q(orld Hotine)-.8
-E(<esri54026> : W)110.5 336 Q(orld Stereographic)-.8 E(<esri54027> : W)
-110.5 348 Q(orld Equidistant Conic)-.8 E(<esri54028> : W)110.5 360 Q
-(orld Cassini)-.8 E(<esri54029> : W)110.5 372 Q(orld V)-.8 E
-(an der Grinten I)-1.11 E(<esri54030> : W)110.5 384 Q(orld Robinson)-.8
-E(<esri54031> : W)110.5 396 Q(orld T)-.8 E .2 -.1(wo P)-.8 H
-(oint Equidistant).1 E(<esri54032> : W)110.5 408 Q
-(orld Azimuthal Equidistant)-.8 E(<esri65061> : N)110.5 420 Q
-(AD 1927 StatePlane Guam FIPS 5400)-.35 E(<esri65161> : N)110.5 432 Q
-(AD 1983 StatePlane Guam FIPS 5400)-.35 E
-(<esri102001> : Canada Albers Equal Area Conic)110.5 444 Q
-(<esri102002> : Canada Lambert Conformal Conic)110.5 456 Q
-(<esri102003> : USA Contiguous Albers Equal Area Conic)110.5 468 Q
-(<esri102004> : USA Contiguous Lambert Conformal Conic)110.5 480 Q
-(<esri102005> : USA Contiguous Equidistant Conic)110.5 492 Q
-(<esri102006> : Alaska Albers Equal Area Conic)110.5 504 Q
-(<esri102007> : Ha)110.5 516 Q -.1(wa)-.15 G(ii Albers Equal Area Conic)
-.1 E(<esri102008> : North America Albers Equal Area Conic)110.5 528 Q
-(<esri102009> : North America Lambert Conformal Conic)110.5 540 Q
-(<esri102010> : North America Equidistant Conic)110.5 552 Q
-(<esri102011> : Africa Sinusoidal)110.5 564 Q
-(<esri102012> : Asia Lambert Conformal Conic)110.5 576 Q
-(<esri102013> : Europe Albers Equal Area Conic)110.5 588 Q
-(<esri102014> : Europe Lambert Conformal Conic)110.5 600 Q
-(<esri102015> : South America Lambert Conformal Conic)110.5 612 Q
-(<esri102016> : North Pole Azimuthal Equidistant)110.5 624 Q
-(<esri102017> : North Pole Lambert Azimuthal Equal Area)110.5 636 Q
-(<esri102018> : North Pole Stereographic)110.5 648 Q
-(<esri102019> : South Pole Azimuthal Equidistant)110.5 660 Q
-(<esri102020> : South Pole Lambert Azimuthal Equal Area)110.5 672 Q
-(<esri102021> : South Pole Stereographic)110.5 684 Q
-(<esri102022> : Africa Albers Equal Area Conic)110.5 696 Q
-(<esri102023> : Africa Equidistant Conic)110.5 708 Q
-(<esri102024> : Africa Lambert Conformal Conic)110.5 720 Q
-(MB-System 5.0)72 768 Q(13 March 2014)140.11 E(137)188.45 E 0 Cg EP
-%%Page: 138 138
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F
-(<esri102025> : Asia North Albers Equal Area Conic)110.5 84 Q
-(<esri102026> : Asia North Equidistant Conic)110.5 96 Q
-(<esri102027> : Asia North Lambert Conformal Conic)110.5 108 Q
-(<esri102028> : Asia South Albers Equal Area Conic)110.5 120 Q
-(<esri102029> : Asia South Equidistant Conic)110.5 132 Q
-(<esri102030> : Asia South Lambert Conformal Conic)110.5 144 Q
-(<esri102031> : Europe Equidistant Conic)110.5 156 Q
-(<esri102032> : South America Equidistant Conic)110.5 168 Q
-(<esri102033> : South America Albers Equal Area Conic)110.5 180 Q
-(<esri102065> : S-JTSK Kro)110.5 192 Q -.25(va)-.15 G(k).25 E
-(<esri102066> : S-JTSK Ferro Kro)110.5 204 Q -.25(va)-.15 G 2.5(kE).25 G
-(ast North)-2.5 E(<esri102067> : S-JTSK Kro)110.5 216 Q -.25(va)-.15 G
-2.5(kE).25 G(ast North)-2.5 E(<esri102091> : Monte Mario Italy 1)110.5
-228 Q(<esri102092> : Monte Mario Italy 2)110.5 240 Q
-(<esri102101> : NGO 1948 Norw)110.5 252 Q(ay Zone 1)-.1 E
-(<esri102102> : NGO 1948 Norw)110.5 264 Q(ay Zone 2)-.1 E
-(<esri102103> : NGO 1948 Norw)110.5 276 Q(ay Zone 3)-.1 E
-(<esri102104> : NGO 1948 Norw)110.5 288 Q(ay Zone 4)-.1 E
-(<esri102105> : NGO 1948 Norw)110.5 300 Q(ay Zone 5)-.1 E
-(<esri102106> : NGO 1948 Norw)110.5 312 Q(ay Zone 6)-.1 E
-(<esri102107> : NGO 1948 Norw)110.5 324 Q(ay Zone 7)-.1 E
-(<esri102108> : NGO 1948 Norw)110.5 336 Q(ay Zone 8)-.1 E
-(<esri102110> : RGF 1993 Lambert 93)110.5 348 Q(<esri102114> : Old Ha)
-110.5 360 Q -.1(wa)-.15 G(iian UTM Zone 4N).1 E(<esri102115> : Old Ha)
-110.5 372 Q -.1(wa)-.15 G(iian UTM Zone 5N).1 E(<esri102120> : N)110.5
-384 Q(AD 1927 Michig)-.35 E(an GeoRef Feet US)-.05 E(<esri102121> : N)
-110.5 396 Q(AD 1983 Michig)-.35 E(an GeoRef Feet US)-.05 E
-(<esri102122> : N)110.5 408 Q(AD 1927 Michig)-.35 E(an GeoRef Meters)
--.05 E(<esri102123> : N)110.5 420 Q(AD 1983 Michig)-.35 E
-(an GeoRef Meters)-.05 E(<esri102132> : NGO 1948 UTM Zone 32N)110.5 432
-Q(<esri102133> : NGO 1948 UTM Zone 33N)110.5 444 Q
-(<esri102134> : NGO 1948 UTM Zone 34N)110.5 456 Q
-(<esri102135> : NGO 1948 UTM Zone 35N)110.5 468 Q(<esri102140> : Hong K)
-110.5 480 Q(ong 1980 Grid)-.35 E(<esri102141> : Hong K)110.5 492 Q
-(ong 1980 UTM Zone 49N)-.35 E(<esri102142> : Hong K)110.5 504 Q
-(ong 1980 UTM Zone 50N)-.35 E(<esri102151> : T)110.5 516 Q(ok)-.8 E
-(yo UTM Zone 51N)-.15 E(<esri102152> : T)110.5 528 Q(ok)-.8 E
-(yo UTM Zone 52N)-.15 E(<esri102153> : T)110.5 540 Q(ok)-.8 E
-(yo UTM Zone 53N)-.15 E(<esri102154> : T)110.5 552 Q(ok)-.8 E
-(yo UTM Zone 54N)-.15 E(<esri102155> : T)110.5 564 Q(ok)-.8 E
-(yo UTM Zone 55N)-.15 E(<esri102156> : T)110.5 576 Q(ok)-.8 E
-(yo UTM Zone 56N)-.15 E(<esri102160> : Datum 73 Hayford Gauss IGeoE)
-110.5 588 Q(<esri102161> : Datum 73 Hayford Gauss IPCC)110.5 600 Q
-(<esri102162> : Graciosa Base SW 1948 UTM Zone 26N)110.5 612 Q
-(<esri102163> : Lisboa Bessel Bonne)110.5 624 Q
-(<esri102164> : Lisboa Hayford Gauss IGeoE)110.5 636 Q
-(<esri102165> : Lisboa Hayford Gauss IPCC)110.5 648 Q
-(<esri102166> : Observ Meteorologico 1939 UTM Zone 25N)110.5 660 Q
-(<esri102167> : Porto Santo 1936 UTM Zone 28N)110.5 672 Q
-(<esri102168> : Sao Braz UTM Zone 26N)110.5 684 Q(<esri102169> : Selv)
-110.5 696 Q(agem Grande 1938 UTM Zone 28N)-.25 E
-(<esri102191> : Nord Maroc De)110.5 708 Q(gree)-.15 E
-(<esri102192> : Sud Maroc De)110.5 720 Q(gree)-.15 E(MB-System 5.0)72
-768 Q(13 March 2014)140.11 E(138)188.45 E 0 Cg EP
-%%Page: 139 139
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<esri102193> : Sahara De)110.5 84 Q(gree)-.15 E
-(<esri102229> : N)110.5 96 Q
-(AD 1983 HARN StatePlane Alabama East FIPS 0101)-.35 E(<esri102230> : N)
-110.5 108 Q(AD 1983 HARN StatePlane Alabama W)-.35 E(est FIPS 0102)-.8 E
-(<esri102241> : N)110.5 120 Q
-(AD 1983 HARN StatePlane California I FIPS 0401)-.35 E(<esri102242> : N)
-110.5 132 Q(AD 1983 HARN StatePlane California II FIPS 0402)-.35 E
-(<esri102243> : N)110.5 144 Q
-(AD 1983 HARN StatePlane California III FIPS 0403)-.35 E
-(<esri102244> : N)110.5 156 Q
-(AD 1983 HARN StatePlane California IV FIPS 0404)-.35 E
-(<esri102245> : N)110.5 168 Q
-(AD 1983 HARN StatePlane California V FIPS 0405)-.35 E(<esri102246> : N)
-110.5 180 Q(AD 1983 HARN StatePlane California VI FIPS 0406)-.35 E
-(<esri102248> : N)110.5 192 Q
-(AD 1983 HARN StatePlane Arizona East FIPS 0201)-.35 E(<esri102249> : N)
-110.5 204 Q(AD 1983 HARN StatePlane Arizona Central FIPS 0202)-.35 E
-(<esri102250> : N)110.5 216 Q(AD 1983 HARN StatePlane Arizona W)-.35 E
-(est FIPS 0203)-.8 E(<esri102251> : N)110.5 228 Q
-(AD 1983 HARN StatePlane Arkansas North FIPS 0301)-.35 E
-(<esri102252> : N)110.5 240 Q
-(AD 1983 HARN StatePlane Arkansas South FIPS 0302)-.35 E
-(<esri102253> : N)110.5 252 Q
-(AD 1983 HARN StatePlane Colorado North FIPS 0501)-.35 E
-(<esri102254> : N)110.5 264 Q
-(AD 1983 HARN StatePlane Colorado Central FIPS 0502)-.35 E
-(<esri102255> : N)110.5 276 Q
-(AD 1983 HARN StatePlane Colorado South FIPS 0503)-.35 E
-(<esri102256> : N)110.5 288 Q
-(AD 1983 HARN StatePlane Connecticut FIPS 0600)-.35 E(<esri102257> : N)
-110.5 300 Q(AD 1983 HARN StatePlane Dela)-.35 E -.1(wa)-.15 G
-(re FIPS 0700).1 E(<esri102258> : N)110.5 312 Q
-(AD 1983 HARN StatePlane Florida East FIPS 0901)-.35 E(<esri102259> : N)
-110.5 324 Q(AD 1983 HARN StatePlane Florida W)-.35 E(est FIPS 0902)-.8 E
-(<esri102260> : N)110.5 336 Q
-(AD 1983 HARN StatePlane Florida North FIPS 0903)-.35 E
-(<esri102261> : N)110.5 348 Q(AD 1983 HARN StatePlane Ha)-.35 E -.1(wa)
--.15 G(ii 1 FIPS 5101).1 E(<esri102262> : N)110.5 360 Q
-(AD 1983 HARN StatePlane Ha)-.35 E -.1(wa)-.15 G(ii 2 FIPS 5102).1 E
-(<esri102263> : N)110.5 372 Q(AD 1983 HARN StatePlane Ha)-.35 E -.1(wa)
--.15 G(ii 3 FIPS 5103).1 E(<esri102264> : N)110.5 384 Q
-(AD 1983 HARN StatePlane Ha)-.35 E -.1(wa)-.15 G(ii 4 FIPS 5104).1 E
-(<esri102265> : N)110.5 396 Q(AD 1983 HARN StatePlane Ha)-.35 E -.1(wa)
--.15 G(ii 5 FIPS 5105).1 E(<esri102266> : N)110.5 408 Q
-(AD 1983 HARN StatePlane Geor)-.35 E(gia East FIPS 1001)-.18 E
-(<esri102267> : N)110.5 420 Q(AD 1983 HARN StatePlane Geor)-.35 E(gia W)
--.18 E(est FIPS 1002)-.8 E(<esri102268> : N)110.5 432 Q
-(AD 1983 HARN StatePlane Idaho East FIPS 1101)-.35 E(<esri102269> : N)
-110.5 444 Q(AD 1983 HARN StatePlane Idaho Central FIPS 1102)-.35 E
-(<esri102270> : N)110.5 456 Q(AD 1983 HARN StatePlane Idaho W)-.35 E
-(est FIPS 1103)-.8 E(<esri102271> : N)110.5 468 Q
-(AD 1983 HARN StatePlane Illinois East FIPS 1201)-.35 E
-(<esri102272> : N)110.5 480 Q(AD 1983 HARN StatePlane Illinois W)-.35 E
-(est FIPS 1202)-.8 E(<esri102273> : N)110.5 492 Q
-(AD 1983 HARN StatePlane Indiana East FIPS 1301)-.35 E(<esri102274> : N)
-110.5 504 Q(AD 1983 HARN StatePlane Indiana W)-.35 E(est FIPS 1302)-.8 E
-(<esri102277> : N)110.5 516 Q
-(AD 1983 HARN StatePlane Kansas North FIPS 1501)-.35 E(<esri102278> : N)
-110.5 528 Q(AD 1983 HARN StatePlane Kansas South FIPS 1502)-.35 E
-(<esri102279> : N)110.5 540 Q(AD 1983 HARN StatePlane K)-.35 E(entuck)
--.25 E 2.5(yN)-.15 G(orth FIPS 1601)-2.5 E(<esri102280> : N)110.5 552 Q
-(AD 1983 HARN StatePlane K)-.35 E(entuck)-.25 E 2.5(yS)-.15 G
-(outh FIPS 1602)-2.5 E(<esri102281> : N)110.5 564 Q
-(AD 1983 HARN StatePlane Louisiana North FIPS 1701)-.35 E
-(<esri102282> : N)110.5 576 Q
-(AD 1983 HARN StatePlane Louisiana South FIPS 1702)-.35 E
-(<esri102283> : N)110.5 588 Q
-(AD 1983 HARN StatePlane Maine East FIPS 1801)-.35 E(<esri102284> : N)
-110.5 600 Q(AD 1983 HARN StatePlane Maine W)-.35 E(est FIPS 1802)-.8 E
-(<esri102285> : N)110.5 612 Q
-(AD 1983 HARN StatePlane Maryland FIPS 1900)-.35 E(<esri102286> : N)
-110.5 624 Q(AD 1983 HARN StatePlane Massachusetts Mainland FIPS 2001)
--.35 E(<esri102287> : N)110.5 636 Q
-(AD 1983 HARN StatePlane Massachusetts Island FIPS 2002)-.35 E
-(<esri102288> : N)110.5 648 Q(AD 1983 HARN StatePlane Michig)-.35 E
-(an North FIPS 2111)-.05 E(<esri102289> : N)110.5 660 Q
-(AD 1983 HARN StatePlane Michig)-.35 E(an Central FIPS 2112)-.05 E
-(<esri102290> : N)110.5 672 Q(AD 1983 HARN StatePlane Michig)-.35 E
-(an South FIPS 2113)-.05 E(<esri102291> : N)110.5 684 Q
-(AD 1983 HARN StatePlane Minnesota North FIPS 2201)-.35 E
-(<esri102292> : N)110.5 696 Q
-(AD 1983 HARN StatePlane Minnesota Central FIPS 2202)-.35 E
-(<esri102293> : N)110.5 708 Q
-(AD 1983 HARN StatePlane Minnesota South FIPS 2203)-.35 E
-(<esri102294> : N)110.5 720 Q
-(AD 1983 HARN StatePlane Mississippi East FIPS 2301)-.35 E
-(MB-System 5.0)72 768 Q(13 March 2014)140.11 E(139)188.45 E 0 Cg EP
-%%Page: 140 140
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<esri102295> : N)110.5 84 Q
-(AD 1983 HARN StatePlane Mississippi W)-.35 E(est FIPS 2302)-.8 E
-(<esri102296> : N)110.5 96 Q
-(AD 1983 HARN StatePlane Missouri East FIPS 2401)-.35 E
-(<esri102297> : N)110.5 108 Q
-(AD 1983 HARN StatePlane Missouri Central FIPS 2402)-.35 E
-(<esri102298> : N)110.5 120 Q(AD 1983 HARN StatePlane Missouri W)-.35 E
-(est FIPS 2403)-.8 E(<esri102300> : N)110.5 132 Q
-(AD 1983 HARN StatePlane Montana FIPS 2500)-.35 E(<esri102304> : N)110.5
-144 Q(AD 1983 HARN StatePlane Nebraska FIPS 2600)-.35 E
-(<esri102307> : N)110.5 156 Q(AD 1983 HARN StatePlane Ne)-.35 E -.25(va)
--.25 G(da East FIPS 2701).25 E(<esri102308> : N)110.5 168 Q
-(AD 1983 HARN StatePlane Ne)-.35 E -.25(va)-.25 G(da Central FIPS 2702)
-.25 E(<esri102309> : N)110.5 180 Q(AD 1983 HARN StatePlane Ne)-.35 E
--.25(va)-.25 G(da W).25 E(est FIPS 2703)-.8 E(<esri102310> : N)110.5 192
-Q(AD 1983 HARN StatePlane Ne)-.35 E 2.5(wH)-.25 G(ampshire FIPS 2800)
--2.5 E(<esri102311> : N)110.5 204 Q(AD 1983 HARN StatePlane Ne)-.35 E
-2.5(wJ)-.25 G(erse)-2.5 E 2.5(yF)-.15 G(IPS 2900)-2.5 E
-(<esri102312> : N)110.5 216 Q(AD 1983 HARN StatePlane Ne)-.35 E 2.5(wM)
--.25 G -.15(ex)-2.5 G(ico East FIPS 3001).15 E(<esri102313> : N)110.5
-228 Q(AD 1983 HARN StatePlane Ne)-.35 E 2.5(wM)-.25 G -.15(ex)-2.5 G
-(ico Central FIPS 3002).15 E(<esri102314> : N)110.5 240 Q
-(AD 1983 HARN StatePlane Ne)-.35 E 2.5(wM)-.25 G -.15(ex)-2.5 G(ico W)
-.15 E(est FIPS 3003)-.8 E(<esri102315> : N)110.5 252 Q
-(AD 1983 HARN StatePlane Ne)-.35 E 2.5(wY)-.25 G(ork East FIPS 3101)-3.6
-E(<esri102316> : N)110.5 264 Q(AD 1983 HARN StatePlane Ne)-.35 E 2.5(wY)
--.25 G(ork Central FIPS 3102)-3.6 E(<esri102317> : N)110.5 276 Q
-(AD 1983 HARN StatePlane Ne)-.35 E 2.5(wY)-.25 G(ork W)-3.6 E
-(est FIPS 3103)-.8 E(<esri102318> : N)110.5 288 Q
-(AD 1983 HARN StatePlane Ne)-.35 E 2.5(wY)-.25 G
-(ork Long Island FIPS 3104)-3.6 E(<esri102320> : N)110.5 300 Q
-(AD 1983 HARN StatePlane North Dak)-.35 E(ota North FIPS 3301)-.1 E
-(<esri102321> : N)110.5 312 Q(AD 1983 HARN StatePlane North Dak)-.35 E
-(ota South FIPS 3302)-.1 E(<esri102322> : N)110.5 324 Q
-(AD 1983 HARN StatePlane Ohio North FIPS 3401)-.35 E(<esri102323> : N)
-110.5 336 Q(AD 1983 HARN StatePlane Ohio South FIPS 3402)-.35 E
-(<esri102324> : N)110.5 348 Q
-(AD 1983 HARN StatePlane Oklahoma North FIPS 3501)-.35 E
-(<esri102325> : N)110.5 360 Q
-(AD 1983 HARN StatePlane Oklahoma South FIPS 3502)-.35 E
-(<esri102326> : N)110.5 372 Q(AD 1983 HARN StatePlane Ore)-.35 E
-(gon North FIPS 3601)-.15 E(<esri102327> : N)110.5 384 Q
-(AD 1983 HARN StatePlane Ore)-.35 E(gon South FIPS 3602)-.15 E
-(<esri102330> : N)110.5 396 Q
-(AD 1983 HARN StatePlane Rhode Island FIPS 3800)-.35 E(<esri102334> : N)
-110.5 408 Q(AD 1983 HARN StatePlane South Dak)-.35 E
-(ota North FIPS 4001)-.1 E(<esri102335> : N)110.5 420 Q
-(AD 1983 HARN StatePlane South Dak)-.35 E(ota South FIPS 4002)-.1 E
-(<esri102336> : N)110.5 432 Q(AD 1983 HARN StatePlane T)-.35 E
-(ennessee FIPS 4100)-.7 E(<esri102337> : N)110.5 444 Q
-(AD 1983 HARN StatePlane T)-.35 E -.15(ex)-.7 G(as North FIPS 4201).15 E
-(<esri102338> : N)110.5 456 Q(AD 1983 HARN StatePlane T)-.35 E -.15(ex)
--.7 G(as North Central FIPS 4202).15 E(<esri102339> : N)110.5 468 Q
-(AD 1983 HARN StatePlane T)-.35 E -.15(ex)-.7 G(as Central FIPS 4203).15
-E(<esri102340> : N)110.5 480 Q(AD 1983 HARN StatePlane T)-.35 E -.15(ex)
--.7 G(as South Central FIPS 4204).15 E(<esri102341> : N)110.5 492 Q
-(AD 1983 HARN StatePlane T)-.35 E -.15(ex)-.7 G(as South FIPS 4205).15 E
-(<esri102342> : N)110.5 504 Q
-(AD 1983 HARN StatePlane Utah North FIPS 4301)-.35 E(<esri102343> : N)
-110.5 516 Q(AD 1983 HARN StatePlane Utah Central FIPS 4302)-.35 E
-(<esri102344> : N)110.5 528 Q
-(AD 1983 HARN StatePlane Utah South FIPS 4303)-.35 E(<esri102345> : N)
-110.5 540 Q(AD 1983 HARN StatePlane V)-.35 E(ermont FIPS 4400)-1.11 E
-(<esri102346> : N)110.5 552 Q(AD 1983 HARN StatePlane V)-.35 E(ir)-.6 E
-(ginia North FIPS 4501)-.18 E(<esri102347> : N)110.5 564 Q
-(AD 1983 HARN StatePlane V)-.35 E(ir)-.6 E(ginia South FIPS 4502)-.18 E
-(<esri102348> : N)110.5 576 Q(AD 1983 HARN StatePlane W)-.35 E
-(ashington North FIPS 4601)-.8 E(<esri102349> : N)110.5 588 Q
-(AD 1983 HARN StatePlane W)-.35 E(ashington South FIPS 4602)-.8 E
-(<esri102350> : N)110.5 600 Q(AD 1983 HARN StatePlane W)-.35 E(est V)-.8
-E(ir)-.6 E(ginia North FIPS 4701)-.18 E(<esri102351> : N)110.5 612 Q
-(AD 1983 HARN StatePlane W)-.35 E(est V)-.8 E(ir)-.6 E
-(ginia South FIPS 4702)-.18 E(<esri102352> : N)110.5 624 Q
-(AD 1983 HARN StatePlane W)-.35 E(isconsin North FIPS 4801)-.4 E
-(<esri102353> : N)110.5 636 Q(AD 1983 HARN StatePlane W)-.35 E
-(isconsin Central FIPS 4802)-.4 E(<esri102354> : N)110.5 648 Q
-(AD 1983 HARN StatePlane W)-.35 E(isconsin South FIPS 4803)-.4 E
-(<esri102355> : N)110.5 660 Q(AD 1983 HARN StatePlane W)-.35 E
-(yoming East FIPS 4901)-.73 E(<esri102356> : N)110.5 672 Q
-(AD 1983 HARN StatePlane W)-.35 E(yoming East Central FIPS 4902)-.73 E
-(<esri102357> : N)110.5 684 Q(AD 1983 HARN StatePlane W)-.35 E(yoming W)
--.73 E(est Central FIPS 4903)-.8 E(<esri102358> : N)110.5 696 Q
-(AD 1983 HARN StatePlane W)-.35 E(yoming W)-.73 E(est FIPS 4904)-.8 E
-(<esri102361> : N)110.5 708 Q(AD 1983 HARN StatePlane Puerto Rico V)-.35
-E(ir)-.6 E(gin Islands FIPS 5200)-.18 E
-(<esri102491> : Nord Algerie Ancienne De)110.5 720 Q(gree)-.15 E
-(MB-System 5.0)72 768 Q(13 March 2014)140.11 E(140)188.45 E 0 Cg EP
-%%Page: 141 141
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<esri102492> : Sud Algerie Ancienne De)110.5 84
-Q(gree)-.15 E(<esri102581> : NTF France I de)110.5 96 Q(grees)-.15 E
-(<esri102582> : NTF France II de)110.5 108 Q(grees)-.15 E
-(<esri102583> : NTF France III de)110.5 120 Q(grees)-.15 E
-(<esri102584> : NTF France IV de)110.5 132 Q(grees)-.15 E
-(<esri102591> : Nord Algerie De)110.5 144 Q(gree)-.15 E
-(<esri102592> : Sud Algerie De)110.5 156 Q(gree)-.15 E(<esri102629> : N)
-110.5 168 Q(AD 1983 StatePlane Alabama East FIPS 0101 Feet)-.35 E
-(<esri102630> : N)110.5 180 Q(AD 1983 StatePlane Alabama W)-.35 E
-(est FIPS 0102 Feet)-.8 E(<esri102631> : N)110.5 192 Q
-(AD 1983 StatePlane Alaska 1 FIPS 5001 Feet)-.35 E(<esri102632> : N)
-110.5 204 Q(AD 1983 StatePlane Alaska 2 FIPS 5002 Feet)-.35 E
-(<esri102633> : N)110.5 216 Q
-(AD 1983 StatePlane Alaska 3 FIPS 5003 Feet)-.35 E(<esri102634> : N)
-110.5 228 Q(AD 1983 StatePlane Alaska 4 FIPS 5004 Feet)-.35 E
-(<esri102635> : N)110.5 240 Q
-(AD 1983 StatePlane Alaska 5 FIPS 5005 Feet)-.35 E(<esri102636> : N)
-110.5 252 Q(AD 1983 StatePlane Alaska 6 FIPS 5006 Feet)-.35 E
-(<esri102637> : N)110.5 264 Q
-(AD 1983 StatePlane Alaska 7 FIPS 5007 Feet)-.35 E(<esri102638> : N)
-110.5 276 Q(AD 1983 StatePlane Alaska 8 FIPS 5008 Feet)-.35 E
-(<esri102639> : N)110.5 288 Q
-(AD 1983 StatePlane Alaska 9 FIPS 5009 Feet)-.35 E(<esri102640> : N)
-110.5 300 Q(AD 1983 StatePlane Alaska 10 FIPS 5010 Feet)-.35 E
-(<esri102641> : N)110.5 312 Q
-(AD 1983 StatePlane California I FIPS 0401 Feet)-.35 E(<esri102642> : N)
-110.5 324 Q(AD 1983 StatePlane California II FIPS 0402 Feet)-.35 E
-(<esri102643> : N)110.5 336 Q
-(AD 1983 StatePlane California III FIPS 0403 Feet)-.35 E
-(<esri102644> : N)110.5 348 Q
-(AD 1983 StatePlane California IV FIPS 0404 Feet)-.35 E
-(<esri102645> : N)110.5 360 Q
-(AD 1983 StatePlane California V FIPS 0405 Feet)-.35 E(<esri102646> : N)
-110.5 372 Q(AD 1983 StatePlane California VI FIPS 0406 Feet)-.35 E
-(<esri102648> : N)110.5 384 Q
-(AD 1983 StatePlane Arizona East FIPS 0201 Feet)-.35 E(<esri102649> : N)
-110.5 396 Q(AD 1983 StatePlane Arizona Central FIPS 0202 Feet)-.35 E
-(<esri102650> : N)110.5 408 Q(AD 1983 StatePlane Arizona W)-.35 E
-(est FIPS 0203 Feet)-.8 E(<esri102651> : N)110.5 420 Q
-(AD 1983 StatePlane Arkansas North FIPS 0301 Feet)-.35 E
-(<esri102652> : N)110.5 432 Q
-(AD 1983 StatePlane Arkansas South FIPS 0302 Feet)-.35 E
-(<esri102653> : N)110.5 444 Q
-(AD 1983 StatePlane Colorado North FIPS 0501 Feet)-.35 E
-(<esri102654> : N)110.5 456 Q
-(AD 1983 StatePlane Colorado Central FIPS 0502 Feet)-.35 E
-(<esri102655> : N)110.5 468 Q
-(AD 1983 StatePlane Colorado South FIPS 0503 Feet)-.35 E
-(<esri102656> : N)110.5 480 Q
-(AD 1983 StatePlane Connecticut FIPS 0600 Feet)-.35 E(<esri102657> : N)
-110.5 492 Q(AD 1983 StatePlane Dela)-.35 E -.1(wa)-.15 G
-(re FIPS 0700 Feet).1 E(<esri102658> : N)110.5 504 Q
-(AD 1983 StatePlane Florida East FIPS 0901 Feet)-.35 E(<esri102659> : N)
-110.5 516 Q(AD 1983 StatePlane Florida W)-.35 E(est FIPS 0902 Feet)-.8 E
-(<esri102660> : N)110.5 528 Q
-(AD 1983 StatePlane Florida North FIPS 0903 Feet)-.35 E
-(<esri102661> : N)110.5 540 Q(AD 1983 StatePlane Ha)-.35 E -.1(wa)-.15 G
-(ii 1 FIPS 5101 Feet).1 E(<esri102662> : N)110.5 552 Q
-(AD 1983 StatePlane Ha)-.35 E -.1(wa)-.15 G(ii 2 FIPS 5102 Feet).1 E
-(<esri102663> : N)110.5 564 Q(AD 1983 StatePlane Ha)-.35 E -.1(wa)-.15 G
-(ii 3 FIPS 5103 Feet).1 E(<esri102664> : N)110.5 576 Q
-(AD 1983 StatePlane Ha)-.35 E -.1(wa)-.15 G(ii 4 FIPS 5104 Feet).1 E
-(<esri102665> : N)110.5 588 Q(AD 1983 StatePlane Ha)-.35 E -.1(wa)-.15 G
-(ii 5 FIPS 5105 Feet).1 E(<esri102666> : N)110.5 600 Q
-(AD 1983 StatePlane Geor)-.35 E(gia East FIPS 1001 Feet)-.18 E
-(<esri102667> : N)110.5 612 Q(AD 1983 StatePlane Geor)-.35 E(gia W)-.18
-E(est FIPS 1002 Feet)-.8 E(<esri102668> : N)110.5 624 Q
-(AD 1983 StatePlane Idaho East FIPS 1101 Feet)-.35 E(<esri102669> : N)
-110.5 636 Q(AD 1983 StatePlane Idaho Central FIPS 1102 Feet)-.35 E
-(<esri102670> : N)110.5 648 Q(AD 1983 StatePlane Idaho W)-.35 E
-(est FIPS 1103 Feet)-.8 E(<esri102671> : N)110.5 660 Q
-(AD 1983 StatePlane Illinois East FIPS 1201 Feet)-.35 E
-(<esri102672> : N)110.5 672 Q(AD 1983 StatePlane Illinois W)-.35 E
-(est FIPS 1202 Feet)-.8 E(<esri102673> : N)110.5 684 Q
-(AD 1983 StatePlane Indiana East FIPS 1301 Feet)-.35 E(<esri102674> : N)
-110.5 696 Q(AD 1983 StatePlane Indiana W)-.35 E(est FIPS 1302 Feet)-.8 E
-(<esri102675> : N)110.5 708 Q(AD 1983 StatePlane Io)-.35 E .2 -.1(wa N)
--.25 H(orth FIPS 1401 Feet).1 E(<esri102676> : N)110.5 720 Q
-(AD 1983 StatePlane Io)-.35 E .2 -.1(wa S)-.25 H(outh FIPS 1402 Feet).1
-E(MB-System 5.0)72 768 Q(13 March 2014)140.11 E(141)188.45 E 0 Cg EP
-%%Page: 142 142
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<esri102677> : N)110.5 84 Q
-(AD 1983 StatePlane Kansas North FIPS 1501 Feet)-.35 E(<esri102678> : N)
-110.5 96 Q(AD 1983 StatePlane Kansas South FIPS 1502 Feet)-.35 E
-(<esri102679> : N)110.5 108 Q(AD 1983 StatePlane K)-.35 E(entuck)-.25 E
-2.5(yN)-.15 G(orth FIPS 1601 Feet)-2.5 E(<esri102680> : N)110.5 120 Q
-(AD 1983 StatePlane K)-.35 E(entuck)-.25 E 2.5(yS)-.15 G
-(outh FIPS 1602 Feet)-2.5 E(<esri102681> : N)110.5 132 Q
-(AD 1983 StatePlane Louisiana North FIPS 1701 Feet)-.35 E
-(<esri102682> : N)110.5 144 Q
-(AD 1983 StatePlane Louisiana South FIPS 1702 Feet)-.35 E
-(<esri102683> : N)110.5 156 Q
-(AD 1983 StatePlane Maine East FIPS 1801 Feet)-.35 E(<esri102684> : N)
-110.5 168 Q(AD 1983 StatePlane Maine W)-.35 E(est FIPS 1802 Feet)-.8 E
-(<esri102685> : N)110.5 180 Q
-(AD 1983 StatePlane Maryland FIPS 1900 Feet)-.35 E(<esri102686> : N)
-110.5 192 Q(AD 1983 StatePlane Massachusetts Mainland FIPS 2001 Feet)
--.35 E(<esri102687> : N)110.5 204 Q
-(AD 1983 StatePlane Massachusetts Island FIPS 2002 Feet)-.35 E
-(<esri102688> : N)110.5 216 Q(AD 1983 StatePlane Michig)-.35 E
-(an North FIPS 2111 Feet)-.05 E(<esri102689> : N)110.5 228 Q
-(AD 1983 StatePlane Michig)-.35 E(an Central FIPS 2112 Feet)-.05 E
-(<esri102690> : N)110.5 240 Q(AD 1983 StatePlane Michig)-.35 E
-(an South FIPS 2113 Feet)-.05 E(<esri102691> : N)110.5 252 Q
-(AD 1983 StatePlane Minnesota North FIPS 2201 Feet)-.35 E
-(<esri102692> : N)110.5 264 Q
-(AD 1983 StatePlane Minnesota Central FIPS 2202 Feet)-.35 E
-(<esri102693> : N)110.5 276 Q
-(AD 1983 StatePlane Minnesota South FIPS 2203 Feet)-.35 E
-(<esri102694> : N)110.5 288 Q
-(AD 1983 StatePlane Mississippi East FIPS 2301 Feet)-.35 E
-(<esri102695> : N)110.5 300 Q(AD 1983 StatePlane Mississippi W)-.35 E
-(est FIPS 2302 Feet)-.8 E(<esri102696> : N)110.5 312 Q
-(AD 1983 StatePlane Missouri East FIPS 2401 Feet)-.35 E
-(<esri102697> : N)110.5 324 Q
-(AD 1983 StatePlane Missouri Central FIPS 2402 Feet)-.35 E
-(<esri102698> : N)110.5 336 Q(AD 1983 StatePlane Missouri W)-.35 E
-(est FIPS 2403 Feet)-.8 E(<esri102700> : N)110.5 348 Q
-(AD 1983 StatePlane Montana FIPS 2500 Feet)-.35 E(<esri102704> : N)110.5
-360 Q(AD 1983 StatePlane Nebraska FIPS 2600 Feet)-.35 E
-(<esri102707> : N)110.5 372 Q(AD 1983 StatePlane Ne)-.35 E -.25(va)-.25
-G(da East FIPS 2701 Feet).25 E(<esri102708> : N)110.5 384 Q
-(AD 1983 StatePlane Ne)-.35 E -.25(va)-.25 G(da Central FIPS 2702 Feet)
-.25 E(<esri102709> : N)110.5 396 Q(AD 1983 StatePlane Ne)-.35 E -.25(va)
--.25 G(da W).25 E(est FIPS 2703 Feet)-.8 E(<esri102710> : N)110.5 408 Q
-(AD 1983 StatePlane Ne)-.35 E 2.5(wH)-.25 G(ampshire FIPS 2800 Feet)-2.5
-E(<esri102711> : N)110.5 420 Q(AD 1983 StatePlane Ne)-.35 E 2.5(wJ)-.25
-G(erse)-2.5 E 2.5(yF)-.15 G(IPS 2900 Feet)-2.5 E(<esri102712> : N)110.5
-432 Q(AD 1983 StatePlane Ne)-.35 E 2.5(wM)-.25 G -.15(ex)-2.5 G
-(ico East FIPS 3001 Feet).15 E(<esri102713> : N)110.5 444 Q
-(AD 1983 StatePlane Ne)-.35 E 2.5(wM)-.25 G -.15(ex)-2.5 G
-(ico Central FIPS 3002 Feet).15 E(<esri102714> : N)110.5 456 Q
-(AD 1983 StatePlane Ne)-.35 E 2.5(wM)-.25 G -.15(ex)-2.5 G(ico W).15 E
-(est FIPS 3003 Feet)-.8 E(<esri102715> : N)110.5 468 Q
-(AD 1983 StatePlane Ne)-.35 E 2.5(wY)-.25 G(ork East FIPS 3101 Feet)-3.6
-E(<esri102716> : N)110.5 480 Q(AD 1983 StatePlane Ne)-.35 E 2.5(wY)-.25
-G(ork Central FIPS 3102 Feet)-3.6 E(<esri102717> : N)110.5 492 Q
-(AD 1983 StatePlane Ne)-.35 E 2.5(wY)-.25 G(ork W)-3.6 E
-(est FIPS 3103 Feet)-.8 E(<esri102718> : N)110.5 504 Q
-(AD 1983 StatePlane Ne)-.35 E 2.5(wY)-.25 G
-(ork Long Island FIPS 3104 Feet)-3.6 E(<esri102719> : N)110.5 516 Q
-(AD 1983 StatePlane North Carolina FIPS 3200 Feet)-.35 E
-(<esri102720> : N)110.5 528 Q(AD 1983 StatePlane North Dak)-.35 E
-(ota North FIPS 3301 Feet)-.1 E(<esri102721> : N)110.5 540 Q
-(AD 1983 StatePlane North Dak)-.35 E(ota South FIPS 3302 Feet)-.1 E
-(<esri102722> : N)110.5 552 Q
-(AD 1983 StatePlane Ohio North FIPS 3401 Feet)-.35 E(<esri102723> : N)
-110.5 564 Q(AD 1983 StatePlane Ohio South FIPS 3402 Feet)-.35 E
-(<esri102724> : N)110.5 576 Q
-(AD 1983 StatePlane Oklahoma North FIPS 3501 Feet)-.35 E
-(<esri102725> : N)110.5 588 Q
-(AD 1983 StatePlane Oklahoma South FIPS 3502 Feet)-.35 E
-(<esri102726> : N)110.5 600 Q(AD 1983 StatePlane Ore)-.35 E
-(gon North FIPS 3601 Feet)-.15 E(<esri102727> : N)110.5 612 Q
-(AD 1983 StatePlane Ore)-.35 E(gon South FIPS 3602 Feet)-.15 E
-(<esri102728> : N)110.5 624 Q(AD 1983 StatePlane Pennsylv)-.35 E
-(ania North FIPS 3701 Feet)-.25 E(<esri102729> : N)110.5 636 Q
-(AD 1983 StatePlane Pennsylv)-.35 E(ania South FIPS 3702 Feet)-.25 E
-(<esri102730> : N)110.5 648 Q
-(AD 1983 StatePlane Rhode Island FIPS 3800 Feet)-.35 E(<esri102733> : N)
-110.5 660 Q(AD 1983 StatePlane South Carolina FIPS 3900 Feet)-.35 E
-(<esri102734> : N)110.5 672 Q(AD 1983 StatePlane South Dak)-.35 E
-(ota North FIPS 4001 Feet)-.1 E(<esri102735> : N)110.5 684 Q
-(AD 1983 StatePlane South Dak)-.35 E(ota South FIPS 4002 Feet)-.1 E
-(<esri102736> : N)110.5 696 Q(AD 1983 StatePlane T)-.35 E
-(ennessee FIPS 4100 Feet)-.7 E(<esri102737> : N)110.5 708 Q
-(AD 1983 StatePlane T)-.35 E -.15(ex)-.7 G(as North FIPS 4201 Feet).15 E
-(<esri102738> : N)110.5 720 Q(AD 1983 StatePlane T)-.35 E -.15(ex)-.7 G
-(as North Central FIPS 4202 Feet).15 E(MB-System 5.0)72 768 Q
-(13 March 2014)140.11 E(142)188.45 E 0 Cg EP
-%%Page: 143 143
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<esri102739> : N)110.5 84 Q
-(AD 1983 StatePlane T)-.35 E -.15(ex)-.7 G(as Central FIPS 4203 Feet).15
-E(<esri102740> : N)110.5 96 Q(AD 1983 StatePlane T)-.35 E -.15(ex)-.7 G
-(as South Central FIPS 4204 Feet).15 E(<esri102741> : N)110.5 108 Q
-(AD 1983 StatePlane T)-.35 E -.15(ex)-.7 G(as South FIPS 4205 Feet).15 E
-(<esri102742> : N)110.5 120 Q
-(AD 1983 StatePlane Utah North FIPS 4301 Feet)-.35 E(<esri102743> : N)
-110.5 132 Q(AD 1983 StatePlane Utah Central FIPS 4302 Feet)-.35 E
-(<esri102744> : N)110.5 144 Q
-(AD 1983 StatePlane Utah South FIPS 4303 Feet)-.35 E(<esri102745> : N)
-110.5 156 Q(AD 1983 StatePlane V)-.35 E(ermont FIPS 4400 Feet)-1.11 E
-(<esri102746> : N)110.5 168 Q(AD 1983 StatePlane V)-.35 E(ir)-.6 E
-(ginia North FIPS 4501 Feet)-.18 E(<esri102747> : N)110.5 180 Q
-(AD 1983 StatePlane V)-.35 E(ir)-.6 E(ginia South FIPS 4502 Feet)-.18 E
-(<esri102748> : N)110.5 192 Q(AD 1983 StatePlane W)-.35 E
-(ashington North FIPS 4601 Feet)-.8 E(<esri102749> : N)110.5 204 Q
-(AD 1983 StatePlane W)-.35 E(ashington South FIPS 4602 Feet)-.8 E
-(<esri102750> : N)110.5 216 Q(AD 1983 StatePlane W)-.35 E(est V)-.8 E
-(ir)-.6 E(ginia North FIPS 4701 Feet)-.18 E(<esri102751> : N)110.5 228 Q
-(AD 1983 StatePlane W)-.35 E(est V)-.8 E(ir)-.6 E
-(ginia South FIPS 4702 Feet)-.18 E(<esri102752> : N)110.5 240 Q
-(AD 1983 StatePlane W)-.35 E(isconsin North FIPS 4801 Feet)-.4 E
-(<esri102753> : N)110.5 252 Q(AD 1983 StatePlane W)-.35 E
-(isconsin Central FIPS 4802 Feet)-.4 E(<esri102754> : N)110.5 264 Q
-(AD 1983 StatePlane W)-.35 E(isconsin South FIPS 4803 Feet)-.4 E
-(<esri102755> : N)110.5 276 Q(AD 1983 StatePlane W)-.35 E
-(yoming East FIPS 4901 Feet)-.73 E(<esri102756> : N)110.5 288 Q
-(AD 1983 StatePlane W)-.35 E(yoming East Central FIPS 4902 Feet)-.73 E
-(<esri102757> : N)110.5 300 Q(AD 1983 StatePlane W)-.35 E(yoming W)-.73
-E(est Central FIPS 4903 Feet)-.8 E(<esri102758> : N)110.5 312 Q
-(AD 1983 StatePlane W)-.35 E(yoming W)-.73 E(est FIPS 4904 Feet)-.8 E
-(<esri102761> : N)110.5 324 Q(AD 1983 StatePlane Puerto Rico V)-.35 E
-(ir)-.6 E(gin Islands FIPS 5200 Feet)-.18 E(<esri102766> : N)110.5 336 Q
-(AD 1983 StatePlane Guam FIPS 5400 Feet)-.35 E
-(<esri103300> : Belge Lambert 1972)110.5 348 Q
-(<esri4023> : GCS International 1967)110.5 360 Q
-(<esri4217> : GCS Bern 1898)110.5 372 Q(<esri4305> : GCS V)110.5 384 Q
-(oirol Uni\214e 1960)-1.29 E(<esri4404> : GCS Montserrat 1958)110.5 396
-Q(<esri4812> : GCS V)110.5 408 Q(oirol Uni\214e 1960 P)-1.29 E(aris)-.15
-E(<esri37001> : GCS WGS 1966)110.5 420 Q(<esri37002> : GCS Fischer 1960)
-110.5 432 Q(<esri37003> : GCS Fischer 1968)110.5 444 Q
-(<esri37004> : GCS Fischer Modi\214ed)110.5 456 Q
-(<esri37005> : GCS Hough 1960)110.5 468 Q(<esri37006> : GCS Ev)110.5 480
-Q(erest Modi\214ed 1969)-.15 E(<esri37007> : GCS W)110.5 492 Q(albeck)
--.8 E(<esri37008> : GCS Sphere ARC INFO)110.5 504 Q
-(<esri37201> : GCS European 1979)110.5 516 Q(<esri37202> : GCS Ev)110.5
-528 Q(erest Bangladesh)-.15 E(<esri37203> : GCS Ev)110.5 540 Q
-(erest India Nepal)-.15 E(<esri37204> : GCS Hjorse)110.5 552 Q 2.5(y1)
--.15 G(955)-2.5 E(<esri37205> : GCS Hong K)110.5 564 Q(ong 1963)-.35 E
-(<esri37206> : GCS Oman)110.5 576 Q(<esri37207> : GCS South Asia Sing)
-110.5 588 Q(apore)-.05 E(<esri37208> : GCS A)110.5 600 Q(yabelle)-.92 E
-(<esri37211> : GCS Point 58)110.5 612 Q(<esri37212> : GCS Beacon E 1945)
-110.5 624 Q(<esri37213> : GCS T)110.5 636 Q(ern Island 1961)-.7 E
-(<esri37214> : GCS Astro 1952)110.5 648 Q(<esri37215> : GCS Belle)110.5
-660 Q(vue IGN)-.25 E(<esri37216> : GCS Canton 1966)110.5 672 Q
-(<esri37217> : GCS Chatham Island 1971)110.5 684 Q
-(<esri37218> : GCS DOS 1968)110.5 696 Q
-(<esri37219> : GCS Easter Island 1967)110.5 708 Q
-(<esri37220> : GCS Guam 1963)110.5 720 Q(MB-System 5.0)72 768 Q
-(13 March 2014)140.11 E(143)188.45 E 0 Cg EP
-%%Page: 144 144
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<esri37221> : GCS GUX 1)110.5 84 Q
-(<esri37222> : GCS Johnston Island 1961)110.5 96 Q
-(<esri37223> : GCS Carthage De)110.5 108 Q(gree)-.15 E
-(<esri37224> : GCS Midw)110.5 120 Q(ay 1961)-.1 E
-(<esri37226> : GCS Pitcairn 1967)110.5 132 Q
-(<esri37227> : GCS Santo DOS 1965)110.5 144 Q(<esri37228> : GCS V)110.5
-156 Q(iti Le)-.6 E(vu 1916)-.25 E(<esri37229> : GCS W)110.5 168 Q(ak)-.8
-E 2.5(eE)-.1 G(niwetok 1960)-2.5 E(<esri37230> : GCS W)110.5 180 Q(ak)
--.8 E 2.5(eI)-.1 G(sland 1952)-2.5 E(<esri37231> : GCS Anna 1 1965)110.5
-192 Q(<esri37232> : GCS Gan 1970)110.5 204 Q
-(<esri37233> : GCS ISTS 073 1969)110.5 216 Q(<esri37234> : GCS K)110.5
-228 Q(er)-.25 E(guelen Island 1949)-.18 E(<esri37235> : GCS Reunion)
-110.5 240 Q(<esri37237> : GCS Ascension Island 1958)110.5 252 Q
-(<esri37238> : GCS DOS 71 4)110.5 264 Q(<esri37239> : GCS Cape Cana)
-110.5 276 Q -.15(ve)-.2 G(ral).15 E(<esri37240> : GCS F)110.5 288 Q
-(ort Thomas 1955)-.15 E(<esri37241> : GCS Graciosa Base SW 1948)110.5
-300 Q(<esri37242> : GCS ISTS 061 1968)110.5 312 Q
-(<esri37243> : GCS LC5 1961)110.5 324 Q
-(<esri37245> : GCS Observ Meteorologico 1939)110.5 336 Q
-(<esri37246> : GCS Pico de Las Nie)110.5 348 Q -.15(ve)-.25 G(s).15 E
-(<esri37247> : GCS Porto Santo 1936)110.5 360 Q
-(<esri37249> : GCS Sao Braz)110.5 372 Q(<esri37250> : GCS Selv)110.5 384
-Q(agem Grande 1938)-.25 E(<esri37251> : GCS T)110.5 396 Q(ristan 1968)
--.35 E(<esri37252> : GCS Samoa 1962)110.5 408 Q
-(<esri37253> : GCS Camp Area)110.5 420 Q
-(<esri37254> : GCS Deception Island)110.5 432 Q
-(<esri37255> : GCS Gunung Se)110.5 444 Q -.05(ga)-.15 G(ra).05 E
-(<esri37257> : GCS S42 Hung)110.5 456 Q(ary)-.05 E(<esri37259> : GCS K)
-110.5 468 Q(usaie 1951)-.15 E(<esri37260> : GCS Alaskan Islands)110.5
-480 Q(<esri104000> : GCS Assumed Geographic 1)110.5 492 Q
-(<esri104101> : GCS Estonia 1937)110.5 504 Q
-(<esri104102> : GCS Hermannsk)110.5 516 Q(ogel)-.1 E
-(<esri104103> : GCS Sierra Leone 1960)110.5 528 Q
-(<esri104104> : GCS Hong K)110.5 540 Q(ong 1980)-.35 E
-(<esri104105> : GCS Datum Lisboa Bessel)110.5 552 Q
-(<esri104106> : GCS Datum Lisboa Hayford)110.5 564 Q
-(<esri104107> : GCS RGF 1993)110.5 576 Q(<esri104108> : GCS NZGD 2000)
-110.5 588 Q(<esri104261> : GCS Merchich De)110.5 600 Q(gree)-.15 E
-(<esri104304> : GCS V)110.5 612 Q(oirol 1875 De)-1.29 E(gree)-.15 E
-(<esri104305> : GCS V)110.5 624 Q(oirol Uni\214e 1960 De)-1.29 E(gree)
--.15 E(\255--------------------------------------------------------)
-110.5 648 Q(Google mercator)110.5 660 Q
-(\255--------------------------------------------------------)110.5 672
-Q(<900913> Chris' funn)110.5 684 Q 2.5(ye)-.15 G
-(psgish code for the google mercator)-2.5 E
-(\255--------------------------------------------------------)110.5 708
-Q(IGNF \(French Mapping Agenc)110.5 720 Q(y\) projection de\214nitions)
--.15 E(MB-System 5.0)72 768 Q(13 March 2014)140.11 E(144)188.45 E 0 Cg
-EP
-%%Page: 145 145
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F
-(\255--------------------------------------------------------)110.5 84 Q
-(<AN)110.5 96 Q(AA92> : MOP92 \(Anaa\) T)-.35 E(uamotu)-.45 E(<AP)110.5
-108 Q -1.11(AT)-.92 G(86> : MOP86 \(Apataki, Rapa, Hao\) T)1.11 E
-(uamotu)-.45 E(<A)110.5 120 Q(TI> : Ancienne T)-1.11 E
-(riangulation des Ingenieurs)-.35 E(<CAD97> : Cadastre 1997)110.5 132 Q
-(<CIOBIH> : CIO-BIH)110.5 144 Q(<CR)110.5 156 Q(OZ63> : Crozet 1963)-.4
-E(<CSG67> : Guyane CSG67)110.5 168 Q(<ED50> : ED50)110.5 180 Q(<EF)110.5
-192 Q -1.11(AT)-.74 G(E57> : EF)1.11 E -1.11(AT)-.74 G(E-IGN 1957)1.11 E
-(<F)110.5 204 Q(ANGA84> : MOP84 \(F)-.74 E(ang)-.15 E(atauf)-.05 E 2.5
-(a1)-.1 G(984\))-2.5 E(<GU)110.5 216 Q(AD48> : Guadeloupe Ste Anne)-.4 E
-(<GU)110.5 228 Q(ADFM49> : Guadeloupe F)-.4 E(ort Marigot)-.15 E
-(<IGN63> : IGN 1963 \(Hi)110.5 240 Q .5 -.25(va O)-.25 H(a, T).25 E
-(ahuata, Mohotani\))-.8 E(<IGN72> : IGN 1972 Grande-T)110.5 252 Q
-(erre / Ile des Pins)-.7 E(<KA)110.5 264 Q(UE70> : MHPF70 \(Kauehi\) T)
--.55 E(uamotu)-.45 E(<KERG62CAR> : K)110.5 276 Q(er)-.25 E
-(guelen \255 K0)-.18 E(<LIFOU56> : Lifou \255 Iles Lo)110.5 288 Q
-(yaute \(IGN56\))-.1 E(<LUREF> : Nouv)110.5 300 Q(elle T)-.15 E
-(riangulation du Grand Duche du Lux)-.35 E(embour)-.15 E(g)-.18 E
-(<MARE53> : Mare \255 Iles Lo)110.5 312 Q(yaute \(IGN53\))-.1 E(<MARQ)
-110.5 324 Q(UI72> : IGN 1972 \(Eiao, Hi)-.1 E .5 -.25(va O)-.25 H
-(a, Mohotani\) Marquises).25 E(<MAR)110.5 336 Q(T38> : Martinique F)-.6
-E(ort-Desaix)-.15 E(<MA)110.5 348 Q -.3(YO)-1.05 G
-(50> : Mayotte Combani).3 E(<MHEFO55F> : MHEFO 1955 \(F)110.5 360 Q
-(atu Huku\))-.15 E(<MHPF67> : MHPF67 \(Mang)110.5 372 Q(are)-.05 E -.25
-(va)-.25 G 2.5(,A).25 G -.05(ga)-2.5 G(kauitai, Auk).05 E
-(ena, Mekiro\) Gambiers \(Iles\))-.1 E(<MOOREA87> : Moorea 1987)110.5
-384 Q(<MOP90> : MOP90 \(T)110.5 396 Q(etiaroa\) Iles de la Societe)-.7 E
-(<NTF> : Nouv)110.5 408 Q(elle T)-.15 E(riangulation Francaise)-.35 E
-(<NUKU72> : IGN 1972 Nuku Hi)110.5 420 Q -.25(va)-.25 G(<NUKU94> : SA)
-110.5 432 Q(T94 \(Nukuta)-1.11 E -.25(va)-.2 G -.1(ke).25 G 2.5(\)T).1 G
-(uamotu)-2.95 E(<OUVEA72CAR> : Ouv)110.5 444 Q(ea \255 Iles Lo)-.15 E
-(yaute \(MHNC 1972 \255 OUVEA\))-.1 E
-(<PETRELS72> : Petrels \255 IGN 1972)110.5 456 Q
-(<RAIA53> : IGN53 \(IGN Raiatea-T)110.5 468 Q(ahaa\) Raiatea-T)-.8 E
-(ahaa-Bora Bora-Huahine)-.8 E(<REUN47> : Reunion 1947)110.5 480 Q
-(<RGF93> : Reseau geodesique francais 1993)110.5 492 Q
-(<RGFG95> : Reseau geodesique francais de Guyane 1995)110.5 504 Q
-(<RGM04> : RGM04 \(Reseau Geodesique de Mayotte 2004\))110.5 516 Q
-(<RGNC> : Reseau Geodesique de Nouv)110.5 528 Q(elle-Caledonie)-.15 E
-(<RGPF> : RGPF \(Reseau Geodesique de Polynesie Francaise\))110.5 540 Q
-(<RGR92> : Reseau geodesique Reunion 1992)110.5 552 Q
-(<RGSPM06> : Reseau Geodesique Saint-Pierre-et-Miquelon \(2006\))110.5
-564 Q
-(<RRAF91> : RRAF 1991 \(Reseau de Reference des Antilles Francaises\))
-110.5 576 Q(<SA)110.5 588 Q(T84> : SA)-1.11 E
-(T84 \(Rurutu\) Iles Australes)-1.11 E
-(<SHOM84> : SHOM 1984 Martinique Montagne Du V)110.5 600 Q(auclin)-1.11
-E(<STPM50> : St Pierre et Miquelon 1950)110.5 612 Q(<T)110.5 624 Q
-(AHAA> : Raiatea \255 T)-.93 E(ahaa 51-54 \(T)-.8 E(ahaa, Base T)-.8 E
-(erme Est\))-.7 E(<T)110.5 636 Q(AHI51> : T)-.93 E(ahiti-T)-.8 E
-(erme Nord 1951)-.7 E(<T)110.5 648 Q(AHI79> : IGN79 \(T)-.93 E
-(ahiti\) Iles de la Societe)-.8 E(<T)110.5 660 Q(ANN)-.93 E(A> : T)-.35
-E(anna Bloc Sud)-.8 E(<TERA50> : Pointe Geologie \255 Perroud 1950)110.5
-672 Q(<TUB)110.5 684 Q(U69> : MHPF 1969 \(T)-.1 E(ub)-.45 E
-(uai\) Iles Australes)-.2 E(<W)110.5 696 Q(ALL78> : W)-1.2 E(allis-Uv)
--.8 E(ea 1978 \(MOP78\))-.15 E(<WGS72> : W)110.5 708 Q
-(orld Geodetic System 1972)-.8 E(<WGS84> : W)110.5 720 Q
-(orld Geodetic System 1984)-.8 E(MB-System 5.0)72 768 Q(13 March 2014)
-140.11 E(145)188.45 E 0 Cg EP
-%%Page: 146 146
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<AN)110.5 84 Q(AA92GEO> : MOP92 \(Anaa\) T)-.35
-E(uamotu)-.45 E(<AP)110.5 96 Q -1.11(AT)-.92 G
-(86GEO> : MOP86 \(Apataki, Rapa, Hao\) T)1.11 E(uamotu)-.45 E(<A)110.5
-108 Q(TIGEO> : Ancienne T)-1.11 E(riangulation des Ingenieurs)-.35 E
-(<CAD97GEO> : Cadastre 1997)110.5 120 Q(<CR)110.5 132 Q
-(OZ63GEO> : Crozet 1963)-.4 E(<CSG67GEO> : Guyane CSG67 UTM fuseau 21)
-110.5 144 Q(<ED50G> : ED50)110.5 156 Q(<EF)110.5 168 Q -1.11(AT)-.74 G
-(E57GEO> : EF)1.11 E -1.11(AT)-.74 G(E-IGN 1957)1.11 E(<F)110.5 180 Q
-(ANGA84GEO> : MOP84 \(F)-.74 E(ang)-.15 E(atauf)-.05 E 2.5(a1)-.1 G
-(984\))-2.5 E(<GU)110.5 192 Q(AD48GEO> : Guadeloupe Ste Anne)-.4 E(<GU)
-110.5 204 Q(ADFM49GEO> : Guadeloupe F)-.4 E(ort Marigot)-.15 E
-(<IGN63GEO> : IGN 1963 \(Hi)110.5 216 Q .5 -.25(va O)-.25 H(a, T).25 E
-(ahuata, Mohotani\))-.8 E(<IGN72GEO> : IGN 1972 Grande-T)110.5 228 Q
-(erre / Ile des Pins)-.7 E(<KA)110.5 240 Q
-(UE70GEO> : MHPF70 \(Kauehi\) T)-.55 E(uamotu)-.45 E(<KERG62GEO> : K)
-110.5 252 Q(er)-.25 E(guelen \255 K0)-.18 E
-(<LIFOU56GEO> : Lifou \255 Iles Lo)110.5 264 Q(yaute \(IGN56\))-.1 E
-(<LUXGEO> : Nouv)110.5 276 Q(elle T)-.15 E
-(riangulation du Grand Duche du Lux)-.35 E(embour)-.15 E(g)-.18 E
-(<MARE53GEO> : Mare \255 Iles Lo)110.5 288 Q(yaute \(IGN53\))-.1 E
-(<MARQ)110.5 300 Q(UI72GEO> : IGN 1972 \(Eiao, Hi)-.1 E .5 -.25(va O)
--.25 H(a, Mohotani\) Marquises).25 E(<MAR)110.5 312 Q
-(T38GEO> : Martinique F)-.6 E(ort-Desaix)-.15 E(<MA)110.5 324 Q -.3(YO)
--1.05 G(50GEO> : Mayotte Combani).3 E(<MHEFO55FGEO> : MHEFO 1955 \(F)
-110.5 336 Q(atu Huku\))-.15 E(<MHPF67GEO> : MHPF67 \(Mang)110.5 348 Q
-(are)-.05 E -.25(va)-.25 G 2.5(,A).25 G -.05(ga)-2.5 G(kauitai, Auk).05
-E(ena, Mekiro\) Gambiers \(Iles\))-.1 E(<MOOREA87GEO> : Moorea 1987)
-110.5 360 Q(<MOP90GEO> : MOP90 \(T)110.5 372 Q
-(etiaroa\) Iles de la Societe)-.7 E(<NTFG> : Nouv)110.5 384 Q(elle T)
--.15 E(riangulation Francaise Greenwich de)-.35 E(gres se)-.15 E
-(xagesimaux)-.15 E(<NTFP> : Nouv)110.5 396 Q(elle T)-.15 E
-(riangulation Francaise P)-.35 E(aris grades)-.15 E
-(<NUKU72GEO> : IGN 1972 Nuku Hi)110.5 408 Q -.25(va)-.25 G
-(<NUKU94GEO> : SA)110.5 420 Q(T94 \(Nukuta)-1.11 E -.25(va)-.2 G -.1(ke)
-.25 G 2.5(\)T).1 G(uamotu)-2.95 E(<OUVEA72GEO> : Ouv)110.5 432 Q
-(ea \255 Iles Lo)-.15 E(yaute \(MHNC 1972 \255 OUVEA\))-.1 E
-(<RAIA53GEO> : IGN53 \(IGN Raiatea-T)110.5 444 Q(ahaa\) Raiatea-T)-.8 E
-(ahaa-Bora Bora-Huahine)-.8 E(<REUN47GEO> : Reunion 1947)110.5 456 Q
-(<RGF93G> : Reseau geodesique francais 1993)110.5 468 Q
-(<RGFG95GEO> : Reseau geodesique francais de Guyane 1995)110.5 480 Q
-(<RGM04GEO> : RGM04 \(Reseau Geodesique de Mayotte 2004\))110.5 492 Q
-(<RGNCGEO> : Reseau Geodesique de Nouv)110.5 504 Q(elle-Caledonie)-.15 E
-(<RGPFGEO> : RGPF \(Reseau Geodesique de Polynesie Francaise\))110.5 516
-Q(<RGR92GEO> : Reseau geodesique de la Reunion 1992)110.5 528 Q
-(<RGSPM06GEO> : Saint-Pierre-et-Miquelon \(2006\))110.5 540 Q(<SA)110.5
-552 Q(T84GEO> : SA)-1.11 E(T84 \(Rurutu\) Iles Australes)-1.11 E
-(<SHOM84GEO> : SHOM 1984 Martinique Montagne Du V)110.5 564 Q(auclin)
--1.11 E(<STPM50GEO> : St Pierre et Miquelon 1950)110.5 576 Q(<T)110.5
-588 Q(AHAA)-.93 E(GEO> : Raiatea \255 T)-.4 E(ahaa 51-54 \(T)-.8 E
-(ahaa, Base T)-.8 E(erme Est\))-.7 E(<T)110.5 600 Q(AHI51GEO> : T)-.93 E
-(ahiti-T)-.8 E(erme Nord 1951)-.7 E(<T)110.5 612 Q
-(AHI79GEO> : IGN79 \(T)-.93 E(ahiti\) Iles de la Societe)-.8 E(<T)110.5
-624 Q(ANN)-.93 E -.4(AG)-.35 G(EO> : T).4 E(anna Bloc Sud)-.8 E
-(<TERA50GEO> : Pointe Geologie \255 Perroud 1950)110.5 636 Q(<TUB)110.5
-648 Q(U69GEO> : MHPF 1969 \(T)-.1 E(ub)-.45 E(uai\) Iles Australes)-.2 E
-(<W)110.5 660 Q(ALL78GEO> : W)-1.2 E(allis \255 Uv)-.8 E
-(ea 1978 \(MOP78\))-.15 E(<WGS72G> : WGS72)110.5 672 Q(<WGS84G> : W)
-110.5 684 Q(orld Geodetic System 1984)-.8 E(<WGS84RRAFGEO> : Reseau de \
-reference des Antilles francaises \(1988-1991\))110.5 696 Q
-(<XGEO> : Systeme CIO-BIH)110.5 708 Q(<AN)110.5 720 Q
-(AA92UTM6S> : MOP92 \(Anaa\) T)-.35 E(uamotu \255 UTM fuseau 6 Sud)-.45
-E(MB-System 5.0)72 768 Q(13 March 2014)140.11 E(146)188.45 E 0 Cg EP
-%%Page: 147 147
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<AP)110.5 84 Q -1.11(AT)-.92 G
-(86UTM6S> : MOP86 \(Apataki, Rapa, Hao\) T)1.11 E
-(uamotu \255 UTM fuseau 6 Sud)-.45 E(<AP)110.5 96 Q -1.11(AT)-.92 G
-(86UTM7S> : MOP86 \(Apataki, Rapa, Hao\) T)1.11 E
-(uamotu \255 UTM fuseau 7 Sud)-.45 E
-(<CAD97UTM38S> : Cadastre 1997 \255 UTM fuseau 38 Sud)110.5 108 Q(<CR)
-110.5 120 Q(OZ63UTM39S> : Crozet 1963)-.4 E
-(<CSG67UTM21> : Guyane CSG67 UTM fuseau 21)110.5 132 Q
-(<CSG67UTM22> : Guyane CSG67 UTM fuseau 22)110.5 144 Q(<EF)110.5 156 Q
--1.11(AT)-.74 G(E57UT59S> : EF)1.11 E -1.11(AT)-.74 G
-(E-IGN 1957 \255 UTM fuseau 59 Sud)1.11 E(<F)110.5 168 Q
-(ANGA84UTM7S> : F)-.74 E(ang)-.15 E(atauf)-.05 E 2.5(a1)-.1 G
-(984 \255 UTM fuseau 7 Sud)-2.5 E(<GEOPOR)110.5 180 Q -.93(TA)-.6 G
-(LANF> : Geoportail \255 Antilles francaises).93 E(<GEOPOR)110.5 192 Q
--.93(TA)-.6 G(LCRZ> : Geoportail \255 Crozet).93 E(<GEOPOR)110.5 204 Q
--.93(TA)-.6 G(LFXX> : Geoportail \255 France metropolitaine).93 E
-(<GEOPOR)110.5 216 Q -.93(TA)-.6 G(LGUF> : Geoportail \255 Guyane).93 E
-(<GEOPOR)110.5 228 Q -.93(TA)-.6 G(LKER> : Geoportail \255 K).93 E(er)
--.25 E(guelen)-.18 E(<GEOPOR)110.5 240 Q -.93(TA)-.6 G
-(LMYT> : Geoportail \255 Mayotte).93 E(<GEOPOR)110.5 252 Q -.93(TA)-.6 G
-(LNCL> : Geoportail \255 Nouv).93 E(elle-Caledonie)-.15 E(<GEOPOR)110.5
-264 Q -.93(TA)-.6 G(LPYF> : Geoportail \255 Polynesie francaise).93 E
-(<GEOPOR)110.5 276 Q -.93(TA)-.6 G
-(LREU> : Geoportail \255 Reunion et dependances).93 E(<GEOPOR)110.5 288
-Q -.93(TA)-.6 G(LSPM> : Geoportail \255 Saint-Pierre et Miquelon).93 E
-(<GEOPOR)110.5 300 Q -.93(TA)-.6 G -.74(LW).93 G
-(LF> : Geoportail \255 W).74 E(allis et Futuna)-.8 E(<GU)110.5 312 Q
-(AD48UTM20> : Guadeloupe Ste Anne)-.4 E(<GU)110.5 324 Q
-(ADFM49U20> : Guadeloupe F)-.4 E(ort Marigot)-.15 E
-(<IGN63UTM7S> : IGN 1963 \255 Hi)110.5 336 Q .5 -.25(va O)-.25 H(a, T)
-.25 E(ahuata, Mohotani \255 UTM fuseau 7 Sud)-.8 E
-(<IGN72LAM> : IGN 1972 \255 Lambert Nouv)110.5 348 Q(elle Caledonie)-.15
-E(<IGN72UTM58S> : IGN 1972 \255 UTM fuseau 58 Sud)110.5 360 Q(<KA)110.5
-372 Q(UE70UTM6S> : MHPF70 \(Kauehi\) T)-.55 E
-(uamotu \255 UTM fuseau 6 Sud)-.45 E(<KERG62UTM42S> : K)110.5 384 Q(er)
--.25 E(guelen 1962)-.18 E(<LAMB1> : Lambert I)110.5 396 Q
-(<LAMB1C> : Lambert I Carto)110.5 408 Q(<LAMB2> : Lambert II)110.5 420 Q
-(<LAMB2C> : Lambert II Carto)110.5 432 Q(<LAMB3> : Lambert III)110.5 444
-Q(<LAMB3C> : Lambert III Carto)110.5 456 Q(<LAMB4> : Lambert IV)110.5
-468 Q(<LAMB4C> : Lambert IV Carto)110.5 480 Q(<LAMB93> : Lambert 93)
-110.5 492 Q(<LAMBE> : Lambert II etendu)110.5 504 Q
-(<LAMBGC> : Lambert grand champ)110.5 516 Q(<LUXGA)110.5 528 Q
-(USSK> : Lux)-.55 E(embour)-.15 E 2.5(g1)-.18 G(929)-2.5 E
-(<MARE53UTM58S> : Mare \255 Iles Lo)110.5 540 Q
-(yaute \255 UTM fuseau 58 Sud)-.1 E(<MAR)110.5 552 Q
-(T38UTM20> : Martinique F)-.6 E(ort-Desaix)-.15 E(<MA)110.5 564 Q -.3
-(YO)-1.05 G(50UTM38S> : Mayotte Combani).3 E
-(<MHPF67UTM8S> : MHPF67 \(Mang)110.5 576 Q(are)-.05 E -.25(va)-.25 G 2.5
-(,A).25 G -.05(ga)-2.5 G(kauitai, Auk).05 E
-(ena, Mekiro\) Gambiers \(Iles\) \255 UTM 8 S)-.1 E
-(<MILLER> : Geoportail \255 Monde)110.5 588 Q
-(<MOOREA87U6S> : Moorea 1987 \255 UTM fuseau 6 Sud)110.5 600 Q
-(<MOP90UTM6S> : MOP90 \(T)110.5 612 Q
-(etiaroa\) Iles de la Societe \255 UTM fuseau 6 Sud)-.7 E
-(<NUKU72U7S> : IGN 1972 Nuku Hi)110.5 624 Q .5 -.25(va \255 U)-.25 H
-(TM fuseau 7 Sud).25 E(<NUKU94UTM7S> : IGN 1994 Nuku Hi)110.5 636 Q .5
--.25(va \255 U)-.25 H(TM fuseau 7 Sud).25 E(<OUVEA72U58S> : Ouv)110.5
-648 Q(ea \255 Iles Lo)-.15 E(yaute \255 UTM fuseau 58 Sud)-.1 E
-(<RAIA53UTM5S> : IGN53 \(IGN Raiatea-T)110.5 660 Q(ahaa\) Raiatea-T)-.8
-E(ahaa-Bora Bora-Huahine \255 UTM fuseau 5)-.8 E(<REUN47GA)110.5 672 Q
-(USSL> : Reunion Gauss Laborde)-.55 E
-(<RGF93CC42> : Projection conique conforme Zone 1)110.5 684 Q
-(<RGF93CC43> : Projection conique conforme Zone 2)110.5 696 Q
-(<RGF93CC44> : Projection conique conforme Zone 3)110.5 708 Q
-(<RGF93CC45> : Projection conique conforme Zone 4)110.5 720 Q
-(MB-System 5.0)72 768 Q(13 March 2014)140.11 E(147)188.45 E 0 Cg EP
-%%Page: 148 148
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F
-(<RGF93CC46> : Projection conique conforme Zone 5)110.5 84 Q
-(<RGF93CC47> : Projection conique conforme Zone 6)110.5 96 Q
-(<RGF93CC48> : Projection conique conforme Zone 7)110.5 108 Q
-(<RGF93CC49> : Projection conique conforme Zone 8)110.5 120 Q
-(<RGF93CC50> : Projection conique conforme Zone 9)110.5 132 Q(<RGM04UTM\
-38S> : UTM fuseau 38 Sud \(Reseau Geodesique de Mayotte 2004\))110.5 144
-Q(<RGNCLAM> : Reseau Geodesique de Nouv)110.5 156 Q
-(elle-Caledonie \255 Lambert Nouv)-.15 E(elle Caledonie)-.15 E
-(<RGNCUTM57S> : Reseau Geodesique de Nouv)110.5 168 Q
-(elle-Caledonie \255 UTM fuseau 57 Sud)-.15 E
-(<RGNCUTM58S> : Reseau Geodesique de Nouv)110.5 180 Q
-(elle-Caledonie \255 UTM fuseau 58 Sud)-.15 E
-(<RGNCUTM59S> : Reseau Geodesique de Nouv)110.5 192 Q
-(elle-Caledonie \255 UTM fuseau 59 Sud)-.15 E
-(<RGPFUTM5S> : RGPF \255 UTM fuseau 5 Sud)110.5 204 Q
-(<RGPFUTM6S> : RGPF \255 UTM fuseau 6 Sud)110.5 216 Q
-(<RGPFUTM7S> : RGPF \255 UTM fuseau 7 Sud)110.5 228 Q
-(<RGR92UTM40S> : RGR92 UTM fuseau 40 Sud)110.5 240 Q
-(<RGSPM06U21> : Saint-Pierre-et-Miquelon \(2006\) UTM Fuseau 21 Nord)
-110.5 252 Q(<SA)110.5 264 Q(T84UTM5S> : SA)-1.11 E
-(T84 \(Rurutu\) Iles Australes \255 UTM fuseau 5 Sud)-1.11 E
-(<STEREOSX> : Stereographique polaire Sud)110.5 276 Q
-(<STPM50UTM21> : St Pierre et Miquelon 1950)110.5 288 Q(<T)110.5 300 Q
-(AHAA)-.93 E(UTM05S> : T)-.55 E(ahaa 1951)-.8 E(<T)110.5 312 Q
-(AHI51UTM06S> : T)-.93 E(ahiti-T)-.8 E(erme Nord UTM fuseau 6 Sud)-.7 E
-(<T)110.5 324 Q(AHI79UTM6S> : T)-.93 E(ahiti 1979)-.8 E(<T)110.5 336 Q
-(ANN)-.93 E -.55(AU)-.35 G(TM59S> : T).55 E
-(anna Bloc Sud \255 UTM fuseau 59 Sud)-.8 E(<TERA50SPT)110.5 348 Q
-(A> : T)-.93 E(erre Adelie Stereo polaire T)-.7 E(erre Adelie)-.7 E
-(<TERA50STEREO> : T)110.5 360 Q(erre Adelie 1950)-.7 E(<TUB)110.5 372 Q
-(U69UTM6S> : T)-.1 E(ub)-.45 E
-(uai \255 Iles Australes \255 UTM fuseau 6 Sud)-.2 E(<UTM01SW72> : W)
-110.5 384 Q(orld Geodetic System 1972 UTM fuseau 01 Sud)-.8 E
-(<UTM01SW84> : W)110.5 396 Q
-(orld Geodetic System 1984 UTM fuseau 01 Sud)-.8 E(<UTM01W84> : W)110.5
-408 Q(orld Geodetic System 1984 UTM fuseau 01)-.8 E(<UTM02SW84> : W)
-110.5 420 Q(orld Geodetic System 1984 UTM fuseau 02 Sud)-.8 E
-(<UTM02W84> : W)110.5 432 Q(orld Geodetic System 1984 UTM fuseau 02)-.8
-E(<UTM03SW84> : W)110.5 444 Q
-(orld Geodetic System 1984 UTM fuseau 03 Sud)-.8 E(<UTM03W84> : W)110.5
-456 Q(orld Geodetic System 1984 UTM fuseau 03)-.8 E(<UTM04SW84> : W)
-110.5 468 Q(orld Geodetic System 1984 UTM fuseau 04 Sud)-.8 E
-(<UTM04W84> : W)110.5 480 Q(orld Geodetic System 1984 UTM fuseau 04)-.8
-E(<UTM05SW84> : W)110.5 492 Q
-(orld Geodetic System 1984 UTM fuseau 05 Sud)-.8 E(<UTM05W84> : W)110.5
-504 Q(orld Geodetic System 1984 UTM fuseau 05)-.8 E(<UTM06SW84> : W)
-110.5 516 Q(orld Geodetic System 1984 UTM fuseau 06 Sud)-.8 E
-(<UTM06W84> : W)110.5 528 Q(orld Geodetic System 1984 UTM fuseau 06)-.8
-E(<UTM07SW84> : W)110.5 540 Q
-(orld Geodetic System 1984 UTM fuseau 07 Sud)-.8 E(<UTM07W84> : W)110.5
-552 Q(orld Geodetic System 1984 UTM fuseau 07)-.8 E(<UTM08SW84> : W)
-110.5 564 Q(orld Geodetic System 1984 UTM fuseau 08 Sud)-.8 E
-(<UTM08W84> : W)110.5 576 Q(orld Geodetic System 1984 UTM fuseau 08)-.8
-E(<UTM09SW84> : W)110.5 588 Q
-(orld Geodetic System 1984 UTM fuseau 09 Sud)-.8 E(<UTM09W84> : W)110.5
-600 Q(orld Geodetic System 1984 UTM fuseau 09)-.8 E(<UTM10SW84> : W)
-110.5 612 Q(orld Geodetic System 1984 UTM fuseau 10 Sud)-.8 E
-(<UTM10W84> : W)110.5 624 Q(orld Geodetic System 1984 UTM fuseau 10)-.8
-E(<UTM11SW84> : W)110.5 636 Q
-(orld Geodetic System 1984 UTM fuseau 11 Sud)-.8 E(<UTM11W84> : W)110.5
-648 Q(orld Geodetic System 1984 UTM fuseau 11)-.8 E(<UTM12SW84> : W)
-110.5 660 Q(orld Geodetic System 1984 UTM fuseau 12 Sud)-.8 E
-(<UTM12W84> : W)110.5 672 Q(orld Geodetic System 1984 UTM fuseau 12)-.8
-E(<UTM13SW84> : W)110.5 684 Q
-(orld Geodetic System 1984 UTM fuseau 13 Sud)-.8 E(<UTM13W84> : W)110.5
-696 Q(orld Geodetic System 1984 UTM fuseau 13)-.8 E(<UTM14SW84> : W)
-110.5 708 Q(orld Geodetic System 1984 UTM fuseau 14 Sud)-.8 E
-(<UTM14W84> : W)110.5 720 Q(orld Geodetic System 1984 UTM fuseau 14)-.8
-E(MB-System 5.0)72 768 Q(13 March 2014)140.11 E(148)188.45 E 0 Cg EP
-%%Page: 149 149
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<UTM15SW84> : W)110.5 84 Q
-(orld Geodetic System 1984 UTM fuseau 15 Sud)-.8 E(<UTM15W84> : W)110.5
-96 Q(orld Geodetic System 1984 UTM fuseau 15)-.8 E(<UTM16SW84> : W)110.5
-108 Q(orld Geodetic System 1984 UTM fuseau 16 Sud)-.8 E(<UTM16W84> : W)
-110.5 120 Q(orld Geodetic System 1984 UTM fuseau 16)-.8 E
-(<UTM17SW84> : W)110.5 132 Q
-(orld Geodetic System 1984 UTM fuseau 17 Sud)-.8 E(<UTM17W84> : W)110.5
-144 Q(orld Geodetic System 1984 UTM fuseau 17)-.8 E(<UTM18SW84> : W)
-110.5 156 Q(orld Geodetic System 1984 UTM fuseau 18 Sud)-.8 E
-(<UTM18W84> : W)110.5 168 Q(orld Geodetic System 1984 UTM fuseau 18)-.8
-E(<UTM19SW84> : W)110.5 180 Q
-(orld Geodetic System 1984 UTM fuseau 19 Sud)-.8 E(<UTM19W84> : W)110.5
-192 Q(orld Geodetic System 1984 UTM fuseau 19)-.8 E(<UTM20SW84> : W)
-110.5 204 Q(orld Geodetic System 1984 UTM fuseau 20 Sud)-.8 E
-(<UTM20W84> : W)110.5 216 Q(orld Geodetic System 1984 UTM fuseau 20)-.8
-E(<UTM20W84GU)110.5 228 Q(AD> : W)-.4 E
-(orld Geodetic System 1984 UTM fuseau 20 Nord-Guadeloupe)-.8 E
-(<UTM20W84MAR)110.5 240 Q(T> : W)-.6 E
-(orld Geodetic System 1984 UTM fuseau 20 Nord-Martinique)-.8 E
-(<UTM21SW84> : W)110.5 252 Q
-(orld Geodetic System 1984 UTM fuseau 21 Sud)-.8 E(<UTM21W84> : W)110.5
-264 Q(orld Geodetic System 1984 UTM fuseau 21)-.8 E
-(<UTM22RGFG95> : RGFG95 UTM fuseau 22 Nord-Guyane)110.5 276 Q
-(<UTM22SW84> : W)110.5 288 Q
-(orld Geodetic System 1984 UTM fuseau 22 Sud)-.8 E(<UTM22W84> : W)110.5
-300 Q(orld Geodetic System 1984 UTM fuseau 22)-.8 E(<UTM23SW84> : W)
-110.5 312 Q(orld Geodetic System 1984 UTM fuseau 23 Sud)-.8 E
-(<UTM23W84> : W)110.5 324 Q(orld Geodetic System 1984 UTM fuseau 23)-.8
-E(<UTM24SW84> : W)110.5 336 Q
-(orld Geodetic System 1984 UTM fuseau 24 Sud)-.8 E(<UTM24W84> : W)110.5
-348 Q(orld Geodetic System 1984 UTM fuseau 24)-.8 E(<UTM25SW84> : W)
-110.5 360 Q(orld Geodetic System 1984 UTM fuseau 25 Sud)-.8 E
-(<UTM25W84> : W)110.5 372 Q(orld Geodetic System 1984 UTM fuseau 25)-.8
-E(<UTM26SW84> : W)110.5 384 Q
-(orld Geodetic System 1984 UTM fuseau 26 Sud)-.8 E(<UTM26W84> : W)110.5
-396 Q(orld Geodetic System 1984 UTM fuseau 26)-.8 E(<UTM27SW84> : W)
-110.5 408 Q(orld Geodetic System 1984 UTM fuseau 27 Sud)-.8 E
-(<UTM27W84> : W)110.5 420 Q(orld Geodetic System 1984 UTM fuseau 27)-.8
-E(<UTM28SW84> : W)110.5 432 Q
-(orld Geodetic System 1984 UTM fuseau 28 Sud)-.8 E(<UTM28W84> : W)110.5
-444 Q(orld Geodetic System 1984 UTM fuseau 28)-.8 E(<UTM29SW84> : W)
-110.5 456 Q(orld Geodetic System 1984 UTM fuseau 29 Sud)-.8 E
-(<UTM29W84> : W)110.5 468 Q(orld Geodetic System 1984 UTM fuseau 29)-.8
-E(<UTM30> : European Datum 1950 UTM fuseau 30)110.5 480 Q
-(<UTM30RGF93> : RGF93 UTM fuseau 30)110.5 492 Q(<UTM30SW84> : W)110.5
-504 Q(orld Geodetic System 1984 UTM fuseau 30 Sud)-.8 E(<UTM30W72> : W)
-110.5 516 Q(orld Geodetic System 1972 UTM fuseau 30)-.8 E
-(<UTM30W84> : W)110.5 528 Q(orld Geodetic System 1984 UTM fuseau 30)-.8
-E(<UTM31> : European Datum 1950 UTM fuseau 31)110.5 540 Q
-(<UTM31RGF93> : RGF93 UTM fuseau 31)110.5 552 Q(<UTM31SW84> : W)110.5
-564 Q(orld Geodetic System 1984 UTM fuseau 31 Sud)-.8 E(<UTM31W72> : W)
-110.5 576 Q(orld Geodetic System 1972 UTM fuseau 31)-.8 E
-(<UTM31W84> : W)110.5 588 Q(orld Geodetic System 1984 UTM fuseau 31)-.8
-E(<UTM32> : European Datum 1950 UTM fuseau 32)110.5 600 Q
-(<UTM32RGF93> : RGF93 UTM fuseau 32)110.5 612 Q(<UTM32SW84> : W)110.5
-624 Q(orld Geodetic System 1984 UTM fuseau 32 Sud)-.8 E(<UTM32W72> : W)
-110.5 636 Q(orld Geodetic System 1972 UTM fuseau 32)-.8 E
-(<UTM32W84> : W)110.5 648 Q(orld Geodetic System 1984 UTM fuseau 32)-.8
-E(<UTM33SW84> : W)110.5 660 Q
-(orld Geodetic System 1984 UTM fuseau 33 Sud)-.8 E(<UTM33W84> : W)110.5
-672 Q(orld Geodetic System 1984 UTM fuseau 33)-.8 E(<UTM34SW84> : W)
-110.5 684 Q(orld Geodetic System 1984 UTM fuseau 34 Sud)-.8 E
-(<UTM34W84> : W)110.5 696 Q(orld Geodetic System 1984 UTM fuseau 34)-.8
-E(<UTM35SW84> : W)110.5 708 Q
-(orld Geodetic System 1984 UTM fuseau 35 Sud)-.8 E(<UTM35W84> : W)110.5
-720 Q(orld Geodetic System 1984 UTM fuseau 35)-.8 E(MB-System 5.0)72 768
-Q(13 March 2014)140.11 E(149)188.45 E 0 Cg EP
-%%Page: 150 150
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(<UTM36SW84> : W)110.5 84 Q
-(orld Geodetic System 1984 UTM fuseau 36 Sud)-.8 E(<UTM36W84> : W)110.5
-96 Q(orld Geodetic System 1984 UTM fuseau 36)-.8 E(<UTM37SW84> : W)110.5
-108 Q(orld Geodetic System 1984 UTM fuseau 37 Sud)-.8 E(<UTM37W84> : W)
-110.5 120 Q(orld Geodetic System 1984 UTM fuseau 37)-.8 E
-(<UTM38SW84> : W)110.5 132 Q
-(orld Geodetic System 1984 UTM fuseau 38 Sud)-.8 E(<UTM38W84> : W)110.5
-144 Q(orld Geodetic System 1984 UTM fuseau 38)-.8 E(<UTM39SW84> : W)
-110.5 156 Q(orld Geodetic System 1984 UTM fuseau 39 Sud)-.8 E
-(<UTM39W84> : W)110.5 168 Q(orld Geodetic System 1984 UTM fuseau 39)-.8
-E(<UTM40SW84> : W)110.5 180 Q
-(orld Geodetic System 1984 UTM fuseau 40 Sud)-.8 E(<UTM40W84> : W)110.5
-192 Q(orld Geodetic System 1984 UTM fuseau 40)-.8 E(<UTM41SW84> : W)
-110.5 204 Q(orld Geodetic System 1984 UTM fuseau 41 Sud)-.8 E
-(<UTM41W84> : W)110.5 216 Q(orld Geodetic System 1984 UTM fuseau 41)-.8
-E(<UTM42SW84> : W)110.5 228 Q
-(orld Geodetic System 1984 UTM fuseau 42 Sud)-.8 E(<UTM42W84> : W)110.5
-240 Q(orld Geodetic System 1984 UTM fuseau 42)-.8 E(<UTM43SW84> : W)
-110.5 252 Q(orld Geodetic System 1984 UTM fuseau 43 Sud)-.8 E
-(<UTM43W84> : W)110.5 264 Q(orld Geodetic System 1984 UTM fuseau 43)-.8
-E(<UTM44SW84> : W)110.5 276 Q
-(orld Geodetic System 1984 UTM fuseau 44 Sud)-.8 E(<UTM44W84> : W)110.5
-288 Q(orld Geodetic System 1984 UTM fuseau 44)-.8 E(<UTM45SW84> : W)
-110.5 300 Q(orld Geodetic System 1984 UTM fuseau 45 Sud)-.8 E
-(<UTM45W84> : W)110.5 312 Q(orld Geodetic System 1984 UTM fuseau 45)-.8
-E(<UTM46SW84> : W)110.5 324 Q
-(orld Geodetic System 1984 UTM fuseau 46 Sud)-.8 E(<UTM46W84> : W)110.5
-336 Q(orld Geodetic System 1984 UTM fuseau 46)-.8 E(<UTM47SW84> : W)
-110.5 348 Q(orld Geodetic System 1984 UTM fuseau 47 Sud)-.8 E
-(<UTM47W84> : W)110.5 360 Q(orld Geodetic System 1984 UTM fuseau 47)-.8
-E(<UTM48SW84> : W)110.5 372 Q
-(orld Geodetic System 1984 UTM fuseau 48 Sud)-.8 E(<UTM48W84> : W)110.5
-384 Q(orld Geodetic System 1984 UTM fuseau 48)-.8 E(<UTM49SW84> : W)
-110.5 396 Q(orld Geodetic System 1984 UTM fuseau 49 Sud)-.8 E
-(<UTM49W84> : W)110.5 408 Q(orld Geodetic System 1984 UTM fuseau 49)-.8
-E(<UTM50SW84> : W)110.5 420 Q
-(orld Geodetic System 1984 UTM fuseau 50 Sud)-.8 E(<UTM50W84> : W)110.5
-432 Q(orld Geodetic System 1984 UTM fuseau 50)-.8 E(<UTM51SW84> : W)
-110.5 444 Q(orld Geodetic System 1984 UTM fuseau 51 Sud)-.8 E
-(<UTM51W84> : W)110.5 456 Q(orld Geodetic System 1984 UTM fuseau 51)-.8
-E(<UTM52SW84> : W)110.5 468 Q
-(orld Geodetic System 1984 UTM fuseau 52 Sud)-.8 E(<UTM52W84> : W)110.5
-480 Q(orld Geodetic System 1984 UTM fuseau 52)-.8 E(<UTM53SW84> : W)
-110.5 492 Q(orld Geodetic System 1984 UTM fuseau 53 Sud)-.8 E
-(<UTM53W84> : W)110.5 504 Q(orld Geodetic System 1984 UTM fuseau 53)-.8
-E(<UTM54SW84> : W)110.5 516 Q
-(orld Geodetic System 1984 UTM fuseau 54 Sud)-.8 E(<UTM54W84> : W)110.5
-528 Q(orld Geodetic System 1984 UTM fuseau 54)-.8 E(<UTM55SW84> : W)
-110.5 540 Q(orld Geodetic System 1984 UTM fuseau 55 Sud)-.8 E
-(<UTM55W84> : W)110.5 552 Q(orld Geodetic System 1984 UTM fuseau 55)-.8
-E(<UTM56SW84> : W)110.5 564 Q
-(orld Geodetic System 1984 UTM fuseau 56 Sud)-.8 E(<UTM56W84> : W)110.5
-576 Q(orld Geodetic System 1984 UTM fuseau 56)-.8 E(<UTM57SW84> : W)
-110.5 588 Q(orld Geodetic System 1984 UTM fuseau 57 Sud)-.8 E
-(<UTM57W84> : W)110.5 600 Q(orld Geodetic System 1984 UTM fuseau 57)-.8
-E(<UTM58SW84> : W)110.5 612 Q
-(orld Geodetic System 1984 UTM fuseau 58 Sud)-.8 E(<UTM58W84> : W)110.5
-624 Q(orld Geodetic System 1984 UTM fuseau 58)-.8 E(<UTM59SW84> : W)
-110.5 636 Q(orld Geodetic System 1984 UTM fuseau 59 Sud)-.8 E
-(<UTM59W84> : W)110.5 648 Q(orld Geodetic System 1984 UTM fuseau 59)-.8
-E(<UTM60SW84> : W)110.5 660 Q
-(orld Geodetic System 1984 UTM fuseau 60 Sud)-.8 E(<UTM60W84> : W)110.5
-672 Q(orld Geodetic System 1984 UTM fuseau 60)-.8 E(<W)110.5 684 Q
-(ALL78UTM1S> : W)-1.2 E(allis-Uv)-.8 E(ea 1978 \(MOP78\) UTM 1 SUD)-.15
-E(\255--------------------------------------------------------)110.5 708
-Q -1.11(Va)110.5 720 S(rious Non-U.S. Coordinate Systems,)1.11 E
-(MB-System 5.0)72 768 Q(13 March 2014)140.11 E(150)188.45 E 0 Cg EP
-%%Page: 151 151
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F
-(\255--------------------------------------------------------)110.5 84 Q
-(<CH1903> : Swiss Coordinate System)110.5 96 Q(<madag)110.5 108 Q
-(ascar> : Laborde grid for Madag)-.05 E(ascar)-.05 E(<ne)110.5 120 Q
-(w_zealand> : Ne)-.25 E 2.5(wZ)-.25 G
-(ealand Map Grid \(NZMG\) \255 Projection unique to N.Z. so all f)-2.5 E
-(actors \214x)-.1 E(ed)-.15 E
-(\255--------------------------------------------------------)110.5 132
-Q(Secondary grids DMA TM8358.1, p. 4.3)110.5 144 Q
-(\255--------------------------------------------------------)110.5 156
-Q(<bwi> : British W)110.5 168 Q(est Indies)-.8 E
-(<costa-n> : Costa Rica Norte)110.5 180 Q(<costa-s> : Costa Rica Sud)
-110.5 192 Q(<cuba-n> : Cuba Norte)110.5 204 Q(<cuba-s> : Cuba Sud)110.5
-216 Q(<domin_rep> : Dominican Republic)110.5 228 Q(<e)110.5 240 Q
-(gypt-1> : Egypt)-.15 E(<e)110.5 252 Q(gypt-2> : Egypt)-.15 E(<e)110.5
-264 Q(gypt-3> : Egypt)-.15 E(<e)110.5 276 Q(gypt-4> : Egypt)-.15 E(<e)
-110.5 288 Q(gypt-5> : Egypt)-.15 E(<el_sal> : El Salv)110.5 300 Q(ador)
--.25 E(<guat-n> : Guatemala Norte)110.5 312 Q(<guat-s> : Guatemala Sud)
-110.5 324 Q(<haiti> : Haiti)110.5 336 Q(<hond-n> : Honduras Norte)110.5
-348 Q(<hond-s> : Honduras Sud)110.5 360 Q(<le)110.5 372 Q -.25(va)-.25 G
-(nt> : Le).25 E -.25(va)-.25 G(nt).25 E(<nica-n> : Nicaragua Norte)110.5
-384 Q(<nica-s> : Nicaragua Sud)110.5 396 Q
-(<nw-africa> : Northwest Africa)110.5 408 Q(<palestine> : P)110.5 420 Q
-(alestine)-.15 E(<panama> : P)110.5 432 Q(anama)-.15 E
-(\255--------------------------------------------------------)110.5 456
-Q(other grids in DMA TM8358.1)110.5 468 Q
-(\255--------------------------------------------------------)110.5 480
-Q(<bng> : British National Grid)110.5 492 Q(<malay> : W)110.5 504 Q
-(est Malaysian RSO Grid)-.8 E(<india-I> : India Zone I)110.5 516 Q
-(<india-IIA> : India Zone IIA)110.5 528 Q(<india-IIB> : India Zone IIB)
-110.5 540 Q(<india-IIIA> : India Zone IIIA)110.5 552 Q
-(<india-IIIB> : India Zone IIIB)110.5 564 Q(<india-IV)110.5 576 Q
-(A> : India Zone IV)-1.35 E(A)-1.35 E(<india-IVB> : India Zone IVB)110.5
-588 Q(<ce)110.5 600 Q(ylon> : Ce)-.15 E(ylon Belt)-.15 E
-(<irish> : Irish T)110.5 612 Q(ransv)-.35 E(erse Mercator Grid)-.15 E
-(<neiez> : Netherlands East Indies Equitorial Zone)110.5 624 Q
-(<n-alger> : Nord Algerie Grid)110.5 636 Q(<n-maroc> : Nord Maroc Grid)
-110.5 648 Q(<n-tunis> : Nord T)110.5 660 Q(unisie Grid)-.45 E
-(<s-alger> : Sud Algerie Grid)110.5 672 Q(<s-maroc> : Sud Maroc Grid)
-110.5 684 Q(<s-tunis> : Sud T)110.5 696 Q(unisie Grid)-.45 E
-(\255--------------------------------------------------------)110.5 720
-Q(MB-System 5.0)72 768 Q(13 March 2014)140.11 E(151)188.45 E 0 Cg EP
-%%Page: 152 152
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.06(mbmosaic\(1\) MB-System)72 48 R 147.06
-(5.0 mbmosaic\(1\))2.5 F(Gauss Krue)110.5 84 Q(ger Grids for German)-.15
-E(y)-.15 E(\255--------------------------------------------------------)
-110.5 96 Q(<gk2-d> : Gauss Krue)110.5 108 Q(ger Grid for German)-.15 E
-(y)-.15 E(<gk3-d> : Gauss Krue)110.5 120 Q(ger Grid for German)-.15 E(y)
--.15 E(<gk4-d> : Gauss Krue)110.5 132 Q(ger Grid for German)-.15 E(y)
--.15 E(MB-System 5.0)72 768 Q(13 March 2014)140.11 E(152)188.45 E 0 Cg
-EP
-%%Trailer
-end
-%%EOF
diff --git a/src/ps/mbnavadjust.ps b/src/ps/mbnavadjust.ps
deleted file mode 100644
index d2f9202..0000000
--- a/src/ps/mbnavadjust.ps
+++ /dev/null
@@ -1,2283 +0,0 @@
-%!PS-Adobe-3.0
-%%Creator: groff version 1.19.2
-%%CreationDate: Wed Jul  1 12:29:30 2015
-%%DocumentNeededResources: font Times-Roman
-%%+ font Times-Bold
-%%+ font Times-Italic
-%%DocumentSuppliedResources: procset grops 1.19 2
-%%Pages: 19
-%%PageOrder: Ascend
-%%DocumentMedia: Default 612 792 0 () ()
-%%Orientation: Portrait
-%%EndComments
-%%BeginDefaults
-%%PageMedia: Default
-%%EndDefaults
-%%BeginProlog
-%%BeginResource: procset grops 1.19 2
-%!PS-Adobe-3.0 Resource-ProcSet
-/setpacking where{
-pop
-currentpacking
-true setpacking
-}if
-/grops 120 dict dup begin
-/SC 32 def
-/A/show load def
-/B{0 SC 3 -1 roll widthshow}bind def
-/C{0 exch ashow}bind def
-/D{0 exch 0 SC 5 2 roll awidthshow}bind def
-/E{0 rmoveto show}bind def
-/F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def
-/G{0 rmoveto 0 exch ashow}bind def
-/H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/I{0 exch rmoveto show}bind def
-/J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def
-/K{0 exch rmoveto 0 exch ashow}bind def
-/L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/M{rmoveto show}bind def
-/N{rmoveto 0 SC 3 -1 roll widthshow}bind def
-/O{rmoveto 0 exch ashow}bind def
-/P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/Q{moveto show}bind def
-/R{moveto 0 SC 3 -1 roll widthshow}bind def
-/S{moveto 0 exch ashow}bind def
-/T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/SF{
-findfont exch
-[exch dup 0 exch 0 exch neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/MF{
-findfont
-[5 2 roll
-0 3 1 roll
-neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/level0 0 def
-/RES 0 def
-/PL 0 def
-/LS 0 def
-/MANUAL{
-statusdict begin/manualfeed true store end
-}bind def
-/PLG{
-gsave newpath clippath pathbbox grestore
-exch pop add exch pop
-}bind def
-/BP{
-/level0 save def
-1 setlinecap
-1 setlinejoin
-72 RES div dup scale
-LS{
-90 rotate
-}{
-0 PL translate
-}ifelse
-1 -1 scale
-}bind def
-/EP{
-level0 restore
-showpage
-}def
-/DA{
-newpath arcn stroke
-}bind def
-/SN{
-transform
-.25 sub exch .25 sub exch
-round .25 add exch round .25 add exch
-itransform
-}bind def
-/DL{
-SN
-moveto
-SN
-lineto stroke
-}bind def
-/DC{
-newpath 0 360 arc closepath
-}bind def
-/TM matrix def
-/DE{
-TM currentmatrix pop
-translate scale newpath 0 0 .5 0 360 arc closepath
-TM setmatrix
-}bind def
-/RC/rcurveto load def
-/RL/rlineto load def
-/ST/stroke load def
-/MT/moveto load def
-/CL/closepath load def
-/Fr{
-setrgbcolor fill
-}bind def
-/setcmykcolor where{
-pop
-/Fk{
-setcmykcolor fill
-}bind def
-}if
-/Fg{
-setgray fill
-}bind def
-/FL/fill load def
-/LW/setlinewidth load def
-/Cr/setrgbcolor load def
-/setcmykcolor where{
-pop
-/Ck/setcmykcolor load def
-}if
-/Cg/setgray load def
-/RE{
-findfont
-dup maxlength 1 index/FontName known not{1 add}if dict begin
-{
-1 index/FID ne{def}{pop pop}ifelse
-}forall
-/Encoding exch def
-dup/FontName exch def
-currentdict end definefont pop
-}bind def
-/DEFS 0 def
-/EBEGIN{
-moveto
-DEFS begin
-}bind def
-/EEND/end load def
-/CNT 0 def
-/level1 0 def
-/PBEGIN{
-/level1 save def
-translate
-div 3 1 roll div exch scale
-neg exch neg exch translate
-0 setgray
-0 setlinecap
-1 setlinewidth
-0 setlinejoin
-10 setmiterlimit
-[]0 setdash
-/setstrokeadjust where{
-pop
-false setstrokeadjust
-}if
-/setoverprint where{
-pop
-false setoverprint
-}if
-newpath
-/CNT countdictstack def
-userdict begin
-/showpage{}def
-/setpagedevice{}def
-}bind def
-/PEND{
-countdictstack CNT sub{end}repeat
-level1 restore
-}bind def
-end def
-/setpacking where{
-pop
-setpacking
-}if
-%%EndResource
-%%EndProlog
-%%BeginSetup
-%%BeginFeature: *PageSize Default
-<< /PageSize [ 612 792 ] /ImagingBBox null >> setpagedevice
-%%EndFeature
-%%IncludeResource: font Times-Roman
-%%IncludeResource: font Times-Bold
-%%IncludeResource: font Times-Italic
-grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72
-def/PL 792 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron/Zcaron
-/scaron/zcaron/Ydieresis/trademark/quotesingle/Euro/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/space/exclam/quotedbl/numbersign/dollar/percent
-/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen
-/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon
-/semicolon/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O
-/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright/circumflex
-/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y
-/z/braceleft/bar/braceright/tilde/.notdef/quotesinglbase/guillemotleft
-/guillemotright/bullet/florin/fraction/perthousand/dagger/daggerdbl
-/endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut
-/dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash
-/quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen
-/brokenbar/section/dieresis/copyright/ordfeminine/guilsinglleft
-/logicalnot/minus/registered/macron/degree/plusminus/twosuperior
-/threesuperior/acute/mu/paragraph/periodcentered/cedilla/onesuperior
-/ordmasculine/guilsinglright/onequarter/onehalf/threequarters
-/questiondown/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE
-/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex
-/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis
-/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn
-/germandbls/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla
-/egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis
-/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide/oslash
-/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis]def
-/Times-Italic at 0 ENC0/Times-Italic RE/Times-Bold at 0 ENC0/Times-Bold RE
-/Times-Roman at 0 ENC0/Times-Roman RE
-%%EndSetup
-%%Page: 1 1
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mbna)72 48 Q -.25(va)-.2 G 137.51
-(djust\(1\) MB-System).25 F 137.51(5.0 mbna)2.5 F -.25(va)-.2 G
-(djust\(1\)).25 E/F1 10.95/Times-Bold at 0 SF -.219(NA)72 84 S(ME).219 E/F2
-10/Times-Bold at 0 SF(mbna)108 96 Q -.1(va)-.25 G(djust).1 E F0 2.711<ad50>
-2.711 G .211(ackage that solv)-2.861 F .211(es for optimal na)-.15 F
-(vig)-.2 E .211(ation by matching bath)-.05 F .21(ymetry of o)-.05 F
--.15(ve)-.15 G .21(rlapping sw).15 F(aths.)-.1 E F1(VERSION)72 124.8 Q
-F0 -1.11(Ve)108 136.8 S(rsion 5.0)1.11 E F1(SYNOPSIS)72 165.6 Q F2(mbna)
-108 177.6 Q -.1(va)-.25 G(djust).1 E F0([)2.5 E F2
-<ad5620ad4820ad4420ad52>A F0(])A F1(DESCRIPTION)72 206.4 Q F2(MBna)108
-218.4 Q -.1(va)-.25 G(djust).1 E F0 .387(is an interacti)2.887 F .687
--.15(ve g)-.25 H .387(raphical program used to adjust sw).15 F .387
-(ath data na)-.1 F(vig)-.2 E .388(ation by matching bath)-.05 F(y-)-.05
-E .895(metric features in o)108 230.4 R -.15(ve)-.15 G .894
-(rlapping and crossing sw).15 F .894(aths. The primary purpose of)-.1 F
-F2(mbna)3.394 E -.1(va)-.25 G(djust).1 E F0 .894(is to eliminate)3.394 F
-(relati)108 242.4 Q .379 -.15(ve n)-.25 H -.2(av).15 G(ig).2 E .079
-(ational errors in sw)-.05 F .079(ath data obtained from poorly na)-.1 F
-(vig)-.2 E .079(ated sonars. Submer)-.05 F .08(ged platforms such)-.18 F
-1.359(as to)108 254.4 R 1.359(wed v)-.25 F 1.359
-(ehicles, remotely operated v)-.15 F 1.358(ehicles \(R)-.15 F -.5(OV)-.4
-G 1.358(s\) and autonomous underw).5 F 1.358(ater v)-.1 F 1.358
-(ehicles \(A)-.15 F 1.358(UVs\) are)-.55 F 1.244(frequently not na)108
-266.4 R(vig)-.2 E 1.244(ated with accurac)-.05 F 3.744(ye)-.15 G(qui)
--3.744 E -.25(va)-.25 G 1.245(lent to the lateral resolution of sw).25 F
-1.245(ath bath)-.1 F 1.245(ymetry obtained)-.05 F .417
-(with high frequenc)108 278.4 R 2.917(ys)-.15 G .416
-(onars operated close to the sea\215oor)-2.917 F 2.916(.T)-.55 G .416
-(his is)-2.916 F .416(particularly true for systems that depend)5.416 F
-.054(on ultra-short baseline na)108 290.4 R(vig)-.2 E .054
-(ation \(USBL\) or on inertial na)-.05 F(vig)-.2 E .054
-(ation \(as opposed to long baseline \(LBL\) na)-.05 F(v-)-.2 E(ig)108
-302.4 Q .993(ation obtained using transponder netw)-.05 F .993
-(orks\). Man)-.1 F 3.493(yo)-.15 G .993(ld, pre-GPS surv)-3.493 F -.15
-(ey)-.15 G 3.493(sw).15 G .993(ith hull mounted sonars also)-3.493 F
-(suf)108 314.4 Q 1(fer from poor na)-.25 F(vig)-.2 E 1(ation relati)-.05
-F 1.3 -.15(ve t)-.25 H 3.5(ot).15 G 1.001(he resolution of the sw)-3.5 F
-1.001(ath bath)-.1 F(ymetry)-.05 E 3.501(,a)-.65 G 1.001
-(nd can thus be impro)-3.501 F -.15(ve)-.15 G(d).15 E .908
-(with application of this tool.)108 326.4 R F2(MBna)3.408 E -.1(va)-.25
-G(djust).1 E F0 .908(also w)3.408 F .908(orks well to co-re)-.1 F .908
-(gister surv)-.15 F -.15(ey)-.15 G 3.408(sa).15 G 3.408(td)-3.408 G(if)
--3.408 E .908(ferent scales. F)-.25 F(or)-.15 E .529
-(instance, our initial use of this tool in)108 338.4 R -.2(vo)-.4 G(lv)
-.2 E .529(ed co-re)-.15 F .529(gistering a deep-to)-.15 F .53
-(wed Reson 8101 multibeam surv)-.25 F .83 -.15(ey o)-.15 H(f).15 E
-(the Loihi Seamount summit \(of)108 350.4 Q(fshore Ha)-.25 E -.1(wa)-.15
-G(ii\) with a hull mounted Simrad EM300 multibeam surv).1 E -.15(ey)-.15
-G(.)-.5 E .486(When sw)108 374.4 R .486(ath surv)-.1 F -.15(ey)-.15 G
-2.986(sa).15 G .486(re poorly na)-2.986 F(vig)-.2 E .485
-(ated, features clearly imaged by the sonar may not match in o)-.05 F
--.15(ve)-.15 G(rlap-).15 E .171(ping and crossing sw)108 386.4 R 2.671
-(aths. Ho)-.1 F(we)-.25 E -.15(ve)-.25 G .972 -.4(r, b).15 H 2.672(ys).4
-G .172(ystematically determining the positional of)-2.672 F .172
-(fsets between matching)-.25 F 1.016(features throughout a surv)108
-398.4 R -.15(ey)-.15 G 3.516(,i)-.5 G 3.516(ti)-3.516 G 3.516(sp)-3.516
-G 1.016(ossible to solv)-3.516 F 1.016(e, or in)-.15 F -.15(ve)-.4 G
-1.016(rt, for a na).15 F(vig)-.2 E 1.016
-(ation model which is consistent)-.05 F .627(with the original na)108
-410.4 R(vig)-.2 E .628(ational constraints, satis\214es the requirement\
- of reasonableness, and also causes fea-)-.05 F .205(tures in o)108
-422.4 R -.15(ve)-.15 G .205(rlapping sw).15 F .205
-(aths to match within the sonar')-.1 F 2.704(sr)-.55 G .204
-(esolution. The analysis and adjustment can be lim-)-2.704 F .511
-(ited to lateral \(x and y or longitude and latitude\) of)108 434.4 R
-.512(fsets when all v)-.25 F .512(ertical of)-.15 F .512(fsets ha)-.25 F
-.812 -.15(ve b)-.2 H .512(een corrected prior).15 F 1.044
-(to importation into)108 446.4 R F2(MBna)3.543 E -.1(va)-.25 G(djust).1
-E F0 1.043(\(e.g. tidal corrections ha)3.543 F 1.343 -.15(ve b)-.2 H
-1.043(een made\).).15 F 1.043(Otherwise, the of)6.043 F 1.043
-(fset analysis)-.25 F(and in)108 458.4 Q -.15(ve)-.4 G
-(rsions are three dimensional.).15 E .507(Early attempts to address thi\
-s problem \(e.g. Nishimura et al. [1988]\) focused on automating the id\
-enti\214ca-)108 482.4 R 1.225(tion of matching features and their na)108
-494.4 R(vig)-.2 E 1.225(ational of)-.05 F 1.224
-(fsets. The automated approach is problematic because)-.25 F .507
-(sea\215oor features are comple)108 506.4 R .508
-(x, and the cross correlation function of matching features often e)-.15
-F .508(xhibits multi-)-.15 F .146(ple local minima. Our approach is to \
-automate the identi\214cation of matching features and the ultimate sol\
-u-)108 518.4 R .354
-(tion for an optimal indenti\214cation while depending on interacti)108
-530.4 R .655 -.15(ve d)-.25 H .355(etermination of the na).15 F(vig)-.2
-E .355(ational of)-.05 F(fsets.)-.25 E 2.438 -.8(We h)108 542.4 T -2.25
--.2(av e).8 H .837
-(not found an automatic algorithm that can reliably replace the human e)
-3.537 F .837(ye and brain in correctly)-.15 F
-(lining up real sea\215oor features.)108 554.4 Q F2(MBna)108 578.4 Q -.1
-(va)-.25 G(djust).1 E F0 .308(operates within the conte)2.807 F .308
-(xt of the)-.15 F F2(mbpr)2.808 E(ocess)-.18 E F0 .308
-(parallel processing scheme, b)2.808 F .308(ut it should used)-.2 F .312
-(on data for which the initial na)108 590.4 R(vig)-.2 E .311
-(ation processing \(e.g.)-.05 F F2(mbna)2.811 E -.1(ve)-.25 G(dit).1 E
-F0 .311(is complete.)2.811 F .311(When sw)5.311 F .311
-(ath data \214les are)-.1 F .32(imported into)108 602.4 R F2(mbna)2.82 E
--.1(va)-.25 G(djust).1 E F0 2.82(,t)C .32(he data is tak)-2.82 F .32
-(en from processed \214les generated by)-.1 F F2(mbpr)2.82 E(ocess)-.18
-E F0(whene)2.82 E -.15(ve)-.25 G 2.82(rp).15 G(os-)-2.82 E .191
-(sible \(when those \214les e)108 614.4 R .191
-(xist\). If no processed \214le e)-.15 F .191(xists, the ra)-.15 F 2.69
-(wd)-.15 G .19(ata \214le is used. When the processing with)-2.69 F F2
-(mbna)108 626.4 Q -.1(va)-.25 G(djust).1 E F0 .525
-(is completed and an optimal na)3.025 F(vig)-.2 E .525
-(ation solution is achie)-.05 F -.15(ve)-.25 G .525(d, ne).15 F 3.025
-(wn)-.25 G -.2(av)-3.025 G(ig).2 E .525(ation \214les are gener)-.05 F
-(-)-.2 E .368(ated \(".na#" \214les, see belo)108 638.4 R 2.868(wf)-.25
-G .368(or full description\) which supercede the ".n)-2.868 F -.15(ve)
--.4 G 2.868<228c>.15 G .368(les generated by)-2.868 F F2(mbna)2.868 E
--.1(ve)-.25 G(dit).1 E F0(.)A(Rerunning)108 650.4 Q F2(mbpr)2.82 E
-(ocess)-.18 E F0 .32(will mer)2.82 F .32(ge the ne)-.18 F 2.82(wn)-.25 G
--.2(av)-2.82 G(ig).2 E .32(ation into a ne)-.05 F 2.821(ws)-.25 G .321
-(et of processed \214les. Once a sw)-2.821 F .321(ath \214le is)-.1 F
-.085(processed with)108 662.4 R F2(mbna)2.585 E -.1(va)-.25 G(djust).1 E
-F0 2.585(,a)C .385 -.15(ny f)-2.585 H .084
-(urther attempts to process the na).15 F(vig)-.2 E .084(ation with)-.05
-F F2(mbna)2.584 E -.1(ve)-.25 G(dit).1 E F0 .084(will only pro-)2.584 F
-.336(duce na)108 674.4 R(vig)-.2 E .336
-(ation \214les that are ignored by)-.05 F F2(mbpr)2.837 E(ocess)-.18 E
-F0 2.837(.T)C .337(his beha)-2.837 F .337(vior can be re)-.2 F -.15(ve)
--.25 G .337(rsed manually using).15 F F2(mbset)2.837 E F0(,)A -.2(bu)108
-686.4 S 2.5(tt).2 G
-(hen the user will unnecessarily complicating his or her ef)-2.5 E
-(forts.)-.25 E 6.37(Ac)108 710.4 S 3.87(ompanion program)-6.37 F F2
-(mbna)6.37 E -.1(va)-.25 G(djustmer).1 E(ge)-.1 E F0 3.87(can add)6.37 F
-F2(mbna)6.37 E -.1(va)-.25 G(djust).1 E F0 3.87
-(projects together or or modify)6.37 F F2(mbna)108 722.4 Q -.1(va)-.25 G
-(djust).1 E F0(prooject settings.)2.5 E(MB-System 5.0)72 768 Q
-(22 April 2015)142.605 E(1)200.945 E 0 Cg EP
-%%Page: 2 2
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mbna)72 48 Q -.25(va)-.2 G 137.51
-(djust\(1\) MB-System).25 F 137.51(5.0 mbna)2.5 F -.25(va)-.2 G
-(djust\(1\)).25 E .748(The in)108 84 R -.15(ve)-.4 G .748
-(rsion for an optimal na).15 F(vig)-.2 E .749(ation which \214ts the of)
--.05 F .749(fsets identi\214ed at matching features must also be)-.25 F
-.751(reasonable. This is achie)108 96 R -.15(ve)-.25 G 3.251(db).15 G
-3.251(ym)-3.251 G .751
-(inimizing perturbations to speed and acceleration in the in)-3.251 F
--.15(ve)-.4 G 3.25(rsion. This).15 F .882
-(approach of penalizing \214rst and second deri)108 108 R -.25(va)-.25 G
-(ti).25 E -.15(ve)-.25 G 3.382(sw).15 G .882(ithin a linear in)-3.382 F
--.15(ve)-.4 G .882(rse problem is common within the).15 F(geoph)108 120
-Q(ysical in)-.05 E -.15(ve)-.4 G(rse theory literature \(e.g. P).15 E
-(ark)-.15 E(er [1994]\).)-.1 E .972(Users are advised that)108 144 R/F1
-10/Times-Bold at 0 SF(mbna)3.472 E -.1(va)-.25 G(djust).1 E F0 .971
-(is complicated in both conception and implementation. W)3.472 F 3.471
-(es)-.8 G(trongly)-3.471 E .814
-(recommend that users read all of the documentation pro)108 156 R .814
-(vided belo)-.15 F 3.314(wp)-.25 G .814
-(rior to attempting a \214rst use of this)-3.314 F(softw)108 168 Q 2.748
-(are. The)-.1 F .248(meaning and use of the indi)2.748 F .247
-(vidual widgets and windo)-.25 F .247(ws emplo)-.25 F .247
-(yed in the graphical interf)-.1 F(ace)-.1 E .206(is pro)108 180 R .206
-(vided in the)-.15 F F1(INTERA)2.706 E .206(CTIVE CONTR)-.55 F(OLS)-.3 E
-F0 .206(section. The)2.706 F F1 .207(USING MBN)2.707 F -.95 -1.45(AV A)
--.2 H(DJUST)1.45 E F0 .207(section pro)2.707 F(vides)-.15 E 3.446(am)108
-192 S .946(ore coherent discussion of ho)-3.446 F 3.445(wt)-.25 G 3.445
-(ou)-3.445 G(se)-3.445 E F1(mbna)3.445 E -.1(va)-.25 G(djust).1 E F0
-3.445(,h)C 1.445 -.25(ow t)-3.445 H .945(his program interacts with the)
-.25 F F1(mbpr)3.445 E(ocess)-.18 E F0(parallel processing scheme, and t\
-he underlying concepts and algorithms.)108 204 Q/F2 10.95/Times-Bold at 0
-SF -.548(AU)72 232.8 S(THORSHIP).548 E F0(Da)108 244.8 Q(vid W)-.2 E 2.5
-(.C)-.92 G(aress \(caress at mbari.or)-2.5 E(g\))-.18 E(Montere)113 256.8 Q
-2.5(yB)-.15 G(ay Aquarium Research Institute)-2.5 E
-(Dale N. Chayes \(dale at ldeo.columbia.edu\))108 268.8 Q
-(Lamont-Doherty Earth Observ)113 280.8 Q(atory)-.25 E F2(OPTIONS)72
-309.6 Q F1<ad48>108 321.6 Q F0 .162(This "help" \215ag cause the progra\
-m to print out a description of its operation and then e)22.52 F .162
-(xit immedi-)-.15 F(ately)144 333.6 Q(.)-.65 E F1<ad44>108 350.4 Q F0
-(Normally)23.08 E(,)-.65 E F1(mbna)3.051 E -.1(va)-.25 G(djust).1 E F0
-.551(uses a white background for the interacti)3.051 F .851 -.15(ve p)
--.25 H .55(lots. This option causes the).15 F
-(program to use a black background for the plots.)144 362.4 Q F1<ad52>
-108 379.2 Q F0 1.035(This option causes)23.08 F F1(mbna)3.535 E -.1(va)
--.25 G(djust).1 E F0 1.035(to discard all na)3.535 F(vig)-.2 E 1.036
-(ation ties, set all crossings to "unanalyzed")-.05 F .083
-(status, and to sa)144 391.2 R .383 -.15(ve t)-.2 H .083
-(he project in this pristine state. Only use this option if you really)
-.15 F 2.582(,r)-.65 G .082(eally w)-2.582 F .082(ant to)-.1 F(start o)
-144 403.2 Q -.15(ve)-.15 G -.55(r.).15 G F1<ad56>108 420 Q F0(Normally)
-23.08 E(,)-.65 E F1(mbna)5.042 E -.1(va)-.25 G(djust).1 E F0 2.543
-(outputs nothing to the stderr stream.)5.042 F 2.543(If the)7.543 F F1
-<ad56>5.043 E F0 2.543(\215ag is gi)5.043 F -.15(ve)-.25 G 2.543
-(n, then).15 F F1(mbna)144 432 Q -.1(va)-.25 G(djust).1 E F0 -.1(wo)
-3.613 G 1.113(rks in a "v).1 F 1.113
-(erbose" mode and outputs the program v)-.15 F 1.113
-(ersion being used, all error)-.15 F(status messages, and a lar)144 444
-Q(ge amount of other information.)-.18 E F2(INTERA)72 472.8 Q
-(CTIVE CONTR)-.602 E(OLS)-.329 E F1(MBna)87 484.8 Q -.1(va)-.25 G
-(djust W).1 E(indo)-.18 E(w)-.1 E F0(This is the primary windo)108 496.8
-Q 2.5(wo)-.25 G(f)-2.5 E F1(mbna)2.5 E -.1(va)-.25 G(djust).1 E F0(.)A
-F1(File)108 525.6 Q F0 .854(This b)19.89 F .854(utton acti)-.2 F -.25
-(va)-.25 G .854(tes a pulldo).25 F .854(wn menu with six items:)-.25 F
-F1(New)3.354 E F0(,)A F1(Open)3.354 E F0(,)A F1(Close)3.355 E F0(,)A F1
-.855(Import Swath Data)3.355 F F0(,)A(and)144 537.6 Q F1(Quit)2.5 E F0
-(.)A F1(File->New)108 566.4 Q F0 .585
-(This menu item brings up a popup windo)144 578.4 R 3.084(ww)-.25 G .584
-(hich allo)-3.084 F .584(ws the user to specify a ne)-.25 F(w)-.25 E F1
-(mbna)3.084 E -.1(va)-.25 G(djust).1 E F0 .243
-(project. As part of initializing a ne)144 590.4 R 2.743(wp)-.25 G
-(roject,)-2.743 E F1(mbna)2.743 E -.1(va)-.25 G(djust).1 E F0 .244
-(creates a \214le with a ".n)2.744 F .244(vh" suf)-.4 F .244
-(\214x and a)-.25 F(directory with a ".dir" suf)144 602.4 Q(\214x.)-.25
-E F1(File->Open)108 619.2 Q F0 .717
-(This menu item brings up a popup windo)144 631.2 R 3.216(ww)-.25 G .716
-(hich allo)-3.216 F .716(ws the user to open an e)-.25 F(xisting)-.15 E
-F1(mbna)3.216 E -.1(va)-.25 G(d-).1 E(just)144 643.2 Q F0(project.)2.5 E
-F1(File->Close)108 660 Q F0(This menu item causes)144 672 Q F1(mbna)2.5
-E -.1(va)-.25 G(djust).1 E F0(to close the current project.)2.5 E F1
-(File->Import Swath Data)108 688.8 Q F0 .122
-(This menu item brings up a popup windo)144 700.8 R 2.622(ww)-.25 G .122
-(hich allo)-2.622 F .122(ws the user to specify a sw)-.25 F .123
-(ath sonar data \214le)-.1 F .071(or a list of sw)144 712.8 R .071
-(ath \214les to be imported into the current)-.1 F F1(mbna)2.57 E -.1
-(va)-.25 G(djust).1 E F0 2.57(project. This)2.57 F .07(program uses the)
-2.57 F F1(MBIO)144 724.8 Q F0 1.354(library and will read an)3.854 F
-3.854(ys)-.15 G -.1(wa)-3.854 G 1.354(th sonar formats supported by).1 F
-F1(MBIO)3.855 E F0 3.855(.Al)C 1.355(ist of the sw)-3.855 F(ath)-.1 E
-(MB-System 5.0)72 768 Q(22 April 2015)142.605 E(2)200.945 E 0 Cg EP
-%%Page: 3 3
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mbna)72 48 Q -.25(va)-.2 G 137.51
-(djust\(1\) MB-System).25 F 137.51(5.0 mbna)2.5 F -.25(va)-.2 G
-(djust\(1\)).25 E .391(sonar data formats currently supported by)144 84
-R/F1 10/Times-Bold at 0 SF(MBIO)2.891 E F0 .391(and their identi\214er v)
-2.891 F .39(alues is gi)-.25 F -.15(ve)-.25 G 2.89(ni).15 G 2.89(nt)
--2.89 G(he)-2.89 E F1(MBIO)2.89 E F0 .681(manual page.)144 96 R .681
-(If the sw)5.681 F .681(ath sonar data \214le is named using the)-.1 F
-F1(MB-System)3.182 E F0(suf)3.182 E .682(\214x con)-.25 F -.15(ve)-.4 G
-.682(ntion \(for).15 F(-)-.2 E .162(mat 11 \214les end with ".mb11", fo\
-rmat 41 \214les end with ".mb41", etc.\), then the program will auto-)
-144 108 R .275(matically use the appropriate format id; otherwise the f\
-ormat must be set by the user in the format)144 120 R(te)144 132 Q
-(xt box.)-.15 E F1(File->Quit)108 148.8 Q F0 .448(This b)144 160.8 R
-.448(utton causes)-.2 F F1(mbna)2.948 E -.1(va)-.25 G(djust).1 E F0 .447
-(to quit. If a project has been created or opened, that project will)
-2.948 F(be closed before the program quits.)144 172.8 Q F1(Option)108
-189.6 Q F0(This b)5.99 E(utton brings up a pulldo)-.2 E
-(wn menu with one item:)-.25 E F1(Contr)2.5 E(ols)-.18 E F0(.)A F1
-(Option->Contr)108 206.4 Q(ols)-.18 E F0 .242
-(This menu item brings up a dialog windo)144 218.4 R 2.743(ww)-.25 G
-.243(ith se)-2.743 F -.15(ve)-.25 G .243
-(ral slider widgets that set parameters control-).15 F .088(ling ho)144
-230.4 R 2.588(ws)-.25 G -.1(wa)-2.588 G .088
-(th data are imported and displayed.).1 F .088
-(These widgets are discussed in the)5.088 F F1(Contr)2.588 E(ols)-.18 E
-F0(sec-)2.588 E(tion belo)144 242.4 Q -.65(w.)-.25 G(.TP)146.5 254.4 Q
-F1 -.37(Vi)3.326 G(ew).37 E F0 .826(This b)3.326 F .826
-(utton brings up a pulldo)-.2 F .826
-(wn menu with \214fteen items in three groups. This menu)-.25 F .26
-(controls the contents of the list widget in the lo)144 266.4 R .26
-(wer right)-.25 F F1(MBna)2.76 E -.1(va)-.25 G .26(djust W).1 F(indo)
--.18 E(w)-.1 E F0 2.76(.I)C 2.76(fa)-2.76 G(n)-2.76 E F1(mbna)2.76 E -.1
-(va)-.25 G(d-).1 E(just)144 278.4 Q F0 .867
-(project has been created or opened, the)3.367 F F1 .868(Data T)3.368 F
-(able)-.92 E F0 .868(list widget will display a table of items)3.368 F
-.947(controlled by these menu items, and the corresponding menu item wi\
-ll be disabled. Selection of)144 290.4 R
-(another item items will change what is displayed in the)144 302.4 Q F1
-(Data T)2.5 E(able)-.92 E F0(list widget accordingly)2.5 E(.)-.65 E
-1.046(The \214rst group includes the)144 326.4 R F1(Sho)3.546 E 3.546
-(wS)-.1 G(ur)-3.546 E -.1(ve)-.1 G(ys).1 E F0(,)A F1(Sho)3.546 E 3.546
-(wD)-.1 G 1.047(ata Files)-3.546 F F0(,)A F1(Sho)3.547 E 3.547(wD)-.1 G
-1.047(ata File Sections)-3.547 F F0(,)A F1(Sho)3.547 E(w)-.1 E 2.057
-(All Cr)144 338.4 R(ossings)-.18 E F0(,)A F1(Sho)4.557 E 4.557(wA)-.1 G
-2.057(ll Cr)-4.557 F(ossings)-.18 E F0(,)A F1(Sho)4.556 E 4.556(w>)-.1 G
-2.056(25% Cr)-4.556 F(ossings)-.18 E F0(,)A F1(Sho)4.556 E 4.556(w>)-.1
-G 2.056(50% Cr)-4.556 F(ossings)-.18 E F0(,)A F1(Sho)4.556 E(w)-.1 E
--.74(Tr)144 350.4 S(ue Cr).74 E(ossings)-.18 E F0 2.5(,a)C(nd)-2.5 E F1
-(Sho)2.5 E 2.5(wT)-.1 G(ies)-2.68 E F0(items.)2.5 E F1 -.37(Vi)108 367.2
-S(ew->Sho).37 E 2.5(wS)-.1 G(ur)-2.5 E -.1(ve)-.1 G(ys).1 E F0 1.05
-(This menu item causes the)144 379.2 R F1 1.05(Data T)3.55 F(able)-.92 E
-F0 1.051(list widget to display a list of the surv)3.55 F -.15(ey)-.15 G
-3.551(si).15 G 3.551(nt)-3.551 G 1.051(he current)-3.551 F F1(mbna)144
-391.2 Q -.1(va)-.25 G(djust).1 E F0 .18(project. W)2.68 F(ithin)-.4 E F1
-(MBna)2.68 E -.1(va)-.25 G(djust).1 E F0 2.68(,as)C(urv)-2.68 E .48 -.15
-(ey i)-.15 H 2.68(sag).15 G .18(roup of sw)-2.68 F .18
-(ath \214les that are contiguous)-.1 F(in time.)144 403.2 Q F1 -.37(Vi)
-108 420 S(ew->Sho).37 E 2.5(wD)-.1 G(ata Files)-2.5 E F0 .001
-(This menu item causes the)144 432 R F1 .001(Data T)2.501 F(able)-.92 E
-F0 .001(list widget to display a list of the sw)2.501 F .001
-(ath data \214les in the cur)-.1 F(-)-.2 E(rent)144 444 Q F1(mbna)2.5 E
--.1(va)-.25 G(djust).1 E F0(project.)2.5 E F1 -.37(Vi)108 460.8 S
-(ew->Sho).37 E 2.5(wD)-.1 G(ata File Sections)-2.5 E F0 .151
-(This menu item causes the)144 472.8 R F1 .151(Data T)2.651 F(able)-.92
-E F0 .151(list widget to display a list of the sw)2.651 F .151
-(ath data sections in the)-.1 F(current)144 484.8 Q F1(mbna)2.5 E -.1
-(va)-.25 G(djust).1 E F0(project.)2.5 E F1 -.37(Vi)108 501.6 S(ew->Sho)
-.37 E 2.5(wA)-.1 G(ll Cr)-2.5 E(ossings)-.18 E F0 .238
-(This menu item causes the)144 513.6 R F1 .238(Data T)2.738 F(able)-.92
-E F0 .239(list widget to display a list of all the sw)2.738 F .239
-(ath crossings in the)-.1 F(current)144 525.6 Q F1(mbna)2.523 E -.1(va)
--.25 G(djust).1 E F0 2.523(project. When)2.523 F .023
-(this option is set, selecting a list item causes)2.523 F F1(mbna)2.522
-E -.1(va)-.25 G(djust).1 E F0(to)2.522 E
-(load and display the selected selected crossing in the "Na)144 537.6 Q
-2.5(vE)-.2 G(rr" windo)-2.5 E -.65(w.)-.25 G F1 -.37(Vi)108 554.4 S
-(ew->Sho).37 E 2.5(w>)-.1 G(25% Cr)-2.5 E(ossings)-.18 E F0 .238
-(This menu item causes the)144 566.4 R F1 .238(Data T)2.738 F(able)-.92
-E F0 .239(list widget to display a list of all the sw)2.738 F .239
-(ath crossings in the)-.1 F(current)144 578.4 Q F1(mbna)3.542 E -.1(va)
--.25 G(djust).1 E F0 1.042(project for which the tw)3.542 F 3.541(os)-.1
-G 1.041(ections o)-3.541 F -.15(ve)-.15 G 1.041(rlap by more than 25%.)
-.15 F 1.041(When this)6.041 F 1.054
-(option is set, selecting a list item causes)144 590.4 R F1(mbna)3.555 E
--.1(va)-.25 G(djust).1 E F0 1.055
-(to load and display the selected selected)3.555 F(crossing in the "Na)
-144 602.4 Q 2.5(vE)-.2 G(rr" windo)-2.5 E -.65(w.)-.25 G F1 -.37(Vi)108
-619.2 S(ew->Sho).37 E 2.5(w>)-.1 G(50% Cr)-2.5 E(ossings)-.18 E F0 .239
-(This menu item causes the)144 631.2 R F1 .239(Data T)2.739 F(able)-.92
-E F0 .238(list widget to display a list of all the sw)2.739 F .238
-(ath crossings in the)-.1 F(current)144 643.2 Q F1(mbna)3.362 E -.1(va)
--.25 G(djust).1 E F0 .863(project for which the tw)3.362 F 3.363(os)-.1
-G .863(ections o)-3.363 F -.15(ve)-.15 G .863(rlap by more than 50%..)
-.15 F .863(When this)5.863 F 1.055
-(option is set, selecting a list item causes)144 655.2 R F1(mbna)3.555 E
--.1(va)-.25 G(djust).1 E F0 1.054
-(to load and display the selected selected)3.555 F(crossing in the "Na)
-144 667.2 Q 2.5(vE)-.2 G(rr" windo)-2.5 E -.65(w.)-.25 G F1 -.37(Vi)108
-684 S(ew->Sho).37 E 2.5(wT)-.1 G(rue Cr)-3.24 E(ossings)-.18 E F0 .106
-(This menu item causes the)144 696 R F1 .107(Data T)2.607 F(able)-.92 E
-F0 .107(list widget to display a list of all the sw)2.607 F .107
-(ath crossings)-.1 F .107(in the)5.107 F(current)144 708 Q F1(mbna)4.635
-E -.1(va)-.25 G(djust).1 E F0 2.135(project for which the na)4.635 F
-(vig)-.2 E 2.135(ation tracks cross.)-.05 F 2.134
-(When this option is set,)7.134 F .555(selecting a list item causes)144
-720 R F1(mbna)3.055 E -.1(va)-.25 G(djust).1 E F0 .556
-(to load and display the selected selected crossing in the)3.055 F
-(MB-System 5.0)72 768 Q(22 April 2015)142.605 E(3)200.945 E 0 Cg EP
-%%Page: 4 4
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mbna)72 48 Q -.25(va)-.2 G 137.51
-(djust\(1\) MB-System).25 F 137.51(5.0 mbna)2.5 F -.25(va)-.2 G
-(djust\(1\)).25 E("Na)144 84 Q 2.5(vE)-.2 G(rr" windo)-2.5 E -.65(w.)
--.25 G/F1 10/Times-Bold at 0 SF -.37(Vi)108 100.8 S(ew->Sho).37 E 2.5(wT)
--.1 G(ies)-2.68 E F0 .643(This menu item causes the)144 112.8 R F1 .643
-(Data T)3.143 F(able)-.92 E F0 .642
-(list widget to display a list of the tie points in the current)3.143 F
-F1(mbna)144 124.8 Q -.1(va)-.25 G(djust).1 E F0(project.)2.5 E 1.775
-(The second group includes the)144 148.8 R F1(Sho)4.275 E 4.275(wA)-.1 G
-1.775(ll Sur)-4.275 F -.1(ve)-.1 G(ys).1 E F0(,)A F1(Sho)4.275 E 4.276
-(wO)-.1 G 1.776(nly Selected Sur)-4.276 F -.1(ve)-.1 G(y).1 E F0(,)A F1
-(Sho)4.276 E 4.276(wO)-.1 G(nly)-4.276 E .412(Selected File)144 160.8 R
-F0 2.912(,a)C(nd)-2.912 E F1(Sho)2.912 E 2.912(wO)-.1 G .412
-(nly Selected Section)-2.912 F F0 .412
-(items. One of these options is al)2.912 F -.1(wa)-.1 G .412(ys acti).1
-F -.15(ve)-.25 G 2.912(,a).15 G(nd)-2.912 E
-(modi\214es what is displayed in the)144 172.8 Q F1(Data T)2.5 E(able)
--.92 E F0(list.)2.5 E F1 -.37(Vi)108 189.6 S(ew->Sho).37 E 2.5(wA)-.1 G
-(ll Sur)-2.5 E -.1(ve)-.1 G(ys).1 E F0 .86(This menu item allo)144 201.6
-R .86(ws all of the possible items \(\214le, sections, crossings, ties\
-\) to be displayed in)-.25 F(the)144 213.6 Q F1(Data T)2.5 E(able)-.92 E
-F0(list.)2.5 E F1 -.37(Vi)108 230.4 S(ew->Sho).37 E 2.5(wO)-.1 G
-(nly Selected Sur)-2.5 E -.1(ve)-.1 G(ys).1 E F0 .553(This menu item li\
-mits the items \(\214le, sections, crossings, ties\) displayed in the)
-144 242.4 R F1 .553(Data T)3.053 F(able)-.92 E F0 .553(list to)3.053 F
-.87(those associated with the most recently selected surv)144 254.4 R
-1.171 -.15(ey \()-.15 H .871(e.g. a surv).15 F 1.171 -.15(ey s)-.15 H
-.871(elected by clicking in the).15 F F1(Data T)144 266.4 Q(able)-.92 E
-F0(list while the <V)2.5 E(ie)-.6 E(w->Sho)-.25 E 2.5(wS)-.25 G(urv)-2.5
-E -.15(ey)-.15 G(s> option is acti).15 E -.15(ve)-.25 G(\).).15 E F1
--.37(Vi)108 283.2 S(ew->Sho).37 E 2.5(wO)-.1 G(nly Selected File)-2.5 E
-F0 .553(This menu item limits the items \(\214le, sections, crossings, \
-ties\) displayed in the)144 295.2 R F1 .553(Data T)3.053 F(able)-.92 E
-F0 .553(list to)3.053 F .035(those associated with the most recently se\
-lected \214le \(e.g. a \214le selected by clicking in the)144 307.2 R F1
-.035(Data T)2.535 F(a-)-.92 E(ble)144 319.2 Q F0(list while the <V)2.5 E
-(ie)-.6 E(w->Sho)-.25 E 2.5(wF)-.25 G(iles> option is acti)-2.5 E -.15
-(ve)-.25 G(\).).15 E F1 -.37(Vi)108 336 S(ew->Sho).37 E 2.5(wO)-.1 G
-(nly Selected Section)-2.5 E F0 .553(This menu item limits the items \(\
-\214le, sections, crossings, ties\) displayed in the)144 348 R F1 .553
-(Data T)3.053 F(able)-.92 E F0 .553(list to)3.053 F .608(those associat\
-ed with the most recently selected section \(e.g. a section selected by\
- clicking in the)144 360 R F1(Data T)144 372 Q(able)-.92 E F0
-(list while the <V)2.5 E(ie)-.6 E(w->Sho)-.25 E 2.5(wS)-.25 G
-(ections> option is acti)-2.5 E -.15(ve)-.25 G(\).).15 E
-(The third group includes tw)144 396 Q 2.5(oo)-.1 G(ptions:)-2.5 E F1
--.37(Vi)108 412.8 S(ew->V).37 E(isualize Sur)-.37 E -.1(ve)-.1 G(y).1 E
-F0(This option is not acti)144 424.8 Q -.15(ve)-.25 G 2.5(,a).15 G
-(nd is for future use.)-2.5 E F1 -.37(Vi)108 441.6 S(ew->Sho).37 E 2.5
-(wM)-.1 G(odelplot)-2.5 E F0 1.567
-(This option causes an addition "Model Plot" windo)144 453.6 R 4.066(wt)
--.25 G 4.066(ob)-4.066 G 4.066(es)-4.066 G(ho)-4.066 E 1.566
-(wn that displays the na)-.25 F(vig)-.2 E(ation)-.05 E .351(adjustment \
-model as three time series: longitude on top, latitude in the middle, a\
-nd v)144 465.6 R .352(ertical on the)-.15 F(bottom.)144 477.6 Q F1
-(Action)108 494.4 Q F0 .171(This b)7.67 F .171(utton brings up a pulldo)
--.2 F .171(wn menu with nine items:)-.25 F F1 .17(Set File P)2.671 F .17
-(oor Na)-.2 F(vigation)-.25 E F0(,)A F1 .17(Set File Good)2.67 F(Na)144
-506.4 Q(vigation)-.25 E F0(,)A F1 .451(Set File Fixed Na)2.95 F
-(vigation)-.25 E F0(,)A F1 -.5(Au)2.951 G .451(to-Pick Offsets).5 F F0
-(,)A F1 .451(Check f)2.951 F .451(or New Cr)-.25 F(ossings)-.18 E F0(,)A
-F1(Analyze)2.951 E(Cr)144 518.4 Q(ossings)-.18 E F0(,)A F1(Zer)2.5 E 2.5
-(oA)-.18 G(ll Z Offsets)-2.5 E F0(,)A F1(In)2.5 E -.1(ve)-.4 G(rt Na).1
-E(vigation)-.25 E F0 2.5(,a)C(nd)-2.5 E F1 -.25(Ap)2.5 G
-(ply Adjusted Na).25 E(vigation)-.25 E F0(.)A F1(Action->Set File P)108
-535.2 Q(oor Na)-.2 E(vigation)-.25 E F0 .647(This menu item causes)144
-547.2 R F1(mbna)3.147 E -.1(va)-.25 G(djust).1 E F0 .647
-(to treat the na)3.147 F(vig)-.2 E .647(ation of a selected sw)-.05 F
-.647(ath data \214le as poor)-.1 F(.)-.55 E .67
-(This option is only acti)144 559.2 R -.25(va)-.25 G .67(ted when the)
-.25 F F1 .67(Data T)3.17 F(able)-.92 E F0 .67(list widget sho)3.17 F .67
-(ws a list of the imported sw)-.25 F(ath)-.1 E .269
-(\214les and one \214le has been selected by clicking in that list.)144
-571.2 R .269(In the case where no \214les are \214x)5.269 F .269
-(ed, the)-.15 F 1.427(\214nal adjusted na)144 583.2 R(vig)-.2 E 1.428
-(ation model is centered on the a)-.05 F -.15(ve)-.2 G 1.428(rage na).15
-F(vig)-.2 E 1.428(ation of)-.05 F 1.428(fsets required for good)-.25 F
-2.5(\214les. The)144 595.2 R(of)2.5 E
-(fsets tieing to \214les with poor na)-.25 E(vig)-.2 E
-(ation are ignored in calculating the a)-.05 E -.15(ve)-.2 G(rages.).15
-E F1(Action->Set File Good Na)108 612 Q(vigation)-.25 E F0 .509
-(This menu item causes)144 624 R F1(mbna)3.008 E -.1(va)-.25 G(djust).1
-E F0 .508(to treat the na)3.008 F(vig)-.2 E .508(ation of a selected sw)
--.05 F .508(ath data \214le as good,)-.1 F .199(which is in f)144 636 R
-.199(act the def)-.1 F .199(ault state for sw)-.1 F .2
-(ath \214les. This option is only acti)-.1 F -.25(va)-.25 G .2
-(ted when the).25 F F1 .2(Data T)2.7 F(able)-.92 E F0 .972
-(list widget sho)144 648 R .972(ws a list of the imported sw)-.25 F .971
-(ath \214les and one \214le has been selected by clicking in)-.1 F .127
-(that list.)144 660 R .127(In the case where no \214les are \214x)5.127
-F .127(ed, the \214nal adjusted na)-.15 F(vig)-.2 E .128
-(ation model is centered on the)-.05 F -2.25 -.2(av e)144 672 T .45
-(rage na).2 F(vig)-.2 E .45(ation of)-.05 F .45
-(fsets required for good \214les.)-.25 F .449(The of)5.449 F .449
-(fsets tieing to \214les with good na)-.25 F(vig)-.2 E(ation)-.05 E
-(are used in calculating the a)144 684 Q -.15(ve)-.2 G(rages.).15 E F1
-(Action->Set File Fixed Na)108 700.8 Q(vigation)-.25 E F0 .517
-(This menu item causes)144 712.8 R F1(mbna)3.017 E -.1(va)-.25 G(djust)
-.1 E F0 .517(to treat the na)3.017 F(vig)-.2 E .518
-(ation of a selected sw)-.05 F .518(ath data \214le as \214x)-.1 F(ed,)
--.15 E 1.68(which means that all na)144 724.8 R(vig)-.2 E 1.68
-(ation points for this \214le will ha)-.05 F 1.98 -.15(ve z)-.2 H 1.68
-(ero of).15 F 1.68(fsets in the \214nal adjusted)-.25 F(MB-System 5.0)72
-768 Q(22 April 2015)142.605 E(4)200.945 E 0 Cg EP
-%%Page: 5 5
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mbna)72 48 Q -.25(va)-.2 G 137.51
-(djust\(1\) MB-System).25 F 137.51(5.0 mbna)2.5 F -.25(va)-.2 G
-(djust\(1\)).25 E(na)144 84 Q(vig)-.2 E 2.582(ation. Ef)-.05 F(fecti)
--.25 E -.15(ve)-.25 G(ly).15 E 2.582(,a)-.65 G .082(ll of the of)-2.582
-F .082(fsets between \214x)-.25 F .082(ed and un\214x)-.15 F .083
-(ed \214les are tak)-.15 F .083(en up in the adjust-)-.1 F .445
-(ments of the un\214x)144 96 R .444(ed \214les.)-.15 F .444
-(This option is only acti)5.444 F -.25(va)-.25 G .444(ted when the).25 F
-/F1 10/Times-Bold at 0 SF .444(Data T)2.944 F(able)-.92 E F0 .444
-(list widget sho)2.944 F .444(ws a)-.25 F(list of the imported sw)144
-108 Q
-(ath \214les and one \214le has been selected by clicking in that list.)
--.1 E F1(Action->A)108 124.8 Q(uto-Pick Offsets)-.5 E F0 .029
-(This menu item causes)144 136.8 R F1(mbna)2.529 E -.1(va)-.25 G(djust)
-.1 E F0 .029(to automatically pick of)2.529 F .03
-(fsets in all of the unset crossings cur)-.25 F(-)-.2 E .405
-(rently displayed in the)144 148.8 R F1 .404(Data T)2.905 F(able)-.92 E
-F0 2.904(list. If)2.904 F(<V)2.904 E(ie)-.6 E(w->Sho)-.25 E 2.904(wT)
--.25 G .404(rue Crossings> has been selected, then)-3.254 F .935(only t\
-rue crossings are displayed and only the unset true crossings will be a\
-utomatically pick)144 160.8 R(ed.)-.1 E .264
-(In general, unsupervised of)144 172.8 R .264
-(fset picks are frequently erroneous, and use of this e)-.25 F .263
-(xperimental option)-.15 F(is not encouraged.)144 184.8 Q F1
-(Action->Check F)108 201.6 Q(or New Cr)-.25 E(ossings)-.18 E F0 1.234
-(This menu item causes)144 213.6 R F1(mbna)3.734 E -.1(va)-.25 G(djust)
-.1 E F0 1.235(to search for ne)3.734 F 3.735(wc)-.25 G 1.235
-(rossings using the adjusted na)-3.735 F(vig)-.2 E(ation)-.05 E .42
-(from the current in)144 225.6 R -.15(ve)-.4 G .42(rsion. Often, ne).15
-F 2.92(wp)-.25 G .42(laces where sw)-2.92 F .42(aths o)-.1 F -.15(ve)
--.15 G .42(rlap and cross emer).15 F .42(ge as the na)-.18 F(vi-)-.2 E
--.05(ga)144 237.6 S .029(tion is adjusted. The percentage of o).05 F
--.15(ve)-.15 G .029(rlap is also recalculated for all of the e).15 F .03
-(xisting crossings. If)-.15 F(ne)144 249.6 Q 3.436(wt)-.25 G .936
-(rue crossings are found, the user will be unable to perform a ne)-3.436
-F 3.435(wi)-.25 G -1.85 -.4(nv e)-3.435 H .935(rsion until all of the).4
-F(true crossings ha)144 261.6 Q .3 -.15(ve b)-.2 H(een analyzed.).15 E
-F1(Action->Analyze Cr)108 278.4 Q(ossings)-.18 E F0 .699
-(This menu item causes)144 290.4 R F1(mbna)3.199 E -.1(va)-.25 G(djust)
-.1 E F0 .699(to load and display the \214rst crossing in the "Na)3.199 F
-3.2(vE)-.2 G .7(rr" win-)-3.2 F(do)144 302.4 Q -.65(w.)-.25 G F1
-(Action->Zer)108 319.2 Q 2.5(oA)-.18 G(ll Z Offsets)-2.5 E F0 .7
-(This menu item causes)144 331.2 R F1(mbna)3.2 E -.1(va)-.25 G(djust).1
-E F0 .699(to load and display the \214rst crossing in the "Na)3.2 F
-3.199(vE)-.2 G .699(rr" win-)-3.199 F(do)144 343.2 Q -.65(w.)-.25 G F1
-(Action->In)108 360 Q -.1(ve)-.4 G(rt Na).1 E(vigation)-.25 E F0 .549
-(This menu item causes)144 372 R F1(mbna)3.049 E -.1(va)-.25 G(djust).1
-E F0 .549(to in)3.049 F -.15(ve)-.4 G .549(rt for an optimal na).15 F
-(vig)-.2 E .55(ation solution that \214ts the of)-.05 F(f-)-.25 E 1.024
-(sets de\214ned at the na)144 384 R(vig)-.2 E 1.023(ation tie points wh\
-ile minimizing speed and acceleration. This option is)-.05 F .91
-(only acti)144 396 R -.25(va)-.25 G .911
-(ted when all of the true crossings in the current).25 F F1(mbna)3.411 E
--.1(va)-.25 G(djust).1 E F0 .911(project ha)3.411 F 1.211 -.15(ve b)-.2
-H .911(een ana-).15 F(lyzed interacti)144 408 Q -.15(ve)-.25 G(ly).15 E
-(.)-.65 E F1(Action->A)108 424.8 Q(pply Adjusted Na)-.25 E(vigation)-.25
-E F0 1.398(This menu item causes)144 436.8 R F1(mbna)3.898 E -.1(va)-.25
-G(djust).1 E F0 1.398(to e)3.898 F 1.398(xport the adjusted na)-.15 F
-(vig)-.2 E 1.397(ation model from the current)-.05 F(in)144 448.8 Q -.15
-(ve)-.4 G .79(rsion to the sw).15 F .791
-(ath \214les in the project.This option is only acti)-.1 F -.25(va)-.25
-G .791(ted when the in).25 F -.15(ve)-.4 G .791(rsion is cur).15 F(-)-.2
-E .135(rent, meaning that no ne)144 460.8 R 2.635(wd)-.25 G .135(ata ha)
--2.635 F .435 -.15(ve b)-.2 H .135(een imported and no changes to of).15
-F .134(fset picks ha)-.25 F .434 -.15(ve b)-.2 H .134(een made).15 F
-(since the last in)144 472.8 Q -.15(ve)-.4 G(rsion.).15 E F1(About)108
-489.6 Q F0(This b)9.33 E(utton brings up a pulldo)-.2 E
-(wn menu with one item:)-.25 E F1(About)2.5 E F0(.)A F1(About->About)108
-506.4 Q F0 .095(This menu item brings up a popup windo)144 518.4 R 2.595
-(wt)-.25 G .095(hat displays the program')-2.595 F 2.596(sn)-.55 G .096
-(ame, authors, and v)-2.596 F(ersion.)-.15 E(Clicking the)144 530.4 Q F1
-(Dismiss)2.5 E F0 -.2(bu)2.5 G(tton will close the windo).2 E -.65(w.)
--.25 G F1(Data T)108 547.2 Q(able)-.92 E F0 1.736
-(This list widget displays one of \214v)144 559.2 R 4.235(et)-.15 G
-1.735(ables of information re)-4.235 F -.05(ga)-.15 G 1.735
-(rding the current).05 F F1(mbna)4.235 E -.1(va)-.25 G(djust).1 E F0
-.806(project. These tables are a list of the imported sw)144 571.2 R
-.806(ath surv)-.1 F -.15(ey)-.15 G .806
-(s, the data \214les, the shorter data sec-).15 F .424(tions comprising\
- each data \214le, a list of the identi\214ed crossing sw)144 583.2 R
-.424(aths, and a list of the na)-.1 F(vig)-.2 E(ation)-.05 E .283
-(tie points de\214ned interacti)144 595.2 R -.15(ve)-.25 G .283
-(ly by the user).15 F 5.283(.T)-.55 G(he)-5.283 E F1 -.37(Vi)2.783 G(ew)
-.37 E F0(pulldo)2.783 E .283(wn menu allo)-.25 F .283
-(ws the user to set which)-.25 F(table is displayed.)144 607.2 Q
-(The surv)144 631.2 Q .3 -.15(ey l)-.15 H(ist will look something lik)
-.15 E(e:)-.1 E
-(00 53 2009/08/03 08:18:49.484999 2009/08/03 22:52:59.375000 good)180
-643.2 Q
-(01 51 2009/08/04 09:03:11.938999 2009/08/04 23:02:03.470999 good)180
-655.2 Q
-(02 01 1998/05/13 01:33:36.791000 1998/05/13 02:42:11.703999 good)180
-667.2 Q 1.122(Here the \214rst column is the surv)144 679.2 R 1.422 -.15
-(ey c)-.15 H(ounter).15 E 3.622(,t)-.4 G 1.122
-(he second is the number of sw)-3.622 F 1.121(ath \214les included in)
--.1 F .655(each surv)144 691.2 R -.15(ey)-.15 G 3.155(,a)-.5 G .656
-(nd the follo)-3.155 F .656(wing information consists of the start and \
-end times of the data in each)-.25 F(surv)144 703.2 Q 2.676 -.15(ey s)
--.15 H(ho).15 E 2.376(wn in YYYY/MM/DD HH:MM:SS.SSSSSS format, follo)
--.25 F 2.376(wed by the surv)-.25 F 2.676 -.15(ey s)-.15 H(tatus).15 E
-(\(poor)144 715.2 Q 2.5(,g)-.4 G(ood, \214x)-2.5 E(ed, \214x)-.15 E
-(edxy)-.15 E 2.5<2c8c>-.65 G -.15(xe)-2.5 G(dz\).).15 E(MB-System 5.0)72
-768 Q(22 April 2015)142.605 E(5)200.945 E 0 Cg EP
-%%Page: 6 6
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mbna)72 48 Q -.25(va)-.2 G 137.51
-(djust\(1\) MB-System).25 F 137.51(5.0 mbna)2.5 F -.25(va)-.2 G
-(djust\(1\)).25 E(The \214le list will look something lik)144 84 Q(e:)
--.1 E 2.5(0000:00 good)180 96 R 2.5(11 0.0 0.0)7.5 F
-(../../20090803/20090803_081706.mb88)2.5 E 2.5(0001:00 good)180 108 R
-2.5(11 0.0 0.0)7.5 F(../../20090803/20090803_083332.mb88)2.5 E 2.5
-(0002:00 good)180 120 R 2.5(11 0.0 0.0)7.5 F
-(../../20090803/20090803_085004.mb88)2.5 E 2.5(0003:00 good)180 132 R
-2.5(11 0.0 0.0)7.5 F(../../20090803/20090803_090636.mb88)2.5 E 2.5
-(0004:00 good)180 144 R 2.5(10 0.0 0.0)7.5 F
-(../../20090803/20090803_092307.mb88)2.5 E
-(..........................................)216 156 Q 2.5(0053:01 good)
-180 168 R 2.5(12 0.0 0.0)7.5 F(../../20090804/20090804_090127.mb88)2.5 E
-2.5(0054:01 good)180 180 R 2.5(10 0.0 0.0)7.5 F
-(../../20090804/20090804_092036.mb88)2.5 E 2.5(0055:01 good)180 192 R
-2.5(11 0.0 0.0)7.5 F(../../20090804/20090804_093707.mb88)2.5 E 2.5
-(0056:01 good)180 204 R 2.5(10 0.0 0.0)7.5 F
-(../../20090804/20090804_095339.mb88)2.5 E 2.5(0057:01 good)180 216 R
-2.5(11 0.0 0.0)7.5 F(../../20090804/20090804_101010.mb88)2.5 E
-(..........................................)216 228 Q 2.5(0104:02 \214x)
-180 240 R 5(ed 8)-.15 F 2.5(0.0 0.0)5 F(../../MB)2.5 E
-(ARI/1998em300/mbari_1998_630_msn.mb57)-.35 E .326
-(Here the \214rst column is the \214le counter and surv)144 252 R .627
--.15(ey c)-.15 H .327(ounter separated by a colon.).15 F .327
-(The second col-)5.327 F .716(umn indicates the \214le na)144 264 R(vig)
--.2 E .715(ations state; "gd" indicates good na)-.05 F(vig)-.2 E .715
-(ation, "pr" indicates poor na)-.05 F(vi-)-.2 E -.05(ga)144 276 S 2.518
-(tion, and "fx" indicates \214x).05 F 2.518(ed na)-.15 F(vig)-.2 E 2.518
-(ation. The third column sho)-.05 F 2.519(ws the number of sections)-.25
-F -.15(ex)144 288 S 1.47(tracted from this \214le.).15 F 1.469
-(The fourth and \214fth columns sho)6.47 F 3.969(wa)-.25 G 1.769 -.15
-(ny h)-3.969 H 1.469(eading or roll bias of).15 F 1.469(fsets in)-.25 F
-(de)144 300 Q .378(grees applied to the sw)-.15 F .378
-(ath data for that \214le.)-.1 F .378(The sixth column gi)5.378 F -.15
-(ve)-.25 G 2.879(st).15 G .379(he name of the sw)-2.879 F .379(ath data)
--.1 F .007(\214le imported into)144 312 R/F1 10/Times-Bold at 0 SF(mbna)
-2.507 E -.1(va)-.25 G(djust).1 E F0 2.507(.N)C .007
-(ote that the name sho)-2.507 F .006(wn here is that of the "ra)-.25 F
-.006(w" sw)-.15 F .006(ath \214le. The)-.1 F .888(data imported by)144
-324 R F1(mbna)3.388 E -.1(va)-.25 G(djust).1 E F0 .888
-(is, if possible, e)3.388 F .889(xtracted from a "processed" sw)-.15 F
-.889(ath \214le generated)-.1 F(by)144 336 Q F1(mbpr)2.5 E(ocess)-.18 E
-F0(rather than the associated "ra)2.5 E(w" \214le.)-.15 E
-(The \214le section list will look something lik)144 360 Q(e:)-.1 E
-(00:0000:00 2009/08/03 08:17:07.546998 2009/08/03 08:18:49.484999)180
-372 Q(00:0000:01 2009/08/03 08:18:49.984999 2009/08/03 08:20:26.952999)
-180 384 Q
-(00:0000:02 2009/08/03 08:20:27.452999 2009/08/03 08:22:05.890999)180
-396 Q(00:0000:03 2009/08/03 08:22:06.390999 2009/08/03 08:23:43.344001)
-180 408 Q
-(00:0000:04 2009/08/03 08:23:43.844001 2009/08/03 08:25:19.796999)180
-420 Q(00:0000:05 2009/08/03 08:25:20.296999 2009/08/03 08:26:57.265997)
-180 432 Q
-(00:0000:06 2009/08/03 08:26:57.765997 2009/08/03 08:28:35.219001)180
-444 Q(00:0000:07 2009/08/03 08:28:35.719001 2009/08/03 08:30:16.155999)
-180 456 Q
-(00:0000:08 2009/08/03 08:30:16.655999 2009/08/03 08:31:57.594001)180
-468 Q(00:0000:09 2009/08/03 08:31:58.094001 2009/08/03 08:33:36.546999)
-180 480 Q
-(00:0000:10 2009/08/03 08:33:37.046999 2009/08/03 08:33:37.546999)180
-492 Q .158(Here the \214rst column sho)144 504 R .158
-(ws the section id with the surv)-.25 F .458 -.15(ey c)-.15 H(ounter).15
-E 2.657(,t)-.4 G .157(he \214le counter)-2.657 F 2.657(,a)-.4 G .157
-(nd the section)-2.657 F .272(counter separated by colons. The follo)144
-516 R .273(wing information consists of the start and end times of each)
--.25 F(section sho)144 528 Q(wn in YYYY/MM/DD HH:MM:SS.SSSSSS format.)
--.25 E(The crossing list will look something lik)144 552 Q(e:)-.1 E 7.5
-(-X 0)180 564 R(000:009 001:000)2.5 E 2.5(21 0)5 F 12.5(-1)180 576 S
-(001:009 002:000)-10 E 2.5(10 0)5 F 12.5(-2)180 588 S(002:009 003:000)
--10 E 2.5(10 0)5 F 12.5(U3)180 600 S(003:009 004:000)-10 E 5(60)7.5 G
-12.5(-4)180 612 S(005:009 006:000)-10 E 2.5(13 0)5 F 12.5(U5)180 624 S
-(007:009 008:000)-10 E 5(30)7.5 G 12.5(U6)180 636 S(009:008 009:010)-10
-E 5(20)7.5 G 12.5(*7)180 648 S(009:008 010:000)-10 E 2.5(16 1)5 F 7.5
-(*X 8)180 660 R(009:009 010:000)2.5 E 2.5(41 1)5 F 12.5(-9)180 672 S
-(009:008 010:001)-10 E 5(10)7.5 G .293(Here the \214rst column indicate\
-s the processing status for the crossing. The \214rst character is the \
-sta-)144 684 R 1.332(tus \215ag. If the status \215ag is "U", then no d\
-ecision has been made about skipping or tieing this)144 696 R 3.758
-(crossing. Ne)144 708 R 3.757(wc)-.25 G 1.257(rossings al)-3.757 F -.1
-(wa)-.1 G 1.257(ys sho).1 F 3.757(wa")-.25 G 1.257
-(U" \215ag prior to being inspected by a user)-3.757 F 3.757(.I)-.55 G
-3.757(ft)-3.757 G 1.257(he \214rst)-3.757 F .836(character is "-", then\
- the crossing has been skipped, and if the \214rst character is "*", th\
-en at least)144 720 R(MB-System 5.0)72 768 Q(22 April 2015)142.605 E(6)
-200.945 E 0 Cg EP
-%%Page: 7 7
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mbna)72 48 Q -.25(va)-.2 G 137.51
-(djust\(1\) MB-System).25 F 137.51(5.0 mbna)2.5 F -.25(va)-.2 G
-(djust\(1\)).25 E .961
-(one tie point has been set. The second column is the crossing counter)
-144 84 R 3.46(.T)-.55 G .96(he third and fourth col-)-3.46 F .315
-(umns identify the sw)144 96 R .315(ath data sections that o)-.1 F -.15
-(ve)-.15 G .316
-(rlap in this crossing. Each are identi\214ed by their \214le).15 F .424
-(id and section id separated by ":". The \214fth column indicates the p\
-ercentage of o)144 108 R -.15(ve)-.15 G .423(rlap of the tw).15 F(o)-.1
-E .1(sections in this crossing. The lar)144 120 R .101(ger the de)-.18 F
-.101(gree of o)-.15 F -.15(ve)-.15 G .101(rlap, the more lik).15 F .101
-(ely that diagnostic matching)-.1 F 1.314(topographic features e)144 132
-R 1.314(xist that can be used to determine the na)-.15 F(vig)-.2 E 1.313
-(ation of)-.05 F 1.313(fsets required for this)-.25 F 2.573
-(crossing. The)144 144 R .073(sixth, and last column gi)2.573 F -.15(ve)
--.25 G 2.573(st).15 G .074(he number of tie points that ha)-2.573 F .374
--.15(ve b)-.2 H .074(een de\214ned for each).15 F(crossing. Ne)144 156 Q
-2.5(wc)-.25 G(rossings al)-2.5 E -.1(wa)-.1 G(ys be).1 E
-(gin with 0 tie points prior to being inspected by a user)-.15 E(.)-.55
-E(The tie point list will look something lik)144 180 Q(e:)-.1 E 2.592
-(700)187.592 192 S .092(09:008:07 010:000:04 00:00)-2.592 F .091
-(1.02 \2552.87 0.00 |)5.091 F 2.591(9.61 8.49)5.091 F .091
-(1.40 | 0.041 0.107 0.027)2.591 F 2.591(800)187.591 204 S .091
-(09:009:02 010:000:00 00:00)-2.591 F .091(0.90 \2554.47 0.00 |)5.091 F
-2.591(7.37 6.30)5.091 F .092(2.29 | 0.040 0.184 0.033)2.591 F 1.598
-(12 0 009:008:04 010:002:04 00:00)186.598 216 R 1.597
-(4.11 \2558.24 0.00 |)6.597 F 4.097(9.28 5.99)6.597 F 1.597
-(1.80 | 0.037 0.021)4.097 F(0.025)144 228 Q 1.597
-(14 0 010:000:02 010:002:06 00:00)186.597 240 R 1.597
-(2.12 \2554.38 0.00 |)6.597 F 4.098(7.50 6.70)6.597 F 1.598
-(1.10 | 0.007 0.065)4.098 F(0.005)144 252 Q 1.598
-(16 0 009:007:04 010:003:04 00:00)186.598 264 R 1.597
-(5.90 \2555.90 0.00 |)6.597 F 4.097(8.66 6.84)6.597 F 1.597
-(1.70 | 0.019 0.085)4.097 F(0.027)144 276 Q 1.597
-(19 0 009:006:04 010:004:04 00:00)186.597 288 R 1.597
-(8.32 \2556.83 0.00 |)6.597 F 4.098(8.78 8.55)6.597 F 1.598
-(6.65 | 0.026 0.066)4.098 F(0.024)144 300 Q 1.431
-(21 0 009:005:05 010:005:03 00:00)186.431 312 R 1.431
-(8.96 \2558.75 0.00 | 12.38)6.431 F 1.43(8.74 5.16 | 0.008 0.045)6.43 F
-(0.008)144 324 Q 1.43
-(23 0 009:004:04 010:006:04 00:00 12.23 \2555.98 0.00 |)186.43 336 R
-3.931(7.03 4.49)6.431 F 1.431(1.40 | 0.019 0.034)3.931 F(0.010)144 348 Q
-1.097(26 0 009:003:04 010:007:04 00:00 17.42 \2554.36 0.00 | 13.92 10.1\
-1 1.80 | 0.025 0.037)186.098 360 R(0.028)144 372 Q .847(Here the \214rs\
-t column indicates the crossing which contains the tie point, and the s\
-econd column)144 384 R(sho)144 396 Q .044(ws which tie point \(of those\
- de\214ned for that crossing\) is displayed in a particular line. The t\
-hird)-.25 F .763(and fourth columns identify the na)144 408 R(vig)-.2 E
-.764(ation control points of the tie point. The na)-.05 F(vig)-.2 E .764
-(ation control)-.05 F .192
-(points are speci\214ed by \214le, section, and na)144 420 R 2.691(vp)
--.2 G .191(oint numbers separated by ":". The \214fth through se)-2.691
-F(v-)-.25 E 1.462(enth columns are the longitude, latitude and v)144 432
-R 1.462(ertical of)-.15 F 1.462(fsets \(in meters\) set interacti)-.25 F
--.15(ve)-.25 G 1.463(ly by the).15 F(user)144 444 Q 3.418(.T)-.55 G .917
-(hese represent the distance the second na)-3.418 F(vig)-.2 E .917
-(ation control point must be mo)-.05 F -.15(ve)-.15 G 3.417(dr).15 G
-(elati)-3.417 E 1.217 -.15(ve t)-.25 H(o).15 E .8
-(the \214rst in order to mak)144 456 R 3.3(et)-.1 G .8(he bath)-3.3 F
-.801(ymetry in the tw)-.05 F 3.301(os)-.1 G -.1(wa)-3.301 G .801
-(ths match. The tenth through twelth col-).1 F .912(umns sho)144 468 R
-3.412(wt)-.25 G .912(he magnitude of the three ax)-3.412 F .912
-(es of the uncertainly ellipsoid associated with each tie.)-.15 F .114(\
-The uncertainly ellipsoid is estimated as a 3x3 tensor and used to weig\
-ht the tie of)144 480 R .114(fsets in the na)-.25 F(vi-)-.2 E -.05(ga)
-144 492 S .899(tion adjustment in).05 F -.15(ve)-.4 G .899
-(rsion. Here the major and second ax).15 F .898(es are al)-.15 F -.1(wa)
--.1 G .898(ys close to horizontal, and).1 F 1.407
-(the minor is axis is al)144 504 R -.1(wa)-.1 G 1.407(ys close to v).1 F
-3.907(ertical. The)-.15 F 1.407
-(last three columns are nonzero only after an)3.907 F(in)144 516 Q -.15
-(ve)-.4 G .721(rsion for an optimal na).15 F(vig)-.2 E .721
-(ation solution has been performed. These represent the residual, or)
--.05 F(dif)144 528 Q .55(ference, between the of)-.25 F .55
-(fset calculated for this tie point in the in)-.25 F -.15(ve)-.4 G .55
-(rsion and that set by the user).15 F
-(\(displayed in the \214fth through se)144 540 Q -.15(ve)-.25 G
-(nth columns\).).15 E .869(If the \214le list is displayed and one \214\
-le is selected by clicking in the list, then the user can \214x or)144
-564 R .823(un\214x the na)144 576 R(vig)-.2 E .824(ation of that \214le\
- using the <Action->Fix File> or <Action->Un\214x File> pulldo)-.05 F
-(wn)-.25 E .552(menu items.)144 588 R .551(If either the crossing list \
-or the tie point list are displayed, selecting one crossing or)5.552 F
-.674(one tie point by clicking in the list widget will cause the speci\
-\214ed crossing to be loaded and dis-)144 600 R(played in the)144 612 Q
-/F1 10/Times-Bold at 0 SF(Na)2.5 E 2.5(vE)-.25 G(rr)-2.5 E F0(windo)2.5 E
--.65(w.)-.25 G F1(Contr)87 640.8 Q(ols W)-.18 E(indo)-.18 E(w)-.1 E F0
-.132(This dialog windo)108 652.8 R 2.632(wi)-.25 G 2.632(sb)-2.632 G
-.131(rought up by clicking the)-2.632 F F1(Option->Contr)2.631 E(ols)
--.18 E F0 .131(menu item in the)2.631 F F1(MBna)2.631 E -.1(va)-.25 G
-.131(djust W).1 F(in-)-.18 E(do)108 664.8 Q(w)-.1 E F0 2.836(.T)C .336
-(his windo)-2.836 F 2.836(wi)-.25 G .336(ncludes tw)-2.836 F 2.836(os)
--.1 G .337(lider widgets setting data importation parameters, four slid\
-er widgets set-)-2.836 F(ting data display parameters, a b)108 676.8 Q
-(utton to apply an)-.2 E 2.5(yc)-.15 G(hanges, and a b)-2.5 E
-(utton to dismiss the windo)-.2 E -.65(w.)-.25 G F1
-(Max Section Length \(km\))108 705.6 Q F0(When)144 717.6 Q F1(mbna)2.589
-E -.1(va)-.25 G(djust).1 E F0 .089(imports sw)2.589 F .088(ath data, it\
- breaks each data \214le up into a set of sections, or pieces.)-.1 F .63
-(The geographical co)144 729.6 R -.15(ve)-.15 G .631
-(rages of all sections are then compared to determine where sw).15 F
-.631(aths o)-.1 F -.15(ve)-.15 G(rlap).15 E(MB-System 5.0)72 768 Q
-(22 April 2015)142.605 E(7)200.945 E 0 Cg EP
-%%Page: 8 8
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mbna)72 48 Q -.25(va)-.2 G 137.51
-(djust\(1\) MB-System).25 F 137.51(5.0 mbna)2.5 F -.25(va)-.2 G
-(djust\(1\)).25 E .741(or cross. This control sets the section track le\
-ngth. The ideal section length v)144 84 R .741(aries with the sonar)-.25
-F .498(altitude and ping rate. If the section length is too short, ther\
-e will be too man)144 96 R 2.998(ys)-.15 G .498(mall sections and)-2.998
-F .525(an e)144 108 R(xcessi)-.15 E .825 -.15(ve n)-.25 H .525
-(umber of crossings to analyze. If the section length is too lar).15 F
-.524(ge, indi)-.18 F .524(vidual sections)-.25 F(will be slo)144 120 Q
-2.5(wt)-.25 G 2.5(ol)-2.5 G(oad and display)-2.5 E(.)-.65 E/F1 10
-/Times-Bold at 0 SF(Max # Soundings in Section)108 136.8 Q F0 1.084
-(This slider widget sets an additional or alternati)144 148.8 R 1.385
--.15(ve c)-.25 H 1.085(ontrol on sw).15 F 1.085
-(ath data section size: the maxi-)-.1 F .307
-(mum number of soundings \(not pings\) that may be included in a gi)144
-160.8 R -.15(ve)-.25 G 2.807(ns).15 G .307(ection. F)-2.807 F .306
-(or some datasets,)-.15 F 1.548(it may be more con)144 172.8 R -.15(ve)
--.4 G 1.549(nient to use the number of soundings rather than the track \
-length as the).15 F(criterea for breaking \214les up into sections.)144
-184.8 Q F1(Decimation)108 201.6 Q F0 .625(When sw)144 213.6 R .625
-(ath bath)-.1 F .625(ymetry sections are displayed in the)-.05 F F1(Na)
-3.125 E 3.125(vE)-.25 G(rr)-3.125 E F0(windo)3.125 E 1.925 -.65(w, t)
--.25 H .625(he primary display con-).65 F .832(sists of bath)144 225.6 R
-.833(ymetric contours.)-.05 F .833
-(The time required for calculating these contours is linear with the)
-5.833 F .29(number of soundings. This slider allo)144 237.6 R .289
-(ws users to decimate the pings used for the contour displays.)-.25 F
-1.019(If the decimation is set to 1, all soundings are used. If the dec\
-imation is set to 2, the soundings)144 249.6 R(from e)144 261.6 Q -.15
-(ve)-.25 G(ry second ping are used for contouring.).15 E F1
-(Contour Inter)108 278.4 Q -.1(va)-.1 G 2.5(l\().1 G(m\))-2.5 E F0
-(This slider widget sets the depth interv)144 290.4 Q
-(al in meters for the bath)-.25 E(ymetric contours.)-.05 E F1
-(Color Inter)108 307.2 Q -.1(va)-.1 G 2.5(l\().1 G(m\))-2.5 E F0 .554
-(This slider widget sets the the depth interv)144 319.2 R .553
-(al in meters at which the color of the bath)-.25 F .553(ymetric con-)
--.05 F 1.111(tours changes. The contours are generated in four colors: \
-black, red, green, and blue. The color)144 331.2 R(interv)144 343.2 Q
-(al should be a multiple of the contour interv)-.25 E(al.)-.25 E F1 -.18
-(Ti)108 360 S(ck Inter).18 E -.1(va)-.1 G 2.5(l\().1 G(m\))-2.5 E F0 .93
-(This slider widget sets the depth interv)144 372 R .929
-(al in meters at which contours ha)-.25 F 1.229 -.15(ve d)-.2 H -.25(ow)
-.15 G .929(nhill f).25 F .929(acing tick-)-.1 F(marks. The tick interv)
-144 384 Q(al should be a multiple of the contour interv)-.25 E(al.)-.25
-E F1(In)108 400.8 Q -.1(ve)-.4 G(rsion Smoothing).1 E F0 .46
-(This slider widget sets the importance of smoothing in the adjusted na)
-144 412.8 R(vig)-.2 E .46(ation model. Lar)-.05 F .46(ger v)-.18 F(al-)
--.25 E 1.242(ues yield a smoother model, smaller v)144 424.8 R 1.241
-(alues a rougher model.)-.25 F 1.241(The def)6.241 F 1.241
-(ault is 4.00, and possible)-.1 F .377(ranges are 0.10 to 10.0, where t\
-he smoothing penalty weight applied to the \214rst and second deri)144
-436.8 R(v-)-.25 E(ati)144 448.8 Q -.15(ve)-.25 G 2.5(so).15 G 2.5(ft)
--2.5 G(he adjusted na)-2.5 E(vig)-.2 E
-(ation perturbation is ten raised to this po)-.05 E(wer)-.25 E(.)-.55 E
-F1 -.25(Ap)108 465.6 S(ply).25 E F0 1.566(This b)10.13 F 1.566
-(utton applies an)-.2 F 4.066(yc)-.15 G 1.566(hanged v)-4.066 F 1.565
-(alues in the slider widgets of the)-.25 F F1(Contr)4.065 E 1.565(ols W)
--.18 F(indo)-.18 E(w)-.1 E F0 6.565(.I)C 4.065(ft)-6.565 G(he)-4.065 E
-F1(Contr)144 477.6 Q .04(ols W)-.18 F(indo)-.18 E(w)-.1 E F0 .04
-(is closed without the)2.54 F F1 -.25(Ap)2.541 G(ply).25 E F0 -.2(bu)
-2.541 G .041(tton being click).2 F .041(ed, all changes to the v)-.1 F
-.041(alues con-)-.25 F(trolled by the sliders are lost.)144 489.6 Q F1
-(Dismiss)108 506.4 Q F0(This b)144 518.4 Q(utton closes the)-.2 E F1
-(Contr)2.5 E(ols W)-.18 E(indo)-.18 E(w)-.1 E F0(.)A F1(Na)87 547.2 Q
-2.5(vE)-.25 G(rr W)-2.5 E(indo)-.18 E(w)-.1 E F0 .1(This windo)108 559.2
-R 2.6(wa)-.25 G(llo)-2.6 E .1(ws users to interacti)-.25 F -.15(ve)-.25
-G .1(ly inspect crossing sw).15 F .1(aths, de\214ne na)-.1 F(vig)-.2 E
-.1(ation tie points where bath)-.05 F(y-)-.05 E 1.653
-(metric features can be matched, and set the na)108 571.2 R(vig)-.2 E
-1.653(ation of)-.05 F 1.653(fsets at those tie points. This windo)-.25 F
-4.153(wc)-.25 G 1.653(an be)-4.153 F .898(brought up in a number of w)
-108 583.2 R .898(ays. If one pulls do)-.1 F .897
-(wn the menu option <Action->Analyze Crossings>, then)-.25 F .221
-(the "Na)108 595.2 R 2.721(vE)-.2 G .221(rror" windo)-2.721 F 2.721(ww)
--.25 G .221(ill come up with the \214rst crossing loaded. Alternati)
--2.721 F -.15(ve)-.25 G(ly).15 E 2.722(,i)-.65 G 2.722(ft)-2.722 G .222
-(he <V)-2.722 F(ie)-.6 E(w->Sho)-.25 E 2.722(wA)-.25 G(ll)-2.722 E .719
-(Crossings> menu item has been selected so that a table of crossings is\
- displayed, clicking once on an)108 607.2 R 3.219(yo)-.15 G(f)-3.219 E
-.275(the crossing items in this tabel will bring up the)108 619.2 R("Na)
-5.275 E 2.775(vE)-.2 G .275(rror" windo)-2.775 F 2.776(ww)-.25 G .276
-(ith that crossing loaded.)-2.776 F(Similarly)5.276 E(,)-.65 E 1.024
-(if tie points ha)108 631.2 R 1.323 -.15(ve b)-.2 H 1.023
-(een established and the tie point table displayed by selecting the <V)
-.15 F(ie)-.6 E(w->Sho)-.25 E 3.523(wT)-.25 G(ies>)-3.873 E .571
-(menu item, then clicking on an)108 643.2 R 3.071(yo)-.15 G 3.071(ft)
--3.071 G .571(he tie items this table will bring up the "Na)-3.071 F
-3.071(vE)-.2 G .571(rror" windo)-3.071 F 3.071(wa)-.25 G .571(nd load)
--3.071 F .142
-(the crossing that includes the selected tie point. If the "Na)108 655.2
-R 2.642(vE)-.2 G .142(rror" windo)-2.642 F 2.642(wi)-.25 G 2.641(sa)
--2.642 G .141(lready displayed, clicking on)-2.641 F .482(crossing or t\
-ie items in the display tables will load the selected crossing in place\
- of whate)108 667.2 R -.15(ve)-.25 G 2.982(rc).15 G .482(rossing w)
--2.982 F(as)-.1 E(pre)108 679.2 Q(viously sho)-.25 E(wn.)-.25 E .21
-(The Na)108 703.2 R 2.71(vE)-.2 G .21(rr windo)-2.71 F 2.71(wi)-.25 G
-.21(ncludes a number of b)-2.71 F .209
-(utton widgets and three display can)-.2 F -.25(va)-.4 G .209
-(ses. The lar).25 F .209(ger display to)-.18 F .471(the right sho)108
-715.2 R .471(ws bath)-.25 F .471(ymetric contour maps of the o)-.05 F
--.15(ve)-.15 G .471(rlapping sw).15 F .471(aths o)-.1 F -.15(ve)-.15 G
-.472(rlain by na).15 F(vig)-.2 E .472(ation tracks and an)-.05 F(y)-.15
-E .602(tie points that ha)108 727.2 R .901 -.15(ve b)-.2 H .601
-(een de\214ned for the current crossing. The smaller can).15 F -.25(va)
--.4 G 3.101(so).25 G 3.101(nt)-3.101 G .601(he middle left sho)-3.101 F
-.601(ws the)-.25 F(MB-System 5.0)72 768 Q(22 April 2015)142.605 E(8)
-200.945 E 0 Cg EP
-%%Page: 9 9
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mbna)72 48 Q -.25(va)-.2 G 137.51
-(djust\(1\) MB-System).25 F 137.51(5.0 mbna)2.5 F -.25(va)-.2 G
-(djust\(1\)).25 E .821(RMS bath)108 84 R .821
-(ymetry mis\214t between the tw)-.05 F 3.321(os)-.1 G -.1(wa)-3.321 G
-.821(ths as a function of lateral \(x and y\) of).1 F .822
-(fset using the current)-.25 F -.15(ve)108 96 S .287(rtical \(z\)of).15
-F .287(fset. The smallest can)-.25 F -.25(va)-.4 G 2.787(so).25 G 2.787
-(nt)-2.787 G .287(he lo)-2.787 F .287(wer left sho)-.25 F .287
-(ws the RMS Bath)-.25 F .287(ymetry mis\214t between the tw)-.05 F(o)-.1
-E(sw)108 108 Q(aths as a function of v)-.1 E(ertical of)-.15 E
-(fset using the current lateral of)-.25 E(fset.)-.25 E/F1 10
-/Times-Bold at 0 SF(Contour Display)108 136.8 Q F0 .023(This can)144 148.8
-R -.25(va)-.4 G 2.523(sd).25 G .024(isplays color bath)-2.523 F .024
-(ymetric contours from both o)-.05 F -.15(ve)-.15 G .024(rlapping sw).15
-F .024(aths in the current sw)-.1 F(ath)-.1 E 1.029(crossing. Initially)
-144 160.8 R 3.529(,t)-.65 G 1.029
-(he display is scaled so that the entire area co)-3.529 F -.15(ve)-.15 G
-1.028(red by the current crossing is).15 F .014(visible. The bath)144
-172.8 R .014(ymetric contours of the second sw)-.05 F .014
-(ath can be mo)-.1 F -.15(ve)-.15 G 2.514(dr).15 G(elati)-2.514 E .314
--.15(ve t)-.25 H 2.514(ot).15 G .014(hose of the \214rst by)-2.514 F
-.717(dragging with the left mouse b)144 184.8 R .717(utton in the can)
--.2 F -.25(va)-.4 G .717(s. The current na).25 F(vig)-.2 E .716
-(ational of)-.05 F .716(fset changes as the)-.25 F .588
-(contours shift. The location of the current lateral of)144 196.8 R .589
-(fset also changes simultaneously on the mis\214t)-.25 F 1.026
-(plot. The user can display a subre)144 208.8 R 1.026
-(gion of the current map by dragging a rectangle in the can)-.15 F -.25
-(va)-.4 G(s).25 E .122(with the middle mouse b)144 220.8 R .122
-(utton. This zoom operation can be repeated as man)-.2 F 2.623(yt)-.15 G
-.123(imes as desired. The)-2.623 F .512(right mouse b)144 232.8 R .512
-(utton is used to set the location of the current na)-.2 F(vig)-.2 E
-.511(ational tie point. When the right)-.05 F .636(mouse b)144 244.8 R
-.636(utton is click)-.2 F .636
-(ed on a point in the contour map, the closest na)-.1 F(vig)-.2 E .637
-(ation control points from)-.05 F .413(each sw)144 256.8 R .412(ath to \
-that position are selected for the current tie point. In practice, the \
-user should right-)-.1 F(click on the bath)144 268.8 Q
-(ymetric feature being matched to set the tie point correctly)-.05 E(.)
--.65 E F1(Lateral Mis\214t Display)108 285.6 Q F0 .83(This can)144 297.6
-R -.25(va)-.4 G 3.33(ss).25 G(ho)-3.33 E .83(ws a color tw)-.25 F 3.33
-(od)-.1 G .83(imensional plot of the RMS bath)-3.33 F .83
-(ymetric mis\214t between the tw)-.05 F(o)-.1 E -.15(ove)144 309.6 S
-.513(rlapping sw).15 F .513(aths. The mis\214t is sho)-.1 F .513
-(wn as a function of relati)-.25 F .812 -.15(ve l)-.25 H .512
-(ateral \(x and y\) of).15 F .512(fsets between)-.25 F .597(the tw)144
-321.6 R 5.597(os)-.1 G -.1(wa)-5.597 G .597(ths using the current v).1 F
-.597(ertical \(z\) of)-.15 F 3.098(fset. Put)-.25 F 3.098(another w)
-3.098 F(ay)-.1 E 5.598(,t)-.65 G .598(he mis\214t plot sho)-5.598 F .598
-(ws ho)-.25 F(w)-.25 E .842
-(good, or bad, the mis\214t becomes as one mo)144 333.6 R -.15(ve)-.15 G
-3.342(so).15 G .842(ne sw)-3.342 F .842(ath relati)-.1 F 1.142 -.15
-(ve t)-.25 H 3.342(oa).15 G(nother)-3.342 E 5.842(.T)-.55 G 3.341(he lo)
--5.842 F .841(west mis\214t)-.25 F -.25(va)144 345.6 S .039
-(lues are sho).25 F .039(wn in red; higher mis\214ts are sho)-.25 F .04
-(wn in blues to purples. The location of the minimum)-.25 F 3.248
-(mis\214t is mark)144 357.6 R .748
-(ed by a black "X", and the location of the current na)-.1 F(vig)-.2 E
-.748(ation of)-.05 F .747(fset is sho)-.25 F .747(wn by a)-.25 F 2.943
-(small red square)144 369.6 R .443(with a black outline. If an in)2.943
-F -.15(ve)-.4 G .444(rsion has been performed, a small black "+" will)
-.15 F .209(mark the location of the of)144 381.6 R .208
-(fset calculated by the in)-.25 F -.15(ve)-.4 G .208
-(rsion. If a user left-clicks in the Lateral Mis\214t).15 F(Display)144
-393.6 Q 3.061(,t)-.65 G .561(he location of the cursor is tak)-3.061 F
-.561(en as the ne)-.1 F 3.061(wn)-.25 G -.2(av)-3.061 G(ig).2 E .561
-(ation of)-.05 F .562(fset and the red square mo)-.25 F -.15(ve)-.15 G
-(s).15 E 1.008(to that location. Simultaneously)144 405.6 R 3.508(,t)
--.65 G 1.008(he bath)-3.508 F 1.008
-(ymetric contours in the Contour Display shift to re\215ect)-.05 F
-(the ne)144 417.6 Q 2.5(wo)-.25 G -.25(ff)-2.5 G(set.).25 E F1 -1(Ve)108
-434.4 S(rtical Mis\214t Display)1 E F0 .177(This can)144 446.4 R -.25
-(va)-.4 G 2.677(ss).25 G(ho)-2.677 E .177
-(ws a color pro\214le plot of the RMS bath)-.25 F .178
-(ymetric mis\214t between the tw)-.05 F 2.678(oo)-.1 G -.15(ve)-2.828 G
-(rlapping).15 E(sw)144 458.4 Q 1.124(aths. The mis\214t is sho)-.1 F
-1.123(wn as a function of relati)-.25 F 1.423 -.15(ve ve)-.25 H 1.123
-(rtical \(z\) of).15 F 1.123(fset between the tw)-.25 F 6.123(os)-.1 G
--.1(wa)-6.123 G(ths).1 E 1.027(using the current lateral \(x andy\) of)
-144 470.4 R 3.527(fsets. Put)-.25 F 3.527(another w)3.527 F(ay)-.1 E
-6.027(,t)-.65 G 1.027(he mis\214t plot sho)-6.027 F 1.027(ws ho)-.25 F
-3.527(wg)-.25 G 1.027(ood, or)-3.527 F .612
-(bad, the mis\214t becomes as one mo)144 482.4 R -.15(ve)-.15 G 3.112
-(so).15 G .612(ne sw)-3.112 F .612(ath v)-.1 F .612(ertically relati)
--.15 F .912 -.15(ve t)-.25 H 3.112(oa).15 G(nother)-3.112 E 5.612(.T)
--.55 G 3.112(he lo)-5.612 F .612(west mis\214t)-.25 F -.25(va)144 494.4
-S .382(lues are sho).25 F .382(wn in red and as high points in the pro\
-\214le; higher mis\214ts are sho)-.25 F .382(wn in blues to pur)-.25 F
-(-)-.2 E 1.012(ples and as lo)144 506.4 R 3.512(wp)-.25 G 1.012
-(oints. The location of the minimum mis\214t)-3.512 F 3.512(is mark)
-6.012 F 1.011(ed by a black "X", and the)-.1 F .003
-(location of the current v)144 518.4 R .003(ertical of)-.15 F .003
-(fset is sho)-.25 F .003(wn by a solid line. If an in)-.25 F -.15(ve)-.4
-G .004(rsion has been performed, a).15 F .181
-(small black "+" will mark the location of the of)144 530.4 R .18
-(fset calculated by the in)-.25 F -.15(ve)-.4 G .18
-(rsion. If a user left-clicks).15 F .491(in the V)144 542.4 R .491
-(ertical Mis\214t Display)-1.11 F 2.991(,t)-.65 G .492
-(he location of the cursor is tak)-2.991 F .492(en as the ne)-.1 F 2.992
-(wv)-.25 G .492(ertical of)-3.142 F .492(fset and the)-.25 F .261
-(solid line mo)144 554.4 R -.15(ve)-.15 G 2.761(st).15 G 2.761(ot)-2.761
-G .261(hat location. Simultaneously)-2.761 F 2.761(,t)-.65 G .261
-(he bath)-2.761 F .26(ymetric contours in the Contour Display)-.05 F
-(shift to re\215ect the ne)144 566.4 Q 2.5(wo)-.25 G -.25(ff)-2.5 G
-(set.).25 E F1(Settings)108 583.2 Q F0(This b)144 595.2 Q
-(utton brings up a pulldo)-.2 E(wn menu with tw)-.25 E 2.5(oi)-.1 G
-(tems:)-2.5 E F1(Biases)2.5 E F0(and)2.5 E F1(ContoursB)2.5 E
-(Settings->Biases)108 612 Q F0 1.042
-(This menu item brings up a dialog windo)144 624 R 3.542(ww)-.25 G 1.043
-(ith se)-3.542 F -.15(ve)-.25 G 1.043
-(ral slider widgets that set roll and heading).15 F(bias v)144 636 Q 2.5
-(alues. These)-.25 F(widgets are discussed in the)2.5 E F1(Biases)2.5 E
-F0(section belo)2.5 E -.65(w.)-.25 G F1(Settings->Contours)108 652.8 Q
-F0 .243(This menu item brings up a dialog windo)144 664.8 R 2.743(ww)
--.25 G .243(ith se)-2.743 F -.15(ve)-.25 G .242
-(ral slider widgets that set parameters control-).15 F .088(ling ho)144
-676.8 R 2.588(ws)-.25 G -.1(wa)-2.588 G .088
-(th data are imported and displayed.).1 F .088
-(These widgets are discussed in the)5.088 F F1(Contr)2.588 E(ols)-.18 E
-F0(sec-)2.588 E(tion abo)144 688.8 Q -.15(ve)-.15 G(.).15 E F1(Pr)108
-705.6 Q -.15(ev)-.18 G(ious).15 E F0(Clicking this b)144 717.6 Q
-(utton causes the Na)-.2 E 2.5(vE)-.2 G(rr windo)-2.5 E 2.5(wt)-.25 G
-2.5(ol)-2.5 G(oad and display the pre)-2.5 E(vious crossing.)-.25 E
-(MB-System 5.0)72 768 Q(22 April 2015)142.605 E(9)200.945 E 0 Cg EP
-%%Page: 10 10
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mbna)72 48 Q -.25(va)-.2 G 137.51
-(djust\(1\) MB-System).25 F 137.51(5.0 mbna)2.5 F -.25(va)-.2 G
-(djust\(1\)).25 E/F1 10/Times-Bold at 0 SF(Next)108 84 Q F0
-(Clicking this b)16.01 E(utton causes the Na)-.2 E 2.5(vE)-.2 G
-(rr windo)-2.5 E 2.5(wt)-.25 G 2.5(ol)-2.5 G(oad and display the ne)-2.5
-E(xt crossing.)-.15 E F1(Next Unset)108 100.8 Q F0 .059(Clicking this b)
-144 112.8 R .059(utton causes the Na)-.2 F 2.559(vE)-.2 G .059(rr windo)
--2.559 F 2.559(wt)-.25 G 2.559(ol)-2.559 G .059(oad and display the ne)
--2.559 F .058(xt crossing which has no)-.15 F
-(tie points set and has not been e)144 124.8 Q(xplicitly skipped.)-.15 E
-F1(Skip Cr)108 141.6 Q(ossing)-.18 E F0 .321(This b)144 153.6 R .321(ut\
-ton indicates that no good tie points can be de\214ned for the current \
-crossing.)-.2 F .322(The program)5.322 F F1(mbna)144 165.6 Q -.1(va)-.25
-G(djust).1 E F0 1.076(will not allo)3.576 F 3.576(wa)-.25 G 3.576(ni)
--3.576 G -1.85 -.4(nv e)-3.576 H 1.076
-(rsion to be calculated until all true crossings either ha).4 F 1.376
--.15(ve t)-.2 H(ie).15 E(points de\214ned or ha)144 177.6 Q .3 -.15
-(ve b)-.2 H(een e).15 E(xplicitly skipped.)-.15 E F1(Full Size)108 194.4
-Q F0 .187(Clicking this b)144 206.4 R .188
-(utton causes the contour display to resize so that it sho)-.2 F .188
-(ws the entire area co)-.25 F -.15(ve)-.15 G .188(red by).15 F(the sw)
-144 218.4 Q(ath sections in the current crossing.)-.1 E F1(Unset Cr)108
-235.2 Q(ossing)-.18 E F0 .335(This b)144 247.2 R .335(utton returns the\
- current crossing to the original unset state, deleting an)-.2 F 2.835
-(yt)-.15 G .335(ies that ha)-2.835 F .635 -.15(ve b)-.2 H(een).15 E
-(set.)144 259.2 Q F1(Reset Cr)108 276 Q(ossing)-.18 E F0 .522(This b)144
-288 R .522(utton is acti)-.2 F .823 -.15(ve o)-.25 H .523
-(nly if a tie has been set for the current crossing. If a tie e).15 F
-.523(xists, and the user)-.15 F .176(has changed the current of)144 300
-R .176(fset from that of the current tie, then this b)-.25 F .176
-(utton returns the w)-.2 F .175(orking of)-.1 F(f-)-.25 E(set v)144 312
-Q(alues to that of the e)-.25 E(xisting tie.)-.15 E F1(Set Offset)108
-328.8 Q F0 .431(This v)144 340.8 R .431(ery important b)-.15 F .432
-(utton causes the current na)-.2 F(vig)-.2 E .432(ational of)-.05 F .432
-(fset to be set for the current tie point)-.25 F .827
-(and crossing. This b)144 352.8 R .827(utton is the only w)-.2 F .827
-(ay that the na)-.1 F(vig)-.2 E .827(ational of)-.05 F .827
-(fsets are actually applied to the)-.25 F F1(mbna)144 364.8 Q -.1(va)
--.25 G(djust).1 E F0 1.747(project. If the user closes the Na)4.247 F
-4.247(vE)-.2 G 1.747(rr windo)-4.247 F 3.047 -.65(w, c)-.25 H 1.747
-(hanges the loaded crossing, or).65 F 2.504(changes the acti)144 376.8 R
-2.804 -.15(ve t)-.25 H 2.503(ie point without clicking <Set Of).15 F
-2.503(fset>, whate)-.25 F -.15(ve)-.25 G 5.003(rn).15 G -.2(av)-5.003 G
-(ig).2 E 2.503(ational of)-.05 F 2.503(fset w)-.25 F(as)-.1 E(vie)144
-388.8 Q .094(wed will be lost. T)-.25 F .094
-(ie points are displayed in yello)-.35 F 2.594(wo)-.25 G .094(nce the)
--2.594 F 2.594(ya)-.15 G .095(re set, and in red when either the)-2.594
-F(na)144 400.8 Q(vig)-.2 E(ational of)-.05 E(fset or the na)-.25 E(vig)
--.2 E(ation points ha)-.05 E .3 -.15(ve b)-.2 H(een changed b).15 E
-(ut not yet set.)-.2 E F1(Zer)108 417.6 Q 2.5(oZO)-.18 G(ffset)-2.5 E F0
-(This b)144 429.6 Q(utton sets the current v)-.2 E(ertical of)-.15 E
-(fset to zero meters.)-.25 E F1(Add T)108 446.4 Q(ie)-.18 E F0 .542
-(This b)144 458.4 R .542(utton adds a ne)-.2 F 3.042(wt)-.25 G .542
-(ie point for the current crossing and mak)-3.042 F .541(es this ne)-.1
-F 3.041(wt)-.25 G .541(ie point acti)-3.041 F -.15(ve)-.25 G 3.041(.T)
-.15 G(he)-3.041 E(tie point initially adopts the current na)144 470.4 Q
-(vig)-.2 E(ational of)-.05 E(fset.)-.25 E F1(Zer)108 487.2 Q 2.5(oO)-.18
-G(ffset)-2.5 E F0(This b)144 499.2 Q(utton sets the current na)-.2 E
-(vig)-.2 E(ational of)-.05 E
-(fset to zero meters for longitude, latitude, and v)-.25 E(ertical.)-.15
-E F1(Select T)108 516 Q(ie)-.18 E F0 .01(If more than one na)144 528 R
-(vig)-.2 E .011(ation tie point has been de\214ned for a crossing, then\
- only one tie point can be)-.05 F(acti)144 540 Q 1.184 -.15(ve a)-.25 H
-3.384(ta).15 G 1.184 -.15(ny t)-3.384 H .884(ime. The na).15 F(vig)-.2 E
-.884(ation control points of the acti)-.05 F 1.183 -.15(ve t)-.25 H .883
-(ie points will be displayed as red).15 F(box)144 552 Q .088
-(es, and those of an)-.15 F 2.589(yi)-.15 G(nacti)-2.589 E .389 -.15
-(ve t)-.25 H .089(ie points will be sho).15 F .089
-(wn as smaller red box)-.25 F .089(es. This b)-.15 F .089(utton changes)
--.2 F .742(the acti)144 564 R 1.042 -.15(ve t)-.25 H .742(ie point.).15
-F .741(Repeatedly clicking this b)5.741 F .741(utton will c)-.2 F .741
-(ycle through all of the tie points in the)-.15 F .532
-(current crossing. Note that each tie point has its o)144 576 R .532
-(wn of)-.25 F .533(fset de\214ned, so in general the positions of)-.25 F
-(the bath)144 588 Q(ymetric contours will change as the acti)-.05 E .3
--.15(ve t)-.25 H(ie point changes.).15 E F1(Delete T)108 604.8 Q(ie)-.18
-E F0(This b)144 616.8 Q(utton deletes the current acti)-.2 E .3 -.15
-(ve t)-.25 H(ie point.).15 E F1(Dismiss)108 633.6 Q F0(This b)144 645.6
-Q(utton closes the Na)-.2 E 2.5(vE)-.2 G(rr windo)-2.5 E -.65(w.)-.25 G
-F1(Minimum Mis\214t)108 662.4 Q F0 1.149(This b)144 674.4 R 1.149
-(utton shifts the current of)-.2 F 1.149(fset to the v)-.25 F 1.149
-(alue identi\214ed as the minimum mis\214t in the current)-.25 F .873
-(mis\214t display)144 686.4 R 3.373(.T)-.65 G .873
-(he minimum mis\214t is sho)-3.373 F .873(wn as the lar)-.25 F .874
-(ge black X on the color lateral mis\214t plot)-.18 F(and on the v)144
-698.4 Q(ertical mis\214t pro\214le.)-.15 E(MB-System 5.0)72 768 Q
-(22 April 2015)142.605 E(10)195.945 E 0 Cg EP
-%%Page: 11 11
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mbna)72 48 Q -.25(va)-.2 G 137.51
-(djust\(1\) MB-System).25 F 137.51(5.0 mbna)2.5 F -.25(va)-.2 G
-(djust\(1\)).25 E/F1 10/Times-Bold at 0 SF(Minimum XY Mis\214t)108 84 Q F0
-.316(This b)144 96 R .316(utton shifts the current lateral of)-.2 F .316
-(fset to the v)-.25 F .315
-(alues identi\214ed as the minimum lateral mis\214t in)-.25 F .432
-(the current mis\214t display)144 108 R 2.932(.T)-.65 G .432(he v)-2.932
-F .433(ertical of)-.15 F .433
-(fset is not changed. The minimum lateral mis\214t is sho)-.25 F(wn)-.25
-E 1.319(as the small black X on the lateral mis\214t plot. This b)144
-120 R 1.319(utton is generally used when the data are)-.2 F .096
-(already corrected for all v)144 132 R .096(ertical of)-.15 F .097
-(fsets \(e.g. tides\), and so all z of)-.25 F .097
-(fsets can be con\214ned to zero v)-.25 F(al-)-.25 E(ues.)144 144 Q F1
-(Center on Zer)108 160.8 Q 2.5(oO)-.18 G(ffset)-2.5 E F0 .259(This b)144
-172.8 R .259(utton causes the mis\214t plot to be re)-.2 F .259
-(generated using a zero na)-.15 F(vig)-.2 E .259(ational of)-.05 F .258
-(fset as the plot ori-)-.25 F(gin.)144 184.8 Q F1(Center on Curr)108
-201.6 Q(ent Offset)-.18 E F0 .153(This b)144 213.6 R .153
-(utton causes the mis\214t plot to be re)-.2 F .153
-(generated using the current na)-.15 F(vig)-.2 E .153(ational of)-.05 F
-.154(fset as the plot)-.25 F(origin.)144 225.6 Q F1(Biases W)87 254.4 Q
-(indo)-.18 E(w)-.1 E F0 .912(This dialog windo)108 266.4 R 3.412(wi)-.25
-G 3.412(sb)-3.412 G .911(rought up by clicking the)-3.412 F F1
-(Settings->Biases)3.411 E F0 .911(menu item in the)3.411 F F1(Na)3.411 E
-3.411(vE)-.25 G .911(rr W)-3.411 F(indo)-.18 E(w)-.1 E F0(.)A .456
-(The controls allo)108 278.4 R 2.956(wu)-.25 G .456
-(sers to set roll and heading bias \(or of)-2.956 F .456(fset\) v)-.25 F
-.457(alues to be a applied to some or all of the)-.25 F(sw)108 290.4 Q
-.063(ath bath)-.1 F .063(ymetry in the)-.05 F F1(mbna)2.562 E -.1(va)
--.25 G(djust).1 E F0 .062
-(project. Under most circumstances, roll bias and pitch bias problems)
-2.562 F .235(should be resolv)108 302.4 R .235(ed before sw)-.15 F .235
-(ath data are imported into)-.1 F F1(mbna)2.735 E -.1(va)-.25 G(djust).1
-E F0 2.735(.H)C -.25(ow)-2.735 G -2.15 -.25(ev e).25 H 1.036 -.4(r, t)
-.25 H .236(hese settings mak).4 F 2.736(ei)-.1 G 2.736(tp)-2.736 G(os-)
--2.736 E .378(sible to deal with bias issues if the)108 314.4 R 2.878
-(ya)-.15 G .378(re disco)-2.878 F -.15(ve)-.15 G .378(red during the na)
-.15 F(vig)-.2 E .378(ation adjustment process. This windo)-.05 F(w)-.25
-E .469(includes tw)108 326.4 R 2.969(ot)-.1 G .469(oggle b)-2.969 F .47
-(uttons to set the bias mode, four slider widgets to set the bias param\
-eters, a b)-.2 F .47(utton to)-.2 F .658
-(apply the bias settings to all sw)108 338.4 R .658(ath \214les, a b)-.1
-F .657(utton to apply the bias settings to the current sw)-.2 F .657
-(ath \214le, and a)-.1 F -.2(bu)108 350.4 S(tton to dismiss the windo).2
-E -.65(w.)-.25 G F1(Same Biases \(km\))108 379.2 Q F0 .628
-(This toggle b)144 391.2 R .629(utton sets the bias mode so that the he\
-ading and roll bias is identical for both sw)-.2 F(ath)-.1 E .3
-(data sections in the current crossing. The <Dif)144 403.2 R .3
-(ferent Biases> toggle is deselected when this toggle)-.25 F
-(is selected.)144 415.2 Q F1(Differ)108 432 Q(ent Biases \(km\))-.18 E
-F0 .114(This toggle b)144 444 R .114
-(utton sets the bias mode so that the heading and roll bias can be dif)
--.2 F .115(ferent between the)-.25 F(tw)144 456 Q 2.517(os)-.1 G -.1(wa)
--2.517 G .017(th data sections in the current crossing.).1 F .016
-(The <Same Biases> toggle is deselected when this)5.017 F
-(toggle is selected.)144 468 Q F1
-(Section 1 Biases \(deg\) \255> Heading)108 484.8 Q F0
-(This slider widget sets the heading bias for sw)144 496.8 Q
-(ath section 1. The)-.1 E F1(Section 1 Biases \(deg\) \255> Roll)108
-513.6 Q F0(This slider widget sets the roll bias for sw)144 525.6 Q
-(ath section 1.)-.1 E F1(Section 2 Biases \(deg\) \255> Heading)108
-542.4 Q F0(This slider widget sets the heading bias for sw)144 554.4 Q
-(ath section 2.)-.1 E F1(Section 2 Biases \(deg\) \255> Roll)108 571.2 Q
-F0(This slider widget sets the roll bias for sw)144 583.2 Q
-(ath section 2.)-.1 E F1 -.25(Ap)108 600 S(ply to All Files).25 E F0
-.257(This b)144 612 R .258
-(utton sets the current heading and roll bias v)-.2 F .258
-(alues as the bias v)-.25 F .258(alues for all sw)-.25 F .258
-(ath \214les in the)-.1 F F1(mbna)144 624 Q -.1(va)-.25 G(djust).1 E F0
-2.5(project. This)2.5 F -.2(bu)2.5 G
-(tton is only enabled when the <Same Biases> toggle is selected.).2 E F1
--.25(Ap)108 640.8 S(ply).25 E F0 .103(This b)10.13 F .103
-(utton sets the current heading and roll bias v)-.2 F .103
-(alues as the bias v)-.25 F .102(alues for the sw)-.25 F .102
-(ath sections in)-.1 F 1.69(the current crossing. The bath)144 652.8 R
-1.691
-(ymetry contours and mis\214t plot are recalculated and redisplayed)-.05
-F(using the ne)144 664.8 Q 2.5(wb)-.25 G(ias v)-2.5 E(alues.)-.25 E F1
-(Dismiss)108 681.6 Q F0(This b)144 693.6 Q(utton closes the)-.2 E F1
-(Contr)2.5 E(ols W)-.18 E(indo)-.18 E(w)-.1 E F0(.)A(MB-System 5.0)72
-768 Q(22 April 2015)142.605 E(11)195.945 E 0 Cg EP
-%%Page: 12 12
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mbna)72 48 Q -.25(va)-.2 G 137.51
-(djust\(1\) MB-System).25 F 137.51(5.0 mbna)2.5 F -.25(va)-.2 G
-(djust\(1\)).25 E/F1 10.95/Times-Bold at 0 SF(USING MBN)72 84 Q -1.04
--1.588(AV A)-.219 H(DJUST 1: IMPOR)1.588 E(TING D)-.438 E -1.644 -1.04
-(AT A)-.383 H F0(Users be)108 96 Q(gin using)-.15 E/F2 10/Times-Bold at 0
-SF(mbna)2.5 E -.1(va)-.25 G(djust).1 E F0
-(by starting up the program on the command line:)2.5 E(mbna)144 108 Q
--.25(va)-.2 G(djust).25 E .402
-(In order to get started, one must either open an e)108 120 R(xisting)
--.15 E F2(mbna)2.902 E -.1(va)-.25 G(djust).1 E F0 .402
-(project or initialize a ne)2.902 F 2.902(wo)-.25 G .402(ne. Both)-2.902
-F .102(options are a)108 132 R -.25(va)-.2 G .103
-(ilable under the <File> menu with the <File->Ne).25 F .103
-(w> and <File->Open> menu b)-.25 F .103(uttons. When)-.2 F .052
-(one pulls do)108 144 R .052(wn the <File->Ne)-.25 F .052
-(w> option, a dialog opens that allo)-.25 F .052(ws na)-.25 F(vig)-.2 E
-.052(ation of the \214lesystem and speci\214-)-.05 F 7.563
-(cation of a project name. Whate)108 156 R -.15(ve)-.25 G 10.063(rp).15
-G 7.563(roject location and name is chosen, a directory)-10.063 F .38("\
-{project_path}/{project_name}.dir" and a \214le "{project_path}/{projec\
-t_name}.n)108 168 R .38(vh" will be created. Once)-.4 F 3.3(ap)108 180 S
-.8(roject e)-3.3 F .8(xists and has been opened, sw)-.15 F .8
-(ath data can be imported and then analyzed. T)-.1 F 3.3(oo)-.8 G .8
-(pen an e)-3.3 F(xisting)-.15 E F2(mbna)108 192 Q -.1(va)-.25 G(djust).1
-E F0(project, click the <File->Open> option and select the correspondin\
-g "*.n)2.5 E(vh" \214le.)-.4 E .122(The main)108 216 R F2(mbna)2.622 E
--.1(va)-.25 G(djust).1 E F0(windo)2.622 E 2.622(wd)-.25 G .122(isplays \
-basic information in a set of labels in the upper left, including the)
--2.622 F .736(open project name, the number of \214les imported, the nu\
-mber of crossings found, the number of crossings)108 228 R .634
-(analyzed, the number of na)108 240 R(vig)-.2 E .634
-(ation tie points set, and whether an up-to-date in)-.05 F -.15(ve)-.4 G
-.634(rsion for optimal na).15 F(vig)-.2 E(a-)-.05 E .269
-(tion has been performed. A scrollable te)108 252 R .269(xt windo)-.15 F
-2.769(wi)-.25 G 2.769(nt)-2.769 G .269(he lo)-2.769 F .27
-(wer left displays messages re)-.25 F -.05(ga)-.15 G .27
-(rding all actions).05 F .451(performed by the program during the curre\
-nt session. Another scrollable windo)108 264 R 2.95(wo)-.25 G 2.95(nt)
--2.95 G .45(he right displays one)-2.95 F .72
-(of three tables of information according a user selection under the <V)
-108 276 R(ie)-.6 E .72(w> menu. The three choices are a)-.25 F .02
-(table of the imported sw)108 288 R .02(ath \214les, a table of the sw)
--.1 F .019(ath crossings, and a table of the interacti)-.1 F -.15(ve)
--.25 G .019(ly de\214ned na).15 F(vi-)-.2 E -.05(ga)108 300 S .03
-(tion tie points. If no sw).05 F .03(ath data has yet been imported, th\
-en the all of the tables will be empty)-.1 F 2.53(.O)-.65 G .03
-(nce some)-2.53 F .464(data \214les are imported, the sw)108 312 R .463
-(ath \214le table will ha)-.1 F .763 -.15(ve e)-.2 H .463
-(ntries and some number of crossings will be de\214ned).15 F
-(\(assuming that sw)108 324 Q(aths do o)-.1 E -.15(ve)-.15 G
-(rlap and cross\), b).15 E(ut no tie points will yet be de\214ned.)-.2 E
-1.542(In order to import sw)108 348 R 1.542(ath data into an)-.1 F F2
-(mbna)4.042 E -.1(va)-.25 G(djust).1 E F0 1.542(project, pull do)4.042 F
-1.542(wn the <File->Import Sw)-.25 F 1.542(ath Data>)-.1 F .459
-(menu item. A \214le selection dialog will appear)108 360 R 2.958(.S)
--.55 G -.1(wa)-2.958 G .458
-(th data can be imported in single \214les or through datal-).1 F .758
-(ists \(see the)108 372 R F2(MB-System)3.258 E F0 .758
-(manual page for a description of recursi)3.258 F 1.058 -.15(ve d)-.25 H
-.758(atalists\). As with other).15 F F2(MB-System)3.258 E F0 1.015(prog\
-rams, the format id will be automatically determined if possible for ea\
-ch \214le selected.)108 384 R 1.015(If a \214lename)6.015 F .204
-(does not follo)108 396 R 2.704(wt)-.25 G .204(he the)-2.704 F F2
-(MB-System)2.704 E F0 .204(naming con)2.704 F -.15(ve)-.4 G .205
-(ntion, the user may need to manually set the format id in).15 F
-(the appropriately labeled dialog te)108 408 Q(xt widget.)-.15 E .99
-(Each \214le that is imported is brok)108 432 R .989
-(en into a number of sections. The maximum size of the sections in line)
--.1 F .386(length or in number of soundings is set in a dialog opened b\
-y clicking on <Option->Controls>. Na)108 444 R(vig)-.2 E(ation)-.05 E
-1.256(control points are selected at re)108 456 R 1.255(gular interv)
--.15 F 1.255(als within each section. The control point distance interv)
--.25 F 1.255(al is)-.25 F 2.932(approximately one)108 468 R .432
-(tenth of the speci\214ed se)2.932 F .432
-(gment length, so there are up to 11 control points for each sec-)-.15 F
-.082(tion. The data for each section is written as a format 71 bath)108
-480 R .081(ymetry-only \214le in the "*.dir" directory)-.05 F 5.081(.A)
--.65 G 2.581(st)-5.081 G(he)-2.581 E .78
-(\214les are imported, the areal e)108 492 R .781
-(xtent of each section is compared to the other sections. An)-.15 F
-3.281(yp)-.15 G .781(air of sections)-3.281 F 1.573(that o)108 504 R
--.15(ve)-.15 G 1.573(rlap is added to a list of crossings to be in).15 F
--.15(ve)-.4 G(stig).15 E 1.573(ated graphically)-.05 F 4.073(.T)-.65 G
-1.572(his list can be displayed by)-4.073 F(pulling do)108 516 Q
-(wn the <V)-.25 E(ie)-.6 E(w->Sho)-.25 E 2.5(wC)-.25 G
-(rossings> menu item.)-2.5 E .143(As the user later w)108 540 R .143(or\
-ks through the crossings, he or she will will de\214ne tie points whene)
--.1 F -.15(ve)-.25 G 2.644(rt).15 G .144(he o)-2.644 F -.15(ve)-.15 G
-(rlapping).15 E(bath)108 552 Q .301(ymetry allo)-.05 F .301(ws the na)
--.25 F(vig)-.2 E .301(ational of)-.05 F .301(fset to be determined reli\
-ably in three dimensions. Each tie point will)-.25 F 1.674(reference tw)
-108 564 R 4.174(oo)-.1 G 4.174(ft)-4.174 G 1.674(he na)-4.174 F(vig)-.2
-E 1.674(ation control points, one from each sw)-.05 F 1.674
-(ath in the crossing.)-.1 F(Ultimately)6.674 E 4.174(,s)-.65 G(ome)
--4.174 E .124(crossings will allo)108 576 R 2.624(wo)-.25 G .123(ne, or\
- in some case multiple tie points to be de\214ned. Other crossings will\
- still ha)-2.624 F .423 -.15(ve n)-.2 H(o).15 E .612
-(tie points, either because the sw)108 588 R .612(aths don')-.1 F 3.112
-(tr)-.18 G .612(eally o)-3.112 F -.15(ve)-.15 G .613
-(rlap or because there aren').15 F 3.113(ta)-.18 G .913 -.15(ny d)-3.113
-H(istincti).15 E .913 -.15(ve f)-.25 H .613(eatures to).15 F 1.083
-(match. When all of the crossings ha)108 600 R 1.382 -.15(ve b)-.2 H
-1.082(een inspected, then the user can in).15 F -.2(vo)-.4 G 1.282 -.1
-(ke i).2 H -1.85 -.4(nv e).1 H 1.082(rsion for an optimal).4 F(na)108
-612 Q(vig)-.2 E .438(ation solution.)-.05 F .439
-(In cases where the data are kno)5.438 F .439
-(wn to be already corrected for v)-.25 F .439(ertical of)-.15 F .439
-(fsets, such as)-.25 F(tides, then the user can uniformly set the v)108
-624 Q(ertical \(z\) components of of)-.15 E(fsets to zero.)-.25 E F1
-(USING MBN)72 652.8 Q -1.04 -1.588(AV A)-.219 H(DJUST 2: INSPECTING CR)
-1.588 E(OSSINGS)-.329 E F2(Bringing Up The Na)87 664.8 Q 2.5(vE)-.25 G
-(rr)-2.5 E(or W)-.18 E(indo)-.18 E(w)-.1 E F0 .4(The heart of)108 676.8
-R F2(mbna)2.9 E -.1(va)-.25 G(djust).1 E F0 .4(is the interacti)2.9 F .7
--.15(ve i)-.25 H .4(nspection of the sw).15 F .4
-(ath crossings. One can bring up the cross-)-.1 F 1.452
-(ing inspection windo)108 688.8 R 3.952(w\()-.25 G 1.452(entitled "Na)
--3.952 F 3.952(vE)-.2 G 1.452(rror"\) in a number of w)-3.952 F 1.453
-(ays. If one pulls do)-.1 F 1.453(wn the menu option)-.25 F .848
-(<Action->Analyze Crossings>, then the "Na)108 700.8 R 3.347(vE)-.2 G
-.847(rror" windo)-3.347 F 3.347(ww)-.25 G .847
-(ill come up with the \214rst crossing loaded.)-3.347 F(Alternati)108
-712.8 Q -.15(ve)-.25 G(ly).15 E 3.25(,i)-.65 G 3.25(ft)-3.25 G .75
-(he <V)-3.25 F(ie)-.6 E(w->Sho)-.25 E 3.25(wC)-.25 G .75
-(rossings> menu item has been selected so that a table of crossings is)
--3.25 F .805(displayed, clicking once on an)108 724.8 R 3.305(yo)-.15 G
-3.305(ft)-3.305 G .804
-(he crossing items in this tabel will bring up the)-3.305 F("Na)5.804 E
-3.304(vE)-.2 G .804(rror" windo)-3.304 F(w)-.25 E(MB-System 5.0)72 768 Q
-(22 April 2015)142.605 E(12)195.945 E 0 Cg EP
-%%Page: 13 13
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mbna)72 48 Q -.25(va)-.2 G 137.51
-(djust\(1\) MB-System).25 F 137.51(5.0 mbna)2.5 F -.25(va)-.2 G
-(djust\(1\)).25 E .308(with that crossing loaded.)108 84 R(Similarly)
-5.309 E 2.809(,i)-.65 G 2.809(ft)-2.809 G .309(ie points ha)-2.809 F
-.609 -.15(ve b)-.2 H .309
-(een established and the tie point table displayed by).15 F .543
-(selecting the <V)108 96 R(ie)-.6 E(w->Sho)-.25 E 3.043(wT)-.25 G .542
-(ies> menu item, then clicking on an)-3.393 F 3.042(yo)-.15 G 3.042(ft)
--3.042 G .542(he tie items this table will bring up)-3.042 F .618
-(the "Na)108 108 R 3.118(vE)-.2 G .618(rror" windo)-3.118 F 3.118(wa)
--.25 G .618
-(nd load the crossing that includes the selected tie point. If the "Na)
--3.118 F 3.119(vE)-.2 G .619(rror" win-)-3.119 F(do)108 120 Q 2.736(wi)
--.25 G 2.736(sa)-2.736 G .236(lready displayed, clicking on crossing or\
- tie items in the display tables will load the selected cross-)-2.736 F
-(ing in place of whate)108 132 Q -.15(ve)-.25 G 2.5(rc).15 G(rossing w)
--2.5 E(as pre)-.1 E(viously sho)-.25 E(wn.)-.25 E .613(Once the "Na)108
-156 R 3.113(vE)-.2 G .613(rr" windo)-3.113 F 3.113(wi)-.25 G 3.113(sd)
--3.113 G .613(isplayed, the user can also mo)-3.113 F .913 -.15(ve t)
--.15 H .614(hrough the crossings by clicking on the).15 F(<Pre)108 168 Q
-.02(vious>, <Ne)-.25 F .02(xt>, and <Ne)-.15 F .02(xt Unset> b)-.15 F
-.02(uttons. The <Pre)-.2 F .02(vious> and <Ne)-.25 F .02(xt> b)-.15 F
-.02(uttons will load the pre)-.2 F(vious)-.25 E .998(or ne)108 180 R
-.998(xt, respecti)-.15 F -.15(ve)-.25 G(ly).15 E 3.498(,c)-.65 G .998
-(rossings in the crossing list. As discussed belo)-3.498 F 2.298 -.65
-(w, e)-.25 H .998(ach crossing must ultimately be).65 F("resolv)108 192
-Q 2.27(ed" by either ha)-.15 F 2.27(ving one or more na)-.2 F(vig)-.2 E
-2.269(ation of)-.05 F 2.269
-(fsets set at particular "tie points", or by being)-.25 F .95
-("skipped" because no matchable sea\215oor features are found. The <Ne)
-108 204 R .95(xt Unset> b)-.15 F .95(utton will load the ne)-.2 F(xt)
--.15 E(crossing that has not been resolv)108 216 Q 2.5(ed. T)-.15 F 2.5
-(oc)-.8 G(lose the "Na)-2.5 E 2.5(vE)-.2 G(rr" windo)-2.5 E 1.3 -.65
-(w, c)-.25 H(lick the <Dismiss> b).65 E(utton.)-.2 E/F1 10/Times-Bold at 0
-SF(Interacti)87 244.8 Q -.1(ve)-.1 G(ly Matching Sea\215oor F).1 E
-(eatur)-.25 E(es)-.18 E F0 .622(The "Na)108 256.8 R 3.122(vE)-.2 G .622
-(rror" windo)-3.122 F 3.122(wi)-.25 G 3.122(sc)-3.122 G .621
-(omplicated in appearance, and re)-3.122 F .621
-(grettably complicated in function also.)-.15 F(The)5.621 E .185
-(purpose is to allo)108 268.8 R 2.685(wt)-.25 G .185
-(he user to determine if an)-2.685 F 2.686(ys)-.15 G .186
-(ea\215oor features can be con\214dently matched in the o)-2.686 F -.15
-(ve)-.15 G(rlap-).15 E .151(ping sw)108 280.8 R .15(aths. If so, one or\
- more tie points can be de\214ned. In order to ease the identi\214catio\
-n of matching fea-)-.1 F .262(tures, tw)108 292.8 R 2.762(os)-.1 G .262
-(imultaneous displays are pro)-2.762 F 2.763(vided. The)-.15 F(lar)2.763
-E .263(ger plot on the right consists of o)-.18 F -.15(ve)-.15 G .263
-(rlain bath).15 F(ymetric)-.05 E 1.115(contours deri)108 304.8 R -.15
-(ve)-.25 G 3.615(df).15 G 1.115(rom each of the tw)-3.615 F 3.615(os)-.1
-G -.1(wa)-3.615 G 1.115(ths. The smaller can).1 F -.25(va)-.4 G 3.615
-(so).25 G 3.615(nt)-3.615 G 1.115(he left sho)-3.615 F 1.115
-(ws a color tw)-.25 F 3.615(od)-.1 G(imen-)-3.615 E .56
-(sional plot of the RMS mis\214t between the tw)108 316.8 R 3.06(os)-.1
-G -.1(wa)-3.06 G .561(ths. The mis\214t is sho).1 F .561
-(wn as a function of relati)-.25 F .861 -.15(ve l)-.25 H(ateral).15 E
-(of)108 328.8 Q 2.131(fsets between the tw)-.25 F 4.631(os)-.1 G -.1(wa)
--4.631 G 2.131(ths. Put another w).1 F(ay)-.1 E 4.631(,t)-.65 G 2.131
-(he mis\214t plot sho)-4.631 F 2.13(ws ho)-.25 F 4.63(wg)-.25 G 2.13
-(ood, or bad, the mis\214t)-4.63 F .123(becomes as one mo)108 340.8 R
--.15(ve)-.15 G 2.623(so).15 G .123(ne sw)-2.623 F .123(ath relati)-.1 F
-.423 -.15(ve t)-.25 H 2.623(oa).15 G(nother)-2.623 E 2.623(.T)-.55 G
-.123(he lo)-2.623 F .123(west mis\214t v)-.25 F .124(alues are sho)-.25
-F .124(wn in red; higher mis-)-.25 F .205(\214ts are sho)108 352.8 R
-.205(wn in blues to purples. The location of the global \(three dimensi\
-onal\) minimum mis\214t is mark)-.25 F(ed)-.1 E .345(by the lar)108
-364.8 R .345
-(ge black "X", the location of the minimum mis\214t using the current v)
--.18 F .345(ertical of)-.15 F .345(fset v)-.25 F .345(alue is mark)-.25
-F(ed)-.1 E .195
-(by a small black "x", and the location of the current na)108 376.8 R
-(vig)-.2 E .195(ation of)-.05 F .195(fset is sho)-.25 F .195
-(wn by a small red square with a)-.25 F(black outline.)108 388.8 Q .528
-(The interacti)108 412.8 R .828 -.15(ve a)-.25 H .528(spect of the "Na)
-.15 F 3.029(vE)-.2 G .529(rror" windo)-3.029 F 3.029(ww)-.25 G .529
-(orks simultaneously in both displays. If the user holds)-3.129 F(do)108
-424.8 Q 1.106(wn the left mouse b)-.25 F 1.106
-(utton in the contour plot and mo)-.2 F -.15(ve)-.15 G 3.606(st).15 G
-1.106(he cursor)-3.606 F 3.606(,t)-.4 G 1.106(he bath)-3.606 F 1.105
-(ymetry contours from one)-.05 F(sw)108 436.8 Q .45(ath will mo)-.1 F
-.75 -.15(ve a)-.15 H .45(long with the cursor).15 F 2.95(.I)-.55 G 2.95
-(nt)-2.95 G .45(his w)-2.95 F(ay)-.1 E 2.95(,t)-.65 G .451
-(he user can mo)-2.95 F .751 -.15(ve o)-.15 H .451(ne of the sw).15 F
-.451(aths around relati)-.1 F .751 -.15(ve t)-.25 H(o).15 E .67(the oth\
-er until the contours line up and features match. As the contours mo)108
-448.8 R -.15(ve)-.15 G 3.17(,t).15 G .67(he red square sho)-3.17 F .67
-(wing the)-.25 F .283(current of)108 460.8 R .283(fset location also mo)
--.25 F -.15(ve)-.15 G 2.783(so).15 G 2.783(nt)-2.783 G .284(he mis\214t\
- plot. The user can thus visually relate the contour matching)-2.783 F
-.933(to the mis\214t function. The combination of these tw)108 472.8 R
-3.432(od)-.1 G .932(isplays greatly impro)-3.432 F -.15(ve)-.15 G 3.432
-(sau).15 G(ser')-3.432 E 3.432(sa)-.55 G .932(bility to reliably)-3.432
-F(determine na)108 484.8 Q(vig)-.2 E(ational of)-.05 E
-(fsets \(and to conclude where na)-.25 E(vig)-.2 E(ational of)-.05 E
-(fsets cannot be determined\).)-.25 E .03(The "Na)108 508.8 R 2.53(vE)
--.2 G .03(rr" windo)-2.53 F 2.53(wi)-.25 G .03(ncludes tw)-2.53 F 2.53
-(ob)-.1 G .03(uttons that are particularly useful during ef)-2.73 F .03
-(forts to match sea\215oor fea-)-.25 F 1.027
-(tures. The <Minimum Mis\214t> b)108 520.8 R 1.027(utton belo)-.2 F
-3.527(wt)-.25 G 1.027(he mis\214t display will cause)-3.527 F F1(mbna)
-3.526 E -.1(va)-.25 G(djust).1 E F0 1.026(to set the current)3.526 F(na)
-108 532.8 Q(vig)-.2 E .956(ational of)-.05 F .956(fset to that associat\
-ed with the smallest mis\214t for the current mis\214t display)-.25 F
-3.457(.T)-.65 G .957(his b)-3.457 F .957(utton is)-.2 F .839
-(often used \214rst to get close to the right of)108 544.8 R 3.339
-(fsets. The)-.25 F .839(<Zero Of)3.339 F .839(fset> b)-.25 F .839
-(utton abo)-.2 F 1.139 -.15(ve t)-.15 H .838(he contour display will).15
-F(return both displays to a state of zero na)108 556.8 Q(vig)-.2 E
-(ational of)-.05 E(fset.)-.25 E .773
-(The relationship between the contoured bath)108 580.8 R .773
-(ymetry and the mis\214t plot is usually quite clear)-.05 F 3.273(.I)
--.55 G 3.274(fas)-3.273 G(trongly)-3.274 E .024
-(matching sea\215oor feature e)108 592.8 R .024
-(xists, then a distinct minimum will sho)-.15 F 2.524(wu)-.25 G 2.524
-(pi)-2.524 G 2.524(nt)-2.524 G .024(he mis\214t plot. If the na)-2.524 F
-(vig)-.2 E .023(ation is)-.05 F .105(good and the feature already match\
-es, then the mis\214t minimum will be located at the center of the plot\
-, cor)108 604.8 R(-)-.2 E .446(responding to an of)108 616.8 R .445(fse\
-t that is zero distance in both the east-west and north-south direction\
-s. If the na)-.25 F(vig)-.2 E(a-)-.05 E .36
-(tion is bad, then the mis\214t minimum will be of)108 628.8 R .36
-(fset from the origin, and the of)-.25 F .36(fset v)-.25 F .36
-(ector will correspond to)-.15 F(ho)108 640.8 Q 3.385(wf)-.25 G .885
-(ar and what direction one must mo)-3.485 F 1.185 -.15(ve o)-.15 H .885
-(ne sw).15 F .885(ath so that the features in both sw)-.1 F .884
-(aths match. In cases)-.1 F .991(where there is no distincti)108 652.8 R
-1.292 -.15(ve s)-.25 H .992(ea\215oor feature to match, the mis\214t pl\
-ot will not display a strong minimum).15 F .406
-(and it will be impossible to determine the relati)108 664.8 R .706 -.15
-(ve n)-.25 H -.2(av).15 G(ig).2 E .406(ational of)-.05 F .406
-(fset. Alternati)-.25 F -.15(ve)-.25 G(ly).15 E 2.906(,t)-.65 G .406
-(he e)-2.906 F .406(xistence of multi-)-.15 F 2.071(ple similar feature\
-s can produce multiple local minima in the mis\214t map. In this case, \
-the ambiguity)108 676.8 R 1(between multiple possible solutions pre)108
-688.8 R -.15(ve)-.25 G .999(nts the determination of the na).15 F(vig)
--.2 E .999(ational of)-.05 F .999(fset. W)-.25 F 3.499(eh)-.8 G -2.25
--.2(av e)-3.499 H(found)3.699 E .805
-(that combining both contour and mis\214t displays allo)108 700.8 R .805
-(ws interacti)-.25 F -.15(ve)-.25 G 3.305(,v).15 G .805
-(isually based decision making that is)-3.305 F
-(more generally reliable than an)108 712.8 Q 2.5(ya)-.15 G
-(utomated scheme we can de)-2.5 E(vise.)-.25 E(MB-System 5.0)72 768 Q
-(22 April 2015)142.605 E(13)195.945 E 0 Cg EP
-%%Page: 14 14
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mbna)72 48 Q -.25(va)-.2 G 137.51
-(djust\(1\) MB-System).25 F 137.51(5.0 mbna)2.5 F -.25(va)-.2 G
-(djust\(1\)).25 E(Na)108 84 Q(vig)-.2 E 1.516(ational of)-.05 F 1.516
-(fsets can only be used when the)-.25 F 4.016(ya)-.15 G 1.516
-(re associated with speci\214c points on the o)-4.016 F -.15(ve)-.15 G
-(rlapping).15 E(sw)108 96 Q .142(ath na)-.1 F(vig)-.2 E .142
-(ation. These points are called "tie points".)-.05 F .142
-(All crossings will be)5.142 F .143(gin with no tie points, and users)
--.15 F 1.456(can generate one or more tie points for an)108 108 R 3.955
-(yc)-.15 G 1.455(rossing as required.)-3.955 F 1.455
-(The creation and manipulation of tie)6.455 F
-(points is discussed in detail in a later section.)108 120 Q 1.288
-(It is also important to understand that an)108 144 R 3.789(ya)-.15 G
-1.289(pparent na)-3.789 F(vig)-.2 E 1.289(ation of)-.05 F 1.289
-(fset observ)-.25 F 1.289(ed in the contour and mis\214t)-.15 F .522
-(plots is relati)108 156 R -.15(ve)-.25 G 3.022(.I).15 G 3.022(tm)-3.022
-G .522(ay turn out that both sw)-3.022 F .521(aths are poorly na)-.1 F
-(vig)-.2 E .521(ated and ha)-.05 F .821 -.15(ve t)-.2 H 3.021(ob).15 G
-3.021(em)-3.021 G -.15(ove)-3.021 G .521(d, or that all of).15 F .371
-(the of)108 168 R .371(fset can be applied to one sw)-.25 F .371
-(ath or the other)-.1 F 2.872(.T)-.55 G .372
-(he set of decisions about ho)-2.872 F 2.872(wt)-.25 G 2.872(od)-2.872 G
-(istrib)-2.872 E .372(ute the relati)-.2 F -.15(ve)-.25 G(na)108 180 Q
-(vig)-.2 E .14(ation of)-.05 F .14(fsets among the af)-.25 F .139
-(fected sw)-.25 F .139(ath \214les intrinsically in)-.1 F -.2(vo)-.4 G
-(lv).2 E .139(es speed and acceleration changes. F)-.15 F(or)-.15 E(-)
--.2 E(tunately)108 192 Q 3.66(,w)-.65 G 3.66(ea)-3.66 G 1.16
-(re able to formulate the automated in)-3.66 F -.15(ve)-.4 G 1.16
-(rsion process discussed belo).15 F 3.66(wt)-.25 G 3.66(oo)-3.66 G 1.16
-(btain an optimal)-3.66 F(na)108 204 Q(vig)-.2 E(ation solution.)-.05 E
-/F1 10/Times-Bold at 0 SF(Display Contr)87 232.8 Q(ols)-.18 E F0 1.284
-(The user controls the appearance of the bath)108 244.8 R 1.284
-(ymetry contour plot.)-.05 F 1.284(The contours are generated at re)
-6.284 F(gular)-.15 E(interv)108 256.8 Q .38
-(als in depth, and also change color and are annotated with do)-.25 F
-.381(wnhill f)-.25 F .381(acing tickmarks at re)-.1 F .381(gular inter)
--.15 F(-)-.2 E -.25(va)108 268.8 S 3.314(ls. A).25 F .813
-(controls dialog brought up by clicking on the <Settings->Contours> b)
-3.314 F .813(utton allo)-.2 F .813(ws the user to set)-.25 F .885
-(the contour)108 280.8 R 3.385(,c)-.4 G .885
-(olor change, and tickmark interv)-3.385 F .886
-(als. This same dialog also sets a decimation parameter that)-.25 F .407
-(causes the contours to be calculated from fe)108 292.8 R .407
-(wer soundings \(the data are decimated by ignoring pings\). The)-.25 F
-.15(application of decimation may speed up the crossing loadings, b)108
-304.8 R .15(ut is not generally recommended unless the)-.2 F(bath)108
-316.8 Q(ymetry is strongly o)-.05 E -.15(ve)-.15 G(rsampled.).15 E .436
-(Users may also use a "zoom" feature to focus on small areas in the con\
-tour plot.)108 340.8 R .435(The center mouse b)5.435 F(utton)-.2 E .486
-(is used to drag a box o)108 352.8 R -.15(ve)-.15 G -5.485 2.986(ra r)
-.15 H -.15(eg)-2.986 G .487
-(ion of interest in the contour plot. When the center b).15 F .487
-(utton is released, both)-.2 F .825
-(the contour and mis\214t plots are re)108 364.8 R .825
-(generated to sho)-.15 F 3.324(wt)-.25 G .824(he smaller area.)-3.324 F
-.824(Users may zoom as man)5.824 F 3.324(yt)-.15 G .824(imes in)-3.324 F
-.563(succession as desired. One cannot undo the indi)108 376.8 R .564
-(vidual zoom e)-.25 F -.15(ve)-.25 G .564(nts, b).15 F .564
-(ut clicking the <Full Size> b)-.2 F .564(utton in)-.2 F .519(the "Na)
-108 388.8 R 3.019(vE)-.2 G .519(rr" windo)-3.019 F 3.019(ww)-.25 G .519
-(ill cause the plots to sho)-3.019 F 3.019(wt)-.25 G .519
-(he original, full area co)-3.019 F -.15(ve)-.15 G .519(red by the tw)
-.15 F 3.019(os)-.1 G -.1(wa)-3.019 G .519(ths in the).1 F
-(current crossing.)108 400.8 Q .893
-(The mis\214t plot represents lateral of)108 424.8 R .893
-(fsets scaled according to the current contour plot display)-.25 F 3.393
-(.S)-.65 G(peci\214cally)-3.393 E(,)-.65 E .563(the width and height of\
- the mis\214t plot correspond to one half the width and height of the b\
-ath)108 436.8 R .563(ymetry con-)-.05 F .248(tour plot.)108 448.8 R .248
-(When the bath)5.248 F .248(ymetry plot area changes due to a zoom e)
--.05 F -.15(ve)-.25 G .249(nt, the mis\214t is recalculated and redis-)
-.15 F .302(played centered around the current of)108 460.8 R .302(fset.\
- The color map used for the mis\214t display is automatically scaled)
--.25 F(according to the minimum and maximum mis\214t v)108 472.8 Q
-(alues.)-.25 E F1(Setting Cr)87 501.6 Q(ossing T)-.18 E(ies and Offsets)
--.18 E F0 1.614(In order to actually set the relati)108 513.6 R 1.914
--.15(ve n)-.25 H -.2(av).15 G(ig).2 E 1.614(ational of)-.05 F 1.614
-(fset between tw)-.25 F 4.114(op)-.1 G 1.614(articular points on o)
--4.114 F -.15(ve)-.15 G 1.614(rlapping or).15 F .608(crossing sw)108
-525.6 R .607(aths, the user must \214rst create a tie point.)-.1 F .607
-(This is accomplished by clicking on the <Add T)5.607 F(ie>)-.35 E -.2
-(bu)108 537.6 S .202(tton in the "Na).2 F 2.702(vE)-.2 G .202(rr" windo)
--2.702 F 4.002 -.65(w. O)-.25 H .202(nce a tie point e).65 F .202
-(xists, it will be sho)-.15 F .203(wn on the contour plot as tw)-.25 F
-2.703(oy)-.1 G(ello)-2.703 E(w)-.25 E .147(or red-\214lled, black outli\
-ned squares connected by a thin black line. Each of the squares is loca\
-ted along one)108 549.6 R 1.696(of the sw)108 561.6 R 1.696(ath na)-.1 F
-(vig)-.2 E 1.696(ation tracks, and represents one of the na)-.05 F(vig)
--.2 E 1.696(ation control points de\214ned during data)-.05 F 2.94
-(importation. There)108 573.6 R .439(can be multiple tie points for eac\
-h crossing, and each one is created by clicking on the)2.94 F(<Add T)108
-585.6 Q(ie> b)-.35 E(utton.)-.2 E .061(Only one tie point will be acti)
-108 609.6 R .361 -.15(ve a)-.25 H 2.561(ta).15 G .361 -.15(ny t)-2.561 H
-.061(ime. The acti).15 F .362 -.15(ve t)-.25 H .062
-(ie point is displayed with lar).15 F .062(ger box)-.18 F .062
-(es \(the inacti)-.15 F -.15(ve)-.25 G .336(tie points are only 1/4 the\
- size. If only one tie point has been de\214ned, it will al)108 621.6 R
--.1(wa)-.1 G .335(ys be acti).1 F -.15(ve)-.25 G 2.835(.I).15 G 2.835
-(fm)-2.835 G .335(ore than)-2.835 F .364(one tie point e)108 633.6 R
-.365(xists, clicking on the <Select T)-.15 F .365(ie> b)-.35 F .365
-(utton in the "Na)-.2 F 2.865(vE)-.2 G .365(rr" windo)-2.865 F 2.865(ww)
--.25 G .365(ill change the acti)-2.865 F .665 -.15(ve t)-.25 H(ie).15 E
-.443(point to the ne)108 645.6 R .442(xt in the list for the displayed \
-crossing \(the tie points are selected in the order in which the)-.15 F
-(y)-.15 E .309(were created\). If the user wishes to delete a tie point\
-, then click <Select T)108 657.6 R .309
-(ie> until the undesirable tie point)-.35 F .472(is acti)108 669.6 R
--.15(ve)-.25 G 2.972(,a).15 G .472(nd then click <Delete T)-2.972 F
-2.972(ie>. The)-.35 F(acti)2.972 E .772 -.15(ve t)-.25 H .471
-(ie point will be displayed in red \214ll if either the associ-).15 F
-.52(ated na)108 681.6 R(vig)-.2 E .52(ation control points or the na)
--.05 F(vig)-.2 E .52(ational of)-.05 F .52(fset ha)-.25 F .82 -.15(ve b)
--.2 H .52(een changed since it w).15 F .52(as created or last set.)-.1 F
-.1(If the acti)108 693.6 R .399 -.15(ve t)-.25 H .099
-(ie point is up-to-date, then it will be displayed in yello).15 F 2.599
-<778c>-.25 G .099(ll. Each ne)-2.599 F 2.599(wt)-.25 G .099
-(ie point is initially dis-)-2.599 F(played in yello)108 705.6 Q 1.3
--.65(w. A)-.25 H(ll inacti).65 E .3 -.15(ve t)-.25 H
-(ie points will be sho).15 E(wn in yello)-.25 E 2.5<778c>-.25 G(ll.)-2.5
-E .543(When vie)108 729.6 R .543
-(wing a crossing with one or more tie points, the of)-.25 F .544
-(fsets displayed are associated with the current)-.25 F(MB-System 5.0)72
-768 Q(22 April 2015)142.605 E(14)195.945 E 0 Cg EP
-%%Page: 15 15
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mbna)72 48 Q -.25(va)-.2 G 137.51
-(djust\(1\) MB-System).25 F 137.51(5.0 mbna)2.5 F -.25(va)-.2 G
-(djust\(1\)).25 E 1.055(tie point. As one mo)108 84 R -.15(ve)-.15 G
-3.554(st).15 G 1.054(he contours to match o)-3.554 F -.15(ve)-.15 G
-1.054(rlapping features, it is important to remember that the).15 F(na)
-108 96 Q(vig)-.2 E .974(ational of)-.05 F .974
-(fset will be applied to the na)-.25 F(vig)-.2 E .975
-(ation points indicated for the current tie. Thus, the feature)-.05 F
-.156(being matched should deri)108 108 R .456 -.15(ve f)-.25 H .156(rom\
- data \(soundings\) associated with those particular points on the ship\
-track.).15 F 1.137(This is accomplished by clicking on the bath)108 120
-R 1.138(ymetric feature in the contour display with the right mouse)-.05
-F -.2(bu)108 132 S .335(tton. The "right-click" causes).2 F/F1 10
-/Times-Bold at 0 SF(mbna)2.835 E -.1(va)-.25 G(djust).1 E F0 .335
-(to \214nd the soundings from each sw)2.835 F .335
-(ath that are closest to the)-.1 F .072(point click)108 144 R .072
-(ed, and then to shift the current tie point to the na)-.1 F(vig)-.2 E
-.073(ation points on each sw)-.05 F .073(ath that include these)-.1 F
-.207(soundings \(that is, the na)108 156 R(vig)-.2 E .207(ation points \
-associated with the sonar pings that include the closest soundings\).)
--.05 F .708(In order to set, and sa)108 180 R -.15(ve)-.2 G 3.208(,an)
-.15 G -.2(av)-3.208 G(ig).2 E .708(ational of)-.05 F .708
-(fset that causes a bath)-.25 F .709(ymetric feature to be matched in o)
--.05 F -.15(ve)-.15 G(rlap-).15 E .899(ping sw)108 192 R .899
-(aths, the user must click the <Set Of)-.1 F .898(fset> b)-.25 F .898
-(utton abo)-.2 F 1.198 -.15(ve t)-.15 H .898(he contour display).15 F
-3.398(.I)-.65 G 3.398(fau)-3.398 G .898(ser changes the)-3.398 F(acti)
-108 204 Q .875 -.15(ve t)-.25 H .576(ie point or loads a dif).15 F .576
-(ferent crossing without clicking <Set T)-.25 F .576(ie>, then no of)
--.35 F .576(fset information will be)-.25 F(sa)108 216 Q -.15(ve)-.2 G
-3.408(d. Con).15 F -.15(ve)-.4 G(rsely).15 E 3.407(,f)-.65 G .907(or an)
--3.407 F 3.407(yc)-.15 G .907
-(rossing with one or more tie points, the <Reset Of)-3.407 F .907
-(fset> b)-.25 F .907(utton will reset the)-.2 F(na)108 228 Q(vig)-.2 E
-(ational of)-.05 E(fset to the last v)-.25 E
-(alue set for the current crossing and tie point.)-.25 E 1.276
-(So, in practice, setting na)108 252 R(vig)-.2 E 1.276(ational of)-.05 F
-1.277(fsets that will be used in obtaining an optimal na)-.25 F(vig)-.2
-E 1.277(ation solution)-.05 F(in)108 264 Q -.2(vo)-.4 G(lv).2 E
-(es the follo)-.15 E(wing steps:)-.25 E(1. Identify a bath)144 276 Q
-(ymetric feature with)-.05 E -.15(ove)151.5 288 S
-(rlapping data so that it can be).15 E(matched.)151.5 300 Q
-(2. Create a tie point by clicking the)144 312 Q(<Add T)151.5 324 Q
-(ie> b)-.35 E(utton.)-.2 E(3. Set the tie point location by right)144
-336 Q(\255clicking on the feature.)151.5 348 Q(4. If necessary)144 360 Q
-2.5(,z)-.65 G(oom the display to)-2.5 E(focus on the bath)151.5 372 Q
-(ymetric feature)-.05 E(of interest by dragging a box)151.5 384 Q
-(with the middle mouse b)151.5 396 Q(utton.)-.2 E(5. Adjust the of)144
-408 Q(fsets so that the)-.25 E(feature is matched in both sw)151.5 420 Q
-(aths)-.1 E(\(operating in the contour display)151.5 432 Q(,)-.65 E
-(the mis\214t display)151.5 444 Q 2.5(,o)-.65 G 2.5(rb)-2.5 G(oth\).)
--2.5 E(6. Click the <Set Of)144 456 Q(fset> b)-.25 E(utton.)-.2 E
-(These steps should be follo)108 468 Q(wed for e)-.25 E -.15(ve)-.25 G
-(ry feature that can be matched in o).15 E -.15(ve)-.15 G(rlapping sw)
-.15 E(aths.)-.1 E .963(In some cases, the user will \214nd it useful to\
- create and set multiple tie points in a single crossing. Other)108 492
-R 1.351(crossings may not allo)108 504 R 3.852(wa)-.25 G 1.652 -.15
-(ny f)-3.852 H 1.352
-(eatures to be matched. Users should click the <Skip Crossing> b).15 F
-1.352(utton on)-.2 F .365(crossings that do not allo)108 516 R 2.865(wo)
--.25 G .365(ne or more of)-2.865 F .365(fsets to be determined. In f)
--.25 F(act,)-.1 E F1(mbna)2.865 E -.1(va)-.25 G(djust).1 E F0 .365
-(will only allo)2.865 F 2.865(wt)-.25 G(he)-2.865 E .22
-(calculation of a na)108 528 R(vig)-.2 E .22
-(ation solution when all of the crossings ha)-.05 F .521 -.15(ve b)-.2 H
-.221(een acted on by either ha).15 F .221(ving tie points)-.2 F
-(set or by ha)108 540 Q(ving been e)-.2 E(xplicitly skipped.)-.15 E .56
-(Users should feel free to iterate an)108 564 R 3.059(yw)-.15 G .559
-(ay the)-3.159 F 3.059(yl)-.15 G(ik)-3.059 E 3.059(ed)-.1 G .559
-(uring crossing inspection. Crossings may be displayed)-3.059 F .344
-(as man)108 576 R 2.844(yt)-.15 G .344(imes as desired, and ties can be\
- created, deleted, and changed without restriction. Users may also)
--2.844 F(quit)108 588 Q F1(mbna)2.5 E -.1(va)-.25 G(djust).1 E F0
-(and then later reopen the same project without losing an)2.5 E 2.5(yi)
--.15 G(nformation.)-2.5 E F1(Setting Good, P)87 616.8 Q
-(oor and Fixed Na)-.2 E(vigation)-.25 E F0 .101(The adjusted na)108
-628.8 R(vig)-.2 E .101(ation model produced by)-.05 F F1(MBna)2.601 E
--.1(va)-.25 G(djust).1 E F0 .101(should be accurate to the bath)2.601 F
-.1(ymetric resolution)-.05 F .415(in a relati)108 640.8 R .715 -.15
-(ve s)-.25 H .415(ense, b).15 F .415(ut \214tting a set of relati)-.2 F
-.715 -.15(ve o)-.25 H -.25(ff).15 G .415(set ties does not pro).25 F
-.416(vide constraints on the global location)-.15 F .252(of the surv)108
-652.8 R .552 -.15(ey d)-.15 H(ata.).15 E F1(MBna)2.752 E -.1(va)-.25 G
-(djust).1 E F0(pro)2.752 E .252(vides tw)-.15 F 2.752(om)-.1 G .252
-(eans to control the global location of the adjusted na)-2.752 F(vig)-.2
-E(a-)-.05 E .778
-(tion. First, the global location of the model is essentially an a)108
-664.8 R -.15(ve)-.2 G .778(rage of the o).15 F -.15(ve)-.15 G .779
-(rall of).15 F .779(fsets associated with)-.25 F .284(good na)108 676.8
-R(vig)-.2 E .284(ation. Users may use the <Action->Set File Poor Na)-.05
-F(vig)-.2 E .283(ation> menu item to set selected surv)-.05 F -.15(ey)
--.15 G(s).15 E .902(or \214les to be ignored in setting the global mode\
-l. Second, if certain data \214les are thought to ha)108 688.8 R 1.202
--.15(ve c)-.2 H(orrect).15 E(na)108 700.8 Q(vig)-.2 E .318(ation, the)
--.05 F 2.818(yc)-.15 G .318(an be \214x)-2.818 F .317(ed \(e.g. to ha)
--.15 F .617 -.15(ve z)-.2 H .317
-(ero adjustment\) using the <Action->Set File Fix).15 F .317(ed Na)-.15
-F(vig)-.2 E(ation>)-.05 E(menu item. In this case, all of the non-\214x)
-108 712.8 Q(ed \214les are adjusted relati)-.15 E .3 -.15(ve t)-.25 H
-2.5(ot).15 G(he \214x)-2.5 E(ed \214les.)-.15 E(MB-System 5.0)72 768 Q
-(22 April 2015)142.605 E(15)195.945 E 0 Cg EP
-%%Page: 16 16
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mbna)72 48 Q -.25(va)-.2 G 137.51
-(djust\(1\) MB-System).25 F 137.51(5.0 mbna)2.5 F -.25(va)-.2 G
-(djust\(1\)).25 E/F1 10.95/Times-Bold at 0 SF(USING MBN)72 84 Q -1.04
--1.588(AV A)-.219 H(DJUST 3: INVER)1.588 E(TING FOR AN OPTIMAL N)-.438 E
--1.588(AV)-.219 G(IGA)1.588 E(TION SOLUTION)-1.04 E/F2 10/Times-Bold at 0
-SF -.2(Pe)87 96 S(rf).2 E(orming the In)-.25 E -.1(ve)-.4 G(rsion).1 E
-F0 .558(Once the user has interacti)108 108 R -.15(ve)-.25 G .559
-(ly analyzed all of the crossings and closed the "Na).15 F 3.059(vE)-.2
-G .559(rr" windo)-3.059 F 3.059(wb)-.25 G 3.059(yc)-3.059 G(licking)
--3.059 E 2.52(the <Dismiss> b)108 120 R 2.519(utton, the <Action->In)-.2
-F -.15(ve)-.4 G 2.519(rt na).15 F(vig)-.2 E 2.519(ation> b)-.05 F 2.519
-(utton becomes enabled. Clicking this b)-.2 F(utton)-.2 E(causes)108 132
-Q F2(mbna)2.5 E -.1(va)-.25 G(djust).1 E F0(to construct and solv)2.5 E
-2.5(ea)-.15 G 2.5(ni)-2.5 G -1.85 -.4(nv e)-2.5 H
-(rsion for the optimal na).4 E(vig)-.2 E(ation.)-.05 E .214(The in)108
-156 R -.15(ve)-.4 G .214(rsion solv).15 F .214(es for na)-.15 F(vig)-.2
-E .215(ation adjustments at each na)-.05 F(vig)-.2 E .215
-(ation control point which satisfy the of)-.05 F .215(fsets at)-.25 F
-.911(the tie points while minimizing speed and acceleration. The speed \
-and acceleration penalty is set using a)108 168 R .551(penalty weight v)
-108 180 R .551(alue that may be v)-.25 F .552
-(aried. If the penalty weight is lar)-.25 F .552(ge, the na)-.18 F(vig)
--.2 E .552(ation adjustments may be)-.05 F .636(smooth and small b)108
-192 R .635(ut not \214t the tie point of)-.2 F .635
-(fsets well. An in\214nite penalty weight produces uniformly zero)-.25 F
-.169(adjustments. In contrast, a small penalty weight allo)108 204 R
-.169(ws the tie point of)-.25 F .169
-(fsets to be \214t as well as possible e)-.25 F -.15(ve)-.25 G(n).15 E
-.11(if lar)108 216 R .11(ge speed and acceleration spik)-.18 F .11
-(es are a consequence. Hoe)-.1 F -.15(ve)-.25 G .91 -.4(r, e).15 H -.15
-(ve).15 G 2.61(nw).15 G .11(ith a zero penalty weight the in)-2.61 F
--.15(ve)-.4 G -.2(r-).15 G .034(sion may not be able to e)108 228 R .034
-(xactly satisfy all of the tie point of)-.15 F .035
-(fsets. If some of the tie point of)-.25 F .035(fsets are con\215ict-)
--.25 F 1.841(ing \(e.g. one tie point requires a na)108 240 R(vig)-.2 E
-1.841(ation control point to mo)-.05 F 2.141 -.15(ve t)-.15 H 4.341(ot)
-.15 G 1.841(he west while another tie point)-4.341 F(requires a mo)108
-252 Q .3 -.15(ve t)-.15 H 2.5(ot).15 G(he east\), then the of)-2.5 E
-(fsets cannot all be simultaneously \214t e)-.25 E(xactly)-.15 E(.)-.65
-E .914(The in)108 276 R -.15(ve)-.4 G .914
-(rsion is actually performed man).15 F 3.415(yt)-.15 G .915
-(imes with dif)-3.415 F .915
-(ferent penalty weights, and the "best" solution is)-.25 F .356
-(selected and applied to the data. The details of ho)108 288 R 2.856(wt)
--.25 G .356(he "best" solution is identi\214ed are gi)-2.856 F -.15(ve)
--.25 G 2.855(ni).15 G 2.855(nt)-2.855 G .355(he section)-2.855 F 1.214
-("Details of the In)108 300 R -.15(ve)-.4 G 1.214(rsion" section belo)
-.15 F 2.514 -.65(w. A l)-.25 H 1.214(og of the in).65 F -.15(ve)-.4 G
-1.214(rsion parameters, the results from each of the).15 F(in)108 312 Q
--.15(ve)-.4 G .02
-(rsion iterations, and detailed results from the \214nal in).15 F -.15
-(ve)-.4 G .019(rsion are output to the Message te).15 F .019(xt windo)
--.15 F 1.319 -.65(w. T)-.25 H(he).65 E .747
-(program then outputs an adjusted na)108 324 R(vig)-.2 E .747
-(ation \214le for each of the input sw)-.05 F .747
-(ath \214les and updates \(or creates\))-.1 F
-(the parameter \214le for each sw)108 336 Q(ath \214le so that)-.1 E F2
-(mbpr)2.5 E(ocess)-.18 E F0(will mer)2.5 E(ge the adjusted na)-.18 E
-(vig)-.2 E(ation.)-.05 E .019(The output adjusted na)108 360 R(vig)-.2 E
-.019(ation \214les are named by adding a ".na#" suf)-.05 F .019
-(\214x to the original sw)-.25 F .018(ath data \214lename.)-.1 F
-(If a sw)108 372 Q(ath \214le imported into)-.1 E F2(mbna)2.5 E -.1(va)
--.25 G(djust).1 E F0(for the \214rst time is named:)2.5 E
-(mbari_1998_55.mb57)144 384 Q(then the adjusted na)108 396 Q(vig)-.2 E
-(ation resulting from that project will be named:)-.05 E
-(mbari_1998_55.mb57.na0)144 408 Q
-(If this \214le is imported into a second)108 420 Q F2(mbna)2.5 E -.1
-(va)-.25 G(djust).1 E F0(project, the result from in)2.5 E -.15(ve)-.4 G
-(rsion in that project will be:).15 E(mbari_1998_55.mb57.na1)144 432 Q
-.16(In addition to generating the adjusted na)108 444 R(vig)-.2 E
-(ation,)-.05 E F2(mbna)2.66 E -.1(va)-.25 G(djust).1 E F0 .16
-(also sets the N)2.66 F -1.35(AVA)-.35 G .16(DJMODE and N)1.35 F -1.35
-(AVA)-.35 G(D-)1.35 E(JFILE v)108 456 Q(alues in the)-.25 E F2(mbpr)2.5
-E(ocess)-.18 E F0
-(parameter \214le. In this case, the parameter \214le is named:)2.5 E
-(mbari_1998_55.mb57.par)144 468 Q(and the processed sw)108 480 Q
-(ath \214le generated by running)-.1 E F2(mbpr)2.5 E(ocess)-.18 E F0
-(is:)2.5 E(mbari_1998_55p.mb57)144 492 Q(Refer to the)108 504 Q F2(mbpr)
-2.5 E(ocess)-.18 E F0(and)2.5 E F2(mbset)2.5 E F0
-(manual pages for details on the control and use of)2.5 E F2(mbpr)2.5 E
-(ocess)-.18 E F0(.)A .545(Note that the rele)108 528 R -.25(va)-.25 G
-.545(nt parameter \214le settings will re\215ect the most recent in).25
-F -.15(ve)-.4 G .544(rsion in).15 F F2(mbna)3.044 E -.1(va)-.25 G(djust)
-.1 E F0 5.544(.U)C(sers)-5.544 E .078(do need to be a)108 540 R -.1(wa)
--.15 G .078(re that the order of na).1 F(vig)-.2 E .078
-(ation processing is important because, when possible,)-.05 F F2(mbna)
-2.579 E -.1(va)-.25 G(d-).1 E(just)108 552 Q F0 1.448(imports e)3.948 F
-1.447(xisting processed data \214les.)-.15 F 1.447(The data within the)
-6.447 F F2(mbna)3.947 E -.1(va)-.25 G(djust).1 E F0 1.447
-(projects are not, ho)3.947 F(we)-.25 E -.15(ve)-.25 G -.4(r,).15 G .977
-(updated when the source data are updated. Consequently)108 564 R 3.477
-(,s)-.65 G .977(tandard na)-3.477 F(vig)-.2 E .977
-(ation processing should be com-)-.05 F .229(pleted and applied with)108
-576 R F2(mbpr)2.729 E(ocess)-.18 E F0 .229(before a sw)2.729 F .229
-(ath \214le is imported into an)-.1 F F2(mbna)2.729 E -.1(va)-.25 G
-(djust).1 E F0 .228(project. If a sw)2.729 F(ath)-.1 E 1.446
-(\214le is to be used in multiple)108 588 R F2(mbna)3.946 E -.1(va)-.25
-G(djust).1 E F0 1.446
-(projects, the \214rst project should be \214nalized and the results)
-3.946 F(applied before data are imported into the second.)108 600 Q F2
-(Fine-T)87 628.8 Q(uning the In)-.92 E -.1(ve)-.4 G(rsion).1 E F0 1.582
-(Once an in)108 640.8 R -.15(ve)-.4 G 1.582(rsion has been performed, t\
-he user should inspect the \214t for each of the tie points before).15 F
-.595(accepting and applying the adjusted na)108 652.8 R(vig)-.2 E .595
-(ation. The relationship between the interacti)-.05 F -.15(ve)-.25 G
-.595(ly de\214ned na).15 F(vig)-.2 E(a-)-.05 E .169(tion of)108 664.8 R
-.169(fsets and the of)-.25 F .169(fsets associated with the in)-.25 F
--.15(ve)-.4 G .169(rsion can be in).15 F -.15(ve)-.4 G(stig).15 E .169
-(ated numerically in the tie points ta-)-.05 F
-(ble or visually in the "Na)108 676.8 Q 2.5(vE)-.2 G(rr" windo)-2.5 E
--.65(w.)-.25 G 2.344 -.8(We s)108 700.8 T .744(uggest \214rst e).8 F
-.744(xamining the tie points table by pulling do)-.15 F .745(wn the <V)
--.25 F(ie)-.6 E(w->Sho)-.25 E 3.245(wT)-.25 G .745(ies> menu item. This)
--3.595 F .046(table sho)108 712.8 R .046(ws, from left to right, the id\
-entity of each tie point, the longitude and latitude of)-.25 F .045
-(fsets de\214ned by the)-.25 F 1.265
-(user \(in meters\), and the longitude and latitude residuals, or dif)
-108 724.8 R 1.266(ferences between these of)-.25 F 1.266
-(fsets and those)-.25 F(MB-System 5.0)72 768 Q(22 April 2015)142.605 E
-(16)195.945 E 0 Cg EP
-%%Page: 17 17
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mbna)72 48 Q -.25(va)-.2 G 137.51
-(djust\(1\) MB-System).25 F 137.51(5.0 mbna)2.5 F -.25(va)-.2 G
-(djust\(1\)).25 E .541(associated with the in)108 84 R -.15(ve)-.4 G
-.541(rsion \(in meters\).).15 F .541(If an)5.541 F 3.041(yo)-.15 G 3.041
-(ft)-3.041 G .54(hese residuals are une)-3.041 F .54(xpectedly lar)-.15
-F .54(ge, simply clicking)-.18 F .24(on the table line sho)108 96 R .24
-(wing the suspect na)-.25 F(vig)-.2 E .24
-(ation tie will bring up the "Na)-.05 F 2.74(vE)-.2 G .24(rr" windo)
--2.74 F 2.74(wa)-.25 G .24(nd load the cross-)-2.74 F .322
-(ing including that na)108 108 R(vig)-.2 E .321(ation tie. Once an in)
--.05 F -.15(ve)-.4 G .321(rsion is performed, the "Na).15 F 2.821(vE)-.2
-G .321(rr" crossing displays sho)-2.821 F 2.821(wt)-.25 G(he)-2.821 E
-(in)108 120 Q -.15(ve)-.4 G .183(rted of).15 F .183(fset as a small '+'\
- symbol on the mis\214t plot. The user can then determine whether the p\
-re)-.25 F(viously)-.25 E .297(set na)108 132 R(vig)-.2 E .297(ation of)
--.05 F .297(fset is truly required by the data. On occasion, one disco)
--.25 F -.15(ve)-.15 G .296(rs that the of).15 F .296
-(fset obtained in the)-.25 F(in)108 144 Q -.15(ve)-.4 G .266
-(rsion is as consistent with the bath).15 F .266(ymetry as the of)-.05 F
-.266(fset originally set by the user)-.25 F 2.766(.O)-.55 G .266
-(nce the of)-2.766 F .267(fset v)-.25 F(alues)-.25 E(ha)108 156 Q .445
--.15(ve b)-.2 H .145(een adjusted as necessary).15 F 2.645(,t)-.65 G(he)
--2.645 E 2.645(yc)-.15 G .145(an be reset by clicking on the <Set Of)
--2.645 F .144(fset> b)-.25 F .144(utton \(just as in the ear)-.2 F(-)-.2
-E(lier interacti)108 168 Q .3 -.15(ve s)-.25 H(essions\).).15 E .134
-(Once all of the suspect na)108 192 R(vig)-.2 E .134(ation ties ha)-.05
-F .434 -.15(ve b)-.2 H .135
-(een inspected, and perhaps corrected, another in).15 F -.15(ve)-.4 G
-.135(rsion can be).15 F .335(generated using the re)108 204 R .335
-(vised set of of)-.25 F .335(fsets. In this w)-.25 F(ay)-.1 E 2.834(,u)
--.65 G .334(sers can iterate o)-2.834 F -.15(ve)-.15 G 2.834(rc).15 G
-.334(ycles of in)-2.984 F -.15(ve)-.4 G .334(rsion and inspec-).15 F
-.192(tion until a satisf)108 216 R .193
-(actory \(self-consistemt\) solution is obtained. When the \214nal in)
--.1 F -.15(ve)-.4 G .193(rsion has been performed,).15 F .715
-(the user can then run)108 228 R/F1 10/Times-Bold at 0 SF(mbpr)3.215 E
-(ocess)-.18 E F0 .715(on all of the af)3.215 F .714(fected sw)-.25 F
-.714(ath data \214les to produce a set of processed \214les)-.1 F .56
-(incorporating the optimally adjusted na)108 240 R(vig)-.2 E .56
-(ation. Once ag)-.05 F .56(ain, we emphasize that users should al)-.05 F
--.1(wa)-.1 G .56(ys \214nal-).1 F(ize an)108 252 Q F1(mbna)2.5 E -.1(va)
--.25 G(djust).1 E F0(project before importing af)2.5 E(fected sw)-.25 E
-(ath data into another)-.1 E F1(mbna)2.5 E -.1(va)-.25 G(djust).1 E F0
-(project.)2.5 E F1(Details of the In)87 280.8 Q -.1(ve)-.4 G(rsion).1 E
-F0 .516(The in)108 292.8 R -.15(ve)-.4 G .516
-(rsion is constructed as a sparse o).15 F -.15(ve)-.15 G .515
-(rdetermined least squares matrix problem. Suppose we ha).15 F .815 -.15
-(ve N)-.2 H(na)108 304.8 Q(vig)-.2 E .122
-(ation control points in all of the sw)-.05 F .122(ath \214les and ha)
--.1 F .423 -.15(ve d)-.2 H .123
-(e\214ned M tie points. The form of the problem is:).15 F F1 2.5(AX)144
-328.8 S F0(=)A F1(D)2.5 E F0(Here)108 352.8 Q F1(X)3.112 E F0 .611
-(is the v)3.111 F .611(ector of unkno)-.15 F .611
-(wns, which happen to be the changes in the longitude and latitude v)
--.25 F .611(alues of)-.25 F .405(all of the na)108 364.8 R(vig)-.2 E
-.405(ation control points. So, there are 2N unkno)-.05 F .405
-(wns. Note that we do not solv)-.25 F 2.906(ed)-.15 G .406
-(irectly for lon-)-2.906 F 1.355(gitude and latitude, b)108 376.8 R
-1.355(ut rather for the change, or perturbation, to the longitude and l\
-atitude v)-.2 F 3.855(alues. The)-.25 F(matrix)108 388.8 Q F1(A)2.643 E
-F0 .143(contains 2N columns corresponding to the unkno)2.643 F .143
-(wns and a ro)-.25 F 2.643(wf)-.25 G .144
-(or each of the constraints we can)-2.643 F 1.329(apply to the na)108
-400.8 R(vig)-.2 E 1.328
-(ation adjustment problem. The number of elements in the "data" v)-.05 F
-(ector)-.15 E F1(D)3.828 E F0 1.328(also corre-)3.828 F
-(sponds to the number of constraints.)108 412.8 Q 1.6 -.8(We a)5 H
-(pply four sets of constraints in this in).8 E -.15(ve)-.4 G
-(rse problem:).15 E(1\) Fix)144 424.8 Q(ed na)-.15 E(vig)-.2 E
-(ation points)-.05 E(2\) Penalize speed \(\214rst deri)144 436.8 Q -.25
-(va)-.25 G(ti).25 E -.15(ve)-.25 G(\)).15 E
-(3\) Penalize acceleration \(second deri)144 448.8 Q -.25(va)-.25 G(ti)
-.25 E -.15(ve)-.25 G(\)).15 E(4\) Fit na)144 460.8 Q(vig)-.2 E(ation of)
--.05 E(fsets at tie points)-.25 E
-(The \214rst kind of constraint is simply e)108 484.8 Q(xpressed as:)
--.15 E(XLONj = 0)144 508.8 Q(XLA)144 532.8 Q(Tj = 0)-1.11 E 1.197
-(where XLONj is the longitude change and XLA)108 556.8 R 1.197
-(Tj is the latitude change for the "j"th na)-1.11 F(vig)-.2 E 1.197
-(ation control)-.05 F(point.)108 568.8 Q
-(The second contraint \(speed\) is also one of minimization:)108 592.8 Q
-(-XLONj + XLONj+1)144 616.8 Q 2.5(---------------- =)144 628.8 R(0)2.5 E
-(\255Tj + Tj+1)154 640.8 Q(-XLA)144 664.8 Q(Tj + XLA)-1.11 E(Tj+1)-1.11
-E 2.5(---------------- =)144 676.8 R(0)2.5 E(\255Tj + Tj+1)154 688.8 Q
-.954(Here XLONj+1 and XLA)108 712.8 R .954
-(Tj+1 are the longitude and latitude changes for the "j+1"th na)-1.11 F
-(vig)-.2 E .953(ational control)-.05 F .09
-(point and Tj and Tj+1 are the times of the "j"th and "j+1"th na)108
-724.8 R(vig)-.2 E .09(ational control points. The denominator in)-.05 F
-(MB-System 5.0)72 768 Q(22 April 2015)142.605 E(17)195.945 E 0 Cg EP
-%%Page: 18 18
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mbna)72 48 Q -.25(va)-.2 G 137.51
-(djust\(1\) MB-System).25 F 137.51(5.0 mbna)2.5 F -.25(va)-.2 G
-(djust\(1\)).25 E .855(these e)108 84 R .855
-(xpressions is thus the time dif)-.15 F .855(ference between the tw)-.25
-F 3.355(on)-.1 G -.2(av)-3.355 G(ig).2 E .854
-(ation points. The speed constraint can)-.05 F 1.507
-(only be applied to na)108 96 R(vig)-.2 E 1.508(ation control points th\
-at are sequential, and is not applied across breaks in the)-.05 F(sw)108
-108 Q .381(ath data. Note that multiple sw)-.1 F .381
-(ath \214les may be sequential without breaks, while time g)-.1 F .38
-(aps or breaks can)-.05 F .568(occur within a single sw)108 120 R .568
-(ath \214le. The e)-.1 F .568(xistence of g)-.15 F .569
-(aps or breaks in the sw)-.05 F .569(ath data is determined solely on)
--.1 F(the basis of time g)108 132 Q(aps as the data are imported.)-.05 E
-(The third contraint \(acceleration\) is also one of minimization:)108
-156 Q(XLONj \255 2 * XLONj+1 + XLONj+2)144 180 Q 10
-(----------------------------- =)144 192 R(0)2.5 E(\255Tj + Tj+2)154 204
-Q(XLA)144 228 Q(Tj \2552 * XLA)-1.11 E(Tj+1 + XLA)-1.11 E(Tj+2)-1.11 E
-10(----------------------------- =)144 240 R(0)2.5 E(\255Tj + Tj+2)154
-252 Q .496(The second deri)108 276 R -.25(va)-.25 G(ti).25 E .796 -.15
-(ve c)-.25 H .496(alculation requires three sequential na).15 F(vig)-.2
-E .496(ation control points: j, j+1, and j+2.)-.05 F(Here)5.495 E .872
-(XLONj+2 and XLA)108 288 R .873
-(Tj+2 are the longitude and latitude changes for the "j+2"th na)-1.11 F
-(vig)-.2 E .873(ational control point)-.05 F .091
-(and Tj and Tj+2 are the times of the "j"th and "j+2"th na)108 300 R
-(vig)-.2 E .09(ational control points. The denominator in these)-.05 F
--.15(ex)108 312 S(pressions is thus the time dif).15 E
-(ference between the "j"th and "j+1"th na)-.25 E(vig)-.2 E
-(ation points.)-.05 E 1.14
-(The \214nal, and most important constraints are the relati)108 336 R
-1.44 -.15(ve n)-.25 H -.2(av).15 G(ig).2 E 1.14
-(ation ofsets de\214ned for each of the M tie)-.05 F 3.294
-(points. Since)108 348 R .794(each of)3.294 F .794
-(fset has a longitude and a latitude v)-.25 F .794
-(alue, there are 2M ro)-.25 F .794(ws in)-.25 F/F1 10/Times-Bold at 0 SF(A)
-3.294 E F0 .794(and elements in)3.294 F F1(D)3.294 E F0 1.522
-(associated with the tie points.)108 360 R 1.522
-(If the "i"th tie point speci\214es an of)6.522 F 1.523
-(fset DLONi and DLA)-.25 F 2.223 -.35(Ti b)-1.11 H 1.523(etween the).35
-F("j1"th and "j2"th na)108 372 Q(vig)-.2 E
-(ation control points, then the constraint may be e)-.05 E(xpressed as:)
--.15 E(-XLONj1 + XLONj2 = DLONi)144 396 Q(-XLA)144 420 Q(Tj1 + XLA)-1.11
-E(Tj2 = DLA)-1.11 E -.35(Ti)-1.11 G 1.318
-(The size of the matrix problem will v)108 456 R 1.318
-(ary with the number of na)-.25 F(vig)-.2 E 1.317
-(ation control points, tie points, \214x)-.05 F(ed)-.15 E .736
-(points, and time g)108 468 R .736(aps. Ho)-.05 F(we)-.25 E -.15(ve)-.25
-G 1.536 -.4(r, t).15 H .737(he addition of the speed and acceleration m\
-inimization constraints guar).4 F(-)-.2 E .814
-(entees that the number of constraints will al)108 480 R -.1(wa)-.1 G
-.813(ys be lar).1 F .813(ger than the number of unkno)-.18 F .813
-(wns, and so we will)-.25 F(al)108 492 Q -.1(wa)-.1 G 1.053
-(ys be solving an o).1 F -.15(ve)-.15 G 1.053
-(rdetermined least squares problem.).15 F 1.054(Each of the abo)6.054 F
-1.354 -.15(ve e)-.15 H 1.054(quations contrib).15 F 1.054(ute one)-.2 F
-(ro)108 504 Q 2.57(wt)-.25 G 2.57(ot)-2.57 G .07
-(he matrix problem, and each of these ro)-2.57 F .069
-(ws has at most three nonzero elements in)-.25 F F1(A)2.569 E F0 2.569
-(.A)C 2.569(sar)-2.569 G .069(esult, this)-2.569 F .533
-(matrix problem is also al)108 516 R -.1(wa)-.1 G .533(ys e).1 F .533
-(xtremely sparse. This condition allo)-.15 F .534
-(ws us to use one of a class of approxi-)-.25 F .376
-(mate least squares solution algorithms that are ef)108 528 R .375
-(\214cient in solving sparse problems. The algorithm used for)-.25 F F1
-(mbna)108 540 Q -.1(va)-.25 G(djust).1 E F0(in)2.5 E -.15(ve)-.4 G
-(rsions is that of Olsen [1987].).15 E .403(The importance of the speed\
- and acceleration minimization constraints is v)108 564 R .403
-(aried by multiplying the associ-)-.25 F 1.021(ated matrix ro)108 576 R
-3.521(we)-.25 G 1.021(lements by a penalty weight v)-3.521 F 3.521
-(alue. In)-.25 F 1.02(practice, the in)3.521 F -.15(ve)-.4 G 1.02
-(rsion is constructed and solv).15 F(ed)-.15 E .684(with man)108 588 R
-3.184(yd)-.15 G(if)-3.184 E .684
-(ferent penalty weights, and the "best" in)-.25 F -.15(ve)-.4 G .685
-(rsion is selected and applied. Generally speaking,).15 F 1.119
-(we seek the smoothest in)108 600 R -.15(ve)-.4 G 1.118
-(rsion that satisf).15 F 1.118(actorily \214ts the tie point of)-.1 F
-1.118(fsets. W)-.25 F 3.618(es)-.8 G 1.118(et smoothness using the)
--3.618 F .066(penalty weight v)108 612 R .066(alue so that lar)-.25 F
-.066(ger penalty weights correspond to smoother solutions.)-.18 F 1.667
--.8(We m)5.066 H .067(easure the \214t to).8 F(the tie point of)108 624
-Q(fsets using the usual least squares calculation:)-.25 E 57.5 15(22 2)
-151.5 636 T 2.5(Fit =)144 648 R 2.5(Chi =)2.5 F 2.5(SUM\( \(DLONi)2.5 F
-2.5<ad28>2.5 G(XLONj2 \255 XLONj1\)\))-2.5 E(2)261.5 660 Q 2.5(+\()189
-672 S(DLA)-2.5 E .7 -.35(Ti \255 \()-1.11 H(XLA).35 E(Tj2 \255 XLA)-1.11
-E 2.5(Tj1\)\) \))-1.11 F .242(using the same notation as abo)108 684 R
--.15(ve)-.15 G 2.742(.N).15 G .242
-(ote that the units of Chi are distance, and so are ph)-2.742 F .241
-(ysically meaningful.)-.05 F 3.203(As)108 696 S .703
-(maller Chi corresponds to a better \214t to the tie point of)-3.203 F
-.703(fsets. The Chi v)-.25 F .704(alue will be smallest for a zero)-.25
-F(penalty weight, and increase as more smoothing is applied.)108 708 Q
-(MB-System 5.0)72 768 Q(22 April 2015)142.605 E(18)195.945 E 0 Cg EP
-%%Page: 19 19
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mbna)72 48 Q -.25(va)-.2 G 137.51
-(djust\(1\) MB-System).25 F 137.51(5.0 mbna)2.5 F -.25(va)-.2 G
-(djust\(1\)).25 E .153(The initial solution is generated using a v)108
-84 R .152(ery small penalty weight to insure that the smoothing is ne)
--.15 F(gligible)-.15 E .053(and that the tie point of)108 96 R .054
-(fsets are \214t to the maximum de)-.25 F .054
-(gree possible. This \214rst in)-.15 F -.15(ve)-.4 G .054
-(rsion is used to set a "ref-).15 F .373(erence" v)108 108 R .372
-(alue of Chi. In some cases, the tie points of)-.25 F .372
-(fsets do not substantially con\215ict and it is possible for)-.25 F
-.591(the in)108 120 R -.15(ve)-.4 G .591(rsion to \214t the of).15 F
-.591(fsets nearly e)-.25 F .592(xactly so that Chi is quite small. If t\
-he initial Chi is greater than the)-.15 F(tar)108 132 Q .839
-(get precision for the in)-.18 F -.15(ve)-.4 G .838
-(rsion \(set from the Controls panel\),).15 F/F1 10/Times-Bold at 0 SF
-(mbna)3.338 E -.1(va)-.25 G(djust).1 E F0 .838
-(sets the reference \214t to this)3.338 F .081(initial v)108 144 R .081
-(alue. Otherwise, the reference \214t is set to the tar)-.25 F .082
-(get precision. The def)-.18 F .082(ault v)-.1 F .082
-(alue is 0.1 meters, which)-.25 F 1.264
-(is appropriate for high resolution, lo)108 156 R 1.264(w-altitude surv)
--.25 F -.15(ey)-.15 G 1.264(s. Lar).15 F 1.264(ger v)-.18 F 1.263
-(alues will be more appropriate for lar)-.25 F(ge)-.18 E 1.778
-(altitude \(e.g. deep w)108 168 R 1.778(ater hull-mounted\) surv)-.1 F
--.15(ey)-.15 G 1.779
-(s. The program then recalculates solutions with dif).15 F(ferent)-.25 E
-.529(penalty weights until the resulting Chi is between 1.05 and 1.1 ti\
-mes the reference \214t. This last solution is)108 180 R 1.17
-(chosen as the best solution, reported as the na)108 192 R(vig)-.2 E
-1.17(ation adjustment in)-.05 F -.15(ve)-.4 G 1.17
-(rsion solution, and applied to that).15 F(sw)108 204 Q 2.293
-(ath data na)-.1 F(vig)-.2 E 4.793(ation. The)-.05 F 2.293
-(justi\214cation for choosing the optimal solution in this f)4.793 F
-2.292(ashion is that this)-.1 F .788
-(approach insures that the smoothness constraint is suf)108 216 R .788
-(\214cient lar)-.25 F .788(ge to be impacting the \214t, b)-.18 F .789
-(ut not so lar)-.2 F(ge)-.18 E(that the \214t has been substantially de)
-108 228 Q(graded.)-.15 E/F2 10.95/Times-Bold at 0 SF(REFERENCES)72 256.8 Q
-F0 1.392(Nishimura, C. E., and D. W)108 268.8 R 3.892(.F)-.92 G 1.392
-(orsyth, Impro)-4.042 F -.15(ve)-.15 G 1.392(ments in na).15 F(vig)-.2 E
-1.392(ation using SeaBeam crossing errors,)-.05 F/F3 10/Times-Italic at 0
-SF(Mar)3.892 E(.)-1.11 E(Geophys. Res.)108 280.8 Q F0(,)A F1(9)2.5 E F0
-2.5(,3)C(33-352, 1988.)-2.5 E 1.648(Olson, A. H., A Chebyshe)108 292.8 R
-4.148(vc)-.25 G 1.648(ondition for accelerating con)-4.148 F -.15(ve)-.4
-G -.18(rg).15 G 1.649(ence of iterati).18 F 1.949 -.15(ve t)-.25 H 1.649
-(omographic methods \255).15 F(Solving lar)108 304.8 Q
-(ge least squares problems, Ph)-.18 E(ys. Earth Planet. Inter)-.05 E
-(., 47, 333-345, 1987.)-.55 E -.15(Pa)108 316.8 S(rk).15 E(er)-.1 E 2.5
-(,R)-.4 G 2.5(.L)-2.5 G(.,)-2.5 E F1(Geoph)2.5 E(ysical In)-.15 E -.1
-(ve)-.4 G(rse Theory).1 E F0 2.5(,P)C(rinceton Uni)-2.5 E -.15(ve)-.25 G
-(rsity Press, Princeton, NJ, 1994.).15 E F2(SEE ALSO)72 345.6 Q F1(mbna)
-108 357.6 Q -.1(va)-.25 G(djustmer).1 E(ge\(1\))-.1 E F0(,)A F1
-(mbsystem)2.5 E F0(\(1\),)A F1(mbio)2.5 E F0(\(1\),)A F1(mbpr)2.5 E
-(ocess)-.18 E F0(\(1\),)A F1(mbna)2.5 E -.1(ve)-.25 G(dit).1 E F0
-(\(1\),)A F1(mbset)2.5 E F0(\(1\))A F2 -.11(BU)72 386.4 S(GS).11 E F0
-(It used to be too ne)108 398.4 Q 2.5(wt)-.25 G 2.5(ob)-2.5 G 2.5(eb)
--2.5 G(ulletproof, no)-2.7 E 2.5(wi)-.25 G(ts too complicated to be b)
--2.5 E 2.5(ulletproof. Good)-.2 F(luck.)2.5 E(MB-System 5.0)72 768 Q
-(22 April 2015)142.605 E(19)195.945 E 0 Cg EP
-%%Trailer
-end
-%%EOF
diff --git a/src/ps/mbnavadjustmerge.ps b/src/ps/mbnavadjustmerge.ps
deleted file mode 100644
index 7d5b1df..0000000
--- a/src/ps/mbnavadjustmerge.ps
+++ /dev/null
@@ -1,602 +0,0 @@
-%!PS-Adobe-3.0
-%%Creator: groff version 1.19.2
-%%CreationDate: Wed Jul  1 12:29:30 2015
-%%DocumentNeededResources: font Times-Roman
-%%+ font Times-Bold
-%%+ font Times-Italic
-%%DocumentSuppliedResources: procset grops 1.19 2
-%%Pages: 4
-%%PageOrder: Ascend
-%%DocumentMedia: Default 612 792 0 () ()
-%%Orientation: Portrait
-%%EndComments
-%%BeginDefaults
-%%PageMedia: Default
-%%EndDefaults
-%%BeginProlog
-%%BeginResource: procset grops 1.19 2
-%!PS-Adobe-3.0 Resource-ProcSet
-/setpacking where{
-pop
-currentpacking
-true setpacking
-}if
-/grops 120 dict dup begin
-/SC 32 def
-/A/show load def
-/B{0 SC 3 -1 roll widthshow}bind def
-/C{0 exch ashow}bind def
-/D{0 exch 0 SC 5 2 roll awidthshow}bind def
-/E{0 rmoveto show}bind def
-/F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def
-/G{0 rmoveto 0 exch ashow}bind def
-/H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/I{0 exch rmoveto show}bind def
-/J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def
-/K{0 exch rmoveto 0 exch ashow}bind def
-/L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/M{rmoveto show}bind def
-/N{rmoveto 0 SC 3 -1 roll widthshow}bind def
-/O{rmoveto 0 exch ashow}bind def
-/P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/Q{moveto show}bind def
-/R{moveto 0 SC 3 -1 roll widthshow}bind def
-/S{moveto 0 exch ashow}bind def
-/T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/SF{
-findfont exch
-[exch dup 0 exch 0 exch neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/MF{
-findfont
-[5 2 roll
-0 3 1 roll
-neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/level0 0 def
-/RES 0 def
-/PL 0 def
-/LS 0 def
-/MANUAL{
-statusdict begin/manualfeed true store end
-}bind def
-/PLG{
-gsave newpath clippath pathbbox grestore
-exch pop add exch pop
-}bind def
-/BP{
-/level0 save def
-1 setlinecap
-1 setlinejoin
-72 RES div dup scale
-LS{
-90 rotate
-}{
-0 PL translate
-}ifelse
-1 -1 scale
-}bind def
-/EP{
-level0 restore
-showpage
-}def
-/DA{
-newpath arcn stroke
-}bind def
-/SN{
-transform
-.25 sub exch .25 sub exch
-round .25 add exch round .25 add exch
-itransform
-}bind def
-/DL{
-SN
-moveto
-SN
-lineto stroke
-}bind def
-/DC{
-newpath 0 360 arc closepath
-}bind def
-/TM matrix def
-/DE{
-TM currentmatrix pop
-translate scale newpath 0 0 .5 0 360 arc closepath
-TM setmatrix
-}bind def
-/RC/rcurveto load def
-/RL/rlineto load def
-/ST/stroke load def
-/MT/moveto load def
-/CL/closepath load def
-/Fr{
-setrgbcolor fill
-}bind def
-/setcmykcolor where{
-pop
-/Fk{
-setcmykcolor fill
-}bind def
-}if
-/Fg{
-setgray fill
-}bind def
-/FL/fill load def
-/LW/setlinewidth load def
-/Cr/setrgbcolor load def
-/setcmykcolor where{
-pop
-/Ck/setcmykcolor load def
-}if
-/Cg/setgray load def
-/RE{
-findfont
-dup maxlength 1 index/FontName known not{1 add}if dict begin
-{
-1 index/FID ne{def}{pop pop}ifelse
-}forall
-/Encoding exch def
-dup/FontName exch def
-currentdict end definefont pop
-}bind def
-/DEFS 0 def
-/EBEGIN{
-moveto
-DEFS begin
-}bind def
-/EEND/end load def
-/CNT 0 def
-/level1 0 def
-/PBEGIN{
-/level1 save def
-translate
-div 3 1 roll div exch scale
-neg exch neg exch translate
-0 setgray
-0 setlinecap
-1 setlinewidth
-0 setlinejoin
-10 setmiterlimit
-[]0 setdash
-/setstrokeadjust where{
-pop
-false setstrokeadjust
-}if
-/setoverprint where{
-pop
-false setoverprint
-}if
-newpath
-/CNT countdictstack def
-userdict begin
-/showpage{}def
-/setpagedevice{}def
-}bind def
-/PEND{
-countdictstack CNT sub{end}repeat
-level1 restore
-}bind def
-end def
-/setpacking where{
-pop
-setpacking
-}if
-%%EndResource
-%%EndProlog
-%%BeginSetup
-%%BeginFeature: *PageSize Default
-<< /PageSize [ 612 792 ] /ImagingBBox null >> setpagedevice
-%%EndFeature
-%%IncludeResource: font Times-Roman
-%%IncludeResource: font Times-Bold
-%%IncludeResource: font Times-Italic
-grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72
-def/PL 792 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron/Zcaron
-/scaron/zcaron/Ydieresis/trademark/quotesingle/Euro/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/space/exclam/quotedbl/numbersign/dollar/percent
-/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen
-/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon
-/semicolon/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O
-/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright/circumflex
-/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y
-/z/braceleft/bar/braceright/tilde/.notdef/quotesinglbase/guillemotleft
-/guillemotright/bullet/florin/fraction/perthousand/dagger/daggerdbl
-/endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut
-/dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash
-/quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen
-/brokenbar/section/dieresis/copyright/ordfeminine/guilsinglleft
-/logicalnot/minus/registered/macron/degree/plusminus/twosuperior
-/threesuperior/acute/mu/paragraph/periodcentered/cedilla/onesuperior
-/ordmasculine/guilsinglright/onequarter/onehalf/threequarters
-/questiondown/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE
-/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex
-/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis
-/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn
-/germandbls/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla
-/egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis
-/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide/oslash
-/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis]def
-/Times-Italic at 0 ENC0/Times-Italic RE/Times-Bold at 0 ENC0/Times-Bold RE
-/Times-Roman at 0 ENC0/Times-Roman RE
-%%EndSetup
-%%Page: 1 1
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mbna)72 48 Q -.25(va)-.2 G(djustmer).25 E 112.7
-(ge\(1\) MB-System)-.18 F 112.7(5.0 mbna)2.5 F -.25(va)-.2 G(djustmer)
-.25 E(ge\(1\))-.18 E/F1 10.95/Times-Bold at 0 SF -.219(NA)72 84 S(ME).219 E
-/F2 10/Times-Bold at 0 SF(mbna)108 96 Q -.1(va)-.25 G(djustmer).1 E(ge)-.1
-E F0 2.762<ad54>2.762 G .262(ool to mer)-3.562 F .262(ge tw)-.18 F 2.761
-(oM)-.1 G(Bna)-2.761 E -.25(va)-.2 G .261
-(djust projects, either adding one to the \214rst or outputting).25 F
-2.5(an)108 108 S .5 -.25(ew p)-2.5 H(roject combining both e).25 E
-(xisting projects.)-.15 E F1(VERSION)72 136.8 Q F0 -1.11(Ve)108 148.8 S
-(rsion 5.0)1.11 E F1(SYNOPSIS)72 177.6 Q F2(mbna)108 189.6 Q -.1(va)-.25
-G(djustmer).1 E(ge)-.1 E F0 8.068(--input=project-base [--input=project\
--add --output=project-output --set-global-)10.567 F
-(tie=\214le:section[:sna)108 201.6 Q(v]/xof)-.2 E(fset/yof)-.25 E
-(fset/zof)-.25 E 36.45
-(fset[/xsigma/ysigma/zsigma] --set-global-tie-xyz=\214le:sec-)-.25 F
-(tion[:sna)108 213.6 Q 6.85
-(v] --set-global-tie-xyonly=\214le:section[:sna)-.2 F 6.85
-(v] --set-global-tie-zonly=\214le:section[:sna)-.2 F 6.85(v] --unset-)
--.2 F 17.555(global-tie=\214le:section --add-crossing=\214le1:section1/\
-\214le2:section2 --set-tie=\214le1:section1/\214le2:sec-)108 225.6 R
-(tion2/xof)108 237.6 Q(fset/yof)-.25 E(fset/zof)-.25 E 23.26(fset --set\
--tie-xyz=\214le1:section1/\214le2:section2 --set-tie-xyonly=\214le1:sec\
--)-.25 F 9.81(tion1/\214le2:section2 --set-tie-zonly=\214le1:section1/\
-\214le2:section2 --unset-tie=\214le1:section1/\214le2:section2)108 249.6
-R 2.92(--set-ties-xyz-with-\214le=\214le --set-ties-xyonly-with-\214le=\
-\214le --set-ties-zonly-with-\214le=\214le --set-ties-xyz-by-)108 261.6
-R(surv)108 273.6 Q -.15(ey)-.15 G(=surv).15 E 6.98 -.15(ey -)-.15 H
-(-set-ties-xyonly-by-surv).15 E -.15(ey)-.15 G(=surv).15 E 6.98 -.15
-(ey -)-.15 H(-set-ties-zonly-by-surv).15 E -.15(ey)-.15 G(=surv).15 E
-6.98 -.15(ey -)-.15 H(-set-ties-xyz-by-).15 E(block=surv)108 285.6 Q
--.15(ey)-.15 G(1/surv).15 E -.15(ey)-.15 G 3.985(2-).15 G
-(-set-ties-xyonly-by-block=surv)-3.985 E -.15(ey)-.15 G(1/surv).15 E
--.15(ey)-.15 G 3.985(2-).15 G(-set-ties-zonly-by-block=surv)-3.985 E
--.15(ey)-.15 G(1/sur).15 E(-)-.2 E -.15(vey)108 297.6 S 14.097(2-).15 G
-(-set-ties-zof)-14.097 E(fset-by-block=surv)-.25 E -.15(ey)-.15 G
-(1/surv).15 E -.15(ey)-.15 G(2/zof).15 E 11.597
-(fset --skip-unset-crossings --insert-discontinu-)-.25 F
-(ity=\214le:section --v)108 309.6 Q(erbose --help ])-.15 E F1
-(DESCRIPTION)72 338.4 Q F2(MBna)108 350.4 Q -.1(va)-.25 G(djustmer).1 E
-(ge)-.1 E F0 .272(is a command line program that mer)2.772 F .272
-(ges tw)-.18 F 2.772(oe)-.1 G(xisting)-2.922 E F2(MBna)2.773 E -.1(va)
--.25 G(djust).1 E F0 .273(projects or modi-)2.773 F(\214es a single)108
-362.4 Q F2(MBna)2.5 E -.1(va)-.25 G(djust).1 E F0(project.)2.5 E F2
-(MBna)108 386.4 Q -.1(va)-.25 G(djust).1 E F0 .388(is an interacti)2.888
-F .687 -.15(ve g)-.25 H .387(raphical program used to adjust sw).15 F
-.387(ath data na)-.1 F(vig)-.2 E .387(ation by matching bath)-.05 F(y-)
--.05 E .894(metric features in o)108 398.4 R -.15(ve)-.15 G .894
-(rlapping and crossing sw).15 F .894(aths. The primary purpose of)-.1 F
-F2(mbna)3.395 E -.1(va)-.25 G(djust).1 E F0 .895(is to eliminate)3.395 F
-(relati)108 410.4 Q .3 -.15(ve n)-.25 H -.2(av).15 G(ig).2 E
-(ational errors in sw)-.05 E(ath data obtained from poorly na)-.1 E(vig)
--.2 E(ated sonars.)-.05 E -.4(Wi)108 434.4 S .805(th respect to the mer)
-.4 F .805(ging function, if the)-.18 F F2(MBna)3.305 E -.1(va)-.25 G
-(djustmer).1 E(ge)-.1 E F0 .805(user speci\214es tw)3.305 F 3.304(oi)-.1
-G .804(nput projects and no)-3.304 F .873(output project, then the seco\
-nd project is added to the \214rst. If an output project is speci\214ed\
-, then the tw)108 446.4 R(o)-.1 E(projects are mer)108 458.4 Q
-(ged and the ne)-.18 E 2.5(wc)-.25 G(ombined project is output.)-2.5 E
-.405(In order to mak)108 482.4 R 2.904(eu)-.1 G .404(se of the project \
-modi\214cation commands, a single input project must be speci\214ed, al\
-ong)-2.904 F 1.024(with one or more of the modi\214cation commands. The\
-se can include adding crossings, setting tie z-of)108 494.4 R(fset)-.25
-E -.25(va)108 506.4 S .912(lues, setting tie of).25 F .912(fsets \(e)
--.25 F -.15(ve)-.25 G 3.412(ni).15 G 3.412(fn)-3.412 G 3.412(oc)-3.412 G
-.912(orresponding crossing already e)-3.412 F .912
-(xists\), setting tie modes \(xy only)-.15 F 3.411(,z)-.65 G(only)108
-518.4 Q 2.5(,x)-.65 G 2.5(yz\), and)-2.5 F(deleting ties.)2.5 E F1 -.548
-(AU)72 547.2 S(THORSHIP).548 E F0(Da)108 559.2 Q(vid W)-.2 E 2.5(.C)-.92
-G(aress \(caress at mbari.or)-2.5 E(g\))-.18 E(Montere)113 571.2 Q 2.5(yB)
--.15 G(ay Aquarium Research Institute)-2.5 E
-(Dale N. Chayes \(dale at ldeo.columbia.edu\))108 583.2 Q
-(Lamont-Doherty Earth Observ)113 595.2 Q(atory)-.25 E F1(OPTIONS)72 624
-Q F2(\255-input=pr)108 636 Q(oject-base)-.18 E(\255-input=pr)144 648 Q
-(oject-add)-.18 E F0(The)5.028 E F2(--input)5.028 E F0 2.528
-(option de\214nes an e)5.028 F 2.528(xisting, input)-.15 F F2(MBna)5.028
-E -.1(va)-.25 G(djust).1 E F0 2.528(project. A)5.028 F .814
-(project may be de\214ned by a relati)144 660 R 1.113 -.15(ve o)-.25 H
-3.313(ra).15 G .813(bsolute path to the project *.n)-3.313 F .813
-(vh \214le or the project *.dir)-.4 F(directory)144 672 Q 3.931(.T)-.65
-G 1.431(his option can be used twice to specify tw)-3.931 F 3.931(oi)-.1
-G 1.432(nput projects. The \214rst use of)-3.931 F F2(--input)3.932 E F0
-.57(de\214nes the base input project, and the second de\214nes the add \
-input project. In the case where the)144 684 R F2(--output)144 696 Q F0
-.817(option is used to de\214ne an output project, the tw)3.317 F 3.317
-(oi)-.1 G .817(nput projects will both be copied to)-3.317 F 1.503
-(the ne)144 708 R 4.003(wo)-.25 G 1.503(utput project \()-4.003 F/F3 10
-/Times-Italic at 0 SF(pr)A(oject-base)-.45 E F0 1.503(\214rst follo)4.003 F
-1.503(wed by)-.25 F F3(pr)4.003 E(oject-add)-.45 E F0 1.503(\). If the)B
-F2(output)4.003 E F0 1.502(option is not)4.003 F .593
-(speci\214ed, then the)144 720 R F3(pr)3.093 E(oject-base)-.45 E F0 .593
-(project is used as the output, and the)3.093 F F3(pr)3.094 E(oject-add)
--.45 E F0 .594(project is added)3.094 F(MB-System 5.0)72 768 Q
-(21 March 2015)140.11 E(1)198.45 E 0 Cg EP
-%%Page: 2 2
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mbna)72 48 Q -.25(va)-.2 G(djustmer).25 E 112.7
-(ge\(1\) MB-System)-.18 F 112.7(5.0 mbna)2.5 F -.25(va)-.2 G(djustmer)
-.25 E(ge\(1\))-.18 E .66(on to the)144 84 R/F1 10/Times-Italic at 0 SF(pr)
-3.16 E(oject-base)-.45 E F0 .66(project. If only the base input project\
- is speci\214ed, then that project will be)3.16 F(modi\214ed according \
-to one or more of the "add", "delete", "skip", or "set" commands.)144 96
-Q/F2 10/Times-Bold at 0 SF(\255-output=pr)108 112.8 Q(oject-output)-.18 E
-F0 .524(This option de\214nes the ne)144 124.8 R(w)-.25 E F2(MBna)3.024
-E -.1(va)-.25 G .524(djust output pr).1 F .524(oject. The tw)-.18 F
-3.024(oi)-.1 G .525(nput pr)-3.024 F .525(ojects will both be)-.18 F
-1.216(copied to the new output pr)144 136.8 R 1.215(oject \()-.18 F F1
-(pr)A(oject-base)-.45 E F2 1.215(\214rst f)6.215 F(ollo)-.25 E 1.215
-(wed by)-.1 F F1(pr)3.715 E(oject-add)-.45 E F2 3.715(\). If)B 1.215
-(the output)3.715 F .305(option is not speci\214ed, then the)144 148.8 R
-F1(pr)2.805 E(oject-base)-.45 E F2(pr)2.805 E .306
-(oject is used as the output, and the)-.18 F F1(pr)2.806 E(oject-add)
--.45 E F2(pr)144 160.8 Q(oject is added on to the)-.18 E F1(pr)2.5 E
-(oject-base)-.45 E F2(pr)2.5 E(oject.)-.18 E
-(\255-set-global-tie=\214le:section[:sna)108 177.6 Q(v]/xoffset/y)-.25 E
-(offset/zoffset[/xsigma/ysigma/zsigma])-.25 E F0 .301
-(This options sets a global tie for a na)144 189.6 R(vig)-.2 E .301
-(ation point in the project. Global ties are ties to the global)-.05 F
-1.151
-(reference frame, which generally means GPS positions \(e.g. WGS84\).)
-144 201.6 R 1.151(The \214le and section id')6.151 F(s)-.55 E .754(must\
- be speci\214ed, along with the x \(east-west\), y \(north-south\), and\
- z \(v)144 213.6 R .754(ertical posti)-.15 F 1.054 -.15(ve u)-.25 H .754
-(p\) of).15 F(fset)-.25 E -.25(va)144 225.6 S .266
-(lues in meters. If the sna).25 F 2.766(vi)-.2 G 2.766(d\()-2.766 G(na)
--2.766 E(vig)-.2 E .267(ation point id\) is not speci\214ed, it is assu\
-med to be 0, the \214rst)-.05 F(na)144 237.6 Q(vig)-.2 E 1.5(ation poin\
-t in the speci\214ed section. If the uncertainties in the global tie \(\
-xsigma, ysigma,)-.05 F(zsigma\) are not speci\214ed, then xsigma = ysig\
-ma = 10 m and zsigma = 0.5 m are assumed.)144 249.6 Q F2
-(\255-set-global-tie-xyz=\214le:section[:sna)108 266.4 Q(v])-.25 E F0
-1.101(This option sets the mode of the e)144 278.4 R 1.101
-(xisting speci\214ed global tie in the)-.15 F F2(MBna)3.602 E -.1(va)
--.25 G(djust).1 E F0 1.102(project to be)3.602 F .529("XYZ". This means\
- all three coordinates of the tie will be used as constraints in the in)
-144 290.4 R -.15(ve)-.4 G .529(rsion for).15 F(an optimal na)144 302.4 Q
-(vig)-.2 E(ation model.)-.05 E F2(\255-set-global-tie-xy)108 319.2 Q
-(only=\214le:section[:sna)-.25 E(v])-.25 E F0 1.101
-(This option sets the mode of the e)144 331.2 R 1.101
-(xisting speci\214ed global tie in the)-.15 F F2(MBna)3.602 E -.1(va)
--.25 G(djust).1 E F0 1.102(project to be)3.602 F 1.586("XY". This means\
- only the horizontal coordinates of the tie will be used as constraints\
- in the)144 343.2 R(in)144 355.2 Q -.15(ve)-.4 G
-(rsion for an optimal na).15 E(vig)-.2 E(ation model.)-.05 E F2
-(\255-set-global-tie-zonly=\214le:section[:sna)108 372 Q(v])-.25 E F0
-1.101(This option sets the mode of the e)144 384 R 1.101
-(xisting speci\214ed global tie in the)-.15 F F2(MBna)3.602 E -.1(va)
--.25 G(djust).1 E F0 1.102(project to be)3.602 F .339
-("Z". This means only the v)144 396 R .338
-(ertical coordinate of the tie will be used as a constraint in the in)
--.15 F -.15(ve)-.4 G(rsion).15 E(for an optimal na)144 408 Q(vig)-.2 E
-(ation model.)-.05 E F2(\255-unset-global-tie=\214le:section)108 424.8 Q
-F0(This option unsets \(deletes\) the speci\214ed global tie in the)144
-436.8 Q F2(MBna)2.5 E -.1(va)-.25 G(djust).1 E F0(project.)2.5 E F2
-(\255-add-cr)108 453.6 Q(ossing=\214le1:section1/\214le2:section2)-.18 E
-F0(This option adds the speci\214ed crossing to the)144 465.6 Q F2(MBna)
-2.5 E -.1(va)-.25 G(djust).1 E F0(project.)2.5 E F2
-(\255-set-tie=\214le1:section1/\214le2:section2/xoffset/y)108 482.4 Q
-(offset/zoffset)-.25 E F0 .218
-(This option adds the speci\214ed tie to the)144 494.4 R F2(MBna)2.718 E
--.1(va)-.25 G(djust).1 E F0 2.718(project. If)2.718 F .218
-(the corresponding crossing does)2.718 F(not already e)144 506.4 Q
-(xist, it will be created.)-.15 E F2
-(\255-set-tie-xyz=\214le1:section1/\214le2:section2)108 523.2 Q F0 .713
-(This option sets the mode of the e)144 535.2 R .713
-(xisting speci\214ed tie in the)-.15 F F2(MBna)3.213 E -.1(va)-.25 G
-(djust).1 E F0 .713(project to be "XYZ".)3.213 F .521(This means all th\
-ree coordinates of the tie will be used as constraints in the in)144
-547.2 R -.15(ve)-.4 G .522(rsion for an opti-).15 F(mal na)144 559.2 Q
-(vig)-.2 E(ation model.)-.05 E F2(\255-set-tie-xy)108 576 Q
-(only=\214le1:section1/\214le2:section2)-.25 E F0 1.095
-(This option sets the mode of the e)144 588 R 1.095
-(xisting speci\214ed tie in the)-.15 F F2(MBna)3.595 E -.1(va)-.25 G
-(djust).1 E F0 1.095(project to be "XY".)3.595 F .863(This means only t\
-he horizontal coordinates of the tie will be used as constraints in the\
- in)144 600 R -.15(ve)-.4 G(rsion).15 E(for an optimal na)144 612 Q(vig)
--.2 E(ation model.)-.05 E F2
-(\255-set-tie-zonly=\214le1:section1/\214le2:section2)108 628.8 Q F0
-.328(This option sets the mode of the e)144 640.8 R .328
-(xisting speci\214ed tie in the)-.15 F F2(MBna)2.827 E -.1(va)-.25 G
-(djust).1 E F0 .327(project to be "Z". This)2.827 F 1.085
-(means only the v)144 652.8 R 1.086
-(ertical coordinate of the tie will be used as a constraint in the in)
--.15 F -.15(ve)-.4 G 1.086(rsion for an).15 F(optimal na)144 664.8 Q
-(vig)-.2 E(ation model.)-.05 E F2
-(\255-unset-tie=\214le1:section1/\214le2:section2)108 681.6 Q F0
-(This option unsets \(deletes\) the speci\214ed tie in the)144 693.6 Q
-F2(MBna)2.5 E -.1(va)-.25 G(djust).1 E F0(project.)2.5 E(MB-System 5.0)
-72 768 Q(21 March 2015)140.11 E(2)198.45 E 0 Cg EP
-%%Page: 3 3
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mbna)72 48 Q -.25(va)-.2 G(djustmer).25 E 112.7
-(ge\(1\) MB-System)-.18 F 112.7(5.0 mbna)2.5 F -.25(va)-.2 G(djustmer)
-.25 E(ge\(1\))-.18 E/F1 10/Times-Bold at 0 SF
-(\255-set-ties-xyz-with-\214le=\214le)108 84 Q F0 .14
-(This option sets the mode of all ties in)144 96 R -.2(vo)-.4 G(lv).2 E
-.14(ed with the speci\214ed \214le in the)-.15 F F1(MBna)2.64 E -.1(va)
--.25 G(djust).1 E F0 .14(project to)2.64 F .738(be "XYZ". This means al\
-l three coordinates of these ties will be used as constraints in the in)
-144 108 R -.15(ve)-.4 G -.2(r-).15 G(sion for an optimal na)144 120 Q
-(vig)-.2 E(ation model.)-.05 E F1(\255-set-ties-xy)108 136.8 Q
-(only-with-\214le=\214le)-.25 E F0 .14
-(This option sets the mode of all ties in)144 148.8 R -.2(vo)-.4 G(lv).2
-E .14(ed with the speci\214ed \214le in the)-.15 F F1(MBna)2.64 E -.1
-(va)-.25 G(djust).1 E F0 .14(project to)2.64 F .072(be "XY". This means\
- only the horizontal coordinates of these ties will be used as constrai\
-nts in the)144 160.8 R(in)144 172.8 Q -.15(ve)-.4 G
-(rsion for an optimal na).15 E(vig)-.2 E(ation model.)-.05 E F1
-(\255-set-ties-zonly-with-\214le=\214le)108 189.6 Q F0 .14
-(This option sets the mode of all ties in)144 201.6 R -.2(vo)-.4 G(lv).2
-E .14(ed with the speci\214ed \214le in the)-.15 F F1(MBna)2.64 E -.1
-(va)-.25 G(djust).1 E F0 .14(project to)2.64 F 1.42
-(be "Z". This means only the v)144 213.6 R 1.421
-(ertical coordinate of these ties will be used as constraints in the)
--.15 F(in)144 225.6 Q -.15(ve)-.4 G(rsion for an optimal na).15 E(vig)
--.2 E(ation model.)-.05 E F1(\255-set-ties-xyz-with-sur)108 242.4 Q -.1
-(ve)-.1 G(y=sur).1 E -.1(ve)-.1 G(y).1 E F0 1.957
-(This option sets the mode of all ties in)144 254.4 R -.2(vo)-.4 G(lv).2
-E 1.957(ed with the speci\214ed surv)-.15 F 2.256 -.15(ey i)-.15 H 4.456
-(nt).15 G(he)-4.456 E F1(MBna)4.456 E -.1(va)-.25 G(djust).1 E F0 .726(\
-project to be "XYZ". This means all three coordinates of these ties wil\
-l be used as constraints in)144 266.4 R(the in)144 278.4 Q -.15(ve)-.4 G
-(rsion for an optimal na).15 E(vig)-.2 E(ation model.)-.05 E F1
-(\255-set-ties-xy)108 295.2 Q(only-with-sur)-.25 E -.1(ve)-.1 G(y=sur).1
-E -.1(ve)-.1 G(y).1 E F0 1.957(This option sets the mode of all ties in)
-144 307.2 R -.2(vo)-.4 G(lv).2 E 1.957(ed with the speci\214ed surv)-.15
-F 2.256 -.15(ey i)-.15 H 4.456(nt).15 G(he)-4.456 E F1(MBna)4.456 E -.1
-(va)-.25 G(djust).1 E F0 .661(project to be "XY". This means only the h\
-orizontal coordinates of these ties will be used as con-)144 319.2 R
-(straints in the in)144 331.2 Q -.15(ve)-.4 G(rsion for an optimal na)
-.15 E(vig)-.2 E(ation model.)-.05 E F1(\255-set-ties-zonly-with-sur)108
-348 Q -.1(ve)-.1 G(y=sur).1 E -.1(ve)-.1 G(y).1 E F0 1.957
-(This option sets the mode of all ties in)144 360 R -.2(vo)-.4 G(lv).2 E
-1.957(ed with the speci\214ed surv)-.15 F 2.256 -.15(ey i)-.15 H 4.456
-(nt).15 G(he)-4.456 E F1(MBna)4.456 E -.1(va)-.25 G(djust).1 E F0 .506
-(project to be "Z". This means only the v)144 372 R .506
-(ertical coordinate of these ties will be used as constraints)-.15 F
-(in the in)144 384 Q -.15(ve)-.4 G(rsion for an optimal na).15 E(vig)-.2
-E(ation model.)-.05 E F1(\255-set-ties-xyz-by-sur)108 400.8 Q -.1(ve)-.1
-G(y=sur).1 E -.1(ve)-.1 G(y).1 E F0 .056
-(This option sets the mode of all ties between tw)144 412.8 R 2.555(os)
--.1 G .055(ections in the speci\214ed surv)-2.555 F .355 -.15(ey i)-.15
-H 2.555(nt).15 G(he)-2.555 E F1(MBna)2.555 E -.1(va)-.25 G(d-).1 E(just)
-144 424.8 Q F0 .236(project to be "XYZ". This means all three coordinat\
-es of these ties will be used as constraints)2.735 F(in the in)144 436.8
-Q -.15(ve)-.4 G(rsion for an optimal na).15 E(vig)-.2 E(ation model.)
--.05 E F1(\255-set-ties-xy)108 453.6 Q(only-by-sur)-.25 E -.1(ve)-.1 G
-(y=sur).1 E -.1(ve)-.1 G(y).1 E F0 .056
-(This option sets the mode of all ties between tw)144 465.6 R 2.555(os)
--.1 G .055(ections in the speci\214ed surv)-2.555 F .355 -.15(ey i)-.15
-H 2.555(nt).15 G(he)-2.555 E F1(MBna)2.555 E -.1(va)-.25 G(d-).1 E(just)
-144 477.6 Q F0 .758(project to be "XY". This means only the horizontal \
-coordinates of these ties will be used as)3.258 F(constraints in the in)
-144 489.6 Q -.15(ve)-.4 G(rsion for an optimal na).15 E(vig)-.2 E
-(ation model.)-.05 E F1(\255-set-ties-zonly-by-sur)108 506.4 Q -.1(ve)
--.1 G(y=sur).1 E -.1(ve)-.1 G(y).1 E F0 .056
-(This option sets the mode of all ties between tw)144 518.4 R 2.555(os)
--.1 G .055(ections in the speci\214ed surv)-2.555 F .355 -.15(ey i)-.15
-H 2.555(nt).15 G(he)-2.555 E F1(MBna)2.555 E -.1(va)-.25 G(d-).1 E(just)
-144 530.4 Q F0 .864(project to be "Z". This means only the v)3.363 F
-.864(ertical coordinate of these ties will be used as con-)-.15 F
-(straints in the in)144 542.4 Q -.15(ve)-.4 G(rsion for an optimal na)
-.15 E(vig)-.2 E(ation model.)-.05 E F1(\255-set-ties-xyz-by-block=sur)
-108 559.2 Q -.1(ve)-.1 G(y1/sur).1 E -.1(ve)-.1 G(y2).1 E F0 2.763(This\
- option sets the mode of all ties between sections of the speci\214ed t\
-w)144 571.2 R 5.263(os)-.1 G(urv)-5.263 E -.15(ey)-.15 G 5.263(si).15 G
-5.263(nt)-5.263 G(he)-5.263 E F1(MBna)144 583.2 Q -.1(va)-.25 G(djust).1
-E F0 .498(project to be "XYZ". This means all three coordinates of thes\
-e ties will be used as)2.997 F(constraints in the in)144 595.2 Q -.15
-(ve)-.4 G(rsion for an optimal na).15 E(vig)-.2 E(ation model.)-.05 E F1
-(\255-set-ties-xy)108 612 Q(only-by-block=sur)-.25 E -.1(ve)-.1 G
-(y1/sur).1 E -.1(ve)-.1 G(y2).1 E F0 2.798(This option sets the mode of\
- all ties between sections in the speci\214ed tw)144 624 R 5.297(os)-.1
-G(urv)-5.297 E -.15(ey)-.15 G 5.297(si).15 G 5.297(nt)-5.297 G(he)-5.297
-E F1(MBna)144 636 Q -.1(va)-.25 G(djust).1 E F0 .178(project to be "XY"\
-. This means only the horizontal coordinates of these ties will be)2.678
-F(used as constraints in the in)144 648 Q -.15(ve)-.4 G
-(rsion for an optimal na).15 E(vig)-.2 E(ation model.)-.05 E F1
-(\255-set-ties-zonly-by-block=sur)108 664.8 Q -.1(ve)-.1 G(y1/sur).1 E
--.1(ve)-.1 G(y2).1 E F0 2.798(This option sets the mode of all ties bet\
-ween sections in the speci\214ed tw)144 676.8 R 5.297(os)-.1 G(urv)
--5.297 E -.15(ey)-.15 G 5.297(si).15 G 5.297(nt)-5.297 G(he)-5.297 E F1
-(MBna)144 688.8 Q -.1(va)-.25 G(djust).1 E F0 .298
-(project to be "Z". This means only the v)2.798 F .298
-(ertical coordinate of these ties will be used)-.15 F
-(as constraints in the in)144 700.8 Q -.15(ve)-.4 G
-(rsion for an optimal na).15 E(vig)-.2 E(ation model.)-.05 E
-(MB-System 5.0)72 768 Q(21 March 2015)140.11 E(3)198.45 E 0 Cg EP
-%%Page: 4 4
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mbna)72 48 Q -.25(va)-.2 G(djustmer).25 E 112.7
-(ge\(1\) MB-System)-.18 F 112.7(5.0 mbna)2.5 F -.25(va)-.2 G(djustmer)
-.25 E(ge\(1\))-.18 E/F1 10/Times-Bold at 0 SF
-(\255-set-ties-zoffset-by-block=sur)108 84 Q -.1(ve)-.1 G(y1/sur).1 E
--.1(ve)-.1 G(y2/zoffset).1 E F0(This option resets the zof)144 96 Q
-(fset v)-.25 E(alue of all ties between sections in the speci\214ed tw)
--.25 E 2.5(os)-.1 G(urv)-2.5 E -.15(ey)-.15 G(s.).15 E F1
-(\255-skip-unset-cr)108 112.8 Q(ossings)-.18 E F0 .45(This option sets \
-all unset crossings in the input projects to be skipped. This does not \
-apply to an)144 124.8 R(y)-.15 E(ne)144 136.8 Q 2.5(wc)-.25 G
-(rossings between the tw)-2.5 E 2.5(om)-.1 G(er)-2.5 E(ged projects.)
--.18 E F1(\255-v)108 153.6 Q(erbose)-.1 E F0 1.008
-(This option increases the v)144 165.6 R 1.008(erbosity of)-.15 F F1
-(MBna)3.508 E -.1(va)-.25 G(djustmer).1 E(ge)-.1 E F0 3.508(,w)C 1.008
-(hich means that more information)-3.508 F(than by def)144 177.6 Q
-(ault is output to the stderr stream of the shell.)-.1 E F1(\255-help)
-108 194.4 Q F0 .154(This option causes)8.63 F F1(MBna)2.654 E -.1(va)
--.25 G(djustmer).1 E .154
-(geP to output a list of the possible command line options,)-.1 F
-(and then exit.)144 206.4 Q/F2 10.95/Times-Bold at 0 SF(EXAMPLES)72 235.2 Q
-F0 .642(Suppose you ha)108 247.2 R .942 -.15(ve t)-.2 H .842 -.1(wo A)
-.15 H .642(UV surv)-.45 F .942 -.15(ey m)-.15 H .642
-(issions, 20140515m1 and 10140515m2, that o).15 F -.15(ve)-.15 G .642
-(rlap slightly).15 F 3.143(.I)-.65 G 3.143(fy)-3.143 G(ou)-3.143 E(ha)
-108 259.2 Q 1.202 -.15(ve u)-.2 H(sed).15 E F1(MBna)3.402 E -.1(va)-.25
-G(djust).1 E F0 .902(to adjust the na)3.402 F(vig)-.2 E .901
-(ation of the tw)-.05 F 3.401(om)-.1 G .901(issions separately)-3.401 F
-3.401(,y)-.65 G .901(ou can use)-3.401 F F1(MBna)3.401 E -.1(va)-.25 G
-(d-).1 E(justmer)108 271.2 Q(ge)-.1 E F0 .333(to mer)2.833 F .333
-(ge the tw)-.18 F(o)-.1 E F1(MBna)2.833 E -.1(va)-.25 G(djust).1 E F0
-.333(projects into a single ne)2.833 F 2.834(wp)-.25 G .334
-(roject without losing an)-2.834 F 2.834(yo)-.15 G 2.834(ft)-2.834 G
-.334(he ties)-2.834 F .351(made between o)108 283.2 R -.15(ve)-.15 G
-.351(rlapping sections in the e).15 F .351(xisting projects. If the tw)
--.15 F 2.85(oe)-.1 G .35(xisting projects are named "Na)-3 F -.25(va)-.2
-G(d-).25 E 1.597(just20140515m1" and "Na)108 295.2 R -.25(va)-.2 G 1.597
-(djust20140515m2", respecti).25 F -.15(ve)-.25 G(ly).15 E 4.097(,t)-.65
-G 1.597(hen there e)-4.097 F 1.598(xist project \214les with a ".n)-.15
-F(vh")-.4 E(suf)108 307.2 Q .334
-(\214x and project directories with a ".dir" suf)-.25 F .334(\214x. T)
--.25 F 2.834(oc)-.8 G .334(reate a ne)-2.834 F(w)-.25 E F1(MBna)2.834 E
--.1(va)-.25 G(djust).1 E F0 .333(project combining the tw)2.833 F(o)-.1
-E -.15(ex)108 319.2 S(isting projects, the follo).15 E(wing will suf)
--.25 E(\214ce:)-.25 E(mbna)120.5 331.2 Q -.25(va)-.2 G(djustmer).25 E
-39.675(ge --input=Na)-.18 F -.25(va)-.2 G(djust20140515m1.n).25 E 94.675
-(vh --input=Na)-.4 F -.25(va)-.2 G(d-).25 E(just20140515m2.n)108 343.2 Q
-55(vh --output=Na)-.4 F -.25(va)-.2 G(djust20140515All.n).25 E(vh)-.4 E
-1.164(The ne)108 367.2 R 3.664(wp)-.25 G 1.164(roject Na)-3.664 F -.25
-(va)-.2 G 1.163
-(djust20140515All can be opened and analyzed further using).25 F F1
-(MBna)3.663 E -.1(va)-.25 G(djust).1 E F0 3.663(.W)C(hen)-3.663 E .947
-(opening the ne)108 379.2 R 3.447(wp)-.25 G .947
-(roject, the user should \214rst solv)-3.447 F 3.447(ef)-.15 G .947
-(or a comprehensi)-3.447 F 1.248 -.15(ve n)-.25 H -.2(av).15 G(ig).2 E
-.948(ation adjustment model by)-.05 F .787(selecting the <Action->In)108
-391.2 R -.15(ve)-.4 G .787(rt Na).15 F(vig)-.2 E .786
-(ation> menu item, and then \214nd the crossings between the tw)-.05 F
-3.286(op)-.1 G(re)-3.286 E(vi-)-.25 E
-(ously separate missions by selecting the <Action->Check F)108 403.2 Q
-(or Ne)-.15 E 2.5(wC)-.25 G(rossings> menu item.)-2.5 E 1.152(If the)108
-427.2 R F1(--skip-unset-cr)3.652 E(ossings)-.18 E F0 1.152
-(option is added to the abo)3.652 F 1.453 -.15(ve c)-.15 H 1.153
-(ommand, then all unset crossings in the tw).15 F(o)-.1 E
-(input projects will be set to "skipped" mode in the output project.)108
-439.2 Q F2(SEE ALSO)72 468 Q F1(mbsystem)108 480 Q F0(\(1\),)A F1(mbio)
-2.5 E F0(\(1\),)A F1(mbpr)2.5 E(ocess)-.18 E F0(\(1\),)A F1(mbna)2.5 E
--.1(va)-.25 G(djust).1 E F0(\(1\),)A F1(mbset)2.5 E F0(\(1\))A F2 -.11
-(BU)72 508.8 S(GS).11 E F0 .528(It started out simple and b)108 520.8 R
-.528(ulletproof, b)-.2 F .528(ut no)-.2 F 3.028(wi)-.25 G(t')-3.028 E
-3.027(st)-.55 G .527(oo complicated to be b)-3.027 F .527
-(ulletproof. It')-.2 F 3.027(sp)-.55 G .527(robably nerfgun-)-3.027 F
-(proof, though.)108 532.8 Q(Good luck.)5 E(MB-System 5.0)72 768 Q
-(21 March 2015)140.11 E(4)198.45 E 0 Cg EP
-%%Trailer
-end
-%%EOF
diff --git a/src/ps/mbnavedit.ps b/src/ps/mbnavedit.ps
deleted file mode 100644
index 01d2f01..0000000
--- a/src/ps/mbnavedit.ps
+++ /dev/null
@@ -1,1025 +0,0 @@
-%!PS-Adobe-3.0
-%%Creator: groff version 1.19.2
-%%CreationDate: Wed Jul  1 12:29:30 2015
-%%DocumentNeededResources: font Times-Roman
-%%+ font Times-Bold
-%%+ font Times-Italic
-%%DocumentSuppliedResources: procset grops 1.19 2
-%%Pages: 8
-%%PageOrder: Ascend
-%%DocumentMedia: Default 612 792 0 () ()
-%%Orientation: Portrait
-%%EndComments
-%%BeginDefaults
-%%PageMedia: Default
-%%EndDefaults
-%%BeginProlog
-%%BeginResource: procset grops 1.19 2
-%!PS-Adobe-3.0 Resource-ProcSet
-/setpacking where{
-pop
-currentpacking
-true setpacking
-}if
-/grops 120 dict dup begin
-/SC 32 def
-/A/show load def
-/B{0 SC 3 -1 roll widthshow}bind def
-/C{0 exch ashow}bind def
-/D{0 exch 0 SC 5 2 roll awidthshow}bind def
-/E{0 rmoveto show}bind def
-/F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def
-/G{0 rmoveto 0 exch ashow}bind def
-/H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/I{0 exch rmoveto show}bind def
-/J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def
-/K{0 exch rmoveto 0 exch ashow}bind def
-/L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/M{rmoveto show}bind def
-/N{rmoveto 0 SC 3 -1 roll widthshow}bind def
-/O{rmoveto 0 exch ashow}bind def
-/P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/Q{moveto show}bind def
-/R{moveto 0 SC 3 -1 roll widthshow}bind def
-/S{moveto 0 exch ashow}bind def
-/T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/SF{
-findfont exch
-[exch dup 0 exch 0 exch neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/MF{
-findfont
-[5 2 roll
-0 3 1 roll
-neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/level0 0 def
-/RES 0 def
-/PL 0 def
-/LS 0 def
-/MANUAL{
-statusdict begin/manualfeed true store end
-}bind def
-/PLG{
-gsave newpath clippath pathbbox grestore
-exch pop add exch pop
-}bind def
-/BP{
-/level0 save def
-1 setlinecap
-1 setlinejoin
-72 RES div dup scale
-LS{
-90 rotate
-}{
-0 PL translate
-}ifelse
-1 -1 scale
-}bind def
-/EP{
-level0 restore
-showpage
-}def
-/DA{
-newpath arcn stroke
-}bind def
-/SN{
-transform
-.25 sub exch .25 sub exch
-round .25 add exch round .25 add exch
-itransform
-}bind def
-/DL{
-SN
-moveto
-SN
-lineto stroke
-}bind def
-/DC{
-newpath 0 360 arc closepath
-}bind def
-/TM matrix def
-/DE{
-TM currentmatrix pop
-translate scale newpath 0 0 .5 0 360 arc closepath
-TM setmatrix
-}bind def
-/RC/rcurveto load def
-/RL/rlineto load def
-/ST/stroke load def
-/MT/moveto load def
-/CL/closepath load def
-/Fr{
-setrgbcolor fill
-}bind def
-/setcmykcolor where{
-pop
-/Fk{
-setcmykcolor fill
-}bind def
-}if
-/Fg{
-setgray fill
-}bind def
-/FL/fill load def
-/LW/setlinewidth load def
-/Cr/setrgbcolor load def
-/setcmykcolor where{
-pop
-/Ck/setcmykcolor load def
-}if
-/Cg/setgray load def
-/RE{
-findfont
-dup maxlength 1 index/FontName known not{1 add}if dict begin
-{
-1 index/FID ne{def}{pop pop}ifelse
-}forall
-/Encoding exch def
-dup/FontName exch def
-currentdict end definefont pop
-}bind def
-/DEFS 0 def
-/EBEGIN{
-moveto
-DEFS begin
-}bind def
-/EEND/end load def
-/CNT 0 def
-/level1 0 def
-/PBEGIN{
-/level1 save def
-translate
-div 3 1 roll div exch scale
-neg exch neg exch translate
-0 setgray
-0 setlinecap
-1 setlinewidth
-0 setlinejoin
-10 setmiterlimit
-[]0 setdash
-/setstrokeadjust where{
-pop
-false setstrokeadjust
-}if
-/setoverprint where{
-pop
-false setoverprint
-}if
-newpath
-/CNT countdictstack def
-userdict begin
-/showpage{}def
-/setpagedevice{}def
-}bind def
-/PEND{
-countdictstack CNT sub{end}repeat
-level1 restore
-}bind def
-end def
-/setpacking where{
-pop
-setpacking
-}if
-%%EndResource
-%%EndProlog
-%%BeginSetup
-%%BeginFeature: *PageSize Default
-<< /PageSize [ 612 792 ] /ImagingBBox null >> setpagedevice
-%%EndFeature
-%%IncludeResource: font Times-Roman
-%%IncludeResource: font Times-Bold
-%%IncludeResource: font Times-Italic
-grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72
-def/PL 792 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron/Zcaron
-/scaron/zcaron/Ydieresis/trademark/quotesingle/Euro/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/space/exclam/quotedbl/numbersign/dollar/percent
-/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen
-/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon
-/semicolon/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O
-/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright/circumflex
-/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y
-/z/braceleft/bar/braceright/tilde/.notdef/quotesinglbase/guillemotleft
-/guillemotright/bullet/florin/fraction/perthousand/dagger/daggerdbl
-/endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut
-/dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash
-/quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen
-/brokenbar/section/dieresis/copyright/ordfeminine/guilsinglleft
-/logicalnot/minus/registered/macron/degree/plusminus/twosuperior
-/threesuperior/acute/mu/paragraph/periodcentered/cedilla/onesuperior
-/ordmasculine/guilsinglright/onequarter/onehalf/threequarters
-/questiondown/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE
-/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex
-/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis
-/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn
-/germandbls/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla
-/egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis
-/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide/oslash
-/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis]def
-/Times-Italic at 0 ENC0/Times-Italic RE/Times-Bold at 0 ENC0/Times-Bold RE
-/Times-Roman at 0 ENC0/Times-Roman RE
-%%EndSetup
-%%Page: 1 1
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mbna)72 48 Q -.15(ve)-.2 G 146.3
-(dit\(1\) MB-System).15 F 146.3(5.0 mbna)2.5 F -.15(ve)-.2 G(dit\(1\))
-.15 E/F1 10.95/Times-Bold at 0 SF -.219(NA)72 84 S(ME).219 E/F2 10
-/Times-Bold at 0 SF(mbna)108 96 Q -.1(ve)-.25 G(dit).1 E F0 2.5<ad49>2.5 G
-(nteracti)-2.5 E .3 -.15(ve n)-.25 H -.2(av).15 G(ig).2 E
-(ation editor for sw)-.05 E(ath sonar data.)-.1 E F1(VERSION)72 124.8 Q
-F0 -1.11(Ve)108 136.8 S(rsion 5.0)1.11 E F1(SYNOPSIS)72 165.6 Q F2(mbna)
-108 177.6 Q -.1(ve)-.25 G(dit).1 E F0([)2.5 E F2<ad42>A/F3 10
-/Times-Italic at 0 SF(yr/mo/da/hr/mn/sc)A F2<ad4420ad45>2.5 E F3
-(yr/mo/da/hr/mn/sc)A F2<ad46>2.5 E F3(format)A F2<ad4720ad49>2.5 E F3
-(in\214le)A F2<ad4e20ad5020ad5420ad5820ad5620ad48>2.5 E F3(])A F1
-(DESCRIPTION)72 206.4 Q F2(MBna)108 218.4 Q -.1(ve)-.25 G(dit).1 E F0
-1.169(is an interacti)3.669 F 1.468 -.15(ve e)-.25 H 1.168
-(ditor used to identify and \214x problems with the na).15 F(vig)-.2 E
-1.168(ation of sw)-.05 F 1.168(ath sonar)-.1 F(data.)108 230.4 Q 1.17
-(In the def)108 254.4 R 1.17(ault mode the edited na)-.1 F(vig)-.2 E
-1.171(ation is output to a \214le with the suf)-.05 F 1.171(\214x ".n)
--.25 F -.15(ve)-.4 G 3.671("a).15 G 1.171(ppended to the input)-3.671 F
-(sw)108 266.4 Q .413
-(ath data \214lename. The program can also be operated in a "bro)-.1 F
-.413(wse" mode where no na)-.25 F(vig)-.2 E .413(ation is output.)-.05 F
-.004(If sa)108 278.4 R -.15(ve)-.2 G .004(d, the edited na).15 F(vig)-.2
-E .005(ation can be mer)-.05 F .005(ged with the sw)-.18 F .005
-(ath data using the program)-.1 F F2(mbpr)2.505 E(ocess)-.18 E F0 2.505
-(,w)C .005(hich out-)-2.505 F .55(puts a processed sw)108 290.4 R .55
-(ath data \214le.)-.1 F(The)5.55 E F2(mbpr)3.049 E(ocess)-.18 E F0 .549
-(program is also used to apply bath)3.049 F .549(ymetry edits, recalcu-)
--.05 F .707(late bath)108 302.4 R(ymetry)-.05 E 3.207(,a)-.65 G .707
-(nd apply other corrections to sw)-3.207 F .707(ath bath)-.1 F .707
-(ymetry data. Users may cause)-.05 F F2(mbpr)3.208 E(ocess)-.18 E F0
-.708(to be)3.208 F(run automatically by specifying the)108 314.4 Q F2
-<ad58>2.5 E F0(option when starting)2.5 E F2(MBna)2.5 E -.1(ve)-.25 G
-(dit).1 E F0(.)A 1.198(In pre)108 338.4 R 3.698(vious v)-.25 F 1.198
-(ersions of)-.15 F F2(MB-System)3.698 E F0(\(v)3.698 E 1.198
-(ersion 4.6.10 or earlier\),)-.15 F F2(MBna)3.698 E -.1(ve)-.25 G(dit).1
-E F0 1.197(produced output sw)3.697 F 1.197(ath data)-.1 F .084
-(\214les directly by reading and storing all of the sw)108 350.4 R .084
-(ath data information in memory \(including non-surv)-.1 F .384 -.15
-(ey d)-.15 H(ata).15 E .096(records\). This approach limited the amount\
- of data that could be handled at once, frequently requiring users)108
-362.4 R(to process \214les in small pieces. The current v)108 374.4 Q
-(ersion only stores and outputs the na)-.15 E(vig)-.2 E(ation data.)-.05
-E .914(Once the na)108 398.4 R(vig)-.2 E .914(ation from a sw)-.05 F
-.914(ath data \214le has been read in,)-.1 F F2(MBna)3.414 E -.1(ve)-.25
-G(dit).1 E F0 .914(displays autoscaled plots of the)3.414 F 1.862(longi\
-tude, latitude, speed, heading, and sonar depth time series, along with\
- a plot of the time interv)108 410.4 R(al)-.25 E .111(between na)108
-422.4 R(vig)-.2 E .111(ation v)-.05 F .112
-(alues. The user may select outliers and interpolate o)-.25 F -.15(ve)
--.15 G 2.612(rt).15 G .112(hem or)-2.612 F 2.612(,i)-.4 G 2.612(nt)
--2.612 G .112(he case of heading)-2.612 F 1.408
-(or speed data, replace the erroneous v)108 434.4 R 1.408
-(alues with estimates deri)-.25 F -.15(ve)-.25 G 3.907(df).15 G 1.407
-(rom "course-made-good" or "speed-)-3.907 F .386(made-good", respecti)
-108 446.4 R -.15(ve)-.25 G(ly).15 E 5.386(.D)-.65 G .386(ata can only b\
-e selected and altered in a single plot at a time \(this a)-5.386 F -.2
-(vo)-.2 G .387(ids con-).2 F(fusion and pre)108 458.4 Q -.15(ve)-.25 G
-(nts mistak).15 E(es\).)-.1 E .039(The nature of the na)108 482.4 R(vig)
--.2 E .039(ation data being edited depends upon the data format. Some d\
-ata formats include the)-.05 F(na)108 494.4 Q(vig)-.2 E 1.029
-(ation in the same data records as the ping or surv)-.05 F 1.329 -.15
-(ey d)-.15 H 1.029(ata. This synchronous na).15 F(vig)-.2 E 1.029
-(ation implies that)-.05 F 1.216
-(either in the sonar or in later processing, the ra)108 506.4 R 3.716
-(wn)-.15 G -.2(av)-3.716 G(ig).2 E 1.216
-(ation has been interpolated to yield v)-.05 F 1.216(alues at the)-.25 F
-.76
-(same time stamps as the sonar pings. Other data formats do not hold na)
-108 518.4 R(vig)-.2 E .76(ation v)-.05 F .76(alues in the surv)-.25 F
-1.06 -.15(ey d)-.15 H(ata).15 E .368
-(records, and instead use separate na)108 530.4 R(vig)-.2 E .368
-(ation records with dif)-.05 F .367
-(ferent time stamps. This asynchronous na)-.25 F(vig)-.2 E(a-)-.05 E
-.774(tion requires that MBIO interpolate or e)108 542.4 R .774
-(xtrapolate the na)-.15 F(vig)-.2 E .774(ation as the surv)-.05 F 1.075
--.15(ey d)-.15 H .775(ata records are read.).15 F -.15(Fo)5.775 G(r).15
-E .76(data formats with synchronous na)108 554.4 R(vig)-.2 E .76
-(ation, the na)-.05 F(vig)-.2 E .76(ation v)-.05 F .76
-(alues edited using)-.25 F F2(MBna)3.26 E -.1(ve)-.25 G(dit).1 E F0 .76
-(are those in the)3.26 F(surv)108 566.4 Q .346 -.15(ey d)-.15 H .047
-(ata records. F).15 F .047(or data formats with only asynchronous na)
--.15 F(vig)-.2 E(ation,)-.05 E F2(MBna)2.547 E -.1(ve)-.25 G(dit).1 E F0
-.047(displays and operates)2.547 F .046(on the v)108 578.4 R .046
-(alues from the na)-.25 F(vig)-.2 E .046(ation records. The)-.05 F F2
-(MBIO)2.546 E F0 .045
-(manual page includes a listing of which type of na)2.546 F(vi-)-.2 E
--.05(ga)108 590.4 S(tion is used by the supported data formats.).05 E
--.15(Fo)108 614.4 S 3.6(rs).15 G 1.1(ome data formats, the user can als\
-o inspect plots of roll, pitch, and hea)-3.6 F -.15(ve)-.2 G 3.6(dd).15
-G 1.1(ata to determine if the)-3.6 F(ship')108 626.4 Q 2.5(sv)-.55 G
-(ertical reference sensors were w)-2.65 E(orking properly)-.1 E(.)-.65 E
-.732(The edited data is usually output to a \214le, b)108 650.4 R .732
-(ut the program can be operated in a "bro)-.2 F .732(wse" mode where no)
--.25 F(data is output.)108 662.4 Q F1(SMOO)72 691.2 Q(THING N)-.438 E
--1.588(AV)-.219 G(IGA)1.588 E(TION)-1.04 E F0 1.023
-(Three algorithms for obtaining and using smooth na)108 703.2 R(vig)-.2
-E 1.023(ation models are a)-.05 F -.25(va)-.2 G 1.023
-(ilable. Replacing the original).25 F(na)108 715.2 Q(vig)-.2 E .448
-(ation with a smoothed v)-.05 F .448(ersion can be adv)-.15 F .448
-(antageous in some cases of v)-.25 F .448(ery noisy na)-.15 F(vig)-.2 E
-.448(ation \(typically)-.05 F .411(from sonars on to)108 727.2 R .412
-(wed platforms or submer)-.25 F .412(ged v)-.18 F .412
-(ehicles\). The \214rst smoothing scheme is the co)-.15 F -.2(vo)-.15 G
-.412(lution of a).2 F(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)
--2.5 E(1)204.835 E 0 Cg EP
-%%Page: 2 2
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mbna)72 48 Q -.15(ve)-.2 G 146.3
-(dit\(1\) MB-System).15 F 146.3(5.0 mbna)2.5 F -.15(ve)-.2 G(dit\(1\))
-.15 E 1.526(Gaussian k)108 84 R 1.526(ernal of user)-.1 F 1.526
-(-de\214ned time width with the data.)-.2 F 1.526
-(Users may select and \215ag outlier na)6.526 F(vig)-.2 E(ation)-.05 E
-1.185(points; an)108 96 R 3.685<798d>-.15 G 1.186
-(agged points are not used to calculate the Gaussian-weighted mean na)
--3.685 F(vig)-.2 E 1.186(ation v)-.05 F 3.686(alues. The)-.25 F .126
-(second approach is simple dead reck)108 108 R .125(oning from the init\
-ial position using the current \(possibly edited\) head-)-.1 F .265
-(ing and speed v)108 120 R .266(alues. The dead reck)-.25 F .266
-(oning na)-.1 F(vig)-.2 E .266(ation can also incorporate user)-.05 F
-.266(-speci\214ed longitude and lati-)-.2 F 1.636(tude drift rates.)108
-132 R 1.636(The third algorithm is an in)6.636 F -.15(ve)-.4 G 1.636
-(rsion for a smooth na).15 F(vig)-.2 E 1.635
-(ation that minimizes speed and)-.05 F .862
-(acceleration while \214tting the original na)108 144 R(vig)-.2 E .862
-(ation in a least squares sense. The in)-.05 F -.15(ve)-.4 G .863
-(rsion weighting ag).15 F(ainst)-.05 E
-(speed and acceleration are user speci\214ed, and only un\215agged na)
-108 156 Q(vig)-.2 E(ation v)-.05 E(alues are used in the in)-.25 E -.15
-(ve)-.4 G(rsion.).15 E/F1 10.95/Times-Bold at 0 SF(HANDLING B)72 184.8 Q
-(AD TIME ST)-.329 E(AMPS)-.986 E F0 1.082(The time interv)108 196.8 R
-1.081(al plot allo)-.25 F 1.081(ws users to spot problems with time sta\
-mps and to change the time stamps, if)-.25 F(necessary)108 208.8 Q 3.007
-(.T)-.65 G .507(he most ob)-3.007 F .508(vious time stamp errors are mu\
-ltiple pings with the same time stamps \(producing a)-.15 F .446
-(zero time interv)108 220.8 R .446(al v)-.25 F .446(alue\), or sequenti\
-al pings with decreasing time stamps \(resulting in ne)-.25 F -.05(ga)
--.15 G(ti).05 E .746 -.15(ve t)-.25 H .446(ime inter).15 F(-)-.2 E -.25
-(va)108 232.8 S 3.914(lv).25 G(alues\).)-4.164 E/F2 10/Times-Bold at 0 SF
-(MBna)3.914 E -.1(ve)-.25 G(dit).1 E F0(pro)3.914 E 1.414(vides tw)-.15
-F 3.914(ot)-.1 G 1.414(ools for dealing with zero or ne)-3.914 F -.05
-(ga)-.15 G(ti).05 E 1.714 -.15(ve t)-.25 H 1.414(ime interv).15 F 1.414
-(als: time stamp)-.25 F 1.635(interpolation or deletion of the af)108
-244.8 R 1.635(fected pings. Control dialogs allo)-.25 F 4.135(wu)-.25 G
-1.635(sers to apply either to the entire)-4.135 F -.2(bu)108 256.8 S
--.25(ff).2 G .538(er at once.).25 F -.35(Ti)5.538 G .539
-(me stamp interpolation may also be accomplished by selecting the rele)
-.35 F -.25(va)-.25 G .539(nt v).25 F .539(alues in the)-.25 F
-(time interv)108 268.8 Q(al display)-.25 E 2.5(,a)-.65 G
-(nd then selecting interpolation.)-2.5 E .78(If the na)108 292.8 R(vig)
--.2 E .78(ation is asynchronous, that generally means the time interv)
--.05 F .78(al should be constant since na)-.25 F(vig)-.2 E(a-)-.05 E
-.945(tion systems are set to output v)108 304.8 R .945(alues at a unifo\
-rm rate. A problem with the time stamps of asynchronous)-.25 F(na)108
-316.8 Q(vig)-.2 E .704(ation should produce spik)-.05 F .704
-(es in both the time interv)-.1 F .704
-(al plot and the speed-made-good plot, and can be)-.25 F(solv)108 328.8
-Q(ed by selecting the of)-.15 E(fending point in the time interv)-.25 E
-(al plot and interpolating to reset the time stamp.)-.25 E 1.085
-(If the na)108 352.8 R(vig)-.2 E 1.085
-(ation is synchronous with the sonar pings, then the time interv)-.05 F
-1.086(al will lik)-.25 F 1.086(ely v)-.1 F 1.086(ary because the)-.25 F
-.731(ping rate for most sonars v)108 364.8 R .731
-(aries with the sonars altitude abo)-.25 F 1.031 -.15(ve t)-.15 H .731
-(he sea\215oor).15 F 3.231(.I)-.55 G 3.231(nt)-3.231 G .731
-(his case, time stamp prob-)-3.231 F 1.442(lems will not produce spik)
-108 376.8 R 1.442(es in the speed-made-good plot because the na)-.1 F
-(vig)-.2 E 1.443(ation has been interpolated)-.05 F .997(using the e)108
-388.8 R .997(xisting time stamps. T)-.15 F .997(ime interv)-.35 F .997
-(al spik)-.25 F .997
-(es may also re\215ect problems with the sonar \(e.g. occa-)-.1 F
-(sional f)108 400.8 Q(ailure to ping at the appropriate time\) rather t\
-han erroneous time stamps.)-.1 E F1 -.548(AU)72 429.6 S(THORSHIP).548 E
-F0(Da)108 441.6 Q(vid W)-.2 E 2.5(.C)-.92 G(aress \(caress at mbari.or)-2.5
-E(g\))-.18 E(Montere)113 453.6 Q 2.5(yB)-.15 G
-(ay Aquarium Research Institute)-2.5 E
-(Dale N. Chayes \(dale at ldeo.columbia.edu\))108 465.6 Q
-(Lamont-Doherty Earth Observ)113 477.6 Q(atory)-.25 E F1(OPTIONS)72
-506.4 Q F2<ad42>108 518.4 Q/F3 10/Times-Italic at 0 SF(yr/mo/da/hr/mn/sc)
-2.5 E F0 .865(Sets the starting time for data allo)108 530.4 R .865(wed\
- in the input data; pings with times before the starting time will be)
--.25 F 2.5(ignored. Def)108 542.4 R(ault:)-.1 E F3(yr/mo/da/hr/mn/sc)2.5
-E F0 2.5(=1)2.5 G(962/2/21/10/30/0.)-2.5 E F2<ad44>108 559.2 Q F0 .884
-(Starts up the program in "bro)23.08 F .883
-(wse" mode. If a \214le is opened in bro)-.25 F .883
-(wse mode \(either at startup or)-.25 F .57
-(later\), none of the edited data will be output to a \214le. The def)
-144 571.2 R .571(ault is to output the edited data to a)-.1 F(\214le.)
-144 583.2 Q F2<ad45>108 600 Q F3(yr/mo/da/hr/mn/sc)23.63 E F0 .287
-(Sets the ending time for data allo)144 612 R .287
-(wed in the input data; pings with times after the ending time will)-.25
-F(be ignored.)144 624 Q(Def)5 E(ault:)-.1 E F3(yr/mo/da/hr/mn/sc)2.5 E
-F0 2.5(=2)2.5 G(062/2/21/10/30/0.)-2.5 E F2<ad46>108 640.8 Q F3(format)
-24.19 E F0 1.018(Sets the format at startup for the input and output sw)
-144 652.8 R 1.018(ath sonar data using)-.1 F F2(MBIO)3.518 E F0(inte)
-3.519 E 1.019(ger format)-.15 F .975(identi\214ers. This v)144 664.8 R
-.974(alue can also be set interacti)-.25 F -.15(ve)-.25 G .974
-(ly when specifying the input \214le.).15 F .974(This program)5.974 F
-.501(uses the)144 676.8 R F2(MBIO)3.001 E F0 .501
-(library and will read or write an)3.001 F 3.001(ys)-.15 G -.1(wa)-3.001
-G .501(th sonar format supported by).1 F F2(MBIO)3.002 E F0 3.002(.Al)C
-(ist)-3.002 E .658(of the sw)144 688.8 R .658
-(ath sonar data formats currently supported by)-.1 F F2(MBIO)3.157 E F0
-.657(and their identi\214er v)3.157 F .657(alues is gi)-.25 F -.15(ve)
--.25 G(n).15 E(in the)144 700.8 Q F2(MBIO)2.5 E F0(manual page.)2.5 E
-(Def)5 E(ault:)-.1 E F3(format)2.5 E F0 2.5(=1)2.5 G(1.)-2.5 E F2<ad47>
-108 717.6 Q F0 .262(This \215ag causes)22.52 F F2(MBna)2.762 E -.1(ve)
--.25 G(dit).1 E F0 .262(to treat the)2.762 F F2(Done)2.762 E F0 -.2(bu)
-2.762 G .263(tton as equi).2 F -.25(va)-.25 G .263(lent to the).25 F F2
-(Quit)2.763 E F0 -.2(bu)2.763 G .263(tton. This option).2 F .13
-(is used when)144 729.6 R F2(MBna)2.63 E -.1(ve)-.25 G(dit).1 E F0 .13(\
-is started automatically by some other process and only a single \214le\
- is to)2.63 F(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(2)
-204.835 E 0 Cg EP
-%%Page: 3 3
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mbna)72 48 Q -.15(ve)-.2 G 146.3
-(dit\(1\) MB-System).15 F 146.3(5.0 mbna)2.5 F -.15(ve)-.2 G(dit\(1\))
-.15 E(edited.)144 84 Q/F1 10/Times-Bold at 0 SF<ad48>108 100.8 Q F0 .162(T\
-his "help" \215ag cause the program to print out a description of its o\
-peration and then e)22.52 F .162(xit immedi-)-.15 F(ately)144 112.8 Q(.)
--.65 E F1<ad49>108 129.6 Q/F2 10/Times-Italic at 0 SF(in\214le)26.41 E F0
-.076(Sets the data \214le from which the input data will be read at sta\
-rtup.)144 141.6 R .075(This v)5.075 F .075(alue can also be set inter)
--.25 F(-)-.2 E(acti)144 153.6 Q -.15(ve)-.25 G(ly).15 E 6.056(.I)-.65 G
-3.556(ft)-6.056 G 1.056(he input \214le is named using the)-3.556 F F1
-(MB-System)3.556 E F0(con)3.556 E -.15(ve)-.4 G 1.056
-(ntion of an ".mbXX" suf).15 F 1.056(\214x \(the)-.25 F .305
-(XX corresponds to the)144 165.6 R F1(MBIO)2.805 E F0 .304
-(format id\), then the output \214le name will ha)2.805 F .604 -.15
-(ve a)-.2 H 2.804(n").15 G .304(e.mbXX" suf)-2.804 F(\214x.)-.25 E
-(Otherwise, the output \214le will be)144 177.6 Q F2(in\214le)2.5 E F0
-(with ".ed" appended.)2.5 E F1<ad4e>108 194.4 Q F0(Normally)23.08 E
-2.533(,a)-.65 G(ll)-2.533 E F1(MB-System)2.533 E F0 .033
-(processing programs embed comment records describing the processing)
-2.533 F .594(actions and parameters into output sw)144 206.4 R .594
-(ath data \214les.)-.1 F .594
-(This \215ag, when used in conjunction with the)5.594 F F1<ad58>144
-218.4 Q F0 .29(\215ag, causes)2.79 F F1(MBna)2.79 E -.1(ve)-.25 G(dit).1
-E F0 .29(to in)2.79 F -.2(vo)-.4 G -.1(ke).2 G F1(mbpr)2.891 E(ocess)
--.18 E F0 .291(with it')2.791 F(s)-.55 E F1<ad4e>2.791 E F0 .291
-(option. In turn, this causes)2.791 F F1(mbpr)2.791 E(o-)-.18 E(cess)144
-230.4 Q F0(to generate an output, processed sw)2.5 E
-(ath data \214le without an)-.1 E 2.5(yc)-.15 G(omment records.)-2.5 E
-F1<ad4f>108 247.2 Q F2(out\214le)22.52 E F0
-(Sets the output data \214le, o)144 259.2 Q -.15(ve)-.15 G
-(rriding the \214le naming con).15 E -.15(ve)-.4 G(ntions discussed abo)
-.15 E .3 -.15(ve i)-.15 H 2.5(nt).15 G(he)-2.5 E F1<ad49>2.5 E F0
-(option.)2.5 E F1<ad50>108 276 Q F0(Causes)24.19 E F1(MBna)2.529 E -.1
-(ve)-.25 G(dit).1 E F0 .028(to load and w)2.529 F .028(ork with na)-.1 F
-(vig)-.2 E .028(ation from surv)-.05 F .328 -.15(ey d)-.15 H .028
-(ata records e).15 F -.15(ve)-.25 G 2.528(ni).15 G 2.528(ft)-2.528 G
-.028(he data for)-2.528 F(-)-.2 E 1.957(mat uses asynchronous na)144 288
-R(vig)-.2 E 1.958
-(ation records. In this case, the only edits which will actually be)-.05
-F(applied to the output data are changes to the time stamps of the surv)
-144 300 Q .3 -.15(ey r)-.15 H(ecords.).15 E F1<ad56>108 316.8 Q F0
-(Normally)23.08 E(,)-.65 E F1(MBna)3.637 E -.1(ve)-.25 G(dit).1 E F0
-1.137(outputs information to the stderr stream re)3.637 F -.05(ga)-.15 G
-1.136(rding the number of records).05 F .252(loaded and dumped.)144
-328.8 R .253(If the)5.253 F F1<ad56>2.753 E F0 .253(\215ag is gi)2.753 F
--.15(ve)-.25 G .253(n, then).15 F F1(MBna)2.753 E -.1(ve)-.25 G(dit).1 E
-F0 -.1(wo)2.753 G .253(rks in a "v).1 F .253(erbose" mode and out-)-.15
-F .517(puts the program v)144 340.8 R .517
-(ersion being used, all error status messages, and a lar)-.15 F .517
-(ge amount of other infor)-.18 F(-)-.2 E
-(mation including all of the beams \215agged or zeroed.)144 352.8 Q F1
-<ad58>108 369.6 Q F0 3.149(This option causes)23.08 F F1(mbpr)5.649 E
-(ocess)-.18 E F0 3.149(to run automatically on an input sw)5.649 F 3.15
-(ath data \214le when the)-.1 F F1(MBna)144 381.6 Q -.1(ve)-.25 G(dit).1
-E F0 .413(editing session is completed. The)2.913 F F1<ad58>2.913 E F0
-.412(option ef)2.912 F(fecti)-.25 E -.15(ve)-.25 G .412
-(ly means that the corresponding).15 F .901(processed sw)144 393.6 R
-.901(ath data is generated or updated immediately)-.1 F 5.902(.T)-.65 G
-.902(he program)-5.902 F F1(mbpr)3.402 E(ocess)-.18 E F0 .902
-(will not be)3.402 F(in)144 405.6 Q -.2(vo)-.4 G -.1(ke).2 G 2.5(di).1 G
-2.5(ft)-2.5 G(he editing session is in the bro)-2.5 E(wse mode.)-.25 E
-/F3 10.95/Times-Bold at 0 SF(INTERA)72 434.4 Q(CTIVE CONTR)-.602 E(OLS)
--.329 E F1(File)108 446.4 Q F0(This b)19.89 E(utton accesses a pulldo)
--.2 E(wn menu with tw)-.25 E 2.5(op)-.1 G(ush b)-2.5 E(uttons:)-.2 E F1
-(Open)2.5 E F0(and)2.5 E F1(File Selection List)2.5 E F0(,)A F1
-(File->Open)108 463.2 Q F0 .615(This b)144 475.2 R .615
-(utton brings up a popup windo)-.2 F 3.115(ww)-.25 G .615(hich allo)
--3.115 F .615(ws the user to specify an input sw)-.25 F .614
-(ath sonar ba-)-.1 F(th)144 487.2 Q 1.7(ymetry data \214le, its)-.05 F
-F1(MBIO)4.2 E F0 1.701(format id, and)4.2 F 1.701(the output mode.)6.701
-F 1.701(This program uses the)6.701 F F1(MBIO)4.201 E F0 1.292
-(library and will read or write an)144 499.2 R 3.792(ys)-.15 G -.1(wa)
--3.792 G 1.292(th sonar format supported by).1 F F1(MBIO)3.792 E F0
-3.792(.A)C 1.291(list of the sw)-.001 F(ath)-.1 E .39
-(sonar data formats currently supported by)144 511.2 R F1(MBIO)2.891 E
-F0 .391(and their identi\214er v)2.891 F .391(alues is gi)-.25 F -.15
-(ve)-.25 G 2.891(ni).15 G 2.891(nt)-2.891 G(he)-2.891 E F1(MBIO)2.891 E
-F0 .682(manual page.)144 523.2 R .682(If the sw)5.682 F .681
-(ath sonar data \214le is named using the)-.1 F F1(MB-System)3.181 E F0
-(suf)3.181 E .681(\214x con)-.25 F -.15(ve)-.4 G .681(ntion \(for).15 F
-(-)-.2 E .162(mat 11 \214les end with ".mb11", format 41 \214les end wi\
-th ".mb41", etc.\), then the program will auto-)144 535.2 R .552(matica\
-lly use the appropriate format id; otherwise the format must be set by \
-the user)144 547.2 R 5.551(.T)-.55 G .551(he popup)-5.551 F(windo)144
-559.2 Q 2.692(wa)-.25 G .192(lso allo)-2.692 F .193
-(ws the output mode to be set to "bro)-.25 F .193
-(wse" so that no edit e)-.25 F -.15(ve)-.25 G .193(nts are output.).15 F
-(When)5.193 E 2.903(av)144 571.2 S .403
-(alid \214le is speci\214ed and the)-3.153 F F1(OK)2.903 E F0 -.2(bu)
-2.903 G .403(tton is click).2 F .403
-(ed, \214le will be added to an internal list of sw)-.1 F(ath)-.1 E .447
-(\214les a)144 583.2 R -.25(va)-.2 G .447(ilable for editing, and then \
-that \214le will be loaded into memory for editing \(if another \214le)
-.25 F -.1(wa)144 595.2 S 2.683(sa).1 G .183
-(lready loaded, that \214le is closed out gracefully before the ne)
--2.683 F 2.682<778c>-.25 G .182(le is loaded\).)-2.682 F .182
-(If the speci\214ed)5.182 F 1.329(input is a datalist \(format id = \
-\2551\), then all of the \214les referenced through that datalist will \
-be)144 607.2 R 1.554(added to the internal list, and the \214rst of tho\
-se \214les loaded. When a \214le is loaded for editing,)144 619.2 R F1
-(MBna)144 631.2 Q -.1(ve)-.25 G(dit).1 E F0 .072
-(reads as much data as will \214t into the data b)2.572 F(uf)-.2 E .073
-(fer \(typically 25000 records\) and se)-.25 F -.15(ve)-.25 G(ral).15 E
-(pings are displayed as stack)144 643.2 Q(ed bath)-.1 E
-(ymetry pro\214les.)-.05 E F1(File->File Selection List)108 660 Q F0 .37
-(This b)144 672 R .37(utton brings up a popup windo)-.2 F 2.869(wd)-.25
-G .369(isplaying the internal list of sw)-2.869 F .369(ath \214les a)-.1
-F -.25(va)-.2 G .369(ilable for edit-).25 F .069
-(ing. The list has four columns.)144 684 R .069
-(The \214rst \(left-most\) column is either blank or sho)5.069 F .07
-(ws "<lock)-.25 F .07(ed>" or)-.1 F 3.73("<loaded>". If)144 696 R 3.73
-<618c>3.73 G 1.23(le is loaded for editing by this program, it sho)-3.73
-F 1.229(ws as "<loaded>".)-.25 F 1.229(If a \214le is)6.229 F 1.458
-(being edited or processed by another program, it sho)144 708 R 1.458
-(ws as "<lock)-.25 F 1.458(ed>". Lock)-.1 F 1.458(ed \214les cannot be)
--.1 F .772(opened for editing, and an)144 720 R 3.271<798c>-.15 G .771
-(le loaded for editing by)-3.271 F F1(MBna)3.271 E -.1(ve)-.25 G(dit).1
-E F0 .771(will sho)3.271 F 3.271(wa)-.25 G 3.271(s")-3.271 G(lock)-3.271
-E .771(ed" to other)-.1 F(MB-System 5.0)72 768 Q 2.5(3J)146.495 G
-(une 2013)-2.5 E(3)204.835 E 0 Cg EP
-%%Page: 4 4
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mbna)72 48 Q -.15(ve)-.2 G 146.3
-(dit\(1\) MB-System).15 F 146.3(5.0 mbna)2.5 F -.15(ve)-.2 G(dit\(1\))
-.15 E .81(programs. The second column is either blank or sho)144 84 R
-.811(ws "<n)-.25 F -.15(ve)-.4 G .811
-(>". This indicates if a \214le has been).15 F(pre)144 96 Q 1.45
-(viously edited so that an edited na)-.25 F(vig)-.2 E 1.45
-(ation \214le already e)-.05 F 1.45(xists. The third and fourth columns)
--.15 F(sho)144 108 Q 2.867(wt)-.25 G .367(he \214lename path and the)
--2.867 F/F1 10/Times-Bold at 0 SF(MBIO)2.867 E F0 .368(format id, respecti)
-2.868 F -.15(ve)-.25 G(ly).15 E 5.368(.U)-.65 G .368
-(sers can select one of the \214les in)-5.368 F .688(the a)144 120 R
--.25(va)-.2 G .688(ilable list. If the "Edit Selected File" b).25 F .688
-(utton is click)-.2 F .687(ed, the selected \214le will be opened for)
--.1 F .863(editing \(and an)144 132 R 3.363<798c>-.15 G .863
-(le already loaded will be closed \214rst\). If the "Remo)-3.363 F 1.163
--.15(ve S)-.15 H .863(elected File" b).15 F .864(utton is)-.2 F
-(selected, then the selected \214le will be remo)144 144 Q -.15(ve)-.15
-G 2.5(df).15 G(rom the a)-2.5 E -.25(va)-.2 G(ilable list.).25 E F1
-(Contr)108 160.8 Q(ols)-.18 E F0 .971(This b)144 172.8 R .971
-(utton acti)-.2 F -.25(va)-.25 G .971(tes a pulldo).25 F .971
-(wn menu with \214v)-.25 F 3.471(eb)-.15 G(uttons:)-3.671 E F1 -.18(Ti)
-3.471 G .971(me Stepping).18 F F0(,)A F1(Na)3.47 E 3.47(vM)-.25 G
-(odeling)-3.47 E F0(,)A F1 -.18(Ti)3.47 G(me).18 E(Inter)144 184.8 Q
-(polation)-.1 E F0(,)A F1 .697(Delete Bad T)3.197 F(imes)-.18 E F0 3.198
-(,a)C(nd)-3.198 E F1 -.2(Po)3.198 G .698(sition Offset).2 F F0 3.198(.E)
-C .698(ach of these b)-3.198 F .698(uttons brings up a dialog)-.2 F
-(windo)144 196.8 Q 2.5(wc)-.25 G
-(ontaining widgets that set parameters or perform actions.)-2.5 E F1
-(Contr)108 213.6 Q(ols->T)-.18 E(ime Stepping->T)-.18 E(ime Span Sho)
--.18 E(wn)-.1 E F0 .221
-(This slider sets the number of seconds of data sho)144 225.6 R .22
-(wn at a time.)-.25 F .22(This v)5.22 F .22(alue is also set by the)-.25
-F F1(Sho)2.72 E(w)-.1 E(Entir)144 237.6 Q 3.018(eB)-.18 G(uffer)-3.018 E
-F0 -.2(bu)3.018 G .518(tton \(sets time sho).2 F .519(wn to all a)-.25 F
--.25(va)-.2 G .519(ilable data\) and the).25 F F1 .519(Pick T)3.019 F
-.519(ime Inter)-.18 F -.1(va)-.1 G(l).1 E F0(function)3.019 E
-(\(sets time sho)144 249.6 Q(wn to an interacti)-.25 E -.15(ve)-.25 G
-(ly speci\214ed interv).15 E(al\).)-.25 E F1(Contr)108 266.4 Q(ols->T)
--.18 E(ime Stepping->T)-.18 E(ime Step)-.18 E F0
-(This slider sets the number of seconds to step when the)144 278.4 Q F1
--.25(Fo)2.5 G(rward).25 E F0(or)2.5 E F1(Re)2.5 E -.1(ve)-.15 G(rse).1 E
-F0 -.2(bu)2.5 G(ttons are pushed.).2 E F1(Contr)108 295.2 Q(ols->Na)-.18
-E(vigation Modeling->Off)-.25 E F0(This toggle b)144 307.2 Q
-(utton turns na)-.2 E(vig)-.2 E(ation modeling of)-.05 E(f.)-.25 E F1
-(Contr)108 324 Q(ols->Na)-.18 E(vigation Modeling->Gaussian Mean)-.25 E
-F0 1.172(This toggle b)144 336 R 1.172(utton enables na)-.2 F(vig)-.2 E
-1.172(ation smoothing by con)-.05 F -.2(vo)-.4 G 1.171
-(lution with a Gaussian k).2 F 1.171(ernel of user)-.1 F .758
-(de\214ned time width.)144 348 R .758(When this toggle b)5.758 F .759
-(utton is highlighted, a smooth na)-.2 F(vig)-.2 E .759
-(ation model is calcu-)-.05 F 1.424(lated and displayed as a blue line \
-in both the longitude and latitude plots.)144 360 R(The)6.423 E F1(Sho)
-3.923 E 3.923(wS)-.1 G(mooth)-3.923 E(In)144 372 Q -.1(ve)-.4 G(rsion).1
-E F0 1.223(toggle b)3.723 F 1.224(uttons also appear \(already enabled\
-\) for both the longitude and latitude plots)-.2 F
-(among the plot display toggles on the left side of the main)144 384 Q
-F1(MBna)2.5 E -.1(ve)-.25 G(dit).1 E F0(windo)2.5 E -.65(w.)-.25 G F1
-(Contr)108 400.8 Q(ols->Na)-.18 E(vigation Modeling->Dead Reck)-.25 E
-(oning)-.15 E F0 1.908(This toggle b)144 412.8 R 1.908
-(utton enables dead reck)-.2 F 1.908(oning na)-.1 F(vig)-.2 E 1.907
-(ation calculation.)-.05 F 1.907(When this toggle b)6.907 F 1.907
-(utton is)-.2 F 1.302(highlighted, a dead reck)144 424.8 R 1.302
-(oning na)-.1 F(vig)-.2 E 1.302
-(ation model is calculated from the initial position using the)-.05 F
-1.524(current heading and speed data and displayed as a blue line in bo\
-th the longitude and latitude)144 436.8 R 2.527(plots. The)144 448.8 R
-F1(Sho)2.527 E 2.527(wD)-.1 G .027(ead Reck)-2.527 F(oning)-.15 E F0
-.027(toggle b)2.527 F .027
-(uttons also appear \(already enabled\) for both the longi-)-.2 F .097(\
-tude and latitude plots among the plot display toggles on the left side\
- of the main)144 460.8 R F1(MBna)2.596 E -.1(ve)-.25 G(dit).1 E F0(win-)
-2.596 E(do)144 472.8 Q -.65(w.)-.25 G F1(Contr)108 489.6 Q(ols->Na)-.18
-E(vigation Modeling->Smooth In)-.25 E -.1(ve)-.4 G(rsion).1 E F0 .977
-(This toggle b)144 501.6 R .977(utton enables in)-.2 F -.15(ve)-.4 G
-.977(rsion for a smooth na).15 F(vig)-.2 E .977
-(ation model which \214ts the original posi-)-.05 F .176(tions in a lea\
-st squares sense while minimizing speed and acceleration.)144 513.6 R
-.175(When this toggle b)5.175 F .175(utton is)-.2 F .027
-(highlighted, a smooth na)144 525.6 R(vig)-.2 E .028(ation model is cal\
-culated and displayed as a blue line in both the longi-)-.05 F .12
-(tude and latitude plots.)144 537.6 R(The)5.12 E F1(Sho)2.62 E 2.62(wS)
--.1 G .12(mooth In)-2.62 F -.1(ve)-.4 G(rsion).1 E F0 .12(toggle b)2.62
-F .12(uttons also appear \(already enabled\))-.2 F .149(for both the lo\
-ngitude and latitude plots among the plot display toggles on the left s\
-ide of the main)144 549.6 R F1(MBna)144 561.6 Q -.1(ve)-.25 G(dit).1 E
-F0(windo)2.5 E -.65(w.)-.25 G F1(Contr)108 578.4 Q(ols->Na)-.18 E
-(vigation Modeling->Gaussian Mean T)-.25 E(ime W)-.18 E(indo)-.18 E(w)
--.1 E F0 .298
-(This slider sets the width in seconds of the Gaussian smoothing k)144
-590.4 R .298(ernel. If Gaussian mean smooth-)-.1 F .494(ing is enabled,\
- changing this slider causes the smoothing to be recalculated and the r\
-esults sho)144 602.4 R(wn)-.25 E(on the longitude and latitude plots.)
-144 614.4 Q F1(Contr)108 631.2 Q(ols->Na)-.18 E
-(vigation Modeling->Dead Reck)-.25 E(oning Longitude Drift)-.15 E F0
-1.024(This slider sets the longitude drift rate in de)144 643.2 R 1.023
-(grees/hour applied to the dead reck)-.15 F 1.023(oning na)-.1 F(vig)-.2
-E(ation)-.05 E .529(calculation. If dead reck)144 655.2 R .529
-(oning is enabled, changes to this slider cause the dead reck)-.1 F .53
-(oning calcula-)-.1 F(tion to be redone and the results sho)144 667.2 Q
-(wn on the longitude and latitude plots.)-.25 E F1(Contr)108 684 Q
-(ols->Na)-.18 E(vigation Modeling->Dead Reck)-.25 E
-(oning Latitude Drift)-.15 E F0 .308
-(This slider sets the latitude drift rate in de)144 696 R .308
-(grees/hour applied to the dead reck)-.15 F .308(oning na)-.1 F(vig)-.2
-E .308(ation cal-)-.05 F .488(culation. If dead reck)144 708 R .489
-(oning is enabled, changes to this slider cause the dead reck)-.1 F .489
-(oning calculation)-.1 F(to be redone and the results sho)144 720 Q
-(wn on the longitude and latitude plots.)-.25 E(MB-System 5.0)72 768 Q
-2.5(3J)146.495 G(une 2013)-2.5 E(4)204.835 E 0 Cg EP
-%%Page: 5 5
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mbna)72 48 Q -.15(ve)-.2 G 146.3
-(dit\(1\) MB-System).15 F 146.3(5.0 mbna)2.5 F -.15(ve)-.2 G(dit\(1\))
-.15 E/F1 10/Times-Bold at 0 SF(Contr)108 84 Q(ols->Na)-.18 E
-(vigation Modeling->Speed De)-.25 E(viation)-.15 E F0 .194(This te)144
-96 R .194(xt entry sets the penalty weighting ag)-.15 F .194
-(ainst speed applied in the in)-.05 F -.15(ve)-.4 G .193
-(rsion for a smooth na).15 F(vi-)-.2 E -.05(ga)144 108 S .306
-(tion. Higher v).05 F .306(alues result in a smoother model; lo)-.25 F
-.306(wer v)-.25 F .307(alues result in a model that more closely)-.25 F
-(follo)144 120 Q 1.105(ws the original na)-.25 F(vig)-.2 E 1.105
-(ation. The def)-.05 F 1.105(ault v)-.1 F 1.105(alue is 100. This v)-.25
-F 1.105(alue is not actually set until the)-.25 F F1 -.25(Ap)144 132 S
-(ply).25 E F0 -.2(bu)2.5 G(tton to the left is click).2 E(ed.)-.1 E F1
-(Contr)108 148.8 Q(ols->Na)-.18 E(vigation Modeling->Acceleration)-.25 E
-F0 .323(This te)144 160.8 R .323(xt entry sets the penalty weighting ag)
--.15 F .323(ainst accleration applied in the in)-.05 F -.15(ve)-.4 G
-.324(rsion for a smooth).15 F(na)144 172.8 Q(vig)-.2 E 1.248
-(ation. Higher v)-.05 F 1.248(alues result in a smoother model; lo)-.25
-F 1.247(wer v)-.25 F 1.247(alues result in a model that more)-.25 F .098
-(closely follo)144 184.8 R .098(ws the original na)-.25 F(vig)-.2 E .098
-(ation. The def)-.05 F .098(ault v)-.1 F .098(alue is 100. This v)-.25 F
-.098(alue is not actually set until)-.25 F(the)144 196.8 Q F1 -.25(Ap)
-2.5 G(ply).25 E F0 -.2(bu)2.5 G(tton to the left is click).2 E(ed.)-.1 E
-F1(Contr)108 213.6 Q(ols->Na)-.18 E(vigation Modeling->A)-.25 E(pply)
--.25 E F0 .563(This b)144 225.6 R .563(utton causes the v)-.2 F .563
-(alues in the)-.25 F F1 .563(Speed De)3.063 F(viation)-.15 E F0(and)
-3.062 E F1(Acceleration)3.062 E F0(te)3.062 E .562
-(xt entries to its right to)-.15 F .527(be applied. If smooth in)144
-237.6 R -.15(ve)-.4 G .527(rsion is enabled, then clicking this b).15 F
-.528(utton will cause the in)-.2 F -.15(ve)-.4 G .528(rsion to be).15 F
-(recalculated and the results displayed in the longitude and latitude p\
-lots.)144 249.6 Q F1(Contr)108 266.4 Q(ols->Na)-.18 E
-(vigation Modeling->Dismiss)-.25 E F0(This b)144 278.4 Q
-(utton causes the)-.2 E F1(Na)2.5 E(vigation Modeling)-.25 E F0
-(dialog to disappear)2.5 E(.)-.55 E F1(Contr)108 295.2 Q(ols->T)-.18 E
-(ime Inter)-.18 E(polation->A)-.1 E(pply)-.25 E F0 .088(This b)144 307.2
-R .088(utton causes the time stamps of all data in the current b)-.2 F
-(uf)-.2 E .087(fer associated with ne)-.25 F -.05(ga)-.15 G(ti).05 E
-.387 -.15(ve o)-.25 H 2.587(rz).15 G(ero)-2.587 E 1.13(time interv)144
-319.2 R 1.13(als to be interpolated so that the time interv)-.25 F 1.13
-(als are positi)-.25 F -.15(ve)-.25 G 3.63(.T).15 G(he)-3.63 E F1 -.18
-(Ti)3.63 G 1.13(me Inter).18 F(polation)-.1 E F0
-(dialog disappears after this action is tak)144 331.2 Q(en.)-.1 E F1
-(Contr)108 348 Q(ols->T)-.18 E(ime Inter)-.18 E(polation->Dismiss)-.1 E
-F0(This b)144 360 Q(utton causes the)-.2 E F1 -.18(Ti)2.5 G(me Inter).18
-E(polation)-.1 E F0(dialog to disappear)2.5 E(.)-.55 E F1(Contr)108
-376.8 Q(ols->Delete Bad T)-.18 E(imes->A)-.18 E(pply)-.25 E F0 .647
-(This b)144 388.8 R .647(utton causes all data in the current b)-.2 F
-(uf)-.2 E .647(fer associated with ne)-.25 F -.05(ga)-.15 G(ti).05 E
-.947 -.15(ve o)-.25 H 3.147(rz).15 G .647(ero time interv)-3.147 F .646
-(als to)-.25 F(be deleted.)144 400.8 Q(The)5 E F1(Delete Bad T)2.5 E
-(imes)-.18 E F0(dialog disappears after this action is tak)2.5 E(en.)-.1
-E F1(Contr)108 417.6 Q(ols->Delete Bad T)-.18 E(imes->Dismiss)-.18 E F0
-(This b)144 429.6 Q(utton causes the)-.2 E F1(Delete Bad T)2.5 E(imes)
--.18 E F0(dialog to disappear)2.5 E(.)-.55 E F1(Contr)108 446.4 Q
-(ols->P)-.18 E(osition Offset->Longitude Offset)-.2 E F0(This te)144
-458.4 Q(xt widget allo)-.15 E
-(ws the user to set the desired longitude of)-.25 E(fset in de)-.25 E
-(grees.)-.15 E F1(Contr)108 475.2 Q(ols->P)-.18 E
-(osition Offset->Latitude Offset)-.2 E F0(This te)144 487.2 Q
-(xt widget allo)-.15 E(ws the user to set the desired latitude of)-.25 E
-(fset in de)-.25 E(grees.)-.15 E F1(Contr)108 504 Q(ols->P)-.18 E
-(osition Offset->A)-.2 E(pply)-.25 E F0 1.356(This b)144 516 R 1.356
-(utton applies the current longitude and latitude of)-.2 F 1.357
-(fsets to all of the na)-.25 F(vig)-.2 E 1.357(ation data.)-.05 F(The)
-6.357 E F1 -.2(Po)144 528 S(sition Offset).2 E F0
-(dialog disappears after this action is tak)2.5 E(en.)-.1 E F1(Contr)108
-544.8 Q(ols->P)-.18 E(osition Offset->Dismiss)-.2 E F0(This b)144 556.8
-Q(utton causes the)-.2 E F1(Delete Bad T)2.5 E(imes)-.18 E F0
-(dialog to disappear)2.5 E(.)-.55 E F1(Start)108 573.6 Q F0 1.483
-(This b)14.34 F 1.483
-(utton causes the set of displayed pings to step backw)-.2 F 1.482
-(ard to the be)-.1 F 1.482(ginning of the current)-.15 F -.2(bu)144
-585.6 S -.25(ff).2 G(er).25 E(.)-.55 E F1(Re)108 602.4 Q -.1(ve)-.15 G
-(rse).1 E F0 .963(This b)144 614.4 R .963
-(utton causes the set of displayed pings to step)-.2 F/F2 10
-/Times-Italic at 0 SF(nstep)3.463 E F0 .963(pings backw)3.463 F .963
-(ard in the current b)-.1 F(uf)-.2 E(fer)-.25 E(.)-.55 E
-(The middle mouse b)144 626.4 Q(utton causes the same action.)-.2 E F1
--.25(Fo)108 643.2 S(rward).25 E F0 .123(This b)144 655.2 R .123
-(utton causes the set of displayed pings to step)-.2 F F2(nstep)2.622 E
-F0 .122(pings forw)2.622 F .122(ard in the current b)-.1 F(uf)-.2 E(fer)
--.25 E 5.122(.T)-.55 G(he)-5.122 E(right mouse b)144 667.2 Q
-(utton causes the same action.)-.2 E F1(End)108 684 Q F0(This b)18.21 E
-(utton causes the set of displayed pings to step forw)-.2 E
-(ard to the end of the current b)-.1 E(uf)-.2 E(fer)-.25 E(.)-.55 E F1
-(Next Buffer)108 700.8 Q F0 .59(This b)144 712.8 R .59
-(utton causes the program to write out the data from the current b)-.2 F
-(uf)-.2 E .59(fer and then read in and)-.25 F 1.269(display the ne)144
-724.8 R 1.269(xt b)-.15 F(uf)-.2 E(fer)-.25 E 6.269(.I)-.55 G 3.769(ft)
--6.269 G 1.268(here is no more data to be read in after the current b)
--3.769 F(uf)-.2 E 1.268(fer has been)-.25 F(MB-System 5.0)72 768 Q 2.5
-(3J)146.495 G(une 2013)-2.5 E(5)204.835 E 0 Cg EP
-%%Page: 6 6
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mbna)72 48 Q -.15(ve)-.2 G 146.3
-(dit\(1\) MB-System).15 F 146.3(5.0 mbna)2.5 F -.15(ve)-.2 G(dit\(1\))
-.15 E(written out, then the input and output \214les are closed.)144 84
-Q/F1 10/Times-Bold at 0 SF(Sho)108 100.8 Q 2.5(wA)-.1 G(ll)-2.5 E F0
-(This b)144 112.8 Q(utton causes the plots to e)-.2 E(xpand to sho)-.15
-E 2.5(wa)-.25 G(ll of the data in the current b)-2.5 E(uf)-.2 E(fer)-.25
-E(.)-.55 E F1(Pick Zoom)108 129.6 Q F0 .195(This b)144 141.6 R .195
-(utton allo)-.2 F .195
-(ws users to focus the plots on a particular time interv)-.25 F .196
-(al. Once the b)-.25 F .196(utton is pushed,)-.2 F 1.238
-(the left mouse b)144 153.6 R 1.238
-(utton is used to select the left edge of the time selection. Similarly)
--.2 F 3.737(,t)-.65 G 1.237(he middle)-3.737 F .677(mouse b)144 165.6 R
-.677(utton selects the right edge of the time selection.)-.2 F .678
-(Both ends of the time selection can be)5.678 F 1.508
-(adjusted multiple times.)144 177.6 R 1.508(Once the time interv)6.508 F
-1.508(al of interest is selected to the users satisf)-.25 F(action,)-.1
-E .27(pressing the right mouse b)144 189.6 R .27
-(utton will cause the plots to be redra)-.2 F .27
-(wn with the selected be)-.15 F .27(ginning and)-.15 F(ending times.)144
-201.6 Q F1(Done | Next File)108 218.4 Q F0 1.203
-(When the last \214le in the list of \214les a)144 230.4 R -.25(va)-.2 G
-1.203(ilable for editing has been loaded, this b).25 F 1.202(utton sho)
--.2 F 1.202(ws as)-.25 F .298("Done". Otherwise, it sho)144 242.4 R .298
-(ws as "Ne)-.25 F .299(xt File". In either case, this b)-.15 F .299
-(utton causes the program to write)-.2 F .302(out all of the edited na)
-144 254.4 R(vig)-.2 E .301(ation data and then close the current \214le\
-. If the current \214le is not the last)-.05 F(one in the a)144 266.4 Q
--.25(va)-.2 G(ilable list, then the ne).25 E(xt unlock)-.15 E
-(ed \214le will be loaded for editing.)-.1 E F1(Quit)108 283.2 Q F0 .932
-(This b)16.55 F .932(utton causes the program to e)-.2 F .933
-(xit gracefully)-.15 F 5.933(.I)-.65 G 3.433(fad)-5.933 G .933
-(ata \214le has been loaded, all of the edits)-3.433 F
-(will be output before e)144 295.2 Q(xiting.)-.15 E F1(About)108 312 Q
-F0(This b)9.33 E(utton causes a dialog to appear sho)-.2 E
-(wing some information about the program.)-.25 E F1(Inter)108 328.8 Q
-(polate)-.1 E F0 .178(This b)144 340.8 R .177(utton causes the selected\
- data to be replaced by linear interpolation of the surrounding unse-)
--.2 F .81(lected data. If the selection e)144 352.8 R .81
-(xtends to the edge of the data, the selected data will be replaced by)
--.15 F(the \214rst unselected datum on the other side.)144 364.8 Q F1
-(Inter)108 381.6 Q(polate Repeats)-.1 E F0 .798(This b)144 393.6 R .798
-(utton causes an)-.2 F 3.298(yr)-.15 G .798(epeated v)-3.298 F .797
-(alues in the selected data to be replaced by linear interpolation)-.25
-F(between the \214rst of the repeated v)144 405.6 Q(alues and the ne)
--.25 E(xt dif)-.15 E(ferent v)-.25 E(alue.)-.25 E F1(Re)108 422.4 Q -.1
-(ve)-.15 G(rt Selection).1 E F0(This b)144 434.4 Q
-(utton causes the selected data to re)-.2 E -.15(ve)-.25 G
-(rt to their original v).15 E(alues.)-.25 E F1(Use Solution)108 451.2 Q
-F0 .982(This b)144 463.2 R .982(utton only appears when one of the tw)
--.2 F 3.482(on)-.1 G -.2(av)-3.482 G(ig).2 E .982
-(ation modeling algorithms is acti)-.05 F -.25(va)-.25 G .983(ted from)
-.25 F .095(the Na)144 475.2 R(vig)-.2 E .095(ation Modeling dialog.)-.05
-F .095(This b)5.095 F .095(utton causes an)-.2 F 2.595(ys)-.15 G .095
-(elected longitude or latitude v)-2.595 F .095(alues to be)-.25 F .645
-(replaced by v)144 487.2 R .645(alues from na)-.25 F(vig)-.2 E .645
-(ation modeling. Either dead reck)-.05 F .645(oning or smooth in)-.1 F
--.15(ve)-.4 G .645(rsion na).15 F(vig)-.2 E(a-)-.05 E .377
-(tion modeling must be enabled. The longitude and latitude v)144 499.2 R
-.377(alues are replaced in pairs \(if a longi-)-.25 F .449(tude v)144
-511.2 R .449(alue is selected, the corresponding latitude v)-.25 F .45
-(alue will also be replaced, and vice v)-.25 F .45(ersa\). The)-.15 F
-(typical sequence is to:)144 523.2 Q
-(1\) adjust the modeling until an acceptable solution)154 535.2 Q
-(is achie)161.5 547.2 Q -.15(ve)-.25 G(d.).15 E(2\) click on the)154
-559.2 Q F1(Select All)2.5 E F0(toggle b)2.5 E(utton)-.2 E
-(3\) click in either the longitude or latitude plot)154 571.2 Q
-(so that all v)161.5 583.2 Q(alues in that windo)-.25 E 2.5(wa)-.25 G
-(re selected)-2.5 E(4\) click on the)154 595.2 Q F1(Use Solution)2.5 E
-F0 -.2(bu)2.5 G(tton so that the).2 E(na)161.5 607.2 Q(vig)-.2 E
-(ation model is adopted for all longitude)-.05 E(and latitude v)161.5
-619.2 Q(alues)-.25 E F1(Flag)108 636 Q F0 1.258(This b)17.11 F 1.257
-(utton only appears when either of the Gaussian mean or the smooth in)
--.2 F -.15(ve)-.4 G 1.257(rsion na).15 F(vig)-.2 E(ation)-.05 E 1.565
-(modeling algorithm is acti)144 648 R -.25(va)-.25 G 1.566
-(ted from the Na).25 F(vig)-.2 E 1.566(ation Modeling dialog.)-.05 F
-1.566(This b)6.566 F 1.566(utton causes an)-.2 F(y)-.15 E .232
-(selected longitude or latitude v)144 660 R .232
-(alues to be \215agged to be ignored by the na)-.25 F(vig)-.2 E .232
-(ation smoothing algo-)-.05 F(rithm. Flagged positions are sho)144 672 Q
-(wn in orange.)-.25 E F1(Un\215ag)108 688.8 Q F0 .391(This b)7.66 F .391
-(utton only appears when the Gaussian mean or smooth in)-.2 F -.15(ve)
--.4 G .392(rsion na).15 F(vig)-.2 E .392(ation modeling algo-)-.05 F .1
-(rithm is acti)144 700.8 R -.25(va)-.25 G .1(ted from the Na).25 F(vig)
--.2 E .1(ation Modeling dialog.)-.05 F .1(This b)5.1 F .1
-(utton causes an)-.2 F 2.6(ys)-.15 G .1(elected longitude)-2.6 F .01
-(or latitude v)144 712.8 R .01
-(alues to be un\215agged. Flagged positions are ignored by the na)-.25 F
-(vig)-.2 E .01(ation smoothing algo-)-.05 F 2.231(rithm. An)144 724.8 R
-4.731(yp)-.15 G 2.231(ositions which are un\215agged will once ag)-4.731
-F 2.23(ain be used by the modeling method.)-.05 F(MB-System 5.0)72 768 Q
-2.5(3J)146.495 G(une 2013)-2.5 E(6)204.835 E 0 Cg EP
-%%Page: 7 7
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mbna)72 48 Q -.15(ve)-.2 G 146.3
-(dit\(1\) MB-System).15 F 146.3(5.0 mbna)2.5 F -.15(ve)-.2 G(dit\(1\))
-.15 E .354(Flagged positions are sho)144 84 R .354(wn in orange.)-.25 F
-.355(Un\215agged positions are sho)5.355 F .355
-(wn in either black \(if the)-.25 F 2.855(ya)-.15 G(re)-2.855 E .161
-(unchanged\) or purple \(if the)144 96 R 2.661(yh)-.15 G -2.25 -.2(av e)
--2.661 H .16
-(been altered by interpolation or application of a modeling solu-)2.861
-F(tion\).)144 108 Q/F1 10/Times-Bold at 0 SF(Pick)108 124.8 Q F0 1.045
-(Clicking on this toggle b)17.11 F 1.045(utton sets the edit mode to "p\
-ick". In this case, clicking the left mouse)-.2 F -.2(bu)144 136.8 S
-(tton will cause the nearest data v).2 E
-(alue to toggle between selected \(red\) and unselected.)-.25 E F1
-(Select)108 153.6 Q F0 .099(Clicking on this toggle b)11.01 F .098(utto\
-n sets the edit mode to "select". In this case, clicking and dragging t\
-he)-.2 F(left mouse b)144 165.6 Q(utton will cause an)-.2 E 2.5(yd)-.15
-G(ata v)-2.5 E(alue touched by the cursor to become selected.)-.25 E F1
-(Deselect)108 182.4 Q F0 .434(Clicking on this toggle b)144 194.4 R .434
-(utton sets the edit mode to "deselect". In this case, clicking and dra\
-gging)-.2 F(the left mouse b)144 206.4 Q(utton will cause an)-.2 E 2.5
-(yd)-.15 G(ata v)-2.5 E
-(alue touched by the cursor to become unselected.)-.25 E F1(Select All)
-108 223.2 Q F0 .33(Clicking on this toggle b)144 235.2 R .329
-(utton sets the edit mode to "select all". In this case, clicking in an)
--.2 F 2.829(yo)-.15 G 2.829(ft)-2.829 G(he)-2.829 E
-(editable plots will cause all of the data in that plot to be selected.)
-144 247.2 Q F1(Deselect All)108 264 Q F0 .329(Clicking on this toggle b)
-144 276 R .33
-(utton sets the edit mode to "select all". In this case, clicking in an)
--.2 F 2.83(yo)-.15 G 2.83(ft)-2.83 G(he)-2.83 E(editable plots will cau\
-se all of the data in that plot to be unselected.)144 288 Q F1 -.18(Ti)
-108 304.8 S(me Inter).18 E -.1(va)-.1 G 2.5(lP).1 G(lot)-2.5 E F0
-(This toggle b)144 316.8 Q(utton turns the time interv)-.2 E
-(al plot on and of)-.25 E(f.)-.25 E F1(Sho)108 333.6 Q 2.5(wO)-.1 G
-(riginal Data \(T)-2.5 E(ime Inter)-.18 E -.1(va)-.1 G 2.5(lP).1 G
-(lot\))-2.5 E F0 .284(When this toggle b)144 345.6 R .284
-(utton is on, the time interv)-.2 F .284
-(al plot includes a green line representing the original)-.25 F
-(time interv)144 357.6 Q(al v)-.25 E(alues.)-.25 E F1(Longitude Plot)108
-374.4 Q F0(This toggle b)144 386.4 Q
-(utton turns the longitude plot on and of)-.2 E(f.)-.25 E F1(Sho)108
-403.2 Q 2.5(wO)-.1 G(riginal Data \(Longitude Plot\))-2.5 E F0 1.156
-(When this toggle b)144 415.2 R 1.156(utton is on, the longitude plot i\
-ncludes a green line representing the original)-.2 F(longitude v)144
-427.2 Q(alues.)-.25 E F1(Sho)108 444 Q 2.5(wD)-.1 G(ead Reck)-2.5 E
-(oning \(Longitude Plot\))-.15 E F0 .102(When this toggle b)144 456 R
-.101(utton is on, the longitude plot includes a blue line representing \
-the dead reck)-.2 F(on-)-.1 E(ing longitude v)144 468 Q(alues.)-.25 E F1
-(Sho)108 484.8 Q 2.5(wS)-.1 G(mooth In)-2.5 E -.1(ve)-.4 G
-(rsion \(Longitude Plot\)).1 E F0 1.599(When this toggle b)144 496.8 R
-1.599(utton is on, the longitude plot includes a blue line representing\
- the smooth)-.2 F(in)144 508.8 Q -.15(ve)-.4 G(rsion longitude v).15 E
-(alues.)-.25 E F1(Latitude Plot)108 525.6 Q F0(This toggle b)144 537.6 Q
-(utton turns the latitude plot on and of)-.2 E(f.)-.25 E F1(Sho)108
-554.4 Q 2.5(wO)-.1 G(riginal Data \(Latitude Plot\))-2.5 E F0 .407
-(When this toggle b)144 566.4 R .407(utton is on, the latitude plot inc\
-ludes a green line representing the original lati-)-.2 F(tude v)144
-578.4 Q(alues.)-.25 E F1(Sho)108 595.2 Q 2.5(wD)-.1 G(ead Reck)-2.5 E
-(oning \(Latitude Plot\))-.15 E F0 .587(When this toggle b)144 607.2 R
-.588(utton is on, the latitude plot includes a blue line representing t\
-he dead reck)-.2 F(on-)-.1 E(ing latitude v)144 619.2 Q(alues.)-.25 E F1
-(Sho)108 636 Q 2.5(wS)-.1 G(mooth In)-2.5 E -.1(ve)-.4 G
-(rsion \(Latitude Plot\)).1 E F0 .384(When this toggle b)144 648 R .384
-(utton is on, the latitude plot includes a blue line representing the s\
-mooth in)-.2 F -.15(ve)-.4 G -.2(r-).15 G(sion latitude v)144 660 Q
-(alues.)-.25 E F1(Speed Plot)108 676.8 Q F0(This toggle b)144 688.8 Q
-(utton turns the speed plot on and of)-.2 E(f.)-.25 E F1(Sho)108 705.6 Q
-2.5(wO)-.1 G(riginal Data \(Speed Plot\))-2.5 E F0 .442
-(When this toggle b)144 717.6 R .443(utton is on, the speed plot includ\
-es a green line representing the original speed)-.2 F -.25(va)144 729.6
-S(lues.).25 E(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(7)
-204.835 E 0 Cg EP
-%%Page: 8 8
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mbna)72 48 Q -.15(ve)-.2 G 146.3
-(dit\(1\) MB-System).15 F 146.3(5.0 mbna)2.5 F -.15(ve)-.2 G(dit\(1\))
-.15 E/F1 10/Times-Bold at 0 SF(Sho)108 84 Q 2.5(wS)-.1 G
-(peed-Made-Good \(Speed Plot\))-2.5 E F0 1.158(When this toggle b)144 96
-R 1.157(utton is on, the speed plot includes a blue line representing t\
-he speed-made-)-.2 F(good v)144 108 Q(alues deri)-.25 E -.15(ve)-.25 G
-2.5(df).15 G(rom the longitude and latitude time series.)-2.5 E F1
-(Use Speed-Made-Good \(Speed Plot\))108 124.8 Q F0 .093(When this b)144
-136.8 R .094(utton is pushed, an)-.2 F 2.594(ys)-.15 G .094
-(elected data in the speed plot will be replaced by the current esti-)
--2.594 F(mates of speed-made-good.)144 148.8 Q F1(Heading Plot)108 165.6
-Q F0(This toggle b)144 177.6 Q(utton turns the heading plot on and of)
--.2 E(f.)-.25 E F1(Sho)108 194.4 Q 2.5(wO)-.1 G
-(riginal Data \(Heading Plot\))-2.5 E F0 .443(When this toggle b)144
-206.4 R .442(utton is on, the speed plot includes a green line represen\
-ting the original speed)-.2 F -.25(va)144 218.4 S(lues.).25 E F1(Sho)108
-235.2 Q 2.5(wC)-.1 G(ourse-Made-Good \(Heading Plot\))-2.5 E F0 .342
-(When this toggle b)144 247.2 R .343(utton is on, the heading plot incl\
-udes a blue line representing the course-made-)-.2 F(good v)144 259.2 Q
-(alues deri)-.25 E -.15(ve)-.25 G 2.5(df).15 G
-(rom the longitude and latitude time series.)-2.5 E F1
-(Use Course-Made-Good \(Heading Plot\))108 276 Q F0 .737(When this b)144
-288 R .737(utton is pushed, an)-.2 F 3.237(ys)-.15 G .736
-(elected data in the heading plot will be replaced by the current)-3.237
-F(estimates of course-made-good.)144 300 Q F1(Roll, Pitch, and Hea)108
-316.8 Q .2 -.1(ve P)-.25 H(lots).1 E F0 .184(This toggle b)144 328.8 R
-.184(utton turns the roll, pitch, and hea)-.2 F .484 -.15(ve p)-.2 H
-.185(lots on and of).15 F 2.685(f. Unlik)-.25 F 2.685(et)-.1 G .185
-(he other plots, the data)-2.685 F .28(in these plots is not editable.)
-144 340.8 R .28(These data are sho)5.28 F .28(wn purely to allo)-.25 F
-2.78(wu)-.25 G .28(sers to determine if the v)-2.78 F(erti-)-.15 E .492
-(cal reference sensors were w)144 352.8 R .493
-(orking properly at the time the data w)-.1 F .493
-(as collected \(note: man)-.1 F 2.993(ys)-.15 G -.1(wa)-2.993 G(th).1 E
-(data formats do not contain roll, pitch, and hea)144 364.8 Q .3 -.15
-(ve d)-.2 H(ata\).).15 E/F2 10.95/Times-Bold at 0 SF(MOUSE A)72 393.6 Q
-(CTIONS)-.602 E F1(Left Mouse Button)108 405.6 Q F0 .07
-(The left mouse b)144 417.6 R .07(utton is used to pick data v)-.2 F
-2.569(alues. Unselected)-.25 F .069(data v)2.569 F .069(alues are sho)
--.25 F .069(wn as \214lled black)-.25 F .258(squares and selected v)144
-429.6 R .259(alues as empty red squares.)-.25 F .259
-(The manner in which data are selected or unse-)5.259 F .162
-(lected is controlled by the edit mode, as set by the)144 441.6 R F1
-(Pick)2.662 E F0(,)A F1(Select)2.662 E F0(,)A F1(Deselect)2.662 E F0(,)A
-F1 .161(Select All)2.661 F F0 2.661(,a)C(nd)-2.661 E F1(Deselect)2.661 E
-(All)144 453.6 Q F0 -.2(bu)2.5 G(ttons.).2 E F1(Middle Mouse Button)108
-470.4 Q F0 .058(The middle mouse b)144 482.4 R .058
-(utton causes the set of displayed data to step backw)-.2 F .059
-(ard in the current b)-.1 F(uf)-.2 E .059(fer by)-.25 F 1.563
-(the amount of time set on the)144 494.4 R F1 -.18(Ti)4.063 G 1.563
-(me Step).18 F F0(slider)4.063 E 6.563(.T)-.55 G 1.563(he control b)
--6.563 F(utton)-.2 E F1(Re)4.063 E -.1(ve)-.15 G(rse).1 E F0 1.563
-(causes the same)4.063 F(action.)144 506.4 Q F1(Right Mouse Button)108
-523.2 Q F0 .132(The right mouse b)144 535.2 R .132
-(utton causes the set of displayed data to step forw)-.2 F .132
-(ard in the current b)-.1 F(uf)-.2 E .133(fer by the)-.25 F
-(amount of time set on the)144 547.2 Q F1 -.18(Ti)2.5 G(me Step).18 E F0
-(slider)2.5 E 5(.T)-.55 G(he control b)-5 E(utton)-.2 E F1 -.25(Fo)2.5 G
-(rward).25 E F0(causes the same action.)2.5 E F2(SEE ALSO)72 576 Q F1
-(mbsystem)108 588 Q F0(\(1\),)A F1(mbio)2.5 E F0(\(1\),)A F1(mbpr)2.5 E
-(ocess)-.18 E F0(\(1\),)A F1(mbset)2.5 E F0(\(1\),)A F1(mbedit)2.5 E F0
-(\(1\),)A F1(mbeditviz)2.5 E F0(\(1\),)A F1(mbinf)2.5 E(o)-.25 E F0
-(\(1\))A F2 -.11(BU)72 616.8 S(GS).11 E F0(This program doesn')108 628.8
-Q 2.5(th)-.18 G(andle the roll, pitch, and hea)-2.5 E .3 -.15(ve d)-.2 H
-(ata in a general w).15 E(ay)-.1 E(.)-.65 E(MB-System 5.0)72 768 Q 2.5
-(3J)146.495 G(une 2013)-2.5 E(8)204.835 E 0 Cg EP
-%%Trailer
-end
-%%EOF
diff --git a/src/ps/mbnavlist.ps b/src/ps/mbnavlist.ps
deleted file mode 100644
index b04d550..0000000
--- a/src/ps/mbnavlist.ps
+++ /dev/null
@@ -1,761 +0,0 @@
-%!PS-Adobe-3.0
-%%Creator: groff version 1.19.2
-%%CreationDate: Wed Jul  1 12:29:30 2015
-%%DocumentNeededResources: font Times-Roman
-%%+ font Times-Bold
-%%+ font Times-Italic
-%%DocumentSuppliedResources: procset grops 1.19 2
-%%Pages: 6
-%%PageOrder: Ascend
-%%DocumentMedia: Default 612 792 0 () ()
-%%Orientation: Portrait
-%%EndComments
-%%BeginDefaults
-%%PageMedia: Default
-%%EndDefaults
-%%BeginProlog
-%%BeginResource: procset grops 1.19 2
-%!PS-Adobe-3.0 Resource-ProcSet
-/setpacking where{
-pop
-currentpacking
-true setpacking
-}if
-/grops 120 dict dup begin
-/SC 32 def
-/A/show load def
-/B{0 SC 3 -1 roll widthshow}bind def
-/C{0 exch ashow}bind def
-/D{0 exch 0 SC 5 2 roll awidthshow}bind def
-/E{0 rmoveto show}bind def
-/F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def
-/G{0 rmoveto 0 exch ashow}bind def
-/H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/I{0 exch rmoveto show}bind def
-/J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def
-/K{0 exch rmoveto 0 exch ashow}bind def
-/L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/M{rmoveto show}bind def
-/N{rmoveto 0 SC 3 -1 roll widthshow}bind def
-/O{rmoveto 0 exch ashow}bind def
-/P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/Q{moveto show}bind def
-/R{moveto 0 SC 3 -1 roll widthshow}bind def
-/S{moveto 0 exch ashow}bind def
-/T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/SF{
-findfont exch
-[exch dup 0 exch 0 exch neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/MF{
-findfont
-[5 2 roll
-0 3 1 roll
-neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/level0 0 def
-/RES 0 def
-/PL 0 def
-/LS 0 def
-/MANUAL{
-statusdict begin/manualfeed true store end
-}bind def
-/PLG{
-gsave newpath clippath pathbbox grestore
-exch pop add exch pop
-}bind def
-/BP{
-/level0 save def
-1 setlinecap
-1 setlinejoin
-72 RES div dup scale
-LS{
-90 rotate
-}{
-0 PL translate
-}ifelse
-1 -1 scale
-}bind def
-/EP{
-level0 restore
-showpage
-}def
-/DA{
-newpath arcn stroke
-}bind def
-/SN{
-transform
-.25 sub exch .25 sub exch
-round .25 add exch round .25 add exch
-itransform
-}bind def
-/DL{
-SN
-moveto
-SN
-lineto stroke
-}bind def
-/DC{
-newpath 0 360 arc closepath
-}bind def
-/TM matrix def
-/DE{
-TM currentmatrix pop
-translate scale newpath 0 0 .5 0 360 arc closepath
-TM setmatrix
-}bind def
-/RC/rcurveto load def
-/RL/rlineto load def
-/ST/stroke load def
-/MT/moveto load def
-/CL/closepath load def
-/Fr{
-setrgbcolor fill
-}bind def
-/setcmykcolor where{
-pop
-/Fk{
-setcmykcolor fill
-}bind def
-}if
-/Fg{
-setgray fill
-}bind def
-/FL/fill load def
-/LW/setlinewidth load def
-/Cr/setrgbcolor load def
-/setcmykcolor where{
-pop
-/Ck/setcmykcolor load def
-}if
-/Cg/setgray load def
-/RE{
-findfont
-dup maxlength 1 index/FontName known not{1 add}if dict begin
-{
-1 index/FID ne{def}{pop pop}ifelse
-}forall
-/Encoding exch def
-dup/FontName exch def
-currentdict end definefont pop
-}bind def
-/DEFS 0 def
-/EBEGIN{
-moveto
-DEFS begin
-}bind def
-/EEND/end load def
-/CNT 0 def
-/level1 0 def
-/PBEGIN{
-/level1 save def
-translate
-div 3 1 roll div exch scale
-neg exch neg exch translate
-0 setgray
-0 setlinecap
-1 setlinewidth
-0 setlinejoin
-10 setmiterlimit
-[]0 setdash
-/setstrokeadjust where{
-pop
-false setstrokeadjust
-}if
-/setoverprint where{
-pop
-false setoverprint
-}if
-newpath
-/CNT countdictstack def
-userdict begin
-/showpage{}def
-/setpagedevice{}def
-}bind def
-/PEND{
-countdictstack CNT sub{end}repeat
-level1 restore
-}bind def
-end def
-/setpacking where{
-pop
-setpacking
-}if
-%%EndResource
-%%EndProlog
-%%BeginSetup
-%%BeginFeature: *PageSize Default
-<< /PageSize [ 612 792 ] /ImagingBBox null >> setpagedevice
-%%EndFeature
-%%IncludeResource: font Times-Roman
-%%IncludeResource: font Times-Bold
-%%IncludeResource: font Times-Italic
-grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72
-def/PL 792 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron/Zcaron
-/scaron/zcaron/Ydieresis/trademark/quotesingle/Euro/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/space/exclam/quotedbl/numbersign/dollar/percent
-/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen
-/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon
-/semicolon/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O
-/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright/circumflex
-/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y
-/z/braceleft/bar/braceright/tilde/.notdef/quotesinglbase/guillemotleft
-/guillemotright/bullet/florin/fraction/perthousand/dagger/daggerdbl
-/endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut
-/dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash
-/quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen
-/brokenbar/section/dieresis/copyright/ordfeminine/guilsinglleft
-/logicalnot/minus/registered/macron/degree/plusminus/twosuperior
-/threesuperior/acute/mu/paragraph/periodcentered/cedilla/onesuperior
-/ordmasculine/guilsinglright/onequarter/onehalf/threequarters
-/questiondown/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE
-/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex
-/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis
-/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn
-/germandbls/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla
-/egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis
-/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide/oslash
-/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis]def
-/Times-Italic at 0 ENC0/Times-Italic RE/Times-Bold at 0 ENC0/Times-Bold RE
-/Times-Roman at 0 ENC0/Times-Roman RE
-%%EndSetup
-%%Page: 1 1
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mbna)72 48 Q 148.92(vlist\(1\) MB-System)-.2 F
-148.92(5.0 mbna)2.5 F(vlist\(1\))-.2 E/F1 10.95/Times-Bold at 0 SF -.219
-(NA)72 84 S(ME).219 E/F2 10/Times-Bold at 0 SF(mbna)108 96 Q(vlist)-.25 E
-F0 2.5<ad4c>2.5 G(ist na)-2.5 E(vig)-.2 E(ation data in sw)-.05 E
-(ath sonar data \214les.)-.1 E F1(VERSION)72 124.8 Q F0 -1.11(Ve)108
-136.8 S(rsion 5.0)1.11 E F1(SYNOPSIS)72 165.6 Q F2(mbna)108 177.6 Q
-(vlist)-.25 E F0([)5.733 E F2<ad42>A/F3 10/Times-Italic at 0 SF
-(yr/mo/da/hr/mn/sc)A F2<ad44>5.733 E F3(decimate)A F2<ad45>5.733 E F3
-(yr/mo/da/hr/mn/sc)A F2<ad46>5.733 E F3(format)A F2<ad47>5.733 E F3
-(delimeter)A F2 3.232<ad4820ad49>5.733 F F3(\214le)A F2<ad4b>108 189.6 Q
-F3(kind)A F2<ad4c>6.308 E F3(lon\215ip)A F2<ad4e>6.308 E F3(navc)A
-(hannel)-.15 E F2<ad4f>6.308 E F3(output_format)A F2<ad52>6.309 E F3
-(west/east/south/north)A F2<ad53>6.309 E F3(speed)A F2<ad54>6.309 E F3
-(time)A(gap)-.4 E F2<ad56>6.309 E<ad5a>108 201.6 Q F3(se)A(gment)-.4 E
-F0(])A F1(DESCRIPTION)72 230.4 Q F2(mbna)108 242.4 Q(vlist)-.25 E F0
-.047(prints the speci\214ed contents of na)2.547 F(vig)-.2 E .047
-(ation records in a sw)-.05 F .046
-(ath sonar data \214le to stdout. By def)-.1 F(ault,)-.1 E F2(mbna)108
-254.4 Q(vlist)-.25 E F0 1.069(produces ASCII \214les in spreadsheet sty\
-le, with data columns separated by tabs. Alternati)3.569 F -.15(ve)-.25
-G(ly).15 E(,)-.65 E .082(other column delimiters can be used \()108
-266.4 R F2<ad47>A F0 .082(option\), or the output can be binary)2.582 F
-2.581(,w)-.65 G .081(ith each \214eld represented as)-2.581 F 2.799(ad)
-108 278.4 S .299(ouble precision \215oat \()-2.799 F F2<ad41>A F0 2.799
-(option\). The)2.799 F .299(output stream can be decimated using the)
-2.799 F F2<ad44>2.8 E F0 .3(option. The output)2.8 F(of)108 290.4 Q F2
-(mbna)2.512 E(vlist)-.25 E F0 .012
-(can be piped to plotting and data analysis programs. The option)2.512 F
-F2<ad4f>2.512 E F3(output_format)A F0 .011(can be used)2.512 F
-(to control the data types that are sent to stdout.)108 302.4 Q .601
-(By def)108 326.4 R(ault,)-.1 E F2(mbna)3.101 E(vlist)-.25 E F0 -.15(ex)
-3.102 G .602(tracts na).15 F(vig)-.2 E .602
-(ation from the data record type listed as the "na)-.05 F(vig)-.2 E .602
-(ation source" for a)-.05 F .76(particular data format. Sw)108 338.4 R
-.76(ath data formats may contain synchronous na)-.1 F(vig)-.2 E .76
-(ation \(na)-.05 F(vig)-.2 E .76(ation is included in)-.05 F(surv)108
-350.4 Q .927 -.15(ey d)-.15 H .627(ata records\), asynchronous na).15 F
-(vig)-.2 E .628(ation \(na)-.05 F(vig)-.2 E .628
-(ation comes in records separate from and at dif)-.05 F(ferent)-.25 E
-.874(times than the surv)108 362.4 R 1.174 -.15(ey d)-.15 H .874
-(ata records\), or both \(surv).15 F 1.174 -.15(ey r)-.15 H .874
-(ecords contain mer).15 F .874(ged na)-.18 F(vig)-.2 E .874
-(ation while the original)-.05 F .221(asynchronous na)108 374.4 R(vig)
--.2 E .221(ation is preserv)-.05 F .221(ed in separate na)-.15 F(vig)-.2
-E .222(ation records\). Some data formats pro)-.05 F .222
-(vide for multi-)-.15 F .678(ple na)108 386.4 R(vig)-.2 E .678(ation so\
-urces, so that there are more than one channel of asynchronous data rec\
-ords. In this case)-.05 F 1.109(one channel is al)108 398.4 R -.1(wa)-.1
-G 1.109(ys designated as the primary or acti).1 F 1.409 -.15(ve n)-.25 H
--.2(av).15 G(ig).2 E 1.11(ation channel. The)-.05 F F2<ad4e>3.61 E F0
-1.11(option allo)3.61 F 1.11(ws the)-.25 F .19(user to specify that)108
-410.4 R F2(mbna)2.69 E(vlist)-.25 E F0 .189(outputs na)2.689 F(vig)-.2 E
-.189(ation from the primary asynchronous na)-.05 F(vig)-.2 E .189
-(ation \()-.05 F F2<ad4e>A F3(0)A F0 2.689(\)o)C 2.689(rf)-2.689 G(rom)
--2.689 E .518(one of three auxiliary na)108 422.4 R(vig)-.2 E .518
-(ation channels \()-.05 F F2<ad4e>A F3(1)A F0(,)A F2<ad4e>3.018 E F3(2)A
-F0 3.018(,o)C(r)-3.018 E F2<ad4e>3.018 E F3(3)A F0 .518
-(\). If the data format only uses asynchronous)B(na)108 434.4 Q(vig)-.2
-E .338(ation, then the def)-.05 F .337(ault na)-.1 F(vig)-.2 E .337
-(ation source will already be the primary asynchronous na)-.05 F(vig)-.2
-E .337(ation and)-.05 F F2<ad4e>2.837 E F0 .533(need not be used. If)108
-446.4 R F2<ad4e>3.033 E F0 .534(is used b)3.033 F .534
-(ut the data \214le does not contain asynchronous na)-.2 F(vig)-.2 E
-.534(ation or the speci\214ed)-.05 F .238(auxiliary na)108 458.4 R(vig)
--.2 E .238(ation channels, then)-.05 F F2(mbna)2.738 E(vlist)-.25 E F0
-.238(will output nothing. T)2.738 F 2.738(od)-.8 G .238
-(etermine if a data\214le contains asyn-)-2.738 F .841(chronous na)108
-470.4 R(vig)-.2 E .841(ation and/or auxiliary na)-.05 F(vig)-.2 E .841
-(ation, run)-.05 F F2(mbinf)3.341 E(o)-.25 E F0 .841(using its)3.341 F
-F2<ad4e>3.341 E F0 .842(option to get counts of all data)3.341 F
-(record types in the \214le.)108 482.4 Q .232(Just to mak)108 506.4 R
-2.732(et)-.1 G .231(hings more complicated, man)-2.732 F 2.731(yd)-.15 G
-.231(ata formats formats pass heading and attitude data in records)
--2.731 F .284(separate from position, and often with dif)108 518.4 R
-.284
-(ferent timestamps and sampling rates. If, for instance, the attitude)
--.25 F 1.001(data are sampled at 10 Hz b)108 530.4 R 1.001
-(ut position is only sampled at 1 Hz, e)-.2 F 1(xtracting roll using)
--.15 F F2(mbna)3.5 E(vlist)-.25 E F0 1(will, by)3.5 F(def)108 542.4 Q
-.272(ault, either output roll v)-.1 F .273
-(alues only at the sonar ping times \(if the na)-.25 F(vig)-.2 E .273
-(ation source is the surv)-.05 F .573 -.15(ey d)-.15 H .273(ata\) or).15
-F .679(at the position record times \(if the na)108 554.4 R(vig)-.2 E
-.678(ation source is the asynchronous position data, b)-.05 F .678
-(ut not at the atti-)-.2 F .863(tude data times. Moreo)108 566.4 R -.15
-(ve)-.15 G 1.663 -.4(r, t).15 H .864(he attitude data will be interpola\
-ted onto the times of sonar pings or position).4 F<8c78>108 578.4 Q
-1.082(es. In order to e)-.15 F 1.082
-(xtract the full attitude data stream, the)-.15 F F2<ad4b>3.582 E F3
-(kind)A F0 1.081(option may be used, where)3.581 F F3(kind)3.581 E F0
-1.081(is the)3.581 F .729
-(identi\214er for the record type to be used as the trigger for output.)
-108 590.4 R(An)5.73 E 3.23(yd)-.15 G .73(esired v)-3.23 F .73
-(alues not contained in the)-.25 F .973(selected record will be interpo\
-lated onto the times of the selected record. In order to identify the r\
-ecords)108 602.4 R -.2(av)108 614.4 S 1.275
-(ailable in a particular data \214le, use)-.05 F F2(mbinf)3.775 E(o)-.25
-E F0 1.275(with the)3.775 F F2<ad4e>3.775 E F0 1.275
-(option. This will sho)3.775 F 3.776(wi)-.25 G 3.776(fad)-3.776 G 1.276
-(ata \214le contains)-3.776 F .479(records of type MB_D)108 626.4 R
--1.21 -1.11(AT A)-.4 H(_A)1.11 E .479(TTITUDE, which has a record type \
-identi\214er of 18, A list of the record type)-1.11 F .217
-(identi\214ers used within)108 638.4 R F2(MB-System)2.717 E F0 .217
-(is gi)2.717 F -.15(ve)-.25 G 2.717(nb).15 G(elo)-2.717 E 1.517 -.65
-(w, a)-.25 H .217(lthough not all of the record types ha).65 F .517 -.15
-(ve t)-.2 H .217(ime stamps or).15 F 1.035(can be used to de\214ne)108
-650.4 R F2(mbna)3.535 E(vlist)-.25 E F0 1.035(output. F)3.535 F 1.035
-(or e)-.15 F 1.035(xample, requesting)-.15 F F2(mbna)3.535 E(vlist)-.25
-E F0 1.035(output associated with com-)3.535 F
-(ment records will yield nonuseful results.)108 662.4 Q F1 -.548(AU)72
-691.2 S(THORSHIP).548 E F0(Da)108 703.2 Q(vid W)-.2 E 2.5(.C)-.92 G
-(aress \(caress at mbari.or)-2.5 E(g\))-.18 E(Montere)113 715.2 Q 2.5(yB)
--.15 G(ay Aquarium Research Institute)-2.5 E
-(Dale N. Chayes \(dale at ldeo.columbia.edu\))108 727.2 Q(MB-System 5.0)72
-768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(1)204.835 E 0 Cg EP
-%%Page: 2 2
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mbna)72 48 Q 148.92(vlist\(1\) MB-System)-.2 F
-148.92(5.0 mbna)2.5 F(vlist\(1\))-.2 E(Lamont-Doherty Earth Observ)113
-84 Q(atory)-.25 E/F1 10.95/Times-Bold at 0 SF(OPTIONS)72 112.8 Q/F2 10
-/Times-Bold at 0 SF<ad41>108 124.8 Q F0 1.035
-(Causes the output to be binary \(nati)144 136.8 R 1.335 -.15(ve d)-.25
-H 1.035(ouble precision \215oating point\) rather than ASCII. Some).15 F
-.032
-(output options cannot be represented as single binary \215oats \(e.g.)
-144 148.8 R .032(time strings and longitude or lati-)5.032 F 1.063
-(tude brok)144 160.8 R 1.063(en into de)-.1 F 1.063
-(grees and minutes. These v)-.15 F 1.064
-(alues are output as multiple \214elds as appropriate.)-.25 F(Def)144
-172.8 Q(ault: ASCII output with \214elds separated by tabs.)-.1 E F2
-<ad42>108 189.6 Q/F3 10/Times-Italic at 0 SF(yr/mo/da/hr/mn/sc)23.63 E F0
-.155(This option sets the starting time for data allo)144 201.6 R .155
-(wed in the input data.)-.25 F(The)5.155 E F2<ad45>2.655 E F0 .155
-(option sets the ending)2.655 F .195
-(time for data. If the starting time is before the ending time, then an)
-144 213.6 R 2.695(yd)-.15 G .196(ata with a time stamp before)-2.695 F
-.444(the starting time or after the ending time is ignored. If instead \
-the starting time is after the ending)144 225.6 R .194(time, then an)144
-237.6 R 2.694(yd)-.15 G .194(ata between the ending and starting time w\
-ill be ignored. This scheme allo)-2.694 F .195(ws time)-.25 F(windo)144
-249.6 Q 5.376(wing both inside and outside a speci\214ed interv)-.25 F
-7.876(al. Def)-.25 F(ault:)-.1 E F3(yr/mo/da/hr/mn/sc)7.876 E F0(=)7.876
-E(1962/2/21/10/30/0.)144 261.6 Q F2<ad44>108 278.4 Q F3(decimate)23.08 E
-F0 .407(Sets the decimation of the output data. By def)144 290.4 R .407
-(ault \(i.e.)-.1 F F3(decimate)2.907 E F0 .408(=1\), e)B -.15(ve)-.25 G
-.408(ry a).15 F -.25(va)-.2 G .408(ilable data record is).25 F
-(output. If)144 302.4 Q F3(decimate)2.5 E F0(>1, then only e)A -.15(ve)
--.25 G(ry ").15 E F3(decimate)A F0("th record will be output. Def)A
-(ault:)-.1 E F3(decimate)2.5 E F0(=1.)A F2<ad45>108 319.2 Q F3
-(yr/mo/da/hr/mn/sc)23.63 E F0 .155
-(This option sets the ending time for data allo)144 331.2 R .155
-(wed in the input data.)-.25 F(The)5.155 E F2<ad42>2.655 E F0 .155
-(option sets the starting)2.655 F .195
-(time for data. If the starting time is before the ending time, then an)
-144 343.2 R 2.695(yd)-.15 G .196(ata with a time stamp before)-2.695 F
-.444(the starting time or after the ending time is ignored. If instead \
-the starting time is after the ending)144 355.2 R .194(time, then an)144
-367.2 R 2.694(yd)-.15 G .194(ata between the ending and starting time w\
-ill be ignored. This scheme allo)-2.694 F .195(ws time)-.25 F(windo)144
-379.2 Q 5.376(wing both inside and outside a speci\214ed interv)-.25 F
-7.876(al. Def)-.25 F(ault:)-.1 E F3(yr/mo/da/hr/mn/sc)7.876 E F0(=)7.876
-E(2062/2/21/10/30/0.)144 391.2 Q F2<ad46>108 408 Q F3(format)24.19 E F0
-.919(Sets the format for the input sw)144 420 R .919
-(ath sonar data using)-.1 F F2(MBIO)3.419 E F0(inte)3.42 E .92
-(ger format identi\214ers.)-.15 F .92(This pro-)5.92 F .502
-(gram uses the)144 432 R F2(MBIO)3.002 E F0 .501
-(library and will read an)3.001 F 3.001(ys)-.15 G -.1(wa)-3.001 G .501
-(th sonar format supported by).1 F F2(MBIO)3.001 E F0 3.001(.Al)C .501
-(ist of)-3.001 F .694(the sw)144 444 R .694
-(ath sonar data formats currently supported by)-.1 F F2(MBIO)3.194 E F0
-.694(and their identi\214er v)3.194 F .694(alues is gi)-.25 F -.15(ve)
--.25 G 3.194(ni).15 G(n)-3.194 E(the)144 456 Q F2(MBIO)2.5 E F0
-(manual page. Def)2.5 E(ault:)-.1 E F3(format)2.5 E F0 2.5(=1)2.5 G(1.)
--2.5 E F2<ad47>108 472.8 Q F3(delimiter)22.52 E F0 .079(Sets the charac\
-ter\(s\) used to separate output \214elds when ascii columns are output\
-. Def)144 484.8 R .078(ault: tabs are)-.1 F(used as delimiters.)144
-496.8 Q F2<ad48>108 513.6 Q F0 .162(This "help" \215ag cause the progra\
-m to print out a description of its operation and then e)22.52 F .162
-(xit immedi-)-.15 F(ately)144 525.6 Q(.)-.65 E F2<ad49>108 542.4 Q F3
-(\214le)26.41 E F0 .313(Sets the input \214lename. If)144 554.4 R F3
-(format)2.813 E F0 2.813(>0\()2.813 G .313(set with the)-2.813 F F2
-<ad46>2.813 E F0 .313(option\) then the sw)2.813 F .312
-(ath sonar data contained)-.1 F(in)144 566.4 Q F3(\214le)2.955 E F0 .455
-(is read and processed. If)2.955 F F3(format)2.956 E F0 2.956(<0)2.956 G
-2.956(,t)-2.956 G(hen)-2.956 E F3(\214le)2.956 E F0 .456
-(is assumed to be an ascii \214le containing a list)2.956 F .87
-(of the input sw)144 578.4 R .869
-(ath sonar data \214les to be processed and their formats.)-.1 F .869
-(The program will read the)5.869 F .663
-(data in each one of these \214les.)144 590.4 R .663(In the)5.663 F F3
-(\214le)3.163 E F0 .664(\214le, each data \214le should be follo)3.163 F
-.664(wed by a data format)-.25 F(identi\214er)144 602.4 Q 2.5(,e)-.4 G
-(.g.:)-2.5 E(data\214le1 11)180 614.4 Q(data\214le2 24)180 626.4 Q .569
-(This program uses the)144 638.4 R F2(MBIO)3.068 E F0 .568
-(library and will read or write an)3.068 F 3.068(ys)-.15 G -.1(wa)-3.068
-G .568(th sonar format supported by).1 F F2(MBIO)144 650.4 Q F0 3.428
-(.Al)C .928(ist of the sw)-3.428 F .928
-(ath sonar data formats currently supported by)-.1 F F2(MBIO)3.428 E F0
-.928(and their identi\214er)3.428 F -.25(va)144 662.4 S(lues is gi).25 E
--.15(ve)-.25 G 2.5(ni).15 G 2.5(nt)-2.5 G(he)-2.5 E F2(MBIO)2.5 E F0
-(manual page.)2.5 E(Def)5 E(ault:)-.1 E F3(\214le)2.5 E F0 2.5(=")2.5 G
-(datalist.mb-1".)-2.5 E F2<ad4b>108 679.2 Q F3(kind)22.52 E F0 .62(This\
- option sets the type of data record used as the trigger for output. By\
- def)144 691.2 R .62(ault, data are output)-.1 F .508
-(when the record type listed as the "na)144 703.2 R(vig)-.2 E .509
-(ation source" for a particular data format is encountered.)-.05 F(The)
-144 715.2 Q F2<ad4b>2.991 E F0 .491(option causes output to be k)2.991 F
--.15(ey)-.1 G .491(ed to data records of type).15 F F3(kind)2.99 E F0
-2.99(,w)C(here)-2.99 E F3(kind)2.99 E F0 .49(may be inte)2.99 F(ger)-.15
-E -.25(va)144 727.2 S(lues such as:).25 E(MB-System 5.0)72 768 Q 2.5(3J)
-146.495 G(une 2013)-2.5 E(2)204.835 E 0 Cg EP
-%%Page: 3 3
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mbna)72 48 Q 148.92(vlist\(1\) MB-System)-.2 F
-148.92(5.0 mbna)2.5 F(vlist\(1\))-.2 E(MB_D)156.5 84 Q -1.21 -1.11(AT A)
--.4 H(_D)1.11 E -1.21 -1.11(AT A)-.4 H 31(1/)92.39 G 2.5(*g)-31 G
-(eneral surv)-2.5 E .3 -.15(ey d)-.15 H(ata */).15 E(MB_D)156.5 96 Q
--1.21 -1.11(AT A)-.4 H(_CALIBRA)1.11 E 59.11(TE 4)-1.11 F
-(/* Hydrosweep DS */)31 E(MB_D)156.5 108 Q -1.21 -1.11(AT A)-.4 H 65.68
-(_MEAN_VELOCITY 5)1.11 F(/* Hydrosweep DS */)31 E(MB_D)156.5 120 Q -1.21
--1.11(AT A)-.4 H(_VELOCITY_PR)1.11 E 18.96(OFILE 6)-.4 F(/* general */)
-31 E(MB_D)156.5 132 Q -1.21 -1.11(AT A)-.4 H(_N)1.11 E 96.85 -1.35(AV 1)
--.35 H 26(2/)1.35 G 2.5(*S)-26 G(imrad, Reson 7k */)-2.5 E(MB_D)156.5
-144 Q -1.21 -1.11(AT A)-.4 H 104.57(_HEADING 17)1.11 F
-(/* Simrad, Hypack */)26 E(MB_D)156.5 156 Q -1.21 -1.11(AT A)-.4 H(_A)
-1.11 E 65.79(TTITUDE 18)-1.11 F(/* Simrad, Hypack, Reson 7k */)26 E
-(MB_D)156.5 168 Q -1.21 -1.11(AT A)-.4 H 95.77(_SSV 19)1.11 F
-(/* Simrad */)26 E(MB_D)156.5 180 Q -1.21 -1.11(AT A)-.4 H(_N)1.11 E
--1.35(AV)-.35 G 91.65(12)1.35 G 26(8/)-91.65 G 2.5(*a)-26 G(ncillary na)
--2.5 E 2.5(vs)-.2 G(ystem 1 */)-2.5 E(MB_D)156.5 192 Q -1.21 -1.11(AT A)
--.4 H(_N)1.11 E -1.35(AV)-.35 G 91.65(22)1.35 G 26(9/)-91.65 G 2.5(*a)
--26 G(ncillary na)-2.5 E 2.5(vs)-.2 G(ystem 2 */)-2.5 E(MB_D)156.5 204 Q
--1.21 -1.11(AT A)-.4 H(_N)1.11 E -1.35(AV)-.35 G 91.65(33)1.35 G 26(0/)
--91.65 G 2.5(*a)-26 G(ncillary na)-2.5 E 2.5(vs)-.2 G(ystem 3 */)-2.5 E
-(MB_D)156.5 216 Q -1.21 -1.11(AT A)-.4 H(_MO)1.11 E 74.52(TION 32)-.4 F
-(/* Reson 7k */)26 E(MB_D)156.5 228 Q -1.21 -1.11(AT A)-.4 H 60.22
-(_SIDESCAN2 37)1.11 F(/* Reson 7k, XTF */)26 E(MB_D)156.5 240 Q -1.21
--1.11(AT A)-.4 H 60.22(_SIDESCAN3 38)1.11 F(/* Reson 7k, XTF */)26 E
-(MB_D)156.5 252 Q -1.21 -1.11(AT A)-.4 H(_R)1.11 E 88.4(OLL 40)-.4 F
-(/* Reson 7k */)26 E(MB_D)156.5 264 Q -1.21 -1.11(AT A)-.4 H 85.22
-(_PITCH 41)1.11 F(/* Reson 7k */)26 E(MB_D)156.5 276 Q -1.21 -1.11(AT A)
--.4 H 57.44(_NMEA_RMC 48)1.11 F(/* NMEA */)26 E(MB_D)156.5 288 Q -1.21
--1.11(AT A)-.4 H 59.67(_NMEA_DBT 49)1.11 F(/* NMEA */)26 E(MB_D)156.5
-300 Q -1.21 -1.11(AT A)-.4 H 60.78(_NMEA_DPT 50)1.11 F(/* NMEA */)26 E
-(MB_D)156.5 312 Q -1.21 -1.11(AT A)-.4 H(_NMEA_ZD)1.11 E 62.02(A5)-.4 G
-26(1/)-62.02 G 2.5(*N)-26 G(MEA */)-2.5 E(MB_D)156.5 324 Q -1.21 -1.11
-(AT A)-.4 H 60.23(_NMEA_GLL 52)1.11 F(/* NMEA */)26 E(MB_D)156.5 336 Q
--1.21 -1.11(AT A)-.4 H 58.01(_NMEA_GGA 53)1.11 F(/* NMEA */)26 E(MB_D)
-156.5 348 Q -1.21 -1.11(AT A)-.4 H(_A)1.11 E 60.79(TTITUDE1 55)-1.11 F
-(/* ancillary attitude system 1 */)26 E(MB_D)156.5 360 Q -1.21 -1.11
-(AT A)-.4 H(_A)1.11 E 60.79(TTITUDE2 56)-1.11 F
-(/* ancillary attitude system 2 */)15 E(MB_D)156.5 372 Q -1.21 -1.11
-(AT A)-.4 H(_A)1.11 E 60.79(TTITUDE3 57)-1.11 F
-(/* ancillary attitude system 3 */)26 E -.15(Fo)144 384 S 2.693(re).15 G
-.193(xample, using)-2.843 F/F1 10/Times-Bold at 0 SF<ad4b>2.693 E/F2 10
-/Times-Italic at 0 SF(18)A F0 .194(will cause)2.693 F F1(mbna)2.694 E
-(vlist)-.25 E F0 .194
-(to output at the times of attitude data records. One)2.694 F .408
-(consequence will be that an)144 396 R 2.908(yr)-.15 G .408
-(oll, pitch, or hea)-2.908 F .708 -.15(ve v)-.2 H .408
-(alues speci\214ed with the)-.1 F F1<ad4f>2.907 E F0 .407
-(option will be out-)2.907 F .27
-(put without modi\214cation, whereas other v)144 408 R .27
-(alues \(e.g. position\) will be interpolated onto the time of)-.25 F
-(the attitude record.)144 420 Q(This option supercedes the)5 E F1<ad4e>
-2.5 E F0(option.)2.5 E F1<ad4c>108 436.8 Q F2(lon\215ip)23.63 E F0 .572
-(Sets the range of the longitude v)144 448.8 R .572(alues returned.)-.25
-F(If)5.572 E F2(lon\215ip)3.072 E F0 .572(=\2551 then the longitude v)B
-.571(alues will be in)-.25 F .488(the range from \255360 to 0 de)144
-460.8 R .488(grees. If)-.15 F F2(lon\215ip)2.988 E F0 .488
-(=0 then the longitude v)B .489(alues will be in the range from)-.25 F
-1.383(\255180 to 180 de)144 472.8 R 1.383(grees. If)-.15 F F2(lon\215ip)
-3.882 E F0 1.382(=1 then the longitude v)B 1.382
-(alues will be in the range from 0 to 360)-.25 F(de)144 484.8 Q 2.5
-(grees. Def)-.15 F(ault:)-.1 E F2(lon\215ip)2.5 E F0 2.5(=0)2.5 G(.)-2.5
-E F1<ad4e>108 501.6 Q F2(navc)23.08 E(hannel)-.15 E F0(Sets)144 513.6 Q
-F1(mbna)2.577 E(vlist)-.25 E F0 .077(to look for na)2.577 F(vig)-.2 E
-.077(ation in na)-.05 F(vig)-.2 E .078
-(ation records rather than the record type listed as the)-.05 F("na)144
-525.6 Q(vig)-.2 E .011(ation source" for a particular data format. Sw)
--.05 F .011(ath data formats may contain synchronous na)-.1 F(v-)-.2 E
-(ig)144 537.6 Q .044(ation \(na)-.05 F(vig)-.2 E .044
-(ation is included in surv)-.05 F .345 -.15(ey d)-.15 H .045
-(ata records\), asynchronous na).15 F(vig)-.2 E .045(ation \(na)-.05 F
-(vig)-.2 E .045(ation comes)-.05 F 1.871
-(in records separate from and at dif)144 549.6 R 1.871
-(ferent times than the surv)-.25 F 2.17 -.15(ey d)-.15 H 1.87
-(ata records\), or both \(surv).15 F -.15(ey)-.15 G .25
-(records contain mer)144 561.6 R .251(ged na)-.18 F(vig)-.2 E .251
-(ation while the original asynchronous na)-.05 F(vig)-.2 E .251
-(ation is preserv)-.05 F .251(ed in sep-)-.15 F .24(arate na)144 573.6 R
-(vig)-.2 E .239(ation records\). Some data formats pro)-.05 F .239
-(vide for multiple na)-.15 F(vig)-.2 E .239
-(ation sources, so that there)-.05 F .272(are more than one channel of \
-asynchronous data records. In this case one channel is al)144 585.6 R
--.1(wa)-.1 G .273(ys desig-).1 F .895(nated as the primary or acti)144
-597.6 R 1.195 -.15(ve n)-.25 H -.2(av).15 G(ig).2 E .895
-(ation channel. The)-.05 F F1<ad4e>3.395 E F0 .895(option allo)3.395 F
-.895(ws the user to specify that)-.25 F F1(mbna)144 609.6 Q(vlist)-.25 E
-F0 1.433(outputs na)3.933 F(vig)-.2 E 1.433
-(ation from the primary asynchronous na)-.05 F(vig)-.2 E 1.433(ation \()
--.05 F F1<ad4e>A F2(0)A F0 3.934(\)o)C 3.934(rf)-3.934 G 1.434
-(rom one of)-3.934 F .872(three auxiliary na)144 621.6 R(vig)-.2 E .872
-(ation channels \()-.05 F F1<ad4e>A F2(1)A F0(,)A F1<ad4e>3.372 E F2(2)A
-F0 3.372(,o)C(r)-3.372 E F1<ad4e>3.372 E F2(3)A F0 .872(\). If)B F1
-<ad4e>3.372 E F0 .872(is used b)3.372 F .871
-(ut the data \214le does not)-.2 F 1.429(contain asynchronous na)144
-633.6 R(vig)-.2 E 1.429(ation or the speci\214ed auxiliary na)-.05 F
-(vig)-.2 E 1.429(ation channels, then)-.05 F F1(mbna)3.929 E(vlist)-.25
-E F0 .845(will output nothing. T)144 645.6 R 3.345(od)-.8 G .845
-(etermine if a data\214le contains asynchronous na)-3.345 F(vig)-.2 E
-.845(ation and/or auxiliary)-.05 F(na)144 657.6 Q(vig)-.2 E .693
-(ation, run)-.05 F F1(mbinf)3.193 E(o)-.25 E F0 .693(using its)3.193 F
-F1<ad4e>3.193 E F0 .693
-(option to get counts of all data record types in the \214le. This)3.193
-F(option is superceded by the)144 669.6 Q F1<ad4b>2.5 E F0(option.)2.5 E
-F1<ad4f>108 686.4 Q F2(output_format)22.52 E F0 .389
-(Determines the form of the output.)144 698.4 R F2(Output_format)2.888 E
-F0 .388(is a string composed of one or more of the fol-)2.888 F(lo)144
-710.4 Q(wing characters:)-.25 E(MB-System 5.0)72 768 Q 2.5(3J)146.495 G
-(une 2013)-2.5 E(3)204.835 E 0 Cg EP
-%%Page: 4 4
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mbna)72 48 Q 148.92(vlist\(1\) MB-System)-.2 F
-148.92(5.0 mbna)2.5 F(vlist\(1\))-.2 E/F1 10/Times-Bold at 0 SF(c)180 84 Q
-F0(for sonar depth \(meters\))5 E F1(H)180 96 Q F0(for heading \(de)5 E
-(grees\))-.15 E F1(h)180 108 Q F0(for course made good \(de)5 E(grees\))
--.15 E F1(J)180 120 Q F0(for a time string \(yyyy jd hh mm ss.ssssss\))5
-E(where jd is the julian day of the year)186.5 132 Q F1(j)180 144 Q F0
-(for a time string \(yyyy jd dm ss.ssssss\))5 E
-(where jd is the julian day of the year)186.5 156 Q
-(and dm is the minute of the day)186.5 168 Q F1(L)180 180 Q F0
-(for cumulati)5 E .3 -.15(ve a)-.25 H(long-track distance \(km\)).15 E
-F1(l)180 192 Q F0(for cumulati)5 E .3 -.15(ve a)-.25 H
-(long-track distance \(m\)).15 E F1(M)180 204 Q F0
-(for unix time in decimal seconds since 1/1/70 00:00:00)5 E F1(m)180 216
-Q F0(for time in decimal seconds since \214rst record)5 E F1(N)180 228 Q
-F0(for ping count)5 E F1(P)180 240 Q F0(for pitch in de)5 E(grees)-.15 E
-F1(p)180 252 Q F0(for draft in meters)5 E F1(R)180 264 Q F0
-(for roll in de)5 E(grees)-.15 E F1(r)180 276 Q F0(for hea)5 E .3 -.15
-(ve i)-.2 H 2.5(nm).15 G(eters)-2.5 E F1(S)180 288 Q F0
-(for speed \(km/hr\))5 E F1(s)180 300 Q F0
-(for speed made good \(km/hr\))5 E F1(T)180 312 Q F0
-(for a time string \(yyyy/mm/dd/hh/mm/ss\))5 E F1(t)180 324 Q F0
-(for a time string \(yyyy mm dd hh mm ss\))5 E F1(U)180 336 Q F0
-(for unix time in inte)5 E(ger seconds since 1/1/70 00:00:00)-.15 E F1
-(u)180 348 Q F0(for time in inte)5 E(ger seconds since \214rst record)
--.15 E F1(V)180 360 Q F0(for ping interv)5 E(al \(decimal seconds\))-.25
-E F1(X)180 372 Q F0(for longitude \(decimal de)5 E(grees\))-.15 E F1(x)
-180 384 Q F0(for longitude \(de)5 E(grees + decimal minutes + E/W\))-.15
-E F1(Y)180 396 Q F0(for latitude \(decimal de)5 E(grees\))-.15 E F1(y)
-180 408 Q F0(for latitude \(de)5 E(grees + decimal minutes + N/S\))-.15
-E(Def)144 432 Q(ault)-.1 E/F2 10/Times-Italic at 0 SF(output_format)2.5 E
-F0(=)2.5 E F1(tMXYHs)2.5 E F0
-(\(time, unix time, latitude, longitude, heading, speed\).)2.5 E F1
-<ad52>108 448.8 Q F2(west/east/south/north)23.08 E F0 .678
-(Sets the longitude and latitude bounds within which sw)144 460.8 R .679
-(ath sonar data will be read. Only the data)-.1 F .098
-(which lies within these bounds will be read.)144 472.8 R(Def)5.097 E
-(ault:)-.1 E F2(west)2.597 E F0 .097(=\255360, east)B F2(=360)A F0(,)A
-F2(south)2.597 E F0(=\25590,)A F2(north)2.597 E F0(=90.)A F1<ad53>108
-489.6 Q F2(speed)24.74 E F0 .532
-(Sets the minimum speed in km/hr \(5.5 kts ~ 10 km/hr\) allo)144 501.6 R
-.532(wed in the input data; pings associated)-.25 F
-(with a smaller ship speed will not be copied. Def)144 513.6 Q(ault:)-.1
-E F2(speed)2.5 E F0 2.5(=0)2.5 G(.)-2.5 E F1<ad54>108 530.4 Q F2(time)
-23.63 E(gap)-.4 E F0 .479(Sets the maximum time g)144 542.4 R .479
-(ap in minutes between adjacent pings allo)-.05 F .478
-(wed before the data is consid-)-.25 F(ered to ha)144 554.4 Q .3 -.15
-(ve a g)-.2 H(ap. Def).1 E(ault:)-.1 E F2(time)2.5 E(gap)-.4 E F0 2.5
-(=1)2.5 G(.)-2.5 E F1<ad56>108 571.2 Q F0(Normally)23.08 E(,)-.65 E F1
-(mbna)3.01 E(vlist)-.25 E F0 -.1(wo)3.01 G .51
-(rks "silently" without outputting an).1 F .51
-(ything to the stderr stream.)-.15 F .51(If the)5.51 F F1<ad56>3.01 E F0
-.928(\215ag is gi)144 583.2 R -.15(ve)-.25 G .928(n, then).15 F F1(mbna)
-3.428 E(vlist)-.25 E F0 -.1(wo)3.428 G .928(rks in a "v).1 F .928
-(erbose" mode and outputs the program v)-.15 F .928(ersion being)-.15 F
-(used and all error status messages.)144 595.2 Q F1<ad5a>108 612 Q F2
-(se)23.63 E(gment)-.4 E F0 .677(Causes the ascii output of dif)144 624 R
-.677(ferent input sw)-.25 F .678
-(ath \214les \(e.g. when a datalist is speci\214ed with the)-.1 F F1
-<ad49>3.178 E F0 .373(option\) to be separated by lines with)144 636 R
-F2(se)2.873 E(gment)-.4 E F0 2.873(.I)C(f)-2.873 E F2(se)2.873 E(gment)
--.4 E F0 .373(is a single character)2.873 F 2.873(,t)-.4 G .372
-(hen the output is a)-2.873 F 1.251(multiple se)144 648 R 1.251
-(gment \214le of the sort accepted by the)-.15 F F1(GMT)3.751 E F0
-(program)3.751 E F1(psxy)3.752 E F0 6.252(.T)C 1.252(his option only w)
--6.252 F(orks)-.1 E .1(with ascii output, and is thus disabled when the)
-144 660 R F1<ad41>2.6 E F0 .1
-(option is speci\214ed. The most common usage is)2.6 F F1<ad5a>144 672 Q
-F0(I>)A F1(.)A/F3 10.95/Times-Bold at 0 SF(EXAMPLES)72 700.8 Q F0 1.837
-(Suppose one wishes to obtain a na)108 712.8 R(vig)-.2 E 1.837
-(ation list from a Simrad EM300 data \214le in the MB)-.05 F 1.838
-(ARI format)-.35 F 1.987
-(\(MBIO id 57\) called mbari_1998_107_msn.mb57. T)108 724.8 R 4.487(oo)
--.8 G 1.986(btain a listing with time in unix second forms)-4.487 F
-(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(4)204.835 E 0
-Cg EP
-%%Page: 5 5
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mbna)72 48 Q 148.92(vlist\(1\) MB-System)-.2 F
-148.92(5.0 mbna)2.5 F(vlist\(1\))-.2 E(follo)108 84 Q
-(wed by longitude and latitude, the follo)-.25 E(wing will suf)-.25 E
-(\214ce:)-.25 E(mbna)144 108 Q
-(vlist \255F57 \255i mbari_1998_107_msn.mb57 \255OMXY | more)-.2 E
-(The output will be as follo)108 132 Q(ws:)-.25 E 17.5
-(889125106.792000 \255155.898471)144 156 R(19.979325)17.5 E 17.5
-(889125108.148000 \255155.898586)144 168 R(19.979400)17.5 E 17.5
-(889125109.496000 \255155.898738)144 180 R(19.979454)17.5 E 17.5
-(889125110.852000 \255155.898876)144 192 R(19.979504)17.5 E 17.5
-(889125112.207000 \255155.899020)144 204 R(19.979544)17.5 E 17.5
-(889125113.571000 \255155.899204)144 216 R(19.979591)17.5 E 17.5
-(889125114.921000 \255155.899479)144 228 R(19.979485)17.5 E(.....)144
-240 Q/F1 10.95/Times-Bold at 0 SF(MB-SYSTEM D)72 256.8 Q -1.644 -1.04(AT A)
--.383 H(RECORD TYPES)3.778 E F0 .794(This list gi)108 268.8 R -.15(ve)
--.25 G 3.294(st).15 G .794
-(he data record types and numerical identi\214ers used within)-3.294 F
-/F2 10/Times-Bold at 0 SF(MB-System)3.294 E F0 3.294(.U)C .794
-(sers can specify)-3.294 F(that)108 280.8 Q F2(mbna)3.376 E(vlist)-.25 E
-F0 .876(output be k)3.376 F -.15(ey)-.1 G .875
-(ed to the time stamps of particular record types by using the).15 F F2
-<ad4b>3.375 E/F3 10/Times-Italic at 0 SF(kind)A F0(option)3.375 E(where)108
-292.8 Q F3(kind)2.5 E F0
-(corresponds to the desired record type identi\214er from this table.)
-2.5 E(MB_D)120.5 316.8 Q -1.21 -1.11(AT A)-.4 H 83.56(_KINDS 54)1.11 F
-(MB_D)120.5 328.8 Q -1.21 -1.11(AT A)-.4 H 86.34(_NONE 0)1.11 F(MB_D)
-120.5 340.8 Q -1.21 -1.11(AT A)-.4 H(_D)1.11 E -1.21 -1.11(AT A)-.4 H 31
-(1g)92.39 G(eneral surv)-31 E .3 -.15(ey d)-.15 H(ata).15 E(MB_D)120.5
-352.8 Q -1.21 -1.11(AT A)-.4 H 99(_COMMENT 2)1.11 F(general comment)31 E
-(MB_D)120.5 364.8 Q -1.21 -1.11(AT A)-.4 H 73.56(_HEADER 3)1.11 F
-(general header)31 E(MB_D)120.5 376.8 Q -1.21 -1.11(AT A)-.4 H(_CALIBRA)
-1.11 E 59.11(TE 4)-1.11 F(Hydrosweep DS)31 E(MB_D)120.5 388.8 Q -1.21
--1.11(AT A)-.4 H 65.68(_MEAN_VELOCITY 5)1.11 F(Hydrosweep DS)31 E(MB_D)
-120.5 400.8 Q -1.21 -1.11(AT A)-.4 H(_VELOCITY_PR)1.11 E 18.96(OFILE 6)
--.4 F(general)31 E(MB_D)120.5 412.8 Q -1.21 -1.11(AT A)-.4 H(_ST)1.11 E
-103.82(ANDBY 7)-.93 F(Hydrosweep DS)31 E(MB_D)120.5 424.8 Q -1.21 -1.11
-(AT A)-.4 H(_N)1.11 E -1.35(AV)-.35 G 49.7(_SOURCE 8)1.35 F
-(Hydrosweep DS)31 E(MB_D)120.5 436.8 Q -1.21 -1.11(AT A)-.4 H(_P)1.11 E
-54.47(ARAMETER 9)-.92 F(general)31 E(MB_D)120.5 448.8 Q -1.21 -1.11
-(AT A)-.4 H(_ST)1.11 E(AR)-.93 E 86.47(T1)-.6 G 26(0S)-86.47 G(imrad)-26
-E(MB_D)120.5 460.8 Q -1.21 -1.11(AT A)-.4 H(_ST)1.11 E 89.84(OP 11)-.18
-F(Simrad)26 E(MB_D)120.5 472.8 Q -1.21 -1.11(AT A)-.4 H(_N)1.11 E 96.85
--1.35(AV 1)-.35 H 26(2S)1.35 G(imrad, Reson 7k)-26 E(MB_D)120.5 484.8 Q
--1.21 -1.11(AT A)-.4 H(_R)1.11 E(UN_P)-.4 E 64.76(ARAMETER 13)-.92 F
-(Simrad)26 E(MB_D)120.5 496.8 Q -1.21 -1.11(AT A)-.4 H 80.22(_CLOCK 14)
-1.11 F(Simrad)26 E(MB_D)120.5 508.8 Q -1.21 -1.11(AT A)-.4 H 91.34
-(_TIDE 15)1.11 F(Simrad, Reson 7k)26 E(MB_D)120.5 520.8 Q -1.21 -1.11
-(AT A)-.4 H 76.9(_HEIGHT 16)1.11 F(Simrad)26 E(MB_D)120.5 532.8 Q -1.21
--1.11(AT A)-.4 H 104.57(_HEADING 17)1.11 F(Simrad, Hypack)26 E(MB_D)
-120.5 544.8 Q -1.21 -1.11(AT A)-.4 H(_A)1.11 E 65.79(TTITUDE 18)-1.11 F
-(Simrad, Hypack, Reson 7k)26 E(MB_D)120.5 556.8 Q -1.21 -1.11(AT A)-.4 H
-95.77(_SSV 19)1.11 F(Simrad)26 E(MB_D)120.5 568.8 Q -1.21 -1.11(AT A)-.4
-H 80.23(_ANGLE 20)1.11 F(HSMD)26 E(MB_D)120.5 580.8 Q -1.21 -1.11(AT A)
--.4 H 81.34(_EVENT 21)1.11 F(HSMD)26 E(MB_D)120.5 592.8 Q -1.21 -1.11
-(AT A)-.4 H(_HIST)1.11 E(OR)-.18 E 74.11(Y2)-.65 G 26(2G)-74.11 G(SF)-26
-E(MB_D)120.5 604.8 Q -1.21 -1.11(AT A)-.4 H(_SUMMAR)1.11 E 101.59(Y2)
--.65 G 26(3G)-101.59 G(SF)-26 E(MB_D)120.5 616.8 Q -1.21 -1.11(AT A)-.4
-H(_PR)1.11 E(OCESSING_P)-.4 E 19.19(ARAMETERS 24)-.92 F(GSF)26 E(MB_D)
-120.5 628.8 Q -1.21 -1.11(AT A)-.4 H(_SENSOR_P)1.11 E 5.57(ARAMETERS 25)
--.92 F(GSF)26 E(MB_D)120.5 640.8 Q -1.21 -1.11(AT A)-.4 H(_N)1.11 E
--1.35(AV)-.35 G(IGA)1.35 E(TION_ERR)-1.11 E 15.67(OR 26)-.4 F(GSF)26 E
-(MB_D)120.5 652.8 Q -1.21 -1.11(AT A)-.4 H(_RA)1.11 E 63.91(W_LINE 27)
--.9 F(uninterpretable line for ascii formats)26 E(MB_D)120.5 664.8 Q
--1.21 -1.11(AT A)-.4 H(_N)1.11 E -1.35(AV)-.35 G 91.65(12)1.35 G 26(8a)
--91.65 G(ncillary na)-26 E 2.5(vs)-.2 G(ystem 1)-2.5 E(MB_D)120.5 676.8
-Q -1.21 -1.11(AT A)-.4 H(_N)1.11 E -1.35(AV)-.35 G 91.65(22)1.35 G 26
-(9a)-91.65 G(ncillary na)-26 E 2.5(vs)-.2 G(ystem 2)-2.5 E(MB_D)120.5
-688.8 Q -1.21 -1.11(AT A)-.4 H(_N)1.11 E -1.35(AV)-.35 G 91.65(33)1.35 G
-26(0a)-91.65 G(ncillary na)-26 E 2.5(vs)-.2 G(ystem 3)-2.5 E(MB_D)120.5
-700.8 Q -1.21 -1.11(AT A)-.4 H(_TIL)1.11 E 95.87(T3)-.92 G 26(1S)-95.87
-G(imrad)-26 E(MB_D)120.5 712.8 Q -1.21 -1.11(AT A)-.4 H(_MO)1.11 E 74.52
-(TION 32)-.4 F(Reson 7k)26 E(MB_D)120.5 724.8 Q -1.21 -1.11(AT A)-.4 H
-94.11(_CTD 33)1.11 F(Reson 7k)26 E(MB-System 5.0)72 768 Q 2.5(3J)146.495
-G(une 2013)-2.5 E(5)204.835 E 0 Cg EP
-%%Page: 6 6
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mbna)72 48 Q 148.92(vlist\(1\) MB-System)-.2 F
-148.92(5.0 mbna)2.5 F(vlist\(1\))-.2 E(MB_D)120.5 84 Q -1.21 -1.11(AT A)
--.4 H(_SUBBO)1.11 E(TT)-.4 E 62.9(OM_MCS 34)-.18 F(Reson 7k)26 E(MB_D)
-120.5 96 Q -1.21 -1.11(AT A)-.4 H(_SUBBO)1.11 E(TT)-.4 E 28.46
-(OM_CNTRBEAM 35)-.18 F(Simrad)26 E(MB_D)120.5 108 Q -1.21 -1.11(AT A)-.4
-H(_SUBBO)1.11 E(TT)-.4 E(OM_SUBBO)-.18 E(TT)-.4 E 22.93(OM 36)-.18 F
-(Reson 7k, XTF)26 E(MB_D)120.5 120 Q -1.21 -1.11(AT A)-.4 H 60.22
-(_SIDESCAN2 37)1.11 F(Reson 7k, XTF)26 E(MB_D)120.5 132 Q -1.21 -1.11
-(AT A)-.4 H 60.22(_SIDESCAN3 38)1.11 F(Reson 7k, XTF)26 E(MB_D)120.5 144
-Q -1.21 -1.11(AT A)-.4 H(_IMA)1.11 E 81.74(GE 39)-.4 F(Reson 7k)26 E
-(MB_D)120.5 156 Q -1.21 -1.11(AT A)-.4 H(_R)1.11 E 88.4(OLL 40)-.4 F
-(Reson 7k)26 E(MB_D)120.5 168 Q -1.21 -1.11(AT A)-.4 H 85.22(_PITCH 41)
-1.11 F(Reson 7k)26 E(MB_D)120.5 180 Q -1.21 -1.11(AT A)-.4 H 62.88
-(_ABSORPTIONLOSS 42)1.11 F(Reson 7k)26 E(MB_D)120.5 192 Q -1.21 -1.11
-(AT A)-.4 H 33.55(_SPREADINGLOSS 43)1.11 F(Reson 7k)26 E(MB_D)120.5 204
-Q -1.21 -1.11(AT A)-.4 H(_INST)1.11 E(ALLA)-.93 E 43.39(TION 44)-1.11 F
-(Reson 7k)26 E(MB_D)120.5 216 Q -1.21 -1.11(AT A)-.4 H(_W)1.11 E -1.11
-(AT)-1.2 G 68.54(ER_COLUMN 45)1.11 F(Simrad)26 E(MB_D)120.5 228 Q -1.21
--1.11(AT A)-.4 H(_ST)1.11 E -1.11(AT)-.93 G 78.37(US 46)1.11 F
-(Simrad, XTF)26 E(MB_D)120.5 240 Q -1.21 -1.11(AT A)-.4 H(_D)1.11 E
-93.96(VL 47)-.4 F(JST)26 E(AR)-.93 E(MB_D)120.5 252 Q -1.21 -1.11(AT A)
--.4 H 57.44(_NMEA_RMC 48)1.11 F(NMEA)26 E(MB_D)120.5 264 Q -1.21 -1.11
-(AT A)-.4 H 59.67(_NMEA_DBT 49)1.11 F(NMEA)26 E(MB_D)120.5 276 Q -1.21
--1.11(AT A)-.4 H 60.78(_NMEA_DPT 50)1.11 F(NMEA)26 E(MB_D)120.5 288 Q
--1.21 -1.11(AT A)-.4 H(_NMEA_ZD)1.11 E 62.02(A5)-.4 G 26(1N)-62.02 G
-(MEA)-26 E(MB_D)120.5 300 Q -1.21 -1.11(AT A)-.4 H 60.23(_NMEA_GLL 52)
-1.11 F(NMEA)26 E(MB_D)120.5 312 Q -1.21 -1.11(AT A)-.4 H 58.01
-(_NMEA_GGA 53)1.11 F(NMEA)26 E(MB_D)120.5 324 Q -1.21 -1.11(AT A)-.4 H
-(_SUR)1.11 E 47.14(VEY_LINE 54)-.8 F(Reson 7k)26 E(MB_D)120.5 336 Q
--1.21 -1.11(AT A)-.4 H(_A)1.11 E 60.79(TTITUDE1 55)-1.11 F
-(ancillary attitude system 1)26 E(MB_D)120.5 348 Q -1.21 -1.11(AT A)-.4
-H(_A)1.11 E 60.79(TTITUDE2 56)-1.11 F(ancillary attitude system 2)15 E
-(MB_D)120.5 360 Q -1.21 -1.11(AT A)-.4 H(_A)1.11 E 60.79(TTITUDE3 57)
--1.11 F(ancillary attitude system 3)26 E/F1 10.95/Times-Bold at 0 SF
-(SEE ALSO)72 388.8 Q/F2 10/Times-Bold at 0 SF(mbsystem)108 400.8 Q F0
-(\(1\),)A F2(mbinf)2.5 E(o)-.25 E F0(\(1\))A F1 -.11(BU)72 429.6 S(GS)
-.11 E F2(mbna)108 441.6 Q(vlist)-.25 E F0
-(is not able to list all of the na)2.5 E(vig)-.2 E(ation information a)
--.05 E -.25(va)-.2 G(ilable in some sw).25 E(ath data formats.)-.1 E
-(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(6)204.835 E 0
-Cg EP
-%%Trailer
-end
-%%EOF
diff --git a/src/ps/mbneptune2esf.ps b/src/ps/mbneptune2esf.ps
deleted file mode 100644
index 6fb29f5..0000000
--- a/src/ps/mbneptune2esf.ps
+++ /dev/null
@@ -1,452 +0,0 @@
-%!PS-Adobe-3.0
-%%Creator: groff version 1.19.2
-%%CreationDate: Wed Jul  1 12:29:30 2015
-%%DocumentNeededResources: font Times-Roman
-%%+ font Times-Bold
-%%+ font Times-Italic
-%%DocumentSuppliedResources: procset grops 1.19 2
-%%Pages: 3
-%%PageOrder: Ascend
-%%DocumentMedia: Default 612 792 0 () ()
-%%Orientation: Portrait
-%%EndComments
-%%BeginDefaults
-%%PageMedia: Default
-%%EndDefaults
-%%BeginProlog
-%%BeginResource: procset grops 1.19 2
-%!PS-Adobe-3.0 Resource-ProcSet
-/setpacking where{
-pop
-currentpacking
-true setpacking
-}if
-/grops 120 dict dup begin
-/SC 32 def
-/A/show load def
-/B{0 SC 3 -1 roll widthshow}bind def
-/C{0 exch ashow}bind def
-/D{0 exch 0 SC 5 2 roll awidthshow}bind def
-/E{0 rmoveto show}bind def
-/F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def
-/G{0 rmoveto 0 exch ashow}bind def
-/H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/I{0 exch rmoveto show}bind def
-/J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def
-/K{0 exch rmoveto 0 exch ashow}bind def
-/L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/M{rmoveto show}bind def
-/N{rmoveto 0 SC 3 -1 roll widthshow}bind def
-/O{rmoveto 0 exch ashow}bind def
-/P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/Q{moveto show}bind def
-/R{moveto 0 SC 3 -1 roll widthshow}bind def
-/S{moveto 0 exch ashow}bind def
-/T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/SF{
-findfont exch
-[exch dup 0 exch 0 exch neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/MF{
-findfont
-[5 2 roll
-0 3 1 roll
-neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/level0 0 def
-/RES 0 def
-/PL 0 def
-/LS 0 def
-/MANUAL{
-statusdict begin/manualfeed true store end
-}bind def
-/PLG{
-gsave newpath clippath pathbbox grestore
-exch pop add exch pop
-}bind def
-/BP{
-/level0 save def
-1 setlinecap
-1 setlinejoin
-72 RES div dup scale
-LS{
-90 rotate
-}{
-0 PL translate
-}ifelse
-1 -1 scale
-}bind def
-/EP{
-level0 restore
-showpage
-}def
-/DA{
-newpath arcn stroke
-}bind def
-/SN{
-transform
-.25 sub exch .25 sub exch
-round .25 add exch round .25 add exch
-itransform
-}bind def
-/DL{
-SN
-moveto
-SN
-lineto stroke
-}bind def
-/DC{
-newpath 0 360 arc closepath
-}bind def
-/TM matrix def
-/DE{
-TM currentmatrix pop
-translate scale newpath 0 0 .5 0 360 arc closepath
-TM setmatrix
-}bind def
-/RC/rcurveto load def
-/RL/rlineto load def
-/ST/stroke load def
-/MT/moveto load def
-/CL/closepath load def
-/Fr{
-setrgbcolor fill
-}bind def
-/setcmykcolor where{
-pop
-/Fk{
-setcmykcolor fill
-}bind def
-}if
-/Fg{
-setgray fill
-}bind def
-/FL/fill load def
-/LW/setlinewidth load def
-/Cr/setrgbcolor load def
-/setcmykcolor where{
-pop
-/Ck/setcmykcolor load def
-}if
-/Cg/setgray load def
-/RE{
-findfont
-dup maxlength 1 index/FontName known not{1 add}if dict begin
-{
-1 index/FID ne{def}{pop pop}ifelse
-}forall
-/Encoding exch def
-dup/FontName exch def
-currentdict end definefont pop
-}bind def
-/DEFS 0 def
-/EBEGIN{
-moveto
-DEFS begin
-}bind def
-/EEND/end load def
-/CNT 0 def
-/level1 0 def
-/PBEGIN{
-/level1 save def
-translate
-div 3 1 roll div exch scale
-neg exch neg exch translate
-0 setgray
-0 setlinecap
-1 setlinewidth
-0 setlinejoin
-10 setmiterlimit
-[]0 setdash
-/setstrokeadjust where{
-pop
-false setstrokeadjust
-}if
-/setoverprint where{
-pop
-false setoverprint
-}if
-newpath
-/CNT countdictstack def
-userdict begin
-/showpage{}def
-/setpagedevice{}def
-}bind def
-/PEND{
-countdictstack CNT sub{end}repeat
-level1 restore
-}bind def
-end def
-/setpacking where{
-pop
-setpacking
-}if
-%%EndResource
-%%EndProlog
-%%BeginSetup
-%%BeginFeature: *PageSize Default
-<< /PageSize [ 612 792 ] /ImagingBBox null >> setpagedevice
-%%EndFeature
-%%IncludeResource: font Times-Roman
-%%IncludeResource: font Times-Bold
-%%IncludeResource: font Times-Italic
-grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72
-def/PL 792 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron/Zcaron
-/scaron/zcaron/Ydieresis/trademark/quotesingle/Euro/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/space/exclam/quotedbl/numbersign/dollar/percent
-/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen
-/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon
-/semicolon/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O
-/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright/circumflex
-/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y
-/z/braceleft/bar/braceright/tilde/.notdef/quotesinglbase/guillemotleft
-/guillemotright/bullet/florin/fraction/perthousand/dagger/daggerdbl
-/endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut
-/dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash
-/quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen
-/brokenbar/section/dieresis/copyright/ordfeminine/guilsinglleft
-/logicalnot/minus/registered/macron/degree/plusminus/twosuperior
-/threesuperior/acute/mu/paragraph/periodcentered/cedilla/onesuperior
-/ordmasculine/guilsinglright/onequarter/onehalf/threequarters
-/questiondown/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE
-/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex
-/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis
-/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn
-/germandbls/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla
-/egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis
-/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide/oslash
-/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis]def
-/Times-Italic at 0 ENC0/Times-Italic RE/Times-Bold at 0 ENC0/Times-Bold RE
-/Times-Roman at 0 ENC0/Times-Roman RE
-%%EndSetup
-%%Page: 1 1
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 127.07(mbneptune2esf\(1\) MB-System)72 48 R
-127.07(5.0 mbneptune2esf\(1\))2.5 F/F1 10.95/Times-Bold at 0 SF -.219(NA)72
-84 S(ME).219 E/F2 10/Times-Bold at 0 SF(mbneptune2esf)108 96 Q F0 2.5<ad54>
-2.5 G(ool to import beam \215ags from Simrad')-3.3 E 2.5(sN)-.55 G
-(eptune system.)-2.5 E F1(VERSION)72 124.8 Q F0 -1.11(Ve)108 136.8 S
-(rsion 5.0)1.11 E F1(SYNOPSIS)72 165.6 Q F2(mbneptune2esf)108 177.6 Q F0
-([)2.5 E F2<ad46>A/F3 10/Times-Italic at 0 SF(format)A F2<ad49>2.5 E F3
-(in\214le)A F2<ad4f>2.5 E F3(out\214le)A F2<ad4d>2.5 E F3(mode)A F2
-<ad52>2.5 E F3(rules_\214le)A F2(\255V \255H])2.5 E F1(DESCRIPTION)72
-206.4 Q F2(mbneptune2esf)108 218.4 Q F0 1.634
-(imports manual data \215agging performed using Simrad')4.134 F 4.133
-(sN)-.55 G 1.633(EPTUNE softw)-4.133 F 1.633(are and \215ags)-.1 F
-(those beams in the corresponding MB-System \214les.)108 230.4 Q(The)108
-254.4 Q F2(binstat)3.655 E F0 1.156(tool in Simrad')3.655 F 3.656(sN)
--.55 G 1.156(EPTUNE softw)-3.656 F 1.156(are has a number of adv)-.1 F
-1.156(antages o)-.25 F -.15(ve)-.15 G 3.656(rm).15 G 1.156
-(bedit as a tool for)-3.656 F .178
-(\215agging bad data, including access to a v)108 266.4 R .178
-(ariety of statistics from gridding the data. MB-System is generally)
--.25 F .714(more \215e)108 278.4 R .714(xible and po)-.15 F .714
-(werful in a number of other areas.)-.25 F F2(mbneptune2esf)5.714 E F0
-.715(tries to gi)3.215 F 1.015 -.15(ve y)-.25 H .715
-(ou the best of both).15 F -.1(wo)108 290.4 S(rlds.).1 E F2
-(mbneptune2esf)108 314.4 Q F0 .672(reads a binstat_?.rules \214le gener\
-ated by manually cleaning data using the correlation plot)3.172 F .611
-(in the binstat tool of the neptune sofw)108 326.4 R .612
-(are written by K)-.1 F(ongsber)-.35 E 3.112(gS)-.18 G .612
-(imrad and writes these edits in a mbsys-)-3.112 F .976(tem esf \214le.)
-108 338.4 R .976(The purpose of this tool is to allo)5.976 F 3.476(wd)
--.25 G .976(ata cleaning done using neptune to be carried into the)
--3.476 F(mbsystem en)108 350.4 Q
-(vironment \255 thus making neptune a more useful tool.)-.4 E F2
-(mbneptune2esf)108 374.4 Q F0 .2
-(applies all the manual edits in the rules \214le gi)2.7 F -.15(ve)-.25
-G 2.701(nt).15 G 2.701(ot)-2.701 G .201
-(hose of the input \214les it recognises as)-2.701 F .62
-(matching the original lines.)108 386.4 R 3.12(Al)5.62 G .619(ine is co\
-nsidered to match if the line name contained in the rules \214le \(e.g.)
--3.12 F(0002_20000408_221415\) is part of the \214le name of the data \
-\214le \(e.g. 0002_20000408_221415.mb57\).)108 398.4 Q(Sw)108 422.4 Q
-.981(ath line \214les should be con)-.1 F -.15(ve)-.4 G .981
-(rted to format 57 using mbcop).15 F 3.481(yb)-.1 G .981
-(efore using this program, as format 56)-3.481 F(does not ha)108 434.4 Q
-.3 -.15(ve t)-.2 H
-(he ability to \215ag data \(although data can be zeroed \255 b).15 E
-(ut zero may be a v)-.2 E(alid depth\).)-.25 E .849(Data \215agged by r\
-ules generated in binstat is not \215agged by this program \255 only ma\
-nually \215agged data is)108 458.4 R(\215agged.)108 470.4 Q F2
-(mbneptune2esf)108 494.4 Q F0 .079
-(can also be used to transfer processing done in neptune to other surv)
-2.579 F -.15(ey)-.15 G 2.58(s. Neptune).15 F .08(breaks a)2.58 F(surv)
-108 506.4 Q 1.126 -.15(ey u)-.15 H 3.326(pi).15 G .826(nto a number of \
-blocks and records all the processing done in these blocks. Changing a \
-block)-3.326 F .198(results in a loss of all the e)108 518.4 R .198
-(xisting processing information. When adding data to an e)-.15 F .199
-(xisting surv)-.15 F .499 -.15(ey t)-.15 H .199(hat f).15 F(alls)-.1 E
-.156(outside an)108 530.4 R 2.656(ye)-.15 G .156
-(xisting block, all of the e)-2.806 F .156(xisting blocks must be remo)
--.15 F -.15(ve)-.15 G .155(d, and therefore all of the processing is).15
-F(lost.)108 542.4 Q F2(mbneptune2esf)5.39 E F0(and)2.89 E F2(mbpr)2.89 E
-(ocess)-.18 E F0 .39
-(can be used to zero all the beams \215agged during neptune processing)
-2.89 F .476
-(and the processed \214les can then be used as the basis for a ne)108
-554.4 R 2.976(ws)-.25 G(urv)-2.976 E -.15(ey)-.15 G 2.976(,p)-.5 G .475
-(reserving the manual \215agging \(b)-2.976 F(ut)-.2 E
-(losing the \215agged data\).)108 566.4 Q
-(The zero data can then be easily \215agged in neptune.)5 E(cd $RA)144
-590.4 Q(WD)-.9 E -1.21 -1.11(AT A)-.4 H(HOME)1.11 E(ls *ra)144 602.4 Q
--.65(w.)-.15 G(all | while \(read \214le\) ; do).65 E
-(echo $\214le 56 1 >> datalist.mb-1)216 614.4 Q(done)180 626.4 Q
-(cat $PR)144 638.4 Q(OCHOME/old_surv)-.4 E -.15(ey)-.15 G
-(/binstat_*.rules | mbneptune2esf \255m3).15 E(mbprocess)144 650.4 Q
-(cat *p.mb56 | handleEmX ne)144 662.4 Q(w_surv)-.25 E .3 -.15(ey o)-.15
-H(p).15 E .394
-(This program \215ags beams by outputting the \215ags as edit e)108
-686.4 R -.15(ve)-.25 G .395(nts to an "edit sa).15 F .695 -.15(ve \214)
--.2 H .395(le", lik).15 F 2.895(et)-.1 G .395(hat produced by)-2.895 F
-F2(mbedit)108 698.4 Q F0 3.19(.I)C 3.19(fa)-3.19 G 3.19(n")-3.19 G .69
-(edit sa)-3.19 F .99 -.15(ve \214)-.2 H .69
-(le" \(named by adding a ".esf" suf).15 F .69(\214x to the input sw)-.25
-F .69(ath \214lename\) already e)-.1 F(xists,)-.15 E .398
-(the edits are read in and applied before the)108 710.4 R F2
-(mbneptune2esf)2.899 E F0 .399(\215agging algorithms are used.)2.899 F
-.399(Once generated,)5.399 F .652(the edit e)108 722.4 R -.15(ve)-.25 G
-.652(nts can be applied to the data using the program).15 F F2(mbpr)
-3.152 E(ocess)-.18 E F0 3.152(,w)C .651(hich outputs a processed sw)
--3.152 F(ath)-.1 E(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)-2.5
-E(1)204.835 E 0 Cg EP
-%%Page: 2 2
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 127.07(mbneptune2esf\(1\) MB-System)72 48 R
-127.07(5.0 mbneptune2esf\(1\))2.5 F 1.432(data \214le.)108 84 R(The)
-6.432 E/F1 10/Times-Bold at 0 SF(mbpr)3.932 E(ocess)-.18 E F0 1.432
-(program is also used to mer)3.932 F 1.432(ge edited na)-.18 F(vig)-.2 E
-1.432(ation, recalculate bath)-.05 F(ymetry)-.05 E 3.933(,a)-.65 G(nd)
--3.933 E(apply other corrections to sw)108 96 Q(ath bath)-.1 E
-(ymetry data.)-.05 E/F2 10.95/Times-Bold at 0 SF -.548(AU)72 124.8 S
-(THORSHIP).548 E F0(Gordon K)108 136.8 Q(eith \(gordon.k)-.25 E
-(eith at csiro.au\))-.1 E(CSIR)113 148.8 Q 2.5(OA)-.4 G(ustralia)-2.5 E(Da)
-108 160.8 Q(vid W)-.2 E 2.5(.C)-.92 G(aress \(caress at mbari.or)-2.5 E
-(g\))-.18 E(Montere)113 172.8 Q 2.5(yB)-.15 G
-(ay Aquarium Research Institute)-2.5 E
-(Dale N. Chayes \(dale at ldeo.columbia.edu\))108 184.8 Q
-(Lamont-Doherty Earth Observ)113 196.8 Q(atory)-.25 E F2(OPTIONS)72
-225.6 Q F1<ad46>108 237.6 Q/F3 10/Times-Italic at 0 SF(format)24.19 E F0
-.22(Sets the data format used if the input is read from stdin or from a\
- \214le. If)144 249.6 R F3(format)2.72 E F0 2.72(<0)2.72 G 2.72(,t)-2.72
-G .22(hen the input)-2.72 F .007(\214le speci\214ed with the)144 261.6 R
-F1<ad49>2.507 E F0 .008(option will actually contain a list of input sw)
-2.508 F .008(ath sonar data \214les. This pro-)-.1 F .012(gram uses the)
-144 273.6 R F1(MBIO)2.512 E F0 .012(library and will read or write an)
-2.512 F 2.512(ys)-.15 G -.1(wa)-2.512 G .012
-(th sonar format supported by).1 F F1(MBIO)2.511 E F0 2.511(.A)C 1.296
-(list of the sw)144 285.6 R 1.297
-(ath sonar data formats currently supported by)-.1 F F1(MBIO)3.797 E F0
-1.297(and their identi\214er v)3.797 F 1.297(alues is)-.25 F(gi)144
-297.6 Q -.15(ve)-.25 G 2.929(ni).15 G 2.929(nt)-2.929 G(he)-2.929 E F1
-(MBIO)2.929 E F0 .428(manual page. Def)2.929 F(ault:)-.1 E F3(format)
-2.928 E F0 2.928(=1)2.928 G 2.928(1. Only)-2.928 F .428
-(formats 56 and 57 \214les are af)2.928 F(fected)-.25 E
-(by this program. Other \214les are ignored.)144 309.6 Q F1<ad48>108
-326.4 Q F0 .162(This "help" \215ag cause the program to print out a des\
-cription of its operation and then e)22.52 F .162(xit immedi-)-.15 F
-(ately)144 338.4 Q(.)-.65 E F1<ad49>108 355.2 Q F3(in\214le)26.41 E F0
-.313(Sets the input \214lename. If)144 367.2 R F3(format)2.813 E F0
-2.813(>0\()2.813 G .313(set with the)-2.813 F F1<ad46>2.813 E F0 .313
-(option\) then the sw)2.813 F .312(ath sonar data contained)-.1 F(in)144
-379.2 Q F3(in\214le)2.937 E F0 .437(is read and processed. If)2.937 F F3
-(format)2.937 E F0 2.937(<0)2.937 G 2.937(,t)-2.937 G(hen)-2.937 E F3
-(in\214le)2.937 E F0 .437(is assumed to be an ascii \214le containing a)
-2.937 F .869(list of the input sw)144 391.2 R .869
-(ath sonar data \214les to be processed and their formats.)-.1 F .868
-(The program will read)5.869 F .711(and process the data in each one of\
- these \214les. Each input \214le will ha)144 403.2 R 1.011 -.15(ve a)
--.2 H 3.211(na).15 G .712(ssociated output \214le)-3.211 F .01
-(with the ".esf" suf)144 415.2 R 2.51(\214x. In)-.25 F(the)2.51 E F3
-(in\214le)2.51 E F0 .01(\214le, each data \214le should be follo)2.51 F
-.01(wed by a data format identi\214er)-.25 F(,)-.4 E(e.g.:)144 427.2 Q
-(data\214le1 11)180 439.2 Q(data\214le2 24)180 451.2 Q .568
-(This program uses the)144 463.2 R F1(MBIO)3.068 E F0 .568
-(library and will read or write an)3.068 F 3.068(ys)-.15 G -.1(wa)-3.068
-G .568(th sonar format supported by).1 F F1(MBIO)144 475.2 Q F0 3.428
-(.Al)C .928(ist of the sw)-3.428 F .928
-(ath sonar data formats currently supported by)-.1 F F1(MBIO)3.428 E F0
-.928(and their identi\214er)3.428 F -.25(va)144 487.2 S .51(lues is gi)
-.25 F -.15(ve)-.25 G 3.01(ni).15 G 3.01(nt)-3.01 G(he)-3.01 E F1(MBIO)
-3.01 E F0 .51(manual page.)3.01 F .51
-(Only formats 56 and 57 \214les are af)5.51 F .51(fected by this pro-)
--.25 F(gram. Other \214les are ignored.)144 499.2 Q(Def)5 E(ault:)-.1 E
-F3(in\214le)2.5 E F0 2.5(=")2.5 G(datalist.mb-1".)-2.5 E F1<ad4d>108 516
-Q F3(mode)20.86 E F0
-(Sets the manner in which \215agged by neptune are handled.)144 528 Q F3
-(mode)180 540 Q F0 2.5(=1)2.5 G 31.92(:F)-2.5 G
-(lags the \215agged beam.)-31.92 E F3(mode)180 552 Q F0 2.5(=3)2.5 G
-31.92(:Z)-2.5 G(eros the \215agged beam.)-31.92 E(Def)5 E(ault:)-.1 E F3
-(mode)2.5 E F0 2.5(=1)2.5 G(.)-2.5 E F1<ad4f>108 568.8 Q F3(out\214le)
-22.52 E F0 .927(Speci\214es a \214le to write a cop)144 580.8 R 3.427
-(yo)-.1 G 3.427(ft)-3.427 G .926(he beam information e)-3.427 F .926
-(xtracted from the rules \214le. Mostly for)-.15 F(deb)144 592.8 Q
-(ugging purposes.)-.2 E F1<ad52>108 609.6 Q F3(rules_\214le)23.08 E F0
-.735(The binstat rules \214le containing the manual \215agging rules to\
- be applied. Rules \214les are normally)144 621.6 R($PR)144 633.6 Q
-(OCHOME/)-.4 E F3(surve)A(y)-.3 E F0(/binstat_)A F3(bloc)A(k)-.2 E F0
-3.582(.rules. The)B(LINES_PING_BEAM_R)3.582 E 1.082
-(ULE rules from this \214le)-.4 F
-(will be applied to the matching line\(s\) in the input \214le.)144
-645.6 Q(Def)5 E(ault:)-.1 E F3(rules_\214le)2.5 E F0 2.5(=s)2.5 G(tdin.)
--2.5 E F1<ad56>108 662.4 Q F0(Normally)23.08 E(,)-.65 E F1
-(mbneptune2esf)3.75 E F0 -.1(wo)3.75 G 1.25
-(rks "silently" without outputting an).1 F 1.25
-(ything to the stderr stream.)-.15 F(If)6.25 E(the)144 674.4 Q F1<ad56>
-3.652 E F0 1.152(\215ag is gi)3.652 F -.15(ve)-.25 G 1.152(n, then).15 F
-F1(mbneptune2esf)3.651 E F0 -.1(wo)3.651 G 1.151(rks in a "v).1 F 1.151
-(erbose" mode and outputs the program)-.15 F -.15(ve)144 686.4 S(rsion \
-being used, all error status messages, and the number of beams \215agge\
-d as bad.).15 E(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E
-(2)204.835 E 0 Cg EP
-%%Page: 3 3
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 127.07(mbneptune2esf\(1\) MB-System)72 48 R
-127.07(5.0 mbneptune2esf\(1\))2.5 F/F1 10.95/Times-Bold at 0 SF(EXAMPLES)72
-84 Q F0 .319(The normal use of)108 96 R/F2 10/Times-Bold at 0 SF
-(mbneptune2esf)2.819 E F0 -.1(wo)2.819 G .32
-(uld be to apply all the manual edits in a Neptune surv).1 F .62 -.15
-(ey t)-.15 H 2.82(ot).15 G .32(he core-)-2.82 F(sponding MB-System surv)
-108 108 Q .3 -.15(ey r)-.15 H(epresented by a datalist:).15 E(cat $PR)
-144 132 Q(OCHOME/Brok)-.4 E(en_Reef/binstat_*.rules | \\)-.1 E
-(mbneptune2esf \255I/data/mbproc/Brok)180 144 Q(en_Reef/datalist.mb-1)
--.1 E .367(Since the def)108 168 R .367
-(ault input \214le is the datalist in the current directory)-.1 F 2.867
-(,t)-.65 G .366(he follo)-2.867 F .366(wing is equi)-.25 F -.25(va)-.25
-G .366(lent if the Neptune).25 F(en)108 180 Q(vironment v)-.4 E
-(ariable PR)-.25 E(OCHOME e)-.4 E -.25(va)-.25 G(luates to /data/proc:)
-.25 E(cd /data/mbproc/Brok)144 204 Q(en_Reef)-.1 E(cat /data/proc/Brok)
-144 216 Q(en_Reef/binstat_*.rules | mbneptune2esf)-.1 E 1.6 -.8(To a)108
-240 T(pply the manual edits from a particular block of a Neptune surv).8
-E .3 -.15(ey t)-.15 H 2.5(oo).15 G(nly one of the related data \214les:)
--2.5 E(mbneptune2esf \255R $PR)144 264 Q(OCHOME/Brok)-.4 E
-(en_Reef/binstat_1.rules \\)-.1 E(-F57 \255I0032_20000408_221201.mb57)
-180 276 Q 1.818 -.8(To u)108 300 T .218
-(se the manual edits from a particular block of a Neptune surv).8 F .519
--.15(ey t)-.15 H 2.719(oz).15 G .219
-(ero the beams of one of the related)-2.719 F(data \214les:)108 312 Q
-(mbneptune2esf \255R $PR)144 336 Q(OCHOME/Brok)-.4 E
-(en_Reef/binstat_2.rules)-.1 E 2.5(-M3 \255F56)180 348 R
-(\255I0002_20000408_153940_ra)2.5 E -.65(w.)-.15 G(all).65 E F1
-(SEE ALSO)72 376.8 Q F2(mbsystem)108 388.8 Q F0(\(1\),)A F2(mbclean)2.5
-E F0(\(1\),)A F2(mbedit)2.5 E F0(\(1\),)A F2(mbpr)2.5 E(ocess)-.18 E F0
-(\(1\))A F1 -.11(BU)72 417.6 S(GS).11 E F2(mbneptune2esf)108 429.6 Q F0
-.04(does not \215ag beams \215agged by rules in binstat, only beams tha\
-t are \215agged manually using)2.54 F(the correlation plot.)108 441.6 Q
-(Probably plenty of others.)108 465.6 Q(MB-System 5.0)72 768 Q 2.5(3J)
-146.495 G(une 2013)-2.5 E(3)204.835 E 0 Cg EP
-%%Trailer
-end
-%%EOF
diff --git a/src/ps/mbotps.ps b/src/ps/mbotps.ps
deleted file mode 100644
index 1b38984..0000000
--- a/src/ps/mbotps.ps
+++ /dev/null
@@ -1,584 +0,0 @@
-%!PS-Adobe-3.0
-%%Creator: groff version 1.19.2
-%%CreationDate: Wed Jul  1 12:29:30 2015
-%%DocumentNeededResources: font Times-Roman
-%%+ font Times-Bold
-%%+ font Times-Italic
-%%DocumentSuppliedResources: procset grops 1.19 2
-%%Pages: 5
-%%PageOrder: Ascend
-%%DocumentMedia: Default 612 792 0 () ()
-%%Orientation: Portrait
-%%EndComments
-%%BeginDefaults
-%%PageMedia: Default
-%%EndDefaults
-%%BeginProlog
-%%BeginResource: procset grops 1.19 2
-%!PS-Adobe-3.0 Resource-ProcSet
-/setpacking where{
-pop
-currentpacking
-true setpacking
-}if
-/grops 120 dict dup begin
-/SC 32 def
-/A/show load def
-/B{0 SC 3 -1 roll widthshow}bind def
-/C{0 exch ashow}bind def
-/D{0 exch 0 SC 5 2 roll awidthshow}bind def
-/E{0 rmoveto show}bind def
-/F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def
-/G{0 rmoveto 0 exch ashow}bind def
-/H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/I{0 exch rmoveto show}bind def
-/J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def
-/K{0 exch rmoveto 0 exch ashow}bind def
-/L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/M{rmoveto show}bind def
-/N{rmoveto 0 SC 3 -1 roll widthshow}bind def
-/O{rmoveto 0 exch ashow}bind def
-/P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/Q{moveto show}bind def
-/R{moveto 0 SC 3 -1 roll widthshow}bind def
-/S{moveto 0 exch ashow}bind def
-/T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/SF{
-findfont exch
-[exch dup 0 exch 0 exch neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/MF{
-findfont
-[5 2 roll
-0 3 1 roll
-neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/level0 0 def
-/RES 0 def
-/PL 0 def
-/LS 0 def
-/MANUAL{
-statusdict begin/manualfeed true store end
-}bind def
-/PLG{
-gsave newpath clippath pathbbox grestore
-exch pop add exch pop
-}bind def
-/BP{
-/level0 save def
-1 setlinecap
-1 setlinejoin
-72 RES div dup scale
-LS{
-90 rotate
-}{
-0 PL translate
-}ifelse
-1 -1 scale
-}bind def
-/EP{
-level0 restore
-showpage
-}def
-/DA{
-newpath arcn stroke
-}bind def
-/SN{
-transform
-.25 sub exch .25 sub exch
-round .25 add exch round .25 add exch
-itransform
-}bind def
-/DL{
-SN
-moveto
-SN
-lineto stroke
-}bind def
-/DC{
-newpath 0 360 arc closepath
-}bind def
-/TM matrix def
-/DE{
-TM currentmatrix pop
-translate scale newpath 0 0 .5 0 360 arc closepath
-TM setmatrix
-}bind def
-/RC/rcurveto load def
-/RL/rlineto load def
-/ST/stroke load def
-/MT/moveto load def
-/CL/closepath load def
-/Fr{
-setrgbcolor fill
-}bind def
-/setcmykcolor where{
-pop
-/Fk{
-setcmykcolor fill
-}bind def
-}if
-/Fg{
-setgray fill
-}bind def
-/FL/fill load def
-/LW/setlinewidth load def
-/Cr/setrgbcolor load def
-/setcmykcolor where{
-pop
-/Ck/setcmykcolor load def
-}if
-/Cg/setgray load def
-/RE{
-findfont
-dup maxlength 1 index/FontName known not{1 add}if dict begin
-{
-1 index/FID ne{def}{pop pop}ifelse
-}forall
-/Encoding exch def
-dup/FontName exch def
-currentdict end definefont pop
-}bind def
-/DEFS 0 def
-/EBEGIN{
-moveto
-DEFS begin
-}bind def
-/EEND/end load def
-/CNT 0 def
-/level1 0 def
-/PBEGIN{
-/level1 save def
-translate
-div 3 1 roll div exch scale
-neg exch neg exch translate
-0 setgray
-0 setlinecap
-1 setlinewidth
-0 setlinejoin
-10 setmiterlimit
-[]0 setdash
-/setstrokeadjust where{
-pop
-false setstrokeadjust
-}if
-/setoverprint where{
-pop
-false setoverprint
-}if
-newpath
-/CNT countdictstack def
-userdict begin
-/showpage{}def
-/setpagedevice{}def
-}bind def
-/PEND{
-countdictstack CNT sub{end}repeat
-level1 restore
-}bind def
-end def
-/setpacking where{
-pop
-setpacking
-}if
-%%EndResource
-%%EndProlog
-%%BeginSetup
-%%BeginFeature: *PageSize Default
-<< /PageSize [ 612 792 ] /ImagingBBox null >> setpagedevice
-%%EndFeature
-%%IncludeResource: font Times-Roman
-%%IncludeResource: font Times-Bold
-%%IncludeResource: font Times-Italic
-grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72
-def/PL 792 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron/Zcaron
-/scaron/zcaron/Ydieresis/trademark/quotesingle/Euro/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/space/exclam/quotedbl/numbersign/dollar/percent
-/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen
-/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon
-/semicolon/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O
-/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright/circumflex
-/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y
-/z/braceleft/bar/braceright/tilde/.notdef/quotesinglbase/guillemotleft
-/guillemotright/bullet/florin/fraction/perthousand/dagger/daggerdbl
-/endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut
-/dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash
-/quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen
-/brokenbar/section/dieresis/copyright/ordfeminine/guilsinglleft
-/logicalnot/minus/registered/macron/degree/plusminus/twosuperior
-/threesuperior/acute/mu/paragraph/periodcentered/cedilla/onesuperior
-/ordmasculine/guilsinglright/onequarter/onehalf/threequarters
-/questiondown/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE
-/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex
-/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis
-/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn
-/germandbls/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla
-/egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis
-/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide/oslash
-/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis]def
-/Times-Italic at 0 ENC0/Times-Italic RE/Times-Bold at 0 ENC0/Times-Bold RE
-/Times-Roman at 0 ENC0/Times-Roman RE
-%%EndSetup
-%%Page: 1 1
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 158.72(mbotps\(1\) MB-System)72 48 R 158.72
-(5.0 mbotps\(1\))2.5 F/F1 10.95/Times-Bold at 0 SF -.219(NA)72 84 S(ME).219
-E/F2 10/Times-Bold at 0 SF(mbotps)108 96 Q F0 2.5<ad50>2.5 G
-(redicts tides using the OSU T)-2.5 E(idal Prediction Softw)-.35 E
-(are \(O)-.1 E(TPS\) distrib)-.4 E(ution.)-.2 E F1(VERSION)72 124.8 Q F0
--1.11(Ve)108 136.8 S(rsion 5.0)1.11 E F1(SYNOPSIS)72 165.6 Q F2(mbotps)
-108 177.6 Q F0([)47.007 E F2<ad41>A/F3 10/Times-Italic at 0 SF(tideformat)A
-F2<ad42>47.007 E F3(year/month/day/hour/minute/second)A F2<ad44>47.006 E
-F3(interval)A F2<ad45>108 189.6 Q F3(year/month/day/hour/minute/second)A
-F2<ad46>10.614 E F3(format)A F2<ad49>10.614 E F3(datalist.mb-1)A F2
-8.114<ad4d20ad4f>10.614 F F3(output)A F2<ad50>10.614 E F3(otps_location)
-A F2<ad52>108 201.6 Q F3(lon/lat)A F2<ad54>2.5 E F3(model)A F2<ad56>2.5
-E F3(])A F1(DESCRIPTION)72 230.4 Q F2(MBotps)108 242.4 Q F0 .088
-(is a utility that predicts tides using the O)2.589 F .088(TPS \(OSU T)
--.4 F .088(idal Prediction Softw)-.35 F .088(are\) package that can be)
--.1 F(do)108 254.4 Q(wnloaded at:)-.25 E(http://www)118 266.4 Q
-(.coas.ore)-.65 E 1.972(gonstate.edu/research/po/research/tide/ The O)
--.15 F 1.973(TPS utilities are operated in a batch)-.4 F 1.236
-(mode using command \214les with a f)108 278.4 R 1.235
-(airly arcane format.)-.1 F F2(MBotps)3.735 E F0(pro)3.735 E 1.235
-(vides a command line interf)-.15 F 1.235(ace that)-.1 F(allo)108 290.4
-Q(ws)-.25 E F2(MB-System)3.664 E F0 1.165(users to easily obtain tide m\
-odels for speci\214ed locations and times.)3.664 F F2(MBotps)3.665 E F0
-1.165(is b)3.665 F(uilt)-.2 E .064(during a normal installation of)108
-302.4 R F2(MB-System)2.564 E F0 2.564(,b)C .064(ut will w)-2.764 F .063
-(ork only if the O)-.1 F .063(TPS package has been installed sep-)-.4 F
-.785(arately and the O)108 314.4 R .785
-(TPS location has been speci\214ed. See the INST)-.4 F .785
-(ALL \214le in the)-.93 F F2(MB-System)3.285 E F0 .785(top directory)
-3.285 F(for guidance on the b)108 326.4 Q(uild process.)-.2 E .134
-(There are actually three v)108 350.4 R .134(ariants of the O)-.25 F
-.134(TPS package a)-.4 F -.25(va)-.2 G .134(ilable for do).25 F .134
-(wnload and installation: O)-.25 F .134(TPS, O)-.4 F(TP-)-.4 E .834
-(Snc, and O)108 362.4 R .834(TPS2. The three v)-.4 F .834
-(ersions use dif)-.15 F .834(ferent tide model formats, b)-.25 F .834
-(ut otherwise are used in the same)-.2 F -.1(wa)108 374.4 S 1.98 -.65
-(y. O).1 H .68(TPS uses tide models stored in a nati).25 F .98 -.15
-(ve b)-.25 H .68(inary format, O).15 F 3.18(TPSnc uses)-.4 F .68
-(tide models in a netCDF for)3.18 F(-)-.2 E .736(mat, and O)108 386.4 R
-.736(TPS2 uses h)-.4 F .736(ybrid tide models combining a lo)-.05 F
-3.236(wr)-.25 G .736(esolution global model with higher resolution)
--3.236 F(representation of man)108 398.4 Q 2.5(yc)-.15 G(oastal re)-2.5
-E(gions.)-.15 E .63(The local O)108 422.4 R .63
-(TPSnc installation can include more than one tidal model; se)-.4 F -.15
-(ve)-.25 G .63(ral global and local models are).15 F -.2(av)108 434.4 S
-.406(ailable from the Ore)-.05 F .406(gon State tide group. By def)-.15
-F(ault,)-.1 E F2(mbotps)2.906 E F0 .407
-(attempts to use a global tide model named)2.907 F 1.673
-(tpxo7.2. Users can use the)108 446.4 R F2(-T)4.173 E F3(model)A F0
-1.673
-(option to specify the desired model. If no model is speci\214ed, and)
-4.173 F .69(tpxo7.2 is not a)108 458.4 R -.25(va)-.2 G .69(ilable, then)
-.25 F F2(mbotps)3.19 E F0 .69(will use the \214rst v)3.19 F .69
-(alid model found. It is the user')-.25 F 3.19(sr)-.55 G .69
-(esponsibility to)-3.19 F(ensure that the positions of requested tide v)
-108 470.4 Q(alues lie within the speci\214ed tide model')-.25 E 2.5(sd)
--.55 G(omain.)-2.5 E 1.455(The O)108 494.4 R 1.455
-(TPSnc models generally tak)-.4 F 3.955(et)-.1 G 1.454
-(he form of four \214les, all of which should be placed in a directory)
--3.955 F(named "D)108 506.4 Q -1.21 -1.11(AT A)-.4 H 2.5("i)1.11 G 2.5
-(nt)-2.5 G(he O)-2.5 E(TPSnc installation. F)-.4 E
-(or a model named ES2008, the \214les are:)-.15 E(Model_ES2008)118 518.4
-Q(gridES2008.nc)118 530.4 Q(hf.ES2008.nc)118 542.4 Q(uv)118 554.4 Q
-(.ES2008.nc)-.65 E .861(Here the \214rst \214le is a te)108 566.4 R .861
-(xt \214le that references the other three; for)-.15 F F2(mbotps)3.361 E
-F0 .861(the model name consists of the)3.361 F(te)108 578.4 Q .868
-(xt that follo)-.15 F .868(ws "Model_" in the \214rst \214le')-.25 F
-3.367(sn)-.55 G .867
-(ame. Most of the models one can obtain from the OSU tide)-3.367 F .479
-(group are intended to be used by running the O)108 590.4 R .479
-(TPSnc program)-.4 F F2(pr)2.98 E(edict_tide)-.18 E F0 .48(from the O)
-2.98 F .48(TPSnc installation)-.4 F(directory)108 602.4 Q 4.692(,a)-.65
-G 2.192(nd thus reference the data \214les using relati)-4.692 F 2.491
--.15(ve p)-.25 H 2.191(aths. F).15 F 2.191(or e)-.15 F 2.191
-(xample, the original contents of)-.15 F(Model_ES2008 are:)108 614.4 Q
--.4(DA)118 626.4 S -.93(TA)-.71 G(/gridES2008.nc).93 E -.4(DA)118 638.4
-S -.93(TA)-.71 G(/hf.ES2008.nc).93 E -.4(DA)118 650.4 S -.93(TA)-.71 G
-(/uv).93 E(.ES2008.nc)-.65 E .777(In order for the O)108 662.4 R .778
-(TPSnc to w)-.4 F .778(ork when called by)-.1 F F2(mbotps)3.278 E F0
-3.278(,t)C .778(he model data \214le paths must be global rather)-3.278
-F 3.248(than relati)108 674.4 R -.15(ve)-.25 G 5.748(.I).15 G 5.748(ft)
--5.748 G 3.248(he O)-5.748 F 3.248
-(TPSnc package has been installed in /usr/local/O)-.4 F 3.248
-(TPSnc, then the model \214le)-.4 F(Model_ES2008 should be edited to ha)
-108 686.4 Q .3 -.15(ve t)-.2 H(he follo).15 E(wing contents:)-.25 E
-(/usr/local/O)118 698.4 Q(TPSnc/D)-.4 E -1.21 -1.11(AT A)-.4 H
-(/gridES2008.nc)1.11 E(/usr/local/O)118 710.4 Q(TPSnc/D)-.4 E -1.21
--1.11(AT A)-.4 H(/D)1.11 E -1.21 -1.11(AT A)-.4 H(/hf.ES2008.nc)1.11 E
-(/usr/local/O)118 722.4 Q(TPSnc/D)-.4 E -1.21 -1.11(AT A)-.4 H(/D)1.11 E
--1.21 -1.11(AT A)-.4 H(/uv)1.11 E(.ES2008.nc)-.65 E(MB-System 5.0)72 768
-Q(20 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E(1)190.545 E 0 Cg EP
-%%Page: 2 2
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 158.72(mbotps\(1\) MB-System)72 48 R 158.72
-(5.0 mbotps\(1\))2.5 F/F1 10/Times-Bold at 0 SF(MBotps)108 84 Q F0 .363
-(can be operated in tw)2.863 F 2.863(om)-.1 G .363
-(odes. First, users may use the)-2.863 F F1<ad52>2.864 E F0(,)A F1<ad42>
-2.864 E F0 2.864(,a)C(nd)-2.864 E F1<ad45>2.864 E F0 .364
-(options to specify a loca-)2.864 F .156(tion and the be)108 96 R .156
-(ginning and end times of a tidal model for that location. The)-.15 F F1
-<ad44>2.656 E F0 .156(option sets the time interv)2.656 F(al)-.25 E
-(of v)108 108 Q(alues in the output tidal model, and the)-.25 E F1<ad4f>
-2.5 E F0(option sets the output tidal model \214lename.)2.5 E(Alternati)
-108 132 Q -.15(ve)-.25 G(ly).15 E 3.458(,i)-.65 G .959(nstead of specif\
-ying a place and time range, the user may specify one or more sw)-3.458
-F .959(ath data)-.1 F .441(\214les using the)108 144 R F1<ad49>2.941 E
-F0 .441(option. A tidal model is produced for each sw)2.941 F .44
-(ath \214le in which tidal v)-.1 F .44(alues are calculated)-.25 F .078
-(using the sonar na)108 156 R(vig)-.2 E .078(ation locations at interv)
--.05 F .078(als speci\214ed with the)-.25 F F1<ad44>2.578 E F0 .079
-(option, and if the)2.578 F F1<ad4d>2.579 E F0 .079(option is speci-)
-2.579 F .197(\214ed, the sw)108 168 R .197(ath \214le')-.1 F 2.697(sp)
--.55 G .196(rocessing parameter \214le is modi\214ed so that)-2.697 F F1
-(mbpr)2.696 E(ocess)-.18 E F0 .196(applies the tidal model during)2.696
-F(processing.)108 180 Q/F2 10.95/Times-Bold at 0 SF -.548(AU)72 208.8 S
-(THORSHIP).548 E F0(Da)108 220.8 Q(vid W)-.2 E 2.5(.C)-.92 G
-(aress \(caress at mbari.or)-2.5 E(g\))-.18 E(Montere)113 232.8 Q 2.5(yB)
--.15 G(ay Aquarium Research Institute)-2.5 E
-(Dale N. Chayes \(dale at ldeo.columbia.edu\))108 244.8 Q
-(Lamont-Doherty Earth Observ)113 256.8 Q(atory)-.25 E F2(OPTIONS)72
-285.6 Q F1<ad41>108 297.6 Q/F3 10/Times-Italic at 0 SF(tideformat)23.08 E
-F0 .451(This option sets the tide format of the output te)144 309.6 R
-.452(xt tide model \214les.)-.15 F(If)5.452 E F3(tideformat)2.952 E F0
-2.952(=2\()2.952 G .452(the def)-2.952 F(ault\),)-.1 E
-(the tide is output in this format:)144 321.6 Q
-(year month day hour minute second tide)180 333.6 Q(where the tide v)144
-345.6 Q(alue is in meters.)-.25 E(If)5 E F3(tideformat)2.5 E F0 2.5(=1)
-2.5 G 2.5(,t)-2.5 G(hen the output format is:)-2.5 E(time_d tide)180
-357.6 Q(where time_d is in seconds since January 1, 1970 and tide is in\
- meters.)144 369.6 Q F1<ad42>108 386.4 Q F3(yr/mo/da/hr/mn/sc)23.63 E F0
-(This option sets the starting time for for the output tidal model.)144
-398.4 Q F1<ad44>108 415.2 Q F3(interval)23.08 E F0
-(This option sets the time interv)144 427.2 Q(al between tidal model v)
--.25 E(alues in seconds.)-.25 E(Def)5 E(ault: 60 seconds.)-.1 E F1<ad45>
-108 444 Q F3(yr/mo/da/hr/mn/sc)23.63 E F0
-(This option sets the ending time for the output tidal model)144 456 Q
-F1<ad46>108 472.8 Q F3(format)24.19 E F0 .045
-(Sets the data format of the input sw)144 484.8 R .045
-(ath data \214le speci\214ed with the)-.1 F F1<ad49>2.545 E F0 .045
-(option. If)2.545 F F3(format)2.545 E F0 2.545(<0)2.545 G 2.545(,t)
--2.545 G .045(hen the)-2.545 F .971(input \214le speci\214ed with the)
-144 496.8 R F1<ad49>3.472 E F0 .972
-(option will actually contain a list of input sw)3.472 F .972
-(ath sonar data \214les.)-.1 F .624(This program uses the)144 508.8 R F1
-(MBIO)3.124 E F0 .623(library and will read an)3.124 F 3.123(ys)-.15 G
--.1(wa)-3.123 G .623(th sonar format with timestamps sup-).1 F .592
-(ported by)144 520.8 R F1(MBIO)3.092 E F0 5.592(.A)C .592
-(list of the sw)-2.5 F .593
-(ath sonar data formats currently supported by)-.1 F F1(MBIO)3.093 E F0
-.593(and their)3.093 F(identi\214er v)144 532.8 Q(alues is gi)-.25 E
--.15(ve)-.25 G 2.5(ni).15 G 2.5(nt)-2.5 G(he)-2.5 E F1(MBIO)2.5 E F0
-(manual page. The def)2.5 E(ault format is set using)-.1 E F1
-(mbdefaults)2.5 E F0(.)A F1<ad48>108 549.6 Q F0 .162(This "help" \215ag\
- cause the program to print out a description of its operation and then\
- e)22.52 F .161(xit immedi-)-.15 F(ately)144 561.6 Q(.)-.65 E F1<ad49>
-108 578.4 Q F3(\214lename)26.41 E F0 .467(Sets the input \214lename. If)
-144 590.4 R F3(format)2.967 E F0 2.967(>0\()2.967 G .467(set with the)
--2.967 F F1<ad66>2.967 E F0 .467(option\) then the sw)2.967 F .468
-(ath sonar data contained)-.1 F(in)144 602.4 Q F3(in\214le)2.937 E F0
-.437(is read and processed. If)2.937 F F3(format)2.937 E F0 2.937(<0)
-2.937 G 2.937(,t)-2.937 G(hen)-2.937 E F3(in\214le)2.937 E F0 .437
-(is assumed to be an ascii \214le containing a)2.937 F .002
-(list of the input sw)144 614.4 R .003
-(ath sonar data \214les to be processed and their formats.)-.1 F .003
-(The program will read the)5.003 F .275
-(data in each one of these \214les.)144 626.4 R .275(In the)5.275 F F3
-(in\214le)2.775 E F0 .274(\214le, each data \214le should be follo)2.775
-F .274(wed by a data format)-.25 F(identi\214er)144 638.4 Q 2.5(,e)-.4 G
-(.g.:)-2.5 E(data\214le1 11)180 650.4 Q(data\214le2 24)180 662.4 Q .568
-(This program uses the)144 674.4 R F1(MBIO)3.068 E F0 .568
-(library and will read or write an)3.068 F 3.068(ys)-.15 G -.1(wa)-3.068
-G .568(th sonar format supported by).1 F F1(MBIO)144 686.4 Q F0 3.428
-(.Al)C .928(ist of the sw)-3.428 F .928
-(ath sonar data formats currently supported by)-.1 F F1(MBIO)3.428 E F0
-.928(and their identi\214er)3.428 F -.25(va)144 698.4 S(lues is gi).25 E
--.15(ve)-.25 G 2.5(ni).15 G 2.5(nt)-2.5 G(he)-2.5 E F1(MBIO)2.5 E F0
-(manual page. Def)2.5 E(ault:)-.1 E F3(in\214le)2.5 E F0 2.5(=")2.5 G
-(stdin".)-2.5 E F1<ad4d>108 715.2 Q F0 1.305(If the)20.86 F F1<ad49>
-3.805 E F0 1.306
-(option has been used so that tidal models are created for sw)3.805 F
-1.306(ath \214les, then this option)-.1 F .779(causes each sw)144 727.2
-R .778(ath \214le')-.1 F 3.278(sp)-.55 G .778
-(arameter \214le to be modi\214ed so that)-3.278 F F1(mbpr)3.278 E
-(ocess)-.18 E F0 .778(will read and apply the)3.278 F(MB-System 5.0)72
-768 Q(20 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E(2)190.545 E 0 Cg EP
-%%Page: 3 3
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 158.72(mbotps\(1\) MB-System)72 48 R 158.72
-(5.0 mbotps\(1\))2.5 F(ancilliary tidal model \214le created by)144 84 Q
-/F1 10/Times-Bold at 0 SF(mbotps)2.5 E F0(.)A F1<ad4f>108 100.8 Q/F2 10
-/Times-Italic at 0 SF(\214lename)22.52 E F0
-(Sets the \214lename of the tidal model output.)144 112.8 Q F1<ad50>108
-129.6 Q F2(otps_location)24.19 E F0 .77
-(Sets the path to the local installation of O)144 141.6 R .77
-(TPS, which in turn de\214nes the location of the program)-.4 F F1(pr)
-144 153.6 Q(edict_tide)-.18 E F0(called by)2.5 E F1(mbotps)2.5 E F0
-(and the tide model to be used by)2.5 E F1(pr)2.5 E(edict_tide)-.18 E F0
-(.)A F1<ad52>108 170.4 Q F2(longitude/latitude)23.08 E F0(Sets the long\
-itude and latitude position at which the tidal model will be calculated\
-.)144 182.4 Q F1<ad54>108 199.2 Q F2(model)23.63 E F0 .126
-(Sets the name of the O)144 211.2 R .125
-(TPSnc tidal model to be used. This model must be part of the local O)
--.4 F(TPSnc)-.4 E(installation. Examples include "tpxo7.2" and "altas".)
-144 223.2 Q(Def)5 E(ault: "tpxo7.2")-.1 E F1<ad56>108 240 Q F0
-(Increases the v)23.08 E(erbosity of)-.15 E F1(mbotps)2.5 E F0(.)A/F3
-10.95/Times-Bold at 0 SF(EXAMPLES)72 268.8 Q F0 1.042
-(Suppose one wishes to obtain a tidal model for the location 121W 36N e)
-108 280.8 R 1.043(xtending at 60 second interv)-.15 F(als)-.25 E -.15
-(ove)108 292.8 S 2.5(rt).15 G(he day February 21, 2009. The follo)-2.5 E
-(wing will suf)-.25 E(\214ce:)-.25 E(mbotps \255R-125/36 \255B2009/02/2\
-1/00/00/00 \255E2009/02/21/23/59/59 \255V)144 304.8 Q
-(The shell output looks lik)108 316.8 Q(e:)-.1 E(Program mbotps)144
-340.8 Q -1.11(Ve)144 352.8 S
-(rsion $Id: mbotps.ps 2252 2015-07-01 19:35:37Z caress $)1.11 E
-(MB-system V)144 364.8 Q(ersion 5.4.2137)-1.11 E(Checking for a)144
-388.8 Q -.25(va)-.2 G(ilable O).25 E(TPS tide models)-.4 E -.4(OT)144
-400.8 S(PS location: /usr/local/O).4 E(TPSnc)-.4 E -1.11(Va)144 412.8 S
-(lid O)1.11 E(TPS tidal models:)-.4 E(tpxo7.2)156.5 424.8 Q(Number of a)
-144 436.8 Q -.25(va)-.2 G(ilable O).25 E(TPS tide models: 1)-.4 E
-(Using O)144 460.8 Q(TPS tide model:)-.4 E(tpxo7.2)30 E(Lat/Lon/T)144
-484.8 Q(ime \214le:tmp_mbotps_llt_10311.txt)-.35 E(Predict OCEAN tide)
-144 496.8 Q(Interpolate minor constituents)144 508.8 Q 17.5(Model: O)144
-532.8 R(TPSnc/D)-.4 E -1.21 -1.11(AT A)-.4 H(/Model_tpxo7.2)1.11 E
-(Model is on grid uniform in lat,lon)144 544.8 Q(Lat limits:)144 556.8 Q
-15(-90.1250000 90.1250000)12.5 F(Lon limits:)144 568.8 Q 15
-(0.125000000 360.125000)12.5 F(Constituents: m2)144 580.8 Q 2.5
-(s2 n2 k2 k1 o1 p1 q1 mf mm m4 ms4)5 F(mn4)2.5 E(Predict ele)144 592.8 Q
--.25(va)-.25 G(tions \(m\)).25 E(Constituents to include: m2)144 604.8 Q
-2.5(s2 n2 k2 k1 o1 p1 q1 mf mm m4 ms4)5 F(mn4)2.5 E
-(Reading model... done)144 616.8 Q
-(Results are in tmp_mbotps_llttd_10311.txt)144 628.8 Q
-(Results are really in tide_model.txt)144 652.8 Q(The output tidal mode\
-l is in the \214le tide_model.txt, which includes data that look lik)108
-664.8 Q(e:)-.1 E 2.5(#T)144 676.8 S
-(ide model generated by program mbotps)-2.85 E 2.5(#V)144 688.8 S
-(ersion: $Id: mbotps.ps 2252 2015-07-01 19:35:37Z caress $)-3.61 E 2.5
-(#M)144 700.8 S(B-System V)-2.5 E(ersion: 5.4.2137)-1.11 E 2.5(#T)144
-712.8 S(ide model generated by program mbotps)-2.85 E 2.5(#w)144 724.8 S
-(hich in turn calls O)-2.5 E(TPS program predict_tide obtained from:)-.4
-E(MB-System 5.0)72 768 Q(20 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E
-(3)190.545 E 0 Cg EP
-%%Page: 4 4
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 158.72(mbotps\(1\) MB-System)72 48 R 158.72
-(5.0 mbotps\(1\))2.5 F 12.5(#h)144 84 S(ttp://www)-12.5 E(.coas.ore)-.65
-E(gonstate.edu/research/po/research/tide/)-.15 E(#)144 96 Q 2.5(#O)144
-108 S(TPSnc tide model:)-2.9 E 15(#t)144 120 S(pxo7.2)-15 E 2.5(#O)144
-132 S(utput format:)-2.5 E 15(#y)144 144 S
-(ear month day hour minute second tide)-15 E 2.5(#w)144 156 S
-(here tide is in meters)-2.5 E 2.5(#R)144 168 S
-(un by user <caress> on cpu <deitz> at <Thu Aug 15 17:53:22 2013>)-2.5 E
-2.5(#M)144 180 S 17.5(odel: O)-2.5 F(TPSnc/D)-.4 E -1.21 -1.11(AT A)-.4
-H(/Model_tpxo7.2)1.11 E 2.5(#C)144 192 S(onstituents included: m2)-2.5 E
-2.5(s2 n2 k2 k1 o1 p1 q1 mf mm m4 ms4)5 F(mn4)2.5 E(2009 02 21 00 00 00)
-144 204 Q(-0.6840)7.5 E(2009 02 21 00 01 00)144 216 Q(-0.6820)7.5 E
-(2009 02 21 00 02 00)144 228 Q(-0.6790)7.5 E(2009 02 21 00 03 00)144 240
-Q(-0.6770)7.5 E(2009 02 21 00 04 00)144 252 Q(-0.6740)7.5 E
-(2009 02 21 00 05 00)144 264 Q(-0.6720)7.5 E(2009 02 21 00 06 00)144 276
-Q(-0.6690)7.5 E(2009 02 21 00 07 00)144 288 Q(-0.6660)7.5 E
-(2009 02 21 00 08 00)144 300 Q(-0.6640)7.5 E(2009 02 21 00 09 00)144 312
-Q(-0.6610)7.5 E(2009 02 21 00 10 00)144 324 Q(-0.6580)7.5 E
-(2009 02 21 00 11 00)144 336 Q(-0.6560)7.5 E(2009 02 21 00 12 00)144 348
-Q(-0.6530)7.5 E(2009 02 21 00 13 00)144 360 Q(-0.6500)7.5 E
-(.................)144 372 Q(2009 02 21 23 54 00)144 384 Q(-0.7980)7.5 E
-(2009 02 21 23 55 00)144 396 Q(-0.7970)7.5 E(2009 02 21 23 56 00)144 408
-Q(-0.7950)7.5 E(2009 02 21 23 57 00)144 420 Q(-0.7940)7.5 E
-(2009 02 21 23 58 00)144 432 Q(-0.7920)7.5 E(2009 02 21 23 59 00)144 444
-Q(-0.7900)7.5 E(No)108 456 Q 2.55 -.65(w, s)-.25 H 1.25
-(uppose that one w).65 F 1.249(ants to apply tide corrections directly \
-to a set of EM3002 data in GSF format.)-.1 F(First, e)108 468 Q -.15(xe)
--.15 G(cute).15 E/F1 10/Times-Bold at 0 SF(mbotps)2.5 E F0
-(with the datalist for the sw)2.5 E(ath data speci\214ed as input:)-.1 E
-(mbotps \255Idatalist.mb-1 \255V)144 480 Q
-(The resulting shell output looks lik)108 492 Q(e:)-.1 E(Program mbotps)
-144 504 Q -1.11(Ve)144 516 S
-(rsion $Id: mbotps.ps 2252 2015-07-01 19:35:37Z caress $)1.11 E
-(MB-system V)144 528 Q(ersion 5.4.2137)-1.11 E(Checking for a)144 552 Q
--.25(va)-.2 G(ilable O).25 E(TPS tide models)-.4 E -.4(OT)144 564 S
-(PS location: /usr/local/O).4 E(TPSnc)-.4 E -1.11(Va)144 576 S(lid O)
-1.11 E(TPS tidal models:)-.4 E(tpxo7.2)156.5 588 Q(Number of a)144 600 Q
--.25(va)-.2 G(ilable O).25 E(TPS tide models: 1)-.4 E(Using O)144 624 Q
-(TPS tide model:)-.4 E(tpxo7.2)30 E
-(---------------------------------------)144 648 Q
-(Processing tides for himbb05291.d23.mb121)144 672 Q
-(35602 records read from himbb05291.d23.mb121.fn)144 696 Q(v)-.4 E
-(Lat/Lon/T)146.5 720 Q(ime \214le:tmp_mbotps_llt_7413.txt)-.35 E
-(MB-System 5.0)72 768 Q(20 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E
-(4)190.545 E 0 Cg EP
-%%Page: 5 5
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 158.72(mbotps\(1\) MB-System)72 48 R 158.72
-(5.0 mbotps\(1\))2.5 F(Constituents to include: m2)146.5 84 Q 2.5
-(s2 n2 k2 k1 o1 p1 q1)5 F(Predict OCEAN tide)146.5 96 Q
-(Interpolate minor constituents)146.5 108 Q 17.5
-(Model: ss/sandbox/tides/O)146.5 132 R(TPSnc/D)-.4 E -1.21 -1.11(AT A)
--.4 H(/Model_tpxo7.2)1.11 E(Model is on grid uniform in lat,lon)146.5
-144 Q(Lat limits:)146.5 156 Q(\25590.125 90.125)10 E(Lon limits:)146.5
-168 Q(0.125 360.125)10 E(Constituents: m2)146.5 180 Q 2.5
-(s2 n2 k2 k1 o1 p1 q1 mf mm m4 ms4)5 F(mn4)2.5 E(Predict ele)146.5 192 Q
--.25(va)-.25 G(tions \(m\)).25 E(Constituents to include: m2)146.5 204 Q
-2.5(s2 n2 k2 k1 o1 p1 q1)5 F(Reading model... done)146.5 216 Q
-(Results are in tmp_mbotps_llttd_7413.txt)146.5 228 Q
-(Results are really in himbb05291.d23.mb121.tde)144 252 Q
-(The output tide \214les ha)108 264 Q .3 -.15(ve t)-.2 H
-(he same structure sho).15 E(wn abo)-.25 E -.15(ve)-.15 G(:).15 E 2.5
-(#T)144 276 S(ide model generated by program mbotps)-2.85 E 2.5(#V)144
-288 S(ersion: $Id: mbotps.ps 2252 2015-07-01 19:35:37Z caress $)-3.61 E
-2.5(#M)144 300 S(B-System V)-2.5 E(ersion: 5.4.2137)-1.11 E 2.5(#T)144
-312 S(ide model generated by program mbotps)-2.85 E 2.5(#w)144 324 S
-(hich in turn calls O)-2.5 E(TPS program predict_tide obtained from:)-.4
-E 12.5(#h)144 336 S(ttp://www)-12.5 E(.coas.ore)-.65 E
-(gonstate.edu/research/po/research/tide/)-.15 E(#)144 348 Q 2.5(#O)144
-360 S(TPSnc tide model:)-2.9 E 15(#t)144 372 S(pxo7.2)-15 E 2.5(#O)144
-384 S(utput format:)-2.5 E 15(#y)144 396 S
-(ear month day hour minute second tide)-15 E 2.5(#w)144 408 S
-(here tide is in meters)-2.5 E 2.5(#R)144 420 S
-(un by user <caress> on cpu <deitz> at <Thu Aug 15 17:53:22 2013>)-2.5 E
-2.5(#M)144 432 S 17.5(odel: O)-2.5 F(TPSnc/D)-.4 E -1.21 -1.11(AT A)-.4
-H(/Model_tpxo7.2)1.11 E 2.5(#C)144 444 S(onstituents included: m2)-2.5 E
-2.5(s2 n2 k2 k1 o1 p1 q1 mf mm m4 ms4)5 F(mn4)2.5 E(2005 10 18 19 01 36)
-144 456 Q(0.0800)10 E(2005 10 18 19 02 36)144 468 Q(0.0790)10 E
-(2005 10 18 19 03 36)144 480 Q(0.0770)10 E(2005 10 18 19 04 36)144 492 Q
-(0.0760)10 E(2005 10 18 19 05 37)144 504 Q(0.0750)10 E
-(2005 10 18 19 06 37)144 516 Q(0.0730)10 E(2005 10 18 19 07 37)144 528 Q
-(0.0720)10 E(2005 10 18 19 08 37)144 540 Q(0.0710)10 E
-(2005 10 18 19 09 37)144 552 Q(0.0700)10 E .968
-(In addition to generating *.tde \214les for each sw)108 564 R .969
-(ath \214le referenced by the input datalist structure,)-.1 F/F1 10
-/Times-Bold at 0 SF(mbotps)3.469 E F0 .08
-(modi\214es the parameter \214le associated with each sw)108 576 R .079
-(ath \214le \(creating it if necessary\) so that tide correction is)-.1
-F .18(enabled using the *.tde \214le and tide format 2. When)108 588 R
-F1(mbpr)2.68 E(ocess)-.18 E F0 .181
-(is run on the same datalist, the \214les will be)2.681 F(reprocessed, \
-and the processing will include the application of the tide correction \
-to all bath)108 600 Q(ymetry)-.05 E(.)-.65 E/F2 10.95/Times-Bold at 0 SF
-(SEE ALSO)72 628.8 Q F1(mbsystem)108 640.8 Q F0(\(1\),)A F1(mbpr)2.5 E
-(ocess)-.18 E F0(,)A F1(mbset)2.5 E F2 -.11(BU)72 669.6 S(GS).11 E F0
-(Installing the F)108 681.6 Q(ortran90 O)-.15 E(TPSnc package from Ore)
--.4 E(gon State is not particularly easy)-.15 E(.)-.65 E(MB-System 5.0)
-72 768 Q(20 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E(5)190.545 E 0 Cg
-EP
-%%Trailer
-end
-%%EOF
diff --git a/src/ps/mbpreprocess.ps b/src/ps/mbpreprocess.ps
deleted file mode 100644
index 2e24feb..0000000
--- a/src/ps/mbpreprocess.ps
+++ /dev/null
@@ -1,284 +0,0 @@
-%!PS-Adobe-3.0
-%%Creator: groff version 1.19.2
-%%CreationDate: Wed Jul  1 12:29:30 2015
-%%DocumentNeededResources: font Times-Roman
-%%+ font Times-Bold
-%%+ font Times-Italic
-%%DocumentSuppliedResources: procset grops 1.19 2
-%%Pages: 1
-%%PageOrder: Ascend
-%%DocumentMedia: Default 612 792 0 () ()
-%%Orientation: Portrait
-%%EndComments
-%%BeginDefaults
-%%PageMedia: Default
-%%EndDefaults
-%%BeginProlog
-%%BeginResource: procset grops 1.19 2
-%!PS-Adobe-3.0 Resource-ProcSet
-/setpacking where{
-pop
-currentpacking
-true setpacking
-}if
-/grops 120 dict dup begin
-/SC 32 def
-/A/show load def
-/B{0 SC 3 -1 roll widthshow}bind def
-/C{0 exch ashow}bind def
-/D{0 exch 0 SC 5 2 roll awidthshow}bind def
-/E{0 rmoveto show}bind def
-/F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def
-/G{0 rmoveto 0 exch ashow}bind def
-/H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/I{0 exch rmoveto show}bind def
-/J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def
-/K{0 exch rmoveto 0 exch ashow}bind def
-/L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/M{rmoveto show}bind def
-/N{rmoveto 0 SC 3 -1 roll widthshow}bind def
-/O{rmoveto 0 exch ashow}bind def
-/P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/Q{moveto show}bind def
-/R{moveto 0 SC 3 -1 roll widthshow}bind def
-/S{moveto 0 exch ashow}bind def
-/T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/SF{
-findfont exch
-[exch dup 0 exch 0 exch neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/MF{
-findfont
-[5 2 roll
-0 3 1 roll
-neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/level0 0 def
-/RES 0 def
-/PL 0 def
-/LS 0 def
-/MANUAL{
-statusdict begin/manualfeed true store end
-}bind def
-/PLG{
-gsave newpath clippath pathbbox grestore
-exch pop add exch pop
-}bind def
-/BP{
-/level0 save def
-1 setlinecap
-1 setlinejoin
-72 RES div dup scale
-LS{
-90 rotate
-}{
-0 PL translate
-}ifelse
-1 -1 scale
-}bind def
-/EP{
-level0 restore
-showpage
-}def
-/DA{
-newpath arcn stroke
-}bind def
-/SN{
-transform
-.25 sub exch .25 sub exch
-round .25 add exch round .25 add exch
-itransform
-}bind def
-/DL{
-SN
-moveto
-SN
-lineto stroke
-}bind def
-/DC{
-newpath 0 360 arc closepath
-}bind def
-/TM matrix def
-/DE{
-TM currentmatrix pop
-translate scale newpath 0 0 .5 0 360 arc closepath
-TM setmatrix
-}bind def
-/RC/rcurveto load def
-/RL/rlineto load def
-/ST/stroke load def
-/MT/moveto load def
-/CL/closepath load def
-/Fr{
-setrgbcolor fill
-}bind def
-/setcmykcolor where{
-pop
-/Fk{
-setcmykcolor fill
-}bind def
-}if
-/Fg{
-setgray fill
-}bind def
-/FL/fill load def
-/LW/setlinewidth load def
-/Cr/setrgbcolor load def
-/setcmykcolor where{
-pop
-/Ck/setcmykcolor load def
-}if
-/Cg/setgray load def
-/RE{
-findfont
-dup maxlength 1 index/FontName known not{1 add}if dict begin
-{
-1 index/FID ne{def}{pop pop}ifelse
-}forall
-/Encoding exch def
-dup/FontName exch def
-currentdict end definefont pop
-}bind def
-/DEFS 0 def
-/EBEGIN{
-moveto
-DEFS begin
-}bind def
-/EEND/end load def
-/CNT 0 def
-/level1 0 def
-/PBEGIN{
-/level1 save def
-translate
-div 3 1 roll div exch scale
-neg exch neg exch translate
-0 setgray
-0 setlinecap
-1 setlinewidth
-0 setlinejoin
-10 setmiterlimit
-[]0 setdash
-/setstrokeadjust where{
-pop
-false setstrokeadjust
-}if
-/setoverprint where{
-pop
-false setoverprint
-}if
-newpath
-/CNT countdictstack def
-userdict begin
-/showpage{}def
-/setpagedevice{}def
-}bind def
-/PEND{
-countdictstack CNT sub{end}repeat
-level1 restore
-}bind def
-end def
-/setpacking where{
-pop
-setpacking
-}if
-%%EndResource
-%%EndProlog
-%%BeginSetup
-%%BeginFeature: *PageSize Default
-<< /PageSize [ 612 792 ] /ImagingBBox null >> setpagedevice
-%%EndFeature
-%%IncludeResource: font Times-Roman
-%%IncludeResource: font Times-Bold
-%%IncludeResource: font Times-Italic
-grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72
-def/PL 792 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron/Zcaron
-/scaron/zcaron/Ydieresis/trademark/quotesingle/Euro/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/space/exclam/quotedbl/numbersign/dollar/percent
-/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen
-/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon
-/semicolon/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O
-/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright/circumflex
-/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y
-/z/braceleft/bar/braceright/tilde/.notdef/quotesinglbase/guillemotleft
-/guillemotright/bullet/florin/fraction/perthousand/dagger/daggerdbl
-/endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut
-/dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash
-/quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen
-/brokenbar/section/dieresis/copyright/ordfeminine/guilsinglleft
-/logicalnot/minus/registered/macron/degree/plusminus/twosuperior
-/threesuperior/acute/mu/paragraph/periodcentered/cedilla/onesuperior
-/ordmasculine/guilsinglright/onequarter/onehalf/threequarters
-/questiondown/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE
-/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex
-/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis
-/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn
-/germandbls/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla
-/egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis
-/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide/oslash
-/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis]def
-/Times-Italic at 0 ENC0/Times-Italic RE/Times-Bold at 0 ENC0/Times-Bold RE
-/Times-Roman at 0 ENC0/Times-Roman RE
-%%EndSetup
-%%Page: 1 1
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 132.63(mbpreprocess\(1\) MB-System)72 48 R
-132.63(5.0 mbpreprocess\(1\))2.5 F/F1 10.95/Times-Bold at 0 SF -.219(NA)72
-84 S(ME).219 E/F2 10/Times-Bold at 0 SF(mbpr)108 96 Q(epr)-.18 E(ocess)-.18
-E F0 3.016<ad70>3.016 G .516(erforms preprocessing of sw)-3.016 F .515
-(ath sonar data as part of setting up an MB-System process-)-.1 F
-(ing structure for a dataset.)108 108 Q F1(VERSION)72 136.8 Q F0 -1.11
-(Ve)108 148.8 S(rsion 5.0)1.11 E F1(SYNOPSIS)72 177.6 Q F2(mbpr)108
-189.6 Q(epr)-.18 E(ocess)-.18 E F0([)5.89 E F2(--v)5.89 E 3.39
-(erbose --help --input)-.1 F F0(=)A/F3 10/Times-Italic at 0 SF(FILE)A F2
-(--f)5.89 E(ormat)-.25 E F0(=)A F3(FORMA)A(T)-.37 E F2(--na)5.89 E
-(v_\214le)-.25 E F0(=)A F3(FILE)A F2(--na)5.89 E(v_\214le_f)-.25 E(or)
--.25 E(-)-.37 E(mat)108 201.6 Q F0(=)A F3(FORMA)A(T)-.37 E F2(--na)3.817
-E(v_async)-.25 E F0(=)A F3(RECORDTYPE)A F2(--sensordepth_\214le)3.817 E
-F0(=)A F3(FILE)A F2(--sensordepth_\214le_f)3.816 E(ormat)-.25 E F0(=)A
-F3(FILE)A F2(--sensordepth_async)108 213.6 Q F0(=)A F3(RECORDTYPE)A F2
-(--heading_\214le)7.83 E F0(=)A F3(FILE)A F2(--heading_\214le_f)7.83 E
-(ormat)-.25 E F0(=)A F3(FORMA)A(T)-.37 E F2(--head-)7.83 E(ing_async)108
-225.6 Q F0(=)A F3(RECORDTYPE)A F2(--attitude_\214le)25.247 E F0(=)A F3
-(FILE)A F2(--attitude_\214le_f)25.247 E(ormat)-.25 E F0(=)A F3(FORMA)A
-(T)-.37 E F2(--atti-)25.246 E(tude_async)108 237.6 Q F0(=)A F3
-(RECORDTYPE)A F2(--timeshift_\214le)6.23 E F0(=)A F3(FILE)A F2
-(--timeshift_constant)6.23 E F0(=)A F3(TIME)A F2(--timeshift_apply_na)
-6.23 E(v)-.25 E 36.555(--timeshift_apply_sensordepth --timeshift_apply_\
-heading --timeshift_apply_attitude)108 249.6 R
-(--timeshift_apply_all_ancilliary --timeshift_apply_sur)108 261.6 Q -.1
-(ve)-.1 G 2.5(y-).1 G(-timeshift_apply_all)-2.5 E F0(])2.5 E F1
-(DESCRIPTION)72 290.4 Q F0 .948
-(MBpreprocess handles preprocessing of sw)108 302.4 R .949
-(ath sonar data as part of setting up an MB-System processing)-.1 F .663
-(structure for a dataset. This program replaces the se)108 314.4 R -.15
-(ve)-.25 G .663(ral format-speci\214c preprocessing programs found in)
-.15 F .961(MB-System v)108 326.4 R .961
-(ersion 5 releases with a single program for v)-.15 F .961(ersion 6.)
--.15 F .962(This program is under de)5.962 F -.15(ve)-.25 G(lopment,).15
-E(and is not ready for general use at this time.)108 338.4 Q F1 -.548
-(AU)72 367.2 S(THORSHIP).548 E F0(Da)108 379.2 Q(vid W)-.2 E 2.5(.C)-.92
-G(aress \(caress at mbari.or)-2.5 E(g\))-.18 E(Montere)113 391.2 Q 2.5(yB)
--.15 G(ay Aquarium Research Institute)-2.5 E
-(Dale N. Chayes \(dale at ldeo.columbia.edu\))108 403.2 Q
-(Lamont-Doherty Earth Observ)113 415.2 Q(atory)-.25 E F1(OPTIONS)72 444
-Q F2(--v)108 456 Q(erbose)-.1 E F0 1.14(By def)144 468 R(ault)-.1 E F2
-(mbpr)3.64 E(epr)-.18 E(ocess)-.18 E F0 1.139
-(outputs minimal information to the shell. This option causes the pro-)
-3.64 F(gram to indicate it')144 480 Q 2.5(sp)-.55 G
-(rogress as it runs. Goody)-2.5 E(.)-.65 E F1(EXAMPLES)72 508.8 Q F0 1.6
--.8(To b)108 520.8 T 2.5(ew).8 G(ritten.....)-2.5 E F1(SEE ALSO)72 549.6
-Q F2(mbsystem)108 561.6 Q F0(\(1\),)A F2(mbdatalist)2.5 E F0(\(1\),)A F2
-(mbpr)2.5 E(ocess)-.18 E F0(\(1\))A F1 -.11(BU)72 590.4 S(GS).11 E F0
-(Oh yeah.)108 602.4 Q(MB-System 5.0)72 768 Q(14 March 2014)140.11 E(1)
-198.45 E 0 Cg EP
-%%Trailer
-end
-%%EOF
diff --git a/src/ps/mbprocess.ps b/src/ps/mbprocess.ps
deleted file mode 100644
index cd97ccb..0000000
--- a/src/ps/mbprocess.ps
+++ /dev/null
@@ -1,1580 +0,0 @@
-%!PS-Adobe-3.0
-%%Creator: groff version 1.19.2
-%%CreationDate: Wed Jul  1 12:29:30 2015
-%%DocumentNeededResources: font Times-Roman
-%%+ font Times-Bold
-%%+ font Times-Italic
-%%DocumentSuppliedResources: procset grops 1.19 2
-%%Pages: 25
-%%PageOrder: Ascend
-%%DocumentMedia: Default 612 792 0 () ()
-%%Orientation: Portrait
-%%EndComments
-%%BeginDefaults
-%%PageMedia: Default
-%%EndDefaults
-%%BeginProlog
-%%BeginResource: procset grops 1.19 2
-%!PS-Adobe-3.0 Resource-ProcSet
-/setpacking where{
-pop
-currentpacking
-true setpacking
-}if
-/grops 120 dict dup begin
-/SC 32 def
-/A/show load def
-/B{0 SC 3 -1 roll widthshow}bind def
-/C{0 exch ashow}bind def
-/D{0 exch 0 SC 5 2 roll awidthshow}bind def
-/E{0 rmoveto show}bind def
-/F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def
-/G{0 rmoveto 0 exch ashow}bind def
-/H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/I{0 exch rmoveto show}bind def
-/J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def
-/K{0 exch rmoveto 0 exch ashow}bind def
-/L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/M{rmoveto show}bind def
-/N{rmoveto 0 SC 3 -1 roll widthshow}bind def
-/O{rmoveto 0 exch ashow}bind def
-/P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/Q{moveto show}bind def
-/R{moveto 0 SC 3 -1 roll widthshow}bind def
-/S{moveto 0 exch ashow}bind def
-/T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/SF{
-findfont exch
-[exch dup 0 exch 0 exch neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/MF{
-findfont
-[5 2 roll
-0 3 1 roll
-neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/level0 0 def
-/RES 0 def
-/PL 0 def
-/LS 0 def
-/MANUAL{
-statusdict begin/manualfeed true store end
-}bind def
-/PLG{
-gsave newpath clippath pathbbox grestore
-exch pop add exch pop
-}bind def
-/BP{
-/level0 save def
-1 setlinecap
-1 setlinejoin
-72 RES div dup scale
-LS{
-90 rotate
-}{
-0 PL translate
-}ifelse
-1 -1 scale
-}bind def
-/EP{
-level0 restore
-showpage
-}def
-/DA{
-newpath arcn stroke
-}bind def
-/SN{
-transform
-.25 sub exch .25 sub exch
-round .25 add exch round .25 add exch
-itransform
-}bind def
-/DL{
-SN
-moveto
-SN
-lineto stroke
-}bind def
-/DC{
-newpath 0 360 arc closepath
-}bind def
-/TM matrix def
-/DE{
-TM currentmatrix pop
-translate scale newpath 0 0 .5 0 360 arc closepath
-TM setmatrix
-}bind def
-/RC/rcurveto load def
-/RL/rlineto load def
-/ST/stroke load def
-/MT/moveto load def
-/CL/closepath load def
-/Fr{
-setrgbcolor fill
-}bind def
-/setcmykcolor where{
-pop
-/Fk{
-setcmykcolor fill
-}bind def
-}if
-/Fg{
-setgray fill
-}bind def
-/FL/fill load def
-/LW/setlinewidth load def
-/Cr/setrgbcolor load def
-/setcmykcolor where{
-pop
-/Ck/setcmykcolor load def
-}if
-/Cg/setgray load def
-/RE{
-findfont
-dup maxlength 1 index/FontName known not{1 add}if dict begin
-{
-1 index/FID ne{def}{pop pop}ifelse
-}forall
-/Encoding exch def
-dup/FontName exch def
-currentdict end definefont pop
-}bind def
-/DEFS 0 def
-/EBEGIN{
-moveto
-DEFS begin
-}bind def
-/EEND/end load def
-/CNT 0 def
-/level1 0 def
-/PBEGIN{
-/level1 save def
-translate
-div 3 1 roll div exch scale
-neg exch neg exch translate
-0 setgray
-0 setlinecap
-1 setlinewidth
-0 setlinejoin
-10 setmiterlimit
-[]0 setdash
-/setstrokeadjust where{
-pop
-false setstrokeadjust
-}if
-/setoverprint where{
-pop
-false setoverprint
-}if
-newpath
-/CNT countdictstack def
-userdict begin
-/showpage{}def
-/setpagedevice{}def
-}bind def
-/PEND{
-countdictstack CNT sub{end}repeat
-level1 restore
-}bind def
-end def
-/setpacking where{
-pop
-setpacking
-}if
-%%EndResource
-%%EndProlog
-%%BeginSetup
-%%BeginFeature: *PageSize Default
-<< /PageSize [ 612 792 ] /ImagingBBox null >> setpagedevice
-%%EndFeature
-%%IncludeResource: font Times-Roman
-%%IncludeResource: font Times-Bold
-%%IncludeResource: font Times-Italic
-grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72
-def/PL 792 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron/Zcaron
-/scaron/zcaron/Ydieresis/trademark/quotesingle/Euro/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/space/exclam/quotedbl/numbersign/dollar/percent
-/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen
-/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon
-/semicolon/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O
-/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright/circumflex
-/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y
-/z/braceleft/bar/braceright/tilde/.notdef/quotesinglbase/guillemotleft
-/guillemotright/bullet/florin/fraction/perthousand/dagger/daggerdbl
-/endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut
-/dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash
-/quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen
-/brokenbar/section/dieresis/copyright/ordfeminine/guilsinglleft
-/logicalnot/minus/registered/macron/degree/plusminus/twosuperior
-/threesuperior/acute/mu/paragraph/periodcentered/cedilla/onesuperior
-/ordmasculine/guilsinglright/onequarter/onehalf/threequarters
-/questiondown/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE
-/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex
-/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis
-/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn
-/germandbls/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla
-/egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis
-/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide/oslash
-/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis]def
-/Times-Italic at 0 ENC0/Times-Italic RE/Times-Bold at 0 ENC0/Times-Bold RE
-/Times-Roman at 0 ENC0/Times-Roman RE
-%%EndSetup
-%%Page: 1 1
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 144.245(mbprocess\(1\) MB\255System)72 48 R
-144.245(5.0 mbprocess\(1\))2.5 F/F1 10.95/Times-Bold at 0 SF -.219(NA)72 84
-S(ME).219 E/F2 10/Times-Bold at 0 SF(mbpr)108 96 Q(ocess)-.18 E F0 2.519
-<ad74>2.519 G .018(his program performs a v)-2.519 F .018(ariety of sw)
--.25 F .018(ath data processing functions in a single step \(producing)
--.1 F 3.647(as)108 108 S 1.147(ingle output sw)-3.647 F 1.148
-(ath data \214le\), including mer)-.1 F 1.148(ging na)-.18 F(vig)-.2 E
-1.148(ation, recalculating bath)-.05 F 1.148(ymetry from tra)-.05 F -.15
-(ve)-.2 G 3.648(lt).15 G(ime)-3.648 E .32
-(and angle data by raytracing through a layered w)108 120 R .319
-(ater sound v)-.1 F .319(elocity model, applying changes to ship draft,)
--.15 F(roll bias and pitch bias, applying tides, and applying bath)108
-132 Q(ymetry edits from edit sa)-.05 E .3 -.15(ve \214)-.2 H(les.).15 E
-F1(VERSION)72 160.8 Q F0 -1.11(Ve)108 172.8 S(rsion 5.0)1.11 E F1
-(SYNOPSIS)72 201.6 Q F2(mbpr)108 213.6 Q(ocess \255I)-.18 E/F3 10
-/Times-Italic at 0 SF(in\214le)A F0([)2.5 E F2<ad46>A F3(format)A F2
-<ad4e20ad4f>2.5 E F3(out\214le)A F2<ad5020ad5320ad5420ad5620ad48>2.5 E
-F0(])A F1(DESCRIPTION)72 242.4 Q F0 .116(The program)108 254.4 R F2
-(mbpr)2.616 E(ocess)-.18 E F0 .116(is a tool for processing sw)2.616 F
-.116(ath sonar bath)-.1 F .116(ymetry data.)-.05 F .117
-(This program can perform a)5.116 F -.25(va)108 266.4 S 1.737
-(riety of sw).25 F 1.736(ath data processing functions in a single step\
- \(producing a single output sw)-.1 F 1.736(ath data \214le\),)-.1 F
-(including:)108 278.4 Q 2.5<ad4d>120.5 290.4 S(er)-2.5 E(ge edited na)
--.18 E(vig)-.2 E(ation generated by)-.05 E F2(mbna)2.5 E -.1(ve)-.25 G
-(dit).1 E F0(.)A 2.5<ad41>120.5 302.4 S(pply bath)-2.5 E
-(ymetry edit \215ags from)-.05 E F2(mbedit)2.5 E F0(and)125.5 314.4 Q F2
-(mbclean)2.5 E F0 2.5<ad52>120.5 326.4 S(ecalculate bath)-2.5 E
-(ymetry from ra)-.05 E 2.5(wt)-.15 G(ra)-2.5 E -.15(ve)-.2 G 2.5(lt).15
-G(ime and)-2.5 E(angle data by raytracing through w)125.5 338.4 Q
-(ater sound speed)-.1 E(models from)125.5 350.4 Q F2(mb)2.5 E -.1(ve)
--.15 G(locitytool).1 E F0(or)2.5 E F2(mbsvplist)2.5 E F0(.)A 2.5<ad41>
-120.5 362.4 S(pply changes to roll bias, pitch bias, heading)-2.5 E
-(bias, and draft v)125.5 374.4 Q(alues.)-.25 E 2.5<ad52>120.5 386.4 S
-(ecalculate sidescan from ra)-2.5 E 2.5(wb)-.15 G(ackscatter samples)
--2.5 E(\(Simrad multibeam data only\).)125.5 398.4 Q 2.5<ad41>120.5
-410.4 S(pply corrections to sidescan based on amplitude vs)-2.5 E
-(grazing angle tables obtained with)125.5 422.4 Q F2(mb)2.5 E(backangle)
--.1 E F0(.)A 2.5<ad41>120.5 434.4 S(pply tides to bath)-2.5 E(ymetry)
--.05 E(.)-.65 E 2.5<ad49>120.5 446.4 S(nsert metadata.)-2.5 E .8
-(The actions of)108 470.4 R F2(mbpr)3.3 E(ocess)-.18 E F0 .801
-(are controlled by te)3.3 F .801(xt parameter \214les. Each)-.15 F F2
-(mbpr)3.301 E(ocess)-.18 E F0 .801(parameter \214le contains)3.301 F
-.356(single line commands that set processing modes and parameters. The\
- program)108 482.4 R F2(mbset)2.856 E F0 .356(can be used to create)
-2.856 F 1.974(and modify)108 494.4 R F2(mbpr)4.474 E(ocess)-.18 E F0
-1.974(parameter \214les.)4.474 F 1.975(Other programs such as)6.974 F F2
-(mbedit)4.475 E F0(,)A F2(mbna)4.475 E -.1(ve)-.25 G(dit).1 E F0(,)A F2
-(mb)4.475 E -.1(ve)-.15 G(locitytool).1 E F0(,)A F2(mbna)108 506.4 Q -.1
-(va)-.25 G(djust).1 E F0 2.5(,a)C(nd)-2.5 E F2(mbclean)2.5 E F0
-(modify or create \(if needed\))2.5 E F2(mbpr)2.5 E(ocess)-.18 E F0
-(parameter \214les.)2.5 E .904(The input \214le "in\214le")108 530.4 R
-.904(must be speci\214ed with the)5.904 F F2<ad49>3.404 E F0 3.404
-(option. If)3.404 F .904("in\214le" is a datalist, then)3.404 F F2(mbpr)
-3.403 E(ocess)-.18 E F0(will)3.403 E .275(attempt to process each sw)108
-542.4 R .276(ath data \214le identi\214ed by recursi)-.1 F -.15(ve)-.25
-G .276(ly reading the datalist. Otherwise,).15 F F2(mbpr)2.776 E(ocess)
--.18 E F0(will attempt to process "in\214le" directly)108 554.4 Q(.)-.65
-E -.15(Fo)108 578.4 S 4.638(ra).15 G 2.438 -.15(ny s)-4.638 H -.1(wa).15
-G 2.137(th data \214le "data\214le", the program will look for and use \
-a parameter \214le with the name).1 F .357
-("data\214le.par". If no parameter \214le e)108 590.4 R(xists,)-.15 E F2
-(mbpr)2.857 E(ocess)-.18 E F0 .358
-(will infer a reasonable processing path by looking for)2.857 F(na)108
-602.4 Q(vig)-.2 E .827(ation and mbedit edit sa)-.05 F 1.127 -.15
-(ve \214)-.2 H .827(les.The data format can also be speci\214ed, though\
- the program can infer).15 F .992
-(the format if the standard MB\255System suf)108 614.4 R .992(\214x con)
--.25 F -.15(ve)-.4 G .992
-(ntion is used \(*.mbXX where XX is the MB\255System).15 F
-(format id number\).)108 626.4 Q .529(The processed output sw)108 650.4
-R .529(ath \214les produced by)-.1 F F2(mbpr)3.029 E(ocess)-.18 E F0
-.529(are named using a con)3.029 F -.15(ve)-.4 G .528
-(ntion based on the data).15 F .488(format id.)108 662.4 R F2
-(MB\255System)5.488 E F0 .488(data formats are speci\214ed using tw)
-2.988 F .489(o\255digit or three\255digit numbers \(see the)-.1 F F2
-(MBIO)2.989 E F0 1.504(manual page\).)108 674.4 R 1.504(If an input sw)
-6.504 F 1.503(ath data \214le is named "root.mbXX", where XX is the for\
-mat id, then the)-.1 F(def)108 686.4 Q 2.67(ault processed output \214l\
-e will be "rootp.mbXX" \(e.g. mydata.mb71 \255> mydatap.mb71\).)-.1 F
-2.67(The "p")7.67 F .949(inserted before the ".mbXX" suf)108 698.4 R
-.948(\214x indicates the output \214le has been created by)-.25 F F2
-(mbpr)3.448 E(ocess)-.18 E F0 5.948(.I)C 3.448(ft)-5.948 G .948
-(he input)-3.448 F .475(\214le does not follo)108 710.4 R 2.975(wt)-.25
-G .475(he *.mbXX naming con)-2.975 F -.15(ve)-.4 G .475
-(ntion, then the output \214lename will just consist of the input).15 F
-(name with "p.mbXX" added as a suf)108 722.4 Q
-(\214x \(e.g. mydata \255> mydatap.mb71\))-.25 E(MB\255System 5.0)72 768
-Q(10 No)129.895 E -.15(ve)-.15 G(mber 2014).15 E(1)190.545 E 0 Cg EP
-%%Page: 2 2
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 144.245(mbprocess\(1\) MB\255System)72 48 R
-144.245(5.0 mbprocess\(1\))2.5 F .798(By def)108 84 R(ault,)-.1 E/F1 10
-/Times-Bold at 0 SF(mbpr)3.298 E(ocess)-.18 E F0 .798
-(will only process a sw)3.298 F .798
-(ath data \214le if the processed output \214le is either missing or)-.1
-F .415(out of date relati)108 96 R .715 -.15(ve t)-.25 H 2.915(ot).15 G
-.415(he input sw)-2.915 F .415
-(ath data \214le, the parameter \214le, or an)-.1 F 2.915(yo)-.15 G
-2.915(ft)-2.915 G .415(he ancillary data \214les referred)-2.915 F .214
-(to in the parameter \214le \(e.g. na)108 108 R(vig)-.2 E .214
-(ation \214les, edit sa)-.05 F .514 -.15(ve \214)-.2 H .214
-(les, svp \214les\). If the).15 F F1<ad50>2.713 E F0 .213
-(option is speci\214ed,)2.713 F F1(mbpr)2.713 E(o-)-.18 E(cess)108 120 Q
-F0(will process e)2.5 E -.15(ve)-.25 G
-(ry \214le, whether it needs it or not.).15 E/F2 10.95/Times-Bold at 0 SF
-(MBPR)72 148.8 Q(OCESS P)-.329 E(ARAMETER FILE COMMANDS)-.81 E F0(The)
-108 160.8 Q F1(mbpr)2.5 E(ocess)-.18 E F0
-(commands found in parameter \214les are:)2.5 E(GENERAL P)110.5 184.8 Q
-(ARAMETERS:)-.92 E(EXPLICIT)115.5 196.8 Q
-(causes mbprocess to set modes implicitely)128 208.8 Q 2.5<ad65>128
-220.8 S(.g. the SVPFILE command will also set)-2.5 E(raytracing on e)133
-232.8 Q -.15(ve)-.25 G 2.5(ni).15 G 2.5(ft)-2.5 G(he RA)-2.5 E(YTRA)
--1.05 E(CE command)-.4 E(is not gi)133 244.8 Q -.15(ve)-.25 G 2.5(n[).15
-G -.15(ex)-2.5 G(plicit mode commands required]).15 E(FORMA)115.5 256.8
-Q 2.5(Tc)-1.11 G(onstant)-2.5 E(sets format id [no def)128 268.8 Q
-(ault])-.1 E(INFILE \214lename)115.5 280.8 Q
-(sets input \214le path [no def)128 292.8 Q(ault])-.1 E
-(OUTFILE \214lename)115.5 304.8 Q(sets output \214le path [no def)128
-316.8 Q(ault])-.1 E -.35(NA)110.5 340.8 S(VIGA)-1 E(TION MERGING:)-1.11
-E -.35(NA)115.5 352.8 S(VMODE boolean)-1 E(sets na)128 364.8 Q(vig)-.2 E
-(ation mer)-.05 E(ging [0])-.18 E(0: na)133 376.8 Q(vig)-.2 E(ation mer)
--.05 E(ge of)-.18 E(f)-.25 E(1: na)133 388.8 Q(vig)-.2 E(ation mer)-.05
-E(ge on)-.18 E -.35(NA)115.5 400.8 S(VFILE \214lename)-1 E(sets na)128
-412.8 Q(vig)-.2 E(ation \214le path [no def)-.05 E(ault])-.1 E -.35(NA)
-115.5 424.8 S(VFORMA)-1 E 2.5(Tc)-1.11 G(onstant)-2.5 E(sets na)128
-436.8 Q(vig)-.2 E(ation \214le format [9])-.05 E(see belo)144 448.8 Q
-2.5(wf)-.25 G(or documentation of the)-2.5 E(supported na)144 460.8 Q
-(vig)-.2 E(ation formats)-.05 E -.35(NA)115.5 472.8 S(VHEADING boolean)
--1 E(sets heading to be mer)128 484.8 Q(ged from na)-.18 E(vig)-.2 E
-(ation \214le)-.05 E 2.5<ad6e>128 496.8 S(ote: heading mer)-2.5 E
-(ged from na)-.18 E(vig)-.2 E(ation before)-.05 E
-(heading correction applied)133 508.8 Q(0: heading not changed)133 520.8
-Q(1: heading mer)133 532.8 Q(ged from na)-.18 E(vig)-.2 E(ation \214le)
--.05 E -.35(NA)115.5 544.8 S(VSPEED boolean)-1 E(sets speed to be mer)
-128 556.8 Q(ged from na)-.18 E(vig)-.2 E(ation \214le)-.05 E
-(0: speed not changed)133 568.8 Q(1: speed mer)133 580.8 Q(ged from na)
--.18 E(vig)-.2 E(ation \214le)-.05 E -.35(NA)115.5 592.8 S
-(VDRAFT boolean)-1 E(sets draft to be mer)128 604.8 Q(ged from na)-.18 E
-(vig)-.2 E(ation \214le)-.05 E 2.5<ad6e>128 616.8 S(ote: draft mer)-2.5
-E(ged from na)-.18 E(vig)-.2 E(ation before)-.05 E
-(draft correction applied)133 628.8 Q(0: draft not changed)133 640.8 Q
-(1: draft mer)133 652.8 Q(ged from na)-.18 E(vig)-.2 E(ation \214le)-.05
-E -.35(NA)115.5 664.8 S -.91 -1.35(VA T)-1 H(TITUDE boolean)1.35 E
-(sets roll, pitch and hea)128 676.8 Q .3 -.15(ve t)-.2 H 2.5(ob).15 G
-2.5(em)-2.5 G(er)-2.5 E(ged from)-.18 E(na)128 688.8 Q(vig)-.2 E
-(ation \214le)-.05 E 2.5<ad6e>128 700.8 S(ote: roll, pitch, and hea)-2.5
-E .3 -.15(ve m)-.2 H(er).15 E(ged from)-.18 E(na)133 712.8 Q(vig)-.2 E
-(ation before roll bias and pitch bias)-.05 E(corrections applied)133
-724.8 Q(MB\255System 5.0)72 768 Q(10 No)129.895 E -.15(ve)-.15 G
-(mber 2014).15 E(2)190.545 E 0 Cg EP
-%%Page: 3 3
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 144.245(mbprocess\(1\) MB\255System)72 48 R
-144.245(5.0 mbprocess\(1\))2.5 F(0: roll, pitch, and hea)133 84 Q .3
--.15(ve n)-.2 H(ot changed).15 E(1: roll, pitch, and hea)133 96 Q .3
--.15(ve m)-.2 H(er).15 E(ged from)-.18 E(na)140.5 108 Q(vig)-.2 E
-(ation \214le)-.05 E -.35(NA)115.5 120 S(VINTERP boolean)-1 E(sets na)
-128 132 Q(vig)-.2 E(ation interpolation algorithm [0])-.05 E
-(0: linear interpolation \(recommended\))133 144 Q
-(1: spline interpolation)133 156 Q -.35(NA)115.5 168 S
-(VTIMESHIFT constant)-1 E(sets na)128 180 Q(vig)-.2 E
-(ation time shift \(seconds\) [0.0])-.05 E 2.5<ad6e>128 192 S
-(ote: time shift added to timestamps of)-2.5 E(na)133 204 Q(vig)-.2 E
-(ation \214x)-.05 E(es read in from N)-.15 E -1.35(AV)-.35 G(FILE)1.35 E
-(prior to mer)133 216 Q(ging)-.18 E -.35(NA)110.5 240 S(VIGA)-1 E
-(TION OFFSETS AND SHIFTS:)-1.11 E 2.5<ad54>128 252 S(hese of)-2.5 E
-(fsets and shifts will be applied to the)-.25 E(original na)133 264 Q
-(vig)-.2 E(ation and to an)-.05 E 2.5(ym)-.15 G(er)-2.5 E(ged na)-.18 E
-(vig)-.2 E(ation,)-.05 E -.2(bu)133 276 S 2.5(tw).2 G
-(ill not be applied to adjusted na)-2.5 E(vig)-.2 E(ation)-.05 E
-(\(because generally adjusted na)133 288 Q(vig)-.2 E(ation generated)
--.05 E(by mbna)133 300 Q -.25(va)-.2 G(djust already has of).25 E
-(fsets and shifts)-.25 E(applied\).)133 312 Q -.35(NA)115.5 324 S
-(VSHIFT boolean)-1 E(sets na)128 336 Q(vig)-.2 E(ation of)-.05 E
-(fset [0])-.25 E 2.5<ad6e>128 348 S(ote: of)-2.5 E
-(fsets and shifts are applied to na)-.25 E(vig)-.2 E(ation)-.05 E -.25
-(va)133 360 S(lues from both surv).25 E .3 -.15(ey a)-.15 H(nd na).15 E
-(vig)-.2 E(ation records, and)-.05 E(are applied to na)133 372 Q(vig)-.2
-E(ation read in from)-.05 E -.35(NA)133 384 S(VFILE prior to mer)-1 E
-(ging)-.18 E 2.5<ad6e>128 396 S(ote: of)-2.5 E(fsets and shifts are NO)
--.25 E 2.5(Ta)-.4 G(pplied to adjusted)-2.5 E(na)133 408 Q(vig)-.2 E
-(ation v)-.05 E(alues from N)-.25 E -1.35(AVA)-.35 G(DJFILE)1.35 E -.35
-(NA)115.5 420 S -.4(VO)-1 G(FFSETX constant).4 E(sets na)128 432 Q(vig)
--.2 E(ation athw)-.05 E(artship of)-.1 E(fset \(meters\) [0.0])-.25 E
-2.5<ad6e>128 444 S(ote: the ef)-2.5 E(fecti)-.25 E .3 -.15(ve n)-.25 H
--.2(av).15 G(ig).2 E(ation shift is)-.05 E(\(N)133 456 Q -.2 -1.35(AV O)
--.35 H(FFSETX \255 SON)1.35 E(AR)-.35 E(OFFSETX\), and the)-.4 E(na)133
-468 Q(vig)-.2 E(ation is corrected by subtracting)-.05 E(this ef)133 480
-Q(fecti)-.25 E .3 -.15(ve s)-.25 H(hift.).15 E 2.5<ad6e>128 492 S
-(ote: athw)-2.5 E(artship shift is positi)-.1 E .3 -.15(ve t)-.25 H(o)
-.15 E(starboard.)133 504 Q -.35(NA)115.5 516 S -.4(VO)-1 G
-(FFSETY constant).4 E(sets na)128 528 Q(vig)-.2 E(ation fore\255aft of)
--.05 E(fset \(meters\) [0.0])-.25 E 2.5<ad6e>128 540 S(ote: the ef)-2.5
-E(fecti)-.25 E .3 -.15(ve n)-.25 H -.2(av).15 G(ig).2 E(ation shift is)
--.05 E(\(N)133 552 Q -.2 -1.35(AV O)-.35 H(FFSETY \255 SON)1.35 E(AR)
--.35 E(OFFSETY\), and the)-.4 E(na)133 564 Q(vig)-.2 E
-(ation is corrected by subtracting)-.05 E(this ef)133 576 Q(fecti)-.25 E
-.3 -.15(ve s)-.25 H(hift.).15 E 2.5<ad6e>128 588 S
-(ote: fore\255aft shift is positi)-2.5 E .3 -.15(ve f)-.25 H(orw).15 E
-(ard.)-.1 E -.35(NA)115.5 600 S -.4(VO)-1 G(FFSETZ constant).4 E
-(sets na)128 612 Q(vig)-.2 E(ation v)-.05 E(ertical of)-.15 E
-(fset \(meters\) [0.0])-.25 E 2.5<ad6e>128 624 S(ote: this v)-2.5 E
-(alue is not yet used for)-.25 E(an)133 636 Q(ything.)-.15 E 2.5<ad6e>
-128 648 S(ote: v)-2.5 E(ertical shift is positi)-.15 E .3 -.15(ve d)-.25
-H -.25(ow).15 G(n.).25 E -.35(NA)115.5 660 S(VSHIFTLON constant)-1 E
-(sets na)128 672 Q(vig)-.2 E(ation longitude shift \(de)-.05 E
-(grees\) [0.0])-.15 E -.35(NA)115.5 684 S(VSHIFTLA)-1 E 2.5(Tc)-1.11 G
-(onstant)-2.5 E(sets na)128 696 Q(vig)-.2 E(ation latitude shift \(de)
--.05 E(grees\) [0.0])-.15 E(ADJUSTED N)110.5 720 Q -1.35(AV)-.35 G(IGA)
-1.35 E(TION MERGING:)-1.11 E(MB\255System 5.0)72 768 Q(10 No)129.895 E
--.15(ve)-.15 G(mber 2014).15 E(3)190.545 E 0 Cg EP
-%%Page: 4 4
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 144.245(mbprocess\(1\) MB\255System)72 48 R
-144.245(5.0 mbprocess\(1\))2.5 F -.35(NA)115.5 84 S -1.35(VA)-1 G
-(DJMODE mode)1.35 E(sets na)128 96 Q(vig)-.2 E(ation mer)-.05 E
-(ging from mbna)-.18 E -.25(va)-.2 G(djust [0]).25 E 2.5<ad63>128 108 S
-(an apply to longitude and latitude only)-2.5 E
-(or longitude, latitude, and depth of)133 120 Q(fset)-.25 E
-(0: adjusted na)133 132 Q(vig)-.2 E(ation mer)-.05 E(ge of)-.18 E(f)-.25
-E(1: adjusted na)133 144 Q(vig)-.2 E(ation mer)-.05 E(ge on)-.18 E
-(2: adjusted na)133 156 Q(vig)-.2 E(ation and depth of)-.05 E(fset mer)
--.25 E(ge on)-.18 E -.35(NA)115.5 168 S -1.35(VA)-1 G(DJFILE \214lename)
-1.35 E(sets adjusted na)128 180 Q(vig)-.2 E(ation \214le path)-.05 E 2.5
-<ad74>128 192 S(his \214le supercedes na)-2.5 E(vig)-.2 E
-(ation \214le for)-.05 E(lon and lat only)133 204 Q 2.5<ad75>128 216 S
-(ses mbna)-2.5 E -.25(va)-.2 G(djust output).25 E -.35(NA)115.5 228 S
--1.35(VA)-1 G(DJINTERP boolean)1.35 E(sets adjusted na)128 240 Q(vig)-.2
-E(ation interpolation algorithm [0])-.05 E
-(0: linear interpolation \(recommended\))133 252 Q
-(1: spline interpolation)133 264 Q -1.11(AT)113 288 S(TITUDE MERGING:)
-1.11 E -1.11(AT)118 300 S(TITUDEMODE mode)1.11 E
-(sets attitude \(roll, pitch, and hea)128 312 Q -.15(ve)-.2 G 2.5(\)m)
-.15 G(er)-2.5 E(ging [0])-.18 E 2.5<ad72>128 324 S(oll, pitch, and hea)
--2.5 E .3 -.15(ve m)-.2 H(er).15 E(ged before)-.18 E
-(roll bias and pitch bias corrections applied)133 336 Q 2.5<ad61>128 348
-S(ttitude mer)-2.5 E(ging from a separate \214le supersedes)-.18 E
-(attitude mer)133 360 Q(ging from a na)-.18 E(vig)-.2 E(ation \214le)
--.05 E(0: attitude mer)133 372 Q(ging of)-.18 E(f)-.25 E
-(1: attitude mer)133 384 Q(ging on)-.18 E -1.11(AT)118 396 S
-(TITUDEFILE \214lename)1.11 E(sets attitude \214le path)128 408 Q -1.11
-(AT)118 420 S(TITUDEFORMA)1.11 E 2.5(Tc)-1.11 G(onstant)-2.5 E
-(sets attitude \214le format [1])128 432 Q 2.5<ad61>128 444 S
-(ttitude \214les can be in one of four ASCII)-2.5 E(table formats)133
-456 Q(1: format is <time_d roll pitch hea)133 468 Q -.15(ve)-.2 G(>).15
-E(2: format is <yr mon day hour min sec roll pitch hea)133 480 Q -.15
-(ve)-.2 G(>).15 E(3: format is <yr jday hour min sec roll pitch hea)133
-492 Q -.15(ve)-.2 G(>).15 E
-(4: format is <yr jday daymin sec roll pitch hea)133 504 Q -.15(ve)-.2 G
-(>).15 E 2.5<ad74>128 516 S(ime_d = decimal seconds since 1/1/1970)-2.5
-E 2.5<ad64>128 528 S(aymin = decimal minutes start of day)-2.5 E 2.5
-<ad72>128 540 S(oll = positi)-2.5 E .3 -.15(ve s)-.25 H(tarboard up, de)
-.15 E(grees)-.15 E 2.5<ad70>128 552 S(itch = positi)-2.5 E .3 -.15(ve f)
--.25 H(orw).15 E(ard up, de)-.1 E(grees)-.15 E 2.5<ad68>128 564 S(ea)
--2.5 E .3 -.15(ve = p)-.2 H(ositi).15 E .3 -.15(ve u)-.25 H(p, meters)
-.15 E(SON)113 588 Q(ARDEPTH MERGING:)-.35 E(SON)118 600 Q
-(ARDEPTHMODE mode)-.35 E(sets sonardepth mer)128 612 Q(ging [0])-.18 E
-2.5<ad73>128 624 S(onardepth mer)-2.5 E(ged before)-.18 E
-(draft corrections applied)133 636 Q 2.5<ad73>128 648 S(onardepth mer)
--2.5 E(ging from a separate \214le supersedes)-.18 E(draft mer)133 660 Q
-(ging from a na)-.18 E(vig)-.2 E(ation \214le)-.05 E(0: sonardepth mer)
-133 672 Q(ging of)-.18 E(f)-.25 E(1: sonardepth mer)133 684 Q(ging on)
--.18 E(SON)118 696 Q(ARDEPTHFILE \214lename)-.35 E
-(sets sonardepth \214le path)128 708 Q(SON)118 720 Q(ARDEPTHFORMA)-.35 E
-2.5(Tc)-1.11 G(onstant)-2.5 E(MB\255System 5.0)72 768 Q(10 No)129.895 E
--.15(ve)-.15 G(mber 2014).15 E(4)190.545 E 0 Cg EP
-%%Page: 5 5
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 144.245(mbprocess\(1\) MB\255System)72 48 R
-144.245(5.0 mbprocess\(1\))2.5 F(sets sonardepth \214le format [1])128
-84 Q 2.5<ad73>128 96 S(onardepth \214les can be in one of four ASCII)
--2.5 E(table formats)133 108 Q(1: format is <time_d sonardepth>)133 120
-Q(2: format is <yr mon day hour min sec sonardepth>)133 132 Q
-(3: format is <yr jday hour min sec sonardepth>)133 144 Q
-(4: format is <yr jday daymin sec sonardepth>)133 156 Q 2.5<ad74>128 168
-S(ime_d = decimal seconds since 1/1/1970)-2.5 E 2.5<ad64>128 180 S
-(aymin = decimal minutes start of day)-2.5 E 2.5<ad73>128 192 S
-(onardepth = sonar depth positi)-2.5 E .3 -.15(ve d)-.25 H -.25(ow).15 G
-(n, meters).25 E -.4(DA)110.5 216 S 1.86 -.93(TA C)-.71 H(UTTING:).93 E
--.4(DA)115.5 228 S -1.04 -.93(TA C)-.71 H(UTCLEAR).93 E(remo)128 240 Q
--.15(ve)-.15 G 2.5(sa).15 G(ll e)-2.5 E(xisting data cutting commands)
--.15 E -.4(DA)115.5 252 S -1.04 -.93(TA C)-.71 H(UT kind mode min max)
-.93 E(adds ne)128 264 Q 2.5(wd)-.25 G(ata cutting command, where:)-2.5 E
-(kind = 0 : cut applied to bath)133 276 Q(ymetry data)-.05 E
-(kind = 1 : cut applied to amplitude data)133 288 Q
-(kind = 2 : cut applied to sidescan data)133 300 Q
-(mode = 0 : min and max indicate start and end)133 312 Q(beam/pix)160.5
-324 Q(el numbers between which data)-.15 E(are \215agged or zeroed)160.5
-336 Q(mode = 1 : min and max indicate start and end)133 348 Q
-(acrosstrack distance \(m\) between which)160.5 360 Q
-(data are \215agged or zeroed)160.5 372 Q -.35(BA)115.5 384 S
-(THCUTNUMBER min max)-.76 E(adds ne)128 396 Q 2.5(wb)-.25 G(ath)-2.5 E
-(ymetry data cutting command where)-.05 E
-(min and max are the start and end beam numbers)128 408 Q
-(between which data are \215agged \(note that)128 420 Q(\215agging bath)
-128 432 Q(ymetry also \215ags amplitude data\))-.05 E -.35(BA)115.5 444
-S(THCUTDIST)-.76 E(ANCE min max)-.93 E(adds ne)128 456 Q 2.5(wb)-.25 G
-(ath)-2.5 E(ymetry data cutting command where)-.05 E
-(min and max are the start and end acrosstrack)128 468 Q
-(distance \(m\) between which data are \215agged)128 480 Q
-(\(note that \215agging bath)128 492 Q(ymetry also \215ags)-.05 E
-(amplitude data\))128 504 Q -.35(BA)115.5 516 S(THCUTSPEED min max)-.76
-E(adds ne)128 528 Q 2.5(wb)-.25 G(ath)-2.5 E
-(ymetry data cutting command where)-.05 E
-(all beams are \215agged for pings with a ship)128 540 Q(or v)128 552 Q
-(ehicle speed less than min or greater than)-.15 E
-(max \(note that \215agging bath)128 564 Q(ymetry also \215ags)-.05 E
-(amplitude data\))128 576 Q(AMPCUTNUMBER min max)115.5 588 Q(adds ne)128
-600 Q 2.5(wa)-.25 G(mplitude data cutting command where)-2.5 E
-(min and max are the start and end beam numbers)128 612 Q
-(between which amplitude data are zeroed \(note)128 624 Q
-(that zeroing amplitude data has no impact on)128 636 Q(bath)128 648 Q
-(ymetry data\))-.05 E(AMPCUTDIST)115.5 660 Q(ANCE min max)-.93 E
-(adds ne)128 672 Q 2.5(wa)-.25 G(mplitude data cutting command where)
--2.5 E(min and max are the start and end acrosstrack)128 684 Q
-(distance \(m\) between which amplitude data are)128 696 Q
-(zeroed \(note that zeroing amplitude data has)128 708 Q
-(no impact on bath)128 720 Q(ymetry data\))-.05 E(MB\255System 5.0)72
-768 Q(10 No)129.895 E -.15(ve)-.15 G(mber 2014).15 E(5)190.545 E 0 Cg EP
-%%Page: 6 6
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 144.245(mbprocess\(1\) MB\255System)72 48 R
-144.245(5.0 mbprocess\(1\))2.5 F(AMPCUTSPEED min max)115.5 84 Q(adds ne)
-128 96 Q 2.5(wa)-.25 G(mplitude data cutting command where)-2.5 E
-(all amplitude v)128 108 Q(alues are zeroed for pings with)-.25 E 2.5
-(as)128 120 S(hip or v)-2.5 E(ehicle speed less than min or greater)-.15
-E(than max \(note that zeroing amplitude data has)128 132 Q
-(no impact on bath)128 144 Q(ymetry data\))-.05 E(SSCUTNUMBER min max)
-115.5 156 Q(adds ne)128 168 Q 2.5(ws)-.25 G
-(idescan data cutting command where)-2.5 E
-(min and max are the start and end pix)128 180 Q(el numbers)-.15 E
-(between which sidescan data are zeroed)128 192 Q(\(note)5 E
-(that zeroing sidescan data has no impact on)128 204 Q(bath)128 216 Q
-(ymetry data\))-.05 E(SSCUTDIST)115.5 228 Q(ANCE min max)-.93 E(adds ne)
-128 240 Q 2.5(ws)-.25 G(idescan data cutting command where)-2.5 E
-(min and max are the start and end acrosstrack)128 252 Q
-(distance \(m\) between which sidescan data are)128 264 Q 2.5
-(zeroed \(note)128 276 R(that zeroing sidescan data has)2.5 E
-(no impact on bath)128 288 Q(ymetry data\))-.05 E(SSCUTSPEED min max)
-115.5 300 Q(adds ne)128 312 Q 2.5(ws)-.25 G
-(idescan data cutting command where)-2.5 E(all sidescan v)128 324 Q
-(alues are zeroed for pings with)-.25 E 2.5(as)128 336 S(hip or v)-2.5 E
-(ehicle speed less than min or greater)-.15 E
-(than max \(note that zeroing sidescan data has)128 348 Q
-(no impact on bath)128 360 Q(ymetry data\))-.05 E -.35(BA)110.5 384 S
-(THYMETR)-.76 E 2.5(YE)-.65 G(DITING:)-2.5 E(EDITSA)115.5 396 Q
-(VEMODE boolean)-1.35 E(turns on reading edit sa)128 408 Q .3 -.15
-(ve \214)-.2 H(le \(from mbedit\) [0]).15 E(EDITSA)115.5 420 Q
-(VEFILE \214lename)-1.35 E(sets edit sa)128 432 Q .3 -.15(ve \214)-.2 H
-(le path \(from mbedit\) [none]).15 E -.35(BA)110.5 456 S(THYMETR)-.76 E
-2.5(YR)-.65 G(ECALCULA)-2.5 E(TION:)-1.11 E(SVPMODE mode)115.5 468 Q
-(sets usage of a w)128 480 Q(ater sound speed model \(sound)-.1 E -.15
-(ve)128 492 S(locity pro\214le, or SVP\) [0]).15 E(0: bath)130.5 504 Q
-(ymetry recalculation by raytracing of)-.05 E(f)-.25 E(1: bath)130.5 516
-Q(ymetry recalculation by raytracing on)-.05 E
-(2: translate depths from corrected to uncorrected)130.5 528 Q
-(or vice v)138 540 Q(ersa depending on SOUNDSPEEDREF)-.15 E(command)138
-552 Q(SVPFILE \214lename)115.5 564 Q(sets SVP \214le path [no def)128
-576 Q(ault])-.1 E(SSVMODE boolean)115.5 588 Q(sets surf)128 600 Q
-(ace sound v)-.1 E(elocity \(SSV\) mode [0])-.15 E
-(0: use SSV from \214le)130.5 612 Q(1: of)130.5 624 Q
-(fset SSV from \214le \(set by SSV command\))-.25 E
-(2: use constant SSV \(set by SSV command\))130.5 636 Q(SSV constant/of)
-115.5 648 Q(fset)-.25 E(sets SSV v)128 660 Q(alue or of)-.25 E
-(fset \(m/s\) [1500.0])-.25 E(ANGLEMODE mode)115.5 672 Q
-(sets handling of beam angles during)128 684 Q(raytracing [1])128 696 Q
-(0: angles not changed before raytracing)130.5 708 Q
-(1: angles adjusted using Snell')130.5 720 Q 2.5(sL)-.55 G .3 -.15(aw f)
--2.5 H(or).15 E(MB\255System 5.0)72 768 Q(10 No)129.895 E -.15(ve)-.15 G
-(mber 2014).15 E(6)190.545 E 0 Cg EP
-%%Page: 7 7
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 144.245(mbprocess\(1\) MB\255System)72 48 R
-144.245(5.0 mbprocess\(1\))2.5 F(the dif)138 84 Q
-(ference between the surf)-.25 E(ace sound)-.1 E -.15(ve)138 96 S
-(locity \(SSV\) and the sound speed at).15 E(the sonar depth in the SVP)
-138 108 Q(.)-1.11 E(2: angles adjusted using Snell')130.5 120 Q 2.5(sL)
--.55 G .3 -.15(aw a)-2.5 H(nd).15 E(the sonar array geometry for the)138
-132 Q(dif)138 144 Q(ference between the surf)-.25 E(ace sound)-.1 E -.15
-(ve)138 156 S(locity \(SSV\) and the sound speed at).15 E
-(the sonar depth in the SVP)138 168 Q(.)-1.11 E(TTMUL)115.5 180 Q(TIPL)
--.92 E 2.5(Ym)-1 G(ultiplier)-2.5 E(sets v)128 192 Q
-(alue multiplied by tra)-.25 E -.15(ve)-.2 G 2.5(lt).15 G(imes [1.0])
--2.5 E(SOUNDSPEEDREF boolean)115.5 204 Q
-(determines the handling of the sound)128 216 Q
-(speed reference for bath)128 228 Q(ymetry [1])-.05 E 2.5<ad6e>128 240 S
-(ote: if raytracing is turned of)-2.5 E 2.5(ft)-.25 G(hen)-2.5 E
-(this command implies correcting or)133 252 Q
-(uncorrecting using the SVP speci\214ed)133 264 Q
-(with the SVPFILE command)133 276 Q(0: produce "uncorrected" bath)130.5
-288 Q(ymetry)-.05 E(referenced to a uniform 1500 m/s)138 300 Q -.1(wa)
-138 312 S(ter sound speed model.).1 E(1: produce "corrected" bath)130.5
-324 Q(ymetry)-.05 E(referenced to a realistic w)138 336 Q(ater)-.1 E
-(sound speed model.)138 348 Q(ST)110.5 372 Q -1.11(AT)-.93 G(IC BEAM B)
-1.11 E -1.11(AT)-.35 G(HYMETR)1.11 E 2.5(YO)-.65 G(FFSETS:)-2.5 E(ST)
-115.5 384 Q -1.11(AT)-.93 G(ICMODE mode)1.11 E(sets of)128 396 Q
-(fsetting of bath)-.25 E(ymetry by)-.05 E(per)128 408 Q
-(-beam statics [0])-.2 E(0: static correction of)133 420 Q(f)-.25 E
-(1: static correction by beam number)133 432 Q
-(2: static correction by acrosstrack beam angle)133 444 Q(ST)115.5 456 Q
--1.11(AT)-.93 G(ICFILE \214lename)1.11 E(sets static per)128 468 Q
-(-beam \214le path [no def)-.2 E(ault])-.1 E 2.5<ad73>128 480 S
-(tatic \214les are tw)-2.5 E(o-column ascii tables)-.1 E 2.5<ad69>128
-492 S 2.5(fc)-2.5 G(orrection is by beam number then)-2.5 E
-(the beam # is in column 1 and)133 504 Q(the depth of)133 516 Q
-(fset is in m in column 2)-.25 E 2.5<ad69>128 528 S 2.5(fc)-2.5 G
-(orrection is by beam angle then)-2.5 E
-(the beam angle \(starboard positi)133 540 Q -.15(ve)-.25 G(\)).15 E
-(is in column 1 and)133 552 Q(the depth of)133 564 Q
-(fset is in m in column 2)-.25 E(DRAFT CORRECTION:)110.5 588 Q
-(DRAFTMODE mode)115.5 600 Q(sets draft correction [0])128 612 Q 2.5
-<ad6e>128 624 S(ote: draft mer)-2.5 E(ged from na)-.18 E(vig)-.2 E
-(ation before)-.05 E(draft correction applied)133 636 Q
-(0: no draft correction)133 648 Q(1: draft correction by of)133 660 Q
-(fset)-.25 E(2: draft correction by multiply)133 672 Q
-(3: draft correction by of)133 684 Q(fset and multiply)-.25 E
-(4: draft set to constant)133 696 Q(DRAFT constant)115.5 708 Q
-(sets draft v)128 720 Q(alue \(m\) [0.0])-.25 E(MB\255System 5.0)72 768
-Q(10 No)129.895 E -.15(ve)-.15 G(mber 2014).15 E(7)190.545 E 0 Cg EP
-%%Page: 8 8
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 144.245(mbprocess\(1\) MB\255System)72 48 R
-144.245(5.0 mbprocess\(1\))2.5 F(DRAFT)115.5 84 Q(OFFSET of)-.18 E(fset)
--.25 E(sets v)128 96 Q(alue added to draft \(m\) [0.0])-.25 E(DRAFTMUL)
-115.5 108 Q(TIPL)-.92 E 2.5(Ym)-1 G(ultiplier)-2.5 E(sets v)128 120 Q
-(alue multiplied by draft [1.0])-.25 E(HEA)110.5 144 Q(VE CORRECTION:)
--1.35 E(HEA)115.5 156 Q(VEMODE mode)-1.35 E(sets hea)128 168 Q .3 -.15
-(ve c)-.2 H(orrection [0]).15 E 2.5<ad6e>128 180 S(ote: hea)-2.5 E .3
--.15(ve c)-.2 H(orrection by of).15 E(fset and/or)-.25 E
-(multiplication is added to an)133 192 Q 2.5(yl)-.15 G -2.15 -.25(ev e)
--2.5 H(r).25 E(hea)133 204 Q .3 -.15(ve c)-.2 H
-(orrection, and then either used in).15 E(bath)133 216 Q
-(ymetry recalculation or added to)-.05 E -.15(ex)133 228 S(isting bath)
-.15 E(ymetry)-.05 E(0: no hea)133 240 Q .3 -.15(ve c)-.2 H(orrection).15
-E(1: hea)133 252 Q .3 -.15(ve c)-.2 H(orrection by of).15 E(fset)-.25 E
-(2: hea)133 264 Q .3 -.15(ve c)-.2 H(orrection by multiply).15 E(3: hea)
-133 276 Q .3 -.15(ve c)-.2 H(orrection by of).15 E(fset and multiply)
--.25 E(HEA)115.5 288 Q(VEOFFSET of)-1.35 E(fset)-.25 E(sets v)128 300 Q
-(alue added to hea)-.25 E .3 -.15(ve \()-.2 H(m\)).15 E(HEA)115.5 312 Q
-(VEMUL)-1.35 E(TIPL)-.92 E 2.5(Ym)-1 G(ultiplier)-2.5 E(sets v)128 324 Q
-(alue multiplied by hea)-.25 E -.15(ve)-.2 G(LEVER CORRECTION:)110.5 348
-Q(LEVERMODE mode)115.5 360 Q(sets hea)128 372 Q .3 -.15(ve c)-.2 H
-(orrection by le).15 E -.15(ve)-.25 G 2.5(rc).15 G(alculation [0])-2.5 E
-2.5<ad6e>128 384 S(ote: le)-2.5 E -.15(ve)-.25 G 2.5(rh).15 G(ea)-2.5 E
-.3 -.15(ve c)-.2 H(orrection is added to).15 E(an)133 396 Q 2.5(yh)-.15
-G(ea)-2.5 E .3 -.15(ve c)-.2 H(orrection by of).15 E(fset and/or)-.25 E
-(multiplication, and then either used in)133 408 Q(bath)133 420 Q
-(ymetry recalculation or added to)-.05 E -.15(ex)133 432 S(isting bath)
-.15 E(ymetry)-.05 E(0: no le)133 444 Q -.15(ve)-.25 G 2.5(rc).15 G
-(alculation)-2.5 E(1: hea)133 456 Q .3 -.15(ve c)-.2 H(orrection by le)
-.15 E -.15(ve)-.25 G 2.5(rc).15 G(alculation)-2.5 E(VR)115.5 468 Q
-(UOFFSETX constant)-.4 E(sets athw)128 480 Q(artships of)-.1 E
-(fset of attitude sensor \(m\))-.25 E 2.5<ad6e>128 492 S(ote: positi)
--2.5 E .3 -.15(ve t)-.25 H 2.5(os).15 G(tarboard)-2.5 E(VR)115.5 504 Q
-(UOFFSETY constant)-.4 E(sets fore\255aft of)128 516 Q
-(fset of attitude sensor \(m\))-.25 E 2.5<ad6e>128 528 S(ote: positi)
--2.5 E .3 -.15(ve f)-.25 H(orw).15 E(ard)-.1 E(VR)115.5 540 Q
-(UOFFSETZ constant)-.4 E(sets v)128 552 Q(ertical of)-.15 E
-(fset of attitude sensor \(m\))-.25 E 2.5<ad6e>128 564 S(ote: positi)
--2.5 E .3 -.15(ve d)-.25 H -.25(ow).15 G(n).25 E(SON)115.5 576 Q(AR)-.35
-E(OFFSETX constant)-.4 E(sets athw)128 588 Q(artships of)-.1 E
-(fset of sonar recei)-.25 E .3 -.15(ve a)-.25 H(rray \(m\)).15 E 2.5
-<ad6e>128 600 S(ote: positi)-2.5 E .3 -.15(ve t)-.25 H 2.5(os).15 G
-(tarboard)-2.5 E(SON)115.5 612 Q(AR)-.35 E(OFFSETY constant)-.4 E
-(sets fore\255aft of)128 624 Q(fset of sonar recei)-.25 E .3 -.15(ve a)
--.25 H(rray \(m\)).15 E 2.5<ad6e>128 636 S(ote: positi)-2.5 E .3 -.15
-(ve f)-.25 H(orw).15 E(ard)-.1 E(SON)115.5 648 Q(AR)-.35 E
-(OFFSETZ constant)-.4 E(sets v)128 660 Q(ertical of)-.15 E
-(fset of sonar recei)-.25 E .3 -.15(ve a)-.25 H(rray \(m\)).15 E 2.5
-<ad6e>128 672 S(ote: positi)-2.5 E .3 -.15(ve d)-.25 H -.25(ow).15 G(n)
-.25 E -.4(RO)110.5 696 S(LL CORRECTION:).4 E -.4(RO)115.5 708 S
-(LLBIASMODE mode).4 E(sets roll correction [0])128 720 Q
-(MB\255System 5.0)72 768 Q(10 No)129.895 E -.15(ve)-.15 G(mber 2014).15
-E(8)190.545 E 0 Cg EP
-%%Page: 9 9
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 144.245(mbprocess\(1\) MB\255System)72 48 R
-144.245(5.0 mbprocess\(1\))2.5 F(0: no roll correction)133 84 Q
-(1: roll correction by single roll bias)133 96 Q
-(2: roll correction by separate port and)133 108 Q(starboard roll bias)
-140.5 120 Q -.4(RO)115.5 132 S(LLBIAS of).4 E(fset)-.25 E
-(sets roll bias \(de)128 144 Q(grees\))-.15 E -.4(RO)115.5 156 S
-(LLBIASPOR).4 E 2.5(To)-.6 G -.25(ff)-2.5 G(set).25 E
-(sets port roll bias \(de)128 168 Q(grees\))-.15 E -.4(RO)115.5 180 S
-(LLBIASSTBD of).4 E(fset)-.25 E(sets starboard roll bias \(de)128 192 Q
-(grees\))-.15 E(PITCH CORRECTION:)110.5 216 Q(PITCHBIASMODE mode)115.5
-228 Q(sets pitch correction [0])128 240 Q(0: no pitch correction)133 252
-Q(1: pitch correction by pitch bias)133 264 Q(PITCHBIAS of)115.5 276 Q
-(fset)-.25 E(sets pitch bias \(de)128 288 Q(grees\))-.15 E
-(HEADING CORRECTION:)110.5 312 Q(HEADINGMODE mode)115.5 324 Q
-(sets heading correction [no heading correction])128 336 Q 2.5<ad6e>128
-348 S(ote: heading mer)-2.5 E(ged from na)-.18 E(vig)-.2 E(ation before)
--.05 E(heading correction applied)133 360 Q(0: no heading correction)133
-372 Q(1: heading correction using course)133 384 Q(made good)140.5 396 Q
-(2: heading correction by of)133 408 Q(fset)-.25 E
-(3: heading correction using course)133 420 Q(made good and of)140.5 432
-Q(fset)-.25 E(HEADINGOFFSET of)115.5 444 Q(fset)-.25 E(sets v)128 456 Q
-(alue added to heading \(de)-.25 E(grees\))-.15 E(TIDE CORRECTION:)110.5
-480 Q(TIDEMODE mode)115.5 492 Q(sets tide correction [0])128 504 Q 2.5
-<ad6e>128 516 S(ote: tide added to bath)-2.5 E(ymetry after)-.05 E
-(all other calculations and corrections)133 528 Q(0: tide correction of)
-133 540 Q(f)-.25 E(1: tide correction on)133 552 Q(TIDEFILE \214lename)
-115.5 564 Q(sets tide \214le path)128 576 Q(TIDEFORMA)115.5 588 Q 2.5
-(Tc)-1.11 G(onstan)-2.5 E(sets tide \214le format [1])128 600 Q 2.5
-<ad74>128 612 S(ide \214les can be in one of four ASCII)-2.5 E
-(table formats)133 624 Q(1: format is <time_d tide>)133 636 Q
-(2: format is <yr mon day hour min sec tide>)133 648 Q
-(3: format is <yr jday hour min sec tide>)133 660 Q
-(4: format is <yr jday daymin sec tide>)133 672 Q 2.5<ad74>128 684 S
-(ime_d = decimal seconds since 1/1/1970)-2.5 E 2.5<ad64>128 696 S
-(aymin = decimal minutes start of day)-2.5 E(AMPLITUDE CORRECTION:)110.5
-720 Q(MB\255System 5.0)72 768 Q(10 No)129.895 E -.15(ve)-.15 G
-(mber 2014).15 E(9)190.545 E 0 Cg EP
-%%Page: 10 10
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 144.245(mbprocess\(1\) MB\255System)72 48 R
-144.245(5.0 mbprocess\(1\))2.5 F 2.5(AMPCORRMODE boolean)115.5 84 R
-(sets correction of amplitude for)128 96 Q
-(amplitude vs grazing angle function)128 108 Q
-(0: amplitude correction of)133 120 Q(f)-.25 E
-(1: amplitude correction on)133 132 Q(AMPCORRFILE \214lename)115.5 144 Q
-(sets amplitude correction \214le path)128 156 Q([no def)128 168 Q
-(ault])-.1 E(AMPCORR)115.5 180 Q(TYPE mode)-.6 E
-(sets sidescan correction type [0])128 192 Q
-(0: correction by subtraction \(dB scale\))133 204 Q
-(1: correction by di)133 216 Q(vision \(linear scale\))-.25 E
-(AMPCORRSYMMETR)115.5 228 Q 2.5(Yb)-.65 G(oolean)-2.5 E
-(forces correction function to be symmetric [1])128 240 Q
-(AMPCORRANGLE constant)115.5 252 Q
-(sets amplitude correction reference angle)128 264 Q(\(de)128 276 Q
-(g\) [30.0])-.15 E(AMPCORRSLOPE mode)115.5 288 Q
-(sets amplitude correction slope mode [0])128 300 Q
-(0: local slope ignored in calculating correction)133 312 Q
-(1: local slope used in calculating correction)133 324 Q(2: topograph)
-133 336 Q 2.5(yg)-.05 G(rid used in calculating correction)-2.5 E -.2
-(bu)180 348 S 2.5(ts).2 G(lope ignored)-2.5 E
-(3: local slope from topograph)133 360 Q 2.5(yg)-.05 G(rid used in)-2.5
-E(calculating correction)185 372 Q(SIDESCAN CORRECTION:)110.5 396 Q 2.5
-(SSCORRMODE boolean)115.5 408 R(sets correction of sidescan for)128 420
-Q(amplitude vs grazing angle function)128 432 Q
-(0: sidescan correction of)133 444 Q(f)-.25 E(1: sidescan correction on)
-133 456 Q(SSCORRFILE \214lename)115.5 468 Q
-(sets sidescan correction \214le path)128 480 Q([no def)128 492 Q(ault])
--.1 E(SSCORR)115.5 504 Q(TYPE mode)-.6 E
-(sets sidescan correction type [0])128 516 Q
-(0: correction by subtraction \(dB scale\))133 528 Q
-(1: correction by di)133 540 Q(vision \(linear scale\))-.25 E
-(SSCORRSYMMETR)115.5 552 Q 2.5(Yb)-.65 G(oolean)-2.5 E
-(forces correction function to be symmetric [1])128 564 Q
-(SSCORRANGLE constant)115.5 576 Q
-(sets sidescan correction reference angle)128 588 Q(\(de)128 600 Q
-(g\) [30.0])-.15 E(SSCORRSLOPE mode)115.5 612 Q
-(sets sidescan correction slope mode [0])128 624 Q
-(0: local slope ignored in calculating correction)133 636 Q
-(1: local slope used in calculating correction)133 648 Q(2: topograph)
-133 660 Q 2.5(yg)-.05 G(rid used in calculating correction)-2.5 E -.2
-(bu)180 672 S 2.5(ts).2 G(lope ignored)-2.5 E
-(3: local slope from topograph)133 684 Q 2.5(yg)-.05 G(rid used in)-2.5
-E(calculating correction)185 696 Q(AMPSSCORR)115.5 708 Q -.18(TO)-.6 G
-(POFILE).18 E(Sets topograph)128 720 Q 2.5(yg)-.05 G
-(rid used for correcting amplitude)-2.5 E(MB\255System 5.0)72 768 Q
-(10 No)129.895 E -.15(ve)-.15 G(mber 2014).15 E(10)185.545 E 0 Cg EP
-%%Page: 11 11
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 144.245(mbprocess\(1\) MB\255System)72 48 R
-144.245(5.0 mbprocess\(1\))2.5 F(and sidescan)128 84 Q
-(SIDESCAN RECALCULA)110.5 108 Q(TION:)-1.11 E 2.5(SSRECALCMODE boolean)
-115.5 120 R(sets recalculation of sidescan for)128 132 Q
-(Simrad multibeam data)128 144 Q(0: sidescan recalculation of)133 156 Q
-(f)-.25 E(1: sidescan recalculation on)133 168 Q(SSPIXELSIZE constant)
-115.5 180 Q(sets recalculated sidescan pix)128 192 Q
-(el size \(m\) [0.0])-.15 E 2.5(\255az)128 204 S(ero v)-2.5 E
-(alue causes the pix)-.25 E(el size to)-.15 E(be recalculated for e)133
-216 Q -.15(ve)-.25 G(ry data record).15 E(SSSW)115.5 228 Q -1.11(AT)-1.2
-G 2.5(HWIDTH constant)1.11 F(sets sidescan sw)128 240 Q(ath width \(de)
--.1 E(grees\) [0.0])-.15 E 2.5(\255az)128 252 S(ero v)-2.5 E
-(alue causes the sw)-.25 E(ath width)-.1 E(to be recalculated for e)133
-264 Q -.15(ve)-.25 G(ry data record).15 E(SSINTERPOLA)115.5 276 Q 2.5
-(TE constant)-1.11 F(sets sidescan interpolation distance)128 288 Q
-(\(number of pix)128 300 Q(els\))-.15 E(MET)110.5 324 Q(AD)-.93 E -1.21
--1.11(AT A)-.4 H(INSER)3.61 E(TION:)-.6 E(MET)115.5 336 Q -1.35(AV)-.93
-G(ESSEL string)1.35 E(sets mbinfo metadata string for v)128 348 Q(essel)
--.15 E(MET)115.5 360 Q(AINSTITUTION string)-.93 E
-(sets mbinfo metadata string for v)128 372 Q(essel)-.15 E
-(operator institution or compan)128 384 Q(y)-.15 E(MET)115.5 396 Q(APLA)
--.93 E(TFORM string)-1.11 E(sets mbinfo metadata string for sonar)128
-408 Q(platform \(ship or v)128 420 Q(ehicle\))-.15 E(MET)115.5 432 Q
-(ASON)-.93 E(AR string)-.35 E(sets mbinfo metadata string for sonar)128
-444 Q(model name)128 456 Q(MET)115.5 468 Q(ASON)-.93 E(AR)-.35 E
-(VERSION string)-.8 E(sets mbinfo metadata string for sonar)128 480 Q
--.15(ve)128 492 S(rsion \(usually softw).15 E(are v)-.1 E(ersion\))-.15
-E(MET)115.5 504 Q -.4(AC)-.93 G -.4(RU).4 G(ISEID string).4 E
-(sets mbinfo metadata string for institutional)128 516 Q(cruise id)128
-528 Q(MET)115.5 540 Q -.4(AC)-.93 G -.4(RU).4 G(ISEN).4 E(AME string)
--.35 E(sets mbinfo metadata string for descripti)128 552 Q -.15(ve)-.25
-G(cruise name)128 564 Q(MET)115.5 576 Q(API string)-.93 E
-(sets mbinfo metadata string for principal)128 588 Q(in)128 600 Q -.15
-(ve)-.4 G(stig).15 E(ator)-.05 E(MET)115.5 612 Q(APIINSTITUTION string)
--.93 E(sets mbinfo metadata string for principal)128 624 Q(in)128 636 Q
--.15(ve)-.4 G(stig).15 E(ator)-.05 E(MET)115.5 648 Q -.4(AC)-.93 G
-(LIENT string).4 E(sets mbinfo metadata string fo data o)128 660 Q(wner)
--.25 E(\(usually PI institution\))128 672 Q(MET)115.5 684 Q
-(ASVCORRECTED boolean)-.93 E(sets mbinfo metadata boolean for sound)128
-696 Q -.15(ve)128 708 S(locity corrected depths).15 E(MET)115.5 720 Q
--1.11(AT)-.93 G(IDECORRECTED boolean)1.11 E(MB\255System 5.0)72 768 Q
-(10 No)129.895 E -.15(ve)-.15 G(mber 2014).15 E(11)185.545 E 0 Cg EP
-%%Page: 12 12
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 144.245(mbprocess\(1\) MB\255System)72 48 R
-144.245(5.0 mbprocess\(1\))2.5 F(sets mbinfo metadata boolean for tide)
-128 84 Q(corrected bath)128 96 Q(ymetry)-.05 E(MET)115.5 108 Q(AB)-.93 E
--1.11(AT)-.35 G(HEDITMANU)1.11 E(AL boolean)-.4 E
-(sets mbinfo metadata boolean for manually)128 120 Q(edited bath)128 132
-Q(ymetry)-.05 E(MET)115.5 144 Q(AB)-.93 E -1.11(AT)-.35 G(HEDIT)1.11 E
--.55(AU)-.93 G .36 -.18(TO b).55 H(oolean).18 E
-(sets mbinfo metadata boolean for automatically)128 156 Q(edited bath)
-128 168 Q(ymetry)-.05 E(MET)115.5 180 Q(AR)-.93 E(OLLBIAS constant)-.4 E
-(sets mbinfo metadata constant for roll bias)128 192 Q(\(de)128 204 Q
-(grees + to starboard\))-.15 E(MET)115.5 216 Q(APITCHBIAS constant)-.93
-E(sets mbinfo metadata constant for pitch bias)128 228 Q(\(de)128 240 Q
-(grees + forw)-.15 E(ard\))-.1 E(MET)115.5 252 Q(AHEADINGBIAS constant)
--.93 E(sets mbinfo metadata constant for heading bias)128 264 Q(MET)
-115.5 276 Q(ADRAFT constant)-.93 E(sets mbinfo metadata constant for v)
-128 288 Q(essel draft \(m\))-.15 E(PR)110.5 312 Q(OCESSING KLUGES:)-.4 E
-(KLUGE001 boolean)115.5 324 Q(enables correction of tra)128 336 Q -.15
-(ve)-.2 G 2.5(lt).15 G(imes in)-2.5 E
-(Hydrosweep DS2 data from the R/V Maurice)128 348 Q
-(Ewing in 2001 and 2002.)128 360 Q(KLUGE002 boolean)115.5 372 Q
-(enables correction of draft v)128 384 Q(alues in)-.25 E(Simrad data)128
-396 Q 2.5<ad73>128 408 S(ome Simrad multibeam data has had an)-2.5 E
-(error in which the hea)133 420 Q .3 -.15(ve h)-.2 H(as bee added).15 E
-(to the sonar depth \(draft for hull)133 432 Q(mounted sonars\))133 444
-Q 2.5<ad74>128 456 S(his correction subtracts the hea)-2.5 E -.15(ve)-.2
-G -.25(va)133 468 S(lue from the sonar depth).25 E(KLUGE003 boolean)
-115.5 480 Q(enables correction of beam angles in)128 492 Q
-(SeaBeam 2112 data)128 504 Q 2.5(\255ad)128 516 S
-(ata sample from the SeaBeam 2112 on)-2.5 E(the USCG Icebreak)133 528 Q
-(er Healy \(collected on)-.1 E(23 July 2003\) w)133 540 Q
-(as found to ha)-.1 E .3 -.15(ve a)-.2 H 2.5(ne).15 G(rror)-2.5 E
-(in which the beam angles had 0.25 times)133 552 Q(the roll added)133
-564 Q 2.5<ad74>128 576 S(his correction subtracts 0.25 * roll)-2.5 E
-(from the beam angles before the bath)133 588 Q(ymetry)-.05 E
-(is recalculated by raytracing through a)133 600 Q -.1(wa)133 612 S
-(ter sound v).1 E(elocity pro\214le)-.15 E 2.5<ad74>128 624 S
-(he mbprocess parameter \214les must be)-2.5 E(set to enable bath)133
-636 Q(ymetry recalculation)-.05 E(by raytracing in order to apply this)
-133 648 Q(correction)133 660 Q(KLUGE004 boolean)115.5 672 Q
-(deletes surv)128 684 Q .3 -.15(ey d)-.15 H
-(ata associated with duplicate).15 E(or re)128 696 Q -.15(ve)-.25 G
-(rsed time tags).15 E 2.5<ad69>128 708 S 2.5(fs)-2.5 G(urv)-2.5 E .3
--.15(ey d)-.15 H(ata records are encountered).15 E
-(with time tags less than or equal to the)133 720 Q(MB\255System 5.0)72
-768 Q(10 No)129.895 E -.15(ve)-.15 G(mber 2014).15 E(12)185.545 E 0 Cg
-EP
-%%Page: 13 13
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 144.245(mbprocess\(1\) MB\255System)72 48 R
-144.245(5.0 mbprocess\(1\))2.5 F
-(last good time tag, an error is set and)133 84 Q
-(the data record is not output to the)133 96 Q(processed data \214le.)
-133 108 Q(KLUGE005 boolean)115.5 120 Q(replaces surv)128 132 Q .3 -.15
-(ey r)-.15 H(ecord timestamps with).15 E
-(timestamps of corresponding mer)128 144 Q(ged na)-.18 E(vig)-.2 E
-(ation)-.05 E(records)128 156 Q 2.5<ad74>128 168 S(his feature allo)-2.5
-E(ws users to \214x)-.25 E(timestamp errors using MBna)133 180 Q -.15
-(ve)-.2 G(dit and).15 E(then insert the corrected timestamps)133 192 Q
-(into processed data)133 204 Q(KLUGE006 boolean)115.5 216 Q
-(changes sonar depth / draft v)144 228 Q(alues without)-.25 E
-(changing bath)128 240 Q(ymetry v)-.05 E(alues)-.25 E(KLUGE007 boolean)
-115.5 252 Q(processing kluge 007 \(not yet de\214ned\))128 264 Q 2.5
-<ad6f>128 276 S(ccasionaly odd processing problems will)-2.5 E
-(occur that are speci\214c to a particular)133 288 Q(surv)133 300 Q .3
--.15(ey o)-.15 H 2.5(rs).15 G(onar v)-2.5 E(ersion)-.15 E 2.5<ad6d>128
-312 S(bprocess will allo)-2.5 E 2.5(wo)-.25 G(ne\255time \214x)-2.5 E
-(es to)-.15 E(be de\214ned as "kluges" that can be turned)133 324 Q
-(on through the parameter \214les.)133 336 Q/F1 10.95/Times-Bold at 0 SF
-(ANCILLAR)72 364.8 Q 2.738(YD)-.383 G -1.644 -1.04(AT A)-3.121 H(FILES)
-3.778 E/F2 10/Times-Bold at 0 SF(MB\255System)108 376.8 Q F0 .034
-(also uses a number of ancillary data \214les, most of which relate to)
-2.534 F F2(mbpr)2.535 E(ocess)-.18 E F0 .035(in some w)2.535 F(ay)-.1 E
-2.535(.B)-.65 G(y)-2.535 E(def)108 388.8 Q 1.354
-(ault, these ancillary data \214les are named by adding a short suf)-.1
-F 1.354(\214x to the primary data \214le name \(e.g.)-.25 F
-(".par", ".svp", ".esf", ".n)108 400.8 Q -.15(ve)-.4 G("\)).15 E 1.092
-(The common ancillary \214les are listed belo)108 424.8 R 2.392 -.65
-(w. T)-.25 H 1.092(he e).65 F 1.093(xample names gi)-.15 F -.15(ve)-.25
-G 3.593(nh).15 G 1.093(ere follo)-3.593 F 3.593(wf)-.25 G 1.093
-(rom an input sw)-3.593 F(ath)-.1 E(data \214le name of mydata.mb71.)108
-436.8 Q .03(The processing parameter \214le used by)108 460.8 R F2(mbpr)
-2.53 E(ocess)-.18 E F0 .029(has an ".par" suf)2.529 F .029
-(\214x. These \214les are generated or modi\214ed)-.25 F(by)108 472.8 Q
-F2(mbset)2.5 E F0(,)A F2(mbedit)2.5 E F0(,)A F2(mbna)2.5 E -.1(ve)-.25 G
-(dit).1 E F0(,)A F2(mb)2.5 E -.1(ve)-.15 G(locitytool).1 E F0(,)A F2
-(mbna)2.5 E -.1(va)-.25 G(djust).1 E F0 2.5(,a)C(nd)-2.5 E F2(mbclean)
-2.5 E F0(.)A(mydata.mb71.par)128 484.8 Q 1.127(The most prominent ancil\
-lary \214les are metadata or "inf" \214les \(created from the output of)
-108 508.8 R F2(mbinf)3.628 E(o)-.25 E F0 3.628(\). Pro-)B .494
-(grams such as)108 520.8 R F2(mbgrid)2.994 E F0(and)2.994 E F2(mbm_plot)
-2.994 E F0 .494(try to check "inf" \214les to see if the corresponding \
-data \214les include)2.994 F .642
-(data within desired areas. The program)108 532.8 R F2(mbpr)3.142 E
-(ocess)-.18 E F0 .642(automatically generates an "inf" \214le for an)
-3.142 F 3.143(yp)-.15 G(rocessed)-3.143 E .032(output sw)108 544.8 R
-.032(ath \214le.)-.1 F .031(Also, the program)5.031 F F2(mbdatalist)
-2.531 E F0 .031(is often used to create or update "inf" \214les for lar)
-2.531 F .031(ge groups)-.18 F(of sw)108 556.8 Q(ath data \214les.)-.1 E
-(mydata.mb71.inf)128 568.8 Q .644(The "f)108 592.8 R .644
-(ast bath" or "fbt" \214les are generated by cop)-.1 F .644(ying the sw)
--.1 F .645(ath bath)-.1 F .645(ymetry to a sparse, quickly read for)-.05
-F(-)-.2 E .13(mat \(format 71\). Programs such as)108 604.8 R F2(mbgrid)
-2.63 E F0(,)A F2(mbswath)2.63 E F0 2.63(,a)C(nd)-2.63 E F2(mbcontour)
-2.63 E F0 .13(will try to read "fbt" \214les instead of)2.63 F .763
-(the full data \214les whene)108 616.8 R -.15(ve)-.25 G 3.264(ro).15 G
-.764(nly bath)-3.264 F .764
-(ymetry information are required. The program)-.05 F F2(mbpr)3.264 E
-(ocess)-.18 E F0(automati-)3.264 E .016
-(cally generates an "fbt" \214le for an)108 628.8 R 2.515(yp)-.15 G .015
-(rocessed output sw)-2.515 F .015(ath \214le.)-.1 F .015
-(Also, the program)5.015 F F2(mbdatalist)2.515 E F0 .015(is often used)
-2.515 F 1.172(to create or update "fbt" \214les for lar)108 640.8 R
-1.172(ge groups of sw)-.18 F 1.172(ath data \214les.)-.1 F 1.172
-(These \214les are not generated or used)6.172 F(when the original sw)
-108 652.8 Q(ath data is already in a compact bath)-.1 E
-(ymetry\255only data format.)-.05 E(mydata.mb71.fbt)128 664.8 Q .564
-(The "f)108 688.8 R .564(ast na)-.1 F .564(v" or "fn)-.2 F .564
-(v" \214les are just ASCII lists of na)-.4 F(vig)-.2 E .563
-(ation generated using)-.05 F F2(mblist)3.063 E F0 .563(with a)3.063 F
-F2<ad4f>3.063 E/F3 10/Times-Italic at 0 SF(tMXYHSc)A F0 .414
-(option. Programs such as)108 700.8 R F2(mbgrid)2.914 E F0(,)A F2
-(mbswath)2.914 E F0 2.914(,a)C(nd)-2.914 E F2(mbcontour)2.914 E F0 .414
-(will try to read "fn)2.914 F .414(v" \214les instead of the full)-.4 F
-.016(data \214les whene)108 712.8 R -.15(ve)-.25 G 2.516(ro).15 G .016
-(nly na)-2.516 F(vig)-.2 E .016(ation information are required. These \
-\214les are not generated or used when the)-.05 F
-(original data is already in a single\255beam or na)108 724.8 Q(vig)-.2
-E(ation data format.)-.05 E(MB\255System 5.0)72 768 Q(10 No)129.895 E
--.15(ve)-.15 G(mber 2014).15 E(13)185.545 E 0 Cg EP
-%%Page: 14 14
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 144.245(mbprocess\(1\) MB\255System)72 48 R
-144.245(5.0 mbprocess\(1\))2.5 F(mydata.mb71.fn)128 84 Q(v)-.4 E
-(The bath)108 108 Q(ymetry edit sa)-.05 E .3 -.15(ve \214)-.2 H
-(le generated by).15 E/F1 10/Times-Bold at 0 SF(mbedit)2.5 E F0(and)2.5 E
-F1(mbclean)2.5 E F0(has an ".esf" suf)2.5 E(\214x.)-.25 E
-(mydata.mb71.esf)128 120 Q 2.981(Aw)108 144 S .481(ater sound v)-3.081 F
-.481(elocity pro\214le \(SVP\) \214le generated by)-.15 F F1(mb)2.981 E
--.1(ve)-.15 G(locitytool).1 E F0 .481(has an ".svp" suf)2.981 F .482
-(\214x unless the user)-.25 F(speci\214es otherwise.)108 156 Q
-(mydata.mb71.svp)128 168 Q -.8(Wa)108 192 S .057(ter sound v).8 F .057
-(elocity pro\214le \(SVP\) \214les generated by)-.15 F F1(mbsvplist)
-2.557 E F0 .056(also use the ".svp" suf)2.557 F 2.556(\214x. Ho)-.25 F
-(we)-.25 E -.15(ve)-.25 G .856 -.4(r, m).15 H(ulti-).4 E .765
-(ple SVP \214les may be e)108 204 R .765(xtracted from each input sw)
--.15 F .765(ath \214le, so the \214les are numbered using a "_YYY)-.1 F
-(.svp")-1.29 E(suf)108 216 Q(\214x, where YYY increments from 001.)-.25
-E(mydata.mb71_001.svp)128 228 Q(mydata.mb71_002.svp)128 240 Q
-(mydata.mb71_003.svp)128 252 Q(Edited na)108 276 Q(vig)-.2 E
-(ation \214les generated by)-.05 E F1(mbna)2.5 E -.1(ve)-.25 G(dit).1 E
-F0(ha)2.5 E .3 -.15(ve a)-.2 H 2.5(n").15 G(.n)-2.5 E -.15(ve)-.4 G 2.5
-("s).15 G(uf)-2.5 E(\214x:)-.25 E(mydata.mb71.n)128 288 Q -.15(ve)-.4 G
-(These na)108 300 Q(vig)-.2 E
-(ation \214les can be read independently using format 166.)-.05 E
-(Adjusted na)108 324 Q(vig)-.2 E(ation \214les generated by)-.05 E F1
-(mbna)2.5 E -.1(va)-.25 G(djust).1 E F0(ha)2.5 E .3 -.15(ve a)-.2 H 2.5
-(n").15 G(.naY" suf)-2.5 E(\214x, where "Y" is a number between)-.25 E
-3.322(0\2559. The)108 336 R F1(mbna)3.322 E -.1(va)-.25 G(djust).1 E F0
-.823(package may be used multiple times for a surv)3.322 F -.15(ey)-.15
-G 3.323(;t).15 G .823(he adjustments are numbered)-3.323 F
-(sequentially from "0":)108 348 Q(mydata.mb71.na0)128 360 Q
-(mydata.mb71.na1)128 372 Q(mydata.mb71.na2)128 384 Q
-(and so on. These na)108 396 Q(vig)-.2 E
-(ation \214les can be read independently using format 166.)-.05 E/F2
-10.95/Times-Bold at 0 SF -.548(AU)72 424.8 S(THORSHIP).548 E F0(Da)108
-436.8 Q(vid W)-.2 E 2.5(.C)-.92 G(aress \(caress at mbari.or)-2.5 E(g\))
--.18 E(Montere)113 448.8 Q 2.5(yB)-.15 G(ay Aquarium Research Institute)
--2.5 E(Dale N. Chayes \(dale at ldeo.columbia.edu\))108 460.8 Q
-(Lamont\255Doherty Earth Observ)113 472.8 Q(atory)-.25 E F2(OPTIONS)72
-501.6 Q F1<ad46>108 513.6 Q/F3 10/Times-Italic at 0 SF(format)24.19 E F0
-.418(Sets the)144 525.6 R F1(MBIO)2.918 E F0(inte)2.918 E .418
-(ger format identi\214er for the input \214le speci\214ed with the)-.15
-F F1<ad49>2.917 E F0 .417(option. By def)2.917 F(ault,)-.1 E F1(mbpr)144
-537.6 Q(ocess)-.18 E F0(deri)2.947 E -.15(ve)-.25 G 2.947(st).15 G .447
-(he format id from the)-2.947 F F1(mbpr)2.947 E(ocess)-.18 E F0 .447
-(parameter \214le associated with the input \214le)2.947 F(\()144 549.6
-Q F1<ad49>A F0(option\) or)2.5 E 2.5(,i)-.4 G 2.5(fn)-2.5 G(ecessary)
--2.5 E 2.5(,i)-.65 G(nfers the format from the "*.mbXX")-2.5 E F1
-(MB\255System)2.5 E F0(suf)2.5 E(\214x con)-.25 E -.15(ve)-.4 G(ntion.)
-.15 E F1<ad48>108 566.4 Q F0 .391(This "help" \215ag causes the program\
- to print out a description of its operation and then e)22.52 F .39
-(xit imme-)-.15 F(diately)144 578.4 Q(.)-.65 E F1<ad49>108 595.2 Q F3
-(in\214le)26.41 E F0(Sw)144 607.2 Q .732(ath data \214le from which the\
- input data will be read, or a datalist \214le containing a list of inp\
-ut)-.1 F(sw)144 619.2 Q .289
-(ath data \214les and/or other datalist \214les. If)-.1 F F3(in\214le)
-2.789 E F0 .289(is a datalist \214le, then)2.789 F F1(mbpr)2.789 E
-(ocess)-.18 E F0 .288(will attempt to)2.788 F
-(process all data \214les identi\214ed by recursi)144 631.2 Q -.15(ve)
--.25 G(ly reading).15 E F3(in\214le)2.5 E F0(.)A F1<ad4e>108 648 Q F0
-.876(By def)144 660 R(ault,)-.1 E F1(mbpr)3.376 E(ocess)-.18 E F0 .876
-(passes an)3.376 F 3.376(yc)-.15 G .876
-(omment records it encounters in the input data to the output)-3.376 F
-.712(data \214le and additionally embeds ne)144 672 R 3.212(wc)-.25 G
-.711(omment records detailing the processing parameters used)-3.212 F
-(by)144 684 Q F1(mbpr)2.672 E(ocess)-.18 E F0 5.172(.T)C .172
-(his option causes)-5.172 F F1(mbpr)2.672 E(ocess)-.18 E F0 .172
-(to not pass ne)2.672 F 2.673(wo)-.25 G 2.673(ro)-2.673 G .173
-(ld comment records to the out-)-2.673 F(put data \214le.)144 696 Q F1
-<ad4f>108 712.8 Q F3(out\214le)22.52 E F0 .273(Data \214le to which the\
- output data will be written. If no output \214le is speci\214ed, the o\
-utput \214lename)144 724.8 R(MB\255System 5.0)72 768 Q(10 No)129.895 E
--.15(ve)-.15 G(mber 2014).15 E(14)185.545 E 0 Cg EP
-%%Page: 15 15
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 144.245(mbprocess\(1\) MB\255System)72 48 R
-144.245(5.0 mbprocess\(1\))2.5 F .328(is set automatically)144 84 R
-2.828(.I)-.65 G 2.828(fa)-2.828 G 2.828(ni)-2.828 G .328(nput sw)-2.828
-F .328(ath data \214le is named "root.mbXX", where XX is the format id,)
--.1 F .08(then the def)144 96 R .08
-(ault processed output \214le will be "rootp.mbXX".)-.1 F .08
-(The "p" inserted before the ".mbXX")5.08 F(suf)144 108 Q .117
-(\214x indicates the output \214le has been created by)-.25 F/F1 10
-/Times-Bold at 0 SF(mbpr)2.618 E(ocess)-.18 E F0 5.118(.I)C 2.618(ft)-5.118
-G .118(he input \214le does not follo)-2.618 F 2.618(wt)-.25 G(he)-2.618
-E 1.58(*.mbXX naming con)144 120 R -.15(ve)-.4 G 1.579(ntion, then the \
-output \214lename will just consist of the input name with).15 F
-("p.mbXX" added as a suf)144 132 Q(\214x.)-.25 E F1<ad50>108 148.8 Q F0
-1.425(By def)144 160.8 R(ault,)-.1 E F1(mbpr)3.925 E(ocess)-.18 E F0
-1.425(will only process a sw)3.925 F 1.426
-(ath data \214le if the processed output \214le is either)-.1 F .017
-(missing or out of date relati)144 172.8 R .317 -.15(ve t)-.25 H 2.517
-(ot).15 G .017(he input sw)-2.517 F .017
-(ath data \214le, the parameter \214le, or an)-.1 F 2.516(yo)-.15 G
-2.516(ft)-2.516 G .016(he ancillary)-2.516 F .439
-(data \214les referred to in the parameter \214le \(e.g. na)144 184.8 R
-(vig)-.2 E .44(ation \214les, edit sa)-.05 F .74 -.15(ve \214)-.2 H .44
-(les, svp \214les\). If the).15 F F1<ad50>2.94 E F0
-(option is speci\214ed,)144 196.8 Q F1(mbpr)2.5 E(ocess)-.18 E F0
-(will process e)2.5 E -.15(ve)-.25 G
-(ry \214le, whether it needs it or not.).15 E F1<ad54>108 213.6 Q F0
-1.21(This option puts)144 225.6 R F1(mbpr)3.71 E(ocess)-.18 E F0 1.21
-(into a test mode. The program will report whether or not it w)3.71 F
-(ould)-.1 E(process a \214le, b)144 237.6 Q(ut it will not actually pro\
-cess the data or produce an output processed \214le.)-.2 E F1<ad53>108
-254.4 Q F0 1.518(This option causes)144 266.4 R F1(mbpr)4.018 E(ocess)
--.18 E F0 1.518
-(to print out the status of each \214le \(e.g. up to date, out of date,)
-4.018 F(lock)144 278.4 Q .475(ed, unlock)-.1 F .475(ed\) along with the\
- \214le modi\214cation times used to determine if the output \214le is \
-out)-.1 F(of date.)144 290.4 Q F1<ad56>108 307.2 Q F0(Normally)23.08 E
-(,)-.65 E F1(mbpr)2.749 E(ocess)-.18 E F0 -.1(wo)2.749 G .249
-(rks "silently" without outputting an).1 F .249
-(ything to the stderr stream.)-.15 F .25(If the)5.25 F F1<ad56>2.75 E F0
-.702(\215ag is gi)144 319.2 R -.15(ve)-.25 G .702(n, then).15 F F1(mbpr)
-3.202 E(ocess)-.18 E F0 -.1(wo)3.202 G .702(rks in a "v).1 F .702
-(erbose" mode and outputs the program v)-.15 F .702(ersion being)-.15 F
-1.31(used, the processing parameters being use, and some statistics re)
-144 331.2 R -.05(ga)-.15 G 1.31(rding the processing accom-).05 F
-(plished.)144 343.2 Q/F2 10.95/Times-Bold at 0 SF -.219(NA)72 372 S(VIGA)
--1.369 E(TION FORMA)-1.04 E(TS)-1.04 E F0(The na)108 384 Q(vig)-.2 E
-(ation formats that are supported for mer)-.05 E(ging by)-.18 E F1(mbpr)
-2.5 E(ocess)-.18 E F0(include the follo)2.5 E(wing:)-.25 E F1(MBpr)144
-396 Q(ocess)-.18 E F0 22.5(ID Name)2.5 F 12.5
-<adadadadadadadadadadadadadadadadadad20adadadad>144 408 R 35(1S)166.5
-420 S(imple Decimal T)-35 E(ime)-.35 E 35(2S)166.5 432 S(imple Date 1)
--35 E 35(3S)166.5 444 S(imple Date 2)-35 E 35(4S)166.5 456 S
-(imple Date 3)-35 E 35(5L)166.5 468 S(\255DEO Processed Na)-35 E(v)-.2 E
-35(6N)166.5 480 S(MEA 0183 \255 GLL)-35 E 35(7N)166.5 492 S
-(MEA 0183 \255 GGA)-35 E 35(8S)166.5 504 S(imrad 90 Na)-35 E(v)-.2 E 35
-(9M)166.5 516 S(BPR)-35 E(ON)-.4 E 2.7 -1.35(AV \()-.35 H(*.n)1.35 E .3
--.15(ve F)-.4 H(iles\)).15 E 30(10 R2RN)166.5 528 R 2.7 -1.35(AV \()-.35
-H(*_hires.r2rna)1.35 E 2.5(vF)-.2 G(iles\))-2.5 E -.15(Fo)108 552 S
-(rmat 1 \(Simple Decimal T).15 E(ime\):)-.35 E 2.5<ad74>144 564 S -.15
-(ex)-2.5 G(t).15 E 2.5<ad8c>144 576 S(elds separated by white space)-2.5
-E 2.5<ad65>144 588 S(ach line contains the follo)-2.5 E(wing \214elds:)
--.25 E(time_d lon lat)180 600 Q 2.5<ad74>144 612 S
-(ime_d : decimal seconds since 1970 Jan 1 00:00:00.00)-2.5 E 2.5<ad6c>
-144 624 S(on: decimal longitude \(de)-2.5 E(g\))-.15 E 2.5<ad6c>144 636
-S(at: decimal latitude \(de)-2.5 E(g\))-.15 E -.15(Fo)108 660 S
-(rmat 2 \(Simple Date 1\):).15 E 2.5<ad74>144 672 S -.15(ex)-2.5 G(t).15
-E 2.5<ad8c>144 684 S(elds separated by white space)-2.5 E 2.5<ad65>144
-696 S(ach line contains the follo)-2.5 E(wing \214elds:)-.25 E
-(yr mon day hour min sec lon lat)180 708 Q 2.5<ad79>144 720 S
-(r: four\255digit year)-2.5 E(MB\255System 5.0)72 768 Q(10 No)129.895 E
--.15(ve)-.15 G(mber 2014).15 E(15)185.545 E 0 Cg EP
-%%Page: 16 16
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 144.245(mbprocess\(1\) MB\255System)72 48 R
-144.245(5.0 mbprocess\(1\))2.5 F 2.5<ad6d>144 84 S(on: inte)-2.5 E
-(ger month of year)-.15 E 2.5<ad64>144 96 S(ay: inte)-2.5 E
-(ger day of month)-.15 E 2.5<ad68>144 108 S(our: inte)-2.5 E
-(ger hour of day)-.15 E 2.5<ad6d>144 120 S(in: inte)-2.5 E
-(ger minute of hour)-.15 E 2.5<ad73>144 132 S
-(ec: decimal second of minute)-2.5 E 2.5<ad6c>144 144 S
-(on: decimal longitude \(de)-2.5 E(g\))-.15 E 2.5<ad6c>144 156 S
-(at: decimal latitude \(de)-2.5 E(g\))-.15 E -.15(Fo)108 180 S
-(rmat 3 \(Simple Date 2\):).15 E 2.5<ad74>144 192 S -.15(ex)-2.5 G(t).15
-E 2.5<ad8c>144 204 S(elds separated by white space)-2.5 E 2.5<ad65>144
-216 S(ach line contains the follo)-2.5 E(wing \214elds:)-.25 E
-(yr jday hour min sec lon lat)180 228 Q 2.5<ad79>144 240 S
-(r: four\255digit year)-2.5 E 2.5<ad6a>144 252 S(day: inte)-2.5 E
-(ger julian day of year)-.15 E 2.5<ad68>144 264 S(our: inte)-2.5 E
-(ger hour of day)-.15 E 2.5<ad6d>144 276 S(in: inte)-2.5 E
-(ger minute of hour)-.15 E 2.5<ad73>144 288 S
-(ec: decimal second of minute)-2.5 E 2.5<ad6c>144 300 S
-(on: decimal longitude \(de)-2.5 E(g\))-.15 E 2.5<ad6c>144 312 S
-(at: decimal latitude \(de)-2.5 E(g\))-.15 E -.15(Fo)108 336 S
-(rmat 4 \(Simple Date 3\):).15 E 2.5<ad74>144 348 S -.15(ex)-2.5 G(t).15
-E 2.5<ad8c>144 360 S(elds separated by white space)-2.5 E 2.5<ad65>144
-372 S(ach line contains the follo)-2.5 E(wing \214elds:)-.25 E
-(yr jday daymin sec lon lat)180 384 Q 2.5<ad79>144 396 S
-(r: four\255digit year)-2.5 E 2.5<ad6a>144 408 S(day: inte)-2.5 E
-(ger julian day of year)-.15 E 2.5<ad64>144 420 S(aymin: inte)-2.5 E
-(ger minute of day)-.15 E 2.5<ad73>144 432 S
-(ec: decimal second of minute)-2.5 E 2.5<ad6c>144 444 S
-(on: decimal longitude \(de)-2.5 E(g\))-.15 E 2.5<ad6c>144 456 S
-(at: decimal latitude \(de)-2.5 E(g\))-.15 E -.15(Fo)108 480 S
-(rmat 5 \(L\255DEO Processed Na).15 E(v\):)-.2 E 2.5<ad74>144 492 S -.15
-(ex)-2.5 G(t).15 E 2.5<ad8c>144 504 S(elds separated by white space)-2.5
-E 2.5<ad65>144 516 S(ach line contains the follo)-2.5 E(wing \214elds:)
--.25 E(timetag NorS latd latm EorW lond lonm src dr1 dr2)180 528 Q 2.5
-<ad74>144 540 S(imetag: comes in tw)-2.5 E 2.5(of)-.1 G(orms)-2.5 E
-(form 1: yy+jjj:hh:mm:ss.sss)180 552 Q(form 2: yyyy+jjj:hh:mm:ss.sss)180
-564 Q 2.5<ad79>144 576 S(y: either tw)-2.5 E
-(o\255digit or four\255digit year)-.1 E 2.5<ad6a>144 588 S(jj: inte)-2.5
-E(ger julian day of year)-.15 E 2.5<ad68>144 600 S(h: inte)-2.5 E
-(ger hour of day)-.15 E 2.5<ad6d>144 612 S(m: inte)-2.5 E
-(ger minute of hour)-.15 E 2.5<ad73>144 624 S
-(s.sss: decimal second of minute)-2.5 E 2.5<ad4e>144 636 S
-(orS: 'S' for southern hemisphere)-2.5 E('N' for northern hemisphere)164
-648 Q 2.5<ad6c>144 660 S(atd: inte)-2.5 E(ger latitude de)-.15 E(grees)
--.15 E 2.5<ad6c>144 672 S(atm: decimal latitude minutes)-2.5 E 2.5<ad45>
-144 684 S(orW)-2.5 E 2.5(:')-.37 G(E' for eastern hemisphere)-2.5 E
-('W' for western hemisphere)164 696 Q 2.5<ad6c>144 708 S(ond: inte)-2.5
-E(ger longitude de)-.15 E(grees)-.15 E 2.5<ad6c>144 720 S
-(onm: decimal longitude minutes)-2.5 E(MB\255System 5.0)72 768 Q(10 No)
-129.895 E -.15(ve)-.15 G(mber 2014).15 E(16)185.545 E 0 Cg EP
-%%Page: 17 17
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 144.245(mbprocess\(1\) MB\255System)72 48 R
-144.245(5.0 mbprocess\(1\))2.5 F 2.5<ad73>144 84 S(rc: na)-2.5 E 2.5(vs)
--.2 G(ource \(e.g. gp1, dr)-2.5 E 2.5(,s)-.4 G(atl\))-2.5 E 2.5
-('gp1' \255)164 96 R(GPS recei)2.5 E -.15(ve)-.25 G 2.5(r1).15 G -.5('d)
-164 108 S 5(r' \255).5 F(dead reck)2.5 E(oning)-.1 E -.55('s)164 120 S
-(atl' \255 transit satellite).55 E 2.5<ad64>144 132 S
-(r1: nonzero when src is ')-2.5 E(dr')-.5 E 2.5<ad64>144 144 S
-(r2: nonzero when src is ')-2.5 E(dr')-.5 E -.15(Fo)108 168 S
-(rmat 6 \(NMEA 0183 \255 GLL\):).15 E 2.5<ad74>144 180 S -.15(ex)-2.5 G
-(t).15 E 2.5<ad8c>144 192 S(elds separated by commas)-2.5 E 2.5<ad6e>144
-204 S .4 -.2(av d)-2.5 H(eri).2 E -.15(ve)-.25 G 2.5(df).15 G
-(rom GLL strings)-2.5 E -.15(Fo)108 228 S
-(rmat 7 \(NMEA 0183 \255 GGA\):).15 E 2.5<ad74>144 240 S -.15(ex)-2.5 G
-(t).15 E 2.5<ad8c>144 252 S(elds separated by commas)-2.5 E 2.5<ad6e>144
-264 S .4 -.2(av d)-2.5 H(eri).2 E -.15(ve)-.25 G 2.5(df).15 G
-(rom GGA strings)-2.5 E -.15(Fo)108 288 S(rmat 8 \(Simrad 90 Na).15 E
-(v\):)-.2 E 2.5<ad74>144 300 S -.15(ex)-2.5 G(t).15 E 2.5<ad8c>144 312 S
-(elds not separated by white space)-2.5 E 2.5<ad65>144 324 S
-(ach line contains the follo)-2.5 E(wing \214elds:)-.25 E 36
-(ddmmyy_hhmmss.ss_LLlllllN_LLLllllllE \255)180 336 R(dd: day of month)
-2.5 E 2.5<ad6d>144 348 S(m: inte)-2.5 E(ger month of year)-.15 E 2.5
-<ad79>38.5 G(y: tw)-2.5 E(o\255digit year)-.1 E 2.5<ad68>144 360 S
-(h: inte)-2.5 E(ger hour of day)-.15 E 2.5<ad6d>144 372 S(m: inte)-2.5 E
-(ger minute of hour)-.15 E 2.5<ad73>144 384 S
-(s.ss: decimal second of minute)-2.5 E 2.5<ad4c>144 396 S(L: inte)-2.5 E
-(ger latitude de)-.15 E(grees)-.15 E 2.5<ad6c>144 408 S(llll: inte)-2.5
-E(ger latitude minutes X 1000)-.15 E 2.5<ad4e>144 420 S 10(:')-2.5 G
-(S' for southern hemisphere)-10 E('N' for northern hemisphere)164 432 Q
-2.5<ad4c>144 444 S(LL: inte)-2.5 E(ger longitude de)-.15 E(grees)-.15 E
-2.5<ad6c>144 456 S(llll: inte)-2.5 E(ger longitude minutes X 1000)-.15 E
-2.5<ad45>144 468 S 10(:')-2.5 G(E' for eastern hemisphere)-10 E
-('W' for western hemisphere)164 480 Q -.15(Fo)108 504 S(rmat 9 \(MBPR)
-.15 E(ON)-.4 E 2.7 -1.35(AV \()-.35 H(*.n)1.35 E .3 -.15(ve F)-.4 H
-(iles\)\):).15 E 2.5<ad74>144 516 S -.15(ex)-2.5 G(t).15 E 2.5<ad8c>144
-528 S(elds separated by white space)-2.5 E 2.5<ad65>144 540 S
-(ach line contains at least 9, and possibly as man)-2.5 E 2.5(ya)-.15 G
-2.5(s1)-2.5 G(9, of the follo)-2.5 E(wing \214elds:)-.25 E
-(yr mn dy hr mi se td ln lt hg sp dr rl pt hv pln plt sln slt)180 552 Q
-2.5<ad79>144 564 S(r: four\255digit year)-2.5 E 2.5<ad6d>144 576 S
-(n: inte)-2.5 E(ger month of year)-.15 E 2.5<ad64>144 588 S(y: inte)-2.5
-E(ger day of month)-.15 E 2.5<ad68>144 600 S(r: inte)-2.5 E
-(ger hour of day)-.15 E 2.5<ad6d>144 612 S(i: inte)-2.5 E
-(ger minute of hour)-.15 E 2.5<ad73>144 624 S
-(e: decimal second of minute)-2.5 E 2.5<ad74>144 636 S 2.5(d:d)-2.5 G
-(ecimal seconds since 1970 Jan 1 00:00:00.00)-2.5 E 2.5<ad6c>144 648 S
-(n: decimal longitude \(de)-2.5 E(g\))-.15 E 2.5<ad6c>144 660 S
-(t: decimal latitude \(de)-2.5 E(g\))-.15 E 2.5<ad68>144 672 S
-(g: decimal heading \(de)-2.5 E(g\))-.15 E 2.5<ad73>144 684 S
-(p: decimal speed \(km/hr\))-2.5 E 2.5<ad64>144 696 S
-(r: decimal draft \(m\))-2.5 E 2.5<ad72>144 708 S(l: decimal roll \(de)
--2.5 E(g\))-.15 E 2.5<ad70>144 720 S(t: decimal pitch \(de)-2.5 E(g\))
--.15 E(MB\255System 5.0)72 768 Q(10 No)129.895 E -.15(ve)-.15 G
-(mber 2014).15 E(17)185.545 E 0 Cg EP
-%%Page: 18 18
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 144.245(mbprocess\(1\) MB\255System)72 48 R
-144.245(5.0 mbprocess\(1\))2.5 F 2.5<ad68>144 84 S(v: decimal hea)-2.5 E
-.3 -.15(ve \()-.2 H(m\)).15 E 2.5<ad70>144 96 S
-(ln: decimal longitude of portmost sounding \(de)-2.5 E(g\))-.15 E 2.5
-<ad70>144 108 S(lt: decimal latitude of portmost sounding \(de)-2.5 E
-(g\))-.15 E 2.5<ad73>144 120 S
-(ln: decimal longitude of starboardmost sounding \(de)-2.5 E(g\))-.15 E
-2.5<ad73>144 132 S(lt: decimal latitude of starboardmost sounding \(de)
--2.5 E(g\))-.15 E -.15(Fo)108 156 S(rmat 10 \(R2RN).15 E 2.7 -1.35
-(AV \()-.35 H(*_hires.r2rna)1.35 E 2.5(vF)-.2 G(iles\)\):)-2.5 E 2.5
-<ad74>144 168 S -.15(ex)-2.5 G 38.5<74ad>.15 G(also w)-36 E
-(orks with *_1min.r2rna)-.1 E 2.5(va)-.2 G(nd *_control.r2rna)-2.5 E 2.5
-<768c>-.2 G(les)-2.5 E 2.5<ad74>180 180 S(hese lack the GPS parameters)
--2.5 E 2.5<ad64>144 192 S
-(e\214ned by SIO GDC as part of the R2R project)-2.5 E 2.5<ad63>144 204
-S(olumns separated by tabs)-2.5 E 2.5<ad65>144 216 S
-(ach line contains the follo)-2.5 E(wing \214elds)-.25 E
-(yyyy\255mm\255ddThh:mm:ss.sssZ lon lat q n d h)180 228 Q 2.5<ad79>144
-240 S(yyy: four\255digit year)-2.5 E 2.5<ad6d>144 252 S(m: inte)-2.5 E
-(ger month of year)-.15 E 2.5<ad64>144 264 S(d: inte)-2.5 E
-(ger day of month)-.15 E 2.5<ad54>144 276 S 2.5(:t)-3 G
-(he letter "T" is al)-2.5 E -.1(wa)-.1 G
-(ys between the date and the time).1 E 2.5<ad68>144 288 S(h: inte)-2.5 E
-(ger hour of day)-.15 E 2.5<ad6d>144 300 S(m: inte)-2.5 E
-(ger minute of hour)-.15 E 2.5<ad73>144 312 S
-(s.sss: decimal second of minute)-2.5 E 2.5<ad5a>144 324 S 2.5(:t)-2.5 G
-(he letter "Z" is al)-2.5 E -.1(wa)-.1 G
-(ys there to specify UTC time zone).1 E 2.5<ad6c>144 336 S
-(o: decimal longitude \(de)-2.5 E(g\) \(\255180 to +180)-.15 E 2.5<ad6c>
-144 348 S(a: decimal latitude \(de)-2.5 E(g\) \(\25590 to +90\))-.15 E
-2.5<ad71>144 360 S 2.5(:G)-2.5 G(PS quality)-2.5 E 2.5<ad6e>144 372 S
-2.5(:n)-2.5 G(umber of GPS satellites)-2.5 E 2.5<ad64>144 384 S 2.5(:G)
--2.5 G(PS dilution)-2.5 E 2.5<ad68>144 396 S 2.5(:G)-2.5 G
-(PS antenna height \(m\))-2.5 E/F1 10.95/Times-Bold at 0 SF(EXAMPLES)72
-424.8 Q F0 .726(Suppose the user has a Simrad EM120 data \214le called \
-"0051_20010829_223755.mb57" that requires pro-)108 436.8 R(cessing.)108
-448.8 Q 7.752(Editing the bath)108 472.8 R 7.752
-(ymetry data in this \214le with mbedit will generate an edit sa)-.05 F
-8.053 -.15(ve \214)-.2 H(le).15 E 30.498
-("0051_20010829_223755.mb57.esf" and an mbprocess parameter \214le)108
-484.8 R 2.5("0051_20010829_223755.mb57.par". The)108 496.8 R
-(contents of the parameter \214le are:)2.5 E
-(## MB\255System processing parameter \214le)110.5 520.8 Q
-(## Written by mb_pr_writepar v)110.5 532.8 Q
-(ersion $Id: mbprocess.ps 2252 2015-07-01 19:35:37Z caress $)-.15 E
-(## MB\255system V)110.5 544.8 Q(ersion 5.0.beta22)-1.11 E
-(## Generated by user <caress> on cpu <menard> at <Fri Sep)110.5 556.8 Q
-2.5(62)5 G(1:27:41 2002>)-2.5 E(##)110.5 568.8 Q(##)110.5 580.8 Q(## F)
-110.5 592.8 Q(orces e)-.15 E(xplicit reading of parameter modes.)-.15 E
-(EXPLICIT)110.5 604.8 Q(##)110.5 616.8 Q(## General P)110.5 628.8 Q
-(arameters:)-.15 E(FORMA)110.5 640.8 Q 2.5(T5)-1.11 G(7)-2.5 E
-(INFILE /data/0051_20010829_223755.mb57)110.5 652.8 Q
-(OUTFILE /data/0051_20010829_223755p.mb57)110.5 664.8 Q(##)110.5 676.8 Q
-(## Na)110.5 688.8 Q(vig)-.2 E(ation Mer)-.05 E(ging:)-.18 E -.35(NA)
-110.5 700.8 S(VMODE 0)-1 E -.35(NA)110.5 712.8 S
-(VFILE /data/0051_20010829_223755.mb57.n)-1 E -.15(ve)-.4 G -.35(NA)
-110.5 724.8 S(VFORMA)-1 E 2.5(T0)-1.11 G(MB\255System 5.0)72 768 Q
-(10 No)129.895 E -.15(ve)-.15 G(mber 2014).15 E(18)185.545 E 0 Cg EP
-%%Page: 19 19
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 144.245(mbprocess\(1\) MB\255System)72 48 R
-144.245(5.0 mbprocess\(1\))2.5 F -.35(NA)110.5 84 S(VHEADING 0)-1 E -.35
-(NA)110.5 96 S(VSPEED 0)-1 E -.35(NA)110.5 108 S(VDRAFT 0)-1 E -.35(NA)
-110.5 120 S -.91 -1.35(VA T)-1 H(TITUDE 0)1.35 E -.35(NA)110.5 132 S
-(VINTERP 0)-1 E -.35(NA)110.5 144 S(VTIMESHIFT 0.000000)-1 E(##)110.5
-156 Q(## Na)110.5 168 Q(vig)-.2 E(ation Of)-.05 E(fsets and Shifts:)-.25
-E -.35(NA)110.5 180 S(VSHIFT 0)-1 E -.35(NA)110.5 192 S -.4(VO)-1 G
-(FFSETX 0.000000).4 E -.35(NA)110.5 204 S -.4(VO)-1 G(FFSETY 0.000000).4
-E -.35(NA)110.5 216 S -.4(VO)-1 G(FFSETZ 0.000000).4 E -.35(NA)110.5 228
-S(VSHIFTLON 0.000000)-1 E -.35(NA)110.5 240 S(VSHIFTLA)-1 E 2.5(T0)-1.11
-G(.000000)-2.5 E(##)110.5 252 Q(## Adjusted Na)110.5 264 Q(vig)-.2 E
-(ation Mer)-.05 E(ging:)-.18 E -.35(NA)110.5 276 S -1.35(VA)-1 G
-(DJMODE 0)1.35 E -.35(NA)110.5 288 S -1.35(VA)-1 G(DJFILE)1.35 E -.35
-(NA)110.5 300 S -1.35(VA)-1 G(DJINTERP 0)1.35 E(##)110.5 312 Q
-(## Attitude Mer)110.5 324 Q(ging:)-.18 E -1.11(AT)110.5 336 S
-(TITUDEMODE 0)1.11 E -1.11(AT)110.5 348 S(TITUDEFILE)1.11 E -1.11(AT)
-110.5 360 S(TITUDEFORMA)1.11 E 2.5(T1)-1.11 G(##)110.5 372 Q
-(## Sonardepth Mer)110.5 384 Q(ging:)-.18 E(SON)110.5 396 Q
-(ARDEPTHMODE 0)-.35 E(SON)110.5 408 Q(ARDEPTHFILE)-.35 E(SON)110.5 420 Q
-(ARDEPTHFORMA)-.35 E 2.5(T1)-1.11 G(##)110.5 432 Q(## Data cutting:)
-110.5 444 Q -.4(DA)110.5 456 S -1.04 -.93(TA C)-.71 H(UTCLEAR).93 E(##)
-110.5 468 Q(## Bath)110.5 480 Q(ymetry Flagging:)-.05 E(EDITSA)110.5 492
-Q(VEMODE 1)-1.35 E(EDITSA)110.5 504 Q
-(VEFILE /data/0051_20010829_223755.mb57.esf)-1.35 E(##)110.5 516 Q
-(## Bath)110.5 528 Q(ymetry Recalculation:)-.05 E(SVPMODE 0)110.5 540 Q
-(SVPFILE)110.5 552 Q(SSVMODE 0)110.5 564 Q(SSV 0.000000)110.5 576 Q
-(TTMODE 0)110.5 588 Q(TTMUL)110.5 600 Q(TIPL)-.92 E 2.5(Y1)-1 G(.000000)
--2.5 E(ANGLEMODE 0)110.5 612 Q(SOUNDSPEEDREF 1)110.5 624 Q(##)110.5 636
-Q(## Draft Correction:)110.5 648 Q(DRAFTMODE 0)110.5 660 Q
-(DRAFT 0.000000)110.5 672 Q(DRAFT)110.5 684 Q(OFFSET 0.000000)-.18 E
-(DRAFTMUL)110.5 696 Q(TIPL)-.92 E 2.5(Y1)-1 G(.000000)-2.5 E(##)110.5
-708 Q(## Hea)110.5 720 Q .3 -.15(ve C)-.2 H(orrection:).15 E
-(MB\255System 5.0)72 768 Q(10 No)129.895 E -.15(ve)-.15 G(mber 2014).15
-E(19)185.545 E 0 Cg EP
-%%Page: 20 20
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 144.245(mbprocess\(1\) MB\255System)72 48 R
-144.245(5.0 mbprocess\(1\))2.5 F(HEA)110.5 84 Q(VEMODE 0)-1.35 E(HEA)
-110.5 96 Q(VEOFFSET 0.000000)-1.35 E(HEA)110.5 108 Q(VEMUL)-1.35 E(TIPL)
--.92 E 2.5(Y1)-1 G(.000000)-2.5 E(##)110.5 120 Q(## Le)110.5 132 Q -.15
-(ve)-.25 G 2.5(rC).15 G(orrection:)-2.5 E(LEVERMODE 0)110.5 144 Q(VR)
-110.5 156 Q(UOFFSETX 0.000000)-.4 E(VR)110.5 168 Q(UOFFSETY 0.000000)-.4
-E(VR)110.5 180 Q(UOFFSETZ 0.000000)-.4 E(SON)110.5 192 Q(AR)-.35 E
-(OFFSETX 0.000000)-.4 E(SON)110.5 204 Q(AR)-.35 E(OFFSETY 0.000000)-.4 E
-(SON)110.5 216 Q(AR)-.35 E(OFFSETZ 0.000000)-.4 E(##)110.5 228 Q
-(## Roll Correction:)110.5 240 Q -.4(RO)110.5 252 S(LLBIASMODE 0).4 E
--.4(RO)110.5 264 S(LLBIAS 0.000000).4 E -.4(RO)110.5 276 S(LLBIASPOR).4
-E 2.5(T0)-.6 G(.000000)-2.5 E -.4(RO)110.5 288 S(LLBIASSTBD 0.000000).4
-E(##)110.5 300 Q(## Pitch Correction:)110.5 312 Q(PITCHBIASMODE 0)110.5
-324 Q(PITCHBIAS 0.000000)110.5 336 Q(##)110.5 348 Q
-(## Heading Correction:)110.5 360 Q(HEADINGMODE 0)110.5 372 Q
-(HEADINGOFFSET 0.000000)110.5 384 Q(##)110.5 396 Q(## T)110.5 408 Q
-(ide Correction:)-.35 E(TIDEMODE 0)110.5 420 Q(TIDEFILE)110.5 432 Q
-(TIDEFORMA)110.5 444 Q 2.5(T1)-1.11 G(##)110.5 456 Q
-(## Amplitude Correction:)110.5 468 Q(AMPCORRMODE 0)110.5 480 Q
-(AMPCORRFILE)110.5 492 Q(AMPCORR)110.5 504 Q(TYPE 0)-.6 E
-(AMPCORRSYMMETR)110.5 516 Q 2.5(Y1)-.65 G(AMPCORRANGLE 30.000000)110.5
-528 Q(AMPCORRSLOPE 0)110.5 540 Q(##)110.5 552 Q(## Sidescan Correction:)
-110.5 564 Q(SSCORRMODE 0)110.5 576 Q(SSCORRFILE)110.5 588 Q(SSCORR)110.5
-600 Q(TYPE 0)-.6 E(SSCORRSYMMETR)110.5 612 Q 2.5(Y1)-.65 G
-(SSCORRANGLE 30.000000)110.5 624 Q(SSCORRSLOPE 0)110.5 636 Q(##)110.5
-648 Q(## Sidescan Recalculation:)110.5 660 Q(SSRECALCMODE 0)110.5 672 Q
-(SSPIXELSIZE 0.000000)110.5 684 Q(SSSW)110.5 696 Q -1.11(AT)-1.2 G
-(HWIDTH 0.000000)1.11 E(SSINTERPOLA)110.5 708 Q(TE 0)-1.11 E(##)110.5
-720 Q(MB\255System 5.0)72 768 Q(10 No)129.895 E -.15(ve)-.15 G
-(mber 2014).15 E(20)185.545 E 0 Cg EP
-%%Page: 21 21
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 144.245(mbprocess\(1\) MB\255System)72 48 R
-144.245(5.0 mbprocess\(1\))2.5 F(## Metadata Insertion:)110.5 84 Q(MET)
-110.5 96 Q -1.35(AV)-.93 G(ESSEL)1.35 E(MET)110.5 108 Q(AINSTITUTION)
--.93 E(MET)110.5 120 Q(APLA)-.93 E(TFORM)-1.11 E(MET)110.5 132 Q(ASON)
--.93 E(AR)-.35 E(MET)110.5 144 Q(ASON)-.93 E(AR)-.35 E(VERSION)-.8 E
-(MET)110.5 156 Q -.4(AC)-.93 G -.4(RU).4 G(ISEID).4 E(MET)110.5 168 Q
--.4(AC)-.93 G -.4(RU).4 G(ISEN).4 E(AME)-.35 E(MET)110.5 180 Q(API)-.93
-E(MET)110.5 192 Q(APIINSTITUTION)-.93 E(MET)110.5 204 Q -.4(AC)-.93 G
-(LIENT).4 E(MET)110.5 216 Q(ASVCORRECTED \2551)-.93 E(MET)110.5 228 Q
--1.11(AT)-.93 G(IDECORRECTED \2551)1.11 E(MET)110.5 240 Q(AB)-.93 E
--1.11(AT)-.35 G(HEDITMANU)1.11 E(AL \2551)-.4 E(MET)110.5 252 Q(AB)-.93
-E -1.11(AT)-.35 G(HEDIT)1.11 E -.55(AU)-.93 G .36 -.18(TO \255).55 H(1)
-.18 E(MET)110.5 264 Q(AR)-.93 E(OLLBIAS 0.000000)-.4 E(MET)110.5 276 Q
-(APITCHBIAS 0.000000)-.93 E(MET)110.5 288 Q(AHEADINGBIAS 0.000000)-.93 E
-(MET)110.5 300 Q(ADRAFT 0.000000)-.93 E(##)110.5 312 Q
-(## Processing Kluges)110.5 324 Q 12.843(Editing the na)108 348 R(vig)
--.2 E 12.843(ation with mbna)-.05 F -.15(ve)-.2 G 12.843
-(dit will generate a na).15 F(vig)-.2 E 12.843(ation \214le named)-.05 F
-("0051_20010829_223755.mb57.n)108 360 Q -.15(ve)-.4 G 8.026("a).15 G
-5.526(nd will modify the parameter \214le. The changed lines in)-8.026 F
-("0051_20010829_223755.mb57.par" are:)108 372 Q(## Na)110.5 396 Q(vig)
--.2 E(ation Mer)-.05 E(ging:)-.18 E -.35(NA)110.5 408 S(VMODE 1)-1 E
--.35(NA)110.5 420 S(VFILE /data/0051_20010829_223755.mb57.n)-1 E -.15
-(ve)-.4 G -.35(NA)110.5 432 S(VFORMA)-1 E 2.5(T9)-1.11 G -.35(NA)110.5
-444 S(VHEADING 1)-1 E -.35(NA)110.5 456 S(VSPEED 1)-1 E -.35(NA)110.5
-468 S(VDRAFT 1)-1 E -.35(NA)110.5 480 S -.91 -1.35(VA T)-1 H(TITUDE 1)
-1.35 E .061(At this point, running)108 504 R/F1 10/Times-Bold at 0 SF(mbpr)
-2.561 E(ocess)-.18 E F0 .062
-(on "0051_20010829_223755.mb57" will apply the bath)2.562 F .062
-(ymetry \215ags from)-.05 F F1(mbedit)108 516 Q F0(and mer)2.5 E
-(ge the na)-.18 E(vig)-.2 E(ation from)-.05 E F1(mbna)2.5 E -.1(ve)-.25
-G(dit).1 E F0 2.5(,b)C(ut will not modify the data in an)-2.7 E 2.5(yo)
--.15 G(ther w)-2.5 E(ay)-.1 E(.)-.65 E .417(If the user w)108 540 R .417
-(ants to recalculate the bath)-.1 F .417
-(ymetry using an SVP \214le "0051_20010829_223755.mb57.svp" and)-.05 F
-2.5(ar)108 552 S(oll bias correction of +0.5 de)-2.5 E(grees, the follo)
--.15 E(wing will suf)-.25 E(\214ce:)-.25 E 3.753
-(mbset \255I 0051_20010829_223755.mb57)128 576 R
-(\255PSVPFILE:0051_20010829_223755.mb57.svp)46.254 E(\255PR)108 588 Q 40
-(OLLBIAS:0.5 \255PDRAFT)-.4 F 40(:1.95 \255V)-.5 F(The af)108 612 Q
-(fected lines in "0051_20010829_223755.mb57.par" are:)-.25 E(##)110.5
-636 Q(## Bath)110.5 648 Q(ymetry Recalculation:)-.05 E(SVPMODE 1)110.5
-660 Q(SVPFILE 0051_20010829_223755.mb57.svp)110.5 672 Q(SSVMODE 0)110.5
-684 Q(SSV 0.000000)110.5 696 Q(TTMODE 0)110.5 708 Q(TTMUL)110.5 720 Q
-(TIPL)-.92 E 2.5(Y1)-1 G(.000000)-2.5 E(MB\255System 5.0)72 768 Q(10 No)
-129.895 E -.15(ve)-.15 G(mber 2014).15 E(21)185.545 E 0 Cg EP
-%%Page: 22 22
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 144.245(mbprocess\(1\) MB\255System)72 48 R
-144.245(5.0 mbprocess\(1\))2.5 F(ANGLEMODE 0)110.5 84 Q(SOUNDSPEEDREF 1)
-110.5 96 Q(##)110.5 108 Q(## Draft Correction:)110.5 120 Q(DRAFTMODE 4)
-110.5 132 Q(DRAFT 1.950000)110.5 144 Q(DRAFT)110.5 156 Q
-(OFFSET 0.000000)-.18 E(DRAFTMUL)110.5 168 Q(TIPL)-.92 E 2.5(Y1)-1 G
-(.000000)-2.5 E(##)110.5 180 Q(## Roll Correction:)110.5 192 Q -.4(RO)
-110.5 204 S(LLBIASMODE 1).4 E -.4(RO)110.5 216 S(LLBIAS 0.500000).4 E
--.4(RO)110.5 228 S(LLBIASPOR).4 E 2.5(T0)-.6 G(.000000)-2.5 E -.4(RO)
-110.5 240 S(LLBIASSTBD 0.000000).4 E 1.6 -.8(To p)108 264 T
-(rocess the data, run mbprocess:).8 E
-(mbprocess \255I0051_20010829_223755.mb57 \255V)128 288 Q
-(The output to the terminal is:)110.5 312 Q(Program mbprocess)110.5 324
-Q -1.11(Ve)110.5 336 S
-(rsion $Id: mbprocess.ps 2252 2015-07-01 19:35:37Z caress $)1.11 E
-(MB\255System V)110.5 348 Q(ersion 5.0.beta07)-1.11 E
-(Program <mbprocess>)110.5 372 Q -1.11(Ve)110.5 384 S
-(rsion $Id: mbprocess.ps 2252 2015-07-01 19:35:37Z caress $)1.11 E
-(MB\255system V)110.5 396 Q(ersion 5.0.beta07)-1.11 E
-(Program Operation:)110.5 420 Q(Input \214le:)115.5 432 Q
-(0051_20010829_223755.mb57)15 E -.15(Fo)115.5 444 S 22.5(rmat: 57).15 F
-(Files processed only if out of date.)115.5 456 Q
-(Comments embedded in output.)115.5 468 Q
-(Data processed \255 out of date:)110.5 492 Q 2.5
-(Input: 0051_20010829_223755.mb57)113 504 R(Output: /u/mb)113 516 Q
-(user/surv)-.2 E -.15(ey)-.15 G(/0051_20010829_223755p.mb57).15 E
-(Input and Output Files:)110.5 540 Q -.15(Fo)115.5 552 S 57.5(rmat: 57)
-.15 F(Input \214le:)115.5 564 Q(0051_20010829_223755.mb57)50 E
-(Output \214le:)115.5 576 Q(/u/mb)47.5 E(user/surv)-.2 E -.15(ey)-.15 G
-(/0051_20010829_223755p.mb57).15 E(Comments in output: ON)115.5 588 Q
-(Na)110.5 612 Q(vig)-.2 E(ation Mer)-.05 E(ging:)-.18 E(Na)115.5 624 Q
-(vig)-.2 E(ation mer)-.05 E(ged from na)-.18 E(vig)-.2 E(ation \214le.)
--.05 E(Heading mer)115.5 636 Q(ged from na)-.18 E(vig)-.2 E
-(ation \214le.)-.05 E(Speed mer)115.5 648 Q(ged from na)-.18 E(vig)-.2 E
-(ation \214le.)-.05 E(Draft mer)115.5 660 Q(ged from na)-.18 E(vig)-.2 E
-(ation \214le.)-.05 E(Na)115.5 672 Q(vig)-.2 E(ation \214le:)-.05 E
-(/u/mb)37.5 E(user/surv)-.2 E -.15(ey)-.15 G
-(/0051_20010829_223755.mb57.n).15 E -.15(ve)-.4 G(Na)115.5 684 Q(vig)-.2
-E(ation algorithm:)-.05 E(linear interpolation)25 E(Na)115.5 696 Q(vig)
--.2 E(ation time shift:)-.05 E(0.000000)22.5 E(Na)110.5 720 Q(vig)-.2 E
-(ation Of)-.05 E(fsets and Shifts:)-.25 E(MB\255System 5.0)72 768 Q
-(10 No)129.895 E -.15(ve)-.15 G(mber 2014).15 E(22)185.545 E 0 Cg EP
-%%Page: 23 23
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 144.245(mbprocess\(1\) MB\255System)72 48 R
-144.245(5.0 mbprocess\(1\))2.5 F(Na)115.5 84 Q(vig)-.2 E
-(ation positions not shifted.)-.05 E(Adjusted Na)110.5 108 Q(vig)-.2 E
-(ation Mer)-.05 E(ging:)-.18 E(Na)115.5 120 Q(vig)-.2 E(ation not mer)
--.05 E(ged from adjusted na)-.18 E(vig)-.2 E(ation \214le.)-.05 E
-(Adjusted na)115.5 132 Q(vig)-.2 E(ation \214le:)-.05 E(Adjusted na)
-115.5 144 Q(vig)-.2 E(ation algorithm: linear interpolation)-.05 E
-(Data Cutting:)110.5 168 Q(Data cutting disabled.)115.5 180 Q(Bath)110.5
-204 Q(ymetry Editing:)-.05 E(Bath)115.5 216 Q
-(ymetry edits applied from \214le.)-.05 E(Bath)115.5 228 Q
-(ymetry edit \214le:)-.05 E(0051_20010829_223755.mb57.esf)25 E(Bath)
-110.5 252 Q(ymetry Recalculation:)-.05 E(Bath)115.5 264 Q
-(ymetry recalculated by raytracing.)-.05 E(SVP \214le:)115.5 276 Q
-(0051_20010829_223755.mb57.svp)55 E(SSV not modi\214ed.)115.5 288 Q
-(SSV of)115.5 300 Q 25(fset/constant: 0.000000)-.25 F(m/s)2.5 E -.35(Tr)
-115.5 312 S -2.25 -.2(av e).35 H 2.5(lt).2 G(ime multiplier:)-2.5 E
-(1.000000 m)20 E(Bath)110.5 336 Q(ymetry W)-.05 E
-(ater Sound Speed Reference:)-.8 E(Output bath)115.5 348 Q
-(ymetry reference:)-.05 E(CORRECTED)7.5 E
-(Depths recalculated as corrected)115.5 360 Q(Draft Correction:)110.5
-384 Q(Draft set to constant.)115.5 396 Q(Draft constant:)115.5 408 Q
-(1.950000 m)40 E(Draft of)115.5 420 Q 42.5(fset: 0.000000)-.25 F(m)2.5 E
-(Draft multiplier:)115.5 432 Q(1.000000 m)35 E(Hea)110.5 456 Q .3 -.15
-(ve C)-.2 H(orrection:).15 E(Hea)115.5 468 Q .3 -.15(ve n)-.2 H
-(ot modi\214ed.).15 E(Hea)115.5 480 Q .3 -.15(ve o)-.2 H -.25(ff).15 G
-42.5(set: 0.000000).25 F(m)2.5 E(Hea)115.5 492 Q .3 -.15(ve m)-.2 H 32.5
-(ultiplier: 1.000000).15 F(m)2.5 E(Le)110.5 516 Q -.15(ve)-.25 G 2.5(rC)
-.15 G(orrection:)-2.5 E(Le)115.5 528 Q -.15(ve)-.25 G 2.5(rc).15 G
-(alculation of)-2.5 E(f.)-.25 E -.35(Ti)110.5 552 S(de Correction:).35 E
--.35(Ti)115.5 564 S(de calculation of).35 E(f.)-.25 E(Roll Correction:)
-110.5 588 Q(Roll of)115.5 600 Q(fset by bias.)-.25 E(Roll bias:)115.5
-612 Q(0.500000 de)52.5 E(g)-.15 E(Port roll bias:)115.5 624 Q
-(0.000000 de)40 E(g)-.15 E(Starboard roll bias:)115.5 636 Q(0.000000 de)
-27.5 E(g)-.15 E(Pitch Correction:)110.5 660 Q(Pitch not modi\214ed.)
-115.5 672 Q(Pitch bias:)115.5 684 Q(0.000000 de)50 E(g)-.15 E
-(Heading Correction:)110.5 708 Q(Heading not modi\214ed.)115.5 720 Q
-(MB\255System 5.0)72 768 Q(10 No)129.895 E -.15(ve)-.15 G(mber 2014).15
-E(23)185.545 E 0 Cg EP
-%%Page: 24 24
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 144.245(mbprocess\(1\) MB\255System)72 48 R
-144.245(5.0 mbprocess\(1\))2.5 F(Heading of)115.5 84 Q 37.5
-(fset: 0.000000)-.25 F(de)2.5 E(g)-.15 E(Amplitude Corrections:)110.5
-108 Q(Amplitude correction of)115.5 120 Q(f.)-.25 E
-(Sidescan Corrections:)110.5 144 Q(Sidescan correction of)115.5 156 Q
-(f.)-.25 E(Sidescan Recalculation:)110.5 180 Q
-(Sidescan not recalculated.)115.5 192 Q(Sidescan pix)115.5 204 Q
-(el size:)-.15 E(0.000000)27.5 E(Sidescan sw)115.5 216 Q(ath width:)-.1
-E(0.000000)25 E(Sidescan interpolation:)115.5 228 Q(0)20 E
-(Metadata Insertion:)110.5 252 Q(Metadata v)115.5 264 Q(essel:)-.15 E
-(Metadata institution:)115.5 276 Q(Metadata platform:)115.5 288 Q
-(Metadata sonar:)115.5 300 Q(Metadata sonarv)115.5 312 Q(ersion:)-.15 E
-(Metadata cruiseid:)115.5 324 Q(Metadata cruisename:)115.5 336 Q
-(Metadata pi:)115.5 348 Q(Metadata piinstitution:)115.5 360 Q
-(Metadata client:)115.5 372 Q(Metadata svcorrected:)115.5 384 Q<ad31>25
-E(Metadata tidecorrected)115.5 396 Q<ad31>22.5 E
-(Metadata batheditmanual)115.5 408 Q<ad31>20 E(Metadata batheditauto:)
-115.5 420 Q<ad31>22.5 E(Metadata rollbias:)115.5 432 Q(0.000000)32.5 E
-(Metadata pitchbias:)115.5 444 Q(0.000000)30 E(Metadata headingbias:)
-115.5 456 Q(0.000000)25 E(Metadata draft:)115.5 468 Q(0.000000)40 E
-(236 na)110.5 492 Q(vig)-.2 E(ation records read)-.05 E(Na)110.5 504 Q
-2.5(vs)-.2 G(tart time: 2001 08 29 22:38:02.082999)-2.5 E(Na)110.5 516 Q
-2.5(ve)-.2 G(nd time:)-2.5 E(2001 08 29 23:37:22.322000)7.5 E(47 bath)
-110.5 540 Q(ymetry edits read)-.05 E(236 input data records)110.5 564 Q
-(3587 input na)110.5 576 Q 2.5(vr)-.2 G(ecords)-2.5 E
-(17 input comment records)110.5 588 Q(6617 input other records)110.5 600
-Q(236 output data records)110.5 612 Q(3587 output na)110.5 624 Q 2.5(vr)
--.2 G(ecords)-2.5 E(64 output comment records)110.5 636 Q
-(6617 output other records)110.5 648 Q(Generating inf \214le for /u/mb)
-110.5 672 Q(user/surv)-.2 E -.15(ey)-.15 G(/0051_20010829_223755p.mb57)
-.15 E(Generating fbt \214le for /u/mb)110.5 684 Q(user/surv)-.2 E -.15
-(ey)-.15 G(/0051_20010829_223755p.mb57).15 E(Generating fn)110.5 696 Q
-2.5<768c>-.4 G(le for /u/mb)-2.5 E(user/surv)-.2 E -.15(ey)-.15 G
-(/0051_20010829_223755p.mb57).15 E(MB\255System 5.0)72 768 Q(10 No)
-129.895 E -.15(ve)-.15 G(mber 2014).15 E(24)185.545 E 0 Cg EP
-%%Page: 25 25
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 144.245(mbprocess\(1\) MB\255System)72 48 R
-144.245(5.0 mbprocess\(1\))2.5 F/F1 10.95/Times-Bold at 0 SF(SEE ALSO)72 84
-Q/F2 10/Times-Bold at 0 SF(mbsystem)108 96 Q F0(\(1\),)A F2(mbset)2.5 E F0
-(\(1\),)A F2(mbedit)2.5 E F0(\(1\),)A F2(mbna)2.5 E -.1(ve)-.25 G(dit).1
-E F0(\(1\),)A F2(mb)2.5 E -.1(ve)-.15 G(locitytool).1 E F0(\(1\))A F1
--.11(BU)72 124.8 S(GS).11 E F0 -1.1(Yo)108 136.8 S 2.5(ut)1.1 G(ell me.)
--2.5 E(MB\255System 5.0)72 768 Q(10 No)129.895 E -.15(ve)-.15 G
-(mber 2014).15 E(25)185.545 E 0 Cg EP
-%%Trailer
-end
-%%EOF
diff --git a/src/ps/mbps.ps b/src/ps/mbps.ps
deleted file mode 100644
index 6ae16fb..0000000
--- a/src/ps/mbps.ps
+++ /dev/null
@@ -1,445 +0,0 @@
-%!PS-Adobe-3.0
-%%Creator: groff version 1.19.2
-%%CreationDate: Wed Jul  1 12:29:30 2015
-%%DocumentNeededResources: font Times-Roman
-%%+ font Times-Bold
-%%+ font Times-Italic
-%%DocumentSuppliedResources: procset grops 1.19 2
-%%Pages: 3
-%%PageOrder: Ascend
-%%DocumentMedia: Default 612 792 0 () ()
-%%Orientation: Portrait
-%%EndComments
-%%BeginDefaults
-%%PageMedia: Default
-%%EndDefaults
-%%BeginProlog
-%%BeginResource: procset grops 1.19 2
-%!PS-Adobe-3.0 Resource-ProcSet
-/setpacking where{
-pop
-currentpacking
-true setpacking
-}if
-/grops 120 dict dup begin
-/SC 32 def
-/A/show load def
-/B{0 SC 3 -1 roll widthshow}bind def
-/C{0 exch ashow}bind def
-/D{0 exch 0 SC 5 2 roll awidthshow}bind def
-/E{0 rmoveto show}bind def
-/F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def
-/G{0 rmoveto 0 exch ashow}bind def
-/H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/I{0 exch rmoveto show}bind def
-/J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def
-/K{0 exch rmoveto 0 exch ashow}bind def
-/L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/M{rmoveto show}bind def
-/N{rmoveto 0 SC 3 -1 roll widthshow}bind def
-/O{rmoveto 0 exch ashow}bind def
-/P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/Q{moveto show}bind def
-/R{moveto 0 SC 3 -1 roll widthshow}bind def
-/S{moveto 0 exch ashow}bind def
-/T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/SF{
-findfont exch
-[exch dup 0 exch 0 exch neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/MF{
-findfont
-[5 2 roll
-0 3 1 roll
-neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/level0 0 def
-/RES 0 def
-/PL 0 def
-/LS 0 def
-/MANUAL{
-statusdict begin/manualfeed true store end
-}bind def
-/PLG{
-gsave newpath clippath pathbbox grestore
-exch pop add exch pop
-}bind def
-/BP{
-/level0 save def
-1 setlinecap
-1 setlinejoin
-72 RES div dup scale
-LS{
-90 rotate
-}{
-0 PL translate
-}ifelse
-1 -1 scale
-}bind def
-/EP{
-level0 restore
-showpage
-}def
-/DA{
-newpath arcn stroke
-}bind def
-/SN{
-transform
-.25 sub exch .25 sub exch
-round .25 add exch round .25 add exch
-itransform
-}bind def
-/DL{
-SN
-moveto
-SN
-lineto stroke
-}bind def
-/DC{
-newpath 0 360 arc closepath
-}bind def
-/TM matrix def
-/DE{
-TM currentmatrix pop
-translate scale newpath 0 0 .5 0 360 arc closepath
-TM setmatrix
-}bind def
-/RC/rcurveto load def
-/RL/rlineto load def
-/ST/stroke load def
-/MT/moveto load def
-/CL/closepath load def
-/Fr{
-setrgbcolor fill
-}bind def
-/setcmykcolor where{
-pop
-/Fk{
-setcmykcolor fill
-}bind def
-}if
-/Fg{
-setgray fill
-}bind def
-/FL/fill load def
-/LW/setlinewidth load def
-/Cr/setrgbcolor load def
-/setcmykcolor where{
-pop
-/Ck/setcmykcolor load def
-}if
-/Cg/setgray load def
-/RE{
-findfont
-dup maxlength 1 index/FontName known not{1 add}if dict begin
-{
-1 index/FID ne{def}{pop pop}ifelse
-}forall
-/Encoding exch def
-dup/FontName exch def
-currentdict end definefont pop
-}bind def
-/DEFS 0 def
-/EBEGIN{
-moveto
-DEFS begin
-}bind def
-/EEND/end load def
-/CNT 0 def
-/level1 0 def
-/PBEGIN{
-/level1 save def
-translate
-div 3 1 roll div exch scale
-neg exch neg exch translate
-0 setgray
-0 setlinecap
-1 setlinewidth
-0 setlinejoin
-10 setmiterlimit
-[]0 setdash
-/setstrokeadjust where{
-pop
-false setstrokeadjust
-}if
-/setoverprint where{
-pop
-false setoverprint
-}if
-newpath
-/CNT countdictstack def
-userdict begin
-/showpage{}def
-/setpagedevice{}def
-}bind def
-/PEND{
-countdictstack CNT sub{end}repeat
-level1 restore
-}bind def
-end def
-/setpacking where{
-pop
-setpacking
-}if
-%%EndResource
-%%EndProlog
-%%BeginSetup
-%%BeginFeature: *PageSize Default
-<< /PageSize [ 612 792 ] /ImagingBBox null >> setpagedevice
-%%EndFeature
-%%IncludeResource: font Times-Roman
-%%IncludeResource: font Times-Bold
-%%IncludeResource: font Times-Italic
-grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72
-def/PL 792 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron/Zcaron
-/scaron/zcaron/Ydieresis/trademark/quotesingle/Euro/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/space/exclam/quotedbl/numbersign/dollar/percent
-/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen
-/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon
-/semicolon/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O
-/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright/circumflex
-/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y
-/z/braceleft/bar/braceright/tilde/.notdef/quotesinglbase/guillemotleft
-/guillemotright/bullet/florin/fraction/perthousand/dagger/daggerdbl
-/endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut
-/dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash
-/quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen
-/brokenbar/section/dieresis/copyright/ordfeminine/guilsinglleft
-/logicalnot/minus/registered/macron/degree/plusminus/twosuperior
-/threesuperior/acute/mu/paragraph/periodcentered/cedilla/onesuperior
-/ordmasculine/guilsinglright/onequarter/onehalf/threequarters
-/questiondown/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE
-/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex
-/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis
-/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn
-/germandbls/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla
-/egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis
-/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide/oslash
-/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis]def
-/Times-Italic at 0 ENC0/Times-Italic RE/Times-Bold at 0 ENC0/Times-Bold RE
-/Times-Roman at 0 ENC0/Times-Roman RE
-%%EndSetup
-%%Page: 1 1
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 161.49(MBPS\(1\) MB-System)72 48 R 161.49
-(5.0 MBPS\(1\))2.5 F/F1 10.95/Times-Bold at 0 SF -.219(NA)72 84 S(ME).219 E
-/F2 10/Times-Bold at 0 SF(mbps)108 96 Q F0 2.5<ad47>2.5 G
-(enerates a PostScript perspecti)-2.5 E .3 -.15(ve p)-.25 H
-(lot of a piece of sw).15 E(ath sonar data.)-.1 E F1(VERSION)72 124.8 Q
-F0 -1.11(Ve)108 136.8 S(rsion 5.0)1.11 E F1(SYNOPSIS)72 165.6 Q F2(mbps)
-108 177.6 Q F0([)5.055 E F2<ad46>A/F3 10/Times-Italic at 0 SF(format)A F2
-<ad49>5.055 E F3(\214lename)A F2 2.554(\255Nnpingsmax \255Ppings \255A)
-5.054 F F3(alpha)A F2<ad42>5.054 E F3(yr/mo/da/hr/mn/sc)A F2<ad44>5.054
-E F3(vie)A(w_dir)-.15 E(ection)-.37 E F2<ad45>108 189.6 Q F3
-(yr/mo/da/hr/mn/sc)A F2<ad47>5.227 E F3(gap)A F2<ad4b>5.227 E F3(eta)A
-F2<ad53>5.227 E F3(speedmin)A F2<ad54>5.227 E F3("title")A F2<ad58>5.227
-E F3(ve)A F2<ad57>5.227 E F3(meter)A(s_per_inc)-.1 E(h)-.15 E F2<ad59>
-5.228 E F3(display_stats)A F2<ad5a>108 201.6 Q F3(display_scales)A F2
-<ad5620ad48>2.5 E F3(])A F1(DESCRIPTION)72 230.4 Q F2(mbps)108 242.4 Q
-F0 .351(is a utility to generate an \(almost correct\) perspecti)2.851 F
-.651 -.15(ve v)-.25 H(ie).15 E 2.85(wo)-.25 G 2.85(fap)-2.85 G .35
-(iece of sw)-2.85 F .35(ath sonar data. It is espe-)-.1 F .633
-(cially useful to get a detailed vie)108 254.4 R 3.133(wo)-.25 G 3.133
-(ft)-3.133 G .633(he quality of the data \(which is not v)-3.133 F .634
-(ery well assessed in a contour)-.15 F .323(plot\) and to mak)108 266.4
-R 2.823(ep)-.1 G .323(retty pictures of features that \214t within a sw)
--2.823 F 2.822(ath. The)-.1 F .322(output is PostScript code, that can)
-2.822 F .5(be piped to a PostScript printer)108 278.4 R 3(,o)-.4 G 3(rt)
--3 G 3(oa\214)-3 G 3(le. The)-3 F .5
-(options are a bit hard to interpret without a picture. Con-)3 F .324
-(sider a frame of reference tied to the ship, with z upw)108 290.4 R
-.323(ard, x across the track \(port being ne)-.1 F -.05(ga)-.15 G(ti).05
-E -.15(ve)-.25 G 2.823(,s).15 G(tarboard)-2.823 E(positi)108 302.4 Q
--.15(ve)-.25 G 3.03(\)a).15 G .53(nd y along the track. Using the)-3.03
-F F2<ad44>3.03 E F0 .531(option, the data can be vie)3.03 F .531
-(wed from port, starboard, or from)-.25 F .195
-(the back. In the \214rst tw)108 314.4 R 2.695(oc)-.1 G .195(ases, the \
-y-axis is horizontal in the plot; in the third case, the x-axis is hori\
-zontal.)-2.695 F .041(The angle)108 326.4 R F3(alpha)2.541 E F0 .041
-(is the angle between the x-axis and the y-axis in the \214nal vie)2.541
-F(w;)-.25 E F3(eta)2.542 E F0 .042(is the angle of ele)2.542 F -.25(va)
--.25 G(tion).25 E 1.25(of the observing point \(90 de)108 338.4 R 1.249
-(grees being the zenith\).)-.15 F 1.249
-(The data points are plotted as triangular polygons)6.249 F .473
-(with the v)108 350.4 R .473
-(ertices at three good \(ie. un\215agged\) adjacent data points. A gi)
--.15 F -.15(ve)-.25 G 2.973(np).15 G .473
-(oint is adjacent to 8 points in)-2.973 F .125(the surrounding sw)108
-362.4 R .125(ath \(top, bottom, 2 sides, and 4 corners\).)-.1 F(No)5.125
-E 2.625(wt)-.25 G .124(hat you are thoroughly confused, just try)-2.625
-F .638(plotting a half-hour or so of data from your f)108 374.4 R -.2
-(avo)-.1 G .638(rite place. The def).2 F .639
-(aults are such that a decent plot should)-.1 F .879(come out.)108 386.4
-R .878(The plot will be scaled automatically to \214t on a page, and wi\
-ll contain v)5.879 F .878(ertical and horizontal)-.15 F .238
-(scales, an arro)108 398.4 R 2.738(wp)-.25 G .238
-(ointing in the direction of the ship')-2.738 F 2.738(sm)-.55 G .238
-(otion, coordinate ax)-2.738 F .238(es, and miscellaneous informa-)-.15
-F 1.05(tion identifying the piece of data being plotted.)108 410.4 R(No)
-6.049 E 3.549(wc)-.25 G 1.049
-(hange some of the options, and things should get)-3.549 F(clearer)108
-422.4 Q(.)-.55 E F1 -.548(AU)72 451.2 S(THORSHIP).548 E F0(Russ T)108
-463.2 Q 2.5(.A)-.74 G(le)-2.5 E(xander)-.15 E -.15(Fo)113 475.2 S
-(rmerly at Uni).15 E -.15(ve)-.25 G
-(rsity of California at Santa Barbara).15 E(Alberto Malin)108 487.2 Q
--.15(ve)-.4 G(rno \(no).15 E 2.5(wa)-.25 G 2.5(tS)-2.5 G(chlumber)-2.5 E
-(ger\))-.18 E(Lamont-Doherty Earth Observ)113 499.2 Q(atory)-.25 E F1
-(OPTIONS)72 528 Q F2<ad41>108 540 Q F3(alpha)23.08 E F0 1.741
-(Sets the angle alpha \(de)144 552 R 1.742(grees\) between the y-axis \
-\(shiptrack direction\) and the x-axis \(across-)-.15 F(track\). Def)144
-564 Q(ault =)-.1 E F3(alpha = 70.)2.5 E F2<ad42>108 580.8 Q F3
-(yr/mo/da/hr/mn/sc)23.63 E F0 .155
-(This option sets the starting time for data allo)144 592.8 R .155
-(wed in the input data.)-.25 F(The)5.155 E F2<ad45>2.655 E F0 .155
-(option sets the ending)2.655 F .195
-(time for data. If the starting time is before the ending time, then an)
-144 604.8 R 2.695(yd)-.15 G .196(ata with a time stamp before)-2.695 F
-.444(the starting time or after the ending time is ignored. If instead \
-the starting time is after the ending)144 616.8 R .194(time, then an)144
-628.8 R 2.694(yd)-.15 G .194(ata between the ending and starting time w\
-ill be ignored. This scheme allo)-2.694 F .195(ws time)-.25 F(windo)144
-640.8 Q 5.376(wing both inside and outside a speci\214ed interv)-.25 F
-7.876(al. Def)-.25 F(ault:)-.1 E F3(yr/mo/da/hr/mn/sc)7.876 E F0(=)7.876
-E(1962/2/21/10/30/0.)144 652.8 Q F2<ad44>108 669.6 Q F3(vie)23.08 E
-(w_dir)-.15 E(ection)-.37 E F0 .79(Sets the vie)144 681.6 R .79
-(wing direction;)-.25 F F3(vie)3.29 E(wdir)-.15 E F0 .791
-(is a single character)3.29 F 3.291(,e)-.4 G .791(ither P/p \(vie)-3.291
-F 3.291(wf)-.25 G .791(rom the port side\), S/s)-3.291 F
-(\(starboard\), or B/b \(back\). Def)144 693.6 Q(ault)-.1 E F3(vie)2.5 E
-(w_dir)-.15 E(ection = S.)-.37 E F2<ad45>108 710.4 Q F3
-(yr/mo/da/hr/mn/sc)23.63 E F0 .155
-(This option sets the ending time for data allo)144 722.4 R .155
-(wed in the input data.)-.25 F(The)5.155 E F2<ad42>2.655 E F0 .155
-(option sets the starting)2.655 F(MB-System 5.0)72 768 Q 2.5(3J)146.495
-G(une 2013)-2.5 E(1)204.835 E 0 Cg EP
-%%Page: 2 2
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 161.49(MBPS\(1\) MB-System)72 48 R 161.49
-(5.0 MBPS\(1\))2.5 F .195
-(time for data. If the starting time is before the ending time, then an)
-144 84 R 2.695(yd)-.15 G .196(ata with a time stamp before)-2.695 F .444
-(the starting time or after the ending time is ignored. If instead the \
-starting time is after the ending)144 96 R .194(time, then an)144 108 R
-2.694(yd)-.15 G .194(ata between the ending and starting time will be i\
-gnored. This scheme allo)-2.694 F .195(ws time)-.25 F(windo)144 120 Q
-5.376(wing both inside and outside a speci\214ed interv)-.25 F 7.876
-(al. Def)-.25 F(ault:)-.1 E/F1 10/Times-Italic at 0 SF(yr/mo/da/hr/mn/sc)
-7.876 E F0(=)7.876 E(2062/2/21/10/30/0.)144 132 Q/F2 10/Times-Bold at 0 SF
-<ad46>108 148.8 Q F1(format)24.19 E F0 .919
-(Sets the format for the input sw)144 160.8 R .919(ath sonar data using)
--.1 F F2(MBIO)3.419 E F0(inte)3.42 E .92(ger format identi\214ers.)-.15
-F .92(This pro-)5.92 F .502(gram uses the)144 172.8 R F2(MBIO)3.002 E F0
-.501(library and will read an)3.001 F 3.001(ys)-.15 G -.1(wa)-3.001 G
-.501(th sonar format supported by).1 F F2(MBIO)3.001 E F0 3.001(.Al)C
-.501(ist of)-3.001 F .694(the sw)144 184.8 R .694
-(ath sonar data formats currently supported by)-.1 F F2(MBIO)3.194 E F0
-.694(and their identi\214er v)3.194 F .694(alues is gi)-.25 F -.15(ve)
--.25 G 3.194(ni).15 G(n)-3.194 E(the)144 196.8 Q F2(MBIO)2.5 E F0
-(manual page. Def)2.5 E(ault:)-.1 E F1(format)2.5 E F0 2.5(=1)2.5 G(1.)
--2.5 E F2<ad47>108 213.6 Q F1(gap)22.52 E F0 .803
-(Sets the manner in which data g)144 225.6 R .803(aps are displayed.)
--.05 F(If)5.803 E F1(gap)3.303 E F0 3.303(=1)3.303 G .802(then g)-.001 F
-.802(aps are \214lled with black.)-.05 F(If)5.802 E F1(gap)144 237.6 Q
-F0 4.579(=0t)4.579 G 2.079(hen g)-4.579 F 2.08(aps are not \214lled and\
- appear the same as the background color of the paper)-.05 F(.)-.55 E
-(Def)144 249.6 Q(ault:)-.1 E F1(gap)2.5 E F0 2.5(=1)2.5 G(.)-2.5 E F2
-<ad48>108 266.4 Q F0 .162(This "help" \215ag cause the program to print\
- out a description of its operation and then e)22.52 F .161(xit immedi-)
--.15 F(ately)144 278.4 Q(.)-.65 E F2<ad49>108 295.2 Q F1(\214lename)
-26.41 E F0 .163(File from which the input data will be read. If no inpu\
-t \214le is speci\214ed, the input will be read from)144 307.2 R
-(stdin. Def)144 319.2 Q(ault:)-.1 E F1(\214lename)2.5 E F0 2.5(=s)2.5 G
-(tdin.)-2.5 E F2<ad4b>108 336 Q F1(eta)22.52 E F0 .122
-(Sets the angle eta \(de)144 348 R .122(grees\) that is the ele)-.15 F
--.25(va)-.25 G .122(tion of the observ).25 F .122(er o)-.15 F -.15(ve)
--.15 G 2.621(rt).15 G .121(he plane de\214ned by the mean)-2.621 F
-(depth. Def)144 360 Q(ault)-.1 E F1(eta = 45.)2.5 E F2<ad4e>108 376.8 Q
-F1(npingsmax)23.08 E F0
-(Sets the maximum number of pings to be read and plotted.)144 388.8 Q
-(Def)5 E(ault:)-.1 E F1(npingsmax)2.5 E F0 2.5(=1)2.5 G(000.)-2.5 E F2
-<ad50>108 405.6 Q F1(pings)24.19 E F0 1.219(Sets the ping a)144 417.6 R
--.15(ve)-.2 G 1.219(raging of the input data. If).15 F F1(pings)3.719 E
-F0 3.72(=1)3.719 G 3.72(,t)-3.72 G 1.22(hen no ping a)-3.72 F -.15(ve)
--.2 G 1.22(raging is performed. If).15 F F1(pings)144 429.6 Q F0 2.652
-(>0)2.652 G 2.652(,t)-2.652 G .152
-(hen that number of input pings will be a)-2.652 F -.15(ve)-.2 G .151
-(raged to produce one output ping.).15 F(If)5.151 E F1(pings)2.651 E F0
-(=)2.651 E .313(0, then the ping a)144 441.6 R -.15(ve)-.2 G .313(ragin\
-g will automatically be done so that the along-track ping spacing is eq\
-ual).15 F(to the across-track beam spacing.)144 453.6 Q(Def)5 E(ault:)
--.1 E F1(pings)2.5 E F0 2.5(=1\()2.5 G(no ping a)-2.5 E -.15(ve)-.2 G
-(raging\).).15 E F2<ad53>108 470.4 Q F1(speedmin)24.74 E F0 .532
-(Sets the minimum speed in km/hr \(5.5 kts ~ 10 km/hr\) allo)144 482.4 R
-.531(wed in the input data; pings associated)-.25 F
-(with a smaller ship speed will not be used. Def)144 494.4 Q(ault:)-.1 E
-F1(speed)2.5 E F0 2.5(=0)2.5 G(.)-2.5 E F2<ad54>108 511.2 Q F1("title")
-23.63 E F0 1.399(Sets the title printed at the top of the plot.)144
-523.2 R 1.4(The title should be enclosed within double quotes.)6.399 F
-(Def)144 535.2 Q(ault: no title.)-.1 E F2<ad56>108 552 Q F0 1.058
-(If the)23.08 F F2<ad56>3.558 E F0 1.058(\215ag is gi)3.558 F -.15(ve)
--.25 G 1.058(n, then).15 F F2(mbps)3.558 E F0 -.1(wo)3.558 G 1.058
-(rks in a "v).1 F 1.057(erbose" mode and outputs the program v)-.15 F
-(ersion)-.15 E(being used and all read error status messages.)144 564 Q
-F2<ad57>108 580.8 Q F1(meter)20.3 E(s_per_inc)-.1 E(h)-.15 E F0 .795
-(Sets the horizontal plotting scale.)144 592.8 R(Def)5.796 E .796
-(ault: automatically calculates a scale such that the plot \214ts)-.1 F
-(on a page.)144 604.8 Q F2<ad58>108 621.6 Q F1(ve)23.08 E F0(Sets the v)
-144 633.6 Q(ertical e)-.15 E(xaggeration. Def)-.15 E(ault)-.1 E F1(ve)
-2.5 E F0 2.5(=5)2.5 G(.)-2.5 E F2<ad59>108 650.4 Q F1(display_stats)
-23.08 E F0 1.324(Sets whether the \214nal plot includes info such as me\
-an latitude, mean longitude, mean heading,)144 662.4 R F1(alpha)144
-674.4 Q F0(,)A F1(eta)2.501 E F0(,)A F1(ve)2.501 E F0 2.501(,s)C .001
-(cale, track length, be)-2.501 F .001(gin time, and end time. if)-.15 F
-F1(display_stats)2.501 E F0 2.501(=1t)2.501 G .001(hen the abo)-2.501 F
-.302 -.15(ve i)-.15 H(nfo).15 E(is plotted; if)144 686.4 Q F1
-(dispaly_stats)2.5 E F0 2.5(=0t)2.5 G(hen it is not plotted.)-2.5 E(Def)
-5 E(ault:)-.1 E F1(display_stats)2.5 E F0 2.5(=1)5 G(.)-2.5 E F2<ad5a>
-108 703.2 Q F1(display_scales)23.63 E F0 1.133
-(Sets whether the \214nal plot includes a horizontal scale, a v)144
-715.2 R 1.133(ertical scale, an arro)-.15 F 3.633(wp)-.25 G 1.133
-(ointing in the)-3.633 F .175(ship heading direction, and coordinate ax)
-144 727.2 R 2.675(es. if)-.15 F F1(display_scales)2.675 E F0 2.675(=1t)
-2.675 G .175(hen the abo)-2.675 F .475 -.15(ve i)-.15 H .175
-(nfo is plotted; if).15 F(MB-System 5.0)72 768 Q 2.5(3J)146.495 G
-(une 2013)-2.5 E(2)204.835 E 0 Cg EP
-%%Page: 3 3
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 161.49(MBPS\(1\) MB-System)72 48 R 161.49
-(5.0 MBPS\(1\))2.5 F/F1 10/Times-Italic at 0 SF(dispaly_scales)144 84 Q F0
-2.5(=0t)2.5 G(hen it is not plotted.)-2.5 E(Def)5 E(ault:)-.1 E F1
-(display_scales)2.5 E F0 2.5(=1)5 G(.)-2.5 E/F2 10.95/Times-Bold at 0 SF
-(EXAMPLES)72 112.8 Q F0 1.06(Suppose one wishes to tak)108 124.8 R 3.56
-(eal)-.1 G 1.059(ook at data from a Hydrosweep \214le in L-DGO edmb for\
-mat \(data.edmb\),)-3.56 F .619
-(starting at 09:00 and ending at 10:30 on September 3, 1991. The follo)
-108 136.8 R .619(wing will output PostScript to a \214le)-.25 F
-(called fred.)108 148.8 Q(mbps \255F22 \255Idata.edmb \255B1991/9/3/9/0\
-/0 \255E1991/9/3/10/30/0 > fred)144 172.8 Q F2(SEE ALSO)72 201.6 Q/F3 10
-/Times-Bold at 0 SF(mbsystem)108 213.6 Q F0(\(1\),)A F3(mbcontour)2.5 E F0
-(\(1\),)A F3(mbswath)2.5 E F0(\(1\))A F2 -.11(BU)72 242.4 S(GS).11 E F3
-(mbps)108 254.4 Q F0 1.014(assumes that the ship w)3.514 F 1.014(as mo)
--.1 F 1.014(ving on a straight line. W)-.15 F 1.014
-(eird plots will result if this is not the case.)-.8 F F3(mbps)108 266.4
-Q F0 1.263(only dra)3.763 F 1.263(ws polygons be)-.15 F 1.263
-(wteen 3 adjacent good points; if isolated points without 2 neighbors e)
--.25 F(xist)-.15 E(the)108 278.4 Q 3.043(yw)-.15 G .543
-(ill not be apparent in the \214nal plot.)-3.043 F .543
-(The \214lling of bad polygons is not perfect and g)5.543 F .542
-(aps in the black)-.05 F(\214ll, especially at the edges of sw)108 290.4
-Q(aths, may occur)-.1 E(.)-.55 E(MB-System 5.0)72 768 Q 2.5(3J)146.495 G
-(une 2013)-2.5 E(3)204.835 E 0 Cg EP
-%%Trailer
-end
-%%EOF
diff --git a/src/ps/mbrollbias.ps b/src/ps/mbrollbias.ps
deleted file mode 100644
index 9b4a4da..0000000
--- a/src/ps/mbrollbias.ps
+++ /dev/null
@@ -1,382 +0,0 @@
-%!PS-Adobe-3.0
-%%Creator: groff version 1.19.2
-%%CreationDate: Wed Jul  1 12:29:30 2015
-%%DocumentNeededResources: font Times-Roman
-%%+ font Times-Bold
-%%+ font Times-Italic
-%%DocumentSuppliedResources: procset grops 1.19 2
-%%Pages: 3
-%%PageOrder: Ascend
-%%DocumentMedia: Default 612 792 0 () ()
-%%Orientation: Portrait
-%%EndComments
-%%BeginDefaults
-%%PageMedia: Default
-%%EndDefaults
-%%BeginProlog
-%%BeginResource: procset grops 1.19 2
-%!PS-Adobe-3.0 Resource-ProcSet
-/setpacking where{
-pop
-currentpacking
-true setpacking
-}if
-/grops 120 dict dup begin
-/SC 32 def
-/A/show load def
-/B{0 SC 3 -1 roll widthshow}bind def
-/C{0 exch ashow}bind def
-/D{0 exch 0 SC 5 2 roll awidthshow}bind def
-/E{0 rmoveto show}bind def
-/F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def
-/G{0 rmoveto 0 exch ashow}bind def
-/H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/I{0 exch rmoveto show}bind def
-/J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def
-/K{0 exch rmoveto 0 exch ashow}bind def
-/L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/M{rmoveto show}bind def
-/N{rmoveto 0 SC 3 -1 roll widthshow}bind def
-/O{rmoveto 0 exch ashow}bind def
-/P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/Q{moveto show}bind def
-/R{moveto 0 SC 3 -1 roll widthshow}bind def
-/S{moveto 0 exch ashow}bind def
-/T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/SF{
-findfont exch
-[exch dup 0 exch 0 exch neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/MF{
-findfont
-[5 2 roll
-0 3 1 roll
-neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/level0 0 def
-/RES 0 def
-/PL 0 def
-/LS 0 def
-/MANUAL{
-statusdict begin/manualfeed true store end
-}bind def
-/PLG{
-gsave newpath clippath pathbbox grestore
-exch pop add exch pop
-}bind def
-/BP{
-/level0 save def
-1 setlinecap
-1 setlinejoin
-72 RES div dup scale
-LS{
-90 rotate
-}{
-0 PL translate
-}ifelse
-1 -1 scale
-}bind def
-/EP{
-level0 restore
-showpage
-}def
-/DA{
-newpath arcn stroke
-}bind def
-/SN{
-transform
-.25 sub exch .25 sub exch
-round .25 add exch round .25 add exch
-itransform
-}bind def
-/DL{
-SN
-moveto
-SN
-lineto stroke
-}bind def
-/DC{
-newpath 0 360 arc closepath
-}bind def
-/TM matrix def
-/DE{
-TM currentmatrix pop
-translate scale newpath 0 0 .5 0 360 arc closepath
-TM setmatrix
-}bind def
-/RC/rcurveto load def
-/RL/rlineto load def
-/ST/stroke load def
-/MT/moveto load def
-/CL/closepath load def
-/Fr{
-setrgbcolor fill
-}bind def
-/setcmykcolor where{
-pop
-/Fk{
-setcmykcolor fill
-}bind def
-}if
-/Fg{
-setgray fill
-}bind def
-/FL/fill load def
-/LW/setlinewidth load def
-/Cr/setrgbcolor load def
-/setcmykcolor where{
-pop
-/Ck/setcmykcolor load def
-}if
-/Cg/setgray load def
-/RE{
-findfont
-dup maxlength 1 index/FontName known not{1 add}if dict begin
-{
-1 index/FID ne{def}{pop pop}ifelse
-}forall
-/Encoding exch def
-dup/FontName exch def
-currentdict end definefont pop
-}bind def
-/DEFS 0 def
-/EBEGIN{
-moveto
-DEFS begin
-}bind def
-/EEND/end load def
-/CNT 0 def
-/level1 0 def
-/PBEGIN{
-/level1 save def
-translate
-div 3 1 roll div exch scale
-neg exch neg exch translate
-0 setgray
-0 setlinecap
-1 setlinewidth
-0 setlinejoin
-10 setmiterlimit
-[]0 setdash
-/setstrokeadjust where{
-pop
-false setstrokeadjust
-}if
-/setoverprint where{
-pop
-false setoverprint
-}if
-newpath
-/CNT countdictstack def
-userdict begin
-/showpage{}def
-/setpagedevice{}def
-}bind def
-/PEND{
-countdictstack CNT sub{end}repeat
-level1 restore
-}bind def
-end def
-/setpacking where{
-pop
-setpacking
-}if
-%%EndResource
-%%EndProlog
-%%BeginSetup
-%%BeginFeature: *PageSize Default
-<< /PageSize [ 612 792 ] /ImagingBBox null >> setpagedevice
-%%EndFeature
-%%IncludeResource: font Times-Roman
-%%IncludeResource: font Times-Bold
-%%IncludeResource: font Times-Italic
-grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72
-def/PL 792 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron/Zcaron
-/scaron/zcaron/Ydieresis/trademark/quotesingle/Euro/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/space/exclam/quotedbl/numbersign/dollar/percent
-/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen
-/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon
-/semicolon/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O
-/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright/circumflex
-/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y
-/z/braceleft/bar/braceright/tilde/.notdef/quotesinglbase/guillemotleft
-/guillemotright/bullet/florin/fraction/perthousand/dagger/daggerdbl
-/endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut
-/dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash
-/quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen
-/brokenbar/section/dieresis/copyright/ordfeminine/guilsinglleft
-/logicalnot/minus/registered/macron/degree/plusminus/twosuperior
-/threesuperior/acute/mu/paragraph/periodcentered/cedilla/onesuperior
-/ordmasculine/guilsinglright/onequarter/onehalf/threequarters
-/questiondown/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE
-/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex
-/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis
-/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn
-/germandbls/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla
-/egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis
-/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide/oslash
-/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis]def
-/Times-Italic at 0 ENC0/Times-Italic RE/Times-Bold at 0 ENC0/Times-Bold RE
-/Times-Roman at 0 ENC0/Times-Roman RE
-%%EndSetup
-%%Page: 1 1
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 145.39(mbrollbias\(1\) MB-System)72 48 R 145.39
-(5.0 mbrollbias\(1\))2.5 F/F1 10.95/Times-Bold at 0 SF -.219(NA)72 84 S(ME)
-.219 E/F2 10/Times-Bold at 0 SF(mbr)108 96 Q(ollbias)-.18 E F0 2.5<ad41>2.5
-G(ssess roll bias of sw)-2.5 E(ath sonar sonar systems.)-.1 E F1
-(VERSION)72 124.8 Q F0 -1.11(Ve)108 136.8 S(rsion 5.0)1.11 E F1
-(SYNOPSIS)72 165.6 Q F2(mbr)108 177.6 Q(ollbias \255F)-.18 E/F3 10
-/Times-Italic at 0 SF(format1/format2)A F2<ad4c>2.5 E F3(lon\215ip)A F2
-<ad49>2.5 E F3(\214le1)A F2<ad4a>2.5 E F3(\214le2)A F2<ad52>2.5 E F3
-(west/east/south/north [)A F2<ad44>A F3(xdim/ydim)A F2<ad4820ad56>2.5 E
-F3(])A F1(DESCRIPTION)72 206.4 Q F2(mbr)108 218.4 Q(ollbias)-.18 E F0
-.044(is a utility used to assess roll bias of sw)2.544 F .043
-(ath sonar sonar systems using bath)-.1 F .043(ymetry data from tw)-.05
-F(o)-.1 E(sw)108 230.4 Q .584(aths co)-.1 F -.15(ve)-.15 G .585
-(ring the same sea\215oor in opposite directions. The program tak).15 F
-.585(es tw)-.1 F 3.085(oi)-.1 G .585(nput \214les and calculates)-3.085
-F 1.231(best \214tting planes for each dataset.)108 242.4 R 1.231
-(The roll bias is calculated by solving for a common roll bias f)6.231 F
-(actor)-.1 E 1.79(which e)108 254.4 R 1.79(xplains the dif)-.15 F 1.79
-(ference between the sea\215oor slopes observ)-.25 F 1.79(ed on the tw)
--.15 F 4.29(os)-.1 G -.1(wa)-4.29 G 4.29(ths. This).1 F(approach)4.29 E
-.805(assumes that pitch bias is not a f)108 266.4 R .805
-(actor; this assumption is most correct when the heading of the tw)-.1 F
-3.304(os)-.1 G(hip-)-3.304 E .912(tracks are e)108 278.4 R .912
-(xactly opposite. The area is di)-.15 F .913
-(vided into a number of rectangular re)-.25 F .913
-(gions and calculations are)-.15 F .087(done in each re)108 290.4 R .087
-(gion containing a suf)-.15 F .087
-(\214cient number of data from both sw)-.25 F 2.586(aths. The)-.1 F .086
-(data contained in the tw)2.586 F(o)-.1 E .728
-(data\214les should be processed to ensure that no artif)108 302.4 R
-.728(acts will bias the roll bias calculations.)-.1 F -.8(Ty)5.729 G
-(pically).8 E 3.229(,t)-.65 G(his)-3.229 E .748(means using)108 314.4 R
-F2(mbclean)3.248 E F0 .748(and or)3.248 F F2(mbedit)3.248 E F0 .748
-(to remo)3.248 F 1.048 -.15(ve n)-.15 H .748(oisy outer beams.).15 F
-3.247(Ap)5.748 G(ositi)-3.247 E 1.047 -.15(ve r)-.25 H .747(oll bias v)
-.15 F .747(alue means that)-.25 F .635(the the v)108 326.4 R .635
-(ertical reference used by the sw)-.15 F .636
-(ath sonar system is biased to starboard, gi)-.1 F .636
-(ving rise to shallo)-.25 F 3.136(wb)-.25 G(a-)-3.136 E(th)108 338.4 Q
-(ymetry to port and deep bath)-.05 E(ymetry to starboard.)-.05 E
-(Results are written to stdout.)5 E F1 -.548(AU)72 367.2 S(THORSHIP).548
-E F0(Da)108 379.2 Q(vid W)-.2 E 2.5(.C)-.92 G(aress \(caress at mbari.or)
--2.5 E(g\))-.18 E(Montere)113 391.2 Q 2.5(yB)-.15 G
-(ay Aquarium Research Institute)-2.5 E
-(Dale N. Chayes \(dale at ldeo.columbia.edu\))108 403.2 Q
-(Lamont-Doherty Earth Observ)113 415.2 Q(atory)-.25 E F1(OPTIONS)72 444
-Q F2<ad46>108 456 Q F3(format1/format2)24.19 E F0 1.162(Sets the)144 468
-R F2(MBIO)3.662 E F0 1.161
-(format identi\214ers for the \214rst and second data \214les, respecti)
-3.662 F -.15(ve)-.25 G(ly).15 E 6.161(.T)-.65 G 1.161(his program)-6.161
-F .501(uses the)144 480 R F2(MBIO)3.001 E F0 .501
-(library and will read or write an)3.001 F 3.001(ys)-.15 G -.1(wa)-3.001
-G .501(th sonar format supported by).1 F F2(MBIO)3.002 E F0 3.002(.Al)C
-(ist)-3.002 E .658(of the sw)144 492 R .658
-(ath sonar data formats currently supported by)-.1 F F2(MBIO)3.157 E F0
-.657(and their identi\214er v)3.157 F .657(alues is gi)-.25 F -.15(ve)
--.25 G(n).15 E(in the)144 504 Q F2(MBIO)2.5 E F0(manual page.)2.5 E F2
-<ad44>108 520.8 Q F3(xdim/ydim)23.08 E F0 .91
-(The area speci\214ed using the)144 532.8 R F2<ad52>3.41 E F0 .91
-(option is di)3.41 F .91(vided up into a grid of rectangular re)-.25 F
-.91(gions; roll bias)-.15 F .416
-(calculations are done in each of these re)144 544.8 R .416(gions pro)
--.15 F .416(viding suf)-.15 F .416(\214cient data is a)-.25 F -.25(va)
--.2 G .416(ilable from both data).25 F 2.748(\214les. This)144 556.8 R
-.249(option sets the dimensions of the re)2.749 F .249(gion grid.)-.15 F
-(Use)5.249 E F3(xdim)2.749 E F0(=)2.749 E F3(ydim)2.749 E F0 2.749(=1t)
-2.749 G 2.749(om)-2.749 G(ak)-2.749 E 2.749(eo)-.1 G .249(ne calcu-)
--2.749 F(lation for the entire area.)144 568.8 Q(Def)5 E(ault:)-.1 E F3
-(xdim)5 E F0(=)2.5 E F3(ydim)2.5 E F0 2.5(=1)2.5 G(.)-2.5 E F2<ad48>108
-585.6 Q F0 .162(This "help" \215ag cause the program to print out a des\
-cription of its operation and then e)22.52 F .161(xit immedi-)-.15 F
-(ately)144 597.6 Q(.)-.65 E F2<ad49>108 614.4 Q F3(\214le1)26.41 E F0
-(Sets the \214lename of the \214rst data \214le to be analyzed.)144
-626.4 Q F2<ad4a>108 643.2 Q F3(\214le2)25.3 E F0
-(Sets the \214lename of the second data \214le to be analyzed.)144 655.2
-Q F2<ad4c>108 672 Q F3(lon\215ip)23.63 E F0 .572
-(Sets the range of the longitude v)144 684 R .572(alues returned.)-.25 F
-(If)5.572 E F3(lon\215ip)3.072 E F0 .572(=\2551 then the longitude v)B
-.572(alues will be in)-.25 F .489(the range from \255360 to 0 de)144 696
-R .488(grees. If)-.15 F F3(lon\215ip)2.988 E F0 .488
-(=0 then the longitude v)B .488(alues will be in the range from)-.25 F
-1.382(\255180 to 180 de)144 708 R 1.382(grees. If)-.15 F F3(lon\215ip)
-3.882 E F0 1.382(=1 then the longitude v)B 1.382
-(alues will be in the range from 0 to 360)-.25 F(de)144 720 Q 2.5
-(grees. Def)-.15 F(ault:)-.1 E F3(lon\215ip)2.5 E F0 2.5(=0)2.5 G(.)-2.5
-E(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(1)204.835 E 0
-Cg EP
-%%Page: 2 2
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 145.39(mbrollbias\(1\) MB-System)72 48 R 145.39
-(5.0 mbrollbias\(1\))2.5 F/F1 10/Times-Bold at 0 SF<ad52>108 84 Q/F2 10
-/Times-Italic at 0 SF(west/east/south/north)23.08 E F0(Sets the longitude \
-and latitude bounds of the area of the roll bias test.)144 96 Q F1<ad56>
-108 112.8 Q F0(The)23.08 E F1<ad56>2.5 E F0
-(option causes the program to print out the program name and v)2.5 E
-(ersion during e)-.15 E -.15(xe)-.15 G(cution.).15 E/F3 10.95
-/Times-Bold at 0 SF(EXAMPLE)72 129.6 Q F0 .807(Suppose you w)108 141.6 R
-.807(ant to calculate roll bias using tw)-.1 F 3.307(oc)-.1 G .807
-(oincident sw)-3.307 F .807(aths of Hydrosweep DS data collected in)-.1
-F(nearly opposite directions.)108 153.6 Q(Run)5 E F1(mbr)2.5 E(ollbias)
--.18 E F0(as follo)2.5 E(ws:)-.25 E
-(mbrollbias \255R-51.07/-50.98/9.0166/9.117 \255D1/1 \255F22/22)144
-177.6 Q(-Ihs_le)180 189.6 Q(g1_z.mb22 \255Jhs_le)-.15 E(g2_z.mb22 \255V)
--.15 E(The output looks lik)108 213.6 Q(e:)-.1 E(Program mbrollbias)
-110.5 237.6 Q -1.11(Ve)110.5 249.6 S
-(rsion $Id: mbrollbias.ps 2252 2015-07-01 19:35:37Z caress $)1.11 E
-(MB-system V)110.5 261.6 Q(ersion 4.00)-1.11 E(mbrollbias P)110.5 285.6
-Q(arameters:)-.15 E(Input \214le 1:)110.5 297.6 Q(hs_le)12.5 E
-(g1_z.mb22)-.15 E(Input \214le 2:)110.5 309.6 Q(hs_le)12.5 E(g2_z.mb22)
--.15 E(Re)110.5 321.6 Q(gion grid bounds:)-.15 E 2.5
-(Longitude: \25551.0700 \25550.9800)115.5 333.6 R 10(Latitude: 9.0166)
-115.5 345.6 R(9.1170)10 E(Re)110.5 357.6 Q(gion grid dimensions: 1 1)
--.15 E(Longitude interv)110.5 369.6 Q(al: 0.090000 de)-.25 E
-(grees or 9.894392 km)-.15 E(Latitude interv)110.5 381.6 Q 2.5
-(al: 0.100400)-.25 F(de)2.5 E(grees or 11.104426 km)-.15 E
-(Longitude \215ipping:)110.5 393.6 Q(0)7.5 E
-(4840 depth points counted in hs_le)110.5 417.6 Q(g1_z.mb22)-.15 E
-(1733 depth points counted in hs_le)110.5 429.6 Q(g2_z.mb22)-.15 E
-(4840 depth points read from hs_le)110.5 441.6 Q(g1_z.mb22)-.15 E
-(1733 depth points read from hs_le)110.5 453.6 Q(g2_z.mb22)-.15 E(Re)
-110.5 477.6 Q(gion 0 \(0 0\) bounds:)-.15 E 2.5
-(Longitude: \25551.0700 \25550.9800)120.5 489.6 R 10(Latitude: 9.0166)
-120.5 501.6 R(9.1170)10 E(First data \214le:)110.5 513.6 Q(hs_le)10 E
-(g1_z.mb22)-.15 E(Number of data: 4840)120.5 525.6 Q(Mean heading:)120.5
-537.6 Q(107.845062)7.5 E(Plane \214t:)120.5 549.6 Q
-(4.759709 \2550.002327 \2550.004623)15 E(Second data \214le:)110.5 561.6
-Q(hs_le)7.5 E(g2_z.mb22)-.15 E(Number of data: 1733)120.5 573.6 Q
-(Mean heading:)120.5 585.6 Q(302.022793)7.5 E(Plane \214t:)120.5 597.6 Q
-(4.640304 0.008438 0.008494)15 E(Roll bias:)110.5 609.6 Q
-(\2550.007288 \(-0.417598 de)7.5 E(grees\))-.15 E(Roll bias is positi)
-110.5 621.6 Q .3 -.15(ve t)-.25 H 2.5(op).15 G(ort, ne)-2.5 E -.05(ga)
--.15 G(ti).05 E .3 -.15(ve t)-.25 H 2.5(os).15 G(tarboard.)-2.5 E 2.5
-(Ap)110.5 633.6 S(osti)-2.5 E .3 -.15(ve r)-.25 H
-(oll bias means the ship rolls to port,).15 E(gi)120.5 645.6 Q
-(ving rise to shallo)-.25 E 2.5(wb)-.25 G(ath)-2.5 E(ymetry to port and)
--.05 E(deep bath)120.5 657.6 Q(ymetry to starboard.)-.05 E F3(SEE ALSO)
-72 686.4 Q F1(mbsystem)108 698.4 Q F0(\(1\))A(MB-System 5.0)72 768 Q 2.5
-(3J)146.495 G(une 2013)-2.5 E(2)204.835 E 0 Cg EP
-%%Page: 3 3
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 145.39(mbrollbias\(1\) MB-System)72 48 R 145.39
-(5.0 mbrollbias\(1\))2.5 F/F1 10.95/Times-Bold at 0 SF -.11(BU)72 84 S(GS)
-.11 E F0(Probably)108 96 Q(.)-.65 E(MB-System 5.0)72 768 Q 2.5(3J)
-146.495 G(une 2013)-2.5 E(3)204.835 E 0 Cg EP
-%%Trailer
-end
-%%EOF
diff --git a/src/ps/mbrolltimelag.ps b/src/ps/mbrolltimelag.ps
deleted file mode 100644
index 5ada657..0000000
--- a/src/ps/mbrolltimelag.ps
+++ /dev/null
@@ -1,484 +0,0 @@
-%!PS-Adobe-3.0
-%%Creator: groff version 1.19.2
-%%CreationDate: Wed Jul  1 12:29:30 2015
-%%DocumentNeededResources: font Times-Roman
-%%+ font Times-Bold
-%%+ font Times-Italic
-%%DocumentSuppliedResources: procset grops 1.19 2
-%%Pages: 3
-%%PageOrder: Ascend
-%%DocumentMedia: Default 612 792 0 () ()
-%%Orientation: Portrait
-%%EndComments
-%%BeginDefaults
-%%PageMedia: Default
-%%EndDefaults
-%%BeginProlog
-%%BeginResource: procset grops 1.19 2
-%!PS-Adobe-3.0 Resource-ProcSet
-/setpacking where{
-pop
-currentpacking
-true setpacking
-}if
-/grops 120 dict dup begin
-/SC 32 def
-/A/show load def
-/B{0 SC 3 -1 roll widthshow}bind def
-/C{0 exch ashow}bind def
-/D{0 exch 0 SC 5 2 roll awidthshow}bind def
-/E{0 rmoveto show}bind def
-/F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def
-/G{0 rmoveto 0 exch ashow}bind def
-/H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/I{0 exch rmoveto show}bind def
-/J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def
-/K{0 exch rmoveto 0 exch ashow}bind def
-/L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/M{rmoveto show}bind def
-/N{rmoveto 0 SC 3 -1 roll widthshow}bind def
-/O{rmoveto 0 exch ashow}bind def
-/P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/Q{moveto show}bind def
-/R{moveto 0 SC 3 -1 roll widthshow}bind def
-/S{moveto 0 exch ashow}bind def
-/T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/SF{
-findfont exch
-[exch dup 0 exch 0 exch neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/MF{
-findfont
-[5 2 roll
-0 3 1 roll
-neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/level0 0 def
-/RES 0 def
-/PL 0 def
-/LS 0 def
-/MANUAL{
-statusdict begin/manualfeed true store end
-}bind def
-/PLG{
-gsave newpath clippath pathbbox grestore
-exch pop add exch pop
-}bind def
-/BP{
-/level0 save def
-1 setlinecap
-1 setlinejoin
-72 RES div dup scale
-LS{
-90 rotate
-}{
-0 PL translate
-}ifelse
-1 -1 scale
-}bind def
-/EP{
-level0 restore
-showpage
-}def
-/DA{
-newpath arcn stroke
-}bind def
-/SN{
-transform
-.25 sub exch .25 sub exch
-round .25 add exch round .25 add exch
-itransform
-}bind def
-/DL{
-SN
-moveto
-SN
-lineto stroke
-}bind def
-/DC{
-newpath 0 360 arc closepath
-}bind def
-/TM matrix def
-/DE{
-TM currentmatrix pop
-translate scale newpath 0 0 .5 0 360 arc closepath
-TM setmatrix
-}bind def
-/RC/rcurveto load def
-/RL/rlineto load def
-/ST/stroke load def
-/MT/moveto load def
-/CL/closepath load def
-/Fr{
-setrgbcolor fill
-}bind def
-/setcmykcolor where{
-pop
-/Fk{
-setcmykcolor fill
-}bind def
-}if
-/Fg{
-setgray fill
-}bind def
-/FL/fill load def
-/LW/setlinewidth load def
-/Cr/setrgbcolor load def
-/setcmykcolor where{
-pop
-/Ck/setcmykcolor load def
-}if
-/Cg/setgray load def
-/RE{
-findfont
-dup maxlength 1 index/FontName known not{1 add}if dict begin
-{
-1 index/FID ne{def}{pop pop}ifelse
-}forall
-/Encoding exch def
-dup/FontName exch def
-currentdict end definefont pop
-}bind def
-/DEFS 0 def
-/EBEGIN{
-moveto
-DEFS begin
-}bind def
-/EEND/end load def
-/CNT 0 def
-/level1 0 def
-/PBEGIN{
-/level1 save def
-translate
-div 3 1 roll div exch scale
-neg exch neg exch translate
-0 setgray
-0 setlinecap
-1 setlinewidth
-0 setlinejoin
-10 setmiterlimit
-[]0 setdash
-/setstrokeadjust where{
-pop
-false setstrokeadjust
-}if
-/setoverprint where{
-pop
-false setoverprint
-}if
-newpath
-/CNT countdictstack def
-userdict begin
-/showpage{}def
-/setpagedevice{}def
-}bind def
-/PEND{
-countdictstack CNT sub{end}repeat
-level1 restore
-}bind def
-end def
-/setpacking where{
-pop
-setpacking
-}if
-%%EndResource
-%%EndProlog
-%%BeginSetup
-%%BeginFeature: *PageSize Default
-<< /PageSize [ 612 792 ] /ImagingBBox null >> setpagedevice
-%%EndFeature
-%%IncludeResource: font Times-Roman
-%%IncludeResource: font Times-Bold
-%%IncludeResource: font Times-Italic
-grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72
-def/PL 792 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron/Zcaron
-/scaron/zcaron/Ydieresis/trademark/quotesingle/Euro/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/space/exclam/quotedbl/numbersign/dollar/percent
-/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen
-/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon
-/semicolon/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O
-/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright/circumflex
-/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y
-/z/braceleft/bar/braceright/tilde/.notdef/quotesinglbase/guillemotleft
-/guillemotright/bullet/florin/fraction/perthousand/dagger/daggerdbl
-/endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut
-/dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash
-/quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen
-/brokenbar/section/dieresis/copyright/ordfeminine/guilsinglleft
-/logicalnot/minus/registered/macron/degree/plusminus/twosuperior
-/threesuperior/acute/mu/paragraph/periodcentered/cedilla/onesuperior
-/ordmasculine/guilsinglright/onequarter/onehalf/threequarters
-/questiondown/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE
-/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex
-/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis
-/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn
-/germandbls/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla
-/egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis
-/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide/oslash
-/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis]def
-/Times-Italic at 0 ENC0/Times-Italic RE/Times-Bold at 0 ENC0/Times-Bold RE
-/Times-Roman at 0 ENC0/Times-Roman RE
-%%EndSetup
-%%Page: 1 1
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 131.5(mbrolltimelag\(1\) MB-System)72 48 R 131.5
-(5.0 mbrolltimelag\(1\))2.5 F/F1 10.95/Times-Bold at 0 SF -.219(NA)72 84 S
-(ME).219 E/F2 10/Times-Bold at 0 SF(mbr)108 96 Q(olltimelag)-.18 E F0 2.913
-<ad43>2.914 G .413
-(alculates cross correlation between the apparent bottom slope in sw)
--2.913 F .413(ath bath)-.1 F .413(ymetry data)-.05 F(and the roll time \
-series used by the sonar in order to assess attitude time lag problems.)
-108 108 Q F1(VERSION)72 136.8 Q F0 -1.11(Ve)108 148.8 S(rsion 5.0)1.11 E
-F1(SYNOPSIS)72 177.6 Q F2(mbr)108 189.6 Q 3.372(olltimelag \255I)-.18 F
-/F3 10/Times-Italic at 0 SF(swathdata)A F0([)5.873 E F2<ad46>A F3(format)A
-F2<ad4b>5.873 E F3 -.45(ro)C(llsour).45 E(ce)-.37 E F2<ad4e>5.873 E F3
-(nping)A F2<ad4f>5.873 E F3(outr)A(oot)-.45 E F2<ad53>5.873 E F3(navc)A
-(hannel)-.15 E F2<ad54>5.873 E F3(nla)A(g/la)-.1 E(g-)-.1 E(min/la)108
-201.6 Q(gmax)-.1 E F2<ad5620ad48>2.5 E F0(])2.5 E F1(DESCRIPTION)72
-218.4 Q F2(MBr)108 230.4 Q(olltimelag)-.18 E F0 .301
-(is an utility used to assess relati)2.802 F .601 -.15(ve t)-.25 H .301
-(ime errors, or time lag, between the ping timestamps of).15 F(sw)108
-242.4 Q .981(ath bath)-.1 F .982(ymetry data and the sonar attitude \(r\
-oll and pitch\) used in calculating the bath)-.05 F(ymetry)-.05 E 3.482
-(.F)-.65 G .982(or an)-3.632 F(y)-.15 E .09
-(sonar ping, a roll error will cause the acrosstrack bath)108 254.4 R
-.09(ymetry pro\214le to rotate v)-.05 F .09
-(ertically so that it is too shal-)-.15 F(lo)108 266.4 Q 2.857(wo)-.25 G
-2.857(no)-2.857 G .357(ne side of the sw)-2.857 F .357
-(ath and too deep on the other)-.1 F 5.357(.C)-.55 G(onsequently)-5.357
-E 2.857(,i)-.65 G 2.857(fn)-2.857 G 2.857(oc)-2.857 G .358
-(orrection is made for the roll)-2.857 F .324(of the sonar)108 278.4 R
-2.824(,t)-.4 G .324(hen the bath)-2.824 F .324
-(ymetry data will appear to be ruf)-.05 F .324(\215ed in the outer sw)
--.25 F 2.824(ath. If)-.1 F .324(the timestamps of the)2.824 F .141(roll\
- and ping data are consistent, then correcting for roll will produce ba\
-th)108 290.4 R .142(ymetry without these pronounced)-.05 F .848
-(across-track artif)108 302.4 R .848(acts. If, ho)-.1 F(we)-.25 E -.15
-(ve)-.25 G 1.648 -.4(r, t).15 H .848(here is a lag between the tw).4 F
-3.348(os)-.1 G .847(ets of time stamps, then the roll v)-3.348 F(alues)
--.25 E(used for correction will be incorrect, and the ruf)108 314.4 Q
-(\215es will still occur)-.25 E(.)-.55 E .615
-(In order to determine the amount of time lag, if an)108 338.4 R 1.915
--.65(y, a)-.15 H .615(ssociated with a sw).65 F .615(ath bath)-.1 F .615
-(ymetry dataset, this pro-)-.05 F .085(gram calculates the cross correl\
-ation between the roll signal and the apparent bottom slope in the case\
- of no)108 350.4 R .494(roll correction \(in practice this latter v)108
-362.4 R .495(alue is found by subtracting the applied roll v)-.25 F .495
-(alue from the apparent)-.25 F 1.101(acrosstrack bottom slope\). If the\
- sea\215oor is planar so that the apparent slope signal is dominated by\
- roll)108 374.4 R(error)108 386.4 Q 2.5(,t)-.4 G(hen there will be a di\
-stinct peak in the cross correlation function at the actual time lag.)
--2.5 E F2(MBr)108 410.4 Q(olltimelag)-.18 E F0 .818
-(reads one or more sw)3.317 F .818
-(ath sonar data \214les containing bath)-.1 F .818
-(ymetry data and calculates man)-.05 F(y)-.15 E .98(cross correlation f\
-unctions. The number of pings used for each calculation is speci\214ed \
-with the)108 422.4 R F2<ad4e>3.48 E F3(nping)A F0 .949
-(option. The range of time lags used and the number of lag v)108 434.4 R
-.949(alues are all speci\214ed using the)-.25 F F2<ad54>3.449 E F3(nla)A
-(g/la)-.1 E(g-)-.1 E(min/la)108 446.4 Q(gmax)-.1 E F0 .358(option. The \
-cross correlation functions are output to a \214le named "sw)2.859 F
-(athdata_xcorr)-.1 E .358(.txt", where)-.55 F F3(swathdata)108 458.4 Q
-F0 1.234(is the input \214le or datalist speci\214ed with the)3.734 F F2
-<ad49>3.734 E F3(swathdata)A F0 1.234(option. The macro)3.734 F F2
-(mbm_xyplot)3.734 E F0(is)3.734 E .64(also called to generate a plot sh\
-ellscript that, if run, will generate a postscript plot of the correlat\
-ion func-)108 470.4 R(tions.)108 482.4 Q F1 -.548(AU)72 511.2 S
-(THORSHIP).548 E F0(Da)108 523.2 Q(vid W)-.2 E 2.5(.C)-.92 G
-(aress \(caress at mbari.or)-2.5 E(g\))-.18 E(Montere)113 535.2 Q 2.5(yB)
--.15 G(ay Aquarium Research Institute)-2.5 E
-(Dale N. Chayes \(dale at ldeo.columbia.edu\))108 547.2 Q
-(Lamont-Doherty Earth Observ)113 559.2 Q(atory)-.25 E F1(OPTIONS)72 588
-Q F2<ad46>108 600 Q F3(format)24.19 E F0 .417(Sets the)144 612 R F2
-(MBIO)2.917 E F0(inte)2.917 E .417
-(ger format identi\214er for the input \214le speci\214ed with the)-.15
-F F2<ad49>2.918 E F0 .418(option. By def)2.918 F(ault,)-.1 E F2(mbr)144
-624 Q(olltimelag)-.18 E F0(infers the format from the "*.mbXX")2.5 E F2
-(MB-System)2.5 E F0(suf)2.5 E(\214x con)-.25 E -.15(ve)-.4 G(ntion.).15
-E F2<ad48>108 640.8 Q F0 .162(This "help" \215ag cause the program to p\
-rint out a description of its operation and then e)22.52 F .161
-(xit immedi-)-.15 F(ately)144 652.8 Q(.)-.65 E F2<ad49>108 669.6 Q F3
-(\214lename)26.41 E F0 .312(Sets the input \214lename. If)144 681.6 R F3
-(format)2.813 E F0 2.813(>0\()2.813 G .313(set with the)-2.813 F F2
-<ad46>2.813 E F0 .313(option\) then the sw)2.813 F .313
-(ath sonar data contained)-.1 F(in)144 693.6 Q F3(in\214le)2.937 E F0
-.437(is read and processed. If)2.937 F F3(format)2.937 E F0 2.937(<0)
-2.937 G 2.937(,t)-2.937 G(hen)-2.937 E F3(in\214le)2.937 E F0 .437
-(is assumed to be an ascii \214le containing a)2.937 F .868
-(list of the input sw)144 705.6 R .869
-(ath sonar data \214les to be processed and their formats.)-.1 F .869
-(The program will read)5.869 F .711(and process the data in each one of\
- these \214les. Each input \214le will ha)144 717.6 R 1.011 -.15(ve a)
--.2 H 3.211(na).15 G .711(ssociated output \214le)-3.211 F .281
-(with either the ".sg)144 729.6 R .281(a" or ".ag)-.05 F .281(a" suf)
--.05 F 2.781(\214x. In)-.25 F(the)2.781 E F3(in\214le)2.781 E F0 .281
-(\214le, each data \214le should be follo)2.781 F .281(wed by a data)
--.25 F(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(1)204.835
-E 0 Cg EP
-%%Page: 2 2
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 131.5(mbrolltimelag\(1\) MB-System)72 48 R 131.5
-(5.0 mbrolltimelag\(1\))2.5 F(format identi\214er)144 84 Q 2.5(,e)-.4 G
-(.g.:)-2.5 E(data\214le1 11)180 96 Q(data\214le2 24)180 108 Q .03
-(This program uses the)144 120 R/F1 10/Times-Bold at 0 SF(MBIO)2.53 E F0
-.029(library and will read an)2.53 F 2.529(ys)-.15 G -.1(wa)-2.529 G
-.029(th sonar format supported by).1 F F1(MBIO)2.529 E F0 2.529(.A)C
-1.296(list of the sw)144 132 R 1.297
-(ath sonar data formats currently supported by)-.1 F F1(MBIO)3.797 E F0
-1.297(and their identi\214er v)3.797 F 1.297(alues is)-.25 F(gi)144 144
-Q -.15(ve)-.25 G 2.5(ni).15 G 2.5(nt)-2.5 G(he)-2.5 E F1(MBIO)2.5 E F0
-(manual page. Def)2.5 E(ault:)-.1 E/F2 10/Times-Italic at 0 SF(in\214le)2.5
-E F0 2.5(=")2.5 G(datalist.mb-1".)-2.5 E F1<ad4b>108 160.8 Q F2(Kr)22.52
-E(ollsour)-.45 E(ce)-.37 E F0 .827
-(This option sets the type of data record from which the roll v)144
-172.8 R .827(alues will be e)-.25 F .827(xtracted. By def)-.15 F(ault,)
--.1 E .158(the roll v)144 184.8 R .159(alues are e)-.25 F .159
-(xtracted from surv)-.15 F .459 -.15(ey d)-.15 H .159
-(ata records. If the).15 F F1<ad53>2.659 E F0 .159
-(option is used, the roll data will be)2.659 F -.15(ex)144 196.8 S .499
-(tracted from primary or ancilliary na).15 F(vig)-.2 E .499
-(ation records. If this)-.05 F F1<ad4b>2.999 E F0 .498
-(option is set, then the roll data)2.999 F(will be e)144 208.8 Q
-(xtracted from data records of type)-.15 E F2(Kr)2.5 E(ollsour)-.45 E
-(ce)-.37 E F0 2.5(,w)C(here the possible v)-2.5 E
-(alues are listed here:)-.25 E(MB_D)156.5 220.8 Q -1.21 -1.11(AT A)-.4 H
-(_D)1.11 E -1.21 -1.11(AT A)-.4 H 31(1/)92.39 G 2.5(*g)-31 G
-(eneral surv)-2.5 E .3 -.15(ey d)-.15 H(ata */).15 E(MB_D)156.5 232.8 Q
--1.21 -1.11(AT A)-.4 H(_CALIBRA)1.11 E 59.11(TE 4)-1.11 F
-(/* Hydrosweep DS */)31 E(MB_D)156.5 244.8 Q -1.21 -1.11(AT A)-.4 H
-29.68(_MEAN_VELOCITY 5)1.11 F(/* Hydrosweep DS */)31 E(MB_D)156.5 256.8
-Q -1.21 -1.11(AT A)-.4 H(_VELOCITY_PR)1.11 E 18.96(OFILE 6)-.4 F
-(/* general */)31 E(MB_D)156.5 268.8 Q -1.21 -1.11(AT A)-.4 H(_N)1.11 E
-96.85 -1.35(AV 1)-.35 H 26(2/)1.35 G 2.5(*S)-26 G(imrad, Reson 7k */)
--2.5 E(MB_D)156.5 280.8 Q -1.21 -1.11(AT A)-.4 H 68.57(_HEADING 17)1.11
-F(/* Simrad, Hypack */)26 E(MB_D)156.5 292.8 Q -1.21 -1.11(AT A)-.4 H
-(_A)1.11 E 65.79(TTITUDE 18)-1.11 F(/* Simrad, Hypack, Reson 7k */)26 E
-(MB_D)156.5 304.8 Q -1.21 -1.11(AT A)-.4 H 95.77(_SSV 19)1.11 F
-(/* Simrad */)26 E(MB_D)156.5 316.8 Q -1.21 -1.11(AT A)-.4 H(_N)1.11 E
--1.35(AV)-.35 G 91.65(12)1.35 G 26(8/)-91.65 G 2.5(*a)-26 G(ncillary na)
--2.5 E 2.5(vs)-.2 G(ystem 1 */)-2.5 E(MB_D)156.5 328.8 Q -1.21 -1.11
-(AT A)-.4 H(_N)1.11 E -1.35(AV)-.35 G 91.65(22)1.35 G 26(9/)-91.65 G 2.5
-(*a)-26 G(ncillary na)-2.5 E 2.5(vs)-.2 G(ystem 2 */)-2.5 E(MB_D)156.5
-340.8 Q -1.21 -1.11(AT A)-.4 H(_N)1.11 E -1.35(AV)-.35 G 91.65(33)1.35 G
-26(0/)-91.65 G 2.5(*a)-26 G(ncillary na)-2.5 E 2.5(vs)-.2 G(ystem 3 */)
--2.5 E(MB_D)156.5 352.8 Q -1.21 -1.11(AT A)-.4 H(_MO)1.11 E 74.52
-(TION 32)-.4 F(/* Reson 7k */)26 E(MB_D)156.5 364.8 Q -1.21 -1.11(AT A)
--.4 H 60.22(_SIDESCAN2 37)1.11 F(/* Reson 7k, XTF */)26 E(MB_D)156.5
-376.8 Q -1.21 -1.11(AT A)-.4 H 60.22(_SIDESCAN3 38)1.11 F
-(/* Reson 7k, XTF */)26 E(MB_D)156.5 388.8 Q -1.21 -1.11(AT A)-.4 H(_R)
-1.11 E 88.4(OLL 40)-.4 F(/* Reson 7k */)26 E(MB_D)156.5 400.8 Q -1.21
--1.11(AT A)-.4 H 85.22(_PITCH 41)1.11 F(/* Reson 7k */)26 E(MB_D)156.5
-412.8 Q -1.21 -1.11(AT A)-.4 H 57.44(_NMEA_RMC 48)1.11 F(/* NMEA */)26 E
-(MB_D)156.5 424.8 Q -1.21 -1.11(AT A)-.4 H 59.67(_NMEA_DBT 49)1.11 F
-(/* NMEA */)26 E(MB_D)156.5 436.8 Q -1.21 -1.11(AT A)-.4 H 60.78
-(_NMEA_DPT 50)1.11 F(/* NMEA */)26 E(MB_D)156.5 448.8 Q -1.21 -1.11
-(AT A)-.4 H(_NMEA_ZD)1.11 E 62.02(A5)-.4 G 26(1/)-62.02 G 2.5(*N)-26 G
-(MEA */)-2.5 E(MB_D)156.5 460.8 Q -1.21 -1.11(AT A)-.4 H 60.23
-(_NMEA_GLL 52)1.11 F(/* NMEA */)26 E(MB_D)156.5 472.8 Q -1.21 -1.11
-(AT A)-.4 H 58.01(_NMEA_GGA 53)1.11 F(/* NMEA */)26 E(MB_D)156.5 484.8 Q
--1.21 -1.11(AT A)-.4 H(_A)1.11 E 60.79(TTITUDE1 55)-1.11 F
-(/* ancillary attitude system 1 */)26 E(MB_D)156.5 496.8 Q -1.21 -1.11
-(AT A)-.4 H(_A)1.11 E 60.79(TTITUDE2 56)-1.11 F
-(/* ancillary attitude system 2 */)15 E(MB_D)156.5 508.8 Q -1.21 -1.11
-(AT A)-.4 H(_A)1.11 E 60.79(TTITUDE3 57)-1.11 F
-(/* ancillary attitude system 3 */)26 E 3.584(At)144 520.8 S 1.084
-(ypical v)-3.584 F 1.084(alue is)-.25 F F2(Kr)3.584 E(ollsour)-.45 E(ce)
--.37 E F0 1.084(=18, which speci\214es e)B 1.084
-(xtraction of roll from asynchronous attitude)-.15 F
-(data records. This option supercedes the)144 532.8 Q F1<ad53>2.5 E F0
-(option.)2.5 E F1<ad4e>108 549.6 Q F2(nping)23.08 E F0(Sets the number \
-of pings to be read for each cross correlation calculation.)144 561.6 Q
-(Def)5 E(ault:)-.1 E F2(nping)2.5 E F0 2.5(=5)2.5 G(0.)-2.5 E F1<ad4f>
-108 578.4 Q F2(outr)22.52 E(oot)-.45 E F0 .352
-(Sets the root of the output \214lenames.)144 590.4 R(Def)5.352 E .352
-(ault: output root is is the input \214lename minus an)-.1 F(y)-.15 E F1
-(MB-)2.851 E(System)144 602.4 Q F0(\214lename suf)2.5 E<8c78>-.25 E 2.5
-(e\()-.15 G(e.g. the root deri)-2.5 E -.15(ve)-.25 G 2.5(df).15 G
-(rom "datalistp.mb-1" will be "datalist"\).)-2.5 E F1<ad53>108 619.2 Q
-F2(navc)24.74 E(hannel)-.15 E F0(Sets)144 631.2 Q F1(MBr)2.73 E
-(olltimelag)-.18 E F0 .23(to read the roll data from na)2.73 F(vig)-.2 E
-.23(ation records rather than the record type listed)-.05 F .73
-(as the "na)144 643.2 R(vig)-.2 E .73
-(ation source" for a particular data format. Sw)-.05 F .73
-(ath data formats may contain synchro-)-.1 F .467(nous na)144 655.2 R
-(vig)-.2 E .467(ation \(na)-.05 F(vig)-.2 E .467
-(ation is included in surv)-.05 F .767 -.15(ey d)-.15 H .468
-(ata records\), asynchronous na).15 F(vig)-.2 E .468(ation \(na)-.05 F
-(vig)-.2 E(a-)-.05 E .884
-(tion comes in records separate from and at dif)144 667.2 R .884
-(ferent times than the surv)-.25 F 1.183 -.15(ey d)-.15 H .883
-(ata records\), or both).15 F(\(surv)144 679.2 Q .323 -.15(ey r)-.15 H
-.023(ecords contain mer).15 F .023(ged na)-.18 F(vig)-.2 E .024
-(ation while the original asynchronous na)-.05 F(vig)-.2 E .024
-(ation is preserv)-.05 F(ed)-.15 E .154(in separate na)144 691.2 R(vig)
--.2 E .153(ation records\). Some data formats pro)-.05 F .153
-(vide for multiple na)-.15 F(vig)-.2 E .153(ation sources, so that)-.05
-F .551(there are more than one channel of asynchronous data records. In\
- this case one channel is al)144 703.2 R -.1(wa)-.1 G(ys).1 E .825
-(designated as the primary or acti)144 715.2 R 1.125 -.15(ve n)-.25 H
--.2(av).15 G(ig).2 E .825(ation channel. The)-.05 F F1<ad53>3.325 E F0
-.824(option allo)3.325 F .824(ws the user to specify)-.25 F(that)144
-727.2 Q F1(MBr)3.992 E(olltimelag)-.18 E F0 1.492
-(uses roll from the primary asynchronous na)3.992 F(vig)-.2 E 1.492
-(ation \()-.05 F F1<ad4e>A F2(0)A F0 3.993(\)o)C 3.993(rf)-3.993 G 1.493
-(rom one of)-3.993 F(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)
--2.5 E(2)204.835 E 0 Cg EP
-%%Page: 3 3
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 131.5(mbrolltimelag\(1\) MB-System)72 48 R 131.5
-(5.0 mbrolltimelag\(1\))2.5 F .872(three auxiliary na)144 84 R(vig)-.2 E
-.872(ation channels \()-.05 F/F1 10/Times-Bold at 0 SF<ad4e>A/F2 10
-/Times-Italic at 0 SF(1)A F0(,)A F1<ad4e>3.372 E F2(2)A F0 3.372(,o)C(r)
--3.372 E F1<ad4e>3.372 E F2(3)A F0 .872(\). If)B F1<ad4e>3.372 E F0 .872
-(is used b)3.372 F .871(ut the data \214le does not)-.2 F 1.429
-(contain asynchronous na)144 96 R(vig)-.2 E 1.429
-(ation or the speci\214ed auxiliary na)-.05 F(vig)-.2 E 1.429
-(ation channels, then)-.05 F F1(mbna)3.929 E(vlist)-.25 E F0 .845
-(will output nothing. T)144 108 R 3.345(od)-.8 G .845
-(etermine if a data\214le contains asynchronous na)-3.345 F(vig)-.2 E
-.845(ation and/or auxiliary)-.05 F(na)144 120 Q(vig)-.2 E 1.927
-(ation, run)-.05 F F1(mbinf)4.427 E(o)-.25 E F0 1.927(using its)4.427 F
-F1<ad4e>4.427 E F0 1.927
-(option to get counts of all data record types in the \214le.)4.427 F
-(Def)144 132 Q(ault:)-.1 E F2(navc)2.5 E(hannel)-.15 E F0 2.5(=1)2.5 G
-(.)-2.5 E F1<ad54>108 148.8 Q F2(nla)23.63 E(g/la)-.1 E(gmin/la)-.1 E
-(gmax)-.1 E F0 .645(Sets the time lag v)144 160.8 R .644
-(alues used for the cross correlation calculations. A total of)-.25 F F2
-(nla)3.144 E(g)-.1 E F0 .644(cross correla-)5.644 F 1.415(tion v)144
-172.8 R 1.415(alues will be calculated e)-.25 F -.15(ve)-.25 G 1.415
-(nly spaced from).15 F F2(la)3.915 E(gmin)-.1 E F0 1.416(seconds to)
-3.916 F F2(la)3.916 E(gmax)-.1 E F0 3.916(seconds. Def)3.916 F(ault:)-.1
-E F2(nla)144 184.8 Q(g)-.1 E F0 2.5(=4)2.5 G(1,)-2.5 E F2(la)2.5 E(gmin)
--.1 E F0 2.5<3dad>2.5 G(2.0 seconds,)-2.5 E F2(la)2.5 E(gmax)-.1 E F0
-2.5(=2)2.5 G(.0 seconds.)-2.5 E F1<ad56>108 201.6 Q F0(The)23.08 E F1
-<ad56>2.5 E F0(option causes the program to be v)2.5 E(erbose.)-.15 E/F3
-10.95/Times-Bold at 0 SF(EXAMPLE)72 218.4 Q F0 .447(Suppose you w)108 230.4
-R .447(ant to e)-.1 F -.25(va)-.25 G .447(luate the possible roll time \
-lag in a collection of Reson 7125 \214les referenced by a).25 F .254
-(datalist called datalistp.mb-1. The sonar w)108 242.4 R .254
-(as pinging at 2Hz \(twice a second\), and roll is a)-.1 F -.25(va)-.2 G
-.254(ilable at 10 Hz).25 F .705(in asynchronous na)108 254.4 R(vig)-.2 E
-.705(ation records that can be accessed with)-.05 F F2(navc)3.204 E
-(hannel)-.15 E F0 3.204(=2)3.204 G 3.204(.W)-3.204 G 3.204(ec)-4.004 G
-.704(hoose to calculate the)-3.204 F .278(cross correlation with time l\
-ags separated by 0.1 seconds from \2552.0 to 2.0 seconds. The follo)108
-266.4 R .278(wing will suf-)-.25 F(\214ce:)108 278.4 Q
-(mbrolltimelag \255Idatalistp.mb-1 \255N41/-2.0/2.0 \255S2 \255V)144
-302.4 Q F3(SEE ALSO)72 331.2 Q F1(mbsystem)108 343.2 Q F0(\(1\))A F3
--.11(BU)72 372 S(GS).11 E F0(Da.)108 384 Q(MB-System 5.0)72 768 Q 2.5
-(3J)146.495 G(une 2013)-2.5 E(3)204.835 E 0 Cg EP
-%%Trailer
-end
-%%EOF
diff --git a/src/ps/mbroutetime.ps b/src/ps/mbroutetime.ps
deleted file mode 100644
index b3607c4..0000000
--- a/src/ps/mbroutetime.ps
+++ /dev/null
@@ -1,481 +0,0 @@
-%!PS-Adobe-3.0
-%%Creator: groff version 1.19.2
-%%CreationDate: Wed Jul  1 12:29:30 2015
-%%DocumentNeededResources: font Times-Roman
-%%+ font Times-Bold
-%%+ font Times-Italic
-%%DocumentSuppliedResources: procset grops 1.19 2
-%%Pages: 4
-%%PageOrder: Ascend
-%%DocumentMedia: Default 612 792 0 () ()
-%%Orientation: Portrait
-%%EndComments
-%%BeginDefaults
-%%PageMedia: Default
-%%EndDefaults
-%%BeginProlog
-%%BeginResource: procset grops 1.19 2
-%!PS-Adobe-3.0 Resource-ProcSet
-/setpacking where{
-pop
-currentpacking
-true setpacking
-}if
-/grops 120 dict dup begin
-/SC 32 def
-/A/show load def
-/B{0 SC 3 -1 roll widthshow}bind def
-/C{0 exch ashow}bind def
-/D{0 exch 0 SC 5 2 roll awidthshow}bind def
-/E{0 rmoveto show}bind def
-/F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def
-/G{0 rmoveto 0 exch ashow}bind def
-/H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/I{0 exch rmoveto show}bind def
-/J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def
-/K{0 exch rmoveto 0 exch ashow}bind def
-/L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/M{rmoveto show}bind def
-/N{rmoveto 0 SC 3 -1 roll widthshow}bind def
-/O{rmoveto 0 exch ashow}bind def
-/P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/Q{moveto show}bind def
-/R{moveto 0 SC 3 -1 roll widthshow}bind def
-/S{moveto 0 exch ashow}bind def
-/T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/SF{
-findfont exch
-[exch dup 0 exch 0 exch neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/MF{
-findfont
-[5 2 roll
-0 3 1 roll
-neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/level0 0 def
-/RES 0 def
-/PL 0 def
-/LS 0 def
-/MANUAL{
-statusdict begin/manualfeed true store end
-}bind def
-/PLG{
-gsave newpath clippath pathbbox grestore
-exch pop add exch pop
-}bind def
-/BP{
-/level0 save def
-1 setlinecap
-1 setlinejoin
-72 RES div dup scale
-LS{
-90 rotate
-}{
-0 PL translate
-}ifelse
-1 -1 scale
-}bind def
-/EP{
-level0 restore
-showpage
-}def
-/DA{
-newpath arcn stroke
-}bind def
-/SN{
-transform
-.25 sub exch .25 sub exch
-round .25 add exch round .25 add exch
-itransform
-}bind def
-/DL{
-SN
-moveto
-SN
-lineto stroke
-}bind def
-/DC{
-newpath 0 360 arc closepath
-}bind def
-/TM matrix def
-/DE{
-TM currentmatrix pop
-translate scale newpath 0 0 .5 0 360 arc closepath
-TM setmatrix
-}bind def
-/RC/rcurveto load def
-/RL/rlineto load def
-/ST/stroke load def
-/MT/moveto load def
-/CL/closepath load def
-/Fr{
-setrgbcolor fill
-}bind def
-/setcmykcolor where{
-pop
-/Fk{
-setcmykcolor fill
-}bind def
-}if
-/Fg{
-setgray fill
-}bind def
-/FL/fill load def
-/LW/setlinewidth load def
-/Cr/setrgbcolor load def
-/setcmykcolor where{
-pop
-/Ck/setcmykcolor load def
-}if
-/Cg/setgray load def
-/RE{
-findfont
-dup maxlength 1 index/FontName known not{1 add}if dict begin
-{
-1 index/FID ne{def}{pop pop}ifelse
-}forall
-/Encoding exch def
-dup/FontName exch def
-currentdict end definefont pop
-}bind def
-/DEFS 0 def
-/EBEGIN{
-moveto
-DEFS begin
-}bind def
-/EEND/end load def
-/CNT 0 def
-/level1 0 def
-/PBEGIN{
-/level1 save def
-translate
-div 3 1 roll div exch scale
-neg exch neg exch translate
-0 setgray
-0 setlinecap
-1 setlinewidth
-0 setlinejoin
-10 setmiterlimit
-[]0 setdash
-/setstrokeadjust where{
-pop
-false setstrokeadjust
-}if
-/setoverprint where{
-pop
-false setoverprint
-}if
-newpath
-/CNT countdictstack def
-userdict begin
-/showpage{}def
-/setpagedevice{}def
-}bind def
-/PEND{
-countdictstack CNT sub{end}repeat
-level1 restore
-}bind def
-end def
-/setpacking where{
-pop
-setpacking
-}if
-%%EndResource
-%%EndProlog
-%%BeginSetup
-%%BeginFeature: *PageSize Default
-<< /PageSize [ 612 792 ] /ImagingBBox null >> setpagedevice
-%%EndFeature
-%%IncludeResource: font Times-Roman
-%%IncludeResource: font Times-Bold
-%%IncludeResource: font Times-Italic
-grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72
-def/PL 792 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron/Zcaron
-/scaron/zcaron/Ydieresis/trademark/quotesingle/Euro/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/space/exclam/quotedbl/numbersign/dollar/percent
-/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen
-/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon
-/semicolon/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O
-/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright/circumflex
-/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y
-/z/braceleft/bar/braceright/tilde/.notdef/quotesinglbase/guillemotleft
-/guillemotright/bullet/florin/fraction/perthousand/dagger/daggerdbl
-/endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut
-/dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash
-/quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen
-/brokenbar/section/dieresis/copyright/ordfeminine/guilsinglleft
-/logicalnot/minus/registered/macron/degree/plusminus/twosuperior
-/threesuperior/acute/mu/paragraph/periodcentered/cedilla/onesuperior
-/ordmasculine/guilsinglright/onequarter/onehalf/threequarters
-/questiondown/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE
-/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex
-/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis
-/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn
-/germandbls/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla
-/egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis
-/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide/oslash
-/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis]def
-/Times-Italic at 0 ENC0/Times-Italic RE/Times-Bold at 0 ENC0/Times-Bold RE
-/Times-Roman at 0 ENC0/Times-Roman RE
-%%EndSetup
-%%Page: 1 1
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 137.06(mbroutetime\(1\) MB-System)72 48 R 137.06
-(5.0 mbroutetime\(1\))2.5 F/F1 10.95/Times-Bold at 0 SF -.219(NA)72 84 S
-(ME).219 E/F2 10/Times-Bold at 0 SF(mbr)108 96 Q(outetime)-.18 E F0 2.806
-<ad50>2.806 G .306(rogram to output a list of the times when a surv)
--2.806 F .606 -.15(ey p)-.15 H .306(asses the w).15 F .305
-(aypoints of a planned sur)-.1 F(-)-.2 E .3 -.15(vey r)108 108 T(oute.)
-.15 E F1(VERSION)72 136.8 Q F0 -1.11(Ve)108 148.8 S(rsion 5.0)1.11 E F1
-(SYNOPSIS)72 177.6 Q F2(mbr)108 189.6 Q(outetime \255Rr)-.18 E
-(oute\214le [\255F)-.18 E/F3 10/Times-Italic at 0 SF(format)A F2<ad49>2.5 E
-F3(\214le)A F2<ad4f>2.5 E F3(waypointtime\214le)A F2<ad55>2.5 E F3 -.15
-(ra)C(ng).15 E(ethr)-.1 E(eshold)-.37 E F2(\255H \255V])2.5 E F1
-(DESCRIPTION)72 218.4 Q F2(mbr)108 230.4 Q(outetime)-.18 E F0<ad>2.5 E
-F1 -.548(AU)72 259.2 S(THORSHIP).548 E F0(Da)108 271.2 Q(vid W)-.2 E 2.5
-(.C)-.92 G(aress \(caress at mbari.or)-2.5 E(g\))-.18 E(Montere)113 283.2 Q
-2.5(yB)-.15 G(ay Aquarium Research Institute)-2.5 E
-(Dale N. Chayes \(dale at ldeo.columbia.edu\))108 295.2 Q
-(Lamont-Doherty Earth Observ)113 307.2 Q(atory)-.25 E F1(OPTIONS)72 336
-Q F2<ad46>108 348 Q F3(format)24.19 E F0 .067
-(Sets the format for the input sw)144 360 R .067(ath data using)-.1 F F2
-(MBIO)2.567 E F0(inte)2.567 E .068(ger format identi\214ers.)-.15 F .068
-(This program uses)5.068 F(the)144 372 Q F2(MBIO)3.432 E F0 .932
-(library and will read an)3.432 F 3.432(ys)-.15 G -.1(wa)-3.432 G .932
-(th format supported by).1 F F2(MBIO)3.432 E F0 3.432(.Al)C .931
-(ist of the sw)-3.432 F .931(ath data)-.1 F 1.231
-(formats currently supported by)144 384 R F2(MBIO)3.731 E F0 1.231
-(and their identi\214er v)3.731 F 1.232(alues is gi)-.25 F -.15(ve)-.25
-G 3.732(ni).15 G 3.732(nt)-3.732 G(he)-3.732 E F2(MBIO)3.732 E F0
-(manual)3.732 E(page. Def)144 396 Q(ault:)-.1 E F3(format)2.5 E F0 2.5
-(=1)2.5 G(1.)-2.5 E F2<ad48>108 412.8 Q F0 .162(This "help" \215ag caus\
-e the program to print out a description of its operation and then e)
-22.52 F .161(xit immedi-)-.15 F(ately)144 424.8 Q(.)-.65 E F2<ad49>108
-441.6 Q F3(\214lename)26.41 E F0 1.083(Sets the input \214lename. If)144
-453.6 R F3(format)3.584 E F0 3.584(>0\()3.584 G 1.084(set with the)
--3.584 F F2<ad46>3.584 E F0 1.084(option\) then the sw)3.584 F 1.084
-(ath data contained in)-.1 F F3(in\214le)144 465.6 Q F0 .215
-(is read and processed. If)2.715 F F3(format)2.715 E F0 2.715(<0)2.715 G
-2.715(,t)-2.715 G(hen)-2.715 E F3(in\214le)2.715 E F0 .214
-(is assumed to be an ascii \214le containing a list)2.714 F .527
-(of the input sw)144 477.6 R .528
-(ath data \214les to be processed and their formats.)-.1 F .528
-(The program will read the data in)5.528 F .333
-(each one of these \214les.)144 489.6 R .333(In the)5.333 F F3(in\214le)
-2.833 E F0 .333(\214le, each data \214le should be follo)2.833 F .332
-(wed by a data format identi-)-.25 F(\214er)144 501.6 Q 2.5(,e)-.4 G
-(.g.:)-2.5 E(data\214le1 11)180 513.6 Q(data\214le2 24)180 525.6 Q .618
-(This program uses the)144 537.6 R F2(MBIO)3.118 E F0 .619
-(library and will read an)3.119 F 3.119(ys)-.15 G -.1(wa)-3.119 G .619
-(th format supported by).1 F F2(MBIO)3.119 E F0 3.119(.Al)C(ist)-3.119 E
-.564(of the sw)144 549.6 R .564(ath data formats currently supported by)
--.1 F F2(MBIO)3.064 E F0 .564(and their identi\214er v)3.064 F .563
-(alues is gi)-.25 F -.15(ve)-.25 G 3.063(ni).15 G 3.063(nt)-3.063 G(he)
--3.063 E F2(MBIO)144 561.6 Q F0(manual page.)2.5 E(Def)5 E(ault:)-.1 E
-F3(in\214le)2.5 E F0 2.5(=")2.5 G(datalist.mb-1".)-2.5 E F2<ad56>108
-578.4 Q F0(The)23.08 E F2<ad56>2.5 E F0(option causes)2.5 E F2(mbr)2.5 E
-(outetime)-.18 E F0(to print out status messages.)2.5 E F1(EXAMPLES)72
-607.2 Q F0 1.344(Suppose you are going to run the MB)108 619.2 R 1.344
-(ARI Mapping A)-.35 F 1.345(UV on the Coaxial Se)-.55 F 1.345
-(gment of the Juan de Fuca)-.15 F 1.532(Ridge. Y)108 631.2 R 1.532
-(ou ha)-1.1 F 1.832 -.15(ve c)-.2 H 1.532
-(reated a route \214le called Coaxial2009_1v3.rte using).15 F F2
-(mbgrdviz)4.032 E F0 4.032(.I)C 4.032(no)-4.032 G 1.532
-(rder to create an)-4.032 F(MB)108 643.2 Q .107(ARI A)-.35 F .107
-(UV mission script for mission be)-.55 F .107
-(ginning with a spiral descent to an altitude of 50 m, follo)-.15 F .108
-(wed by)-.25 F 2.5(as)108 655.2 S(urv)-2.5 E .3 -.15(ey r)-.15 H
-(un at a 75 m altitude, the follo).15 E(wing will suf)-.25 E(\214ce:)
--.25 E .342(mbroutetime \255I Coaxial2009_1v3.rte)144 667.2 R .341
-(-A75/30/75 \255B1)67.102 F .341(-G0 \255MSL \255N50)42.421 F 50.13
-(\255R220/83/0.3 -O)108 679.2 R 42.07(Coaxial2009_1v3.cfg -S1.5)2.5 F
-(\255L30 \255W100 \255V)2.5 E
-(The resulting mission script has the follo)108 691.2 Q(wing header:)
--.25 E 2.5(#T)120.5 715.2 S(his MB)-2.5 E(ARI Mapping A)-.35 E
-(UV mission \214le has been generated)-.55 E 2.5(#b)120.5 727.2 S 2.5
-(yt)-2.5 G(he MB-System program mbroutetime run by)-2.5 E(MB-System 5.0)
-72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(1)204.835 E 0 Cg EP
-%%Page: 2 2
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 137.06(mbroutetime\(1\) MB-System)72 48 R 137.06
-(5.0 mbroutetime\(1\))2.5 F 2.5(#u)120.5 84 S
-(ser <caress> on cpu <shepard> at <Thu Jul 30 11:36:47 PDT 2009>)-2.5 E
-(#)120.5 96 Q 2.5(#M)120.5 108 S(ission Summary:)-2.5 E 12.5(#R)120.5
-120 S(oute File:)-12.5 E(Coaxial2009_1v3.rte)37.5 E 12.5(#M)120.5 132 S
-(ission File:)-12.5 E(Coaxial2009_1v3.cfg)32.5 E 12.5(#D)120.5 144 S 40
-(istance: 79501.503455)-12.5 F(\(m\))2.5 E 12.5(#E)120.5 156 S
-(stimated T)-12.5 E 25(ime: 57203)-.35 F 2.5(\(s\) 15.890)2.5 F(\(hr\))
-2.5 E 12.5(#A)120.5 168 S(bort T)-12.5 E 35(ime: 60067)-.35 F(\(s\))2.5
-E 12.5(#M)120.5 180 S(ax battery life:)-12.5 E(64800 \(s\))22.5 E 12.5
-(#S)120.5 192 S(afety mar)-12.5 E 27.5(gin: 1800)-.18 F(\(s\))2.5 E 12.5
-(#A)120.5 204 S(scend time:)-12.5 E(2932 \(s\))35 E 12.5(#W)120.5 216 S
-(ay Points:)-13.3 E(44)37.5 E 12.5(#R)120.5 228 S(oute Points:)-12.5 E
-(550)32.5 E 12.5(#S)120.5 240 S(urv)-12.5 E .3 -.15(ey b)-.15 H(eha).15
-E 22.5(vior: W)-.2 F(aypointDepth)-.8 E 12.5(#D)120.5 252 S
-(escent style:)-12.5 E(Spiral descent)30 E 12.5(#M)120.5 264 S
-(apping sonar control enabled:)-12.5 E 77.5(#M)120.5 276 S
-(ultibeam enabled)-77.5 E 82.5(#M)120.5 288 S(ultibeam recei)-82.5 E .3
--.15(ve g)-.25 H 25(ain: 83).1 F 82.5(#M)120.5 300 S
-(ultibeam transmit g)-82.5 E 22.5(ain: 220)-.05 F 82.5(#M)120.5 312 S
-(ultibeam minimum range fraction: 0.3)-82.5 E 77.5(#S)120.5 324 S
-(ubbottom enabled)-77.5 E 77.5(#L)120.5 336 S .5 -.25(ow s)-77.5 H
-(idescan enabled).25 E 77.5(#H)120.5 348 S(igh sidescan disabled)-77.5 E
-(#)120.5 360 Q 2.5(#M)120.5 372 S(ission P)-2.5 E(arameters:)-.15 E 12.5
-(#V)120.5 384 S(ehicle Speed:)-13.61 E
-(1.500000 \(m/s\) 2.915769 \(knots\))30 E 12.5(#D)120.5 396 S(esired V)
--12.5 E(ehicle Altitude: 75 \(m\))-1.11 E 12.5(#M)120.5 408 S(inimum V)
--12.5 E(ehicle Altitude: 75 \(m\))-1.11 E 12.5(#A)120.5 420 S(bort V)
--12.5 E(ehicle Altitude:)-1.11 E(30 \(m\))7.5 E 12.5(#M)120.5 432 S
-(aximum V)-12.5 E(ehicle Depth:)-1.11 E(2525.307922 \(m\))10 E 12.5(#A)
-120.5 444 S(bort V)-12.5 E(ehicle Depth:)-1.11 E(2562.807922 \(m\))15 E
-12.5(#D)120.5 456 S(escent V)-12.5 E(ehicle Depth:)-1.11 E 2.5(3\()10 G
-(m\))-2.5 E 12.5(#S)120.5 468 S(piral descent depth:)-12.5 E
-(2324.917643 m)12.5 E 12.5(#S)120.5 480 S(piral descent altitude:)-12.5
-E(50 m)5 E 12.5(#F)120.5 492 S(orw)-12.65 E(ard Looking Distance:)-.1 E
-(\(m\))5 E 12.5(#W)120.5 504 S(aypoint Spacing:)-13.3 E(100 \(m\))22.5 E
-12.5(#G)120.5 516 S(PS Duration:)-12.5 E(600 \(s\))32.5 E 12.5(#D)120.5
-528 S(escend Rate:)-12.5 E(0.417 \(m/s\))32.5 E 12.5(#A)120.5 540 S
-(scend Rate:)-12.5 E 2.5(1\()35 G(m/s\))-2.5 E 12.5(#I)120.5 552 S
-(nitial descend Duration: 300 \(s\))-12.5 E 12.5(#S)120.5 564 S
-(etpoint Duration:)-12.5 E(30 \(s\))20 E(#)120.5 576 Q 2.5(#T)120.5 588
-S(he primary w)-2.5 E(aypoints from the route \214le are:)-.1 E 7.5(#<)
-120.5 600 S(number> <longitude \(de)-7.5 E(g\)> <latitude \(de)-.15 E
-(g\)> <topograph)-.15 E 2.5(y\()-.05 G(m\)> <distance \(m\)> <type>)-2.5
-E 7.5(#0)120.5 612 S
-(\255129.588618 46.504590 \2552384.917643 0.000000 3)-5 E 7.5(#1)120.5
-624 S(\255129.583151 46.507559 \2552412.977865 533.709482 3)-5 E 7.5(#2)
-120.5 636 S(\255129.569223 46.503420 \2552548.389974 1697.143568 1)-5 E
-7.5(#3)120.5 648 S
-(\255129.566359 46.501080 \2552494.963053 2037.557099 3)-5 E 7.5(#4)
-120.5 660 S(\255129.548611 46.529852 \2552539.510864 5512.537193 4)-5 E
-7.5(#5)120.5 672 S
-(\255129.551250 46.530628 \2552562.807922 5732.537193 3)-5 E 7.5(#6)
-120.5 684 S(\255129.568962 46.501924 \2552531.034424 9199.497998 4)-5 E
-7.5(#7)120.5 696 S
-(\255129.571600 46.502699 \2552519.138489 9419.497998 3)-5 E 7.5(#8)
-120.5 708 S(\255129.553889 46.531404 \2552547.114624 12886.458803 4)-5 E
-7.5(#9)120.5 720 S
-(\255129.556529 46.532180 \2552514.533569 13106.458803 3)-5 E
-(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(2)204.835 E 0
-Cg EP
-%%Page: 3 3
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 137.06(mbroutetime\(1\) MB-System)72 48 R 137.06
-(5.0 mbroutetime\(1\))2.5 F 7.5(#1)120.5 84 S 2.5<30ad>-7.5 G
-(129.574238 46.503475 \2552470.815735 16573.419607 4)-2.5 E 7.5(#1)120.5
-96 S 2.5<31ad>-7.5 G
-(129.576876 46.504250 \2552444.596313 16793.419607 3)-2.5 E 7.5(#1)120.5
-108 S 2.5<32ad>-7.5 G
-(129.559168 46.532956 \2552521.781921 20260.380412 4)-2.5 E 7.5(#1)120.5
-120 S 2.5<33ad>-7.5 G
-(129.561807 46.533732 \2552537.382141 20480.380412 3)-2.5 E 7.5(#1)120.5
-132 S 2.5<34ad>-7.5 G
-(129.579514 46.505026 \2552429.459961 23947.341216 4)-2.5 E 7.5(#1)120.5
-144 S 2.5<35ad>-7.5 G
-(129.582152 46.505801 \2552412.764343 24167.341217 3)-2.5 E 7.5(#1)120.5
-156 S 2.5<36ad>-7.5 G
-(129.564447 46.534508 \2552545.397705 27634.302021 4)-2.5 E 7.5(#1)120.5
-168 S 2.5<37ad>-7.5 G
-(129.567086 46.535284 \2552534.068665 27854.302021 3)-2.5 E 7.5(#1)120.5
-180 S 2.5<38ad>-7.5 G
-(129.584791 46.506576 \2552398.283020 31321.262826 4)-2.5 E 7.5(#1)120.5
-192 S 2.5<39ad>-7.5 G
-(129.587429 46.507352 \2552390.671509 31541.262826 3)-2.5 E 7.5(#2)120.5
-204 S 2.5<30ad>-7.5 G
-(129.569726 46.536059 \2552489.889282 35008.223630 4)-2.5 E 7.5(#2)120.5
-216 S 2.5<31ad>-7.5 G
-(129.572365 46.536835 \2552465.280823 35228.223630 3)-2.5 E 7.5(#2)120.5
-228 S 2.5<32ad>-7.5 G
-(129.590068 46.508127 \2552389.067017 38695.184435 4)-2.5 E 7.5(#2)120.5
-240 S 2.5<33ad>-7.5 G
-(129.592706 46.508902 \2552409.290771 38915.184435 3)-2.5 E 7.5(#2)120.5
-252 S 2.5<34ad>-7.5 G
-(129.575005 46.537610 \2552466.533142 42382.145240 4)-2.5 E 7.5(#2)120.5
-264 S 2.5<35ad>-7.5 G
-(129.577645 46.538386 \2552491.371094 42602.145240 3)-2.5 E 7.5(#2)120.5
-276 S 2.5<36ad>-7.5 G
-(129.595345 46.509677 \2552397.609253 46069.106044 4)-2.5 E 7.5(#2)120.5
-288 S 2.5<37ad>-7.5 G
-(129.597984 46.510452 \2552413.315918 46289.106044 3)-2.5 E 7.5(#2)120.5
-300 S 2.5<38ad>-7.5 G
-(129.580285 46.539161 \2552499.048889 49756.066849 4)-2.5 E 7.5(#2)120.5
-312 S 2.5<39ad>-7.5 G
-(129.582925 46.539937 \2552523.030640 49976.066849 3)-2.5 E 7.5(#3)120.5
-324 S 2.5<30ad>-7.5 G
-(129.600622 46.511227 \2552443.481018 53443.027653 4)-2.5 E 7.5(#3)120.5
-336 S 2.5<31ad>-7.5 G
-(129.603261 46.512002 \2552419.008240 53663.027653 3)-2.5 E 7.5(#3)120.5
-348 S 2.5<32ad>-7.5 G
-(129.585565 46.540712 \2552518.522400 57129.988458 4)-2.5 E 7.5(#3)120.5
-360 S 2.5<33ad>-7.5 G
-(129.588205 46.541487 \2552498.521301 57349.988458 3)-2.5 E 7.5(#3)120.5
-372 S 2.5<34ad>-7.5 G
-(129.605900 46.512777 \2552450.386536 60816.949263 4)-2.5 E 7.5(#3)120.5
-384 S 2.5<35ad>-7.5 G
-(129.608539 46.513552 \2552473.623230 61036.949263 3)-2.5 E 7.5(#3)120.5
-396 S 2.5<36ad>-7.5 G
-(129.590845 46.542262 \2552487.422180 64503.910067 4)-2.5 E 7.5(#3)120.5
-408 S 2.5<37ad>-7.5 G
-(129.593485 46.543038 \2552491.040466 64723.910067 3)-2.5 E 7.5(#3)120.5
-420 S 2.5<38ad>-7.5 G
-(129.611178 46.514327 \2552472.610657 68190.870872 3)-2.5 E 7.5(#3)120.5
-432 S 2.5<39ad>-7.5 G
-(129.606711 46.517999 \2552485.114583 68723.704236 3)-2.5 E 7.5(#4)120.5
-444 S 2.5<30ad>-7.5 G
-(129.557338 46.509809 \2552488.398743 72619.152031 3)-2.5 E 7.5(#4)120.5
-456 S 2.5<31ad>-7.5 G
-(129.550415 46.521262 \2552545.285828 73998.189601 3)-2.5 E 7.5(#4)120.5
-468 S 2.5<32ad>-7.5 G
-(129.600724 46.536447 \2552470.920736 78209.372536 3)-2.5 E 7.5(#4)120.5
-480 S 2.5<33ad>-7.5 G
-(129.606972 46.525648 \2552443.988281 79501.503455 4)-2.5 E(#)120.5 492
-Q 2.5(#At)120.5 504 S(otal of 550 mission points ha)-2.5 E .3 -.15(ve b)
--.2 H(een de\214ned.).15 E(#)120.5 516 Q 2.5(#D)120.5 528 S
-(e\214ne Mission parameters:)-2.5 E(#de\214ne MISSION_SPEED)120.5 540 Q
-(1.500000)15 E(#de\214ne MISSION_DIST)120.5 552 Q 5(ANCE 79501.503455)
--.93 F(#de\214ne MISSION_TIME)120.5 564 Q(57203)17.5 E
-(#de\214ne MISSION_TIMEOUT)120.5 576 Q(60067)10 E(#de\214ne DEPTH_MAX)
-120.5 588 Q(2525.307922)25 E(#de\214ne DEPTH_ABOR)120.5 600 Q 20(T2)-.6
-G(562.807922)-20 E(#de\214ne AL)120.5 612 Q 5(TITUDE_DESIRED 75.000000)
--.92 F(#de\214ne AL)120.5 624 Q 15(TITUDE_MIN 75.000000)-.92 F
-(#de\214ne AL)120.5 636 Q(TITUDE_ABOR)-.92 E 12.5(T3)-.6 G(0.000000)
--12.5 E(#de\214ne GPS_DURA)120.5 648 Q 15(TION 600)-1.11 F
-(#de\214ne DESCENT_DEPTH)120.5 660 Q(3.000000)15 E
-(#de\214ne SPIRAL_DESCENT_DEPTH)120.5 672 Q(2324.917643)15 E
-(#de\214ne SPIRAL_DESCENT_AL)120.5 684 Q 5(TITUDE 50.000000)-.92 F
-(#de\214ne DESCEND_DURA)120.5 696 Q 5(TION 300)-1.11 F
-(#de\214ne SETPOINT_DURA)120.5 708 Q 2.5(TION 30)-1.11 F
-(#de\214ne GPSMINHITS)120.5 720 Q(10)22.5 E(MB-System 5.0)72 768 Q 2.5
-(3J)146.495 G(une 2013)-2.5 E(3)204.835 E 0 Cg EP
-%%Page: 4 4
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 137.06(mbroutetime\(1\) MB-System)72 48 R 137.06
-(5.0 mbroutetime\(1\))2.5 F(#de\214ne ASCENDR)120.5 84 Q 15
-(UDDER 3.000000)-.4 F(#de\214ne ASCENDPITCH)120.5 96 Q(45.000000)20 E
-(#de\214ne ASCENDENDDEPTH)120.5 108 Q(2.000000)12.5 E
-(#de\214ne DESCENDR)120.5 120 Q 12.5(UDDER 3.000000)-.4 F
-(#de\214ne DESCENDPITCH)120.5 132 Q(\25530.000000)17.5 E
-(#de\214ne MAXCR)120.5 144 Q(OSSTRA)-.4 E(CKERR)-.4 E(OR 30)-.4 E
-(#de\214ne RESON_DURA)120.5 156 Q 10(TION 6)-1.11 F(#q)120.5 168 Q/F1
-10.95/Times-Bold at 0 SF(SEE ALSO)72 196.8 Q/F2 10/Times-Bold at 0 SF
-(mbsystem)108 208.8 Q F0(\(1\),)A F2(mbgrdviz)2.5 E F0(\(1\))A F1 -.11
-(BU)72 237.6 S(GS).11 E F0(Perhaps.)108 249.6 Q(MB-System 5.0)72 768 Q
-2.5(3J)146.495 G(une 2013)-2.5 E(4)204.835 E 0 Cg EP
-%%Trailer
-end
-%%EOF
diff --git a/src/ps/mbsegygrid.ps b/src/ps/mbsegygrid.ps
deleted file mode 100644
index 208ad71..0000000
--- a/src/ps/mbsegygrid.ps
+++ /dev/null
@@ -1,620 +0,0 @@
-%!PS-Adobe-3.0
-%%Creator: groff version 1.19.2
-%%CreationDate: Wed Jul  1 12:29:30 2015
-%%DocumentNeededResources: font Times-Roman
-%%+ font Times-Bold
-%%+ font Times-Italic
-%%DocumentSuppliedResources: procset grops 1.19 2
-%%Pages: 5
-%%PageOrder: Ascend
-%%DocumentMedia: Default 612 792 0 () ()
-%%Orientation: Portrait
-%%EndComments
-%%BeginDefaults
-%%PageMedia: Default
-%%EndDefaults
-%%BeginProlog
-%%BeginResource: procset grops 1.19 2
-%!PS-Adobe-3.0 Resource-ProcSet
-/setpacking where{
-pop
-currentpacking
-true setpacking
-}if
-/grops 120 dict dup begin
-/SC 32 def
-/A/show load def
-/B{0 SC 3 -1 roll widthshow}bind def
-/C{0 exch ashow}bind def
-/D{0 exch 0 SC 5 2 roll awidthshow}bind def
-/E{0 rmoveto show}bind def
-/F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def
-/G{0 rmoveto 0 exch ashow}bind def
-/H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/I{0 exch rmoveto show}bind def
-/J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def
-/K{0 exch rmoveto 0 exch ashow}bind def
-/L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/M{rmoveto show}bind def
-/N{rmoveto 0 SC 3 -1 roll widthshow}bind def
-/O{rmoveto 0 exch ashow}bind def
-/P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/Q{moveto show}bind def
-/R{moveto 0 SC 3 -1 roll widthshow}bind def
-/S{moveto 0 exch ashow}bind def
-/T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/SF{
-findfont exch
-[exch dup 0 exch 0 exch neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/MF{
-findfont
-[5 2 roll
-0 3 1 roll
-neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/level0 0 def
-/RES 0 def
-/PL 0 def
-/LS 0 def
-/MANUAL{
-statusdict begin/manualfeed true store end
-}bind def
-/PLG{
-gsave newpath clippath pathbbox grestore
-exch pop add exch pop
-}bind def
-/BP{
-/level0 save def
-1 setlinecap
-1 setlinejoin
-72 RES div dup scale
-LS{
-90 rotate
-}{
-0 PL translate
-}ifelse
-1 -1 scale
-}bind def
-/EP{
-level0 restore
-showpage
-}def
-/DA{
-newpath arcn stroke
-}bind def
-/SN{
-transform
-.25 sub exch .25 sub exch
-round .25 add exch round .25 add exch
-itransform
-}bind def
-/DL{
-SN
-moveto
-SN
-lineto stroke
-}bind def
-/DC{
-newpath 0 360 arc closepath
-}bind def
-/TM matrix def
-/DE{
-TM currentmatrix pop
-translate scale newpath 0 0 .5 0 360 arc closepath
-TM setmatrix
-}bind def
-/RC/rcurveto load def
-/RL/rlineto load def
-/ST/stroke load def
-/MT/moveto load def
-/CL/closepath load def
-/Fr{
-setrgbcolor fill
-}bind def
-/setcmykcolor where{
-pop
-/Fk{
-setcmykcolor fill
-}bind def
-}if
-/Fg{
-setgray fill
-}bind def
-/FL/fill load def
-/LW/setlinewidth load def
-/Cr/setrgbcolor load def
-/setcmykcolor where{
-pop
-/Ck/setcmykcolor load def
-}if
-/Cg/setgray load def
-/RE{
-findfont
-dup maxlength 1 index/FontName known not{1 add}if dict begin
-{
-1 index/FID ne{def}{pop pop}ifelse
-}forall
-/Encoding exch def
-dup/FontName exch def
-currentdict end definefont pop
-}bind def
-/DEFS 0 def
-/EBEGIN{
-moveto
-DEFS begin
-}bind def
-/EEND/end load def
-/CNT 0 def
-/level1 0 def
-/PBEGIN{
-/level1 save def
-translate
-div 3 1 roll div exch scale
-neg exch neg exch translate
-0 setgray
-0 setlinecap
-1 setlinewidth
-0 setlinejoin
-10 setmiterlimit
-[]0 setdash
-/setstrokeadjust where{
-pop
-false setstrokeadjust
-}if
-/setoverprint where{
-pop
-false setoverprint
-}if
-newpath
-/CNT countdictstack def
-userdict begin
-/showpage{}def
-/setpagedevice{}def
-}bind def
-/PEND{
-countdictstack CNT sub{end}repeat
-level1 restore
-}bind def
-end def
-/setpacking where{
-pop
-setpacking
-}if
-%%EndResource
-%%EndProlog
-%%BeginSetup
-%%BeginFeature: *PageSize Default
-<< /PageSize [ 612 792 ] /ImagingBBox null >> setpagedevice
-%%EndFeature
-%%IncludeResource: font Times-Roman
-%%IncludeResource: font Times-Bold
-%%IncludeResource: font Times-Italic
-grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72
-def/PL 792 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron/Zcaron
-/scaron/zcaron/Ydieresis/trademark/quotesingle/Euro/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/space/exclam/quotedbl/numbersign/dollar/percent
-/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen
-/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon
-/semicolon/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O
-/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright/circumflex
-/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y
-/z/braceleft/bar/braceright/tilde/.notdef/quotesinglbase/guillemotleft
-/guillemotright/bullet/florin/fraction/perthousand/dagger/daggerdbl
-/endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut
-/dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash
-/quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen
-/brokenbar/section/dieresis/copyright/ordfeminine/guilsinglleft
-/logicalnot/minus/registered/macron/degree/plusminus/twosuperior
-/threesuperior/acute/mu/paragraph/periodcentered/cedilla/onesuperior
-/ordmasculine/guilsinglright/onequarter/onehalf/threequarters
-/questiondown/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE
-/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex
-/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis
-/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn
-/germandbls/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla
-/egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis
-/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide/oslash
-/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis]def
-/Times-Italic at 0 ENC0/Times-Italic RE/Times-Bold at 0 ENC0/Times-Bold RE
-/Times-Roman at 0 ENC0/Times-Roman RE
-%%EndSetup
-%%Page: 1 1
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mbse)72 48 Q 141.1(gygrid\(1\) MB-System)-.15 F
-141.1(5.0 mbse)2.5 F(gygrid\(1\))-.15 E/F1 10.95/Times-Bold at 0 SF -.219
-(NA)72 84 S(ME).219 E/F2 10/Times-Bold at 0 SF(mbsegygrid)108 96 Q F0 2.5
-<ad47>2.5 G(enerate time vs. trace number grids of seismic data from se)
--2.5 E(gy \214les.)-.15 E F1(VERSION)72 124.8 Q F0 -1.11(Ve)108 136.8 S
-(rsion 5.0)1.11 E F1(SYNOPSIS)72 165.6 Q F2 2.612(mbsegygrid \255I)108
-177.6 R/F3 10/Times-Italic at 0 SF(se)A(gy\214le)-.4 E F2<ad4f>5.112 E F3
-(grid\214le)A F2([\255A)5.112 E F3(shotscale/timescale)A F2<ad42>5.112 E
-F3(maxvalue/window)A F2<ad44>5.112 E F3(decimate)A(x/decimate)-.2 E(y)
--.3 E F2<ad47>108 189.6 Q F3(mode/gain[/window])A F2<ad53>9.28 E F3
-(mode[/start/end[/sc)A(han/ec)-.15 E(han]])-.15 E F2<ad54>9.28 E F3
-(sweep[/delay])A F2<ad57>9.28 E F3(mode/start/end)A F2<ad48>9.28 E
-(\255V]";)108 201.6 Q F1(DESCRIPTION)72 230.4 Q F2(MBsegygrid)108 242.4
-Q F0 1.026(generates grids of seismic data from se)3.526 F 1.025
-(gy \214les.)-.15 F 1.025(The program w)6.025 F 1.025
-(orks by inserting trace data)-.1 F .388
-(into a grid in which the y-axis is some measure of trace number)108
-254.4 R 2.888(,r)-.4 G .388
-(ange, or distance along a pro\214le, and the)-2.888 F
-(y-axis is time. The output \214les are)108 266.4 Q F2(GMT)2.5 E F0
-(netCDF format grid \214les.)2.5 E .337(By def)108 290.4 R .337
-(ault or with use of the)-.1 F F2<ad41>2.837 E F0 .336(option, the x-di\
-mension of the grid is determined by the number of traces)2.837 F .296
-(speci\214ed by the)108 302.4 R F2<ad53>2.796 E F0 .296(option and an)
-2.796 F 2.796(yd)-.15 G .296(ecimation speci\214ed with option)-2.796 F
-F2<ad44>2.796 E F0 5.296(.I)C 2.796(ft)-5.296 G(he)-2.796 E F2<ad52>
-2.797 E F0 .297(option is used, then the)2.797 F .109(pro\214le will re\
-present a line between speci\214ed start and end positions di)108 314.4
-R .108(vided into binning cells according to)-.25 F 2.943(as)108 326.4 S
-.443(peci\214ed cell size, and the x-dimension of the grid will be the \
-distance along the line \(in meters\) di)-2.943 F(vided)-.25 E
-(by the cell size and an)108 338.4 Q 2.5(yd)-.15 G
-(ecimation speci\214ed with option)-2.5 E F2<ad44>2.5 E F0(.)A .093
-(The y-dimension of the grid is determined by the sample spacing, an)108
-362.4 R 2.593(yd)-.15 G .093(ecimation speci\214ed with option)-2.593 F
-F2<ad44>2.593 E F0(,)A(and the time sweep speci\214ed by the)108 374.4 Q
-F2<ad54>5 E F0(option.)2.5 E .222(If the)108 398.4 R F2<ad53>2.722 E F0
-.222(option is not speci\214ed, then all of the traces in the se)2.722 F
-.222(gy \214le will be gridded. If the time sweep and)-.15 F .76
-(delay \(if an)108 410.4 R .76(y\) are not speci\214ed using the)-.15 F
-F2<ad54>3.26 E F0 .76
-(option, then the sweep and delay will be set so that all trace)3.26 F
-(samples are incorporated into the grid.)108 422.4 Q 2.668(As)108 446.4
-S .168(imple time-v)-2.668 F .169(arying g)-.25 F .169
-(ain can be applied to the traces before gridding using the)-.05 F F2
-<ad47>2.669 E F0 .169(option. The start time)2.669 F(for the g)108 458.4
-Q(ain may be either the start of the trace or the sea\215oor arri)-.05 E
--.25(va)-.25 G 2.5(lt).25 G(ime.)-2.5 E(Simple time-domain lo)108 482.4
-Q(w-pass \214ltering can be applied to the traces before gridding using\
- the)-.25 E F2<ad46>2.5 E F0(option.)2.5 E(Re)108 506.4 Q
-(gions of the grid without data are indicated in the output by NaN v)
--.15 E(alues.)-.25 E F1 -.548(AU)72 535.2 S(THORSHIP).548 E F0(Da)108
-547.2 Q(vid W)-.2 E 2.5(.C)-.92 G(aress \(caress at mbari.or)-2.5 E(g\))
--.18 E(Montere)113 559.2 Q 2.5(yB)-.15 G(ay Aquarium Research Institute)
--2.5 E(Dale N. Chayes \(dale at ldeo.columbia.edu\))108 571.2 Q
-(Lamont-Doherty Earth Observ)113 583.2 Q(atory)-.25 E F1(OPTIONS)72 612
-Q F2<ad41>108 624 Q F3(shotscale/timescale)23.08 E F0 .275(This option \
-causes the x-axis to be rescaled from shot number to distance in meters\
- and the y-axis)144 636 R 1.019
-(to be rescaled from time in seconds to depth in meters.)144 648 R(The)
-6.02 E F3(shotscale)3.52 E F0 -.25(va)3.52 G 1.02
-(lue represents the shot).25 F .517(spacing in meters and the)144 660 R
-F3(timescale)3.017 E F0 -.25(va)3.017 G .517
-(lue is the scaling from time to depth \(typically 750 m/s for).25 F
-(the w)144 672 Q(ater column\).)-.1 E F2<ad42>108 688.8 Q F3
-(maxvalue[/window])23.63 E F0 .428
-(This option causes the application of automatic g)144 700.8 R .429
-(ain control \(A)-.05 F .429(GC\). At each sample, a time inter)-.4 F(-)
--.2 E -.25(va)144 712.8 S(l).25 E F3(window)2.899 E F0 .399
-(seconds long centered on the sample is considered. The sample v)2.899 F
-.398(alue is multiplied by)-.25 F 4.999(as)144 724.8 S 2.499(caling f)
--4.999 F 2.499(actor calculated as)-.1 F F3(maxvalue)4.999 E F0(di)4.999
-E 2.499(vided by the maximum original v)-.25 F 2.5(alue in the time)-.25
-F(MB-System 5.0)72 768 Q(12 October 2013)137.055 E(1)195.395 E 0 Cg EP
-%%Page: 2 2
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mbse)72 48 Q 141.1(gygrid\(1\) MB-System)-.15 F
-141.1(5.0 mbse)2.5 F(gygrid\(1\))-.15 E(interv)144 84 Q .123
-(al. This approach can emphasize coherent arri)-.25 F -.25(va)-.25 G
-.123(ls re).25 F -.05(ga)-.15 G .123(rdless of amplitude le).05 F -.15
-(ve)-.25 G .123(l. If).15 F/F1 10/Times-Italic at 0 SF(window)2.623 E F0
-(is)2.623 E .141(not speci\214ed, then the)144 96 R F1 .141
-(window is tak)2.641 F .141(en to be the tr)-.1 F .141
-(ace length in time so that the entir)-.15 F 2.641(et)-.37 G -.15(ra)
--2.641 G .141(ce is nor).15 F(-)-.2 E
-(malized using the same scale factor)144 108 Q 2.5(,a)-1.11 G(nd all tr)
--2.5 E(aces has the same maximum value of maxvalue)-.15 E(.)-.15 E/F2 10
-/Times-Bold at 0 SF<ad44>108 124.8 Q F1(decimate)23.08 E(x/decimate)-.2 E
-(y)-.3 E F0 .913(Sets the decimation of traces \()144 136.8 R F1
-(decimate)A(x)-.2 E F0 3.412(\)a)C .912(nd samples \()-3.412 F F1
-(decimate)A(y)-.3 E F0 3.412(\)u)C .912(sed in generating the output)
--3.412 F .513(grid. The do)144 148.8 R .513
-(wnsampling of the data is actually accomplished by a)-.25 F -.15(ve)-.2
-G .514(raging the v).15 F .514(alues within each)-.25 F
-(grid bin rather than omitting traces or samples.)144 160.8 Q F2<ad46>
-108 177.6 Q F1(mode/window)24.19 E F0 .414(Sets the application of lo)
-144 189.6 R .413(w-pass \214ltering to the trace data. The \214ltering \
-is applied by con)-.25 F -.2(vo)-.4 G .413(lving a).2 F 1.617
-(\214lter function of length)144 201.6 R F1(window)4.117 E F0 1.617
-(seconds with the trace. Currently the only a)4.117 F -.25(va)-.2 G
-1.618(ilable \214lter is a).25 F(cosine taper)144 213.6 Q 2.5(,s)-.4 G
-(et using)-2.5 E F1(mode)2.5 E F0 2.5(=1)2.5 G(.)-2.5 E F2<ad47>108
-230.4 Q F1(mode/gain[/window])22.52 E F0 .507(Sets the application of g)
-144 242.4 R .507(ain to the trace data. The)-.05 F F1(mode)3.006 E F0
--.25(va)3.006 G .506(lue determines ho).25 F 3.006(wt)-.25 G .506(he g)
--3.006 F .506(ain is applied.)-.05 F(If)144 254.4 Q F1(mode)2.987 E F0
-2.987(=0)2.987 G 2.987(,n)-2.987 G 2.987(og)-2.987 G .487
-(ain is applied.If)-3.037 F F1(mode)2.987 E F0 2.987(=1)2.987 G 2.987
-(,t)-2.987 G .487(he g)-2.987 F .487
-(ain is applied starting from the be)-.05 F .487(ginning of the)-.15 F
-.875(trace. If)144 266.4 R F1(mode)5.875 E F0 3.375(=2)3.375 G 3.375(,t)
--3.375 G .875(he g)-3.375 F .875(ain is applied starting at the sea\215\
-oor \(assuming that a sea\215oor pick has)-.05 F .167
-(been de\214ned in the se)144 278.4 R .167(gy data \214le\). The)-.15 F
-F1(gain)2.667 E F0 -.25(va)2.667 G .167(lue sets the g).25 F .167
-(ain applied as follo)-.05 F .167(ws. If G =)-.25 F F1(gain)2.667 E F0
-(and)2.667 E 2.797(ti)144 290.4 S 2.797(st)-2.797 G .297
-(he time in seconds since the start of g)-2.797 F .297
-(ain application, then each sample is multiplied by a f)-.05 F(ac-)-.1 E
-.136(tor of \(1 + \(G * t\)\).)144 302.4 R .136(The parameter)5.136 F F1
-(window)2.636 E F0 2.636(,i)C 2.637(fg)-2.636 G -2.15 -.25(iv e)-2.637 H
-.137(n, sets the length of the time interv).25 F .137(al in seconds)-.25
-F .265(that g)144 314.4 R .265(ain is applied. When the g)-.05 F .265
-(ain is windo)-.05 F .264(wed, trace v)-.25 F .264
-(alues after the end of the g)-.25 F .264(ain windo)-.05 F 2.764(wa)-.25
-G(re)-2.764 E(zeroed.)144 326.4 Q F2<ad48>108 343.2 Q F0 .162(This "hel\
-p" \215ag cause the program to print out a description of its operation\
- and then e)22.52 F .162(xit immedi-)-.15 F(ately)144 355.2 Q(.)-.65 E
-F2<ad49>108 372 Q F1(se)26.41 E(gy\214le)-.4 E F0
-(Sets the \214lename of the input se)144 384 Q
-(gy seismic data \214le to be gridded.)-.15 E F2<ad4f>108 400.8 Q F1
-(grid\214le)22.52 E F0
-(Sets the \214lename for the output GMT netCDF format grid.)144 412.8 Q
-F2<ad52>108 429.6 Q F1(cellsize/startlon/endlon/startlat/endlat)23.08 E
-F0 .128(If the)144 441.6 R F2<ad52>2.628 E F0 .128(option is used, then\
- the pro\214le will represent a line between start and end positions sp\
-ec-)2.628 F .343(i\214ed using longitude and latitude v)144 453.6 R .343
-(alues in decimal de)-.25 F .343(grees. This line se)-.15 F .344
-(gment is di)-.15 F .344(vided into bin-)-.25 F 1.437
-(ning cells according to)144 465.6 R F1(cellsize)3.937 E F0 1.437
-(in meters, and the x-dimension of the grid will be the distance)3.937 F
-1.001(along the line \(in meters\) di)144 477.6 R 1.001
-(vided by the cell size and an)-.25 F 3.501(yd)-.15 G 1.002
-(ecimation speci\214ed with option)-3.501 F F2<ad44>3.502 E F0(.)A(Ef)
-144 489.6 Q(fecti)-.25 E -.15(ve)-.25 G(ly).15 E 3.975(,t)-.65 G 1.475
-(he location of each trace will be projected onto the line se)-3.975 F
-1.474(gment and the se)-.15 F(gment)-.15 E
-(added to the appropriate cell. Where cells ha)144 501.6 Q .3 -.15(ve m)
--.2 H(ultiple traces, the traces will be a).15 E -.15(ve)-.2 G(raged.)
-.15 E F2<ad53>108 518.4 Q F1(mode[/start/end[/sc)24.74 E(han/ec)-.15 E
-(han]])-.15 E F0 .847(This option sets the range of traces that are gri\
-dded, and thus determines the x-dimension of the)144 530.4 R .531
-(output grid \(also impacted by an)144 542.4 R 3.031(yd)-.15 G .531
-(ecimation speci\214ed with)-3.031 F F2<ad44>3.031 E F0 .531(\). If)B F1
-(mode)3.03 E F0 3.03(=0)3.03 G 3.03(,t)-3.03 G(hen)-3.03 E F1(start)3.03
-E F0(and)3.03 E F1(end)3.03 E F0 1.057(refer to shot numbers. This typi\
-cally is useful for subbottom data or seismic data in shot g)144 554.4 R
-(ather)-.05 E .117(form. If)144 566.4 R F1(mode)2.617 E F0 2.617(=1)
-2.617 G 2.617(,t)-2.617 G(hen)-2.617 E F1(start)2.617 E F0(and)2.617 E
-F1(end)2.617 E F0 .117
-(refer to CMP \(or RP or CDP\) numbers. This typically is use-)2.617 F
-.058(ful for seismic re\215ection data in stack)144 578.4 R .059
-(ed or CMP g)-.1 F .059
-(ather forms. If the data are multichannel seismic)-.05 F 1.198
-(re\215ection or seismic refraction in either shot or CMP g)144 590.4 R
-1.198(athers, the start and end of the channels)-.05 F .806
-(selected for gridding is set using the optional)144 602.4 R F1(sc)3.306
-E(han)-.15 E F0(and)3.307 E F1(ec)3.307 E(han)-.15 E F0 3.307(,r)C
-(especti)-3.307 E -.15(ve)-.25 G(ly).15 E 3.307(.T)-.65 G .807
-(he x-dimension of)-3.307 F(the output grid is determined by \()144
-614.4 Q F1(end)A F0<ad>2.5 E F1(start)2.5 E F0 2.5(+1)2.5 G 2.5(\)*\()
--2.5 G F1(ec)-2.5 E(han)-.15 E F0<ad>2.5 E F1(sc)2.5 E(han)-.15 E F0 2.5
-(+1)2.5 G 2.5(\)/)-2.5 G F1(decimate)A(x)-.2 E F0(.)A F2<ad54>108 631.2
-Q F1(sweep[/delay])23.63 E F0 .814
-(Sets the time range of seismic data to be gridded. The)144 643.2 R F1
-(sweep)3.314 E F0 .814(speci\214es the number of seconds of)3.314 F .219
-(data comprising the y-axis of the grid. The number of samples follo)144
-655.2 R .219(ws from the sample interv)-.25 F .219(al of)-.25 F .239
-(the data, and an)144 667.2 R 2.738(yd)-.15 G .238
-(ecimation applied using)-2.738 F F2<ad44>2.738 E F0 2.738(.T)C .238
-(he optional)-2.738 F F1(delay)2.738 E F0 -.25(va)2.738 G .238
-(lue sets the sweep start time,).25 F(ag)144 679.2 Q .959
-(ain in seconds.)-.05 F .959
-(The y-dimension of the output grid is determined by)5.959 F F1(sweep)
-3.46 E F0 3.46(/s)3.46 G(ampleinterv)-3.46 E .96(al /)-.25 F F1
-(decimate)144 691.2 Q(y)-.3 E F0 2.5(,w)C(here the sampleinterv)-2.5 E
-(al is a parameter read with the seismic data.)-.25 E F2<ad56>108 708 Q
-F0(Normally)23.08 E(,)-.65 E F2(mbsegygrid)3.525 E F0 1.025
-(prints out information re)3.525 F -.05(ga)-.15 G 1.025
-(rding its controlling parameters during e).05 F -.15(xe)-.15 G(cu-).15
-E(tion; the)144 720 Q F2<ad56>2.5 E F0(option causes the program to als\
-o print out statements indicating its progress.)2.5 E(MB-System 5.0)72
-768 Q(12 October 2013)137.055 E(2)195.395 E 0 Cg EP
-%%Page: 3 3
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mbse)72 48 Q 141.1(gygrid\(1\) MB-System)-.15 F
-141.1(5.0 mbse)2.5 F(gygrid\(1\))-.15 E/F1 10/Times-Bold at 0 SF<ad57>108
-84 Q/F2 10/Times-Italic at 0 SF(mode/start/end)20.3 E F0 1.348(This option\
- can be used to limit the data being gridded to a particular time windo)
-144 96 R 3.849(wi)-.25 G 3.849(nv)-3.849 G(arious)-4.099 E -.1(wa)144
-108 S .9(ys. This option does not impact the de\214nition of the o).1 F
--.15(ve)-.15 G .9(rall grid bounds, b).15 F .9(ut does restrict the)-.2
-F .115(data gridded to samples within particular times of interest. If)
-144 120 R F2(mode)2.616 E F0 2.616(=1)2.616 G 2.616(,t)-2.616 G(hen)
--2.616 E F2(start)2.616 E F0(and)2.616 E F2(end)2.616 E F0 .116
-(are sim-)2.616 F .396
-(ply start and end times of good data in seconds. If)144 132 R F2(mode)
-2.896 E F0 2.896(=2)2.896 G 2.896(,t)-2.896 G(hen)-2.896 E F2(start)
-2.896 E F0(and)2.896 E F2(end)2.896 E F0 .396(are relati)2.896 F .696
--.15(ve t)-.25 H 2.896(ot).15 G(he)-2.896 E .378
-(time of the bottom return. In this case)144 144 R F2(start)2.878 E F0
-.378(is often ne)2.878 F -.05(ga)-.15 G(ti).05 E .679 -.15(ve s)-.25 H
-2.879(ot).15 G .379(hat the grid sho)-2.879 F .379(ws data abo)-.25 F
-.679 -.15(ve t)-.15 H(he).15 E(sea\215oor)144 156 Q 2.809(,a)-.4 G .309
-(nd then do)-2.809 F .309(wn into the subsurf)-.25 F .308(ace. Finally)
--.1 F 2.808(,i)-.65 G(f)-2.808 E F2(mode)2.808 E F0 2.808(=3)2.808 G
-2.808(,t)-2.808 G(hen)-2.808 E F2(start)2.808 E F0(and)2.808 E F2(end)
-2.808 E F0 .308(are relati)2.808 F .608 -.15(ve t)-.25 H(o).15 E
-(the time corresponding to the sonar depth.)144 168 Q/F3 10.95
-/Times-Bold at 0 SF(EXAMPLES)72 196.8 Q F0 .826(Suppose that we ha)108
-208.8 R 1.126 -.15(ve a R)-.2 H .827(eson 7k format \214le \(format 88\
-\) called 20040722_152111.s7k that contains sub-).15 F .997
-(bottom pro\214ler data. Further suppose that we ha)108 220.8 R 1.296
--.15(ve u)-.2 H(sed).15 E F1(mbextractsegy)3.496 E F0 .996(to e)3.496 F
-.996(xtract the subbottom pro\214ler)-.15 F .673(data into a se)108
-232.8 R .673(gy format \214le called 20040722_152111.s7k.se)-.15 F(gy)
--.15 E(.)-.65 E F1(MBextractsegy)3.173 E F0 .673
-(also generates a "sinf" \214le)3.173 F 4.23
-(containing statistics about the data in the se)108 244.8 R 4.229
-(gy \214le. In this case, the contents of the sinf \214le)-.15 F
-(20040722_152111.s7k.se)108 256.8 Q(gy)-.15 E(.sinf are:)-.65 E
-(SEGY Data File:)144 268.8 Q(20040722_152111.s7k.se)15 E(gy)-.15 E
-(File Header Info:)144 292.8 Q 62.5(Channels: 1)149 304.8 R
-(Auxiliary Channels:)149 316.8 Q(0)40 E(Sample Interv)149 328.8 Q
-(al \(usec\):)-.25 E(64)27.5 E(Number of Samples in T)149 340.8 Q 10
-(race: 8330)-.35 F -.35(Tr)149 352.8 S(ace length \(sec\):).35 E
-(0.533120)22.5 E(Data F)149 364.8 Q 37.5(ormat: IEEE)-.15 F(32 bit inte)
-2.5 E(ger)-.15 E(CDP F)149 376.8 Q 62.5(old: 0)-.15 F(Data T)144 400.8 Q
-(otals:)-.8 E(Number of T)149 412.8 Q 35(races: 2527)-.35 F
-(Min Max Delta:)149 424.8 Q(Shot number:)154 436.8 Q 10(56 2582 2527)50
-F(Shot trace:)154 448.8 Q 20(111)55 G(RP number:)154 460.8 Q 10
-(56 2582 2527)55 F(RP trace:)154 472.8 Q 20(111)60 G(Delay \(sec\):)154
-484.8 Q(0.000000 0.000000 0.000000)35 E(Range \(m\):)154 496.8 Q
-(0.000000 0.000000 0.000000)40 E(Recei)154 508.8 Q -.15(ve)-.25 G 2.5
-(rE).15 G(le)-2.5 E -.25(va)-.25 G(tion \(m\):).25 E
-(\255224.030000 \2552.860000 \255221.170000)7.5 E(Source Ele)154 520.8 Q
--.25(va)-.25 G(tion \(m\):).25 E
-(\255224.030000 \2552.860000 \255221.170000)12.5 E(Source Depth \(m\):)
-154 532.8 Q(2.860000 224.030000 \255221.170000)22.5 E(Recei)154 544.8 Q
--.15(ve)-.25 G 2.5(rW).15 G
-(ater Depth \(m\): 51.510000 487.670000 \255436.160000)-3.3 E(Source W)
-154 556.8 Q(ater Depth \(m\):)-.8 E(51.510000 487.670000 \255436.160000)
-7.5 E(Na)144 580.8 Q(vig)-.2 E(ation T)-.05 E(otals:)-.8 E
-(Start of Data:)149 604.8 Q -.35(Ti)154 616.8 S 2.5(me: 07).35 F
-(22 2004 15:20:37.029000)2.5 E(JD204)5 E(Lon: \255121.8573)154 628.8 Q 5
-(Lat: 36.7755)12.5 F(End of Data:)149 652.8 Q -.35(Ti)154 664.8 S 2.5
-(me: 07).35 F(22 2004 15:44:15.438000)2.5 E(JD204)5 E(Lon: \255121.8572)
-154 676.8 Q 5(Lat: 36.7952)12.5 F(Limits:)144 700.8 Q
-(Minimum Longitude:)149 712.8 Q 5(\255121.8574 Maximum)10 F 7.5
-(Longitude: \255121.8572)2.5 F(Minimum Latitude:)149 724.8 Q 5
-(36.7755 Maximum)17.5 F 15(Latitude: 36.7952)2.5 F(MB-System 5.0)72 768
-Q(12 October 2013)137.055 E(3)195.395 E 0 Cg EP
-%%Page: 4 4
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mbse)72 48 Q 141.1(gygrid\(1\) MB-System)-.15 F
-141.1(5.0 mbse)2.5 F(gygrid\(1\))-.15 E .431(In order to generate a tim\
-e vs. trace number grid of all traces in the se)108 84 R .431
-(gy \214le, with a column for each trace)-.15 F .505(and a ro)108 96 R
-3.005(wf)-.25 G .505(or each time sample, one can simply in)-3.005 F -.2
-(vo)-.4 G -.1(ke).2 G/F1 10/Times-Bold at 0 SF(mbsegygrid)3.105 E F0 .504
-(without specifying a range of desired)3.005 F .008(traces or the desir\
-ed time sweep. The program automatically sizes the grid to include all \
-traces and samples,)108 108 R .321
-(taking into account trace start delays if necessary)108 120 R 2.821(.T)
--.65 G .32
-(he root of the output grid \214lename is speci\214ed with the)-2.821 F
-F1<ad4f>108 132 Q F0 1.256(option; if "SubbottomGrid" is speci\214ed th\
-en the output grid will be named SubbottomGrid.grd. The)3.755 F
-(command is:)108 144 Q(mbse)144 156 Q
-(gygrid \255I 20040722_152111.s7k.se)-.15 E 40.39(gy -O)-.15 F
-(SubbottomGrid)2.5 E(and the output to the terminal looks lik)108 168 Q
-(e:)-.1 E(MBse)144 192 Q(gygrid P)-.15 E(arameters:)-.15 E(Input se)144
-204 Q(gy \214le:)-.15 E(20040722_152111.s7k.se)22.5 E(gy)-.15 E
-(Output \214leroot:)144 216 Q(SubbottomGrid)22.5 E(Input P)144 228 Q
-(arameters:)-.15 E(trace mode:)156.5 240 Q(1)22.5 E(trace start:)156.5
-252 Q(56)20 E(trace end:)156.5 264 Q(2582)25 E(channel start:)156.5 276
-Q(1)15 E(channel end:)156.5 288 Q(1)20 E(trace decimation:)156.5 300 Q
-(1)7.5 E(time sweep:)156.5 312 Q(0.533120 seconds)22.5 E(time delay:)
-156.5 324 Q(0.000000 seconds)22.5 E(sample interv)156.5 336 Q 7.5
-(al: 0.000064)-.25 F(seconds)2.5 E(sample decimation:)156.5 348 Q(1)5 E
-(windo)156.5 360 Q 2.5(wm)-.25 G 17.5(ode: 0)-2.5 F(windo)156.5 372 Q
-2.5(ws)-.25 G 15(tart: 0.000000)-2.5 F(seconds)2.5 E(windo)156.5 384 Q
-2.5(we)-.25 G 20(nd: 0.000000)-2.5 F(seconds)2.5 E -.05(ga)156.5 396 S
-(in mode:).05 E(0)25 E -.05(ga)156.5 408 S 35(in: 0.000000).05 F
-(Output P)144 420 Q(arameters:)-.15 E(grid \214lename:)156.5 432 Q
-(SubbottomGrid.grd)15 E 2.5(xg)156.5 444 S(rid dimension:)-2.5 E(2527)
-7.5 E 2.5(yg)156.5 456 S(rid dimension:)-2.5 E(8331)7.5 E(grid xmin:)
-156.5 468 Q(55.500000)25 E(grid xmax:)156.5 480 Q(2582.500000)25 E
-(grid ymin:)156.5 492 Q(\2550.533152)25 E(grid ymax:)156.5 504 Q
-(0.000032)25 E(NaN v)156.5 516 Q(alues used to \215ag re)-.25 E
-(gions with no data)-.15 E(PR)144 528 Q 2.393(OCESS read:0 position:0 r\
-p:56 channel:1 2004/204 15:20:37.029 samples:8330 interv)-.4 F(al:64)
--.25 E(usec minmax: 0.000000 2425.784912)108 540 Q(PR)144 552 Q 1.142(O\
-CESS read:25 position:25 rp:81 channel:1 2004/204 15:20:51.068 samples:\
-8330 interv)-.4 F(al:64)-.25 E(usec minmax: 0.000000 3832.087402)108 564
-Q(PR)144 576 Q .518(OCESS read:50 position:50 rp:106 channel:1 2004/204\
- 15:21:05.106 samples:8330 interv)-.4 F(al:64)-.25 E
-(usec minmax: 0.000000 1590.149658)108 588 Q(....................)144
-600 Q(PR)144 612 Q .095(OCESS read:2475 position:2475 rp:2531 channel:1\
- 2004/204 15:43:46.800 samples:8330 inter)-.4 F(-)-.2 E -.25(va)108 624
-S(l:64 usec minmax: 0.000000 991.466064).25 E(PR)144 636 Q .095(OCESS r\
-ead:2500 position:2500 rp:2556 channel:1 2004/204 15:44:00.838 samples:\
-8330 inter)-.4 F(-)-.2 E -.25(va)108 648 S
-(l:64 usec minmax: 0.000000 838.286926).25 E(PR)144 660 Q .095(OCESS re\
-ad:2525 position:2525 rp:2581 channel:1 2004/204 15:44:14.877 samples:8\
-330 inter)-.4 F(-)-.2 E -.25(va)108 672 S
-(l:64 usec minmax: 0.000000 985.870667).25 E(--------------)144 696 Q
-(Plot generation shellscript <SubbottomGrid.grd.cmd> created.)144 720 Q
-(MB-System 5.0)72 768 Q(12 October 2013)137.055 E(4)195.395 E 0 Cg EP
-%%Page: 5 5
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mbse)72 48 Q 141.1(gygrid\(1\) MB-System)-.15 F
-141.1(5.0 mbse)2.5 F(gygrid\(1\))-.15 E(Instructions:)144 84 Q(Ex)149 96
-Q(ecute <SubbottomGrid.grd.cmd> to generate Postscript plot <SubbottomG\
-rid.grd.ps>.)-.15 E(Ex)149 108 Q
-(ecuting <SubbottomGrid.grd.cmd> also in)-.15 E -.2(vo)-.4 G -.1(ke).2 G
-2.5(sg).1 G 2.5(vt)-2.5 G 2.5(ov)-2.5 G(ie)-2.5 E 2.5(wt)-.25 G
-(he plot on the screen.)-2.5 E(--------------)144 132 Q .771
-(The size of the the output grid can be check)108 156 R .771
-(ed using the)-.1 F/F1 10/Times-Bold at 0 SF(GMT)3.27 E F0(program)3.27 E
-F1(grdinf)3.27 E(o)-.25 E F0 3.27(.T)C .77(he results of the com-)-3.27
-F(mand:)108 168 Q(grdinfo SubbottomGrid.grd)144 180 Q(look lik)108 192 Q
-(e:)-.1 E(SubbottomGrid.grd: T)144 204 Q
-(itle: Seismic Grid from 20040722_152111.s7k.se)-.35 E(gy)-.15 E
-(SubbottomGrid.grd: Command:)144 216 Q(SubbottomGrid.grd: Remark:)144
-228 Q(Projection: SeismicPro\214le)164 240 Q(Grid created by MBse)164
-252 Q(gygrid)-.15 E(MB-system V)164 264 Q(ersion 5.0.4)-1.11 E
-(Run by <caress> on <hess> at <Thu Sep 23 16:24:39 2004>)164 276 Q
-(SubbottomGrid.grd: Pix)144 288 Q(el node re)-.15 E(gistration used)-.15
-E(SubbottomGrid.grd: grd\214le format # 0)144 300 Q
-(SubbottomGrid.grd: x_min: 55.5 x_max: 2582.5 x_inc: 1 units: T)144 312
-Q(race Number nx: 2527)-.35 E .92(SubbottomGrid.grd: y_min: \2550.53315\
-2 y_max: 3.2e-05 y_inc: 6.4e-05 units: T)144 324 R .92
-(ime \(seconds\) n)-.35 F(y:)-.15 E(8331)108 336 Q
-(SubbottomGrid.grd: z_min: 0 z_max: 2623.34 units: T)144 348 Q
-(race Signal)-.35 E(SubbottomGrid.grd: scale_f)144 360 Q
-(actor: 1 add_of)-.1 E(fset: 0)-.25 E F1(MBsegygrid)108 384 Q F0 1.272
-(also uses the macro)3.772 F F1(mbm_grdplot)3.772 E F0 1.272
-(to generate a shellscript called SubbottomGrid.grd.cmd)3.772 F
-(that, when e)108 396 Q -.15(xe)-.15 G(cuted, will use).15 E F1(GMT)2.5
-E F0(commands to generate a Postscript plot of the grid.)2.5 E .465(In \
-order to generate a grid of a subset of the subbottom data \(for instan\
-ce, shots 1500 \255 2000 and the time)108 420 R
-(sweep from 0.25 to 0.35 seconds\), use the)108 432 Q F1<ad53>2.5 E F0
-(and)2.5 E F1<ad54>2.5 E F0(options:)2.5 E(mbse)144 444 Q 24.93
-(gygrid \255I 20040722_152111.s7k.se)-.15 F 65.32(gy -O)-.15 F
-(SubbottomGrid2)27.43 E(-S0/1500/2000 \255T0.1/0.25)166.72 456 Q
-(This time the)108 468 Q F1(grdinf)2.5 E(o)-.25 E F0(output looks lik)
-2.5 E(e:)-.1 E(SubbottomGrid2.grd: T)144 480 Q
-(itle: Seismic Grid from 20040722_152111.s7k.se)-.35 E(gy)-.15 E
-(SubbottomGrid2.grd: Command:)144 492 Q(SubbottomGrid2.grd: Remark:)144
-504 Q(Projection: SeismicPro\214le)164 516 Q(Grid created by MBse)164
-528 Q(gygrid)-.15 E(MB-system V)164 540 Q(ersion 5.0.4)-1.11 E
-(Run by <caress> on <hess> at <Thu Sep 23 16:40:34 2004>)164 552 Q
-(SubbottomGrid2.grd: Pix)144 564 Q(el node re)-.15 E(gistration used)
--.15 E(SubbottomGrid2.grd: grd\214le format # 0)144 576 Q
-(SubbottomGrid2.grd: x_min: 1499.5 x_max: 2000.5 x_inc: 1 units: T)144
-588 Q(race Number nx: 501)-.35 E 1.133(SubbottomGrid2.grd: y_min: \2550\
-.35 y_max: \2550.249968 y_inc: 6.4e-05 units: T)144 600 R 1.133
-(ime \(seconds\) n)-.35 F(y:)-.15 E(1563)108 612 Q
-(SubbottomGrid2.grd: z_min: 0 z_max: 558.42 units: T)144 624 Q
-(race Signal)-.35 E(SubbottomGrid2.grd: scale_f)144 636 Q
-(actor: 1 add_of)-.1 E(fset: 0)-.25 E/F2 10.95/Times-Bold at 0 SF(SEE ALSO)
-72 664.8 Q F1(mbsystem)108 676.8 Q F0(\(1\),)A F1(mbm_grdplot)2.5 E F0
-(\(1\),)A F1(mbmosaic)2.5 E F0(\(1\),)A F1(mbm_grid)2.5 E F0(\(1\))A F2
--.11(BU)72 705.6 S(GS).11 E F0(This tool isn')108 717.6 Q 2.5(tc)-.18 G
-(lose to being complete...)-2.5 E(MB-System 5.0)72 768 Q
-(12 October 2013)137.055 E(5)195.395 E 0 Cg EP
-%%Trailer
-end
-%%EOF
diff --git a/src/ps/mbsegyinfo.ps b/src/ps/mbsegyinfo.ps
deleted file mode 100644
index d97ae77..0000000
--- a/src/ps/mbsegyinfo.ps
+++ /dev/null
@@ -1,343 +0,0 @@
-%!PS-Adobe-3.0
-%%Creator: groff version 1.19.2
-%%CreationDate: Wed Jul  1 12:29:30 2015
-%%DocumentNeededResources: font Times-Roman
-%%+ font Times-Bold
-%%+ font Times-Italic
-%%DocumentSuppliedResources: procset grops 1.19 2
-%%Pages: 2
-%%PageOrder: Ascend
-%%DocumentMedia: Default 612 792 0 () ()
-%%Orientation: Portrait
-%%EndComments
-%%BeginDefaults
-%%PageMedia: Default
-%%EndDefaults
-%%BeginProlog
-%%BeginResource: procset grops 1.19 2
-%!PS-Adobe-3.0 Resource-ProcSet
-/setpacking where{
-pop
-currentpacking
-true setpacking
-}if
-/grops 120 dict dup begin
-/SC 32 def
-/A/show load def
-/B{0 SC 3 -1 roll widthshow}bind def
-/C{0 exch ashow}bind def
-/D{0 exch 0 SC 5 2 roll awidthshow}bind def
-/E{0 rmoveto show}bind def
-/F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def
-/G{0 rmoveto 0 exch ashow}bind def
-/H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/I{0 exch rmoveto show}bind def
-/J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def
-/K{0 exch rmoveto 0 exch ashow}bind def
-/L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/M{rmoveto show}bind def
-/N{rmoveto 0 SC 3 -1 roll widthshow}bind def
-/O{rmoveto 0 exch ashow}bind def
-/P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/Q{moveto show}bind def
-/R{moveto 0 SC 3 -1 roll widthshow}bind def
-/S{moveto 0 exch ashow}bind def
-/T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/SF{
-findfont exch
-[exch dup 0 exch 0 exch neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/MF{
-findfont
-[5 2 roll
-0 3 1 roll
-neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/level0 0 def
-/RES 0 def
-/PL 0 def
-/LS 0 def
-/MANUAL{
-statusdict begin/manualfeed true store end
-}bind def
-/PLG{
-gsave newpath clippath pathbbox grestore
-exch pop add exch pop
-}bind def
-/BP{
-/level0 save def
-1 setlinecap
-1 setlinejoin
-72 RES div dup scale
-LS{
-90 rotate
-}{
-0 PL translate
-}ifelse
-1 -1 scale
-}bind def
-/EP{
-level0 restore
-showpage
-}def
-/DA{
-newpath arcn stroke
-}bind def
-/SN{
-transform
-.25 sub exch .25 sub exch
-round .25 add exch round .25 add exch
-itransform
-}bind def
-/DL{
-SN
-moveto
-SN
-lineto stroke
-}bind def
-/DC{
-newpath 0 360 arc closepath
-}bind def
-/TM matrix def
-/DE{
-TM currentmatrix pop
-translate scale newpath 0 0 .5 0 360 arc closepath
-TM setmatrix
-}bind def
-/RC/rcurveto load def
-/RL/rlineto load def
-/ST/stroke load def
-/MT/moveto load def
-/CL/closepath load def
-/Fr{
-setrgbcolor fill
-}bind def
-/setcmykcolor where{
-pop
-/Fk{
-setcmykcolor fill
-}bind def
-}if
-/Fg{
-setgray fill
-}bind def
-/FL/fill load def
-/LW/setlinewidth load def
-/Cr/setrgbcolor load def
-/setcmykcolor where{
-pop
-/Ck/setcmykcolor load def
-}if
-/Cg/setgray load def
-/RE{
-findfont
-dup maxlength 1 index/FontName known not{1 add}if dict begin
-{
-1 index/FID ne{def}{pop pop}ifelse
-}forall
-/Encoding exch def
-dup/FontName exch def
-currentdict end definefont pop
-}bind def
-/DEFS 0 def
-/EBEGIN{
-moveto
-DEFS begin
-}bind def
-/EEND/end load def
-/CNT 0 def
-/level1 0 def
-/PBEGIN{
-/level1 save def
-translate
-div 3 1 roll div exch scale
-neg exch neg exch translate
-0 setgray
-0 setlinecap
-1 setlinewidth
-0 setlinejoin
-10 setmiterlimit
-[]0 setdash
-/setstrokeadjust where{
-pop
-false setstrokeadjust
-}if
-/setoverprint where{
-pop
-false setoverprint
-}if
-newpath
-/CNT countdictstack def
-userdict begin
-/showpage{}def
-/setpagedevice{}def
-}bind def
-/PEND{
-countdictstack CNT sub{end}repeat
-level1 restore
-}bind def
-end def
-/setpacking where{
-pop
-setpacking
-}if
-%%EndResource
-%%EndProlog
-%%BeginSetup
-%%BeginFeature: *PageSize Default
-<< /PageSize [ 612 792 ] /ImagingBBox null >> setpagedevice
-%%EndFeature
-%%IncludeResource: font Times-Roman
-%%IncludeResource: font Times-Bold
-%%IncludeResource: font Times-Italic
-grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72
-def/PL 792 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron/Zcaron
-/scaron/zcaron/Ydieresis/trademark/quotesingle/Euro/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/space/exclam/quotedbl/numbersign/dollar/percent
-/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen
-/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon
-/semicolon/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O
-/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright/circumflex
-/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y
-/z/braceleft/bar/braceright/tilde/.notdef/quotesinglbase/guillemotleft
-/guillemotright/bullet/florin/fraction/perthousand/dagger/daggerdbl
-/endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut
-/dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash
-/quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen
-/brokenbar/section/dieresis/copyright/ordfeminine/guilsinglleft
-/logicalnot/minus/registered/macron/degree/plusminus/twosuperior
-/threesuperior/acute/mu/paragraph/periodcentered/cedilla/onesuperior
-/ordmasculine/guilsinglright/onequarter/onehalf/threequarters
-/questiondown/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE
-/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex
-/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis
-/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn
-/germandbls/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla
-/egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis
-/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide/oslash
-/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis]def
-/Times-Italic at 0 ENC0/Times-Italic RE/Times-Bold at 0 ENC0/Times-Bold RE
-/Times-Roman at 0 ENC0/Times-Roman RE
-%%EndSetup
-%%Page: 1 1
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mbse)72 48 Q 141.1(gyinfo\(1\) MB-System)-.15 F
-141.1(5.0 mbse)2.5 F(gyinfo\(1\))-.15 E/F1 10.95/Times-Bold at 0 SF -.219
-(NA)72 84 S(ME).219 E/F2 10/Times-Bold at 0 SF(mbsegyinf)108 96 Q(o)-.25 E
-F0 2.5<ad4f>2.5 G(utput some basic statistics of se)-2.5 E
-(gy format seismic data \214les.)-.15 E F1(VERSION)72 124.8 Q F0 -1.11
-(Ve)108 136.8 S(rsion 5.0)1.11 E F1(SYNOPSIS)72 165.6 Q F2(mbsegyinf)108
-177.6 Q(o)-.25 E F0([)2.5 E F2<ad49>A/F3 10/Times-Italic at 0 SF
-(\214lename)A F2<ad4c>2.5 E F3(lon\215ip)A F2(\255O \255H \255V])2.5 E
-F1(DESCRIPTION)72 206.4 Q F2(MBsegyinf)108 218.4 Q(o)-.25 E F0 .259
-(is a utility for reading a se)2.759 F .258(gy format seismic data \214\
-le or \214les and outputting some basic statis-)-.15 F 2.726(tics. The)
-108 230.4 R .227(table generated sho)2.726 F .227
-(ws the \214lename, data counts, na)-.25 F(vig)-.2 E .227
-(ation totals, time and na)-.05 F(vig)-.2 E .227(ation of the \214rst)
--.05 F(and last data records, minimum and maximum data v)108 242.4 Q
-(alues, and the geographic bounding box of the data.)-.25 E .685
-(An important function)108 266.4 R(of)5.685 E F2(mbsegyinf)3.185 E(o)
--.25 E F0 .684(is to generate se)3.185 F .684
-(gy information, or ".sinf" \214les, that may be parsed)-.15 F .728
-(by other)108 278.4 R F2(MB-System)3.228 E F0 .728
-(programs and macros. T)3.228 F 3.228(oc)-.8 G .728
-(reate an ".sinf" \214le, simply direct the output of)-3.228 F F2
-(mbsegy-)3.229 E(inf)108 290.4 Q(o)-.25 E F0 .915
-(to a \214le named by adding the suf)3.415 F .915
-(\214x ".sinf" to the input sw)-.25 F .914(ath data \214lename. The)-.1
-F F2<ad4f>3.414 E F0 .914(option accom-)3.414 F
-(plishes this same task automatically)108 302.4 Q(.)-.65 E F1 -.548(AU)
-72 331.2 S(THORSHIP).548 E F0(Da)108 343.2 Q(vid W)-.2 E 2.5(.C)-.92 G
-(aress \(caress at mbari.or)-2.5 E(g\))-.18 E(Montere)113 355.2 Q 2.5(yB)
--.15 G(ay Aquarium Research Institute)-2.5 E
-(Dale N. Chayes \(dale at ldeo.columbia.edu\))108 367.2 Q
-(Lamont-Doherty Earth Observ)113 379.2 Q(atory)-.25 E F1(OPTIONS)72 408
-Q F2<ad48>108 420 Q F0 .162(This "help" \215ag cause the program to pri\
-nt out a description of its operation and then e)22.52 F .162
-(xit immedi-)-.15 F(ately)144 432 Q(.)-.65 E F2<ad49>108 448.8 Q F3
-(\214lename)26.41 E F0(Sets the input se)144 460.8 Q
-(gy seismic data \214lename. Def)-.15 E(ault:)-.1 E F3(in\214le)2.5 E F0
-2.5(=")2.5 G(stdin".)-2.5 E F2<ad4c>108 477.6 Q F3(lon\215ip)23.63 E F0
-.572(Sets the range of the longitude v)144 489.6 R .572(alues returned.)
--.25 F(If)5.572 E F3(lon\215ip)3.072 E F0 .572
-(=\2551 then the longitude v)B .571(alues will be in)-.25 F .488
-(the range from \255360 to 0 de)144 501.6 R .488(grees. If)-.15 F F3
-(lon\215ip)2.988 E F0 .488(=0 then the longitude v)B .489
-(alues will be in the range from)-.25 F 1.383(\255180 to 180 de)144
-513.6 R 1.383(grees. If)-.15 F F3(lon\215ip)3.882 E F0 1.382
-(=1 then the longitude v)B 1.382
-(alues will be in the range from 0 to 360)-.25 F(de)144 525.6 Q 2.5
-(grees. Def)-.15 F(ault:)-.1 E F2(mbsegyinf)2.5 E 2.5(os)-.25 G
-(elects the bext longitude range based on the \214rst data.)-2.5 E<ad4f>
-108 542.4 Q F0 1.256(This option causes the program output to be direct\
-ed to ".sinf" \214les rather than to stdout. Each)144 554.4 R(".sinf" \
-\214le is named using the original data \214le path with an ".sinf" suf)
-144 566.4 Q(\214x appended.)-.25 E F2<ad56>108 583.2 Q F0(Normally)23.08
-E(,)-.65 E F2(mbsegyinf)3.046 E(o)-.25 E F0 .546
-(only prints out the statistics obtained by reading all of the data.)
-3.046 F .545(If the)5.545 F F2<ad56>3.045 E F0 .484(\215ag is gi)144
-595.2 R -.15(ve)-.25 G .484(n, then).15 F F2(mbsegyinf)2.984 E(o)-.25 E
-F0 -.1(wo)2.984 G .484(rks in a "v).1 F .484
-(erbose" mode and outputs the program v)-.15 F .484(ersion being)-.15 F
-(used and all read error status messages.)144 607.2 Q F1(EXAMPLES)72 636
-Q F0 1.159(Suppose one wishes to kno)108 648 R 3.659(ws)-.25 G 1.159
-(omething about the contents of a se)-3.659 F 1.158
-(gy subbottom pro\214ler data \214le named)-.15 F
-(20040722_152111.s7k.se)108 660 Q(gy)-.15 E 5(.T)-.65 G(he follo)-5 E
-(wing will suf)-.25 E(\214ce:)-.25 E(mbse)144 672 Q
-(gyinfo \255I 20040722_152111.s7k.se)-.15 E(gy)-.15 E
-(and returns the follo)108 684 Q(wing output:)-.25 E(SEGY Data File:)144
-696 Q(20040722_152111.s7k.se)15 E(gy)-.15 E(File Header Info:)144 720 Q
-(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(1)204.835 E 0
-Cg EP
-%%Page: 2 2
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mbse)72 48 Q 141.1(gyinfo\(1\) MB-System)-.15 F
-141.1(5.0 mbse)2.5 F(gyinfo\(1\))-.15 E 62.5(Channels: 1)149 84 R
-(Auxiliary Channels:)149 96 Q(0)40 E(Sample Interv)149 108 Q
-(al \(usec\):)-.25 E(64)27.5 E(Number of Samples in T)149 120 Q 10
-(race: 8330)-.35 F -.35(Tr)133 132 S(ace length \(sec\):).35 E(0.533120)
-22.5 E(Data F)149 144 Q 37.5(ormat: IEEE)-.15 F(32 bit inte)2.5 E(ger)
--.15 E(CDP F)149 156 Q 62.5(old: 0)-.15 F(Data T)144 180 Q(otals:)-.8 E
-(Number of T)149 192 Q 35(races: 2527)-.35 F(Min Max Delta:)149 204 Q
-(Shot number:)154 216 Q 10(56 2582 2527)50 F(Shot trace:)154 228 Q 20
-(111)55 G(RP number:)154 240 Q 10(56 2582 2527)55 F(RP trace:)154 252 Q
-20(111)60 G(Delay \(sec\):)138 264 Q(0.000000 0.000000 0.000000)35 E
-(Range \(m\):)154 276 Q(0.000000 0.000000 0.000000)40 E(Recei)154 288 Q
--.15(ve)-.25 G 2.5(rE).15 G(le)-2.5 E -.25(va)-.25 G(tion \(m\):).25 E
-(\255224.030000 \2552.860000 \255221.170000)7.5 E(Source Ele)154 300 Q
--.25(va)-.25 G(tion \(m\):).25 E
-(\255224.030000 \2552.860000 \255221.170000)12.5 E(Source Depth \(m\):)
-154 312 Q(2.860000 224.030000 \255221.170000)22.5 E(Recei)154 324 Q -.15
-(ve)-.25 G 2.5(rW).15 G
-(ater Depth \(m\): 51.510000 487.670000 \255436.160000)-3.3 E(Source W)
-154 336 Q(ater Depth \(m\):)-.8 E(51.510000 487.670000 \255436.160000)
-7.5 E(Na)144 360 Q(vig)-.2 E(ation T)-.05 E(otals:)-.8 E(Start of Data:)
-149 384 Q -.35(Ti)154 396 S 2.5(me: 07).35 F(22 2004 15:20:37.029000)2.5
-E(JD204)5 E(Lon: \255121.8573)154 408 Q 5(Lat: 36.7755)12.5 F
-(End of Data:)149 432 Q -.35(Ti)154 444 S 2.5(me: 07).35 F
-(22 2004 15:44:15.438000)2.5 E(JD204)5 E(Lon: \255121.8572)154 456 Q 5
-(Lat: 36.7952)12.5 F(Limits:)144 480 Q(Minimum Longitude:)149 492 Q 5
-(\255121.8574 Maximum)10 F 7.5(Longitude: \255121.8572)2.5 F
-(Minimum Latitude:)149 504 Q 5(36.7755 Maximum)17.5 F 15
-(Latitude: 36.7952)2.5 F/F1 10.95/Times-Bold at 0 SF(SEE ALSO)72 532.8 Q/F2
-10/Times-Bold at 0 SF(mbsystem)108 544.8 Q F0(\(1\),)A F2(mbextractsegy)2.5
-E F0(\(1\),)A F2(mbsegylist)2.5 E F0(\(1\),)A F2(mbsegygrid)2.5 E F0
-(\(1\),)A F2(SIOSEIS)2.5 E F0(\(http://sioseis.ucsd.edu/ \))A F1 -.11
-(BU)72 573.6 S(GS).11 E F0(Maybe. Depends on who')108 585.6 Q 2.5(sa)
--.55 G(sking...)-2.5 E(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)
--2.5 E(2)204.835 E 0 Cg EP
-%%Trailer
-end
-%%EOF
diff --git a/src/ps/mbsegylist.ps b/src/ps/mbsegylist.ps
deleted file mode 100644
index 63efa13..0000000
--- a/src/ps/mbsegylist.ps
+++ /dev/null
@@ -1,408 +0,0 @@
-%!PS-Adobe-3.0
-%%Creator: groff version 1.19.2
-%%CreationDate: Wed Jul  1 12:29:30 2015
-%%DocumentNeededResources: font Times-Roman
-%%+ font Times-Bold
-%%+ font Times-Italic
-%%DocumentSuppliedResources: procset grops 1.19 2
-%%Pages: 3
-%%PageOrder: Ascend
-%%DocumentMedia: Default 612 792 0 () ()
-%%Orientation: Portrait
-%%EndComments
-%%BeginDefaults
-%%PageMedia: Default
-%%EndDefaults
-%%BeginProlog
-%%BeginResource: procset grops 1.19 2
-%!PS-Adobe-3.0 Resource-ProcSet
-/setpacking where{
-pop
-currentpacking
-true setpacking
-}if
-/grops 120 dict dup begin
-/SC 32 def
-/A/show load def
-/B{0 SC 3 -1 roll widthshow}bind def
-/C{0 exch ashow}bind def
-/D{0 exch 0 SC 5 2 roll awidthshow}bind def
-/E{0 rmoveto show}bind def
-/F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def
-/G{0 rmoveto 0 exch ashow}bind def
-/H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/I{0 exch rmoveto show}bind def
-/J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def
-/K{0 exch rmoveto 0 exch ashow}bind def
-/L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/M{rmoveto show}bind def
-/N{rmoveto 0 SC 3 -1 roll widthshow}bind def
-/O{rmoveto 0 exch ashow}bind def
-/P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/Q{moveto show}bind def
-/R{moveto 0 SC 3 -1 roll widthshow}bind def
-/S{moveto 0 exch ashow}bind def
-/T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/SF{
-findfont exch
-[exch dup 0 exch 0 exch neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/MF{
-findfont
-[5 2 roll
-0 3 1 roll
-neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/level0 0 def
-/RES 0 def
-/PL 0 def
-/LS 0 def
-/MANUAL{
-statusdict begin/manualfeed true store end
-}bind def
-/PLG{
-gsave newpath clippath pathbbox grestore
-exch pop add exch pop
-}bind def
-/BP{
-/level0 save def
-1 setlinecap
-1 setlinejoin
-72 RES div dup scale
-LS{
-90 rotate
-}{
-0 PL translate
-}ifelse
-1 -1 scale
-}bind def
-/EP{
-level0 restore
-showpage
-}def
-/DA{
-newpath arcn stroke
-}bind def
-/SN{
-transform
-.25 sub exch .25 sub exch
-round .25 add exch round .25 add exch
-itransform
-}bind def
-/DL{
-SN
-moveto
-SN
-lineto stroke
-}bind def
-/DC{
-newpath 0 360 arc closepath
-}bind def
-/TM matrix def
-/DE{
-TM currentmatrix pop
-translate scale newpath 0 0 .5 0 360 arc closepath
-TM setmatrix
-}bind def
-/RC/rcurveto load def
-/RL/rlineto load def
-/ST/stroke load def
-/MT/moveto load def
-/CL/closepath load def
-/Fr{
-setrgbcolor fill
-}bind def
-/setcmykcolor where{
-pop
-/Fk{
-setcmykcolor fill
-}bind def
-}if
-/Fg{
-setgray fill
-}bind def
-/FL/fill load def
-/LW/setlinewidth load def
-/Cr/setrgbcolor load def
-/setcmykcolor where{
-pop
-/Ck/setcmykcolor load def
-}if
-/Cg/setgray load def
-/RE{
-findfont
-dup maxlength 1 index/FontName known not{1 add}if dict begin
-{
-1 index/FID ne{def}{pop pop}ifelse
-}forall
-/Encoding exch def
-dup/FontName exch def
-currentdict end definefont pop
-}bind def
-/DEFS 0 def
-/EBEGIN{
-moveto
-DEFS begin
-}bind def
-/EEND/end load def
-/CNT 0 def
-/level1 0 def
-/PBEGIN{
-/level1 save def
-translate
-div 3 1 roll div exch scale
-neg exch neg exch translate
-0 setgray
-0 setlinecap
-1 setlinewidth
-0 setlinejoin
-10 setmiterlimit
-[]0 setdash
-/setstrokeadjust where{
-pop
-false setstrokeadjust
-}if
-/setoverprint where{
-pop
-false setoverprint
-}if
-newpath
-/CNT countdictstack def
-userdict begin
-/showpage{}def
-/setpagedevice{}def
-}bind def
-/PEND{
-countdictstack CNT sub{end}repeat
-level1 restore
-}bind def
-end def
-/setpacking where{
-pop
-setpacking
-}if
-%%EndResource
-%%EndProlog
-%%BeginSetup
-%%BeginFeature: *PageSize Default
-<< /PageSize [ 612 792 ] /ImagingBBox null >> setpagedevice
-%%EndFeature
-%%IncludeResource: font Times-Roman
-%%IncludeResource: font Times-Bold
-%%IncludeResource: font Times-Italic
-grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72
-def/PL 792 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron/Zcaron
-/scaron/zcaron/Ydieresis/trademark/quotesingle/Euro/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/space/exclam/quotedbl/numbersign/dollar/percent
-/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen
-/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon
-/semicolon/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O
-/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright/circumflex
-/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y
-/z/braceleft/bar/braceright/tilde/.notdef/quotesinglbase/guillemotleft
-/guillemotright/bullet/florin/fraction/perthousand/dagger/daggerdbl
-/endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut
-/dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash
-/quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen
-/brokenbar/section/dieresis/copyright/ordfeminine/guilsinglleft
-/logicalnot/minus/registered/macron/degree/plusminus/twosuperior
-/threesuperior/acute/mu/paragraph/periodcentered/cedilla/onesuperior
-/ordmasculine/guilsinglright/onequarter/onehalf/threequarters
-/questiondown/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE
-/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex
-/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis
-/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn
-/germandbls/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla
-/egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis
-/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide/oslash
-/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis]def
-/Times-Italic at 0 ENC0/Times-Italic RE/Times-Bold at 0 ENC0/Times-Bold RE
-/Times-Roman at 0 ENC0/Times-Roman RE
-%%EndSetup
-%%Page: 1 1
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mbse)72 48 Q 144.98(gylist\(1\) MB-System)-.15 F
-144.98(5.0 mbse)2.5 F(gylist\(1\))-.15 E/F1 10.95/Times-Bold at 0 SF -.219
-(NA)72 84 S(ME).219 E/F2 10/Times-Bold at 0 SF(mbsegylist)108 96 Q F0 2.5
-<ad4c>2.5 G(ist selected header v)-2.5 E(alues in se)-.25 E
-(gy format seismic data \214les.)-.15 E F1(VERSION)72 124.8 Q F0 -1.11
-(Ve)108 136.8 S(rsion 5.0)1.11 E F1(SYNOPSIS)72 165.6 Q F2(mbsegylist)
-108 177.6 Q F0([)5.429 E F2 2.929<ad4120ad44>B/F3 10/Times-Italic at 0 SF
-(decimate)A F2 2.929<ad4820ad47>5.429 F F3(delimeter)A F2<ad49>5.429 E
-F3(in\214lename)A F2<ad4c>5.429 E F3(lon\215ip)A F2<ad4f>5.429 E F3
-(output_format)A F2<ad55>5.429 E F3 -.15(ch)C(ec).15 E(k)-.2 E F2<ad56>
-5.428 E<ad5a>108 189.6 Q F3(se)A(gment)-.4 E F0(])A F1(DESCRIPTION)72
-218.4 Q F2(MBsegylist)108 230.4 Q F0 .567
-(is a utility to output speci\214ed header v)3.067 F .567(alues from se)
--.25 F .567(gy seismic data \214les to stdout. The option)-.15 F F2
-<ad4f>108 242.4 Q F3(output_format)A F0 .538
-(is used to control the type and order of v)3.038 F .538(alues output.)
--.25 F .538(By def)5.538 F(ault,)-.1 E F2(mbsegylist)3.038 E F0
-(produces)5.538 E 1.725(ASCII \214les in spreadsheet style, with data c\
-olumns separated by tabs. Alternati)108 254.4 R -.15(ve)-.25 G(ly).15 E
-4.226(,t)-.65 G 1.726(he output can be)-4.226 F(binary)108 266.4 Q 2.5
-(,w)-.65 G
-(ith each \214eld represented as a double precision \215oat \()-2.5 E F2
-<ad41>A F0(option\).)2.5 E F1 -.548(AU)72 295.2 S(THORSHIP).548 E F0(Da)
-108 307.2 Q(vid W)-.2 E 2.5(.C)-.92 G(aress \(caress at mbari.or)-2.5 E
-(g\))-.18 E(Montere)113 319.2 Q 2.5(yB)-.15 G
-(ay Aquarium Research Institute)-2.5 E
-(Dale N. Chayes \(dale at ldeo.columbia.edu\))108 331.2 Q
-(Lamont-Doherty Earth Observ)113 343.2 Q(atory)-.25 E F1(OPTIONS)72 372
-Q F2<ad41>108 384 Q F0 1.035(Causes the output to be binary \(nati)144
-396 R 1.335 -.15(ve d)-.25 H 1.035
-(ouble precision \215oating point\) rather than ASCII. Some).15 F .032
-(output options cannot be represented as single binary \215oats \(e.g.)
-144 408 R .032(time strings and longitude or lati-)5.032 F 1.064
-(tude brok)144 420 R 1.064(en into de)-.1 F 1.064
-(grees and minutes. These v)-.15 F 1.063
-(alues are output as multiple \214elds as appropriate.)-.25 F(Def)144
-432 Q(ault: ASCII output with \214elds separated by tabs.)-.1 E F2<ad44>
-108 448.8 Q F3(decimate)23.08 E F0 .407
-(Sets the decimation of the output data. By def)144 460.8 R .407
-(ault \(i.e.)-.1 F F3(decimate)2.907 E F0 .408(=1\), e)B -.15(ve)-.25 G
-.408(ry a).15 F -.25(va)-.2 G .408(ilable data record is).25 F
-(output. If)144 472.8 Q F3(decimate)2.5 E F0(>1, then only e)A -.15(ve)
--.25 G(ry ").15 E F3(decimate)A F0("th record will be output. Def)A
-(ault:)-.1 E F3(decimate)2.5 E F0(=1.)A F2<ad47>108 489.6 Q F3
-(delimiter)22.52 E F0 .079(Sets the character\(s\) used to separate out\
-put \214elds when ascii columns are output. Def)144 501.6 R .078
-(ault: tabs are)-.1 F(used as delimiters.)144 513.6 Q F2<ad48>108 530.4
-Q F0 .162(This "help" \215ag cause the program to print out a descripti\
-on of its operation and then e)22.52 F .162(xit immedi-)-.15 F(ately)144
-542.4 Q(.)-.65 E F2<ad49>108 559.2 Q F3(\214lename)26.41 E F0
-(Sets the \214lename of the input se)144 571.2 Q
-(gy seismic data \214le.)-.15 E F2<ad4c>108 588 Q F3(lon\215ip)23.63 E
-F0 .572(Sets the range of the longitude v)144 600 R .572
-(alues returned.)-.25 F(If)5.572 E F3(lon\215ip)3.072 E F0 .572
-(=\2551 then the longitude v)B .571(alues will be in)-.25 F .488
-(the range from \255360 to 0 de)144 612 R .488(grees. If)-.15 F F3
-(lon\215ip)2.988 E F0 .488(=0 then the longitude v)B .489
-(alues will be in the range from)-.25 F 1.383(\255180 to 180 de)144 624
-R 1.383(grees. If)-.15 F F3(lon\215ip)3.882 E F0 1.382
-(=1 then the longitude v)B 1.382
-(alues will be in the range from 0 to 360)-.25 F(de)144 636 Q 2.5
-(grees. Def)-.15 F(ault:)-.1 E F3(lon\215ip)2.5 E F0 2.5(=0)2.5 G(.)-2.5
-E F2<ad4f>108 652.8 Q F3(output_format)22.52 E F0 .502
-(Determines the form of the output;)144 664.8 R F3(output_format)3.002 E
-F0 .503(is a string composed of one or more of the fol-)3.002 F(lo)144
-676.8 Q(wing characters:)-.25 E F2(/)144 693.6 Q F0 1.97
-(special character: this causes the v)4.47 F 1.969
-(alue indicated by the ne)-.25 F 1.969(xt character to be)-.15 F(in)
-6.969 E -.15(ve)-.4 G 1.969(rted. This).15 F .014
-(applies only to simple numeric v)144 705.6 R .014
-(alues such as depth and heading and not to v)-.25 F .014(alues lik)-.25
-F 2.515(et)-.1 G .015(ime strings)-2.515 F
-(orpositions with hemisphere characters.)144 717.6 Q(MB-System 5.0)72
-768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(1)204.835 E 0 Cg EP
-%%Page: 2 2
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mbse)72 48 Q 144.98(gylist\(1\) MB-System)-.15 F
-144.98(5.0 mbse)2.5 F(gylist\(1\))-.15 E/F1 10/Times-Bold at 0 SF<ad>144 84
-Q F0 .929(special character: this causes the v)3.429 F .929
-(alue indicated by the ne)-.25 F .928
-(xt character to be multiplied by \2551.)-.15 F .537
-(This applies only to simple numeric v)144 96 R .537
-(alues such as depth and heading and not to v)-.25 F .537(alues lik)-.25
-F 3.038(et)-.1 G(ime)-3.038 E
-(strings or positions with hemisphere characters.)144 108 Q F1(C)144
-124.8 Q F0(for CMP \(or RP or CDP\) g)2.5 E(ather number of a trace)-.05
-E F1(c)144 141.6 Q F0(for trace number within a CMP \(or RP or CDP\) g)
-2.5 E(ather)-.05 E F1(D)144 158.4 Q F0
-(for trace start delay \(seconds\))2.5 E F1(I)144 175.2 Q F0
-(for sample length \(seconds\))2.5 E F1(i)144 192 Q F0(for time interv)
-2.5 E(al since last trace \(seconds\))-.25 E F1(J)144 208.8 Q F0(for a \
-time string \(yyyy jd hh mm ss.ssssss\) where jd is the day of the year)
-2.5 E F1(j)144 225.6 Q F0 .666(for a time string \(yyyy jd dm ss.ssssss\
-\) where jd is the day of the year and dm is the minute of)3.166 F
-(the day)144 237.6 Q F1(L)144 254.4 Q F0(for trace length \(seconds\))
-2.5 E F1(M)144 271.2 Q F0
-(for unix \(epoch\) time in decimal seconds since 1/1/70 00:00:00)2.5 E
-F1(m)144 288 Q F0(for time in decimal seconds since \214rst record)2.5 E
-F1(N)144 304.8 Q F0(for number of samples in the trace)2.5 E F1(n)144
-321.6 Q F0(for trace counter \(starts from 0\))2.5 E F1(R)144 338.4 Q F0
-(for range from source to recei)5 E -.15(ve)-.25 G 2.5(r\().15 G(m\))
--2.5 E F1(S)144 355.2 Q F0(for shot number)5 E F1(s)144 372 Q F0
-(for trace number within a shot g)5 E(ather)-.05 E F1(T)144 388.8 Q F0
-(for a time string \(yyyy/mm/dd/hh/mm/ss\))5 E F1(t)144 405.6 Q F0
-(for a time string \(yyyy mm dd hh mm ss\))5 E F1(U)144 422.4 Q F0
-(for unix time in inte)5 E(ger seconds since 1/1/70 00:00:00)-.15 E F1
-(u)144 439.2 Q F0(for time in inte)5 E(ger seconds since \214rst record)
--.15 E F1(V)144 456 Q F0(for shot or ping interv)5 E
-(al \(decimal seconds\))-.25 E F1(X)144 472.8 Q F0
-(for longitude \(decimal de)5 E(grees\))-.15 E F1(x)144 489.6 Q F0
-(for longitude \(de)5 E(grees + decimal minutes + E/W\))-.15 E F1(Y)144
-506.4 Q F0(for latitude \(decimal de)5 E(grees\))-.15 E F1(y)144 523.2 Q
-F0(for latitude \(de)5 E(grees + decimal minutes + N/S\))-.15 E F1(Z)144
-540 Q F0(for source or sonar depth \(positi)5 E .3 -.15(ve d)-.25 H -.25
-(ow).15 G(nw).25 E(ards\) \(m\))-.1 E F1(z)144 556.8 Q F0
-(for depth \(positi)5 E .3 -.15(ve d)-.25 H -.25(ow).15 G(nw).25 E
-(ards\) \(m\))-.1 E(Def)144 580.8 Q(ault)-.1 E/F2 10/Times-Italic at 0 SF
-(output_format)3.766 E F0(=)3.766 E F1 -.18(Ti)3.766 G(XYSsCcDINL).18 E
-F0 1.266(\(time, time interv)3.766 F 1.266
-(al, lon, lat, shot, shot trace #, cmp,)-.25 F(cmp trace #, delay)144
-592.8 Q 2.5(,s)-.65 G(ample length, number samples, trace length\))-2.5
-E F1<ad56>108 609.6 Q F0(Normally)23.08 E(,)-.65 E F1(mbsegylist)2.778 E
-F0 -.1(wo)2.778 G .278(rks "silently" without outputting an).1 F .278
-(ything to the stderr stream.)-.15 F .277(If the)5.277 F F1<ad56>2.777 E
-F0 .726(\215ag is gi)144 621.6 R -.15(ve)-.25 G .726(n, then).15 F F1
-(mbsegylist)3.226 E F0 -.1(wo)3.226 G .727(rks in a "v).1 F .727
-(erbose" mode and outputs the program v)-.15 F .727(ersion being)-.15 F
-(used and all error status messages.)144 633.6 Q F1<ad5a>108 650.4 Q F2
-(se)23.63 E(gment)-.4 E F0 .975(Causes the ascii output of dif)144 662.4
-R .975(ferent input se)-.25 F .975
-(gy \214les \(e.g. when a datalist is speci\214ed with the)-.15 F F1
-<ad49>3.474 E F0 .372(option\) to be separated by lines with)144 674.4 R
-F2(se)2.873 E(gment)-.4 E F0 2.873(.I)C(f)-2.873 E F2(se)2.873 E(gment)
--.4 E F0 .373(is a single character)2.873 F 2.873(,t)-.4 G .373
-(hen the output is a)-2.873 F 1.252(multiple se)144 686.4 R 1.252
-(gment \214le of the sort accepted by the)-.15 F F1(GMT)3.751 E F0
-(program)3.751 E F1(psxy)3.751 E F0 6.251(.T)C 1.251(his option only w)
--6.251 F(orks)-.1 E .1(with ascii output, and is thus disabled when the)
-144 698.4 R F1<ad41>2.6 E F0 .1
-(option is speci\214ed. The most common usage is)2.6 F F1<ad5a>144 710.4
-Q F0(I>)A F1(.)A F0(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)
--2.5 E(2)204.835 E 0 Cg EP
-%%Page: 3 3
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mbse)72 48 Q 144.98(gylist\(1\) MB-System)-.15 F
-144.98(5.0 mbse)2.5 F(gylist\(1\))-.15 E/F1 10.95/Times-Bold at 0 SF
-(EXAMPLES)72 84 Q F0(Suppose one has a subbottom pro\214ler se)108 96 Q
-(gy data \214le called 20040722_152111.s7k.se)-.15 E(gy)-.15 E(.)-.65 E
-.063(In order to obtain a listing of the shot number)108 120 R 2.563(,t)
--.4 G .063(ime tag, and position of the traces in the \214le, use)-2.563
-F/F2 10/Times-Bold at 0 SF(mbsegylist)2.562 E F0(as follo)108 132 Q(ws:)
--.25 E(mbse)144 144 Q(gylist \255I 20040722_152111.s7k.se)-.15 E
-(gy \255OSTXY)-.15 E(The output will be as follo)108 168 Q(ws:)-.25 E
-2.5(56 2004/07/22/15/20/37.029000)118 192 R 15(\255121.857289 36.775508)
-15 F 2.5(57 2004/07/22/15/20/37.590000)118 204 R 15
-(\255121.857289 36.775514)15 F 2.5(58 2004/07/22/15/20/38.152000)118 216
-R 15(\255121.857289 36.775519)15 F 2.5(59 2004/07/22/15/20/38.713000)118
-228 R 15(\255121.857289 36.775525)15 F 2.5
-(60 2004/07/22/15/20/39.275000)118 240 R 15(\255121.857289 36.775531)15
-F 2.5(61 2004/07/22/15/20/39.837000)118 252 R 15
-(\255121.857289 36.775536)15 F 2.5(62 2004/07/22/15/20/40.398000)118 264
-R 15(\255121.857289 36.775542)15 F 2.5(63 2004/07/22/15/20/40.960000)118
-276 R 15(\255121.857289 36.775547)15 F 2.5
-(64 2004/07/22/15/20/41.521000)118 288 R 15(\255121.857289 36.775553)15
-F(.....)144 300 Q F1(SEE ALSO)72 328.8 Q F2(mbsystem)108 340.8 Q F0
-(\(1\),)A F2(mbextractsegy)2.5 E F0(\(1\),)A F2(mbsegyinf)2.5 E(o)-.25 E
-F0(\(1\),)A F2(mbsegygrid)2.5 E F0(\(1\),)A F2(SIOSEIS)2.5 E F0
-(\(http://sioseis.ucsd.edu/ \))A F1 -.11(BU)72 369.6 S(GS).11 E F0
-(Si. Oui. Y)108 381.6 Q(a. Da. Y)-1 E(es. Mess.)-1 E(MB-System 5.0)72
-768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(3)204.835 E 0 Cg EP
-%%Trailer
-end
-%%EOF
diff --git a/src/ps/mbsegypsd.ps b/src/ps/mbsegypsd.ps
deleted file mode 100644
index f7f0881..0000000
--- a/src/ps/mbsegypsd.ps
+++ /dev/null
@@ -1,491 +0,0 @@
-%!PS-Adobe-3.0
-%%Creator: groff version 1.19.2
-%%CreationDate: Wed Jul  1 12:29:30 2015
-%%DocumentNeededResources: font Times-Roman
-%%+ font Times-Bold
-%%+ font Times-Italic
-%%DocumentSuppliedResources: procset grops 1.19 2
-%%Pages: 4
-%%PageOrder: Ascend
-%%DocumentMedia: Default 612 792 0 () ()
-%%Orientation: Portrait
-%%EndComments
-%%BeginDefaults
-%%PageMedia: Default
-%%EndDefaults
-%%BeginProlog
-%%BeginResource: procset grops 1.19 2
-%!PS-Adobe-3.0 Resource-ProcSet
-/setpacking where{
-pop
-currentpacking
-true setpacking
-}if
-/grops 120 dict dup begin
-/SC 32 def
-/A/show load def
-/B{0 SC 3 -1 roll widthshow}bind def
-/C{0 exch ashow}bind def
-/D{0 exch 0 SC 5 2 roll awidthshow}bind def
-/E{0 rmoveto show}bind def
-/F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def
-/G{0 rmoveto 0 exch ashow}bind def
-/H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/I{0 exch rmoveto show}bind def
-/J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def
-/K{0 exch rmoveto 0 exch ashow}bind def
-/L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/M{rmoveto show}bind def
-/N{rmoveto 0 SC 3 -1 roll widthshow}bind def
-/O{rmoveto 0 exch ashow}bind def
-/P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/Q{moveto show}bind def
-/R{moveto 0 SC 3 -1 roll widthshow}bind def
-/S{moveto 0 exch ashow}bind def
-/T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/SF{
-findfont exch
-[exch dup 0 exch 0 exch neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/MF{
-findfont
-[5 2 roll
-0 3 1 roll
-neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/level0 0 def
-/RES 0 def
-/PL 0 def
-/LS 0 def
-/MANUAL{
-statusdict begin/manualfeed true store end
-}bind def
-/PLG{
-gsave newpath clippath pathbbox grestore
-exch pop add exch pop
-}bind def
-/BP{
-/level0 save def
-1 setlinecap
-1 setlinejoin
-72 RES div dup scale
-LS{
-90 rotate
-}{
-0 PL translate
-}ifelse
-1 -1 scale
-}bind def
-/EP{
-level0 restore
-showpage
-}def
-/DA{
-newpath arcn stroke
-}bind def
-/SN{
-transform
-.25 sub exch .25 sub exch
-round .25 add exch round .25 add exch
-itransform
-}bind def
-/DL{
-SN
-moveto
-SN
-lineto stroke
-}bind def
-/DC{
-newpath 0 360 arc closepath
-}bind def
-/TM matrix def
-/DE{
-TM currentmatrix pop
-translate scale newpath 0 0 .5 0 360 arc closepath
-TM setmatrix
-}bind def
-/RC/rcurveto load def
-/RL/rlineto load def
-/ST/stroke load def
-/MT/moveto load def
-/CL/closepath load def
-/Fr{
-setrgbcolor fill
-}bind def
-/setcmykcolor where{
-pop
-/Fk{
-setcmykcolor fill
-}bind def
-}if
-/Fg{
-setgray fill
-}bind def
-/FL/fill load def
-/LW/setlinewidth load def
-/Cr/setrgbcolor load def
-/setcmykcolor where{
-pop
-/Ck/setcmykcolor load def
-}if
-/Cg/setgray load def
-/RE{
-findfont
-dup maxlength 1 index/FontName known not{1 add}if dict begin
-{
-1 index/FID ne{def}{pop pop}ifelse
-}forall
-/Encoding exch def
-dup/FontName exch def
-currentdict end definefont pop
-}bind def
-/DEFS 0 def
-/EBEGIN{
-moveto
-DEFS begin
-}bind def
-/EEND/end load def
-/CNT 0 def
-/level1 0 def
-/PBEGIN{
-/level1 save def
-translate
-div 3 1 roll div exch scale
-neg exch neg exch translate
-0 setgray
-0 setlinecap
-1 setlinewidth
-0 setlinejoin
-10 setmiterlimit
-[]0 setdash
-/setstrokeadjust where{
-pop
-false setstrokeadjust
-}if
-/setoverprint where{
-pop
-false setoverprint
-}if
-newpath
-/CNT countdictstack def
-userdict begin
-/showpage{}def
-/setpagedevice{}def
-}bind def
-/PEND{
-countdictstack CNT sub{end}repeat
-level1 restore
-}bind def
-end def
-/setpacking where{
-pop
-setpacking
-}if
-%%EndResource
-%%EndProlog
-%%BeginSetup
-%%BeginFeature: *PageSize Default
-<< /PageSize [ 612 792 ] /ImagingBBox null >> setpagedevice
-%%EndFeature
-%%IncludeResource: font Times-Roman
-%%IncludeResource: font Times-Bold
-%%IncludeResource: font Times-Italic
-grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72
-def/PL 792 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron/Zcaron
-/scaron/zcaron/Ydieresis/trademark/quotesingle/Euro/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/space/exclam/quotedbl/numbersign/dollar/percent
-/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen
-/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon
-/semicolon/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O
-/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright/circumflex
-/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y
-/z/braceleft/bar/braceright/tilde/.notdef/quotesinglbase/guillemotleft
-/guillemotright/bullet/florin/fraction/perthousand/dagger/daggerdbl
-/endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut
-/dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash
-/quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen
-/brokenbar/section/dieresis/copyright/ordfeminine/guilsinglleft
-/logicalnot/minus/registered/macron/degree/plusminus/twosuperior
-/threesuperior/acute/mu/paragraph/periodcentered/cedilla/onesuperior
-/ordmasculine/guilsinglright/onequarter/onehalf/threequarters
-/questiondown/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE
-/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex
-/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis
-/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn
-/germandbls/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla
-/egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis
-/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide/oslash
-/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis]def
-/Times-Italic at 0 ENC0/Times-Italic RE/Times-Bold at 0 ENC0/Times-Bold RE
-/Times-Roman at 0 ENC0/Times-Roman RE
-%%EndSetup
-%%Page: 1 1
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mbse)72 48 Q 143.32(gypsd\(1\) MB-System)-.15 F
-143.32(5.0 mbse)2.5 F(gypsd\(1\))-.15 E/F1 10.95/Times-Bold at 0 SF -.219
-(NA)72 84 S(ME).219 E/F2 10/Times-Bold at 0 SF(mbsegypsd)108 96 Q F0 2.839
-<ad43>2.839 G .339(alculates the po)-2.839 F .339
-(wer spectral densisty function \(PSD\) of each trace in a se)-.25 F
-.338(gy \214le, outputting)-.15 F(the PSD estimates as a GMT grid \214l\
-e with trace number along the x axis and frequenc)108 108 Q 2.5(ya)-.15
-G(long the y axis.)-2.5 E F1(VERSION)72 136.8 Q F0 -1.11(Ve)108 148.8 S
-(rsion 5.0)1.11 E F1(SYNOPSIS)72 177.6 Q F2 9.793(mbsegypsd \255I)108
-189.6 R/F3 10/Times-Italic at 0 SF(\214le)A F2<ad4f>12.293 E F3 -.45(ro)C
-9.793(ot [).45 F F2<ad41>A F3(shotscale)A F2<ad44>12.293 E F3(decimate)A
-(x)-.2 E F2 9.794<ad5220ad53>12.294 F F3(mode[/start/end[/sc)A(han/ec)
--.15 E(han]])-.15 E F2<ad54>108 201.6 Q F3(sweep[/delay])A F2<ad57>2.5 E
-F3(mode/start/end)A F2(\255H \255V]";)2.5 E F1(DESCRIPTION)72 230.4 Q F2
-(mbsegypsd)108 242.4 Q F0 .067(calculates the po)2.567 F .067
-(wer spectral densisty function \(PSD\) of each trace in a se)-.25 F
-.066(gy \214le, outputting the)-.15 F .082(PSD estimates as a grid with\
- trace number along the x axis and frequenc)108 254.4 R 2.583(ya)-.15 G
-.083(long the y axis.)-2.583 F .083(The output \214les)5.083 F(are)108
-266.4 Q F2(GMT)2.5 E F0(netCDF format grid \214les.)2.5 E .153(The x-di\
-mension of the grid is determined by the number of traces speci\214ed b\
-y the)108 290.4 R F2<ad53>2.652 E F0 .152(option and an)2.652 F 2.652
-(yd)-.15 G(eci-)-2.652 E .195(mation speci\214ed with option)108 302.4 R
-F2<ad44>2.695 E F0 5.195(.I)C 2.695(ft)-5.195 G(he)-2.695 E F2<ad53>
-2.695 E F0 .195
-(option is not speci\214ed, then all of the traces in the se)2.695 F
-.196(gy \214le will)-.15 F .105
-(be processed. If the time sweep and delay \(if an)108 314.4 R .104
-(y\) are not speci\214ed using the)-.15 F F2<ad54>2.604 E F0 .104
-(option, then the sweep and)2.604 F(delay will be set so that all trace\
- samples are incorporated into the grid.)108 326.4 Q 1.158
-(The y-dimension of the grid is determined by the sample interv)108
-350.4 R 1.159(al in the time series data. The frequenc)-.25 F(y)-.15 E
-1.171(range runs from zero Hz to a maximum frequenc)108 362.4 R 3.671
-(yg)-.15 G -2.15 -.25(iv e)-3.671 H 3.671(ni).25 G 3.67(nH)-3.671 G 3.67
-(zb)-3.67 G 3.67(y1)-3.67 G(/\(2*sampleinterv)-3.67 E 1.17
-(al\), where the sam-)-.25 F(pleinterv)108 374.4 Q .12
-(al is in seconds. So, for instance, h)-.25 F .12
-(ydrophone data sampled at 26 kHz \(26000 samples/second\) will)-.05 F
-(ha)108 386.4 Q .614 -.15(ve a s)-.2 H .314(ample interv).15 F .314(al \
-of \(1/26000 = 0.00003846 seconds\). In this case, the PSD will be calc\
-ulated for fre-)-.25 F
-(quencies ranging from 0 Hz to 13000 Hz \(13 kHz\).)108 398.4 Q -.15(Fo)
-108 422.4 S 3.014(re).15 G .514
-(ach trace, the PSD will be calculated by ensemble a)-3.014 F -.15(ve)
--.2 G .515(raging, which means that the trace will be bro-).15 F -.1(ke)
-108 434.4 S 3.901(nu).1 G 3.901(pi)-3.901 G 1.401(nto a number of se)
--3.901 F 1.401(gments of length)-.15 F F3(nf)3.901 E(ft)-.18 E F0 1.4
-(\(speci\214ed with the)3.901 F F2<ad4e>3.9 E F0 1.4(option, def)3.9 F
-1.4(ault = 1024\), a f)-.1 F(ast-)-.1 E -.15(Fo)108 446.4 S(urier).15 E
-.687(-transform \(FFT\) will be calculated for each se)-.2 F .687
-(gment, and the PSD estimate will be the a)-.15 F -.15(ve)-.2 G .687
-(rage of).15 F .401(the FFT magnitudes o)108 458.4 R -.15(ve)-.15 G
-2.901(ra).15 G .401(ll se)-2.901 F .401
-(gments. Before the FFT is calculated, each se)-.15 F .4
-(gment is multiplied by a Han-)-.15 F 1.349(ning \(cosine\) taper; the \
-PSD estimates are normalized to account for the loss of signal due to t\
-he taper)108 470.4 R(application.)108 482.4 Q .423(The output grid can \
-be either in linear units \(Intensity/Hz\) or in log-scaled dB/Hz calcu\
-lated as 20 * log10)108 506.4 R(\(ra)108 518.4 Q(w-PSD-v)-.15 E
-(alue\). The def)-.25 E(ault is the former)-.1 E 2.5(,a)-.4 G(nd the)
--2.5 E F2<ad4c>2.5 E F0(option causes output in the dB/Hz form.)2.5 E
-2.5(As)108 542.4 S(hellscript in)-2.5 E -.2(vo)-.4 G(king).2 E F2(GMT)
-2.5 E F0(programs to plot the PSD grid is automatically generated.)2.5 E
-F1 -.548(AU)72 571.2 S(THORSHIP).548 E F0(Da)108 583.2 Q(vid W)-.2 E 2.5
-(.C)-.92 G(aress \(caress at mbari.or)-2.5 E(g\))-.18 E(Montere)113 595.2 Q
-2.5(yB)-.15 G(ay Aquarium Research Institute)-2.5 E
-(Dale N. Chayes \(dale at ldeo.columbia.edu\))108 607.2 Q
-(Lamont-Doherty Earth Observ)113 619.2 Q(atory)-.25 E F1(OPTIONS)72 648
-Q F2<ad41>108 660 Q F3(shotscale)23.08 E F0 .031(This option causes the\
- x-axis to be rescaled from shot number to distance in meters.)144 672 R
-(The)5.032 E F3(shotscale)2.532 E F0 -.25(va)144 684 S
-(lue represents the shot spacing in meters.).25 E F2<ad44>108 700.8 Q F3
-(decimate)23.08 E(x)-.2 E F0(Sets the decimation of traces \()144 712.8
-Q F3(decimate)A(x)-.2 E F0 2.5(\)u)C(sed in generating the output grid.)
--2.5 E(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(1)204.835
-E 0 Cg EP
-%%Page: 2 2
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mbse)72 48 Q 143.32(gypsd\(1\) MB-System)-.15 F
-143.32(5.0 mbse)2.5 F(gypsd\(1\))-.15 E/F1 10/Times-Bold at 0 SF<ad48>108
-84 Q F0 .162(This "help" \215ag cause the program to print out a descri\
-ption of its operation and then e)22.52 F .161(xit immedi-)-.15 F(ately)
-144 96 Q(.)-.65 E F1<ad49>108 112.8 Q/F2 10/Times-Italic at 0 SF(se)26.41 E
-(gy\214le)-.4 E F0(Sets the \214lename of the input se)144 124.8 Q
-(gy seismic data \214le to be gridded.)-.15 E F1<ad4c>108 141.6 Q F0
-(Sets the PSD grid output to be in dB/Hz.)144 153.6 Q F1<ad4f>108 170.4
-Q F2 -.45(ro)22.52 G(ot).45 E F0
-(Sets the \214lename root for the output GMT netCDF format grid.)144
-182.4 Q F1<ad53>108 199.2 Q F2(mode[/start/end[/sc)24.74 E(han/ec)-.15 E
-(han]])-.15 E F0 .847(This option sets the range of traces that are gri\
-dded, and thus determines the x-dimension of the)144 211.2 R .531
-(output grid \(also impacted by an)144 223.2 R 3.031(yd)-.15 G .531
-(ecimation speci\214ed with)-3.031 F F1<ad44>3.031 E F0 .531(\). If)B F2
-(mode)3.03 E F0 3.03(=0)3.03 G 3.03(,t)-3.03 G(hen)-3.03 E F2(start)3.03
-E F0(and)3.03 E F2(end)3.03 E F0 1.057(refer to shot numbers. This typi\
-cally is useful for subbottom data or seismic data in shot g)144 235.2 R
-(ather)-.05 E .117(form. If)144 247.2 R F2(mode)2.617 E F0 2.617(=1)
-2.617 G 2.617(,t)-2.617 G(hen)-2.617 E F2(start)2.617 E F0(and)2.617 E
-F2(end)2.617 E F0 .117
-(refer to CMP \(or RP or CDP\) numbers. This typically is use-)2.617 F
-.058(ful for seismic re\215ection data in stack)144 259.2 R .059
-(ed or CMP g)-.1 F .059
-(ather forms. If the data are multichannel seismic)-.05 F 1.198
-(re\215ection or seismic refraction in either shot or CMP g)144 271.2 R
-1.198(athers, the start and end of the channels)-.05 F .806
-(selected for gridding is set using the optional)144 283.2 R F2(sc)3.306
-E(han)-.15 E F0(and)3.307 E F2(ec)3.307 E(han)-.15 E F0 3.307(,r)C
-(especti)-3.307 E -.15(ve)-.25 G(ly).15 E 3.307(.T)-.65 G .807
-(he x-dimension of)-3.307 F(the output grid is determined by \()144
-295.2 Q F2(end)A F0<ad>2.5 E F2(start)2.5 E F0 2.5(+1)2.5 G 2.5(\)*\()
--2.5 G F2(ec)-2.5 E(han)-.15 E F0<ad>2.5 E F2(sc)2.5 E(han)-.15 E F0 2.5
-(+1)2.5 G 2.5(\)/)-2.5 G F2(decimate)A(x)-.2 E F0(.)A F1<ad54>108 312 Q
-F2(sweep[/delay])23.63 E F0(The)144 324 Q F2(sweep)3.937 E F0 -.25(va)
-3.937 G 1.436
-(lue sets the time range of seismic data to be processed in seconds.).25
-F 1.436(The optional)6.436 F F2(delay)144 336 Q F0 -.25(va)2.5 G
-(lue sets the sweep start time, ag).25 E(ain in seconds.)-.05 E F1<ad56>
-108 352.8 Q F0(Normally)23.08 E(,)-.65 E F1(mbsegypsd)3.802 E F0 1.302
-(prints out information re)3.802 F -.05(ga)-.15 G 1.302
-(rding its controlling parameters during e).05 F -.15(xe)-.15 G(cu-).15
-E(tion; the)144 364.8 Q F1<ad56>2.5 E F0(option causes the program to a\
-lso print out statements indicating its progress.)2.5 E F1<ad57>108
-381.6 Q F2(mode/start/end)20.3 E F0 .826(This option can be used to lim\
-it the data being processed to a particular time windo)144 393.6 R 3.325
-(wi)-.25 G 3.325(nv)-3.325 G(arious)-3.575 E -.1(wa)144 405.6 S .9
-(ys. This option does not impact the de\214nition of the o).1 F -.15(ve)
--.15 G .9(rall grid bounds, b).15 F .9(ut does restrict the)-.2 F .793
-(data processed to samples within particular times of interest. If)144
-417.6 R F2(mode)3.293 E F0 3.293(=1)3.293 G 3.293(,t)-3.293 G(hen)-3.293
-E F2(start)3.293 E F0(and)3.293 E F2(end)3.293 E F0(are)3.292 E .429
-(simply start and end times of good data in seconds. If)144 429.6 R F2
-(mode)2.93 E F0 2.93(=2)2.93 G 2.93(,t)-2.93 G(hen)-2.93 E F2(start)2.93
-E F0(and)2.93 E F2(end)2.93 E F0 .43(are relati)2.93 F .73 -.15(ve t)
--.25 H(o).15 E .379(the time of the bottom return. In this case)144
-441.6 R F2(start)2.878 E F0 .378(is often ne)2.878 F -.05(ga)-.15 G(ti)
-.05 E .678 -.15(ve s)-.25 H 2.878(ot).15 G .378(hat the grid sho)-2.878
-F .378(ws data abo)-.25 F -.15(ve)-.15 G .061(the sea\215oor)144 453.6 R
-2.561(,a)-.4 G .061(nd then do)-2.561 F .061(wn into the subsurf)-.25 F
-.062(ace. Finally)-.1 F 2.562(,i)-.65 G(f)-2.562 E F2(mode)2.562 E F0
-2.562(=3)2.562 G 2.562(,t)-2.562 G(hen)-2.562 E F2(start)2.562 E F0(and)
-2.562 E F2(end)2.562 E F0 .062(are relati)2.562 F -.15(ve)-.25 G
-(to the time corresponding to the sonar depth.)144 465.6 Q/F3 10.95
-/Times-Bold at 0 SF(EXAMPLES)72 494.4 Q F0 .05(Suppose that one has a se)
-108 506.4 R .05(gy \214le of h)-.15 F .05
-(ydrophone data sampled at a 37 microsecond interv)-.05 F .05
-(al, corresponding to)-.25 F 3.217(a2)108 518.4 S .717
-(7027 Hz sampling rate.)-3.217 F .718(Each of 1610 traces consists of 6\
-4865 samples. In order to create a sonogram)5.718 F(displaying the po)
-108 530.4 Q(wer spectral density as a function of time, e)-.25 E -.15
-(xe)-.15 G(cute mbse).15 E(gypsd as follo)-.15 E(ws:)-.25 E(mbse)144
-542.4 Q(gypsd \255I 20090922_1833_V3422_S7_CH025ms.se)-.15 E
-(gy \255N1024 \255L \255O testpsd \255V)-.15 E .645(Here the)108 554.4 R
-F1<ad4e>3.145 E F0 .644(option sets the FFT dimension used to be 1024 s\
-amples, which means that the PSD estimate)3.145 F
-(for each trace is the a)108 566.4 Q -.15(ve)-.2 G(rage of 64865 / 1024\
- = 63 calculations. The shell output of the program is:).15 E
-(Program mbse)144 578.4 Q(gypsd)-.15 E -1.11(Ve)144 590.4 S
-(rsion $Id: mbsegypsd.ps 2252 2015-07-01 19:35:37Z caress $)-.15
-E(MB-system V)144 602.4 Q(ersion 5.1.2beta12)-1.11 E(MBse)144 626.4 Q
-(gypsd P)-.15 E(arameters:)-.15 E(Input se)144 638.4 Q(gy \214le:)-.15 E
-(20090922_1833_V3422_S7_CH025ms.se)22.5 E(gy)-.15 E(Output \214leroot:)
-144 650.4 Q(testpsd)22.5 E(Input P)144 662.4 Q(arameters:)-.15 E
-(trace mode:)156.5 674.4 Q(0)22.5 E(trace start:)156.5 686.4 Q(0)20 E
-(trace end:)156.5 698.4 Q(1609)25 E(channel start:)156.5 710.4 Q(1)15 E
-(channel end:)156.5 722.4 Q(1)20 E(MB-System 5.0)72 768 Q 2.5(3J)146.495
-G(une 2013)-2.5 E(2)204.835 E 0 Cg EP
-%%Page: 3 3
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mbse)72 48 Q 143.32(gypsd\(1\) MB-System)-.15 F
-143.32(5.0 mbse)2.5 F(gypsd\(1\))-.15 E(trace decimation:)156.5 84 Q(1)
-7.5 E(time sweep:)156.5 96 Q(2.399968 seconds)22.5 E(time delay:)156.5
-108 Q(0.000000 seconds)22.5 E(sample interv)156.5 120 Q 7.5
-(al: 0.000037)-.25 F(seconds)2.5 E(windo)156.5 132 Q 2.5(wm)-.25 G 17.5
-(ode: 0)-2.5 F(windo)156.5 144 Q 2.5(ws)-.25 G 15(tart: 0.000000)-2.5 F
-(seconds)2.5 E(windo)156.5 156 Q 2.5(we)-.25 G 20(nd: 0.000000)-2.5 F
-(seconds)2.5 E(Output P)144 168 Q(arameters:)-.15 E(grid \214lename:)
-156.5 180 Q(testpsd.grd)15 E(psd \214lename:)156.5 192 Q
-(testpsd_psd.txt)17.5 E 2.5(xg)156.5 204 S(rid dimension:)-2.5 E(1610)
-7.5 E 2.5(yg)156.5 216 S(rid dimension:)-2.5 E(513)7.5 E(grid xmin:)
-156.5 228 Q(\2550.500000)25 E(grid xmax:)156.5 240 Q(1609.500000)25 E
-(grid ymin:)156.5 252 Q(\25513.171066)25 E(grid ymax:)156.5 264 Q
-(13500.342448)25 E(NaN v)156.5 276 Q(alues used to \215ag re)-.25 E
-(gions with no data)-.15 E 22.5(shotscale: 1.000000)156.5 288 R
-(frequenc)156.5 300 Q 10(yscale: 1.000000)-.15 F(PR)144 324 Q 1.35(OCES\
-S read:0 position:0 shot:0 channel:1 2009/265 18:32:59.000 samples:6486\
-4 interv)-.4 F(al:37)-.25 E
-(usec minmax: \255102498.789062 \255187.008667)108 336 Q(PR)144 348 Q
-2.178(OCESS read:25 position:25 shot:25 channel:1 2009/265 18:34:14.000\
- samples:64864 inter)-.4 F(-)-.2 E -.25(va)108 360 S
-(l:37 usec minmax: \255201902.890625 9166.462891).25 E(PR)144 372 Q
-2.177(OCESS read:50 position:50 shot:50 channel:1 2009/265 18:35:29.000\
- samples:64864 inter)-.4 F(-)-.2 E -.25(va)108 384 S
-(l:37 usec minmax: \255203695.765625 28316.906250).25 E(PR)144 396 Q
-2.178(OCESS read:75 position:75 shot:75 channel:1 2009/265 18:36:44.000\
- samples:64864 inter)-.4 F(-)-.2 E -.25(va)108 408 S
-(l:37 usec minmax: \255201434.375000 24819.115234).25 E(PR)144 420 Q
-.302(OCESS read:100 position:100 shot:100 channel:1 2009/265 18:37:59.0\
-00 samples:64864 inter)-.4 F(-)-.2 E -.25(va)108 432 S
-(l:37 usec minmax: \25516544.123047 37.462040).25 E
-(............................)144 444 Q(PR)144 456 Q 1.626(OCESS read:1\
-500 position:1500 shot:1500 channel:1 2009/265 19:47:59.000 samples:648\
-64)-.4 F(interv)108 468 Q
-(al:37 usec minmax: \2558367.179688 \255876.420044)-.25 E(PR)144 480 Q
-1.626(OCESS read:1525 position:1525 shot:1525 channel:1 2009/265 19:49:\
-14.000 samples:64864)-.4 F(interv)108 492 Q
-(al:37 usec minmax: \2559163.580078 201.037201)-.25 E(PR)144 504 Q 1.626
-(OCESS read:1550 position:1550 shot:1550 channel:1 2009/265 19:50:29.00\
-0 samples:64864)-.4 F(interv)108 516 Q
-(al:37 usec minmax: \25512128.291016 \255993.766357)-.25 E(PR)144 528 Q
-1.626(OCESS read:1575 position:1575 shot:1575 channel:1 2009/265 19:51:\
-44.000 samples:64864)-.4 F(interv)108 540 Q
-(al:37 usec minmax: \25567764.585938 2457.883789)-.25 E(PR)144 552 Q
-1.626(OCESS read:1600 position:1600 shot:1600 channel:1 2009/265 19:52:\
-59.000 samples:64864)-.4 F(interv)108 564 Q
-(al:37 usec minmax: \255190216.031250 \25514304.720703)-.25 E(.br)110.5
-576 Q .214(.br The output PSD grid \214le is named testpsd.grd. A shell\
-script named testpsd.grd.cmd is also created that,)110.5 588 R .668
-(when e)108 600 R -.15(xe)-.15 G .668
-(cuted, will generate a plot of the sonogram.).15 F/F1 10/Times-Bold at 0
-SF(MBsegypsd)3.167 E F0 .667
-(also outputs an ascii \214le containing the)3.167 F -2.25 -.2(av e)108
-612 T .08(rage PSD for the entire se).2 F .08
-(gy \214le in the form of frequenc)-.15 F 2.581(yP)-.15 G .081
-(SD pairs. In this case, the a)-2.581 F -.15(ve)-.2 G .081
-(rage PSD \214le is).15 F(named testpsd_psd.txt, and has contents lik)
-108 624 Q(e:)-.1 E(0.000000 193.762464)144 636 Q(26.342132 99.114274)144
-648 Q(52.684263 93.781880)144 660 Q(79.026395 86.775795)144 672 Q
-(105.368526 80.297280)144 684 Q(131.710658 74.908340)144 696 Q
-(158.052790 71.366137)144 708 Q(184.394921 70.319082)144 720 Q
-(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(3)204.835 E 0
-Cg EP
-%%Page: 4 4
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mbse)72 48 Q 143.32(gypsd\(1\) MB-System)-.15 F
-143.32(5.0 mbse)2.5 F(gypsd\(1\))-.15 E(210.737053 69.840534)144 84 Q
-(237.079184 70.794517)144 96 Q(263.421316 72.002905)144 108 Q
-(289.763448 71.979001)144 120 Q(316.105579 70.637717)144 132 Q
-(342.447711 69.652364)144 144 Q(..............)144 156 Q
-(13329.118592 \25513.659568)144 168 Q(13355.460724 \25513.722928)144 180
-Q(13381.802855 \25512.981740)144 192 Q(13408.144987 \25512.626286)144
-204 Q(13434.487119 \25512.533222)144 216 Q(13460.829250 \25513.659002)
-144 228 Q(13487.171382 \25524.474310)144 240 Q 2.96(As)108 252 S .46
-(hellscript named testpsd_psd.txt.cmd is created that will, when e)-2.96
-F -.15(xe)-.15 G .46(cuted, generate a plot of the a).15 F -.15(ve)-.2 G
-(rage).15 E(PSD.)108 264 Q/F1 10.95/Times-Bold at 0 SF(SEE ALSO)72 292.8 Q
-/F2 10/Times-Bold at 0 SF(mbsystem)108 304.8 Q F0(\(1\),)A F2(mbm_grdplot)
-2.5 E F0(\(1\),)A F2(mbmosaic)2.5 E F0(\(1\),)A F2(mbm_grid)2.5 E F0
-(\(1\))A F1 -.11(BU)72 333.6 S(GS).11 E F0(Probably)108 345.6 Q 2.5
-(... The)-.65 F(plots could be better)2.5 E(...)-.55 E(MB-System 5.0)72
-768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(4)204.835 E 0 Cg EP
-%%Trailer
-end
-%%EOF
diff --git a/src/ps/mbset.ps b/src/ps/mbset.ps
deleted file mode 100644
index 6aaba85..0000000
--- a/src/ps/mbset.ps
+++ /dev/null
@@ -1,1375 +0,0 @@
-%!PS-Adobe-3.0
-%%Creator: groff version 1.19.2
-%%CreationDate: Wed Jul  1 12:29:31 2015
-%%DocumentNeededResources: font Times-Roman
-%%+ font Times-Bold
-%%+ font Times-Italic
-%%DocumentSuppliedResources: procset grops 1.19 2
-%%Pages: 21
-%%PageOrder: Ascend
-%%DocumentMedia: Default 612 792 0 () ()
-%%Orientation: Portrait
-%%EndComments
-%%BeginDefaults
-%%PageMedia: Default
-%%EndDefaults
-%%BeginProlog
-%%BeginResource: procset grops 1.19 2
-%!PS-Adobe-3.0 Resource-ProcSet
-/setpacking where{
-pop
-currentpacking
-true setpacking
-}if
-/grops 120 dict dup begin
-/SC 32 def
-/A/show load def
-/B{0 SC 3 -1 roll widthshow}bind def
-/C{0 exch ashow}bind def
-/D{0 exch 0 SC 5 2 roll awidthshow}bind def
-/E{0 rmoveto show}bind def
-/F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def
-/G{0 rmoveto 0 exch ashow}bind def
-/H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/I{0 exch rmoveto show}bind def
-/J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def
-/K{0 exch rmoveto 0 exch ashow}bind def
-/L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/M{rmoveto show}bind def
-/N{rmoveto 0 SC 3 -1 roll widthshow}bind def
-/O{rmoveto 0 exch ashow}bind def
-/P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/Q{moveto show}bind def
-/R{moveto 0 SC 3 -1 roll widthshow}bind def
-/S{moveto 0 exch ashow}bind def
-/T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/SF{
-findfont exch
-[exch dup 0 exch 0 exch neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/MF{
-findfont
-[5 2 roll
-0 3 1 roll
-neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/level0 0 def
-/RES 0 def
-/PL 0 def
-/LS 0 def
-/MANUAL{
-statusdict begin/manualfeed true store end
-}bind def
-/PLG{
-gsave newpath clippath pathbbox grestore
-exch pop add exch pop
-}bind def
-/BP{
-/level0 save def
-1 setlinecap
-1 setlinejoin
-72 RES div dup scale
-LS{
-90 rotate
-}{
-0 PL translate
-}ifelse
-1 -1 scale
-}bind def
-/EP{
-level0 restore
-showpage
-}def
-/DA{
-newpath arcn stroke
-}bind def
-/SN{
-transform
-.25 sub exch .25 sub exch
-round .25 add exch round .25 add exch
-itransform
-}bind def
-/DL{
-SN
-moveto
-SN
-lineto stroke
-}bind def
-/DC{
-newpath 0 360 arc closepath
-}bind def
-/TM matrix def
-/DE{
-TM currentmatrix pop
-translate scale newpath 0 0 .5 0 360 arc closepath
-TM setmatrix
-}bind def
-/RC/rcurveto load def
-/RL/rlineto load def
-/ST/stroke load def
-/MT/moveto load def
-/CL/closepath load def
-/Fr{
-setrgbcolor fill
-}bind def
-/setcmykcolor where{
-pop
-/Fk{
-setcmykcolor fill
-}bind def
-}if
-/Fg{
-setgray fill
-}bind def
-/FL/fill load def
-/LW/setlinewidth load def
-/Cr/setrgbcolor load def
-/setcmykcolor where{
-pop
-/Ck/setcmykcolor load def
-}if
-/Cg/setgray load def
-/RE{
-findfont
-dup maxlength 1 index/FontName known not{1 add}if dict begin
-{
-1 index/FID ne{def}{pop pop}ifelse
-}forall
-/Encoding exch def
-dup/FontName exch def
-currentdict end definefont pop
-}bind def
-/DEFS 0 def
-/EBEGIN{
-moveto
-DEFS begin
-}bind def
-/EEND/end load def
-/CNT 0 def
-/level1 0 def
-/PBEGIN{
-/level1 save def
-translate
-div 3 1 roll div exch scale
-neg exch neg exch translate
-0 setgray
-0 setlinecap
-1 setlinewidth
-0 setlinejoin
-10 setmiterlimit
-[]0 setdash
-/setstrokeadjust where{
-pop
-false setstrokeadjust
-}if
-/setoverprint where{
-pop
-false setoverprint
-}if
-newpath
-/CNT countdictstack def
-userdict begin
-/showpage{}def
-/setpagedevice{}def
-}bind def
-/PEND{
-countdictstack CNT sub{end}repeat
-level1 restore
-}bind def
-end def
-/setpacking where{
-pop
-setpacking
-}if
-%%EndResource
-%%EndProlog
-%%BeginSetup
-%%BeginFeature: *PageSize Default
-<< /PageSize [ 612 792 ] /ImagingBBox null >> setpagedevice
-%%EndFeature
-%%IncludeResource: font Times-Roman
-%%IncludeResource: font Times-Bold
-%%IncludeResource: font Times-Italic
-grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72
-def/PL 792 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron/Zcaron
-/scaron/zcaron/Ydieresis/trademark/quotesingle/Euro/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/space/exclam/quotedbl/numbersign/dollar/percent
-/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen
-/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon
-/semicolon/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O
-/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright/circumflex
-/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y
-/z/braceleft/bar/braceright/tilde/.notdef/quotesinglbase/guillemotleft
-/guillemotright/bullet/florin/fraction/perthousand/dagger/daggerdbl
-/endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut
-/dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash
-/quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen
-/brokenbar/section/dieresis/copyright/ordfeminine/guilsinglleft
-/logicalnot/minus/registered/macron/degree/plusminus/twosuperior
-/threesuperior/acute/mu/paragraph/periodcentered/cedilla/onesuperior
-/ordmasculine/guilsinglright/onequarter/onehalf/threequarters
-/questiondown/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE
-/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex
-/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis
-/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn
-/germandbls/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla
-/egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis
-/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide/oslash
-/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis]def
-/Times-Italic at 0 ENC0/Times-Italic RE/Times-Bold at 0 ENC0/Times-Bold RE
-/Times-Roman at 0 ENC0/Times-Roman RE
-%%EndSetup
-%%Page: 1 1
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 164.28(mbset\(1\) MB-System)72 48 R 164.28
-(5.0 mbset\(1\))2.5 F/F1 10.95/Times-Bold at 0 SF -.219(NA)72 84 S(ME).219
-E/F2 10/Times-Bold at 0 SF(mbset)108 96 Q F0 2.5<ad53>2.5 G(ets v)-2.5 E
-(alues in)-.25 E F2(mbpr)2.5 E(ocess)-.18 E F0(parameter \214les.)2.5 E
-F1(VERSION)72 124.8 Q F0 -1.11(Ve)108 136.8 S(rsion 5.0)1.11 E F1
-(SYNOPSIS)72 165.6 Q F2(mbset \255I)108 177.6 Q/F3 10/Times-Italic at 0 SF
-(in\214le)A F2([\255E \255L \255P)2.5 E F3 -.9(PA)C(RAMETER:value).9 E
-F2<ad5620ad48>2.5 E F3(])A F1(DESCRIPTION)72 206.4 Q F2(mbset)108 218.4
-Q F0(is a utility for creating and modifying)2.5 E F2(mbpr)2.5 E(ocess)
--.18 E F0(parameter \214les.)2.5 E .269(The program)108 242.4 R F2(mbpr)
-2.769 E(ocess)-.18 E F0 .268(can perform a v)2.768 F .268(ariety of sw)
--.25 F .268(ath data processing functions in a single step \(produc-)-.1
-F(ing a single output sw)108 254.4 Q(ath data \214le\), including:)-.1 E
-2.5<ad4d>120.5 266.4 S(er)-2.5 E(ge edited na)-.18 E(vig)-.2 E
-(ation generated by)-.05 E F2(mbna)2.5 E -.1(ve)-.25 G(dit).1 E F0(.)A
-2.5<ad41>120.5 278.4 S(pply bath)-2.5 E(ymetry edit \215ags from)-.05 E
-F2(mbedit)2.5 E F0(and)125.5 290.4 Q F2(mbclean)2.5 E F0 2.5<ad52>120.5
-302.4 S(ecalculate bath)-2.5 E(ymetry from ra)-.05 E 2.5(wt)-.15 G(ra)
--2.5 E -.15(ve)-.2 G 2.5(lt).15 G(ime and)-2.5 E
-(angle data by raytracing through w)125.5 314.4 Q(ater sound speed)-.1 E
-(models from)125.5 326.4 Q F2(mb)2.5 E -.1(ve)-.15 G(locitytool).1 E F0
-(or)2.5 E F2(mbsvplist)2.5 E F0(.)A 2.5<ad41>120.5 338.4 S
-(pply changes to roll bias, pitch bias, heading)-2.5 E
-(bias, and draft v)125.5 350.4 Q(alues.)-.25 E 2.5<ad52>120.5 362.4 S
-(ecalculate sidescan from ra)-2.5 E 2.5(wb)-.15 G(ackscatter samples)
--2.5 E(\(Simrad multibeam data only\).)125.5 374.4 Q 2.5<ad41>120.5
-386.4 S(pply tides to bath)-2.5 E(ymetry)-.05 E(.)-.65 E 2.5<ad49>120.5
-398.4 S(nsert metadata.)-2.5 E .8(The actions of)108 422.4 R F2(mbpr)3.3
-E(ocess)-.18 E F0 .801(are controlled by te)3.3 F .801
-(xt parameter \214les. Each)-.15 F F2(mbpr)3.301 E(ocess)-.18 E F0 .801
-(parameter \214le contains)3.301 F .177
-(single line commands that set processing modes and parameters. The)108
-434.4 R F2<ad50>2.677 E F0 .177(option of)2.677 F F2(mbset)2.677 E F0
-.177(is used to modify)2.677 F 2.714(as)108 446.4 S(ingle)-2.714 E F2
-(mbpr)2.714 E(ocess)-.18 E F0 .215
-(parameter command. This option can be in)2.714 F -.2(vo)-.4 G -.1(ke).2
-G 2.715(da).1 G 2.715(sm)-2.715 G(an)-2.715 E 2.715(yt)-.15 G .215
-(imes as desired on the com-)-2.715 F .395(mand line, allo)108 458.4 R
-(wing)-.25 E F2(mbset)2.895 E F0 .395(to set multiple)2.895 F F2(mbpr)
-2.895 E(ocess)-.18 E F0 .395(processing parameters and modes.)2.895 F
-.394(If the sw)5.394 F .394(ath data)-.1 F .331
-(\214le speci\214ed by the)108 470.4 R F2<ad49>2.831 E F3(in\214le)A F0
-.331(option of)2.831 F F2(mbset)2.831 E F0 .331(has an e)2.831 F
-(xisting)-.15 E F2(mbpr)2.831 E(ocess)-.18 E F0 .332
-(parameter \214le, then that parameter)2.831 F .475
-(\214le will be read and the e)108 482.4 R .475(xisting parameter v)-.15
-F .475(alues will be modi\214ed. If no)-.25 F F2(mbpr)2.974 E(ocess)-.18
-E F0 .474(parameter \214le e)2.974 F(xists,)-.15 E(then)108 494.4 Q F2
-(mbset)3.23 E F0 .73(starts with def)3.23 F .73
-(ault processing parameters, modi\214es those, and then generates a ne)
--.1 F 3.23(wp)-.25 G(arameter)-3.23 E(\214le.)108 506.4 Q 1.113
-(If the input \214le speci\214ed by the)108 530.4 R F2<ad49>3.612 E F0
-1.112(option is a single sw)3.612 F 1.112(ath data \214le,)-.1 F F2
-(mbset)3.612 E F0 1.112(will act on that \214le and it')3.612 F(s)-.55 E
-.842(parameter \214le only)108 542.4 R 3.342(.I)-.65 G 3.342(ft)-3.342 G
-.842(he input \214le is a datalist, then)-3.342 F F2(mbset)3.342 E F0
-.842(will act on all sw)3.342 F .842(ath \214les e)-.1 F .842
-(xtracted from the)-.15 F .45(datalist \(and an)108 554.4 R 2.95(yr)-.15
-G(ecursi)-2.95 E -.15(ve)-.25 G .45
-(ly parsed datalist \214les\). This function allo).15 F .45
-(ws users to easily set uniform process-)-.25 F(ing parameters for lar)
-108 566.4 Q(ge numbers of data \214les. The def)-.18 E
-(ault input \214le is "datalist.mb-1".)-.1 E .418
-(The processing parameter \214le used by)108 590.4 R F2(mbpr)2.919 E
-(ocess)-.18 E F0 .419(has an ".par" suf)2.919 F .419
-(\214x. In addition to)-.25 F F2(mbset)2.919 E F0 2.919(,t)C .419
-(hese \214les are)-2.919 F(generated or modi\214ed by)108 602.4 Q F2
-(mbedit)2.5 E F0(,)A F2(mbna)2.5 E -.1(ve)-.25 G(dit).1 E F0(,)A F2(mb)
-2.5 E -.1(ve)-.15 G(locitytool).1 E F0(,)A F2(mbna)2.5 E -.1(va)-.25 G
-(djust).1 E F0 2.5(,a)C(nd)-2.5 E F2(mbclean)2.5 E F0(.)A .529
-(The processed output sw)108 626.4 R .529(ath \214les produced by)-.1 F
-F2(mbpr)3.029 E(ocess)-.18 E F0 .529(are named using a con)3.029 F -.15
-(ve)-.4 G .528(ntion based on the data).15 F .987(format id.)108 638.4 R
-F2(MB-System)5.987 E F0 .988(data formats are speci\214ed using tw)3.488
-F .988(o-digit or three-digit numbers \(see the)-.1 F F2(MBIO)3.488 E F0
-1.504(manual page\).)108 650.4 R 1.504(If an input sw)6.504 F 1.503(ath\
- data \214le is named "root.mbXX", where XX is the format id, then the)
--.1 F(def)108 662.4 Q 2.67(ault processed output \214le will be "rootp.\
-mbXX" \(e.g. mydata.mb71 \255> mydatap.mb71\).)-.1 F 2.67(The "p")7.67 F
-.949(inserted before the ".mbXX" suf)108 674.4 R .948
-(\214x indicates the output \214le has been created by)-.25 F F2(mbpr)
-3.448 E(ocess)-.18 E F0 5.948(.I)C 3.448(ft)-5.948 G .948(he input)
--3.448 F .475(\214le does not follo)108 686.4 R 2.975(wt)-.25 G .475
-(he *.mbXX naming con)-2.975 F -.15(ve)-.4 G .475
-(ntion, then the output \214lename will just consist of the input).15 F
-(name with "p.mbXX" added as a suf)108 698.4 Q
-(\214x \(e.g. mydata \255> mydatap.mb71\))-.25 E(MB-System 5.0)72 768 Q
-(10 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E(1)190.545 E 0 Cg EP
-%%Page: 2 2
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 164.28(mbset\(1\) MB-System)72 48 R 164.28
-(5.0 mbset\(1\))2.5 F/F1 10.95/Times-Bold at 0 SF(MBPR)72 84 Q(OCESS P)
--.329 E(ARAMETER FILE COMMANDS)-.81 E F0(The)108 96 Q/F2 10/Times-Bold at 0
-SF(mbpr)2.5 E(ocess)-.18 E F0(parameter \214le commands modi\214ed by)
-2.5 E F2(mbset)2.5 E F0(are:)2.5 E(GENERAL P)110.5 120 Q(ARAMETERS:)-.92
-E(EXPLICIT)115.5 132 Q(causes mbprocess to set modes implicitely)128 144
-Q 2.5<ad65>128 156 S(.g. the SVPFILE command will also set)-2.5 E
-(raytracing on e)133 168 Q -.15(ve)-.25 G 2.5(ni).15 G 2.5(ft)-2.5 G
-(he RA)-2.5 E(YTRA)-1.05 E(CE command)-.4 E(is not gi)133 180 Q -.15(ve)
--.25 G 2.5(n[).15 G -.15(ex)-2.5 G(plicit mode commands required]).15 E
-(FORMA)115.5 192 Q 2.5(Tc)-1.11 G(onstant)-2.5 E(sets format id [no def)
-128 204 Q(ault])-.1 E(INFILE \214lename)115.5 216 Q
-(sets input \214le path [no def)128 228 Q(ault])-.1 E
-(OUTFILE \214lename)115.5 240 Q(sets output \214le path [no def)128 252
-Q(ault])-.1 E -.35(NA)110.5 276 S(VIGA)-1 E(TION MERGING:)-1.11 E -.35
-(NA)115.5 288 S(VMODE boolean)-1 E(sets na)128 300 Q(vig)-.2 E
-(ation mer)-.05 E(ging [0])-.18 E(0: na)133 312 Q(vig)-.2 E(ation mer)
--.05 E(ge of)-.18 E(f)-.25 E(1: na)133 324 Q(vig)-.2 E(ation mer)-.05 E
-(ge on)-.18 E -.35(NA)115.5 336 S(VFILE \214lename)-1 E(sets na)128 348
-Q(vig)-.2 E(ation \214le path [no def)-.05 E(ault])-.1 E -.35(NA)115.5
-360 S(VFORMA)-1 E 2.5(Tc)-1.11 G(onstant)-2.5 E(sets na)128 372 Q(vig)
--.2 E(ation \214le format [9])-.05 E(see the)144 384 Q F2(mbpr)2.5 E
-(ocess)-.18 E F0(man page for)2.5 E(documentation of the supported)144
-396 Q(na)144 408 Q(vig)-.2 E(ation formats.)-.05 E -.35(NA)115.5 420 S
-(VHEADING boolean)-1 E(sets heading to be mer)128 432 Q(ged from na)-.18
-E(vig)-.2 E(ation \214le)-.05 E 2.5<ad6e>128 444 S(ote: heading mer)-2.5
-E(ged from na)-.18 E(vig)-.2 E(ation before)-.05 E
-(heading correction applied)133 456 Q(0: heading not changed)133 468 Q
-(1: heading mer)133 480 Q(ged from na)-.18 E(vig)-.2 E(ation \214le)-.05
-E -.35(NA)115.5 492 S(VSPEED boolean)-1 E(sets speed to be mer)128 504 Q
-(ged from na)-.18 E(vig)-.2 E(ation \214le)-.05 E(0: speed not changed)
-133 516 Q(1: speed mer)133 528 Q(ged from na)-.18 E(vig)-.2 E
-(ation \214le)-.05 E -.35(NA)115.5 540 S(VDRAFT boolean)-1 E
-(sets draft to be mer)128 552 Q(ged from na)-.18 E(vig)-.2 E
-(ation \214le)-.05 E 2.5<ad6e>128 564 S(ote: draft mer)-2.5 E
-(ged from na)-.18 E(vig)-.2 E(ation before)-.05 E
-(draft correction applied)133 576 Q(0: draft not changed)133 588 Q
-(1: draft mer)133 600 Q(ged from na)-.18 E(vig)-.2 E(ation \214le)-.05 E
--.35(NA)115.5 612 S -.91 -1.35(VA T)-1 H(TITUDE boolean)1.35 E
-(sets roll, pitch and hea)128 624 Q .3 -.15(ve t)-.2 H 2.5(ob).15 G 2.5
-(em)-2.5 G(er)-2.5 E(ged from)-.18 E(na)128 636 Q(vig)-.2 E
-(ation \214le)-.05 E 2.5<ad6e>128 648 S(ote: roll, pitch, and hea)-2.5 E
-.3 -.15(ve m)-.2 H(er).15 E(ged from)-.18 E(na)133 660 Q(vig)-.2 E
-(ation before roll bias and pitch bias)-.05 E(corrections applied)133
-672 Q(0: roll, pitch, and hea)133 684 Q .3 -.15(ve n)-.2 H(ot changed)
-.15 E(1: roll, pitch, and hea)133 696 Q .3 -.15(ve m)-.2 H(er).15 E
-(ged from)-.18 E(na)140.5 708 Q(vig)-.2 E(ation \214le)-.05 E -.35(NA)
-115.5 720 S(VINTERP boolean)-1 E(MB-System 5.0)72 768 Q(10 No)132.205 E
--.15(ve)-.15 G(mber 2014).15 E(2)190.545 E 0 Cg EP
-%%Page: 3 3
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 164.28(mbset\(1\) MB-System)72 48 R 164.28
-(5.0 mbset\(1\))2.5 F(sets na)128 84 Q(vig)-.2 E
-(ation interpolation algorithm [0])-.05 E
-(0: linear interpolation \(recommended\))133 96 Q
-(1: spline interpolation)133 108 Q -.35(NA)115.5 120 S
-(VTIMESHIFT constant)-1 E(sets na)128 132 Q(vig)-.2 E
-(ation time shift \(seconds\) [0.0])-.05 E 2.5<ad6e>128 144 S
-(ote: time shift added to timestamps of)-2.5 E(na)133 156 Q(vig)-.2 E
-(ation \214x)-.05 E(es read in from N)-.15 E -1.35(AV)-.35 G(FILE)1.35 E
-(prior to mer)133 168 Q(ging)-.18 E -.35(NA)110.5 192 S(VIGA)-1 E
-(TION OFFSETS AND SHIFTS:)-1.11 E -.35(NA)115.5 204 S(VSHIFT boolean)-1
-E(sets na)128 216 Q(vig)-.2 E(ation of)-.05 E(fset [0])-.25 E 2.5<ad6e>
-128 228 S(ote: of)-2.5 E(fsets and shifts are applied to na)-.25 E(vig)
--.2 E(ation)-.05 E -.25(va)133 240 S(lues from both surv).25 E .3 -.15
-(ey a)-.15 H(nd na).15 E(vig)-.2 E(ation records, and)-.05 E
-(are applied to na)133 252 Q(vig)-.2 E(ation read in from)-.05 E -.35
-(NA)133 264 S(VFILE prior to mer)-1 E(ging)-.18 E 2.5<ad6e>128 276 S
-(ote: of)-2.5 E(fsets and shifts are NO)-.25 E 2.5(Ta)-.4 G
-(pplied to adjusted)-2.5 E(na)133 288 Q(vig)-.2 E(ation v)-.05 E
-(alues from N)-.25 E -1.35(AVA)-.35 G(DJFILE)1.35 E -.35(NA)115.5 300 S
--.4(VO)-1 G(FFSETX constant).4 E(sets na)128 312 Q(vig)-.2 E(ation athw)
--.05 E(artship of)-.1 E(fset \(meters\) [0.0])-.25 E 2.5<ad6e>128 324 S
-(ote: the ef)-2.5 E(fecti)-.25 E .3 -.15(ve n)-.25 H -.2(av).15 G(ig).2
-E(ation shift is)-.05 E(\(N)133 336 Q -.2 -1.35(AV O)-.35 H
-(FFSETX \255 SON)1.35 E(AR)-.35 E(OFFSETX\), and the)-.4 E(na)133 348 Q
-(vig)-.2 E(ation is corrected by subtracting)-.05 E(this ef)133 360 Q
-(fecti)-.25 E .3 -.15(ve s)-.25 H(hift.).15 E 2.5<ad6e>128 372 S
-(ote: athw)-2.5 E(artship shift is positi)-.1 E .3 -.15(ve t)-.25 H(o)
-.15 E(starboard.)133 384 Q -.35(NA)115.5 396 S -.4(VO)-1 G
-(FFSETY constant).4 E(sets na)128 408 Q(vig)-.2 E(ation fore-aft of)-.05
-E(fset \(meters\) [0.0])-.25 E 2.5<ad6e>128 420 S(ote: the ef)-2.5 E
-(fecti)-.25 E .3 -.15(ve n)-.25 H -.2(av).15 G(ig).2 E(ation shift is)
--.05 E(\(N)133 432 Q -.2 -1.35(AV O)-.35 H(FFSETY \255 SON)1.35 E(AR)
--.35 E(OFFSETY\), and the)-.4 E(na)133 444 Q(vig)-.2 E
-(ation is corrected by subtracting)-.05 E(this ef)133 456 Q(fecti)-.25 E
-.3 -.15(ve s)-.25 H(hift.).15 E 2.5<ad6e>128 468 S
-(ote: fore-aft shift is positi)-2.5 E .3 -.15(ve f)-.25 H(orw).15 E
-(ard.)-.1 E -.35(NA)115.5 480 S -.4(VO)-1 G(FFSETZ constant).4 E
-(sets na)128 492 Q(vig)-.2 E(ation v)-.05 E(ertical of)-.15 E
-(fset \(meters\) [0.0])-.25 E 2.5<ad6e>128 504 S(ote: this v)-2.5 E
-(alue is not yet used for)-.25 E(an)133 516 Q(ything.)-.15 E 2.5<ad6e>
-128 528 S(ote: v)-2.5 E(ertical shift is positi)-.15 E .3 -.15(ve d)-.25
-H -.25(ow).15 G(n.).25 E -.35(NA)115.5 540 S(VSHIFTLON constant)-1 E
-(sets na)128 552 Q(vig)-.2 E(ation longitude shift \(de)-.05 E
-(grees\) [0.0])-.15 E -.35(NA)115.5 564 S(VSHIFTLA)-1 E 2.5(Tc)-1.11 G
-(onstant)-2.5 E(sets na)128 576 Q(vig)-.2 E(ation latitude shift \(de)
--.05 E(grees\) [0.0])-.15 E(ADJUSTED N)110.5 600 Q -1.35(AV)-.35 G(IGA)
-1.35 E(TION MERGING:)-1.11 E -.35(NA)115.5 612 S -1.35(VA)-1 G
-(DJMODE mode)1.35 E(sets na)128 624 Q(vig)-.2 E(ation mer)-.05 E
-(ging from mbna)-.18 E -.25(va)-.2 G(djust [0]).25 E 2.5<ad63>128 636 S
-(an apply to longitude and latitude only)-2.5 E
-(or longitude, latitude, and depth of)133 648 Q(fset)-.25 E
-(0: adjusted na)133 660 Q(vig)-.2 E(ation mer)-.05 E(ge of)-.18 E(f)-.25
-E(1: adjusted na)133 672 Q(vig)-.2 E(ation mer)-.05 E(ge on)-.18 E
-(2: adjusted na)133 684 Q(vig)-.2 E(ation and depth of)-.05 E(fset mer)
--.25 E(ge on)-.18 E -.35(NA)115.5 696 S -1.35(VA)-1 G(DJFILE \214lename)
-1.35 E(sets adjusted na)128 708 Q(vig)-.2 E(ation \214le path)-.05 E 2.5
-<ad74>128 720 S(his \214le supercedes na)-2.5 E(vig)-.2 E
-(ation \214le for)-.05 E(MB-System 5.0)72 768 Q(10 No)132.205 E -.15(ve)
--.15 G(mber 2014).15 E(3)190.545 E 0 Cg EP
-%%Page: 4 4
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 164.28(mbset\(1\) MB-System)72 48 R 164.28
-(5.0 mbset\(1\))2.5 F(lon and lat only)133 84 Q 2.5<ad75>128 96 S
-(ses mbna)-2.5 E -.25(va)-.2 G(djust output).25 E -.35(NA)115.5 108 S
--1.35(VA)-1 G(DJINTERP boolean)1.35 E(sets adjusted na)128 120 Q(vig)-.2
-E(ation interpolation algorithm [0])-.05 E
-(0: linear interpolation \(recommended\))133 132 Q
-(1: spline interpolation)133 144 Q -1.11(AT)113 168 S(TITUDE MERGING:)
-1.11 E -1.11(AT)118 180 S(TITUDEMODE mode)1.11 E
-(sets attitude \(roll, pitch, and hea)128 192 Q -.15(ve)-.2 G 2.5(\)m)
-.15 G(er)-2.5 E(ging [0])-.18 E 2.5<ad72>128 204 S(oll, pitch, and hea)
--2.5 E .3 -.15(ve m)-.2 H(er).15 E(ged before)-.18 E
-(roll bias and pitch bias corrections applied)133 216 Q 2.5<ad61>128 228
-S(ttitude mer)-2.5 E(ging from a separate \214le supersedes)-.18 E
-(attitude mer)133 240 Q(ging from a na)-.18 E(vig)-.2 E(ation \214le)
--.05 E(0: attitude mer)133 252 Q(ging of)-.18 E(f)-.25 E
-(1: attitude mer)133 264 Q(ging on)-.18 E -1.11(AT)118 276 S
-(TITUDEFILE \214lename)1.11 E(sets attitude \214le path)128 288 Q -1.11
-(AT)118 300 S(TITUDEFORMA)1.11 E 2.5(Tc)-1.11 G(onstant)-2.5 E
-(sets attitude \214le format [1])128 312 Q 2.5<ad61>128 324 S
-(ttitude \214les can be in one of four ASCII)-2.5 E(table formats)133
-336 Q(1: format is <time_d roll pitch hea)133 348 Q -.15(ve)-.2 G(>).15
-E(2: format is <yr mon day hour min sec roll pitch hea)133 360 Q -.15
-(ve)-.2 G(>).15 E(3: format is <yr jday hour min sec roll pitch hea)133
-372 Q -.15(ve)-.2 G(>).15 E
-(4: format is <yr jday daymin sec roll pitch hea)133 384 Q -.15(ve)-.2 G
-(>).15 E 2.5<ad74>128 396 S(ime_d = decimal seconds since 1/1/1970)-2.5
-E 2.5<ad64>128 408 S(aymin = decimal minutes start of day)-2.5 E 2.5
-<ad72>128 420 S(oll = positi)-2.5 E .3 -.15(ve s)-.25 H(tarboard up, de)
-.15 E(grees)-.15 E 2.5<ad70>128 432 S(itch = positi)-2.5 E .3 -.15(ve f)
--.25 H(orw).15 E(ard up, de)-.1 E(grees)-.15 E 2.5<ad68>128 444 S(ea)
--2.5 E .3 -.15(ve = p)-.2 H(ositi).15 E .3 -.15(ve u)-.25 H(p, meters)
-.15 E(SON)113 468 Q(ARDEPTH MERGING:)-.35 E(SON)118 480 Q
-(ARDEPTHMODE mode)-.35 E(sets sonardepth mer)128 492 Q(ging [0])-.18 E
-2.5<ad73>128 504 S(onardepth mer)-2.5 E(ged before)-.18 E
-(draft corrections applied)133 516 Q 2.5<ad73>128 528 S(onardepth mer)
--2.5 E(ging from a separate \214le supersedes)-.18 E(draft mer)133 540 Q
-(ging from a na)-.18 E(vig)-.2 E(ation \214le)-.05 E(0: sonardepth mer)
-133 552 Q(ging of)-.18 E(f)-.25 E(1: sonardepth mer)133 564 Q(ging on)
--.18 E(SON)118 576 Q(ARDEPTHFILE \214lename)-.35 E
-(sets sonardepth \214le path)128 588 Q(SON)118 600 Q(ARDEPTHFORMA)-.35 E
-2.5(Tc)-1.11 G(onstant)-2.5 E(sets sonardepth \214le format [1])128 612
-Q 2.5<ad73>128 624 S(onardepth \214les can be in one of four ASCII)-2.5
-E(table formats)133 636 Q(1: format is <time_d sonardepth>)133 648 Q
-(2: format is <yr mon day hour min sec sonardepth>)133 660 Q
-(3: format is <yr jday hour min sec sonardepth>)133 672 Q
-(4: format is <yr jday daymin sec sonardepth>)133 684 Q 2.5<ad74>128 696
-S(ime_d = decimal seconds since 1/1/1970)-2.5 E 2.5<ad64>128 708 S
-(aymin = decimal minutes start of day)-2.5 E 2.5<ad73>128 720 S
-(onardepth = sonar depth positi)-2.5 E .3 -.15(ve d)-.25 H -.25(ow).15 G
-(n, meters).25 E(MB-System 5.0)72 768 Q(10 No)132.205 E -.15(ve)-.15 G
-(mber 2014).15 E(4)190.545 E 0 Cg EP
-%%Page: 5 5
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 164.28(mbset\(1\) MB-System)72 48 R 164.28
-(5.0 mbset\(1\))2.5 F -.4(DA)110.5 84 S 1.86 -.93(TA C)-.71 H(UTTING:)
-.93 E -.4(DA)115.5 96 S -1.04 -.93(TA C)-.71 H(UTCLEAR).93 E(remo)128
-108 Q -.15(ve)-.15 G 2.5(sa).15 G(ll e)-2.5 E
-(xisting data cutting commands)-.15 E -.4(DA)115.5 120 S -1.04 -.93
-(TA C)-.71 H(UT kind mode min max).93 E(adds ne)128 132 Q 2.5(wd)-.25 G
-(ata cutting command, where:)-2.5 E(kind = 0 : cut applied to bath)133
-144 Q(ymetry data)-.05 E(kind = 1 : cut applied to amplitude data)133
-156 Q(kind = 2 : cut applied to sidescan data)133 168 Q
-(mode = 0 : min and max indicate start and end)133 180 Q(beam/pix)160.5
-192 Q(el numbers between which data)-.15 E(are \215agged or zeroed)160.5
-204 Q(mode = 1 : min and max indicate start and end)133 216 Q
-(acrosstrack distance \(m\) between which)160.5 228 Q
-(data are \215agged or zeroed)160.5 240 Q -.35(BA)115.5 252 S
-(THCUTNUMBER min max)-.76 E(adds ne)128 264 Q 2.5(wb)-.25 G(ath)-2.5 E
-(ymetry data cutting command where)-.05 E
-(min and max are the start and end beam numbers)128 276 Q
-(between which data are \215agged \(note that)128 288 Q(\215agging bath)
-128 300 Q(ymetry also \215ags amplitude data\))-.05 E -.35(BA)115.5 312
-S(THCUTDIST)-.76 E(ANCE min max)-.93 E(adds ne)128 324 Q 2.5(wb)-.25 G
-(ath)-2.5 E(ymetry data cutting command where)-.05 E
-(min and max are the start and end acrosstrack)128 336 Q
-(distance \(m\) between which data are \215agged)128 348 Q
-(\(note that \215agging bath)128 360 Q(ymetry also \215ags)-.05 E
-(amplitude data\))128 372 Q -.35(BA)115.5 384 S(THCUTSPEED min max)-.76
-E(adds ne)128 396 Q 2.5(wb)-.25 G(ath)-2.5 E
-(ymetry data cutting command where)-.05 E
-(all beams are \215agged for pings with a ship)128 408 Q(or v)128 420 Q
-(ehicle speed less than min or greater than)-.15 E
-(max \(note that \215agging bath)128 432 Q(ymetry also \215ags)-.05 E
-(amplitude data\))128 444 Q(AMPCUTNUMBER min max)115.5 456 Q(adds ne)128
-468 Q 2.5(wa)-.25 G(mplitude data cutting command where)-2.5 E
-(min and max are the start and end beam numbers)128 480 Q
-(between which amplitude data are zeroed \(note)128 492 Q
-(that zeroing amplitude data has no impact on)128 504 Q(bath)128 516 Q
-(ymetry data\))-.05 E(AMPCUTDIST)115.5 528 Q(ANCE min max)-.93 E
-(adds ne)128 540 Q 2.5(wa)-.25 G(mplitude data cutting command where)
--2.5 E(min and max are the start and end acrosstrack)128 552 Q
-(distance \(m\) between which amplitude data are)128 564 Q
-(zeroed \(note that zeroing amplitude data has)128 576 Q
-(no impact on bath)128 588 Q(ymetry data\))-.05 E(AMPCUTSPEED min max)
-115.5 600 Q(adds ne)128 612 Q 2.5(wa)-.25 G
-(mplitude data cutting command where)-2.5 E(all amplitude v)128 624 Q
-(alues are zeroed for pings with)-.25 E 2.5(as)128 636 S(hip or v)-2.5 E
-(ehicle speed less than min or greater)-.15 E
-(than max \(note that zeroing amplitude data has)128 648 Q
-(no impact on bath)128 660 Q(ymetry data\))-.05 E(SSCUTNUMBER min max)
-115.5 672 Q(adds ne)128 684 Q 2.5(ws)-.25 G
-(idescan data cutting command where)-2.5 E
-(min and max are the start and end pix)128 696 Q(el numbers)-.15 E
-(between which sidescan data are zeroed)128 708 Q(\(note)5 E
-(that zeroing sidescan data has no impact on)128 720 Q(MB-System 5.0)72
-768 Q(10 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E(5)190.545 E 0 Cg EP
-%%Page: 6 6
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 164.28(mbset\(1\) MB-System)72 48 R 164.28
-(5.0 mbset\(1\))2.5 F(bath)128 84 Q(ymetry data\))-.05 E(SSCUTDIST)115.5
-96 Q(ANCE min max)-.93 E(adds ne)128 108 Q 2.5(ws)-.25 G
-(idescan data cutting command where)-2.5 E
-(min and max are the start and end acrosstrack)128 120 Q
-(distance \(m\) between which sidescan data are)128 132 Q 2.5
-(zeroed \(note)128 144 R(that zeroing sidescan data has)2.5 E
-(no impact on bath)128 156 Q(ymetry data\))-.05 E(SSCUTSPEED min max)
-115.5 168 Q(adds ne)128 180 Q 2.5(ws)-.25 G
-(idescan data cutting command where)-2.5 E(all sidescan v)128 192 Q
-(alues are zeroed for pings with)-.25 E 2.5(as)128 204 S(hip or v)-2.5 E
-(ehicle speed less than min or greater)-.15 E
-(than max \(note that zeroing sidescan data has)128 216 Q
-(no impact on bath)128 228 Q(ymetry data\))-.05 E -.35(BA)110.5 252 S
-(THYMETR)-.76 E 2.5(YE)-.65 G(DITING:)-2.5 E(EDITSA)115.5 264 Q
-(VEMODE boolean)-1.35 E(turns on reading edit sa)128 276 Q .3 -.15
-(ve \214)-.2 H(le \(from mbedit\) [0]).15 E(EDITSA)115.5 288 Q
-(VEFILE \214lename)-1.35 E(sets edit sa)128 300 Q .3 -.15(ve \214)-.2 H
-(le path \(from mbedit\) [none]).15 E -.35(BA)110.5 324 S(THYMETR)-.76 E
-2.5(YR)-.65 G(ECALCULA)-2.5 E(TION:)-1.11 E(SVPMODE mode)115.5 336 Q
-(sets usage of a w)128 348 Q(ater sound speed model \(sound)-.1 E -.15
-(ve)128 360 S(locity pro\214le, or SVP\) [0]).15 E(0: bath)130.5 372 Q
-(ymetry recalculation by raytracing of)-.05 E(f)-.25 E(1: bath)130.5 384
-Q(ymetry recalculation by raytracing on)-.05 E
-(2: translate depths from corrected to uncorrected)130.5 396 Q
-(or vice v)138 408 Q(ersa depending on SOUNDSPEEDREF)-.15 E(command)138
-420 Q(SVPFILE \214lename)115.5 432 Q(sets SVP \214le path [no def)128
-444 Q(ault])-.1 E(SSVMODE boolean)115.5 456 Q(sets surf)128 468 Q
-(ace sound v)-.1 E(elocity \(SSV\) mode [0])-.15 E
-(0: use SSV from \214le)130.5 480 Q(1: of)130.5 492 Q
-(fset SSV from \214le \(set by SSV command\))-.25 E
-(2: use constant SSV \(set by SSV command\))130.5 504 Q(SSV constant/of)
-115.5 516 Q(fset)-.25 E(sets SSV v)128 528 Q(alue or of)-.25 E
-(fset \(m/s\) [1500.0])-.25 E(ANGLEMODE mode)115.5 540 Q
-(sets handling of beam angles during)128 552 Q(raytracing [1])128 564 Q
-(0: angles not changed before raytracing)130.5 576 Q
-(1: angles adjusted using Snell')130.5 588 Q 2.5(sL)-.55 G .3 -.15(aw f)
--2.5 H(or).15 E(the dif)138 600 Q(ference between the surf)-.25 E
-(ace sound)-.1 E -.15(ve)138 612 S
-(locity \(SSV\) and the sound speed at).15 E(the sonar depth in the SVP)
-138 624 Q(.)-1.11 E(2: angles adjusted using Snell')130.5 636 Q 2.5(sL)
--.55 G .3 -.15(aw a)-2.5 H(nd).15 E(the sonar array geometry for the)138
-648 Q(dif)138 660 Q(ference between the surf)-.25 E(ace sound)-.1 E -.15
-(ve)138 672 S(locity \(SSV\) and the sound speed at).15 E
-(the sonar depth in the SVP)138 684 Q(.)-1.11 E(TTMUL)115.5 696 Q(TIPL)
--.92 E 2.5(Ym)-1 G(ultiplier)-2.5 E(sets v)128 708 Q
-(alue multiplied by tra)-.25 E -.15(ve)-.2 G 2.5(lt).15 G(imes [1.0])
--2.5 E(SOUNDSPEEDREF boolean)115.5 720 Q(MB-System 5.0)72 768 Q(10 No)
-132.205 E -.15(ve)-.15 G(mber 2014).15 E(6)190.545 E 0 Cg EP
-%%Page: 7 7
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 164.28(mbset\(1\) MB-System)72 48 R 164.28
-(5.0 mbset\(1\))2.5 F(determines the handling of the sound)128 84 Q
-(speed reference for bath)128 96 Q(ymetry [1])-.05 E 2.5<ad6e>128 108 S
-(ote: if raytracing is turned of)-2.5 E 2.5(ft)-.25 G(hen)-2.5 E
-(this command implies correcting or)133 120 Q
-(uncorrecting using the SVP speci\214ed)133 132 Q
-(with the SVPFILE command)133 144 Q(0: produce "uncorrected" bath)130.5
-156 Q(ymetry)-.05 E(referenced to a uniform 1500 m/s)138 168 Q -.1(wa)
-138 180 S(ter sound speed model.).1 E(1: produce "corrected" bath)130.5
-192 Q(ymetry)-.05 E(referenced to a realistic w)138 204 Q(ater)-.1 E
-(sound speed model.)138 216 Q(ST)110.5 240 Q -1.11(AT)-.93 G(IC BEAM B)
-1.11 E -1.11(AT)-.35 G(HYMETR)1.11 E 2.5(YO)-.65 G(FFSETS:)-2.5 E(ST)
-115.5 252 Q -1.11(AT)-.93 G(ICMODE mode)1.11 E(sets of)128 264 Q
-(fsetting of bath)-.25 E(ymetry by)-.05 E(per)128 276 Q
-(-beam statics [0])-.2 E(0: static correction of)133 288 Q(f)-.25 E
-(1: static correction by beam number)133 300 Q
-(2: static correction by acrosstrack beam angle)133 312 Q(ST)115.5 324 Q
--1.11(AT)-.93 G(ICFILE \214lename)1.11 E(sets static per)128 336 Q
-(-beam \214le path [no def)-.2 E(ault])-.1 E 2.5<ad73>128 348 S
-(tatic \214les are tw)-2.5 E(o-column ascii tables)-.1 E 2.5<ad69>128
-360 S 2.5(fc)-2.5 G(orrection is by beam number then)-2.5 E
-(the beam # is in column 1 and)133 372 Q(the depth of)133 384 Q
-(fset is in m in column 2)-.25 E 2.5<ad69>128 396 S 2.5(fc)-2.5 G
-(orrection is by beam angle then)-2.5 E
-(the beam angle \(starboard positi)133 408 Q -.15(ve)-.25 G(\)).15 E
-(is in column 1 and)133 420 Q(the depth of)133 432 Q
-(fset is in m in column 2)-.25 E(DRAFT CORRECTION:)110.5 456 Q
-(DRAFTMODE mode)115.5 468 Q(sets draft correction [0])128 480 Q 2.5
-<ad6e>128 492 S(ote: draft mer)-2.5 E(ged from na)-.18 E(vig)-.2 E
-(ation before)-.05 E(draft correction applied)133 504 Q
-(0: no draft correction)133 516 Q(1: draft correction by of)133 528 Q
-(fset)-.25 E(2: draft correction by multiply)133 540 Q
-(3: draft correction by of)133 552 Q(fset and multiply)-.25 E
-(4: draft set to constant)133 564 Q(DRAFT constant)115.5 576 Q
-(sets draft v)128 588 Q(alue \(m\) [0.0])-.25 E(DRAFT)115.5 600 Q
-(OFFSET of)-.18 E(fset)-.25 E(sets v)128 612 Q
-(alue added to draft \(m\) [0.0])-.25 E(DRAFTMUL)115.5 624 Q(TIPL)-.92 E
-2.5(Ym)-1 G(ultiplier)-2.5 E(sets v)128 636 Q
-(alue multiplied by draft [1.0])-.25 E(HEA)110.5 660 Q(VE CORRECTION:)
--1.35 E(HEA)115.5 672 Q(VEMODE mode)-1.35 E(sets hea)128 684 Q .3 -.15
-(ve c)-.2 H(orrection [0]).15 E 2.5<ad6e>128 696 S(ote: hea)-2.5 E .3
--.15(ve c)-.2 H(orrection by of).15 E(fset and/or)-.25 E
-(multiplication is added to an)133 708 Q 2.5(yl)-.15 G -2.15 -.25(ev e)
--2.5 H(r).25 E(hea)133 720 Q .3 -.15(ve c)-.2 H
-(orrection, and then either used in).15 E(MB-System 5.0)72 768 Q(10 No)
-132.205 E -.15(ve)-.15 G(mber 2014).15 E(7)190.545 E 0 Cg EP
-%%Page: 8 8
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 164.28(mbset\(1\) MB-System)72 48 R 164.28
-(5.0 mbset\(1\))2.5 F(bath)133 84 Q(ymetry recalculation or added to)
--.05 E -.15(ex)133 96 S(isting bath).15 E(ymetry)-.05 E(0: no hea)133
-108 Q .3 -.15(ve c)-.2 H(orrection).15 E(1: hea)133 120 Q .3 -.15(ve c)
--.2 H(orrection by of).15 E(fset)-.25 E(2: hea)133 132 Q .3 -.15(ve c)
--.2 H(orrection by multiply).15 E(3: hea)133 144 Q .3 -.15(ve c)-.2 H
-(orrection by of).15 E(fset and multiply)-.25 E(HEA)115.5 156 Q
-(VEOFFSET of)-1.35 E(fset)-.25 E(sets v)128 168 Q(alue added to hea)-.25
-E .3 -.15(ve \()-.2 H(m\)).15 E(HEA)115.5 180 Q(VEMUL)-1.35 E(TIPL)-.92
-E 2.5(Ym)-1 G(ultiplier)-2.5 E(sets v)128 192 Q(alue multiplied by hea)
--.25 E -.15(ve)-.2 G(LEVER CORRECTION:)110.5 216 Q(LEVERMODE mode)115.5
-228 Q(sets hea)128 240 Q .3 -.15(ve c)-.2 H(orrection by le).15 E -.15
-(ve)-.25 G 2.5(rc).15 G(alculation [0])-2.5 E 2.5<ad6e>128 252 S
-(ote: le)-2.5 E -.15(ve)-.25 G 2.5(rh).15 G(ea)-2.5 E .3 -.15(ve c)-.2 H
-(orrection is added to).15 E(an)133 264 Q 2.5(yh)-.15 G(ea)-2.5 E .3
--.15(ve c)-.2 H(orrection by of).15 E(fset and/or)-.25 E
-(multiplication, and then either used in)133 276 Q(bath)133 288 Q
-(ymetry recalculation or added to)-.05 E -.15(ex)133 300 S(isting bath)
-.15 E(ymetry)-.05 E(0: no le)133 312 Q -.15(ve)-.25 G 2.5(rc).15 G
-(alculation)-2.5 E(1: hea)133 324 Q .3 -.15(ve c)-.2 H(orrection by le)
-.15 E -.15(ve)-.25 G 2.5(rc).15 G(alculation)-2.5 E(VR)115.5 336 Q
-(UOFFSETX constant)-.4 E(sets athw)128 348 Q(artships of)-.1 E
-(fset of attitude sensor \(m\))-.25 E 2.5<ad6e>128 360 S(ote: positi)
--2.5 E .3 -.15(ve t)-.25 H 2.5(os).15 G(tarboard)-2.5 E(VR)115.5 372 Q
-(UOFFSETY constant)-.4 E(sets fore-aft of)128 384 Q
-(fset of attitude sensor \(m\))-.25 E 2.5<ad6e>128 396 S(ote: positi)
--2.5 E .3 -.15(ve f)-.25 H(orw).15 E(ard)-.1 E(VR)115.5 408 Q
-(UOFFSETZ constant)-.4 E(sets v)128 420 Q(ertical of)-.15 E
-(fset of attitude sensor \(m\))-.25 E 2.5<ad6e>128 432 S(ote: positi)
--2.5 E .3 -.15(ve d)-.25 H -.25(ow).15 G(n).25 E(SON)115.5 444 Q(AR)-.35
-E(OFFSETX constant)-.4 E(sets athw)128 456 Q(artships of)-.1 E
-(fset of sonar recei)-.25 E .3 -.15(ve a)-.25 H(rray \(m\)).15 E 2.5
-<ad6e>128 468 S(ote: positi)-2.5 E .3 -.15(ve t)-.25 H 2.5(os).15 G
-(tarboard)-2.5 E(SON)115.5 480 Q(AR)-.35 E(OFFSETY constant)-.4 E
-(sets fore-aft of)128 492 Q(fset of sonar recei)-.25 E .3 -.15(ve a)-.25
-H(rray \(m\)).15 E 2.5<ad6e>128 504 S(ote: positi)-2.5 E .3 -.15(ve f)
--.25 H(orw).15 E(ard)-.1 E(SON)115.5 516 Q(AR)-.35 E(OFFSETZ constant)
--.4 E(sets v)128 528 Q(ertical of)-.15 E(fset of sonar recei)-.25 E .3
--.15(ve a)-.25 H(rray \(m\)).15 E 2.5<ad6e>128 540 S(ote: positi)-2.5 E
-.3 -.15(ve d)-.25 H -.25(ow).15 G(n).25 E -.4(RO)110.5 564 S
-(LL CORRECTION:).4 E -.4(RO)115.5 576 S(LLBIASMODE mode).4 E
-(sets roll correction [0])128 588 Q(0: no roll correction)133 600 Q
-(1: roll correction by single roll bias)133 612 Q
-(2: roll correction by separate port and)133 624 Q(starboard roll bias)
-140.5 636 Q -.4(RO)115.5 648 S(LLBIAS of).4 E(fset)-.25 E
-(sets roll bias \(de)128 660 Q(grees\))-.15 E -.4(RO)115.5 672 S
-(LLBIASPOR).4 E 2.5(To)-.6 G -.25(ff)-2.5 G(set).25 E
-(sets port roll bias \(de)128 684 Q(grees\))-.15 E -.4(RO)115.5 696 S
-(LLBIASSTBD of).4 E(fset)-.25 E(sets starboard roll bias \(de)128 708 Q
-(grees\))-.15 E(MB-System 5.0)72 768 Q(10 No)132.205 E -.15(ve)-.15 G
-(mber 2014).15 E(8)190.545 E 0 Cg EP
-%%Page: 9 9
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 164.28(mbset\(1\) MB-System)72 48 R 164.28
-(5.0 mbset\(1\))2.5 F(PITCH CORRECTION:)110.5 84 Q(PITCHBIASMODE mode)
-115.5 96 Q(sets pitch correction [0])128 108 Q(0: no pitch correction)
-133 120 Q(1: pitch correction by pitch bias)133 132 Q(PITCHBIAS of)115.5
-144 Q(fset)-.25 E(sets pitch bias \(de)128 156 Q(grees\))-.15 E
-(HEADING CORRECTION:)110.5 180 Q(HEADINGMODE mode)115.5 192 Q
-(sets heading correction [no heading correction])128 204 Q 2.5<ad6e>128
-216 S(ote: heading mer)-2.5 E(ged from na)-.18 E(vig)-.2 E(ation before)
--.05 E(heading correction applied)133 228 Q(0: no heading correction)133
-240 Q(1: heading correction using course)133 252 Q(made good)140.5 264 Q
-(2: heading correction by of)133 276 Q(fset)-.25 E
-(3: heading correction using course)133 288 Q(made good and of)140.5 300
-Q(fset)-.25 E(HEADINGOFFSET of)115.5 312 Q(fset)-.25 E(sets v)128 324 Q
-(alue added to heading \(de)-.25 E(grees\))-.15 E(TIDE CORRECTION:)110.5
-348 Q(TIDEMODE mode)115.5 360 Q(sets tide correction [0])128 372 Q 2.5
-<ad6e>128 384 S(ote: tide added to bath)-2.5 E(ymetry after)-.05 E
-(all other calculations and corrections)133 396 Q(0: tide correction of)
-133 408 Q(f)-.25 E(1: tide correction on)133 420 Q(TIDEFILE \214lename)
-115.5 432 Q(sets tide \214le path)128 444 Q(TIDEFORMA)115.5 456 Q 2.5
-(Tc)-1.11 G(onstan)-2.5 E(sets tide \214le format [1])128 468 Q 2.5
-<ad74>128 480 S(ide \214les can be in one of four ASCII)-2.5 E
-(table formats)133 492 Q(1: format is <time_d tide>)133 504 Q
-(2: format is <yr mon day hour min sec tide>)133 516 Q
-(3: format is <yr jday hour min sec tide>)133 528 Q
-(4: format is <yr jday daymin sec tide>)133 540 Q 2.5<ad74>128 552 S
-(ime_d = decimal seconds since 1/1/1970)-2.5 E 2.5<ad64>128 564 S
-(aymin = decimal minutes start of day)-2.5 E(AMPLITUDE CORRECTION:)110.5
-588 Q 2.5(AMPCORRMODE boolean)115.5 600 R
-(sets correction of amplitude for)128 612 Q
-(amplitude vs grazing angle function)128 624 Q
-(0: amplitude correction of)133 636 Q(f)-.25 E
-(1: amplitude correction on)133 648 Q(AMPCORRFILE \214lename)115.5 660 Q
-(sets amplitude correction \214le path)128 672 Q([no def)128 684 Q
-(ault])-.1 E(AMPCORR)115.5 696 Q(TYPE mode)-.6 E
-(sets sidescan correction type [0])128 708 Q
-(0: correction by subtraction \(dB scale\))133 720 Q(MB-System 5.0)72
-768 Q(10 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E(9)190.545 E 0 Cg EP
-%%Page: 10 10
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 164.28(mbset\(1\) MB-System)72 48 R 164.28
-(5.0 mbset\(1\))2.5 F(1: correction by di)133 84 Q
-(vision \(linear scale\))-.25 E(AMPCORRSYMMETR)115.5 96 Q 2.5(Yb)-.65 G
-(oolean)-2.5 E(forces correction function to be symmetric [1])128 108 Q
-(AMPCORRANGLE constant)115.5 120 Q
-(sets amplitude correction reference angle)128 132 Q(\(de)128 144 Q
-(g\) [30.0])-.15 E(AMPCORRSLOPE mode)115.5 156 Q
-(sets amplitude correction slope mode [0])128 168 Q
-(0: local slope ignored in calculating correction)133 180 Q
-(1: local slope used in calculating correction)133 192 Q(2: topograph)
-133 204 Q 2.5(yg)-.05 G(rid used in calculating correction)-2.5 E -.2
-(bu)140.5 216 S 2.5(ts).2 G(lope ignored)-2.5 E
-(3: local slope from topograph)133 228 Q 2.5(yg)-.05 G(rid used in)-2.5
-E(calculating correction)140.5 240 Q(SIDESCAN CORRECTION:)110.5 264 Q
-2.5(SSCORRMODE boolean)115.5 276 R(sets correction of sidescan for)128
-288 Q(amplitude vs grazing angle function)128 300 Q
-(0: sidescan correction of)133 312 Q(f)-.25 E(1: sidescan correction on)
-133 324 Q(SSCORRFILE \214lename)115.5 336 Q
-(sets sidescan correction \214le path)128 348 Q([no def)128 360 Q(ault])
--.1 E(SSCORR)115.5 372 Q(TYPE mode)-.6 E
-(sets sidescan correction type [0])128 384 Q
-(0: correction by subtraction \(dB scale\))133 396 Q
-(1: correction by di)133 408 Q(vision \(linear scale\))-.25 E
-(SSCORRSYMMETR)115.5 420 Q 2.5(Yb)-.65 G(oolean)-2.5 E
-(forces correction function to be symmetric [1])128 432 Q
-(SSCORRANGLE constant)115.5 444 Q
-(sets sidescan correction reference angle)128 456 Q(\(de)128 468 Q
-(g\) [30.0])-.15 E(SSCORRSLOPE mode)115.5 480 Q
-(sets sidescan correction slope mode [0])128 492 Q
-(0: local slope ignored in calculating correction)133 504 Q
-(1: local slope used in calculating correction)133 516 Q(2: topograph)
-133 528 Q 2.5(yg)-.05 G(rid used in calculating correction)-2.5 E -.2
-(bu)140.5 540 S 2.5(ts).2 G(lope ignored)-2.5 E
-(3: local slope from topograph)133 552 Q 2.5(yg)-.05 G(rid used in)-2.5
-E(calculating correction)140.5 564 Q(AMPSSCORR)115.5 576 Q -.18(TO)-.6 G
-(POFILE).18 E(Sets topograph)128 588 Q 2.5(yg)-.05 G
-(rid used for correcting amplitude)-2.5 E(and sidescan)128 600 Q
-(SIDESCAN RECALCULA)110.5 624 Q(TION:)-1.11 E 2.5(SSRECALCMODE boolean)
-115.5 636 R(sets recalculation of sidescan for)128 648 Q
-(Simrad multibeam data)128 660 Q(0: sidescan recalculation of)133 672 Q
-(f)-.25 E(1: sidescan recalculation on)133 684 Q(SSPIXELSIZE constant)
-115.5 696 Q(sets recalculated sidescan pix)128 708 Q
-(el size \(m\) [0.0])-.15 E 2.5(\255az)128 720 S(ero v)-2.5 E
-(alue causes the pix)-.25 E(el size to)-.15 E(MB-System 5.0)72 768 Q
-(10 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E(10)185.545 E 0 Cg EP
-%%Page: 11 11
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 164.28(mbset\(1\) MB-System)72 48 R 164.28
-(5.0 mbset\(1\))2.5 F(be recalculated for e)133 84 Q -.15(ve)-.25 G
-(ry data record).15 E(SSSW)115.5 96 Q -1.11(AT)-1.2 G 2.5
-(HWIDTH constant)1.11 F(sets sidescan sw)128 108 Q(ath width \(de)-.1 E
-(grees\) [0.0])-.15 E 2.5(\255az)128 120 S(ero v)-2.5 E
-(alue causes the sw)-.25 E(ath width)-.1 E(to be recalculated for e)133
-132 Q -.15(ve)-.25 G(ry data record).15 E(SSINTERPOLA)115.5 144 Q 2.5
-(TE constant)-1.11 F(sets sidescan interpolation distance)128 156 Q
-(\(number of pix)128 168 Q(els\))-.15 E(MET)110.5 192 Q(AD)-.93 E -1.21
--1.11(AT A)-.4 H(INSER)3.61 E(TION:)-.6 E(MET)115.5 204 Q -1.35(AV)-.93
-G(ESSEL string)1.35 E(sets mbinfo metadata string for v)128 216 Q(essel)
--.15 E(MET)115.5 228 Q(AINSTITUTION string)-.93 E
-(sets mbinfo metadata string for v)128 240 Q(essel)-.15 E
-(operator institution or compan)128 252 Q(y)-.15 E(MET)115.5 264 Q(APLA)
--.93 E(TFORM string)-1.11 E(sets mbinfo metadata string for sonar)128
-276 Q(platform \(ship or v)128 288 Q(ehicle\))-.15 E(MET)115.5 300 Q
-(ASON)-.93 E(AR string)-.35 E(sets mbinfo metadata string for sonar)128
-312 Q(model name)128 324 Q(MET)115.5 336 Q(ASON)-.93 E(AR)-.35 E
-(VERSION string)-.8 E(sets mbinfo metadata string for sonar)128 348 Q
--.15(ve)128 360 S(rsion \(usually softw).15 E(are v)-.1 E(ersion\))-.15
-E(MET)115.5 372 Q -.4(AC)-.93 G -.4(RU).4 G(ISEID string).4 E
-(sets mbinfo metadata string for institutional)128 384 Q(cruise id)128
-396 Q(MET)115.5 408 Q -.4(AC)-.93 G -.4(RU).4 G(ISEN).4 E(AME string)
--.35 E(sets mbinfo metadata string for descripti)128 420 Q -.15(ve)-.25
-G(cruise name)128 432 Q(MET)115.5 444 Q(API string)-.93 E
-(sets mbinfo metadata string for principal)128 456 Q(in)128 468 Q -.15
-(ve)-.4 G(stig).15 E(ator)-.05 E(MET)115.5 480 Q(APIINSTITUTION string)
--.93 E(sets mbinfo metadata string for principal)128 492 Q(in)128 504 Q
--.15(ve)-.4 G(stig).15 E(ator)-.05 E(MET)115.5 516 Q -.4(AC)-.93 G
-(LIENT string).4 E(sets mbinfo metadata string fo data o)128 528 Q(wner)
--.25 E(\(usually PI institution\))128 540 Q(MET)115.5 552 Q
-(ASVCORRECTED boolean)-.93 E(sets mbinfo metadata boolean for sound)128
-564 Q -.15(ve)128 576 S(locity corrected depths).15 E(MET)115.5 588 Q
--1.11(AT)-.93 G(IDECORRECTED boolean)1.11 E
-(sets mbinfo metadata boolean for tide)128 600 Q(corrected bath)128 612
-Q(ymetry)-.05 E(MET)115.5 624 Q(AB)-.93 E -1.11(AT)-.35 G(HEDITMANU)1.11
-E(AL boolean)-.4 E(sets mbinfo metadata boolean for manually)128 636 Q
-(edited bath)128 648 Q(ymetry)-.05 E(MET)115.5 660 Q(AB)-.93 E -1.11(AT)
--.35 G(HEDIT)1.11 E -.55(AU)-.93 G .36 -.18(TO b).55 H(oolean).18 E
-(sets mbinfo metadata boolean for automatically)128 672 Q(edited bath)
-128 684 Q(ymetry)-.05 E(MET)115.5 696 Q(AR)-.93 E(OLLBIAS constant)-.4 E
-(sets mbinfo metadata constant for roll bias)128 708 Q(\(de)128 720 Q
-(grees + to starboard\))-.15 E(MB-System 5.0)72 768 Q(10 No)132.205 E
--.15(ve)-.15 G(mber 2014).15 E(11)185.545 E 0 Cg EP
-%%Page: 12 12
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 164.28(mbset\(1\) MB-System)72 48 R 164.28
-(5.0 mbset\(1\))2.5 F(MET)115.5 84 Q(APITCHBIAS constant)-.93 E
-(sets mbinfo metadata constant for pitch bias)128 96 Q(\(de)128 108 Q
-(grees + forw)-.15 E(ard\))-.1 E(MET)115.5 120 Q(AHEADINGBIAS constant)
--.93 E(sets mbinfo metadata constant for heading bias)128 132 Q(MET)
-115.5 144 Q(ADRAFT constant)-.93 E(sets mbinfo metadata constant for v)
-128 156 Q(essel draft \(m\))-.15 E(PR)110.5 180 Q(OCESSING KLUGES:)-.4 E
-(KLUGE001 boolean)115.5 192 Q(enables correction of tra)128 204 Q -.15
-(ve)-.2 G 2.5(lt).15 G(imes in)-2.5 E
-(Hydrosweep DS2 data from the R/V Maurice)128 216 Q
-(Ewing in 2001 and 2002.)128 228 Q(KLUGE002 boolean)115.5 240 Q
-(enables correction of draft v)128 252 Q(alues in)-.25 E(Simrad data)128
-264 Q 2.5<ad73>128 276 S(ome Simrad multibeam data has had an)-2.5 E
-(error in which the hea)133 288 Q .3 -.15(ve h)-.2 H(as bee added).15 E
-(to the sonar depth \(draft for hull)133 300 Q(mounted sonars\))133 312
-Q 2.5<ad74>128 324 S(his correction subtracts the hea)-2.5 E -.15(ve)-.2
-G -.25(va)133 336 S(lue from the sonar depth).25 E(KLUGE003 boolean)
-115.5 348 Q(enables correction of beam angles in)128 360 Q
-(SeaBeam 2112 data)128 372 Q 2.5(\255ad)128 384 S
-(ata sample from the SeaBeam 2112 on)-2.5 E(the USCG Icebreak)133 396 Q
-(er Healy \(collected on)-.1 E(23 July 2003\) w)133 408 Q
-(as found to ha)-.1 E .3 -.15(ve a)-.2 H 2.5(ne).15 G(rror)-2.5 E
-(in which the beam angles had 0.25 times)133 420 Q(the roll added)133
-432 Q 2.5<ad74>128 444 S(his correction subtracts 0.25 * roll)-2.5 E
-(from the beam angles before the bath)133 456 Q(ymetry)-.05 E
-(is recalculated by raytracing through a)133 468 Q -.1(wa)133 480 S
-(ter sound v).1 E(elocity pro\214le)-.15 E 2.5<ad74>128 492 S
-(he mbprocess parameter \214les must be)-2.5 E(set to enable bath)133
-504 Q(ymetry recalculation)-.05 E(by raytracing in order to apply this)
-133 516 Q(correction)133 528 Q(KLUGE004 boolean)115.5 540 Q
-(deletes surv)128 552 Q .3 -.15(ey d)-.15 H
-(ata associated with duplicate).15 E(or re)128 564 Q -.15(ve)-.25 G
-(rsed time tags).15 E 2.5<ad69>128 576 S 2.5(fs)-2.5 G(urv)-2.5 E .3
--.15(ey d)-.15 H(ata records are encountered).15 E
-(with time tags less than or equal to the)133 588 Q
-(last good time tag, an error is set and)133 600 Q
-(the data record is not output to the)133 612 Q(processed data \214le.)
-133 624 Q(KLUGE005 boolean)115.5 636 Q(replaces surv)128 648 Q .3 -.15
-(ey r)-.15 H(ecord timestamps with).15 E
-(timestamps of corresponding mer)128 660 Q(ged na)-.18 E(vig)-.2 E
-(ation)-.05 E(records)128 672 Q 2.5<ad74>128 684 S(his feature allo)-2.5
-E(ws users to \214x)-.25 E(timestamp errors using MBna)133 696 Q -.15
-(ve)-.2 G(dit and).15 E(then insert the corrected timestamps)133 708 Q
-(into processed data)133 720 Q(MB-System 5.0)72 768 Q(10 No)132.205 E
--.15(ve)-.15 G(mber 2014).15 E(12)185.545 E 0 Cg EP
-%%Page: 13 13
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 164.28(mbset\(1\) MB-System)72 48 R 164.28
-(5.0 mbset\(1\))2.5 F(KLUGE006 boolean)115.5 84 Q
-(changes sonar depth / draft v)144 96 Q(alues without)-.25 E
-(changing bath)128 108 Q(ymetry v)-.05 E(alues)-.25 E(KLUGE007 boolean)
-115.5 120 Q(processing kluge 007 \(not yet de\214ned\))128 132 Q 2.5
-<ad6f>128 144 S(ccasionaly odd processing problems will)-2.5 E
-(occur that are speci\214c to a particular)133 156 Q(surv)133 168 Q .3
--.15(ey o)-.15 H 2.5(rs).15 G(onar v)-2.5 E(ersion)-.15 E 2.5<ad6d>128
-180 S(bprocess will allo)-2.5 E 2.5(wo)-.25 G(ne-time \214x)-2.5 E
-(es to)-.15 E(be de\214ned as "kluges" that can be turned)133 192 Q
-(on through the parameter \214les.)133 204 Q/F1 10.95/Times-Bold at 0 SF
-(ANCILLAR)72 232.8 Q 2.738(YD)-.383 G -1.644 -1.04(AT A)-3.121 H(FILES)
-3.778 E/F2 10/Times-Bold at 0 SF(MB-System)108 244.8 Q F0 .166
-(also uses a number of ancillary data \214les, most of which relate to)
-2.667 F F2(mbpr)2.666 E(ocess)-.18 E F0 .166(in some w)2.666 F(ay)-.1 E
-2.666(.B)-.65 G(y)-2.666 E(def)108 256.8 Q 1.354
-(ault, these ancillary data \214les are named by adding a short suf)-.1
-F 1.354(\214x to the primary data \214le name \(e.g.)-.25 F
-(".par", ".svp", ".esf", ".n)108 268.8 Q -.15(ve)-.4 G("\)).15 E 1.093
-(The common ancillary \214les are listed belo)108 292.8 R 2.393 -.65
-(w. T)-.25 H 1.093(he e).65 F 1.092(xample names gi)-.15 F -.15(ve)-.25
-G 3.592(nh).15 G 1.092(ere follo)-3.592 F 3.592(wf)-.25 G 1.092
-(rom an input sw)-3.592 F(ath)-.1 E(data \214le name of mydata.mb71.)108
-304.8 Q .029(The processing parameter \214le used by)108 328.8 R F2
-(mbpr)2.529 E(ocess)-.18 E F0 .029(has an ".par" suf)2.529 F .03
-(\214x. These \214les are generated or modi\214ed)-.25 F(by)108 340.8 Q
-F2(mbset)2.5 E F0(,)A F2(mbedit)2.5 E F0(,)A F2(mbna)2.5 E -.1(ve)-.25 G
-(dit).1 E F0(,)A F2(mb)2.5 E -.1(ve)-.15 G(locitytool).1 E F0(,)A F2
-(mbna)2.5 E -.1(va)-.25 G(djust).1 E F0 2.5(,a)C(nd)-2.5 E F2(mbclean)
-2.5 E F0(.)A(mydata.mb71.par)128 352.8 Q 1.128(The most prominent ancil\
-lary \214les are metadata or "inf" \214les \(created from the output of)
-108 376.8 R F2(mbinf)3.627 E(o)-.25 E F0 3.627(\). Pro-)B .493
-(grams such as)108 388.8 R F2(mbgrid)2.994 E F0(and)2.994 E F2(mbm_plot)
-2.994 E F0 .494(try to check "inf" \214les to see if the corresponding \
-data \214les include)2.994 F .642
-(data within desired areas. The program)108 400.8 R F2(mbpr)3.142 E
-(ocess)-.18 E F0 .642(automatically generates an "inf" \214le for an)
-3.142 F 3.142(yp)-.15 G(rocessed)-3.142 E .031(output sw)108 412.8 R
-.031(ath \214le.)-.1 F .031(Also, the program)5.031 F F2(mbdatalist)
-2.531 E F0 .031(is often used to create or update "inf" \214les for lar)
-2.531 F .032(ge groups)-.18 F(of sw)108 424.8 Q(ath data \214les.)-.1 E
-(mydata.mb71.inf)128 436.8 Q(mydata.mb71.inf)128 448.8 Q .645(The "f)108
-472.8 R .645(ast bath" or "fbt" \214les are generated by cop)-.1 F .644
-(ying the sw)-.1 F .644(ath bath)-.1 F .644
-(ymetry to a sparse, quickly read for)-.05 F(-)-.2 E .13
-(mat \(format 71\). Programs such as)108 484.8 R F2(mbgrid)2.63 E F0(,)A
-F2(mbswath)2.63 E F0 2.63(,a)C(nd)-2.63 E F2(mbcontour)2.63 E F0 .13
-(will try to read "fbt" \214les instead of)2.63 F .764
-(the full data \214les whene)108 496.8 R -.15(ve)-.25 G 3.264(ro).15 G
-.764(nly bath)-3.264 F .764
-(ymetry information are required. The program)-.05 F F2(mbpr)3.263 E
-(ocess)-.18 E F0(automati-)3.263 E .015
-(cally generates an "fbt" \214le for an)108 508.8 R 2.515(yp)-.15 G .015
-(rocessed output sw)-2.515 F .015(ath \214le.)-.1 F .015
-(Also, the program)5.015 F F2(mbdatalist)2.516 E F0 .016(is often used)
-2.516 F 1.172(to create or update "fbt" \214les for lar)108 520.8 R
-1.172(ge groups of sw)-.18 F 1.172(ath data \214les.)-.1 F 1.172
-(These \214les are not generated or used)6.172 F(when the original sw)
-108 532.8 Q(ath data is already in a compact bath)-.1 E
-(ymetry-only data format.)-.05 E(mydata.mb71.fbt)128 544.8 Q .563
-(The "f)108 568.8 R .563(ast na)-.1 F .563(v" or "fn)-.2 F .563
-(v" \214les are just ASCII lists of na)-.4 F(vig)-.2 E .564
-(ation generated using)-.05 F F2(mblist)3.064 E F0 .564(with a)3.064 F
-F2<ad4f>3.064 E/F3 10/Times-Italic at 0 SF(tMXYHSc)A F0 .415
-(option. Programs such as)108 580.8 R F2(mbgrid)2.914 E F0(,)A F2
-(mbswath)2.914 E F0 2.914(,a)C(nd)-2.914 E F2(mbcontour)2.914 E F0 .414
-(will try to read "fn)2.914 F .414(v" \214les instead of the full)-.4 F
-.015(data \214les whene)108 592.8 R -.15(ve)-.25 G 2.515(ro).15 G .015
-(nly na)-2.515 F(vig)-.2 E .016(ation information are required. These \
-\214les are not generated or used when the)-.05 F
-(original data is already in a single-beam or na)108 604.8 Q(vig)-.2 E
-(ation data format.)-.05 E(mydata.mb71.fn)128 616.8 Q(v)-.4 E(The bath)
-108 640.8 Q(ymetry edit sa)-.05 E .3 -.15(ve \214)-.2 H(le generated by)
-.15 E F2(mbedit)2.5 E F0(and)2.5 E F2(mbclean)2.5 E F0
-(has an ".esf" suf)2.5 E(\214x.)-.25 E(mydata.mb71.esf)128 652.8 Q 2.982
-(Aw)108 676.8 S .482(ater sound v)-3.082 F .481
-(elocity pro\214le \(SVP\) \214le generated by)-.15 F F2(mb)2.981 E -.1
-(ve)-.15 G(locitytool).1 E F0 .481(has an ".svp" suf)2.981 F .481
-(\214x unless the user)-.25 F(speci\214es otherwise.)108 688.8 Q
-(mydata.mb71.svp)128 700.8 Q -.8(Wa)108 724.8 S 1.985(ter sound v).8 F
-1.986(elocity pro\214le \(SVP\) \214les generated by)-.15 F F2
-(mbsvplist)4.486 E F0 1.986(also use the ".svp" suf)4.486 F 4.486
-(\214x. Ho)-.25 F(we)-.25 E -.15(ve)-.25 G -.4(r,).15 G(MB-System 5.0)72
-768 Q(10 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E(13)185.545 E 0 Cg
-EP
-%%Page: 14 14
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 164.28(mbset\(1\) MB-System)72 48 R 164.28
-(5.0 mbset\(1\))2.5 F 2.652(multiple SVP \214les may be e)108 84 R 2.651
-(xtracted from each input sw)-.15 F 2.651
-(ath \214le, so the \214les are numbered using a)-.1 F("_YYY)108 96 Q
-(.svp" suf)-1.29 E(\214x, where YYY increments from 001.)-.25 E
-(mydata.mb71_001.svp)128 108 Q(mydata.mb71_002.svp)128 120 Q
-(mydata.mb71_003.svp)128 132 Q(Edited na)108 156 Q(vig)-.2 E
-(ation \214les generated by)-.05 E/F1 10/Times-Bold at 0 SF(mbna)2.5 E -.1
-(ve)-.25 G(dit).1 E F0(ha)2.5 E .3 -.15(ve a)-.2 H 2.5(n").15 G(.n)-2.5
-E -.15(ve)-.4 G 2.5("s).15 G(uf)-2.5 E(\214x:)-.25 E(mydata.mb71.n)128
-168 Q -.15(ve)-.4 G(These na)108 180 Q(vig)-.2 E
-(ation \214les can be read independently using format 166.)-.05 E
-(Adjusted na)108 204 Q(vig)-.2 E(ation \214les generated by)-.05 E F1
-(mbna)2.5 E -.1(va)-.25 G(djust).1 E F0(ha)2.5 E .3 -.15(ve a)-.2 H 2.5
-(n").15 G(.naY" suf)-2.5 E(\214x, where "Y" is a number between)-.25 E
-3.477(0-9. The)108 216 R F1(mbna)3.477 E -.1(va)-.25 G(djust).1 E F0
-.977(package may be used multiple times for a surv)3.477 F -.15(ey)-.15
-G 3.476(;t).15 G .976(he adjustments are numbered)-3.476 F
-(sequentially from "0":)108 228 Q(mydata.mb71.na0)128 240 Q
-(mydata.mb71.na1)128 252 Q(mydata.mb71.na2)128 264 Q
-(and so on. These na)108 276 Q(vig)-.2 E
-(ation \214les can be read independently using format 166.)-.05 E/F2
-10.95/Times-Bold at 0 SF -.548(AU)72 304.8 S(THORSHIP).548 E F0(Da)108
-316.8 Q(vid W)-.2 E 2.5(.C)-.92 G(aress \(caress at mbari.or)-2.5 E(g\))
--.18 E(Montere)113 328.8 Q 2.5(yB)-.15 G(ay Aquarium Research Institute)
--2.5 E(Dale N. Chayes \(dale at ldeo.columbia.edu\))108 340.8 Q
-(Lamont-Doherty Earth Observ)113 352.8 Q(atory)-.25 E F2(OPTIONS)72
-381.6 Q F1<ad45>108 393.6 Q F0 1.171(This option causes)144 405.6 R F1
-(mbset)3.672 E F0 1.172(to require all processing modes to be e)3.672 F
-1.172(xplicitly set by)-.15 F F1<ad50>3.672 E F0 1.172(calls. Nor)3.672
-F(-)-.2 E(mally)144 417.6 Q(,)-.65 E F1(mbset)3.448 E F0 .947
-(will implicitly set some modes based on the parameters applied. F)3.448
-F .947(or e)-.15 F .947(xample, if a)-.15 F .884(user applies)144 429.6
-R F1<ad50>3.384 E/F3 10/Times-Italic at 0 SF(SVPFILE:best.svp)A F0(,)A F1
-(mbset)3.384 E F0 -.1(wo)3.384 G .884(uld normally set the bath).1 F
-.884(ymetry recalculation mode)-.05 F
-(on so that the SVP \214le speci\214ed actually gets used.)144 441.6 Q
-F1<ad49>108 458.4 Q F3(in\214le)26.41 E F0(Sw)144 470.4 Q .276
-(ath data \214le for which an)-.1 F F1(mbpr)2.776 E(ocess)-.18 E F0 .276
-(parameter \214le will be created or updated, or a datalist \214le)2.776
-F .741(containing a list of input sw)144 482.4 R .741
-(ath data \214les and/or other datalist \214les. If)-.1 F F3(in\214le)
-3.241 E F0 .741(is a datalist \214le, then)3.241 F F1(mbset)144 494.4 Q
-F0 1.461
-(will attempt to update or create the parameter \214les for all sw)3.962
-F 1.461(ath data \214les identi\214ed by)-.1 F(recursi)144 506.4 Q -.15
-(ve)-.25 G(ly reading).15 E F3(in\214le)2.5 E F0 5(.D)C(ef)-5 E(ault)-.1
-E F3(in\214le)2.5 E F0 2.5(:d)C(atalist.mb-1)-2.5 E F1<ad4c>108 523.2 Q
-F0 1.207(If gi)144 535.2 R -.15(ve)-.25 G 3.707(no).15 G 1.207
-(nce, this option causes)-3.707 F F1(mbset)3.707 E F0 1.207
-(to look for an)3.707 F 3.707(ye)-.15 G 1.207(dit sa)-3.707 F 1.507 -.15
-(ve \214)-.2 H 1.207(les and na).15 F(vig)-.2 E 1.207
-(ation \214les with)-.05 F -.15(ex)144 547.2 S .444
-(pected names and set the).15 F F1(mbpr)2.944 E(ocess)-.18 E F0 .444
-(parameters so that these \214les are used. If multiple na)2.944 F(vig)
--.2 E(a-)-.05 E .554(tion \214les are a)144 559.2 R -.25(va)-.2 G .554
-(ilable \(re\215ecting use of).25 F F1(mbna)3.054 E -.1(ve)-.25 G(dit).1
-E F0 .554(and one or more uses of)3.054 F F1(mbna)3.054 E -.1(va)-.25 G
-(djust).1 E F0 .554(\), then)B .182(the latest \(highest numbered\))144
-571.2 R F1(mbna)2.682 E -.1(va)-.25 G(djust).1 E F0 .182
-(solution is used.)2.682 F(If)5.182 E F1<ad4c>2.682 E F0 .182(is gi)
-2.682 F -.15(ve)-.25 G 2.682(nt).15 G(wice,)-2.682 E F1(mbset)2.682 E F0
-.182(will also)2.682 F .651(look for an)144 583.2 R 3.151(yS)-.15 G .651
-(VP \214les with e)-3.151 F .651(xpected names and set the)-.15 F F1
-(mbpr)3.151 E(ocess)-.18 E F0 .652(parameters so that these \214les)
-3.151 F .357(are used for recalculating bath)144 595.2 R .357
-(ymetry by raytracing.)-.05 F .357(If multiple SVP \214les are a)5.357 F
--.25(va)-.2 G .356(ilable \(re\215ecting).25 F .23(use of)144 607.2 R F1
-(mbsvplist)2.73 E F0(and)2.73 E F1(mb)2.73 E -.1(ve)-.15 G(locitytool).1
-E F0 .231(\), then the \214le deri)B -.15(ve)-.25 G 2.731(df).15 G(rom)
--2.731 E F1(mb)2.731 E -.1(ve)-.15 G(locitytool).1 E F0 .231(is used.)
-2.731 F(If)5.231 E F1<ad4c>2.731 E F0(is)2.731 E(gi)144 619.2 Q -.15(ve)
--.25 G 3.538(nt).15 G 1.037(hree times or more, then)-3.538 F F1(mbset)
-3.537 E F0 1.037(will not look for an)3.537 F 3.537(ya)-.15 G 1.037
-(ncillary \214les, b)-3.537 F 1.037(ut instead reset the)-.2 F .468(pat\
-hs to all output \214les to be "local", meaning located in the same dir\
-ectory as the input \214le. This)144 631.2 R .142(special option allo)
-144 643.2 R .142(ws users to \214x parameter \214les containing full pa\
-ths for output \214les \(as generated)-.25 F(by early v)144 655.2 Q
-(ersions of this program\).)-.15 E F1<ad48>108 672 Q F0 .391(This "help\
-" \215ag causes the program to print out a description of its operation\
- and then e)22.52 F .391(xit imme-)-.15 F(diately)144 684 Q(.)-.65 E F1
-<ad50>108 700.8 Q F3 -.9(PA)24.19 G(RAMETER:value).9 E F0(The)4.085 E F1
-<ad50>4.085 E F0 1.585(option of)4.085 F F1(mbset)4.085 E F0 1.584
-(is used to modify a single)4.085 F F1(mbpr)4.084 E(ocess)-.18 E F0
-(parameter)4.084 E 1.106(command. Here)144 712.8 R F3 -.9(PA)3.606 G
-(RAMETER).9 E F0 1.106(may be an)3.606 F 3.606(yo)-.15 G 3.606(ft)-3.606
-G 1.106(he processing parameter names listed abo)-3.606 F -.15(ve)-.15 G
-3.607(,a).15 G(nd)-3.607 E F3(value)144 724.8 Q F0 .197
-(is the corresponding v)2.697 F .197
-(alue to be set. This option can be in)-.25 F -.2(vo)-.4 G -.1(ke).2 G
-2.696(da).1 G 2.696(sm)-2.696 G(an)-2.696 E 2.696(yt)-.15 G .196
-(imes as desired on)-2.696 F(MB-System 5.0)72 768 Q(10 No)132.205 E -.15
-(ve)-.15 G(mber 2014).15 E(14)185.545 E 0 Cg EP
-%%Page: 15 15
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 164.28(mbset\(1\) MB-System)72 48 R 164.28
-(5.0 mbset\(1\))2.5 F .77(the command line, allo)144 84 R(wing)-.25 E/F1
-10/Times-Bold at 0 SF(mbset)3.271 E F0 .771(to set multiple)3.271 F F1
-(mbpr)3.271 E(ocess)-.18 E F0 .771(processing parameters and modes.)
-3.271 F .118(The separater between)144 96 R/F2 10/Times-Italic at 0 SF -.9
-(PA)2.618 G(RAMETER).9 E F0(and)2.618 E F2(value)2.618 E F0 .118
-(can be either ':' or '='. Only the \214rst ':' or '=' acts)2.618 F
-(as a separater; later instances of these characters are tak)144 108 Q
-(en as part of)-.1 E F2(value)2.5 E F0(.)A F1<ad56>108 124.8 Q F0
-(Normally)23.08 E(,)-.65 E F1(mbset)2.897 E F0 -.1(wo)2.897 G .397
-(rks "silently" without outputting an).1 F .397
-(ything to the stderr stream.)-.15 F .397(If the)5.397 F F1<ad56>2.898 E
-F0(\215ag)2.898 E .63(is gi)144 136.8 R -.15(ve)-.25 G .63(n, then).15 F
-F1(mbset)3.13 E F0 -.1(wo)3.13 G .63(rks in a "v).1 F .63
-(erbose" mode and outputs the program v)-.15 F .63
-(ersion being used and)-.15 F
-(lists the processing parameters output to the)144 148.8 Q F1(mbpr)2.5 E
-(ocess)-.18 E F0(parameter \214le.)2.5 E/F3 10.95/Times-Bold at 0 SF
-(EXAMPLES)72 177.6 Q F0 .726(Suppose the user has a Simrad EM120 data \
-\214le called "0051_20010829_223755.mb57" that requires pro-)108 189.6 R
-(cessing.)108 201.6 Q 7.753(Editing the bath)108 225.6 R 7.752
-(ymetry data in this \214le with mbedit will generate an edit sa)-.05 F
-8.052 -.15(ve \214)-.2 H(le).15 E 30.498
-("0051_20010829_223755.mb57.esf" and an mbprocess parameter \214le)108
-237.6 R 2.5("0051_20010829_223755.mb57.par". The)108 249.6 R
-(contents of the parameter \214le are:)2.5 E
-(## MB-System processing parameter \214le)110.5 273.6 Q
-(## Written by mb_pr_writepar v)110.5 285.6 Q
-(ersion $Id: mbset.ps 2252 2015-07-01 19:35:37Z caress $)-.15 E
-(## MB-system V)110.5 297.6 Q(ersion 5.0.beta22)-1.11 E
-(## Generated by user <caress> on cpu <menard> at <Fri Sep)110.5 309.6 Q
-2.5(62)5 G(1:27:41 2002>)-2.5 E(##)110.5 321.6 Q(##)110.5 333.6 Q(## F)
-110.5 345.6 Q(orces e)-.15 E(xplicit reading of parameter modes.)-.15 E
-(EXPLICIT)110.5 357.6 Q(##)110.5 369.6 Q(## General P)110.5 381.6 Q
-(arameters:)-.15 E(FORMA)110.5 393.6 Q 2.5(T5)-1.11 G(7)-2.5 E
-(INFILE /data/0051_20010829_223755.mb57)110.5 405.6 Q
-(OUTFILE /data/0051_20010829_223755p.mb57)110.5 417.6 Q(##)110.5 429.6 Q
-(## Na)110.5 441.6 Q(vig)-.2 E(ation Mer)-.05 E(ging:)-.18 E -.35(NA)
-110.5 453.6 S(VMODE 0)-1 E -.35(NA)110.5 465.6 S
-(VFILE /data/0051_20010829_223755.mb57.n)-1 E -.15(ve)-.4 G -.35(NA)
-110.5 477.6 S(VFORMA)-1 E 2.5(T0)-1.11 G -.35(NA)110.5 489.6 S
-(VHEADING 0)-1 E -.35(NA)110.5 501.6 S(VSPEED 0)-1 E -.35(NA)110.5 513.6
-S(VDRAFT 0)-1 E -.35(NA)110.5 525.6 S -.91 -1.35(VA T)-1 H(TITUDE 0)1.35
-E -.35(NA)110.5 537.6 S(VINTERP 0)-1 E -.35(NA)110.5 549.6 S
-(VTIMESHIFT 0.000000)-1 E(##)110.5 561.6 Q(## Na)110.5 573.6 Q(vig)-.2 E
-(ation Of)-.05 E(fsets and Shifts:)-.25 E -.35(NA)110.5 585.6 S
-(VSHIFT 0)-1 E -.35(NA)110.5 597.6 S -.4(VO)-1 G(FFSETX 0.000000).4 E
--.35(NA)110.5 609.6 S -.4(VO)-1 G(FFSETY 0.000000).4 E -.35(NA)110.5
-621.6 S -.4(VO)-1 G(FFSETZ 0.000000).4 E -.35(NA)110.5 633.6 S
-(VSHIFTLON 0.000000)-1 E -.35(NA)110.5 645.6 S(VSHIFTLA)-1 E 2.5(T0)
--1.11 G(.000000)-2.5 E(##)110.5 657.6 Q(## Adjusted Na)110.5 669.6 Q
-(vig)-.2 E(ation Mer)-.05 E(ging:)-.18 E -.35(NA)110.5 681.6 S -1.35(VA)
--1 G(DJMODE 0)1.35 E -.35(NA)110.5 693.6 S -1.35(VA)-1 G(DJFILE)1.35 E
--.35(NA)110.5 705.6 S -1.35(VA)-1 G(DJINTERP 0)1.35 E(##)110.5 717.6 Q
-(## Attitude Mer)110.5 729.6 Q(ging:)-.18 E(MB-System 5.0)72 768 Q
-(10 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E(15)185.545 E 0 Cg EP
-%%Page: 16 16
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 164.28(mbset\(1\) MB-System)72 48 R 164.28
-(5.0 mbset\(1\))2.5 F -1.11(AT)110.5 84 S(TITUDEMODE 0)1.11 E -1.11(AT)
-110.5 96 S(TITUDEFILE)1.11 E -1.11(AT)110.5 108 S(TITUDEFORMA)1.11 E 2.5
-(T1)-1.11 G(##)110.5 120 Q(## Sonardepth Mer)110.5 132 Q(ging:)-.18 E
-(SON)110.5 144 Q(ARDEPTHMODE 0)-.35 E(SON)110.5 156 Q(ARDEPTHFILE)-.35 E
-(SON)110.5 168 Q(ARDEPTHFORMA)-.35 E 2.5(T1)-1.11 G(##)110.5 180 Q
-(## Data cutting:)110.5 192 Q -.4(DA)110.5 204 S -1.04 -.93(TA C)-.71 H
-(UTCLEAR).93 E(##)110.5 216 Q(## Bath)110.5 228 Q(ymetry Flagging:)-.05
-E(EDITSA)110.5 240 Q(VEMODE 1)-1.35 E(EDITSA)110.5 252 Q
-(VEFILE /data/0051_20010829_223755.mb57.esf)-1.35 E(##)110.5 264 Q
-(## Bath)110.5 276 Q(ymetry Recalculation:)-.05 E(SVPMODE 0)110.5 288 Q
-(SVPFILE)110.5 300 Q(SSVMODE 0)110.5 312 Q(SSV 0.000000)110.5 324 Q
-(TTMODE 0)110.5 336 Q(TTMUL)110.5 348 Q(TIPL)-.92 E 2.5(Y1)-1 G(.000000)
--2.5 E(ANGLEMODE 0)110.5 360 Q(SOUNDSPEEDREF 1)110.5 372 Q(##)110.5 384
-Q(## Draft Correction:)110.5 396 Q(DRAFTMODE 0)110.5 408 Q
-(DRAFT 0.000000)110.5 420 Q(DRAFT)110.5 432 Q(OFFSET 0.000000)-.18 E
-(DRAFTMUL)110.5 444 Q(TIPL)-.92 E 2.5(Y1)-1 G(.000000)-2.5 E(##)110.5
-456 Q(## Hea)110.5 468 Q .3 -.15(ve C)-.2 H(orrection:).15 E(HEA)110.5
-480 Q(VEMODE 0)-1.35 E(HEA)110.5 492 Q(VEOFFSET 0.000000)-1.35 E(HEA)
-110.5 504 Q(VEMUL)-1.35 E(TIPL)-.92 E 2.5(Y1)-1 G(.000000)-2.5 E(##)
-110.5 516 Q(## Le)110.5 528 Q -.15(ve)-.25 G 2.5(rC).15 G(orrection:)
--2.5 E(LEVERMODE 0)110.5 540 Q(VR)110.5 552 Q(UOFFSETX 0.000000)-.4 E
-(VR)110.5 564 Q(UOFFSETY 0.000000)-.4 E(VR)110.5 576 Q
-(UOFFSETZ 0.000000)-.4 E(SON)110.5 588 Q(AR)-.35 E(OFFSETX 0.000000)-.4
-E(SON)110.5 600 Q(AR)-.35 E(OFFSETY 0.000000)-.4 E(SON)110.5 612 Q(AR)
--.35 E(OFFSETZ 0.000000)-.4 E(##)110.5 624 Q(## Roll Correction:)110.5
-636 Q -.4(RO)110.5 648 S(LLBIASMODE 0).4 E -.4(RO)110.5 660 S
-(LLBIAS 0.000000).4 E -.4(RO)110.5 672 S(LLBIASPOR).4 E 2.5(T0)-.6 G
-(.000000)-2.5 E -.4(RO)110.5 684 S(LLBIASSTBD 0.000000).4 E(##)110.5 696
-Q(## Pitch Correction:)110.5 708 Q(PITCHBIASMODE 0)110.5 720 Q
-(MB-System 5.0)72 768 Q(10 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E
-(16)185.545 E 0 Cg EP
-%%Page: 17 17
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 164.28(mbset\(1\) MB-System)72 48 R 164.28
-(5.0 mbset\(1\))2.5 F(PITCHBIAS 0.000000)110.5 84 Q(##)110.5 96 Q
-(## Heading Correction:)110.5 108 Q(HEADINGMODE 0)110.5 120 Q
-(HEADINGOFFSET 0.000000)110.5 132 Q(##)110.5 144 Q(## T)110.5 156 Q
-(ide Correction:)-.35 E(TIDEMODE 0)110.5 168 Q(TIDEFILE)110.5 180 Q
-(TIDEFORMA)110.5 192 Q 2.5(T1)-1.11 G(##)110.5 204 Q
-(## Amplitude Correction:)110.5 216 Q(AMPCORRMODE 0)110.5 228 Q
-(AMPCORRFILE)110.5 240 Q(AMPCORR)110.5 252 Q(TYPE 0)-.6 E
-(AMPCORRSYMMETR)110.5 264 Q 2.5(Y1)-.65 G(AMPCORRANGLE 30.000000)110.5
-276 Q(AMPCORRSLOPE 0)110.5 288 Q(##)110.5 300 Q(## Sidescan Correction:)
-110.5 312 Q(SSCORRMODE 0)110.5 324 Q(SSCORRFILE)110.5 336 Q(SSCORR)110.5
-348 Q(TYPE 0)-.6 E(SSCORRSYMMETR)110.5 360 Q 2.5(Y1)-.65 G
-(SSCORRANGLE 30.000000)110.5 372 Q(SSCORRSLOPE 0)110.5 384 Q(##)110.5
-396 Q(## Sidescan Recalculation:)110.5 408 Q(SSRECALCMODE 0)110.5 420 Q
-(SSPIXELSIZE 0.000000)110.5 432 Q(SSSW)110.5 444 Q -1.11(AT)-1.2 G
-(HWIDTH 0.000000)1.11 E(SSINTERPOLA)110.5 456 Q(TE 0)-1.11 E(##)110.5
-468 Q(## Metadata Insertion:)110.5 480 Q(MET)110.5 492 Q -1.35(AV)-.93 G
-(ESSEL)1.35 E(MET)110.5 504 Q(AINSTITUTION)-.93 E(MET)110.5 516 Q(APLA)
--.93 E(TFORM)-1.11 E(MET)110.5 528 Q(ASON)-.93 E(AR)-.35 E(MET)110.5 540
-Q(ASON)-.93 E(AR)-.35 E(VERSION)-.8 E(MET)110.5 552 Q -.4(AC)-.93 G -.4
-(RU).4 G(ISEID).4 E(MET)110.5 564 Q -.4(AC)-.93 G -.4(RU).4 G(ISEN).4 E
-(AME)-.35 E(MET)110.5 576 Q(API)-.93 E(MET)110.5 588 Q(APIINSTITUTION)
--.93 E(MET)110.5 600 Q -.4(AC)-.93 G(LIENT).4 E(MET)110.5 612 Q
-(ASVCORRECTED \2551)-.93 E(MET)110.5 624 Q -1.11(AT)-.93 G
-(IDECORRECTED \2551)1.11 E(MET)110.5 636 Q(AB)-.93 E -1.11(AT)-.35 G
-(HEDITMANU)1.11 E(AL \2551)-.4 E(MET)110.5 648 Q(AB)-.93 E -1.11(AT)-.35
-G(HEDIT)1.11 E -.55(AU)-.93 G .36 -.18(TO \255).55 H(1).18 E(MET)110.5
-660 Q(AR)-.93 E(OLLBIAS 0.000000)-.4 E(MET)110.5 672 Q
-(APITCHBIAS 0.000000)-.93 E(MET)110.5 684 Q(AHEADINGBIAS 0.000000)-.93 E
-(MET)110.5 696 Q(ADRAFT 0.000000)-.93 E(##)110.5 708 Q
-(## Processing Kluges:)110.5 720 Q(MB-System 5.0)72 768 Q(10 No)132.205
-E -.15(ve)-.15 G(mber 2014).15 E(17)185.545 E 0 Cg EP
-%%Page: 18 18
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 164.28(mbset\(1\) MB-System)72 48 R 164.28
-(5.0 mbset\(1\))2.5 F 12.843(Editing the na)108 84 R(vig)-.2 E 12.843
-(ation with mbna)-.05 F -.15(ve)-.2 G 12.843(dit will generate a na).15
-F(vig)-.2 E 12.843(ation \214le named)-.05 F
-("0051_20010829_223755.mb57.n)108 96 Q -.15(ve)-.4 G 8.026("a).15 G
-5.526(nd will modify the parameter \214le. The changed lines in)-8.026 F
-("0051_20010829_223755.mb57.par" are:)108 108 Q(## Na)110.5 132 Q(vig)
--.2 E(ation Mer)-.05 E(ging:)-.18 E -.35(NA)110.5 144 S(VMODE 1)-1 E
--.35(NA)110.5 156 S(VFILE /data/0051_20010829_223755.mb57.n)-1 E -.15
-(ve)-.4 G -.35(NA)110.5 168 S(VFORMA)-1 E 2.5(T9)-1.11 G -.35(NA)110.5
-180 S(VHEADING 1)-1 E -.35(NA)110.5 192 S(VSPEED 1)-1 E -.35(NA)110.5
-204 S(VDRAFT 1)-1 E -.35(NA)110.5 216 S -.91 -1.35(VA T)-1 H(TITUDE 1)
-1.35 E .062(At this point, running)108 240 R/F1 10/Times-Bold at 0 SF(mbpr)
-2.562 E(ocess)-.18 E F0 .062
-(on "0051_20010829_223755.mb57" will apply the bath)2.562 F .061
-(ymetry \215ags from)-.05 F F1(mbedit)108 252 Q F0(and mer)2.5 E
-(ge the na)-.18 E(vig)-.2 E(ation from)-.05 E F1(mbna)2.5 E -.1(ve)-.25
-G(dit).1 E F0 2.5(,b)C(ut will not modify the data in an)-2.7 E 2.5(yo)
--.15 G(ther w)-2.5 E(ay)-.1 E(.)-.65 E .417(If the user w)108 276 R .417
-(ants to recalculate the bath)-.1 F .417
-(ymetry using an SVP \214le "0051_20010829_223755.mb57.svp" and)-.05 F
-2.5(ar)108 288 S(oll bias correction of +0.5 de)-2.5 E(grees, the follo)
--.15 E(wing will suf)-.25 E(\214ce:)-.25 E 4.587
-(mbset \255I 0051_20010829_223755.mb57)128 312 R
-(\255PSVPFILE:0051_20010829_223755.mb57.svp)44.586 E(\255PR)108 324 Q
-37.5(OLLBIAS:0.5 \255PDRAFT)-.4 F 37.5(:1.95 \255V)-.5 F(The af)108 348
-Q(fected lines in "0051_20010829_223755.mb57.par" are:)-.25 E(##)110.5
-372 Q(## Bath)110.5 384 Q(ymetry Recalculation:)-.05 E(SVPMODE 1)110.5
-396 Q(SVPFILE 0051_20010829_223755.mb57.svp)110.5 408 Q(SSVMODE 0)110.5
-420 Q(SSV 0.000000)110.5 432 Q(TTMODE 0)110.5 444 Q(TTMUL)110.5 456 Q
-(TIPL)-.92 E 2.5(Y1)-1 G(.000000)-2.5 E(ANGLEMODE 0)110.5 468 Q
-(SOUNDSPEEDREF 1)110.5 480 Q(##)110.5 492 Q(## Draft Correction:)110.5
-504 Q(DRAFTMODE 4)110.5 516 Q(DRAFT 1.950000)110.5 528 Q(DRAFT)110.5 540
-Q(OFFSET 0.000000)-.18 E(DRAFTMUL)110.5 552 Q(TIPL)-.92 E 2.5(Y1)-1 G
-(.000000)-2.5 E(##)110.5 564 Q(## Roll Correction:)110.5 576 Q -.4(RO)
-110.5 588 S(LLBIASMODE 1).4 E -.4(RO)110.5 600 S(LLBIAS 0.500000).4 E
--.4(RO)110.5 612 S(LLBIASPOR).4 E 2.5(T0)-.6 G(.000000)-2.5 E -.4(RO)
-110.5 624 S(LLBIASSTBD 0.000000).4 E 1.6 -.8(To p)108 648 T
-(rocess the data, run mbprocess:).8 E
-(mbprocess \255I0051_20010829_223755.mb57 \255V)128 672 Q
-(The output to the terminal is:)110.5 696 Q(Program mbprocess)110.5 708
-Q -1.11(Ve)110.5 720 S
-(rsion $Id: mbset.ps 2252 2015-07-01 19:35:37Z caress $)1.11 E
-(MB-System 5.0)72 768 Q(10 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E
-(18)185.545 E 0 Cg EP
-%%Page: 19 19
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 164.28(mbset\(1\) MB-System)72 48 R 164.28
-(5.0 mbset\(1\))2.5 F(MB-System V)110.5 84 Q(ersion 5.0.beta07)-1.11 E
-(Program <mbprocess>)110.5 108 Q -1.11(Ve)110.5 120 S
-(rsion $Id: mbset.ps 2252 2015-07-01 19:35:37Z caress $)1.11 E
-(MB-system V)110.5 132 Q(ersion 5.0.beta07)-1.11 E(Program Operation:)
-110.5 156 Q(Input \214le:)115.5 168 Q(0051_20010829_223755.mb57)15 E
--.15(Fo)115.5 180 S 22.5(rmat: 57).15 F
-(Files processed only if out of date.)115.5 192 Q
-(Comments embedded in output.)115.5 204 Q
-(Data processed \255 out of date:)110.5 228 Q 2.5
-(Input: 0051_20010829_223755.mb57)113 240 R
-(Output: 0051_20010829_223755p.mb57)113 252 Q(Input and Output Files:)
-110.5 276 Q -.15(Fo)115.5 288 S 57.5(rmat: 57).15 F(Input \214le:)115.5
-300 Q(0051_20010829_223755.mb57)50 E(Output \214le:)115.5 312 Q
-(0051_20010829_223755p.mb57)47.5 E(Comments in output: ON)115.5 324 Q
-(Na)110.5 348 Q(vig)-.2 E(ation Mer)-.05 E(ging:)-.18 E(Na)115.5 360 Q
-(vig)-.2 E(ation mer)-.05 E(ged from na)-.18 E(vig)-.2 E(ation \214le.)
--.05 E(Heading mer)115.5 372 Q(ged from na)-.18 E(vig)-.2 E
-(ation \214le.)-.05 E(Speed mer)115.5 384 Q(ged from na)-.18 E(vig)-.2 E
-(ation \214le.)-.05 E(Draft mer)115.5 396 Q(ged from na)-.18 E(vig)-.2 E
-(ation \214le.)-.05 E(Na)115.5 408 Q(vig)-.2 E(ation \214le:)-.05 E
-(0051_20010829_223755.mb57.n)37.5 E -.15(ve)-.4 G(Na)115.5 420 Q(vig)-.2
-E(ation algorithm:)-.05 E(linear interpolation)25 E(Na)115.5 432 Q(vig)
--.2 E(ation time shift:)-.05 E(0.000000)22.5 E(Na)110.5 456 Q(vig)-.2 E
-(ation Of)-.05 E(fsets and Shifts:)-.25 E(Na)115.5 468 Q(vig)-.2 E
-(ation positions not shifted.)-.05 E(Adjusted Na)110.5 492 Q(vig)-.2 E
-(ation Mer)-.05 E(ging:)-.18 E(Na)115.5 504 Q(vig)-.2 E(ation not mer)
--.05 E(ged from adjusted na)-.18 E(vig)-.2 E(ation \214le.)-.05 E
-(Adjusted na)115.5 516 Q(vig)-.2 E(ation \214le:)-.05 E(Adjusted na)
-115.5 528 Q(vig)-.2 E(ation algorithm: linear interpolation)-.05 E
-(Data Cutting:)110.5 552 Q(Data cutting disabled.)115.5 564 Q(Bath)110.5
-588 Q(ymetry Editing:)-.05 E(Bath)115.5 600 Q
-(ymetry edits applied from \214le.)-.05 E(Bath)115.5 612 Q
-(ymetry edit \214le:)-.05 E(0051_20010829_223755.mb57.esf)25 E(Bath)
-110.5 636 Q(ymetry Recalculation:)-.05 E(Bath)115.5 648 Q
-(ymetry recalculated by raytracing.)-.05 E(SVP \214le:)115.5 660 Q
-(0051_20010829_223755.mb57.svp)55 E(SSV not modi\214ed.)115.5 672 Q
-(SSV of)115.5 684 Q 25(fset/constant: 0.000000)-.25 F(m/s)2.5 E -.35(Tr)
-115.5 696 S -2.25 -.2(av e).35 H 2.5(lt).2 G(ime multiplier:)-2.5 E
-(1.000000 m)20 E(Bath)110.5 720 Q(ymetry W)-.05 E
-(ater Sound Speed Reference:)-.8 E(MB-System 5.0)72 768 Q(10 No)132.205
-E -.15(ve)-.15 G(mber 2014).15 E(19)185.545 E 0 Cg EP
-%%Page: 20 20
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 164.28(mbset\(1\) MB-System)72 48 R 164.28
-(5.0 mbset\(1\))2.5 F(Output bath)115.5 84 Q(ymetry reference:)-.05 E
-(CORRECTED)7.5 E(Depths recalculated as corrected)115.5 96 Q
-(Draft Correction:)110.5 120 Q(Draft set to constant.)115.5 132 Q
-(Draft constant:)115.5 144 Q(1.950000 m)40 E(Draft of)115.5 156 Q 42.5
-(fset: 0.000000)-.25 F(m)2.5 E(Draft multiplier:)115.5 168 Q(1.000000 m)
-35 E(Hea)110.5 192 Q .3 -.15(ve C)-.2 H(orrection:).15 E(Hea)115.5 204 Q
-.3 -.15(ve n)-.2 H(ot modi\214ed.).15 E(Hea)115.5 216 Q .3 -.15(ve o)-.2
-H -.25(ff).15 G 42.5(set: 0.000000).25 F(m)2.5 E(Hea)115.5 228 Q .3 -.15
-(ve m)-.2 H 32.5(ultiplier: 1.000000).15 F(m)2.5 E(Le)110.5 252 Q -.15
-(ve)-.25 G 2.5(rC).15 G(orrection:)-2.5 E(Le)115.5 264 Q -.15(ve)-.25 G
-2.5(rc).15 G(alculation of)-2.5 E(f.)-.25 E -.35(Ti)110.5 288 S
-(de Correction:).35 E -.35(Ti)115.5 300 S(de calculation of).35 E(f.)
--.25 E(Roll Correction:)110.5 324 Q(Roll of)115.5 336 Q(fset by bias.)
--.25 E(Roll bias:)115.5 348 Q(0.500000 de)52.5 E(g)-.15 E
-(Port roll bias:)115.5 360 Q(0.000000 de)40 E(g)-.15 E
-(Starboard roll bias:)115.5 372 Q(0.000000 de)27.5 E(g)-.15 E
-(Pitch Correction:)110.5 396 Q(Pitch not modi\214ed.)115.5 408 Q
-(Pitch bias:)115.5 420 Q(0.000000 de)50 E(g)-.15 E(Heading Correction:)
-110.5 444 Q(Heading not modi\214ed.)115.5 456 Q(Heading of)115.5 468 Q
-37.5(fset: 0.000000)-.25 F(de)2.5 E(g)-.15 E(Amplitude Corrections:)
-110.5 492 Q(Amplitude correction of)115.5 504 Q(f.)-.25 E
-(Sidescan Corrections:)110.5 528 Q(Sidescan correction of)115.5 540 Q
-(f.)-.25 E(Sidescan Recalculation:)110.5 564 Q
-(Sidescan not recalculated.)115.5 576 Q(Sidescan pix)115.5 588 Q
-(el size:)-.15 E(0.000000)27.5 E(Sidescan sw)115.5 600 Q(ath width:)-.1
-E(0.000000)25 E(Sidescan interpolation:)115.5 612 Q(0)20 E
-(Metadata Insertion:)110.5 636 Q(Metadata v)115.5 648 Q(essel:)-.15 E
-(Metadata institution:)115.5 660 Q(Metadata platform:)115.5 672 Q
-(Metadata sonar:)115.5 684 Q(Metadata sonarv)115.5 696 Q(ersion:)-.15 E
-(Metadata cruiseid:)115.5 708 Q(Metadata cruisename:)115.5 720 Q
-(MB-System 5.0)72 768 Q(10 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E
-(20)185.545 E 0 Cg EP
-%%Page: 21 21
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 164.28(mbset\(1\) MB-System)72 48 R 164.28
-(5.0 mbset\(1\))2.5 F(Metadata pi:)115.5 84 Q(Metadata piinstitution:)
-115.5 96 Q(Metadata client:)115.5 108 Q(Metadata svcorrected:)115.5 120
-Q<ad31>25 E(Metadata tidecorrected)115.5 132 Q<ad31>22.5 E
-(Metadata batheditmanual)115.5 144 Q<ad31>20 E(Metadata batheditauto:)
-115.5 156 Q<ad31>22.5 E(Metadata rollbias:)115.5 168 Q(0.000000)32.5 E
-(Metadata pitchbias:)115.5 180 Q(0.000000)30 E(Metadata headingbias:)
-115.5 192 Q(0.000000)25 E(Metadata draft:)115.5 204 Q(0.000000)40 E
-(236 na)110.5 228 Q(vig)-.2 E(ation records read)-.05 E(Na)110.5 240 Q
-2.5(vs)-.2 G(tart time: 2001 08 29 22:38:02.082999)-2.5 E(Na)110.5 252 Q
-2.5(ve)-.2 G(nd time:)-2.5 E(2001 08 29 23:37:22.322000)7.5 E(47 bath)
-110.5 276 Q(ymetry edits read)-.05 E(236 input data records)110.5 300 Q
-(3587 input na)110.5 312 Q 2.5(vr)-.2 G(ecords)-2.5 E
-(17 input comment records)110.5 324 Q(6617 input other records)110.5 336
-Q(236 output data records)110.5 348 Q(3587 output na)110.5 360 Q 2.5(vr)
--.2 G(ecords)-2.5 E(64 output comment records)110.5 372 Q
-(6617 output other records)110.5 384 Q
-(Generating inf \214le for 0051_20010829_223755p.mb57)110.5 408 Q/F1
-10.95/Times-Bold at 0 SF(SEE ALSO)72 448.8 Q/F2 10/Times-Bold at 0 SF
-(mbsystem)108 460.8 Q F0(\(1\),)A F2(mbpr)2.5 E(ocess)-.18 E F0(\(1\),)A
-F2(mbedit)2.5 E F0(\(1\),)A F2(mbna)2.5 E -.1(ve)-.25 G(dit).1 E F0
-(\(1\),)A F2(mb)2.5 E -.1(ve)-.15 G(locitytool).1 E F0(\(1\))A F1 -.11
-(BU)72 489.6 S(GS).11 E F0(Oh yeah...)108 501.6 Q(MB-System 5.0)72 768 Q
-(10 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E(21)185.545 E 0 Cg EP
-%%Trailer
-end
-%%EOF
diff --git a/src/ps/mbstripnan.ps b/src/ps/mbstripnan.ps
deleted file mode 100644
index 6521a9b..0000000
--- a/src/ps/mbstripnan.ps
+++ /dev/null
@@ -1,286 +0,0 @@
-%!PS-Adobe-3.0
-%%Creator: groff version 1.19.2
-%%CreationDate: Wed Jul  1 12:29:31 2015
-%%DocumentNeededResources: font Times-Roman
-%%+ font Times-Bold
-%%DocumentSuppliedResources: procset grops 1.19 2
-%%Pages: 2
-%%PageOrder: Ascend
-%%DocumentMedia: Default 612 792 0 () ()
-%%Orientation: Portrait
-%%EndComments
-%%BeginDefaults
-%%PageMedia: Default
-%%EndDefaults
-%%BeginProlog
-%%BeginResource: procset grops 1.19 2
-%!PS-Adobe-3.0 Resource-ProcSet
-/setpacking where{
-pop
-currentpacking
-true setpacking
-}if
-/grops 120 dict dup begin
-/SC 32 def
-/A/show load def
-/B{0 SC 3 -1 roll widthshow}bind def
-/C{0 exch ashow}bind def
-/D{0 exch 0 SC 5 2 roll awidthshow}bind def
-/E{0 rmoveto show}bind def
-/F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def
-/G{0 rmoveto 0 exch ashow}bind def
-/H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/I{0 exch rmoveto show}bind def
-/J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def
-/K{0 exch rmoveto 0 exch ashow}bind def
-/L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/M{rmoveto show}bind def
-/N{rmoveto 0 SC 3 -1 roll widthshow}bind def
-/O{rmoveto 0 exch ashow}bind def
-/P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/Q{moveto show}bind def
-/R{moveto 0 SC 3 -1 roll widthshow}bind def
-/S{moveto 0 exch ashow}bind def
-/T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/SF{
-findfont exch
-[exch dup 0 exch 0 exch neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/MF{
-findfont
-[5 2 roll
-0 3 1 roll
-neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/level0 0 def
-/RES 0 def
-/PL 0 def
-/LS 0 def
-/MANUAL{
-statusdict begin/manualfeed true store end
-}bind def
-/PLG{
-gsave newpath clippath pathbbox grestore
-exch pop add exch pop
-}bind def
-/BP{
-/level0 save def
-1 setlinecap
-1 setlinejoin
-72 RES div dup scale
-LS{
-90 rotate
-}{
-0 PL translate
-}ifelse
-1 -1 scale
-}bind def
-/EP{
-level0 restore
-showpage
-}def
-/DA{
-newpath arcn stroke
-}bind def
-/SN{
-transform
-.25 sub exch .25 sub exch
-round .25 add exch round .25 add exch
-itransform
-}bind def
-/DL{
-SN
-moveto
-SN
-lineto stroke
-}bind def
-/DC{
-newpath 0 360 arc closepath
-}bind def
-/TM matrix def
-/DE{
-TM currentmatrix pop
-translate scale newpath 0 0 .5 0 360 arc closepath
-TM setmatrix
-}bind def
-/RC/rcurveto load def
-/RL/rlineto load def
-/ST/stroke load def
-/MT/moveto load def
-/CL/closepath load def
-/Fr{
-setrgbcolor fill
-}bind def
-/setcmykcolor where{
-pop
-/Fk{
-setcmykcolor fill
-}bind def
-}if
-/Fg{
-setgray fill
-}bind def
-/FL/fill load def
-/LW/setlinewidth load def
-/Cr/setrgbcolor load def
-/setcmykcolor where{
-pop
-/Ck/setcmykcolor load def
-}if
-/Cg/setgray load def
-/RE{
-findfont
-dup maxlength 1 index/FontName known not{1 add}if dict begin
-{
-1 index/FID ne{def}{pop pop}ifelse
-}forall
-/Encoding exch def
-dup/FontName exch def
-currentdict end definefont pop
-}bind def
-/DEFS 0 def
-/EBEGIN{
-moveto
-DEFS begin
-}bind def
-/EEND/end load def
-/CNT 0 def
-/level1 0 def
-/PBEGIN{
-/level1 save def
-translate
-div 3 1 roll div exch scale
-neg exch neg exch translate
-0 setgray
-0 setlinecap
-1 setlinewidth
-0 setlinejoin
-10 setmiterlimit
-[]0 setdash
-/setstrokeadjust where{
-pop
-false setstrokeadjust
-}if
-/setoverprint where{
-pop
-false setoverprint
-}if
-newpath
-/CNT countdictstack def
-userdict begin
-/showpage{}def
-/setpagedevice{}def
-}bind def
-/PEND{
-countdictstack CNT sub{end}repeat
-level1 restore
-}bind def
-end def
-/setpacking where{
-pop
-setpacking
-}if
-%%EndResource
-%%EndProlog
-%%BeginSetup
-%%BeginFeature: *PageSize Default
-<< /PageSize [ 612 792 ] /ImagingBBox null >> setpagedevice
-%%EndFeature
-%%IncludeResource: font Times-Roman
-%%IncludeResource: font Times-Bold
-grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72
-def/PL 792 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron/Zcaron
-/scaron/zcaron/Ydieresis/trademark/quotesingle/Euro/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/space/exclam/quotedbl/numbersign/dollar/percent
-/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen
-/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon
-/semicolon/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O
-/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright/circumflex
-/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y
-/z/braceleft/bar/braceright/tilde/.notdef/quotesinglbase/guillemotleft
-/guillemotright/bullet/florin/fraction/perthousand/dagger/daggerdbl
-/endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut
-/dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash
-/quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen
-/brokenbar/section/dieresis/copyright/ordfeminine/guilsinglleft
-/logicalnot/minus/registered/macron/degree/plusminus/twosuperior
-/threesuperior/acute/mu/paragraph/periodcentered/cedilla/onesuperior
-/ordmasculine/guilsinglright/onequarter/onehalf/threequarters
-/questiondown/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE
-/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex
-/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis
-/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn
-/germandbls/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla
-/egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis
-/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide/oslash
-/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis]def
-/Times-Bold at 0 ENC0/Times-Bold RE/Times-Roman at 0 ENC0/Times-Roman RE
-%%EndSetup
-%%Page: 1 1
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 138.73(mbstripNaN\(1\) MB-System)72 48 R 138.73
-(5.0 mbstripNaN\(1\))2.5 F/F1 10.95/Times-Bold at 0 SF -.219(NA)72 84 S(ME)
-.219 E/F2 10/Times-Bold at 0 SF(mbstripNaN)108 96 Q F0 2.5<ad8c>2.5 G
-(lter to remo)-2.5 E .3 -.15(ve N)-.15 H(aN nodes).15 E F1(VERSION)72
-124.8 Q F0 -1.11(Ve)108 136.8 S(rsion 5.0)1.11 E F1(SYNOPSIS)72 165.6 Q
-F2(mbstripNaN)108 177.6 Q F1(DESCRIPTION)72 206.4 Q F2(mbstripNaN)108
-218.4 Q F0 1.492(is a utility for remo)3.992 F 1.491
-(ving NaN nodes that are produced by the GMT utilities)-.15 F F2
-(grd2xyz)3.991 E F0(and)3.991 E F2(blockmean)108 230.4 Q F0
-(with the \255bo option.)2.5 E(The standard output of)5 E F2(mbstripNaN)
-2.5 E F0(may be fed into the standard input of)2.5 E F2(surface)108
-242.4 Q F0 .576(with the \255bi option.)3.077 F .576
-(This is used by the)5.576 F F2(mbm_grd2geo)3.076 E(vrml)-.1 E F0 .576
-(utility in order to spline \214ll areas of)3.076 F .584
-(no data so that irre)108 254.4 R .584(gular bath)-.15 F .584
-(ymetry may be ef)-.05 F(fecti)-.25 E -.15(ve)-.25 G .584
-(ly visualized using GeoVRML which has no concept).15 F(of NaN.)108
-266.4 Q(Note that)108 290.4 Q F2(mbstripNaN)2.5 E F0 -.1(wo)2.5 G
-(rks with a double precision data stream.).1 E(The code is simple.)108
-314.4 Q(Here it is:)5 E(#include <stdio.h>)113 338.4 Q
-(#include <math.h>)113 350.4 Q(/*)113 374.4 Q 2.5(*R)115.5 386.4 S
-(ead double x,y)-2.5 E(,z on stdin and send to stdout all)-.65 E 2.5(*t)
-115.5 398.4 S(riplets b)-2.5 E(ut ones where z == NaN)-.2 E(*/)115.5
-410.4 Q(main \(\) {)113 422.4 Q
-(struct node { double lon, lat, height; };)149 434.4 Q(struct node n;)
-149 446.4 Q(while \( \( fread\(&n, 24, 1, stdin\) > 0 \) \) {)149 458.4
-Q(if \( ! isnan\(n.height\) \) {)185 470.4 Q
-(fwrite\(&n, 24, 1, stdout\);)221 482.4 Q(})185 494.4 Q(})149 506.4 Q(})
-115.5 518.4 Q F1(EXAMPLE)72 559.2 Q F0(This is a command that)108 571.2
-Q F2(mbm_grd2geo)2.5 E(vrml)-.1 E F0(constructs and e)2.5 E -.15(xe)-.15
-G(cutes:).15 E(#)113 595.2 Q 2.5(#C)113 607.2 S(on)-2.5 E -.15(ve)-.4 G
-(rt grid to xyz format for \214lling in blank).15 E 2.5(#a)113 619.2 S
-(reas, preprocess w/blockmean, use surf)-2.5 E(ace to)-.1 E 2.5(#e)113
-631.2 S(xtrapolate to no data areas)-2.65 E(#)113 643.2 Q
-(grd2xyz \255bo Samp_Ore)113 655.2 Q(gonMar)-.15 E
-(ginI_bath.grd | blockmean \\)-.18 E
-(\255bi \255bo \255V \255I0.00336363636363635/0.00134545454545457 \\)118
-667.2 Q(\255R-125.2/-124.867/45/45.1332 | mbstripNaN | surf)118 679.2 Q
-(ace \\)-.1 E(\255bi \255I0.00336363636363635/0.00134545454545457 \\)118
-691.2 Q(\255S0.333312 \255T0.35 \255GTmp_Ore)118 703.2 Q(gonMar)-.15 E
-(ginI_bath.grd \255V \\)-.18 E(\255R-125.2/-124.867/45/45.1332)118 715.2
-Q(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(1)204.835 E 0
-Cg EP
-%%Page: 2 2
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 138.73(mbstripNaN\(1\) MB-System)72 48 R 138.73
-(5.0 mbstripNaN\(1\))2.5 F/F1 10.95/Times-Bold at 0 SF(SEE ALSO)72 84 Q/F2
-10/Times-Bold at 0 SF(grd2xyz)108 96 Q F0(\(1\),)A F2(blockmean)2.5 E F0
-(\(1\),)A F2(surface)2.5 E F0(\(1\),)A F2(mbm_grd2geo)2.5 E(vrml)-.1 E
-F0(\(1\))A F1 -.11(BU)72 148.8 S(GS).11 E F0(Ho)108 160.8 Q 2.5(wm)-.25
-G(an)-2.5 E 2.5(yb)-.15 G(ugs can there be in an 8 line program?)-2.7 E
-(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(2)204.835 E 0
-Cg EP
-%%Trailer
-end
-%%EOF
diff --git a/src/ps/mbsvplist.ps b/src/ps/mbsvplist.ps
deleted file mode 100644
index ab349d1..0000000
--- a/src/ps/mbsvplist.ps
+++ /dev/null
@@ -1,438 +0,0 @@
-%!PS-Adobe-3.0
-%%Creator: groff version 1.19.2
-%%CreationDate: Wed Jul  1 12:29:31 2015
-%%DocumentNeededResources: font Times-Roman
-%%+ font Times-Bold
-%%+ font Times-Italic
-%%DocumentSuppliedResources: procset grops 1.19 2
-%%Pages: 3
-%%PageOrder: Ascend
-%%DocumentMedia: Default 612 792 0 () ()
-%%Orientation: Portrait
-%%EndComments
-%%BeginDefaults
-%%PageMedia: Default
-%%EndDefaults
-%%BeginProlog
-%%BeginResource: procset grops 1.19 2
-%!PS-Adobe-3.0 Resource-ProcSet
-/setpacking where{
-pop
-currentpacking
-true setpacking
-}if
-/grops 120 dict dup begin
-/SC 32 def
-/A/show load def
-/B{0 SC 3 -1 roll widthshow}bind def
-/C{0 exch ashow}bind def
-/D{0 exch 0 SC 5 2 roll awidthshow}bind def
-/E{0 rmoveto show}bind def
-/F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def
-/G{0 rmoveto 0 exch ashow}bind def
-/H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/I{0 exch rmoveto show}bind def
-/J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def
-/K{0 exch rmoveto 0 exch ashow}bind def
-/L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/M{rmoveto show}bind def
-/N{rmoveto 0 SC 3 -1 roll widthshow}bind def
-/O{rmoveto 0 exch ashow}bind def
-/P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/Q{moveto show}bind def
-/R{moveto 0 SC 3 -1 roll widthshow}bind def
-/S{moveto 0 exch ashow}bind def
-/T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/SF{
-findfont exch
-[exch dup 0 exch 0 exch neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/MF{
-findfont
-[5 2 roll
-0 3 1 roll
-neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/level0 0 def
-/RES 0 def
-/PL 0 def
-/LS 0 def
-/MANUAL{
-statusdict begin/manualfeed true store end
-}bind def
-/PLG{
-gsave newpath clippath pathbbox grestore
-exch pop add exch pop
-}bind def
-/BP{
-/level0 save def
-1 setlinecap
-1 setlinejoin
-72 RES div dup scale
-LS{
-90 rotate
-}{
-0 PL translate
-}ifelse
-1 -1 scale
-}bind def
-/EP{
-level0 restore
-showpage
-}def
-/DA{
-newpath arcn stroke
-}bind def
-/SN{
-transform
-.25 sub exch .25 sub exch
-round .25 add exch round .25 add exch
-itransform
-}bind def
-/DL{
-SN
-moveto
-SN
-lineto stroke
-}bind def
-/DC{
-newpath 0 360 arc closepath
-}bind def
-/TM matrix def
-/DE{
-TM currentmatrix pop
-translate scale newpath 0 0 .5 0 360 arc closepath
-TM setmatrix
-}bind def
-/RC/rcurveto load def
-/RL/rlineto load def
-/ST/stroke load def
-/MT/moveto load def
-/CL/closepath load def
-/Fr{
-setrgbcolor fill
-}bind def
-/setcmykcolor where{
-pop
-/Fk{
-setcmykcolor fill
-}bind def
-}if
-/Fg{
-setgray fill
-}bind def
-/FL/fill load def
-/LW/setlinewidth load def
-/Cr/setrgbcolor load def
-/setcmykcolor where{
-pop
-/Ck/setcmykcolor load def
-}if
-/Cg/setgray load def
-/RE{
-findfont
-dup maxlength 1 index/FontName known not{1 add}if dict begin
-{
-1 index/FID ne{def}{pop pop}ifelse
-}forall
-/Encoding exch def
-dup/FontName exch def
-currentdict end definefont pop
-}bind def
-/DEFS 0 def
-/EBEGIN{
-moveto
-DEFS begin
-}bind def
-/EEND/end load def
-/CNT 0 def
-/level1 0 def
-/PBEGIN{
-/level1 save def
-translate
-div 3 1 roll div exch scale
-neg exch neg exch translate
-0 setgray
-0 setlinecap
-1 setlinewidth
-0 setlinejoin
-10 setmiterlimit
-[]0 setdash
-/setstrokeadjust where{
-pop
-false setstrokeadjust
-}if
-/setoverprint where{
-pop
-false setoverprint
-}if
-newpath
-/CNT countdictstack def
-userdict begin
-/showpage{}def
-/setpagedevice{}def
-}bind def
-/PEND{
-countdictstack CNT sub{end}repeat
-level1 restore
-}bind def
-end def
-/setpacking where{
-pop
-setpacking
-}if
-%%EndResource
-%%EndProlog
-%%BeginSetup
-%%BeginFeature: *PageSize Default
-<< /PageSize [ 612 792 ] /ImagingBBox null >> setpagedevice
-%%EndFeature
-%%IncludeResource: font Times-Roman
-%%IncludeResource: font Times-Bold
-%%IncludeResource: font Times-Italic
-grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72
-def/PL 792 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron/Zcaron
-/scaron/zcaron/Ydieresis/trademark/quotesingle/Euro/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/space/exclam/quotedbl/numbersign/dollar/percent
-/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen
-/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon
-/semicolon/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O
-/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright/circumflex
-/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y
-/z/braceleft/bar/braceright/tilde/.notdef/quotesinglbase/guillemotleft
-/guillemotright/bullet/florin/fraction/perthousand/dagger/daggerdbl
-/endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut
-/dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash
-/quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen
-/brokenbar/section/dieresis/copyright/ordfeminine/guilsinglleft
-/logicalnot/minus/registered/macron/degree/plusminus/twosuperior
-/threesuperior/acute/mu/paragraph/periodcentered/cedilla/onesuperior
-/ordmasculine/guilsinglright/onequarter/onehalf/threequarters
-/questiondown/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE
-/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex
-/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis
-/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn
-/germandbls/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla
-/egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis
-/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide/oslash
-/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis]def
-/Times-Italic at 0 ENC0/Times-Italic RE/Times-Bold at 0 ENC0/Times-Bold RE
-/Times-Roman at 0 ENC0/Times-Roman RE
-%%EndSetup
-%%Page: 1 1
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 149.27(mbsvplist\(1\) MB-System)72 48 R 149.27
-(5.0 mbsvplist\(1\))2.5 F/F1 10.95/Times-Bold at 0 SF -.219(NA)72 84 S(ME)
-.219 E/F2 10/Times-Bold at 0 SF(mbsvplist)108 96 Q F0 2.5<ad4c>2.5 G(ist w)
--2.5 E(ater sound v)-.1 E(elocity pro\214les in sw)-.15 E
-(ath sonar data \214les.)-.1 E F1(VERSION)72 124.8 Q F0 -1.11(Ve)108
-136.8 S(rsion 5.0)1.11 E F1(SYNOPSIS)72 165.6 Q F2(mbsvplist)108 177.6 Q
-F0([)2.5 E F2<ad4320ad4420ad46>A/F3 10/Times-Italic at 0 SF(format)A F2
-<ad4820ad49>2.5 E F3(\214le)A F2<ad4d>2.5 E F3(mode)A F2
-(\255O \255P \255S \255V \255Z])2.5 E F1(DESCRIPTION)72 206.4 Q F0 .59
-(This program,)108 218.4 R F2(mbsvplist)3.09 E F0 3.09(,l)C .59
-(ists all w)-3.09 F .59(ater sound v)-.1 F .59
-(elocity pro\214les \(SVPs\) within sw)-.15 F .59(ath data \214les.)-.1
-F(Sw)5.59 E .59(ath ba-)-.1 F(th)108 230.4 Q 1.478
-(ymetry is calculated from ra)-.05 F 3.978(wa)-.15 G 1.478
-(ngles and tra)-3.978 F -.15(ve)-.2 G 3.978(lt).15 G 1.478
-(imes by raytracing through a model of the speed of)-3.978 F .3
-(sound in w)108 242.4 R(ater)-.1 E 2.8(.M)-.55 G(an)-2.8 E 2.8(ys)-.15 G
--.1(wa)-2.8 G .3(th data formats allo).1 F 2.8(wS)-.25 G .3
-(VPs to be embedded in the data, and often the SVPs used)-2.8 F 1.09
-(to calculate the data will be included.)108 254.4 R 1.091(By def)6.09 F
-1.091(ault, all unique SVPs encountered are listed to stdout. The)-.1 F
-.462(SVPs may instead be written to indi)108 266.4 R .461
-(vidual \214les with names FILE_XXX.svp, where FILE is the sw)-.25 F
-.461(ath data)-.1 F .899(\214lename and XXX is the SVP count within the\
- \214le. The SVP \214les output by)108 278.4 R F2(mbsvplist)3.399 E F0
-.899(include a header)3.399 F 1.041(line starting with "## MB-SVP" and \
-including the timestamp and location of the SVP record as inferred)108
-290.4 R .645(from its location in the \214le. This header record is rec\
-ognized by the program)108 302.4 R F2(mbsvpselect)3.145 E F0 .645
-(which uses the)3.145 F .484
-(information to select the best SVP models to apply to sw)108 314.4 R
-.484(ath data \214les for bath)-.1 F .483(ymetry recalculation.)-.05 F
-(Some)5.483 E 1.363(\214les contain SVPs at re)108 326.4 R 1.363
-(gular interv)-.15 F 1.363
-(als, typically with the same SVP duplicated man)-.25 F 3.864(yt)-.15 G
-1.364(imes. By def)-3.864 F(ault,)-.1 E F2(mbsvplist)108 338.4 Q F0
-1.522(ignores duplicate SVPs. The)4.022 F F2<ad44>4.022 E F0 1.522
-(option causes duplicate SVPs to be output.)4.022 F(The)6.522 E F2<ad50>
-4.022 E F0(option)4.022 E(implies)108 350.4 Q F2<ad4f>3.885 E F0 3.885
-(,a)C 1.386(nd also causes the parameter \214le to be modi\214ed so tha\
-t the \214rst SVP output for each \214le)-3.885 F .163
-(becomes the SVP used for recalculating bath)108 362.4 R .163
-(ymetry for that sw)-.05 F .163(ath \214le.)-.1 F(The)5.163 E F2<ad43>
-2.663 E F0 .163(option causes)2.663 F F2(mbsvplist)2.663 E F0(to)2.663 E
-.464(output the number of unique SVPs in a \214le to the shell \(standa\
-rd out\).)108 374.4 R(The)5.464 E F2<ad53>2.964 E F0 .464(option causes)
-2.964 F F2(mbsvplist)2.964 E F0(to)2.964 E .159(output the sound v)108
-386.4 R .159(elocity v)-.15 F .159
-(alues used for beamforming by the sonar \(often called surf)-.25 F .158
-(ace sound v)-.1 F(elocity)-.15 E 2.658(,o)-.65 G(r)-2.658 E .151
-(SSV\) instead of SVP pro\214les. Each SSV v)108 398.4 R .152
-(alue will be paired with the corresponding sonar depth, and there)-.25
-F(will generally be one SSV v)108 410.4 Q(alue output for each surv)-.25
-E .3 -.15(ey p)-.15 H(ing.).15 E F1 -.548(AU)72 439.2 S(THORSHIP).548 E
-F0(Da)108 451.2 Q(vid W)-.2 E 2.5(.C)-.92 G(aress \(caress at mbari.or)-2.5
-E(g\))-.18 E(Montere)113 463.2 Q 2.5(yB)-.15 G
-(ay Aquarium Research Institute)-2.5 E
-(Dale N. Chayes \(dale at ldeo.columbia.edu\))108 475.2 Q
-(Lamont-Doherty Earth Observ)113 487.2 Q(atory)-.25 E F1(OPTIONS)72 516
-Q F2<ad43>108 528 Q F0(Causes)144 540 Q F2(mbsvplist)2.5 E F0(to output\
- the number of unique SVPs in each \214le to the shell \(standard out\)\
-.)2.5 E F2<ad44>108 556.8 Q F0(Causes)144 568.8 Q F2(mbsvplist)2.5 E F0
-(to output duplicate SVPs. This is equi)2.5 E -.25(va)-.25 G(lent to).25
-E F2<ad4d>2.5 E F3(2)A F0(.)A F2<ad46>108 585.6 Q F3(format)24.19 E F0
-.423(Sets the format for the input sw)144 597.6 R .423
-(ath sonar data using)-.1 F F2(MBIO)2.922 E F0(inte)2.922 E .422
-(ger format identi\214ers.)-.15 F(If)5.422 E F3(format)2.922 E F0(<)
-2.922 E .717(0, then the input \214le speci\214ed with the)144 609.6 R
-F2<ad49>3.217 E F0 .717(option will actually contain a list of input sw)
-3.217 F .718(ath sonar)-.1 F .81(data \214les.)144 621.6 R .81
-(This program uses the)5.81 F F2(MBIO)3.309 E F0 .809
-(library and will read an)3.309 F 3.309(ys)-.15 G -.1(wa)-3.309 G .809
-(th sonar format supported).1 F(by)144 633.6 Q F2(MBIO)2.588 E F0 2.588
-(.Al)C .089(ist of the sw)-2.588 F .089
-(ath sonar data formats currently supported by)-.1 F F2(MBIO)2.589 E F0
-.089(and their identi\214er)2.589 F -.25(va)144 645.6 S(lues is gi).25 E
--.15(ve)-.25 G 2.5(ni).15 G 2.5(nt)-2.5 G(he)-2.5 E F2(MBIO)2.5 E F0
-(manual page.)2.5 E F2<ad48>108 662.4 Q F0 .162(This "help" \215ag caus\
-e the program to print out a description of its operation and then e)
-22.52 F .161(xit immedi-)-.15 F(ately)144 674.4 Q(.)-.65 E F2<ad49>108
-691.2 Q F3(\214le)26.41 E F0 .312(Sets the input \214lename. If)144
-703.2 R F3(format)2.813 E F0 2.813(>0\()2.813 G .313(set with the)-2.813
-F F2<ad46>2.813 E F0 .313(option\) then the sw)2.813 F .313
-(ath sonar data contained)-.1 F(in)144 715.2 Q F3(\214le)2.956 E F0 .456
-(is read and processed. If)2.956 F F3(format)2.956 E F0 2.956(<0)2.956 G
-2.956(,t)-2.956 G(hen)-2.956 E F3(\214le)2.956 E F0 .455
-(is assumed to be an ascii \214le containing a list)2.956 F .869
-(of the input sw)144 727.2 R .869
-(ath sonar data \214les to be processed and their formats.)-.1 F .87
-(The program will read the)5.87 F(MB-System 5.0)72 768 Q(17 March 2014)
-140.11 E(1)198.45 E 0 Cg EP
-%%Page: 2 2
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 149.27(mbsvplist\(1\) MB-System)72 48 R 149.27
-(5.0 mbsvplist\(1\))2.5 F .664(data in each one of these \214les.)144 84
-R .664(In the)5.664 F/F1 10/Times-Italic at 0 SF(\214le)3.164 E F0 .663
-(\214le, each data \214le should be follo)3.164 F .663
-(wed by a data format)-.25 F(identi\214er)144 96 Q 2.5(,e)-.4 G(.g.:)
--2.5 E(data\214le1 11)180 108 Q(data\214le2 24)180 120 Q .568
-(This program uses the)144 132 R/F2 10/Times-Bold at 0 SF(MBIO)3.068 E F0
-.568(library and will read or write an)3.068 F 3.068(ys)-.15 G -.1(wa)
--3.068 G .568(th sonar format supported by).1 F F2(MBIO)144 144 Q F0
-3.428(.Al)C .928(ist of the sw)-3.428 F .928
-(ath sonar data formats currently supported by)-.1 F F2(MBIO)3.428 E F0
-.928(and their identi\214er)3.428 F -.25(va)144 156 S(lues is gi).25 E
--.15(ve)-.25 G 2.5(ni).15 G 2.5(nt)-2.5 G(he)-2.5 E F2(MBIO)2.5 E F0
-(manual page. Def)2.5 E(ault:)-.1 E F1(\214le)2.5 E F0 2.5(=")2.5 G
-(datalist.mb-1".)-2.5 E F2<ad4d>108 172.8 Q F1(mode)20.86 E F0 .536
-(Sets the SVP output mode. If)144 184.8 R F1(mode)3.036 E F0 .536
-(=0 \(the def)B .536
-(ault\), then the \214rst SVP of each \214le will be output,)-.1 F .879
-(plus an)144 196.8 R 3.379(yS)-.15 G .879(VP that is dif)-3.379 F .878
-(ferent from the pre)-.25 F .878(vious SVP)-.25 F 5.878(.I)-1.11 G(f)
--5.878 E F1(mode)3.378 E F0 .878(=1, then only the \214rst instance of)B
-.024(each unique SVP will be output, e)144 208.8 R -.15(ve)-.25 G 2.524
-(nt).15 G .025
-(hrough multiple \214les referenced through a datalist structure.)-2.524
-F(If)144 220.8 Q F1(mode)2.5 E F0(=2, then all SVPs will be output e)A
--.15(ve)-.25 G 2.5(ni).15 G 2.5(ft)-2.5 G(he)-2.5 E 2.5(ya)-.15 G
-(re duplicates \(equi)-2.5 E -.25(va)-.25 G(lent to the).25 E F2<ad44>
-2.5 E F0(option\).)2.5 E F2<ad4f>108 237.6 Q F0 .316(By def)144 249.6 R
-(ault,)-.1 E F2(mbsvplist)2.816 E F0 .315(writes the SVP records to std\
-out. This option causes the program to instead)2.816 F 1.249
-(write the SVPs to indi)144 261.6 R 1.249
-(vidual \214les with names FILE_XXX.svp, where FILE is the source sw)
--.25 F(ath)-.1 E
-(data \214lename and XXX is the SVP count within the \214le.)144 273.6 Q
-F2<ad50>108 290.4 Q F0 1.042(This option implies the output option)144
-302.4 R F2<ad4f>3.542 E F0 3.542(.A)C(dditionally)-3.542 E 3.542(,t)-.65
-G 1.042(his option sets the \214rst SVP output for)-3.542 F .154
-(each sw)144 314.4 R .154
-(ath\214le to be used for recalculating the bath)-.1 F .155
-(ymetry in that sw)-.05 F .155(ath\214le by)-.1 F F2(mbpr)2.655 E(ocess)
--.18 E F0 .155(by mod-)2.655 F(ifying the associated parameter \214le.)
-144 326.4 Q F2<ad53>108 343.2 Q F0 1.253(This option causes)144 355.2 R
-F2(mbsvplist)3.752 E F0 1.252(to output the sound v)3.752 F 1.252
-(elocity v)-.15 F 1.252(alues used for beamforming by the)-.25 F .646
-(sonar \(often called surf)144 367.2 R .646(ace sound v)-.1 F(elocity)
--.15 E 3.147(,o)-.65 G 3.147(rS)-3.147 G .647
-(SV\) instead of SVP pro\214les. Each SSV v)-3.147 F .647(alue will)-.25
-F .014(be paired with the corresponding sonar depth, and in general one\
- depth-SSV pair will be output for)144 379.2 R(each surv)144 391.2 Q .3
--.15(ey p)-.15 H(ing.).15 E F2<ad56>108 408 Q F0(Normally)23.08 E(,)-.65
-E F2(mbsvplist)3.076 E F0 -.1(wo)3.076 G .576
-(rks "silently" without outputting an).1 F .576
-(ything to the stderr stream.)-.15 F .577(If the)5.576 F F2<ad56>3.077 E
-F0 .525(\215ag is gi)144 420 R -.15(ve)-.25 G .525(n, then).15 F F2
-(mblist)3.025 E F0 -.1(wo)3.025 G .525(rks in a "v).1 F .525
-(erbose" mode and outputs the program v)-.15 F .525(ersion being used)
--.15 F(and all error status messages.)144 432 Q F2<ad5a>108 448.8 Q F0
-(Normally)23.63 E(,)-.65 E F2(mbsvplist)3.159 E F0 -.1(fa)3.159 G .659
-(ithfully outputs the SVP data just as it is stored in the sw).1 F .66
-(ath \214les. Rarely)-.1 F(,)-.65 E .933(sonars may store SVP data with\
- a nonzero depth for the \214rst sound speed v)144 460.8 R .933
-(alue, a circumstance)-.25 F 2.375(that causes problems with bath)144
-472.8 R 2.375(ymetry recalculation using)-.05 F F2(mbpr)4.876 E(ocess)
--.18 E F0 4.876(.T)C(he)-4.876 E F2<ad5a>4.876 E F0 2.376(option causes)
-4.876 F F2(mbsvplist)144 484.8 Q F0(to replace the \214rst depth v)2.5 E
-(alue with zero before outputting the SVP)-.25 E(.)-1.11 E/F3 10.95
-/Times-Bold at 0 SF(EXAMPLES)72 513.6 Q F0 .402(Suppose one wishes to obta\
-in an SVP list from a Simrad EM300 data \214le in the MB)108 525.6 R
-.402(ARI format \(MBIO id)-.35 F(57\) called mbari_1998_107_msn.mb57. T)
-108 537.6 Q 2.5(oo)-.8 G(btain a listing to stdout, the follo)-2.5 E
-(wing will suf)-.25 E(\214ce:)-.25 E
-(mbsvplist \255F57 \255I mbari_1998_526_msn.mb57 \255V)144 561.6 Q
-(The output will be as follo)108 585.6 Q(ws:)-.25 E(Program mbsvplist)
-110.5 609.6 Q -1.11(Ve)110.5 621.6 S
-(rsion $Id: mbsvplist.ps 2252 2015-07-01 19:35:37Z caress $)1.11 E
-(MB-system V)110.5 633.6 Q(ersion 5.0)-1.11 E
-(Searching mbari_1998_526_msn.mb57 for SVP records)110.5 657.6 Q
-(Outputting SVP to \214le:)110.5 669.6 Q(## W)110.5 681.6 Q
-(ater Sound V)-.8 E(elocity Pro\214le \(SVP\))-1.11 E
-(## Output by Program mbsvplist)110.5 693.6 Q(## Program V)110.5 705.6 Q
-(ersion $Id: mbsvplist.ps 2252 2015-07-01 19:35:37Z caress $)-1.11 E
-(## MB-System V)110.5 717.6 Q(ersion 5.0.alpha01)-1.11 E
-(## Run by user <caress> on cpu <menard> at <Thu Jan)110.5 729.6 Q 2.5
-(41)5 G(3:36:44 2001>)-2.5 E(MB-System 5.0)72 768 Q(17 March 2014)140.11
-E(2)198.45 E 0 Cg EP
-%%Page: 3 3
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 149.27(mbsvplist\(1\) MB-System)72 48 R 149.27
-(5.0 mbsvplist\(1\))2.5 F(## Sw)110.5 84 Q
-(ath File: mbari_1998_526_msn.mb57)-.1 E(## Start T)110.5 96 Q
-(ime: 1998/05/02 01:33:08.300000)-.35 E(## SVP Count: 1)110.5 108 Q
-(## Number of SVP Points: 15)110.5 120 Q 17.5(0.00 1503.50)120.5 132 R
-17.5(9.99 1502.70)120.5 144 R 17.5(19.98 1501.80)118 156 R 17.5
-(30.00 1501.40)118 168 R 17.5(39.99 1501.40)118 180 R 17.5
-(49.98 1499.90)118 192 R 17.5(60.00 1499.80)118 204 R 17.5
-(69.99 1497.50)118 216 R 17.5(79.98 1496.90)118 228 R 17.5
-(90.00 1496.90)118 240 R 17.5(99.99 1495.10)118 252 R 17.5
-(198.99 1486.60)115.5 264 R 17.5(498.99 1480.60)115.5 276 R 17.5
-(1000.98 1481.90)113 288 R 17.5(1830.00 1488.70)113 300 R(##)110.5 312 Q
-(##)110.5 324 Q 2.5(4S)110.5 336 S(VP records read)-2.5 E 2.5(1S)110.5
-348 S(VP records written)-2.5 E -.8(To)108 372 S
-(tal 4 SVP records read T).8 E(otal 1 SVP records written)-.8 E/F1 10.95
-/Times-Bold at 0 SF(SEE ALSO)72 400.8 Q/F2 10/Times-Bold at 0 SF(mbsystem)108
-412.8 Q F0(\(1\),)A F2(mbpr)2.5 E(ocess)-.18 E F0(\(1\),)A F2
-(mbsvpselect)2.5 E F0(\(1\))A F1 -.11(BU)72 441.6 S(GS).11 E F0
-(Probably)108 453.6 Q(.)-.65 E(MB-System 5.0)72 768 Q(17 March 2014)
-140.11 E(3)198.45 E 0 Cg EP
-%%Trailer
-end
-%%EOF
diff --git a/src/ps/mbsvpselect.ps b/src/ps/mbsvpselect.ps
deleted file mode 100644
index aedaefa..0000000
--- a/src/ps/mbsvpselect.ps
+++ /dev/null
@@ -1,509 +0,0 @@
-%!PS-Adobe-3.0
-%%Creator: groff version 1.19.2
-%%CreationDate: Wed Jul  1 12:29:31 2015
-%%DocumentNeededResources: font Times-Roman
-%%+ font Times-Bold
-%%+ font Times-Italic
-%%DocumentSuppliedResources: procset grops 1.19 2
-%%Pages: 4
-%%PageOrder: Ascend
-%%DocumentMedia: Default 612 792 0 () ()
-%%Orientation: Portrait
-%%EndComments
-%%BeginDefaults
-%%PageMedia: Default
-%%EndDefaults
-%%BeginProlog
-%%BeginResource: procset grops 1.19 2
-%!PS-Adobe-3.0 Resource-ProcSet
-/setpacking where{
-pop
-currentpacking
-true setpacking
-}if
-/grops 120 dict dup begin
-/SC 32 def
-/A/show load def
-/B{0 SC 3 -1 roll widthshow}bind def
-/C{0 exch ashow}bind def
-/D{0 exch 0 SC 5 2 roll awidthshow}bind def
-/E{0 rmoveto show}bind def
-/F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def
-/G{0 rmoveto 0 exch ashow}bind def
-/H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/I{0 exch rmoveto show}bind def
-/J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def
-/K{0 exch rmoveto 0 exch ashow}bind def
-/L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/M{rmoveto show}bind def
-/N{rmoveto 0 SC 3 -1 roll widthshow}bind def
-/O{rmoveto 0 exch ashow}bind def
-/P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/Q{moveto show}bind def
-/R{moveto 0 SC 3 -1 roll widthshow}bind def
-/S{moveto 0 exch ashow}bind def
-/T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/SF{
-findfont exch
-[exch dup 0 exch 0 exch neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/MF{
-findfont
-[5 2 roll
-0 3 1 roll
-neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/level0 0 def
-/RES 0 def
-/PL 0 def
-/LS 0 def
-/MANUAL{
-statusdict begin/manualfeed true store end
-}bind def
-/PLG{
-gsave newpath clippath pathbbox grestore
-exch pop add exch pop
-}bind def
-/BP{
-/level0 save def
-1 setlinecap
-1 setlinejoin
-72 RES div dup scale
-LS{
-90 rotate
-}{
-0 PL translate
-}ifelse
-1 -1 scale
-}bind def
-/EP{
-level0 restore
-showpage
-}def
-/DA{
-newpath arcn stroke
-}bind def
-/SN{
-transform
-.25 sub exch .25 sub exch
-round .25 add exch round .25 add exch
-itransform
-}bind def
-/DL{
-SN
-moveto
-SN
-lineto stroke
-}bind def
-/DC{
-newpath 0 360 arc closepath
-}bind def
-/TM matrix def
-/DE{
-TM currentmatrix pop
-translate scale newpath 0 0 .5 0 360 arc closepath
-TM setmatrix
-}bind def
-/RC/rcurveto load def
-/RL/rlineto load def
-/ST/stroke load def
-/MT/moveto load def
-/CL/closepath load def
-/Fr{
-setrgbcolor fill
-}bind def
-/setcmykcolor where{
-pop
-/Fk{
-setcmykcolor fill
-}bind def
-}if
-/Fg{
-setgray fill
-}bind def
-/FL/fill load def
-/LW/setlinewidth load def
-/Cr/setrgbcolor load def
-/setcmykcolor where{
-pop
-/Ck/setcmykcolor load def
-}if
-/Cg/setgray load def
-/RE{
-findfont
-dup maxlength 1 index/FontName known not{1 add}if dict begin
-{
-1 index/FID ne{def}{pop pop}ifelse
-}forall
-/Encoding exch def
-dup/FontName exch def
-currentdict end definefont pop
-}bind def
-/DEFS 0 def
-/EBEGIN{
-moveto
-DEFS begin
-}bind def
-/EEND/end load def
-/CNT 0 def
-/level1 0 def
-/PBEGIN{
-/level1 save def
-translate
-div 3 1 roll div exch scale
-neg exch neg exch translate
-0 setgray
-0 setlinecap
-1 setlinewidth
-0 setlinejoin
-10 setmiterlimit
-[]0 setdash
-/setstrokeadjust where{
-pop
-false setstrokeadjust
-}if
-/setoverprint where{
-pop
-false setoverprint
-}if
-newpath
-/CNT countdictstack def
-userdict begin
-/showpage{}def
-/setpagedevice{}def
-}bind def
-/PEND{
-countdictstack CNT sub{end}repeat
-level1 restore
-}bind def
-end def
-/setpacking where{
-pop
-setpacking
-}if
-%%EndResource
-%%EndProlog
-%%BeginSetup
-%%BeginFeature: *PageSize Default
-<< /PageSize [ 612 792 ] /ImagingBBox null >> setpagedevice
-%%EndFeature
-%%IncludeResource: font Times-Roman
-%%IncludeResource: font Times-Bold
-%%IncludeResource: font Times-Italic
-grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72
-def/PL 792 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron/Zcaron
-/scaron/zcaron/Ydieresis/trademark/quotesingle/Euro/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/space/exclam/quotedbl/numbersign/dollar/percent
-/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen
-/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon
-/semicolon/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O
-/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright/circumflex
-/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y
-/z/braceleft/bar/braceright/tilde/.notdef/quotesinglbase/guillemotleft
-/guillemotright/bullet/florin/fraction/perthousand/dagger/daggerdbl
-/endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut
-/dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash
-/quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen
-/brokenbar/section/dieresis/copyright/ordfeminine/guilsinglleft
-/logicalnot/minus/registered/macron/degree/plusminus/twosuperior
-/threesuperior/acute/mu/paragraph/periodcentered/cedilla/onesuperior
-/ordmasculine/guilsinglright/onequarter/onehalf/threequarters
-/questiondown/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE
-/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex
-/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis
-/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn
-/germandbls/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla
-/egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis
-/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide/oslash
-/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis]def
-/Times-Italic at 0 ENC0/Times-Italic RE/Times-Bold at 0 ENC0/Times-Bold RE
-/Times-Roman at 0 ENC0/Times-Roman RE
-%%EndSetup
-%%Page: 1 1
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 138.73(mbsvpselect\(1\) MB-System)72 48 R 138.73
-(5.0 mbsvpselect\(1\))2.5 F/F1 10.95/Times-Bold at 0 SF -.219(NA)72 84 S
-(ME).219 E/F2 10/Times-Bold at 0 SF(mbsvpselect)108 96 Q F0 3.038<ad4d>
-3.038 G .538(bsvpselect chooses and implements the best a)-3.038 F -.25
-(va)-.2 G .538(ilable sound speed model for each sw).25 F(ath)-.1 E
-(\214le in a surv)108 108 Q -.15(ey)-.15 G F1(VERSION)72 136.8 Q F0
--1.11(Ve)108 148.8 S(rsion 5.0)1.11 E F1(SYNOPSIS)72 177.6 Q F0
-(mbsvpselect -N -V -Idatalist -Ssvplist -Pmode[/criteria[/submode]])108
-189.6 Q .816([-P0, -P1, -P2/period, -P3/range, -P3/range/1])108 213.6 R
-F2(mbsvpselect)3.316 E F0([)3.316 E F2 .816<ad4320ad4420ad46>B/F3 10
-/Times-Italic at 0 SF(format)A F2 .816<ad4820ad49>3.316 F F3(\214le)A F2
-<ad4d>3.316 E F3(mode)A F2 .817<ad4f20ad50>3.317 F(\255S \255V \255Z])
-108 225.6 Q F1(DESCRIPTION)72 254.4 Q F0 .414
-(Mbsvpselect chooses and implements the best a)108 266.4 R -.25(va)-.2 G
-.414(ilable sound speed model for each sw).25 F .413
-(ath \214le in a surv)-.1 F -.15(ey)-.15 G(.)-.5 E .241(The user pro)108
-278.4 R .241(vides a list of the a)-.15 F -.25(va)-.2 G .242(ilable sou\
-nd speed models and speci\214es the criteria used for model selec-).25 F
-.956(tion. The program uses mbset to turn on bath)108 290.4 R .955
-(ymetry recalculation by raytracing through the sound speed)-.05 F
-(model selected for each sw)108 302.4 Q(ath \214le.)-.1 E(Description:)
-108 326.4 Q .865
-(The tool aims to help users to automatically apply the sound v)108
-350.4 R .866(elocity correction to the surv)-.15 F 1.166 -.15(ey \214)
--.15 H .866(les. since).15 F .256(most surv)108 362.4 R -.15(ey)-.15 G
-2.756(si).15 G -1.9 -.4(nv o)-2.756 H(lv).4 E 2.756(es)-.15 G -2.15 -.25
-(ev e)-2.756 H .255
-(ral SVPs, the seletion of the appropriate SVP for each surv).25 F .555
--.15(ey p)-.15 H .255(ro\214le is still miss-).15 F(ing in MB-System.)
-108 374.4 Q .563(After \214nding the appropriate svp for each pro\214le\
- based on the choosed method, the results are copied to a)108 398.4 R
-.665(txt \214le that sho)108 410.4 R .665(ws each surv)-.25 F .965 -.15
-(ey p)-.15 H .664(ro\214le with the corresponding SVP).15 F 3.164(.t)
--1.11 G .664(he tool also calls mbset automatically)-3.164 F
-(so no need to assign SVP to the data. it is done automatically)108
-422.4 Q(.)-.65 E
-(There are 5 methods for choosing the appropriate SVP for each surv)108
-446.4 Q .3 -.15(ey p)-.15 H(ro\214le. These methods are:).15 E
-(1. Nearest SVP in position: the middle position of each surv)108 470.4
-Q .3 -.15(ey p)-.15 H(ro\214le).15 E
-(is calculated and the geodesics \(shortest distance on the ellipsoid\))
-115.5 482.4 Q
-(to all SVPs are calcualted. and the SVP with the shortest distance is)
-115.5 494.4 Q(chosen. when the middle position of the surv)115.5 506.4 Q
-.3 -.15(ey p)-.15 H(ro\214le is calculated).15 E
-(there is an option to check for 0 lat 0 long wrong v)115.5 518.4 Q
-(alues. if it is)-.25 E
-(found at the starting the geodesic will be calculated to the end of)
-115.5 530.4 Q(the pro\214le.)115.5 542.4 Q
-(2. Nearest in time: the time interv)108 566.4 Q
-(eal between the starting time of)-.15 E
-(the pro\214le and the time of the SVP)115.5 578.4 Q 2.5(,a)-1.11 G
-(nd the SVP with)-2.5 E(the shortest)5 E(interv)115.5 590.4 Q
-(al will be chosen.)-.25 E(3. Nearest in position within time: a def)108
-614.4 Q(ault time radius from the)-.1 E
-(pro\214le is set as 10 hours, and within this period the nearest SVP)
-115.5 626.4 Q
-(in position is chosen. if none of the SVPs are within this period the)
-115.5 638.4 Q(nearest in position will be tak)115.5 650.4 Q
-(en despit of the period threshold. The)-.1 E
-(period threshold can be set by the user)115.5 662.4 Q(.)-.55 E
-(4. Nearest in time within range: similar to the pre)108 686.4 Q
-(vious option b)-.25 E(ut)-.2 E(this time a def)115.5 698.4 Q
-(ault range of 10000 meters is set and within this range)-.1 E
-(the svp nearest in time is chosen. also this 10000 meter v)115.5 710.4
-Q(alue could)-.25 E(be set by the user)115.5 722.4 Q(.)-.55 E
-(MB-System 5.0)72 768 Q(13 March 2014)140.11 E(1)198.45 E 0 Cg EP
-%%Page: 2 2
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 138.73(mbsvpselect\(1\) MB-System)72 48 R 138.73
-(5.0 mbsvpselect\(1\))2.5 F
-(5. Nearest in season within range: similar to the pre)108 84 Q
-(vious option the)-.25 E
-(selected SVP could be chosen based on the month only not on the year)
-115.5 96 Q(.)-.55 E(it means within the speci\214ed range the user coul\
-d chose either the svp)115.5 108 Q(nearest in time or the svp nearest i\
-n month \(this could be interpreted)115.5 120 Q(as the svp that f)115.5
-132 Q(alls in the same seasonal period despite of the year)-.1 E
-(when it w)115.5 144 Q(as tak)-.1 E(en\).)-.1 E .12
-(Mbsvpselect reads the .inf \214le of each sw)108 168 R .121
-(ath \214le referenced in a recursi)-.1 F .421 -.15(ve d)-.25 H .121
-(atalist structure to determine the).15 F .551
-(location and collection time of the rele)108 180 R -.25(va)-.25 G .551
-(nt data. The ancilliary *.inf, *.fbt, and *.fn).25 F 3.05<768c>-.4 G
-.55(les must be created)-3.05 F .021(\214rst. The w)108 192 R .022
-(ater sound speed models \(called SVPs by con)-.1 F -.15(ve)-.4 G .022
-(ntion as an acron).15 F .022(ym for Sound V)-.15 F .022
-(elocity Pro\214les\))-1.11 F(to be used must include one of three supp\
-orted \214le headers specifying the time and location of the model.)108
-204 Q(Uni)108 228 Q -.15(ve)-.25 G(rsity of Bremen SVP headers:).15 E
-(MB-SVP 2011/01/08 19:30:00 -52.965437)113 240 Q(-36.986314)5 E(\(k)113
-252 Q -.15(ey)-.1 G -.1(wo).15 G
-(rd yyyy/mm/dd hh:mm:ss latitude longitude\)).1 E(MB-System SVPs as no)
-108 276 Q 2.5(wo)-.25 G(utput by mbsvplist:)-2.5 E
-(#MB-SVP 2011/01/08 19:30:00 -36.986314 -52.965437)113 288 Q(\(k)113 300
-Q -.15(ey)-.1 G -.1(wo).15 G
-(rd yyyy/mm/dd hh:mm:ss longitude latitude\)).1 E(CARIS sound v)108 324
-Q(elocity header format:)-.15 E
-(Section 2013-150 23:22:18 -57:02:01 -26:02:18)113 336 Q(\(k)113 348 Q
--.15(ey)-.1 G -.1(wo).15 G(rd yyyy-yearDay).1 E(hh:mm:ss latitude \(de)5
-E(gree:min:sec\) longitude \(de)-.15 E(gree:min:sec\)\))-.15 E .393(Mbs\
-vpselect supports SVP \214les with single models or \214les with multip\
-le models where ne)108 372 R 2.892(wh)-.25 G .392(eaders occur)-2.892 F
-(between models.)108 384 Q(Instructions:)108 408 Q(1\) Set up a surv)108
-432 Q .3 -.15(ey \()-.15 H(or surv).15 E -.15(ey)-.15 G
-(s\) for MB-System processing in the usual w).15 E(ay)-.1 E(,)-.65 E
-(including creating a datalist \214le referencing the sw)115.5 444 Q
-(ath data of interest)-.1 E
-(and generating the ancilliary *.inf, *.fbt, and *.fn)115.5 456 Q 2.5
-<768c>-.4 G(les for each of)-2.5 E(the sw)115.5 468 Q(ath \214les.)-.1 E
-(2\) Create an svplist \214le \(analagous to a datalist, b)5 E
-(ut referencing the)-.2 E(rele)115.5 480 Q -.25(va)-.25 G
-(nt SVP \214les\). Each SVP \214le is e).25 E(xpected to be a te)-.15 E
-(xt \214le with)-.15 E
-(depth-sound speed pairs on each line \(depth in meters, sound speed in)
-115.5 492 Q(meters/second\) e)115.5 504 Q
-(xcepting for a header line at the start of each discrete)-.15 E
-(model. An)115.5 516 Q 2.5(yo)-.15 G 2.5(ft)-2.5 G
-(he header formats listed abo)-2.5 E .3 -.15(ve w)-.15 H(ill w).15 E
-(ork.)-.1 E .581(that refers to a local svp datalist. the local datalis\
-ts includes 3\) In order to turn on bath)115.5 528 R .582
-(ymetry recalcula-)-.05 F(tion by raytracing through the)108 540 Q
-(most appropriate sound speed model for each sw)115.5 552 Q
-(ath \214le, call mbsvpselect:)-.1 E(mbsvpselect -N -V -Idatalist -Ssvp\
-list [-P0, -P1, -P2/period, -P3/range, -P3/range/1])120.5 576 Q
-(-N is the option to check 0 latitude 0 longitude in the surv)115.5 600
-Q .3 -.15(ey l)-.15 H(ines.).15 E(-V v)115.5 612 Q(erbosity)-.15 E(.)
--.65 E(-I input datalist)115.5 624 Q(-S input svp datalist)115.5 636 Q
-(-P the method for choosing the svp where:)115.5 648 Q(-P or -P0)125.5
-660 Q(is the nearest in position)42.5 E 55(-P1 is)125.5 672 R
-(the nearest in time)2.5 E 55(-P2 is)125.5 684 R
-(nearest in position within time \(def)2.5 E
-(ault time period is 10 hours\))-.1 E 42.5(-P2/time is)125.5 696 R
-(nearest in position within speci\214ed time period \(in hours\))2.5 E
-55(-P3 is)125.5 708 R(nearest in time within range)2.5 E(\(def)7.5 E
-(ault range is 10000 meters\))-.1 E(-P3/range or -P3/range/0)125.5 720 Q
-(is nearest in time within speci\214ed range \(in meters\))5 E
-(MB-System 5.0)72 768 Q(13 March 2014)140.11 E(2)198.45 E 0 Cg EP
-%%Page: 3 3
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 138.73(mbsvpselect\(1\) MB-System)72 48 R 138.73
-(5.0 mbsvpselect\(1\))2.5 F 50(-P3/range/1 is)125.5 84 R
-(nearest in month \(seasonal\) within speci\214ed range in meter)2.5 E
-(.)-.55 E/F1 10.95/Times-Bold at 0 SF -.548(AU)72 112.8 S(THORSHIP).548 E
-F0(Ammar Aljuhe \(ammaraljuhne at gmail.com\))108 124.8 Q(MAR)113 136.8 Q
-(UM, Uni)-.4 E -.15(ve)-.25 G(rsity of Bremen).15 E
-(Christian do Santos Ferreira \(cferreira at marum.de\))108 148.8 Q(MAR)113
-160.8 Q(UM, Uni)-.4 E -.15(ve)-.25 G(rsity of Bremen).15 E F1(OPTIONS)72
-189.6 Q/F2 10/Times-Bold at 0 SF<ad48>108 201.6 Q F0 .162(This "help" \215\
-ag cause the program to print out a description of its operation and th\
-en e)22.52 F .161(xit immedi-)-.15 F(ately)144 213.6 Q(.)-.65 E F2<ad49>
-108 230.4 Q/F3 10/Times-Italic at 0 SF(datalist)26.41 E F0 .601
-(Sets the input datalist \214le, where)144 242.4 R F3(datalist)3.101 E
-F0 .602(is an ascii \214le containing a list of the input sw)3.102 F
-.602(ath sonar)-.1 F .678
-(data \214les to be processed and their formats.)144 254.4 R .678
-(The program will read the data in each one of these)5.678 F 2.5
-(\214les. In)144 266.4 R(the)2.5 E F3(\214le)2.5 E F0
-(\214le, each data \214le should be follo)2.5 E
-(wed by a data format identi\214er)-.25 E 2.5(,e)-.4 G(.g.:)-2.5 E
-(data\214le1 11)180 278.4 Q(data\214le2 24)180 290.4 Q 1.216
-(This program uses the)144 302.4 R F2(MBIO)3.716 E F0 1.217
-(library and will operate on an)3.716 F 3.717(ys)-.15 G -.1(wa)-3.717 G
-1.217(th sonar format supported by).1 F F2(MBIO)144 314.4 Q F0 3.428
-(.Al)C .928(ist of the sw)-3.428 F .928
-(ath sonar data formats currently supported by)-.1 F F2(MBIO)3.428 E F0
-.928(and their identi\214er)3.428 F -.25(va)144 326.4 S(lues is gi).25 E
--.15(ve)-.25 G 2.5(ni).15 G 2.5(nt)-2.5 G(he)-2.5 E F2(MBIO)2.5 E F0
-(manual page. Def)2.5 E(ault:)-.1 E F3(\214le)2.5 E F0 2.5(=")2.5 G
-(datalist.mb-1".)-2.5 E F2<ad4e>108 343.2 Q F0(Causes the program to ch\
-eck for SVPs with zero longitude and latitude v)144 355.2 Q(alues.)-.25
-E F2<ad50>108 372 Q F0 .829(This option sets the criteria by which)144
-384 R F2(mbsvpselect)3.329 E F0 .83
-(selects the sound speed model to be used for)3.329 F(each sw)144 396 Q
-(ath \214le.)-.1 E(-P or -P0)149 408 Q(nearest in position)32.5 E 45
-(-P1 nearest)149 420 R(in time)2.5 E 45(-P2 nearest)149 432 R
-(in position within time)2.5 E 32.5(-P2/time nearest)149 444 R
-(in position within speci\214ed time period)2.5 E 86.61(-P3 nearest)149
-456 R(in time within range)2.5 E 61.62(-P3/range nearest)149 468 R
-(in time within speci\214ed range)2.5 E 53.84(-P3/range/0 nearest)149
-480 R(in time within speci\214ed range)2.5 E 25(-P3/range/1 nearest)149
-492 R(in month \(seasonal\) within speci\214ed range)2.5 E .219
-(The times are speci\214ed in hours and the ranges in meters.)144 504 R
-.219(The def)5.219 F .219(ault time period is 10 hours and)-.1 F
-(the def)144 516 Q(ault range is 10000 meters.)-.1 E F2<ad53>108 532.8 Q
-F3(svplist)24.74 E F0 .904(Sets the input svplist \214le, where)144
-544.8 R F3(svplist)3.404 E F0 .905
-(is an ascii \214le containing a list of the input sound speed)3.404 F
-.47(model or SVP \214les.)144 556.8 R .469(The program will read the lo\
-cation and time stamp information for all of the)5.47 F .888
-(models in each one of these \214les.)144 568.8 R .888(In the)5.888 F F3
-(svplist)3.388 E F0 .889
-(\214le, each SVP \214le should be on a separate line,)3.388 F(e.g.:)144
-580.8 Q(svp\214le1)180 592.8 Q(svp\214le2)180 604.8 Q(Def)144 616.8 Q
-(ault:)-.1 E F3(\214le)2.5 E F0 2.5(=")2.5 G(svplist.mb-1".)-2.5 E F2
-<ad56>108 633.6 Q F0(Normally)23.08 E(,)-.65 E F2(mbsvpselect)3.531 E F0
--.1(wo)3.531 G 1.031(rks "silently" without outputting an).1 F 1.031
-(ything to the stderr stream.)-.15 F 1.03(If the)6.03 F F2<ad56>144
-645.6 Q F0 .863(\215ag is gi)3.363 F -.15(ve)-.25 G .863(n, then).15 F
-F2(mblist)3.363 E F0 -.1(wo)3.363 G .863(rks in a "v).1 F .863
-(erbose" mode and outputs the program v)-.15 F .864(ersion being)-.15 F
-(used and all error status messages.)144 657.6 Q F1(EXAMPLES)72 686.4 Q
-F0 1.038(Suppose you are w)108 698.4 R 1.038
-(orking in a directory called Surv)-.1 F -.15(ey)-.15 G 1.038
-(_1 containing sw).15 F 1.037(ath \214les that need to ha)-.1 F 1.337
--.15(ve t)-.2 H 1.037(he ba-).15 F(th)108 710.4 Q .098
-(ymetry recalculated by raytracing through w)-.05 F .099
-(ater sound speed models. The local datalist \214le might contain)-.1 F
-(something lik)108 722.4 Q(e:)-.1 E(MB-System 5.0)72 768 Q
-(13 March 2014)140.11 E(3)198.45 E 0 Cg EP
-%%Page: 4 4
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 138.73(mbsvpselect\(1\) MB-System)72 48 R 138.73
-(5.0 mbsvpselect\(1\))2.5 F(13349457_3934_2845.mb88 88)120.5 84 Q
-(13645323_3433_5543.mb88 88)120.5 96 Q(46372536_6563_4637.mb88 88)120.5
-108 Q(64362825_6344_2635.mb88 88)120.5 120 Q(or)108 144 Q 2.5(,i)-.4 G
-2.5(fy)-2.5 G(ou use absolute passw)-2.5 E(ords, something lik)-.1 E(e:)
--.1 E(/MyMac/User/Surv)120.5 168 Q -.15(ey)-.15 G
-(_1/13349457_3934_2845.mb88 88).15 E(/MyMac/User/Surv)120.5 180 Q -.15
-(ey)-.15 G(_1/13645323_3433_5543.mb88 88).15 E(/MyMac/User/Surv)120.5
-192 Q -.15(ey)-.15 G(_1/46372536_6563_4637.mb88 88).15 E
-(/MyMac/User/Surv)120.5 204 Q -.15(ey)-.15 G
-(_1/64362825_6344_2635.mb88 88).15 E .42(By con)108 228 R -.15(ve)-.4 G
-.419(ntion, this datalist will be named something lik).15 F 2.919(ed)-.1
-G .419(atalist.mb-1, where the ".mb-1" suf)-2.919 F .419
-(\214x indicates)-.25 F 1.652(to MB-System programs that this is a data\
-list \214le. As documented else)108 240 R 1.652
-(where, datalist \214les can contain)-.25 F(entries that reference data\
-lists rather than single \214les; thus datalists can be recursi)108 252
-Q -.15(ve)-.25 G(.).15 E .538(Suppose that the w)108 276 R .538
-(ater properties were v)-.1 F .537(ariable during this surv)-.25 F -.15
-(ey)-.15 G 3.037(,w)-.5 G .537(ith the v)-3.037 F .537
-(ariability dominated by loca-)-.25 F 1.327(tion.Further suppose that t\
-here are three SVP \214les in a separate directory with names such as s\
-vp1.svp,)108 288 R .521(svp2.svp, and svp3.svp. Each of these \214les c\
-ontains a single model deri)108 300 R -.15(ve)-.25 G 3.02(df).15 G .52
-(rom CTD casts at a particular)-3.02 F 1.242(place and time indicated i\
-n the single header line. In that directory one can create an svplist \
-\214le named)108 312 R(SVP_list.mb-1 with contents:)108 324 Q(svp1.svp)
-120.5 336 Q(svp2.svp)120.5 348 Q 1.928(svp3.svp Since mbsvpselect allo)
-120.5 360 R 1.927(ws svplists to be recursi)-.25 F 2.227 -.15(ve \()-.25
-H(lik).15 E 4.427(ed)-.1 G 1.927(atalists\), one can create a second)
--4.427 F .155(svplist named my_svplist.mb-1in the surv)108 372 R .455
--.15(ey p)-.15 H .155
-(rocessing directory that references the \214rst with an entry lik).15 F
-(e:)-.1 E(/MyMac/User/Surv)120.5 396 Q -.15(ey)-.15 G
-(_1/SVP_folder/SVP_list.mb-1 -1).15 E .491(In order to turn on bath)108
-420 R .491(ymetry recalculation for all of the sw)-.05 F .49
-(ath \214les referenced by datalist.mb-1 using the)-.1 F
-(most appropriate of the a)108 432 Q -.25(va)-.2 G
-(ilable sound speed models, run mbsvpselect with ar).25 E(guments lik)
--.18 E(e:)-.1 E
-(mbsvpselect -N -V -I datalist.mb-1 -S my_svplist.mb-1 -P2/50)120.5 456
-Q .38(Here the -P2/50 option speci\214es that the sound speed model to \
-be used for each \214le will be the closest one)108 480 R .261
-(collected within 50 hours of the sw)108 492 R .261(ath data. The bath)
--.1 F .26(ymetry recalculation will be turned on using an mbset)-.05 F
-(call of the form:)108 504 Q
-(mbset -Idatalist.mb-1 -PSVPFILE:/MyMac/User/Surv)120.5 528 Q -.15(ey)
--.15 G(_1/SVP_folder/svp1.svp).15 E -.15(Fo)108 552 S(llo).15 E 1.055(w\
-ing the mbsvpselect usage, mbprocess must be run to actually reprocess \
-the sw)-.25 F 1.055(ath data, including)-.1 F(bath)108 564 Q
-(ymetry recalculation by raytracing.)-.05 E/F1 10.95/Times-Bold at 0 SF
-(SEE ALSO)72 592.8 Q/F2 10/Times-Bold at 0 SF(mbsystem)108 604.8 Q F0
-(\(1\),)A F2(mbpr)2.5 E(ocess)-.18 E F0(\(1\),)A F2(mbset)2.5 E F0
-(\(1\),)A F2(mbsvplist)2.5 E F0(\(1\))A F1 -.11(BU)72 633.6 S(GS).11 E
-F0(The b)108 645.6 Q(ugs are special because the)-.2 E 2.5(ya)-.15 G
-(re from Egypt, German)-2.5 E 1.3 -.65(y, a)-.15 H(nd Brazil.).65 E
-(MB-System 5.0)72 768 Q(13 March 2014)140.11 E(4)198.45 E 0 Cg EP
-%%Trailer
-end
-%%EOF
diff --git a/src/ps/mbswath.ps b/src/ps/mbswath.ps
deleted file mode 100644
index 040ba14..0000000
--- a/src/ps/mbswath.ps
+++ /dev/null
@@ -1,733 +0,0 @@
-%!PS-Adobe-3.0
-%%Creator: groff version 1.19.2
-%%CreationDate: Wed Jul  1 12:29:31 2015
-%%DocumentNeededResources: font Times-Roman
-%%+ font Times-Bold
-%%+ font Times-Italic
-%%DocumentSuppliedResources: procset grops 1.19 2
-%%Pages: 6
-%%PageOrder: Ascend
-%%DocumentMedia: Default 612 792 0 () ()
-%%Orientation: Portrait
-%%EndComments
-%%BeginDefaults
-%%PageMedia: Default
-%%EndDefaults
-%%BeginProlog
-%%BeginResource: procset grops 1.19 2
-%!PS-Adobe-3.0 Resource-ProcSet
-/setpacking where{
-pop
-currentpacking
-true setpacking
-}if
-/grops 120 dict dup begin
-/SC 32 def
-/A/show load def
-/B{0 SC 3 -1 roll widthshow}bind def
-/C{0 exch ashow}bind def
-/D{0 exch 0 SC 5 2 roll awidthshow}bind def
-/E{0 rmoveto show}bind def
-/F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def
-/G{0 rmoveto 0 exch ashow}bind def
-/H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/I{0 exch rmoveto show}bind def
-/J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def
-/K{0 exch rmoveto 0 exch ashow}bind def
-/L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/M{rmoveto show}bind def
-/N{rmoveto 0 SC 3 -1 roll widthshow}bind def
-/O{rmoveto 0 exch ashow}bind def
-/P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/Q{moveto show}bind def
-/R{moveto 0 SC 3 -1 roll widthshow}bind def
-/S{moveto 0 exch ashow}bind def
-/T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/SF{
-findfont exch
-[exch dup 0 exch 0 exch neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/MF{
-findfont
-[5 2 roll
-0 3 1 roll
-neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/level0 0 def
-/RES 0 def
-/PL 0 def
-/LS 0 def
-/MANUAL{
-statusdict begin/manualfeed true store end
-}bind def
-/PLG{
-gsave newpath clippath pathbbox grestore
-exch pop add exch pop
-}bind def
-/BP{
-/level0 save def
-1 setlinecap
-1 setlinejoin
-72 RES div dup scale
-LS{
-90 rotate
-}{
-0 PL translate
-}ifelse
-1 -1 scale
-}bind def
-/EP{
-level0 restore
-showpage
-}def
-/DA{
-newpath arcn stroke
-}bind def
-/SN{
-transform
-.25 sub exch .25 sub exch
-round .25 add exch round .25 add exch
-itransform
-}bind def
-/DL{
-SN
-moveto
-SN
-lineto stroke
-}bind def
-/DC{
-newpath 0 360 arc closepath
-}bind def
-/TM matrix def
-/DE{
-TM currentmatrix pop
-translate scale newpath 0 0 .5 0 360 arc closepath
-TM setmatrix
-}bind def
-/RC/rcurveto load def
-/RL/rlineto load def
-/ST/stroke load def
-/MT/moveto load def
-/CL/closepath load def
-/Fr{
-setrgbcolor fill
-}bind def
-/setcmykcolor where{
-pop
-/Fk{
-setcmykcolor fill
-}bind def
-}if
-/Fg{
-setgray fill
-}bind def
-/FL/fill load def
-/LW/setlinewidth load def
-/Cr/setrgbcolor load def
-/setcmykcolor where{
-pop
-/Ck/setcmykcolor load def
-}if
-/Cg/setgray load def
-/RE{
-findfont
-dup maxlength 1 index/FontName known not{1 add}if dict begin
-{
-1 index/FID ne{def}{pop pop}ifelse
-}forall
-/Encoding exch def
-dup/FontName exch def
-currentdict end definefont pop
-}bind def
-/DEFS 0 def
-/EBEGIN{
-moveto
-DEFS begin
-}bind def
-/EEND/end load def
-/CNT 0 def
-/level1 0 def
-/PBEGIN{
-/level1 save def
-translate
-div 3 1 roll div exch scale
-neg exch neg exch translate
-0 setgray
-0 setlinecap
-1 setlinewidth
-0 setlinejoin
-10 setmiterlimit
-[]0 setdash
-/setstrokeadjust where{
-pop
-false setstrokeadjust
-}if
-/setoverprint where{
-pop
-false setoverprint
-}if
-newpath
-/CNT countdictstack def
-userdict begin
-/showpage{}def
-/setpagedevice{}def
-}bind def
-/PEND{
-countdictstack CNT sub{end}repeat
-level1 restore
-}bind def
-end def
-/setpacking where{
-pop
-setpacking
-}if
-%%EndResource
-%%EndProlog
-%%BeginSetup
-%%BeginFeature: *PageSize Default
-<< /PageSize [ 612 792 ] /ImagingBBox null >> setpagedevice
-%%EndFeature
-%%IncludeResource: font Times-Roman
-%%IncludeResource: font Times-Bold
-%%IncludeResource: font Times-Italic
-grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72
-def/PL 792 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron/Zcaron
-/scaron/zcaron/Ydieresis/trademark/quotesingle/Euro/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/space/exclam/quotedbl/numbersign/dollar/percent
-/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen
-/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon
-/semicolon/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O
-/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright/circumflex
-/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y
-/z/braceleft/bar/braceright/tilde/.notdef/quotesinglbase/guillemotleft
-/guillemotright/bullet/florin/fraction/perthousand/dagger/daggerdbl
-/endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut
-/dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash
-/quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen
-/brokenbar/section/dieresis/copyright/ordfeminine/guilsinglleft
-/logicalnot/minus/registered/macron/degree/plusminus/twosuperior
-/threesuperior/acute/mu/paragraph/periodcentered/cedilla/onesuperior
-/ordmasculine/guilsinglright/onequarter/onehalf/threequarters
-/questiondown/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE
-/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex
-/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis
-/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn
-/germandbls/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla
-/egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis
-/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide/oslash
-/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis]def
-/Times-Italic at 0 ENC0/Times-Italic RE/Times-Bold at 0 ENC0/Times-Bold RE
-/Times-Roman at 0 ENC0/Times-Roman RE
-%%EndSetup
-%%Page: 1 1
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mbsw)72 48 Q 152.16(ath\(1\) MB-System)-.1 F
-152.16(5.0 mbsw)2.5 F(ath\(1\))-.1 E/F1 10.95/Times-Bold at 0 SF -.219(NA)
-72 84 S(ME).219 E/F2 10/Times-Bold at 0 SF(mbswath)108 96 Q F0<ad>2.744 E
-F2(GMT)2.744 E F0 .243
-(plug-in module for color \214ll or color shaded relief sw)2.744 F .243
-(ath plots of sw)-.1 F .243(ath sonar data using)-.1 F(Postscript.)108
-108 Q F1(VERSION)72 136.8 Q F0 -1.11(Ve)108 148.8 S(rsion 5.0)1.11 E F1
-(SYNOPSIS)72 177.6 Q F2 6.308(gmt mbswath \255C)108 189.6 R/F3 10
-/Times-Italic at 0 SF(cpt\214le)A F2<ad4a>8.808 E F3(par)A(ameter)-.15 E(s)
--.1 E F2<ad52>8.808 E F3(west/east/south/north)A F2([\255A)8.809 E F3
-(factor/mode/depth)A F2<ad42>8.809 E F3(tic)A(kinfo)-.2 E F2<ad62>108
-201.6 Q F3(yr/mo/da/hr/mn/sc)A F2<ad63>4.824 E F3(copies)A F2<ad44>4.824
-E F3(mode/scale/min/max)A F2<ad45>4.824 E F3(yr/mo/da/hr/mn/sc)A F2
-<ad66>4.824 E F3(format)A F2<ad46>4.824 E F3 -.37(re)C(d/gr).37 E
-(een/blue)-.37 E F2<ad47>108 213.6 Q F3(ma)A(gnitude/azimuth)-.1 E F2
-<ad49>3.291 E F3(datalist)A F2 .791<ad4b20ad4e>3.291 F F3(cpt\214le)A F2
-.792<ad4f20ad5020ad70>3.291 F F3(pings)A F2<ad51>3.292 E F3(dpi)A F2
-<ad53>3.292 E F3(speed)A F2<ad54>3.292 E F3(time)A(gap)-.4 E F2 .792
-<ad5520ad5720ad58>3.292 F F3(x-)A(shift)108 225.6 Q F2<ad59>2.5 E F3
-(y-shift)A F2<ad5a>2.5 E F3(mode[F])A F2(\2550 \2551 \2552 \255V \255H])
-2.5 E F1(DESCRIPTION)72 254.4 Q F2(mbswath)108 266.4 Q F0 .613
-(is a plug-in module for plotting sw)3.113 F .612
-(ath sonar data in color \214ll or color shaded relief using)-.1 F F2
-(GMT)3.112 E F0 .409(\(Generic Mapping T)108 278.4 R 2.909(ools\). Lik)
--.8 F(e)-.1 E F2(mbcontour)2.909 E F0(,)A F2(mbswath)2.909 E F0 .409
-(is fully compatible with the)2.909 F F2(GMT)2.91 E F0 .41(package v)
-2.91 F(ersion)-.15 E 1.102(5, including the use of GMT style color pall\
-ete \(cpt\) \214les to control the color table.)108 290.4 R 3.602(A2)
-6.102 G 1.102(4-bit true color)-3.602 F F3 -.8(Po)108 302.4 S(stScript)
-.8 E F0 .876(\214le is output using one of three methods. Unless indi)
-3.376 F .877(vidual polygon \214lls are used \()-.25 F F2<ad31>A F0
-(option\),)3.377 E .905(only one call to)108 314.4 R F2(mbswath)3.405 E
-F0 .905(can be made for each plot because the color image produced co)
-3.405 F -.15(ve)-.15 G .905(rs the entire).15 F .042(plot space.)108
-326.4 R .042(The program can read data from a single sw)5.042 F .043
-(ath sonar \214le or from multiple \214les as referenced by)-.1 F
-(an MB-System datalist \214le.)108 338.4 Q .532
-(Before opening an input sw)108 362.4 R .531(ath data \214le,)-.1 F F2
-(mbmbswath)3.031 E F0 .531
-(checks for an ascii \214le in the same directory ha)3.031 F(ving)-.2 E
-.626(the same name e)108 374.4 R .626(xcept that ".inf" is appended to \
-the end. The program assumes that this ascii \214le contains)-.15 F .089
-(the output of the program)108 386.4 R F2(mbinf)2.589 E(o)-.25 E F0 .088
-(run on the input data \214le. If the ".inf" \214le e)2.589 F(xists,)
--.15 E F2(mbswath)2.588 E F0 .088(reads the min-)2.588 F 1.576
-(imum and maximum longitude and latitude bounds from the)108 398.4 R F2
-(mbinf)4.077 E(o)-.25 E F0 1.577(output and compares those to the)4.077
-F 1.388(bounds for the plot. If the ".inf" \214le indicates that none o\
-f the data in the input \214le lies inside the plot)108 410.4 R .041
-(bounds, that input \214le is skipped. This allo)108 422.4 R .042(ws us\
-ers to maintain a single master list of data \214les for use in all)-.25
-F .275(plotting without the performance penalty of)108 434.4 R F2
-(mbswath)2.775 E F0 .274(reading through all the data \214les, e)2.774 F
--.15(ve)-.25 G 2.774(nt).15 G .274(hose with no)-2.774 F(rele)108 446.4
-Q -.15(ve)-.25 G .63(nt data. W).15 F 3.13(er)-.8 G .63
-(ecommend that users maintain a ".inf" \214le for each sw)-3.13 F .63
-(ath data \214le used for gridding or)-.1 F(plotting. The)108 458.4 Q F2
-(GMT)2.5 E F0(modules)2.5 E F2(mbcontour)2.5 E F0(and)2.5 E F2(mbgrid)
-2.5 E F0(also use ".inf" \214les in the same f)2.5 E(ashion.)-.1 E(If)
-108 482.4 Q F2(mb\214lter)3.239 E F0 .738(has been used to \214lter amp\
-litude and/or sidescan data in the desired input, then the)3.239 F F2
-<ad5a>3.238 E F0(option)3.238 E(can be used to specify plotting the \
-\214ltered rather than un\214ltered data.)108 494.4 Q .232(In order for)
-108 518.4 R F2(GMT)2.732 E F0 .232(to successfully e)2.732 F -.15(xe)
--.15 G(cute).15 E F2(mbswath)2.732 E F0 2.732(,t)C .232
-(he location of the shared library)-2.732 F F3(libmbgmt)2.732 E F0
-(containing)2.732 E 2.652(this module must be kno)108 530.4 R 2.652
-(wn to)-.25 F F2(GMT)5.151 E F0 7.651(.T)C 2.651
-(his can be accomplished by either setting the GMT_CUS-)-7.651 F -.18
-(TO)108 542.4 S .375(M_LIBS parameter in the \214le gmt.conf that is pa\
-rt of the GMT installation, by setting this parameter in).18 F .335
-(the \214le gmt.conf in the user')108 554.4 R 2.835(sh)-.55 G .335
-(ome directory)-2.835 F 2.835(,o)-.65 G 2.835(rb)-2.835 G 2.835(yu)
--2.835 G .335(sing the GMT module)-2.835 F F2(gmtset)2.835 E F0 .335
-(to modify this parame-)2.835 F .853(ter in the current w)108 566.4 R
-.853(orking directory)-.1 F 3.353(.I)-.65 G .853(f, for instance, the)
--3.353 F F3(libmbgmt)3.353 E F0 .853
-(shared library has been installed in the)3.353 F
-(\214le /usr/lib/libmbgmt.dylib, then the GMT_CUST)108 578.4 Q
-(OM_LIBS parameter in a gmt.conf \214le can be set to:)-.18 E(GMT_CUST)
-128 590.4 Q(OM_LIBS = /usr/lib/libmbgmt.dylib)-.18 E F1 -.548(AU)72
-619.2 S(THORSHIP).548 E F0(Da)108 631.2 Q(vid W)-.2 E 2.5(.C)-.92 G
-(aress \(caress at mbari.or)-2.5 E(g\))-.18 E(Montere)113 643.2 Q 2.5(yB)
--.15 G(ay Aquarium Research Institute)-2.5 E
-(Dale N. Chayes \(dale at ldeo.columbia.edu\))108 655.2 Q
-(Lamont-Doherty Earth Observ)113 667.2 Q(atory)-.25 E F1(OPTIONS)72 696
-Q F2<ad41>108 708 Q F3(factor/mode/depth)23.08 E F0 3.38
-(This option determines ho)144 720 R 5.879(wt)-.25 G 3.379
-(he along-track dimension of the beam or pix)-5.879 F 3.379
-(el footprints is)-.15 F(MB-System 5.0)72 768 Q 2.5(5F)137.61 G
-(ebruary 2015)-2.5 E(1)195.95 E 0 Cg EP
-%%Page: 2 2
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mbsw)72 48 Q 152.16(ath\(1\) MB-System)-.1 F
-152.16(5.0 mbsw)2.5 F(ath\(1\))-.1 E .651(calculated. If)144 84 R/F1 10
-/Times-Italic at 0 SF(mode)3.151 E F0 3.151(=1)3.151 G 3.151(,t)-3.151 G
-.652(hen the fore-aft beam angle width of the sonar is used so that the\
- width)-3.151 F .403(increases to)144 96 R -.1(wa)-.25 G .403
-(rds the outer parts of the sw).1 F 2.903(ath. The)-.1 F .403
-(fore-aft beam angle width \()2.903 F/F2 10/Times-Bold at 0 SF(MB-System)A
-F0(inter)2.902 E(-)-.2 E .529(nally stores a v)144 108 R .529
-(alue for each format/sonar\) is multiplied by the)-.25 F F1(factor)3.03
-E F0 -.25(va)3.03 G .53(lue; a).25 F F1(factor)3.03 E F0 3.03(<1)3.03 G
-.53(.0 can be)-3.03 F .388(useful if the data highly o)144 120 R -.15
-(ve)-.15 G .388(rsamples the sea\215oor and a).15 F F1(factor)2.888 E F0
-2.888(>1)2.888 G .388(.0 can \214ll in plots of data which)-2.888 F .064
-(undersample the sea\215oor)144 132 R 2.564(.I)-.55 G 2.564(ft)-2.564 G
-.064(he data stream does not include depth v)-2.564 F .065
-(alues \(e.g. one is plotting pure)-.25 F 1.019
-(sidescan data\), then the)144 144 R F1(depth)3.518 E F0 -.25(va)3.518 G
-1.018(lue sets the depth v).25 F 1.018
-(alue in meters used in the footprint calcula-)-.25 F 2.515(tions. If)
-144 156 R F1(mode)2.515 E F0 2.515(=2)2.515 G 2.515(,t)-2.515 G .015
-(hen the along-track dimension of the beam or pix)-2.515 F .015
-(el footprints is just the along-)-.15 F .66
-(track distance between pings multiplied by the)144 168 R F1(factor)3.16
-E F0 -.25(va)3.16 G 3.16(lue. If).25 F F1(mode)3.16 E F0 3.16(=3)3.16 G
-3.16(,t)-3.16 G .66(hen each data point is)-3.16 F .385
-(plotted as a point, and the)144 180 R F1(factor)2.885 E F0(and)2.885 E
-F1(depth)2.885 E F0 .385(parameters are ignored.)2.885 F(Def)5.385 E
-(ault:)-.1 E F1(factor)2.886 E F0 2.886(=1)2.886 G(.0,)-2.886 E F1(mode)
-2.886 E F0(=)2.886 E(1,)144 192 Q F1(depth)2.5 E F0 2.5(=3)2.5 G(000.0.)
--2.5 E F2<ad42>108 208.8 Q F1(tic)23.63 E(kinfo)-.2 E F0
-(Sets map boundary tickmark interv)144 220.8 Q(als. See the)-.25 E F2
-(psbasemap)2.5 E F0(manual page for details.)2.5 E F2<ad62>108 237.6 Q
-F1(yr/mo/da/hr/mn/sc)24.74 E F0 .614
-(Sets the starting time for data allo)144 249.6 R .614
-(wed in the input data; pings with times before the starting time)-.25 F
-(will be ignored.)144 261.6 Q(Def)5 E(ault:)-.1 E F1(yr/mo/da/hr/mn/sc)
-2.5 E F0 2.5(=1)2.5 G(962/2/21/10/30/0.)-2.5 E F2<ad43>108 278.4 Q F0
-1.245
-(Sets the color palette \214le which controls the color of the plot.)
-23.08 F 1.246(See documentation of the GMT)6.246 F
-(package for a complete description of cpt \214les.)144 290.4 Q F2<ad63>
-108 307.2 Q F1(copies)25.86 E F0
-(Speci\214es the number of plot copies \(the def)144 319.2 Q
-(ault is 1\).)-.1 E F2<ad44>108 336 Q F1(mode/scale/min/max)23.08 E F0
-.876(Sets scaling of beam amplitude or sidescan pix)144 348 R .875(el v)
--.15 F .875(alues which can be applied before plotting. If)-.25 F F1
-(mode)144 360 Q F0 2.5(=1o)2.5 G 2.5(r2)-2.5 G 2.5(,t)-2.5 G
-(hen a linear scaling of the form:)-2.5 E(scaled_v)180 372 Q
-(alue = scale * \(v)-.25 E(alue \255 min\) / \(max \255 min\))-.25 E
-(is applied.)144 384 Q(If)5 E F1(mode)2.5 E F0 2.5(=3o)2.5 G 2.5(r4)-2.5
-G 2.5(,t)-2.5 G(hen a log10 scaling of the form:)-2.5 E(scaled_v)180 396
-Q(alue = scale * \(20 * log10\(v)-.25 E
-(alue\) \255 min\) / \(max \255 min\))-.25 E 1.142(is applied.)144 408 R
-(If)6.142 E F1(mode)3.642 E F0 3.642(=2o)3.642 G 3.642(r4)-3.642 G 3.642
-(,t)-3.642 G 1.142(hen the v)-3.642 F 1.143(alue \(or 20*log10\(v)-.25 F
-1.143(alue\)\) will be clipped to)-.25 F F1(min)3.643 E F0 1.143
-(if it is)3.643 F .502(smaller than)144 420 R F1(min)3.002 E F0(or)3.002
-E F1(max)3.002 E F0 .502(if it is greater than)3.002 F F1(max)3.002 E F0
-3.002(;t)C .501(his clipping happens prior to the multiplication)-3.002
-F(by)144 432 Q F1(scale)2.5 E F0 2.5(.D)C(ef)-2.5 E(ault:)-.1 E F1(mode)
-2.5 E F0 2.5(=1)2.5 G(,)-2.5 E F1(scale)2.5 E F0 2.5(=1)2.5 G(.0,)-2.5 E
-F1(min)2.5 E F0 2.5(=0)2.5 G(.0,)-2.5 E F1(max)2.5 E F0 2.5(=1)2.5 G
-(.0.)-2.5 E F2<ad45>108 448.8 Q F1(yr/mo/da/hr/mn/sc)23.63 E F0 .286
-(Sets the ending time for data allo)144 460.8 R .287
-(wed in the input data; pings with times after the ending time will)-.25
-F(be ignored.)144 472.8 Q(Def)5 E(ault:)-.1 E F1(yr/mo/da/hr/mn/sc)2.5 E
-F0 2.5(=2)2.5 G(062/2/21/10/30/0.)-2.5 E F2<ad46>108 489.6 Q F1 -.37(re)
-24.19 G(d/gr).37 E(een/blue)-.37 E F0
-(Sets the color used for Frame and annotation. [Def)144 501.6 Q
-(ault is black])-.1 E F2<ad66>108 518.4 Q F1(format)26.97 E F0 .22(Sets\
- the data format used if the input is read from stdin or from a \214le.\
- If)144 530.4 R F1(format)2.72 E F0 2.72(<0)2.72 G 2.72(,t)-2.72 G .22
-(hen the input)-2.72 F .007(\214le speci\214ed with the)144 542.4 R F2
-<ad49>2.507 E F0 .008(option will actually contain a list of input sw)
-2.508 F .008(ath sonar data \214les. This pro-)-.1 F .012(gram uses the)
-144 554.4 R F2(MBIO)2.512 E F0 .012(library and will read or write an)
-2.512 F 2.512(ys)-.15 G -.1(wa)-2.512 G .012
-(th sonar format supported by).1 F F2(MBIO)2.511 E F0 2.511(.A)C 1.296
-(list of the sw)144 566.4 R 1.297
-(ath sonar data formats currently supported by)-.1 F F2(MBIO)3.797 E F0
-1.297(and their identi\214er v)3.797 F 1.297(alues is)-.25 F(gi)144
-578.4 Q -.15(ve)-.25 G 2.5(ni).15 G 2.5(nt)-2.5 G(he)-2.5 E F2(MBIO)2.5
-E F0(manual page. Def)2.5 E(ault:)-.1 E F1(format)2.5 E F0 2.5<3dad>2.5
-G(1.)-2.5 E F2<ad47>108 595.2 Q F1(ma)22.52 E(gnitude/azimuth)-.1 E F0
-(or)2.5 E F1(ma)2.5 E(gnitude/median)-.1 E F0 .535
-(Sets the parameters which control ho)144 607.2 R(w)-.25 E F2(mbswath)
-3.035 E F0 .534(generates simulated illumination of bath)3.034 F(ymetry)
--.05 E(,)-.65 E .521(which can be either shaded relief bath)144 619.2 R
-.521(ymetry or bath)-.05 F .522(ymetry draped with amplitude data.)-.05
-F(If)5.522 E F1(mode)3.022 E F0 .246(is set to 2 \(shaded relief bath)
-144 631.2 R .246(ymetry\) using the)-.05 F F2<ad5a>2.746 E F0 .246
-(option, then the v)2.746 F(alue)-.25 E F1(ma)2.746 E(gnitude)-.1 E F0
-.245(is an ef)2.746 F(fecti)-.25 E -.15(ve)-.25 G -.15(ve)144 643.2 S
-1.424(rtical e).15 F 1.424
-(xageration which modulates the intensity of the shading; typical v)-.15
-F 1.425(alues are in the 1-5)-.25 F 2.758(range. The)144 655.2 R -.25
-(va)2.758 G(lue).25 E F1(azimuth)2.758 E F0 .258
-(is the azimuth from which the bath)2.758 F .257(ymetry is illuminated.)
--.05 F(If)5.257 E F1(mode)2.757 E F0 .257(is set)2.757 F .666
-(to 3 \(bath)144 667.2 R .666
-(ymetry shaded using amplitudes\) using the)-.05 F F2<ad5a>3.166 E F0
-.667(option, then the v)3.167 F(alue)-.25 E F1(ma)3.167 E(gnitude)-.1 E
-F0(modu-)3.167 E .94(lates the intensity of the shading; the v)144 679.2
-R(alue)-.25 E F1(median)3.439 E F0 .939(sets the amplitude v)3.439 F
-.939(alue which serv)-.25 F .939(es as the)-.15 F(zero or neutral le)144
-691.2 Q -.15(ve)-.25 G(l.).15 E F2<ad48>108 708 Q F0 .162(This "help" \
-\215ag cause the program to print out a description of its operation an\
-d then e)22.52 F .162(xit immedi-)-.15 F(ately)144 720 Q(.)-.65 E
-(MB-System 5.0)72 768 Q 2.5(5F)137.61 G(ebruary 2015)-2.5 E(2)195.95 E 0
-Cg EP
-%%Page: 3 3
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mbsw)72 48 Q 152.16(ath\(1\) MB-System)-.1 F
-152.16(5.0 mbsw)2.5 F(ath\(1\))-.1 E/F1 10/Times-Bold at 0 SF<ad49>108 84 Q
-/F2 10/Times-Italic at 0 SF(in\214le)26.41 E F0 .468
-(Sets the input \214lename. If)144 96 R F2(format)2.967 E F0 2.967(>0\()
-2.967 G .467(set with the)-2.967 F F1<ad66>2.967 E F0 .467
-(option\) then the sw)2.967 F .467(ath sonar data contained)-.1 F(in)144
-108 Q F2(in\214le)2.937 E F0 .437(is read and processed. If)2.937 F F2
-(format)2.937 E F0 2.937(<0)2.937 G 2.937(,t)-2.937 G(hen)-2.937 E F2
-(in\214le)2.937 E F0 .437(is assumed to be an ascii \214le containing a)
-2.937 F .869(list of the input sw)144 120 R .869
-(ath sonar data \214les to be processed and their formats.)-.1 F .868
-(The program will read)5.869 F .194
-(and plot the data in each one of these \214les.)144 132 R .195(In the)
-5.195 F F2(in\214le)2.695 E F0 .195
-(\214le, each data \214le should be follo)2.695 F .195(wed by a)-.25 F
-(data format identi\214er)144 144 Q 2.5(,e)-.4 G(.g.:)-2.5 E
-(data\214le1 11)180 156 Q(data\214le2 24)180 168 Q .03
-(This program uses the)144 180 R F1(MBIO)2.53 E F0 .029
-(library and will read an)2.53 F 2.529(ys)-.15 G -.1(wa)-2.529 G .029
-(th sonar format supported by).1 F F1(MBIO)2.529 E F0 2.529(.A)C 1.296
-(list of the sw)144 192 R 1.297
-(ath sonar data formats currently supported by)-.1 F F1(MBIO)3.797 E F0
-1.297(and their identi\214er v)3.797 F 1.297(alues is)-.25 F(gi)144 204
-Q -.15(ve)-.25 G 2.5(ni).15 G 2.5(nt)-2.5 G(he)-2.5 E F1(MBIO)2.5 E F0
-(manual page.)2.5 E .42(An input data\214le may be accompanied by a "f)
-144 216 R .42(ast bath)-.1 F .42(ymetry" or "fbt" \214le.)-.05 F .42
-(The "fbt" \214ne naming)5.42 F(con)144 228 Q -.15(ve)-.4 G 1.166
-(ntion is to add the ".fbt" suf).15 F 1.166(\214x to the original sw)
--.25 F 1.166(ath data \214lename.)-.1 F 1.167(An "fbt" \214le contains)
-6.167 F .597(only sw)144 240 R .597(ath bath)-.1 F .596(ymetry informat\
-ion in a compact format \(format 71\), and is thus quick to read. If)
--.05 F F1(mbswath)144 252 Q F0 2.133
-(is generating a plot containing only bath)4.633 F 2.133(ymetry \()-.05
-F F1<ad5a>A F2(1)A F0(and)4.633 E F1<ad5a>4.633 E F2(2)A F0 4.633
-(\). the)B 2.134(program will)4.633 F
-(attempt to read an "fbt" \214le in lieu of the original data.)144 264 Q
-F1<ad4a>108 280.8 Q F0 .96(Selects the map projection. Scale is inch/de)
-25.3 F .959(gree, 1:xxxxx.)-.15 F .959
-(or width in inches \(upper case modi-)5.959 F(\214er\).)144 292.8 Q F1
-(CYLINDRICAL PR)144 316.8 Q(OJECTIONS:)-.3 E(\255Jc)144 340.8 Q F2
-(lon0/lat0/scale)A F0(\(Cassini\))2.5 E F1(\255Jm)144 352.8 Q F2(scale)A
-F0(\(Mercator\))2.5 E F1<ad4a>144 364.8 Q(oa)-.15 E F2
-(lon0/lat0/azimuth/scale)A F0
-(\(Oblique Mercator \255 point and azimuth\))2.5 E F1<ad4a>144 376.8 Q
-(ob)-.15 E F2(lon0/lat0/lon1/lat1/scale)A F0(\(Oblique Mercator \255 tw)
-2.5 E 2.5(op)-.1 G(oints\))-2.5 E F1<ad4a>144 388.8 Q(oc)-.15 E F2
-(lon0/lat0/lonp/latp/scale)A F0
-(\(Oblique Mercator \255 point and pole\))2.5 E F1(\255Jq)144 400.8 Q F2
-(lon0/scale)A F0
-(\(Equidistant Cylindrical Projection \(Plate Carree\)\))2.5 E F1
-(\255Jt)144 412.8 Q F2(lon0/scale)A F0(\(TM \255 T)2.5 E(ransv)-.35 E
-(erse Mercator\))-.15 E F1<ad4a>144 424.8 Q(u)-.15 E F2(zone/scale)A F0
-(\(UTM \255 Uni)2.5 E -.15(ve)-.25 G(rsal T).15 E(ransv)-.35 E
-(erse Mercator\))-.15 E F1(\255Jy)144 436.8 Q F2(lon0/lats/scale)A F0
-(\(Basic Cylindrical Projection\))2.5 E F1(AZIMUTHAL PR)144 460.8 Q
-(OJECTIONS:)-.3 E<ad4a>144 484.8 Q(a)-.15 E F2(lon0/lat0/scale)A F0
-(\(Lambert\).)2.5 E F1<ad4a>144 496.8 Q(e)-.15 E F2(lon0/lat0/scale)A F0
-(\(Equidistant\).)2.5 E F1(\255Jg)144 508.8 Q F2(lon0/lat0/scale)A F0
-(\(Orthographic\).)2.5 E F1(\255Js)144 520.8 Q F2(lon0/lat0/scale)A F0
-(\(General Stereographic\))2.5 E F1(CONIC PR)144 544.8 Q(OJECTIONS:)-.3
-E(\255Jb)144 568.8 Q F2(lon0/lat0/lat1/lat2/scale)A F0(\(Albers\))2.5 E
-F1(\255Jl)144 580.8 Q F2(lon0/lat0/lat1/lat2/scale)A F0(\(Lambert\))2.5
-E F1(MISCELLANEOUS PR)144 604.8 Q(OJECTIONS:)-.3 E(\255Jh)144 628.8 Q F2
-(lon0/scale)A F0(\(Hammer\))2.5 E F1(\255Ji)144 640.8 Q F2(lon0/scale)A
-F0(\(Sinusoidal\))2.5 E F1(\255Jk)144 652.8 Q F2(lon0/scale)A F0(\(Eck)
-2.5 E(ert VI\))-.1 E F1(\255Jn)144 664.8 Q F2(lon0/scale)A F0
-(\(Robinson\))2.5 E F1(\255Jr)144 676.8 Q F2(lon0/scale)A F0(\(W)2.5 E
-(ink)-.4 E(el T)-.1 E(ripel\))-.35 E F1(\255Jw)144 688.8 Q F2
-(lon0/scale)A F0(\(Moll)2.5 E(weide\))-.1 E F1(NON-GEOGRAPHICAL PR)144
-712.8 Q(OJECTIONS:)-.3 E F0(MB-System 5.0)72 768 Q 2.5(5F)137.61 G
-(ebruary 2015)-2.5 E(3)195.95 E 0 Cg EP
-%%Page: 4 4
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mbsw)72 48 Q 152.16(ath\(1\) MB-System)-.1 F
-152.16(5.0 mbsw)2.5 F(ath\(1\))-.1 E/F1 10/Times-Bold at 0 SF(\255Jp)144 84
-Q/F2 10/Times-Italic at 0 SF(scale)A F0
-(\(Linear projection for polar \(theta,r\) coordinates\))2.5 E F1
-(\255Jx)144 96 Q F2(x-scale)A F0([)A F1(l|p)A F2(pow)A F0(][)A F2
-(/y-scale)A F0([)A F1(l|p)A F2(pow)A F0(]] \(Linear)A 2.5(,l)-.4 G
-(og, and po)-2.5 E(wer scaling\))-.25 E
-(More details can be found in the)144 108 Q F1(psbasemap)2.5 E F0
-(manpages.)2.5 E F1<ad4b>108 124.8 Q F0(More)22.52 E F2 -.8(Po)2.5 G
-(stScript).8 E F0(code will be appended later [Def)2.5 E
-(ault terminates the plot system].)-.1 E F1<ad4c>108 141.6 Q F2
-(lon\215ip)23.63 E F0 .458(Sets the range of the longitude v)144 153.6 R
-.459(alues returned by the sw)-.25 F .459(ath sonar i/o routines.)-.1 F
-(If)5.459 E F2(lon\215ip)2.959 E F0 .459(=\2551 then)B .892
-(the longitude v)144 165.6 R .892
-(alues will be in the range from \255360 to 0 de)-.25 F .892(grees. If)
--.15 F F2(lon\215ip)3.391 E F0 .891(=0 then the longitude)B -.25(va)144
-177.6 S .131(lues will be in the range from \255180 to 180 de).25 F .131
-(grees. If)-.15 F F2(lon\215ip)2.631 E F0 .131(=1 then the longitude v)B
-.132(alues will be)-.25 F(in the range from 0 to 360 de)144 189.6 Q 2.5
-(grees. Def)-.15 F(ault:)-.1 E F2(lon\215ip)2.5 E F0 2.5(=0)2.5 G(.)-2.5
-E F1<ad4e>108 206.4 Q F2(cpt\214le)23.08 E F0(Normally)144 218.4 Q 2.924
-(,s)-.65 G .424(hading of bath)-2.924 F .424(ymetry with amplitudes \()
--.05 F F2(mode)A F0 2.924(=3a)2.924 G 2.924(ss)-2.924 G .424
-(et with the)-2.924 F F1<ad5a>2.923 E F0 .423(option\) is accom-)2.923 F
-.707(plished by linearly mapping the amplitudes to shade v)144 230.4 R
-.707(alues. This option speci\214es a grayscale cpt)-.25 F
-(\214le used to map amplitude v)144 242.4 Q(alues to grayscale shade v)
--.25 E(alues.)-.25 E F1<ad4f>108 259.2 Q F0(Selects Ov)22.52 E
-(erlay plot mode [Def)-.15 E(ault initializes a ne)-.1 E 2.5(wp)-.25 G
-(lot system].)-2.5 E F1<ad50>108 276 Q F0
-(Selects Portrait plotting mode [GMT Def)24.19 E
-(ault is Landscape, see gmtdef)-.1 E(aults to change this].)-.1 E F1
-<ad70>108 292.8 Q F2(pings)24.74 E F0 1.22(Sets the ping a)144 304.8 R
--.15(ve)-.2 G 1.22(raging of the input data. If).15 F F2(pings)3.719 E
-F0 3.719(=1)3.719 G 3.719(,t)-3.719 G 1.219(hen no ping a)-3.719 F -.15
-(ve)-.2 G 1.219(raging is performed. If).15 F F2(pings)144 316.8 Q F0
-2.651(>0)2.651 G 2.651(,t)-2.651 G .151
-(hen that number of input pings will be a)-2.651 F -.15(ve)-.2 G .152
-(raged to produce one output ping.).15 F(If)5.152 E F2(pings)2.652 E F0
-(=)2.652 E .314(0, then the ping a)144 328.8 R -.15(ve)-.2 G .313(ragin\
-g will automatically be done so that the along-track ping spacing is eq\
-ual).15 F(to the across-track beam spacing.)144 340.8 Q(Def)5 E(ault:)
--.1 E F2(pings)2.5 E F0 2.5(=1\()2.5 G(no ping a)-2.5 E -.15(ve)-.2 G
-(raging\).).15 E F1<ad51>108 357.6 Q F2(dpi)22.52 E F0 .544
-(Sets the resolution of the color image output by)144 369.6 R F1
-(mbswath)3.044 E F0 .544(in pix)3.044 F .544(els per inch \(e)-.15 F
-.544(xcept when the)-.15 F F1<ad31>3.045 E F0
-(option is used to force indi)144 381.6 Q
-(vidual polygon color \214lls\). Def)-.25 E(ault:)-.1 E F2(dpi)2.5 E F0
-2.5(=1)2.5 G(00.)-2.5 E F1<ad52>108 398.4 Q F2(west/east/south/north)
-23.08 E F0 1.335(Sets the longitude and latitude bounds within which sw)
-144 410.4 R 1.334(ath sonar data will be read and plotted.)-.1 F 2.696
-(Only the data which lies within these bounds will be read.)144 422.4 R
-(Def)7.696 E(ault:)-.1 E F2(west)5.197 E F0 2.697(=\255360, east)B F2
-(=360)A F0(,)A F2(south)144 434.4 Q F0(=\25590,)A F2(north)2.5 E F0
-(=90.)A F1<ad53>108 451.2 Q F2(speed)24.74 E F0 .532
-(Sets the minimum speed in km/hr \(5.5 kts ~ 10 km/hr\) allo)144 463.2 R
-.531(wed in the input data; pings associated)-.25 F
-(with a smaller ship speed will not be processed. Def)144 475.2 Q(ault:)
--.1 E F2(speed)2.5 E F0 2.5(=0)2.5 G(.)-2.5 E F1<ad54>108 492 Q F2(time)
-23.63 E(gap)-.4 E F0 .478(Sets the maximum time g)144 504 R .479
-(ap in minutes between adjacent pings allo)-.05 F .479
-(wed before the data is consid-)-.25 F(ered to ha)144 516 Q .3 -.15
-(ve a g)-.2 H(ap. Def).1 E(ault:)-.1 E F2(time)2.5 E(gap)-.4 E F0 2.5
-(=1)2.5 G(.)-2.5 E F1<ad55>108 532.8 Q F0(Dra)23.08 E 2.625(wU)-.15 G
-.124(nix System time stamp on plot.)-2.625 F(Optionally)5.124 E 2.624
-(,a)-.65 G .124(ppend a label, or 'c' which will plot the com-)-2.624 F
-(mand string.)144 544.8 Q F1<ad56>108 561.6 Q F0(Selects v)23.08 E
-(erbose mode, which will send progress reports to stderr [Def)-.15 E
-(ault runs "silently"].)-.1 E F1<ad57>108 578.4 Q F0(Normally)20.3 E(,)
--.65 E F1(mbswath)4.77 E F0 -.1(wo)4.77 G 2.27(rks with bath).1 F 2.27
-(ymetry v)-.05 F 2.27(alues in meters.)-.25 F 2.27(If the)7.27 F F1
-<ad57>4.77 E F0 2.27(\215ag is gi)4.77 F -.15(ve)-.25 G 2.27(n, then).15
-F F1(mbswath)144 590.4 Q F0 .004(will w)2.504 F .003(ork with bath)-.1 F
-.003(ymetry v)-.05 F .003
-(alues in feet. The color palette \214le used must conform to the)-.25 F
-(range of bath)144 602.4 Q(ymetry v)-.05 E(alues in feet.)-.25 E F1
-<ad5820ad59>108 619.2 Q F0(Shift origin of plot by \()7.66 E F2
-(x-shift,y-shift)A F0 2.5(\)i)C 2.5(nches [Def)-2.5 F
-(ault is \(1,1\) for ne)-.1 E 2.5(wp)-.25 G(lots, \(0,0\) for o)-2.5 E
--.15(ve)-.15 G(rlays].).15 E F1<ad5a>108 636 Q F2(mode[F])23.63 E F0
-(Sets the style of the plot.)144 648 Q F2(mode)180 660 Q F0 2.5(=1)2.5 G
-31.92(:C)-2.5 G(olor \214ll of bath)-31.92 E(ymetry data.)-.05 E F2
-(mode)180 672 Q F0 2.5(=2)2.5 G 31.92(:C)-2.5 G(olor shaded relief bath)
--31.92 E(ymetry)-.05 E(.)-.65 E F2(mode)180 684 Q F0 2.5(=3)2.5 G 31.92
-(:B)-2.5 G(ath)-31.92 E(ymetry shaded using amplitude data.)-.05 E F2
-(mode)180 696 Q F0 2.5(=4)2.5 G 31.92(:C)-2.5 G
-(olor \214ll of amplitude data.)-31.92 E F2(mode)180 708 Q F0 2.5(=5)2.5
-G 31.92(:C)-2.5 G(olor \214ll of sidescan data.)-31.92 E 1.238
-(If "F" is appended to)144 720 R F2(mode)3.738 E F0 3.738(,t)C(hen)
--3.738 E F1(mbswath)3.738 E F0 1.238
-(will attempt to plot amplitude or sidescan data that)3.738 F
-(MB-System 5.0)72 768 Q 2.5(5F)137.61 G(ebruary 2015)-2.5 E(4)195.95 E 0
-Cg EP
-%%Page: 5 5
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mbsw)72 48 Q 152.16(ath\(1\) MB-System)-.1 F
-152.16(5.0 mbsw)2.5 F(ath\(1\))-.1 E(ha)144 84 Q .462 -.15(ve b)-.2 H
-.162(een \214ltered with).15 F/F1 10/Times-Bold at 0 SF(mb\214lter)2.662 E
-F0 5.162(.I)C 2.662(ft)-5.162 G .162
-(he desired \214ltered data \214les do not e)-2.662 F .161
-(xist, plotting will f)-.15 F .161(ail and)-.1 F F1(mbswath)144 96 Q F0
-.117(will e)2.617 F .117(xit with an error message. Filtered amplitude \
-data are stored in ancilliary \214les end-)-.15 F 1.308(ing with ".f)144
-108 R -.1(fa)-.25 G 1.308(", and \214ltered sidescan \214les end in ".f)
-.1 F 1.307(fs". Filtering of bath)-.25 F 1.307(ymetry data is not sup-)
--.05 F(ported, and so appending "F" to)144 120 Q/F2 10/Times-Italic at 0 SF
-(mode)2.5 E F0 -.25(va)2.5 G(lues of 1 or 2 will ha).25 E .3 -.15(ve n)
--.2 H 2.5(oe).15 G -.25(ff)-2.5 G 2.5(ect. Def).25 F(ault:)-.1 E F2
-(mode)2.5 E F0 2.5(=1)2.5 G(;)-2.5 E F1<ad30>108 136.8 Q F0
-(Create the image using the Adobe)25.3 E F2 -.8(Po)2.5 G(stScript).8 E
-F0(colorimage operator)2.5 E 5(.T)-.55 G(his is the def)-5 E(ault.)-.1 E
-F1<ad31>108 153.6 Q F0(Create the image by plotting indi)25.3 E
-(vidual color polygons.)-.25 E F1<ad32>108 170.4 Q F0(Create the image \
-by color separation using three calls to image for later processing by)
-25.3 E F1(psto24)2.5 E F0(.)A/F3 10.95/Times-Bold at 0 SF(EXAMPLES)72 187.2
-Q F0 .792(Suppose the user has a Hydrosweep data \214le in the L-DEO in\
--house binary format \()108 199.2 R F1(MBIO)A F0 .792(format id 24\))
-3.292 F 1.022(called hs_e)108 211.2 R 1.021
-(w9302_157_mn.mb24 which lies in the re)-.25 F 1.021
-(gion w/s/e/n = \25532.1874/-26.6236/54.6349/56.7536.)-.15 F(The follo)
-108 223.2 Q(wing will suf)-.25 E
-(\214ce to generate a color \214ll plot:)-.25 E(gmt mbsw)144 235.2 Q
-(ath \255Idatalist \255Jm1.46578 \255R-32.1874/-26.6236/54.6349/56.7536)
--.1 E(-B1/1 \255Ccolor)180 247.2 Q(.cpt \255p1 \255A1 \255Q100 \255Z2)
--.55 E(-X1 \255Y1.75 \255V > mbsw)180 259.2 Q(ath.ps)-.1 E
-(where the \214le datalist contains:)108 271.2 Q(hs_e)144 283.2 Q
-(w9302_157_mn.mb24 24)-.25 E 3.274(Am)108 295.2 S .774
-(ore complicated plot including a na)-3.274 F(vig)-.2 E .774
-(ation track and a color scale can be created using)-.05 F F1(mbswath)
-3.275 E F0(in)3.275 E .915(conjunction with other GMT and GMT)108 307.2
-R .914(-compatible utilities.)-.92 F .914(The follo)5.914 F .914
-(wing is an e)-.25 F .914(xample of a shellscript)-.15 F
-(which generates such a plot and then displays it on the screen:)108
-319.2 Q(#)110.5 343.2 Q 2.5(#S)110.5 355.2 S
-(hellscript to create Postscript plot of sw)-2.5 E(ath sonar data)-.1 E
-2.5(#C)110.5 367.2 S(reated by macro mbm_plot)-2.5 E(#)110.5 379.2 Q 2.5
-(#M)110.5 391.2 S(ak)-2.5 E 2.5(ed)-.1 G(atalist \214le)-2.5 E
-(echo Making datalist \214le...)110.5 403.2 Q(echo hs_e)110.5 415.2 Q
-(w9302_157_bmn.mb24 24 > datalist)-.25 E(#)110.5 427.2 Q 2.5(#M)110.5
-439.2 S(ak)-2.5 E 2.5(ec)-.1 G(olor palette table \214le)-2.5 E
-(echo Making color palette table \214le...)110.5 451.2 Q
-(echo 2235 255 255 255 2372 255 221 171 > hs_e)110.5 463.2 Q
-(w9302_157_bmn.mb24.cpt)-.25 E
-(echo 2372 255 221 171 2509 255 186 133 >> hs_e)110.5 475.2 Q
-(w9302_157_bmn.mb24.cpt)-.25 E
-(echo 2509 255 186 133 2646 255 161 68 >> hs_e)110.5 487.2 Q
-(w9302_157_bmn.mb24.cpt)-.25 E
-(echo 2646 255 161 68 2783 255 189 87 >> hs_e)110.5 499.2 Q
-(w9302_157_bmn.mb24.cpt)-.25 E
-(echo 2783 255 189 87 2920 240 236 121 >> hs_e)110.5 511.2 Q
-(w9302_157_bmn.mb24.cpt)-.25 E
-(echo 2920 240 236 121 3057 205 255 162 >> hs_e)110.5 523.2 Q
-(w9302_157_bmn.mb24.cpt)-.25 E
-(echo 3057 205 255 162 3193 138 236 174 >> hs_e)110.5 535.2 Q
-(w9302_157_bmn.mb24.cpt)-.25 E
-(echo 3193 138 236 174 3330 106 235 255 >> hs_e)110.5 547.2 Q
-(w9302_157_bmn.mb24.cpt)-.25 E
-(echo 3330 106 235 255 3467 87 215 255 >> hs_e)110.5 559.2 Q
-(w9302_157_bmn.mb24.cpt)-.25 E
-(echo 3467 87 215 255 3604 50 190 255 >> hs_e)110.5 571.2 Q
-(w9302_157_bmn.mb24.cpt)-.25 E
-(echo 3604 50 190 255 3741 0 160 255 >> hs_e)110.5 583.2 Q
-(w9302_157_bmn.mb24.cpt)-.25 E
-(echo 3741 0 160 255 3878 40 127 251 >> hs_e)110.5 595.2 Q
-(w9302_157_bmn.mb24.cpt)-.25 E
-(echo 3878 40 127 251 4015 21 92 236 >> hs_e)110.5 607.2 Q
-(w9302_157_bmn.mb24.cpt)-.25 E
-(echo 4015 21 92 236 4152 37 57 175 >> hs_e)110.5 619.2 Q
-(w9302_157_bmn.mb24.cpt)-.25 E(#)110.5 631.2 Q 2.5(#R)110.5 643.2 S
-(un mbsw)-2.5 E(ath)-.1 E(echo Running mbsw)110.5 655.2 Q(ath...)-.1 E
-2.396(gmt mbsw)110.5 667.2 R 2.396
-(ath \255Idatalist \255Jm1.46578 \255R-32.1874/-26.6236/54.6349/56.7536)
--.1 F(-B1.1128/1.1128":.Data)17.346 E 1.664(File hs_e)108 679.2 R 4.884
-(w9302_157_bmn.mb24:" -Chs_e)-.25 F 1.664
-(w9302_157_bmn.mb24.cpt \255p1 \255A1 \255Q100 \255G5/0 \255Z2 \255X1)
--.25 F(-Y1.75 \255K \255V > hs_e)116.31 691.2 Q(w9302_157_bmn.mb24.ps)
--.25 E(#)110.5 703.2 Q 2.5(#R)110.5 715.2 S(un mblist)-2.5 E
-(echo Running mblist...)110.5 727.2 Q(MB-System 5.0)72 768 Q 2.5(5F)
-137.61 G(ebruary 2015)-2.5 E(5)195.95 E 0 Cg EP
-%%Page: 6 6
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mbsw)72 48 Q 152.16(ath\(1\) MB-System)-.1 F
-152.16(5.0 mbsw)2.5 F(ath\(1\))-.1 E(mblist \255F24 \255Ihs_e)110.5 84 Q
-(w9302_157_bmn.mb24 \255O)-.25 E(XYU > hs_e)-.4 E(w9302_157_bmn.mb24.na)
--.25 E(v)-.2 E(#)110.5 96 Q 2.5(#R)110.5 108 S(un pstrack)-2.5 E
-(echo Running pstrack...)110.5 120 Q 6.25(gmt pstrack hs_e)110.5 132 R
-(w9302_157_bmn.mb24.na)-.25 E 8.75<76ad>-.2 G 21.4
-(Jm1.46578 -R-32.1874/-26.6236/54.6349/56.7536)-8.75 F 6.239
-(\255B1.1128/1.1128":.Data File)108 144 R(hs_e)33.849 E 6.238
-(w9302_157_bmn.mb24:" \255W1p \255Mt15ma1h \255O \255K >>)-.25 F(hs_e)
-108 156 Q(w9302_157_bmn.mb24.ps)-.25 E(#)110.5 168 Q 2.5(#R)110.5 180 S
-(un psscale)-2.5 E(echo Running psscale...)110.5 192 Q(gmt psscale)110.5
-204 Q(\255Chs_e)5 E
-(w9302_157_bmn.mb24.cpt \255D4.0777/-0.5000/6.5242/0.1500h)-.25 E
-(-B":.Depth \(meters\):" \255O \255V >> hs_e)144 216 Q
-(w9302_157_bmn.mb24.ps)-.25 E(#)110.5 228 Q 2.5(#D)110.5 240 S
-(elete surplus \214les)-2.5 E(echo Deleting surplus \214les...)110.5 252
-Q(rm \255f hs_e)110.5 264 Q(w9302_157_bmn.mb24.cpt datalist hs_e)-.25 E
-(w9302_157_bmn.mb24.na)-.25 E(v)-.2 E(#)110.5 276 Q 2.5(#R)110.5 288 S
-(un page)-2.5 E(vie)-.25 E(w)-.25 E(echo Running gv in background...)
-110.5 300 Q(gv hs_e)110.5 312 Q(w9302_157_bmn.mb24.ps &)-.25 E(#)110.5
-324 Q 2.5(#A)110.5 336 S(ll done!)-2.5 E(echo All done!)110.5 348 Q/F1
-10.95/Times-Bold at 0 SF(SEE ALSO)72 376.8 Q/F2 10/Times-Bold at 0 SF
-(mbsystem)108 388.8 Q F0(\(1\),)A F2(mbm_plot)2.5 E F0(\(1\),)A F2
-(mbcontour)2.5 E F0(\(1\),)A F2(mb\214lter)5 E F0(\(1\),)A F2(gmtsystem)
-2.5 E F0(\(1\),)A F2(psbasemap)2.5 E F0(\(1\),)A F2(psto24)2.5 E F0
-(\(1\))A F1 -.11(BU)72 417.6 S(GS).11 E F0(Let us kno)108 429.6 Q -.65
-(w.)-.25 G(MB-System 5.0)72 768 Q 2.5(5F)137.61 G(ebruary 2015)-2.5 E(6)
-195.95 E 0 Cg EP
-%%Trailer
-end
-%%EOF
diff --git a/src/ps/mbswplspreprocess.ps b/src/ps/mbswplspreprocess.ps
deleted file mode 100644
index 75dd919..0000000
--- a/src/ps/mbswplspreprocess.ps
+++ /dev/null
@@ -1,427 +0,0 @@
-%!PS-Adobe-3.0
-%%Creator: groff version 1.19.2
-%%CreationDate: Wed Jul  1 12:29:31 2015
-%%DocumentNeededResources: font Times-Roman
-%%+ font Times-Bold
-%%+ font Times-Italic
-%%DocumentSuppliedResources: procset grops 1.19 2
-%%Pages: 3
-%%PageOrder: Ascend
-%%DocumentMedia: Default 612 792 0 () ()
-%%Orientation: Portrait
-%%EndComments
-%%BeginDefaults
-%%PageMedia: Default
-%%EndDefaults
-%%BeginProlog
-%%BeginResource: procset grops 1.19 2
-%!PS-Adobe-3.0 Resource-ProcSet
-/setpacking where{
-pop
-currentpacking
-true setpacking
-}if
-/grops 120 dict dup begin
-/SC 32 def
-/A/show load def
-/B{0 SC 3 -1 roll widthshow}bind def
-/C{0 exch ashow}bind def
-/D{0 exch 0 SC 5 2 roll awidthshow}bind def
-/E{0 rmoveto show}bind def
-/F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def
-/G{0 rmoveto 0 exch ashow}bind def
-/H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/I{0 exch rmoveto show}bind def
-/J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def
-/K{0 exch rmoveto 0 exch ashow}bind def
-/L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/M{rmoveto show}bind def
-/N{rmoveto 0 SC 3 -1 roll widthshow}bind def
-/O{rmoveto 0 exch ashow}bind def
-/P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/Q{moveto show}bind def
-/R{moveto 0 SC 3 -1 roll widthshow}bind def
-/S{moveto 0 exch ashow}bind def
-/T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/SF{
-findfont exch
-[exch dup 0 exch 0 exch neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/MF{
-findfont
-[5 2 roll
-0 3 1 roll
-neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/level0 0 def
-/RES 0 def
-/PL 0 def
-/LS 0 def
-/MANUAL{
-statusdict begin/manualfeed true store end
-}bind def
-/PLG{
-gsave newpath clippath pathbbox grestore
-exch pop add exch pop
-}bind def
-/BP{
-/level0 save def
-1 setlinecap
-1 setlinejoin
-72 RES div dup scale
-LS{
-90 rotate
-}{
-0 PL translate
-}ifelse
-1 -1 scale
-}bind def
-/EP{
-level0 restore
-showpage
-}def
-/DA{
-newpath arcn stroke
-}bind def
-/SN{
-transform
-.25 sub exch .25 sub exch
-round .25 add exch round .25 add exch
-itransform
-}bind def
-/DL{
-SN
-moveto
-SN
-lineto stroke
-}bind def
-/DC{
-newpath 0 360 arc closepath
-}bind def
-/TM matrix def
-/DE{
-TM currentmatrix pop
-translate scale newpath 0 0 .5 0 360 arc closepath
-TM setmatrix
-}bind def
-/RC/rcurveto load def
-/RL/rlineto load def
-/ST/stroke load def
-/MT/moveto load def
-/CL/closepath load def
-/Fr{
-setrgbcolor fill
-}bind def
-/setcmykcolor where{
-pop
-/Fk{
-setcmykcolor fill
-}bind def
-}if
-/Fg{
-setgray fill
-}bind def
-/FL/fill load def
-/LW/setlinewidth load def
-/Cr/setrgbcolor load def
-/setcmykcolor where{
-pop
-/Ck/setcmykcolor load def
-}if
-/Cg/setgray load def
-/RE{
-findfont
-dup maxlength 1 index/FontName known not{1 add}if dict begin
-{
-1 index/FID ne{def}{pop pop}ifelse
-}forall
-/Encoding exch def
-dup/FontName exch def
-currentdict end definefont pop
-}bind def
-/DEFS 0 def
-/EBEGIN{
-moveto
-DEFS begin
-}bind def
-/EEND/end load def
-/CNT 0 def
-/level1 0 def
-/PBEGIN{
-/level1 save def
-translate
-div 3 1 roll div exch scale
-neg exch neg exch translate
-0 setgray
-0 setlinecap
-1 setlinewidth
-0 setlinejoin
-10 setmiterlimit
-[]0 setdash
-/setstrokeadjust where{
-pop
-false setstrokeadjust
-}if
-/setoverprint where{
-pop
-false setoverprint
-}if
-newpath
-/CNT countdictstack def
-userdict begin
-/showpage{}def
-/setpagedevice{}def
-}bind def
-/PEND{
-countdictstack CNT sub{end}repeat
-level1 restore
-}bind def
-end def
-/setpacking where{
-pop
-setpacking
-}if
-%%EndResource
-%%EndProlog
-%%BeginSetup
-%%BeginFeature: *PageSize Default
-<< /PageSize [ 612 792 ] /ImagingBBox null >> setpagedevice
-%%EndFeature
-%%IncludeResource: font Times-Roman
-%%IncludeResource: font Times-Bold
-%%IncludeResource: font Times-Italic
-grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72
-def/PL 792 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron/Zcaron
-/scaron/zcaron/Ydieresis/trademark/quotesingle/Euro/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/space/exclam/quotedbl/numbersign/dollar/percent
-/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen
-/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon
-/semicolon/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O
-/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright/circumflex
-/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y
-/z/braceleft/bar/braceright/tilde/.notdef/quotesinglbase/guillemotleft
-/guillemotright/bullet/florin/fraction/perthousand/dagger/daggerdbl
-/endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut
-/dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash
-/quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen
-/brokenbar/section/dieresis/copyright/ordfeminine/guilsinglleft
-/logicalnot/minus/registered/macron/degree/plusminus/twosuperior
-/threesuperior/acute/mu/paragraph/periodcentered/cedilla/onesuperior
-/ordmasculine/guilsinglright/onequarter/onehalf/threequarters
-/questiondown/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE
-/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex
-/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis
-/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn
-/germandbls/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla
-/egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis
-/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide/oslash
-/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis]def
-/Times-Italic at 0 ENC0/Times-Italic RE/Times-Bold at 0 ENC0/Times-Bold RE
-/Times-Roman at 0 ENC0/Times-Roman RE
-%%EndSetup
-%%Page: 1 1
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 109.85(mbswplspreprocess\(1\) MB-System)72 48 R
-109.85(5.0 mbswplspreprocess\(1\))2.5 F/F1 10.95/Times-Bold at 0 SF -.219
-(NA)72 84 S(ME).219 E/F2 10/Times-Bold at 0 SF(mbswplspr)108 96 Q(epr)-.18
-E(ocess)-.18 E F0 3.149<ad70>3.149 G .649(repairs a SW)-3.149 F -1.11
-(AT)-1.2 G .649(Hplus sonar \214le \()1.11 F F2(MBIO)A F0 .648
-(format 222\) for processed with MB Sys-)3.149 F(tem.)108 108 Q F1
-(VERSION)72 124.8 Q F0 -1.11(Ve)108 136.8 S(rsion 5.0)1.11 E F1
-(SYNOPSIS)72 165.6 Q F2(mbswplspr)108 177.6 Q(epr)-.18 E(ocess)-.18 E F0
-([)2.5 E F2(\255ABGNRSHV)A F0 2.5(][)C F2<ad46>-2.5 E/F3 10
-/Times-Italic at 0 SF(format)A F0 2.5(][)C F2<ad4a>-2.5 E F3(pr)A
-(oj4command)-.45 E F0 2.5(][)C F2<ad4f>-2.5 E F3(out\214le)A F0(])A F2
-<ad49>2.5 E F3(\214le)A F1(DESCRIPTION)72 206.4 Q F2(mbswplspr)108 218.4
-Q(epr)-.18 E(ocess)-.18 E F0 .233(prepairs a SW)2.733 F -1.11(AT)-1.2 G
-.233(Hplus SXP \()1.11 F F2(MBIO)A F0 .233
-(format 222\) \214le for processing with MB System.)2.733 F .098
-(MB System can read and plot SXP \214les without modi\214cation. Ho)108
-235.2 R(we)-.25 E -.15(ve)-.25 G .897 -.4(r, m).15 H(an).4 E 2.597(yo)
--.15 G 2.597(ft)-2.597 G .097(he editing and calibration)-2.597 F .352
-(programs w)108 247.2 R .352(ork best if each transducer channel is sto\
-red in a separate \214le \(use the)-.1 F F2<ad53>2.853 E F0 .353
-(option\). In particular)2.853 F(,)-.4 E 1.038(multiple transducer chan\
-nels pinging simultaneously will trip up time \214ltering, since each c\
-hannel in the)108 259.2 R(ping series has the same time stamp.)108 271.2
-Q .753(If during data acquisition using the SEA SW)108 288 R -1.11(AT)
--1.2 G 3.253(HR)1.11 G(eal-T)-3.253 E .753
-(ime Acquisition System \(SEA Sw)-.35 F .754(ath Processor\),)-.1 F .25
-(the "Store All Data" option w)108 300 R .25
-(as selected in combination with the "Do)-.1 F .25(wnsample" Bath)-.25 F
-2.75<798c>-.05 G(lter)-2.75 E 2.75(,t)-.4 G .25(he SXP ping)-2.75 F .235
-(records will contain both the original data \(all samples rejected\) a\
-nd the \214ltered data \(all samples accepted\))108 312 R
-(simultaneously)108 324 Q 3.016(.T)-.65 G .515
-(his will confuse most programs in MB System. Use the)-3.016 F F2<ad42>
-3.015 E F0(and)3.015 E F2<ad52>3.015 E F0 .515(options as needed to)
-3.015 F(strip out the undesired set prior to processing.)108 336 Q .21
-(SXP ping records contain both a ra)108 352.8 R 2.71(wa)-.15 G .211
-(mplitude and a processed amplitude v)-2.71 F .211
-(alue for each sample. MB Sys-)-.25 F .272(tem reads and writes ONL)108
-364.8 R 2.772(Yt)-1 G .272(he processed amplitude v)-2.772 F .272
-(alues, lea)-.25 F .272(ving the ra)-.2 F 2.772(wv)-.15 G .272
-(alues untouched. Use the)-3.022 F F2<ad41>2.771 E F0 .551
-(option to cop)108 376.8 R 3.051(y\()-.1 G .551(or restore\) the ra)
--3.051 F 3.052(wa)-.15 G .552(mplitude v)-3.052 F .552
-(alues into the processed amplitude slots so that the)-.25 F 3.052(yc)
--.15 G .552(an be)-3.052 F(accessed by MB System.)108 388.8 Q F1 -.548
-(AU)72 405.6 S(THORSHIP).548 E F0(Da)108 417.6 Q(vid P)-.2 E 2.5(.F)
--1.11 G(inlayson \(d\214nlayson at usgs.go)-2.5 E(v\))-.15 E -.15(Pa)110.5
-429.6 S(ci\214c Coastal and Marine Science Center).15 E 2.5(,U)-.4 G
-(SGS)-2.5 E F1(OPTIONS)72 446.4 Q F2<ad41>108 458.4 Q F0 .271
-(This option causes the program to cop)144 470.4 R 2.771(yt)-.1 G .271
-(he ra)-2.771 F 2.771(wa)-.15 G .271(mplitude v)-2.771 F .27
-(alues stored with each sample into the)-.25 F(corresponding processed \
-amplitude slot where it can then be used by MB System.)144 482.4 Q F2
-<ad42>108 499.2 Q F0 2.365(This option causes the program to re)144
-511.2 R -.15(ve)-.25 G 2.366
-(rse the sample \215ag setting. That is, rejected samples).15 F
-(become accepted samples and vis-a-vis. This option is al)144 523.2 Q
--.1(wa)-.1 G(ys applied before option).1 E F2<ad52>2.5 E F0(.)A F2<ad46>
-108 540 Q F3(format)24.19 E F0 .107(Sets the data format used if the in\
-put is read from stdin or from a \214le.)144 552 R(If)5.106 E F3(format)
-2.606 E F0 2.606(<0)2.606 G 2.606(,t)-2.606 G .106(hen the input)-2.606
-F .007(\214le speci\214ed with the)144 564 R F2<ad49>2.507 E F0 .008
-(option will actually contain a list of input sw)2.508 F .008
-(ath sonar data \214les. This pro-)-.1 F(gram only reads Bath)144 576 Q
-(ysw)-.05 E(ath \(SW)-.1 E -1.11(AT)-1.2 G
-(Hplus\) format data \214les \()1.11 E F2(MBIO)A F0(format 222\).)2.5 E
-F2<ad47>108 592.8 Q F0(Print to stdout an ASCII representation of each \
-data record read from the \214le.)22.52 E F2<ad48>108 609.6 Q F0 .162(T\
-his "help" \215ag cause the program to print out a description of its o\
-peration and then e)22.52 F .161(xit immedi-)-.15 F(ately)144 621.6 Q(.)
--.65 E F2<ad49>108 638.4 Q F3(in\214le)26.41 E F0 .514
-(Sets the input \214le path. If)144 650.4 R F3(format)3.015 E F0 3.015
-(>0\()3.015 G .515(set with the)-3.015 F F2<ad66>3.015 E F0 .515
-(option or)3.015 F F2(mbdefaults)3.015 E F0 3.015(\)t)C .515(hen the sw)
--3.015 F .515(ath sonar)-.1 F .797(data contained in)144 662.4 R F3
-(in\214le)3.297 E F0 .797(is read and processed. If)3.297 F F3(format)
-3.297 E F0 3.297(<0)3.297 G 3.297(,t)-3.297 G(hen)-3.297 E F3(in\214le)
-3.297 E F0 .796(is assumed to be an ascii)3.297 F .156
-(\214le containing a list of the input sw)144 674.4 R .157
-(ath sonar data \214les to be processed and their formats.)-.1 F .157
-(The pro-)5.157 F .929
-(gram will read the data in each one of these \214les.)144 686.4 R .928
-(In the)5.928 F F3(in\214le)3.428 E F0 .928
-(\214le, each data \214le should be fol-)3.428 F(lo)144 698.4 Q
-(wed by a data format identi\214er)-.25 E 2.5(,e)-.4 G(.g.:)-2.5 E
-(data\214le1 222 1)180 710.4 Q(data\214le2 222 1)180 722.4 Q
-(MB-System 5.0)72 768 Q(26 March 2014)140.11 E(1)198.45 E 0 Cg EP
-%%Page: 2 2
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 109.85(mbswplspreprocess\(1\) MB-System)72 48 R
-109.85(5.0 mbswplspreprocess\(1\))2.5 F(This program only reads SW)144
-84 Q -1.11(AT)-1.2 G(Hplus format data \214les \()1.11 E/F1 10
-/Times-Bold at 0 SF(MBIO)A F0(format 222\). .)2.5 E F1<ad4a>108 100.8 Q/F2
-10/Times-Italic at 0 SF(pr)25.3 E(ojection)-.45 E F0 .182(The SW)144 112.8
-R -1.11(AT)-1.2 G .182(Hplus softw)1.11 F .183
-(are packages operate with na)-.1 F(vig)-.2 E .183(ation in a user)-.05
-F .183(-de\214ned projected coordinate)-.2 F 3.82(system. Resultantly)
-144 124.8 R 3.82(,S)-.65 G 1.32(XP format \214les contain positions in \
-a projected coordinate system rather)-3.82 F .23
-(than longitude and latitude in geographic coordinates.)144 136.8 R
-(Generally)5.231 E 2.731(,t)-.65 G .231
-(he SXP \214les do not contain an)-2.731 F(y)-.15 E .753(description of\
- the projection used to obtain the eastings and northings in those \214\
-les.)144 148.8 R .752(This option)5.752 F(allo)144 160.8 Q .15(ws a use\
-r to speci\214y the projection used to translate the eastings and north\
-ings back into longi-)-.25 F .7(tude and latitude.)144 172.8 R .699
-(If this option is not speci\214ed,)5.7 F F1(MB-System)3.199 E F0 .699
-(will assume the data are associated)3.199 F .17(with UTM zone 1 north.)
-144 184.8 R .17(The projection identi\214er must conform to the same us\
-age as with projec-)5.17 F .174(tions speci\214ed for)144 196.8 R F1
-(mbgrid)2.674 E F0 5.174(.F)C .173
-(or instance, to fully specify a particular northern UTM zone, set pro-)
--5.324 F .842(jection = UTMXXN where XX gi)144 208.8 R -.15(ve)-.25 G
-3.342(st).15 G .842(he UTM zone \(de\214ned from 01 to 60\).)-3.342 F
-.843(As an e)5.843 F .843(xample, a)-.15 F .959
-(northern UTM zone 12 projection can be speci\214ed using -JUTM12N.)144
-220.8 R .958(Southern UTM zones are)5.958 F .353(speci\214ed as UTMXXS.)
-144 232.8 R .354(The European Petroleum Surv)5.354 F .654 -.15(ey G)-.15
-H .354(roup \(EPSG\) has de\214ned a lar).15 F .354(ge num-)-.18 F .455
-(ber of PCS')144 244.8 R 2.955(su)-.55 G .455(sed w)-2.955 F .455
-(orldwide and assigned number id')-.1 F 2.954(st)-.55 G 2.954(oe)-2.954
-G .454(ach; one can also specify the northern)-2.954 F .847
-(UTM zone 12 projection using its EPSG designation, or -Jepsg32612.)144
-256.8 R .847(The complete list of pro-)5.847 F
-(jected coordinate systems supported by MB-System is gi)144 268.8 Q -.15
-(ve)-.25 G 2.5(ni).15 G 2.5(nt)-2.5 G(he mbgrid manual page.)-2.5 E F1
-<ad4e>108 285.6 Q F0(Do not write output \214le. Useful for inspecting \
-\214les, especially combined with)23.08 E F1<ad47>2.5 E F0(.)A F1<ad4f>
-108 302.4 Q F2(out\214le)22.52 E F0 .944(This option causes)144 314.4 R
-F1(mbswplspr)3.444 E(epr)-.18 E(ocess)-.18 E F0 .943
-(to output all data to a single \214le speci\214ed as)3.444 F F2
-(out\214le)3.443 E F0 3.443(.B)C(y)-3.443 E(def)144 326.4 Q .264(ault, \
-the program creates output \214les for each input \214le. If combined w\
-ith)-.1 F F1<ad53>2.764 E F0 2.764(,t)C .264(his will serv)-2.764 F
-2.765(ea)-.15 G(s)-2.765 E
-(the basename for a set of output \214les, one for each transducer)144
-338.4 Q(.)-.55 E F1<ad52>108 355.2 Q F0(This option remo)23.08 E -.15
-(ve)-.15 G 2.5(sa).15 G
-(ll rejected samples from pings before writing output.)-2.5 E F1<ad53>
-108 372 Q F0 .024(This option sa)24.74 F -.15(ve)-.2 G 2.524(se).15 G
-.024(ach transducer channel into a separate output \214le. This is the \
-best w)-2.524 F .023(ay to handle)-.1 F .105
-(simultaneous pinging in MB System and the only w)144 384 R .106
-(ay to handle 3 or more transducer channel sys-)-.1 F(tems. The transdu\
-cer channel will be appended to the output \214lename as follo)144 396 Q
-(ws:)-.25 E(out\214le_tx)144 408 Q(er<channel>.mb222)-.15 E/F3 10.95
-/Times-Bold at 0 SF(EXAMPLES)72 424.8 Q F0 2.069
-(Suppose that one has collected a SW)108 436.8 R -1.11(AT)-1.2 G 2.068
-(Hplus data\214le incorporating interferometric sonar data from a)1.11 F
-(2-transducer system pinging simultaneously)108 448.8 Q 2.5(.T)-.65 G
-(he \214le name is:)-2.5 E(20140418_150155.sxp)144 465.6 Q 1.755 -.8
-(To s)108 482.4 T .155(plit each transducer into its o).8 F .156(wn \
-\214le for better \214ltering support from MB System, to reset the ampl\
-itude)-.25 F -.25(va)108 494.4 S(lues to their original pre-processed v)
-.25 E(alues, and to strip out an)-.25 E 2.5(yp)-.15 G(re)-2.5 E
-(viously \215agged data run:)-.25 E
-(mbswplspreprocess \255SAR \255I20140418_150155.sxp)144 511.2 Q 1.6 -.8
-(To e)108 528 T(xport the data records stored in an SXP \214le to a te)
-.65 E(xt \214le:)-.15 E
-(mbswplspreprocess \255GN \255I20140418_150155.sxp > output.txt)144
-544.8 Q F3(NO)72 566.4 Q(TES)-.438 E F0 .664
-(The SXP \214le format does not contain suf)108 578.4 R .664
-(\214cient information to completely re-process the data in MB Sys-)-.25
-F 1.168(tem itself. F)108 590.4 R 1.168(or e)-.15 F 1.168
-(xample, you should not attempt to re-calculate bath)-.15 F 1.168
-(ymetry based on ne)-.05 F 3.668(ws)-.25 G 1.168(ound v)-3.668 F
-(elocity)-.15 E .763(information. Ridged translations and rotations are\
- OK \(static shifts in x, y)108 602.4 R 3.263(,o)-.65 G 3.263(rz)-3.263
-G 3.263(,r)-3.263 G .763(otations about the trans-)-3.263 F .207
-(ducer reference point\) pro)108 614.4 R .208
-(vided that each transducer channel resides in its o)-.15 F .208
-(wn \214le \(see the)-.25 F F1<ad53>2.708 E F0 .208(option\). It is)
-2.708 F(al)108 626.4 Q -.1(wa)-.1 G
-(ys safe to edit and \214lter the soundings in).1 E F1(mbedit)2.5 E F0
-(and)2.5 E F1(mbeditviz)2.5 E F0(.)A .842(SXP \214les use a projected c\
-oordinate system for all transducer and sea \215oor sample coordinates.\
- The user)108 643.2 R .249(must supply a .PRJ \214le de\214ning the coo\
-rdinate system \(usually UTM\) for each input \214le before proceeding)
-108 655.2 R(with further processing in MB System. The coordinate system\
- is not stored in the SXP \214le data itself.)108 667.2 Q F3(SEE ALSO)72
-684 Q F1(mbsystem)108 696 Q F0(\(1\),)A F1(mbf)2.5 E(ormat)-.25 E F0
-(\(1\),)A F1(mbinf)2.5 E(o)-.25 E F0(\(1\))A(MB-System 5.0)72 768 Q
-(26 March 2014)140.11 E(2)198.45 E 0 Cg EP
-%%Page: 3 3
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 109.85(mbswplspreprocess\(1\) MB-System)72 48 R
-109.85(5.0 mbswplspreprocess\(1\))2.5 F/F1 10.95/Times-Bold at 0 SF -.11
-(BU)72 84 S(GS).11 E F0(Oh yeah.)108 96 Q(MB-System 5.0)72 768 Q
-(26 March 2014)140.11 E(3)198.45 E 0 Cg EP
-%%Trailer
-end
-%%EOF
diff --git a/src/ps/mbsystem.ps b/src/ps/mbsystem.ps
deleted file mode 100644
index 9d635bb..0000000
--- a/src/ps/mbsystem.ps
+++ /dev/null
@@ -1,2165 +0,0 @@
-%!PS-Adobe-3.0
-%%Creator: groff version 1.19.2
-%%CreationDate: Wed Jul  1 12:29:31 2015
-%%DocumentNeededResources: font Times-Roman
-%%+ font Times-Bold
-%%+ font Times-Italic
-%%DocumentSuppliedResources: procset grops 1.19 2
-%%Pages: 22
-%%PageOrder: Ascend
-%%DocumentMedia: Default 612 792 0 () ()
-%%Orientation: Portrait
-%%EndComments
-%%BeginDefaults
-%%PageMedia: Default
-%%EndDefaults
-%%BeginProlog
-%%BeginResource: procset grops 1.19 2
-%!PS-Adobe-3.0 Resource-ProcSet
-/setpacking where{
-pop
-currentpacking
-true setpacking
-}if
-/grops 120 dict dup begin
-/SC 32 def
-/A/show load def
-/B{0 SC 3 -1 roll widthshow}bind def
-/C{0 exch ashow}bind def
-/D{0 exch 0 SC 5 2 roll awidthshow}bind def
-/E{0 rmoveto show}bind def
-/F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def
-/G{0 rmoveto 0 exch ashow}bind def
-/H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/I{0 exch rmoveto show}bind def
-/J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def
-/K{0 exch rmoveto 0 exch ashow}bind def
-/L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/M{rmoveto show}bind def
-/N{rmoveto 0 SC 3 -1 roll widthshow}bind def
-/O{rmoveto 0 exch ashow}bind def
-/P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/Q{moveto show}bind def
-/R{moveto 0 SC 3 -1 roll widthshow}bind def
-/S{moveto 0 exch ashow}bind def
-/T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/SF{
-findfont exch
-[exch dup 0 exch 0 exch neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/MF{
-findfont
-[5 2 roll
-0 3 1 roll
-neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/level0 0 def
-/RES 0 def
-/PL 0 def
-/LS 0 def
-/MANUAL{
-statusdict begin/manualfeed true store end
-}bind def
-/PLG{
-gsave newpath clippath pathbbox grestore
-exch pop add exch pop
-}bind def
-/BP{
-/level0 save def
-1 setlinecap
-1 setlinejoin
-72 RES div dup scale
-LS{
-90 rotate
-}{
-0 PL translate
-}ifelse
-1 -1 scale
-}bind def
-/EP{
-level0 restore
-showpage
-}def
-/DA{
-newpath arcn stroke
-}bind def
-/SN{
-transform
-.25 sub exch .25 sub exch
-round .25 add exch round .25 add exch
-itransform
-}bind def
-/DL{
-SN
-moveto
-SN
-lineto stroke
-}bind def
-/DC{
-newpath 0 360 arc closepath
-}bind def
-/TM matrix def
-/DE{
-TM currentmatrix pop
-translate scale newpath 0 0 .5 0 360 arc closepath
-TM setmatrix
-}bind def
-/RC/rcurveto load def
-/RL/rlineto load def
-/ST/stroke load def
-/MT/moveto load def
-/CL/closepath load def
-/Fr{
-setrgbcolor fill
-}bind def
-/setcmykcolor where{
-pop
-/Fk{
-setcmykcolor fill
-}bind def
-}if
-/Fg{
-setgray fill
-}bind def
-/FL/fill load def
-/LW/setlinewidth load def
-/Cr/setrgbcolor load def
-/setcmykcolor where{
-pop
-/Ck/setcmykcolor load def
-}if
-/Cg/setgray load def
-/RE{
-findfont
-dup maxlength 1 index/FontName known not{1 add}if dict begin
-{
-1 index/FID ne{def}{pop pop}ifelse
-}forall
-/Encoding exch def
-dup/FontName exch def
-currentdict end definefont pop
-}bind def
-/DEFS 0 def
-/EBEGIN{
-moveto
-DEFS begin
-}bind def
-/EEND/end load def
-/CNT 0 def
-/level1 0 def
-/PBEGIN{
-/level1 save def
-translate
-div 3 1 roll div exch scale
-neg exch neg exch translate
-0 setgray
-0 setlinecap
-1 setlinewidth
-0 setlinejoin
-10 setmiterlimit
-[]0 setdash
-/setstrokeadjust where{
-pop
-false setstrokeadjust
-}if
-/setoverprint where{
-pop
-false setoverprint
-}if
-newpath
-/CNT countdictstack def
-userdict begin
-/showpage{}def
-/setpagedevice{}def
-}bind def
-/PEND{
-countdictstack CNT sub{end}repeat
-level1 restore
-}bind def
-end def
-/setpacking where{
-pop
-setpacking
-}if
-%%EndResource
-%%EndProlog
-%%BeginSetup
-%%BeginFeature: *PageSize Default
-<< /PageSize [ 612 792 ] /ImagingBBox null >> setpagedevice
-%%EndFeature
-%%IncludeResource: font Times-Roman
-%%IncludeResource: font Times-Bold
-%%IncludeResource: font Times-Italic
-grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72
-def/PL 792 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron/Zcaron
-/scaron/zcaron/Ydieresis/trademark/quotesingle/Euro/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/space/exclam/quotedbl/numbersign/dollar/percent
-/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen
-/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon
-/semicolon/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O
-/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright/circumflex
-/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y
-/z/braceleft/bar/braceright/tilde/.notdef/quotesinglbase/guillemotleft
-/guillemotright/bullet/florin/fraction/perthousand/dagger/daggerdbl
-/endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut
-/dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash
-/quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen
-/brokenbar/section/dieresis/copyright/ordfeminine/guilsinglleft
-/logicalnot/minus/registered/macron/degree/plusminus/twosuperior
-/threesuperior/acute/mu/paragraph/periodcentered/cedilla/onesuperior
-/ordmasculine/guilsinglright/onequarter/onehalf/threequarters
-/questiondown/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE
-/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex
-/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis
-/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn
-/germandbls/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla
-/egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis
-/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide/oslash
-/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis]def
-/Times-Italic at 0 ENC0/Times-Italic RE/Times-Bold at 0 ENC0/Times-Bold RE
-/Times-Roman at 0 ENC0/Times-Roman RE
-%%EndSetup
-%%Page: 1 1
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.61(mbsystem\(1\) MB-System)72 48 R 147.61
-(5.5 mbsystem\(1\))2.5 F/F1 10.95/Times-Bold at 0 SF -.219(NA)72 84 S(ME)
-.219 E/F2 10/Times-Bold at 0 SF(mbsystem)108 96 Q F0 4.007(\255As)4.007 G
-1.506(et of utilities for manipulating and processing sw)-4.007 F 1.506
-(ath sonar bath)-.1 F(ymetry)-.05 E 4.006(,a)-.65 G 1.506(mplitude, and)
--4.006 F(sidescan data.)108 108 Q F1(VERSION)72 136.8 Q F0 -1.11(Ve)108
-148.8 S(rsion 5.5)1.11 E F1 -.548(AU)72 177.6 S(THORSHIP).548 E F0(Da)
-108 189.6 Q(vid W)-.2 E 2.5(.C)-.92 G(aress \(caress at mbari.or)-2.5 E
-(g\))-.18 E(Montere)113 201.6 Q 2.5(yB)-.15 G
-(ay Aquarium Research Institute)-2.5 E
-(Dale N. Chayes \(dale at ldeo.columbia.edu\))108 213.6 Q
-(Lamont-Doherty Earth Observ)113 225.6 Q(atory)-.25 E F1(INTR)72 254.4 Q
-(ODUCTION)-.329 E F2(MB-System)108 266.4 Q F0 .221(is a softw)2.721 F
-.222(are package consisting of programs which manipulate, process, list\
-, or display sw)-.1 F(ath)-.1 E .037(sonar bath)108 278.4 R(ymetry)-.05
-E 2.537(,a)-.65 G .037(mplitude, and sidescan data. This softw)-2.537 F
-.037(are is distrib)-.1 F .037(uted freely \(and for free\) in the form)
--.2 F .709(of source code for Unix platforms. The heart of the system i\
-s an input/output library called)108 290.4 R F2(MBIO)3.21 E F0(which)
-3.21 E(allo)108 302.4 Q .775(ws programs to w)-.25 F .775
-(ork transparently with an)-.1 F 3.274(yo)-.15 G 3.274(fan)-3.274 G .774
-(umber of supported sw)-3.274 F .774(ath sonar data formats. This)-.1 F
-.392(approach has allo)108 314.4 R .393(wed the creation of "generic" u\
-tilities which can be applied in a uniform manner to sonar)-.25 F .264
-(data from a v)108 326.4 R .264
-(ariety of sources. Most of the programs are command-line tools, b)-.25
-F .263(ut the package does include)-.2 F 1.951
-(graphical tools for editing sw)108 338.4 R 1.952(ath bath)-.1 F(ymetry)
--.05 E 4.452(,e)-.65 G 1.952(diting na)-4.452 F(vig)-.2 E 1.952
-(ation, modeling bath)-.05 F 1.952(ymetry calculation, and)-.05 F
-(adjusting surv)108 350.4 Q .3 -.15(ey n)-.15 H -.2(av).15 G(ig).2 E
-(ation.)-.05 E 1.088(The acron)108 374.4 R 1.088
-(ym MB stands for MultiBeam; this re\215ects the f)-.15 F 1.088
-(act that the early de)-.1 F -.15(ve)-.25 G 1.088(lopment of).15 F F2
-(MB-System)3.588 E F0 .311(focused on processing deep sea bath)108 386.4
-R .311(ymetry data from ship-mounted multibeam sonars. Ho)-.05 F(we)-.25
-E -.15(ve)-.25 G -.4(r,).15 G F2(MB-Sys-)3.211 E(tem)108 398.4 Q F0(no)
-2.783 E 2.783(ws)-.25 G .283(upports se)-2.783 F -.15(ve)-.25 G .283
-(ral data formats from sidescan and interferometric sonars and w).15 F
-.282(orks with sonar data)-.1 F
-(that map the sea\215oor at scales from centimeters to kilometers.)108
-410.4 Q .61(The original National Science F)108 434.4 R .61
-(oundation \(NSF\) mandate in 1993 w)-.15 F .61
-(as to create a set of generic tools that)-.1 F -.1(wo)108 446.4 S 2.032
-(uld w).1 F 2.032
-(ork with all of the sonar data collected on U.S. academic research v)
--.1 F 2.032(essels in NSF-supported)-.15 F .913
-(projects. Not surprisingly)108 458.4 R 3.413(,t)-.65 G .913
-(he early core of the)-3.413 F F2(MB-System)3.413 E F0 .913
-(user community consisted of NSF-supported)3.413 F 1.125(researchers at\
- U.S. institutions such as the Lamont-Doherty Earth Observ)108 470.4 R
-(atory)-.25 E 3.624(,t)-.65 G 1.124(he Scripps Institution of)-3.624 F
-(Oceanograph)108 482.4 Q 2.081 -.65(y, a)-.05 H .781(nd the W).65 F .782
-(oods Hole Oceanographic Institution. Ho)-.8 F(we)-.25 E -.15(ve)-.25 G
-1.582 -.4(r, i).15 H 3.282(nr).4 G .782(ecent years)-3.282 F F2
-(MB-System)3.282 E F0(has)3.282 E .859(also come to be used widely in t\
-he international oceanographic community and in the marine technology)
-108 494.4 R(industry)108 506.4 Q(.)-.65 E(The)108 530.4 Q F2(MB-System)
-3.522 E F0 1.022(source code is distrib)3.522 F 1.023
-(uted under the GNU General Public License as formulated by the)-.2 F
-.21(GNU Project.)108 542.4 R F2(MB-System)2.71 E F0 .21
-(installation depends on some other softw)2.71 F .21
-(are packages \(e.g.)-.1 F .21(GMT and netCDF\),)5.21 F
-(all of which are freely a)108 554.4 Q -.25(va)-.2 G
-(ilable as source code.).25 E F1(COPYRIGHT AND LICENSING)72 583.2 Q F2
-(MB-System)108 595.2 Q F0(Cop)2.5 E(yright \(C\) 1993-2015 by)-.1 E(Da)
-108 607.2 Q(vid W)-.2 E 2.5(.C)-.92 G(aress \(caress at mbari.or)-2.5 E
-(g\))-.18 E(Montere)118 619.2 Q 2.5(yB)-.15 G
-(ay Aquarium Research Institute)-2.5 E(Moss Landing, CA 95039)118 631.2
-Q(Dale N. Chayes \(dale at ldeo.columbia.edu\))108 643.2 Q
-(Lamont-Doherty Earth Observ)118 655.2 Q(atory of Columbia Uni)-.25 E
--.15(ve)-.25 G(rsity).15 E -.15(Pa)118 667.2 S(lisades, NY 10964).15 E
-(All Rights Reserv)108 679.2 Q(ed)-.15 E(All Wrongs Remembered)108 691.2
-Q(The)108 715.2 Q F2(MB-System)3.522 E F0 1.022(source code is distrib)
-3.522 F 1.023
-(uted under the GNU General Public License as formulated by the)-.2 F
-.73(GNU Project. Early)108 727.2 R F2(MB-System)3.23 E F0(distrib)3.23 E
-.73(utions were described as "public domain", which meant there w)-.2 F
-(as)-.1 E(MB-System 5.5)72 768 Q(26 January 2015)137.61 E(1)195.95 E 0
-Cg EP
-%%Page: 2 2
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.61(mbsystem\(1\) MB-System)72 48 R 147.61
-(5.5 mbsystem\(1\))2.5 F 1.131(no restrictions whatsoe)108 84 R -.15(ve)
--.25 G 3.631(ro).15 G 3.631(nt)-3.631 G 1.132(he use of the code. W)
--3.631 F 3.632(ea)-.8 G 1.132(dopted the more restricti)-3.632 F 1.432
--.15(ve G)-.25 H 1.132(NU GPL license in).15 F 1.276
-(order to insure that an)108 96 R 1.276(yone who distrib)-.15 F 1.275
-(utes softw)-.2 F 1.275(are based in whole or in part on)-.1 F/F1 10
-/Times-Bold at 0 SF(MB-System)3.775 E F0 1.275(also dis-)3.775 F(trib)108
-108 Q(utes the modi\214ed)-.2 E F1(MB-System)2.5 E F0
-(source code and an)2.5 E 2.5(ya)-.15 G(dditional source code.)-2.5 E
-.695(The GNU GPL also prohibits the distrib)108 132 R .695
-(ution of proprietary e)-.2 F -.15(xe)-.15 G .696(cutables link).15 F
-.696(ed with)-.1 F F1(MB-System)3.196 E F0(libraries)3.196 E 1.28
-(unless the source code is also distrib)108 144 R 1.279(uted. W)-.2 F
-3.779(ew)-.8 G(ai)-3.879 E 1.579 -.15(ve t)-.25 H 1.279
-(his restriction on distrib).15 F 1.279(uting proprietary compiled)-.2 F
-.372(programs for speci\214c softw)108 156 R .372
-(are products if and only if those softw)-.1 F .373
-(are products meet the follo)-.1 F .373(wing tw)-.25 F 2.873(oc)-.1 G
-(on-)-2.873 E(ditions:)108 168 Q .745(1\) The softw)144 184.8 R .745
-(are product w)-.1 F .745(as created, sold, and deli)-.1 F -.15(ve)-.25
-G .745(red to customers using source code deri).15 F -.15(ve)-.25 G(d)
-.15 E(from)180 196.8 Q F1(MB-System)2.5 E F0(release 4.6 distrib)2.5 E
-(utions.)-.2 E(2\) The softw)144 213.6 Q(are product w)-.1 E
-(as sold and deli)-.1 E -.15(ve)-.25 G
-(red to customers prior to January 1, 2001.).15 E/F2 10.95/Times-Bold at 0
-SF(HIST)72 242.4 Q(OR)-.197 E(Y)-.383 E F0 .767(The de)108 254.4 R -.15
-(ve)-.25 G .767(lopment of).15 F F1(MB-System)3.267 E F0(be)3.267 E -.05
-(ga)-.15 G 3.267(ni).05 G 3.267(n1)-3.267 G .767(990 as part of Da)
--3.267 F .768(vid Caress' research at the Lamont-Doherty)-.2 F 1.758
-(Earth Observ)108 266.4 R 1.758(atory \(LDEO\), which in)-.25 F -.2(vo)
--.4 G(lv).2 E 1.757(ed sw)-.15 F 1.757(ath bath)-.1 F 1.757
-(ymetry data collected with SeaBeam multibeam)-.05 F 3.428(sonars. De)
-108 278.4 R -.15(ve)-.25 G 3.428(lopment w).15 F 3.428
-(as accelerated in 1991 as part of an ef)-.1 F 3.428
-(fort to support the ne)-.25 F 5.928(wS)-.25 G(TN-Atlas)-5.928 E 1.695
-(Hydrosweep DS multibeam sonar on LDEO')108 290.4 R 4.194(ss)-.55 G
-1.694(hip, the R/V Maurice Ewing.)-4.194 F 1.694(Dale Chayes, a Lamont-)
-6.694 F .502(Doherty engineer)108 302.4 R 3.002(,w)-.4 G .503
-(as responsible for the maintenance and operation of the Ewing')-3.102 F
-3.003(sH)-.55 G .503(ydrosweep. As part)-3.003 F .167(of a grant in 199\
-3 and 1994 to Chayes and Caress to upgrade the Hydrosweep operations on\
- the Ewing, the)108 314.4 R .139(National Science F)108 326.4 R .139
-(oundation pro)-.15 F .139(vided support to impro)-.15 F .439 -.15(ve a)
--.15 H .139(nd e).15 F(xtend)-.15 E F1(MB-System)2.639 E F0 2.639(.T)C
-.14(he intent of this initial)-2.639 F .855(grant w)108 338.4 R .855
-(as to pro)-.1 F .854(vide a standard "generic" set of tools for proces\
-sing and display of sw)-.15 F .854(ath sonar data that)-.1 F .766
-(could be used by the U.S. academic community)108 350.4 R 3.266(.T)-.65
-G .766(he \214rst generally released v)-3.266 F .766(ersion of)-.15 F F1
-(MB-System)3.266 E F0(\(3.0\))3.266 E -.1(wa)108 362.4 S 2.764(sm).1 G
-.264(ade a)-2.764 F -.25(va)-.2 G .263
-(ilable in the Spring of 1993. This w).25 F .263(as follo)-.1 F .263
-(wed by v)-.25 F .263(ersions 3.1 and 3.2 in July)-.15 F 2.763(,1)-.65 G
-.263(993, v)-2.763 F(ersion)-.15 E 1.693(3.3 in No)108 374.4 R -.15(ve)
--.15 G(mber).15 E 4.193(,1)-.4 G 1.693(993, and v)-4.193 F 1.693(ersion\
- 3.4 in December 1993. All of these early releases supported only)-.15 F
-(SeaBeam and Hydrosweep data.)108 386.4 Q .521
-(SeaBeam Instruments and Antarctic Support Associates pro)108 410.4 R
-.521(vided additional support in 1994 for the de)-.15 F -.15(ve)-.25 G
-(l-).15 E .154(opment of)108 422.4 R F1(MB-System)2.654 E F0 2.654(,w)C
-.155(ith particular emphasis on capabilities related to the ne)-2.654 F
-2.655(wS)-.25 G .155(eaBeam 2100 series of)-2.655 F .942
-(sonars. A considerably enhanced)108 434.4 R F1(MB-System)3.442 E F0
--.15(ve)3.442 G .942(rsion 4.0 w).15 F .941
-(as released on October 22, 1994; this release)-.1 F(follo)108 446.4 Q
-.539(wed an almost complete re)-.25 F .539
-(write of the underlying source code. The ne)-.25 F 3.04(wc)-.25 G .54
-(apabilities included support)-3.04 F(for sidescan as well as bath)108
-458.4 Q(ymetry data and support for data from a number of v)-.05 E
-(ery dif)-.15 E(ferent sonars.)-.25 E .72(The National Science F)108
-482.4 R .72(oundation funded a \214v)-.15 F 3.219(ey)-.15 G .719(ear ef)
--3.219 F .719(fort be)-.25 F .719
-(gun in 1995 to maintain and further de)-.15 F -.15(ve)-.25 G(lop).15 E
-F1(MB-System)108 494.4 Q F0 2.674(.F)C .174
-(rom 1994 to 1997, SeaBeam Instruments \(a major multibeam sonar manuf)
--2.674 F .175(acturer and, at the)-.1 F 1.107(time, the principal emplo)
-108 506.4 R 1.107(yer of Da)-.1 F 1.107(vid W)-.2 F 6.107(.C)-.92 G
-1.107(aress\) pro)-6.107 F 1.107(vided signi\214cant support for)-.15 F
-F1(MB-System)3.607 E F0(de)3.606 E -.15(ve)-.25 G(lop-).15 E .482
-(ment and maintenance.)108 518.4 R(Similarly)5.482 E 2.982(,t)-.65 G
-.482(he Ne)-2.982 F .482(wport, RI of)-.25 F .483
-(\214ce of the Science Applications International Corpo-)-.25 F 2.901
-(ration \(SAIC\) supported some)108 530.4 R F1(MB-System)5.401 E F0(de)
-5.401 E -.15(ve)-.25 G 2.901(lopment during 1997-1998, when Da).15 F
-2.901(vid W)-.2 F 7.9(.C)-.92 G(aress)-7.9 E -.1(wo)108 542.4 S(rk).1 E
-1.718(ed there. V)-.1 F 1.718(ersion 4.1 w)-1.11 F 1.718
-(as released in No)-.1 F -.15(ve)-.15 G(mber).15 E 4.218(,1)-.4 G 1.718
-(994, follo)-4.218 F 1.718(wed by 4.2 in February 1995, 4.3 on)-.25 F
-(March 12, 1996, 4.4 on August 27, 1996, and 4.5 on September 23, 1997.)
-108 554.4 Q(Da)108 578.4 Q .137(vid Caress joined the Montere)-.2 F
-2.636(yB)-.15 G .136(ay Aquarium Research Institute \(MB)-2.636 F .136
-(ARI\) in September)-.35 F 2.636(,1)-.4 G .136(998. V)-2.636 F(ersion)
--1.11 E .921(4.6 w)108 590.4 R .921
-(as released on April 16, 1999. The \214nal update to v)-.1 F .922
-(ersion 4.6 \(4.6.10\) w)-.15 F .922(as announced on March 8,)-.1 F .254
-(2000. The primary inno)108 602.4 R -.25(va)-.15 G .253
-(tions during this period included support for the ne).25 F 2.753(wg)
--.25 G .253(eneration of Simrad multi-)-2.753 F .275(beam sonars and to\
-ols for generating data products that could be imported directly into G\
-IS softw)108 614.4 R .275(are pack-)-.1 F(ages.)108 626.4 Q 1.372
-(The National Science F)108 650.4 R 1.372
-(oundation has continued to support)-.15 F F1(MB-System)3.872 E F0(de)
-3.872 E -.15(ve)-.25 G 1.371(lopment through additional).15 F<8c76>108
-662.4 Q 3.517(ey)-.15 G 1.018
-(ear grants \(2001-2006 & 2006-2011\) to MB)-3.517 F 1.018
-(ARI and L-DEO. The P)-.35 F 1.018(ackard F)-.15 F 1.018
-(oundation matches the)-.15 F .836(NSF support to Caress at MB)108 674.4
-R .836(ARI. The v)-.35 F .836
-(ersion 5.0 release incorporated another substantial re)-.15 F .836
-(write of the)-.25 F .717(underlying code as well as pro)108 686.4 R
-.717(viding signi\214cant ne)-.15 F 3.217(wc)-.25 G .717
-(apabilities. Thirty one 5.0 "beta" distrib)-3.217 F .718(utions were)
--.2 F .554(released during 2001-2003, with the full 5.0.0 v)108 698.4 R
-.553(ersion released on December 5, 2003. Acti)-.15 F .853 -.15(ve d)
--.25 H -2.15 -.25(ev e).15 H(lopment).25 E .062
-(continued with 5.1.0 released on No)108 710.4 R -.15(ve)-.15 G .062
-(mber 26, 2006, 5.1.1 on December 31, 2008.).15 F .062
-(and 5.1.2 on December)5.062 F .923(31, 2009. Since the adv)108 722.4 R
-.923(ent of 5.0, o)-.15 F -.15(ve)-.15 G 3.423(rs).15 G .922
-(ixty "beta" and "of)-3.423 F .922(\214cial" distrib)-.25 F .922
-(utions of)-.2 F F1(MB-System)3.422 E F0(ha)3.422 E 1.222 -.15(ve b)-.2
-H(een).15 E(MB-System 5.5)72 768 Q(26 January 2015)137.61 E(2)195.95 E 0
-Cg EP
-%%Page: 3 3
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.61(mbsystem\(1\) MB-System)72 48 R 147.61
-(5.5 mbsystem\(1\))2.5 F 1.122(released. Be)108 84 R 1.122
-(ginning with 5.2.1880 on December 30, 2010,)-.15 F/F1 10/Times-Bold at 0
-SF(MB-System)3.622 E F0(distrib)3.622 E 1.122(utions are tied to the re)
--.2 F(vi-)-.25 E(sions in the source code archi)108 96 Q .3 -.15(ve \()
--.25 H(the third number corresponds to the re).15 E
-(vision id in the archi)-.25 E -.15(ve)-.25 G(\).).15 E 1.129
-(Since 2004 a major theme of)108 120 R F1(MB-System)3.629 E F0(de)3.629
-E -.15(ve)-.25 G 1.128
-(lopment has been the processing of multibeam, sidescan,).15 F .984
-(and subbottom pro\214ler data collected on submer)108 132 R .985
-(ged platforms, particularly autonomous underw)-.18 F .985(ater v)-.1 F
-(ehi-)-.15 E(cles \(A)108 144 Q(UVs\).)-.55 E/F2 10.95/Times-Bold at 0 SF
-(WHA)72 172.8 Q(T'S NEW ABOUT VERSION 5)-1.04 E F0 .12(The v)108 184.8 R
-.12(ersion 5.0 release of)-.15 F F1(MB-System)2.62 E F0 .119
-(included a number of changes and impro)2.62 F -.15(ve)-.15 G .119
-(ments relati).15 F .419 -.15(ve t)-.25 H 2.619(ot).15 G .119(he v)
--2.619 F(er)-.15 E(-)-.2 E
-(sion 4 releases. The most signi\214cant changes included:)108 196.8 Q
-F1 2.5(An)87 225.6 S(ew appr)-2.5 E(oach to managing data pr)-.18 E
-(ocessing)-.18 E(.)-.15 E F0 16.5<834d>108 237.6 S(an)-16.5 E 3.354(yt)
--.15 G .854(ools \255 one output \214le. In pre)-3.354 F .854(vious v)
--.25 F .854(ersions of)-.15 F F1(MB-System)3.354 E F0 3.354(,e)C .854
-(ach processing program read an)-3.354 F .126(input sw)128 249.6 R .126
-(ath data \214le and produced an output sw)-.1 F .125
-(ath data \214le. This "serial" processing scheme generally)-.1 F .262
-(produced a lar)128 261.6 R .263
-(ge number of intermediate data \214les.)-.18 F F1(MB-System)2.763 E F0
--.15(ve)2.763 G .263(rsion 5.0 features the inte).15 F .263(gration of)
--.15 F .358(the editing and analysis tools with a single program, mbpro\
-cess, that outputs processed data \214les. The)128 273.6 R(ne)128 285.6
-Q 2.906(w")-.25 G .406(parallel" processing scheme co)-2.906 F -.15(ve)
--.15 G .406(rs bath).15 F .406(ymetry data processing, b)-.05 F .406
-(ut does not yet incorporate the)-.2 F(sidescan processing capabilities\
-. All of the old tools and capabilities are still part of the distrib)
-128 297.6 Q(ution.)-.2 E 16.5<8352>108 314.4 S(ecursi)-16.5 E 1.194 -.15
-(ve d)-.25 H .893(atalists. The lists of data \214les used by gridding \
-and plotting programs can no).15 F 3.393(wb)-.25 G 3.393(er)-3.393 G
-(ecur)-3.393 E(-)-.2 E(si)128 326.4 Q -.15(ve)-.25 G 2.5(,m).15 G
-(aking it simpler to manage data from man)-2.5 E 2.5(yd)-.15 G(if)-2.5 E
-(ferent surv)-.25 E -.15(ey)-.15 G(s.).15 E 16.5<8341>108 343.2 S .409
-(utomatic format identi\214cation.)-16.5 F F1(MB-System)2.909 E F0 .409
-(programs will no)2.909 F 2.909(wa)-.25 G .409
-(ttempt to automatically identify the)-2.909 F(sw)128 355.2 Q
-(ath data format based on the \214lename suf)-.1 E(\214x.)-.25 E 16.5
-<8341>108 372 S 2.357(ncillary data \214les. Man)-16.5 F 4.856(yc)-.15 G
-(ommon)-4.856 E F1(MB-System)4.856 E F0 2.356(tasks \(e.g. sw)4.856 F
-2.356(ath plotting and gridding\) can be)-.1 F .106(accomplished more r\
-apidly using ancillary data \214les containing \214le statistics \(".in\
-f" \214les\), quickly read)128 384 R(bath)128 396 Q .839
-(ymetry \(".fbt" \214les\), and \(".fn)-.05 F .838(v"\) \214les. Each o\
-f these \214les is named by adding the indicated four)-.4 F .405
-(character suf)128 408 R .405(\214x to the original sw)-.25 F .406(ath \
-data \214lename. The ".inf" \214les are created by directing the output)
--.1 F(of)128 420 Q F1(mbinf)2.871 E(o)-.25 E F0 .371
-(to a \214le. The ".fbt" \214les are creating by using)2.871 F F1
-(mbcopy)2.87 E F0 .37(to e)2.87 F .37(xtract the bath)-.15 F .37
-(ymetry into a for)-.05 F(-)-.2 E .881(mat 71 \214le. The ".fn)128 432 R
-.881(v" \214les are created using)-.4 F F1(mblist)3.381 E F0 .881
-(to create a te)3.381 F .881(xt na)-.15 F(vig)-.2 E .882(ation list.)
--.05 F .882(These ancillary)5.882 F
-(\214les are automatically created together using the program)128 444 Q
-F1(mbdatalist)2.5 E F0(.)A F1(New tools.)87 472.8 Q F0<83>108 484.8 Q F1
-(mbna)16.5 E -.1(va)-.25 G(djust).1 E F0 3.162(.T)C .662(his ne)-3.162 F
-3.162(wt)-.25 G .662(ool allo)-3.162 F .661
-(ws users to adjust poorly na)-.25 F(vig)-.2 E .661(ated surv)-.05 F
--.15(ey)-.15 G 3.161(sb).15 G 3.161(ym)-3.161 G .661
-(atching features in)-3.161 F -.15(ove)128 496.8 S .825(rlapping sw).15
-F .825(athes. It is particularly useful for processing surv)-.1 F -.15
-(ey)-.15 G 3.325(sc).15 G .825(onducted from submer)-3.325 F .825
-(ged plat-)-.18 F(forms.)128 508.8 Q<83>108 525.6 Q F1(mbpr)16.5 E
-(ocess)-.18 E F0 3.609(.T)C 1.109(his ne)-3.609 F 3.609(wt)-.25 G 1.109
-(ool performs a v)-3.609 F 1.108
-(ariety of processing tasks and produces a single output pro-)-.25 F
-.357(cessed sw)128 537.6 R .357
-(ath data \214le. The program mbprocess can apply bath)-.1 F .357
-(ymetry edits from mbedit and mbclean,)-.05 F(na)128 549.6 Q(vig)-.2 E
-.279(ation edits from mbna)-.05 F -.15(ve)-.2 G .279(dit, sound v).15 F
-.278(elocity pro\214le changes from mb)-.15 F -.15(ve)-.15 G .278
-(locitytool, and a v).15 F .278(ariety of)-.25 F(other corrections.)128
-561.6 Q<83>108 578.4 Q F1(mbset)16.5 E F0 3.043(.T)C .543(his ne)-3.043
-F 3.043(wt)-.25 G .543(ool allo)-3.043 F .544(ws users to create and mo\
-dify the parameter \214les used to control the opera-)-.25 F
-(tion of mbprocess.)128 590.4 Q<83>108 607.2 Q F1(mbdatalist)16.5 E F0
-3.345(.T)C .845(his ne)-3.345 F 3.345(wt)-.25 G .845(ool allo)-3.345 F
-.844(ws users to list the \214les referenced by a recursi)-.25 F 1.144
--.15(ve d)-.25 H .844(atalist structure. It).15 F .363
-(can also be used to create the ancillary ".inf", ".fbt", and ".fn)128
-619.2 R .364(v" \214les for all of the data \214les referenced)-.4 F
-(in a recursi)128 631.2 Q .3 -.15(ve d)-.25 H(atalist structure.).15 E
-<83>108 648 Q F1(mbsvplist)16.5 E F0 2.546(.T)C .046(his ne)-2.546 F
-2.546(wt)-.25 G .046(ool lists w)-2.546 F .046(ater sound v)-.1 F .046
-(elocity pro\214les embedded in sw)-.15 F .046
-(ath data \214les, creating sec-)-.1 F
-(ondary \214les that can be read into MBv)128 660 Q(elocitytool.)-.15 E
-<83>108 676.8 Q F1(mbar)16.5 E(eaclean)-.18 E F0 4.142(.T)C 1.642
-(his ne)-4.142 F 4.143(wt)-.25 G 1.643
-(ool identi\214es and \215ags artif)-4.143 F 1.643(acts in sw)-.1 F
-1.643(ath sonar bath)-.1 F 1.643(ymetry data within a)-.05 F 1.161
-(speci\214ed area of interest. The area is di)128 688.8 R 1.161
-(vided into a grid with square cells or bins, and the data are)-.25 F
-.727(grouped according to these bins. Once all of)128 700.8 R 3.227
-(data are)5.727 F .727
-(read, statistical tests are applied to the sound-)3.227 F
-(ings within each bin.)128 712.8 Q(MB-System 5.5)72 768 Q
-(26 January 2015)137.61 E(3)195.95 E 0 Cg EP
-%%Page: 4 4
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.61(mbsystem\(1\) MB-System)72 48 R 147.61
-(5.5 mbsystem\(1\))2.5 F/F1 10/Times-Bold at 0 SF(Support f)87 84 Q(or Pr)
--.25 E(ojected Coordinate Systems.)-.18 E F0<83>108 96 Q F1(MB-System)
-16.5 E F0(no)3.476 E 3.476(wi)-.25 G .976
-(ncorporates the source code for the PR)-3.476 F .976
-(OJ.4 Cartographic Projections library)-.4 F 3.475(,p)-.65 G(ro-)-3.475
-E .741(viding support for \(apparently\) all commonly used geodetic coo\
-rdinate systems.)128 108 R F1(PR)5.741 E(OJ)-.3 E(.4)-.2 E F0 -.1(wa)
-3.241 G 3.241(sd).1 G -2.15 -.25(ev e)-3.241 H(l-).25 E .008
-(oped by Gerald Ev)128 120 R .008(enden \(then of the USGS\), and w)-.15
-F .008(as obtained from the www)-.1 F(.remotesensing.or)-.65 E 2.507(gw)
--.18 G(eb-)-2.507 E(site.)128 132 Q 16.5<8341>108 148.8 S(lar)-12.239 E
-1.761(ge number of commonly used projected coordinate systems \(e.g. UT\
-M\) are de\214ned in a \214le)-.18 F .114
-(\(mbsystem/share/projections.dat\) distrib)128 160.8 R .114(uted with)
--.2 F F1(MB-System)2.614 E F0 2.614(.T)C .114
-(hese include all of the standard UTM)-2.614 F .583(zones, all of the s\
-tandard state plate coordinate systems, and most of the European Petrol\
-eum Surv)128 172.8 R -.15(ey)-.15 G
-(Group \(EPSG\) coordinate systems \(also including UTM\).)128 184.8 Q
-<83>108 201.6 Q F1(MB-System)16.5 E F0 .568(can no)3.068 F 3.068(wh)-.25
-G .568(andle sw)-3.068 F .568(ath data that is na)-.1 F(vig)-.2 E .568
-(ated in a supported projected coordinate system.)-.05 F .884
-(In particular)128 213.6 R 3.384(,d)-.4 G .884(ata \214les that are na)
--3.384 F(vig)-.2 E .884
-(ated with UTM eastings and northings instead of longitude and)-.05 F
-(latitude can no)128 225.6 Q 2.5(wb)-.25 G 2.5(ep)-2.5 G
-(lotted and processed with)-2.5 E F1(MB-System)2.5 E F0(.)A 16.5<8354>
-108 242.4 S .34(he programs)-16.5 F F1(mbgrid)2.84 E F0(and)2.84 E F1
-(mbmosaic)2.84 E F0 .34(can no)2.84 F 2.84(wo)-.25 G .34
-(utput grids and mosaics in an)-2.84 F 2.84(yo)-.15 G 2.84(ft)-2.84 G
-.34(he projected coor)-2.84 F(-)-.2 E
-(dinate systems speci\214ed in mbsystem/share/projections.dat.)128 254.4
-Q 16.5<8354>108 271.2 S 1.566(he TIFF images generated with)-16.5 F F1
-(mbm_grdtiff)4.066 E F0(and)4.066 E F1(mbgrdtiff)4.066 E F0(no)4.066 E
-4.066(wf)-.25 G 1.566(ully conform to the GeoTIFF)-4.066 F 1.21
-(standard, pro)128 283.2 R 1.209
-(viding that the source grids or mosaics were generated using)-.15 F F1
-(mbgrid)3.709 E F0(or)3.709 E F1(mbmosaic)3.709 E F0(in)3.709 E .448
-(either Geographic coordinates, UTM coordinates, or an)128 295.2 R 2.948
-(yo)-.15 G 2.949(ft)-2.948 G .449
-(he EPSG coordinate systems speci\214ed in)-2.949 F .435(the projection\
-s.dat \214le. This means, for instance, that GeoTIFF images generated w\
-ith)128 307.2 R F1(mbgrdtiff)2.935 E F0(will)2.935 E
-(be properly georeferenced when the)128 319.2 Q 2.5(ya)-.15 G
-(re imported into ESRI)-2.5 E F1(Ar)2.5 E(cGIS)-.18 E F0
-(or other GIS packages.)2.5 E F1(Restructuring the code.)87 348 Q F0
-16.5<8341>108 360 S(ll of the C code no)-16.5 E 2.5(wc)-.25 G
-(onforms to the ANSI C standard.)-2.5 E 16.5<8354>108 376.8 S .77
-(he underlying input/output library \()-16.5 F F1(MBIO)A F0 3.271(\)h)C
-.771(as been substantially re)-3.271 F .771
-(written. The structure has been)-.25 F 1.075
-(streamlined, simplifying both future de)128 388.8 R -.15(ve)-.25 G
-1.075(lopment and support of the e).15 F 1.074(xisting code. The)-.15 F
-F1(MBIO)3.574 E F0(API)3.574 E(has been greatly modi\214ed.)128 400.8 Q
-F1(Handling of old Simrad multibeam data.)87 429.6 Q F0 16.5<8356>108
-441.6 S .469(endor format data from the old Simrad multibeams \(pre-199\
-7 sonars\) are no)-17.61 F 2.97(ws)-.25 G .47(upported by a single)-2.97
-F .256(format id \(51\) rather than a separate format id for each sonar\
- model. The old format id')128 453.6 R 2.755(sa)-.55 G .255
-(re automati-)-2.755 F(cally aliased to 51, so e)128 465.6 Q
-(xisting shellscripts will continue to w)-.15 E(ork.)-.1 E<83>108 482.4
-Q F1(MB-System)16.5 E F0 .701(no longer supports beam \215agging in for\
-mat 51 data. The use of mbedit and mbclean on)3.201 F .01
-(format 51 data will cause the \215agged beams to be irre)128 494.4 R
--.2(vo)-.25 G .009(cably nulled. Pre).2 F .009(vious v)-.25 F .009
-(ersions of)-.15 F F1(MB-System)2.509 E F0 .344
-(used the highest bit in the depth v)128 506.4 R .345
-(alues to represent beam \215ags because no Simrad data seemed to use)
--.25 F .513(that bit. W)128 518.4 R 3.013(eh)-.8 G -2.25 -.2(av e)-3.013
-H .512(not obtained data with depth v)3.213 F .512
-(alues using the full bit-range, con\215icting with the old)-.25 F .672
-(beam \215agging scheme. W)128 530.4 R 3.172(er)-.8 G .672
-(ecommend that old Simrad data be translated to the e)-3.172 F .673
-(xtended processing)-.15 F .295(format \(57\) which contains proper bea\
-m \215ags and supports all processing functions. F)128 542.4 R .294
-(ormat 57 is also)-.15 F
-(used for processing data from the current Simrad multibeam sonars.)128
-554.4 Q 16.5<8353>108 571.2 S .432
-(idescan data from old Simrad multibeams \(pre-1997 sonars\) are no)
--16.5 F 2.933(wh)-.25 G .433(andled in the same manner as)-2.933 F .23
-(data from the ne)128 583.2 R .229
-(wer sonars \(e.g. EM3000, EM3000, EM120\). The ra)-.25 F 2.729(ws)-.15
-G .229(amples in the v)-2.729 F .229(endor data for)-.15 F(-)-.2 E .807
-(mat are binned, a)128 595.2 R -.15(ve)-.2 G .807
-(raged, and interpolated into a 1024 pix).15 F .807(el sidescan sw)-.15
-F .808(ath. This binned sidescan is)-.1 F 1.626(not sa)128 607.2 R -.15
-(ve)-.2 G 4.126(di).15 G 4.126(nt)-4.126 G 1.626(he v)-4.126 F 1.626
-(endor format, so \(as abo)-.15 F -.15(ve)-.15 G 4.126(\)i).15 G 4.126
-(ti)-4.126 G 4.125(sr)-4.126 G 1.625
-(ecommended that the data be translated to an)-4.125 F -.15(ex)128 619.2
-S(tended format \(57\) that stores both bath).15 E
-(ymetry beam \215ags and processed sidescan.)-.05 E F1(Str)87 648 Q
-(eamlining of MB-System Default P)-.18 E(arameters.)-.1 E F0 16.5<8350>
-108 660 S .577(rior to v)-16.5 F .577(ersion 5.0, the)-.15 F F1
-(MB-System)3.077 E F0(def)3.077 E .577(aults set by)-.1 F F1(mbdefaults)
-3.078 E F0 .578(included the format id, a control for)3.078 F 1.317
-(ping a)128 672 R -.15(ve)-.2 G 1.317
-(raging, longitude and latitude bounds for windo).15 F 1.317
-(wing by area, and be)-.25 F 1.316(gin and end times for)-.15 F(windo)
-128 684 Q .79(wing in time. These v)-.25 F .79
-(alues are no longer set in the .mbio_def)-.25 F .79
-(aults \214le or controlled by)-.1 F F1(mbde-)3.29 E(faults)128 696 Q F0
-4.115(.A)C 4.115(sn)-4.115 G 1.615(oted abo)-4.115 F -.15(ve)-.15 G
-4.115(,t).15 G 1.615(he format id is automatically identi\214ed from th\
-e \214lename when possible.)-4.115 F .042(When \214lenames do not match\
- one of the recognized structures, users must specify the format using \
-the)128 708 R(rele)128 720 Q -.25(va)-.25 G .057(nt programs).25 F F1
-<ad46>2.557 E/F2 10/Times-Italic at 0 SF(format)A F0 2.557(option. The)
-2.557 F .056(controls for ping a)2.557 F -.15(ve)-.2 G .056
-(raging and windo).15 F .056(wing in time and space)-.25 F
-(MB-System 5.5)72 768 Q(26 January 2015)137.61 E(4)195.95 E 0 Cg EP
-%%Page: 5 5
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.61(mbsystem\(1\) MB-System)72 48 R 147.61
-(5.5 mbsystem\(1\))2.5 F(are rarely used, and must no)128 84 Q 2.5(wb)
--.25 G 2.5(ee)-2.5 G(xplicitly set in command line ar)-2.65 E(guments.)
--.18 E/F1 10/Times-Bold at 0 SF(New Data F)87 112.8 Q(ormats.)-.25 E F0
-16.5<8346>108 124.8 S(uruno HS10 multibeam bath)-16.5 E
-(ymetry is supported as format 171.)-.05 E 16.5<8353>108 141.6 S 1.296(\
-eaBeam 2120 multibeam data in the L3 Communications XSE format are supp\
-orted as format 94)-16.5 F
-(\(already used to support Elac Bottomchart MkII XSE data\).)128 153.6 Q
-16.5<8352>108 170.4 S 1.093 -.15(aw S)-16.5 H .792(TN Atlas multibeam d\
-ata generated by the upgraded Hydrosweep DS2 multibeam on the R/V).15 F
-.074(Ewing are supported by read-only format 182. Processing is support\
-ed using the augmented read-write)128 182.4 R(format 183.)128 194.4 Q
-16.5<8354>108 211.2 S 1.571(he IFREMER netCDF multibeam archi)-16.5 F
-1.571(ving data format is supported as format 75. Similarly)-.25 F 4.07
-(,t)-.65 G(he)-4.07 E(IFREMER netCDF na)128 223.2 Q(vig)-.2 E
-(ation archi)-.05 E(ving data format is supported as format 167.)-.25 E
-16.5<8354>108 240 S 1.029(he STN Atlas processing data format SURF is s\
-upported as format 181. At present, SURF is sup-)-16.5 F .485
-(ported as a read-only format. This allo)128 252 R .485
-(ws plotting and gridding of the SURF data, b)-.25 F .485
-(ut not processing.)-.2 F(Writing or translating the SURF data to allo)
-128 264 Q 2.5(wp)-.25 G(rocessing will be supported in a later v)-2.5 E
-(ersion.)-.15 E 16.5<8354>108 280.8 S .966(he Ha)-16.5 F -.1(wa)-.15 G
-.966(ii Mapping Research Group').1 F 3.466(sn)-.55 G 1.467 -.25(ew M)
--3.466 H .967(R1 format is supported as format 64.).25 F .967
-(This format is)5.967 F .341(used to disseminate data from both the HMR\
-G interferometric sonars \(e.g. MR1\) and the WHOI DSL)128 292.8 R 1.177
-(120 deep-to)128 304.8 R 1.177(wed inteferometric sonar)-.25 F 3.678(.T)
--.55 G 1.178
-(his format has been supported by including the code for the)-3.678 F
-1.298(HMRG library libmr1pr in the)128 316.8 R F1 1.298(MB-System MBIO)
-3.798 F F0(library)3.798 E 3.798(.T)-.65 G 1.298(hanks to Roger Da)
--3.798 F 1.297(vis and HMRG for)-.2 F(making the code a)128 328.8 Q -.25
-(va)-.2 G(ilable under the GPL.).25 E 16.5<8354>108 345.6 S
-(he Edgetech Jstar format for sidescan and subbottom data is no)-16.5 E
-2.5(ws)-.25 G(upported as formats 132 and 133.)-2.5 E/F2 10.95
-/Times-Bold at 0 SF(THE NEW VERSION 5 D)72 374.4 Q -1.644 -1.04(AT A)-.383
-H(PR)3.778 E(OCESSING STR)-.329 E(UCTURE)-.329 E F0(Pre)108 386.4 Q .009
-(vious v)-.25 F .009(ersions of)-.15 F F1(MB-System)2.509 E F0(ha)2.509
-E .309 -.15(ve e)-.2 H .009
-(mphasized processing utilities that operate serially).15 F 2.51(,t)-.65
-G .01(hat is, that read)-2.51 F .205(in an input sw)108 398.4 R .205
-(ath data \214le, modify it, and then output a second sw)-.1 F .204
-(ath data \214le. Serial processing utilities do)-.1 F(allo)108 410.4 Q
-3.488(wf)-.25 G .988(or great \215e)-3.488 F .988(xibility in processin\
-g because one uses only the programs required and, in general, the)-.15
-F .233(order in which the programs are used does matter)108 422.4 R
-2.732(.H)-.55 G -.25(ow)-2.732 G -2.15 -.25(ev e).25 H 1.032 -.4(r, o)
-.25 H .232(ne consequence of serial processing has been).4 F 1.817
-(that processing data frequently results in a lar)108 434.4 R 1.817
-(ge number of intermediate data \214les. F)-.18 F 1.817
-(or instance, if an)-.15 F 1.105
-(EM300 data \214le called "mbari_1998_524.mb57" has spik)108 446.4 R
-1.105(es in the bath)-.1 F(ymetry)-.05 E 3.604(,o)-.65 G 1.104
-(utliers in the na)-3.604 F(vig)-.2 E(ation,)-.05 E .296(and the bath)
-108 458.4 R .297
-(ymetry has been calculated using an incorrect model for the w)-.05 F
-.297(ater sound speed structure, users)-.1 F(of)108 470.4 Q F1
-(MB-System)2.5 E F0 -.1(wo)2.5 G(uld pre).1 E(viously ha)-.25 E .3 -.15
-(ve p)-.2 H(rocessed it with a sequence something lik).15 E 2.5(et)-.1 G
-(his:)-2.5 E(1\) Run)120.5 494.4 Q F1(mbclean)2.5 E F0
-(to automatically \215ag)2.5 E(the ob)128 506.4 Q(vious bath)-.15 E
-(ymetric artif)-.05 E(acts.)-.1 E 2.5(Input: mbari_1998_524.mb57)138
-518.4 R(Output: mbari_1998_524_c.mb57)138 530.4 Q(2\) Run)120.5 554.4 Q
-F1(mbedit)2.5 E F0(to interacti)2.5 E -.15(ve)-.25 G(ly \215ag).15 E
-(bath)128 566.4 Q(ymetric artif)-.05 E(acts.)-.1 E 2.5
-(Input: mbari_1998_524_c.mb57)138 578.4 R
-(Output: mbari_1998_524_ce.mb57)138 590.4 Q(3\) Run)120.5 614.4 Q F1
-(mbna)2.5 E -.1(ve)-.25 G(dit).1 E F0(to interacti)2.5 E -.15(ve)-.25 G
-(ly clean).15 E(the na)128 626.4 Q(vig)-.2 E(ation.)-.05 E 2.5
-(Input: mbari_1998_524_ce.mb57)138 638.4 R
-(Output: mbari_1998_524_cen.mb57)138 650.4 Q(4\) Run)120.5 674.4 Q F1
-(mb)2.5 E -.1(ve)-.15 G(locitytool).1 E F0(to generate an)2.5 E
-(appropriate sound v)128 686.4 Q(elocity pro\214le \(SVP\) for)-.15 E
-(recalculating the bath)128 698.4 Q(ymetry)-.05 E(.)-.65 E 2.5
-(Input: mbari_1998_524_cen.mb57)138 710.4 R(Output: good.svp)138 722.4 Q
-(MB-System 5.5)72 768 Q(26 January 2015)137.61 E(5)195.95 E 0 Cg EP
-%%Page: 6 6
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.61(mbsystem\(1\) MB-System)72 48 R 147.61
-(5.5 mbsystem\(1\))2.5 F(5\) Run)120.5 84 Q/F1 10/Times-Bold at 0 SF(mb)2.5
-E(bath)-.1 E F0(to recalculate the)2.5 E(bath)128 96 Q
-(ymetry using the SVP \214le generated)-.05 E(using)128 108 Q F1(mb)2.5
-E -.1(ve)-.15 G(locitytool).1 E F0(.)A 2.5
-(Input: mbari_1998_524_cen.mb57)138 120 R 2.5(Input: good.svp)138 132 R
-(Output: mbari_1998_524_cenb)138 144 Q(.mb57)-.4 E(6\) Run)120.5 168 Q
-F1(mbsimradmak)2.5 E(ess)-.1 E F0(to recalculate the)2.5 E
-(sidescan while ignoring sidescan samples)138 180 Q(from beams no)138
-192 Q 2.5<778d>-.25 G(agged as bad.)-2.5 E 2.5
-(Input: mbari_1998_524_cenb)138 204 R(.mb57)-.4 E
-(Output: mbari_1998_524_cenbs.mb57)138 216 Q(7\) Run)120.5 240 Q F1(mb)
-2.5 E(backangle)-.1 E F0(to calculate an amplitude)2.5 E
-(vs grazing angle table for correcting)123 252 Q(sidescan.)123 264 Q 2.5
-(Input: mbari_1998_524_cenbs.mb57)138 276 R(Output: ampvsg)138 288 Q
-(a.dat)-.05 E(8\) Run)120.5 312 Q F1(mbanglecorr)2.5 E(ect)-.18 E F0
-(to correct the sidescan.)2.5 E 2.5(Input: mbari_1998_524_cenbs.mb57)138
-324 R(Input: ampvsg)138 336 Q(a.dat)-.05 E
-(Output: mbari_1998_524_cenbsc.mb57)138 348 Q .349
-(The result of this processing includes the input sw)108 372 R .349
-(ath data \214le, the \214nal sw)-.1 F .349(ath data \214le, and \214v)
--.1 F 2.848(ei)-.15 G(ntermedi-)-2.848 E 1.307(ate sw)108 384 R 1.307(a\
-th data \214les. The impact of this approach on data storage requiremen\
-ts is ob)-.1 F 1.308(vious \(though some)-.15 F .192(users ha)108 396 R
-.492 -.15(ve a)-.2 H .192(meliorated the issue by w).15 F .192(orking w\
-ith scripts that automatically delete unneeded data \214les or by)-.1 F
-.442(piping data from one non-graphical process to another to a)108 408
-R -.2(vo)-.2 G .443(id making intermediate \214les\).).2 F .443
-(The serial pro-)5.443 F .315(cessing approach also presents data manag\
-ement problems because data \214les frequently ha)108 420 R .615 -.15
-(ve d)-.2 H(if).15 E .315(ferent pro-)-.25 F .209
-(cessing requirements, e)108 432 R -.15(ve)-.25 G 2.709(nw).15 G .209
-(ithin a single surv)-2.709 F -.15(ey)-.15 G 2.709(.W)-.5 G 2.709(eh)
--3.509 G -2.25 -.2(av e)-2.709 H .209(found that w)2.909 F .21
-(orking with v)-.1 F .21(ery lar)-.15 F .21(ge datasets can)-.18 F .805
-(be a)108 444 R(wkw)-.15 E .805
-(ard when only a minority of data \214les require na)-.1 F(vig)-.2 E
-.804(ation editing or bath)-.05 F .804(ymetric recalculation, or)-.05 F
-(when some data \214les require multiple episodes of bath)108 456 Q
-(ymetry and na)-.05 E(vig)-.2 E(ation editing.)-.05 E F1(MB-System)108
-480 Q F0 -.15(ve)3.007 G .507(rsion 5 includes ne).15 F 3.008(wu)-.25 G
-.508(tilities implementing a parallel processing scheme that simpli\214\
-es the)-3.008 F .251(processing of most sw)108 492 R .251
-(ath data. This scheme is centered around the program)-.1 F F1(mbpr)2.75
-E(ocess)-.18 E F0 2.75(,w)C .25(hich can accom-)-2.75 F(plish the follo)
-108 504 Q(wing processing tasks in a single step:)-.25 E 16.5<834d>144
-520.8 S(er)-16.5 E(ge edited na)-.18 E(vig)-.2 E(ation generated by)-.05
-E F1(mbna)2.5 E -.1(ve)-.25 G(dit).1 E F0(.)A 16.5<8341>144 537.6 S
-(pply bath)-16.5 E(ymetry edit \215ags from)-.05 E F1(mbedit)2.5 E F0
-(and)2.5 E F1(mbclean)2.5 E F0 16.5<8352>144 554.4 S 1.904
-(ecalculate bath)-16.5 F 1.904(ymetry from ra)-.05 F 4.404(wt)-.15 G(ra)
--4.404 E -.15(ve)-.2 G 4.404(lt).15 G 1.904
-(ime and angle data by raytracing through w)-4.404 F(ater)-.1 E
-(sound speed models from)164 566.4 Q F1(mb)2.5 E -.1(ve)-.15 G
-(locitytool).1 E F0(or)2.5 E F1(mbsvplist)2.5 E F0(.)A 16.5<8341>144
-583.2 S
-(pply changes to roll bias, pitch bias, heading bias, and draft v)-16.5
-E(alues.)-.25 E 16.5<8352>144 600 S(ecalculate sidescan from ra)-16.5 E
-2.5(wb)-.15 G(ackscatter samples \(Simrad multibeam data only\).)-2.5 E
-16.5<8352>144 616.8 S(ecalculate sidescan from ra)-16.5 E 2.5(wb)-.15 G
-(ackscatter samples \(Simrad multibeam data only\).)-2.5 E 16.5<8343>144
-633.6 S(orrect sidescan for amplitude vs grazing angle patterns.)-16.5 E
-16.5<8341>144 650.4 S(pply tides to bath)-16.5 E(ymetry)-.05 E(.)-.65 E
-.581(The actions of)108 662.4 R F1(mbpr)3.081 E(ocess)-.18 E F0 .581
-(are controlled by te)3.081 F .581(xt parameter \214les. Each)-.15 F F1
-(mbpr)3.08 E(ocess)-.18 E F0 .58(parameter \214le is named)3.08 F .497
-(by adding a ".par" suf)108 674.4 R .497
-(\214x to the associated input sw)-.25 F .497
-(ath data \214le and contains single line commands that set)-.1 F 1.615
-(processing modes and parameters. T)108 686.4 R 1.615(ools such as)-.8 F
-F1(mbedit)4.115 E F0(,)A F1(mbna)4.115 E -.1(ve)-.25 G(dit).1 E F0 4.114
-(,a)C(nd)-4.114 E F1(mbclean)4.114 E F0 1.614(all generate and/or)4.114
-F .446(modify parameter \214les in addition to generating parallel \214\
-les used by)108 698.4 R F1(mbpr)2.946 E(ocess)-.18 E F0 2.946(.T)C .446
-(he program)-2.946 F F1(mbset)2.946 E F0(can)2.946 E
-(also be used to create and modify)108 710.4 Q F1(mbpr)2.5 E(ocess)-.18
-E F0(parameter \214les.)2.5 E(MB-System 5.5)72 768 Q(26 January 2015)
-137.61 E(6)195.95 E 0 Cg EP
-%%Page: 7 7
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.61(mbsystem\(1\) MB-System)72 48 R 147.61
-(5.5 mbsystem\(1\))2.5 F 1.216(The same processing steps described abo)
-108 84 R 1.515 -.15(ve a)-.15 H 3.715(sas).15 G 1.215
-(erial processing scheme can be accomplished with the)-3.715 F(ne)108 96
-Q 2.5(wp)-.25 G(arallel processing scheme as follo)-2.5 E(ws:)-.25 E
-(1\) Run)120.5 120 Q/F1 10/Times-Bold at 0 SF(mbdatalist)2.5 E F0
-(to create ancillary)2.5 E(data \214les containing statistics)128 132 Q
-(\(".inf"\), quickly read bath)128 144 Q(ymetry)-.05 E
-(\(".fbt"\), and quickly read na)128 156 Q(vig)-.2 E(ation)-.05 E
-(\(".fn)128 168 Q(v"\). These \214les are used to)-.4 E
-(speed common operations such as sw)128 180 Q(ath)-.1 E
-(plotting and gridding.)128 192 Q 2.5(Input: mbari_1998_524.mb57)138 204
-R(Output: mbari_1998_524.mb57.inf)138 216 Q(mbari_1998_524.mb57.fbt)158
-228 Q(mbari_1998_524.mb57.fn)158 240 Q(v)-.4 E(2\) Run)120.5 264 Q F1
-(mbclean)2.5 E F0(to identify)2.5 E(the ob)128 276 Q(vious bath)-.15 E
-(ymetric artif)-.05 E(acts)-.1 E(and output a list of the edit e)128 288
-Q -.15(ve)-.25 G(nts.).15 E(The parameter \214le is created and)128 300
-Q(set to apply bath)128 312 Q(ymetry \215ags from)-.05 E
-(the ".esf" \214le.)128 324 Q 2.5(Input: mbari_1998_524.mb57)138 336 R
-(Output: mbari_1998_524.mb57.esf)138 348 Q(mbari_1998_524.mb57.par)158
-360 Q(3\) Run)120.5 384 Q F1(mbedit)2.5 E F0(to interacti)2.5 E -.15(ve)
--.25 G(ly).15 E(identify bath)128 396 Q(ymetric artif)-.05 E(acts)-.1 E
-(and output a list of the edit e)128 408 Q -.15(ve)-.25 G(nts.).15 E
-(The e)128 420 Q(xisting edits from)-.15 E F1(mbclean)2.5 E F0
-(are loaded and applied prior to editing.)128 432 Q
-(The parameter \214le is updated and)128 444 Q(set to apply bath)128 456
-Q(ymetry \215ags from)-.05 E(the ".esf" \214le.)128 468 Q 2.5
-(Input: mbari_1998_524.mb57)138 480 R(mbari_1998_524.mb57.esf)158 492 Q
-(mbari_1998_524.mb57.par)158 504 Q(Output: mbari_1998_524.mb57.esf)138
-516 Q(mbari_1998_524.mb57.par)158 528 Q(4\) Run)120.5 552 Q F1(mbna)2.5
-E -.1(ve)-.25 G(dit).1 E F0(to interacti)2.5 E -.15(ve)-.25 G(ly).15 E
-(clean the na)128 564 Q(vig)-.2 E(ation. The edited)-.05 E(na)128 576 Q
-(vig)-.2 E(ation is output to the ".n)-.05 E -.15(ve)-.4 G 2.5<228c>.15
-G(le.)-2.5 E(The parameter \214le is updated and)128 588 Q(set to mer)
-128 600 Q(ge the na)-.18 E(vig)-.2 E(ation from)-.05 E(the ".n)128 612 Q
--.15(ve)-.4 G 2.5<228c>.15 G(le.)-2.5 E 2.5(Input: mbari_1998_524.mb57)
-138 624 R(mbari_1998_524.mb57.par)158 636 Q
-(Output: mbari_1998_524.mb57.n)138 648 Q -.15(ve)-.4 G
-(mbari_1998_524.mb57.par)158 660 Q(5\) Run)120.5 684 Q F1(mb)2.5 E -.1
-(ve)-.15 G(locitytool).1 E F0(to generate an)2.5 E
-(an appropriate sound v)128 696 Q(elocity pro\214le)-.15 E
-(\(SVP\) for recalculating the bath)128 708 Q(ymetry)-.05 E(.)-.65 E
-(The SVP is output to the ".svp" \214le.)128 720 Q(MB-System 5.5)72 768
-Q(26 January 2015)137.61 E(7)195.95 E 0 Cg EP
-%%Page: 8 8
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.61(mbsystem\(1\) MB-System)72 48 R 147.61
-(5.5 mbsystem\(1\))2.5 F(The parameter \214le is updated and)128 84 Q
-(set to recalculate the bath)128 96 Q(ymetry by)-.05 E
-(raytracing through the SVP model from)128 108 Q(the ".svp" \214le.)128
-120 Q 2.5(Input: mbari_1998_524.mb57)138 132 R(mbari_1998_524.mb57.par)
-158 144 Q(Output: mbari_1998_524.mb57.svp)138 156 Q
-(mbari_1998_524.mb57.par)158 168 Q(6\) Run)120.5 192 Q/F1 10
-/Times-Bold at 0 SF(mb)2.5 E(backangle)-.1 E F0(to generate an)2.5 E 2.5
-(as)128 204 S(et of amplitude vs grazing angle)-2.5 E(tables at re)128
-216 Q(gular interv)-.15 E(als in the)-.25 E
-(data. These tables are placed into)128 228 Q 2.5(as)128 240 S
-(ingle ".sg)-2.5 E(a" \214le. The parameter)-.05 E
-(\214le is updated and set to correct)128 252 Q
-(the sidescan by interpolating the)128 264 Q
-(amplitude vs grazing angle table for)128 276 Q(each ping.)128 288 Q 2.5
-(Input: mbari_1998_524.mb57)138 300 R(mbari_1998_524.mb57.par)158 312 Q
-(Output: mbari_1998_524.mb57.sg)138 324 Q(a)-.05 E
-(mbari_1998_524.mb57.par)158 336 Q(7\) Run)120.5 360 Q F1(mbset)2.5 E F0
-(to set the parameter \214le)2.5 E(so that mbprocess will recalculate)
-128 372 Q(the sidescan \(this is for Simrad)128 384 Q
-(multibeam data only\) while ignoring)128 396 Q
-(sidescan samples from beams no)128 408 Q 2.5<778d>-.25 G(agged)-2.5 E
-(as bad.)128 420 Q 2.5(Input: mbari_1998_524.mb57.par)138 432 R
-(Output: mbari_1998_524.mb57.par)138 444 Q(8\) Run)120.5 468 Q F1(mbpr)
-2.5 E(ocess)-.18 E F0(to apply the bath)2.5 E(ymetric)-.05 E(edits, mer)
-128 480 Q(ge the cleaned na)-.18 E(vig)-.2 E(ation,)-.05 E
-(recalculate the bath)128 492 Q(ymetry)-.05 E 2.5(,r)-.65 G(ecalculate)
--2.5 E(the sidescan, and correct the sidescan.)128 504 Q
-(The processed sw)128 516 Q(ath data is written to)-.1 E(an output sw)
-128 528 Q(ath data \214le. The usual)-.1 E
-(ancillary data \214les containing statistics,)128 540 Q
-(quickly read bath)128 552 Q(ymetry)-.05 E 2.5(,a)-.65 G(nd quickly)-2.5
-E(read na)128 564 Q(vig)-.2 E(ation are also created.)-.05 E 2.5
-(Input: mbari_1998_524.mb57)138 576 R(mbari_1998_524.mb57.esf)158 588 Q
-(mbari_1998_524.mb57.n)158 600 Q -.15(ve)-.4 G(mbari_1998_524.mb57.svp)
-158 612 Q(mbari_1998_524.mb57.ag)158 624 Q(a)-.05 E
-(mbari_1998_524.mb57.par)158 636 Q(Output: mbari_1998_524p.mb57)138 648
-Q(mbari_1998_524p.mb57.inf)158 660 Q(mbari_1998_524p.mb57.fbt)158 672 Q
-(mbari_1998_524p.mb57.fn)158 684 Q(v)-.4 E .159
-(The result of this processing is a single output sw)108 708 R .159
-(ath data \214le. Moreo)-.1 F -.15(ve)-.15 G .959 -.4(r, t).15 H .159
-(he processed output can be easily).4 F .665(updated if, for e)108 720 R
-.665(xample, additional bath)-.15 F .665
-(ymetry editing is required. If the)-.05 F F1(mbedit)3.165 E F0 .665
-(program is used ag)3.165 F .665(ain, it)-.05 F(MB-System 5.5)72 768 Q
-(26 January 2015)137.61 E(8)195.95 E 0 Cg EP
-%%Page: 9 9
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.61(mbsystem\(1\) MB-System)72 48 R 147.61
-(5.5 mbsystem\(1\))2.5 F 1.52(will load the e)108 84 R 1.52
-(xisting edit e)-.15 F -.15(ve)-.25 G 1.52
-(nts from the ".esf" \214le and then update the ".esf" \214le. T).15 F
-4.02(oi)-.8 G 1.52(ncorporate the)-4.02 F .803(updated bath)108 96 R
-.803(ymetry edits, one just runs)-.05 F/F1 10/Times-Bold at 0 SF(mbpr)3.303
-E(ocess)-.18 E F0(ag)3.303 E .802
-(ain. One can similarly change the SVP \214le without)-.05 F
-(impacting on the bath)108 108 Q(ymetry editing or na)-.05 E(vig)-.2 E
-(ation editing components of the processing.)-.05 E .466
-(All of the old, serial processing utilities are still distrib)108 132 R
-.466(uted with)-.2 F F1(MB-System)2.966 E F0 2.966(.H)C -.25(ow)-2.966 G
--2.15 -.25(ev e).25 H 1.267 -.4(r, s).25 H .467(ome of the serial).4 F
-1.232(tools ha)108 144 R 1.532 -.15(ve b)-.2 H 1.232(een replaced by ne)
-.15 F 3.731(wv)-.25 G 1.231(ersions of the same name \(e.g.)-3.881 F F1
-(mbedit)3.731 E F0(,)A F1(mbclean)3.731 E F0(,)A F1(mb)3.731 E
-(backangle)-.1 E F0 3.731(,a)C(nd)-3.731 E F1(mbna)108 156 Q -.1(ve)-.25
-G(dit).1 E F0 3.531(\). In)B 1.032(these cases, the old v)3.531 F 1.032
-(ersions are preserv)-.15 F 1.032
-(ed as programs with "old" added to their names)-.15 F(\(e.g.)108 168 Q
-F1(mbeditold)2.5 E F0(,)A F1(mbcleanold)2.5 E F0(,)A F1(mb)2.5 E
-(backangleold)-.1 E F0 2.5(,a)C(nd)-2.5 E F1(mbna)2.5 E -.1(ve)-.25 G
-(ditold).1 E F0(\).)A/F2 10.95/Times-Bold at 0 SF(THE NEW VERSION 5 D)72
-196.8 Q -1.644 -1.04(AT A)-.383 H(LIST FILES)1.04 E F0(Pre)108 208.8 Q
-.14(vious v)-.25 F .14(ersions of)-.15 F F1(MB-System)2.64 E F0(ha)2.64
-E .44 -.15(ve u)-.2 H .139
-(sed lists of data \214les, or datalists, as input to se).15 F -.15(ve)
--.25 G .139(ral programs \(e.g.).15 F F1(mbgrid)108 220.8 Q F0(,)A F1
-(mbmosaic)3.84 E F0(,)A F1(mbinf)3.84 E(o)-.25 E F0(,)A F1(mblist)3.84 E
-F0 3.84(,a)C(nd)-3.84 E F1(mbm_plot)3.841 E F0 1.341
-(\). The basic datalist entry has consisted of a sw)B(ath)-.1 E .254
-(data name \(often including the entire path\) follo)108 232.8 R .253
-(wed by a space and then the)-.25 F F1(MB-System)2.753 E F0 .253
-(format id for that)2.753 F .139(\214le. Datalist entry lines starting \
-with the character '#' are considered comments. V)108 244.8 R .14
-(ersion 5 e)-1.11 F .14(xtends the de\214-)-.15 F .963
-(nition and usage of datalists in se)108 256.8 R -.15(ve)-.25 G .963
-(ral signi\214cant w).15 F .963(ays. First, datalists may no)-.1 F 3.463
-(wb)-.25 G 3.463(er)-3.463 G(ecursi)-3.463 E -.15(ve)-.25 G 5.963(.A).15
-G(datalist)-2.5 E .279(entry may be another datalist \214le, as indicat\
-ed by a format id of \2551. Second, datalists entries may contain a)108
-268.8 R .743(third column which is interpreted as a gridding weight v)
-108 280.8 R .743(alue by)-.25 F F1(mbgird)3.243 E F0 3.243(.T)C .743
-(his third v)-3.243 F .742(alue may be used to)-.25 F .529
-(weight some data higher than other data. F)108 292.8 R .529(or e)-.15 F
-.53(xample, one might weight SeaBeam 2112 data with a v)-.15 F(alue)-.25
-E .915(of 1.0 and lo)108 304.8 R .914
-(wer quality SeaBeam classic data with a v)-.25 F .914
-(alue of 0.001. The result w)-.25 F .914(ould be that the ne)-.1 F(wer)
--.25 E .198(2112 data ef)108 316.8 R(fecti)-.25 E -.15(ve)-.25 G .198
-(ly o).15 F -.15(ve)-.15 G .199(rlies the less good data where).15 F
--.15(ve)-.25 G 2.699(ro).15 G -.15(ve)-2.849 G .199
-(rlap occurs. The third ne).15 F 2.699(wf)-.25 G .199
-(eature of datalists)-2.699 F -.1(wo)108 328.8 S .182
-(rks with data processed using the ne).1 F 2.681(wp)-.25 G .181
-(arallel processing scheme.)-2.681 F .181
-(In the parallel processing scheme the)5.181 F(ra)108 340.8 Q 2.592(wd)
--.15 G .093(ata \214les are often, b)-2.592 F .093(ut not al)-.2 F -.1
-(wa)-.1 G .093(ys, accompanied by processed \214les produced by).1 F F1
-(mbpr)2.593 E(ocess)-.18 E F0 5.093(.I)C 2.593(ti)-5.093 G 2.593(sa)
--2.593 G(wk-)-2.743 E -.1(wa)108 352.8 S 1.63(rd to maintain datalists \
-that directly refer to the current best data\214les. If one inserts the\
- te).1 F 1.63(xt $PR)-.15 F(O-)-.4 E .574
-(CESSED into the \214rst line of a datalist containing ra)108 364.8 R
-3.074<778c>-.15 G .574(les, then programs lik)-3.074 F(e)-.1 E F1
-(mbgrid)3.074 E F0 .574(will read the pro-)3.074 F .116
-(cessed \214le if it e)108 376.8 R .116(xists, b)-.15 F .116
-(ut otherwise will read the ra)-.2 F 2.616<778c>-.15 G .116
-(le. Similarly)-2.616 F 2.616(,a\214)-.65 G .115(rst line of $RA)-2.616
-F 2.615(Ww)-.9 G .115(ill force the pro-)-2.615 F .183
-(grams to only read the ra)108 388.8 R 2.683<778c>-.15 G .183
-(les directly referenced in the datalist. These options also w)-2.683 F
-.183(ork recursi)-.1 F -.15(ve)-.25 G(ly).15 E 2.683(.T)-.65 G(he)-2.683
-E .299(\214rst instance of a $PR)108 400.8 R .298(OCESSED or $RA)-.4 F
-2.798(Wt)-.9 G .298(ag will pre)-2.798 F -.25(va)-.25 G .298(il o).25 F
--.15(ve)-.15 G 2.798(ra).15 G .298
-(ll others encountered through a hierarch)-2.798 F(y)-.05 E .808
-(of recursi)108 412.8 R 1.108 -.15(ve d)-.25 H 3.308(atalists. The).15 F
-.809(gridding weight v)3.308 F .809(alues will also be applied recursi)
--.25 F -.15(ve)-.25 G(ly).15 E 3.309(,s)-.65 G 3.309(oo)-3.309 G .809
-(ne can specify the)-3.309 F .362(gridding weight for a lar)108 424.8 R
-.362(ge number of data \214les by applying to a datalist entry which is\
- itself a datalist ref-)-.18 F .592(erencing those \214les. Ho)108 436.8
-R(we)-.25 E -.15(ve)-.25 G 1.392 -.4(r, g).15 H .592
-(ridding weights are by def).4 F .593(ault o)-.1 F -.15(ve)-.15 G .593
-(rridden by an).15 F 3.093(yv)-.15 G .593(alues applied to the \214le)
--3.343 F(entries themselv)108 448.8 Q(es \(this beha)-.15 E
-(vior can be re)-.2 E -.15(ve)-.25 G
-(rsed using the datalist tag $NOLOCAL).15 E(WEIGHT\).)-.74 E F2
-(VERSION 5 FILE N)72 477.6 Q(AMING CONVENTIONS)-.219 E F0 .668(The v)108
-489.6 R .668(ersion 5)-.15 F F1(MB-System)3.168 E F0 .668(programs mak)
-3.168 F 3.168(ee)-.1 G(xtensi)-3.318 E .968 -.15(ve u)-.25 H .668
-(se of standardized \214lename suf).15 F<8c78>-.25 E .667(es. These suf)
--.15 F<8c78>-.25 E(es)-.15 E(allo)108 501.6 Q(w)-.25 E F1(MB-System)3.08
-E F0 .58(programs to kno)3.08 F 3.08(ww)-.25 G .58
-(hat kinds of \214les it is w)-3.08 F .58
-(orking with, and in particular to determine)-.1 F(sw)108 513.6 Q .83
-(ath data formats without the user ha)-.1 F .83
-(ving to specify them. Although the processing will generally w)-.2 F
-(ork)-.1 E -2.15 -.25(ev e)108 525.6 T 3.09(ni).25 G 3.09(fau)-3.09 G
-.59(ser does not use the standard \214lenaming con)-3.09 F -.15(ve)-.4 G
-.591(ntion, we can guarentee that the user').15 F 3.091(sw)-.55 G .591
-(ork will)-3.191 F .671(be much easier if the con)108 537.6 R -.15(ve)
--.4 G .671(ntion is follo).15 F .671(wed. Quite simply)-.25 F 3.171(,t)
--.65 G .671(he con)-3.171 F -.15(ve)-.4 G .671(ntion is for sw).15 F
-.671(ath \214les to end with a)-.1 F(suf)108 549.6 Q .323
-(\214x of the format ".mbXX" or ".mbXXX", where XX or XXX is the tw)-.25
-F 2.823(od)-.1 G .323(igit or three digit)-2.823 F F1(MB-System)2.823 E
-F0 .31(format id, respecti)108 561.6 R -.15(ve)-.25 G(ly).15 E 2.81(.F)
--.65 G .31(or instance, a Simrad EM3000 \214le in the processing format\
- 57 might ha)-2.96 F .61 -.15(ve a n)-.2 H(ame).15 E(lik)108 573.6 Q(e:)
--.1 E(0053_20020518_205816.mb57)144 585.6 Q
-(and a Reson 8101 \214le in the GSF format 121 might ha)108 597.6 Q .3
--.15(ve a n)-.2 H(ame lik).15 E(e:)-.1 E(039_2106.mb121)144 609.6 Q F1
-(MB-System)108 621.6 Q F0 .408(programs are able to recognize man)2.908
-F 2.909(ys)-.15 G .409(tandard \214lename con)-2.909 F -.15(ve)-.4 G
-.409(ntions used by sonar v).15 F .409(endors or)-.15 F
-(data logging package v)108 633.6 Q(endors. F)-.15 E
-(or instance, \214lenames with a "_ra)-.15 E -.65(w.)-.15 G(all" suf).65
-E(\214x, lik)-.25 E(e:)-.1 E(0053_20020518_205816_ra)144 645.6 Q -.65
-(w.)-.15 G(all).65 E .351
-(are recognized as either old \(format 51\) or ne)108 657.6 R 2.851(w\()
--.25 G .35(format 56\) Simrad multibeam data \(and the programs also)
--2.851 F .324(determine which of the tw)108 669.6 R 2.824(of)-.1 G .324
-(ormats apply\). Filenames ending with ".rec" are recognized as SeaBeam\
- 2100)-2.824 F .516
-(multibeam data. Filenames ending with ".xse" are kno)108 681.6 R .516
-(wn to be Elac Bottomchart or SeaBeam 2100 multi-)-.25 F .47
-(beam data in the XSE format 94. In these instances the program)108
-693.6 R F1(mbpr)2.971 E(ocess)-.18 E F0 .471
-(will automatically replace the)2.971 F -.15(ve)108 705.6 S(ndor suf).15
-E(\214x with the)-.25 E F1(MB-System)2.5 E F0(con)2.5 E -.15(ve)-.4 G
-(ntion suf).15 E(\214x when it creates a processed output \214le.)-.25 E
-(MB-System 5.5)72 768 Q(26 January 2015)137.61 E(9)195.95 E 0 Cg EP
-%%Page: 10 10
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.61(mbsystem\(1\) MB-System)72 48 R 147.61
-(5.5 mbsystem\(1\))2.5 F/F1 10.95/Times-Bold at 0 SF(LIST OF MB-SYSTEM PR)
-72 84 Q(OGRAMS AND MA)-.329 E(CR)-.602 E(OS)-.329 E F0 .174
-(See the indi)108 96 R .173(vidual manual pages for detailed informatio\
-n about speci\214c programs.)-.25 F .173(See the manual page for)5.173 F
-/F2 10/Times-Bold at 0 SF(MBIO)108 108 Q F0
-(for information about the i/o library and the sw)2.5 E
-(ath sonar data formats supported by)-.1 E F2(MBIO)2.5 E F0(.)A .227
-(These are the MB-system programs which are used in the v)108 132 R .227
-(ersion 5 parallel processing scheme. Those pro-)-.15 F
-(grams that are also rele)108 144 Q -.25(va)-.25 G
-(nt to the serial processing scheme are mark).25 E(ed with an *:)-.1 E
-F2(mb7k2jstar)110.5 156 Q F0 2.5(:E)C
-(xtract Jstar format \(format 132\) sidescan)-2.5 E
-(and subbottom data from Reson 7k \(format 88\))180 168 Q(data \214les.)
-180 180 Q F2(mb7k2ss)110.5 192 Q F0 2.5(:E)C
-(xtract sidescan sonar data from Reson 7k format)-2.5 E
-(data, bins and lays the sidescan onto the)180 204 Q(sea\215oor)180 216
-Q 2.5(,a)-.4 G(nd outputs \214les in the MBF_MBLDEOIH)-2.5 E
-(formst \(MBIO format 71\).)180 228 Q F2(mb7kpr)110.5 240 Q(epr)-.18 E
-(ocess)-.18 E F0 2.5(:P)C(reprocess Reson 7k data \(MBIO format 88\),)
--2.5 E(including applying time lag and biases to)180 252 Q
-(attitude and na)180 264 Q(vig)-.2 E(ation data.)-.05 E F2(mbh)110.5 276
-Q(ysweeppr)-.15 E(epr)-.18 E(ocess)-.18 E F0 2.5(:P)C
-(reprocess multibeam data in the)-2.5 E
-(Hysweep HSX format \(MBIO format 201\).)180 288 Q F2(mbk)110.5 300 Q
-(ongsber)-.15 E(gpr)-.1 E(epr)-.18 E(ocess)-.18 E F0 2.5(:P)C
-(reprocess data from third generation)-2.5 E -.35(Ko)180 312 S(ngsber)
-.35 E 2.5(gm)-.18 G(ultibeam sonars \(MBIO formats 58 and 59\).)-2.5 E
-F2(mb)110.5 324 Q(backangle)-.1 E F0 5(:G)C(enerates tables of the a)-5
-E -.15(ve)-.2 G(rage).15 E(amplitude or sidescan v)180 336 Q(alues as a)
--.25 E(function of the grazing angle with)180 348 Q
-(the sea\215oor at re)180 360 Q(gular interv)-.15 E(als in)-.25 E
-(the data.)74.5 E F2(mbclean)110.5 372 Q F0 5(:A)C
-(utomatically identi\214es and)-5 E(\215ags bad beams in sw)180 384 Q
-(ath sonar)-.1 E(bath)180 396 Q(ymetry data.)-.05 E F2(mbcontour)110.5
-408 Q F0 2.5(*: Generate)B(GMT compatible Postscript)2.5 E(color sw)180
-420 Q(ath contour plots.)-.1 E F2(mbcopy)110.5 432 Q F0 2.5(*: Cop)B 2.5
-(ys)-.1 G -.1(wa)-2.5 G(th sonar data \214les.).1 E F2(mbdatalist)110.5
-444 Q F0 5(:P)C(arses recursi)-5.15 E .3 -.15(ve d)-.25 H
-(atalist \214les).15 E(and outputs the)180 456 Q 2.5(complete list of)5
-F 2.5(data \214les, formats, and \214le)180 468 R(weights.)2.5 E F2
-(mbdefaults)110.5 480 Q F0 2.5(*: Set)B(or list def)2.5 E
-(ault mbio parameters)-.1 E(for reading and writing sw)180 492 Q
-(ath sonar data)-.1 E F2(mbedit)110.5 504 Q F0 5(:I)C(nteracti)-5 E .3
--.15(ve e)-.25 H(ditor used to \215ag bad).15 E(beams in sw)180 516 Q
-(ath sonar bath)-.1 E(ymetry data.)-.05 E F2(mbextractsegy)110.5 528 Q
-F0 2.5(:E)C(xtract subbottom pro\214ler or)-2.5 E
-(center beam re\215ection data to se)180 540 Q(gy \214les.)-.15 E F2
-(mbf)110.5 552 Q(ormat)-.25 E F0 5(*: List)B(information about sw)2.5 E
-(ath sonar)-.1 E(data formats supported by the)180 564 Q F2(MBIO)2.5 E
-F0(library)2.5 E(.)-.65 E F2(mbgetesf)110.5 576 Q F0 2.5(*: Extract)B
-(list of \215agging or un\215agging)2.5 E(beam edit e)180 588 Q -.15(ve)
--.25 G(nts from a sw).15 E(ath sonar data)-.1 E(\214le in the edit sa)
-180 600 Q .3 -.15(ve \214)-.2 H(le \(".esf"\) format).15 E(used by)180
-612 Q F2(mbedit)2.5 E F0(,)A F2(mbclean)2.5 E F0 2.5(,a)C(nd)-2.5 E F2
-(mbpr)180 624 Q(ocess)-.18 E F0(.)A F2(mbgrdtiff)110.5 636 Q F0 2.5(:G)C
-(enerate TIFF image from gridded data)-2.5 E F2(mbgrdviz)110.5 648 Q F0
-2.5(:V)C(izualize GMT grids.)-3.1 E F2(mbgrid)110.5 660 Q F0 2.5
-(*: Grid)B(bath)2.5 E(ymetry)-.05 E 2.5(,a)-.65 G
-(mplitude, and sidescan)-2.5 E(data from sw)180 672 Q
-(ath sonar data \214les.)-.1 E F2(mbhistogram)110.5 684 Q F0 2.5
-(*: Obtain)B(histogram of bath)2.5 E(ymetry)-.05 E(,)-.65 E
-(amplitude, or sidescan data from)180 696 Q(sw)180 708 Q
-(ath sonar data \214les.)-.1 E F2(mbinf)110.5 720 Q(o)-.25 E F0 2.5
-(*: Output)B(some basic statistics of)2.5 E(MB-System 5.5)72 768 Q
-(26 January 2015)137.61 E(10)190.95 E 0 Cg EP
-%%Page: 11 11
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.61(mbsystem\(1\) MB-System)72 48 R 147.61
-(5.5 mbsystem\(1\))2.5 F(sw)180 84 Q(ath sonar data \214les.)-.1 E/F1 10
-/Times-Bold at 0 SF(mble)110.5 96 Q(vitus)-.15 E F0 2.5(*: Create)B 2.5(aw)
-2.5 G(ater v)-2.6 E(elocity pro\214le)-.15 E(which is representati)180
-108 Q .3 -.15(ve o)-.25 H 2.5(ft).15 G(he mean)-2.5 E(annual w)180 120 Q
-(ater column for a speci\214ed)-.1 E 2.5(1d)180 132 S -.15(eg)-2.5 G
-(ree by 1 de).15 E(gree re)-.15 E(gion.)-.15 E F1(mblist)110.5 144 Q F0
-2.5(*: List)B(data in sw)2.5 E(ath sonar data \214les.)-.1 E F1
-(mbmosaic)110.5 156 Q F0 2.5(*: Mosaic)B(sidescan and amplitude data.)
-2.5 E F1(mbna)110.5 168 Q -.1(va)-.25 G(djust).1 E F0 5(:I)C(nteracti)-5
-E .3 -.15(ve n)-.25 H -.2(av).15 G(ig).2 E(ation adjustment)-.05 E
-(package that adjusts na)180 180 Q(vig)-.2 E(ation so)-.05 E(that sw)180
-192 Q(ath bath)-.1 E(ymetry matches where)-.05 E(sw)180 204 Q(athes o)
--.1 E -.15(ve)-.15 G(rlap or cross.).15 E F1(mbna)110.5 216 Q -.1(ve)
--.25 G(dit).1 E F0 5(:I)C(nteracti)-5 E .3 -.15(ve e)-.25 H
-(ditor used to \214x).15 E(problems with na)180 228 Q(vig)-.2 E
-(ation in)-.05 E(sw)180 240 Q(ath sonar data \214les.)-.1 E F1(mbna)
-110.5 252 Q(vlist)-.25 E F0 2.5(*: List)B(na)2.5 E(vig)-.2 E
-(ation data in sw)-.05 E(ath)-.1 E(sonar data \214les.)180 264 Q F1
-(mbneptune2esf)110.5 276 Q F0 2.5(:E)C(xtract bath)-2.5 E
-(ymetry edits from)-.05 E(Simrad Neptune softw)180 288 Q
-(are into edit sa)-.1 E 72.3 -.15(ve \214)-.2 H(le format.).15 E F1
-(mbpr)110.5 300 Q(ocess)-.18 E F0 2.5(:P)C(erforms a v)-2.5 E
-(ariety of processing)-.25 E(tasks in a single step, including)180 312 Q
-(mer)180 324 Q(ging na)-.18 E(vig)-.2 E(ation, applying)-.05 E(bath)180
-336 Q(ymetry edits, recalculating)-.05 E(bath)180 348 Q(ymetry)-.05 E
-2.5(,a)-.65 G(nd recalculating)-2.5 E(sidescan.)180 360 Q F1(mbps)110.5
-372 Q F0 7.5(*: Simple)B(perspecti)2.5 E .3 -.15(ve v)-.25 H(ie).15 E
-(ws of sw)-.25 E(ath)-.1 E(bath)180 384 Q(ymetry in Postscript.)-.05 E
-F1(mbr)110.5 396 Q(olltimelag)-.18 E F0 5(:E)C
-(stimate attitude time lag by cross)-5 E
-(correlation of apparent bottom slope with the)180 408 Q
-(roll time series:)180 420 Q F1(mbsegygrid)110.5 432 Q F0 2.5(:G)C
-(enerate time vs. trace number)-2.5 E(grids of seismic data from se)180
-444 Q(gy \214les.)-.15 E F1(mbsegyinf)110.5 456 Q(o)-.25 E F0 2.5(:O)C
-(utput some basic statistics of)-2.5 E(se)180 468 Q
-(gy seismic data \214les.)-.15 E F1(mbsegylist)110.5 480 Q F0 2.5(:L)C
-(ist selected header v)-2.5 E(alues in)-.25 E(se)180 492 Q
-(gy seismic data \214les.)-.15 E F1(mbset)110.5 504 Q F0 5(:C)C
-(reate and modify)-5 E F1(mbpr)2.5 E(ocess)-.18 E F0(parameter \214les.)
-180 516 Q F1(mbsvplist)110.5 528 Q F0 2.5(*: List)B -.1(wa)2.5 G
-(ter sound v).1 E(elocity pro\214les in sw)-.15 E(ath)-.1 E
-(sonar data \214les.)180 540 Q F1(mbswath)110.5 552 Q F0 2.5
-(*: Generate)B(GMT compatible Postscript)2.5 E
-(color and color shaded relief sw)180 564 Q(ath plots.)-.1 E F1(mb)110.5
-576 Q -.1(ve)-.15 G(locitytool).1 E F0 2.5(*: Interacti)B .3 -.15(ve p)
--.25 H(rogram for).15 E(modeling the af)180 588 Q(fect of the w)-.25 E
-(ater)-.1 E -.15(ve)180 600 S(locity pro\214le on sw).15 E(ath sonar)-.1
-E(bath)180 612 Q(ymetry calculations.)-.05 E 1.091(The follo)108 636 R
-1.091(wing are MB-system programs which are not used in the v)-.25 F
-1.09(ersion 5 parallel processing scheme.)-.15 F .805
-(These programs are included in the v)108 648 R .806
-(ersion 5 releases for backw)-.15 F .806
-(ard compatibility with the old serial pro-)-.1 F(cessing scheme:)108
-660 Q F1(mbhsdump)110.5 672 Q F0 5(:L)C(ists contents of the v)-5 E
-(arious sorts of)-.25 E(data records in Hydrosweep DS data.)180 684 Q F1
-(mbanglecorr)110.5 696 Q(ect)-.18 E F0 5(:A)C
-(pply a grazing angle correction)-5 E
-(to beam amplitude or sidescan data.)180 708 Q F1(mb)110.5 720 Q
-(backangle)-.1 E F0 5(:G)C(enerates a table of the a)-5 E -.15(ve)-.2 G
-(rage).15 E(MB-System 5.5)72 768 Q(26 January 2015)137.61 E(11)190.95 E
-0 Cg EP
-%%Page: 12 12
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.61(mbsystem\(1\) MB-System)72 48 R 147.61
-(5.5 mbsystem\(1\))2.5 F(amplitude or sidescan v)180 84 Q(alues as a)
--.25 E(function of the grazing angle with)180 96 Q(the sea\215oor)180
-108 Q(.)-.55 E/F1 10/Times-Bold at 0 SF(mb)110.5 120 Q(bath)-.1 E F0 5(:G)C
-(enerates bath)-5 E(ymetry from tra)-.05 E -.15(ve)-.2 G 2.5(lt).15 G
-(imes)-2.5 E(in sw)180 132 Q(ath sonar data.)-.1 E F1(mbcleanold)110.5
-144 Q F0 5(:O)C(ld tool that utomatically)-5 E
-(identi\214es and \215ags bad beams)180 156 Q(in sw)180 168 Q
-(ath sonar bath)-.1 E(ymetry data.)-.05 E F1(mbcut)110.5 180 Q F0 5(:R)C
-(emo)-5 E -.15(ve)-.15 G 2.5(sd).15 G(ata from portions of sw)-2.5 E
-(ath)-.1 E(as speci\214ed by the user)180 192 Q(.)-.55 E F1(mbeditold)
-110.5 204 Q F0 5(:O)C(ld interacti)-5 E .3 -.15(ve e)-.25 H
-(ditor used to \215ag bad).15 E(beams in sw)180 216 Q(ath sonar bath)-.1
-E(ymetry data.)-.05 E F1(mb\214lter)110.5 228 Q F0 7.5(:A)C
-(pply some simple \214lter functions)-7.5 E
-(to sidescan, beam amplitude, or)180 240 Q(bath)180 252 Q(ymetry data.)
--.05 E F1(mbgetmask)110.5 264 Q F0 5(:E)C
-(xtract list of \215agged or edited)-5 E(beams from a sw)180 276 Q
-(ath sonar data \214le.)-.1 E F1(mbmask)110.5 288 Q F0 5(:A)C
-(pply editing information obtained)-5 E(from one \214le with)180 300 Q
-F1(mbgetmask)2.5 E F0(to another \214le.)180 312 Q F1(mbmer)110.5 324 Q
-(ge)-.1 E F0 5(:M)C(er)-5 E(ge sw)-.18 E(ath sonar data with ne)-.1 E(w)
--.25 E(na)180 336 Q(vig)-.2 E(ation.)-.05 E F1(mbna)110.5 348 Q -.1(ve)
--.25 G(ditold).1 E F0 5(:O)C(ld interacti)-5 E .3 -.15(ve e)-.25 H
-(ditor used to \214x).15 E(problems with na)180 360 Q(vig)-.2 E
-(ation in)-.05 E(sw)180 372 Q(ath sonar data \214les.)-.1 E F1(mbr)110.5
-384 Q(ollbias)-.18 E F0 5(:E)C -.25(va)-5 G(luate the roll bias of a).25
-E(sw)180 396 Q(ath sonar system using tw)-.1 E 2.5(op)-.1 G(ieces)-2.5 E
-(of coincident bath)180 408 Q(ymetry data)-.05 E
-(collected with opposing ship headings.)180 420 Q F1(mbsimradmak)110.5
-432 Q(ess)-.1 E F0 5(:R)C -.15(eg)-5 G(enerate sidescan imagery).15 E
-(from the ra)180 444 Q 2.5(wa)-.15 G(mplitude samples contained)-2.5 E
-(in data from Simrad EM300 and EM3000 sonars.)180 456 Q F1(mbtide)110.5
-468 Q F0 5(:C)C(orrects sw)-5 E(ath sonar bath)-.1 E(ymetry)-.05 E
-(for tide data.)180 480 Q F1(mb)110.5 492 Q(unclean)-.2 E F0 5(:U)C
-(n\215ags edited beams in sw)-5 E(ath sonar)-.1 E(bath)180 504 Q
-(ymetry data.)-.05 E .542(Macros are programs or shellscripts which mak)
-108 528 R 3.041(eu)-.1 G .541
-(se of programs from the MB-system and other softw)-3.041 F(are)-.1 E
-(packages to accomplish common tasks easily)108 540 Q 5(.T)-.65 G
-(hese are the current MB-system macros:)-5 E F1(mbm_ar)110.5 552 Q
-(c2grd)-.18 E F0 5(:C)C(on)-5 E -.15(ve)-.4 G(rt an ESRI ArcV).15 E(ie)
--.6 E 2.5(wA)-.25 G(SCII grid \214le)-2.5 E(to a GMT grid \214le.)180
-564 Q F1(mbm_copy)110.5 576 Q F0 5(:T)C(ranslate groups of sw)-5.35 E
-(ath data \214les)-.1 E(between formats)180 588 Q F1(mbm_dslna)110.5 600
-Q(v\214x)-.25 E F0 5(:R)C(eads a WHOI DSL AMS-120 processed)-5 E(na)180
-612 Q(vig)-.2 E(ation \214le containing UTM northings)-.05 E
-(and eastings and outputs a na)180 624 Q(vig)-.2 E(ation \214le)-.05 E
-(containing longitude and latitude which is)180 636 Q
-(suitable for use with)180 648 Q F1(mbmer)2.5 E(ge)-.1 E F0(.)A F1
-(mbm_fmtv)110.5 660 Q(el)-.1 E F0 5(:S)C
-(cans a Hydrosweep DS data \214le)-5 E(and outputs a formatted table of)
-180 672 Q(the mean w)180 684 Q(ater v)-.1 E(elocity and surf)-.15 E(ace)
--.1 E -.1(wa)180 696 S(ter v).1 E(elocity v)-.15 E(alues used in)-.25 E
-(processing that data.)180 708 Q F1(mbm_grd2ar)110.5 720 Q(c)-.18 E F0 5
-(:C)C(on)-5 E -.15(ve)-.4 G(rts a GMT grid \214le to an ESRI ArcV).15 E
-(ie)-.6 E(w)-.25 E(MB-System 5.5)72 768 Q(26 January 2015)137.61 E(12)
-190.95 E 0 Cg EP
-%%Page: 13 13
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.61(mbsystem\(1\) MB-System)72 48 R 147.61
-(5.5 mbsystem\(1\))2.5 F(ASCII grid \214le.)180 84 Q/F1 10/Times-Bold at 0
-SF(mbm_grd2geo)110.5 96 Q(vrml)-.1 E F0 5(:C)C(reate and e)-5 E -.15(xe)
--.15 G(cute commands which).15 E(generate a T)180 108 Q(erraV)-.7 E
-(ision tileset and GeoVRML)-.6 E 2.5(set of \214les that)180 120 R 2.5
-(can be)2.5 F(combined with)2.5 E(other data and vie)180 132 Q
-(wed in a web bro)-.25 E(wser)-.25 E(.)-.55 E F1(mbm_grd3dplot)110.5 144
-Q F0 5(:R)C(eads a GMT GRD grid \214le and)-5 E
-(writes a shellscript which will)180 156 Q(generate a GMT 3D perspecti)
-180 168 Q .3 -.15(ve v)-.25 H(ie).15 E(w)-.25 E(of the data.)180 180 Q
-F1(mbm_grdcut)110.5 192 Q F0 5(:E)C
-(xtracts a subarea of a GMT grid \214le.)-5 E F1(mbm_grdplot)110.5 204 Q
-F0 5(:R)C(eads a GMT GRD grid \214le and)-5 E
-(writes a shellscript which will)180 216 Q
-(generate a GMT map of the data.)180 228 Q F1(mbm_grdtiff)110.5 240 Q F0
-5(:R)C(eads a GMT GRD grid \214le and writes a)-5 E
-(shellscript which will generate a TIFF image)180 252 Q(of the data.)180
-264 Q F1(mbm_grid)110.5 276 Q F0 5(:R)C(eads a sw)-5 E
-(ath sonar data \214le and writes a)-.1 E
-(shellscript which will grid bath)180 288 Q(ymetry data or)-.05 E
-(mosaic sidescan \(or amplitude\) data using)180 300 Q
-(reasonable guesses at the appropriate grid)180 312 Q
-(bounds and bin size.)180 324 Q F1(mbm_mak)110.5 336 Q(edatalist)-.1 E
-F0 2.5(:G)C(enerates an MB-System datalist)-2.5 E(\214le referencing)180
-348 Q(all identi\214able sw)5 E(ath)-.1 E
-(\214les in the speci\214ed tar)180 360 Q(get directory)-.18 E(.)-.65 E
-F1(mbm_plot)110.5 372 Q F0 5(:R)C(eads a sw)-5 E
-(ath sonar data \214le and)-.1 E(writes a shellscript which will)180 384
-Q(generate a sw)180 396 Q(ath and/or contour)-.1 E(plot of the data.)180
-408 Q F1(mbm_r)110.5 420 Q(ollerr)-.18 E(or)-.18 E F0 5(:R)C(eads a sw)
--5 E(ath sonar data \214le,)-.1 E(calculates the noise in the v)180 432
-Q(ertical reference)-.15 E(used by the sonar)180 444 Q 2.5(,a)-.4 G
-(nd generates a \214le)-2.5 E(containing roll corrections which)180 456
-Q(can be applied to the data.)180 468 Q F1(mbm_r)110.5 480 Q
-(oute2mission)-.18 E F0 5(:T)C(ranslate an mbgrdviz surv)-5.35 E .3 -.15
-(ey r)-.15 H(oute).15 E(\214le into an MB)180 492 Q(ARI A)-.35 E
-(UV mission script.)-.55 E F1(mbm_stat)110.5 504 Q F0 5(:R)C(uns)-5 E F1
-(mbinf)2.5 E(o)-.25 E F0(on a sw)2.5 E(ath sonar data)-.1 E
-(\214le and e)180 516 Q(xtracts beam statistics from)-.15 E
-(the output of)180 528 Q F1(mbinf)2.5 E(o)-.25 E F0(.)A F1(mbm_utm)110.5
-540 Q F0 2.5(:P)C(erforms forw)-2.5 E(ard and in)-.1 E -.15(ve)-.4 G
-(rse UTM projections).15 E(of ASCII data triples.)180 552 Q F1(mbm_vr)
-110.5 564 Q(efcheck)-.18 E F0 5(:G)C(enerates a plot of high pass)-5 E
-(\214ltered apparent crosstrack sea\215oor slope.)180 576 Q F1(mbm_xbt)
-110.5 588 Q F0 5(:P)C(rocesses a Sparton XBT data \214le)-5 E
-(and outputs a sound v)180 600 Q(elocity pro\214le)-.15 E
-(\214le which can be used to process)180 612 Q(sw)180 624 Q
-(ath sonar data.)-.1 E F1(mbm_xyplot)110.5 636 Q F0 5(:R)C
-(eads one or more ASCII "X-Y")-5 E
-(data \214les and writes a shellscript)180 648 Q
-(which will generate an XY plot of the data.)180 660 Q/F2 10.95
-/Times-Bold at 0 SF(EXAMPLE PR)72 688.8 Q(OCESSING APPR)-.329 E -.438(OA)
--.329 G(CH)-.164 E F0 .324(An e)108 700.8 R .324
-(xample processing stream for sw)-.15 F .324
-(ath sonar data which uses the ne)-.1 F 1.625 -.65(w, p)-.25 H .325
-(arallel processing scheme is pro-).65 F .147(vided here. Note that a '\
-\264 character at the end of a line indicates that the command line sho\
-uld actually con-)108 712.8 R .643(tinue with the te)108 724.8 R .643
-(xt on the ne)-.15 F .643(xt line. Refer to indi)-.15 F .643
-(vidual program manual pages for detailed information on)-.25 F
-(MB-System 5.5)72 768 Q(26 January 2015)137.61 E(13)190.95 E 0 Cg EP
-%%Page: 14 14
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.61(mbsystem\(1\) MB-System)72 48 R 147.61
-(5.5 mbsystem\(1\))2.5 F(the command ar)108 84 Q
-(guments and functionality of the v)-.18 E(arious programs.)-.25 E/F1
-10.95/Times-Bold at 0 SF(PR)72 112.8 Q(OCESSING SEABEAM 2100 D)-.329 E
--1.644 -1.04(AT A)-.383 H F0 .563(The follo)108 124.8 R .562(wing data \
-processing stream is recommended for data obtained with SeaBeam 2100 se\
-ries multi-)-.25 F .798(beam sonars.)108 136.8 R 3.298(An)5.798 G .798
-(umber of SeaBeam 2112 sonars were installed on academic research v)
--3.298 F .798(essels during the)-.15 F(1990')108 148.8 Q .481
-(s, including the R/V Knorr and R/V Atlantis operated by the W)-.55 F
-.48(oods Hole Oceanographic Institution,)-.8 F .671(the R/V Re)108 160.8
-R -.15(ve)-.25 G .671
-(lle operated by the Scripps Institution of Oceanograph).15 F 1.971 -.65
-(y, t)-.05 H .672(he R/V Ronald Bro).65 F .672(wn operated by)-.25 F(NO)
-108 172.8 Q .112(AA, R/V Mirai and R/V Kairai operated by J)-.35 F .111
-(AMSTEC and other v)-.6 F 2.611(essels. This)-.15 F .111
-(same approach is appro-)2.611 F .153
-(priate for data from all other multibeam sonars, with small v)108 184.8
-R .154(ariations. The issues and dif)-.25 F .154(ferences associated)
--.25 F(with data from certain other types of sonars are discussed in th\
-e follo)108 196.8 Q(wing sections.)-.25 E .499
-(Consider a data \214le "sb199411211212.rec" containing one hour')108
-220.8 R 2.999(sw)-.55 G .498(orth of SeaBeam 2112 data in the v)-3.099 F
-(en-)-.15 E .83(dor format \(format 41\).)108 232.8 R .83
-(This \214le contains bath)5.83 F(ymetry)-.05 E 3.33(,b)-.65 G .83
-(eam amplitude, and sidescan data. The follo)-3.33 F(wing)-.25 E(comman\
-ds are typical for processing such data and generating preliminary maps\
-.)108 244.8 Q/F2 10/Times-Bold at 0 SF(Step 1)108 268.8 Q F0 2.5(:W)C(hat')
--2.5 E 2.5(si)-.55 G 2.5(nt)-2.5 G(he data \214le?)-2.5 E(First we run)
-108 292.8 Q F2(mbinf)2.5 E(o)-.25 E F0
-(to obtain statistics about the contents of the data \214le:)2.5 E
-(mbinfo \255I sb199411211212.mb41)144 316.8 Q
-(Seeing reasonable output assures us that we in f)108 328.8 Q(act kno)
--.1 E 2.5(ww)-.25 G(hat kind of data we are processing.)-2.5 E F2
-(Step 2)108 352.8 Q F0 2.5(:G)C(enerate ancillary \214les.)-2.5 E(Ne)108
-376.8 Q 1.238(xt, we run)-.15 F F2(mbdatalist)3.738 E F0 1.238
-(to generate the statistics \(".inf"\), quickly read bath)3.738 F 1.237
-(ymetry \(".fbt"\), and quickly)-.05 F(read na)108 388.8 Q(vig)-.2 E
-(ation \(".fn)-.05 E(v"\) \214les that mak)-.4 E 2.5(em)-.1 G(an)-2.5 E
-2.5(yt)-.15 G(asks run f)-2.5 E(aster:)-.1 E
-(mbdatalist \255I sb199411211212.mb41 \\)144 412.8 Q(-N \255V)180 424.8
-Q(Running this program generates three output \214les, which we call an\
-cillary \214les:)108 448.8 Q(sb199411211212.mb41.inf)144 460.8 Q
-(sb199411211212.mb41.fbt)144 472.8 Q(sb199411211212.mb41.fn)144 484.8 Q
-(v)-.4 E F2(Step 3)108 508.8 Q F0 2.5(:G)C(enerate \214rst cut plota.)
--2.5 E 1.842 -.8(We a)108 532.8 T .242(re no).8 F 2.742(ws)-.25 G .242
-(et up to process the data. Ho)-2.742 F(we)-.25 E -.15(ve)-.25 G 1.042
--.4(r, \214).15 H .243
-(rst we visually check the data by generating a sw).4 F .243(ath plot)
--.1 F 3.109(of color \214lled bath)108 544.8 R 3.109(ymetry o)-.05 F
--.15(ve)-.15 G 3.109(rlaid with contours and na).15 F(vig)-.2 E 3.108
-(ation. This is easily accomplished with)-.05 F F2(mbm_plot)108 556.8 Q
-F0(:)A(mbm_plot \255I sb199411211212.mb41 \\)144 568.8 Q
-(-G1 \255C \255N \255V \\)180 580.8 Q(-O ZSw)180 592.8 Q 36
-(athBathCont ZSw)-.1 F(athBathCont.cmd)-.1 E .773(Here the ZSw)108 604.8
-R .773(athBathCont represents the plot name, and multiple \214les will \
-be generated with names con-)-.1 F .77(structed by adding dif)108 616.8
-R .77(ferent suf)-.25 F<8c78>-.25 E .769(es to this name. The)-.15 F F2
-(mbm_plot)3.269 E F0 .769(command generates a shellscript called)3.269 F
-(ZSw)108 628.8 Q 2.246(athBathCont.cmd. Running this shellscript in tur\
-n generates a Postscript plot called ZSw)-.1 F(athBath-)-.1 E .1(Cont.p\
-s, and then displays the plot to the screen using the Postscript vie)108
-640.8 R .1(wer pre)-.25 F .1(viously speci\214ed by the user)-.25 F
-(with)108 652.8 Q F2(mbdefaults)2.605 E F0 2.605(.T)C .105(he name ZSw)
--2.605 F .106(athBathCont is descripti)-.1 F .406 -.15(ve b)-.25 H .106
-(ut arbitrary)-.05 F 2.606(.U)-.65 G .106(sers may specify an)-2.606 F
-2.606(yn)-.15 G .106(ame the)-2.606 F(y)-.15 E(wish.)108 664.8 Q
-(The types of sw)108 688.8 Q(ath plots produced by)-.1 E F2(mbm_plot)2.5
-E F0(include:)2.5 E 2.5<ad63>120.5 700.8 S(olor \214ll bath)-2.5 E
-(ymetry with contours)-.05 E 2.5<ad73>120.5 712.8 S
-(haded relief color \214ll bath)-2.5 E(ymetry)-.05 E 2.5<ad63>120.5
-724.8 S(olor \214ll bath)-2.5 E(ymetry o)-.05 E -.15(ve)-.15 G
-(rlaid with amplitude).15 E(MB-System 5.5)72 768 Q(26 January 2015)
-137.61 E(14)190.95 E 0 Cg EP
-%%Page: 15 15
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.61(mbsystem\(1\) MB-System)72 48 R 147.61
-(5.5 mbsystem\(1\))2.5 F 2.5<ad67>120.5 84 S(rayscale amplitude)-2.5 E
-2.5<ad67>120.5 96 S(rayscale sidescan)-2.5 E 1.6 -.8(We h)108 120 T
--2.25 -.2(av e).8 H(already generated the \214rst type of plot. W)2.7 E
-2.5(en)-.8 G .5 -.25(ow g)-2.5 H(enerate the other four as well:).25 E
-(mbm_plot \255I sb199411211212.mb41 \\)144 132 Q(-G2 \255N \255V \\)180
-144 Q(-O ZSw)180 156 Q(athBathShade)-.1 E(ZSw)144 168 Q
-(athBathShade.cmd)-.1 E(mbm_plot \255I sb199411211212.mb41 \\)144 180 Q
-(-G3 \255S0/1 \255N \255V \\)180 192 Q(-O ZSw)180 204 Q(athBathAmp)-.1 E
-(ZSw)144 216 Q(athBathAmp.cmd)-.1 E
-(mbm_plot \255I sb199411211212.mb41 \\)144 228 Q
-(-G4 \255S \255N \255V \\)180 240 Q(-O ZSw)180 252 Q(athAmp)-.1 E(ZSw)
-144 264 Q(athAmp.cmd)-.1 E(mbm_plot \255I sb199411211212.mb41 \\)144 276
-Q(-G5 \255S \255N \255V \\)180 288 Q(-O ZSw)180 300 Q(athSS)-.1 E(ZSw)
-144 312 Q(athSS.cmd)-.1 E 2.063 -.8(We u)108 324 T .462(se the \255S op\
-tion to apply histogram equalization to sidescan and amplitude data; no\
-te that for the ba-).8 F(th)108 336 Q .374(ymetry o)-.05 F -.15(ve)-.15
-G .374(rlaid with amplitude map we use \255S0/1 so that the the amplitu\
-de data used for shading is his-).15 F(togram equalized b)108 348 Q
-(ut the bath)-.2 E(ymetry is not.)-.05 E/F1 10/Times-Bold at 0 SF(Step 3)
-108 372 Q F0 2.5(:A)C(pply Analysis T)-2.5 E(ools)-.8 E 2.502 -.8(We n)
-108 396 T 1.402 -.25(ow h).8 H -2.25 -.2(av e).25 H 3.401(ar)3.601 G
-.901(easonable idea of the data quality)-3.401 F 5.901(.T)-.65 G .901
-(here are se)-5.901 F -.15(ve)-.25 G .901
-(ral data analysis and editing tools that).15 F .226
-(may be used to \214x problems \(or just to further in)108 408 R -.15
-(ve)-.4 G(stig).15 E .227(ate the data\). These may be used in an)-.05 F
-2.727(yo)-.15 G(rder)-2.727 E 2.727(,a)-.4 G 2.727(ta)-2.727 G -.15(ny)
--2.727 G(time.)108 420 Q F1(Analysis Option A)108 444 Q F0 2.5(:A)C
-(utomatic Bath)-2.5 E(ymetry Editing.)-.05 E .314(The program)108 468 R
-F1(mbclean)2.813 E F0 .313(applies some simple artif)2.813 F .313
-(act detection algorithms to the bath)-.1 F(ymetry)-.05 E 2.813(,e)-.65
-G -.25(ff)-2.813 G(ecti).25 E -.15(ve)-.25 G .313(ly pro-).15 F .886
-(viding a means of automatically editing the bath)108 480 R(ymetry)-.05
-E 5.886(.W)-.65 G 3.386(eg)-6.686 G .886
-(enerally recommend that users edit the ba-)-3.386 F(th)108 492 Q .204
-(ymetry interacti)-.05 F -.15(ve)-.25 G .204(ly \(see option B belo).15
-F .203(w\) because no automated \214lter yet approaches \(in our opinio\
-n\) the)-.25 F .85(ability of the human e)108 504 R .851
-(ye and brain to discern the dif)-.15 F .851
-(ference between interesting sea\215oor morphology and)-.25 F .225
-(sonar artif)108 516 R .225(act. In particular)-.1 F 2.725(,n)-.4 G .225
-(one of the \214lters a)-2.725 F -.25(va)-.2 G .224(ilable in).25 F F1
-(mbclean)2.724 E F0 .224(come remotely close to performing sat-)2.724 F
-(isf)108 528 Q 1.044(actorily in general. Ho)-.1 F(we)-.25 E -.15(ve)
--.25 G 1.844 -.4(r, m).15 H(an).4 E 3.544(yu)-.15 G 1.044
-(sers do \214nd it useful to preprocess the data with)-3.544 F F1
-(mbclean)3.545 E F0(before)3.545 E .717(editing in the hope that man)108
-540 R 3.217(yo)-.15 G 3.217(rm)-3.217 G .716(ost of the artif)-3.217 F
-.716(acts can \215agged automatically)-.1 F 3.216(.A)-.65 G -.05(ga)
--3.216 G .716(in, we emphasize the).05 F
-(importance of not depending solely on automatic \214lters.)108 552 Q F1
-(If y)2.5 E(ou car)-.25 E 2.5(ea)-.18 G(bout y)-2.5 E
-(our data, look at it.)-.25 E F0 .421(When we apply)108 576 R F1
-(mbclean)2.921 E F0 2.921(,w)C 2.921(eu)-2.921 G .421
-(sually use a \214lter that \215ags all soundings that de)-2.921 F .421
-(viate more than a speci\214ed)-.25 F .16
-(fraction of the local median depth from that median depth \(the)108 588
-R F1<ad47>2.659 E F0 .159
-(option\). The choice of the \214lter or \214lters)2.659 F
-(and the \214lter parameters used depends v)108 600 Q
-(ery much on the nature of the bath)-.15 E(ymetry data being processed:)
--.05 E(mbclean \255I sb199411211212.mb41 \255G0.9/1.1 \255V)144 612 Q
-.77(If an "edit sa)108 624 R 1.07 -.15(ve \214)-.2 H .77
-(le" named sb199411211212.mb41.esf already e).15 F(xists,)-.15 E F1
-(mbclean)3.27 E F0 .77(reads this \214le and applies)3.27 F .969
-(the pre-e)108 636 R .969(xisting edits prior to be)-.15 F .969
-(ginning its \214ltering.)-.15 F .969(All pre-e)5.969 F .969
-(xisting edit e)-.15 F -.15(ve)-.25 G .968(nts and all ne).15 F .968
-(wly generated)-.25 F .161(\215ags by)108 648 R F1(mbclean)2.661 E F0
-.161(are output to a ne)2.661 F 2.661(w")-.25 G .161(edit sa)-2.661 F
-.461 -.15(ve \214)-.2 H .161(le", ag).15 F .161
-(ain called sb199411211212.mb41.esf.)-.05 F .162(Since this is)5.162 F
-.604(the \214rst of the analyis programs to be run on this data \214le,)
-108 660 R F1(mbclean)3.103 E F0 .603(also creates an)3.103 F F1(mbpr)
-3.103 E(ocess)-.18 E F0(parameter)3.103 E 2.011(\214le called sb1994112\
-11212.mb41.par which contains all of the parameters and settings to be \
-used by)108 672 R F1(mbpr)108 684 Q(ocess)-.18 E F0 .193
-(in generating a processed sw)2.693 F .193
-(ath \214le. If the parameter \214le already e)-.1 F(xisted,)-.15 E F1
-(mbclean)2.692 E F0 -.1(wo)2.692 G .192(uld mod-).1 F
-(ify it so that the bath)108 696 Q(ymetry edits w)-.05 E
-(ould be applied when)-.1 E F1(mbpr)2.5 E(ocess)-.18 E F0(is run.)2.5 E
-F1(Analysis Option B)108 720 Q F0 2.5(:I)C(nteracti)-2.5 E .3 -.15(ve B)
--.25 H(ath).15 E(ymetry Editing.)-.05 E(MB-System 5.5)72 768 Q
-(26 January 2015)137.61 E(15)190.95 E 0 Cg EP
-%%Page: 16 16
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.61(mbsystem\(1\) MB-System)72 48 R 147.61
-(5.5 mbsystem\(1\))2.5 F 2.098 -.8(We u)108 84 T .498(se the interacti)
-.8 F .799 -.15(ve g)-.25 H .499(raphical tool).15 F/F1 10/Times-Bold at 0
-SF(mbedit)2.999 E F0 .499(to check the quality of the bath)2.999 F .499
-(ymetry and to \215ag artif)-.05 F .499(acts as)-.1 F(necessary)108 96 Q
-2.5(.W)-.65 G 2.5(ec)-3.3 G(an start)-2.5 E F1(mbedit)2.5 E F0
-(with the simple command:)2.5 E(mbedit)144 108 Q .306
-(and then open a sw)108 120 R .306(ath \214le using the pull do)-.1 F
-.305(wn menus and dialogs.)-.25 F(Alternati)5.305 E -.15(ve)-.25 G(ly)
-.15 E 2.805(,w)-.65 G 2.805(ec)-2.805 G .305(an specify the sw)-2.805 F
-(ath)-.1 E(\214le on the command line:)108 132 Q
-(mbedit \255I sb199411211212.mb41)144 144 Q .544
-(While we are editing the bath)108 156 R(ymetry)-.05 E 3.045(,a)-.65 G
-.545(ll edit e)-3.045 F -.15(ve)-.25 G .545
-(nts, both \215ag and un\215ag, are written to an "edit sa).15 F .845
--.15(ve \214)-.2 H(le").15 E .003(called sb199411211212.mb41.esf. This \
-\214le is closed when the <Done> or <Quit> b)108 168 R .003
-(utton is click)-.2 F 2.503(ed. In)-.1 F(turn,)2.503 E 1.124
-(this \214le of edit e)108 180 R -.15(ve)-.25 G 1.124
-(nts will be read and these e).15 F -.15(ve)-.25 G 1.125
-(nts applied if we run).15 F F1(mbclean)3.625 E F0 3.625(,o)C(r)-3.625 E
-F1(mbpr)3.625 E(ocess)-.18 E F0 3.625(,o)C 3.625(ri)-3.625 G 3.625(fw)
--3.625 G(e)-3.625 E .827(choose to run)108 192 R F1(mbedit)3.327 E F0
-(ag)3.327 E .827(ain. If this is the \214rst of the analyis programs to\
- be run on this data \214le,)-.05 F F1(mbedit)3.326 E F0 2.41
-(also creates an)108 204 R F1(mbpr)4.91 E(ocess)-.18 E F0 2.41(paramete\
-r \214le called sb199411211212.mb41.par which contains all of the)4.91 F
-.336(parameters and settings to be used by)108 216 R F1(mbpr)2.835 E
-(ocess)-.18 E F0 .335(in generating a processed sw)2.835 F .335
-(ath \214le. If the parameter \214le)-.1 F .285(already e)108 228 R
-(xisted,)-.15 E F1(mbedit)2.785 E F0 -.1(wo)2.785 G .285
-(uld modify it so that the bath).1 F .285(ymetry edits w)-.05 F .285
-(ould be applied when)-.1 F F1(mbpr)2.785 E(ocess)-.18 E F0(is)2.785 E
-(run.)108 240 Q F1(Analysis Option C)108 264 Q F0 2.5(:E)C
-(diting the na)-2.5 E(vig)-.2 E(ation.)-.05 E 2.039 -.8(We u)108 288 T
-.439(se the interacti).8 F .739 -.15(ve g)-.25 H .439(raphical tool).15
-F F1(mbna)2.939 E -.1(ve)-.25 G(dit).1 E F0 .439
-(to check the quality of the na)2.939 F(vig)-.2 E .438
-(ation and to \214x problems)-.05 F(as necessary)108 300 Q 2.5(.W)-.65 G
-2.5(ec)-3.3 G(an start)-2.5 E F1(mbna)2.5 E -.1(ve)-.25 G(dit).1 E F0
-(with the simple command:)2.5 E(mbna)144 312 Q -.15(ve)-.2 G(dit).15 E
-.305(and then open a sw)108 324 R .305(ath \214le using the pull do)-.1
-F .306(wn menus and dialogs.)-.25 F(Alternati)5.306 E -.15(ve)-.25 G(ly)
-.15 E 2.806(,w)-.65 G 2.806(ec)-2.806 G .306(an specify the sw)-2.806 F
-(ath)-.1 E(\214le on the command line:)108 336 Q(mbna)144 348 Q -.15(ve)
--.2 G(dit \255I sb199411211212.mb41).15 E .228(When we ha)108 360 R .528
--.15(ve c)-.2 H .228(ompleted editing the na).15 F(vig)-.2 E .227
-(ation, we click the <Done> or <Quit> b)-.05 F .227
-(utton. The program then)-.2 F 1.012(writes the \214nal na)108 372 R
-(vig)-.2 E 1.012(ation to an "edited na)-.05 F(vig)-.2 E 1.013
-(ation" \214le called sb199411211212.mb41.n)-.05 F -.15(ve)-.4 G 6.013
-(.T).15 G 1.013(he program)-6.013 F F1(mbna)108 384 Q -.1(ve)-.25 G(dit)
-.1 E F0 .79(also modi\214es \(or creates if needed\) an)3.29 F F1(mbpr)
-3.29 E(ocess)-.18 E F0 .79
-(parameter \214le and sets it so that the edited)3.29 F(na)108 396 Q
-(vig)-.2 E(ation is read and mer)-.05 E(ged with the sw)-.18 E
-(ath data when)-.1 E F1(mbpr)2.5 E(ocess)-.18 E F0(is run.)2.5 E F1
-(Analysis Option D)108 420 Q F0 2.5(:M)C(odeling sound v)-2.5 E
-(elocity pro\214les.)-.15 E 1.915 -.8(We u)108 444 T .315
-(se the interacti).8 F .615 -.15(ve g)-.25 H .315(raphical tool).15 F F1
-(mb)2.815 E -.1(ve)-.15 G(locitytool).1 E F0 .315(to model the ef)2.815
-F .315(fect of altering the sound v)-.25 F .315(elocity pro-)-.15 F .644
-(\214le \(SVP\) used to calculate bath)108 456 R .643
-(ymetry from the ra)-.05 F 3.143(wt)-.15 G(ra)-3.143 E -.15(ve)-.2 G
-3.143(lt).15 G .643(imes and angles stored in the sw)-3.143 F .643
-(ath data. W)-.1 F(e)-.8 E(can start)108 468 Q F1(mb)2.5 E -.1(ve)-.15 G
-(locitytool).1 E F0(with the simple command:)2.5 E(mb)144 480 Q -.15(ve)
--.15 G(locitytool).15 E .305(and then open a sw)108 492 R .305
-(ath \214le using the pull do)-.1 F .306(wn menus and dialogs.)-.25 F
-(Alternati)5.306 E -.15(ve)-.25 G(ly).15 E 2.806(,w)-.65 G 2.806(ec)
--2.806 G .306(an specify the sw)-2.806 F(ath)-.1 E
-(\214le on the command line:)108 504 Q(mb)144 516 Q -.15(ve)-.15 G
-(locitytool \255I sb199411211212.mb41).15 E .412(If the)108 528 R F1(Le)
-2.912 E(vitus)-.15 E F0 .411(database has been installed,)2.912 F F1(mb)
-2.911 E -.1(ve)-.15 G(locitytool).1 E F0 .411(will attempt to run)2.911
-F F1(mble)2.911 E(vitus)-.15 E F0 .411(to e)2.911 F .411(xtract a refer)
--.15 F(-)-.2 E .461(ence sound v)108 540 R .462
-(elocity pro\214le for the approximate location of the sw)-.15 F .462
-(ath data \214le. This SVP will be displayed)-.1 F .082
-(along with the editable SVP used for modeling. See the)108 552 R F1(mb)
-2.582 E -.1(ve)-.15 G(locitytool).1 E F0 .081
-(manual page for details on its oper)2.582 F(-)-.2 E 4.023(ation. If)108
-564 R 1.523(we conclude that the bath)4.023 F 1.524
-(ymetry data include artif)-.05 F 1.524(acts associated with ha)-.1 F
-1.524(ving been calculated)-.2 F .78(using an incorrect SVP)108 576 R
-3.28(,a)-1.11 G .78(nd we arri)-3.28 F 1.08 -.15(ve t)-.25 H .779
-(hrough modeling at an SVP which is more lik).15 F .779
-(ely correct, we sa)-.1 F -.15(ve)-.2 G .205
-(this SVP using the <File->Sa)108 588 R .505 -.15(ve s)-.2 H -.1(wa).15
-G .205(th svp \214le> menu b).1 F .205(utton. Then)-.2 F F1(mb)2.705 E
--.1(ve)-.15 G(locitytool).1 E F0(sa)2.705 E -.15(ve)-.2 G 2.705(st).15 G
-.205(he edited SVP in)-2.705 F 6.527<618c>108 600 S 4.027(le named sb19\
-9411211212.mb41.svp, and also sets \(or creates if needed\))-6.527 F
-4.027(the parameter \214le)9.027 F 1.191
-(sb199411211212.mb41.par so that)108 612 R F1(mbpr)3.692 E(ocess)-.18 E
-F0 1.192(will recalculate the bath)3.692 F 1.192
-(ymetry by raytracing through this)-.05 F(SVP)108 624 Q(.)-1.11 E F1
-(Analysis Option E)108 648 Q F0 2.5(:C)C(orrecting sidescan data.)-2.5 E
-1.91 -.8(We o)108 672 T .31(ften \214nd that sidescan imagery).8 F 2.81
-(,d)-.65 G .31(espite the best ef)-2.81 F .31(forts of sonar manuf)-.25
-F .31(acturers, is dominated by a sys-)-.1 F .439(tematic v)108 684 R
-.439(ariation in amplitude across the sw)-.25 F .439(ath. Most commonly)
--.1 F 2.939(,t)-.65 G .44(he center or nadir re)-2.939 F .44
-(gion of the sw)-.15 F .44(ath is)-.1 F .689
-(characterized by high amplitudes, and the outer sw)108 696 R .689
-(ath e)-.1 F .689(xhibits much lo)-.15 F .688(wer amplitudes. This ef)
--.25 F .688(fect can be)-.25 F 1.38(corrected by)108 708 R F1(mbpr)3.88
-E(ocess)-.18 E F0(pro)3.88 E 1.38
-(vided that an appropriate model for the v)-.15 F 1.38
-(ariation in amplitude with grazing)-.25 F .514(angle is a)108 720 R
--.25(va)-.2 G 3.014(ilable. Since).25 F .514
-(the amplitude vs grazing angle function v)3.014 F .513
-(aries with the type of sea\215oor)-.25 F 3.013(,w)-.4 G 3.013(en)-3.013
-G(eed)-3.013 E(MB-System 5.5)72 768 Q(26 January 2015)137.61 E(16)190.95
-E 0 Cg EP
-%%Page: 17 17
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.61(mbsystem\(1\) MB-System)72 48 R 147.61
-(5.5 mbsystem\(1\))2.5 F .939(to construct separate amplitude vs grazin\
-g angle correction tables at re)108 84 R .94(gular interv)-.15 F .94
-(als through each sw)-.25 F(ath)-.1 E(data \214le.)108 96 Q 1.6 -.8
-(We u)5 H(se the program).8 E/F1 10/Times-Bold at 0 SF(mb)2.5 E(backangle)
--.1 E F0(to construct the amplitude vs.)2.5 E(grazing angle tables:)5 E
-(mbbackangle \255I sb199411211212.mb41 \\)144 108 Q
-(-P25 \255N161/80 \255V)180 120 Q .582(Here a ne)108 132 R 3.082(wt)-.25
-G .582(able is constructed e)-3.082 F -.15(ve)-.25 G .581(ry 25 pings, \
-and the tables will consist of 161 angle bins ranging from).15 F 1.219
-(\25580 de)108 144 R 1.219(grees to +80 de)-.15 F 1.219
-(gress grazing angles. The tables are written by)-.15 F F1(mb)3.72 E
-(backangle)-.1 E F0 1.22(to an amplitude vs.)3.72 F .015
-(grazing angle \214le called sb199411211212.mb41.sg)108 156 R 2.514
-(a. Of)-.05 F .014
-(course, the program also sets \(or creates if needed\))2.514 F
-(the parameter \214le sb199411211212.mb41.par so that)108 168 Q F1(mbpr)
-2.5 E(ocess)-.18 E F0(will correct the sidescan.)2.5 E F1(Step 4)108 192
-Q F0 2.5(:P)C(rocess the data.)-2.5 E .065
-(The program that actually tak)108 216 R .065(es the input, ra)-.1 F
-2.566(ws)-.15 G -.1(wa)-2.566 G .066(th data and produces processed sw)
-.1 F .066(ath data is)-.1 F F1(mbpr)2.566 E(ocess)-.18 E F0(.)A 1.928(T\
-his program operates using the parameters listed in the parameter \214l\
-e sb199411211212.mb41.par)108 228 R 4.427(.T)-.55 G(o)-5.227 E
-(process the data, we run)108 240 Q(mbprocess \255I sb199411211212.mb41)
-144 252 Q 1.364(The program produces an output processed sw)108 264 R
-1.365(ath \214le called sb199411211212p.mb41 \(a 'p' character is)-.1 F
-.04(inserted in the \214lename just before the)108 276 R F1(MB-System)
-2.539 E F0(suf)2.539 E .039(\214x. The program)-.25 F F1(mbpr)2.539 E
-(ocess)-.18 E F0 .039(also automatically gen-)2.539 F
-(erates the three basic ancillary data \214les for the processed sw)108
-288 Q(ath \214le:)-.1 E(sb199411211212.mb41.inf)144 300 Q
-(sb199411211212.mb41.fbt)144 312 Q(sb199411211212.mb41.fn)144 324 Q(v)
--.4 E F1(Step 5)108 348 Q F0 2.5(:G)C(rid the bath)-2.5 E(ymetry)-.05 E
-(.)-.65 E(No)108 372 Q 2.598(wu)-.25 G(se)-2.598 E F1(mbgrid)2.599 E F0
-.099(to grid the bath)2.599 F(ymetry)-.05 E 2.599(.T)-.65 G .099
-(he greatest depth in the \214le is 4502 meters \(from the mbinfo out-)
--2.599 F 2.899(put\). The)108 384 R .399(120 de)2.899 F .399(gree sw)
--.15 F .399(ath is 3.4 times the w)-.1 F .398
-(ater depth wide, or 15.3 km wide. This translates to an a)-.1 F -.15
-(ve)-.2 G -.2(r-).15 G .515
-(age acrosstrack spacing of 15300 m / 120 = 127.5 m. If a re)108 396 R
-.516(gion of a grid has more than one data point in)-.15 F .231
-(each grid cell or bin, we say that this re)108 408 R .231(gion is "o)
--.15 F -.15(ve)-.15 G .231(rsampled". If some bins in a re).15 F .231
-(gion ha)-.15 F .531 -.15(ve n)-.2 H 2.731(od).15 G .23(ata points,)
--2.731 F .884(we say that this re)108 420 R .884
-(gion is "undersampled". W)-.15 F 3.384(ec)-.8 G .884
-(hoose a grid cell spacing of 150 m, which will cause the)-3.384 F
-(grid to be o)108 432 Q -.15(ve)-.15 G(rsampled to).15 E -.1(wa)-.25 G
-(rds the center of the sw).1 E(ath, b)-.1 E(ut undersampled to)-.2 E -.1
-(wa)-.25 G(rds the edges of the sw).1 E(ath.)-.1 E(The program)108 456 Q
-F1(mbgrid)2.5 E F0(tak)2.5 E
-(es a datalist as input, so we \214rst construct that \214le:)-.1 E
-(echo sb199411211212p.mb41 41 > datalist_grid)144 468 Q(No)108 492 Q
-3.638(wr)-.25 G(un)-3.638 E F1(mbgrid)3.638 E F0 1.138(using the g)3.638
-F 1.137(aussian weighted mean algorithm \(-F1\) and longitude and latit\
-ude grid cell)-.05 F .139
-(spacings of 150 m \(-E150/150/m\) to grid bath)108 504 R .139
-(ymetry \(-A1\). W)-.05 F 2.639(eu)-.8 G .14
-(se spline interpolation to \214ll in small g)-2.639 F(aps)-.05 E .026
-(in the data no lar)108 516 R .026(ger than tw)-.18 F 2.525(og)-.1 G
-.025(rid cells \(-C2\), and we set re)-2.525 F .025
-(gions with no data to Nan v)-.15 F .025(alues for compatibil-)-.25 F
-.369(ity with GMT programs \(-N\). W)108 528 R 2.869(ea)-.8 G .369
-(lso specify \255M so that grids of data density and data standard de)
--2.869 F(viation)-.25 E(will be generated:)108 540 Q
-(mbgrid \255Idatalist_grid \255E150/150/m \\)144 552 Q
-(-R114.2208/114.4209/-31.9001/-31.6377 \\)180 564 Q
-(-OZGridBath \255A1 \255N \255C2 \255M \255V)180 576 Q 1.346
-(The program)108 600 R F1(mbgrid)3.846 E F0 1.345
-(creates a shellscript which, when e)3.846 F -.15(xe)-.15 G 1.345
-(cuted, will generate a color \214ll plot o).15 F -.15(ve)-.15 G(rlaid)
-.15 E(with contours of the gridded bath)108 612 Q(ymetry)-.05 E 2.5(.N)
--.65 G .5 -.25(ow r)-2.5 H(un that shellscript:).25 E(ZGridBath.cmd)144
-624 Q(Shellscripts ha)108 648 Q .3 -.15(ve a)-.2 H
-(lso been created to generate plots of the data density and standard de)
-.15 E(viation grids:)-.25 E(ZGridBath_bath_num.cmd)144 660 Q
-(ZGridBath_bath_sd.cmd)144 672 Q F1(Step 6)108 696 Q F0 2.5(:M)C
-(osaic the corrected sidescan data.)-2.5 E .173(The program)108 720 R F1
-(mbmosaic)2.673 E F0 .173(operates in a f)2.673 F .173
-(ashion similar to)-.1 F F1(mbgrid)2.673 E F0 2.673(,b)C .174
-(ut has special capabilities allo)-2.873 F .174(wing users)-.25 F
-(MB-System 5.5)72 768 Q(26 January 2015)137.61 E(17)190.95 E 0 Cg EP
-%%Page: 18 18
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.61(mbsystem\(1\) MB-System)72 48 R 147.61
-(5.5 mbsystem\(1\))2.5 F .019(to prioritize which parts of the sw)108 84
-R .018(ath are used in the mosaic that are useful for sidescan data. In\
- particular)-.1 F 2.518(,i)-.4 G(t)-2.518 E .596
-(is possible to create mosaics which do not use the nadir re)108 96 R
-.596(gion of the sw)-.15 F .596(ath e)-.1 F .596
-(xcept where no other data is)-.15 F -.2(av)108 108 S 1.652(ailable, or\
- to create mosaics of sidescan data with particular look azimuths. The \
-sidescan data has a)-.05 F .364(higher resolution than the bath)108 120
-R .364(ymetry so a smaller grid size can be appropriate. Ho)-.05 F(we)
--.25 E -.15(ve)-.25 G 1.164 -.4(r, w).15 H 2.864(ew).4 G .365(ish to o)
--2.864 F -.15(ve)-.15 G -.2(r-).15 G(lay the sidescan on the bath)108
-132 Q(ymetry)-.05 E 2.5(,s)-.65 G 2.5(ow)-2.5 G 2.5(eu)-2.5 G
-(se the same grid cell spacing of 150 m.)-2.5 E .54(In order to gi)108
-156 R .84 -.15(ve t)-.25 H .54(he nadir re).15 F .54(gion a lo)-.15 F
-.539(wer priority than the outer parts of the sidescan sw)-.25 F .539
-(ath, create a \214le of)-.1 F .397(data priorities \(priorities range \
-from 0 to 1\) as a function of apparent grazing angle \(ne)108 168 R
--.05(ga)-.15 G(ti).05 E .698 -.15(ve a)-.25 H .398(ngles are on).15 F
-(the port side of the sw)108 180 Q(ath, zero is at nadir)-.1 E 2.5(,a)
--.4 G(nd positi)-2.5 E .3 -.15(ve a)-.25 H
-(ngles are on the starboard side of the sw).15 E(ath\):)-.1 E(-60.0 0.2)
-144 192 Q(-45.0 1.0)144 204 Q(-15.0 0.8)144 216 Q(-14.9 0.1)144 228 Q
-(14.9 0.1)144 240 Q(15.0 0.8)144 252 Q(45.0 1.0)144 264 Q(60.0 0.2)144
-276 Q .415(Here the nadir re)108 300 R .415(gion has been set to a lo)
--.15 F 2.915(wp)-.25 G .415
-(riority and the highest priority has been gi)-2.915 F -.15(ve)-.25 G
-2.914(nt).15 G 2.914(od)-2.914 G .414(ata from an)-2.914 F
-(apparent grazing angle of 45 de)108 312 Q(grees.)-.15 E(No)108 336 Q
-2.5(wr)-.25 G(un)-2.5 E/F1 10/Times-Bold at 0 SF(mbmosaic)2.5 E F0
-(to mosaic the bath)2.5 E(ymetry corrected sidescan data \(-A4\):)-.05 E
-(mbmosaic \255Idatalist_grid \255E150/150/m \\)144 348 Q
-(-R114.2208/114.4209/-31.9001/-31.6377 \\)180 360 Q(-W)180 372 Q
-(angle_priority)-.8 E(.dat \255F0.10 \\)-.65 E
-(-OZMosaicSS \255A4 \255N \255C2 \255M \255V)180 384 Q(No)108 408 Q
-3.157(wr)-.25 G .657(un the plot shellscripts to vie)-3.157 F 3.158(wt)
--.25 G .658
-(he gridded sidescan data in grayscale and the ancillary data density)
--3.158 F(and standard de)108 420 Q(viation plots:)-.25 E(ZMosaicSS.cmd)
-144 432 Q(ZMosaicSS_num.cmd)144 444 Q(ZMosaicSS_sd.cmd)144 456 Q F1
-(Step 7)108 480 Q F0 2.5(:G)C
-(enerate additional maps of the gridded data.)-2.5 E .372(First, we use)
-108 504 R F1(mbm_grdplot)2.872 E F0 .372
-(to generate a color shaded relief vie)2.872 F 2.872(wo)-.25 G 2.872(ft)
--2.872 G .372(he bath)-2.872 F(ymetry)-.05 E 2.871(.W)-.65 G 2.871(ec)
--3.671 G .371(hoose to illumi-)-2.871 F 1.473(nate the bath)108 516 R
-1.473(ymetry from the northeast \(azimuth of 45 de)-.05 F 1.474
-(grees\) and to use a shading magnitude of 0.4)-.15 F 3.675
-(\(-A0.4/45\). Because)108 528 R 1.175
-(the data has been gridded as bath)3.675 F 1.175(ymetry \(positi)-.05 F
-1.475 -.15(ve d)-.25 H -.25(ow).15 G 1.175(n\) rather than as topograph)
-.25 F(y)-.05 E(\(positi)108 540 Q .621 -.15(ve u)-.25 H .321
-(p\), the def).15 F .322(ault plot will ha)-.1 F .622 -.15(ve ")-.2 H
-.322(hot" colors for deep re).15 F .322
-(gions and "cold" colors for shallo)-.15 F 2.822(wr)-.25 G -.15(eg)
--2.822 G(ions;).15 E .181(this is the opposite of the con)108 552 R -.15
-(ve)-.4 G .181
-(ntion we usually use. In order to \214x the colors, we ha).15 F .481
--.15(ve t)-.2 H 2.681(oe).15 G .181(ither rescale the)-2.681 F .758
-(data by multiplying the bath)108 564 R .758(ymetry by \2551 \(accompli\
-shed with \255MGS-1\), or \215ip the color palette \(accom-)-.05 F 1.384
-(plished with \255D\). W)108 576 R 3.884(eu)-.8 G 1.384
-(se the latter approach.)-3.884 F(Finally)6.384 E 3.884(,b)-.65 G 1.383
-(ecause this grid is so small, the def)-3.884 F 1.383(ault shaded)-.1 F
-2.316(relief image is lik)108 588 R 2.317(ely to be grain)-.1 F 3.617
--.65(y. T)-.15 H 4.817<6f8c>-.15 G 4.817(xt)-4.817 G 2.317
-(his problem, we specify a dots per inch resolution of 72)-4.817 F .337
-(\(-MGQ72\); this will tak)108 600 R 2.837(el)-.1 G .337
-(onger and generate a lar)-2.837 F .336(ger plot\214le, b)-.18 F .336
-(ut the plot will look better)-.2 F 2.836(.W)-.55 G 2.836(ea)-3.636 G
-.336(lso use the)-2.836 F(\255L option to specify the title and color s\
-cale label for the plot. Here is the command:)108 612 Q
-(mbm_grdplot \255IZGridBath.grd \\)144 624 Q
-(-G2 \255A0.4/45 \255D \255MGQ72 \255V \\)180 636 Q
-(-L"Shaded Relief Bath)180 648 Q(ymetry":"Depth \(meters\)" \\)-.05 E
-(-Osb199411211212_bathshade)180 660 Q(ZGridBathShade.cmd)144 672 Q 1.26
-(Second, we use)108 696 R F1(mbm_grdplot)3.76 E F0 1.26
-(to generate a color \214ll vie)3.76 F 3.76(wo)-.25 G 3.76(ft)-3.76 G
-1.26(he bath)-3.76 F 1.26(ymetry o)-.05 F -.15(ve)-.15 G 1.26
-(rlaid with the gridded).15 F 2.838(sidescan. The)108 708 R .337
-(sidescan o)2.837 F -.15(ve)-.15 G .337
-(rlay is speci\214ed using the \255K option.).15 F 1.937 -.8(We w)5.337
-H .337(ant the colors for the bath).7 F .337(ymetry to)-.05 F 1.341
-(be chosen without histogram equalization, b)108 720 R 1.341
-(ut we also w)-.2 F 1.342
-(ant histogram equalization to be applied to the)-.1 F(MB-System 5.5)72
-768 Q(26 January 2015)137.61 E(18)190.95 E 0 Cg EP
-%%Page: 19 19
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.61(mbsystem\(1\) MB-System)72 48 R 147.61
-(5.5 mbsystem\(1\))2.5 F .293(sidescan data used for shading. T)108 84 R
-2.793(od)-.8 G 2.793(ot)-2.793 G .293(his, we use \255S0/1, where the \
-\214rst number \(0\) speci\214es no histogram)-2.793 F 1.417(equalizati\
-on of the color scale and the second number \(1\) causes histogram equa\
-lization of the shading)108 96 R 1.396
-(sidescan data to be implemented. In order to maintain the con)108 108 R
--.15(ve)-.4 G 1.396(ntion that high sidescan amplitudes are).15 F 1.164
-(black, we \215ip both the color palette \(as in the pre)108 120 R 1.165
-(vious e)-.25 F 1.165(xample\) and the shading scale with \255D1/1. W)
--.15 F(e)-.8 E 1.289(could also \215ip the shading by specifying a ne)
-108 132 R -.05(ga)-.15 G(ti).05 E 1.589 -.15(ve s)-.25 H 1.289
-(hading magnitude \(-A-0.4\).).15 F 1.288(In this case, we for)6.289 F
-(go)-.18 E(specifying the image resolution, resulting in a grain)108 144
-Q 2.5(yp)-.15 G(lot:)-2.5 E(mbm_grdplot \255IZGridBath.grd \\)144 156 Q
-(-G3 \255KZMosaicSS.grd \\)180 168 Q(-S0/1 \255D1/1 \255A0.4 \255V \\)
-180 180 Q(-L"Bath)180 192 Q(ymetry Ov)-.05 E(erlaid W)-.15 E
-(ith Sidescan":"Depth \(meters\)" \\)-.4 E(-OZGridBathSS)180 204 Q
-(ZGridBathSS.cmd)144 216 Q/F1 10/Times-Bold at 0 SF(Step 8)108 240 Q F0 2.5
-(:G)C(enerate 3D perspecti)-2.5 E .3 -.15(ve v)-.25 H(ie).15 E
-(ws of the gridded data.)-.25 E(No)108 264 Q 2.137 -.65(w, g)-.25 H .837
-(enerate a 3D perspecti).65 F 1.137 -.15(ve v)-.25 H(ie).15 E 3.337(wo)
--.25 G 3.337(ft)-3.337 G .837(he gridded bath)-3.337 F .837
-(ymetry with shading through synthetic illumina-)-.05 F .119
-(tion \(-G2\) using the macro)108 276 R F1(mbm_grd3dplot)2.619 E F0
-2.619(.T)C .119(he grid \214le is in bath)-2.619 F .119(ymetry \(positi)
--.05 F .418 -.15(ve d)-.25 H -.25(ow).15 G .118(n\) rather in topog-).25
-F(raph)108 288 Q 2.905(y\()-.05 G(positi)-2.905 E .705 -.15(ve u)-.25 H
-.405(p\), so the bath).15 F .405
-(ymetry needs to be rescaled by multiplying by \2551 \(-MGS-1\). W)-.05
-F 2.906(ec)-.8 G .406(hoose an)-2.906 F .253
-(illumination magnitude of 0.4 and an illumination azimuth of 45 de)108
-300 R .252(grees \(-A0.4/45\). W)-.15 F 2.752(ea)-.8 G .252
-(lso choose a per)-2.752 F(-)-.2 E(specti)108 312 Q .3 -.15(ve a)-.25 H
-(zimuth of 250 de).15 E(grees and an ele)-.15 E -.25(va)-.25 G
-(tion of 30 de).25 E(grees \(-E240/30\):)-.15 E
-(mbm_grd3dplot \255IZGridBath.grd \\)144 324 Q
-(-G2 \255A0.4/45 \255E250/30 \255MGS-1 \255V \\)180 336 Q(-OZGridBath3D)
-180 348 Q(ZGridBath3D.cmd)144 360 Q(No)108 384 Q 2.583 -.65(w, g)-.25 H
-1.283(enerate a 3D perspecti).65 F 1.583 -.15(ve v)-.25 H(ie).15 E 3.783
-(wo)-.25 G 3.783(ft)-3.783 G 1.283(he gridded bath)-3.783 F 1.284
-(ymetry shaded using the gridded sidescan data)-.05 F .48
-(\(-KZMosaicSS.grd\). W)108 396 R 2.98(ew)-.8 G .48
-(ant the sidescan data to be histogram equalized, so we use \255S0/1. W)
--3.08 F 2.98(ea)-.8 G .48(lso w)-2.98 F(ant)-.1 E 1.325
-(the shading to be more prominent than the def)108 408 R 1.325
-(ault shading magnitude of 0.2 w)-.1 F 1.326(ould produce, so we use)-.1
-F(\255A0.5:)108 420 Q(mbm_grd3dplot \255IZGridBath.grd \\)144 432 Q
-(-KZMosaicSS.grd \\)180 444 Q
-(-G3 \255A0.5 \255E250/30 \255D0/1 \255S0/1 \255MGS-1 \255V \\)180 456 Q
-(-Osb199411211212_bathss3d)180 468 Q(ZGridBathSS3D.cmd)144 480 Q/F2
-10.95/Times-Bold at 0 SF(PR)72 508.8 Q(OCESSING THIRD GENERA)-.329 E
-(TION K)-1.04 E(ONGSBERG MUL)-.329 E(TIBEAM D)-1.007 E -1.644 -1.04
-(AT A)-.383 H F0 .265(The current generation of K)108 520.8 R(ongsber)
--.35 E 2.765(gm)-.18 G .265
-(ultibeam sonars \(EM122, EM302, EM710\) record data in \214les typi-)
--2.765 F .259(cally named with a *.all suf)108 532.8 R .259
-(\214x. These binary \214les consist of man)-.25 F 2.76(yd)-.15 G(if)
--2.76 E .26(ferent data records, most of which are)-.25 F .994
-(similarly structure b)108 544.8 R .994
-(ut distinct from the records output by the earlier generations of K)-.2
-F(ongsber)-.35 E 3.493(g\()-.18 G(formerly)-3.493 E .257
-(Simrad\) multibeams described in a later section. The ra)108 556.8 R
-2.757(wK)-.15 G(ongsber)-3.107 E 2.757(gf)-.18 G .258
-(ormat is supported in)-2.757 F F1(MB-System)2.758 E F0(as)2.758 E .941
-(format 58. Ho)108 568.8 R(we)-.25 E -.15(ve)-.25 G 1.741 -.4(r, f).15 H
-.941(ormat 58 lacks places to store some information that is important \
-to processing. In).4 F(particular)108 580.8 Q 2.954(,t)-.4 G .454(he ra)
--2.954 F 2.954(wK)-.15 G(ongsber)-3.304 E 2.954(gf)-.18 G .454
-(ormat does not store beam \215ags, so the only to apply bath)-2.954 F
-.455(ymetry edits is to)-.05 F .007(null the \215agged beams. This is n\
-ot recommended, as it precludes un\215agging \215agged beams later dete\
-rmined)108 592.8 R(to be good.)108 604.8 Q .957(Also, the ra)108 628.8 R
-3.457(wK)-.15 G(ongsber)-3.807 E 3.457(gf)-.18 G .957
-(ormat stores the initial sidescan samples deri)-3.457 F -.15(ve)-.25 G
-3.457(df).15 G .958(rom subsampling the bottom)-3.457 F .765(returns in\
- each of the formed beams. The locations of these samples on the sea\
-\215oor are irre)108 640.8 R(gular)-.15 E 3.264(,a)-.4 G .764(nd the)
--3.264 F .275(number of samples v)108 652.8 R .275
-(aries greatly from ping to ping. This ra)-.25 F 2.775(ws)-.15 G .275
-(idescan is not well suited for mapmaking or)-2.775 F 1.342
-(processing because of the irre)108 664.8 R 1.342(gular locations.)-.15
-F F1(MB-System)3.842 E F0 1.341(automatically bins and a)3.842 F -.15
-(ve)-.2 G 1.341(rages the a).15 F -.25(va)-.2 G(ilable).25 E .83
-(sidescan samples into a re)108 676.8 R .83(gularly spaced 1024 pix)-.15
-F .831(els with pix)-.15 F .831(el sizes that v)-.15 F .831
-(ary only slightly from ping to)-.25 F .517
-(ping. This resampled sidescan is what appears in sw)108 688.8 R .516
-(ath plots and in the statistics reported by)-.1 F F1(mbinf)3.016 E(o)
--.25 E F0 3.016(.T)C(he)-3.016 E(ra)108 700.8 Q 2.525(wf)-.15 G .025
-(ormat has no space to store the rebinned sidescan, so an)-2.525 F 2.525
-(yc)-.15 G .025(orrections or other processing applied to the)-2.525 F
-(sidescan in formats 58 is lost.)108 712.8 Q(MB-System 5.5)72 768 Q
-(26 January 2015)137.61 E(19)190.95 E 0 Cg EP
-%%Page: 20 20
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.61(mbsystem\(1\) MB-System)72 48 R 147.61
-(5.5 mbsystem\(1\))2.5 F 2.722 -.8(We h)108 84 T -2.25 -.2(av e).8 H
-1.122(de\214ned a processing format \(59\) for K)3.822 F(ongsber)-.35 E
-3.621(gm)-.18 G 1.121(ultibeam that stores beam \215ags and rebinned)
--3.621 F .737(sidescan in addition to all of the information in the ra)
-108 96 R 3.237<778c>-.15 G .737(le format 58. W)-3.237 F 3.238(es)-.8 G
-.738(trongly recommend that third)-3.238 F .723(generation K)108 108 R
-(ongsber)-.35 E 3.223(gm)-.18 G .723(ultibeam data be translated into f\
-ormat 59 before processing. This can be accom-)-3.223 F 6.291
-(plished, albeit unsatisf)108 120 R(actorily)-.1 E 8.791(,w)-.65 G 6.291
-(ith mbcop)-8.791 F 7.592 -.65(y. F)-.1 H 6.292(or e).5 F 6.292
-(xample, gi)-.15 F -.15(ve)-.25 G 8.792(nar).15 G 6.592 -.15(aw E)-8.792
-H 6.292(M122 \214le called).15 F(0006_20111219_201329_METEOR_EM122.all,\
- we can translate it to format 59 using:)108 132 Q(mbcop)144 144 Q 2.5
-<79ad>-.1 G(F58/59 \255I 0006_20111219_201329_METEOR_EM122.all \\)-2.5 E
-(-O 0006_20111219_201329_METEOR_EM122.mb59)180 156 Q 1.384(If we ha)108
-168 R 1.684 -.15(ve a n)-.2 H 1.384(umber of EM122 \214les referenced t\
-hrough a datalist \214le called datalist_ra).15 F -.65(w.)-.15 G 1.383
-(mb-1, we can).65 F(translate all of them using the macro)108 180 Q/F1
-10/Times-Bold at 0 SF(mbm_copy)2.5 E F0(:)A(mbm_cop)144 192 Q 2.5<79ad>-.1
-G(F59 \255I datalist_ra)-2.5 E -.65(w.)-.15 G(mb-1).65 E
-(This macro simply e)108 204 Q -.15(xe)-.15 G(cutes).15 E F1(mbcopy)2.5
-E F0(for each of the data referenced in the input datalist structure.)
-2.5 E .316(The problem with using)108 228 R F1(mbcopy)2.817 E F0 .317
-(for translation between formats 58 and 59 is that the na)2.817 F(vig)
--.2 E .317(ation, heading,)-.05 F 1.155(and attitude contained in forma\
-t 58 \214les are purely asynchronous, which means these v)108 240 R
-1.155(alues are de\214ned)-.25 F .235(according to their o)108 252 R
-.235(wn time stamps and not the time stamps of the multibeam sonar ping\
-s. When format 58)-.25 F 1.263(data are read, the na)108 264 R(vig)-.2 E
-1.263(ation, heading and attitude v)-.05 F 1.262
-(alues must be read from their o)-.25 F 1.262(wn data records and)-.25 F
-1.316(interpolated \(or e)108 276 R 1.316(xtrapolated\) onto the time s\
-tamps of the multibeam pings for each surv)-.15 F 1.616 -.15(ey r)-.15 H
-1.316(ecord. This).15 F -.1(wo)108 288 S .005(rks \214ne if the rele).1
-F -.25(va)-.25 G .005(nt asynchronous na).25 F(vig)-.2 E .005
-(ation and attitude data are al)-.05 F -.1(wa)-.1 G .004
-(ys found in the data \214les before).1 F .197(the surv)108 300 R .497
--.15(ey d)-.15 H .197(ata from the same time, b).15 F .198(ut that adv)
--.2 F .198(antageious timing is neither assured nor common.)-.25 F 2.698
-(Ab)5.198 G(etter)-2.698 E 1.356(approach is to use the tool)108 312 R
-F1(mbk)3.856 E(ongsber)-.15 E(gpr)-.1 E(epr)-.18 E(ocess)-.18 E F0 1.356
-(to preprocess the K)3.856 F(ongsber)-.35 E 3.856(gm)-.18 G 1.356
-(ultibeam data. This)-3.856 F .031(program mak)108 324 R .031(es tw)-.1
-F 2.531(op)-.1 G .032(asses through reading each input \214le, the \214\
-rst to read and store the na)-2.531 F(vig)-.2 E .032(ation and atti-)
--.05 F .294(tude data, and the second to properly interpolate the na)108
-336 R(vig)-.2 E .294(ation and attitude v)-.05 F .293
-(alues onto the multibeam sur)-.25 F(-)-.2 E .3 -.15(vey p)108 348 T
-(ings. The usage is of the form:).15 E(mbk)144 360 Q(ongsber)-.1 E
-(gpreprocess \255I datalist_ra)-.18 E -.65(w.)-.15 G(mb-1 \255V).65 E
-1.342(One further feature of Simrad multibeam data processing should be\
- noted.)108 384 R(Gi)6.342 E -.15(ve)-.25 G 3.842(nt).15 G 1.342
-(hat the ra)-3.842 F 3.842(ws)-.15 G(idescan)-3.842 E .65
-(samples are deri)108 396 R -.15(ve)-.25 G 3.15(dd).15 G .65(irectly fr\
-om the bottom returns identi\214ed by the sonar for each beam, it follo)
--3.15 F .65(ws that)-.25 F(whene)108 408 Q -.15(ve)-.25 G 3.09(rab).15 G
-.59(ottom return pick is erroneous, the sidescan samples associated wit\
-h that beam are also erro-)-3.09 F .093(neous. Consequently)108 420 R
-2.593(,t)-.65 G .092(he binned sidescan shoulde be reprocessed follo)
--2.593 F .092(wing the application of beam \215ags to)-.25 F -.15(ex)108
-432 S 1.395
-(clude the incorrect sidescan samples from the \214nal imagery).15 F
-6.396(.R)-.65 G 1.396(ecalculating the Simrad sidescan is an)-6.396 F F1
-(mbpr)108 444 Q(ocess)-.18 E F0(option which can set using)2.5 E F1
-(mbset)2.5 E F0 2.5(.T)C 2.5(ot)-3.3 G
-(urn on sidescan calculation, we use:)-2.5 E
-(mbset \255I 0006_20111219_201329_METEOR_EM122.mb59 \\)144 456 Q
-(=PSSRECALCMOD:1 \255V)180 468 Q 1.6 -.8(We c)108 480 T(an also turn of)
-.8 E 2.5(fs)-.25 G(idescan recalculation using:)-2.5 E
-(mbset \255I 0006_20111219_201329_METEOR_EM122.mb59 \\)144 492 Q
-(=PSSRECALCMOD:0 \255V)180 504 Q .38(In practice,)108 528 R F1(mbedit)
-2.88 E F0(,)A F1(mbeditviz)2.88 E F0(and)2.88 E F1(mbclean)2.88 E F0
-.379(automatically set the parameter \214le to turn on sidescan recal-)
-2.879 F .563(culation when writing an "edit sa)108 540 R .863 -.15
-(ve \214)-.2 H .564(le" for format 59 data, so users should not ha).15 F
-.864 -.15(ve t)-.2 H 3.064(os).15 G .564(et this parameter)-3.064 F
-(manually)108 552 Q(.)-.65 E/F2 10.95/Times-Bold at 0 SF(PR)72 580.8 Q
-(OCESSING OLDER K)-.329 E(ONGSBERG \(FORMERL)-.329 E 2.738(YS)-1.007 G
-(IMRAD\) MUL)-2.738 E(TIBEAM D)-1.007 E -1.644 -1.04(AT A)-.383 H F0
-2.415(The older series of Simrad multibeam sonars \(EM100, EM950, EM100\
-0, EM12, EM12D, EM121A\))108 592.8 R .285(recorded ra)108 604.8 R 2.785
-(wd)-.15 G .285(ata in \214les typically named with an "_ra)-2.785 F
--.65(w.)-.15 G .285(all" suf).65 F .286
-(\214x. These older data are supported in)-.25 F F1(MB-)2.786 E(System)
-108 616.8 Q F0 .605
-(using format 51. The data from the second generation Simrad \(K)3.106 F
-(ongsber)-.35 E .605(g\) multibeams \(EM3000,)-.18 F .678
-(EM2000, EM1002, EM300, EM120\) also come in \214les with the "_ra)108
-628.8 R -.65(w.)-.15 G .678(all" suf).65 F .678(\214x, b)-.25 F .678
-(ut the format is dif)-.2 F(fer)-.25 E(-)-.2 E .009
-(ent, and is supported by)108 640.8 R F1(MB-System)2.509 E F0 .009
-(as format 56.)2.509 F F1(MB-System)2.509 E F0 .008
-(programs can automatically discern the dif-)2.509 F
-(ference between the tw)108 652.8 Q 2.5(of)-.1 G(ormats, and so the ini\
-tial identi\214cation of the data type is easy with)-2.5 E F1(mbinf)2.5
-E(o)-.25 E F0(.)A(Ho)108 676.8 Q(we)-.25 E -.15(ve)-.25 G 1.358 -.4
-(r, b).15 H .558(oth formats 51 and 56 lack places to store some inform\
-ation that is important to processing. In).4 F(particular)108 688.8 Q
-2.975(,t)-.4 G .475(he ra)-2.975 F 2.975(wS)-.15 G .475
-(imrad formats do not store beam \215ags, so the only to apply bath)
--2.975 F .474(ymetry edits is to null)-.05 F .526(the \215agged beams. \
-This is not recommended, as it precludes un\215agging \215agged beams l\
-ater determined to)108 700.8 R(be good.)108 712.8 Q(MB-System 5.5)72 768
-Q(26 January 2015)137.61 E(20)190.95 E 0 Cg EP
-%%Page: 21 21
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.61(mbsystem\(1\) MB-System)72 48 R 147.61
-(5.5 mbsystem\(1\))2.5 F 1.99(Also, the ra)108 84 R 4.49(wS)-.15 G 1.99
-(imrad formats store the initial sidescan samples deri)-4.49 F -.15(ve)
--.25 G 4.49(df).15 G 1.99(rom subsampling the bottom)-4.49 F .764(retur\
-ns in each of the formed beams. The locations of these samples on the s\
-ea\215oor are irre)108 96 R(gular)-.15 E 3.265(,a)-.4 G .765(nd the)
--3.265 F .275(number of samples v)108 108 R .275
-(aries greatly from ping to ping. This ra)-.25 F 2.775(ws)-.15 G .275
-(idescan is not well suited for mapmaking or)-2.775 F 1.341
-(processing because of the irre)108 120 R 1.342(gular locations.)-.15 F
-/F1 10/Times-Bold at 0 SF(MB-System)3.842 E F0 1.342
-(automatically bins and a)3.842 F -.15(ve)-.2 G 1.342(rages the a).15 F
--.25(va)-.2 G(ilable).25 E .831(sidescan samples into a re)108 132 R
-.831(gularly spaced 1024 pix)-.15 F .831(els with pix)-.15 F .83
-(el sizes that v)-.15 F .83(ary only slightly from ping to)-.25 F .516
-(ping. This resampled sidescan is what appears in sw)108 144 R .517
-(ath plots and in the statistics reported by)-.1 F F1(mbinf)3.017 E(o)
--.25 E F0 3.017(.T)C(he)-3.017 E(ra)108 156 Q 2.858(wf)-.15 G .358
-(ormats ha)-2.858 F .658 -.15(ve n)-.2 H 2.858(os).15 G .358
-(pace to store the rebinned sidescan, so an)-2.858 F 2.857(yc)-.15 G
-.357(orrections or other processing applied to)-2.857 F
-(the sidescan in formats 51 and 56 is lost.)108 168 Q 1.94 -.8(We h)108
-192 T -2.25 -.2(av e).8 H .341(de\214ned a processing format \(57\) for\
- Simrad multibeam that stores beam \215ags and rebinned sides-)3.04 F
-.623(can in addition to all of the information in either of the ra)108
-204 R 3.123<778c>-.15 G .623(le formats \(51 and 56\).)-3.123 F 2.223
--.8(We s)5.623 H .623(trongly recom-).8 F .414
-(mend that Simrad multibeam data from both old and ne)108 216 R .414
-(wer sonars be translated into format 57 before pro-)-.25 F 5.665
-(cessing. This is accomplished with mbcop)108 228 R 6.965 -.65(y. F)-.1
-H 5.665(or e).5 F 5.665(xample, gi)-.15 F -.15(ve)-.25 G 8.164(nar).15 G
-5.964 -.15(aw E)-8.164 H 5.664(M1000 \214le called).15 F
-(0021_19960714_123418_ra)108 240 Q -.65(w.)-.15 G
-(all, we translate it to format 57 using:).65 E(mbcop)144 252 Q 2.5
-<79ad>-.1 G(F51/57 \255I 0021_19960714_123418_ra)-2.5 E -.65(w.)-.15 G
-(all \\).65 E(-O 0021_19960714_123418_ra)180 264 Q -.65(w.)-.15 G(mb57)
-.65 E(Similarly)108 276 Q 4.263(,g)-.65 G -2.15 -.25(iv e)-4.263 H
--6.762 4.263(na r).25 H 2.064 -.15(aw E)-4.263 H 1.764
-(M300 \214le called 0005_20020425_034057_ra).15 F -.65(w.)-.15 G 1.764
-(all, we translate it to format 57).65 F(using:)108 288 Q(mbcop)144 300
-Q 2.5<79ad>-.1 G(F56/57 \255I 0005_20020425_034057_ra)-2.5 E -.65(w.)
--.15 G(all \\).65 E(-O 0005_20020425_034057.mb57)180 312 Q 1.342(One fu\
-rther feature of Simrad multibeam data processing should be noted.)108
-336 R(Gi)6.342 E -.15(ve)-.25 G 3.842(nt).15 G 1.342(hat the ra)-3.842 F
-3.842(ws)-.15 G(idescan)-3.842 E .65(samples are deri)108 348 R -.15(ve)
--.25 G 3.15(dd).15 G .65(irectly from the bottom returns identi\214ed b\
-y the sonar for each beam, it follo)-3.15 F .65(ws that)-.25 F(whene)108
-360 Q -.15(ve)-.25 G 3.09(rab).15 G .59(ottom return pick is erroneous,\
- the sidescan samples associated with that beam are also erro-)-3.09 F
-.092(neous. Consequently)108 372 R 2.592(,t)-.65 G .092
-(he binned sidescan shoulde be reprocessed follo)-2.592 F .092
-(wing the application of beam \215ags to)-.25 F -.15(ex)108 384 S 1.396
-(clude the incorrect sidescan samples from the \214nal imagery).15 F
-6.396(.R)-.65 G 1.395(ecalculating the Simrad sidescan is an)-6.396 F F1
-(mbpr)108 396 Q(ocess)-.18 E F0(option which can set using)2.5 E F1
-(mbset)2.5 E F0 2.5(.T)C 2.5(ot)-3.3 G
-(urn on sidescan calculation, we use:)-2.5 E
-(mbset \255I 0005_20020425_034057.mb57 \\)144 408 Q
-(=PSSRECALCMOD:1 \255V)180 420 Q 1.6 -.8(We c)108 432 T(an also turn of)
-.8 E 2.5(fs)-.25 G(idescan recalculation using:)-2.5 E
-(mbset \255I 0005_20020425_034057.mb57 \\)144 444 Q
-(=PSSRECALCMOD:0 \255V)180 456 Q 1.715(In practice,)108 480 R F1(mbedit)
-4.215 E F0(and)4.215 E F1(mbclean)4.215 E F0 1.716(automatically set th\
-e parameter \214le to turn on sidescan recalculation)4.216 F .204
-(when writing an "edit sa)108 492 R .503 -.15(ve \214)-.2 H .203
-(le" for format 57 data, so users should not ha).15 F .503 -.15(ve t)-.2
-H 2.703(os).15 G .203(et this parameter manually)-2.703 F(.)-.65 E/F2
-10.95/Times-Bold at 0 SF(PR)72 520.8 Q(OCESSING HYDR)-.329 E(OSWEEP DS D)
--.329 E -1.644 -1.04(AT A)-.383 H F0 1.657(Hydrosweep DS sonars were us\
-ed on the R/V Maurice Ewing \(operated by the Lamont-Doherty Earth)108
-532.8 R(Observ)108 544.8 Q 1.204
-(atory and the R/V Thomas Thompson \(operated by the Uni)-.25 F -.15(ve)
--.25 G 1.203(rsity of W).15 F 1.203(ashington\) from the early)-.8 F
-(1990')108 556.8 Q 2.747(su)-.55 G .247(ntil 2001. The ra)-2.747 F 2.747
-(wd)-.15 G .247(ata w)-2.747 F .247(as logged in a te)-.1 F .247
-(xt format \(21\) that is slo)-.15 F 2.747(wt)-.25 G 2.747(or)-2.747 G
-.247(ead and write.)-2.747 F 1.848 -.8(We r)5.248 H(ecom-).8 E .571(men\
-d that users confronted with format 21 data translate it to format 24 b\
-efore processing. F)108 568.8 R .57(ormat 24 is a)-.15 F .463
-(binary data format that contains all of the information in the ra)108
-580.8 R 2.963<778c>-.15 G .463(le, b)-2.963 F .464
-(ut is on the order of 15 times f)-.2 F(aster)-.1 E(to read and write.)
-108 592.8 Q 1.6 -.8(We a)5 H(ccomplish the translation using).8 E F1
-(mbcopy)2.5 E F0(:)A(mbcop)144 604.8 Q 2.5<79ad>-.1 G(F21/24 \255Ihs_e)
--2.5 E(w9204_134.mb21 \\)-.25 E(-Ohsih_e)180 616.8 Q(w9204_134.mb24)-.25
-E 1.652 -.8(We a)108 628.8 T .051(lso strongly recommend that users of \
-Hydrosweep DS data recalculate the bath).8 F .051
-(ymetry using raytracing)-.05 F 1.5(through an appropriate SVP)108 640.8
-R 4.001(,w)-1.11 G 1.501(hether obtained using)-4.001 F F1(mble)4.001 E
-(vitus)-.15 E F0(,)A F1(mb)4.001 E -.1(ve)-.15 G(locitytool).1 E F0
-4.001(,o)C 4.001(rf)-4.001 G 1.501(rom other sources.)-4.001 F 1.132
-(The sonar calculates the ra)108 652.8 R 3.632(wb)-.15 G(ath)-3.632 E
-1.132(ymetry using a homogeneous w)-.05 F 1.132(ater v)-.1 F 1.132
-(elocity model, and the results are)-.15 F(almost al)108 664.8 Q -.1(wa)
--.1 G(ys inferior to those obtained by doing the full raytracing calcul\
-ations with a correct SVP).1 E(.)-1.11 E .324
-(Hydrosweep DS data do not contain sidescan, b)108 688.8 R .324(ut the)
--.2 F 2.824(yd)-.15 G 2.824(oc)-2.824 G .325
-(ontain per beam amplitude data. The amplitude)-2.824 F .826
-(data may be corrected in the same f)108 700.8 R .826
-(ashion as the sidescan. W)-.1 F 3.325(er)-.8 G(un)-3.325 E F1(mb)3.325
-E(backangle)-.1 E F0 .825(with the)3.325 F F1<ad41>3.325 E/F3 10
-/Times-Italic at 0 SF(1)A F0 .825(option to)3.325 F
-(operate on the amplitude data:)108 712.8 Q
-(mbbackangle \255I sb199411211212.mb41 \\)144 724.8 Q(MB-System 5.5)72
-768 Q(26 January 2015)137.61 E(21)190.95 E 0 Cg EP
-%%Page: 22 22
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 147.61(mbsystem\(1\) MB-System)72 48 R 147.61
-(5.5 mbsystem\(1\))2.5 F(-A1 \255P25 \255N161/80 \255V)180 84 Q
-(and then run)108 96 Q/F1 10/Times-Bold at 0 SF(mbpr)2.5 E(ocess)-.18 E F0
-(as usual.)2.5 E/F2 10.95/Times-Bold at 0 SF(PR)72 124.8 Q(OCESSING HYDR)
--.329 E(OSWEEP MD D)-.329 E -1.644 -1.04(AT A)-.383 H F0 .383(Processin\
-g Hydrosweep MD data is similar to processing Hydrosweep DS data. In pa\
-rticular)108 136.8 R 2.884(,r)-.4 G(ecalculating)-2.884 E(bath)108 148.8
-Q .22(ymetry from the tra)-.05 F -.15(ve)-.2 G 2.72(lt).15 G .219
-(imes is necessary because the sonar uses a homogeneous w)-2.72 F .219
-(ater v)-.1 F .219(elocity model.)-.15 F 1.023(The dif)108 160.8 R 1.023
-(ference is simply in the data formats used.)-.25 F 1.023(The ra)6.023 F
-3.523(wH)-.15 G 1.023(ydrosweep MD data \214les \(typically named)-3.523
-F 1.065(with a ".R" suf)108 172.8 R 1.065(\214x\) contain only the tra)
--.25 F -.15(ve)-.2 G 3.565(lt).15 G 1.065
-(imes; the sonar calculated bath)-3.565 F 1.065
-(ymetry is contained in parallel)-.05 F .432
-(\214les \(typically named with a ".P" suf)108 184.8 R .432
-(\214x\). The ".R" \214les are supported as format 101. F)-.25 F .433
-(ormat 102 data \214les)-.15 F(contain bath)108 196.8 Q
-(ymetry in addition to the tra)-.05 E -.15(ve)-.2 G 2.5(lt).15 G
-(imes. T)-2.5 E 2.5(ot)-.8 G
-(ranslate the data from format 101 to 102 we use:)-2.5 E(mbcop)144 208.8
-Q 2.5<79ad>-.1 G(F101/102 \255Iys9409040607.R \\)-2.5 E
-(-Oys9409040607.mb102)180 220.8 Q(Bath)108 232.8 Q .756(ymetry equi)-.05
-F -.25(va)-.25 G .755(lent to that generated by the sonar will automati\
-cally be calculated in the cop).25 F 3.255(yp)-.1 G(rocess)-3.255 E
-(\(the data stream includes the mean w)108 244.8 Q(ater v)-.1 E
-(elocity used by the sonar\).)-.15 E .116
-(Hydrosweep MD data do not contain sidescan, b)108 268.8 R .116(ut the)
--.2 F 2.616(yd)-.15 G 2.616(oc)-2.616 G .117
-(ontain per beam amplitude data. The amplitude)-2.616 F .826
-(data may be corrected in the same f)108 280.8 R .826
-(ashion as the sidescan. W)-.1 F 3.325(er)-.8 G(un)-3.325 E F1(mb)3.325
-E(backangle)-.1 E F0 .825(with the)3.325 F F1<ad41>3.325 E/F3 10
-/Times-Italic at 0 SF(1)A F0 .825(option to)3.325 F
-(operate on the amplitude data:)108 292.8 Q
-(mbbackangle \255I sb199411211212.mb41 \\)144 304.8 Q
-(-A1 \255P25 \255N161/80 \255V)180 316.8 Q(and then run)108 328.8 Q F1
-(mbpr)2.5 E(ocess)-.18 E F0(as usual.)2.5 E F2(SEE ALSO)72 357.6 Q F1
-(mbio)108 369.6 Q F0(\(1\))A F2 -.11(BU)72 398.4 S(GS).11 E F0 .224
-(It doesn')108 410.4 R 2.724(td)-.18 G 2.724(oe)-2.724 G -.15(ve)-2.974
-G .224(rything we w).15 F .224(ant it to yet, it doesn')-.1 F 2.725(tw)
--.18 G .225(ork with e)-2.825 F -.15(ve)-.25 G .225(ry kind of sw).15 F
-.225(ath data e)-.1 F -.15(ve)-.25 G 2.725(rc).15 G .225(ollected, and)
--2.725 F(sometimes it breaks.)108 422.4 Q(MB-System 5.5)72 768 Q
-(26 January 2015)137.61 E(22)190.95 E 0 Cg EP
-%%Trailer
-end
-%%EOF
diff --git a/src/ps/mbtime.ps b/src/ps/mbtime.ps
deleted file mode 100644
index c9dfb34..0000000
--- a/src/ps/mbtime.ps
+++ /dev/null
@@ -1,307 +0,0 @@
-%!PS-Adobe-3.0
-%%Creator: groff version 1.19.2
-%%CreationDate: Wed Jul  1 12:29:31 2015
-%%DocumentNeededResources: font Times-Roman
-%%+ font Times-Bold
-%%+ font Times-Italic
-%%DocumentSuppliedResources: procset grops 1.19 2
-%%Pages: 2
-%%PageOrder: Ascend
-%%DocumentMedia: Default 612 792 0 () ()
-%%Orientation: Portrait
-%%EndComments
-%%BeginDefaults
-%%PageMedia: Default
-%%EndDefaults
-%%BeginProlog
-%%BeginResource: procset grops 1.19 2
-%!PS-Adobe-3.0 Resource-ProcSet
-/setpacking where{
-pop
-currentpacking
-true setpacking
-}if
-/grops 120 dict dup begin
-/SC 32 def
-/A/show load def
-/B{0 SC 3 -1 roll widthshow}bind def
-/C{0 exch ashow}bind def
-/D{0 exch 0 SC 5 2 roll awidthshow}bind def
-/E{0 rmoveto show}bind def
-/F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def
-/G{0 rmoveto 0 exch ashow}bind def
-/H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/I{0 exch rmoveto show}bind def
-/J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def
-/K{0 exch rmoveto 0 exch ashow}bind def
-/L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/M{rmoveto show}bind def
-/N{rmoveto 0 SC 3 -1 roll widthshow}bind def
-/O{rmoveto 0 exch ashow}bind def
-/P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/Q{moveto show}bind def
-/R{moveto 0 SC 3 -1 roll widthshow}bind def
-/S{moveto 0 exch ashow}bind def
-/T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/SF{
-findfont exch
-[exch dup 0 exch 0 exch neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/MF{
-findfont
-[5 2 roll
-0 3 1 roll
-neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/level0 0 def
-/RES 0 def
-/PL 0 def
-/LS 0 def
-/MANUAL{
-statusdict begin/manualfeed true store end
-}bind def
-/PLG{
-gsave newpath clippath pathbbox grestore
-exch pop add exch pop
-}bind def
-/BP{
-/level0 save def
-1 setlinecap
-1 setlinejoin
-72 RES div dup scale
-LS{
-90 rotate
-}{
-0 PL translate
-}ifelse
-1 -1 scale
-}bind def
-/EP{
-level0 restore
-showpage
-}def
-/DA{
-newpath arcn stroke
-}bind def
-/SN{
-transform
-.25 sub exch .25 sub exch
-round .25 add exch round .25 add exch
-itransform
-}bind def
-/DL{
-SN
-moveto
-SN
-lineto stroke
-}bind def
-/DC{
-newpath 0 360 arc closepath
-}bind def
-/TM matrix def
-/DE{
-TM currentmatrix pop
-translate scale newpath 0 0 .5 0 360 arc closepath
-TM setmatrix
-}bind def
-/RC/rcurveto load def
-/RL/rlineto load def
-/ST/stroke load def
-/MT/moveto load def
-/CL/closepath load def
-/Fr{
-setrgbcolor fill
-}bind def
-/setcmykcolor where{
-pop
-/Fk{
-setcmykcolor fill
-}bind def
-}if
-/Fg{
-setgray fill
-}bind def
-/FL/fill load def
-/LW/setlinewidth load def
-/Cr/setrgbcolor load def
-/setcmykcolor where{
-pop
-/Ck/setcmykcolor load def
-}if
-/Cg/setgray load def
-/RE{
-findfont
-dup maxlength 1 index/FontName known not{1 add}if dict begin
-{
-1 index/FID ne{def}{pop pop}ifelse
-}forall
-/Encoding exch def
-dup/FontName exch def
-currentdict end definefont pop
-}bind def
-/DEFS 0 def
-/EBEGIN{
-moveto
-DEFS begin
-}bind def
-/EEND/end load def
-/CNT 0 def
-/level1 0 def
-/PBEGIN{
-/level1 save def
-translate
-div 3 1 roll div exch scale
-neg exch neg exch translate
-0 setgray
-0 setlinecap
-1 setlinewidth
-0 setlinejoin
-10 setmiterlimit
-[]0 setdash
-/setstrokeadjust where{
-pop
-false setstrokeadjust
-}if
-/setoverprint where{
-pop
-false setoverprint
-}if
-newpath
-/CNT countdictstack def
-userdict begin
-/showpage{}def
-/setpagedevice{}def
-}bind def
-/PEND{
-countdictstack CNT sub{end}repeat
-level1 restore
-}bind def
-end def
-/setpacking where{
-pop
-setpacking
-}if
-%%EndResource
-%%EndProlog
-%%BeginSetup
-%%BeginFeature: *PageSize Default
-<< /PageSize [ 612 792 ] /ImagingBBox null >> setpagedevice
-%%EndFeature
-%%IncludeResource: font Times-Roman
-%%IncludeResource: font Times-Bold
-%%IncludeResource: font Times-Italic
-grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72
-def/PL 792 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron/Zcaron
-/scaron/zcaron/Ydieresis/trademark/quotesingle/Euro/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/space/exclam/quotedbl/numbersign/dollar/percent
-/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen
-/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon
-/semicolon/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O
-/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright/circumflex
-/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y
-/z/braceleft/bar/braceright/tilde/.notdef/quotesinglbase/guillemotleft
-/guillemotright/bullet/florin/fraction/perthousand/dagger/daggerdbl
-/endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut
-/dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash
-/quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen
-/brokenbar/section/dieresis/copyright/ordfeminine/guilsinglleft
-/logicalnot/minus/registered/macron/degree/plusminus/twosuperior
-/threesuperior/acute/mu/paragraph/periodcentered/cedilla/onesuperior
-/ordmasculine/guilsinglright/onequarter/onehalf/threequarters
-/questiondown/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE
-/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex
-/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis
-/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn
-/germandbls/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla
-/egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis
-/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide/oslash
-/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis]def
-/Times-Italic at 0 ENC0/Times-Italic RE/Times-Bold at 0 ENC0/Times-Bold RE
-/Times-Roman at 0 ENC0/Times-Roman RE
-%%EndSetup
-%%Page: 1 1
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 157.61(mbtime\(1\) MB-System)72 48 R 157.61
-(5.0 mbtime\(1\))2.5 F/F1 10.95/Times-Bold at 0 SF -.219(NA)72 84 S(ME).219
-E/F2 10/Times-Bold at 0 SF(mbtime)108 96 Q F0 2.5<ad54>2.5 G
-(ranslate between calendar time v)-2.85 E(alues and unix time.)-.25 E F1
-(VERSION)72 124.8 Q F0 -1.11(Ve)108 136.8 S(rsion 5.0)1.11 E F1
-(SYNOPSIS)72 165.6 Q F2(mbtime)108 177.6 Q F0([)2.5 E F2<ad4d>A/F3 10
-/Times-Italic at 0 SF(time_d)A F2<ad54>2.5 E F3
-(year/month/day/hour/minute/second)A F2(\255V \255H])2.5 E F1
-(DESCRIPTION)72 206.4 Q F0 .169(The program)108 218.4 R F2(mbtime)2.669
-E F0(con)2.669 E -.15(ve)-.4 G .169(rts time v).15 F .168
-(alues between unix time \(seconds since 1970/01/01 00:00:00.000000\))
--.25 F .619(and calendar time \(e.g. 2008/006/05/17/24/32.000000\).)108
-230.4 R .619(Unix time is also kno)5.619 F .62
-(wn as POSIX time or epoch)-.25 F 1.24
-(time, and are typically represented in)108 242.4 R F2(MB-System)3.74 E
-F0 1.24(documentation \(and source code\) as "time_d" v)3.74 F(alues.)
--.25 E 5.108(The input time is set using the command line ar)108 254.4 R
-(guments)-.18 E F2<ad4d>7.609 E F3(time_d)A F0 5.109
-(for epoch seconds and)7.609 F F2<ad54>108 266.4 Q F3
-(year/month/day/hour/minute/second)A F0 1.709
-(for calendar time. The output time \(in the form not speci\214ed as)
-4.21 F(input\) is written to stdout.)108 278.4 Q F1 -.548(AU)72 307.2 S
-(THORSHIP).548 E F0(Da)108 319.2 Q(vid W)-.2 E 2.5(.C)-.92 G
-(aress \(caress at mbari.or)-2.5 E(g\))-.18 E(Montere)113 331.2 Q 2.5(yB)
--.15 G(ay Aquarium Research Institute)-2.5 E
-(Dale N. Chayes \(dale at ldeo.columbia.edu\))108 343.2 Q
-(Lamont-Doherty Earth Observ)113 355.2 Q(atory)-.25 E F1(OPTIONS)72 384
-Q F2<ad48>108 396 Q F0 .162(This "help" \215ag cause the program to pri\
-nt out a description of its operation and then e)22.52 F .162
-(xit immedi-)-.15 F(ately)144 408 Q(.)-.65 E F2<ad4d>108 424.8 Q F3
-(time_d)20.86 E F0 .584(Sets the input time to be)144 436.8 R F3(time_d)
-3.084 E F0 .584
-(in unix time, which is de\214ned as seconds since 00:00:00.000000)3.084
-F .142(01 January 1970. If)144 448.8 R F2<ad4d>2.642 E F0 .142
-(is speci\214ed, this time will be con)2.642 F -.15(ve)-.4 G .143
-(rted to calendar time and output to std-).15 F(out in the form)144
-460.8 Q(yyyy/mm/dd/hh/mm/ss.ssssss)180 472.8 Q F2<ad54>108 489.6 Q F3
-(year/month/day/hour/minute/second)23.63 E F0 .399
-(Sets the input time to be)144 501.6 R F3
-(year/month/day/hour/minute/second)2.899 E F0 5.399(.I)C(f)-5.399 E F2
-<ad54>2.899 E F0 .398(is speci\214ed, this time will be)2.898 F(con)144
-513.6 Q -.15(ve)-.4 G 1.043(rted to).15 F F3(time_d)3.543 E F0 1.043(in\
- epoch \(Unix\) seconds, which are seconds since 00:00:00.000000 01 Jan\
--)3.543 F(uary 1970.)144 525.6 Q(The)5 E F3(time_d)2.5 E F0 -.25(va)2.5
-G(lue will be output to stdout.).25 E F2<ad56>108 542.4 Q F0(Normally)
-23.08 E(,)-.65 E F2(mbtime)2.732 E F0 .232(only prints out the con)2.732
-F -.15(ve)-.4 G .232(rted time.).15 F .232(If the)5.232 F F2<ad56>2.732
-E F0 .232(\215ag is gi)2.732 F -.15(ve)-.25 G .232(n, then).15 F F2
-(mbtime)2.731 E F0 -.1(wo)2.731 G(rks).1 E(in a "v)144 554.4 Q
-(erbose" mode and also outputs the program v)-.15 E(ersion being used.)
--.15 E F1(EXAMPLES)72 583.2 Q F0 .509(Suppose one wishes to con)108
-595.2 R -.15(ve)-.4 G .509(rt the current time \(06 June 2008 18:37:14.\
-000000\) to unix seconds. The fol-).15 F(lo)108 607.2 Q(wing command:)
--.25 E(mbtime \255T2008/06/06/18/37/14.0)144 619.2 Q(yields the follo)
-108 631.2 Q(wing result:)-.25 E(1212777434.000000)144 643.2 Q
-(Suppose on wishes to con)108 667.2 Q -.15(ve)-.4 G
-(rt the unix time 1212777434.0 to calendar time.).15 E(The follo)5 E
-(wing command:)-.25 E(mbtime \255M1212777434.0)144 679.2 Q
-(yields the follo)108 691.2 Q(wing result:)-.25 E
-(2008/06/06/18/37/14.000000)144 703.2 Q(MB-System 5.0)72 768 Q 2.5(3J)
-146.495 G(une 2013)-2.5 E(1)204.835 E 0 Cg EP
-%%Page: 2 2
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF 157.61(mbtime\(1\) MB-System)72 48 R 157.61
-(5.0 mbtime\(1\))2.5 F/F1 10.95/Times-Bold at 0 SF(SEE ALSO)72 84 Q/F2 10
-/Times-Bold at 0 SF(mbsystem)108 96 Q F0(\(1\),)A F2(mbio)2.5 E F0(\(1\))A
-F1 -.11(BU)72 124.8 S(GS).11 E F0(Ne)108 136.8 Q -.15(ve)-.25 G 2.5(rb)
-.15 G(ugs, b)-2.7 E
-(ut perhaps our good friends, the terrestrial isopods.)-.2 E
-(MB-System 5.0)72 768 Q 2.5(3J)146.495 G(une 2013)-2.5 E(2)204.835 E 0
-Cg EP
-%%Trailer
-end
-%%EOF
diff --git a/src/ps/mbvelocitytool.ps b/src/ps/mbvelocitytool.ps
deleted file mode 100644
index d266510..0000000
--- a/src/ps/mbvelocitytool.ps
+++ /dev/null
@@ -1,747 +0,0 @@
-%!PS-Adobe-3.0
-%%Creator: groff version 1.19.2
-%%CreationDate: Wed Jul  1 12:29:31 2015
-%%DocumentNeededResources: font Times-Roman
-%%+ font Times-Bold
-%%+ font Times-Italic
-%%DocumentSuppliedResources: procset grops 1.19 2
-%%Pages: 5
-%%PageOrder: Ascend
-%%DocumentMedia: Default 612 792 0 () ()
-%%Orientation: Portrait
-%%EndComments
-%%BeginDefaults
-%%PageMedia: Default
-%%EndDefaults
-%%BeginProlog
-%%BeginResource: procset grops 1.19 2
-%!PS-Adobe-3.0 Resource-ProcSet
-/setpacking where{
-pop
-currentpacking
-true setpacking
-}if
-/grops 120 dict dup begin
-/SC 32 def
-/A/show load def
-/B{0 SC 3 -1 roll widthshow}bind def
-/C{0 exch ashow}bind def
-/D{0 exch 0 SC 5 2 roll awidthshow}bind def
-/E{0 rmoveto show}bind def
-/F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def
-/G{0 rmoveto 0 exch ashow}bind def
-/H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/I{0 exch rmoveto show}bind def
-/J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def
-/K{0 exch rmoveto 0 exch ashow}bind def
-/L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/M{rmoveto show}bind def
-/N{rmoveto 0 SC 3 -1 roll widthshow}bind def
-/O{rmoveto 0 exch ashow}bind def
-/P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/Q{moveto show}bind def
-/R{moveto 0 SC 3 -1 roll widthshow}bind def
-/S{moveto 0 exch ashow}bind def
-/T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/SF{
-findfont exch
-[exch dup 0 exch 0 exch neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/MF{
-findfont
-[5 2 roll
-0 3 1 roll
-neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/level0 0 def
-/RES 0 def
-/PL 0 def
-/LS 0 def
-/MANUAL{
-statusdict begin/manualfeed true store end
-}bind def
-/PLG{
-gsave newpath clippath pathbbox grestore
-exch pop add exch pop
-}bind def
-/BP{
-/level0 save def
-1 setlinecap
-1 setlinejoin
-72 RES div dup scale
-LS{
-90 rotate
-}{
-0 PL translate
-}ifelse
-1 -1 scale
-}bind def
-/EP{
-level0 restore
-showpage
-}def
-/DA{
-newpath arcn stroke
-}bind def
-/SN{
-transform
-.25 sub exch .25 sub exch
-round .25 add exch round .25 add exch
-itransform
-}bind def
-/DL{
-SN
-moveto
-SN
-lineto stroke
-}bind def
-/DC{
-newpath 0 360 arc closepath
-}bind def
-/TM matrix def
-/DE{
-TM currentmatrix pop
-translate scale newpath 0 0 .5 0 360 arc closepath
-TM setmatrix
-}bind def
-/RC/rcurveto load def
-/RL/rlineto load def
-/ST/stroke load def
-/MT/moveto load def
-/CL/closepath load def
-/Fr{
-setrgbcolor fill
-}bind def
-/setcmykcolor where{
-pop
-/Fk{
-setcmykcolor fill
-}bind def
-}if
-/Fg{
-setgray fill
-}bind def
-/FL/fill load def
-/LW/setlinewidth load def
-/Cr/setrgbcolor load def
-/setcmykcolor where{
-pop
-/Ck/setcmykcolor load def
-}if
-/Cg/setgray load def
-/RE{
-findfont
-dup maxlength 1 index/FontName known not{1 add}if dict begin
-{
-1 index/FID ne{def}{pop pop}ifelse
-}forall
-/Encoding exch def
-dup/FontName exch def
-currentdict end definefont pop
-}bind def
-/DEFS 0 def
-/EBEGIN{
-moveto
-DEFS begin
-}bind def
-/EEND/end load def
-/CNT 0 def
-/level1 0 def
-/PBEGIN{
-/level1 save def
-translate
-div 3 1 roll div exch scale
-neg exch neg exch translate
-0 setgray
-0 setlinecap
-1 setlinewidth
-0 setlinejoin
-10 setmiterlimit
-[]0 setdash
-/setstrokeadjust where{
-pop
-false setstrokeadjust
-}if
-/setoverprint where{
-pop
-false setoverprint
-}if
-newpath
-/CNT countdictstack def
-userdict begin
-/showpage{}def
-/setpagedevice{}def
-}bind def
-/PEND{
-countdictstack CNT sub{end}repeat
-level1 restore
-}bind def
-end def
-/setpacking where{
-pop
-setpacking
-}if
-%%EndResource
-%%EndProlog
-%%BeginSetup
-%%BeginFeature: *PageSize Default
-<< /PageSize [ 612 792 ] /ImagingBBox null >> setpagedevice
-%%EndFeature
-%%IncludeResource: font Times-Roman
-%%IncludeResource: font Times-Bold
-%%IncludeResource: font Times-Italic
-grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72
-def/PL 792 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron/Zcaron
-/scaron/zcaron/Ydieresis/trademark/quotesingle/Euro/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/space/exclam/quotedbl/numbersign/dollar/percent
-/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen
-/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon
-/semicolon/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O
-/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright/circumflex
-/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y
-/z/braceleft/bar/braceright/tilde/.notdef/quotesinglbase/guillemotleft
-/guillemotright/bullet/florin/fraction/perthousand/dagger/daggerdbl
-/endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut
-/dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash
-/quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen
-/brokenbar/section/dieresis/copyright/ordfeminine/guilsinglleft
-/logicalnot/minus/registered/macron/degree/plusminus/twosuperior
-/threesuperior/acute/mu/paragraph/periodcentered/cedilla/onesuperior
-/ordmasculine/guilsinglright/onequarter/onehalf/threequarters
-/questiondown/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE
-/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex
-/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis
-/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn
-/germandbls/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla
-/egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis
-/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide/oslash
-/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis]def
-/Times-Italic at 0 ENC0/Times-Italic RE/Times-Bold at 0 ENC0/Times-Bold RE
-/Times-Roman at 0 ENC0/Times-Roman RE
-%%EndSetup
-%%Page: 1 1
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mb)72 48 Q -.15(ve)-.15 G 127.91
-(locitytool\(1\) MB-System).15 F 127.91(5.0 mb)2.5 F -.15(ve)-.15 G
-(locitytool\(1\)).15 E/F1 10.95/Times-Bold at 0 SF -.219(NA)72 84 S(ME).219
-E/F2 10/Times-Bold at 0 SF(mb)108 96 Q -.1(ve)-.15 G(locitytool).1 E F0 2.5
-<ad49>2.5 G(nteracti)-2.5 E .3 -.15(ve w)-.25 H(ater sound v).05 E
-(elocity pro\214le editor)-.15 E(.)-.55 E F1(VERSION)72 124.8 Q F0 -1.11
-(Ve)108 136.8 S(rsion 5.0)1.11 E F1(SYNOPSIS)72 165.6 Q F2(mb)108 177.6
-Q -.1(ve)-.15 G(locitytool).1 E F0([)2.5 E F2<ad42>A/F3 10
-/Times-Italic at 0 SF(yr/mo/da/hr/mn/sc)A F2<ad45>2.5 E F3
-(yr/mo/da/hr/mn/sc)A F2<ad46>2.5 E F3(format)A F2<ad49>2.5 E F3(\214le)A
-F2<ad53>2.5 E F3(svp\214le)A F2<ad57>2.5 E F3(svp\214le)A F2<ad5620ad48>
-2.5 E F3(])A F1(DESCRIPTION)72 206.4 Q F2(MBv)108 218.4 Q(elocitytool)
--.1 E F0 .27(is an interacti)2.77 F .57 -.15(ve w)-.25 H .269
-(ater sound v).05 F .269(elocity pro\214le \(SVP\) editor used to e)-.15
-F .269(xamine multiple SVPs,)-.15 F .225(to create ne)108 230.4 R 2.725
-(wS)-.25 G .225
-(VPs, and to model the impact of SVP modi\214cation on sw)-2.725 F .226
-(ath bath)-.1 F .226(ymetry data. SVPs created)-.05 F(using)108 242.4 Q
-F2(MBv)3.445 E(elocitytool)-.1 E F0 .944(can be used by the program)
-3.445 F F2(mbpr)3.444 E(ocess)-.18 E F0 .944(to recalculate sw)3.444 F
-.944(ath bath)-.1 F .944(ymetry from ra)-.05 F(w)-.15 E(tra)108 254.4 Q
--.15(ve)-.2 G 2.5(lt).15 G(ime and angle data.)-2.5 E .234(In general,)
-108 278.4 R F2(MBv)2.734 E(elocitytool)-.1 E F0 .234(is used to e)2.734
-F .234(xamine SVPs obtained from sw)-.15 F .234(ath data \214les \(see)
--.1 F F2(mbsvplist)2.734 E F0(manual)2.734 E 1.116
-(page\), XBTs, CTDs, or databases, and to construct ne)108 290.4 R 3.615
-(wp)-.25 G 1.115(ro\214les consistent with these v)-3.615 F 1.115
-(arious sources of)-.25 F .212
-(information. The SVPs are represented by a set of paired depth and v)
-108 302.4 R .213(elocity v)-.15 F .213(alues which are connected by)-.25
-F 1.631(linear interpolation.)108 314.4 R 1.631
-(Users may load a number of SVPs for display)6.631 F 4.13(.U)-.65 G 1.63
-(sers may load or create a single)-4.13 F
-(editable SVP and then interacti)108 326.4 Q -.15(ve)-.25 G
-(ly modify this pro\214le.).15 E .497(When users load sw)108 350.4 R
-.497(ath bath)-.1 F .497(ymetry data containing ra)-.05 F 2.997(wt)-.15
-G(ra)-2.997 E -.15(ve)-.2 G 2.997(lt).15 G .497
-(ime and angle data \(man)-2.997 F 2.997(yb)-.15 G .497(ut not all sw)
--3.197 F(ath)-.1 E .935(data format include this information\),)108
-362.4 R F2(MBv)3.435 E(elocitytool)-.1 E F0 .934(recalculates the bath)
-5.935 F .934(ymetry by raytracing through)-.05 F .801
-(the current SVP model. If the bath)108 374.4 R .801
-(ymetry in the input sw)-.05 F .801
-(ath \214le has been edited \(e.g. with)-.1 F F2(mbedit)3.302 E F0 .802
-(\), then)B .102(the associated edit sa)108 386.4 R .402 -.15(ve \214)
--.2 H .102(le \(*.esf \214le\) will be loaded as well, and the beams \
-\215agged as bad will not be used).15 F(by)108 398.4 Q F2(MBv)2.728 E
-(elocitytool)-.1 E F0 5.228(.T)C .228(he bath)-5.228 F .229
-(ymetry of each ping is \214t with a line, and bath)-.05 F .229
-(ymetry residuals are calculated)-.05 F 1.003(for each good beam relati)
-108 410.4 R 1.303 -.15(ve t)-.25 H 3.503(ot).15 G 1.003
-(he linear \214t.)-3.503 F 1.003(The a)6.003 F -.15(ve)-.2 G 1.003
-(rage of the bath).15 F 1.003(ymetry residuals is displayed along)-.05 F
-1.805(with "error bars" indicating the standard de)108 422.4 R 1.805
-(viations of the residuals. Anomalously shallo)-.25 F 6.805(wb)-.25 G
-(ath)-6.805 E(ymetry)-.05 E .188(maps into ne)108 434.4 R -.05(ga)-.15 G
-(ti).05 E .488 -.15(ve r)-.25 H .188(esiduals and deep bath).15 F .188
-(ymetry into positi)-.05 F .488 -.15(ve r)-.25 H .188
-(esiduals; the residuals are displayed so that).15 F(shallo)108 446.4 Q
-2.933(wi)-.25 G 2.933(su)-2.933 G 2.933(pa)-2.933 G .433(nd deep is do)
--2.933 F .433(wn. If the sea\215oor is reasonably smooth so that a line\
-ar \214t is appropriate, then)-.25 F .38
-(the residuals will accurately re\215ect an)108 458.4 R 2.88(yp)-.15 G
-.379(roblems with the w)-2.88 F .379(ater v)-.1 F .379
-(elocity pro\214le.)-.15 F .379(If the w)5.379 F .379(ater v)-.1 F .379
-(elocity pro-)-.15 F 1.315
-(\214le is correct, then the residual plot will be roughly \215at.)108
-470.4 R 1.315(If the w)6.315 F 1.315(ater v)-.1 F 1.315
-(elocity pro\214le is signi\214cantly in)-.15 F(error)108 482.4 Q 3.461
-(,t)-.4 G .961(hen the outer beam depths may anomalously shallo)-3.461 F
-3.461(w\()-.25 G .96(edge curl up\) or deep \(edge curl do)-3.461 F 3.46
-(wn\). In)-.25 F(practice, the editable v)108 494.4 Q
-(elocity pro\214le is altered interacti)-.15 E -.15(ve)-.25 G
-(ly until a reasonably residual pattern is achie).15 E -.15(ve)-.25 G
-(d.).15 E 1.983(In order to calculate bath)108 518.4 R 1.983(ymetry v)
--.05 F 1.983(alues from tra)-.25 F -.15(ve)-.2 G 4.483(lt).15 G 1.983
-(ime observ)-4.483 F 1.983(ations, geometrical raypaths are traced)-.25
-F .012(through the SVP for each beam. Because the sound v)108 530.4 R
-.011(elocity gradients are uniform between the depth-v)-.15 F(eloc-)-.15
-E .937(ity nodes \(linear interpolation\), the raypaths are be calculat\
-ed analytically as pieces of circular arcs. This)108 542.4 R
-(raytracing algorithm is the same used in the program)108 554.4 Q F2
-(mbpr)2.5 E(ocess)-.18 E F0(.)A 1.367(One important aspect of the raytr\
-acing is the handling of the initial tak)108 578.4 R(eof)-.1 E 3.867(fa)
--.25 G 1.366(ngles associated with each)-3.867 F .082
-(beam or sounding. In general, the raytracing will be)108 590.4 R .083
-(gin at a point in the sound speed model that has a sound)-.15 F -.15
-(ve)108 602.4 S .587(locity dif).15 F .587(ferent than the surf)-.25 F
-.587(ace sound v)-.1 F .587
-(elocity \(SSV\) used by the mapping sonar for the original beam-)-.15 F
-.035(forming. The usual approach is to use Snell')108 614.4 R 2.536(sl)
--.55 G .336 -.15(aw t)-2.536 H 2.536(oa).15 G .036
-(djust the starting angle for this change in sound v)-2.536 F(eloc-)-.15
-E(ity)108 626.4 Q 3.704(.T)-.65 G 1.204
-(his amounts to an assumption that the original SSV w)-3.704 F 1.204
-(as correct and that)-.1 F 1.204(the rays pass through an)6.204 F .301(\
-insigni\214cantly thick layer in which the sound speed equals the SSV b\
-efore transitioning to the sound speed)108 638.4 R .895
-(implied by the SVP)108 650.4 R 3.395(.T)-1.11 G .895(his is the def)
--3.395 F .894(ault setting for raytracing in)-.1 F F2(MB-System)3.394 E
-F0 5.894(.A)C(lternati)-5.894 E -.15(ve)-.25 G(ly).15 E 3.394(,o)-.65 G
-.894(ne can pro-)-3.394 F .313
-(ceed with raytracing using the original angle b)108 662.4 R .314
-(ut this is rarely useful or correct. Finally)-.2 F 2.814(,i)-.65 G
-2.814(ft)-2.814 G .314(he SSV used by)-2.814 F .141
-(the sonar is judged to ha)108 674.4 R .441 -.15(ve b)-.2 H .141
-(een incorrect, then the tak).15 F(eof)-.1 E 2.641(fa)-.25 G .141
-(ngle must be corrected for the erroneous beam-)-2.641 F .054
-(forming as well as for the dif)108 686.4 R .054
-(ference between the SSV and the initial raytracing sound v)-.25 F
-(elocity)-.15 E 2.555(.T)-.65 G .055(his correc-)-2.555 F .707
-(tion must tak)108 698.4 R 3.207(et)-.1 G .707(he sonar geometry into a\
-ccount because the impact of changing the SSV on a beam angle)-3.207 F
-.513(from a \215at recei)108 710.4 R .813 -.15(ve a)-.25 H .513
-(rray is v).15 F .514(ery dif)-.15 F .514(ferent from a V)-.25 F .514
-(-shaped or curv)-1 F .514(ed array)-.15 F 3.014(.A)-.65 G .514
-(ll three of these angle correc-)-3.014 F(tion modes are a)108 722.4 Q
--.25(va)-.2 G(ilable in).25 E F2(mb)2.5 E -.1(ve)-.15 G(locitytool).1 E
-F0(.)A(MB-System 5.0)72 768 Q(10 No)132.205 E -.15(ve)-.15 G(mber 2014)
-.15 E(1)190.545 E 0 Cg EP
-%%Page: 2 2
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mb)72 48 Q -.15(ve)-.15 G 127.91
-(locitytool\(1\) MB-System).15 F 127.91(5.0 mb)2.5 F -.15(ve)-.15 G
-(locitytool\(1\)).15 E/F1 10/Times-Bold at 0 SF(MBv)108 84 Q(elocitytool)
--.1 E F0 1.591(can be used in conjunction with)4.091 F F1(mbpr)4.091 E
-(ocess)-.18 E F0 6.591(.I)C 4.091(ft)-6.591 G 1.59(he user uses the)
--4.091 F F1(Sa)4.09 E 1.79 -.1(ve s)-.25 H 1.59(wath svp \214le).1 F F0
-.066(option to sa)108 96 R .366 -.15(ve a)-.2 H 2.566(nS).15 G .066
-(VP model de)-2.566 F -.15(ve)-.25 G .066
-(loped through the analysis of a particular sw).15 F .067
-(ath data \214le,)-.1 F F1(MBv)2.567 E(elocitytool)-.1 E F0 .455
-(also sets the associated)108 108 R F1(mbpr)2.955 E(ocess)-.18 E F0 .455
-(parameter \214le so that)2.955 F F1(mbpr)2.955 E(ocess)-.18 E F0 .455
-(recalculates the bath)2.955 F .455(ymetry using the)-.05 F(ne)108 120 Q
-3.155(wS)-.25 G .655(VP model.)-3.155 F .655(The program)5.655 F F1
-(mbset)3.155 E F0 .656
-(may be used to set the SVP \214le in the parameter \214le for an)3.155
-F 3.156(ys)-.15 G -.1(wa)-3.156 G(th).1 E .938
-(data \214le. Users may also sa)108 132 R 1.238 -.15(ve S)-.2 H .938
-(VP models without setting an).15 F(y)-.15 E F1(mbpr)3.438 E(ocess)-.18
-E F0 .938(parameters by using the)3.438 F F1(Sa)3.438 E -.1(ve)-.25 G
-(editable pr)108 144 Q(o\214le)-.18 E F0(option.)2.5 E .373
-(Sometimes the bath)108 168 R .373(ymetry residuals sho)-.05 F 2.873(ws)
--.25 G .373(tructure indicati)-2.873 F .673 -.15(ve o)-.25 H 2.873(fp)
-.15 G .373(ersistent artif)-2.873 F .373(acts in the bath)-.1 F .374
-(ymetry \(e.g.)-.05 F .485(certain parts of the sw)108 180 R .484
-(ath may be persistently shallo)-.1 F .484
-(wer or deeper than the rest of the sw)-.25 F .484
-(ath\). In this situa-)-.1 F .621(tion, it is possible to e)108 192 R
-.621(xport the residuals and to then apply them in)-.15 F F1(mbpr)3.121
-E(ocess)-.18 E F0 .621(as static corrections to the)3.121 F(bath)108 204
-Q(ymetry)-.05 E 2.5(.T)-.65 G(his is accomplished by using the)-2.5 E F1
-(Sa)2.5 E .2 -.1(ve r)-.25 H(esiduals as offsets)-.08 E F0
-(option under the)2.5 E F1(File)2.5 E F0(menu.)2.5 E .998
-(If a user attempts to read in sw)108 228 R .998(ath bath)-.1 F .998
-(ymetry that does not contain the tra)-.05 F -.15(ve)-.2 G 3.498(lt).15
-G .998(ime and beam angle data)-3.498 F 1.01(required for bath)108 240 R
-1.01(ymetry recalculation,)-.05 F F1(MBv)3.51 E(elocitytool)-.1 E F0
-1.01(will estimate the tra)3.51 F -.15(ve)-.2 G 3.51(lt).15 G 1.01
-(imes and angles from the)-3.51 F(bath)108 252 Q 1.163
-(ymetry by assuming a 1500 m/s half-space \(and then post a w)-.05 F
-1.162(arning dialog\). Although the user can)-.1 F .265
-(proceed to model bath)108 264 R .265
-(ymetry recalculation by modifying the acti)-.05 F .566 -.15(ve S)-.25 H
-.266(VP just as with proper data, the tra).15 F -.15(ve)-.2 G(l).15 E
-.27
-(times and angles are not in general correct and so the modeling and an)
-108 276 R 2.77(yr)-.15 G .27(esults it gi)-2.77 F -.15(ve)-.25 G 2.77
-(sa).15 G .27(re, well, bogus.)-2.77 F(A)5.27 E .452
-(more useful approach is to lea)108 288 R .752 -.15(ve t)-.2 H .453
-(he SVP alone and simply e).15 F .453
-(xport the residuals to be applied as static cor)-.15 F(-)-.2 E 1.398
-(rections in mbprocess.)108 300 R 1.397(This approach allo)6.397 F 1.397
-(ws users a practical means of correcting older multibeam ba-)-.25 F(th)
-108 312 Q .901(ymetry that w)-.05 F .901
-(as originally calculated with an incorrect SVP b)-.1 F .901
-(ut which contains no tra)-.2 F -.15(ve)-.2 G 3.402(lt).15 G .902
-(ime or angle)-3.402 F(data.)108 324 Q/F2 10.95/Times-Bold at 0 SF -.548
-(AU)72 352.8 S(THORSHIP).548 E F0(Da)108 364.8 Q(vid W)-.2 E 2.5(.C)-.92
-G(aress \(caress at mbari.or)-2.5 E(g\))-.18 E(Montere)113 376.8 Q 2.5(yB)
--.15 G(ay Aquarium Research Institute)-2.5 E
-(Dale N. Chayes \(dale at ldeo.columbia.edu\))108 388.8 Q
-(Lamont-Doherty Earth Observ)113 400.8 Q(atory)-.25 E F2(OPTIONS)72
-429.6 Q F1<ad42>108 441.6 Q/F3 10/Times-Italic at 0 SF(yr/mo/da/hr/mn/sc)
-23.63 E F0 .614(Sets the starting time for data allo)144 453.6 R .614
-(wed in the input data; pings with times before the starting time)-.25 F
-(will be ignored.)144 465.6 Q(Def)5 E(ault:)-.1 E F3(yr/mo/da/hr/mn/sc)
-2.5 E F0 2.5(=1)2.5 G(962/2/21/10/30/0.)-2.5 E F1<ad45>108 482.4 Q F3
-(yr/mo/da/hr/mn/sc)23.63 E F0 .286(Sets the ending time for data allo)
-144 494.4 R .287
-(wed in the input data; pings with times after the ending time will)-.25
-F(be ignored.)144 506.4 Q(Def)5 E(ault:)-.1 E F3(yr/mo/da/hr/mn/sc)2.5 E
-F0 2.5(=2)2.5 G(062/2/21/10/30/0.)-2.5 E F1<ad46>108 523.2 Q F3(format)
-24.19 E F0 1.018(Sets the format at startup for the input and output sw)
-144 535.2 R 1.018(ath sonar data using)-.1 F F1(MBIO)3.518 E F0(inte)
-3.518 E 1.018(ger format)-.15 F .974(identi\214ers. This v)144 547.2 R
-.974(alue can also be set interacti)-.25 F -.15(ve)-.25 G .974
-(ly when specifying the input \214le.).15 F .975(This program)5.975 F
-.992(uses the)144 559.2 R F1(MBIO)3.492 E F0 .991
-(library and will read an)3.492 F 3.491(ys)-.15 G -.1(wa)-3.491 G .991
-(th sonar format supported by).1 F F1(MBIO)3.491 E F0 3.491(.Al)C .991
-(ist of the)-3.491 F(sw)144 571.2 Q .694
-(ath sonar data formats currently supported by)-.1 F F1(MBIO)3.194 E F0
-.694(and their identi\214er v)3.194 F .694(alues is gi)-.25 F -.15(ve)
--.25 G 3.194(ni).15 G 3.194(nt)-3.194 G(he)-3.194 E F1(MBIO)144 583.2 Q
-F0(manual page.)2.5 E(Def)5 E(ault:)-.1 E F3(format)2.5 E F0 2.5(=1)2.5
-G(1.)-2.5 E F1<ad48>108 600 Q F0 .162(This "help" \215ag cause the prog\
-ram to print out a description of its operation and then e)22.52 F .161
-(xit immedi-)-.15 F(ately)144 612 Q(.)-.65 E F1<ad49>108 628.8 Q F3
-(\214le)26.41 E F0 .702(Sets the data \214le from which the input sw)144
-640.8 R .703(ath data will be read at startup.)-.1 F .703(This v)5.703 F
-.703(alue can also be)-.25 F(set interacti)144 652.8 Q -.15(ve)-.25 G
-(ly).15 E 2.5(.S)-.65 G(ee belo)-2.5 E -.65(w.)-.25 G F1<ad53>108 669.6
-Q F3(svp\214le)24.74 E F0 .985
-(Sets the data \214le from which an input display sound v)144 681.6 R
-.984(elocity pro\214le will be read at startup. See)-.15 F(belo)144
-693.6 Q 3.8 -.65(w. T)-.25 H(his v).65 E(alue can also be set interacti)
--.25 E -.15(ve)-.25 G(ly).15 E(.)-.65 E F1<ad57>108 710.4 Q F3
-(svp\214le)20.3 E F0 .478
-(Sets the data \214le from which an input editable sound v)144 722.4 R
-.478(elocity pro\214le will be read at startup.)-.15 F(This)5.479 E
-(MB-System 5.0)72 768 Q(10 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E
-(2)190.545 E 0 Cg EP
-%%Page: 3 3
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mb)72 48 Q -.15(ve)-.15 G 127.91
-(locitytool\(1\) MB-System).15 F 127.91(5.0 mb)2.5 F -.15(ve)-.15 G
-(locitytool\(1\)).15 E -.25(va)144 84 S(lue can also be set interacti)
-.25 E -.15(ve)-.25 G(ly).15 E 2.5(.S)-.65 G(ee belo)-2.5 E -.65(w.)-.25
-G/F1 10/Times-Bold at 0 SF<ad56>108 100.8 Q F0(Normally)23.08 E(,)-.65 E F1
-(mb)2.626 E -.1(ve)-.15 G(locitytool).1 E F0 -.1(wo)2.626 G .126
-(rks "silently" without outputting an).1 F .126
-(ything to the stderr stream.)-.15 F .125(If the)5.125 F F1<ad56>144
-112.8 Q F0 .178(\215ag is gi)2.678 F -.15(ve)-.25 G .178(n, then).15 F
-F1(mb)2.678 E -.1(ve)-.15 G(locitytool).1 E F0 -.1(wo)2.679 G .179
-(rks in a "v).1 F .179(erbose" mode and outputs the program v)-.15 F
-(ersion)-.15 E(being used, all error status messages, and a lar)144
-124.8 Q(ge amount of other information.)-.18 E/F2 10.95/Times-Bold at 0 SF
-(INTERA)72 153.6 Q(CTIVE CONTR)-.602 E(OLS)-.329 E F1(File)108 165.6 Q
-F0(This b)19.89 E
-(utton brings up a menu containing the commands listed belo)-.2 E(w:)
--.25 E F1(File->Open Display Pr)108 182.4 Q(o\214le)-.18 E F0 .211
-(Selecting this menu item brings up a popup windo)144 194.4 R 2.711(ww)
--.25 G .211(hich allo)-2.711 F .21(ws the user to select an input w)-.25
-F(ater)-.1 E -.15(ve)144 206.4 S .502(locity pro\214le \214le. The pro\
-\214le will be displayed in a depth vs v).15 F .503
-(elocity plot along with other dis-)-.15 F .439
-(play pro\214les and the edit v)144 218.4 R .439
-(elocity pro\214le, if one has been opened.)-.15 F .439
-(Up to ten display v)5.439 F .438(elocity pro-)-.15 F .529
-(\214les may be loaded; the color of the display pro\214les c)144 230.4
-R .529(ycles through red, green, blue, and black in)-.15 F
-(the order that the)144 242.4 Q 2.5(ya)-.15 G(re loaded.)-2.5 E F1
-(File->Open Editable Pr)108 259.2 Q(o\214le)-.18 E F0 .211
-(Selecting this menu item brings up a popup windo)144 271.2 R 2.711(ww)
--.25 G .211(hich allo)-2.711 F .21(ws the user to select an input w)-.25
-F(ater)-.1 E -.15(ve)144 283.2 S 1.041
-(locity pro\214le \214le to be edited.).15 F 1.042
-(The pro\214le will be displayed in a depth vs v)6.042 F 1.042
-(elocity plot along)-.15 F .964(with an)144 295.2 R 3.464(yd)-.15 G .964
-(isplay pro\214les that ha)-3.464 F 1.264 -.15(ve b)-.2 H .964
-(een opened.).15 F .964
-(This pro\214le will be plotted as black lines with)5.964 F .96
-(small black squares at the v)144 307.2 R .96(elocity depth points.)-.15
-F .96(The v)5.96 F .96(elocity depth points may be selected and)-.15 F
-(dragged using the mouse to change the editable v)144 319.2 Q
-(elocity pro\214le.)-.15 E F1(File->New Editable Pr)108 336 Q(o\214le)
--.18 E F0 .432(Selecting this menu item creates a def)144 348 R .432
-(ault editable v)-.1 F .431(elocity pro\214le consisting of 14 v)-.15 F
-(elocity-depth)-.15 E .023(points with a v)144 360 R .023
-(elocity of 1500 m/s.)-.15 F(An)5.024 E 2.524(yp)-.15 G(re)-2.524 E .024
-(viously de\214ned editable v)-.25 F .024
-(elocity pro\214le will disappear)-.15 F(.)-.55 E .638
-(The pro\214le will be displayed in a depth vs v)144 372 R .638
-(elocity plot along with an)-.15 F 3.137(yd)-.15 G .637
-(isplay pro\214les that ha)-3.137 F -.15(ve)-.2 G .942(been opened.)144
-384 R .943(This pro\214le will be plotted as black lines with small bla\
-ck squares at the v)5.942 F(elocity)-.15 E .556(depth points.)144 396 R
-.556(The v)5.556 F .555(elocity depth points may be selected and dragge\
-d using the left mouse b)-.15 F(utton)-.2 E .929
-(to change the editable v)144 408 R .929
-(elocity pro\214le. The center mouse b)-.15 F .929(utton adds ne)-.2 F
-3.43(wv)-.25 G .93(elocity-depth points,)-3.58 F(and the right mouse b)
-144 420 Q(utton remo)-.2 E -.15(ve)-.15 G 2.5(sv).15 G
-(elocity-depth points.)-2.65 E F1(File->Sa)108 436.8 Q .2 -.1(ve E)-.25
-H(ditable Pr).1 E(o\214le)-.18 E F0 1.438
-(Selecting this menu item brings up a popup windo)144 448.8 R 3.937(ww)
--.25 G 1.437(hich allo)-3.937 F 1.437(ws the user to sa)-.25 F 1.737
--.15(ve t)-.2 H 1.437(he current).15 F(editable v)144 460.8 Q
-(elocity pro\214le as a \214le.)-.15 E F1(File->Open Swath Sonar Data)
-108 477.6 Q F0 .144(Selecting this menu item brings up a popup windo)144
-489.6 R 2.645(ww)-.25 G .145(hich allo)-2.645 F .145
-(ws the user to select an input sw)-.25 F(ath)-.1 E .025(sonar data \
-\214le to be processed in conjunction with the current editable v)144
-501.6 R .025(elocity pro\214le.)-.15 F .025(The format)5.025 F 1.252
-(id for the data \214le must be set appropriately in the editable te)144
-513.6 R 1.253(xt widget labeled "MBIO F)-.15 F(ormat)-.15 E .14
-(ID:"; this program uses the)144 525.6 R F1(MBIO)2.64 E F0 .139
-(library and will read or write an)2.64 F 2.639(ys)-.15 G -.1(wa)-2.639
-G .139(th sonar format supported).1 F(by)144 537.6 Q F1(MBIO)2.588 E F0
-2.588(.Al)C .089(ist of the sw)-2.588 F .089
-(ath sonar data formats currently supported by)-.1 F F1(MBIO)2.589 E F0
-.089(and their identi\214er)2.589 F -.25(va)144 549.6 S .903(lues is gi)
-.25 F -.15(ve)-.25 G 3.403(ni).15 G 3.403(nt)-3.403 G(he)-3.403 E F1
-(MBIO)3.402 E F0 .902(manual page.)3.402 F .902(If the sw)5.902 F .902
-(ath sonar data \214le is named using the)-.1 F F1(MB-)3.402 E(System)
-144 561.6 Q F0(suf)3.765 E 1.265(\214x con)-.25 F -.15(ve)-.4 G 1.266(n\
-tion \(format 11 \214les end with ".mb11", format 41 \214les end with "\
-.mb41",).15 F .319(etc.\), then the program will automatically use the \
-appropriate format id.)144 573.6 R .318(The sw)5.318 F .318
-(ath sonar data \214le)-.1 F .017
-(must be in one of the formats which store tra)144 585.6 R -.15(ve)-.2 G
-2.517(lt).15 G .017(ime data for each beam. Up to 25000 data records)
--2.517 F 1.309(will be read into a b)144 597.6 R(uf)-.2 E 1.308
-(fer for processing.)-.25 F 1.308(If there is no current editable v)
-6.308 F 1.308(elocity pro\214le, then a)-.15 F(def)144 609.6 Q .037
-(ault pro\214le consisting of 14 v)-.1 F .037
-(elocity-depth points with a v)-.15 F .038
-(elocity of 1500 m/s will be created. A)-.15 F 2.138
-(display pro\214le generated by the)144 621.6 R F1(mble)4.638 E(vitus)
--.15 E F0 2.137(program will also be automatically generated and)4.638 F
-1.069(loaded into)144 633.6 R F1(mb)3.569 E -.1(ve)-.15 G(locitytool).1
-E F0 3.569(;t)C 1.069(his Le)-3.569 F 1.069(vitus pro\214le will serv)
--.25 F 3.569(ea)-.15 G 3.569(sa)-3.569 G 3.569(na)-3.569 G -.15(ve)
--3.769 G 1.07(rage reference for the w).15 F(ater)-.1 E .295(sound v)144
-645.6 R .295(elocity structure at the location of the sw)-.15 F .295
-(ath data being analyzed. The tra)-.1 F -.15(ve)-.2 G 2.795(lt).15 G
-.295(ime data will)-2.795 F
-(then be processed and displayed in the manner described belo)144 657.6
-Q 2.5(wf)-.25 G(or the)-2.5 E F1(Repr)2.5 E(ocess)-.18 E F0 -.2(bu)2.5 G
-(tton.).2 E F1(File->Sa)108 674.4 Q .2 -.1(ve S)-.25 H(wath SVP File).1
-E F0 .599(Selecting this menu item sa)144 686.4 R -.15(ve)-.2 G 3.099
-(st).15 G .599(he current editable v)-3.099 F .6
-(elocity pro\214le as a \214le. The SVP \214lename is)-.15 F .938
-(that of the current sw)144 698.4 R .938
-(ath data input \214le with a ".svp" suf)-.1 F .937(\214x added.)-.25 F
-F1(MBv)3.437 E(elocitytool)-.1 E F0 .937(also sets the)3.437 F(sw)144
-710.4 Q .791(ath data \214le')-.1 F(s)-.55 E F1(mbpr)3.291 E(ocess)-.18
-E F0 .791(parameter \214le to recalculate bath)3.291 F .792
-(ymetry using the ne)-.05 F 3.292(wS)-.25 G .792(VP \214le and)-3.292 F
-.226(using the same angle mode setting applied in the interacti)144
-722.4 R .526 -.15(ve m)-.25 H .226(odeling \(see the Angle Mode dialog)
-.15 F(MB-System 5.0)72 768 Q(10 No)132.205 E -.15(ve)-.15 G(mber 2014)
-.15 E(3)190.545 E 0 Cg EP
-%%Page: 4 4
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mb)72 48 Q -.15(ve)-.15 G 127.91
-(locitytool\(1\) MB-System).15 F 127.91(5.0 mb)2.5 F -.15(ve)-.15 G
-(locitytool\(1\)).15 E(description belo)144 84 Q(w\).)-.25 E/F1 10
-/Times-Bold at 0 SF(File->Sa)108 100.8 Q .2 -.1(ve R)-.25 H
-(esiduals As Offsets).1 E F0 .077(Selecting this menu item sa)144 112.8
-R -.15(ve)-.2 G 2.578(st).15 G .078(he current bath)-2.578 F .078
-(ymetry residuals as a "static bath)-.05 F .078(ymetry of)-.05 F .078
-(fset" \214le.)-.25 F .105(The \214lename is that of the current sw)144
-124.8 R .104(ath data input \214le with a ".sbo" suf)-.1 F .104
-(\214x added.)-.25 F F1(MBv)2.604 E(elocitytool)-.1 E F0 .923
-(also sets the sw)144 136.8 R .923(ath data \214le')-.1 F(s)-.55 E F1
-(mbpr)3.423 E(ocess)-.18 E F0 .924
-(parameter \214le to apply these residuals as static correc-)3.423 F
-(tions to the bath)144 148.8 Q(ymetry)-.05 E(.)-.65 E F1(Plot Scaling)
-108 165.6 Q F0(This b)144 177.6 Q(utton brings up a dialog containing t\
-he three controls discussed immediately belo)-.2 E -.65(w.)-.25 G F1
-(Plot Scaling->Maximum Depth)108 194.4 Q F0 .595
-(This slider sets the maximum depth in meters of both the v)144 206.4 R
-.594(elocity pro\214le display and the raypath)-.15 F(display)144 218.4
-Q 3.272(.T)-.65 G .772(he minimum depths of these displays are al)-3.272
-F -.1(wa)-.1 G .772(ys zero. The acrosstrack distance axis of).1 F(the \
-raypath display automatically adjusts so that the rays are plotted with\
- no v)144 230.4 Q(ertical e)-.15 E(xageration.)-.15 E F1
-(Plot Scaling->V)108 247.2 Q(elocity Range)-1 E F0 1.071
-(This slider sets the minimum and maximum v)144 259.2 R 1.071(elocity v)
--.15 F 1.071(alues of the v)-.25 F 1.07(elocity pro\214le display)-.15 F
-6.07(.T)-.65 G(he)-6.07 E .261(minimum v)144 271.2 R .261(alue is the v)
--.25 F .261(elocity center minus the v)-.15 F .261
-(elocity range; the maximum v)-.15 F .262(alue is the v)-.25 F(elocity)
--.15 E(center plus the v)144 283.2 Q(elocity range.)-.15 E F1
-(Plot Scaling->V)108 300 Q(elocity Center)-1 E F0 .26
-(This slider sets the center v)144 312 R .26(elocity v)-.15 F .259
-(alue of the v)-.25 F .259(elocity pro\214le display)-.15 F 5.259(.T)
--.65 G .259(he minimum v)-5.259 F .259(alue is the)-.25 F -.15(ve)144
-324 S .33(locity center minus the v).15 F .331
-(elocity range; the maximum v)-.15 F .331(alue is the v)-.25 F .331
-(elocity center plus the v)-.15 F(eloc-)-.15 E(ity range.)144 336 Q F1
-(Plot Scaling->Residual Range)108 352.8 Q F0 .17
-(This slider sets the minimum and maximum bath)144 364.8 R .17
-(ymetry residual v)-.05 F .17(alues of the bath)-.25 F .17
-(ymetry residual)-.05 F(display)144 376.8 Q 5(.T)-.65 G
-(he residual plot has a minimum v)-5 E
-(alue of \255range and a maximum v)-.25 E(alue of +range.)-.25 E F1
-(Angle Mode)108 393.6 Q F0 .628(This b)144 405.6 R .628
-(utton brings up a dialog containing three choices for ho)-.2 F 3.128
-(wt)-.25 G .628(he starting beam angles are cor)-3.128 F(-)-.2 E 1.458
-(rected during raytracing. The selected angle mode is used by)144 417.6
-R F1(mb)3.957 E -.1(ve)-.15 G(locitytool).1 E F0 1.457(in the interacti)
-3.957 F -.15(ve)-.25 G .094(modeling, and is also passed on to the)144
-429.6 R F1(mbpr)2.594 E(ocess)-.18 E F0 .095
-(parameter \214le created or modi\214ed when an SVP)2.594 F
-(\214le is sa)144 441.6 Q -.15(ve)-.2 G(d.).15 E F1
-(Angle Mode->Do Not Change Beam Angles)108 458.4 Q F0 .011(This b)144
-470.4 R .011(utton sets the angle mode so that the starting beam angles\
- are not corrected before raytracing)-.2 F .393(for the dif)144 482.4 R
-.393(ference between the surf)-.25 F .393(ace sound v)-.1 F .393
-(elocity \(SSV\) and the sound v)-.15 F .394(elocity of the starting)
--.15 F(depth in the SVP)144 494.4 Q(.)-1.11 E F1
-(Angle Mode->Adjust Angles Using Snell')108 511.2 Q 2.5(sL)-.37 G(aw)
--2.5 E F0 .864(This b)144 523.2 R .863(utton sets the angle mode so tha\
-t the starting beam angles are corrected before raytracing,)-.2 F 1.617
-(using Snell')144 535.2 R 4.117(sL)-.55 G -.15(aw)-4.117 G 4.118(,f)-.5
-G 1.618(or the dif)-4.118 F 1.618(ference between the surf)-.25 F 1.618
-(ace sound v)-.1 F 1.618(elocity \(SSV\) and the sound)-.15 F -.15(ve)
-144 547.2 S .139(locity of the starting depth in the SVP).15 F 2.639(.T)
--1.11 G .139(his amounts to an assumption that the original SSV w)-2.639
-F(as)-.1 E 1.588(correct and that)144 559.2 R 1.589(the rays pass throu\
-gh an insigni\214cantly thick layer in which the sound speed)6.588 F
-.197(equals the SSV before transitioning to the sound speed implied by \
-the SVP)144 571.2 R 2.696(.T)-1.11 G .196(his is the def)-2.696 F .196
-(ault set-)-.1 F(ting for raytracing in)144 583.2 Q F1(mb)2.5 E -.1(ve)
--.15 G(locitytool).1 E F0(and in)2.5 E F1(MB-System)2.5 E F0
-(in general.)2.5 E F1(Angle Mode->Adjust Angles Using Sonar Geometry)108
-600 Q F0 .863(This b)144 612 R .863(utton sets the angle mode so that t\
-he starting beam angles are corrected before raytracing,)-.2 F .865
-(using Snell')144 624 R 3.365(sL)-.55 G 1.165 -.15(aw a)-3.365 H .865
-(nd the sonar geometry).15 F 3.365(,f)-.65 G .865(or the dif)-3.365 F
-.865(ference between the surf)-.25 F .865(ace sound v)-.1 F(elocity)-.15
-E .325(\(SSV\) and the sound v)144 636 R .326
-(elocity of the starting depth in the SVP)-.15 F 2.826(.T)-1.11 G .326
-(his option is rele)-2.826 F -.25(va)-.25 G .326(nt to situations).25 F
-.75(where the SSV used by the sonar for beamforming w)144 648 R .75
-(as incorrect, and so the initial angles them-)-.1 F(selv)144 660 Q .286
-(es must be adjusted. This mode is indistinguishable from that of "Adju\
-st Angles Using Snell')-.15 F(s)-.55 E(La)144 672 Q 1.363
-(w" for multibeam sonars with \215at, horizontal recei)-.15 F 1.662 -.15
-(ve a)-.25 H 1.362(rrays, b).15 F 1.362(ut de)-.2 F 1.362
-(viates strongly for sonars)-.25 F(with tilted, V)144 684 Q
-(-shaped, or curv)-1 E(ed recei)-.15 E .3 -.15(ve a)-.25 H(rrays.).15 E
-F1(Repr)108 700.8 Q(ocess)-.18 E F0 .134(Selecting this b)144 712.8 R
-.134(utton causes the sw)-.2 F .135(ath sonar tra)-.1 F -.15(ve)-.2 G
-2.635(lt).15 G .135(ime data to be processed into bath)-2.635 F .135
-(ymetry using)-.05 F 1.816(the current editable v)144 724.8 R 1.816
-(elocity pro\214le. The processing in)-.15 F -.2(vo)-.4 G(lv).2 E 1.816
-(es full raytracing through the w)-.15 F(ater)-.1 E(MB-System 5.0)72 768
-Q(10 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E(4)190.545 E 0 Cg EP
-%%Page: 5 5
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman at 0 SF(mb)72 48 Q -.15(ve)-.15 G 127.91
-(locitytool\(1\) MB-System).15 F 127.91(5.0 mb)2.5 F -.15(ve)-.15 G
-(locitytool\(1\)).15 E -.15(ve)144 84 S .255(locity model. The bath).15
-F .256(ymetry of each ping is \214t with a line, and bath)-.05 F .256
-(ymetry residuals are calcu-)-.05 F .422
-(lated for each good beam relati)144 96 R .721 -.15(ve t)-.25 H 2.921
-(ot).15 G .421(he linear \214t.)-2.921 F .421(The a)5.421 F -.15(ve)-.2
-G .421(rage of the bath).15 F .421(ymetry residuals is dis-)-.05 F .09
-(played in the upper right part of the windo)144 108 R 2.59(wa)-.25 G
-2.59(saf)-2.59 G .09(unction of beam number)-2.59 F 2.59(,a)-.4 G .09
-(long with "error bars")-2.59 F .013(indicating the standard de)144 120
-R .013(viations of the residuals.)-.25 F .012
-(Raypaths are displayed without v)5.012 F .012(ertical e)-.15 F(xager)
--.15 E(-)-.2 E .967(ation in the lo)144 132 R .967
-(wer part of the windo)-.25 F .968
-(w; these represent the \214rst raypath calculated for each beam)-.25 F
-.155(while processing the current data \(most will be from the \214rst \
-ping\). Anomalously shallo)144 144 R 2.655(wb)-.25 G(ath)-2.655 E(ym-)
--.05 E .07(etry maps into ne)144 156 R -.05(ga)-.15 G(ti).05 E .37 -.15
-(ve r)-.25 H .071(esiduals and deep bath).15 F .071(ymetry into positi)
--.05 F .371 -.15(ve r)-.25 H .071(esiduals; the residuals are dis-).15 F
-.126(played so that shallo)144 168 R 2.626(wi)-.25 G 2.626(su)-2.626 G
-2.625(pa)-2.626 G .125(nd deep is do)-2.625 F 2.625(wn. If)-.25 F .125
-(the sea\215oor is reasonably smooth so that a linear)2.625 F 1.116
-(\214t is appropriate, then the residuals will accurately re\215ect an)
-144 180 R 3.617(yp)-.15 G 1.117(roblems with the w)-3.617 F 1.117
-(ater v)-.1 F(elocity)-.15 E 3.492(pro\214le. If)144 192 R .992(the w)
-3.492 F .992(ater v)-.1 F .992(elocity pro\214le is correct, then the r\
-esidual plot will be roughly \215at.)-.15 F .991(If the)5.991 F -.1(wa)
-144 204 S .696(ter v).1 F .696
-(elocity pro\214le is signi\214cantly in error)-.15 F 3.196(,t)-.4 G
-.697(hen the outer beam depths may anomalously shal-)-3.196 F(lo)144 216
-Q 3.53(w\()-.25 G 1.03(edge curl up\) or deep \(edge curl do)-3.53 F
-3.529(wn\). In)-.25 F 1.029(practice, the editable v)3.529 F 1.029
-(elocity pro\214le is altered)-.15 F(interacti)144 228 Q -.15(ve)-.25 G
-1.372(ly until a reasonably residual pattern is achie).15 F -.15(ve)-.25
-G 1.372(d; reference v).15 F 1.372(elocity pro\214les obtained)-.15 F
-.089(from CTD casts, XBT')144 240 R .089
-(s, or data bases \(see manual page for program)-.55 F/F1 10
-/Times-Bold at 0 SF(mble)2.589 E(vitus)-.15 E F0 2.589(\)m)C .088
-(ay be read in as)-2.589 F
-(display pro\214les to guide the editing process.)144 252 Q F1(Quit)108
-268.8 Q F0 .046(This b)16.55 F .046(utton causes the program to e)-.2 F
-.047(xit gracefully)-.15 F 2.547(,b)-.65 G .047(ut without asking an)
--2.747 F 2.547(yq)-.15 G 2.547(uestions. If)-2.547 F .047(you ha)2.547 F
--.15(ve)-.2 G(n').15 E(t)-.18 E(already sa)144 280.8 Q -.15(ve)-.2 G 2.5
-(dy).15 G(our edited v)-2.5 E
-(elocity pro\214le it will be lost when you quit.)-.15 E/F2 10.95
-/Times-Bold at 0 SF(SEE ALSO)72 309.6 Q F1(mbsystem)108 321.6 Q F0(\(1\),)A
-F1(mbpr)2.5 E(ocess)-.18 E F0(\(1\),)A F1(mbset)2.5 E F0(,)A F1
-(mbsvplist)2.5 E F0(,)A F1(mb)2.5 E(bath)-.1 E F0(,)A F1(mble)2.5 E
-(vitus)-.15 E F0(\(1\),)A F1(mbm_xbt)2.5 E F0(\(1\),)A F1(mbm_xbt)2.5 E
-F0(\(1\))A F2 -.11(BU)72 350.4 S(GS).11 E F0 .518(Users cannot remo)108
-362.4 R .818 -.15(ve d)-.15 H .518(isplay sound v).15 F .518
-(elocity pro\214les from the screen once the)-.15 F 3.017(ya)-.15 G .517
-(re read in. The main win-)-3.017 F(do)108 374.4 Q 2.5(wf)-.25 G(or mb)
--2.5 E -.15(ve)-.15 G(locitytool is too lar).15 E
-(ge for use on screens smaller than 1024 X 768 pix)-.18 E(els.)-.15 E
-(MB-System 5.0)72 768 Q(10 No)132.205 E -.15(ve)-.15 G(mber 2014).15 E
-(5)190.545 E 0 Cg EP
-%%Trailer
-end
-%%EOF
diff --git a/src/share/LevitusAnnual82.dat b/src/share/LevitusAnnual82.dat
deleted file mode 100644
index d578be7..0000000
Binary files a/src/share/LevitusAnnual82.dat and /dev/null differ
diff --git a/src/share/Makefile.am b/src/share/Makefile.am
deleted file mode 100644
index aa1592b..0000000
--- a/src/share/Makefile.am
+++ /dev/null
@@ -1 +0,0 @@
-dist_mbsystemdata_DATA =  Projections.dat LevitusAnnual82.dat
diff --git a/src/share/Makefile.in b/src/share/Makefile.in
deleted file mode 100644
index a05cbb6..0000000
--- a/src/share/Makefile.in
+++ /dev/null
@@ -1,517 +0,0 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
-
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-
-VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
-am__make_running_with_option = \
-  case $${target_option-} in \
-      ?) ;; \
-      *) echo "am__make_running_with_option: internal error: invalid" \
-              "target option '$${target_option-}' specified" >&2; \
-         exit 1;; \
-  esac; \
-  has_opt=no; \
-  sane_makeflags=$$MAKEFLAGS; \
-  if $(am__is_gnu_make); then \
-    sane_makeflags=$$MFLAGS; \
-  else \
-    case $$MAKEFLAGS in \
-      *\\[\ \	]*) \
-        bs=\\; \
-        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
-          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
-    esac; \
-  fi; \
-  skip_next=no; \
-  strip_trailopt () \
-  { \
-    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
-  }; \
-  for flg in $$sane_makeflags; do \
-    test $$skip_next = yes && { skip_next=no; continue; }; \
-    case $$flg in \
-      *=*|--*) continue;; \
-        -*I) strip_trailopt 'I'; skip_next=yes;; \
-      -*I?*) strip_trailopt 'I';; \
-        -*O) strip_trailopt 'O'; skip_next=yes;; \
-      -*O?*) strip_trailopt 'O';; \
-        -*l) strip_trailopt 'l'; skip_next=yes;; \
-      -*l?*) strip_trailopt 'l';; \
-      -[dEDm]) skip_next=yes;; \
-      -[JT]) skip_next=yes;; \
-    esac; \
-    case $$flg in \
-      *$$target_option*) has_opt=yes; break;; \
-    esac; \
-  done; \
-  test $$has_opt = yes
-am__make_dryrun = (target_option=n; $(am__make_running_with_option))
-am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-subdir = src/share
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(dist_mbsystemdata_DATA)
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
-	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
-	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
-	$(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-	$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/src/mbio/mb_config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-AM_V_P = $(am__v_P_ at AM_V@)
-am__v_P_ = $(am__v_P_ at AM_DEFAULT_V@)
-am__v_P_0 = false
-am__v_P_1 = :
-AM_V_GEN = $(am__v_GEN_ at AM_V@)
-am__v_GEN_ = $(am__v_GEN_ at AM_DEFAULT_V@)
-am__v_GEN_0 = @echo "  GEN     " $@;
-am__v_GEN_1 = 
-AM_V_at = $(am__v_at_ at AM_V@)
-am__v_at_ = $(am__v_at_ at AM_DEFAULT_V@)
-am__v_at_0 = @
-am__v_at_1 = 
-SOURCES =
-DIST_SOURCES =
-am__can_run_installinfo = \
-  case $$AM_UPDATE_INFO_DIR in \
-    n|no|NO) false;; \
-    *) (install-info --version) >/dev/null 2>&1;; \
-  esac
-am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
-am__vpath_adj = case $$p in \
-    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
-    *) f=$$p;; \
-  esac;
-am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
-am__install_max = 40
-am__nobase_strip_setup = \
-  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
-am__nobase_strip = \
-  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
-am__nobase_list = $(am__nobase_strip_setup); \
-  for p in $$list; do echo "$$p $$p"; done | \
-  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
-  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
-    if (++n[$$2] == $(am__install_max)) \
-      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
-    END { for (dir in files) print dir, files[dir] }'
-am__base_list = \
-  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
-  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
-am__uninstall_files_from_dir = { \
-  test -z "$$files" \
-    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
-    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
-         $(am__cd) "$$dir" && rm -f $$files; }; \
-  }
-am__installdirs = "$(DESTDIR)$(mbsystemdatadir)"
-DATA = $(dist_mbsystemdata_DATA)
-am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-CC = @CC@
-CCAS = @CCAS@
-CCASDEPMODE = @CCASDEPMODE@
-CCASFLAGS = @CCASFLAGS@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DLLTOOL = @DLLTOOL@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GREP = @GREP@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBM = @LIBM@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIBTOOL_DEPS = @LIBTOOL_DEPS@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LTLIBOBJS = @LTLIBOBJS@
-LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
-MAINT = @MAINT@
-MAKEINFO = @MAKEINFO@
-MANIFEST_TOOL = @MANIFEST_TOOL@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-OTPS_DIR = @OTPS_DIR@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_URL = @PACKAGE_URL@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PKG_CONFIG = @PKG_CONFIG@
-PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
-PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-VERSION = @VERSION@
-XDR_LIB = @XDR_LIB@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_AR = @ac_ct_AR@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-fftw_app = @fftw_app@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libGLU_CFLAGS = @libGLU_CFLAGS@
-libGLU_LIBS = @libGLU_LIBS@
-libXm_CFLAGS = @libXm_CFLAGS@
-libXm_LIBS = @libXm_LIBS@
-libdir = @libdir@
-libexecdir = @libexecdir@
-libfftw3_CFLAGS = @libfftw3_CFLAGS@
-libfftw3_LIBS = @libfftw3_LIBS@
-libfftw_CPPFLAGS = @libfftw_CPPFLAGS@
-libfftw_LIBS = @libfftw_LIBS@
-libgmt_CFLAGS = @libgmt_CFLAGS@
-libgmt_CPPFLAGS = @libgmt_CPPFLAGS@
-libgmt_LIBS = @libgmt_LIBS@
-libmotif_CPPFLAGS = @libmotif_CPPFLAGS@
-libmotif_LIBS = @libmotif_LIBS@
-libnetcdf_CFLAGS = @libnetcdf_CFLAGS@
-libnetcdf_CPPFLAGS = @libnetcdf_CPPFLAGS@
-libnetcdf_LIBS = @libnetcdf_LIBS@
-libopengl_CPPFLAGS = @libopengl_CPPFLAGS@
-libopengl_LIBS = @libopengl_LIBS@
-libproj_CFLAGS = @libproj_CFLAGS@
-libproj_CPPFLAGS = @libproj_CPPFLAGS@
-libproj_LIBS = @libproj_LIBS@
-libpsl_CFLAGS = @libpsl_CFLAGS@
-libpsl_LIBS = @libpsl_LIBS@
-localedir = @localedir@
-localstatedir = @localstatedir@
-mandir = @mandir@
-mbsystemdatadir = @mbsystemdatadir@
-mbsystemhtmldir = @mbsystemhtmldir@
-mbsystempsdir = @mbsystempsdir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-dist_mbsystemdata_DATA = Projections.dat LevitusAnnual82.dat
-all: all-am
-
-.SUFFIXES:
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
-	@for dep in $?; do \
-	  case '$(am__configure_deps)' in \
-	    *$$dep*) \
-	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-	        && { if test -f $@; then exit 0; else break; fi; }; \
-	      exit 1;; \
-	  esac; \
-	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/share/Makefile'; \
-	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --gnu src/share/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	@case '$?' in \
-	  *config.status*) \
-	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-	esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-
-mostlyclean-libtool:
-	-rm -f *.lo
-
-clean-libtool:
-	-rm -rf .libs _libs
-install-dist_mbsystemdataDATA: $(dist_mbsystemdata_DATA)
-	@$(NORMAL_INSTALL)
-	@list='$(dist_mbsystemdata_DATA)'; test -n "$(mbsystemdatadir)" || list=; \
-	if test -n "$$list"; then \
-	  echo " $(MKDIR_P) '$(DESTDIR)$(mbsystemdatadir)'"; \
-	  $(MKDIR_P) "$(DESTDIR)$(mbsystemdatadir)" || exit 1; \
-	fi; \
-	for p in $$list; do \
-	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
-	  echo "$$d$$p"; \
-	done | $(am__base_list) | \
-	while read files; do \
-	  echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(mbsystemdatadir)'"; \
-	  $(INSTALL_DATA) $$files "$(DESTDIR)$(mbsystemdatadir)" || exit $$?; \
-	done
-
-uninstall-dist_mbsystemdataDATA:
-	@$(NORMAL_UNINSTALL)
-	@list='$(dist_mbsystemdata_DATA)'; test -n "$(mbsystemdatadir)" || list=; \
-	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
-	dir='$(DESTDIR)$(mbsystemdatadir)'; $(am__uninstall_files_from_dir)
-tags TAGS:
-
-ctags CTAGS:
-
-cscope cscopelist:
-
-
-distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	list='$(DISTFILES)'; \
-	  dist_files=`for file in $$list; do echo $$file; done | \
-	  sed -e "s|^$$srcdirstrip/||;t" \
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
-	case $$dist_files in \
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
-			   sort -u` ;; \
-	esac; \
-	for file in $$dist_files; do \
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  if test -d $$d/$$file; then \
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
-	    if test -d "$(distdir)/$$file"; then \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
-	  else \
-	    test -f "$(distdir)/$$file" \
-	    || cp -p $$d/$$file "$(distdir)/$$file" \
-	    || exit 1; \
-	  fi; \
-	done
-check-am: all-am
-check: check-am
-all-am: Makefile $(DATA)
-installdirs:
-	for dir in "$(DESTDIR)$(mbsystemdatadir)"; do \
-	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
-	done
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
-	if test -z '$(STRIP)'; then \
-	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	      install; \
-	else \
-	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
-	fi
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
-	@echo "This command is intended for maintainers to use"
-	@echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-generic clean-libtool mostlyclean-am
-
-distclean: distclean-am
-	-rm -f Makefile
-distclean-am: clean-am distclean-generic
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am: install-dist_mbsystemdataDATA
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am:
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
-	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-generic mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am: uninstall-dist_mbsystemdataDATA
-
-.MAKE: install-am install-strip
-
-.PHONY: all all-am check check-am clean clean-generic clean-libtool \
-	cscopelist-am ctags-am distclean distclean-generic \
-	distclean-libtool distdir dvi dvi-am html html-am info info-am \
-	install install-am install-data install-data-am \
-	install-dist_mbsystemdataDATA install-dvi install-dvi-am \
-	install-exec install-exec-am install-html install-html-am \
-	install-info install-info-am install-man install-pdf \
-	install-pdf-am install-ps install-ps-am install-strip \
-	installcheck installcheck-am installdirs maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-generic \
-	mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \
-	uninstall-am uninstall-dist_mbsystemdataDATA
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/share/Projections.dat b/src/share/Projections.dat
deleted file mode 100644
index b37eb3c..0000000
--- a/src/share/Projections.dat
+++ /dev/null
@@ -1,17373 +0,0 @@
-#######################################################################
-#    The MB-system:	Projections.dat		9/19/2002
-#    $ID: $
-#
-#    Copyright (c) 2002-2014 by
-#    David W. Caress (caress at mbari.org)
-#      Monterey Bay Aquarium Research Institute
-#      Moss Landing, CA 95039
-#    and Dale N. Chayes (dale at ldeo.columbia.edu)
-#      Lamont-Doherty Earth Observatory
-#      Palisades, NY 10964
-#
-#    See README file for copying and redistribution conditions.
-#
-#######################################################################
-#
-# Projection database for MB-system at the share directory level
-# Author:	D. W. Caress
-# Date:		September 13, 2002
-#
-# $Log: Projections.dat,v $
-# Revision 5.3  2008/11/16 21:51:17  caress
-# Updating all recent changes, including time lag analysis using mbeditviz and improvements to the mbgrid footprint gridding algorithm.
-#
-# Revision 5.2  2008/05/26 04:43:15  caress
-# Getting ready for release 5.1.1beta19.
-#
-# Revision 5.1  2002/11/13 00:49:57  caress
-# Reformatted to make extracting comments easier.
-#
-# Revision 5.0  2002/09/19 00:54:21  caress
-# Release 5.0.beta23
-#
-#
-# Notes:
-#
-#   This file contains definitions of projections and projected
-#   coordinate systems in the format used by the PROJ4 package
-#   and the PROJ4 library. The PROJ4 source code was originally obtained
-#   from http://www.remotesensing.org/ in September 2002. Most
-#   recently version 4.8.0 was obtained from http://trac.osgeo.org/proj/
-#
-#   The proj library source code has been incorporated unchanged
-#   into the MB-System package.
-#
-#   The projection definitions listed below also derive from the
-#   PROJ4 distribution, but have been reformatted from several
-#   different files. In particular, projections derived from the
-#   "epsg" file in the PROJ.4 distribution are prefixed with "epsg"
-#   and those from the "esri" file are prefixed with "esri".
-#   For instance, the projection identified by <4314> in the PROJ.4
-#   epsg file is identified here as <epsg4314>.
-#
-#######################################################################
-#
-# General default values from proj/nad/proj_def.dat
-
-# <general> General default ellipsoid WGS84
-<general> ellps=WGS84 <>
-
-# <aea> # Conterminous U.S. map
-<aea> lat_1=29.5 lat_2=45.5 <>
-
-# <lcc> Conterminous U.S. map
-<lcc> lat_1=33 lat_2=45 <>
-
-# <lagrng>
-<lagrng> W=2 <>
-
-#
-##########################################################
-#
-#     Standard Universal Transverse Mercator (UTM)
-#     and Universal Polar Stereographic (UPS)
-#     projected coordinate systems for MB-System
-#
-
-# <UTM01N> WGS 84 / UTM zone 1N
-<UTM01N> +proj=utm +zone=1 +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UTM02N> WGS 84 / UTM zone 2N
-<UTM02N> +proj=utm +zone=2 +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UTM03N> WGS 84 / UTM zone 3N
-<UTM03N> +proj=utm +zone=3 +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UTM04N> WGS 84 / UTM zone 4N
-<UTM04N> +proj=utm +zone=4 +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UTM05N> WGS 84 / UTM zone 5N
-<UTM05N> +proj=utm +zone=5 +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UTM06N> WGS 84 / UTM zone 6N
-<UTM06N> +proj=utm +zone=6 +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UTM07N> WGS 84 / UTM zone 7N
-<UTM07N> +proj=utm +zone=7 +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UTM08N> WGS 84 / UTM zone 8N
-<UTM08N> +proj=utm +zone=8 +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UTM09N> WGS 84 / UTM zone 9N
-<UTM09N> +proj=utm +zone=9 +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UTM10N> WGS 84 / UTM zone 10N
-<UTM10N> +proj=utm +zone=10 +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UTM11N> WGS 84 / UTM zone 11N
-<UTM11N> +proj=utm +zone=11 +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UTM12N> WGS 84 / UTM zone 12N
-<UTM12N> +proj=utm +zone=12 +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UTM13N> WGS 84 / UTM zone 13N
-<UTM13N> +proj=utm +zone=13 +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UTM14N> WGS 84 / UTM zone 14N
-<UTM14N> +proj=utm +zone=14 +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UTM15N> WGS 84 / UTM zone 15N
-<UTM15N> +proj=utm +zone=15 +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UTM16N> WGS 84 / UTM zone 16N
-<UTM16N> +proj=utm +zone=16 +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UTM17N> WGS 84 / UTM zone 17N
-<UTM17N> +proj=utm +zone=17 +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UTM18N> WGS 84 / UTM zone 18N
-<UTM18N> +proj=utm +zone=18 +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UTM19N> WGS 84 / UTM zone 19N
-<UTM19N> +proj=utm +zone=19 +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UTM20N> WGS 84 / UTM zone 20N
-<UTM20N> +proj=utm +zone=20 +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UTM21N> WGS 84 / UTM zone 21N
-<UTM21N> +proj=utm +zone=21 +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UTM22N> WGS 84 / UTM zone 22N
-<UTM22N> +proj=utm +zone=22 +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UTM23N> WGS 84 / UTM zone 23N
-<UTM23N> +proj=utm +zone=23 +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UTM24N> WGS 84 / UTM zone 24N
-<UTM24N> +proj=utm +zone=24 +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UTM25N> WGS 84 / UTM zone 25N
-<UTM25N> +proj=utm +zone=25 +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UTM26N> WGS 84 / UTM zone 26N
-<UTM26N> +proj=utm +zone=26 +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UTM27N> WGS 84 / UTM zone 27N
-<UTM27N> +proj=utm +zone=27 +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UTM28N> WGS 84 / UTM zone 28N
-<UTM28N> +proj=utm +zone=28 +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UTM29N> WGS 84 / UTM zone 29N
-<UTM29N> +proj=utm +zone=29 +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UTM30N> WGS 84 / UTM zone 30N
-<UTM30N> +proj=utm +zone=30 +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UTM31N> WGS 84 / UTM zone 31N
-<UTM31N> +proj=utm +zone=31 +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UTM32N> WGS 84 / UTM zone 32N
-<UTM32N> +proj=utm +zone=32 +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UTM33N> WGS 84 / UTM zone 33N
-<UTM33N> +proj=utm +zone=33 +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UTM34N> WGS 84 / UTM zone 34N
-<UTM34N> +proj=utm +zone=34 +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UTM35N> WGS 84 / UTM zone 35N
-<UTM35N> +proj=utm +zone=35 +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UTM36N> WGS 84 / UTM zone 36N
-<UTM36N> +proj=utm +zone=36 +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UTM37N> WGS 84 / UTM zone 37N
-<UTM37N> +proj=utm +zone=37 +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UTM38N> WGS 84 / UTM zone 38N
-<UTM38N> +proj=utm +zone=38 +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UTM39N> WGS 84 / UTM zone 39N
-<UTM39N> +proj=utm +zone=39 +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UTM40N> WGS 84 / UTM zone 40N
-<UTM40N> +proj=utm +zone=40 +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UTM41N> WGS 84 / UTM zone 41N
-<UTM41N> +proj=utm +zone=41 +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UTM42N> WGS 84 / UTM zone 42N
-<UTM42N> +proj=utm +zone=42 +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UTM43N> WGS 84 / UTM zone 43N
-<UTM43N> +proj=utm +zone=43 +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UTM44N> WGS 84 / UTM zone 44N
-<UTM44N> +proj=utm +zone=44 +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UTM45N> WGS 84 / UTM zone 45N
-<UTM45N> +proj=utm +zone=45 +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UTM46N> WGS 84 / UTM zone 46N
-<UTM46N> +proj=utm +zone=46 +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UTM47N> WGS 84 / UTM zone 47N
-<UTM47N> +proj=utm +zone=47 +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UTM48N> WGS 84 / UTM zone 48N
-<UTM48N> +proj=utm +zone=48 +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UTM49N> WGS 84 / UTM zone 49N
-<UTM49N> +proj=utm +zone=49 +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UTM50N> WGS 84 / UTM zone 50N
-<UTM50N> +proj=utm +zone=50 +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UTM51N> WGS 84 / UTM zone 51N
-<UTM51N> +proj=utm +zone=51 +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UTM52N> WGS 84 / UTM zone 52N
-<UTM52N> +proj=utm +zone=52 +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UTM53N> WGS 84 / UTM zone 53N
-<UTM53N> +proj=utm +zone=53 +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UTM54N> WGS 84 / UTM zone 54N
-<UTM54N> +proj=utm +zone=54 +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UTM55N> WGS 84 / UTM zone 55N
-<UTM55N> +proj=utm +zone=55 +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UTM56N> WGS 84 / UTM zone 56N
-<UTM56N> +proj=utm +zone=56 +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UTM57N> WGS 84 / UTM zone 57N
-<UTM57N> +proj=utm +zone=57 +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UTM58N> WGS 84 / UTM zone 58N
-<UTM58N> +proj=utm +zone=58 +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UTM59N> WGS 84 / UTM zone 59N
-<UTM59N> +proj=utm +zone=59 +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UTM60N> WGS 84 / UTM zone 60N
-<UTM60N> +proj=utm +zone=60 +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UTM01S> WGS 84 / UTM zone 1S
-<UTM01S> +proj=utm +zone=1 +south +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UTM02S> WGS 84 / UTM zone 2S
-<UTM02S> +proj=utm +zone=2 +south +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UTM03S> WGS 84 / UTM zone 3S
-<UTM03S> +proj=utm +zone=3 +south +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UTM04S> WGS 84 / UTM zone 4S
-<UTM04S> +proj=utm +zone=4 +south +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UTM05S> WGS 84 / UTM zone 5S
-<UTM05S> +proj=utm +zone=5 +south +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UTM06S> WGS 84 / UTM zone 6S
-<UTM06S> +proj=utm +zone=6 +south +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UTM07S> WGS 84 / UTM zone 7S
-<UTM07S> +proj=utm +zone=7 +south +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UTM08S> WGS 84 / UTM zone 8S
-<UTM08S> +proj=utm +zone=8 +south +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UTM09S> WGS 84 / UTM zone 9S
-<UTM09S> +proj=utm +zone=9 +south +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UTM10S> WGS 84 / UTM zone 10S
-<UTM10S> +proj=utm +zone=10 +south +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UTM11S> WGS 84 / UTM zone 11S
-<UTM11S> +proj=utm +zone=11 +south +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UTM12S> WGS 84 / UTM zone 12S
-<UTM12S> +proj=utm +zone=12 +south +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UTM13S> WGS 84 / UTM zone 13S
-<UTM13S> +proj=utm +zone=13 +south +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UTM14S> WGS 84 / UTM zone 14S
-<UTM14S> +proj=utm +zone=14 +south +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UTM15S> WGS 84 / UTM zone 15S
-<UTM15S> +proj=utm +zone=15 +south +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UTM16S> WGS 84 / UTM zone 16S
-<UTM16S> +proj=utm +zone=16 +south +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UTM17S> WGS 84 / UTM zone 17S
-<UTM17S> +proj=utm +zone=17 +south +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UTM18S> WGS 84 / UTM zone 18S
-<UTM18S> +proj=utm +zone=18 +south +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UTM19S> WGS 84 / UTM zone 19S
-<UTM19S> +proj=utm +zone=19 +south +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UTM20S> WGS 84 / UTM zone 20S
-<UTM20S> +proj=utm +zone=20 +south +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UTM21S> WGS 84 / UTM zone 21S
-<UTM21S> +proj=utm +zone=21 +south +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UTM22S> WGS 84 / UTM zone 22S
-<UTM22S> +proj=utm +zone=22 +south +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UTM23S> WGS 84 / UTM zone 23S
-<UTM23S> +proj=utm +zone=23 +south +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UTM24S> WGS 84 / UTM zone 24S
-<UTM24S> +proj=utm +zone=24 +south +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UTM25S> WGS 84 / UTM zone 25S
-<UTM25S> +proj=utm +zone=25 +south +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UTM26S> WGS 84 / UTM zone 26S
-<UTM26S> +proj=utm +zone=26 +south +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UTM27S> WGS 84 / UTM zone 27S
-<UTM27S> +proj=utm +zone=27 +south +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UTM28S> WGS 84 / UTM zone 28S
-<UTM28S> +proj=utm +zone=28 +south +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UTM29S> WGS 84 / UTM zone 29S
-<UTM29S> +proj=utm +zone=29 +south +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UTM30S> WGS 84 / UTM zone 30S
-<UTM30S> +proj=utm +zone=30 +south +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UTM31S> WGS 84 / UTM zone 31S
-<UTM31S> +proj=utm +zone=31 +south +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UTM32S> WGS 84 / UTM zone 32S
-<UTM32S> +proj=utm +zone=32 +south +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UTM33S> WGS 84 / UTM zone 33S
-<UTM33S> +proj=utm +zone=33 +south +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UTM34S> WGS 84 / UTM zone 34S
-<UTM34S> +proj=utm +zone=34 +south +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UTM35S> WGS 84 / UTM zone 35S
-<UTM35S> +proj=utm +zone=35 +south +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UTM36S> WGS 84 / UTM zone 36S
-<UTM36S> +proj=utm +zone=36 +south +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UTM37S> WGS 84 / UTM zone 37S
-<UTM37S> +proj=utm +zone=37 +south +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UTM38S> WGS 84 / UTM zone 38S
-<UTM38S> +proj=utm +zone=38 +south +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UTM39S> WGS 84 / UTM zone 39S
-<UTM39S> +proj=utm +zone=39 +south +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UTM40S> WGS 84 / UTM zone 40S
-<UTM40S> +proj=utm +zone=40 +south +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UTM41S> WGS 84 / UTM zone 41S
-<UTM41S> +proj=utm +zone=41 +south +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UTM42S> WGS 84 / UTM zone 42S
-<UTM42S> +proj=utm +zone=42 +south +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UTM43S> WGS 84 / UTM zone 43S
-<UTM43S> +proj=utm +zone=43 +south +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UTM44S> WGS 84 / UTM zone 44S
-<UTM44S> +proj=utm +zone=44 +south +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UTM45S> WGS 84 / UTM zone 45S
-<UTM45S> +proj=utm +zone=45 +south +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UTM46S> WGS 84 / UTM zone 46S
-<UTM46S> +proj=utm +zone=46 +south +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UTM47S> WGS 84 / UTM zone 47S
-<UTM47S> +proj=utm +zone=47 +south +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UTM48S> WGS 84 / UTM zone 48S
-<UTM48S> +proj=utm +zone=48 +south +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UTM49S> WGS 84 / UTM zone 49S
-<UTM49S> +proj=utm +zone=49 +south +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UTM50S> WGS 84 / UTM zone 50S
-<UTM50S> +proj=utm +zone=50 +south +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UTM51S> WGS 84 / UTM zone 51S
-<UTM51S> +proj=utm +zone=51 +south +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UTM52S> WGS 84 / UTM zone 52S
-<UTM52S> +proj=utm +zone=52 +south +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UTM53S> WGS 84 / UTM zone 53S
-<UTM53S> +proj=utm +zone=53 +south +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UTM54S> WGS 84 / UTM zone 54S
-<UTM54S> +proj=utm +zone=54 +south +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UTM55S> WGS 84 / UTM zone 55S
-<UTM55S> +proj=utm +zone=55 +south +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UTM56S> WGS 84 / UTM zone 56S
-<UTM56S> +proj=utm +zone=56 +south +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UTM57S> WGS 84 / UTM zone 57S
-<UTM57S> +proj=utm +zone=57 +south +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UTM58S> WGS 84 / UTM zone 58S
-<UTM58S> +proj=utm +zone=58 +south +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UTM59S> WGS 84 / UTM zone 59S
-<UTM59S> +proj=utm +zone=59 +south +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UTM60S> WGS 84 / UTM zone 60S
-<UTM60S> +proj=utm +zone=60 +south +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UPSN> WGS 84 / UPS North
-<UPSN> +proj=stere +lat_0=90.000000000 +lon_0=0.000000000 +x_0=2000000.000 +y_0=2000000.000 +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-
-# <UPSS> WGS 84 / UPS South
-<UPSS> +proj=stere +lat_0=-90.000000000 +lon_0=0.000000000 +x_0=2000000.000 +y_0=2000000.000 +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-#
-#
-##########################################################
-# Listing of State Plane North American Datum Zones
-#
-#   MB-System projection ids are the zone number
-#   prefixed by either "nad27sp" or "nad83sp"
-#
-# ----------------------------------------------
-#                                NGS zone number
-# State and zone                  1927     1983
-# ----------------------------------------------
-# Alabama east ..................  101      101
-# Alabama west ..................  102      102
-# Alaska zone no. 1 ............. 5001     5001
-# Alaska zone no. 2 ............. 5002     5002
-# Alaska zone no. 3 ............. 5003     5003
-# Alaska zone no. 4 ............. 5004     5004
-# Alaska zone no. 5 ............. 5005     5005
-# Alaska zone no. 6 ............. 5006     5006
-# Alaska zone no. 7 ............. 5007     5007
-# Alaska zone no. 8 ............. 5008     5008
-# Alaska zone no. 9 ............. 5009     5009
-# Alaska zone no. 10 ............ 5010     5010
-# American Samoa ................ 5300
-# Arizona central ...............  202      202
-# Arizona east ..................  201      201
-# Arizona west ..................  203      203
-# Arkansas north ................  301      301
-# Arkansas south ................  302      302
-# California I ..................  401      401
-# California II .................  402      402
-# California III ................  403      403
-# California IV .................  404      404
-# California V ..................  405      405
-# California VI .................  406      406
-# California VII ................  407
-# Colorado central ..............  502      502
-# Colorado north ................  501      501
-# Colorado south ................  503      503
-# Connecticut ...................  600      600
-# Delaware ......................  700      700
-# Florida east ..................  901      901
-# Florida north .................  903      903
-# Florida west ..................  902      902
-# Georgia east .................. 1001     1001
-# Georgia west .................. 1002     1002
-# Guam Island ................... 5400
-# Hawaii 1 ...................... 5101     5101
-# Hawaii 2 ...................... 5102     5102
-# Hawaii 3 ...................... 5103     5103
-# Hawaii 4 ...................... 5104     5104
-# Hawaii 5 ...................... 5105     5105
-# Idaho central ................. 1102     1102
-# Idaho east .................... 1101     1101
-# Idaho west .................... 1103     1103
-# Illinois east ................. 1201     1201
-# Illinois west ................. 1202     1202
-# Indiana east .................. 1301     1301
-# Indiana west .................. 1302     1302
-# Iowa north .................... 1401     1401
-# Iowa south .................... 1402     1402
-# Kansas north .................. 1501     1501
-# Kansas south .................. 1502     1502
-# Kentucky north ................ 1601     1601
-# Kentucky south ................ 1602     1602
-# Louisiana north ............... 1701     1701
-# Louisiana offshore ............ 1703     1703
-# Louisiana south ............... 1702     1702
-# Maine east .................... 1801     1801
-# Maine west .................... 1802     1802
-# Maryland ...................... 1900     1900
-# Massachusetts island .......... 2002     2002
-# Massachusetts mainland ........ 2001     2001
-# Michigan central/l ............ 2112     2112 current
-# Michigan central/m ............ 2102          old
-# Michigan east ................. 2101          old
-# Michigan north ................ 2111     2111 current
-# Michigan south ................ 2113     2113 current
-# Michigan west ................. 2103          old
-# Minnesota central ............. 2202     2202
-# Minnesota north ............... 2201     2201
-# Minnesota south ............... 2203     2203
-# Mississippi east .............. 2301     2301
-# Mississippi west .............. 2302     2302
-# Missouri central .............. 2402     2402
-# Missouri east ................. 2401     2401
-# Missouri west ................. 2403     2403
-# Montana .......................          2500
-# Montana central ............... 2502
-# Montana north ................. 2501
-# Montana south ................. 2503
-# Nebraska ......................          2600
-# Nebraska north ................ 2601
-# Nebraska south ................ 2602
-# Nevada central ................ 2702     2702
-# Nevada east ................... 2701     2701
-# Nevada west ................... 2703     2703
-# New hampshire ................. 2800     2800
-# New jersey .................... 2900     2900
-# New mexico central ............ 3002     3002
-# New mexico east ............... 3001     3001
-# New mexico west ............... 3003     3003
-# New york central .............. 3102     3102
-# New york east ................. 3101     3101
-# New york long island .......... 3104     3104
-# New york west ................. 3103     3103
-# North carolina ................ 3200     3200
-# North dakota north ............ 3301     3301
-# North dakota south ............ 3302     3302
-# Ohio north .................... 3401     3401
-# Ohio south .................... 3402     3402
-# Oklahoma north ................ 3501     3501
-# Oklahoma south ................ 3502     3502
-# Oregon north .................. 3601     3601
-# Oregon south .................. 3602     3602
-# Pennsylvania north ............ 3701     3701
-# Pennsylvania south ............ 3702     3702
-# Puerto Rico, Virgin Islands ... 5201     5200
-# Rhode Island .................. 3800     3800
-# South Carolina ................          3900
-# South Carolina north .......... 3901
-# South Carolina south .......... 3902
-# South Dakota north ............ 4001     4001
-# South Dakota south ............ 4002     4002
-# Tennessee ..................... 4100     4100
-# Texas central ................. 4203     4203
-# Texas north ................... 4201     4201
-# Texas north central ........... 4202     4202
-# Texas south ................... 4205     4205
-# Texas south central ........... 4204     4204
-# Utah central .................. 4302     4302
-# Utah north .................... 4301     4301
-# Utah south .................... 4303     4303
-# Vermont ....................... 4400     4400
-# Virgin Islands, St. Croix ..... 5202
-# Virginia north ................ 4501     4501
-# Virginia south ................ 4502     4502
-# Washington north .............. 4601     4601
-# Washington south .............. 4602     4602
-# West Virginia north ........... 4701     4701
-# West Virginia south ........... 4702     4702
-# Wisconsin central ............. 4802     4802
-# Wisconsin north ............... 4801     4801
-# Wisconsin south ............... 4803     4803
-# Wyoming east .................. 4901     4901
-# Wyoming east central .......... 4902     4902
-# Wyoming west .................. 4904     4904
-# Wyoming west central .......... 4903     4903
-# ----------------------------------------------
-#
-##########################################################
-#
-#     State Plane Coordinate Systems
-#     North American Datum 1927
-
-
-# <nad27sp101> alabama east : nad27sp
-<nad27sp101> proj=tmerc  datum=NAD27
-lon_0=-85d50 lat_0=30d30 k=.99996
-x_0=152400.3048006096 y_0=0
-no_defs <>
-
-# <nad27sp102> alabama west : nad27sp
-<nad27sp102> proj=tmerc  datum=NAD27
-lon_0=-87d30 lat_0=30 k=.9999333333333333
-x_0=152400.3048006096 y_0=0
-no_defs <>
-
-# <nad27sp5010> alaska zone no. 10 : nad27sp
-<nad27sp5010> proj=lcc  datum=NAD27
-lon_0=-176 lat_1=53d50 lat_2=51d50 lat_0=51
-x_0=914401.8288036576 y_0=0
-no_defs <>
-
-# <nad27sp5300> american samoa : nad27sp
-<nad27sp5300> proj=lcc  datum=NAD27
-lon_0=-170 lat_1=-14d16 lat_2=-14d16 lat_0=-14d16
-x_0=152400.3048006096 y_0=95169.31165862332
-no_defs <>
-
-# <nad27sp201> arizona east : nad27sp
-<nad27sp201> proj=tmerc  datum=NAD27
-lon_0=-110d10 lat_0=31 k=.9999
-x_0=152400.3048006096 y_0=0
-no_defs <>
-
-# <nad27sp202> arizona central : nad27sp
-<nad27sp202> proj=tmerc  datum=NAD27
-lon_0=-111d55 lat_0=31 k=.9999
-x_0=152400.3048006096 y_0=0
-no_defs <>
-
-# <nad27sp203> arizona west : nad27sp
-<nad27sp203> proj=tmerc  datum=NAD27
-lon_0=-113d45 lat_0=31 k=.9999333333333333
-x_0=152400.3048006096 y_0=0
-no_defs <>
-
-# <nad27sp301> arkansas north : nad27sp
-<nad27sp301> proj=lcc  datum=NAD27
-lon_0=-92 lat_1=36d14 lat_2=34d56 lat_0=34d20
-x_0=609601.2192024384 y_0=0
-no_defs <>
-
-# <nad27sp302> arkansas south : nad27sp
-<nad27sp302> proj=lcc  datum=NAD27
-lon_0=-92 lat_1=34d46 lat_2=33d18 lat_0=32d40
-x_0=609601.2192024384 y_0=0
-no_defs <>
-
-# <nad27sp401> california i : nad27sp
-<nad27sp401> proj=lcc  datum=NAD27
-lon_0=-122 lat_1=41d40 lat_2=40 lat_0=39d20
-x_0=609601.2192024384 y_0=0
-no_defs <>
-
-# <nad27sp402> california ii : nad27sp
-<nad27sp402> proj=lcc  datum=NAD27
-lon_0=-122 lat_1=39d50 lat_2=38d20 lat_0=37d40
-x_0=609601.2192024384 y_0=0
-no_defs <>
-
-# <nad27sp403> california iii : nad27sp
-<nad27sp403> proj=lcc  datum=NAD27
-lon_0=-120d30 lat_1=38d26 lat_2=37d4 lat_0=36d30
-x_0=609601.2192024384 y_0=0
-no_defs <>
-
-# <nad27sp404> california iv : nad27sp
-<nad27sp404> proj=lcc  datum=NAD27
-lon_0=-119 lat_1=37d15 lat_2=36 lat_0=35d20
-x_0=609601.2192024384 y_0=0
-no_defs <>
-
-# <nad27sp405> california v : nad27sp
-<nad27sp405> proj=lcc  datum=NAD27
-lon_0=-118 lat_1=35d28 lat_2=34d2 lat_0=33d30
-x_0=609601.2192024384 y_0=0
-no_defs <>
-
-# <nad27sp406> california vi : nad27sp
-<nad27sp406> proj=lcc  datum=NAD27
-lon_0=-116d15 lat_1=33d53 lat_2=32d47 lat_0=32d10
-x_0=609601.2192024384 y_0=0
-no_defs <>
-
-# <nad27sp407> california vii : nad27sp
-<nad27sp407> proj=lcc  datum=NAD27
-lon_0=-118d20 lat_1=34d25 lat_2=33d52 lat_0=34d8
-x_0=1276106.450596901 y_0=1268253.006858014
-no_defs <>
-
-# <nad27sp501> colorado north : nad27sp
-<nad27sp501> proj=lcc  datum=NAD27
-lon_0=-105d30 lat_1=40d47 lat_2=39d43 lat_0=39d20
-x_0=609601.2192024384 y_0=0
-no_defs <>
-
-# <nad27sp502> colorado central : nad27sp
-<nad27sp502> proj=lcc  datum=NAD27
-lon_0=-105d30 lat_1=39d45 lat_2=38d27 lat_0=37d50
-x_0=609601.2192024384 y_0=0
-no_defs <>
-
-# <nad27sp503> colorado south : nad27sp
-<nad27sp503> proj=lcc  datum=NAD27
-lon_0=-105d30 lat_1=38d26 lat_2=37d14 lat_0=36d40
-x_0=609601.2192024384 y_0=0
-no_defs <>
-
-# <nad27sp600> connecticut --- : nad27sp
-<nad27sp600> proj=lcc  datum=NAD27
-lon_0=-72d45 lat_1=41d52 lat_2=41d12 lat_0=40d50
-x_0=182880.3657607315 y_0=0
-no_defs <>
-
-# <nad27sp700> delaware --- : nad27sp
-<nad27sp700> proj=tmerc  datum=NAD27
-lon_0=-75d25 lat_0=38 k=.999995
-x_0=152400.3048006096 y_0=0
-no_defs <>
-
-# <nad27sp901> florida east : nad27sp
-<nad27sp901> proj=tmerc  datum=NAD27
-lon_0=-81 lat_0=24d20 k=.9999411764705882
-x_0=152400.3048006096 y_0=0
-no_defs <>
-
-# <nad27sp902> florida west : nad27sp
-<nad27sp902> proj=tmerc  datum=NAD27
-lon_0=-82 lat_0=24d20 k=.9999411764705882
-x_0=152400.3048006096 y_0=0
-no_defs <>
-
-# <nad27sp903> florida north : nad27sp
-<nad27sp903> proj=lcc  datum=NAD27
-lon_0=-84d30 lat_1=30d45 lat_2=29d35 lat_0=29
-x_0=609601.2192024384 y_0=0
-no_defs <>
-
-# <nad27sp1001> georgia east : nad27sp
-<nad27sp1001> proj=tmerc  datum=NAD27
-lon_0=-82d10 lat_0=30 k=.9999
-x_0=152400.3048006096 y_0=0
-no_defs <>
-
-# <nad27sp1002> georgia west : nad27sp
-<nad27sp1002> proj=tmerc  datum=NAD27
-lon_0=-84d10 lat_0=30 k=.9999
-x_0=152400.3048006096 y_0=0
-no_defs <>
-
-# <nad27sp5101> hawaii 1 : nad27sp
-<nad27sp5101> proj=tmerc  datum=NAD27
-lon_0=-155d30 lat_0=18d50 k=.9999666666666667
-x_0=152400.3048006096 y_0=0
-no_defs <>
-
-# <nad27sp5102> hawaii 2 : nad27sp
-<nad27sp5102> proj=tmerc  datum=NAD27
-lon_0=-156d40 lat_0=20d20 k=.9999666666666667
-x_0=152400.3048006096 y_0=0
-no_defs <>
-
-# <nad27sp5103> hawaii 3 : nad27sp
-<nad27sp5103> proj=tmerc  datum=NAD27
-lon_0=-158 lat_0=21d10 k=.99999
-x_0=152400.3048006096 y_0=0
-no_defs <>
-
-# <nad27sp5104> hawaii 4 : nad27sp
-<nad27sp5104> proj=tmerc  datum=NAD27
-lon_0=-159d30 lat_0=21d50 k=.99999
-x_0=152400.3048006096 y_0=0
-no_defs <>
-
-# <nad27sp5105> hawaii 5 : nad27sp
-<nad27sp5105> proj=tmerc  datum=NAD27
-lon_0=-160d10 lat_0=21d40 k=1
-x_0=152400.3048006096 y_0=0
-no_defs <>
-
-# <nad27sp1101> idaho east : nad27sp
-<nad27sp1101> proj=tmerc  datum=NAD27
-lon_0=-112d10 lat_0=41d40 k=.9999473684210526
-x_0=152400.3048006096 y_0=0
-no_defs <>
-
-# <nad27sp1102> idaho central : nad27sp
-<nad27sp1102> proj=tmerc  datum=NAD27
-lon_0=-114 lat_0=41d40 k=.9999473684210526
-x_0=152400.3048006096 y_0=0
-no_defs <>
-
-# <nad27sp1103> idaho west : nad27sp
-<nad27sp1103> proj=tmerc  datum=NAD27
-lon_0=-115d45 lat_0=41d40 k=.9999333333333333
-x_0=152400.3048006096 y_0=0
-no_defs <>
-
-# <nad27sp1201> illinois east : nad27sp
-<nad27sp1201> proj=tmerc  datum=NAD27
-lon_0=-88d20 lat_0=36d40 k=.999975
-x_0=152400.3048006096 y_0=0
-no_defs <>
-
-# <nad27sp1202> illinois west : nad27sp
-<nad27sp1202> proj=tmerc  datum=NAD27
-lon_0=-90d10 lat_0=36d40 k=.9999411764705882
-x_0=152400.3048006096 y_0=0
-no_defs <>
-
-# <nad27sp1301> indiana east : nad27sp
-<nad27sp1301> proj=tmerc  datum=NAD27
-lon_0=-85d40 lat_0=37d30 k=.9999666666666667
-x_0=152400.3048006096 y_0=0
-no_defs <>
-
-# <nad27sp1302> indiana west : nad27sp
-<nad27sp1302> proj=tmerc  datum=NAD27
-lon_0=-87d5 lat_0=37d30 k=.9999666666666667
-x_0=152400.3048006096 y_0=0
-no_defs <>
-
-# <nad27sp1401> iowa north : nad27sp
-<nad27sp1401> proj=lcc  datum=NAD27
-lon_0=-93d30 lat_1=43d16 lat_2=42d4 lat_0=41d30
-x_0=609601.2192024384 y_0=0
-no_defs <>
-
-# <nad27sp1402> iowa south : nad27sp
-<nad27sp1402> proj=lcc  datum=NAD27
-lon_0=-93d30 lat_1=41d47 lat_2=40d37 lat_0=40
-x_0=609601.2192024384 y_0=0
-no_defs <>
-
-# <nad27sp1501> kansas north : nad27sp
-<nad27sp1501> proj=lcc  datum=NAD27
-lon_0=-98 lat_1=39d47 lat_2=38d43 lat_0=38d20
-x_0=609601.2192024384 y_0=0
-no_defs <>
-
-# <nad27sp1502> kansas south : nad27sp
-<nad27sp1502> proj=lcc  datum=NAD27
-lon_0=-98d30 lat_1=38d34 lat_2=37d16 lat_0=36d40
-x_0=609601.2192024384 y_0=0
-no_defs <>
-
-# <nad27sp1601> kentucky north : nad27sp
-<nad27sp1601> proj=lcc  datum=NAD27
-lon_0=-84d15 lat_1=38d58 lat_2=37d58 lat_0=37d30
-x_0=609601.2192024384 y_0=0
-no_defs <>
-
-# <nad27sp1602> kentucky south : nad27sp
-<nad27sp1602> proj=lcc  datum=NAD27
-lon_0=-85d45 lat_1=37d56 lat_2=36d44 lat_0=36d20
-x_0=609601.2192024384 y_0=0
-no_defs <>
-
-# <nad27sp1701> louisiana north : nad27sp
-<nad27sp1701> proj=lcc  datum=NAD27
-lon_0=-92d30 lat_1=32d40 lat_2=31d10 lat_0=30d40
-x_0=609601.2192024384 y_0=0
-no_defs <>
-
-# <nad27sp1702> louisiana south : nad27sp
-<nad27sp1702> proj=lcc  datum=NAD27
-lon_0=-91d20 lat_1=30d42 lat_2=29d18 lat_0=28d40
-x_0=609601.2192024384 y_0=0
-no_defs <>
-
-# <nad27sp1703> louisiana offshore : nad27sp
-<nad27sp1703> proj=lcc  datum=NAD27
-lon_0=-91d20 lat_1=27d50 lat_2=26d10 lat_0=25d40
-x_0=609601.2192024384 y_0=0
-no_defs <>
-
-# <nad27sp1801> maine east : nad27sp
-<nad27sp1801> proj=tmerc  datum=NAD27
-lon_0=-68d30 lat_0=43d50 k=.9999
-x_0=152400.3048006096 y_0=0
-no_defs <>
-
-# <nad27sp1802> maine west : nad27sp
-<nad27sp1802> proj=tmerc  datum=NAD27
-lon_0=-70d10 lat_0=42d50 k=.9999666666666667
-x_0=152400.3048006096 y_0=0
-no_defs <>
-
-# <nad27sp1900> maryland --- : nad27sp
-<nad27sp1900> proj=lcc  datum=NAD27
-lon_0=-77 lat_1=39d27 lat_2=38d18 lat_0=37d50
-x_0=243840.4876809754 y_0=0
-no_defs <>
-
-# <nad27sp2001> massachusetts mainland : nad27sp
-<nad27sp2001> proj=lcc  datum=NAD27
-lon_0=-71d30 lat_1=42d41 lat_2=41d43 lat_0=41
-x_0=182880.3657607315 y_0=0
-no_defs <>
-
-# <nad27sp2002> massachusetts island : nad27sp
-<nad27sp2002> proj=lcc  datum=NAD27
-lon_0=-70d30 lat_1=41d29 lat_2=41d17 lat_0=41
-x_0=60960.12192024384 y_0=0
-no_defs <>
-
-# <nad27sp2101> michigan east : nad27sp
-<nad27sp2101> proj=tmerc  datum=NAD27
-lon_0=-83d40 lat_0=41d30 k=.9999428571428571
-x_0=152400.3048006096 y_0=0
-no_defs <>
-
-# <nad27sp2102> michigan central/m : nad27sp
-<nad27sp2102> proj=tmerc  datum=NAD27
-lon_0=-85d45 lat_0=41d30 k=.9999090909090909
-x_0=152400.3048006096 y_0=0
-no_defs <>
-
-# <nad27sp2103> michigan west : nad27sp
-<nad27sp2103> proj=tmerc  datum=NAD27
-lon_0=-88d45 lat_0=41d30 k=.9999090909090909
-x_0=152400.3048006096 y_0=0
-no_defs <>
-
-# <nad27sp2111> michigan north : nad27sp
-<nad27sp2111> proj=lcc  a=6378450.047 es=.006768657997291094
-lon_0=-87 lat_1=47d5 lat_2=45d29 lat_0=44d47
-x_0=609601.2192024384 y_0=0
-no_defs <>
-
-# <nad27sp2112> michigan central/l : nad27sp
-<nad27sp2112> proj=lcc  a=6378450.047 es=.006768657997291094
-lon_0=-84d20 lat_1=45d42 lat_2=44d11 lat_0=43d19
-x_0=609601.2192024384 y_0=0
-no_defs <>
-
-# <nad27sp2113> michigan south : nad27sp
-<nad27sp2113> proj=lcc  a=6378450.047 es=.006768657997291094
-lon_0=-84d20 lat_1=43d40 lat_2=42d6 lat_0=41d30
-x_0=609601.2192024384 y_0=0
-no_defs <>
-
-# <nad27sp2201> minnesota north : nad27sp
-<nad27sp2201> proj=lcc  datum=NAD27
-lon_0=-93d6 lat_1=48d38 lat_2=47d2 lat_0=46d30
-x_0=609601.2192024384 y_0=0
-no_defs <>
-
-# <nad27sp2202> minnesota central : nad27sp
-<nad27sp2202> proj=lcc  datum=NAD27
-lon_0=-94d15 lat_1=47d3 lat_2=45d37 lat_0=45
-x_0=609601.2192024384 y_0=0
-no_defs <>
-
-# <nad27sp2203> minnesota south : nad27sp
-<nad27sp2203> proj=lcc  datum=NAD27
-lon_0=-94 lat_1=45d13 lat_2=43d47 lat_0=43
-x_0=609601.2192024384 y_0=0
-no_defs <>
-
-# <nad27sp2301> mississippi east : nad27sp
-<nad27sp2301> proj=tmerc  datum=NAD27
-lon_0=-88d50 lat_0=29d40 k=.99996
-x_0=152400.3048006096 y_0=0
-no_defs <>
-
-# <nad27sp2302> mississippi west : nad27sp
-<nad27sp2302> proj=tmerc  datum=NAD27
-lon_0=-90d20 lat_0=30d30 k=.9999411764705882
-x_0=152400.3048006096 y_0=0
-no_defs <>
-
-# <nad27sp2401> missouri east : nad27sp
-<nad27sp2401> proj=tmerc  datum=NAD27
-lon_0=-90d30 lat_0=35d50 k=.9999333333333333
-x_0=152400.3048006096 y_0=0
-no_defs <>
-
-# <nad27sp2402> missouri central : nad27sp
-<nad27sp2402> proj=tmerc  datum=NAD27
-lon_0=-92d30 lat_0=35d50 k=.9999333333333333
-x_0=152400.3048006096 y_0=0
-no_defs <>
-
-# <nad27sp2403> missouri west : nad27sp
-<nad27sp2403> proj=tmerc  datum=NAD27
-lon_0=-94d30 lat_0=36d10 k=.9999411764705882
-x_0=152400.3048006096 y_0=0
-no_defs <>
-
-# <nad27sp2501> montana north : nad27sp
-<nad27sp2501> proj=lcc  datum=NAD27
-lon_0=-109d30 lat_1=48d43 lat_2=47d51 lat_0=47
-x_0=609601.2192024384 y_0=0
-no_defs <>
-
-# <nad27sp2502> montana central : nad27sp
-<nad27sp2502> proj=lcc  datum=NAD27
-lon_0=-109d30 lat_1=47d53 lat_2=46d27 lat_0=45d50
-x_0=609601.2192024384 y_0=0
-no_defs <>
-
-# <nad27sp2503> montana south : nad27sp
-<nad27sp2503> proj=lcc  datum=NAD27
-lon_0=-109d30 lat_1=46d24 lat_2=44d52 lat_0=44
-x_0=609601.2192024384 y_0=0
-no_defs <>
-
-# <nad27sp2601> nebraska north : nad27sp
-<nad27sp2601> proj=lcc  datum=NAD27
-lon_0=-100 lat_1=42d49 lat_2=41d51 lat_0=41d20
-x_0=609601.2192024384 y_0=0
-no_defs <>
-
-# <nad27sp2602> nebraska south : nad27sp
-<nad27sp2602> proj=lcc  datum=NAD27
-lon_0=-99d30 lat_1=41d43 lat_2=40d17 lat_0=39d40
-x_0=609601.2192024384 y_0=0
-no_defs <>
-
-# <nad27sp2701> nevada east : nad27sp
-<nad27sp2701> proj=tmerc  datum=NAD27
-lon_0=-115d35 lat_0=34d45 k=.9999
-x_0=152400.3048006096 y_0=0
-no_defs <>
-
-# <nad27sp2702> nevada central : nad27sp
-<nad27sp2702> proj=tmerc  datum=NAD27
-lon_0=-116d40 lat_0=34d45 k=.9999
-x_0=152400.3048006096 y_0=0
-no_defs <>
-
-# <nad27sp2703> nevada west : nad27sp
-<nad27sp2703> proj=tmerc  datum=NAD27
-lon_0=-118d35 lat_0=34d45 k=.9999
-x_0=152400.3048006096 y_0=0
-no_defs <>
-
-# <nad27sp2800> new hampshire --- : nad27sp
-<nad27sp2800> proj=tmerc  datum=NAD27
-lon_0=-71d40 lat_0=42d30 k=.9999666666666667
-x_0=152400.3048006096 y_0=0
-no_defs <>
-
-# <nad27sp2900> new jersey --- : nad27sp
-<nad27sp2900> proj=tmerc  datum=NAD27
-lon_0=-74d40 lat_0=38d50 k=.999975
-x_0=609601.2192024384 y_0=0
-no_defs <>
-
-# <nad27sp3001> new mexico east : nad27sp
-<nad27sp3001> proj=tmerc  datum=NAD27
-lon_0=-104d20 lat_0=31 k=.9999090909090909
-x_0=152400.3048006096 y_0=0
-no_defs <>
-
-# <nad27sp3002> new mexico central : nad27sp
-<nad27sp3002> proj=tmerc  datum=NAD27
-lon_0=-106d15 lat_0=31 k=.9999
-x_0=152400.3048006096 y_0=0
-no_defs <>
-
-# <nad27sp3003> new mexico west : nad27sp
-<nad27sp3003> proj=tmerc  datum=NAD27
-lon_0=-107d50 lat_0=31 k=.9999166666666667
-x_0=152400.3048006096 y_0=0
-no_defs <>
-
-# <nad27sp3101> new york east : nad27sp
-<nad27sp3101> proj=tmerc  datum=NAD27
-lon_0=-74d20 lat_0=40 k=.9999666666666667
-x_0=152400.3048006096 y_0=0
-no_defs <>
-
-# <nad27sp3102> new york central : nad27sp
-<nad27sp3102> proj=tmerc  datum=NAD27
-lon_0=-76d35 lat_0=40 k=.9999375
-x_0=152400.3048006096 y_0=0
-no_defs <>
-
-# <nad27sp3103> new york west : nad27sp
-<nad27sp3103> proj=tmerc  datum=NAD27
-lon_0=-78d35 lat_0=40 k=.9999375
-x_0=152400.3048006096 y_0=0
-no_defs <>
-
-# <nad27sp3104> new york long island : nad27sp
-<nad27sp3104> proj=lcc  datum=NAD27
-lon_0=-74 lat_1=41d2 lat_2=40d40 lat_0=40d30
-x_0=609601.2192024384 y_0=30480.06096012192
-no_defs <>
-
-# <nad27sp3200> north carolina --- : nad27sp
-<nad27sp3200> proj=lcc  datum=NAD27
-lon_0=-79 lat_1=36d10 lat_2=34d20 lat_0=33d45
-x_0=609601.2192024384 y_0=0
-no_defs <>
-
-# <nad27sp3301> north dakota north : nad27sp
-<nad27sp3301> proj=lcc  datum=NAD27
-lon_0=-100d30 lat_1=48d44 lat_2=47d26 lat_0=47
-x_0=609601.2192024384 y_0=0
-no_defs <>
-
-# <nad27sp3302> north dakota south : nad27sp
-<nad27sp3302> proj=lcc  datum=NAD27
-lon_0=-100d30 lat_1=47d29 lat_2=46d11 lat_0=45d40
-x_0=609601.2192024384 y_0=0
-no_defs <>
-
-# <nad27sp3401> ohio north : nad27sp
-<nad27sp3401> proj=lcc  datum=NAD27
-lon_0=-82d30 lat_1=41d42 lat_2=40d26 lat_0=39d40
-x_0=609601.2192024384 y_0=0
-no_defs <>
-
-# <nad27sp3402> ohio south : nad27sp
-<nad27sp3402> proj=lcc  datum=NAD27
-lon_0=-82d30 lat_1=40d2 lat_2=38d44 lat_0=38
-x_0=609601.2192024384 y_0=0
-no_defs <>
-
-# <nad27sp3501> oklahoma north : nad27sp
-<nad27sp3501> proj=lcc  datum=NAD27
-lon_0=-98 lat_1=36d46 lat_2=35d34 lat_0=35
-x_0=609601.2192024384 y_0=0
-no_defs <>
-
-# <nad27sp3502> oklahoma south : nad27sp
-<nad27sp3502> proj=lcc  datum=NAD27
-lon_0=-98 lat_1=35d14 lat_2=33d56 lat_0=33d20
-x_0=609601.2192024384 y_0=0
-no_defs <>
-
-# <nad27sp3601> oregon north : nad27sp
-<nad27sp3601> proj=lcc  datum=NAD27
-lon_0=-120d30 lat_1=46 lat_2=44d20 lat_0=43d40
-x_0=609601.2192024384 y_0=0
-no_defs <>
-
-# <nad27sp3602> oregon south : nad27sp
-<nad27sp3602> proj=lcc  datum=NAD27
-lon_0=-120d30 lat_1=44 lat_2=42d20 lat_0=41d40
-x_0=609601.2192024384 y_0=0
-no_defs <>
-
-# <nad27sp3701> pennsylvania north : nad27sp
-<nad27sp3701> proj=lcc  datum=NAD27
-lon_0=-77d45 lat_1=41d57 lat_2=40d53 lat_0=40d10
-x_0=609601.2192024384 y_0=0
-no_defs <>
-
-# <nad27sp3702> pennsylvania south : nad27sp
-<nad27sp3702> proj=lcc  datum=NAD27
-lon_0=-77d45 lat_1=40d58 lat_2=39d56 lat_0=39d20
-x_0=609601.2192024384 y_0=0
-no_defs <>
-
-# <nad27sp3800> rhode island --- : nad27sp
-<nad27sp3800> proj=tmerc  datum=NAD27
-lon_0=-71d30 lat_0=41d5 k=.99999375
-x_0=152400.3048006096 y_0=0
-no_defs <>
-
-# <nad27sp3901> south carolina north : nad27sp
-<nad27sp3901> proj=lcc  datum=NAD27
-lon_0=-81 lat_1=34d58 lat_2=33d46 lat_0=33
-x_0=609601.2192024384 y_0=0
-no_defs <>
-
-# <nad27sp3902> south carolina south : nad27sp
-<nad27sp3902> proj=lcc  datum=NAD27
-lon_0=-81 lat_1=33d40 lat_2=32d20 lat_0=31d50
-x_0=609601.2192024384 y_0=0
-no_defs <>
-
-# <nad27sp4001> south dakota north : nad27sp
-<nad27sp4001> proj=lcc  datum=NAD27
-lon_0=-100 lat_1=45d41 lat_2=44d25 lat_0=43d50
-x_0=609601.2192024384 y_0=0
-no_defs <>
-
-# <nad27sp4002> south dakota south : nad27sp
-<nad27sp4002> proj=lcc  datum=NAD27
-lon_0=-100d20 lat_1=44d24 lat_2=42d50 lat_0=42d20
-x_0=609601.2192024384 y_0=0
-no_defs <>
-
-# <nad27sp4100> tennessee --- : nad27sp
-<nad27sp4100> proj=lcc  datum=NAD27
-lon_0=-86 lat_1=36d25 lat_2=35d15 lat_0=34d40
-x_0=609601.2192024384 y_0=30480.06096012192
-no_defs <>
-
-# <nad27sp4201> texas north : nad27sp
-<nad27sp4201> proj=lcc  datum=NAD27
-lon_0=-101d30 lat_1=36d11 lat_2=34d39 lat_0=34
-x_0=609601.2192024384 y_0=0
-no_defs <>
-
-# <nad27sp4202> texas north central : nad27sp
-<nad27sp4202> proj=lcc  datum=NAD27
-lon_0=-97d30 lat_1=33d58 lat_2=32d8 lat_0=31d40
-x_0=609601.2192024384 y_0=0
-no_defs <>
-
-# <nad27sp4203> texas central : nad27sp
-<nad27sp4203> proj=lcc  datum=NAD27
-lon_0=-100d20 lat_1=31d53 lat_2=30d7 lat_0=29d40
-x_0=609601.2192024384 y_0=0
-no_defs <>
-
-# <nad27sp4204> texas south central : nad27sp
-<nad27sp4204> proj=lcc  datum=NAD27
-lon_0=-99 lat_1=30d17 lat_2=28d23 lat_0=27d50
-x_0=609601.2192024384 y_0=0
-no_defs <>
-
-# <nad27sp4205> texas south : nad27sp
-<nad27sp4205> proj=lcc  datum=NAD27
-lon_0=-98d30 lat_1=27d50 lat_2=26d10 lat_0=25d40
-x_0=609601.2192024384 y_0=0
-no_defs <>
-
-# <nad27sp4301> utah north : nad27sp
-<nad27sp4301> proj=lcc  datum=NAD27
-lon_0=-111d30 lat_1=41d47 lat_2=40d43 lat_0=40d20
-x_0=609601.2192024384 y_0=0
-no_defs <>
-
-# <nad27sp4302> utah central : nad27sp
-<nad27sp4302> proj=lcc  datum=NAD27
-lon_0=-111d30 lat_1=40d39 lat_2=39d1 lat_0=38d20
-x_0=609601.2192024384 y_0=0
-no_defs <>
-
-# <nad27sp4303> utah south : nad27sp
-<nad27sp4303> proj=lcc  datum=NAD27
-lon_0=-111d30 lat_1=38d21 lat_2=37d13 lat_0=36d40
-x_0=609601.2192024384 y_0=0
-no_defs <>
-
-# <nad27sp4400> vermont --- : nad27sp
-<nad27sp4400> proj=tmerc  datum=NAD27
-lon_0=-72d30 lat_0=42d30 k=.9999642857142857
-x_0=152400.3048006096 y_0=0
-no_defs <>
-
-# <nad27sp4501> virginia north : nad27sp
-<nad27sp4501> proj=lcc  datum=NAD27
-lon_0=-78d30 lat_1=39d12 lat_2=38d2 lat_0=37d40
-x_0=609601.2192024384 y_0=0
-no_defs <>
-
-# <nad27sp4502> virginia south : nad27sp
-<nad27sp4502> proj=lcc  datum=NAD27
-lon_0=-78d30 lat_1=37d58 lat_2=36d46 lat_0=36d20
-x_0=609601.2192024384 y_0=0
-no_defs <>
-
-# <nad27sp4601> washington north : nad27sp
-<nad27sp4601> proj=lcc  datum=NAD27
-lon_0=-120d50 lat_1=48d44 lat_2=47d30 lat_0=47
-x_0=609601.2192024384 y_0=0
-no_defs <>
-
-# <nad27sp4602> washington south : nad27sp
-<nad27sp4602> proj=lcc  datum=NAD27
-lon_0=-120d30 lat_1=47d20 lat_2=45d50 lat_0=45d20
-x_0=609601.2192024384 y_0=0
-no_defs <>
-
-# <nad27sp4701> west virginia north : nad27sp
-<nad27sp4701> proj=lcc  datum=NAD27
-lon_0=-79d30 lat_1=40d15 lat_2=39 lat_0=38d30
-x_0=609601.2192024384 y_0=0
-no_defs <>
-
-# <nad27sp4702> west virginia south : nad27sp
-<nad27sp4702> proj=lcc  datum=NAD27
-lon_0=-81 lat_1=38d53 lat_2=37d29 lat_0=37
-x_0=609601.2192024384 y_0=0
-no_defs <>
-
-# <nad27sp4801> wisconsin north : nad27sp
-<nad27sp4801> proj=lcc  datum=NAD27
-lon_0=-90 lat_1=46d46 lat_2=45d34 lat_0=45d10
-x_0=609601.2192024384 y_0=0
-no_defs <>
-
-# <nad27sp4802> wisconsin central : nad27sp
-<nad27sp4802> proj=lcc  datum=NAD27
-lon_0=-90 lat_1=45d30 lat_2=44d15 lat_0=43d50
-x_0=609601.2192024384 y_0=0
-no_defs <>
-
-# <nad27sp4803> wisconsin south : nad27sp
-<nad27sp4803> proj=lcc  datum=NAD27
-lon_0=-90 lat_1=44d4 lat_2=42d44 lat_0=42
-x_0=609601.2192024384 y_0=0
-no_defs <>
-
-# <nad27sp4901> wyoming east : nad27sp
-<nad27sp4901> proj=tmerc  datum=NAD27
-lon_0=-105d10 lat_0=40d40 k=.9999411764705882
-x_0=152400.3048006096 y_0=0
-no_defs <>
-
-# <nad27sp4902> wyoming east central : nad27sp
-<nad27sp4902> proj=tmerc  datum=NAD27
-lon_0=-107d20 lat_0=40d40 k=.9999411764705882
-x_0=152400.3048006096 y_0=0
-no_defs <>
-
-# <nad27sp4903> wyoming west central : nad27sp
-<nad27sp4903> proj=tmerc  datum=NAD27
-lon_0=-108d45 lat_0=40d40 k=.9999411764705882
-x_0=152400.3048006096 y_0=0
-no_defs <>
-
-# <nad27sp4904> wyoming west : nad27sp
-<nad27sp4904> proj=tmerc  datum=NAD27
-lon_0=-110d5 lat_0=40d40 k=.9999411764705882
-x_0=152400.3048006096 y_0=0
-no_defs <>
-
-# <nad27sp5001> alaska zone no. 1 : nad27sp
-<nad27sp5001> proj=omerc  datum=NAD27
-k=.9999 lonc=-133d40 lat_0=57 alpha=-36d52'11.6315
-x_0=818585.5672270928 y_0=575219.2451072642
-no_defs <>
-
-# <nad27sp5002> alaska zone no. 2 : nad27sp
-<nad27sp5002> proj=tmerc  datum=NAD27
-lon_0=-142 lat_0=54 k=.9999
-x_0=152400.3048006096 y_0=0
-no_defs <>
-
-# <nad27sp5003> alaska zone no. 3 : nad27sp
-<nad27sp5003> proj=tmerc  datum=NAD27
-lon_0=-146 lat_0=54 k=.9999
-x_0=152400.3048006096 y_0=0
-no_defs <>
-
-# <nad27sp5004> alaska zone no. 4 : nad27sp
-<nad27sp5004> proj=tmerc  datum=NAD27
-lon_0=-150 lat_0=54 k=.9999
-x_0=152400.3048006096 y_0=0
-no_defs <>
-
-# <nad27sp5005> alaska zone no. 5 : nad27sp
-<nad27sp5005> proj=tmerc  datum=NAD27
-lon_0=-154 lat_0=54 k=.9999
-x_0=152400.3048006096 y_0=0
-no_defs <>
-
-# <nad27sp5006> alaska zone no. 6 : nad27sp
-<nad27sp5006> proj=tmerc  datum=NAD27
-lon_0=-158 lat_0=54 k=.9999
-x_0=152400.3048006096 y_0=0
-no_defs <>
-
-# <nad27sp5007> alaska zone no. 7 : nad27sp
-<nad27sp5007> proj=tmerc  datum=NAD27
-lon_0=-162 lat_0=54 k=.9999
-x_0=213360.4267208534 y_0=0
-no_defs <>
-
-# <nad27sp5008> alaska zone no. 8 : nad27sp
-<nad27sp5008> proj=tmerc  datum=NAD27
-lon_0=-166 lat_0=54 k=.9999
-x_0=152400.3048006096 y_0=0
-no_defs <>
-
-# <nad27sp5009> alaska zone no. 9 : nad27sp
-<nad27sp5009> proj=tmerc  datum=NAD27
-lon_0=-170 lat_0=54 k=.9999
-x_0=182880.3657607315 y_0=0
-no_defs <>
-
-# <nad27sp5201> puerto rico and virgin islands : nad27sp
-<nad27sp5201> proj=lcc  datum=NAD27
-lon_0=-66d26 lat_1=18d26 lat_2=18d2 lat_0=17d50
-x_0=152400.3048006096 y_0=0
-no_defs <>
-
-# <nad27sp5202> virgin islands st. croix : nad27sp
-<nad27sp5202> proj=lcc  datum=NAD27
-lon_0=-66d26 lat_1=18d26 lat_2=18d2 lat_0=17d50
-x_0=152400.3048006096 y_0=30480.06096012192
-no_defs <>
-
-# <nad27sp5400> guam island : nad27sp
-<nad27sp5400> proj=poly  datum=NAD27
-x_0=50000 y_0=50000 lon_0=144d44'55.50254 lat_0=13d28'20.87887
-no_defs <>
-
-#
-#
-##########################################################
-#
-#     State Plane Coordinate Systems
-#     North American Datum 1983
-
-# <nad83sp101> alabama east nad83
-<nad83sp101> proj=tmerc  datum=NAD83
-lon_0=-85d50 lat_0=30d30 k=.99996
-x_0=200000 y_0=0
-no_defs <>
-
-# <nad83sp102> alabama west nad83
-<nad83sp102> proj=tmerc  datum=NAD83
-lon_0=-87d30 lat_0=30 k=.9999333333333333
-x_0=600000 y_0=0
-no_defs <>
-
-# <nad83sp5010> alaska zone no. 10 nad83
-<nad83sp5010> proj=lcc  datum=NAD83
-lon_0=-176 lat_1=53d50 lat_2=51d50 lat_0=51
-x_0=1000000 y_0=0
-no_defs <>
-
-# <nad83sp201> arizona east nad83
-<nad83sp201> proj=tmerc  datum=NAD83
-lon_0=-110d10 lat_0=31 k=.9999
-x_0=213360 y_0=0
-no_defs <>
-
-# <nad83sp202> arizona central nad83
-<nad83sp202> proj=tmerc  datum=NAD83
-lon_0=-111d55 lat_0=31 k=.9999
-x_0=213360 y_0=0
-no_defs <>
-
-# <nad83sp203> arizona west nad83
-<nad83sp203> proj=tmerc  datum=NAD83
-lon_0=-113d45 lat_0=31 k=.9999333333333333
-x_0=213360 y_0=0
-no_defs <>
-
-# <nad83sp301> arkansas north nad83
-<nad83sp301> proj=lcc  datum=NAD83
-lon_0=-92 lat_1=36d14 lat_2=34d56 lat_0=34d20
-x_0=400000 y_0=0
-no_defs <>
-
-# <nad83sp302> arkansas south nad83
-<nad83sp302> proj=lcc  datum=NAD83
-lon_0=-92 lat_1=34d46 lat_2=33d18 lat_0=32d40
-x_0=400000 y_0=400000
-no_defs <>
-
-# <nad83sp401> california i nad83
-<nad83sp401> proj=lcc  datum=NAD83
-lon_0=-122 lat_1=41d40 lat_2=40 lat_0=39d20
-x_0=2000000 y_0=500000
-no_defs <>
-
-# <nad83sp402> california ii nad83
-<nad83sp402> proj=lcc  datum=NAD83
-lon_0=-122 lat_1=39d50 lat_2=38d20 lat_0=37d40
-x_0=2000000 y_0=500000
-no_defs <>
-
-# <nad83sp403> california iii nad83
-<nad83sp403> proj=lcc  datum=NAD83
-lon_0=-120d30 lat_1=38d26 lat_2=37d4 lat_0=36d30
-x_0=2000000 y_0=500000
-no_defs <>
-
-# <nad83sp404> california iv nad83
-<nad83sp404> proj=lcc  datum=NAD83
-lon_0=-119 lat_1=37d15 lat_2=36 lat_0=35d20
-x_0=2000000 y_0=500000
-no_defs <>
-
-# <nad83sp405> california v nad83
-<nad83sp405> proj=lcc  datum=NAD83
-lon_0=-118 lat_1=35d28 lat_2=34d2 lat_0=33d30
-x_0=2000000 y_0=500000
-no_defs <>
-
-# <nad83sp406> california vi nad83
-<nad83sp406> proj=lcc  datum=NAD83
-lon_0=-116d15 lat_1=33d53 lat_2=32d47 lat_0=32d10
-x_0=2000000 y_0=500000
-no_defs <>
-
-# <nad83sp501> colorado north nad83
-<nad83sp501> proj=lcc  datum=NAD83
-lon_0=-105d30 lat_1=40d47 lat_2=39d43 lat_0=39d20
-x_0=914401.8289 y_0=304800.6096
-no_defs <>
-
-# <nad83sp502> colorado central nad83
-<nad83sp502> proj=lcc  datum=NAD83
-lon_0=-105d30 lat_1=39d45 lat_2=38d27 lat_0=37d50
-x_0=914401.8289 y_0=304800.6096
-no_defs <>
-
-# <nad83sp503> colorado south nad83
-<nad83sp503> proj=lcc  datum=NAD83
-lon_0=-105d30 lat_1=38d26 lat_2=37d14 lat_0=36d40
-x_0=914401.8289 y_0=304800.6096
-no_defs <>
-
-# <nad83sp600> connecticut --- nad83
-<nad83sp600> proj=lcc  datum=NAD83
-lon_0=-72d45 lat_1=41d52 lat_2=41d12 lat_0=40d50
-x_0=304800.6096 y_0=152400.3048
-no_defs <>
-
-# <nad83sp700> delaware --- nad83
-<nad83sp700> proj=tmerc  datum=NAD83
-lon_0=-75d25 lat_0=38 k=.999995
-x_0=200000 y_0=0
-no_defs <>
-
-# <nad83sp901> florida east nad83
-<nad83sp901> proj=tmerc  datum=NAD83
-lon_0=-81 lat_0=24d20 k=.9999411764705882
-x_0=200000 y_0=0
-no_defs <>
-
-# <nad83sp902> florida west nad83
-<nad83sp902> proj=tmerc  datum=NAD83
-lon_0=-82 lat_0=24d20 k=.9999411764705882
-x_0=200000 y_0=0
-no_defs <>
-
-# <nad83sp903> florida north nad83
-<nad83sp903> proj=lcc  datum=NAD83
-lon_0=-84d30 lat_1=30d45 lat_2=29d35 lat_0=29
-x_0=600000 y_0=0
-no_defs <>
-
-# <nad83sp1001> georgia east nad83
-<nad83sp1001> proj=tmerc  datum=NAD83
-lon_0=-82d10 lat_0=30 k=.9999
-x_0=200000 y_0=0
-no_defs <>
-
-# <nad83sp1002> georgia west nad83
-<nad83sp1002> proj=tmerc  datum=NAD83
-lon_0=-84d10 lat_0=30 k=.9999
-x_0=700000 y_0=0
-no_defs <>
-
-# <nad83sp5101> hawaii 1 nad83
-<nad83sp5101> proj=tmerc  datum=NAD83
-lon_0=-155d30 lat_0=18d50 k=.9999666666666667
-x_0=500000 y_0=0
-no_defs <>
-
-# <nad83sp5102> hawaii 2 nad83
-<nad83sp5102> proj=tmerc  datum=NAD83
-lon_0=-156d40 lat_0=20d20 k=.9999666666666667
-x_0=500000 y_0=0
-no_defs <>
-
-# <nad83sp5103> hawaii 3 nad83
-<nad83sp5103> proj=tmerc  datum=NAD83
-lon_0=-158 lat_0=21d10 k=.99999
-x_0=500000 y_0=0
-no_defs <>
-
-# <nad83sp5104> hawaii 4 nad83
-<nad83sp5104> proj=tmerc  datum=NAD83
-lon_0=-159d30 lat_0=21d50 k=.99999
-x_0=500000 y_0=0
-no_defs <>
-
-# <nad83sp5105> hawaii 5 nad83
-<nad83sp5105> proj=tmerc  datum=NAD83
-lon_0=-160d10 lat_0=21d40 k=1
-x_0=500000 y_0=0
-no_defs <>
-
-# <nad83sp1101> idaho east nad83
-<nad83sp1101> proj=tmerc  datum=NAD83
-lon_0=-112d10 lat_0=41d40 k=.9999473684210526
-x_0=200000 y_0=0
-no_defs <>
-
-# <nad83sp1102> idaho central nad83
-<nad83sp1102> proj=tmerc  datum=NAD83
-lon_0=-114 lat_0=41d40 k=.9999473684210526
-x_0=500000 y_0=0
-no_defs <>
-
-# <nad83sp1103> idaho west nad83
-<nad83sp1103> proj=tmerc  datum=NAD83
-lon_0=-115d45 lat_0=41d40 k=.9999333333333333
-x_0=800000 y_0=0
-no_defs <>
-
-# <nad83sp1201> illinois east nad83
-<nad83sp1201> proj=tmerc  datum=NAD83
-lon_0=-88d20 lat_0=36d40 k=.999975
-x_0=300000 y_0=0
-no_defs <>
-
-# <nad83sp1202> illinois west nad83
-<nad83sp1202> proj=tmerc  datum=NAD83
-lon_0=-90d10 lat_0=36d40 k=.9999411764705882
-x_0=700000 y_0=0
-no_defs <>
-
-# <nad83sp1301> indiana east nad83
-<nad83sp1301> proj=tmerc  datum=NAD83
-lon_0=-85d40 lat_0=37d30 k=.9999666666666667
-x_0=100000 y_0=250000
-no_defs <>
-
-# <nad83sp1302> indiana west nad83
-<nad83sp1302> proj=tmerc  datum=NAD83
-lon_0=-87d5 lat_0=37d30 k=.9999666666666667
-x_0=900000 y_0=250000
-no_defs <>
-
-# <nad83sp1401> iowa north nad83
-<nad83sp1401> proj=lcc  datum=NAD83
-lon_0=-93d30 lat_1=43d16 lat_2=42d4 lat_0=41d30
-x_0=1500000 y_0=1000000
-no_defs <>
-
-# <nad83sp1402> iowa south nad83
-<nad83sp1402> proj=lcc  datum=NAD83
-lon_0=-93d30 lat_1=41d47 lat_2=40d37 lat_0=40
-x_0=500000 y_0=0
-no_defs <>
-
-# <nad83sp1501> kansas north nad83
-<nad83sp1501> proj=lcc  datum=NAD83
-lon_0=-98 lat_1=39d47 lat_2=38d43 lat_0=38d20
-x_0=400000 y_0=0
-no_defs <>
-
-# <nad83sp1502> kansas south nad83
-<nad83sp1502> proj=lcc  datum=NAD83
-lon_0=-98d30 lat_1=38d34 lat_2=37d16 lat_0=36d40
-x_0=400000 y_0=400000
-no_defs <>
-
-# <nad83sp1601> kentucky north nad83
-<nad83sp1601> proj=lcc  datum=NAD83
-lon_0=-84d15 lat_1=38d58 lat_2=37d58 lat_0=37d30
-x_0=500000 y_0=0
-no_defs <>
-
-# <nad83sp1602> kentucky south nad83
-<nad83sp1602> proj=lcc  datum=NAD83
-lon_0=-85d45 lat_1=37d56 lat_2=36d44 lat_0=36d20
-x_0=500000 y_0=500000
-no_defs <>
-
-# <nad83sp1701> louisiana north nad83
-<nad83sp1701> proj=lcc  datum=NAD83
-lon_0=-92d30 lat_1=32d40 lat_2=31d10 lat_0=30d30
-x_0=1000000 y_0=0
-no_defs <>
-
-# <nad83sp1702> louisiana south nad83
-<nad83sp1702> proj=lcc  datum=NAD83
-lon_0=-91d20 lat_1=30d42 lat_2=29d18 lat_0=28d30
-x_0=1000000 y_0=0
-no_defs <>
-
-# <nad83sp1703> louisiana offshore nad83
-<nad83sp1703> proj=lcc  datum=NAD83
-lon_0=-91d20 lat_1=27d50 lat_2=26d10 lat_0=25d30
-x_0=1000000 y_0=0
-no_defs <>
-
-# <nad83sp1801> maine east nad83
-<nad83sp1801> proj=tmerc  datum=NAD83
-lon_0=-68d30 lat_0=43d40 k=.9999
-x_0=300000 y_0=0
-no_defs <>
-
-# <nad83sp1802> maine west nad83
-<nad83sp1802> proj=tmerc  datum=NAD83
-lon_0=-70d10 lat_0=42d50 k=.9999666666666667
-x_0=900000 y_0=0
-no_defs <>
-
-# <nad83sp1900> maryland --- nad83
-<nad83sp1900> proj=lcc  datum=NAD83
-lon_0=-77 lat_1=39d27 lat_2=38d18 lat_0=37d40
-x_0=400000 y_0=0
-no_defs <>
-
-# <nad83sp2001> massachusetts mainland nad83
-<nad83sp2001> proj=lcc  datum=NAD83
-lon_0=-71d30 lat_1=42d41 lat_2=41d43 lat_0=41
-x_0=200000 y_0=750000
-no_defs <>
-
-# <nad83sp2002> massachusetts island nad83
-<nad83sp2002> proj=lcc  datum=NAD83
-lon_0=-70d30 lat_1=41d29 lat_2=41d17 lat_0=41
-x_0=500000 y_0=0
-no_defs <>
-
-# <nad83sp2111> michigan north nad83
-<nad83sp2111> proj=lcc  datum=NAD83
-lon_0=-87 lat_1=47d5 lat_2=45d29 lat_0=44d47
-x_0=8000000 y_0=0
-no_defs <>
-
-# <nad83sp2112> michigan central/l nad83
-<nad83sp2112> proj=lcc  datum=NAD83
-lon_0=-84d22 lat_1=45d42 lat_2=44d11 lat_0=43d19
-x_0=6000000 y_0=0
-no_defs <>
-
-# <nad83sp2113> michigan south nad83
-<nad83sp2113> proj=lcc  datum=NAD83
-lon_0=-84d22 lat_1=43d40 lat_2=42d6 lat_0=41d30
-x_0=4000000 y_0=0
-no_defs <>
-
-# <nad83sp2201> minnesota north nad83
-<nad83sp2201> proj=lcc  datum=NAD83
-lon_0=-93d6 lat_1=48d38 lat_2=47d2 lat_0=46d30
-x_0=800000 y_0=100000
-no_defs <>
-
-# <nad83sp2202> minnesota central nad83
-<nad83sp2202> proj=lcc  datum=NAD83
-lon_0=-94d15 lat_1=47d3 lat_2=45d37 lat_0=45
-x_0=800000 y_0=100000
-no_defs <>
-
-# <nad83sp2203> minnesota south nad83
-<nad83sp2203> proj=lcc  datum=NAD83
-lon_0=-94 lat_1=45d13 lat_2=43d47 lat_0=43
-x_0=800000 y_0=100000
-no_defs <>
-
-# <nad83sp2301> mississippi east nad83
-<nad83sp2301> proj=tmerc  datum=NAD83
-lon_0=-88d50 lat_0=29d30 k=.99995
-x_0=300000 y_0=0
-no_defs <>
-
-# <nad83sp2302> mississippi west nad83
-<nad83sp2302> proj=tmerc  datum=NAD83
-lon_0=-90d20 lat_0=29d30 k=.99995
-x_0=700000 y_0=0
-no_defs <>
-
-# <nad83sp2401> missouri east nad83
-<nad83sp2401> proj=tmerc  datum=NAD83
-lon_0=-90d30 lat_0=35d50 k=.9999333333333333
-x_0=250000 y_0=0
-no_defs <>
-
-# <nad83sp2402> missouri central nad83
-<nad83sp2402> proj=tmerc  datum=NAD83
-lon_0=-92d30 lat_0=35d50 k=.9999333333333333
-x_0=500000 y_0=0
-no_defs <>
-
-# <nad83sp2403> missouri west nad83
-<nad83sp2403> proj=tmerc  datum=NAD83
-lon_0=-94d30 lat_0=36d10 k=.9999411764705882
-x_0=850000 y_0=0
-no_defs <>
-
-# <nad83sp2500> montana nad83
-<nad83sp2500> proj=lcc  datum=NAD83
-lon_0=-109d30 lat_1=49 lat_2=45 lat_0=44d15
-x_0=600000 y_0=0
-no_defs <>
-
-# <nad83sp2600> nebraska nad83
-<nad83sp2600> proj=lcc  datum=NAD83
-lon_0=-100 lat_1=43 lat_2=40 lat_0=39d50
-x_0=500000 y_0=0
-no_defs <>
-
-# <nad83sp2701> nevada east nad83
-<nad83sp2701> proj=tmerc  datum=NAD83
-lon_0=-115d35 lat_0=34d45 k=.9999
-x_0=200000 y_0=8000000
-no_defs <>
-
-# <nad83sp2702> nevada central nad83
-<nad83sp2702> proj=tmerc  datum=NAD83
-lon_0=-116d40 lat_0=34d45 k=.9999
-x_0=500000 y_0=6000000
-no_defs <>
-
-# <nad83sp2703> nevada west nad83
-<nad83sp2703> proj=tmerc  datum=NAD83
-lon_0=-118d35 lat_0=34d45 k=.9999
-x_0=800000 y_0=4000000
-no_defs <>
-
-# <nad83sp2800> new hampshire --- nad83
-<nad83sp2800> proj=tmerc  datum=NAD83
-lon_0=-71d40 lat_0=42d30 k=.9999666666666667
-x_0=300000 y_0=0
-no_defs <>
-
-# <nad83sp2900> new jersey --- nad83
-<nad83sp2900> proj=tmerc  datum=NAD83
-lon_0=-74d30 lat_0=38d50 k=.9999
-x_0=150000 y_0=0
-no_defs <>
-
-# <nad83sp3001> new mexico east nad83
-<nad83sp3001> proj=tmerc  datum=NAD83
-lon_0=-104d20 lat_0=31 k=.9999090909090909
-x_0=165000 y_0=0
-no_defs <>
-
-# <nad83sp3002> new mexico central nad83
-<nad83sp3002> proj=tmerc  datum=NAD83
-lon_0=-106d15 lat_0=31 k=.9999
-x_0=500000 y_0=0
-no_defs <>
-
-# <nad83sp3003> new mexico west nad83
-<nad83sp3003> proj=tmerc  datum=NAD83
-lon_0=-107d50 lat_0=31 k=.9999166666666667
-x_0=830000 y_0=0
-no_defs <>
-
-# <nad83sp3101> new york east nad83
-<nad83sp3101> proj=tmerc  datum=NAD83
-lon_0=-74d30 lat_0=38d50 k=.9999
-x_0=150000 y_0=0
-no_defs <>
-
-# <nad83sp3102> new york central nad83
-<nad83sp3102> proj=tmerc  datum=NAD83
-lon_0=-76d35 lat_0=40 k=.9999375
-x_0=250000 y_0=0
-no_defs <>
-
-# <nad83sp3103> new york west nad83
-<nad83sp3103> proj=tmerc  datum=NAD83
-lon_0=-78d35 lat_0=40 k=.9999375
-x_0=350000 y_0=0
-no_defs <>
-
-# <nad83sp3104> new york long island nad83
-<nad83sp3104> proj=lcc  datum=NAD83
-lon_0=-74 lat_1=41d2 lat_2=40d40 lat_0=40d10
-x_0=300000 y_0=0
-no_defs <>
-
-# <nad83sp3200> north carolina --- nad83
-<nad83sp3200> proj=lcc  datum=NAD83
-lon_0=-79 lat_1=36d10 lat_2=34d20 lat_0=33d45
-x_0=609601.22 y_0=0
-no_defs <>
-
-# <nad83sp3301> north dakota north nad83
-<nad83sp3301> proj=lcc  datum=NAD83
-lon_0=-100d30 lat_1=48d44 lat_2=47d26 lat_0=47
-x_0=600000 y_0=0
-no_defs <>
-
-# <nad83sp3302> north dakota south nad83
-<nad83sp3302> proj=lcc  datum=NAD83
-lon_0=-100d30 lat_1=47d29 lat_2=46d11 lat_0=45d40
-x_0=600000 y_0=0
-no_defs <>
-
-# <nad83sp3401> ohio north nad83
-<nad83sp3401> proj=lcc  datum=NAD83
-lon_0=-82d30 lat_1=41d42 lat_2=40d26 lat_0=39d40
-x_0=600000 y_0=0
-no_defs <>
-
-# <nad83sp3402> ohio south nad83
-<nad83sp3402> proj=lcc  datum=NAD83
-lon_0=-82d30 lat_1=40d2 lat_2=38d44 lat_0=38
-x_0=600000 y_0=0
-no_defs <>
-
-# <nad83sp3501> oklahoma north nad83
-<nad83sp3501> proj=lcc  datum=NAD83
-lon_0=-98 lat_1=36d46 lat_2=35d34 lat_0=35
-x_0=600000 y_0=0
-no_defs <>
-
-# <nad83sp3502> oklahoma south nad83
-<nad83sp3502> proj=lcc  datum=NAD83
-lon_0=-98 lat_1=35d14 lat_2=33d56 lat_0=33d20
-x_0=600000 y_0=0
-no_defs <>
-
-# <nad83sp3601> oregon north nad83
-<nad83sp3601> proj=lcc  datum=NAD83
-lon_0=-120d30 lat_1=46 lat_2=44d20 lat_0=43d40
-x_0=2500000 y_0=0
-no_defs <>
-
-# <nad83sp3602> oregon south nad83
-<nad83sp3602> proj=lcc  datum=NAD83
-lon_0=-120d30 lat_1=44 lat_2=42d20 lat_0=41d40
-x_0=1500000 y_0=0
-no_defs <>
-
-# <nad83sp3701> pennsylvania north nad83
-<nad83sp3701> proj=lcc  datum=NAD83
-lon_0=-77d45 lat_1=41d57 lat_2=40d53 lat_0=40d10
-x_0=600000 y_0=0
-no_defs <>
-
-# <nad83sp3702> pennsylvania south nad83
-<nad83sp3702> proj=lcc  datum=NAD83
-lon_0=-77d45 lat_1=40d58 lat_2=39d56 lat_0=39d20
-x_0=600000 y_0=0
-no_defs <>
-
-# <nad83sp3800> rhode island --- nad83
-<nad83sp3800> proj=tmerc  datum=NAD83
-lon_0=-71d30 lat_0=41d5 k=.99999375
-x_0=100000 y_0=0
-no_defs <>
-
-# <nad83sp3900> south carolina nad83
-<nad83sp3900> proj=lcc  datum=NAD83
-lon_0=-81 lat_1=34d50 lat_2=32d30 lat_0=31d50
-x_0=609600 y_0=0
-no_defs <>
-
-# <nad83sp4001> south dakota north nad83
-<nad83sp4001> proj=lcc  datum=NAD83
-lon_0=-100 lat_1=45d41 lat_2=44d25 lat_0=43d50
-x_0=600000 y_0=0
-no_defs <>
-
-# <nad83sp4002> south dakota south nad83
-<nad83sp4002> proj=lcc  datum=NAD83
-lon_0=-100d20 lat_1=44d24 lat_2=42d50 lat_0=42d20
-x_0=600000 y_0=0
-no_defs <>
-
-# <nad83sp4100> tennessee --- nad83
-<nad83sp4100> proj=lcc  datum=NAD83
-lon_0=-86 lat_1=36d25 lat_2=35d15 lat_0=34d20
-x_0=600000 y_0=0
-no_defs <>
-
-# <nad83sp4201> texas north nad83
-<nad83sp4201> proj=lcc  datum=NAD83
-lon_0=-101d30 lat_1=36d11 lat_2=34d39 lat_0=34
-x_0=200000 y_0=1000000
-no_defs <>
-
-# <nad83sp4202> texas north central nad83
-<nad83sp4202> proj=lcc  datum=NAD83
-lon_0=-98d30 lat_1=33d58 lat_2=32d8 lat_0=31d40
-x_0=600000 y_0=2000000
-no_defs <>
-
-# <nad83sp4203> texas central nad83
-<nad83sp4203> proj=lcc  datum=NAD83
-lon_0=-100d20 lat_1=31d53 lat_2=30d7 lat_0=29d40
-x_0=700000 y_0=3000000
-no_defs <>
-
-# <nad83sp4204> texas south central nad83
-<nad83sp4204> proj=lcc  datum=NAD83
-lon_0=-99 lat_1=30d17 lat_2=28d23 lat_0=27d50
-x_0=600000 y_0=4000000
-no_defs <>
-
-# <nad83sp4205> texas south nad83
-<nad83sp4205> proj=lcc  datum=NAD83
-lon_0=-98d30 lat_1=27d50 lat_2=26d10 lat_0=25d40
-x_0=300000 y_0=5000000
-no_defs <>
-
-# <nad83sp4301> utah north nad83
-<nad83sp4301> proj=lcc  datum=NAD83
-lon_0=-111d30 lat_1=41d47 lat_2=40d43 lat_0=40d20
-x_0=500000 y_0=1000000
-no_defs <>
-
-# <nad83sp4302> utah central nad83
-<nad83sp4302> proj=lcc  datum=NAD83
-lon_0=-111d30 lat_1=40d39 lat_2=39d1 lat_0=38d20
-x_0=500000 y_0=2000000
-no_defs <>
-
-# <nad83sp4303> utah south nad83
-<nad83sp4303> proj=lcc  datum=NAD83
-lon_0=-111d30 lat_1=38d21 lat_2=37d13 lat_0=36d40
-x_0=500000 y_0=3000000
-no_defs <>
-
-# <nad83sp4400> vermont --- nad83
-<nad83sp4400> proj=tmerc  datum=NAD83
-lon_0=-72d30 lat_0=42d30 k=.9999642857142857
-x_0=500000 y_0=0
-no_defs <>
-
-# <nad83sp4501> virginia north nad83
-<nad83sp4501> proj=lcc  datum=NAD83
-lon_0=-78d30 lat_1=39d12 lat_2=38d2 lat_0=37d40
-x_0=3500000 y_0=2000000
-no_defs <>
-
-# <nad83sp4502> virginia south nad83
-<nad83sp4502> proj=lcc  datum=NAD83
-lon_0=-78d30 lat_1=37d58 lat_2=36d46 lat_0=36d20
-x_0=3500000 y_0=1000000
-no_defs <>
-
-# <nad83sp4601> washington north nad83
-<nad83sp4601> proj=lcc  datum=NAD83
-lon_0=-120d50 lat_1=48d44 lat_2=47d30 lat_0=47
-x_0=500000 y_0=0
-no_defs <>
-
-# <nad83sp4602> washington south nad83
-<nad83sp4602> proj=lcc  datum=NAD83
-lon_0=-120d30 lat_1=47d20 lat_2=45d50 lat_0=45d20
-x_0=500000 y_0=0
-no_defs <>
-
-# <nad83sp4701> west virginia north nad83
-<nad83sp4701> proj=lcc  datum=NAD83
-lon_0=-79d30 lat_1=40d15 lat_2=39 lat_0=38d30
-x_0=600000 y_0=0
-no_defs <>
-
-# <nad83sp4702> west virginia south nad83
-<nad83sp4702> proj=lcc  datum=NAD83
-lon_0=-81 lat_1=38d53 lat_2=37d29 lat_0=37
-x_0=600000 y_0=0
-no_defs <>
-
-# <nad83sp4801> wisconsin north nad83
-<nad83sp4801> proj=lcc  datum=NAD83
-lon_0=-90 lat_1=46d46 lat_2=45d34 lat_0=45d10
-x_0=600000 y_0=0
-no_defs <>
-
-# <nad83sp4802> wisconsin central nad83
-<nad83sp4802> proj=lcc  datum=NAD83
-lon_0=-90 lat_1=45d30 lat_2=44d15 lat_0=43d50
-x_0=600000 y_0=0
-no_defs <>
-
-# <nad83sp4803> wisconsin south nad83
-<nad83sp4803> proj=lcc  datum=NAD83
-lon_0=-90 lat_1=44d4 lat_2=42d44 lat_0=42
-x_0=600000 y_0=0
-no_defs <>
-
-# <nad83sp4901> wyoming east nad83
-<nad83sp4901> proj=tmerc  datum=NAD83
-lon_0=-105d10 lat_0=40d30 k=.9999375
-x_0=200000 y_0=0
-no_defs <>
-
-# <nad83sp4902> wyoming east central nad83
-<nad83sp4902> proj=tmerc  datum=NAD83
-lon_0=-107d20 lat_0=40d30 k=.9999375
-x_0=400000 y_0=100000
-no_defs <>
-
-# <nad83sp4903> wyoming west central nad83
-<nad83sp4903> proj=tmerc  datum=NAD83
-lon_0=-108d45 lat_0=40d30 k=.9999375
-x_0=600000 y_0=0
-no_defs <>
-
-# <nad83sp4904> wyoming west nad83
-<nad83sp4904> proj=tmerc  datum=NAD83
-lon_0=-110d5 lat_0=40d30 k=.9999375
-x_0=800000 y_0=100000
-no_defs <>
-
-# <nad83sp5001> alaska zone no. 1 nad83
-<nad83sp5001> proj=omerc  datum=NAD83
-k=.9999 lonc=-133d40 lat_0=57 alpha=-36d52'11.6315
-x_0=818676.7344011233 y_0=575097.6888751927
-no_defs <>
-
-# <nad83sp5002> alaska zone no. 2 nad83
-<nad83sp5002> proj=tmerc  datum=NAD83
-lon_0=-142 lat_0=54 k=.9999
-x_0=500000 y_0=0
-no_defs <>
-
-# <nad83sp5003> alaska zone no. 3 nad83
-<nad83sp5003> proj=tmerc  datum=NAD83
-lon_0=-146 lat_0=54 k=.9999
-x_0=500000 y_0=0
-no_defs <>
-
-# <nad83sp5004> alaska zone no. 4 nad83
-<nad83sp5004> proj=tmerc  datum=NAD83
-lon_0=-150 lat_0=54 k=.9999
-x_0=500000 y_0=0
-no_defs <>
-
-# <nad83sp5005> alaska zone no. 5 nad83
-<nad83sp5005> proj=tmerc  datum=NAD83
-lon_0=-154 lat_0=54 k=.9999
-x_0=500000 y_0=0
-no_defs <>
-
-# <nad83sp5006> alaska zone no. 6 nad83
-<nad83sp5006> proj=tmerc  datum=NAD83
-lon_0=-158 lat_0=54 k=.9999
-x_0=500000 y_0=0
-no_defs <>
-
-# <nad83sp5007> alaska zone no. 7 nad83
-<nad83sp5007> proj=tmerc  datum=NAD83
-lon_0=-162 lat_0=54 k=.9999
-x_0=500000 y_0=0
-no_defs <>
-
-# <nad83sp5008> alaska zone no. 8 nad83
-<nad83sp5008> proj=tmerc  datum=NAD83
-lon_0=-166 lat_0=54 k=.9999
-x_0=500000 y_0=0
-no_defs <>
-
-# <nad83sp5009> alaska zone no. 9 nad83
-<nad83sp5009> proj=tmerc  datum=NAD83
-lon_0=-170 lat_0=54 k=.9999
-x_0=500000 y_0=0
-no_defs <>
-
-# <nad83sp5200> puerto rico and virgin islands nad83
-<nad83sp5200> proj=lcc  datum=NAD83
-lon_0=-66d26 lat_1=18d26 lat_2=18d2 lat_0=17d50
-x_0=200000 y_0=200000
-no_defs <>
-
-
-#
-#
-##########################################################
-#
-# Great Lakes Grids using Clarke 1866 ellipsoid
-
-# <erie-etal> Lake Erie, Ontario and St. Lawrence River.
-<erie-etal>
-	proj=omerc ellps=clrk66 k_0=0.9999
-	lonc=78d00'W lat_0=44d00'N alpha=55d40'
-	x_0=-3950000 y_0=-3430000
-	no_defs <>
-# <huron> Lake Huron
-<huron>
-	proj=omerc ellps=clrk66 k_0=0.9999
-	lonc=82d00'W lat_0=43d00'N alpha=350d37'
-	x_0=1200000 y_0=-3500000
-	no_defs <>
-# <michigan> Lake Michigan
-<michigan>
-	proj=omerc ellps=clrk66 k_0=0.9999
-	lonc=87d00'W lat_0=44d00'N alpha=15d00'
-	x_0=-1000000 y_0=-4300000
-	no_defs <>
-# <superior> Lake Superior, Lake of the Woods
-<superior>
-	proj=omerc ellps=clrk66 k_0=0.9999
-	lonc=88d50'0.256"W lat_0=47d12'21.554"N alpha=285d41'42.593"
-	x_0=9000000 y_0=-1600000
-	no_defs <>
-#
-#
-##########################################################
-#
-# EPSG projection definitions
-#
-# HD1909
-<epsg3819> +proj=longlat +ellps=bessel +towgs84=595.48,121.69,515.35,4.115,-2.9383,0.853,-3.408 +no_defs  <>
-# TWD67
-<epsg3821> +proj=longlat +ellps=aust_SA +no_defs  <>
-# TWD97
-<epsg3824> +proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs  <>
-# IGRS
-<epsg3889> +proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs  <>
-# MGI 1901
-<epsg3906> +proj=longlat +ellps=bessel +towgs84=682,-203,480,0,0,0,0 +no_defs  <>
-# Unknown datum based upon the Airy 1830 ellipsoid
-<epsg4001> +proj=longlat +ellps=airy +no_defs  <>
-# Unknown datum based upon the Airy Modified 1849 ellipsoid
-<epsg4002> +proj=longlat +ellps=mod_airy +no_defs  <>
-# Unknown datum based upon the Australian National Spheroid
-<epsg4003> +proj=longlat +ellps=aust_SA +no_defs  <>
-# Unknown datum based upon the Bessel 1841 ellipsoid
-<epsg4004> +proj=longlat +ellps=bessel +no_defs  <>
-# Unknown datum based upon the Bessel Modified ellipsoid
-<epsg4005> +proj=longlat +a=6377492.018 +b=6356173.508712696 +no_defs  <>
-# Unknown datum based upon the Bessel Namibia ellipsoid
-<epsg4006> +proj=longlat +ellps=bess_nam +no_defs  <>
-# Unknown datum based upon the Clarke 1858 ellipsoid
-<epsg4007> +proj=longlat +a=6378293.645208759 +b=6356617.987679838 +no_defs  <>
-# Unknown datum based upon the Clarke 1866 ellipsoid
-<epsg4008> +proj=longlat +ellps=clrk66 +no_defs  <>
-# Unknown datum based upon the Clarke 1866 Michigan ellipsoid
-<epsg4009> +proj=longlat +a=6378450.047548896 +b=6356826.621488444 +no_defs  <>
-# Unknown datum based upon the Clarke 1880 (Benoit) ellipsoid
-<epsg4010> +proj=longlat +a=6378300.789 +b=6356566.435 +no_defs  <>
-# Unknown datum based upon the Clarke 1880 (IGN) ellipsoid
-<epsg4011> +proj=longlat +a=6378249.2 +b=6356515 +no_defs  <>
-# Unknown datum based upon the Clarke 1880 (RGS) ellipsoid
-<epsg4012> +proj=longlat +ellps=clrk80 +no_defs  <>
-# Unknown datum based upon the Clarke 1880 (Arc) ellipsoid
-<epsg4013> +proj=longlat +a=6378249.145 +b=6356514.966398753 +no_defs  <>
-# Unknown datum based upon the Clarke 1880 (SGA 1922) ellipsoid
-<epsg4014> +proj=longlat +a=6378249.2 +b=6356514.996941779 +no_defs  <>
-# Unknown datum based upon the Everest 1830 (1937 Adjustment) ellipsoid
-<epsg4015> +proj=longlat +a=6377276.345 +b=6356075.41314024 +no_defs  <>
-# Unknown datum based upon the Everest 1830 (1967 Definition) ellipsoid
-<epsg4016> +proj=longlat +ellps=evrstSS +no_defs  <>
-# Unknown datum based upon the Everest 1830 Modified ellipsoid
-<epsg4018> +proj=longlat +a=6377304.063 +b=6356103.038993155 +no_defs  <>
-# Unknown datum based upon the GRS 1980 ellipsoid
-<epsg4019> +proj=longlat +ellps=GRS80 +no_defs  <>
-# Unknown datum based upon the Helmert 1906 ellipsoid
-<epsg4020> +proj=longlat +ellps=helmert +no_defs  <>
-# Unknown datum based upon the Indonesian National Spheroid
-<epsg4021> +proj=longlat +a=6378160 +b=6356774.50408554 +no_defs  <>
-# Unknown datum based upon the International 1924 ellipsoid
-<epsg4022> +proj=longlat +ellps=intl +no_defs  <>
-# MOLDREF99
-<epsg4023> +proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs  <>
-# Unknown datum based upon the Krassowsky 1940 ellipsoid
-<epsg4024> +proj=longlat +ellps=krass +no_defs  <>
-# Unknown datum based upon the NWL 9D ellipsoid
-<epsg4025> +proj=longlat +ellps=WGS66 +no_defs  <>
-# Unknown datum based upon the Plessis 1817 ellipsoid
-<epsg4027> +proj=longlat +a=6376523 +b=6355862.933255573 +no_defs  <>
-# Unknown datum based upon the Struve 1860 ellipsoid
-<epsg4028> +proj=longlat +a=6378298.3 +b=6356657.142669561 +no_defs  <>
-# Unknown datum based upon the War Office ellipsoid
-<epsg4029> +proj=longlat +a=6378300 +b=6356751.689189189 +no_defs  <>
-# Unknown datum based upon the WGS 84 ellipsoid
-<epsg4030> +proj=longlat +ellps=WGS84 +no_defs  <>
-# Unknown datum based upon the GEM 10C ellipsoid
-<epsg4031> +proj=longlat +ellps=WGS84 +no_defs  <>
-# Unknown datum based upon the OSU86F ellipsoid
-<epsg4032> +proj=longlat +a=6378136.2 +b=6356751.516927429 +no_defs  <>
-# Unknown datum based upon the OSU91A ellipsoid
-<epsg4033> +proj=longlat +a=6378136.3 +b=6356751.616592146 +no_defs  <>
-# Unknown datum based upon the Clarke 1880 ellipsoid
-<epsg4034> +proj=longlat +a=6378249.144808011 +b=6356514.966204134 +no_defs  <>
-# Unknown datum based upon the Authalic Sphere
-<epsg4035> +proj=longlat +a=6371000 +b=6371000 +no_defs  <>
-# Unknown datum based upon the GRS 1967 ellipsoid
-<epsg4036> +proj=longlat +ellps=GRS67 +no_defs  <>
-# Unknown datum based upon the Average Terrestrial System 1977 ellipsoid
-<epsg4041> +proj=longlat +a=6378135 +b=6356750.304921594 +no_defs  <>
-# Unknown datum based upon the Everest (1830 Definition) ellipsoid
-<epsg4042> +proj=longlat +a=6377299.36559538 +b=6356098.359005156 +no_defs  <>
-# Unknown datum based upon the WGS 72 ellipsoid
-<epsg4043> +proj=longlat +ellps=WGS72 +no_defs  <>
-# Unknown datum based upon the Everest 1830 (1962 Definition) ellipsoid
-<epsg4044> +proj=longlat +a=6377301.243 +b=6356100.230165384 +no_defs  <>
-# Unknown datum based upon the Everest 1830 (1975 Definition) ellipsoid
-<epsg4045> +proj=longlat +a=6377299.151 +b=6356098.145120132 +no_defs  <>
-# RGRDC 2005
-<epsg4046> +proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs  <>
-# Unspecified datum based upon the GRS 1980 Authalic Sphere
-<epsg4047> +proj=longlat +a=6371007 +b=6371007 +no_defs  <>
-# Unspecified datum based upon the Clarke 1866 Authalic Sphere
-<epsg4052> +proj=longlat +a=6370997 +b=6370997 +no_defs  <>
-# Unspecified datum based upon the International 1924 Authalic Sphere
-<epsg4053> +proj=longlat +a=6371228 +b=6371228 +no_defs  <>
-# Unspecified datum based upon the Hughes 1980 ellipsoid
-<epsg4054> +proj=longlat +a=6378273 +b=6356889.449 +no_defs  <>
-# Popular Visualisation CRS
-<epsg4055> +proj=longlat +a=6378137 +b=6378137 +towgs84=0,0,0,0,0,0,0 +no_defs  <>
-# SREF98
-<epsg4075> +proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs  <>
-# REGCAN95
-<epsg4081> +proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs  <>
-# Greek
-<epsg4120> +proj=longlat +ellps=bessel +no_defs  <>
-# GGRS87
-<epsg4121> +proj=longlat +datum=GGRS87 +no_defs  <>
-# ATS77
-<epsg4122> +proj=longlat +a=6378135 +b=6356750.304921594 +no_defs  <>
-# KKJ
-<epsg4123> +proj=longlat +ellps=intl +towgs84=-96.062,-82.428,-121.753,4.801,0.345,-1.376,1.496 +no_defs  <>
-# RT90
-<epsg4124> +proj=longlat +ellps=bessel +towgs84=414.1,41.3,603.1,-0.855,2.141,-7.023,0 +no_defs  <>
-# Samboja
-<epsg4125> +proj=longlat +ellps=bessel +towgs84=-404.78,685.68,45.47,0,0,0,0 +no_defs  <>
-# LKS94 (ETRS89)
-<epsg4126> +proj=longlat +ellps=GRS80 +no_defs  <>
-# Tete
-<epsg4127> +proj=longlat +ellps=clrk66 +towgs84=219.315,168.975,-166.145,0.198,5.926,-2.356,-57.104 +no_defs  <>
-# Madzansua
-<epsg4128> +proj=longlat +ellps=clrk66 +no_defs  <>
-# Observatario
-<epsg4129> +proj=longlat +ellps=clrk66 +no_defs  <>
-# Moznet
-<epsg4130> +proj=longlat +ellps=WGS84 +towgs84=0,0,0,-0,-0,-0,0 +no_defs  <>
-# Indian 1960
-<epsg4131> +proj=longlat +a=6377276.345 +b=6356075.41314024 +towgs84=198,881,317,0,0,0,0 +no_defs  <>
-# FD58
-<epsg4132> +proj=longlat +ellps=clrk80 +towgs84=-239.1,-170.02,397.5,0,0,0,0 +no_defs  <>
-# EST92
-<epsg4133> +proj=longlat +ellps=GRS80 +towgs84=0.055,-0.541,-0.185,0.0183,-0.0003,-0.007,-0.014 +no_defs  <>
-# PSD93
-<epsg4134> +proj=longlat +ellps=clrk80 +towgs84=-180.624,-225.516,173.919,-0.81,-1.898,8.336,16.7101 +no_defs  <>
-# Old Hawaiian
-<epsg4135> +proj=longlat +ellps=clrk66 +towgs84=61,-285,-181,0,0,0,0 +no_defs  <>
-# St. Lawrence Island
-<epsg4136> +proj=longlat +ellps=clrk66 +no_defs  <>
-# St. Paul Island
-<epsg4137> +proj=longlat +ellps=clrk66 +no_defs  <>
-# St. George Island
-<epsg4138> +proj=longlat +ellps=clrk66 +no_defs  <>
-# Puerto Rico
-<epsg4139> +proj=longlat +ellps=clrk66 +towgs84=11,72,-101,0,0,0,0 +no_defs  <>
-# NAD83(CSRS98)
-<epsg4140> +proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs  <>
-# Israel
-<epsg4141> +proj=longlat +ellps=GRS80 +towgs84=-48,55,52,0,0,0,0 +no_defs  <>
-# Locodjo 1965
-<epsg4142> +proj=longlat +ellps=clrk80 +towgs84=-125,53,467,0,0,0,0 +no_defs  <>
-# Abidjan 1987
-<epsg4143> +proj=longlat +ellps=clrk80 +towgs84=-124.76,53,466.79,0,0,0,0 +no_defs  <>
-# Kalianpur 1937
-<epsg4144> +proj=longlat +a=6377276.345 +b=6356075.41314024 +towgs84=282,726,254,0,0,0,0 +no_defs  <>
-# Kalianpur 1962
-<epsg4145> +proj=longlat +a=6377301.243 +b=6356100.230165384 +towgs84=283,682,231,0,0,0,0 +no_defs  <>
-# Kalianpur 1975
-<epsg4146> +proj=longlat +a=6377299.151 +b=6356098.145120132 +towgs84=295,736,257,0,0,0,0 +no_defs  <>
-# Hanoi 1972
-<epsg4147> +proj=longlat +ellps=krass +towgs84=-17.51,-108.32,-62.39,0,0,0,0 +no_defs  <>
-# Hartebeesthoek94
-<epsg4148> +proj=longlat +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +no_defs  <>
-# CH1903
-<epsg4149> +proj=longlat +ellps=bessel +towgs84=674.4,15.1,405.3,0,0,0,0 +no_defs  <>
-# CH1903+
-<epsg4150> +proj=longlat +ellps=bessel +towgs84=674.374,15.056,405.346,0,0,0,0 +no_defs  <>
-# CHTRF95
-<epsg4151> +proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs  <>
-# NAD83(HARN)
-<epsg4152> +proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs  <>
-# Rassadiran
-<epsg4153> +proj=longlat +ellps=intl +towgs84=-133.63,-157.5,-158.62,0,0,0,0 +no_defs  <>
-# ED50(ED77)
-<epsg4154> +proj=longlat +ellps=intl +towgs84=-117,-132,-164,0,0,0,0 +no_defs  <>
-# Dabola 1981
-<epsg4155> +proj=longlat +a=6378249.2 +b=6356515 +towgs84=-83,37,124,0,0,0,0 +no_defs  <>
-# S-JTSK
-<epsg4156> +proj=longlat +ellps=bessel +towgs84=589,76,480,0,0,0,0 +no_defs  <>
-# Mount Dillon
-<epsg4157> +proj=longlat +a=6378293.645208759 +b=6356617.987679838 +no_defs  <>
-# Naparima 1955
-<epsg4158> +proj=longlat +ellps=intl +towgs84=-0.465,372.095,171.736,0,0,0,0 +no_defs  <>
-# ELD79
-<epsg4159> +proj=longlat +ellps=intl +towgs84=-115.854,-99.0583,-152.462,0,0,0,0 +no_defs  <>
-# Chos Malal 1914
-<epsg4160> +proj=longlat +ellps=intl +no_defs  <>
-# Pampa del Castillo
-<epsg4161> +proj=longlat +ellps=intl +towgs84=27.5,14,186.4,0,0,0,0 +no_defs  <>
-# Korean 1985
-<epsg4162> +proj=longlat +ellps=bessel +no_defs  <>
-# Yemen NGN96
-<epsg4163> +proj=longlat +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +no_defs  <>
-# South Yemen
-<epsg4164> +proj=longlat +ellps=krass +towgs84=-76,-138,67,0,0,0,0 +no_defs  <>
-# Bissau
-<epsg4165> +proj=longlat +ellps=intl +towgs84=-173,253,27,0,0,0,0 +no_defs  <>
-# Korean 1995
-<epsg4166> +proj=longlat +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +no_defs  <>
-# NZGD2000
-<epsg4167> +proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs  <>
-# Accra
-<epsg4168> +proj=longlat +a=6378300 +b=6356751.689189189 +towgs84=-199,32,322,0,0,0,0 +no_defs  <>
-# American Samoa 1962
-<epsg4169> +proj=longlat +ellps=clrk66 +towgs84=-115,118,426,0,0,0,0 +no_defs  <>
-# SIRGAS 1995
-<epsg4170> +proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs  <>
-# RGF93
-<epsg4171> +proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs  <>
-# POSGAR
-<epsg4172> +proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs  <>
-# IRENET95
-<epsg4173> +proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs  <>
-# Sierra Leone 1924
-<epsg4174> +proj=longlat +a=6378300 +b=6356751.689189189 +no_defs  <>
-# Sierra Leone 1968
-<epsg4175> +proj=longlat +ellps=clrk80 +towgs84=-88,4,101,0,0,0,0 +no_defs  <>
-# Australian Antarctic
-<epsg4176> +proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs  <>
-# Pulkovo 1942(83)
-<epsg4178> +proj=longlat +ellps=krass +towgs84=26,-121,-78,0,0,0,0 +no_defs  <>
-# Pulkovo 1942(58)
-<epsg4179> +proj=longlat +ellps=krass +towgs84=33.4,-146.6,-76.3,-0.359,-0.053,0.844,-0.84 +no_defs  <>
-# EST97
-<epsg4180> +proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs  <>
-# Luxembourg 1930
-<epsg4181> +proj=longlat +ellps=intl +towgs84=-189.681,18.3463,-42.7695,-0.33746,-3.09264,2.53861,0.4598 +no_defs  <>
-# Azores Occidental 1939
-<epsg4182> +proj=longlat +ellps=intl +towgs84=-425,-169,81,0,0,0,0 +no_defs  <>
-# Azores Central 1948
-<epsg4183> +proj=longlat +ellps=intl +towgs84=-104,167,-38,0,0,0,0 +no_defs  <>
-# Azores Oriental 1940
-<epsg4184> +proj=longlat +ellps=intl +towgs84=-203,141,53,0,0,0,0 +no_defs  <>
-# Madeira 1936
-<epsg4185> +proj=longlat +ellps=intl +no_defs  <>
-# OSNI 1952
-<epsg4188> +proj=longlat +ellps=airy +towgs84=482.5,-130.6,564.6,-1.042,-0.214,-0.631,8.15 +no_defs  <>
-# REGVEN
-<epsg4189> +proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs  <>
-# POSGAR 98
-<epsg4190> +proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs  <>
-# Albanian 1987
-<epsg4191> +proj=longlat +ellps=krass +no_defs  <>
-# Douala 1948
-<epsg4192> +proj=longlat +ellps=intl +towgs84=-206.1,-174.7,-87.7,0,0,0,0 +no_defs  <>
-# Manoca 1962
-<epsg4193> +proj=longlat +a=6378249.2 +b=6356515 +towgs84=-70.9,-151.8,-41.4,0,0,0,0 +no_defs  <>
-# Qornoq 1927
-<epsg4194> +proj=longlat +ellps=intl +towgs84=164,138,-189,0,0,0,0 +no_defs  <>
-# Scoresbysund 1952
-<epsg4195> +proj=longlat +ellps=intl +towgs84=105,326,-102.5,0,0,0.814,-0.6 +no_defs  <>
-# Ammassalik 1958
-<epsg4196> +proj=longlat +ellps=intl +towgs84=-45,417,-3.5,0,0,0.814,-0.6 +no_defs  <>
-# Garoua
-<epsg4197> +proj=longlat +ellps=clrk80 +no_defs  <>
-# Kousseri
-<epsg4198> +proj=longlat +ellps=clrk80 +no_defs  <>
-# Egypt 1930
-<epsg4199> +proj=longlat +ellps=intl +no_defs  <>
-# Pulkovo 1995
-<epsg4200> +proj=longlat +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +no_defs  <>
-# Adindan
-<epsg4201> +proj=longlat +ellps=clrk80 +towgs84=-166,-15,204,0,0,0,0 +no_defs  <>
-# AGD66
-<epsg4202> +proj=longlat +ellps=aust_SA +towgs84=-117.808,-51.536,137.784,0.303,0.446,0.234,-0.29 +no_defs  <>
-# AGD84
-<epsg4203> +proj=longlat +ellps=aust_SA +towgs84=-134,-48,149,0,0,0,0 +no_defs  <>
-# Ain el Abd
-<epsg4204> +proj=longlat +ellps=intl +towgs84=-143,-236,7,0,0,0,0 +no_defs  <>
-# Afgooye
-<epsg4205> +proj=longlat +ellps=krass +towgs84=-43,-163,45,0,0,0,0 +no_defs  <>
-# Agadez
-<epsg4206> +proj=longlat +a=6378249.2 +b=6356515 +no_defs  <>
-# Lisbon
-<epsg4207> +proj=longlat +ellps=intl +towgs84=-304.046,-60.576,103.64,0,0,0,0 +no_defs  <>
-# Aratu
-<epsg4208> +proj=longlat +ellps=intl +towgs84=-151.99,287.04,-147.45,0,0,0,0 +no_defs  <>
-# Arc 1950
-<epsg4209> +proj=longlat +a=6378249.145 +b=6356514.966398753 +towgs84=-143,-90,-294,0,0,0,0 +no_defs  <>
-# Arc 1960
-<epsg4210> +proj=longlat +ellps=clrk80 +towgs84=-160,-6,-302,0,0,0,0 +no_defs  <>
-# Batavia
-<epsg4211> +proj=longlat +ellps=bessel +towgs84=-377,681,-50,0,0,0,0 +no_defs  <>
-# Barbados 1938
-<epsg4212> +proj=longlat +ellps=clrk80 +towgs84=31.95,300.99,419.19,0,0,0,0 +no_defs  <>
-# Beduaram
-<epsg4213> +proj=longlat +a=6378249.2 +b=6356515 +towgs84=-106,-87,188,0,0,0,0 +no_defs  <>
-# Beijing 1954
-<epsg4214> +proj=longlat +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +no_defs  <>
-# Belge 1950
-<epsg4215> +proj=longlat +ellps=intl +no_defs  <>
-# Bermuda 1957
-<epsg4216> +proj=longlat +ellps=clrk66 +towgs84=-73,213,296,0,0,0,0 +no_defs  <>
-# Bogota 1975
-<epsg4218> +proj=longlat +ellps=intl +towgs84=307,304,-318,0,0,0,0 +no_defs  <>
-# Bukit Rimpah
-<epsg4219> +proj=longlat +ellps=bessel +towgs84=-384,664,-48,0,0,0,0 +no_defs  <>
-# Camacupa
-<epsg4220> +proj=longlat +ellps=clrk80 +towgs84=-50.9,-347.6,-231,0,0,0,0 +no_defs  <>
-# Campo Inchauspe
-<epsg4221> +proj=longlat +ellps=intl +towgs84=-148,136,90,0,0,0,0 +no_defs  <>
-# Cape
-<epsg4222> +proj=longlat +a=6378249.145 +b=6356514.966398753 +towgs84=-136,-108,-292,0,0,0,0 +no_defs  <>
-# Carthage
-<epsg4223> +proj=longlat +datum=carthage +no_defs  <>
-# Chua
-<epsg4224> +proj=longlat +ellps=intl +towgs84=-134,229,-29,0,0,0,0 +no_defs  <>
-# Corrego Alegre 1970-72
-<epsg4225> +proj=longlat +ellps=intl +towgs84=-206,172,-6,0,0,0,0 +no_defs  <>
-# Cote d'Ivoire
-<epsg4226> +proj=longlat +a=6378249.2 +b=6356515 +no_defs  <>
-# Deir ez Zor
-<epsg4227> +proj=longlat +a=6378249.2 +b=6356515 +towgs84=-190.421,8.532,238.69,0,0,0,0 +no_defs  <>
-# Douala
-<epsg4228> +proj=longlat +a=6378249.2 +b=6356515 +no_defs  <>
-# Egypt 1907
-<epsg4229> +proj=longlat +ellps=helmert +towgs84=-130,110,-13,0,0,0,0 +no_defs  <>
-# ED50
-<epsg4230> +proj=longlat +ellps=intl +towgs84=-87,-98,-121,0,0,0,0 +no_defs  <>
-# ED87
-<epsg4231> +proj=longlat +ellps=intl +towgs84=-83.11,-97.38,-117.22,0.00569291,-0.0446976,0.0442851,0.1218 +no_defs  <>
-# Fahud
-<epsg4232> +proj=longlat +ellps=clrk80 +towgs84=-346,-1,224,0,0,0,0 +no_defs  <>
-# Gandajika 1970
-<epsg4233> +proj=longlat +ellps=intl +towgs84=-133,-321,50,0,0,0,0 +no_defs  <>
-# Garoua
-<epsg4234> +proj=longlat +a=6378249.2 +b=6356515 +no_defs  <>
-# Guyane Francaise
-<epsg4235> +proj=longlat +ellps=intl +no_defs  <>
-# Hu Tzu Shan 1950
-<epsg4236> +proj=longlat +ellps=intl +towgs84=-637,-549,-203,0,0,0,0 +no_defs  <>
-# HD72
-<epsg4237> +proj=longlat +ellps=GRS67 +towgs84=52.17,-71.82,-14.9,0,0,0,0 +no_defs  <>
-# ID74
-<epsg4238> +proj=longlat +a=6378160 +b=6356774.50408554 +towgs84=-24,-15,5,0,0,0,0 +no_defs  <>
-# Indian 1954
-<epsg4239> +proj=longlat +a=6377276.345 +b=6356075.41314024 +towgs84=217,823,299,0,0,0,0 +no_defs  <>
-# Indian 1975
-<epsg4240> +proj=longlat +a=6377276.345 +b=6356075.41314024 +towgs84=210,814,289,0,0,0,0 +no_defs  <>
-# Jamaica 1875
-<epsg4241> +proj=longlat +a=6378249.144808011 +b=6356514.966204134 +no_defs  <>
-# JAD69
-<epsg4242> +proj=longlat +ellps=clrk66 +towgs84=70,207,389.5,0,0,0,0 +no_defs  <>
-# Kalianpur 1880
-<epsg4243> +proj=longlat +a=6377299.36559538 +b=6356098.359005156 +no_defs  <>
-# Kandawala
-<epsg4244> +proj=longlat +a=6377276.345 +b=6356075.41314024 +towgs84=-97,787,86,0,0,0,0 +no_defs  <>
-# Kertau 1968
-<epsg4245> +proj=longlat +a=6377304.063 +b=6356103.038993155 +towgs84=-11,851,5,0,0,0,0 +no_defs  <>
-# KOC
-<epsg4246> +proj=longlat +ellps=clrk80 +towgs84=-294.7,-200.1,525.5,0,0,0,0 +no_defs  <>
-# La Canoa
-<epsg4247> +proj=longlat +ellps=intl +towgs84=-273.5,110.6,-357.9,0,0,0,0 +no_defs  <>
-# PSAD56
-<epsg4248> +proj=longlat +ellps=intl +towgs84=-288,175,-376,0,0,0,0 +no_defs  <>
-# Lake
-<epsg4249> +proj=longlat +ellps=intl +no_defs  <>
-# Leigon
-<epsg4250> +proj=longlat +ellps=clrk80 +towgs84=-130,29,364,0,0,0,0 +no_defs  <>
-# Liberia 1964
-<epsg4251> +proj=longlat +ellps=clrk80 +towgs84=-90,40,88,0,0,0,0 +no_defs  <>
-# Lome
-<epsg4252> +proj=longlat +a=6378249.2 +b=6356515 +no_defs  <>
-# Luzon 1911
-<epsg4253> +proj=longlat +ellps=clrk66 +towgs84=-133,-77,-51,0,0,0,0 +no_defs  <>
-# Hito XVIII 1963
-<epsg4254> +proj=longlat +ellps=intl +towgs84=16,196,93,0,0,0,0 +no_defs  <>
-# Herat North
-<epsg4255> +proj=longlat +ellps=intl +towgs84=-333,-222,114,0,0,0,0 +no_defs  <>
-# Mahe 1971
-<epsg4256> +proj=longlat +ellps=clrk80 +towgs84=41,-220,-134,0,0,0,0 +no_defs  <>
-# Makassar
-<epsg4257> +proj=longlat +ellps=bessel +towgs84=-587.8,519.75,145.76,0,0,0,0 +no_defs  <>
-# ETRS89
-<epsg4258> +proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs  <>
-# Malongo 1987
-<epsg4259> +proj=longlat +ellps=intl +towgs84=-254.1,-5.36,-100.29,0,0,0,0 +no_defs  <>
-# Manoca
-<epsg4260> +proj=longlat +ellps=clrk80 +towgs84=-70.9,-151.8,-41.4,0,0,0,0 +no_defs  <>
-# Merchich
-<epsg4261> +proj=longlat +a=6378249.2 +b=6356515 +towgs84=31,146,47,0,0,0,0 +no_defs  <>
-# Massawa
-<epsg4262> +proj=longlat +ellps=bessel +towgs84=639,405,60,0,0,0,0 +no_defs  <>
-# Minna
-<epsg4263> +proj=longlat +ellps=clrk80 +towgs84=-92,-93,122,0,0,0,0 +no_defs  <>
-# Mhast
-<epsg4264> +proj=longlat +ellps=intl +towgs84=-252.95,-4.11,-96.38,0,0,0,0 +no_defs  <>
-# Monte Mario
-<epsg4265> +proj=longlat +ellps=intl +towgs84=-104.1,-49.1,-9.9,0.971,-2.917,0.714,-11.68 +no_defs  <>
-# M'poraloko
-<epsg4266> +proj=longlat +a=6378249.2 +b=6356515 +towgs84=-74,-130,42,0,0,0,0 +no_defs  <>
-# NAD27
-<epsg4267> +proj=longlat +datum=NAD27 +no_defs  <>
-# NAD27 Michigan
-<epsg4268> +proj=longlat +a=6378450.047548896 +b=6356826.621488444 +no_defs  <>
-# NAD83
-<epsg4269> +proj=longlat +datum=NAD83 +no_defs  <>
-# Nahrwan 1967
-<epsg4270> +proj=longlat +ellps=clrk80 +towgs84=-243,-192,477,0,0,0,0 +no_defs  <>
-# Naparima 1972
-<epsg4271> +proj=longlat +ellps=intl +towgs84=-10,375,165,0,0,0,0 +no_defs  <>
-# NZGD49
-<epsg4272> +proj=longlat +datum=nzgd49 +no_defs  <>
-# NGO 1948
-<epsg4273> +proj=longlat +a=6377492.018 +b=6356173.508712696 +towgs84=278.3,93,474.5,7.889,0.05,-6.61,6.21 +no_defs  <>
-# Datum 73
-<epsg4274> +proj=longlat +ellps=intl +towgs84=-223.237,110.193,36.649,0,0,0,0 +no_defs  <>
-# NTF
-<epsg4275> +proj=longlat +a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 +no_defs  <>
-# NSWC 9Z-2
-<epsg4276> +proj=longlat +ellps=WGS66 +no_defs  <>
-# OSGB 1936
-<epsg4277> +proj=longlat +datum=OSGB36 +no_defs  <>
-# OSGB70
-<epsg4278> +proj=longlat +ellps=airy +no_defs  <>
-# OS(SN)80
-<epsg4279> +proj=longlat +ellps=airy +no_defs  <>
-# Padang
-<epsg4280> +proj=longlat +ellps=bessel +no_defs  <>
-# Palestine 1923
-<epsg4281> +proj=longlat +a=6378300.789 +b=6356566.435 +towgs84=-275.722,94.7824,340.894,-8.001,-4.42,-11.821,1 +no_defs  <>
-# Pointe Noire
-<epsg4282> +proj=longlat +a=6378249.2 +b=6356515 +towgs84=-148,51,-291,0,0,0,0 +no_defs  <>
-# GDA94
-<epsg4283> +proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs  <>
-# Pulkovo 1942
-<epsg4284> +proj=longlat +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +no_defs  <>
-# Qatar 1974
-<epsg4285> +proj=longlat +ellps=intl +towgs84=-128.16,-282.42,21.93,0,0,0,0 +no_defs  <>
-# Qatar 1948
-<epsg4286> +proj=longlat +ellps=helmert +no_defs  <>
-# Qornoq
-<epsg4287> +proj=longlat +ellps=intl +towgs84=164,138,-189,0,0,0,0 +no_defs  <>
-# Loma Quintana
-<epsg4288> +proj=longlat +ellps=intl +no_defs  <>
-# Amersfoort
-<epsg4289> +proj=longlat +ellps=bessel +towgs84=565.417,50.3319,465.552,-0.398957,0.343988,-1.8774,4.0725 +no_defs  <>
-# SAD69
-<epsg4291> +proj=longlat +ellps=GRS67 +towgs84=-57,1,-41,0,0,0,0 +no_defs  <>
-# Sapper Hill 1943
-<epsg4292> +proj=longlat +ellps=intl +towgs84=-355,21,72,0,0,0,0 +no_defs  <>
-# Schwarzeck
-<epsg4293> +proj=longlat +ellps=bess_nam +towgs84=616,97,-251,0,0,0,0 +no_defs  <>
-# Segora
-<epsg4294> +proj=longlat +ellps=bessel +towgs84=-403,684,41,0,0,0,0 +no_defs  <>
-# Serindung
-<epsg4295> +proj=longlat +ellps=bessel +no_defs  <>
-# Sudan
-<epsg4296> +proj=longlat +a=6378249.2 +b=6356515 +no_defs  <>
-# Tananarive
-<epsg4297> +proj=longlat +ellps=intl +towgs84=-189,-242,-91,0,0,0,0 +no_defs  <>
-# Timbalai 1948
-<epsg4298> +proj=longlat +ellps=evrstSS +towgs84=-533.4,669.2,-52.5,0,0,4.28,9.4 +no_defs  <>
-# TM65
-<epsg4299> +proj=longlat +datum=ire65 +no_defs  <>
-# TM75
-<epsg4300> +proj=longlat +ellps=mod_airy +towgs84=482.5,-130.6,564.6,-1.042,-0.214,-0.631,8.15 +no_defs  <>
-# Tokyo
-<epsg4301> +proj=longlat +ellps=bessel +towgs84=-146.414,507.337,680.507,0,0,0,0 +no_defs  <>
-# Trinidad 1903
-<epsg4302> +proj=longlat +a=6378293.645208759 +b=6356617.987679838 +towgs84=-61.702,284.488,472.052,0,0,0,0 +no_defs  <>
-# TC(1948)
-<epsg4303> +proj=longlat +ellps=helmert +no_defs  <>
-# Voirol 1875
-<epsg4304> +proj=longlat +a=6378249.2 +b=6356515 +towgs84=-73,-247,227,0,0,0,0 +no_defs  <>
-# Bern 1938
-<epsg4306> +proj=longlat +ellps=bessel +no_defs  <>
-# Nord Sahara 1959
-<epsg4307> +proj=longlat +ellps=clrk80 +towgs84=-186,-93,310,0,0,0,0 +no_defs  <>
-# RT38
-<epsg4308> +proj=longlat +ellps=bessel +no_defs  <>
-# Yacare
-<epsg4309> +proj=longlat +ellps=intl +towgs84=-155,171,37,0,0,0,0 +no_defs  <>
-# Yoff
-<epsg4310> +proj=longlat +a=6378249.2 +b=6356515 +no_defs  <>
-# Zanderij
-<epsg4311> +proj=longlat +ellps=intl +towgs84=-265,120,-358,0,0,0,0 +no_defs  <>
-# MGI
-<epsg4312> +proj=longlat +datum=hermannskogel +no_defs  <>
-# Belge 1972
-<epsg4313> +proj=longlat +ellps=intl +towgs84=-106.869,52.2978,-103.724,0.3366,-0.457,1.8422,-1.2747 +no_defs  <>
-# DHDN
-<epsg4314> +proj=longlat +datum=potsdam +no_defs  <>
-# Conakry 1905
-<epsg4315> +proj=longlat +a=6378249.2 +b=6356515 +towgs84=-23,259,-9,0,0,0,0 +no_defs  <>
-# Dealul Piscului 1930
-<epsg4316> +proj=longlat +ellps=intl +towgs84=103.25,-100.4,-307.19,0,0,0,0 +no_defs  <>
-# Dealul Piscului 1970
-<epsg4317> +proj=longlat +ellps=krass +towgs84=28,-121,-77,0,0,0,0 +no_defs  <>
-# NGN
-<epsg4318> +proj=longlat +ellps=WGS84 +towgs84=-3.2,-5.7,2.8,0,0,0,0 +no_defs  <>
-# KUDAMS
-<epsg4319> +proj=longlat +ellps=GRS80 +towgs84=-20.8,11.3,2.4,0,0,0,0 +no_defs  <>
-# WGS 72
-<epsg4322> +proj=longlat +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +no_defs  <>
-# WGS 72BE
-<epsg4324> +proj=longlat +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +no_defs  <>
-# WGS 84
-<epsg4326> +proj=longlat +datum=WGS84 +no_defs  <>
-# RGSPM06
-<epsg4463> +proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs  <>
-# RGM04
-<epsg4470> +proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs  <>
-# Cadastre 1997
-<epsg4475> +proj=longlat +ellps=intl +towgs84=-381.788,-57.501,-256.673,0,0,0,0 +no_defs  <>
-# Mexican Datum of 1993
-<epsg4483> +proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs  <>
-# China Geodetic Coordinate System 2000
-<epsg4490> +proj=longlat +ellps=GRS80 +no_defs  <>
-# New Beijing
-<epsg4555> +proj=longlat +ellps=krass +no_defs  <>
-# RRAF 1991
-<epsg4558> +proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs  <>
-# Anguilla 1957
-<epsg4600> +proj=longlat +ellps=clrk80 +no_defs  <>
-# Antigua 1943
-<epsg4601> +proj=longlat +ellps=clrk80 +towgs84=-255,-15,71,0,0,0,0 +no_defs  <>
-# Dominica 1945
-<epsg4602> +proj=longlat +ellps=clrk80 +towgs84=725,685,536,0,0,0,0 +no_defs  <>
-# Grenada 1953
-<epsg4603> +proj=longlat +ellps=clrk80 +towgs84=72,213.7,93,0,0,0,0 +no_defs  <>
-# Montserrat 1958
-<epsg4604> +proj=longlat +ellps=clrk80 +towgs84=174,359,365,0,0,0,0 +no_defs  <>
-# St. Kitts 1955
-<epsg4605> +proj=longlat +ellps=clrk80 +towgs84=9,183,236,0,0,0,0 +no_defs  <>
-# St. Lucia 1955
-<epsg4606> +proj=longlat +ellps=clrk80 +towgs84=-149,128,296,0,0,0,0 +no_defs  <>
-# St. Vincent 1945
-<epsg4607> +proj=longlat +ellps=clrk80 +towgs84=195.671,332.517,274.607,0,0,0,0 +no_defs  <>
-# NAD27(76)
-<epsg4608> +proj=longlat +ellps=clrk66 +no_defs  <>
-# NAD27(CGQ77)
-<epsg4609> +proj=longlat +ellps=clrk66 +no_defs  <>
-# Xian 1980
-<epsg4610> +proj=longlat +a=6378140 +b=6356755.288157528 +no_defs  <>
-# Hong Kong 1980
-<epsg4611> +proj=longlat +ellps=intl +towgs84=-162.619,-276.959,-161.764,0.067753,-2.24365,-1.15883,-1.09425 +no_defs  <>
-# JGD2000
-<epsg4612> +proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs  <>
-# Segara
-<epsg4613> +proj=longlat +ellps=bessel +towgs84=-403,684,41,0,0,0,0 +no_defs  <>
-# QND95
-<epsg4614> +proj=longlat +ellps=intl +towgs84=-119.425,-303.659,-11.0006,1.1643,0.174458,1.09626,3.65706 +no_defs  <>
-# Porto Santo
-<epsg4615> +proj=longlat +ellps=intl +towgs84=-499,-249,314,0,0,0,0 +no_defs  <>
-# Selvagem Grande
-<epsg4616> +proj=longlat +ellps=intl +towgs84=-289,-124,60,0,0,0,0 +no_defs  <>
-# NAD83(CSRS)
-<epsg4617> +proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs  <>
-# SAD69
-<epsg4618> +proj=longlat +ellps=aust_SA +towgs84=-57,1,-41,0,0,0,0 +no_defs  <>
-# SWEREF99
-<epsg4619> +proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs  <>
-# Point 58
-<epsg4620> +proj=longlat +ellps=clrk80 +towgs84=-106,-129,165,0,0,0,0 +no_defs  <>
-# Fort Marigot
-<epsg4621> +proj=longlat +ellps=intl +towgs84=137,248,-430,0,0,0,0 +no_defs  <>
-# Guadeloupe 1948
-<epsg4622> +proj=longlat +ellps=intl +towgs84=-467,-16,-300,0,0,0,0 +no_defs  <>
-# CSG67
-<epsg4623> +proj=longlat +ellps=intl +towgs84=-186,230,110,0,0,0,0 +no_defs  <>
-# RGFG95
-<epsg4624> +proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs  <>
-# Martinique 1938
-<epsg4625> +proj=longlat +ellps=intl +towgs84=186,482,151,0,0,0,0 +no_defs  <>
-# Reunion 1947
-<epsg4626> +proj=longlat +ellps=intl +towgs84=94,-948,-1262,0,0,0,0 +no_defs  <>
-# RGR92
-<epsg4627> +proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs  <>
-# Tahiti 52
-<epsg4628> +proj=longlat +ellps=intl +towgs84=162,117,154,0,0,0,0 +no_defs  <>
-# Tahaa 54
-<epsg4629> +proj=longlat +ellps=intl +towgs84=72.438,345.918,79.486,1.6045,0.8823,0.5565,1.3746 +no_defs  <>
-# IGN72 Nuku Hiva
-<epsg4630> +proj=longlat +ellps=intl +towgs84=84,274,65,0,0,0,0 +no_defs  <>
-# K0 1949
-<epsg4631> +proj=longlat +ellps=intl +towgs84=145,-187,103,0,0,0,0 +no_defs  <>
-# Combani 1950
-<epsg4632> +proj=longlat +ellps=intl +towgs84=-382,-59,-262,0,0,0,0 +no_defs  <>
-# IGN56 Lifou
-<epsg4633> +proj=longlat +ellps=intl +towgs84=335.47,222.58,-230.94,0,0,0,0 +no_defs  <>
-# IGN72 Grand Terre
-<epsg4634> +proj=longlat +ellps=intl +towgs84=-13,-348,292,0,0,0,0 +no_defs  <>
-# ST87 Ouvea
-<epsg4635> +proj=longlat +ellps=intl +towgs84=-122.383,-188.696,103.344,3.5107,-4.9668,-5.7047,4.4798 +no_defs  <>
-# Petrels 1972
-<epsg4636> +proj=longlat +ellps=intl +towgs84=365,194,166,0,0,0,0 +no_defs  <>
-# Perroud 1950
-<epsg4637> +proj=longlat +ellps=intl +towgs84=325,154,172,0,0,0,0 +no_defs  <>
-# Saint Pierre et Miquelon 1950
-<epsg4638> +proj=longlat +ellps=clrk66 +towgs84=30,430,368,0,0,0,0 +no_defs  <>
-# MOP78
-<epsg4639> +proj=longlat +ellps=intl +towgs84=253,-132,-127,0,0,0,0 +no_defs  <>
-# RRAF 1991
-<epsg4640> +proj=longlat +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +no_defs  <>
-# IGN53 Mare
-<epsg4641> +proj=longlat +ellps=intl +towgs84=287.58,177.78,-135.41,0,0,0,0 +no_defs  <>
-# ST84 Ile des Pins
-<epsg4642> +proj=longlat +ellps=intl +towgs84=-13,-348,292,0,0,0,0 +no_defs  <>
-# ST71 Belep
-<epsg4643> +proj=longlat +ellps=intl +towgs84=-480.26,-438.32,-643.429,16.3119,20.1721,-4.0349,-111.7 +no_defs  <>
-# NEA74 Noumea
-<epsg4644> +proj=longlat +ellps=intl +towgs84=-10.18,-350.43,291.37,0,0,0,0 +no_defs  <>
-# RGNC 1991
-<epsg4645> +proj=longlat +ellps=intl +towgs84=0,0,0,0,0,0,0 +no_defs  <>
-# Grand Comoros
-<epsg4646> +proj=longlat +ellps=intl +towgs84=-963,510,-359,0,0,0,0 +no_defs  <>
-# Reykjavik 1900
-<epsg4657> +proj=longlat +a=6377019.27 +b=6355762.5391 +towgs84=-28,199,5,0,0,0,0 +no_defs  <>
-# Hjorsey 1955
-<epsg4658> +proj=longlat +ellps=intl +towgs84=-73,46,-86,0,0,0,0 +no_defs  <>
-# ISN93
-<epsg4659> +proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs  <>
-# Helle 1954
-<epsg4660> +proj=longlat +ellps=intl +towgs84=982.609,552.753,-540.873,6.68163,-31.6115,-19.8482,16.805 +no_defs  <>
-# LKS92
-<epsg4661> +proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs  <>
-# IGN72 Grande Terre
-<epsg4662> +proj=longlat +ellps=intl +towgs84=-11.64,-348.6,291.98,0,0,0,0 +no_defs  <>
-# Porto Santo 1995
-<epsg4663> +proj=longlat +ellps=intl +towgs84=-502.862,-247.438,312.724,0,0,0,0 +no_defs  <>
-# Azores Oriental 1995
-<epsg4664> +proj=longlat +ellps=intl +towgs84=-204.619,140.176,55.226,0,0,0,0 +no_defs  <>
-# Azores Central 1995
-<epsg4665> +proj=longlat +ellps=intl +towgs84=-106.226,166.366,-37.893,0,0,0,0 +no_defs  <>
-# Lisbon 1890
-<epsg4666> +proj=longlat +ellps=bessel +towgs84=508.088,-191.042,565.223,0,0,0,0 +no_defs  <>
-# IKBD-92
-<epsg4667> +proj=longlat +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +no_defs  <>
-# ED79
-<epsg4668> +proj=longlat +ellps=intl +towgs84=-86,-98,-119,0,0,0,0 +no_defs  <>
-# LKS94
-<epsg4669> +proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs  <>
-# IGM95
-<epsg4670> +proj=longlat +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +no_defs  <>
-# Voirol 1879
-<epsg4671> +proj=longlat +a=6378249.2 +b=6356515 +no_defs  <>
-# Chatham Islands 1971
-<epsg4672> +proj=longlat +ellps=intl +towgs84=175,-38,113,0,0,0,0 +no_defs  <>
-# Chatham Islands 1979
-<epsg4673> +proj=longlat +ellps=intl +towgs84=174.05,-25.49,112.57,-0,-0,0.554,0.2263 +no_defs  <>
-# SIRGAS 2000
-<epsg4674> +proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs  <>
-# Guam 1963
-<epsg4675> +proj=longlat +ellps=clrk66 +towgs84=-100,-248,259,0,0,0,0 +no_defs  <>
-# Vientiane 1982
-<epsg4676> +proj=longlat +ellps=krass +no_defs  <>
-# Lao 1993
-<epsg4677> +proj=longlat +ellps=krass +no_defs  <>
-# Lao 1997
-<epsg4678> +proj=longlat +ellps=krass +towgs84=44.585,-131.212,-39.544,0,0,0,0 +no_defs  <>
-# Jouik 1961
-<epsg4679> +proj=longlat +ellps=clrk80 +towgs84=-80.01,253.26,291.19,0,0,0,0 +no_defs  <>
-# Nouakchott 1965
-<epsg4680> +proj=longlat +ellps=clrk80 +towgs84=124.5,-63.5,-281,0,0,0,0 +no_defs  <>
-# Mauritania 1999
-<epsg4681> +proj=longlat +ellps=clrk80 +no_defs  <>
-# Gulshan 303
-<epsg4682> +proj=longlat +a=6377276.345 +b=6356075.41314024 +towgs84=283.7,735.9,261.1,0,0,0,0 +no_defs  <>
-# PRS92
-<epsg4683> +proj=longlat +ellps=clrk66 +towgs84=-127.62,-67.24,-47.04,-3.068,4.903,1.578,-1.06 +no_defs  <>
-# Gan 1970
-<epsg4684> +proj=longlat +ellps=intl +towgs84=-133,-321,50,0,0,0,0 +no_defs  <>
-# Gandajika
-<epsg4685> +proj=longlat +ellps=intl +no_defs  <>
-# MAGNA-SIRGAS
-<epsg4686> +proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs  <>
-# RGPF
-<epsg4687> +proj=longlat +ellps=GRS80 +towgs84=0.072,-0.507,-0.245,-0.0183,0.0003,-0.007,-0.0093 +no_defs  <>
-# Fatu Iva 72
-<epsg4688> +proj=longlat +ellps=intl +towgs84=347.103,1078.12,2623.92,-33.8875,70.6773,-9.3943,186.074 +no_defs  <>
-# IGN63 Hiva Oa
-<epsg4689> +proj=longlat +ellps=intl +towgs84=410.721,55.049,80.746,2.5779,2.3514,0.6664,17.3311 +no_defs  <>
-# Tahiti 79
-<epsg4690> +proj=longlat +ellps=intl +towgs84=221.525,152.948,176.768,-2.3847,-1.3896,-0.877,11.4741 +no_defs  <>
-# Moorea 87
-<epsg4691> +proj=longlat +ellps=intl +towgs84=215.525,149.593,176.229,-3.2624,-1.692,-1.1571,10.4773 +no_defs  <>
-# Maupiti 83
-<epsg4692> +proj=longlat +ellps=intl +towgs84=217.037,86.959,23.956,0,0,0,0 +no_defs  <>
-# Nakhl-e Ghanem
-<epsg4693> +proj=longlat +ellps=WGS84 +towgs84=0,-0.15,0.68,0,0,0,0 +no_defs  <>
-# POSGAR 94
-<epsg4694> +proj=longlat +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +no_defs  <>
-# Katanga 1955
-<epsg4695> +proj=longlat +ellps=clrk66 +towgs84=-103.746,-9.614,-255.95,0,0,0,0 +no_defs  <>
-# Kasai 1953
-<epsg4696> +proj=longlat +ellps=clrk80 +no_defs  <>
-# IGC 1962 6th Parallel South
-<epsg4697> +proj=longlat +ellps=clrk80 +no_defs  <>
-# IGN 1962 Kerguelen
-<epsg4698> +proj=longlat +ellps=intl +towgs84=145,-187,103,0,0,0,0 +no_defs  <>
-# Le Pouce 1934
-<epsg4699> +proj=longlat +ellps=clrk80 +towgs84=-770.1,158.4,-498.2,0,0,0,0 +no_defs  <>
-# IGN Astro 1960
-<epsg4700> +proj=longlat +ellps=clrk80 +no_defs  <>
-# IGCB 1955
-<epsg4701> +proj=longlat +ellps=clrk80 +towgs84=-79.9,-158,-168.9,0,0,0,0 +no_defs  <>
-# Mauritania 1999
-<epsg4702> +proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs  <>
-# Mhast 1951
-<epsg4703> +proj=longlat +ellps=clrk80 +no_defs  <>
-# Mhast (onshore)
-<epsg4704> +proj=longlat +ellps=intl +no_defs  <>
-# Mhast (offshore)
-<epsg4705> +proj=longlat +ellps=intl +no_defs  <>
-# Egypt Gulf of Suez S-650 TL
-<epsg4706> +proj=longlat +ellps=helmert +towgs84=-146.21,112.63,4.05,0,0,0,0 +no_defs  <>
-# Tern Island 1961
-<epsg4707> +proj=longlat +ellps=intl +towgs84=114,-116,-333,0,0,0,0 +no_defs  <>
-# Cocos Islands 1965
-<epsg4708> +proj=longlat +ellps=aust_SA +towgs84=-491,-22,435,0,0,0,0 +no_defs  <>
-# Iwo Jima 1945
-<epsg4709> +proj=longlat +ellps=intl +towgs84=145,75,-272,0,0,0,0 +no_defs  <>
-# St. Helena 1971
-<epsg4710> +proj=longlat +ellps=intl +towgs84=-320,550,-494,0,0,0,0 +no_defs  <>
-# Marcus Island 1952
-<epsg4711> +proj=longlat +ellps=intl +towgs84=124,-234,-25,0,0,0,0 +no_defs  <>
-# Ascension Island 1958
-<epsg4712> +proj=longlat +ellps=intl +towgs84=-205,107,53,0,0,0,0 +no_defs  <>
-# Ayabelle Lighthouse
-<epsg4713> +proj=longlat +ellps=clrk80 +towgs84=-79,-129,145,0,0,0,0 +no_defs  <>
-# Bellevue
-<epsg4714> +proj=longlat +ellps=intl +towgs84=-127,-769,472,0,0,0,0 +no_defs  <>
-# Camp Area Astro
-<epsg4715> +proj=longlat +ellps=intl +towgs84=-104,-129,239,0,0,0,0 +no_defs  <>
-# Phoenix Islands 1966
-<epsg4716> +proj=longlat +ellps=intl +towgs84=298,-304,-375,0,0,0,0 +no_defs  <>
-# Cape Canaveral
-<epsg4717> +proj=longlat +ellps=clrk66 +towgs84=-2,151,181,0,0,0,0 +no_defs  <>
-# Solomon 1968
-<epsg4718> +proj=longlat +ellps=intl +towgs84=252,-209,-751,0,0,0,0 +no_defs  <>
-# Easter Island 1967
-<epsg4719> +proj=longlat +ellps=intl +towgs84=211,147,111,0,0,0,0 +no_defs  <>
-# Fiji 1986
-<epsg4720> +proj=longlat +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +no_defs  <>
-# Fiji 1956
-<epsg4721> +proj=longlat +ellps=intl +towgs84=265.025,384.929,-194.046,0,0,0,0 +no_defs  <>
-# South Georgia 1968
-<epsg4722> +proj=longlat +ellps=intl +towgs84=-794,119,-298,0,0,0,0 +no_defs  <>
-# Grand Cayman 1959
-<epsg4723> +proj=longlat +ellps=clrk66 +towgs84=67.8,106.1,138.8,0,0,0,0 +no_defs  <>
-# Diego Garcia 1969
-<epsg4724> +proj=longlat +ellps=intl +towgs84=208,-435,-229,0,0,0,0 +no_defs  <>
-# Johnston Island 1961
-<epsg4725> +proj=longlat +ellps=intl +towgs84=189,-79,-202,0,0,0,0 +no_defs  <>
-# Little Cayman 1961
-<epsg4726> +proj=longlat +ellps=clrk66 +towgs84=42,124,147,0,0,0,0 +no_defs  <>
-# Midway 1961
-<epsg4727> +proj=longlat +ellps=intl +towgs84=403,-81,277,0,0,0,0 +no_defs  <>
-# Pico de las Nieves 1984
-<epsg4728> +proj=longlat +ellps=intl +towgs84=-307,-92,127,0,0,0,0 +no_defs  <>
-# Pitcairn 1967
-<epsg4729> +proj=longlat +ellps=intl +towgs84=185,165,42,0,0,0,0 +no_defs  <>
-# Santo 1965
-<epsg4730> +proj=longlat +ellps=intl +towgs84=170,42,84,0,0,0,0 +no_defs  <>
-# Viti Levu 1916
-<epsg4731> +proj=longlat +ellps=clrk80 +towgs84=51,391,-36,0,0,0,0 +no_defs  <>
-# Marshall Islands 1960
-<epsg4732> +proj=longlat +a=6378270 +b=6356794.343434343 +towgs84=102,52,-38,0,0,0,0 +no_defs  <>
-# Wake Island 1952
-<epsg4733> +proj=longlat +ellps=intl +towgs84=276,-57,149,0,0,0,0 +no_defs  <>
-# Tristan 1968
-<epsg4734> +proj=longlat +ellps=intl +towgs84=-632,438,-609,0,0,0,0 +no_defs  <>
-# Kusaie 1951
-<epsg4735> +proj=longlat +ellps=intl +towgs84=647,1777,-1124,0,0,0,0 +no_defs  <>
-# Deception Island
-<epsg4736> +proj=longlat +ellps=clrk80 +towgs84=260,12,-147,0,0,0,0 +no_defs  <>
-# Korea 2000
-<epsg4737> +proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs  <>
-# Hong Kong 1963
-<epsg4738> +proj=longlat +a=6378293.645208759 +b=6356617.987679838 +no_defs  <>
-# Hong Kong 1963(67)
-<epsg4739> +proj=longlat +ellps=intl +towgs84=-156,-271,-189,0,0,0,0 +no_defs  <>
-# PZ-90
-<epsg4740> +proj=longlat +a=6378136 +b=6356751.361745712 +towgs84=0,0,1.5,-0,-0,0.076,0 +no_defs  <>
-# FD54
-<epsg4741> +proj=longlat +ellps=intl +no_defs  <>
-# GDM2000
-<epsg4742> +proj=longlat +ellps=GRS80 +no_defs  <>
-# Karbala 1979
-<epsg4743> +proj=longlat +ellps=clrk80 +towgs84=70.995,-335.916,262.898,0,0,0,0 +no_defs  <>
-# Nahrwan 1934
-<epsg4744> +proj=longlat +ellps=clrk80 +no_defs  <>
-# RD/83
-<epsg4745> +proj=longlat +ellps=bessel +no_defs  <>
-# PD/83
-<epsg4746> +proj=longlat +ellps=bessel +no_defs  <>
-# GR96
-<epsg4747> +proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs  <>
-# Vanua Levu 1915
-<epsg4748> +proj=longlat +a=6378306.3696 +b=6356571.996 +towgs84=51,391,-36,0,0,0,0 +no_defs  <>
-# RGNC91-93
-<epsg4749> +proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs  <>
-# ST87 Ouvea
-<epsg4750> +proj=longlat +ellps=WGS84 +towgs84=-56.263,16.136,-22.856,0,0,0,0 +no_defs  <>
-# Kertau (RSO)
-<epsg4751> +proj=longlat +a=6377295.664 +b=6356094.667915204 +no_defs  <>
-# Viti Levu 1912
-<epsg4752> +proj=longlat +a=6378306.3696 +b=6356571.996 +towgs84=51,391,-36,0,0,0,0 +no_defs  <>
-# fk89
-<epsg4753> +proj=longlat +ellps=intl +no_defs  <>
-# LGD2006
-<epsg4754> +proj=longlat +ellps=intl +towgs84=-208.406,-109.878,-2.5764,0,0,0,0 +no_defs  <>
-# DGN95
-<epsg4755> +proj=longlat +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +no_defs  <>
-# VN-2000
-<epsg4756> +proj=longlat +ellps=WGS84 +towgs84=-192.873,-39.382,-111.202,-0.00205,-0.0005,0.00335,0.0188 +no_defs  <>
-# SVY21
-<epsg4757> +proj=longlat +ellps=WGS84 +no_defs  <>
-# JAD2001
-<epsg4758> +proj=longlat +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +no_defs  <>
-# NAD83(NSRS2007)
-<epsg4759> +proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs  <>
-# WGS 66
-<epsg4760> +proj=longlat +ellps=WGS66 +no_defs  <>
-# HTRS96
-<epsg4761> +proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs  <>
-# BDA2000
-<epsg4762> +proj=longlat +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +no_defs  <>
-# Pitcairn 2006
-<epsg4763> +proj=longlat +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +no_defs  <>
-# RSRGD2000
-<epsg4764> +proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs  <>
-# Slovenia 1996
-<epsg4765> +proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs  <>
-# Bern 1898 (Bern)
-<epsg4801> +proj=longlat +ellps=bessel +towgs84=674.4,15.1,405.3,0,0,0,0 +pm=bern +no_defs  <>
-# Bogota 1975 (Bogota)
-<epsg4802> +proj=longlat +ellps=intl +towgs84=307,304,-318,0,0,0,0 +pm=bogota +no_defs  <>
-# Lisbon (Lisbon)
-<epsg4803> +proj=longlat +ellps=intl +towgs84=-304.046,-60.576,103.64,0,0,0,0 +pm=lisbon +no_defs  <>
-# Makassar (Jakarta)
-<epsg4804> +proj=longlat +ellps=bessel +towgs84=-587.8,519.75,145.76,0,0,0,0 +pm=jakarta +no_defs  <>
-# MGI (Ferro)
-<epsg4805> +proj=longlat +ellps=bessel +towgs84=682,-203,480,0,0,0,0 +pm=ferro +no_defs  <>
-# Monte Mario (Rome)
-<epsg4806> +proj=longlat +ellps=intl +towgs84=-104.1,-49.1,-9.9,0.971,-2.917,0.714,-11.68 +pm=rome +no_defs  <>
-# NTF (Paris)
-<epsg4807> +proj=longlat +a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 +pm=paris +no_defs  <>
-# Padang (Jakarta)
-<epsg4808> +proj=longlat +ellps=bessel +pm=jakarta +no_defs  <>
-# Belge 1950 (Brussels)
-<epsg4809> +proj=longlat +ellps=intl +pm=brussels +no_defs  <>
-# Tananarive (Paris)
-<epsg4810> +proj=longlat +ellps=intl +towgs84=-189,-242,-91,0,0,0,0 +pm=paris +no_defs  <>
-# Voirol 1875 (Paris)
-<epsg4811> +proj=longlat +a=6378249.2 +b=6356515 +towgs84=-73,-247,227,0,0,0,0 +pm=paris +no_defs  <>
-# Batavia (Jakarta)
-<epsg4813> +proj=longlat +ellps=bessel +towgs84=-377,681,-50,0,0,0,0 +pm=jakarta +no_defs  <>
-# RT38 (Stockholm)
-<epsg4814> +proj=longlat +ellps=bessel +pm=stockholm +no_defs  <>
-# Greek (Athens)
-<epsg4815> +proj=longlat +ellps=bessel +pm=athens +no_defs  <>
-# Carthage (Paris)
-<epsg4816> +proj=longlat +a=6378249.2 +b=6356515 +towgs84=-263,6,431,0,0,0,0 +pm=paris +no_defs  <>
-# NGO 1948 (Oslo)
-<epsg4817> +proj=longlat +a=6377492.018 +b=6356173.508712696 +towgs84=278.3,93,474.5,7.889,0.05,-6.61,6.21 +pm=oslo +no_defs  <>
-# S-JTSK (Ferro)
-<epsg4818> +proj=longlat +ellps=bessel +towgs84=589,76,480,0,0,0,0 +pm=ferro +no_defs  <>
-# Nord Sahara 1959 (Paris)
-<epsg4819> +proj=longlat +ellps=clrk80 +towgs84=-186,-93,310,0,0,0,0 +pm=paris +no_defs  <>
-# Segara (Jakarta)
-<epsg4820> +proj=longlat +ellps=bessel +towgs84=-403,684,41,0,0,0,0 +pm=jakarta +no_defs  <>
-# Voirol 1879 (Paris)
-<epsg4821> +proj=longlat +a=6378249.2 +b=6356515 +pm=paris +no_defs  <>
-# Sao Tome
-<epsg4823> +proj=longlat +ellps=intl +no_defs  <>
-# Principe
-<epsg4824> +proj=longlat +ellps=intl +no_defs  <>
-# ATF (Paris)
-<epsg4901> +proj=longlat +a=6376523 +b=6355862.933255573 +pm=2.337208333333333 +no_defs  <>
-# NDG (Paris)
-<epsg4902> +proj=longlat +a=6376523 +b=6355862.933255573 +pm=paris +no_defs  <>
-# Madrid 1870 (Madrid)
-<epsg4903> +proj=longlat +a=6378298.3 +b=6356657.142669561 +pm=madrid +no_defs  <>
-# Lisbon 1890 (Lisbon)
-<epsg4904> +proj=longlat +ellps=bessel +towgs84=508.088,-191.042,565.223,0,0,0,0 +pm=lisbon +no_defs  <>
-# PTRA08
-<epsg5013> +proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs  <>
-# Tokyo 1892
-<epsg5132> +proj=longlat +ellps=bessel +no_defs  <>
-# S-JTSK/05
-<epsg5228> +proj=longlat +ellps=bessel +towgs84=572.213,85.334,461.94,4.9732,1.529,5.2484,3.5378 +no_defs  <>
-# S-JTSK/05 (Ferro)
-<epsg5229> +proj=longlat +ellps=bessel +towgs84=572.213,85.334,461.94,4.9732,1.529,5.2484,3.5378 +pm=ferro +no_defs  <>
-# SLD99
-<epsg5233> +proj=longlat +a=6377276.345 +b=6356075.41314024 +towgs84=-0.293,766.95,87.713,0.195704,1.69507,3.47302,-0.039338 +no_defs  <>
-# GDBD2009
-<epsg5246> +proj=longlat +ellps=GRS80 +no_defs  <>
-# TUREF
-<epsg5252> +proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs  <>
-# DRUKREF 03
-<epsg5264> +proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs  <>
-# ISN2004
-<epsg5324> +proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs  <>
-# POSGAR 2007
-<epsg5340> +proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs  <>
-# MARGEN
-<epsg5354> +proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs  <>
-# SIRGAS-Chile
-<epsg5360> +proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs  <>
-# CR05
-<epsg5365> +proj=longlat +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +no_defs  <>
-# MACARIO SOLIS
-<epsg5371> +proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs  <>
-# Peru96
-<epsg5373> +proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs  <>
-# SIRGAS-ROU98
-<epsg5381> +proj=longlat +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +no_defs  <>
-# SIRGAS_ES2007.8
-<epsg5393> +proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs  <>
-# Ocotepeque 1935
-<epsg5451> +proj=longlat +ellps=clrk66 +towgs84=213.11,9.37,-74.95,0,0,0,0 +no_defs  <>
-# Sibun Gorge 1922
-<epsg5464> +proj=longlat +a=6378293.645208759 +b=6356617.987679838 +no_defs  <>
-# Panama-Colon 1911
-<epsg5467> +proj=longlat +ellps=clrk66 +no_defs  <>
-# RGAF09
-<epsg5489> +proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs  <>
-# Corrego Alegre 1961
-<epsg5524> +proj=longlat +ellps=intl +no_defs  <>
-# SAD69(96)
-<epsg5527> +proj=longlat +ellps=aust_SA +no_defs  <>
-# PNG94
-<epsg5546> +proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs  <>
-# Anguilla 1957 / British West Indies Grid
-<epsg2000> +proj=tmerc +lat_0=0 +lon_0=-62 +k=0.9995000000000001 +x_0=400000 +y_0=0 +ellps=clrk80 +units=m +no_defs  <>
-# Antigua 1943 / British West Indies Grid
-<epsg2001> +proj=tmerc +lat_0=0 +lon_0=-62 +k=0.9995000000000001 +x_0=400000 +y_0=0 +ellps=clrk80 +towgs84=-255,-15,71,0,0,0,0 +units=m +no_defs  <>
-# Dominica 1945 / British West Indies Grid
-<epsg2002> +proj=tmerc +lat_0=0 +lon_0=-62 +k=0.9995000000000001 +x_0=400000 +y_0=0 +ellps=clrk80 +towgs84=725,685,536,0,0,0,0 +units=m +no_defs  <>
-# Grenada 1953 / British West Indies Grid
-<epsg2003> +proj=tmerc +lat_0=0 +lon_0=-62 +k=0.9995000000000001 +x_0=400000 +y_0=0 +ellps=clrk80 +towgs84=72,213.7,93,0,0,0,0 +units=m +no_defs  <>
-# Montserrat 1958 / British West Indies Grid
-<epsg2004> +proj=tmerc +lat_0=0 +lon_0=-62 +k=0.9995000000000001 +x_0=400000 +y_0=0 +ellps=clrk80 +towgs84=174,359,365,0,0,0,0 +units=m +no_defs  <>
-# St. Kitts 1955 / British West Indies Grid
-<epsg2005> +proj=tmerc +lat_0=0 +lon_0=-62 +k=0.9995000000000001 +x_0=400000 +y_0=0 +ellps=clrk80 +towgs84=9,183,236,0,0,0,0 +units=m +no_defs  <>
-# St. Lucia 1955 / British West Indies Grid
-<epsg2006> +proj=tmerc +lat_0=0 +lon_0=-62 +k=0.9995000000000001 +x_0=400000 +y_0=0 +ellps=clrk80 +towgs84=-149,128,296,0,0,0,0 +units=m +no_defs  <>
-# St. Vincent 45 / British West Indies Grid
-<epsg2007> +proj=tmerc +lat_0=0 +lon_0=-62 +k=0.9995000000000001 +x_0=400000 +y_0=0 +ellps=clrk80 +towgs84=195.671,332.517,274.607,0,0,0,0 +units=m +no_defs  <>
-# NAD27(CGQ77) / SCoPQ zone 2 (deprecated)
-<epsg2008> +proj=tmerc +lat_0=0 +lon_0=-55.5 +k=0.9999 +x_0=304800 +y_0=0 +ellps=clrk66 +units=m +no_defs  <>
-# NAD27(CGQ77) / SCoPQ zone 3
-<epsg2009> +proj=tmerc +lat_0=0 +lon_0=-58.5 +k=0.9999 +x_0=304800 +y_0=0 +ellps=clrk66 +units=m +no_defs  <>
-# NAD27(CGQ77) / SCoPQ zone 4
-<epsg2010> +proj=tmerc +lat_0=0 +lon_0=-61.5 +k=0.9999 +x_0=304800 +y_0=0 +ellps=clrk66 +units=m +no_defs  <>
-# NAD27(CGQ77) / SCoPQ zone 5
-<epsg2011> +proj=tmerc +lat_0=0 +lon_0=-64.5 +k=0.9999 +x_0=304800 +y_0=0 +ellps=clrk66 +units=m +no_defs  <>
-# NAD27(CGQ77) / SCoPQ zone 6
-<epsg2012> +proj=tmerc +lat_0=0 +lon_0=-67.5 +k=0.9999 +x_0=304800 +y_0=0 +ellps=clrk66 +units=m +no_defs  <>
-# NAD27(CGQ77) / SCoPQ zone 7
-<epsg2013> +proj=tmerc +lat_0=0 +lon_0=-70.5 +k=0.9999 +x_0=304800 +y_0=0 +ellps=clrk66 +units=m +no_defs  <>
-# NAD27(CGQ77) / SCoPQ zone 8
-<epsg2014> +proj=tmerc +lat_0=0 +lon_0=-73.5 +k=0.9999 +x_0=304800 +y_0=0 +ellps=clrk66 +units=m +no_defs  <>
-# NAD27(CGQ77) / SCoPQ zone 9
-<epsg2015> +proj=tmerc +lat_0=0 +lon_0=-76.5 +k=0.9999 +x_0=304800 +y_0=0 +ellps=clrk66 +units=m +no_defs  <>
-# NAD27(CGQ77) / SCoPQ zone 10
-<epsg2016> +proj=tmerc +lat_0=0 +lon_0=-79.5 +k=0.9999 +x_0=304800 +y_0=0 +ellps=clrk66 +units=m +no_defs  <>
-# NAD27(76) / MTM zone 8
-<epsg2017> +proj=tmerc +lat_0=0 +lon_0=-73.5 +k=0.9999 +x_0=304800 +y_0=0 +ellps=clrk66 +units=m +no_defs  <>
-# NAD27(76) / MTM zone 9
-<epsg2018> +proj=tmerc +lat_0=0 +lon_0=-76.5 +k=0.9999 +x_0=304800 +y_0=0 +ellps=clrk66 +units=m +no_defs  <>
-# NAD27(76) / MTM zone 10
-<epsg2019> +proj=tmerc +lat_0=0 +lon_0=-79.5 +k=0.9999 +x_0=304800 +y_0=0 +ellps=clrk66 +units=m +no_defs  <>
-# NAD27(76) / MTM zone 11
-<epsg2020> +proj=tmerc +lat_0=0 +lon_0=-82.5 +k=0.9999 +x_0=304800 +y_0=0 +ellps=clrk66 +units=m +no_defs  <>
-# NAD27(76) / MTM zone 12
-<epsg2021> +proj=tmerc +lat_0=0 +lon_0=-81 +k=0.9999 +x_0=304800 +y_0=0 +ellps=clrk66 +units=m +no_defs  <>
-# NAD27(76) / MTM zone 13
-<epsg2022> +proj=tmerc +lat_0=0 +lon_0=-84 +k=0.9999 +x_0=304800 +y_0=0 +ellps=clrk66 +units=m +no_defs  <>
-# NAD27(76) / MTM zone 14
-<epsg2023> +proj=tmerc +lat_0=0 +lon_0=-87 +k=0.9999 +x_0=304800 +y_0=0 +ellps=clrk66 +units=m +no_defs  <>
-# NAD27(76) / MTM zone 15
-<epsg2024> +proj=tmerc +lat_0=0 +lon_0=-90 +k=0.9999 +x_0=304800 +y_0=0 +ellps=clrk66 +units=m +no_defs  <>
-# NAD27(76) / MTM zone 16
-<epsg2025> +proj=tmerc +lat_0=0 +lon_0=-93 +k=0.9999 +x_0=304800 +y_0=0 +ellps=clrk66 +units=m +no_defs  <>
-# NAD27(76) / MTM zone 17
-<epsg2026> +proj=tmerc +lat_0=0 +lon_0=-96 +k=0.9999 +x_0=304800 +y_0=0 +ellps=clrk66 +units=m +no_defs  <>
-# NAD27(76) / UTM zone 15N
-<epsg2027> +proj=utm +zone=15 +ellps=clrk66 +units=m +no_defs  <>
-# NAD27(76) / UTM zone 16N
-<epsg2028> +proj=utm +zone=16 +ellps=clrk66 +units=m +no_defs  <>
-# NAD27(76) / UTM zone 17N
-<epsg2029> +proj=utm +zone=17 +ellps=clrk66 +units=m +no_defs  <>
-# NAD27(76) / UTM zone 18N
-<epsg2030> +proj=utm +zone=18 +ellps=clrk66 +units=m +no_defs  <>
-# NAD27(CGQ77) / UTM zone 17N
-<epsg2031> +proj=utm +zone=17 +ellps=clrk66 +units=m +no_defs  <>
-# NAD27(CGQ77) / UTM zone 18N
-<epsg2032> +proj=utm +zone=18 +ellps=clrk66 +units=m +no_defs  <>
-# NAD27(CGQ77) / UTM zone 19N
-<epsg2033> +proj=utm +zone=19 +ellps=clrk66 +units=m +no_defs  <>
-# NAD27(CGQ77) / UTM zone 20N
-<epsg2034> +proj=utm +zone=20 +ellps=clrk66 +units=m +no_defs  <>
-# NAD27(CGQ77) / UTM zone 21N
-<epsg2035> +proj=utm +zone=21 +ellps=clrk66 +units=m +no_defs  <>
-# NAD83(CSRS98) / New Brunswick Stereo (deprecated)
-<epsg2036> +proj=sterea +lat_0=46.5 +lon_0=-66.5 +k=0.999912 +x_0=2500000 +y_0=7500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(CSRS98) / UTM zone 19N (deprecated)
-<epsg2037> +proj=utm +zone=19 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(CSRS98) / UTM zone 20N (deprecated)
-<epsg2038> +proj=utm +zone=20 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# Israel / Israeli TM Grid
-<epsg2039> +proj=tmerc +lat_0=31.73439361111111 +lon_0=35.20451694444445 +k=1.0000067 +x_0=219529.584 +y_0=626907.39 +ellps=GRS80 +towgs84=-48,55,52,0,0,0,0 +units=m +no_defs  <>
-# Locodjo 1965 / UTM zone 30N
-<epsg2040> +proj=utm +zone=30 +ellps=clrk80 +towgs84=-125,53,467,0,0,0,0 +units=m +no_defs  <>
-# Abidjan 1987 / UTM zone 30N
-<epsg2041> +proj=utm +zone=30 +ellps=clrk80 +towgs84=-124.76,53,466.79,0,0,0,0 +units=m +no_defs  <>
-# Locodjo 1965 / UTM zone 29N
-<epsg2042> +proj=utm +zone=29 +ellps=clrk80 +towgs84=-125,53,467,0,0,0,0 +units=m +no_defs  <>
-# Abidjan 1987 / UTM zone 29N
-<epsg2043> +proj=utm +zone=29 +ellps=clrk80 +towgs84=-124.76,53,466.79,0,0,0,0 +units=m +no_defs  <>
-# Hanoi 1972 / Gauss-Kruger zone 18
-<epsg2044> +proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=18500000 +y_0=0 +ellps=krass +towgs84=-17.51,-108.32,-62.39,0,0,0,0 +units=m +no_defs  <>
-# Hanoi 1972 / Gauss-Kruger zone 19
-<epsg2045> +proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=19500000 +y_0=0 +ellps=krass +towgs84=-17.51,-108.32,-62.39,0,0,0,0 +units=m +no_defs  <>
-# Hartebeesthoek94 / Lo15
-<epsg2046> +proj=tmerc +lat_0=0 +lon_0=15 +k=1 +x_0=0 +y_0=0 +axis=wsu +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# Hartebeesthoek94 / Lo17
-<epsg2047> +proj=tmerc +lat_0=0 +lon_0=17 +k=1 +x_0=0 +y_0=0 +axis=wsu +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# Hartebeesthoek94 / Lo19
-<epsg2048> +proj=tmerc +lat_0=0 +lon_0=19 +k=1 +x_0=0 +y_0=0 +axis=wsu +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# Hartebeesthoek94 / Lo21
-<epsg2049> +proj=tmerc +lat_0=0 +lon_0=21 +k=1 +x_0=0 +y_0=0 +axis=wsu +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# Hartebeesthoek94 / Lo23
-<epsg2050> +proj=tmerc +lat_0=0 +lon_0=23 +k=1 +x_0=0 +y_0=0 +axis=wsu +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# Hartebeesthoek94 / Lo25
-<epsg2051> +proj=tmerc +lat_0=0 +lon_0=25 +k=1 +x_0=0 +y_0=0 +axis=wsu +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# Hartebeesthoek94 / Lo27
-<epsg2052> +proj=tmerc +lat_0=0 +lon_0=27 +k=1 +x_0=0 +y_0=0 +axis=wsu +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# Hartebeesthoek94 / Lo29
-<epsg2053> +proj=tmerc +lat_0=0 +lon_0=29 +k=1 +x_0=0 +y_0=0 +axis=wsu +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# Hartebeesthoek94 / Lo31
-<epsg2054> +proj=tmerc +lat_0=0 +lon_0=31 +k=1 +x_0=0 +y_0=0 +axis=wsu +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# Hartebeesthoek94 / Lo33
-<epsg2055> +proj=tmerc +lat_0=0 +lon_0=33 +k=1 +x_0=0 +y_0=0 +axis=wsu +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# CH1903+ / LV95
-<epsg2056> +proj=somerc +lat_0=46.95240555555556 +lon_0=7.439583333333333 +k_0=1 +x_0=2600000 +y_0=1200000 +ellps=bessel +towgs84=674.374,15.056,405.346,0,0,0,0 +units=m +no_defs  <>
-# Rassadiran / Nakhl e Taqi
-<epsg2057> +proj=omerc +lat_0=27.51882880555555 +lonc=52.60353916666667 +alpha=0.5716611944444444 +k=0.999895934 +x_0=658377.437 +y_0=3044969.194 +gamma=0.5716611944444444 +ellps=intl +towgs84=-133.63,-157.5,-158.62,0,0,0,0 +units=m +no_defs  <>
-# ED50(ED77) / UTM zone 38N
-<epsg2058> +proj=utm +zone=38 +ellps=intl +towgs84=-117,-132,-164,0,0,0,0 +units=m +no_defs  <>
-# ED50(ED77) / UTM zone 39N
-<epsg2059> +proj=utm +zone=39 +ellps=intl +towgs84=-117,-132,-164,0,0,0,0 +units=m +no_defs  <>
-# ED50(ED77) / UTM zone 40N
-<epsg2060> +proj=utm +zone=40 +ellps=intl +towgs84=-117,-132,-164,0,0,0,0 +units=m +no_defs  <>
-# ED50(ED77) / UTM zone 41N
-<epsg2061> +proj=utm +zone=41 +ellps=intl +towgs84=-117,-132,-164,0,0,0,0 +units=m +no_defs  <>
-# Madrid 1870 (Madrid) / Spain
-<epsg2062> +proj=lcc +lat_1=40 +lat_0=40 +lon_0=0 +k_0=0.9988085293 +x_0=600000 +y_0=600000 +a=6378298.3 +b=6356657.142669561 +pm=madrid +units=m +no_defs  <>
-# Dabola 1981 / UTM zone 28N (deprecated)
-<epsg2063> +proj=utm +zone=28 +a=6378249.2 +b=6356515 +towgs84=-23,259,-9,0,0,0,0 +units=m +no_defs  <>
-# Dabola 1981 / UTM zone 29N (deprecated)
-<epsg2064> +proj=utm +zone=29 +a=6378249.2 +b=6356515 +towgs84=-23,259,-9,0,0,0,0 +units=m +no_defs  <>
-# S-JTSK (Ferro) / Krovak
-<epsg2065> +proj=krovak +lat_0=49.5 +lon_0=42.5 +alpha=30.28813972222222 +k=0.9999 +x_0=0 +y_0=0 +ellps=bessel +towgs84=589,76,480,0,0,0,0 +pm=ferro +units=m +no_defs  <>
-# Mount Dillon / Tobago Grid
-<epsg2066> +proj=cass +lat_0=11.25217861111111 +lon_0=-60.68600888888889 +x_0=37718.66159325 +y_0=36209.91512952 +a=6378293.645208759 +b=6356617.987679838 +to_meter=0.201166195164 +no_defs  <>
-# Naparima 1955 / UTM zone 20N
-<epsg2067> +proj=utm +zone=20 +ellps=intl +towgs84=-0.465,372.095,171.736,0,0,0,0 +units=m +no_defs  <>
-# ELD79 / Libya zone 5
-<epsg2068> +proj=tmerc +lat_0=0 +lon_0=9 +k=0.9999 +x_0=200000 +y_0=0 +ellps=intl +towgs84=-115.854,-99.0583,-152.462,0,0,0,0 +units=m +no_defs  <>
-# ELD79 / Libya zone 6
-<epsg2069> +proj=tmerc +lat_0=0 +lon_0=11 +k=0.9999 +x_0=200000 +y_0=0 +ellps=intl +towgs84=-115.854,-99.0583,-152.462,0,0,0,0 +units=m +no_defs  <>
-# ELD79 / Libya zone 7
-<epsg2070> +proj=tmerc +lat_0=0 +lon_0=13 +k=0.9999 +x_0=200000 +y_0=0 +ellps=intl +towgs84=-115.854,-99.0583,-152.462,0,0,0,0 +units=m +no_defs  <>
-# ELD79 / Libya zone 8
-<epsg2071> +proj=tmerc +lat_0=0 +lon_0=15 +k=0.9999 +x_0=200000 +y_0=0 +ellps=intl +towgs84=-115.854,-99.0583,-152.462,0,0,0,0 +units=m +no_defs  <>
-# ELD79 / Libya zone 9
-<epsg2072> +proj=tmerc +lat_0=0 +lon_0=17 +k=0.9999 +x_0=200000 +y_0=0 +ellps=intl +towgs84=-115.854,-99.0583,-152.462,0,0,0,0 +units=m +no_defs  <>
-# ELD79 / Libya zone 10
-<epsg2073> +proj=tmerc +lat_0=0 +lon_0=19 +k=0.9999 +x_0=200000 +y_0=0 +ellps=intl +towgs84=-115.854,-99.0583,-152.462,0,0,0,0 +units=m +no_defs  <>
-# ELD79 / Libya zone 11
-<epsg2074> +proj=tmerc +lat_0=0 +lon_0=21 +k=0.9999 +x_0=200000 +y_0=0 +ellps=intl +towgs84=-115.854,-99.0583,-152.462,0,0,0,0 +units=m +no_defs  <>
-# ELD79 / Libya zone 12
-<epsg2075> +proj=tmerc +lat_0=0 +lon_0=23 +k=0.9999 +x_0=200000 +y_0=0 +ellps=intl +towgs84=-115.854,-99.0583,-152.462,0,0,0,0 +units=m +no_defs  <>
-# ELD79 / Libya zone 13
-<epsg2076> +proj=tmerc +lat_0=0 +lon_0=25 +k=0.9999 +x_0=200000 +y_0=0 +ellps=intl +towgs84=-115.854,-99.0583,-152.462,0,0,0,0 +units=m +no_defs  <>
-# ELD79 / UTM zone 32N
-<epsg2077> +proj=utm +zone=32 +ellps=intl +towgs84=-115.854,-99.0583,-152.462,0,0,0,0 +units=m +no_defs  <>
-# ELD79 / UTM zone 33N
-<epsg2078> +proj=utm +zone=33 +ellps=intl +towgs84=-115.854,-99.0583,-152.462,0,0,0,0 +units=m +no_defs  <>
-# ELD79 / UTM zone 34N
-<epsg2079> +proj=utm +zone=34 +ellps=intl +towgs84=-115.854,-99.0583,-152.462,0,0,0,0 +units=m +no_defs  <>
-# ELD79 / UTM zone 35N
-<epsg2080> +proj=utm +zone=35 +ellps=intl +towgs84=-115.854,-99.0583,-152.462,0,0,0,0 +units=m +no_defs  <>
-# Chos Malal 1914 / Argentina 2
-<epsg2081> +proj=tmerc +lat_0=-90 +lon_0=-69 +k=1 +x_0=2500000 +y_0=0 +ellps=intl +units=m +no_defs  <>
-# Pampa del Castillo / Argentina 2
-<epsg2082> +proj=tmerc +lat_0=-90 +lon_0=-69 +k=1 +x_0=2500000 +y_0=0 +ellps=intl +towgs84=27.5,14,186.4,0,0,0,0 +units=m +no_defs  <>
-# Hito XVIII 1963 / Argentina 2
-<epsg2083> +proj=tmerc +lat_0=-90 +lon_0=-69 +k=1 +x_0=2500000 +y_0=0 +ellps=intl +towgs84=16,196,93,0,0,0,0 +units=m +no_defs  <>
-# Hito XVIII 1963 / UTM zone 19S
-<epsg2084> +proj=utm +zone=19 +south +ellps=intl +towgs84=16,196,93,0,0,0,0 +units=m +no_defs  <>
-# NAD27 / Cuba Norte (deprecated)
-<epsg2085> +proj=lcc +lat_1=22.35 +lat_0=22.35 +lon_0=-81 +k_0=0.99993602 +x_0=500000 +y_0=280296.016 +datum=NAD27 +units=m +no_defs  <>
-# NAD27 / Cuba Sur (deprecated)
-<epsg2086> +proj=lcc +lat_1=20.71666666666667 +lat_0=20.71666666666667 +lon_0=-76.83333333333333 +k_0=0.99994848 +x_0=500000 +y_0=229126.939 +datum=NAD27 +units=m +no_defs  <>
-# ELD79 / TM 12 NE
-<epsg2087> +proj=tmerc +lat_0=0 +lon_0=12 +k=0.9996 +x_0=500000 +y_0=0 +ellps=intl +towgs84=-115.854,-99.0583,-152.462,0,0,0,0 +units=m +no_defs  <>
-# Carthage / TM 11 NE
-<epsg2088> +proj=tmerc +lat_0=0 +lon_0=11 +k=0.9996 +x_0=500000 +y_0=0 +datum=carthage +units=m +no_defs  <>
-# Yemen NGN96 / UTM zone 38N
-<epsg2089> +proj=utm +zone=38 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# Yemen NGN96 / UTM zone 39N
-<epsg2090> +proj=utm +zone=39 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# South Yemen / Gauss Kruger zone 8 (deprecated)
-<epsg2091> +proj=tmerc +lat_0=0 +lon_0=45 +k=1 +x_0=8500000 +y_0=0 +ellps=krass +towgs84=-76,-138,67,0,0,0,0 +units=m +no_defs  <>
-# South Yemen / Gauss Kruger zone 9 (deprecated)
-<epsg2092> +proj=tmerc +lat_0=0 +lon_0=51 +k=1 +x_0=9500000 +y_0=0 +ellps=krass +towgs84=-76,-138,67,0,0,0,0 +units=m +no_defs  <>
-# Hanoi 1972 / GK 106 NE
-<epsg2093> +proj=tmerc +lat_0=0 +lon_0=106 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=-17.51,-108.32,-62.39,0,0,0,0 +units=m +no_defs  <>
-# WGS 72BE / TM 106 NE
-<epsg2094> +proj=tmerc +lat_0=0 +lon_0=106 +k=0.9996 +x_0=500000 +y_0=0 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# Bissau / UTM zone 28N
-<epsg2095> +proj=utm +zone=28 +ellps=intl +towgs84=-173,253,27,0,0,0,0 +units=m +no_defs  <>
-# Korean 1985 / East Belt
-<epsg2096> +proj=tmerc +lat_0=38 +lon_0=129 +k=1 +x_0=200000 +y_0=500000 +ellps=bessel +units=m +no_defs  <>
-# Korean 1985 / Central Belt
-<epsg2097> +proj=tmerc +lat_0=38 +lon_0=127 +k=1 +x_0=200000 +y_0=500000 +ellps=bessel +units=m +no_defs  <>
-# Korean 1985 / West Belt
-<epsg2098> +proj=tmerc +lat_0=38 +lon_0=125 +k=1 +x_0=200000 +y_0=500000 +ellps=bessel +units=m +no_defs  <>
-# Qatar 1948 / Qatar Grid
-<epsg2099> +proj=cass +lat_0=25.38236111111111 +lon_0=50.76138888888889 +x_0=100000 +y_0=100000 +ellps=helmert +units=m +no_defs  <>
-# GGRS87 / Greek Grid
-<epsg2100> +proj=tmerc +lat_0=0 +lon_0=24 +k=0.9996 +x_0=500000 +y_0=0 +datum=GGRS87 +units=m +no_defs  <>
-# Lake / Maracaibo Grid M1
-<epsg2101> +proj=lcc +lat_1=10.16666666666667 +lat_0=10.16666666666667 +lon_0=-71.60561777777777 +k_0=1 +x_0=0 +y_0=-52684.972 +ellps=intl +units=m +no_defs  <>
-# Lake / Maracaibo Grid
-<epsg2102> +proj=lcc +lat_1=10.16666666666667 +lat_0=10.16666666666667 +lon_0=-71.60561777777777 +k_0=1 +x_0=200000 +y_0=147315.028 +ellps=intl +units=m +no_defs  <>
-# Lake / Maracaibo Grid M3
-<epsg2103> +proj=lcc +lat_1=10.16666666666667 +lat_0=10.16666666666667 +lon_0=-71.60561777777777 +k_0=1 +x_0=500000 +y_0=447315.028 +ellps=intl +units=m +no_defs  <>
-# Lake / Maracaibo La Rosa Grid
-<epsg2104> +proj=lcc +lat_1=10.16666666666667 +lat_0=10.16666666666667 +lon_0=-71.60561777777777 +k_0=1 +x_0=-17044 +y_0=-23139.97 +ellps=intl +units=m +no_defs  <>
-# NZGD2000 / Mount Eden 2000
-<epsg2105> +proj=tmerc +lat_0=-36.87972222222222 +lon_0=174.7641666666667 +k=0.9999 +x_0=400000 +y_0=800000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NZGD2000 / Bay of Plenty 2000
-<epsg2106> +proj=tmerc +lat_0=-37.76111111111111 +lon_0=176.4661111111111 +k=1 +x_0=400000 +y_0=800000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NZGD2000 / Poverty Bay 2000
-<epsg2107> +proj=tmerc +lat_0=-38.62444444444444 +lon_0=177.8855555555556 +k=1 +x_0=400000 +y_0=800000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NZGD2000 / Hawkes Bay 2000
-<epsg2108> +proj=tmerc +lat_0=-39.65083333333333 +lon_0=176.6736111111111 +k=1 +x_0=400000 +y_0=800000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NZGD2000 / Taranaki 2000
-<epsg2109> +proj=tmerc +lat_0=-39.13555555555556 +lon_0=174.2277777777778 +k=1 +x_0=400000 +y_0=800000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NZGD2000 / Tuhirangi 2000
-<epsg2110> +proj=tmerc +lat_0=-39.51222222222222 +lon_0=175.64 +k=1 +x_0=400000 +y_0=800000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NZGD2000 / Wanganui 2000
-<epsg2111> +proj=tmerc +lat_0=-40.24194444444444 +lon_0=175.4880555555555 +k=1 +x_0=400000 +y_0=800000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NZGD2000 / Wairarapa 2000
-<epsg2112> +proj=tmerc +lat_0=-40.92527777777777 +lon_0=175.6472222222222 +k=1 +x_0=400000 +y_0=800000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NZGD2000 / Wellington 2000
-<epsg2113> +proj=tmerc +lat_0=-41.3011111111111 +lon_0=174.7763888888889 +k=1 +x_0=400000 +y_0=800000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NZGD2000 / Collingwood 2000
-<epsg2114> +proj=tmerc +lat_0=-40.71472222222223 +lon_0=172.6719444444444 +k=1 +x_0=400000 +y_0=800000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NZGD2000 / Nelson 2000
-<epsg2115> +proj=tmerc +lat_0=-41.27444444444444 +lon_0=173.2991666666667 +k=1 +x_0=400000 +y_0=800000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NZGD2000 / Karamea 2000
-<epsg2116> +proj=tmerc +lat_0=-41.28972222222222 +lon_0=172.1088888888889 +k=1 +x_0=400000 +y_0=800000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NZGD2000 / Buller 2000
-<epsg2117> +proj=tmerc +lat_0=-41.81055555555555 +lon_0=171.5811111111111 +k=1 +x_0=400000 +y_0=800000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NZGD2000 / Grey 2000
-<epsg2118> +proj=tmerc +lat_0=-42.33361111111111 +lon_0=171.5497222222222 +k=1 +x_0=400000 +y_0=800000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NZGD2000 / Amuri 2000
-<epsg2119> +proj=tmerc +lat_0=-42.68888888888888 +lon_0=173.01 +k=1 +x_0=400000 +y_0=800000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NZGD2000 / Marlborough 2000
-<epsg2120> +proj=tmerc +lat_0=-41.54444444444444 +lon_0=173.8019444444444 +k=1 +x_0=400000 +y_0=800000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NZGD2000 / Hokitika 2000
-<epsg2121> +proj=tmerc +lat_0=-42.88611111111111 +lon_0=170.9797222222222 +k=1 +x_0=400000 +y_0=800000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NZGD2000 / Okarito 2000
-<epsg2122> +proj=tmerc +lat_0=-43.11 +lon_0=170.2608333333333 +k=1 +x_0=400000 +y_0=800000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NZGD2000 / Jacksons Bay 2000
-<epsg2123> +proj=tmerc +lat_0=-43.97777777777778 +lon_0=168.6061111111111 +k=1 +x_0=400000 +y_0=800000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NZGD2000 / Mount Pleasant 2000
-<epsg2124> +proj=tmerc +lat_0=-43.59055555555556 +lon_0=172.7269444444445 +k=1 +x_0=400000 +y_0=800000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NZGD2000 / Gawler 2000
-<epsg2125> +proj=tmerc +lat_0=-43.74861111111111 +lon_0=171.3605555555555 +k=1 +x_0=400000 +y_0=800000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NZGD2000 / Timaru 2000
-<epsg2126> +proj=tmerc +lat_0=-44.40194444444445 +lon_0=171.0572222222222 +k=1 +x_0=400000 +y_0=800000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NZGD2000 / Lindis Peak 2000
-<epsg2127> +proj=tmerc +lat_0=-44.735 +lon_0=169.4675 +k=1 +x_0=400000 +y_0=800000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NZGD2000 / Mount Nicholas 2000
-<epsg2128> +proj=tmerc +lat_0=-45.13277777777778 +lon_0=168.3986111111111 +k=1 +x_0=400000 +y_0=800000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NZGD2000 / Mount York 2000
-<epsg2129> +proj=tmerc +lat_0=-45.56361111111111 +lon_0=167.7386111111111 +k=1 +x_0=400000 +y_0=800000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NZGD2000 / Observation Point 2000
-<epsg2130> +proj=tmerc +lat_0=-45.81611111111111 +lon_0=170.6283333333333 +k=1 +x_0=400000 +y_0=800000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NZGD2000 / North Taieri 2000
-<epsg2131> +proj=tmerc +lat_0=-45.86138888888889 +lon_0=170.2825 +k=0.99996 +x_0=400000 +y_0=800000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NZGD2000 / Bluff 2000
-<epsg2132> +proj=tmerc +lat_0=-46.6 +lon_0=168.3427777777778 +k=1 +x_0=400000 +y_0=800000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NZGD2000 / UTM zone 58S
-<epsg2133> +proj=utm +zone=58 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NZGD2000 / UTM zone 59S
-<epsg2134> +proj=utm +zone=59 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NZGD2000 / UTM zone 60S
-<epsg2135> +proj=utm +zone=60 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# Accra / Ghana National Grid
-<epsg2136> +proj=tmerc +lat_0=4.666666666666667 +lon_0=-1 +k=0.99975 +x_0=274319.7391633579 +y_0=0 +a=6378300 +b=6356751.689189189 +towgs84=-199,32,322,0,0,0,0 +to_meter=0.3047997101815088 +no_defs  <>
-# Accra / TM 1 NW
-<epsg2137> +proj=tmerc +lat_0=0 +lon_0=-1 +k=0.9996 +x_0=500000 +y_0=0 +a=6378300 +b=6356751.689189189 +towgs84=-199,32,322,0,0,0,0 +units=m +no_defs  <>
-# NAD27(CGQ77) / Quebec Lambert
-<epsg2138> +proj=lcc +lat_1=60 +lat_2=46 +lat_0=44 +lon_0=-68.5 +x_0=0 +y_0=0 +ellps=clrk66 +units=m +no_defs  <>
-# NAD83(CSRS98) / SCoPQ zone 2 (deprecated)
-<epsg2139> +proj=tmerc +lat_0=0 +lon_0=-55.5 +k=0.9999 +x_0=304800 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(CSRS98) / MTM zone 3 (deprecated)
-<epsg2140> +proj=tmerc +lat_0=0 +lon_0=-58.5 +k=0.9999 +x_0=304800 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(CSRS98) / MTM zone 4 (deprecated)
-<epsg2141> +proj=tmerc +lat_0=0 +lon_0=-61.5 +k=0.9999 +x_0=304800 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(CSRS98) / MTM zone 5 (deprecated)
-<epsg2142> +proj=tmerc +lat_0=0 +lon_0=-64.5 +k=0.9999 +x_0=304800 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(CSRS98) / MTM zone 6 (deprecated)
-<epsg2143> +proj=tmerc +lat_0=0 +lon_0=-67.5 +k=0.9999 +x_0=304800 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(CSRS98) / MTM zone 7 (deprecated)
-<epsg2144> +proj=tmerc +lat_0=0 +lon_0=-70.5 +k=0.9999 +x_0=304800 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(CSRS98) / MTM zone 8 (deprecated)
-<epsg2145> +proj=tmerc +lat_0=0 +lon_0=-73.5 +k=0.9999 +x_0=304800 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(CSRS98) / MTM zone 9 (deprecated)
-<epsg2146> +proj=tmerc +lat_0=0 +lon_0=-76.5 +k=0.9999 +x_0=304800 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(CSRS98) / MTM zone 10 (deprecated)
-<epsg2147> +proj=tmerc +lat_0=0 +lon_0=-79.5 +k=0.9999 +x_0=304800 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(CSRS98) / UTM zone 21N (deprecated)
-<epsg2148> +proj=utm +zone=21 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(CSRS98) / UTM zone 18N (deprecated)
-<epsg2149> +proj=utm +zone=18 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(CSRS98) / UTM zone 17N (deprecated)
-<epsg2150> +proj=utm +zone=17 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(CSRS98) / UTM zone 13N (deprecated)
-<epsg2151> +proj=utm +zone=13 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(CSRS98) / UTM zone 12N (deprecated)
-<epsg2152> +proj=utm +zone=12 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(CSRS98) / UTM zone 11N (deprecated)
-<epsg2153> +proj=utm +zone=11 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# RGF93 / Lambert-93
-<epsg2154> +proj=lcc +lat_1=49 +lat_2=44 +lat_0=46.5 +lon_0=3 +x_0=700000 +y_0=6600000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# American Samoa 1962 / American Samoa Lambert (deprecated)
-<epsg2155> +proj=lcc +lat_1=-14.26666666666667 +lat_0=-14.26666666666667 +lon_0=170 +k_0=1 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +towgs84=-115,118,426,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(HARN) / UTM zone 59S (deprecated)
-<epsg2156> +proj=utm +zone=59 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# IRENET95 / Irish Transverse Mercator
-<epsg2157> +proj=tmerc +lat_0=53.5 +lon_0=-8 +k=0.99982 +x_0=600000 +y_0=750000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# IRENET95 / UTM zone 29N
-<epsg2158> +proj=utm +zone=29 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# Sierra Leone 1924 / New Colony Grid
-<epsg2159> +proj=tmerc +lat_0=6.666666666666667 +lon_0=-12 +k=1 +x_0=152399.8550907544 +y_0=0 +a=6378300 +b=6356751.689189189 +to_meter=0.3047997101815088 +no_defs  <>
-# Sierra Leone 1924 / New War Office Grid
-<epsg2160> +proj=tmerc +lat_0=6.666666666666667 +lon_0=-12 +k=1 +x_0=243839.7681452071 +y_0=182879.8261089053 +a=6378300 +b=6356751.689189189 +to_meter=0.3047997101815088 +no_defs  <>
-# Sierra Leone 1968 / UTM zone 28N
-<epsg2161> +proj=utm +zone=28 +ellps=clrk80 +towgs84=-88,4,101,0,0,0,0 +units=m +no_defs  <>
-# Sierra Leone 1968 / UTM zone 29N
-<epsg2162> +proj=utm +zone=29 +ellps=clrk80 +towgs84=-88,4,101,0,0,0,0 +units=m +no_defs  <>
-# US National Atlas Equal Area
-<epsg2163> +proj=laea +lat_0=45 +lon_0=-100 +x_0=0 +y_0=0 +a=6370997 +b=6370997 +units=m +no_defs  <>
-# Locodjo 1965 / TM 5 NW
-<epsg2164> +proj=tmerc +lat_0=0 +lon_0=-5 +k=0.9996 +x_0=500000 +y_0=0 +ellps=clrk80 +towgs84=-125,53,467,0,0,0,0 +units=m +no_defs  <>
-# Abidjan 1987 / TM 5 NW
-<epsg2165> +proj=tmerc +lat_0=0 +lon_0=-5 +k=0.9996 +x_0=500000 +y_0=0 +ellps=clrk80 +towgs84=-124.76,53,466.79,0,0,0,0 +units=m +no_defs  <>
-# Pulkovo 1942(83) / Gauss Kruger zone 3 (deprecated)
-<epsg2166> +proj=tmerc +lat_0=0 +lon_0=9 +k=1 +x_0=3500000 +y_0=0 +ellps=krass +towgs84=26,-121,-78,0,0,0,0 +units=m +no_defs  <>
-# Pulkovo 1942(83) / Gauss Kruger zone 4 (deprecated)
-<epsg2167> +proj=tmerc +lat_0=0 +lon_0=12 +k=1 +x_0=4500000 +y_0=0 +ellps=krass +towgs84=26,-121,-78,0,0,0,0 +units=m +no_defs  <>
-# Pulkovo 1942(83) / Gauss Kruger zone 5 (deprecated)
-<epsg2168> +proj=tmerc +lat_0=0 +lon_0=15 +k=1 +x_0=5500000 +y_0=0 +ellps=krass +towgs84=26,-121,-78,0,0,0,0 +units=m +no_defs  <>
-# Luxembourg 1930 / Gauss
-<epsg2169> +proj=tmerc +lat_0=49.83333333333334 +lon_0=6.166666666666667 +k=1 +x_0=80000 +y_0=100000 +ellps=intl +towgs84=-189.681,18.3463,-42.7695,-0.33746,-3.09264,2.53861,0.4598 +units=m +no_defs  <>
-# MGI / Slovenia Grid (deprecated)
-<epsg2170> +proj=tmerc +lat_0=0 +lon_0=15 +k=0.9999 +x_0=500000 +y_0=0 +datum=hermannskogel +units=m +no_defs  <>
-# Pulkovo 1942(58) / Poland zone I (deprecated)
-<epsg2171> +proj=sterea +lat_0=50.625 +lon_0=21.08333333333333 +k=0.9998 +x_0=4637000 +y_0=5647000 +ellps=krass +towgs84=33.4,-146.6,-76.3,-0.359,-0.053,0.844,-0.84 +units=m +no_defs  <>
-# Pulkovo 1942(58) / Poland zone II
-<epsg2172> +proj=sterea +lat_0=53.00194444444445 +lon_0=21.50277777777778 +k=0.9998 +x_0=4603000 +y_0=5806000 +ellps=krass +towgs84=33.4,-146.6,-76.3,-0.359,-0.053,0.844,-0.84 +units=m +no_defs  <>
-# Pulkovo 1942(58) / Poland zone III
-<epsg2173> +proj=sterea +lat_0=53.58333333333334 +lon_0=17.00833333333333 +k=0.9998 +x_0=3501000 +y_0=5999000 +ellps=krass +towgs84=33.4,-146.6,-76.3,-0.359,-0.053,0.844,-0.84 +units=m +no_defs  <>
-# Pulkovo 1942(58) / Poland zone IV
-<epsg2174> +proj=sterea +lat_0=51.67083333333333 +lon_0=16.67222222222222 +k=0.9998 +x_0=3703000 +y_0=5627000 +ellps=krass +towgs84=33.4,-146.6,-76.3,-0.359,-0.053,0.844,-0.84 +units=m +no_defs  <>
-# Pulkovo 1942(58) / Poland zone V
-<epsg2175> +proj=tmerc +lat_0=0 +lon_0=18.95833333333333 +k=0.999983 +x_0=237000 +y_0=-4700000 +ellps=krass +towgs84=33.4,-146.6,-76.3,-0.359,-0.053,0.844,-0.84 +units=m +no_defs  <>
-# ETRS89 / Poland CS2000 zone 5
-<epsg2176> +proj=tmerc +lat_0=0 +lon_0=15 +k=0.999923 +x_0=5500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ETRS89 / Poland CS2000 zone 6
-<epsg2177> +proj=tmerc +lat_0=0 +lon_0=18 +k=0.999923 +x_0=6500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ETRS89 / Poland CS2000 zone 7
-<epsg2178> +proj=tmerc +lat_0=0 +lon_0=21 +k=0.999923 +x_0=7500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ETRS89 / Poland CS2000 zone 8
-<epsg2179> +proj=tmerc +lat_0=0 +lon_0=24 +k=0.999923 +x_0=8500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ETRS89 / Poland CS92
-<epsg2180> +proj=tmerc +lat_0=0 +lon_0=19 +k=0.9993 +x_0=500000 +y_0=-5300000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# Azores Occidental 1939 / UTM zone 25N
-<epsg2188> +proj=utm +zone=25 +ellps=intl +towgs84=-425,-169,81,0,0,0,0 +units=m +no_defs  <>
-# Azores Central 1948 / UTM zone 26N
-<epsg2189> +proj=utm +zone=26 +ellps=intl +towgs84=-104,167,-38,0,0,0,0 +units=m +no_defs  <>
-# Azores Oriental 1940 / UTM zone 26N
-<epsg2190> +proj=utm +zone=26 +ellps=intl +towgs84=-203,141,53,0,0,0,0 +units=m +no_defs  <>
-# Madeira 1936 / UTM zone 28N (deprecated)
-<epsg2191> +proj=utm +zone=28 +ellps=intl +units=m +no_defs  <>
-# ED50 / France EuroLambert
-<epsg2192> +proj=lcc +lat_1=46.8 +lat_0=46.8 +lon_0=2.337229166666667 +k_0=0.99987742 +x_0=600000 +y_0=2200000 +ellps=intl +towgs84=-87,-98,-121,0,0,0,0 +units=m +no_defs  <>
-# NZGD2000 / New Zealand Transverse Mercator 2000
-<epsg2193> +proj=tmerc +lat_0=0 +lon_0=173 +k=0.9996 +x_0=1600000 +y_0=10000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# American Samoa 1962 / American Samoa Lambert (deprecated)
-<epsg2194> +proj=lcc +lat_1=-14.26666666666667 +lat_0=-14.26666666666667 +lon_0=-170 +k_0=1 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +towgs84=-115,118,426,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(HARN) / UTM zone 2S
-<epsg2195> +proj=utm +zone=2 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ETRS89 / Kp2000 Jutland
-<epsg2196> +proj=tmerc +lat_0=0 +lon_0=9.5 +k=0.99995 +x_0=200000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ETRS89 / Kp2000 Zealand
-<epsg2197> +proj=tmerc +lat_0=0 +lon_0=12 +k=0.99995 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ETRS89 / Kp2000 Bornholm
-<epsg2198> +proj=tmerc +lat_0=0 +lon_0=15 +k=1 +x_0=900000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# Albanian 1987 / Gauss Kruger zone 4 (deprecated)
-<epsg2199> +proj=tmerc +lat_0=0 +lon_0=21 +k=1 +x_0=4500000 +y_0=0 +ellps=krass +units=m +no_defs  <>
-# ATS77 / New Brunswick Stereographic (ATS77)
-<epsg2200> +proj=sterea +lat_0=46.5 +lon_0=-66.5 +k=0.999912 +x_0=300000 +y_0=800000 +a=6378135 +b=6356750.304921594 +units=m +no_defs  <>
-# REGVEN / UTM zone 18N
-<epsg2201> +proj=utm +zone=18 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# REGVEN / UTM zone 19N
-<epsg2202> +proj=utm +zone=19 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# REGVEN / UTM zone 20N
-<epsg2203> +proj=utm +zone=20 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD27 / Tennessee
-<epsg2204> +proj=lcc +lat_1=35.25 +lat_2=36.41666666666666 +lat_0=34.66666666666666 +lon_0=-86 +x_0=609601.2192024384 +y_0=30480.06096012192 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD83 / Kentucky North
-<epsg2205> +proj=lcc +lat_1=37.96666666666667 +lat_2=38.96666666666667 +lat_0=37.5 +lon_0=-84.25 +x_0=500000 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# ED50 / 3-degree Gauss-Kruger zone 9
-<epsg2206> +proj=tmerc +lat_0=0 +lon_0=27 +k=1 +x_0=9500000 +y_0=0 +ellps=intl +towgs84=-87,-98,-121,0,0,0,0 +units=m +no_defs  <>
-# ED50 / 3-degree Gauss-Kruger zone 10
-<epsg2207> +proj=tmerc +lat_0=0 +lon_0=30 +k=1 +x_0=10500000 +y_0=0 +ellps=intl +towgs84=-87,-98,-121,0,0,0,0 +units=m +no_defs  <>
-# ED50 / 3-degree Gauss-Kruger zone 11
-<epsg2208> +proj=tmerc +lat_0=0 +lon_0=33 +k=1 +x_0=11500000 +y_0=0 +ellps=intl +towgs84=-87,-98,-121,0,0,0,0 +units=m +no_defs  <>
-# ED50 / 3-degree Gauss-Kruger zone 12
-<epsg2209> +proj=tmerc +lat_0=0 +lon_0=36 +k=1 +x_0=12500000 +y_0=0 +ellps=intl +towgs84=-87,-98,-121,0,0,0,0 +units=m +no_defs  <>
-# ED50 / 3-degree Gauss-Kruger zone 13
-<epsg2210> +proj=tmerc +lat_0=0 +lon_0=39 +k=1 +x_0=13500000 +y_0=0 +ellps=intl +towgs84=-87,-98,-121,0,0,0,0 +units=m +no_defs  <>
-# ED50 / 3-degree Gauss-Kruger zone 14
-<epsg2211> +proj=tmerc +lat_0=0 +lon_0=42 +k=1 +x_0=14500000 +y_0=0 +ellps=intl +towgs84=-87,-98,-121,0,0,0,0 +units=m +no_defs  <>
-# ED50 / 3-degree Gauss-Kruger zone 15
-<epsg2212> +proj=tmerc +lat_0=0 +lon_0=45 +k=1 +x_0=15500000 +y_0=0 +ellps=intl +towgs84=-87,-98,-121,0,0,0,0 +units=m +no_defs  <>
-# ETRS89 / TM 30 NE
-<epsg2213> +proj=tmerc +lat_0=0 +lon_0=30 +k=0.9996 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# Douala 1948 / AOF west (deprecated)
-<epsg2214> +proj=tmerc +lat_0=0 +lon_0=10.5 +k=0.999 +x_0=1000000 +y_0=1000000 +ellps=intl +towgs84=-206.1,-174.7,-87.7,0,0,0,0 +units=m +no_defs  <>
-# Manoca 1962 / UTM zone 32N
-<epsg2215> +proj=utm +zone=32 +a=6378249.2 +b=6356515 +towgs84=-70.9,-151.8,-41.4,0,0,0,0 +units=m +no_defs  <>
-# Qornoq 1927 / UTM zone 22N
-<epsg2216> +proj=utm +zone=22 +ellps=intl +towgs84=164,138,-189,0,0,0,0 +units=m +no_defs  <>
-# Qornoq 1927 / UTM zone 23N
-<epsg2217> +proj=utm +zone=23 +ellps=intl +towgs84=164,138,-189,0,0,0,0 +units=m +no_defs  <>
-# Scoresbysund 1952 / Greenland zone 5 east
-# Unable to translate coordinate system EPSG:2218 into PROJ.4 format.
-#
-# ATS77 / UTM zone 19N
-<epsg2219> +proj=utm +zone=19 +a=6378135 +b=6356750.304921594 +units=m +no_defs  <>
-# ATS77 / UTM zone 20N
-<epsg2220> +proj=utm +zone=20 +a=6378135 +b=6356750.304921594 +units=m +no_defs  <>
-# Scoresbysund 1952 / Greenland zone 6 east
-# Unable to translate coordinate system EPSG:2221 into PROJ.4 format.
-#
-# NAD83 / Arizona East (ft)
-<epsg2222> +proj=tmerc +lat_0=31 +lon_0=-110.1666666666667 +k=0.9999 +x_0=213360 +y_0=0 +datum=NAD83 +units=ft +no_defs  <>
-# NAD83 / Arizona Central (ft)
-<epsg2223> +proj=tmerc +lat_0=31 +lon_0=-111.9166666666667 +k=0.9999 +x_0=213360 +y_0=0 +datum=NAD83 +units=ft +no_defs  <>
-# NAD83 / Arizona West (ft)
-<epsg2224> +proj=tmerc +lat_0=31 +lon_0=-113.75 +k=0.999933333 +x_0=213360 +y_0=0 +datum=NAD83 +units=ft +no_defs  <>
-# NAD83 / California zone 1 (ftUS)
-<epsg2225> +proj=lcc +lat_1=41.66666666666666 +lat_2=40 +lat_0=39.33333333333334 +lon_0=-122 +x_0=2000000.0001016 +y_0=500000.0001016001 +datum=NAD83 +units=us-ft +no_defs  <>
-# NAD83 / California zone 2 (ftUS)
-<epsg2226> +proj=lcc +lat_1=39.83333333333334 +lat_2=38.33333333333334 +lat_0=37.66666666666666 +lon_0=-122 +x_0=2000000.0001016 +y_0=500000.0001016001 +datum=NAD83 +units=us-ft +no_defs  <>
-# NAD83 / California zone 3 (ftUS)
-<epsg2227> +proj=lcc +lat_1=38.43333333333333 +lat_2=37.06666666666667 +lat_0=36.5 +lon_0=-120.5 +x_0=2000000.0001016 +y_0=500000.0001016001 +datum=NAD83 +units=us-ft +no_defs  <>
-# NAD83 / California zone 4 (ftUS)
-<epsg2228> +proj=lcc +lat_1=37.25 +lat_2=36 +lat_0=35.33333333333334 +lon_0=-119 +x_0=2000000.0001016 +y_0=500000.0001016001 +datum=NAD83 +units=us-ft +no_defs  <>
-# NAD83 / California zone 5 (ftUS)
-<epsg2229> +proj=lcc +lat_1=35.46666666666667 +lat_2=34.03333333333333 +lat_0=33.5 +lon_0=-118 +x_0=2000000.0001016 +y_0=500000.0001016001 +datum=NAD83 +units=us-ft +no_defs  <>
-# NAD83 / California zone 6 (ftUS)
-<epsg2230> +proj=lcc +lat_1=33.88333333333333 +lat_2=32.78333333333333 +lat_0=32.16666666666666 +lon_0=-116.25 +x_0=2000000.0001016 +y_0=500000.0001016001 +datum=NAD83 +units=us-ft +no_defs  <>
-# NAD83 / Colorado North (ftUS)
-<epsg2231> +proj=lcc +lat_1=40.78333333333333 +lat_2=39.71666666666667 +lat_0=39.33333333333334 +lon_0=-105.5 +x_0=914401.8288036576 +y_0=304800.6096012192 +datum=NAD83 +units=us-ft +no_defs  <>
-# NAD83 / Colorado Central (ftUS)
-<epsg2232> +proj=lcc +lat_1=39.75 +lat_2=38.45 +lat_0=37.83333333333334 +lon_0=-105.5 +x_0=914401.8288036576 +y_0=304800.6096012192 +datum=NAD83 +units=us-ft +no_defs  <>
-# NAD83 / Colorado South (ftUS)
-<epsg2233> +proj=lcc +lat_1=38.43333333333333 +lat_2=37.23333333333333 +lat_0=36.66666666666666 +lon_0=-105.5 +x_0=914401.8288036576 +y_0=304800.6096012192 +datum=NAD83 +units=us-ft +no_defs  <>
-# NAD83 / Connecticut (ftUS)
-<epsg2234> +proj=lcc +lat_1=41.86666666666667 +lat_2=41.2 +lat_0=40.83333333333334 +lon_0=-72.75 +x_0=304800.6096012192 +y_0=152400.3048006096 +datum=NAD83 +units=us-ft +no_defs  <>
-# NAD83 / Delaware (ftUS)
-<epsg2235> +proj=tmerc +lat_0=38 +lon_0=-75.41666666666667 +k=0.999995 +x_0=200000.0001016002 +y_0=0 +datum=NAD83 +units=us-ft +no_defs  <>
-# NAD83 / Florida East (ftUS)
-<epsg2236> +proj=tmerc +lat_0=24.33333333333333 +lon_0=-81 +k=0.999941177 +x_0=200000.0001016002 +y_0=0 +datum=NAD83 +units=us-ft +no_defs  <>
-# NAD83 / Florida West (ftUS)
-<epsg2237> +proj=tmerc +lat_0=24.33333333333333 +lon_0=-82 +k=0.999941177 +x_0=200000.0001016002 +y_0=0 +datum=NAD83 +units=us-ft +no_defs  <>
-# NAD83 / Florida North (ftUS)
-<epsg2238> +proj=lcc +lat_1=30.75 +lat_2=29.58333333333333 +lat_0=29 +lon_0=-84.5 +x_0=600000 +y_0=0 +datum=NAD83 +units=us-ft +no_defs  <>
-# NAD83 / Georgia East (ftUS)
-<epsg2239> +proj=tmerc +lat_0=30 +lon_0=-82.16666666666667 +k=0.9999 +x_0=200000.0001016002 +y_0=0 +datum=NAD83 +units=us-ft +no_defs  <>
-# NAD83 / Georgia West (ftUS)
-<epsg2240> +proj=tmerc +lat_0=30 +lon_0=-84.16666666666667 +k=0.9999 +x_0=699999.9998983998 +y_0=0 +datum=NAD83 +units=us-ft +no_defs  <>
-# NAD83 / Idaho East (ftUS)
-<epsg2241> +proj=tmerc +lat_0=41.66666666666666 +lon_0=-112.1666666666667 +k=0.9999473679999999 +x_0=200000.0001016002 +y_0=0 +datum=NAD83 +units=us-ft +no_defs  <>
-# NAD83 / Idaho Central (ftUS)
-<epsg2242> +proj=tmerc +lat_0=41.66666666666666 +lon_0=-114 +k=0.9999473679999999 +x_0=500000.0001016001 +y_0=0 +datum=NAD83 +units=us-ft +no_defs  <>
-# NAD83 / Idaho West (ftUS)
-<epsg2243> +proj=tmerc +lat_0=41.66666666666666 +lon_0=-115.75 +k=0.999933333 +x_0=800000.0001016001 +y_0=0 +datum=NAD83 +units=us-ft +no_defs  <>
-# NAD83 / Indiana East (ftUS) (deprecated)
-<epsg2244> +proj=tmerc +lat_0=37.5 +lon_0=-85.66666666666667 +k=0.999966667 +x_0=99999.99989839978 +y_0=249364.9987299975 +datum=NAD83 +units=us-ft +no_defs  <>
-# NAD83 / Indiana West (ftUS) (deprecated)
-<epsg2245> +proj=tmerc +lat_0=37.5 +lon_0=-87.08333333333333 +k=0.999966667 +x_0=900000 +y_0=249364.9987299975 +datum=NAD83 +units=us-ft +no_defs  <>
-# NAD83 / Kentucky North (ftUS)
-<epsg2246> +proj=lcc +lat_1=37.96666666666667 +lat_2=38.96666666666667 +lat_0=37.5 +lon_0=-84.25 +x_0=500000.0001016001 +y_0=0 +datum=NAD83 +units=us-ft +no_defs  <>
-# NAD83 / Kentucky South (ftUS)
-<epsg2247> +proj=lcc +lat_1=37.93333333333333 +lat_2=36.73333333333333 +lat_0=36.33333333333334 +lon_0=-85.75 +x_0=500000.0001016001 +y_0=500000.0001016001 +datum=NAD83 +units=us-ft +no_defs  <>
-# NAD83 / Maryland (ftUS)
-<epsg2248> +proj=lcc +lat_1=39.45 +lat_2=38.3 +lat_0=37.66666666666666 +lon_0=-77 +x_0=399999.9998983998 +y_0=0 +datum=NAD83 +units=us-ft +no_defs  <>
-# NAD83 / Massachusetts Mainland (ftUS)
-<epsg2249> +proj=lcc +lat_1=42.68333333333333 +lat_2=41.71666666666667 +lat_0=41 +lon_0=-71.5 +x_0=200000.0001016002 +y_0=750000 +datum=NAD83 +units=us-ft +no_defs  <>
-# NAD83 / Massachusetts Island (ftUS)
-<epsg2250> +proj=lcc +lat_1=41.48333333333333 +lat_2=41.28333333333333 +lat_0=41 +lon_0=-70.5 +x_0=500000.0001016001 +y_0=0 +datum=NAD83 +units=us-ft +no_defs  <>
-# NAD83 / Michigan North (ft)
-<epsg2251> +proj=lcc +lat_1=47.08333333333334 +lat_2=45.48333333333333 +lat_0=44.78333333333333 +lon_0=-87 +x_0=7999999.999968001 +y_0=0 +datum=NAD83 +units=ft +no_defs  <>
-# NAD83 / Michigan Central (ft)
-<epsg2252> +proj=lcc +lat_1=45.7 +lat_2=44.18333333333333 +lat_0=43.31666666666667 +lon_0=-84.36666666666666 +x_0=5999999.999976001 +y_0=0 +datum=NAD83 +units=ft +no_defs  <>
-# NAD83 / Michigan South (ft)
-<epsg2253> +proj=lcc +lat_1=43.66666666666666 +lat_2=42.1 +lat_0=41.5 +lon_0=-84.36666666666666 +x_0=3999999.999984 +y_0=0 +datum=NAD83 +units=ft +no_defs  <>
-# NAD83 / Mississippi East (ftUS)
-<epsg2254> +proj=tmerc +lat_0=29.5 +lon_0=-88.83333333333333 +k=0.99995 +x_0=300000.0000000001 +y_0=0 +datum=NAD83 +units=us-ft +no_defs  <>
-# NAD83 / Mississippi West (ftUS)
-<epsg2255> +proj=tmerc +lat_0=29.5 +lon_0=-90.33333333333333 +k=0.99995 +x_0=699999.9998983998 +y_0=0 +datum=NAD83 +units=us-ft +no_defs  <>
-# NAD83 / Montana (ft)
-<epsg2256> +proj=lcc +lat_1=49 +lat_2=45 +lat_0=44.25 +lon_0=-109.5 +x_0=599999.9999976 +y_0=0 +datum=NAD83 +units=ft +no_defs  <>
-# NAD83 / New Mexico East (ftUS)
-<epsg2257> +proj=tmerc +lat_0=31 +lon_0=-104.3333333333333 +k=0.999909091 +x_0=165000 +y_0=0 +datum=NAD83 +units=us-ft +no_defs  <>
-# NAD83 / New Mexico Central (ftUS)
-<epsg2258> +proj=tmerc +lat_0=31 +lon_0=-106.25 +k=0.9999 +x_0=500000.0001016001 +y_0=0 +datum=NAD83 +units=us-ft +no_defs  <>
-# NAD83 / New Mexico West (ftUS)
-<epsg2259> +proj=tmerc +lat_0=31 +lon_0=-107.8333333333333 +k=0.999916667 +x_0=830000.0001016001 +y_0=0 +datum=NAD83 +units=us-ft +no_defs  <>
-# NAD83 / New York East (ftUS)
-<epsg2260> +proj=tmerc +lat_0=38.83333333333334 +lon_0=-74.5 +k=0.9999 +x_0=150000 +y_0=0 +datum=NAD83 +units=us-ft +no_defs  <>
-# NAD83 / New York Central (ftUS)
-<epsg2261> +proj=tmerc +lat_0=40 +lon_0=-76.58333333333333 +k=0.9999375 +x_0=249999.9998983998 +y_0=0 +datum=NAD83 +units=us-ft +no_defs  <>
-# NAD83 / New York West (ftUS)
-<epsg2262> +proj=tmerc +lat_0=40 +lon_0=-78.58333333333333 +k=0.9999375 +x_0=350000.0001016001 +y_0=0 +datum=NAD83 +units=us-ft +no_defs  <>
-# NAD83 / New York Long Island (ftUS)
-<epsg2263> +proj=lcc +lat_1=41.03333333333333 +lat_2=40.66666666666666 +lat_0=40.16666666666666 +lon_0=-74 +x_0=300000.0000000001 +y_0=0 +datum=NAD83 +units=us-ft +no_defs  <>
-# NAD83 / North Carolina (ftUS)
-<epsg2264> +proj=lcc +lat_1=36.16666666666666 +lat_2=34.33333333333334 +lat_0=33.75 +lon_0=-79 +x_0=609601.2192024384 +y_0=0 +datum=NAD83 +units=us-ft +no_defs  <>
-# NAD83 / North Dakota North (ft)
-<epsg2265> +proj=lcc +lat_1=48.73333333333333 +lat_2=47.43333333333333 +lat_0=47 +lon_0=-100.5 +x_0=599999.9999976 +y_0=0 +datum=NAD83 +units=ft +no_defs  <>
-# NAD83 / North Dakota South (ft)
-<epsg2266> +proj=lcc +lat_1=47.48333333333333 +lat_2=46.18333333333333 +lat_0=45.66666666666666 +lon_0=-100.5 +x_0=599999.9999976 +y_0=0 +datum=NAD83 +units=ft +no_defs  <>
-# NAD83 / Oklahoma North (ftUS)
-<epsg2267> +proj=lcc +lat_1=36.76666666666667 +lat_2=35.56666666666667 +lat_0=35 +lon_0=-98 +x_0=600000 +y_0=0 +datum=NAD83 +units=us-ft +no_defs  <>
-# NAD83 / Oklahoma South (ftUS)
-<epsg2268> +proj=lcc +lat_1=35.23333333333333 +lat_2=33.93333333333333 +lat_0=33.33333333333334 +lon_0=-98 +x_0=600000 +y_0=0 +datum=NAD83 +units=us-ft +no_defs  <>
-# NAD83 / Oregon North (ft)
-<epsg2269> +proj=lcc +lat_1=46 +lat_2=44.33333333333334 +lat_0=43.66666666666666 +lon_0=-120.5 +x_0=2500000.0001424 +y_0=0 +datum=NAD83 +units=ft +no_defs  <>
-# NAD83 / Oregon South (ft)
-<epsg2270> +proj=lcc +lat_1=44 +lat_2=42.33333333333334 +lat_0=41.66666666666666 +lon_0=-120.5 +x_0=1500000.0001464 +y_0=0 +datum=NAD83 +units=ft +no_defs  <>
-# NAD83 / Pennsylvania North (ftUS)
-<epsg2271> +proj=lcc +lat_1=41.95 +lat_2=40.88333333333333 +lat_0=40.16666666666666 +lon_0=-77.75 +x_0=600000 +y_0=0 +datum=NAD83 +units=us-ft +no_defs  <>
-# NAD83 / Pennsylvania South (ftUS)
-<epsg2272> +proj=lcc +lat_1=40.96666666666667 +lat_2=39.93333333333333 +lat_0=39.33333333333334 +lon_0=-77.75 +x_0=600000 +y_0=0 +datum=NAD83 +units=us-ft +no_defs  <>
-# NAD83 / South Carolina (ft)
-<epsg2273> +proj=lcc +lat_1=34.83333333333334 +lat_2=32.5 +lat_0=31.83333333333333 +lon_0=-81 +x_0=609600 +y_0=0 +datum=NAD83 +units=ft +no_defs  <>
-# NAD83 / Tennessee (ftUS)
-<epsg2274> +proj=lcc +lat_1=36.41666666666666 +lat_2=35.25 +lat_0=34.33333333333334 +lon_0=-86 +x_0=600000 +y_0=0 +datum=NAD83 +units=us-ft +no_defs  <>
-# NAD83 / Texas North (ftUS)
-<epsg2275> +proj=lcc +lat_1=36.18333333333333 +lat_2=34.65 +lat_0=34 +lon_0=-101.5 +x_0=200000.0001016002 +y_0=999999.9998983998 +datum=NAD83 +units=us-ft +no_defs  <>
-# NAD83 / Texas North Central (ftUS)
-<epsg2276> +proj=lcc +lat_1=33.96666666666667 +lat_2=32.13333333333333 +lat_0=31.66666666666667 +lon_0=-98.5 +x_0=600000 +y_0=2000000.0001016 +datum=NAD83 +units=us-ft +no_defs  <>
-# NAD83 / Texas Central (ftUS)
-<epsg2277> +proj=lcc +lat_1=31.88333333333333 +lat_2=30.11666666666667 +lat_0=29.66666666666667 +lon_0=-100.3333333333333 +x_0=699999.9998983998 +y_0=3000000 +datum=NAD83 +units=us-ft +no_defs  <>
-# NAD83 / Texas South Central (ftUS)
-<epsg2278> +proj=lcc +lat_1=30.28333333333333 +lat_2=28.38333333333333 +lat_0=27.83333333333333 +lon_0=-99 +x_0=600000 +y_0=3999999.9998984 +datum=NAD83 +units=us-ft +no_defs  <>
-# NAD83 / Texas South (ftUS)
-<epsg2279> +proj=lcc +lat_1=27.83333333333333 +lat_2=26.16666666666667 +lat_0=25.66666666666667 +lon_0=-98.5 +x_0=300000.0000000001 +y_0=5000000.0001016 +datum=NAD83 +units=us-ft +no_defs  <>
-# NAD83 / Utah North (ft)
-<epsg2280> +proj=lcc +lat_1=41.78333333333333 +lat_2=40.71666666666667 +lat_0=40.33333333333334 +lon_0=-111.5 +x_0=500000.0001504 +y_0=999999.9999960001 +datum=NAD83 +units=ft +no_defs  <>
-# NAD83 / Utah Central (ft)
-<epsg2281> +proj=lcc +lat_1=40.65 +lat_2=39.01666666666667 +lat_0=38.33333333333334 +lon_0=-111.5 +x_0=500000.0001504 +y_0=1999999.999992 +datum=NAD83 +units=ft +no_defs  <>
-# NAD83 / Utah South (ft)
-<epsg2282> +proj=lcc +lat_1=38.35 +lat_2=37.21666666666667 +lat_0=36.66666666666666 +lon_0=-111.5 +x_0=500000.0001504 +y_0=2999999.999988 +datum=NAD83 +units=ft +no_defs  <>
-# NAD83 / Virginia North (ftUS)
-<epsg2283> +proj=lcc +lat_1=39.2 +lat_2=38.03333333333333 +lat_0=37.66666666666666 +lon_0=-78.5 +x_0=3500000.0001016 +y_0=2000000.0001016 +datum=NAD83 +units=us-ft +no_defs  <>
-# NAD83 / Virginia South (ftUS)
-<epsg2284> +proj=lcc +lat_1=37.96666666666667 +lat_2=36.76666666666667 +lat_0=36.33333333333334 +lon_0=-78.5 +x_0=3500000.0001016 +y_0=999999.9998983998 +datum=NAD83 +units=us-ft +no_defs  <>
-# NAD83 / Washington North (ftUS)
-<epsg2285> +proj=lcc +lat_1=48.73333333333333 +lat_2=47.5 +lat_0=47 +lon_0=-120.8333333333333 +x_0=500000.0001016001 +y_0=0 +datum=NAD83 +units=us-ft +no_defs  <>
-# NAD83 / Washington South (ftUS)
-<epsg2286> +proj=lcc +lat_1=47.33333333333334 +lat_2=45.83333333333334 +lat_0=45.33333333333334 +lon_0=-120.5 +x_0=500000.0001016001 +y_0=0 +datum=NAD83 +units=us-ft +no_defs  <>
-# NAD83 / Wisconsin North (ftUS)
-<epsg2287> +proj=lcc +lat_1=46.76666666666667 +lat_2=45.56666666666667 +lat_0=45.16666666666666 +lon_0=-90 +x_0=600000 +y_0=0 +datum=NAD83 +units=us-ft +no_defs  <>
-# NAD83 / Wisconsin Central (ftUS)
-<epsg2288> +proj=lcc +lat_1=45.5 +lat_2=44.25 +lat_0=43.83333333333334 +lon_0=-90 +x_0=600000 +y_0=0 +datum=NAD83 +units=us-ft +no_defs  <>
-# NAD83 / Wisconsin South (ftUS)
-<epsg2289> +proj=lcc +lat_1=44.06666666666667 +lat_2=42.73333333333333 +lat_0=42 +lon_0=-90 +x_0=600000 +y_0=0 +datum=NAD83 +units=us-ft +no_defs  <>
-# ATS77 / Prince Edward Isl. Stereographic (ATS77)
-<epsg2290> +proj=sterea +lat_0=47.25 +lon_0=-63 +k=0.999912 +x_0=700000 +y_0=400000 +a=6378135 +b=6356750.304921594 +units=m +no_defs  <>
-# NAD83(CSRS98) / Prince Edward Isl. Stereographic (NAD83) (deprecated)
-<epsg2291> +proj=sterea +lat_0=47.25 +lon_0=-63 +k=0.999912 +x_0=400000 +y_0=800000 +a=6378135 +b=6356750.304921594 +units=m +no_defs  <>
-# NAD83(CSRS98) / Prince Edward Isl. Stereographic (NAD83) (deprecated)
-<epsg2292> +proj=sterea +lat_0=47.25 +lon_0=-63 +k=0.999912 +x_0=400000 +y_0=800000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ATS77 / MTM Nova Scotia zone 4
-<epsg2294> +proj=tmerc +lat_0=0 +lon_0=-61.5 +k=0.9999 +x_0=4500000 +y_0=0 +a=6378135 +b=6356750.304921594 +units=m +no_defs  <>
-# ATS77 / MTM Nova Scotia zone 5
-<epsg2295> +proj=tmerc +lat_0=0 +lon_0=-64.5 +k=0.9999 +x_0=5500000 +y_0=0 +a=6378135 +b=6356750.304921594 +units=m +no_defs  <>
-# Ammassalik 1958 / Greenland zone 7 east
-# Unable to translate coordinate system EPSG:2296 into PROJ.4 format.
-#
-# Qornoq 1927 / Greenland zone 1 east (deprecated)
-# Unable to translate coordinate system EPSG:2297 into PROJ.4 format.
-#
-# Qornoq 1927 / Greenland zone 2 east (deprecated)
-# Unable to translate coordinate system EPSG:2298 into PROJ.4 format.
-#
-# Qornoq 1927 / Greenland zone 2 west
-# Unable to translate coordinate system EPSG:2299 into PROJ.4 format.
-#
-# Qornoq 1927 / Greenland zone 3 east (deprecated)
-# Unable to translate coordinate system EPSG:2300 into PROJ.4 format.
-#
-# Qornoq 1927 / Greenland zone 3 west
-# Unable to translate coordinate system EPSG:2301 into PROJ.4 format.
-#
-# Qornoq 1927 / Greenland zone 4 east (deprecated)
-# Unable to translate coordinate system EPSG:2302 into PROJ.4 format.
-#
-# Qornoq 1927 / Greenland zone 4 west
-# Unable to translate coordinate system EPSG:2303 into PROJ.4 format.
-#
-# Qornoq 1927 / Greenland zone 5 west
-# Unable to translate coordinate system EPSG:2304 into PROJ.4 format.
-#
-# Qornoq 1927 / Greenland zone 6 west
-# Unable to translate coordinate system EPSG:2305 into PROJ.4 format.
-#
-# Qornoq 1927 / Greenland zone 7 west
-# Unable to translate coordinate system EPSG:2306 into PROJ.4 format.
-#
-# Qornoq 1927 / Greenland zone 8 east
-# Unable to translate coordinate system EPSG:2307 into PROJ.4 format.
-#
-# Batavia / TM 109 SE
-<epsg2308> +proj=tmerc +lat_0=0 +lon_0=109 +k=0.9996 +x_0=500000 +y_0=10000000 +ellps=bessel +towgs84=-377,681,-50,0,0,0,0 +units=m +no_defs  <>
-# WGS 84 / TM 116 SE
-<epsg2309> +proj=tmerc +lat_0=0 +lon_0=116 +k=0.9996 +x_0=500000 +y_0=10000000 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / TM 132 SE
-<epsg2310> +proj=tmerc +lat_0=0 +lon_0=132 +k=0.9996 +x_0=500000 +y_0=10000000 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / TM 6 NE
-<epsg2311> +proj=tmerc +lat_0=0 +lon_0=6 +k=0.9996 +x_0=500000 +y_0=0 +datum=WGS84 +units=m +no_defs  <>
-# Garoua / UTM zone 33N
-<epsg2312> +proj=utm +zone=33 +ellps=clrk80 +units=m +no_defs  <>
-# Kousseri / UTM zone 33N
-<epsg2313> +proj=utm +zone=33 +ellps=clrk80 +units=m +no_defs  <>
-# Trinidad 1903 / Trinidad Grid (ftCla)
-<epsg2314> +proj=cass +lat_0=10.44166666666667 +lon_0=-61.33333333333334 +x_0=86501.46392052001 +y_0=65379.0134283 +a=6378293.645208759 +b=6356617.987679838 +towgs84=-61.702,284.488,472.052,0,0,0,0 +to_meter=0.3047972654 +no_defs  <>
-# Campo Inchauspe / UTM zone 19S
-<epsg2315> +proj=utm +zone=19 +south +ellps=intl +towgs84=-148,136,90,0,0,0,0 +units=m +no_defs  <>
-# Campo Inchauspe / UTM zone 20S
-<epsg2316> +proj=utm +zone=20 +south +ellps=intl +towgs84=-148,136,90,0,0,0,0 +units=m +no_defs  <>
-# PSAD56 / ICN Regional
-<epsg2317> +proj=lcc +lat_1=9 +lat_2=3 +lat_0=6 +lon_0=-66 +x_0=1000000 +y_0=1000000 +ellps=intl +towgs84=-288,175,-376,0,0,0,0 +units=m +no_defs  <>
-# Ain el Abd / Aramco Lambert
-<epsg2318> +proj=lcc +lat_1=17 +lat_2=33 +lat_0=25.08951 +lon_0=48 +x_0=0 +y_0=0 +ellps=intl +towgs84=-143,-236,7,0,0,0,0 +units=m +no_defs  <>
-# ED50 / TM27
-<epsg2319> +proj=tmerc +lat_0=0 +lon_0=27 +k=1 +x_0=500000 +y_0=0 +ellps=intl +towgs84=-87,-98,-121,0,0,0,0 +units=m +no_defs  <>
-# ED50 / TM30
-<epsg2320> +proj=tmerc +lat_0=0 +lon_0=30 +k=1 +x_0=500000 +y_0=0 +ellps=intl +towgs84=-87,-98,-121,0,0,0,0 +units=m +no_defs  <>
-# ED50 / TM33
-<epsg2321> +proj=tmerc +lat_0=0 +lon_0=33 +k=1 +x_0=500000 +y_0=0 +ellps=intl +towgs84=-87,-98,-121,0,0,0,0 +units=m +no_defs  <>
-# ED50 / TM36
-<epsg2322> +proj=tmerc +lat_0=0 +lon_0=36 +k=1 +x_0=500000 +y_0=0 +ellps=intl +towgs84=-87,-98,-121,0,0,0,0 +units=m +no_defs  <>
-# ED50 / TM39
-<epsg2323> +proj=tmerc +lat_0=0 +lon_0=39 +k=1 +x_0=500000 +y_0=0 +ellps=intl +towgs84=-87,-98,-121,0,0,0,0 +units=m +no_defs  <>
-# ED50 / TM42
-<epsg2324> +proj=tmerc +lat_0=0 +lon_0=42 +k=1 +x_0=500000 +y_0=0 +ellps=intl +towgs84=-87,-98,-121,0,0,0,0 +units=m +no_defs  <>
-# ED50 / TM45
-<epsg2325> +proj=tmerc +lat_0=0 +lon_0=45 +k=1 +x_0=500000 +y_0=0 +ellps=intl +towgs84=-87,-98,-121,0,0,0,0 +units=m +no_defs  <>
-# Hong Kong 1980 Grid System
-<epsg2326> +proj=tmerc +lat_0=22.31213333333334 +lon_0=114.1785555555556 +k=1 +x_0=836694.05 +y_0=819069.8 +ellps=intl +towgs84=-162.619,-276.959,-161.764,0.067753,-2.24365,-1.15883,-1.09425 +units=m +no_defs  <>
-# Xian 1980 / Gauss-Kruger zone 13
-<epsg2327> +proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=13500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  <>
-# Xian 1980 / Gauss-Kruger zone 14
-<epsg2328> +proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=14500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  <>
-# Xian 1980 / Gauss-Kruger zone 15
-<epsg2329> +proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=15500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  <>
-# Xian 1980 / Gauss-Kruger zone 16
-<epsg2330> +proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=16500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  <>
-# Xian 1980 / Gauss-Kruger zone 17
-<epsg2331> +proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=17500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  <>
-# Xian 1980 / Gauss-Kruger zone 18
-<epsg2332> +proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=18500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  <>
-# Xian 1980 / Gauss-Kruger zone 19
-<epsg2333> +proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=19500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  <>
-# Xian 1980 / Gauss-Kruger zone 20
-<epsg2334> +proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=20500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  <>
-# Xian 1980 / Gauss-Kruger zone 21
-<epsg2335> +proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=21500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  <>
-# Xian 1980 / Gauss-Kruger zone 22
-<epsg2336> +proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=22500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  <>
-# Xian 1980 / Gauss-Kruger zone 23
-<epsg2337> +proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=23500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  <>
-# Xian 1980 / Gauss-Kruger CM 75E
-<epsg2338> +proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  <>
-# Xian 1980 / Gauss-Kruger CM 81E
-<epsg2339> +proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  <>
-# Xian 1980 / Gauss-Kruger CM 87E
-<epsg2340> +proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  <>
-# Xian 1980 / Gauss-Kruger CM 93E
-<epsg2341> +proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  <>
-# Xian 1980 / Gauss-Kruger CM 99E
-<epsg2342> +proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  <>
-# Xian 1980 / Gauss-Kruger CM 105E
-<epsg2343> +proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  <>
-# Xian 1980 / Gauss-Kruger CM 111E
-<epsg2344> +proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  <>
-# Xian 1980 / Gauss-Kruger CM 117E
-<epsg2345> +proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  <>
-# Xian 1980 / Gauss-Kruger CM 123E
-<epsg2346> +proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  <>
-# Xian 1980 / Gauss-Kruger CM 129E
-<epsg2347> +proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  <>
-# Xian 1980 / Gauss-Kruger CM 135E
-<epsg2348> +proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  <>
-# Xian 1980 / 3-degree Gauss-Kruger zone 25
-<epsg2349> +proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=25500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  <>
-# Xian 1980 / 3-degree Gauss-Kruger zone 26
-<epsg2350> +proj=tmerc +lat_0=0 +lon_0=78 +k=1 +x_0=26500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  <>
-# Xian 1980 / 3-degree Gauss-Kruger zone 27
-<epsg2351> +proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=27500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  <>
-# Xian 1980 / 3-degree Gauss-Kruger zone 28
-<epsg2352> +proj=tmerc +lat_0=0 +lon_0=84 +k=1 +x_0=28500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  <>
-# Xian 1980 / 3-degree Gauss-Kruger zone 29
-<epsg2353> +proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=29500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  <>
-# Xian 1980 / 3-degree Gauss-Kruger zone 30
-<epsg2354> +proj=tmerc +lat_0=0 +lon_0=90 +k=1 +x_0=30500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  <>
-# Xian 1980 / 3-degree Gauss-Kruger zone 31
-<epsg2355> +proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=31500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  <>
-# Xian 1980 / 3-degree Gauss-Kruger zone 32
-<epsg2356> +proj=tmerc +lat_0=0 +lon_0=96 +k=1 +x_0=32500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  <>
-# Xian 1980 / 3-degree Gauss-Kruger zone 33
-<epsg2357> +proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=33500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  <>
-# Xian 1980 / 3-degree Gauss-Kruger zone 34
-<epsg2358> +proj=tmerc +lat_0=0 +lon_0=102 +k=1 +x_0=34500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  <>
-# Xian 1980 / 3-degree Gauss-Kruger zone 35
-<epsg2359> +proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=35500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  <>
-# Xian 1980 / 3-degree Gauss-Kruger zone 36
-<epsg2360> +proj=tmerc +lat_0=0 +lon_0=108 +k=1 +x_0=36500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  <>
-# Xian 1980 / 3-degree Gauss-Kruger zone 37
-<epsg2361> +proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=37500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  <>
-# Xian 1980 / 3-degree Gauss-Kruger zone 38
-<epsg2362> +proj=tmerc +lat_0=0 +lon_0=114 +k=1 +x_0=38500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  <>
-# Xian 1980 / 3-degree Gauss-Kruger zone 39
-<epsg2363> +proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=39500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  <>
-# Xian 1980 / 3-degree Gauss-Kruger zone 40
-<epsg2364> +proj=tmerc +lat_0=0 +lon_0=120 +k=1 +x_0=40500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  <>
-# Xian 1980 / 3-degree Gauss-Kruger zone 41
-<epsg2365> +proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=41500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  <>
-# Xian 1980 / 3-degree Gauss-Kruger zone 42
-<epsg2366> +proj=tmerc +lat_0=0 +lon_0=126 +k=1 +x_0=42500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  <>
-# Xian 1980 / 3-degree Gauss-Kruger zone 43
-<epsg2367> +proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=43500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  <>
-# Xian 1980 / 3-degree Gauss-Kruger zone 44
-<epsg2368> +proj=tmerc +lat_0=0 +lon_0=132 +k=1 +x_0=44500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  <>
-# Xian 1980 / 3-degree Gauss-Kruger zone 45
-<epsg2369> +proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=45500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  <>
-# Xian 1980 / 3-degree Gauss-Kruger CM 75E
-<epsg2370> +proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  <>
-# Xian 1980 / 3-degree Gauss-Kruger CM 78E
-<epsg2371> +proj=tmerc +lat_0=0 +lon_0=78 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  <>
-# Xian 1980 / 3-degree Gauss-Kruger CM 81E
-<epsg2372> +proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  <>
-# Xian 1980 / 3-degree Gauss-Kruger CM 84E
-<epsg2373> +proj=tmerc +lat_0=0 +lon_0=84 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  <>
-# Xian 1980 / 3-degree Gauss-Kruger CM 87E
-<epsg2374> +proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  <>
-# Xian 1980 / 3-degree Gauss-Kruger CM 90E
-<epsg2375> +proj=tmerc +lat_0=0 +lon_0=90 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  <>
-# Xian 1980 / 3-degree Gauss-Kruger CM 93E
-<epsg2376> +proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  <>
-# Xian 1980 / 3-degree Gauss-Kruger CM 96E
-<epsg2377> +proj=tmerc +lat_0=0 +lon_0=96 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  <>
-# Xian 1980 / 3-degree Gauss-Kruger CM 99E
-<epsg2378> +proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  <>
-# Xian 1980 / 3-degree Gauss-Kruger CM 102E
-<epsg2379> +proj=tmerc +lat_0=0 +lon_0=102 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  <>
-# Xian 1980 / 3-degree Gauss-Kruger CM 105E
-<epsg2380> +proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  <>
-# Xian 1980 / 3-degree Gauss-Kruger CM 108E
-<epsg2381> +proj=tmerc +lat_0=0 +lon_0=108 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  <>
-# Xian 1980 / 3-degree Gauss-Kruger CM 111E
-<epsg2382> +proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  <>
-# Xian 1980 / 3-degree Gauss-Kruger CM 114E
-<epsg2383> +proj=tmerc +lat_0=0 +lon_0=114 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  <>
-# Xian 1980 / 3-degree Gauss-Kruger CM 117E
-<epsg2384> +proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  <>
-# Xian 1980 / 3-degree Gauss-Kruger CM 120E
-<epsg2385> +proj=tmerc +lat_0=0 +lon_0=120 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  <>
-# Xian 1980 / 3-degree Gauss-Kruger CM 123E
-<epsg2386> +proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  <>
-# Xian 1980 / 3-degree Gauss-Kruger CM 126E
-<epsg2387> +proj=tmerc +lat_0=0 +lon_0=126 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  <>
-# Xian 1980 / 3-degree Gauss-Kruger CM 129E
-<epsg2388> +proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  <>
-# Xian 1980 / 3-degree Gauss-Kruger CM 132E
-<epsg2389> +proj=tmerc +lat_0=0 +lon_0=132 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  <>
-# Xian 1980 / 3-degree Gauss-Kruger CM 135E
-<epsg2390> +proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  <>
-# KKJ / Finland zone 1
-<epsg2391> +proj=tmerc +lat_0=0 +lon_0=21 +k=1 +x_0=1500000 +y_0=0 +ellps=intl +towgs84=-96.062,-82.428,-121.753,4.801,0.345,-1.376,1.496 +units=m +no_defs  <>
-# KKJ / Finland zone 2
-<epsg2392> +proj=tmerc +lat_0=0 +lon_0=24 +k=1 +x_0=2500000 +y_0=0 +ellps=intl +towgs84=-96.062,-82.428,-121.753,4.801,0.345,-1.376,1.496 +units=m +no_defs  <>
-# KKJ / Finland Uniform Coordinate System
-<epsg2393> +proj=tmerc +lat_0=0 +lon_0=27 +k=1 +x_0=3500000 +y_0=0 +ellps=intl +towgs84=-96.062,-82.428,-121.753,4.801,0.345,-1.376,1.496 +units=m +no_defs  <>
-# KKJ / Finland zone 4
-<epsg2394> +proj=tmerc +lat_0=0 +lon_0=30 +k=1 +x_0=4500000 +y_0=0 +ellps=intl +towgs84=-96.062,-82.428,-121.753,4.801,0.345,-1.376,1.496 +units=m +no_defs  <>
-# South Yemen / Gauss-Kruger zone 8
-<epsg2395> +proj=tmerc +lat_0=0 +lon_0=45 +k=1 +x_0=8500000 +y_0=0 +ellps=krass +towgs84=-76,-138,67,0,0,0,0 +units=m +no_defs  <>
-# South Yemen / Gauss-Kruger zone 9
-<epsg2396> +proj=tmerc +lat_0=0 +lon_0=51 +k=1 +x_0=9500000 +y_0=0 +ellps=krass +towgs84=-76,-138,67,0,0,0,0 +units=m +no_defs  <>
-# Pulkovo 1942(83) / 3-degree Gauss-Kruger zone 3
-<epsg2397> +proj=tmerc +lat_0=0 +lon_0=9 +k=1 +x_0=3500000 +y_0=0 +ellps=krass +towgs84=26,-121,-78,0,0,0,0 +units=m +no_defs  <>
-# Pulkovo 1942(83) / 3-degree Gauss-Kruger zone 4
-<epsg2398> +proj=tmerc +lat_0=0 +lon_0=12 +k=1 +x_0=4500000 +y_0=0 +ellps=krass +towgs84=26,-121,-78,0,0,0,0 +units=m +no_defs  <>
-# Pulkovo 1942(83) / 3-degree Gauss-Kruger zone 5
-<epsg2399> +proj=tmerc +lat_0=0 +lon_0=15 +k=1 +x_0=5500000 +y_0=0 +ellps=krass +towgs84=26,-121,-78,0,0,0,0 +units=m +no_defs  <>
-# RT90 2.5 gon W (deprecated)
-<epsg2400> +proj=tmerc +lat_0=0 +lon_0=15.80827777777778 +k=1 +x_0=1500000 +y_0=0 +ellps=bessel +towgs84=414.1,41.3,603.1,-0.855,2.141,-7.023,0 +units=m +no_defs  <>
-# Beijing 1954 / 3-degree Gauss-Kruger zone 25
-<epsg2401> +proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=25500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs  <>
-# Beijing 1954 / 3-degree Gauss-Kruger zone 26
-<epsg2402> +proj=tmerc +lat_0=0 +lon_0=78 +k=1 +x_0=26500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs  <>
-# Beijing 1954 / 3-degree Gauss-Kruger zone 27
-<epsg2403> +proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=27500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs  <>
-# Beijing 1954 / 3-degree Gauss-Kruger zone 28
-<epsg2404> +proj=tmerc +lat_0=0 +lon_0=84 +k=1 +x_0=28500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs  <>
-# Beijing 1954 / 3-degree Gauss-Kruger zone 29
-<epsg2405> +proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=29500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs  <>
-# Beijing 1954 / 3-degree Gauss-Kruger zone 30
-<epsg2406> +proj=tmerc +lat_0=0 +lon_0=90 +k=1 +x_0=30500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs  <>
-# Beijing 1954 / 3-degree Gauss-Kruger zone 31
-<epsg2407> +proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=31500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs  <>
-# Beijing 1954 / 3-degree Gauss-Kruger zone 32
-<epsg2408> +proj=tmerc +lat_0=0 +lon_0=96 +k=1 +x_0=32500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs  <>
-# Beijing 1954 / 3-degree Gauss-Kruger zone 33
-<epsg2409> +proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=33500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs  <>
-# Beijing 1954 / 3-degree Gauss-Kruger zone 34
-<epsg2410> +proj=tmerc +lat_0=0 +lon_0=102 +k=1 +x_0=34500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs  <>
-# Beijing 1954 / 3-degree Gauss-Kruger zone 35
-<epsg2411> +proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=35500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs  <>
-# Beijing 1954 / 3-degree Gauss-Kruger zone 36
-<epsg2412> +proj=tmerc +lat_0=0 +lon_0=108 +k=1 +x_0=36500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs  <>
-# Beijing 1954 / 3-degree Gauss-Kruger zone 37
-<epsg2413> +proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=37500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs  <>
-# Beijing 1954 / 3-degree Gauss-Kruger zone 38
-<epsg2414> +proj=tmerc +lat_0=0 +lon_0=114 +k=1 +x_0=38500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs  <>
-# Beijing 1954 / 3-degree Gauss-Kruger zone 39
-<epsg2415> +proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=39500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs  <>
-# Beijing 1954 / 3-degree Gauss-Kruger zone 40
-<epsg2416> +proj=tmerc +lat_0=0 +lon_0=120 +k=1 +x_0=40500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs  <>
-# Beijing 1954 / 3-degree Gauss-Kruger zone 41
-<epsg2417> +proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=41500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs  <>
-# Beijing 1954 / 3-degree Gauss-Kruger zone 42
-<epsg2418> +proj=tmerc +lat_0=0 +lon_0=126 +k=1 +x_0=42500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs  <>
-# Beijing 1954 / 3-degree Gauss-Kruger zone 43
-<epsg2419> +proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=43500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs  <>
-# Beijing 1954 / 3-degree Gauss-Kruger zone 44
-<epsg2420> +proj=tmerc +lat_0=0 +lon_0=132 +k=1 +x_0=44500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs  <>
-# Beijing 1954 / 3-degree Gauss-Kruger zone 45
-<epsg2421> +proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=45500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs  <>
-# Beijing 1954 / 3-degree Gauss-Kruger CM 75E
-<epsg2422> +proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs  <>
-# Beijing 1954 / 3-degree Gauss-Kruger CM 78E
-<epsg2423> +proj=tmerc +lat_0=0 +lon_0=78 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs  <>
-# Beijing 1954 / 3-degree Gauss-Kruger CM 81E
-<epsg2424> +proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs  <>
-# Beijing 1954 / 3-degree Gauss-Kruger CM 84E
-<epsg2425> +proj=tmerc +lat_0=0 +lon_0=84 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs  <>
-# Beijing 1954 / 3-degree Gauss-Kruger CM 87E
-<epsg2426> +proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs  <>
-# Beijing 1954 / 3-degree Gauss-Kruger CM 90E
-<epsg2427> +proj=tmerc +lat_0=0 +lon_0=90 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs  <>
-# Beijing 1954 / 3-degree Gauss-Kruger CM 93E
-<epsg2428> +proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs  <>
-# Beijing 1954 / 3-degree Gauss-Kruger CM 96E
-<epsg2429> +proj=tmerc +lat_0=0 +lon_0=96 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs  <>
-# Beijing 1954 / 3-degree Gauss-Kruger CM 99E
-<epsg2430> +proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs  <>
-# Beijing 1954 / 3-degree Gauss-Kruger CM 102E
-<epsg2431> +proj=tmerc +lat_0=0 +lon_0=102 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs  <>
-# Beijing 1954 / 3-degree Gauss-Kruger CM 105E
-<epsg2432> +proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs  <>
-# Beijing 1954 / 3-degree Gauss-Kruger CM 108E
-<epsg2433> +proj=tmerc +lat_0=0 +lon_0=108 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs  <>
-# Beijing 1954 / 3-degree Gauss-Kruger CM 111E
-<epsg2434> +proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs  <>
-# Beijing 1954 / 3-degree Gauss-Kruger CM 114E
-<epsg2435> +proj=tmerc +lat_0=0 +lon_0=114 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs  <>
-# Beijing 1954 / 3-degree Gauss-Kruger CM 117E
-<epsg2436> +proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs  <>
-# Beijing 1954 / 3-degree Gauss-Kruger CM 120E
-<epsg2437> +proj=tmerc +lat_0=0 +lon_0=120 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs  <>
-# Beijing 1954 / 3-degree Gauss-Kruger CM 123E
-<epsg2438> +proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs  <>
-# Beijing 1954 / 3-degree Gauss-Kruger CM 126E
-<epsg2439> +proj=tmerc +lat_0=0 +lon_0=126 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs  <>
-# Beijing 1954 / 3-degree Gauss-Kruger CM 129E
-<epsg2440> +proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs  <>
-# Beijing 1954 / 3-degree Gauss-Kruger CM 132E
-<epsg2441> +proj=tmerc +lat_0=0 +lon_0=132 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs  <>
-# Beijing 1954 / 3-degree Gauss-Kruger CM 135E
-<epsg2442> +proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs  <>
-# JGD2000 / Japan Plane Rectangular CS I
-<epsg2443> +proj=tmerc +lat_0=33 +lon_0=129.5 +k=0.9999 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# JGD2000 / Japan Plane Rectangular CS II
-<epsg2444> +proj=tmerc +lat_0=33 +lon_0=131 +k=0.9999 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# JGD2000 / Japan Plane Rectangular CS III
-<epsg2445> +proj=tmerc +lat_0=36 +lon_0=132.1666666666667 +k=0.9999 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# JGD2000 / Japan Plane Rectangular CS IV
-<epsg2446> +proj=tmerc +lat_0=33 +lon_0=133.5 +k=0.9999 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# JGD2000 / Japan Plane Rectangular CS V
-<epsg2447> +proj=tmerc +lat_0=36 +lon_0=134.3333333333333 +k=0.9999 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# JGD2000 / Japan Plane Rectangular CS VI
-<epsg2448> +proj=tmerc +lat_0=36 +lon_0=136 +k=0.9999 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# JGD2000 / Japan Plane Rectangular CS VII
-<epsg2449> +proj=tmerc +lat_0=36 +lon_0=137.1666666666667 +k=0.9999 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# JGD2000 / Japan Plane Rectangular CS VIII
-<epsg2450> +proj=tmerc +lat_0=36 +lon_0=138.5 +k=0.9999 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# JGD2000 / Japan Plane Rectangular CS IX
-<epsg2451> +proj=tmerc +lat_0=36 +lon_0=139.8333333333333 +k=0.9999 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# JGD2000 / Japan Plane Rectangular CS X
-<epsg2452> +proj=tmerc +lat_0=40 +lon_0=140.8333333333333 +k=0.9999 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# JGD2000 / Japan Plane Rectangular CS XI
-<epsg2453> +proj=tmerc +lat_0=44 +lon_0=140.25 +k=0.9999 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# JGD2000 / Japan Plane Rectangular CS XII
-<epsg2454> +proj=tmerc +lat_0=44 +lon_0=142.25 +k=0.9999 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# JGD2000 / Japan Plane Rectangular CS XIII
-<epsg2455> +proj=tmerc +lat_0=44 +lon_0=144.25 +k=0.9999 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# JGD2000 / Japan Plane Rectangular CS XIV
-<epsg2456> +proj=tmerc +lat_0=26 +lon_0=142 +k=0.9999 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# JGD2000 / Japan Plane Rectangular CS XV
-<epsg2457> +proj=tmerc +lat_0=26 +lon_0=127.5 +k=0.9999 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# JGD2000 / Japan Plane Rectangular CS XVI
-<epsg2458> +proj=tmerc +lat_0=26 +lon_0=124 +k=0.9999 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# JGD2000 / Japan Plane Rectangular CS XVII
-<epsg2459> +proj=tmerc +lat_0=26 +lon_0=131 +k=0.9999 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# JGD2000 / Japan Plane Rectangular CS XVIII
-<epsg2460> +proj=tmerc +lat_0=20 +lon_0=136 +k=0.9999 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# JGD2000 / Japan Plane Rectangular CS XIX
-<epsg2461> +proj=tmerc +lat_0=26 +lon_0=154 +k=0.9999 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# Albanian 1987 / Gauss-Kruger zone 4
-<epsg2462> +proj=tmerc +lat_0=0 +lon_0=21 +k=1 +x_0=4500000 +y_0=0 +ellps=krass +units=m +no_defs  <>
-# Pulkovo 1995 / Gauss-Kruger CM 21E
-<epsg2463> +proj=tmerc +lat_0=0 +lon_0=21 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / Gauss-Kruger CM 27E
-<epsg2464> +proj=tmerc +lat_0=0 +lon_0=27 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / Gauss-Kruger CM 33E
-<epsg2465> +proj=tmerc +lat_0=0 +lon_0=33 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / Gauss-Kruger CM 39E
-<epsg2466> +proj=tmerc +lat_0=0 +lon_0=39 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / Gauss-Kruger CM 45E
-<epsg2467> +proj=tmerc +lat_0=0 +lon_0=45 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / Gauss-Kruger CM 51E
-<epsg2468> +proj=tmerc +lat_0=0 +lon_0=51 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / Gauss-Kruger CM 57E
-<epsg2469> +proj=tmerc +lat_0=0 +lon_0=57 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / Gauss-Kruger CM 63E
-<epsg2470> +proj=tmerc +lat_0=0 +lon_0=63 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / Gauss-Kruger CM 69E
-<epsg2471> +proj=tmerc +lat_0=0 +lon_0=69 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / Gauss-Kruger CM 75E
-<epsg2472> +proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / Gauss-Kruger CM 81E
-<epsg2473> +proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / Gauss-Kruger CM 87E
-<epsg2474> +proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / Gauss-Kruger CM 93E
-<epsg2475> +proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / Gauss-Kruger CM 99E
-<epsg2476> +proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / Gauss-Kruger CM 105E
-<epsg2477> +proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / Gauss-Kruger CM 111E
-<epsg2478> +proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / Gauss-Kruger CM 117E
-<epsg2479> +proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / Gauss-Kruger CM 123E
-<epsg2480> +proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / Gauss-Kruger CM 129E
-<epsg2481> +proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / Gauss-Kruger CM 135E
-<epsg2482> +proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / Gauss-Kruger CM 141E
-<epsg2483> +proj=tmerc +lat_0=0 +lon_0=141 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / Gauss-Kruger CM 147E
-<epsg2484> +proj=tmerc +lat_0=0 +lon_0=147 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / Gauss-Kruger CM 153E
-<epsg2485> +proj=tmerc +lat_0=0 +lon_0=153 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / Gauss-Kruger CM 159E
-<epsg2486> +proj=tmerc +lat_0=0 +lon_0=159 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / Gauss-Kruger CM 165E
-<epsg2487> +proj=tmerc +lat_0=0 +lon_0=165 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / Gauss-Kruger CM 171E
-<epsg2488> +proj=tmerc +lat_0=0 +lon_0=171 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / Gauss-Kruger CM 177E
-<epsg2489> +proj=tmerc +lat_0=0 +lon_0=177 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / Gauss-Kruger CM 177W
-<epsg2490> +proj=tmerc +lat_0=0 +lon_0=-177 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / Gauss-Kruger CM 171W
-<epsg2491> +proj=tmerc +lat_0=0 +lon_0=-171 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1942 / Gauss-Kruger CM 9E (deprecated)
-<epsg2492> +proj=tmerc +lat_0=0 +lon_0=9 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / Gauss-Kruger CM 15E (deprecated)
-<epsg2493> +proj=tmerc +lat_0=0 +lon_0=15 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / Gauss-Kruger CM 21E
-<epsg2494> +proj=tmerc +lat_0=0 +lon_0=21 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / Gauss-Kruger CM 27E
-<epsg2495> +proj=tmerc +lat_0=0 +lon_0=27 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / Gauss-Kruger CM 33E
-<epsg2496> +proj=tmerc +lat_0=0 +lon_0=33 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / Gauss-Kruger CM 39E
-<epsg2497> +proj=tmerc +lat_0=0 +lon_0=39 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / Gauss-Kruger CM 45E
-<epsg2498> +proj=tmerc +lat_0=0 +lon_0=45 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / Gauss-Kruger CM 51E
-<epsg2499> +proj=tmerc +lat_0=0 +lon_0=51 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / Gauss-Kruger CM 57E
-<epsg2500> +proj=tmerc +lat_0=0 +lon_0=57 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / Gauss-Kruger CM 63E
-<epsg2501> +proj=tmerc +lat_0=0 +lon_0=63 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / Gauss-Kruger CM 69E
-<epsg2502> +proj=tmerc +lat_0=0 +lon_0=69 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / Gauss-Kruger CM 75E
-<epsg2503> +proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / Gauss-Kruger CM 81E
-<epsg2504> +proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / Gauss-Kruger CM 87E
-<epsg2505> +proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / Gauss-Kruger CM 93E
-<epsg2506> +proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / Gauss-Kruger CM 99E
-<epsg2507> +proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / Gauss-Kruger CM 105E
-<epsg2508> +proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / Gauss-Kruger CM 111E
-<epsg2509> +proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / Gauss-Kruger CM 117E
-<epsg2510> +proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / Gauss-Kruger CM 123E
-<epsg2511> +proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / Gauss-Kruger CM 129E
-<epsg2512> +proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / Gauss-Kruger CM 135E
-<epsg2513> +proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / Gauss-Kruger CM 141E
-<epsg2514> +proj=tmerc +lat_0=0 +lon_0=141 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / Gauss-Kruger CM 147E
-<epsg2515> +proj=tmerc +lat_0=0 +lon_0=147 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / Gauss-Kruger CM 153E
-<epsg2516> +proj=tmerc +lat_0=0 +lon_0=153 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / Gauss-Kruger CM 159E
-<epsg2517> +proj=tmerc +lat_0=0 +lon_0=159 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / Gauss-Kruger CM 165E
-<epsg2518> +proj=tmerc +lat_0=0 +lon_0=165 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / Gauss-Kruger CM 171E
-<epsg2519> +proj=tmerc +lat_0=0 +lon_0=171 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / Gauss-Kruger CM 177E
-<epsg2520> +proj=tmerc +lat_0=0 +lon_0=177 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / Gauss-Kruger CM 177W
-<epsg2521> +proj=tmerc +lat_0=0 +lon_0=-177 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / Gauss-Kruger CM 171W
-<epsg2522> +proj=tmerc +lat_0=0 +lon_0=-171 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger zone 7
-<epsg2523> +proj=tmerc +lat_0=0 +lon_0=21 +k=1 +x_0=7500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger zone 8
-<epsg2524> +proj=tmerc +lat_0=0 +lon_0=24 +k=1 +x_0=8500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger zone 9
-<epsg2525> +proj=tmerc +lat_0=0 +lon_0=27 +k=1 +x_0=9500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger zone 10
-<epsg2526> +proj=tmerc +lat_0=0 +lon_0=30 +k=1 +x_0=10500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger zone 11
-<epsg2527> +proj=tmerc +lat_0=0 +lon_0=33 +k=1 +x_0=11500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger zone 12
-<epsg2528> +proj=tmerc +lat_0=0 +lon_0=36 +k=1 +x_0=12500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger zone 13
-<epsg2529> +proj=tmerc +lat_0=0 +lon_0=39 +k=1 +x_0=13500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger zone 14
-<epsg2530> +proj=tmerc +lat_0=0 +lon_0=42 +k=1 +x_0=14500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger zone 15
-<epsg2531> +proj=tmerc +lat_0=0 +lon_0=45 +k=1 +x_0=15500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger zone 16
-<epsg2532> +proj=tmerc +lat_0=0 +lon_0=48 +k=1 +x_0=16500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger zone 17
-<epsg2533> +proj=tmerc +lat_0=0 +lon_0=51 +k=1 +x_0=17500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger zone 18
-<epsg2534> +proj=tmerc +lat_0=0 +lon_0=54 +k=1 +x_0=18500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger zone 19
-<epsg2535> +proj=tmerc +lat_0=0 +lon_0=57 +k=1 +x_0=19500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger zone 20
-<epsg2536> +proj=tmerc +lat_0=0 +lon_0=60 +k=1 +x_0=20500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger zone 21
-<epsg2537> +proj=tmerc +lat_0=0 +lon_0=63 +k=1 +x_0=21500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger zone 22
-<epsg2538> +proj=tmerc +lat_0=0 +lon_0=66 +k=1 +x_0=22500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger zone 23
-<epsg2539> +proj=tmerc +lat_0=0 +lon_0=69 +k=1 +x_0=23500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger zone 24
-<epsg2540> +proj=tmerc +lat_0=0 +lon_0=72 +k=1 +x_0=24500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger zone 25
-<epsg2541> +proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=25500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger zone 26
-<epsg2542> +proj=tmerc +lat_0=0 +lon_0=78 +k=1 +x_0=26500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger zone 27
-<epsg2543> +proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=27500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger zone 28
-<epsg2544> +proj=tmerc +lat_0=0 +lon_0=84 +k=1 +x_0=28500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger zone 29
-<epsg2545> +proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=29500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger zone 30
-<epsg2546> +proj=tmerc +lat_0=0 +lon_0=90 +k=1 +x_0=30500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger zone 31
-<epsg2547> +proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=31500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger zone 32
-<epsg2548> +proj=tmerc +lat_0=0 +lon_0=96 +k=1 +x_0=32500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger zone 33
-<epsg2549> +proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=33500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Samboja / UTM zone 50S (deprecated)
-<epsg2550> +proj=utm +zone=50 +south +ellps=bessel +towgs84=-404.78,685.68,45.47,0,0,0,0 +units=m +no_defs  <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger zone 34
-<epsg2551> +proj=tmerc +lat_0=0 +lon_0=102 +k=1 +x_0=34500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger zone 35
-<epsg2552> +proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=35500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger zone 36
-<epsg2553> +proj=tmerc +lat_0=0 +lon_0=108 +k=1 +x_0=36500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger zone 37
-<epsg2554> +proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=37500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger zone 38
-<epsg2555> +proj=tmerc +lat_0=0 +lon_0=114 +k=1 +x_0=38500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger zone 39
-<epsg2556> +proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=39500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger zone 40
-<epsg2557> +proj=tmerc +lat_0=0 +lon_0=120 +k=1 +x_0=40500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger zone 41
-<epsg2558> +proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=41500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger zone 42
-<epsg2559> +proj=tmerc +lat_0=0 +lon_0=126 +k=1 +x_0=42500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger zone 43
-<epsg2560> +proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=43500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger zone 44
-<epsg2561> +proj=tmerc +lat_0=0 +lon_0=132 +k=1 +x_0=44500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger zone 45
-<epsg2562> +proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=45500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger zone 46
-<epsg2563> +proj=tmerc +lat_0=0 +lon_0=138 +k=1 +x_0=46500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger zone 47
-<epsg2564> +proj=tmerc +lat_0=0 +lon_0=141 +k=1 +x_0=47500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger zone 48
-<epsg2565> +proj=tmerc +lat_0=0 +lon_0=144 +k=1 +x_0=48500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger zone 49
-<epsg2566> +proj=tmerc +lat_0=0 +lon_0=147 +k=1 +x_0=49500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger zone 50
-<epsg2567> +proj=tmerc +lat_0=0 +lon_0=150 +k=1 +x_0=50500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger zone 51
-<epsg2568> +proj=tmerc +lat_0=0 +lon_0=153 +k=1 +x_0=51500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger zone 52
-<epsg2569> +proj=tmerc +lat_0=0 +lon_0=156 +k=1 +x_0=52500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger zone 53
-<epsg2570> +proj=tmerc +lat_0=0 +lon_0=159 +k=1 +x_0=53500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger zone 54
-<epsg2571> +proj=tmerc +lat_0=0 +lon_0=162 +k=1 +x_0=54500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger zone 55
-<epsg2572> +proj=tmerc +lat_0=0 +lon_0=165 +k=1 +x_0=55500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger zone 56
-<epsg2573> +proj=tmerc +lat_0=0 +lon_0=168 +k=1 +x_0=56500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger zone 57
-<epsg2574> +proj=tmerc +lat_0=0 +lon_0=171 +k=1 +x_0=57500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger zone 58
-<epsg2575> +proj=tmerc +lat_0=0 +lon_0=174 +k=1 +x_0=58500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger zone 59
-<epsg2576> +proj=tmerc +lat_0=0 +lon_0=177 +k=1 +x_0=59500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger zone 60 (deprecated)
-<epsg2577> +proj=tmerc +lat_0=0 +lon_0=180 +k=1 +x_0=60000000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger zone 61
-<epsg2578> +proj=tmerc +lat_0=0 +lon_0=-177 +k=1 +x_0=61500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger zone 62
-<epsg2579> +proj=tmerc +lat_0=0 +lon_0=-174 +k=1 +x_0=62500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger zone 63
-<epsg2580> +proj=tmerc +lat_0=0 +lon_0=-171 +k=1 +x_0=63500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger zone 64
-<epsg2581> +proj=tmerc +lat_0=0 +lon_0=-168 +k=1 +x_0=64500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger CM 21E
-<epsg2582> +proj=tmerc +lat_0=0 +lon_0=21 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger CM 24E
-<epsg2583> +proj=tmerc +lat_0=0 +lon_0=24 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger CM 27E
-<epsg2584> +proj=tmerc +lat_0=0 +lon_0=27 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger CM 30E
-<epsg2585> +proj=tmerc +lat_0=0 +lon_0=30 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger CM 33E
-<epsg2586> +proj=tmerc +lat_0=0 +lon_0=33 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger CM 36E
-<epsg2587> +proj=tmerc +lat_0=0 +lon_0=36 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger CM 39E
-<epsg2588> +proj=tmerc +lat_0=0 +lon_0=39 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger CM 42E
-<epsg2589> +proj=tmerc +lat_0=0 +lon_0=42 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger CM 45E
-<epsg2590> +proj=tmerc +lat_0=0 +lon_0=45 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger CM 48E
-<epsg2591> +proj=tmerc +lat_0=0 +lon_0=48 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger CM 51E
-<epsg2592> +proj=tmerc +lat_0=0 +lon_0=51 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger CM 54E
-<epsg2593> +proj=tmerc +lat_0=0 +lon_0=54 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger CM 57E
-<epsg2594> +proj=tmerc +lat_0=0 +lon_0=57 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger CM 60E
-<epsg2595> +proj=tmerc +lat_0=0 +lon_0=60 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger CM 63E
-<epsg2596> +proj=tmerc +lat_0=0 +lon_0=63 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger CM 66E
-<epsg2597> +proj=tmerc +lat_0=0 +lon_0=66 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger CM 69E
-<epsg2598> +proj=tmerc +lat_0=0 +lon_0=69 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger CM 72E
-<epsg2599> +proj=tmerc +lat_0=0 +lon_0=72 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Lietuvos Koordinoei Sistema 1994 (deprecated)
-<epsg2600> +proj=tmerc +lat_0=0 +lon_0=24 +k=0.9998 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger CM 75E
-<epsg2601> +proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger CM 78E
-<epsg2602> +proj=tmerc +lat_0=0 +lon_0=78 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger CM 81E
-<epsg2603> +proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger CM 84E
-<epsg2604> +proj=tmerc +lat_0=0 +lon_0=84 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger CM 87E
-<epsg2605> +proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger CM 90E
-<epsg2606> +proj=tmerc +lat_0=0 +lon_0=90 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger CM 93E
-<epsg2607> +proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger CM 96E
-<epsg2608> +proj=tmerc +lat_0=0 +lon_0=96 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger CM 99E
-<epsg2609> +proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger CM 102E
-<epsg2610> +proj=tmerc +lat_0=0 +lon_0=102 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger CM 105E
-<epsg2611> +proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger CM 108E
-<epsg2612> +proj=tmerc +lat_0=0 +lon_0=108 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger CM 111E
-<epsg2613> +proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger CM 114E
-<epsg2614> +proj=tmerc +lat_0=0 +lon_0=114 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger CM 117E
-<epsg2615> +proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger CM 120E
-<epsg2616> +proj=tmerc +lat_0=0 +lon_0=120 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger CM 123E
-<epsg2617> +proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger CM 126E
-<epsg2618> +proj=tmerc +lat_0=0 +lon_0=126 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger CM 129E
-<epsg2619> +proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger CM 132E
-<epsg2620> +proj=tmerc +lat_0=0 +lon_0=132 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger CM 135E
-<epsg2621> +proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger CM 138E
-<epsg2622> +proj=tmerc +lat_0=0 +lon_0=138 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger CM 141E
-<epsg2623> +proj=tmerc +lat_0=0 +lon_0=141 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger CM 144E
-<epsg2624> +proj=tmerc +lat_0=0 +lon_0=144 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger CM 147E
-<epsg2625> +proj=tmerc +lat_0=0 +lon_0=147 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger CM 150E
-<epsg2626> +proj=tmerc +lat_0=0 +lon_0=150 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger CM 153E
-<epsg2627> +proj=tmerc +lat_0=0 +lon_0=153 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger CM 156E
-<epsg2628> +proj=tmerc +lat_0=0 +lon_0=156 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger CM 159E
-<epsg2629> +proj=tmerc +lat_0=0 +lon_0=159 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger CM 162E
-<epsg2630> +proj=tmerc +lat_0=0 +lon_0=162 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger CM 165E
-<epsg2631> +proj=tmerc +lat_0=0 +lon_0=165 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger CM 168E
-<epsg2632> +proj=tmerc +lat_0=0 +lon_0=168 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger CM 171E
-<epsg2633> +proj=tmerc +lat_0=0 +lon_0=171 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger CM 174E
-<epsg2634> +proj=tmerc +lat_0=0 +lon_0=174 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger CM 177E
-<epsg2635> +proj=tmerc +lat_0=0 +lon_0=177 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger CM 180E
-<epsg2636> +proj=tmerc +lat_0=0 +lon_0=180 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger CM 177W
-<epsg2637> +proj=tmerc +lat_0=0 +lon_0=-177 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger CM 174W
-<epsg2638> +proj=tmerc +lat_0=0 +lon_0=-174 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger CM 171W
-<epsg2639> +proj=tmerc +lat_0=0 +lon_0=-171 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger CM 168W
-<epsg2640> +proj=tmerc +lat_0=0 +lon_0=-168 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger zone 7
-<epsg2641> +proj=tmerc +lat_0=0 +lon_0=21 +k=1 +x_0=7500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger zone 8
-<epsg2642> +proj=tmerc +lat_0=0 +lon_0=24 +k=1 +x_0=8500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger zone 9
-<epsg2643> +proj=tmerc +lat_0=0 +lon_0=27 +k=1 +x_0=9500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger zone 10
-<epsg2644> +proj=tmerc +lat_0=0 +lon_0=30 +k=1 +x_0=10500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger zone 11
-<epsg2645> +proj=tmerc +lat_0=0 +lon_0=33 +k=1 +x_0=11500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger zone 12
-<epsg2646> +proj=tmerc +lat_0=0 +lon_0=36 +k=1 +x_0=12500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger zone 13
-<epsg2647> +proj=tmerc +lat_0=0 +lon_0=39 +k=1 +x_0=13500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger zone 14
-<epsg2648> +proj=tmerc +lat_0=0 +lon_0=42 +k=1 +x_0=14500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger zone 15
-<epsg2649> +proj=tmerc +lat_0=0 +lon_0=45 +k=1 +x_0=15500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger zone 16
-<epsg2650> +proj=tmerc +lat_0=0 +lon_0=48 +k=1 +x_0=16500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger zone 17
-<epsg2651> +proj=tmerc +lat_0=0 +lon_0=51 +k=1 +x_0=17500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger zone 18
-<epsg2652> +proj=tmerc +lat_0=0 +lon_0=54 +k=1 +x_0=18500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger zone 19
-<epsg2653> +proj=tmerc +lat_0=0 +lon_0=57 +k=1 +x_0=19500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger zone 20
-<epsg2654> +proj=tmerc +lat_0=0 +lon_0=60 +k=1 +x_0=20500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger zone 21
-<epsg2655> +proj=tmerc +lat_0=0 +lon_0=63 +k=1 +x_0=21500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger zone 22
-<epsg2656> +proj=tmerc +lat_0=0 +lon_0=66 +k=1 +x_0=22500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger zone 23
-<epsg2657> +proj=tmerc +lat_0=0 +lon_0=69 +k=1 +x_0=23500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger zone 24
-<epsg2658> +proj=tmerc +lat_0=0 +lon_0=72 +k=1 +x_0=24500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger zone 25
-<epsg2659> +proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=25500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger zone 26
-<epsg2660> +proj=tmerc +lat_0=0 +lon_0=78 +k=1 +x_0=26500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger zone 27
-<epsg2661> +proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=27500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger zone 28
-<epsg2662> +proj=tmerc +lat_0=0 +lon_0=84 +k=1 +x_0=28500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger zone 29
-<epsg2663> +proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=29500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger zone 30
-<epsg2664> +proj=tmerc +lat_0=0 +lon_0=90 +k=1 +x_0=30500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger zone 31
-<epsg2665> +proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=31500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger zone 32
-<epsg2666> +proj=tmerc +lat_0=0 +lon_0=96 +k=1 +x_0=32500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger zone 33
-<epsg2667> +proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=33500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger zone 34
-<epsg2668> +proj=tmerc +lat_0=0 +lon_0=102 +k=1 +x_0=34500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger zone 35
-<epsg2669> +proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=35500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger zone 36
-<epsg2670> +proj=tmerc +lat_0=0 +lon_0=108 +k=1 +x_0=36500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger zone 37
-<epsg2671> +proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=37500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger zone 38
-<epsg2672> +proj=tmerc +lat_0=0 +lon_0=114 +k=1 +x_0=38500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger zone 39
-<epsg2673> +proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=39500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger zone 40
-<epsg2674> +proj=tmerc +lat_0=0 +lon_0=120 +k=1 +x_0=40500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger zone 41
-<epsg2675> +proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=41500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger zone 42
-<epsg2676> +proj=tmerc +lat_0=0 +lon_0=126 +k=1 +x_0=42500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger zone 43
-<epsg2677> +proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=43500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger zone 44
-<epsg2678> +proj=tmerc +lat_0=0 +lon_0=132 +k=1 +x_0=44500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger zone 45
-<epsg2679> +proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=45500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger zone 46
-<epsg2680> +proj=tmerc +lat_0=0 +lon_0=138 +k=1 +x_0=46500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger zone 47
-<epsg2681> +proj=tmerc +lat_0=0 +lon_0=141 +k=1 +x_0=47500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger zone 48
-<epsg2682> +proj=tmerc +lat_0=0 +lon_0=144 +k=1 +x_0=48500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger zone 49
-<epsg2683> +proj=tmerc +lat_0=0 +lon_0=147 +k=1 +x_0=49500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger zone 50
-<epsg2684> +proj=tmerc +lat_0=0 +lon_0=150 +k=1 +x_0=50500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger zone 51
-<epsg2685> +proj=tmerc +lat_0=0 +lon_0=153 +k=1 +x_0=51500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger zone 52
-<epsg2686> +proj=tmerc +lat_0=0 +lon_0=156 +k=1 +x_0=52500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger zone 53
-<epsg2687> +proj=tmerc +lat_0=0 +lon_0=159 +k=1 +x_0=53500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger zone 54
-<epsg2688> +proj=tmerc +lat_0=0 +lon_0=162 +k=1 +x_0=54500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger zone 55
-<epsg2689> +proj=tmerc +lat_0=0 +lon_0=165 +k=1 +x_0=55500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger zone 56
-<epsg2690> +proj=tmerc +lat_0=0 +lon_0=168 +k=1 +x_0=56500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger zone 57
-<epsg2691> +proj=tmerc +lat_0=0 +lon_0=171 +k=1 +x_0=57500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger zone 58
-<epsg2692> +proj=tmerc +lat_0=0 +lon_0=174 +k=1 +x_0=58500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger zone 59
-<epsg2693> +proj=tmerc +lat_0=0 +lon_0=177 +k=1 +x_0=59500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger zone 60 (deprecated)
-<epsg2694> +proj=tmerc +lat_0=0 +lon_0=180 +k=1 +x_0=60000000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger zone 61
-<epsg2695> +proj=tmerc +lat_0=0 +lon_0=-177 +k=1 +x_0=61500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger zone 62
-<epsg2696> +proj=tmerc +lat_0=0 +lon_0=-174 +k=1 +x_0=62500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger zone 63
-<epsg2697> +proj=tmerc +lat_0=0 +lon_0=-171 +k=1 +x_0=63500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger zone 64
-<epsg2698> +proj=tmerc +lat_0=0 +lon_0=-168 +k=1 +x_0=64500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger CM 21E
-<epsg2699> +proj=tmerc +lat_0=0 +lon_0=21 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger CM 24E
-<epsg2700> +proj=tmerc +lat_0=0 +lon_0=24 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger CM 27E
-<epsg2701> +proj=tmerc +lat_0=0 +lon_0=27 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger CM 30E
-<epsg2702> +proj=tmerc +lat_0=0 +lon_0=30 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger CM 33E
-<epsg2703> +proj=tmerc +lat_0=0 +lon_0=33 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger CM 36E
-<epsg2704> +proj=tmerc +lat_0=0 +lon_0=36 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger CM 39E
-<epsg2705> +proj=tmerc +lat_0=0 +lon_0=39 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger CM 42E
-<epsg2706> +proj=tmerc +lat_0=0 +lon_0=42 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger CM 45E
-<epsg2707> +proj=tmerc +lat_0=0 +lon_0=45 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger CM 48E
-<epsg2708> +proj=tmerc +lat_0=0 +lon_0=48 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger CM 51E
-<epsg2709> +proj=tmerc +lat_0=0 +lon_0=51 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger CM 54E
-<epsg2710> +proj=tmerc +lat_0=0 +lon_0=54 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger CM 57E
-<epsg2711> +proj=tmerc +lat_0=0 +lon_0=57 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger CM 60E
-<epsg2712> +proj=tmerc +lat_0=0 +lon_0=60 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger CM 63E
-<epsg2713> +proj=tmerc +lat_0=0 +lon_0=63 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger CM 66E
-<epsg2714> +proj=tmerc +lat_0=0 +lon_0=66 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger CM 69E
-<epsg2715> +proj=tmerc +lat_0=0 +lon_0=69 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger CM 72E
-<epsg2716> +proj=tmerc +lat_0=0 +lon_0=72 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger CM 75E
-<epsg2717> +proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger CM 78E
-<epsg2718> +proj=tmerc +lat_0=0 +lon_0=78 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger CM 81E
-<epsg2719> +proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger CM 84E
-<epsg2720> +proj=tmerc +lat_0=0 +lon_0=84 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger CM 87E
-<epsg2721> +proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger CM 90E
-<epsg2722> +proj=tmerc +lat_0=0 +lon_0=90 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger CM 93E
-<epsg2723> +proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger CM 96E
-<epsg2724> +proj=tmerc +lat_0=0 +lon_0=96 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger CM 99E
-<epsg2725> +proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger CM 102E
-<epsg2726> +proj=tmerc +lat_0=0 +lon_0=102 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger CM 105E
-<epsg2727> +proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger CM 108E
-<epsg2728> +proj=tmerc +lat_0=0 +lon_0=108 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger CM 111E
-<epsg2729> +proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger CM 114E
-<epsg2730> +proj=tmerc +lat_0=0 +lon_0=114 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger CM 117E
-<epsg2731> +proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger CM 120E
-<epsg2732> +proj=tmerc +lat_0=0 +lon_0=120 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger CM 123E
-<epsg2733> +proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger CM 126E
-<epsg2734> +proj=tmerc +lat_0=0 +lon_0=126 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger CM 129E
-<epsg2735> +proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Tete / UTM zone 36S
-<epsg2736> +proj=utm +zone=36 +south +ellps=clrk66 +towgs84=219.315,168.975,-166.145,0.198,5.926,-2.356,-57.104 +units=m +no_defs  <>
-# Tete / UTM zone 37S
-<epsg2737> +proj=utm +zone=37 +south +ellps=clrk66 +towgs84=219.315,168.975,-166.145,0.198,5.926,-2.356,-57.104 +units=m +no_defs  <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger CM 132E
-<epsg2738> +proj=tmerc +lat_0=0 +lon_0=132 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger CM 135E
-<epsg2739> +proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger CM 138E
-<epsg2740> +proj=tmerc +lat_0=0 +lon_0=138 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger CM 141E
-<epsg2741> +proj=tmerc +lat_0=0 +lon_0=141 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger CM 144E
-<epsg2742> +proj=tmerc +lat_0=0 +lon_0=144 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger CM 147E
-<epsg2743> +proj=tmerc +lat_0=0 +lon_0=147 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger CM 150E
-<epsg2744> +proj=tmerc +lat_0=0 +lon_0=150 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger CM 153E
-<epsg2745> +proj=tmerc +lat_0=0 +lon_0=153 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger CM 156E
-<epsg2746> +proj=tmerc +lat_0=0 +lon_0=156 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger CM 159E
-<epsg2747> +proj=tmerc +lat_0=0 +lon_0=159 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger CM 162E
-<epsg2748> +proj=tmerc +lat_0=0 +lon_0=162 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger CM 165E
-<epsg2749> +proj=tmerc +lat_0=0 +lon_0=165 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger CM 168E
-<epsg2750> +proj=tmerc +lat_0=0 +lon_0=168 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger CM 171E
-<epsg2751> +proj=tmerc +lat_0=0 +lon_0=171 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger CM 174E
-<epsg2752> +proj=tmerc +lat_0=0 +lon_0=174 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger CM 177E
-<epsg2753> +proj=tmerc +lat_0=0 +lon_0=177 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger CM 180E
-<epsg2754> +proj=tmerc +lat_0=0 +lon_0=180 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger CM 177W
-<epsg2755> +proj=tmerc +lat_0=0 +lon_0=-177 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger CM 174W
-<epsg2756> +proj=tmerc +lat_0=0 +lon_0=-174 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger CM 171W
-<epsg2757> +proj=tmerc +lat_0=0 +lon_0=-171 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger CM 168W
-<epsg2758> +proj=tmerc +lat_0=0 +lon_0=-168 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# NAD83(HARN) / Alabama East
-<epsg2759> +proj=tmerc +lat_0=30.5 +lon_0=-85.83333333333333 +k=0.99996 +x_0=200000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / Alabama West
-<epsg2760> +proj=tmerc +lat_0=30 +lon_0=-87.5 +k=0.999933333 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / Arizona East
-<epsg2761> +proj=tmerc +lat_0=31 +lon_0=-110.1666666666667 +k=0.9999 +x_0=213360 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / Arizona Central
-<epsg2762> +proj=tmerc +lat_0=31 +lon_0=-111.9166666666667 +k=0.9999 +x_0=213360 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / Arizona West
-<epsg2763> +proj=tmerc +lat_0=31 +lon_0=-113.75 +k=0.999933333 +x_0=213360 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / Arkansas North
-<epsg2764> +proj=lcc +lat_1=36.23333333333333 +lat_2=34.93333333333333 +lat_0=34.33333333333334 +lon_0=-92 +x_0=400000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / Arkansas South
-<epsg2765> +proj=lcc +lat_1=34.76666666666667 +lat_2=33.3 +lat_0=32.66666666666666 +lon_0=-92 +x_0=400000 +y_0=400000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / California zone 1
-<epsg2766> +proj=lcc +lat_1=41.66666666666666 +lat_2=40 +lat_0=39.33333333333334 +lon_0=-122 +x_0=2000000 +y_0=500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / California zone 2
-<epsg2767> +proj=lcc +lat_1=39.83333333333334 +lat_2=38.33333333333334 +lat_0=37.66666666666666 +lon_0=-122 +x_0=2000000 +y_0=500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / California zone 3
-<epsg2768> +proj=lcc +lat_1=38.43333333333333 +lat_2=37.06666666666667 +lat_0=36.5 +lon_0=-120.5 +x_0=2000000 +y_0=500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / California zone 4
-<epsg2769> +proj=lcc +lat_1=37.25 +lat_2=36 +lat_0=35.33333333333334 +lon_0=-119 +x_0=2000000 +y_0=500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / California zone 5
-<epsg2770> +proj=lcc +lat_1=35.46666666666667 +lat_2=34.03333333333333 +lat_0=33.5 +lon_0=-118 +x_0=2000000 +y_0=500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / California zone 6
-<epsg2771> +proj=lcc +lat_1=33.88333333333333 +lat_2=32.78333333333333 +lat_0=32.16666666666666 +lon_0=-116.25 +x_0=2000000 +y_0=500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / Colorado North
-<epsg2772> +proj=lcc +lat_1=40.78333333333333 +lat_2=39.71666666666667 +lat_0=39.33333333333334 +lon_0=-105.5 +x_0=914401.8289 +y_0=304800.6096 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / Colorado Central
-<epsg2773> +proj=lcc +lat_1=39.75 +lat_2=38.45 +lat_0=37.83333333333334 +lon_0=-105.5 +x_0=914401.8289 +y_0=304800.6096 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / Colorado South
-<epsg2774> +proj=lcc +lat_1=38.43333333333333 +lat_2=37.23333333333333 +lat_0=36.66666666666666 +lon_0=-105.5 +x_0=914401.8289 +y_0=304800.6096 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / Connecticut
-<epsg2775> +proj=lcc +lat_1=41.86666666666667 +lat_2=41.2 +lat_0=40.83333333333334 +lon_0=-72.75 +x_0=304800.6096 +y_0=152400.3048 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / Delaware
-<epsg2776> +proj=tmerc +lat_0=38 +lon_0=-75.41666666666667 +k=0.999995 +x_0=200000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / Florida East
-<epsg2777> +proj=tmerc +lat_0=24.33333333333333 +lon_0=-81 +k=0.999941177 +x_0=200000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / Florida West
-<epsg2778> +proj=tmerc +lat_0=24.33333333333333 +lon_0=-82 +k=0.999941177 +x_0=200000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / Florida North
-<epsg2779> +proj=lcc +lat_1=30.75 +lat_2=29.58333333333333 +lat_0=29 +lon_0=-84.5 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / Georgia East
-<epsg2780> +proj=tmerc +lat_0=30 +lon_0=-82.16666666666667 +k=0.9999 +x_0=200000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / Georgia West
-<epsg2781> +proj=tmerc +lat_0=30 +lon_0=-84.16666666666667 +k=0.9999 +x_0=700000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / Hawaii zone 1
-<epsg2782> +proj=tmerc +lat_0=18.83333333333333 +lon_0=-155.5 +k=0.999966667 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / Hawaii zone 2
-<epsg2783> +proj=tmerc +lat_0=20.33333333333333 +lon_0=-156.6666666666667 +k=0.999966667 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / Hawaii zone 3
-<epsg2784> +proj=tmerc +lat_0=21.16666666666667 +lon_0=-158 +k=0.99999 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / Hawaii zone 4
-<epsg2785> +proj=tmerc +lat_0=21.83333333333333 +lon_0=-159.5 +k=0.99999 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / Hawaii zone 5
-<epsg2786> +proj=tmerc +lat_0=21.66666666666667 +lon_0=-160.1666666666667 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / Idaho East
-<epsg2787> +proj=tmerc +lat_0=41.66666666666666 +lon_0=-112.1666666666667 +k=0.9999473679999999 +x_0=200000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / Idaho Central
-<epsg2788> +proj=tmerc +lat_0=41.66666666666666 +lon_0=-114 +k=0.9999473679999999 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / Idaho West
-<epsg2789> +proj=tmerc +lat_0=41.66666666666666 +lon_0=-115.75 +k=0.999933333 +x_0=800000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / Illinois East
-<epsg2790> +proj=tmerc +lat_0=36.66666666666666 +lon_0=-88.33333333333333 +k=0.9999749999999999 +x_0=300000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / Illinois West
-<epsg2791> +proj=tmerc +lat_0=36.66666666666666 +lon_0=-90.16666666666667 +k=0.999941177 +x_0=700000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / Indiana East
-<epsg2792> +proj=tmerc +lat_0=37.5 +lon_0=-85.66666666666667 +k=0.999966667 +x_0=100000 +y_0=250000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / Indiana West
-<epsg2793> +proj=tmerc +lat_0=37.5 +lon_0=-87.08333333333333 +k=0.999966667 +x_0=900000 +y_0=250000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / Iowa North
-<epsg2794> +proj=lcc +lat_1=43.26666666666667 +lat_2=42.06666666666667 +lat_0=41.5 +lon_0=-93.5 +x_0=1500000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / Iowa South
-<epsg2795> +proj=lcc +lat_1=41.78333333333333 +lat_2=40.61666666666667 +lat_0=40 +lon_0=-93.5 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / Kansas North
-<epsg2796> +proj=lcc +lat_1=39.78333333333333 +lat_2=38.71666666666667 +lat_0=38.33333333333334 +lon_0=-98 +x_0=400000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / Kansas South
-<epsg2797> +proj=lcc +lat_1=38.56666666666667 +lat_2=37.26666666666667 +lat_0=36.66666666666666 +lon_0=-98.5 +x_0=400000 +y_0=400000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / Kentucky North
-<epsg2798> +proj=lcc +lat_1=37.96666666666667 +lat_2=38.96666666666667 +lat_0=37.5 +lon_0=-84.25 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / Kentucky South
-<epsg2799> +proj=lcc +lat_1=37.93333333333333 +lat_2=36.73333333333333 +lat_0=36.33333333333334 +lon_0=-85.75 +x_0=500000 +y_0=500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / Louisiana North
-<epsg2800> +proj=lcc +lat_1=32.66666666666666 +lat_2=31.16666666666667 +lat_0=30.5 +lon_0=-92.5 +x_0=1000000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / Louisiana South
-<epsg2801> +proj=lcc +lat_1=30.7 +lat_2=29.3 +lat_0=28.5 +lon_0=-91.33333333333333 +x_0=1000000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / Maine East
-<epsg2802> +proj=tmerc +lat_0=43.66666666666666 +lon_0=-68.5 +k=0.9999 +x_0=300000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / Maine West
-<epsg2803> +proj=tmerc +lat_0=42.83333333333334 +lon_0=-70.16666666666667 +k=0.999966667 +x_0=900000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / Maryland
-<epsg2804> +proj=lcc +lat_1=39.45 +lat_2=38.3 +lat_0=37.66666666666666 +lon_0=-77 +x_0=400000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / Massachusetts Mainland
-<epsg2805> +proj=lcc +lat_1=42.68333333333333 +lat_2=41.71666666666667 +lat_0=41 +lon_0=-71.5 +x_0=200000 +y_0=750000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / Massachusetts Island
-<epsg2806> +proj=lcc +lat_1=41.48333333333333 +lat_2=41.28333333333333 +lat_0=41 +lon_0=-70.5 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / Michigan North
-<epsg2807> +proj=lcc +lat_1=47.08333333333334 +lat_2=45.48333333333333 +lat_0=44.78333333333333 +lon_0=-87 +x_0=8000000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / Michigan Central
-<epsg2808> +proj=lcc +lat_1=45.7 +lat_2=44.18333333333333 +lat_0=43.31666666666667 +lon_0=-84.36666666666666 +x_0=6000000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / Michigan South
-<epsg2809> +proj=lcc +lat_1=43.66666666666666 +lat_2=42.1 +lat_0=41.5 +lon_0=-84.36666666666666 +x_0=4000000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / Minnesota North
-<epsg2810> +proj=lcc +lat_1=48.63333333333333 +lat_2=47.03333333333333 +lat_0=46.5 +lon_0=-93.09999999999999 +x_0=800000 +y_0=100000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / Minnesota Central
-<epsg2811> +proj=lcc +lat_1=47.05 +lat_2=45.61666666666667 +lat_0=45 +lon_0=-94.25 +x_0=800000 +y_0=100000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / Minnesota South
-<epsg2812> +proj=lcc +lat_1=45.21666666666667 +lat_2=43.78333333333333 +lat_0=43 +lon_0=-94 +x_0=800000 +y_0=100000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / Mississippi East
-<epsg2813> +proj=tmerc +lat_0=29.5 +lon_0=-88.83333333333333 +k=0.99995 +x_0=300000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / Mississippi West
-<epsg2814> +proj=tmerc +lat_0=29.5 +lon_0=-90.33333333333333 +k=0.99995 +x_0=700000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / Missouri East
-<epsg2815> +proj=tmerc +lat_0=35.83333333333334 +lon_0=-90.5 +k=0.999933333 +x_0=250000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / Missouri Central
-<epsg2816> +proj=tmerc +lat_0=35.83333333333334 +lon_0=-92.5 +k=0.999933333 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / Missouri West
-<epsg2817> +proj=tmerc +lat_0=36.16666666666666 +lon_0=-94.5 +k=0.999941177 +x_0=850000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / Montana
-<epsg2818> +proj=lcc +lat_1=49 +lat_2=45 +lat_0=44.25 +lon_0=-109.5 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / Nebraska
-<epsg2819> +proj=lcc +lat_1=43 +lat_2=40 +lat_0=39.83333333333334 +lon_0=-100 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / Nevada East
-<epsg2820> +proj=tmerc +lat_0=34.75 +lon_0=-115.5833333333333 +k=0.9999 +x_0=200000 +y_0=8000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / Nevada Central
-<epsg2821> +proj=tmerc +lat_0=34.75 +lon_0=-116.6666666666667 +k=0.9999 +x_0=500000 +y_0=6000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / Nevada West
-<epsg2822> +proj=tmerc +lat_0=34.75 +lon_0=-118.5833333333333 +k=0.9999 +x_0=800000 +y_0=4000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / New Hampshire
-<epsg2823> +proj=tmerc +lat_0=42.5 +lon_0=-71.66666666666667 +k=0.999966667 +x_0=300000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / New Jersey
-<epsg2824> +proj=tmerc +lat_0=38.83333333333334 +lon_0=-74.5 +k=0.9999 +x_0=150000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / New Mexico East
-<epsg2825> +proj=tmerc +lat_0=31 +lon_0=-104.3333333333333 +k=0.999909091 +x_0=165000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / New Mexico Central
-<epsg2826> +proj=tmerc +lat_0=31 +lon_0=-106.25 +k=0.9999 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / New Mexico West
-<epsg2827> +proj=tmerc +lat_0=31 +lon_0=-107.8333333333333 +k=0.999916667 +x_0=830000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / New York East
-<epsg2828> +proj=tmerc +lat_0=38.83333333333334 +lon_0=-74.5 +k=0.9999 +x_0=150000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / New York Central
-<epsg2829> +proj=tmerc +lat_0=40 +lon_0=-76.58333333333333 +k=0.9999375 +x_0=250000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / New York West
-<epsg2830> +proj=tmerc +lat_0=40 +lon_0=-78.58333333333333 +k=0.9999375 +x_0=350000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / New York Long Island
-<epsg2831> +proj=lcc +lat_1=41.03333333333333 +lat_2=40.66666666666666 +lat_0=40.16666666666666 +lon_0=-74 +x_0=300000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / North Dakota North
-<epsg2832> +proj=lcc +lat_1=48.73333333333333 +lat_2=47.43333333333333 +lat_0=47 +lon_0=-100.5 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / North Dakota South
-<epsg2833> +proj=lcc +lat_1=47.48333333333333 +lat_2=46.18333333333333 +lat_0=45.66666666666666 +lon_0=-100.5 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / Ohio North
-<epsg2834> +proj=lcc +lat_1=41.7 +lat_2=40.43333333333333 +lat_0=39.66666666666666 +lon_0=-82.5 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / Ohio South
-<epsg2835> +proj=lcc +lat_1=40.03333333333333 +lat_2=38.73333333333333 +lat_0=38 +lon_0=-82.5 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / Oklahoma North
-<epsg2836> +proj=lcc +lat_1=36.76666666666667 +lat_2=35.56666666666667 +lat_0=35 +lon_0=-98 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / Oklahoma South
-<epsg2837> +proj=lcc +lat_1=35.23333333333333 +lat_2=33.93333333333333 +lat_0=33.33333333333334 +lon_0=-98 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / Oregon North
-<epsg2838> +proj=lcc +lat_1=46 +lat_2=44.33333333333334 +lat_0=43.66666666666666 +lon_0=-120.5 +x_0=2500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / Oregon South
-<epsg2839> +proj=lcc +lat_1=44 +lat_2=42.33333333333334 +lat_0=41.66666666666666 +lon_0=-120.5 +x_0=1500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / Rhode Island
-<epsg2840> +proj=tmerc +lat_0=41.08333333333334 +lon_0=-71.5 +k=0.99999375 +x_0=100000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / South Dakota North
-<epsg2841> +proj=lcc +lat_1=45.68333333333333 +lat_2=44.41666666666666 +lat_0=43.83333333333334 +lon_0=-100 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / South Dakota South
-<epsg2842> +proj=lcc +lat_1=44.4 +lat_2=42.83333333333334 +lat_0=42.33333333333334 +lon_0=-100.3333333333333 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / Tennessee
-<epsg2843> +proj=lcc +lat_1=36.41666666666666 +lat_2=35.25 +lat_0=34.33333333333334 +lon_0=-86 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / Texas North
-<epsg2844> +proj=lcc +lat_1=36.18333333333333 +lat_2=34.65 +lat_0=34 +lon_0=-101.5 +x_0=200000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / Texas North Central
-<epsg2845> +proj=lcc +lat_1=33.96666666666667 +lat_2=32.13333333333333 +lat_0=31.66666666666667 +lon_0=-98.5 +x_0=600000 +y_0=2000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / Texas Central
-<epsg2846> +proj=lcc +lat_1=31.88333333333333 +lat_2=30.11666666666667 +lat_0=29.66666666666667 +lon_0=-100.3333333333333 +x_0=700000 +y_0=3000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / Texas South Central
-<epsg2847> +proj=lcc +lat_1=30.28333333333333 +lat_2=28.38333333333333 +lat_0=27.83333333333333 +lon_0=-99 +x_0=600000 +y_0=4000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / Texas South
-<epsg2848> +proj=lcc +lat_1=27.83333333333333 +lat_2=26.16666666666667 +lat_0=25.66666666666667 +lon_0=-98.5 +x_0=300000 +y_0=5000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / Utah North
-<epsg2849> +proj=lcc +lat_1=41.78333333333333 +lat_2=40.71666666666667 +lat_0=40.33333333333334 +lon_0=-111.5 +x_0=500000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / Utah Central
-<epsg2850> +proj=lcc +lat_1=40.65 +lat_2=39.01666666666667 +lat_0=38.33333333333334 +lon_0=-111.5 +x_0=500000 +y_0=2000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / Utah South
-<epsg2851> +proj=lcc +lat_1=38.35 +lat_2=37.21666666666667 +lat_0=36.66666666666666 +lon_0=-111.5 +x_0=500000 +y_0=3000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / Vermont
-<epsg2852> +proj=tmerc +lat_0=42.5 +lon_0=-72.5 +k=0.999964286 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / Virginia North
-<epsg2853> +proj=lcc +lat_1=39.2 +lat_2=38.03333333333333 +lat_0=37.66666666666666 +lon_0=-78.5 +x_0=3500000 +y_0=2000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / Virginia South
-<epsg2854> +proj=lcc +lat_1=37.96666666666667 +lat_2=36.76666666666667 +lat_0=36.33333333333334 +lon_0=-78.5 +x_0=3500000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / Washington North
-<epsg2855> +proj=lcc +lat_1=48.73333333333333 +lat_2=47.5 +lat_0=47 +lon_0=-120.8333333333333 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / Washington South
-<epsg2856> +proj=lcc +lat_1=47.33333333333334 +lat_2=45.83333333333334 +lat_0=45.33333333333334 +lon_0=-120.5 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / West Virginia North
-<epsg2857> +proj=lcc +lat_1=40.25 +lat_2=39 +lat_0=38.5 +lon_0=-79.5 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / West Virginia South
-<epsg2858> +proj=lcc +lat_1=38.88333333333333 +lat_2=37.48333333333333 +lat_0=37 +lon_0=-81 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / Wisconsin North
-<epsg2859> +proj=lcc +lat_1=46.76666666666667 +lat_2=45.56666666666667 +lat_0=45.16666666666666 +lon_0=-90 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / Wisconsin Central
-<epsg2860> +proj=lcc +lat_1=45.5 +lat_2=44.25 +lat_0=43.83333333333334 +lon_0=-90 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / Wisconsin South
-<epsg2861> +proj=lcc +lat_1=44.06666666666667 +lat_2=42.73333333333333 +lat_0=42 +lon_0=-90 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / Wyoming East
-<epsg2862> +proj=tmerc +lat_0=40.5 +lon_0=-105.1666666666667 +k=0.9999375 +x_0=200000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / Wyoming East Central
-<epsg2863> +proj=tmerc +lat_0=40.5 +lon_0=-107.3333333333333 +k=0.9999375 +x_0=400000 +y_0=100000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / Wyoming West Central
-<epsg2864> +proj=tmerc +lat_0=40.5 +lon_0=-108.75 +k=0.9999375 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / Wyoming West
-<epsg2865> +proj=tmerc +lat_0=40.5 +lon_0=-110.0833333333333 +k=0.9999375 +x_0=800000 +y_0=100000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / Puerto Rico and Virgin Is.
-<epsg2866> +proj=lcc +lat_1=18.43333333333333 +lat_2=18.03333333333333 +lat_0=17.83333333333333 +lon_0=-66.43333333333334 +x_0=200000 +y_0=200000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / Arizona East (ft)
-<epsg2867> +proj=tmerc +lat_0=31 +lon_0=-110.1666666666667 +k=0.9999 +x_0=213360 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=ft +no_defs  <>
-# NAD83(HARN) / Arizona Central (ft)
-<epsg2868> +proj=tmerc +lat_0=31 +lon_0=-111.9166666666667 +k=0.9999 +x_0=213360 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=ft +no_defs  <>
-# NAD83(HARN) / Arizona West (ft)
-<epsg2869> +proj=tmerc +lat_0=31 +lon_0=-113.75 +k=0.999933333 +x_0=213360 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=ft +no_defs  <>
-# NAD83(HARN) / California zone 1 (ftUS)
-<epsg2870> +proj=lcc +lat_1=41.66666666666666 +lat_2=40 +lat_0=39.33333333333334 +lon_0=-122 +x_0=2000000.0001016 +y_0=500000.0001016001 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(HARN) / California zone 2 (ftUS)
-<epsg2871> +proj=lcc +lat_1=39.83333333333334 +lat_2=38.33333333333334 +lat_0=37.66666666666666 +lon_0=-122 +x_0=2000000.0001016 +y_0=500000.0001016001 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(HARN) / California zone 3 (ftUS)
-<epsg2872> +proj=lcc +lat_1=38.43333333333333 +lat_2=37.06666666666667 +lat_0=36.5 +lon_0=-120.5 +x_0=2000000.0001016 +y_0=500000.0001016001 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(HARN) / California zone 4 (ftUS)
-<epsg2873> +proj=lcc +lat_1=37.25 +lat_2=36 +lat_0=35.33333333333334 +lon_0=-119 +x_0=2000000.0001016 +y_0=500000.0001016001 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(HARN) / California zone 5 (ftUS)
-<epsg2874> +proj=lcc +lat_1=35.46666666666667 +lat_2=34.03333333333333 +lat_0=33.5 +lon_0=-118 +x_0=2000000.0001016 +y_0=500000.0001016001 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(HARN) / California zone 6 (ftUS)
-<epsg2875> +proj=lcc +lat_1=33.88333333333333 +lat_2=32.78333333333333 +lat_0=32.16666666666666 +lon_0=-116.25 +x_0=2000000.0001016 +y_0=500000.0001016001 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(HARN) / Colorado North (ftUS)
-<epsg2876> +proj=lcc +lat_1=40.78333333333333 +lat_2=39.71666666666667 +lat_0=39.33333333333334 +lon_0=-105.5 +x_0=914401.8288036576 +y_0=304800.6096012192 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(HARN) / Colorado Central (ftUS)
-<epsg2877> +proj=lcc +lat_1=39.75 +lat_2=38.45 +lat_0=37.83333333333334 +lon_0=-105.5 +x_0=914401.8288036576 +y_0=304800.6096012192 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(HARN) / Colorado South (ftUS)
-<epsg2878> +proj=lcc +lat_1=38.43333333333333 +lat_2=37.23333333333333 +lat_0=36.66666666666666 +lon_0=-105.5 +x_0=914401.8288036576 +y_0=304800.6096012192 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(HARN) / Connecticut (ftUS)
-<epsg2879> +proj=lcc +lat_1=41.86666666666667 +lat_2=41.2 +lat_0=40.83333333333334 +lon_0=-72.75 +x_0=304800.6096012192 +y_0=152400.3048006096 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(HARN) / Delaware (ftUS)
-<epsg2880> +proj=tmerc +lat_0=38 +lon_0=-75.41666666666667 +k=0.999995 +x_0=200000.0001016002 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(HARN) / Florida East (ftUS)
-<epsg2881> +proj=tmerc +lat_0=24.33333333333333 +lon_0=-81 +k=0.999941177 +x_0=200000.0001016002 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(HARN) / Florida West (ftUS)
-<epsg2882> +proj=tmerc +lat_0=24.33333333333333 +lon_0=-82 +k=0.999941177 +x_0=200000.0001016002 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(HARN) / Florida North (ftUS)
-<epsg2883> +proj=lcc +lat_1=30.75 +lat_2=29.58333333333333 +lat_0=29 +lon_0=-84.5 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(HARN) / Georgia East (ftUS)
-<epsg2884> +proj=tmerc +lat_0=30 +lon_0=-82.16666666666667 +k=0.9999 +x_0=200000.0001016002 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(HARN) / Georgia West (ftUS)
-<epsg2885> +proj=tmerc +lat_0=30 +lon_0=-84.16666666666667 +k=0.9999 +x_0=699999.9998983998 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(HARN) / Idaho East (ftUS)
-<epsg2886> +proj=tmerc +lat_0=41.66666666666666 +lon_0=-112.1666666666667 +k=0.9999473679999999 +x_0=200000.0001016002 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(HARN) / Idaho Central (ftUS)
-<epsg2887> +proj=tmerc +lat_0=41.66666666666666 +lon_0=-114 +k=0.9999473679999999 +x_0=500000.0001016001 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(HARN) / Idaho West (ftUS)
-<epsg2888> +proj=tmerc +lat_0=41.66666666666666 +lon_0=-115.75 +k=0.999933333 +x_0=800000.0001016001 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(HARN) / Indiana East (ftUS) (deprecated)
-<epsg2889> +proj=tmerc +lat_0=37.5 +lon_0=-85.66666666666667 +k=0.999966667 +x_0=99999.99989839978 +y_0=249364.9987299975 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(HARN) / Indiana West (ftUS) (deprecated)
-<epsg2890> +proj=tmerc +lat_0=37.5 +lon_0=-87.08333333333333 +k=0.999966667 +x_0=900000 +y_0=249364.9987299975 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(HARN) / Kentucky North (ftUS)
-<epsg2891> +proj=lcc +lat_1=37.96666666666667 +lat_2=38.96666666666667 +lat_0=37.5 +lon_0=-84.25 +x_0=500000.0001016001 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(HARN) / Kentucky South (ftUS)
-<epsg2892> +proj=lcc +lat_1=37.93333333333333 +lat_2=36.73333333333333 +lat_0=36.33333333333334 +lon_0=-85.75 +x_0=500000.0001016001 +y_0=500000.0001016001 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(HARN) / Maryland (ftUS)
-<epsg2893> +proj=lcc +lat_1=39.45 +lat_2=38.3 +lat_0=37.66666666666666 +lon_0=-77 +x_0=399999.9998983998 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(HARN) / Massachusetts Mainland (ftUS)
-<epsg2894> +proj=lcc +lat_1=42.68333333333333 +lat_2=41.71666666666667 +lat_0=41 +lon_0=-71.5 +x_0=200000.0001016002 +y_0=750000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(HARN) / Massachusetts Island (ftUS)
-<epsg2895> +proj=lcc +lat_1=41.48333333333333 +lat_2=41.28333333333333 +lat_0=41 +lon_0=-70.5 +x_0=500000.0001016001 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(HARN) / Michigan North (ft)
-<epsg2896> +proj=lcc +lat_1=47.08333333333334 +lat_2=45.48333333333333 +lat_0=44.78333333333333 +lon_0=-87 +x_0=7999999.999968001 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=ft +no_defs  <>
-# NAD83(HARN) / Michigan Central (ft)
-<epsg2897> +proj=lcc +lat_1=45.7 +lat_2=44.18333333333333 +lat_0=43.31666666666667 +lon_0=-84.36666666666666 +x_0=5999999.999976001 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=ft +no_defs  <>
-# NAD83(HARN) / Michigan South (ft)
-<epsg2898> +proj=lcc +lat_1=43.66666666666666 +lat_2=42.1 +lat_0=41.5 +lon_0=-84.36666666666666 +x_0=3999999.999984 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=ft +no_defs  <>
-# NAD83(HARN) / Mississippi East (ftUS)
-<epsg2899> +proj=tmerc +lat_0=29.5 +lon_0=-88.83333333333333 +k=0.99995 +x_0=300000.0000000001 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(HARN) / Mississippi West (ftUS)
-<epsg2900> +proj=tmerc +lat_0=29.5 +lon_0=-90.33333333333333 +k=0.99995 +x_0=699999.9998983998 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(HARN) / Montana (ft)
-<epsg2901> +proj=lcc +lat_1=49 +lat_2=45 +lat_0=44.25 +lon_0=-109.5 +x_0=599999.9999976 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=ft +no_defs  <>
-# NAD83(HARN) / New Mexico East (ftUS)
-<epsg2902> +proj=tmerc +lat_0=31 +lon_0=-104.3333333333333 +k=0.999909091 +x_0=165000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(HARN) / New Mexico Central (ftUS)
-<epsg2903> +proj=tmerc +lat_0=31 +lon_0=-106.25 +k=0.9999 +x_0=500000.0001016001 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(HARN) / New Mexico West (ftUS)
-<epsg2904> +proj=tmerc +lat_0=31 +lon_0=-107.8333333333333 +k=0.999916667 +x_0=830000.0001016001 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(HARN) / New York East (ftUS)
-<epsg2905> +proj=tmerc +lat_0=38.83333333333334 +lon_0=-74.5 +k=0.9999 +x_0=150000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(HARN) / New York Central (ftUS)
-<epsg2906> +proj=tmerc +lat_0=40 +lon_0=-76.58333333333333 +k=0.9999375 +x_0=249999.9998983998 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(HARN) / New York West (ftUS)
-<epsg2907> +proj=tmerc +lat_0=40 +lon_0=-78.58333333333333 +k=0.9999375 +x_0=350000.0001016001 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(HARN) / New York Long Island (ftUS)
-<epsg2908> +proj=lcc +lat_1=41.03333333333333 +lat_2=40.66666666666666 +lat_0=40.16666666666666 +lon_0=-74 +x_0=300000.0000000001 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(HARN) / North Dakota North (ft)
-<epsg2909> +proj=lcc +lat_1=48.73333333333333 +lat_2=47.43333333333333 +lat_0=47 +lon_0=-100.5 +x_0=599999.9999976 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=ft +no_defs  <>
-# NAD83(HARN) / North Dakota South (ft)
-<epsg2910> +proj=lcc +lat_1=47.48333333333333 +lat_2=46.18333333333333 +lat_0=45.66666666666666 +lon_0=-100.5 +x_0=599999.9999976 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=ft +no_defs  <>
-# NAD83(HARN) / Oklahoma North (ftUS)
-<epsg2911> +proj=lcc +lat_1=36.76666666666667 +lat_2=35.56666666666667 +lat_0=35 +lon_0=-98 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(HARN) / Oklahoma South (ftUS)
-<epsg2912> +proj=lcc +lat_1=35.23333333333333 +lat_2=33.93333333333333 +lat_0=33.33333333333334 +lon_0=-98 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(HARN) / Oregon North (ft)
-<epsg2913> +proj=lcc +lat_1=46 +lat_2=44.33333333333334 +lat_0=43.66666666666666 +lon_0=-120.5 +x_0=2500000.0001424 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=ft +no_defs  <>
-# NAD83(HARN) / Oregon South (ft)
-<epsg2914> +proj=lcc +lat_1=44 +lat_2=42.33333333333334 +lat_0=41.66666666666666 +lon_0=-120.5 +x_0=1500000.0001464 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=ft +no_defs  <>
-# NAD83(HARN) / Tennessee (ftUS)
-<epsg2915> +proj=lcc +lat_1=36.41666666666666 +lat_2=35.25 +lat_0=34.33333333333334 +lon_0=-86 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(HARN) / Texas North (ftUS)
-<epsg2916> +proj=lcc +lat_1=36.18333333333333 +lat_2=34.65 +lat_0=34 +lon_0=-101.5 +x_0=200000.0001016002 +y_0=999999.9998983998 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(HARN) / Texas North Central (ftUS)
-<epsg2917> +proj=lcc +lat_1=33.96666666666667 +lat_2=32.13333333333333 +lat_0=31.66666666666667 +lon_0=-98.5 +x_0=600000 +y_0=2000000.0001016 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(HARN) / Texas Central (ftUS)
-<epsg2918> +proj=lcc +lat_1=31.88333333333333 +lat_2=30.11666666666667 +lat_0=29.66666666666667 +lon_0=-100.3333333333333 +x_0=699999.9998983998 +y_0=3000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(HARN) / Texas South Central (ftUS)
-<epsg2919> +proj=lcc +lat_1=30.28333333333333 +lat_2=28.38333333333333 +lat_0=27.83333333333333 +lon_0=-99 +x_0=600000 +y_0=3999999.9998984 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(HARN) / Texas South (ftUS)
-<epsg2920> +proj=lcc +lat_1=27.83333333333333 +lat_2=26.16666666666667 +lat_0=25.66666666666667 +lon_0=-98.5 +x_0=300000.0000000001 +y_0=5000000.0001016 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(HARN) / Utah North (ft)
-<epsg2921> +proj=lcc +lat_1=41.78333333333333 +lat_2=40.71666666666667 +lat_0=40.33333333333334 +lon_0=-111.5 +x_0=500000.0001504 +y_0=999999.9999960001 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=ft +no_defs  <>
-# NAD83(HARN) / Utah Central (ft)
-<epsg2922> +proj=lcc +lat_1=40.65 +lat_2=39.01666666666667 +lat_0=38.33333333333334 +lon_0=-111.5 +x_0=500000.0001504 +y_0=1999999.999992 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=ft +no_defs  <>
-# NAD83(HARN) / Utah South (ft)
-<epsg2923> +proj=lcc +lat_1=38.35 +lat_2=37.21666666666667 +lat_0=36.66666666666666 +lon_0=-111.5 +x_0=500000.0001504 +y_0=2999999.999988 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=ft +no_defs  <>
-# NAD83(HARN) / Virginia North (ftUS)
-<epsg2924> +proj=lcc +lat_1=39.2 +lat_2=38.03333333333333 +lat_0=37.66666666666666 +lon_0=-78.5 +x_0=3500000.0001016 +y_0=2000000.0001016 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(HARN) / Virginia South (ftUS)
-<epsg2925> +proj=lcc +lat_1=37.96666666666667 +lat_2=36.76666666666667 +lat_0=36.33333333333334 +lon_0=-78.5 +x_0=3500000.0001016 +y_0=999999.9998983998 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(HARN) / Washington North (ftUS)
-<epsg2926> +proj=lcc +lat_1=48.73333333333333 +lat_2=47.5 +lat_0=47 +lon_0=-120.8333333333333 +x_0=500000.0001016001 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(HARN) / Washington South (ftUS)
-<epsg2927> +proj=lcc +lat_1=47.33333333333334 +lat_2=45.83333333333334 +lat_0=45.33333333333334 +lon_0=-120.5 +x_0=500000.0001016001 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(HARN) / Wisconsin North (ftUS)
-<epsg2928> +proj=lcc +lat_1=46.76666666666667 +lat_2=45.56666666666667 +lat_0=45.16666666666666 +lon_0=-90 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(HARN) / Wisconsin Central (ftUS)
-<epsg2929> +proj=lcc +lat_1=45.5 +lat_2=44.25 +lat_0=43.83333333333334 +lon_0=-90 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(HARN) / Wisconsin South (ftUS)
-<epsg2930> +proj=lcc +lat_1=44.06666666666667 +lat_2=42.73333333333333 +lat_0=42 +lon_0=-90 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# Beduaram / TM 13 NE
-<epsg2931> +proj=tmerc +lat_0=0 +lon_0=13 +k=0.9996 +x_0=500000 +y_0=0 +a=6378249.2 +b=6356515 +towgs84=-106,-87,188,0,0,0,0 +units=m +no_defs  <>
-# QND95 / Qatar National Grid
-<epsg2932> +proj=tmerc +lat_0=24.45 +lon_0=51.21666666666667 +k=0.99999 +x_0=200000 +y_0=300000 +ellps=intl +towgs84=-119.425,-303.659,-11.0006,1.1643,0.174458,1.09626,3.65706 +units=m +no_defs  <>
-# Segara / UTM zone 50S
-<epsg2933> +proj=utm +zone=50 +south +ellps=bessel +towgs84=-403,684,41,0,0,0,0 +units=m +no_defs  <>
-# Segara (Jakarta) / NEIEZ (deprecated)
-<epsg2934> +proj=merc +lon_0=110 +k=0.997 +x_0=3900000 +y_0=900000 +ellps=bessel +towgs84=-403,684,41,0,0,0,0 +pm=jakarta +units=m +no_defs  <>
-# Pulkovo 1942 / CS63 zone A1
-<epsg2935> +proj=tmerc +lat_0=0.1166666666666667 +lon_0=41.53333333333333 +k=1 +x_0=1300000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / CS63 zone A2
-<epsg2936> +proj=tmerc +lat_0=0.1166666666666667 +lon_0=44.53333333333333 +k=1 +x_0=2300000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / CS63 zone A3
-<epsg2937> +proj=tmerc +lat_0=0.1166666666666667 +lon_0=47.53333333333333 +k=1 +x_0=3300000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / CS63 zone A4
-<epsg2938> +proj=tmerc +lat_0=0.1166666666666667 +lon_0=50.53333333333333 +k=1 +x_0=4300000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / CS63 zone K2
-<epsg2939> +proj=tmerc +lat_0=0.1333333333333333 +lon_0=50.76666666666667 +k=1 +x_0=2300000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / CS63 zone K3
-<epsg2940> +proj=tmerc +lat_0=0.1333333333333333 +lon_0=53.76666666666667 +k=1 +x_0=3300000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / CS63 zone K4
-<epsg2941> +proj=tmerc +lat_0=0.1333333333333333 +lon_0=56.76666666666667 +k=1 +x_0=4300000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Porto Santo / UTM zone 28N
-<epsg2942> +proj=utm +zone=28 +ellps=intl +towgs84=-499,-249,314,0,0,0,0 +units=m +no_defs  <>
-# Selvagem Grande / UTM zone 28N
-<epsg2943> +proj=utm +zone=28 +ellps=intl +towgs84=-289,-124,60,0,0,0,0 +units=m +no_defs  <>
-# NAD83(CSRS) / SCoPQ zone 2 (deprecated)
-<epsg2944> +proj=tmerc +lat_0=0 +lon_0=-55.5 +k=0.9999 +x_0=304800 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(CSRS) / MTM zone 3
-<epsg2945> +proj=tmerc +lat_0=0 +lon_0=-58.5 +k=0.9999 +x_0=304800 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(CSRS) / MTM zone 4
-<epsg2946> +proj=tmerc +lat_0=0 +lon_0=-61.5 +k=0.9999 +x_0=304800 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(CSRS) / MTM zone 5
-<epsg2947> +proj=tmerc +lat_0=0 +lon_0=-64.5 +k=0.9999 +x_0=304800 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(CSRS) / MTM zone 6
-<epsg2948> +proj=tmerc +lat_0=0 +lon_0=-67.5 +k=0.9999 +x_0=304800 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(CSRS) / MTM zone 7
-<epsg2949> +proj=tmerc +lat_0=0 +lon_0=-70.5 +k=0.9999 +x_0=304800 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(CSRS) / MTM zone 8
-<epsg2950> +proj=tmerc +lat_0=0 +lon_0=-73.5 +k=0.9999 +x_0=304800 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(CSRS) / MTM zone 9
-<epsg2951> +proj=tmerc +lat_0=0 +lon_0=-76.5 +k=0.9999 +x_0=304800 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(CSRS) / MTM zone 10
-<epsg2952> +proj=tmerc +lat_0=0 +lon_0=-79.5 +k=0.9999 +x_0=304800 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(CSRS) / New Brunswick Stereographic
-<epsg2953> +proj=sterea +lat_0=46.5 +lon_0=-66.5 +k=0.999912 +x_0=2500000 +y_0=7500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(CSRS) / Prince Edward Isl. Stereographic (NAD83)
-<epsg2954> +proj=sterea +lat_0=47.25 +lon_0=-63 +k=0.999912 +x_0=400000 +y_0=800000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(CSRS) / UTM zone 11N
-<epsg2955> +proj=utm +zone=11 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(CSRS) / UTM zone 12N
-<epsg2956> +proj=utm +zone=12 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(CSRS) / UTM zone 13N
-<epsg2957> +proj=utm +zone=13 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(CSRS) / UTM zone 17N
-<epsg2958> +proj=utm +zone=17 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(CSRS) / UTM zone 18N
-<epsg2959> +proj=utm +zone=18 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(CSRS) / UTM zone 19N
-<epsg2960> +proj=utm +zone=19 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(CSRS) / UTM zone 20N
-<epsg2961> +proj=utm +zone=20 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(CSRS) / UTM zone 21N
-<epsg2962> +proj=utm +zone=21 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# Lisbon 1890 (Lisbon) / Portugal Bonne
-# Unable to translate coordinate system EPSG:2963 into PROJ.4 format.
-#
-# NAD27 / Alaska Albers
-<epsg2964> +proj=aea +lat_1=55 +lat_2=65 +lat_0=50 +lon_0=-154 +x_0=0 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD83 / Indiana East (ftUS)
-<epsg2965> +proj=tmerc +lat_0=37.5 +lon_0=-85.66666666666667 +k=0.999966667 +x_0=99999.99989839978 +y_0=249999.9998983998 +datum=NAD83 +units=us-ft +no_defs  <>
-# NAD83 / Indiana West (ftUS)
-<epsg2966> +proj=tmerc +lat_0=37.5 +lon_0=-87.08333333333333 +k=0.999966667 +x_0=900000 +y_0=249999.9998983998 +datum=NAD83 +units=us-ft +no_defs  <>
-# NAD83(HARN) / Indiana East (ftUS)
-<epsg2967> +proj=tmerc +lat_0=37.5 +lon_0=-85.66666666666667 +k=0.999966667 +x_0=99999.99989839978 +y_0=249999.9998983998 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(HARN) / Indiana West (ftUS)
-<epsg2968> +proj=tmerc +lat_0=37.5 +lon_0=-87.08333333333333 +k=0.999966667 +x_0=900000 +y_0=249999.9998983998 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# Fort Marigot / UTM zone 20N
-<epsg2969> +proj=utm +zone=20 +ellps=intl +towgs84=137,248,-430,0,0,0,0 +units=m +no_defs  <>
-# Guadeloupe 1948 / UTM zone 20N
-<epsg2970> +proj=utm +zone=20 +ellps=intl +towgs84=-467,-16,-300,0,0,0,0 +units=m +no_defs  <>
-# CSG67 / UTM zone 22N
-<epsg2971> +proj=utm +zone=22 +ellps=intl +towgs84=-186,230,110,0,0,0,0 +units=m +no_defs  <>
-# RGFG95 / UTM zone 22N
-<epsg2972> +proj=utm +zone=22 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# Martinique 1938 / UTM zone 20N
-<epsg2973> +proj=utm +zone=20 +ellps=intl +towgs84=186,482,151,0,0,0,0 +units=m +no_defs  <>
-# RGR92 / UTM zone 40S
-<epsg2975> +proj=utm +zone=40 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# Tahiti 52 / UTM zone 6S
-<epsg2976> +proj=utm +zone=6 +south +ellps=intl +towgs84=162,117,154,0,0,0,0 +units=m +no_defs  <>
-# Tahaa 54 / UTM zone 5S
-<epsg2977> +proj=utm +zone=5 +south +ellps=intl +towgs84=72.438,345.918,79.486,1.6045,0.8823,0.5565,1.3746 +units=m +no_defs  <>
-# IGN72 Nuku Hiva / UTM zone 7S
-<epsg2978> +proj=utm +zone=7 +south +ellps=intl +towgs84=84,274,65,0,0,0,0 +units=m +no_defs  <>
-# K0 1949 / UTM zone 42S (deprecated)
-<epsg2979> +proj=utm +zone=42 +south +ellps=intl +towgs84=145,-187,103,0,0,0,0 +units=m +no_defs  <>
-# Combani 1950 / UTM zone 38S
-<epsg2980> +proj=utm +zone=38 +south +ellps=intl +towgs84=-382,-59,-262,0,0,0,0 +units=m +no_defs  <>
-# IGN56 Lifou / UTM zone 58S
-<epsg2981> +proj=utm +zone=58 +south +ellps=intl +towgs84=335.47,222.58,-230.94,0,0,0,0 +units=m +no_defs  <>
-# IGN72 Grand Terre / UTM zone 58S (deprecated)
-<epsg2982> +proj=utm +zone=58 +south +ellps=intl +towgs84=-13,-348,292,0,0,0,0 +units=m +no_defs  <>
-# ST87 Ouvea / UTM zone 58S (deprecated)
-<epsg2983> +proj=utm +zone=58 +south +ellps=intl +towgs84=-122.383,-188.696,103.344,3.5107,-4.9668,-5.7047,4.4798 +units=m +no_defs  <>
-# RGNC 1991 / Lambert New Caledonia (deprecated)
-<epsg2984> +proj=lcc +lat_1=-20.66666666666667 +lat_2=-22.33333333333333 +lat_0=-21.5 +lon_0=166 +x_0=400000 +y_0=300000 +ellps=intl +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# Petrels 1972 / Terre Adelie Polar Stereographic
-# Unable to translate coordinate system EPSG:2985 into PROJ.4 format.
-#
-# Perroud 1950 / Terre Adelie Polar Stereographic
-# Unable to translate coordinate system EPSG:2986 into PROJ.4 format.
-#
-# Saint Pierre et Miquelon 1950 / UTM zone 21N
-<epsg2987> +proj=utm +zone=21 +ellps=clrk66 +towgs84=30,430,368,0,0,0,0 +units=m +no_defs  <>
-# MOP78 / UTM zone 1S
-<epsg2988> +proj=utm +zone=1 +south +ellps=intl +towgs84=253,-132,-127,0,0,0,0 +units=m +no_defs  <>
-# RRAF 1991 / UTM zone 20N (deprecated)
-<epsg2989> +proj=utm +zone=20 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# Reunion 1947 / TM Reunion (deprecated)
-<epsg2990> +proj=tmerc +lat_0=-21.11666666666667 +lon_0=55.53333333333333 +k=1 +x_0=50000 +y_0=160000 +ellps=intl +towgs84=94,-948,-1262,0,0,0,0 +units=m +no_defs  <>
-# NAD83 / Oregon Lambert
-<epsg2991> +proj=lcc +lat_1=43 +lat_2=45.5 +lat_0=41.75 +lon_0=-120.5 +x_0=400000 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / Oregon Lambert (ft)
-<epsg2992> +proj=lcc +lat_1=43 +lat_2=45.5 +lat_0=41.75 +lon_0=-120.5 +x_0=399999.9999984 +y_0=0 +datum=NAD83 +units=ft +no_defs  <>
-# NAD83(HARN) / Oregon Lambert
-<epsg2993> +proj=lcc +lat_1=43 +lat_2=45.5 +lat_0=41.75 +lon_0=-120.5 +x_0=400000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / Oregon Lambert (ft)
-<epsg2994> +proj=lcc +lat_1=43 +lat_2=45.5 +lat_0=41.75 +lon_0=-120.5 +x_0=399999.9999984 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=ft +no_defs  <>
-# IGN53 Mare / UTM zone 58S
-<epsg2995> +proj=utm +zone=58 +south +ellps=intl +towgs84=287.58,177.78,-135.41,0,0,0,0 +units=m +no_defs  <>
-# ST84 Ile des Pins / UTM zone 58S
-<epsg2996> +proj=utm +zone=58 +south +ellps=intl +towgs84=-13,-348,292,0,0,0,0 +units=m +no_defs  <>
-# ST71 Belep / UTM zone 58S
-<epsg2997> +proj=utm +zone=58 +south +ellps=intl +towgs84=-480.26,-438.32,-643.429,16.3119,20.1721,-4.0349,-111.7 +units=m +no_defs  <>
-# NEA74 Noumea / UTM zone 58S
-<epsg2998> +proj=utm +zone=58 +south +ellps=intl +towgs84=-10.18,-350.43,291.37,0,0,0,0 +units=m +no_defs  <>
-# Grand Comoros / UTM zone 38S
-<epsg2999> +proj=utm +zone=38 +south +ellps=intl +towgs84=-963,510,-359,0,0,0,0 +units=m +no_defs  <>
-# Segara / NEIEZ
-<epsg3000> +proj=merc +lon_0=110 +k=0.997 +x_0=3900000 +y_0=900000 +ellps=bessel +towgs84=-403,684,41,0,0,0,0 +units=m +no_defs  <>
-# Batavia / NEIEZ
-<epsg3001> +proj=merc +lon_0=110 +k=0.997 +x_0=3900000 +y_0=900000 +ellps=bessel +towgs84=-377,681,-50,0,0,0,0 +units=m +no_defs  <>
-# Makassar / NEIEZ
-<epsg3002> +proj=merc +lon_0=110 +k=0.997 +x_0=3900000 +y_0=900000 +ellps=bessel +towgs84=-587.8,519.75,145.76,0,0,0,0 +units=m +no_defs  <>
-# Monte Mario / Italy zone 1
-<epsg3003> +proj=tmerc +lat_0=0 +lon_0=9 +k=0.9996 +x_0=1500000 +y_0=0 +ellps=intl +towgs84=-104.1,-49.1,-9.9,0.971,-2.917,0.714,-11.68 +units=m +no_defs  <>
-# Monte Mario / Italy zone 2
-<epsg3004> +proj=tmerc +lat_0=0 +lon_0=15 +k=0.9996 +x_0=2520000 +y_0=0 +ellps=intl +towgs84=-104.1,-49.1,-9.9,0.971,-2.917,0.714,-11.68 +units=m +no_defs  <>
-# NAD83 / BC Albers
-<epsg3005> +proj=aea +lat_1=50 +lat_2=58.5 +lat_0=45 +lon_0=-126 +x_0=1000000 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# SWEREF99 TM
-<epsg3006> +proj=utm +zone=33 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# SWEREF99 12 00
-<epsg3007> +proj=tmerc +lat_0=0 +lon_0=12 +k=1 +x_0=150000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# SWEREF99 13 30
-<epsg3008> +proj=tmerc +lat_0=0 +lon_0=13.5 +k=1 +x_0=150000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# SWEREF99 15 00
-<epsg3009> +proj=tmerc +lat_0=0 +lon_0=15 +k=1 +x_0=150000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# SWEREF99 16 30
-<epsg3010> +proj=tmerc +lat_0=0 +lon_0=16.5 +k=1 +x_0=150000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# SWEREF99 18 00
-<epsg3011> +proj=tmerc +lat_0=0 +lon_0=18 +k=1 +x_0=150000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# SWEREF99 14 15
-<epsg3012> +proj=tmerc +lat_0=0 +lon_0=14.25 +k=1 +x_0=150000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# SWEREF99 15 45
-<epsg3013> +proj=tmerc +lat_0=0 +lon_0=15.75 +k=1 +x_0=150000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# SWEREF99 17 15
-<epsg3014> +proj=tmerc +lat_0=0 +lon_0=17.25 +k=1 +x_0=150000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# SWEREF99 18 45
-<epsg3015> +proj=tmerc +lat_0=0 +lon_0=18.75 +k=1 +x_0=150000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# SWEREF99 20 15
-<epsg3016> +proj=tmerc +lat_0=0 +lon_0=20.25 +k=1 +x_0=150000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# SWEREF99 21 45
-<epsg3017> +proj=tmerc +lat_0=0 +lon_0=21.75 +k=1 +x_0=150000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# SWEREF99 23 15
-<epsg3018> +proj=tmerc +lat_0=0 +lon_0=23.25 +k=1 +x_0=150000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# RT90 7.5 gon V
-<epsg3019> +proj=tmerc +lat_0=0 +lon_0=11.30827777777778 +k=1 +x_0=1500000 +y_0=0 +ellps=bessel +towgs84=414.1,41.3,603.1,-0.855,2.141,-7.023,0 +units=m +no_defs  <>
-# RT90 5 gon V
-<epsg3020> +proj=tmerc +lat_0=0 +lon_0=13.55827777777778 +k=1 +x_0=1500000 +y_0=0 +ellps=bessel +towgs84=414.1,41.3,603.1,-0.855,2.141,-7.023,0 +units=m +no_defs  <>
-# RT90 2.5 gon V
-<epsg3021> +proj=tmerc +lat_0=0 +lon_0=15.80827777777778 +k=1 +x_0=1500000 +y_0=0 +ellps=bessel +towgs84=414.1,41.3,603.1,-0.855,2.141,-7.023,0 +units=m +no_defs  <>
-# RT90 0 gon
-<epsg3022> +proj=tmerc +lat_0=0 +lon_0=18.05827777777778 +k=1 +x_0=1500000 +y_0=0 +ellps=bessel +towgs84=414.1,41.3,603.1,-0.855,2.141,-7.023,0 +units=m +no_defs  <>
-# RT90 2.5 gon O
-<epsg3023> +proj=tmerc +lat_0=0 +lon_0=20.30827777777778 +k=1 +x_0=1500000 +y_0=0 +ellps=bessel +towgs84=414.1,41.3,603.1,-0.855,2.141,-7.023,0 +units=m +no_defs  <>
-# RT90 5 gon O
-<epsg3024> +proj=tmerc +lat_0=0 +lon_0=22.55827777777778 +k=1 +x_0=1500000 +y_0=0 +ellps=bessel +towgs84=414.1,41.3,603.1,-0.855,2.141,-7.023,0 +units=m +no_defs  <>
-# RT38 7.5 gon V
-<epsg3025> +proj=tmerc +lat_0=0 +lon_0=11.30827777777778 +k=1 +x_0=1500000 +y_0=0 +ellps=bessel +units=m +no_defs  <>
-# RT38 5 gon V
-<epsg3026> +proj=tmerc +lat_0=0 +lon_0=13.55827777777778 +k=1 +x_0=1500000 +y_0=0 +ellps=bessel +units=m +no_defs  <>
-# RT38 2.5 gon V
-<epsg3027> +proj=tmerc +lat_0=0 +lon_0=15.80827777777778 +k=1 +x_0=1500000 +y_0=0 +ellps=bessel +units=m +no_defs  <>
-# RT38 0 gon
-<epsg3028> +proj=tmerc +lat_0=0 +lon_0=18.05827777777778 +k=1 +x_0=1500000 +y_0=0 +ellps=bessel +units=m +no_defs  <>
-# RT38 2.5 gon O
-<epsg3029> +proj=tmerc +lat_0=0 +lon_0=20.30827777777778 +k=1 +x_0=1500000 +y_0=0 +ellps=bessel +units=m +no_defs  <>
-# RT38 5 gon O
-<epsg3030> +proj=tmerc +lat_0=0 +lon_0=22.55827777777778 +k=1 +x_0=1500000 +y_0=0 +ellps=bessel +units=m +no_defs  <>
-# WGS 84 / Antarctic Polar Stereographic
-<epsg3031> +proj=stere +lat_0=-90 +lat_ts=-71 +lon_0=0 +k=1 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / Australian Antarctic Polar Stereographic
-<epsg3032> +proj=stere +lat_0=-90 +lat_ts=-71 +lon_0=70 +k=1 +x_0=6000000 +y_0=6000000 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / Australian Antarctic Lambert
-<epsg3033> +proj=lcc +lat_1=-68.5 +lat_2=-74.5 +lat_0=-50 +lon_0=70 +x_0=6000000 +y_0=6000000 +datum=WGS84 +units=m +no_defs  <>
-# ETRS89 / LCC Europe
-<epsg3034> +proj=lcc +lat_1=35 +lat_2=65 +lat_0=52 +lon_0=10 +x_0=4000000 +y_0=2800000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ETRS89 / LAEA Europe
-<epsg3035> +proj=laea +lat_0=52 +lon_0=10 +x_0=4321000 +y_0=3210000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# Moznet / UTM zone 36S
-<epsg3036> +proj=utm +zone=36 +south +ellps=WGS84 +towgs84=0,0,0,-0,-0,-0,0 +units=m +no_defs  <>
-# Moznet / UTM zone 37S
-<epsg3037> +proj=utm +zone=37 +south +ellps=WGS84 +towgs84=0,0,0,-0,-0,-0,0 +units=m +no_defs  <>
-# ETRS89 / TM26
-<epsg3038> +proj=utm +zone=26 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ETRS89 / TM27
-<epsg3039> +proj=utm +zone=27 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ETRS89 / TM28
-<epsg3040> +proj=utm +zone=28 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ETRS89 / TM29
-<epsg3041> +proj=utm +zone=29 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ETRS89 / TM30
-<epsg3042> +proj=utm +zone=30 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ETRS89 / TM31
-<epsg3043> +proj=utm +zone=31 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ETRS89 / TM32
-<epsg3044> +proj=utm +zone=32 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ETRS89 / TM33
-<epsg3045> +proj=utm +zone=33 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ETRS89 / TM34
-<epsg3046> +proj=utm +zone=34 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ETRS89 / TM35
-<epsg3047> +proj=utm +zone=35 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ETRS89 / TM36
-<epsg3048> +proj=utm +zone=36 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ETRS89 / TM37
-<epsg3049> +proj=utm +zone=37 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ETRS89 / TM38
-<epsg3050> +proj=utm +zone=38 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ETRS89 / TM39
-<epsg3051> +proj=utm +zone=39 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# Reykjavik 1900 / Lambert 1900
-# Unable to translate coordinate system EPSG:3052 into PROJ.4 format.
-#
-# Hjorsey 1955 / Lambert 1955
-# Unable to translate coordinate system EPSG:3053 into PROJ.4 format.
-#
-# Hjorsey 1955 / UTM zone 26N
-<epsg3054> +proj=utm +zone=26 +ellps=intl +towgs84=-73,46,-86,0,0,0,0 +units=m +no_defs  <>
-# Hjorsey 1955 / UTM zone 27N
-<epsg3055> +proj=utm +zone=27 +ellps=intl +towgs84=-73,46,-86,0,0,0,0 +units=m +no_defs  <>
-# Hjorsey 1955 / UTM zone 28N
-<epsg3056> +proj=utm +zone=28 +ellps=intl +towgs84=-73,46,-86,0,0,0,0 +units=m +no_defs  <>
-# ISN93 / Lambert 1993
-<epsg3057> +proj=lcc +lat_1=64.25 +lat_2=65.75 +lat_0=65 +lon_0=-19 +x_0=500000 +y_0=500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# Helle 1954 / Jan Mayen Grid
-<epsg3058> +proj=tmerc +lat_0=0 +lon_0=-8.5 +k=1 +x_0=50000 +y_0=-7800000 +ellps=intl +towgs84=982.609,552.753,-540.873,6.68163,-31.6115,-19.8482,16.805 +units=m +no_defs  <>
-# LKS92 / Latvia TM
-<epsg3059> +proj=tmerc +lat_0=0 +lon_0=24 +k=0.9996 +x_0=500000 +y_0=-6000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# IGN72 Grande Terre / UTM zone 58S
-<epsg3060> +proj=utm +zone=58 +south +ellps=intl +towgs84=-11.64,-348.6,291.98,0,0,0,0 +units=m +no_defs  <>
-# Porto Santo 1995 / UTM zone 28N
-<epsg3061> +proj=utm +zone=28 +ellps=intl +towgs84=-502.862,-247.438,312.724,0,0,0,0 +units=m +no_defs  <>
-# Azores Oriental 1995 / UTM zone 26N
-<epsg3062> +proj=utm +zone=26 +ellps=intl +towgs84=-204.619,140.176,55.226,0,0,0,0 +units=m +no_defs  <>
-# Azores Central 1995 / UTM zone 26N
-<epsg3063> +proj=utm +zone=26 +ellps=intl +towgs84=-106.226,166.366,-37.893,0,0,0,0 +units=m +no_defs  <>
-# IGM95 / UTM zone 32N
-<epsg3064> +proj=utm +zone=32 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# IGM95 / UTM zone 33N
-<epsg3065> +proj=utm +zone=33 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ED50 / Jordan TM
-<epsg3066> +proj=tmerc +lat_0=0 +lon_0=37 +k=0.9998 +x_0=500000 +y_0=-3000000 +ellps=intl +towgs84=-87,-98,-121,0,0,0,0 +units=m +no_defs  <>
-# ETRS89 / TM35FIN(E,N)
-<epsg3067> +proj=utm +zone=35 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# DHDN / Soldner Berlin
-<epsg3068> +proj=cass +lat_0=52.41864827777778 +lon_0=13.62720366666667 +x_0=40000 +y_0=10000 +datum=potsdam +units=m +no_defs  <>
-# NAD27 / Wisconsin Transverse Mercator
-<epsg3069> +proj=tmerc +lat_0=0 +lon_0=-90 +k=0.9996 +x_0=500000 +y_0=-4500000 +datum=NAD27 +units=m +no_defs  <>
-# NAD83 / Wisconsin Transverse Mercator
-<epsg3070> +proj=tmerc +lat_0=0 +lon_0=-90 +k=0.9996 +x_0=520000 +y_0=-4480000 +datum=NAD83 +units=m +no_defs  <>
-# NAD83(HARN) / Wisconsin Transverse Mercator
-<epsg3071> +proj=tmerc +lat_0=0 +lon_0=-90 +k=0.9996 +x_0=520000 +y_0=-4480000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83 / Maine CS2000 East
-<epsg3072> +proj=tmerc +lat_0=43.83333333333334 +lon_0=-67.875 +k=0.99998 +x_0=700000 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / Maine CS2000 Central (deprecated)
-<epsg3073> +proj=tmerc +lat_0=43 +lon_0=-69.125 +k=0.99998 +x_0=500000 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / Maine CS2000 West
-<epsg3074> +proj=tmerc +lat_0=42.83333333333334 +lon_0=-70.375 +k=0.99998 +x_0=300000 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83(HARN) / Maine CS2000 East
-<epsg3075> +proj=tmerc +lat_0=43.83333333333334 +lon_0=-67.875 +k=0.99998 +x_0=700000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / Maine CS2000 Central (deprecated)
-<epsg3076> +proj=tmerc +lat_0=43 +lon_0=-69.125 +k=0.99998 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / Maine CS2000 West
-<epsg3077> +proj=tmerc +lat_0=42.83333333333334 +lon_0=-70.375 +k=0.99998 +x_0=300000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83 / Michigan Oblique Mercator
-<epsg3078> +proj=omerc +lat_0=45.30916666666666 +lonc=-86 +alpha=337.25556 +k=0.9996 +x_0=2546731.496 +y_0=-4354009.816 +no_uoff +gamma=337.25556 +datum=NAD83 +units=m +no_defs  <>
-# NAD83(HARN) / Michigan Oblique Mercator
-<epsg3079> +proj=omerc +lat_0=45.30916666666666 +lonc=-86 +alpha=337.25556 +k=0.9996 +x_0=2546731.496 +y_0=-4354009.816 +no_uoff +gamma=337.25556 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD27 / Shackleford
-<epsg3080> +proj=lcc +lat_1=27.41666666666667 +lat_2=34.91666666666666 +lat_0=31.16666666666667 +lon_0=-100 +x_0=914400 +y_0=914400 +datum=NAD27 +units=ft +no_defs  <>
-# NAD83 / Texas State Mapping System
-<epsg3081> +proj=lcc +lat_1=27.41666666666667 +lat_2=34.91666666666666 +lat_0=31.16666666666667 +lon_0=-100 +x_0=1000000 +y_0=1000000 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / Texas Centric Lambert Conformal
-<epsg3082> +proj=lcc +lat_1=27.5 +lat_2=35 +lat_0=18 +lon_0=-100 +x_0=1500000 +y_0=5000000 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / Texas Centric Albers Equal Area
-<epsg3083> +proj=aea +lat_1=27.5 +lat_2=35 +lat_0=18 +lon_0=-100 +x_0=1500000 +y_0=6000000 +datum=NAD83 +units=m +no_defs  <>
-# NAD83(HARN) / Texas Centric Lambert Conformal
-<epsg3084> +proj=lcc +lat_1=27.5 +lat_2=35 +lat_0=18 +lon_0=-100 +x_0=1500000 +y_0=5000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / Texas Centric Albers Equal Area
-<epsg3085> +proj=aea +lat_1=27.5 +lat_2=35 +lat_0=18 +lon_0=-100 +x_0=1500000 +y_0=6000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83 / Florida GDL Albers
-<epsg3086> +proj=aea +lat_1=24 +lat_2=31.5 +lat_0=24 +lon_0=-84 +x_0=400000 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83(HARN) / Florida GDL Albers
-<epsg3087> +proj=aea +lat_1=24 +lat_2=31.5 +lat_0=24 +lon_0=-84 +x_0=400000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83 / Kentucky Single Zone
-<epsg3088> +proj=lcc +lat_1=37.08333333333334 +lat_2=38.66666666666666 +lat_0=36.33333333333334 +lon_0=-85.75 +x_0=1500000 +y_0=1000000 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / Kentucky Single Zone (ftUS)
-<epsg3089> +proj=lcc +lat_1=37.08333333333334 +lat_2=38.66666666666666 +lat_0=36.33333333333334 +lon_0=-85.75 +x_0=1500000 +y_0=999999.9998983998 +datum=NAD83 +units=us-ft +no_defs  <>
-# NAD83(HARN) / Kentucky Single Zone
-<epsg3090> +proj=lcc +lat_1=37.08333333333334 +lat_2=38.66666666666666 +lat_0=36.33333333333334 +lon_0=-85.75 +x_0=1500000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / Kentucky Single Zone (ftUS)
-<epsg3091> +proj=lcc +lat_1=37.08333333333334 +lat_2=38.66666666666666 +lat_0=36.33333333333334 +lon_0=-85.75 +x_0=1500000 +y_0=999999.9998983998 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# Tokyo / UTM zone 51N
-<epsg3092> +proj=utm +zone=51 +ellps=bessel +towgs84=-146.414,507.337,680.507,0,0,0,0 +units=m +no_defs  <>
-# Tokyo / UTM zone 52N
-<epsg3093> +proj=utm +zone=52 +ellps=bessel +towgs84=-146.414,507.337,680.507,0,0,0,0 +units=m +no_defs  <>
-# Tokyo / UTM zone 53N
-<epsg3094> +proj=utm +zone=53 +ellps=bessel +towgs84=-146.414,507.337,680.507,0,0,0,0 +units=m +no_defs  <>
-# Tokyo / UTM zone 54N
-<epsg3095> +proj=utm +zone=54 +ellps=bessel +towgs84=-146.414,507.337,680.507,0,0,0,0 +units=m +no_defs  <>
-# Tokyo / UTM zone 55N
-<epsg3096> +proj=utm +zone=55 +ellps=bessel +towgs84=-146.414,507.337,680.507,0,0,0,0 +units=m +no_defs  <>
-# JGD2000 / UTM zone 51N
-<epsg3097> +proj=utm +zone=51 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# JGD2000 / UTM zone 52N
-<epsg3098> +proj=utm +zone=52 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# JGD2000 / UTM zone 53N
-<epsg3099> +proj=utm +zone=53 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# JGD2000 / UTM zone 54N
-<epsg3100> +proj=utm +zone=54 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# JGD2000 / UTM zone 55N
-<epsg3101> +proj=utm +zone=55 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# American Samoa 1962 / American Samoa Lambert
-<epsg3102> +proj=lcc +lat_1=-14.26666666666667 +lat_0=-14.26666666666667 +lon_0=-170 +k_0=1 +x_0=152400.3048006096 +y_0=95169.31165862332 +ellps=clrk66 +towgs84=-115,118,426,0,0,0,0 +units=us-ft +no_defs  <>
-# Mauritania 1999 / UTM zone 28N (deprecated)
-<epsg3103> +proj=utm +zone=28 +ellps=clrk80 +units=m +no_defs  <>
-# Mauritania 1999 / UTM zone 29N (deprecated)
-<epsg3104> +proj=utm +zone=29 +ellps=clrk80 +units=m +no_defs  <>
-# Mauritania 1999 / UTM zone 30N (deprecated)
-<epsg3105> +proj=utm +zone=30 +ellps=clrk80 +units=m +no_defs  <>
-# Gulshan 303 / Bangladesh Transverse Mercator
-<epsg3106> +proj=tmerc +lat_0=0 +lon_0=90 +k=0.9996 +x_0=500000 +y_0=0 +a=6377276.345 +b=6356075.41314024 +towgs84=283.7,735.9,261.1,0,0,0,0 +units=m +no_defs  <>
-# GDA94 / SA Lambert
-<epsg3107> +proj=lcc +lat_1=-28 +lat_2=-36 +lat_0=-32 +lon_0=135 +x_0=1000000 +y_0=2000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ETRS89 / Guernsey Grid
-<epsg3108> +proj=tmerc +lat_0=49.5 +lon_0=-2.416666666666667 +k=0.999997 +x_0=47000 +y_0=50000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ETRS89 / Jersey Transverse Mercator
-<epsg3109> +proj=tmerc +lat_0=49.225 +lon_0=-2.135 +k=0.9999999000000001 +x_0=40000 +y_0=70000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# AGD66 / Vicgrid66
-<epsg3110> +proj=lcc +lat_1=-36 +lat_2=-38 +lat_0=-37 +lon_0=145 +x_0=2500000 +y_0=4500000 +ellps=aust_SA +towgs84=-117.808,-51.536,137.784,0.303,0.446,0.234,-0.29 +units=m +no_defs  <>
-# GDA94 / Vicgrid94
-<epsg3111> +proj=lcc +lat_1=-36 +lat_2=-38 +lat_0=-37 +lon_0=145 +x_0=2500000 +y_0=2500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# GDA94 / Geoscience Australia Lambert
-<epsg3112> +proj=lcc +lat_1=-18 +lat_2=-36 +lat_0=0 +lon_0=134 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# GDA94 / BCSG02
-<epsg3113> +proj=tmerc +lat_0=-28 +lon_0=153 +k=0.99999 +x_0=50000 +y_0=100000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# MAGNA-SIRGAS / Colombia Far West zone
-<epsg3114> +proj=tmerc +lat_0=4.596200416666666 +lon_0=-80.07750791666666 +k=1 +x_0=1000000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# MAGNA-SIRGAS / Colombia West zone
-<epsg3115> +proj=tmerc +lat_0=4.596200416666666 +lon_0=-77.07750791666666 +k=1 +x_0=1000000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# MAGNA-SIRGAS / Colombia Bogota zone
-<epsg3116> +proj=tmerc +lat_0=4.596200416666666 +lon_0=-74.07750791666666 +k=1 +x_0=1000000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# MAGNA-SIRGAS / Colombia East Central zone
-<epsg3117> +proj=tmerc +lat_0=4.596200416666666 +lon_0=-71.07750791666666 +k=1 +x_0=1000000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# MAGNA-SIRGAS / Colombia East zone
-<epsg3118> +proj=tmerc +lat_0=4.596200416666666 +lon_0=-68.07750791666666 +k=1 +x_0=1000000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# Douala 1948 / AEF west
-<epsg3119> +proj=tmerc +lat_0=0 +lon_0=10.5 +k=0.999 +x_0=1000000 +y_0=1000000 +ellps=intl +towgs84=-206.1,-174.7,-87.7,0,0,0,0 +units=m +no_defs  <>
-# Pulkovo 1942(58) / Poland zone I
-<epsg3120> +proj=sterea +lat_0=50.625 +lon_0=21.08333333333333 +k=0.9998 +x_0=4637000 +y_0=5467000 +ellps=krass +towgs84=33.4,-146.6,-76.3,-0.359,-0.053,0.844,-0.84 +units=m +no_defs  <>
-# PRS92 / Philippines zone 1
-<epsg3121> +proj=tmerc +lat_0=0 +lon_0=117 +k=0.99995 +x_0=500000 +y_0=0 +ellps=clrk66 +towgs84=-127.62,-67.24,-47.04,-3.068,4.903,1.578,-1.06 +units=m +no_defs  <>
-# PRS92 / Philippines zone 2
-<epsg3122> +proj=tmerc +lat_0=0 +lon_0=119 +k=0.99995 +x_0=500000 +y_0=0 +ellps=clrk66 +towgs84=-127.62,-67.24,-47.04,-3.068,4.903,1.578,-1.06 +units=m +no_defs  <>
-# PRS92 / Philippines zone 3
-<epsg3123> +proj=tmerc +lat_0=0 +lon_0=121 +k=0.99995 +x_0=500000 +y_0=0 +ellps=clrk66 +towgs84=-127.62,-67.24,-47.04,-3.068,4.903,1.578,-1.06 +units=m +no_defs  <>
-# PRS92 / Philippines zone 4
-<epsg3124> +proj=tmerc +lat_0=0 +lon_0=123 +k=0.99995 +x_0=500000 +y_0=0 +ellps=clrk66 +towgs84=-127.62,-67.24,-47.04,-3.068,4.903,1.578,-1.06 +units=m +no_defs  <>
-# PRS92 / Philippines zone 5
-<epsg3125> +proj=tmerc +lat_0=0 +lon_0=125 +k=0.99995 +x_0=500000 +y_0=0 +ellps=clrk66 +towgs84=-127.62,-67.24,-47.04,-3.068,4.903,1.578,-1.06 +units=m +no_defs  <>
-# ETRS89 / ETRS-GK19FIN
-<epsg3126> +proj=tmerc +lat_0=0 +lon_0=19 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ETRS89 / ETRS-GK20FIN
-<epsg3127> +proj=tmerc +lat_0=0 +lon_0=20 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ETRS89 / ETRS-GK21FIN
-<epsg3128> +proj=tmerc +lat_0=0 +lon_0=21 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ETRS89 / ETRS-GK22FIN
-<epsg3129> +proj=tmerc +lat_0=0 +lon_0=22 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ETRS89 / ETRS-GK23FIN
-<epsg3130> +proj=tmerc +lat_0=0 +lon_0=23 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ETRS89 / ETRS-GK24FIN
-<epsg3131> +proj=tmerc +lat_0=0 +lon_0=24 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ETRS89 / ETRS-GK25FIN
-<epsg3132> +proj=tmerc +lat_0=0 +lon_0=25 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ETRS89 / ETRS-GK26FIN
-<epsg3133> +proj=tmerc +lat_0=0 +lon_0=26 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ETRS89 / ETRS-GK27FIN
-<epsg3134> +proj=tmerc +lat_0=0 +lon_0=27 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ETRS89 / ETRS-GK28FIN
-<epsg3135> +proj=tmerc +lat_0=0 +lon_0=28 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ETRS89 / ETRS-GK29FIN
-<epsg3136> +proj=tmerc +lat_0=0 +lon_0=29 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ETRS89 / ETRS-GK30FIN
-<epsg3137> +proj=tmerc +lat_0=0 +lon_0=30 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ETRS89 / ETRS-GK31FIN
-<epsg3138> +proj=tmerc +lat_0=0 +lon_0=31 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# Vanua Levu 1915 / Vanua Levu Grid
-# Unable to translate coordinate system EPSG:3139 into PROJ.4 format.
-#
-# Viti Levu 1912 / Viti Levu Grid
-<epsg3140> +proj=cass +lat_0=-18 +lon_0=178 +x_0=109435.392 +y_0=141622.272 +a=6378306.3696 +b=6356571.996 +towgs84=51,391,-36,0,0,0,0 +to_meter=0.201168 +no_defs  <>
-# Fiji 1956 / UTM zone 60S
-<epsg3141> +proj=utm +zone=60 +south +ellps=intl +towgs84=265.025,384.929,-194.046,0,0,0,0 +units=m +no_defs  <>
-# Fiji 1956 / UTM zone 1S
-<epsg3142> +proj=utm +zone=1 +south +ellps=intl +towgs84=265.025,384.929,-194.046,0,0,0,0 +units=m +no_defs  <>
-# Fiji 1986 / Fiji Map Grid (deprecated)
-<epsg3143> +proj=tmerc +lat_0=-17 +lon_0=178.75 +k=0.99985 +x_0=2000000 +y_0=4000000 +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# FD54 / Faroe Lambert
-# Unable to translate coordinate system EPSG:3144 into PROJ.4 format.
-#
-# ETRS89 / Faroe Lambert
-# Unable to translate coordinate system EPSG:3145 into PROJ.4 format.
-#
-# Pulkovo 1942 / 3-degree Gauss-Kruger zone 6
-<epsg3146> +proj=tmerc +lat_0=0 +lon_0=18 +k=1 +x_0=6500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger CM 18E
-<epsg3147> +proj=tmerc +lat_0=0 +lon_0=18 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Indian 1960 / UTM zone 48N
-<epsg3148> +proj=utm +zone=48 +a=6377276.345 +b=6356075.41314024 +towgs84=198,881,317,0,0,0,0 +units=m +no_defs  <>
-# Indian 1960 / UTM zone 49N
-<epsg3149> +proj=utm +zone=49 +a=6377276.345 +b=6356075.41314024 +towgs84=198,881,317,0,0,0,0 +units=m +no_defs  <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger zone 6
-<epsg3150> +proj=tmerc +lat_0=0 +lon_0=18 +k=1 +x_0=6500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger CM 18E
-<epsg3151> +proj=tmerc +lat_0=0 +lon_0=18 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# ST74
-<epsg3152> +proj=tmerc +lat_0=0 +lon_0=18.05779 +k=0.99999425 +x_0=100178.1808 +y_0=-6500614.7836 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(CSRS) / BC Albers
-<epsg3153> +proj=aea +lat_1=50 +lat_2=58.5 +lat_0=45 +lon_0=-126 +x_0=1000000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(CSRS) / UTM zone 7N
-<epsg3154> +proj=utm +zone=7 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(CSRS) / UTM zone 8N
-<epsg3155> +proj=utm +zone=8 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(CSRS) / UTM zone 9N
-<epsg3156> +proj=utm +zone=9 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(CSRS) / UTM zone 10N
-<epsg3157> +proj=utm +zone=10 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(CSRS) / UTM zone 14N
-<epsg3158> +proj=utm +zone=14 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(CSRS) / UTM zone 15N
-<epsg3159> +proj=utm +zone=15 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(CSRS) / UTM zone 16N
-<epsg3160> +proj=utm +zone=16 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83 / Ontario MNR Lambert
-<epsg3161> +proj=lcc +lat_1=44.5 +lat_2=53.5 +lat_0=0 +lon_0=-85 +x_0=930000 +y_0=6430000 +datum=NAD83 +units=m +no_defs  <>
-# NAD83(CSRS) / Ontario MNR Lambert
-<epsg3162> +proj=lcc +lat_1=44.5 +lat_2=53.5 +lat_0=0 +lon_0=-85 +x_0=930000 +y_0=6430000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# RGNC91-93 / Lambert New Caledonia
-<epsg3163> +proj=lcc +lat_1=-20.66666666666667 +lat_2=-22.33333333333333 +lat_0=-21.5 +lon_0=166 +x_0=400000 +y_0=300000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ST87 Ouvea / UTM zone 58S
-<epsg3164> +proj=utm +zone=58 +south +ellps=WGS84 +towgs84=-56.263,16.136,-22.856,0,0,0,0 +units=m +no_defs  <>
-# NEA74 Noumea / Noumea Lambert
-<epsg3165> +proj=lcc +lat_1=-22.24469175 +lat_2=-22.29469175 +lat_0=-22.26969175 +lon_0=166.44242575 +x_0=0.66 +y_0=1.02 +ellps=intl +towgs84=-10.18,-350.43,291.37,0,0,0,0 +units=m +no_defs  <>
-# NEA74 Noumea / Noumea Lambert 2
-<epsg3166> +proj=lcc +lat_1=-22.24472222222222 +lat_2=-22.29472222222222 +lat_0=-22.26972222222222 +lon_0=166.4425 +x_0=8.313000000000001 +y_0=-2.354 +ellps=intl +towgs84=-10.18,-350.43,291.37,0,0,0,0 +units=m +no_defs  <>
-# Kertau (RSO) / RSO Malaya (ch)
-<epsg3167> +proj=omerc +lat_0=4 +lonc=102.25 +alpha=323.0257905 +k=0.99984 +x_0=40000 +y_0=0 +no_uoff +gamma=323.1301023611111 +a=6377295.664 +b=6356094.667915204 +to_meter=20.116756 +no_defs  <>
-# Kertau (RSO) / RSO Malaya (m)
-<epsg3168> +proj=omerc +lat_0=4 +lonc=102.25 +alpha=323.0257905 +k=0.99984 +x_0=804670.24 +y_0=0 +no_uoff +gamma=323.1301023611111 +a=6377295.664 +b=6356094.667915204 +units=m +no_defs  <>
-# RGNC91-93 / UTM zone 57S
-<epsg3169> +proj=utm +zone=57 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# RGNC91-93 / UTM zone 58S
-<epsg3170> +proj=utm +zone=58 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# RGNC91-93 / UTM zone 59S
-<epsg3171> +proj=utm +zone=59 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# IGN53 Mare / UTM zone 59S
-<epsg3172> +proj=utm +zone=59 +south +ellps=intl +towgs84=287.58,177.78,-135.41,0,0,0,0 +units=m +no_defs  <>
-# fk89 / Faroe Lambert FK89
-# Unable to translate coordinate system EPSG:3173 into PROJ.4 format.
-#
-# NAD83 / Great Lakes Albers
-<epsg3174> +proj=aea +lat_1=42.122774 +lat_2=49.01518 +lat_0=45.568977 +lon_0=-84.455955 +x_0=1000000 +y_0=1000000 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / Great Lakes and St Lawrence Albers
-<epsg3175> +proj=aea +lat_1=42.122774 +lat_2=49.01518 +lat_0=45.568977 +lon_0=-83.248627 +x_0=1000000 +y_0=1000000 +datum=NAD83 +units=m +no_defs  <>
-# Indian 1960 / TM 106 NE
-<epsg3176> +proj=tmerc +lat_0=0 +lon_0=106 +k=0.9996 +x_0=500000 +y_0=0 +a=6377276.345 +b=6356075.41314024 +towgs84=198,881,317,0,0,0,0 +units=m +no_defs  <>
-# LGD2006 / Libya TM
-<epsg3177> +proj=tmerc +lat_0=0 +lon_0=17 +k=0.9965000000000001 +x_0=1000000 +y_0=0 +ellps=intl +towgs84=-208.406,-109.878,-2.5764,0,0,0,0 +units=m +no_defs  <>
-# GR96 / UTM zone 18N
-<epsg3178> +proj=utm +zone=18 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# GR96 / UTM zone 19N
-<epsg3179> +proj=utm +zone=19 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# GR96 / UTM zone 20N
-<epsg3180> +proj=utm +zone=20 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# GR96 / UTM zone 21N
-<epsg3181> +proj=utm +zone=21 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# GR96 / UTM zone 22N
-<epsg3182> +proj=utm +zone=22 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# GR96 / UTM zone 23N
-<epsg3183> +proj=utm +zone=23 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# GR96 / UTM zone 24N
-<epsg3184> +proj=utm +zone=24 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# GR96 / UTM zone 25N
-<epsg3185> +proj=utm +zone=25 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# GR96 / UTM zone 26N
-<epsg3186> +proj=utm +zone=26 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# GR96 / UTM zone 27N
-<epsg3187> +proj=utm +zone=27 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# GR96 / UTM zone 28N
-<epsg3188> +proj=utm +zone=28 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# GR96 / UTM zone 29N
-<epsg3189> +proj=utm +zone=29 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# LGD2006 / Libya TM zone 5
-<epsg3190> +proj=tmerc +lat_0=0 +lon_0=9 +k=0.99995 +x_0=200000 +y_0=0 +ellps=intl +towgs84=-208.406,-109.878,-2.5764,0,0,0,0 +units=m +no_defs  <>
-# LGD2006 / Libya TM zone 6
-<epsg3191> +proj=tmerc +lat_0=0 +lon_0=11 +k=0.99995 +x_0=200000 +y_0=0 +ellps=intl +towgs84=-208.406,-109.878,-2.5764,0,0,0,0 +units=m +no_defs  <>
-# LGD2006 / Libya TM zone 7
-<epsg3192> +proj=tmerc +lat_0=0 +lon_0=13 +k=0.99995 +x_0=200000 +y_0=0 +ellps=intl +towgs84=-208.406,-109.878,-2.5764,0,0,0,0 +units=m +no_defs  <>
-# LGD2006 / Libya TM zone 8
-<epsg3193> +proj=tmerc +lat_0=0 +lon_0=15 +k=0.99995 +x_0=200000 +y_0=0 +ellps=intl +towgs84=-208.406,-109.878,-2.5764,0,0,0,0 +units=m +no_defs  <>
-# LGD2006 / Libya TM zone 9
-<epsg3194> +proj=tmerc +lat_0=0 +lon_0=17 +k=0.99995 +x_0=200000 +y_0=0 +ellps=intl +towgs84=-208.406,-109.878,-2.5764,0,0,0,0 +units=m +no_defs  <>
-# LGD2006 / Libya TM zone 10
-<epsg3195> +proj=tmerc +lat_0=0 +lon_0=19 +k=0.99995 +x_0=200000 +y_0=0 +ellps=intl +towgs84=-208.406,-109.878,-2.5764,0,0,0,0 +units=m +no_defs  <>
-# LGD2006 / Libya TM zone 11
-<epsg3196> +proj=tmerc +lat_0=0 +lon_0=21 +k=0.99995 +x_0=200000 +y_0=0 +ellps=intl +towgs84=-208.406,-109.878,-2.5764,0,0,0,0 +units=m +no_defs  <>
-# LGD2006 / Libya TM zone 12
-<epsg3197> +proj=tmerc +lat_0=0 +lon_0=23 +k=0.99995 +x_0=200000 +y_0=0 +ellps=intl +towgs84=-208.406,-109.878,-2.5764,0,0,0,0 +units=m +no_defs  <>
-# LGD2006 / Libya TM zone 13
-<epsg3198> +proj=tmerc +lat_0=0 +lon_0=25 +k=0.99995 +x_0=200000 +y_0=0 +ellps=intl +towgs84=-208.406,-109.878,-2.5764,0,0,0,0 +units=m +no_defs  <>
-# LGD2006 / UTM zone 32N
-<epsg3199> +proj=utm +zone=32 +ellps=intl +towgs84=-208.406,-109.878,-2.5764,0,0,0,0 +units=m +no_defs  <>
-# FD58 / Iraq zone
-<epsg3200> +proj=lcc +lat_1=32.5 +lat_0=32.5 +lon_0=45 +k_0=0.9987864078000001 +x_0=1500000 +y_0=1166200 +ellps=clrk80 +towgs84=-239.1,-170.02,397.5,0,0,0,0 +units=m +no_defs  <>
-# LGD2006 / UTM zone 33N
-<epsg3201> +proj=utm +zone=33 +ellps=intl +towgs84=-208.406,-109.878,-2.5764,0,0,0,0 +units=m +no_defs  <>
-# LGD2006 / UTM zone 34N
-<epsg3202> +proj=utm +zone=34 +ellps=intl +towgs84=-208.406,-109.878,-2.5764,0,0,0,0 +units=m +no_defs  <>
-# LGD2006 / UTM zone 35N
-<epsg3203> +proj=utm +zone=35 +ellps=intl +towgs84=-208.406,-109.878,-2.5764,0,0,0,0 +units=m +no_defs  <>
-# WGS 84 / SCAR IMW SP19-20
-<epsg3204> +proj=lcc +lat_1=-60.66666666666666 +lat_2=-63.33333333333334 +lat_0=-90 +lon_0=-66 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / SCAR IMW SP21-22
-<epsg3205> +proj=lcc +lat_1=-60.66666666666666 +lat_2=-63.33333333333334 +lat_0=-90 +lon_0=-54 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / SCAR IMW SP23-24
-<epsg3206> +proj=lcc +lat_1=-60.66666666666666 +lat_2=-63.33333333333334 +lat_0=-90 +lon_0=-42 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / SCAR IMW SQ01-02
-<epsg3207> +proj=lcc +lat_1=-64.66666666666667 +lat_2=-67.33333333333333 +lat_0=-90 +lon_0=-174 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / SCAR IMW SQ19-20
-<epsg3208> +proj=lcc +lat_1=-64.66666666666667 +lat_2=-67.33333333333333 +lat_0=-90 +lon_0=-66 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / SCAR IMW SQ21-22
-<epsg3209> +proj=lcc +lat_1=-64.66666666666667 +lat_2=-67.33333333333333 +lat_0=-90 +lon_0=-54 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / SCAR IMW SQ37-38
-<epsg3210> +proj=lcc +lat_1=-64.66666666666667 +lat_2=-67.33333333333333 +lat_0=-90 +lon_0=42 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / SCAR IMW SQ39-40
-<epsg3211> +proj=lcc +lat_1=-64.66666666666667 +lat_2=-67.33333333333333 +lat_0=-90 +lon_0=54 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / SCAR IMW SQ41-42
-<epsg3212> +proj=lcc +lat_1=-64.66666666666667 +lat_2=-67.33333333333333 +lat_0=-90 +lon_0=66 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / SCAR IMW SQ43-44
-<epsg3213> +proj=lcc +lat_1=-64.66666666666667 +lat_2=-67.33333333333333 +lat_0=-90 +lon_0=78 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / SCAR IMW SQ45-46
-<epsg3214> +proj=lcc +lat_1=-64.66666666666667 +lat_2=-67.33333333333333 +lat_0=-90 +lon_0=90 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / SCAR IMW SQ47-48
-<epsg3215> +proj=lcc +lat_1=-64.66666666666667 +lat_2=-67.33333333333333 +lat_0=-90 +lon_0=102 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / SCAR IMW SQ49-50
-<epsg3216> +proj=lcc +lat_1=-64.66666666666667 +lat_2=-67.33333333333333 +lat_0=-90 +lon_0=114 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / SCAR IMW SQ51-52
-<epsg3217> +proj=lcc +lat_1=-64.66666666666667 +lat_2=-67.33333333333333 +lat_0=-90 +lon_0=126 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / SCAR IMW SQ53-54
-<epsg3218> +proj=lcc +lat_1=-64.66666666666667 +lat_2=-67.33333333333333 +lat_0=-90 +lon_0=138 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / SCAR IMW SQ55-56
-<epsg3219> +proj=lcc +lat_1=-64.66666666666667 +lat_2=-67.33333333333333 +lat_0=-90 +lon_0=150 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / SCAR IMW SQ57-58
-<epsg3220> +proj=lcc +lat_1=-64.66666666666667 +lat_2=-67.33333333333333 +lat_0=-90 +lon_0=162 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / SCAR IMW SR13-14
-<epsg3221> +proj=lcc +lat_1=-68.66666666666667 +lat_2=-71.33333333333333 +lat_0=-90 +lon_0=-102 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / SCAR IMW SR15-16
-<epsg3222> +proj=lcc +lat_1=-68.66666666666667 +lat_2=-71.33333333333333 +lat_0=-90 +lon_0=-90 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / SCAR IMW SR17-18
-<epsg3223> +proj=lcc +lat_1=-68.66666666666667 +lat_2=-71.33333333333333 +lat_0=-90 +lon_0=-78 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / SCAR IMW SR19-20
-<epsg3224> +proj=lcc +lat_1=-68.66666666666667 +lat_2=-71.33333333333333 +lat_0=-90 +lon_0=-66 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / SCAR IMW SR27-28
-<epsg3225> +proj=lcc +lat_1=-68.66666666666667 +lat_2=-71.33333333333333 +lat_0=-90 +lon_0=-18 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / SCAR IMW SR29-30
-<epsg3226> +proj=lcc +lat_1=-68.66666666666667 +lat_2=-71.33333333333333 +lat_0=-90 +lon_0=-6 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / SCAR IMW SR31-32
-<epsg3227> +proj=lcc +lat_1=-68.66666666666667 +lat_2=-71.33333333333333 +lat_0=-90 +lon_0=6 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / SCAR IMW SR33-34
-<epsg3228> +proj=lcc +lat_1=-68.66666666666667 +lat_2=-71.33333333333333 +lat_0=-90 +lon_0=18 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / SCAR IMW SR35-36
-<epsg3229> +proj=lcc +lat_1=-68.66666666666667 +lat_2=-71.33333333333333 +lat_0=-90 +lon_0=30 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / SCAR IMW SR37-38
-<epsg3230> +proj=lcc +lat_1=-68.66666666666667 +lat_2=-71.33333333333333 +lat_0=-90 +lon_0=42 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / SCAR IMW SR39-40
-<epsg3231> +proj=lcc +lat_1=-68.66666666666667 +lat_2=-71.33333333333333 +lat_0=-90 +lon_0=54 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / SCAR IMW SR41-42
-<epsg3232> +proj=lcc +lat_1=-68.66666666666667 +lat_2=-71.33333333333333 +lat_0=-90 +lon_0=66 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / SCAR IMW SR43-44
-<epsg3233> +proj=lcc +lat_1=-68.66666666666667 +lat_2=-71.33333333333333 +lat_0=-90 +lon_0=78 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / SCAR IMW SR45-46
-<epsg3234> +proj=lcc +lat_1=-68.66666666666667 +lat_2=-71.33333333333333 +lat_0=-90 +lon_0=90 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / SCAR IMW SR47-48
-<epsg3235> +proj=lcc +lat_1=-68.66666666666667 +lat_2=-71.33333333333333 +lat_0=-90 +lon_0=102 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / SCAR IMW SR49-50
-<epsg3236> +proj=lcc +lat_1=-68.66666666666667 +lat_2=-71.33333333333333 +lat_0=-90 +lon_0=114 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / SCAR IMW SR51-52
-<epsg3237> +proj=lcc +lat_1=-68.66666666666667 +lat_2=-71.33333333333333 +lat_0=-90 +lon_0=126 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / SCAR IMW SR53-54
-<epsg3238> +proj=lcc +lat_1=-68.66666666666667 +lat_2=-71.33333333333333 +lat_0=-90 +lon_0=138 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / SCAR IMW SR55-56
-<epsg3239> +proj=lcc +lat_1=-68.66666666666667 +lat_2=-71.33333333333333 +lat_0=-90 +lon_0=150 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / SCAR IMW SR57-58
-<epsg3240> +proj=lcc +lat_1=-68.66666666666667 +lat_2=-71.33333333333333 +lat_0=-90 +lon_0=162 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / SCAR IMW SR59-60
-<epsg3241> +proj=lcc +lat_1=-68.66666666666667 +lat_2=-71.33333333333333 +lat_0=-90 +lon_0=174 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / SCAR IMW SS04-06
-<epsg3242> +proj=lcc +lat_1=-72.66666666666667 +lat_2=-75.33333333333333 +lat_0=-90 +lon_0=-153 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / SCAR IMW SS07-09
-<epsg3243> +proj=lcc +lat_1=-72.66666666666667 +lat_2=-75.33333333333333 +lat_0=-90 +lon_0=-135 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / SCAR IMW SS10-12
-<epsg3244> +proj=lcc +lat_1=-72.66666666666667 +lat_2=-75.33333333333333 +lat_0=-90 +lon_0=-117 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / SCAR IMW SS13-15
-<epsg3245> +proj=lcc +lat_1=-72.66666666666667 +lat_2=-75.33333333333333 +lat_0=-90 +lon_0=-99 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / SCAR IMW SS16-18
-<epsg3246> +proj=lcc +lat_1=-72.66666666666667 +lat_2=-75.33333333333333 +lat_0=-90 +lon_0=-81 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / SCAR IMW SS19-21
-<epsg3247> +proj=lcc +lat_1=-72.66666666666667 +lat_2=-75.33333333333333 +lat_0=-90 +lon_0=-63 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / SCAR IMW SS25-27
-<epsg3248> +proj=lcc +lat_1=-72.66666666666667 +lat_2=-75.33333333333333 +lat_0=-90 +lon_0=-27 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / SCAR IMW SS28-30
-<epsg3249> +proj=lcc +lat_1=-72.66666666666667 +lat_2=-75.33333333333333 +lat_0=-90 +lon_0=-9 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / SCAR IMW SS31-33
-<epsg3250> +proj=lcc +lat_1=-72.66666666666667 +lat_2=-75.33333333333333 +lat_0=-90 +lon_0=9 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / SCAR IMW SS34-36
-<epsg3251> +proj=lcc +lat_1=-72.66666666666667 +lat_2=-75.33333333333333 +lat_0=-90 +lon_0=27 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / SCAR IMW SS37-39
-<epsg3252> +proj=lcc +lat_1=-72.66666666666667 +lat_2=-75.33333333333333 +lat_0=-90 +lon_0=45 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / SCAR IMW SS40-42
-<epsg3253> +proj=lcc +lat_1=-72.66666666666667 +lat_2=-75.33333333333333 +lat_0=-90 +lon_0=63 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / SCAR IMW SS43-45
-<epsg3254> +proj=lcc +lat_1=-72.66666666666667 +lat_2=-75.33333333333333 +lat_0=-90 +lon_0=81 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / SCAR IMW SS46-48
-<epsg3255> +proj=lcc +lat_1=-72.66666666666667 +lat_2=-75.33333333333333 +lat_0=-90 +lon_0=99 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / SCAR IMW SS49-51
-<epsg3256> +proj=lcc +lat_1=-72.66666666666667 +lat_2=-75.33333333333333 +lat_0=-90 +lon_0=117 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / SCAR IMW SS52-54
-<epsg3257> +proj=lcc +lat_1=-72.66666666666667 +lat_2=-75.33333333333333 +lat_0=-90 +lon_0=135 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / SCAR IMW SS55-57
-<epsg3258> +proj=lcc +lat_1=-72.66666666666667 +lat_2=-75.33333333333333 +lat_0=-90 +lon_0=153 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / SCAR IMW SS58-60
-<epsg3259> +proj=lcc +lat_1=-72.66666666666667 +lat_2=-75.33333333333333 +lat_0=-90 +lon_0=171 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / SCAR IMW ST01-04
-<epsg3260> +proj=lcc +lat_1=-76.66666666666667 +lat_2=-79.33333333333333 +lat_0=-90 +lon_0=-168 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / SCAR IMW ST05-08
-<epsg3261> +proj=lcc +lat_1=-76.66666666666667 +lat_2=-79.33333333333333 +lat_0=-90 +lon_0=-144 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / SCAR IMW ST09-12
-<epsg3262> +proj=lcc +lat_1=-76.66666666666667 +lat_2=-79.33333333333333 +lat_0=-90 +lon_0=-120 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / SCAR IMW ST13-16
-<epsg3263> +proj=lcc +lat_1=-76.66666666666667 +lat_2=-79.33333333333333 +lat_0=-90 +lon_0=-96 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / SCAR IMW ST17-20
-<epsg3264> +proj=lcc +lat_1=-76.66666666666667 +lat_2=-79.33333333333333 +lat_0=-90 +lon_0=-72 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / SCAR IMW ST21-24
-<epsg3265> +proj=lcc +lat_1=-76.66666666666667 +lat_2=-79.33333333333333 +lat_0=-90 +lon_0=-48 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / SCAR IMW ST25-28
-<epsg3266> +proj=lcc +lat_1=-76.66666666666667 +lat_2=-79.33333333333333 +lat_0=-90 +lon_0=-24 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / SCAR IMW ST29-32
-<epsg3267> +proj=lcc +lat_1=-76.66666666666667 +lat_2=-79.33333333333333 +lat_0=-90 +lon_0=0 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / SCAR IMW ST33-36
-<epsg3268> +proj=lcc +lat_1=-76.66666666666667 +lat_2=-79.33333333333333 +lat_0=-90 +lon_0=24 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / SCAR IMW ST37-40
-<epsg3269> +proj=lcc +lat_1=-76.66666666666667 +lat_2=-79.33333333333333 +lat_0=-90 +lon_0=48 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / SCAR IMW ST41-44
-<epsg3270> +proj=lcc +lat_1=-76.66666666666667 +lat_2=-79.33333333333333 +lat_0=-90 +lon_0=72 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / SCAR IMW ST45-48
-<epsg3271> +proj=lcc +lat_1=-76.66666666666667 +lat_2=-79.33333333333333 +lat_0=-90 +lon_0=96 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / SCAR IMW ST49-52
-<epsg3272> +proj=lcc +lat_1=-76.66666666666667 +lat_2=-79.33333333333333 +lat_0=-90 +lon_0=120 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / SCAR IMW ST53-56
-<epsg3273> +proj=lcc +lat_1=-76.66666666666667 +lat_2=-79.33333333333333 +lat_0=-90 +lon_0=144 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / SCAR IMW ST57-60
-<epsg3274> +proj=lcc +lat_1=-76.66666666666667 +lat_2=-79.33333333333333 +lat_0=-90 +lon_0=168 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / SCAR IMW SU01-05
-<epsg3275> +proj=stere +lat_0=-90 +lat_ts=-80.23861111111111 +lon_0=-165 +k=1 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / SCAR IMW SU06-10
-<epsg3276> +proj=stere +lat_0=-90 +lat_ts=-80.23861111111111 +lon_0=-135 +k=1 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / SCAR IMW SU11-15
-<epsg3277> +proj=stere +lat_0=-90 +lat_ts=-80.23861111111111 +lon_0=-105 +k=1 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / SCAR IMW SU16-20
-<epsg3278> +proj=stere +lat_0=-90 +lat_ts=-80.23861111111111 +lon_0=-75 +k=1 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / SCAR IMW SU21-25
-<epsg3279> +proj=stere +lat_0=-90 +lat_ts=-80.23861111111111 +lon_0=-45 +k=1 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / SCAR IMW SU26-30
-<epsg3280> +proj=stere +lat_0=-90 +lat_ts=-80.23861111111111 +lon_0=-15 +k=1 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / SCAR IMW SU31-35
-<epsg3281> +proj=stere +lat_0=-90 +lat_ts=-80.23861111111111 +lon_0=15 +k=1 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / SCAR IMW SU36-40
-<epsg3282> +proj=stere +lat_0=-90 +lat_ts=-80.23861111111111 +lon_0=45 +k=1 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / SCAR IMW SU41-45
-<epsg3283> +proj=stere +lat_0=-90 +lat_ts=-80.23861111111111 +lon_0=75 +k=1 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / SCAR IMW SU46-50
-<epsg3284> +proj=stere +lat_0=-90 +lat_ts=-80.23861111111111 +lon_0=105 +k=1 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / SCAR IMW SU51-55
-<epsg3285> +proj=stere +lat_0=-90 +lat_ts=-80.23861111111111 +lon_0=135 +k=1 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / SCAR IMW SU56-60
-<epsg3286> +proj=stere +lat_0=-90 +lat_ts=-80.23861111111111 +lon_0=165 +k=1 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / SCAR IMW SV01-10
-<epsg3287> +proj=stere +lat_0=-90 +lat_ts=-80.23861111111111 +lon_0=-150 +k=1 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / SCAR IMW SV11-20
-<epsg3288> +proj=stere +lat_0=-90 +lat_ts=-80.23861111111111 +lon_0=-90 +k=1 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / SCAR IMW SV21-30
-<epsg3289> +proj=stere +lat_0=-90 +lat_ts=-80.23861111111111 +lon_0=-30 +k=1 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / SCAR IMW SV31-40
-<epsg3290> +proj=stere +lat_0=-90 +lat_ts=-80.23861111111111 +lon_0=30 +k=1 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / SCAR IMW SV41-50
-<epsg3291> +proj=stere +lat_0=-90 +lat_ts=-80.23861111111111 +lon_0=90 +k=1 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / SCAR IMW SV51-60
-<epsg3292> +proj=stere +lat_0=-90 +lat_ts=-80.23861111111111 +lon_0=150 +k=1 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / SCAR IMW SW01-60
-<epsg3293> +proj=stere +lat_0=-90 +lat_ts=-80.23861111111111 +lon_0=0 +k=1 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / USGS Transantarctic Mountains
-<epsg3294> +proj=lcc +lat_1=-76.66666666666667 +lat_2=-79.33333333333333 +lat_0=-78 +lon_0=162 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs  <>
-# Guam 1963 / Yap Islands
-# Unable to translate coordinate system EPSG:3295 into PROJ.4 format.
-#
-# RGPF / UTM zone 5S
-<epsg3296> +proj=utm +zone=5 +south +ellps=GRS80 +towgs84=0.072,-0.507,-0.245,-0.0183,0.0003,-0.007,-0.0093 +units=m +no_defs  <>
-# RGPF / UTM zone 6S
-<epsg3297> +proj=utm +zone=6 +south +ellps=GRS80 +towgs84=0.072,-0.507,-0.245,-0.0183,0.0003,-0.007,-0.0093 +units=m +no_defs  <>
-# RGPF / UTM zone 7S
-<epsg3298> +proj=utm +zone=7 +south +ellps=GRS80 +towgs84=0.072,-0.507,-0.245,-0.0183,0.0003,-0.007,-0.0093 +units=m +no_defs  <>
-# RGPF / UTM zone 8S
-<epsg3299> +proj=utm +zone=8 +south +ellps=GRS80 +towgs84=0.072,-0.507,-0.245,-0.0183,0.0003,-0.007,-0.0093 +units=m +no_defs  <>
-# Estonian Coordinate System of 1992
-<epsg3300> +proj=lcc +lat_1=59.33333333333334 +lat_2=58 +lat_0=57.51755393055556 +lon_0=24 +x_0=500000 +y_0=6375000 +ellps=GRS80 +towgs84=0.055,-0.541,-0.185,0.0183,-0.0003,-0.007,-0.014 +units=m +no_defs  <>
-# Estonian Coordinate System of 1997
-<epsg3301> +proj=lcc +lat_1=59.33333333333334 +lat_2=58 +lat_0=57.51755393055556 +lon_0=24 +x_0=500000 +y_0=6375000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# IGN63 Hiva Oa / UTM zone 7S
-<epsg3302> +proj=utm +zone=7 +south +ellps=intl +towgs84=410.721,55.049,80.746,2.5779,2.3514,0.6664,17.3311 +units=m +no_defs  <>
-# Fatu Iva 72 / UTM zone 7S
-<epsg3303> +proj=utm +zone=7 +south +ellps=intl +towgs84=347.103,1078.12,2623.92,-33.8875,70.6773,-9.3943,186.074 +units=m +no_defs  <>
-# Tahiti 79 / UTM zone 6S
-<epsg3304> +proj=utm +zone=6 +south +ellps=intl +towgs84=221.525,152.948,176.768,-2.3847,-1.3896,-0.877,11.4741 +units=m +no_defs  <>
-# Moorea 87 / UTM zone 6S
-<epsg3305> +proj=utm +zone=6 +south +ellps=intl +towgs84=215.525,149.593,176.229,-3.2624,-1.692,-1.1571,10.4773 +units=m +no_defs  <>
-# Maupiti 83 / UTM zone 5S
-<epsg3306> +proj=utm +zone=5 +south +ellps=intl +towgs84=217.037,86.959,23.956,0,0,0,0 +units=m +no_defs  <>
-# Nakhl-e Ghanem / UTM zone 39N
-<epsg3307> +proj=utm +zone=39 +ellps=WGS84 +towgs84=0,-0.15,0.68,0,0,0,0 +units=m +no_defs  <>
-# GDA94 / NSW Lambert
-<epsg3308> +proj=lcc +lat_1=-30.75 +lat_2=-35.75 +lat_0=-33.25 +lon_0=147 +x_0=9300000 +y_0=4500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD27 / California Albers
-<epsg3309> +proj=aea +lat_1=34 +lat_2=40.5 +lat_0=0 +lon_0=-120 +x_0=0 +y_0=-4000000 +datum=NAD27 +units=m +no_defs  <>
-# NAD83 / California Albers
-<epsg3310> +proj=aea +lat_1=34 +lat_2=40.5 +lat_0=0 +lon_0=-120 +x_0=0 +y_0=-4000000 +datum=NAD83 +units=m +no_defs  <>
-# NAD83(HARN) / California Albers
-<epsg3311> +proj=aea +lat_1=34 +lat_2=40.5 +lat_0=0 +lon_0=-120 +x_0=0 +y_0=-4000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# CSG67 / UTM zone 21N
-<epsg3312> +proj=utm +zone=21 +ellps=intl +towgs84=-186,230,110,0,0,0,0 +units=m +no_defs  <>
-# RGFG95 / UTM zone 21N
-<epsg3313> +proj=utm +zone=21 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# Katanga 1955 / Katanga Lambert (deprecated)
-<epsg3314> +proj=lcc +lat_1=-6.5 +lat_2=-11.5 +lat_0=0 +lon_0=26 +x_0=0 +y_0=0 +ellps=clrk66 +towgs84=-103.746,-9.614,-255.95,0,0,0,0 +units=m +no_defs  <>
-# Katanga 1955 / Katanga TM (deprecated)
-<epsg3315> +proj=tmerc +lat_0=-9 +lon_0=26 +k=0.9998 +x_0=0 +y_0=0 +ellps=clrk66 +towgs84=-103.746,-9.614,-255.95,0,0,0,0 +units=m +no_defs  <>
-# Kasai 1953 / Congo TM zone 22
-<epsg3316> +proj=tmerc +lat_0=0 +lon_0=22 +k=0.9999 +x_0=500000 +y_0=10000000 +ellps=clrk80 +units=m +no_defs  <>
-# Kasai 1953 / Congo TM zone 24
-<epsg3317> +proj=tmerc +lat_0=0 +lon_0=24 +k=0.9999 +x_0=500000 +y_0=10000000 +ellps=clrk80 +units=m +no_defs  <>
-# IGC 1962 / Congo TM zone 12
-<epsg3318> +proj=tmerc +lat_0=0 +lon_0=12 +k=0.9999 +x_0=500000 +y_0=10000000 +ellps=clrk80 +units=m +no_defs  <>
-# IGC 1962 / Congo TM zone 14
-<epsg3319> +proj=tmerc +lat_0=0 +lon_0=14 +k=0.9999 +x_0=500000 +y_0=10000000 +ellps=clrk80 +units=m +no_defs  <>
-# IGC 1962 / Congo TM zone 16
-<epsg3320> +proj=tmerc +lat_0=0 +lon_0=16 +k=0.9999 +x_0=500000 +y_0=10000000 +ellps=clrk80 +units=m +no_defs  <>
-# IGC 1962 / Congo TM zone 18
-<epsg3321> +proj=tmerc +lat_0=0 +lon_0=18 +k=0.9999 +x_0=500000 +y_0=10000000 +ellps=clrk80 +units=m +no_defs  <>
-# IGC 1962 / Congo TM zone 20
-<epsg3322> +proj=tmerc +lat_0=0 +lon_0=20 +k=0.9999 +x_0=500000 +y_0=10000000 +ellps=clrk80 +units=m +no_defs  <>
-# IGC 1962 / Congo TM zone 22
-<epsg3323> +proj=tmerc +lat_0=0 +lon_0=22 +k=0.9999 +x_0=500000 +y_0=10000000 +ellps=clrk80 +units=m +no_defs  <>
-# IGC 1962 / Congo TM zone 24
-<epsg3324> +proj=tmerc +lat_0=0 +lon_0=24 +k=0.9999 +x_0=500000 +y_0=10000000 +ellps=clrk80 +units=m +no_defs  <>
-# IGC 1962 / Congo TM zone 26
-<epsg3325> +proj=tmerc +lat_0=0 +lon_0=26 +k=0.9999 +x_0=500000 +y_0=10000000 +ellps=clrk80 +units=m +no_defs  <>
-# IGC 1962 / Congo TM zone 28
-<epsg3326> +proj=tmerc +lat_0=0 +lon_0=28 +k=0.9999 +x_0=500000 +y_0=10000000 +ellps=clrk80 +units=m +no_defs  <>
-# IGC 1962 / Congo TM zone 30
-<epsg3327> +proj=tmerc +lat_0=0 +lon_0=30 +k=0.9999 +x_0=500000 +y_0=10000000 +ellps=clrk80 +units=m +no_defs  <>
-# Pulkovo 1942(58) / GUGiK-80
-<epsg3328> +proj=sterea +lat_0=52.16666666666666 +lon_0=19.16666666666667 +k=0.999714 +x_0=500000 +y_0=500000 +ellps=krass +towgs84=33.4,-146.6,-76.3,-0.359,-0.053,0.844,-0.84 +units=m +no_defs  <>
-# Pulkovo 1942(58) / 3-degree Gauss-Kruger zone 5
-<epsg3329> +proj=tmerc +lat_0=0 +lon_0=15 +k=1 +x_0=5500000 +y_0=0 +ellps=krass +towgs84=33.4,-146.6,-76.3,-0.359,-0.053,0.844,-0.84 +units=m +no_defs  <>
-# Pulkovo 1942(58) / 3-degree Gauss-Kruger zone 6
-<epsg3330> +proj=tmerc +lat_0=0 +lon_0=18 +k=1 +x_0=6500000 +y_0=0 +ellps=krass +towgs84=33.4,-146.6,-76.3,-0.359,-0.053,0.844,-0.84 +units=m +no_defs  <>
-# Pulkovo 1942(58) / 3-degree Gauss-Kruger zone 7
-<epsg3331> +proj=tmerc +lat_0=0 +lon_0=21 +k=1 +x_0=7500000 +y_0=0 +ellps=krass +towgs84=33.4,-146.6,-76.3,-0.359,-0.053,0.844,-0.84 +units=m +no_defs  <>
-# Pulkovo 1942(58) / 3-degree Gauss-Kruger zone 8
-<epsg3332> +proj=tmerc +lat_0=0 +lon_0=24 +k=1 +x_0=8500000 +y_0=0 +ellps=krass +towgs84=33.4,-146.6,-76.3,-0.359,-0.053,0.844,-0.84 +units=m +no_defs  <>
-# Pulkovo 1942(58) / Gauss-Kruger zone 3
-<epsg3333> +proj=tmerc +lat_0=0 +lon_0=15 +k=1 +x_0=3500000 +y_0=0 +ellps=krass +towgs84=33.4,-146.6,-76.3,-0.359,-0.053,0.844,-0.84 +units=m +no_defs  <>
-# Pulkovo 1942(58) / Gauss-Kruger zone 4
-<epsg3334> +proj=tmerc +lat_0=0 +lon_0=21 +k=1 +x_0=4500000 +y_0=0 +ellps=krass +towgs84=33.4,-146.6,-76.3,-0.359,-0.053,0.844,-0.84 +units=m +no_defs  <>
-# Pulkovo 1942(58) / Gauss-Kruger zone 5
-<epsg3335> +proj=tmerc +lat_0=0 +lon_0=27 +k=1 +x_0=5500000 +y_0=0 +ellps=krass +towgs84=33.4,-146.6,-76.3,-0.359,-0.053,0.844,-0.84 +units=m +no_defs  <>
-# IGN 1962 Kerguelen / UTM zone 42S
-<epsg3336> +proj=utm +zone=42 +south +ellps=intl +towgs84=145,-187,103,0,0,0,0 +units=m +no_defs  <>
-# Le Pouce 1934 / Mauritius Grid
-<epsg3337> +proj=lcc +lat_1=-20.19506944444445 +lat_0=-20.19506944444445 +lon_0=57.52182777777778 +k_0=1 +x_0=1000000 +y_0=1000000 +ellps=clrk80 +towgs84=-770.1,158.4,-498.2,0,0,0,0 +units=m +no_defs  <>
-# NAD83 / Alaska Albers
-<epsg3338> +proj=aea +lat_1=55 +lat_2=65 +lat_0=50 +lon_0=-154 +x_0=0 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# IGCB 1955 / Congo TM zone 12
-<epsg3339> +proj=tmerc +lat_0=0 +lon_0=12 +k=0.9999 +x_0=500000 +y_0=10000000 +ellps=clrk80 +towgs84=-79.9,-158,-168.9,0,0,0,0 +units=m +no_defs  <>
-# IGCB 1955 / Congo TM zone 14
-<epsg3340> +proj=tmerc +lat_0=0 +lon_0=14 +k=0.9999 +x_0=500000 +y_0=10000000 +ellps=clrk80 +towgs84=-79.9,-158,-168.9,0,0,0,0 +units=m +no_defs  <>
-# IGCB 1955 / Congo TM zone 16
-<epsg3341> +proj=tmerc +lat_0=0 +lon_0=16 +k=0.9999 +x_0=500000 +y_0=10000000 +ellps=clrk80 +towgs84=-79.9,-158,-168.9,0,0,0,0 +units=m +no_defs  <>
-# IGCB 1955 / UTM zone 33S
-<epsg3342> +proj=utm +zone=33 +south +ellps=clrk80 +towgs84=-79.9,-158,-168.9,0,0,0,0 +units=m +no_defs  <>
-# Mauritania 1999 / UTM zone 28N
-<epsg3343> +proj=utm +zone=28 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# Mauritania 1999 / UTM zone 29N
-<epsg3344> +proj=utm +zone=29 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# Mauritania 1999 / UTM zone 30N
-<epsg3345> +proj=utm +zone=30 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# LKS94 / Lithuania TM
-<epsg3346> +proj=tmerc +lat_0=0 +lon_0=24 +k=0.9998 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83 / Statistics Canada Lambert
-<epsg3347> +proj=lcc +lat_1=49 +lat_2=77 +lat_0=63.390675 +lon_0=-91.86666666666666 +x_0=6200000 +y_0=3000000 +datum=NAD83 +units=m +no_defs  <>
-# NAD83(CSRS) / Statistics Canada Lambert
-<epsg3348> +proj=lcc +lat_1=49 +lat_2=77 +lat_0=63.390675 +lon_0=-91.86666666666666 +x_0=6200000 +y_0=3000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# WGS 84 / PDC Mercator (deprecated)
-<epsg3349> +proj=merc +lon_0=-150 +k=1 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs  <>
-# Pulkovo 1942 / CS63 zone C0
-<epsg3350> +proj=tmerc +lat_0=0.1 +lon_0=21.95 +k=1 +x_0=250000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / CS63 zone C1
-<epsg3351> +proj=tmerc +lat_0=0.1 +lon_0=24.95 +k=1 +x_0=1250000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / CS63 zone C2
-<epsg3352> +proj=tmerc +lat_0=0.1 +lon_0=27.95 +k=1 +x_0=2250000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Mhast (onshore) / UTM zone 32S
-<epsg3353> +proj=utm +zone=32 +south +ellps=intl +units=m +no_defs  <>
-# Mhast (offshore) / UTM zone 32S
-<epsg3354> +proj=utm +zone=32 +south +ellps=intl +units=m +no_defs  <>
-# Egypt Gulf of Suez S-650 TL / Red Belt
-<epsg3355> +proj=tmerc +lat_0=30 +lon_0=31 +k=1 +x_0=615000 +y_0=810000 +ellps=helmert +towgs84=-146.21,112.63,4.05,0,0,0,0 +units=m +no_defs  <>
-# Grand Cayman 1959 / UTM zone 17N
-<epsg3356> +proj=utm +zone=17 +ellps=clrk66 +towgs84=67.8,106.1,138.8,0,0,0,0 +units=m +no_defs  <>
-# Little Cayman 1961 / UTM zone 17N
-<epsg3357> +proj=utm +zone=17 +ellps=clrk66 +towgs84=42,124,147,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / North Carolina
-<epsg3358> +proj=lcc +lat_1=36.16666666666666 +lat_2=34.33333333333334 +lat_0=33.75 +lon_0=-79 +x_0=609601.22 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / North Carolina (ftUS) (deprecated)
-<epsg3359> +proj=lcc +lat_1=36.16666666666666 +lat_2=34.33333333333334 +lat_0=33.75 +lon_0=-79 +x_0=609601.2192024385 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=ft +no_defs  <>
-# NAD83(HARN) / South Carolina
-<epsg3360> +proj=lcc +lat_1=34.83333333333334 +lat_2=32.5 +lat_0=31.83333333333333 +lon_0=-81 +x_0=609600 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / South Carolina (ft)
-<epsg3361> +proj=lcc +lat_1=34.83333333333334 +lat_2=32.5 +lat_0=31.83333333333333 +lon_0=-81 +x_0=609600 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=ft +no_defs  <>
-# NAD83(HARN) / Pennsylvania North
-<epsg3362> +proj=lcc +lat_1=41.95 +lat_2=40.88333333333333 +lat_0=40.16666666666666 +lon_0=-77.75 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / Pennsylvania North (ftUS)
-<epsg3363> +proj=lcc +lat_1=41.95 +lat_2=40.88333333333333 +lat_0=40.16666666666666 +lon_0=-77.75 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(HARN) / Pennsylvania South
-<epsg3364> +proj=lcc +lat_1=40.96666666666667 +lat_2=39.93333333333333 +lat_0=39.33333333333334 +lon_0=-77.75 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / Pennsylvania South (ftUS)
-<epsg3365> +proj=lcc +lat_1=40.96666666666667 +lat_2=39.93333333333333 +lat_0=39.33333333333334 +lon_0=-77.75 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# Hong Kong 1963 Grid System (deprecated)
-<epsg3366> +proj=cass +lat_0=22.31213333333334 +lon_0=114.1785555555556 +x_0=40243.57775604237 +y_0=19069.93351512578 +a=6378293.645208759 +b=6356617.987679838 +units=m +no_defs  <>
-# IGN Astro 1960 / UTM zone 28N
-<epsg3367> +proj=utm +zone=28 +ellps=clrk80 +units=m +no_defs  <>
-# IGN Astro 1960 / UTM zone 29N
-<epsg3368> +proj=utm +zone=29 +ellps=clrk80 +units=m +no_defs  <>
-# IGN Astro 1960 / UTM zone 30N
-<epsg3369> +proj=utm +zone=30 +ellps=clrk80 +units=m +no_defs  <>
-# NAD27 / UTM zone 59N
-<epsg3370> +proj=utm +zone=59 +datum=NAD27 +units=m +no_defs  <>
-# NAD27 / UTM zone 60N
-<epsg3371> +proj=utm +zone=60 +datum=NAD27 +units=m +no_defs  <>
-# NAD83 / UTM zone 59N
-<epsg3372> +proj=utm +zone=59 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / UTM zone 60N
-<epsg3373> +proj=utm +zone=60 +datum=NAD83 +units=m +no_defs  <>
-# FD54 / UTM zone 29N
-<epsg3374> +proj=utm +zone=29 +ellps=intl +units=m +no_defs  <>
-# GDM2000 / Peninsula RSO
-<epsg3375> +proj=omerc +lat_0=4 +lonc=102.25 +alpha=323.0257964666666 +k=0.99984 +x_0=804671 +y_0=0 +no_uoff +gamma=323.1301023611111 +ellps=GRS80 +units=m +no_defs  <>
-# GDM2000 / East Malaysia BRSO
-<epsg3376> +proj=omerc +lat_0=4 +lonc=115 +alpha=53.31580995 +k=0.99984 +x_0=0 +y_0=0 +no_uoff +gamma=53.13010236111111 +ellps=GRS80 +units=m +no_defs  <>
-# GDM2000 / Johor Grid
-<epsg3377> +proj=cass +lat_0=2.121679744444445 +lon_0=103.4279362361111 +x_0=-14810.562 +y_0=8758.32 +ellps=GRS80 +units=m +no_defs  <>
-# GDM2000 / Sembilan and Melaka Grid
-<epsg3378> +proj=cass +lat_0=2.682347636111111 +lon_0=101.9749050416667 +x_0=3673.785 +y_0=-4240.573 +ellps=GRS80 +units=m +no_defs  <>
-# GDM2000 / PahangGrid
-<epsg3379> +proj=cass +lat_0=3.769388088888889 +lon_0=102.3682989833333 +x_0=-7368.228 +y_0=6485.858 +ellps=GRS80 +units=m +no_defs  <>
-# GDM2000 / Selangor Grid
-<epsg3380> +proj=cass +lat_0=3.68464905 +lon_0=101.3891079138889 +x_0=-34836.161 +y_0=56464.049 +ellps=GRS80 +units=m +no_defs  <>
-# GDM2000 / Terengganu Grid
-<epsg3381> +proj=cass +lat_0=4.9762852 +lon_0=103.070275625 +x_0=19594.245 +y_0=3371.895 +ellps=GRS80 +units=m +no_defs  <>
-# GDM2000 / Pinang Grid
-<epsg3382> +proj=cass +lat_0=5.421517541666667 +lon_0=100.3443769638889 +x_0=-23.414 +y_0=62.283 +ellps=GRS80 +units=m +no_defs  <>
-# GDM2000 / Kedah and Perlis Grid
-<epsg3383> +proj=cass +lat_0=5.964672713888889 +lon_0=100.6363711111111 +x_0=0 +y_0=0 +ellps=GRS80 +units=m +no_defs  <>
-# GDM2000 / Perak Grid
-<epsg3384> +proj=cass +lat_0=4.859063022222222 +lon_0=100.8154105861111 +x_0=-1.769 +y_0=133454.779 +ellps=GRS80 +units=m +no_defs  <>
-# GDM2000 / Kelantan Grid
-<epsg3385> +proj=cass +lat_0=5.972543658333334 +lon_0=102.2952416694444 +x_0=13227.851 +y_0=8739.894 +ellps=GRS80 +units=m +no_defs  <>
-# KKJ / Finland zone 0
-<epsg3386> +proj=tmerc +lat_0=0 +lon_0=18 +k=1 +x_0=500000 +y_0=0 +ellps=intl +towgs84=-96.062,-82.428,-121.753,4.801,0.345,-1.376,1.496 +units=m +no_defs  <>
-# KKJ / Finland zone 5
-<epsg3387> +proj=tmerc +lat_0=0 +lon_0=33 +k=1 +x_0=5500000 +y_0=0 +ellps=intl +towgs84=-96.062,-82.428,-121.753,4.801,0.345,-1.376,1.496 +units=m +no_defs  <>
-# Pulkovo 1942 / Caspian Sea Mercator
-<epsg3388> +proj=merc +lon_0=51 +lat_ts=42 +x_0=0 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger zone 60
-<epsg3389> +proj=tmerc +lat_0=0 +lon_0=180 +k=1 +x_0=60500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger zone 60
-<epsg3390> +proj=tmerc +lat_0=0 +lon_0=180 +k=1 +x_0=60500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Karbala 1979 / UTM zone 37N
-<epsg3391> +proj=utm +zone=37 +ellps=clrk80 +towgs84=70.995,-335.916,262.898,0,0,0,0 +units=m +no_defs  <>
-# Karbala 1979 / UTM zone 38N
-<epsg3392> +proj=utm +zone=38 +ellps=clrk80 +towgs84=70.995,-335.916,262.898,0,0,0,0 +units=m +no_defs  <>
-# Karbala 1979 / UTM zone 39N
-<epsg3393> +proj=utm +zone=39 +ellps=clrk80 +towgs84=70.995,-335.916,262.898,0,0,0,0 +units=m +no_defs  <>
-# Nahrwan 1934 / Iraq zone
-<epsg3394> +proj=lcc +lat_1=32.5 +lat_0=32.5 +lon_0=45 +k_0=0.9987864078000001 +x_0=1500000 +y_0=1166200 +ellps=clrk80 +units=m +no_defs  <>
-# WGS 84 / World Mercator
-<epsg3395> +proj=merc +lon_0=0 +k=1 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs  <>
-# PD/83 / 3-degree Gauss-Kruger zone 3
-<epsg3396> +proj=tmerc +lat_0=0 +lon_0=9 +k=1 +x_0=3500000 +y_0=0 +ellps=bessel +units=m +no_defs  <>
-# PD/83 / 3-degree Gauss-Kruger zone 4
-<epsg3397> +proj=tmerc +lat_0=0 +lon_0=12 +k=1 +x_0=4500000 +y_0=0 +ellps=bessel +units=m +no_defs  <>
-# RD/83 / 3-degree Gauss-Kruger zone 4
-<epsg3398> +proj=tmerc +lat_0=0 +lon_0=12 +k=1 +x_0=4500000 +y_0=0 +ellps=bessel +units=m +no_defs  <>
-# RD/83 / 3-degree Gauss-Kruger zone 5
-<epsg3399> +proj=tmerc +lat_0=0 +lon_0=15 +k=1 +x_0=5500000 +y_0=0 +ellps=bessel +units=m +no_defs  <>
-# NAD83 / Alberta 10-TM (Forest)
-<epsg3400> +proj=tmerc +lat_0=0 +lon_0=-115 +k=0.9992 +x_0=500000 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / Alberta 10-TM (Resource)
-<epsg3401> +proj=tmerc +lat_0=0 +lon_0=-115 +k=0.9992 +x_0=0 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83(CSRS) / Alberta 10-TM (Forest)
-<epsg3402> +proj=tmerc +lat_0=0 +lon_0=-115 +k=0.9992 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(CSRS) / Alberta 10-TM (Resource)
-<epsg3403> +proj=tmerc +lat_0=0 +lon_0=-115 +k=0.9992 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / North Carolina (ftUS)
-<epsg3404> +proj=lcc +lat_1=36.16666666666666 +lat_2=34.33333333333334 +lat_0=33.75 +lon_0=-79 +x_0=609601.2192024384 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# VN-2000 / UTM zone 48N
-<epsg3405> +proj=utm +zone=48 +ellps=WGS84 +towgs84=-192.873,-39.382,-111.202,-0.00205,-0.0005,0.00335,0.0188 +units=m +no_defs  <>
-# VN-2000 / UTM zone 49N
-<epsg3406> +proj=utm +zone=49 +ellps=WGS84 +towgs84=-192.873,-39.382,-111.202,-0.00205,-0.0005,0.00335,0.0188 +units=m +no_defs  <>
-# Hong Kong 1963 Grid System
-<epsg3407> +proj=cass +lat_0=22.31213333333334 +lon_0=114.1785555555556 +x_0=40243.57775604237 +y_0=19069.93351512578 +a=6378293.645208759 +b=6356617.987679838 +to_meter=0.3047972654 +no_defs  <>
-# NSIDC EASE-Grid North
-<epsg3408> +proj=laea +lat_0=90 +lon_0=0 +x_0=0 +y_0=0 +a=6371228 +b=6371228 +units=m +no_defs  <>
-# NSIDC EASE-Grid South
-<epsg3409> +proj=laea +lat_0=-90 +lon_0=0 +x_0=0 +y_0=0 +a=6371228 +b=6371228 +units=m +no_defs  <>
-# NSIDC EASE-Grid Global
-<epsg3410> +proj=cea +lon_0=0 +lat_ts=30 +x_0=0 +y_0=0 +a=6371228 +b=6371228 +units=m +no_defs  <>
-# NSIDC Sea Ice Polar Stereographic North
-<epsg3411> +proj=stere +lat_0=90 +lat_ts=70 +lon_0=-45 +k=1 +x_0=0 +y_0=0 +a=6378273 +b=6356889.449 +units=m +no_defs  <>
-# NSIDC Sea Ice Polar Stereographic South
-<epsg3412> +proj=stere +lat_0=-90 +lat_ts=-70 +lon_0=0 +k=1 +x_0=0 +y_0=0 +a=6378273 +b=6356889.449 +units=m +no_defs  <>
-# WGS 84 / NSIDC Sea Ice Polar Stereographic North
-<epsg3413> +proj=stere +lat_0=90 +lat_ts=70 +lon_0=-45 +k=1 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs  <>
-# SVY21 / Singapore TM
-<epsg3414> +proj=tmerc +lat_0=1.366666666666667 +lon_0=103.8333333333333 +k=1 +x_0=28001.642 +y_0=38744.572 +ellps=WGS84 +units=m +no_defs  <>
-# WGS 72BE / South China Sea Lambert
-<epsg3415> +proj=lcc +lat_1=18 +lat_2=24 +lat_0=21 +lon_0=114 +x_0=500000 +y_0=500000 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# ETRS89 / Austria Lambert
-<epsg3416> +proj=lcc +lat_1=49 +lat_2=46 +lat_0=47.5 +lon_0=13.33333333333333 +x_0=400000 +y_0=400000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83 / Iowa North (ft US)
-<epsg3417> +proj=lcc +lat_1=43.26666666666667 +lat_2=42.06666666666667 +lat_0=41.5 +lon_0=-93.5 +x_0=1500000 +y_0=999999.9999898402 +datum=NAD83 +units=us-ft +no_defs  <>
-# NAD83 / Iowa South (ft US)
-<epsg3418> +proj=lcc +lat_1=41.78333333333333 +lat_2=40.61666666666667 +lat_0=40 +lon_0=-93.5 +x_0=500000.00001016 +y_0=0 +datum=NAD83 +units=us-ft +no_defs  <>
-# NAD83 / Kansas North (ft US)
-<epsg3419> +proj=lcc +lat_1=39.78333333333333 +lat_2=38.71666666666667 +lat_0=38.33333333333334 +lon_0=-98 +x_0=399999.99998984 +y_0=0 +datum=NAD83 +units=us-ft +no_defs  <>
-# NAD83 / Kansas South (ft US)
-<epsg3420> +proj=lcc +lat_1=38.56666666666667 +lat_2=37.26666666666667 +lat_0=36.66666666666666 +lon_0=-98.5 +x_0=399999.99998984 +y_0=399999.99998984 +datum=NAD83 +units=us-ft +no_defs  <>
-# NAD83 / Nevada East (ft US)
-<epsg3421> +proj=tmerc +lat_0=34.75 +lon_0=-115.5833333333333 +k=0.9999 +x_0=200000.00001016 +y_0=8000000.000010163 +datum=NAD83 +units=us-ft +no_defs  <>
-# NAD83 / Nevada Central (ft US)
-<epsg3422> +proj=tmerc +lat_0=34.75 +lon_0=-116.6666666666667 +k=0.9999 +x_0=500000.00001016 +y_0=6000000 +datum=NAD83 +units=us-ft +no_defs  <>
-# NAD83 / Nevada West (ft US)
-<epsg3423> +proj=tmerc +lat_0=34.75 +lon_0=-118.5833333333333 +k=0.9999 +x_0=800000.0000101599 +y_0=3999999.99998984 +datum=NAD83 +units=us-ft +no_defs  <>
-# NAD83 / New Jersey (ft US)
-<epsg3424> +proj=tmerc +lat_0=38.83333333333334 +lon_0=-74.5 +k=0.9999 +x_0=150000 +y_0=0 +datum=NAD83 +units=us-ft +no_defs  <>
-# NAD83(HARN) / Iowa North (ft US)
-<epsg3425> +proj=lcc +lat_1=43.26666666666667 +lat_2=42.06666666666667 +lat_0=41.5 +lon_0=-93.5 +x_0=1500000 +y_0=999999.9999898402 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(HARN) / Iowa South (ft US)
-<epsg3426> +proj=lcc +lat_1=41.78333333333333 +lat_2=40.61666666666667 +lat_0=40 +lon_0=-93.5 +x_0=500000.00001016 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(HARN) / Kansas North (ft US)
-<epsg3427> +proj=lcc +lat_1=39.78333333333333 +lat_2=38.71666666666667 +lat_0=38.33333333333334 +lon_0=-98 +x_0=399999.99998984 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(HARN) / Kansas South (ft US)
-<epsg3428> +proj=lcc +lat_1=38.56666666666667 +lat_2=37.26666666666667 +lat_0=36.66666666666666 +lon_0=-98.5 +x_0=399999.99998984 +y_0=399999.99998984 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(HARN) / Nevada East (ft US)
-<epsg3429> +proj=tmerc +lat_0=34.75 +lon_0=-115.5833333333333 +k=0.9999 +x_0=200000.00001016 +y_0=8000000.000010163 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(HARN) / Nevada Central (ft US)
-<epsg3430> +proj=tmerc +lat_0=34.75 +lon_0=-116.6666666666667 +k=0.9999 +x_0=500000.00001016 +y_0=6000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(HARN) / Nevada West (ft US)
-<epsg3431> +proj=tmerc +lat_0=34.75 +lon_0=-118.5833333333333 +k=0.9999 +x_0=800000.0000101599 +y_0=3999999.99998984 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(HARN) / New Jersey (ft US)
-<epsg3432> +proj=tmerc +lat_0=38.83333333333334 +lon_0=-74.5 +k=0.9999 +x_0=150000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83 / Arkansas North (ftUS)
-<epsg3433> +proj=lcc +lat_1=36.23333333333333 +lat_2=34.93333333333333 +lat_0=34.33333333333334 +lon_0=-92 +x_0=399999.99998984 +y_0=0 +datum=NAD83 +units=us-ft +no_defs  <>
-# NAD83 / Arkansas South (ftUS)
-<epsg3434> +proj=lcc +lat_1=34.76666666666667 +lat_2=33.3 +lat_0=32.66666666666666 +lon_0=-92 +x_0=399999.99998984 +y_0=399999.99998984 +datum=NAD83 +units=us-ft +no_defs  <>
-# NAD83 / Illinois East (ftUS)
-<epsg3435> +proj=tmerc +lat_0=36.66666666666666 +lon_0=-88.33333333333333 +k=0.9999749999999999 +x_0=300000.0000000001 +y_0=0 +datum=NAD83 +units=us-ft +no_defs  <>
-# NAD83 / Illinois West (ftUS)
-<epsg3436> +proj=tmerc +lat_0=36.66666666666666 +lon_0=-90.16666666666667 +k=0.999941177 +x_0=699999.9999898402 +y_0=0 +datum=NAD83 +units=us-ft +no_defs  <>
-# NAD83 / New Hampshire (ftUS)
-<epsg3437> +proj=tmerc +lat_0=42.5 +lon_0=-71.66666666666667 +k=0.999966667 +x_0=300000.0000000001 +y_0=0 +datum=NAD83 +units=us-ft +no_defs  <>
-# NAD83 / Rhode Island (ftUS)
-<epsg3438> +proj=tmerc +lat_0=41.08333333333334 +lon_0=-71.5 +k=0.99999375 +x_0=99999.99998983997 +y_0=0 +datum=NAD83 +units=us-ft +no_defs  <>
-# PSD93 / UTM zone 39N
-<epsg3439> +proj=utm +zone=39 +ellps=clrk80 +towgs84=-180.624,-225.516,173.919,-0.81,-1.898,8.336,16.7101 +units=m +no_defs  <>
-# PSD93 / UTM zone 40N
-<epsg3440> +proj=utm +zone=40 +ellps=clrk80 +towgs84=-180.624,-225.516,173.919,-0.81,-1.898,8.336,16.7101 +units=m +no_defs  <>
-# NAD83(HARN) / Arkansas North (ftUS)
-<epsg3441> +proj=lcc +lat_1=36.23333333333333 +lat_2=34.93333333333333 +lat_0=34.33333333333334 +lon_0=-92 +x_0=399999.99998984 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(HARN) / Arkansas South (ftUS)
-<epsg3442> +proj=lcc +lat_1=34.76666666666667 +lat_2=33.3 +lat_0=32.66666666666666 +lon_0=-92 +x_0=399999.99998984 +y_0=399999.99998984 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(HARN) / Illinois East (ftUS)
-<epsg3443> +proj=tmerc +lat_0=36.66666666666666 +lon_0=-88.33333333333333 +k=0.9999749999999999 +x_0=300000.0000000001 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(HARN) / Illinois West (ftUS)
-<epsg3444> +proj=tmerc +lat_0=36.66666666666666 +lon_0=-90.16666666666667 +k=0.999941177 +x_0=699999.9999898402 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(HARN) / New Hampshire (ftUS)
-<epsg3445> +proj=tmerc +lat_0=42.5 +lon_0=-71.66666666666667 +k=0.999966667 +x_0=300000.0000000001 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(HARN) / Rhode Island (ftUS)
-<epsg3446> +proj=tmerc +lat_0=41.08333333333334 +lon_0=-71.5 +k=0.99999375 +x_0=99999.99998983997 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# ETRS89 / Belgian Lambert 2005
-<epsg3447> +proj=lcc +lat_1=49.83333333333334 +lat_2=51.16666666666666 +lat_0=50.797815 +lon_0=4.359215833333333 +x_0=150328 +y_0=166262 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# JAD2001 / Jamaica Metric Grid
-<epsg3448> +proj=lcc +lat_1=18 +lat_0=18 +lon_0=-77 +k_0=1 +x_0=750000 +y_0=650000 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# JAD2001 / UTM zone 17N
-<epsg3449> +proj=utm +zone=17 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# JAD2001 / UTM zone 18N
-<epsg3450> +proj=utm +zone=18 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83 / Louisiana North (ftUS)
-<epsg3451> +proj=lcc +lat_1=32.66666666666666 +lat_2=31.16666666666667 +lat_0=30.5 +lon_0=-92.5 +x_0=999999.9999898402 +y_0=0 +datum=NAD83 +units=us-ft +no_defs  <>
-# NAD83 / Louisiana South (ftUS)
-<epsg3452> +proj=lcc +lat_1=30.7 +lat_2=29.3 +lat_0=28.5 +lon_0=-91.33333333333333 +x_0=999999.9999898402 +y_0=0 +datum=NAD83 +units=us-ft +no_defs  <>
-# NAD83 / Louisiana Offshore (ftUS)
-<epsg3453> +proj=lcc +lat_1=27.83333333333333 +lat_2=26.16666666666667 +lat_0=25.5 +lon_0=-91.33333333333333 +x_0=999999.9999898402 +y_0=0 +datum=NAD83 +units=us-ft +no_defs  <>
-# NAD83 / South Dakota North (ftUS) (deprecated)
-<epsg3454> +proj=lcc +lat_1=44.4 +lat_2=42.83333333333334 +lat_0=42.33333333333334 +lon_0=-100.3333333333333 +x_0=600000 +y_0=0 +datum=NAD83 +units=us-ft +no_defs  <>
-# NAD83 / South Dakota South (ftUS)
-<epsg3455> +proj=lcc +lat_1=44.4 +lat_2=42.83333333333334 +lat_0=42.33333333333334 +lon_0=-100.3333333333333 +x_0=600000 +y_0=0 +datum=NAD83 +units=us-ft +no_defs  <>
-# NAD83(HARN) / Louisiana North (ftUS)
-<epsg3456> +proj=lcc +lat_1=32.66666666666666 +lat_2=31.16666666666667 +lat_0=30.5 +lon_0=-92.5 +x_0=999999.9999898402 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(HARN) / Louisiana South (ftUS)
-<epsg3457> +proj=lcc +lat_1=30.7 +lat_2=29.3 +lat_0=28.5 +lon_0=-91.33333333333333 +x_0=999999.9999898402 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(HARN) / South Dakota North (ftUS)
-<epsg3458> +proj=lcc +lat_1=45.68333333333333 +lat_2=44.41666666666666 +lat_0=43.83333333333334 +lon_0=-100 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(HARN) / South Dakota South (ftUS)
-<epsg3459> +proj=lcc +lat_1=44.4 +lat_2=42.83333333333334 +lat_0=42.33333333333334 +lon_0=-100.3333333333333 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# Fiji 1986 / Fiji Map Grid
-<epsg3460> +proj=tmerc +lat_0=-17 +lon_0=178.75 +k=0.99985 +x_0=2000000 +y_0=4000000 +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# Dabola 1981 / UTM zone 28N
-<epsg3461> +proj=utm +zone=28 +a=6378249.2 +b=6356515 +towgs84=-83,37,124,0,0,0,0 +units=m +no_defs  <>
-# Dabola 1981 / UTM zone 29N
-<epsg3462> +proj=utm +zone=29 +a=6378249.2 +b=6356515 +towgs84=-83,37,124,0,0,0,0 +units=m +no_defs  <>
-# NAD83 / Maine CS2000 Central
-<epsg3463> +proj=tmerc +lat_0=43.5 +lon_0=-69.125 +k=0.99998 +x_0=500000 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83(HARN) / Maine CS2000 Central
-<epsg3464> +proj=tmerc +lat_0=43.5 +lon_0=-69.125 +k=0.99998 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / Alabama East
-<epsg3465> +proj=tmerc +lat_0=30.5 +lon_0=-85.83333333333333 +k=0.99996 +x_0=200000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / Alabama West
-<epsg3466> +proj=tmerc +lat_0=30 +lon_0=-87.5 +k=0.999933333 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / Alaska Albers
-<epsg3467> +proj=aea +lat_1=55 +lat_2=65 +lat_0=50 +lon_0=-154 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / Alaska zone 1
-<epsg3468> +proj=omerc +lat_0=57 +lonc=-133.6666666666667 +alpha=323.1301023611111 +k=0.9999 +x_0=5000000 +y_0=-5000000 +no_uoff +gamma=323.1301023611111 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / Alaska zone 2
-<epsg3469> +proj=tmerc +lat_0=54 +lon_0=-142 +k=0.9999 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / Alaska zone 3
-<epsg3470> +proj=tmerc +lat_0=54 +lon_0=-146 +k=0.9999 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / Alaska zone 4
-<epsg3471> +proj=tmerc +lat_0=54 +lon_0=-150 +k=0.9999 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / Alaska zone 5
-<epsg3472> +proj=tmerc +lat_0=54 +lon_0=-154 +k=0.9999 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / Alaska zone 6
-<epsg3473> +proj=tmerc +lat_0=54 +lon_0=-158 +k=0.9999 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / Alaska zone 7
-<epsg3474> +proj=tmerc +lat_0=54 +lon_0=-162 +k=0.9999 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / Alaska zone 8
-<epsg3475> +proj=tmerc +lat_0=54 +lon_0=-166 +k=0.9999 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / Alaska zone 9
-<epsg3476> +proj=tmerc +lat_0=54 +lon_0=-170 +k=0.9999 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / Alaska zone 10
-<epsg3477> +proj=lcc +lat_1=53.83333333333334 +lat_2=51.83333333333334 +lat_0=51 +lon_0=-176 +x_0=1000000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / Arizona Central
-<epsg3478> +proj=tmerc +lat_0=31 +lon_0=-111.9166666666667 +k=0.9999 +x_0=213360 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / Arizona Central (ft)
-<epsg3479> +proj=tmerc +lat_0=31 +lon_0=-111.9166666666667 +k=0.9999 +x_0=213360 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=ft +no_defs  <>
-# NAD83(NSRS2007) / Arizona East
-<epsg3480> +proj=tmerc +lat_0=31 +lon_0=-110.1666666666667 +k=0.9999 +x_0=213360 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / Arizona East (ft)
-<epsg3481> +proj=tmerc +lat_0=31 +lon_0=-110.1666666666667 +k=0.9999 +x_0=213360 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=ft +no_defs  <>
-# NAD83(NSRS2007) / Arizona West
-<epsg3482> +proj=tmerc +lat_0=31 +lon_0=-113.75 +k=0.999933333 +x_0=213360 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / Arizona West (ft)
-<epsg3483> +proj=tmerc +lat_0=31 +lon_0=-113.75 +k=0.999933333 +x_0=213360 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=ft +no_defs  <>
-# NAD83(NSRS2007) / Arkansas North
-<epsg3484> +proj=lcc +lat_1=36.23333333333333 +lat_2=34.93333333333333 +lat_0=34.33333333333334 +lon_0=-92 +x_0=400000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / Arkansas North (ftUS)
-<epsg3485> +proj=lcc +lat_1=36.23333333333333 +lat_2=34.93333333333333 +lat_0=34.33333333333334 +lon_0=-92 +x_0=399999.99998984 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(NSRS2007) / Arkansas South
-<epsg3486> +proj=lcc +lat_1=34.76666666666667 +lat_2=33.3 +lat_0=32.66666666666666 +lon_0=-92 +x_0=400000 +y_0=400000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / Arkansas South (ftUS)
-<epsg3487> +proj=lcc +lat_1=34.76666666666667 +lat_2=33.3 +lat_0=32.66666666666666 +lon_0=-92 +x_0=399999.99998984 +y_0=399999.99998984 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(NSRS2007) / California Albers
-<epsg3488> +proj=aea +lat_1=34 +lat_2=40.5 +lat_0=0 +lon_0=-120 +x_0=0 +y_0=-4000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / California zone 1
-<epsg3489> +proj=lcc +lat_1=41.66666666666666 +lat_2=40 +lat_0=39.33333333333334 +lon_0=-122 +x_0=2000000 +y_0=500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / California zone 1 (ftUS)
-<epsg3490> +proj=lcc +lat_1=41.66666666666666 +lat_2=40 +lat_0=39.33333333333334 +lon_0=-122 +x_0=2000000.0001016 +y_0=500000.0001016001 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(NSRS2007) / California zone 2
-<epsg3491> +proj=lcc +lat_1=39.83333333333334 +lat_2=38.33333333333334 +lat_0=37.66666666666666 +lon_0=-122 +x_0=2000000 +y_0=500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / California zone 2 (ftUS)
-<epsg3492> +proj=lcc +lat_1=39.83333333333334 +lat_2=38.33333333333334 +lat_0=37.66666666666666 +lon_0=-122 +x_0=2000000.0001016 +y_0=500000.0001016001 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(NSRS2007) / California zone 3
-<epsg3493> +proj=lcc +lat_1=38.43333333333333 +lat_2=37.06666666666667 +lat_0=36.5 +lon_0=-120.5 +x_0=2000000 +y_0=500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / California zone 3 (ftUS)
-<epsg3494> +proj=lcc +lat_1=38.43333333333333 +lat_2=37.06666666666667 +lat_0=36.5 +lon_0=-120.5 +x_0=2000000.0001016 +y_0=500000.0001016001 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(NSRS2007) / California zone 4
-<epsg3495> +proj=lcc +lat_1=37.25 +lat_2=36 +lat_0=35.33333333333334 +lon_0=-119 +x_0=2000000 +y_0=500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / California zone 4 (ftUS)
-<epsg3496> +proj=lcc +lat_1=37.25 +lat_2=36 +lat_0=35.33333333333334 +lon_0=-119 +x_0=2000000.0001016 +y_0=500000.0001016001 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(NSRS2007) / California zone 5
-<epsg3497> +proj=lcc +lat_1=35.46666666666667 +lat_2=34.03333333333333 +lat_0=33.5 +lon_0=-118 +x_0=2000000 +y_0=500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / California zone 5 (ftUS)
-<epsg3498> +proj=lcc +lat_1=35.46666666666667 +lat_2=34.03333333333333 +lat_0=33.5 +lon_0=-118 +x_0=2000000.0001016 +y_0=500000.0001016001 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(NSRS2007) / California zone 6
-<epsg3499> +proj=lcc +lat_1=33.88333333333333 +lat_2=32.78333333333333 +lat_0=32.16666666666666 +lon_0=-116.25 +x_0=2000000 +y_0=500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / California zone 6 (ftUS)
-<epsg3500> +proj=lcc +lat_1=33.88333333333333 +lat_2=32.78333333333333 +lat_0=32.16666666666666 +lon_0=-116.25 +x_0=2000000.0001016 +y_0=500000.0001016001 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(NSRS2007) / Colorado Central
-<epsg3501> +proj=lcc +lat_1=39.75 +lat_2=38.45 +lat_0=37.83333333333334 +lon_0=-105.5 +x_0=914401.8289 +y_0=304800.6096 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / Colorado Central (ftUS)
-<epsg3502> +proj=lcc +lat_1=39.75 +lat_2=38.45 +lat_0=37.83333333333334 +lon_0=-105.5 +x_0=914401.8288036576 +y_0=304800.6096012192 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(NSRS2007) / Colorado North
-<epsg3503> +proj=lcc +lat_1=40.78333333333333 +lat_2=39.71666666666667 +lat_0=39.33333333333334 +lon_0=-105.5 +x_0=914401.8289 +y_0=304800.6096 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / Colorado North (ftUS)
-<epsg3504> +proj=lcc +lat_1=40.78333333333333 +lat_2=39.71666666666667 +lat_0=39.33333333333334 +lon_0=-105.5 +x_0=914401.8288036576 +y_0=304800.6096012192 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(NSRS2007) / Colorado South
-<epsg3505> +proj=lcc +lat_1=38.43333333333333 +lat_2=37.23333333333333 +lat_0=36.66666666666666 +lon_0=-105.5 +x_0=914401.8289 +y_0=304800.6096 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / Colorado South (ftUS)
-<epsg3506> +proj=lcc +lat_1=38.43333333333333 +lat_2=37.23333333333333 +lat_0=36.66666666666666 +lon_0=-105.5 +x_0=914401.8288036576 +y_0=304800.6096012192 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(NSRS2007) / Connecticut
-<epsg3507> +proj=lcc +lat_1=41.86666666666667 +lat_2=41.2 +lat_0=40.83333333333334 +lon_0=-72.75 +x_0=304800.6096 +y_0=152400.3048 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / Connecticut (ftUS)
-<epsg3508> +proj=lcc +lat_1=41.86666666666667 +lat_2=41.2 +lat_0=40.83333333333334 +lon_0=-72.75 +x_0=304800.6096012192 +y_0=152400.3048006096 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(NSRS2007) / Delaware
-<epsg3509> +proj=tmerc +lat_0=38 +lon_0=-75.41666666666667 +k=0.999995 +x_0=200000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / Delaware (ftUS)
-<epsg3510> +proj=tmerc +lat_0=38 +lon_0=-75.41666666666667 +k=0.999995 +x_0=200000.0001016002 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(NSRS2007) / Florida East
-<epsg3511> +proj=tmerc +lat_0=24.33333333333333 +lon_0=-81 +k=0.999941177 +x_0=200000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / Florida East (ftUS)
-<epsg3512> +proj=tmerc +lat_0=24.33333333333333 +lon_0=-81 +k=0.999941177 +x_0=200000.0001016002 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(NSRS2007) / Florida GDL Albers
-<epsg3513> +proj=aea +lat_1=24 +lat_2=31.5 +lat_0=24 +lon_0=-84 +x_0=400000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / Florida North
-<epsg3514> +proj=lcc +lat_1=30.75 +lat_2=29.58333333333333 +lat_0=29 +lon_0=-84.5 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / Florida North (ftUS)
-<epsg3515> +proj=lcc +lat_1=30.75 +lat_2=29.58333333333333 +lat_0=29 +lon_0=-84.5 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(NSRS2007) / Florida West
-<epsg3516> +proj=tmerc +lat_0=24.33333333333333 +lon_0=-82 +k=0.999941177 +x_0=200000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / Florida West (ftUS)
-<epsg3517> +proj=tmerc +lat_0=24.33333333333333 +lon_0=-82 +k=0.999941177 +x_0=200000.0001016002 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(NSRS2007) / Georgia East
-<epsg3518> +proj=tmerc +lat_0=30 +lon_0=-82.16666666666667 +k=0.9999 +x_0=200000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / Georgia East (ftUS)
-<epsg3519> +proj=tmerc +lat_0=30 +lon_0=-82.16666666666667 +k=0.9999 +x_0=200000.0001016002 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(NSRS2007) / Georgia West
-<epsg3520> +proj=tmerc +lat_0=30 +lon_0=-84.16666666666667 +k=0.9999 +x_0=700000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / Georgia West (ftUS)
-<epsg3521> +proj=tmerc +lat_0=30 +lon_0=-84.16666666666667 +k=0.9999 +x_0=699999.9998983998 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(NSRS2007) / Idaho Central
-<epsg3522> +proj=tmerc +lat_0=41.66666666666666 +lon_0=-114 +k=0.9999473679999999 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / Idaho Central (ftUS)
-<epsg3523> +proj=tmerc +lat_0=41.66666666666666 +lon_0=-114 +k=0.9999473679999999 +x_0=500000.0001016001 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(NSRS2007) / Idaho East
-<epsg3524> +proj=tmerc +lat_0=41.66666666666666 +lon_0=-112.1666666666667 +k=0.9999473679999999 +x_0=200000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / Idaho East (ftUS)
-<epsg3525> +proj=tmerc +lat_0=41.66666666666666 +lon_0=-112.1666666666667 +k=0.9999473679999999 +x_0=200000.0001016002 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(NSRS2007) / Idaho West
-<epsg3526> +proj=tmerc +lat_0=41.66666666666666 +lon_0=-115.75 +k=0.999933333 +x_0=800000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / Idaho West (ftUS)
-<epsg3527> +proj=tmerc +lat_0=41.66666666666666 +lon_0=-115.75 +k=0.999933333 +x_0=800000.0001016001 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(NSRS2007) / Illinois East
-<epsg3528> +proj=tmerc +lat_0=36.66666666666666 +lon_0=-88.33333333333333 +k=0.9999749999999999 +x_0=300000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / Illinois East (ftUS)
-<epsg3529> +proj=tmerc +lat_0=36.66666666666666 +lon_0=-88.33333333333333 +k=0.9999749999999999 +x_0=300000.0000000001 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(NSRS2007) / Illinois West
-<epsg3530> +proj=tmerc +lat_0=36.66666666666666 +lon_0=-90.16666666666667 +k=0.999941177 +x_0=700000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / Illinois West (ftUS)
-<epsg3531> +proj=tmerc +lat_0=36.66666666666666 +lon_0=-90.16666666666667 +k=0.999941177 +x_0=699999.9999898402 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(NSRS2007) / Indiana East
-<epsg3532> +proj=tmerc +lat_0=37.5 +lon_0=-85.66666666666667 +k=0.999966667 +x_0=100000 +y_0=250000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / Indiana East (ftUS)
-<epsg3533> +proj=tmerc +lat_0=37.5 +lon_0=-85.66666666666667 +k=0.999966667 +x_0=99999.99989839978 +y_0=249999.9998983998 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(NSRS2007) / Indiana West
-<epsg3534> +proj=tmerc +lat_0=37.5 +lon_0=-87.08333333333333 +k=0.999966667 +x_0=900000 +y_0=250000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / Indiana West (ftUS)
-<epsg3535> +proj=tmerc +lat_0=37.5 +lon_0=-87.08333333333333 +k=0.999966667 +x_0=900000 +y_0=249999.9998983998 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(NSRS2007) / Iowa North
-<epsg3536> +proj=lcc +lat_1=43.26666666666667 +lat_2=42.06666666666667 +lat_0=41.5 +lon_0=-93.5 +x_0=1500000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / Iowa North (ft US)
-<epsg3537> +proj=lcc +lat_1=43.26666666666667 +lat_2=42.06666666666667 +lat_0=41.5 +lon_0=-93.5 +x_0=1500000 +y_0=999999.9999898402 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(NSRS2007) / Iowa South
-<epsg3538> +proj=lcc +lat_1=41.78333333333333 +lat_2=40.61666666666667 +lat_0=40 +lon_0=-93.5 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / Iowa South (ft US)
-<epsg3539> +proj=lcc +lat_1=41.78333333333333 +lat_2=40.61666666666667 +lat_0=40 +lon_0=-93.5 +x_0=500000.00001016 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(NSRS2007) / Kansas North
-<epsg3540> +proj=lcc +lat_1=39.78333333333333 +lat_2=38.71666666666667 +lat_0=38.33333333333334 +lon_0=-98 +x_0=400000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / Kansas North (ft US)
-<epsg3541> +proj=lcc +lat_1=39.78333333333333 +lat_2=38.71666666666667 +lat_0=38.33333333333334 +lon_0=-98 +x_0=399999.99998984 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(NSRS2007) / Kansas South
-<epsg3542> +proj=lcc +lat_1=38.56666666666667 +lat_2=37.26666666666667 +lat_0=36.66666666666666 +lon_0=-98.5 +x_0=400000 +y_0=400000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / Kansas South (ft US)
-<epsg3543> +proj=lcc +lat_1=38.56666666666667 +lat_2=37.26666666666667 +lat_0=36.66666666666666 +lon_0=-98.5 +x_0=399999.99998984 +y_0=399999.99998984 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(NSRS2007) / Kentucky North
-<epsg3544> +proj=lcc +lat_1=37.96666666666667 +lat_2=38.96666666666667 +lat_0=37.5 +lon_0=-84.25 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / Kentucky North (ftUS)
-<epsg3545> +proj=lcc +lat_1=37.96666666666667 +lat_2=38.96666666666667 +lat_0=37.5 +lon_0=-84.25 +x_0=500000.0001016001 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(NSRS2007) / Kentucky Single Zone
-<epsg3546> +proj=lcc +lat_1=37.08333333333334 +lat_2=38.66666666666666 +lat_0=36.33333333333334 +lon_0=-85.75 +x_0=1500000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / Kentucky Single Zone (ftUS)
-<epsg3547> +proj=lcc +lat_1=37.08333333333334 +lat_2=38.66666666666666 +lat_0=36.33333333333334 +lon_0=-85.75 +x_0=1500000 +y_0=999999.9998983998 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(NSRS2007) / Kentucky South
-<epsg3548> +proj=lcc +lat_1=37.93333333333333 +lat_2=36.73333333333333 +lat_0=36.33333333333334 +lon_0=-85.75 +x_0=500000 +y_0=500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / Kentucky South (ftUS)
-<epsg3549> +proj=lcc +lat_1=37.93333333333333 +lat_2=36.73333333333333 +lat_0=36.33333333333334 +lon_0=-85.75 +x_0=500000.0001016001 +y_0=500000.0001016001 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(NSRS2007) / Louisiana North
-<epsg3550> +proj=lcc +lat_1=32.66666666666666 +lat_2=31.16666666666667 +lat_0=30.5 +lon_0=-92.5 +x_0=1000000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / Louisiana North (ftUS)
-<epsg3551> +proj=lcc +lat_1=32.66666666666666 +lat_2=31.16666666666667 +lat_0=30.5 +lon_0=-92.5 +x_0=999999.9999898402 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(NSRS2007) / Louisiana South
-<epsg3552> +proj=lcc +lat_1=30.7 +lat_2=29.3 +lat_0=28.5 +lon_0=-91.33333333333333 +x_0=1000000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / Louisiana South (ftUS)
-<epsg3553> +proj=lcc +lat_1=30.7 +lat_2=29.3 +lat_0=28.5 +lon_0=-91.33333333333333 +x_0=999999.9999898402 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(NSRS2007) / Maine CS2000 Central
-<epsg3554> +proj=tmerc +lat_0=43.5 +lon_0=-69.125 +k=0.99998 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / Maine CS2000 East
-<epsg3555> +proj=tmerc +lat_0=43.83333333333334 +lon_0=-67.875 +k=0.99998 +x_0=700000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / Maine CS2000 West
-<epsg3556> +proj=tmerc +lat_0=42.83333333333334 +lon_0=-70.375 +k=0.99998 +x_0=300000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / Maine East
-<epsg3557> +proj=tmerc +lat_0=43.66666666666666 +lon_0=-68.5 +k=0.9999 +x_0=300000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / Maine West
-<epsg3558> +proj=tmerc +lat_0=42.83333333333334 +lon_0=-70.16666666666667 +k=0.999966667 +x_0=900000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / Maryland
-<epsg3559> +proj=lcc +lat_1=39.45 +lat_2=38.3 +lat_0=37.66666666666666 +lon_0=-77 +x_0=400000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83 / Utah North (ftUS)
-<epsg3560> +proj=lcc +lat_1=41.78333333333333 +lat_2=40.71666666666667 +lat_0=40.33333333333334 +lon_0=-111.5 +x_0=500000.00001016 +y_0=999999.9999898402 +datum=NAD83 +units=us-ft +no_defs  <>
-# Old Hawaiian / Hawaii zone 1
-<epsg3561> +proj=tmerc +lat_0=18.83333333333333 +lon_0=-155.5 +k=0.999966667 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +towgs84=61,-285,-181,0,0,0,0 +units=us-ft +no_defs  <>
-# Old Hawaiian / Hawaii zone 2
-<epsg3562> +proj=tmerc +lat_0=20.33333333333333 +lon_0=-156.6666666666667 +k=0.999966667 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +towgs84=61,-285,-181,0,0,0,0 +units=us-ft +no_defs  <>
-# Old Hawaiian / Hawaii zone 3
-<epsg3563> +proj=tmerc +lat_0=21.16666666666667 +lon_0=-158 +k=0.99999 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +towgs84=61,-285,-181,0,0,0,0 +units=us-ft +no_defs  <>
-# Old Hawaiian / Hawaii zone 4
-<epsg3564> +proj=tmerc +lat_0=21.83333333333333 +lon_0=-159.5 +k=0.99999 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +towgs84=61,-285,-181,0,0,0,0 +units=us-ft +no_defs  <>
-# Old Hawaiian / Hawaii zone 5
-<epsg3565> +proj=tmerc +lat_0=21.66666666666667 +lon_0=-160.1666666666667 +k=1 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +towgs84=61,-285,-181,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83 / Utah Central (ftUS)
-<epsg3566> +proj=lcc +lat_1=40.65 +lat_2=39.01666666666667 +lat_0=38.33333333333334 +lon_0=-111.5 +x_0=500000.00001016 +y_0=2000000.00001016 +datum=NAD83 +units=us-ft +no_defs  <>
-# NAD83 / Utah South (ftUS)
-<epsg3567> +proj=lcc +lat_1=38.35 +lat_2=37.21666666666667 +lat_0=36.66666666666666 +lon_0=-111.5 +x_0=500000.00001016 +y_0=3000000 +datum=NAD83 +units=us-ft +no_defs  <>
-# NAD83(HARN) / Utah North (ftUS)
-<epsg3568> +proj=lcc +lat_1=41.78333333333333 +lat_2=40.71666666666667 +lat_0=40.33333333333334 +lon_0=-111.5 +x_0=500000.00001016 +y_0=999999.9999898402 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(HARN) / Utah Central (ftUS)
-<epsg3569> +proj=lcc +lat_1=40.65 +lat_2=39.01666666666667 +lat_0=38.33333333333334 +lon_0=-111.5 +x_0=500000.00001016 +y_0=2000000.00001016 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(HARN) / Utah South (ftUS)
-<epsg3570> +proj=lcc +lat_1=38.35 +lat_2=37.21666666666667 +lat_0=36.66666666666666 +lon_0=-111.5 +x_0=500000.00001016 +y_0=3000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# WGS 84 / North Pole LAEA Bering Sea
-<epsg3571> +proj=laea +lat_0=90 +lon_0=180 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / North Pole LAEA Alaska
-<epsg3572> +proj=laea +lat_0=90 +lon_0=-150 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / North Pole LAEA Canada
-<epsg3573> +proj=laea +lat_0=90 +lon_0=-100 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / North Pole LAEA Atlantic
-<epsg3574> +proj=laea +lat_0=90 +lon_0=-40 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / North Pole LAEA Europe
-<epsg3575> +proj=laea +lat_0=90 +lon_0=10 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / North Pole LAEA Russia
-<epsg3576> +proj=laea +lat_0=90 +lon_0=90 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs  <>
-# GDA94 / Australian Albers
-<epsg3577> +proj=aea +lat_1=-18 +lat_2=-36 +lat_0=0 +lon_0=132 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83 / Yukon Albers
-<epsg3578> +proj=aea +lat_1=61.66666666666666 +lat_2=68 +lat_0=59 +lon_0=-132.5 +x_0=500000 +y_0=500000 +datum=NAD83 +units=m +no_defs  <>
-# NAD83(CSRS) / Yukon Albers
-<epsg3579> +proj=aea +lat_1=61.66666666666666 +lat_2=68 +lat_0=59 +lon_0=-132.5 +x_0=500000 +y_0=500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83 / NWT Lambert
-<epsg3580> +proj=lcc +lat_1=62 +lat_2=70 +lat_0=0 +lon_0=-112 +x_0=0 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83(CSRS) / NWT Lambert
-<epsg3581> +proj=lcc +lat_1=62 +lat_2=70 +lat_0=0 +lon_0=-112 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / Maryland (ftUS)
-<epsg3582> +proj=lcc +lat_1=39.45 +lat_2=38.3 +lat_0=37.66666666666666 +lon_0=-77 +x_0=399999.9998983998 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(NSRS2007) / Massachusetts Island
-<epsg3583> +proj=lcc +lat_1=41.48333333333333 +lat_2=41.28333333333333 +lat_0=41 +lon_0=-70.5 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / Massachusetts Island (ftUS)
-<epsg3584> +proj=lcc +lat_1=41.48333333333333 +lat_2=41.28333333333333 +lat_0=41 +lon_0=-70.5 +x_0=500000.0001016001 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(NSRS2007) / Massachusetts Mainland
-<epsg3585> +proj=lcc +lat_1=42.68333333333333 +lat_2=41.71666666666667 +lat_0=41 +lon_0=-71.5 +x_0=200000 +y_0=750000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / Massachusetts Mainland (ftUS)
-<epsg3586> +proj=lcc +lat_1=42.68333333333333 +lat_2=41.71666666666667 +lat_0=41 +lon_0=-71.5 +x_0=200000.0001016002 +y_0=750000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(NSRS2007) / Michigan Central
-<epsg3587> +proj=lcc +lat_1=45.7 +lat_2=44.18333333333333 +lat_0=43.31666666666667 +lon_0=-84.36666666666666 +x_0=6000000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / Michigan Central (ft)
-<epsg3588> +proj=lcc +lat_1=45.7 +lat_2=44.18333333333333 +lat_0=43.31666666666667 +lon_0=-84.36666666666666 +x_0=5999999.999976001 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=ft +no_defs  <>
-# NAD83(NSRS2007) / Michigan North
-<epsg3589> +proj=lcc +lat_1=47.08333333333334 +lat_2=45.48333333333333 +lat_0=44.78333333333333 +lon_0=-87 +x_0=8000000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / Michigan North (ft)
-<epsg3590> +proj=lcc +lat_1=47.08333333333334 +lat_2=45.48333333333333 +lat_0=44.78333333333333 +lon_0=-87 +x_0=7999999.999968001 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=ft +no_defs  <>
-# NAD83(NSRS2007) / Michigan Oblique Mercator
-<epsg3591> +proj=omerc +lat_0=45.30916666666666 +lonc=-86 +alpha=337.25556 +k=0.9996 +x_0=2546731.496 +y_0=-4354009.816 +no_uoff +gamma=337.25556 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / Michigan South
-<epsg3592> +proj=lcc +lat_1=43.66666666666666 +lat_2=42.1 +lat_0=41.5 +lon_0=-84.36666666666666 +x_0=4000000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / Michigan South (ft)
-<epsg3593> +proj=lcc +lat_1=43.66666666666666 +lat_2=42.1 +lat_0=41.5 +lon_0=-84.36666666666666 +x_0=3999999.999984 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=ft +no_defs  <>
-# NAD83(NSRS2007) / Minnesota Central
-<epsg3594> +proj=lcc +lat_1=47.05 +lat_2=45.61666666666667 +lat_0=45 +lon_0=-94.25 +x_0=800000 +y_0=100000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / Minnesota North
-<epsg3595> +proj=lcc +lat_1=48.63333333333333 +lat_2=47.03333333333333 +lat_0=46.5 +lon_0=-93.09999999999999 +x_0=800000 +y_0=100000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / Minnesota South
-<epsg3596> +proj=lcc +lat_1=45.21666666666667 +lat_2=43.78333333333333 +lat_0=43 +lon_0=-94 +x_0=800000 +y_0=100000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / Mississippi East
-<epsg3597> +proj=tmerc +lat_0=29.5 +lon_0=-88.83333333333333 +k=0.99995 +x_0=300000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / Mississippi East (ftUS)
-<epsg3598> +proj=tmerc +lat_0=29.5 +lon_0=-88.83333333333333 +k=0.99995 +x_0=300000.0000000001 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(NSRS2007) / Mississippi West
-<epsg3599> +proj=tmerc +lat_0=29.5 +lon_0=-90.33333333333333 +k=0.99995 +x_0=700000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / Mississippi West (ftUS)
-<epsg3600> +proj=tmerc +lat_0=29.5 +lon_0=-90.33333333333333 +k=0.99995 +x_0=699999.9998983998 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(NSRS2007) / Missouri Central
-<epsg3601> +proj=tmerc +lat_0=35.83333333333334 +lon_0=-92.5 +k=0.999933333 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / Missouri East
-<epsg3602> +proj=tmerc +lat_0=35.83333333333334 +lon_0=-90.5 +k=0.999933333 +x_0=250000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / Missouri West
-<epsg3603> +proj=tmerc +lat_0=36.16666666666666 +lon_0=-94.5 +k=0.999941177 +x_0=850000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / Montana
-<epsg3604> +proj=lcc +lat_1=49 +lat_2=45 +lat_0=44.25 +lon_0=-109.5 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / Montana (ft)
-<epsg3605> +proj=lcc +lat_1=49 +lat_2=45 +lat_0=44.25 +lon_0=-109.5 +x_0=599999.9999976 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=ft +no_defs  <>
-# NAD83(NSRS2007) / Nebraska
-<epsg3606> +proj=lcc +lat_1=43 +lat_2=40 +lat_0=39.83333333333334 +lon_0=-100 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / Nevada Central
-<epsg3607> +proj=tmerc +lat_0=34.75 +lon_0=-116.6666666666667 +k=0.9999 +x_0=500000 +y_0=6000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / Nevada Central (ft US)
-<epsg3608> +proj=tmerc +lat_0=34.75 +lon_0=-116.6666666666667 +k=0.9999 +x_0=500000.00001016 +y_0=6000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(NSRS2007) / Nevada East
-<epsg3609> +proj=tmerc +lat_0=34.75 +lon_0=-115.5833333333333 +k=0.9999 +x_0=200000 +y_0=8000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / Nevada East (ft US)
-<epsg3610> +proj=tmerc +lat_0=34.75 +lon_0=-115.5833333333333 +k=0.9999 +x_0=200000.00001016 +y_0=8000000.000010163 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(NSRS2007) / Nevada West
-<epsg3611> +proj=tmerc +lat_0=34.75 +lon_0=-118.5833333333333 +k=0.9999 +x_0=800000 +y_0=4000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / Nevada West (ft US)
-<epsg3612> +proj=tmerc +lat_0=34.75 +lon_0=-118.5833333333333 +k=0.9999 +x_0=800000.0000101599 +y_0=3999999.99998984 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(NSRS2007) / New Hampshire
-<epsg3613> +proj=tmerc +lat_0=42.5 +lon_0=-71.66666666666667 +k=0.999966667 +x_0=300000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / New Hampshire (ftUS)
-<epsg3614> +proj=tmerc +lat_0=42.5 +lon_0=-71.66666666666667 +k=0.999966667 +x_0=300000.0000000001 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(NSRS2007) / New Jersey
-<epsg3615> +proj=tmerc +lat_0=38.83333333333334 +lon_0=-74.5 +k=0.9999 +x_0=150000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / New Jersey (ft US)
-<epsg3616> +proj=tmerc +lat_0=38.83333333333334 +lon_0=-74.5 +k=0.9999 +x_0=150000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(NSRS2007) / New Mexico Central
-<epsg3617> +proj=tmerc +lat_0=31 +lon_0=-106.25 +k=0.9999 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / New Mexico Central (ftUS)
-<epsg3618> +proj=tmerc +lat_0=31 +lon_0=-106.25 +k=0.9999 +x_0=500000.0001016001 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(NSRS2007) / New Mexico East
-<epsg3619> +proj=tmerc +lat_0=31 +lon_0=-104.3333333333333 +k=0.999909091 +x_0=165000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / New Mexico East (ftUS)
-<epsg3620> +proj=tmerc +lat_0=31 +lon_0=-104.3333333333333 +k=0.999909091 +x_0=165000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(NSRS2007) / New Mexico West
-<epsg3621> +proj=tmerc +lat_0=31 +lon_0=-107.8333333333333 +k=0.999916667 +x_0=830000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / New Mexico West (ftUS)
-<epsg3622> +proj=tmerc +lat_0=31 +lon_0=-107.8333333333333 +k=0.999916667 +x_0=830000.0001016001 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(NSRS2007) / New York Central
-<epsg3623> +proj=tmerc +lat_0=40 +lon_0=-76.58333333333333 +k=0.9999375 +x_0=250000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / New York Central (ftUS)
-<epsg3624> +proj=tmerc +lat_0=40 +lon_0=-76.58333333333333 +k=0.9999375 +x_0=249999.9998983998 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(NSRS2007) / New York East
-<epsg3625> +proj=tmerc +lat_0=38.83333333333334 +lon_0=-74.5 +k=0.9999 +x_0=150000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / New York East (ftUS)
-<epsg3626> +proj=tmerc +lat_0=38.83333333333334 +lon_0=-74.5 +k=0.9999 +x_0=150000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(NSRS2007) / New York Long Island
-<epsg3627> +proj=lcc +lat_1=41.03333333333333 +lat_2=40.66666666666666 +lat_0=40.16666666666666 +lon_0=-74 +x_0=300000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / New York Long Island (ftUS)
-<epsg3628> +proj=lcc +lat_1=41.03333333333333 +lat_2=40.66666666666666 +lat_0=40.16666666666666 +lon_0=-74 +x_0=300000.0000000001 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(NSRS2007) / New York West
-<epsg3629> +proj=tmerc +lat_0=40 +lon_0=-78.58333333333333 +k=0.9999375 +x_0=350000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / New York West (ftUS)
-<epsg3630> +proj=tmerc +lat_0=40 +lon_0=-78.58333333333333 +k=0.9999375 +x_0=350000.0001016001 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(NSRS2007) / North Carolina
-<epsg3631> +proj=lcc +lat_1=36.16666666666666 +lat_2=34.33333333333334 +lat_0=33.75 +lon_0=-79 +x_0=609601.22 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / North Carolina (ftUS)
-<epsg3632> +proj=lcc +lat_1=36.16666666666666 +lat_2=34.33333333333334 +lat_0=33.75 +lon_0=-79 +x_0=609601.2192024384 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(NSRS2007) / North Dakota North
-<epsg3633> +proj=lcc +lat_1=48.73333333333333 +lat_2=47.43333333333333 +lat_0=47 +lon_0=-100.5 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / North Dakota North (ft)
-<epsg3634> +proj=lcc +lat_1=48.73333333333333 +lat_2=47.43333333333333 +lat_0=47 +lon_0=-100.5 +x_0=599999.9999976 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=ft +no_defs  <>
-# NAD83(NSRS2007) / North Dakota South
-<epsg3635> +proj=lcc +lat_1=47.48333333333333 +lat_2=46.18333333333333 +lat_0=45.66666666666666 +lon_0=-100.5 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / North Dakota South (ft)
-<epsg3636> +proj=lcc +lat_1=47.48333333333333 +lat_2=46.18333333333333 +lat_0=45.66666666666666 +lon_0=-100.5 +x_0=599999.9999976 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=ft +no_defs  <>
-# NAD83(NSRS2007) / Ohio North
-<epsg3637> +proj=lcc +lat_1=41.7 +lat_2=40.43333333333333 +lat_0=39.66666666666666 +lon_0=-82.5 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / Ohio South
-<epsg3638> +proj=lcc +lat_1=40.03333333333333 +lat_2=38.73333333333333 +lat_0=38 +lon_0=-82.5 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / Oklahoma North
-<epsg3639> +proj=lcc +lat_1=36.76666666666667 +lat_2=35.56666666666667 +lat_0=35 +lon_0=-98 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / Oklahoma North (ftUS)
-<epsg3640> +proj=lcc +lat_1=36.76666666666667 +lat_2=35.56666666666667 +lat_0=35 +lon_0=-98 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(NSRS2007) / Oklahoma South
-<epsg3641> +proj=lcc +lat_1=35.23333333333333 +lat_2=33.93333333333333 +lat_0=33.33333333333334 +lon_0=-98 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / Oklahoma South (ftUS)
-<epsg3642> +proj=lcc +lat_1=35.23333333333333 +lat_2=33.93333333333333 +lat_0=33.33333333333334 +lon_0=-98 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(NSRS2007) / Oregon Lambert
-<epsg3643> +proj=lcc +lat_1=43 +lat_2=45.5 +lat_0=41.75 +lon_0=-120.5 +x_0=400000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / Oregon Lambert (ft)
-<epsg3644> +proj=lcc +lat_1=43 +lat_2=45.5 +lat_0=41.75 +lon_0=-120.5 +x_0=399999.9999984 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=ft +no_defs  <>
-# NAD83(NSRS2007) / Oregon North
-<epsg3645> +proj=lcc +lat_1=46 +lat_2=44.33333333333334 +lat_0=43.66666666666666 +lon_0=-120.5 +x_0=2500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / Oregon North (ft)
-<epsg3646> +proj=lcc +lat_1=46 +lat_2=44.33333333333334 +lat_0=43.66666666666666 +lon_0=-120.5 +x_0=2500000.0001424 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=ft +no_defs  <>
-# NAD83(NSRS2007) / Oregon South
-<epsg3647> +proj=lcc +lat_1=44 +lat_2=42.33333333333334 +lat_0=41.66666666666666 +lon_0=-120.5 +x_0=1500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / Oregon South (ft)
-<epsg3648> +proj=lcc +lat_1=44 +lat_2=42.33333333333334 +lat_0=41.66666666666666 +lon_0=-120.5 +x_0=1500000.0001464 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=ft +no_defs  <>
-# NAD83(NSRS2007) / Pennsylvania North
-<epsg3649> +proj=lcc +lat_1=41.95 +lat_2=40.88333333333333 +lat_0=40.16666666666666 +lon_0=-77.75 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / Pennsylvania North (ftUS)
-<epsg3650> +proj=lcc +lat_1=41.95 +lat_2=40.88333333333333 +lat_0=40.16666666666666 +lon_0=-77.75 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(NSRS2007) / Pennsylvania South
-<epsg3651> +proj=lcc +lat_1=40.96666666666667 +lat_2=39.93333333333333 +lat_0=39.33333333333334 +lon_0=-77.75 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / Pennsylvania South (ftUS)
-<epsg3652> +proj=lcc +lat_1=40.96666666666667 +lat_2=39.93333333333333 +lat_0=39.33333333333334 +lon_0=-77.75 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(NSRS2007) / Rhode Island
-<epsg3653> +proj=tmerc +lat_0=41.08333333333334 +lon_0=-71.5 +k=0.99999375 +x_0=100000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / Rhode Island (ftUS)
-<epsg3654> +proj=tmerc +lat_0=41.08333333333334 +lon_0=-71.5 +k=0.99999375 +x_0=99999.99998983997 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(NSRS2007) / South Carolina
-<epsg3655> +proj=lcc +lat_1=34.83333333333334 +lat_2=32.5 +lat_0=31.83333333333333 +lon_0=-81 +x_0=609600 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / South Carolina (ft)
-<epsg3656> +proj=lcc +lat_1=34.83333333333334 +lat_2=32.5 +lat_0=31.83333333333333 +lon_0=-81 +x_0=609600 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=ft +no_defs  <>
-# NAD83(NSRS2007) / South Dakota North
-<epsg3657> +proj=lcc +lat_1=45.68333333333333 +lat_2=44.41666666666666 +lat_0=43.83333333333334 +lon_0=-100 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / South Dakota North (ftUS)
-<epsg3658> +proj=lcc +lat_1=45.68333333333333 +lat_2=44.41666666666666 +lat_0=43.83333333333334 +lon_0=-100 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(NSRS2007) / South Dakota South
-<epsg3659> +proj=lcc +lat_1=44.4 +lat_2=42.83333333333334 +lat_0=42.33333333333334 +lon_0=-100.3333333333333 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / South Dakota South (ftUS)
-<epsg3660> +proj=lcc +lat_1=44.4 +lat_2=42.83333333333334 +lat_0=42.33333333333334 +lon_0=-100.3333333333333 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(NSRS2007) / Tennessee
-<epsg3661> +proj=lcc +lat_1=36.41666666666666 +lat_2=35.25 +lat_0=34.33333333333334 +lon_0=-86 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / Tennessee (ftUS)
-<epsg3662> +proj=lcc +lat_1=36.41666666666666 +lat_2=35.25 +lat_0=34.33333333333334 +lon_0=-86 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(NSRS2007) / Texas Central
-<epsg3663> +proj=lcc +lat_1=31.88333333333333 +lat_2=30.11666666666667 +lat_0=29.66666666666667 +lon_0=-100.3333333333333 +x_0=700000 +y_0=3000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / Texas Central (ftUS)
-<epsg3664> +proj=lcc +lat_1=31.88333333333333 +lat_2=30.11666666666667 +lat_0=29.66666666666667 +lon_0=-100.3333333333333 +x_0=699999.9998983998 +y_0=3000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(NSRS2007) / Texas Centric Albers Equal Area
-<epsg3665> +proj=aea +lat_1=27.5 +lat_2=35 +lat_0=18 +lon_0=-100 +x_0=1500000 +y_0=6000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / Texas Centric Lambert Conformal
-<epsg3666> +proj=lcc +lat_1=27.5 +lat_2=35 +lat_0=18 +lon_0=-100 +x_0=1500000 +y_0=5000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / Texas North
-<epsg3667> +proj=lcc +lat_1=36.18333333333333 +lat_2=34.65 +lat_0=34 +lon_0=-101.5 +x_0=200000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / Texas North (ftUS)
-<epsg3668> +proj=lcc +lat_1=36.18333333333333 +lat_2=34.65 +lat_0=34 +lon_0=-101.5 +x_0=200000.0001016002 +y_0=999999.9998983998 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(NSRS2007) / Texas North Central
-<epsg3669> +proj=lcc +lat_1=33.96666666666667 +lat_2=32.13333333333333 +lat_0=31.66666666666667 +lon_0=-98.5 +x_0=600000 +y_0=2000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / Texas North Central (ftUS)
-<epsg3670> +proj=lcc +lat_1=33.96666666666667 +lat_2=32.13333333333333 +lat_0=31.66666666666667 +lon_0=-98.5 +x_0=600000 +y_0=2000000.0001016 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(NSRS2007) / Texas South
-<epsg3671> +proj=lcc +lat_1=27.83333333333333 +lat_2=26.16666666666667 +lat_0=25.66666666666667 +lon_0=-98.5 +x_0=300000 +y_0=5000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / Texas South (ftUS)
-<epsg3672> +proj=lcc +lat_1=27.83333333333333 +lat_2=26.16666666666667 +lat_0=25.66666666666667 +lon_0=-98.5 +x_0=300000.0000000001 +y_0=5000000.0001016 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(NSRS2007) / Texas South Central
-<epsg3673> +proj=lcc +lat_1=30.28333333333333 +lat_2=28.38333333333333 +lat_0=27.83333333333333 +lon_0=-99 +x_0=600000 +y_0=4000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / Texas South Central (ftUS)
-<epsg3674> +proj=lcc +lat_1=30.28333333333333 +lat_2=28.38333333333333 +lat_0=27.83333333333333 +lon_0=-99 +x_0=600000 +y_0=3999999.9998984 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(NSRS2007) / Utah Central
-<epsg3675> +proj=lcc +lat_1=40.65 +lat_2=39.01666666666667 +lat_0=38.33333333333334 +lon_0=-111.5 +x_0=500000 +y_0=2000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / Utah Central (ft)
-<epsg3676> +proj=lcc +lat_1=40.65 +lat_2=39.01666666666667 +lat_0=38.33333333333334 +lon_0=-111.5 +x_0=500000.0001504 +y_0=1999999.999992 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=ft +no_defs  <>
-# NAD83(NSRS2007) / Utah Central (ftUS)
-<epsg3677> +proj=lcc +lat_1=40.65 +lat_2=39.01666666666667 +lat_0=38.33333333333334 +lon_0=-111.5 +x_0=500000.00001016 +y_0=2000000.00001016 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(NSRS2007) / Utah North
-<epsg3678> +proj=lcc +lat_1=41.78333333333333 +lat_2=40.71666666666667 +lat_0=40.33333333333334 +lon_0=-111.5 +x_0=500000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / Utah North (ft)
-<epsg3679> +proj=lcc +lat_1=41.78333333333333 +lat_2=40.71666666666667 +lat_0=40.33333333333334 +lon_0=-111.5 +x_0=500000.0001504 +y_0=999999.9999960001 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=ft +no_defs  <>
-# NAD83(NSRS2007) / Utah North (ftUS)
-<epsg3680> +proj=lcc +lat_1=41.78333333333333 +lat_2=40.71666666666667 +lat_0=40.33333333333334 +lon_0=-111.5 +x_0=500000.00001016 +y_0=999999.9999898402 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(NSRS2007) / Utah South
-<epsg3681> +proj=lcc +lat_1=38.35 +lat_2=37.21666666666667 +lat_0=36.66666666666666 +lon_0=-111.5 +x_0=500000 +y_0=3000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / Utah South (ft)
-<epsg3682> +proj=lcc +lat_1=38.35 +lat_2=37.21666666666667 +lat_0=36.66666666666666 +lon_0=-111.5 +x_0=500000.0001504 +y_0=2999999.999988 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=ft +no_defs  <>
-# NAD83(NSRS2007) / Utah South (ftUS)
-<epsg3683> +proj=lcc +lat_1=38.35 +lat_2=37.21666666666667 +lat_0=36.66666666666666 +lon_0=-111.5 +x_0=500000.00001016 +y_0=3000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(NSRS2007) / Vermont
-<epsg3684> +proj=tmerc +lat_0=42.5 +lon_0=-72.5 +k=0.999964286 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / Virginia North
-<epsg3685> +proj=lcc +lat_1=39.2 +lat_2=38.03333333333333 +lat_0=37.66666666666666 +lon_0=-78.5 +x_0=3500000 +y_0=2000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / Virginia North (ftUS)
-<epsg3686> +proj=lcc +lat_1=39.2 +lat_2=38.03333333333333 +lat_0=37.66666666666666 +lon_0=-78.5 +x_0=3500000.0001016 +y_0=2000000.0001016 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(NSRS2007) / Virginia South
-<epsg3687> +proj=lcc +lat_1=37.96666666666667 +lat_2=36.76666666666667 +lat_0=36.33333333333334 +lon_0=-78.5 +x_0=3500000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / Virginia South (ftUS)
-<epsg3688> +proj=lcc +lat_1=37.96666666666667 +lat_2=36.76666666666667 +lat_0=36.33333333333334 +lon_0=-78.5 +x_0=3500000.0001016 +y_0=999999.9998983998 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(NSRS2007) / Washington North
-<epsg3689> +proj=lcc +lat_1=48.73333333333333 +lat_2=47.5 +lat_0=47 +lon_0=-120.8333333333333 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / Washington North (ftUS)
-<epsg3690> +proj=lcc +lat_1=48.73333333333333 +lat_2=47.5 +lat_0=47 +lon_0=-120.8333333333333 +x_0=500000.0001016001 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(NSRS2007) / Washington South
-<epsg3691> +proj=lcc +lat_1=47.33333333333334 +lat_2=45.83333333333334 +lat_0=45.33333333333334 +lon_0=-120.5 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / Washington South (ftUS)
-<epsg3692> +proj=lcc +lat_1=47.33333333333334 +lat_2=45.83333333333334 +lat_0=45.33333333333334 +lon_0=-120.5 +x_0=500000.0001016001 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(NSRS2007) / West Virginia North
-<epsg3693> +proj=lcc +lat_1=40.25 +lat_2=39 +lat_0=38.5 +lon_0=-79.5 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / West Virginia South
-<epsg3694> +proj=lcc +lat_1=38.88333333333333 +lat_2=37.48333333333333 +lat_0=37 +lon_0=-81 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / Wisconsin Central
-<epsg3695> +proj=lcc +lat_1=45.5 +lat_2=44.25 +lat_0=43.83333333333334 +lon_0=-90 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / Wisconsin Central (ftUS)
-<epsg3696> +proj=lcc +lat_1=45.5 +lat_2=44.25 +lat_0=43.83333333333334 +lon_0=-90 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(NSRS2007) / Wisconsin North
-<epsg3697> +proj=lcc +lat_1=46.76666666666667 +lat_2=45.56666666666667 +lat_0=45.16666666666666 +lon_0=-90 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / Wisconsin North (ftUS)
-<epsg3698> +proj=lcc +lat_1=46.76666666666667 +lat_2=45.56666666666667 +lat_0=45.16666666666666 +lon_0=-90 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(NSRS2007) / Wisconsin South
-<epsg3699> +proj=lcc +lat_1=44.06666666666667 +lat_2=42.73333333333333 +lat_0=42 +lon_0=-90 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / Wisconsin South (ftUS)
-<epsg3700> +proj=lcc +lat_1=44.06666666666667 +lat_2=42.73333333333333 +lat_0=42 +lon_0=-90 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(NSRS2007) / Wisconsin Transverse Mercator
-<epsg3701> +proj=tmerc +lat_0=0 +lon_0=-90 +k=0.9996 +x_0=520000 +y_0=-4480000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / Wyoming East
-<epsg3702> +proj=tmerc +lat_0=40.5 +lon_0=-105.1666666666667 +k=0.9999375 +x_0=200000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / Wyoming East Central
-<epsg3703> +proj=tmerc +lat_0=40.5 +lon_0=-107.3333333333333 +k=0.9999375 +x_0=400000 +y_0=100000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / Wyoming West Central
-<epsg3704> +proj=tmerc +lat_0=40.5 +lon_0=-108.75 +k=0.9999375 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / Wyoming West
-<epsg3705> +proj=tmerc +lat_0=40.5 +lon_0=-110.0833333333333 +k=0.9999375 +x_0=800000 +y_0=100000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / UTM zone 59N
-<epsg3706> +proj=utm +zone=59 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / UTM zone 60N
-<epsg3707> +proj=utm +zone=60 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / UTM zone 1N
-<epsg3708> +proj=utm +zone=1 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / UTM zone 2N
-<epsg3709> +proj=utm +zone=2 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / UTM zone 3N
-<epsg3710> +proj=utm +zone=3 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / UTM zone 4N
-<epsg3711> +proj=utm +zone=4 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / UTM zone 5N
-<epsg3712> +proj=utm +zone=5 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / UTM zone 6N
-<epsg3713> +proj=utm +zone=6 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / UTM zone 7N
-<epsg3714> +proj=utm +zone=7 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / UTM zone 8N
-<epsg3715> +proj=utm +zone=8 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / UTM zone 9N
-<epsg3716> +proj=utm +zone=9 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / UTM zone 10N
-<epsg3717> +proj=utm +zone=10 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / UTM zone 11N
-<epsg3718> +proj=utm +zone=11 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / UTM zone 12N
-<epsg3719> +proj=utm +zone=12 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / UTM zone 13N
-<epsg3720> +proj=utm +zone=13 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / UTM zone 14N
-<epsg3721> +proj=utm +zone=14 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / UTM zone 15N
-<epsg3722> +proj=utm +zone=15 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / UTM zone 16N
-<epsg3723> +proj=utm +zone=16 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / UTM zone 17N
-<epsg3724> +proj=utm +zone=17 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / UTM zone 18N
-<epsg3725> +proj=utm +zone=18 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / UTM zone 19N
-<epsg3726> +proj=utm +zone=19 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# Reunion 1947 / TM Reunion
-<epsg3727> +proj=tmerc +lat_0=-21.11666666666667 +lon_0=55.53333333333333 +k=1 +x_0=160000 +y_0=50000 +ellps=intl +towgs84=94,-948,-1262,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / Ohio North (ftUS)
-<epsg3728> +proj=lcc +lat_1=41.7 +lat_2=40.43333333333333 +lat_0=39.66666666666666 +lon_0=-82.5 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(NSRS2007) / Ohio South (ftUS)
-<epsg3729> +proj=lcc +lat_1=40.03333333333333 +lat_2=38.73333333333333 +lat_0=38 +lon_0=-82.5 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(NSRS2007) / Wyoming East (ftUS)
-<epsg3730> +proj=tmerc +lat_0=40.5 +lon_0=-105.1666666666667 +k=0.9999375 +x_0=200000.00001016 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(NSRS2007) / Wyoming East Central (ftUS)
-<epsg3731> +proj=tmerc +lat_0=40.5 +lon_0=-107.3333333333333 +k=0.9999375 +x_0=399999.99998984 +y_0=99999.99998983997 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(NSRS2007) / Wyoming West Central (ftUS)
-<epsg3732> +proj=tmerc +lat_0=40.5 +lon_0=-108.75 +k=0.9999375 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(NSRS2007) / Wyoming West (ftUS)
-<epsg3733> +proj=tmerc +lat_0=40.5 +lon_0=-110.0833333333333 +k=0.9999375 +x_0=800000.0000101599 +y_0=99999.99998983997 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83 / Ohio North (ftUS)
-<epsg3734> +proj=lcc +lat_1=41.7 +lat_2=40.43333333333333 +lat_0=39.66666666666666 +lon_0=-82.5 +x_0=600000 +y_0=0 +datum=NAD83 +units=us-ft +no_defs  <>
-# NAD83 / Ohio South (ftUS)
-<epsg3735> +proj=lcc +lat_1=40.03333333333333 +lat_2=38.73333333333333 +lat_0=38 +lon_0=-82.5 +x_0=600000 +y_0=0 +datum=NAD83 +units=us-ft +no_defs  <>
-# NAD83 / Wyoming East (ftUS)
-<epsg3736> +proj=tmerc +lat_0=40.5 +lon_0=-105.1666666666667 +k=0.9999375 +x_0=200000.00001016 +y_0=0 +datum=NAD83 +units=us-ft +no_defs  <>
-# NAD83 / Wyoming East Central (ftUS)
-<epsg3737> +proj=tmerc +lat_0=40.5 +lon_0=-107.3333333333333 +k=0.9999375 +x_0=399999.99998984 +y_0=99999.99998983997 +datum=NAD83 +units=us-ft +no_defs  <>
-# NAD83 / Wyoming West Central (ftUS)
-<epsg3738> +proj=tmerc +lat_0=40.5 +lon_0=-108.75 +k=0.9999375 +x_0=600000 +y_0=0 +datum=NAD83 +units=us-ft +no_defs  <>
-# NAD83 / Wyoming West (ftUS)
-<epsg3739> +proj=tmerc +lat_0=40.5 +lon_0=-110.0833333333333 +k=0.9999375 +x_0=800000.0000101599 +y_0=99999.99998983997 +datum=NAD83 +units=us-ft +no_defs  <>
-# NAD83(HARN) / UTM zone 10N
-<epsg3740> +proj=utm +zone=10 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / UTM zone 11N
-<epsg3741> +proj=utm +zone=11 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / UTM zone 12N
-<epsg3742> +proj=utm +zone=12 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / UTM zone 13N
-<epsg3743> +proj=utm +zone=13 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / UTM zone 14N
-<epsg3744> +proj=utm +zone=14 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / UTM zone 15N
-<epsg3745> +proj=utm +zone=15 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / UTM zone 16N
-<epsg3746> +proj=utm +zone=16 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / UTM zone 17N
-<epsg3747> +proj=utm +zone=17 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / UTM zone 18N
-<epsg3748> +proj=utm +zone=18 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / UTM zone 19N
-<epsg3749> +proj=utm +zone=19 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / UTM zone 4N
-<epsg3750> +proj=utm +zone=4 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / UTM zone 5N
-<epsg3751> +proj=utm +zone=5 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# WGS 84 / Mercator 41 (deprecated)
-<epsg3752> +proj=merc +lon_0=100 +lat_ts=-41 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs  <>
-# NAD83(HARN) / Ohio North (ftUS)
-<epsg3753> +proj=lcc +lat_1=41.7 +lat_2=40.43333333333333 +lat_0=39.66666666666666 +lon_0=-82.5 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(HARN) / Ohio South (ftUS)
-<epsg3754> +proj=lcc +lat_1=40.03333333333333 +lat_2=38.73333333333333 +lat_0=38 +lon_0=-82.5 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(HARN) / Wyoming East (ftUS)
-<epsg3755> +proj=tmerc +lat_0=40.5 +lon_0=-105.1666666666667 +k=0.9999375 +x_0=200000.00001016 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(HARN) / Wyoming East Central (ftUS)
-<epsg3756> +proj=tmerc +lat_0=40.5 +lon_0=-107.3333333333333 +k=0.9999375 +x_0=399999.99998984 +y_0=99999.99998983997 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(HARN) / Wyoming West Central (ftUS)
-<epsg3757> +proj=tmerc +lat_0=40.5 +lon_0=-108.75 +k=0.9999375 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(HARN) / Wyoming West (ftUS)
-<epsg3758> +proj=tmerc +lat_0=40.5 +lon_0=-110.0833333333333 +k=0.9999375 +x_0=800000.0000101599 +y_0=99999.99998983997 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83 / Hawaii zone 3 (ftUS)
-<epsg3759> +proj=tmerc +lat_0=21.16666666666667 +lon_0=-158 +k=0.99999 +x_0=500000.00001016 +y_0=0 +datum=NAD83 +units=us-ft +no_defs  <>
-# NAD83(HARN) / Hawaii zone 3 (ftUS)
-<epsg3760> +proj=tmerc +lat_0=21.16666666666667 +lon_0=-158 +k=0.99999 +x_0=500000.00001016 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(CSRS) / UTM zone 22N
-<epsg3761> +proj=utm +zone=22 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# WGS 84 / South Georgia Lambert
-<epsg3762> +proj=lcc +lat_1=-54 +lat_2=-54.75 +lat_0=-55 +lon_0=-37 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs  <>
-# ETRS89 / Portugal TM06
-<epsg3763> +proj=tmerc +lat_0=39.66825833333333 +lon_0=-8.133108333333334 +k=1 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NZGD2000 / Chatham Island Circuit 2000
-<epsg3764> +proj=tmerc +lat_0=-44 +lon_0=-176.5 +k=1 +x_0=400000 +y_0=800000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# HTRS96 / Croatia TM
-<epsg3765> +proj=tmerc +lat_0=0 +lon_0=16.5 +k=0.9999 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# HTRS96 / Croatia LCC
-<epsg3766> +proj=lcc +lat_1=45.91666666666666 +lat_2=43.08333333333334 +lat_0=0 +lon_0=16.5 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# HTRS96 / UTM zone 33N
-<epsg3767> +proj=utm +zone=33 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# HTRS96 / UTM zone 34N
-<epsg3768> +proj=utm +zone=34 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# Bermuda 1957 / UTM zone 20N
-<epsg3769> +proj=utm +zone=20 +ellps=clrk66 +towgs84=-73,213,296,0,0,0,0 +units=m +no_defs  <>
-# BDA2000 / Bermuda 2000 National Grid
-<epsg3770> +proj=tmerc +lat_0=32 +lon_0=-64.75 +k=1 +x_0=550000 +y_0=100000 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD27 / Alberta 3TM ref merid 111 W
-<epsg3771> +proj=tmerc +lat_0=0 +lon_0=-111 +k=0.9999 +x_0=0 +y_0=0 +datum=NAD27 +units=m +no_defs  <>
-# NAD27 / Alberta 3TM ref merid 114 W
-<epsg3772> +proj=tmerc +lat_0=0 +lon_0=-114 +k=0.9999 +x_0=0 +y_0=0 +datum=NAD27 +units=m +no_defs  <>
-# NAD27 / Alberta 3TM ref merid 117 W
-<epsg3773> +proj=tmerc +lat_0=0 +lon_0=-117 +k=0.9999 +x_0=0 +y_0=0 +datum=NAD27 +units=m +no_defs  <>
-# NAD27 / Alberta 3TM ref merid 120 W (deprecated)
-<epsg3774> +proj=tmerc +lat_0=0 +lon_0=-120 +k=0.9999 +x_0=0 +y_0=0 +datum=NAD27 +units=m +no_defs  <>
-# NAD83 / Alberta 3TM ref merid 111 W
-<epsg3775> +proj=tmerc +lat_0=0 +lon_0=-111 +k=0.9999 +x_0=0 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / Alberta 3TM ref merid 114 W
-<epsg3776> +proj=tmerc +lat_0=0 +lon_0=-114 +k=0.9999 +x_0=0 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / Alberta 3TM ref merid 117 W
-<epsg3777> +proj=tmerc +lat_0=0 +lon_0=-117 +k=0.9999 +x_0=0 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / Alberta 3TM ref merid 120 W (deprecated)
-<epsg3778> +proj=tmerc +lat_0=0 +lon_0=-120 +k=0.9999 +x_0=0 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83(CSRS) / Alberta 3TM ref merid 111 W
-<epsg3779> +proj=tmerc +lat_0=0 +lon_0=-111 +k=0.9999 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(CSRS) / Alberta 3TM ref merid 114 W
-<epsg3780> +proj=tmerc +lat_0=0 +lon_0=-114 +k=0.9999 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(CSRS) / Alberta 3TM ref merid 117 W
-<epsg3781> +proj=tmerc +lat_0=0 +lon_0=-117 +k=0.9999 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(CSRS) / Alberta 3TM ref merid 120 W (deprecated)
-<epsg3782> +proj=tmerc +lat_0=0 +lon_0=-120 +k=0.9999 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# Pitcairn 2006 / Pitcairn TM 2006
-<epsg3783> +proj=tmerc +lat_0=-25.06855261111111 +lon_0=-130.1129671111111 +k=1 +x_0=14200 +y_0=15500 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# Pitcairn 1967 / UTM zone 9S
-<epsg3784> +proj=utm +zone=9 +south +ellps=intl +towgs84=185,165,42,0,0,0,0 +units=m +no_defs  <>
-# Popular Visualisation CRS / Mercator (deprecated)
-<epsg3785> +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext  +no_defs <>
-# World Equidistant Cylindrical (Sphere) (deprecated)
-<epsg3786> +proj=eqc +lat_ts=0 +lat_0=0 +lon_0=0 +x_0=0 +y_0=0 +a=6371007 +b=6371007 +units=m +no_defs  <>
-# MGI / Slovene National Grid (deprecated)
-<epsg3787> +proj=tmerc +lat_0=0 +lon_0=15 +k=0.9999 +x_0=500000 +y_0=-5000000 +datum=hermannskogel +units=m +no_defs  <>
-# NZGD2000 / Auckland Islands TM 2000
-<epsg3788> +proj=tmerc +lat_0=0 +lon_0=166 +k=1 +x_0=3500000 +y_0=10000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NZGD2000 / Campbell Island TM 2000
-<epsg3789> +proj=tmerc +lat_0=0 +lon_0=169 +k=1 +x_0=3500000 +y_0=10000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NZGD2000 / Antipodes Islands TM 2000
-<epsg3790> +proj=tmerc +lat_0=0 +lon_0=179 +k=1 +x_0=3500000 +y_0=10000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NZGD2000 / Raoul Island TM 2000
-<epsg3791> +proj=tmerc +lat_0=0 +lon_0=-178 +k=1 +x_0=3500000 +y_0=10000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NZGD2000 / Chatham Islands TM 2000
-<epsg3793> +proj=tmerc +lat_0=0 +lon_0=-176.5 +k=1 +x_0=3500000 +y_0=10000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# Slovenia 1996 / Slovene National Grid
-<epsg3794> +proj=tmerc +lat_0=0 +lon_0=15 +k=0.9999 +x_0=500000 +y_0=-5000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD27 / Cuba Norte
-<epsg3795> +proj=lcc +lat_1=23 +lat_2=21.7 +lat_0=22.35 +lon_0=-81 +x_0=500000 +y_0=280296.016 +datum=NAD27 +units=m +no_defs  <>
-# NAD27 / Cuba Sur
-<epsg3796> +proj=lcc +lat_1=21.3 +lat_2=20.13333333333333 +lat_0=20.71666666666667 +lon_0=-76.83333333333333 +x_0=500000 +y_0=229126.939 +datum=NAD27 +units=m +no_defs  <>
-# NAD27 / MTQ Lambert
-<epsg3797> +proj=lcc +lat_1=50 +lat_2=46 +lat_0=44 +lon_0=-70 +x_0=800000 +y_0=0 +datum=NAD27 +units=m +no_defs  <>
-# NAD83 / MTQ Lambert
-<epsg3798> +proj=lcc +lat_1=50 +lat_2=46 +lat_0=44 +lon_0=-70 +x_0=800000 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83(CSRS) / MTQ Lambert
-<epsg3799> +proj=lcc +lat_1=50 +lat_2=46 +lat_0=44 +lon_0=-70 +x_0=800000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD27 / Alberta 3TM ref merid 120 W
-<epsg3800> +proj=tmerc +lat_0=0 +lon_0=-120 +k=0.9999 +x_0=0 +y_0=0 +datum=NAD27 +units=m +no_defs  <>
-# NAD83 / Alberta 3TM ref merid 120 W
-<epsg3801> +proj=tmerc +lat_0=0 +lon_0=-120 +k=0.9999 +x_0=0 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83(CSRS) / Alberta 3TM ref merid 120 W
-<epsg3802> +proj=tmerc +lat_0=0 +lon_0=-120 +k=0.9999 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ETRS89 / Belgian Lambert 2008
-<epsg3812> +proj=lcc +lat_1=49.83333333333334 +lat_2=51.16666666666666 +lat_0=50.797815 +lon_0=4.359215833333333 +x_0=649328 +y_0=665262 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83 / Mississippi TM
-<epsg3814> +proj=tmerc +lat_0=32.5 +lon_0=-89.75 +k=0.9998335 +x_0=500000 +y_0=1300000 +datum=NAD83 +units=m +no_defs  <>
-# NAD83(HARN) / Mississippi TM
-<epsg3815> +proj=tmerc +lat_0=32.5 +lon_0=-89.75 +k=0.9998335 +x_0=500000 +y_0=1300000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / Mississippi TM
-<epsg3816> +proj=tmerc +lat_0=32.5 +lon_0=-89.75 +k=0.9998335 +x_0=500000 +y_0=1300000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# TWD97 / TM2 zone 119
-<epsg3825> +proj=tmerc +lat_0=0 +lon_0=119 +k=0.9999 +x_0=250000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# TWD97 / TM2 zone 121
-<epsg3826> +proj=tmerc +lat_0=0 +lon_0=121 +k=0.9999 +x_0=250000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# TWD67 / TM2 zone 119
-<epsg3827> +proj=tmerc +lat_0=0 +lon_0=119 +k=0.9999 +x_0=250000 +y_0=0 +ellps=aust_SA +units=m +no_defs  <>
-# TWD67 / TM2 zone 121
-<epsg3828> +proj=tmerc +lat_0=0 +lon_0=121 +k=0.9999 +x_0=250000 +y_0=0 +ellps=aust_SA +units=m +no_defs  <>
-# Hu Tzu Shan 1950 / UTM zone 51N
-<epsg3829> +proj=utm +zone=51 +ellps=intl +towgs84=-637,-549,-203,0,0,0,0 +units=m +no_defs  <>
-# WGS 84 / PDC Mercator
-<epsg3832> +proj=merc +lon_0=150 +k=1 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs  <>
-# Pulkovo 1942(58) / Gauss-Kruger zone 2
-<epsg3833> +proj=tmerc +lat_0=0 +lon_0=9 +k=1 +x_0=2500000 +y_0=0 +ellps=krass +towgs84=33.4,-146.6,-76.3,-0.359,-0.053,0.844,-0.84 +units=m +no_defs  <>
-# Pulkovo 1942(83) / Gauss-Kruger zone 2
-<epsg3834> +proj=tmerc +lat_0=0 +lon_0=9 +k=1 +x_0=2500000 +y_0=0 +ellps=krass +towgs84=26,-121,-78,0,0,0,0 +units=m +no_defs  <>
-# Pulkovo 1942(83) / Gauss-Kruger zone 3
-<epsg3835> +proj=tmerc +lat_0=0 +lon_0=15 +k=1 +x_0=3500000 +y_0=0 +ellps=krass +towgs84=26,-121,-78,0,0,0,0 +units=m +no_defs  <>
-# Pulkovo 1942(83) / Gauss-Kruger zone 4
-<epsg3836> +proj=tmerc +lat_0=0 +lon_0=21 +k=1 +x_0=4500000 +y_0=0 +ellps=krass +towgs84=26,-121,-78,0,0,0,0 +units=m +no_defs  <>
-# Pulkovo 1942(58) / 3-degree Gauss-Kruger zone 3
-<epsg3837> +proj=tmerc +lat_0=0 +lon_0=9 +k=1 +x_0=3500000 +y_0=0 +ellps=krass +towgs84=33.4,-146.6,-76.3,-0.359,-0.053,0.844,-0.84 +units=m +no_defs  <>
-# Pulkovo 1942(58) / 3-degree Gauss-Kruger zone 4
-<epsg3838> +proj=tmerc +lat_0=0 +lon_0=12 +k=1 +x_0=4500000 +y_0=0 +ellps=krass +towgs84=33.4,-146.6,-76.3,-0.359,-0.053,0.844,-0.84 +units=m +no_defs  <>
-# Pulkovo 1942(58) / 3-degree Gauss-Kruger zone 9
-<epsg3839> +proj=tmerc +lat_0=0 +lon_0=27 +k=1 +x_0=9500000 +y_0=0 +ellps=krass +towgs84=33.4,-146.6,-76.3,-0.359,-0.053,0.844,-0.84 +units=m +no_defs  <>
-# Pulkovo 1942(58) / 3-degree Gauss-Kruger zone 10
-<epsg3840> +proj=tmerc +lat_0=0 +lon_0=30 +k=1 +x_0=10500000 +y_0=0 +ellps=krass +towgs84=33.4,-146.6,-76.3,-0.359,-0.053,0.844,-0.84 +units=m +no_defs  <>
-# Pulkovo 1942(83) / 3-degree Gauss-Kruger zone 6
-<epsg3841> +proj=tmerc +lat_0=0 +lon_0=18 +k=1 +x_0=6500000 +y_0=0 +ellps=krass +towgs84=26,-121,-78,0,0,0,0 +units=m +no_defs  <>
-# Pulkovo 1942(83) / 3-degree Gauss-Kruger zone 7 (deprecated)
-<epsg3842> +proj=tmerc +lat_0=0 +lon_0=18 +k=1 +x_0=6500000 +y_0=0 +ellps=krass +towgs84=26,-121,-78,0,0,0,0 +units=m +no_defs  <>
-# Pulkovo 1942(83) / 3-degree Gauss-Kruger zone 8 (deprecated)
-<epsg3843> +proj=tmerc +lat_0=0 +lon_0=18 +k=1 +x_0=6500000 +y_0=0 +ellps=krass +towgs84=26,-121,-78,0,0,0,0 +units=m +no_defs  <>
-# Pulkovo 1942(58) / Stereo70
-<epsg3844> +proj=sterea +lat_0=46 +lon_0=25 +k=0.99975 +x_0=500000 +y_0=500000 +ellps=krass +towgs84=33.4,-146.6,-76.3,-0.359,-0.053,0.844,-0.84 +units=m +no_defs  <>
-# SWEREF99 / RT90 7.5 gon V emulation
-<epsg3845> +proj=tmerc +lat_0=0 +lon_0=11.30625 +k=1.000006 +x_0=1500025.141 +y_0=-667.282 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# SWEREF99 / RT90 5 gon V emulation
-<epsg3846> +proj=tmerc +lat_0=0 +lon_0=13.55626666666667 +k=1.0000058 +x_0=1500044.695 +y_0=-667.13 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# SWEREF99 / RT90 2.5 gon V emulation
-<epsg3847> +proj=tmerc +lat_0=0 +lon_0=15.80628452944445 +k=1.00000561024 +x_0=1500064.274 +y_0=-667.711 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# SWEREF99 / RT90 0 gon emulation
-<epsg3848> +proj=tmerc +lat_0=0 +lon_0=18.0563 +k=1.0000054 +x_0=1500083.521 +y_0=-668.8440000000001 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# SWEREF99 / RT90 2.5 gon O emulation
-<epsg3849> +proj=tmerc +lat_0=0 +lon_0=20.30631666666667 +k=1.0000052 +x_0=1500102.765 +y_0=-670.706 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# SWEREF99 / RT90 5 gon O emulation
-<epsg3850> +proj=tmerc +lat_0=0 +lon_0=22.55633333333333 +k=1.0000049 +x_0=1500121.846 +y_0=-672.557 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NZGD2000 / NZCS2000
-<epsg3851> +proj=lcc +lat_1=-37.5 +lat_2=-44.5 +lat_0=-41 +lon_0=173 +x_0=3000000 +y_0=7000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# RSRGD2000 / DGLC2000
-<epsg3852> +proj=lcc +lat_1=-76.66666666666667 +lat_2=-79.33333333333333 +lat_0=-90 +lon_0=157 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# County ST74
-<epsg3854> +proj=tmerc +lat_0=0 +lon_0=18.05787 +k=0.99999506 +x_0=100182.7406 +y_0=-6500620.1207 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# WGS 84 / Pseudo-Mercator
-<epsg3857> +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext  +no_defs <>
-# ETRS89 / GK19FIN
-<epsg3873> +proj=tmerc +lat_0=0 +lon_0=19 +k=1 +x_0=19500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ETRS89 / GK20FIN
-<epsg3874> +proj=tmerc +lat_0=0 +lon_0=20 +k=1 +x_0=20500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ETRS89 / GK21FIN
-<epsg3875> +proj=tmerc +lat_0=0 +lon_0=21 +k=1 +x_0=21500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ETRS89 / GK22FIN
-<epsg3876> +proj=tmerc +lat_0=0 +lon_0=22 +k=1 +x_0=22500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ETRS89 / GK23FIN
-<epsg3877> +proj=tmerc +lat_0=0 +lon_0=23 +k=1 +x_0=23500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ETRS89 / GK24FIN
-<epsg3878> +proj=tmerc +lat_0=0 +lon_0=24 +k=1 +x_0=24500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ETRS89 / GK25FIN
-<epsg3879> +proj=tmerc +lat_0=0 +lon_0=25 +k=1 +x_0=25500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ETRS89 / GK26FIN
-<epsg3880> +proj=tmerc +lat_0=0 +lon_0=26 +k=1 +x_0=26500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ETRS89 / GK27FIN
-<epsg3881> +proj=tmerc +lat_0=0 +lon_0=27 +k=1 +x_0=27500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ETRS89 / GK28FIN
-<epsg3882> +proj=tmerc +lat_0=0 +lon_0=28 +k=1 +x_0=28500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ETRS89 / GK29FIN
-<epsg3883> +proj=tmerc +lat_0=0 +lon_0=29 +k=1 +x_0=29500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ETRS89 / GK30FIN
-<epsg3884> +proj=tmerc +lat_0=0 +lon_0=30 +k=1 +x_0=30500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ETRS89 / GK31FIN
-<epsg3885> +proj=tmerc +lat_0=0 +lon_0=31 +k=1 +x_0=31500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# IGRS / UTM zone 37N
-<epsg3890> +proj=utm +zone=37 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# IGRS / UTM zone 38N
-<epsg3891> +proj=utm +zone=38 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# IGRS / UTM zone 39N
-<epsg3892> +proj=utm +zone=39 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ED50 / Iraq National Grid
-<epsg3893> +proj=tmerc +lat_0=29.02626833333333 +lon_0=46.5 +k=0.9994 +x_0=800000 +y_0=0 +ellps=intl +towgs84=-87,-98,-121,0,0,0,0 +units=m +no_defs  <>
-# MGI 1901 / Balkans zone 5
-<epsg3907> +proj=tmerc +lat_0=0 +lon_0=15 +k=0.9999 +x_0=5500000 +y_0=0 +ellps=bessel +towgs84=682,-203,480,0,0,0,0 +units=m +no_defs  <>
-# MGI 1901 / Balkans zone 6
-<epsg3908> +proj=tmerc +lat_0=0 +lon_0=18 +k=0.9999 +x_0=6500000 +y_0=0 +ellps=bessel +towgs84=682,-203,480,0,0,0,0 +units=m +no_defs  <>
-# MGI 1901 / Balkans zone 7
-<epsg3909> +proj=tmerc +lat_0=0 +lon_0=21 +k=0.9999 +x_0=7500000 +y_0=0 +ellps=bessel +towgs84=682,-203,480,0,0,0,0 +units=m +no_defs  <>
-# MGI 1901 / Balkans zone 8
-<epsg3910> +proj=tmerc +lat_0=0 +lon_0=24 +k=0.9999 +x_0=8500000 +y_0=0 +ellps=bessel +towgs84=682,-203,480,0,0,0,0 +units=m +no_defs  <>
-# MGI 1901 / Slovenia Grid
-<epsg3911> +proj=tmerc +lat_0=0 +lon_0=15 +k=0.9999 +x_0=500000 +y_0=0 +ellps=bessel +towgs84=682,-203,480,0,0,0,0 +units=m +no_defs  <>
-# MGI 1901 / Slovene National Grid
-<epsg3912> +proj=tmerc +lat_0=0 +lon_0=15 +k=0.9999 +x_0=500000 +y_0=-5000000 +ellps=bessel +towgs84=682,-203,480,0,0,0,0 +units=m +no_defs  <>
-# Puerto Rico / UTM zone 20N
-<epsg3920> +proj=utm +zone=20 +ellps=clrk66 +towgs84=11,72,-101,0,0,0,0 +units=m +no_defs  <>
-# RGF93 / CC42
-<epsg3942> +proj=lcc +lat_1=41.25 +lat_2=42.75 +lat_0=42 +lon_0=3 +x_0=1700000 +y_0=1200000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# RGF93 / CC43
-<epsg3943> +proj=lcc +lat_1=42.25 +lat_2=43.75 +lat_0=43 +lon_0=3 +x_0=1700000 +y_0=2200000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# RGF93 / CC44
-<epsg3944> +proj=lcc +lat_1=43.25 +lat_2=44.75 +lat_0=44 +lon_0=3 +x_0=1700000 +y_0=3200000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# RGF93 / CC45
-<epsg3945> +proj=lcc +lat_1=44.25 +lat_2=45.75 +lat_0=45 +lon_0=3 +x_0=1700000 +y_0=4200000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# RGF93 / CC46
-<epsg3946> +proj=lcc +lat_1=45.25 +lat_2=46.75 +lat_0=46 +lon_0=3 +x_0=1700000 +y_0=5200000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# RGF93 / CC47
-<epsg3947> +proj=lcc +lat_1=46.25 +lat_2=47.75 +lat_0=47 +lon_0=3 +x_0=1700000 +y_0=6200000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# RGF93 / CC48
-<epsg3948> +proj=lcc +lat_1=47.25 +lat_2=48.75 +lat_0=48 +lon_0=3 +x_0=1700000 +y_0=7200000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# RGF93 / CC49
-<epsg3949> +proj=lcc +lat_1=48.25 +lat_2=49.75 +lat_0=49 +lon_0=3 +x_0=1700000 +y_0=8200000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# RGF93 / CC50
-<epsg3950> +proj=lcc +lat_1=49.25 +lat_2=50.75 +lat_0=50 +lon_0=3 +x_0=1700000 +y_0=9200000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83 / Virginia Lambert
-<epsg3968> +proj=lcc +lat_1=37 +lat_2=39.5 +lat_0=36 +lon_0=-79.5 +x_0=0 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83(HARN) / Virginia Lambert
-<epsg3969> +proj=lcc +lat_1=37 +lat_2=39.5 +lat_0=36 +lon_0=-79.5 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / Virginia Lambert
-<epsg3970> +proj=lcc +lat_1=37 +lat_2=39.5 +lat_0=36 +lon_0=-79.5 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# WGS 84 / NSIDC EASE-Grid North
-<epsg3973> +proj=laea +lat_0=90 +lon_0=0 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / NSIDC EASE-Grid South
-<epsg3974> +proj=laea +lat_0=-90 +lon_0=0 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / NSIDC EASE-Grid Global
-<epsg3975> +proj=cea +lon_0=0 +lat_ts=30 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / NSIDC Sea Ice Polar Stereographic South
-<epsg3976> +proj=stere +lat_0=-90 +lat_ts=-70 +lon_0=0 +k=1 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs  <>
-# NAD83 / Canada Atlas Lambert
-<epsg3978> +proj=lcc +lat_1=49 +lat_2=77 +lat_0=49 +lon_0=-95 +x_0=0 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83(CSRS) / Canada Atlas Lambert
-<epsg3979> +proj=lcc +lat_1=49 +lat_2=77 +lat_0=49 +lon_0=-95 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# Katanga 1955 / Katanga Lambert (deprecated)
-<epsg3985> +proj=lcc +lat_1=-6.5 +lat_2=-11.5 +lat_0=9 +lon_0=26 +x_0=500000 +y_0=500000 +ellps=clrk66 +towgs84=-103.746,-9.614,-255.95,0,0,0,0 +units=m +no_defs  <>
-# Katanga 1955 / Katanga Gauss zone A
-<epsg3986> +proj=tmerc +lat_0=-9 +lon_0=30 +k=1 +x_0=200000 +y_0=500000 +ellps=clrk66 +towgs84=-103.746,-9.614,-255.95,0,0,0,0 +units=m +no_defs  <>
-# Katanga 1955 / Katanga Gauss zone B
-<epsg3987> +proj=tmerc +lat_0=-9 +lon_0=28 +k=1 +x_0=200000 +y_0=500000 +ellps=clrk66 +towgs84=-103.746,-9.614,-255.95,0,0,0,0 +units=m +no_defs  <>
-# Katanga 1955 / Katanga Gauss zone C
-<epsg3988> +proj=tmerc +lat_0=-9 +lon_0=26 +k=1 +x_0=200000 +y_0=500000 +ellps=clrk66 +towgs84=-103.746,-9.614,-255.95,0,0,0,0 +units=m +no_defs  <>
-# Katanga 1955 / Katanga Gauss zone D
-<epsg3989> +proj=tmerc +lat_0=-9 +lon_0=24 +k=1 +x_0=200000 +y_0=500000 +ellps=clrk66 +towgs84=-103.746,-9.614,-255.95,0,0,0,0 +units=m +no_defs  <>
-# Puerto Rico State Plane CS of 1927
-<epsg3991> +proj=lcc +lat_1=18.43333333333333 +lat_2=18.03333333333333 +lat_0=17.83333333333333 +lon_0=-66.43333333333334 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +towgs84=11,72,-101,0,0,0,0 +units=us-ft +no_defs  <>
-# Puerto Rico / St. Croix
-<epsg3992> +proj=lcc +lat_1=18.43333333333333 +lat_2=18.03333333333333 +lat_0=17.83333333333333 +lon_0=-66.43333333333334 +x_0=152400.3048006096 +y_0=30480.06096012192 +ellps=clrk66 +towgs84=11,72,-101,0,0,0,0 +units=us-ft +no_defs  <>
-# Guam 1963 / Guam SPCS
-# Unable to translate coordinate system EPSG:3993 into PROJ.4 format.
-#
-# WGS 84 / Mercator 41
-<epsg3994> +proj=merc +lon_0=100 +lat_ts=-41 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / Arctic Polar Stereographic
-<epsg3995> +proj=stere +lat_0=90 +lat_ts=71 +lon_0=0 +k=1 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / IBCAO Polar Stereographic
-<epsg3996> +proj=stere +lat_0=90 +lat_ts=75 +lon_0=0 +k=1 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / Dubai Local TM
-<epsg3997> +proj=tmerc +lat_0=0 +lon_0=55.33333333333334 +k=1 +x_0=500000 +y_0=0 +datum=WGS84 +units=m +no_defs  <>
-# MOLDREF99 / Moldova TM
-<epsg4026> +proj=tmerc +lat_0=0 +lon_0=28.4 +k=0.9999400000000001 +x_0=200000 +y_0=-5000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# WGS 84 / TMzn35N
-<epsg4037> +proj=utm +zone=35 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / TMzn36N
-<epsg4038> +proj=utm +zone=36 +datum=WGS84 +units=m +no_defs  <>
-# RGRDC 2005 / Congo TM zone 12
-<epsg4048> +proj=tmerc +lat_0=0 +lon_0=12 +k=0.9999 +x_0=500000 +y_0=10000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# RGRDC 2005 / Congo TM zone 14
-<epsg4049> +proj=tmerc +lat_0=0 +lon_0=14 +k=0.9999 +x_0=500000 +y_0=10000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# RGRDC 2005 / Congo TM zone 16
-<epsg4050> +proj=tmerc +lat_0=0 +lon_0=16 +k=0.9999 +x_0=500000 +y_0=10000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# RGRDC 2005 / Congo TM zone 18
-<epsg4051> +proj=tmerc +lat_0=0 +lon_0=18 +k=0.9999 +x_0=500000 +y_0=10000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# RGRDC 2005 / Congo TM zone 20
-<epsg4056> +proj=tmerc +lat_0=0 +lon_0=20 +k=0.9999 +x_0=500000 +y_0=10000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# RGRDC 2005 / Congo TM zone 22
-<epsg4057> +proj=tmerc +lat_0=0 +lon_0=22 +k=0.9999 +x_0=500000 +y_0=10000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# RGRDC 2005 / Congo TM zone 24
-<epsg4058> +proj=tmerc +lat_0=0 +lon_0=24 +k=0.9999 +x_0=500000 +y_0=10000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# RGRDC 2005 / Congo TM zone 26
-<epsg4059> +proj=tmerc +lat_0=0 +lon_0=26 +k=0.9999 +x_0=500000 +y_0=10000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# RGRDC 2005 / Congo TM zone 28
-<epsg4060> +proj=tmerc +lat_0=0 +lon_0=28 +k=0.9999 +x_0=500000 +y_0=10000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# RGRDC 2005 / UTM zone 33S
-<epsg4061> +proj=utm +zone=33 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# RGRDC 2005 / UTM zone 34S
-<epsg4062> +proj=utm +zone=34 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# RGRDC 2005 / UTM zone 35S
-<epsg4063> +proj=utm +zone=35 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# Chua / UTM zone 23S
-<epsg4071> +proj=utm +zone=23 +south +ellps=intl +towgs84=-134,229,-29,0,0,0,0 +units=m +no_defs  <>
-# REGCAN95 / UTM zone 27N
-<epsg4082> +proj=utm +zone=27 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# REGCAN95 / UTM zone 28N
-<epsg4083> +proj=utm +zone=28 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# WGS 84 / World Equidistant Cylindrical
-# Unable to translate coordinate system EPSG:4087 into PROJ.4 format.
-#
-# World Equidistant Cylindrical (Sphere)
-# Unable to translate coordinate system EPSG:4088 into PROJ.4 format.
-#
-# ETRS89 / DKTM1
-<epsg4093> +proj=tmerc +lat_0=0 +lon_0=9 +k=0.99998 +x_0=200000 +y_0=-5000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ETRS89 / DKTM2
-<epsg4094> +proj=tmerc +lat_0=0 +lon_0=10 +k=0.99998 +x_0=400000 +y_0=-5000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ETRS89 / DKTM3
-<epsg4095> +proj=tmerc +lat_0=0 +lon_0=11.75 +k=0.99998 +x_0=600000 +y_0=-5000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ETRS89 / DKTM4
-<epsg4096> +proj=tmerc +lat_0=0 +lon_0=15 +k=1 +x_0=800000 +y_0=-5000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83 / BLM 59N (ftUS)
-<epsg4217> +proj=tmerc +lat_0=0 +lon_0=171 +k=0.9996 +x_0=500000.001016002 +y_0=0 +datum=NAD83 +units=us-ft +no_defs  <>
-# NAD27 / BLM 59N (ftUS)
-<epsg4399> +proj=tmerc +lat_0=0 +lon_0=171 +k=0.9996 +x_0=500000.001016002 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / BLM 60N (ftUS)
-<epsg4400> +proj=tmerc +lat_0=0 +lon_0=177 +k=0.9996 +x_0=500000.001016002 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / BLM 1N (ftUS)
-<epsg4401> +proj=tmerc +lat_0=0 +lon_0=-177 +k=0.9996 +x_0=500000.001016002 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / BLM 2N (ftUS)
-<epsg4402> +proj=tmerc +lat_0=0 +lon_0=-171 +k=0.9996 +x_0=500000.001016002 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / BLM 3N (ftUS)
-<epsg4403> +proj=tmerc +lat_0=0 +lon_0=-165 +k=0.9996 +x_0=500000.001016002 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / BLM 4N (ftUS)
-<epsg4404> +proj=tmerc +lat_0=0 +lon_0=-159 +k=0.9996 +x_0=500000.001016002 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / BLM 5N (ftUS)
-<epsg4405> +proj=tmerc +lat_0=0 +lon_0=-153 +k=0.9996 +x_0=500000.001016002 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / BLM 6N (ftUS)
-<epsg4406> +proj=tmerc +lat_0=0 +lon_0=-147 +k=0.9996 +x_0=500000.001016002 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / BLM 7N (ftUS)
-<epsg4407> +proj=tmerc +lat_0=0 +lon_0=-141 +k=0.9996 +x_0=500000.001016002 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / BLM 8N (ftUS)
-<epsg4408> +proj=tmerc +lat_0=0 +lon_0=-135 +k=0.9996 +x_0=500000.001016002 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / BLM 9N (ftUS)
-<epsg4409> +proj=tmerc +lat_0=0 +lon_0=-129 +k=0.9996 +x_0=500000.001016002 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / BLM 10N (ftUS)
-<epsg4410> +proj=tmerc +lat_0=0 +lon_0=-123 +k=0.9996 +x_0=500000.001016002 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / BLM 11N (ftUS)
-<epsg4411> +proj=tmerc +lat_0=0 +lon_0=-117 +k=0.9996 +x_0=500000.001016002 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / BLM 12N (ftUS)
-<epsg4412> +proj=tmerc +lat_0=0 +lon_0=-111 +k=0.9996 +x_0=500000.001016002 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / BLM 13N (ftUS)
-<epsg4413> +proj=tmerc +lat_0=0 +lon_0=-105 +k=0.9996 +x_0=500000.001016002 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD83(HARN) / Guam Map Grid
-<epsg4414> +proj=tmerc +lat_0=13.5 +lon_0=144.75 +k=1 +x_0=100000 +y_0=200000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# Katanga 1955 / Katanga Lambert
-<epsg4415> +proj=lcc +lat_1=-6.5 +lat_2=-11.5 +lat_0=-9 +lon_0=26 +x_0=500000 +y_0=500000 +ellps=clrk66 +towgs84=-103.746,-9.614,-255.95,0,0,0,0 +units=m +no_defs  <>
-# Pulkovo 1942(83) / 3-degree Gauss-Kruger zone 7
-<epsg4417> +proj=tmerc +lat_0=0 +lon_0=21 +k=1 +x_0=7500000 +y_0=0 +ellps=krass +towgs84=26,-121,-78,0,0,0,0 +units=m +no_defs  <>
-# NAD27 / BLM 18N (ftUS)
-<epsg4418> +proj=tmerc +lat_0=0 +lon_0=-75 +k=0.9996 +x_0=500000.001016002 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / BLM 19N (ftUS)
-<epsg4419> +proj=tmerc +lat_0=0 +lon_0=-69 +k=0.9996 +x_0=500000.001016002 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD83 / BLM 60N (ftUS)
-<epsg4420> +proj=tmerc +lat_0=0 +lon_0=177 +k=0.9996 +x_0=500000.001016002 +y_0=0 +datum=NAD83 +units=us-ft +no_defs  <>
-# NAD83 / BLM 1N (ftUS)
-<epsg4421> +proj=tmerc +lat_0=0 +lon_0=-177 +k=0.9996 +x_0=500000.001016002 +y_0=0 +datum=NAD83 +units=us-ft +no_defs  <>
-# NAD83 / BLM 2N (ftUS)
-<epsg4422> +proj=tmerc +lat_0=0 +lon_0=-171 +k=0.9996 +x_0=500000.001016002 +y_0=0 +datum=NAD83 +units=us-ft +no_defs  <>
-# NAD83 / BLM 3N (ftUS)
-<epsg4423> +proj=tmerc +lat_0=0 +lon_0=-165 +k=0.9996 +x_0=500000.001016002 +y_0=0 +datum=NAD83 +units=us-ft +no_defs  <>
-# NAD83 / BLM 4N (ftUS)
-<epsg4424> +proj=tmerc +lat_0=0 +lon_0=-159 +k=0.9996 +x_0=500000.001016002 +y_0=0 +datum=NAD83 +units=us-ft +no_defs  <>
-# NAD83 / BLM 5N (ftUS)
-<epsg4425> +proj=tmerc +lat_0=0 +lon_0=-153 +k=0.9996 +x_0=500000.001016002 +y_0=0 +datum=NAD83 +units=us-ft +no_defs  <>
-# NAD83 / BLM 6N (ftUS)
-<epsg4426> +proj=tmerc +lat_0=0 +lon_0=-147 +k=0.9996 +x_0=500000.001016002 +y_0=0 +datum=NAD83 +units=us-ft +no_defs  <>
-# NAD83 / BLM 7N (ftUS)
-<epsg4427> +proj=tmerc +lat_0=0 +lon_0=-141 +k=0.9996 +x_0=500000.001016002 +y_0=0 +datum=NAD83 +units=us-ft +no_defs  <>
-# NAD83 / BLM 8N (ftUS)
-<epsg4428> +proj=tmerc +lat_0=0 +lon_0=-135 +k=0.9996 +x_0=500000.001016002 +y_0=0 +datum=NAD83 +units=us-ft +no_defs  <>
-# NAD83 / BLM 9N (ftUS)
-<epsg4429> +proj=tmerc +lat_0=0 +lon_0=-129 +k=0.9996 +x_0=500000.001016002 +y_0=0 +datum=NAD83 +units=us-ft +no_defs  <>
-# NAD83 / BLM 10N (ftUS)
-<epsg4430> +proj=tmerc +lat_0=0 +lon_0=-123 +k=0.9996 +x_0=500000.001016002 +y_0=0 +datum=NAD83 +units=us-ft +no_defs  <>
-# NAD83 / BLM 11N (ftUS)
-<epsg4431> +proj=tmerc +lat_0=0 +lon_0=-117 +k=0.9996 +x_0=500000.001016002 +y_0=0 +datum=NAD83 +units=us-ft +no_defs  <>
-# NAD83 / BLM 12N (ftUS)
-<epsg4432> +proj=tmerc +lat_0=0 +lon_0=-111 +k=0.9996 +x_0=500000.001016002 +y_0=0 +datum=NAD83 +units=us-ft +no_defs  <>
-# NAD83 / BLM 13N (ftUS)
-<epsg4433> +proj=tmerc +lat_0=0 +lon_0=-105 +k=0.9996 +x_0=500000.001016002 +y_0=0 +datum=NAD83 +units=us-ft +no_defs  <>
-# Pulkovo 1942(83) / 3-degree Gauss-Kruger zone 8
-<epsg4434> +proj=tmerc +lat_0=0 +lon_0=24 +k=1 +x_0=8500000 +y_0=0 +ellps=krass +towgs84=26,-121,-78,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / Puerto Rico and Virgin Is.
-<epsg4437> +proj=lcc +lat_1=18.43333333333333 +lat_2=18.03333333333333 +lat_0=17.83333333333333 +lon_0=-66.43333333333334 +x_0=200000 +y_0=200000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83 / BLM 18N (ftUS)
-<epsg4438> +proj=tmerc +lat_0=0 +lon_0=-75 +k=0.9996 +x_0=500000.001016002 +y_0=0 +datum=NAD83 +units=us-ft +no_defs  <>
-# NAD83 / BLM 19N (ftUS)
-<epsg4439> +proj=tmerc +lat_0=0 +lon_0=-69 +k=0.9996 +x_0=500000.001016002 +y_0=0 +datum=NAD83 +units=us-ft +no_defs  <>
-# NAD27 / Pennsylvania South
-<epsg4455> +proj=lcc +lat_1=40.96666666666667 +lat_2=39.93333333333333 +lat_0=39.33333333333334 +lon_0=-77.75 +x_0=609601.2192024384 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / New York Long Island
-<epsg4456> +proj=lcc +lat_1=41.03333333333333 +lat_2=40.66666666666666 +lat_0=40.5 +lon_0=-74 +x_0=609601.2192024384 +y_0=30480.06096012192 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD83 / South Dakota North (ftUS)
-<epsg4457> +proj=lcc +lat_1=45.68333333333333 +lat_2=44.41666666666666 +lat_0=43.83333333333334 +lon_0=-100 +x_0=600000 +y_0=0 +datum=NAD83 +units=us-ft +no_defs  <>
-# WGS 84 / Australian Centre for Remote Sensing Lambert
-<epsg4462> +proj=lcc +lat_1=-18 +lat_2=-36 +lat_0=-27 +lon_0=132 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs  <>
-# RGSPM06 / UTM zone 21N
-<epsg4467> +proj=utm +zone=21 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# RGM04 / UTM zone 38S
-<epsg4471> +proj=utm +zone=38 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# Cadastre 1997 / UTM zone 38S
-<epsg4474> +proj=utm +zone=38 +south +ellps=intl +towgs84=-382,-59,-262,0,0,0,0 +units=m +no_defs  <>
-# Mexican Datum of 1993 / UTM zone 11N
-<epsg4484> +proj=utm +zone=11 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# Mexican Datum of 1993 / UTM zone 12N
-<epsg4485> +proj=utm +zone=12 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# Mexican Datum of 1993 / UTM zone 13N
-<epsg4486> +proj=utm +zone=13 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# Mexican Datum of 1993 / UTM zone 14N
-<epsg4487> +proj=utm +zone=14 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# Mexican Datum of 1993 / UTM zone 15N
-<epsg4488> +proj=utm +zone=15 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# Mexican Datum of 1993 / UTM zone 16N
-<epsg4489> +proj=utm +zone=16 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# CGCS2000 / Gauss-Kruger zone 13
-<epsg4491> +proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=13500000 +y_0=0 +ellps=GRS80 +units=m +no_defs  <>
-# CGCS2000 / Gauss-Kruger zone 14
-<epsg4492> +proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=14500000 +y_0=0 +ellps=GRS80 +units=m +no_defs  <>
-# CGCS2000 / Gauss-Kruger zone 15
-<epsg4493> +proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=15500000 +y_0=0 +ellps=GRS80 +units=m +no_defs  <>
-# CGCS2000 / Gauss-Kruger zone 16
-<epsg4494> +proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=16500000 +y_0=0 +ellps=GRS80 +units=m +no_defs  <>
-# CGCS2000 / Gauss-Kruger zone 17
-<epsg4495> +proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=17500000 +y_0=0 +ellps=GRS80 +units=m +no_defs  <>
-# CGCS2000 / Gauss-Kruger zone 18
-<epsg4496> +proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=18500000 +y_0=0 +ellps=GRS80 +units=m +no_defs  <>
-# CGCS2000 / Gauss-Kruger zone 19
-<epsg4497> +proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=19500000 +y_0=0 +ellps=GRS80 +units=m +no_defs  <>
-# CGCS2000 / Gauss-Kruger zone 20
-<epsg4498> +proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=20500000 +y_0=0 +ellps=GRS80 +units=m +no_defs  <>
-# CGCS2000 / Gauss-Kruger zone 21
-<epsg4499> +proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=21500000 +y_0=0 +ellps=GRS80 +units=m +no_defs  <>
-# CGCS2000 / Gauss-Kruger zone 22
-<epsg4500> +proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=22500000 +y_0=0 +ellps=GRS80 +units=m +no_defs  <>
-# CGCS2000 / Gauss-Kruger zone 23
-<epsg4501> +proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=23500000 +y_0=0 +ellps=GRS80 +units=m +no_defs  <>
-# CGCS2000 / Gauss-Kruger CM 75E
-<epsg4502> +proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs  <>
-# CGCS2000 / Gauss-Kruger CM 81E
-<epsg4503> +proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs  <>
-# CGCS2000 / Gauss-Kruger CM 87E
-<epsg4504> +proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs  <>
-# CGCS2000 / Gauss-Kruger CM 93E
-<epsg4505> +proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs  <>
-# CGCS2000 / Gauss-Kruger CM 99E
-<epsg4506> +proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs  <>
-# CGCS2000 / Gauss-Kruger CM 105E
-<epsg4507> +proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs  <>
-# CGCS2000 / Gauss-Kruger CM 111E
-<epsg4508> +proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs  <>
-# CGCS2000 / Gauss-Kruger CM 117E
-<epsg4509> +proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs  <>
-# CGCS2000 / Gauss-Kruger CM 123E
-<epsg4510> +proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs  <>
-# CGCS2000 / Gauss-Kruger CM 129E
-<epsg4511> +proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs  <>
-# CGCS2000 / Gauss-Kruger CM 135E
-<epsg4512> +proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs  <>
-# CGCS2000 / 3-degree Gauss-Kruger zone 25
-<epsg4513> +proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=25500000 +y_0=0 +ellps=GRS80 +units=m +no_defs  <>
-# CGCS2000 / 3-degree Gauss-Kruger zone 26
-<epsg4514> +proj=tmerc +lat_0=0 +lon_0=78 +k=1 +x_0=26500000 +y_0=0 +ellps=GRS80 +units=m +no_defs  <>
-# CGCS2000 / 3-degree Gauss-Kruger zone 27
-<epsg4515> +proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=27500000 +y_0=0 +ellps=GRS80 +units=m +no_defs  <>
-# CGCS2000 / 3-degree Gauss-Kruger zone 28
-<epsg4516> +proj=tmerc +lat_0=0 +lon_0=84 +k=1 +x_0=28500000 +y_0=0 +ellps=GRS80 +units=m +no_defs  <>
-# CGCS2000 / 3-degree Gauss-Kruger zone 29
-<epsg4517> +proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=29500000 +y_0=0 +ellps=GRS80 +units=m +no_defs  <>
-# CGCS2000 / 3-degree Gauss-Kruger zone 30
-<epsg4518> +proj=tmerc +lat_0=0 +lon_0=90 +k=1 +x_0=30500000 +y_0=0 +ellps=GRS80 +units=m +no_defs  <>
-# CGCS2000 / 3-degree Gauss-Kruger zone 31
-<epsg4519> +proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=31500000 +y_0=0 +ellps=GRS80 +units=m +no_defs  <>
-# CGCS2000 / 3-degree Gauss-Kruger zone 32
-<epsg4520> +proj=tmerc +lat_0=0 +lon_0=96 +k=1 +x_0=32500000 +y_0=0 +ellps=GRS80 +units=m +no_defs  <>
-# CGCS2000 / 3-degree Gauss-Kruger zone 33
-<epsg4521> +proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=33500000 +y_0=0 +ellps=GRS80 +units=m +no_defs  <>
-# CGCS2000 / 3-degree Gauss-Kruger zone 34
-<epsg4522> +proj=tmerc +lat_0=0 +lon_0=102 +k=1 +x_0=34500000 +y_0=0 +ellps=GRS80 +units=m +no_defs  <>
-# CGCS2000 / 3-degree Gauss-Kruger zone 35
-<epsg4523> +proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=35500000 +y_0=0 +ellps=GRS80 +units=m +no_defs  <>
-# CGCS2000 / 3-degree Gauss-Kruger zone 36
-<epsg4524> +proj=tmerc +lat_0=0 +lon_0=108 +k=1 +x_0=36500000 +y_0=0 +ellps=GRS80 +units=m +no_defs  <>
-# CGCS2000 / 3-degree Gauss-Kruger zone 37
-<epsg4525> +proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=37500000 +y_0=0 +ellps=GRS80 +units=m +no_defs  <>
-# CGCS2000 / 3-degree Gauss-Kruger zone 38
-<epsg4526> +proj=tmerc +lat_0=0 +lon_0=114 +k=1 +x_0=38500000 +y_0=0 +ellps=GRS80 +units=m +no_defs  <>
-# CGCS2000 / 3-degree Gauss-Kruger zone 39
-<epsg4527> +proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=39500000 +y_0=0 +ellps=GRS80 +units=m +no_defs  <>
-# CGCS2000 / 3-degree Gauss-Kruger zone 40
-<epsg4528> +proj=tmerc +lat_0=0 +lon_0=120 +k=1 +x_0=40500000 +y_0=0 +ellps=GRS80 +units=m +no_defs  <>
-# CGCS2000 / 3-degree Gauss-Kruger zone 41
-<epsg4529> +proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=41500000 +y_0=0 +ellps=GRS80 +units=m +no_defs  <>
-# CGCS2000 / 3-degree Gauss-Kruger zone 42
-<epsg4530> +proj=tmerc +lat_0=0 +lon_0=126 +k=1 +x_0=42500000 +y_0=0 +ellps=GRS80 +units=m +no_defs  <>
-# CGCS2000 / 3-degree Gauss-Kruger zone 43
-<epsg4531> +proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=43500000 +y_0=0 +ellps=GRS80 +units=m +no_defs  <>
-# CGCS2000 / 3-degree Gauss-Kruger zone 44
-<epsg4532> +proj=tmerc +lat_0=0 +lon_0=132 +k=1 +x_0=44500000 +y_0=0 +ellps=GRS80 +units=m +no_defs  <>
-# CGCS2000 / 3-degree Gauss-Kruger zone 45
-<epsg4533> +proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=45500000 +y_0=0 +ellps=GRS80 +units=m +no_defs  <>
-# CGCS2000 / 3-degree Gauss-Kruger CM 75E
-<epsg4534> +proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs  <>
-# CGCS2000 / 3-degree Gauss-Kruger CM 78E
-<epsg4535> +proj=tmerc +lat_0=0 +lon_0=78 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs  <>
-# CGCS2000 / 3-degree Gauss-Kruger CM 81E
-<epsg4536> +proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs  <>
-# CGCS2000 / 3-degree Gauss-Kruger CM 84E
-<epsg4537> +proj=tmerc +lat_0=0 +lon_0=84 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs  <>
-# CGCS2000 / 3-degree Gauss-Kruger CM 87E
-<epsg4538> +proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs  <>
-# CGCS2000 / 3-degree Gauss-Kruger CM 90E
-<epsg4539> +proj=tmerc +lat_0=0 +lon_0=90 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs  <>
-# CGCS2000 / 3-degree Gauss-Kruger CM 93E
-<epsg4540> +proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs  <>
-# CGCS2000 / 3-degree Gauss-Kruger CM 96E
-<epsg4541> +proj=tmerc +lat_0=0 +lon_0=96 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs  <>
-# CGCS2000 / 3-degree Gauss-Kruger CM 99E
-<epsg4542> +proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs  <>
-# CGCS2000 / 3-degree Gauss-Kruger CM 102E
-<epsg4543> +proj=tmerc +lat_0=0 +lon_0=102 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs  <>
-# CGCS2000 / 3-degree Gauss-Kruger CM 105E
-<epsg4544> +proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs  <>
-# CGCS2000 / 3-degree Gauss-Kruger CM 108E
-<epsg4545> +proj=tmerc +lat_0=0 +lon_0=108 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs  <>
-# CGCS2000 / 3-degree Gauss-Kruger CM 111E
-<epsg4546> +proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs  <>
-# CGCS2000 / 3-degree Gauss-Kruger CM 114E
-<epsg4547> +proj=tmerc +lat_0=0 +lon_0=114 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs  <>
-# CGCS2000 / 3-degree Gauss-Kruger CM 117E
-<epsg4548> +proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs  <>
-# CGCS2000 / 3-degree Gauss-Kruger CM 120E
-<epsg4549> +proj=tmerc +lat_0=0 +lon_0=120 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs  <>
-# CGCS2000 / 3-degree Gauss-Kruger CM 123E
-<epsg4550> +proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs  <>
-# CGCS2000 / 3-degree Gauss-Kruger CM 126E
-<epsg4551> +proj=tmerc +lat_0=0 +lon_0=126 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs  <>
-# CGCS2000 / 3-degree Gauss-Kruger CM 129E
-<epsg4552> +proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs  <>
-# CGCS2000 / 3-degree Gauss-Kruger CM 132E
-<epsg4553> +proj=tmerc +lat_0=0 +lon_0=132 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs  <>
-# CGCS2000 / 3-degree Gauss-Kruger CM 135E
-<epsg4554> +proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs  <>
-# RRAF 1991 / UTM zone 20N
-<epsg4559> +proj=utm +zone=20 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# New Beijing / Gauss-Kruger zone 13
-<epsg4568> +proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=13500000 +y_0=0 +ellps=krass +units=m +no_defs  <>
-# New Beijing / Gauss-Kruger zone 14
-<epsg4569> +proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=14500000 +y_0=0 +ellps=krass +units=m +no_defs  <>
-# New Beijing / Gauss-Kruger zone 15
-<epsg4570> +proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=15500000 +y_0=0 +ellps=krass +units=m +no_defs  <>
-# New Beijing / Gauss-Kruger zone 16
-<epsg4571> +proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=16500000 +y_0=0 +ellps=krass +units=m +no_defs  <>
-# New Beijing / Gauss-Kruger zone 17
-<epsg4572> +proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=17500000 +y_0=0 +ellps=krass +units=m +no_defs  <>
-# New Beijing / Gauss-Kruger zone 18
-<epsg4573> +proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=18500000 +y_0=0 +ellps=krass +units=m +no_defs  <>
-# New Beijing / Gauss-Kruger zone 19
-<epsg4574> +proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=19500000 +y_0=0 +ellps=krass +units=m +no_defs  <>
-# New Beijing / Gauss-Kruger zone 20
-<epsg4575> +proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=20500000 +y_0=0 +ellps=krass +units=m +no_defs  <>
-# New Beijing / Gauss-Kruger zone 21
-<epsg4576> +proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=21500000 +y_0=0 +ellps=krass +units=m +no_defs  <>
-# New Beijing / Gauss-Kruger zone 22
-<epsg4577> +proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=22500000 +y_0=0 +ellps=krass +units=m +no_defs  <>
-# New Beijing / Gauss-Kruger zone 23
-<epsg4578> +proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=23500000 +y_0=0 +ellps=krass +units=m +no_defs  <>
-# New Beijing / Gauss-Kruger CM 75E
-<epsg4579> +proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  <>
-# New Beijing / Gauss-Kruger CM 81E
-<epsg4580> +proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  <>
-# New Beijing / Gauss-Kruger CM 87E
-<epsg4581> +proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  <>
-# New Beijing / Gauss-Kruger CM 93E
-<epsg4582> +proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  <>
-# New Beijing / Gauss-Kruger CM 99E
-<epsg4583> +proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  <>
-# New Beijing / Gauss-Kruger CM 105E
-<epsg4584> +proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  <>
-# New Beijing / Gauss-Kruger CM 111E
-<epsg4585> +proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  <>
-# New Beijing / Gauss-Kruger CM 117E
-<epsg4586> +proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  <>
-# New Beijing / Gauss-Kruger CM 123E
-<epsg4587> +proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  <>
-# New Beijing / Gauss-Kruger CM 129E
-<epsg4588> +proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  <>
-# New Beijing / Gauss-Kruger CM 135E
-<epsg4589> +proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  <>
-# ETRS89 / UTM zone N32
-<epsg4647> +proj=tmerc +lat_0=0 +lon_0=9 +k=0.9996 +x_0=32500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# New Beijing / 3-degree Gauss-Kruger zone 25
-<epsg4652> +proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=25500000 +y_0=0 +ellps=krass +units=m +no_defs  <>
-# New Beijing / 3-degree Gauss-Kruger zone 26
-<epsg4653> +proj=tmerc +lat_0=0 +lon_0=78 +k=1 +x_0=26500000 +y_0=0 +ellps=krass +units=m +no_defs  <>
-# New Beijing / 3-degree Gauss-Kruger zone 27
-<epsg4654> +proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=27500000 +y_0=0 +ellps=krass +units=m +no_defs  <>
-# New Beijing / 3-degree Gauss-Kruger zone 28
-<epsg4655> +proj=tmerc +lat_0=0 +lon_0=84 +k=1 +x_0=28500000 +y_0=0 +ellps=krass +units=m +no_defs  <>
-# New Beijing / 3-degree Gauss-Kruger zone 29
-<epsg4656> +proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=29500000 +y_0=0 +ellps=krass +units=m +no_defs  <>
-# New Beijing / 3-degree Gauss-Kruger zone 30
-<epsg4766> +proj=tmerc +lat_0=0 +lon_0=90 +k=1 +x_0=30500000 +y_0=0 +ellps=krass +units=m +no_defs  <>
-# New Beijing / 3-degree Gauss-Kruger zone 31
-<epsg4767> +proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=31500000 +y_0=0 +ellps=krass +units=m +no_defs  <>
-# New Beijing / 3-degree Gauss-Kruger zone 32
-<epsg4768> +proj=tmerc +lat_0=0 +lon_0=96 +k=1 +x_0=32500000 +y_0=0 +ellps=krass +units=m +no_defs  <>
-# New Beijing / 3-degree Gauss-Kruger zone 33
-<epsg4769> +proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=33500000 +y_0=0 +ellps=krass +units=m +no_defs  <>
-# New Beijing / 3-degree Gauss-Kruger zone 34
-<epsg4770> +proj=tmerc +lat_0=0 +lon_0=102 +k=1 +x_0=34500000 +y_0=0 +ellps=krass +units=m +no_defs  <>
-# New Beijing / 3-degree Gauss-Kruger zone 35
-<epsg4771> +proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=35500000 +y_0=0 +ellps=krass +units=m +no_defs  <>
-# New Beijing / 3-degree Gauss-Kruger zone 36
-<epsg4772> +proj=tmerc +lat_0=0 +lon_0=108 +k=1 +x_0=36500000 +y_0=0 +ellps=krass +units=m +no_defs  <>
-# New Beijing / 3-degree Gauss-Kruger zone 37
-<epsg4773> +proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=37500000 +y_0=0 +ellps=krass +units=m +no_defs  <>
-# New Beijing / 3-degree Gauss-Kruger zone 38
-<epsg4774> +proj=tmerc +lat_0=0 +lon_0=114 +k=1 +x_0=38500000 +y_0=0 +ellps=krass +units=m +no_defs  <>
-# New Beijing / 3-degree Gauss-Kruger zone 39
-<epsg4775> +proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=39500000 +y_0=0 +ellps=krass +units=m +no_defs  <>
-# New Beijing / 3-degree Gauss-Kruger zone 40
-<epsg4776> +proj=tmerc +lat_0=0 +lon_0=120 +k=1 +x_0=40500000 +y_0=0 +ellps=krass +units=m +no_defs  <>
-# New Beijing / 3-degree Gauss-Kruger zone 41
-<epsg4777> +proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=41500000 +y_0=0 +ellps=krass +units=m +no_defs  <>
-# New Beijing / 3-degree Gauss-Kruger zone 42
-<epsg4778> +proj=tmerc +lat_0=0 +lon_0=126 +k=1 +x_0=42500000 +y_0=0 +ellps=krass +units=m +no_defs  <>
-# New Beijing / 3-degree Gauss-Kruger zone 43
-<epsg4779> +proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=43500000 +y_0=0 +ellps=krass +units=m +no_defs  <>
-# New Beijing / 3-degree Gauss-Kruger zone 44
-<epsg4780> +proj=tmerc +lat_0=0 +lon_0=132 +k=1 +x_0=44500000 +y_0=0 +ellps=krass +units=m +no_defs  <>
-# New Beijing / 3-degree Gauss-Kruger zone 45
-<epsg4781> +proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=45500000 +y_0=0 +ellps=krass +units=m +no_defs  <>
-# New Beijing / 3-degree Gauss-Kruger CM 75E
-<epsg4782> +proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  <>
-# New Beijing / 3-degree Gauss-Kruger CM 78E
-<epsg4783> +proj=tmerc +lat_0=0 +lon_0=78 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  <>
-# New Beijing / 3-degree Gauss-Kruger CM 81E
-<epsg4784> +proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  <>
-# New Beijing / 3-degree Gauss-Kruger CM 84E
-<epsg4785> +proj=tmerc +lat_0=0 +lon_0=84 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  <>
-# New Beijing / 3-degree Gauss-Kruger CM 87E
-<epsg4786> +proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  <>
-# New Beijing / 3-degree Gauss-Kruger CM 90E
-<epsg4787> +proj=tmerc +lat_0=0 +lon_0=90 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  <>
-# New Beijing / 3-degree Gauss-Kruger CM 93E
-<epsg4788> +proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  <>
-# New Beijing / 3-degree Gauss-Kruger CM 96E
-<epsg4789> +proj=tmerc +lat_0=0 +lon_0=96 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  <>
-# New Beijing / 3-degree Gauss-Kruger CM 99E
-<epsg4790> +proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  <>
-# New Beijing / 3-degree Gauss-Kruger CM 102E
-<epsg4791> +proj=tmerc +lat_0=0 +lon_0=102 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  <>
-# New Beijing / 3-degree Gauss-Kruger CM 105E
-<epsg4792> +proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  <>
-# New Beijing / 3-degree Gauss-Kruger CM 108E
-<epsg4793> +proj=tmerc +lat_0=0 +lon_0=108 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  <>
-# New Beijing / 3-degree Gauss-Kruger CM 111E
-<epsg4794> +proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  <>
-# New Beijing / 3-degree Gauss-Kruger CM 114E
-<epsg4795> +proj=tmerc +lat_0=0 +lon_0=114 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  <>
-# New Beijing / 3-degree Gauss-Kruger CM 117E
-<epsg4796> +proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  <>
-# New Beijing / 3-degree Gauss-Kruger CM 120E
-<epsg4797> +proj=tmerc +lat_0=0 +lon_0=120 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  <>
-# New Beijing / 3-degree Gauss-Kruger CM 123E
-<epsg4798> +proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  <>
-# New Beijing / 3-degree Gauss-Kruger CM 126E
-<epsg4799> +proj=tmerc +lat_0=0 +lon_0=126 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  <>
-# New Beijing / 3-degree Gauss-Kruger CM 129E
-<epsg4800> +proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  <>
-# New Beijing / 3-degree Gauss-Kruger CM 132E
-<epsg4812> +proj=tmerc +lat_0=0 +lon_0=132 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  <>
-# New Beijing / 3-degree Gauss-Kruger CM 135E
-<epsg4822> +proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  <>
-# WGS 84 / Cape Verde National
-<epsg4826> +proj=lcc +lat_1=15 +lat_2=16.66666666666667 +lat_0=15.83333333333333 +lon_0=-24 +x_0=161587.83 +y_0=128511.202 +datum=WGS84 +units=m +no_defs  <>
-# ETRS89 / LCC Germany (N-E)
-<epsg4839> +proj=lcc +lat_1=48.66666666666666 +lat_2=53.66666666666666 +lat_0=51 +lon_0=10.5 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ETRS89 / NTM zone 5 (deprecated)
-<epsg4855> +proj=tmerc +lat_0=0 +lon_0=5.5 +k=1 +x_0=100000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ETRS89 / NTM zone 6 (deprecated)
-<epsg4856> +proj=tmerc +lat_0=0 +lon_0=6.5 +k=1 +x_0=100000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ETRS89 / NTM zone 7 (deprecated)
-<epsg4857> +proj=tmerc +lat_0=0 +lon_0=7.5 +k=1 +x_0=100000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ETRS89 / NTM zone 8 (deprecated)
-<epsg4858> +proj=tmerc +lat_0=0 +lon_0=8.5 +k=1 +x_0=100000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ETRS89 / NTM zone 9 (deprecated)
-<epsg4859> +proj=tmerc +lat_0=0 +lon_0=9.5 +k=1 +x_0=100000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ETRS89 / NTM zone 10 (deprecated)
-<epsg4860> +proj=tmerc +lat_0=0 +lon_0=10.5 +k=1 +x_0=100000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ETRS89 / NTM zone 11 (deprecated)
-<epsg4861> +proj=tmerc +lat_0=0 +lon_0=11.5 +k=1 +x_0=100000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ETRS89 / NTM zone 12 (deprecated)
-<epsg4862> +proj=tmerc +lat_0=0 +lon_0=12.5 +k=1 +x_0=100000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ETRS89 / NTM zone 13 (deprecated)
-<epsg4863> +proj=tmerc +lat_0=0 +lon_0=13.5 +k=1 +x_0=100000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ETRS89 / NTM zone 14 (deprecated)
-<epsg4864> +proj=tmerc +lat_0=0 +lon_0=14.5 +k=1 +x_0=100000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ETRS89 / NTM zone 15 (deprecated)
-<epsg4865> +proj=tmerc +lat_0=0 +lon_0=15.5 +k=1 +x_0=100000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ETRS89 / NTM zone 16 (deprecated)
-<epsg4866> +proj=tmerc +lat_0=0 +lon_0=16.5 +k=1 +x_0=100000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ETRS89 / NTM zone 17 (deprecated)
-<epsg4867> +proj=tmerc +lat_0=0 +lon_0=17.5 +k=1 +x_0=100000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ETRS89 / NTM zone 18 (deprecated)
-<epsg4868> +proj=tmerc +lat_0=0 +lon_0=18.5 +k=1 +x_0=100000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ETRS89 / NTM zone 19 (deprecated)
-<epsg4869> +proj=tmerc +lat_0=0 +lon_0=19.5 +k=1 +x_0=100000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ETRS89 / NTM zone 20 (deprecated)
-<epsg4870> +proj=tmerc +lat_0=0 +lon_0=20.5 +k=1 +x_0=100000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ETRS89 / NTM zone 21 (deprecated)
-<epsg4871> +proj=tmerc +lat_0=0 +lon_0=21.5 +k=1 +x_0=100000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ETRS89 / NTM zone 22 (deprecated)
-<epsg4872> +proj=tmerc +lat_0=0 +lon_0=22.5 +k=1 +x_0=100000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ETRS89 / NTM zone 23 (deprecated)
-<epsg4873> +proj=tmerc +lat_0=0 +lon_0=23.5 +k=1 +x_0=100000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ETRS89 / NTM zone 24 (deprecated)
-<epsg4874> +proj=tmerc +lat_0=0 +lon_0=24.5 +k=1 +x_0=100000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ETRS89 / NTM zone 25 (deprecated)
-<epsg4875> +proj=tmerc +lat_0=0 +lon_0=25.5 +k=1 +x_0=100000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ETRS89 / NTM zone 26 (deprecated)
-<epsg4876> +proj=tmerc +lat_0=0 +lon_0=26.5 +k=1 +x_0=100000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ETRS89 / NTM zone 27 (deprecated)
-<epsg4877> +proj=tmerc +lat_0=0 +lon_0=27.5 +k=1 +x_0=100000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ETRS89 / NTM zone 28 (deprecated)
-<epsg4878> +proj=tmerc +lat_0=0 +lon_0=28.5 +k=1 +x_0=100000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ETRS89 / NTM zone 29 (deprecated)
-<epsg4879> +proj=tmerc +lat_0=0 +lon_0=29.5 +k=1 +x_0=100000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ETRS89 / NTM zone 30 (deprecated)
-<epsg4880> +proj=tmerc +lat_0=0 +lon_0=30.5 +k=1 +x_0=100000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# PTRA08 / UTM zone 25N
-<epsg5014> +proj=utm +zone=25 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# PTRA08 / UTM zone 26N
-<epsg5015> +proj=utm +zone=26 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# PTRA08 / UTM zone 28N
-<epsg5016> +proj=utm +zone=28 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# Lisbon 1890 / Portugal Bonne New
-# Unable to translate coordinate system EPSG:5017 into PROJ.4 format.
-#
-# Lisbon / Portuguese Grid New
-<epsg5018> +proj=tmerc +lat_0=39.66666666666666 +lon_0=-8.131906111111112 +k=1 +x_0=0 +y_0=0 +ellps=intl +towgs84=-304.046,-60.576,103.64,0,0,0,0 +units=m +no_defs  <>
-# WGS 84 / UPS North (E,N)
-<epsg5041> +proj=stere +lat_0=90 +lat_ts=90 +lon_0=0 +k=0.994 +x_0=2000000 +y_0=2000000 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UPS South (E,N)
-<epsg5042> +proj=stere +lat_0=-90 +lat_ts=-90 +lon_0=0 +k=0.994 +x_0=2000000 +y_0=2000000 +datum=WGS84 +units=m +no_defs  <>
-# ETRS89 / TM35FIN(N,E)
-<epsg5048> +proj=utm +zone=35 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD27 / Conus Albers
-<epsg5069> +proj=aea +lat_1=29.5 +lat_2=45.5 +lat_0=23 +lon_0=-96 +x_0=0 +y_0=0 +datum=NAD27 +units=m +no_defs  <>
-# NAD83 / Conus Albers
-<epsg5070> +proj=aea +lat_1=29.5 +lat_2=45.5 +lat_0=23 +lon_0=-96 +x_0=0 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83(HARN) / Conus Albers
-<epsg5071> +proj=aea +lat_1=29.5 +lat_2=45.5 +lat_0=23 +lon_0=-96 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / Conus Albers
-<epsg5072> +proj=aea +lat_1=29.5 +lat_2=45.5 +lat_0=23 +lon_0=-96 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ETRS89 / NTM zone 5
-<epsg5105> +proj=tmerc +lat_0=58 +lon_0=5.5 +k=1 +x_0=100000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ETRS89 / NTM zone 6
-<epsg5106> +proj=tmerc +lat_0=58 +lon_0=6.5 +k=1 +x_0=100000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ETRS89 / NTM zone 7
-<epsg5107> +proj=tmerc +lat_0=58 +lon_0=7.5 +k=1 +x_0=100000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ETRS89 / NTM zone 8
-<epsg5108> +proj=tmerc +lat_0=58 +lon_0=8.5 +k=1 +x_0=100000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ETRS89 / NTM zone 9
-<epsg5109> +proj=tmerc +lat_0=58 +lon_0=9.5 +k=1 +x_0=100000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ETRS89 / NTM zone 10
-<epsg5110> +proj=tmerc +lat_0=58 +lon_0=10.5 +k=1 +x_0=100000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ETRS89 / NTM zone 11
-<epsg5111> +proj=tmerc +lat_0=58 +lon_0=11.5 +k=1 +x_0=100000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ETRS89 / NTM zone 12
-<epsg5112> +proj=tmerc +lat_0=58 +lon_0=12.5 +k=1 +x_0=100000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ETRS89 / NTM zone 13
-<epsg5113> +proj=tmerc +lat_0=58 +lon_0=13.5 +k=1 +x_0=100000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ETRS89 / NTM zone 14
-<epsg5114> +proj=tmerc +lat_0=58 +lon_0=14.5 +k=1 +x_0=100000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ETRS89 / NTM zone 15
-<epsg5115> +proj=tmerc +lat_0=58 +lon_0=15.5 +k=1 +x_0=100000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ETRS89 / NTM zone 16
-<epsg5116> +proj=tmerc +lat_0=58 +lon_0=16.5 +k=1 +x_0=100000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ETRS89 / NTM zone 17
-<epsg5117> +proj=tmerc +lat_0=58 +lon_0=17.5 +k=1 +x_0=100000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ETRS89 / NTM zone 18
-<epsg5118> +proj=tmerc +lat_0=58 +lon_0=18.5 +k=1 +x_0=100000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ETRS89 / NTM zone 19
-<epsg5119> +proj=tmerc +lat_0=58 +lon_0=19.5 +k=1 +x_0=100000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ETRS89 / NTM zone 20
-<epsg5120> +proj=tmerc +lat_0=58 +lon_0=20.5 +k=1 +x_0=100000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ETRS89 / NTM zone 21
-<epsg5121> +proj=tmerc +lat_0=58 +lon_0=21.5 +k=1 +x_0=100000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ETRS89 / NTM zone 22
-<epsg5122> +proj=tmerc +lat_0=58 +lon_0=22.5 +k=1 +x_0=100000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ETRS89 / NTM zone 23
-<epsg5123> +proj=tmerc +lat_0=58 +lon_0=23.5 +k=1 +x_0=100000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ETRS89 / NTM zone 24
-<epsg5124> +proj=tmerc +lat_0=58 +lon_0=24.5 +k=1 +x_0=100000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ETRS89 / NTM zone 25
-<epsg5125> +proj=tmerc +lat_0=58 +lon_0=25.5 +k=1 +x_0=100000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ETRS89 / NTM zone 26
-<epsg5126> +proj=tmerc +lat_0=58 +lon_0=26.5 +k=1 +x_0=100000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ETRS89 / NTM zone 27
-<epsg5127> +proj=tmerc +lat_0=58 +lon_0=27.5 +k=1 +x_0=100000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ETRS89 / NTM zone 28
-<epsg5128> +proj=tmerc +lat_0=58 +lon_0=28.5 +k=1 +x_0=100000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ETRS89 / NTM zone 29
-<epsg5129> +proj=tmerc +lat_0=58 +lon_0=29.5 +k=1 +x_0=100000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ETRS89 / NTM zone 30
-<epsg5130> +proj=tmerc +lat_0=58 +lon_0=30.5 +k=1 +x_0=100000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# Korean 1985 / East Sea Belt
-<epsg5167> +proj=tmerc +lat_0=38 +lon_0=131 +k=1 +x_0=200000 +y_0=500000 +ellps=bessel +units=m +no_defs  <>
-# Korean 1985 / Central Belt Jeju
-<epsg5168> +proj=tmerc +lat_0=38 +lon_0=127 +k=1 +x_0=200000 +y_0=550000 +ellps=bessel +units=m +no_defs  <>
-# Tokyo 1892 / Korea West Belt
-<epsg5169> +proj=tmerc +lat_0=38 +lon_0=125 +k=1 +x_0=200000 +y_0=500000 +ellps=bessel +units=m +no_defs  <>
-# Tokyo 1892 / Korea Central Belt
-<epsg5170> +proj=tmerc +lat_0=38 +lon_0=127 +k=1 +x_0=200000 +y_0=500000 +ellps=bessel +units=m +no_defs  <>
-# Tokyo 1892 / Korea East Belt
-<epsg5171> +proj=tmerc +lat_0=38 +lon_0=129 +k=1 +x_0=200000 +y_0=500000 +ellps=bessel +units=m +no_defs  <>
-# Tokyo 1892 / Korea East Sea Belt
-<epsg5172> +proj=tmerc +lat_0=38 +lon_0=131 +k=1 +x_0=200000 +y_0=500000 +ellps=bessel +units=m +no_defs  <>
-# Korean 1985 / Modified West Belt
-<epsg5173> +proj=tmerc +lat_0=38 +lon_0=125.0028902777778 +k=1 +x_0=200000 +y_0=500000 +ellps=bessel +units=m +no_defs  <>
-# Korean 1985 / Modified Central Belt
-<epsg5174> +proj=tmerc +lat_0=38 +lon_0=127.0028902777778 +k=1 +x_0=200000 +y_0=500000 +ellps=bessel +units=m +no_defs  <>
-# Korean 1985 / Modified Central Belt Jeju
-<epsg5175> +proj=tmerc +lat_0=38 +lon_0=127.0028902777778 +k=1 +x_0=200000 +y_0=550000 +ellps=bessel +units=m +no_defs  <>
-# Korean 1985 / Modified East Belt
-<epsg5176> +proj=tmerc +lat_0=38 +lon_0=129.0028902777778 +k=1 +x_0=200000 +y_0=500000 +ellps=bessel +units=m +no_defs  <>
-# Korean 1985 / Modified East Sea Belt
-<epsg5177> +proj=tmerc +lat_0=38 +lon_0=131.0028902777778 +k=1 +x_0=200000 +y_0=500000 +ellps=bessel +units=m +no_defs  <>
-# Korean 1985 / Unified CS
-<epsg5178> +proj=tmerc +lat_0=38 +lon_0=127.5 +k=0.9996 +x_0=1000000 +y_0=2000000 +ellps=bessel +units=m +no_defs  <>
-# Korea 2000 / Unified CS
-<epsg5179> +proj=tmerc +lat_0=38 +lon_0=127.5 +k=0.9996 +x_0=1000000 +y_0=2000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# Korea 2000 / West Belt
-<epsg5180> +proj=tmerc +lat_0=38 +lon_0=125 +k=1 +x_0=200000 +y_0=500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# Korea 2000 / Central Belt
-<epsg5181> +proj=tmerc +lat_0=38 +lon_0=127 +k=1 +x_0=200000 +y_0=500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# Korea 2000 / Central Belt Jeju
-<epsg5182> +proj=tmerc +lat_0=38 +lon_0=127 +k=1 +x_0=200000 +y_0=550000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# Korea 2000 / East Belt
-<epsg5183> +proj=tmerc +lat_0=38 +lon_0=129 +k=1 +x_0=200000 +y_0=500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# Korea 2000 / East Sea Belt
-<epsg5184> +proj=tmerc +lat_0=38 +lon_0=131 +k=1 +x_0=200000 +y_0=500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# Korea 2000 / West Belt 2010
-<epsg5185> +proj=tmerc +lat_0=38 +lon_0=125 +k=1 +x_0=200000 +y_0=600000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# Korea 2000 / Central Belt 2010
-<epsg5186> +proj=tmerc +lat_0=38 +lon_0=127 +k=1 +x_0=200000 +y_0=600000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# Korea 2000 / East Belt 2010
-<epsg5187> +proj=tmerc +lat_0=38 +lon_0=129 +k=1 +x_0=200000 +y_0=600000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# Korea 2000 / East Sea Belt 2010
-<epsg5188> +proj=tmerc +lat_0=38 +lon_0=131 +k=1 +x_0=200000 +y_0=600000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# S-JTSK (Ferro) / Krovak East North
-# Unable to translate coordinate system EPSG:5221 into PROJ.4 format.
-#
-# WGS 84 / Gabon TM
-<epsg5223> +proj=tmerc +lat_0=0 +lon_0=12 +k=0.9996 +x_0=500000 +y_0=500000 +datum=WGS84 +units=m +no_defs  <>
-# S-JTSK/05 (Ferro) / Modified Krovak
-# Unable to translate coordinate system EPSG:5224 into PROJ.4 format.
-#
-# S-JTSK/05 (Ferro) / Modified Krovak East North
-# Unable to translate coordinate system EPSG:5225 into PROJ.4 format.
-#
-# Kandawala / Sri Lanka Grid
-<epsg5234> +proj=tmerc +lat_0=7.000480277777778 +lon_0=80.77171111111112 +k=0.9999238418 +x_0=200000 +y_0=200000 +a=6377276.345 +b=6356075.41314024 +towgs84=-97,787,86,0,0,0,0 +units=m +no_defs  <>
-# SLD99 / Sri Lanka Grid 1999
-<epsg5235> +proj=tmerc +lat_0=7.000471527777778 +lon_0=80.77171308333334 +k=0.9999238418 +x_0=500000 +y_0=500000 +a=6377276.345 +b=6356075.41314024 +towgs84=-0.293,766.95,87.713,0.195704,1.69507,3.47302,-0.039338 +units=m +no_defs  <>
-# ETRS89 / LCC Germany (E-N)
-<epsg5243> +proj=lcc +lat_1=48.66666666666666 +lat_2=53.66666666666666 +lat_0=51 +lon_0=10.5 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# GDBD2009 / Brunei BRSO
-<epsg5247> +proj=omerc +lat_0=4 +lonc=115 +alpha=53.31580995 +k=0.99984 +x_0=0 +y_0=0 +no_uoff +gamma=53.13010236111111 +ellps=GRS80 +units=m +no_defs  <>
-# TUREF / TM27
-<epsg5253> +proj=tmerc +lat_0=0 +lon_0=27 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# TUREF / TM30
-<epsg5254> +proj=tmerc +lat_0=0 +lon_0=30 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# TUREF / TM33
-<epsg5255> +proj=tmerc +lat_0=0 +lon_0=33 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# TUREF / TM36
-<epsg5256> +proj=tmerc +lat_0=0 +lon_0=36 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# TUREF / TM39
-<epsg5257> +proj=tmerc +lat_0=0 +lon_0=39 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# TUREF / TM42
-<epsg5258> +proj=tmerc +lat_0=0 +lon_0=42 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# TUREF / TM45
-<epsg5259> +proj=tmerc +lat_0=0 +lon_0=45 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# DRUKREF 03 / Bhutan National Grid
-<epsg5266> +proj=tmerc +lat_0=0 +lon_0=90 +k=1 +x_0=250000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# TUREF / 3-degree Gauss-Kruger zone 9
-<epsg5269> +proj=tmerc +lat_0=0 +lon_0=27 +k=1 +x_0=9500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# TUREF / 3-degree Gauss-Kruger zone 10
-<epsg5270> +proj=tmerc +lat_0=0 +lon_0=30 +k=1 +x_0=10500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# TUREF / 3-degree Gauss-Kruger zone 11
-<epsg5271> +proj=tmerc +lat_0=0 +lon_0=33 +k=1 +x_0=11500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# TUREF / 3-degree Gauss-Kruger zone 12
-<epsg5272> +proj=tmerc +lat_0=0 +lon_0=36 +k=1 +x_0=12500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# TUREF / 3-degree Gauss-Kruger zone 13
-<epsg5273> +proj=tmerc +lat_0=0 +lon_0=39 +k=1 +x_0=13500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# TUREF / 3-degree Gauss-Kruger zone 14
-<epsg5274> +proj=tmerc +lat_0=0 +lon_0=42 +k=1 +x_0=14500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# TUREF / 3-degree Gauss-Kruger zone 15
-<epsg5275> +proj=tmerc +lat_0=0 +lon_0=45 +k=1 +x_0=15500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# DRUKREF 03 / Bumthang TM
-<epsg5292> +proj=tmerc +lat_0=0 +lon_0=90.73333333333333 +k=1 +x_0=250000 +y_0=-2500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# DRUKREF 03 / Chhukha TM
-<epsg5293> +proj=tmerc +lat_0=0 +lon_0=89.55 +k=1 +x_0=250000 +y_0=-2500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# DRUKREF 03 / Dagana TM
-<epsg5294> +proj=tmerc +lat_0=0 +lon_0=89.84999999999999 +k=1 +x_0=250000 +y_0=-2500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# DRUKREF 03 / Gasa TM
-<epsg5295> +proj=tmerc +lat_0=0 +lon_0=90.03333333333333 +k=1 +x_0=250000 +y_0=-2500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# DRUKREF 03 / Ha TM
-<epsg5296> +proj=tmerc +lat_0=0 +lon_0=90.15000000000001 +k=1 +x_0=250000 +y_0=-2500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# DRUKREF 03 / Lhuentse TM
-<epsg5297> +proj=tmerc +lat_0=0 +lon_0=91.13333333333334 +k=1 +x_0=250000 +y_0=-2500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# DRUKREF 03 / Mongar TM
-<epsg5298> +proj=tmerc +lat_0=0 +lon_0=91.23333333333333 +k=1 +x_0=250000 +y_0=-2500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# DRUKREF 03 / Paro TM
-<epsg5299> +proj=tmerc +lat_0=0 +lon_0=89.34999999999999 +k=1 +x_0=250000 +y_0=-2500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# DRUKREF 03 / Pemagatshel TM
-<epsg5300> +proj=tmerc +lat_0=0 +lon_0=91.34999999999999 +k=1 +x_0=250000 +y_0=-2500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# DRUKREF 03 / Punakha TM
-<epsg5301> +proj=tmerc +lat_0=0 +lon_0=89.84999999999999 +k=1 +x_0=250000 +y_0=-2500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# DRUKREF 03 / Samdrup Jongkhar TM
-<epsg5302> +proj=tmerc +lat_0=0 +lon_0=91.56666666666666 +k=1 +x_0=250000 +y_0=-2500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# DRUKREF 03 / Samtse TM
-<epsg5303> +proj=tmerc +lat_0=0 +lon_0=89.06666666666666 +k=1 +x_0=250000 +y_0=-2500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# DRUKREF 03 / Sarpang TM
-<epsg5304> +proj=tmerc +lat_0=0 +lon_0=90.26666666666667 +k=1 +x_0=250000 +y_0=-2500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# DRUKREF 03 / Thimphu TM
-<epsg5305> +proj=tmerc +lat_0=0 +lon_0=89.55 +k=1 +x_0=250000 +y_0=-2500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# DRUKREF 03 / Trashigang TM
-<epsg5306> +proj=tmerc +lat_0=0 +lon_0=91.75 +k=1 +x_0=250000 +y_0=-2500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# DRUKREF 03 / Trongsa TM
-<epsg5307> +proj=tmerc +lat_0=0 +lon_0=90.5 +k=1 +x_0=250000 +y_0=-2500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# DRUKREF 03 / Tsirang TM
-<epsg5308> +proj=tmerc +lat_0=0 +lon_0=90.16666666666667 +k=1 +x_0=250000 +y_0=-2500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# DRUKREF 03 / Wangdue Phodrang TM
-<epsg5309> +proj=tmerc +lat_0=0 +lon_0=90.11666666666666 +k=1 +x_0=250000 +y_0=-2500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# DRUKREF 03 / Yangtse TM
-<epsg5310> +proj=tmerc +lat_0=0 +lon_0=91.56666666666666 +k=1 +x_0=250000 +y_0=-2500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# DRUKREF 03 / Zhemgang TM
-<epsg5311> +proj=tmerc +lat_0=0 +lon_0=90.86666666666666 +k=1 +x_0=250000 +y_0=-2500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ETRS89 / Faroe TM
-<epsg5316> +proj=tmerc +lat_0=0 +lon_0=-7 +k=0.999997 +x_0=200000 +y_0=-6000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83 / Teranet Ontario Lambert
-<epsg5320> +proj=lcc +lat_1=44.5 +lat_2=54.5 +lat_0=0 +lon_0=-84 +x_0=1000000 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83(CSRS) / Teranet Ontario Lambert
-<epsg5321> +proj=lcc +lat_1=44.5 +lat_2=54.5 +lat_0=0 +lon_0=-84 +x_0=1000000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ISN2004 / Lambert 2004
-<epsg5325> +proj=lcc +lat_1=64.25 +lat_2=65.75 +lat_0=65 +lon_0=-19 +x_0=1700000 +y_0=300000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# Segara (Jakarta) / NEIEZ
-<epsg5329> +proj=merc +lon_0=3.192280555555556 +k=0.997 +x_0=3900000 +y_0=900000 +ellps=bessel +towgs84=-403,684,41,0,0,0,0 +pm=jakarta +units=m +no_defs  <>
-# Batavia (Jakarta) / NEIEZ
-<epsg5330> +proj=merc +lon_0=3.192280555555556 +k=0.997 +x_0=3900000 +y_0=900000 +ellps=bessel +towgs84=-377,681,-50,0,0,0,0 +pm=jakarta +units=m +no_defs  <>
-# Makassar (Jakarta) / NEIEZ
-<epsg5331> +proj=merc +lon_0=3.192280555555556 +k=0.997 +x_0=3900000 +y_0=900000 +ellps=bessel +towgs84=-587.8,519.75,145.76,0,0,0,0 +pm=jakarta +units=m +no_defs  <>
-# Aratu / UTM zone 25S
-<epsg5337> +proj=utm +zone=25 +south +ellps=intl +towgs84=-151.99,287.04,-147.45,0,0,0,0 +units=m +no_defs  <>
-# POSGAR 2007 / Argentina 1
-<epsg5343> +proj=tmerc +lat_0=-90 +lon_0=-72 +k=1 +x_0=1500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# POSGAR 2007 / Argentina 2
-<epsg5344> +proj=tmerc +lat_0=-90 +lon_0=-69 +k=1 +x_0=2500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# POSGAR 2007 / Argentina 3
-<epsg5345> +proj=tmerc +lat_0=-90 +lon_0=-66 +k=1 +x_0=3500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# POSGAR 2007 / Argentina 4
-<epsg5346> +proj=tmerc +lat_0=-90 +lon_0=-63 +k=1 +x_0=4500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# POSGAR 2007 / Argentina 5
-<epsg5347> +proj=tmerc +lat_0=-90 +lon_0=-60 +k=1 +x_0=5500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# POSGAR 2007 / Argentina 6
-<epsg5348> +proj=tmerc +lat_0=-90 +lon_0=-57 +k=1 +x_0=6500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# POSGAR 2007 / Argentina 7
-<epsg5349> +proj=tmerc +lat_0=-90 +lon_0=-54 +k=1 +x_0=7500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# MARGEN / UTM zone 20S
-<epsg5355> +proj=utm +zone=20 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# MARGEN / UTM zone 19S
-<epsg5356> +proj=utm +zone=19 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# MARGEN / UTM zone 21S
-<epsg5357> +proj=utm +zone=21 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# SIRGAS-Chile / UTM zone 19S
-<epsg5361> +proj=utm +zone=19 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# SIRGAS-Chile / UTM zone 18S
-<epsg5362> +proj=utm +zone=18 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# CR05 / CRTM05
-<epsg5367> +proj=tmerc +lat_0=0 +lon_0=-84 +k=0.9999 +x_0=500000 +y_0=0 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# SIRGAS-ROU98 / UTM zone 21S
-<epsg5382> +proj=utm +zone=21 +south +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# SIRGAS-ROU98 / UTM zone 22S
-<epsg5383> +proj=utm +zone=22 +south +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# Peru96 / UTM zone 18S
-<epsg5387> +proj=utm +zone=18 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# Peru96 / UTM zone 17S
-<epsg5388> +proj=utm +zone=17 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# Peru96 / UTM zone 19S
-<epsg5389> +proj=utm +zone=19 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# SIRGAS 2000 / UTM zone 26S
-<epsg5396> +proj=utm +zone=26 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# Ocotepeque 1935 / Costa Rica Norte
-<epsg5456> +proj=lcc +lat_1=10.46666666666667 +lat_0=10.46666666666667 +lon_0=-84.33333333333333 +k_0=0.99995696 +x_0=500000 +y_0=271820.522 +ellps=clrk66 +towgs84=213.11,9.37,-74.95,0,0,0,0 +units=m +no_defs  <>
-# Ocotepeque 1935 / Costa Rica Sur
-<epsg5457> +proj=lcc +lat_1=9 +lat_0=9 +lon_0=-83.66666666666667 +k_0=0.99995696 +x_0=500000 +y_0=327987.436 +ellps=clrk66 +towgs84=213.11,9.37,-74.95,0,0,0,0 +units=m +no_defs  <>
-# Ocotepeque 1935 / Guatemala Norte (deprecated)
-<epsg5458> +proj=lcc +lat_1=16.81666666666667 +lat_0=16.81666666666667 +lon_0=-90.33333333333333 +k_0=0.99992226 +x_0=500000 +y_0=292209.579 +datum=NAD27 +units=m +no_defs  <>
-# Ocotepeque 1935 / Guatemala Sur
-<epsg5459> +proj=lcc +lat_1=14.9 +lat_0=14.9 +lon_0=-90.33333333333333 +k_0=0.99989906 +x_0=500000 +y_0=325992.681 +ellps=clrk66 +towgs84=213.11,9.37,-74.95,0,0,0,0 +units=m +no_defs  <>
-# Ocotepeque 1935 / El Salvador Lambert
-<epsg5460> +proj=lcc +lat_1=13.78333333333333 +lat_0=13.78333333333333 +lon_0=-89 +k_0=0.99996704 +x_0=500000 +y_0=295809.184 +ellps=clrk66 +towgs84=213.11,9.37,-74.95,0,0,0,0 +units=m +no_defs  <>
-# Ocotepeque 1935 / Nicaragua Norte
-<epsg5461> +proj=lcc +lat_1=13.86666666666667 +lat_0=13.86666666666667 +lon_0=-85.5 +k_0=0.99990314 +x_0=500000 +y_0=359891.816 +ellps=clrk66 +towgs84=213.11,9.37,-74.95,0,0,0,0 +units=m +no_defs  <>
-# Ocotepeque 1935 / Nicaragua Sur
-<epsg5462> +proj=lcc +lat_1=11.73333333333333 +lat_0=11.73333333333333 +lon_0=-85.5 +k_0=0.9999222800000001 +x_0=500000 +y_0=288876.327 +ellps=clrk66 +towgs84=213.11,9.37,-74.95,0,0,0,0 +units=m +no_defs  <>
-# SAD69 / UTM zone 17N
-<epsg5463> +proj=utm +zone=17 +ellps=aust_SA +towgs84=-57,1,-41,0,0,0,0 +units=m +no_defs  <>
-# Sibun Gorge 1922 / Colony Grid
-<epsg5466> +proj=tmerc +lat_0=17.06124194444444 +lon_0=-88.6318575 +k=1 +x_0=66220.02833082761 +y_0=135779.5099885299 +a=6378293.645208759 +b=6356617.987679838 +units=m +no_defs  <>
-# Panama-Colon 1911 / Panama Lambert
-<epsg5469> +proj=lcc +lat_1=8.416666666666666 +lat_0=8.416666666666666 +lon_0=-80 +k_0=0.99989909 +x_0=500000 +y_0=294865.303 +ellps=clrk66 +units=m +no_defs  <>
-# Panama-Colon 1911 / Panama Polyconic
-<epsg5472> +proj=poly +lat_0=8.25 +lon_0=-81 +x_0=914391.7962 +y_0=999404.7217154861 +ellps=clrk66 +to_meter=0.9143917962 +no_defs  <>
-# RSRGD2000 / MSLC2000
-<epsg5479> +proj=lcc +lat_1=-76.66666666666667 +lat_2=-79.33333333333333 +lat_0=-78 +lon_0=163 +x_0=7000000 +y_0=5000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# RSRGD2000 / BCLC2000
-<epsg5480> +proj=lcc +lat_1=-73.66666666666667 +lat_2=-75.33333333333333 +lat_0=-74.5 +lon_0=165 +x_0=5000000 +y_0=3000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# RSRGD2000 / PCLC2000
-<epsg5481> +proj=lcc +lat_1=-70.66666666666667 +lat_2=-72.33333333333333 +lat_0=-71.5 +lon_0=166 +x_0=3000000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# RSRGD2000 / RSPS2000
-<epsg5482> +proj=stere +lat_0=-90 +lat_ts=-90 +lon_0=180 +k=0.994 +x_0=5000000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# RGAF09 / UTM zone 20N
-<epsg5490> +proj=utm +zone=20 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# S-JTSK / Krovak
-<epsg5513> +proj=krovak +lat_0=49.5 +lon_0=24.83333333333333 +alpha=30.28813972222222 +k=0.9999 +x_0=0 +y_0=0 +ellps=bessel +towgs84=589,76,480,0,0,0,0 +units=m +no_defs  <>
-# S-JTSK / Krovak East North
-# Unable to translate coordinate system EPSG:5514 into PROJ.4 format.
-#
-# S-JTSK/05 / Modified Krovak
-# Unable to translate coordinate system EPSG:5515 into PROJ.4 format.
-#
-# S-JTSK/05 / Modified Krovak East North
-# Unable to translate coordinate system EPSG:5516 into PROJ.4 format.
-#
-# CI1971 / Chatham Islands Map Grid
-<epsg5518> +proj=tmerc +lat_0=-44 +lon_0=-176.5 +k=1 +x_0=350000 +y_0=650000 +ellps=intl +towgs84=175,-38,113,0,0,0,0 +units=m +no_defs  <>
-# CI1979 / Chatham Islands Map Grid
-<epsg5519> +proj=tmerc +lat_0=-44 +lon_0=-176.5 +k=1 +x_0=350000 +y_0=650000 +ellps=intl +towgs84=174.05,-25.49,112.57,-0,-0,0.554,0.2263 +units=m +no_defs  <>
-# DHDN / 3-degree Gauss-Kruger zone 1
-<epsg5520> +proj=tmerc +lat_0=0 +lon_0=3 +k=1 +x_0=1500000 +y_0=0 +datum=potsdam +units=m +no_defs  <>
-# WGS 84 / Gabon TM 2011
-<epsg5523> +proj=tmerc +lat_0=0 +lon_0=11.5 +k=0.9996 +x_0=1500000 +y_0=5500000 +datum=WGS84 +units=m +no_defs  <>
-# SAD69(96) / Brazil Polyconic
-<epsg5530> +proj=poly +lat_0=0 +lon_0=-54 +x_0=5000000 +y_0=10000000 +ellps=aust_SA +units=m +no_defs  <>
-# SAD69(96) / UTM zone 21S
-<epsg5531> +proj=utm +zone=21 +south +ellps=aust_SA +units=m +no_defs  <>
-# SAD69(96) / UTM zone 22S
-<epsg5532> +proj=utm +zone=22 +south +ellps=aust_SA +towgs84=-57,1,-41,0,0,0,0 +units=m +no_defs  <>
-# SAD69(96) / UTM zone 23S
-<epsg5533> +proj=utm +zone=23 +south +ellps=aust_SA +units=m +no_defs  <>
-# SAD69(96) / UTM zone 24S
-<epsg5534> +proj=utm +zone=24 +south +ellps=aust_SA +units=m +no_defs  <>
-# SAD69(96) / UTM zone 25S
-<epsg5535> +proj=utm +zone=25 +south +ellps=aust_SA +units=m +no_defs  <>
-# Corrego Alegre 1961 / UTM zone 21S
-<epsg5536> +proj=utm +zone=21 +south +ellps=intl +units=m +no_defs  <>
-# Corrego Alegre 1961 / UTM zone 22S
-<epsg5537> +proj=utm +zone=22 +south +ellps=intl +units=m +no_defs  <>
-# Corrego Alegre 1961 / UTM zone 23S
-<epsg5538> +proj=utm +zone=23 +south +ellps=intl +units=m +no_defs  <>
-# Corrego Alegre 1961 / UTM zone 24S
-<epsg5539> +proj=utm +zone=24 +south +ellps=intl +units=m +no_defs  <>
-# PNG94 / PNGMG94 zone 54
-<epsg5550> +proj=utm +zone=54 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# PNG94 / PNGMG94 zone 55
-<epsg5551> +proj=utm +zone=55 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# PNG94 / PNGMG94 zone 56
-<epsg5552> +proj=utm +zone=56 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# Ocotepeque 1935 / Guatemala Norte
-<epsg5559> +proj=lcc +lat_1=16.81666666666667 +lat_0=16.81666666666667 +lon_0=-90.33333333333333 +k_0=0.99992226 +x_0=500000 +y_0=292209.579 +ellps=clrk66 +towgs84=213.11,9.37,-74.95,0,0,0,0 +units=m +no_defs  <>
-# EPSG topocentric example A
-# Unable to translate coordinate system EPSG:5819 into PROJ.4 format.
-#
-# EPSG topocentric example B
-# Unable to translate coordinate system EPSG:5820 into PROJ.4 format.
-#
-# EPSG vertical perspective example
-# Unable to translate coordinate system EPSG:5821 into PROJ.4 format.
-#
-# Pulkovo 1995 / Gauss-Kruger zone 4
-<epsg20004> +proj=tmerc +lat_0=0 +lon_0=21 +k=1 +x_0=4500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / Gauss-Kruger zone 5
-<epsg20005> +proj=tmerc +lat_0=0 +lon_0=27 +k=1 +x_0=5500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / Gauss-Kruger zone 6
-<epsg20006> +proj=tmerc +lat_0=0 +lon_0=33 +k=1 +x_0=6500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / Gauss-Kruger zone 7
-<epsg20007> +proj=tmerc +lat_0=0 +lon_0=39 +k=1 +x_0=7500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / Gauss-Kruger zone 8
-<epsg20008> +proj=tmerc +lat_0=0 +lon_0=45 +k=1 +x_0=8500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / Gauss-Kruger zone 9
-<epsg20009> +proj=tmerc +lat_0=0 +lon_0=51 +k=1 +x_0=9500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / Gauss-Kruger zone 10
-<epsg20010> +proj=tmerc +lat_0=0 +lon_0=57 +k=1 +x_0=10500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / Gauss-Kruger zone 11
-<epsg20011> +proj=tmerc +lat_0=0 +lon_0=63 +k=1 +x_0=11500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / Gauss-Kruger zone 12
-<epsg20012> +proj=tmerc +lat_0=0 +lon_0=69 +k=1 +x_0=12500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / Gauss-Kruger zone 13
-<epsg20013> +proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=13500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / Gauss-Kruger zone 14
-<epsg20014> +proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=14500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / Gauss-Kruger zone 15
-<epsg20015> +proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=15500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / Gauss-Kruger zone 16
-<epsg20016> +proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=16500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / Gauss-Kruger zone 17
-<epsg20017> +proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=17500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / Gauss-Kruger zone 18
-<epsg20018> +proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=18500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / Gauss-Kruger zone 19
-<epsg20019> +proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=19500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / Gauss-Kruger zone 20
-<epsg20020> +proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=20500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / Gauss-Kruger zone 21
-<epsg20021> +proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=21500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / Gauss-Kruger zone 22
-<epsg20022> +proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=22500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / Gauss-Kruger zone 23
-<epsg20023> +proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=23500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / Gauss-Kruger zone 24
-<epsg20024> +proj=tmerc +lat_0=0 +lon_0=141 +k=1 +x_0=24500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / Gauss-Kruger zone 25
-<epsg20025> +proj=tmerc +lat_0=0 +lon_0=147 +k=1 +x_0=25500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / Gauss-Kruger zone 26
-<epsg20026> +proj=tmerc +lat_0=0 +lon_0=153 +k=1 +x_0=26500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / Gauss-Kruger zone 27
-<epsg20027> +proj=tmerc +lat_0=0 +lon_0=159 +k=1 +x_0=27500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / Gauss-Kruger zone 28
-<epsg20028> +proj=tmerc +lat_0=0 +lon_0=165 +k=1 +x_0=28500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / Gauss-Kruger zone 29
-<epsg20029> +proj=tmerc +lat_0=0 +lon_0=171 +k=1 +x_0=29500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / Gauss-Kruger zone 30
-<epsg20030> +proj=tmerc +lat_0=0 +lon_0=177 +k=1 +x_0=30500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / Gauss-Kruger zone 31
-<epsg20031> +proj=tmerc +lat_0=0 +lon_0=-177 +k=1 +x_0=31500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / Gauss-Kruger zone 32
-<epsg20032> +proj=tmerc +lat_0=0 +lon_0=-171 +k=1 +x_0=32500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / Gauss-Kruger 4N (deprecated)
-<epsg20064> +proj=tmerc +lat_0=0 +lon_0=21 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / Gauss-Kruger 5N (deprecated)
-<epsg20065> +proj=tmerc +lat_0=0 +lon_0=27 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / Gauss-Kruger 6N (deprecated)
-<epsg20066> +proj=tmerc +lat_0=0 +lon_0=33 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / Gauss-Kruger 7N (deprecated)
-<epsg20067> +proj=tmerc +lat_0=0 +lon_0=39 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / Gauss-Kruger 8N (deprecated)
-<epsg20068> +proj=tmerc +lat_0=0 +lon_0=45 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / Gauss-Kruger 9N (deprecated)
-<epsg20069> +proj=tmerc +lat_0=0 +lon_0=51 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / Gauss-Kruger 10N (deprecated)
-<epsg20070> +proj=tmerc +lat_0=0 +lon_0=57 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / Gauss-Kruger 11N (deprecated)
-<epsg20071> +proj=tmerc +lat_0=0 +lon_0=63 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / Gauss-Kruger 12N (deprecated)
-<epsg20072> +proj=tmerc +lat_0=0 +lon_0=69 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / Gauss-Kruger 13N (deprecated)
-<epsg20073> +proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / Gauss-Kruger 14N (deprecated)
-<epsg20074> +proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / Gauss-Kruger 15N (deprecated)
-<epsg20075> +proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / Gauss-Kruger 16N (deprecated)
-<epsg20076> +proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / Gauss-Kruger 17N (deprecated)
-<epsg20077> +proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / Gauss-Kruger 18N (deprecated)
-<epsg20078> +proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / Gauss-Kruger 19N (deprecated)
-<epsg20079> +proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / Gauss-Kruger 20N (deprecated)
-<epsg20080> +proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / Gauss-Kruger 21N (deprecated)
-<epsg20081> +proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / Gauss-Kruger 22N (deprecated)
-<epsg20082> +proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / Gauss-Kruger 23N (deprecated)
-<epsg20083> +proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / Gauss-Kruger 24N (deprecated)
-<epsg20084> +proj=tmerc +lat_0=0 +lon_0=141 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / Gauss-Kruger 25N (deprecated)
-<epsg20085> +proj=tmerc +lat_0=0 +lon_0=147 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / Gauss-Kruger 26N (deprecated)
-<epsg20086> +proj=tmerc +lat_0=0 +lon_0=153 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / Gauss-Kruger 27N (deprecated)
-<epsg20087> +proj=tmerc +lat_0=0 +lon_0=159 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / Gauss-Kruger 28N (deprecated)
-<epsg20088> +proj=tmerc +lat_0=0 +lon_0=165 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / Gauss-Kruger 29N (deprecated)
-<epsg20089> +proj=tmerc +lat_0=0 +lon_0=171 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / Gauss-Kruger 30N (deprecated)
-<epsg20090> +proj=tmerc +lat_0=0 +lon_0=177 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / Gauss-Kruger 31N (deprecated)
-<epsg20091> +proj=tmerc +lat_0=0 +lon_0=-177 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Pulkovo 1995 / Gauss-Kruger 32N (deprecated)
-<epsg20092> +proj=tmerc +lat_0=0 +lon_0=-171 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs  <>
-# Adindan / UTM zone 35N
-<epsg20135> +proj=utm +zone=35 +ellps=clrk80 +towgs84=-166,-15,204,0,0,0,0 +units=m +no_defs  <>
-# Adindan / UTM zone 36N
-<epsg20136> +proj=utm +zone=36 +ellps=clrk80 +towgs84=-166,-15,204,0,0,0,0 +units=m +no_defs  <>
-# Adindan / UTM zone 37N
-<epsg20137> +proj=utm +zone=37 +ellps=clrk80 +towgs84=-166,-15,204,0,0,0,0 +units=m +no_defs  <>
-# Adindan / UTM zone 38N
-<epsg20138> +proj=utm +zone=38 +ellps=clrk80 +towgs84=-166,-15,204,0,0,0,0 +units=m +no_defs  <>
-# AGD66 / AMG zone 48
-<epsg20248> +proj=utm +zone=48 +south +ellps=aust_SA +towgs84=-117.808,-51.536,137.784,0.303,0.446,0.234,-0.29 +units=m +no_defs  <>
-# AGD66 / AMG zone 49
-<epsg20249> +proj=utm +zone=49 +south +ellps=aust_SA +towgs84=-117.808,-51.536,137.784,0.303,0.446,0.234,-0.29 +units=m +no_defs  <>
-# AGD66 / AMG zone 50
-<epsg20250> +proj=utm +zone=50 +south +ellps=aust_SA +towgs84=-117.808,-51.536,137.784,0.303,0.446,0.234,-0.29 +units=m +no_defs  <>
-# AGD66 / AMG zone 51
-<epsg20251> +proj=utm +zone=51 +south +ellps=aust_SA +towgs84=-117.808,-51.536,137.784,0.303,0.446,0.234,-0.29 +units=m +no_defs  <>
-# AGD66 / AMG zone 52
-<epsg20252> +proj=utm +zone=52 +south +ellps=aust_SA +towgs84=-117.808,-51.536,137.784,0.303,0.446,0.234,-0.29 +units=m +no_defs  <>
-# AGD66 / AMG zone 53
-<epsg20253> +proj=utm +zone=53 +south +ellps=aust_SA +towgs84=-117.808,-51.536,137.784,0.303,0.446,0.234,-0.29 +units=m +no_defs  <>
-# AGD66 / AMG zone 54
-<epsg20254> +proj=utm +zone=54 +south +ellps=aust_SA +towgs84=-117.808,-51.536,137.784,0.303,0.446,0.234,-0.29 +units=m +no_defs  <>
-# AGD66 / AMG zone 55
-<epsg20255> +proj=utm +zone=55 +south +ellps=aust_SA +towgs84=-117.808,-51.536,137.784,0.303,0.446,0.234,-0.29 +units=m +no_defs  <>
-# AGD66 / AMG zone 56
-<epsg20256> +proj=utm +zone=56 +south +ellps=aust_SA +towgs84=-117.808,-51.536,137.784,0.303,0.446,0.234,-0.29 +units=m +no_defs  <>
-# AGD66 / AMG zone 57
-<epsg20257> +proj=utm +zone=57 +south +ellps=aust_SA +towgs84=-117.808,-51.536,137.784,0.303,0.446,0.234,-0.29 +units=m +no_defs  <>
-# AGD66 / AMG zone 58
-<epsg20258> +proj=utm +zone=58 +south +ellps=aust_SA +towgs84=-117.808,-51.536,137.784,0.303,0.446,0.234,-0.29 +units=m +no_defs  <>
-# AGD84 / AMG zone 48
-<epsg20348> +proj=utm +zone=48 +south +ellps=aust_SA +towgs84=-134,-48,149,0,0,0,0 +units=m +no_defs  <>
-# AGD84 / AMG zone 49
-<epsg20349> +proj=utm +zone=49 +south +ellps=aust_SA +towgs84=-134,-48,149,0,0,0,0 +units=m +no_defs  <>
-# AGD84 / AMG zone 50
-<epsg20350> +proj=utm +zone=50 +south +ellps=aust_SA +towgs84=-134,-48,149,0,0,0,0 +units=m +no_defs  <>
-# AGD84 / AMG zone 51
-<epsg20351> +proj=utm +zone=51 +south +ellps=aust_SA +towgs84=-134,-48,149,0,0,0,0 +units=m +no_defs  <>
-# AGD84 / AMG zone 52
-<epsg20352> +proj=utm +zone=52 +south +ellps=aust_SA +towgs84=-134,-48,149,0,0,0,0 +units=m +no_defs  <>
-# AGD84 / AMG zone 53
-<epsg20353> +proj=utm +zone=53 +south +ellps=aust_SA +towgs84=-134,-48,149,0,0,0,0 +units=m +no_defs  <>
-# AGD84 / AMG zone 54
-<epsg20354> +proj=utm +zone=54 +south +ellps=aust_SA +towgs84=-134,-48,149,0,0,0,0 +units=m +no_defs  <>
-# AGD84 / AMG zone 55
-<epsg20355> +proj=utm +zone=55 +south +ellps=aust_SA +towgs84=-134,-48,149,0,0,0,0 +units=m +no_defs  <>
-# AGD84 / AMG zone 56
-<epsg20356> +proj=utm +zone=56 +south +ellps=aust_SA +towgs84=-134,-48,149,0,0,0,0 +units=m +no_defs  <>
-# AGD84 / AMG zone 57
-<epsg20357> +proj=utm +zone=57 +south +ellps=aust_SA +towgs84=-134,-48,149,0,0,0,0 +units=m +no_defs  <>
-# AGD84 / AMG zone 58
-<epsg20358> +proj=utm +zone=58 +south +ellps=aust_SA +towgs84=-134,-48,149,0,0,0,0 +units=m +no_defs  <>
-# Ain el Abd / UTM zone 36N
-<epsg20436> +proj=utm +zone=36 +ellps=intl +towgs84=-143,-236,7,0,0,0,0 +units=m +no_defs  <>
-# Ain el Abd / UTM zone 37N
-<epsg20437> +proj=utm +zone=37 +ellps=intl +towgs84=-143,-236,7,0,0,0,0 +units=m +no_defs  <>
-# Ain el Abd / UTM zone 38N
-<epsg20438> +proj=utm +zone=38 +ellps=intl +towgs84=-143,-236,7,0,0,0,0 +units=m +no_defs  <>
-# Ain el Abd / UTM zone 39N
-<epsg20439> +proj=utm +zone=39 +ellps=intl +towgs84=-143,-236,7,0,0,0,0 +units=m +no_defs  <>
-# Ain el Abd / UTM zone 40N
-<epsg20440> +proj=utm +zone=40 +ellps=intl +towgs84=-143,-236,7,0,0,0,0 +units=m +no_defs  <>
-# Ain el Abd / Bahrain Grid
-<epsg20499> +proj=utm +zone=39 +ellps=intl +towgs84=-143,-236,7,0,0,0,0 +units=m +no_defs  <>
-# Afgooye / UTM zone 38N
-<epsg20538> +proj=utm +zone=38 +ellps=krass +towgs84=-43,-163,45,0,0,0,0 +units=m +no_defs  <>
-# Afgooye / UTM zone 39N
-<epsg20539> +proj=utm +zone=39 +ellps=krass +towgs84=-43,-163,45,0,0,0,0 +units=m +no_defs  <>
-# Lisbon (Lisbon) / Portuguese National Grid
-<epsg20790> +proj=tmerc +lat_0=39.66666666666666 +lon_0=1 +k=1 +x_0=200000 +y_0=300000 +ellps=intl +towgs84=-304.046,-60.576,103.64,0,0,0,0 +pm=lisbon +units=m +no_defs  <>
-# Lisbon (Lisbon) / Portuguese Grid
-<epsg20791> +proj=tmerc +lat_0=39.66666666666666 +lon_0=1 +k=1 +x_0=0 +y_0=0 +ellps=intl +towgs84=-304.046,-60.576,103.64,0,0,0,0 +pm=lisbon +units=m +no_defs  <>
-# Aratu / UTM zone 22S
-<epsg20822> +proj=utm +zone=22 +south +ellps=intl +towgs84=-151.99,287.04,-147.45,0,0,0,0 +units=m +no_defs  <>
-# Aratu / UTM zone 23S
-<epsg20823> +proj=utm +zone=23 +south +ellps=intl +towgs84=-151.99,287.04,-147.45,0,0,0,0 +units=m +no_defs  <>
-# Aratu / UTM zone 24S
-<epsg20824> +proj=utm +zone=24 +south +ellps=intl +towgs84=-151.99,287.04,-147.45,0,0,0,0 +units=m +no_defs  <>
-# Arc 1950 / UTM zone 34S
-<epsg20934> +proj=utm +zone=34 +south +a=6378249.145 +b=6356514.966398753 +towgs84=-143,-90,-294,0,0,0,0 +units=m +no_defs  <>
-# Arc 1950 / UTM zone 35S
-<epsg20935> +proj=utm +zone=35 +south +a=6378249.145 +b=6356514.966398753 +towgs84=-143,-90,-294,0,0,0,0 +units=m +no_defs  <>
-# Arc 1950 / UTM zone 36S
-<epsg20936> +proj=utm +zone=36 +south +a=6378249.145 +b=6356514.966398753 +towgs84=-143,-90,-294,0,0,0,0 +units=m +no_defs  <>
-# Arc 1960 / UTM zone 35S
-<epsg21035> +proj=utm +zone=35 +south +ellps=clrk80 +towgs84=-160,-6,-302,0,0,0,0 +units=m +no_defs  <>
-# Arc 1960 / UTM zone 36S
-<epsg21036> +proj=utm +zone=36 +south +ellps=clrk80 +towgs84=-160,-6,-302,0,0,0,0 +units=m +no_defs  <>
-# Arc 1960 / UTM zone 37S
-<epsg21037> +proj=utm +zone=37 +south +ellps=clrk80 +towgs84=-160,-6,-302,0,0,0,0 +units=m +no_defs  <>
-# Arc 1960 / UTM zone 35N
-<epsg21095> +proj=utm +zone=35 +ellps=clrk80 +towgs84=-160,-6,-302,0,0,0,0 +units=m +no_defs  <>
-# Arc 1960 / UTM zone 36N
-<epsg21096> +proj=utm +zone=36 +ellps=clrk80 +towgs84=-160,-6,-302,0,0,0,0 +units=m +no_defs  <>
-# Arc 1960 / UTM zone 37N
-<epsg21097> +proj=utm +zone=37 +ellps=clrk80 +towgs84=-160,-6,-302,0,0,0,0 +units=m +no_defs  <>
-# Batavia (Jakarta) / NEIEZ (deprecated)
-<epsg21100> +proj=merc +lon_0=110 +k=0.997 +x_0=3900000 +y_0=900000 +ellps=bessel +towgs84=-377,681,-50,0,0,0,0 +pm=jakarta +units=m +no_defs  <>
-# Batavia / UTM zone 48S
-<epsg21148> +proj=utm +zone=48 +south +ellps=bessel +towgs84=-377,681,-50,0,0,0,0 +units=m +no_defs  <>
-# Batavia / UTM zone 49S
-<epsg21149> +proj=utm +zone=49 +south +ellps=bessel +towgs84=-377,681,-50,0,0,0,0 +units=m +no_defs  <>
-# Batavia / UTM zone 50S
-<epsg21150> +proj=utm +zone=50 +south +ellps=bessel +towgs84=-377,681,-50,0,0,0,0 +units=m +no_defs  <>
-# Barbados 1938 / British West Indies Grid
-<epsg21291> +proj=tmerc +lat_0=0 +lon_0=-62 +k=0.9995000000000001 +x_0=400000 +y_0=0 +ellps=clrk80 +towgs84=31.95,300.99,419.19,0,0,0,0 +units=m +no_defs  <>
-# Barbados 1938 / Barbados National Grid
-<epsg21292> +proj=tmerc +lat_0=13.17638888888889 +lon_0=-59.55972222222222 +k=0.9999986 +x_0=30000 +y_0=75000 +ellps=clrk80 +towgs84=31.95,300.99,419.19,0,0,0,0 +units=m +no_defs  <>
-# Beijing 1954 / Gauss-Kruger zone 13
-<epsg21413> +proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=13500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs  <>
-# Beijing 1954 / Gauss-Kruger zone 14
-<epsg21414> +proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=14500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs  <>
-# Beijing 1954 / Gauss-Kruger zone 15
-<epsg21415> +proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=15500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs  <>
-# Beijing 1954 / Gauss-Kruger zone 16
-<epsg21416> +proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=16500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs  <>
-# Beijing 1954 / Gauss-Kruger zone 17
-<epsg21417> +proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=17500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs  <>
-# Beijing 1954 / Gauss-Kruger zone 18
-<epsg21418> +proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=18500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs  <>
-# Beijing 1954 / Gauss-Kruger zone 19
-<epsg21419> +proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=19500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs  <>
-# Beijing 1954 / Gauss-Kruger zone 20
-<epsg21420> +proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=20500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs  <>
-# Beijing 1954 / Gauss-Kruger zone 21
-<epsg21421> +proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=21500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs  <>
-# Beijing 1954 / Gauss-Kruger zone 22
-<epsg21422> +proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=22500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs  <>
-# Beijing 1954 / Gauss-Kruger zone 23
-<epsg21423> +proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=23500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs  <>
-# Beijing 1954 / Gauss-Kruger CM 75E
-<epsg21453> +proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs  <>
-# Beijing 1954 / Gauss-Kruger CM 81E
-<epsg21454> +proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs  <>
-# Beijing 1954 / Gauss-Kruger CM 87E
-<epsg21455> +proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs  <>
-# Beijing 1954 / Gauss-Kruger CM 93E
-<epsg21456> +proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs  <>
-# Beijing 1954 / Gauss-Kruger CM 99E
-<epsg21457> +proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs  <>
-# Beijing 1954 / Gauss-Kruger CM 105E
-<epsg21458> +proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs  <>
-# Beijing 1954 / Gauss-Kruger CM 111E
-<epsg21459> +proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs  <>
-# Beijing 1954 / Gauss-Kruger CM 117E
-<epsg21460> +proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs  <>
-# Beijing 1954 / Gauss-Kruger CM 123E
-<epsg21461> +proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs  <>
-# Beijing 1954 / Gauss-Kruger CM 129E
-<epsg21462> +proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs  <>
-# Beijing 1954 / Gauss-Kruger CM 135E
-<epsg21463> +proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs  <>
-# Beijing 1954 / Gauss-Kruger 13N (deprecated)
-<epsg21473> +proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs  <>
-# Beijing 1954 / Gauss-Kruger 14N (deprecated)
-<epsg21474> +proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs  <>
-# Beijing 1954 / Gauss-Kruger 15N (deprecated)
-<epsg21475> +proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs  <>
-# Beijing 1954 / Gauss-Kruger 16N (deprecated)
-<epsg21476> +proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs  <>
-# Beijing 1954 / Gauss-Kruger 17N (deprecated)
-<epsg21477> +proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs  <>
-# Beijing 1954 / Gauss-Kruger 18N (deprecated)
-<epsg21478> +proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs  <>
-# Beijing 1954 / Gauss-Kruger 19N (deprecated)
-<epsg21479> +proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs  <>
-# Beijing 1954 / Gauss-Kruger 20N (deprecated)
-<epsg21480> +proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs  <>
-# Beijing 1954 / Gauss-Kruger 21N (deprecated)
-<epsg21481> +proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs  <>
-# Beijing 1954 / Gauss-Kruger 22N (deprecated)
-<epsg21482> +proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs  <>
-# Beijing 1954 / Gauss-Kruger 23N (deprecated)
-<epsg21483> +proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs  <>
-# Belge 1950 (Brussels) / Belge Lambert 50
-<epsg21500> +proj=lcc +lat_1=49.83333333333334 +lat_2=51.16666666666666 +lat_0=90 +lon_0=0 +x_0=150000 +y_0=5400000 +ellps=intl +pm=brussels +units=m +no_defs  <>
-# Bern 1898 (Bern) / LV03C
-<epsg21780> +proj=somerc +lat_0=46.95240555555556 +lon_0=0 +k_0=1 +x_0=0 +y_0=0 +ellps=bessel +towgs84=674.4,15.1,405.3,0,0,0,0 +pm=bern +units=m +no_defs  <>
-# CH1903 / LV03
-<epsg21781> +proj=somerc +lat_0=46.95240555555556 +lon_0=7.439583333333333 +k_0=1 +x_0=600000 +y_0=200000 +ellps=bessel +towgs84=674.4,15.1,405.3,0,0,0,0 +units=m +no_defs  <>
-# CH1903 / LV03C-G
-<epsg21782> +proj=somerc +lat_0=46.95240555555556 +lon_0=7.439583333333333 +k_0=1 +x_0=0 +y_0=0 +ellps=bessel +towgs84=674.4,15.1,405.3,0,0,0,0 +units=m +no_defs  <>
-# Bogota 1975 / UTM zone 17N (deprecated)
-<epsg21817> +proj=utm +zone=17 +ellps=intl +towgs84=307,304,-318,0,0,0,0 +units=m +no_defs  <>
-# Bogota 1975 / UTM zone 18N
-<epsg21818> +proj=utm +zone=18 +ellps=intl +towgs84=307,304,-318,0,0,0,0 +units=m +no_defs  <>
-# Bogota 1975 / Colombia West zone (deprecated)
-<epsg21891> +proj=tmerc +lat_0=4.599047222222222 +lon_0=-77.08091666666667 +k=1 +x_0=1000000 +y_0=1000000 +ellps=intl +towgs84=307,304,-318,0,0,0,0 +units=m +no_defs  <>
-# Bogota 1975 / Colombia Bogota zone (deprecated)
-<epsg21892> +proj=tmerc +lat_0=4.599047222222222 +lon_0=-74.08091666666667 +k=1 +x_0=1000000 +y_0=1000000 +ellps=intl +towgs84=307,304,-318,0,0,0,0 +units=m +no_defs  <>
-# Bogota 1975 / Colombia East Central zone (deprecated)
-<epsg21893> +proj=tmerc +lat_0=4.599047222222222 +lon_0=-71.08091666666667 +k=1 +x_0=1000000 +y_0=1000000 +ellps=intl +towgs84=307,304,-318,0,0,0,0 +units=m +no_defs  <>
-# Bogota 1975 / Colombia East (deprecated)
-<epsg21894> +proj=tmerc +lat_0=4.599047222222222 +lon_0=-68.08091666666667 +k=1 +x_0=1000000 +y_0=1000000 +ellps=intl +towgs84=307,304,-318,0,0,0,0 +units=m +no_defs  <>
-# Bogota 1975 / Colombia West zone
-<epsg21896> +proj=tmerc +lat_0=4.599047222222222 +lon_0=-77.08091666666667 +k=1 +x_0=1000000 +y_0=1000000 +ellps=intl +towgs84=307,304,-318,0,0,0,0 +units=m +no_defs  <>
-# Bogota 1975 / Colombia Bogota zone
-<epsg21897> +proj=tmerc +lat_0=4.599047222222222 +lon_0=-74.08091666666667 +k=1 +x_0=1000000 +y_0=1000000 +ellps=intl +towgs84=307,304,-318,0,0,0,0 +units=m +no_defs  <>
-# Bogota 1975 / Colombia East Central zone
-<epsg21898> +proj=tmerc +lat_0=4.599047222222222 +lon_0=-71.08091666666667 +k=1 +x_0=1000000 +y_0=1000000 +ellps=intl +towgs84=307,304,-318,0,0,0,0 +units=m +no_defs  <>
-# Bogota 1975 / Colombia East
-<epsg21899> +proj=tmerc +lat_0=4.599047222222222 +lon_0=-68.08091666666667 +k=1 +x_0=1000000 +y_0=1000000 +ellps=intl +towgs84=307,304,-318,0,0,0,0 +units=m +no_defs  <>
-# Camacupa / UTM zone 32S
-<epsg22032> +proj=utm +zone=32 +south +ellps=clrk80 +towgs84=-50.9,-347.6,-231,0,0,0,0 +units=m +no_defs  <>
-# Camacupa / UTM zone 33S
-<epsg22033> +proj=utm +zone=33 +south +ellps=clrk80 +towgs84=-50.9,-347.6,-231,0,0,0,0 +units=m +no_defs  <>
-# Camacupa / TM 11.30 SE
-<epsg22091> +proj=tmerc +lat_0=0 +lon_0=11.5 +k=0.9996 +x_0=500000 +y_0=10000000 +ellps=clrk80 +towgs84=-50.9,-347.6,-231,0,0,0,0 +units=m +no_defs  <>
-# Camacupa / TM 12 SE
-<epsg22092> +proj=tmerc +lat_0=0 +lon_0=12 +k=0.9996 +x_0=500000 +y_0=10000000 +ellps=clrk80 +towgs84=-50.9,-347.6,-231,0,0,0,0 +units=m +no_defs  <>
-# POSGAR 98 / Argentina 1
-<epsg22171> +proj=tmerc +lat_0=-90 +lon_0=-72 +k=1 +x_0=1500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# POSGAR 98 / Argentina 2
-<epsg22172> +proj=tmerc +lat_0=-90 +lon_0=-69 +k=1 +x_0=2500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# POSGAR 98 / Argentina 3
-<epsg22173> +proj=tmerc +lat_0=-90 +lon_0=-66 +k=1 +x_0=3500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# POSGAR 98 / Argentina 4
-<epsg22174> +proj=tmerc +lat_0=-90 +lon_0=-63 +k=1 +x_0=4500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# POSGAR 98 / Argentina 5
-<epsg22175> +proj=tmerc +lat_0=-90 +lon_0=-60 +k=1 +x_0=5500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# POSGAR 98 / Argentina 6
-<epsg22176> +proj=tmerc +lat_0=-90 +lon_0=-57 +k=1 +x_0=6500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# POSGAR 98 / Argentina 7
-<epsg22177> +proj=tmerc +lat_0=-90 +lon_0=-54 +k=1 +x_0=7500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# POSGAR 94 / Argentina 1
-<epsg22181> +proj=tmerc +lat_0=-90 +lon_0=-72 +k=1 +x_0=1500000 +y_0=0 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# POSGAR 94 / Argentina 2
-<epsg22182> +proj=tmerc +lat_0=-90 +lon_0=-69 +k=1 +x_0=2500000 +y_0=0 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# POSGAR 94 / Argentina 3
-<epsg22183> +proj=tmerc +lat_0=-90 +lon_0=-66 +k=1 +x_0=3500000 +y_0=0 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# POSGAR 94 / Argentina 4
-<epsg22184> +proj=tmerc +lat_0=-90 +lon_0=-63 +k=1 +x_0=4500000 +y_0=0 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# POSGAR 94 / Argentina 5
-<epsg22185> +proj=tmerc +lat_0=-90 +lon_0=-60 +k=1 +x_0=5500000 +y_0=0 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# POSGAR 94 / Argentina 6
-<epsg22186> +proj=tmerc +lat_0=-90 +lon_0=-57 +k=1 +x_0=6500000 +y_0=0 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# POSGAR 94 / Argentina 7
-<epsg22187> +proj=tmerc +lat_0=-90 +lon_0=-54 +k=1 +x_0=7500000 +y_0=0 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# Campo Inchauspe / Argentina 1
-<epsg22191> +proj=tmerc +lat_0=-90 +lon_0=-72 +k=1 +x_0=1500000 +y_0=0 +ellps=intl +towgs84=-148,136,90,0,0,0,0 +units=m +no_defs  <>
-# Campo Inchauspe / Argentina 2
-<epsg22192> +proj=tmerc +lat_0=-90 +lon_0=-69 +k=1 +x_0=2500000 +y_0=0 +ellps=intl +towgs84=-148,136,90,0,0,0,0 +units=m +no_defs  <>
-# Campo Inchauspe / Argentina 3
-<epsg22193> +proj=tmerc +lat_0=-90 +lon_0=-66 +k=1 +x_0=3500000 +y_0=0 +ellps=intl +towgs84=-148,136,90,0,0,0,0 +units=m +no_defs  <>
-# Campo Inchauspe / Argentina 4
-<epsg22194> +proj=tmerc +lat_0=-90 +lon_0=-63 +k=1 +x_0=4500000 +y_0=0 +ellps=intl +towgs84=-148,136,90,0,0,0,0 +units=m +no_defs  <>
-# Campo Inchauspe / Argentina 5
-<epsg22195> +proj=tmerc +lat_0=-90 +lon_0=-60 +k=1 +x_0=5500000 +y_0=0 +ellps=intl +towgs84=-148,136,90,0,0,0,0 +units=m +no_defs  <>
-# Campo Inchauspe / Argentina 6
-<epsg22196> +proj=tmerc +lat_0=-90 +lon_0=-57 +k=1 +x_0=6500000 +y_0=0 +ellps=intl +towgs84=-148,136,90,0,0,0,0 +units=m +no_defs  <>
-# Campo Inchauspe / Argentina 7
-<epsg22197> +proj=tmerc +lat_0=-90 +lon_0=-54 +k=1 +x_0=7500000 +y_0=0 +ellps=intl +towgs84=-148,136,90,0,0,0,0 +units=m +no_defs  <>
-# Cape / UTM zone 34S
-<epsg22234> +proj=utm +zone=34 +south +a=6378249.145 +b=6356514.966398753 +towgs84=-136,-108,-292,0,0,0,0 +units=m +no_defs  <>
-# Cape / UTM zone 35S
-<epsg22235> +proj=utm +zone=35 +south +a=6378249.145 +b=6356514.966398753 +towgs84=-136,-108,-292,0,0,0,0 +units=m +no_defs  <>
-# Cape / UTM zone 36S (deprecated)
-<epsg22236> +proj=utm +zone=36 +south +a=6378249.145 +b=6356514.966398753 +towgs84=-136,-108,-292,0,0,0,0 +units=m +no_defs  <>
-# Cape / Lo15
-<epsg22275> +proj=tmerc +lat_0=0 +lon_0=15 +k=1 +x_0=0 +y_0=0 +axis=wsu +a=6378249.145 +b=6356514.966398753 +towgs84=-136,-108,-292,0,0,0,0 +units=m +no_defs  <>
-# Cape / Lo17
-<epsg22277> +proj=tmerc +lat_0=0 +lon_0=17 +k=1 +x_0=0 +y_0=0 +axis=wsu +a=6378249.145 +b=6356514.966398753 +towgs84=-136,-108,-292,0,0,0,0 +units=m +no_defs  <>
-# Cape / Lo19
-<epsg22279> +proj=tmerc +lat_0=0 +lon_0=19 +k=1 +x_0=0 +y_0=0 +axis=wsu +a=6378249.145 +b=6356514.966398753 +towgs84=-136,-108,-292,0,0,0,0 +units=m +no_defs  <>
-# Cape / Lo21
-<epsg22281> +proj=tmerc +lat_0=0 +lon_0=21 +k=1 +x_0=0 +y_0=0 +axis=wsu +a=6378249.145 +b=6356514.966398753 +towgs84=-136,-108,-292,0,0,0,0 +units=m +no_defs  <>
-# Cape / Lo23
-<epsg22283> +proj=tmerc +lat_0=0 +lon_0=23 +k=1 +x_0=0 +y_0=0 +axis=wsu +a=6378249.145 +b=6356514.966398753 +towgs84=-136,-108,-292,0,0,0,0 +units=m +no_defs  <>
-# Cape / Lo25
-<epsg22285> +proj=tmerc +lat_0=0 +lon_0=25 +k=1 +x_0=0 +y_0=0 +axis=wsu +a=6378249.145 +b=6356514.966398753 +towgs84=-136,-108,-292,0,0,0,0 +units=m +no_defs  <>
-# Cape / Lo27
-<epsg22287> +proj=tmerc +lat_0=0 +lon_0=27 +k=1 +x_0=0 +y_0=0 +axis=wsu +a=6378249.145 +b=6356514.966398753 +towgs84=-136,-108,-292,0,0,0,0 +units=m +no_defs  <>
-# Cape / Lo29
-<epsg22289> +proj=tmerc +lat_0=0 +lon_0=29 +k=1 +x_0=0 +y_0=0 +axis=wsu +a=6378249.145 +b=6356514.966398753 +towgs84=-136,-108,-292,0,0,0,0 +units=m +no_defs  <>
-# Cape / Lo31
-<epsg22291> +proj=tmerc +lat_0=0 +lon_0=31 +k=1 +x_0=0 +y_0=0 +axis=wsu +a=6378249.145 +b=6356514.966398753 +towgs84=-136,-108,-292,0,0,0,0 +units=m +no_defs  <>
-# Cape / Lo33
-<epsg22293> +proj=tmerc +lat_0=0 +lon_0=33 +k=1 +x_0=0 +y_0=0 +axis=wsu +a=6378249.145 +b=6356514.966398753 +towgs84=-136,-108,-292,0,0,0,0 +units=m +no_defs  <>
-# Carthage (Paris) / Tunisia Mining Grid
-# Unable to translate coordinate system EPSG:22300 into PROJ.4 format.
-#
-# Carthage / UTM zone 32N
-<epsg22332> +proj=utm +zone=32 +datum=carthage +units=m +no_defs  <>
-# Carthage / Nord Tunisie
-<epsg22391> +proj=lcc +lat_1=36 +lat_0=36 +lon_0=9.9 +k_0=0.999625544 +x_0=500000 +y_0=300000 +datum=carthage +units=m +no_defs  <>
-# Carthage / Sud Tunisie
-<epsg22392> +proj=lcc +lat_1=33.3 +lat_0=33.3 +lon_0=9.9 +k_0=0.999625769 +x_0=500000 +y_0=300000 +datum=carthage +units=m +no_defs  <>
-# Corrego Alegre 1970-72 / UTM zone 21S
-<epsg22521> +proj=utm +zone=21 +south +ellps=intl +towgs84=-206,172,-6,0,0,0,0 +units=m +no_defs  <>
-# Corrego Alegre 1970-72 / UTM zone 22S
-<epsg22522> +proj=utm +zone=22 +south +ellps=intl +towgs84=-206,172,-6,0,0,0,0 +units=m +no_defs  <>
-# Corrego Alegre 1970-72 / UTM zone 23S
-<epsg22523> +proj=utm +zone=23 +south +ellps=intl +towgs84=-206,172,-6,0,0,0,0 +units=m +no_defs  <>
-# Corrego Alegre 1970-72 / UTM zone 24S
-<epsg22524> +proj=utm +zone=24 +south +ellps=intl +towgs84=-206,172,-6,0,0,0,0 +units=m +no_defs  <>
-# Corrego Alegre 1970-72 / UTM zone 25S
-<epsg22525> +proj=utm +zone=25 +south +ellps=intl +towgs84=-206,172,-6,0,0,0,0 +units=m +no_defs  <>
-# Deir ez Zor / Levant Zone
-<epsg22700> +proj=lcc +lat_1=34.65 +lat_0=34.65 +lon_0=37.35 +k_0=0.9996256 +x_0=300000 +y_0=300000 +a=6378249.2 +b=6356515 +towgs84=-190.421,8.532,238.69,0,0,0,0 +units=m +no_defs  <>
-# Deir ez Zor / Syria Lambert
-<epsg22770> +proj=lcc +lat_1=34.65 +lat_0=34.65 +lon_0=37.35 +k_0=0.9996256 +x_0=300000 +y_0=300000 +a=6378249.2 +b=6356515 +towgs84=-190.421,8.532,238.69,0,0,0,0 +units=m +no_defs  <>
-# Deir ez Zor / Levant Stereographic
-<epsg22780> +proj=sterea +lat_0=34.2 +lon_0=39.15 +k=0.9995341 +x_0=0 +y_0=0 +a=6378249.2 +b=6356515 +towgs84=-190.421,8.532,238.69,0,0,0,0 +units=m +no_defs  <>
-# Douala / UTM zone 32N (deprecated)
-<epsg22832> +proj=utm +zone=32 +a=6378249.2 +b=6356515 +units=m +no_defs  <>
-# Egypt 1907 / Blue Belt
-<epsg22991> +proj=tmerc +lat_0=30 +lon_0=35 +k=1 +x_0=300000 +y_0=1100000 +ellps=helmert +towgs84=-130,110,-13,0,0,0,0 +units=m +no_defs  <>
-# Egypt 1907 / Red Belt
-<epsg22992> +proj=tmerc +lat_0=30 +lon_0=31 +k=1 +x_0=615000 +y_0=810000 +ellps=helmert +towgs84=-130,110,-13,0,0,0,0 +units=m +no_defs  <>
-# Egypt 1907 / Purple Belt
-<epsg22993> +proj=tmerc +lat_0=30 +lon_0=27 +k=1 +x_0=700000 +y_0=200000 +ellps=helmert +towgs84=-130,110,-13,0,0,0,0 +units=m +no_defs  <>
-# Egypt 1907 / Extended Purple Belt
-<epsg22994> +proj=tmerc +lat_0=30 +lon_0=27 +k=1 +x_0=700000 +y_0=1200000 +ellps=helmert +towgs84=-130,110,-13,0,0,0,0 +units=m +no_defs  <>
-# ED50 / UTM zone 28N
-<epsg23028> +proj=utm +zone=28 +ellps=intl +towgs84=-87,-98,-121,0,0,0,0 +units=m +no_defs  <>
-# ED50 / UTM zone 29N
-<epsg23029> +proj=utm +zone=29 +ellps=intl +towgs84=-87,-98,-121,0,0,0,0 +units=m +no_defs  <>
-# ED50 / UTM zone 30N
-<epsg23030> +proj=utm +zone=30 +ellps=intl +towgs84=-87,-98,-121,0,0,0,0 +units=m +no_defs  <>
-# ED50 / UTM zone 31N
-<epsg23031> +proj=utm +zone=31 +ellps=intl +towgs84=-87,-98,-121,0,0,0,0 +units=m +no_defs  <>
-# ED50 / UTM zone 32N
-<epsg23032> +proj=utm +zone=32 +ellps=intl +towgs84=-87,-98,-121,0,0,0,0 +units=m +no_defs  <>
-# ED50 / UTM zone 33N
-<epsg23033> +proj=utm +zone=33 +ellps=intl +towgs84=-87,-98,-121,0,0,0,0 +units=m +no_defs  <>
-# ED50 / UTM zone 34N
-<epsg23034> +proj=utm +zone=34 +ellps=intl +towgs84=-87,-98,-121,0,0,0,0 +units=m +no_defs  <>
-# ED50 / UTM zone 35N
-<epsg23035> +proj=utm +zone=35 +ellps=intl +towgs84=-87,-98,-121,0,0,0,0 +units=m +no_defs  <>
-# ED50 / UTM zone 36N
-<epsg23036> +proj=utm +zone=36 +ellps=intl +towgs84=-87,-98,-121,0,0,0,0 +units=m +no_defs  <>
-# ED50 / UTM zone 37N
-<epsg23037> +proj=utm +zone=37 +ellps=intl +towgs84=-87,-98,-121,0,0,0,0 +units=m +no_defs  <>
-# ED50 / UTM zone 38N
-<epsg23038> +proj=utm +zone=38 +ellps=intl +towgs84=-87,-98,-121,0,0,0,0 +units=m +no_defs  <>
-# ED50 / TM 0 N
-<epsg23090> +proj=tmerc +lat_0=0 +lon_0=0 +k=0.9996 +x_0=500000 +y_0=0 +ellps=intl +towgs84=-87,-98,-121,0,0,0,0 +units=m +no_defs  <>
-# ED50 / TM 5 NE
-<epsg23095> +proj=tmerc +lat_0=0 +lon_0=5 +k=0.9996 +x_0=500000 +y_0=0 +ellps=intl +towgs84=-87,-98,-121,0,0,0,0 +units=m +no_defs  <>
-# Fahud / UTM zone 39N
-<epsg23239> +proj=utm +zone=39 +ellps=clrk80 +towgs84=-346,-1,224,0,0,0,0 +units=m +no_defs  <>
-# Fahud / UTM zone 40N
-<epsg23240> +proj=utm +zone=40 +ellps=clrk80 +towgs84=-346,-1,224,0,0,0,0 +units=m +no_defs  <>
-# Garoua / UTM zone 33N (deprecated)
-<epsg23433> +proj=utm +zone=33 +a=6378249.2 +b=6356515 +units=m +no_defs  <>
-# HD72 / EOV
-<epsg23700> +proj=somerc +lat_0=47.14439372222222 +lon_0=19.04857177777778 +k_0=0.99993 +x_0=650000 +y_0=200000 +ellps=GRS67 +towgs84=52.17,-71.82,-14.9,0,0,0,0 +units=m +no_defs  <>
-# DGN95 / Indonesia TM-3 zone 46.2
-<epsg23830> +proj=tmerc +lat_0=0 +lon_0=94.5 +k=0.9999 +x_0=200000 +y_0=1500000 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# DGN95 / Indonesia TM-3 zone 47.1
-<epsg23831> +proj=tmerc +lat_0=0 +lon_0=97.5 +k=0.9999 +x_0=200000 +y_0=1500000 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# DGN95 / Indonesia TM-3 zone 47.2
-<epsg23832> +proj=tmerc +lat_0=0 +lon_0=100.5 +k=0.9999 +x_0=200000 +y_0=1500000 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# DGN95 / Indonesia TM-3 zone 48.1
-<epsg23833> +proj=tmerc +lat_0=0 +lon_0=103.5 +k=0.9999 +x_0=200000 +y_0=1500000 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# DGN95 / Indonesia TM-3 zone 48.2
-<epsg23834> +proj=tmerc +lat_0=0 +lon_0=106.5 +k=0.9999 +x_0=200000 +y_0=1500000 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# DGN95 / Indonesia TM-3 zone 49.1
-<epsg23835> +proj=tmerc +lat_0=0 +lon_0=109.5 +k=0.9999 +x_0=200000 +y_0=1500000 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# DGN95 / Indonesia TM-3 zone 49.2
-<epsg23836> +proj=tmerc +lat_0=0 +lon_0=112.5 +k=0.9999 +x_0=200000 +y_0=1500000 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# DGN95 / Indonesia TM-3 zone 50.1
-<epsg23837> +proj=tmerc +lat_0=0 +lon_0=115.5 +k=0.9999 +x_0=200000 +y_0=1500000 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# DGN95 / Indonesia TM-3 zone 50.2
-<epsg23838> +proj=tmerc +lat_0=0 +lon_0=118.5 +k=0.9999 +x_0=200000 +y_0=1500000 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# DGN95 / Indonesia TM-3 zone 51.1
-<epsg23839> +proj=tmerc +lat_0=0 +lon_0=121.5 +k=0.9999 +x_0=200000 +y_0=1500000 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# DGN95 / Indonesia TM-3 zone 51.2
-<epsg23840> +proj=tmerc +lat_0=0 +lon_0=124.5 +k=0.9999 +x_0=200000 +y_0=1500000 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# DGN95 / Indonesia TM-3 zone 52.1
-<epsg23841> +proj=tmerc +lat_0=0 +lon_0=127.5 +k=0.9999 +x_0=200000 +y_0=1500000 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# DGN95 / Indonesia TM-3 zone 52.2
-<epsg23842> +proj=tmerc +lat_0=0 +lon_0=130.5 +k=0.9999 +x_0=200000 +y_0=1500000 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# DGN95 / Indonesia TM-3 zone 53.1
-<epsg23843> +proj=tmerc +lat_0=0 +lon_0=133.5 +k=0.9999 +x_0=200000 +y_0=1500000 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# DGN95 / Indonesia TM-3 zone 53.2
-<epsg23844> +proj=tmerc +lat_0=0 +lon_0=136.5 +k=0.9999 +x_0=200000 +y_0=1500000 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# DGN95 / Indonesia TM-3 zone 54.1
-<epsg23845> +proj=tmerc +lat_0=0 +lon_0=139.5 +k=0.9999 +x_0=200000 +y_0=1500000 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ID74 / UTM zone 46N
-<epsg23846> +proj=utm +zone=46 +a=6378160 +b=6356774.50408554 +towgs84=-24,-15,5,0,0,0,0 +units=m +no_defs  <>
-# ID74 / UTM zone 47N
-<epsg23847> +proj=utm +zone=47 +a=6378160 +b=6356774.50408554 +towgs84=-24,-15,5,0,0,0,0 +units=m +no_defs  <>
-# ID74 / UTM zone 48N
-<epsg23848> +proj=utm +zone=48 +a=6378160 +b=6356774.50408554 +towgs84=-24,-15,5,0,0,0,0 +units=m +no_defs  <>
-# ID74 / UTM zone 49N
-<epsg23849> +proj=utm +zone=49 +a=6378160 +b=6356774.50408554 +towgs84=-24,-15,5,0,0,0,0 +units=m +no_defs  <>
-# ID74 / UTM zone 50N
-<epsg23850> +proj=utm +zone=50 +a=6378160 +b=6356774.50408554 +towgs84=-24,-15,5,0,0,0,0 +units=m +no_defs  <>
-# ID74 / UTM zone 51N
-<epsg23851> +proj=utm +zone=51 +a=6378160 +b=6356774.50408554 +towgs84=-24,-15,5,0,0,0,0 +units=m +no_defs  <>
-# ID74 / UTM zone 52N
-<epsg23852> +proj=utm +zone=52 +a=6378160 +b=6356774.50408554 +towgs84=-24,-15,5,0,0,0,0 +units=m +no_defs  <>
-# ID74 / UTM zone 53N (deprecated)
-<epsg23853> +proj=utm +zone=53 +a=6378160 +b=6356774.50408554 +towgs84=-24,-15,5,0,0,0,0 +units=m +no_defs  <>
-# DGN95 / UTM zone 46N
-<epsg23866> +proj=utm +zone=46 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# DGN95 / UTM zone 47N
-<epsg23867> +proj=utm +zone=47 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# DGN95 / UTM zone 48N
-<epsg23868> +proj=utm +zone=48 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# DGN95 / UTM zone 49N
-<epsg23869> +proj=utm +zone=49 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# DGN95 / UTM zone 50N
-<epsg23870> +proj=utm +zone=50 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# DGN95 / UTM zone 51N
-<epsg23871> +proj=utm +zone=51 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# DGN95 / UTM zone 52N
-<epsg23872> +proj=utm +zone=52 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# DGN95 / UTM zone 47S
-<epsg23877> +proj=utm +zone=47 +south +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# DGN95 / UTM zone 48S
-<epsg23878> +proj=utm +zone=48 +south +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# DGN95 / UTM zone 49S
-<epsg23879> +proj=utm +zone=49 +south +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# DGN95 / UTM zone 50S
-<epsg23880> +proj=utm +zone=50 +south +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# DGN95 / UTM zone 51S
-<epsg23881> +proj=utm +zone=51 +south +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# DGN95 / UTM zone 52S
-<epsg23882> +proj=utm +zone=52 +south +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# DGN95 / UTM zone 53S
-<epsg23883> +proj=utm +zone=53 +south +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# DGN95 / UTM zone 54S
-<epsg23884> +proj=utm +zone=54 +south +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ID74 / UTM zone 46S (deprecated)
-<epsg23886> +proj=utm +zone=46 +south +a=6378160 +b=6356774.50408554 +towgs84=-24,-15,5,0,0,0,0 +units=m +no_defs  <>
-# ID74 / UTM zone 47S
-<epsg23887> +proj=utm +zone=47 +south +a=6378160 +b=6356774.50408554 +towgs84=-24,-15,5,0,0,0,0 +units=m +no_defs  <>
-# ID74 / UTM zone 48S
-<epsg23888> +proj=utm +zone=48 +south +a=6378160 +b=6356774.50408554 +towgs84=-24,-15,5,0,0,0,0 +units=m +no_defs  <>
-# ID74 / UTM zone 49S
-<epsg23889> +proj=utm +zone=49 +south +a=6378160 +b=6356774.50408554 +towgs84=-24,-15,5,0,0,0,0 +units=m +no_defs  <>
-# ID74 / UTM zone 50S
-<epsg23890> +proj=utm +zone=50 +south +a=6378160 +b=6356774.50408554 +towgs84=-24,-15,5,0,0,0,0 +units=m +no_defs  <>
-# ID74 / UTM zone 51S
-<epsg23891> +proj=utm +zone=51 +south +a=6378160 +b=6356774.50408554 +towgs84=-24,-15,5,0,0,0,0 +units=m +no_defs  <>
-# ID74 / UTM zone 52S
-<epsg23892> +proj=utm +zone=52 +south +a=6378160 +b=6356774.50408554 +towgs84=-24,-15,5,0,0,0,0 +units=m +no_defs  <>
-# ID74 / UTM zone 53S
-<epsg23893> +proj=utm +zone=53 +south +a=6378160 +b=6356774.50408554 +towgs84=-24,-15,5,0,0,0,0 +units=m +no_defs  <>
-# ID74 / UTM zone 54S
-<epsg23894> +proj=utm +zone=54 +south +a=6378160 +b=6356774.50408554 +towgs84=-24,-15,5,0,0,0,0 +units=m +no_defs  <>
-# Indian 1954 / UTM zone 46N
-<epsg23946> +proj=utm +zone=46 +a=6377276.345 +b=6356075.41314024 +towgs84=217,823,299,0,0,0,0 +units=m +no_defs  <>
-# Indian 1954 / UTM zone 47N
-<epsg23947> +proj=utm +zone=47 +a=6377276.345 +b=6356075.41314024 +towgs84=217,823,299,0,0,0,0 +units=m +no_defs  <>
-# Indian 1954 / UTM zone 48N
-<epsg23948> +proj=utm +zone=48 +a=6377276.345 +b=6356075.41314024 +towgs84=217,823,299,0,0,0,0 +units=m +no_defs  <>
-# Indian 1975 / UTM zone 47N
-<epsg24047> +proj=utm +zone=47 +a=6377276.345 +b=6356075.41314024 +towgs84=210,814,289,0,0,0,0 +units=m +no_defs  <>
-# Indian 1975 / UTM zone 48N
-<epsg24048> +proj=utm +zone=48 +a=6377276.345 +b=6356075.41314024 +towgs84=210,814,289,0,0,0,0 +units=m +no_defs  <>
-# Jamaica 1875 / Jamaica (Old Grid)
-<epsg24100> +proj=lcc +lat_1=18 +lat_0=18 +lon_0=-77 +k_0=1 +x_0=167638.49597 +y_0=121918.90616 +a=6378249.144808011 +b=6356514.966204134 +to_meter=0.3047972654 +no_defs  <>
-# JAD69 / Jamaica National Grid
-<epsg24200> +proj=lcc +lat_1=18 +lat_0=18 +lon_0=-77 +k_0=1 +x_0=250000 +y_0=150000 +ellps=clrk66 +towgs84=70,207,389.5,0,0,0,0 +units=m +no_defs  <>
-# Kalianpur 1937 / UTM zone 45N
-<epsg24305> +proj=utm +zone=45 +a=6377276.345 +b=6356075.41314024 +towgs84=282,726,254,0,0,0,0 +units=m +no_defs  <>
-# Kalianpur 1937 / UTM zone 46N
-<epsg24306> +proj=utm +zone=46 +a=6377276.345 +b=6356075.41314024 +towgs84=282,726,254,0,0,0,0 +units=m +no_defs  <>
-# Kalianpur 1962 / UTM zone 41N
-<epsg24311> +proj=utm +zone=41 +a=6377301.243 +b=6356100.230165384 +towgs84=283,682,231,0,0,0,0 +units=m +no_defs  <>
-# Kalianpur 1962 / UTM zone 42N
-<epsg24312> +proj=utm +zone=42 +a=6377301.243 +b=6356100.230165384 +towgs84=283,682,231,0,0,0,0 +units=m +no_defs  <>
-# Kalianpur 1962 / UTM zone 43N
-<epsg24313> +proj=utm +zone=43 +a=6377301.243 +b=6356100.230165384 +towgs84=283,682,231,0,0,0,0 +units=m +no_defs  <>
-# Kalianpur 1975 / UTM zone 42N
-<epsg24342> +proj=utm +zone=42 +a=6377299.151 +b=6356098.145120132 +towgs84=295,736,257,0,0,0,0 +units=m +no_defs  <>
-# Kalianpur 1975 / UTM zone 43N
-<epsg24343> +proj=utm +zone=43 +a=6377299.151 +b=6356098.145120132 +towgs84=295,736,257,0,0,0,0 +units=m +no_defs  <>
-# Kalianpur 1975 / UTM zone 44N
-<epsg24344> +proj=utm +zone=44 +a=6377299.151 +b=6356098.145120132 +towgs84=295,736,257,0,0,0,0 +units=m +no_defs  <>
-# Kalianpur 1975 / UTM zone 45N
-<epsg24345> +proj=utm +zone=45 +a=6377299.151 +b=6356098.145120132 +towgs84=295,736,257,0,0,0,0 +units=m +no_defs  <>
-# Kalianpur 1975 / UTM zone 46N
-<epsg24346> +proj=utm +zone=46 +a=6377299.151 +b=6356098.145120132 +towgs84=295,736,257,0,0,0,0 +units=m +no_defs  <>
-# Kalianpur 1975 / UTM zone 47N
-<epsg24347> +proj=utm +zone=47 +a=6377299.151 +b=6356098.145120132 +towgs84=295,736,257,0,0,0,0 +units=m +no_defs  <>
-# Kalianpur 1880 / India zone 0
-<epsg24370> +proj=lcc +lat_1=39.5 +lat_0=39.5 +lon_0=68 +k_0=0.99846154 +x_0=2153865.73916853 +y_0=2368292.194628102 +a=6377299.36559538 +b=6356098.359005156 +to_meter=0.9143985307444408 +no_defs  <>
-# Kalianpur 1880 / India zone I
-<epsg24371> +proj=lcc +lat_1=32.5 +lat_0=32.5 +lon_0=68 +k_0=0.99878641 +x_0=2743195.592233322 +y_0=914398.5307444407 +a=6377299.36559538 +b=6356098.359005156 +to_meter=0.9143985307444408 +no_defs  <>
-# Kalianpur 1880 / India zone IIa
-<epsg24372> +proj=lcc +lat_1=26 +lat_0=26 +lon_0=74 +k_0=0.99878641 +x_0=2743195.592233322 +y_0=914398.5307444407 +a=6377299.36559538 +b=6356098.359005156 +to_meter=0.9143985307444408 +no_defs  <>
-# Kalianpur 1880 / India zone III
-<epsg24373> +proj=lcc +lat_1=19 +lat_0=19 +lon_0=80 +k_0=0.99878641 +x_0=2743195.592233322 +y_0=914398.5307444407 +a=6377299.36559538 +b=6356098.359005156 +to_meter=0.9143985307444408 +no_defs  <>
-# Kalianpur 1880 / India zone IV
-<epsg24374> +proj=lcc +lat_1=12 +lat_0=12 +lon_0=80 +k_0=0.99878641 +x_0=2743195.592233322 +y_0=914398.5307444407 +a=6377299.36559538 +b=6356098.359005156 +to_meter=0.9143985307444408 +no_defs  <>
-# Kalianpur 1937 / India zone IIb
-<epsg24375> +proj=lcc +lat_1=26 +lat_0=26 +lon_0=90 +k_0=0.99878641 +x_0=2743185.69 +y_0=914395.23 +a=6377276.345 +b=6356075.41314024 +towgs84=282,726,254,0,0,0,0 +units=m +no_defs  <>
-# Kalianpur 1962 / India zone I
-<epsg24376> +proj=lcc +lat_1=32.5 +lat_0=32.5 +lon_0=68 +k_0=0.99878641 +x_0=2743196.4 +y_0=914398.8 +a=6377301.243 +b=6356100.230165384 +towgs84=283,682,231,0,0,0,0 +units=m +no_defs  <>
-# Kalianpur 1962 / India zone IIa
-<epsg24377> +proj=lcc +lat_1=26 +lat_0=26 +lon_0=74 +k_0=0.99878641 +x_0=2743196.4 +y_0=914398.8 +a=6377301.243 +b=6356100.230165384 +towgs84=283,682,231,0,0,0,0 +units=m +no_defs  <>
-# Kalianpur 1975 / India zone I
-<epsg24378> +proj=lcc +lat_1=32.5 +lat_0=32.5 +lon_0=68 +k_0=0.99878641 +x_0=2743195.5 +y_0=914398.5 +a=6377299.151 +b=6356098.145120132 +towgs84=295,736,257,0,0,0,0 +units=m +no_defs  <>
-# Kalianpur 1975 / India zone IIa
-<epsg24379> +proj=lcc +lat_1=26 +lat_0=26 +lon_0=74 +k_0=0.99878641 +x_0=2743195.5 +y_0=914398.5 +a=6377299.151 +b=6356098.145120132 +towgs84=295,736,257,0,0,0,0 +units=m +no_defs  <>
-# Kalianpur 1975 / India zone IIb
-<epsg24380> +proj=lcc +lat_1=26 +lat_0=26 +lon_0=90 +k_0=0.99878641 +x_0=2743195.5 +y_0=914398.5 +a=6377299.151 +b=6356098.145120132 +towgs84=295,736,257,0,0,0,0 +units=m +no_defs  <>
-# Kalianpur 1975 / India zone III
-<epsg24381> +proj=lcc +lat_1=19 +lat_0=19 +lon_0=80 +k_0=0.99878641 +x_0=2743195.5 +y_0=914398.5 +a=6377299.151 +b=6356098.145120132 +towgs84=295,736,257,0,0,0,0 +units=m +no_defs  <>
-# Kalianpur 1880 / India zone IIb
-<epsg24382> +proj=lcc +lat_1=26 +lat_0=26 +lon_0=90 +k_0=0.99878641 +x_0=2743195.592233322 +y_0=914398.5307444407 +a=6377299.36559538 +b=6356098.359005156 +to_meter=0.9143985307444408 +no_defs  <>
-# Kalianpur 1975 / India zone IV
-<epsg24383> +proj=lcc +lat_1=12 +lat_0=12 +lon_0=80 +k_0=0.99878641 +x_0=2743195.5 +y_0=914398.5 +a=6377299.151 +b=6356098.145120132 +towgs84=295,736,257,0,0,0,0 +units=m +no_defs  <>
-# Kertau 1968 / Singapore Grid
-<epsg24500> +proj=cass +lat_0=1.287646666666667 +lon_0=103.8530022222222 +x_0=30000 +y_0=30000 +a=6377304.063 +b=6356103.038993155 +towgs84=-11,851,5,0,0,0,0 +units=m +no_defs  <>
-# Kertau 1968 / UTM zone 47N
-<epsg24547> +proj=utm +zone=47 +a=6377304.063 +b=6356103.038993155 +towgs84=-11,851,5,0,0,0,0 +units=m +no_defs  <>
-# Kertau 1968 / UTM zone 48N
-<epsg24548> +proj=utm +zone=48 +a=6377304.063 +b=6356103.038993155 +towgs84=-11,851,5,0,0,0,0 +units=m +no_defs  <>
-# Kertau / R.S.O. Malaya (ch) (deprecated)
-<epsg24571> +proj=omerc +lat_0=4 +lonc=102.25 +alpha=323.0257905 +k=0.99984 +x_0=804671.2997750348 +y_0=0 +no_uoff +gamma=323.1301023611111 +a=6377304.063 +b=6356103.038993155 +towgs84=-11,851,5,0,0,0,0 +to_meter=20.11678249437587 +no_defs  <>
-# KOC Lambert
-<epsg24600> +proj=lcc +lat_1=32.5 +lat_0=32.5 +lon_0=45 +k_0=0.9987864078000001 +x_0=1500000 +y_0=1166200 +ellps=clrk80 +towgs84=-294.7,-200.1,525.5,0,0,0,0 +units=m +no_defs  <>
-# La Canoa / UTM zone 18N
-<epsg24718> +proj=utm +zone=18 +ellps=intl +towgs84=-273.5,110.6,-357.9,0,0,0,0 +units=m +no_defs  <>
-# La Canoa / UTM zone 19N
-<epsg24719> +proj=utm +zone=19 +ellps=intl +towgs84=-273.5,110.6,-357.9,0,0,0,0 +units=m +no_defs  <>
-# La Canoa / UTM zone 20N
-<epsg24720> +proj=utm +zone=20 +ellps=intl +towgs84=-273.5,110.6,-357.9,0,0,0,0 +units=m +no_defs  <>
-# PSAD56 / UTM zone 17N
-<epsg24817> +proj=utm +zone=17 +ellps=intl +towgs84=-288,175,-376,0,0,0,0 +units=m +no_defs  <>
-# PSAD56 / UTM zone 18N
-<epsg24818> +proj=utm +zone=18 +ellps=intl +towgs84=-288,175,-376,0,0,0,0 +units=m +no_defs  <>
-# PSAD56 / UTM zone 19N
-<epsg24819> +proj=utm +zone=19 +ellps=intl +towgs84=-288,175,-376,0,0,0,0 +units=m +no_defs  <>
-# PSAD56 / UTM zone 20N
-<epsg24820> +proj=utm +zone=20 +ellps=intl +towgs84=-288,175,-376,0,0,0,0 +units=m +no_defs  <>
-# PSAD56 / UTM zone 21N
-<epsg24821> +proj=utm +zone=21 +ellps=intl +towgs84=-288,175,-376,0,0,0,0 +units=m +no_defs  <>
-# PSAD56 / UTM zone 17S
-<epsg24877> +proj=utm +zone=17 +south +ellps=intl +towgs84=-288,175,-376,0,0,0,0 +units=m +no_defs  <>
-# PSAD56 / UTM zone 18S
-<epsg24878> +proj=utm +zone=18 +south +ellps=intl +towgs84=-288,175,-376,0,0,0,0 +units=m +no_defs  <>
-# PSAD56 / UTM zone 19S
-<epsg24879> +proj=utm +zone=19 +south +ellps=intl +towgs84=-288,175,-376,0,0,0,0 +units=m +no_defs  <>
-# PSAD56 / UTM zone 20S
-<epsg24880> +proj=utm +zone=20 +south +ellps=intl +towgs84=-288,175,-376,0,0,0,0 +units=m +no_defs  <>
-# PSAD56 / UTM zone 21S
-<epsg24881> +proj=utm +zone=21 +south +ellps=intl +towgs84=-288,175,-376,0,0,0,0 +units=m +no_defs  <>
-# PSAD56 / UTM zone 22S
-<epsg24882> +proj=utm +zone=22 +south +ellps=intl +towgs84=-288,175,-376,0,0,0,0 +units=m +no_defs  <>
-# PSAD56 / Peru west zone
-<epsg24891> +proj=tmerc +lat_0=-6 +lon_0=-80.5 +k=0.99983008 +x_0=222000 +y_0=1426834.743 +ellps=intl +towgs84=-288,175,-376,0,0,0,0 +units=m +no_defs  <>
-# PSAD56 / Peru central zone
-<epsg24892> +proj=tmerc +lat_0=-9.5 +lon_0=-76 +k=0.99932994 +x_0=720000 +y_0=1039979.159 +ellps=intl +towgs84=-288,175,-376,0,0,0,0 +units=m +no_defs  <>
-# PSAD56 / Peru east zone
-<epsg24893> +proj=tmerc +lat_0=-9.5 +lon_0=-70.5 +k=0.99952992 +x_0=1324000 +y_0=1040084.558 +ellps=intl +towgs84=-288,175,-376,0,0,0,0 +units=m +no_defs  <>
-# Leigon / Ghana Metre Grid
-<epsg25000> +proj=tmerc +lat_0=4.666666666666667 +lon_0=-1 +k=0.99975 +x_0=274319.51 +y_0=0 +ellps=clrk80 +towgs84=-130,29,364,0,0,0,0 +units=m +no_defs  <>
-# Lome / UTM zone 31N
-<epsg25231> +proj=utm +zone=31 +a=6378249.2 +b=6356515 +units=m +no_defs  <>
-# Luzon 1911 / Philippines zone I
-<epsg25391> +proj=tmerc +lat_0=0 +lon_0=117 +k=0.99995 +x_0=500000 +y_0=0 +ellps=clrk66 +towgs84=-133,-77,-51,0,0,0,0 +units=m +no_defs  <>
-# Luzon 1911 / Philippines zone II
-<epsg25392> +proj=tmerc +lat_0=0 +lon_0=119 +k=0.99995 +x_0=500000 +y_0=0 +ellps=clrk66 +towgs84=-133,-77,-51,0,0,0,0 +units=m +no_defs  <>
-# Luzon 1911 / Philippines zone III
-<epsg25393> +proj=tmerc +lat_0=0 +lon_0=121 +k=0.99995 +x_0=500000 +y_0=0 +ellps=clrk66 +towgs84=-133,-77,-51,0,0,0,0 +units=m +no_defs  <>
-# Luzon 1911 / Philippines zone IV
-<epsg25394> +proj=tmerc +lat_0=0 +lon_0=123 +k=0.99995 +x_0=500000 +y_0=0 +ellps=clrk66 +towgs84=-133,-77,-51,0,0,0,0 +units=m +no_defs  <>
-# Luzon 1911 / Philippines zone V
-<epsg25395> +proj=tmerc +lat_0=0 +lon_0=125 +k=0.99995 +x_0=500000 +y_0=0 +ellps=clrk66 +towgs84=-133,-77,-51,0,0,0,0 +units=m +no_defs  <>
-# Makassar (Jakarta) / NEIEZ (deprecated)
-<epsg25700> +proj=merc +lon_0=110 +k=0.997 +x_0=3900000 +y_0=900000 +ellps=bessel +towgs84=-587.8,519.75,145.76,0,0,0,0 +pm=jakarta +units=m +no_defs  <>
-# ETRS89 / UTM zone 28N
-<epsg25828> +proj=utm +zone=28 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ETRS89 / UTM zone 29N
-<epsg25829> +proj=utm +zone=29 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ETRS89 / UTM zone 30N
-<epsg25830> +proj=utm +zone=30 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ETRS89 / UTM zone 31N
-<epsg25831> +proj=utm +zone=31 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ETRS89 / UTM zone 32N
-<epsg25832> +proj=utm +zone=32 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ETRS89 / UTM zone 33N
-<epsg25833> +proj=utm +zone=33 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ETRS89 / UTM zone 34N
-<epsg25834> +proj=utm +zone=34 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ETRS89 / UTM zone 35N
-<epsg25835> +proj=utm +zone=35 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ETRS89 / UTM zone 36N
-<epsg25836> +proj=utm +zone=36 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ETRS89 / UTM zone 37N
-<epsg25837> +proj=utm +zone=37 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ETRS89 / UTM zone 38N
-<epsg25838> +proj=utm +zone=38 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# ETRS89 / TM Baltic93
-<epsg25884> +proj=tmerc +lat_0=0 +lon_0=24 +k=0.9996 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# Malongo 1987 / UTM zone 32S
-<epsg25932> +proj=utm +zone=32 +south +ellps=intl +towgs84=-254.1,-5.36,-100.29,0,0,0,0 +units=m +no_defs  <>
-# Merchich / Nord Maroc
-<epsg26191> +proj=lcc +lat_1=33.3 +lat_0=33.3 +lon_0=-5.4 +k_0=0.999625769 +x_0=500000 +y_0=300000 +a=6378249.2 +b=6356515 +towgs84=31,146,47,0,0,0,0 +units=m +no_defs  <>
-# Merchich / Sud Maroc
-<epsg26192> +proj=lcc +lat_1=29.7 +lat_0=29.7 +lon_0=-5.4 +k_0=0.9996155960000001 +x_0=500000 +y_0=300000 +a=6378249.2 +b=6356515 +towgs84=31,146,47,0,0,0,0 +units=m +no_defs  <>
-# Merchich / Sahara (deprecated)
-<epsg26193> +proj=lcc +lat_1=26.1 +lat_0=26.1 +lon_0=-5.4 +k_0=0.9996 +x_0=1200000 +y_0=400000 +a=6378249.2 +b=6356515 +towgs84=31,146,47,0,0,0,0 +units=m +no_defs  <>
-# Merchich / Sahara Nord
-<epsg26194> +proj=lcc +lat_1=26.1 +lat_0=26.1 +lon_0=-5.4 +k_0=0.999616304 +x_0=1200000 +y_0=400000 +a=6378249.2 +b=6356515 +towgs84=31,146,47,0,0,0,0 +units=m +no_defs  <>
-# Merchich / Sahara Sud
-<epsg26195> +proj=lcc +lat_1=22.5 +lat_0=22.5 +lon_0=-5.4 +k_0=0.999616437 +x_0=1500000 +y_0=400000 +a=6378249.2 +b=6356515 +towgs84=31,146,47,0,0,0,0 +units=m +no_defs  <>
-# Massawa / UTM zone 37N
-<epsg26237> +proj=utm +zone=37 +ellps=bessel +towgs84=639,405,60,0,0,0,0 +units=m +no_defs  <>
-# Minna / UTM zone 31N
-<epsg26331> +proj=utm +zone=31 +ellps=clrk80 +towgs84=-92,-93,122,0,0,0,0 +units=m +no_defs  <>
-# Minna / UTM zone 32N
-<epsg26332> +proj=utm +zone=32 +ellps=clrk80 +towgs84=-92,-93,122,0,0,0,0 +units=m +no_defs  <>
-# Minna / Nigeria West Belt
-<epsg26391> +proj=tmerc +lat_0=4 +lon_0=4.5 +k=0.99975 +x_0=230738.26 +y_0=0 +ellps=clrk80 +towgs84=-92,-93,122,0,0,0,0 +units=m +no_defs  <>
-# Minna / Nigeria Mid Belt
-<epsg26392> +proj=tmerc +lat_0=4 +lon_0=8.5 +k=0.99975 +x_0=670553.98 +y_0=0 +ellps=clrk80 +towgs84=-92,-93,122,0,0,0,0 +units=m +no_defs  <>
-# Minna / Nigeria East Belt
-<epsg26393> +proj=tmerc +lat_0=4 +lon_0=12.5 +k=0.99975 +x_0=1110369.7 +y_0=0 +ellps=clrk80 +towgs84=-92,-93,122,0,0,0,0 +units=m +no_defs  <>
-# Mhast / UTM zone 32S (deprecated)
-<epsg26432> +proj=utm +zone=32 +south +ellps=intl +towgs84=-252.95,-4.11,-96.38,0,0,0,0 +units=m +no_defs  <>
-# Monte Mario (Rome) / Italy zone 1 (deprecated)
-<epsg26591> +proj=tmerc +lat_0=0 +lon_0=-3.45233333333333 +k=0.9996 +x_0=1500000 +y_0=0 +ellps=intl +towgs84=-104.1,-49.1,-9.9,0.971,-2.917,0.714,-11.68 +pm=rome +units=m +no_defs  <>
-# Monte Mario (Rome) / Italy zone 2 (deprecated)
-<epsg26592> +proj=tmerc +lat_0=0 +lon_0=2.54766666666666 +k=0.9996 +x_0=2520000 +y_0=0 +ellps=intl +towgs84=-104.1,-49.1,-9.9,0.971,-2.917,0.714,-11.68 +pm=rome +units=m +no_defs  <>
-# M'poraloko / UTM zone 32N
-<epsg26632> +proj=utm +zone=32 +a=6378249.2 +b=6356515 +towgs84=-74,-130,42,0,0,0,0 +units=m +no_defs  <>
-# M'poraloko / UTM zone 32S
-<epsg26692> +proj=utm +zone=32 +south +a=6378249.2 +b=6356515 +towgs84=-74,-130,42,0,0,0,0 +units=m +no_defs  <>
-# NAD27 / UTM zone 1N
-<epsg26701> +proj=utm +zone=1 +datum=NAD27 +units=m +no_defs  <>
-# NAD27 / UTM zone 2N
-<epsg26702> +proj=utm +zone=2 +datum=NAD27 +units=m +no_defs  <>
-# NAD27 / UTM zone 3N
-<epsg26703> +proj=utm +zone=3 +datum=NAD27 +units=m +no_defs  <>
-# NAD27 / UTM zone 4N
-<epsg26704> +proj=utm +zone=4 +datum=NAD27 +units=m +no_defs  <>
-# NAD27 / UTM zone 5N
-<epsg26705> +proj=utm +zone=5 +datum=NAD27 +units=m +no_defs  <>
-# NAD27 / UTM zone 6N
-<epsg26706> +proj=utm +zone=6 +datum=NAD27 +units=m +no_defs  <>
-# NAD27 / UTM zone 7N
-<epsg26707> +proj=utm +zone=7 +datum=NAD27 +units=m +no_defs  <>
-# NAD27 / UTM zone 8N
-<epsg26708> +proj=utm +zone=8 +datum=NAD27 +units=m +no_defs  <>
-# NAD27 / UTM zone 9N
-<epsg26709> +proj=utm +zone=9 +datum=NAD27 +units=m +no_defs  <>
-# NAD27 / UTM zone 10N
-<epsg26710> +proj=utm +zone=10 +datum=NAD27 +units=m +no_defs  <>
-# NAD27 / UTM zone 11N
-<epsg26711> +proj=utm +zone=11 +datum=NAD27 +units=m +no_defs  <>
-# NAD27 / UTM zone 12N
-<epsg26712> +proj=utm +zone=12 +datum=NAD27 +units=m +no_defs  <>
-# NAD27 / UTM zone 13N
-<epsg26713> +proj=utm +zone=13 +datum=NAD27 +units=m +no_defs  <>
-# NAD27 / UTM zone 14N
-<epsg26714> +proj=utm +zone=14 +datum=NAD27 +units=m +no_defs  <>
-# NAD27 / UTM zone 15N
-<epsg26715> +proj=utm +zone=15 +datum=NAD27 +units=m +no_defs  <>
-# NAD27 / UTM zone 16N
-<epsg26716> +proj=utm +zone=16 +datum=NAD27 +units=m +no_defs  <>
-# NAD27 / UTM zone 17N
-<epsg26717> +proj=utm +zone=17 +datum=NAD27 +units=m +no_defs  <>
-# NAD27 / UTM zone 18N
-<epsg26718> +proj=utm +zone=18 +datum=NAD27 +units=m +no_defs  <>
-# NAD27 / UTM zone 19N
-<epsg26719> +proj=utm +zone=19 +datum=NAD27 +units=m +no_defs  <>
-# NAD27 / UTM zone 20N
-<epsg26720> +proj=utm +zone=20 +datum=NAD27 +units=m +no_defs  <>
-# NAD27 / UTM zone 21N
-<epsg26721> +proj=utm +zone=21 +datum=NAD27 +units=m +no_defs  <>
-# NAD27 / UTM zone 22N
-<epsg26722> +proj=utm +zone=22 +datum=NAD27 +units=m +no_defs  <>
-# NAD27 / Alabama East
-<epsg26729> +proj=tmerc +lat_0=30.5 +lon_0=-85.83333333333333 +k=0.99996 +x_0=152400.3048006096 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / Alabama West
-<epsg26730> +proj=tmerc +lat_0=30 +lon_0=-87.5 +k=0.999933333 +x_0=152400.3048006096 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / Alaska zone 1
-<epsg26731> +proj=omerc +lat_0=57 +lonc=-133.6666666666667 +alpha=323.1301023611111 +k=0.9999 +x_0=5000000.001016002 +y_0=-5000000.001016002 +no_uoff +gamma=323.1301023611111 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / Alaska zone 2
-<epsg26732> +proj=tmerc +lat_0=54 +lon_0=-142 +k=0.9999 +x_0=152400.3048006096 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / Alaska zone 3
-<epsg26733> +proj=tmerc +lat_0=54 +lon_0=-146 +k=0.9999 +x_0=152400.3048006096 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / Alaska zone 4
-<epsg26734> +proj=tmerc +lat_0=54 +lon_0=-150 +k=0.9999 +x_0=152400.3048006096 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / Alaska zone 5
-<epsg26735> +proj=tmerc +lat_0=54 +lon_0=-154 +k=0.9999 +x_0=152400.3048006096 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / Alaska zone 6
-<epsg26736> +proj=tmerc +lat_0=54 +lon_0=-158 +k=0.9999 +x_0=152400.3048006096 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / Alaska zone 7
-<epsg26737> +proj=tmerc +lat_0=54 +lon_0=-162 +k=0.9999 +x_0=213360.4267208534 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / Alaska zone 8
-<epsg26738> +proj=tmerc +lat_0=54 +lon_0=-166 +k=0.9999 +x_0=152400.3048006096 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / Alaska zone 9
-<epsg26739> +proj=tmerc +lat_0=54 +lon_0=-170 +k=0.9999 +x_0=182880.3657607315 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / Alaska zone 10
-<epsg26740> +proj=lcc +lat_1=53.83333333333334 +lat_2=51.83333333333334 +lat_0=51 +lon_0=-176 +x_0=914401.8288036576 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / California zone I
-<epsg26741> +proj=lcc +lat_1=41.66666666666666 +lat_2=40 +lat_0=39.33333333333334 +lon_0=-122 +x_0=609601.2192024384 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / California zone II
-<epsg26742> +proj=lcc +lat_1=39.83333333333334 +lat_2=38.33333333333334 +lat_0=37.66666666666666 +lon_0=-122 +x_0=609601.2192024384 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / California zone III
-<epsg26743> +proj=lcc +lat_1=38.43333333333333 +lat_2=37.06666666666667 +lat_0=36.5 +lon_0=-120.5 +x_0=609601.2192024384 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / California zone IV
-<epsg26744> +proj=lcc +lat_1=37.25 +lat_2=36 +lat_0=35.33333333333334 +lon_0=-119 +x_0=609601.2192024384 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / California zone V
-<epsg26745> +proj=lcc +lat_1=35.46666666666667 +lat_2=34.03333333333333 +lat_0=33.5 +lon_0=-118 +x_0=609601.2192024384 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / California zone VI
-<epsg26746> +proj=lcc +lat_1=33.88333333333333 +lat_2=32.78333333333333 +lat_0=32.16666666666666 +lon_0=-116.25 +x_0=609601.2192024384 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / California zone VII (deprecated)
-<epsg26747> +proj=lcc +lat_1=34.41666666666666 +lat_2=33.86666666666667 +lat_0=34.13333333333333 +lon_0=-118.3333333333333 +x_0=1276106.450596901 +y_0=127079.524511049 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / Arizona East
-<epsg26748> +proj=tmerc +lat_0=31 +lon_0=-110.1666666666667 +k=0.9999 +x_0=152400.3048006096 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / Arizona Central
-<epsg26749> +proj=tmerc +lat_0=31 +lon_0=-111.9166666666667 +k=0.9999 +x_0=152400.3048006096 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / Arizona West
-<epsg26750> +proj=tmerc +lat_0=31 +lon_0=-113.75 +k=0.999933333 +x_0=152400.3048006096 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / Arkansas North
-<epsg26751> +proj=lcc +lat_1=36.23333333333333 +lat_2=34.93333333333333 +lat_0=34.33333333333334 +lon_0=-92 +x_0=609601.2192024384 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / Arkansas South
-<epsg26752> +proj=lcc +lat_1=34.76666666666667 +lat_2=33.3 +lat_0=32.66666666666666 +lon_0=-92 +x_0=609601.2192024384 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / Colorado North
-<epsg26753> +proj=lcc +lat_1=39.71666666666667 +lat_2=40.78333333333333 +lat_0=39.33333333333334 +lon_0=-105.5 +x_0=609601.2192024384 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / Colorado Central
-<epsg26754> +proj=lcc +lat_1=39.75 +lat_2=38.45 +lat_0=37.83333333333334 +lon_0=-105.5 +x_0=609601.2192024384 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / Colorado South
-<epsg26755> +proj=lcc +lat_1=38.43333333333333 +lat_2=37.23333333333333 +lat_0=36.66666666666666 +lon_0=-105.5 +x_0=609601.2192024384 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / Connecticut
-<epsg26756> +proj=lcc +lat_1=41.86666666666667 +lat_2=41.2 +lat_0=40.83333333333334 +lon_0=-72.75 +x_0=182880.3657607315 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / Delaware
-<epsg26757> +proj=tmerc +lat_0=38 +lon_0=-75.41666666666667 +k=0.999995 +x_0=152400.3048006096 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / Florida East
-<epsg26758> +proj=tmerc +lat_0=24.33333333333333 +lon_0=-81 +k=0.999941177 +x_0=152400.3048006096 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / Florida West
-<epsg26759> +proj=tmerc +lat_0=24.33333333333333 +lon_0=-82 +k=0.999941177 +x_0=152400.3048006096 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / Florida North
-<epsg26760> +proj=lcc +lat_1=30.75 +lat_2=29.58333333333333 +lat_0=29 +lon_0=-84.5 +x_0=609601.2192024384 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / Georgia East
-<epsg26766> +proj=tmerc +lat_0=30 +lon_0=-82.16666666666667 +k=0.9999 +x_0=152400.3048006096 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / Georgia West
-<epsg26767> +proj=tmerc +lat_0=30 +lon_0=-84.16666666666667 +k=0.9999 +x_0=152400.3048006096 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / Idaho East
-<epsg26768> +proj=tmerc +lat_0=41.66666666666666 +lon_0=-112.1666666666667 +k=0.9999473679999999 +x_0=152400.3048006096 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / Idaho Central
-<epsg26769> +proj=tmerc +lat_0=41.66666666666666 +lon_0=-114 +k=0.9999473679999999 +x_0=152400.3048006096 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / Idaho West
-<epsg26770> +proj=tmerc +lat_0=41.66666666666666 +lon_0=-115.75 +k=0.999933333 +x_0=152400.3048006096 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / Illinois East
-<epsg26771> +proj=tmerc +lat_0=36.66666666666666 +lon_0=-88.33333333333333 +k=0.9999749999999999 +x_0=152400.3048006096 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / Illinois West
-<epsg26772> +proj=tmerc +lat_0=36.66666666666666 +lon_0=-90.16666666666667 +k=0.999941177 +x_0=152400.3048006096 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / Indiana East
-<epsg26773> +proj=tmerc +lat_0=37.5 +lon_0=-85.66666666666667 +k=0.999966667 +x_0=152400.3048006096 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / Indiana West
-<epsg26774> +proj=tmerc +lat_0=37.5 +lon_0=-87.08333333333333 +k=0.999966667 +x_0=152400.3048006096 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / Iowa North
-<epsg26775> +proj=lcc +lat_1=43.26666666666667 +lat_2=42.06666666666667 +lat_0=41.5 +lon_0=-93.5 +x_0=609601.2192024384 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / Iowa South
-<epsg26776> +proj=lcc +lat_1=41.78333333333333 +lat_2=40.61666666666667 +lat_0=40 +lon_0=-93.5 +x_0=609601.2192024384 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / Kansas North
-<epsg26777> +proj=lcc +lat_1=39.78333333333333 +lat_2=38.71666666666667 +lat_0=38.33333333333334 +lon_0=-98 +x_0=609601.2192024384 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / Kansas South
-<epsg26778> +proj=lcc +lat_1=38.56666666666667 +lat_2=37.26666666666667 +lat_0=36.66666666666666 +lon_0=-98.5 +x_0=609601.2192024384 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / Kentucky North
-<epsg26779> +proj=lcc +lat_1=37.96666666666667 +lat_2=38.96666666666667 +lat_0=37.5 +lon_0=-84.25 +x_0=609601.2192024384 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / Kentucky South
-<epsg26780> +proj=lcc +lat_1=36.73333333333333 +lat_2=37.93333333333333 +lat_0=36.33333333333334 +lon_0=-85.75 +x_0=609601.2192024384 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / Louisiana North
-<epsg26781> +proj=lcc +lat_1=31.16666666666667 +lat_2=32.66666666666666 +lat_0=30.66666666666667 +lon_0=-92.5 +x_0=609601.2192024384 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / Louisiana South
-<epsg26782> +proj=lcc +lat_1=29.3 +lat_2=30.7 +lat_0=28.66666666666667 +lon_0=-91.33333333333333 +x_0=609601.2192024384 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / Maine East
-<epsg26783> +proj=tmerc +lat_0=43.83333333333334 +lon_0=-68.5 +k=0.9999 +x_0=152400.3048006096 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / Maine West
-<epsg26784> +proj=tmerc +lat_0=42.83333333333334 +lon_0=-70.16666666666667 +k=0.999966667 +x_0=152400.3048006096 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / Maryland
-<epsg26785> +proj=lcc +lat_1=38.3 +lat_2=39.45 +lat_0=37.83333333333334 +lon_0=-77 +x_0=243840.4876809754 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / Massachusetts Mainland
-<epsg26786> +proj=lcc +lat_1=41.71666666666667 +lat_2=42.68333333333333 +lat_0=41 +lon_0=-71.5 +x_0=182880.3657607315 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / Massachusetts Island
-<epsg26787> +proj=lcc +lat_1=41.28333333333333 +lat_2=41.48333333333333 +lat_0=41 +lon_0=-70.5 +x_0=60960.12192024384 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / Minnesota North
-<epsg26791> +proj=lcc +lat_1=47.03333333333333 +lat_2=48.63333333333333 +lat_0=46.5 +lon_0=-93.09999999999999 +x_0=609601.2192024384 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / Minnesota Central
-<epsg26792> +proj=lcc +lat_1=45.61666666666667 +lat_2=47.05 +lat_0=45 +lon_0=-94.25 +x_0=609601.2192024384 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / Minnesota South
-<epsg26793> +proj=lcc +lat_1=43.78333333333333 +lat_2=45.21666666666667 +lat_0=43 +lon_0=-94 +x_0=609601.2192024384 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / Mississippi East
-<epsg26794> +proj=tmerc +lat_0=29.66666666666667 +lon_0=-88.83333333333333 +k=0.99996 +x_0=152400.3048006096 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / Mississippi West
-<epsg26795> +proj=tmerc +lat_0=30.5 +lon_0=-90.33333333333333 +k=0.999941177 +x_0=152400.3048006096 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / Missouri East
-<epsg26796> +proj=tmerc +lat_0=35.83333333333334 +lon_0=-90.5 +k=0.999933333 +x_0=152400.3048006096 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / Missouri Central
-<epsg26797> +proj=tmerc +lat_0=35.83333333333334 +lon_0=-92.5 +k=0.999933333 +x_0=152400.3048006096 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / Missouri West
-<epsg26798> +proj=tmerc +lat_0=36.16666666666666 +lon_0=-94.5 +k=0.999941177 +x_0=152400.3048006096 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / California zone VII
-<epsg26799> +proj=lcc +lat_1=34.41666666666666 +lat_2=33.86666666666667 +lat_0=34.13333333333333 +lon_0=-118.3333333333333 +x_0=1276106.450596901 +y_0=1268253.006858014 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD Michigan / Michigan East
-<epsg26801> +proj=tmerc +lat_0=41.5 +lon_0=-83.66666666666667 +k=0.999942857 +x_0=152400.3048006096 +y_0=0 +a=6378450.047548896 +b=6356826.621488444 +units=us-ft +no_defs  <>
-# NAD Michigan / Michigan Old Central
-<epsg26802> +proj=tmerc +lat_0=41.5 +lon_0=-85.75 +k=0.999909091 +x_0=152400.3048006096 +y_0=0 +a=6378450.047548896 +b=6356826.621488444 +units=us-ft +no_defs  <>
-# NAD Michigan / Michigan West
-<epsg26803> +proj=tmerc +lat_0=41.5 +lon_0=-88.75 +k=0.999909091 +x_0=152400.3048006096 +y_0=0 +a=6378450.047548896 +b=6356826.621488444 +units=us-ft +no_defs  <>
-# NAD Michigan / Michigan North
-<epsg26811> +proj=lcc +lat_1=45.48333333333333 +lat_2=47.08333333333334 +lat_0=44.78333333333333 +lon_0=-87 +x_0=609601.2192024384 +y_0=0 +a=6378450.047548896 +b=6356826.621488444 +units=us-ft +no_defs  <>
-# NAD Michigan / Michigan Central
-<epsg26812> +proj=lcc +lat_1=44.18333333333333 +lat_2=45.7 +lat_0=43.31666666666667 +lon_0=-84.33333333333333 +x_0=609601.2192024384 +y_0=0 +a=6378450.047548896 +b=6356826.621488444 +units=us-ft +no_defs  <>
-# NAD Michigan / Michigan South
-<epsg26813> +proj=lcc +lat_1=42.1 +lat_2=43.66666666666666 +lat_0=41.5 +lon_0=-84.33333333333333 +x_0=609601.2192024384 +y_0=0 +a=6378450.047548896 +b=6356826.621488444 +units=us-ft +no_defs  <>
-# NAD83 / Maine East (ftUS) (deprecated)
-<epsg26814> +proj=tmerc +lat_0=43.66666666666666 +lon_0=-68.5 +k=0.9999 +x_0=300000 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / Maine West (ftUS) (deprecated)
-<epsg26815> +proj=tmerc +lat_0=42.83333333333334 +lon_0=-70.16666666666667 +k=0.999966667 +x_0=900000 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / Minnesota North (ftUS) (deprecated)
-<epsg26819> +proj=lcc +lat_1=48.63333333333333 +lat_2=47.03333333333333 +lat_0=46.5 +lon_0=-93.09999999999999 +x_0=800000.0000101601 +y_0=99999.99998984 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / Minnesota Central (ftUS) (deprecated)
-<epsg26820> +proj=lcc +lat_1=47.05 +lat_2=45.61666666666667 +lat_0=45 +lon_0=-94.25 +x_0=800000.0000101601 +y_0=99999.99998984 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / Minnesota South (ftUS) (deprecated)
-<epsg26821> +proj=lcc +lat_1=45.21666666666667 +lat_2=43.78333333333333 +lat_0=43 +lon_0=-94 +x_0=800000.0000101601 +y_0=99999.99998984 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / Nebraska (ftUS) (deprecated)
-<epsg26822> +proj=lcc +lat_1=43 +lat_2=40 +lat_0=39.83333333333334 +lon_0=-100 +x_0=500000.0000101601 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / West Virginia North (ftUS) (deprecated)
-<epsg26823> +proj=lcc +lat_1=40.25 +lat_2=39 +lat_0=38.5 +lon_0=-79.5 +x_0=1968500 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / West Virginia South (ftUS) (deprecated)
-<epsg26824> +proj=lcc +lat_1=38.88333333333333 +lat_2=37.48333333333333 +lat_0=37 +lon_0=-81 +x_0=1968500 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83(HARN) / Maine East (ftUS) (deprecated)
-<epsg26825> +proj=tmerc +lat_0=43.66666666666666 +lon_0=-68.5 +k=0.9999 +x_0=300000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / Maine West (ftUS) (deprecated)
-<epsg26826> +proj=tmerc +lat_0=42.83333333333334 +lon_0=-70.16666666666667 +k=0.999966667 +x_0=900000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / Minnesota North (ftUS) (deprecated)
-<epsg26830> +proj=lcc +lat_1=48.63333333333333 +lat_2=47.03333333333333 +lat_0=46.5 +lon_0=-93.09999999999999 +x_0=800000.0000101601 +y_0=99999.99998984 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / Minnesota Central (ftUS) (deprecated)
-<epsg26831> +proj=lcc +lat_1=47.05 +lat_2=45.61666666666667 +lat_0=45 +lon_0=-94.25 +x_0=800000.0000101601 +y_0=99999.99998984 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / Minnesota South (ftUS) (deprecated)
-<epsg26832> +proj=lcc +lat_1=45.21666666666667 +lat_2=43.78333333333333 +lat_0=43 +lon_0=-94 +x_0=800000.0000101601 +y_0=99999.99998984 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / Nebraska (ftUS) (deprecated)
-<epsg26833> +proj=lcc +lat_1=43 +lat_2=40 +lat_0=39.83333333333334 +lon_0=-100 +x_0=500000.0000101601 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / West Virginia North (ftUS) (deprecated)
-<epsg26834> +proj=lcc +lat_1=40.25 +lat_2=39 +lat_0=38.5 +lon_0=-79.5 +x_0=1968500 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(HARN) / West Virginia South (ftUS) (deprecated)
-<epsg26835> +proj=lcc +lat_1=38.88333333333333 +lat_2=37.48333333333333 +lat_0=37 +lon_0=-81 +x_0=1968500 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / Maine East (ftUS) (deprecated)
-<epsg26836> +proj=tmerc +lat_0=43.66666666666666 +lon_0=-68.5 +k=0.9999 +x_0=300000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / Maine West (ftUS) (deprecated)
-<epsg26837> +proj=tmerc +lat_0=42.83333333333334 +lon_0=-70.16666666666667 +k=0.999966667 +x_0=900000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / Minnesota North (ftUS) (deprecated)
-<epsg26841> +proj=lcc +lat_1=48.63333333333333 +lat_2=47.03333333333333 +lat_0=46.5 +lon_0=-93.09999999999999 +x_0=800000.0000101601 +y_0=99999.99998984 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / Minnesota Central (ftUS) (deprecated)
-<epsg26842> +proj=lcc +lat_1=47.05 +lat_2=45.61666666666667 +lat_0=45 +lon_0=-94.25 +x_0=800000.0000101601 +y_0=99999.99998984 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / Minnesota South (ftUS) (deprecated)
-<epsg26843> +proj=lcc +lat_1=45.21666666666667 +lat_2=43.78333333333333 +lat_0=43 +lon_0=-94 +x_0=800000.0000101601 +y_0=99999.99998984 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / Nebraska (ftUS) (deprecated)
-<epsg26844> +proj=lcc +lat_1=43 +lat_2=40 +lat_0=39.83333333333334 +lon_0=-100 +x_0=500000.0000101601 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / West Virginia North (ftUS) (deprecated)
-<epsg26845> +proj=lcc +lat_1=40.25 +lat_2=39 +lat_0=38.5 +lon_0=-79.5 +x_0=1968500 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(NSRS2007) / West Virginia South (ftUS) (deprecated)
-<epsg26846> +proj=lcc +lat_1=38.88333333333333 +lat_2=37.48333333333333 +lat_0=37 +lon_0=-81 +x_0=1968500 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83 / Maine East (ftUS)
-<epsg26847> +proj=tmerc +lat_0=43.66666666666666 +lon_0=-68.5 +k=0.9999 +x_0=300000.0000000001 +y_0=0 +datum=NAD83 +units=us-ft +no_defs  <>
-# NAD83 / Maine West (ftUS)
-<epsg26848> +proj=tmerc +lat_0=42.83333333333334 +lon_0=-70.16666666666667 +k=0.999966667 +x_0=900000 +y_0=0 +datum=NAD83 +units=us-ft +no_defs  <>
-# NAD83 / Minnesota North (ftUS)
-<epsg26849> +proj=lcc +lat_1=48.63333333333333 +lat_2=47.03333333333333 +lat_0=46.5 +lon_0=-93.09999999999999 +x_0=800000.0000101599 +y_0=99999.99998983997 +datum=NAD83 +units=us-ft +no_defs  <>
-# NAD83 / Minnesota Central (ftUS)
-<epsg26850> +proj=lcc +lat_1=47.05 +lat_2=45.61666666666667 +lat_0=45 +lon_0=-94.25 +x_0=800000.0000101599 +y_0=99999.99998983997 +datum=NAD83 +units=us-ft +no_defs  <>
-# NAD83 / Minnesota South (ftUS)
-<epsg26851> +proj=lcc +lat_1=45.21666666666667 +lat_2=43.78333333333333 +lat_0=43 +lon_0=-94 +x_0=800000.0000101599 +y_0=99999.99998983997 +datum=NAD83 +units=us-ft +no_defs  <>
-# NAD83 / Nebraska (ftUS)
-<epsg26852> +proj=lcc +lat_1=43 +lat_2=40 +lat_0=39.83333333333334 +lon_0=-100 +x_0=500000.00001016 +y_0=0 +datum=NAD83 +units=us-ft +no_defs  <>
-# NAD83 / West Virginia North (ftUS)
-<epsg26853> +proj=lcc +lat_1=40.25 +lat_2=39 +lat_0=38.5 +lon_0=-79.5 +x_0=600000 +y_0=0 +datum=NAD83 +units=us-ft +no_defs  <>
-# NAD83 / West Virginia South (ftUS)
-<epsg26854> +proj=lcc +lat_1=38.88333333333333 +lat_2=37.48333333333333 +lat_0=37 +lon_0=-81 +x_0=600000 +y_0=0 +datum=NAD83 +units=us-ft +no_defs  <>
-# NAD83(HARN) / Maine East (ftUS)
-<epsg26855> +proj=tmerc +lat_0=43.66666666666666 +lon_0=-68.5 +k=0.9999 +x_0=300000.0000000001 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(HARN) / Maine West (ftUS)
-<epsg26856> +proj=tmerc +lat_0=42.83333333333334 +lon_0=-70.16666666666667 +k=0.999966667 +x_0=900000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(HARN) / Minnesota North (ftUS)
-<epsg26857> +proj=lcc +lat_1=48.63333333333333 +lat_2=47.03333333333333 +lat_0=46.5 +lon_0=-93.09999999999999 +x_0=800000.0000101599 +y_0=99999.99998983997 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(HARN) / Minnesota Central (ftUS)
-<epsg26858> +proj=lcc +lat_1=47.05 +lat_2=45.61666666666667 +lat_0=45 +lon_0=-94.25 +x_0=800000.0000101599 +y_0=99999.99998983997 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(HARN) / Minnesota South (ftUS)
-<epsg26859> +proj=lcc +lat_1=45.21666666666667 +lat_2=43.78333333333333 +lat_0=43 +lon_0=-94 +x_0=800000.0000101599 +y_0=99999.99998983997 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(HARN) / Nebraska (ftUS)
-<epsg26860> +proj=lcc +lat_1=43 +lat_2=40 +lat_0=39.83333333333334 +lon_0=-100 +x_0=500000.00001016 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(HARN) / West Virginia North (ftUS)
-<epsg26861> +proj=lcc +lat_1=40.25 +lat_2=39 +lat_0=38.5 +lon_0=-79.5 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(HARN) / West Virginia South (ftUS)
-<epsg26862> +proj=lcc +lat_1=38.88333333333333 +lat_2=37.48333333333333 +lat_0=37 +lon_0=-81 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(NSRS2007) / Maine East (ftUS)
-<epsg26863> +proj=tmerc +lat_0=43.66666666666666 +lon_0=-68.5 +k=0.9999 +x_0=300000.0000000001 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(NSRS2007) / Maine West (ftUS)
-<epsg26864> +proj=tmerc +lat_0=42.83333333333334 +lon_0=-70.16666666666667 +k=0.999966667 +x_0=900000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(NSRS2007) / Minnesota North (ftUS)
-<epsg26865> +proj=lcc +lat_1=48.63333333333333 +lat_2=47.03333333333333 +lat_0=46.5 +lon_0=-93.09999999999999 +x_0=800000.0000101599 +y_0=99999.99998983997 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(NSRS2007) / Minnesota Central (ftUS)
-<epsg26866> +proj=lcc +lat_1=47.05 +lat_2=45.61666666666667 +lat_0=45 +lon_0=-94.25 +x_0=800000.0000101599 +y_0=99999.99998983997 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(NSRS2007) / Minnesota South (ftUS)
-<epsg26867> +proj=lcc +lat_1=45.21666666666667 +lat_2=43.78333333333333 +lat_0=43 +lon_0=-94 +x_0=800000.0000101599 +y_0=99999.99998983997 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(NSRS2007) / Nebraska (ftUS)
-<epsg26868> +proj=lcc +lat_1=43 +lat_2=40 +lat_0=39.83333333333334 +lon_0=-100 +x_0=500000.00001016 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(NSRS2007) / West Virginia North (ftUS)
-<epsg26869> +proj=lcc +lat_1=40.25 +lat_2=39 +lat_0=38.5 +lon_0=-79.5 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(NSRS2007) / West Virginia South (ftUS)
-<epsg26870> +proj=lcc +lat_1=38.88333333333333 +lat_2=37.48333333333333 +lat_0=37 +lon_0=-81 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs  <>
-# NAD83(CSRS) / MTM zone 11
-<epsg26891> +proj=tmerc +lat_0=0 +lon_0=-82.5 +k=0.9999 +x_0=304800 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(CSRS) / MTM zone 12
-<epsg26892> +proj=tmerc +lat_0=0 +lon_0=-81 +k=0.9999 +x_0=304800 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(CSRS) / MTM zone 13
-<epsg26893> +proj=tmerc +lat_0=0 +lon_0=-84 +k=0.9999 +x_0=304800 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(CSRS) / MTM zone 14
-<epsg26894> +proj=tmerc +lat_0=0 +lon_0=-87 +k=0.9999 +x_0=304800 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(CSRS) / MTM zone 15
-<epsg26895> +proj=tmerc +lat_0=0 +lon_0=-90 +k=0.9999 +x_0=304800 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(CSRS) / MTM zone 16
-<epsg26896> +proj=tmerc +lat_0=0 +lon_0=-93 +k=0.9999 +x_0=304800 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(CSRS) / MTM zone 17
-<epsg26897> +proj=tmerc +lat_0=0 +lon_0=-96 +k=0.9999 +x_0=304800 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(CSRS) / MTM zone 1
-<epsg26898> +proj=tmerc +lat_0=0 +lon_0=-53 +k=0.9999 +x_0=304800 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83(CSRS) / MTM zone 2
-<epsg26899> +proj=tmerc +lat_0=0 +lon_0=-56 +k=0.9999 +x_0=304800 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD83 / UTM zone 1N
-<epsg26901> +proj=utm +zone=1 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / UTM zone 2N
-<epsg26902> +proj=utm +zone=2 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / UTM zone 3N
-<epsg26903> +proj=utm +zone=3 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / UTM zone 4N
-<epsg26904> +proj=utm +zone=4 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / UTM zone 5N
-<epsg26905> +proj=utm +zone=5 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / UTM zone 6N
-<epsg26906> +proj=utm +zone=6 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / UTM zone 7N
-<epsg26907> +proj=utm +zone=7 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / UTM zone 8N
-<epsg26908> +proj=utm +zone=8 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / UTM zone 9N
-<epsg26909> +proj=utm +zone=9 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / UTM zone 10N
-<epsg26910> +proj=utm +zone=10 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / UTM zone 11N
-<epsg26911> +proj=utm +zone=11 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / UTM zone 12N
-<epsg26912> +proj=utm +zone=12 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / UTM zone 13N
-<epsg26913> +proj=utm +zone=13 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / UTM zone 14N
-<epsg26914> +proj=utm +zone=14 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / UTM zone 15N
-<epsg26915> +proj=utm +zone=15 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / UTM zone 16N
-<epsg26916> +proj=utm +zone=16 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / UTM zone 17N
-<epsg26917> +proj=utm +zone=17 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / UTM zone 18N
-<epsg26918> +proj=utm +zone=18 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / UTM zone 19N
-<epsg26919> +proj=utm +zone=19 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / UTM zone 20N
-<epsg26920> +proj=utm +zone=20 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / UTM zone 21N
-<epsg26921> +proj=utm +zone=21 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / UTM zone 22N
-<epsg26922> +proj=utm +zone=22 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / UTM zone 23N
-<epsg26923> +proj=utm +zone=23 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / Alabama East
-<epsg26929> +proj=tmerc +lat_0=30.5 +lon_0=-85.83333333333333 +k=0.99996 +x_0=200000 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / Alabama West
-<epsg26930> +proj=tmerc +lat_0=30 +lon_0=-87.5 +k=0.999933333 +x_0=600000 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / Alaska zone 1
-<epsg26931> +proj=omerc +lat_0=57 +lonc=-133.6666666666667 +alpha=323.1301023611111 +k=0.9999 +x_0=5000000 +y_0=-5000000 +no_uoff +gamma=323.1301023611111 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / Alaska zone 2
-<epsg26932> +proj=tmerc +lat_0=54 +lon_0=-142 +k=0.9999 +x_0=500000 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / Alaska zone 3
-<epsg26933> +proj=tmerc +lat_0=54 +lon_0=-146 +k=0.9999 +x_0=500000 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / Alaska zone 4
-<epsg26934> +proj=tmerc +lat_0=54 +lon_0=-150 +k=0.9999 +x_0=500000 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / Alaska zone 5
-<epsg26935> +proj=tmerc +lat_0=54 +lon_0=-154 +k=0.9999 +x_0=500000 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / Alaska zone 6
-<epsg26936> +proj=tmerc +lat_0=54 +lon_0=-158 +k=0.9999 +x_0=500000 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / Alaska zone 7
-<epsg26937> +proj=tmerc +lat_0=54 +lon_0=-162 +k=0.9999 +x_0=500000 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / Alaska zone 8
-<epsg26938> +proj=tmerc +lat_0=54 +lon_0=-166 +k=0.9999 +x_0=500000 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / Alaska zone 9
-<epsg26939> +proj=tmerc +lat_0=54 +lon_0=-170 +k=0.9999 +x_0=500000 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / Alaska zone 10
-<epsg26940> +proj=lcc +lat_1=53.83333333333334 +lat_2=51.83333333333334 +lat_0=51 +lon_0=-176 +x_0=1000000 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / California zone 1
-<epsg26941> +proj=lcc +lat_1=41.66666666666666 +lat_2=40 +lat_0=39.33333333333334 +lon_0=-122 +x_0=2000000 +y_0=500000 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / California zone 2
-<epsg26942> +proj=lcc +lat_1=39.83333333333334 +lat_2=38.33333333333334 +lat_0=37.66666666666666 +lon_0=-122 +x_0=2000000 +y_0=500000 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / California zone 3
-<epsg26943> +proj=lcc +lat_1=38.43333333333333 +lat_2=37.06666666666667 +lat_0=36.5 +lon_0=-120.5 +x_0=2000000 +y_0=500000 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / California zone 4
-<epsg26944> +proj=lcc +lat_1=37.25 +lat_2=36 +lat_0=35.33333333333334 +lon_0=-119 +x_0=2000000 +y_0=500000 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / California zone 5
-<epsg26945> +proj=lcc +lat_1=35.46666666666667 +lat_2=34.03333333333333 +lat_0=33.5 +lon_0=-118 +x_0=2000000 +y_0=500000 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / California zone 6
-<epsg26946> +proj=lcc +lat_1=33.88333333333333 +lat_2=32.78333333333333 +lat_0=32.16666666666666 +lon_0=-116.25 +x_0=2000000 +y_0=500000 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / Arizona East
-<epsg26948> +proj=tmerc +lat_0=31 +lon_0=-110.1666666666667 +k=0.9999 +x_0=213360 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / Arizona Central
-<epsg26949> +proj=tmerc +lat_0=31 +lon_0=-111.9166666666667 +k=0.9999 +x_0=213360 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / Arizona West
-<epsg26950> +proj=tmerc +lat_0=31 +lon_0=-113.75 +k=0.999933333 +x_0=213360 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / Arkansas North
-<epsg26951> +proj=lcc +lat_1=36.23333333333333 +lat_2=34.93333333333333 +lat_0=34.33333333333334 +lon_0=-92 +x_0=400000 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / Arkansas South
-<epsg26952> +proj=lcc +lat_1=34.76666666666667 +lat_2=33.3 +lat_0=32.66666666666666 +lon_0=-92 +x_0=400000 +y_0=400000 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / Colorado North
-<epsg26953> +proj=lcc +lat_1=40.78333333333333 +lat_2=39.71666666666667 +lat_0=39.33333333333334 +lon_0=-105.5 +x_0=914401.8289 +y_0=304800.6096 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / Colorado Central
-<epsg26954> +proj=lcc +lat_1=39.75 +lat_2=38.45 +lat_0=37.83333333333334 +lon_0=-105.5 +x_0=914401.8289 +y_0=304800.6096 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / Colorado South
-<epsg26955> +proj=lcc +lat_1=38.43333333333333 +lat_2=37.23333333333333 +lat_0=36.66666666666666 +lon_0=-105.5 +x_0=914401.8289 +y_0=304800.6096 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / Connecticut
-<epsg26956> +proj=lcc +lat_1=41.86666666666667 +lat_2=41.2 +lat_0=40.83333333333334 +lon_0=-72.75 +x_0=304800.6096 +y_0=152400.3048 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / Delaware
-<epsg26957> +proj=tmerc +lat_0=38 +lon_0=-75.41666666666667 +k=0.999995 +x_0=200000 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / Florida East
-<epsg26958> +proj=tmerc +lat_0=24.33333333333333 +lon_0=-81 +k=0.999941177 +x_0=200000 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / Florida West
-<epsg26959> +proj=tmerc +lat_0=24.33333333333333 +lon_0=-82 +k=0.999941177 +x_0=200000 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / Florida North
-<epsg26960> +proj=lcc +lat_1=30.75 +lat_2=29.58333333333333 +lat_0=29 +lon_0=-84.5 +x_0=600000 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / Hawaii zone 1
-<epsg26961> +proj=tmerc +lat_0=18.83333333333333 +lon_0=-155.5 +k=0.999966667 +x_0=500000 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / Hawaii zone 2
-<epsg26962> +proj=tmerc +lat_0=20.33333333333333 +lon_0=-156.6666666666667 +k=0.999966667 +x_0=500000 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / Hawaii zone 3
-<epsg26963> +proj=tmerc +lat_0=21.16666666666667 +lon_0=-158 +k=0.99999 +x_0=500000 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / Hawaii zone 4
-<epsg26964> +proj=tmerc +lat_0=21.83333333333333 +lon_0=-159.5 +k=0.99999 +x_0=500000 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / Hawaii zone 5
-<epsg26965> +proj=tmerc +lat_0=21.66666666666667 +lon_0=-160.1666666666667 +k=1 +x_0=500000 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / Georgia East
-<epsg26966> +proj=tmerc +lat_0=30 +lon_0=-82.16666666666667 +k=0.9999 +x_0=200000 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / Georgia West
-<epsg26967> +proj=tmerc +lat_0=30 +lon_0=-84.16666666666667 +k=0.9999 +x_0=700000 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / Idaho East
-<epsg26968> +proj=tmerc +lat_0=41.66666666666666 +lon_0=-112.1666666666667 +k=0.9999473679999999 +x_0=200000 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / Idaho Central
-<epsg26969> +proj=tmerc +lat_0=41.66666666666666 +lon_0=-114 +k=0.9999473679999999 +x_0=500000 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / Idaho West
-<epsg26970> +proj=tmerc +lat_0=41.66666666666666 +lon_0=-115.75 +k=0.999933333 +x_0=800000 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / Illinois East
-<epsg26971> +proj=tmerc +lat_0=36.66666666666666 +lon_0=-88.33333333333333 +k=0.9999749999999999 +x_0=300000 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / Illinois West
-<epsg26972> +proj=tmerc +lat_0=36.66666666666666 +lon_0=-90.16666666666667 +k=0.999941177 +x_0=700000 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / Indiana East
-<epsg26973> +proj=tmerc +lat_0=37.5 +lon_0=-85.66666666666667 +k=0.999966667 +x_0=100000 +y_0=250000 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / Indiana West
-<epsg26974> +proj=tmerc +lat_0=37.5 +lon_0=-87.08333333333333 +k=0.999966667 +x_0=900000 +y_0=250000 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / Iowa North
-<epsg26975> +proj=lcc +lat_1=43.26666666666667 +lat_2=42.06666666666667 +lat_0=41.5 +lon_0=-93.5 +x_0=1500000 +y_0=1000000 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / Iowa South
-<epsg26976> +proj=lcc +lat_1=41.78333333333333 +lat_2=40.61666666666667 +lat_0=40 +lon_0=-93.5 +x_0=500000 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / Kansas North
-<epsg26977> +proj=lcc +lat_1=39.78333333333333 +lat_2=38.71666666666667 +lat_0=38.33333333333334 +lon_0=-98 +x_0=400000 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / Kansas South
-<epsg26978> +proj=lcc +lat_1=38.56666666666667 +lat_2=37.26666666666667 +lat_0=36.66666666666666 +lon_0=-98.5 +x_0=400000 +y_0=400000 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / Kentucky North (deprecated)
-<epsg26979> +proj=lcc +lat_1=37.96666666666667 +lat_2=37.96666666666667 +lat_0=37.5 +lon_0=-84.25 +x_0=500000 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / Kentucky South
-<epsg26980> +proj=lcc +lat_1=37.93333333333333 +lat_2=36.73333333333333 +lat_0=36.33333333333334 +lon_0=-85.75 +x_0=500000 +y_0=500000 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / Louisiana North
-<epsg26981> +proj=lcc +lat_1=32.66666666666666 +lat_2=31.16666666666667 +lat_0=30.5 +lon_0=-92.5 +x_0=1000000 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / Louisiana South
-<epsg26982> +proj=lcc +lat_1=30.7 +lat_2=29.3 +lat_0=28.5 +lon_0=-91.33333333333333 +x_0=1000000 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / Maine East
-<epsg26983> +proj=tmerc +lat_0=43.66666666666666 +lon_0=-68.5 +k=0.9999 +x_0=300000 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / Maine West
-<epsg26984> +proj=tmerc +lat_0=42.83333333333334 +lon_0=-70.16666666666667 +k=0.999966667 +x_0=900000 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / Maryland
-<epsg26985> +proj=lcc +lat_1=39.45 +lat_2=38.3 +lat_0=37.66666666666666 +lon_0=-77 +x_0=400000 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / Massachusetts Mainland
-<epsg26986> +proj=lcc +lat_1=42.68333333333333 +lat_2=41.71666666666667 +lat_0=41 +lon_0=-71.5 +x_0=200000 +y_0=750000 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / Massachusetts Island
-<epsg26987> +proj=lcc +lat_1=41.48333333333333 +lat_2=41.28333333333333 +lat_0=41 +lon_0=-70.5 +x_0=500000 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / Michigan North
-<epsg26988> +proj=lcc +lat_1=47.08333333333334 +lat_2=45.48333333333333 +lat_0=44.78333333333333 +lon_0=-87 +x_0=8000000 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / Michigan Central
-<epsg26989> +proj=lcc +lat_1=45.7 +lat_2=44.18333333333333 +lat_0=43.31666666666667 +lon_0=-84.36666666666666 +x_0=6000000 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / Michigan South
-<epsg26990> +proj=lcc +lat_1=43.66666666666666 +lat_2=42.1 +lat_0=41.5 +lon_0=-84.36666666666666 +x_0=4000000 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / Minnesota North
-<epsg26991> +proj=lcc +lat_1=48.63333333333333 +lat_2=47.03333333333333 +lat_0=46.5 +lon_0=-93.09999999999999 +x_0=800000 +y_0=100000 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / Minnesota Central
-<epsg26992> +proj=lcc +lat_1=47.05 +lat_2=45.61666666666667 +lat_0=45 +lon_0=-94.25 +x_0=800000 +y_0=100000 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / Minnesota South
-<epsg26993> +proj=lcc +lat_1=45.21666666666667 +lat_2=43.78333333333333 +lat_0=43 +lon_0=-94 +x_0=800000 +y_0=100000 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / Mississippi East
-<epsg26994> +proj=tmerc +lat_0=29.5 +lon_0=-88.83333333333333 +k=0.99995 +x_0=300000 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / Mississippi West
-<epsg26995> +proj=tmerc +lat_0=29.5 +lon_0=-90.33333333333333 +k=0.99995 +x_0=700000 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / Missouri East
-<epsg26996> +proj=tmerc +lat_0=35.83333333333334 +lon_0=-90.5 +k=0.999933333 +x_0=250000 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / Missouri Central
-<epsg26997> +proj=tmerc +lat_0=35.83333333333334 +lon_0=-92.5 +k=0.999933333 +x_0=500000 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / Missouri West
-<epsg26998> +proj=tmerc +lat_0=36.16666666666666 +lon_0=-94.5 +k=0.999941177 +x_0=850000 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# Nahrwan 1967 / UTM zone 37N
-<epsg27037> +proj=utm +zone=37 +ellps=clrk80 +towgs84=-243,-192,477,0,0,0,0 +units=m +no_defs  <>
-# Nahrwan 1967 / UTM zone 38N
-<epsg27038> +proj=utm +zone=38 +ellps=clrk80 +towgs84=-243,-192,477,0,0,0,0 +units=m +no_defs  <>
-# Nahrwan 1967 / UTM zone 39N
-<epsg27039> +proj=utm +zone=39 +ellps=clrk80 +towgs84=-243,-192,477,0,0,0,0 +units=m +no_defs  <>
-# Nahrwan 1967 / UTM zone 40N
-<epsg27040> +proj=utm +zone=40 +ellps=clrk80 +towgs84=-243,-192,477,0,0,0,0 +units=m +no_defs  <>
-# Naparima 1972 / UTM zone 20N
-<epsg27120> +proj=utm +zone=20 +ellps=intl +towgs84=-10,375,165,0,0,0,0 +units=m +no_defs  <>
-# NZGD49 / New Zealand Map Grid
-<epsg27200> +proj=nzmg +lat_0=-41 +lon_0=173 +x_0=2510000 +y_0=6023150 +datum=nzgd49 +units=m +no_defs  <>
-# NZGD49 / Mount Eden Circuit
-<epsg27205> +proj=tmerc +lat_0=-36.87986527777778 +lon_0=174.7643393611111 +k=0.9999 +x_0=300000 +y_0=700000 +datum=nzgd49 +units=m +no_defs  <>
-# NZGD49 / Bay of Plenty Circuit
-<epsg27206> +proj=tmerc +lat_0=-37.76124980555556 +lon_0=176.46619725 +k=1 +x_0=300000 +y_0=700000 +datum=nzgd49 +units=m +no_defs  <>
-# NZGD49 / Poverty Bay Circuit
-<epsg27207> +proj=tmerc +lat_0=-38.62470277777778 +lon_0=177.8856362777778 +k=1 +x_0=300000 +y_0=700000 +datum=nzgd49 +units=m +no_defs  <>
-# NZGD49 / Hawkes Bay Circuit
-<epsg27208> +proj=tmerc +lat_0=-39.65092930555556 +lon_0=176.6736805277778 +k=1 +x_0=300000 +y_0=700000 +datum=nzgd49 +units=m +no_defs  <>
-# NZGD49 / Taranaki Circuit
-<epsg27209> +proj=tmerc +lat_0=-39.13575830555556 +lon_0=174.22801175 +k=1 +x_0=300000 +y_0=700000 +datum=nzgd49 +units=m +no_defs  <>
-# NZGD49 / Tuhirangi Circuit
-<epsg27210> +proj=tmerc +lat_0=-39.51247038888889 +lon_0=175.6400368055556 +k=1 +x_0=300000 +y_0=700000 +datum=nzgd49 +units=m +no_defs  <>
-# NZGD49 / Wanganui Circuit
-<epsg27211> +proj=tmerc +lat_0=-40.24194713888889 +lon_0=175.4880996111111 +k=1 +x_0=300000 +y_0=700000 +datum=nzgd49 +units=m +no_defs  <>
-# NZGD49 / Wairarapa Circuit
-<epsg27212> +proj=tmerc +lat_0=-40.92553263888889 +lon_0=175.6473496666667 +k=1 +x_0=300000 +y_0=700000 +datum=nzgd49 +units=m +no_defs  <>
-# NZGD49 / Wellington Circuit
-<epsg27213> +proj=tmerc +lat_0=-41.30131963888888 +lon_0=174.7766231111111 +k=1 +x_0=300000 +y_0=700000 +datum=nzgd49 +units=m +no_defs  <>
-# NZGD49 / Collingwood Circuit
-<epsg27214> +proj=tmerc +lat_0=-40.71475905555556 +lon_0=172.6720465 +k=1 +x_0=300000 +y_0=700000 +datum=nzgd49 +units=m +no_defs  <>
-# NZGD49 / Nelson Circuit
-<epsg27215> +proj=tmerc +lat_0=-41.27454472222222 +lon_0=173.2993168055555 +k=1 +x_0=300000 +y_0=700000 +datum=nzgd49 +units=m +no_defs  <>
-# NZGD49 / Karamea Circuit
-<epsg27216> +proj=tmerc +lat_0=-41.28991152777778 +lon_0=172.1090281944444 +k=1 +x_0=300000 +y_0=700000 +datum=nzgd49 +units=m +no_defs  <>
-# NZGD49 / Buller Circuit
-<epsg27217> +proj=tmerc +lat_0=-41.81080286111111 +lon_0=171.5812600555556 +k=1 +x_0=300000 +y_0=700000 +datum=nzgd49 +units=m +no_defs  <>
-# NZGD49 / Grey Circuit
-<epsg27218> +proj=tmerc +lat_0=-42.33369427777778 +lon_0=171.5497713055556 +k=1 +x_0=300000 +y_0=700000 +datum=nzgd49 +units=m +no_defs  <>
-# NZGD49 / Amuri Circuit
-<epsg27219> +proj=tmerc +lat_0=-42.68911658333333 +lon_0=173.0101333888889 +k=1 +x_0=300000 +y_0=700000 +datum=nzgd49 +units=m +no_defs  <>
-# NZGD49 / Marlborough Circuit
-<epsg27220> +proj=tmerc +lat_0=-41.54448666666666 +lon_0=173.8020741111111 +k=1 +x_0=300000 +y_0=700000 +datum=nzgd49 +units=m +no_defs  <>
-# NZGD49 / Hokitika Circuit
-<epsg27221> +proj=tmerc +lat_0=-42.88632236111111 +lon_0=170.9799935 +k=1 +x_0=300000 +y_0=700000 +datum=nzgd49 +units=m +no_defs  <>
-# NZGD49 / Okarito Circuit
-<epsg27222> +proj=tmerc +lat_0=-43.11012813888889 +lon_0=170.2609258333333 +k=1 +x_0=300000 +y_0=700000 +datum=nzgd49 +units=m +no_defs  <>
-# NZGD49 / Jacksons Bay Circuit
-<epsg27223> +proj=tmerc +lat_0=-43.97780288888889 +lon_0=168.606267 +k=1 +x_0=300000 +y_0=700000 +datum=nzgd49 +units=m +no_defs  <>
-# NZGD49 / Mount Pleasant Circuit
-<epsg27224> +proj=tmerc +lat_0=-43.59063758333333 +lon_0=172.7271935833333 +k=1 +x_0=300000 +y_0=700000 +datum=nzgd49 +units=m +no_defs  <>
-# NZGD49 / Gawler Circuit
-<epsg27225> +proj=tmerc +lat_0=-43.74871155555556 +lon_0=171.3607484722222 +k=1 +x_0=300000 +y_0=700000 +datum=nzgd49 +units=m +no_defs  <>
-# NZGD49 / Timaru Circuit
-<epsg27226> +proj=tmerc +lat_0=-44.40222036111111 +lon_0=171.0572508333333 +k=1 +x_0=300000 +y_0=700000 +datum=nzgd49 +units=m +no_defs  <>
-# NZGD49 / Lindis Peak Circuit
-<epsg27227> +proj=tmerc +lat_0=-44.73526797222222 +lon_0=169.4677550833333 +k=1 +x_0=300000 +y_0=700000 +datum=nzgd49 +units=m +no_defs  <>
-# NZGD49 / Mount Nicholas Circuit
-<epsg27228> +proj=tmerc +lat_0=-45.13290258333333 +lon_0=168.3986411944444 +k=1 +x_0=300000 +y_0=700000 +datum=nzgd49 +units=m +no_defs  <>
-# NZGD49 / Mount York Circuit
-<epsg27229> +proj=tmerc +lat_0=-45.56372616666666 +lon_0=167.7388617777778 +k=1 +x_0=300000 +y_0=700000 +datum=nzgd49 +units=m +no_defs  <>
-# NZGD49 / Observation Point Circuit
-<epsg27230> +proj=tmerc +lat_0=-45.81619661111111 +lon_0=170.6285951666667 +k=1 +x_0=300000 +y_0=700000 +datum=nzgd49 +units=m +no_defs  <>
-# NZGD49 / North Taieri Circuit
-<epsg27231> +proj=tmerc +lat_0=-45.86151336111111 +lon_0=170.2825891111111 +k=0.99996 +x_0=300000 +y_0=700000 +datum=nzgd49 +units=m +no_defs  <>
-# NZGD49 / Bluff Circuit
-<epsg27232> +proj=tmerc +lat_0=-46.60000961111111 +lon_0=168.342872 +k=1 +x_0=300002.66 +y_0=699999.58 +datum=nzgd49 +units=m +no_defs  <>
-# NZGD49 / UTM zone 58S
-<epsg27258> +proj=utm +zone=58 +south +datum=nzgd49 +units=m +no_defs  <>
-# NZGD49 / UTM zone 59S
-<epsg27259> +proj=utm +zone=59 +south +datum=nzgd49 +units=m +no_defs  <>
-# NZGD49 / UTM zone 60S
-<epsg27260> +proj=utm +zone=60 +south +datum=nzgd49 +units=m +no_defs  <>
-# NZGD49 / North Island Grid
-<epsg27291> +proj=tmerc +lat_0=-39 +lon_0=175.5 +k=1 +x_0=274319.5243848086 +y_0=365759.3658464114 +datum=nzgd49 +to_meter=0.9143984146160287 +no_defs  <>
-# NZGD49 / South Island Grid
-<epsg27292> +proj=tmerc +lat_0=-44 +lon_0=171.5 +k=1 +x_0=457199.2073080143 +y_0=457199.2073080143 +datum=nzgd49 +to_meter=0.9143984146160287 +no_defs  <>
-# NGO 1948 (Oslo) / NGO zone I
-<epsg27391> +proj=tmerc +lat_0=58 +lon_0=-4.666666666666667 +k=1 +x_0=0 +y_0=0 +a=6377492.018 +b=6356173.508712696 +towgs84=278.3,93,474.5,7.889,0.05,-6.61,6.21 +pm=oslo +units=m +no_defs  <>
-# NGO 1948 (Oslo) / NGO zone II
-<epsg27392> +proj=tmerc +lat_0=58 +lon_0=-2.333333333333333 +k=1 +x_0=0 +y_0=0 +a=6377492.018 +b=6356173.508712696 +towgs84=278.3,93,474.5,7.889,0.05,-6.61,6.21 +pm=oslo +units=m +no_defs  <>
-# NGO 1948 (Oslo) / NGO zone III
-<epsg27393> +proj=tmerc +lat_0=58 +lon_0=0 +k=1 +x_0=0 +y_0=0 +a=6377492.018 +b=6356173.508712696 +towgs84=278.3,93,474.5,7.889,0.05,-6.61,6.21 +pm=oslo +units=m +no_defs  <>
-# NGO 1948 (Oslo) / NGO zone IV
-<epsg27394> +proj=tmerc +lat_0=58 +lon_0=2.5 +k=1 +x_0=0 +y_0=0 +a=6377492.018 +b=6356173.508712696 +towgs84=278.3,93,474.5,7.889,0.05,-6.61,6.21 +pm=oslo +units=m +no_defs  <>
-# NGO 1948 (Oslo) / NGO zone V
-<epsg27395> +proj=tmerc +lat_0=58 +lon_0=6.166666666666667 +k=1 +x_0=0 +y_0=0 +a=6377492.018 +b=6356173.508712696 +towgs84=278.3,93,474.5,7.889,0.05,-6.61,6.21 +pm=oslo +units=m +no_defs  <>
-# NGO 1948 (Oslo) / NGO zone VI
-<epsg27396> +proj=tmerc +lat_0=58 +lon_0=10.16666666666667 +k=1 +x_0=0 +y_0=0 +a=6377492.018 +b=6356173.508712696 +towgs84=278.3,93,474.5,7.889,0.05,-6.61,6.21 +pm=oslo +units=m +no_defs  <>
-# NGO 1948 (Oslo) / NGO zone VII
-<epsg27397> +proj=tmerc +lat_0=58 +lon_0=14.16666666666667 +k=1 +x_0=0 +y_0=0 +a=6377492.018 +b=6356173.508712696 +towgs84=278.3,93,474.5,7.889,0.05,-6.61,6.21 +pm=oslo +units=m +no_defs  <>
-# NGO 1948 (Oslo) / NGO zone VIII
-<epsg27398> +proj=tmerc +lat_0=58 +lon_0=18.33333333333333 +k=1 +x_0=0 +y_0=0 +a=6377492.018 +b=6356173.508712696 +towgs84=278.3,93,474.5,7.889,0.05,-6.61,6.21 +pm=oslo +units=m +no_defs  <>
-# Datum 73 / UTM zone 29N
-<epsg27429> +proj=utm +zone=29 +ellps=intl +towgs84=-223.237,110.193,36.649,0,0,0,0 +units=m +no_defs  <>
-# Datum 73 / Modified Portuguese Grid (deprecated)
-<epsg27492> +proj=tmerc +lat_0=39.66666666666666 +lon_0=-8.131906111111112 +k=1 +x_0=180.598 +y_0=-86.98999999999999 +ellps=intl +towgs84=-223.237,110.193,36.649,0,0,0,0 +units=m +no_defs  <>
-# Datum 73 / Modified Portuguese Grid
-<epsg27493> +proj=tmerc +lat_0=39.66666666666666 +lon_0=-8.131906111111112 +k=1 +x_0=180.598 +y_0=-86.98999999999999 +ellps=intl +towgs84=-223.237,110.193,36.649,0,0,0,0 +units=m +no_defs  <>
-# ATF (Paris) / Nord de Guerre
-<epsg27500> +proj=lcc +lat_1=49.50000000000001 +lat_0=49.50000000000001 +lon_0=5.399999999999999 +k_0=0.99950908 +x_0=500000 +y_0=300000 +a=6376523 +b=6355862.933255573 +pm=2.337208333333333 +units=m +no_defs  <>
-# NTF (Paris) / Lambert Nord France
-<epsg27561> +proj=lcc +lat_1=49.50000000000001 +lat_0=49.50000000000001 +lon_0=0 +k_0=0.999877341 +x_0=600000 +y_0=200000 +a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 +pm=paris +units=m +no_defs  <>
-# NTF (Paris) / Lambert Centre France
-<epsg27562> +proj=lcc +lat_1=46.8 +lat_0=46.8 +lon_0=0 +k_0=0.99987742 +x_0=600000 +y_0=200000 +a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 +pm=paris +units=m +no_defs  <>
-# NTF (Paris) / Lambert Sud France
-<epsg27563> +proj=lcc +lat_1=44.10000000000001 +lat_0=44.10000000000001 +lon_0=0 +k_0=0.999877499 +x_0=600000 +y_0=200000 +a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 +pm=paris +units=m +no_defs  <>
-# NTF (Paris) / Lambert Corse
-<epsg27564> +proj=lcc +lat_1=42.16500000000001 +lat_0=42.16500000000001 +lon_0=0 +k_0=0.99994471 +x_0=234.358 +y_0=185861.369 +a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 +pm=paris +units=m +no_defs  <>
-# NTF (Paris) / Lambert zone I
-<epsg27571> +proj=lcc +lat_1=49.50000000000001 +lat_0=49.50000000000001 +lon_0=0 +k_0=0.999877341 +x_0=600000 +y_0=1200000 +a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 +pm=paris +units=m +no_defs  <>
-# NTF (Paris) / Lambert zone II
-<epsg27572> +proj=lcc +lat_1=46.8 +lat_0=46.8 +lon_0=0 +k_0=0.99987742 +x_0=600000 +y_0=2200000 +a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 +pm=paris +units=m +no_defs  <>
-# NTF (Paris) / Lambert zone III
-<epsg27573> +proj=lcc +lat_1=44.10000000000001 +lat_0=44.10000000000001 +lon_0=0 +k_0=0.999877499 +x_0=600000 +y_0=3200000 +a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 +pm=paris +units=m +no_defs  <>
-# NTF (Paris) / Lambert zone IV
-<epsg27574> +proj=lcc +lat_1=42.16500000000001 +lat_0=42.16500000000001 +lon_0=0 +k_0=0.99994471 +x_0=234.358 +y_0=4185861.369 +a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 +pm=paris +units=m +no_defs  <>
-# NTF (Paris) / France I (deprecated)
-<epsg27581> +proj=lcc +lat_1=49.50000000000001 +lat_0=49.50000000000001 +lon_0=0 +k_0=0.999877341 +x_0=600000 +y_0=1200000 +a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 +pm=paris +units=m +no_defs  <>
-# NTF (Paris) / France II (deprecated)
-<epsg27582> +proj=lcc +lat_1=46.8 +lat_0=46.8 +lon_0=0 +k_0=0.99987742 +x_0=600000 +y_0=2200000 +a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 +pm=paris +units=m +no_defs  <>
-# NTF (Paris) / France III (deprecated)
-<epsg27583> +proj=lcc +lat_1=44.10000000000001 +lat_0=44.10000000000001 +lon_0=0 +k_0=0.999877499 +x_0=600000 +y_0=3200000 +a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 +pm=paris +units=m +no_defs  <>
-# NTF (Paris) / France IV (deprecated)
-<epsg27584> +proj=lcc +lat_1=42.16500000000001 +lat_0=42.16500000000001 +lon_0=0 +k_0=0.99994471 +x_0=234.358 +y_0=4185861.369 +a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 +pm=paris +units=m +no_defs  <>
-# NTF (Paris) / Nord France (deprecated)
-<epsg27591> +proj=lcc +lat_1=49.50000000000001 +lat_0=49.50000000000001 +lon_0=0 +k_0=0.999877341 +x_0=600000 +y_0=200000 +a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 +pm=paris +units=m +no_defs  <>
-# NTF (Paris) / Centre France (deprecated)
-<epsg27592> +proj=lcc +lat_1=46.8 +lat_0=46.8 +lon_0=0 +k_0=0.99987742 +x_0=600000 +y_0=200000 +a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 +pm=paris +units=m +no_defs  <>
-# NTF (Paris) / Sud France (deprecated)
-<epsg27593> +proj=lcc +lat_1=44.10000000000001 +lat_0=44.10000000000001 +lon_0=0 +k_0=0.999877499 +x_0=600000 +y_0=200000 +a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 +pm=paris +units=m +no_defs  <>
-# NTF (Paris) / Corse (deprecated)
-<epsg27594> +proj=lcc +lat_1=42.16500000000001 +lat_0=42.16500000000001 +lon_0=0 +k_0=0.99994471 +x_0=234.358 +y_0=185861.369 +a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 +pm=paris +units=m +no_defs  <>
-# OSGB 1936 / British National Grid
-<epsg27700> +proj=tmerc +lat_0=49 +lon_0=-2 +k=0.9996012717 +x_0=400000 +y_0=-100000 +datum=OSGB36 +units=m +no_defs  <>
-# Palestine 1923 / Palestine Grid
-<epsg28191> +proj=cass +lat_0=31.73409694444445 +lon_0=35.21208055555556 +x_0=170251.555 +y_0=126867.909 +a=6378300.789 +b=6356566.435 +towgs84=-275.722,94.7824,340.894,-8.001,-4.42,-11.821,1 +units=m +no_defs  <>
-# Palestine 1923 / Palestine Belt
-<epsg28192> +proj=tmerc +lat_0=31.73409694444445 +lon_0=35.21208055555556 +k=1 +x_0=170251.555 +y_0=1126867.909 +a=6378300.789 +b=6356566.435 +towgs84=-275.722,94.7824,340.894,-8.001,-4.42,-11.821,1 +units=m +no_defs  <>
-# Palestine 1923 / Israeli CS Grid
-<epsg28193> +proj=cass +lat_0=31.73409694444445 +lon_0=35.21208055555556 +x_0=170251.555 +y_0=1126867.909 +a=6378300.789 +b=6356566.435 +towgs84=-275.722,94.7824,340.894,-8.001,-4.42,-11.821,1 +units=m +no_defs  <>
-# Pointe Noire / UTM zone 32S
-<epsg28232> +proj=utm +zone=32 +south +a=6378249.2 +b=6356515 +towgs84=-148,51,-291,0,0,0,0 +units=m +no_defs  <>
-# GDA94 / MGA zone 48
-<epsg28348> +proj=utm +zone=48 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# GDA94 / MGA zone 49
-<epsg28349> +proj=utm +zone=49 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# GDA94 / MGA zone 50
-<epsg28350> +proj=utm +zone=50 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# GDA94 / MGA zone 51
-<epsg28351> +proj=utm +zone=51 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# GDA94 / MGA zone 52
-<epsg28352> +proj=utm +zone=52 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# GDA94 / MGA zone 53
-<epsg28353> +proj=utm +zone=53 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# GDA94 / MGA zone 54
-<epsg28354> +proj=utm +zone=54 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# GDA94 / MGA zone 55
-<epsg28355> +proj=utm +zone=55 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# GDA94 / MGA zone 56
-<epsg28356> +proj=utm +zone=56 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# GDA94 / MGA zone 57
-<epsg28357> +proj=utm +zone=57 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# GDA94 / MGA zone 58
-<epsg28358> +proj=utm +zone=58 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# Pulkovo 1942 / Gauss-Kruger zone 2 (deprecated)
-<epsg28402> +proj=tmerc +lat_0=0 +lon_0=9 +k=1 +x_0=2500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / Gauss-Kruger zone 3 (deprecated)
-<epsg28403> +proj=tmerc +lat_0=0 +lon_0=15 +k=1 +x_0=3500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / Gauss-Kruger zone 4
-<epsg28404> +proj=tmerc +lat_0=0 +lon_0=21 +k=1 +x_0=4500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / Gauss-Kruger zone 5
-<epsg28405> +proj=tmerc +lat_0=0 +lon_0=27 +k=1 +x_0=5500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / Gauss-Kruger zone 6
-<epsg28406> +proj=tmerc +lat_0=0 +lon_0=33 +k=1 +x_0=6500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / Gauss-Kruger zone 7
-<epsg28407> +proj=tmerc +lat_0=0 +lon_0=39 +k=1 +x_0=7500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / Gauss-Kruger zone 8
-<epsg28408> +proj=tmerc +lat_0=0 +lon_0=45 +k=1 +x_0=8500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / Gauss-Kruger zone 9
-<epsg28409> +proj=tmerc +lat_0=0 +lon_0=51 +k=1 +x_0=9500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / Gauss-Kruger zone 10
-<epsg28410> +proj=tmerc +lat_0=0 +lon_0=57 +k=1 +x_0=10500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / Gauss-Kruger zone 11
-<epsg28411> +proj=tmerc +lat_0=0 +lon_0=63 +k=1 +x_0=11500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / Gauss-Kruger zone 12
-<epsg28412> +proj=tmerc +lat_0=0 +lon_0=69 +k=1 +x_0=12500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / Gauss-Kruger zone 13
-<epsg28413> +proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=13500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / Gauss-Kruger zone 14
-<epsg28414> +proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=14500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / Gauss-Kruger zone 15
-<epsg28415> +proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=15500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / Gauss-Kruger zone 16
-<epsg28416> +proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=16500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / Gauss-Kruger zone 17
-<epsg28417> +proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=17500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / Gauss-Kruger zone 18
-<epsg28418> +proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=18500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / Gauss-Kruger zone 19
-<epsg28419> +proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=19500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / Gauss-Kruger zone 20
-<epsg28420> +proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=20500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / Gauss-Kruger zone 21
-<epsg28421> +proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=21500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / Gauss-Kruger zone 22
-<epsg28422> +proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=22500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / Gauss-Kruger zone 23
-<epsg28423> +proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=23500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / Gauss-Kruger zone 24
-<epsg28424> +proj=tmerc +lat_0=0 +lon_0=141 +k=1 +x_0=24500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / Gauss-Kruger zone 25
-<epsg28425> +proj=tmerc +lat_0=0 +lon_0=147 +k=1 +x_0=25500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / Gauss-Kruger zone 26
-<epsg28426> +proj=tmerc +lat_0=0 +lon_0=153 +k=1 +x_0=26500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / Gauss-Kruger zone 27
-<epsg28427> +proj=tmerc +lat_0=0 +lon_0=159 +k=1 +x_0=27500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / Gauss-Kruger zone 28
-<epsg28428> +proj=tmerc +lat_0=0 +lon_0=165 +k=1 +x_0=28500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / Gauss-Kruger zone 29
-<epsg28429> +proj=tmerc +lat_0=0 +lon_0=171 +k=1 +x_0=29500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / Gauss-Kruger zone 30
-<epsg28430> +proj=tmerc +lat_0=0 +lon_0=177 +k=1 +x_0=30500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / Gauss-Kruger zone 31
-<epsg28431> +proj=tmerc +lat_0=0 +lon_0=-177 +k=1 +x_0=31500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / Gauss-Kruger zone 32
-<epsg28432> +proj=tmerc +lat_0=0 +lon_0=-171 +k=1 +x_0=32500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / Gauss-Kruger 2N (deprecated)
-<epsg28462> +proj=tmerc +lat_0=0 +lon_0=9 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / Gauss-Kruger 3N (deprecated)
-<epsg28463> +proj=tmerc +lat_0=0 +lon_0=15 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / Gauss-Kruger 4N (deprecated)
-<epsg28464> +proj=tmerc +lat_0=0 +lon_0=21 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / Gauss-Kruger 5N (deprecated)
-<epsg28465> +proj=tmerc +lat_0=0 +lon_0=27 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / Gauss-Kruger 6N (deprecated)
-<epsg28466> +proj=tmerc +lat_0=0 +lon_0=33 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / Gauss-Kruger 7N (deprecated)
-<epsg28467> +proj=tmerc +lat_0=0 +lon_0=39 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / Gauss-Kruger 8N (deprecated)
-<epsg28468> +proj=tmerc +lat_0=0 +lon_0=45 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / Gauss-Kruger 9N (deprecated)
-<epsg28469> +proj=tmerc +lat_0=0 +lon_0=51 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / Gauss-Kruger 10N (deprecated)
-<epsg28470> +proj=tmerc +lat_0=0 +lon_0=57 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / Gauss-Kruger 11N (deprecated)
-<epsg28471> +proj=tmerc +lat_0=0 +lon_0=63 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / Gauss-Kruger 12N (deprecated)
-<epsg28472> +proj=tmerc +lat_0=0 +lon_0=69 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / Gauss-Kruger 13N (deprecated)
-<epsg28473> +proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / Gauss-Kruger 14N (deprecated)
-<epsg28474> +proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / Gauss-Kruger 15N (deprecated)
-<epsg28475> +proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / Gauss-Kruger 16N (deprecated)
-<epsg28476> +proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / Gauss-Kruger 17N (deprecated)
-<epsg28477> +proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / Gauss-Kruger 18N (deprecated)
-<epsg28478> +proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / Gauss-Kruger 19N (deprecated)
-<epsg28479> +proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / Gauss-Kruger 20N (deprecated)
-<epsg28480> +proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / Gauss-Kruger 21N (deprecated)
-<epsg28481> +proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / Gauss-Kruger 22N (deprecated)
-<epsg28482> +proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / Gauss-Kruger 23N (deprecated)
-<epsg28483> +proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / Gauss-Kruger 24N (deprecated)
-<epsg28484> +proj=tmerc +lat_0=0 +lon_0=141 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / Gauss-Kruger 25N (deprecated)
-<epsg28485> +proj=tmerc +lat_0=0 +lon_0=147 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / Gauss-Kruger 26N (deprecated)
-<epsg28486> +proj=tmerc +lat_0=0 +lon_0=153 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / Gauss-Kruger 27N (deprecated)
-<epsg28487> +proj=tmerc +lat_0=0 +lon_0=159 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / Gauss-Kruger 28N (deprecated)
-<epsg28488> +proj=tmerc +lat_0=0 +lon_0=165 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / Gauss-Kruger 29N (deprecated)
-<epsg28489> +proj=tmerc +lat_0=0 +lon_0=171 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / Gauss-Kruger 30N (deprecated)
-<epsg28490> +proj=tmerc +lat_0=0 +lon_0=177 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / Gauss-Kruger 31N (deprecated)
-<epsg28491> +proj=tmerc +lat_0=0 +lon_0=-177 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Pulkovo 1942 / Gauss-Kruger 32N (deprecated)
-<epsg28492> +proj=tmerc +lat_0=0 +lon_0=-171 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=23.92,-141.27,-80.9,-0,0.35,0.82,-0.12 +units=m +no_defs  <>
-# Qatar 1974 / Qatar National Grid
-<epsg28600> +proj=tmerc +lat_0=24.45 +lon_0=51.21666666666667 +k=0.99999 +x_0=200000 +y_0=300000 +ellps=intl +towgs84=-128.16,-282.42,21.93,0,0,0,0 +units=m +no_defs  <>
-# Amersfoort / RD Old
-<epsg28991> +proj=sterea +lat_0=52.15616055555555 +lon_0=5.38763888888889 +k=0.9999079 +x_0=0 +y_0=0 +ellps=bessel +towgs84=565.417,50.3319,465.552,-0.398957,0.343988,-1.8774,4.0725 +units=m +no_defs  <>
-# Amersfoort / RD New
-<epsg28992> +proj=sterea +lat_0=52.15616055555555 +lon_0=5.38763888888889 +k=0.9999079 +x_0=155000 +y_0=463000 +ellps=bessel +towgs84=565.417,50.3319,465.552,-0.398957,0.343988,-1.8774,4.0725 +units=m +no_defs  <>
-# SAD69 / Brazil Polyconic (deprecated)
-<epsg29100> +proj=poly +lat_0=0 +lon_0=-54 +x_0=5000000 +y_0=10000000 +ellps=GRS67 +towgs84=-57,1,-41,0,0,0,0 +units=m +no_defs  <>
-# SAD69 / Brazil Polyconic
-<epsg29101> +proj=poly +lat_0=0 +lon_0=-54 +x_0=5000000 +y_0=10000000 +ellps=aust_SA +towgs84=-57,1,-41,0,0,0,0 +units=m +no_defs  <>
-# SAD69 / UTM zone 18N (deprecated)
-<epsg29118> +proj=utm +zone=18 +ellps=GRS67 +towgs84=-57,1,-41,0,0,0,0 +units=m +no_defs  <>
-# SAD69 / UTM zone 19N (deprecated)
-<epsg29119> +proj=utm +zone=19 +ellps=GRS67 +towgs84=-57,1,-41,0,0,0,0 +units=m +no_defs  <>
-# SAD69 / UTM zone 20N (deprecated)
-<epsg29120> +proj=utm +zone=20 +ellps=GRS67 +towgs84=-57,1,-41,0,0,0,0 +units=m +no_defs  <>
-# SAD69 / UTM zone 21N (deprecated)
-<epsg29121> +proj=utm +zone=21 +ellps=GRS67 +towgs84=-57,1,-41,0,0,0,0 +units=m +no_defs  <>
-# SAD69 / UTM zone 22N (deprecated)
-<epsg29122> +proj=utm +zone=22 +ellps=GRS67 +towgs84=-57,1,-41,0,0,0,0 +units=m +no_defs  <>
-# SAD69 / UTM zone 18N
-<epsg29168> +proj=utm +zone=18 +ellps=aust_SA +towgs84=-57,1,-41,0,0,0,0 +units=m +no_defs  <>
-# SAD69 / UTM zone 19N
-<epsg29169> +proj=utm +zone=19 +ellps=aust_SA +towgs84=-57,1,-41,0,0,0,0 +units=m +no_defs  <>
-# SAD69 / UTM zone 20N
-<epsg29170> +proj=utm +zone=20 +ellps=aust_SA +towgs84=-57,1,-41,0,0,0,0 +units=m +no_defs  <>
-# SAD69 / UTM zone 21N
-<epsg29171> +proj=utm +zone=21 +ellps=aust_SA +towgs84=-57,1,-41,0,0,0,0 +units=m +no_defs  <>
-# SAD69 / UTM zone 22N
-<epsg29172> +proj=utm +zone=22 +ellps=aust_SA +towgs84=-57,1,-41,0,0,0,0 +units=m +no_defs  <>
-# SAD69 / UTM zone 17S (deprecated)
-<epsg29177> +proj=utm +zone=17 +south +ellps=GRS67 +towgs84=-57,1,-41,0,0,0,0 +units=m +no_defs  <>
-# SAD69 / UTM zone 18S (deprecated)
-<epsg29178> +proj=utm +zone=18 +south +ellps=GRS67 +towgs84=-57,1,-41,0,0,0,0 +units=m +no_defs  <>
-# SAD69 / UTM zone 19S (deprecated)
-<epsg29179> +proj=utm +zone=19 +south +ellps=GRS67 +towgs84=-57,1,-41,0,0,0,0 +units=m +no_defs  <>
-# SAD69 / UTM zone 20S (deprecated)
-<epsg29180> +proj=utm +zone=20 +south +ellps=GRS67 +towgs84=-57,1,-41,0,0,0,0 +units=m +no_defs  <>
-# SAD69 / UTM zone 21S (deprecated)
-<epsg29181> +proj=utm +zone=21 +south +ellps=GRS67 +towgs84=-57,1,-41,0,0,0,0 +units=m +no_defs  <>
-# SAD69 / UTM zone 22S (deprecated)
-<epsg29182> +proj=utm +zone=22 +south +ellps=GRS67 +towgs84=-57,1,-41,0,0,0,0 +units=m +no_defs  <>
-# SAD69 / UTM zone 23S (deprecated)
-<epsg29183> +proj=utm +zone=23 +south +ellps=GRS67 +towgs84=-57,1,-41,0,0,0,0 +units=m +no_defs  <>
-# SAD69 / UTM zone 24S (deprecated)
-<epsg29184> +proj=utm +zone=24 +south +ellps=GRS67 +towgs84=-57,1,-41,0,0,0,0 +units=m +no_defs  <>
-# SAD69 / UTM zone 25S (deprecated)
-<epsg29185> +proj=utm +zone=25 +south +ellps=GRS67 +towgs84=-57,1,-41,0,0,0,0 +units=m +no_defs  <>
-# SAD69 / UTM zone 17S
-<epsg29187> +proj=utm +zone=17 +south +ellps=aust_SA +towgs84=-57,1,-41,0,0,0,0 +units=m +no_defs  <>
-# SAD69 / UTM zone 18S
-<epsg29188> +proj=utm +zone=18 +south +ellps=aust_SA +towgs84=-57,1,-41,0,0,0,0 +units=m +no_defs  <>
-# SAD69 / UTM zone 19S
-<epsg29189> +proj=utm +zone=19 +south +ellps=aust_SA +towgs84=-57,1,-41,0,0,0,0 +units=m +no_defs  <>
-# SAD69 / UTM zone 20S
-<epsg29190> +proj=utm +zone=20 +south +ellps=aust_SA +towgs84=-57,1,-41,0,0,0,0 +units=m +no_defs  <>
-# SAD69 / UTM zone 21S
-<epsg29191> +proj=utm +zone=21 +south +ellps=aust_SA +towgs84=-57,1,-41,0,0,0,0 +units=m +no_defs  <>
-# SAD69 / UTM zone 22S
-<epsg29192> +proj=utm +zone=22 +south +ellps=aust_SA +towgs84=-57,1,-41,0,0,0,0 +units=m +no_defs  <>
-# SAD69 / UTM zone 23S
-<epsg29193> +proj=utm +zone=23 +south +ellps=aust_SA +towgs84=-57,1,-41,0,0,0,0 +units=m +no_defs  <>
-# SAD69 / UTM zone 24S
-<epsg29194> +proj=utm +zone=24 +south +ellps=aust_SA +towgs84=-57,1,-41,0,0,0,0 +units=m +no_defs  <>
-# SAD69 / UTM zone 25S
-<epsg29195> +proj=utm +zone=25 +south +ellps=aust_SA +towgs84=-57,1,-41,0,0,0,0 +units=m +no_defs  <>
-# Sapper Hill 1943 / UTM zone 20S
-<epsg29220> +proj=utm +zone=20 +south +ellps=intl +towgs84=-355,21,72,0,0,0,0 +units=m +no_defs  <>
-# Sapper Hill 1943 / UTM zone 21S
-<epsg29221> +proj=utm +zone=21 +south +ellps=intl +towgs84=-355,21,72,0,0,0,0 +units=m +no_defs  <>
-# Schwarzeck / UTM zone 33S
-<epsg29333> +proj=utm +zone=33 +south +ellps=bess_nam +towgs84=616,97,-251,0,0,0,0 +units=m +no_defs  <>
-# Schwarzeck / Lo22/11
-<epsg29371> +proj=tmerc +lat_0=-22 +lon_0=11 +k=1 +x_0=0 +y_0=0 +axis=wsu +ellps=bess_nam +towgs84=616,97,-251,0,0,0,0 +to_meter=1.0000135965 +no_defs  <>
-# Schwarzeck / Lo22/13
-<epsg29373> +proj=tmerc +lat_0=-22 +lon_0=13 +k=1 +x_0=0 +y_0=0 +axis=wsu +ellps=bess_nam +towgs84=616,97,-251,0,0,0,0 +to_meter=1.0000135965 +no_defs  <>
-# Schwarzeck / Lo22/15
-<epsg29375> +proj=tmerc +lat_0=-22 +lon_0=15 +k=1 +x_0=0 +y_0=0 +axis=wsu +ellps=bess_nam +towgs84=616,97,-251,0,0,0,0 +to_meter=1.0000135965 +no_defs  <>
-# Schwarzeck / Lo22/17
-<epsg29377> +proj=tmerc +lat_0=-22 +lon_0=17 +k=1 +x_0=0 +y_0=0 +axis=wsu +ellps=bess_nam +towgs84=616,97,-251,0,0,0,0 +to_meter=1.0000135965 +no_defs  <>
-# Schwarzeck / Lo22/19
-<epsg29379> +proj=tmerc +lat_0=-22 +lon_0=19 +k=1 +x_0=0 +y_0=0 +axis=wsu +ellps=bess_nam +towgs84=616,97,-251,0,0,0,0 +to_meter=1.0000135965 +no_defs  <>
-# Schwarzeck / Lo22/21
-<epsg29381> +proj=tmerc +lat_0=-22 +lon_0=21 +k=1 +x_0=0 +y_0=0 +axis=wsu +ellps=bess_nam +towgs84=616,97,-251,0,0,0,0 +to_meter=1.0000135965 +no_defs  <>
-# Schwarzeck / Lo22/23
-<epsg29383> +proj=tmerc +lat_0=-22 +lon_0=23 +k=1 +x_0=0 +y_0=0 +axis=wsu +ellps=bess_nam +towgs84=616,97,-251,0,0,0,0 +to_meter=1.0000135965 +no_defs  <>
-# Schwarzeck / Lo22/25
-<epsg29385> +proj=tmerc +lat_0=-22 +lon_0=25 +k=1 +x_0=0 +y_0=0 +axis=wsu +ellps=bess_nam +towgs84=616,97,-251,0,0,0,0 +to_meter=1.0000135965 +no_defs  <>
-# Sudan / UTM zone 35N (deprecated)
-<epsg29635> +proj=utm +zone=35 +a=6378249.2 +b=6356515 +units=m +no_defs  <>
-# Sudan / UTM zone 36N (deprecated)
-<epsg29636> +proj=utm +zone=36 +a=6378249.2 +b=6356515 +units=m +no_defs  <>
-# Tananarive (Paris) / Laborde Grid (deprecated)
-<epsg29700> +proj=omerc +lat_0=-18.9 +lonc=44.10000000000001 +alpha=18.9 +k=0.9995000000000001 +x_0=400000 +y_0=800000 +gamma=18.9 +ellps=intl +towgs84=-189,-242,-91,0,0,0,0 +pm=paris +units=m +no_defs  <>
-# Tananarive (Paris) / Laborde Grid
-# Unable to translate coordinate system EPSG:29701 into PROJ.4 format.
-#
-# Tananarive (Paris) / Laborde Grid approximation
-<epsg29702> +proj=omerc +lat_0=-18.9 +lonc=44.10000000000001 +alpha=18.9 +k=0.9995000000000001 +x_0=400000 +y_0=800000 +gamma=18.9 +ellps=intl +towgs84=-189,-242,-91,0,0,0,0 +pm=paris +units=m +no_defs  <>
-# Tananarive / UTM zone 38S
-<epsg29738> +proj=utm +zone=38 +south +ellps=intl +towgs84=-189,-242,-91,0,0,0,0 +units=m +no_defs  <>
-# Tananarive / UTM zone 39S
-<epsg29739> +proj=utm +zone=39 +south +ellps=intl +towgs84=-189,-242,-91,0,0,0,0 +units=m +no_defs  <>
-# Timbalai 1948 / UTM zone 49N
-<epsg29849> +proj=utm +zone=49 +ellps=evrstSS +towgs84=-533.4,669.2,-52.5,0,0,4.28,9.4 +units=m +no_defs  <>
-# Timbalai 1948 / UTM zone 50N
-<epsg29850> +proj=utm +zone=50 +ellps=evrstSS +towgs84=-533.4,669.2,-52.5,0,0,4.28,9.4 +units=m +no_defs  <>
-# Timbalai 1948 / RSO Borneo (ch)
-<epsg29871> +proj=omerc +lat_0=4 +lonc=115 +alpha=53.31582047222222 +k=0.99984 +x_0=590476.8714630401 +y_0=442857.653094361 +gamma=53.13010236111111 +ellps=evrstSS +towgs84=-533.4,669.2,-52.5,0,0,4.28,9.4 +to_meter=20.11676512155263 +no_defs  <>
-# Timbalai 1948 / RSO Borneo (ft)
-<epsg29872> +proj=omerc +lat_0=4 +lonc=115 +alpha=53.31582047222222 +k=0.99984 +x_0=590476.8727431979 +y_0=442857.6545573985 +gamma=53.13010236111111 +ellps=evrstSS +towgs84=-533.4,669.2,-52.5,0,0,4.28,9.4 +to_meter=0.3047994715386762 +no_defs  <>
-# Timbalai 1948 / RSO Borneo (m)
-<epsg29873> +proj=omerc +lat_0=4 +lonc=115 +alpha=53.31582047222222 +k=0.99984 +x_0=590476.87 +y_0=442857.65 +gamma=53.13010236111111 +ellps=evrstSS +towgs84=-533.4,669.2,-52.5,0,0,4.28,9.4 +units=m +no_defs  <>
-# TM65 / Irish National Grid (deprecated)
-<epsg29900> +proj=tmerc +lat_0=53.5 +lon_0=-8 +k=1.000035 +x_0=200000 +y_0=250000 +datum=ire65 +units=m +no_defs  <>
-# OSNI 1952 / Irish National Grid
-<epsg29901> +proj=tmerc +lat_0=53.5 +lon_0=-8 +k=1 +x_0=200000 +y_0=250000 +ellps=airy +towgs84=482.5,-130.6,564.6,-1.042,-0.214,-0.631,8.15 +units=m +no_defs  <>
-# TM65 / Irish Grid
-<epsg29902> +proj=tmerc +lat_0=53.5 +lon_0=-8 +k=1.000035 +x_0=200000 +y_0=250000 +datum=ire65 +units=m +no_defs  <>
-# TM75 / Irish Grid
-<epsg29903> +proj=tmerc +lat_0=53.5 +lon_0=-8 +k=1.000035 +x_0=200000 +y_0=250000 +ellps=mod_airy +towgs84=482.5,-130.6,564.6,-1.042,-0.214,-0.631,8.15 +units=m +no_defs  <>
-# Tokyo / Japan Plane Rectangular CS I
-<epsg30161> +proj=tmerc +lat_0=33 +lon_0=129.5 +k=0.9999 +x_0=0 +y_0=0 +ellps=bessel +towgs84=-146.414,507.337,680.507,0,0,0,0 +units=m +no_defs  <>
-# Tokyo / Japan Plane Rectangular CS II
-<epsg30162> +proj=tmerc +lat_0=33 +lon_0=131 +k=0.9999 +x_0=0 +y_0=0 +ellps=bessel +towgs84=-146.414,507.337,680.507,0,0,0,0 +units=m +no_defs  <>
-# Tokyo / Japan Plane Rectangular CS III
-<epsg30163> +proj=tmerc +lat_0=36 +lon_0=132.1666666666667 +k=0.9999 +x_0=0 +y_0=0 +ellps=bessel +towgs84=-146.414,507.337,680.507,0,0,0,0 +units=m +no_defs  <>
-# Tokyo / Japan Plane Rectangular CS IV
-<epsg30164> +proj=tmerc +lat_0=33 +lon_0=133.5 +k=0.9999 +x_0=0 +y_0=0 +ellps=bessel +towgs84=-146.414,507.337,680.507,0,0,0,0 +units=m +no_defs  <>
-# Tokyo / Japan Plane Rectangular CS V
-<epsg30165> +proj=tmerc +lat_0=36 +lon_0=134.3333333333333 +k=0.9999 +x_0=0 +y_0=0 +ellps=bessel +towgs84=-146.414,507.337,680.507,0,0,0,0 +units=m +no_defs  <>
-# Tokyo / Japan Plane Rectangular CS VI
-<epsg30166> +proj=tmerc +lat_0=36 +lon_0=136 +k=0.9999 +x_0=0 +y_0=0 +ellps=bessel +towgs84=-146.414,507.337,680.507,0,0,0,0 +units=m +no_defs  <>
-# Tokyo / Japan Plane Rectangular CS VII
-<epsg30167> +proj=tmerc +lat_0=36 +lon_0=137.1666666666667 +k=0.9999 +x_0=0 +y_0=0 +ellps=bessel +towgs84=-146.414,507.337,680.507,0,0,0,0 +units=m +no_defs  <>
-# Tokyo / Japan Plane Rectangular CS VIII
-<epsg30168> +proj=tmerc +lat_0=36 +lon_0=138.5 +k=0.9999 +x_0=0 +y_0=0 +ellps=bessel +towgs84=-146.414,507.337,680.507,0,0,0,0 +units=m +no_defs  <>
-# Tokyo / Japan Plane Rectangular CS IX
-<epsg30169> +proj=tmerc +lat_0=36 +lon_0=139.8333333333333 +k=0.9999 +x_0=0 +y_0=0 +ellps=bessel +towgs84=-146.414,507.337,680.507,0,0,0,0 +units=m +no_defs  <>
-# Tokyo / Japan Plane Rectangular CS X
-<epsg30170> +proj=tmerc +lat_0=40 +lon_0=140.8333333333333 +k=0.9999 +x_0=0 +y_0=0 +ellps=bessel +towgs84=-146.414,507.337,680.507,0,0,0,0 +units=m +no_defs  <>
-# Tokyo / Japan Plane Rectangular CS XI
-<epsg30171> +proj=tmerc +lat_0=44 +lon_0=140.25 +k=0.9999 +x_0=0 +y_0=0 +ellps=bessel +towgs84=-146.414,507.337,680.507,0,0,0,0 +units=m +no_defs  <>
-# Tokyo / Japan Plane Rectangular CS XII
-<epsg30172> +proj=tmerc +lat_0=44 +lon_0=142.25 +k=0.9999 +x_0=0 +y_0=0 +ellps=bessel +towgs84=-146.414,507.337,680.507,0,0,0,0 +units=m +no_defs  <>
-# Tokyo / Japan Plane Rectangular CS XIII
-<epsg30173> +proj=tmerc +lat_0=44 +lon_0=144.25 +k=0.9999 +x_0=0 +y_0=0 +ellps=bessel +towgs84=-146.414,507.337,680.507,0,0,0,0 +units=m +no_defs  <>
-# Tokyo / Japan Plane Rectangular CS XIV
-<epsg30174> +proj=tmerc +lat_0=26 +lon_0=142 +k=0.9999 +x_0=0 +y_0=0 +ellps=bessel +towgs84=-146.414,507.337,680.507,0,0,0,0 +units=m +no_defs  <>
-# Tokyo / Japan Plane Rectangular CS XV
-<epsg30175> +proj=tmerc +lat_0=26 +lon_0=127.5 +k=0.9999 +x_0=0 +y_0=0 +ellps=bessel +towgs84=-146.414,507.337,680.507,0,0,0,0 +units=m +no_defs  <>
-# Tokyo / Japan Plane Rectangular CS XVI
-<epsg30176> +proj=tmerc +lat_0=26 +lon_0=124 +k=0.9999 +x_0=0 +y_0=0 +ellps=bessel +towgs84=-146.414,507.337,680.507,0,0,0,0 +units=m +no_defs  <>
-# Tokyo / Japan Plane Rectangular CS XVII
-<epsg30177> +proj=tmerc +lat_0=26 +lon_0=131 +k=0.9999 +x_0=0 +y_0=0 +ellps=bessel +towgs84=-146.414,507.337,680.507,0,0,0,0 +units=m +no_defs  <>
-# Tokyo / Japan Plane Rectangular CS XVIII
-<epsg30178> +proj=tmerc +lat_0=20 +lon_0=136 +k=0.9999 +x_0=0 +y_0=0 +ellps=bessel +towgs84=-146.414,507.337,680.507,0,0,0,0 +units=m +no_defs  <>
-# Tokyo / Japan Plane Rectangular CS XIX
-<epsg30179> +proj=tmerc +lat_0=26 +lon_0=154 +k=0.9999 +x_0=0 +y_0=0 +ellps=bessel +towgs84=-146.414,507.337,680.507,0,0,0,0 +units=m +no_defs  <>
-# Trinidad 1903 / Trinidad Grid
-<epsg30200> +proj=cass +lat_0=10.44166666666667 +lon_0=-61.33333333333334 +x_0=86501.46392051999 +y_0=65379.0134283 +a=6378293.645208759 +b=6356617.987679838 +towgs84=-61.702,284.488,472.052,0,0,0,0 +to_meter=0.201166195164 +no_defs  <>
-# TC(1948) / UTM zone 39N
-<epsg30339> +proj=utm +zone=39 +ellps=helmert +units=m +no_defs  <>
-# TC(1948) / UTM zone 40N
-<epsg30340> +proj=utm +zone=40 +ellps=helmert +units=m +no_defs  <>
-# Voirol 1875 / Nord Algerie (ancienne)
-<epsg30491> +proj=lcc +lat_1=36 +lat_0=36 +lon_0=2.7 +k_0=0.999625544 +x_0=500000 +y_0=300000 +a=6378249.2 +b=6356515 +towgs84=-73,-247,227,0,0,0,0 +units=m +no_defs  <>
-# Voirol 1875 / Sud Algerie (ancienne)
-<epsg30492> +proj=lcc +lat_1=33.3 +lat_0=33.3 +lon_0=2.7 +k_0=0.999625769 +x_0=500000 +y_0=300000 +a=6378249.2 +b=6356515 +towgs84=-73,-247,227,0,0,0,0 +units=m +no_defs  <>
-# Voirol 1879 / Nord Algerie (ancienne)
-<epsg30493> +proj=lcc +lat_1=36 +lat_0=36 +lon_0=2.7 +k_0=0.999625544 +x_0=500000 +y_0=300000 +a=6378249.2 +b=6356515 +units=m +no_defs  <>
-# Voirol 1879 / Sud Algerie (ancienne)
-<epsg30494> +proj=lcc +lat_1=33.3 +lat_0=33.3 +lon_0=2.7 +k_0=0.999625769 +x_0=500000 +y_0=300000 +a=6378249.2 +b=6356515 +units=m +no_defs  <>
-# Nord Sahara 1959 / UTM zone 29N
-<epsg30729> +proj=utm +zone=29 +ellps=clrk80 +towgs84=-186,-93,310,0,0,0,0 +units=m +no_defs  <>
-# Nord Sahara 1959 / UTM zone 30N
-<epsg30730> +proj=utm +zone=30 +ellps=clrk80 +towgs84=-186,-93,310,0,0,0,0 +units=m +no_defs  <>
-# Nord Sahara 1959 / UTM zone 31N
-<epsg30731> +proj=utm +zone=31 +ellps=clrk80 +towgs84=-186,-93,310,0,0,0,0 +units=m +no_defs  <>
-# Nord Sahara 1959 / UTM zone 32N
-<epsg30732> +proj=utm +zone=32 +ellps=clrk80 +towgs84=-186,-93,310,0,0,0,0 +units=m +no_defs  <>
-# Nord Sahara 1959 / Voirol Unifie Nord
-<epsg30791> +proj=lcc +lat_1=36 +lat_0=36 +lon_0=2.7 +k_0=0.999625544 +x_0=500135 +y_0=300090 +ellps=clrk80 +towgs84=-186,-93,310,0,0,0,0 +units=m +no_defs  <>
-# Nord Sahara 1959 / Voirol Unifie Sud
-<epsg30792> +proj=lcc +lat_1=33.3 +lat_0=33.3 +lon_0=2.7 +k_0=0.999625769 +x_0=500135 +y_0=300090 +ellps=clrk80 +towgs84=-186,-93,310,0,0,0,0 +units=m +no_defs  <>
-# RT38 2.5 gon W (deprecated)
-<epsg30800> +proj=tmerc +lat_0=0 +lon_0=15.80827777777778 +k=1 +x_0=1500000 +y_0=0 +ellps=bessel +units=m +no_defs  <>
-# Yoff / UTM zone 28N
-<epsg31028> +proj=utm +zone=28 +a=6378249.2 +b=6356515 +units=m +no_defs  <>
-# Zanderij / UTM zone 21N
-<epsg31121> +proj=utm +zone=21 +ellps=intl +towgs84=-265,120,-358,0,0,0,0 +units=m +no_defs  <>
-# Zanderij / TM 54 NW
-<epsg31154> +proj=tmerc +lat_0=0 +lon_0=-54 +k=0.9996 +x_0=500000 +y_0=0 +ellps=intl +towgs84=-265,120,-358,0,0,0,0 +units=m +no_defs  <>
-# Zanderij / Suriname Old TM
-<epsg31170> +proj=tmerc +lat_0=0 +lon_0=-55.68333333333333 +k=0.9996 +x_0=500000 +y_0=0 +ellps=intl +towgs84=-265,120,-358,0,0,0,0 +units=m +no_defs  <>
-# Zanderij / Suriname TM
-<epsg31171> +proj=tmerc +lat_0=0 +lon_0=-55.68333333333333 +k=0.9999 +x_0=500000 +y_0=0 +ellps=intl +towgs84=-265,120,-358,0,0,0,0 +units=m +no_defs  <>
-# MGI (Ferro) / Austria GK West Zone
-<epsg31251> +proj=tmerc +lat_0=0 +lon_0=28 +k=1 +x_0=0 +y_0=-5000000 +ellps=bessel +towgs84=682,-203,480,0,0,0,0 +pm=ferro +units=m +no_defs  <>
-# MGI (Ferro) / Austria GK Central Zone
-<epsg31252> +proj=tmerc +lat_0=0 +lon_0=31 +k=1 +x_0=0 +y_0=-5000000 +ellps=bessel +towgs84=682,-203,480,0,0,0,0 +pm=ferro +units=m +no_defs  <>
-# MGI (Ferro) / Austria GK East Zone
-<epsg31253> +proj=tmerc +lat_0=0 +lon_0=34 +k=1 +x_0=0 +y_0=-5000000 +ellps=bessel +towgs84=682,-203,480,0,0,0,0 +pm=ferro +units=m +no_defs  <>
-# MGI / Austria GK West
-<epsg31254> +proj=tmerc +lat_0=0 +lon_0=10.33333333333333 +k=1 +x_0=0 +y_0=-5000000 +datum=hermannskogel +units=m +no_defs  <>
-# MGI / Austria GK Central
-<epsg31255> +proj=tmerc +lat_0=0 +lon_0=13.33333333333333 +k=1 +x_0=0 +y_0=-5000000 +datum=hermannskogel +units=m +no_defs  <>
-# MGI / Austria GK East
-<epsg31256> +proj=tmerc +lat_0=0 +lon_0=16.33333333333333 +k=1 +x_0=0 +y_0=-5000000 +datum=hermannskogel +units=m +no_defs  <>
-# MGI / Austria GK M28
-<epsg31257> +proj=tmerc +lat_0=0 +lon_0=10.33333333333333 +k=1 +x_0=150000 +y_0=-5000000 +datum=hermannskogel +units=m +no_defs  <>
-# MGI / Austria GK M31
-<epsg31258> +proj=tmerc +lat_0=0 +lon_0=13.33333333333333 +k=1 +x_0=450000 +y_0=-5000000 +datum=hermannskogel +units=m +no_defs  <>
-# MGI / Austria GK M34
-<epsg31259> +proj=tmerc +lat_0=0 +lon_0=16.33333333333333 +k=1 +x_0=750000 +y_0=-5000000 +datum=hermannskogel +units=m +no_defs  <>
-# MGI / 3-degree Gauss zone 5 (deprecated)
-<epsg31265> +proj=tmerc +lat_0=0 +lon_0=15 +k=1 +x_0=5500000 +y_0=0 +datum=hermannskogel +units=m +no_defs  <>
-# MGI / 3-degree Gauss zone 6 (deprecated)
-<epsg31266> +proj=tmerc +lat_0=0 +lon_0=18 +k=1 +x_0=6500000 +y_0=0 +datum=hermannskogel +units=m +no_defs  <>
-# MGI / 3-degree Gauss zone 7 (deprecated)
-<epsg31267> +proj=tmerc +lat_0=0 +lon_0=21 +k=1 +x_0=7500000 +y_0=0 +datum=hermannskogel +units=m +no_defs  <>
-# MGI / 3-degree Gauss zone 8 (deprecated)
-<epsg31268> +proj=tmerc +lat_0=0 +lon_0=24 +k=1 +x_0=8500000 +y_0=0 +datum=hermannskogel +units=m +no_defs  <>
-# MGI / Balkans zone 5 (deprecated)
-<epsg31275> +proj=tmerc +lat_0=0 +lon_0=15 +k=0.9999 +x_0=5500000 +y_0=0 +datum=hermannskogel +units=m +no_defs  <>
-# MGI / Balkans zone 6 (deprecated)
-<epsg31276> +proj=tmerc +lat_0=0 +lon_0=18 +k=0.9999 +x_0=6500000 +y_0=0 +datum=hermannskogel +units=m +no_defs  <>
-# MGI / Balkans zone 7 (deprecated)
-<epsg31277> +proj=tmerc +lat_0=0 +lon_0=21 +k=0.9999 +x_0=7500000 +y_0=0 +datum=hermannskogel +units=m +no_defs  <>
-# MGI / Balkans zone 8 (deprecated)
-<epsg31278> +proj=tmerc +lat_0=0 +lon_0=21 +k=0.9999 +x_0=7500000 +y_0=0 +datum=hermannskogel +units=m +no_defs  <>
-# MGI / Balkans zone 8 (deprecated)
-<epsg31279> +proj=tmerc +lat_0=0 +lon_0=24 +k=0.9999 +x_0=8500000 +y_0=0 +datum=hermannskogel +units=m +no_defs  <>
-# MGI (Ferro) / Austria West Zone
-<epsg31281> +proj=tmerc +lat_0=0 +lon_0=28 +k=1 +x_0=0 +y_0=0 +ellps=bessel +towgs84=682,-203,480,0,0,0,0 +pm=ferro +units=m +no_defs  <>
-# MGI (Ferro) / Austria Central Zone
-<epsg31282> +proj=tmerc +lat_0=0 +lon_0=31 +k=1 +x_0=0 +y_0=0 +ellps=bessel +towgs84=682,-203,480,0,0,0,0 +pm=ferro +units=m +no_defs  <>
-# MGI (Ferro) / Austria East Zone
-<epsg31283> +proj=tmerc +lat_0=0 +lon_0=34 +k=1 +x_0=0 +y_0=0 +ellps=bessel +towgs84=682,-203,480,0,0,0,0 +pm=ferro +units=m +no_defs  <>
-# MGI / Austria M28
-<epsg31284> +proj=tmerc +lat_0=0 +lon_0=10.33333333333333 +k=1 +x_0=150000 +y_0=0 +datum=hermannskogel +units=m +no_defs  <>
-# MGI / Austria M31
-<epsg31285> +proj=tmerc +lat_0=0 +lon_0=13.33333333333333 +k=1 +x_0=450000 +y_0=0 +datum=hermannskogel +units=m +no_defs  <>
-# MGI / Austria M34
-<epsg31286> +proj=tmerc +lat_0=0 +lon_0=16.33333333333333 +k=1 +x_0=750000 +y_0=0 +datum=hermannskogel +units=m +no_defs  <>
-# MGI / Austria Lambert
-<epsg31287> +proj=lcc +lat_1=49 +lat_2=46 +lat_0=47.5 +lon_0=13.33333333333333 +x_0=400000 +y_0=400000 +datum=hermannskogel +units=m +no_defs  <>
-# MGI (Ferro) / M28
-<epsg31288> +proj=tmerc +lat_0=0 +lon_0=28 +k=1 +x_0=150000 +y_0=0 +ellps=bessel +towgs84=682,-203,480,0,0,0,0 +pm=ferro +units=m +no_defs  <>
-# MGI (Ferro) / M31
-<epsg31289> +proj=tmerc +lat_0=0 +lon_0=31 +k=1 +x_0=450000 +y_0=0 +ellps=bessel +towgs84=682,-203,480,0,0,0,0 +pm=ferro +units=m +no_defs  <>
-# MGI (Ferro) / M34
-<epsg31290> +proj=tmerc +lat_0=0 +lon_0=34 +k=1 +x_0=750000 +y_0=0 +ellps=bessel +towgs84=682,-203,480,0,0,0,0 +pm=ferro +units=m +no_defs  <>
-# MGI (Ferro) / Austria West Zone (deprecated)
-<epsg31291> +proj=tmerc +lat_0=0 +lon_0=28 +k=1 +x_0=0 +y_0=0 +ellps=bessel +towgs84=682,-203,480,0,0,0,0 +pm=ferro +units=m +no_defs  <>
-# MGI (Ferro) / Austria Central Zone (deprecated)
-<epsg31292> +proj=tmerc +lat_0=0 +lon_0=31 +k=1 +x_0=0 +y_0=0 +ellps=bessel +towgs84=682,-203,480,0,0,0,0 +pm=ferro +units=m +no_defs  <>
-# MGI (Ferro) / Austria East Zone (deprecated)
-<epsg31293> +proj=tmerc +lat_0=0 +lon_0=34 +k=1 +x_0=0 +y_0=0 +ellps=bessel +towgs84=682,-203,480,0,0,0,0 +pm=ferro +units=m +no_defs  <>
-# MGI / M28 (deprecated)
-<epsg31294> +proj=tmerc +lat_0=0 +lon_0=10.33333333333333 +k=1 +x_0=150000 +y_0=0 +datum=hermannskogel +units=m +no_defs  <>
-# MGI / M31 (deprecated)
-<epsg31295> +proj=tmerc +lat_0=0 +lon_0=13.33333333333333 +k=1 +x_0=450000 +y_0=0 +datum=hermannskogel +units=m +no_defs  <>
-# MGI / M34 (deprecated)
-<epsg31296> +proj=tmerc +lat_0=0 +lon_0=16.33333333333333 +k=1 +x_0=750000 +y_0=0 +datum=hermannskogel +units=m +no_defs  <>
-# MGI / Austria Lambert (deprecated)
-<epsg31297> +proj=lcc +lat_1=49 +lat_2=46 +lat_0=47.5 +lon_0=13.33333333333333 +x_0=400000 +y_0=400000 +datum=hermannskogel +units=m +no_defs  <>
-# Belge 1972 / Belge Lambert 72
-<epsg31300> +proj=lcc +lat_1=49.83333333333334 +lat_2=51.16666666666666 +lat_0=90 +lon_0=4.356939722222222 +x_0=150000.01256 +y_0=5400088.4378 +ellps=intl +towgs84=-106.869,52.2978,-103.724,0.3366,-0.457,1.8422,-1.2747 +units=m +no_defs  <>
-# Belge 1972 / Belgian Lambert 72
-<epsg31370> +proj=lcc +lat_1=51.16666723333333 +lat_2=49.8333339 +lat_0=90 +lon_0=4.367486666666666 +x_0=150000.013 +y_0=5400088.438 +ellps=intl +towgs84=-106.869,52.2978,-103.724,0.3366,-0.457,1.8422,-1.2747 +units=m +no_defs  <>
-# DHDN / 3-degree Gauss zone 1 (deprecated)
-<epsg31461> +proj=tmerc +lat_0=0 +lon_0=3 +k=1 +x_0=1500000 +y_0=0 +datum=potsdam +units=m +no_defs  <>
-# DHDN / 3-degree Gauss zone 2 (deprecated)
-<epsg31462> +proj=tmerc +lat_0=0 +lon_0=6 +k=1 +x_0=2500000 +y_0=0 +datum=potsdam +units=m +no_defs  <>
-# DHDN / 3-degree Gauss zone 3 (deprecated)
-<epsg31463> +proj=tmerc +lat_0=0 +lon_0=9 +k=1 +x_0=3500000 +y_0=0 +datum=potsdam +units=m +no_defs  <>
-# DHDN / 3-degree Gauss zone 4 (deprecated)
-<epsg31464> +proj=tmerc +lat_0=0 +lon_0=12 +k=1 +x_0=4500000 +y_0=0 +datum=potsdam +units=m +no_defs  <>
-# DHDN / 3-degree Gauss zone 5 (deprecated)
-<epsg31465> +proj=tmerc +lat_0=0 +lon_0=15 +k=1 +x_0=5500000 +y_0=0 +datum=potsdam +units=m +no_defs  <>
-# DHDN / 3-degree Gauss-Kruger zone 2
-<epsg31466> +proj=tmerc +lat_0=0 +lon_0=6 +k=1 +x_0=2500000 +y_0=0 +datum=potsdam +units=m +no_defs  <>
-# DHDN / 3-degree Gauss-Kruger zone 3
-<epsg31467> +proj=tmerc +lat_0=0 +lon_0=9 +k=1 +x_0=3500000 +y_0=0 +datum=potsdam +units=m +no_defs  <>
-# DHDN / 3-degree Gauss-Kruger zone 4
-<epsg31468> +proj=tmerc +lat_0=0 +lon_0=12 +k=1 +x_0=4500000 +y_0=0 +datum=potsdam +units=m +no_defs  <>
-# DHDN / 3-degree Gauss-Kruger zone 5
-<epsg31469> +proj=tmerc +lat_0=0 +lon_0=15 +k=1 +x_0=5500000 +y_0=0 +datum=potsdam +units=m +no_defs  <>
-# Conakry 1905 / UTM zone 28N
-<epsg31528> +proj=utm +zone=28 +a=6378249.2 +b=6356515 +towgs84=-23,259,-9,0,0,0,0 +units=m +no_defs  <>
-# Conakry 1905 / UTM zone 29N
-<epsg31529> +proj=utm +zone=29 +a=6378249.2 +b=6356515 +towgs84=-23,259,-9,0,0,0,0 +units=m +no_defs  <>
-# Dealul Piscului 1930 / Stereo 33
-<epsg31600> +proj=sterea +lat_0=45.9 +lon_0=25.39246588888889 +k=0.9996667 +x_0=500000 +y_0=500000 +ellps=intl +towgs84=103.25,-100.4,-307.19,0,0,0,0 +units=m +no_defs  <>
-# Dealul Piscului 1970/ Stereo 70 (deprecated)
-<epsg31700> +proj=sterea +lat_0=46 +lon_0=25 +k=0.99975 +x_0=500000 +y_0=500000 +ellps=krass +towgs84=28,-121,-77,0,0,0,0 +units=m +no_defs  <>
-# NGN / UTM zone 38N
-<epsg31838> +proj=utm +zone=38 +ellps=WGS84 +towgs84=-3.2,-5.7,2.8,0,0,0,0 +units=m +no_defs  <>
-# NGN / UTM zone 39N
-<epsg31839> +proj=utm +zone=39 +ellps=WGS84 +towgs84=-3.2,-5.7,2.8,0,0,0,0 +units=m +no_defs  <>
-# KUDAMS / KTM (deprecated)
-<epsg31900> +proj=tmerc +lat_0=0 +lon_0=48 +k=0.9996 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=-20.8,11.3,2.4,0,0,0,0 +units=m +no_defs  <>
-# KUDAMS / KTM
-<epsg31901> +proj=tmerc +lat_0=0 +lon_0=48 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=-20.8,11.3,2.4,0,0,0,0 +units=m +no_defs  <>
-# SIRGAS 2000 / UTM zone 11N
-<epsg31965> +proj=utm +zone=11 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# SIRGAS 2000 / UTM zone 12N
-<epsg31966> +proj=utm +zone=12 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# SIRGAS 2000 / UTM zone 13N
-<epsg31967> +proj=utm +zone=13 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# SIRGAS 2000 / UTM zone 14N
-<epsg31968> +proj=utm +zone=14 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# SIRGAS 2000 / UTM zone 15N
-<epsg31969> +proj=utm +zone=15 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# SIRGAS 2000 / UTM zone 16N
-<epsg31970> +proj=utm +zone=16 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# SIRGAS 2000 / UTM zone 17N
-<epsg31971> +proj=utm +zone=17 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# SIRGAS 2000 / UTM zone 18N
-<epsg31972> +proj=utm +zone=18 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# SIRGAS 2000 / UTM zone 19N
-<epsg31973> +proj=utm +zone=19 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# SIRGAS 2000 / UTM zone 20N
-<epsg31974> +proj=utm +zone=20 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# SIRGAS 2000 / UTM zone 21N
-<epsg31975> +proj=utm +zone=21 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# SIRGAS 2000 / UTM zone 22N
-<epsg31976> +proj=utm +zone=22 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# SIRGAS 2000 / UTM zone 17S
-<epsg31977> +proj=utm +zone=17 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# SIRGAS 2000 / UTM zone 18S
-<epsg31978> +proj=utm +zone=18 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# SIRGAS 2000 / UTM zone 19S
-<epsg31979> +proj=utm +zone=19 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# SIRGAS 2000 / UTM zone 20S
-<epsg31980> +proj=utm +zone=20 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# SIRGAS 2000 / UTM zone 21S
-<epsg31981> +proj=utm +zone=21 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# SIRGAS 2000 / UTM zone 22S
-<epsg31982> +proj=utm +zone=22 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# SIRGAS 2000 / UTM zone 23S
-<epsg31983> +proj=utm +zone=23 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# SIRGAS 2000 / UTM zone 24S
-<epsg31984> +proj=utm +zone=24 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# SIRGAS 2000 / UTM zone 25S
-<epsg31985> +proj=utm +zone=25 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# SIRGAS 1995 / UTM zone 17N
-<epsg31986> +proj=utm +zone=17 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# SIRGAS 1995 / UTM zone 18N
-<epsg31987> +proj=utm +zone=18 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# SIRGAS 1995 / UTM zone 19N
-<epsg31988> +proj=utm +zone=19 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# SIRGAS 1995 / UTM zone 20N
-<epsg31989> +proj=utm +zone=20 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# SIRGAS 1995 / UTM zone 21N
-<epsg31990> +proj=utm +zone=21 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# SIRGAS 1995 / UTM zone 22N
-<epsg31991> +proj=utm +zone=22 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# SIRGAS 1995 / UTM zone 17S
-<epsg31992> +proj=utm +zone=17 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# SIRGAS 1995 / UTM zone 18S
-<epsg31993> +proj=utm +zone=18 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# SIRGAS 1995 / UTM zone 19S
-<epsg31994> +proj=utm +zone=19 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# SIRGAS 1995 / UTM zone 20S
-<epsg31995> +proj=utm +zone=20 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# SIRGAS 1995 / UTM zone 21S
-<epsg31996> +proj=utm +zone=21 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# SIRGAS 1995 / UTM zone 22S
-<epsg31997> +proj=utm +zone=22 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# SIRGAS 1995 / UTM zone 23S
-<epsg31998> +proj=utm +zone=23 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# SIRGAS 1995 / UTM zone 24S
-<epsg31999> +proj=utm +zone=24 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# SIRGAS 1995 / UTM zone 25S
-<epsg32000> +proj=utm +zone=25 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>
-# NAD27 / Montana North
-<epsg32001> +proj=lcc +lat_1=48.71666666666667 +lat_2=47.85 +lat_0=47 +lon_0=-109.5 +x_0=609601.2192024384 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / Montana Central
-<epsg32002> +proj=lcc +lat_1=47.88333333333333 +lat_2=46.45 +lat_0=45.83333333333334 +lon_0=-109.5 +x_0=609601.2192024384 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / Montana South
-<epsg32003> +proj=lcc +lat_1=46.4 +lat_2=44.86666666666667 +lat_0=44 +lon_0=-109.5 +x_0=609601.2192024384 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / Nebraska North
-<epsg32005> +proj=lcc +lat_1=41.85 +lat_2=42.81666666666667 +lat_0=41.33333333333334 +lon_0=-100 +x_0=609601.2192024384 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / Nebraska South
-<epsg32006> +proj=lcc +lat_1=40.28333333333333 +lat_2=41.71666666666667 +lat_0=39.66666666666666 +lon_0=-99.5 +x_0=609601.2192024384 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / Nevada East
-<epsg32007> +proj=tmerc +lat_0=34.75 +lon_0=-115.5833333333333 +k=0.9999 +x_0=152400.3048006096 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / Nevada Central
-<epsg32008> +proj=tmerc +lat_0=34.75 +lon_0=-116.6666666666667 +k=0.9999 +x_0=152400.3048006096 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / Nevada West
-<epsg32009> +proj=tmerc +lat_0=34.75 +lon_0=-118.5833333333333 +k=0.9999 +x_0=152400.3048006096 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / New Hampshire
-<epsg32010> +proj=tmerc +lat_0=42.5 +lon_0=-71.66666666666667 +k=0.999966667 +x_0=152400.3048006096 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / New Jersey
-<epsg32011> +proj=tmerc +lat_0=38.83333333333334 +lon_0=-74.66666666666667 +k=0.9999749999999999 +x_0=609601.2192024384 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / New Mexico East
-<epsg32012> +proj=tmerc +lat_0=31 +lon_0=-104.3333333333333 +k=0.999909091 +x_0=152400.3048006096 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / New Mexico Central
-<epsg32013> +proj=tmerc +lat_0=31 +lon_0=-106.25 +k=0.9999 +x_0=152400.3048006096 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / New Mexico West
-<epsg32014> +proj=tmerc +lat_0=31 +lon_0=-107.8333333333333 +k=0.999916667 +x_0=152400.3048006096 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / New York East
-<epsg32015> +proj=tmerc +lat_0=40 +lon_0=-74.33333333333333 +k=0.999966667 +x_0=152400.3048006096 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / New York Central
-<epsg32016> +proj=tmerc +lat_0=40 +lon_0=-76.58333333333333 +k=0.9999375 +x_0=152400.3048006096 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / New York West
-<epsg32017> +proj=tmerc +lat_0=40 +lon_0=-78.58333333333333 +k=0.9999375 +x_0=152400.3048006096 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / New York Long Island (deprecated)
-<epsg32018> +proj=lcc +lat_1=41.03333333333333 +lat_2=40.66666666666666 +lat_0=40.5 +lon_0=-74 +x_0=304800.6096012192 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / North Carolina
-<epsg32019> +proj=lcc +lat_1=34.33333333333334 +lat_2=36.16666666666666 +lat_0=33.75 +lon_0=-79 +x_0=609601.2192024384 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / North Dakota North
-<epsg32020> +proj=lcc +lat_1=47.43333333333333 +lat_2=48.73333333333333 +lat_0=47 +lon_0=-100.5 +x_0=609601.2192024384 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / North Dakota South
-<epsg32021> +proj=lcc +lat_1=46.18333333333333 +lat_2=47.48333333333333 +lat_0=45.66666666666666 +lon_0=-100.5 +x_0=609601.2192024384 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / Ohio North
-<epsg32022> +proj=lcc +lat_1=40.43333333333333 +lat_2=41.7 +lat_0=39.66666666666666 +lon_0=-82.5 +x_0=609601.2192024384 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / Ohio South
-<epsg32023> +proj=lcc +lat_1=38.73333333333333 +lat_2=40.03333333333333 +lat_0=38 +lon_0=-82.5 +x_0=609601.2192024384 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / Oklahoma North
-<epsg32024> +proj=lcc +lat_1=35.56666666666667 +lat_2=36.76666666666667 +lat_0=35 +lon_0=-98 +x_0=609601.2192024384 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / Oklahoma South
-<epsg32025> +proj=lcc +lat_1=33.93333333333333 +lat_2=35.23333333333333 +lat_0=33.33333333333334 +lon_0=-98 +x_0=609601.2192024384 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / Oregon North
-<epsg32026> +proj=lcc +lat_1=44.33333333333334 +lat_2=46 +lat_0=43.66666666666666 +lon_0=-120.5 +x_0=609601.2192024384 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / Oregon South
-<epsg32027> +proj=lcc +lat_1=42.33333333333334 +lat_2=44 +lat_0=41.66666666666666 +lon_0=-120.5 +x_0=609601.2192024384 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / Pennsylvania North
-<epsg32028> +proj=lcc +lat_1=40.88333333333333 +lat_2=41.95 +lat_0=40.16666666666666 +lon_0=-77.75 +x_0=609601.2192024384 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / Pennsylvania South (deprecated)
-<epsg32029> +proj=lcc +lat_1=39.93333333333333 +lat_2=40.8 +lat_0=39.33333333333334 +lon_0=-77.75 +x_0=609601.2192024384 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / Rhode Island
-<epsg32030> +proj=tmerc +lat_0=41.08333333333334 +lon_0=-71.5 +k=0.9999938 +x_0=152400.3048006096 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / South Carolina North
-<epsg32031> +proj=lcc +lat_1=33.76666666666667 +lat_2=34.96666666666667 +lat_0=33 +lon_0=-81 +x_0=609601.2192024384 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / South Carolina South
-<epsg32033> +proj=lcc +lat_1=32.33333333333334 +lat_2=33.66666666666666 +lat_0=31.83333333333333 +lon_0=-81 +x_0=609601.2192024384 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / South Dakota North
-<epsg32034> +proj=lcc +lat_1=44.41666666666666 +lat_2=45.68333333333333 +lat_0=43.83333333333334 +lon_0=-100 +x_0=609601.2192024384 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / South Dakota South
-<epsg32035> +proj=lcc +lat_1=42.83333333333334 +lat_2=44.4 +lat_0=42.33333333333334 +lon_0=-100.3333333333333 +x_0=609601.2192024384 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / Tennessee (deprecated)
-<epsg32036> +proj=lcc +lat_1=35.25 +lat_2=36.41666666666666 +lat_0=34.66666666666666 +lon_0=-86 +x_0=30480.06096012192 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / Texas North
-<epsg32037> +proj=lcc +lat_1=34.65 +lat_2=36.18333333333333 +lat_0=34 +lon_0=-101.5 +x_0=609601.2192024384 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / Texas North Central
-<epsg32038> +proj=lcc +lat_1=32.13333333333333 +lat_2=33.96666666666667 +lat_0=31.66666666666667 +lon_0=-97.5 +x_0=609601.2192024384 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / Texas Central
-<epsg32039> +proj=lcc +lat_1=30.11666666666667 +lat_2=31.88333333333333 +lat_0=29.66666666666667 +lon_0=-100.3333333333333 +x_0=609601.2192024384 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / Texas South Central
-<epsg32040> +proj=lcc +lat_1=28.38333333333333 +lat_2=30.28333333333333 +lat_0=27.83333333333333 +lon_0=-99 +x_0=609601.2192024384 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / Texas South
-<epsg32041> +proj=lcc +lat_1=26.16666666666667 +lat_2=27.83333333333333 +lat_0=25.66666666666667 +lon_0=-98.5 +x_0=609601.2192024384 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / Utah North
-<epsg32042> +proj=lcc +lat_1=40.71666666666667 +lat_2=41.78333333333333 +lat_0=40.33333333333334 +lon_0=-111.5 +x_0=609601.2192024384 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / Utah Central
-<epsg32043> +proj=lcc +lat_1=39.01666666666667 +lat_2=40.65 +lat_0=38.33333333333334 +lon_0=-111.5 +x_0=609601.2192024384 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / Utah South
-<epsg32044> +proj=lcc +lat_1=37.21666666666667 +lat_2=38.35 +lat_0=36.66666666666666 +lon_0=-111.5 +x_0=609601.2192024384 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / Vermont
-<epsg32045> +proj=tmerc +lat_0=42.5 +lon_0=-72.5 +k=0.999964286 +x_0=152400.3048006096 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / Virginia North
-<epsg32046> +proj=lcc +lat_1=38.03333333333333 +lat_2=39.2 +lat_0=37.66666666666666 +lon_0=-78.5 +x_0=609601.2192024384 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / Virginia South
-<epsg32047> +proj=lcc +lat_1=36.76666666666667 +lat_2=37.96666666666667 +lat_0=36.33333333333334 +lon_0=-78.5 +x_0=609601.2192024384 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / Washington North
-<epsg32048> +proj=lcc +lat_1=47.5 +lat_2=48.73333333333333 +lat_0=47 +lon_0=-120.8333333333333 +x_0=609601.2192024384 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / Washington South
-<epsg32049> +proj=lcc +lat_1=45.83333333333334 +lat_2=47.33333333333334 +lat_0=45.33333333333334 +lon_0=-120.5 +x_0=609601.2192024384 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / West Virginia North
-<epsg32050> +proj=lcc +lat_1=39 +lat_2=40.25 +lat_0=38.5 +lon_0=-79.5 +x_0=609601.2192024384 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / West Virginia South
-<epsg32051> +proj=lcc +lat_1=37.48333333333333 +lat_2=38.88333333333333 +lat_0=37 +lon_0=-81 +x_0=609601.2192024384 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / Wisconsin North
-<epsg32052> +proj=lcc +lat_1=45.56666666666667 +lat_2=46.76666666666667 +lat_0=45.16666666666666 +lon_0=-90 +x_0=609601.2192024384 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / Wisconsin Central
-<epsg32053> +proj=lcc +lat_1=44.25 +lat_2=45.5 +lat_0=43.83333333333334 +lon_0=-90 +x_0=609601.2192024384 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / Wisconsin South
-<epsg32054> +proj=lcc +lat_1=42.73333333333333 +lat_2=44.06666666666667 +lat_0=42 +lon_0=-90 +x_0=609601.2192024384 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / Wyoming East
-<epsg32055> +proj=tmerc +lat_0=40.66666666666666 +lon_0=-105.1666666666667 +k=0.999941177 +x_0=152400.3048006096 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / Wyoming East Central
-<epsg32056> +proj=tmerc +lat_0=40.66666666666666 +lon_0=-107.3333333333333 +k=0.999941177 +x_0=152400.3048006096 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / Wyoming West Central
-<epsg32057> +proj=tmerc +lat_0=40.66666666666666 +lon_0=-108.75 +k=0.999941177 +x_0=152400.3048006096 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / Wyoming West
-<epsg32058> +proj=tmerc +lat_0=40.66666666666666 +lon_0=-110.0833333333333 +k=0.999941177 +x_0=152400.3048006096 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / Guatemala Norte (deprecated)
-<epsg32061> +proj=lcc +lat_1=16.81666666666667 +lat_0=16.81666666666667 +lon_0=-90.33333333333333 +k_0=0.99992226 +x_0=500000 +y_0=292209.579 +datum=NAD27 +units=m +no_defs  <>
-# NAD27 / Guatemala Sur (deprecated)
-<epsg32062> +proj=lcc +lat_1=14.9 +lat_0=14.9 +lon_0=-90.33333333333333 +k_0=0.99989906 +x_0=500000 +y_0=325992.681 +datum=NAD27 +units=m +no_defs  <>
-# NAD27 / BLM 14N (ftUS)
-<epsg32064> +proj=tmerc +lat_0=0 +lon_0=-99 +k=0.9996 +x_0=500000.001016002 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / BLM 15N (ftUS)
-<epsg32065> +proj=tmerc +lat_0=0 +lon_0=-93 +k=0.9996 +x_0=500000.001016002 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / BLM 16N (ftUS)
-<epsg32066> +proj=tmerc +lat_0=0 +lon_0=-87 +k=0.9996 +x_0=500000.001016002 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / BLM 17N (ftUS)
-<epsg32067> +proj=tmerc +lat_0=0 +lon_0=-81 +k=0.9996 +x_0=500000.001016002 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / BLM 14N (feet) (deprecated)
-<epsg32074> +proj=tmerc +lat_0=0 +lon_0=-99 +k=0.9996 +x_0=500000.001016002 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / BLM 15N (feet) (deprecated)
-<epsg32075> +proj=tmerc +lat_0=0 +lon_0=-93 +k=0.9996 +x_0=500000.001016002 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / BLM 16N (feet) (deprecated)
-<epsg32076> +proj=tmerc +lat_0=0 +lon_0=-87 +k=0.9996 +x_0=500000.001016002 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / BLM 17N (feet) (deprecated)
-<epsg32077> +proj=tmerc +lat_0=0 +lon_0=-81 +k=0.9996 +x_0=500000.001016002 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD27 / MTM zone 1
-<epsg32081> +proj=tmerc +lat_0=0 +lon_0=-53 +k=0.9999 +x_0=304800 +y_0=0 +datum=NAD27 +units=m +no_defs  <>
-# NAD27 / MTM zone 2
-<epsg32082> +proj=tmerc +lat_0=0 +lon_0=-56 +k=0.9999 +x_0=304800 +y_0=0 +datum=NAD27 +units=m +no_defs  <>
-# NAD27 / MTM zone 3
-<epsg32083> +proj=tmerc +lat_0=0 +lon_0=-58.5 +k=0.9999 +x_0=304800 +y_0=0 +datum=NAD27 +units=m +no_defs  <>
-# NAD27 / MTM zone 4
-<epsg32084> +proj=tmerc +lat_0=0 +lon_0=-61.5 +k=0.9999 +x_0=304800 +y_0=0 +datum=NAD27 +units=m +no_defs  <>
-# NAD27 / MTM zone 5
-<epsg32085> +proj=tmerc +lat_0=0 +lon_0=-64.5 +k=0.9999 +x_0=304800 +y_0=0 +datum=NAD27 +units=m +no_defs  <>
-# NAD27 / MTM zone 6
-<epsg32086> +proj=tmerc +lat_0=0 +lon_0=-67.5 +k=0.9999 +x_0=304800 +y_0=0 +datum=NAD27 +units=m +no_defs  <>
-# NAD27 / Quebec Lambert
-<epsg32098> +proj=lcc +lat_1=60 +lat_2=46 +lat_0=44 +lon_0=-68.5 +x_0=0 +y_0=0 +datum=NAD27 +units=m +no_defs  <>
-# NAD27 / Louisiana Offshore
-<epsg32099> +proj=lcc +lat_1=27.83333333333333 +lat_2=26.16666666666667 +lat_0=25.66666666666667 +lon_0=-91.33333333333333 +x_0=609601.2192024384 +y_0=0 +datum=NAD27 +units=us-ft +no_defs  <>
-# NAD83 / Montana
-<epsg32100> +proj=lcc +lat_1=49 +lat_2=45 +lat_0=44.25 +lon_0=-109.5 +x_0=600000 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / Nebraska
-<epsg32104> +proj=lcc +lat_1=43 +lat_2=40 +lat_0=39.83333333333334 +lon_0=-100 +x_0=500000 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / Nevada East
-<epsg32107> +proj=tmerc +lat_0=34.75 +lon_0=-115.5833333333333 +k=0.9999 +x_0=200000 +y_0=8000000 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / Nevada Central
-<epsg32108> +proj=tmerc +lat_0=34.75 +lon_0=-116.6666666666667 +k=0.9999 +x_0=500000 +y_0=6000000 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / Nevada West
-<epsg32109> +proj=tmerc +lat_0=34.75 +lon_0=-118.5833333333333 +k=0.9999 +x_0=800000 +y_0=4000000 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / New Hampshire
-<epsg32110> +proj=tmerc +lat_0=42.5 +lon_0=-71.66666666666667 +k=0.999966667 +x_0=300000 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / New Jersey
-<epsg32111> +proj=tmerc +lat_0=38.83333333333334 +lon_0=-74.5 +k=0.9999 +x_0=150000 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / New Mexico East
-<epsg32112> +proj=tmerc +lat_0=31 +lon_0=-104.3333333333333 +k=0.999909091 +x_0=165000 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / New Mexico Central
-<epsg32113> +proj=tmerc +lat_0=31 +lon_0=-106.25 +k=0.9999 +x_0=500000 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / New Mexico West
-<epsg32114> +proj=tmerc +lat_0=31 +lon_0=-107.8333333333333 +k=0.999916667 +x_0=830000 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / New York East
-<epsg32115> +proj=tmerc +lat_0=38.83333333333334 +lon_0=-74.5 +k=0.9999 +x_0=150000 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / New York Central
-<epsg32116> +proj=tmerc +lat_0=40 +lon_0=-76.58333333333333 +k=0.9999375 +x_0=250000 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / New York West
-<epsg32117> +proj=tmerc +lat_0=40 +lon_0=-78.58333333333333 +k=0.9999375 +x_0=350000 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / New York Long Island
-<epsg32118> +proj=lcc +lat_1=41.03333333333333 +lat_2=40.66666666666666 +lat_0=40.16666666666666 +lon_0=-74 +x_0=300000 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / North Carolina
-<epsg32119> +proj=lcc +lat_1=36.16666666666666 +lat_2=34.33333333333334 +lat_0=33.75 +lon_0=-79 +x_0=609601.22 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / North Dakota North
-<epsg32120> +proj=lcc +lat_1=48.73333333333333 +lat_2=47.43333333333333 +lat_0=47 +lon_0=-100.5 +x_0=600000 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / North Dakota South
-<epsg32121> +proj=lcc +lat_1=47.48333333333333 +lat_2=46.18333333333333 +lat_0=45.66666666666666 +lon_0=-100.5 +x_0=600000 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / Ohio North
-<epsg32122> +proj=lcc +lat_1=41.7 +lat_2=40.43333333333333 +lat_0=39.66666666666666 +lon_0=-82.5 +x_0=600000 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / Ohio South
-<epsg32123> +proj=lcc +lat_1=40.03333333333333 +lat_2=38.73333333333333 +lat_0=38 +lon_0=-82.5 +x_0=600000 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / Oklahoma North
-<epsg32124> +proj=lcc +lat_1=36.76666666666667 +lat_2=35.56666666666667 +lat_0=35 +lon_0=-98 +x_0=600000 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / Oklahoma South
-<epsg32125> +proj=lcc +lat_1=35.23333333333333 +lat_2=33.93333333333333 +lat_0=33.33333333333334 +lon_0=-98 +x_0=600000 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / Oregon North
-<epsg32126> +proj=lcc +lat_1=46 +lat_2=44.33333333333334 +lat_0=43.66666666666666 +lon_0=-120.5 +x_0=2500000 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / Oregon South
-<epsg32127> +proj=lcc +lat_1=44 +lat_2=42.33333333333334 +lat_0=41.66666666666666 +lon_0=-120.5 +x_0=1500000 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / Pennsylvania North
-<epsg32128> +proj=lcc +lat_1=41.95 +lat_2=40.88333333333333 +lat_0=40.16666666666666 +lon_0=-77.75 +x_0=600000 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / Pennsylvania South
-<epsg32129> +proj=lcc +lat_1=40.96666666666667 +lat_2=39.93333333333333 +lat_0=39.33333333333334 +lon_0=-77.75 +x_0=600000 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / Rhode Island
-<epsg32130> +proj=tmerc +lat_0=41.08333333333334 +lon_0=-71.5 +k=0.99999375 +x_0=100000 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / South Carolina
-<epsg32133> +proj=lcc +lat_1=34.83333333333334 +lat_2=32.5 +lat_0=31.83333333333333 +lon_0=-81 +x_0=609600 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / South Dakota North
-<epsg32134> +proj=lcc +lat_1=45.68333333333333 +lat_2=44.41666666666666 +lat_0=43.83333333333334 +lon_0=-100 +x_0=600000 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / South Dakota South
-<epsg32135> +proj=lcc +lat_1=44.4 +lat_2=42.83333333333334 +lat_0=42.33333333333334 +lon_0=-100.3333333333333 +x_0=600000 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / Tennessee
-<epsg32136> +proj=lcc +lat_1=36.41666666666666 +lat_2=35.25 +lat_0=34.33333333333334 +lon_0=-86 +x_0=600000 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / Texas North
-<epsg32137> +proj=lcc +lat_1=36.18333333333333 +lat_2=34.65 +lat_0=34 +lon_0=-101.5 +x_0=200000 +y_0=1000000 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / Texas North Central
-<epsg32138> +proj=lcc +lat_1=33.96666666666667 +lat_2=32.13333333333333 +lat_0=31.66666666666667 +lon_0=-98.5 +x_0=600000 +y_0=2000000 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / Texas Central
-<epsg32139> +proj=lcc +lat_1=31.88333333333333 +lat_2=30.11666666666667 +lat_0=29.66666666666667 +lon_0=-100.3333333333333 +x_0=700000 +y_0=3000000 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / Texas South Central
-<epsg32140> +proj=lcc +lat_1=30.28333333333333 +lat_2=28.38333333333333 +lat_0=27.83333333333333 +lon_0=-99 +x_0=600000 +y_0=4000000 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / Texas South
-<epsg32141> +proj=lcc +lat_1=27.83333333333333 +lat_2=26.16666666666667 +lat_0=25.66666666666667 +lon_0=-98.5 +x_0=300000 +y_0=5000000 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / Utah North
-<epsg32142> +proj=lcc +lat_1=41.78333333333333 +lat_2=40.71666666666667 +lat_0=40.33333333333334 +lon_0=-111.5 +x_0=500000 +y_0=1000000 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / Utah Central
-<epsg32143> +proj=lcc +lat_1=40.65 +lat_2=39.01666666666667 +lat_0=38.33333333333334 +lon_0=-111.5 +x_0=500000 +y_0=2000000 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / Utah South
-<epsg32144> +proj=lcc +lat_1=38.35 +lat_2=37.21666666666667 +lat_0=36.66666666666666 +lon_0=-111.5 +x_0=500000 +y_0=3000000 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / Vermont
-<epsg32145> +proj=tmerc +lat_0=42.5 +lon_0=-72.5 +k=0.999964286 +x_0=500000 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / Virginia North
-<epsg32146> +proj=lcc +lat_1=39.2 +lat_2=38.03333333333333 +lat_0=37.66666666666666 +lon_0=-78.5 +x_0=3500000 +y_0=2000000 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / Virginia South
-<epsg32147> +proj=lcc +lat_1=37.96666666666667 +lat_2=36.76666666666667 +lat_0=36.33333333333334 +lon_0=-78.5 +x_0=3500000 +y_0=1000000 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / Washington North
-<epsg32148> +proj=lcc +lat_1=48.73333333333333 +lat_2=47.5 +lat_0=47 +lon_0=-120.8333333333333 +x_0=500000 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / Washington South
-<epsg32149> +proj=lcc +lat_1=47.33333333333334 +lat_2=45.83333333333334 +lat_0=45.33333333333334 +lon_0=-120.5 +x_0=500000 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / West Virginia North
-<epsg32150> +proj=lcc +lat_1=40.25 +lat_2=39 +lat_0=38.5 +lon_0=-79.5 +x_0=600000 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / West Virginia South
-<epsg32151> +proj=lcc +lat_1=38.88333333333333 +lat_2=37.48333333333333 +lat_0=37 +lon_0=-81 +x_0=600000 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / Wisconsin North
-<epsg32152> +proj=lcc +lat_1=46.76666666666667 +lat_2=45.56666666666667 +lat_0=45.16666666666666 +lon_0=-90 +x_0=600000 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / Wisconsin Central
-<epsg32153> +proj=lcc +lat_1=45.5 +lat_2=44.25 +lat_0=43.83333333333334 +lon_0=-90 +x_0=600000 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / Wisconsin South
-<epsg32154> +proj=lcc +lat_1=44.06666666666667 +lat_2=42.73333333333333 +lat_0=42 +lon_0=-90 +x_0=600000 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / Wyoming East
-<epsg32155> +proj=tmerc +lat_0=40.5 +lon_0=-105.1666666666667 +k=0.9999375 +x_0=200000 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / Wyoming East Central
-<epsg32156> +proj=tmerc +lat_0=40.5 +lon_0=-107.3333333333333 +k=0.9999375 +x_0=400000 +y_0=100000 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / Wyoming West Central
-<epsg32157> +proj=tmerc +lat_0=40.5 +lon_0=-108.75 +k=0.9999375 +x_0=600000 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / Wyoming West
-<epsg32158> +proj=tmerc +lat_0=40.5 +lon_0=-110.0833333333333 +k=0.9999375 +x_0=800000 +y_0=100000 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / Puerto Rico & Virgin Is.
-<epsg32161> +proj=lcc +lat_1=18.43333333333333 +lat_2=18.03333333333333 +lat_0=17.83333333333333 +lon_0=-66.43333333333334 +x_0=200000 +y_0=200000 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / BLM 14N (ftUS)
-<epsg32164> +proj=tmerc +lat_0=0 +lon_0=-99 +k=0.9996 +x_0=500000.001016002 +y_0=0 +datum=NAD83 +units=us-ft +no_defs  <>
-# NAD83 / BLM 15N (ftUS)
-<epsg32165> +proj=tmerc +lat_0=0 +lon_0=-93 +k=0.9996 +x_0=500000.001016002 +y_0=0 +datum=NAD83 +units=us-ft +no_defs  <>
-# NAD83 / BLM 16N (ftUS)
-<epsg32166> +proj=tmerc +lat_0=0 +lon_0=-87 +k=0.9996 +x_0=500000.001016002 +y_0=0 +datum=NAD83 +units=us-ft +no_defs  <>
-# NAD83 / BLM 17N (ftUS)
-<epsg32167> +proj=tmerc +lat_0=0 +lon_0=-81 +k=0.9996 +x_0=500000.001016002 +y_0=0 +datum=NAD83 +units=us-ft +no_defs  <>
-# NAD83 / SCoPQ zone 2 (deprecated)
-<epsg32180> +proj=tmerc +lat_0=0 +lon_0=-55.5 +k=0.9999 +x_0=304800 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / MTM zone 1
-<epsg32181> +proj=tmerc +lat_0=0 +lon_0=-53 +k=0.9999 +x_0=304800 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / MTM zone 2
-<epsg32182> +proj=tmerc +lat_0=0 +lon_0=-56 +k=0.9999 +x_0=304800 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / MTM zone 3
-<epsg32183> +proj=tmerc +lat_0=0 +lon_0=-58.5 +k=0.9999 +x_0=304800 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / MTM zone 4
-<epsg32184> +proj=tmerc +lat_0=0 +lon_0=-61.5 +k=0.9999 +x_0=304800 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / MTM zone 5
-<epsg32185> +proj=tmerc +lat_0=0 +lon_0=-64.5 +k=0.9999 +x_0=304800 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / MTM zone 6
-<epsg32186> +proj=tmerc +lat_0=0 +lon_0=-67.5 +k=0.9999 +x_0=304800 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / MTM zone 7
-<epsg32187> +proj=tmerc +lat_0=0 +lon_0=-70.5 +k=0.9999 +x_0=304800 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / MTM zone 8
-<epsg32188> +proj=tmerc +lat_0=0 +lon_0=-73.5 +k=0.9999 +x_0=304800 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / MTM zone 9
-<epsg32189> +proj=tmerc +lat_0=0 +lon_0=-76.5 +k=0.9999 +x_0=304800 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / MTM zone 10
-<epsg32190> +proj=tmerc +lat_0=0 +lon_0=-79.5 +k=0.9999 +x_0=304800 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / MTM zone 11
-<epsg32191> +proj=tmerc +lat_0=0 +lon_0=-82.5 +k=0.9999 +x_0=304800 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / MTM zone 12
-<epsg32192> +proj=tmerc +lat_0=0 +lon_0=-81 +k=0.9999 +x_0=304800 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / MTM zone 13
-<epsg32193> +proj=tmerc +lat_0=0 +lon_0=-84 +k=0.9999 +x_0=304800 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / MTM zone 14
-<epsg32194> +proj=tmerc +lat_0=0 +lon_0=-87 +k=0.9999 +x_0=304800 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / MTM zone 15
-<epsg32195> +proj=tmerc +lat_0=0 +lon_0=-90 +k=0.9999 +x_0=304800 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / MTM zone 16
-<epsg32196> +proj=tmerc +lat_0=0 +lon_0=-93 +k=0.9999 +x_0=304800 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / MTM zone 17
-<epsg32197> +proj=tmerc +lat_0=0 +lon_0=-96 +k=0.9999 +x_0=304800 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / Quebec Lambert
-<epsg32198> +proj=lcc +lat_1=60 +lat_2=46 +lat_0=44 +lon_0=-68.5 +x_0=0 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# NAD83 / Louisiana Offshore
-<epsg32199> +proj=lcc +lat_1=27.83333333333333 +lat_2=26.16666666666667 +lat_0=25.5 +lon_0=-91.33333333333333 +x_0=1000000 +y_0=0 +datum=NAD83 +units=m +no_defs  <>
-# WGS 72 / UTM zone 1N
-<epsg32201> +proj=utm +zone=1 +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# WGS 72 / UTM zone 2N
-<epsg32202> +proj=utm +zone=2 +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# WGS 72 / UTM zone 3N
-<epsg32203> +proj=utm +zone=3 +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# WGS 72 / UTM zone 4N
-<epsg32204> +proj=utm +zone=4 +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# WGS 72 / UTM zone 5N
-<epsg32205> +proj=utm +zone=5 +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# WGS 72 / UTM zone 6N
-<epsg32206> +proj=utm +zone=6 +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# WGS 72 / UTM zone 7N
-<epsg32207> +proj=utm +zone=7 +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# WGS 72 / UTM zone 8N
-<epsg32208> +proj=utm +zone=8 +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# WGS 72 / UTM zone 9N
-<epsg32209> +proj=utm +zone=9 +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# WGS 72 / UTM zone 10N
-<epsg32210> +proj=utm +zone=10 +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# WGS 72 / UTM zone 11N
-<epsg32211> +proj=utm +zone=11 +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# WGS 72 / UTM zone 12N
-<epsg32212> +proj=utm +zone=12 +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# WGS 72 / UTM zone 13N
-<epsg32213> +proj=utm +zone=13 +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# WGS 72 / UTM zone 14N
-<epsg32214> +proj=utm +zone=14 +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# WGS 72 / UTM zone 15N
-<epsg32215> +proj=utm +zone=15 +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# WGS 72 / UTM zone 16N
-<epsg32216> +proj=utm +zone=16 +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# WGS 72 / UTM zone 17N
-<epsg32217> +proj=utm +zone=17 +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# WGS 72 / UTM zone 18N
-<epsg32218> +proj=utm +zone=18 +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# WGS 72 / UTM zone 19N
-<epsg32219> +proj=utm +zone=19 +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# WGS 72 / UTM zone 20N
-<epsg32220> +proj=utm +zone=20 +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# WGS 72 / UTM zone 21N
-<epsg32221> +proj=utm +zone=21 +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# WGS 72 / UTM zone 22N
-<epsg32222> +proj=utm +zone=22 +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# WGS 72 / UTM zone 23N
-<epsg32223> +proj=utm +zone=23 +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# WGS 72 / UTM zone 24N
-<epsg32224> +proj=utm +zone=24 +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# WGS 72 / UTM zone 25N
-<epsg32225> +proj=utm +zone=25 +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# WGS 72 / UTM zone 26N
-<epsg32226> +proj=utm +zone=26 +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# WGS 72 / UTM zone 27N
-<epsg32227> +proj=utm +zone=27 +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# WGS 72 / UTM zone 28N
-<epsg32228> +proj=utm +zone=28 +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# WGS 72 / UTM zone 29N
-<epsg32229> +proj=utm +zone=29 +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# WGS 72 / UTM zone 30N
-<epsg32230> +proj=utm +zone=30 +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# WGS 72 / UTM zone 31N
-<epsg32231> +proj=utm +zone=31 +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# WGS 72 / UTM zone 32N
-<epsg32232> +proj=utm +zone=32 +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# WGS 72 / UTM zone 33N
-<epsg32233> +proj=utm +zone=33 +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# WGS 72 / UTM zone 34N
-<epsg32234> +proj=utm +zone=34 +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# WGS 72 / UTM zone 35N
-<epsg32235> +proj=utm +zone=35 +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# WGS 72 / UTM zone 36N
-<epsg32236> +proj=utm +zone=36 +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# WGS 72 / UTM zone 37N
-<epsg32237> +proj=utm +zone=37 +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# WGS 72 / UTM zone 38N
-<epsg32238> +proj=utm +zone=38 +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# WGS 72 / UTM zone 39N
-<epsg32239> +proj=utm +zone=39 +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# WGS 72 / UTM zone 40N
-<epsg32240> +proj=utm +zone=40 +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# WGS 72 / UTM zone 41N
-<epsg32241> +proj=utm +zone=41 +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# WGS 72 / UTM zone 42N
-<epsg32242> +proj=utm +zone=42 +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# WGS 72 / UTM zone 43N
-<epsg32243> +proj=utm +zone=43 +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# WGS 72 / UTM zone 44N
-<epsg32244> +proj=utm +zone=44 +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# WGS 72 / UTM zone 45N
-<epsg32245> +proj=utm +zone=45 +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# WGS 72 / UTM zone 46N
-<epsg32246> +proj=utm +zone=46 +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# WGS 72 / UTM zone 47N
-<epsg32247> +proj=utm +zone=47 +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# WGS 72 / UTM zone 48N
-<epsg32248> +proj=utm +zone=48 +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# WGS 72 / UTM zone 49N
-<epsg32249> +proj=utm +zone=49 +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# WGS 72 / UTM zone 50N
-<epsg32250> +proj=utm +zone=50 +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# WGS 72 / UTM zone 51N
-<epsg32251> +proj=utm +zone=51 +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# WGS 72 / UTM zone 52N
-<epsg32252> +proj=utm +zone=52 +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# WGS 72 / UTM zone 53N
-<epsg32253> +proj=utm +zone=53 +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# WGS 72 / UTM zone 54N
-<epsg32254> +proj=utm +zone=54 +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# WGS 72 / UTM zone 55N
-<epsg32255> +proj=utm +zone=55 +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# WGS 72 / UTM zone 56N
-<epsg32256> +proj=utm +zone=56 +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# WGS 72 / UTM zone 57N
-<epsg32257> +proj=utm +zone=57 +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# WGS 72 / UTM zone 58N
-<epsg32258> +proj=utm +zone=58 +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# WGS 72 / UTM zone 59N
-<epsg32259> +proj=utm +zone=59 +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# WGS 72 / UTM zone 60N
-<epsg32260> +proj=utm +zone=60 +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# WGS 72 / UTM zone 1S
-<epsg32301> +proj=utm +zone=1 +south +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# WGS 72 / UTM zone 2S
-<epsg32302> +proj=utm +zone=2 +south +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# WGS 72 / UTM zone 3S
-<epsg32303> +proj=utm +zone=3 +south +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# WGS 72 / UTM zone 4S
-<epsg32304> +proj=utm +zone=4 +south +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# WGS 72 / UTM zone 5S
-<epsg32305> +proj=utm +zone=5 +south +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# WGS 72 / UTM zone 6S
-<epsg32306> +proj=utm +zone=6 +south +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# WGS 72 / UTM zone 7S
-<epsg32307> +proj=utm +zone=7 +south +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# WGS 72 / UTM zone 8S
-<epsg32308> +proj=utm +zone=8 +south +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# WGS 72 / UTM zone 9S
-<epsg32309> +proj=utm +zone=9 +south +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# WGS 72 / UTM zone 10S
-<epsg32310> +proj=utm +zone=10 +south +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# WGS 72 / UTM zone 11S
-<epsg32311> +proj=utm +zone=11 +south +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# WGS 72 / UTM zone 12S
-<epsg32312> +proj=utm +zone=12 +south +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# WGS 72 / UTM zone 13S
-<epsg32313> +proj=utm +zone=13 +south +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# WGS 72 / UTM zone 14S
-<epsg32314> +proj=utm +zone=14 +south +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# WGS 72 / UTM zone 15S
-<epsg32315> +proj=utm +zone=15 +south +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# WGS 72 / UTM zone 16S
-<epsg32316> +proj=utm +zone=16 +south +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# WGS 72 / UTM zone 17S
-<epsg32317> +proj=utm +zone=17 +south +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# WGS 72 / UTM zone 18S
-<epsg32318> +proj=utm +zone=18 +south +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# WGS 72 / UTM zone 19S
-<epsg32319> +proj=utm +zone=19 +south +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# WGS 72 / UTM zone 20S
-<epsg32320> +proj=utm +zone=20 +south +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# WGS 72 / UTM zone 21S
-<epsg32321> +proj=utm +zone=21 +south +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# WGS 72 / UTM zone 22S
-<epsg32322> +proj=utm +zone=22 +south +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# WGS 72 / UTM zone 23S
-<epsg32323> +proj=utm +zone=23 +south +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# WGS 72 / UTM zone 24S
-<epsg32324> +proj=utm +zone=24 +south +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# WGS 72 / UTM zone 25S
-<epsg32325> +proj=utm +zone=25 +south +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# WGS 72 / UTM zone 26S
-<epsg32326> +proj=utm +zone=26 +south +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# WGS 72 / UTM zone 27S
-<epsg32327> +proj=utm +zone=27 +south +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# WGS 72 / UTM zone 28S
-<epsg32328> +proj=utm +zone=28 +south +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# WGS 72 / UTM zone 29S
-<epsg32329> +proj=utm +zone=29 +south +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# WGS 72 / UTM zone 30S
-<epsg32330> +proj=utm +zone=30 +south +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# WGS 72 / UTM zone 31S
-<epsg32331> +proj=utm +zone=31 +south +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# WGS 72 / UTM zone 32S
-<epsg32332> +proj=utm +zone=32 +south +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# WGS 72 / UTM zone 33S
-<epsg32333> +proj=utm +zone=33 +south +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# WGS 72 / UTM zone 34S
-<epsg32334> +proj=utm +zone=34 +south +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# WGS 72 / UTM zone 35S
-<epsg32335> +proj=utm +zone=35 +south +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# WGS 72 / UTM zone 36S
-<epsg32336> +proj=utm +zone=36 +south +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# WGS 72 / UTM zone 37S
-<epsg32337> +proj=utm +zone=37 +south +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# WGS 72 / UTM zone 38S
-<epsg32338> +proj=utm +zone=38 +south +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# WGS 72 / UTM zone 39S
-<epsg32339> +proj=utm +zone=39 +south +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# WGS 72 / UTM zone 40S
-<epsg32340> +proj=utm +zone=40 +south +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# WGS 72 / UTM zone 41S
-<epsg32341> +proj=utm +zone=41 +south +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# WGS 72 / UTM zone 42S
-<epsg32342> +proj=utm +zone=42 +south +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# WGS 72 / UTM zone 43S
-<epsg32343> +proj=utm +zone=43 +south +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# WGS 72 / UTM zone 44S
-<epsg32344> +proj=utm +zone=44 +south +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# WGS 72 / UTM zone 45S
-<epsg32345> +proj=utm +zone=45 +south +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# WGS 72 / UTM zone 46S
-<epsg32346> +proj=utm +zone=46 +south +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# WGS 72 / UTM zone 47S
-<epsg32347> +proj=utm +zone=47 +south +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# WGS 72 / UTM zone 48S
-<epsg32348> +proj=utm +zone=48 +south +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# WGS 72 / UTM zone 49S
-<epsg32349> +proj=utm +zone=49 +south +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# WGS 72 / UTM zone 50S
-<epsg32350> +proj=utm +zone=50 +south +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# WGS 72 / UTM zone 51S
-<epsg32351> +proj=utm +zone=51 +south +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# WGS 72 / UTM zone 52S
-<epsg32352> +proj=utm +zone=52 +south +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# WGS 72 / UTM zone 53S
-<epsg32353> +proj=utm +zone=53 +south +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# WGS 72 / UTM zone 54S
-<epsg32354> +proj=utm +zone=54 +south +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# WGS 72 / UTM zone 55S
-<epsg32355> +proj=utm +zone=55 +south +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# WGS 72 / UTM zone 56S
-<epsg32356> +proj=utm +zone=56 +south +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# WGS 72 / UTM zone 57S
-<epsg32357> +proj=utm +zone=57 +south +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# WGS 72 / UTM zone 58S
-<epsg32358> +proj=utm +zone=58 +south +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# WGS 72 / UTM zone 59S
-<epsg32359> +proj=utm +zone=59 +south +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# WGS 72 / UTM zone 60S
-<epsg32360> +proj=utm +zone=60 +south +ellps=WGS72 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs  <>
-# WGS 72BE / UTM zone 1N
-<epsg32401> +proj=utm +zone=1 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# WGS 72BE / UTM zone 2N
-<epsg32402> +proj=utm +zone=2 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# WGS 72BE / UTM zone 3N
-<epsg32403> +proj=utm +zone=3 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# WGS 72BE / UTM zone 4N
-<epsg32404> +proj=utm +zone=4 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# WGS 72BE / UTM zone 5N
-<epsg32405> +proj=utm +zone=5 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# WGS 72BE / UTM zone 6N
-<epsg32406> +proj=utm +zone=6 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# WGS 72BE / UTM zone 7N
-<epsg32407> +proj=utm +zone=7 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# WGS 72BE / UTM zone 8N
-<epsg32408> +proj=utm +zone=8 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# WGS 72BE / UTM zone 9N
-<epsg32409> +proj=utm +zone=9 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# WGS 72BE / UTM zone 10N
-<epsg32410> +proj=utm +zone=10 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# WGS 72BE / UTM zone 11N
-<epsg32411> +proj=utm +zone=11 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# WGS 72BE / UTM zone 12N
-<epsg32412> +proj=utm +zone=12 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# WGS 72BE / UTM zone 13N
-<epsg32413> +proj=utm +zone=13 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# WGS 72BE / UTM zone 14N
-<epsg32414> +proj=utm +zone=14 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# WGS 72BE / UTM zone 15N
-<epsg32415> +proj=utm +zone=15 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# WGS 72BE / UTM zone 16N
-<epsg32416> +proj=utm +zone=16 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# WGS 72BE / UTM zone 17N
-<epsg32417> +proj=utm +zone=17 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# WGS 72BE / UTM zone 18N
-<epsg32418> +proj=utm +zone=18 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# WGS 72BE / UTM zone 19N
-<epsg32419> +proj=utm +zone=19 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# WGS 72BE / UTM zone 20N
-<epsg32420> +proj=utm +zone=20 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# WGS 72BE / UTM zone 21N
-<epsg32421> +proj=utm +zone=21 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# WGS 72BE / UTM zone 22N
-<epsg32422> +proj=utm +zone=22 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# WGS 72BE / UTM zone 23N
-<epsg32423> +proj=utm +zone=23 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# WGS 72BE / UTM zone 24N
-<epsg32424> +proj=utm +zone=24 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# WGS 72BE / UTM zone 25N
-<epsg32425> +proj=utm +zone=25 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# WGS 72BE / UTM zone 26N
-<epsg32426> +proj=utm +zone=26 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# WGS 72BE / UTM zone 27N
-<epsg32427> +proj=utm +zone=27 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# WGS 72BE / UTM zone 28N
-<epsg32428> +proj=utm +zone=28 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# WGS 72BE / UTM zone 29N
-<epsg32429> +proj=utm +zone=29 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# WGS 72BE / UTM zone 30N
-<epsg32430> +proj=utm +zone=30 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# WGS 72BE / UTM zone 31N
-<epsg32431> +proj=utm +zone=31 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# WGS 72BE / UTM zone 32N
-<epsg32432> +proj=utm +zone=32 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# WGS 72BE / UTM zone 33N
-<epsg32433> +proj=utm +zone=33 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# WGS 72BE / UTM zone 34N
-<epsg32434> +proj=utm +zone=34 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# WGS 72BE / UTM zone 35N
-<epsg32435> +proj=utm +zone=35 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# WGS 72BE / UTM zone 36N
-<epsg32436> +proj=utm +zone=36 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# WGS 72BE / UTM zone 37N
-<epsg32437> +proj=utm +zone=37 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# WGS 72BE / UTM zone 38N
-<epsg32438> +proj=utm +zone=38 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# WGS 72BE / UTM zone 39N
-<epsg32439> +proj=utm +zone=39 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# WGS 72BE / UTM zone 40N
-<epsg32440> +proj=utm +zone=40 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# WGS 72BE / UTM zone 41N
-<epsg32441> +proj=utm +zone=41 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# WGS 72BE / UTM zone 42N
-<epsg32442> +proj=utm +zone=42 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# WGS 72BE / UTM zone 43N
-<epsg32443> +proj=utm +zone=43 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# WGS 72BE / UTM zone 44N
-<epsg32444> +proj=utm +zone=44 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# WGS 72BE / UTM zone 45N
-<epsg32445> +proj=utm +zone=45 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# WGS 72BE / UTM zone 46N
-<epsg32446> +proj=utm +zone=46 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# WGS 72BE / UTM zone 47N
-<epsg32447> +proj=utm +zone=47 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# WGS 72BE / UTM zone 48N
-<epsg32448> +proj=utm +zone=48 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# WGS 72BE / UTM zone 49N
-<epsg32449> +proj=utm +zone=49 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# WGS 72BE / UTM zone 50N
-<epsg32450> +proj=utm +zone=50 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# WGS 72BE / UTM zone 51N
-<epsg32451> +proj=utm +zone=51 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# WGS 72BE / UTM zone 52N
-<epsg32452> +proj=utm +zone=52 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# WGS 72BE / UTM zone 53N
-<epsg32453> +proj=utm +zone=53 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# WGS 72BE / UTM zone 54N
-<epsg32454> +proj=utm +zone=54 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# WGS 72BE / UTM zone 55N
-<epsg32455> +proj=utm +zone=55 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# WGS 72BE / UTM zone 56N
-<epsg32456> +proj=utm +zone=56 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# WGS 72BE / UTM zone 57N
-<epsg32457> +proj=utm +zone=57 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# WGS 72BE / UTM zone 58N
-<epsg32458> +proj=utm +zone=58 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# WGS 72BE / UTM zone 59N
-<epsg32459> +proj=utm +zone=59 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# WGS 72BE / UTM zone 60N
-<epsg32460> +proj=utm +zone=60 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# WGS 72BE / UTM zone 1S
-<epsg32501> +proj=utm +zone=1 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# WGS 72BE / UTM zone 2S
-<epsg32502> +proj=utm +zone=2 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# WGS 72BE / UTM zone 3S
-<epsg32503> +proj=utm +zone=3 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# WGS 72BE / UTM zone 4S
-<epsg32504> +proj=utm +zone=4 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# WGS 72BE / UTM zone 5S
-<epsg32505> +proj=utm +zone=5 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# WGS 72BE / UTM zone 6S
-<epsg32506> +proj=utm +zone=6 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# WGS 72BE / UTM zone 7S
-<epsg32507> +proj=utm +zone=7 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# WGS 72BE / UTM zone 8S
-<epsg32508> +proj=utm +zone=8 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# WGS 72BE / UTM zone 9S
-<epsg32509> +proj=utm +zone=9 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# WGS 72BE / UTM zone 10S
-<epsg32510> +proj=utm +zone=10 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# WGS 72BE / UTM zone 11S
-<epsg32511> +proj=utm +zone=11 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# WGS 72BE / UTM zone 12S
-<epsg32512> +proj=utm +zone=12 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# WGS 72BE / UTM zone 13S
-<epsg32513> +proj=utm +zone=13 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# WGS 72BE / UTM zone 14S
-<epsg32514> +proj=utm +zone=14 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# WGS 72BE / UTM zone 15S
-<epsg32515> +proj=utm +zone=15 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# WGS 72BE / UTM zone 16S
-<epsg32516> +proj=utm +zone=16 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# WGS 72BE / UTM zone 17S
-<epsg32517> +proj=utm +zone=17 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# WGS 72BE / UTM zone 18S
-<epsg32518> +proj=utm +zone=18 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# WGS 72BE / UTM zone 19S
-<epsg32519> +proj=utm +zone=19 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# WGS 72BE / UTM zone 20S
-<epsg32520> +proj=utm +zone=20 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# WGS 72BE / UTM zone 21S
-<epsg32521> +proj=utm +zone=21 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# WGS 72BE / UTM zone 22S
-<epsg32522> +proj=utm +zone=22 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# WGS 72BE / UTM zone 23S
-<epsg32523> +proj=utm +zone=23 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# WGS 72BE / UTM zone 24S
-<epsg32524> +proj=utm +zone=24 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# WGS 72BE / UTM zone 25S
-<epsg32525> +proj=utm +zone=25 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# WGS 72BE / UTM zone 26S
-<epsg32526> +proj=utm +zone=26 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# WGS 72BE / UTM zone 27S
-<epsg32527> +proj=utm +zone=27 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# WGS 72BE / UTM zone 28S
-<epsg32528> +proj=utm +zone=28 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# WGS 72BE / UTM zone 29S
-<epsg32529> +proj=utm +zone=29 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# WGS 72BE / UTM zone 30S
-<epsg32530> +proj=utm +zone=30 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# WGS 72BE / UTM zone 31S
-<epsg32531> +proj=utm +zone=31 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# WGS 72BE / UTM zone 32S
-<epsg32532> +proj=utm +zone=32 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# WGS 72BE / UTM zone 33S
-<epsg32533> +proj=utm +zone=33 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# WGS 72BE / UTM zone 34S
-<epsg32534> +proj=utm +zone=34 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# WGS 72BE / UTM zone 35S
-<epsg32535> +proj=utm +zone=35 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# WGS 72BE / UTM zone 36S
-<epsg32536> +proj=utm +zone=36 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# WGS 72BE / UTM zone 37S
-<epsg32537> +proj=utm +zone=37 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# WGS 72BE / UTM zone 38S
-<epsg32538> +proj=utm +zone=38 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# WGS 72BE / UTM zone 39S
-<epsg32539> +proj=utm +zone=39 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# WGS 72BE / UTM zone 40S
-<epsg32540> +proj=utm +zone=40 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# WGS 72BE / UTM zone 41S
-<epsg32541> +proj=utm +zone=41 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# WGS 72BE / UTM zone 42S
-<epsg32542> +proj=utm +zone=42 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# WGS 72BE / UTM zone 43S
-<epsg32543> +proj=utm +zone=43 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# WGS 72BE / UTM zone 44S
-<epsg32544> +proj=utm +zone=44 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# WGS 72BE / UTM zone 45S
-<epsg32545> +proj=utm +zone=45 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# WGS 72BE / UTM zone 46S
-<epsg32546> +proj=utm +zone=46 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# WGS 72BE / UTM zone 47S
-<epsg32547> +proj=utm +zone=47 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# WGS 72BE / UTM zone 48S
-<epsg32548> +proj=utm +zone=48 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# WGS 72BE / UTM zone 49S
-<epsg32549> +proj=utm +zone=49 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# WGS 72BE / UTM zone 50S
-<epsg32550> +proj=utm +zone=50 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# WGS 72BE / UTM zone 51S
-<epsg32551> +proj=utm +zone=51 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# WGS 72BE / UTM zone 52S
-<epsg32552> +proj=utm +zone=52 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# WGS 72BE / UTM zone 53S
-<epsg32553> +proj=utm +zone=53 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# WGS 72BE / UTM zone 54S
-<epsg32554> +proj=utm +zone=54 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# WGS 72BE / UTM zone 55S
-<epsg32555> +proj=utm +zone=55 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# WGS 72BE / UTM zone 56S
-<epsg32556> +proj=utm +zone=56 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# WGS 72BE / UTM zone 57S
-<epsg32557> +proj=utm +zone=57 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# WGS 72BE / UTM zone 58S
-<epsg32558> +proj=utm +zone=58 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# WGS 72BE / UTM zone 59S
-<epsg32559> +proj=utm +zone=59 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# WGS 72BE / UTM zone 60S
-<epsg32560> +proj=utm +zone=60 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  <>
-# WGS 84 / UTM grid system (northern hemisphere)
-# Unable to translate coordinate system EPSG:32600 into PROJ.4 format.
-#
-# WGS 84 / UTM zone 1N
-<epsg32601> +proj=utm +zone=1 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UTM zone 2N
-<epsg32602> +proj=utm +zone=2 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UTM zone 3N
-<epsg32603> +proj=utm +zone=3 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UTM zone 4N
-<epsg32604> +proj=utm +zone=4 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UTM zone 5N
-<epsg32605> +proj=utm +zone=5 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UTM zone 6N
-<epsg32606> +proj=utm +zone=6 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UTM zone 7N
-<epsg32607> +proj=utm +zone=7 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UTM zone 8N
-<epsg32608> +proj=utm +zone=8 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UTM zone 9N
-<epsg32609> +proj=utm +zone=9 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UTM zone 10N
-<epsg32610> +proj=utm +zone=10 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UTM zone 11N
-<epsg32611> +proj=utm +zone=11 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UTM zone 12N
-<epsg32612> +proj=utm +zone=12 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UTM zone 13N
-<epsg32613> +proj=utm +zone=13 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UTM zone 14N
-<epsg32614> +proj=utm +zone=14 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UTM zone 15N
-<epsg32615> +proj=utm +zone=15 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UTM zone 16N
-<epsg32616> +proj=utm +zone=16 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UTM zone 17N
-<epsg32617> +proj=utm +zone=17 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UTM zone 18N
-<epsg32618> +proj=utm +zone=18 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UTM zone 19N
-<epsg32619> +proj=utm +zone=19 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UTM zone 20N
-<epsg32620> +proj=utm +zone=20 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UTM zone 21N
-<epsg32621> +proj=utm +zone=21 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UTM zone 22N
-<epsg32622> +proj=utm +zone=22 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UTM zone 23N
-<epsg32623> +proj=utm +zone=23 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UTM zone 24N
-<epsg32624> +proj=utm +zone=24 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UTM zone 25N
-<epsg32625> +proj=utm +zone=25 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UTM zone 26N
-<epsg32626> +proj=utm +zone=26 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UTM zone 27N
-<epsg32627> +proj=utm +zone=27 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UTM zone 28N
-<epsg32628> +proj=utm +zone=28 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UTM zone 29N
-<epsg32629> +proj=utm +zone=29 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UTM zone 30N
-<epsg32630> +proj=utm +zone=30 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UTM zone 31N
-<epsg32631> +proj=utm +zone=31 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UTM zone 32N
-<epsg32632> +proj=utm +zone=32 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UTM zone 33N
-<epsg32633> +proj=utm +zone=33 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UTM zone 34N
-<epsg32634> +proj=utm +zone=34 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UTM zone 35N
-<epsg32635> +proj=utm +zone=35 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UTM zone 36N
-<epsg32636> +proj=utm +zone=36 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UTM zone 37N
-<epsg32637> +proj=utm +zone=37 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UTM zone 38N
-<epsg32638> +proj=utm +zone=38 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UTM zone 39N
-<epsg32639> +proj=utm +zone=39 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UTM zone 40N
-<epsg32640> +proj=utm +zone=40 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UTM zone 41N
-<epsg32641> +proj=utm +zone=41 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UTM zone 42N
-<epsg32642> +proj=utm +zone=42 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UTM zone 43N
-<epsg32643> +proj=utm +zone=43 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UTM zone 44N
-<epsg32644> +proj=utm +zone=44 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UTM zone 45N
-<epsg32645> +proj=utm +zone=45 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UTM zone 46N
-<epsg32646> +proj=utm +zone=46 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UTM zone 47N
-<epsg32647> +proj=utm +zone=47 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UTM zone 48N
-<epsg32648> +proj=utm +zone=48 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UTM zone 49N
-<epsg32649> +proj=utm +zone=49 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UTM zone 50N
-<epsg32650> +proj=utm +zone=50 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UTM zone 51N
-<epsg32651> +proj=utm +zone=51 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UTM zone 52N
-<epsg32652> +proj=utm +zone=52 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UTM zone 53N
-<epsg32653> +proj=utm +zone=53 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UTM zone 54N
-<epsg32654> +proj=utm +zone=54 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UTM zone 55N
-<epsg32655> +proj=utm +zone=55 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UTM zone 56N
-<epsg32656> +proj=utm +zone=56 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UTM zone 57N
-<epsg32657> +proj=utm +zone=57 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UTM zone 58N
-<epsg32658> +proj=utm +zone=58 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UTM zone 59N
-<epsg32659> +proj=utm +zone=59 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UTM zone 60N
-<epsg32660> +proj=utm +zone=60 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UPS North (N,E)
-<epsg32661> +proj=stere +lat_0=90 +lat_ts=90 +lon_0=0 +k=0.994 +x_0=2000000 +y_0=2000000 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / Plate Carree (deprecated)
-<epsg32662> +proj=eqc +lat_ts=0 +lat_0=0 +lon_0=0 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / World Equidistant Cylindrical (deprecated)
-# Unable to translate coordinate system EPSG:32663 into PROJ.4 format.
-#
-# WGS 84 / BLM 14N (ftUS)
-<epsg32664> +proj=tmerc +lat_0=0 +lon_0=-99 +k=0.9996 +x_0=500000.001016002 +y_0=0 +datum=WGS84 +units=us-ft +no_defs  <>
-# WGS 84 / BLM 15N (ftUS)
-<epsg32665> +proj=tmerc +lat_0=0 +lon_0=-93 +k=0.9996 +x_0=500000.001016002 +y_0=0 +datum=WGS84 +units=us-ft +no_defs  <>
-# WGS 84 / BLM 16N (ftUS)
-<epsg32666> +proj=tmerc +lat_0=0 +lon_0=-87 +k=0.9996 +x_0=500000.001016002 +y_0=0 +datum=WGS84 +units=us-ft +no_defs  <>
-# WGS 84 / BLM 17N (ftUS)
-<epsg32667> +proj=tmerc +lat_0=0 +lon_0=-81 +k=0.9996 +x_0=500000.001016002 +y_0=0 +datum=WGS84 +units=us-ft +no_defs  <>
-# WGS 84 / UTM grid system (southern hemisphere)
-# Unable to translate coordinate system EPSG:32700 into PROJ.4 format.
-#
-# WGS 84 / UTM zone 1S
-<epsg32701> +proj=utm +zone=1 +south +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UTM zone 2S
-<epsg32702> +proj=utm +zone=2 +south +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UTM zone 3S
-<epsg32703> +proj=utm +zone=3 +south +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UTM zone 4S
-<epsg32704> +proj=utm +zone=4 +south +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UTM zone 5S
-<epsg32705> +proj=utm +zone=5 +south +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UTM zone 6S
-<epsg32706> +proj=utm +zone=6 +south +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UTM zone 7S
-<epsg32707> +proj=utm +zone=7 +south +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UTM zone 8S
-<epsg32708> +proj=utm +zone=8 +south +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UTM zone 9S
-<epsg32709> +proj=utm +zone=9 +south +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UTM zone 10S
-<epsg32710> +proj=utm +zone=10 +south +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UTM zone 11S
-<epsg32711> +proj=utm +zone=11 +south +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UTM zone 12S
-<epsg32712> +proj=utm +zone=12 +south +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UTM zone 13S
-<epsg32713> +proj=utm +zone=13 +south +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UTM zone 14S
-<epsg32714> +proj=utm +zone=14 +south +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UTM zone 15S
-<epsg32715> +proj=utm +zone=15 +south +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UTM zone 16S
-<epsg32716> +proj=utm +zone=16 +south +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UTM zone 17S
-<epsg32717> +proj=utm +zone=17 +south +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UTM zone 18S
-<epsg32718> +proj=utm +zone=18 +south +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UTM zone 19S
-<epsg32719> +proj=utm +zone=19 +south +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UTM zone 20S
-<epsg32720> +proj=utm +zone=20 +south +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UTM zone 21S
-<epsg32721> +proj=utm +zone=21 +south +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UTM zone 22S
-<epsg32722> +proj=utm +zone=22 +south +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UTM zone 23S
-<epsg32723> +proj=utm +zone=23 +south +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UTM zone 24S
-<epsg32724> +proj=utm +zone=24 +south +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UTM zone 25S
-<epsg32725> +proj=utm +zone=25 +south +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UTM zone 26S
-<epsg32726> +proj=utm +zone=26 +south +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UTM zone 27S
-<epsg32727> +proj=utm +zone=27 +south +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UTM zone 28S
-<epsg32728> +proj=utm +zone=28 +south +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UTM zone 29S
-<epsg32729> +proj=utm +zone=29 +south +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UTM zone 30S
-<epsg32730> +proj=utm +zone=30 +south +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UTM zone 31S
-<epsg32731> +proj=utm +zone=31 +south +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UTM zone 32S
-<epsg32732> +proj=utm +zone=32 +south +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UTM zone 33S
-<epsg32733> +proj=utm +zone=33 +south +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UTM zone 34S
-<epsg32734> +proj=utm +zone=34 +south +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UTM zone 35S
-<epsg32735> +proj=utm +zone=35 +south +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UTM zone 36S
-<epsg32736> +proj=utm +zone=36 +south +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UTM zone 37S
-<epsg32737> +proj=utm +zone=37 +south +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UTM zone 38S
-<epsg32738> +proj=utm +zone=38 +south +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UTM zone 39S
-<epsg32739> +proj=utm +zone=39 +south +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UTM zone 40S
-<epsg32740> +proj=utm +zone=40 +south +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UTM zone 41S
-<epsg32741> +proj=utm +zone=41 +south +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UTM zone 42S
-<epsg32742> +proj=utm +zone=42 +south +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UTM zone 43S
-<epsg32743> +proj=utm +zone=43 +south +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UTM zone 44S
-<epsg32744> +proj=utm +zone=44 +south +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UTM zone 45S
-<epsg32745> +proj=utm +zone=45 +south +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UTM zone 46S
-<epsg32746> +proj=utm +zone=46 +south +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UTM zone 47S
-<epsg32747> +proj=utm +zone=47 +south +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UTM zone 48S
-<epsg32748> +proj=utm +zone=48 +south +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UTM zone 49S
-<epsg32749> +proj=utm +zone=49 +south +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UTM zone 50S
-<epsg32750> +proj=utm +zone=50 +south +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UTM zone 51S
-<epsg32751> +proj=utm +zone=51 +south +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UTM zone 52S
-<epsg32752> +proj=utm +zone=52 +south +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UTM zone 53S
-<epsg32753> +proj=utm +zone=53 +south +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UTM zone 54S
-<epsg32754> +proj=utm +zone=54 +south +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UTM zone 55S
-<epsg32755> +proj=utm +zone=55 +south +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UTM zone 56S
-<epsg32756> +proj=utm +zone=56 +south +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UTM zone 57S
-<epsg32757> +proj=utm +zone=57 +south +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UTM zone 58S
-<epsg32758> +proj=utm +zone=58 +south +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UTM zone 59S
-<epsg32759> +proj=utm +zone=59 +south +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UTM zone 60S
-<epsg32760> +proj=utm +zone=60 +south +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / UPS South (N,E)
-<epsg32761> +proj=stere +lat_0=-90 +lat_ts=-90 +lon_0=0 +k=0.994 +x_0=2000000 +y_0=2000000 +datum=WGS84 +units=m +no_defs  <>
-# WGS 84 / TM 36 SE
-<epsg32766> +proj=tmerc +lat_0=0 +lon_0=36 +k=0.9996 +x_0=500000 +y_0=10000000 +datum=WGS84 +units=m +no_defs  <>
-#
-##########################################################
-#
-#  Additional EPSG-like projection definitions
-#
-#  OGC-defined extended codes  (41000--41999)
-#  see http://www.digitalearth.gov/wmt/auto.html
-#
-# WGS84 / Simple Mercator
-<epsg41001> +proj=merc +lat_ts=0 +lon_0=0 +k=1.000000 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-#
-#  CubeWerx-defined extended codes  (42100--42199)
-#
-# WGS 84 / LCC Canada
-<epsg42101> +proj=lcc +lat_1=49 +lat_2=77 +lat_0=0 +lon_0=-95 +x_0=0 +y_0=-8000000 +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# NAD83 / BC Albers (this has been superceeded but is kept for compatibility)
-<epsg42102> +proj=aea +ellps=GRS80 +lat_0=45 +lon_0=-126.0 +lat_1=50.0 +lat_2=58.5 +x_0=1000000.0 +y_0=0 +datum=NAD83 +units=m no_defs <>
-# WGS 84 / LCC USA
-<epsg42103> +proj=lcc +lat_1=33 +lat_2=45 +lat_0=0 +lon_0=-100 +x_0=0 +y_0=0 +ellps=WGS72 +datum=WGS84 +units=m +no_defs  no_defs <>
-# NAD83 / MTM zone 8 Québec
-<epsg42104> +proj=tmerc +lat_0=0 +lon_0=-73.5 +k=0.999900 +x_0=304800 +y_0=0 +ellps=GRS80 +units=m +no_defs  no_defs <>
-# WGS84 / Merc NorthAm
-<epsg42105> +proj=merc +lat_ts=0 +lon_0=-96 +k=1.000000 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS84 / Lambert Azim Mozambique
-<epsg42106> +proj=laea +lat_0=5 +lon_0=20 +x_0=0 +y_0=0 +a=6370997 +b=6370997 +datum=WGS84 +units=m +no_defs  no_defs <>
-#
-#  CubeWerx-customer definitions  (42300--42399)
-#
-# NAD27 / Polar Stereographic / CM=-98
-<epsg42301> +proj=stere +lat_0=90 +lon_0=-98 +x_0=0 +y_0=0 +ellps=clrk66 +datum=NAD27 +units=m +no_defs  no_defs <>
-# JapanOrtho.09 09
-<epsg42302> +proj=tmerc +lat_0=36 +lon_0=139.833333333333 +k=0.999900 +x_0=0 +y_0=0 +ellps=bessel +units=m +no_defs  no_defs <>
-# NAD83 / Albers NorthAm
-<epsg42303> +proj=aea +lat_1=29.5 +lat_2=45.5 +lat_0=23 +lon_0=-96 +x_0=0 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / NRCan LCC Canada
-<epsg42304> +proj=lcc +lat_1=49 +lat_2=77 +lat_0=49 +lon_0=-95 +x_0=0 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# France_II
-<epsg42305> +proj=lcc +lat_1=45.898918964419 +lat_2=47.696014502038 +lat_0=46.8 +lon_0=2.337229166666667 +x_0=600000 +y_0=2200000 +a=6378249.2 +b=6356514.999904194 +pm=2.337229166666667 +units=m +no_defs  no_defs <>
-# NAD83/QC_LCC
-<epsg42306> +proj=lcc +lat_1=46 +lat_2=60 +lat_0=44 +lon_0=-68.5 +x_0=0 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / Texas Central - feet
-<epsg42307> +proj=lcc +lat_1=31.8833333333333 +lat_2=30.1166666666667 +lat_0=29.6666666666667 +lon_0=-100.333333333333 +x_0=700000.0000000001 +y_0=3000000 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / California Albers
-<epsg42308> +proj=aea +lat_1=34 +lat_2=40.5 +lat_0=0 +lon_0=-120 +x_0=0 +y_0=-4000000 +ellps=clrk66 +datum=NAD27 +units=m +no_defs  no_defs <>
-# NAD 83 / LCC Canada AVHRR-2
-<epsg42309> +proj=lcc +lat_1=49 +lat_2=77 +lat_0=0 +lon_0=-95 +x_0=0 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# WGS84+GRS80 / Mercator
-<epsg42310> +proj=merc +lat_ts=0 +lon_0=0 +k=1.000000 +x_0=0 +y_0=0 +ellps=GRS80 +datum=WGS84 +units=m +no_defs  no_defs <>
-# NAD83 / LCC Statcan
-<epsg42311> +proj=lcc +lat_1=49 +lat_2=77 +lat_0=63.390675 +lon_0=-91.86666700000001 +x_0=6200000 +y_0=3000000 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-#
-#  Funny epsgish code for google mercator - you should really use EPSG:3857
-#
-<epsg900913> +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext  +no_defs <>
-#
-##########################################################
-#
-# ESRI projection definitions
-#
-# Anguilla 1957 / British West Indies Grid
-<esri2000> +proj=tmerc +lat_0=0 +lon_0=-62 +k=0.999500 +x_0=400000 +y_0=0 +ellps=clrk80 +units=m +no_defs  no_defs <>
-# Antigua 1943 / British West Indies Grid
-<esri2001> +proj=tmerc +lat_0=0 +lon_0=-62 +k=0.999500 +x_0=400000 +y_0=0 +ellps=clrk80 +towgs84=-255,-15,71,0,0,0,0 +units=m +no_defs  no_defs <>
-# Dominica 1945 / British West Indies Grid
-<esri2002> +proj=tmerc +lat_0=0 +lon_0=-62 +k=0.999500 +x_0=400000 +y_0=0 +ellps=clrk80 +towgs84=725,685,536,0,0,0,0 +units=m +no_defs  no_defs <>
-# Grenada 1953 / British West Indies Grid
-<esri2003> +proj=tmerc +lat_0=0 +lon_0=-62 +k=0.999500 +x_0=400000 +y_0=0 +ellps=clrk80 +towgs84=72,213.7,93,0,0,0,0 +units=m +no_defs  no_defs <>
-# Montserrat 58 / British West Indies Grid
-<esri2004> +proj=tmerc +lat_0=0 +lon_0=-62 +k=0.999500 +x_0=400000 +y_0=0 +ellps=clrk80 +towgs84=174,359,365,0,0,0,0 +units=m +no_defs  no_defs <>
-# St Kitts 1955 / British West Indies Grid
-<esri2005> +proj=tmerc +lat_0=0 +lon_0=-62 +k=0.999500 +x_0=400000 +y_0=0 +ellps=clrk80 +towgs84=9,183,236,0,0,0,0 +units=m +no_defs  no_defs <>
-# St Lucia 1955 / British West Indies Grid
-<esri2006> +proj=tmerc +lat_0=0 +lon_0=-62 +k=0.999500 +x_0=400000 +y_0=0 +ellps=clrk80 +towgs84=-149,128,296,0,0,0,0 +units=m +no_defs  no_defs <>
-# St Vincent 45 / British West Indies Grid
-<esri2007> +proj=tmerc +lat_0=0 +lon_0=-62 +k=0.999500 +x_0=400000 +y_0=0 +ellps=clrk80 +units=m +no_defs  no_defs <>
-# NAD27(CGQ77) / SCoPQ zone 2
-<esri2008> +proj=tmerc +lat_0=0 +lon_0=-55.5 +k=0.999900 +x_0=304800 +y_0=0 +ellps=clrk66 +units=m +no_defs  no_defs <>
-# NAD27(CGQ77) / SCoPQ zone 3
-<esri2009> +proj=tmerc +lat_0=0 +lon_0=-58.5 +k=0.999900 +x_0=304800 +y_0=0 +ellps=clrk66 +units=m +no_defs  no_defs <>
-# NAD27(CGQ77) / SCoPQ zone 4
-<esri2010> +proj=tmerc +lat_0=0 +lon_0=-61.5 +k=0.999900 +x_0=304800 +y_0=0 +ellps=clrk66 +units=m +no_defs  no_defs <>
-# NAD27(CGQ77) / SCoPQ zone 5
-<esri2011> +proj=tmerc +lat_0=0 +lon_0=-64.5 +k=0.999900 +x_0=304800 +y_0=0 +ellps=clrk66 +units=m +no_defs  no_defs <>
-# NAD27(CGQ77) / SCoPQ zone 6
-<esri2012> +proj=tmerc +lat_0=0 +lon_0=-67.5 +k=0.999900 +x_0=304800 +y_0=0 +ellps=clrk66 +units=m +no_defs  no_defs <>
-# NAD27(CGQ77) / SCoPQ zone 7
-<esri2013> +proj=tmerc +lat_0=0 +lon_0=-70.5 +k=0.999900 +x_0=304800 +y_0=0 +ellps=clrk66 +units=m +no_defs  no_defs <>
-# NAD27(CGQ77) / SCoPQ zone 8
-<esri2014> +proj=tmerc +lat_0=0 +lon_0=-73.5 +k=0.999900 +x_0=304800 +y_0=0 +ellps=clrk66 +units=m +no_defs  no_defs <>
-# NAD27(CGQ77) / SCoPQ zone 9
-<esri2015> +proj=tmerc +lat_0=0 +lon_0=-76.5 +k=0.999900 +x_0=304800 +y_0=0 +ellps=clrk66 +units=m +no_defs  no_defs <>
-# NAD27(CGQ77) / SCoPQ zone 10
-<esri2016> +proj=tmerc +lat_0=0 +lon_0=-79.5 +k=0.999900 +x_0=304800 +y_0=0 +ellps=clrk66 +units=m +no_defs  no_defs <>
-# NAD27(76) / MTM zone 8
-<esri2017> +proj=tmerc +lat_0=0 +lon_0=-73.5 +k=0.999900 +x_0=304800 +y_0=0 +ellps=clrk66 +units=m +no_defs  no_defs <>
-# NAD27(76) / MTM zone 9
-<esri2018> +proj=tmerc +lat_0=0 +lon_0=-76.5 +k=0.999900 +x_0=304800 +y_0=0 +ellps=clrk66 +units=m +no_defs  no_defs <>
-# NAD27(76) / MTM zone 10
-<esri2019> +proj=tmerc +lat_0=0 +lon_0=-79.5 +k=0.999900 +x_0=304800 +y_0=0 +ellps=clrk66 +units=m +no_defs  no_defs <>
-# NAD27(76) / MTM zone 11
-<esri2020> +proj=tmerc +lat_0=0 +lon_0=-82.5 +k=0.999900 +x_0=304800 +y_0=0 +ellps=clrk66 +units=m +no_defs  no_defs <>
-# NAD27(76) / MTM zone 12
-<esri2021> +proj=tmerc +lat_0=0 +lon_0=-81 +k=0.999900 +x_0=304800 +y_0=0 +ellps=clrk66 +units=m +no_defs  no_defs <>
-# NAD27(76) / MTM zone 13
-<esri2022> +proj=tmerc +lat_0=0 +lon_0=-84 +k=0.999900 +x_0=304800 +y_0=0 +ellps=clrk66 +units=m +no_defs  no_defs <>
-# NAD27(76) / MTM zone 14
-<esri2023> +proj=tmerc +lat_0=0 +lon_0=-87 +k=0.999900 +x_0=304800 +y_0=0 +ellps=clrk66 +units=m +no_defs  no_defs <>
-# NAD27(76) / MTM zone 15
-<esri2024> +proj=tmerc +lat_0=0 +lon_0=-90 +k=0.999900 +x_0=304800 +y_0=0 +ellps=clrk66 +units=m +no_defs  no_defs <>
-# NAD27(76) / MTM zone 16
-<esri2025> +proj=tmerc +lat_0=0 +lon_0=-93 +k=0.999900 +x_0=304800 +y_0=0 +ellps=clrk66 +units=m +no_defs  no_defs <>
-# NAD27(76) / MTM zone 17
-<esri2026> +proj=tmerc +lat_0=0 +lon_0=-96 +k=0.999900 +x_0=304800 +y_0=0 +ellps=clrk66 +units=m +no_defs  no_defs <>
-# NAD27(76) / UTM zone 15N
-<esri2027> +proj=utm +zone=15 +ellps=clrk66 +units=m +no_defs  no_defs <>
-# NAD27(76) / UTM zone 16N
-<esri2028> +proj=utm +zone=16 +ellps=clrk66 +units=m +no_defs  no_defs <>
-# NAD27(76) / UTM zone 17N
-<esri2029> +proj=utm +zone=17 +ellps=clrk66 +units=m +no_defs  no_defs <>
-# NAD27(76) / UTM zone 18N
-<esri2030> +proj=utm +zone=18 +ellps=clrk66 +units=m +no_defs  no_defs <>
-# NAD27(CGQ77) / UTM zone 17N
-<esri2031> +proj=utm +zone=17 +ellps=clrk66 +units=m +no_defs  no_defs <>
-# NAD27(CGQ77) / UTM zone 18N
-<esri2032> +proj=utm +zone=18 +ellps=clrk66 +units=m +no_defs  no_defs <>
-# NAD27(CGQ77) / UTM zone 19N
-<esri2033> +proj=utm +zone=19 +ellps=clrk66 +units=m +no_defs  no_defs <>
-# NAD27(CGQ77) / UTM zone 20N
-<esri2034> +proj=utm +zone=20 +ellps=clrk66 +units=m +no_defs  no_defs <>
-# NAD27(CGQ77) / UTM zone 21N
-<esri2035> +proj=utm +zone=21 +ellps=clrk66 +units=m +no_defs  no_defs <>
-# NAD83(CSRS98) / New Brunswick Stereo
-<esri2036> +proj=stere +lat_0=46.5 +lon_0=-66.5 +k=0.999912 +x_0=2500000 +y_0=7500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(CSRS98) / UTM zone 19N
-<esri2037> +proj=utm +zone=19 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(CSRS98) / UTM zone 20N
-<esri2038> +proj=utm +zone=20 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# Israel / Israeli TM Grid
-<esri2039> +proj=tmerc +lat_0=31.73439361111111 +lon_0=35.20451694444445 +k=1.000007 +x_0=219529.584 +y_0=626907.39 +ellps=GRS80 +units=m +no_defs  no_defs <>
-# Locodjo 1965 / UTM zone 30N
-<esri2040> +proj=utm +zone=30 +ellps=clrk80 +towgs84=-125,53,467,0,0,0,0 +units=m +no_defs  no_defs <>
-# Abidjan 1987 / UTM zone 30N
-<esri2041> +proj=utm +zone=30 +ellps=clrk80 +towgs84=-124.76,53,466.79,0,0,0,0 +units=m +no_defs  no_defs <>
-# Locodjo 1965 / UTM zone 29N
-<esri2042> +proj=utm +zone=29 +ellps=clrk80 +towgs84=-125,53,467,0,0,0,0 +units=m +no_defs  no_defs <>
-# Abidjan 1987 / UTM zone 29N
-<esri2043> +proj=utm +zone=29 +ellps=clrk80 +towgs84=-124.76,53,466.79,0,0,0,0 +units=m +no_defs  no_defs <>
-# Hanoi 1972 / Gauss-Kruger zone 18
-<esri2044> +proj=tmerc +lat_0=0 +lon_0=105 +k=1.000000 +x_0=18500000 +y_0=0 +ellps=krass +towgs84=-17.51,-108.32,-62.39,0,0,0,0 +units=m +no_defs  no_defs <>
-# Hanoi 1972 / Gauss-Kruger zone 19
-<esri2045> +proj=tmerc +lat_0=0 +lon_0=111 +k=1.000000 +x_0=19500000 +y_0=0 +ellps=krass +towgs84=-17.51,-108.32,-62.39,0,0,0,0 +units=m +no_defs  no_defs <>
-# Hartebeesthoek94 / Lo15
-# Hartebeesthoek94 / Lo17
-# Hartebeesthoek94 / Lo19
-# Hartebeesthoek94 / Lo21
-# Hartebeesthoek94 / Lo23
-# Hartebeesthoek94 / Lo25
-# Hartebeesthoek94 / Lo27
-# Hartebeesthoek94 / Lo29
-# Hartebeesthoek94 / Lo31
-# Hartebeesthoek94 / Lo33
-# CH1903+ / LV95
-<esri2056> +proj=omerc +lat_0=46.95240555555556 +lonc=7.439583333333333 +alpha=90 +k=1 +x_0=2600000 +y_0=1200000 +ellps=bessel +towgs84=674.374,15.056,405.346,0,0,0,0 +units=m +no_defs  no_defs <>
-# Rassadiran / Nakhl e Taqi
-<esri2057> +proj=omerc +lat_0=27.51882880555555 +lonc=52.60353916666667 +alpha=0.5716611944444444 +k=0.999895934 +x_0=658377.437 +y_0=3044969.194 +ellps=intl +towgs84=-133.63,-157.5,-158.62,0,0,0,0 +units=m +no_defs  no_defs <>
-# ED50(ED77) / UTM zone 38N
-<esri2058> +proj=utm +zone=38 +ellps=intl +units=m +no_defs  no_defs <>
-# ED50(ED77) / UTM zone 39N
-<esri2059> +proj=utm +zone=39 +ellps=intl +units=m +no_defs  no_defs <>
-# ED50(ED77) / UTM zone 40N
-<esri2060> +proj=utm +zone=40 +ellps=intl +units=m +no_defs  no_defs <>
-# ED50(ED77) / UTM zone 41N
-<esri2061> +proj=utm +zone=41 +ellps=intl +units=m +no_defs  no_defs <>
-# Madrid 1870 (Madrid) / Spain
-<esri2062> +proj=lcc +lat_1=40 +lat_0=40 +lon_0=-3.687938888888889 +k_0=0.9988085293 +x_0=600000 +y_0=600000 +a=6378298.3 +b=6356657.142669562 +pm=madrid +units=m +no_defs  no_defs <>
-# Dabola 1981 / UTM zone 28N
-<esri2063> +proj=utm +zone=28 +a=6378249.2 +b=6356515 +towgs84=-23,259,-9,0,0,0,0 +units=m +no_defs  no_defs <>
-# Dabola 1981 / UTM zone 29N
-<esri2064> +proj=utm +zone=29 +a=6378249.2 +b=6356515 +towgs84=-23,259,-9,0,0,0,0 +units=m +no_defs  no_defs <>
-# S-JTSK (Ferro) / Krovak
-<esri2065> +proj=krovak +lat_0=49.5 +lon_0=24.83333333333333 +alpha=30.28813972222222 +k=0.9999 +x_0=0 +y_0=0 +ellps=bessel +pm=ferro +units=m +no_defs  no_defs <>
-# Mount Dillon / Tobago Grid
-<esri2066> +proj=cass +lat_0=11.25217861111111 +lon_0=-60.68600888888889 +x_0=37718.66154375 +y_0=36209.915082 +a=6378293.63683822 +b=6356617.979337744 +to_meter=0.2011661949 +no_defs  no_defs <>
-# Naparima 1955 / UTM zone 20N
-<esri2067> +proj=utm +zone=20 +ellps=intl +units=m +no_defs  no_defs <>
-# ELD79 / Libya zone 5
-<esri2068> +proj=tmerc +lat_0=0 +lon_0=9 +k=0.999900 +x_0=200000 +y_0=0 +ellps=intl +units=m +no_defs  no_defs <>
-# ELD79 / Libya zone 6
-<esri2069> +proj=tmerc +lat_0=0 +lon_0=11 +k=0.999900 +x_0=200000 +y_0=0 +ellps=intl +units=m +no_defs  no_defs <>
-# ELD79 / Libya zone 7
-<esri2070> +proj=tmerc +lat_0=0 +lon_0=13 +k=0.999900 +x_0=200000 +y_0=0 +ellps=intl +units=m +no_defs  no_defs <>
-# ELD79 / Libya zone 8
-<esri2071> +proj=tmerc +lat_0=0 +lon_0=15 +k=0.999900 +x_0=200000 +y_0=0 +ellps=intl +units=m +no_defs  no_defs <>
-# ELD79 / Libya zone 9
-<esri2072> +proj=tmerc +lat_0=0 +lon_0=17 +k=0.999900 +x_0=200000 +y_0=0 +ellps=intl +units=m +no_defs  no_defs <>
-# ELD79 / Libya zone 10
-<esri2073> +proj=tmerc +lat_0=0 +lon_0=19 +k=0.999900 +x_0=200000 +y_0=0 +ellps=intl +units=m +no_defs  no_defs <>
-# ELD79 / Libya zone 11
-<esri2074> +proj=tmerc +lat_0=0 +lon_0=21 +k=0.999900 +x_0=200000 +y_0=0 +ellps=intl +units=m +no_defs  no_defs <>
-# ELD79 / Libya zone 12
-<esri2075> +proj=tmerc +lat_0=0 +lon_0=23 +k=0.999900 +x_0=200000 +y_0=0 +ellps=intl +units=m +no_defs  no_defs <>
-# ELD79 / Libya zone 13
-<esri2076> +proj=tmerc +lat_0=0 +lon_0=25 +k=0.999900 +x_0=200000 +y_0=0 +ellps=intl +units=m +no_defs  no_defs <>
-# ELD79 / UTM zone 32N
-<esri2077> +proj=utm +zone=32 +ellps=intl +units=m +no_defs  no_defs <>
-# ELD79 / UTM zone 33N
-<esri2078> +proj=utm +zone=33 +ellps=intl +units=m +no_defs  no_defs <>
-# ELD79 / UTM zone 34N
-<esri2079> +proj=utm +zone=34 +ellps=intl +units=m +no_defs  no_defs <>
-# ELD79 / UTM zone 35N
-<esri2080> +proj=utm +zone=35 +ellps=intl +units=m +no_defs  no_defs <>
-# Chos Malal 1914 / Argentina zone 2
-<esri2081> +proj=tmerc +lat_0=-90 +lon_0=-69 +k=1.000000 +x_0=2500000 +y_0=0 +ellps=intl +units=m +no_defs  no_defs <>
-# Pampa del Castillo / Argentina zone 2
-<esri2082> +proj=tmerc +lat_0=-90 +lon_0=-69 +k=1.000000 +x_0=2500000 +y_0=0 +ellps=intl +units=m +no_defs  no_defs <>
-# Hito XVIII 1963 / Argentina zone 2
-<esri2083> +proj=tmerc +lat_0=-90 +lon_0=-69 +k=1.000000 +x_0=2500000 +y_0=0 +ellps=intl +towgs84=18.38,192.45,96.82,0.056,-0.142,-0.2,-0.0013 +units=m +no_defs  no_defs <>
-# Hito XVIII 1963 / UTM zone 19S
-<esri2084> +proj=utm +zone=19 +south +ellps=intl +towgs84=18.38,192.45,96.82,0.056,-0.142,-0.2,-0.0013 +units=m +no_defs  no_defs <>
-# NAD27 / Cuba Norte
-<esri2085> +proj=lcc +lat_1=22.35 +lat_0=22.35 +lon_0=-81 +k_0=0.99993602 +x_0=500000 +y_0=280296.016 +ellps=clrk66 +datum=NAD27 +units=m +no_defs  no_defs <>
-# NAD27 / Cuba Sur
-<esri2086> +proj=lcc +lat_1=20.71666666666667 +lat_0=20.71666666666667 +lon_0=-76.83333333333333 +k_0=0.99994848 +x_0=500000 +y_0=229126.939 +ellps=clrk66 +datum=NAD27 +units=m +no_defs  no_defs <>
-# ELD79 / TM 12 NE
-<esri2087> +proj=tmerc +lat_0=0 +lon_0=12 +k=0.999600 +x_0=500000 +y_0=0 +ellps=intl +units=m +no_defs  no_defs <>
-# Carthage / TM 11 NE
-<esri2088> +proj=tmerc +lat_0=0 +lon_0=11 +k=0.999600 +x_0=500000 +y_0=0 +a=6378249.2 +b=6356515 +units=m +no_defs  no_defs <>
-# Yemen NGN96 / UTM zone 38N
-<esri2089> +proj=utm +zone=38 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# Yemen NGN96 / UTM zone 39N
-<esri2090> +proj=utm +zone=39 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# South Yemen / Gauss Kruger zone 8
-<esri2091> +proj=tmerc +lat_0=0 +lon_0=45 +k=1.000000 +x_0=8500000 +y_0=0 +ellps=krass +towgs84=-76,-138,67,0,0,0,0 +units=m +no_defs  no_defs <>
-# South Yemen / Gauss Kruger zone 9
-<esri2092> +proj=tmerc +lat_0=0 +lon_0=51 +k=1.000000 +x_0=9500000 +y_0=0 +ellps=krass +towgs84=-76,-138,67,0,0,0,0 +units=m +no_defs  no_defs <>
-# Hanoi 1972 / GK 106 NE
-<esri2093> +proj=tmerc +lat_0=0 +lon_0=106 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +towgs84=-17.51,-108.32,-62.39,0,0,0,0 +units=m +no_defs  no_defs <>
-# WGS 72BE / TM 106 NE
-<esri2094> +proj=tmerc +lat_0=0 +lon_0=106 +k=0.999600 +x_0=500000 +y_0=0 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# Bissau / UTM zone 28N
-<esri2095> +proj=utm +zone=28 +ellps=intl +towgs84=-173,253,27,0,0,0,0 +units=m +no_defs  no_defs <>
-# Korean 1985 / Korea East Belt
-<esri2096> +proj=tmerc +lat_0=38 +lon_0=129 +k=1.000000 +x_0=200000 +y_0=500000 +ellps=bessel +units=m +no_defs  no_defs <>
-# Korean 1985 / Korea Central Belt
-<esri2097> +proj=tmerc +lat_0=38 +lon_0=127 +k=1.000000 +x_0=200000 +y_0=500000 +ellps=bessel +units=m +no_defs  no_defs <>
-# Korean 1985 / Korea West Belt
-<esri2098> +proj=tmerc +lat_0=38 +lon_0=125 +k=1.000000 +x_0=200000 +y_0=500000 +ellps=bessel +units=m +no_defs  no_defs <>
-# Qatar 1948 / Qatar Grid
-<esri2099> +proj=cass +lat_0=25.38236111111111 +lon_0=50.76138888888889 +x_0=100000 +y_0=100000 +ellps=helmert +units=m +no_defs  no_defs <>
-# GGRS87 / Greek Grid
-<esri2100> +proj=tmerc +lat_0=0 +lon_0=24 +k=0.999600 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=-199.87,74.79,246.62,0,0,0,0 +units=m +no_defs  no_defs <>
-# Lake / Maracaibo Grid M1
-<esri2101> +proj=lcc +lat_1=10.16666666666667 +lat_0=10.16666666666667 +lon_0=-71.60561777777777 +k_0=1 +x_0=0 +y_0=-52684.972 +ellps=intl +units=m +no_defs  no_defs <>
-# Lake / Maracaibo Grid
-<esri2102> +proj=lcc +lat_1=10.16666666666667 +lat_0=10.16666666666667 +lon_0=-71.60561777777777 +k_0=1 +x_0=200000 +y_0=147315.028 +ellps=intl +units=m +no_defs  no_defs <>
-# Lake / Maracaibo Grid M3
-<esri2103> +proj=lcc +lat_1=10.16666666666667 +lat_0=10.16666666666667 +lon_0=-71.60561777777777 +k_0=1 +x_0=500000 +y_0=447315.028 +ellps=intl +units=m +no_defs  no_defs <>
-# Lake / Maracaibo La Rosa Grid
-<esri2104> +proj=lcc +lat_1=10.16666666666667 +lat_0=10.16666666666667 +lon_0=-71.60561777777777 +k_0=1 +x_0=-17044 +y_0=-23139.97 +ellps=intl +units=m +no_defs  no_defs <>
-# NZGD2000 / Mount Eden Circuit 2000
-<esri2105> +proj=tmerc +lat_0=-36.87972222222222 +lon_0=174.7641666666667 +k=0.999900 +x_0=400000 +y_0=800000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NZGD2000 / Bay of Plenty Circuit 2000
-<esri2106> +proj=tmerc +lat_0=-37.76111111111111 +lon_0=176.4661111111111 +k=1.000000 +x_0=400000 +y_0=800000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NZGD2000 / Poverty Bay Circuit 2000
-<esri2107> +proj=tmerc +lat_0=-38.62444444444444 +lon_0=177.8855555555556 +k=1.000000 +x_0=400000 +y_0=800000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NZGD2000 / Hawkes Bay Circuit 2000
-<esri2108> +proj=tmerc +lat_0=-39.65083333333333 +lon_0=176.6736111111111 +k=1.000000 +x_0=400000 +y_0=800000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NZGD2000 / Taranaki Circuit 2000
-<esri2109> +proj=tmerc +lat_0=-39.13555555555556 +lon_0=174.2277777777778 +k=1.000000 +x_0=400000 +y_0=800000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NZGD2000 / Tuhirangi Circuit 2000
-<esri2110> +proj=tmerc +lat_0=-39.51222222222222 +lon_0=175.64 +k=1.000000 +x_0=400000 +y_0=800000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NZGD2000 / Wanganui Circuit 2000
-<esri2111> +proj=tmerc +lat_0=-40.24194444444444 +lon_0=175.4880555555555 +k=1.000000 +x_0=400000 +y_0=800000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NZGD2000 / Wairarapa Circuit 2000
-<esri2112> +proj=tmerc +lat_0=-40.92527777777777 +lon_0=175.6472222222222 +k=1.000000 +x_0=400000 +y_0=800000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NZGD2000 / Wellington Circuit 2000
-<esri2113> +proj=tmerc +lat_0=-41.3011111111111 +lon_0=174.7763888888889 +k=1.000000 +x_0=400000 +y_0=800000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NZGD2000 / Collingwood Circuit 2000
-<esri2114> +proj=tmerc +lat_0=-40.71472222222223 +lon_0=172.6719444444444 +k=1.000000 +x_0=400000 +y_0=800000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NZGD2000 / Nelson Circuit 2000
-<esri2115> +proj=tmerc +lat_0=-41.27444444444444 +lon_0=173.2991666666667 +k=1.000000 +x_0=400000 +y_0=800000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NZGD2000 / Karamea Circuit 2000
-<esri2116> +proj=tmerc +lat_0=-41.28972222222222 +lon_0=172.1088888888889 +k=1.000000 +x_0=400000 +y_0=800000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NZGD2000 / Buller Circuit 2000
-<esri2117> +proj=tmerc +lat_0=-41.81055555555555 +lon_0=171.5811111111111 +k=1.000000 +x_0=400000 +y_0=800000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NZGD2000 / Grey Circuit 2000
-<esri2118> +proj=tmerc +lat_0=-42.33361111111111 +lon_0=171.5497222222222 +k=1.000000 +x_0=400000 +y_0=800000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NZGD2000 / Amuri Circuit 2000
-<esri2119> +proj=tmerc +lat_0=-42.68888888888888 +lon_0=173.01 +k=1.000000 +x_0=400000 +y_0=800000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NZGD2000 / Marlborough Circuit 2000
-<esri2120> +proj=tmerc +lat_0=-41.54444444444444 +lon_0=173.8019444444444 +k=1.000000 +x_0=400000 +y_0=800000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NZGD2000 / Hokitika Circuit 2000
-<esri2121> +proj=tmerc +lat_0=-42.88611111111111 +lon_0=170.9797222222222 +k=1.000000 +x_0=400000 +y_0=800000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NZGD2000 / Okarito Circuit 2000
-<esri2122> +proj=tmerc +lat_0=-43.11 +lon_0=170.2608333333333 +k=1.000000 +x_0=400000 +y_0=800000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NZGD2000 / Jacksons Bay Circuit 2000
-<esri2123> +proj=tmerc +lat_0=-43.97777777777778 +lon_0=168.6061111111111 +k=1.000000 +x_0=400000 +y_0=800000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NZGD2000 / Mount Pleasant Circuit 2000
-<esri2124> +proj=tmerc +lat_0=-43.59055555555556 +lon_0=172.7269444444445 +k=1.000000 +x_0=400000 +y_0=800000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NZGD2000 / Gawler Circuit 2000
-<esri2125> +proj=tmerc +lat_0=-43.74861111111111 +lon_0=171.3605555555555 +k=1.000000 +x_0=400000 +y_0=800000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NZGD2000 / Timaru Circuit 2000
-<esri2126> +proj=tmerc +lat_0=-44.40194444444445 +lon_0=171.0572222222222 +k=1.000000 +x_0=400000 +y_0=800000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NZGD2000 / Lindis Peak Circuit 2000
-<esri2127> +proj=tmerc +lat_0=-44.735 +lon_0=169.4675 +k=1.000000 +x_0=400000 +y_0=800000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NZGD2000 / Mount Nicholas Circuit 2000
-<esri2128> +proj=tmerc +lat_0=-45.13277777777778 +lon_0=168.3986111111111 +k=1.000000 +x_0=400000 +y_0=800000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NZGD2000 / Mount York Circuit 2000
-<esri2129> +proj=tmerc +lat_0=-45.56361111111111 +lon_0=167.7386111111111 +k=1.000000 +x_0=400000 +y_0=800000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NZGD2000 / Observation Point Circuit 2000
-<esri2130> +proj=tmerc +lat_0=-45.81611111111111 +lon_0=170.6283333333333 +k=1.000000 +x_0=400000 +y_0=800000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NZGD2000 / North Taieri Circuit 2000
-<esri2131> +proj=tmerc +lat_0=-45.86138888888889 +lon_0=170.2825 +k=0.999960 +x_0=400000 +y_0=800000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NZGD2000 / Bluff Circuit 2000
-<esri2132> +proj=tmerc +lat_0=-46.6 +lon_0=168.3427777777778 +k=1.000000 +x_0=400000 +y_0=800000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NZGD2000 / UTM zone 58S
-<esri2133> +proj=utm +zone=58 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NZGD2000 / UTM zone 59S
-<esri2134> +proj=utm +zone=59 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NZGD2000 / UTM zone 60S
-<esri2135> +proj=utm +zone=60 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# Accra / Ghana National Grid
-<esri2136> +proj=tmerc +lat_0=4.666666666666667 +lon_0=-1 +k=0.999750 +x_0=274319.7391633579 +y_0=0 +a=6378300 +b=6356751.689189189 +towgs84=-199,32,322,0,0,0,0 +to_meter=0.3047997101815088 +no_defs  no_defs <>
-# Accra / TM 1 NW
-<esri2137> +proj=tmerc +lat_0=0 +lon_0=-1 +k=0.999600 +x_0=500000 +y_0=0 +a=6378300 +b=6356751.689189189 +towgs84=-199,32,322,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD27(CGQ77) / Quebec Lambert
-<esri2138> +proj=lcc +lat_1=60 +lat_2=46 +lat_0=44 +lon_0=-68.5 +x_0=0 +y_0=0 +ellps=clrk66 +units=m +no_defs  no_defs <>
-# NAD83(CSRS98) / SCoPQ zone 2
-<esri2139> +proj=tmerc +lat_0=0 +lon_0=-55.5 +k=0.999900 +x_0=304800 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(CSRS98) / MTM zone 3
-<esri2140> +proj=tmerc +lat_0=0 +lon_0=-58.5 +k=0.999900 +x_0=304800 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(CSRS98) / MTM zone 4
-<esri2141> +proj=tmerc +lat_0=0 +lon_0=-61.5 +k=0.999900 +x_0=304800 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(CSRS98) / MTM zone 5
-<esri2142> +proj=tmerc +lat_0=0 +lon_0=-64.5 +k=0.999900 +x_0=304800 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(CSRS98) / MTM zone 6
-<esri2143> +proj=tmerc +lat_0=0 +lon_0=-67.5 +k=0.999900 +x_0=304800 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(CSRS98) / MTM zone 7
-<esri2144> +proj=tmerc +lat_0=0 +lon_0=-70.5 +k=0.999900 +x_0=304800 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(CSRS98) / MTM zone 8
-<esri2145> +proj=tmerc +lat_0=0 +lon_0=-73.5 +k=0.999900 +x_0=304800 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(CSRS98) / MTM zone 9
-<esri2146> +proj=tmerc +lat_0=0 +lon_0=-76.5 +k=0.999900 +x_0=304800 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(CSRS98) / MTM zone 10
-<esri2147> +proj=tmerc +lat_0=0 +lon_0=-79.5 +k=0.999900 +x_0=304800 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(CSRS98) / UTM zone 21N
-<esri2148> +proj=utm +zone=21 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(CSRS98) / UTM zone 18N
-<esri2149> +proj=utm +zone=18 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(CSRS98) / UTM zone 17N
-<esri2150> +proj=utm +zone=17 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(CSRS98) / UTM zone 13N
-<esri2151> +proj=utm +zone=13 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(CSRS98) / UTM zone 12N
-<esri2152> +proj=utm +zone=12 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(CSRS98) / UTM zone 11N
-<esri2153> +proj=utm +zone=11 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# RGF93 / Lambert-93
-<esri2154> +proj=lcc +lat_1=49 +lat_2=44 +lat_0=46.5 +lon_0=3 +x_0=700000 +y_0=6600000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# American Samoa 1962 / American Samoa Lambert
-<esri2155> +proj=lcc +lat_1=-14.26666666666667 +lat_0=-14.26666666666667 +lon_0=170 +k_0=1 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +towgs84=-115,118,426,0,0,0,0 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD83(HARN) / UTM zone 59S
-<esri2156> +proj=utm +zone=59 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# IRENET95 / Irish Transverse Mercator
-<esri2157> +proj=tmerc +lat_0=53.5 +lon_0=-8 +k=0.999820 +x_0=600000 +y_0=750000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# IRENET95 / UTM zone 29N
-<esri2158> +proj=utm +zone=29 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# Sierra Leone 1924 / New Colony Grid
-<esri2159> +proj=tmerc +lat_0=6.666666666666667 +lon_0=-12 +k=1.000000 +x_0=152399.8550907544 +y_0=0 +a=6378300 +b=6356751.689189189 +to_meter=0.3047997101815088 +no_defs  no_defs <>
-# Sierra Leone 1924 / New War Office Grid
-<esri2160> +proj=tmerc +lat_0=6.666666666666667 +lon_0=-12 +k=1.000000 +x_0=243839.7681452071 +y_0=182879.8261089053 +a=6378300 +b=6356751.689189189 +to_meter=0.3047997101815088 +no_defs  no_defs <>
-# Sierra Leone 1968 / UTM zone 28N
-<esri2161> +proj=utm +zone=28 +ellps=clrk80 +towgs84=-88,4,101,0,0,0,0 +units=m +no_defs  no_defs <>
-# Sierra Leone 1968 / UTM zone 29N
-<esri2162> +proj=utm +zone=29 +ellps=clrk80 +towgs84=-88,4,101,0,0,0,0 +units=m +no_defs  no_defs <>
-# US National Atlas Equal Area
-<esri2163> +proj=laea +lat_0=45 +lon_0=-100 +x_0=0 +y_0=0 +a=6370997 +b=6370997 +units=m +no_defs  no_defs <>
-# Locodjo 1965 / TM 5 NW
-<esri2164> +proj=tmerc +lat_0=0 +lon_0=-5 +k=0.999600 +x_0=500000 +y_0=0 +ellps=clrk80 +towgs84=-125,53,467,0,0,0,0 +units=m +no_defs  no_defs <>
-# Abidjan 1987 / TM 5 NW
-<esri2165> +proj=tmerc +lat_0=0 +lon_0=-5 +k=0.999600 +x_0=500000 +y_0=0 +ellps=clrk80 +towgs84=-124.76,53,466.79,0,0,0,0 +units=m +no_defs  no_defs <>
-# Pulkovo 1942(83) / Gauss Kruger zone 3
-<esri2166> +proj=tmerc +lat_0=0 +lon_0=9 +k=1.000000 +x_0=3500000 +y_0=0 +ellps=krass +towgs84=24,-123,-94,0.02,-0.25,-0.13,1.1 +units=m +no_defs  no_defs <>
-# Pulkovo 1942(83) / Gauss Kruger zone 4
-<esri2167> +proj=tmerc +lat_0=0 +lon_0=12 +k=1.000000 +x_0=4500000 +y_0=0 +ellps=krass +towgs84=24,-123,-94,0.02,-0.25,-0.13,1.1 +units=m +no_defs  no_defs <>
-# Pulkovo 1942(83) / Gauss Kruger zone 5
-<esri2168> +proj=tmerc +lat_0=0 +lon_0=15 +k=1.000000 +x_0=5500000 +y_0=0 +ellps=krass +towgs84=24,-123,-94,0.02,-0.25,-0.13,1.1 +units=m +no_defs  no_defs <>
-# Luxembourg 1930 / Gauss
-<esri2169> +proj=tmerc +lat_0=49.83333333333334 +lon_0=6.166666666666667 +k=1.000000 +x_0=80000 +y_0=100000 +ellps=intl +towgs84=-193,13.7,-39.3,-0.41,-2.933,2.688,0.43 +units=m +no_defs  no_defs <>
-# MGI / Slovenia Grid
-<esri2170> +proj=tmerc +lat_0=0 +lon_0=15 +k=0.999900 +x_0=500000 +y_0=0 +ellps=bessel +units=m +no_defs  no_defs <>
-# Pulkovo 1942(58) / Poland zone I
-<esri2171> +proj=stere +lat_0=50.625 +lon_0=21.08333333333333 +k=0.999800 +x_0=4637000 +y_0=5647000 +ellps=krass +towgs84=33.4,-146.6,-76.3,-0.359,-0.053,0.844,-0.84 +units=m +no_defs  no_defs <>
-# Pulkovo 1942(58) / Poland zone II
-<esri2172> +proj=stere +lat_0=53.00194444444445 +lon_0=21.50277777777778 +k=0.999800 +x_0=4603000 +y_0=5806000 +ellps=krass +towgs84=33.4,-146.6,-76.3,-0.359,-0.053,0.844,-0.84 +units=m +no_defs  no_defs <>
-# Pulkovo 1942(58) / Poland zone III
-<esri2173> +proj=stere +lat_0=53.58333333333334 +lon_0=17.00833333333333 +k=0.999800 +x_0=3501000 +y_0=5999000 +ellps=krass +towgs84=33.4,-146.6,-76.3,-0.359,-0.053,0.844,-0.84 +units=m +no_defs  no_defs <>
-# Pulkovo 1942(58) / Poland zone IV
-<esri2174> +proj=stere +lat_0=51.67083333333333 +lon_0=16.67222222222222 +k=0.999800 +x_0=3703000 +y_0=5627000 +ellps=krass +towgs84=33.4,-146.6,-76.3,-0.359,-0.053,0.844,-0.84 +units=m +no_defs  no_defs <>
-# Pulkovo 1942(58) / Poland zone V
-<esri2175> +proj=tmerc +lat_0=0 +lon_0=18.95833333333333 +k=0.999983 +x_0=237000 +y_0=-4700000 +ellps=krass +towgs84=33.4,-146.6,-76.3,-0.359,-0.053,0.844,-0.84 +units=m +no_defs  no_defs <>
-# ETRS89 / Poland CS2000 zone 5
-<esri2176> +proj=tmerc +lat_0=0 +lon_0=15 +k=0.999923 +x_0=5500000 +y_0=0 +ellps=GRS80 +units=m +no_defs  no_defs <>
-# ETRS89 / Poland CS2000 zone 6
-<esri2177> +proj=tmerc +lat_0=0 +lon_0=18 +k=0.999923 +x_0=6500000 +y_0=0 +ellps=GRS80 +units=m +no_defs  no_defs <>
-# ETRS89 / Poland CS2000 zone 7
-<esri2178> +proj=tmerc +lat_0=0 +lon_0=21 +k=0.999923 +x_0=7500000 +y_0=0 +ellps=GRS80 +units=m +no_defs  no_defs <>
-# ETRS89 / Poland CS2000 zone 8
-<esri2179> +proj=tmerc +lat_0=0 +lon_0=24 +k=0.999923 +x_0=8500000 +y_0=0 +ellps=GRS80 +units=m +no_defs  no_defs <>
-# ETRS89 / Poland CS92
-<esri2180> +proj=tmerc +lat_0=0 +lon_0=19 +k=0.999300 +x_0=500000 +y_0=-5300000 +ellps=GRS80 +units=m +no_defs  no_defs <>
-# Azores Occidental 1939 / UTM zone 25N
-<esri2188> +proj=utm +zone=25 +ellps=intl +units=m +no_defs  no_defs <>
-# Azores Central 1948 / UTM zone 26N
-<esri2189> +proj=utm +zone=26 +ellps=intl +units=m +no_defs  no_defs <>
-# Azores Oriental 1940 / UTM zone 26N
-<esri2190> +proj=utm +zone=26 +ellps=intl +units=m +no_defs  no_defs <>
-# Madeira 1936 / UTM zone 28N
-<esri2191> +proj=utm +zone=28 +ellps=intl +units=m +no_defs  no_defs <>
-# ED50 / France EuroLambert
-<esri2192> +proj=lcc +lat_1=46.8 +lat_0=46.8 +lon_0=2.337229166666667 +k_0=0.99987742 +x_0=600000 +y_0=2200000 +ellps=intl +units=m +no_defs  no_defs <>
-# NZGD2000 / New Zealand Transverse Mercator
-<esri2193> +proj=tmerc +lat_0=0 +lon_0=173 +k=0.999600 +x_0=1600000 +y_0=10000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# American Samoa 1962 / American Samoa Lambert
-<esri2194> +proj=lcc +lat_1=-14.26666666666667 +lat_0=-14.26666666666667 +lon_0=-170 +k_0=1 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +towgs84=-115,118,426,0,0,0,0 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD83(HARN) / UTM zone 2S
-<esri2195> +proj=utm +zone=2 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# ETRS89 / Kp2000 Jutland
-<esri2196> +proj=tmerc +lat_0=0 +lon_0=9.5 +k=0.999950 +x_0=200000 +y_0=0 +ellps=GRS80 +units=m +no_defs  no_defs <>
-# ETRS89 / Kp2000 Zealand
-<esri2197> +proj=tmerc +lat_0=0 +lon_0=12 +k=0.999950 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs  no_defs <>
-# ETRS89 / Kp2000 Bornholm
-<esri2198> +proj=tmerc +lat_0=0 +lon_0=15 +k=1.000000 +x_0=900000 +y_0=0 +ellps=GRS80 +units=m +no_defs  no_defs <>
-# Albanian 1987 / Gauss Kruger zone 4
-<esri2199> +proj=tmerc +lat_0=0 +lon_0=21 +k=1.000000 +x_0=4500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# ATS77 / New Brunswick Stereographic (ATS77)
-<esri2200> +proj=stere +lat_0=46.5 +lon_0=-66.5 +k=0.999912 +x_0=300000 +y_0=800000 +a=6378135 +b=6356750.304921594 +units=m +no_defs  no_defs <>
-# REGVEN / UTM zone 18N
-<esri2201> +proj=utm +zone=18 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# REGVEN / UTM zone 19N
-<esri2202> +proj=utm +zone=19 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# REGVEN / UTM zone 20N
-<esri2203> +proj=utm +zone=20 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD27 / Tennessee
-<esri2204> +proj=lcc +lat_1=35.25 +lat_2=36.41666666666666 +lat_0=34.66666666666666 +lon_0=-86 +x_0=609601.2192024384 +y_0=30480.06096012192 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD83 / Kentucky North
-<esri2205> +proj=lcc +lat_1=37.96666666666667 +lat_2=38.96666666666667 +lat_0=37.5 +lon_0=-84.25 +x_0=500000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# ED50 / 3-degree Gauss-Kruger zone 9
-<esri2206> +proj=tmerc +lat_0=0 +lon_0=27 +k=1.000000 +x_0=9500000 +y_0=0 +ellps=intl +units=m +no_defs  no_defs <>
-# ED50 / 3-degree Gauss-Kruger zone 10
-<esri2207> +proj=tmerc +lat_0=0 +lon_0=30 +k=1.000000 +x_0=10500000 +y_0=0 +ellps=intl +units=m +no_defs  no_defs <>
-# ED50 / 3-degree Gauss-Kruger zone 11
-<esri2208> +proj=tmerc +lat_0=0 +lon_0=33 +k=1.000000 +x_0=11500000 +y_0=0 +ellps=intl +units=m +no_defs  no_defs <>
-# ED50 / 3-degree Gauss-Kruger zone 12
-<esri2209> +proj=tmerc +lat_0=0 +lon_0=36 +k=1.000000 +x_0=12500000 +y_0=0 +ellps=intl +units=m +no_defs  no_defs <>
-# ED50 / 3-degree Gauss-Kruger zone 13
-<esri2210> +proj=tmerc +lat_0=0 +lon_0=39 +k=1.000000 +x_0=13500000 +y_0=0 +ellps=intl +units=m +no_defs  no_defs <>
-# ED50 / 3-degree Gauss-Kruger zone 14
-<esri2211> +proj=tmerc +lat_0=0 +lon_0=42 +k=1.000000 +x_0=14500000 +y_0=0 +ellps=intl +units=m +no_defs  no_defs <>
-# ED50 / 3-degree Gauss-Kruger zone 15
-<esri2212> +proj=tmerc +lat_0=0 +lon_0=45 +k=1.000000 +x_0=15500000 +y_0=0 +ellps=intl +units=m +no_defs  no_defs <>
-# ETRS89 / TM 30 NE
-<esri2213> +proj=tmerc +lat_0=0 +lon_0=30 +k=0.999600 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs  no_defs <>
-# Douala 1948 / AOF west
-<esri2214> +proj=tmerc +lat_0=0 +lon_0=10.5 +k=0.999000 +x_0=1000000 +y_0=1000000 +ellps=intl +units=m +no_defs  no_defs <>
-# Manoca 1962 / UTM zone 32N
-<esri2215> +proj=utm +zone=32 +a=6378249.2 +b=6356515 +towgs84=-70.9,-151.8,-41.4,0,0,0,0 +units=m +no_defs  no_defs <>
-# Qornoq 1927 / UTM zone 22N
-<esri2216> +proj=utm +zone=22 +ellps=intl +units=m +no_defs  no_defs <>
-# Qornoq 1927 / UTM zone 23N
-<esri2217> +proj=utm +zone=23 +ellps=intl +units=m +no_defs  no_defs <>
-# ATS77 / UTM zone 19N
-<esri2219> +proj=utm +zone=19 +a=6378135 +b=6356750.304921594 +units=m +no_defs  no_defs <>
-# ATS77 / UTM zone 20N
-<esri2220> +proj=utm +zone=20 +a=6378135 +b=6356750.304921594 +units=m +no_defs  no_defs <>
-# NAD83 / Arizona East (ft)
-<esri2222> +proj=tmerc +lat_0=31 +lon_0=-110.1666666666667 +k=0.999900 +x_0=213360 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048 +no_defs  no_defs <>
-# NAD83 / Arizona Central (ft)
-<esri2223> +proj=tmerc +lat_0=31 +lon_0=-111.9166666666667 +k=0.999900 +x_0=213360 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048 +no_defs  no_defs <>
-# NAD83 / Arizona West (ft)
-<esri2224> +proj=tmerc +lat_0=31 +lon_0=-113.75 +k=0.999933 +x_0=213360 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048 +no_defs  no_defs <>
-# NAD83 / California zone 1 (ftUS)
-<esri2225> +proj=lcc +lat_1=41.66666666666666 +lat_2=40 +lat_0=39.33333333333334 +lon_0=-122 +x_0=2000000.0001016 +y_0=500000.0001016001 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD83 / California zone 2 (ftUS)
-<esri2226> +proj=lcc +lat_1=39.83333333333334 +lat_2=38.33333333333334 +lat_0=37.66666666666666 +lon_0=-122 +x_0=2000000.0001016 +y_0=500000.0001016001 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD83 / California zone 3 (ftUS)
-<esri2227> +proj=lcc +lat_1=38.43333333333333 +lat_2=37.06666666666667 +lat_0=36.5 +lon_0=-120.5 +x_0=2000000.0001016 +y_0=500000.0001016001 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD83 / California zone 4 (ftUS)
-<esri2228> +proj=lcc +lat_1=37.25 +lat_2=36 +lat_0=35.33333333333334 +lon_0=-119 +x_0=2000000.0001016 +y_0=500000.0001016001 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD83 / California zone 5 (ftUS)
-<esri2229> +proj=lcc +lat_1=35.46666666666667 +lat_2=34.03333333333333 +lat_0=33.5 +lon_0=-118 +x_0=2000000.0001016 +y_0=500000.0001016001 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD83 / California zone 6 (ftUS)
-<esri2230> +proj=lcc +lat_1=33.88333333333333 +lat_2=32.78333333333333 +lat_0=32.16666666666666 +lon_0=-116.25 +x_0=2000000.0001016 +y_0=500000.0001016001 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD83 / Colorado North (ftUS)
-<esri2231> +proj=lcc +lat_1=40.78333333333333 +lat_2=39.71666666666667 +lat_0=39.33333333333334 +lon_0=-105.5 +x_0=914401.8288036576 +y_0=304800.6096012192 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD83 / Colorado Central (ftUS)
-<esri2232> +proj=lcc +lat_1=39.75 +lat_2=38.45 +lat_0=37.83333333333334 +lon_0=-105.5 +x_0=914401.8288036576 +y_0=304800.6096012192 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD83 / Colorado South (ftUS)
-<esri2233> +proj=lcc +lat_1=38.43333333333333 +lat_2=37.23333333333333 +lat_0=36.66666666666666 +lon_0=-105.5 +x_0=914401.8288036576 +y_0=304800.6096012192 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD83 / Connecticut (ftUS)
-<esri2234> +proj=lcc +lat_1=41.86666666666667 +lat_2=41.2 +lat_0=40.83333333333334 +lon_0=-72.75 +x_0=304800.6096012192 +y_0=152400.3048006096 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD83 / Delaware (ftUS)
-<esri2235> +proj=tmerc +lat_0=38 +lon_0=-75.41666666666667 +k=0.999995 +x_0=200000.0001016002 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD83 / Florida East (ftUS)
-<esri2236> +proj=tmerc +lat_0=24.33333333333333 +lon_0=-81 +k=0.999941 +x_0=200000.0001016002 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD83 / Florida West (ftUS)
-<esri2237> +proj=tmerc +lat_0=24.33333333333333 +lon_0=-82 +k=0.999941 +x_0=200000.0001016002 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD83 / Florida North (ftUS)
-<esri2238> +proj=lcc +lat_1=30.75 +lat_2=29.58333333333333 +lat_0=29 +lon_0=-84.5 +x_0=600000 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD83 / Georgia East (ftUS)
-<esri2239> +proj=tmerc +lat_0=30 +lon_0=-82.16666666666667 +k=0.999900 +x_0=200000.0001016002 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD83 / Georgia West (ftUS)
-<esri2240> +proj=tmerc +lat_0=30 +lon_0=-84.16666666666667 +k=0.999900 +x_0=699999.9998983998 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD83 / Idaho East (ftUS)
-<esri2241> +proj=tmerc +lat_0=41.66666666666666 +lon_0=-112.1666666666667 +k=0.999947 +x_0=200000.0001016002 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD83 / Idaho Central (ftUS)
-<esri2242> +proj=tmerc +lat_0=41.66666666666666 +lon_0=-114 +k=0.999947 +x_0=500000.0001016001 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD83 / Idaho West (ftUS)
-<esri2243> +proj=tmerc +lat_0=41.66666666666666 +lon_0=-115.75 +k=0.999933 +x_0=800000.0001016001 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD83 / Indiana East (ftUS)
-<esri2244> +proj=tmerc +lat_0=37.5 +lon_0=-85.66666666666667 +k=0.999967 +x_0=99999.99989839978 +y_0=249364.9987299975 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD83 / Indiana West (ftUS)
-<esri2245> +proj=tmerc +lat_0=37.5 +lon_0=-87.08333333333333 +k=0.999967 +x_0=900000 +y_0=249364.9987299975 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD83 / Kentucky North (ftUS)
-<esri2246> +proj=lcc +lat_1=37.96666666666667 +lat_2=38.96666666666667 +lat_0=37.5 +lon_0=-84.25 +x_0=500000.0001016001 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD83 / Kentucky South (ftUS)
-<esri2247> +proj=lcc +lat_1=37.93333333333333 +lat_2=36.73333333333333 +lat_0=36.33333333333334 +lon_0=-85.75 +x_0=500000.0001016001 +y_0=500000.0001016001 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD83 / Maryland (ftUS)
-<esri2248> +proj=lcc +lat_1=39.45 +lat_2=38.3 +lat_0=37.66666666666666 +lon_0=-77 +x_0=399999.9998983998 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD83 / Massachusetts Mainland (ftUS)
-<esri2249> +proj=lcc +lat_1=42.68333333333333 +lat_2=41.71666666666667 +lat_0=41 +lon_0=-71.5 +x_0=200000.0001016002 +y_0=750000 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD83 / Massachusetts Island (ftUS)
-<esri2250> +proj=lcc +lat_1=41.48333333333333 +lat_2=41.28333333333333 +lat_0=41 +lon_0=-70.5 +x_0=500000.0001016001 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD83 / Michigan North (ft)
-<esri2251> +proj=lcc +lat_1=47.08333333333334 +lat_2=45.48333333333333 +lat_0=44.78333333333333 +lon_0=-87 +x_0=7999999.999968001 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048 +no_defs  no_defs <>
-# NAD83 / Michigan Central (ft)
-<esri2252> +proj=lcc +lat_1=45.7 +lat_2=44.18333333333333 +lat_0=43.31666666666667 +lon_0=-84.36666666666666 +x_0=5999999.999976001 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048 +no_defs  no_defs <>
-# NAD83 / Michigan South (ft)
-<esri2253> +proj=lcc +lat_1=43.66666666666666 +lat_2=42.1 +lat_0=41.5 +lon_0=-84.36666666666666 +x_0=3999999.999984 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048 +no_defs  no_defs <>
-# NAD83 / Mississippi East (ftUS)
-<esri2254> +proj=tmerc +lat_0=29.5 +lon_0=-88.83333333333333 +k=0.999950 +x_0=300000.0000000001 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD83 / Mississippi West (ftUS)
-<esri2255> +proj=tmerc +lat_0=29.5 +lon_0=-90.33333333333333 +k=0.999950 +x_0=699999.9998983998 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD83 / Montana (ft)
-<esri2256> +proj=lcc +lat_1=49 +lat_2=45 +lat_0=44.25 +lon_0=-109.5 +x_0=599999.9999976 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048 +no_defs  no_defs <>
-# NAD83 / New Mexico East (ftUS)
-<esri2257> +proj=tmerc +lat_0=31 +lon_0=-104.3333333333333 +k=0.999909 +x_0=165000 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD83 / New Mexico Central (ftUS)
-<esri2258> +proj=tmerc +lat_0=31 +lon_0=-106.25 +k=0.999900 +x_0=500000.0001016001 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD83 / New Mexico West (ftUS)
-<esri2259> +proj=tmerc +lat_0=31 +lon_0=-107.8333333333333 +k=0.999917 +x_0=830000.0001016001 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD83 / New York East (ftUS)
-<esri2260> +proj=tmerc +lat_0=38.83333333333334 +lon_0=-74.5 +k=0.999900 +x_0=150000 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD83 / New York Central (ftUS)
-<esri2261> +proj=tmerc +lat_0=40 +lon_0=-76.58333333333333 +k=0.999938 +x_0=249999.9998983998 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD83 / New York West (ftUS)
-<esri2262> +proj=tmerc +lat_0=40 +lon_0=-78.58333333333333 +k=0.999938 +x_0=350000.0001016001 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD83 / New York Long Island (ftUS)
-<esri2263> +proj=lcc +lat_1=41.03333333333333 +lat_2=40.66666666666666 +lat_0=40.16666666666666 +lon_0=-74 +x_0=300000.0000000001 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD83 / North Carolina (ftUS)
-<esri2264> +proj=lcc +lat_1=36.16666666666666 +lat_2=34.33333333333334 +lat_0=33.75 +lon_0=-79 +x_0=609601.2192024384 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD83 / North Dakota North (ft)
-<esri2265> +proj=lcc +lat_1=48.73333333333333 +lat_2=47.43333333333333 +lat_0=47 +lon_0=-100.5 +x_0=599999.9999976 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048 +no_defs  no_defs <>
-# NAD83 / North Dakota South (ft)
-<esri2266> +proj=lcc +lat_1=47.48333333333333 +lat_2=46.18333333333333 +lat_0=45.66666666666666 +lon_0=-100.5 +x_0=599999.9999976 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048 +no_defs  no_defs <>
-# NAD83 / Oklahoma North (ftUS)
-<esri2267> +proj=lcc +lat_1=36.76666666666667 +lat_2=35.56666666666667 +lat_0=35 +lon_0=-98 +x_0=600000 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD83 / Oklahoma South (ftUS)
-<esri2268> +proj=lcc +lat_1=35.23333333333333 +lat_2=33.93333333333333 +lat_0=33.33333333333334 +lon_0=-98 +x_0=600000 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD83 / Oregon North (ft)
-<esri2269> +proj=lcc +lat_1=46 +lat_2=44.33333333333334 +lat_0=43.66666666666666 +lon_0=-120.5 +x_0=2500000.0001424 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048 +no_defs  no_defs <>
-# NAD83 / Oregon South (ft)
-<esri2270> +proj=lcc +lat_1=44 +lat_2=42.33333333333334 +lat_0=41.66666666666666 +lon_0=-120.5 +x_0=1500000.0001464 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048 +no_defs  no_defs <>
-# NAD83 / Pennsylvania North (ftUS)
-<esri2271> +proj=lcc +lat_1=41.95 +lat_2=40.88333333333333 +lat_0=40.16666666666666 +lon_0=-77.75 +x_0=600000 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD83 / Pennsylvania South (ftUS)
-<esri2272> +proj=lcc +lat_1=40.96666666666667 +lat_2=39.93333333333333 +lat_0=39.33333333333334 +lon_0=-77.75 +x_0=600000 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD83 / South Carolina (ft)
-<esri2273> +proj=lcc +lat_1=34.83333333333334 +lat_2=32.5 +lat_0=31.83333333333333 +lon_0=-81 +x_0=609600 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048 +no_defs  no_defs <>
-# NAD83 / Tennessee (ftUS)
-<esri2274> +proj=lcc +lat_1=36.41666666666666 +lat_2=35.25 +lat_0=34.33333333333334 +lon_0=-86 +x_0=600000 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD83 / Texas North (ftUS)
-<esri2275> +proj=lcc +lat_1=36.18333333333333 +lat_2=34.65 +lat_0=34 +lon_0=-101.5 +x_0=200000.0001016002 +y_0=999999.9998983998 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD83 / Texas North Central (ftUS)
-<esri2276> +proj=lcc +lat_1=33.96666666666667 +lat_2=32.13333333333333 +lat_0=31.66666666666667 +lon_0=-98.5 +x_0=600000 +y_0=2000000.0001016 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD83 / Texas Central (ftUS)
-<esri2277> +proj=lcc +lat_1=31.88333333333333 +lat_2=30.11666666666667 +lat_0=29.66666666666667 +lon_0=-100.3333333333333 +x_0=699999.9998983998 +y_0=3000000 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD83 / Texas South Central (ftUS)
-<esri2278> +proj=lcc +lat_1=30.28333333333333 +lat_2=28.38333333333333 +lat_0=27.83333333333333 +lon_0=-99 +x_0=600000 +y_0=3999999.9998984 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD83 / Texas South (ftUS)
-<esri2279> +proj=lcc +lat_1=27.83333333333333 +lat_2=26.16666666666667 +lat_0=25.66666666666667 +lon_0=-98.5 +x_0=300000.0000000001 +y_0=5000000.0001016 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD83 / Utah North (ft)
-<esri2280> +proj=lcc +lat_1=41.78333333333333 +lat_2=40.71666666666667 +lat_0=40.33333333333334 +lon_0=-111.5 +x_0=500000.0001504 +y_0=999999.9999960001 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048 +no_defs  no_defs <>
-# NAD83 / Utah Central (ft)
-<esri2281> +proj=lcc +lat_1=40.65 +lat_2=39.01666666666667 +lat_0=38.33333333333334 +lon_0=-111.5 +x_0=500000.0001504 +y_0=1999999.999992 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048 +no_defs  no_defs <>
-# NAD83 / Utah South (ft)
-<esri2282> +proj=lcc +lat_1=38.35 +lat_2=37.21666666666667 +lat_0=36.66666666666666 +lon_0=-111.5 +x_0=500000.0001504 +y_0=2999999.999988 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048 +no_defs  no_defs <>
-# NAD83 / Virginia North (ftUS)
-<esri2283> +proj=lcc +lat_1=39.2 +lat_2=38.03333333333333 +lat_0=37.66666666666666 +lon_0=-78.5 +x_0=3500000.0001016 +y_0=2000000.0001016 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD83 / Virginia South (ftUS)
-<esri2284> +proj=lcc +lat_1=37.96666666666667 +lat_2=36.76666666666667 +lat_0=36.33333333333334 +lon_0=-78.5 +x_0=3500000.0001016 +y_0=999999.9998983998 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD83 / Washington North (ftUS)
-<esri2285> +proj=lcc +lat_1=48.73333333333333 +lat_2=47.5 +lat_0=47 +lon_0=-120.8333333333333 +x_0=500000.0001016001 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD83 / Washington South (ftUS)
-<esri2286> +proj=lcc +lat_1=47.33333333333334 +lat_2=45.83333333333334 +lat_0=45.33333333333334 +lon_0=-120.5 +x_0=500000.0001016001 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD83 / Wisconsin North (ftUS)
-<esri2287> +proj=lcc +lat_1=46.76666666666667 +lat_2=45.56666666666667 +lat_0=45.16666666666666 +lon_0=-90 +x_0=600000 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD83 / Wisconsin Central (ftUS)
-<esri2288> +proj=lcc +lat_1=45.5 +lat_2=44.25 +lat_0=43.83333333333334 +lon_0=-90 +x_0=600000 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD83 / Wisconsin South (ftUS)
-<esri2289> +proj=lcc +lat_1=44.06666666666667 +lat_2=42.73333333333333 +lat_0=42 +lon_0=-90 +x_0=600000 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# ATS77 / Prince Edward Isl. Stereographic (ATS77)
-<esri2290> +proj=stere +lat_0=47.25 +lon_0=-63 +k=0.999912 +x_0=700000 +y_0=400000 +a=6378135 +b=6356750.304921594 +units=m +no_defs  no_defs <>
-# NAD83(CSRS98) / Prince Edward Isl. Stereographic (NAD83)
-<esri2291> +proj=stere +lat_0=47.25 +lon_0=-63 +k=0.999912 +x_0=400000 +y_0=800000 +a=6378135 +b=6356750.304921594 +units=m +no_defs  no_defs <>
-# NAD83(CSRS98) / Prince Edward Isl. Stereographic (NAD83)
-<esri2292> +proj=stere +lat_0=47.25 +lon_0=-63 +k=0.999912 +x_0=400000 +y_0=800000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# ATS77 / MTM Nova Scotia zone 4
-<esri2294> +proj=tmerc +lat_0=0 +lon_0=-61.5 +k=0.999900 +x_0=4500000 +y_0=0 +a=6378135 +b=6356750.304921594 +units=m +no_defs  no_defs <>
-# ATS77 / MTM Nova Scotia zone 5
-<esri2295> +proj=tmerc +lat_0=0 +lon_0=-64.5 +k=0.999900 +x_0=5500000 +y_0=0 +a=6378135 +b=6356750.304921594 +units=m +no_defs  no_defs <>
-# Batavia / TM 109 SE
-<esri2308> +proj=tmerc +lat_0=0 +lon_0=109 +k=0.999600 +x_0=500000 +y_0=10000000 +ellps=bessel +units=m +no_defs  no_defs <>
-# WGS 84 / TM 116 SE
-<esri2309> +proj=tmerc +lat_0=0 +lon_0=116 +k=0.999600 +x_0=500000 +y_0=10000000 +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / TM 132 SE
-<esri2310> +proj=tmerc +lat_0=0 +lon_0=132 +k=0.999600 +x_0=500000 +y_0=10000000 +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / TM 6 NE
-<esri2311> +proj=tmerc +lat_0=0 +lon_0=6 +k=0.999600 +x_0=500000 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# Garoua / UTM zone 33N
-<esri2312> +proj=utm +zone=33 +ellps=clrk80 +units=m +no_defs  no_defs <>
-# Kousseri / UTM zone 33N
-<esri2313> +proj=utm +zone=33 +ellps=clrk80 +units=m +no_defs  no_defs <>
-# Trinidad 1903 / Trinidad Grid (ftCla)
-<esri2314> +proj=cass +lat_0=10.44166666666667 +lon_0=-61.33333333333334 +x_0=86501.46380699999 +y_0=65379.01334249999 +a=6378293.63683822 +b=6356617.979337744 +towgs84=-61.702,284.488,472.052,0,0,0,0 +to_meter=0.304797265 +no_defs  no_defs <>
-# Campo Inchauspe / UTM zone 19S
-<esri2315> +proj=utm +zone=19 +south +ellps=intl +units=m +no_defs  no_defs <>
-# Campo Inchauspe / UTM zone 20S
-<esri2316> +proj=utm +zone=20 +south +ellps=intl +units=m +no_defs  no_defs <>
-# PSAD56 / ICN Regional
-<esri2317> +proj=lcc +lat_1=9 +lat_2=3 +lat_0=6 +lon_0=-66 +x_0=1000000 +y_0=1000000 +ellps=intl +units=m +no_defs  no_defs <>
-# Ain el Abd / Aramco Lambert
-<esri2318> +proj=lcc +lat_1=17 +lat_2=33 +lat_0=25.08951 +lon_0=48 +x_0=0 +y_0=0 +ellps=intl +units=m +no_defs  no_defs <>
-# ED50 / TM27
-<esri2319> +proj=tmerc +lat_0=0 +lon_0=27 +k=1.000000 +x_0=500000 +y_0=0 +ellps=intl +units=m +no_defs  no_defs <>
-# ED50 / TM30
-<esri2320> +proj=tmerc +lat_0=0 +lon_0=30 +k=1.000000 +x_0=500000 +y_0=0 +ellps=intl +units=m +no_defs  no_defs <>
-# ED50 / TM33
-<esri2321> +proj=tmerc +lat_0=0 +lon_0=33 +k=1.000000 +x_0=500000 +y_0=0 +ellps=intl +units=m +no_defs  no_defs <>
-# ED50 / TM36
-<esri2322> +proj=tmerc +lat_0=0 +lon_0=36 +k=1.000000 +x_0=500000 +y_0=0 +ellps=intl +units=m +no_defs  no_defs <>
-# ED50 / TM39
-<esri2323> +proj=tmerc +lat_0=0 +lon_0=39 +k=1.000000 +x_0=500000 +y_0=0 +ellps=intl +units=m +no_defs  no_defs <>
-# ED50 / TM42
-<esri2324> +proj=tmerc +lat_0=0 +lon_0=42 +k=1.000000 +x_0=500000 +y_0=0 +ellps=intl +units=m +no_defs  no_defs <>
-# ED50 / TM45
-<esri2325> +proj=tmerc +lat_0=0 +lon_0=45 +k=1.000000 +x_0=500000 +y_0=0 +ellps=intl +units=m +no_defs  no_defs <>
-# Hong Kong 1980 Grid System
-<esri2326> +proj=tmerc +lat_0=22.31213333333334 +lon_0=114.1785555555556 +k=1.000000 +x_0=836694.05 +y_0=819069.8 +ellps=intl +towgs84=-162.619,-276.959,-161.764,0.067753,-2.24365,-1.15883,-1.09425 +units=m +no_defs  no_defs <>
-# Xian 1980 / Gauss-Kruger zone 13
-<esri2327> +proj=tmerc +lat_0=0 +lon_0=75 +k=1.000000 +x_0=13500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  no_defs <>
-# Xian 1980 / Gauss-Kruger zone 14
-<esri2328> +proj=tmerc +lat_0=0 +lon_0=81 +k=1.000000 +x_0=14500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  no_defs <>
-# Xian 1980 / Gauss-Kruger zone 15
-<esri2329> +proj=tmerc +lat_0=0 +lon_0=87 +k=1.000000 +x_0=15500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  no_defs <>
-# Xian 1980 / Gauss-Kruger zone 16
-<esri2330> +proj=tmerc +lat_0=0 +lon_0=93 +k=1.000000 +x_0=16500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  no_defs <>
-# Xian 1980 / Gauss-Kruger zone 17
-<esri2331> +proj=tmerc +lat_0=0 +lon_0=99 +k=1.000000 +x_0=17500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  no_defs <>
-# Xian 1980 / Gauss-Kruger zone 18
-<esri2332> +proj=tmerc +lat_0=0 +lon_0=105 +k=1.000000 +x_0=18500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  no_defs <>
-# Xian 1980 / Gauss-Kruger zone 19
-<esri2333> +proj=tmerc +lat_0=0 +lon_0=111 +k=1.000000 +x_0=19500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  no_defs <>
-# Xian 1980 / Gauss-Kruger zone 20
-<esri2334> +proj=tmerc +lat_0=0 +lon_0=117 +k=1.000000 +x_0=20500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  no_defs <>
-# Xian 1980 / Gauss-Kruger zone 21
-<esri2335> +proj=tmerc +lat_0=0 +lon_0=123 +k=1.000000 +x_0=21500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  no_defs <>
-# Xian 1980 / Gauss-Kruger zone 22
-<esri2336> +proj=tmerc +lat_0=0 +lon_0=129 +k=1.000000 +x_0=22500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  no_defs <>
-# Xian 1980 / Gauss-Kruger zone 23
-<esri2337> +proj=tmerc +lat_0=0 +lon_0=135 +k=1.000000 +x_0=23500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  no_defs <>
-# Xian 1980 / Gauss-Kruger CM 75E
-<esri2338> +proj=tmerc +lat_0=0 +lon_0=75 +k=1.000000 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  no_defs <>
-# Xian 1980 / Gauss-Kruger CM 81E
-<esri2339> +proj=tmerc +lat_0=0 +lon_0=81 +k=1.000000 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  no_defs <>
-# Xian 1980 / Gauss-Kruger CM 87E
-<esri2340> +proj=tmerc +lat_0=0 +lon_0=87 +k=1.000000 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  no_defs <>
-# Xian 1980 / Gauss-Kruger CM 93E
-<esri2341> +proj=tmerc +lat_0=0 +lon_0=93 +k=1.000000 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  no_defs <>
-# Xian 1980 / Gauss-Kruger CM 99E
-<esri2342> +proj=tmerc +lat_0=0 +lon_0=99 +k=1.000000 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  no_defs <>
-# Xian 1980 / Gauss-Kruger CM 105E
-<esri2343> +proj=tmerc +lat_0=0 +lon_0=105 +k=1.000000 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  no_defs <>
-# Xian 1980 / Gauss-Kruger CM 111E
-<esri2344> +proj=tmerc +lat_0=0 +lon_0=111 +k=1.000000 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  no_defs <>
-# Xian 1980 / Gauss-Kruger CM 117E
-<esri2345> +proj=tmerc +lat_0=0 +lon_0=117 +k=1.000000 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  no_defs <>
-# Xian 1980 / Gauss-Kruger CM 123E
-<esri2346> +proj=tmerc +lat_0=0 +lon_0=123 +k=1.000000 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  no_defs <>
-# Xian 1980 / Gauss-Kruger CM 129E
-<esri2347> +proj=tmerc +lat_0=0 +lon_0=129 +k=1.000000 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  no_defs <>
-# Xian 1980 / Gauss-Kruger CM 135E
-<esri2348> +proj=tmerc +lat_0=0 +lon_0=135 +k=1.000000 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  no_defs <>
-# Xian 1980 / 3-degree Gauss-Kruger zone 25
-<esri2349> +proj=tmerc +lat_0=0 +lon_0=75 +k=1.000000 +x_0=25500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  no_defs <>
-# Xian 1980 / 3-degree Gauss-Kruger zone 26
-<esri2350> +proj=tmerc +lat_0=0 +lon_0=78 +k=1.000000 +x_0=26500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  no_defs <>
-# Xian 1980 / 3-degree Gauss-Kruger zone 27
-<esri2351> +proj=tmerc +lat_0=0 +lon_0=81 +k=1.000000 +x_0=27500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  no_defs <>
-# Xian 1980 / 3-degree Gauss-Kruger zone 28
-<esri2352> +proj=tmerc +lat_0=0 +lon_0=84 +k=1.000000 +x_0=28500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  no_defs <>
-# Xian 1980 / 3-degree Gauss-Kruger zone 29
-<esri2353> +proj=tmerc +lat_0=0 +lon_0=87 +k=1.000000 +x_0=29500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  no_defs <>
-# Xian 1980 / 3-degree Gauss-Kruger zone 30
-<esri2354> +proj=tmerc +lat_0=0 +lon_0=90 +k=1.000000 +x_0=30500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  no_defs <>
-# Xian 1980 / 3-degree Gauss-Kruger zone 31
-<esri2355> +proj=tmerc +lat_0=0 +lon_0=93 +k=1.000000 +x_0=31500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  no_defs <>
-# Xian 1980 / 3-degree Gauss-Kruger zone 32
-<esri2356> +proj=tmerc +lat_0=0 +lon_0=96 +k=1.000000 +x_0=32500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  no_defs <>
-# Xian 1980 / 3-degree Gauss-Kruger zone 33
-<esri2357> +proj=tmerc +lat_0=0 +lon_0=99 +k=1.000000 +x_0=33500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  no_defs <>
-# Xian 1980 / 3-degree Gauss-Kruger zone 34
-<esri2358> +proj=tmerc +lat_0=0 +lon_0=102 +k=1.000000 +x_0=34500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  no_defs <>
-# Xian 1980 / 3-degree Gauss-Kruger zone 35
-<esri2359> +proj=tmerc +lat_0=0 +lon_0=105 +k=1.000000 +x_0=35500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  no_defs <>
-# Xian 1980 / 3-degree Gauss-Kruger zone 36
-<esri2360> +proj=tmerc +lat_0=0 +lon_0=108 +k=1.000000 +x_0=36500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  no_defs <>
-# Xian 1980 / 3-degree Gauss-Kruger zone 37
-<esri2361> +proj=tmerc +lat_0=0 +lon_0=111 +k=1.000000 +x_0=37500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  no_defs <>
-# Xian 1980 / 3-degree Gauss-Kruger zone 38
-<esri2362> +proj=tmerc +lat_0=0 +lon_0=114 +k=1.000000 +x_0=38500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  no_defs <>
-# Xian 1980 / 3-degree Gauss-Kruger zone 39
-<esri2363> +proj=tmerc +lat_0=0 +lon_0=117 +k=1.000000 +x_0=39500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  no_defs <>
-# Xian 1980 / 3-degree Gauss-Kruger zone 40
-<esri2364> +proj=tmerc +lat_0=0 +lon_0=120 +k=1.000000 +x_0=40500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  no_defs <>
-# Xian 1980 / 3-degree Gauss-Kruger zone 41
-<esri2365> +proj=tmerc +lat_0=0 +lon_0=123 +k=1.000000 +x_0=41500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  no_defs <>
-# Xian 1980 / 3-degree Gauss-Kruger zone 42
-<esri2366> +proj=tmerc +lat_0=0 +lon_0=126 +k=1.000000 +x_0=42500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  no_defs <>
-# Xian 1980 / 3-degree Gauss-Kruger zone 43
-<esri2367> +proj=tmerc +lat_0=0 +lon_0=129 +k=1.000000 +x_0=43500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  no_defs <>
-# Xian 1980 / 3-degree Gauss-Kruger zone 44
-<esri2368> +proj=tmerc +lat_0=0 +lon_0=132 +k=1.000000 +x_0=44500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  no_defs <>
-# Xian 1980 / 3-degree Gauss-Kruger zone 45
-<esri2369> +proj=tmerc +lat_0=0 +lon_0=135 +k=1.000000 +x_0=45500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  no_defs <>
-# Xian 1980 / 3-degree Gauss-Kruger CM 75E
-<esri2370> +proj=tmerc +lat_0=0 +lon_0=75 +k=1.000000 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  no_defs <>
-# Xian 1980 / 3-degree Gauss-Kruger CM 78E
-<esri2371> +proj=tmerc +lat_0=0 +lon_0=78 +k=1.000000 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  no_defs <>
-# Xian 1980 / 3-degree Gauss-Kruger CM 81E
-<esri2372> +proj=tmerc +lat_0=0 +lon_0=81 +k=1.000000 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  no_defs <>
-# Xian 1980 / 3-degree Gauss-Kruger CM 84E
-<esri2373> +proj=tmerc +lat_0=0 +lon_0=84 +k=1.000000 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  no_defs <>
-# Xian 1980 / 3-degree Gauss-Kruger CM 87E
-<esri2374> +proj=tmerc +lat_0=0 +lon_0=87 +k=1.000000 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  no_defs <>
-# Xian 1980 / 3-degree Gauss-Kruger CM 90E
-<esri2375> +proj=tmerc +lat_0=0 +lon_0=90 +k=1.000000 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  no_defs <>
-# Xian 1980 / 3-degree Gauss-Kruger CM 93E
-<esri2376> +proj=tmerc +lat_0=0 +lon_0=93 +k=1.000000 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  no_defs <>
-# Xian 1980 / 3-degree Gauss-Kruger CM 96E
-<esri2377> +proj=tmerc +lat_0=0 +lon_0=96 +k=1.000000 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  no_defs <>
-# Xian 1980 / 3-degree Gauss-Kruger CM 99E
-<esri2378> +proj=tmerc +lat_0=0 +lon_0=99 +k=1.000000 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  no_defs <>
-# Xian 1980 / 3-degree Gauss-Kruger CM 102E
-<esri2379> +proj=tmerc +lat_0=0 +lon_0=102 +k=1.000000 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  no_defs <>
-# Xian 1980 / 3-degree Gauss-Kruger CM 105E
-<esri2380> +proj=tmerc +lat_0=0 +lon_0=105 +k=1.000000 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  no_defs <>
-# Xian 1980 / 3-degree Gauss-Kruger CM 108E
-<esri2381> +proj=tmerc +lat_0=0 +lon_0=108 +k=1.000000 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  no_defs <>
-# Xian 1980 / 3-degree Gauss-Kruger CM 111E
-<esri2382> +proj=tmerc +lat_0=0 +lon_0=111 +k=1.000000 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  no_defs <>
-# Xian 1980 / 3-degree Gauss-Kruger CM 114E
-<esri2383> +proj=tmerc +lat_0=0 +lon_0=114 +k=1.000000 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  no_defs <>
-# Xian 1980 / 3-degree Gauss-Kruger CM 117E
-<esri2384> +proj=tmerc +lat_0=0 +lon_0=117 +k=1.000000 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  no_defs <>
-# Xian 1980 / 3-degree Gauss-Kruger CM 120E
-<esri2385> +proj=tmerc +lat_0=0 +lon_0=120 +k=1.000000 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  no_defs <>
-# Xian 1980 / 3-degree Gauss-Kruger CM 123E
-<esri2386> +proj=tmerc +lat_0=0 +lon_0=123 +k=1.000000 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  no_defs <>
-# Xian 1980 / 3-degree Gauss-Kruger CM 126E
-<esri2387> +proj=tmerc +lat_0=0 +lon_0=126 +k=1.000000 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  no_defs <>
-# Xian 1980 / 3-degree Gauss-Kruger CM 129E
-<esri2388> +proj=tmerc +lat_0=0 +lon_0=129 +k=1.000000 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  no_defs <>
-# Xian 1980 / 3-degree Gauss-Kruger CM 132E
-<esri2389> +proj=tmerc +lat_0=0 +lon_0=132 +k=1.000000 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  no_defs <>
-# Xian 1980 / 3-degree Gauss-Kruger CM 135E
-<esri2390> +proj=tmerc +lat_0=0 +lon_0=135 +k=1.000000 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs  no_defs <>
-# KKJ / Finland zone 1
-<esri2391> +proj=tmerc +lat_0=0 +lon_0=21 +k=1.000000 +x_0=1500000 +y_0=0 +ellps=intl +towgs84=-90.7,-106.1,-119.2,4.09,0.218,-1.05,1.37 +units=m +no_defs  no_defs <>
-# KKJ / Finland zone 2
-<esri2392> +proj=tmerc +lat_0=0 +lon_0=24 +k=1.000000 +x_0=2500000 +y_0=0 +ellps=intl +towgs84=-90.7,-106.1,-119.2,4.09,0.218,-1.05,1.37 +units=m +no_defs  no_defs <>
-# KKJ / Finland Uniform Coordinate System
-<esri2393> +proj=tmerc +lat_0=0 +lon_0=27 +k=1.000000 +x_0=3500000 +y_0=0 +ellps=intl +towgs84=-90.7,-106.1,-119.2,4.09,0.218,-1.05,1.37 +units=m +no_defs  no_defs <>
-# KKJ / Finland zone 4
-<esri2394> +proj=tmerc +lat_0=0 +lon_0=30 +k=1.000000 +x_0=4500000 +y_0=0 +ellps=intl +towgs84=-90.7,-106.1,-119.2,4.09,0.218,-1.05,1.37 +units=m +no_defs  no_defs <>
-# South Yemen / Gauss-Kruger zone 8
-<esri2395> +proj=tmerc +lat_0=0 +lon_0=45 +k=1.000000 +x_0=8500000 +y_0=0 +ellps=krass +towgs84=-76,-138,67,0,0,0,0 +units=m +no_defs  no_defs <>
-# South Yemen / Gauss-Kruger zone 9
-<esri2396> +proj=tmerc +lat_0=0 +lon_0=51 +k=1.000000 +x_0=9500000 +y_0=0 +ellps=krass +towgs84=-76,-138,67,0,0,0,0 +units=m +no_defs  no_defs <>
-# Pulkovo 1942(83) / Gauss-Kruger zone 3
-<esri2397> +proj=tmerc +lat_0=0 +lon_0=9 +k=1.000000 +x_0=3500000 +y_0=0 +ellps=krass +towgs84=24,-123,-94,0.02,-0.25,-0.13,1.1 +units=m +no_defs  no_defs <>
-# Pulkovo 1942(83) / Gauss-Kruger zone 4
-<esri2398> +proj=tmerc +lat_0=0 +lon_0=12 +k=1.000000 +x_0=4500000 +y_0=0 +ellps=krass +towgs84=24,-123,-94,0.02,-0.25,-0.13,1.1 +units=m +no_defs  no_defs <>
-# Pulkovo 1942(83) / Gauss-Kruger zone 5
-<esri2399> +proj=tmerc +lat_0=0 +lon_0=15 +k=1.000000 +x_0=5500000 +y_0=0 +ellps=krass +towgs84=24,-123,-94,0.02,-0.25,-0.13,1.1 +units=m +no_defs  no_defs <>
-# RT90 2.5 gon W
-<esri2400> +proj=tmerc +lat_0=0 +lon_0=15.80827777777778 +k=1.000000 +x_0=1500000 +y_0=0 +ellps=bessel +units=m +no_defs  no_defs <>
-# Beijing 1954 / 3-degree Gauss-Kruger zone 25
-<esri2401> +proj=tmerc +lat_0=0 +lon_0=75 +k=1.000000 +x_0=25500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Beijing 1954 / 3-degree Gauss-Kruger zone 26
-<esri2402> +proj=tmerc +lat_0=0 +lon_0=78 +k=1.000000 +x_0=26500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Beijing 1954 / 3-degree Gauss-Kruger zone 27
-<esri2403> +proj=tmerc +lat_0=0 +lon_0=81 +k=1.000000 +x_0=27500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Beijing 1954 / 3-degree Gauss-Kruger zone 28
-<esri2404> +proj=tmerc +lat_0=0 +lon_0=84 +k=1.000000 +x_0=28500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Beijing 1954 / 3-degree Gauss-Kruger zone 29
-<esri2405> +proj=tmerc +lat_0=0 +lon_0=87 +k=1.000000 +x_0=29500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Beijing 1954 / 3-degree Gauss-Kruger zone 30
-<esri2406> +proj=tmerc +lat_0=0 +lon_0=90 +k=1.000000 +x_0=30500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Beijing 1954 / 3-degree Gauss-Kruger zone 31
-<esri2407> +proj=tmerc +lat_0=0 +lon_0=93 +k=1.000000 +x_0=31500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Beijing 1954 / 3-degree Gauss-Kruger zone 32
-<esri2408> +proj=tmerc +lat_0=0 +lon_0=96 +k=1.000000 +x_0=32500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Beijing 1954 / 3-degree Gauss-Kruger zone 33
-<esri2409> +proj=tmerc +lat_0=0 +lon_0=99 +k=1.000000 +x_0=33500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Beijing 1954 / 3-degree Gauss-Kruger zone 34
-<esri2410> +proj=tmerc +lat_0=0 +lon_0=102 +k=1.000000 +x_0=34500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Beijing 1954 / 3-degree Gauss-Kruger zone 35
-<esri2411> +proj=tmerc +lat_0=0 +lon_0=105 +k=1.000000 +x_0=35500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Beijing 1954 / 3-degree Gauss-Kruger zone 36
-<esri2412> +proj=tmerc +lat_0=0 +lon_0=108 +k=1.000000 +x_0=36500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Beijing 1954 / 3-degree Gauss-Kruger zone 37
-<esri2413> +proj=tmerc +lat_0=0 +lon_0=111 +k=1.000000 +x_0=37500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Beijing 1954 / 3-degree Gauss-Kruger zone 38
-<esri2414> +proj=tmerc +lat_0=0 +lon_0=114 +k=1.000000 +x_0=38500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Beijing 1954 / 3-degree Gauss-Kruger zone 39
-<esri2415> +proj=tmerc +lat_0=0 +lon_0=117 +k=1.000000 +x_0=39500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Beijing 1954 / 3-degree Gauss-Kruger zone 40
-<esri2416> +proj=tmerc +lat_0=0 +lon_0=120 +k=1.000000 +x_0=40500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Beijing 1954 / 3-degree Gauss-Kruger zone 41
-<esri2417> +proj=tmerc +lat_0=0 +lon_0=123 +k=1.000000 +x_0=41500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Beijing 1954 / 3-degree Gauss-Kruger zone 42
-<esri2418> +proj=tmerc +lat_0=0 +lon_0=126 +k=1.000000 +x_0=42500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Beijing 1954 / 3-degree Gauss-Kruger zone 43
-<esri2419> +proj=tmerc +lat_0=0 +lon_0=129 +k=1.000000 +x_0=43500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Beijing 1954 / 3-degree Gauss-Kruger zone 44
-<esri2420> +proj=tmerc +lat_0=0 +lon_0=132 +k=1.000000 +x_0=44500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Beijing 1954 / 3-degree Gauss-Kruger zone 45
-<esri2421> +proj=tmerc +lat_0=0 +lon_0=135 +k=1.000000 +x_0=45500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Beijing 1954 / 3-degree Gauss-Kruger CM 75E
-<esri2422> +proj=tmerc +lat_0=0 +lon_0=75 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Beijing 1954 / 3-degree Gauss-Kruger CM 78E
-<esri2423> +proj=tmerc +lat_0=0 +lon_0=78 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Beijing 1954 / 3-degree Gauss-Kruger CM 81E
-<esri2424> +proj=tmerc +lat_0=0 +lon_0=81 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Beijing 1954 / 3-degree Gauss-Kruger CM 84E
-<esri2425> +proj=tmerc +lat_0=0 +lon_0=84 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Beijing 1954 / 3-degree Gauss-Kruger CM 87E
-<esri2426> +proj=tmerc +lat_0=0 +lon_0=87 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Beijing 1954 / 3-degree Gauss-Kruger CM 90E
-<esri2427> +proj=tmerc +lat_0=0 +lon_0=90 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Beijing 1954 / 3-degree Gauss-Kruger CM 93E
-<esri2428> +proj=tmerc +lat_0=0 +lon_0=93 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Beijing 1954 / 3-degree Gauss-Kruger CM 96E
-<esri2429> +proj=tmerc +lat_0=0 +lon_0=96 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Beijing 1954 / 3-degree Gauss-Kruger CM 99E
-<esri2430> +proj=tmerc +lat_0=0 +lon_0=99 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Beijing 1954 / 3-degree Gauss-Kruger CM 102E
-<esri2431> +proj=tmerc +lat_0=0 +lon_0=102 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Beijing 1954 / 3-degree Gauss-Kruger CM 105E
-<esri2432> +proj=tmerc +lat_0=0 +lon_0=105 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Beijing 1954 / 3-degree Gauss-Kruger CM 108E
-<esri2433> +proj=tmerc +lat_0=0 +lon_0=108 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Beijing 1954 / 3-degree Gauss-Kruger CM 111E
-<esri2434> +proj=tmerc +lat_0=0 +lon_0=111 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Beijing 1954 / 3-degree Gauss-Kruger CM 114E
-<esri2435> +proj=tmerc +lat_0=0 +lon_0=114 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Beijing 1954 / 3-degree Gauss-Kruger CM 117E
-<esri2436> +proj=tmerc +lat_0=0 +lon_0=117 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Beijing 1954 / 3-degree Gauss-Kruger CM 120E
-<esri2437> +proj=tmerc +lat_0=0 +lon_0=120 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Beijing 1954 / 3-degree Gauss-Kruger CM 123E
-<esri2438> +proj=tmerc +lat_0=0 +lon_0=123 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Beijing 1954 / 3-degree Gauss-Kruger CM 126E
-<esri2439> +proj=tmerc +lat_0=0 +lon_0=126 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Beijing 1954 / 3-degree Gauss-Kruger CM 129E
-<esri2440> +proj=tmerc +lat_0=0 +lon_0=129 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Beijing 1954 / 3-degree Gauss-Kruger CM 132E
-<esri2441> +proj=tmerc +lat_0=0 +lon_0=132 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Beijing 1954 / 3-degree Gauss-Kruger CM 135E
-<esri2442> +proj=tmerc +lat_0=0 +lon_0=135 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# JGD2000 / Japan Plane Rectangular CS I
-<esri2443> +proj=tmerc +lat_0=33 +lon_0=129.5 +k=0.999900 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# JGD2000 / Japan Plane Rectangular CS II
-<esri2444> +proj=tmerc +lat_0=33 +lon_0=131 +k=0.999900 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# JGD2000 / Japan Plane Rectangular CS III
-<esri2445> +proj=tmerc +lat_0=36 +lon_0=132.1666666666667 +k=0.999900 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# JGD2000 / Japan Plane Rectangular CS IV
-<esri2446> +proj=tmerc +lat_0=33 +lon_0=133.5 +k=0.999900 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# JGD2000 / Japan Plane Rectangular CS V
-<esri2447> +proj=tmerc +lat_0=36 +lon_0=134.3333333333333 +k=0.999900 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# JGD2000 / Japan Plane Rectangular CS VI
-<esri2448> +proj=tmerc +lat_0=36 +lon_0=136 +k=0.999900 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# JGD2000 / Japan Plane Rectangular CS VII
-<esri2449> +proj=tmerc +lat_0=36 +lon_0=137.1666666666667 +k=0.999900 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# JGD2000 / Japan Plane Rectangular CS VIII
-<esri2450> +proj=tmerc +lat_0=36 +lon_0=138.5 +k=0.999900 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# JGD2000 / Japan Plane Rectangular CS IX
-<esri2451> +proj=tmerc +lat_0=36 +lon_0=139.8333333333333 +k=0.999900 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# JGD2000 / Japan Plane Rectangular CS X
-<esri2452> +proj=tmerc +lat_0=40 +lon_0=140.8333333333333 +k=0.999900 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# JGD2000 / Japan Plane Rectangular CS XI
-<esri2453> +proj=tmerc +lat_0=44 +lon_0=140.25 +k=0.999900 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# JGD2000 / Japan Plane Rectangular CS XII
-<esri2454> +proj=tmerc +lat_0=44 +lon_0=142.25 +k=0.999900 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# JGD2000 / Japan Plane Rectangular CS XIII
-<esri2455> +proj=tmerc +lat_0=44 +lon_0=144.25 +k=0.999900 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# JGD2000 / Japan Plane Rectangular CS XIV
-<esri2456> +proj=tmerc +lat_0=26 +lon_0=142 +k=0.999900 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# JGD2000 / Japan Plane Rectangular CS XV
-<esri2457> +proj=tmerc +lat_0=26 +lon_0=127.5 +k=0.999900 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# JGD2000 / Japan Plane Rectangular CS XVI
-<esri2458> +proj=tmerc +lat_0=26 +lon_0=124 +k=0.999900 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# JGD2000 / Japan Plane Rectangular CS XVII
-<esri2459> +proj=tmerc +lat_0=26 +lon_0=131 +k=0.999900 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# JGD2000 / Japan Plane Rectangular CS XVIII
-<esri2460> +proj=tmerc +lat_0=20 +lon_0=136 +k=0.999900 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# JGD2000 / Japan Plane Rectangular CS XIX
-<esri2461> +proj=tmerc +lat_0=26 +lon_0=154 +k=0.999900 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# Albanian 1987 / Gauss-Kruger zone 4
-<esri2462> +proj=tmerc +lat_0=0 +lon_0=21 +k=1.000000 +x_0=4500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / Gauss-Kruger CM 21E
-<esri2463> +proj=tmerc +lat_0=0 +lon_0=21 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / Gauss-Kruger CM 27E
-<esri2464> +proj=tmerc +lat_0=0 +lon_0=27 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / Gauss-Kruger CM 33E
-<esri2465> +proj=tmerc +lat_0=0 +lon_0=33 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / Gauss-Kruger CM 39E
-<esri2466> +proj=tmerc +lat_0=0 +lon_0=39 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / Gauss-Kruger CM 45E
-<esri2467> +proj=tmerc +lat_0=0 +lon_0=45 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / Gauss-Kruger CM 51E
-<esri2468> +proj=tmerc +lat_0=0 +lon_0=51 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / Gauss-Kruger CM 57E
-<esri2469> +proj=tmerc +lat_0=0 +lon_0=57 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / Gauss-Kruger CM 63E
-<esri2470> +proj=tmerc +lat_0=0 +lon_0=63 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / Gauss-Kruger CM 69E
-<esri2471> +proj=tmerc +lat_0=0 +lon_0=69 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / Gauss-Kruger CM 75E
-<esri2472> +proj=tmerc +lat_0=0 +lon_0=75 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / Gauss-Kruger CM 81E
-<esri2473> +proj=tmerc +lat_0=0 +lon_0=81 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / Gauss-Kruger CM 87E
-<esri2474> +proj=tmerc +lat_0=0 +lon_0=87 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / Gauss-Kruger CM 93E
-<esri2475> +proj=tmerc +lat_0=0 +lon_0=93 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / Gauss-Kruger CM 99E
-<esri2476> +proj=tmerc +lat_0=0 +lon_0=99 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / Gauss-Kruger CM 105E
-<esri2477> +proj=tmerc +lat_0=0 +lon_0=105 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / Gauss-Kruger CM 111E
-<esri2478> +proj=tmerc +lat_0=0 +lon_0=111 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / Gauss-Kruger CM 117E
-<esri2479> +proj=tmerc +lat_0=0 +lon_0=117 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / Gauss-Kruger CM 123E
-<esri2480> +proj=tmerc +lat_0=0 +lon_0=123 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / Gauss-Kruger CM 129E
-<esri2481> +proj=tmerc +lat_0=0 +lon_0=129 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / Gauss-Kruger CM 135E
-<esri2482> +proj=tmerc +lat_0=0 +lon_0=135 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / Gauss-Kruger CM 141E
-<esri2483> +proj=tmerc +lat_0=0 +lon_0=141 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / Gauss-Kruger CM 147E
-<esri2484> +proj=tmerc +lat_0=0 +lon_0=147 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / Gauss-Kruger CM 153E
-<esri2485> +proj=tmerc +lat_0=0 +lon_0=153 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / Gauss-Kruger CM 159E
-<esri2486> +proj=tmerc +lat_0=0 +lon_0=159 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / Gauss-Kruger CM 165E
-<esri2487> +proj=tmerc +lat_0=0 +lon_0=165 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / Gauss-Kruger CM 171E
-<esri2488> +proj=tmerc +lat_0=0 +lon_0=171 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / Gauss-Kruger CM 177E
-<esri2489> +proj=tmerc +lat_0=0 +lon_0=177 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / Gauss-Kruger CM 177W
-<esri2490> +proj=tmerc +lat_0=0 +lon_0=-177 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / Gauss-Kruger CM 171W
-<esri2491> +proj=tmerc +lat_0=0 +lon_0=-171 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / Gauss-Kruger CM 9E
-<esri2492> +proj=tmerc +lat_0=0 +lon_0=9 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / Gauss-Kruger CM 15E
-<esri2493> +proj=tmerc +lat_0=0 +lon_0=15 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / Gauss-Kruger CM 21E
-<esri2494> +proj=tmerc +lat_0=0 +lon_0=21 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / Gauss-Kruger CM 27E
-<esri2495> +proj=tmerc +lat_0=0 +lon_0=27 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / Gauss-Kruger CM 33E
-<esri2496> +proj=tmerc +lat_0=0 +lon_0=33 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / Gauss-Kruger CM 39E
-<esri2497> +proj=tmerc +lat_0=0 +lon_0=39 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / Gauss-Kruger CM 45E
-<esri2498> +proj=tmerc +lat_0=0 +lon_0=45 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / Gauss-Kruger CM 51E
-<esri2499> +proj=tmerc +lat_0=0 +lon_0=51 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / Gauss-Kruger CM 57E
-<esri2500> +proj=tmerc +lat_0=0 +lon_0=57 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / Gauss-Kruger CM 63E
-<esri2501> +proj=tmerc +lat_0=0 +lon_0=63 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / Gauss-Kruger CM 69E
-<esri2502> +proj=tmerc +lat_0=0 +lon_0=69 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / Gauss-Kruger CM 75E
-<esri2503> +proj=tmerc +lat_0=0 +lon_0=75 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / Gauss-Kruger CM 81E
-<esri2504> +proj=tmerc +lat_0=0 +lon_0=81 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / Gauss-Kruger CM 87E
-<esri2505> +proj=tmerc +lat_0=0 +lon_0=87 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / Gauss-Kruger CM 93E
-<esri2506> +proj=tmerc +lat_0=0 +lon_0=93 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / Gauss-Kruger CM 99E
-<esri2507> +proj=tmerc +lat_0=0 +lon_0=99 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / Gauss-Kruger CM 105E
-<esri2508> +proj=tmerc +lat_0=0 +lon_0=105 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / Gauss-Kruger CM 111E
-<esri2509> +proj=tmerc +lat_0=0 +lon_0=111 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / Gauss-Kruger CM 117E
-<esri2510> +proj=tmerc +lat_0=0 +lon_0=117 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / Gauss-Kruger CM 123E
-<esri2511> +proj=tmerc +lat_0=0 +lon_0=123 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / Gauss-Kruger CM 129E
-<esri2512> +proj=tmerc +lat_0=0 +lon_0=129 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / Gauss-Kruger CM 135E
-<esri2513> +proj=tmerc +lat_0=0 +lon_0=135 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / Gauss-Kruger CM 141E
-<esri2514> +proj=tmerc +lat_0=0 +lon_0=141 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / Gauss-Kruger CM 147E
-<esri2515> +proj=tmerc +lat_0=0 +lon_0=147 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / Gauss-Kruger CM 153E
-<esri2516> +proj=tmerc +lat_0=0 +lon_0=153 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / Gauss-Kruger CM 159E
-<esri2517> +proj=tmerc +lat_0=0 +lon_0=159 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / Gauss-Kruger CM 165E
-<esri2518> +proj=tmerc +lat_0=0 +lon_0=165 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / Gauss-Kruger CM 171E
-<esri2519> +proj=tmerc +lat_0=0 +lon_0=171 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / Gauss-Kruger CM 177E
-<esri2520> +proj=tmerc +lat_0=0 +lon_0=177 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / Gauss-Kruger CM 177W
-<esri2521> +proj=tmerc +lat_0=0 +lon_0=-177 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / Gauss-Kruger CM 171W
-<esri2522> +proj=tmerc +lat_0=0 +lon_0=-171 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger zone 7
-<esri2523> +proj=tmerc +lat_0=0 +lon_0=21 +k=1.000000 +x_0=7500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger zone 8
-<esri2524> +proj=tmerc +lat_0=0 +lon_0=24 +k=1.000000 +x_0=8500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger zone 9
-<esri2525> +proj=tmerc +lat_0=0 +lon_0=27 +k=1.000000 +x_0=9500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger zone 10
-<esri2526> +proj=tmerc +lat_0=0 +lon_0=30 +k=1.000000 +x_0=10500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger zone 11
-<esri2527> +proj=tmerc +lat_0=0 +lon_0=33 +k=1.000000 +x_0=11500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger zone 12
-<esri2528> +proj=tmerc +lat_0=0 +lon_0=36 +k=1.000000 +x_0=12500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger zone 13
-<esri2529> +proj=tmerc +lat_0=0 +lon_0=39 +k=1.000000 +x_0=13500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger zone 14
-<esri2530> +proj=tmerc +lat_0=0 +lon_0=42 +k=1.000000 +x_0=14500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger zone 15
-<esri2531> +proj=tmerc +lat_0=0 +lon_0=45 +k=1.000000 +x_0=15500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger zone 16
-<esri2532> +proj=tmerc +lat_0=0 +lon_0=48 +k=1.000000 +x_0=16500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger zone 17
-<esri2533> +proj=tmerc +lat_0=0 +lon_0=51 +k=1.000000 +x_0=17500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger zone 18
-<esri2534> +proj=tmerc +lat_0=0 +lon_0=54 +k=1.000000 +x_0=18500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger zone 19
-<esri2535> +proj=tmerc +lat_0=0 +lon_0=57 +k=1.000000 +x_0=19500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger zone 20
-<esri2536> +proj=tmerc +lat_0=0 +lon_0=60 +k=1.000000 +x_0=20500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger zone 21
-<esri2537> +proj=tmerc +lat_0=0 +lon_0=63 +k=1.000000 +x_0=21500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger zone 22
-<esri2538> +proj=tmerc +lat_0=0 +lon_0=66 +k=1.000000 +x_0=22500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger zone 23
-<esri2539> +proj=tmerc +lat_0=0 +lon_0=69 +k=1.000000 +x_0=23500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger zone 24
-<esri2540> +proj=tmerc +lat_0=0 +lon_0=72 +k=1.000000 +x_0=24500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger zone 25
-<esri2541> +proj=tmerc +lat_0=0 +lon_0=75 +k=1.000000 +x_0=25500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger zone 26
-<esri2542> +proj=tmerc +lat_0=0 +lon_0=78 +k=1.000000 +x_0=26500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger zone 27
-<esri2543> +proj=tmerc +lat_0=0 +lon_0=81 +k=1.000000 +x_0=27500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger zone 28
-<esri2544> +proj=tmerc +lat_0=0 +lon_0=84 +k=1.000000 +x_0=28500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger zone 29
-<esri2545> +proj=tmerc +lat_0=0 +lon_0=87 +k=1.000000 +x_0=29500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger zone 30
-<esri2546> +proj=tmerc +lat_0=0 +lon_0=90 +k=1.000000 +x_0=30500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger zone 31
-<esri2547> +proj=tmerc +lat_0=0 +lon_0=93 +k=1.000000 +x_0=31500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger zone 32
-<esri2548> +proj=tmerc +lat_0=0 +lon_0=96 +k=1.000000 +x_0=32500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger zone 33
-<esri2549> +proj=tmerc +lat_0=0 +lon_0=99 +k=1.000000 +x_0=33500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Samboja / UTM zone 50S
-<esri2550> +proj=utm +zone=50 +south +ellps=bessel +towgs84=-404.78,685.68,45.47,0,0,0,0 +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger zone 34
-<esri2551> +proj=tmerc +lat_0=0 +lon_0=102 +k=1.000000 +x_0=34500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger zone 35
-<esri2552> +proj=tmerc +lat_0=0 +lon_0=105 +k=1.000000 +x_0=35500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger zone 36
-<esri2553> +proj=tmerc +lat_0=0 +lon_0=108 +k=1.000000 +x_0=36500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger zone 37
-<esri2554> +proj=tmerc +lat_0=0 +lon_0=111 +k=1.000000 +x_0=37500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger zone 38
-<esri2555> +proj=tmerc +lat_0=0 +lon_0=114 +k=1.000000 +x_0=38500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger zone 39
-<esri2556> +proj=tmerc +lat_0=0 +lon_0=117 +k=1.000000 +x_0=39500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger zone 40
-<esri2557> +proj=tmerc +lat_0=0 +lon_0=120 +k=1.000000 +x_0=40500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger zone 41
-<esri2558> +proj=tmerc +lat_0=0 +lon_0=123 +k=1.000000 +x_0=41500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger zone 42
-<esri2559> +proj=tmerc +lat_0=0 +lon_0=126 +k=1.000000 +x_0=42500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger zone 43
-<esri2560> +proj=tmerc +lat_0=0 +lon_0=129 +k=1.000000 +x_0=43500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger zone 44
-<esri2561> +proj=tmerc +lat_0=0 +lon_0=132 +k=1.000000 +x_0=44500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger zone 45
-<esri2562> +proj=tmerc +lat_0=0 +lon_0=135 +k=1.000000 +x_0=45500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger zone 46
-<esri2563> +proj=tmerc +lat_0=0 +lon_0=138 +k=1.000000 +x_0=46500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger zone 47
-<esri2564> +proj=tmerc +lat_0=0 +lon_0=141 +k=1.000000 +x_0=47500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger zone 48
-<esri2565> +proj=tmerc +lat_0=0 +lon_0=144 +k=1.000000 +x_0=48500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger zone 49
-<esri2566> +proj=tmerc +lat_0=0 +lon_0=147 +k=1.000000 +x_0=49500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger zone 50
-<esri2567> +proj=tmerc +lat_0=0 +lon_0=150 +k=1.000000 +x_0=50500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger zone 51
-<esri2568> +proj=tmerc +lat_0=0 +lon_0=153 +k=1.000000 +x_0=51500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger zone 52
-<esri2569> +proj=tmerc +lat_0=0 +lon_0=156 +k=1.000000 +x_0=52500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger zone 53
-<esri2570> +proj=tmerc +lat_0=0 +lon_0=159 +k=1.000000 +x_0=53500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger zone 54
-<esri2571> +proj=tmerc +lat_0=0 +lon_0=162 +k=1.000000 +x_0=54500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger zone 55
-<esri2572> +proj=tmerc +lat_0=0 +lon_0=165 +k=1.000000 +x_0=55500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger zone 56
-<esri2573> +proj=tmerc +lat_0=0 +lon_0=168 +k=1.000000 +x_0=56500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger zone 57
-<esri2574> +proj=tmerc +lat_0=0 +lon_0=171 +k=1.000000 +x_0=57500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger zone 58
-<esri2575> +proj=tmerc +lat_0=0 +lon_0=174 +k=1.000000 +x_0=58500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger zone 59
-<esri2576> +proj=tmerc +lat_0=0 +lon_0=177 +k=1.000000 +x_0=59500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger zone 60
-<esri2577> +proj=tmerc +lat_0=0 +lon_0=180 +k=1.000000 +x_0=60000000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger zone 61
-<esri2578> +proj=tmerc +lat_0=0 +lon_0=-177 +k=1.000000 +x_0=61500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger zone 62
-<esri2579> +proj=tmerc +lat_0=0 +lon_0=-174 +k=1.000000 +x_0=62500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger zone 63
-<esri2580> +proj=tmerc +lat_0=0 +lon_0=-171 +k=1.000000 +x_0=63500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger zone 64
-<esri2581> +proj=tmerc +lat_0=0 +lon_0=-168 +k=1.000000 +x_0=64500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger CM 21E
-<esri2582> +proj=tmerc +lat_0=0 +lon_0=21 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger CM 24E
-<esri2583> +proj=tmerc +lat_0=0 +lon_0=24 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger CM 27E
-<esri2584> +proj=tmerc +lat_0=0 +lon_0=27 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger CM 30E
-<esri2585> +proj=tmerc +lat_0=0 +lon_0=30 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger CM 33E
-<esri2586> +proj=tmerc +lat_0=0 +lon_0=33 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger CM 36E
-<esri2587> +proj=tmerc +lat_0=0 +lon_0=36 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger CM 39E
-<esri2588> +proj=tmerc +lat_0=0 +lon_0=39 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger CM 42E
-<esri2589> +proj=tmerc +lat_0=0 +lon_0=42 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger CM 45E
-<esri2590> +proj=tmerc +lat_0=0 +lon_0=45 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger CM 48E
-<esri2591> +proj=tmerc +lat_0=0 +lon_0=48 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger CM 51E
-<esri2592> +proj=tmerc +lat_0=0 +lon_0=51 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger CM 54E
-<esri2593> +proj=tmerc +lat_0=0 +lon_0=54 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger CM 57E
-<esri2594> +proj=tmerc +lat_0=0 +lon_0=57 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger CM 60E
-<esri2595> +proj=tmerc +lat_0=0 +lon_0=60 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger CM 63E
-<esri2596> +proj=tmerc +lat_0=0 +lon_0=63 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger CM 66E
-<esri2597> +proj=tmerc +lat_0=0 +lon_0=66 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger CM 69E
-<esri2598> +proj=tmerc +lat_0=0 +lon_0=69 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger CM 72E
-<esri2599> +proj=tmerc +lat_0=0 +lon_0=72 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Lietuvos Koordinoei Sistema 1994
-<esri2600> +proj=tmerc +lat_0=0 +lon_0=24 +k=0.999800 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger CM 75E
-<esri2601> +proj=tmerc +lat_0=0 +lon_0=75 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger CM 78E
-<esri2602> +proj=tmerc +lat_0=0 +lon_0=78 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger CM 81E
-<esri2603> +proj=tmerc +lat_0=0 +lon_0=81 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger CM 84E
-<esri2604> +proj=tmerc +lat_0=0 +lon_0=84 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger CM 87E
-<esri2605> +proj=tmerc +lat_0=0 +lon_0=87 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger CM 90E
-<esri2606> +proj=tmerc +lat_0=0 +lon_0=90 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger CM 93E
-<esri2607> +proj=tmerc +lat_0=0 +lon_0=93 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger CM 96E
-<esri2608> +proj=tmerc +lat_0=0 +lon_0=96 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger CM 99E
-<esri2609> +proj=tmerc +lat_0=0 +lon_0=99 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger CM 102E
-<esri2610> +proj=tmerc +lat_0=0 +lon_0=102 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger CM 105E
-<esri2611> +proj=tmerc +lat_0=0 +lon_0=105 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger CM 108E
-<esri2612> +proj=tmerc +lat_0=0 +lon_0=108 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger CM 111E
-<esri2613> +proj=tmerc +lat_0=0 +lon_0=111 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger CM 114E
-<esri2614> +proj=tmerc +lat_0=0 +lon_0=114 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger CM 117E
-<esri2615> +proj=tmerc +lat_0=0 +lon_0=117 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger CM 120E
-<esri2616> +proj=tmerc +lat_0=0 +lon_0=120 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger CM 123E
-<esri2617> +proj=tmerc +lat_0=0 +lon_0=123 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger CM 126E
-<esri2618> +proj=tmerc +lat_0=0 +lon_0=126 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger CM 129E
-<esri2619> +proj=tmerc +lat_0=0 +lon_0=129 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger CM 132E
-<esri2620> +proj=tmerc +lat_0=0 +lon_0=132 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger CM 135E
-<esri2621> +proj=tmerc +lat_0=0 +lon_0=135 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger CM 138E
-<esri2622> +proj=tmerc +lat_0=0 +lon_0=138 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger CM 141E
-<esri2623> +proj=tmerc +lat_0=0 +lon_0=141 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger CM 144E
-<esri2624> +proj=tmerc +lat_0=0 +lon_0=144 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger CM 147E
-<esri2625> +proj=tmerc +lat_0=0 +lon_0=147 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger CM 150E
-<esri2626> +proj=tmerc +lat_0=0 +lon_0=150 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger CM 153E
-<esri2627> +proj=tmerc +lat_0=0 +lon_0=153 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger CM 156E
-<esri2628> +proj=tmerc +lat_0=0 +lon_0=156 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger CM 159E
-<esri2629> +proj=tmerc +lat_0=0 +lon_0=159 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger CM 162E
-<esri2630> +proj=tmerc +lat_0=0 +lon_0=162 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger CM 165E
-<esri2631> +proj=tmerc +lat_0=0 +lon_0=165 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger CM 168E
-<esri2632> +proj=tmerc +lat_0=0 +lon_0=168 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger CM 171E
-<esri2633> +proj=tmerc +lat_0=0 +lon_0=171 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger CM 174E
-<esri2634> +proj=tmerc +lat_0=0 +lon_0=174 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger CM 177E
-<esri2635> +proj=tmerc +lat_0=0 +lon_0=177 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger CM 180E
-<esri2636> +proj=tmerc +lat_0=0 +lon_0=180 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger CM 177W
-<esri2637> +proj=tmerc +lat_0=0 +lon_0=-177 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger CM 174W
-<esri2638> +proj=tmerc +lat_0=0 +lon_0=-174 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger CM 171W
-<esri2639> +proj=tmerc +lat_0=0 +lon_0=-171 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / 3-degree Gauss-Kruger CM 168W
-<esri2640> +proj=tmerc +lat_0=0 +lon_0=-168 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger zone 7
-<esri2641> +proj=tmerc +lat_0=0 +lon_0=21 +k=1.000000 +x_0=7500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger zone 8
-<esri2642> +proj=tmerc +lat_0=0 +lon_0=24 +k=1.000000 +x_0=8500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger zone 9
-<esri2643> +proj=tmerc +lat_0=0 +lon_0=27 +k=1.000000 +x_0=9500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger zone 10
-<esri2644> +proj=tmerc +lat_0=0 +lon_0=30 +k=1.000000 +x_0=10500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger zone 11
-<esri2645> +proj=tmerc +lat_0=0 +lon_0=33 +k=1.000000 +x_0=11500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger zone 12
-<esri2646> +proj=tmerc +lat_0=0 +lon_0=36 +k=1.000000 +x_0=12500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger zone 13
-<esri2647> +proj=tmerc +lat_0=0 +lon_0=39 +k=1.000000 +x_0=13500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger zone 14
-<esri2648> +proj=tmerc +lat_0=0 +lon_0=42 +k=1.000000 +x_0=14500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger zone 15
-<esri2649> +proj=tmerc +lat_0=0 +lon_0=45 +k=1.000000 +x_0=15500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger zone 16
-<esri2650> +proj=tmerc +lat_0=0 +lon_0=48 +k=1.000000 +x_0=16500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger zone 17
-<esri2651> +proj=tmerc +lat_0=0 +lon_0=51 +k=1.000000 +x_0=17500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger zone 18
-<esri2652> +proj=tmerc +lat_0=0 +lon_0=54 +k=1.000000 +x_0=18500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger zone 19
-<esri2653> +proj=tmerc +lat_0=0 +lon_0=57 +k=1.000000 +x_0=19500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger zone 20
-<esri2654> +proj=tmerc +lat_0=0 +lon_0=60 +k=1.000000 +x_0=20500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger zone 21
-<esri2655> +proj=tmerc +lat_0=0 +lon_0=63 +k=1.000000 +x_0=21500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger zone 22
-<esri2656> +proj=tmerc +lat_0=0 +lon_0=66 +k=1.000000 +x_0=22500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger zone 23
-<esri2657> +proj=tmerc +lat_0=0 +lon_0=69 +k=1.000000 +x_0=23500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger zone 24
-<esri2658> +proj=tmerc +lat_0=0 +lon_0=72 +k=1.000000 +x_0=24500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger zone 25
-<esri2659> +proj=tmerc +lat_0=0 +lon_0=75 +k=1.000000 +x_0=25500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger zone 26
-<esri2660> +proj=tmerc +lat_0=0 +lon_0=78 +k=1.000000 +x_0=26500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger zone 27
-<esri2661> +proj=tmerc +lat_0=0 +lon_0=81 +k=1.000000 +x_0=27500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger zone 28
-<esri2662> +proj=tmerc +lat_0=0 +lon_0=84 +k=1.000000 +x_0=28500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger zone 29
-<esri2663> +proj=tmerc +lat_0=0 +lon_0=87 +k=1.000000 +x_0=29500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger zone 30
-<esri2664> +proj=tmerc +lat_0=0 +lon_0=90 +k=1.000000 +x_0=30500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger zone 31
-<esri2665> +proj=tmerc +lat_0=0 +lon_0=93 +k=1.000000 +x_0=31500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger zone 32
-<esri2666> +proj=tmerc +lat_0=0 +lon_0=96 +k=1.000000 +x_0=32500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger zone 33
-<esri2667> +proj=tmerc +lat_0=0 +lon_0=99 +k=1.000000 +x_0=33500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger zone 34
-<esri2668> +proj=tmerc +lat_0=0 +lon_0=102 +k=1.000000 +x_0=34500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger zone 35
-<esri2669> +proj=tmerc +lat_0=0 +lon_0=105 +k=1.000000 +x_0=35500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger zone 36
-<esri2670> +proj=tmerc +lat_0=0 +lon_0=108 +k=1.000000 +x_0=36500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger zone 37
-<esri2671> +proj=tmerc +lat_0=0 +lon_0=111 +k=1.000000 +x_0=37500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger zone 38
-<esri2672> +proj=tmerc +lat_0=0 +lon_0=114 +k=1.000000 +x_0=38500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger zone 39
-<esri2673> +proj=tmerc +lat_0=0 +lon_0=117 +k=1.000000 +x_0=39500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger zone 40
-<esri2674> +proj=tmerc +lat_0=0 +lon_0=120 +k=1.000000 +x_0=40500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger zone 41
-<esri2675> +proj=tmerc +lat_0=0 +lon_0=123 +k=1.000000 +x_0=41500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger zone 42
-<esri2676> +proj=tmerc +lat_0=0 +lon_0=126 +k=1.000000 +x_0=42500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger zone 43
-<esri2677> +proj=tmerc +lat_0=0 +lon_0=129 +k=1.000000 +x_0=43500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger zone 44
-<esri2678> +proj=tmerc +lat_0=0 +lon_0=132 +k=1.000000 +x_0=44500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger zone 45
-<esri2679> +proj=tmerc +lat_0=0 +lon_0=135 +k=1.000000 +x_0=45500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger zone 46
-<esri2680> +proj=tmerc +lat_0=0 +lon_0=138 +k=1.000000 +x_0=46500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger zone 47
-<esri2681> +proj=tmerc +lat_0=0 +lon_0=141 +k=1.000000 +x_0=47500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger zone 48
-<esri2682> +proj=tmerc +lat_0=0 +lon_0=144 +k=1.000000 +x_0=48500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger zone 49
-<esri2683> +proj=tmerc +lat_0=0 +lon_0=147 +k=1.000000 +x_0=49500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger zone 50
-<esri2684> +proj=tmerc +lat_0=0 +lon_0=150 +k=1.000000 +x_0=50500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger zone 51
-<esri2685> +proj=tmerc +lat_0=0 +lon_0=153 +k=1.000000 +x_0=51500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger zone 52
-<esri2686> +proj=tmerc +lat_0=0 +lon_0=156 +k=1.000000 +x_0=52500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger zone 53
-<esri2687> +proj=tmerc +lat_0=0 +lon_0=159 +k=1.000000 +x_0=53500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger zone 54
-<esri2688> +proj=tmerc +lat_0=0 +lon_0=162 +k=1.000000 +x_0=54500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger zone 55
-<esri2689> +proj=tmerc +lat_0=0 +lon_0=165 +k=1.000000 +x_0=55500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger zone 56
-<esri2690> +proj=tmerc +lat_0=0 +lon_0=168 +k=1.000000 +x_0=56500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger zone 57
-<esri2691> +proj=tmerc +lat_0=0 +lon_0=171 +k=1.000000 +x_0=57500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger zone 58
-<esri2692> +proj=tmerc +lat_0=0 +lon_0=174 +k=1.000000 +x_0=58500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger zone 59
-<esri2693> +proj=tmerc +lat_0=0 +lon_0=177 +k=1.000000 +x_0=59500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger zone 60
-<esri2694> +proj=tmerc +lat_0=0 +lon_0=180 +k=1.000000 +x_0=60000000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger zone 61
-<esri2695> +proj=tmerc +lat_0=0 +lon_0=-177 +k=1.000000 +x_0=61500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger zone 62
-<esri2696> +proj=tmerc +lat_0=0 +lon_0=-174 +k=1.000000 +x_0=62500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger zone 63
-<esri2697> +proj=tmerc +lat_0=0 +lon_0=-171 +k=1.000000 +x_0=63500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger zone 64
-<esri2698> +proj=tmerc +lat_0=0 +lon_0=-168 +k=1.000000 +x_0=64500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger CM 21E
-<esri2699> +proj=tmerc +lat_0=0 +lon_0=21 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger CM 24E
-<esri2700> +proj=tmerc +lat_0=0 +lon_0=24 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger CM 27E
-<esri2701> +proj=tmerc +lat_0=0 +lon_0=27 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger CM 30E
-<esri2702> +proj=tmerc +lat_0=0 +lon_0=30 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger CM 33E
-<esri2703> +proj=tmerc +lat_0=0 +lon_0=33 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger CM 36E
-<esri2704> +proj=tmerc +lat_0=0 +lon_0=36 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger CM 39E
-<esri2705> +proj=tmerc +lat_0=0 +lon_0=39 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger CM 42E
-<esri2706> +proj=tmerc +lat_0=0 +lon_0=42 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger CM 45E
-<esri2707> +proj=tmerc +lat_0=0 +lon_0=45 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger CM 48E
-<esri2708> +proj=tmerc +lat_0=0 +lon_0=48 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger CM 51E
-<esri2709> +proj=tmerc +lat_0=0 +lon_0=51 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger CM 54E
-<esri2710> +proj=tmerc +lat_0=0 +lon_0=54 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger CM 57E
-<esri2711> +proj=tmerc +lat_0=0 +lon_0=57 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger CM 60E
-<esri2712> +proj=tmerc +lat_0=0 +lon_0=60 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger CM 63E
-<esri2713> +proj=tmerc +lat_0=0 +lon_0=63 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger CM 66E
-<esri2714> +proj=tmerc +lat_0=0 +lon_0=66 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger CM 69E
-<esri2715> +proj=tmerc +lat_0=0 +lon_0=69 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger CM 72E
-<esri2716> +proj=tmerc +lat_0=0 +lon_0=72 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger CM 75E
-<esri2717> +proj=tmerc +lat_0=0 +lon_0=75 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger CM 78E
-<esri2718> +proj=tmerc +lat_0=0 +lon_0=78 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger CM 81E
-<esri2719> +proj=tmerc +lat_0=0 +lon_0=81 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger CM 84E
-<esri2720> +proj=tmerc +lat_0=0 +lon_0=84 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger CM 87E
-<esri2721> +proj=tmerc +lat_0=0 +lon_0=87 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger CM 90E
-<esri2722> +proj=tmerc +lat_0=0 +lon_0=90 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger CM 93E
-<esri2723> +proj=tmerc +lat_0=0 +lon_0=93 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger CM 96E
-<esri2724> +proj=tmerc +lat_0=0 +lon_0=96 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger CM 99E
-<esri2725> +proj=tmerc +lat_0=0 +lon_0=99 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger CM 102E
-<esri2726> +proj=tmerc +lat_0=0 +lon_0=102 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger CM 105E
-<esri2727> +proj=tmerc +lat_0=0 +lon_0=105 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger CM 108E
-<esri2728> +proj=tmerc +lat_0=0 +lon_0=108 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger CM 111E
-<esri2729> +proj=tmerc +lat_0=0 +lon_0=111 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger CM 114E
-<esri2730> +proj=tmerc +lat_0=0 +lon_0=114 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger CM 117E
-<esri2731> +proj=tmerc +lat_0=0 +lon_0=117 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger CM 120E
-<esri2732> +proj=tmerc +lat_0=0 +lon_0=120 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger CM 123E
-<esri2733> +proj=tmerc +lat_0=0 +lon_0=123 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger CM 126E
-<esri2734> +proj=tmerc +lat_0=0 +lon_0=126 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger CM 129E
-<esri2735> +proj=tmerc +lat_0=0 +lon_0=129 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Tete / UTM zone 36S
-<esri2736> +proj=utm +zone=36 +south +ellps=clrk66 +units=m +no_defs  no_defs <>
-# Tete / UTM zone 37S
-<esri2737> +proj=utm +zone=37 +south +ellps=clrk66 +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger CM 132E
-<esri2738> +proj=tmerc +lat_0=0 +lon_0=132 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger CM 135E
-<esri2739> +proj=tmerc +lat_0=0 +lon_0=135 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger CM 138E
-<esri2740> +proj=tmerc +lat_0=0 +lon_0=138 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger CM 141E
-<esri2741> +proj=tmerc +lat_0=0 +lon_0=141 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger CM 144E
-<esri2742> +proj=tmerc +lat_0=0 +lon_0=144 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger CM 147E
-<esri2743> +proj=tmerc +lat_0=0 +lon_0=147 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger CM 150E
-<esri2744> +proj=tmerc +lat_0=0 +lon_0=150 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger CM 153E
-<esri2745> +proj=tmerc +lat_0=0 +lon_0=153 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger CM 156E
-<esri2746> +proj=tmerc +lat_0=0 +lon_0=156 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger CM 159E
-<esri2747> +proj=tmerc +lat_0=0 +lon_0=159 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger CM 162E
-<esri2748> +proj=tmerc +lat_0=0 +lon_0=162 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger CM 165E
-<esri2749> +proj=tmerc +lat_0=0 +lon_0=165 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger CM 168E
-<esri2750> +proj=tmerc +lat_0=0 +lon_0=168 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger CM 171E
-<esri2751> +proj=tmerc +lat_0=0 +lon_0=171 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger CM 174E
-<esri2752> +proj=tmerc +lat_0=0 +lon_0=174 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger CM 177E
-<esri2753> +proj=tmerc +lat_0=0 +lon_0=177 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger CM 180E
-<esri2754> +proj=tmerc +lat_0=0 +lon_0=180 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger CM 177W
-<esri2755> +proj=tmerc +lat_0=0 +lon_0=-177 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger CM 174W
-<esri2756> +proj=tmerc +lat_0=0 +lon_0=-174 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger CM 171W
-<esri2757> +proj=tmerc +lat_0=0 +lon_0=-171 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / 3-degree Gauss-Kruger CM 168W
-<esri2758> +proj=tmerc +lat_0=0 +lon_0=-168 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# NAD83(HARN) / Alabama East
-<esri2759> +proj=tmerc +lat_0=30.5 +lon_0=-85.83333333333333 +k=0.999960 +x_0=200000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(HARN) / Alabama West
-<esri2760> +proj=tmerc +lat_0=30 +lon_0=-87.5 +k=0.999933 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(HARN) / Arizona East
-<esri2761> +proj=tmerc +lat_0=31 +lon_0=-110.1666666666667 +k=0.999900 +x_0=213360 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(HARN) / Arizona Central
-<esri2762> +proj=tmerc +lat_0=31 +lon_0=-111.9166666666667 +k=0.999900 +x_0=213360 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(HARN) / Arizona West
-<esri2763> +proj=tmerc +lat_0=31 +lon_0=-113.75 +k=0.999933 +x_0=213360 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(HARN) / Arkansas North
-<esri2764> +proj=lcc +lat_1=36.23333333333333 +lat_2=34.93333333333333 +lat_0=34.33333333333334 +lon_0=-92 +x_0=400000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(HARN) / Arkansas South
-<esri2765> +proj=lcc +lat_1=34.76666666666667 +lat_2=33.3 +lat_0=32.66666666666666 +lon_0=-92 +x_0=400000 +y_0=400000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(HARN) / California zone 1
-<esri2766> +proj=lcc +lat_1=41.66666666666666 +lat_2=40 +lat_0=39.33333333333334 +lon_0=-122 +x_0=2000000 +y_0=500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(HARN) / California zone 2
-<esri2767> +proj=lcc +lat_1=39.83333333333334 +lat_2=38.33333333333334 +lat_0=37.66666666666666 +lon_0=-122 +x_0=2000000 +y_0=500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(HARN) / California zone 3
-<esri2768> +proj=lcc +lat_1=38.43333333333333 +lat_2=37.06666666666667 +lat_0=36.5 +lon_0=-120.5 +x_0=2000000 +y_0=500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(HARN) / California zone 4
-<esri2769> +proj=lcc +lat_1=37.25 +lat_2=36 +lat_0=35.33333333333334 +lon_0=-119 +x_0=2000000 +y_0=500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(HARN) / California zone 5
-<esri2770> +proj=lcc +lat_1=35.46666666666667 +lat_2=34.03333333333333 +lat_0=33.5 +lon_0=-118 +x_0=2000000 +y_0=500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(HARN) / California zone 6
-<esri2771> +proj=lcc +lat_1=33.88333333333333 +lat_2=32.78333333333333 +lat_0=32.16666666666666 +lon_0=-116.25 +x_0=2000000 +y_0=500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(HARN) / Colorado North
-<esri2772> +proj=lcc +lat_1=40.78333333333333 +lat_2=39.71666666666667 +lat_0=39.33333333333334 +lon_0=-105.5 +x_0=914401.8289 +y_0=304800.6096 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(HARN) / Colorado Central
-<esri2773> +proj=lcc +lat_1=39.75 +lat_2=38.45 +lat_0=37.83333333333334 +lon_0=-105.5 +x_0=914401.8289 +y_0=304800.6096 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(HARN) / Colorado South
-<esri2774> +proj=lcc +lat_1=38.43333333333333 +lat_2=37.23333333333333 +lat_0=36.66666666666666 +lon_0=-105.5 +x_0=914401.8289 +y_0=304800.6096 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(HARN) / Connecticut
-<esri2775> +proj=lcc +lat_1=41.86666666666667 +lat_2=41.2 +lat_0=40.83333333333334 +lon_0=-72.75 +x_0=304800.6096 +y_0=152400.3048 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(HARN) / Delaware
-<esri2776> +proj=tmerc +lat_0=38 +lon_0=-75.41666666666667 +k=0.999995 +x_0=200000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(HARN) / Florida East
-<esri2777> +proj=tmerc +lat_0=24.33333333333333 +lon_0=-81 +k=0.999941 +x_0=200000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(HARN) / Florida West
-<esri2778> +proj=tmerc +lat_0=24.33333333333333 +lon_0=-82 +k=0.999941 +x_0=200000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(HARN) / Florida North
-<esri2779> +proj=lcc +lat_1=30.75 +lat_2=29.58333333333333 +lat_0=29 +lon_0=-84.5 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(HARN) / Georgia East
-<esri2780> +proj=tmerc +lat_0=30 +lon_0=-82.16666666666667 +k=0.999900 +x_0=200000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(HARN) / Georgia West
-<esri2781> +proj=tmerc +lat_0=30 +lon_0=-84.16666666666667 +k=0.999900 +x_0=700000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(HARN) / Hawaii zone 1
-<esri2782> +proj=tmerc +lat_0=18.83333333333333 +lon_0=-155.5 +k=0.999967 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(HARN) / Hawaii zone 2
-<esri2783> +proj=tmerc +lat_0=20.33333333333333 +lon_0=-156.6666666666667 +k=0.999967 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(HARN) / Hawaii zone 3
-<esri2784> +proj=tmerc +lat_0=21.16666666666667 +lon_0=-158 +k=0.999990 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(HARN) / Hawaii zone 4
-<esri2785> +proj=tmerc +lat_0=21.83333333333333 +lon_0=-159.5 +k=0.999990 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(HARN) / Hawaii zone 5
-<esri2786> +proj=tmerc +lat_0=21.66666666666667 +lon_0=-160.1666666666667 +k=1.000000 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(HARN) / Idaho East
-<esri2787> +proj=tmerc +lat_0=41.66666666666666 +lon_0=-112.1666666666667 +k=0.999947 +x_0=200000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(HARN) / Idaho Central
-<esri2788> +proj=tmerc +lat_0=41.66666666666666 +lon_0=-114 +k=0.999947 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(HARN) / Idaho West
-<esri2789> +proj=tmerc +lat_0=41.66666666666666 +lon_0=-115.75 +k=0.999933 +x_0=800000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(HARN) / Illinois East
-<esri2790> +proj=tmerc +lat_0=36.66666666666666 +lon_0=-88.33333333333333 +k=0.999975 +x_0=300000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(HARN) / Illinois West
-<esri2791> +proj=tmerc +lat_0=36.66666666666666 +lon_0=-90.16666666666667 +k=0.999941 +x_0=700000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(HARN) / Indiana East
-<esri2792> +proj=tmerc +lat_0=37.5 +lon_0=-85.66666666666667 +k=0.999967 +x_0=100000 +y_0=250000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(HARN) / Indiana West
-<esri2793> +proj=tmerc +lat_0=37.5 +lon_0=-87.08333333333333 +k=0.999967 +x_0=900000 +y_0=250000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(HARN) / Iowa North
-<esri2794> +proj=lcc +lat_1=43.26666666666667 +lat_2=42.06666666666667 +lat_0=41.5 +lon_0=-93.5 +x_0=1500000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(HARN) / Iowa South
-<esri2795> +proj=lcc +lat_1=41.78333333333333 +lat_2=40.61666666666667 +lat_0=40 +lon_0=-93.5 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(HARN) / Kansas North
-<esri2796> +proj=lcc +lat_1=39.78333333333333 +lat_2=38.71666666666667 +lat_0=38.33333333333334 +lon_0=-98 +x_0=400000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(HARN) / Kansas South
-<esri2797> +proj=lcc +lat_1=38.56666666666667 +lat_2=37.26666666666667 +lat_0=36.66666666666666 +lon_0=-98.5 +x_0=400000 +y_0=400000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(HARN) / Kentucky North
-<esri2798> +proj=lcc +lat_1=37.96666666666667 +lat_2=38.96666666666667 +lat_0=37.5 +lon_0=-84.25 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(HARN) / Kentucky South
-<esri2799> +proj=lcc +lat_1=37.93333333333333 +lat_2=36.73333333333333 +lat_0=36.33333333333334 +lon_0=-85.75 +x_0=500000 +y_0=500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(HARN) / Louisiana North
-<esri2800> +proj=lcc +lat_1=32.66666666666666 +lat_2=31.16666666666667 +lat_0=30.5 +lon_0=-92.5 +x_0=1000000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(HARN) / Louisiana South
-<esri2801> +proj=lcc +lat_1=30.7 +lat_2=29.3 +lat_0=28.5 +lon_0=-91.33333333333333 +x_0=1000000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(HARN) / Maine East
-<esri2802> +proj=tmerc +lat_0=43.66666666666666 +lon_0=-68.5 +k=0.999900 +x_0=300000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(HARN) / Maine West
-<esri2803> +proj=tmerc +lat_0=42.83333333333334 +lon_0=-70.16666666666667 +k=0.999967 +x_0=900000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(HARN) / Maryland
-<esri2804> +proj=lcc +lat_1=39.45 +lat_2=38.3 +lat_0=37.66666666666666 +lon_0=-77 +x_0=400000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(HARN) / Massachusetts Mainland
-<esri2805> +proj=lcc +lat_1=42.68333333333333 +lat_2=41.71666666666667 +lat_0=41 +lon_0=-71.5 +x_0=200000 +y_0=750000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(HARN) / Massachusetts Island
-<esri2806> +proj=lcc +lat_1=41.48333333333333 +lat_2=41.28333333333333 +lat_0=41 +lon_0=-70.5 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(HARN) / Michigan North
-<esri2807> +proj=lcc +lat_1=47.08333333333334 +lat_2=45.48333333333333 +lat_0=44.78333333333333 +lon_0=-87 +x_0=8000000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(HARN) / Michigan Central
-<esri2808> +proj=lcc +lat_1=45.7 +lat_2=44.18333333333333 +lat_0=43.31666666666667 +lon_0=-84.36666666666666 +x_0=6000000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(HARN) / Michigan South
-<esri2809> +proj=lcc +lat_1=43.66666666666666 +lat_2=42.1 +lat_0=41.5 +lon_0=-84.36666666666666 +x_0=4000000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(HARN) / Minnesota North
-<esri2810> +proj=lcc +lat_1=48.63333333333333 +lat_2=47.03333333333333 +lat_0=46.5 +lon_0=-93.09999999999999 +x_0=800000 +y_0=100000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(HARN) / Minnesota Central
-<esri2811> +proj=lcc +lat_1=47.05 +lat_2=45.61666666666667 +lat_0=45 +lon_0=-94.25 +x_0=800000 +y_0=100000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(HARN) / Minnesota South
-<esri2812> +proj=lcc +lat_1=45.21666666666667 +lat_2=43.78333333333333 +lat_0=43 +lon_0=-94 +x_0=800000 +y_0=100000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(HARN) / Mississippi East
-<esri2813> +proj=tmerc +lat_0=29.5 +lon_0=-88.83333333333333 +k=0.999950 +x_0=300000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(HARN) / Mississippi West
-<esri2814> +proj=tmerc +lat_0=29.5 +lon_0=-90.33333333333333 +k=0.999950 +x_0=700000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(HARN) / Missouri East
-<esri2815> +proj=tmerc +lat_0=35.83333333333334 +lon_0=-90.5 +k=0.999933 +x_0=250000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(HARN) / Missouri Central
-<esri2816> +proj=tmerc +lat_0=35.83333333333334 +lon_0=-92.5 +k=0.999933 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(HARN) / Missouri West
-<esri2817> +proj=tmerc +lat_0=36.16666666666666 +lon_0=-94.5 +k=0.999941 +x_0=850000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(HARN) / Montana
-<esri2818> +proj=lcc +lat_1=49 +lat_2=45 +lat_0=44.25 +lon_0=-109.5 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(HARN) / Nebraska
-<esri2819> +proj=lcc +lat_1=43 +lat_2=40 +lat_0=39.83333333333334 +lon_0=-100 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(HARN) / Nevada East
-<esri2820> +proj=tmerc +lat_0=34.75 +lon_0=-115.5833333333333 +k=0.999900 +x_0=200000 +y_0=8000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(HARN) / Nevada Central
-<esri2821> +proj=tmerc +lat_0=34.75 +lon_0=-116.6666666666667 +k=0.999900 +x_0=500000 +y_0=6000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(HARN) / Nevada West
-<esri2822> +proj=tmerc +lat_0=34.75 +lon_0=-118.5833333333333 +k=0.999900 +x_0=800000 +y_0=4000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(HARN) / New Hampshire
-<esri2823> +proj=tmerc +lat_0=42.5 +lon_0=-71.66666666666667 +k=0.999967 +x_0=300000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(HARN) / New Jersey
-<esri2824> +proj=tmerc +lat_0=38.83333333333334 +lon_0=-74.5 +k=0.999900 +x_0=150000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(HARN) / New Mexico East
-<esri2825> +proj=tmerc +lat_0=31 +lon_0=-104.3333333333333 +k=0.999909 +x_0=165000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(HARN) / New Mexico Central
-<esri2826> +proj=tmerc +lat_0=31 +lon_0=-106.25 +k=0.999900 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(HARN) / New Mexico West
-<esri2827> +proj=tmerc +lat_0=31 +lon_0=-107.8333333333333 +k=0.999917 +x_0=830000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(HARN) / New York East
-<esri2828> +proj=tmerc +lat_0=38.83333333333334 +lon_0=-74.5 +k=0.999900 +x_0=150000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(HARN) / New York Central
-<esri2829> +proj=tmerc +lat_0=40 +lon_0=-76.58333333333333 +k=0.999938 +x_0=250000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(HARN) / New York West
-<esri2830> +proj=tmerc +lat_0=40 +lon_0=-78.58333333333333 +k=0.999938 +x_0=350000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(HARN) / New York Long Island
-<esri2831> +proj=lcc +lat_1=41.03333333333333 +lat_2=40.66666666666666 +lat_0=40.16666666666666 +lon_0=-74 +x_0=300000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(HARN) / North Dakota North
-<esri2832> +proj=lcc +lat_1=48.73333333333333 +lat_2=47.43333333333333 +lat_0=47 +lon_0=-100.5 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(HARN) / North Dakota South
-<esri2833> +proj=lcc +lat_1=47.48333333333333 +lat_2=46.18333333333333 +lat_0=45.66666666666666 +lon_0=-100.5 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(HARN) / Ohio North
-<esri2834> +proj=lcc +lat_1=41.7 +lat_2=40.43333333333333 +lat_0=39.66666666666666 +lon_0=-82.5 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(HARN) / Ohio South
-<esri2835> +proj=lcc +lat_1=40.03333333333333 +lat_2=38.73333333333333 +lat_0=38 +lon_0=-82.5 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(HARN) / Oklahoma North
-<esri2836> +proj=lcc +lat_1=36.76666666666667 +lat_2=35.56666666666667 +lat_0=35 +lon_0=-98 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(HARN) / Oklahoma South
-<esri2837> +proj=lcc +lat_1=35.23333333333333 +lat_2=33.93333333333333 +lat_0=33.33333333333334 +lon_0=-98 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(HARN) / Oregon North
-<esri2838> +proj=lcc +lat_1=46 +lat_2=44.33333333333334 +lat_0=43.66666666666666 +lon_0=-120.5 +x_0=2500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(HARN) / Oregon South
-<esri2839> +proj=lcc +lat_1=44 +lat_2=42.33333333333334 +lat_0=41.66666666666666 +lon_0=-120.5 +x_0=1500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(HARN) / Rhode Island
-<esri2840> +proj=tmerc +lat_0=41.08333333333334 +lon_0=-71.5 +k=0.999994 +x_0=100000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(HARN) / South Dakota North
-<esri2841> +proj=lcc +lat_1=45.68333333333333 +lat_2=44.41666666666666 +lat_0=43.83333333333334 +lon_0=-100 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(HARN) / South Dakota South
-<esri2842> +proj=lcc +lat_1=44.4 +lat_2=42.83333333333334 +lat_0=42.33333333333334 +lon_0=-100.3333333333333 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(HARN) / Tennessee
-<esri2843> +proj=lcc +lat_1=36.41666666666666 +lat_2=35.25 +lat_0=34.33333333333334 +lon_0=-86 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(HARN) / Texas North
-<esri2844> +proj=lcc +lat_1=36.18333333333333 +lat_2=34.65 +lat_0=34 +lon_0=-101.5 +x_0=200000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(HARN) / Texas North Central
-<esri2845> +proj=lcc +lat_1=33.96666666666667 +lat_2=32.13333333333333 +lat_0=31.66666666666667 +lon_0=-98.5 +x_0=600000 +y_0=2000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(HARN) / Texas Central
-<esri2846> +proj=lcc +lat_1=31.88333333333333 +lat_2=30.11666666666667 +lat_0=29.66666666666667 +lon_0=-100.3333333333333 +x_0=700000 +y_0=3000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(HARN) / Texas South Central
-<esri2847> +proj=lcc +lat_1=30.28333333333333 +lat_2=28.38333333333333 +lat_0=27.83333333333333 +lon_0=-99 +x_0=600000 +y_0=4000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(HARN) / Texas South
-<esri2848> +proj=lcc +lat_1=27.83333333333333 +lat_2=26.16666666666667 +lat_0=25.66666666666667 +lon_0=-98.5 +x_0=300000 +y_0=5000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(HARN) / Utah North
-<esri2849> +proj=lcc +lat_1=41.78333333333333 +lat_2=40.71666666666667 +lat_0=40.33333333333334 +lon_0=-111.5 +x_0=500000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(HARN) / Utah Central
-<esri2850> +proj=lcc +lat_1=40.65 +lat_2=39.01666666666667 +lat_0=38.33333333333334 +lon_0=-111.5 +x_0=500000 +y_0=2000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(HARN) / Utah South
-<esri2851> +proj=lcc +lat_1=38.35 +lat_2=37.21666666666667 +lat_0=36.66666666666666 +lon_0=-111.5 +x_0=500000 +y_0=3000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(HARN) / Vermont
-<esri2852> +proj=tmerc +lat_0=42.5 +lon_0=-72.5 +k=0.999964 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(HARN) / Virginia North
-<esri2853> +proj=lcc +lat_1=39.2 +lat_2=38.03333333333333 +lat_0=37.66666666666666 +lon_0=-78.5 +x_0=3500000 +y_0=2000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(HARN) / Virginia South
-<esri2854> +proj=lcc +lat_1=37.96666666666667 +lat_2=36.76666666666667 +lat_0=36.33333333333334 +lon_0=-78.5 +x_0=3500000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(HARN) / Washington North
-<esri2855> +proj=lcc +lat_1=48.73333333333333 +lat_2=47.5 +lat_0=47 +lon_0=-120.8333333333333 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(HARN) / Washington South
-<esri2856> +proj=lcc +lat_1=47.33333333333334 +lat_2=45.83333333333334 +lat_0=45.33333333333334 +lon_0=-120.5 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(HARN) / West Virginia North
-<esri2857> +proj=lcc +lat_1=40.25 +lat_2=39 +lat_0=38.5 +lon_0=-79.5 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(HARN) / West Virginia South
-<esri2858> +proj=lcc +lat_1=38.88333333333333 +lat_2=37.48333333333333 +lat_0=37 +lon_0=-81 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(HARN) / Wisconsin North
-<esri2859> +proj=lcc +lat_1=46.76666666666667 +lat_2=45.56666666666667 +lat_0=45.16666666666666 +lon_0=-90 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(HARN) / Wisconsin Central
-<esri2860> +proj=lcc +lat_1=45.5 +lat_2=44.25 +lat_0=43.83333333333334 +lon_0=-90 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(HARN) / Wisconsin South
-<esri2861> +proj=lcc +lat_1=44.06666666666667 +lat_2=42.73333333333333 +lat_0=42 +lon_0=-90 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(HARN) / Wyoming East
-<esri2862> +proj=tmerc +lat_0=40.5 +lon_0=-105.1666666666667 +k=0.999938 +x_0=200000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(HARN) / Wyoming East Central
-<esri2863> +proj=tmerc +lat_0=40.5 +lon_0=-107.3333333333333 +k=0.999938 +x_0=400000 +y_0=100000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(HARN) / Wyoming West Central
-<esri2864> +proj=tmerc +lat_0=40.5 +lon_0=-108.75 +k=0.999938 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(HARN) / Wyoming West
-<esri2865> +proj=tmerc +lat_0=40.5 +lon_0=-110.0833333333333 +k=0.999938 +x_0=800000 +y_0=100000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(HARN) / Puerto Rico & Virgin Is.
-<esri2866> +proj=lcc +lat_1=18.43333333333333 +lat_2=18.03333333333333 +lat_0=17.83333333333333 +lon_0=-66.43333333333334 +x_0=200000 +y_0=200000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(HARN) / Arizona East (ft)
-<esri2867> +proj=tmerc +lat_0=31 +lon_0=-110.1666666666667 +k=0.999900 +x_0=213360 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048 +no_defs  no_defs <>
-# NAD83(HARN) / Arizona Central (ft)
-<esri2868> +proj=tmerc +lat_0=31 +lon_0=-111.9166666666667 +k=0.999900 +x_0=213360 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048 +no_defs  no_defs <>
-# NAD83(HARN) / Arizona West (ft)
-<esri2869> +proj=tmerc +lat_0=31 +lon_0=-113.75 +k=0.999933 +x_0=213360 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048 +no_defs  no_defs <>
-# NAD83(HARN) / California zone 1 (ftUS)
-<esri2870> +proj=lcc +lat_1=41.66666666666666 +lat_2=40 +lat_0=39.33333333333334 +lon_0=-122 +x_0=2000000.0001016 +y_0=500000.0001016001 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD83(HARN) / California zone 2 (ftUS)
-<esri2871> +proj=lcc +lat_1=39.83333333333334 +lat_2=38.33333333333334 +lat_0=37.66666666666666 +lon_0=-122 +x_0=2000000.0001016 +y_0=500000.0001016001 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD83(HARN) / California zone 3 (ftUS)
-<esri2872> +proj=lcc +lat_1=38.43333333333333 +lat_2=37.06666666666667 +lat_0=36.5 +lon_0=-120.5 +x_0=2000000.0001016 +y_0=500000.0001016001 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD83(HARN) / California zone 4 (ftUS)
-<esri2873> +proj=lcc +lat_1=37.25 +lat_2=36 +lat_0=35.33333333333334 +lon_0=-119 +x_0=2000000.0001016 +y_0=500000.0001016001 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD83(HARN) / California zone 5 (ftUS)
-<esri2874> +proj=lcc +lat_1=35.46666666666667 +lat_2=34.03333333333333 +lat_0=33.5 +lon_0=-118 +x_0=2000000.0001016 +y_0=500000.0001016001 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD83(HARN) / California zone 6 (ftUS)
-<esri2875> +proj=lcc +lat_1=33.88333333333333 +lat_2=32.78333333333333 +lat_0=32.16666666666666 +lon_0=-116.25 +x_0=2000000.0001016 +y_0=500000.0001016001 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD83(HARN) / Colorado North (ftUS)
-<esri2876> +proj=lcc +lat_1=40.78333333333333 +lat_2=39.71666666666667 +lat_0=39.33333333333334 +lon_0=-105.5 +x_0=914401.8288036576 +y_0=304800.6096012192 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD83(HARN) / Colorado Central (ftUS)
-<esri2877> +proj=lcc +lat_1=39.75 +lat_2=38.45 +lat_0=37.83333333333334 +lon_0=-105.5 +x_0=914401.8288036576 +y_0=304800.6096012192 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD83(HARN) / Colorado South (ftUS)
-<esri2878> +proj=lcc +lat_1=38.43333333333333 +lat_2=37.23333333333333 +lat_0=36.66666666666666 +lon_0=-105.5 +x_0=914401.8288036576 +y_0=304800.6096012192 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD83(HARN) / Connecticut (ftUS)
-<esri2879> +proj=lcc +lat_1=41.86666666666667 +lat_2=41.2 +lat_0=40.83333333333334 +lon_0=-72.75 +x_0=304800.6096012192 +y_0=152400.3048006096 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD83(HARN) / Delaware (ftUS)
-<esri2880> +proj=tmerc +lat_0=38 +lon_0=-75.41666666666667 +k=0.999995 +x_0=200000.0001016002 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD83(HARN) / Florida East (ftUS)
-<esri2881> +proj=tmerc +lat_0=24.33333333333333 +lon_0=-81 +k=0.999941 +x_0=200000.0001016002 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD83(HARN) / Florida West (ftUS)
-<esri2882> +proj=tmerc +lat_0=24.33333333333333 +lon_0=-82 +k=0.999941 +x_0=200000.0001016002 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD83(HARN) / Florida North (ftUS)
-<esri2883> +proj=lcc +lat_1=30.75 +lat_2=29.58333333333333 +lat_0=29 +lon_0=-84.5 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD83(HARN) / Georgia East (ftUS)
-<esri2884> +proj=tmerc +lat_0=30 +lon_0=-82.16666666666667 +k=0.999900 +x_0=200000.0001016002 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD83(HARN) / Georgia West (ftUS)
-<esri2885> +proj=tmerc +lat_0=30 +lon_0=-84.16666666666667 +k=0.999900 +x_0=699999.9998983998 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD83(HARN) / Idaho East (ftUS)
-<esri2886> +proj=tmerc +lat_0=41.66666666666666 +lon_0=-112.1666666666667 +k=0.999947 +x_0=200000.0001016002 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD83(HARN) / Idaho Central (ftUS)
-<esri2887> +proj=tmerc +lat_0=41.66666666666666 +lon_0=-114 +k=0.999947 +x_0=500000.0001016001 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD83(HARN) / Idaho West (ftUS)
-<esri2888> +proj=tmerc +lat_0=41.66666666666666 +lon_0=-115.75 +k=0.999933 +x_0=800000.0001016001 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD83(HARN) / Indiana East (ftUS)
-<esri2889> +proj=tmerc +lat_0=37.5 +lon_0=-85.66666666666667 +k=0.999967 +x_0=99999.99989839978 +y_0=249364.9987299975 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD83(HARN) / Indiana West (ftUS)
-<esri2890> +proj=tmerc +lat_0=37.5 +lon_0=-87.08333333333333 +k=0.999967 +x_0=900000 +y_0=249364.9987299975 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD83(HARN) / Kentucky North (ftUS)
-<esri2891> +proj=lcc +lat_1=37.96666666666667 +lat_2=38.96666666666667 +lat_0=37.5 +lon_0=-84.25 +x_0=500000.0001016001 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD83(HARN) / Kentucky South (ftUS)
-<esri2892> +proj=lcc +lat_1=37.93333333333333 +lat_2=36.73333333333333 +lat_0=36.33333333333334 +lon_0=-85.75 +x_0=500000.0001016001 +y_0=500000.0001016001 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD83(HARN) / Maryland (ftUS)
-<esri2893> +proj=lcc +lat_1=39.45 +lat_2=38.3 +lat_0=37.66666666666666 +lon_0=-77 +x_0=399999.9998983998 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD83(HARN) / Massachusetts Mainland (ftUS)
-<esri2894> +proj=lcc +lat_1=42.68333333333333 +lat_2=41.71666666666667 +lat_0=41 +lon_0=-71.5 +x_0=200000.0001016002 +y_0=750000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD83(HARN) / Massachusetts Island (ftUS)
-<esri2895> +proj=lcc +lat_1=41.48333333333333 +lat_2=41.28333333333333 +lat_0=41 +lon_0=-70.5 +x_0=500000.0001016001 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD83(HARN) / Michigan North (ft)
-<esri2896> +proj=lcc +lat_1=47.08333333333334 +lat_2=45.48333333333333 +lat_0=44.78333333333333 +lon_0=-87 +x_0=7999999.999968001 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048 +no_defs  no_defs <>
-# NAD83(HARN) / Michigan Central (ft)
-<esri2897> +proj=lcc +lat_1=45.7 +lat_2=44.18333333333333 +lat_0=43.31666666666667 +lon_0=-84.36666666666666 +x_0=5999999.999976001 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048 +no_defs  no_defs <>
-# NAD83(HARN) / Michigan South (ft)
-<esri2898> +proj=lcc +lat_1=43.66666666666666 +lat_2=42.1 +lat_0=41.5 +lon_0=-84.36666666666666 +x_0=3999999.999984 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048 +no_defs  no_defs <>
-# NAD83(HARN) / Mississippi East (ftUS)
-<esri2899> +proj=tmerc +lat_0=29.5 +lon_0=-88.83333333333333 +k=0.999950 +x_0=300000.0000000001 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD83(HARN) / Mississippi West (ftUS)
-<esri2900> +proj=tmerc +lat_0=29.5 +lon_0=-90.33333333333333 +k=0.999950 +x_0=699999.9998983998 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD83(HARN) / Montana (ft)
-<esri2901> +proj=lcc +lat_1=49 +lat_2=45 +lat_0=44.25 +lon_0=-109.5 +x_0=599999.9999976 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048 +no_defs  no_defs <>
-# NAD83(HARN) / New Mexico East (ftUS)
-<esri2902> +proj=tmerc +lat_0=31 +lon_0=-104.3333333333333 +k=0.999909 +x_0=165000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD83(HARN) / New Mexico Central (ftUS)
-<esri2903> +proj=tmerc +lat_0=31 +lon_0=-106.25 +k=0.999900 +x_0=500000.0001016001 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD83(HARN) / New Mexico West (ftUS)
-<esri2904> +proj=tmerc +lat_0=31 +lon_0=-107.8333333333333 +k=0.999917 +x_0=830000.0001016001 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD83(HARN) / New York East (ftUS)
-<esri2905> +proj=tmerc +lat_0=38.83333333333334 +lon_0=-74.5 +k=0.999900 +x_0=150000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD83(HARN) / New York Central (ftUS)
-<esri2906> +proj=tmerc +lat_0=40 +lon_0=-76.58333333333333 +k=0.999938 +x_0=249999.9998983998 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD83(HARN) / New York West (ftUS)
-<esri2907> +proj=tmerc +lat_0=40 +lon_0=-78.58333333333333 +k=0.999938 +x_0=350000.0001016001 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD83(HARN) / New York Long Island (ftUS)
-<esri2908> +proj=lcc +lat_1=41.03333333333333 +lat_2=40.66666666666666 +lat_0=40.16666666666666 +lon_0=-74 +x_0=300000.0000000001 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD83(HARN) / North Dakota North (ft)
-<esri2909> +proj=lcc +lat_1=48.73333333333333 +lat_2=47.43333333333333 +lat_0=47 +lon_0=-100.5 +x_0=599999.9999976 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048 +no_defs  no_defs <>
-# NAD83(HARN) / North Dakota South (ft)
-<esri2910> +proj=lcc +lat_1=47.48333333333333 +lat_2=46.18333333333333 +lat_0=45.66666666666666 +lon_0=-100.5 +x_0=599999.9999976 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048 +no_defs  no_defs <>
-# NAD83(HARN) / Oklahoma North (ftUS)
-<esri2911> +proj=lcc +lat_1=36.76666666666667 +lat_2=35.56666666666667 +lat_0=35 +lon_0=-98 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD83(HARN) / Oklahoma South (ftUS)
-<esri2912> +proj=lcc +lat_1=35.23333333333333 +lat_2=33.93333333333333 +lat_0=33.33333333333334 +lon_0=-98 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD83(HARN) / Oregon North (ft)
-<esri2913> +proj=lcc +lat_1=46 +lat_2=44.33333333333334 +lat_0=43.66666666666666 +lon_0=-120.5 +x_0=2500000.0001424 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048 +no_defs  no_defs <>
-# NAD83(HARN) / Oregon South (ft)
-<esri2914> +proj=lcc +lat_1=44 +lat_2=42.33333333333334 +lat_0=41.66666666666666 +lon_0=-120.5 +x_0=1500000.0001464 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048 +no_defs  no_defs <>
-# NAD83(HARN) / Tennessee (ftUS)
-<esri2915> +proj=lcc +lat_1=36.41666666666666 +lat_2=35.25 +lat_0=34.33333333333334 +lon_0=-86 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD83(HARN) / Texas North (ftUS)
-<esri2916> +proj=lcc +lat_1=36.18333333333333 +lat_2=34.65 +lat_0=34 +lon_0=-101.5 +x_0=200000.0001016002 +y_0=999999.9998983998 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD83(HARN) / Texas North Central (ftUS)
-<esri2917> +proj=lcc +lat_1=33.96666666666667 +lat_2=32.13333333333333 +lat_0=31.66666666666667 +lon_0=-98.5 +x_0=600000 +y_0=2000000.0001016 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD83(HARN) / Texas Central (ftUS)
-<esri2918> +proj=lcc +lat_1=31.88333333333333 +lat_2=30.11666666666667 +lat_0=29.66666666666667 +lon_0=-100.3333333333333 +x_0=699999.9998983998 +y_0=3000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD83(HARN) / Texas South Central (ftUS)
-<esri2919> +proj=lcc +lat_1=30.28333333333333 +lat_2=28.38333333333333 +lat_0=27.83333333333333 +lon_0=-99 +x_0=600000 +y_0=3999999.9998984 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD83(HARN) / Texas South (ftUS)
-<esri2920> +proj=lcc +lat_1=27.83333333333333 +lat_2=26.16666666666667 +lat_0=25.66666666666667 +lon_0=-98.5 +x_0=300000.0000000001 +y_0=5000000.0001016 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD83(HARN) / Utah North (ft)
-<esri2921> +proj=lcc +lat_1=41.78333333333333 +lat_2=40.71666666666667 +lat_0=40.33333333333334 +lon_0=-111.5 +x_0=500000.0001504 +y_0=999999.9999960001 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048 +no_defs  no_defs <>
-# NAD83(HARN) / Utah Central (ft)
-<esri2922> +proj=lcc +lat_1=40.65 +lat_2=39.01666666666667 +lat_0=38.33333333333334 +lon_0=-111.5 +x_0=500000.0001504 +y_0=1999999.999992 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048 +no_defs  no_defs <>
-# NAD83(HARN) / Utah South (ft)
-<esri2923> +proj=lcc +lat_1=38.35 +lat_2=37.21666666666667 +lat_0=36.66666666666666 +lon_0=-111.5 +x_0=500000.0001504 +y_0=2999999.999988 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048 +no_defs  no_defs <>
-# NAD83(HARN) / Virginia North (ftUS)
-<esri2924> +proj=lcc +lat_1=39.2 +lat_2=38.03333333333333 +lat_0=37.66666666666666 +lon_0=-78.5 +x_0=3500000.0001016 +y_0=2000000.0001016 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD83(HARN) / Virginia South (ftUS)
-<esri2925> +proj=lcc +lat_1=37.96666666666667 +lat_2=36.76666666666667 +lat_0=36.33333333333334 +lon_0=-78.5 +x_0=3500000.0001016 +y_0=999999.9998983998 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD83(HARN) / Washington North (ftUS)
-<esri2926> +proj=lcc +lat_1=48.73333333333333 +lat_2=47.5 +lat_0=47 +lon_0=-120.8333333333333 +x_0=500000.0001016001 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD83(HARN) / Washington South (ftUS)
-<esri2927> +proj=lcc +lat_1=47.33333333333334 +lat_2=45.83333333333334 +lat_0=45.33333333333334 +lon_0=-120.5 +x_0=500000.0001016001 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD83(HARN) / Wisconsin North (ftUS)
-<esri2928> +proj=lcc +lat_1=46.76666666666667 +lat_2=45.56666666666667 +lat_0=45.16666666666666 +lon_0=-90 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD83(HARN) / Wisconsin Central (ftUS)
-<esri2929> +proj=lcc +lat_1=45.5 +lat_2=44.25 +lat_0=43.83333333333334 +lon_0=-90 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD83(HARN) / Wisconsin South (ftUS)
-<esri2930> +proj=lcc +lat_1=44.06666666666667 +lat_2=42.73333333333333 +lat_0=42 +lon_0=-90 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# Beduaram / TM 13 NE
-<esri2931> +proj=tmerc +lat_0=0 +lon_0=13 +k=0.999600 +x_0=500000.0000000001 +y_0=0 +a=6378249.2 +b=6356515 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# QND95 / Qatar National Grid
-<esri2932> +proj=tmerc +lat_0=24.45 +lon_0=51.21666666666667 +k=0.999990 +x_0=200000 +y_0=300000 +ellps=intl +towgs84=-119.425,-303.659,-11.0006,1.1643,0.174458,1.09626,3.65706 +units=m +no_defs  no_defs <>
-# Segara / UTM zone 50S
-<esri2933> +proj=utm +zone=50 +south +ellps=bessel +towgs84=-404.78,685.68,45.47,0,0,0,0 +units=m +no_defs  no_defs <>
-# Segara (Jakarta) / NEIEZ
-<esri2934> +proj=merc +lat_ts=0 +lon_0=216.8077194444444 +k=0.997000 +x_0=3900000 +y_0=900000 +ellps=bessel +pm=jakarta +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / CS63 zone A1
-<esri2935> +proj=tmerc +lat_0=0.1166666666666667 +lon_0=41.53333333333333 +k=1.000000 +x_0=1300000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / CS63 zone A2
-<esri2936> +proj=tmerc +lat_0=0.1166666666666667 +lon_0=44.53333333333333 +k=1.000000 +x_0=2300000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / CS63 zone A3
-<esri2937> +proj=tmerc +lat_0=0.1166666666666667 +lon_0=47.53333333333333 +k=1.000000 +x_0=3300000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / CS63 zone A4
-<esri2938> +proj=tmerc +lat_0=0.1166666666666667 +lon_0=50.53333333333333 +k=1.000000 +x_0=4300000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / CS63 zone K2
-<esri2939> +proj=tmerc +lat_0=0.1333333333333333 +lon_0=50.76666666666667 +k=1.000000 +x_0=2300000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / CS63 zone K3
-<esri2940> +proj=tmerc +lat_0=0.1333333333333333 +lon_0=53.76666666666667 +k=1.000000 +x_0=3300000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / CS63 zone K4
-<esri2941> +proj=tmerc +lat_0=0.1333333333333333 +lon_0=56.76666666666667 +k=1.000000 +x_0=4300000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Porto Santo / UTM zone 28N
-<esri2942> +proj=utm +zone=28 +ellps=intl +units=m +no_defs  no_defs <>
-# Selvagem Grande / UTM zone 28N
-<esri2943> +proj=utm +zone=28 +ellps=intl +units=m +no_defs  no_defs <>
-# NAD83(CSRS) / SCoPQ zone 2
-<esri2944> +proj=tmerc +lat_0=0 +lon_0=-55.5 +k=0.999900 +x_0=304800 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(CSRS) / MTM zone 3
-<esri2945> +proj=tmerc +lat_0=0 +lon_0=-58.5 +k=0.999900 +x_0=304800 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(CSRS) / MTM zone 4
-<esri2946> +proj=tmerc +lat_0=0 +lon_0=-61.5 +k=0.999900 +x_0=304800 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(CSRS) / MTM zone 5
-<esri2947> +proj=tmerc +lat_0=0 +lon_0=-64.5 +k=0.999900 +x_0=304800 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(CSRS) / MTM zone 6
-<esri2948> +proj=tmerc +lat_0=0 +lon_0=-67.5 +k=0.999900 +x_0=304800 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(CSRS) / MTM zone 7
-<esri2949> +proj=tmerc +lat_0=0 +lon_0=-70.5 +k=0.999900 +x_0=304800 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(CSRS) / MTM zone 8
-<esri2950> +proj=tmerc +lat_0=0 +lon_0=-73.5 +k=0.999900 +x_0=304800 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(CSRS) / MTM zone 9
-<esri2951> +proj=tmerc +lat_0=0 +lon_0=-76.5 +k=0.999900 +x_0=304800 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(CSRS) / MTM zone 10
-<esri2952> +proj=tmerc +lat_0=0 +lon_0=-79.5 +k=0.999900 +x_0=304800 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(CSRS) / New Brunswick Stereo
-<esri2953> +proj=stere +lat_0=46.5 +lon_0=-66.5 +k=0.999912 +x_0=2500000 +y_0=7500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(CSRS) / Prince Edward Isl. Stereographic (NAD83)
-<esri2954> +proj=stere +lat_0=47.25 +lon_0=-63 +k=0.999912 +x_0=400000 +y_0=800000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(CSRS) / UTM zone 11N
-<esri2955> +proj=utm +zone=11 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(CSRS) / UTM zone 12N
-<esri2956> +proj=utm +zone=12 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(CSRS) / UTM zone 13N
-<esri2957> +proj=utm +zone=13 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(CSRS) / UTM zone 17N
-<esri2958> +proj=utm +zone=17 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(CSRS) / UTM zone 18N
-<esri2959> +proj=utm +zone=18 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(CSRS) / UTM zone 19N
-<esri2960> +proj=utm +zone=19 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(CSRS) / UTM zone 20N
-<esri2961> +proj=utm +zone=20 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD83(CSRS) / UTM zone 21N
-<esri2962> +proj=utm +zone=21 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# Moznet / UTM zone 36S
-<esri3036> +proj=utm +zone=36 +south +ellps=WGS84 +towgs84=0,0,0,-0,-0,-0,0 +units=m +no_defs  no_defs <>
-# Moznet / UTM zone 37S
-<esri3037> +proj=utm +zone=37 +south +ellps=WGS84 +towgs84=0,0,0,-0,-0,-0,0 +units=m +no_defs  no_defs <>
-# Indian 1960 / UTM zone 48N
-<esri3148> +proj=utm +zone=48 +a=6377276.345 +b=6356075.413140239 +units=m +no_defs  no_defs <>
-# Indian 1960 / UTM zone 49N
-<esri3149> +proj=utm +zone=49 +a=6377276.345 +b=6356075.413140239 +units=m +no_defs  no_defs <>
-# Indian 1960 / TM 106 NE
-<esri3176> +proj=tmerc +lat_0=0 +lon_0=106 +k=0.999600 +x_0=500000 +y_0=0 +a=6377276.345 +b=6356075.413140239 +units=m +no_defs  no_defs <>
-# FD58 / Iraq zone
-<esri3200> +proj=lcc +lat_1=32.5 +lat_0=32.5 +lon_0=45 +k_0=0.9987864078000001 +x_0=1500000 +y_0=1166200 +ellps=clrk80 +units=m +no_defs  no_defs <>
-# Estonian Coordinate System of 1992
-<esri3300> +proj=lcc +lat_1=59.33333333333334 +lat_2=58 +lat_0=57.51755393055556 +lon_0=24 +x_0=500000 +y_0=6375000 +ellps=GRS80 +towgs84=0.055,-0.541,-0.185,0.0183,-0.0003,-0.007,-0.014 +units=m +no_defs  no_defs <>
-# Estonian Coordinate System of 1997
-<esri3301> +proj=lcc +lat_1=59.33333333333334 +lat_2=58 +lat_0=57.51755393055556 +lon_0=24 +x_0=500000 +y_0=6375000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# PSD93 / UTM zone 39N
-<esri3439> +proj=utm +zone=39 +ellps=clrk80 +units=m +no_defs  no_defs <>
-# PSD93 / UTM zone 40N
-<esri3440> +proj=utm +zone=40 +ellps=clrk80 +units=m +no_defs  no_defs <>
-# Old Hawaiian / Hawaii zone 1
-<esri3561> +proj=tmerc +lat_0=18.83333333333333 +lon_0=-155.5 +k=0.999967 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# Old Hawaiian / Hawaii zone 2
-<esri3562> +proj=tmerc +lat_0=20.33333333333333 +lon_0=-156.6666666666667 +k=0.999967 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# Old Hawaiian / Hawaii zone 3
-<esri3563> +proj=tmerc +lat_0=21.16666666666667 +lon_0=-158 +k=0.999990 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# Old Hawaiian / Hawaii zone 4
-<esri3564> +proj=tmerc +lat_0=21.83333333333333 +lon_0=-159.5 +k=0.999990 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# Old Hawaiian / Hawaii zone 5
-<esri3565> +proj=tmerc +lat_0=21.66666666666667 +lon_0=-160.1666666666667 +k=1.000000 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# Puerto Rico / UTM zone 20N
-<esri3920> +proj=utm +zone=20 +ellps=clrk66 +units=m +no_defs  no_defs <>
-# Puerto Rico State Plane CS of 1927
-<esri3991> +proj=lcc +lat_1=18.43333333333333 +lat_2=18.03333333333333 +lat_0=17.83333333333333 +lon_0=-66.43333333333334 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# Puerto Rico / St. Croix
-<esri3992> +proj=lcc +lat_1=18.43333333333333 +lat_2=18.03333333333333 +lat_0=17.83333333333333 +lon_0=-66.43333333333334 +x_0=152400.3048006096 +y_0=30480.06096012192 +ellps=clrk66 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# Unknown datum based upon the Airy 1830 ellipsoid
-<esri4001> +proj=longlat +ellps=airy +no_defs  no_defs <>
-# Unknown datum based upon the Airy Modified 1849 ellipsoid
-<esri4002> +proj=longlat +a=6377340.189 +b=6356034.447938534 +no_defs  no_defs <>
-# Unknown datum based upon the Australian National Spheroid
-<esri4003> +proj=longlat +ellps=aust_SA +no_defs  no_defs <>
-# Unknown datum based upon the Bessel 1841 ellipsoid
-<esri4004> +proj=longlat +ellps=bessel +no_defs  no_defs <>
-# Unknown datum based upon the Bessel Modified ellipsoid
-<esri4005> +proj=longlat +a=6377492.018 +b=6356173.508712696 +no_defs  no_defs <>
-# Unknown datum based upon the Bessel Namibia ellipsoid
-<esri4006> +proj=longlat +ellps=bess_nam +no_defs  no_defs <>
-# Unknown datum based upon the Clarke 1858 ellipsoid
-<esri4007> +proj=longlat +a=6378293.63683822 +b=6356617.979337744 +no_defs  no_defs <>
-# Unknown datum based upon the Clarke 1866 ellipsoid
-<esri4008> +proj=longlat +ellps=clrk66 +no_defs  no_defs <>
-# Unknown datum based upon the Clarke 1866 Michigan ellipsoid
-<esri4009> +proj=longlat +a=6378450.047548896 +b=6356826.621488444 +no_defs  no_defs <>
-# Unknown datum based upon the Clarke 1880 (Benoit) ellipsoid
-<esri4010> +proj=longlat +a=6378300.789 +b=6356566.435 +no_defs  no_defs <>
-# Unknown datum based upon the Clarke 1880 (IGN) ellipsoid
-<esri4011> +proj=longlat +a=6378249.2 +b=6356515 +no_defs  no_defs <>
-# Unknown datum based upon the Clarke 1880 (RGS) ellipsoid
-<esri4012> +proj=longlat +ellps=clrk80 +no_defs  no_defs <>
-# Unknown datum based upon the Clarke 1880 (Arc) ellipsoid
-<esri4013> +proj=longlat +a=6378249.145 +b=6356514.966398753 +no_defs  no_defs <>
-# Unknown datum based upon the Clarke 1880 (SGA 1922) ellipsoid
-<esri4014> +proj=longlat +a=6378249.2 +b=6356514.996941779 +no_defs  no_defs <>
-# Unknown datum based upon the Everest 1830 (1937 Adjustment) ellipsoid
-<esri4015> +proj=longlat +a=6377276.345 +b=6356075.413140239 +no_defs  no_defs <>
-# Unknown datum based upon the Everest 1830 (1967 Definition) ellipsoid
-<esri4016> +proj=longlat +ellps=evrstSS +no_defs  no_defs <>
-# Unknown datum based upon the Everest 1830 Modified ellipsoid
-<esri4018> +proj=longlat +a=6377304.063 +b=6356103.038993155 +no_defs  no_defs <>
-# Unknown datum based upon the GRS 1980 ellipsoid
-<esri4019> +proj=longlat +ellps=GRS80 +no_defs  no_defs <>
-# Unknown datum based upon the Helmert 1906 ellipsoid
-<esri4020> +proj=longlat +ellps=helmert +no_defs  no_defs <>
-# Unknown datum based upon the Indonesian National Spheroid
-<esri4021> +proj=longlat +a=6378160 +b=6356774.50408554 +no_defs  no_defs <>
-# Unknown datum based upon the International 1924 ellipsoid
-<esri4022> +proj=longlat +ellps=intl +no_defs  no_defs <>
-# Unknown datum based upon the Krassowsky 1940 ellipsoid
-<esri4024> +proj=longlat +ellps=krass +no_defs  no_defs <>
-# Unknown datum based upon the NWL 9D ellipsoid
-<esri4025> +proj=longlat +ellps=WGS66 +no_defs  no_defs <>
-# Unknown datum based upon the Plessis 1817 ellipsoid
-<esri4027> +proj=longlat +a=6376523 +b=6355862.933255573 +no_defs  no_defs <>
-# Unknown datum based upon the Struve 1860 ellipsoid
-<esri4028> +proj=longlat +a=6378298.3 +b=6356657.142669562 +no_defs  no_defs <>
-# Unknown datum based upon the War Office ellipsoid
-<esri4029> +proj=longlat +a=6378300 +b=6356751.689189189 +no_defs  no_defs <>
-# Unknown datum based upon the WGS 84 ellipsoid
-<esri4030> +proj=longlat +ellps=WGS84 +no_defs  no_defs <>
-# Unknown datum based upon the GEM 10C ellipsoid
-<esri4031> +proj=longlat +ellps=WGS84 +no_defs  no_defs <>
-# Unknown datum based upon the OSU86F ellipsoid
-<esri4032> +proj=longlat +a=6378136.2 +b=6356751.516927429 +no_defs  no_defs <>
-# Unknown datum based upon the OSU91A ellipsoid
-<esri4033> +proj=longlat +a=6378136.3 +b=6356751.616592146 +no_defs  no_defs <>
-# Unknown datum based upon the Clarke 1880 ellipsoid
-<esri4034> +proj=longlat +ellps=clrk80 +no_defs  no_defs <>
-# Unknown datum based upon the Authalic Sphere
-<esri4035> +proj=longlat +a=6371000 +b=6371000 +no_defs  no_defs <>
-# Unknown datum based upon the GRS 1967 ellipsoid
-<esri4036> +proj=longlat +ellps=GRS67 +no_defs  no_defs <>
-# Unknown datum based upon the Average Terrestrial System 1977 ellipsoid
-<esri4041> +proj=longlat +a=6378135 +b=6356750.304921594 +no_defs  no_defs <>
-# Unknown datum based upon the Everest (1830 Definition) ellipsoid
-<esri4042> +proj=longlat +a=6377299.36559538 +b=6356098.357204817 +no_defs  no_defs <>
-# Unknown datum based upon the WGS 72 ellipsoid
-<esri4043> +proj=longlat +ellps=WGS72 +no_defs  no_defs <>
-# Unknown datum based upon the Everest 1830 (1962 Definition) ellipsoid
-<esri4044> +proj=longlat +a=6377301.243 +b=6356100.230165385 +no_defs  no_defs <>
-# Unknown datum based upon the Everest 1830 (1975 Definition) ellipsoid
-<esri4045> +proj=longlat +a=6377299.151 +b=6356098.145120132 +no_defs  no_defs <>
-# Unspecified based upon the GRS 1980 Authalic Sphere
-<esri4047> +proj=longlat +a=6370997 +b=6370997 +no_defs  no_defs <>
-# Greek
-<esri4120> +proj=longlat +ellps=bessel +no_defs  no_defs <>
-# GGRS87
-<esri4121> +proj=longlat +ellps=GRS80 +towgs84=-199.87,74.79,246.62,0,0,0,0 +no_defs  no_defs <>
-# ATS77
-<esri4122> +proj=longlat +a=6378135 +b=6356750.304921594 +no_defs  no_defs <>
-# KKJ
-<esri4123> +proj=longlat +ellps=intl +towgs84=-90.7,-106.1,-119.2,4.09,0.218,-1.05,1.37 +no_defs  no_defs <>
-# RT90
-<esri4124> +proj=longlat +ellps=bessel +no_defs  no_defs <>
-# Samboja
-<esri4125> +proj=longlat +ellps=bessel +towgs84=-404.78,685.68,45.47,0,0,0,0 +no_defs  no_defs <>
-# LKS94 (ETRS89)
-<esri4126> +proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs  no_defs <>
-# Tete
-<esri4127> +proj=longlat +ellps=clrk66 +no_defs  no_defs <>
-# Madzansua
-<esri4128> +proj=longlat +ellps=clrk66 +no_defs  no_defs <>
-# Observatario
-<esri4129> +proj=longlat +ellps=clrk66 +no_defs  no_defs <>
-# Moznet
-<esri4130> +proj=longlat +ellps=WGS84 +towgs84=0,0,0,-0,-0,-0,0 +no_defs  no_defs <>
-# Indian 1960
-<esri4131> +proj=longlat +a=6377276.345 +b=6356075.413140239 +no_defs  no_defs <>
-# FD58
-<esri4132> +proj=longlat +ellps=clrk80 +no_defs  no_defs <>
-# EST92
-<esri4133> +proj=longlat +ellps=GRS80 +towgs84=0.055,-0.541,-0.185,0.0183,-0.0003,-0.007,-0.014 +no_defs  no_defs <>
-# PDO Survey Datum 1993
-<esri4134> +proj=longlat +ellps=clrk80 +no_defs  no_defs <>
-# Old Hawaiian
-<esri4135> +proj=longlat +ellps=clrk66 +no_defs  no_defs <>
-# St. Lawrence Island
-<esri4136> +proj=longlat +ellps=clrk66 +no_defs  no_defs <>
-# St. Paul Island
-<esri4137> +proj=longlat +ellps=clrk66 +no_defs  no_defs <>
-# St. George Island
-<esri4138> +proj=longlat +ellps=clrk66 +no_defs  no_defs <>
-# Puerto Rico
-<esri4139> +proj=longlat +ellps=clrk66 +no_defs  no_defs <>
-# NAD83(CSRS98)
-<esri4140> +proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs  no_defs <>
-# Israel
-<esri4141> +proj=longlat +ellps=GRS80 +no_defs  no_defs <>
-# Locodjo 1965
-<esri4142> +proj=longlat +ellps=clrk80 +towgs84=-125,53,467,0,0,0,0 +no_defs  no_defs <>
-# Abidjan 1987
-<esri4143> +proj=longlat +ellps=clrk80 +towgs84=-124.76,53,466.79,0,0,0,0 +no_defs  no_defs <>
-# Kalianpur 1937
-<esri4144> +proj=longlat +a=6377276.345 +b=6356075.413140239 +no_defs  no_defs <>
-# Kalianpur 1962
-<esri4145> +proj=longlat +a=6377301.243 +b=6356100.230165385 +towgs84=283,682,231,0,0,0,0 +no_defs  no_defs <>
-# Kalianpur 1975
-<esri4146> +proj=longlat +a=6377299.151 +b=6356098.145120132 +towgs84=295,736,257,0,0,0,0 +no_defs  no_defs <>
-# Hanoi 1972
-<esri4147> +proj=longlat +ellps=krass +towgs84=-17.51,-108.32,-62.39,0,0,0,0 +no_defs  no_defs <>
-# Hartebeesthoek94
-<esri4148> +proj=longlat +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +no_defs  no_defs <>
-# CH1903
-<esri4149> +proj=longlat +ellps=bessel +no_defs  no_defs <>
-# CH1903+
-<esri4150> +proj=longlat +ellps=bessel +towgs84=674.374,15.056,405.346,0,0,0,0 +no_defs  no_defs <>
-# CHTRF95
-<esri4151> +proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs  no_defs <>
-# NAD83(HARN)
-<esri4152> +proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs  no_defs <>
-# Rassadiran
-<esri4153> +proj=longlat +ellps=intl +towgs84=-133.63,-157.5,-158.62,0,0,0,0 +no_defs  no_defs <>
-# ED50(ED77)
-<esri4154> +proj=longlat +ellps=intl +no_defs  no_defs <>
-# Dabola 1981
-<esri4155> +proj=longlat +a=6378249.2 +b=6356515 +towgs84=-83,37,124,0,0,0,0 +no_defs  no_defs <>
-# S-JTSK
-<esri4156> +proj=longlat +ellps=bessel +no_defs  no_defs <>
-# Mount Dillon
-<esri4157> +proj=longlat +a=6378293.63683822 +b=6356617.979337744 +no_defs  no_defs <>
-# Naparima 1955
-<esri4158> +proj=longlat +ellps=intl +no_defs  no_defs <>
-# ELD79
-<esri4159> +proj=longlat +ellps=intl +no_defs  no_defs <>
-# Chos Malal 1914
-<esri4160> +proj=longlat +ellps=intl +no_defs  no_defs <>
-# Pampa del Castillo
-<esri4161> +proj=longlat +ellps=intl +no_defs  no_defs <>
-# Korean 1985
-<esri4162> +proj=longlat +ellps=bessel +no_defs  no_defs <>
-# Yemen NGN96
-<esri4163> +proj=longlat +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +no_defs  no_defs <>
-# South Yemen
-<esri4164> +proj=longlat +ellps=krass +towgs84=-76,-138,67,0,0,0,0 +no_defs  no_defs <>
-# Bissau
-<esri4165> +proj=longlat +ellps=intl +towgs84=-173,253,27,0,0,0,0 +no_defs  no_defs <>
-# Korean 1995
-<esri4166> +proj=longlat +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +no_defs  no_defs <>
-# NZGD2000
-<esri4167> +proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs  no_defs <>
-# Accra
-<esri4168> +proj=longlat +a=6378300 +b=6356751.689189189 +towgs84=-199,32,322,0,0,0,0 +no_defs  no_defs <>
-# American Samoa 1962
-<esri4169> +proj=longlat +ellps=clrk66 +towgs84=-115,118,426,0,0,0,0 +no_defs  no_defs <>
-# SIRGAS
-<esri4170> +proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs  no_defs <>
-# RGF93
-<esri4171> +proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs  no_defs <>
-# POSGAR
-<esri4172> +proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs  no_defs <>
-# IRENET95
-<esri4173> +proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs  no_defs <>
-# Sierra Leone 1924
-<esri4174> +proj=longlat +a=6378300 +b=6356751.689189189 +no_defs  no_defs <>
-# Sierra Leone 1968
-<esri4175> +proj=longlat +ellps=clrk80 +towgs84=-88,4,101,0,0,0,0 +no_defs  no_defs <>
-# Australian Antarctic
-<esri4176> +proj=longlat +ellps=GRS80 +no_defs  no_defs <>
-# Pulkovo 1942(83)
-<esri4178> +proj=longlat +ellps=krass +towgs84=24,-123,-94,0.02,-0.25,-0.13,1.1 +no_defs  no_defs <>
-# Pulkovo 1942(58)
-<esri4179> +proj=longlat +ellps=krass +towgs84=33.4,-146.6,-76.3,-0.359,-0.053,0.844,-0.84 +no_defs  no_defs <>
-# EST97
-<esri4180> +proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs  no_defs <>
-# Luxembourg 1930
-<esri4181> +proj=longlat +ellps=intl +towgs84=-193,13.7,-39.3,-0.41,-2.933,2.688,0.43 +no_defs  no_defs <>
-# Azores Occidental 1939
-<esri4182> +proj=longlat +ellps=intl +no_defs  no_defs <>
-# Azores Central 1948
-<esri4183> +proj=longlat +ellps=intl +no_defs  no_defs <>
-# Azores Oriental 1940
-<esri4184> +proj=longlat +ellps=intl +no_defs  no_defs <>
-# Madeira 1936
-<esri4185> +proj=longlat +ellps=intl +no_defs  no_defs <>
-# OSNI 1952
-<esri4188> +proj=longlat +ellps=airy +no_defs  no_defs <>
-# REGVEN
-<esri4189> +proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs  no_defs <>
-# POSGAR 98
-<esri4190> +proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs  no_defs <>
-# Albanian 1987
-<esri4191> +proj=longlat +ellps=krass +no_defs  no_defs <>
-# Douala 1948
-<esri4192> +proj=longlat +ellps=intl +no_defs  no_defs <>
-# Manoca 1962
-<esri4193> +proj=longlat +a=6378249.2 +b=6356515 +towgs84=-70.9,-151.8,-41.4,0,0,0,0 +no_defs  no_defs <>
-# Qornoq 1927
-<esri4194> +proj=longlat +ellps=intl +no_defs  no_defs <>
-# Scoresbysund 1952
-<esri4195> +proj=longlat +ellps=intl +towgs84=105,326,-102.5,0,0,0.814,-0.6 +no_defs  no_defs <>
-# Ammassalik 1958
-<esri4196> +proj=longlat +ellps=intl +towgs84=-45,417,-3.5,0,0,0.814,-0.6 +no_defs  no_defs <>
-# Garoua
-<esri4197> +proj=longlat +ellps=clrk80 +no_defs  no_defs <>
-# Kousseri
-<esri4198> +proj=longlat +ellps=clrk80 +no_defs  no_defs <>
-# Egypt 1930
-<esri4199> +proj=longlat +ellps=intl +no_defs  no_defs <>
-# Pulkovo 1995
-<esri4200> +proj=longlat +ellps=krass +no_defs  no_defs <>
-# Adindan
-<esri4201> +proj=longlat +ellps=clrk80 +no_defs  no_defs <>
-# AGD66
-<esri4202> +proj=longlat +ellps=aust_SA +no_defs  no_defs <>
-# AGD84
-<esri4203> +proj=longlat +ellps=aust_SA +no_defs  no_defs <>
-# Ain el Abd
-<esri4204> +proj=longlat +ellps=intl +no_defs  no_defs <>
-# Afgooye
-<esri4205> +proj=longlat +ellps=krass +towgs84=-43,-163,45,0,0,0,0 +no_defs  no_defs <>
-# Agadez
-<esri4206> +proj=longlat +a=6378249.2 +b=6356515 +no_defs  no_defs <>
-# Lisbon
-<esri4207> +proj=longlat +ellps=intl +no_defs  no_defs <>
-# Aratu
-<esri4208> +proj=longlat +ellps=intl +no_defs  no_defs <>
-# Arc 1950
-<esri4209> +proj=longlat +a=6378249.145 +b=6356514.966398753 +no_defs  no_defs <>
-# Arc 1960
-<esri4210> +proj=longlat +ellps=clrk80 +no_defs  no_defs <>
-# Batavia
-<esri4211> +proj=longlat +ellps=bessel +no_defs  no_defs <>
-# Barbados 1938
-<esri4212> +proj=longlat +ellps=clrk80 +no_defs  no_defs <>
-# Beduaram
-<esri4213> +proj=longlat +a=6378249.2 +b=6356515 +no_defs  no_defs <>
-# Beijing 1954
-<esri4214> +proj=longlat +ellps=krass +no_defs  no_defs <>
-# Belge 1950
-<esri4215> +proj=longlat +ellps=intl +no_defs  no_defs <>
-# Bermuda 1957
-<esri4216> +proj=longlat +ellps=clrk66 +towgs84=-73,213,296,0,0,0,0 +no_defs  no_defs <>
-# Bogota 1975
-<esri4218> +proj=longlat +ellps=intl +no_defs  no_defs <>
-# Bukit Rimpah
-<esri4219> +proj=longlat +ellps=bessel +towgs84=-384,664,-48,0,0,0,0 +no_defs  no_defs <>
-# Camacupa
-<esri4220> +proj=longlat +ellps=clrk80 +no_defs  no_defs <>
-# Campo Inchauspe
-<esri4221> +proj=longlat +ellps=intl +no_defs  no_defs <>
-# Cape
-<esri4222> +proj=longlat +a=6378249.145 +b=6356514.966398753 +no_defs  no_defs <>
-# Carthage
-<esri4223> +proj=longlat +a=6378249.2 +b=6356515 +no_defs  no_defs <>
-# Chua
-<esri4224> +proj=longlat +ellps=intl +towgs84=-134,229,-29,0,0,0,0 +no_defs  no_defs <>
-# Corrego Alegre
-<esri4225> +proj=longlat +ellps=intl +towgs84=-206,172,-6,0,0,0,0 +no_defs  no_defs <>
-# Cote d'Ivoire
-<esri4226> +proj=longlat +a=6378249.2 +b=6356515 +no_defs  no_defs <>
-# Deir ez Zor
-<esri4227> +proj=longlat +a=6378249.2 +b=6356515 +no_defs  no_defs <>
-# Douala
-<esri4228> +proj=longlat +a=6378249.2 +b=6356515 +no_defs  no_defs <>
-# Egypt 1907
-<esri4229> +proj=longlat +ellps=helmert +no_defs  no_defs <>
-# ED50
-<esri4230> +proj=longlat +ellps=intl +no_defs  no_defs <>
-# ED87
-<esri4231> +proj=longlat +ellps=intl +towgs84=-82.981,-99.719,-110.709,-0.5076,0.1503,0.3898,-0.3143 +no_defs  no_defs <>
-# Fahud
-<esri4232> +proj=longlat +ellps=clrk80 +no_defs  no_defs <>
-# Gandajika 1970
-<esri4233> +proj=longlat +ellps=intl +no_defs  no_defs <>
-# Garoua
-<esri4234> +proj=longlat +a=6378249.2 +b=6356515 +no_defs  no_defs <>
-# Guyane Francaise
-<esri4235> +proj=longlat +ellps=intl +no_defs  no_defs <>
-# Hu Tzu Shan
-<esri4236> +proj=longlat +ellps=intl +towgs84=-637,-549,-203,0,0,0,0 +no_defs  no_defs <>
-# HD72
-<esri4237> +proj=longlat +ellps=GRS67 +no_defs  no_defs <>
-# ID74
-<esri4238> +proj=longlat +a=6378160 +b=6356774.50408554 +no_defs  no_defs <>
-# Indian 1954
-<esri4239> +proj=longlat +a=6377276.345 +b=6356075.413140239 +towgs84=217,823,299,0,0,0,0 +no_defs  no_defs <>
-# Indian 1975
-<esri4240> +proj=longlat +a=6377276.345 +b=6356075.413140239 +no_defs  no_defs <>
-# Jamaica 1875
-<esri4241> +proj=longlat +ellps=clrk80 +no_defs  no_defs <>
-# JAD69
-<esri4242> +proj=longlat +ellps=clrk66 +no_defs  no_defs <>
-# Kalianpur 1880
-<esri4243> +proj=longlat +a=6377299.36559538 +b=6356098.357204817 +no_defs  no_defs <>
-# Kandawala
-<esri4244> +proj=longlat +a=6377276.345 +b=6356075.413140239 +towgs84=-97,787,86,0,0,0,0 +no_defs  no_defs <>
-# Kertau
-<esri4245> +proj=longlat +a=6377304.063 +b=6356103.038993155 +towgs84=-11,851,5,0,0,0,0 +no_defs  no_defs <>
-# KOC
-<esri4246> +proj=longlat +ellps=clrk80 +no_defs  no_defs <>
-# La Canoa
-<esri4247> +proj=longlat +ellps=intl +towgs84=-273.5,110.6,-357.9,0,0,0,0 +no_defs  no_defs <>
-# PSAD56
-<esri4248> +proj=longlat +ellps=intl +no_defs  no_defs <>
-# Lake
-<esri4249> +proj=longlat +ellps=intl +no_defs  no_defs <>
-# Leigon
-<esri4250> +proj=longlat +ellps=clrk80 +towgs84=-130,29,364,0,0,0,0 +no_defs  no_defs <>
-# Liberia 1964
-<esri4251> +proj=longlat +ellps=clrk80 +towgs84=-90,40,88,0,0,0,0 +no_defs  no_defs <>
-# Lome
-<esri4252> +proj=longlat +a=6378249.2 +b=6356515 +no_defs  no_defs <>
-# Luzon 1911
-<esri4253> +proj=longlat +ellps=clrk66 +no_defs  no_defs <>
-# Hito XVIII 1963
-<esri4254> +proj=longlat +ellps=intl +towgs84=18.38,192.45,96.82,0.056,-0.142,-0.2,-0.0013 +no_defs  no_defs <>
-# Herat North
-<esri4255> +proj=longlat +ellps=intl +towgs84=-333,-222,114,0,0,0,0 +no_defs  no_defs <>
-# Mahe 1971
-<esri4256> +proj=longlat +ellps=clrk80 +towgs84=41,-220,-134,0,0,0,0 +no_defs  no_defs <>
-# Makassar
-<esri4257> +proj=longlat +ellps=bessel +towgs84=-587.8,519.75,145.76,0,0,0,0 +no_defs  no_defs <>
-# ETRS89
-<esri4258> +proj=longlat +ellps=GRS80 +no_defs  no_defs <>
-# Malongo 1987
-<esri4259> +proj=longlat +ellps=intl +no_defs  no_defs <>
-# Manoca
-<esri4260> +proj=longlat +ellps=clrk80 +towgs84=-70.9,-151.8,-41.4,0,0,0,0 +no_defs  no_defs <>
-# Merchich
-<esri4261> +proj=longlat +a=6378249.2 +b=6356515 +towgs84=31,146,47,0,0,0,0 +no_defs  no_defs <>
-# Massawa
-<esri4262> +proj=longlat +ellps=bessel +towgs84=639,405,60,0,0,0,0 +no_defs  no_defs <>
-# Minna
-<esri4263> +proj=longlat +ellps=clrk80 +no_defs  no_defs <>
-# Mhast
-<esri4264> +proj=longlat +ellps=intl +towgs84=-252.95,-4.11,-96.38,0,0,0,0 +no_defs  no_defs <>
-# Monte Mario
-<esri4265> +proj=longlat +ellps=intl +no_defs  no_defs <>
-# M'poraloko
-<esri4266> +proj=longlat +a=6378249.2 +b=6356515 +no_defs  no_defs <>
-# NAD27
-<esri4267> +proj=longlat +ellps=clrk66 +datum=NAD27 +no_defs  no_defs <>
-# NAD27 Michigan
-<esri4268> +proj=longlat +a=6378450.047548896 +b=6356826.621488444 +no_defs  no_defs <>
-# NAD83
-<esri4269> +proj=longlat +ellps=GRS80 +datum=NAD83 +no_defs  no_defs <>
-# Nahrwan 1967
-<esri4270> +proj=longlat +ellps=clrk80 +no_defs  no_defs <>
-# Naparima 1972
-<esri4271> +proj=longlat +ellps=intl +no_defs  no_defs <>
-# NZGD49
-<esri4272> +proj=longlat +ellps=intl +no_defs  no_defs <>
-# NGO 1948
-<esri4273> +proj=longlat +a=6377492.018 +b=6356173.508712696 +towgs84=278.3,93,474.5,7.889,0.05,-6.61,6.21 +no_defs  no_defs <>
-# Datum 73
-<esri4274> +proj=longlat +ellps=intl +no_defs  no_defs <>
-# NTF
-<esri4275> +proj=longlat +a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 +no_defs  no_defs <>
-# NSWC 9Z-2
-<esri4276> +proj=longlat +ellps=WGS66 +no_defs  no_defs <>
-# OSGB 1936
-<esri4277> +proj=longlat +ellps=airy +no_defs  no_defs <>
-# OSGB70
-<esri4278> +proj=longlat +ellps=airy +no_defs  no_defs <>
-# OS(SN)80
-<esri4279> +proj=longlat +ellps=airy +no_defs  no_defs <>
-# Padang
-<esri4280> +proj=longlat +ellps=bessel +no_defs  no_defs <>
-# Palestine 1923
-<esri4281> +proj=longlat +a=6378300.789 +b=6356566.435 +no_defs  no_defs <>
-# Pointe Noire
-<esri4282> +proj=longlat +a=6378249.2 +b=6356515 +no_defs  no_defs <>
-# GDA94
-<esri4283> +proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs  no_defs <>
-# Pulkovo 1942
-<esri4284> +proj=longlat +ellps=krass +no_defs  no_defs <>
-# Qatar 1974
-<esri4285> +proj=longlat +ellps=intl +no_defs  no_defs <>
-# Qatar 1948
-<esri4286> +proj=longlat +ellps=helmert +no_defs  no_defs <>
-# Qornoq
-<esri4287> +proj=longlat +ellps=intl +towgs84=164,138,-189,0,0,0,0 +no_defs  no_defs <>
-# Loma Quintana
-<esri4288> +proj=longlat +ellps=intl +no_defs  no_defs <>
-# Amersfoort
-<esri4289> +proj=longlat +ellps=bessel +no_defs  no_defs <>
-# SAD69
-<esri4291> +proj=longlat +ellps=GRS67 +no_defs  no_defs <>
-# Sapper Hill 1943
-<esri4292> +proj=longlat +ellps=intl +towgs84=-355,21,72,0,0,0,0 +no_defs  no_defs <>
-# Schwarzeck
-<esri4293> +proj=longlat +ellps=bess_nam +no_defs  no_defs <>
-# Segora
-<esri4294> +proj=longlat +ellps=bessel +no_defs  no_defs <>
-# Serindung
-<esri4295> +proj=longlat +ellps=bessel +no_defs  no_defs <>
-# Sudan
-<esri4296> +proj=longlat +a=6378249.2 +b=6356515 +no_defs  no_defs <>
-# Tananarive
-<esri4297> +proj=longlat +ellps=intl +towgs84=-189,-242,-91,0,0,0,0 +no_defs  no_defs <>
-# Timbalai 1948
-<esri4298> +proj=longlat +ellps=evrstSS +no_defs  no_defs <>
-# TM65
-<esri4299> +proj=longlat +a=6377340.189 +b=6356034.447938534 +no_defs  no_defs <>
-# TM75
-<esri4300> +proj=longlat +a=6377340.189 +b=6356034.447938534 +no_defs  no_defs <>
-# Tokyo
-<esri4301> +proj=longlat +ellps=bessel +no_defs  no_defs <>
-# Trinidad 1903
-<esri4302> +proj=longlat +a=6378293.63683822 +b=6356617.979337744 +towgs84=-61.702,284.488,472.052,0,0,0,0 +no_defs  no_defs <>
-# TC(1948)
-<esri4303> +proj=longlat +ellps=helmert +no_defs  no_defs <>
-# Voirol 1875
-<esri4304> +proj=longlat +a=6378249.2 +b=6356515 +towgs84=-73,-247,227,0,0,0,0 +no_defs  no_defs <>
-# Bern 1938
-<esri4306> +proj=longlat +ellps=bessel +no_defs  no_defs <>
-# Nord Sahara 1959
-<esri4307> +proj=longlat +ellps=clrk80 +no_defs  no_defs <>
-# RT38
-<esri4308> +proj=longlat +ellps=bessel +no_defs  no_defs <>
-# Yacare
-<esri4309> +proj=longlat +ellps=intl +towgs84=-155,171,37,0,0,0,0 +no_defs  no_defs <>
-# Yoff
-<esri4310> +proj=longlat +a=6378249.2 +b=6356515 +no_defs  no_defs <>
-# Zanderij
-<esri4311> +proj=longlat +ellps=intl +towgs84=-265,120,-358,0,0,0,0 +no_defs  no_defs <>
-# MGI
-<esri4312> +proj=longlat +ellps=bessel +no_defs  no_defs <>
-# Belge 1972
-<esri4313> +proj=longlat +ellps=intl +no_defs  no_defs <>
-# DHDN
-<esri4314> +proj=longlat +ellps=bessel +no_defs  no_defs <>
-# Conakry 1905
-<esri4315> +proj=longlat +a=6378249.2 +b=6356515 +towgs84=-23,259,-9,0,0,0,0 +no_defs  no_defs <>
-# Dealul Piscului 1933
-<esri4316> +proj=longlat +ellps=intl +towgs84=103.25,-100.4,-307.19,0,0,0,0 +no_defs  no_defs <>
-# Dealul Piscului 1970
-<esri4317> +proj=longlat +ellps=krass +no_defs  no_defs <>
-# NGN
-<esri4318> +proj=longlat +ellps=WGS84 +no_defs  no_defs <>
-# KUDAMS
-<esri4319> +proj=longlat +ellps=GRS80 +no_defs  no_defs <>
-# WGS 72
-<esri4322> +proj=longlat +ellps=WGS72 +no_defs  no_defs <>
-# WGS 72BE
-<esri4324> +proj=longlat +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +no_defs  no_defs <>
-# WGS 84
-<esri4326> +proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs  no_defs <>
-# Anguilla 1957
-<esri4600> +proj=longlat +ellps=clrk80 +no_defs  no_defs <>
-# Antigua 1943
-<esri4601> +proj=longlat +ellps=clrk80 +towgs84=-255,-15,71,0,0,0,0 +no_defs  no_defs <>
-# Dominica 1945
-<esri4602> +proj=longlat +ellps=clrk80 +towgs84=725,685,536,0,0,0,0 +no_defs  no_defs <>
-# Grenada 1953
-<esri4603> +proj=longlat +ellps=clrk80 +towgs84=72,213.7,93,0,0,0,0 +no_defs  no_defs <>
-# Montserrat 1958
-<esri4604> +proj=longlat +ellps=clrk80 +towgs84=174,359,365,0,0,0,0 +no_defs  no_defs <>
-# St. Kitts 1955
-<esri4605> +proj=longlat +ellps=clrk80 +towgs84=9,183,236,0,0,0,0 +no_defs  no_defs <>
-# St. Lucia 1955
-<esri4606> +proj=longlat +ellps=clrk80 +towgs84=-149,128,296,0,0,0,0 +no_defs  no_defs <>
-# St. Vincent 1945
-<esri4607> +proj=longlat +ellps=clrk80 +no_defs  no_defs <>
-# NAD27(76)
-<esri4608> +proj=longlat +ellps=clrk66 +no_defs  no_defs <>
-# NAD27(CGQ77)
-<esri4609> +proj=longlat +ellps=clrk66 +no_defs  no_defs <>
-# Xian 1980
-<esri4610> +proj=longlat +a=6378140 +b=6356755.288157528 +no_defs  no_defs <>
-# Hong Kong 1980
-<esri4611> +proj=longlat +ellps=intl +towgs84=-162.619,-276.959,-161.764,0.067753,-2.24365,-1.15883,-1.09425 +no_defs  no_defs <>
-# JGD2000
-<esri4612> +proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs  no_defs <>
-# Segara
-<esri4613> +proj=longlat +ellps=bessel +towgs84=-404.78,685.68,45.47,0,0,0,0 +no_defs  no_defs <>
-# QND95
-<esri4614> +proj=longlat +ellps=intl +towgs84=-119.425,-303.659,-11.0006,1.1643,0.174458,1.09626,3.65706 +no_defs  no_defs <>
-# Porto Santo
-<esri4615> +proj=longlat +ellps=intl +no_defs  no_defs <>
-# Selvagem Grande
-<esri4616> +proj=longlat +ellps=intl +no_defs  no_defs <>
-# NAD83(CSRS)
-<esri4617> +proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs  no_defs <>
-# Bern 1898 (Bern)
-<esri4801> +proj=longlat +ellps=bessel +pm=bern +no_defs  no_defs <>
-# Bogota 1975 (Bogota)
-<esri4802> +proj=longlat +ellps=intl +pm=bogota +no_defs  no_defs <>
-# Lisbon (Lisbon)
-<esri4803> +proj=longlat +ellps=intl +pm=lisbon +no_defs  no_defs <>
-# Makassar (Jakarta)
-<esri4804> +proj=longlat +ellps=bessel +towgs84=-587.8,519.75,145.76,0,0,0,0 +pm=jakarta +no_defs  no_defs <>
-# MGI (Ferro)
-<esri4805> +proj=longlat +ellps=bessel +pm=ferro +no_defs  no_defs <>
-# Monte Mario (Rome)
-<esri4806> +proj=longlat +ellps=intl +pm=rome +no_defs  no_defs <>
-# NTF (Paris)
-<esri4807> +proj=longlat +a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 +pm=paris +no_defs  no_defs <>
-# Padang (Jakarta)
-<esri4808> +proj=longlat +ellps=bessel +pm=jakarta +no_defs  no_defs <>
-# Belge 1950 (Brussels)
-<esri4809> +proj=longlat +ellps=intl +pm=brussels +no_defs  no_defs <>
-# Tananarive (Paris)
-<esri4810> +proj=longlat +ellps=intl +towgs84=-189,-242,-91,0,0,0,0 +pm=paris +no_defs  no_defs <>
-# Voirol 1875 (Paris)
-<esri4811> +proj=longlat +a=6378249.2 +b=6356515 +towgs84=-73,-247,227,0,0,0,0 +pm=paris +no_defs  no_defs <>
-# Batavia (Jakarta)
-<esri4813> +proj=longlat +ellps=bessel +pm=jakarta +no_defs  no_defs <>
-# RT38 (Stockholm)
-<esri4814> +proj=longlat +ellps=bessel +pm=stockholm +no_defs  no_defs <>
-# Greek (Athens)
-<esri4815> +proj=longlat +ellps=bessel +pm=athens +no_defs  no_defs <>
-# Carthage (Paris)
-<esri4816> +proj=longlat +a=6378249.2 +b=6356515 +pm=paris +no_defs  no_defs <>
-# NGO 1948 (Oslo)
-<esri4817> +proj=longlat +a=6377492.018 +b=6356173.508712696 +towgs84=278.3,93,474.5,7.889,0.05,-6.61,6.21 +pm=oslo +no_defs  no_defs <>
-# S-JTSK (Ferro)
-<esri4818> +proj=longlat +ellps=bessel +pm=ferro +no_defs  no_defs <>
-# Nord Sahara 1959 (Paris)
-<esri4819> +proj=longlat +ellps=clrk80 +pm=paris +no_defs  no_defs <>
-# Segara (Jakarta)
-<esri4820> +proj=longlat +ellps=bessel +pm=jakarta +no_defs  no_defs <>
-# ATF (Paris)
-<esri4901> +proj=longlat +a=6376523 +b=6355862.933255573 +pm=paris +no_defs  no_defs <>
-# NDG (Paris)
-<esri4902> +proj=longlat +a=6376523 +b=6355862.933255573 +pm=paris +no_defs  no_defs <>
-# Madrid 1870 (Madrid)
-<esri4903> +proj=longlat +a=6378298.3 +b=6356657.142669562 +pm=madrid +no_defs  no_defs <>
-# Lisbon 1890 (Lisbon)
-<esri4904> +proj=longlat +ellps=bessel +pm=lisbon +no_defs  no_defs <>
-# Pulkovo 1995 / Gauss-Kruger zone 4
-<esri20004> +proj=tmerc +lat_0=0 +lon_0=21 +k=1.000000 +x_0=4500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / Gauss-Kruger zone 5
-<esri20005> +proj=tmerc +lat_0=0 +lon_0=27 +k=1.000000 +x_0=5500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / Gauss-Kruger zone 6
-<esri20006> +proj=tmerc +lat_0=0 +lon_0=33 +k=1.000000 +x_0=6500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / Gauss-Kruger zone 7
-<esri20007> +proj=tmerc +lat_0=0 +lon_0=39 +k=1.000000 +x_0=7500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / Gauss-Kruger zone 8
-<esri20008> +proj=tmerc +lat_0=0 +lon_0=45 +k=1.000000 +x_0=8500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / Gauss-Kruger zone 9
-<esri20009> +proj=tmerc +lat_0=0 +lon_0=51 +k=1.000000 +x_0=9500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / Gauss-Kruger zone 10
-<esri20010> +proj=tmerc +lat_0=0 +lon_0=57 +k=1.000000 +x_0=10500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / Gauss-Kruger zone 11
-<esri20011> +proj=tmerc +lat_0=0 +lon_0=63 +k=1.000000 +x_0=11500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / Gauss-Kruger zone 12
-<esri20012> +proj=tmerc +lat_0=0 +lon_0=69 +k=1.000000 +x_0=12500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / Gauss-Kruger zone 13
-<esri20013> +proj=tmerc +lat_0=0 +lon_0=75 +k=1.000000 +x_0=13500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / Gauss-Kruger zone 14
-<esri20014> +proj=tmerc +lat_0=0 +lon_0=81 +k=1.000000 +x_0=14500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / Gauss-Kruger zone 15
-<esri20015> +proj=tmerc +lat_0=0 +lon_0=87 +k=1.000000 +x_0=15500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / Gauss-Kruger zone 16
-<esri20016> +proj=tmerc +lat_0=0 +lon_0=93 +k=1.000000 +x_0=16500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / Gauss-Kruger zone 17
-<esri20017> +proj=tmerc +lat_0=0 +lon_0=99 +k=1.000000 +x_0=17500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / Gauss-Kruger zone 18
-<esri20018> +proj=tmerc +lat_0=0 +lon_0=105 +k=1.000000 +x_0=18500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / Gauss-Kruger zone 19
-<esri20019> +proj=tmerc +lat_0=0 +lon_0=111 +k=1.000000 +x_0=19500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / Gauss-Kruger zone 20
-<esri20020> +proj=tmerc +lat_0=0 +lon_0=117 +k=1.000000 +x_0=20500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / Gauss-Kruger zone 21
-<esri20021> +proj=tmerc +lat_0=0 +lon_0=123 +k=1.000000 +x_0=21500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / Gauss-Kruger zone 22
-<esri20022> +proj=tmerc +lat_0=0 +lon_0=129 +k=1.000000 +x_0=22500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / Gauss-Kruger zone 23
-<esri20023> +proj=tmerc +lat_0=0 +lon_0=135 +k=1.000000 +x_0=23500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / Gauss-Kruger zone 24
-<esri20024> +proj=tmerc +lat_0=0 +lon_0=141 +k=1.000000 +x_0=24500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / Gauss-Kruger zone 25
-<esri20025> +proj=tmerc +lat_0=0 +lon_0=147 +k=1.000000 +x_0=25500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / Gauss-Kruger zone 26
-<esri20026> +proj=tmerc +lat_0=0 +lon_0=153 +k=1.000000 +x_0=26500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / Gauss-Kruger zone 27
-<esri20027> +proj=tmerc +lat_0=0 +lon_0=159 +k=1.000000 +x_0=27500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / Gauss-Kruger zone 28
-<esri20028> +proj=tmerc +lat_0=0 +lon_0=165 +k=1.000000 +x_0=28500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / Gauss-Kruger zone 29
-<esri20029> +proj=tmerc +lat_0=0 +lon_0=171 +k=1.000000 +x_0=29500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / Gauss-Kruger zone 30
-<esri20030> +proj=tmerc +lat_0=0 +lon_0=177 +k=1.000000 +x_0=30500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / Gauss-Kruger zone 31
-<esri20031> +proj=tmerc +lat_0=0 +lon_0=-177 +k=1.000000 +x_0=31500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / Gauss-Kruger zone 32
-<esri20032> +proj=tmerc +lat_0=0 +lon_0=-171 +k=1.000000 +x_0=32500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / Gauss-Kruger 4N
-<esri20064> +proj=tmerc +lat_0=0 +lon_0=21 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / Gauss-Kruger 5N
-<esri20065> +proj=tmerc +lat_0=0 +lon_0=27 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / Gauss-Kruger 6N
-<esri20066> +proj=tmerc +lat_0=0 +lon_0=33 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / Gauss-Kruger 7N
-<esri20067> +proj=tmerc +lat_0=0 +lon_0=39 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / Gauss-Kruger 8N
-<esri20068> +proj=tmerc +lat_0=0 +lon_0=45 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / Gauss-Kruger 9N
-<esri20069> +proj=tmerc +lat_0=0 +lon_0=51 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / Gauss-Kruger 10N
-<esri20070> +proj=tmerc +lat_0=0 +lon_0=57 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / Gauss-Kruger 11N
-<esri20071> +proj=tmerc +lat_0=0 +lon_0=63 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / Gauss-Kruger 12N
-<esri20072> +proj=tmerc +lat_0=0 +lon_0=69 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / Gauss-Kruger 13N
-<esri20073> +proj=tmerc +lat_0=0 +lon_0=75 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / Gauss-Kruger 14N
-<esri20074> +proj=tmerc +lat_0=0 +lon_0=81 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / Gauss-Kruger 15N
-<esri20075> +proj=tmerc +lat_0=0 +lon_0=87 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / Gauss-Kruger 16N
-<esri20076> +proj=tmerc +lat_0=0 +lon_0=93 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / Gauss-Kruger 17N
-<esri20077> +proj=tmerc +lat_0=0 +lon_0=99 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / Gauss-Kruger 18N
-<esri20078> +proj=tmerc +lat_0=0 +lon_0=105 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / Gauss-Kruger 19N
-<esri20079> +proj=tmerc +lat_0=0 +lon_0=111 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / Gauss-Kruger 20N
-<esri20080> +proj=tmerc +lat_0=0 +lon_0=117 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / Gauss-Kruger 21N
-<esri20081> +proj=tmerc +lat_0=0 +lon_0=123 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / Gauss-Kruger 22N
-<esri20082> +proj=tmerc +lat_0=0 +lon_0=129 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / Gauss-Kruger 23N
-<esri20083> +proj=tmerc +lat_0=0 +lon_0=135 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / Gauss-Kruger 24N
-<esri20084> +proj=tmerc +lat_0=0 +lon_0=141 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / Gauss-Kruger 25N
-<esri20085> +proj=tmerc +lat_0=0 +lon_0=147 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / Gauss-Kruger 26N
-<esri20086> +proj=tmerc +lat_0=0 +lon_0=153 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / Gauss-Kruger 27N
-<esri20087> +proj=tmerc +lat_0=0 +lon_0=159 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / Gauss-Kruger 28N
-<esri20088> +proj=tmerc +lat_0=0 +lon_0=165 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / Gauss-Kruger 29N
-<esri20089> +proj=tmerc +lat_0=0 +lon_0=171 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / Gauss-Kruger 30N
-<esri20090> +proj=tmerc +lat_0=0 +lon_0=177 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / Gauss-Kruger 31N
-<esri20091> +proj=tmerc +lat_0=0 +lon_0=-177 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1995 / Gauss-Kruger 32N
-<esri20092> +proj=tmerc +lat_0=0 +lon_0=-171 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Adindan / UTM zone 37N
-<esri20137> +proj=utm +zone=37 +ellps=clrk80 +units=m +no_defs  no_defs <>
-# Adindan / UTM zone 38N
-<esri20138> +proj=utm +zone=38 +ellps=clrk80 +units=m +no_defs  no_defs <>
-# AGD66 / AMG zone 48
-<esri20248> +proj=utm +zone=48 +south +ellps=aust_SA +units=m +no_defs  no_defs <>
-# AGD66 / AMG zone 49
-<esri20249> +proj=utm +zone=49 +south +ellps=aust_SA +units=m +no_defs  no_defs <>
-# AGD66 / AMG zone 50
-<esri20250> +proj=utm +zone=50 +south +ellps=aust_SA +units=m +no_defs  no_defs <>
-# AGD66 / AMG zone 51
-<esri20251> +proj=utm +zone=51 +south +ellps=aust_SA +units=m +no_defs  no_defs <>
-# AGD66 / AMG zone 52
-<esri20252> +proj=utm +zone=52 +south +ellps=aust_SA +units=m +no_defs  no_defs <>
-# AGD66 / AMG zone 53
-<esri20253> +proj=utm +zone=53 +south +ellps=aust_SA +units=m +no_defs  no_defs <>
-# AGD66 / AMG zone 54
-<esri20254> +proj=utm +zone=54 +south +ellps=aust_SA +units=m +no_defs  no_defs <>
-# AGD66 / AMG zone 55
-<esri20255> +proj=utm +zone=55 +south +ellps=aust_SA +units=m +no_defs  no_defs <>
-# AGD66 / AMG zone 56
-<esri20256> +proj=utm +zone=56 +south +ellps=aust_SA +units=m +no_defs  no_defs <>
-# AGD66 / AMG zone 57
-<esri20257> +proj=utm +zone=57 +south +ellps=aust_SA +units=m +no_defs  no_defs <>
-# AGD66 / AMG zone 58
-<esri20258> +proj=utm +zone=58 +south +ellps=aust_SA +units=m +no_defs  no_defs <>
-# AGD84 / AMG zone 48
-<esri20348> +proj=utm +zone=48 +south +ellps=aust_SA +units=m +no_defs  no_defs <>
-# AGD84 / AMG zone 49
-<esri20349> +proj=utm +zone=49 +south +ellps=aust_SA +units=m +no_defs  no_defs <>
-# AGD84 / AMG zone 50
-<esri20350> +proj=utm +zone=50 +south +ellps=aust_SA +units=m +no_defs  no_defs <>
-# AGD84 / AMG zone 51
-<esri20351> +proj=utm +zone=51 +south +ellps=aust_SA +units=m +no_defs  no_defs <>
-# AGD84 / AMG zone 52
-<esri20352> +proj=utm +zone=52 +south +ellps=aust_SA +units=m +no_defs  no_defs <>
-# AGD84 / AMG zone 53
-<esri20353> +proj=utm +zone=53 +south +ellps=aust_SA +units=m +no_defs  no_defs <>
-# AGD84 / AMG zone 54
-<esri20354> +proj=utm +zone=54 +south +ellps=aust_SA +units=m +no_defs  no_defs <>
-# AGD84 / AMG zone 55
-<esri20355> +proj=utm +zone=55 +south +ellps=aust_SA +units=m +no_defs  no_defs <>
-# AGD84 / AMG zone 56
-<esri20356> +proj=utm +zone=56 +south +ellps=aust_SA +units=m +no_defs  no_defs <>
-# AGD84 / AMG zone 57
-<esri20357> +proj=utm +zone=57 +south +ellps=aust_SA +units=m +no_defs  no_defs <>
-# AGD84 / AMG zone 58
-<esri20358> +proj=utm +zone=58 +south +ellps=aust_SA +units=m +no_defs  no_defs <>
-# Ain el Abd / UTM zone 37N
-<esri20437> +proj=utm +zone=37 +ellps=intl +units=m +no_defs  no_defs <>
-# Ain el Abd / UTM zone 38N
-<esri20438> +proj=utm +zone=38 +ellps=intl +units=m +no_defs  no_defs <>
-# Ain el Abd / UTM zone 39N
-<esri20439> +proj=utm +zone=39 +ellps=intl +units=m +no_defs  no_defs <>
-# Ain el Abd / Bahrain Grid
-<esri20499> +proj=utm +zone=39 +ellps=intl +units=m +no_defs  no_defs <>
-# Afgooye / UTM zone 38N
-<esri20538> +proj=utm +zone=38 +ellps=krass +towgs84=-43,-163,45,0,0,0,0 +units=m +no_defs  no_defs <>
-# Afgooye / UTM zone 39N
-<esri20539> +proj=utm +zone=39 +ellps=krass +towgs84=-43,-163,45,0,0,0,0 +units=m +no_defs  no_defs <>
-# Lisbon (Lisbon)/Portuguese National Grid
-<esri20790> +proj=tmerc +lat_0=39.66666666666666 +lon_0=-8.131906111111112 +k=1.000000 +x_0=200000 +y_0=300000 +ellps=intl +pm=lisbon +units=m +no_defs  no_defs <>
-# Lisbon (Lisbon)/Portuguese Grid
-<esri20791> +proj=tmerc +lat_0=39.66666666666666 +lon_0=-8.131906111111112 +k=1.000000 +x_0=0 +y_0=0 +ellps=intl +pm=lisbon +units=m +no_defs  no_defs <>
-# Aratu / UTM zone 22S
-<esri20822> +proj=utm +zone=22 +south +ellps=intl +units=m +no_defs  no_defs <>
-# Aratu / UTM zone 23S
-<esri20823> +proj=utm +zone=23 +south +ellps=intl +units=m +no_defs  no_defs <>
-# Aratu / UTM zone 24S
-<esri20824> +proj=utm +zone=24 +south +ellps=intl +units=m +no_defs  no_defs <>
-# Arc 1950 / UTM zone 34S
-<esri20934> +proj=utm +zone=34 +south +a=6378249.145 +b=6356514.966398753 +units=m +no_defs  no_defs <>
-# Arc 1950 / UTM zone 35S
-<esri20935> +proj=utm +zone=35 +south +a=6378249.145 +b=6356514.966398753 +units=m +no_defs  no_defs <>
-# Arc 1950 / UTM zone 36S
-<esri20936> +proj=utm +zone=36 +south +a=6378249.145 +b=6356514.966398753 +units=m +no_defs  no_defs <>
-# Arc 1960 / UTM zone 35S
-<esri21035> +proj=utm +zone=35 +south +ellps=clrk80 +units=m +no_defs  no_defs <>
-# Arc 1960 / UTM zone 36S
-<esri21036> +proj=utm +zone=36 +south +ellps=clrk80 +units=m +no_defs  no_defs <>
-# Arc 1960 / UTM zone 37S
-<esri21037> +proj=utm +zone=37 +south +ellps=clrk80 +units=m +no_defs  no_defs <>
-# Arc 1960 / UTM zone 35N
-<esri21095> +proj=utm +zone=35 +ellps=clrk80 +units=m +no_defs  no_defs <>
-# Arc 1960 / UTM zone 36N
-<esri21096> +proj=utm +zone=36 +ellps=clrk80 +units=m +no_defs  no_defs <>
-# Arc 1960 / UTM zone 37N
-<esri21097> +proj=utm +zone=37 +ellps=clrk80 +units=m +no_defs  no_defs <>
-# Batavia (Jakarta) / NEIEZ
-<esri21100> +proj=merc +lat_ts=0 +lon_0=216.8077194444444 +k=0.997000 +x_0=3900000 +y_0=900000 +ellps=bessel +pm=jakarta +units=m +no_defs  no_defs <>
-# Batavia / UTM zone 48S
-<esri21148> +proj=utm +zone=48 +south +ellps=bessel +units=m +no_defs  no_defs <>
-# Batavia / UTM zone 49S
-<esri21149> +proj=utm +zone=49 +south +ellps=bessel +units=m +no_defs  no_defs <>
-# Batavia / UTM zone 50S
-<esri21150> +proj=utm +zone=50 +south +ellps=bessel +units=m +no_defs  no_defs <>
-# Barbados 1938 / British West Indies Grid
-<esri21291> +proj=tmerc +lat_0=0 +lon_0=-62 +k=0.999500 +x_0=400000 +y_0=0 +ellps=clrk80 +units=m +no_defs  no_defs <>
-# Barbados 1938 / Barbados National Grid
-<esri21292> +proj=tmerc +lat_0=13.17638888888889 +lon_0=-59.55972222222222 +k=0.999999 +x_0=30000 +y_0=75000 +ellps=clrk80 +units=m +no_defs  no_defs <>
-# Beijing 1954 / Gauss-Kruger zone 13
-<esri21413> +proj=tmerc +lat_0=0 +lon_0=75 +k=1.000000 +x_0=13500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Beijing 1954 / Gauss-Kruger zone 14
-<esri21414> +proj=tmerc +lat_0=0 +lon_0=81 +k=1.000000 +x_0=14500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Beijing 1954 / Gauss-Kruger zone 15
-<esri21415> +proj=tmerc +lat_0=0 +lon_0=87 +k=1.000000 +x_0=15500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Beijing 1954 / Gauss-Kruger zone 16
-<esri21416> +proj=tmerc +lat_0=0 +lon_0=93 +k=1.000000 +x_0=16500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Beijing 1954 / Gauss-Kruger zone 17
-<esri21417> +proj=tmerc +lat_0=0 +lon_0=99 +k=1.000000 +x_0=17500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Beijing 1954 / Gauss-Kruger zone 18
-<esri21418> +proj=tmerc +lat_0=0 +lon_0=105 +k=1.000000 +x_0=18500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Beijing 1954 / Gauss-Kruger zone 19
-<esri21419> +proj=tmerc +lat_0=0 +lon_0=111 +k=1.000000 +x_0=19500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Beijing 1954 / Gauss-Kruger zone 20
-<esri21420> +proj=tmerc +lat_0=0 +lon_0=117 +k=1.000000 +x_0=20500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Beijing 1954 / Gauss-Kruger zone 21
-<esri21421> +proj=tmerc +lat_0=0 +lon_0=123 +k=1.000000 +x_0=21500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Beijing 1954 / Gauss-Kruger zone 22
-<esri21422> +proj=tmerc +lat_0=0 +lon_0=129 +k=1.000000 +x_0=22500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Beijing 1954 / Gauss-Kruger zone 23
-<esri21423> +proj=tmerc +lat_0=0 +lon_0=135 +k=1.000000 +x_0=23500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Beijing 1954 / Gauss-Kruger CM 75E
-<esri21453> +proj=tmerc +lat_0=0 +lon_0=75 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Beijing 1954 / Gauss-Kruger CM 81E
-<esri21454> +proj=tmerc +lat_0=0 +lon_0=81 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Beijing 1954 / Gauss-Kruger CM 87E
-<esri21455> +proj=tmerc +lat_0=0 +lon_0=87 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Beijing 1954 / Gauss-Kruger CM 93E
-<esri21456> +proj=tmerc +lat_0=0 +lon_0=93 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Beijing 1954 / Gauss-Kruger CM 99E
-<esri21457> +proj=tmerc +lat_0=0 +lon_0=99 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Beijing 1954 / Gauss-Kruger CM 105E
-<esri21458> +proj=tmerc +lat_0=0 +lon_0=105 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Beijing 1954 / Gauss-Kruger CM 111E
-<esri21459> +proj=tmerc +lat_0=0 +lon_0=111 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Beijing 1954 / Gauss-Kruger CM 117E
-<esri21460> +proj=tmerc +lat_0=0 +lon_0=117 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Beijing 1954 / Gauss-Kruger CM 123E
-<esri21461> +proj=tmerc +lat_0=0 +lon_0=123 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Beijing 1954 / Gauss-Kruger CM 129E
-<esri21462> +proj=tmerc +lat_0=0 +lon_0=129 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Beijing 1954 / Gauss-Kruger CM 135E
-<esri21463> +proj=tmerc +lat_0=0 +lon_0=135 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Beijing 1954 / Gauss-Kruger 13N
-<esri21473> +proj=tmerc +lat_0=0 +lon_0=75 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Beijing 1954 / Gauss-Kruger 14N
-<esri21474> +proj=tmerc +lat_0=0 +lon_0=81 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Beijing 1954 / Gauss-Kruger 15N
-<esri21475> +proj=tmerc +lat_0=0 +lon_0=87 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Beijing 1954 / Gauss-Kruger 16N
-<esri21476> +proj=tmerc +lat_0=0 +lon_0=93 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Beijing 1954 / Gauss-Kruger 17N
-<esri21477> +proj=tmerc +lat_0=0 +lon_0=99 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Beijing 1954 / Gauss-Kruger 18N
-<esri21478> +proj=tmerc +lat_0=0 +lon_0=105 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Beijing 1954 / Gauss-Kruger 19N
-<esri21479> +proj=tmerc +lat_0=0 +lon_0=111 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Beijing 1954 / Gauss-Kruger 20N
-<esri21480> +proj=tmerc +lat_0=0 +lon_0=117 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Beijing 1954 / Gauss-Kruger 21N
-<esri21481> +proj=tmerc +lat_0=0 +lon_0=123 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Beijing 1954 / Gauss-Kruger 22N
-<esri21482> +proj=tmerc +lat_0=0 +lon_0=129 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Beijing 1954 / Gauss-Kruger 23N
-<esri21483> +proj=tmerc +lat_0=0 +lon_0=135 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Belge 1950 (Brussels) / Belge Lambert 50
-<esri21500> +proj=lcc +lat_1=49.83333333333334 +lat_2=51.16666666666666 +lat_0=90 +lon_0=4.367975 +x_0=150000 +y_0=5400000 +ellps=intl +pm=brussels +units=m +no_defs  no_defs <>
-# Bern 1898 (Bern) / LV03C
-<esri21780> +proj=omerc +lat_0=46.95240555555556 +lonc=7.439583333333333 +alpha=90 +k=1 +x_0=0 +y_0=0 +ellps=bessel +pm=bern +units=m +no_defs  no_defs <>
-# CH1903 / LV03
-<esri21781> +proj=omerc +lat_0=46.95240555555556 +lonc=7.439583333333333 +alpha=90 +k=1 +x_0=600000 +y_0=200000 +ellps=bessel +units=m +no_defs  no_defs <>
-# Bogota 1975 / UTM zone 17N
-<esri21817> +proj=utm +zone=17 +ellps=intl +units=m +no_defs  no_defs <>
-# Bogota 1975 / UTM zone 18N
-<esri21818> +proj=utm +zone=18 +ellps=intl +units=m +no_defs  no_defs <>
-# Bogota 1975 / Colombia West zone
-<esri21891> +proj=tmerc +lat_0=4.599047222222222 +lon_0=-77.08091666666667 +k=1.000000 +x_0=1000000 +y_0=1000000 +ellps=intl +units=m +no_defs  no_defs <>
-# Bogota 1975 / Colombia Bogota zone
-<esri21892> +proj=tmerc +lat_0=4.599047222222222 +lon_0=-74.08091666666667 +k=1.000000 +x_0=1000000 +y_0=1000000 +ellps=intl +units=m +no_defs  no_defs <>
-# Bogota 1975 / Colombia East Central zone
-<esri21893> +proj=tmerc +lat_0=4.599047222222222 +lon_0=-71.08091666666667 +k=1.000000 +x_0=1000000 +y_0=1000000 +ellps=intl +units=m +no_defs  no_defs <>
-# Bogota 1975 / Colombia East
-<esri21894> +proj=tmerc +lat_0=4.599047222222222 +lon_0=-68.08091666666667 +k=1.000000 +x_0=1000000 +y_0=1000000 +ellps=intl +units=m +no_defs  no_defs <>
-# Camacupa / UTM zone 32S
-<esri22032> +proj=utm +zone=32 +south +ellps=clrk80 +units=m +no_defs  no_defs <>
-# Camacupa / UTM zone 33S
-<esri22033> +proj=utm +zone=33 +south +ellps=clrk80 +units=m +no_defs  no_defs <>
-# Camacupa / TM 11.30 SE
-<esri22091> +proj=tmerc +lat_0=0 +lon_0=11.5 +k=0.999600 +x_0=500000 +y_0=10000000 +ellps=clrk80 +units=m +no_defs  no_defs <>
-# Camacupa / TM 12 SE
-<esri22092> +proj=tmerc +lat_0=0 +lon_0=12 +k=0.999600 +x_0=500000 +y_0=10000000 +ellps=clrk80 +units=m +no_defs  no_defs <>
-# Campo Inchauspe / Argentina 1
-<esri22191> +proj=tmerc +lat_0=-90 +lon_0=-72 +k=1.000000 +x_0=1500000 +y_0=0 +ellps=intl +units=m +no_defs  no_defs <>
-# Campo Inchauspe / Argentina 2
-<esri22192> +proj=tmerc +lat_0=-90 +lon_0=-69 +k=1.000000 +x_0=2500000 +y_0=0 +ellps=intl +units=m +no_defs  no_defs <>
-# Campo Inchauspe / Argentina 3
-<esri22193> +proj=tmerc +lat_0=-90 +lon_0=-66 +k=1.000000 +x_0=3500000 +y_0=0 +ellps=intl +units=m +no_defs  no_defs <>
-# Campo Inchauspe / Argentina 4
-<esri22194> +proj=tmerc +lat_0=-90 +lon_0=-63 +k=1.000000 +x_0=4500000 +y_0=0 +ellps=intl +units=m +no_defs  no_defs <>
-# Campo Inchauspe / Argentina 5
-<esri22195> +proj=tmerc +lat_0=-90 +lon_0=-60 +k=1.000000 +x_0=5500000 +y_0=0 +ellps=intl +units=m +no_defs  no_defs <>
-# Campo Inchauspe / Argentina 6
-<esri22196> +proj=tmerc +lat_0=-90 +lon_0=-57 +k=1.000000 +x_0=6500000 +y_0=0 +ellps=intl +units=m +no_defs  no_defs <>
-# Campo Inchauspe / Argentina 7
-<esri22197> +proj=tmerc +lat_0=-90 +lon_0=-54 +k=1.000000 +x_0=7500000 +y_0=0 +ellps=intl +units=m +no_defs  no_defs <>
-# Cape / UTM zone 34S
-<esri22234> +proj=utm +zone=34 +south +a=6378249.145 +b=6356514.966398753 +units=m +no_defs  no_defs <>
-# Cape / UTM zone 35S
-<esri22235> +proj=utm +zone=35 +south +a=6378249.145 +b=6356514.966398753 +units=m +no_defs  no_defs <>
-# Cape / UTM zone 36S
-<esri22236> +proj=utm +zone=36 +south +a=6378249.145 +b=6356514.966398753 +units=m +no_defs  no_defs <>
-# South African Coordinate System zone 15
-# South African Coordinate System zone 17
-# South African Coordinate System zone 19
-# South African Coordinate System zone 21
-# South African Coordinate System zone 23
-# South African Coordinate System zone 25
-# South African Coordinate System zone 27
-# South African Coordinate System zone 29
-# South African Coordinate System zone 31
-# South African Coordinate System zone 33
-# Carthage (Paris) / Tunisia Mining Grid
-# Carthage / UTM zone 32N
-<esri22332> +proj=utm +zone=32 +a=6378249.2 +b=6356515 +units=m +no_defs  no_defs <>
-# Carthage / Nord Tunisie
-<esri22391> +proj=lcc +lat_1=36 +lat_0=36 +lon_0=9.9 +k_0=0.999625544 +x_0=500000 +y_0=300000 +a=6378249.2 +b=6356515 +units=m +no_defs  no_defs <>
-# Carthage / Sud Tunisie
-<esri22392> +proj=lcc +lat_1=33.3 +lat_0=33.3 +lon_0=9.9 +k_0=0.999625769 +x_0=500000 +y_0=300000 +a=6378249.2 +b=6356515 +units=m +no_defs  no_defs <>
-# Corrego Alegre / UTM zone 23S
-<esri22523> +proj=utm +zone=23 +south +ellps=intl +towgs84=-206,172,-6,0,0,0,0 +units=m +no_defs  no_defs <>
-# Corrego Alegre / UTM zone 24S
-<esri22524> +proj=utm +zone=24 +south +ellps=intl +towgs84=-206,172,-6,0,0,0,0 +units=m +no_defs  no_defs <>
-# Deir ez Zor / Levant Zone
-<esri22700> +proj=lcc +lat_1=34.65 +lat_0=34.65 +lon_0=37.35 +k_0=0.9996256 +x_0=300000 +y_0=300000 +a=6378249.2 +b=6356515 +units=m +no_defs  no_defs <>
-# Deir ez Zor / Syria Lambert
-<esri22770> +proj=lcc +lat_1=34.65 +lat_0=34.65 +lon_0=37.35 +k_0=0.9996256 +x_0=300000 +y_0=300000 +a=6378249.2 +b=6356515 +units=m +no_defs  no_defs <>
-# Deir ez Zor / Levant Stereographic
-<esri22780> +proj=stere +lat_0=34.2 +lon_0=39.15 +k=0.999534 +x_0=0 +y_0=0 +a=6378249.2 +b=6356515 +units=m +no_defs  no_defs <>
-# Douala / UTM zone 32N
-<esri22832> +proj=utm +zone=32 +a=6378249.2 +b=6356515 +units=m +no_defs  no_defs <>
-# Egypt 1907 / Blue Belt
-<esri22991> +proj=tmerc +lat_0=30 +lon_0=35 +k=1.000000 +x_0=300000 +y_0=1100000 +ellps=helmert +units=m +no_defs  no_defs <>
-# Egypt 1907 / Red Belt
-<esri22992> +proj=tmerc +lat_0=30 +lon_0=31 +k=1.000000 +x_0=615000 +y_0=810000 +ellps=helmert +units=m +no_defs  no_defs <>
-# Egypt 1907 / Purple Belt
-<esri22993> +proj=tmerc +lat_0=30 +lon_0=27 +k=1.000000 +x_0=700000 +y_0=200000 +ellps=helmert +units=m +no_defs  no_defs <>
-# Egypt 1907 / Extended Purple Belt
-<esri22994> +proj=tmerc +lat_0=30 +lon_0=27 +k=1.000000 +x_0=700000 +y_0=1200000 +ellps=helmert +units=m +no_defs  no_defs <>
-# ED50 / UTM zone 28N
-<esri23028> +proj=utm +zone=28 +ellps=intl +units=m +no_defs  no_defs <>
-# ED50 / UTM zone 29N
-<esri23029> +proj=utm +zone=29 +ellps=intl +units=m +no_defs  no_defs <>
-# ED50 / UTM zone 30N
-<esri23030> +proj=utm +zone=30 +ellps=intl +units=m +no_defs  no_defs <>
-# ED50 / UTM zone 31N
-<esri23031> +proj=utm +zone=31 +ellps=intl +units=m +no_defs  no_defs <>
-# ED50 / UTM zone 32N
-<esri23032> +proj=utm +zone=32 +ellps=intl +units=m +no_defs  no_defs <>
-# ED50 / UTM zone 33N
-<esri23033> +proj=utm +zone=33 +ellps=intl +units=m +no_defs  no_defs <>
-# ED50 / UTM zone 34N
-<esri23034> +proj=utm +zone=34 +ellps=intl +units=m +no_defs  no_defs <>
-# ED50 / UTM zone 35N
-<esri23035> +proj=utm +zone=35 +ellps=intl +units=m +no_defs  no_defs <>
-# ED50 / UTM zone 36N
-<esri23036> +proj=utm +zone=36 +ellps=intl +units=m +no_defs  no_defs <>
-# ED50 / UTM zone 37N
-<esri23037> +proj=utm +zone=37 +ellps=intl +units=m +no_defs  no_defs <>
-# ED50 / UTM zone 38N
-<esri23038> +proj=utm +zone=38 +ellps=intl +units=m +no_defs  no_defs <>
-# ED50 / TM 0 N
-<esri23090> +proj=tmerc +lat_0=0 +lon_0=0 +k=0.999600 +x_0=500000 +y_0=0 +ellps=intl +units=m +no_defs  no_defs <>
-# ED50 / TM 5 NE
-<esri23095> +proj=tmerc +lat_0=0 +lon_0=5 +k=0.999600 +x_0=500000 +y_0=0 +ellps=intl +units=m +no_defs  no_defs <>
-# Fahud / UTM zone 39N
-<esri23239> +proj=utm +zone=39 +ellps=clrk80 +units=m +no_defs  no_defs <>
-# Fahud / UTM zone 40N
-<esri23240> +proj=utm +zone=40 +ellps=clrk80 +units=m +no_defs  no_defs <>
-# Garoua / UTM zone 33N
-<esri23433> +proj=utm +zone=33 +a=6378249.2 +b=6356515 +units=m +no_defs  no_defs <>
-# HD72 / EOV
-<esri23700> +proj=omerc +lat_0=47.14439372222222 +lonc=19.04857177777778 +alpha=90 +k=0.99993 +x_0=650000 +y_0=200000 +ellps=GRS67 +units=m +no_defs  no_defs <>
-# ID74 / UTM zone 46N
-<esri23846> +proj=utm +zone=46 +a=6378160 +b=6356774.50408554 +units=m +no_defs  no_defs <>
-# ID74 / UTM zone 47N
-<esri23847> +proj=utm +zone=47 +a=6378160 +b=6356774.50408554 +units=m +no_defs  no_defs <>
-# ID74 / UTM zone 48N
-<esri23848> +proj=utm +zone=48 +a=6378160 +b=6356774.50408554 +units=m +no_defs  no_defs <>
-# ID74 / UTM zone 49N
-<esri23849> +proj=utm +zone=49 +a=6378160 +b=6356774.50408554 +units=m +no_defs  no_defs <>
-# ID74 / UTM zone 50N
-<esri23850> +proj=utm +zone=50 +a=6378160 +b=6356774.50408554 +units=m +no_defs  no_defs <>
-# ID74 / UTM zone 51N
-<esri23851> +proj=utm +zone=51 +a=6378160 +b=6356774.50408554 +units=m +no_defs  no_defs <>
-# ID74 / UTM zone 52N
-<esri23852> +proj=utm +zone=52 +a=6378160 +b=6356774.50408554 +units=m +no_defs  no_defs <>
-# ID74 / UTM zone 53N
-<esri23853> +proj=utm +zone=53 +a=6378160 +b=6356774.50408554 +units=m +no_defs  no_defs <>
-# ID74 / UTM zone 46S
-<esri23886> +proj=utm +zone=46 +south +a=6378160 +b=6356774.50408554 +units=m +no_defs  no_defs <>
-# ID74 / UTM zone 47S
-<esri23887> +proj=utm +zone=47 +south +a=6378160 +b=6356774.50408554 +units=m +no_defs  no_defs <>
-# ID74 / UTM zone 48S
-<esri23888> +proj=utm +zone=48 +south +a=6378160 +b=6356774.50408554 +units=m +no_defs  no_defs <>
-# ID74 / UTM zone 49S
-<esri23889> +proj=utm +zone=49 +south +a=6378160 +b=6356774.50408554 +units=m +no_defs  no_defs <>
-# ID74 / UTM zone 50S
-<esri23890> +proj=utm +zone=50 +south +a=6378160 +b=6356774.50408554 +units=m +no_defs  no_defs <>
-# ID74 / UTM zone 51S
-<esri23891> +proj=utm +zone=51 +south +a=6378160 +b=6356774.50408554 +units=m +no_defs  no_defs <>
-# ID74 / UTM zone 52S
-<esri23892> +proj=utm +zone=52 +south +a=6378160 +b=6356774.50408554 +units=m +no_defs  no_defs <>
-# ID74 / UTM zone 53S
-<esri23893> +proj=utm +zone=53 +south +a=6378160 +b=6356774.50408554 +units=m +no_defs  no_defs <>
-# ID74 / UTM zone 54S
-<esri23894> +proj=utm +zone=54 +south +a=6378160 +b=6356774.50408554 +units=m +no_defs  no_defs <>
-# Indian 1954 / UTM zone 46N
-<esri23946> +proj=utm +zone=46 +a=6377276.345 +b=6356075.413140239 +towgs84=217,823,299,0,0,0,0 +units=m +no_defs  no_defs <>
-# Indian 1954 / UTM zone 47N
-<esri23947> +proj=utm +zone=47 +a=6377276.345 +b=6356075.413140239 +towgs84=217,823,299,0,0,0,0 +units=m +no_defs  no_defs <>
-# Indian 1954 / UTM zone 48N
-<esri23948> +proj=utm +zone=48 +a=6377276.345 +b=6356075.413140239 +towgs84=217,823,299,0,0,0,0 +units=m +no_defs  no_defs <>
-# Indian 1975 / UTM zone 47N
-<esri24047> +proj=utm +zone=47 +a=6377276.345 +b=6356075.413140239 +units=m +no_defs  no_defs <>
-# Indian 1975 / UTM zone 48N
-<esri24048> +proj=utm +zone=48 +a=6377276.345 +b=6356075.413140239 +units=m +no_defs  no_defs <>
-# Jamaica 1875 / Jamaica (Old Grid)
-<esri24100> +proj=lcc +lat_1=18 +lat_0=18 +lon_0=-77 +k_0=1 +x_0=167638.49575 +y_0=121918.906 +ellps=clrk80 +to_meter=0.304797265 +no_defs  no_defs <>
-# JAD69 / Jamaica National Grid
-<esri24200> +proj=lcc +lat_1=18 +lat_0=18 +lon_0=-77 +k_0=1 +x_0=250000 +y_0=150000 +ellps=clrk66 +units=m +no_defs  no_defs <>
-# Kalianpur 1937 / UTM zone 45N
-<esri24305> +proj=utm +zone=45 +a=6377276.345 +b=6356075.413140239 +units=m +no_defs  no_defs <>
-# Kalianpur 1937 / UTM zone 46N
-<esri24306> +proj=utm +zone=46 +a=6377276.345 +b=6356075.413140239 +units=m +no_defs  no_defs <>
-# Kalianpur 1962 / UTM zone 41N
-<esri24311> +proj=utm +zone=41 +a=6377301.243 +b=6356100.230165385 +towgs84=283,682,231,0,0,0,0 +units=m +no_defs  no_defs <>
-# Kalianpur 1962 / UTM zone 42N
-<esri24312> +proj=utm +zone=42 +a=6377301.243 +b=6356100.230165385 +towgs84=283,682,231,0,0,0,0 +units=m +no_defs  no_defs <>
-# Kalianpur 1962 / UTM zone 43N
-<esri24313> +proj=utm +zone=43 +a=6377301.243 +b=6356100.230165385 +towgs84=283,682,231,0,0,0,0 +units=m +no_defs  no_defs <>
-# Kalianpur 1975 / UTM zone 42N
-<esri24342> +proj=utm +zone=42 +a=6377299.151 +b=6356098.145120132 +towgs84=295,736,257,0,0,0,0 +units=m +no_defs  no_defs <>
-# Kalianpur 1975 / UTM zone 43N
-<esri24343> +proj=utm +zone=43 +a=6377299.151 +b=6356098.145120132 +towgs84=295,736,257,0,0,0,0 +units=m +no_defs  no_defs <>
-# Kalianpur 1975 / UTM zone 44N
-<esri24344> +proj=utm +zone=44 +a=6377299.151 +b=6356098.145120132 +towgs84=295,736,257,0,0,0,0 +units=m +no_defs  no_defs <>
-# Kalianpur 1975 / UTM zone 45N
-<esri24345> +proj=utm +zone=45 +a=6377299.151 +b=6356098.145120132 +towgs84=295,736,257,0,0,0,0 +units=m +no_defs  no_defs <>
-# Kalianpur 1975 / UTM zone 46N
-<esri24346> +proj=utm +zone=46 +a=6377299.151 +b=6356098.145120132 +towgs84=295,736,257,0,0,0,0 +units=m +no_defs  no_defs <>
-# Kalianpur 1975 / UTM zone 47N
-<esri24347> +proj=utm +zone=47 +a=6377299.151 +b=6356098.145120132 +towgs84=295,736,257,0,0,0,0 +units=m +no_defs  no_defs <>
-# Kalianpur 1880 / India zone 0
-<esri24370> +proj=lcc +lat_1=39.5 +lat_0=39.5 +lon_0=68 +k_0=0.99846154 +x_0=2153865.73916853 +y_0=2368292.194628102 +a=6377299.36559538 +b=6356098.357204817 +to_meter=0.9143985307444408 +no_defs  no_defs <>
-# Kalianpur 1880 / India zone I
-<esri24371> +proj=lcc +lat_1=32.5 +lat_0=32.5 +lon_0=68 +k_0=0.99878641 +x_0=2743195.592233322 +y_0=914398.5307444407 +a=6377299.36559538 +b=6356098.357204817 +to_meter=0.9143985307444408 +no_defs  no_defs <>
-# Kalianpur 1880 / India zone IIa
-<esri24372> +proj=lcc +lat_1=26 +lat_0=26 +lon_0=74 +k_0=0.99878641 +x_0=2743195.592233322 +y_0=914398.5307444407 +a=6377299.36559538 +b=6356098.357204817 +to_meter=0.9143985307444408 +no_defs  no_defs <>
-# Kalianpur 1880 / India zone III
-<esri24373> +proj=lcc +lat_1=19 +lat_0=19 +lon_0=80 +k_0=0.99878641 +x_0=2743195.592233322 +y_0=914398.5307444407 +a=6377299.36559538 +b=6356098.357204817 +to_meter=0.9143985307444408 +no_defs  no_defs <>
-# Kalianpur 1880 / India zone IV
-<esri24374> +proj=lcc +lat_1=12 +lat_0=12 +lon_0=80 +k_0=0.99878641 +x_0=2743195.592233322 +y_0=914398.5307444407 +a=6377299.36559538 +b=6356098.357204817 +to_meter=0.9143985307444408 +no_defs  no_defs <>
-# Kalianpur 1937 / India zone IIb
-<esri24375> +proj=lcc +lat_1=26 +lat_0=26 +lon_0=90 +k_0=0.99878641 +x_0=2743185.69 +y_0=914395.23 +a=6377276.345 +b=6356075.413140239 +units=m +no_defs  no_defs <>
-# Kalianpur 1962 / India zone I
-<esri24376> +proj=lcc +lat_1=32.5 +lat_0=32.5 +lon_0=68 +k_0=0.99878641 +x_0=2743196.4 +y_0=914398.8 +a=6377301.243 +b=6356100.230165385 +towgs84=283,682,231,0,0,0,0 +units=m +no_defs  no_defs <>
-# Kalianpur 1962 / India zone IIa
-<esri24377> +proj=lcc +lat_1=26 +lat_0=26 +lon_0=74 +k_0=0.99878641 +x_0=2743196.4 +y_0=914398.8 +a=6377301.243 +b=6356100.230165385 +towgs84=283,682,231,0,0,0,0 +units=m +no_defs  no_defs <>
-# Kalianpur 1975 / India zone I
-<esri24378> +proj=lcc +lat_1=32.5 +lat_0=32.5 +lon_0=68 +k_0=0.99878641 +x_0=2743195.5 +y_0=914398.5 +a=6377299.151 +b=6356098.145120132 +towgs84=295,736,257,0,0,0,0 +units=m +no_defs  no_defs <>
-# Kalianpur 1975 / India zone IIa
-<esri24379> +proj=lcc +lat_1=26 +lat_0=26 +lon_0=74 +k_0=0.99878641 +x_0=2743195.5 +y_0=914398.5 +a=6377299.151 +b=6356098.145120132 +towgs84=295,736,257,0,0,0,0 +units=m +no_defs  no_defs <>
-# Kalianpur 1975 / India zone IIb
-<esri24380> +proj=lcc +lat_1=26 +lat_0=26 +lon_0=90 +k_0=0.99878641 +x_0=2743195.5 +y_0=914398.5 +a=6377299.151 +b=6356098.145120132 +towgs84=295,736,257,0,0,0,0 +units=m +no_defs  no_defs <>
-# Kalianpur 1975 / India zone III
-<esri24381> +proj=lcc +lat_1=19 +lat_0=19 +lon_0=80 +k_0=0.99878641 +x_0=2743195.5 +y_0=914398.5 +a=6377299.151 +b=6356098.145120132 +towgs84=295,736,257,0,0,0,0 +units=m +no_defs  no_defs <>
-# Kalianpur 1880 / India zone IIb
-<esri24382> +proj=lcc +lat_1=26 +lat_0=26 +lon_0=90 +k_0=0.99878641 +x_0=2743195.592233322 +y_0=914398.5307444407 +a=6377299.36559538 +b=6356098.357204817 +to_meter=0.9143985307444408 +no_defs  no_defs <>
-# Kalianpur 1975 / India zone IV
-<esri24383> +proj=lcc +lat_1=12 +lat_0=12 +lon_0=80 +k_0=0.99878641 +x_0=2743195.5 +y_0=914398.5 +a=6377299.151 +b=6356098.145120132 +towgs84=295,736,257,0,0,0,0 +units=m +no_defs  no_defs <>
-# Kertau / Singapore Grid
-<esri24500> +proj=cass +lat_0=1.287646666666667 +lon_0=103.8530022222222 +x_0=30000 +y_0=30000 +a=6377304.063 +b=6356103.038993155 +towgs84=-11,851,5,0,0,0,0 +units=m +no_defs  no_defs <>
-# Kertau / UTM zone 47N
-<esri24547> +proj=utm +zone=47 +a=6377304.063 +b=6356103.038993155 +towgs84=-11,851,5,0,0,0,0 +units=m +no_defs  no_defs <>
-# Kertau / UTM zone 48N
-<esri24548> +proj=utm +zone=48 +a=6377304.063 +b=6356103.038993155 +towgs84=-11,851,5,0,0,0,0 +units=m +no_defs  no_defs <>
-# Kertau / R.S.O. Malaya (ch)
-<esri24571> +proj=omerc +lat_0=4 +lonc=102.25 +alpha=323.0257905 +k=0.99984 +x_0=804671.2997750348 +y_0=0 +a=6377304.063 +b=6356103.038993155 +towgs84=-11,851,5,0,0,0,0 +to_meter=20.11678249437587 +no_defs  no_defs <>
-# KOC Lambert
-<esri24600> +proj=lcc +lat_1=32.5 +lat_0=32.5 +lon_0=45 +k_0=0.9987864078000001 +x_0=1500000 +y_0=1166200 +ellps=clrk80 +units=m +no_defs  no_defs <>
-# La Canoa / UTM zone 18N
-<esri24718> +proj=utm +zone=18 +ellps=intl +towgs84=-273.5,110.6,-357.9,0,0,0,0 +units=m +no_defs  no_defs <>
-# La Canoa / UTM zone 19N
-<esri24719> +proj=utm +zone=19 +ellps=intl +towgs84=-273.5,110.6,-357.9,0,0,0,0 +units=m +no_defs  no_defs <>
-# La Canoa / UTM zone 20N
-<esri24720> +proj=utm +zone=20 +ellps=intl +towgs84=-273.5,110.6,-357.9,0,0,0,0 +units=m +no_defs  no_defs <>
-# PSAD56 / UTM zone 18N
-<esri24818> +proj=utm +zone=18 +ellps=intl +units=m +no_defs  no_defs <>
-# PSAD56 / UTM zone 19N
-<esri24819> +proj=utm +zone=19 +ellps=intl +units=m +no_defs  no_defs <>
-# PSAD56 / UTM zone 20N
-<esri24820> +proj=utm +zone=20 +ellps=intl +units=m +no_defs  no_defs <>
-# PSAD56 / UTM zone 21N
-<esri24821> +proj=utm +zone=21 +ellps=intl +units=m +no_defs  no_defs <>
-# PSAD56 / UTM zone 17S
-<esri24877> +proj=utm +zone=17 +south +ellps=intl +units=m +no_defs  no_defs <>
-# PSAD56 / UTM zone 18S
-<esri24878> +proj=utm +zone=18 +south +ellps=intl +units=m +no_defs  no_defs <>
-# PSAD56 / UTM zone 19S
-<esri24879> +proj=utm +zone=19 +south +ellps=intl +units=m +no_defs  no_defs <>
-# PSAD56 / UTM zone 20S
-<esri24880> +proj=utm +zone=20 +south +ellps=intl +units=m +no_defs  no_defs <>
-# PSAD56 / UTM zone 22S
-<esri24882> +proj=utm +zone=22 +south +ellps=intl +units=m +no_defs  no_defs <>
-# PSAD56 / Peru west zone
-<esri24891> +proj=tmerc +lat_0=-6 +lon_0=-80.5 +k=0.999830 +x_0=222000 +y_0=1426834.743 +ellps=intl +units=m +no_defs  no_defs <>
-# PSAD56 / Peru central zone
-<esri24892> +proj=tmerc +lat_0=-9.5 +lon_0=-76 +k=0.999330 +x_0=720000 +y_0=1039979.159 +ellps=intl +units=m +no_defs  no_defs <>
-# PSAD56 / Peru east zone
-<esri24893> +proj=tmerc +lat_0=-9.5 +lon_0=-70.5 +k=0.999530 +x_0=1324000 +y_0=1040084.558 +ellps=intl +units=m +no_defs  no_defs <>
-# Leigon / Ghana Metre Grid
-<esri25000> +proj=tmerc +lat_0=4.666666666666667 +lon_0=-1 +k=0.999750 +x_0=274319.51 +y_0=0 +ellps=clrk80 +towgs84=-130,29,364,0,0,0,0 +units=m +no_defs  no_defs <>
-# Lome / UTM zone 31N
-<esri25231> +proj=utm +zone=31 +a=6378249.2 +b=6356515 +units=m +no_defs  no_defs <>
-# Luzon 1911 / Philippines zone I
-<esri25391> +proj=tmerc +lat_0=0 +lon_0=117 +k=0.999950 +x_0=500000 +y_0=0 +ellps=clrk66 +units=m +no_defs  no_defs <>
-# Luzon 1911 / Philippines zone II
-<esri25392> +proj=tmerc +lat_0=0 +lon_0=119 +k=0.999950 +x_0=500000 +y_0=0 +ellps=clrk66 +units=m +no_defs  no_defs <>
-# Luzon 1911 / Philippines zone III
-<esri25393> +proj=tmerc +lat_0=0 +lon_0=121 +k=0.999950 +x_0=500000 +y_0=0 +ellps=clrk66 +units=m +no_defs  no_defs <>
-# Luzon 1911 / Philippines zone IV
-<esri25394> +proj=tmerc +lat_0=0 +lon_0=123 +k=0.999950 +x_0=500000 +y_0=0 +ellps=clrk66 +units=m +no_defs  no_defs <>
-# Luzon 1911 / Philippines zone V
-<esri25395> +proj=tmerc +lat_0=0 +lon_0=125 +k=0.999950 +x_0=500000 +y_0=0 +ellps=clrk66 +units=m +no_defs  no_defs <>
-# Makassar (Jakarta) / NEIEZ
-<esri25700> +proj=merc +lat_ts=0 +lon_0=216.8077194444444 +k=0.997000 +x_0=3900000 +y_0=900000 +ellps=bessel +towgs84=-587.8,519.75,145.76,0,0,0,0 +pm=jakarta +units=m +no_defs  no_defs <>
-# ETRS89 / UTM zone 28N
-<esri25828> +proj=utm +zone=28 +ellps=GRS80 +units=m +no_defs  no_defs <>
-# ETRS89 / UTM zone 29N
-<esri25829> +proj=utm +zone=29 +ellps=GRS80 +units=m +no_defs  no_defs <>
-# ETRS89 / UTM zone 30N
-<esri25830> +proj=utm +zone=30 +ellps=GRS80 +units=m +no_defs  no_defs <>
-# ETRS89 / UTM zone 31N
-<esri25831> +proj=utm +zone=31 +ellps=GRS80 +units=m +no_defs  no_defs <>
-# ETRS89 / UTM zone 32N
-<esri25832> +proj=utm +zone=32 +ellps=GRS80 +units=m +no_defs  no_defs <>
-# ETRS89 / UTM zone 33N
-<esri25833> +proj=utm +zone=33 +ellps=GRS80 +units=m +no_defs  no_defs <>
-# ETRS89 / UTM zone 34N
-<esri25834> +proj=utm +zone=34 +ellps=GRS80 +units=m +no_defs  no_defs <>
-# ETRS89 / UTM zone 35N
-<esri25835> +proj=utm +zone=35 +ellps=GRS80 +units=m +no_defs  no_defs <>
-# ETRS89 / UTM zone 36N
-<esri25836> +proj=utm +zone=36 +ellps=GRS80 +units=m +no_defs  no_defs <>
-# ETRS89 / UTM zone 37N
-<esri25837> +proj=utm +zone=37 +ellps=GRS80 +units=m +no_defs  no_defs <>
-# ETRS89 / UTM zone 38N
-<esri25838> +proj=utm +zone=38 +ellps=GRS80 +units=m +no_defs  no_defs <>
-# ETRS89 / TM Baltic93
-<esri25884> +proj=tmerc +lat_0=0 +lon_0=24 +k=0.999600 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs  no_defs <>
-# Malongo 1987 / UTM zone 32S
-<esri25932> +proj=utm +zone=32 +south +ellps=intl +units=m +no_defs  no_defs <>
-# Merchich / Nord Maroc
-<esri26191> +proj=lcc +lat_1=33.3 +lat_0=33.3 +lon_0=-5.4 +k_0=0.999625769 +x_0=500000 +y_0=300000 +a=6378249.2 +b=6356515 +towgs84=31,146,47,0,0,0,0 +units=m +no_defs  no_defs <>
-# Merchich / Sud Maroc
-<esri26192> +proj=lcc +lat_1=29.7 +lat_0=29.7 +lon_0=-5.4 +k_0=0.9996155960000001 +x_0=500000 +y_0=300000 +a=6378249.2 +b=6356515 +towgs84=31,146,47,0,0,0,0 +units=m +no_defs  no_defs <>
-# Merchich / Sahara
-<esri26193> +proj=lcc +lat_1=26.1 +lat_0=26.1 +lon_0=-5.4 +k_0=0.9996 +x_0=1200000 +y_0=400000 +a=6378249.2 +b=6356515 +towgs84=31,146,47,0,0,0,0 +units=m +no_defs  no_defs <>
-# Massawa / UTM zone 37N
-<esri26237> +proj=utm +zone=37 +ellps=bessel +towgs84=639,405,60,0,0,0,0 +units=m +no_defs  no_defs <>
-# Minna / UTM zone 31N
-<esri26331> +proj=utm +zone=31 +ellps=clrk80 +units=m +no_defs  no_defs <>
-# Minna / UTM zone 32N
-<esri26332> +proj=utm +zone=32 +ellps=clrk80 +units=m +no_defs  no_defs <>
-# Minna / Nigeria West Belt
-<esri26391> +proj=tmerc +lat_0=4 +lon_0=4.5 +k=0.999750 +x_0=230738.26 +y_0=0 +ellps=clrk80 +units=m +no_defs  no_defs <>
-# Minna / Nigeria Mid Belt
-<esri26392> +proj=tmerc +lat_0=4 +lon_0=8.5 +k=0.999750 +x_0=670553.98 +y_0=0 +ellps=clrk80 +units=m +no_defs  no_defs <>
-# Minna / Nigeria East Belt
-<esri26393> +proj=tmerc +lat_0=4 +lon_0=12.5 +k=0.999750 +x_0=1110369.7 +y_0=0 +ellps=clrk80 +units=m +no_defs  no_defs <>
-# Mhast / UTM zone 32S
-<esri26432> +proj=utm +zone=32 +south +ellps=intl +towgs84=-252.95,-4.11,-96.38,0,0,0,0 +units=m +no_defs  no_defs <>
-# Monte Mario (Rome) / Italy zone 1
-<esri26591> +proj=tmerc +lat_0=0 +lon_0=21.45233333333333 +k=0.999600 +x_0=1500000 +y_0=0 +ellps=intl +pm=rome +units=m +no_defs  no_defs <>
-# Monte Mario (Rome) / Italy zone 2
-<esri26592> +proj=tmerc +lat_0=0 +lon_0=27.45233333333333 +k=0.999600 +x_0=2520000 +y_0=0 +ellps=intl +pm=rome +units=m +no_defs  no_defs <>
-# M'poraloko / UTM zone 32N
-<esri26632> +proj=utm +zone=32 +a=6378249.2 +b=6356515 +units=m +no_defs  no_defs <>
-# M'poraloko / UTM zone 32S
-<esri26692> +proj=utm +zone=32 +south +a=6378249.2 +b=6356515 +units=m +no_defs  no_defs <>
-# NAD27 / UTM zone 3N
-<esri26703> +proj=utm +zone=3 +ellps=clrk66 +datum=NAD27 +units=m +no_defs  no_defs <>
-# NAD27 / UTM zone 4N
-<esri26704> +proj=utm +zone=4 +ellps=clrk66 +datum=NAD27 +units=m +no_defs  no_defs <>
-# NAD27 / UTM zone 5N
-<esri26705> +proj=utm +zone=5 +ellps=clrk66 +datum=NAD27 +units=m +no_defs  no_defs <>
-# NAD27 / UTM zone 6N
-<esri26706> +proj=utm +zone=6 +ellps=clrk66 +datum=NAD27 +units=m +no_defs  no_defs <>
-# NAD27 / UTM zone 7N
-<esri26707> +proj=utm +zone=7 +ellps=clrk66 +datum=NAD27 +units=m +no_defs  no_defs <>
-# NAD27 / UTM zone 8N
-<esri26708> +proj=utm +zone=8 +ellps=clrk66 +datum=NAD27 +units=m +no_defs  no_defs <>
-# NAD27 / UTM zone 9N
-<esri26709> +proj=utm +zone=9 +ellps=clrk66 +datum=NAD27 +units=m +no_defs  no_defs <>
-# NAD27 / UTM zone 10N
-<esri26710> +proj=utm +zone=10 +ellps=clrk66 +datum=NAD27 +units=m +no_defs  no_defs <>
-# NAD27 / UTM zone 11N
-<esri26711> +proj=utm +zone=11 +ellps=clrk66 +datum=NAD27 +units=m +no_defs  no_defs <>
-# NAD27 / UTM zone 12N
-<esri26712> +proj=utm +zone=12 +ellps=clrk66 +datum=NAD27 +units=m +no_defs  no_defs <>
-# NAD27 / UTM zone 13N
-<esri26713> +proj=utm +zone=13 +ellps=clrk66 +datum=NAD27 +units=m +no_defs  no_defs <>
-# NAD27 / UTM zone 14N
-<esri26714> +proj=utm +zone=14 +ellps=clrk66 +datum=NAD27 +units=m +no_defs  no_defs <>
-# NAD27 / UTM zone 15N
-<esri26715> +proj=utm +zone=15 +ellps=clrk66 +datum=NAD27 +units=m +no_defs  no_defs <>
-# NAD27 / UTM zone 16N
-<esri26716> +proj=utm +zone=16 +ellps=clrk66 +datum=NAD27 +units=m +no_defs  no_defs <>
-# NAD27 / UTM zone 17N
-<esri26717> +proj=utm +zone=17 +ellps=clrk66 +datum=NAD27 +units=m +no_defs  no_defs <>
-# NAD27 / UTM zone 18N
-<esri26718> +proj=utm +zone=18 +ellps=clrk66 +datum=NAD27 +units=m +no_defs  no_defs <>
-# NAD27 / UTM zone 19N
-<esri26719> +proj=utm +zone=19 +ellps=clrk66 +datum=NAD27 +units=m +no_defs  no_defs <>
-# NAD27 / UTM zone 20N
-<esri26720> +proj=utm +zone=20 +ellps=clrk66 +datum=NAD27 +units=m +no_defs  no_defs <>
-# NAD27 / UTM zone 21N
-<esri26721> +proj=utm +zone=21 +ellps=clrk66 +datum=NAD27 +units=m +no_defs  no_defs <>
-# NAD27 / UTM zone 22N
-<esri26722> +proj=utm +zone=22 +ellps=clrk66 +datum=NAD27 +units=m +no_defs  no_defs <>
-# NAD27 / Alabama East
-<esri26729> +proj=tmerc +lat_0=30.5 +lon_0=-85.83333333333333 +k=0.999960 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / Alabama West
-<esri26730> +proj=tmerc +lat_0=30 +lon_0=-87.5 +k=0.999933 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / Alaska zone 1
-<esri26731> +proj=omerc +lat_0=57 +lonc=-133.6666666666667 +alpha=323.1301023611111 +k=0.9999 +x_0=5000000.001016002 +y_0=-5000000.001016002 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / Alaska zone 2
-<esri26732> +proj=tmerc +lat_0=54 +lon_0=-142 +k=0.999900 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / Alaska zone 3
-<esri26733> +proj=tmerc +lat_0=54 +lon_0=-146 +k=0.999900 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / Alaska zone 4
-<esri26734> +proj=tmerc +lat_0=54 +lon_0=-150 +k=0.999900 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / Alaska zone 5
-<esri26735> +proj=tmerc +lat_0=54 +lon_0=-154 +k=0.999900 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / Alaska zone 6
-<esri26736> +proj=tmerc +lat_0=54 +lon_0=-158 +k=0.999900 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / Alaska zone 7
-<esri26737> +proj=tmerc +lat_0=54 +lon_0=-162 +k=0.999900 +x_0=213360.4267208534 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / Alaska zone 8
-<esri26738> +proj=tmerc +lat_0=54 +lon_0=-166 +k=0.999900 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / Alaska zone 9
-<esri26739> +proj=tmerc +lat_0=54 +lon_0=-170 +k=0.999900 +x_0=182880.3657607315 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / Alaska zone 10
-<esri26740> +proj=lcc +lat_1=53.83333333333334 +lat_2=51.83333333333334 +lat_0=51 +lon_0=-176 +x_0=914401.8288036576 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / California zone I
-<esri26741> +proj=lcc +lat_1=41.66666666666666 +lat_2=40 +lat_0=39.33333333333334 +lon_0=-122 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / California zone II
-<esri26742> +proj=lcc +lat_1=39.83333333333334 +lat_2=38.33333333333334 +lat_0=37.66666666666666 +lon_0=-122 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / California zone III
-<esri26743> +proj=lcc +lat_1=38.43333333333333 +lat_2=37.06666666666667 +lat_0=36.5 +lon_0=-120.5 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / California zone IV
-<esri26744> +proj=lcc +lat_1=37.25 +lat_2=36 +lat_0=35.33333333333334 +lon_0=-119 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / California zone V
-<esri26745> +proj=lcc +lat_1=35.46666666666667 +lat_2=34.03333333333333 +lat_0=33.5 +lon_0=-118 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / California zone VI
-<esri26746> +proj=lcc +lat_1=33.88333333333333 +lat_2=32.78333333333333 +lat_0=32.16666666666666 +lon_0=-116.25 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / California zone VII
-<esri26747> +proj=lcc +lat_1=34.41666666666666 +lat_2=33.86666666666667 +lat_0=34.13333333333333 +lon_0=-118.3333333333333 +x_0=1276106.450596901 +y_0=127079.524511049 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / Arizona East
-<esri26748> +proj=tmerc +lat_0=31 +lon_0=-110.1666666666667 +k=0.999900 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / Arizona Central
-<esri26749> +proj=tmerc +lat_0=31 +lon_0=-111.9166666666667 +k=0.999900 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / Arizona West
-<esri26750> +proj=tmerc +lat_0=31 +lon_0=-113.75 +k=0.999933 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / Arkansas North
-<esri26751> +proj=lcc +lat_1=36.23333333333333 +lat_2=34.93333333333333 +lat_0=34.33333333333334 +lon_0=-92 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / Arkansas South
-<esri26752> +proj=lcc +lat_1=34.76666666666667 +lat_2=33.3 +lat_0=32.66666666666666 +lon_0=-92 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / Colorado North
-<esri26753> +proj=lcc +lat_1=39.71666666666667 +lat_2=40.78333333333333 +lat_0=39.33333333333334 +lon_0=-105.5 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / Colorado Central
-<esri26754> +proj=lcc +lat_1=39.75 +lat_2=38.45 +lat_0=37.83333333333334 +lon_0=-105.5 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / Colorado South
-<esri26755> +proj=lcc +lat_1=38.43333333333333 +lat_2=37.23333333333333 +lat_0=36.66666666666666 +lon_0=-105.5 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / Connecticut
-<esri26756> +proj=lcc +lat_1=41.86666666666667 +lat_2=41.2 +lat_0=40.83333333333334 +lon_0=-72.75 +x_0=182880.3657607315 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / Delaware
-<esri26757> +proj=tmerc +lat_0=38 +lon_0=-75.41666666666667 +k=0.999995 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / Florida East
-<esri26758> +proj=tmerc +lat_0=24.33333333333333 +lon_0=-81 +k=0.999941 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / Florida West
-<esri26759> +proj=tmerc +lat_0=24.33333333333333 +lon_0=-82 +k=0.999941 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / Florida North
-<esri26760> +proj=lcc +lat_1=30.75 +lat_2=29.58333333333333 +lat_0=29 +lon_0=-84.5 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / Georgia East
-<esri26766> +proj=tmerc +lat_0=30 +lon_0=-82.16666666666667 +k=0.999900 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / Georgia West
-<esri26767> +proj=tmerc +lat_0=30 +lon_0=-84.16666666666667 +k=0.999900 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / Idaho East
-<esri26768> +proj=tmerc +lat_0=41.66666666666666 +lon_0=-112.1666666666667 +k=0.999947 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / Idaho Central
-<esri26769> +proj=tmerc +lat_0=41.66666666666666 +lon_0=-114 +k=0.999947 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / Idaho West
-<esri26770> +proj=tmerc +lat_0=41.66666666666666 +lon_0=-115.75 +k=0.999933 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / Illinois East
-<esri26771> +proj=tmerc +lat_0=36.66666666666666 +lon_0=-88.33333333333333 +k=0.999975 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / Illinois West
-<esri26772> +proj=tmerc +lat_0=36.66666666666666 +lon_0=-90.16666666666667 +k=0.999941 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / Indiana East
-<esri26773> +proj=tmerc +lat_0=37.5 +lon_0=-85.66666666666667 +k=0.999967 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / Indiana West
-<esri26774> +proj=tmerc +lat_0=37.5 +lon_0=-87.08333333333333 +k=0.999967 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / Iowa North
-<esri26775> +proj=lcc +lat_1=43.26666666666667 +lat_2=42.06666666666667 +lat_0=41.5 +lon_0=-93.5 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / Iowa South
-<esri26776> +proj=lcc +lat_1=41.78333333333333 +lat_2=40.61666666666667 +lat_0=40 +lon_0=-93.5 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / Kansas North
-<esri26777> +proj=lcc +lat_1=39.78333333333333 +lat_2=38.71666666666667 +lat_0=38.33333333333334 +lon_0=-98 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / Kansas South
-<esri26778> +proj=lcc +lat_1=38.56666666666667 +lat_2=37.26666666666667 +lat_0=36.66666666666666 +lon_0=-98.5 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / Kentucky North
-<esri26779> +proj=lcc +lat_1=37.96666666666667 +lat_2=38.96666666666667 +lat_0=37.5 +lon_0=-84.25 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / Kentucky South
-<esri26780> +proj=lcc +lat_1=36.73333333333333 +lat_2=37.93333333333333 +lat_0=36.33333333333334 +lon_0=-85.75 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / Louisiana North
-<esri26781> +proj=lcc +lat_1=31.16666666666667 +lat_2=32.66666666666666 +lat_0=30.66666666666667 +lon_0=-92.5 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / Louisiana South
-<esri26782> +proj=lcc +lat_1=29.3 +lat_2=30.7 +lat_0=28.66666666666667 +lon_0=-91.33333333333333 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / Maine East
-<esri26783> +proj=tmerc +lat_0=43.83333333333334 +lon_0=-68.5 +k=0.999900 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / Maine West
-<esri26784> +proj=tmerc +lat_0=42.83333333333334 +lon_0=-70.16666666666667 +k=0.999967 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / Maryland
-<esri26785> +proj=lcc +lat_1=38.3 +lat_2=39.45 +lat_0=37.83333333333334 +lon_0=-77 +x_0=243840.4876809754 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / Massachusetts Mainland
-<esri26786> +proj=lcc +lat_1=41.71666666666667 +lat_2=42.68333333333333 +lat_0=41 +lon_0=-71.5 +x_0=182880.3657607315 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / Massachusetts Island
-<esri26787> +proj=lcc +lat_1=41.28333333333333 +lat_2=41.48333333333333 +lat_0=41 +lon_0=-70.5 +x_0=60960.12192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / Minnesota North
-<esri26791> +proj=lcc +lat_1=47.03333333333333 +lat_2=48.63333333333333 +lat_0=46.5 +lon_0=-93.09999999999999 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / Minnesota Central
-<esri26792> +proj=lcc +lat_1=45.61666666666667 +lat_2=47.05 +lat_0=45 +lon_0=-94.25 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / Minnesota South
-<esri26793> +proj=lcc +lat_1=43.78333333333333 +lat_2=45.21666666666667 +lat_0=43 +lon_0=-94 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / Mississippi East
-<esri26794> +proj=tmerc +lat_0=29.66666666666667 +lon_0=-88.83333333333333 +k=0.999960 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / Mississippi West
-<esri26795> +proj=tmerc +lat_0=30.5 +lon_0=-90.33333333333333 +k=0.999941 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / Missouri East
-<esri26796> +proj=tmerc +lat_0=35.83333333333334 +lon_0=-90.5 +k=0.999933 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / Missouri Central
-<esri26797> +proj=tmerc +lat_0=35.83333333333334 +lon_0=-92.5 +k=0.999933 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / Missouri West
-<esri26798> +proj=tmerc +lat_0=36.16666666666666 +lon_0=-94.5 +k=0.999941 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD Michigan / Michigan East
-<esri26801> +proj=tmerc +lat_0=41.5 +lon_0=-83.66666666666667 +k=0.999943 +x_0=152400.3048006096 +y_0=0 +a=6378450.047548896 +b=6356826.621488444 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD Michigan / Michigan Old Central
-<esri26802> +proj=tmerc +lat_0=41.5 +lon_0=-85.75 +k=0.999909 +x_0=152400.3048006096 +y_0=0 +a=6378450.047548896 +b=6356826.621488444 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD Michigan / Michigan West
-<esri26803> +proj=tmerc +lat_0=41.5 +lon_0=-88.75 +k=0.999909 +x_0=152400.3048006096 +y_0=0 +a=6378450.047548896 +b=6356826.621488444 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD Michigan / Michigan North
-<esri26811> +proj=lcc +lat_1=45.48333333333333 +lat_2=47.08333333333334 +lat_0=44.78333333333333 +lon_0=-87 +x_0=609601.2192024384 +y_0=0 +a=6378450.047548896 +b=6356826.621488444 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD Michigan / Michigan Central
-<esri26812> +proj=lcc +lat_1=44.18333333333333 +lat_2=45.7 +lat_0=43.31666666666667 +lon_0=-84.33333333333333 +x_0=609601.2192024384 +y_0=0 +a=6378450.047548896 +b=6356826.621488444 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD Michigan / Michigan South
-<esri26813> +proj=lcc +lat_1=42.1 +lat_2=43.66666666666666 +lat_0=41.5 +lon_0=-84.33333333333333 +x_0=609601.2192024384 +y_0=0 +a=6378450.047548896 +b=6356826.621488444 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD83 / UTM zone 3N
-<esri26903> +proj=utm +zone=3 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / UTM zone 4N
-<esri26904> +proj=utm +zone=4 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / UTM zone 5N
-<esri26905> +proj=utm +zone=5 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / UTM zone 6N
-<esri26906> +proj=utm +zone=6 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / UTM zone 7N
-<esri26907> +proj=utm +zone=7 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / UTM zone 8N
-<esri26908> +proj=utm +zone=8 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / UTM zone 9N
-<esri26909> +proj=utm +zone=9 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / UTM zone 10N
-<esri26910> +proj=utm +zone=10 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / UTM zone 11N
-<esri26911> +proj=utm +zone=11 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / UTM zone 12N
-<esri26912> +proj=utm +zone=12 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / UTM zone 13N
-<esri26913> +proj=utm +zone=13 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / UTM zone 14N
-<esri26914> +proj=utm +zone=14 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / UTM zone 15N
-<esri26915> +proj=utm +zone=15 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / UTM zone 16N
-<esri26916> +proj=utm +zone=16 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / UTM zone 17N
-<esri26917> +proj=utm +zone=17 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / UTM zone 18N
-<esri26918> +proj=utm +zone=18 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / UTM zone 19N
-<esri26919> +proj=utm +zone=19 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / UTM zone 20N
-<esri26920> +proj=utm +zone=20 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / UTM zone 21N
-<esri26921> +proj=utm +zone=21 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / UTM zone 22N
-<esri26922> +proj=utm +zone=22 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / UTM zone 23N
-<esri26923> +proj=utm +zone=23 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / Alabama East
-<esri26929> +proj=tmerc +lat_0=30.5 +lon_0=-85.83333333333333 +k=0.999960 +x_0=200000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / Alabama West
-<esri26930> +proj=tmerc +lat_0=30 +lon_0=-87.5 +k=0.999933 +x_0=600000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / Alaska zone 1
-<esri26931> +proj=omerc +lat_0=57 +lonc=-133.6666666666667 +alpha=323.1301023611111 +k=0.9999 +x_0=5000000 +y_0=-5000000 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / Alaska zone 2
-<esri26932> +proj=tmerc +lat_0=54 +lon_0=-142 +k=0.999900 +x_0=500000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / Alaska zone 3
-<esri26933> +proj=tmerc +lat_0=54 +lon_0=-146 +k=0.999900 +x_0=500000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / Alaska zone 4
-<esri26934> +proj=tmerc +lat_0=54 +lon_0=-150 +k=0.999900 +x_0=500000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / Alaska zone 5
-<esri26935> +proj=tmerc +lat_0=54 +lon_0=-154 +k=0.999900 +x_0=500000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / Alaska zone 6
-<esri26936> +proj=tmerc +lat_0=54 +lon_0=-158 +k=0.999900 +x_0=500000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / Alaska zone 7
-<esri26937> +proj=tmerc +lat_0=54 +lon_0=-162 +k=0.999900 +x_0=500000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / Alaska zone 8
-<esri26938> +proj=tmerc +lat_0=54 +lon_0=-166 +k=0.999900 +x_0=500000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / Alaska zone 9
-<esri26939> +proj=tmerc +lat_0=54 +lon_0=-170 +k=0.999900 +x_0=500000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / Alaska zone 10
-<esri26940> +proj=lcc +lat_1=53.83333333333334 +lat_2=51.83333333333334 +lat_0=51 +lon_0=-176 +x_0=1000000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / California zone 1
-<esri26941> +proj=lcc +lat_1=41.66666666666666 +lat_2=40 +lat_0=39.33333333333334 +lon_0=-122 +x_0=2000000 +y_0=500000 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / California zone 2
-<esri26942> +proj=lcc +lat_1=39.83333333333334 +lat_2=38.33333333333334 +lat_0=37.66666666666666 +lon_0=-122 +x_0=2000000 +y_0=500000 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / California zone 3
-<esri26943> +proj=lcc +lat_1=38.43333333333333 +lat_2=37.06666666666667 +lat_0=36.5 +lon_0=-120.5 +x_0=2000000 +y_0=500000 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / California zone 4
-<esri26944> +proj=lcc +lat_1=37.25 +lat_2=36 +lat_0=35.33333333333334 +lon_0=-119 +x_0=2000000 +y_0=500000 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / California zone 5
-<esri26945> +proj=lcc +lat_1=35.46666666666667 +lat_2=34.03333333333333 +lat_0=33.5 +lon_0=-118 +x_0=2000000 +y_0=500000 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / California zone 6
-<esri26946> +proj=lcc +lat_1=33.88333333333333 +lat_2=32.78333333333333 +lat_0=32.16666666666666 +lon_0=-116.25 +x_0=2000000 +y_0=500000 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / Arizona East
-<esri26948> +proj=tmerc +lat_0=31 +lon_0=-110.1666666666667 +k=0.999900 +x_0=213360 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / Arizona Central
-<esri26949> +proj=tmerc +lat_0=31 +lon_0=-111.9166666666667 +k=0.999900 +x_0=213360 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / Arizona West
-<esri26950> +proj=tmerc +lat_0=31 +lon_0=-113.75 +k=0.999933 +x_0=213360 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / Arkansas North
-<esri26951> +proj=lcc +lat_1=36.23333333333333 +lat_2=34.93333333333333 +lat_0=34.33333333333334 +lon_0=-92 +x_0=400000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / Arkansas South
-<esri26952> +proj=lcc +lat_1=34.76666666666667 +lat_2=33.3 +lat_0=32.66666666666666 +lon_0=-92 +x_0=400000 +y_0=400000 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / Colorado North
-<esri26953> +proj=lcc +lat_1=40.78333333333333 +lat_2=39.71666666666667 +lat_0=39.33333333333334 +lon_0=-105.5 +x_0=914401.8289 +y_0=304800.6096 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / Colorado Central
-<esri26954> +proj=lcc +lat_1=39.75 +lat_2=38.45 +lat_0=37.83333333333334 +lon_0=-105.5 +x_0=914401.8289 +y_0=304800.6096 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / Colorado South
-<esri26955> +proj=lcc +lat_1=38.43333333333333 +lat_2=37.23333333333333 +lat_0=36.66666666666666 +lon_0=-105.5 +x_0=914401.8289 +y_0=304800.6096 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / Connecticut
-<esri26956> +proj=lcc +lat_1=41.86666666666667 +lat_2=41.2 +lat_0=40.83333333333334 +lon_0=-72.75 +x_0=304800.6096 +y_0=152400.3048 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / Delaware
-<esri26957> +proj=tmerc +lat_0=38 +lon_0=-75.41666666666667 +k=0.999995 +x_0=200000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / Florida East
-<esri26958> +proj=tmerc +lat_0=24.33333333333333 +lon_0=-81 +k=0.999941 +x_0=200000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / Florida West
-<esri26959> +proj=tmerc +lat_0=24.33333333333333 +lon_0=-82 +k=0.999941 +x_0=200000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / Florida North
-<esri26960> +proj=lcc +lat_1=30.75 +lat_2=29.58333333333333 +lat_0=29 +lon_0=-84.5 +x_0=600000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / Hawaii zone 1
-<esri26961> +proj=tmerc +lat_0=18.83333333333333 +lon_0=-155.5 +k=0.999967 +x_0=500000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / Hawaii zone 2
-<esri26962> +proj=tmerc +lat_0=20.33333333333333 +lon_0=-156.6666666666667 +k=0.999967 +x_0=500000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / Hawaii zone 3
-<esri26963> +proj=tmerc +lat_0=21.16666666666667 +lon_0=-158 +k=0.999990 +x_0=500000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / Hawaii zone 4
-<esri26964> +proj=tmerc +lat_0=21.83333333333333 +lon_0=-159.5 +k=0.999990 +x_0=500000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / Hawaii zone 5
-<esri26965> +proj=tmerc +lat_0=21.66666666666667 +lon_0=-160.1666666666667 +k=1.000000 +x_0=500000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / Georgia East
-<esri26966> +proj=tmerc +lat_0=30 +lon_0=-82.16666666666667 +k=0.999900 +x_0=200000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / Georgia West
-<esri26967> +proj=tmerc +lat_0=30 +lon_0=-84.16666666666667 +k=0.999900 +x_0=700000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / Idaho East
-<esri26968> +proj=tmerc +lat_0=41.66666666666666 +lon_0=-112.1666666666667 +k=0.999947 +x_0=200000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / Idaho Central
-<esri26969> +proj=tmerc +lat_0=41.66666666666666 +lon_0=-114 +k=0.999947 +x_0=500000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / Idaho West
-<esri26970> +proj=tmerc +lat_0=41.66666666666666 +lon_0=-115.75 +k=0.999933 +x_0=800000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / Illinois East
-<esri26971> +proj=tmerc +lat_0=36.66666666666666 +lon_0=-88.33333333333333 +k=0.999975 +x_0=300000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / Illinois West
-<esri26972> +proj=tmerc +lat_0=36.66666666666666 +lon_0=-90.16666666666667 +k=0.999941 +x_0=700000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / Indiana East
-<esri26973> +proj=tmerc +lat_0=37.5 +lon_0=-85.66666666666667 +k=0.999967 +x_0=100000 +y_0=250000 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / Indiana West
-<esri26974> +proj=tmerc +lat_0=37.5 +lon_0=-87.08333333333333 +k=0.999967 +x_0=900000 +y_0=250000 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / Iowa North
-<esri26975> +proj=lcc +lat_1=43.26666666666667 +lat_2=42.06666666666667 +lat_0=41.5 +lon_0=-93.5 +x_0=1500000 +y_0=1000000 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / Iowa South
-<esri26976> +proj=lcc +lat_1=41.78333333333333 +lat_2=40.61666666666667 +lat_0=40 +lon_0=-93.5 +x_0=500000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / Kansas North
-<esri26977> +proj=lcc +lat_1=39.78333333333333 +lat_2=38.71666666666667 +lat_0=38.33333333333334 +lon_0=-98 +x_0=400000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / Kansas South
-<esri26978> +proj=lcc +lat_1=38.56666666666667 +lat_2=37.26666666666667 +lat_0=36.66666666666666 +lon_0=-98.5 +x_0=400000 +y_0=400000 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / Kentucky North
-<esri26979> +proj=lcc +lat_1=37.96666666666667 +lat_2=37.96666666666667 +lat_0=37.5 +lon_0=-84.25 +x_0=500000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / Kentucky South
-<esri26980> +proj=lcc +lat_1=37.93333333333333 +lat_2=36.73333333333333 +lat_0=36.33333333333334 +lon_0=-85.75 +x_0=500000 +y_0=500000 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / Louisiana North
-<esri26981> +proj=lcc +lat_1=32.66666666666666 +lat_2=31.16666666666667 +lat_0=30.5 +lon_0=-92.5 +x_0=1000000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / Louisiana South
-<esri26982> +proj=lcc +lat_1=30.7 +lat_2=29.3 +lat_0=28.5 +lon_0=-91.33333333333333 +x_0=1000000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / Maine East
-<esri26983> +proj=tmerc +lat_0=43.66666666666666 +lon_0=-68.5 +k=0.999900 +x_0=300000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / Maine West
-<esri26984> +proj=tmerc +lat_0=42.83333333333334 +lon_0=-70.16666666666667 +k=0.999967 +x_0=900000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / Maryland
-<esri26985> +proj=lcc +lat_1=39.45 +lat_2=38.3 +lat_0=37.66666666666666 +lon_0=-77 +x_0=400000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / Massachusetts Mainland
-<esri26986> +proj=lcc +lat_1=42.68333333333333 +lat_2=41.71666666666667 +lat_0=41 +lon_0=-71.5 +x_0=200000 +y_0=750000 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / Massachusetts Island
-<esri26987> +proj=lcc +lat_1=41.48333333333333 +lat_2=41.28333333333333 +lat_0=41 +lon_0=-70.5 +x_0=500000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / Michigan North
-<esri26988> +proj=lcc +lat_1=47.08333333333334 +lat_2=45.48333333333333 +lat_0=44.78333333333333 +lon_0=-87 +x_0=8000000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / Michigan Central
-<esri26989> +proj=lcc +lat_1=45.7 +lat_2=44.18333333333333 +lat_0=43.31666666666667 +lon_0=-84.36666666666666 +x_0=6000000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / Michigan South
-<esri26990> +proj=lcc +lat_1=43.66666666666666 +lat_2=42.1 +lat_0=41.5 +lon_0=-84.36666666666666 +x_0=4000000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / Minnesota North
-<esri26991> +proj=lcc +lat_1=48.63333333333333 +lat_2=47.03333333333333 +lat_0=46.5 +lon_0=-93.09999999999999 +x_0=800000 +y_0=100000 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / Minnesota Central
-<esri26992> +proj=lcc +lat_1=47.05 +lat_2=45.61666666666667 +lat_0=45 +lon_0=-94.25 +x_0=800000 +y_0=100000 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / Minnesota South
-<esri26993> +proj=lcc +lat_1=45.21666666666667 +lat_2=43.78333333333333 +lat_0=43 +lon_0=-94 +x_0=800000 +y_0=100000 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / Mississippi East
-<esri26994> +proj=tmerc +lat_0=29.5 +lon_0=-88.83333333333333 +k=0.999950 +x_0=300000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / Mississippi West
-<esri26995> +proj=tmerc +lat_0=29.5 +lon_0=-90.33333333333333 +k=0.999950 +x_0=700000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / Missouri East
-<esri26996> +proj=tmerc +lat_0=35.83333333333334 +lon_0=-90.5 +k=0.999933 +x_0=250000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / Missouri Central
-<esri26997> +proj=tmerc +lat_0=35.83333333333334 +lon_0=-92.5 +k=0.999933 +x_0=500000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / Missouri West
-<esri26998> +proj=tmerc +lat_0=36.16666666666666 +lon_0=-94.5 +k=0.999941 +x_0=850000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# Nahrwan 1967 / UTM zone 38N
-<esri27038> +proj=utm +zone=38 +ellps=clrk80 +units=m +no_defs  no_defs <>
-# Nahrwan 1967 / UTM zone 39N
-<esri27039> +proj=utm +zone=39 +ellps=clrk80 +units=m +no_defs  no_defs <>
-# Nahrwan 1967 / UTM zone 40N
-<esri27040> +proj=utm +zone=40 +ellps=clrk80 +units=m +no_defs  no_defs <>
-# Naparima 1972 / UTM zone 20N
-<esri27120> +proj=utm +zone=20 +ellps=intl +units=m +no_defs  no_defs <>
-# NZGD49 / New Zealand Map Grid
-<esri27200> +proj=nzmg +lat_0=-41 +lon_0=173 +x_0=2510000 +y_0=6023150 +ellps=intl +units=m +no_defs  no_defs <>
-# NZGD49 / Mount Eden Circuit
-<esri27205> +proj=tmerc +lat_0=-36.87986527777778 +lon_0=174.7643393611111 +k=0.999900 +x_0=300000 +y_0=700000 +ellps=intl +units=m +no_defs  no_defs <>
-# NZGD49 / Bay of Plenty Circuit
-<esri27206> +proj=tmerc +lat_0=-37.76124980555556 +lon_0=176.46619725 +k=1.000000 +x_0=300000 +y_0=700000 +ellps=intl +units=m +no_defs  no_defs <>
-# NZGD49 / Poverty Bay Circuit
-<esri27207> +proj=tmerc +lat_0=-38.62470277777778 +lon_0=177.8856362777778 +k=1.000000 +x_0=300000 +y_0=700000 +ellps=intl +units=m +no_defs  no_defs <>
-# NZGD49 / Hawkes Bay Circuit
-<esri27208> +proj=tmerc +lat_0=-39.65092930555556 +lon_0=176.6736805277778 +k=1.000000 +x_0=300000 +y_0=700000 +ellps=intl +units=m +no_defs  no_defs <>
-# NZGD49 / Taranaki Circuit
-<esri27209> +proj=tmerc +lat_0=-39.13575830555556 +lon_0=174.22801175 +k=1.000000 +x_0=300000 +y_0=700000 +ellps=intl +units=m +no_defs  no_defs <>
-# NZGD49 / Tuhirangi Circuit
-<esri27210> +proj=tmerc +lat_0=-39.51247038888889 +lon_0=175.6400368055556 +k=1.000000 +x_0=300000 +y_0=700000 +ellps=intl +units=m +no_defs  no_defs <>
-# NZGD49 / Wanganui Circuit
-<esri27211> +proj=tmerc +lat_0=-40.24194713888889 +lon_0=175.4880996111111 +k=1.000000 +x_0=300000 +y_0=700000 +ellps=intl +units=m +no_defs  no_defs <>
-# NZGD49 / Wairarapa Circuit
-<esri27212> +proj=tmerc +lat_0=-40.92553263888889 +lon_0=175.6473496666667 +k=1.000000 +x_0=300000 +y_0=700000 +ellps=intl +units=m +no_defs  no_defs <>
-# NZGD49 / Wellington Circuit
-<esri27213> +proj=tmerc +lat_0=-41.30131963888888 +lon_0=174.7766231111111 +k=1.000000 +x_0=300000 +y_0=700000 +ellps=intl +units=m +no_defs  no_defs <>
-# NZGD49 / Collingwood Circuit
-<esri27214> +proj=tmerc +lat_0=-40.71475905555556 +lon_0=172.6720465 +k=1.000000 +x_0=300000 +y_0=700000 +ellps=intl +units=m +no_defs  no_defs <>
-# NZGD49 / Nelson Circuit
-<esri27215> +proj=tmerc +lat_0=-41.27454472222222 +lon_0=173.2993168055555 +k=1.000000 +x_0=300000 +y_0=700000 +ellps=intl +units=m +no_defs  no_defs <>
-# NZGD49 / Karamea Circuit
-<esri27216> +proj=tmerc +lat_0=-41.28991152777778 +lon_0=172.1090281944444 +k=1.000000 +x_0=300000 +y_0=700000 +ellps=intl +units=m +no_defs  no_defs <>
-# NZGD49 / Buller Circuit
-<esri27217> +proj=tmerc +lat_0=-41.81080286111111 +lon_0=171.5812600555556 +k=1.000000 +x_0=300000 +y_0=700000 +ellps=intl +units=m +no_defs  no_defs <>
-# NZGD49 / Grey Circuit
-<esri27218> +proj=tmerc +lat_0=-42.33369427777778 +lon_0=171.5497713055556 +k=1.000000 +x_0=300000 +y_0=700000 +ellps=intl +units=m +no_defs  no_defs <>
-# NZGD49 / Amuri Circuit
-<esri27219> +proj=tmerc +lat_0=-42.68911658333333 +lon_0=173.0101333888889 +k=1.000000 +x_0=300000 +y_0=700000 +ellps=intl +units=m +no_defs  no_defs <>
-# NZGD49 / Marlborough Circuit
-<esri27220> +proj=tmerc +lat_0=-41.54448666666666 +lon_0=173.8020741111111 +k=1.000000 +x_0=300000 +y_0=700000 +ellps=intl +units=m +no_defs  no_defs <>
-# NZGD49 / Hokitika Circuit
-<esri27221> +proj=tmerc +lat_0=-42.88632236111111 +lon_0=170.9799935 +k=1.000000 +x_0=300000 +y_0=700000 +ellps=intl +units=m +no_defs  no_defs <>
-# NZGD49 / Okarito Circuit
-<esri27222> +proj=tmerc +lat_0=-43.11012813888889 +lon_0=170.2609258333333 +k=1.000000 +x_0=300000 +y_0=700000 +ellps=intl +units=m +no_defs  no_defs <>
-# NZGD49 / Jacksons Bay Circuit
-<esri27223> +proj=tmerc +lat_0=-43.97780288888889 +lon_0=168.606267 +k=1.000000 +x_0=300000 +y_0=700000 +ellps=intl +units=m +no_defs  no_defs <>
-# NZGD49 / Mount Pleasant Circuit
-<esri27224> +proj=tmerc +lat_0=-43.59063758333333 +lon_0=172.7271935833333 +k=1.000000 +x_0=300000 +y_0=700000 +ellps=intl +units=m +no_defs  no_defs <>
-# NZGD49 / Gawler Circuit
-<esri27225> +proj=tmerc +lat_0=-43.74871155555556 +lon_0=171.3607484722222 +k=1.000000 +x_0=300000 +y_0=700000 +ellps=intl +units=m +no_defs  no_defs <>
-# NZGD49 / Timaru Circuit
-<esri27226> +proj=tmerc +lat_0=-44.40222036111111 +lon_0=171.0572508333333 +k=1.000000 +x_0=300000 +y_0=700000 +ellps=intl +units=m +no_defs  no_defs <>
-# NZGD49 / Lindis Peak Circuit
-<esri27227> +proj=tmerc +lat_0=-44.73526797222222 +lon_0=169.4677550833333 +k=1.000000 +x_0=300000 +y_0=700000 +ellps=intl +units=m +no_defs  no_defs <>
-# NZGD49 / Mount Nicholas Circuit
-<esri27228> +proj=tmerc +lat_0=-45.13290258333333 +lon_0=168.3986411944444 +k=1.000000 +x_0=300000 +y_0=700000 +ellps=intl +units=m +no_defs  no_defs <>
-# NZGD49 / Mount York Circuit
-<esri27229> +proj=tmerc +lat_0=-45.56372616666666 +lon_0=167.7388617777778 +k=1.000000 +x_0=300000 +y_0=700000 +ellps=intl +units=m +no_defs  no_defs <>
-# NZGD49 / Observation Point Circuit
-<esri27230> +proj=tmerc +lat_0=-45.81619661111111 +lon_0=170.6285951666667 +k=1.000000 +x_0=300000 +y_0=700000 +ellps=intl +units=m +no_defs  no_defs <>
-# NZGD49 / North Taieri Circuit
-<esri27231> +proj=tmerc +lat_0=-45.86151336111111 +lon_0=170.2825891111111 +k=0.999960 +x_0=300000 +y_0=700000 +ellps=intl +units=m +no_defs  no_defs <>
-# NZGD49 / Bluff Circuit
-<esri27232> +proj=tmerc +lat_0=-46.60000961111111 +lon_0=168.342872 +k=1.000000 +x_0=300002.66 +y_0=699999.58 +ellps=intl +units=m +no_defs  no_defs <>
-# NZGD49 / UTM zone 58S
-<esri27258> +proj=utm +zone=58 +south +ellps=intl +units=m +no_defs  no_defs <>
-# NZGD49 / UTM zone 59S
-<esri27259> +proj=utm +zone=59 +south +ellps=intl +units=m +no_defs  no_defs <>
-# NZGD49 / UTM zone 60S
-<esri27260> +proj=utm +zone=60 +south +ellps=intl +units=m +no_defs  no_defs <>
-# NZGD49 / North Island Grid
-<esri27291> +proj=tmerc +lat_0=-39 +lon_0=175.5 +k=1.000000 +x_0=274319.5243848086 +y_0=365759.3658464114 +ellps=intl +to_meter=0.9143984146160287 +no_defs  no_defs <>
-# NZGD49 / South Island Grid
-<esri27292> +proj=tmerc +lat_0=-44 +lon_0=171.5 +k=1.000000 +x_0=457199.2073080143 +y_0=457199.2073080143 +ellps=intl +to_meter=0.9143984146160287 +no_defs  no_defs <>
-# NGO 1948 (Oslo) / NGO zone I
-<esri27391> +proj=tmerc +lat_0=58 +lon_0=6.056250000000003 +k=1.000000 +x_0=0 +y_0=0 +a=6377492.018 +b=6356173.508712696 +towgs84=278.3,93,474.5,7.889,0.05,-6.61,6.21 +pm=oslo +units=m +no_defs  no_defs <>
-# NGO 1948 (Oslo) / NGO zone II
-<esri27392> +proj=tmerc +lat_0=58 +lon_0=8.389583333333336 +k=1.000000 +x_0=0 +y_0=0 +a=6377492.018 +b=6356173.508712696 +towgs84=278.3,93,474.5,7.889,0.05,-6.61,6.21 +pm=oslo +units=m +no_defs  no_defs <>
-# NGO 1948 (Oslo) / NGO zone III
-<esri27393> +proj=tmerc +lat_0=58 +lon_0=10.72291666666667 +k=1.000000 +x_0=0 +y_0=0 +a=6377492.018 +b=6356173.508712696 +towgs84=278.3,93,474.5,7.889,0.05,-6.61,6.21 +pm=oslo +units=m +no_defs  no_defs <>
-# NGO 1948 (Oslo) / NGO zone IV
-<esri27394> +proj=tmerc +lat_0=58 +lon_0=13.22291666666667 +k=1.000000 +x_0=0 +y_0=0 +a=6377492.018 +b=6356173.508712696 +towgs84=278.3,93,474.5,7.889,0.05,-6.61,6.21 +pm=oslo +units=m +no_defs  no_defs <>
-# NGO 1948 (Oslo) / NGO zone V
-<esri27395> +proj=tmerc +lat_0=58 +lon_0=16.88958333333334 +k=1.000000 +x_0=0 +y_0=0 +a=6377492.018 +b=6356173.508712696 +towgs84=278.3,93,474.5,7.889,0.05,-6.61,6.21 +pm=oslo +units=m +no_defs  no_defs <>
-# NGO 1948 (Oslo) / NGO zone VI
-<esri27396> +proj=tmerc +lat_0=58 +lon_0=20.88958333333333 +k=1.000000 +x_0=0 +y_0=0 +a=6377492.018 +b=6356173.508712696 +towgs84=278.3,93,474.5,7.889,0.05,-6.61,6.21 +pm=oslo +units=m +no_defs  no_defs <>
-# NGO 1948 (Oslo) / NGO zone VII
-<esri27397> +proj=tmerc +lat_0=58 +lon_0=24.88958333333333 +k=1.000000 +x_0=0 +y_0=0 +a=6377492.018 +b=6356173.508712696 +towgs84=278.3,93,474.5,7.889,0.05,-6.61,6.21 +pm=oslo +units=m +no_defs  no_defs <>
-# NGO 1948 (Oslo) / NGO zone VIII
-<esri27398> +proj=tmerc +lat_0=58 +lon_0=29.05625 +k=1.000000 +x_0=0 +y_0=0 +a=6377492.018 +b=6356173.508712696 +towgs84=278.3,93,474.5,7.889,0.05,-6.61,6.21 +pm=oslo +units=m +no_defs  no_defs <>
-# Datum 73 / UTM zone 29N
-<esri27429> +proj=utm +zone=29 +ellps=intl +units=m +no_defs  no_defs <>
-# Datum 73 / Modified Portuguese Grid
-<esri27492> +proj=tmerc +lat_0=39.66666666666666 +lon_0=-8.131906111111112 +k=1.000000 +x_0=180.598 +y_0=-86.98999999999999 +ellps=intl +units=m +no_defs  no_defs <>
-# ATF (Paris) / Nord de Guerre
-<esri27500> +proj=lcc +lat_1=49.50000000000001 +lat_0=49.50000000000001 +lon_0=7.737229170000001 +k_0=0.99950908 +x_0=500000 +y_0=300000 +a=6376523 +b=6355862.933255573 +pm=paris +units=m +no_defs  no_defs <>
-# NTF (Paris) / Lambert Nord France
-<esri27561> +proj=lcc +lat_1=49.50000000000001 +lat_0=49.50000000000001 +lon_0=2.33722917 +k_0=0.999877341 +x_0=600000 +y_0=200000 +a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 +pm=paris +units=m +no_defs  no_defs <>
-# NTF (Paris) / Lambert Centre France
-<esri27562> +proj=lcc +lat_1=46.8 +lat_0=46.8 +lon_0=2.33722917 +k_0=0.99987742 +x_0=600000 +y_0=200000 +a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 +pm=paris +units=m +no_defs  no_defs <>
-# NTF (Paris) / Lambert Sud France
-<esri27563> +proj=lcc +lat_1=44.10000000000001 +lat_0=44.10000000000001 +lon_0=2.33722917 +k_0=0.999877499 +x_0=600000 +y_0=200000 +a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 +pm=paris +units=m +no_defs  no_defs <>
-# NTF (Paris) / Lambert Corse
-<esri27564> +proj=lcc +lat_1=42.16500000000001 +lat_0=42.16500000000001 +lon_0=2.33722917 +k_0=0.99994471 +x_0=234.358 +y_0=185861.369 +a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 +pm=paris +units=m +no_defs  no_defs <>
-# NTF (Paris) / Lambert zone I
-<esri27571> +proj=lcc +lat_1=49.50000000000001 +lat_0=49.50000000000001 +lon_0=2.33722917 +k_0=0.999877341 +x_0=600000 +y_0=1200000 +a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 +pm=paris +units=m +no_defs  no_defs <>
-# NTF (Paris) / Lambert zone II
-<esri27572> +proj=lcc +lat_1=46.8 +lat_0=46.8 +lon_0=2.33722917 +k_0=0.99987742 +x_0=600000 +y_0=2200000 +a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 +pm=paris +units=m +no_defs  no_defs <>
-# NTF (Paris) / Lambert zone III
-<esri27573> +proj=lcc +lat_1=44.10000000000001 +lat_0=44.10000000000001 +lon_0=2.33722917 +k_0=0.999877499 +x_0=600000 +y_0=3200000 +a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 +pm=paris +units=m +no_defs  no_defs <>
-# NTF (Paris) / Lambert zone IV
-<esri27574> +proj=lcc +lat_1=42.16500000000001 +lat_0=42.16500000000001 +lon_0=2.33722917 +k_0=0.99994471 +x_0=234.358 +y_0=4185861.369 +a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 +pm=paris +units=m +no_defs  no_defs <>
-# NTF (Paris) / France I
-<esri27581> +proj=lcc +lat_1=49.50000000000001 +lat_0=49.50000000000001 +lon_0=2.33722917 +k_0=0.999877341 +x_0=600000 +y_0=1200000 +a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 +pm=paris +units=m +no_defs  no_defs <>
-# NTF (Paris) / France II
-<esri27582> +proj=lcc +lat_1=46.8 +lat_0=46.8 +lon_0=2.33722917 +k_0=0.99987742 +x_0=600000 +y_0=2200000 +a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 +pm=paris +units=m +no_defs  no_defs <>
-# NTF (Paris) / France III
-<esri27583> +proj=lcc +lat_1=44.10000000000001 +lat_0=44.10000000000001 +lon_0=2.33722917 +k_0=0.999877499 +x_0=600000 +y_0=3200000 +a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 +pm=paris +units=m +no_defs  no_defs <>
-# NTF (Paris) / France IV
-<esri27584> +proj=lcc +lat_1=42.16500000000001 +lat_0=42.16500000000001 +lon_0=2.33722917 +k_0=0.99994471 +x_0=234.358 +y_0=4185861.369 +a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 +pm=paris +units=m +no_defs  no_defs <>
-# NTF (Paris) / Nord France
-<esri27591> +proj=lcc +lat_1=49.50000000000001 +lat_0=49.50000000000001 +lon_0=2.33722917 +k_0=0.999877341 +x_0=600000 +y_0=200000 +a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 +pm=paris +units=m +no_defs  no_defs <>
-# NTF (Paris) / Centre France
-<esri27592> +proj=lcc +lat_1=46.8 +lat_0=46.8 +lon_0=2.33722917 +k_0=0.99987742 +x_0=600000 +y_0=200000 +a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 +pm=paris +units=m +no_defs  no_defs <>
-# NTF (Paris) / Sud France
-<esri27593> +proj=lcc +lat_1=44.10000000000001 +lat_0=44.10000000000001 +lon_0=2.33722917 +k_0=0.999877499 +x_0=600000 +y_0=200000 +a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 +pm=paris +units=m +no_defs  no_defs <>
-# NTF (Paris) / Corse
-<esri27594> +proj=lcc +lat_1=42.16500000000001 +lat_0=42.16500000000001 +lon_0=2.33722917 +k_0=0.99994471 +x_0=234.358 +y_0=185861.369 +a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 +pm=paris +units=m +no_defs  no_defs <>
-# OSGB 1936 / British National Grid
-<esri27700> +proj=tmerc +lat_0=49 +lon_0=-2 +k=0.999601 +x_0=400000 +y_0=-100000 +ellps=airy +units=m +no_defs  no_defs <>
-# Palestine 1923 / Palestine Grid
-<esri28191> +proj=cass +lat_0=31.73409694444445 +lon_0=35.21208055555556 +x_0=170251.555 +y_0=126867.909 +a=6378300.789 +b=6356566.435 +units=m +no_defs  no_defs <>
-# Palestine 1923 / Palestine Belt
-<esri28192> +proj=tmerc +lat_0=31.73409694444445 +lon_0=35.21208055555556 +k=1.000000 +x_0=170251.555 +y_0=1126867.909 +a=6378300.789 +b=6356566.435 +units=m +no_defs  no_defs <>
-# Palestine 1923 / Israeli CS Grid
-<esri28193> +proj=cass +lat_0=31.73409694444445 +lon_0=35.21208055555556 +x_0=170251.555 +y_0=1126867.909 +a=6378300.789 +b=6356566.435 +units=m +no_defs  no_defs <>
-# Pointe Noire / UTM zone 32S
-<esri28232> +proj=utm +zone=32 +south +a=6378249.2 +b=6356515 +units=m +no_defs  no_defs <>
-# GDA94 / MGA zone 48
-<esri28348> +proj=utm +zone=48 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# GDA94 / MGA zone 49
-<esri28349> +proj=utm +zone=49 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# GDA94 / MGA zone 50
-<esri28350> +proj=utm +zone=50 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# GDA94 / MGA zone 51
-<esri28351> +proj=utm +zone=51 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# GDA94 / MGA zone 52
-<esri28352> +proj=utm +zone=52 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# GDA94 / MGA zone 53
-<esri28353> +proj=utm +zone=53 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# GDA94 / MGA zone 54
-<esri28354> +proj=utm +zone=54 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# GDA94 / MGA zone 55
-<esri28355> +proj=utm +zone=55 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# GDA94 / MGA zone 56
-<esri28356> +proj=utm +zone=56 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# GDA94 / MGA zone 57
-<esri28357> +proj=utm +zone=57 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# GDA94 / MGA zone 58
-<esri28358> +proj=utm +zone=58 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / Gauss-Kruger zone 2
-<esri28402> +proj=tmerc +lat_0=0 +lon_0=9 +k=1.000000 +x_0=2500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / Gauss-Kruger zone 3
-<esri28403> +proj=tmerc +lat_0=0 +lon_0=15 +k=1.000000 +x_0=3500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / Gauss-Kruger zone 4
-<esri28404> +proj=tmerc +lat_0=0 +lon_0=21 +k=1.000000 +x_0=4500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / Gauss-Kruger zone 5
-<esri28405> +proj=tmerc +lat_0=0 +lon_0=27 +k=1.000000 +x_0=5500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / Gauss-Kruger zone 6
-<esri28406> +proj=tmerc +lat_0=0 +lon_0=33 +k=1.000000 +x_0=6500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / Gauss-Kruger zone 7
-<esri28407> +proj=tmerc +lat_0=0 +lon_0=39 +k=1.000000 +x_0=7500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / Gauss-Kruger zone 8
-<esri28408> +proj=tmerc +lat_0=0 +lon_0=45 +k=1.000000 +x_0=8500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / Gauss-Kruger zone 9
-<esri28409> +proj=tmerc +lat_0=0 +lon_0=51 +k=1.000000 +x_0=9500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / Gauss-Kruger zone 10
-<esri28410> +proj=tmerc +lat_0=0 +lon_0=57 +k=1.000000 +x_0=10500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / Gauss-Kruger zone 11
-<esri28411> +proj=tmerc +lat_0=0 +lon_0=63 +k=1.000000 +x_0=11500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / Gauss-Kruger zone 12
-<esri28412> +proj=tmerc +lat_0=0 +lon_0=69 +k=1.000000 +x_0=12500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / Gauss-Kruger zone 13
-<esri28413> +proj=tmerc +lat_0=0 +lon_0=75 +k=1.000000 +x_0=13500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / Gauss-Kruger zone 14
-<esri28414> +proj=tmerc +lat_0=0 +lon_0=81 +k=1.000000 +x_0=14500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / Gauss-Kruger zone 15
-<esri28415> +proj=tmerc +lat_0=0 +lon_0=87 +k=1.000000 +x_0=15500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / Gauss-Kruger zone 16
-<esri28416> +proj=tmerc +lat_0=0 +lon_0=93 +k=1.000000 +x_0=16500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / Gauss-Kruger zone 17
-<esri28417> +proj=tmerc +lat_0=0 +lon_0=99 +k=1.000000 +x_0=17500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / Gauss-Kruger zone 18
-<esri28418> +proj=tmerc +lat_0=0 +lon_0=105 +k=1.000000 +x_0=18500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / Gauss-Kruger zone 19
-<esri28419> +proj=tmerc +lat_0=0 +lon_0=111 +k=1.000000 +x_0=19500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / Gauss-Kruger zone 20
-<esri28420> +proj=tmerc +lat_0=0 +lon_0=117 +k=1.000000 +x_0=20500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / Gauss-Kruger zone 21
-<esri28421> +proj=tmerc +lat_0=0 +lon_0=123 +k=1.000000 +x_0=21500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / Gauss-Kruger zone 22
-<esri28422> +proj=tmerc +lat_0=0 +lon_0=129 +k=1.000000 +x_0=22500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / Gauss-Kruger zone 23
-<esri28423> +proj=tmerc +lat_0=0 +lon_0=135 +k=1.000000 +x_0=23500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / Gauss-Kruger zone 24
-<esri28424> +proj=tmerc +lat_0=0 +lon_0=141 +k=1.000000 +x_0=24500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / Gauss-Kruger zone 25
-<esri28425> +proj=tmerc +lat_0=0 +lon_0=147 +k=1.000000 +x_0=25500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / Gauss-Kruger zone 26
-<esri28426> +proj=tmerc +lat_0=0 +lon_0=153 +k=1.000000 +x_0=26500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / Gauss-Kruger zone 27
-<esri28427> +proj=tmerc +lat_0=0 +lon_0=159 +k=1.000000 +x_0=27500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / Gauss-Kruger zone 28
-<esri28428> +proj=tmerc +lat_0=0 +lon_0=165 +k=1.000000 +x_0=28500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / Gauss-Kruger zone 29
-<esri28429> +proj=tmerc +lat_0=0 +lon_0=171 +k=1.000000 +x_0=29500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / Gauss-Kruger zone 30
-<esri28430> +proj=tmerc +lat_0=0 +lon_0=177 +k=1.000000 +x_0=30500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / Gauss-Kruger zone 31
-<esri28431> +proj=tmerc +lat_0=0 +lon_0=-177 +k=1.000000 +x_0=31500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / Gauss-Kruger zone 32
-<esri28432> +proj=tmerc +lat_0=0 +lon_0=-171 +k=1.000000 +x_0=32500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / Gauss-Kruger 2N
-<esri28462> +proj=tmerc +lat_0=0 +lon_0=9 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / Gauss-Kruger 3N
-<esri28463> +proj=tmerc +lat_0=0 +lon_0=15 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / Gauss-Kruger 4N
-<esri28464> +proj=tmerc +lat_0=0 +lon_0=21 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / Gauss-Kruger 5N
-<esri28465> +proj=tmerc +lat_0=0 +lon_0=27 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / Gauss-Kruger 6N
-<esri28466> +proj=tmerc +lat_0=0 +lon_0=33 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / Gauss-Kruger 7N
-<esri28467> +proj=tmerc +lat_0=0 +lon_0=39 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / Gauss-Kruger 8N
-<esri28468> +proj=tmerc +lat_0=0 +lon_0=45 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / Gauss-Kruger 9N
-<esri28469> +proj=tmerc +lat_0=0 +lon_0=51 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / Gauss-Kruger 10N
-<esri28470> +proj=tmerc +lat_0=0 +lon_0=57 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / Gauss-Kruger 11N
-<esri28471> +proj=tmerc +lat_0=0 +lon_0=63 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / Gauss-Kruger 12N
-<esri28472> +proj=tmerc +lat_0=0 +lon_0=69 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / Gauss-Kruger 13N
-<esri28473> +proj=tmerc +lat_0=0 +lon_0=75 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / Gauss-Kruger 14N
-<esri28474> +proj=tmerc +lat_0=0 +lon_0=81 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / Gauss-Kruger 15N
-<esri28475> +proj=tmerc +lat_0=0 +lon_0=87 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / Gauss-Kruger 16N
-<esri28476> +proj=tmerc +lat_0=0 +lon_0=93 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / Gauss-Kruger 17N
-<esri28477> +proj=tmerc +lat_0=0 +lon_0=99 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / Gauss-Kruger 18N
-<esri28478> +proj=tmerc +lat_0=0 +lon_0=105 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / Gauss-Kruger 19N
-<esri28479> +proj=tmerc +lat_0=0 +lon_0=111 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / Gauss-Kruger 20N
-<esri28480> +proj=tmerc +lat_0=0 +lon_0=117 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / Gauss-Kruger 21N
-<esri28481> +proj=tmerc +lat_0=0 +lon_0=123 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / Gauss-Kruger 22N
-<esri28482> +proj=tmerc +lat_0=0 +lon_0=129 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / Gauss-Kruger 23N
-<esri28483> +proj=tmerc +lat_0=0 +lon_0=135 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / Gauss-Kruger 24N
-<esri28484> +proj=tmerc +lat_0=0 +lon_0=141 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / Gauss-Kruger 25N
-<esri28485> +proj=tmerc +lat_0=0 +lon_0=147 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / Gauss-Kruger 26N
-<esri28486> +proj=tmerc +lat_0=0 +lon_0=153 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / Gauss-Kruger 27N
-<esri28487> +proj=tmerc +lat_0=0 +lon_0=159 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / Gauss-Kruger 28N
-<esri28488> +proj=tmerc +lat_0=0 +lon_0=165 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / Gauss-Kruger 29N
-<esri28489> +proj=tmerc +lat_0=0 +lon_0=171 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / Gauss-Kruger 30N
-<esri28490> +proj=tmerc +lat_0=0 +lon_0=177 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / Gauss-Kruger 31N
-<esri28491> +proj=tmerc +lat_0=0 +lon_0=-177 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Pulkovo 1942 / Gauss-Kruger 32N
-<esri28492> +proj=tmerc +lat_0=0 +lon_0=-171 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs  no_defs <>
-# Qatar 1974 / Qatar National Grid
-<esri28600> +proj=tmerc +lat_0=24.45 +lon_0=51.21666666666667 +k=0.999990 +x_0=200000 +y_0=300000 +ellps=intl +units=m +no_defs  no_defs <>
-# Amersfoort / RD Old
-<esri28991> +proj=stere +lat_0=52.15616055555555 +lon_0=5.38763888888889 +k=0.999908 +x_0=0 +y_0=0 +ellps=bessel +units=m +no_defs  no_defs <>
-# Amersfoort / RD New
-<esri28992> +proj=stere +lat_0=52.15616055555555 +lon_0=5.38763888888889 +k=0.999908 +x_0=155000 +y_0=463000 +ellps=bessel +units=m +no_defs  no_defs <>
-# SAD69 / Brazil Polyconic
-<esri29100> +proj=poly +lat_0=0 +lon_0=-54 +x_0=5000000 +y_0=10000000 +ellps=GRS67 +units=m +no_defs  no_defs <>
-# SAD69 / UTM zone 18N
-<esri29118> +proj=utm +zone=18 +ellps=GRS67 +units=m +no_defs  no_defs <>
-# SAD69 / UTM zone 19N
-<esri29119> +proj=utm +zone=19 +ellps=GRS67 +units=m +no_defs  no_defs <>
-# SAD69 / UTM zone 20N
-<esri29120> +proj=utm +zone=20 +ellps=GRS67 +units=m +no_defs  no_defs <>
-# SAD69 / UTM zone 21N
-<esri29121> +proj=utm +zone=21 +ellps=GRS67 +units=m +no_defs  no_defs <>
-# SAD69 / UTM zone 22N
-<esri29122> +proj=utm +zone=22 +ellps=GRS67 +units=m +no_defs  no_defs <>
-# SAD69 / UTM zone 17S
-<esri29177> +proj=utm +zone=17 +south +ellps=GRS67 +units=m +no_defs  no_defs <>
-# SAD69 / UTM zone 18S
-<esri29178> +proj=utm +zone=18 +south +ellps=GRS67 +units=m +no_defs  no_defs <>
-# SAD69 / UTM zone 19S
-<esri29179> +proj=utm +zone=19 +south +ellps=GRS67 +units=m +no_defs  no_defs <>
-# SAD69 / UTM zone 20S
-<esri29180> +proj=utm +zone=20 +south +ellps=GRS67 +units=m +no_defs  no_defs <>
-# SAD69 / UTM zone 21S
-<esri29181> +proj=utm +zone=21 +south +ellps=GRS67 +units=m +no_defs  no_defs <>
-# SAD69 / UTM zone 22S
-<esri29182> +proj=utm +zone=22 +south +ellps=GRS67 +units=m +no_defs  no_defs <>
-# SAD69 / UTM zone 23S
-<esri29183> +proj=utm +zone=23 +south +ellps=GRS67 +units=m +no_defs  no_defs <>
-# SAD69 / UTM zone 24S
-<esri29184> +proj=utm +zone=24 +south +ellps=GRS67 +units=m +no_defs  no_defs <>
-# SAD69 / UTM zone 25S
-<esri29185> +proj=utm +zone=25 +south +ellps=GRS67 +units=m +no_defs  no_defs <>
-# Sapper Hill 1943 / UTM zone 20S
-<esri29220> +proj=utm +zone=20 +south +ellps=intl +towgs84=-355,21,72,0,0,0,0 +units=m +no_defs  no_defs <>
-# Sapper Hill 1943 / UTM zone 21S
-<esri29221> +proj=utm +zone=21 +south +ellps=intl +towgs84=-355,21,72,0,0,0,0 +units=m +no_defs  no_defs <>
-# Schwarzeck / UTM zone 33S
-<esri29333> +proj=utm +zone=33 +south +ellps=bess_nam +units=m +no_defs  no_defs <>
-# South West African Coord. System zone 11
-# South West African Coord. System zone 13
-# South West African Coord. System zone 15
-# South West African Coord. System zone 17
-# South West African Coord. System zone 19
-# South West African Coord. System zone 21
-# South West African Coord. System zone 23
-# South West African Coord. System zone 25
-# Sudan / UTM zone 35N
-<esri29635> +proj=utm +zone=35 +a=6378249.2 +b=6356515 +units=m +no_defs  no_defs <>
-# Sudan / UTM zone 36N
-<esri29636> +proj=utm +zone=36 +a=6378249.2 +b=6356515 +units=m +no_defs  no_defs <>
-# Tananarive (Paris) / Laborde Grid
-<esri29700> +proj=omerc +lat_0=-18.9 +lonc=46.43722917000001 +alpha=18.9 +k=0.9995000000000001 +x_0=400000 +y_0=800000 +ellps=intl +towgs84=-189,-242,-91,0,0,0,0 +pm=paris +units=m +no_defs  no_defs <>
-# Tananarive / UTM zone 38S
-<esri29738> +proj=utm +zone=38 +south +ellps=intl +towgs84=-189,-242,-91,0,0,0,0 +units=m +no_defs  no_defs <>
-# Tananarive / UTM zone 39S
-<esri29739> +proj=utm +zone=39 +south +ellps=intl +towgs84=-189,-242,-91,0,0,0,0 +units=m +no_defs  no_defs <>
-# Timbalai 1948 / UTM zone 49N
-<esri29849> +proj=utm +zone=49 +ellps=evrstSS +units=m +no_defs  no_defs <>
-# Timbalai 1948 / UTM zone 50N
-<esri29850> +proj=utm +zone=50 +ellps=evrstSS +units=m +no_defs  no_defs <>
-# Timbalai 1948 / R.S.O. Borneo (ch)
-<esri29871> +proj=omerc +lat_0=4 +lonc=115 +alpha=53.31582047222222 +k=0.99984 +x_0=590476.8714630401 +y_0=442857.653094361 +ellps=evrstSS +to_meter=20.11676512155263 +no_defs  no_defs <>
-# Timbalai 1948 / R.S.O. Borneo (ft)
-<esri29872> +proj=omerc +lat_0=4 +lonc=115 +alpha=53.31582047222222 +k=0.99984 +x_0=590476.8727431979 +y_0=442857.6545573985 +ellps=evrstSS +to_meter=0.3047994715386762 +no_defs  no_defs <>
-# Timbalai 1948 / R.S.O. Borneo (m)
-<esri29873> +proj=omerc +lat_0=4 +lonc=115 +alpha=53.31582047222222 +k=0.99984 +x_0=590476.87 +y_0=442857.65 +ellps=evrstSS +units=m +no_defs  no_defs <>
-# TM65 / Irish National Grid
-<esri29900> +proj=tmerc +lat_0=53.5 +lon_0=-8 +k=1.000035 +x_0=200000 +y_0=250000 +a=6377340.189 +b=6356034.447938534 +units=m +no_defs  no_defs <>
-# OSNI 1952 / Irish National Grid
-<esri29901> +proj=tmerc +lat_0=53.5 +lon_0=-8 +k=1.000000 +x_0=200000 +y_0=250000 +ellps=airy +units=m +no_defs  no_defs <>
-# TM65 / Irish Grid
-<esri29902> +proj=tmerc +lat_0=53.5 +lon_0=-8 +k=1.000035 +x_0=200000 +y_0=250000 +a=6377340.189 +b=6356034.447938534 +units=m +no_defs  no_defs <>
-# TM75 / Irish Grid
-<esri29903> +proj=tmerc +lat_0=53.5 +lon_0=-8 +k=1.000035 +x_0=200000 +y_0=250000 +a=6377340.189 +b=6356034.447938534 +units=m +no_defs  no_defs <>
-# Tokyo / Japan Plane Rectangular CS I
-<esri30161> +proj=tmerc +lat_0=33 +lon_0=129.5 +k=0.999900 +x_0=0 +y_0=0 +ellps=bessel +units=m +no_defs  no_defs <>
-# Tokyo / Japan Plane Rectangular CS II
-<esri30162> +proj=tmerc +lat_0=33 +lon_0=131 +k=0.999900 +x_0=0 +y_0=0 +ellps=bessel +units=m +no_defs  no_defs <>
-# Tokyo / Japan Plane Rectangular CS III
-<esri30163> +proj=tmerc +lat_0=36 +lon_0=132.1666666666667 +k=0.999900 +x_0=0 +y_0=0 +ellps=bessel +units=m +no_defs  no_defs <>
-# Tokyo / Japan Plane Rectangular CS IV
-<esri30164> +proj=tmerc +lat_0=33 +lon_0=133.5 +k=0.999900 +x_0=0 +y_0=0 +ellps=bessel +units=m +no_defs  no_defs <>
-# Tokyo / Japan Plane Rectangular CS V
-<esri30165> +proj=tmerc +lat_0=36 +lon_0=134.3333333333333 +k=0.999900 +x_0=0 +y_0=0 +ellps=bessel +units=m +no_defs  no_defs <>
-# Tokyo / Japan Plane Rectangular CS VI
-<esri30166> +proj=tmerc +lat_0=36 +lon_0=136 +k=0.999900 +x_0=0 +y_0=0 +ellps=bessel +units=m +no_defs  no_defs <>
-# Tokyo / Japan Plane Rectangular CS VII
-<esri30167> +proj=tmerc +lat_0=36 +lon_0=137.1666666666667 +k=0.999900 +x_0=0 +y_0=0 +ellps=bessel +units=m +no_defs  no_defs <>
-# Tokyo / Japan Plane Rectangular CS VIII
-<esri30168> +proj=tmerc +lat_0=36 +lon_0=138.5 +k=0.999900 +x_0=0 +y_0=0 +ellps=bessel +units=m +no_defs  no_defs <>
-# Tokyo / Japan Plane Rectangular CS IX
-<esri30169> +proj=tmerc +lat_0=36 +lon_0=139.8333333333333 +k=0.999900 +x_0=0 +y_0=0 +ellps=bessel +units=m +no_defs  no_defs <>
-# Tokyo / Japan Plane Rectangular CS X
-<esri30170> +proj=tmerc +lat_0=40 +lon_0=140.8333333333333 +k=0.999900 +x_0=0 +y_0=0 +ellps=bessel +units=m +no_defs  no_defs <>
-# Tokyo / Japan Plane Rectangular CS XI
-<esri30171> +proj=tmerc +lat_0=44 +lon_0=140.25 +k=0.999900 +x_0=0 +y_0=0 +ellps=bessel +units=m +no_defs  no_defs <>
-# Tokyo / Japan Plane Rectangular CS XII
-<esri30172> +proj=tmerc +lat_0=44 +lon_0=142.25 +k=0.999900 +x_0=0 +y_0=0 +ellps=bessel +units=m +no_defs  no_defs <>
-# Tokyo / Japan Plane Rectangular CS XIII
-<esri30173> +proj=tmerc +lat_0=44 +lon_0=144.25 +k=0.999900 +x_0=0 +y_0=0 +ellps=bessel +units=m +no_defs  no_defs <>
-# Tokyo / Japan Plane Rectangular CS XIV
-<esri30174> +proj=tmerc +lat_0=26 +lon_0=142 +k=0.999900 +x_0=0 +y_0=0 +ellps=bessel +units=m +no_defs  no_defs <>
-# Tokyo / Japan Plane Rectangular CS XV
-<esri30175> +proj=tmerc +lat_0=26 +lon_0=127.5 +k=0.999900 +x_0=0 +y_0=0 +ellps=bessel +units=m +no_defs  no_defs <>
-# Tokyo / Japan Plane Rectangular CS XVI
-<esri30176> +proj=tmerc +lat_0=26 +lon_0=124 +k=0.999900 +x_0=0 +y_0=0 +ellps=bessel +units=m +no_defs  no_defs <>
-# Tokyo / Japan Plane Rectangular CS XVII
-<esri30177> +proj=tmerc +lat_0=26 +lon_0=131 +k=0.999900 +x_0=0 +y_0=0 +ellps=bessel +units=m +no_defs  no_defs <>
-# Tokyo / Japan Plane Rectangular CS XVIII
-<esri30178> +proj=tmerc +lat_0=20 +lon_0=136 +k=0.999900 +x_0=0 +y_0=0 +ellps=bessel +units=m +no_defs  no_defs <>
-# Tokyo / Japan Plane Rectangular CS XIX
-<esri30179> +proj=tmerc +lat_0=26 +lon_0=154 +k=0.999900 +x_0=0 +y_0=0 +ellps=bessel +units=m +no_defs  no_defs <>
-# Trinidad 1903 / Trinidad Grid
-<esri30200> +proj=cass +lat_0=10.44166666666667 +lon_0=-61.33333333333334 +x_0=86501.46380700001 +y_0=65379.0133425 +a=6378293.63683822 +b=6356617.979337744 +towgs84=-61.702,284.488,472.052,0,0,0,0 +to_meter=0.2011661949 +no_defs  no_defs <>
-# TC(1948) / UTM zone 39N
-<esri30339> +proj=utm +zone=39 +ellps=helmert +units=m +no_defs  no_defs <>
-# TC(1948) / UTM zone 40N
-<esri30340> +proj=utm +zone=40 +ellps=helmert +units=m +no_defs  no_defs <>
-# Voirol 1875 / Nord Algerie (ancienne)
-<esri30491> +proj=lcc +lat_1=36 +lat_0=36 +lon_0=2.7 +k_0=0.999625544 +x_0=500000 +y_0=300000 +a=6378249.2 +b=6356515 +towgs84=-73,-247,227,0,0,0,0 +units=m +no_defs  no_defs <>
-# Voirol 1875 / Sud Algerie (ancienne)
-<esri30492> +proj=lcc +lat_1=33.3 +lat_0=33.3 +lon_0=2.7 +k_0=0.999625769 +x_0=500000 +y_0=300000 +a=6378249.2 +b=6356515 +towgs84=-73,-247,227,0,0,0,0 +units=m +no_defs  no_defs <>
-# Nord Sahara 1959 / UTM zone 29N
-<esri30729> +proj=utm +zone=29 +ellps=clrk80 +units=m +no_defs  no_defs <>
-# Nord Sahara 1959 / UTM zone 30N
-<esri30730> +proj=utm +zone=30 +ellps=clrk80 +units=m +no_defs  no_defs <>
-# Nord Sahara 1959 / UTM zone 31N
-<esri30731> +proj=utm +zone=31 +ellps=clrk80 +units=m +no_defs  no_defs <>
-# Nord Sahara 1959 / UTM zone 32N
-<esri30732> +proj=utm +zone=32 +ellps=clrk80 +units=m +no_defs  no_defs <>
-# Nord Sahara 1959 / Voirol Unifie Nord
-<esri30791> +proj=lcc +lat_1=36 +lat_0=36 +lon_0=2.7 +k_0=0.999625544 +x_0=500135 +y_0=300090 +ellps=clrk80 +units=m +no_defs  no_defs <>
-# Nord Sahara 1959 / Voirol Unifie Sud
-<esri30792> +proj=lcc +lat_1=33.3 +lat_0=33.3 +lon_0=2.7 +k_0=0.999625769 +x_0=500135 +y_0=300090 +ellps=clrk80 +units=m +no_defs  no_defs <>
-# RT38 2.5 gon W
-<esri30800> +proj=tmerc +lat_0=0 +lon_0=15.80827777777778 +k=1.000000 +x_0=1500000 +y_0=0 +ellps=bessel +units=m +no_defs  no_defs <>
-# Yoff / UTM zone 28N
-<esri31028> +proj=utm +zone=28 +a=6378249.2 +b=6356515 +units=m +no_defs  no_defs <>
-# Zanderij / UTM zone 21N
-<esri31121> +proj=utm +zone=21 +ellps=intl +towgs84=-265,120,-358,0,0,0,0 +units=m +no_defs  no_defs <>
-# Zanderij / TM 54 NW
-<esri31154> +proj=tmerc +lat_0=0 +lon_0=-54 +k=0.999600 +x_0=500000 +y_0=0 +ellps=intl +towgs84=-265,120,-358,0,0,0,0 +units=m +no_defs  no_defs <>
-# Zanderij / Suriname Old TM
-<esri31170> +proj=tmerc +lat_0=0 +lon_0=-55.68333333333333 +k=0.999600 +x_0=500000 +y_0=0 +ellps=intl +towgs84=-265,120,-358,0,0,0,0 +units=m +no_defs  no_defs <>
-# Zanderij / Suriname TM
-<esri31171> +proj=tmerc +lat_0=0 +lon_0=-55.68333333333333 +k=0.999900 +x_0=500000 +y_0=0 +ellps=intl +towgs84=-265,120,-358,0,0,0,0 +units=m +no_defs  no_defs <>
-# MGI / 3-degree Gauss zone 5
-<esri31265> +proj=tmerc +lat_0=0 +lon_0=15 +k=1.000000 +x_0=5500000 +y_0=0 +ellps=bessel +units=m +no_defs  no_defs <>
-# MGI / 3-degree Gauss zone 6
-<esri31266> +proj=tmerc +lat_0=0 +lon_0=18 +k=1.000000 +x_0=6500000 +y_0=0 +ellps=bessel +units=m +no_defs  no_defs <>
-# MGI / 3-degree Gauss zone 7
-<esri31267> +proj=tmerc +lat_0=0 +lon_0=21 +k=1.000000 +x_0=7500000 +y_0=0 +ellps=bessel +units=m +no_defs  no_defs <>
-# MGI / 3-degree Gauss zone 8
-<esri31268> +proj=tmerc +lat_0=0 +lon_0=24 +k=1.000000 +x_0=8500000 +y_0=0 +ellps=bessel +units=m +no_defs  no_defs <>
-# MGI / Balkans zone 5
-<esri31275> +proj=tmerc +lat_0=0 +lon_0=15 +k=0.999900 +x_0=5500000 +y_0=0 +ellps=bessel +units=m +no_defs  no_defs <>
-# MGI / Balkans zone 6
-<esri31276> +proj=tmerc +lat_0=0 +lon_0=18 +k=0.999900 +x_0=6500000 +y_0=0 +ellps=bessel +units=m +no_defs  no_defs <>
-# MGI / Balkans zone 7
-<esri31277> +proj=tmerc +lat_0=0 +lon_0=21 +k=0.999900 +x_0=7500000 +y_0=0 +ellps=bessel +units=m +no_defs  no_defs <>
-# MGI / Balkans zone 8
-<esri31278> +proj=tmerc +lat_0=0 +lon_0=21 +k=0.999900 +x_0=7500000 +y_0=0 +ellps=bessel +units=m +no_defs  no_defs <>
-# MGI / Balkans zone 8
-<esri31279> +proj=tmerc +lat_0=0 +lon_0=24 +k=0.999900 +x_0=8500000 +y_0=0 +ellps=bessel +units=m +no_defs  no_defs <>
-# MGI (Ferro) / Austria West Zone
-<esri31281> +proj=tmerc +lat_0=0 +lon_0=10.33333333333333 +k=1.000000 +x_0=0 +y_0=0 +ellps=bessel +pm=ferro +units=m +no_defs  no_defs <>
-# MGI (Ferro) / Austria Central Zone
-<esri31282> +proj=tmerc +lat_0=0 +lon_0=13.33333333333333 +k=1.000000 +x_0=0 +y_0=0 +ellps=bessel +pm=ferro +units=m +no_defs  no_defs <>
-# MGI (Ferro) / Austria East Zone
-<esri31283> +proj=tmerc +lat_0=0 +lon_0=16.33333333333333 +k=1.000000 +x_0=0 +y_0=0 +ellps=bessel +pm=ferro +units=m +no_defs  no_defs <>
-# MGI / M28
-<esri31284> +proj=tmerc +lat_0=0 +lon_0=10.33333333333333 +k=1.000000 +x_0=150000 +y_0=0 +ellps=bessel +units=m +no_defs  no_defs <>
-# MGI / M31
-<esri31285> +proj=tmerc +lat_0=0 +lon_0=13.33333333333333 +k=1.000000 +x_0=450000 +y_0=0 +ellps=bessel +units=m +no_defs  no_defs <>
-# MGI / M34
-<esri31286> +proj=tmerc +lat_0=0 +lon_0=16.33333333333333 +k=1.000000 +x_0=750000 +y_0=0 +ellps=bessel +units=m +no_defs  no_defs <>
-# MGI / Austria Lambert
-<esri31287> +proj=lcc +lat_1=49 +lat_2=46 +lat_0=47.5 +lon_0=13.33333333333333 +x_0=400000 +y_0=400000 +ellps=bessel +units=m +no_defs  no_defs <>
-# MGI (Ferro) / Austria West Zone
-<esri31291> +proj=tmerc +lat_0=0 +lon_0=10.33333333333333 +k=1.000000 +x_0=0 +y_0=0 +ellps=bessel +pm=ferro +units=m +no_defs  no_defs <>
-# MGI (Ferro) / Austria Central Zone
-<esri31292> +proj=tmerc +lat_0=0 +lon_0=13.33333333333333 +k=1.000000 +x_0=0 +y_0=0 +ellps=bessel +pm=ferro +units=m +no_defs  no_defs <>
-# MGI (Ferro) / Austria East Zone
-<esri31293> +proj=tmerc +lat_0=0 +lon_0=16.33333333333333 +k=1.000000 +x_0=0 +y_0=0 +ellps=bessel +pm=ferro +units=m +no_defs  no_defs <>
-# MGI / M28
-<esri31294> +proj=tmerc +lat_0=0 +lon_0=10.33333333333333 +k=1.000000 +x_0=150000 +y_0=0 +ellps=bessel +units=m +no_defs  no_defs <>
-# MGI / M31
-<esri31295> +proj=tmerc +lat_0=0 +lon_0=13.33333333333333 +k=1.000000 +x_0=450000 +y_0=0 +ellps=bessel +units=m +no_defs  no_defs <>
-# MGI / M34
-<esri31296> +proj=tmerc +lat_0=0 +lon_0=16.33333333333333 +k=1.000000 +x_0=750000 +y_0=0 +ellps=bessel +units=m +no_defs  no_defs <>
-# MGI / Austria Lambert
-<esri31297> +proj=lcc +lat_1=49 +lat_2=46 +lat_0=47.5 +lon_0=13.33333333333333 +x_0=400000 +y_0=400000 +ellps=bessel +units=m +no_defs  no_defs <>
-# Belge 1972 / Belge Lambert 72
-<esri31300> +proj=lcc +lat_1=49.83333333333334 +lat_2=51.16666666666666 +lat_0=90 +lon_0=4.356939722222222 +x_0=150000.01256 +y_0=5400088.4378 +ellps=intl +units=m +no_defs  no_defs <>
-# Belge 1972 / Belgian Lambert 72
-<esri31370> +proj=lcc +lat_1=51.16666723333333 +lat_2=49.8333339 +lat_0=90 +lon_0=4.367486666666666 +x_0=150000.013 +y_0=5400088.438 +ellps=intl +units=m +no_defs  no_defs <>
-# DHDN / 3-degree Gauss zone 1
-<esri31461> +proj=tmerc +lat_0=0 +lon_0=3 +k=1.000000 +x_0=1500000 +y_0=0 +ellps=bessel +units=m +no_defs  no_defs <>
-# DHDN / 3-degree Gauss zone 2
-<esri31462> +proj=tmerc +lat_0=0 +lon_0=6 +k=1.000000 +x_0=2500000 +y_0=0 +ellps=bessel +units=m +no_defs  no_defs <>
-# DHDN / 3-degree Gauss zone 3
-<esri31463> +proj=tmerc +lat_0=0 +lon_0=9 +k=1.000000 +x_0=3500000 +y_0=0 +ellps=bessel +units=m +no_defs  no_defs <>
-# DHDN / 3-degree Gauss zone 4
-<esri31464> +proj=tmerc +lat_0=0 +lon_0=12 +k=1.000000 +x_0=4500000 +y_0=0 +ellps=bessel +units=m +no_defs  no_defs <>
-# DHDN / 3-degree Gauss zone 5
-<esri31465> +proj=tmerc +lat_0=0 +lon_0=15 +k=1.000000 +x_0=5500000 +y_0=0 +ellps=bessel +units=m +no_defs  no_defs <>
-# DHDN / Gauss-Kruger zone 2
-<esri31466> +proj=tmerc +lat_0=0 +lon_0=6 +k=1.000000 +x_0=2500000 +y_0=0 +ellps=bessel +units=m +no_defs  no_defs <>
-# DHDN / Gauss-Kruger zone 3
-<esri31467> +proj=tmerc +lat_0=0 +lon_0=9 +k=1.000000 +x_0=3500000 +y_0=0 +ellps=bessel +units=m +no_defs  no_defs <>
-# DHDN / Gauss-Kruger zone 4
-<esri31468> +proj=tmerc +lat_0=0 +lon_0=12 +k=1.000000 +x_0=4500000 +y_0=0 +ellps=bessel +units=m +no_defs  no_defs <>
-# DHDN / Gauss-Kruger zone 5
-<esri31469> +proj=tmerc +lat_0=0 +lon_0=15 +k=1.000000 +x_0=5500000 +y_0=0 +ellps=bessel +units=m +no_defs  no_defs <>
-# Conakry 1905 / UTM zone 28N
-<esri31528> +proj=utm +zone=28 +a=6378249.2 +b=6356515 +towgs84=-23,259,-9,0,0,0,0 +units=m +no_defs  no_defs <>
-# Conakry 1905 / UTM zone 29N
-<esri31529> +proj=utm +zone=29 +a=6378249.2 +b=6356515 +towgs84=-23,259,-9,0,0,0,0 +units=m +no_defs  no_defs <>
-# Dealul Piscului 1933/ Stereo 33
-<esri31600> +proj=stere +lat_0=45.9 +lon_0=25.39246588888889 +k=0.999667 +x_0=500000 +y_0=500000 +ellps=intl +towgs84=103.25,-100.4,-307.19,0,0,0,0 +units=m +no_defs  no_defs <>
-# Dealul Piscului 1970/ Stereo 70
-<esri31700> +proj=stere +lat_0=46 +lon_0=25 +k=0.999750 +x_0=500000 +y_0=500000 +ellps=krass +units=m +no_defs  no_defs <>
-# NGN / UTM zone 38N
-<esri31838> +proj=utm +zone=38 +ellps=WGS84 +units=m +no_defs  no_defs <>
-# NGN / UTM zone 39N
-<esri31839> +proj=utm +zone=39 +ellps=WGS84 +units=m +no_defs  no_defs <>
-# KUDAMS / KTM
-<esri31900> +proj=tmerc +lat_0=0 +lon_0=48 +k=0.999600 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs  no_defs <>
-# SIRGAS / UTM zone 17N
-<esri31986> +proj=utm +zone=17 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# SIRGAS / UTM zone 18N
-<esri31987> +proj=utm +zone=18 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# SIRGAS / UTM zone 19N
-<esri31988> +proj=utm +zone=19 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# SIRGAS / UTM zone 20N
-<esri31989> +proj=utm +zone=20 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# SIRGAS / UTM zone 21N
-<esri31990> +proj=utm +zone=21 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# SIRGAS / UTM zone 22N
-<esri31991> +proj=utm +zone=22 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# SIRGAS / UTM zone 17S
-<esri31992> +proj=utm +zone=17 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# SIRGAS / UTM zone 18S
-<esri31993> +proj=utm +zone=18 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# SIRGAS / UTM zone 19S
-<esri31994> +proj=utm +zone=19 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# SIRGAS / UTM zone 20S
-<esri31995> +proj=utm +zone=20 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# SIRGAS / UTM zone 21S
-<esri31996> +proj=utm +zone=21 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# SIRGAS / UTM zone 22S
-<esri31997> +proj=utm +zone=22 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# SIRGAS / UTM zone 23S
-<esri31998> +proj=utm +zone=23 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# SIRGAS / UTM zone 24S
-<esri31999> +proj=utm +zone=24 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# SIRGAS / UTM zone 25S
-<esri32000> +proj=utm +zone=25 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  no_defs <>
-# NAD27 / Montana North
-<esri32001> +proj=lcc +lat_1=48.71666666666667 +lat_2=47.85 +lat_0=47 +lon_0=-109.5 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / Montana Central
-<esri32002> +proj=lcc +lat_1=47.88333333333333 +lat_2=46.45 +lat_0=45.83333333333334 +lon_0=-109.5 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / Montana South
-<esri32003> +proj=lcc +lat_1=46.4 +lat_2=44.86666666666667 +lat_0=44 +lon_0=-109.5 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / Nebraska North
-<esri32005> +proj=lcc +lat_1=41.85 +lat_2=42.81666666666667 +lat_0=41.33333333333334 +lon_0=-100 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / Nebraska South
-<esri32006> +proj=lcc +lat_1=40.28333333333333 +lat_2=41.71666666666667 +lat_0=39.66666666666666 +lon_0=-99.5 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / Nevada East
-<esri32007> +proj=tmerc +lat_0=34.75 +lon_0=-115.5833333333333 +k=0.999900 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / Nevada Central
-<esri32008> +proj=tmerc +lat_0=34.75 +lon_0=-116.6666666666667 +k=0.999900 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / Nevada West
-<esri32009> +proj=tmerc +lat_0=34.75 +lon_0=-118.5833333333333 +k=0.999900 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / New Hampshire
-<esri32010> +proj=tmerc +lat_0=42.5 +lon_0=-71.66666666666667 +k=0.999967 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / New Jersey
-<esri32011> +proj=tmerc +lat_0=38.83333333333334 +lon_0=-74.66666666666667 +k=0.999975 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / New Mexico East
-<esri32012> +proj=tmerc +lat_0=31 +lon_0=-104.3333333333333 +k=0.999909 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / New Mexico Central
-<esri32013> +proj=tmerc +lat_0=31 +lon_0=-106.25 +k=0.999900 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / New Mexico West
-<esri32014> +proj=tmerc +lat_0=31 +lon_0=-107.8333333333333 +k=0.999917 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / New York East
-<esri32015> +proj=tmerc +lat_0=40 +lon_0=-74.33333333333333 +k=0.999967 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / New York Central
-<esri32016> +proj=tmerc +lat_0=40 +lon_0=-76.58333333333333 +k=0.999938 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / New York West
-<esri32017> +proj=tmerc +lat_0=40 +lon_0=-78.58333333333333 +k=0.999938 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / New York Long Island
-<esri32018> +proj=lcc +lat_1=41.03333333333333 +lat_2=40.66666666666666 +lat_0=40.5 +lon_0=-74 +x_0=304800.6096012192 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / North Carolina
-<esri32019> +proj=lcc +lat_1=34.33333333333334 +lat_2=36.16666666666666 +lat_0=33.75 +lon_0=-79 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / North Dakota North
-<esri32020> +proj=lcc +lat_1=47.43333333333333 +lat_2=48.73333333333333 +lat_0=47 +lon_0=-100.5 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / North Dakota South
-<esri32021> +proj=lcc +lat_1=46.18333333333333 +lat_2=47.48333333333333 +lat_0=45.66666666666666 +lon_0=-100.5 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / Ohio North
-<esri32022> +proj=lcc +lat_1=40.43333333333333 +lat_2=41.7 +lat_0=39.66666666666666 +lon_0=-82.5 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / Ohio South
-<esri32023> +proj=lcc +lat_1=38.73333333333333 +lat_2=40.03333333333333 +lat_0=38 +lon_0=-82.5 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / Oklahoma North
-<esri32024> +proj=lcc +lat_1=35.56666666666667 +lat_2=36.76666666666667 +lat_0=35 +lon_0=-98 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / Oklahoma South
-<esri32025> +proj=lcc +lat_1=33.93333333333333 +lat_2=35.23333333333333 +lat_0=33.33333333333334 +lon_0=-98 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / Oregon North
-<esri32026> +proj=lcc +lat_1=44.33333333333334 +lat_2=46 +lat_0=43.66666666666666 +lon_0=-120.5 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / Oregon South
-<esri32027> +proj=lcc +lat_1=42.33333333333334 +lat_2=44 +lat_0=41.66666666666666 +lon_0=-120.5 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / Pennsylvania North
-<esri32028> +proj=lcc +lat_1=40.88333333333333 +lat_2=41.95 +lat_0=40.16666666666666 +lon_0=-77.75 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / Pennsylvania South
-<esri32029> +proj=lcc +lat_1=39.93333333333333 +lat_2=40.8 +lat_0=39.33333333333334 +lon_0=-77.75 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / Rhode Island
-<esri32030> +proj=tmerc +lat_0=41.08333333333334 +lon_0=-71.5 +k=0.999994 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / South Carolina North
-<esri32031> +proj=lcc +lat_1=33.76666666666667 +lat_2=34.96666666666667 +lat_0=33 +lon_0=-81 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / South Carolina South
-<esri32033> +proj=lcc +lat_1=32.33333333333334 +lat_2=33.66666666666666 +lat_0=31.83333333333333 +lon_0=-81 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / South Dakota North
-<esri32034> +proj=lcc +lat_1=44.41666666666666 +lat_2=45.68333333333333 +lat_0=43.83333333333334 +lon_0=-100 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / South Dakota South
-<esri32035> +proj=lcc +lat_1=42.83333333333334 +lat_2=44.4 +lat_0=42.33333333333334 +lon_0=-100.3333333333333 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / Tennessee
-<esri32036> +proj=lcc +lat_1=35.25 +lat_2=36.41666666666666 +lat_0=34.66666666666666 +lon_0=-86 +x_0=30480.06096012192 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / Texas North
-<esri32037> +proj=lcc +lat_1=34.65 +lat_2=36.18333333333333 +lat_0=34 +lon_0=-101.5 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / Texas North Central
-<esri32038> +proj=lcc +lat_1=32.13333333333333 +lat_2=33.96666666666667 +lat_0=31.66666666666667 +lon_0=-97.5 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / Texas Central
-<esri32039> +proj=lcc +lat_1=30.11666666666667 +lat_2=31.88333333333333 +lat_0=29.66666666666667 +lon_0=-100.3333333333333 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / Texas South Central
-<esri32040> +proj=lcc +lat_1=28.38333333333333 +lat_2=30.28333333333333 +lat_0=27.83333333333333 +lon_0=-99 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / Texas South
-<esri32041> +proj=lcc +lat_1=26.16666666666667 +lat_2=27.83333333333333 +lat_0=25.66666666666667 +lon_0=-98.5 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / Utah North
-<esri32042> +proj=lcc +lat_1=40.71666666666667 +lat_2=41.78333333333333 +lat_0=40.33333333333334 +lon_0=-111.5 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / Utah Central
-<esri32043> +proj=lcc +lat_1=39.01666666666667 +lat_2=40.65 +lat_0=38.33333333333334 +lon_0=-111.5 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / Utah South
-<esri32044> +proj=lcc +lat_1=37.21666666666667 +lat_2=38.35 +lat_0=36.66666666666666 +lon_0=-111.5 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / Vermont
-<esri32045> +proj=tmerc +lat_0=42.5 +lon_0=-72.5 +k=0.999964 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / Virginia North
-<esri32046> +proj=lcc +lat_1=38.03333333333333 +lat_2=39.2 +lat_0=37.66666666666666 +lon_0=-78.5 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / Virginia South
-<esri32047> +proj=lcc +lat_1=36.76666666666667 +lat_2=37.96666666666667 +lat_0=36.33333333333334 +lon_0=-78.5 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / Washington North
-<esri32048> +proj=lcc +lat_1=47.5 +lat_2=48.73333333333333 +lat_0=47 +lon_0=-120.8333333333333 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / Washington South
-<esri32049> +proj=lcc +lat_1=45.83333333333334 +lat_2=47.33333333333334 +lat_0=45.33333333333334 +lon_0=-120.5 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / West Virginia North
-<esri32050> +proj=lcc +lat_1=39 +lat_2=40.25 +lat_0=38.5 +lon_0=-79.5 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / West Virginia South
-<esri32051> +proj=lcc +lat_1=37.48333333333333 +lat_2=38.88333333333333 +lat_0=37 +lon_0=-81 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / Wisconsin North
-<esri32052> +proj=lcc +lat_1=45.56666666666667 +lat_2=46.76666666666667 +lat_0=45.16666666666666 +lon_0=-90 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / Wisconsin Central
-<esri32053> +proj=lcc +lat_1=44.25 +lat_2=45.5 +lat_0=43.83333333333334 +lon_0=-90 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / Wisconsin South
-<esri32054> +proj=lcc +lat_1=42.73333333333333 +lat_2=44.06666666666667 +lat_0=42 +lon_0=-90 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / Wyoming East
-<esri32055> +proj=tmerc +lat_0=40.66666666666666 +lon_0=-105.1666666666667 +k=0.999941 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / Wyoming East Central
-<esri32056> +proj=tmerc +lat_0=40.66666666666666 +lon_0=-107.3333333333333 +k=0.999941 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / Wyoming West Central
-<esri32057> +proj=tmerc +lat_0=40.66666666666666 +lon_0=-108.75 +k=0.999941 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / Wyoming West
-<esri32058> +proj=tmerc +lat_0=40.66666666666666 +lon_0=-110.0833333333333 +k=0.999941 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / Guatemala Norte
-<esri32061> +proj=lcc +lat_1=16.81666666666667 +lat_0=16.81666666666667 +lon_0=-90.33333333333333 +k_0=0.99992226 +x_0=500000 +y_0=292209.579 +ellps=clrk66 +datum=NAD27 +units=m +no_defs  no_defs <>
-# NAD27 / Guatemala Sur
-<esri32062> +proj=lcc +lat_1=14.9 +lat_0=14.9 +lon_0=-90.33333333333333 +k_0=0.99989906 +x_0=500000 +y_0=325992.681 +ellps=clrk66 +datum=NAD27 +units=m +no_defs  no_defs <>
-# NAD27 / BLM 14N (ftUS)
-<esri32064> +proj=tmerc +lat_0=0 +lon_0=-99 +k=0.999600 +x_0=500000.001016002 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / BLM 15N (ftUS)
-<esri32065> +proj=tmerc +lat_0=0 +lon_0=-93 +k=0.999600 +x_0=500000.001016002 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / BLM 16N (ftUS)
-<esri32066> +proj=tmerc +lat_0=0 +lon_0=-87 +k=0.999600 +x_0=500000.001016002 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / BLM 17N (ftUS)
-<esri32067> +proj=tmerc +lat_0=0 +lon_0=-81 +k=0.999600 +x_0=500000.001016002 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / BLM 14N (feet)
-<esri32074> +proj=tmerc +lat_0=0 +lon_0=-99 +k=0.999600 +x_0=500000.001016002 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / BLM 15N (feet)
-<esri32075> +proj=tmerc +lat_0=0 +lon_0=-93 +k=0.999600 +x_0=500000.001016002 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / BLM 16N (feet)
-<esri32076> +proj=tmerc +lat_0=0 +lon_0=-87 +k=0.999600 +x_0=500000.001016002 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / BLM 17N (feet)
-<esri32077> +proj=tmerc +lat_0=0 +lon_0=-81 +k=0.999600 +x_0=500000.001016002 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs  no_defs <>
-# NAD27 / MTM zone 1
-<esri32081> +proj=tmerc +lat_0=0 +lon_0=-53 +k=0.999900 +x_0=304800 +y_0=0 +ellps=clrk66 +datum=NAD27 +units=m +no_defs  no_defs <>
-# NAD27 / MTM zone 2
-<esri32082> +proj=tmerc +lat_0=0 +lon_0=-56 +k=0.999900 +x_0=304800 +y_0=0 +ellps=clrk66 +datum=NAD27 +units=m +no_defs  no_defs <>
-# NAD27 / MTM zone 3
-<esri32083> +proj=tmerc +lat_0=0 +lon_0=-58.5 +k=0.999900 +x_0=304800 +y_0=0 +ellps=clrk66 +datum=NAD27 +units=m +no_defs  no_defs <>
-# NAD27 / MTM zone 4
-<esri32084> +proj=tmerc +lat_0=0 +lon_0=-61.5 +k=0.999900 +x_0=304800 +y_0=0 +ellps=clrk66 +datum=NAD27 +units=m +no_defs  no_defs <>
-# NAD27 / MTM zone 5
-<esri32085> +proj=tmerc +lat_0=0 +lon_0=-64.5 +k=0.999900 +x_0=304800 +y_0=0 +ellps=clrk66 +datum=NAD27 +units=m +no_defs  no_defs <>
-# NAD27 / MTM zone 6
-<esri32086> +proj=tmerc +lat_0=0 +lon_0=-67.5 +k=0.999900 +x_0=304800 +y_0=0 +ellps=clrk66 +datum=NAD27 +units=m +no_defs  no_defs <>
-# NAD27 / Quebec Lambert
-<esri32098> +proj=lcc +lat_1=60 +lat_2=46 +lat_0=44 +lon_0=-68.5 +x_0=0 +y_0=0 +ellps=clrk66 +datum=NAD27 +units=m +no_defs  no_defs <>
-# NAD83 / Montana
-<esri32100> +proj=lcc +lat_1=49 +lat_2=45 +lat_0=44.25 +lon_0=-109.5 +x_0=600000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / Nebraska
-<esri32104> +proj=lcc +lat_1=43 +lat_2=40 +lat_0=39.83333333333334 +lon_0=-100 +x_0=500000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / Nevada East
-<esri32107> +proj=tmerc +lat_0=34.75 +lon_0=-115.5833333333333 +k=0.999900 +x_0=200000 +y_0=8000000 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / Nevada Central
-<esri32108> +proj=tmerc +lat_0=34.75 +lon_0=-116.6666666666667 +k=0.999900 +x_0=500000 +y_0=6000000 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / Nevada West
-<esri32109> +proj=tmerc +lat_0=34.75 +lon_0=-118.5833333333333 +k=0.999900 +x_0=800000 +y_0=4000000 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / New Hampshire
-<esri32110> +proj=tmerc +lat_0=42.5 +lon_0=-71.66666666666667 +k=0.999967 +x_0=300000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / New Jersey
-<esri32111> +proj=tmerc +lat_0=38.83333333333334 +lon_0=-74.5 +k=0.999900 +x_0=150000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / New Mexico East
-<esri32112> +proj=tmerc +lat_0=31 +lon_0=-104.3333333333333 +k=0.999909 +x_0=165000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / New Mexico Central
-<esri32113> +proj=tmerc +lat_0=31 +lon_0=-106.25 +k=0.999900 +x_0=500000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / New Mexico West
-<esri32114> +proj=tmerc +lat_0=31 +lon_0=-107.8333333333333 +k=0.999917 +x_0=830000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / New York East
-<esri32115> +proj=tmerc +lat_0=38.83333333333334 +lon_0=-74.5 +k=0.999900 +x_0=150000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / New York Central
-<esri32116> +proj=tmerc +lat_0=40 +lon_0=-76.58333333333333 +k=0.999938 +x_0=250000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / New York West
-<esri32117> +proj=tmerc +lat_0=40 +lon_0=-78.58333333333333 +k=0.999938 +x_0=350000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / New York Long Island
-<esri32118> +proj=lcc +lat_1=41.03333333333333 +lat_2=40.66666666666666 +lat_0=40.16666666666666 +lon_0=-74 +x_0=300000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / North Carolina
-<esri32119> +proj=lcc +lat_1=36.16666666666666 +lat_2=34.33333333333334 +lat_0=33.75 +lon_0=-79 +x_0=609601.22 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / North Dakota North
-<esri32120> +proj=lcc +lat_1=48.73333333333333 +lat_2=47.43333333333333 +lat_0=47 +lon_0=-100.5 +x_0=600000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / North Dakota South
-<esri32121> +proj=lcc +lat_1=47.48333333333333 +lat_2=46.18333333333333 +lat_0=45.66666666666666 +lon_0=-100.5 +x_0=600000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / Ohio North
-<esri32122> +proj=lcc +lat_1=41.7 +lat_2=40.43333333333333 +lat_0=39.66666666666666 +lon_0=-82.5 +x_0=600000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / Ohio South
-<esri32123> +proj=lcc +lat_1=40.03333333333333 +lat_2=38.73333333333333 +lat_0=38 +lon_0=-82.5 +x_0=600000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / Oklahoma North
-<esri32124> +proj=lcc +lat_1=36.76666666666667 +lat_2=35.56666666666667 +lat_0=35 +lon_0=-98 +x_0=600000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / Oklahoma South
-<esri32125> +proj=lcc +lat_1=35.23333333333333 +lat_2=33.93333333333333 +lat_0=33.33333333333334 +lon_0=-98 +x_0=600000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / Oregon North
-<esri32126> +proj=lcc +lat_1=46 +lat_2=44.33333333333334 +lat_0=43.66666666666666 +lon_0=-120.5 +x_0=2500000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / Oregon South
-<esri32127> +proj=lcc +lat_1=44 +lat_2=42.33333333333334 +lat_0=41.66666666666666 +lon_0=-120.5 +x_0=1500000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / Pennsylvania North
-<esri32128> +proj=lcc +lat_1=41.95 +lat_2=40.88333333333333 +lat_0=40.16666666666666 +lon_0=-77.75 +x_0=600000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / Pennsylvania South
-<esri32129> +proj=lcc +lat_1=40.96666666666667 +lat_2=39.93333333333333 +lat_0=39.33333333333334 +lon_0=-77.75 +x_0=600000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / Rhode Island
-<esri32130> +proj=tmerc +lat_0=41.08333333333334 +lon_0=-71.5 +k=0.999994 +x_0=100000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / South Carolina
-<esri32133> +proj=lcc +lat_1=34.83333333333334 +lat_2=32.5 +lat_0=31.83333333333333 +lon_0=-81 +x_0=609600 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / South Dakota North
-<esri32134> +proj=lcc +lat_1=45.68333333333333 +lat_2=44.41666666666666 +lat_0=43.83333333333334 +lon_0=-100 +x_0=600000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / South Dakota South
-<esri32135> +proj=lcc +lat_1=44.4 +lat_2=42.83333333333334 +lat_0=42.33333333333334 +lon_0=-100.3333333333333 +x_0=600000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / Tennessee
-<esri32136> +proj=lcc +lat_1=36.41666666666666 +lat_2=35.25 +lat_0=34.33333333333334 +lon_0=-86 +x_0=600000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / Texas North
-<esri32137> +proj=lcc +lat_1=36.18333333333333 +lat_2=34.65 +lat_0=34 +lon_0=-101.5 +x_0=200000 +y_0=1000000 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / Texas North Central
-<esri32138> +proj=lcc +lat_1=33.96666666666667 +lat_2=32.13333333333333 +lat_0=31.66666666666667 +lon_0=-98.5 +x_0=600000 +y_0=2000000 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / Texas Central
-<esri32139> +proj=lcc +lat_1=31.88333333333333 +lat_2=30.11666666666667 +lat_0=29.66666666666667 +lon_0=-100.3333333333333 +x_0=700000 +y_0=3000000 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / Texas South Central
-<esri32140> +proj=lcc +lat_1=30.28333333333333 +lat_2=28.38333333333333 +lat_0=27.83333333333333 +lon_0=-99 +x_0=600000 +y_0=4000000 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / Texas South
-<esri32141> +proj=lcc +lat_1=27.83333333333333 +lat_2=26.16666666666667 +lat_0=25.66666666666667 +lon_0=-98.5 +x_0=300000 +y_0=5000000 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / Utah North
-<esri32142> +proj=lcc +lat_1=41.78333333333333 +lat_2=40.71666666666667 +lat_0=40.33333333333334 +lon_0=-111.5 +x_0=500000 +y_0=1000000 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / Utah Central
-<esri32143> +proj=lcc +lat_1=40.65 +lat_2=39.01666666666667 +lat_0=38.33333333333334 +lon_0=-111.5 +x_0=500000 +y_0=2000000 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / Utah South
-<esri32144> +proj=lcc +lat_1=38.35 +lat_2=37.21666666666667 +lat_0=36.66666666666666 +lon_0=-111.5 +x_0=500000 +y_0=3000000 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / Vermont
-<esri32145> +proj=tmerc +lat_0=42.5 +lon_0=-72.5 +k=0.999964 +x_0=500000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / Virginia North
-<esri32146> +proj=lcc +lat_1=39.2 +lat_2=38.03333333333333 +lat_0=37.66666666666666 +lon_0=-78.5 +x_0=3500000 +y_0=2000000 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / Virginia South
-<esri32147> +proj=lcc +lat_1=37.96666666666667 +lat_2=36.76666666666667 +lat_0=36.33333333333334 +lon_0=-78.5 +x_0=3500000 +y_0=1000000 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / Washington North
-<esri32148> +proj=lcc +lat_1=48.73333333333333 +lat_2=47.5 +lat_0=47 +lon_0=-120.8333333333333 +x_0=500000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / Washington South
-<esri32149> +proj=lcc +lat_1=47.33333333333334 +lat_2=45.83333333333334 +lat_0=45.33333333333334 +lon_0=-120.5 +x_0=500000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / West Virginia North
-<esri32150> +proj=lcc +lat_1=40.25 +lat_2=39 +lat_0=38.5 +lon_0=-79.5 +x_0=600000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / West Virginia South
-<esri32151> +proj=lcc +lat_1=38.88333333333333 +lat_2=37.48333333333333 +lat_0=37 +lon_0=-81 +x_0=600000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / Wisconsin North
-<esri32152> +proj=lcc +lat_1=46.76666666666667 +lat_2=45.56666666666667 +lat_0=45.16666666666666 +lon_0=-90 +x_0=600000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / Wisconsin Central
-<esri32153> +proj=lcc +lat_1=45.5 +lat_2=44.25 +lat_0=43.83333333333334 +lon_0=-90 +x_0=600000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / Wisconsin South
-<esri32154> +proj=lcc +lat_1=44.06666666666667 +lat_2=42.73333333333333 +lat_0=42 +lon_0=-90 +x_0=600000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / Wyoming East
-<esri32155> +proj=tmerc +lat_0=40.5 +lon_0=-105.1666666666667 +k=0.999938 +x_0=200000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / Wyoming East Central
-<esri32156> +proj=tmerc +lat_0=40.5 +lon_0=-107.3333333333333 +k=0.999938 +x_0=400000 +y_0=100000 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / Wyoming West Central
-<esri32157> +proj=tmerc +lat_0=40.5 +lon_0=-108.75 +k=0.999938 +x_0=600000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / Wyoming West
-<esri32158> +proj=tmerc +lat_0=40.5 +lon_0=-110.0833333333333 +k=0.999938 +x_0=800000 +y_0=100000 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / Puerto Rico & Virgin Is.
-<esri32161> +proj=lcc +lat_1=18.43333333333333 +lat_2=18.03333333333333 +lat_0=17.83333333333333 +lon_0=-66.43333333333334 +x_0=200000 +y_0=200000 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / SCoPQ zone 2
-<esri32180> +proj=tmerc +lat_0=0 +lon_0=-55.5 +k=0.999900 +x_0=304800 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / MTM zone 1
-<esri32181> +proj=tmerc +lat_0=0 +lon_0=-53 +k=0.999900 +x_0=304800 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / MTM zone 2
-<esri32182> +proj=tmerc +lat_0=0 +lon_0=-56 +k=0.999900 +x_0=304800 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / MTM zone 3
-<esri32183> +proj=tmerc +lat_0=0 +lon_0=-58.5 +k=0.999900 +x_0=304800 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / MTM zone 4
-<esri32184> +proj=tmerc +lat_0=0 +lon_0=-61.5 +k=0.999900 +x_0=304800 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / MTM zone 5
-<esri32185> +proj=tmerc +lat_0=0 +lon_0=-64.5 +k=0.999900 +x_0=304800 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / MTM zone 6
-<esri32186> +proj=tmerc +lat_0=0 +lon_0=-67.5 +k=0.999900 +x_0=304800 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / MTM zone 7
-<esri32187> +proj=tmerc +lat_0=0 +lon_0=-70.5 +k=0.999900 +x_0=304800 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / MTM zone 8
-<esri32188> +proj=tmerc +lat_0=0 +lon_0=-73.5 +k=0.999900 +x_0=304800 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / MTM zone 9
-<esri32189> +proj=tmerc +lat_0=0 +lon_0=-76.5 +k=0.999900 +x_0=304800 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / MTM zone 10
-<esri32190> +proj=tmerc +lat_0=0 +lon_0=-79.5 +k=0.999900 +x_0=304800 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / MTM zone 11
-<esri32191> +proj=tmerc +lat_0=0 +lon_0=-82.5 +k=0.999900 +x_0=304800 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / MTM zone 12
-<esri32192> +proj=tmerc +lat_0=0 +lon_0=-81 +k=0.999900 +x_0=304800 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / MTM zone 13
-<esri32193> +proj=tmerc +lat_0=0 +lon_0=-84 +k=0.999900 +x_0=304800 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / MTM zone 14
-<esri32194> +proj=tmerc +lat_0=0 +lon_0=-87 +k=0.999900 +x_0=304800 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / MTM zone 15
-<esri32195> +proj=tmerc +lat_0=0 +lon_0=-90 +k=0.999900 +x_0=304800 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / MTM zone 16
-<esri32196> +proj=tmerc +lat_0=0 +lon_0=-93 +k=0.999900 +x_0=304800 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / MTM zone 17
-<esri32197> +proj=tmerc +lat_0=0 +lon_0=-96 +k=0.999900 +x_0=304800 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# NAD83 / Quebec Lambert
-<esri32198> +proj=lcc +lat_1=60 +lat_2=46 +lat_0=44 +lon_0=-68.5 +x_0=0 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs  no_defs <>
-# WGS 72 / UTM zone 1N
-<esri32201> +proj=utm +zone=1 +ellps=WGS72 +units=m +no_defs  no_defs <>
-# WGS 72 / UTM zone 2N
-<esri32202> +proj=utm +zone=2 +ellps=WGS72 +units=m +no_defs  no_defs <>
-# WGS 72 / UTM zone 3N
-<esri32203> +proj=utm +zone=3 +ellps=WGS72 +units=m +no_defs  no_defs <>
-# WGS 72 / UTM zone 4N
-<esri32204> +proj=utm +zone=4 +ellps=WGS72 +units=m +no_defs  no_defs <>
-# WGS 72 / UTM zone 5N
-<esri32205> +proj=utm +zone=5 +ellps=WGS72 +units=m +no_defs  no_defs <>
-# WGS 72 / UTM zone 6N
-<esri32206> +proj=utm +zone=6 +ellps=WGS72 +units=m +no_defs  no_defs <>
-# WGS 72 / UTM zone 7N
-<esri32207> +proj=utm +zone=7 +ellps=WGS72 +units=m +no_defs  no_defs <>
-# WGS 72 / UTM zone 8N
-<esri32208> +proj=utm +zone=8 +ellps=WGS72 +units=m +no_defs  no_defs <>
-# WGS 72 / UTM zone 9N
-<esri32209> +proj=utm +zone=9 +ellps=WGS72 +units=m +no_defs  no_defs <>
-# WGS 72 / UTM zone 10N
-<esri32210> +proj=utm +zone=10 +ellps=WGS72 +units=m +no_defs  no_defs <>
-# WGS 72 / UTM zone 11N
-<esri32211> +proj=utm +zone=11 +ellps=WGS72 +units=m +no_defs  no_defs <>
-# WGS 72 / UTM zone 12N
-<esri32212> +proj=utm +zone=12 +ellps=WGS72 +units=m +no_defs  no_defs <>
-# WGS 72 / UTM zone 13N
-<esri32213> +proj=utm +zone=13 +ellps=WGS72 +units=m +no_defs  no_defs <>
-# WGS 72 / UTM zone 14N
-<esri32214> +proj=utm +zone=14 +ellps=WGS72 +units=m +no_defs  no_defs <>
-# WGS 72 / UTM zone 15N
-<esri32215> +proj=utm +zone=15 +ellps=WGS72 +units=m +no_defs  no_defs <>
-# WGS 72 / UTM zone 16N
-<esri32216> +proj=utm +zone=16 +ellps=WGS72 +units=m +no_defs  no_defs <>
-# WGS 72 / UTM zone 17N
-<esri32217> +proj=utm +zone=17 +ellps=WGS72 +units=m +no_defs  no_defs <>
-# WGS 72 / UTM zone 18N
-<esri32218> +proj=utm +zone=18 +ellps=WGS72 +units=m +no_defs  no_defs <>
-# WGS 72 / UTM zone 19N
-<esri32219> +proj=utm +zone=19 +ellps=WGS72 +units=m +no_defs  no_defs <>
-# WGS 72 / UTM zone 20N
-<esri32220> +proj=utm +zone=20 +ellps=WGS72 +units=m +no_defs  no_defs <>
-# WGS 72 / UTM zone 21N
-<esri32221> +proj=utm +zone=21 +ellps=WGS72 +units=m +no_defs  no_defs <>
-# WGS 72 / UTM zone 22N
-<esri32222> +proj=utm +zone=22 +ellps=WGS72 +units=m +no_defs  no_defs <>
-# WGS 72 / UTM zone 23N
-<esri32223> +proj=utm +zone=23 +ellps=WGS72 +units=m +no_defs  no_defs <>
-# WGS 72 / UTM zone 24N
-<esri32224> +proj=utm +zone=24 +ellps=WGS72 +units=m +no_defs  no_defs <>
-# WGS 72 / UTM zone 25N
-<esri32225> +proj=utm +zone=25 +ellps=WGS72 +units=m +no_defs  no_defs <>
-# WGS 72 / UTM zone 26N
-<esri32226> +proj=utm +zone=26 +ellps=WGS72 +units=m +no_defs  no_defs <>
-# WGS 72 / UTM zone 27N
-<esri32227> +proj=utm +zone=27 +ellps=WGS72 +units=m +no_defs  no_defs <>
-# WGS 72 / UTM zone 28N
-<esri32228> +proj=utm +zone=28 +ellps=WGS72 +units=m +no_defs  no_defs <>
-# WGS 72 / UTM zone 29N
-<esri32229> +proj=utm +zone=29 +ellps=WGS72 +units=m +no_defs  no_defs <>
-# WGS 72 / UTM zone 30N
-<esri32230> +proj=utm +zone=30 +ellps=WGS72 +units=m +no_defs  no_defs <>
-# WGS 72 / UTM zone 31N
-<esri32231> +proj=utm +zone=31 +ellps=WGS72 +units=m +no_defs  no_defs <>
-# WGS 72 / UTM zone 32N
-<esri32232> +proj=utm +zone=32 +ellps=WGS72 +units=m +no_defs  no_defs <>
-# WGS 72 / UTM zone 33N
-<esri32233> +proj=utm +zone=33 +ellps=WGS72 +units=m +no_defs  no_defs <>
-# WGS 72 / UTM zone 34N
-<esri32234> +proj=utm +zone=34 +ellps=WGS72 +units=m +no_defs  no_defs <>
-# WGS 72 / UTM zone 35N
-<esri32235> +proj=utm +zone=35 +ellps=WGS72 +units=m +no_defs  no_defs <>
-# WGS 72 / UTM zone 36N
-<esri32236> +proj=utm +zone=36 +ellps=WGS72 +units=m +no_defs  no_defs <>
-# WGS 72 / UTM zone 37N
-<esri32237> +proj=utm +zone=37 +ellps=WGS72 +units=m +no_defs  no_defs <>
-# WGS 72 / UTM zone 38N
-<esri32238> +proj=utm +zone=38 +ellps=WGS72 +units=m +no_defs  no_defs <>
-# WGS 72 / UTM zone 39N
-<esri32239> +proj=utm +zone=39 +ellps=WGS72 +units=m +no_defs  no_defs <>
-# WGS 72 / UTM zone 40N
-<esri32240> +proj=utm +zone=40 +ellps=WGS72 +units=m +no_defs  no_defs <>
-# WGS 72 / UTM zone 41N
-<esri32241> +proj=utm +zone=41 +ellps=WGS72 +units=m +no_defs  no_defs <>
-# WGS 72 / UTM zone 42N
-<esri32242> +proj=utm +zone=42 +ellps=WGS72 +units=m +no_defs  no_defs <>
-# WGS 72 / UTM zone 43N
-<esri32243> +proj=utm +zone=43 +ellps=WGS72 +units=m +no_defs  no_defs <>
-# WGS 72 / UTM zone 44N
-<esri32244> +proj=utm +zone=44 +ellps=WGS72 +units=m +no_defs  no_defs <>
-# WGS 72 / UTM zone 45N
-<esri32245> +proj=utm +zone=45 +ellps=WGS72 +units=m +no_defs  no_defs <>
-# WGS 72 / UTM zone 46N
-<esri32246> +proj=utm +zone=46 +ellps=WGS72 +units=m +no_defs  no_defs <>
-# WGS 72 / UTM zone 47N
-<esri32247> +proj=utm +zone=47 +ellps=WGS72 +units=m +no_defs  no_defs <>
-# WGS 72 / UTM zone 48N
-<esri32248> +proj=utm +zone=48 +ellps=WGS72 +units=m +no_defs  no_defs <>
-# WGS 72 / UTM zone 49N
-<esri32249> +proj=utm +zone=49 +ellps=WGS72 +units=m +no_defs  no_defs <>
-# WGS 72 / UTM zone 50N
-<esri32250> +proj=utm +zone=50 +ellps=WGS72 +units=m +no_defs  no_defs <>
-# WGS 72 / UTM zone 51N
-<esri32251> +proj=utm +zone=51 +ellps=WGS72 +units=m +no_defs  no_defs <>
-# WGS 72 / UTM zone 52N
-<esri32252> +proj=utm +zone=52 +ellps=WGS72 +units=m +no_defs  no_defs <>
-# WGS 72 / UTM zone 53N
-<esri32253> +proj=utm +zone=53 +ellps=WGS72 +units=m +no_defs  no_defs <>
-# WGS 72 / UTM zone 54N
-<esri32254> +proj=utm +zone=54 +ellps=WGS72 +units=m +no_defs  no_defs <>
-# WGS 72 / UTM zone 55N
-<esri32255> +proj=utm +zone=55 +ellps=WGS72 +units=m +no_defs  no_defs <>
-# WGS 72 / UTM zone 56N
-<esri32256> +proj=utm +zone=56 +ellps=WGS72 +units=m +no_defs  no_defs <>
-# WGS 72 / UTM zone 57N
-<esri32257> +proj=utm +zone=57 +ellps=WGS72 +units=m +no_defs  no_defs <>
-# WGS 72 / UTM zone 58N
-<esri32258> +proj=utm +zone=58 +ellps=WGS72 +units=m +no_defs  no_defs <>
-# WGS 72 / UTM zone 59N
-<esri32259> +proj=utm +zone=59 +ellps=WGS72 +units=m +no_defs  no_defs <>
-# WGS 72 / UTM zone 60N
-<esri32260> +proj=utm +zone=60 +ellps=WGS72 +units=m +no_defs  no_defs <>
-# WGS 72 / UTM zone 1S
-<esri32301> +proj=utm +zone=1 +south +ellps=WGS72 +units=m +no_defs  no_defs <>
-# WGS 72 / UTM zone 2S
-<esri32302> +proj=utm +zone=2 +south +ellps=WGS72 +units=m +no_defs  no_defs <>
-# WGS 72 / UTM zone 3S
-<esri32303> +proj=utm +zone=3 +south +ellps=WGS72 +units=m +no_defs  no_defs <>
-# WGS 72 / UTM zone 4S
-<esri32304> +proj=utm +zone=4 +south +ellps=WGS72 +units=m +no_defs  no_defs <>
-# WGS 72 / UTM zone 5S
-<esri32305> +proj=utm +zone=5 +south +ellps=WGS72 +units=m +no_defs  no_defs <>
-# WGS 72 / UTM zone 6S
-<esri32306> +proj=utm +zone=6 +south +ellps=WGS72 +units=m +no_defs  no_defs <>
-# WGS 72 / UTM zone 7S
-<esri32307> +proj=utm +zone=7 +south +ellps=WGS72 +units=m +no_defs  no_defs <>
-# WGS 72 / UTM zone 8S
-<esri32308> +proj=utm +zone=8 +south +ellps=WGS72 +units=m +no_defs  no_defs <>
-# WGS 72 / UTM zone 9S
-<esri32309> +proj=utm +zone=9 +south +ellps=WGS72 +units=m +no_defs  no_defs <>
-# WGS 72 / UTM zone 10S
-<esri32310> +proj=utm +zone=10 +south +ellps=WGS72 +units=m +no_defs  no_defs <>
-# WGS 72 / UTM zone 11S
-<esri32311> +proj=utm +zone=11 +south +ellps=WGS72 +units=m +no_defs  no_defs <>
-# WGS 72 / UTM zone 12S
-<esri32312> +proj=utm +zone=12 +south +ellps=WGS72 +units=m +no_defs  no_defs <>
-# WGS 72 / UTM zone 13S
-<esri32313> +proj=utm +zone=13 +south +ellps=WGS72 +units=m +no_defs  no_defs <>
-# WGS 72 / UTM zone 14S
-<esri32314> +proj=utm +zone=14 +south +ellps=WGS72 +units=m +no_defs  no_defs <>
-# WGS 72 / UTM zone 15S
-<esri32315> +proj=utm +zone=15 +south +ellps=WGS72 +units=m +no_defs  no_defs <>
-# WGS 72 / UTM zone 16S
-<esri32316> +proj=utm +zone=16 +south +ellps=WGS72 +units=m +no_defs  no_defs <>
-# WGS 72 / UTM zone 17S
-<esri32317> +proj=utm +zone=17 +south +ellps=WGS72 +units=m +no_defs  no_defs <>
-# WGS 72 / UTM zone 18S
-<esri32318> +proj=utm +zone=18 +south +ellps=WGS72 +units=m +no_defs  no_defs <>
-# WGS 72 / UTM zone 19S
-<esri32319> +proj=utm +zone=19 +south +ellps=WGS72 +units=m +no_defs  no_defs <>
-# WGS 72 / UTM zone 20S
-<esri32320> +proj=utm +zone=20 +south +ellps=WGS72 +units=m +no_defs  no_defs <>
-# WGS 72 / UTM zone 21S
-<esri32321> +proj=utm +zone=21 +south +ellps=WGS72 +units=m +no_defs  no_defs <>
-# WGS 72 / UTM zone 22S
-<esri32322> +proj=utm +zone=22 +south +ellps=WGS72 +units=m +no_defs  no_defs <>
-# WGS 72 / UTM zone 23S
-<esri32323> +proj=utm +zone=23 +south +ellps=WGS72 +units=m +no_defs  no_defs <>
-# WGS 72 / UTM zone 24S
-<esri32324> +proj=utm +zone=24 +south +ellps=WGS72 +units=m +no_defs  no_defs <>
-# WGS 72 / UTM zone 25S
-<esri32325> +proj=utm +zone=25 +south +ellps=WGS72 +units=m +no_defs  no_defs <>
-# WGS 72 / UTM zone 26S
-<esri32326> +proj=utm +zone=26 +south +ellps=WGS72 +units=m +no_defs  no_defs <>
-# WGS 72 / UTM zone 27S
-<esri32327> +proj=utm +zone=27 +south +ellps=WGS72 +units=m +no_defs  no_defs <>
-# WGS 72 / UTM zone 28S
-<esri32328> +proj=utm +zone=28 +south +ellps=WGS72 +units=m +no_defs  no_defs <>
-# WGS 72 / UTM zone 29S
-<esri32329> +proj=utm +zone=29 +south +ellps=WGS72 +units=m +no_defs  no_defs <>
-# WGS 72 / UTM zone 30S
-<esri32330> +proj=utm +zone=30 +south +ellps=WGS72 +units=m +no_defs  no_defs <>
-# WGS 72 / UTM zone 31S
-<esri32331> +proj=utm +zone=31 +south +ellps=WGS72 +units=m +no_defs  no_defs <>
-# WGS 72 / UTM zone 32S
-<esri32332> +proj=utm +zone=32 +south +ellps=WGS72 +units=m +no_defs  no_defs <>
-# WGS 72 / UTM zone 33S
-<esri32333> +proj=utm +zone=33 +south +ellps=WGS72 +units=m +no_defs  no_defs <>
-# WGS 72 / UTM zone 34S
-<esri32334> +proj=utm +zone=34 +south +ellps=WGS72 +units=m +no_defs  no_defs <>
-# WGS 72 / UTM zone 35S
-<esri32335> +proj=utm +zone=35 +south +ellps=WGS72 +units=m +no_defs  no_defs <>
-# WGS 72 / UTM zone 36S
-<esri32336> +proj=utm +zone=36 +south +ellps=WGS72 +units=m +no_defs  no_defs <>
-# WGS 72 / UTM zone 37S
-<esri32337> +proj=utm +zone=37 +south +ellps=WGS72 +units=m +no_defs  no_defs <>
-# WGS 72 / UTM zone 38S
-<esri32338> +proj=utm +zone=38 +south +ellps=WGS72 +units=m +no_defs  no_defs <>
-# WGS 72 / UTM zone 39S
-<esri32339> +proj=utm +zone=39 +south +ellps=WGS72 +units=m +no_defs  no_defs <>
-# WGS 72 / UTM zone 40S
-<esri32340> +proj=utm +zone=40 +south +ellps=WGS72 +units=m +no_defs  no_defs <>
-# WGS 72 / UTM zone 41S
-<esri32341> +proj=utm +zone=41 +south +ellps=WGS72 +units=m +no_defs  no_defs <>
-# WGS 72 / UTM zone 42S
-<esri32342> +proj=utm +zone=42 +south +ellps=WGS72 +units=m +no_defs  no_defs <>
-# WGS 72 / UTM zone 43S
-<esri32343> +proj=utm +zone=43 +south +ellps=WGS72 +units=m +no_defs  no_defs <>
-# WGS 72 / UTM zone 44S
-<esri32344> +proj=utm +zone=44 +south +ellps=WGS72 +units=m +no_defs  no_defs <>
-# WGS 72 / UTM zone 45S
-<esri32345> +proj=utm +zone=45 +south +ellps=WGS72 +units=m +no_defs  no_defs <>
-# WGS 72 / UTM zone 46S
-<esri32346> +proj=utm +zone=46 +south +ellps=WGS72 +units=m +no_defs  no_defs <>
-# WGS 72 / UTM zone 47S
-<esri32347> +proj=utm +zone=47 +south +ellps=WGS72 +units=m +no_defs  no_defs <>
-# WGS 72 / UTM zone 48S
-<esri32348> +proj=utm +zone=48 +south +ellps=WGS72 +units=m +no_defs  no_defs <>
-# WGS 72 / UTM zone 49S
-<esri32349> +proj=utm +zone=49 +south +ellps=WGS72 +units=m +no_defs  no_defs <>
-# WGS 72 / UTM zone 50S
-<esri32350> +proj=utm +zone=50 +south +ellps=WGS72 +units=m +no_defs  no_defs <>
-# WGS 72 / UTM zone 51S
-<esri32351> +proj=utm +zone=51 +south +ellps=WGS72 +units=m +no_defs  no_defs <>
-# WGS 72 / UTM zone 52S
-<esri32352> +proj=utm +zone=52 +south +ellps=WGS72 +units=m +no_defs  no_defs <>
-# WGS 72 / UTM zone 53S
-<esri32353> +proj=utm +zone=53 +south +ellps=WGS72 +units=m +no_defs  no_defs <>
-# WGS 72 / UTM zone 54S
-<esri32354> +proj=utm +zone=54 +south +ellps=WGS72 +units=m +no_defs  no_defs <>
-# WGS 72 / UTM zone 55S
-<esri32355> +proj=utm +zone=55 +south +ellps=WGS72 +units=m +no_defs  no_defs <>
-# WGS 72 / UTM zone 56S
-<esri32356> +proj=utm +zone=56 +south +ellps=WGS72 +units=m +no_defs  no_defs <>
-# WGS 72 / UTM zone 57S
-<esri32357> +proj=utm +zone=57 +south +ellps=WGS72 +units=m +no_defs  no_defs <>
-# WGS 72 / UTM zone 58S
-<esri32358> +proj=utm +zone=58 +south +ellps=WGS72 +units=m +no_defs  no_defs <>
-# WGS 72 / UTM zone 59S
-<esri32359> +proj=utm +zone=59 +south +ellps=WGS72 +units=m +no_defs  no_defs <>
-# WGS 72 / UTM zone 60S
-<esri32360> +proj=utm +zone=60 +south +ellps=WGS72 +units=m +no_defs  no_defs <>
-# WGS 72BE / UTM zone 1N
-<esri32401> +proj=utm +zone=1 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# WGS 72BE / UTM zone 2N
-<esri32402> +proj=utm +zone=2 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# WGS 72BE / UTM zone 3N
-<esri32403> +proj=utm +zone=3 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# WGS 72BE / UTM zone 4N
-<esri32404> +proj=utm +zone=4 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# WGS 72BE / UTM zone 5N
-<esri32405> +proj=utm +zone=5 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# WGS 72BE / UTM zone 6N
-<esri32406> +proj=utm +zone=6 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# WGS 72BE / UTM zone 7N
-<esri32407> +proj=utm +zone=7 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# WGS 72BE / UTM zone 8N
-<esri32408> +proj=utm +zone=8 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# WGS 72BE / UTM zone 9N
-<esri32409> +proj=utm +zone=9 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# WGS 72BE / UTM zone 10N
-<esri32410> +proj=utm +zone=10 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# WGS 72BE / UTM zone 11N
-<esri32411> +proj=utm +zone=11 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# WGS 72BE / UTM zone 12N
-<esri32412> +proj=utm +zone=12 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# WGS 72BE / UTM zone 13N
-<esri32413> +proj=utm +zone=13 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# WGS 72BE / UTM zone 14N
-<esri32414> +proj=utm +zone=14 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# WGS 72BE / UTM zone 15N
-<esri32415> +proj=utm +zone=15 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# WGS 72BE / UTM zone 16N
-<esri32416> +proj=utm +zone=16 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# WGS 72BE / UTM zone 17N
-<esri32417> +proj=utm +zone=17 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# WGS 72BE / UTM zone 18N
-<esri32418> +proj=utm +zone=18 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# WGS 72BE / UTM zone 19N
-<esri32419> +proj=utm +zone=19 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# WGS 72BE / UTM zone 20N
-<esri32420> +proj=utm +zone=20 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# WGS 72BE / UTM zone 21N
-<esri32421> +proj=utm +zone=21 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# WGS 72BE / UTM zone 22N
-<esri32422> +proj=utm +zone=22 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# WGS 72BE / UTM zone 23N
-<esri32423> +proj=utm +zone=23 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# WGS 72BE / UTM zone 24N
-<esri32424> +proj=utm +zone=24 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# WGS 72BE / UTM zone 25N
-<esri32425> +proj=utm +zone=25 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# WGS 72BE / UTM zone 26N
-<esri32426> +proj=utm +zone=26 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# WGS 72BE / UTM zone 27N
-<esri32427> +proj=utm +zone=27 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# WGS 72BE / UTM zone 28N
-<esri32428> +proj=utm +zone=28 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# WGS 72BE / UTM zone 29N
-<esri32429> +proj=utm +zone=29 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# WGS 72BE / UTM zone 30N
-<esri32430> +proj=utm +zone=30 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# WGS 72BE / UTM zone 31N
-<esri32431> +proj=utm +zone=31 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# WGS 72BE / UTM zone 32N
-<esri32432> +proj=utm +zone=32 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# WGS 72BE / UTM zone 33N
-<esri32433> +proj=utm +zone=33 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# WGS 72BE / UTM zone 34N
-<esri32434> +proj=utm +zone=34 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# WGS 72BE / UTM zone 35N
-<esri32435> +proj=utm +zone=35 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# WGS 72BE / UTM zone 36N
-<esri32436> +proj=utm +zone=36 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# WGS 72BE / UTM zone 37N
-<esri32437> +proj=utm +zone=37 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# WGS 72BE / UTM zone 38N
-<esri32438> +proj=utm +zone=38 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# WGS 72BE / UTM zone 39N
-<esri32439> +proj=utm +zone=39 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# WGS 72BE / UTM zone 40N
-<esri32440> +proj=utm +zone=40 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# WGS 72BE / UTM zone 41N
-<esri32441> +proj=utm +zone=41 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# WGS 72BE / UTM zone 42N
-<esri32442> +proj=utm +zone=42 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# WGS 72BE / UTM zone 43N
-<esri32443> +proj=utm +zone=43 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# WGS 72BE / UTM zone 44N
-<esri32444> +proj=utm +zone=44 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# WGS 72BE / UTM zone 45N
-<esri32445> +proj=utm +zone=45 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# WGS 72BE / UTM zone 46N
-<esri32446> +proj=utm +zone=46 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# WGS 72BE / UTM zone 47N
-<esri32447> +proj=utm +zone=47 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# WGS 72BE / UTM zone 48N
-<esri32448> +proj=utm +zone=48 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# WGS 72BE / UTM zone 49N
-<esri32449> +proj=utm +zone=49 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# WGS 72BE / UTM zone 50N
-<esri32450> +proj=utm +zone=50 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# WGS 72BE / UTM zone 51N
-<esri32451> +proj=utm +zone=51 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# WGS 72BE / UTM zone 52N
-<esri32452> +proj=utm +zone=52 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# WGS 72BE / UTM zone 53N
-<esri32453> +proj=utm +zone=53 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# WGS 72BE / UTM zone 54N
-<esri32454> +proj=utm +zone=54 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# WGS 72BE / UTM zone 55N
-<esri32455> +proj=utm +zone=55 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# WGS 72BE / UTM zone 56N
-<esri32456> +proj=utm +zone=56 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# WGS 72BE / UTM zone 57N
-<esri32457> +proj=utm +zone=57 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# WGS 72BE / UTM zone 58N
-<esri32458> +proj=utm +zone=58 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# WGS 72BE / UTM zone 59N
-<esri32459> +proj=utm +zone=59 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# WGS 72BE / UTM zone 60N
-<esri32460> +proj=utm +zone=60 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# WGS 72BE / UTM zone 1S
-<esri32501> +proj=utm +zone=1 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# WGS 72BE / UTM zone 2S
-<esri32502> +proj=utm +zone=2 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# WGS 72BE / UTM zone 3S
-<esri32503> +proj=utm +zone=3 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# WGS 72BE / UTM zone 4S
-<esri32504> +proj=utm +zone=4 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# WGS 72BE / UTM zone 5S
-<esri32505> +proj=utm +zone=5 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# WGS 72BE / UTM zone 6S
-<esri32506> +proj=utm +zone=6 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# WGS 72BE / UTM zone 7S
-<esri32507> +proj=utm +zone=7 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# WGS 72BE / UTM zone 8S
-<esri32508> +proj=utm +zone=8 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# WGS 72BE / UTM zone 9S
-<esri32509> +proj=utm +zone=9 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# WGS 72BE / UTM zone 10S
-<esri32510> +proj=utm +zone=10 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# WGS 72BE / UTM zone 11S
-<esri32511> +proj=utm +zone=11 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# WGS 72BE / UTM zone 12S
-<esri32512> +proj=utm +zone=12 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# WGS 72BE / UTM zone 13S
-<esri32513> +proj=utm +zone=13 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# WGS 72BE / UTM zone 14S
-<esri32514> +proj=utm +zone=14 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# WGS 72BE / UTM zone 15S
-<esri32515> +proj=utm +zone=15 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# WGS 72BE / UTM zone 16S
-<esri32516> +proj=utm +zone=16 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# WGS 72BE / UTM zone 17S
-<esri32517> +proj=utm +zone=17 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# WGS 72BE / UTM zone 18S
-<esri32518> +proj=utm +zone=18 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# WGS 72BE / UTM zone 19S
-<esri32519> +proj=utm +zone=19 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# WGS 72BE / UTM zone 20S
-<esri32520> +proj=utm +zone=20 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# WGS 72BE / UTM zone 21S
-<esri32521> +proj=utm +zone=21 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# WGS 72BE / UTM zone 22S
-<esri32522> +proj=utm +zone=22 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# WGS 72BE / UTM zone 23S
-<esri32523> +proj=utm +zone=23 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# WGS 72BE / UTM zone 24S
-<esri32524> +proj=utm +zone=24 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# WGS 72BE / UTM zone 25S
-<esri32525> +proj=utm +zone=25 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# WGS 72BE / UTM zone 26S
-<esri32526> +proj=utm +zone=26 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# WGS 72BE / UTM zone 27S
-<esri32527> +proj=utm +zone=27 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# WGS 72BE / UTM zone 28S
-<esri32528> +proj=utm +zone=28 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# WGS 72BE / UTM zone 29S
-<esri32529> +proj=utm +zone=29 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# WGS 72BE / UTM zone 30S
-<esri32530> +proj=utm +zone=30 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# WGS 72BE / UTM zone 31S
-<esri32531> +proj=utm +zone=31 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# WGS 72BE / UTM zone 32S
-<esri32532> +proj=utm +zone=32 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# WGS 72BE / UTM zone 33S
-<esri32533> +proj=utm +zone=33 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# WGS 72BE / UTM zone 34S
-<esri32534> +proj=utm +zone=34 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# WGS 72BE / UTM zone 35S
-<esri32535> +proj=utm +zone=35 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# WGS 72BE / UTM zone 36S
-<esri32536> +proj=utm +zone=36 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# WGS 72BE / UTM zone 37S
-<esri32537> +proj=utm +zone=37 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# WGS 72BE / UTM zone 38S
-<esri32538> +proj=utm +zone=38 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# WGS 72BE / UTM zone 39S
-<esri32539> +proj=utm +zone=39 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# WGS 72BE / UTM zone 40S
-<esri32540> +proj=utm +zone=40 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# WGS 72BE / UTM zone 41S
-<esri32541> +proj=utm +zone=41 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# WGS 72BE / UTM zone 42S
-<esri32542> +proj=utm +zone=42 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# WGS 72BE / UTM zone 43S
-<esri32543> +proj=utm +zone=43 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# WGS 72BE / UTM zone 44S
-<esri32544> +proj=utm +zone=44 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# WGS 72BE / UTM zone 45S
-<esri32545> +proj=utm +zone=45 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# WGS 72BE / UTM zone 46S
-<esri32546> +proj=utm +zone=46 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# WGS 72BE / UTM zone 47S
-<esri32547> +proj=utm +zone=47 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# WGS 72BE / UTM zone 48S
-<esri32548> +proj=utm +zone=48 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# WGS 72BE / UTM zone 49S
-<esri32549> +proj=utm +zone=49 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# WGS 72BE / UTM zone 50S
-<esri32550> +proj=utm +zone=50 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# WGS 72BE / UTM zone 51S
-<esri32551> +proj=utm +zone=51 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# WGS 72BE / UTM zone 52S
-<esri32552> +proj=utm +zone=52 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# WGS 72BE / UTM zone 53S
-<esri32553> +proj=utm +zone=53 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# WGS 72BE / UTM zone 54S
-<esri32554> +proj=utm +zone=54 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# WGS 72BE / UTM zone 55S
-<esri32555> +proj=utm +zone=55 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# WGS 72BE / UTM zone 56S
-<esri32556> +proj=utm +zone=56 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# WGS 72BE / UTM zone 57S
-<esri32557> +proj=utm +zone=57 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# WGS 72BE / UTM zone 58S
-<esri32558> +proj=utm +zone=58 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# WGS 72BE / UTM zone 59S
-<esri32559> +proj=utm +zone=59 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# WGS 72BE / UTM zone 60S
-<esri32560> +proj=utm +zone=60 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs  no_defs <>
-# WGS 84 / UTM zone 1N
-<esri32601> +proj=utm +zone=1 +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UTM zone 2N
-<esri32602> +proj=utm +zone=2 +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UTM zone 3N
-<esri32603> +proj=utm +zone=3 +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UTM zone 4N
-<esri32604> +proj=utm +zone=4 +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UTM zone 5N
-<esri32605> +proj=utm +zone=5 +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UTM zone 6N
-<esri32606> +proj=utm +zone=6 +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UTM zone 7N
-<esri32607> +proj=utm +zone=7 +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UTM zone 8N
-<esri32608> +proj=utm +zone=8 +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UTM zone 9N
-<esri32609> +proj=utm +zone=9 +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UTM zone 10N
-<esri32610> +proj=utm +zone=10 +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UTM zone 11N
-<esri32611> +proj=utm +zone=11 +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UTM zone 12N
-<esri32612> +proj=utm +zone=12 +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UTM zone 13N
-<esri32613> +proj=utm +zone=13 +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UTM zone 14N
-<esri32614> +proj=utm +zone=14 +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UTM zone 15N
-<esri32615> +proj=utm +zone=15 +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UTM zone 16N
-<esri32616> +proj=utm +zone=16 +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UTM zone 17N
-<esri32617> +proj=utm +zone=17 +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UTM zone 18N
-<esri32618> +proj=utm +zone=18 +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UTM zone 19N
-<esri32619> +proj=utm +zone=19 +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UTM zone 20N
-<esri32620> +proj=utm +zone=20 +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UTM zone 21N
-<esri32621> +proj=utm +zone=21 +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UTM zone 22N
-<esri32622> +proj=utm +zone=22 +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UTM zone 23N
-<esri32623> +proj=utm +zone=23 +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UTM zone 24N
-<esri32624> +proj=utm +zone=24 +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UTM zone 25N
-<esri32625> +proj=utm +zone=25 +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UTM zone 26N
-<esri32626> +proj=utm +zone=26 +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UTM zone 27N
-<esri32627> +proj=utm +zone=27 +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UTM zone 28N
-<esri32628> +proj=utm +zone=28 +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UTM zone 29N
-<esri32629> +proj=utm +zone=29 +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UTM zone 30N
-<esri32630> +proj=utm +zone=30 +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UTM zone 31N
-<esri32631> +proj=utm +zone=31 +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UTM zone 32N
-<esri32632> +proj=utm +zone=32 +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UTM zone 33N
-<esri32633> +proj=utm +zone=33 +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UTM zone 34N
-<esri32634> +proj=utm +zone=34 +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UTM zone 35N
-<esri32635> +proj=utm +zone=35 +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UTM zone 36N
-<esri32636> +proj=utm +zone=36 +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UTM zone 37N
-<esri32637> +proj=utm +zone=37 +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UTM zone 38N
-<esri32638> +proj=utm +zone=38 +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UTM zone 39N
-<esri32639> +proj=utm +zone=39 +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UTM zone 40N
-<esri32640> +proj=utm +zone=40 +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UTM zone 41N
-<esri32641> +proj=utm +zone=41 +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UTM zone 42N
-<esri32642> +proj=utm +zone=42 +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UTM zone 43N
-<esri32643> +proj=utm +zone=43 +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UTM zone 44N
-<esri32644> +proj=utm +zone=44 +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UTM zone 45N
-<esri32645> +proj=utm +zone=45 +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UTM zone 46N
-<esri32646> +proj=utm +zone=46 +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UTM zone 47N
-<esri32647> +proj=utm +zone=47 +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UTM zone 48N
-<esri32648> +proj=utm +zone=48 +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UTM zone 49N
-<esri32649> +proj=utm +zone=49 +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UTM zone 50N
-<esri32650> +proj=utm +zone=50 +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UTM zone 51N
-<esri32651> +proj=utm +zone=51 +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UTM zone 52N
-<esri32652> +proj=utm +zone=52 +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UTM zone 53N
-<esri32653> +proj=utm +zone=53 +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UTM zone 54N
-<esri32654> +proj=utm +zone=54 +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UTM zone 55N
-<esri32655> +proj=utm +zone=55 +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UTM zone 56N
-<esri32656> +proj=utm +zone=56 +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UTM zone 57N
-<esri32657> +proj=utm +zone=57 +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UTM zone 58N
-<esri32658> +proj=utm +zone=58 +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UTM zone 59N
-<esri32659> +proj=utm +zone=59 +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UTM zone 60N
-<esri32660> +proj=utm +zone=60 +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UPS North
-<esri32661> +proj=stere +lat_0=90 +lat_ts=90 +lon_0=0 +k=0.994 +x_0=2000000 +y_0=2000000 +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UTM zone 1S
-<esri32701> +proj=utm +zone=1 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UTM zone 2S
-<esri32702> +proj=utm +zone=2 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UTM zone 3S
-<esri32703> +proj=utm +zone=3 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UTM zone 4S
-<esri32704> +proj=utm +zone=4 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UTM zone 5S
-<esri32705> +proj=utm +zone=5 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UTM zone 6S
-<esri32706> +proj=utm +zone=6 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UTM zone 7S
-<esri32707> +proj=utm +zone=7 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UTM zone 8S
-<esri32708> +proj=utm +zone=8 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UTM zone 9S
-<esri32709> +proj=utm +zone=9 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UTM zone 10S
-<esri32710> +proj=utm +zone=10 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UTM zone 11S
-<esri32711> +proj=utm +zone=11 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UTM zone 12S
-<esri32712> +proj=utm +zone=12 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UTM zone 13S
-<esri32713> +proj=utm +zone=13 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UTM zone 14S
-<esri32714> +proj=utm +zone=14 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UTM zone 15S
-<esri32715> +proj=utm +zone=15 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UTM zone 16S
-<esri32716> +proj=utm +zone=16 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UTM zone 17S
-<esri32717> +proj=utm +zone=17 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UTM zone 18S
-<esri32718> +proj=utm +zone=18 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UTM zone 19S
-<esri32719> +proj=utm +zone=19 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UTM zone 20S
-<esri32720> +proj=utm +zone=20 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UTM zone 21S
-<esri32721> +proj=utm +zone=21 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UTM zone 22S
-<esri32722> +proj=utm +zone=22 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UTM zone 23S
-<esri32723> +proj=utm +zone=23 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UTM zone 24S
-<esri32724> +proj=utm +zone=24 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UTM zone 25S
-<esri32725> +proj=utm +zone=25 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UTM zone 26S
-<esri32726> +proj=utm +zone=26 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UTM zone 27S
-<esri32727> +proj=utm +zone=27 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UTM zone 28S
-<esri32728> +proj=utm +zone=28 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UTM zone 29S
-<esri32729> +proj=utm +zone=29 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UTM zone 30S
-<esri32730> +proj=utm +zone=30 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UTM zone 31S
-<esri32731> +proj=utm +zone=31 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UTM zone 32S
-<esri32732> +proj=utm +zone=32 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UTM zone 33S
-<esri32733> +proj=utm +zone=33 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UTM zone 34S
-<esri32734> +proj=utm +zone=34 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UTM zone 35S
-<esri32735> +proj=utm +zone=35 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UTM zone 36S
-<esri32736> +proj=utm +zone=36 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UTM zone 37S
-<esri32737> +proj=utm +zone=37 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UTM zone 38S
-<esri32738> +proj=utm +zone=38 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UTM zone 39S
-<esri32739> +proj=utm +zone=39 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UTM zone 40S
-<esri32740> +proj=utm +zone=40 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UTM zone 41S
-<esri32741> +proj=utm +zone=41 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UTM zone 42S
-<esri32742> +proj=utm +zone=42 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UTM zone 43S
-<esri32743> +proj=utm +zone=43 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UTM zone 44S
-<esri32744> +proj=utm +zone=44 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UTM zone 45S
-<esri32745> +proj=utm +zone=45 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UTM zone 46S
-<esri32746> +proj=utm +zone=46 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UTM zone 47S
-<esri32747> +proj=utm +zone=47 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UTM zone 48S
-<esri32748> +proj=utm +zone=48 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UTM zone 49S
-<esri32749> +proj=utm +zone=49 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UTM zone 50S
-<esri32750> +proj=utm +zone=50 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UTM zone 51S
-<esri32751> +proj=utm +zone=51 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UTM zone 52S
-<esri32752> +proj=utm +zone=52 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UTM zone 53S
-<esri32753> +proj=utm +zone=53 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UTM zone 54S
-<esri32754> +proj=utm +zone=54 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UTM zone 55S
-<esri32755> +proj=utm +zone=55 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UTM zone 56S
-<esri32756> +proj=utm +zone=56 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UTM zone 57S
-<esri32757> +proj=utm +zone=57 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UTM zone 58S
-<esri32758> +proj=utm +zone=58 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UTM zone 59S
-<esri32759> +proj=utm +zone=59 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UTM zone 60S
-<esri32760> +proj=utm +zone=60 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / UPS South
-<esri32761> +proj=stere +lat_0=-90 +lat_ts=-90 +lon_0=0 +k=0.994 +x_0=2000000 +y_0=2000000 +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# WGS 84 / TM 36 SE
-<esri32766> +proj=tmerc +lat_0=0 +lon_0=36 +k=0.999600 +x_0=500000 +y_0=10000000 +ellps=WGS84 +datum=WGS84 +units=m +no_defs  no_defs <>
-# Pulkovo 1995 GK Zone 2
-<esri20002> +proj=tmerc +lat_0=0 +lon_0=9 +k=1.000000 +x_0=2500000 +y_0=0 +ellps=krass +units=m  no_defs <>
-# Pulkovo 1995 GK Zone 3
-<esri20003> +proj=tmerc +lat_0=0 +lon_0=15 +k=1.000000 +x_0=3500000 +y_0=0 +ellps=krass +units=m  no_defs <>
-# Pulkovo 1995 GK Zone 2N
-<esri20062> +proj=tmerc +lat_0=0 +lon_0=9 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m  no_defs <>
-# Pulkovo 1995 GK Zone 3N
-<esri20063> +proj=tmerc +lat_0=0 +lon_0=15 +k=1.000000 +x_0=500000 +y_0=0 +ellps=krass +units=m  no_defs <>
-# La Canoa UTM Zone 21N
-<esri24721> +proj=utm +zone=21 +ellps=intl +units=m  no_defs <>
-# NAD 1927 StatePlane Hawaii 1 FIPS 5101
-<esri26761> +proj=tmerc +lat_0=18.83333333333333 +lon_0=-155.5 +k=0.999967 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1927 StatePlane Hawaii 2 FIPS 5102
-<esri26762> +proj=tmerc +lat_0=20.33333333333333 +lon_0=-156.6666666666667 +k=0.999967 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1927 StatePlane Hawaii 3 FIPS 5103
-<esri26763> +proj=tmerc +lat_0=21.16666666666667 +lon_0=-158 +k=0.999990 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1927 StatePlane Hawaii 4 FIPS 5104
-<esri26764> +proj=tmerc +lat_0=21.83333333333333 +lon_0=-159.5 +k=0.999990 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1927 StatePlane Hawaii 5 FIPS 5105
-<esri26765> +proj=tmerc +lat_0=21.66666666666667 +lon_0=-160.1666666666667 +k=1.000000 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1927 StatePlane Michigan North FIPS 2111
-<esri26788> +proj=lcc +lat_1=45.48333333333333 +lat_2=47.08333333333334 +lat_0=44.78333333333333 +lon_0=-87 +x_0=609601.2192024385 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1927 StatePlane Michigan Central FIPS 2112
-<esri26789> +proj=lcc +lat_1=44.18333333333333 +lat_2=45.7 +lat_0=43.31666666666667 +lon_0=-84.33333333333333 +x_0=609601.2192024385 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1927 StatePlane Michigan South FIPS 2113
-<esri26790> +proj=lcc +lat_1=42.1 +lat_2=43.66666666666666 +lat_0=41.5 +lon_0=-84.33333333333333 +x_0=609601.2192024385 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192  no_defs <>
-# Nord Algerie
-<esri30591> +proj=lcc +lat_1=36 +lat_0=36 +lon_0=2.7 +k_0=0.999625544 +x_0=500135 +y_0=300090 +ellps=clrk80 +units=m  no_defs <>
-# Sud Algerie
-<esri30592> +proj=lcc +lat_1=33.3 +lat_0=33.3 +lon_0=2.7 +k_0=0.999625769 +x_0=500135 +y_0=300090 +ellps=clrk80 +units=m  no_defs <>
-# Germany Zone 1
-<esri31491> +proj=tmerc +lat_0=0 +lon_0=3 +k=1.000000 +x_0=1500000 +y_0=0 +ellps=bessel +units=m  no_defs <>
-# Germany Zone 2
-<esri31492> +proj=tmerc +lat_0=0 +lon_0=6 +k=1.000000 +x_0=2500000 +y_0=0 +ellps=bessel +units=m  no_defs <>
-# Germany Zone 3
-<esri31493> +proj=tmerc +lat_0=0 +lon_0=9 +k=1.000000 +x_0=3500000 +y_0=0 +ellps=bessel +units=m  no_defs <>
-# Germany Zone 4
-<esri31494> +proj=tmerc +lat_0=0 +lon_0=12 +k=1.000000 +x_0=4500000 +y_0=0 +ellps=bessel +units=m  no_defs <>
-# Germany Zone 5
-<esri31495> +proj=tmerc +lat_0=0 +lon_0=15 +k=1.000000 +x_0=5500000 +y_0=0 +ellps=bessel +units=m  no_defs <>
-# NAD 1927 StatePlane Puerto Rico FIPS 5201
-<esri32059> +proj=lcc +lat_1=18.03333333333334 +lat_2=18.43333333333333 +lat_0=17.83333333333333 +lon_0=-66.43333333333334 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1927 StatePlane Virgin Islands St Croix FIPS 5202
-<esri32060> +proj=lcc +lat_1=18.03333333333334 +lat_2=18.43333333333333 +lat_0=17.83333333333333 +lon_0=-66.43333333333334 +x_0=152400.3048006096 +y_0=30480.06096012193 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192  no_defs <>
-# Sphere Plate Carree
-<esri53001> +a=6371000 +b=6371000 +units=m  no_defs <>
-# Sphere Equidistant Cylindrical
-<esri53002> +a=6371000 +b=6371000 +units=m  no_defs <>
-# Sphere Miller Cylindrical
-<esri53003> +proj=mill +lat_0=0 +lon_0=0 +x_0=0 +y_0=0 +R_A +a=6371000 +b=6371000 +units=m  no_defs <>
-# Sphere Mercator
-<esri53004> +proj=merc +lat_ts=0 +lon_0=0 +k=1.000000 +x_0=0 +y_0=0 +a=6371000 +b=6371000 +units=m  no_defs <>
-# Sphere Sinusoidal
-<esri53008> +proj=sinu +lon_0=0 +x_0=0 +y_0=0 +a=6371000 +b=6371000 +units=m  no_defs <>
-# Sphere Mollweide
-<esri53009> +proj=moll +lon_0=0 +x_0=0 +y_0=0 +a=6371000 +b=6371000 +units=m  no_defs <>
-# Sphere Eckert VI
-<esri53010> +proj=eck6 +lon_0=0 +x_0=0 +y_0=0 +a=6371000 +b=6371000 +units=m  no_defs <>
-# Sphere Eckert V
-<esri53011> +a=6371000 +b=6371000 +units=m  no_defs <>
-# Sphere Eckert IV
-<esri53012> +proj=eck4 +lon_0=0 +x_0=0 +y_0=0 +a=6371000 +b=6371000 +units=m  no_defs <>
-# Sphere Eckert III
-<esri53013> +a=6371000 +b=6371000 +units=m  no_defs <>
-# Sphere Eckert II
-<esri53014> +a=6371000 +b=6371000 +units=m  no_defs <>
-# Sphere Eckert I
-<esri53015> +a=6371000 +b=6371000 +units=m  no_defs <>
-# Sphere Gall Stereographic
-<esri53016> +proj=gall +lon_0=0 +x_0=0 +y_0=0 +a=6371000 +b=6371000 +units=m  no_defs <>
-# Sphere Behrmann
-<esri53017> +a=6371000 +b=6371000 +units=m  no_defs <>
-# Sphere Winkel I
-<esri53018> +a=6371000 +b=6371000 +units=m  no_defs <>
-# Sphere Winkel II
-<esri53019> +a=6371000 +b=6371000 +units=m  no_defs <>
-# Sphere Polyconic
-<esri53021> +proj=poly +lat_0=0 +lon_0=0 +x_0=0 +y_0=0 +a=6371000 +b=6371000 +units=m  no_defs <>
-# Sphere Quartic Authalic
-<esri53022> +a=6371000 +b=6371000 +units=m  no_defs <>
-# Sphere Loximuthal
-<esri53023> +a=6371000 +b=6371000 +units=m  no_defs <>
-# Sphere Bonne
-<esri53024> +a=6371000 +b=6371000 +units=m  no_defs <>
-# Sphere Hotine
-<esri53025> +a=6371000 +b=6371000 +units=m  no_defs <>
-# Sphere Stereographic
-<esri53026> +proj=stere +lat_0=0 +lon_0=0 +x_0=0 +y_0=0 +a=6371000 +b=6371000 +units=m  no_defs <>
-# Sphere Equidistant Conic
-<esri53027> +proj=eqdc +lat_0=0 +lon_0=0 +lat_1=60 +lat_2=60 +x_0=0 +y_0=0 +a=6371000 +b=6371000 +units=m  no_defs <>
-# Sphere Cassini
-<esri53028> +proj=cass +lat_0=0 +lon_0=0 +x_0=0 +y_0=0 +a=6371000 +b=6371000 +units=m  no_defs <>
-# Sphere Van der Grinten I
-<esri53029> +proj=vandg +lon_0=0 +x_0=0 +y_0=0 +R_A +a=6371000 +b=6371000 +units=m  no_defs <>
-# Sphere Robinson
-<esri53030> +proj=robin +lon_0=0 +x_0=0 +y_0=0 +a=6371000 +b=6371000 +units=m  no_defs <>
-# Sphere Two Point Equidistant
-<esri53031> +a=6371000 +b=6371000 +units=m  no_defs <>
-# Sphere Azimuthal Equidistant
-<esri53032> +proj=aeqd +lat_0=0 +lon_0=0 +x_0=0 +y_0=0 +a=6371000 +b=6371000 +units=m  no_defs <>
-# World Plate Carree
-<esri54001> +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-# World Equidistant Cylindrical
-<esri54002> +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-# World Miller Cylindrical
-<esri54003> +proj=mill +lat_0=0 +lon_0=0 +x_0=0 +y_0=0 +R_A +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-# World Mercator
-<esri54004> +proj=merc +lat_ts=0 +lon_0=0 +k=1.000000 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-# World Sinusoidal
-<esri54008> +proj=sinu +lon_0=0 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-# World Mollweide
-<esri54009> +proj=moll +lon_0=0 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-# World Eckert VI
-<esri54010> +proj=eck6 +lon_0=0 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-# World Eckert V
-<esri54011> +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-# World Eckert IV
-<esri54012> +proj=eck4 +lon_0=0 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-# World Eckert III
-<esri54013> +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-# World Eckert II
-<esri54014> +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-# World Eckert I
-<esri54015> +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-# World Gall Stereographic
-<esri54016> +proj=gall +lon_0=0 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-# World Behrmann
-<esri54017> +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-# World Winkel I
-<esri54018> +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-# World Winkel II
-<esri54019> +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-# World Polyconic
-<esri54021> +proj=poly +lat_0=0 +lon_0=0 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-# World Quartic Authalic
-<esri54022> +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-# World Loximuthal
-<esri54023> +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-# World Bonne
-<esri54024> +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-# World Hotine
-<esri54025> +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-# World Stereographic
-<esri54026> +proj=stere +lat_0=0 +lon_0=0 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-# World Equidistant Conic
-<esri54027> +proj=eqdc +lat_0=0 +lon_0=0 +lat_1=60 +lat_2=60 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-# World Cassini
-<esri54028> +proj=cass +lat_0=0 +lon_0=0 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-# World Van der Grinten I
-<esri54029> +proj=vandg +lon_0=0 +x_0=0 +y_0=0 +R_A +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-# World Robinson
-<esri54030> +proj=robin +lon_0=0 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-# World Two Point Equidistant
-<esri54031> +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-# World Azimuthal Equidistant
-<esri54032> +proj=aeqd +lat_0=0 +lon_0=0 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-# NAD 1927 StatePlane Guam FIPS 5400
-<esri65061> +proj=poly +lat_0=13.47246635277778 +lon_0=-144.7487507055556 +x_0=50000.00000000001 +y_0=50000.00000000001 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane Guam FIPS 5400
-<esri65161> +proj=poly +lat_0=13.47246635277778 +lon_0=-144.7487507055556 +x_0=50000 +y_0=50000 +ellps=GRS80 +datum=NAD83 +units=m  no_defs <>
-# Canada Albers Equal Area Conic
-<esri102001> +proj=aea +lat_1=50 +lat_2=70 +lat_0=40 +lon_0=-96 +x_0=0 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m  no_defs <>
-# Canada Lambert Conformal Conic
-<esri102002> +proj=lcc +lat_1=50 +lat_2=70 +lat_0=40 +lon_0=-96 +x_0=0 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m  no_defs <>
-# USA Contiguous Albers Equal Area Conic
-<esri102003> +proj=aea +lat_1=29.5 +lat_2=45.5 +lat_0=37.5 +lon_0=-96 +x_0=0 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m  no_defs <>
-# USA Contiguous Lambert Conformal Conic
-<esri102004> +proj=lcc +lat_1=33 +lat_2=45 +lat_0=39 +lon_0=-96 +x_0=0 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m  no_defs <>
-# USA Contiguous Equidistant Conic
-<esri102005> +proj=eqdc +lat_0=0 +lon_0=0 +lat_1=33 +lat_2=45 +x_0=0 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m  no_defs <>
-# Alaska Albers Equal Area Conic
-<esri102006> +proj=aea +lat_1=55 +lat_2=65 +lat_0=50 +lon_0=-154 +x_0=0 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m  no_defs <>
-# Hawaii Albers Equal Area Conic
-<esri102007> +proj=aea +lat_1=8 +lat_2=18 +lat_0=13 +lon_0=-157 +x_0=0 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m  no_defs <>
-# North America Albers Equal Area Conic
-<esri102008> +proj=aea +lat_1=20 +lat_2=60 +lat_0=40 +lon_0=-96 +x_0=0 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m  no_defs <>
-# North America Lambert Conformal Conic
-<esri102009> +proj=lcc +lat_1=20 +lat_2=60 +lat_0=40 +lon_0=-96 +x_0=0 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m  no_defs <>
-# North America Equidistant Conic
-<esri102010> +proj=eqdc +lat_0=0 +lon_0=0 +lat_1=20 +lat_2=60 +x_0=0 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m  no_defs <>
-# Africa Sinusoidal
-<esri102011> +proj=sinu +lon_0=0 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-# Asia Lambert Conformal Conic
-<esri102012> +proj=lcc +lat_1=30 +lat_2=62 +lat_0=0 +lon_0=105 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-# Europe Albers Equal Area Conic
-<esri102013> +proj=aea +lat_1=43 +lat_2=62 +lat_0=30 +lon_0=10 +x_0=0 +y_0=0 +ellps=intl +units=m  no_defs <>
-# Europe Lambert Conformal Conic
-<esri102014> +proj=lcc +lat_1=43 +lat_2=62 +lat_0=30 +lon_0=10 +x_0=0 +y_0=0 +ellps=intl +units=m  no_defs <>
-# South America Lambert Conformal Conic
-<esri102015> +proj=lcc +lat_1=-5 +lat_2=-42 +lat_0=-32 +lon_0=-60 +x_0=0 +y_0=0 +ellps=aust_SA +units=m  no_defs <>
-# North Pole Azimuthal Equidistant
-<esri102016> +proj=aeqd +lat_0=90 +lon_0=0 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-# North Pole Lambert Azimuthal Equal Area
-<esri102017> +proj=laea +lat_0=90 +lon_0=0 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-# North Pole Stereographic
-<esri102018> +proj=stere +lat_0=90 +lon_0=0 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-# South Pole Azimuthal Equidistant
-<esri102019> +proj=aeqd +lat_0=-90 +lon_0=0 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-# South Pole Lambert Azimuthal Equal Area
-<esri102020> +proj=laea +lat_0=-90 +lon_0=0 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-# South Pole Stereographic
-<esri102021> +proj=stere +lat_0=-90 +lon_0=0 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-# Africa Albers Equal Area Conic
-<esri102022> +proj=aea +lat_1=20 +lat_2=-23 +lat_0=0 +lon_0=25 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-# Africa Equidistant Conic
-<esri102023> +proj=eqdc +lat_0=0 +lon_0=0 +lat_1=20 +lat_2=-23 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-# Africa Lambert Conformal Conic
-<esri102024> +proj=lcc +lat_1=20 +lat_2=-23 +lat_0=0 +lon_0=25 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-# Asia North Albers Equal Area Conic
-<esri102025> +proj=aea +lat_1=15 +lat_2=65 +lat_0=30 +lon_0=95 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-# Asia North Equidistant Conic
-<esri102026> +proj=eqdc +lat_0=0 +lon_0=0 +lat_1=15 +lat_2=65 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-# Asia North Lambert Conformal Conic
-<esri102027> +proj=lcc +lat_1=15 +lat_2=65 +lat_0=30 +lon_0=95 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-# Asia South Albers Equal Area Conic
-<esri102028> +proj=aea +lat_1=7 +lat_2=-32 +lat_0=-15 +lon_0=125 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-# Asia South Equidistant Conic
-<esri102029> +proj=eqdc +lat_0=0 +lon_0=0 +lat_1=7 +lat_2=-32 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-# Asia South Lambert Conformal Conic
-<esri102030> +proj=lcc +lat_1=7 +lat_2=-32 +lat_0=-15 +lon_0=125 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m  no_defs <>
-# Europe Equidistant Conic
-<esri102031> +proj=eqdc +lat_0=0 +lon_0=0 +lat_1=43 +lat_2=62 +x_0=0 +y_0=0 +ellps=intl +units=m  no_defs <>
-# South America Equidistant Conic
-<esri102032> +proj=eqdc +lat_0=0 +lon_0=0 +lat_1=-5 +lat_2=-42 +x_0=0 +y_0=0 +ellps=aust_SA +units=m  no_defs <>
-# South America Albers Equal Area Conic
-<esri102033> +proj=aea +lat_1=-5 +lat_2=-42 +lat_0=-32 +lon_0=-60 +x_0=0 +y_0=0 +ellps=aust_SA +units=m  no_defs <>
-# S-JTSK Krovak
-<esri102065> +proj=krovak +lat_0=49.5 +lon_0=24.83333333333333 +alpha=30.28813975277778 +k=0.9999 +x_0=0 +y_0=0 +ellps=bessel +units=m  no_defs <>
-# S-JTSK Ferro Krovak East North
-<esri102066> +proj=krovak +lat_0=49.5 +lon_0=24.83333333333333 +alpha=30.28813975277778 +k=0.9999 +x_0=0 +y_0=0 +ellps=bessel +pm=-17.66666666666667 +units=m  no_defs <>
-# S-JTSK Krovak East North
-<esri102067> +proj=krovak +lat_0=49.5 +lon_0=24.83333333333333 +alpha=30.28813975277778 +k=0.9999 +x_0=0 +y_0=0 +ellps=bessel +units=m  no_defs <>
-# Monte Mario Italy 1
-<esri102091> +proj=tmerc +lat_0=0 +lon_0=9 +k=0.999600 +x_0=1500000 +y_0=0 +ellps=intl +units=m  no_defs <>
-# Monte Mario Italy 2
-<esri102092> +proj=tmerc +lat_0=0 +lon_0=15 +k=0.999600 +x_0=2520000 +y_0=0 +ellps=intl +units=m  no_defs <>
-# NGO 1948 Norway Zone 1
-<esri102101> +proj=tmerc +lat_0=58 +lon_0=6.05625 +k=1.000000 +x_0=0 +y_0=0 +a=6377492.018 +b=6356173.508712696 +units=m  no_defs <>
-# NGO 1948 Norway Zone 2
-<esri102102> +proj=tmerc +lat_0=58 +lon_0=8.389583333333333 +k=1.000000 +x_0=0 +y_0=0 +a=6377492.018 +b=6356173.508712696 +units=m  no_defs <>
-# NGO 1948 Norway Zone 3
-<esri102103> +proj=tmerc +lat_0=58 +lon_0=10.72291666666667 +k=1.000000 +x_0=0 +y_0=0 +a=6377492.018 +b=6356173.508712696 +units=m  no_defs <>
-# NGO 1948 Norway Zone 4
-<esri102104> +proj=tmerc +lat_0=58 +lon_0=13.22291666666667 +k=1.000000 +x_0=0 +y_0=0 +a=6377492.018 +b=6356173.508712696 +units=m  no_defs <>
-# NGO 1948 Norway Zone 5
-<esri102105> +proj=tmerc +lat_0=58 +lon_0=16.88958333333333 +k=1.000000 +x_0=0 +y_0=0 +a=6377492.018 +b=6356173.508712696 +units=m  no_defs <>
-# NGO 1948 Norway Zone 6
-<esri102106> +proj=tmerc +lat_0=58 +lon_0=20.88958333333333 +k=1.000000 +x_0=0 +y_0=0 +a=6377492.018 +b=6356173.508712696 +units=m  no_defs <>
-# NGO 1948 Norway Zone 7
-<esri102107> +proj=tmerc +lat_0=58 +lon_0=24.88958333333333 +k=1.000000 +x_0=0 +y_0=0 +a=6377492.018 +b=6356173.508712696 +units=m  no_defs <>
-# NGO 1948 Norway Zone 8
-<esri102108> +proj=tmerc +lat_0=58 +lon_0=29.05625 +k=1.000000 +x_0=0 +y_0=0 +a=6377492.018 +b=6356173.508712696 +units=m  no_defs <>
-# RGF 1993 Lambert 93
-<esri102110> +proj=lcc +lat_1=44 +lat_2=49 +lat_0=46.5 +lon_0=3 +x_0=700000 +y_0=6600000 +ellps=GRS80 +units=m  no_defs <>
-# Old Hawaiian UTM Zone 4N
-<esri102114> +proj=utm +zone=4 +ellps=clrk66 +units=m  no_defs <>
-# Old Hawaiian UTM Zone 5N
-<esri102115> +proj=utm +zone=5 +ellps=clrk66 +units=m  no_defs <>
-# NAD 1927 Michigan GeoRef Feet US
-<esri102120> +proj=omerc +lat_0=45.30916666666666 +lonc=-86 +alpha=337.255555555556 +k=0.9996 +x_0=2546731.495961392 +y_0=-4354009.816002033 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 Michigan GeoRef Feet US
-<esri102121> +proj=omerc +lat_0=45.30916666666666 +lonc=-86 +alpha=337.255555555556 +k=0.9996 +x_0=2546731.495961392 +y_0=-4354009.816002033 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1927 Michigan GeoRef Meters
-<esri102122> +proj=omerc +lat_0=45.30916666666666 +lonc=-86 +alpha=337.255555555556 +k=0.9996 +x_0=2546731.496 +y_0=-4354009.816 +ellps=clrk66 +datum=NAD27 +units=m  no_defs <>
-# NAD 1983 Michigan GeoRef Meters
-<esri102123> +proj=omerc +lat_0=45.30916666666666 +lonc=-86 +alpha=337.255555555556 +k=0.9996 +x_0=2546731.496 +y_0=-4354009.816 +ellps=GRS80 +datum=NAD83 +units=m  no_defs <>
-# NGO 1948 UTM Zone 32N
-<esri102132> +proj=utm +zone=32 +a=6377492.018 +b=6356173.508712696 +units=m  no_defs <>
-# NGO 1948 UTM Zone 33N
-<esri102133> +proj=utm +zone=33 +a=6377492.018 +b=6356173.508712696 +units=m  no_defs <>
-# NGO 1948 UTM Zone 34N
-<esri102134> +proj=utm +zone=34 +a=6377492.018 +b=6356173.508712696 +units=m  no_defs <>
-# NGO 1948 UTM Zone 35N
-<esri102135> +proj=utm +zone=35 +a=6377492.018 +b=6356173.508712696 +units=m  no_defs <>
-# Hong Kong 1980 Grid
-<esri102140> +proj=tmerc +lat_0=22.31213333333334 +lon_0=114.1785555555556 +k=1.000000 +x_0=836694.05 +y_0=819069.8 +ellps=intl +units=m  no_defs <>
-# Hong Kong 1980 UTM Zone 49N
-<esri102141> +proj=utm +zone=49 +ellps=intl +units=m  no_defs <>
-# Hong Kong 1980 UTM Zone 50N
-<esri102142> +proj=utm +zone=50 +ellps=intl +units=m  no_defs <>
-# Tokyo UTM Zone 51N
-<esri102151> +proj=utm +zone=51 +ellps=bessel +units=m  no_defs <>
-# Tokyo UTM Zone 52N
-<esri102152> +proj=utm +zone=52 +ellps=bessel +units=m  no_defs <>
-# Tokyo UTM Zone 53N
-<esri102153> +proj=utm +zone=53 +ellps=bessel +units=m  no_defs <>
-# Tokyo UTM Zone 54N
-<esri102154> +proj=utm +zone=54 +ellps=bessel +units=m  no_defs <>
-# Tokyo UTM Zone 55N
-<esri102155> +proj=utm +zone=55 +ellps=bessel +units=m  no_defs <>
-# Tokyo UTM Zone 56N
-<esri102156> +proj=utm +zone=56 +ellps=bessel +units=m  no_defs <>
-# Datum 73 Hayford Gauss IGeoE
-<esri102160> +proj=tmerc +lat_0=39.66666666666666 +lon_0=-8.131906111111112 +k=1.000000 +x_0=200180.598 +y_0=299913.01 +ellps=intl +units=m  no_defs <>
-# Datum 73 Hayford Gauss IPCC
-<esri102161> +proj=tmerc +lat_0=39.66666666666666 +lon_0=-8.131906111111112 +k=1.000000 +x_0=180.598 +y_0=-86.98999999999999 +ellps=intl +units=m  no_defs <>
-# Graciosa Base SW 1948 UTM Zone 26N
-<esri102162> +proj=utm +zone=26 +ellps=intl +units=m  no_defs <>
-# Lisboa Bessel Bonne
-<esri102163> +ellps=bessel +units=m  no_defs <>
-# Lisboa Hayford Gauss IGeoE
-<esri102164> +proj=tmerc +lat_0=39.66666666666666 +lon_0=-8.131906111111112 +k=1.000000 +x_0=200000 +y_0=300000 +ellps=intl +units=m  no_defs <>
-# Lisboa Hayford Gauss IPCC
-<esri102165> +proj=tmerc +lat_0=39.66666666666666 +lon_0=-8.131906111111112 +k=1.000000 +x_0=0 +y_0=0 +ellps=intl +units=m  no_defs <>
-# Observ Meteorologico 1939 UTM Zone 25N
-<esri102166> +proj=utm +zone=25 +ellps=intl +units=m  no_defs <>
-# Porto Santo 1936 UTM Zone 28N
-<esri102167> +proj=utm +zone=28 +ellps=intl +units=m  no_defs <>
-# Sao Braz UTM Zone 26N
-<esri102168> +proj=utm +zone=26 +ellps=intl +units=m  no_defs <>
-# Selvagem Grande 1938 UTM Zone 28N
-<esri102169> +proj=utm +zone=28 +ellps=intl +units=m  no_defs <>
-# Nord Maroc Degree
-<esri102191> +proj=lcc +lat_1=33.3 +lat_0=33.3 +lon_0=-5.4 +k_0=0.999625769 +x_0=500000 +y_0=300000 +a=6378249.2 +b=6356514.999904194 +units=m  no_defs <>
-# Sud Maroc Degree
-<esri102192> +proj=lcc +lat_1=29.7 +lat_0=29.7 +lon_0=-5.4 +k_0=0.9996155960000001 +x_0=500000 +y_0=300000 +a=6378249.2 +b=6356514.999904194 +units=m  no_defs <>
-# Sahara Degree
-<esri102193> +proj=lcc +lat_1=26.1 +lat_0=26.1 +lon_0=-5.4 +k_0=0.9996 +x_0=1200000 +y_0=400000 +a=6378249.2 +b=6356514.999904194 +units=m  no_defs <>
-# NAD 1983 HARN StatePlane Alabama East FIPS 0101
-<esri102229> +proj=tmerc +lat_0=30.5 +lon_0=-85.83333333333333 +k=0.999960 +x_0=200000 +y_0=0 +ellps=GRS80 +units=m  no_defs <>
-# NAD 1983 HARN StatePlane Alabama West FIPS 0102
-<esri102230> +proj=tmerc +lat_0=30 +lon_0=-87.5 +k=0.999933 +x_0=600000 +y_0=0 +ellps=GRS80 +units=m  no_defs <>
-# NAD 1983 HARN StatePlane California I FIPS 0401
-<esri102241> +proj=lcc +lat_1=40 +lat_2=41.66666666666666 +lat_0=39.33333333333334 +lon_0=-122 +x_0=2000000 +y_0=500000 +ellps=GRS80 +units=m  no_defs <>
-# NAD 1983 HARN StatePlane California II FIPS 0402
-<esri102242> +proj=lcc +lat_1=38.33333333333334 +lat_2=39.83333333333334 +lat_0=37.66666666666666 +lon_0=-122 +x_0=2000000 +y_0=500000 +ellps=GRS80 +units=m  no_defs <>
-# NAD 1983 HARN StatePlane California III FIPS 0403
-<esri102243> +proj=lcc +lat_1=37.06666666666667 +lat_2=38.43333333333333 +lat_0=36.5 +lon_0=-120.5 +x_0=2000000 +y_0=500000 +ellps=GRS80 +units=m  no_defs <>
-# NAD 1983 HARN StatePlane California IV FIPS 0404
-<esri102244> +proj=lcc +lat_1=36 +lat_2=37.25 +lat_0=35.33333333333334 +lon_0=-119 +x_0=2000000 +y_0=500000 +ellps=GRS80 +units=m  no_defs <>
-# NAD 1983 HARN StatePlane California V FIPS 0405
-<esri102245> +proj=lcc +lat_1=34.03333333333333 +lat_2=35.46666666666667 +lat_0=33.5 +lon_0=-118 +x_0=2000000 +y_0=500000 +ellps=GRS80 +units=m  no_defs <>
-# NAD 1983 HARN StatePlane California VI FIPS 0406
-<esri102246> +proj=lcc +lat_1=32.78333333333333 +lat_2=33.88333333333333 +lat_0=32.16666666666666 +lon_0=-116.25 +x_0=2000000 +y_0=500000 +ellps=GRS80 +units=m  no_defs <>
-# NAD 1983 HARN StatePlane Arizona East FIPS 0201
-<esri102248> +proj=tmerc +lat_0=31 +lon_0=-110.1666666666667 +k=0.999900 +x_0=213360 +y_0=0 +ellps=GRS80 +units=m  no_defs <>
-# NAD 1983 HARN StatePlane Arizona Central FIPS 0202
-<esri102249> +proj=tmerc +lat_0=31 +lon_0=-111.9166666666667 +k=0.999900 +x_0=213360 +y_0=0 +ellps=GRS80 +units=m  no_defs <>
-# NAD 1983 HARN StatePlane Arizona West FIPS 0203
-<esri102250> +proj=tmerc +lat_0=31 +lon_0=-113.75 +k=0.999933 +x_0=213360 +y_0=0 +ellps=GRS80 +units=m  no_defs <>
-# NAD 1983 HARN StatePlane Arkansas North FIPS 0301
-<esri102251> +proj=lcc +lat_1=34.93333333333333 +lat_2=36.23333333333333 +lat_0=34.33333333333334 +lon_0=-92 +x_0=400000 +y_0=0 +ellps=GRS80 +units=m  no_defs <>
-# NAD 1983 HARN StatePlane Arkansas South FIPS 0302
-<esri102252> +proj=lcc +lat_1=33.3 +lat_2=34.76666666666667 +lat_0=32.66666666666666 +lon_0=-92 +x_0=400000 +y_0=400000 +ellps=GRS80 +units=m  no_defs <>
-# NAD 1983 HARN StatePlane Colorado North FIPS 0501
-<esri102253> +proj=lcc +lat_1=39.71666666666667 +lat_2=40.78333333333333 +lat_0=39.33333333333334 +lon_0=-105.5 +x_0=914401.8289 +y_0=304800.6096 +ellps=GRS80 +units=m  no_defs <>
-# NAD 1983 HARN StatePlane Colorado Central FIPS 0502
-<esri102254> +proj=lcc +lat_1=38.45 +lat_2=39.75 +lat_0=37.83333333333334 +lon_0=-105.5 +x_0=914401.8289 +y_0=304800.6096 +ellps=GRS80 +units=m  no_defs <>
-# NAD 1983 HARN StatePlane Colorado South FIPS 0503
-<esri102255> +proj=lcc +lat_1=37.23333333333333 +lat_2=38.43333333333333 +lat_0=36.66666666666666 +lon_0=-105.5 +x_0=914401.8289 +y_0=304800.6096 +ellps=GRS80 +units=m  no_defs <>
-# NAD 1983 HARN StatePlane Connecticut FIPS 0600
-<esri102256> +proj=lcc +lat_1=41.2 +lat_2=41.86666666666667 +lat_0=40.83333333333334 +lon_0=-72.75 +x_0=304800.6096 +y_0=152400.3048 +ellps=GRS80 +units=m  no_defs <>
-# NAD 1983 HARN StatePlane Delaware FIPS 0700
-<esri102257> +proj=tmerc +lat_0=38 +lon_0=-75.41666666666667 +k=0.999995 +x_0=200000 +y_0=0 +ellps=GRS80 +units=m  no_defs <>
-# NAD 1983 HARN StatePlane Florida East FIPS 0901
-<esri102258> +proj=tmerc +lat_0=24.33333333333333 +lon_0=-81 +k=0.999941 +x_0=200000 +y_0=0 +ellps=GRS80 +units=m  no_defs <>
-# NAD 1983 HARN StatePlane Florida West FIPS 0902
-<esri102259> +proj=tmerc +lat_0=24.33333333333333 +lon_0=-82 +k=0.999941 +x_0=200000 +y_0=0 +ellps=GRS80 +units=m  no_defs <>
-# NAD 1983 HARN StatePlane Florida North FIPS 0903
-<esri102260> +proj=lcc +lat_1=29.58333333333333 +lat_2=30.75 +lat_0=29 +lon_0=-84.5 +x_0=600000 +y_0=0 +ellps=GRS80 +units=m  no_defs <>
-# NAD 1983 HARN StatePlane Hawaii 1 FIPS 5101
-<esri102261> +proj=tmerc +lat_0=18.83333333333333 +lon_0=-155.5 +k=0.999967 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m  no_defs <>
-# NAD 1983 HARN StatePlane Hawaii 2 FIPS 5102
-<esri102262> +proj=tmerc +lat_0=20.33333333333333 +lon_0=-156.6666666666667 +k=0.999967 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m  no_defs <>
-# NAD 1983 HARN StatePlane Hawaii 3 FIPS 5103
-<esri102263> +proj=tmerc +lat_0=21.16666666666667 +lon_0=-158 +k=0.999990 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m  no_defs <>
-# NAD 1983 HARN StatePlane Hawaii 4 FIPS 5104
-<esri102264> +proj=tmerc +lat_0=21.83333333333333 +lon_0=-159.5 +k=0.999990 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m  no_defs <>
-# NAD 1983 HARN StatePlane Hawaii 5 FIPS 5105
-<esri102265> +proj=tmerc +lat_0=21.66666666666667 +lon_0=-160.1666666666667 +k=1.000000 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m  no_defs <>
-# NAD 1983 HARN StatePlane Georgia East FIPS 1001
-<esri102266> +proj=tmerc +lat_0=30 +lon_0=-82.16666666666667 +k=0.999900 +x_0=200000 +y_0=0 +ellps=GRS80 +units=m  no_defs <>
-# NAD 1983 HARN StatePlane Georgia West FIPS 1002
-<esri102267> +proj=tmerc +lat_0=30 +lon_0=-84.16666666666667 +k=0.999900 +x_0=700000 +y_0=0 +ellps=GRS80 +units=m  no_defs <>
-# NAD 1983 HARN StatePlane Idaho East FIPS 1101
-<esri102268> +proj=tmerc +lat_0=41.66666666666666 +lon_0=-112.1666666666667 +k=0.999947 +x_0=200000 +y_0=0 +ellps=GRS80 +units=m  no_defs <>
-# NAD 1983 HARN StatePlane Idaho Central FIPS 1102
-<esri102269> +proj=tmerc +lat_0=41.66666666666666 +lon_0=-114 +k=0.999947 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m  no_defs <>
-# NAD 1983 HARN StatePlane Idaho West FIPS 1103
-<esri102270> +proj=tmerc +lat_0=41.66666666666666 +lon_0=-115.75 +k=0.999933 +x_0=800000 +y_0=0 +ellps=GRS80 +units=m  no_defs <>
-# NAD 1983 HARN StatePlane Illinois East FIPS 1201
-<esri102271> +proj=tmerc +lat_0=36.66666666666666 +lon_0=-88.33333333333333 +k=0.999975 +x_0=300000 +y_0=0 +ellps=GRS80 +units=m  no_defs <>
-# NAD 1983 HARN StatePlane Illinois West FIPS 1202
-<esri102272> +proj=tmerc +lat_0=36.66666666666666 +lon_0=-90.16666666666667 +k=0.999941 +x_0=700000 +y_0=0 +ellps=GRS80 +units=m  no_defs <>
-# NAD 1983 HARN StatePlane Indiana East FIPS 1301
-<esri102273> +proj=tmerc +lat_0=37.5 +lon_0=-85.66666666666667 +k=0.999967 +x_0=100000 +y_0=250000 +ellps=GRS80 +units=m  no_defs <>
-# NAD 1983 HARN StatePlane Indiana West FIPS 1302
-<esri102274> +proj=tmerc +lat_0=37.5 +lon_0=-87.08333333333333 +k=0.999967 +x_0=900000 +y_0=250000 +ellps=GRS80 +units=m  no_defs <>
-# NAD 1983 HARN StatePlane Kansas North FIPS 1501
-<esri102277> +proj=lcc +lat_1=38.71666666666667 +lat_2=39.78333333333333 +lat_0=38.33333333333334 +lon_0=-98 +x_0=400000 +y_0=0 +ellps=GRS80 +units=m  no_defs <>
-# NAD 1983 HARN StatePlane Kansas South FIPS 1502
-<esri102278> +proj=lcc +lat_1=37.26666666666667 +lat_2=38.56666666666667 +lat_0=36.66666666666666 +lon_0=-98.5 +x_0=400000 +y_0=400000 +ellps=GRS80 +units=m  no_defs <>
-# NAD 1983 HARN StatePlane Kentucky North FIPS 1601
-<esri102279> +proj=lcc +lat_1=37.96666666666667 +lat_2=38.96666666666667 +lat_0=37.5 +lon_0=-84.25 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m  no_defs <>
-# NAD 1983 HARN StatePlane Kentucky South FIPS 1602
-<esri102280> +proj=lcc +lat_1=36.73333333333333 +lat_2=37.93333333333333 +lat_0=36.33333333333334 +lon_0=-85.75 +x_0=500000 +y_0=500000 +ellps=GRS80 +units=m  no_defs <>
-# NAD 1983 HARN StatePlane Louisiana North FIPS 1701
-<esri102281> +proj=lcc +lat_1=31.16666666666667 +lat_2=32.66666666666666 +lat_0=30.5 +lon_0=-92.5 +x_0=1000000 +y_0=0 +ellps=GRS80 +units=m  no_defs <>
-# NAD 1983 HARN StatePlane Louisiana South FIPS 1702
-<esri102282> +proj=lcc +lat_1=29.3 +lat_2=30.7 +lat_0=28.5 +lon_0=-91.33333333333333 +x_0=1000000 +y_0=0 +ellps=GRS80 +units=m  no_defs <>
-# NAD 1983 HARN StatePlane Maine East FIPS 1801
-<esri102283> +proj=tmerc +lat_0=43.66666666666666 +lon_0=-68.5 +k=0.999900 +x_0=300000 +y_0=0 +ellps=GRS80 +units=m  no_defs <>
-# NAD 1983 HARN StatePlane Maine West FIPS 1802
-<esri102284> +proj=tmerc +lat_0=42.83333333333334 +lon_0=-70.16666666666667 +k=0.999967 +x_0=900000 +y_0=0 +ellps=GRS80 +units=m  no_defs <>
-# NAD 1983 HARN StatePlane Maryland FIPS 1900
-<esri102285> +proj=lcc +lat_1=38.3 +lat_2=39.45 +lat_0=37.66666666666666 +lon_0=-77 +x_0=400000 +y_0=0 +ellps=GRS80 +units=m  no_defs <>
-# NAD 1983 HARN StatePlane Massachusetts Mainland FIPS 2001
-<esri102286> +proj=lcc +lat_1=41.71666666666667 +lat_2=42.68333333333333 +lat_0=41 +lon_0=-71.5 +x_0=200000 +y_0=750000 +ellps=GRS80 +units=m  no_defs <>
-# NAD 1983 HARN StatePlane Massachusetts Island FIPS 2002
-<esri102287> +proj=lcc +lat_1=41.28333333333333 +lat_2=41.48333333333333 +lat_0=41 +lon_0=-70.5 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m  no_defs <>
-# NAD 1983 HARN StatePlane Michigan North FIPS 2111
-<esri102288> +proj=lcc +lat_1=45.48333333333333 +lat_2=47.08333333333334 +lat_0=44.78333333333333 +lon_0=-87 +x_0=8000000 +y_0=0 +ellps=GRS80 +units=m  no_defs <>
-# NAD 1983 HARN StatePlane Michigan Central FIPS 2112
-<esri102289> +proj=lcc +lat_1=44.18333333333333 +lat_2=45.7 +lat_0=43.31666666666667 +lon_0=-84.36666666666666 +x_0=6000000 +y_0=0 +ellps=GRS80 +units=m  no_defs <>
-# NAD 1983 HARN StatePlane Michigan South FIPS 2113
-<esri102290> +proj=lcc +lat_1=42.1 +lat_2=43.66666666666666 +lat_0=41.5 +lon_0=-84.36666666666666 +x_0=4000000 +y_0=0 +ellps=GRS80 +units=m  no_defs <>
-# NAD 1983 HARN StatePlane Minnesota North FIPS 2201
-<esri102291> +proj=lcc +lat_1=47.03333333333333 +lat_2=48.63333333333333 +lat_0=46.5 +lon_0=-93.09999999999999 +x_0=800000 +y_0=100000 +ellps=GRS80 +units=m  no_defs <>
-# NAD 1983 HARN StatePlane Minnesota Central FIPS 2202
-<esri102292> +proj=lcc +lat_1=45.61666666666667 +lat_2=47.05 +lat_0=45 +lon_0=-94.25 +x_0=800000 +y_0=100000 +ellps=GRS80 +units=m  no_defs <>
-# NAD 1983 HARN StatePlane Minnesota South FIPS 2203
-<esri102293> +proj=lcc +lat_1=43.78333333333333 +lat_2=45.21666666666667 +lat_0=43 +lon_0=-94 +x_0=800000 +y_0=100000 +ellps=GRS80 +units=m  no_defs <>
-# NAD 1983 HARN StatePlane Mississippi East FIPS 2301
-<esri102294> +proj=tmerc +lat_0=29.5 +lon_0=-88.83333333333333 +k=0.999950 +x_0=300000 +y_0=0 +ellps=GRS80 +units=m  no_defs <>
-# NAD 1983 HARN StatePlane Mississippi West FIPS 2302
-<esri102295> +proj=tmerc +lat_0=29.5 +lon_0=-90.33333333333333 +k=0.999950 +x_0=700000 +y_0=0 +ellps=GRS80 +units=m  no_defs <>
-# NAD 1983 HARN StatePlane Missouri East FIPS 2401
-<esri102296> +proj=tmerc +lat_0=35.83333333333334 +lon_0=-90.5 +k=0.999933 +x_0=250000 +y_0=0 +ellps=GRS80 +units=m  no_defs <>
-# NAD 1983 HARN StatePlane Missouri Central FIPS 2402
-<esri102297> +proj=tmerc +lat_0=35.83333333333334 +lon_0=-92.5 +k=0.999933 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m  no_defs <>
-# NAD 1983 HARN StatePlane Missouri West FIPS 2403
-<esri102298> +proj=tmerc +lat_0=36.16666666666666 +lon_0=-94.5 +k=0.999941 +x_0=850000 +y_0=0 +ellps=GRS80 +units=m  no_defs <>
-# NAD 1983 HARN StatePlane Montana FIPS 2500
-<esri102300> +proj=lcc +lat_1=45 +lat_2=49 +lat_0=44.25 +lon_0=-109.5 +x_0=600000 +y_0=0 +ellps=GRS80 +units=m  no_defs <>
-# NAD 1983 HARN StatePlane Nebraska FIPS 2600
-<esri102304> +proj=lcc +lat_1=40 +lat_2=43 +lat_0=39.83333333333334 +lon_0=-100 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m  no_defs <>
-# NAD 1983 HARN StatePlane Nevada East FIPS 2701
-<esri102307> +proj=tmerc +lat_0=34.75 +lon_0=-115.5833333333333 +k=0.999900 +x_0=200000 +y_0=8000000 +ellps=GRS80 +units=m  no_defs <>
-# NAD 1983 HARN StatePlane Nevada Central FIPS 2702
-<esri102308> +proj=tmerc +lat_0=34.75 +lon_0=-116.6666666666667 +k=0.999900 +x_0=500000 +y_0=6000000 +ellps=GRS80 +units=m  no_defs <>
-# NAD 1983 HARN StatePlane Nevada West FIPS 2703
-<esri102309> +proj=tmerc +lat_0=34.75 +lon_0=-118.5833333333333 +k=0.999900 +x_0=800000 +y_0=4000000 +ellps=GRS80 +units=m  no_defs <>
-# NAD 1983 HARN StatePlane New Hampshire FIPS 2800
-<esri102310> +proj=tmerc +lat_0=42.5 +lon_0=-71.66666666666667 +k=0.999967 +x_0=300000 +y_0=0 +ellps=GRS80 +units=m  no_defs <>
-# NAD 1983 HARN StatePlane New Jersey FIPS 2900
-<esri102311> +proj=tmerc +lat_0=38.83333333333334 +lon_0=-74.5 +k=0.999900 +x_0=150000 +y_0=0 +ellps=GRS80 +units=m  no_defs <>
-# NAD 1983 HARN StatePlane New Mexico East FIPS 3001
-<esri102312> +proj=tmerc +lat_0=31 +lon_0=-104.3333333333333 +k=0.999909 +x_0=165000 +y_0=0 +ellps=GRS80 +units=m  no_defs <>
-# NAD 1983 HARN StatePlane New Mexico Central FIPS 3002
-<esri102313> +proj=tmerc +lat_0=31 +lon_0=-106.25 +k=0.999900 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m  no_defs <>
-# NAD 1983 HARN StatePlane New Mexico West FIPS 3003
-<esri102314> +proj=tmerc +lat_0=31 +lon_0=-107.8333333333333 +k=0.999917 +x_0=830000 +y_0=0 +ellps=GRS80 +units=m  no_defs <>
-# NAD 1983 HARN StatePlane New York East FIPS 3101
-<esri102315> +proj=tmerc +lat_0=38.83333333333334 +lon_0=-74.5 +k=0.999900 +x_0=150000 +y_0=0 +ellps=GRS80 +units=m  no_defs <>
-# NAD 1983 HARN StatePlane New York Central FIPS 3102
-<esri102316> +proj=tmerc +lat_0=40 +lon_0=-76.58333333333333 +k=0.999938 +x_0=250000 +y_0=0 +ellps=GRS80 +units=m  no_defs <>
-# NAD 1983 HARN StatePlane New York West FIPS 3103
-<esri102317> +proj=tmerc +lat_0=40 +lon_0=-78.58333333333333 +k=0.999938 +x_0=350000 +y_0=0 +ellps=GRS80 +units=m  no_defs <>
-# NAD 1983 HARN StatePlane New York Long Island FIPS 3104
-<esri102318> +proj=lcc +lat_1=40.66666666666666 +lat_2=41.03333333333333 +lat_0=40.16666666666666 +lon_0=-74 +x_0=300000 +y_0=0 +ellps=GRS80 +units=m  no_defs <>
-# NAD 1983 HARN StatePlane North Dakota North FIPS 3301
-<esri102320> +proj=lcc +lat_1=47.43333333333333 +lat_2=48.73333333333333 +lat_0=47 +lon_0=-100.5 +x_0=600000 +y_0=0 +ellps=GRS80 +units=m  no_defs <>
-# NAD 1983 HARN StatePlane North Dakota South FIPS 3302
-<esri102321> +proj=lcc +lat_1=46.18333333333333 +lat_2=47.48333333333333 +lat_0=45.66666666666666 +lon_0=-100.5 +x_0=600000 +y_0=0 +ellps=GRS80 +units=m  no_defs <>
-# NAD 1983 HARN StatePlane Ohio North FIPS 3401
-<esri102322> +proj=lcc +lat_1=40.43333333333333 +lat_2=41.7 +lat_0=39.66666666666666 +lon_0=-82.5 +x_0=600000 +y_0=0 +ellps=GRS80 +units=m  no_defs <>
-# NAD 1983 HARN StatePlane Ohio South FIPS 3402
-<esri102323> +proj=lcc +lat_1=38.73333333333333 +lat_2=40.03333333333333 +lat_0=38 +lon_0=-82.5 +x_0=600000 +y_0=0 +ellps=GRS80 +units=m  no_defs <>
-# NAD 1983 HARN StatePlane Oklahoma North FIPS 3501
-<esri102324> +proj=lcc +lat_1=35.56666666666667 +lat_2=36.76666666666667 +lat_0=35 +lon_0=-98 +x_0=600000 +y_0=0 +ellps=GRS80 +units=m  no_defs <>
-# NAD 1983 HARN StatePlane Oklahoma South FIPS 3502
-<esri102325> +proj=lcc +lat_1=33.93333333333333 +lat_2=35.23333333333333 +lat_0=33.33333333333334 +lon_0=-98 +x_0=600000 +y_0=0 +ellps=GRS80 +units=m  no_defs <>
-# NAD 1983 HARN StatePlane Oregon North FIPS 3601
-<esri102326> +proj=lcc +lat_1=44.33333333333334 +lat_2=46 +lat_0=43.66666666666666 +lon_0=-120.5 +x_0=2500000 +y_0=0 +ellps=GRS80 +units=m  no_defs <>
-# NAD 1983 HARN StatePlane Oregon South FIPS 3602
-<esri102327> +proj=lcc +lat_1=42.33333333333334 +lat_2=44 +lat_0=41.66666666666666 +lon_0=-120.5 +x_0=1500000 +y_0=0 +ellps=GRS80 +units=m  no_defs <>
-# NAD 1983 HARN StatePlane Rhode Island FIPS 3800
-<esri102330> +proj=tmerc +lat_0=41.08333333333334 +lon_0=-71.5 +k=0.999994 +x_0=100000 +y_0=0 +ellps=GRS80 +units=m  no_defs <>
-# NAD 1983 HARN StatePlane South Dakota North FIPS 4001
-<esri102334> +proj=lcc +lat_1=44.41666666666666 +lat_2=45.68333333333333 +lat_0=43.83333333333334 +lon_0=-100 +x_0=600000 +y_0=0 +ellps=GRS80 +units=m  no_defs <>
-# NAD 1983 HARN StatePlane South Dakota South FIPS 4002
-<esri102335> +proj=lcc +lat_1=42.83333333333334 +lat_2=44.4 +lat_0=42.33333333333334 +lon_0=-100.3333333333333 +x_0=600000 +y_0=0 +ellps=GRS80 +units=m  no_defs <>
-# NAD 1983 HARN StatePlane Tennessee FIPS 4100
-<esri102336> +proj=lcc +lat_1=35.25 +lat_2=36.41666666666666 +lat_0=34.33333333333334 +lon_0=-86 +x_0=600000 +y_0=0 +ellps=GRS80 +units=m  no_defs <>
-# NAD 1983 HARN StatePlane Texas North FIPS 4201
-<esri102337> +proj=lcc +lat_1=34.65 +lat_2=36.18333333333333 +lat_0=34 +lon_0=-101.5 +x_0=200000 +y_0=1000000 +ellps=GRS80 +units=m  no_defs <>
-# NAD 1983 HARN StatePlane Texas North Central FIPS 4202
-<esri102338> +proj=lcc +lat_1=32.13333333333333 +lat_2=33.96666666666667 +lat_0=31.66666666666667 +lon_0=-98.5 +x_0=600000 +y_0=2000000 +ellps=GRS80 +units=m  no_defs <>
-# NAD 1983 HARN StatePlane Texas Central FIPS 4203
-<esri102339> +proj=lcc +lat_1=30.11666666666667 +lat_2=31.88333333333333 +lat_0=29.66666666666667 +lon_0=-100.3333333333333 +x_0=700000 +y_0=3000000 +ellps=GRS80 +units=m  no_defs <>
-# NAD 1983 HARN StatePlane Texas South Central FIPS 4204
-<esri102340> +proj=lcc +lat_1=28.38333333333333 +lat_2=30.28333333333334 +lat_0=27.83333333333333 +lon_0=-99 +x_0=600000 +y_0=4000000 +ellps=GRS80 +units=m  no_defs <>
-# NAD 1983 HARN StatePlane Texas South FIPS 4205
-<esri102341> +proj=lcc +lat_1=26.16666666666667 +lat_2=27.83333333333333 +lat_0=25.66666666666667 +lon_0=-98.5 +x_0=300000 +y_0=5000000 +ellps=GRS80 +units=m  no_defs <>
-# NAD 1983 HARN StatePlane Utah North FIPS 4301
-<esri102342> +proj=lcc +lat_1=40.71666666666667 +lat_2=41.78333333333333 +lat_0=40.33333333333334 +lon_0=-111.5 +x_0=500000 +y_0=1000000 +ellps=GRS80 +units=m  no_defs <>
-# NAD 1983 HARN StatePlane Utah Central FIPS 4302
-<esri102343> +proj=lcc +lat_1=39.01666666666667 +lat_2=40.65 +lat_0=38.33333333333334 +lon_0=-111.5 +x_0=500000 +y_0=2000000 +ellps=GRS80 +units=m  no_defs <>
-# NAD 1983 HARN StatePlane Utah South FIPS 4303
-<esri102344> +proj=lcc +lat_1=37.21666666666667 +lat_2=38.35 +lat_0=36.66666666666666 +lon_0=-111.5 +x_0=500000 +y_0=3000000 +ellps=GRS80 +units=m  no_defs <>
-# NAD 1983 HARN StatePlane Vermont FIPS 4400
-<esri102345> +proj=tmerc +lat_0=42.5 +lon_0=-72.5 +k=0.999964 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m  no_defs <>
-# NAD 1983 HARN StatePlane Virginia North FIPS 4501
-<esri102346> +proj=lcc +lat_1=38.03333333333333 +lat_2=39.2 +lat_0=37.66666666666666 +lon_0=-78.5 +x_0=3500000 +y_0=2000000 +ellps=GRS80 +units=m  no_defs <>
-# NAD 1983 HARN StatePlane Virginia South FIPS 4502
-<esri102347> +proj=lcc +lat_1=36.76666666666667 +lat_2=37.96666666666667 +lat_0=36.33333333333334 +lon_0=-78.5 +x_0=3500000 +y_0=1000000 +ellps=GRS80 +units=m  no_defs <>
-# NAD 1983 HARN StatePlane Washington North FIPS 4601
-<esri102348> +proj=lcc +lat_1=47.5 +lat_2=48.73333333333333 +lat_0=47 +lon_0=-120.8333333333333 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m  no_defs <>
-# NAD 1983 HARN StatePlane Washington South FIPS 4602
-<esri102349> +proj=lcc +lat_1=45.83333333333334 +lat_2=47.33333333333334 +lat_0=45.33333333333334 +lon_0=-120.5 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m  no_defs <>
-# NAD 1983 HARN StatePlane West Virginia North FIPS 4701
-<esri102350> +proj=lcc +lat_1=39 +lat_2=40.25 +lat_0=38.5 +lon_0=-79.5 +x_0=600000 +y_0=0 +ellps=GRS80 +units=m  no_defs <>
-# NAD 1983 HARN StatePlane West Virginia South FIPS 4702
-<esri102351> +proj=lcc +lat_1=37.48333333333333 +lat_2=38.88333333333333 +lat_0=37 +lon_0=-81 +x_0=600000 +y_0=0 +ellps=GRS80 +units=m  no_defs <>
-# NAD 1983 HARN StatePlane Wisconsin North FIPS 4801
-<esri102352> +proj=lcc +lat_1=45.56666666666667 +lat_2=46.76666666666667 +lat_0=45.16666666666666 +lon_0=-90 +x_0=600000 +y_0=0 +ellps=GRS80 +units=m  no_defs <>
-# NAD 1983 HARN StatePlane Wisconsin Central FIPS 4802
-<esri102353> +proj=lcc +lat_1=44.25 +lat_2=45.5 +lat_0=43.83333333333334 +lon_0=-90 +x_0=600000 +y_0=0 +ellps=GRS80 +units=m  no_defs <>
-# NAD 1983 HARN StatePlane Wisconsin South FIPS 4803
-<esri102354> +proj=lcc +lat_1=42.73333333333333 +lat_2=44.06666666666667 +lat_0=42 +lon_0=-90 +x_0=600000 +y_0=0 +ellps=GRS80 +units=m  no_defs <>
-# NAD 1983 HARN StatePlane Wyoming East FIPS 4901
-<esri102355> +proj=tmerc +lat_0=40.5 +lon_0=-105.1666666666667 +k=0.999938 +x_0=200000 +y_0=0 +ellps=GRS80 +units=m  no_defs <>
-# NAD 1983 HARN StatePlane Wyoming East Central FIPS 4902
-<esri102356> +proj=tmerc +lat_0=40.5 +lon_0=-107.3333333333333 +k=0.999938 +x_0=400000 +y_0=100000 +ellps=GRS80 +units=m  no_defs <>
-# NAD 1983 HARN StatePlane Wyoming West Central FIPS 4903
-<esri102357> +proj=tmerc +lat_0=40.5 +lon_0=-108.75 +k=0.999938 +x_0=600000 +y_0=0 +ellps=GRS80 +units=m  no_defs <>
-# NAD 1983 HARN StatePlane Wyoming West FIPS 4904
-<esri102358> +proj=tmerc +lat_0=40.5 +lon_0=-110.0833333333333 +k=0.999938 +x_0=800000 +y_0=100000 +ellps=GRS80 +units=m  no_defs <>
-# NAD 1983 HARN StatePlane Puerto Rico Virgin Islands FIPS 5200
-<esri102361> +proj=lcc +lat_1=18.03333333333334 +lat_2=18.43333333333333 +lat_0=17.83333333333333 +lon_0=-66.43333333333334 +x_0=200000 +y_0=200000 +ellps=GRS80 +units=m  no_defs <>
-# Nord Algerie Ancienne Degree
-<esri102491> +proj=lcc +lat_1=36 +lat_0=36 +lon_0=2.7 +k_0=0.999625544 +x_0=500000 +y_0=300000 +a=6378249.2 +b=6356514.999904194 +units=m  no_defs <>
-# Sud Algerie Ancienne Degree
-<esri102492> +proj=lcc +lat_1=33.3 +lat_0=33.3 +lon_0=2.7 +k_0=0.999625769 +x_0=500000 +y_0=300000 +a=6378249.2 +b=6356514.999904194 +units=m  no_defs <>
-# NTF France I degrees
-<esri102581> +proj=lcc +lat_1=49.5 +lat_0=49.5 +lon_0=2.337229166666667 +k_0=0.999877341 +x_0=600000 +y_0=1200000 +a=6378249.2 +b=6356514.999904194 +units=m  no_defs <>
-# NTF France II degrees
-<esri102582> +proj=lcc +lat_1=46.8 +lat_0=46.8 +lon_0=2.337229166666667 +k_0=0.99987742 +x_0=600000 +y_0=2200000 +a=6378249.2 +b=6356514.999904194 +units=m  no_defs <>
-# NTF France III degrees
-<esri102583> +proj=lcc +lat_1=44.1 +lat_0=44.1 +lon_0=2.337229166666667 +k_0=0.999877499 +x_0=600000 +y_0=3200000 +a=6378249.2 +b=6356514.999904194 +units=m  no_defs <>
-# NTF France IV degrees
-<esri102584> +proj=lcc +lat_1=42.165 +lat_0=42.165 +lon_0=2.337229166666667 +k_0=0.99994471 +x_0=234.358 +y_0=4185861.369 +a=6378249.2 +b=6356514.999904194 +units=m  no_defs <>
-# Nord Algerie Degree
-<esri102591> +proj=lcc +lat_1=36 +lat_0=36 +lon_0=2.7 +k_0=0.999625544 +x_0=500135 +y_0=300090 +ellps=clrk80 +units=m  no_defs <>
-# Sud Algerie Degree
-<esri102592> +proj=lcc +lat_1=33.3 +lat_0=33.3 +lon_0=2.7 +k_0=0.999625769 +x_0=500135 +y_0=300090 +ellps=clrk80 +units=m  no_defs <>
-# NAD 1983 StatePlane Alabama East FIPS 0101 Feet
-<esri102629> +proj=tmerc +lat_0=30.5 +lon_0=-85.83333333333333 +k=0.999960 +x_0=200000 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane Alabama West FIPS 0102 Feet
-<esri102630> +proj=tmerc +lat_0=30 +lon_0=-87.5 +k=0.999933 +x_0=600000.0000000001 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane Alaska 1 FIPS 5001 Feet
-<esri102631> +proj=omerc +lat_0=57 +lonc=-133.6666666666667 +alpha=-36.86989764583333 +k=0.9999 +x_0=4999999.999999999 +y_0=-4999999.999999999 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane Alaska 2 FIPS 5002 Feet
-<esri102632> +proj=tmerc +lat_0=54 +lon_0=-142 +k=0.999900 +x_0=500000.0000000002 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane Alaska 3 FIPS 5003 Feet
-<esri102633> +proj=tmerc +lat_0=54 +lon_0=-146 +k=0.999900 +x_0=500000.0000000002 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane Alaska 4 FIPS 5004 Feet
-<esri102634> +proj=tmerc +lat_0=54 +lon_0=-150 +k=0.999900 +x_0=500000.0000000002 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane Alaska 5 FIPS 5005 Feet
-<esri102635> +proj=tmerc +lat_0=54 +lon_0=-154 +k=0.999900 +x_0=500000.0000000002 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane Alaska 6 FIPS 5006 Feet
-<esri102636> +proj=tmerc +lat_0=54 +lon_0=-158 +k=0.999900 +x_0=500000.0000000002 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane Alaska 7 FIPS 5007 Feet
-<esri102637> +proj=tmerc +lat_0=54 +lon_0=-162 +k=0.999900 +x_0=500000.0000000002 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane Alaska 8 FIPS 5008 Feet
-<esri102638> +proj=tmerc +lat_0=54 +lon_0=-166 +k=0.999900 +x_0=500000.0000000002 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane Alaska 9 FIPS 5009 Feet
-<esri102639> +proj=tmerc +lat_0=54 +lon_0=-170 +k=0.999900 +x_0=500000.0000000002 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane Alaska 10 FIPS 5010 Feet
-<esri102640> +proj=lcc +lat_1=51.83333333333334 +lat_2=53.83333333333334 +lat_0=51 +lon_0=-176 +x_0=1000000 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane California I FIPS 0401 Feet
-<esri102641> +proj=lcc +lat_1=40 +lat_2=41.66666666666666 +lat_0=39.33333333333334 +lon_0=-122 +x_0=2000000 +y_0=500000.0000000002 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane California II FIPS 0402 Feet
-<esri102642> +proj=lcc +lat_1=38.33333333333334 +lat_2=39.83333333333334 +lat_0=37.66666666666666 +lon_0=-122 +x_0=2000000 +y_0=500000.0000000002 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane California III FIPS 0403 Feet
-<esri102643> +proj=lcc +lat_1=37.06666666666667 +lat_2=38.43333333333333 +lat_0=36.5 +lon_0=-120.5 +x_0=2000000 +y_0=500000.0000000002 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane California IV FIPS 0404 Feet
-<esri102644> +proj=lcc +lat_1=36 +lat_2=37.25 +lat_0=35.33333333333334 +lon_0=-119 +x_0=2000000 +y_0=500000.0000000002 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane California V FIPS 0405 Feet
-<esri102645> +proj=lcc +lat_1=34.03333333333333 +lat_2=35.46666666666667 +lat_0=33.5 +lon_0=-118 +x_0=2000000 +y_0=500000.0000000002 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane California VI FIPS 0406 Feet
-<esri102646> +proj=lcc +lat_1=32.78333333333333 +lat_2=33.88333333333333 +lat_0=32.16666666666666 +lon_0=-116.25 +x_0=2000000 +y_0=500000.0000000002 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane Arizona East FIPS 0201 Feet
-<esri102648> +proj=tmerc +lat_0=31 +lon_0=-110.1666666666667 +k=0.999900 +x_0=213360 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane Arizona Central FIPS 0202 Feet
-<esri102649> +proj=tmerc +lat_0=31 +lon_0=-111.9166666666667 +k=0.999900 +x_0=213360 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane Arizona West FIPS 0203 Feet
-<esri102650> +proj=tmerc +lat_0=31 +lon_0=-113.75 +k=0.999933 +x_0=213360 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane Arkansas North FIPS 0301 Feet
-<esri102651> +proj=lcc +lat_1=34.93333333333333 +lat_2=36.23333333333333 +lat_0=34.33333333333334 +lon_0=-92 +x_0=399999.9999999999 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane Arkansas South FIPS 0302 Feet
-<esri102652> +proj=lcc +lat_1=33.3 +lat_2=34.76666666666667 +lat_0=32.66666666666666 +lon_0=-92 +x_0=399999.9999999999 +y_0=399999.9999999999 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane Colorado North FIPS 0501 Feet
-<esri102653> +proj=lcc +lat_1=39.71666666666667 +lat_2=40.78333333333333 +lat_0=39.33333333333334 +lon_0=-105.5 +x_0=914401.8289 +y_0=304800.6096 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane Colorado Central FIPS 0502 Feet
-<esri102654> +proj=lcc +lat_1=38.45 +lat_2=39.75 +lat_0=37.83333333333334 +lon_0=-105.5 +x_0=914401.8289 +y_0=304800.6096 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane Colorado South FIPS 0503 Feet
-<esri102655> +proj=lcc +lat_1=37.23333333333333 +lat_2=38.43333333333333 +lat_0=36.66666666666666 +lon_0=-105.5 +x_0=914401.8289 +y_0=304800.6096 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane Connecticut FIPS 0600 Feet
-<esri102656> +proj=lcc +lat_1=41.2 +lat_2=41.86666666666667 +lat_0=40.83333333333334 +lon_0=-72.75 +x_0=304800.6096 +y_0=152400.3048 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane Delaware FIPS 0700 Feet
-<esri102657> +proj=tmerc +lat_0=38 +lon_0=-75.41666666666667 +k=0.999995 +x_0=200000 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane Florida East FIPS 0901 Feet
-<esri102658> +proj=tmerc +lat_0=24.33333333333333 +lon_0=-81 +k=0.999941 +x_0=200000 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane Florida West FIPS 0902 Feet
-<esri102659> +proj=tmerc +lat_0=24.33333333333333 +lon_0=-82 +k=0.999941 +x_0=200000 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane Florida North FIPS 0903 Feet
-<esri102660> +proj=lcc +lat_1=29.58333333333333 +lat_2=30.75 +lat_0=29 +lon_0=-84.5 +x_0=600000.0000000001 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane Hawaii 1 FIPS 5101 Feet
-<esri102661> +proj=tmerc +lat_0=18.83333333333333 +lon_0=-155.5 +k=0.999967 +x_0=500000.0000000002 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane Hawaii 2 FIPS 5102 Feet
-<esri102662> +proj=tmerc +lat_0=20.33333333333333 +lon_0=-156.6666666666667 +k=0.999967 +x_0=500000.0000000002 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane Hawaii 3 FIPS 5103 Feet
-<esri102663> +proj=tmerc +lat_0=21.16666666666667 +lon_0=-158 +k=0.999990 +x_0=500000.0000000002 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane Hawaii 4 FIPS 5104 Feet
-<esri102664> +proj=tmerc +lat_0=21.83333333333333 +lon_0=-159.5 +k=0.999990 +x_0=500000.0000000002 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane Hawaii 5 FIPS 5105 Feet
-<esri102665> +proj=tmerc +lat_0=21.66666666666667 +lon_0=-160.1666666666667 +k=1.000000 +x_0=500000.0000000002 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane Georgia East FIPS 1001 Feet
-<esri102666> +proj=tmerc +lat_0=30 +lon_0=-82.16666666666667 +k=0.999900 +x_0=200000 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane Georgia West FIPS 1002 Feet
-<esri102667> +proj=tmerc +lat_0=30 +lon_0=-84.16666666666667 +k=0.999900 +x_0=700000 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane Idaho East FIPS 1101 Feet
-<esri102668> +proj=tmerc +lat_0=41.66666666666666 +lon_0=-112.1666666666667 +k=0.999947 +x_0=200000 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane Idaho Central FIPS 1102 Feet
-<esri102669> +proj=tmerc +lat_0=41.66666666666666 +lon_0=-114 +k=0.999947 +x_0=500000.0000000002 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane Idaho West FIPS 1103 Feet
-<esri102670> +proj=tmerc +lat_0=41.66666666666666 +lon_0=-115.75 +k=0.999933 +x_0=799999.9999999999 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane Illinois East FIPS 1201 Feet
-<esri102671> +proj=tmerc +lat_0=36.66666666666666 +lon_0=-88.33333333333333 +k=0.999975 +x_0=300000 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane Illinois West FIPS 1202 Feet
-<esri102672> +proj=tmerc +lat_0=36.66666666666666 +lon_0=-90.16666666666667 +k=0.999941 +x_0=700000 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane Indiana East FIPS 1301 Feet
-<esri102673> +proj=tmerc +lat_0=37.5 +lon_0=-85.66666666666667 +k=0.999967 +x_0=100000 +y_0=250000 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane Indiana West FIPS 1302 Feet
-<esri102674> +proj=tmerc +lat_0=37.5 +lon_0=-87.08333333333333 +k=0.999967 +x_0=900000.0000000001 +y_0=250000 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane Iowa North FIPS 1401 Feet
-<esri102675> +proj=lcc +lat_1=42.06666666666667 +lat_2=43.26666666666667 +lat_0=41.5 +lon_0=-93.5 +x_0=1500000 +y_0=1000000 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane Iowa South FIPS 1402 Feet
-<esri102676> +proj=lcc +lat_1=40.61666666666667 +lat_2=41.78333333333333 +lat_0=40 +lon_0=-93.5 +x_0=500000.0000000002 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane Kansas North FIPS 1501 Feet
-<esri102677> +proj=lcc +lat_1=38.71666666666667 +lat_2=39.78333333333333 +lat_0=38.33333333333334 +lon_0=-98 +x_0=399999.9999999999 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane Kansas South FIPS 1502 Feet
-<esri102678> +proj=lcc +lat_1=37.26666666666667 +lat_2=38.56666666666667 +lat_0=36.66666666666666 +lon_0=-98.5 +x_0=399999.9999999999 +y_0=399999.9999999999 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane Kentucky North FIPS 1601 Feet
-<esri102679> +proj=lcc +lat_1=37.96666666666667 +lat_2=38.96666666666667 +lat_0=37.5 +lon_0=-84.25 +x_0=500000.0000000002 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane Kentucky South FIPS 1602 Feet
-<esri102680> +proj=lcc +lat_1=36.73333333333333 +lat_2=37.93333333333333 +lat_0=36.33333333333334 +lon_0=-85.75 +x_0=500000.0000000002 +y_0=500000.0000000002 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane Louisiana North FIPS 1701 Feet
-<esri102681> +proj=lcc +lat_1=31.16666666666667 +lat_2=32.66666666666666 +lat_0=30.5 +lon_0=-92.5 +x_0=1000000 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane Louisiana South FIPS 1702 Feet
-<esri102682> +proj=lcc +lat_1=29.3 +lat_2=30.7 +lat_0=28.5 +lon_0=-91.33333333333333 +x_0=1000000 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane Maine East FIPS 1801 Feet
-<esri102683> +proj=tmerc +lat_0=43.66666666666666 +lon_0=-68.5 +k=0.999900 +x_0=300000 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane Maine West FIPS 1802 Feet
-<esri102684> +proj=tmerc +lat_0=42.83333333333334 +lon_0=-70.16666666666667 +k=0.999967 +x_0=900000.0000000001 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane Maryland FIPS 1900 Feet
-<esri102685> +proj=lcc +lat_1=38.3 +lat_2=39.45 +lat_0=37.66666666666666 +lon_0=-77 +x_0=399999.9999999999 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane Massachusetts Mainland FIPS 2001 Feet
-<esri102686> +proj=lcc +lat_1=41.71666666666667 +lat_2=42.68333333333333 +lat_0=41 +lon_0=-71.5 +x_0=200000 +y_0=750000.0000000001 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane Massachusetts Island FIPS 2002 Feet
-<esri102687> +proj=lcc +lat_1=41.28333333333333 +lat_2=41.48333333333333 +lat_0=41 +lon_0=-70.5 +x_0=500000.0000000002 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane Michigan North FIPS 2111 Feet
-<esri102688> +proj=lcc +lat_1=45.48333333333333 +lat_2=47.08333333333334 +lat_0=44.78333333333333 +lon_0=-87 +x_0=7999999.999999999 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane Michigan Central FIPS 2112 Feet
-<esri102689> +proj=lcc +lat_1=44.18333333333333 +lat_2=45.7 +lat_0=43.31666666666667 +lon_0=-84.36666666666666 +x_0=6000000.000000001 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane Michigan South FIPS 2113 Feet
-<esri102690> +proj=lcc +lat_1=42.1 +lat_2=43.66666666666666 +lat_0=41.5 +lon_0=-84.36666666666666 +x_0=4000000 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane Minnesota North FIPS 2201 Feet
-<esri102691> +proj=lcc +lat_1=47.03333333333333 +lat_2=48.63333333333333 +lat_0=46.5 +lon_0=-93.09999999999999 +x_0=799999.9999999999 +y_0=100000 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane Minnesota Central FIPS 2202 Feet
-<esri102692> +proj=lcc +lat_1=45.61666666666667 +lat_2=47.05 +lat_0=45 +lon_0=-94.25 +x_0=799999.9999999999 +y_0=100000 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane Minnesota South FIPS 2203 Feet
-<esri102693> +proj=lcc +lat_1=43.78333333333333 +lat_2=45.21666666666667 +lat_0=43 +lon_0=-94 +x_0=799999.9999999999 +y_0=100000 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane Mississippi East FIPS 2301 Feet
-<esri102694> +proj=tmerc +lat_0=29.5 +lon_0=-88.83333333333333 +k=0.999950 +x_0=300000 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane Mississippi West FIPS 2302 Feet
-<esri102695> +proj=tmerc +lat_0=29.5 +lon_0=-90.33333333333333 +k=0.999950 +x_0=700000 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane Missouri East FIPS 2401 Feet
-<esri102696> +proj=tmerc +lat_0=35.83333333333334 +lon_0=-90.5 +k=0.999933 +x_0=250000 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane Missouri Central FIPS 2402 Feet
-<esri102697> +proj=tmerc +lat_0=35.83333333333334 +lon_0=-92.5 +k=0.999933 +x_0=500000.0000000002 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane Missouri West FIPS 2403 Feet
-<esri102698> +proj=tmerc +lat_0=36.16666666666666 +lon_0=-94.5 +k=0.999941 +x_0=850000 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane Montana FIPS 2500 Feet
-<esri102700> +proj=lcc +lat_1=45 +lat_2=49 +lat_0=44.25 +lon_0=-109.5 +x_0=600000.0000000001 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane Nebraska FIPS 2600 Feet
-<esri102704> +proj=lcc +lat_1=40 +lat_2=43 +lat_0=39.83333333333334 +lon_0=-100 +x_0=500000.0000000002 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane Nevada East FIPS 2701 Feet
-<esri102707> +proj=tmerc +lat_0=34.75 +lon_0=-115.5833333333333 +k=0.999900 +x_0=200000 +y_0=7999999.999999999 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane Nevada Central FIPS 2702 Feet
-<esri102708> +proj=tmerc +lat_0=34.75 +lon_0=-116.6666666666667 +k=0.999900 +x_0=500000.0000000002 +y_0=6000000.000000001 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane Nevada West FIPS 2703 Feet
-<esri102709> +proj=tmerc +lat_0=34.75 +lon_0=-118.5833333333333 +k=0.999900 +x_0=799999.9999999999 +y_0=4000000 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane New Hampshire FIPS 2800 Feet
-<esri102710> +proj=tmerc +lat_0=42.5 +lon_0=-71.66666666666667 +k=0.999967 +x_0=300000 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane New Jersey FIPS 2900 Feet
-<esri102711> +proj=tmerc +lat_0=38.83333333333334 +lon_0=-74.5 +k=0.999900 +x_0=150000 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane New Mexico East FIPS 3001 Feet
-<esri102712> +proj=tmerc +lat_0=31 +lon_0=-104.3333333333333 +k=0.999909 +x_0=165000 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane New Mexico Central FIPS 3002 Feet
-<esri102713> +proj=tmerc +lat_0=31 +lon_0=-106.25 +k=0.999900 +x_0=500000.0000000002 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane New Mexico West FIPS 3003 Feet
-<esri102714> +proj=tmerc +lat_0=31 +lon_0=-107.8333333333333 +k=0.999917 +x_0=829999.9999999999 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane New York East FIPS 3101 Feet
-<esri102715> +proj=tmerc +lat_0=38.83333333333334 +lon_0=-74.5 +k=0.999900 +x_0=150000 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane New York Central FIPS 3102 Feet
-<esri102716> +proj=tmerc +lat_0=40 +lon_0=-76.58333333333333 +k=0.999938 +x_0=250000 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane New York West FIPS 3103 Feet
-<esri102717> +proj=tmerc +lat_0=40 +lon_0=-78.58333333333333 +k=0.999938 +x_0=350000.0000000001 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane New York Long Island FIPS 3104 Feet
-<esri102718> +proj=lcc +lat_1=40.66666666666666 +lat_2=41.03333333333333 +lat_0=40.16666666666666 +lon_0=-74 +x_0=300000 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane North Carolina FIPS 3200 Feet
-<esri102719> +proj=lcc +lat_1=34.33333333333334 +lat_2=36.16666666666666 +lat_0=33.75 +lon_0=-79 +x_0=609601.2199999999 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane North Dakota North FIPS 3301 Feet
-<esri102720> +proj=lcc +lat_1=47.43333333333333 +lat_2=48.73333333333333 +lat_0=47 +lon_0=-100.5 +x_0=600000.0000000001 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane North Dakota South FIPS 3302 Feet
-<esri102721> +proj=lcc +lat_1=46.18333333333333 +lat_2=47.48333333333333 +lat_0=45.66666666666666 +lon_0=-100.5 +x_0=600000.0000000001 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane Ohio North FIPS 3401 Feet
-<esri102722> +proj=lcc +lat_1=40.43333333333333 +lat_2=41.7 +lat_0=39.66666666666666 +lon_0=-82.5 +x_0=600000.0000000001 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane Ohio South FIPS 3402 Feet
-<esri102723> +proj=lcc +lat_1=38.73333333333333 +lat_2=40.03333333333333 +lat_0=38 +lon_0=-82.5 +x_0=600000.0000000001 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane Oklahoma North FIPS 3501 Feet
-<esri102724> +proj=lcc +lat_1=35.56666666666667 +lat_2=36.76666666666667 +lat_0=35 +lon_0=-98 +x_0=600000.0000000001 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane Oklahoma South FIPS 3502 Feet
-<esri102725> +proj=lcc +lat_1=33.93333333333333 +lat_2=35.23333333333333 +lat_0=33.33333333333334 +lon_0=-98 +x_0=600000.0000000001 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane Oregon North FIPS 3601 Feet
-<esri102726> +proj=lcc +lat_1=44.33333333333334 +lat_2=46 +lat_0=43.66666666666666 +lon_0=-120.5 +x_0=2500000 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane Oregon South FIPS 3602 Feet
-<esri102727> +proj=lcc +lat_1=42.33333333333334 +lat_2=44 +lat_0=41.66666666666666 +lon_0=-120.5 +x_0=1500000 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane Pennsylvania North FIPS 3701 Feet
-<esri102728> +proj=lcc +lat_1=40.88333333333333 +lat_2=41.95 +lat_0=40.16666666666666 +lon_0=-77.75 +x_0=600000.0000000001 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane Pennsylvania South FIPS 3702 Feet
-<esri102729> +proj=lcc +lat_1=39.93333333333333 +lat_2=40.96666666666667 +lat_0=39.33333333333334 +lon_0=-77.75 +x_0=600000.0000000001 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane Rhode Island FIPS 3800 Feet
-<esri102730> +proj=tmerc +lat_0=41.08333333333334 +lon_0=-71.5 +k=0.999994 +x_0=100000 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane South Carolina FIPS 3900 Feet
-<esri102733> +proj=lcc +lat_1=32.5 +lat_2=34.83333333333334 +lat_0=31.83333333333333 +lon_0=-81 +x_0=609600.0000000001 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane South Dakota North FIPS 4001 Feet
-<esri102734> +proj=lcc +lat_1=44.41666666666666 +lat_2=45.68333333333333 +lat_0=43.83333333333334 +lon_0=-100 +x_0=600000.0000000001 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane South Dakota South FIPS 4002 Feet
-<esri102735> +proj=lcc +lat_1=42.83333333333334 +lat_2=44.4 +lat_0=42.33333333333334 +lon_0=-100.3333333333333 +x_0=600000.0000000001 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane Tennessee FIPS 4100 Feet
-<esri102736> +proj=lcc +lat_1=35.25 +lat_2=36.41666666666666 +lat_0=34.33333333333334 +lon_0=-86 +x_0=600000.0000000001 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane Texas North FIPS 4201 Feet
-<esri102737> +proj=lcc +lat_1=34.65 +lat_2=36.18333333333333 +lat_0=34 +lon_0=-101.5 +x_0=200000 +y_0=1000000 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane Texas North Central FIPS 4202 Feet
-<esri102738> +proj=lcc +lat_1=32.13333333333333 +lat_2=33.96666666666667 +lat_0=31.66666666666667 +lon_0=-98.5 +x_0=600000.0000000001 +y_0=2000000 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane Texas Central FIPS 4203 Feet
-<esri102739> +proj=lcc +lat_1=30.11666666666667 +lat_2=31.88333333333333 +lat_0=29.66666666666667 +lon_0=-100.3333333333333 +x_0=700000 +y_0=3000000 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane Texas South Central FIPS 4204 Feet
-<esri102740> +proj=lcc +lat_1=28.38333333333333 +lat_2=30.28333333333334 +lat_0=27.83333333333333 +lon_0=-99 +x_0=600000.0000000001 +y_0=4000000 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane Texas South FIPS 4205 Feet
-<esri102741> +proj=lcc +lat_1=26.16666666666667 +lat_2=27.83333333333333 +lat_0=25.66666666666667 +lon_0=-98.5 +x_0=300000 +y_0=4999999.999999999 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane Utah North FIPS 4301 Feet
-<esri102742> +proj=lcc +lat_1=40.71666666666667 +lat_2=41.78333333333333 +lat_0=40.33333333333334 +lon_0=-111.5 +x_0=500000.0000000002 +y_0=1000000 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane Utah Central FIPS 4302 Feet
-<esri102743> +proj=lcc +lat_1=39.01666666666667 +lat_2=40.65 +lat_0=38.33333333333334 +lon_0=-111.5 +x_0=500000.0000000002 +y_0=2000000 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane Utah South FIPS 4303 Feet
-<esri102744> +proj=lcc +lat_1=37.21666666666667 +lat_2=38.35 +lat_0=36.66666666666666 +lon_0=-111.5 +x_0=500000.0000000002 +y_0=3000000 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane Vermont FIPS 4400 Feet
-<esri102745> +proj=tmerc +lat_0=42.5 +lon_0=-72.5 +k=0.999964 +x_0=500000.0000000002 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane Virginia North FIPS 4501 Feet
-<esri102746> +proj=lcc +lat_1=38.03333333333333 +lat_2=39.2 +lat_0=37.66666666666666 +lon_0=-78.5 +x_0=3499999.999999999 +y_0=2000000 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane Virginia South FIPS 4502 Feet
-<esri102747> +proj=lcc +lat_1=36.76666666666667 +lat_2=37.96666666666667 +lat_0=36.33333333333334 +lon_0=-78.5 +x_0=3499999.999999999 +y_0=1000000 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane Washington North FIPS 4601 Feet
-<esri102748> +proj=lcc +lat_1=47.5 +lat_2=48.73333333333333 +lat_0=47 +lon_0=-120.8333333333333 +x_0=500000.0000000002 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane Washington South FIPS 4602 Feet
-<esri102749> +proj=lcc +lat_1=45.83333333333334 +lat_2=47.33333333333334 +lat_0=45.33333333333334 +lon_0=-120.5 +x_0=500000.0000000002 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane West Virginia North FIPS 4701 Feet
-<esri102750> +proj=lcc +lat_1=39 +lat_2=40.25 +lat_0=38.5 +lon_0=-79.5 +x_0=600000.0000000001 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane West Virginia South FIPS 4702 Feet
-<esri102751> +proj=lcc +lat_1=37.48333333333333 +lat_2=38.88333333333333 +lat_0=37 +lon_0=-81 +x_0=600000.0000000001 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane Wisconsin North FIPS 4801 Feet
-<esri102752> +proj=lcc +lat_1=45.56666666666667 +lat_2=46.76666666666667 +lat_0=45.16666666666666 +lon_0=-90 +x_0=600000.0000000001 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane Wisconsin Central FIPS 4802 Feet
-<esri102753> +proj=lcc +lat_1=44.25 +lat_2=45.5 +lat_0=43.83333333333334 +lon_0=-90 +x_0=600000.0000000001 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane Wisconsin South FIPS 4803 Feet
-<esri102754> +proj=lcc +lat_1=42.73333333333333 +lat_2=44.06666666666667 +lat_0=42 +lon_0=-90 +x_0=600000.0000000001 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane Wyoming East FIPS 4901 Feet
-<esri102755> +proj=tmerc +lat_0=40.5 +lon_0=-105.1666666666667 +k=0.999938 +x_0=200000 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane Wyoming East Central FIPS 4902 Feet
-<esri102756> +proj=tmerc +lat_0=40.5 +lon_0=-107.3333333333333 +k=0.999938 +x_0=399999.9999999999 +y_0=100000 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane Wyoming West Central FIPS 4903 Feet
-<esri102757> +proj=tmerc +lat_0=40.5 +lon_0=-108.75 +k=0.999938 +x_0=600000.0000000001 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane Wyoming West FIPS 4904 Feet
-<esri102758> +proj=tmerc +lat_0=40.5 +lon_0=-110.0833333333333 +k=0.999938 +x_0=799999.9999999999 +y_0=100000 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane Puerto Rico Virgin Islands FIPS 5200 Feet
-<esri102761> +proj=lcc +lat_1=18.03333333333334 +lat_2=18.43333333333333 +lat_0=17.83333333333333 +lon_0=-66.43333333333334 +x_0=200000 +y_0=200000 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# NAD 1983 StatePlane Guam FIPS 5400 Feet
-<esri102766> +proj=poly +lat_0=13.47246635277778 +lon_0=-144.7487507055556 +x_0=49999.99999999999 +y_0=49999.99999999999 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs <>
-# Belge Lambert 1972
-<esri103300> +proj=lcc +lat_1=49.8333339 +lat_2=51.16666733333333 +lat_0=90 +lon_0=4.367486666666666 +x_0=150000.01256 +y_0=5400088.4378 +ellps=intl +units=m  no_defs <>
-# GCS International 1967
-<esri4023> +proj=longlat +ellps=aust_SA  no_defs <>
-# GCS Bern 1898
-<esri4217> +proj=longlat +ellps=bessel  no_defs <>
-# GCS Voirol Unifie 1960
-<esri4305> +proj=longlat +ellps=clrk80  no_defs <>
-# GCS Montserrat 1958
-<esri4404> +proj=longlat +ellps=clrk80  no_defs <>
-# GCS Voirol Unifie 1960 Paris
-<esri4812> +proj=longlat +ellps=clrk80 +pm=2.337229166666667  no_defs <>
-# GCS WGS 1966
-<esri37001> +proj=longlat +ellps=WGS66  no_defs <>
-# GCS Fischer 1960
-<esri37002> +proj=longlat +a=6378166 +b=6356784.283607107  no_defs <>
-# GCS Fischer 1968
-<esri37003> +proj=longlat +a=6378150 +b=6356768.337244385  no_defs <>
-# GCS Fischer Modified
-<esri37004> +proj=longlat +ellps=fschr60m  no_defs <>
-# GCS Hough 1960
-<esri37005> +proj=longlat +a=6378270 +b=6356794.343434343  no_defs <>
-# GCS Everest Modified 1969
-<esri37006> +proj=longlat +a=6377295.664 +b=6356094.667915204  no_defs <>
-# GCS Walbeck
-<esri37007> +proj=longlat +a=6376896 +b=6355834.846687363  no_defs <>
-# GCS Sphere ARC INFO
-<esri37008> +proj=longlat +a=6370997 +b=6370997  no_defs <>
-# GCS European 1979
-<esri37201> +proj=longlat +ellps=intl  no_defs <>
-# GCS Everest Bangladesh
-<esri37202> +proj=longlat +a=6377276.345 +b=6356075.413140239  no_defs <>
-# GCS Everest India Nepal
-<esri37203> +proj=longlat +a=6377301.243 +b=6356100.230165385  no_defs <>
-# GCS Hjorsey 1955
-<esri37204> +proj=longlat +ellps=intl  no_defs <>
-# GCS Hong Kong 1963
-<esri37205> +proj=longlat +ellps=intl  no_defs <>
-# GCS Oman
-<esri37206> +proj=longlat +ellps=clrk80  no_defs <>
-# GCS South Asia Singapore
-<esri37207> +proj=longlat +ellps=fschr60m  no_defs <>
-# GCS Ayabelle
-<esri37208> +proj=longlat +ellps=clrk80  no_defs <>
-# GCS Point 58
-<esri37211> +proj=longlat +ellps=clrk80  no_defs <>
-# GCS Beacon E 1945
-<esri37212> +proj=longlat +ellps=intl  no_defs <>
-# GCS Tern Island 1961
-<esri37213> +proj=longlat +ellps=intl  no_defs <>
-# GCS Astro 1952
-<esri37214> +proj=longlat +ellps=intl  no_defs <>
-# GCS Bellevue IGN
-<esri37215> +proj=longlat +ellps=intl  no_defs <>
-# GCS Canton 1966
-<esri37216> +proj=longlat +ellps=intl  no_defs <>
-# GCS Chatham Island 1971
-<esri37217> +proj=longlat +ellps=intl  no_defs <>
-# GCS DOS 1968
-<esri37218> +proj=longlat +ellps=intl  no_defs <>
-# GCS Easter Island 1967
-<esri37219> +proj=longlat +ellps=intl  no_defs <>
-# GCS Guam 1963
-<esri37220> +proj=longlat +ellps=clrk66  no_defs <>
-# GCS GUX 1
-<esri37221> +proj=longlat +ellps=intl  no_defs <>
-# GCS Johnston Island 1961
-<esri37222> +proj=longlat +ellps=intl  no_defs <>
-# GCS Carthage Degree
-<esri37223> +proj=longlat +a=6378249.2 +b=6356514.999904194  no_defs <>
-# GCS Midway 1961
-<esri37224> +proj=longlat +ellps=intl  no_defs <>
-# GCS Pitcairn 1967
-<esri37226> +proj=longlat +ellps=intl  no_defs <>
-# GCS Santo DOS 1965
-<esri37227> +proj=longlat +ellps=intl  no_defs <>
-# GCS Viti Levu 1916
-<esri37228> +proj=longlat +ellps=clrk80  no_defs <>
-# GCS Wake Eniwetok 1960
-<esri37229> +proj=longlat +a=6378270 +b=6356794.343434343  no_defs <>
-# GCS Wake Island 1952
-<esri37230> +proj=longlat +ellps=intl  no_defs <>
-# GCS Anna 1 1965
-<esri37231> +proj=longlat +ellps=aust_SA  no_defs <>
-# GCS Gan 1970
-<esri37232> +proj=longlat +ellps=intl  no_defs <>
-# GCS ISTS 073 1969
-<esri37233> +proj=longlat +ellps=intl  no_defs <>
-# GCS Kerguelen Island 1949
-<esri37234> +proj=longlat +ellps=intl  no_defs <>
-# GCS Reunion
-<esri37235> +proj=longlat +ellps=intl  no_defs <>
-# GCS Ascension Island 1958
-<esri37237> +proj=longlat +ellps=intl  no_defs <>
-# GCS DOS 71 4
-<esri37238> +proj=longlat +ellps=intl  no_defs <>
-# GCS Cape Canaveral
-<esri37239> +proj=longlat +ellps=clrk66  no_defs <>
-# GCS Fort Thomas 1955
-<esri37240> +proj=longlat +ellps=clrk80  no_defs <>
-# GCS Graciosa Base SW 1948
-<esri37241> +proj=longlat +ellps=intl  no_defs <>
-# GCS ISTS 061 1968
-<esri37242> +proj=longlat +ellps=intl  no_defs <>
-# GCS LC5 1961
-<esri37243> +proj=longlat +ellps=clrk66  no_defs <>
-# GCS Observ Meteorologico 1939
-<esri37245> +proj=longlat +ellps=intl  no_defs <>
-# GCS Pico de Las Nieves
-<esri37246> +proj=longlat +ellps=intl  no_defs <>
-# GCS Porto Santo 1936
-<esri37247> +proj=longlat +ellps=intl  no_defs <>
-# GCS Sao Braz
-<esri37249> +proj=longlat +ellps=intl  no_defs <>
-# GCS Selvagem Grande 1938
-<esri37250> +proj=longlat +ellps=intl  no_defs <>
-# GCS Tristan 1968
-<esri37251> +proj=longlat +ellps=intl  no_defs <>
-# GCS Samoa 1962
-<esri37252> +proj=longlat +ellps=clrk66  no_defs <>
-# GCS Camp Area
-<esri37253> +proj=longlat +ellps=intl  no_defs <>
-# GCS Deception Island
-<esri37254> +proj=longlat +ellps=clrk80  no_defs <>
-# GCS Gunung Segara
-<esri37255> +proj=longlat +ellps=bessel  no_defs <>
-# GCS S42 Hungary
-<esri37257> +proj=longlat +ellps=krass  no_defs <>
-# GCS Kusaie 1951
-<esri37259> +proj=longlat +ellps=intl  no_defs <>
-# GCS Alaskan Islands
-<esri37260> +proj=longlat +ellps=clrk66  no_defs <>
-# GCS Assumed Geographic 1
-<esri104000> +proj=longlat +ellps=clrk66 +datum=NAD27  no_defs <>
-# GCS Estonia 1937
-<esri104101> +proj=longlat +ellps=bessel  no_defs <>
-# GCS Hermannskogel
-<esri104102> +proj=longlat +ellps=bessel  no_defs <>
-# GCS Sierra Leone 1960
-<esri104103> +proj=longlat +ellps=clrk80  no_defs <>
-# GCS Hong Kong 1980
-<esri104104> +proj=longlat +ellps=intl  no_defs <>
-# GCS Datum Lisboa Bessel
-<esri104105> +proj=longlat +ellps=bessel  no_defs <>
-# GCS Datum Lisboa Hayford
-<esri104106> +proj=longlat +ellps=intl  no_defs <>
-# GCS RGF 1993
-<esri104107> +proj=longlat +ellps=GRS80  no_defs <>
-# GCS NZGD 2000
-<esri104108> +proj=longlat +ellps=GRS80  no_defs <>
-# GCS Merchich Degree
-<esri104261> +proj=longlat +a=6378249.2 +b=6356514.999904194  no_defs <>
-# GCS Voirol 1875 Degree
-<esri104304> +proj=longlat +a=6378249.2 +b=6356514.999904194  no_defs <>
-# GCS Voirol Unifie 1960 Degree
-<esri104305> +proj=longlat +ellps=clrk80  no_defs <>
-
-##########################################################
-#
-# Google mercator
-#
-# <900913> Chris' funny epsgish code for the google mercator
-<900913> +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext  +no_defs <>
-
-##########################################################
-#
-# IGNF (French Mapping Agency) projection definitions
-#
-# W [AMANU49]
-# W [AMANU63]
-<AMST63> +title=Ile d'Amsterdam 1963 +proj=geocent +towgs84=109.7530,-528.1330,-362.2440 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs <>
-# W [ANAA47]
-<ANAA92> +title=MOP92 (Anaa) Tuamotu +proj=geocent +towgs84=1.5000,3.8400,4.8100 +a=6378137.0000 +rf=298.2572235630000 +units=m +no_defs <>
-# W [APAT48]
-# W [APAT49]
-<APAT86> +title=MOP86 (Apataki, Rapa, Hao) Tuamotu +proj=geocent +towgs84=216.8400,118.8100,19.6100 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs <>
-<ATI> +title=Ancienne Triangulation des Ingenieurs +proj=geocent +towgs84=1127.0000,22.0000,57.0000 +a=6376523.0000 +rf=308.6400000000000 +units=m +no_defs <>
-# W [BASSAS]
-# W [BIEN55]
-<CAD97> +title=Cadastre 1997 +proj=geocent +towgs84=-381.7880,-57.5010,-256.6730 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs <>
-# W [CADA80]
-# W [CASS1733]
-<CIOBIH> +title=CIO-BIH +proj=geocent +towgs84=0.0000,0.0000,0.5000,0.0000,0.0000,0.0140,-0.100000 +a=6378137.0000 +rf=298.2572221010000 +units=m +no_defs <>
-# W [CLIP67]
-<CROZ63> +title=Crozet 1963 +proj=geocent +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs <>
-<CSG67> +title=Guyane CSG67 +proj=geocent +towgs84=-193.0660,236.9930,105.4470,0.4814,-0.8074,0.1276,1.564900 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs <>
-<ED50> +title=ED50 +proj=geocent +towgs84=-84.0000,-97.0000,-117.0000 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs <>
-<EFATE57> +title=EFATE-IGN 1957 +proj=geocent +towgs84=-127.0000,-769.0000,472.0000 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs <>
-<ETRS89> +title=Systeme de reference terrestre Europeen (1989) +proj=geocent +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +units=m +no_defs <>
-# W [EUROPA54]
-# W [FAKA50]
-# W [FANGA50]
-# W [FANGA64]
-# W [FANGA651]
-# W [FANGA652]
-# W [FANGA66]
-<FANGA84> +title=MOP84 (Fangataufa 1984) +proj=geocent +towgs84=150.5700,158.3300,118.3200 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs <>
-# W [GLOR77CAR]
-<GUAD48> +title=Guadeloupe Ste Anne +proj=geocent +towgs84=-472.2900,-5.6300,-304.1200,0.4362,-0.8374,0.2563,1.898400 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs <>
-<GUADFM49> +title=Guadeloupe Fort Marigot +proj=geocent +towgs84=136.5960,248.1480,-429.7890 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs <>
-# W [HAO49]
-# W [HAO58]
-# W [HAO67]
-# W [HARA49]
-# W [HIKU50]
-# W [HIVA60]
-# W [HIVA67]
-<IGN63> +title=IGN 1963 (Hiva Oa, Tahuata, Mohotani) +proj=geocent +towgs84=410.7210,55.0490,80.7460,-2.5779,-2.3514,-0.6664,17.331100 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs <>
-<IGN72> +title=IGN 1972 Grande-Terre / Ile des Pins +proj=geocent +towgs84=-11.6400,-348.6000,291.6800 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs <>
-# W [JULES55]
-<KAUE70> +title=MHPF70 (Kauehi) Tuamotu +proj=geocent +towgs84=126.7400,300.1000,-75.4900 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs <>
-<KERG62CAR> +title=Kerguelen - K0 +proj=geocent +towgs84=144.8990,-186.7700,100.9230 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs <>
-<LIFOU56> +title=Lifou - Iles Loyaute (IGN56) +proj=geocent +towgs84=336.0000,223.0000,-231.0000 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs <>
-<LUREF> +title=Nouvelle Triangulation du Grand Duche du Luxembourg +proj=geocent +towgs84=-192.9860,13.6730,-39.3090,-0.4099,-2.9332,2.6881,0.430000 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs <>
-# W [MAKE50]
-# W [MANGA51]
-<MARE53> +title=Mare - Iles Loyaute (IGN53) +proj=geocent +towgs84=287.0000,178.0000,-136.0000 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs <>
-<MARQUI72> +title=IGN 1972 (Eiao, Hiva Oa, Mohotani) Marquises +proj=geocent +towgs84=327.8400,-14.9600,59.3300 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs <>
-<MART38> +title=Martinique Fort-Desaix +proj=geocent +towgs84=126.9260,547.9390,130.4090,-2.7867,5.1612,-0.8584,13.822650 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs <>
-# W [MAUPITI]
-<MAYO50> +title=Mayotte Combani +proj=geocent +towgs84=-599.9280,-275.5520,-195.6650,-0.0835,-0.4715,0.0602,49.281400 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs <>
-<MHEFO55F> +title=MHEFO 1955 (Fatu Huku) +proj=geocent +towgs84=347.1030,1078.1250,2623.9220,33.8875,-70.6773,9.3943,186.074000 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs <>
-# W [MHEFO55M]
-<MHPF67> +title=MHPF67 (Mangareva, Agakauitai, Aukena, Mekiro) Gambiers (Iles) +proj=geocent +towgs84=338.0800,212.5800,-296.1700 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs <>
-<MOOREA87> +title=Moorea 1987 +proj=geocent +towgs84=215.9820,149.5930,176.2290,3.2624,1.6920,1.1571,10.477300 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs <>
-<MOP90> +title=MOP90 (Tetiaroa) Iles de la Societe +proj=geocent +towgs84=217.0370,86.9590,23.9560 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs <>
-# W [MURU51]
-# W [MURU59]
-# W [MURU62]
-# W [MURU78]
-# W [NC51]
-# W [NOVA53]
-<NTF> +title=Nouvelle Triangulation Francaise +proj=geocent +nadgrids=ntf_r93.gsb,null +wktext +towgs84=-168.0000,-60.0000,320.0000 +a=6378249.2000 +rf=293.4660210000000 +units=m +no_defs <>
-<NUKU72> +title=IGN 1972 Nuku Hiva +proj=geocent +towgs84=165.7320,216.7200,180.5050,-0.6434,-0.4512,-0.0791,7.420400 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs <>
-<NUKU94> +title=SAT94 (Nukutavake) Tuamotu +proj=geocent +towgs84=197.1600,200.1700,-48.0800 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs <>
-<OUVEA72CAR> +title=Ouvea - Iles Loyaute (MHNC 1972 - OUVEA) +proj=geocent +towgs84=-13.0000,-348.0000,292.0000 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs <>
-<PETRELS72> +title=Petrels - IGN 1972 +proj=geocent +towgs84=365.0000,194.0000,166.0000 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs <>
-# W [PMAR55]
-<RAIA53> +title=IGN53 (IGN Raiatea-Tahaa) Raiatea-Tahaa-Bora Bora-Huahine +proj=geocent +towgs84=65.0300,341.5500,76.6700 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs <>
-# W [RAIV54]
-# W [RAIV66]
-# W [RANGI47]
-# W [RANGI59]
-# W [RANGI68]
-# W [RAPA55]
-# W [RAPA80]
-<REUN47> +title=Reunion 1947 +proj=geocent +towgs84=789.5240,-626.4860,-89.9040,0.6006,76.7946,-10.5788,-32.324100 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs <>
-# W [REUN49]
-# W [REUN92]
-<RGF93> +title=Reseau geodesique francais 1993 +proj=geocent +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +units=m +no_defs <>
-<RGFG95> +title=Reseau geodesique francais de Guyane 1995 +proj=geocent +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +units=m +no_defs <>
-<RGM04> +title=RGM04 (Reseau Geodesique de Mayotte 2004) +proj=geocent +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +units=m +no_defs <>
-<RGNC> +title=Reseau Geodesique de Nouvelle-Caledonie +proj=geocent +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +units=m +no_defs <>
-<RGPF> +title=RGPF (Reseau Geodesique de Polynesie Francaise) +proj=geocent +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +units=m +no_defs <>
-<RGR92> +title=Reseau geodesique Reunion 1992 +proj=geocent +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +units=m +no_defs <>
-<RGSPM06> +title=Reseau Geodesique Saint-Pierre-et-Miquelon (2006) +proj=geocent +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +units=m +no_defs <>
-<RGTAAF07> +title=Reseau Geodesique des TAAF (2007) +proj=geocent +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +units=m +no_defs <>
-<RRAF91> +title=RRAF 1991 (Reseau de Reference des Antilles Francaises) +proj=geocent +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +units=m +no_defs <>
-<SAT84> +title=SAT84 (Rurutu) Iles Australes +proj=geocent +towgs84=202.1300,174.6000,-15.7400 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs <>
-<SHOM84> +title=SHOM 1984 Martinique Montagne Du Vauclin +proj=geocent +towgs84=189.5060,486.5470,148.7830 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs <>
-<STPL69> +title=Ile de Saint-Paul 1969 +proj=geocent +towgs84=225.5710,-346.6080,-46.5670 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs <>
-<STPM50> +title=St Pierre et Miquelon 1950 +proj=geocent +towgs84=-95.5930,573.7630,173.4420,-0.9602,1.2510,-1.3918,42.626500 +a=6378206.4000 +rf=294.9786982000000 +units=m +no_defs <>
-# W [SYSLNCAR]
-<TAHAA> +title=Raiatea - Tahaa 51-54 (Tahaa, Base Terme Est) +proj=geocent +towgs84=72.4380,345.9180,79.4860,-1.6045,-0.8823,-0.5565,1.374600 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs <>
-<TAHI51> +title=Tahiti-Terme Nord 1951 +proj=geocent +towgs84=162.0000,117.0000,154.0000 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs <>
-<TAHI79> +title=IGN79 (Tahiti) Iles de la Societe +proj=geocent +towgs84=221.5250,152.9480,176.7680,2.3847,1.3896,0.8770,11.474100 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs <>
-# W [TAKA69]
-<TANNA> +title=Tanna Bloc Sud +proj=geocent +towgs84=-139.0000,-967.0000,436.0000 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs <>
-<TERA50> +title=Pointe Geologie - Perroud 1950 +proj=geocent +towgs84=324.9120,153.2820,172.0260 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs <>
-# W [TIKE50]
-# W [TIKE60]
-# W [TROM56]
-<TUBU69> +title=MHPF 1969 (Tubuai) Iles Australes +proj=geocent +towgs84=237.1700,171.6100,-77.8400 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs <>
-# W [TURI69]
-# W [WALL76]
-<WALL78> +title=Wallis-Uvea 1978 (MOP78) +proj=geocent +towgs84=253.0000,-133.0000,-127.0000 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs <>
-<WGS72> +title=World Geodetic System 1972 +proj=geocent +towgs84=0.0000,12.0000,6.0000 +a=6378135.0000 +rf=298.2600000000000 +units=m +no_defs <>
-<WGS84> +title=World Geodetic System 1984 +proj=geocent +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +units=m +no_defs <>
-# W [AMANU49GEO]
-# W [AMANU63GEO]
-<AMST63GEO> +title=Ile d'Amsterdam 1963 +proj=longlat +towgs84=109.7530,-528.1330,-362.2440 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs <>
-# W [ANAA47GEO]
-<ANAA92GEO> +title=MOP92 (Anaa) Tuamotu +proj=longlat +towgs84=1.5000,3.8400,4.8100 +a=6378137.0000 +rf=298.2572235630000 +units=m +no_defs <>
-# W [APAT48GEO]
-# W [APAT49GEO]
-<APAT86GEO> +title=MOP86 (Apataki, Rapa, Hao) Tuamotu +proj=longlat +towgs84=216.8400,118.8100,19.6100 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs <>
-<ATIGEO> +title=Ancienne Triangulation des Ingenieurs +proj=longlat +towgs84=1127.0000,22.0000,57.0000 +a=6376523.0000 +rf=308.6400000000000 +units=m +no_defs <>
-# W [BASSASGEO]
-# W [BIEN55GEO]
-<CAD97GEO> +title=Cadastre 1997 +proj=longlat +towgs84=-381.7880,-57.5010,-256.6730 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs <>
-# W [CADA80GEO]
-# W [CASS1733GEO]
-# W [CLIP67GEO]
-<CROZ63GEO> +title=Crozet 1963 +proj=longlat +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs <>
-<CSG67GEO> +title=Guyane CSG67 +proj=longlat +towgs84=-193.0660,236.9930,105.4470,0.4814,-0.8074,0.1276,1.564900 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs <>
-<ED50G> +title=ED50 +proj=longlat +towgs84=-84.0000,-97.0000,-117.0000 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs <>
-<EFATE57GEO> +title=EFATE-IGN 1957 +proj=longlat +towgs84=-127.0000,-769.0000,472.0000 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs <>
-<ETRS89GEO> +title=ETRS89 geographiques (dms) +proj=longlat +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +units=m +no_defs <>
-# W [EUROPA54GEO]
-# W [FAKA50GEO]
-# W [FANGA50GEO]
-# W [FANGA64GEO]
-# W [FANGA651GEO]
-# W [FANGA652GEO]
-# W [FANGA66GEO]
-<FANGA84GEO> +title=MOP84 (Fangataufa 1984) +proj=longlat +towgs84=150.5700,158.3300,118.3200 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs <>
-# W [GLOR77GEO]
-<GUAD48GEO> +title=Guadeloupe Ste Anne +proj=longlat +towgs84=-472.2900,-5.6300,-304.1200,0.4362,-0.8374,0.2563,1.898400 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs <>
-<GUADFM49GEO> +title=Guadeloupe Fort Marigot +proj=longlat +towgs84=136.5960,248.1480,-429.7890 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs <>
-# W [HAO49GEO]
-# W [HAO58GEO]
-# W [HAO67GEO]
-# W [HARA49GEO]
-# W [HIKU50GEO]
-# W [HIVA60GEO]
-# W [HIVA67GEO]
-<IGN63GEO> +title=IGN 1963 (Hiva Oa, Tahuata, Mohotani) +proj=longlat +towgs84=410.7210,55.0490,80.7460,-2.5779,-2.3514,-0.6664,17.331100 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs <>
-<IGN72GEO> +title=IGN 1972 Grande-Terre / Ile des Pins +proj=longlat +towgs84=-11.6400,-348.6000,291.6800 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs <>
-# W [JULES55GEO]
-<KAUE70GEO> +title=MHPF70 (Kauehi) Tuamotu +proj=longlat +towgs84=126.7400,300.1000,-75.4900 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs <>
-<KERG62GEO> +title=Kerguelen - K0 +proj=longlat +towgs84=144.8990,-186.7700,100.9230 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs <>
-<LIFOU56GEO> +title=Lifou - Iles Loyaute (IGN56) +proj=longlat +towgs84=336.0000,223.0000,-231.0000 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs <>
-<LUXGEO> +title=Nouvelle Triangulation du Grand Duche du Luxembourg +proj=longlat +towgs84=-192.9860,13.6730,-39.3090,-0.4099,-2.9332,2.6881,0.430000 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs <>
-# W [MAKE50GEO]
-# W [MANGA51GEO]
-<MARE53GEO> +title=Mare - Iles Loyaute (IGN53) +proj=longlat +towgs84=287.0000,178.0000,-136.0000 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs <>
-<MARQUI72GEO> +title=IGN 1972 (Eiao, Hiva Oa, Mohotani) Marquises +proj=longlat +towgs84=327.8400,-14.9600,59.3300 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs <>
-<MART38GEO> +title=Martinique Fort-Desaix +proj=longlat +towgs84=126.9260,547.9390,130.4090,-2.7867,5.1612,-0.8584,13.822650 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs <>
-# W [MAUPITIGEO]
-<MAYO50GEO> +title=Mayotte Combani +proj=longlat +towgs84=-599.9280,-275.5520,-195.6650,-0.0835,-0.4715,0.0602,49.281400 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs <>
-<MHEFO55FGEO> +title=MHEFO 1955 (Fatu Huku) +proj=longlat +towgs84=347.1030,1078.1250,2623.9220,33.8875,-70.6773,9.3943,186.074000 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs <>
-# W [MHEFO55MGEO]
-<MHPF67GEO> +title=MHPF67 (Mangareva, Agakauitai, Aukena, Mekiro) Gambiers (Iles) +proj=longlat +towgs84=338.0800,212.5800,-296.1700 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs <>
-<MOOREA87GEO> +title=Moorea 1987 +proj=longlat +towgs84=215.9820,149.5930,176.2290,3.2624,1.6920,1.1571,10.477300 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs <>
-<MOP90GEO> +title=MOP90 (Tetiaroa) Iles de la Societe +proj=longlat +towgs84=217.0370,86.9590,23.9560 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs <>
-# W [MURU51GEO]
-# W [MURU59GEO]
-# W [MURU62GEO]
-# W [MURU78GEO]
-# W [NC51GEO]
-# W [NOVA53GEO]
-<NTFG> +title=Nouvelle Triangulation Francaise Greenwich degres sexagesimaux +proj=longlat +nadgrids=ntf_r93.gsb,null +wktext +towgs84=-168.0000,-60.0000,320.0000 +a=6378249.2000 +rf=293.4660210000000 +units=m +no_defs <>
-<NTFP> +title=Nouvelle Triangulation Francaise Paris grades +proj=longlat +nadgrids=ntf_r93.gsb,null +wktext +towgs84=-168.0000,-60.0000,320.0000 +a=6378249.2000 +rf=293.4660210000000 +pm=2.337229167 +units=m +no_defs <>
-<NUKU72GEO> +title=IGN 1972 Nuku Hiva +proj=longlat +towgs84=165.7320,216.7200,180.5050,-0.6434,-0.4512,-0.0791,7.420400 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs <>
-<NUKU94GEO> +title=SAT94 (Nukutavake) Tuamotu +proj=longlat +towgs84=197.1600,200.1700,-48.0800 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs <>
-<OUVEA72GEO> +title=Ouvea - Iles Loyaute (MHNC 1972 - OUVEA) +proj=longlat +towgs84=-13.0000,-348.0000,292.0000 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs <>
-# W [PMAR55GEO]
-<RAIA53GEO> +title=IGN53 (IGN Raiatea-Tahaa) Raiatea-Tahaa-Bora Bora-Huahine +proj=longlat +towgs84=65.0300,341.5500,76.6700 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs <>
-# W [RAIV54GEO]
-# W [RAIV66GEO]
-# W [RANGI47GEO]
-# W [RANGI59GEO]
-# W [RANGI68GEO]
-# W [RAPA55GEO]
-# W [RAPA80GEO]
-<REUN47GEO> +title=Reunion 1947 +proj=longlat +towgs84=789.5240,-626.4860,-89.9040,0.6006,76.7946,-10.5788,-32.324100 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs <>
-# W [REUN49GEO]
-# W [REUN92GEO]
-<RGF93G> +title=Reseau geodesique francais 1993 +proj=longlat +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +units=m +no_defs <>
-<RGFG95GEO> +title=Reseau geodesique francais de Guyane 1995 +proj=longlat +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +units=m +no_defs <>
-<RGM04GEO> +title=RGM04 (Reseau Geodesique de Mayotte 2004) +proj=longlat +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +units=m +no_defs <>
-<RGNCGEO> +title=Reseau Geodesique de Nouvelle-Caledonie +proj=longlat +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +units=m +no_defs <>
-<RGPFGEO> +title=RGPF (Reseau Geodesique de Polynesie Francaise) +proj=longlat +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +units=m +no_defs <>
-<RGR92GEO> +title=Reseau geodesique de la Reunion 1992 +proj=longlat +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +units=m +no_defs <>
-<RGSPM06GEO> +title=Saint-Pierre-et-Miquelon (2006) +proj=longlat +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +units=m +no_defs <>
-<RGTAAF07G> +title=Reseau Geodesique des TAAF (2007) (dms) +proj=longlat +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +units=m +no_defs <>
-<SAT84GEO> +title=SAT84 (Rurutu) Iles Australes +proj=longlat +towgs84=202.1300,174.6000,-15.7400 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs <>
-<SHOM84GEO> +title=SHOM 1984 Martinique Montagne Du Vauclin +proj=longlat +towgs84=189.5060,486.5470,148.7830 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs <>
-<STPL69GEO> +title=Ile de Saint-Paul 1969 +proj=longlat +towgs84=225.5710,-346.6080,-46.5670 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs <>
-<STPM50GEO> +title=St Pierre et Miquelon 1950  +proj=longlat +towgs84=-95.5930,573.7630,173.4420,-0.9602,1.2510,-1.3918,42.626500 +a=6378206.4000 +rf=294.9786982000000 +units=m +no_defs <>
-# W [SYSLNGEO]
-<TAHAAGEO> +title=Raiatea - Tahaa 51-54 (Tahaa, Base Terme Est) +proj=longlat +towgs84=72.4380,345.9180,79.4860,-1.6045,-0.8823,-0.5565,1.374600 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs <>
-<TAHI51GEO> +title=Tahiti-Terme Nord 1951 +proj=longlat +towgs84=162.0000,117.0000,154.0000 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs <>
-<TAHI79GEO> +title=IGN79 (Tahiti) Iles de la Societe +proj=longlat +towgs84=221.5250,152.9480,176.7680,2.3847,1.3896,0.8770,11.474100 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs <>
-# W [TAKA69GEO]
-<TANNAGEO> +title=Tanna Bloc Sud +proj=longlat +towgs84=-139.0000,-967.0000,436.0000 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs <>
-<TERA50G> +title=Pointe Geologie - Perroud 1950 +proj=longlat +towgs84=324.9120,153.2820,172.0260 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs <>
-# W [TIKE50GEO]
-# W [TIKE60GEO]
-# W [TROM56GEO]
-<TUBU69GEO> +title=MHPF 1969 (Tubuai) Iles Australes +proj=longlat +towgs84=237.1700,171.6100,-77.8400 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs <>
-# W [TURI69GEO]
-# W [VAITAPEGEO]
-# W [WALL76GEO]
-<WALL78GEO> +title=Wallis - Uvea 1978 (MOP78) +proj=longlat +towgs84=253.0000,-133.0000,-127.0000 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs <>
-<WGS72G> +title=WGS72 +proj=longlat +towgs84=0.0000,12.0000,6.0000 +a=6378135.0000 +rf=298.2600000000000 +units=m +no_defs <>
-<WGS84G> +title=World Geodetic System 1984 +proj=longlat +a=6378137.0000 +rf=298.2572221010000 +units=m +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +no_defs <>
-<WGS84RRAFGEO> +title=Reseau de reference des Antilles francaises (1988-1991) +proj=longlat +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +units=m +no_defs <>
-<XGEO> +title=Systeme CIO-BIH +proj=longlat +towgs84=0.0000,0.0000,0.5000,0.0000,0.0000,0.0140,-0.100000 +a=6378137.0000 +rf=298.2572221010000 +units=m +no_defs <>
-# W [AMANU63UTM7S]
-<AMST63UTM43S> +title=Amsterdam 1963 +proj=tmerc +towgs84=109.7530,-528.1330,-362.2440 +a=6378388.0000 +rf=297.0000000000000 +lat_0=0.000000000 +lon_0=75.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs <>
-# W [ANAA47UTM6S]
-<ANAA92UTM6S> +title=MOP92 (Anaa) Tuamotu - UTM fuseau 6 Sud +proj=tmerc +towgs84=1.5000,3.8400,4.8100 +a=6378137.0000 +rf=298.2572235630000 +lat_0=0.000000000 +lon_0=-147.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs <>
-<APAT86UTM6S> +title=MOP86 (Apataki, Rapa, Hao) Tuamotu - UTM fuseau 6 Sud +proj=tmerc +towgs84=216.8400,118.8100,19.6100 +a=6378388.0000 +rf=297.0000000000000 +lat_0=0.000000000 +lon_0=-147.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs <>
-<APAT86UTM7S> +title=MOP86 (Apataki, Rapa, Hao) Tuamotu - UTM fuseau 7 Sud +proj=tmerc +towgs84=216.8400,118.8100,19.6100 +a=6378388.0000 +rf=297.0000000000000 +lat_0=0.000000000 +lon_0=-141.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs <>
-# W [BASSASUTM37S]
-<CAD97UTM38S> +title=Cadastre 1997 - UTM fuseau 38 Sud +proj=tmerc +towgs84=-381.7880,-57.5010,-256.6730 +a=6378388.0000 +rf=297.0000000000000 +lat_0=0.000000000 +lon_0=45.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs <>
-# W [CADA80UTM7S]
-# W [CLIP57UTM12]
-<CROZ63UTM39S> +title=Crozet 1963 +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378388.0000 +rf=297.0000000000000 +lat_0=0.000000000 +lon_0=51.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs <>
-<CSG67UTM21> +title=Guyane CSG67 UTM fuseau 21 +proj=tmerc +towgs84=-193.0660,236.9930,105.4470,0.4814,-0.8074,0.1276,1.564900 +a=6378388.0000 +rf=297.0000000000000 +lat_0=0.000000000 +lon_0=-57.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=0.000 +units=m +no_defs <>
-<CSG67UTM22> +title=Guyane CSG67 UTM fuseau 22 +proj=tmerc +towgs84=-193.0660,236.9930,105.4470,0.4814,-0.8074,0.1276,1.564900 +a=6378388.0000 +rf=297.0000000000000 +lat_0=0.000000000 +lon_0=-51.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=0.000 +units=m +no_defs <>
-<EFATE57UT59S> +title=EFATE-IGN 1957 - UTM fuseau 59 Sud +proj=tmerc +towgs84=-127.0000,-769.0000,472.0000 +a=6378388.0000 +rf=297.0000000000000 +lat_0=0.000000000 +lon_0=171.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs <>
-<ETRS89LAEA> +title=ETRS89 Lambert Azimutal Equal Area +proj=laea +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=52.000000000 +lon_0=10.000000000 +x_0=4321000.000 +y_0=3210000.000 +units=m +no_defs <>
-<ETRS89LCC> +title=ETRS89 Lambert Conformal Conic +proj=lcc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=52.000000000 +lon_0=9.999999995 +lat_1=35.000000000 +lat_2=65.000000000 +x_0=4000000.000 +y_0=2800000.000 +units=m +no_defs <>
-# W [FAKA50UTM6S]
-# W [FANGA64UTM7S]
-# W [FANGA651U7S]
-# W [FANGA652U7S]
-# W [FANGA66UTM7S]
-<FANGA84UTM7S> +title=Fangataufa 1984 - UTM fuseau 7 Sud +proj=tmerc +towgs84=150.5700,158.3300,118.3200 +a=6378388.0000 +rf=297.0000000000000 +lat_0=0.000000000 +lon_0=-141.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs <>
-<GEOPORTALANF> +title=Geoportail - Antilles francaises +proj=eqc +nadgrids=null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=0.000000000 +lat_ts=15.000000000 +x_0=0.000 +y_0=0.000 +units=m +no_defs <>
-<GEOPORTALASP> +title=Geoportail - Amsterdam et Saint-Paul +proj=eqc +nadgrids=null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=0.000000000 +lat_ts=-38.000000000 +x_0=0.000 +y_0=0.000 +units=m +no_defs <>
-<GEOPORTALCRZ> +title=Geoportail - Crozet +proj=eqc +nadgrids=null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=0.000000000 +lat_ts=-46.000000000 +x_0=0.000 +y_0=0.000 +units=m +no_defs <>
-<GEOPORTALFXX> +title=Geoportail - France metropolitaine +proj=eqc +nadgrids=null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=0.000000000 +lat_ts=46.500000000 +x_0=0.000 +y_0=0.000 +units=m +no_defs <>
-<GEOPORTALGUF> +title=Geoportail - Guyane +proj=eqc +nadgrids=null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=0.000000000 +lat_ts=4.000000000 +x_0=0.000 +y_0=0.000 +units=m +no_defs <>
-<GEOPORTALKER> +title=Geoportail - Kerguelen +proj=eqc +nadgrids=null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=0.000000000 +lat_ts=-49.500000000 +x_0=0.000 +y_0=0.000 +units=m +no_defs <>
-<GEOPORTALMYT> +title=Geoportail - Mayotte +proj=eqc +nadgrids=null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=0.000000000 +lat_ts=-12.000000000 +x_0=0.000 +y_0=0.000 +units=m +no_defs <>
-<GEOPORTALNCL> +title=Geoportail - Nouvelle-Caledonie +proj=eqc +nadgrids=null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=0.000000000 +lat_ts=-22.000000000 +x_0=0.000 +y_0=0.000 +units=m +no_defs <>
-<GEOPORTALPYF> +title=Geoportail - Polynesie francaise +proj=eqc +nadgrids=null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=0.000000000 +lat_ts=-15.000000000 +x_0=0.000 +y_0=0.000 +units=m +no_defs <>
-<GEOPORTALREU> +title=Geoportail - Reunion et dependances +proj=eqc +nadgrids=null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=0.000000000 +lat_ts=-21.000000000 +x_0=0.000 +y_0=0.000 +units=m +no_defs <>
-<GEOPORTALSPM> +title=Geoportail - Saint-Pierre et Miquelon +proj=eqc +nadgrids=null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=0.000000000 +lat_ts=47.000000000 +x_0=0.000 +y_0=0.000 +units=m +no_defs <>
-<GEOPORTALWLF> +title=Geoportail - Wallis et Futuna +proj=eqc +nadgrids=null +wktext +towgs84=0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.000000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=0.000000000 +lat_ts=-14.000000000 +x_0=0.000 +y_0=0.000 +units=m +no_defs <>
-# W [GLOR77UTM38S]
-<GUAD48UTM20> +title=Guadeloupe Ste Anne +proj=tmerc +towgs84=-472.2900,-5.6300,-304.1200,0.4362,-0.8374,0.2563,1.898400 +a=6378388.0000 +rf=297.0000000000000 +lat_0=0.000000000 +lon_0=-63.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=0.000 +units=m +no_defs <>
-<GUADFM49U20> +title=Guadeloupe Fort Marigot  +proj=tmerc +towgs84=136.5960,248.1480,-429.7890 +a=6378388.0000 +rf=297.0000000000000 +lat_0=0.000000000 +lon_0=-63.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=0.000 +units=m +no_defs <>
-# W [HAO58UTM7S]
-# W [HAO67UTM7S]
-# W [HARA49UTM7S]
-# W [HIKU50UTM7S]
-# W [HIVA60UTM7S]
-# W [HIVA67UTM7S]
-<IGN63UTM7S> +title=IGN 1963 - Hiva Oa, Tahuata, Mohotani - UTM fuseau 7 Sud +proj=tmerc +towgs84=410.7210,55.0490,80.7460,-2.5779,-2.3514,-0.6664,17.331100 +a=6378388.0000 +rf=297.0000000000000 +lat_0=0.000000000 +lon_0=-141.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs <>
-<IGN72LAM> +title=IGN 1972 - Lambert Nouvelle Caledonie +proj=lcc +towgs84=-11.6400,-348.6000,291.6800 +a=6378388.0000 +rf=297.0000000000000 +lat_0=-21.499999999 +lon_0=166.000000000 +lat_1=-20.666666667 +lat_2=-22.333333333 +x_0=400000.000 +y_0=300000.000 +units=m +no_defs <>
-<IGN72UTM58S> +title=IGN 1972 - UTM fuseau 58 Sud +proj=tmerc +towgs84=-11.6400,-348.6000,291.6800 +a=6378388.0000 +rf=297.0000000000000 +lat_0=0.000000000 +lon_0=165.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs <>
-<KAUE70UTM6S> +title=MHPF70 (Kauehi) Tuamotu - UTM fuseau 6 Sud +proj=tmerc +towgs84=126.7400,300.1000,-75.4900 +a=6378388.0000 +rf=297.0000000000000 +lat_0=0.000000000 +lon_0=-147.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs <>
-<KERG62UTM42S> +title=Kerguelen 1962 +proj=tmerc +towgs84=144.8990,-186.7700,100.9230 +a=6378388.0000 +rf=297.0000000000000 +lat_0=0.000000000 +lon_0=69.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs <>
-<LAMB1> +title=Lambert I +proj=lcc +nadgrids=ntf_r93.gsb,null +wktext +towgs84=-168.0000,-60.0000,320.0000 +a=6378249.2000 +rf=293.4660210000000 +pm=2.337229167 +lat_0=49.500000000 +lon_0=0.000000000 +k_0=0.99987734 +lat_1=49.500000000 +x_0=600000.000 +y_0=200000.000 +units=m +no_defs <>
-<LAMB1C> +title=Lambert I Carto +proj=lcc +nadgrids=ntf_r93.gsb,null +wktext +towgs84=-168.0000,-60.0000,320.0000 +a=6378249.2000 +rf=293.4660210000000 +pm=2.337229167 +lat_0=49.500000000 +lon_0=0.000000000 +k_0=0.99987734 +lat_1=49.500000000 +x_0=600000.000 +y_0=1200000.000 +units=m +no_defs <>
-<LAMB2> +title=Lambert II +proj=lcc +nadgrids=ntf_r93.gsb,null +wktext +towgs84=-168.0000,-60.0000,320.0000 +a=6378249.2000 +rf=293.4660210000000 +pm=2.337229167 +lat_0=46.800000000 +lon_0=0.000000000 +k_0=0.99987742 +lat_1=46.800000000 +x_0=600000.000 +y_0=200000.000 +units=m +no_defs <>
-<LAMB2C> +title=Lambert II Carto +proj=lcc +nadgrids=ntf_r93.gsb,null +wktext +towgs84=-168.0000,-60.0000,320.0000 +a=6378249.2000 +rf=293.4660210000000 +pm=2.337229167 +lat_0=46.800000000 +lon_0=0.000000000 +k_0=0.99987742 +lat_1=46.800000000 +x_0=600000.000 +y_0=2200000.000 +units=m +no_defs <>
-<LAMB3> +title=Lambert III +proj=lcc +nadgrids=ntf_r93.gsb,null +wktext +towgs84=-168.0000,-60.0000,320.0000 +a=6378249.2000 +rf=293.4660210000000 +pm=2.337229167 +lat_0=44.100000000 +lon_0=0.000000000 +k_0=0.99987750 +lat_1=44.100000000 +x_0=600000.000 +y_0=200000.000 +units=m +no_defs <>
-<LAMB3C> +title=Lambert III Carto +proj=lcc +nadgrids=ntf_r93.gsb,null +wktext +towgs84=-168.0000,-60.0000,320.0000 +a=6378249.2000 +rf=293.4660210000000 +pm=2.337229167 +lat_0=44.100000000 +lon_0=0.000000000 +k_0=0.99987750 +lat_1=44.100000000 +x_0=600000.000 +y_0=3200000.000 +units=m +no_defs <>
-<LAMB4> +title=Lambert IV +proj=lcc +nadgrids=ntf_r93.gsb,null +wktext +towgs84=-168.0000,-60.0000,320.0000 +a=6378249.2000 +rf=293.4660210000000 +pm=2.337229167 +lat_0=42.165000000 +lon_0=0.000000000 +k_0=0.99994471 +lat_1=42.165000000 +x_0=234.358 +y_0=185861.369 +units=m +no_defs <>
-<LAMB4C> +title=Lambert IV Carto +proj=lcc +nadgrids=ntf_r93.gsb,null +wktext +towgs84=-168.0000,-60.0000,320.0000 +a=6378249.2000 +rf=293.4660210000000 +pm=2.337229167 +lat_0=42.165000000 +lon_0=0.000000000 +k_0=0.99994471 +lat_1=42.165000000 +x_0=234.358 +y_0=4185861.369 +units=m +no_defs <>
-<LAMB93> +title=Lambert 93 +proj=lcc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=46.500000000 +lon_0=3.000000000 +lat_1=44.000000000 +lat_2=49.000000000 +x_0=700000.000 +y_0=6600000.000 +units=m +no_defs <>
-<LAMBE> +title=Lambert II etendu +proj=lcc +nadgrids=ntf_r93.gsb,null +wktext +towgs84=-168.0000,-60.0000,320.0000 +a=6378249.2000 +rf=293.4660210000000 +pm=2.337229167 +lat_0=46.800000000 +lon_0=0.000000000 +k_0=0.99987742 +lat_1=46.800000000 +x_0=600000.000 +y_0=2200000.000 +units=m +no_defs <>
-<LAMBGC> +title=Lambert grand champ +proj=lcc +nadgrids=ntf_r93.gsb,null +wktext +towgs84=-168.0000,-60.0000,320.0000 +a=6378249.2000 +rf=293.4660210000000 +pm=2.337229167 +lat_0=47.000000000 +lon_0=0.000000000 +lat_1=45.000000000 +lat_2=49.000000000 +x_0=600000.000 +y_0=600000.000 +units=m +no_defs <>
-<LUXGAUSSK> +title=Luxembourg 1929 +proj=tmerc +towgs84=-192.9860,13.6730,-39.3090,-0.4099,-2.9332,2.6881,0.430000 +a=6378388.0000 +rf=297.0000000000000 +lat_0=49.833333333 +lon_0=6.166666667 +k_0=1.00000000 +x_0=80000.000 +y_0=100000.000 +units=m +no_defs <>
-# W [MAKE50UTM7S]
-# W [MANGA51U8S]
-<MARE53UTM58S> +title=Mare - Iles Loyaute - UTM fuseau 58 Sud +proj=tmerc +towgs84=287.0000,178.0000,-136.0000 +a=6378388.0000 +rf=297.0000000000000 +lat_0=0.000000000 +lon_0=165.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs <>
-<MART38UTM20> +title=Martinique Fort-Desaix +proj=tmerc +towgs84=126.9260,547.9390,130.4090,-2.7867,5.1612,-0.8584,13.822650 +a=6378388.0000 +rf=297.0000000000000 +lat_0=0.000000000 +lon_0=-63.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=0.000 +units=m +no_defs <>
-# W [MAUPITIUTM5S]
-<MAYO50UTM38S> +title=Mayotte Combani +proj=tmerc +towgs84=-599.9280,-275.5520,-195.6650,-0.0835,-0.4715,0.0602,49.281400 +a=6378388.0000 +rf=297.0000000000000 +lat_0=0.000000000 +lon_0=45.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs <>
-<MHPF67UTM8S> +title=MHPF67 (Mangareva, Agakauitai, Aukena, Mekiro) Gambiers (Iles) - UTM 8 S +proj=tmerc +towgs84=338.0800,212.5800,-296.1700 +a=6378388.0000 +rf=297.0000000000000 +lat_0=0.000000000 +lon_0=-135.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs <>
-<MILLER> +title=Geoportail - Monde +proj=mill +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lon_0=0.000000000 +x_0=0.000 +y_0=0.000 +units=m +no_defs <>
-<MOOREA87U6S> +title=Moorea 1987 - UTM fuseau 6 Sud +proj=tmerc +towgs84=215.9820,149.5930,176.2290,3.2624,1.6920,1.1571,10.477300 +a=6378388.0000 +rf=297.0000000000000 +lat_0=0.000000000 +lon_0=-147.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs <>
-<MOP90UTM6S> +title=MOP90 (Tetiaroa) Iles de la Societe - UTM fuseau 6 Sud +proj=tmerc +towgs84=217.0370,86.9590,23.9560 +a=6378388.0000 +rf=297.0000000000000 +lat_0=0.000000000 +lon_0=-147.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs <>
-# W [MURU59UTM7S]
-# W [MURU62UTM7S]
-# W [MURU78UTM7S]
-# W [NC51UTM58S]
-# W [NOVA53UTM38S]
-<NUKU72U7S> +title=IGN 1972 Nuku Hiva - UTM fuseau 7 Sud +proj=tmerc +towgs84=165.7320,216.7200,180.5050,-0.6434,-0.4512,-0.0791,7.420400 +a=6378388.0000 +rf=297.0000000000000 +lat_0=0.000000000 +lon_0=-141.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs <>
-<NUKU94UTM7S> +title=IGN 1994 Nuku Hiva - UTM fuseau 7 Sud +proj=tmerc +towgs84=197.1600,200.1700,-48.0800 +a=6378388.0000 +rf=297.0000000000000 +lat_0=0.000000000 +lon_0=-141.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs <>
-<OUVEA72U58S> +title=Ouvea - Iles Loyaute - UTM fuseau 58 Sud +proj=tmerc +towgs84=-13.0000,-348.0000,292.0000 +a=6378388.0000 +rf=297.0000000000000 +lat_0=0.000000000 +lon_0=165.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs <>
-<RAIA53UTM5S> +title=IGN53 (IGN Raiatea-Tahaa) Raiatea-Tahaa-Bora Bora-Huahine - UTM fuseau 5 +proj=tmerc +towgs84=65.0300,341.5500,76.6700 +a=6378388.0000 +rf=297.0000000000000 +lat_0=0.000000000 +lon_0=-153.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs <>
-# W [RAIV54UTM6S]
-# W [RAIV66UTM6S]
-# W [RANGI47U6S]
-# W [RANGI59U6S]
-# W [RANGI68U6S]
-<REUN47GAUSSL> +title=Reunion Gauss Laborde +proj=gstmerc +towgs84=789.5240,-626.4860,-89.9040,0.6006,76.7946,-10.5788,-32.324100 +a=6378388.0000 +rf=297.0000000000000 +lat_0=-21.116666667 +lon_0=55.533333333 +k_0=1.00000000 +x_0=160000.000 +y_0=50000.000 +units=m +no_defs <>
-<RGF93CC42> +title=Projection conique conforme Zone 1 +proj=lcc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=42.000000000 +lon_0=3.000000000 +lat_1=41.250000000 +lat_2=42.750000000 +x_0=1700000.000 +y_0=1200000.000 +units=m +no_defs <>
-<RGF93CC43> +title=Projection conique conforme Zone 2 +proj=lcc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=43.000000000 +lon_0=3.000000000 +lat_1=42.250000000 +lat_2=43.750000000 +x_0=1700000.000 +y_0=2200000.000 +units=m +no_defs <>
-<RGF93CC44> +title=Projection conique conforme Zone 3 +proj=lcc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=44.000000000 +lon_0=3.000000000 +lat_1=43.250000000 +lat_2=44.750000000 +x_0=1700000.000 +y_0=3200000.000 +units=m +no_defs <>
-<RGF93CC45> +title=Projection conique conforme Zone 4 +proj=lcc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=45.000000000 +lon_0=3.000000000 +lat_1=44.250000000 +lat_2=45.750000000 +x_0=1700000.000 +y_0=4200000.000 +units=m +no_defs <>
-<RGF93CC46> +title=Projection conique conforme Zone 5 +proj=lcc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=46.000000000 +lon_0=3.000000000 +lat_1=45.250000000 +lat_2=46.750000000 +x_0=1700000.000 +y_0=5200000.000 +units=m +no_defs <>
-<RGF93CC47> +title=Projection conique conforme Zone 6 +proj=lcc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=47.000000000 +lon_0=3.000000000 +lat_1=46.250000000 +lat_2=47.750000000 +x_0=1700000.000 +y_0=6200000.000 +units=m +no_defs <>
-<RGF93CC48> +title=Projection conique conforme Zone 7 +proj=lcc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=48.000000000 +lon_0=3.000000000 +lat_1=47.250000000 +lat_2=48.750000000 +x_0=1700000.000 +y_0=7200000.000 +units=m +no_defs <>
-<RGF93CC49> +title=Projection conique conforme Zone 8 +proj=lcc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=49.000000000 +lon_0=3.000000000 +lat_1=48.250000000 +lat_2=49.750000000 +x_0=1700000.000 +y_0=8200000.000 +units=m +no_defs <>
-<RGF93CC50> +title=Projection conique conforme Zone 9 +proj=lcc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=50.000000000 +lon_0=3.000000000 +lat_1=49.250000000 +lat_2=50.750000000 +x_0=1700000.000 +y_0=9200000.000 +units=m +no_defs <>
-<RGM04UTM38S> +title=UTM fuseau 38 Sud (Reseau Geodesique de Mayotte 2004) +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=45.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs <>
-<RGNCLAM> +title=Reseau Geodesique de Nouvelle-Caledonie - Lambert Nouvelle Caledonie +proj=lcc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=-21.499999999 +lon_0=166.000000000 +lat_1=-20.666666667 +lat_2=-22.333333333 +x_0=400000.000 +y_0=300000.000 +units=m +no_defs <>
-<RGNCUTM57S> +title=Reseau Geodesique de Nouvelle-Caledonie - UTM fuseau 57 Sud +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=159.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs <>
-<RGNCUTM58S> +title=Reseau Geodesique de Nouvelle-Caledonie - UTM fuseau 58 Sud +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=165.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs <>
-<RGNCUTM59S> +title=Reseau Geodesique de Nouvelle-Caledonie - UTM fuseau 59 Sud +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=171.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs <>
-<RGPFUTM5S> +title=RGPF - UTM fuseau 5 Sud +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=-153.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs <>
-<RGPFUTM6S> +title=RGPF - UTM fuseau 6 Sud +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=-147.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs <>
-<RGPFUTM7S> +title=RGPF - UTM fuseau 7 Sud +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=-141.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs <>
-<RGR92UTM40S> +title=RGR92 UTM fuseau 40 Sud +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=57.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs <>
-<RGSPM06U21> +title=Saint-Pierre-et-Miquelon (2006) UTM Fuseau 21 Nord +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=-57.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=0.000 +units=m +no_defs <>
-<SAT84UTM5S> +title=SAT84 (Rurutu) Iles Australes - UTM fuseau 5 Sud +proj=tmerc +towgs84=202.1300,174.6000,-15.7400 +a=6378388.0000 +rf=297.0000000000000 +lat_0=0.000000000 +lon_0=-153.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs <>
-<STPL69UTM43S> +title=Saint-Paul 1969 +proj=tmerc +towgs84=225.5710,-346.6080,-46.5670 +a=6378388.0000 +rf=297.0000000000000 +lat_0=0.000000000 +lon_0=75.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs <>
-<STPM50UTM21> +title=St Pierre et Miquelon 1950 +proj=tmerc +towgs84=-95.5930,573.7630,173.4420,-0.9602,1.2510,-1.3918,42.626500 +a=6378206.4000 +rf=294.9786982000000 +lat_0=0.000000000 +lon_0=-57.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=0.000 +units=m +no_defs <>
-<TAHAAUTM05S> +title=Tahaa 1951 +proj=tmerc +towgs84=72.4380,345.9180,79.4860,-1.6045,-0.8823,-0.5565,1.374600 +a=6378388.0000 +rf=297.0000000000000 +lat_0=0.000000000 +lon_0=-153.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs <>
-<TAHI51UTM06S> +title=Tahiti-Terme Nord UTM fuseau 6 Sud +proj=tmerc +towgs84=162.0000,117.0000,154.0000 +a=6378388.0000 +rf=297.0000000000000 +lat_0=0.000000000 +lon_0=-147.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs <>
-<TAHI79UTM6S> +title=Tahiti 1979 +proj=tmerc +towgs84=221.5250,152.9480,176.7680,2.3847,1.3896,0.8770,11.474100 +a=6378388.0000 +rf=297.0000000000000 +lat_0=0.000000000 +lon_0=-147.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs <>
-# W [TAKA69UTM6S]
-<TANNAUTM59S> +title=Tanna Bloc Sud - UTM fuseau 59 Sud +proj=tmerc +towgs84=-139.0000,-967.0000,436.0000 +a=6378388.0000 +rf=297.0000000000000 +lat_0=0.000000000 +lon_0=171.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs <>
-<TERA50STEREO> +title=Terre Adelie 1950 +proj=stere +towgs84=324.9120,153.2820,172.0260 +a=6378388.0000 +rf=297.0000000000000 +lat_0=-90.000000000 +lon_0=140.000000000 +lat_ts=-67.000000000 +k=0.96027295 +x_0=300000.000 +y_0=-2299363.482 +units=m +no_defs <>
-# W [TIKE50UTM6S]
-# W [TIKE60UTM6S]
-<TUBU69UTM6S> +title=Tubuai - Iles Australes - UTM fuseau 6 Sud +proj=tmerc +towgs84=237.1700,171.6100,-77.8400 +a=6378388.0000 +rf=297.0000000000000 +lat_0=0.000000000 +lon_0=-147.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs <>
-# W [TURI69UTM7S]
-<UTM01SW72> +title=World Geodetic System 1972 UTM fuseau 01 Sud +proj=tmerc +towgs84=0.0000,12.0000,6.0000 +a=6378135.0000 +rf=298.2600000000000 +lat_0=0.000000000 +lon_0=-177.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs <>
-<UTM01SW84> +title=World Geodetic System 1984 UTM fuseau 01 Sud +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=-177.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs <>
-<UTM01W84> +title=World Geodetic System 1984 UTM fuseau 01 +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=-177.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=0.000 +units=m +no_defs <>
-<UTM02SW84> +title=World Geodetic System 1984 UTM fuseau 02 Sud +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=-171.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs <>
-<UTM02W84> +title=World Geodetic System 1984 UTM fuseau 02 +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=-171.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=0.000 +units=m +no_defs <>
-<UTM03SW84> +title=World Geodetic System 1984 UTM fuseau 03 Sud +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=-165.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs <>
-<UTM03W84> +title=World Geodetic System 1984 UTM fuseau 03 +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=-165.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=0.000 +units=m +no_defs <>
-<UTM04SW84> +title=World Geodetic System 1984 UTM fuseau 04 Sud +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=-159.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs <>
-<UTM04W84> +title=World Geodetic System 1984 UTM fuseau 04 +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=-159.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=0.000 +units=m +no_defs <>
-<UTM05SW84> +title=World Geodetic System 1984 UTM fuseau 05 Sud +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=-153.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs <>
-<UTM05W84> +title=World Geodetic System 1984 UTM fuseau 05 +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=-153.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=0.000 +units=m +no_defs <>
-<UTM06SW84> +title=World Geodetic System 1984 UTM fuseau 06 Sud +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=-147.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs <>
-<UTM06W84> +title=World Geodetic System 1984 UTM fuseau 06 +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=-147.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=0.000 +units=m +no_defs <>
-<UTM07SW84> +title=World Geodetic System 1984 UTM fuseau 07 Sud +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=-141.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs <>
-<UTM07W84> +title=World Geodetic System 1984 UTM fuseau 07 +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=-141.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=0.000 +units=m +no_defs <>
-<UTM08SW84> +title=World Geodetic System 1984 UTM fuseau 08 Sud +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=-135.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs <>
-<UTM08W84> +title=World Geodetic System 1984 UTM fuseau 08 +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=-135.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=0.000 +units=m +no_defs <>
-<UTM09SW84> +title=World Geodetic System 1984 UTM fuseau 09 Sud +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=-129.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs <>
-<UTM09W84> +title=World Geodetic System 1984 UTM fuseau 09 +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=-129.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=0.000 +units=m +no_defs <>
-<UTM10SW84> +title=World Geodetic System 1984 UTM fuseau 10 Sud +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=-123.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs <>
-<UTM10W84> +title=World Geodetic System 1984 UTM fuseau 10 +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=-123.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=0.000 +units=m +no_defs <>
-<UTM11SW84> +title=World Geodetic System 1984 UTM fuseau 11 Sud +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=-117.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs <>
-<UTM11W84> +title=World Geodetic System 1984 UTM fuseau 11 +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=-117.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=0.000 +units=m +no_defs <>
-<UTM12SW84> +title=World Geodetic System 1984 UTM fuseau 12 Sud +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=-111.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs <>
-<UTM12W84> +title=World Geodetic System 1984 UTM fuseau 12 +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=-111.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=0.000 +units=m +no_defs <>
-<UTM13SW84> +title=World Geodetic System 1984 UTM fuseau 13 Sud +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=-105.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs <>
-<UTM13W84> +title=World Geodetic System 1984 UTM fuseau 13 +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=-105.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=0.000 +units=m +no_defs <>
-<UTM14SW84> +title=World Geodetic System 1984 UTM fuseau 14 Sud +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=-99.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs <>
-<UTM14W84> +title=World Geodetic System 1984 UTM fuseau 14 +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=-99.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=0.000 +units=m +no_defs <>
-<UTM15SW84> +title=World Geodetic System 1984 UTM fuseau 15 Sud +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=-93.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs <>
-<UTM15W84> +title=World Geodetic System 1984 UTM fuseau 15 +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=-93.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=0.000 +units=m +no_defs <>
-<UTM16SW84> +title=World Geodetic System 1984 UTM fuseau 16 Sud +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=-87.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs <>
-<UTM16W84> +title=World Geodetic System 1984 UTM fuseau 16 +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=-87.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=0.000 +units=m +no_defs <>
-<UTM17SW84> +title=World Geodetic System 1984 UTM fuseau 17 Sud +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=-81.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs <>
-<UTM17W84> +title=World Geodetic System 1984 UTM fuseau 17 +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=-81.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=0.000 +units=m +no_defs <>
-<UTM18SW84> +title=World Geodetic System 1984 UTM fuseau 18 Sud +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=-75.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs <>
-<UTM18W84> +title=World Geodetic System 1984 UTM fuseau 18 +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=-75.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=0.000 +units=m +no_defs <>
-<UTM19SW84> +title=World Geodetic System 1984 UTM fuseau 19 Sud +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=-69.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs <>
-<UTM19W84> +title=World Geodetic System 1984 UTM fuseau 19 +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=-69.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=0.000 +units=m +no_defs <>
-<UTM20SW84> +title=World Geodetic System 1984 UTM fuseau 20 Sud +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=-63.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs <>
-<UTM20W84> +title=World Geodetic System 1984 UTM fuseau 20 +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=-63.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=0.000 +units=m +no_defs <>
-<UTM20W84GUAD> +title=World Geodetic System 1984 UTM fuseau 20 Nord-Guadeloupe +proj=tmerc +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=-63.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=0.000 +units=m +no_defs <>
-<UTM20W84MART> +title=World Geodetic System 1984 UTM fuseau 20 Nord-Martinique +proj=tmerc +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=-63.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=0.000 +units=m +no_defs <>
-<UTM21SW84> +title=World Geodetic System 1984 UTM fuseau 21 Sud +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=-57.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs <>
-<UTM21W84> +title=World Geodetic System 1984 UTM fuseau 21 +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=-57.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=0.000 +units=m +no_defs <>
-<UTM22RGFG95> +title=RGFG95 UTM fuseau 22 Nord-Guyane +proj=tmerc +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=-51.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=0.000 +units=m +no_defs <>
-<UTM22SW84> +title=World Geodetic System 1984 UTM fuseau 22 Sud +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=-51.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs <>
-<UTM22W84> +title=World Geodetic System 1984 UTM fuseau 22 +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=-51.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=0.000 +units=m +no_defs <>
-<UTM23SW84> +title=World Geodetic System 1984 UTM fuseau 23 Sud +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=-45.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs <>
-<UTM23W84> +title=World Geodetic System 1984 UTM fuseau 23 +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=-45.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=0.000 +units=m +no_defs <>
-<UTM24SW84> +title=World Geodetic System 1984 UTM fuseau 24 Sud +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=-39.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs <>
-<UTM24W84> +title=World Geodetic System 1984 UTM fuseau 24 +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=-39.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=0.000 +units=m +no_defs <>
-<UTM25SW84> +title=World Geodetic System 1984 UTM fuseau 25 Sud +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=-33.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs <>
-<UTM25W84> +title=World Geodetic System 1984 UTM fuseau 25 +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=-33.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=0.000 +units=m +no_defs <>
-<UTM26ETRS89> +title=Europe - de 30d a 24d Ouest +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=-27.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=0.000 +units=m +no_defs <>
-<UTM26SW84> +title=World Geodetic System 1984 UTM fuseau 26 Sud +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=-27.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs <>
-<UTM26W84> +title=World Geodetic System 1984 UTM fuseau 26 +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=-27.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=0.000 +units=m +no_defs <>
-<UTM27ETRS89> +title=Europe - de 24d a 18d Ouest +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=-21.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=0.000 +units=m +no_defs <>
-<UTM27SW84> +title=World Geodetic System 1984 UTM fuseau 27 Sud +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=-21.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs <>
-<UTM27W84> +title=World Geodetic System 1984 UTM fuseau 27 +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=-21.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=0.000 +units=m +no_defs <>
-<UTM28ETRS89> +title=Europe - de 18d a 12d Ouest +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=-15.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=0.000 +units=m +no_defs <>
-<UTM28SW84> +title=World Geodetic System 1984 UTM fuseau 28 Sud +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=-15.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs <>
-<UTM28W84> +title=World Geodetic System 1984 UTM fuseau 28 +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=-15.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=0.000 +units=m +no_defs <>
-<UTM29ETRS89> +title=Europe - de 12d a 6d Ouest +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=-9.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=0.000 +units=m +no_defs <>
-<UTM29SW84> +title=World Geodetic System 1984 UTM fuseau 29 Sud +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=-9.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs <>
-<UTM29W84> +title=World Geodetic System 1984 UTM fuseau 29 +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=-9.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=0.000 +units=m +no_defs <>
-<UTM30> +title=European Datum 1950 UTM fuseau 30 +proj=tmerc +towgs84=-84.0000,-97.0000,-117.0000 +a=6378388.0000 +rf=297.0000000000000 +lat_0=0.000000000 +lon_0=-3.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=0.000 +units=m +no_defs <>
-<UTM30ETRS89> +title=Europe - de -6d a 0d Ouest +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=-3.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=0.000 +units=m +no_defs <>
-<UTM30RGF93> +title=RGF93 UTM fuseau 30 +proj=tmerc +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=-3.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=0.000 +units=m +no_defs <>
-<UTM30SW84> +title=World Geodetic System 1984 UTM fuseau 30 Sud +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=-3.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs <>
-<UTM30W72> +title=World Geodetic System 1972 UTM fuseau 30 +proj=tmerc +towgs84=0.0000,12.0000,6.0000 +a=6378135.0000 +rf=298.2600000000000 +lat_0=0.000000000 +lon_0=-3.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=0.000 +units=m +no_defs <>
-<UTM30W84> +title=World Geodetic System 1984 UTM fuseau 30 +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=-3.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=0.000 +units=m +no_defs <>
-<UTM31> +title=European Datum 1950 UTM fuseau 31 +proj=tmerc +towgs84=-84.0000,-97.0000,-117.0000 +a=6378388.0000 +rf=297.0000000000000 +lat_0=0.000000000 +lon_0=3.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=0.000 +units=m +no_defs <>
-<UTM31ETRS89> +title=Europe - de 0d a 6d Est +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=3.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=0.000 +units=m +no_defs <>
-<UTM31RGF93> +title=RGF93 UTM fuseau 31 +proj=tmerc +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=3.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=0.000 +units=m +no_defs <>
-<UTM31SW84> +title=World Geodetic System 1984 UTM fuseau 31 Sud +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=3.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs <>
-<UTM31W72> +title=World Geodetic System 1972 UTM fuseau 31 +proj=tmerc +towgs84=0.0000,12.0000,6.0000 +a=6378135.0000 +rf=298.2600000000000 +lat_0=0.000000000 +lon_0=3.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=0.000 +units=m +no_defs <>
-<UTM31W84> +title=World Geodetic System 1984 UTM fuseau 31 +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=3.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=0.000 +units=m +no_defs <>
-<UTM32> +title=European Datum 1950 UTM fuseau 32 +proj=tmerc +towgs84=-84.0000,-97.0000,-117.0000 +a=6378388.0000 +rf=297.0000000000000 +lat_0=0.000000000 +lon_0=9.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=0.000 +units=m +no_defs <>
-<UTM32ETRS89> +title=Europe - de 6d a 12d Est +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=9.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=0.000 +units=m +no_defs <>
-<UTM32RGF93> +title=RGF93 UTM fuseau 32 +proj=tmerc +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=9.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=0.000 +units=m +no_defs <>
-<UTM32SW84> +title=World Geodetic System 1984 UTM fuseau 32 Sud +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=9.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs <>
-<UTM32W72> +title=World Geodetic System 1972 UTM fuseau 32 +proj=tmerc +towgs84=0.0000,12.0000,6.0000 +a=6378135.0000 +rf=298.2600000000000 +lat_0=0.000000000 +lon_0=9.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=0.000 +units=m +no_defs <>
-<UTM32W84> +title=World Geodetic System 1984 UTM fuseau 32 +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=9.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=0.000 +units=m +no_defs <>
-<UTM33ETRS89> +title=Europe - de 12d a 18d Est +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=15.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=0.000 +units=m +no_defs <>
-<UTM33SW84> +title=World Geodetic System 1984 UTM fuseau 33 Sud +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=15.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs <>
-<UTM33W84> +title=World Geodetic System 1984 UTM fuseau 33 +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=15.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=0.000 +units=m +no_defs <>
-<UTM34ETRS89> +title=Europe - de 18d a 24d Est +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=21.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=0.000 +units=m +no_defs <>
-<UTM34SW84> +title=World Geodetic System 1984 UTM fuseau 34 Sud +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=21.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs <>
-<UTM34W84> +title=World Geodetic System 1984 UTM fuseau 34 +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=21.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=0.000 +units=m +no_defs <>
-<UTM35ETRS89> +title=Europe - de 24d a 30d Est +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=27.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=0.000 +units=m +no_defs <>
-<UTM35SW84> +title=World Geodetic System 1984 UTM fuseau 35 Sud +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=27.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs <>
-<UTM35W84> +title=World Geodetic System 1984 UTM fuseau 35 +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=27.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=0.000 +units=m +no_defs <>
-<UTM36ETRS89> +title=Europe - de 30d a 36d Est +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=33.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=0.000 +units=m +no_defs <>
-<UTM36SW84> +title=World Geodetic System 1984 UTM fuseau 36 Sud +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=33.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs <>
-<UTM36W84> +title=World Geodetic System 1984 UTM fuseau 36 +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=33.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=0.000 +units=m +no_defs <>
-<UTM37ETRS89> +title=Europe - de 36d a 42d Est +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=39.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=0.000 +units=m +no_defs <>
-<UTM37SW84> +title=World Geodetic System 1984 UTM fuseau 37 Sud +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=39.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs <>
-<UTM37W84> +title=World Geodetic System 1984 UTM fuseau 37 +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=39.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=0.000 +units=m +no_defs <>
-<UTM38ETRS89> +title=Europe - de 42d a 48d Est +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=45.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=0.000 +units=m +no_defs <>
-<UTM38SW84> +title=World Geodetic System 1984 UTM fuseau 38 Sud +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=45.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs <>
-<UTM38W84> +title=World Geodetic System 1984 UTM fuseau 38 +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=45.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=0.000 +units=m +no_defs <>
-<UTM39SW84> +title=World Geodetic System 1984 UTM fuseau 39 Sud +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=51.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs <>
-<UTM39W84> +title=World Geodetic System 1984 UTM fuseau 39 +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=51.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=0.000 +units=m +no_defs <>
-<UTM40SW84> +title=World Geodetic System 1984 UTM fuseau 40 Sud +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=57.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs <>
-<UTM40W84> +title=World Geodetic System 1984 UTM fuseau 40 +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=57.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=0.000 +units=m +no_defs <>
-<UTM41SW84> +title=World Geodetic System 1984 UTM fuseau 41 Sud +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=63.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs <>
-<UTM41W84> +title=World Geodetic System 1984 UTM fuseau 41 +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=63.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=0.000 +units=m +no_defs <>
-<UTM42SW84> +title=World Geodetic System 1984 UTM fuseau 42 Sud +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=69.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs <>
-<UTM42W84> +title=World Geodetic System 1984 UTM fuseau 42 +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=69.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=0.000 +units=m +no_defs <>
-<UTM43SW84> +title=World Geodetic System 1984 UTM fuseau 43 Sud +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=75.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs <>
-<UTM43W84> +title=World Geodetic System 1984 UTM fuseau 43 +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=75.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=0.000 +units=m +no_defs <>
-<UTM44SW84> +title=World Geodetic System 1984 UTM fuseau 44 Sud +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=81.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs <>
-<UTM44W84> +title=World Geodetic System 1984 UTM fuseau 44 +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=81.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=0.000 +units=m +no_defs <>
-<UTM45SW84> +title=World Geodetic System 1984 UTM fuseau 45 Sud +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=87.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs <>
-<UTM45W84> +title=World Geodetic System 1984 UTM fuseau 45 +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=87.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=0.000 +units=m +no_defs <>
-<UTM46SW84> +title=World Geodetic System 1984 UTM fuseau 46 Sud +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=93.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs <>
-<UTM46W84> +title=World Geodetic System 1984 UTM fuseau 46 +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=93.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=0.000 +units=m +no_defs <>
-<UTM47SW84> +title=World Geodetic System 1984 UTM fuseau 47 Sud +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=99.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs <>
-<UTM47W84> +title=World Geodetic System 1984 UTM fuseau 47 +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=99.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=0.000 +units=m +no_defs <>
-<UTM48SW84> +title=World Geodetic System 1984 UTM fuseau 48 Sud +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=105.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs <>
-<UTM48W84> +title=World Geodetic System 1984 UTM fuseau 48 +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=105.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=0.000 +units=m +no_defs <>
-<UTM49SW84> +title=World Geodetic System 1984 UTM fuseau 49 Sud +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=111.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs <>
-<UTM49W84> +title=World Geodetic System 1984 UTM fuseau 49 +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=111.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=0.000 +units=m +no_defs <>
-<UTM50SW84> +title=World Geodetic System 1984 UTM fuseau 50 Sud +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=117.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs <>
-<UTM50W84> +title=World Geodetic System 1984 UTM fuseau 50 +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=117.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=0.000 +units=m +no_defs <>
-<UTM51SW84> +title=World Geodetic System 1984 UTM fuseau 51 Sud +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=123.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs <>
-<UTM51W84> +title=World Geodetic System 1984 UTM fuseau 51 +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=123.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=0.000 +units=m +no_defs <>
-<UTM52SW84> +title=World Geodetic System 1984 UTM fuseau 52 Sud +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=129.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs <>
-<UTM52W84> +title=World Geodetic System 1984 UTM fuseau 52 +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=129.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=0.000 +units=m +no_defs <>
-<UTM53SW84> +title=World Geodetic System 1984 UTM fuseau 53 Sud +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=135.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs <>
-<UTM53W84> +title=World Geodetic System 1984 UTM fuseau 53 +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=135.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=0.000 +units=m +no_defs <>
-<UTM54SW84> +title=World Geodetic System 1984 UTM fuseau 54 Sud +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=141.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs <>
-<UTM54W84> +title=World Geodetic System 1984 UTM fuseau 54 +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=141.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=0.000 +units=m +no_defs <>
-<UTM55SW84> +title=World Geodetic System 1984 UTM fuseau 55 Sud +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=147.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs <>
-<UTM55W84> +title=World Geodetic System 1984 UTM fuseau 55 +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=147.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=0.000 +units=m +no_defs <>
-<UTM56SW84> +title=World Geodetic System 1984 UTM fuseau 56 Sud +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=153.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs <>
-<UTM56W84> +title=World Geodetic System 1984 UTM fuseau 56 +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=153.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=0.000 +units=m +no_defs <>
-<UTM57SW84> +title=World Geodetic System 1984 UTM fuseau 57 Sud +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=159.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs <>
-<UTM57W84> +title=World Geodetic System 1984 UTM fuseau 57 +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=159.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=0.000 +units=m +no_defs <>
-<UTM58SW84> +title=World Geodetic System 1984 UTM fuseau 58 Sud +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=165.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs <>
-<UTM58W84> +title=World Geodetic System 1984 UTM fuseau 58 +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=165.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=0.000 +units=m +no_defs <>
-<UTM59SW84> +title=World Geodetic System 1984 UTM fuseau 59 Sud +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=171.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs <>
-<UTM59W84> +title=World Geodetic System 1984 UTM fuseau 59 +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=171.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=0.000 +units=m +no_defs <>
-<UTM60SW84> +title=World Geodetic System 1984 UTM fuseau 60 Sud +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=177.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs <>
-<UTM60W84> +title=World Geodetic System 1984 UTM fuseau 60 +proj=tmerc +nadgrids=@null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=0.000000000 +lon_0=177.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=0.000 +units=m +no_defs <>
-# W [VAITAPEUTM5S]
-# W [WALL76UTM1S]
-<WALL78UTM1S> +title=Wallis-Uvea 1978 (MOP78) UTM 1 SUD +proj=tmerc +towgs84=253.0000,-133.0000,-127.0000 +a=6378388.0000 +rf=297.0000000000000 +lat_0=0.000000000 +lon_0=-177.000000000 +k_0=0.99960000 +x_0=500000.000 +y_0=10000000.000 +units=m +no_defs <>
-#
-#
-##########################################################
-#
-#     Various Non-U.S. Coordinate Systems,
-#
-#
-<CH1903> # Swiss Coordinate System
-	+proj=somerc +lat_0=46d57'8.660"N +lon_0=7d26'22.500"E
-	+ellps=bessel +x_0=600000 +y_0=200000
-	+k_0=1.  no_defs <>
-<madagascar> # Laborde grid for Madagascar
-	proj=labrd ellps=intl lon_0=46d26'13.95E lat_0=18d54S
-	azi=18d54 k_0=.9995 x_0=400000 y_0=800000
-	no_defs <>
-<new_zealand> # New Zealand Map Grid (NZMG)
-	proj=nzmg  # Projection unique to N.Z. so all factors fixed
-	no_defs <>
-# Secondary grids DMA TM8358.1, p. 4.3
-<bwi> # British West Indies
-	proj=tmerc ellps=clrk80 lon_0=62W
-	x_0=400000 k_0=0.9995
-	no_defs <>
-<costa-n> # Costa Rica Norte
-	proj=lcc ellps=clrk66 lat_1=10d28N lon_0=84d20W
-	x_0=500000 y_0=217820.522 k_0=0.99995696
-	no_defs <>
-<costa-s> # Costa Rica Sud
-	proj=lcc ellps=clrk66 lat_1=9dN lon_0=83d40W
-	x_0=500000 y_0=327987.436 k_0=0.99995696
-	no_defs <>
-<cuba-n> # Cuba Norte
-	proj=lcc ellps=clrk66 lat_1=22d21N lon_0=81dW
-	x_0=500000 y_0=280296.016 k_0=0.99993602
-	no_defs <>
-<cuba-s> # Cuba Sud
-	proj=lcc ellps=clrk66 lat_1=20d43'N lon_0=76d50'W
-	x_0=500000 y_0=229126.939 k_0=0.99994848
-	no_defs <>
-<domin_rep> # Dominican Republic
-	proj=lcc ellps=clrk66 lat_1=18d49'N lon_0=71d30'W
-	x_0=500000 y_0=277063.657 k_0=0.99991102
-	no_defs <>
-<egypt-1> # Egypt
-	proj=tmerc ellps=intl lon_0=25d30'E x_0=300000 k_0=0.99985
-	no_defs <>
-<egypt-2> # Egypt
-	proj=tmerc ellps=intl lon_0=28d30'E x_0=300000 k_0=0.99985
-	no_defs <>
-<egypt-3> # Egypt
-	proj=tmerc ellps=intl lon_0=31d30'E x_0=300000 k_0=0.99985
-	no_defs <>
-<egypt-4> # Egypt
-	proj=tmerc ellps=intl lon_0=34d30'E x_0=300000 k_0=0.99985
-	no_defs <>
-<egypt-5> # Egypt
-	proj=tmerc ellps=intl lon_0=37d30'E x_0=300000 k_0=0.99985
-	no_defs <>
-<el_sal> # El Salvador
-	proj=lcc ellps=clrk66 lat_1=13d47'N lon_0=89dW
-	x_0=500000 y_0=295809.184 k_0=0.99996704
-	no_defs <>
-<guat-n> # Guatemala Norte
-	proj=lcc ellps=clrk66 lat_1=16d49'N lon_0=90d20'W
-	x_0=500000 y_0=292209.579 k_0=0.99992226
-	no_defs <>
-<guat-s> # Guatemala Sud
-	proj=lcc ellps=clrk66 lat_1=14d54'N lon_0=90d20'W
-	x_0=500000 y_0=325992.681 k_0=0.99989906
-	no_defs <>
-<haiti> # Haiti
-	proj=lcc ellps=clrk66 lat_1=18d49'N lon_0=71d30'W
-	x_0=500000 y_0=277063.657 k_0=0.99991102
-	no_defs <>
-<hond-n> # Honduras Norte
-	proj=lcc ellps=clrk66 lat_1=15d30'N lon_0=86d10'W
-	x_0=500000 y_0=296917.439 k_0=0.99993273
-	no_defs <>
-<hond-s> # Honduras Sud
-	proj=lcc ellps=clrk66 lat_1=13d47'N lon_0=87d10'W
-	x_0=500000 y_0=296215.903 k_0=0.99995140
-	no_defs <>
-<levant> # Levant
-	proj=lcc ellps=clrk66 lat_1=34d39'N lon_0=37d21'E
-	x_0=500000 y_0=300000 k_0=0.9996256
-	no_defs <>
-<nica-n> # Nicaragua Norte
-	proj=lcc ellps=clrk66 lat_1=13d52'N lon_0=85d30'W
-	x_0=500000 y_0=359891.816 k_0=0.99990314
-	no_defs <>
-<nica-s> # Nicaragua Sud
-	proj=lcc ellps=clrk66 lat_1=11d40'N lon_0=85d30'W
-	x_0=500000 y_0=288876.327 k_0=0.99992228
-	no_defs <>
-<nw-africa> # Northwest Africa
-	proj=lcc ellps=clrk80 lat_1=34dN lon_0=0dE
-	x_0=1000000 y_0=500000 k_0=0.99908
-	no_defs <>
-<palestine> # Palestine
-	proj=tmerc a=6378300.79 rf=293.488307656
-	lat_0=31d44'2.749"N lon_0=35d12'43.490"E
-	x_0=170251.555 y_0=126867.909 k_0=1
-	no_defs <>
-<panama> # Panama
-	proj=lcc ellps=clrk66 lat_1=8d25'N lon_0=80dW
-	x_0=500000 y_0=294865.303 k_0=0.99989909
-	no_defs <>
-# other grids in DMA TM8358.1
-<bng> # British National Grid
-	proj=tmerc ellps=airy lat_0=49dN lon_0=2dW
-	k_0=0.9996012717 x_0=400000 y_0=-100000
-	no_defs <>
-<malay> # West Malaysian RSO Grid
-	proj=omerc a=6377295.66402 rf=300.8017 alpha=323d01'32.846"
-	no_uoff rot_conv lonc=102d15E lat_0=4dN k_0=0.99984 x_0=804670.240 y_0=0
-	no_defs <>
-<india-I> # India Zone I
-	proj=lcc ellps=everest lon_0=68E lat_1=32d30'N
-	x_0=2743185.69 y_0=914395.23 k_0=.998786408
-	no_defs <>
-<india-IIA> # India Zone IIA
-	proj=lcc ellps=everest lon_0=74E lat_1=26N
-	x_0=2743185.69 y_0=914395.23 k_0=.998786408
-	no_defs <>
-<india-IIB> # India Zone IIB
-	proj=lcc ellps=everest lon_0=90E lat_1=26N
-	x_0=2743185.69 y_0=914395.23 k_0=.998786408
-	no_defs <>
-<india-IIIA> # India Zone IIIA
-	proj=lcc ellps=everest lon_0=80E lat_1=19N
-	x_0=2743185.69 y_0=914395.23 k_0=.998786408
-	no_defs <>
-<india-IIIB> # India Zone IIIB
-	proj=lcc ellps=everest lon_0=100E lat_1=19N
-	x_0=2743185.69 y_0=914395.23 k_0=.998786408
-	no_defs <>
-<india-IVA> # India Zone IVA
-	proj=lcc ellps=everest lon_0=80E lat_1=12N
-	x_0=2743185.69 y_0=914395.23 k_0=.998786408
-	no_defs <>
-<india-IVB> # India Zone IVB
-	proj=lcc ellps=everest lon_0=104E lat_1=12N
-	x_0=2743185.69 y_0=914395.23 k_0=.998786408
-	no_defs <>
-<ceylon> # Ceylon Belt
-	proj=tmerc ellps=everest lon_0=80d46'18.160"E lat_0=7d0'1.729"N
-	x_0=160933.56048 y_0=160933.56048 k_0=1.
-	no_defs <>
-<irish> # Irish Transverse Mercator Grid
-	proj=tmerc ellps=mod_airy lat_0=53d30'N lon_0=8W
-	x_0=200000 y_0=250000 k_0=1.000035
-	no_defs <>
-<neiez> # Netherlands East Indies Equitorial Zone
-	proj=merc ellps=bessel lon_0=110E
-	x_0=3900000 y_0=900000 k_0=0.997
-	no_defs <>
-<n-alger> # Nord Algerie Grid
-	proj=lcc ellps=clrk80 lon_0=2d42E lat_0=36N
-	x_0=500000 y_0=300000 k_0=0.999625544
-	no_defs <>
-<n-maroc> # Nord Maroc Grid
-	proj=lcc ellps=clrk80 lon_0=5d24'W lat_0=33d18'N
-	x_0=500000 y_0=300000 k_0=0.999625769
-	no_defs <>
-<n-tunis> # Nord Tunisie Grid
-	proj=lcc ellps=clrk80 lon_0=9d54E lat_0=36N
-	x_0=500000 y_0=300000 k_0=0.999625544
-	no_defs <>
-<s-alger> # Sud Algerie Grid
-	proj=lcc ellps=clrk80 lon_0=2d42E lat_0=33d18'N
-	x_0=500000 y_0=300000 k_0=0.999625769
-	no_defs <>
-<s-maroc> # Sud Maroc Grid
-	proj=lcc ellps=clrk80 lon_0=5d24W lat_0=29d42'N
-	x_0=500000 y_0=300000 k_0=0.999615596
-	no_defs <>
-<s-tunis> # Sud Tunisie Grid
-	proj=lcc ellps=clrk80 lon_0=9d54'E lat_0=33d18'N
-	x_0=500000 y_0=300000 k_0=0.999625769
-	no_defs <>
-# Gauss Krueger Grid for Germany
-#
-# The first figure of the easting is lon_0 divided by 3
-# ( 2 for 6d0E, 3 for 9d0E, 4 for 12d0E)
-# For translations you have to remove this first figure
-# and convert northings and eastings from km to meter .
-# The other way round, devide by 1000 and add the figure.
-# I made 3 entrys for the officially used grids in Germany
-#
-#
-# Und nochmal in deutsch :
-# Die erste Ziffer des Rechtswerts beschreibt den Hauptmeridian
-# und ist dessen Gradzahl geteilt durch 3.
-# Zum Umrechnen in Grad muss daher die erste Ziffer des Rechtswertes
-# entfernt werden und evt. von km auf Metern umgerechnet werden.
-# Zur Umrechnung in Gauss Krueger Koordinaten entsprechend die
-# Ziffer fuer den Hauptmeridian vor dem Rechtswert ergaenzen.
-# Ich hab fuer alle drei in Deutschland ueblichen Hauptmeridiane
-# jeweils einen Eintrag ergaenzt.
-#
-#
-# added by Michael Goepel <goepel at ffm.plusline.de>
-#
-<gk2-d> # Gauss Krueger Grid for Germany
-        proj=tmerc ellps=bessel lon_0=6d0E lat_0=0
-        x_0=500000
-        no_defs<>
-<gk3-d> # Gauss Krueger Grid for Germany
-        proj=tmerc ellps=bessel lon_0=9d0E lat_0=0
-        x_0=500000
-        no_defs<>
-<gk4-d> # Gauss Krueger Grid for Germany
-        proj=tmerc ellps=bessel lon_0=12d0E lat_0=0
-        x_0=500000
-        no_defs<>
-#
-#
-##########################################################
-#
-# MBARI Project Specific Projections
-#
-# Oblique Mercator for Alarcon Rise Survey
-<AlarconRiseObliqueMercator>
-	proj=omerc ellps=WGS84
-	lon_1=-108.628211 lat_1=23.252474
-	lon_c=-108.494979 lat_0=23.437453
-	lon_2=-108.361691 lat_2=23.622586
-	units=m no_rot no_uoff rot_conv
-	x_0=-3046491.73 y_0=0.00
-	no_defs<>
diff --git a/src/stamp-h1 b/src/stamp-h1
deleted file mode 100644
index 5904f28..0000000
--- a/src/stamp-h1
+++ /dev/null
@@ -1 +0,0 @@
-timestamp for src/mbsystem_config.h
diff --git a/src/surf/Makefile.am b/src/surf/Makefile.am
deleted file mode 100644
index 5df0f87..0000000
--- a/src/surf/Makefile.am
+++ /dev/null
@@ -1,15 +0,0 @@
-AM_CPPFLAGS = -I${top_srcdir}/src/mbio
-
-include_HEADERS = mb_sapi.h
-
-lib_LTLIBRARIES = libmbsapi.la
-
-libmbsapi_la_LDFLAGS = -no-undefined -version-info 0:0:0
-
-libmbsapi_la_LIBADD = ${XDR_LIB}
-
-libmbsapi_la_SOURCES = \
-		mem_surf.c pb_math.c sapi_build.c sapi_data.c sapi_files.c \
-		sapi_globals.c sapi_simple.c util_surf.c xdr_surf.c
-
-#xdr_win32.c for win32??
diff --git a/src/surf/Makefile.in b/src/surf/Makefile.in
deleted file mode 100644
index b867af6..0000000
--- a/src/surf/Makefile.in
+++ /dev/null
@@ -1,712 +0,0 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
-
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-
-
-VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
-am__make_running_with_option = \
-  case $${target_option-} in \
-      ?) ;; \
-      *) echo "am__make_running_with_option: internal error: invalid" \
-              "target option '$${target_option-}' specified" >&2; \
-         exit 1;; \
-  esac; \
-  has_opt=no; \
-  sane_makeflags=$$MAKEFLAGS; \
-  if $(am__is_gnu_make); then \
-    sane_makeflags=$$MFLAGS; \
-  else \
-    case $$MAKEFLAGS in \
-      *\\[\ \	]*) \
-        bs=\\; \
-        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
-          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
-    esac; \
-  fi; \
-  skip_next=no; \
-  strip_trailopt () \
-  { \
-    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
-  }; \
-  for flg in $$sane_makeflags; do \
-    test $$skip_next = yes && { skip_next=no; continue; }; \
-    case $$flg in \
-      *=*|--*) continue;; \
-        -*I) strip_trailopt 'I'; skip_next=yes;; \
-      -*I?*) strip_trailopt 'I';; \
-        -*O) strip_trailopt 'O'; skip_next=yes;; \
-      -*O?*) strip_trailopt 'O';; \
-        -*l) strip_trailopt 'l'; skip_next=yes;; \
-      -*l?*) strip_trailopt 'l';; \
-      -[dEDm]) skip_next=yes;; \
-      -[JT]) skip_next=yes;; \
-    esac; \
-    case $$flg in \
-      *$$target_option*) has_opt=yes; break;; \
-    esac; \
-  done; \
-  test $$has_opt = yes
-am__make_dryrun = (target_option=n; $(am__make_running_with_option))
-am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-subdir = src/surf
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/depcomp $(include_HEADERS) README
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
-	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
-	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
-	$(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-	$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/src/mbio/mb_config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
-am__vpath_adj = case $$p in \
-    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
-    *) f=$$p;; \
-  esac;
-am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
-am__install_max = 40
-am__nobase_strip_setup = \
-  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
-am__nobase_strip = \
-  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
-am__nobase_list = $(am__nobase_strip_setup); \
-  for p in $$list; do echo "$$p $$p"; done | \
-  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
-  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
-    if (++n[$$2] == $(am__install_max)) \
-      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
-    END { for (dir in files) print dir, files[dir] }'
-am__base_list = \
-  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
-  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
-am__uninstall_files_from_dir = { \
-  test -z "$$files" \
-    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
-    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
-         $(am__cd) "$$dir" && rm -f $$files; }; \
-  }
-am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includedir)"
-LTLIBRARIES = $(lib_LTLIBRARIES)
-am__DEPENDENCIES_1 =
-libmbsapi_la_DEPENDENCIES = $(am__DEPENDENCIES_1)
-am_libmbsapi_la_OBJECTS = mem_surf.lo pb_math.lo sapi_build.lo \
-	sapi_data.lo sapi_files.lo sapi_globals.lo sapi_simple.lo \
-	util_surf.lo xdr_surf.lo
-libmbsapi_la_OBJECTS = $(am_libmbsapi_la_OBJECTS)
-AM_V_lt = $(am__v_lt_ at AM_V@)
-am__v_lt_ = $(am__v_lt_ at AM_DEFAULT_V@)
-am__v_lt_0 = --silent
-am__v_lt_1 = 
-libmbsapi_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
-	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
-	$(libmbsapi_la_LDFLAGS) $(LDFLAGS) -o $@
-AM_V_P = $(am__v_P_ at AM_V@)
-am__v_P_ = $(am__v_P_ at AM_DEFAULT_V@)
-am__v_P_0 = false
-am__v_P_1 = :
-AM_V_GEN = $(am__v_GEN_ at AM_V@)
-am__v_GEN_ = $(am__v_GEN_ at AM_DEFAULT_V@)
-am__v_GEN_0 = @echo "  GEN     " $@;
-am__v_GEN_1 = 
-AM_V_at = $(am__v_at_ at AM_V@)
-am__v_at_ = $(am__v_at_ at AM_DEFAULT_V@)
-am__v_at_0 = @
-am__v_at_1 = 
-DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)/src/mbio
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
-am__mv = mv -f
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
-	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
-	$(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
-	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
-	$(AM_CFLAGS) $(CFLAGS)
-AM_V_CC = $(am__v_CC_ at AM_V@)
-am__v_CC_ = $(am__v_CC_ at AM_DEFAULT_V@)
-am__v_CC_0 = @echo "  CC      " $@;
-am__v_CC_1 = 
-CCLD = $(CC)
-LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
-	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
-	$(AM_LDFLAGS) $(LDFLAGS) -o $@
-AM_V_CCLD = $(am__v_CCLD_ at AM_V@)
-am__v_CCLD_ = $(am__v_CCLD_ at AM_DEFAULT_V@)
-am__v_CCLD_0 = @echo "  CCLD    " $@;
-am__v_CCLD_1 = 
-SOURCES = $(libmbsapi_la_SOURCES)
-DIST_SOURCES = $(libmbsapi_la_SOURCES)
-am__can_run_installinfo = \
-  case $$AM_UPDATE_INFO_DIR in \
-    n|no|NO) false;; \
-    *) (install-info --version) >/dev/null 2>&1;; \
-  esac
-HEADERS = $(include_HEADERS)
-am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
-# Read a list of newline-separated strings from the standard input,
-# and print each of them once, without duplicates.  Input order is
-# *not* preserved.
-am__uniquify_input = $(AWK) '\
-  BEGIN { nonempty = 0; } \
-  { items[$$0] = 1; nonempty = 1; } \
-  END { if (nonempty) { for (i in items) print i; }; } \
-'
-# Make sure the list of sources is unique.  This is necessary because,
-# e.g., the same source file might be shared among _SOURCES variables
-# for different programs/libraries.
-am__define_uniq_tagged_files = \
-  list='$(am__tagged_files)'; \
-  unique=`for i in $$list; do \
-    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-  done | $(am__uniquify_input)`
-ETAGS = etags
-CTAGS = ctags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-CC = @CC@
-CCAS = @CCAS@
-CCASDEPMODE = @CCASDEPMODE@
-CCASFLAGS = @CCASFLAGS@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DLLTOOL = @DLLTOOL@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GREP = @GREP@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBM = @LIBM@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIBTOOL_DEPS = @LIBTOOL_DEPS@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LTLIBOBJS = @LTLIBOBJS@
-LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
-MAINT = @MAINT@
-MAKEINFO = @MAKEINFO@
-MANIFEST_TOOL = @MANIFEST_TOOL@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-OTPS_DIR = @OTPS_DIR@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_URL = @PACKAGE_URL@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PKG_CONFIG = @PKG_CONFIG@
-PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
-PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-VERSION = @VERSION@
-XDR_LIB = @XDR_LIB@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_AR = @ac_ct_AR@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-fftw_app = @fftw_app@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libGLU_CFLAGS = @libGLU_CFLAGS@
-libGLU_LIBS = @libGLU_LIBS@
-libXm_CFLAGS = @libXm_CFLAGS@
-libXm_LIBS = @libXm_LIBS@
-libdir = @libdir@
-libexecdir = @libexecdir@
-libfftw3_CFLAGS = @libfftw3_CFLAGS@
-libfftw3_LIBS = @libfftw3_LIBS@
-libfftw_CPPFLAGS = @libfftw_CPPFLAGS@
-libfftw_LIBS = @libfftw_LIBS@
-libgmt_CFLAGS = @libgmt_CFLAGS@
-libgmt_CPPFLAGS = @libgmt_CPPFLAGS@
-libgmt_LIBS = @libgmt_LIBS@
-libmotif_CPPFLAGS = @libmotif_CPPFLAGS@
-libmotif_LIBS = @libmotif_LIBS@
-libnetcdf_CFLAGS = @libnetcdf_CFLAGS@
-libnetcdf_CPPFLAGS = @libnetcdf_CPPFLAGS@
-libnetcdf_LIBS = @libnetcdf_LIBS@
-libopengl_CPPFLAGS = @libopengl_CPPFLAGS@
-libopengl_LIBS = @libopengl_LIBS@
-libproj_CFLAGS = @libproj_CFLAGS@
-libproj_CPPFLAGS = @libproj_CPPFLAGS@
-libproj_LIBS = @libproj_LIBS@
-libpsl_CFLAGS = @libpsl_CFLAGS@
-libpsl_LIBS = @libpsl_LIBS@
-localedir = @localedir@
-localstatedir = @localstatedir@
-mandir = @mandir@
-mbsystemdatadir = @mbsystemdatadir@
-mbsystemhtmldir = @mbsystemhtmldir@
-mbsystempsdir = @mbsystempsdir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-AM_CPPFLAGS = -I${top_srcdir}/src/mbio
-include_HEADERS = mb_sapi.h
-lib_LTLIBRARIES = libmbsapi.la
-libmbsapi_la_LDFLAGS = -no-undefined -version-info 0:0:0
-libmbsapi_la_LIBADD = ${XDR_LIB}
-libmbsapi_la_SOURCES = \
-		mem_surf.c pb_math.c sapi_build.c sapi_data.c sapi_files.c \
-		sapi_globals.c sapi_simple.c util_surf.c xdr_surf.c
-
-all: all-am
-
-.SUFFIXES:
-.SUFFIXES: .c .lo .o .obj
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
-	@for dep in $?; do \
-	  case '$(am__configure_deps)' in \
-	    *$$dep*) \
-	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-	        && { if test -f $@; then exit 0; else break; fi; }; \
-	      exit 1;; \
-	  esac; \
-	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/surf/Makefile'; \
-	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --gnu src/surf/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	@case '$?' in \
-	  *config.status*) \
-	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-	esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-
-install-libLTLIBRARIES: $(lib_LTLIBRARIES)
-	@$(NORMAL_INSTALL)
-	@list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
-	list2=; for p in $$list; do \
-	  if test -f $$p; then \
-	    list2="$$list2 $$p"; \
-	  else :; fi; \
-	done; \
-	test -z "$$list2" || { \
-	  echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \
-	  $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \
-	}
-
-uninstall-libLTLIBRARIES:
-	@$(NORMAL_UNINSTALL)
-	@list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
-	for p in $$list; do \
-	  $(am__strip_dir) \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \
-	done
-
-clean-libLTLIBRARIES:
-	-test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
-	@list='$(lib_LTLIBRARIES)'; \
-	locs=`for p in $$list; do echo $$p; done | \
-	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
-	      sort -u`; \
-	test -z "$$locs" || { \
-	  echo rm -f $${locs}; \
-	  rm -f $${locs}; \
-	}
-
-libmbsapi.la: $(libmbsapi_la_OBJECTS) $(libmbsapi_la_DEPENDENCIES) $(EXTRA_libmbsapi_la_DEPENDENCIES) 
-	$(AM_V_CCLD)$(libmbsapi_la_LINK) -rpath $(libdir) $(libmbsapi_la_OBJECTS) $(libmbsapi_la_LIBADD) $(LIBS)
-
-mostlyclean-compile:
-	-rm -f *.$(OBJEXT)
-
-distclean-compile:
-	-rm -f *.tab.c
-
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mem_surf.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/pb_math.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/sapi_build.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/sapi_data.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/sapi_files.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/sapi_globals.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/sapi_simple.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/util_surf.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/xdr_surf.Plo at am__quote@
-
-.c.o:
- at am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(COMPILE) -c -o $@ $<
-
-.c.obj:
- at am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
- at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-
-.c.lo:
- at am__fastdepCC_TRUE@	$(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(LTCOMPILE) -c -o $@ $<
-
-mostlyclean-libtool:
-	-rm -f *.lo
-
-clean-libtool:
-	-rm -rf .libs _libs
-install-includeHEADERS: $(include_HEADERS)
-	@$(NORMAL_INSTALL)
-	@list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \
-	if test -n "$$list"; then \
-	  echo " $(MKDIR_P) '$(DESTDIR)$(includedir)'"; \
-	  $(MKDIR_P) "$(DESTDIR)$(includedir)" || exit 1; \
-	fi; \
-	for p in $$list; do \
-	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
-	  echo "$$d$$p"; \
-	done | $(am__base_list) | \
-	while read files; do \
-	  echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includedir)'"; \
-	  $(INSTALL_HEADER) $$files "$(DESTDIR)$(includedir)" || exit $$?; \
-	done
-
-uninstall-includeHEADERS:
-	@$(NORMAL_UNINSTALL)
-	@list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \
-	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
-	dir='$(DESTDIR)$(includedir)'; $(am__uninstall_files_from_dir)
-
-ID: $(am__tagged_files)
-	$(am__define_uniq_tagged_files); mkid -fID $$unique
-tags: tags-am
-TAGS: tags
-
-tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
-	set x; \
-	here=`pwd`; \
-	$(am__define_uniq_tagged_files); \
-	shift; \
-	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
-	  test -n "$$unique" || unique=$$empty_fix; \
-	  if test $$# -gt 0; then \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      "$$@" $$unique; \
-	  else \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      $$unique; \
-	  fi; \
-	fi
-ctags: ctags-am
-
-CTAGS: ctags
-ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
-	$(am__define_uniq_tagged_files); \
-	test -z "$(CTAGS_ARGS)$$unique" \
-	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$unique
-
-GTAGS:
-	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && $(am__cd) $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) "$$here"
-cscopelist: cscopelist-am
-
-cscopelist-am: $(am__tagged_files)
-	list='$(am__tagged_files)'; \
-	case "$(srcdir)" in \
-	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
-	  *) sdir=$(subdir)/$(srcdir) ;; \
-	esac; \
-	for i in $$list; do \
-	  if test -f "$$i"; then \
-	    echo "$(subdir)/$$i"; \
-	  else \
-	    echo "$$sdir/$$i"; \
-	  fi; \
-	done >> $(top_builddir)/cscope.files
-
-distclean-tags:
-	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	list='$(DISTFILES)'; \
-	  dist_files=`for file in $$list; do echo $$file; done | \
-	  sed -e "s|^$$srcdirstrip/||;t" \
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
-	case $$dist_files in \
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
-			   sort -u` ;; \
-	esac; \
-	for file in $$dist_files; do \
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  if test -d $$d/$$file; then \
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
-	    if test -d "$(distdir)/$$file"; then \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
-	  else \
-	    test -f "$(distdir)/$$file" \
-	    || cp -p $$d/$$file "$(distdir)/$$file" \
-	    || exit 1; \
-	  fi; \
-	done
-check-am: all-am
-check: check-am
-all-am: Makefile $(LTLIBRARIES) $(HEADERS)
-installdirs:
-	for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includedir)"; do \
-	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
-	done
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
-	if test -z '$(STRIP)'; then \
-	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	      install; \
-	else \
-	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
-	fi
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
-	@echo "This command is intended for maintainers to use"
-	@echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \
-	mostlyclean-am
-
-distclean: distclean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
-	distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am: install-includeHEADERS
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am: install-libLTLIBRARIES
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic \
-	mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am: uninstall-includeHEADERS uninstall-libLTLIBRARIES
-
-.MAKE: install-am install-strip
-
-.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
-	clean-libLTLIBRARIES clean-libtool cscopelist-am ctags \
-	ctags-am distclean distclean-compile distclean-generic \
-	distclean-libtool distclean-tags distdir dvi dvi-am html \
-	html-am info info-am install install-am install-data \
-	install-data-am install-dvi install-dvi-am install-exec \
-	install-exec-am install-html install-html-am \
-	install-includeHEADERS install-info install-info-am \
-	install-libLTLIBRARIES install-man install-pdf install-pdf-am \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-compile \
-	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-	tags tags-am uninstall uninstall-am uninstall-includeHEADERS \
-	uninstall-libLTLIBRARIES
-
-
-#xdr_win32.c for win32??
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/surf/Makefile.org b/src/surf/Makefile.org
deleted file mode 100644
index ab3c35e..0000000
--- a/src/surf/Makefile.org
+++ /dev/null
@@ -1,117 +0,0 @@
-##################################################################
-#
-# Makefile for Archive Library "libsapi.a"
-#
-##################################################################
-
-SAPI_LIB           =  libsapi.a
-
-ALL_INCLUDE        = -I.
-
-CC      = cc
-
-
-# HP-UX 10.20
-#CFLAGS  = -Ae $(ALL_INCLUDE)
-#LIBS  = $(SAPI_LIB) -lrpcsvc -lm
-
-# DEC-Unix, OSF1 # please use gmake
-#CFLAGS  = -std1 -D_ANSI_C_SOURCE -D_POSIX_SOURCE -D_XOPEN_SOURCE \
-#          -D_AES_SOURCE -D_OSF_SOURCE $(ALL_INCLUDE)
-#LIBS  = $(SAPI_LIB) -lrpcsvc -lm
-
-# IRIX
-CFLAGS  = -c -g2 -DCC -DCG_ANSI -DSYSV $(ALL_INCLUDE)
-LIBS  = $(SAPI_LIB) -lsun -lm
-
-# Solaris, SunOS
-#CFLAGS = $(ALL_INCLUDE)
-#LIBS  = $(SAPI_LIB) -lrpcsvc -lm -lnsl
-
-# Linux
-#CFLAGS = $(ALL_INCLUDE)
-#LIBS  =  $(SAPI_LIB) -lrpcsvc -lm
-
-
-$(SAPI_LIB):  $(SAPI_LIB)(xdr_surf.o)    \
-              $(SAPI_LIB)(mem_surf.o)    \
-              $(SAPI_LIB)(util_surf.o)   \
-              $(SAPI_LIB)(pb_math.o)     \
-              $(SAPI_LIB)(sapi_files.o)  \
-              $(SAPI_LIB)(sapi_build.o)  \
-              $(SAPI_LIB)(sapi_globals.o)\
-              $(SAPI_LIB)(sapi_data.o)   \
-              $(SAPI_LIB)(sapi_simple.o) \
-              $(SAPI_LIB)(myOpSys.o)
-
-
-$(SAPI_LIB)(xdr_surf.o): \
-                surf.h \
-                xdr_surf.h\
-                xdr_surf.c
-
-$(SAPI_LIB)(mem_surf.o): \
-                surf.h \
-                xdr_surf.h \
-                mem_surf.h \
-                mem_surf.c
-
-$(SAPI_LIB)(util_surf.o): \
-                surf.h \
-                xdr_surf.h \
-                mem_surf.h \
-                util_surf.h\
-                util_surf.c
-
-$(SAPI_LIB)(pb_math.o): \
-                pb_math.h\
-                pb_math.c
-
-$(SAPI_LIB)(sapi_files.o): \
-       		surf.h\
-                xdr_surf.h\
-                mem_surf.h\
-                sapi.h\
-	        sapi_files.c
-
-$(SAPI_LIB)(sapi_globals.o): \
-       		surf.h\
-                xdr_surf.h\
-	        mem_surf.h\
-       		sapi.h\
-                sapi_globals.c
-
-$(SAPI_LIB)(sapi_data.o): \
-       		surf.h\
-                xdr_surf.h\
-                mem_surf.h\
-       		sapi.h\
-                sapi_data.c
-
-$(SAPI_LIB)(sapi_simple.o): \
-                surf.h\
-                xdr_surf.h\
-                mem_surf.h\
-                sapi.h\
-                sapi_simple.c
-
-$(SAPI_LIB)(sapi_build.o): \
-                surf.h\
-                xdr_surf.h\
-                mem_surf.h\
-                sapi.h\
-                sapi_build.c
-
-$(SAPI_LIB)(myOpSys.o): myOpSys.c
-
-myOpSys.c: getopsys
-	getopsys
-
-##########################################
-clean:
-	- rm -f libsapi.a
-	- rm -f myOpSys.c
-	- rm -f *.o
-
-dist: clean
-	- cd libsapi/Debug; rm -f *
diff --git a/src/surf/README b/src/surf/README
deleted file mode 100644
index 13d4476..0000000
--- a/src/surf/README
+++ /dev/null
@@ -1,154 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	README	6/1/2002
- *    $Id: README 1770 2009-10-19 17:16:39Z caress $
- *
- *    Copyright (c) 2002 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *--------------------------------------------------------------------*/
-
-This directory (mbsystem/src/surf) contains source code for 
-reading and writing the SURF format developed by 
-ATLAS Hydrographics GmbH of Bremen, Germany. This source 
-code was developed by ATLAS Hydrographics and has been
-released by ATLAS Hydrographics for open source distribution
-under the GNU Public License (GPL).
-
-The code in this directory is unchanged from ATLAS distribution,
-but is now embedded in the MB-System distribution structure.
-The original ATLAS Hydrographics distribution also included
-data samples and example programs that use the SURF API or
-sapi library. This original distribution is available
-separately from the MB-System ftp site.
-
-The text from the original ATLAS README file is below, including
-references to the example data and programs included in the
-separate SAPI distribution.
-
-/*--------------------------------------------------------------------*/
-
-
-SURF Application Programming Interface (SURF API)
--------------------------------------------------
-Version: 3.1.4
-
-
-
-1. GENERAL
-----------------------------------------
-
-SURF ("Sensor-Unabhaengiges Rohdaten-Format") is a widely used ATLAS format
-for exchange of hydroacoustic data. The SURF format contains data of one
-specific hydroacoustic sensor accompanied by assigned data of all other 
-sensors that are relevant for hydrographic data processing. SURF is used 
-as a transfer format from the ATLAS HYDROMAP ONLINE to hydrographic data
-processing systems like the ATLAS HYDROMAP OFFLINE.
-
-SURF data are generated by the ATLAS HYDROMAP ONLINE or by the SURF API using 
-the system independent LAN transfer format XDR. The SURF format supports
-parallel data access (for fast memory access) and serial data transfer.
-
-SURF data are transfered via LAN or data exchange media to data processing
-tools or user-dependent application programs for interpretation and
-transformation into other data output formats. 
-
-The SURF format is the same for all sensors of the same sounder type
-(multibeam echosounder or singlebeam echosounder). SURF includes sensor data
-information of relevant sensors like position sensors, gyros and motion 
-sensors. The sensor data information is assigned to the hydroacoustic 
-data of the sounding sensor. The sensor data information is interpolated
-for each sounding according to time (for transmit time and receive time
-of the acoustic pulse).
-The SURF format contains other data necessary for data processing as well
-(e.g. water sound velocity profiles, tide measurements). Data which 
-are valid for a number of soundings are stored only once.
-
-SURF data are accessible from external side via the SURF API leading to the
-following customer benefit: Changes in the SURF format do not require 
-changes in customer application software; they only require the inclusion
-of an updated version of the SURF API. The SURF API is a function library
-written in ANSI C. The provided SURF API source code is compatible with Unix
-and Windows platforms and was tested on HP-UX, Sun-OS, Dec-Unix, Sgi-Irix,
-Linux, Windows 9x, Windows NT and Windows 2000.
-
-Over the years, the SURF Format has been extended twice:
-
-- The original SURF format was SURF 1.
-- The extension to the SURF 2 format includes backscatter information.
-- The extension to the SURF 3 format includes TPE information.
- ( TPE = Total Propagated Error )
-
-The current SURF API is able to read all types of SURF files (SURF 1, 
-SURF 2 and SURF 3) and writes SURF 3 files.   
-
-
-
-2. HOW TO USE THE SURF API
------------------------------------------
-
-The SURF API is a library enabling easy access to SURF data.
-
-One of the source code files is the header file sapi.h describing the
-contents of the different SURF modules and declaring the SURF API function
-prototypes. The directory 'libsrc' includes the source code of the 
-SURF API library.
-
-In the directory 'examples', you find two example source files (sapitest1.c,
-sapitest2.c) showing how to read data and using most of the SURF API functions.
-
-There are three additional examples which show how to build your
-own SURF data files (sapitest3.c, sapitest4.c, sapitest5.c).
-
-In the directory 'data', you find two different SURF files for testing the
-examples or testing your own application.
-
-In the directory 'doc', you find a description of the API functions.
-
-For compilation of the SURF API, an ANSI C compiler is required.
-
-Two additional system libraries must be linked to your application:
-- the math-lib 'libm.a' 
-- the library with the xdr-routines
-
-In order to build the library and the example programms on a specific
-Unix system, please adapt the Makefiles in the directory 'libsrc' and
-in the directory 'examples' first:
-uncomment the compile and link options for the used Unix system and use
-make or gmake (on DEC-Unix) from the main directory. 
-For Windows systems, you can find the project definition files for 
-Visual Studio 6.0 in the following directories:
-example/win_sapitest1
-example/win_sapitest2
-example/win_sapitest4
-libsrc/libsapi
-
-
-
-
-3. COPYRIGHT AND LICENSING
------------------------------------------
-
-SURF API Copyright (C) 1993-2001 by
-  
-  ATLAS Hydrographics GmbH
-  D-28211 Bremen, Kurfuerstenallee 130
-
-All Rights Reserved
-
-This SURF API source code is distributed under the GNU
-General Public License (GNU GPL) as formulated by the GNU Project.
-
-The GNU GPL prohibits the distribution of proprietary
-executables linked with this SURF API library unless the
-source code is also distributed. (see: http://www.gnu.org/copyleft/gpl.html)
-
-This SURF API does not come with any warranties, nor is it
-guaranteed to work on your computer or to do anything useful.  
-The user assumes full responsibility for the use of this library.
-
-
diff --git a/src/surf/mb_sapi.h b/src/surf/mb_sapi.h
deleted file mode 100644
index 3f99637..0000000
--- a/src/surf/mb_sapi.h
+++ /dev/null
@@ -1,719 +0,0 @@
-/*-----------------------------------------------------------------------
-/ H E A D E R K O P F
-/ ------------------------------------------------------------------------
-/ ------------------------------------------------------------------------
-/  DATEINAME        : sapi.h
-/  ERSTELLUNGSDATUM : 21.05.96
-/ ----------------------------------------------------------------------*/
-/*!
-/ ------------------------------------------------------------------------
-/ COPYRIGHT (C) 1993: ATLAS ELEKTRONIK GMBH, 28305 BREMEN
-/ ------------------------------------------------------------------------
-/
-/  See README file for copying and redistribution conditions.
-/
-/
-/ HIER/SACHN: P: RP ____ _ ___ __
-/ BENENNUNG :
-/ ERSTELLER : Peter Block    : SHD2
-/ FREIGABE  : __.__.__  GS__
-/ AEND/STAND: __.__.__  __
-/ PRUEFVERM.:
-*/
-
-/*
-/ SPRACHE          : UNIX-C
-/ COMPILER         : Silicon Graphix
-/ BETRIEBSSYSTEM   : IRIX
-/ HARDWARE-UMGEBUNG: SGI Crimson
-/ URSPRUNGSHINWEIS :
-/
-/ ------------------------------------------------------------------------
-/ BESCHREIBUNG:       Definitions describing the "SURF-Format" 3
-/                                               & SURF-API-lib V3.1.4
-/ ------------------------------------------------------------------------
-/
-/ ------------------------------------------------------------------------
-/ E N D E   D E S   K O P F E S
-/ ------------------------------------------------------------------------
-*/
-/************************************************************************/
-
-
-
-
-#ifndef _SAPI
-#define _SAPI
-
-#ifndef __SAPI__
-
-#ifndef _WIN32
-#include <rpc/types.h>
-#include <rpc/xdr.h>
-#endif
-
-#ifdef __LP64__
-#define SAPI_U_LONG unsigned int
-#else
-#define SAPI_U_LONG unsigned long
-#endif
-
-/*
-   ALL DATA ARE SCALED IN MKS
-   That means scalings are METER,SECONDS,RAD
-   or derivates ..[m/sec],[1/sec]=[Hz]...
-
-   -Relative Times are related to the profile starttime
-   -Relative Ways are related to the profile startposition
-   -All Positions are relative to the positionreference
-   -Positions are scaled either in [m] or [rad] according to
-    the presentationOfPosition-dataentry
-   -Centerpositions are given for a virtual Shipreferencepoint
-    (should be the "ship's turning point")
-   -Positions in the Shipcoordinatesystem (ahead,astar) are
-    also related to this point and scaled in [m]
-
-   time/date-sets are presented in ASCII-Characters
-      DDMMYYHHMMSS.NN<0x0>
-
-   name-strings and Label-strings are presented in
-   c-string-annotation    ABCDEFG<0x0>
-
-*/
-
-
-
-#define LABEL_SIZE          16
-#define STRING_SIZE         16
-#define TIME_SIZE           16
-
-
-/***************************************/
-/*                                     */
-/* SURF-elements describing SIX-files  */
-/*                                     */
-/***************************************/
-
-
-/* SURF-dataset "Globaldata" */
-
-  /* Values of 'typeOfSounder' */
-
-#define MANUAL_DATA              'M'
-#define DIGITIZED_DATA           'D'
-#define VERTICAL_SOUNDER         'V'
-#define BOMA_TYPE_SOUNDER        'B'
-#define FAN_TYPE_SOUNDER         'F'
-
-  /* Values of 'presentationOfPosition' */
-
-#define EASTING_NORTHING         'E' /* Values are scaled in [rad] */
-#define X_Y                      'X' /* Values are scaled in [m]   */
-
-/* correctedParameterFlags */
-
-#define CP_TIDE_CORRECTED          1
-#define CP_DRAUGHT_CORRECTED       2
-#define CP_COURSE_MANIPULATED      4
-#define CP_HEAVE_MANIPULATED       8
-#define CP_ROLL_MANIPULATED       16
-#define CP_PITCH_MANIPULATED      32
-#define CP_CKEEL_MANIPULATED      64
-#define CP_CMEAN_MANIPULATED     128
-#define CP_SQUAT_CORRECTED      1024
-
-
-#define SURF_GLOBAL_DATA_LABEL "GLOBALDATA"
-
-typedef struct
-            {
-              char    label                      [LABEL_SIZE];
-              char    shipsName                 [STRING_SIZE];
-              char    startTimeOfProfile          [TIME_SIZE];
-              char    regionOfProfile           [STRING_SIZE];
-              char    numberOfProfile           [STRING_SIZE];
-              float   chartZero                              ;  /* rel. NN*/
-              float   tideZero                               ;  /* rel. NN*/
-              SAPI_U_LONG  numberOfMeasuredSoundings              ;
-              SAPI_U_LONG  actualNumberOfSoundingSets             ;
-              char    timeDateOfTideModification  [TIME_SIZE];
-              char    timeDateOfDepthModification [TIME_SIZE];
-              char    timeDateOfPosiModification  [TIME_SIZE];
-              char    timeDateOfParaModification  [TIME_SIZE];
-              SAPI_U_LONG  correctedParameterFlags                ;
-              float   offsetHeave                            ;
-              float   offsetRollPort                         ;
-              float   offsetRollStar                         ;
-              float   offsetPitchFore                        ;
-              float   offsetPitchAft                         ;
-              char    nameOfSounder             [STRING_SIZE];
-              char    typeOfSounder                          ;
-              float   highFrequency                          ;
-              float   mediumFrequency                        ;
-              float   lowFrequency                           ;
-              char    nameOfEllipsoid           [STRING_SIZE];
-              double  semiMajorAxis                          ;
-              double  flattening                             ;
-              char    projection                [STRING_SIZE];
-              char    presentationOfPosition                 ;
-              double  referenceMeridian                      ;
-              double  falseEasting                           ;
-              double  falseNorthing                          ;
-              double  referenceOfPositionX                   ;
-              double  referenceOfPositionY                   ;
-              char    presentationOfRelWay                   ;
-                /* 'p' = projection , 'l' = lineintegral */
-              float   planedTrackStartX                      ;
-              float   planedTrackStartY                      ;
-              float   planedTrackStopX                       ;
-              float   planedTrackStopY                       ;
-              float   originalTrackStartX                    ;
-              float   originalTrackStartY                    ;
-              float   originalTrackStopX                     ;
-              float   originalTrackStopY                     ;
-              float   originalStartStopDistance              ;
-              double  originalStartStopTime                  ;
-              char    timeDateOfTrackModification [TIME_SIZE];
-              float   modifiedTrackStartX                    ;
-              float   modifiedTrackStartY                    ;
-              float   modifiedTrackStopX                     ;
-              float   modifiedTrackStopY                     ;
-              float   modifiedStartStopDistance              ;
-            } SurfGlobalData;
-
-
-
-
-
-/* SURF-dataset "Statistics" */
-
-#define SURF_STATISTICS_LABEL "STATISTICS"
-
-typedef struct
-            {
-              char    label              [LABEL_SIZE];
-              double  minNorthing                    ;
-              double  maxNorthing                    ;
-              double  minEasting                     ;
-              double  maxEasting                     ;
-              float   minSpeed                       ;
-              float   maxSpeed                       ;
-              float   minRoll                        ;
-              float   maxRoll                        ;
-              float   minPitch                       ;
-              float   maxPitch                       ;
-              float   minHeave                       ;
-              float   maxHeave                       ;
-              float   minBeamPositionStar            ;
-              float   maxBeamPositionStar            ;
-              float   minBeamPositionAhead           ;
-              float   maxBeamPositionAhead           ;
-              float   minDepth                       ;
-              float   maxDepth                       ;
-            } SurfStatistics;
-
-
-
-
-
-/* SURF-dataset "Positionsensors" */
-
-#define SURF_POSITION_SENSOR_LABEL "POSITIONSENSORS"
-#define UNION_SIZE 200
-
-typedef struct
-            {
-              char    label                       [LABEL_SIZE];
-              char    positionSensorName         [STRING_SIZE];
-              char    sensorUnion                 [UNION_SIZE];
-            } SurfPositionSensorArray;
-
-
-    /*  Now special Sensors */
-
-
-    /*  Overlayed Polarfix-Set  */
-
-#define POLARFIX "POLARFIX"
-
-typedef struct
-            {
-              char    label                       [LABEL_SIZE];
-              char    positionSensorName         [STRING_SIZE];
-              float   polarfixLocationX                       ;
-              float   polarfixLocationY                       ;
-              float   polarfixLocationZ                       ;
-              float   polarfixReferenceX                      ;
-              float   polarfixReferenceY                      ;
-              float   polarfixReferenceZ                      ;
-              float   polarfixReferenceDistance               ;
-              float   polarfixReferenceAngle                  ;
-              char    timeOfLastPolarfixEdit       [TIME_SIZE];
-              float   polarfixEditLocationX                   ;
-              float   polarfixEditLocationY                   ;
-              float   polarfixEditLocationZ                   ;
-              float   polarfixEditReferenceX                  ;
-              float   polarfixEditReferenceY                  ;
-              float   polarfixEditReferenceZ                  ;
-              float   polarfixEditReferenceDistance           ;
-              float   polarfixEditReferenceAngle              ;
-              float   polarfixAntennaPositionAhead            ;
-              float   polarfixAntennaPositionStar             ;
-              float   polarfixAntennaPositionHeight           ;
-            } SurfPositionPolarfix;
-
-    /*  other overlayed Sets */
-
-#define UNKNOWNPOSSENS   "UNKNOWN"
-#define INAV             "INTEGRATED NAV"
-#define SYLEDIS          "SYLEDIS"
-#define MNS2000          "MNS2000"
-#define GPS              "GPS"
-#define EPIRB            "EPIRB"
-
-typedef struct
-            {
-              char    label                       [LABEL_SIZE];
-              char    positionSensorName         [STRING_SIZE];
-              float   none1                                   ;
-              float   none2                                   ;
-              float   none3                                   ;
-              float   none4                                   ;
-              float   none5                                   ;
-              float   none6                                   ;
-              float   none7                                   ;
-              float   none8                                   ;
-              char    time9                        [TIME_SIZE];
-              float   none10                                  ;
-              float   none11                                  ;
-              float   none12                                  ;
-              float   none13                                  ;
-              float   none14                                  ;
-              float   none15                                  ;
-              float   none16                                  ;
-              float   none17                                  ;
-              float   sensorAntennaPositionAhead              ;
-              float   sensorAntennaPositionStar               ;
-              float   sensorAntennaPositionHeight             ;
-            } SurfPositionAnySensor;
-
-
-
-
-
-
-/* SURF-dataset "Multibeam-Angle-Table" */
-
-#define SURF_MULTIBEAM_ANGLE_LABEL "MULTIBEAMANGLES"
-
-typedef struct
-            {
-              char              label    [LABEL_SIZE];
-              u_short actualNumberOfBeams            ;
-              float   beamAngle                   [1]; /*numberOfBeams times*/
-            } SurfMultiBeamAngleTable;
-
-
-
-/* SURF-dataset "Transducer Parameters" */
-
-#define SURF_TRANSDUCER_TABLE_LABEL "TRANSDUCERTABLE"
-
-typedef struct
-            {
-              char              label    [LABEL_SIZE];
-              float   transducerDepth                ;
-              float   transducerPositionAhead        ;
-              float   transducerPositionStar         ;
-              float   transducerTwoThetaHFreq        ;
-              float   transducerTwoThetaMFreq        ;
-              float   transducerTwoThetaLFreq        ;
-            } SurfTransducerParameterTable;
-
-
-
-
-
-
-/* SURF-dataset "C-profile-tables" */
-
-#define SURF_C_PROFILE_LABEL "C_PROFILES"
-
-typedef struct
-            {
-               float  depth                          ;
-               float  cValue                         ;
-            } CProfileValues;
-
-
-typedef struct
-            {
-              char              label    [LABEL_SIZE];
-              float             relTime              ;
-              u_short           numberOfActualValues ;
-              CProfileValues  values              [1]; /*numberOfActualValues times*/
-            } SurfCProfileTable;
-
-
-
-
-/* SURF-dataset "Polygon" */
-
-#define SURF_POLYGONS_LABEL "POLYGON"
-
-typedef struct
-            {
-              double  polygonX                       ;
-              double  polygonY                       ;
-            } SurfPolygonValues;
-
-typedef struct
-            {
-              char              label    [LABEL_SIZE];
-              SurfPolygonValues values            [1]; /*numberOfPolygons times*/
-            } SurfPolygons;
-
-
-
-
-
-
-/* SURF-dataset "Events " */
-
-#define SURF_EVENT_LABEL "EVENTS"
-#define EVENT_SIZE 84
-
-typedef struct
-            {
-              double  positionX                      ;
-              double  positionY                      ;
-              float   relTime                        ;
-              char    text[EVENT_SIZE]               ;
-            } SurfEventValues;
-
-typedef struct
-            {
-              char              label    [LABEL_SIZE];
-              SurfEventValues   values            [1];
-            } SurfEvents;
-
-
-
-
-
-/* SURF-dataset "Free Text " */
-
-#define SURF_FREE_TEXT_LABEL "FREETEXT"
-#define FREE_TEXT_BLOCK_SIZE        4
-
-typedef struct
-            {
-              char    text[FREE_TEXT_BLOCK_SIZE]               ;
-            } SurfFreeTextBlocks;
-
-typedef struct
-            {
-              char              label    [LABEL_SIZE];
-              SurfFreeTextBlocks blocks[1]; /* nrFreeTextBlocks times*/
-            } SurfFreeText;
-
-
-
-
-
-/***************************************/
-/*                                     */
-/* SURF-elements describing SDA-files  */
-/*                                     */
-/***************************************/
-
-
-
-
-/* SURF-dataset "Sounding-Data" */
-
-  /* soundingFlag */
-
-#define SF_DELETED                 1
-#define SF_COURSE_MANIPULATED      2
-#define SF_HEAVE_MANIPULATED       4
-#define SF_ROLL_MANIPULATED        8
-#define SF_PITCH_MANIPULATED      16
-#define SF_CKEEL_MANIPULATED      32
-#define SF_CMEAN_MANIPULATED      64
-#define SF_FAN_PAT_1             256 /* 0 = full fan; 1 = split fan */
-#define SF_FAN_PAT_2             512 /* 0 = port fan; 1 = star  fan */
-#define SF_FAN_PAT_3            1024 /* 0 = norm.fan; 1 = ahead fan */
-
-
-
-typedef struct
-            {
-              u_short soundingFlag                   ;
-              u_short indexToAngle                   ;
-              u_short indexToTransducer              ;
-              u_short indexToCProfile                ;
-              float   relTime                        ;
-              float   relWay                         ;
-              float   tide                           ;
-              float   headingWhileTransmitting       ;
-              float   heaveWhileTransmitting         ;
-              float   rollWhileTransmitting          ;
-              float   pitchWhileTransmitting         ;
-              float   cKeel                          ;
-              float   cMean                          ;
-              float   dynChartZero                   ;
-            } SurfSoundingData;
-
-
-  /* positionFlag
-
-     no entries yet*/
-
-
-
-
-/* SURF-dataset "Center-Position" */
-
-typedef struct
-            {
-              u_short positionFlag                   ;
-              float   centerPositionX                ;
-              float   centerPositionY                ;
-              float   speed                          ;
-            } SurfCenterPosition;
-
-
-
-
-/* SURF-dataset "Single-Beam-Depth" */
-
-/* depthFlag */
-#define SB_DELETED                 1
-#define SB_OBJECT                  2
-#define SB_FRAC_LINE               4
-#define SB_MAN_DATA                8
-#define SB_TIDE_CORRECTED         16
-#define SB_TIDE_MANIPULATED       32
-#define SB_POSI_MANIPULATED       64
-#define SB_DEPTH_MANIPULATED     128 /* Multibeam  */
-#define SB_H_DEPTH_MANIPULATED   128 /* Singlebeam */
-#define SB_M_DEPTH_MANIPULATED   256 /*     "      */
-#define SB_L_DEPTH_MANIPULATED   512 /*     "      */
-#define SB_DRAUGHT_CORRECTED    1024
-#define SB_DEPTH_SUPPRESSED     2048
-#define SB_REDUCED_FAN          4096 /* Multibeam  */
-
-typedef struct
-            {
-              u_short depthFlag                      ;
-              float   travelTimeOfRay                ;
-              float   depthHFreq                     ;
-              float   depthMFreq                     ;
-              float   depthLFreq                     ;
-            } SurfSingleBeamDepth;
-
-
-
-
-/* SURF-dataset "Multi-Beam-Depth" */
-
-typedef struct
-            {
-              u_short depthFlag                      ;
-              float   depth                          ;
-              float   beamPositionAhead              ;
-              float   beamPositionStar               ;
-            } SurfMultiBeamDepth;
-
-
-
-
-/* SURF-dataset "Multi-Beam-Travel-Time" */
-
-typedef struct
-            {
-              float   travelTimeOfRay                ;
-            } SurfMultiBeamTT;
-
-
-
-
-/* SURF-dataset "Multi-Beam-Receive" */
-
-typedef struct
-            {
-              float   headingWhileReceiving          ;
-              float   heaveWhileReceiving            ;
-            } SurfMultiBeamReceive;
-
-
-
-
-/* SURF-dataset "Beam-Amplitudes" */
-
-typedef struct
-            {
-              u_short beamAmplitude                  ;
-            } SurfAmplitudes;
-
-
-
-
-/* SURF-dataset "Extended-Beam-Amplitudes" */
-
-typedef struct
-            {
-              float   mtau                           ;
-              u_short nis                            ;
-              u_short beamAmplitude                  ;
-            } SurfExtendedAmplitudes;
-
-
-
-
-/* SURF-dataset "RxSignalparameter" */
-
-typedef struct
-            {
-             float time;               /* scale : sec  */
-             float gain;               /* scale : dB */
-            }TvgRxSets;
-
-typedef struct
-            {
-             u_short bscatClass                     ;/* neu V2.2 */
-             u_short nrActualGainSets               ;
-             float   rxGup                          ;
-             float   rxGain                         ;
-             float   ar                             ;
-             TvgRxSets rxSets[1]                    ;
-            } SurfSignalParameter;
-
-
-
-
-/* SURF-dataset "TxSignalparameter" */
-
-typedef struct
-            {
-             SAPI_U_LONG txBeamIndex   ;  /* Code of external Beamshapetab */
-             float  txLevel       ;  /* scale : dB rel 1 uPa */
-             float  txBeamAngle   ;  /* scale : rad */
-             float  pulseLength   ;  /* scale : sec */
-            }TxSets;
-
-typedef struct
-            {
-             TxSets  txSets[1]                      ;
-            } SurfTxParameter;
-
-
-
-
-/* SURF-dataset "Sidescandata"  */
-
-typedef struct
-            {
-              SAPI_U_LONG  sidescanFlag                   ;
-              u_short actualNrOfSsDataPort           ;
-              u_short actualNrOfSsDataStb            ;
-              float   minSsTimePort                  ;
-              float   minSsTimeStb                   ;
-              float   maxSsTimePort                  ;
-              float   maxSsTimeStb                   ;
-              u_char  ssData[1]                      ;/* nr of actual Data times
-                                                         first Port then Stb */
-            } SurfSidescanData;
-
-
-#endif /* ifndef __SAPI__ */
-
-
-
-/* FILE-handling functions */
-
-extern void  SAPI_printAPIandSURFversion(void);
-
-extern long  SAPI_open(char* surfDir,char* surfFile,long errorprint);
-extern long  SAPI_nextSounding(long errorprint);
-extern long  SAPI_rewind(long errorprint);
-extern void  SAPI_close(void);
-
-extern long SAPI_openIntoMemory(char* surfDir,char* surfFile,long errorprint);
-extern long SAPI_writeBackFromMemory(char* surfDir,char* surfFile,long errorprint);
-
-extern long SAPI_createSurfBody(long nrSoundings,long nrBeams,
-                         long maxNrSidescanSamplesPerSounding,long errorprint);
-
-
-/* Data from SIX(Index-)-File */
-
-extern char* SAPI_getNameOfShip(void);
-extern char* SAPI_getTypeOfSounder(void);
-extern char* SAPI_getNameOfSounder(void);
-extern long  SAPI_getNrSoundings(void);
-extern long  SAPI_getNrBeams(void);
-extern long  SAPI_posPresentationIsRad(void);
-extern long  SAPI_getNrPositionsensors(void);
-extern long  SAPI_getNrSoundvelocityProfiles(void);
-extern long  SAPI_getNrEvents(void);
-extern long  SAPI_getNrPolygonElements(void);
-
-extern double SAPI_getAbsoluteStartTimeOfProfile(void);
-
-extern long  SAPI_dataHaveHighFrequencyLayer(void);
-extern long  SAPI_dataHaveMediumFrequencyLayer(void);
-extern long  SAPI_dataHaveLowFrequencyLayer(void);
-
-extern SurfGlobalData*               SAPI_getGlobalData(void);
-extern SurfStatistics*               SAPI_getStatistics(void);
-extern SurfPositionAnySensor*        SAPI_getPositionSensor(long nrSensor);
-extern SurfEventValues*              SAPI_getEvent(long nrEvent);
-extern SurfPolygons*                 SAPI_getPolygons(void);
-
-
-/* Data from SDA(Massdata-)-File */
-
-extern SurfSoundingData*             SAPI_getSoundingData(void);
-extern SurfTransducerParameterTable* SAPI_getActualTransducerTable(void);
-extern SurfMultiBeamAngleTable*      SAPI_getActualAngleTable(void);
-extern SurfCProfileTable*            SAPI_getActualCProfileTable(void);
-
-extern SurfCenterPosition*           SAPI_getCenterPosition(long nrPositionSensor);
-extern SurfSingleBeamDepth*          SAPI_getSingleBeamDepth(void);
-extern SurfMultiBeamDepth*           SAPI_getMultiBeamDepth(long beam);
-extern SurfMultiBeamTT*              SAPI_getMultiBeamTraveltime(long beam);
-extern SurfMultiBeamReceive*         SAPI_getMultiBeamReceiveParams(long beam);
-
-
-/* Sidescan- & Backscatter-related Data from SDA(Massdata-)-File */
-
-SurfAmplitudes*                      SAPI_getMultibeamBeamAmplitudes(long beam);
-SurfExtendedAmplitudes*              SAPI_getMultibeamExtendedBeamAmplitudes(long beam);
-SurfSignalParameter*                 SAPI_getMultibeamSignalParameters(void);
-SurfTxParameter*                     SAPI_getMultibeamTransmitterParameters(int *nTxParams);
-SurfSidescanData*                    SAPI_getSidescanData(void);
-
-
-
-/* some simple routines (simple,but maybe slower than plain code !) */
-
-  /* depthOverChartZero =  0 --> depth over normal 0
-     depthOverChartZero =  1 --> depth over in SURF defined Chartzero */
-
-extern long SAPI_getXYZfromMultibeamSounding(long nrBeam,long depthOverChartZero,
-                                             double* north,double* east,double* depth);
-
-  /* different Frequencylayers may be stored in one profile of vertical sounders */
-                    /* LF < 15kHz < MF < 70 kHz < HF */
-
-extern long SAPI_getXYZfromSinglebeamSoundingHF(long depthOverChartZero,
-                                             double* north,double* east,double* depth);
-extern long SAPI_getXYZfromSinglebeamSoundingMF(long depthOverChartZero,
-                                             double* north,double* east,double* depth);
-extern long SAPI_getXYZfromSinglebeamSoundingLF(long depthOverChartZero,
-                                             double* north,double* east,double* depth);
-
-
-#endif /* ifndef _SAPI */
diff --git a/src/surf/mem_surf.c b/src/surf/mem_surf.c
deleted file mode 100644
index af4d71c..0000000
--- a/src/surf/mem_surf.c
+++ /dev/null
@@ -1,2309 +0,0 @@
-/*-----------------------------------------------------------------------
-/ P R O G R A M M K O P F
-/ ------------------------------------------------------------------------
-/ ------------------------------------------------------------------------
-/  DATEINAME        : mem_surf.c     Version 3.0
-/  ERSTELLUNGSDATUM : 29.07.93
-/ ------------------------------------------------------------------------
-/
-/ ------------------------------------------------------------------------
-/ COPYRIGHT (C) 1993: ATLAS ELEKTRONIK GMBH, 28305 BREMEN
-/ ------------------------------------------------------------------------
-/
-/  See README file for copying and redistribution conditions.
-/
-/
-/ HIER/SACHN: P: RP ____ _ ___ __
-/ BENENNUNG :
-/ ERSTELLER : Peter Block    : SAS3
-/ FREIGABE  : __.__.__  GS__
-/ AEND/STAND: __.__.__  __
-/ PRUEFVERM.:
-*/
-
-/*
-/ SPRACHE          : UNIX-C
-/ COMPILER         : Silicon Graphix
-/ BETRIEBSSYSTEM   : IRIX
-/ HARDWARE-UMGEBUNG: SGI Crimson
-/ URSPRUNGSHINWEIS :
-/
-/ ------------------------------------------------------------------------
-/ PROGRAMMBESCHREIBUNG:
-/ ------------------------------------------------------------------------
-/
-/    LIBRARY-Functions for SURF-memory-administration V2.0
-/
-/ ------------------------------------------------------------------------
-/ NAME, STRUKTUR UND KURZBESCHREIBUNG DER EINGABEPARAMETER:
-/ ------------------------------------------------------------------------
-/
-/    see mem_surf.h
-/
-/ ------------------------------------------------------------------------
-/ NAME, STRUKTUR UND KURZBESCHREIBUNG DER AUSGABEPARAMETER:
-/ ------------------------------------------------------------------------
-/
-/    see mem_surf.h
-/
-/ ------------------------------------------------------------------------
-/ VERHALTEN IM FEHLERFALL:
-/ ------------------------------------------------------------------------
-/
-/    see mem_surf.h
-/
-/ ------------------------------------------------------------------------
-/ E N D E   D E S   P R O G R A M M K O P F E S
-/ ------------------------------------------------------------------------
-*/
-/* ***********************************************************************
-*                                                                        *
-*  BEGINN DES DEKLARATIONSTEILS                                          *
-*                                                                        *
-*********************************************************************** */
-
-
-#define _MEM_SURF
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "xdr_surf.h"
-#include "mem_surf.h"
-
-
-/* ***********************************************************************
-*                                                                        *
-*  ENDE DES DEKLARATIONSTEILS                                            *
-*                                                                        *
-*********************************************************************** */
-
-
-
-
-
-
-/***************************************/
-/*                                     */
-/* free the memory for SIX-Block       */
-/* according to the Info-Structure     */
-/*                                     */
-/* a NULL-pointer in Info tells that   */
-/* this block is not existing in that  */
-/* specific configuration              */
-/*                                     */
-/***************************************/
-
-
-/* free a given six-structure */
-
-
-XdrSurf freeSixBlocks(SurfDataInfo* toSurfDataInfo,XdrSurf returnvalue )
-{
-  if(toSurfDataInfo->fp            != NULL)
-  {
-    fclose(toSurfDataInfo->fp);
-    toSurfDataInfo->fp = NULL;
-  }  
-  if(toSurfDataInfo->xdrs          != NULL)
-  {
-    free(toSurfDataInfo->xdrs);
-    toSurfDataInfo->xdrs = NULL;
-  }  
-  if(toSurfDataInfo->toDescriptor  != NULL)
-  {
-    free(toSurfDataInfo->toDescriptor);
-    toSurfDataInfo->toDescriptor = NULL;
-  }  
-  if(toSurfDataInfo->toGlobalData  != NULL)
-  {
-    free(toSurfDataInfo->toGlobalData);
-    toSurfDataInfo->toGlobalData = NULL;
-  }  
-  if(toSurfDataInfo->toStatistics  != NULL)
-  {
-    free(toSurfDataInfo->toStatistics);
-    toSurfDataInfo->toStatistics = NULL;
-  }  
-  if(toSurfDataInfo->toPosiSensors != NULL)
-  {
-    free(toSurfDataInfo->toPosiSensors);
-    toSurfDataInfo->toPosiSensors = NULL;
-  }  
-  if(toSurfDataInfo->toAngleTables != NULL)
-  {
-    free(toSurfDataInfo->toAngleTables);
-    toSurfDataInfo->toAngleTables = NULL;
-  }  
-  if(toSurfDataInfo->toTransducers != NULL)
-  {
-    free(toSurfDataInfo->toTransducers);
-    toSurfDataInfo->toTransducers = NULL;
-  }  
-  if(toSurfDataInfo->toCProfiles   != NULL)
-  {
-    free(toSurfDataInfo->toCProfiles);
-    toSurfDataInfo->toCProfiles = NULL;
-  }  
-  if(toSurfDataInfo->toPolygons    != NULL)
-  {
-    free(toSurfDataInfo->toPolygons);
-    toSurfDataInfo->toPolygons = NULL;
-  }  
-  if(toSurfDataInfo->toEvents      != NULL)
-  {
-    free(toSurfDataInfo->toEvents  );
-    toSurfDataInfo->toEvents = NULL;
-  } 
-  if(toSurfDataInfo->toFreeText    != NULL)
-  {
-    free(toSurfDataInfo->toFreeText);
-    toSurfDataInfo->toFreeText = NULL;
-  } 
-  if(toSurfDataInfo->toAddStatistics != NULL)
-  {
-    free(toSurfDataInfo->toAddStatistics);
-    toSurfDataInfo->toAddStatistics = NULL;
-  } 
-  if(toSurfDataInfo->toTpeStatics != NULL)
-  {
-    free(toSurfDataInfo->toTpeStatics);
-    toSurfDataInfo->toTpeStatics = NULL;
-  } 
-  if(toSurfDataInfo->toCProfileTpes  != NULL)
-  {
-    free(toSurfDataInfo->toCProfileTpes);
-    toSurfDataInfo->toCProfileTpes = NULL;
-  }  
-  if(toSurfDataInfo->toFreeSixDataDescr != NULL)
-  {
-    free(toSurfDataInfo->toFreeSixDataDescr);
-    toSurfDataInfo->toFreeSixDataDescr = NULL;
-  } 
-  if(toSurfDataInfo->toFreeSndgDataDescr != NULL)
-  {
-    free(toSurfDataInfo->toFreeSndgDataDescr);
-    toSurfDataInfo->toFreeSndgDataDescr = NULL;
-  } 
-  if(toSurfDataInfo->toFreeBeamDataDescr != NULL)
-  {
-    free(toSurfDataInfo->toFreeBeamDataDescr);
-    toSurfDataInfo->toFreeBeamDataDescr = NULL;
-  } 
-  if(toSurfDataInfo->toFreeSixData != NULL)
-  {
-    free(toSurfDataInfo->toFreeSixData);
-    toSurfDataInfo->toFreeSixData = NULL;
-  } 
-  if(toSurfDataInfo->toVendorText != NULL)
-  {
-    free(toSurfDataInfo->toVendorText);
-    toSurfDataInfo->toVendorText = NULL;
-  } 
-  return(returnvalue);
-}
-
-
-
-
-/***************************************/
-/*                                     */
-/* Allocate memory for SIX-Block and   */
-/* read data from file                 */
-/*                                     */
-/***************************************/
-
-/* fill the Descriptor- & Info-Structure with data from the file */           
-
-XdrSurf checkAndLoadSurfDescriptor(SurfDescriptor* toSurfDescriptor,
-                                      SurfDataInfo* toSurfDataInfo)
-{
-  if((toSurfDescriptor->six                != SIX_M               ) ||
-     (toSurfDescriptor->descriptor.typ     != DESCRIPTOR          ) ||
-     (toSurfDescriptor->globalData.typ     != GLOBALDATA          ) ||
-     (toSurfDescriptor->statistics.typ     != STATISTICS          ) ||
-     (toSurfDescriptor->positionSensor.typ != POSITIONSENSORS     ) ||
-     (toSurfDescriptor->transducer.typ     != TRANSDUCERPARAM     ) ||
-     (toSurfDescriptor->angleTab.typ       != BEAMANGLE           ) ||
-     (toSurfDescriptor->cProfile.typ       != CPROFILE            ) ||
-     (toSurfDescriptor->polygon.typ        != AREAPOLYGON         ) ||
-     (toSurfDescriptor->events.typ         != EVENTS              ) ||
-     (toSurfDescriptor->freeText.typ       != FREETEXT            ) ||
-     (toSurfDescriptor->addStatistics.typ  != ADDSTATISTICS       ) ||
-     (toSurfDescriptor->tpeStatics.typ     != TPESTATICS          ) ||
-     (toSurfDescriptor->cprofTpes.typ      != CPROFTPES           ) ||
-     (toSurfDescriptor->freeSixDescr.typ   != FREESIXDESCR        ) ||
-     (toSurfDescriptor->freeSndgDescr.typ  != FREESNDGDESCR       ) ||
-     (toSurfDescriptor->freeBeamDescr.typ  != FREEBEAMDESCR       ) ||
-     (toSurfDescriptor->freeSixAttData.typ != SIXATTDATA          ) ||
-     (toSurfDescriptor->vendorText.typ     != VENDORTEXT          ) ||
-     (toSurfDescriptor->sda                != SDA_M               ) ||
-     (toSurfDescriptor->nrof               != NROF_M              ) ||
-     (toSurfDescriptor->eod                != EOD_M               ))   
-  {
-   return(SURF_CORRUPTED_DATASET);
-  }
-
-  toSurfDataInfo->nrStatistics  = toSurfDescriptor->statistics.nr          ;
-  toSurfDataInfo->nrPosiSensors = toSurfDescriptor->positionSensor.nr      ;
-  toSurfDataInfo->nrAngleTables = toSurfDescriptor->angleTab.nr            ;
-  toSurfDataInfo->nrBeams       = toSurfDescriptor->maxNrOfBeams.nr        ;
-  toSurfDataInfo->nrTransducers = toSurfDescriptor->transducer.nr          ;
-  toSurfDataInfo->nrCProfiles   = toSurfDescriptor->cProfile.nr            ;
-  toSurfDataInfo->nrCPElements  = toSurfDescriptor->maxNrOfCProfileElements.nr;
-  toSurfDataInfo->nrPolyElements= toSurfDescriptor->maxNrOfPolygonElements.nr ;
-  toSurfDataInfo->nrEvents      = toSurfDescriptor->maxNrOfEvents.nr       ;
-  toSurfDataInfo->nrFreeTextUnits=toSurfDescriptor->maxNrOfFreeTextBlocks.nr  ;
-  toSurfDataInfo->nrAddStatistics     = toSurfDescriptor->addStatistics.nr;
-  toSurfDataInfo->nrTpeStatics        = toSurfDescriptor->tpeStatics.nr;
-  toSurfDataInfo->nrCprofTpes         = toSurfDescriptor->cprofTpes.nr;
-  toSurfDataInfo->nrOfSixAttachedData = toSurfDescriptor->freeSixDescr.nr;
-  toSurfDataInfo->nrOfSndgAttachedData= toSurfDescriptor->freeSndgDescr.nr;
-  toSurfDataInfo->nrOfBeamAttachedData= toSurfDescriptor->freeBeamDescr.nr;
-  toSurfDataInfo->nrOfVendorText      = toSurfDescriptor->vendorText.nr;
-  toSurfDataInfo->nrOfSoundings = toSurfDescriptor->soundings.nr           ;
-  toSurfDataInfo->maxNrSsData   = toSurfDescriptor->maxNrOfSidescanData.nr ;
-  toSurfDataInfo->nrOfRxSets    = toSurfDescriptor->nrOfRxTvgSets.nr ;
-  toSurfDataInfo->nrOfTxSets    = toSurfDescriptor->nrOfTxTvgSets.nr ;
-  toSurfDataInfo->nrOfCenterPositions 
-                                = toSurfDescriptor->centerPositions.nr     ;
-  toSurfDataInfo->nrOfCeps      = toSurfDescriptor->positionCpes.nr        ;
-  toSurfDataInfo->nrOfSingleBeamDepth 
-                                = toSurfDescriptor->singleBeamDepth.nr     ;
-  toSurfDataInfo->nrOfMultiBeamDepth 
-                                = toSurfDescriptor->multiBeamDepth.nr      ;
-  toSurfDataInfo->nrOfMultiBeamTT    
-                                = toSurfDescriptor->multiBeamTT.nr         ;
-  toSurfDataInfo->nrOfMultiBeamRec   
-                                = toSurfDescriptor->multiBeamRecv.nr       ;
-  toSurfDataInfo->nrOfSignalParams   
-                                = toSurfDescriptor->signalParams.nr        ;
-  toSurfDataInfo->nrOfTxParams   
-                                = toSurfDescriptor->txParams.nr            ;
-  toSurfDataInfo->nrOfSignalAmplitudes
-                                = toSurfDescriptor->signalAmplitudes.nr    ;
-  toSurfDataInfo->nrOfAmplitudes
-                                = toSurfDescriptor->beamAmplitudes.nr      ;
-  toSurfDataInfo->nrOfExtAmplitudes
-                                = toSurfDescriptor->extendBeamAmplitudes.nr;
-  toSurfDataInfo->nrOfSsData
-                                = toSurfDescriptor->sidescanData.nr        ;
-  toSurfDataInfo->nrOfSingleTPEs = toSurfDescriptor->singleTpeParams.nr    ;
-  toSurfDataInfo->nrOfMultiTPEs = toSurfDescriptor->multiTpeParams.nr      ;
-  return(SURF_SUCCESS);          
-}                                      
-
-
-
- 
-XdrSurf mem_ReadSixStructure(char* filename,
-                             SurfDataInfo* toSurfDataInfo)
-                             
-/* Allocates the necessary memory for a SIX-structure and reads 
-   the data from file;
-   actual description of the structure will be returned in
-   SurfDataInfo                                               */  
-                              
-{
-  XdrSurf ret;
-  XDR* xdrs;
-  FILE* fp;
-  SurfDescriptor* surfDescriptor;
-  SurfGlobalData* surfGlobalData;
-  SurfStatistics* surfStatistics;
-  SurfPositionSensorArray* surfPositionSensorArray;
-  SurfMultiBeamAngleTable* surfMultiBeamAngleTable; 
-  SurfTransducerParameterTable* surfTransducerParameterTable;
-  SurfCProfileTable* surfCProfileTable;
-  SurfCProfileTpeTable* surfCProfileTpeTable;
-  SurfPolygons*   surfPolygons;
-  SurfEvents*     surfEvents;   
-  SurfFreeText*   surfFreeText; 
-  SurfAddStatistics*       surfAddStatistics;
-  SurfTpeStatics*          surfTpeStatics;
-  SurfFreeSixDataDescr*    surfFreeSixDataDescr;
-  SurfFreeSndgDataDescr*   surfFreeSndgDataDescr;
-  SurfFreeBeamDataDescr*   surfFreeBeamDataDescr; 
-  SurfFreeSixAttachedData* surfFreeSixAttachedData;
-  SurfVendorText*          surfVendorText;
-  u_long  ii,jj,nn;
-  short newVersion,oldVersion,vers20;
-
-  /* initialize SurfDataInfo */
-
-  toSurfDataInfo->fp            = NULL;
-  toSurfDataInfo->xdrs          = NULL;
-  toSurfDataInfo->toDescriptor  = NULL;
-  toSurfDataInfo->toGlobalData  = NULL;
-  toSurfDataInfo->toStatistics  = NULL;
-  toSurfDataInfo->toPosiSensors = NULL;
-  toSurfDataInfo->toAngleTables = NULL;
-  toSurfDataInfo->toTransducers = NULL;
-  toSurfDataInfo->toCProfiles   = NULL;
-  toSurfDataInfo->toPolygons    = NULL;
-  toSurfDataInfo->toEvents      = NULL;
-  toSurfDataInfo->toFreeText    = NULL;
-  toSurfDataInfo->toAddStatistics    = NULL; 
-  toSurfDataInfo->toTpeStatics       = NULL;
-  toSurfDataInfo->toCProfileTpes     = NULL; 
-  toSurfDataInfo->toFreeSixDataDescr = NULL; 
-  toSurfDataInfo->toFreeSndgDataDescr= NULL; 
-  toSurfDataInfo->toFreeBeamDataDescr= NULL; 
-  toSurfDataInfo->toFreeSixData      = NULL; 
-  toSurfDataInfo->toVendorText       = NULL; 
-
-  /* allocate structure for xdr-conversion and SurfDescriptor */
-  
-  xdrs = (XDR*)calloc(1,sizeof(XDR));
-  toSurfDataInfo->xdrs = xdrs; 
-  surfDescriptor = (SurfDescriptor*)calloc(1,sizeof(SurfDescriptor));
-  toSurfDataInfo->toDescriptor = surfDescriptor;
-  if ((xdrs == NULL) || (surfDescriptor == NULL))
-  {
-   return(freeSixBlocks(toSurfDataInfo,SURF_CANT_GET_MEMORY));
-  }
-
-
-  /* open conversion and file Read  */
-  
-  fp =  xdrSurfOpenRead(xdrs,(const char*)filename);
-  toSurfDataInfo->fp = fp; 
-  if(fp == NULL)
-  {
-   return(freeSixBlocks(toSurfDataInfo,SURF_CANT_OPEN_FILE));
-  }
-
-
-  /* read SurfDescriptor */
-  
-  ret = xdr_SurfDescriptor(xdrs,surfDescriptor,&newVersion,&oldVersion);
-  if(ret != SURF_SUCCESS)
-  {
-   return(freeSixBlocks(toSurfDataInfo,ret));
-  }
-  toSurfDataInfo->sourceVersionLess2 = 0;
-  vers20 = getSurfVersion(SURF_VERS2_0);
-  if(oldVersion < vers20)
-  {
-   toSurfDataInfo->sourceVersionLess2 = 1;
-  } 
-  
-  ret = checkAndLoadSurfDescriptor(surfDescriptor,toSurfDataInfo);
-  if(ret != SURF_SUCCESS)
-  {
-   return(freeSixBlocks(toSurfDataInfo,ret));
-  }
-
-
-  /* read Global Data */
-
-  surfGlobalData = (SurfGlobalData*)calloc(1,sizeof(SurfGlobalData));
-  toSurfDataInfo->toGlobalData = surfGlobalData;
-  if (surfGlobalData == NULL)
-  {
-   return(freeSixBlocks(toSurfDataInfo,SURF_CANT_GET_MEMORY));
-  }
-  ret = xdr_SurfGlobalData(xdrs,surfGlobalData);
-  if(ret != SURF_SUCCESS)
-  {
-   return(freeSixBlocks(toSurfDataInfo,ret));
-  }
-
-
-  /* read Statistics  */
-
-  if(toSurfDataInfo->nrStatistics != 0)
-  {
-   surfStatistics = (SurfStatistics*)calloc(1,sizeof(SurfStatistics));
-   toSurfDataInfo->toStatistics = surfStatistics;
-   if (surfStatistics == NULL)
-   {
-    return(freeSixBlocks(toSurfDataInfo,SURF_CANT_GET_MEMORY));
-   }
-   ret = xdr_SurfStatistics(xdrs,surfStatistics);
-   if(ret != SURF_SUCCESS)
-   {
-    return(freeSixBlocks(toSurfDataInfo,ret));
-   }
-  }
-
-
-  /* read Position Sensors  */
-
-  ii = toSurfDataInfo->nrPosiSensors;
-  if(ii == 0)
-  {
-   return(freeSixBlocks(toSurfDataInfo,SURF_CORRUPTED_DATASET));
-  }
-  else
-  {
-   surfPositionSensorArray = (SurfPositionSensorArray*)
-                            calloc((u_int)ii,sizeof(SurfPositionSensorArray));
-   toSurfDataInfo->toPosiSensors = surfPositionSensorArray;
-   if (surfPositionSensorArray == NULL)
-   {
-    return(freeSixBlocks(toSurfDataInfo,SURF_CANT_GET_MEMORY));
-   }
-   for(nn=0;nn<ii;nn++)
-   {
-    ret = xdr_PositionSensorArray(xdrs,surfPositionSensorArray,oldVersion);
-    if(ret != SURF_SUCCESS)
-    {
-     return(freeSixBlocks(toSurfDataInfo,ret));
-    }
-    surfPositionSensorArray++;
-   }
-  }
-
-
-  /* read transducer data of singlebeamsounders  */
-
-  ii = toSurfDataInfo->nrTransducers;
-  if(ii != 0)
-  {
-   surfTransducerParameterTable = (SurfTransducerParameterTable*)calloc((u_int)ii,
-                                  sizeof(SurfTransducerParameterTable));
-   toSurfDataInfo->toTransducers = surfTransducerParameterTable;
-   if (surfTransducerParameterTable == NULL)
-   {
-    return(freeSixBlocks(toSurfDataInfo,SURF_CANT_GET_MEMORY));
-   }
-   for(nn=0;nn<ii;nn++)
-   {
-    ret = xdr_SurfTransducerParameterTable(xdrs,surfTransducerParameterTable);
-    if(ret != SURF_SUCCESS)
-    {
-     return(freeSixBlocks(toSurfDataInfo,ret));
-    }
-    surfTransducerParameterTable++;
-   }
-  }
-
-
-  /* read beam-angle tables of multibeamsounders  */
-
-  ii = toSurfDataInfo->nrAngleTables;  
-  jj = toSurfDataInfo->nrBeams;        
-  if((ii != 0) && (jj != 0))
-  {
-   surfMultiBeamAngleTable = (SurfMultiBeamAngleTable*)
-                 calloc((u_int)ii,(size_t)SIZE_OF_SURF_MULTIBEAM_ANGLE_TAB((u_int)jj));
-   toSurfDataInfo->toAngleTables = surfMultiBeamAngleTable;
-   if (surfMultiBeamAngleTable == NULL)
-   {
-    return(freeSixBlocks(toSurfDataInfo,SURF_CANT_GET_MEMORY));
-   }
-   for(nn=0;nn<ii;nn++)
-   {
-    ret = xdr_SurfMultiBeamAngleTable(xdrs,surfMultiBeamAngleTable,(u_short)jj);
-    if(ret != SURF_SUCCESS)
-    {
-     return(freeSixBlocks(toSurfDataInfo,ret));
-    }
-    surfMultiBeamAngleTable = (SurfMultiBeamAngleTable*)
-                             ((char*)(surfMultiBeamAngleTable)
-                             +(size_t)(SIZE_OF_SURF_MULTIBEAM_ANGLE_TAB(jj)));
-   }
-  }
-
-
-  /* read C-profile tables */
-
-  ii = toSurfDataInfo->nrCProfiles;    
-  jj = toSurfDataInfo->nrCPElements;   
-  if((ii != 0) && (jj != 0))
-  {
-   surfCProfileTable = (SurfCProfileTable*)
-                         calloc((u_int)ii,(size_t)SIZE_OF_SURF_C_PROFILE_TAB((u_int)jj));
-   toSurfDataInfo->toCProfiles = surfCProfileTable;
-   if (surfCProfileTable == NULL)
-   {
-    return(freeSixBlocks(toSurfDataInfo,SURF_CANT_GET_MEMORY));
-   }
-   for(nn=0;nn<ii;nn++)
-   {
-    surfCProfileTable =  getSurfCProfileTable(toSurfDataInfo->toCProfiles,
-                                                       (short)jj,(long)nn);
-    ret = xdr_SurfCProfileTable(xdrs,surfCProfileTable,(u_short)jj);
-    if(ret != SURF_SUCCESS)
-    {
-     return(freeSixBlocks(toSurfDataInfo,ret));
-    }
-   }
-  }
-
-
-  /* read C-profile TPE-values */
-
-  if(toSurfDataInfo->nrCprofTpes > 0)
-  {
-   ii = toSurfDataInfo->nrCProfiles;    
-   jj = toSurfDataInfo->nrCPElements;   
-   if((ii != 0) && (jj != 0))
-   {
-    surfCProfileTpeTable = (SurfCProfileTpeTable*)
-                  calloc((u_int)ii,(size_t)SIZE_OF_SURF_C_PROFILE_TPE_TAB((u_int)jj));
-    toSurfDataInfo->toCProfileTpes = surfCProfileTpeTable;
-    if (surfCProfileTpeTable == NULL)
-    {
-     return(freeSixBlocks(toSurfDataInfo,SURF_CANT_GET_MEMORY));
-    }
-    for(nn=0;nn<ii;nn++)
-    {
-     surfCProfileTpeTable =  getSurfCProfileTpeTable(toSurfDataInfo->toCProfileTpes,
-                                                                (short)jj,(long)nn);
-     ret = xdr_SurfCProfileTableTpes(xdrs,surfCProfileTpeTable,(u_short)jj);
-     if(ret != SURF_SUCCESS)
-     {
-      return(freeSixBlocks(toSurfDataInfo,ret));
-     }
-    }
-   }
-  }
-
-
-
-  /* read areapolygon */
-
-  jj = toSurfDataInfo->nrPolyElements;   
-  if(jj != 0)
-  {
-   surfPolygons = (SurfPolygons*)calloc(1,(size_t)SIZE_OF_SURF_POLYGON_ARRAY((u_int)jj));
-   toSurfDataInfo->toPolygons = surfPolygons;
-   if (surfPolygons == NULL)
-   {
-    return(freeSixBlocks(toSurfDataInfo,SURF_CANT_GET_MEMORY));
-   }
-   ret = xdr_SurfPolygons(xdrs,surfPolygons,(u_short)jj);
-   if(ret != SURF_SUCCESS)
-   {
-    return(freeSixBlocks(toSurfDataInfo,ret));
-   }
-  }
-
-
-  /* read event blocks*/
-
-  jj = toSurfDataInfo->nrEvents;
-  if(jj != 0)
-  {
-   surfEvents = (SurfEvents*)calloc(1,(size_t)SIZE_OF_SURF_EVENT_ARRAY((u_int)jj));
-   toSurfDataInfo->toEvents = surfEvents;
-   if (surfEvents == NULL)
-   {
-    return(freeSixBlocks(toSurfDataInfo,SURF_CANT_GET_MEMORY));
-   }
-   ret = xdr_SurfEvents(xdrs,surfEvents,(u_short)jj);
-   if(ret != SURF_SUCCESS)
-   {
-    return(freeSixBlocks(toSurfDataInfo,ret));
-   }
-  }
-
-
-  /* read free text block*/
-
-  jj = toSurfDataInfo->nrFreeTextUnits;
-  if(jj != 0)
-  {
-   surfFreeText = (SurfFreeText*)calloc(1,(size_t)SIZE_OF_FREE_TEXT_ARRAY((u_int)jj));
-   toSurfDataInfo->toFreeText = surfFreeText;
-   if (surfFreeText == NULL)
-   {
-    return(freeSixBlocks(toSurfDataInfo,SURF_CANT_GET_MEMORY));
-   }
-   ret = xdr_SurfFreeText(xdrs,surfFreeText,(u_short)jj);
-   if(ret != SURF_SUCCESS)
-   {
-    return(freeSixBlocks(toSurfDataInfo,ret));
-   }
-  }
-
-
-  /* read additional Statistics  */
-
-  if(toSurfDataInfo->nrAddStatistics != 0)
-  {
-   surfAddStatistics = (SurfAddStatistics*)calloc(1,sizeof(SurfAddStatistics));
-   toSurfDataInfo->toAddStatistics = surfAddStatistics;
-   if (surfStatistics == NULL)
-   {
-    return(freeSixBlocks(toSurfDataInfo,SURF_CANT_GET_MEMORY));
-   }
-   ret = xdr_SurfAddStatistics(xdrs,surfAddStatistics);
-   if(ret != SURF_SUCCESS)
-   {
-    return(freeSixBlocks(toSurfDataInfo,ret));
-   }
-  }
-
-
-  
-  /* read TPE Static Data  */
-
-  if(toSurfDataInfo->nrTpeStatics != 0)
-  {
-   surfTpeStatics = (SurfTpeStatics*)calloc(1,sizeof(SurfTpeStatics));
-   toSurfDataInfo->toTpeStatics = surfTpeStatics;
-   if (surfTpeStatics == NULL)
-   {
-    return(freeSixBlocks(toSurfDataInfo,SURF_CANT_GET_MEMORY));
-   }
-   ret = xdr_SurfTpeStatics(xdrs,surfTpeStatics);
-   if(ret != SURF_SUCCESS)
-   {
-    return(freeSixBlocks(toSurfDataInfo,ret));
-   }
-  }
-
-
-
-  
-  /* read Free Six Data Descriptor */
-
-  jj = toSurfDataInfo->nrOfSixAttachedData;
-  if(jj > 0)
-  {
-   surfFreeSixDataDescr = (SurfFreeSixDataDescr*)calloc((u_int)jj,sizeof(SurfFreeSixDataDescr));
-   toSurfDataInfo->toFreeSixDataDescr = surfFreeSixDataDescr;
-   if (surfFreeSixDataDescr == NULL)
-   {
-    return(freeSixBlocks(toSurfDataInfo,SURF_CANT_GET_MEMORY));
-   }
-   for(ii=0;ii<jj;ii++)
-   {
-    surfFreeSixDataDescr = &(toSurfDataInfo->toFreeSixDataDescr[ii]);
-    ret = xdr_SurfFreeSixDataDescr(xdrs,surfFreeSixDataDescr);
-    if(ret != SURF_SUCCESS)
-    {
-     return(freeSixBlocks(toSurfDataInfo,ret));
-    }
-   }
-  }
-
-
-
-  /* read Free Sounding Data Descriptor */
-
-  jj = toSurfDataInfo->nrOfSndgAttachedData;
-  if(jj > 0)
-  {
-   surfFreeSndgDataDescr = (SurfFreeSndgDataDescr*)calloc((u_int)jj,sizeof(SurfFreeSndgDataDescr));
-   toSurfDataInfo->toFreeSndgDataDescr = surfFreeSndgDataDescr;
-   if (surfFreeSndgDataDescr == NULL)
-   {
-    return(freeSixBlocks(toSurfDataInfo,SURF_CANT_GET_MEMORY));
-   }
-   for(ii=0;ii<jj;ii++)
-   {
-    surfFreeSndgDataDescr = &(toSurfDataInfo->toFreeSndgDataDescr[ii]);
-    ret = xdr_SurfFreeSndgDataDescr(xdrs,surfFreeSndgDataDescr);
-    if(ret != SURF_SUCCESS)
-    {
-     return(freeSixBlocks(toSurfDataInfo,ret));
-    }
-   }
-  }
-
-
-
-  /* read Free Beam Data Descriptor */
-
-  jj = toSurfDataInfo->nrOfBeamAttachedData;
-  if(jj > 0)
-  {
-   surfFreeBeamDataDescr = (SurfFreeBeamDataDescr*)calloc((u_int)jj,sizeof(SurfFreeBeamDataDescr));
-   toSurfDataInfo->toFreeBeamDataDescr = surfFreeBeamDataDescr;
-   if (surfFreeBeamDataDescr == NULL)
-   {
-    return(freeSixBlocks(toSurfDataInfo,SURF_CANT_GET_MEMORY));
-   }
-   for(ii=0;ii<jj;ii++)
-   {
-    surfFreeBeamDataDescr = &(toSurfDataInfo->toFreeBeamDataDescr[ii]);
-    ret = xdr_SurfFreeBeamDataDescr(xdrs,surfFreeBeamDataDescr);
-    if(ret != SURF_SUCCESS)
-    {
-     return(freeSixBlocks(toSurfDataInfo,ret));
-    }
-   }
-  }
-
-
-
-  /* read Free Six Data */
-
-  jj = toSurfDataInfo->nrOfSixAttachedData;
-  if(jj > 0)
-  {
-   surfFreeSixAttachedData = (SurfFreeSixAttachedData*)calloc((u_int)jj,sizeof(SurfFreeSixAttachedData));
-   toSurfDataInfo->toFreeSixData = surfFreeSixAttachedData;
-   if (surfFreeSixAttachedData == NULL)
-   {
-    return(freeSixBlocks(toSurfDataInfo,SURF_CANT_GET_MEMORY));
-   }
-   for(ii=0;ii<jj;ii++)
-   {
-    surfFreeSixAttachedData = &(toSurfDataInfo->toFreeSixData[ii]);
-    ret = xdr_SurfFreeSixAttachedData(xdrs,surfFreeSixAttachedData);
-    if(ret != SURF_SUCCESS)
-    {
-     return(freeSixBlocks(toSurfDataInfo,ret));
-    }
-   }
-  }
-
-
-
-  /* read Vendor Text  */
-
-  if(toSurfDataInfo->nrOfVendorText != 0)
-  {
-   surfVendorText = (SurfVendorText*)calloc(1,sizeof(SurfVendorText));
-   toSurfDataInfo->toVendorText = surfVendorText;
-   if (surfVendorText == NULL)
-   {
-    return(freeSixBlocks(toSurfDataInfo,SURF_CANT_GET_MEMORY));
-   }
-   ret = xdr_SurfVendorText(xdrs,surfVendorText);
-   if(ret != SURF_SUCCESS)
-   {
-    return(freeSixBlocks(toSurfDataInfo,ret));
-   }
-  }
-
-
-  /* Everything is done successfully (hope so ?)*/
-
-  if(toSurfDataInfo->fp != NULL)fclose(fp);
-  toSurfDataInfo->fp = NULL;
-  return(SURF_SUCCESS);
-
-}
-
-
-
-
-/***************************************/
-/*                                     */
-/* Allocate memory for SDA-Block and   */
-/* read data from file                 */
-/*                                     */
-/***************************************/
-
-
-static size_t align64(size_t size)
-{
- return( (size_t) ( ((int) ((size+7)/8))*8 ) );
-}
-
-/* calculate the sizes within a SDA-Block */
-
-
-size_t initializeSdaInfo(SurfDataInfo* toSurfDataInfo,SdaInfo* toSdaInfo)
-{
- size_t sum;
- short nrAmpli;
- 
- toSdaInfo->indexCenterPosition = 0;
- toSdaInfo->indexMultiBeam      = 0;
- toSdaInfo->indexAmplitudes     = 0;
-
- toSdaInfo->nrCenterPosition = toSurfDataInfo->nrOfCenterPositions;
- toSdaInfo->nrBeam           = toSurfDataInfo->nrOfMultiBeamDepth;
- toSdaInfo->nrAmplitudes     = toSurfDataInfo->nrOfSignalAmplitudes;
- toSdaInfo->nrSsData         = toSurfDataInfo->maxNrSsData;
- toSdaInfo->nrRxParams       = toSurfDataInfo->nrOfRxSets;
- toSdaInfo->nrTxParams       = toSurfDataInfo->nrOfTxSets;
- toSdaInfo->nrOfSndgAttachedData = toSurfDataInfo->nrOfSndgAttachedData;
- toSdaInfo->nrOfBeamAttachedData = toSurfDataInfo->nrOfBeamAttachedData;
-
- toSdaInfo->soundingS        = sizeof(SurfSoundingData);
- toSdaInfo->sndgAttDataS = 0;
- if(toSurfDataInfo->nrOfSndgAttachedData > 0)
- {
-  toSdaInfo->sndgAttDataS = sizeof(SurfFreeSoundingAttachedData);
- }
- toSdaInfo->centerPS         = sizeof(SurfCenterPosition);
- toSdaInfo->positionCepDataS = 0;
- if(toSurfDataInfo->nrOfCeps > 0)
- {
-  toSdaInfo->positionCepDataS= sizeof(SurfPositionCepData);
- }
- toSdaInfo->singleBDS       = 0;
- if(toSurfDataInfo->nrOfSingleBeamDepth > 0)
- {
-  toSdaInfo->singleBDS        = sizeof(SurfSingleBeamDepth);
- }
- toSdaInfo->singleTPEsS       = 0;
- if(toSurfDataInfo->nrOfSingleTPEs > 0)
- {
-  toSdaInfo->singleTPEsS      = sizeof(SurfTpeValues);
- }
- toSdaInfo->multiBDS       = 0;
- if(toSurfDataInfo->nrOfMultiBeamDepth > 0)
- {
-  toSdaInfo->multiBDS        = sizeof(SurfMultiBeamDepth);
- } 
- toSdaInfo->multiBTTS      = 0;
- if(toSurfDataInfo->nrOfMultiBeamTT > 0)
- {
-  toSdaInfo->multiBTTS       = sizeof(SurfMultiBeamTT);
- } 
- toSdaInfo->multiBRS       = 0;
- if(toSurfDataInfo->nrOfMultiBeamRec > 0)
- {
-  toSdaInfo->multiBRS        = sizeof(SurfMultiBeamReceive);
- } 
- toSdaInfo->multiTPEsS       = 0;
- if(toSurfDataInfo->nrOfMultiTPEs > 0)
- {
-  toSdaInfo->multiTPEsS      = sizeof(SurfTpeValues);
- }
- toSdaInfo->beamAttDataS = 0;
- if(toSurfDataInfo->nrOfBeamAttachedData > 0)
- {
-  toSdaInfo->beamAttDataS = sizeof(SurfFreeBeamAttachedData);
- }
- toSdaInfo->amplS           = 0;
- if(toSurfDataInfo->nrOfAmplitudes > 0)
- {
-  toSdaInfo->amplS           = sizeof(SurfAmplitudes);
- } 
- toSdaInfo->extAmplS        = 0;
- if(toSurfDataInfo->nrOfExtAmplitudes > 0)
- {
-  toSdaInfo->extAmplS        = sizeof(SurfExtendedAmplitudes);
- } 
- toSdaInfo->signalPS       = 0;
- if(toSurfDataInfo->nrOfSignalParams > 0)
- {
-  toSdaInfo->signalPS        = 
-                        SIZE_OF_SURF_SIGNAL_PARAMETER((u_int)toSdaInfo->nrRxParams);
- } 
- toSdaInfo->signalTxPS       = 0;
- if(toSurfDataInfo->nrOfTxParams > 0)
- {
-  toSdaInfo->signalTxPS       = 
-                        SIZE_OF_SURF_TX_PARAMETER((u_int)toSdaInfo->nrTxParams);
- } 
- toSdaInfo->signalAS       = 0;
- if(toSurfDataInfo->nrOfSignalAmplitudes > 0)
- {
-  toSdaInfo->signalAS        = 
-    SIZE_OF_SURF_SIGNAL_AMPLITUDES_ARRAY((u_int)toSurfDataInfo->nrOfSignalAmplitudes);
- }
- toSdaInfo->ssDataS       = 0;
- if(toSurfDataInfo->nrOfSsData > 0)
- {
-  toSdaInfo->ssDataS        = 
-    SIZE_OF_SURF_SIDESCAN_DATA_ARRAY((u_int)toSurfDataInfo->maxNrSsData);
- }
-
- nrAmpli=(short)toSdaInfo->nrBeam;
- if((nrAmpli%2) != 0)nrAmpli++;
-
- sum = align64( toSdaInfo->soundingS                                                )
-     + align64( toSdaInfo->sndgAttDataS  * (size_t)(toSdaInfo->nrOfSndgAttachedData))
-     + align64( toSdaInfo->centerPS          * (size_t)(toSdaInfo->nrCenterPosition))
-     + align64( toSdaInfo->positionCepDataS  * (size_t)(toSdaInfo->nrCenterPosition))
-     + align64( toSdaInfo->singleBDS                                                )
-     + align64( toSdaInfo->singleTPEsS                                              )
-     + align64( toSdaInfo->multiBDS   * (size_t)(toSdaInfo->nrBeam                 ))
-     + align64( toSdaInfo->multiBTTS  * (size_t)(toSdaInfo->nrBeam                 ))
-     + align64( toSdaInfo->multiBRS   * (size_t)(toSdaInfo->nrBeam                 ))
-     + align64( toSdaInfo->multiTPEsS * (size_t)(toSdaInfo->nrBeam                 ))
-     + align64( toSdaInfo->beamAttDataS  * (size_t)(toSdaInfo->nrOfBeamAttachedData)
-                                  * (size_t)(toSdaInfo->nrBeam )             )
-     + align64( toSdaInfo->amplS      * (size_t)(nrAmpli                           ))
-     + align64( toSdaInfo->extAmplS   * (size_t)(toSdaInfo->nrBeam                 ))
-     + align64( toSdaInfo->signalPS                                                 )
-     + align64( toSdaInfo->signalTxPS                                               )
-     + align64( toSdaInfo->signalAS                                                 )
-     + align64( toSdaInfo->ssDataS                                                  );
-     
- toSdaInfo->allS = sum;
- return(sum);
-}
-
-
-
-
-/* sets the sda pointers in SdaInfo         */
-
-void setPointersInSdaInfo(void* toSdaBlock,SdaInfo* toSdaInfo)
-{
- char* bp;
- short nrAmpli;
-
- bp = (char*)toSdaBlock;
- 
- toSdaInfo->toSoundings = (SurfSoundingData*) bp;
- bp = bp + align64(toSdaInfo->soundingS);
-
- if( toSdaInfo->sndgAttDataS == 0)
- {
-  toSdaInfo->toFreeSoundingAttachedData = NULL;
- }
- else
- { 
-  toSdaInfo->toFreeSoundingAttachedData = (SurfFreeSoundingAttachedData*) bp;
-  bp = bp + align64(toSdaInfo->sndgAttDataS * (size_t)(toSdaInfo->nrOfSndgAttachedData));
- }
- 
- toSdaInfo->toCenterPositions    = (SurfCenterPosition*) bp;
- toSdaInfo->toActCenterPosition  = (SurfCenterPosition*)(bp 
-              + (toSdaInfo->centerPS * toSdaInfo->indexCenterPosition));
- bp = bp + align64((size_t)(toSdaInfo->centerPS * toSdaInfo->nrCenterPosition));
-
- if( toSdaInfo->positionCepDataS == 0)
- {
-  toSdaInfo->toPositionCepData    = NULL;
- }
- else
- {
-  toSdaInfo->toPositionCepData    = (SurfPositionCepData*) bp;
-  bp = bp + align64((size_t)(toSdaInfo->positionCepDataS * toSdaInfo->nrCenterPosition));
- }
-
- if( toSdaInfo->singleBDS == 0)
- {
-  toSdaInfo->toSingleBeamDepth = NULL;
- }
- else
- {
-  toSdaInfo->toSingleBeamDepth = (SurfSingleBeamDepth*) bp;
-  bp = bp + align64(toSdaInfo->singleBDS); 
- }
-
- if( toSdaInfo->singleTPEsS == 0)
- {
-  toSdaInfo->toSingleBeamTpeValues = NULL;
- }
- else
- {
-  toSdaInfo->toSingleBeamTpeValues = (SurfTpeValues*) bp;
-  bp = bp + align64(toSdaInfo->singleTPEsS); 
- }
-
- if( toSdaInfo->multiBDS == 0)
- {
-  toSdaInfo->toMultiBeamDepth = NULL;
-  toSdaInfo->toActMultiBeamDepth = NULL;
- }
- else
- {
-  toSdaInfo->toMultiBeamDepth = (SurfMultiBeamDepth*) bp;
-  toSdaInfo->toActMultiBeamDepth  = (SurfMultiBeamDepth*)(bp 
-              + (toSdaInfo->multiBDS * toSdaInfo->indexMultiBeam));
-  bp = bp + align64((size_t)(toSdaInfo->multiBDS * toSdaInfo->nrBeam)); 
- }
-
- if( toSdaInfo->multiBTTS == 0)
- {
-  toSdaInfo->toMultiBeamTT = NULL;
-  toSdaInfo->toActMultiBeamTT = NULL;
- }
- else
- {
-  toSdaInfo->toMultiBeamTT = (SurfMultiBeamTT*) bp;
-  toSdaInfo->toActMultiBeamTT  = (SurfMultiBeamTT*)(bp 
-              + (toSdaInfo->multiBTTS * toSdaInfo->indexMultiBeam));
-  bp = bp + align64((size_t)(toSdaInfo->multiBTTS * toSdaInfo->nrBeam)); 
- }
-
- if( toSdaInfo->multiBRS == 0)
- {
-  toSdaInfo->toMultiBeamRec = NULL;
-  toSdaInfo->toActMultiBeamRec = NULL;
- }
- else
- {
-  toSdaInfo->toMultiBeamRec = (SurfMultiBeamReceive*) bp;
-  toSdaInfo->toActMultiBeamRec  = (SurfMultiBeamReceive*)(bp 
-              + (toSdaInfo->multiBRS * toSdaInfo->indexMultiBeam));
-  bp = bp + align64((size_t)(toSdaInfo->multiBRS * toSdaInfo->nrBeam)); 
- }
-
- if( toSdaInfo->multiTPEsS == 0)
- {
-  toSdaInfo->toMultiBeamTpeValues = NULL;
- }
- else
- {
-  toSdaInfo->toMultiBeamTpeValues = (SurfTpeValues*) bp;
-  bp = bp + align64(toSdaInfo->multiTPEsS * (size_t)(toSdaInfo->nrBeam)); 
- }
-
- if( toSdaInfo->beamAttDataS == 0)
- {
-  toSdaInfo->toFreeBeamAttachedData = NULL;
- }
- else
- {
-  toSdaInfo->toFreeBeamAttachedData = (SurfFreeBeamAttachedData*) bp;
-  bp = bp + align64( toSdaInfo->beamAttDataS  * (size_t)(toSdaInfo->nrOfBeamAttachedData)
-                                       * (size_t)(toSdaInfo->nrBeam ));
- }
-
- if( toSdaInfo->amplS    == 0)
- {
-  toSdaInfo->toAmplitudes = NULL;
- }
- else
- {
-  toSdaInfo->toAmplitudes = (SurfAmplitudes*) bp;
-  nrAmpli=(short)toSdaInfo->nrBeam;
-  if((nrAmpli%2) != 0)nrAmpli++;
-  bp = bp + align64(toSdaInfo->amplS * nrAmpli); 
- }
-
- if( toSdaInfo->extAmplS    == 0)
- {
-  toSdaInfo->toExtendedAmpl = NULL;
- }
- else
- {
-  toSdaInfo->toExtendedAmpl = (SurfExtendedAmplitudes*) bp;
-  bp = bp + align64((size_t)(toSdaInfo->extAmplS * toSdaInfo->nrBeam)); 
- }
-
- if( toSdaInfo->signalPS == 0)
- {
-  toSdaInfo->toSignalParams = NULL;
- }
- else
- {
-  toSdaInfo->toSignalParams = (SurfSignalParameter*) bp;
-  bp = bp + align64(toSdaInfo->signalPS);
- }
-
- if( toSdaInfo->signalTxPS == 0)
- {
-  toSdaInfo->toTxParams = NULL;
- }
- else
- {
-  toSdaInfo->toTxParams = (SurfTxParameter*) bp;
-  bp = bp + align64(toSdaInfo->signalTxPS);
- }
-
- if( toSdaInfo->signalAS == 0)
- {
-  toSdaInfo->toSignalAmplitudes = NULL;
-  toSdaInfo->toActSignalAmplitudes = NULL;
- }
- else
- {
-  toSdaInfo->toSignalAmplitudes = (SurfSignalAmplitudes*) bp;
-  toSdaInfo->toActSignalAmplitudes = (SurfSignalAmplitudes*)bp; 
-  bp = bp + align64(toSdaInfo->signalAS);
- }
-
- if( toSdaInfo->ssDataS == 0)
- {
-  toSdaInfo->toSsData = NULL;
- }
- else
- {
-  toSdaInfo->toSsData = (SurfSidescanData*) bp;
-  bp = bp + align64(toSdaInfo->ssDataS);
- }
-}
-
-
-
-
-/* converts  one SDA-Block memory->file or file->memory */
- 
-XdrSurf mem_convertOneSdaBlock2(XDR* xdrs,SdaInfo* sdaInfo,short versLess2)
-{
- XdrSurf ret;
- char* bp;
- u_long ii,jj;
- 
- 
- ret = xdr_SurfSoundingData(xdrs,sdaInfo->toSoundings,versLess2);
- if(ret != SURF_SUCCESS) return(ret);
-
- if(sdaInfo->toFreeSoundingAttachedData != NULL)
- { 
-  for(ii=0;ii < sdaInfo->nrOfSndgAttachedData;ii++)
-  {
-   bp = (char*)(sdaInfo->toFreeSoundingAttachedData)+(ii * sdaInfo->sndgAttDataS);
-   ret = xdr_SurfFreeSoundingAttachedData(xdrs,(SurfFreeSoundingAttachedData*) bp);
-   if(ret != SURF_SUCCESS)
-   {
-    return(ret);
-   } 
-  }
- }
-
- for(ii=0;ii < sdaInfo->nrCenterPosition;ii++)
- {
-  bp = (char*)(sdaInfo->toCenterPositions)+(ii * sdaInfo->centerPS);
-  ret = xdr_SurfCenterPosition(xdrs,(SurfCenterPosition*) bp);
-  if(ret != SURF_SUCCESS)
-  {
-   return(ret);
-  } 
- }
-
- if(sdaInfo->toPositionCepData != NULL)
- { 
-  for(ii=0;ii < sdaInfo->nrCenterPosition;ii++)
-  {
-   bp = (char*)(sdaInfo->toPositionCepData)+(ii * sdaInfo->positionCepDataS);
-   ret = xdr_SurfPositionCepData(xdrs,(SurfPositionCepData*) bp);
-   if(ret != SURF_SUCCESS)
-   {
-    return(ret);
-   } 
-  }
- }
-
- if(sdaInfo->toSingleBeamDepth != NULL)
- {
-  ret = xdr_SurfSingleBeamDepth(xdrs,sdaInfo->toSingleBeamDepth);
-  if(ret != SURF_SUCCESS)
-  {
-   return(ret);
-  } 
- }
-
- if(sdaInfo->toSingleBeamTpeValues != NULL)
- {
-  ret = xdr_SurfTpeValues(xdrs,(SurfTpeValues*) sdaInfo->toSingleBeamTpeValues);
-  if(ret != SURF_SUCCESS)
-  {
-   return(ret);
-  } 
- }
-
- if(sdaInfo->toMultiBeamDepth != NULL)
- {
-   for(ii=0;ii < sdaInfo->nrBeam;ii++)
-   {
-    bp = (char*)(sdaInfo->toMultiBeamDepth)+(ii * sdaInfo->multiBDS);
-    ret = xdr_SurfMultiBeamDepth(xdrs,(SurfMultiBeamDepth*) bp);
-    if(ret != SURF_SUCCESS)
-    {
-     return(ret);
-    } 
-   }
- }
-
- if(sdaInfo->toMultiBeamTT != NULL)
- {
-   for(ii=0;ii < sdaInfo->nrBeam;ii++)
-   {
-    bp = (char*)(sdaInfo->toMultiBeamTT)+(ii * sdaInfo->multiBTTS);
-    ret = xdr_SurfMultiBeamTT(xdrs,(SurfMultiBeamTT*) bp);
-    if(ret != SURF_SUCCESS)
-    {
-     return(ret);
-    } 
-   }
- }
-
- if(sdaInfo->toMultiBeamRec != NULL)
- {
-   for(ii=0;ii < sdaInfo->nrBeam;ii++)
-   {
-    bp = (char*)(sdaInfo->toMultiBeamRec)+(ii * sdaInfo->multiBRS);
-    ret = xdr_SurfMultiBeamReceive(xdrs,(SurfMultiBeamReceive*) bp);
-    if(ret != SURF_SUCCESS)
-    {
-     return(ret);
-    } 
-   }
- }
-
- if(sdaInfo->toMultiBeamTpeValues != NULL)
- {
-  for(ii=0;ii < sdaInfo->nrBeam;ii++)
-  {
-   bp = (char*)(sdaInfo->toMultiBeamTpeValues)+(ii * sizeof(SurfTpeValues));
-   ret = xdr_SurfTpeValues(xdrs,(SurfTpeValues*) bp);
-   if(ret != SURF_SUCCESS)
-   {
-    return(ret);
-   } 
-  }
- }
-
- if(sdaInfo->toFreeBeamAttachedData != NULL)
- {
-  for(ii=0;ii < sdaInfo->nrBeam;ii++)
-  {
-   for(jj=0;jj < sdaInfo->nrOfBeamAttachedData;jj++)
-   {
-    bp = (char*)(sdaInfo->toFreeBeamAttachedData)
-         +((size_t)((ii * sdaInfo->nrOfBeamAttachedData) + jj) 
-                                        * sizeof(SurfFreeBeamAttachedData));
-    ret = xdr_SurfFreeBeamAttachedData(xdrs,(SurfFreeBeamAttachedData*) bp);
-    if(ret != SURF_SUCCESS)
-    {
-     return(ret);
-    }
-   } 
-  }
- }
-
- if(sdaInfo->toAmplitudes != NULL)
- {
-   for(ii=0;ii < sdaInfo->nrBeam;ii++)
-   {
-    bp = (char*)(sdaInfo->toAmplitudes)+(ii * sdaInfo->amplS);
-    ret = xdr_SurfAmplitudes(xdrs,(SurfAmplitudes*) bp);
-    if(ret != SURF_SUCCESS)
-    {
-     return(ret);
-    } 
-   }
- }
-
- if(sdaInfo->toExtendedAmpl != NULL)
- {
-   for(ii=0;ii < sdaInfo->nrBeam;ii++)
-   {
-    bp = (char*)(sdaInfo->toExtendedAmpl)+(ii * sdaInfo->extAmplS);
-    ret = xdr_SurfExtendedAmplitudes(xdrs,(SurfExtendedAmplitudes*) bp);
-    if(ret != SURF_SUCCESS)
-    {
-     return(ret);
-    } 
-   }
- }
-
- if(sdaInfo->toSignalParams != NULL)
- {
-  ret = xdr_SurfSignalParameter(xdrs,sdaInfo->toSignalParams,
-                                                 (short)sdaInfo->nrRxParams);
-  if(ret != SURF_SUCCESS)
-  {
-   return(ret);
-  } 
- }
-
- if(sdaInfo->toTxParams != NULL)
- {
-  ret = xdr_SurfTxParameter(xdrs,sdaInfo->toTxParams,(short)sdaInfo->nrTxParams);
-  if(ret != SURF_SUCCESS)
-  {
-   return(ret);
-  } 
- }
-
- if(sdaInfo->toSignalAmplitudes != NULL)
- {
-   bp = (char*)(sdaInfo->toSignalAmplitudes);
-   ret = xdr_SurfSignalAmplitudes(xdrs,(SurfSignalAmplitudes*) bp,
-         (u_short)sdaInfo->nrAmplitudes);
-   return(ret);
- }
-
-
- if(sdaInfo->toSsData != NULL)
- {
-   bp = (char*)(sdaInfo->toSsData);
-   ret = xdr_SurfSidescanData(xdrs,(SurfSidescanData*) bp,
-         (u_short)sdaInfo->nrSsData);
-   return(ret);
- }
- return(SURF_SUCCESS);
-}
-
-
-XdrSurf mem_convertOneSdaBlock(XDR* xdrs,SdaInfo* sdaInfo)
-{
- return(mem_convertOneSdaBlock2(xdrs,sdaInfo,0));
-}
-
-
-/* frees Sda-Memory */
- 
-void free_SdaMemory(SurfDataInfo* toSurfDataInfo)
-{
-  SurfSoundingData* toSounding;
-  u_long ii;
-
-  if(toSurfDataInfo->xdrs != NULL)
-  {
-   free(toSurfDataInfo->xdrs);
-   toSurfDataInfo->xdrs = NULL;
-  }
-  if(toSurfDataInfo->toSdaInfo != NULL)
-  {
-   free(toSurfDataInfo->toSdaInfo);
-   toSurfDataInfo->toSdaInfo = NULL;
-  }
-  if(toSurfDataInfo->toSdaThread != NULL)
-  {
-   for(ii=0;ii < toSurfDataInfo->nrOfSoundings;ii++)
-   {
-    toSounding = toSurfDataInfo->toSdaThread->thread[ii].sounding;
-    if(toSounding != NULL) free(toSounding);
-    toSurfDataInfo->toSdaThread->thread[ii].sounding = NULL;
-    toSounding = toSurfDataInfo->toSdaThread->thread[ii].saveSounding;
-    if(toSounding != NULL) free(toSounding);
-    toSurfDataInfo->toSdaThread->thread[ii].saveSounding = NULL;
-   } 
-   free(toSurfDataInfo->toSdaThread);
-   toSurfDataInfo->toSdaThread = NULL;
-  }
-  if(toSurfDataInfo->fp != NULL)
-  {
-   fclose(toSurfDataInfo->fp);
-   toSurfDataInfo->fp = NULL;
-  }
-}
-
-
-
-/* reads a whole SDA-File into memory */
- 
-XdrSurf mem_ReadSdaStructure(char* filename,
-                             SurfDataInfo* toSurfDataInfo)
-                             
-/* Allocates the necessary memory for a SDA-structure and reads 
-   the data from file;
-                                               */
-{
-  XdrSurf ret;
-  XDR* xdrs;
-  FILE* fp;
-  SurfSdaThread* toSdaThread    ;
-  SdaInfo*       toSdaInfo      ;
-  SurfSoundingData* toSdaBlock;
-  size_t         sizeOfSdaBlock;
-  u_long  nrSoundings,nrBeams,nrPositions,nrAmplitudes;
-  u_long  ii,jj;
-  short versLess2;
-
-
-  /* initialize local variables */
-
-  nrSoundings = toSurfDataInfo->nrOfSoundings;
-  nrPositions = toSurfDataInfo->nrOfCenterPositions;
-  nrBeams     = toSurfDataInfo->nrOfMultiBeamDepth;
-  nrAmplitudes = toSurfDataInfo->nrOfSignalAmplitudes;
-
-  versLess2 = toSurfDataInfo->sourceVersionLess2;
-
-  /* allocate structure for xdr-conversion and SdaInfo and Sda-Thread */
-  
-  xdrs = (XDR*)calloc(1,sizeof(XDR));
-  toSurfDataInfo->xdrs = xdrs; 
-  if (xdrs == NULL)
-  {
-   return(SURF_CANT_GET_MEMORY);
-  }
-  toSdaInfo = (SdaInfo*)calloc(1,sizeof(SdaInfo));
-  toSurfDataInfo->toSdaInfo = toSdaInfo;
-  if (toSdaInfo == NULL)
-  {
-   free_SdaMemory(toSurfDataInfo);
-   return(SURF_CANT_GET_MEMORY);
-  }
-  toSdaThread = (SurfSdaThread*)calloc((u_int)nrSoundings,sizeof(SurfSdaThread));
-  toSurfDataInfo->toSdaThread = toSdaThread;
-  if (toSdaThread == NULL)
-  {
-   free_SdaMemory(toSurfDataInfo);
-   return(SURF_CANT_GET_MEMORY);
-  }
-
-           
-
-  /* open conversion and file Read  */
-  
-  fp =  xdrSurfOpenRead(xdrs,(const char*)filename);
-  toSurfDataInfo->fp = fp; 
-  if(fp == NULL)
-  {
-   free_SdaMemory(toSurfDataInfo);
-   return(SURF_CANT_OPEN_FILE);
-  }
-
-  /* fill SdaInfo and allocate memory for Sda-Blocks */
-
-  sizeOfSdaBlock = initializeSdaInfo(toSurfDataInfo,toSdaInfo);
-  for(ii=0;ii < nrSoundings;ii++)
-  {
-   toSdaBlock = (SurfSoundingData*)malloc(sizeOfSdaBlock);
-   if(toSdaBlock == NULL)
-   {
-    ret = (SURF_CANT_GET_MEMORY);
-   }
-   else
-   {
-    toSdaThread->thread[ii].sounding = toSdaBlock;
-    setPointersInSdaInfo(toSdaBlock,toSdaInfo);
-    ret = mem_convertOneSdaBlock2(xdrs,toSdaInfo,versLess2);
-   }
-   if(ret != SURF_SUCCESS)
-   {
-    for(jj=0;jj<ii;jj++)
-    {
-     if(toSdaThread->thread[jj].sounding != NULL)
-       free(toSdaThread->thread[jj].sounding);
-     toSdaThread->thread[jj].sounding = NULL;
-    }
-    free_SdaMemory(toSurfDataInfo);
-    return(ret);
-   }
-  }
-
-  free(xdrs);
-  if(toSurfDataInfo->fp != NULL)fclose(fp);
-  toSurfDataInfo->fp = NULL;
-  toSurfDataInfo->xdrs = NULL;
-  return(SURF_SUCCESS);
-}                                               
-
-
-
-
-
-
-
-/* for external use: converters,etc. */
-
-XdrSurf mem_buildSurfSdaStructure(SurfDataInfo* toSurfDataInfo)
-{
-  XdrSurf ret;
-  SurfSdaThread* toSdaThread    ;
-  SdaInfo*       toSdaInfo      ;
-  SurfSoundingData* toSdaBlock;
-  size_t         sizeOfSdaBlock;
-  u_long  nrSoundings,nrBeams,nrPositions,nrAmplitudes,nrSsData;
-  u_long  ii,jj;
-
-    /* initialize local variables */
-
-  nrSoundings = toSurfDataInfo->nrOfSoundings;
-  nrPositions = toSurfDataInfo->nrOfCenterPositions;
-  nrBeams     = toSurfDataInfo->nrOfMultiBeamDepth;
-  nrAmplitudes = toSurfDataInfo->nrOfSignalAmplitudes;
-  nrSsData    = toSurfDataInfo->maxNrSsData;
-
-  toSdaInfo = (SdaInfo*)calloc(1,sizeof(SdaInfo));
-  toSurfDataInfo->toSdaInfo = toSdaInfo;
-  if (toSdaInfo == NULL)
-  {
-   free_SdaMemory(toSurfDataInfo);
-   return(SURF_CANT_GET_MEMORY);
-  }
-  toSdaThread = (SurfSdaThread*)calloc((u_int)nrSoundings,sizeof(SurfSdaThread));
-  toSurfDataInfo->toSdaThread = toSdaThread;
-  if (toSdaThread == NULL)
-  {
-   free_SdaMemory(toSurfDataInfo);
-   return(SURF_CANT_GET_MEMORY);
-  }
-
-  ret = SURF_SUCCESS;
-  sizeOfSdaBlock = initializeSdaInfo(toSurfDataInfo,toSdaInfo);
-  for(ii=0;ii < nrSoundings;ii++)
-  {
-   toSdaBlock = (SurfSoundingData*)calloc(1,sizeOfSdaBlock);
-   if(toSdaBlock == NULL)
-   {
-    ret = (SURF_CANT_GET_MEMORY);
-   }
-   else
-   {
-    toSdaThread->thread[ii].sounding = toSdaBlock;
-   }
-   if(ret != SURF_SUCCESS)
-   {
-    for(jj=0;jj<ii;jj++)
-    {
-     if(toSdaThread->thread[jj].sounding != NULL)
-       free(toSdaThread->thread[jj].sounding);
-     toSdaThread->thread[jj].sounding = NULL;
-    }
-    free_SdaMemory(toSurfDataInfo);
-    return(ret);
-   }
-  }
-  return(SURF_SUCCESS);
-}                                               
-             
-
-
-/***************************************/
-/*                                     */
-/* write a SIX-File in memory back to  */
-/* the file                            */
-/*                                     */
-/* the specific file-structure is given*/
-/* in the descriptor- and pointers     */
-/* to memory in the info-structure     */
-/*                                     */
-/* a NULL-pointer in Info tells that   */
-/* this block is not existing in that  */
-/* specific configuration              */
-/*                                     */
-/* if the information in Info is       */
-/* different from the Descriptor,      */
-/* the Descriptor will be updated      */
-/*                                     */
-/***************************************/
-
-
-/* update the Descriptor-structure with data from the Info-Structure  */
-
-XdrSurf checkAndUpdateSurfDescriptor(SurfDescriptor* toSurfDescriptor,
-                                      SurfDataInfo* toSurfDataInfo)
-{
-  if((toSurfDescriptor->six                != SIX_M               ) ||
-     (toSurfDescriptor->descriptor.typ     != DESCRIPTOR          ) ||
-     (toSurfDescriptor->globalData.typ     != GLOBALDATA          ) ||
-     (toSurfDescriptor->statistics.typ     != STATISTICS          ) ||
-     (toSurfDescriptor->positionSensor.typ != POSITIONSENSORS     ) ||
-     (toSurfDescriptor->transducer.typ     != TRANSDUCERPARAM     ) ||
-     (toSurfDescriptor->angleTab.typ       != BEAMANGLE           ) ||
-     (toSurfDescriptor->cProfile.typ       != CPROFILE            ) ||
-     (toSurfDescriptor->polygon.typ        != AREAPOLYGON         ) ||
-     (toSurfDescriptor->events.typ         != EVENTS              ) ||
-     (toSurfDescriptor->freeText.typ       != FREETEXT            ) ||
-     (toSurfDescriptor->addStatistics.typ  != ADDSTATISTICS       ) ||
-     (toSurfDescriptor->tpeStatics.typ     != TPESTATICS          ) ||
-     (toSurfDescriptor->cprofTpes.typ      != CPROFTPES           ) ||
-     (toSurfDescriptor->freeSixDescr.typ   != FREESIXDESCR        ) ||
-     (toSurfDescriptor->freeSndgDescr.typ  != FREESNDGDESCR       ) ||
-     (toSurfDescriptor->freeBeamDescr.typ  != FREEBEAMDESCR       ) ||
-     (toSurfDescriptor->freeSixAttData.typ != SIXATTDATA          ) ||
-     (toSurfDescriptor->vendorText.typ     != VENDORTEXT          ) ||
-     (toSurfDescriptor->sda                != SDA_M               ) ||
-     (toSurfDescriptor->nrof               != NROF_M              ) ||
-     (toSurfDescriptor->eod                != EOD_M               ))   
-  {
-   return(SURF_CORRUPTED_DATASET);
-  }
-
-  toSurfDescriptor->descriptor.nr  = 1;    
-  toSurfDescriptor->globalData.nr  = 1;
-  toSurfDescriptor->statistics.nr  = 0;
-  if(toSurfDataInfo->toStatistics != NULL)
-  {
-    toSurfDescriptor->statistics.nr  = 1;
-  }
-  if((toSurfDataInfo->toPosiSensors == NULL) ||
-     (toSurfDataInfo->nrPosiSensors == 0   ))
-  {
-    return(SURF_CORRUPTED_DATASET);
-  }
-  else
-  {
-    toSurfDescriptor->positionSensor.nr = toSurfDataInfo->nrPosiSensors;
-  }
-  toSurfDescriptor->transducer.nr     = toSurfDataInfo->nrTransducers;
-  toSurfDescriptor->angleTab.nr       = toSurfDataInfo->nrAngleTables;
-  toSurfDescriptor->maxNrOfBeams.nr   = toSurfDataInfo->nrBeams;
-  toSurfDescriptor->cProfile.nr       = toSurfDataInfo->nrCProfiles;
-  toSurfDescriptor->maxNrOfCProfileElements.nr
-                                      = toSurfDataInfo->nrCPElements;
-  toSurfDescriptor->maxNrOfSidescanData.nr
-                                      = toSurfDataInfo->maxNrSsData;
-  toSurfDescriptor->nrOfRxTvgSets.nr  = toSurfDataInfo->nrOfRxSets;   
-  toSurfDescriptor->nrOfTxTvgSets.nr  = toSurfDataInfo->nrOfTxSets;   
-
-  toSurfDescriptor->polygon.nr        = 0;
-  toSurfDescriptor->maxNrOfPolygonElements.nr = 0;
-  if(toSurfDataInfo->toPolygons  != NULL)
-  {                         
-   toSurfDescriptor->polygon.nr        = 1;
-   toSurfDescriptor->maxNrOfPolygonElements.nr
-                                      = toSurfDataInfo->nrPolyElements;
-  }
-
-  toSurfDescriptor->events.nr        = 0;
-  toSurfDescriptor->maxNrOfEvents.nr = 0;
-  if(toSurfDataInfo->toEvents != NULL)
-  {                         
-   toSurfDescriptor->events.nr        = 1;
-   toSurfDescriptor->maxNrOfEvents.nr = toSurfDataInfo->nrEvents;
-  }
-
-  toSurfDescriptor->freeText.nr        = 0;
-  toSurfDescriptor->maxNrOfFreeTextBlocks.nr = 0;
-  if(toSurfDataInfo->toFreeText != NULL)
-  {                         
-   toSurfDescriptor->freeText.nr        = 1;
-   toSurfDescriptor->maxNrOfFreeTextBlocks.nr 
-                                        = toSurfDataInfo->nrFreeTextUnits;
-  }
-  
-  toSurfDescriptor->addStatistics.nr    = 0;
-  if(toSurfDataInfo->toAddStatistics != NULL)
-  {                         
-   toSurfDescriptor->addStatistics.nr   = 1;
-  }
-  
-  toSurfDescriptor->tpeStatics.nr       = 0;
-  if(toSurfDataInfo->toTpeStatics != NULL)
-  {                         
-   toSurfDescriptor->tpeStatics.nr      = 1;
-  }
-
-  toSurfDescriptor->cprofTpes.nr        = 0;
-  if(toSurfDataInfo->toCProfileTpes != NULL)
-  {
-   toSurfDescriptor->cprofTpes.nr       = toSurfDataInfo->nrCProfiles;
-  } 
-
-  toSurfDescriptor->freeSixDescr.nr   = toSurfDataInfo->nrOfSixAttachedData;
-  toSurfDescriptor->freeSndgDescr.nr  = toSurfDataInfo->nrOfSndgAttachedData;
-  toSurfDescriptor->freeBeamDescr.nr  = toSurfDataInfo->nrOfBeamAttachedData;
-  toSurfDescriptor->freeSixAttData.nr = toSurfDataInfo->nrOfSixAttachedData;
-
-  toSurfDescriptor->vendorText.nr       = 0;
-  if(toSurfDataInfo->toVendorText != NULL)
-  {                         
-   toSurfDescriptor->vendorText.nr      = 1;
-  }
-
-  
-  /* sda -data */
-
-  toSurfDescriptor->soundings.nr       = toSurfDataInfo->nrOfSoundings;
-  toSurfDescriptor->centerPositions.nr = toSurfDataInfo->nrPosiSensors;
-  toSurfDescriptor->positionCpes.nr    = toSurfDataInfo->nrOfCeps;
-  toSurfDescriptor->singleBeamDepth.nr = toSurfDataInfo->nrOfSingleBeamDepth ;
-  toSurfDescriptor->multiBeamDepth.nr  = toSurfDataInfo->nrOfMultiBeamDepth;
-  toSurfDescriptor->multiBeamTT.nr     = toSurfDataInfo->nrOfMultiBeamTT;
-  toSurfDescriptor->multiBeamRecv.nr   = toSurfDataInfo->nrOfMultiBeamRec;
-  toSurfDescriptor->signalParams.nr    = toSurfDataInfo->nrOfSignalParams;   
-  toSurfDescriptor->txParams.nr        = toSurfDataInfo->nrOfTxParams;   
-  toSurfDescriptor->beamAmplitudes.nr  = toSurfDataInfo->nrOfAmplitudes;   
-  toSurfDescriptor->extendBeamAmplitudes.nr
-                                       = toSurfDataInfo->nrOfExtAmplitudes;   
-  toSurfDescriptor->signalAmplitudes.nr= toSurfDataInfo->nrOfSignalAmplitudes;
-  toSurfDescriptor->sidescanData.nr    = toSurfDataInfo->nrOfSsData;
-  toSurfDescriptor->singleTpeParams.nr = toSurfDataInfo->nrOfSingleTPEs;
-  toSurfDescriptor->multiTpeParams.nr  = toSurfDataInfo->nrOfMultiTPEs;
-  toSurfDescriptor->sndgAttData.nr     = toSurfDataInfo->nrOfSndgAttachedData;
-  toSurfDescriptor->beamAttData.nr     = toSurfDataInfo->nrOfBeamAttachedData;
-
-  return(SURF_SUCCESS);          
-}
-
-
-
-                                      
-/* cleaning the internal memory-requests */
-
-XdrSurf cleanUpSixWrite(SurfDataInfo* toSurfDataInfo,
-                        XDR* xdrs,FILE* fp,XdrSurf returnvalue)
-{
-  if(fp != NULL)
-  {
-   if(toSurfDataInfo->fp != NULL)fclose(fp);
-   toSurfDataInfo->fp = NULL;
-  }
-  if(xdrs != NULL)
-  {
-   free(xdrs);
-   toSurfDataInfo->xdrs = NULL;
-  }
-  return(returnvalue);
-}
-
-
-
-XdrSurf mem_WriteSixStructure(char* filename,
-                             SurfDataInfo* toSurfDataInfo)
-                             
-/* writes a SIX-structure back to the file 
-   according to SurfDataInfo                    */  
-                              
-{
-  XdrSurf ret;
-  XDR* xdrs;
-  FILE* fp;
-  SurfDescriptor* surfDescriptor;
-  SurfGlobalData* surfGlobalData;
-  SurfStatistics* surfStatistics;
-  SurfPositionSensorArray* surfPositionSensorArray;
-  SurfMultiBeamAngleTable* surfMultiBeamAngleTable; 
-  SurfTransducerParameterTable* surfTransducerParameterTable;
-  SurfCProfileTable* surfCProfileTable;
-  SurfCProfileTpeTable* surfCProfileTpeTable;
-  SurfPolygons* surfPolygons;
-  SurfEvents*   surfEvents;   
-  SurfFreeText*   surfFreeText;   
-  SurfAddStatistics*       surfAddStatistics;
-  SurfTpeStatics*          surfTpeStatics;
-  SurfFreeSixDataDescr*    surfFreeSixDataDescr;
-  SurfFreeSndgDataDescr*   surfFreeSndgDataDescr;
-  SurfFreeBeamDataDescr*   surfFreeBeamDataDescr; 
-  SurfFreeSixAttachedData* surfFreeSixAttachedData;
-  SurfVendorText*          surfVendorText;
-  u_long  ii,jj,nn;
-  short newVersion,oldVersion;
-
-  xdrs = NULL;
-  fp = NULL;
-  
-  /* allocate structure for xdr-conversion */
-  
-  xdrs = (XDR*)calloc(1,sizeof(XDR));
-  if (xdrs == NULL)
-  {
-   return(SURF_CANT_GET_MEMORY);
-  }
-  toSurfDataInfo->xdrs = xdrs; 
-  surfDescriptor = toSurfDataInfo->toDescriptor;
-  if (surfDescriptor == NULL)
-  {
-   return(cleanUpSixWrite(toSurfDataInfo,xdrs,fp,SURF_CORRUPTED_DATASET));
-  }
-
-
-  /* open conversion and file Write */
-  
-  fp =  xdrSurfOpenWrite(xdrs,(const char*)filename);
-  toSurfDataInfo->fp = fp; 
-  if(fp == NULL)
-  {
-   return(cleanUpSixWrite(toSurfDataInfo,xdrs,fp,SURF_CANT_OPEN_FILE));
-  }
-
-
-  /* write SurfDescriptor */
-  
-  ret = checkAndUpdateSurfDescriptor(surfDescriptor,toSurfDataInfo);
-  if(ret != SURF_SUCCESS)
-  {
-   return(cleanUpSixWrite(toSurfDataInfo,xdrs,fp,ret));
-  }
-
-  ret = xdr_SurfDescriptor(xdrs,surfDescriptor,&newVersion,&oldVersion);
-  if(ret != SURF_SUCCESS)
-  {
-   return(cleanUpSixWrite(toSurfDataInfo,xdrs,fp,ret));
-  }
-
-
-  /* write Global Data */
-
-  surfGlobalData = toSurfDataInfo->toGlobalData;
-  if (surfGlobalData == NULL)
-  {
-   return(cleanUpSixWrite(toSurfDataInfo,xdrs,fp,SURF_CORRUPTED_DATASET));
-  }
-  ret = xdr_SurfGlobalData(xdrs,surfGlobalData);
-  if(ret != SURF_SUCCESS)
-  {
-   return(cleanUpSixWrite(toSurfDataInfo,xdrs,fp,ret));
-  }
-
-
-  /* write Statistics  */
-
-  if(toSurfDataInfo->nrStatistics != 0)
-  {
-   surfStatistics = toSurfDataInfo->toStatistics;
-   if (surfStatistics == NULL)
-   {
-    return(cleanUpSixWrite(toSurfDataInfo,xdrs,fp,SURF_CORRUPTED_DATASET));
-   }
-   ret = xdr_SurfStatistics(xdrs,surfStatistics);
-   if(ret != SURF_SUCCESS)
-   {
-    return(cleanUpSixWrite(toSurfDataInfo,xdrs,fp,ret));
-   }
-  }
-
-
-  /* write Position Sensors  */
-
-  ii = toSurfDataInfo->nrPosiSensors;
-  if(ii == 0)
-  {
-   return(cleanUpSixWrite(toSurfDataInfo,xdrs,fp,SURF_CORRUPTED_DATASET));
-  }
-  else
-  {
-   surfPositionSensorArray = toSurfDataInfo->toPosiSensors;
-   if (surfPositionSensorArray == NULL)
-   {
-    return(cleanUpSixWrite(toSurfDataInfo,xdrs,fp,SURF_CORRUPTED_DATASET));
-   }
-   for(nn=0;nn<ii;nn++)
-   {
-    ret = xdr_PositionSensorArray(xdrs,surfPositionSensorArray,newVersion);
-    if(ret != SURF_SUCCESS)
-    {
-     return(cleanUpSixWrite(toSurfDataInfo,xdrs,fp,ret));
-    }
-    surfPositionSensorArray++;
-   }
-  }
-
-
-  /* write transducer data of singlebeamsounders  */
-
-  ii = toSurfDataInfo->nrTransducers;
-  if(ii != 0)
-  {
-   surfTransducerParameterTable = toSurfDataInfo->toTransducers;
-   if (surfTransducerParameterTable == NULL)
-   {
-    return(cleanUpSixWrite(toSurfDataInfo,xdrs,fp,SURF_CORRUPTED_DATASET));
-   }
-   for(nn=0;nn<ii;nn++)
-   {
-    ret = xdr_SurfTransducerParameterTable(xdrs,surfTransducerParameterTable);
-    if(ret != SURF_SUCCESS)
-    {
-     return(cleanUpSixWrite(toSurfDataInfo,xdrs,fp,ret));
-    }
-    surfTransducerParameterTable++;
-   }
-  }
-
-
-  /* write beam-angle tables of multibeamsounders  */
-
-  ii = toSurfDataInfo->nrAngleTables;  
-  jj = toSurfDataInfo->nrBeams;        
-  if((ii != 0) && (jj != 0))
-  {
-   surfMultiBeamAngleTable = toSurfDataInfo->toAngleTables;
-   if (surfMultiBeamAngleTable == NULL)
-   {
-    return(cleanUpSixWrite(toSurfDataInfo,xdrs,fp,SURF_CORRUPTED_DATASET));
-   }
-   for(nn=0;nn<ii;nn++)
-   {
-    surfMultiBeamAngleTable = getSurfAngleTable(
-                            toSurfDataInfo->toAngleTables,(short)jj,(long)nn);
-    ret = xdr_SurfMultiBeamAngleTable(xdrs,surfMultiBeamAngleTable,(u_short)jj);
-    if(ret != SURF_SUCCESS)
-    {
-     return(cleanUpSixWrite(toSurfDataInfo,xdrs,fp,ret));
-    }
-   }
-  }
-
-
-  /* write C-profile tables */
-
-  ii = toSurfDataInfo->nrCProfiles;    
-  jj = toSurfDataInfo->nrCPElements;   
-  if((ii != 0) && (jj != 0))
-  {
-   surfCProfileTable = toSurfDataInfo->toCProfiles;
-   if (surfCProfileTable == NULL)
-   {
-    return(cleanUpSixWrite(toSurfDataInfo,xdrs,fp,SURF_CORRUPTED_DATASET));
-   }
-   for(nn=0;nn<ii;nn++)
-   {
-    surfCProfileTable =  getSurfCProfileTable(toSurfDataInfo->toCProfiles,
-                                                       (short)jj,(long)nn);
-    ret = xdr_SurfCProfileTable(xdrs,surfCProfileTable,(u_short)jj);
-    if(ret != SURF_SUCCESS)
-    {
-     return(cleanUpSixWrite(toSurfDataInfo,xdrs,fp,ret));
-    }
-   }
-  }
-
-
-  /* write C-profile TPE-values */
-
-  if(toSurfDataInfo->nrCprofTpes > 0)
-  {
-   ii = toSurfDataInfo->nrCProfiles;    
-   jj = toSurfDataInfo->nrCPElements;   
-   if((ii != 0) && (jj != 0))
-   {
-    surfCProfileTpeTable = toSurfDataInfo->toCProfileTpes;
-    if (surfCProfileTpeTable == NULL)
-    {
-     return(cleanUpSixWrite(toSurfDataInfo,xdrs,fp,SURF_CORRUPTED_DATASET));
-    }
-    for(nn=0;nn<ii;nn++)
-    {
-     surfCProfileTpeTable =  getSurfCProfileTpeTable(toSurfDataInfo->toCProfileTpes,
-                                                                (short)jj,(long)nn);
-     ret = xdr_SurfCProfileTableTpes(xdrs,surfCProfileTpeTable,(u_short)jj);
-     if(ret != SURF_SUCCESS)
-     {
-      return(cleanUpSixWrite(toSurfDataInfo,xdrs,fp,ret));
-     }
-    }
-   }
-  }
-
-
-
-
-  /* write areapolygon */
-
-  jj = toSurfDataInfo->nrPolyElements;   
-  if(jj != 0)
-  {
-   surfPolygons = toSurfDataInfo->toPolygons;
-   if (surfPolygons == NULL)
-   {
-    return(cleanUpSixWrite(toSurfDataInfo,xdrs,fp,SURF_CORRUPTED_DATASET));
-   }
-   ret = xdr_SurfPolygons(xdrs,surfPolygons,(u_short)jj);
-   if(ret != SURF_SUCCESS)
-   {
-    return(cleanUpSixWrite(toSurfDataInfo,xdrs,fp,ret));
-   }
-  }
-
-
-  /* write event blocks*/
-
-  jj = toSurfDataInfo->nrEvents;
-  if(jj != 0)
-  {
-   surfEvents = toSurfDataInfo->toEvents;
-   if (surfEvents == NULL)
-   {
-    return(cleanUpSixWrite(toSurfDataInfo,xdrs,fp,SURF_CORRUPTED_DATASET));
-   }
-   ret = xdr_SurfEvents(xdrs,surfEvents,(u_short)jj);
-   if(ret != SURF_SUCCESS)
-   {
-    return(cleanUpSixWrite(toSurfDataInfo,xdrs,fp,ret));
-   }
-  }
-  
-
-
-  /* write free text blocks*/
-
-  jj = toSurfDataInfo->nrFreeTextUnits;
-  if(jj != 0)
-  {
-   surfFreeText = toSurfDataInfo->toFreeText;
-   if (surfFreeText == NULL)
-   {
-    return(cleanUpSixWrite(toSurfDataInfo,xdrs,fp,SURF_CORRUPTED_DATASET));
-   }
-   ret = xdr_SurfFreeText(xdrs,surfFreeText,(u_short)jj);
-   if(ret != SURF_SUCCESS)
-   {
-    return(cleanUpSixWrite(toSurfDataInfo,xdrs,fp,ret));
-   }
-  }
-  
-
-
-  /* write additional Statistics  */
-
-  if(toSurfDataInfo->nrAddStatistics != 0)
-  {
-   surfAddStatistics = toSurfDataInfo->toAddStatistics;
-   if (surfAddStatistics == NULL)
-   {
-    return(cleanUpSixWrite(toSurfDataInfo,xdrs,fp,SURF_CORRUPTED_DATASET));
-   }
-   ret = xdr_SurfAddStatistics(xdrs,surfAddStatistics);
-   if(ret != SURF_SUCCESS)
-   {
-    return(cleanUpSixWrite(toSurfDataInfo,xdrs,fp,ret));
-   }
-  }
-
-
-  
-  /* write TPE Static Data  */
-
-  if(toSurfDataInfo->nrTpeStatics != 0)
-  {
-   surfTpeStatics = toSurfDataInfo->toTpeStatics;
-   if (surfTpeStatics == NULL)
-   {
-    return(cleanUpSixWrite(toSurfDataInfo,xdrs,fp,SURF_CORRUPTED_DATASET));
-   }
-   ret = xdr_SurfTpeStatics(xdrs,surfTpeStatics);
-   if(ret != SURF_SUCCESS)
-   {
-    return(cleanUpSixWrite(toSurfDataInfo,xdrs,fp,ret));
-   }
-  }
-
-
-
-  
-  /* write Free Six Data Descriptor */
-
-  jj = toSurfDataInfo->nrOfSixAttachedData;
-  if(jj > 0)
-  {
-   surfFreeSixDataDescr = toSurfDataInfo->toFreeSixDataDescr;
-   if (surfFreeSixDataDescr == NULL)
-   {
-    return(cleanUpSixWrite(toSurfDataInfo,xdrs,fp,SURF_CORRUPTED_DATASET));
-   }
-   for(ii=0;ii<jj;ii++)
-   {
-    surfFreeSixDataDescr = &(toSurfDataInfo->toFreeSixDataDescr[ii]);
-    ret = xdr_SurfFreeSixDataDescr(xdrs,surfFreeSixDataDescr);
-    if(ret != SURF_SUCCESS)
-    {
-     return(cleanUpSixWrite(toSurfDataInfo,xdrs,fp,ret));
-    }
-   }
-  }
-
-
-
-  /* write Free Sounding Data Descriptor */
-
-  jj = toSurfDataInfo->nrOfSndgAttachedData;
-  if(jj > 0)
-  {
-   surfFreeSndgDataDescr = toSurfDataInfo->toFreeSndgDataDescr;
-   if (surfFreeSndgDataDescr == NULL)
-   {
-    return(cleanUpSixWrite(toSurfDataInfo,xdrs,fp,ret));
-   }
-   for(ii=0;ii<jj;ii++)
-   {
-    surfFreeSndgDataDescr = &(toSurfDataInfo->toFreeSndgDataDescr[ii]);
-    ret = xdr_SurfFreeSndgDataDescr(xdrs,surfFreeSndgDataDescr);
-    if(ret != SURF_SUCCESS)
-    {
-     return(cleanUpSixWrite(toSurfDataInfo,xdrs,fp,ret));
-    }
-   }
-  }
-
-
-
-  /* write Free Beam Data Descriptor */
-
-  jj = toSurfDataInfo->nrOfBeamAttachedData;
-  if(jj > 0)
-  {
-   surfFreeBeamDataDescr = toSurfDataInfo->toFreeBeamDataDescr;
-   if (surfFreeBeamDataDescr == NULL)
-   {
-    return(cleanUpSixWrite(toSurfDataInfo,xdrs,fp,ret));
-   }
-   for(ii=0;ii<jj;ii++)
-   {
-    surfFreeBeamDataDescr = &(toSurfDataInfo->toFreeBeamDataDescr[ii]);
-    ret = xdr_SurfFreeBeamDataDescr(xdrs,surfFreeBeamDataDescr);
-    if(ret != SURF_SUCCESS)
-    {
-     return(cleanUpSixWrite(toSurfDataInfo,xdrs,fp,ret));
-    }
-   }
-  }
-
-
-
-  /* write Free Six Data */
-
-  jj = toSurfDataInfo->nrOfSixAttachedData;
-  if(jj > 0)
-  {
-   surfFreeSixAttachedData = toSurfDataInfo->toFreeSixData;
-   if (surfFreeSixAttachedData == NULL)
-   {
-    return(cleanUpSixWrite(toSurfDataInfo,xdrs,fp,ret));
-   }
-   for(ii=0;ii<jj;ii++)
-   {
-    surfFreeSixAttachedData = &(toSurfDataInfo->toFreeSixData[ii]);
-    ret = xdr_SurfFreeSixAttachedData(xdrs,surfFreeSixAttachedData);
-    if(ret != SURF_SUCCESS)
-    {
-     return(cleanUpSixWrite(toSurfDataInfo,xdrs,fp,ret));
-    }
-   }
-  }
-
-
-
-  /* write Vendor Text  */
-
-  if(toSurfDataInfo->nrOfVendorText != 0)
-  {
-   surfVendorText = toSurfDataInfo->toVendorText;
-   if (surfVendorText == NULL)
-   {
-    return(cleanUpSixWrite(toSurfDataInfo,xdrs,fp,ret));
-   }
-   ret = xdr_SurfVendorText(xdrs,surfVendorText);
-   if(ret != SURF_SUCCESS)
-   {
-    return(cleanUpSixWrite(toSurfDataInfo,xdrs,fp,ret));
-   }
-  }
-
-
-  /* Everything is done successfully (hope so ?)*/
-
-  return(cleanUpSixWrite(toSurfDataInfo,xdrs,fp,SURF_SUCCESS));
-
-}
-
-
-
-
-/***************************************/
-/*                                     */
-/* Write SDA-Data into a file          */
-/*                                     */
-/***************************************/
-
-
-
-/* writes a whole SDA-File from memory */
- 
-XdrSurf mem_WriteSdaStructure(char* filename,
-                              SurfDataInfo* toSurfDataInfo)
-{
-  XdrSurf ret;
-  XDR* xdrs;
-  FILE* fp;
-  SurfSdaThread* toSdaThread    ;
-  SdaInfo*       toSdaInfo      ;
-  SurfSoundingData* toSdaBlock;
-  u_long  nrSoundings,nrBeams,nrPositions,nrAmplitudes;
-  u_long  ii;
-
-
-  /* initialize local variables */
-
-  nrSoundings = toSurfDataInfo->nrOfSoundings;
-  nrPositions = toSurfDataInfo->nrOfCenterPositions;
-  nrBeams     = toSurfDataInfo->nrOfMultiBeamDepth;
-  nrAmplitudes = toSurfDataInfo->nrOfSignalAmplitudes;
-
-
-  /* allocate structure for xdr-conversion and SdaInfo and Sda-Thread */
-  
-  xdrs = (XDR*)calloc(1,sizeof(XDR));
-  toSurfDataInfo->xdrs = xdrs; 
-  if (xdrs == NULL)
-  {
-   return(SURF_CANT_GET_MEMORY);
-  }
-  toSdaInfo = toSurfDataInfo->toSdaInfo;
-  toSdaThread = toSurfDataInfo->toSdaThread;
-           
-
-  /* open conversion and file Read  */
-  
-  fp =  xdrSurfOpenWrite(xdrs,(const char*)filename);
-  toSurfDataInfo->fp = fp; 
-  if(fp == NULL)
-  {
-   free(xdrs);
-   toSurfDataInfo->xdrs = NULL; 
-   return(SURF_CANT_OPEN_FILE);
-  }
-
-  /* fill SdaInfo and allocate memory for Sda-Blocks */
-
-  for(ii=0;ii < nrSoundings;ii++)
-  {
-   toSdaBlock = toSdaThread->thread[ii].sounding;
-   setPointersInSdaInfo(toSdaBlock,toSdaInfo);
-   ret = mem_convertOneSdaBlock2(xdrs,toSdaInfo,0);
-   if(ret != SURF_SUCCESS)
-   {
-    free(xdrs);
-    if(toSurfDataInfo->fp != NULL) fclose(fp);
-    toSurfDataInfo->xdrs = NULL; 
-    toSurfDataInfo->fp   = NULL; 
-    return(ret);
-   }
-  }
-
-  free(xdrs);
-  if(toSurfDataInfo->fp != NULL) fclose(fp);
-  toSurfDataInfo->fp = NULL;
-  toSurfDataInfo->xdrs = NULL;
-  return(SURF_SUCCESS);
-}                                               
-
-
-
-
-
-
-
-/****************************************/
-/*                                      */
-/* destroys a whole SURF-Structure      */
-/* (including SurfDataInfo)             */
-/*                                      */
-/****************************************/
-
-
-XdrSurf mem_destroyAWholeSurfStructure(SurfDataInfo* toSurfDataInfo)
-{
- XdrSurf ret;
-
-  ret = SURF_SUCCESS;
-  if(toSurfDataInfo != NULL)
-  { 
-   free_SdaMemory(toSurfDataInfo);
-   ret = freeSixBlocks(toSurfDataInfo,SURF_SUCCESS);
-   free(toSurfDataInfo);
-  }
-  return(ret);
-}
-
-
-
-
-/****************************************/
-/*                                      */
-/* get Table-pointers                   */
-/*     in SIX-structure                 */
-/*                                      */
-/****************************************/
-
-
-
-SurfMultiBeamAngleTable* getSurfAngleTable(SurfMultiBeamAngleTable*
-                                toAngleTable,short nrBeams,long index)
-{
- SurfMultiBeamAngleTable* ret;
- ret = (SurfMultiBeamAngleTable*)((char*)(toAngleTable) + 
-       ((size_t)(index) * 
-           (size_t)(SIZE_OF_SURF_MULTIBEAM_ANGLE_TAB(nrBeams))));
- return(ret);        
-}        
-
-
-SurfCProfileTable* getSurfCProfileTable(SurfCProfileTable* 
-                                toCProf,short nrCPElements,long index)
-{
- SurfCProfileTable* ret;
- ret = (SurfCProfileTable*)((char*)(toCProf) + 
-       ((size_t)(index) * 
-           (size_t)(SIZE_OF_SURF_C_PROFILE_TAB(nrCPElements))));
- return(ret);        
-}
-
-
-SurfCProfileTpeTable* getSurfCProfileTpeTable(SurfCProfileTpeTable* 
-                                toCProfTpe,short nrCPElements,long index)
-{
- SurfCProfileTpeTable* ret;
- ret = (SurfCProfileTpeTable*)((char*)(toCProfTpe) + 
-       ((size_t)(index) * 
-           (size_t)(SIZE_OF_SURF_C_PROFILE_TPE_TAB(nrCPElements))));
- return(ret);        
-}
-
-
diff --git a/src/surf/mem_surf.h b/src/surf/mem_surf.h
deleted file mode 100644
index 3d5e695..0000000
--- a/src/surf/mem_surf.h
+++ /dev/null
@@ -1,297 +0,0 @@
-/*-----------------------------------------------------------------------
-/ H E A D E R K O P F
-/ ------------------------------------------------------------------------
-/ ------------------------------------------------------------------------
-/  DATEINAME        : mem_surf.h    Version 3.0
-/  ERSTELLUNGSDATUM : 28.07.93
-/ ------------------------------------------------------------------------
-/
-/ ------------------------------------------------------------------------
-/ COPYRIGHT (C) 1993: ATLAS ELEKTRONIK GMBH, 28305 BREMEN
-/ ------------------------------------------------------------------------
-/
-/  See README file for copying and redistribution conditions.
-/
-/
-/ HIER/SACHN: P: RP ____ _ ___ __
-/ BENENNUNG :
-/ ERSTELLER : Peter Block    : SAS3
-/ FREIGABE  : __.__.__  GS__
-/ AEND/STAND: __.__.__  __
-/ PRUEFVERM.:
-
-
-
-/ SPRACHE          : UNIX-C
-/ COMPILER         : Silicon Graphix
-/ BETRIEBSSYSTEM   : IRIX
-/ HARDWARE-UMGEBUNG: SGI Crimson
-/ URSPRUNGSHINWEIS :
-/
-/ ------------------------------------------------------------------------
-/ BESCHREIBUNG:  Definitions describing SURF-functions for memory-admin.
-/                V2.0
-/ ------------------------------------------------------------------------
-/
-/ ------------------------------------------------------------------------
-/ E N D E   D E S   K O P F E S
-/ ------------------------------------------------------------------------
-
-*************************************************************************/
-
-#ifndef _mem_surf_h_
-#define _mem_surf_h_
-
-
-enum _SurfThreadFlag {
-                        OLD_BLOCK       ,
-                        INSERTED_BLOCK
-                     };
-typedef enum _SurfThreadFlag SurfThreadFlag;
-
-
-
-
-typedef struct
-            {
-              SurfSoundingData*              sounding       ;
-              SurfSoundingData*              saveSounding   ;
-              SurfThreadFlag                 flag           ;
-            } SurfSdaThreadElement;
-
-
-
-typedef struct
-            {
-              SurfSdaThreadElement           thread[1]      ;
-            } SurfSdaThread;
-
-
-
-
-typedef struct
-            {
-              SurfSoundingData*              toSoundings           ;
-              SurfFreeSoundingAttachedData*  toFreeSoundingAttachedData;
-              SurfCenterPosition*            toCenterPositions     ;
-              SurfCenterPosition*            toActCenterPosition   ;
-              SurfPositionCepData*           toPositionCepData     ;
-              SurfSingleBeamDepth*           toSingleBeamDepth     ;
-              SurfTpeValues*                 toSingleBeamTpeValues ;
-              SurfMultiBeamDepth*            toMultiBeamDepth      ;
-              SurfMultiBeamDepth*            toActMultiBeamDepth   ;
-              SurfMultiBeamTT*               toMultiBeamTT         ;
-              SurfMultiBeamTT*               toActMultiBeamTT      ;
-              SurfMultiBeamReceive*          toMultiBeamRec        ;
-              SurfMultiBeamReceive*          toActMultiBeamRec     ;
-              SurfTpeValues*                 toMultiBeamTpeValues  ;
-              SurfFreeBeamAttachedData*      toFreeBeamAttachedData;
-              SurfSignalParameter*           toSignalParams        ;
-              SurfTxParameter*               toTxParams            ;
-              SurfSignalAmplitudes*          toSignalAmplitudes    ;
-              SurfSignalAmplitudes*          toActSignalAmplitudes ;
-              SurfAmplitudes*                toAmplitudes          ;
-              SurfExtendedAmplitudes*        toExtendedAmpl        ;
-              SurfSidescanData*              toSsData              ;
-
-              SURF_U_LONG                    indexCenterPosition   ;
-              SURF_U_LONG                    indexMultiBeam        ;
-              SURF_U_LONG                    indexAmplitudes       ;
-              SURF_U_LONG                    nrCenterPosition      ;
-              SURF_U_LONG                    nrBeam                ;
-              SURF_U_LONG                    nrAmplitudes          ;
-              SURF_U_LONG                    nrSsData              ;
-              SURF_U_LONG                    nrRxParams            ;
-              SURF_U_LONG                    nrTxParams            ;
-              SURF_U_LONG                    nrOfSndgAttachedData  ;
-              SURF_U_LONG                    nrOfBeamAttachedData  ;
-              size_t                         soundingS             ;
-              size_t                         sndgAttDataS          ;
-              size_t                         centerPS              ;
-              size_t                         positionCepDataS      ;
-              size_t                         singleBDS             ;
-              size_t                         singleTPEsS           ;
-              size_t                         multiBDS              ;
-              size_t                         multiBTTS             ;
-              size_t                         multiBRS              ;
-              size_t                         multiTPEsS            ;
-              size_t                         beamAttDataS          ;
-              size_t                         signalPS              ;
-              size_t                         signalTxPS            ;
-              size_t                         signalAS              ;
-              size_t                         amplS                 ;
-              size_t                         extAmplS              ;
-              size_t                         ssDataS               ;
-              size_t                         allS                  ;
-            } SdaInfo;
-
-
-
-
-typedef struct
-            {
-              FILE*                          fp                  ;
-              XDR*                           xdrs                ;
-
-              SurfDescriptor*                toDescriptor        ;
-              SurfGlobalData*                toGlobalData        ;
-              SurfStatistics*                toStatistics        ;
-              SURF_U_LONG                         nrStatistics        ;
-              SurfPositionSensorArray*       toPosiSensors       ;
-              SURF_U_LONG                         nrPosiSensors       ;
-              SurfMultiBeamAngleTable*       toAngleTables       ;
-              SURF_U_LONG                         nrAngleTables       ;
-              SURF_U_LONG                         nrBeams             ;
-              SurfTransducerParameterTable*  toTransducers       ;
-              SURF_U_LONG                         nrTransducers       ;
-              SurfCProfileTable*             toCProfiles         ;
-              SURF_U_LONG                         nrCProfiles         ;
-              SURF_U_LONG                         nrCPElements        ;
-              SurfCProfileTpeTable*          toCProfileTpes      ;
-              SURF_U_LONG                         nrCprofTpes         ;
-              SurfPolygons*                  toPolygons          ;
-              SURF_U_LONG                         nrPolyElements      ;
-              SurfEvents*                    toEvents            ;
-              SURF_U_LONG                         nrEvents            ;
-              SurfFreeText*                  toFreeText          ;
-              SURF_U_LONG                         nrFreeTextUnits     ;
-              SurfAddStatistics*             toAddStatistics     ;
-              SURF_U_LONG                         nrAddStatistics     ;
-              SurfTpeStatics*                toTpeStatics        ;
-              SURF_U_LONG                         nrTpeStatics        ;
-              SurfFreeSixDataDescr*          toFreeSixDataDescr  ;
-              SURF_U_LONG                         nrOfSixAttachedData ;
-              SurfFreeSndgDataDescr*         toFreeSndgDataDescr ;
-              SURF_U_LONG                         nrOfSndgAttachedData;
-              SurfFreeBeamDataDescr*         toFreeBeamDataDescr ;
-              SURF_U_LONG                         nrOfBeamAttachedData;
-              SurfFreeSixAttachedData*       toFreeSixData       ;
-              SurfVendorText*                toVendorText        ;
-              SURF_U_LONG                         nrOfVendorText      ;
-
-              SurfSdaThread*                 toSdaThread         ;
-              SURF_U_LONG                         activeThreadIndex   ;
-              SdaInfo*                       toSdaInfo           ;
-              /* Data of SDA-blocks */
-              SURF_U_LONG                         nrOfSoundings       ;
-              SURF_U_LONG                         nrOfCenterPositions ;
-              SURF_U_LONG                         nrOfCeps            ;
-              SURF_U_LONG                         nrOfSingleBeamDepth ;
-              SURF_U_LONG                         nrOfMultiBeamDepth  ;
-              SURF_U_LONG                         nrOfMultiBeamTT     ;
-              SURF_U_LONG                         nrOfMultiBeamRec    ;
-              SURF_U_LONG                         nrOfSignalParams    ;
-              SURF_U_LONG                         nrOfTxParams        ;
-              SURF_U_LONG                         nrOfRxSets          ;
-              SURF_U_LONG                         nrOfTxSets          ;
-              SURF_U_LONG                         nrOfSignalAmplitudes;
-              SURF_U_LONG                         nrOfSsData          ;
-              SURF_U_LONG                         maxNrSsData         ;
-              SURF_U_LONG                         nrOfAmplitudes      ;
-              SURF_U_LONG                         nrOfExtAmplitudes   ;
-              SURF_U_LONG                         nrOfMultiTPEs       ;
-              SURF_U_LONG                         nrOfSingleTPEs      ;
-              short                          sourceVersionLess2  ;
-            } SurfDataInfo;
-
-
-
-
-
-
-#ifdef _MEM_SURF
-
-
-
-XdrSurf mem_ReadSixStructure(char* filename,
-                                    SurfDataInfo* toSurfDataInfo);
-XdrSurf mem_WriteSixStructure(char* filename,
-                                    SurfDataInfo* toSurfDataInfo);
-XdrSurf mem_ReadSdaStructure(char* filename,
-                                    SurfDataInfo* toSurfDataInfo);
-XdrSurf mem_WriteSdaStructure(char* filename,
-                                    SurfDataInfo* toSurfDataInfo);
-XdrSurf mem_destroyAWholeSurfStructure(SurfDataInfo* toSurfDataInfo);
-
-XdrSurf mem_buildSurfSdaStructure(SurfDataInfo* toSurfDataInfo);
-
-
-XdrSurf freeSixBlocks(SurfDataInfo* toSurfDataInfo,XdrSurf returnvalue);
-XdrSurf checkAndLoadSurfDescriptor(SurfDescriptor* toSurfDescriptor,
-                                      SurfDataInfo* toSurfDataInfo);
-XdrSurf checkAndUpdateSurfDescriptor(SurfDescriptor* toSurfDescriptor,
-                                      SurfDataInfo* toSurfDataInfo);
-size_t initializeSdaInfo(SurfDataInfo* toSurfDataInfo,SdaInfo* toSdaInfo);
-void setPointersInSdaInfo(void* toSdaBlock,SdaInfo* toSdaInfo);
-void free_SdaMemory(SurfDataInfo* toSurfDataInfo);
-
-SurfMultiBeamAngleTable* getSurfAngleTable(SurfMultiBeamAngleTable*
-                                toAngleTable,short nrBeams,long index);
-SurfCProfileTable* getSurfCProfileTable(SurfCProfileTable*
-                                toCProf,short nrCPElements,long index);
-SurfCProfileTpeTable* getSurfCProfileTpeTable(SurfCProfileTpeTable*
-                                toCProfTpe,short nrCPElements,long index);
-#else
-
-/********************************************/
-/*                                          */
-/*        general LIBRARY-functions         */
-/*                                          */
-/********************************************/
-
-
-
-extern XdrSurf mem_ReadSixStructure(char* filename,
-                                    SurfDataInfo* toSurfDataInfo);
-
-/* This function doesn't destroy the internal data-structures */
-
-extern XdrSurf mem_WriteSixStructure(char* filename,
-                                    SurfDataInfo* toSurfDataInfo);
-
-extern XdrSurf mem_ReadSdaStructure(char* filename,
-                                    SurfDataInfo* toSurfDataInfo);
-
-/* This function doesn't destroy the internal data-structures */
-
-extern XdrSurf mem_WriteSdaStructure(char* filename,
-                                    SurfDataInfo* toSurfDataInfo);
-
-extern XdrSurf mem_destroyAWholeSurfStructure(SurfDataInfo* toSurfDataInfo);
-
-extern XdrSurf mem_buildSurfSdaStructure(SurfDataInfo* toSurfDataInfo);
-
-
-/*****************************************************/
-/*                                                   */
-/* some internal functios,that might be useful       */
-/* useful (to use them , it is necessary to under-   */
-/*         stand the internal architecture)          */
-/*                                                   */
-/*****************************************************/
-
-
-
-extern XdrSurf freeSixBlocks(SurfDataInfo* toSurfDataInfo,XdrSurf returnvalue);
-
-extern XdrSurf checkAndLoadSurfDescriptor(SurfDescriptor* toSurfDescriptor,
-                                          SurfDataInfo* toSurfDataInfo);
-extern XdrSurf checkAndUpdateSurfDescriptor(SurfDescriptor* toSurfDescriptor,
-                                            SurfDataInfo* toSurfDataInfo);
-extern size_t initializeSdaInfo(SurfDataInfo* toSurfDataInfo,
-                                SdaInfo* toSdaInfo);
-extern void setPointersInSdaInfo(void* toSdaBlock,
-                                 SdaInfo* toSdaInfo);
-extern void free_SdaMemory(SurfDataInfo* toSurfDataInfo);
-
-extern SurfMultiBeamAngleTable* getSurfAngleTable(SurfMultiBeamAngleTable*
-                                toAngleTable,short nrBeams,long index);
-extern SurfCProfileTable* getSurfCProfileTable(SurfCProfileTable*
-                                toCProf,short nrCPElements,long index);
-extern SurfCProfileTpeTable* getSurfCProfileTpeTable(SurfCProfileTpeTable*
-                                toCProfTpe,short nrCPElements,long index);
-
-#endif
-
-
-#endif
diff --git a/src/surf/myOpSys.c b/src/surf/myOpSys.c
deleted file mode 100644
index 270491a..0000000
--- a/src/surf/myOpSys.c
+++ /dev/null
@@ -1,5 +0,0 @@
-static char sccsid[100] = {"@(#)Lib compiled on IRIX64 6.4 02121744"};
-char* forCCopsys(void)
-{
- return(sccsid);
-}
diff --git a/src/surf/opsys.h b/src/surf/opsys.h
deleted file mode 100644
index 8ec4579..0000000
--- a/src/surf/opsys.h
+++ /dev/null
@@ -1 +0,0 @@
-#define IRIX64
diff --git a/src/surf/pb_math.c b/src/surf/pb_math.c
deleted file mode 100644
index 85a15bd..0000000
--- a/src/surf/pb_math.c
+++ /dev/null
@@ -1,448 +0,0 @@
-/*-----------------------------------------------------------------------
-/ P R O G R A M M K O P F
-/ ------------------------------------------------------------------------
-/ ------------------------------------------------------------------------
-/  DATEINAME        : pb_math.c
-/  ERSTELLUNGSDATUM : 20.09.93
-/ ------------------------------------------------------------------------
-/
-/ ------------------------------------------------------------------------
-/ COPYRIGHT (C) 1993: ATLAS ELEKTRONIK GMBH, 28305 BREMEN
-/ ------------------------------------------------------------------------
-/
-/  See README file for copying and redistribution conditions.
-/
-/
-/ HIER/SACHN: P: RP ____ _ ___ __
-/ BENENNUNG :
-/ ERSTELLER : Peter Block    : SAS3
-/ FREIGABE  : __.__.__  GS__
-/ AEND/STAND: __.__.__  __
-/ PRUEFVERM.:
-*/
-
-
-#define _PB_MATH 
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#include <string.h>
-#include "xdr_surf.h"
-#include "mem_surf.h"
-#include "util_surf.h"
-#include "pb_math.h"
-
-static char sccsid[50] = {"@(#)libpbmath.a Version 1.2 15.12.1998"};
-
-/* There are C++ - Compilers, which omit unreferenced statics */
-char* forCCmath(void)
-{
- return(sccsid);
-}
-
-
-double pbAtan2(double y,double x)
-{
- if(fabs(x) > 0.0)
- {
-  return(atan2(y,x));
- } 
- else
- {
-  if(y< 0.0)
-   return((double)-HALF_PI);
-  else
-   return((double)HALF_PI); 
- }
-}
-
-
-
-double setToPlusMinusPI(double angle)
-{
- if(angle > PI)
- {
-  angle = setToPlusMinusPI(angle - (2.0*PI)); 
- } 
- if(angle < -PI)
- {
-  angle = setToPlusMinusPI(angle + (2.0*PI)); 
- }
- return(angle); 
-}
-
-
-
-
-void rotateCoordinates(double rotAngle,XY_Coords* origCoords,
-                                       XY_Coords* targetCoords)
-{
- double angle;
-
- angle = setToPlusMinusPI(rotAngle); 
- targetCoords->x =   (origCoords->x * cos(angle)) 
-                   + (origCoords->y * sin(angle));
- targetCoords->y = - (origCoords->x * sin(angle)) 
-                   + (origCoords->y * cos(angle));
-}
-
-
-void xyToRhoPhi(double x0,double y0,double pointX,double pointY,
-                                             double* rho,double* phi)
-{
- double x,y,angle;
-
- x = pointX - x0;
- y = pointY - y0;
- *rho = sqrt((x*x) + (y*y));
- angle = pbAtan2(x,y);
- if(angle < 0.0)
-  *phi = angle + (2.0 * PI);
- else
-  *phi = angle;
-}
-
- 
-void lambdaPhiToRhoPhi(double x0,double y0,double pointX,double pointY,
-                                             double* rho,double* phi)
-{
- double x,y,angle;
-
- x = pointX - x0;
- y = pointY - y0;
- x = RAD_TO_METER_X(x,y0);
- y = RAD_TO_METER_Y(y);
- *rho = sqrt((x*x) + (y*y));
- angle = pbAtan2(x,y);
- if(angle < 0.0)
-  *phi = angle + (2.0 * PI);
- else
-  *phi = angle;
-}
-
- 
-Boolean signf(double value) 
-{
- if(value < 0.0) return(False);
- return(True);
-}
-
-
- 
-Boolean signsh(short value) 
-{
- if(value < 0) return(False);
- return(True);
-}
-
-
-
-
-/* Berechnung von Tiefe und Ablagen aus Traveltime */
-
-Boolean depthFromTT(FanParam* fanParam,Boolean isPitchcompensated)
-{
- double alpha,arg,travelWay,depth,tanAl,tan2Al,tanP,tan2P;
-
- /* aktuellen Winkel Aufgrund cmean rechnen */
- 
-  if((fanParam->cmean == 0.0) || (fanParam->ckeel == 0.0)
-     || (fanParam->travelTime == 0.0 )) return (False);
-  arg = (fanParam->cmean / fanParam->ckeel) * sin(fanParam->angle);
-  if((arg < 1.0) && (arg > -1.0)) 
-     alpha = asin(arg);
-  else
-     return(False);  
-
- /* Winkelparameter */
-
-  tanAl  = tan(alpha);
-  tan2Al = tanAl * tanAl;    
-  if(isPitchcompensated == False)
-  {
-   tanP  = tan(fanParam->pitchTx);
-   tan2P = tanP * tanP;
-  }
-  else
-  {
-   tanP  = 0.0;
-   tan2P = 0.0;
-  }
-
- /* mittleren rueckgestreuten Weg auf Bezugsniveau HubRx rechnen */
-
-  travelWay = fanParam->travelTime * fanParam->cmean;
-
-  travelWay = travelWay 
-            - (((fanParam->heaveTx - fanParam->heaveRx)/2.0) * cos(alpha)); 
-
- /* Pitchkompensierte Tiefe ohne Huboffset (3D-Pythagoras) */
-
-  depth = travelWay / sqrt(tan2Al + tan2P + 1);
-
-
- /* Positionen */
-
-  fanParam->posAhead = (depth * tanP)  + fanParam->transducerOffsetAhead;
-
-  fanParam->posStar  = (depth * tanAl) + fanParam->transducerOffsetStar;
-
- 
- /* Tiefe rechnen */
-           
-  fanParam->depth = depth                                  /* Pitch-kompensierte Messtiefe */
-                  - fanParam->heaveRx                      /* absolute Hubkompensation     */
-                  + fanParam->draught;                     /* Tiefgang                     */
-
-  return(True);                   
-}
-
-
-
-
-/* Berechnung von Traveltime und Ablagen aus Depth */
-
-Boolean TTfromDepth(FanParam* fanParam,Boolean isPitchcompensated)
-{
- double alpha,arg,travelWay,depth,tanAl,tan2Al,tanP,tan2P;
-
- /* aktuellen Winkel Aufgrund cmean rechnen */
- 
-  if((fanParam->cmean == 0.0) || (fanParam->ckeel == 0.0)
-     || (fanParam->travelTime == 0.0 )) return (False);
-  arg = (fanParam->cmean / fanParam->ckeel) * sin(fanParam->angle);
-  if((arg < 1.0) && (arg > -1.0)) 
-     alpha = asin(arg);
-  else
-     return(False);  
-
- /* Winkelparameter */
-
-  tanAl  = tan(alpha);
-  tan2Al = tanAl * tanAl;    
-  if(isPitchcompensated == False)
-  {
-   tanP  = tan(fanParam->pitchTx);
-   tan2P = tanP * tanP;
-  }
-  else
-  {
-   tanP  = 0.0;
-   tan2P = 0.0;
-  }
-
- /* Tiefe auf HubRx-Niveau rechnen */
-           
-  depth =           fanParam->depth                        /* Pitch-kompensierte Messtiefe */
-                  + fanParam->heaveRx                      /* absolute Hubkompensation     */
-                  - fanParam->draught;                     /* Tiefgang                     */
-
- /* Travelway auf HubRx-Niveau (3D-Pythagoras) */
-
-  travelWay = depth * sqrt(tan2Al + tan2P + 1);
-
- /* mittleren rueckgestreuten Weg auf Bezugsniveau HubRx rechnen */
-
-  travelWay = travelWay 
-            + (((fanParam->heaveTx - fanParam->heaveRx)/2.0) * cos(alpha/2.0)); 
-  fanParam->travelTime = travelWay / fanParam->cmean;
-
- /* Positionen */
-
-  fanParam->posAhead = (depth * tanP)  + fanParam->transducerOffsetAhead;
-
-  fanParam->posStar  = (depth * tanAl) + fanParam->transducerOffsetStar;
-
-
- return(True);                   
-}
-
-
-
-
-
-/* Berechnung von Draught aus Ablage und Depth */
-
-Boolean draughtFromDepth(FanParam* fanParam)
-{
- double alpha,arg,fanDepth;
-
- /* aktuellen Winkel aufgrund cmean rechnen */
- 
- if((fanParam->cmean == 0.0) || (fanParam->ckeel == 0.0)) return (False);
- arg = (fanParam->cmean / fanParam->ckeel) * sin(fanParam->angle);
- if((arg < 1.0) && (arg > -1.0)) 
-    alpha = asin(arg);
- else
-    return(False);  
-
- /* Faechertiefe */
- 
- fanDepth = 
-   fabs(fanParam->posStar - fanParam->transducerOffsetStar)/tan(fabs(alpha));
-
- fanParam->draught = fanParam->depth - fanDepth;
- return(True);                   
-}
-
-
-/* Berechnung von Heave aus Ablage,Tiefgang und Depth */
-
-Boolean heaveFromDepth(FanParam* fanParam)
-{
- double alpha,arg,fanDepth;
-
- /* aktuellen Winkel aufgrund cmean rechnen */
- 
- if((fanParam->cmean == 0.0) || (fanParam->ckeel == 0.0)) return (False);
- arg = (fanParam->cmean / fanParam->ckeel) * sin(fanParam->angle);
- if((arg < 1.0) && (arg > -1.0)) 
-    alpha = asin(arg);
- else
-    return(False);  
-
- /* Faechertiefe */
- 
- fanDepth = (fanParam->posStar - fanParam->transducerOffsetStar)/tan(alpha);
-
- fanParam->heaveTx = - (fanParam->depth - fanDepth - fanParam->draught);
- fanParam->heaveRx = fanParam->heaveTx;
-
- return(True);                   
-}
-
-
-
-
-/* nach Del Grosso : ....     */
-
-
-double cMeanToTemperature(double salinity,double cMean)
-{
- double k0,k1,k2,arg,t1,t2;
-
- k0 = -(1448.6 + (1.15*(salinity-35.0)) - cMean);
- k1 = -4.618;
- k2 = 0.0523;
-
- arg = (k1*k1) - (4.0*k0*k2);
- if(arg < 0) return(0.0); /* nur komplexe Loesungen */
-
- t1 = (-k1 + sqrt(arg))/(2.0 * k2);
- t2 = (-k1 - sqrt(arg))/(2.0 * k2);
- if((t2 >= 0.0) && (t2 < 60.0))
-    return(t2);
- if((t1 >= 0.0) && (t1 < 60.0))
-    return(t1);
- else
-    return((double)(0.0));   
-}
-
-double temperatureToCMean(double salinity,double temperature)
-{
- return((double)(1448.6 + (temperature*4.618) 
-               - (temperature*temperature*0.0523) +(1.15* (salinity-35.0))));
-}
-
-
-double temperatureToCMeanDelGrosso(double salinity,double temperature)
-{
- return((double)(1448.6 + (temperature*4.618) 
-               - (temperature*temperature*0.0523) +(1.15* (salinity-35.0))));
-}
-
-
-double temperatureToCMeanMedwin(double salinity,double temperature)
-{
- return((double)(1449.2 + (temperature*4.6) - (temperature*temperature*0.055)
-               + (temperature*temperature*temperature*0.00029) +((1.34 - 0.01*temperature)* (salinity-35.0))));
-}
-
-
-/* Zeitwandlungen */
-
-
-SurfTime surfTimeOfDayFromAbsTime (SurfTime absTime)
-{
-#define HOURS_PER_DAY   3600.0*24.0
-
- while (absTime > (1000.0 * HOURS_PER_DAY))
-   absTime = absTime - (1000.0 * HOURS_PER_DAY); 
- while (absTime > (100.0 * HOURS_PER_DAY))
-   absTime = absTime - (100.0 * HOURS_PER_DAY); 
- while (absTime > (10.0 * HOURS_PER_DAY))
-   absTime = absTime - (10.0 * HOURS_PER_DAY); 
- while (absTime > (HOURS_PER_DAY))
-   absTime = absTime - (HOURS_PER_DAY);
- return(absTime);  
-}
-
-
-
-void timeFromRelTime (SurfTime relTime,char*buffer)
-{
- short day,hour,min,sec;
- day = 0;
- hour = 0;
- min = 0;
- sec = 0;
- 
- while (relTime >= (24.0*3600.0))
- {
-  relTime = relTime - (24.0*3600.0);
-  day++;
- }    
- while (relTime >= 3600.0)
- {
-  relTime = relTime - 3600.0;
-  hour++;
- }    
- while (relTime >= 60.0)
- {
-  relTime = relTime - 60.0;
-  min++;
- }    
- while (relTime > 0.0)
- {
-  relTime = relTime - 1.0;
-  sec++;
- }
- if(sec >= 60)
- {
-  min++;
-  sec = 0;
- } 
- if(min >= 60)
- {
-  hour++;
-  min = 0;
- } 
- if(hour >= 24)
- {
-  day++;
-  hour = 0;
- } 
- 
- sprintf(buffer,"%02d:%02d:%02d",hour,min,sec);    
-}
-
-
-Boolean relTimeFromTime (char*buffer,SurfTime* relTime)
-{
- int hour,min,sec;
- int nr;
-
- if(strlen(buffer) >8)buffer[8] = 0; 
- if(strlen(buffer) != 8) return(False);
- if((buffer[2] != ':') || (buffer[5] != ':')) return(False);
- nr = sscanf(buffer,"%2d:%2d:%2d",&hour,&min,&sec);
- if(nr != 3) return(False);
-
- *relTime = ((double)(hour) * 3600.0)
-          + ((double)(min ) *   60.0)
-          + ((double)(sec ));
- return(True);
-}
-
-
diff --git a/src/surf/pb_math.h b/src/surf/pb_math.h
deleted file mode 100644
index fb82e22..0000000
--- a/src/surf/pb_math.h
+++ /dev/null
@@ -1,182 +0,0 @@
-/*-----------------------------------------------------------------------
-/ H E A D E R K O P F
-/ ------------------------------------------------------------------------
-/ ------------------------------------------------------------------------
-/  DATEINAME        : hydEdit_math.h 
-/  ERSTELLUNGSDATUM : 20.09.93
-/ ----------------------------------------------------------------------*/
-/*!
-/ ------------------------------------------------------------------------
-/ COPYRIGHT (C) 1993: ATLAS ELEKTRONIK GMBH, 28305 BREMEN
-/ ------------------------------------------------------------------------
-/
-/  See README file for copying and redistribution conditions.
-/
-/
-/ HIER/SACHN: P: RP ____ _ ___ __
-/ BENENNUNG :
-/ ERSTELLER : Peter Block    : SAS3
-/ FREIGABE  : __.__.__  GS__
-/ AEND/STAND: __.__.__  __
-/ PRUEFVERM.:
-*/
-
-/*
-/ SPRACHE          : UNIX-C
-/ COMPILER         : Silicon Graphix
-/ BETRIEBSSYSTEM   : IRIX
-/ HARDWARE-UMGEBUNG: SGI Crimson
-/ URSPRUNGSHINWEIS :
-/
-/ ------------------------------------------------------------------------
-/ BESCHREIBUNG: Header fuer Vertikaltiefenparametereditor
-/ ------------------------------------------------------------------------
-/
-/ ------------------------------------------------------------------------
-/ E N D E   D E S   K O P F E S
-/ ------------------------------------------------------------------------
-*/
-/************************************************************************/
-
-#ifndef PI
-#define PI 3.14159265359
-#endif
-
-#define HALF_PI (double)(3.14159265359/2.0)
-
-#define RAD_TO_DEG(a) ((a>=+0.0)?                                \
-                                (double)((180.0*a)/PI)           \
-                               :                                 \
-                                (double)(360.0 - ((180.0*a)/PI)) )
-
-#define RAD_TO_PLUMINUS_DEG(a) ((double)((180.0*a)/PI))
-#define RAD_TO_PLUMINUS_MIN(a) ((double)((180.0*60.0*a)/PI))
-
-#define DEG_TO_RAD(a) ((a<=180.0)?                               \
-                                (double)((PI*a)/180.0)           \
-                                :                                \
-                                (double)((PI*(a - 360.0))/180.0) )
-
-#define DEG_TO_TWO_PI(a)        ((double)((PI*a)/180.0) )
-#define MIN_TO_RAD(a)           ((double)((PI*a)/(180.0*60.0)) )
-#define SET_TO_PLUS_PI(a) ((a<0.0)?                              \
-                                ((double)(a+(2.0*PI)))           \
-                                :                                \
-                                ((double)(a))                    )
-
-typedef  int   Boolean;
-#define  True  1
-#define  False 0
-
-typedef struct {
-                 double    x;
-                 double    y;
-               } XY_Coords;
-
-
-
-typedef struct {
-                 double    angle;
-                 double    cmean;
-                 double    ckeel;
-                 double    travelTime;
-                 double    draught;
-                 double    heaveTx;
-                 double    heaveRx;
-                 double    pitchTx;
-                 double    transducerOffsetStar;
-                 double    transducerOffsetAhead;
-                 double    depth;
-                 double    posStar;
-                 double    posAhead;
-               } FanParam;
-
-
-/* Plattkarten-Projektion */
-
-#define M_PER_RAD_LAT      ((double)(60.0*180.0*1852.0/PI))
-#define M_PER_RAD_LON(LAT) (((double)(60.0*180.0*1852.0/PI))*cos(LAT))
-
-#define M_TO_RAD_Y(Y)      ((double)(Y/M_PER_RAD_LAT))
-#define M_TO_RAD_X(X,LAT)  ((double)(X/(M_PER_RAD_LON(LAT))))
-#define RAD_TO_METER_Y(LAT)      ((double)(LAT*M_PER_RAD_LAT))
-#define RAD_TO_METER_X(LON,LAT)  ((double)(LON*(M_PER_RAD_LON(LAT))))
-
-#ifdef _PB_MATH  
-
-double pbAtan2(double y,double x);
-
-double setToPlusMinusPI(double angle);
-void rotateCoordinates(double rotAngle,XY_Coords* origCoords,
-                                       XY_Coords* targetCoords);
-void xyToRhoPhi(double x0,double y0,double pointX,double pointY,
-                                             double* rho,double* phi);
-void lambdaPhiToRhoPhi(double x0,double y0,double pointX,double pointY,
-                                             double* rho,double* phi);
-Boolean signf(double value);
-Boolean signsh(short value);
-
-Boolean depthFromTT(FanParam* fanParam,Boolean isPitchcompensated);
-Boolean TTfromDepth(FanParam* fanParam,Boolean isPitchcompensated);
-Boolean draughtFromDepth(FanParam* fanParam);
-Boolean heaveFromDepth(FanParam* fanParam);
-
-double cMeanToTemperature(double salinity,double cMean);
-double temperatureToCMeanDelGrosso(double salinity,double temperature);
-double temperatureToCMeanMedwin(double salinity,double temperature);
-double temperatureToCMean(double salinity,double temperature);
-
-SurfTime surfTimeOfDayFromAbsTime (SurfTime absTime);
-void timeFromRelTime (SurfTime relTime,char*buffer);
-Boolean relTimeFromTime (char*buffer,SurfTime* relTime);
-
-                                       
-#endif
-
-
-
-
-
-
-#ifndef _PB_MATH  
-
-extern double pbAtan2(double y,double x);
-
-extern double setToPlusMinusPI(double angle);
-extern void rotateCoordinates(double rotAngle,XY_Coords* origCoords,
-                                            XY_Coords* targetCoords);
-extern void xyToRhoPhi(double x0,double y0,double pointX,double pointY,
-                                             double* rho,double* phi);
-extern void lambdaPhiToRhoPhi(double x0,double y0,double pointX,double pointY,
-                                             double* rho,double* phi);
-extern Boolean signf(double value);
-extern Boolean signsh(short value);
-
-extern Boolean depthFromTT(FanParam* fanParam,Boolean isPitchcompensated);
-extern Boolean TTfromDepth(FanParam* fanParam,Boolean isPitchcompensated);
-extern Boolean draughtFromDepth(FanParam* fanParam);
-extern Boolean heaveFromDepth(FanParam* fanParam);
-
-extern double cMeanToTemperature(double salinity,double cMean);
-extern double temperatureToCMeanDelGrosso(double salinity,double temperature);
-extern double temperatureToCMeanMedwin(double salinity,double temperature);
-extern double temperatureToCMean(double salinity,double temperature);
-
-#ifndef WITHOUT_SURF
-extern SurfTime surfTimeOfDayFromAbsTime (SurfTime absTime);
-extern void timeFromRelTime (SurfTime relTime,char*buffer);
-extern Boolean relTimeFromTime (char*buffer,SurfTime* relTime);
-#endif
-
-#endif
-
-
-/*********************************************************************
-*         H I S T O R I E
-**********************************************************************
-*  Edition  History
-*   date    comments                                            by
-* --------  ------------------------------------------------ ---------
-* 20-09-93  created                                            Block
-*********************************************************************/
-
diff --git a/src/surf/sapi_build.c b/src/surf/sapi_build.c
deleted file mode 100644
index ac69a2d..0000000
--- a/src/surf/sapi_build.c
+++ /dev/null
@@ -1,286 +0,0 @@
-/*
-/  See README file for copying and redistribution conditions.
-*/
-
-#include <stdio.h>
-#include <stdlib.h>
-#ifdef _WIN32
-#include <string.h>
-#include "types_win32.h"
-#else
-#include <string.h>
-#include <unistd.h>
-#endif
-#include <math.h>
-
-
-#include "xdr_surf.h"
-#include "mem_surf.h"
-#include "util_surf.h"
-#include "pb_math.h"
-#define  __SAPI__
-#include "mb_sapi.h"
-
-
-extern SurfDataInfo*      sapiToSurfData;
-extern SurfSoundingData*  sapiToSdaBlock;
-extern Boolean            loadIntoMemory;
-
-
-static SurfDescriptor defaultDescriptor =
-{
- SURF_DESCRIPTOR_LABEL,
- SIX_M,
- {DESCRIPTOR,                       1},
- {GLOBALDATA,                       1},
- {STATISTICS,                       1},
- {POSITIONSENSORS,                  1},
- {TRANSDUCERPARAM,                  1},
- {BEAMANGLE,                        0},
- {CPROFILE,                         0},
- {AREAPOLYGON,                      0},
- {EVENTS,                           0},
- {FREETEXT,                         1},
-#ifdef SURF30
- {ADDSTATISTICS,                    0},
- {TPESTATICS,                       0},
- {CPROFTPES,                        0},
- {FREESIXDESCR,                     0},
- {FREESNDGDESCR,                    0},
- {FREEBEAMDESCR,                    0},
- {SIXATTDATA,                       0},
- {VENDORTEXT,                       0},
-#endif
- SDA_M,
- {SOUNDING,                         1},
- {CENTERPOSITION,                   1},
- {SINGLEBEAMDEPTH,                  1},
- {MULTIBEAMDEPTH,                   0},
- {MULTIBEAMTT,                      0},
- {MULTIBEAMRECV,                    0},
- {SIGNALPARMS,                      0},
- {SIGNALAMPLITUDE,                  0},
- {BEAMAMPLITUDES,                   0},
- {EXTBEAMAMPLI,                     0},
- {SIDESCANDATA,                     0},
- {TXPARMS,                          0},
-#ifdef SURF30
- {POSITIONCEP,                      0},
- {MULTITPES,                        0},
- {SINGLETPES,                       0},
- {SNDGATTDATA,                      0},
- {BEAMATTDATA,                      0},
-#endif
- NROF_M,
- {MAX_NROF_BEAMS_PER_TABLE,         0},
- {MAX_NROF_CPROFILES_PER_TABLE,     0},
- {MAX_NROF_POLYGONS_PER_TABLE,      0},
- {MAX_NROF_EVENTS,                  0},
- {MAX_NROF_FREE_TEXT_BLOCKS,       20},
- {MAX_NROF_SIDESCAN_DATA,           0},
- {NROF_RX_TVG_SETS,                 0},
- {NROF_TX_TVG_SETS,                 0},
- EOD_M
-};
-
-
-static SurfGlobalData defaultGlobalData =
-{
- SURF_GLOBAL_DATA_LABEL,
- "UNKNOWN",
- "","","",
- 0.0,0.0,
- 0l,0l,
- "","","","",
- 0,
- 0.0,0.0,0.0,0.0,0.0,
- "UNKNOWN",'V',
- 0.0,
- 0.0,
- 0.0,
- "WGS84",6378137.0,0.00335281070480037,"Mercator",
- 'E',0.0,0.0,0.0,
- 0.0,0.0,
- 'l',
- 0.0,0.0,0.0,0.0,
- 0.0,0.0,0.0,0.0,
- 0.0,0.0,
- "",
- 0.0,0.0,0.0,0.0,
- 0.0
-};
-
-
-static SurfStatistics defaultStatistics =
-{
- SURF_STATISTICS_LABEL
-};
-
-static SurfPositionSensorArray defaultPositionSensorArray =
-{
- SURF_POSITION_SENSOR_LABEL,
- UNKNOWNPOSSENS
-};
-
-static SurfTransducerParameterTable defaultTransducerTable =
-{
- SURF_TRANSDUCER_TABLE_LABEL
-};
-
-static SurfMultiBeamAngleTable defaultAngleTable =
-{
- SURF_MULTIBEAM_ANGLE_LABEL
-};
-
-
-
-
-static long createSDAs(void)
-{
- SdaInfo*          sapiToSdaInfo;
- SurfSoundingData* toSdaBlock;
- size_t         sizeOfSdaBlock;
- u_long  nrSoundings,nrBeams;
- u_long  ii,jj;
-
- nrSoundings = sapiToSurfData->nrOfSoundings;
- nrBeams     = sapiToSurfData->nrOfMultiBeamDepth;
-
- sapiToSdaInfo = (SdaInfo*)calloc(1,sizeof(SdaInfo));
- sapiToSurfData->toSdaInfo = sapiToSdaInfo;
- if (sapiToSdaInfo == NULL)
- {
-  free_SdaMemory(sapiToSurfData);
-  return(-1);
- }
- sapiToSurfData->toSdaThread =
-           (SurfSdaThread*)calloc((u_int)nrSoundings,sizeof(SurfSdaThread));
- if (sapiToSurfData->toSdaThread == NULL)
- {
-  free_SdaMemory(sapiToSurfData);
-  return(-1);
- }
-
- sizeOfSdaBlock = initializeSdaInfo(sapiToSurfData,sapiToSdaInfo);
- for(ii=0;ii < nrSoundings;ii++)
- {
-  toSdaBlock = (SurfSoundingData*)calloc(1,sizeOfSdaBlock);
-  if(toSdaBlock == NULL)
-  {
-   for(jj=0;jj<ii;jj++)
-   {
-    if(sapiToSurfData->toSdaThread->thread[jj].sounding != NULL)
-            free(sapiToSurfData->toSdaThread->thread[jj].sounding);
-    sapiToSurfData->toSdaThread->thread[jj].sounding = NULL;
-   }
-   free_SdaMemory(sapiToSurfData);
-   return(-1);
-  }
-  else
-  {
-   sapiToSurfData->toSdaThread->thread[ii].sounding = toSdaBlock;
-  }
- }
- return(0);
-}
-
-
-
-
-long SAPI_createSurfBody(long nrSoundings,
-                         long nrBeams,
-                         long maxNrSidescanSamplesPerSounding,
-                         long errorprint)
-{
-
- defaultDescriptor.soundings.nr=nrSoundings;
- defaultGlobalData.numberOfMeasuredSoundings =nrSoundings;
- defaultGlobalData.actualNumberOfSoundingSets=nrSoundings;
- if(nrBeams > 0)
- {
-  defaultDescriptor.angleTab.nr = 1;
-  defaultDescriptor.maxNrOfBeams.nr = 1;
-  defaultDescriptor.singleBeamDepth.nr = 0;
-  defaultDescriptor.maxNrOfBeams.nr    = nrBeams;
-  defaultDescriptor.multiBeamDepth.nr  = nrBeams;
-  defaultDescriptor.multiBeamTT.nr     = nrBeams;
-  defaultDescriptor.multiBeamRecv.nr   = nrBeams;
-  defaultGlobalData.typeOfSounder = 'F';
-  defaultAngleTable.actualNumberOfBeams = (u_short)nrBeams;
- }
- if(maxNrSidescanSamplesPerSounding > 0)
- {
-  defaultDescriptor.sidescanData.nr = 1;
-  defaultDescriptor.maxNrOfSidescanData.nr = maxNrSidescanSamplesPerSounding;
- }
-
- sapiToSurfData = (SurfDataInfo*)calloc(1,sizeof(SurfDataInfo));
- if (sapiToSurfData == NULL)
- {
-  if(errorprint != 0)
-    fprintf(stderr,"SAPI-Error: Can't allocate sufficient memory' !\n");
-  return((long)-1);
- }
-
- sapiToSurfData->toDescriptor =
-        (SurfDescriptor*)calloc(1,sizeof(SurfDescriptor));
- sapiToSurfData->toGlobalData =
-        (SurfGlobalData*)calloc(1,sizeof(SurfGlobalData));
- sapiToSurfData->toStatistics =
-        (SurfStatistics*)calloc(1,sizeof(SurfStatistics));
- sapiToSurfData->toPosiSensors =
-        (SurfPositionSensorArray*)calloc(1,sizeof(SurfPositionSensorArray));
- sapiToSurfData->toTransducers =
-        (SurfTransducerParameterTable*)calloc(1,sizeof(SurfTransducerParameterTable));
- sapiToSurfData->toFreeText =
-        (SurfFreeText*)calloc(1,SIZE_OF_FREE_TEXT_ARRAY(20));
- if(  (sapiToSurfData->toDescriptor == NULL)
-   || (sapiToSurfData->toGlobalData == NULL)
-   || (sapiToSurfData->toStatistics == NULL)
-   || (sapiToSurfData->toPosiSensors == NULL)
-   || (sapiToSurfData->toTransducers == NULL)
-   || (sapiToSurfData->toFreeText    == NULL))
- {
-  if(errorprint != 0)
-    fprintf(stderr,"SAPI-Error: Can't allocate sufficient memory' !\n");
-  freeSixBlocks(sapiToSurfData,0);
-  return((long)-1);
- }
-
- if(nrBeams != 0)
- {
-  sapiToSurfData->toAngleTables =
-        (SurfMultiBeamAngleTable*)calloc(1,(size_t)SIZE_OF_SURF_MULTIBEAM_ANGLE_TAB((u_int)nrBeams));
-  if(sapiToSurfData->toAngleTables == NULL)
-  {
-   if(errorprint != 0)
-    fprintf(stderr,"SAPI-Error: Can't allocate sufficient memory' !\n");
-   freeSixBlocks(sapiToSurfData,0);
-   return((long)-1);
-  }
-  *(sapiToSurfData->toAngleTables) = defaultAngleTable;
- }
-
- *(sapiToSurfData->toDescriptor) = defaultDescriptor;
- *(sapiToSurfData->toGlobalData) = defaultGlobalData;
- *(sapiToSurfData->toStatistics) = defaultStatistics;
- *(sapiToSurfData->toPosiSensors)= defaultPositionSensorArray;
- *(sapiToSurfData->toTransducers)= defaultTransducerTable;
-
- checkAndLoadSurfDescriptor(sapiToSurfData->toDescriptor,sapiToSurfData);
-
- if(createSDAs()<0)
- {
-  if(errorprint != 0)
-    fprintf(stderr,"SAPI-Error: Can't allocate sufficient memory' !\n");
-  freeSixBlocks(sapiToSurfData,0);
-  return((long)-1);
- }
-
- surf_moveInSdaThread(sapiToSurfData,TO_START,0);
-
- loadIntoMemory = True;
-
- return((long)0);
-}
-
diff --git a/src/surf/sapi_data.c b/src/surf/sapi_data.c
deleted file mode 100644
index ae8e650..0000000
--- a/src/surf/sapi_data.c
+++ /dev/null
@@ -1,277 +0,0 @@
-/*
-/  See README file for copying and redistribution conditions.
-*/
-
-#include <stdio.h>
-#include <stdlib.h>
-#ifdef _WIN32
-#include <string.h>
-#include "types_win32.h"
-#else
-#include <string.h>
-#include <unistd.h>
-#endif
-#include <math.h>
-
-#include "xdr_surf.h"
-#include "mem_surf.h"
-#include "util_surf.h"
-#include "pb_math.h"
-#define  __SAPI__
-#include "mb_sapi.h"
-
-
-
-extern SurfDataInfo*      sapiToSurfData;
-extern SurfSoundingData*  sapiToSdaBlock;
-
-
-
-SurfSoundingData* SAPI_getSoundingData(void)
-{
- SdaInfo* sapiToSdaInfo = NULL;
-
- if(sapiToSurfData != NULL) sapiToSdaInfo = sapiToSurfData->toSdaInfo;
- if(sapiToSdaInfo == NULL) return(NULL);
- return(sapiToSdaInfo->toSoundings);
-}
-
-
-SurfTransducerParameterTable* SAPI_getActualTransducerTable(void)
-{
- SdaInfo* sapiToSdaInfo = NULL;
- SurfTransducerParameterTable* toTransdTable;
- short index;
-
- if((sapiToSurfData == NULL) || (sapiToSurfData->toTransducers == NULL)) return(NULL);
- sapiToSdaInfo = sapiToSurfData->toSdaInfo;
- if(sapiToSdaInfo == NULL) return(NULL);
- index=(short)sapiToSdaInfo->toSoundings->indexToTransducer;
- toTransdTable = &(sapiToSurfData->toTransducers[index]);
- return(toTransdTable);
-}
-
-
-SurfMultiBeamAngleTable* SAPI_getActualAngleTable(void)
-{
- SdaInfo* sapiToSdaInfo = NULL;
- SurfMultiBeamAngleTable* toAngleTable;
- short index,nrBeams;
-
- if((sapiToSurfData == NULL) || (sapiToSurfData->toAngleTables == NULL)) return(NULL);
- sapiToSdaInfo = sapiToSurfData->toSdaInfo;
- if(sapiToSdaInfo == NULL) return(NULL);
- index=(short)sapiToSdaInfo->toSoundings->indexToAngle;
- nrBeams=(short)SAPI_getNrBeams();
- toAngleTable = getSurfAngleTable(sapiToSurfData->toAngleTables,nrBeams,index);
- return(toAngleTable);
-}
-
-
-SurfCProfileTable* SAPI_getActualCProfileTable(void)
-{
- SdaInfo* sapiToSdaInfo = NULL;
- SurfCProfileTable* toCProf;
- short index,nrCEles;
-
- if((sapiToSurfData == NULL) || (sapiToSurfData->toCProfiles == NULL)) return(NULL);
- sapiToSdaInfo = sapiToSurfData->toSdaInfo;
- if(sapiToSdaInfo == NULL) return(NULL);
- index=(short)sapiToSdaInfo->toSoundings->indexToCProfile;
- nrCEles=(short)sapiToSurfData->nrCPElements;
- toCProf=getSurfCProfileTable(sapiToSurfData->toCProfiles,nrCEles,index);
- return(toCProf);
-}
-
-
-SurfCenterPosition* SAPI_getCenterPosition(long nrPositionSensor)
-{
- SurfCenterPosition* toPosition;
- SdaInfo* sapiToSdaInfo = NULL;
-
- if(sapiToSurfData != NULL) sapiToSdaInfo = sapiToSurfData->toSdaInfo;
- if(sapiToSdaInfo == NULL) return(NULL);
- if((nrPositionSensor<SAPI_getNrPositionsensors()) && (nrPositionSensor>=0))
- {
-  toPosition = (SurfCenterPosition*)
-                &sapiToSdaInfo->toActCenterPosition[nrPositionSensor].positionFlag;
-  return(toPosition);
- }
- return(NULL);
-}
-
-
-SurfSingleBeamDepth* SAPI_getSingleBeamDepth(void)
-{
- SdaInfo* sapiToSdaInfo = NULL;
-
- if(sapiToSurfData != NULL) sapiToSdaInfo = sapiToSurfData->toSdaInfo;
- if(sapiToSdaInfo == NULL) return(NULL);
- return(sapiToSdaInfo->toSingleBeamDepth);
-}
-
-
-SurfMultiBeamDepth* SAPI_getMultiBeamDepth(long beam)
-{
- SdaInfo* sapiToSdaInfo = NULL;
-
- if(sapiToSurfData != NULL) sapiToSdaInfo = sapiToSurfData->toSdaInfo;
- if((sapiToSdaInfo == NULL) || (sapiToSdaInfo->toMultiBeamDepth == NULL)) return(NULL);
- if((beam >= 0) && (beam<SAPI_getNrBeams()))
- {
-  return(&(sapiToSdaInfo->toMultiBeamDepth[beam]));
- }
- return(NULL);
-}
-
-
-SurfMultiBeamTT* SAPI_getMultiBeamTraveltime(long beam)
-{
- SdaInfo* sapiToSdaInfo = NULL;
-
- if(sapiToSurfData != NULL) sapiToSdaInfo = sapiToSurfData->toSdaInfo;
- if((sapiToSdaInfo == NULL) || (sapiToSdaInfo->toMultiBeamTT == NULL)) return(NULL);
- if((beam >= 0) && (beam<SAPI_getNrBeams()))
- {
-  return(&(sapiToSdaInfo->toMultiBeamTT[beam]));
- }
- return(NULL);
-}
-
-
-SurfMultiBeamReceive* SAPI_getMultiBeamReceiveParams(long beam)
-{
- SdaInfo* sapiToSdaInfo = NULL;
-
- if(sapiToSurfData != NULL) sapiToSdaInfo = sapiToSurfData->toSdaInfo;
- if((sapiToSdaInfo == NULL) || (sapiToSdaInfo->toMultiBeamRec == NULL)) return(NULL);
- if((beam >= 0) && (beam<SAPI_getNrBeams()))
- {
-  return(&(sapiToSdaInfo->toMultiBeamRec[beam]));
- }
- return(NULL);
-}
-
-
-
-/* New Data in SURF2.0 */
-
-
-SurfAmplitudes* SAPI_getMultibeamBeamAmplitudes(long beam)
-{
- SdaInfo* sapiToSdaInfo = NULL;
-
- if(sapiToSurfData != NULL) sapiToSdaInfo = sapiToSurfData->toSdaInfo;
- if((sapiToSdaInfo == NULL) || (sapiToSdaInfo->toAmplitudes == NULL)) return(NULL);
- if((beam >= 0) && (beam<SAPI_getNrBeams()))
- {
-  return(&(sapiToSdaInfo->toAmplitudes[beam]));
- }
- return(NULL);
-}
-
-
-
-SurfExtendedAmplitudes* SAPI_getMultibeamExtendedBeamAmplitudes(long beam)
-{
- SdaInfo* sapiToSdaInfo = NULL;
-
- if(sapiToSurfData != NULL) sapiToSdaInfo = sapiToSurfData->toSdaInfo;
- if((sapiToSdaInfo == NULL) || (sapiToSdaInfo->toExtendedAmpl == NULL)) return(NULL);
- if((beam >= 0) && (beam<SAPI_getNrBeams()))
- {
-  return(&(sapiToSdaInfo->toExtendedAmpl[beam]));
- }
- return(NULL);
-}
-
-
-
-SurfSignalParameter* SAPI_getMultibeamSignalParameters(void)
-{
- SdaInfo* sapiToSdaInfo = NULL;
-
- if(sapiToSurfData != NULL) sapiToSdaInfo = sapiToSurfData->toSdaInfo;
- if(sapiToSdaInfo == NULL) return(NULL);
- return(sapiToSdaInfo->toSignalParams);
-}
-
-
-
-SurfTxParameter* SAPI_getMultibeamTransmitterParameters(int *nTxParams)
-{
- SdaInfo* sapiToSdaInfo = NULL;
-
- if(nTxParams != NULL)
-  *nTxParams = 0;
- if(sapiToSurfData != NULL) sapiToSdaInfo = sapiToSurfData->toSdaInfo;
- if(sapiToSdaInfo == NULL) return(NULL);
- if(nTxParams != NULL)
-  *nTxParams = sapiToSdaInfo->nrTxParams;
- return(sapiToSdaInfo->toTxParams);
-}
-
-
-
-SurfSidescanData* SAPI_getSidescanData(void)
-{
- SdaInfo* sapiToSdaInfo = NULL;
-
- if(sapiToSurfData != NULL) sapiToSdaInfo = sapiToSurfData->toSdaInfo;
- if(sapiToSdaInfo == NULL) return(NULL);
- return(sapiToSdaInfo->toSsData);
-}
-
-
-#ifdef SURF30
-
-SurfAddStatistics*  SAPI_getAddStatistics(void)
-{
- if(sapiToSurfData == NULL) return(NULL);
- return(sapiToSurfData->toAddStatistics);
-}
-
-SurfTpeStatics*  SAPI_getTpeStatics(void)
-{
- if(sapiToSurfData == NULL) return(NULL);
- return(sapiToSurfData->toTpeStatics);
-}
-
-SurfTpeValues* SAPI_getMultiBeamTPEValues(long beam)
-{
- SdaInfo* sapiToSdaInfo = NULL;
-
- if(sapiToSurfData != NULL) sapiToSdaInfo = sapiToSurfData->toSdaInfo;
- if(sapiToSdaInfo == NULL) return(NULL);
- if(sapiToSdaInfo->toMultiBeamTpeValues == NULL) return(NULL);
- if((beam >= 0) && (beam<SAPI_getNrBeams()))
- {
-  return(&(sapiToSdaInfo->toMultiBeamTpeValues[beam]));
- }
- return(NULL);
-}
-
-SurfTpeValues* SAPI_getSingleBeamTPEValues(void)
-{
- SdaInfo* sapiToSdaInfo = NULL;
-
- if(sapiToSurfData != NULL) sapiToSdaInfo = sapiToSurfData->toSdaInfo;
- if(sapiToSdaInfo == NULL) return(NULL);
- return(sapiToSdaInfo->toSingleBeamTpeValues);
-}
-
-SurfPositionCepData* SAPI_getPositionCep(long nrPositionSensor)
-{
- SdaInfo* sapiToSdaInfo = NULL;
-
- if(sapiToSurfData != NULL) sapiToSdaInfo = sapiToSurfData->toSdaInfo;
- if(sapiToSdaInfo == NULL) return(NULL);
- if(sapiToSdaInfo->toPositionCepData == NULL) return(NULL);
- if((nrPositionSensor<SAPI_getNrPositionsensors()) && (nrPositionSensor>=0))
- {
-  return(&(sapiToSdaInfo->toPositionCepData[nrPositionSensor]));
- }
- return(NULL);
-}
-
-#endif
diff --git a/src/surf/sapi_files.c b/src/surf/sapi_files.c
deleted file mode 100644
index 0d7c992..0000000
--- a/src/surf/sapi_files.c
+++ /dev/null
@@ -1,685 +0,0 @@
-/*
-/  See README file for copying and redistribution conditions.
-*/
-
-#include <stdio.h>
-#include <stdlib.h>
-#ifdef _WIN32
-#include <string.h>
-#include "types_win32.h"
-#else
-#include <string.h>
-#include <unistd.h>
-#endif
-#include <math.h>
-
-#include "xdr_surf.h"
-#include "mem_surf.h"
-#include "util_surf.h"
-#include "pb_math.h"
-#define  __SAPI__
-#include "mb_sapi.h"
-
-#define SAPI_VERSION "SAPI V3.1.4"
-
-#ifdef _WIN32
-#include <io.h>
-#define access _access
-#endif
-
-extern XdrSurf mem_convertOneSdaBlock2(XDR* xdrs,SdaInfo* sdaInfo,short versLess2);
-extern size_t initializeSdaInfo(SurfDataInfo* toSurfDataInfo,SdaInfo* toSdaInfo);
-extern void setPointersInSdaInfo(void* toSdaBlock,SdaInfo* toSdaInfo);
-long SAPI_openFile(char* surfDir,char* surfFile,long errorprint);
-
-
-SurfDataInfo*      sapiToSurfData;
-SurfSoundingData*  sapiToSdaBlock;
-Boolean            loadIntoMemory=False;
-
-
-void SAPI_printAPIandSURFversion(void)
-{
- fprintf(stderr,"Version: %s\n         %s\n",SAPI_VERSION,SURF_VERSION);
-}
-
-
-static void freeControlData(void)
-{
- SdaInfo* sapiToSdaInfo = NULL;
-
- if(sapiToSurfData != NULL)
- {
-  sapiToSdaInfo = sapiToSurfData->toSdaInfo;
-  if(sapiToSurfData->xdrs != NULL)
-  {
-   free((char*)sapiToSurfData->xdrs);
-   sapiToSurfData->xdrs=NULL;
-  }
-  if(sapiToSurfData->fp != NULL)fclose(sapiToSurfData->fp);
-  free((char*)sapiToSurfData);
-  sapiToSurfData=NULL;
- }
- if(sapiToSdaInfo != NULL && loadIntoMemory != True )
-     free((char*)sapiToSdaInfo);
- if(sapiToSdaBlock != NULL) free((char*)sapiToSdaBlock);
- sapiToSurfData = NULL;
- sapiToSdaInfo = NULL;
- sapiToSdaBlock = NULL;
-}
-
-
-
-long SAPI_openIntoMemory(char* surfDir,char* surfFile,long errorprint)
-{
- loadIntoMemory=True;
- return(SAPI_openFile(surfDir,surfFile,errorprint));
-}
-
-long SAPI_open(char* surfDir,char* surfFile,long errorprint)
-{
- loadIntoMemory=False;
- return(SAPI_openFile(surfDir,surfFile,errorprint));
-}
-
-
-
-
-long SAPI_openFile(char* surfDir,char* surfFile,long errorprint)
-{
- SdaInfo* sapiToSdaInfo = NULL;
- char filesix[300];
- char filesda[300];
- XdrSurf ret;
- size_t  sizeOfSdaBlock;
-
-
- if(access(surfDir,0) != 0)
- {
-  if(errorprint != 0)
-    fprintf(stderr,"SAPI-Error: Can't access path: '%s' !\n",surfDir);
-  return((long)-1);
- }
-
- freeControlData();
-
- sapiToSurfData = (SurfDataInfo*)calloc(1,sizeof(SurfDataInfo));
- if (sapiToSurfData == NULL)
- {
-  if(errorprint != 0)
-    fprintf(stderr,"SAPI-Error: Can't allocate sufficient memory' !\n");
-  return((long)-1);
- }
-
- strncpy(filesix,surfDir,250);
- strcat(filesix,"/");
- strcat(filesix,surfFile);
- strcat(filesix,".six");
-
- strncpy(filesda,surfDir,250);
- strcat(filesda,"/");
- strcat(filesda,surfFile);
- strcat(filesda,".sda");
-
- if(access(filesix,4) !=0)
- {
-  freeControlData();
-  if(errorprint != 0)
-    fprintf(stderr,"SAPI-Error: Can't access file: '%s' !\n",filesix);
-  return(-1);
- }
- if(access(filesda,4) !=0)
- {
-  freeControlData();
-  if(errorprint != 0)
-    fprintf(stderr,"SAPI-Error: Can't access file: '%s' !\n",filesda);
-  return(-1);
- }
-
- ret = mem_ReadSixStructure(filesix,sapiToSurfData);
- if(ret != SURF_SUCCESS)
- {
-  mem_destroyAWholeSurfStructure(sapiToSurfData);
-  freeControlData();
-  if(errorprint != 0)
-    fprintf(stderr,"SAPI-Error: Can't read file: '%s' !\n",filesix);
-  return((long)-1);
- }
-
- /* special mode for rewrite read the whole surfFile into memory */
-
- if(loadIntoMemory==True)
- {
-  ret = mem_ReadSdaStructure(filesda,sapiToSurfData);
-  if(ret != SURF_SUCCESS)
-  {
-   mem_destroyAWholeSurfStructure(sapiToSurfData);
-   freeControlData();
-   if(errorprint != 0)
-     fprintf(stderr,"SAPI-Error: Can't read file: '%s' !\n",filesda);
-   return((long)-1);
-  }
-  surf_moveInSdaThread(sapiToSurfData,ABS_POSITION,0);
-  return((long)0);
- }
-
- /* Allocate the necessary memory for a SDA-structure and read
-    the first SDA-Block from file; */
-
- if(sapiToSurfData->nrOfSoundings <=0)
- {
-  freeControlData();
-  if(errorprint != 0)
-    fprintf(stderr,"SAPI-Error: nr of soundings = %d!\n",(int)(sapiToSurfData->nrOfSoundings));
-  return((long)-1);
- }
-
- /* allocate structure for xdr-conversion and SdaInfo and Sda-Thread */
-
- sapiToSdaInfo = (SdaInfo*)calloc(1,sizeof(SdaInfo));
- sapiToSurfData->toSdaInfo = sapiToSdaInfo;
-
- sapiToSurfData->xdrs = (XDR*)calloc(1,sizeof(XDR));  /* ????? */
-
- if((sapiToSurfData->xdrs == NULL) || (sapiToSdaInfo == NULL))
- {
-  freeControlData();
-  if(errorprint != 0)
-    fprintf(stderr,"SAPI-Error: Can't allocate sufficient memory' !\n");
-  return((long)-1);
- }
-
- sizeOfSdaBlock = initializeSdaInfo(sapiToSurfData,sapiToSdaInfo);
- sapiToSdaBlock = (SurfSoundingData*)calloc(1,sizeOfSdaBlock);
-
- if((sapiToSurfData->xdrs == NULL) || (sapiToSdaInfo == NULL))
- {
-  freeControlData();
-  if(errorprint != 0)
-    fprintf(stderr,"SAPI-Error: Can't allocate sufficient memory' !\n");
-  return((long)-1);
- }
-
- setPointersInSdaInfo(sapiToSdaBlock,sapiToSdaInfo);
-
- /* open file Read and read first Block */
-
- sapiToSurfData->fp = xdrSurfOpenRead(sapiToSurfData->xdrs,(const char*)filesda);
- if(sapiToSurfData->fp == NULL)
- {
-  freeControlData();
-  if(errorprint != 0)
-    fprintf(stderr,"SAPI-Error: Can't open file: '%s' !\n",filesda);
-  return((long)-1);
- }
-
- ret = mem_convertOneSdaBlock2(sapiToSurfData->xdrs,sapiToSdaInfo,sapiToSurfData->sourceVersionLess2);
- if(ret != SURF_SUCCESS)
- {
-  freeControlData();
-  if(errorprint != 0)
-    fprintf(stderr,"SAPI-Error: Can't read file: '%s' !\n",filesda);
-  return((long)-1);
- }
-
- return((long)0);
-}
-
-
-
-long SAPI_nextSounding(long errorprint)
-{
- XdrSurf ret;
- SdaInfo* sapiToSdaInfo = NULL;
-
- if(sapiToSurfData != NULL) sapiToSdaInfo = sapiToSurfData->toSdaInfo;
- if((sapiToSurfData == NULL) || (sapiToSdaInfo == NULL))
- {
-  if(errorprint != 0)
-    fprintf(stderr,"SAPI-Error: No SURF-data open !\n");
-  return((long)-1);
- }
-
- /* special mode for rewrite read the whole surfFile into memory */
-
- if(loadIntoMemory==True)
- {
-  if(surf_moveInSdaThread(sapiToSurfData,FORE_ONE_STEP,0) == END_OF_THREAD)
-  {
-   if(errorprint != 0)
-     fprintf(stderr,"SAPI-Error: End of file !\n");
-   return((long)-1);
-  }
-  return((long)0);
- }
-
- ret = mem_convertOneSdaBlock2(sapiToSurfData->xdrs,sapiToSdaInfo,sapiToSurfData->sourceVersionLess2);
- if(ret != SURF_SUCCESS)
- {
-  if(errorprint != 0)
-    fprintf(stderr,"SAPI-Error: Can't read file or EOF !\n");
-  return((long)-1);
- }
- return((long)0);
-}
-
-
-
-long SAPI_rewind(long errorprint)
-{
- SdaInfo* sapiToSdaInfo = NULL;
-
- if(sapiToSurfData != NULL) sapiToSdaInfo = sapiToSurfData->toSdaInfo;
-
- /* special mode for rewrite read the whole surfFile into memory */
- if(loadIntoMemory==True)
- {
-  if((sapiToSurfData == NULL) || (sapiToSdaInfo == NULL))
-  {
-   return((long)-1);
-  }
-  surf_moveInSdaThread(sapiToSurfData,TO_START,0);
-  return((long)0);
- }
-
- if((sapiToSurfData == NULL) || (sapiToSurfData->xdrs == NULL)
-  || (sapiToSdaInfo == NULL) || (sapiToSurfData->fp == NULL))
- {
-  return((long)-1);
- }
-
- rewind(sapiToSurfData->fp);
- return(SAPI_nextSounding(errorprint));
-}
-
-
-void SAPI_close(void)
-{
- if(sapiToSurfData != NULL)
- {
-  if(sapiToSurfData->fp != NULL)fclose(sapiToSurfData->fp);
-  sapiToSurfData->fp = NULL;
-  mem_destroyAWholeSurfStructure(sapiToSurfData);
-  sapiToSurfData = NULL;
- }
-#ifndef _WIN32
- freeControlData();
-#endif
-}
-
-
-
-
-
-void recalculateData(void)
-{
- SurfGlobalData* toGlobalData;
- SurfStatistics* toStatistics;
- SurfMultiBeamAngleTable* toAngles;
- Boolean isPitchcompensated,allBeamsDeleted;
- Boolean depthStatisticsFound = False;
- Boolean posIsMeter = False;
- FanParam fanParam;
- short indexToAngle,indexToTransducer;
- u_short depthFlag,soundingFlag;
- long ii,nrSoundings,firstSounding;
- short beam,nrBeams;
- double tide,depth;
- double minDef= 999999999.0;
- double maxDef=-999999999.0;
- double minBeamPositionStar,maxBeamPositionStar;
- double minBeamPositionAhead,maxBeamPositionAhead;
- double minDepth,maxDepth;
- double minX,maxX,minY,maxY,refX,refY,relWay,relTime;
- double posX,posY,deltaX,deltaY,lastX,lastY;
- double speed,minSpeed,maxSpeed;
- double roll,minRoll,maxRoll;
- double minPitch,maxPitch;
- double minHeave,maxHeave;
- double cmean;
-
- if(sapiToSurfData!=NULL)
- {
-  toGlobalData = sapiToSurfData->toGlobalData;
-  toStatistics = sapiToSurfData->toStatistics;
-
-  nrBeams = (short) sapiToSurfData->nrBeams;
-  nrSoundings = sapiToSurfData->nrOfSoundings;
-
-  if(toGlobalData->presentationOfPosition=='X')
-       posIsMeter=True;
-
-  isPitchcompensated = True;
-  if(strncmp(toGlobalData->nameOfSounder,"MD",2) == 0)
-       isPitchcompensated = False;
-  if(strncmp(toGlobalData->nameOfSounder,"FS",2) == 0)
-       isPitchcompensated = False;
-
-
-  if(toGlobalData->typeOfSounder != 'F')
-  {
-   minBeamPositionStar  = 0.0;
-   maxBeamPositionStar  = 0.0;
-   minBeamPositionAhead = 0.0;
-   maxBeamPositionAhead = 0.0;
-  }
-  else
-  {
-   minBeamPositionStar  = minDef;
-   maxBeamPositionStar  = maxDef;
-   minBeamPositionAhead = minDef;
-   maxBeamPositionAhead = maxDef;
-  }
-  minDepth = minDef;
-  maxDepth = maxDef;
-  minX = minDef;
-  minY = minDef;
-  maxX = maxDef;
-  maxY = maxDef;
-
-  minSpeed=minRoll=minPitch=minHeave=minDef;
-  maxSpeed=maxRoll=maxPitch=maxHeave=maxDef;
-
-  refX  = toGlobalData->referenceOfPositionX;
-  refY  = toGlobalData->referenceOfPositionY;
-  posX = posY = 0.0;
-  relWay = 0.0;
-  relTime=0.0;
-
-  firstSounding = -1;
-  for(ii=0;ii<nrSoundings;ii++)
-  {
-   surf_moveInSdaThread(sapiToSurfData,ABS_POSITION,ii);
-   soundingFlag = sapiToSurfData->toSdaInfo->toSoundings->soundingFlag;
-
-   if((soundingFlag & (SF_DELETED | SF_ALL_BEAMS_DELETED)) == 0)
-   {
-    firstSounding ++;
-    relTime = (double) sapiToSurfData->toSdaInfo->toSoundings->relTime;
-    posX = (double)
-         (sapiToSurfData->toSdaInfo->toActCenterPosition->centerPositionX) + refX;
-    posY = (double)
-         (sapiToSurfData->toSdaInfo->toActCenterPosition->centerPositionY) + refY;
-    speed = (double)
-         (sapiToSurfData->toSdaInfo->toActCenterPosition->speed);
-    if(firstSounding == 0)
-    {
-     lastX = posX;
-     lastY = posY;
-    }
-    if(posX > maxX) maxX = posX;
-    if(posX < minX) minX = posX;
-    if(posY > maxY) maxY = posY;
-    if(posY < minY) minY = posY;
-    if(speed > maxSpeed) maxSpeed = speed;
-    if(speed < minSpeed) minSpeed = speed;
-
-    if(posIsMeter==True)
-    {
-     deltaX = posX - lastX;
-     deltaY = posY - lastY;
-    }
-    else
-    {
-     deltaX = setToPlusMinusPI(posX - lastX);
-     deltaY = setToPlusMinusPI(posY - lastY);
-     deltaY = RAD_TO_METER_Y(deltaY);
-     deltaX = RAD_TO_METER_X(deltaX,lastY);
-    }
-    relWay = relWay + sqrt((deltaX*deltaX) + (deltaY*deltaY));
-    sapiToSurfData->toSdaInfo->toSoundings->relWay = (float)relWay;
-    if(firstSounding == 0)
-    {
-     toGlobalData->modifiedTrackStartX = (float)(posX - refX);
-     toGlobalData->modifiedTrackStartY = (float)(posY - refY);
-    }
-    lastX = posX;
-    lastY = posY;
-
-
-    tide = (double)sapiToSurfData->toSdaInfo->toSoundings->tide;
-
-    roll =
-        (double)sapiToSurfData->toSdaInfo->toSoundings->rollWhileTransmitting;
-    fanParam.pitchTx =
-        (double)sapiToSurfData->toSdaInfo->toSoundings->pitchWhileTransmitting
-       +(double)sapiToSurfData->toGlobalData->offsetPitchFore;
-    fanParam.heaveTx = (double)
-        sapiToSurfData->toSdaInfo->toSoundings->heaveWhileTransmitting;
-    fanParam.ckeel   = (double)
-        sapiToSurfData->toSdaInfo->toSoundings->cKeel;
-    fanParam.cmean   = (double)
-        sapiToSurfData->toSdaInfo->toSoundings->cMean;
-
-    if(roll > maxRoll) maxRoll = roll;
-    if(roll < minRoll) minRoll = roll;
-    if(fanParam.pitchTx > maxPitch) maxPitch = fanParam.pitchTx;
-    if(fanParam.pitchTx < minPitch) minPitch = fanParam.pitchTx;
-    if(fanParam.heaveTx > maxHeave) maxHeave = fanParam.heaveTx;
-    if(fanParam.heaveTx < minHeave) minHeave = fanParam.heaveTx;
-
-    if(toGlobalData->typeOfSounder == 'F')
-    {
-     indexToAngle =
-             (short)sapiToSurfData->toSdaInfo->toSoundings->indexToAngle;
-     toAngles = getSurfAngleTable(sapiToSurfData->toAngleTables,
-                                                   nrBeams,indexToAngle);
-
-     allBeamsDeleted=True;
-     for(beam = 0;beam < nrBeams;beam++)
-     {
-      depthFlag = sapiToSurfData->toSdaInfo->toMultiBeamDepth[beam].depthFlag;
-      if((depthFlag & SB_DELETED) == 0)
-      {
-       allBeamsDeleted=False;
-       fanParam.angle = toAngles->beamAngle[beam];
-       indexToTransducer =
-             (short)sapiToSurfData->toSdaInfo->toSoundings->indexToTransducer;
-       if((sapiToSurfData->toSdaInfo->toMultiBeamDepth[beam].depthFlag & SB_TRANSDUCER_PLUS1) != 0)
-             indexToTransducer++;
-       fanParam.draught = (double)
-         sapiToSurfData->toTransducers[indexToTransducer].transducerDepth;
-       fanParam.transducerOffsetAhead = (double)
-         sapiToSurfData->toTransducers[indexToTransducer].transducerPositionAhead;
-       fanParam.transducerOffsetStar  = (double)
-         sapiToSurfData->toTransducers[indexToTransducer].transducerPositionStar;
-       if(sapiToSurfData->toSdaInfo->toMultiBeamRec != NULL)
-         fanParam.heaveRx = (double)
-               sapiToSurfData->toSdaInfo->toMultiBeamRec[beam].heaveWhileReceiving;
-       else
-         fanParam.heaveRx = 0.0;
-       fanParam.travelTime = (double)
-         sapiToSurfData->toSdaInfo->toMultiBeamTT[beam].travelTimeOfRay;
-
-       if(depthFromTT(&fanParam,isPitchcompensated) == True)
-       {
-        depth=fanParam.depth - tide;
-        sapiToSurfData->toSdaInfo->toMultiBeamDepth[beam].depth = (float)depth;
-        sapiToSurfData->toSdaInfo->toMultiBeamDepth[beam].beamPositionAhead =
-                                                 (float)fanParam.posAhead;
-        sapiToSurfData->toSdaInfo->toMultiBeamDepth[beam].beamPositionStar  =
-                                                 (float)fanParam.posStar;
-        if(depth < minDepth)
-          minDepth = depth;
-        if(depth > maxDepth)
-          maxDepth = depth;
-        if(fanParam.posStar < minBeamPositionStar)
-          minBeamPositionStar = fanParam.posStar;
-        if(fanParam.posStar > maxBeamPositionStar)
-          maxBeamPositionStar = fanParam.posStar;
-        if(fanParam.posAhead < minBeamPositionAhead)
-          minBeamPositionAhead = fanParam.posAhead;
-        if(fanParam.posAhead > maxBeamPositionAhead)
-          maxBeamPositionAhead = fanParam.posAhead;
-        depthStatisticsFound=True;
-       }
-       else
-       {
-        sapiToSurfData->toSdaInfo->toMultiBeamDepth[beam].depthFlag =
-                                                     depthFlag | SB_DELETED;
-       }
-      }
-     } /*for(beam = 0;beam < nrBeams;beam++)*/
-     if(allBeamsDeleted==True)
-     {
-      sapiToSurfData->toSdaInfo->toSoundings->soundingFlag =
-               soundingFlag | SF_DELETED | SF_ALL_BEAMS_DELETED;
-     }
-    } /*if(toGlobalData->typeOfSounder == 'F')*/
-    else
-    {
-     cmean = (double)sapiToSurfData->toSdaInfo->toSoundings->cMean;
-     sapiToSurfData->toSdaInfo->toSoundings->cKeel = (float)cmean;
-     if((sapiToSurfData->toSdaInfo->toSingleBeamDepth->depthFlag & SB_DELETED) == 0)
-     {
-      depth = (double)sapiToSurfData->toSdaInfo->toSingleBeamDepth->depthLFreq;
-      if(depth != 0.0)
-      {
-       if(depth < minDepth)
-          minDepth = depth;
-       if(depth > maxDepth)
-          maxDepth = depth;
-       depthStatisticsFound=True;
-      }
-      depth = (double)sapiToSurfData->toSdaInfo->toSingleBeamDepth->depthMFreq;
-      if(depth != 0.0)
-      {
-       if(depth < minDepth)
-          minDepth = depth;
-       if(depth > maxDepth)
-          maxDepth = depth;
-       depthStatisticsFound=True;
-      }
-      depth = (double)sapiToSurfData->toSdaInfo->toSingleBeamDepth->depthHFreq;
-      if(depth != 0.0)
-      {
-       if(depth < minDepth)
-          minDepth = depth;
-       if(depth > maxDepth)
-          maxDepth = depth;
-       depthStatisticsFound=True;
-      }
-     }
-    }
-   } /*if((soundingFlag & SF_DELETED) == 0)*/
-  } /*for(ii=0;ii<nrSoundings;ii++)*/
-
-  if(depthStatisticsFound==False)
-  {
-   minDepth = maxDepth = 0.0;
-   minBeamPositionStar = maxBeamPositionStar = 0.0;
-   minBeamPositionAhead = maxBeamPositionAhead = 0.0;
-   minX = maxX = minY = maxY = 0.0;
-  }
-
-  toStatistics->minDepth  = (float)minDepth;
-  toStatistics->maxDepth  = (float)maxDepth;
-  toStatistics->minBeamPositionStar  = (float)minBeamPositionStar;
-  toStatistics->maxBeamPositionStar  = (float)maxBeamPositionStar;
-  toStatistics->minBeamPositionAhead  = (float)minBeamPositionAhead;
-  toStatistics->maxBeamPositionAhead  = (float)maxBeamPositionAhead;
-
-  toStatistics->minEasting  = minX;
-  toStatistics->maxEasting  = maxX;
-  toStatistics->minNorthing = minY;
-  toStatistics->maxNorthing = maxY;
-
-  toStatistics->minSpeed=(float)minSpeed;
-  toStatistics->maxSpeed=(float)maxSpeed;
-  toStatistics->minRoll=(float)minRoll;
-  toStatistics->maxRoll=(float)maxRoll;
-  toStatistics->minPitch=(float)minPitch;
-  toStatistics->maxPitch=(float)maxPitch;
-  toStatistics->minHeave=(float)minHeave;
-  toStatistics->maxHeave=(float)maxHeave;
-
-  toGlobalData->modifiedTrackStopX  = (float)(posX - refX);
-  toGlobalData->modifiedTrackStopY  = (float)(posY - refY);
-  toGlobalData->modifiedStartStopDistance = (float)(relWay);
-  toGlobalData->originalTrackStartX = toGlobalData->modifiedTrackStartX;
-  toGlobalData->originalTrackStartY = toGlobalData->modifiedTrackStartY;
-  toGlobalData->originalTrackStopX  = toGlobalData->modifiedTrackStopX;
-  toGlobalData->originalTrackStopY  = toGlobalData->modifiedTrackStopY;
-  toGlobalData->originalStartStopDistance = (float)(relWay);
-  toGlobalData->originalStartStopTime     = relTime;
- }
-}
-
-
-
-
-
-long SAPI_writeBackFromMemory(char* surfDir,char* surfFile,long errorprint)
-{
- char filesix[300];
- char filesda[300];
- XdrSurf ret;
-
- if(sapiToSurfData==NULL)
- {
-  if(errorprint != 0)
-   fprintf(stderr,
-       "SAPI-Error: There is no open SURF-file for writing back !\n");
-  return((long)-1);
- }
-
- if(loadIntoMemory==False)
- {
-  if(errorprint != 0)
-   fprintf(stderr,
-    "SAPI-Error: For writing back you have to open\n     the file with SAPI_openIntoMemory(..)!\n");
-  return((long)-1);
- }
-
- if(access(surfDir,0) != 0)
- {
-  if(errorprint != 0)
-    fprintf(stderr,"SAPI-Error: Can't access path: '%s' !\n",surfDir);
-  return((long)-1);
- }
-
- recalculateData();
-
- if(sapiToSurfData->toFreeText != NULL) free(sapiToSurfData->toFreeText);
- sapiToSurfData->toFreeText =
-        (SurfFreeText*)calloc(1,SIZE_OF_FREE_TEXT_ARRAY(20));
- if(sapiToSurfData->toFreeText != NULL)
- {
-  sapiToSurfData->nrFreeTextUnits=20;
-  sprintf(sapiToSurfData->toFreeText->label,SURF_FREE_TEXT_LABEL);
-  sprintf(sapiToSurfData->toFreeText->blocks[0].text,"%s%s%s",
-                 "@(","#)","This SURF-Dataset was NOT generated by STN-Atlas !");
- }
-
- strncpy(filesix,surfDir,250);
- strcat(filesix,"/");
- strcat(filesix,surfFile);
- strcat(filesix,".six");
-
- strncpy(filesda,surfDir,250);
- strcat(filesda,"/");
- strcat(filesda,surfFile);
- strcat(filesda,".sda");
-
- ret = mem_WriteSdaStructure(filesda,sapiToSurfData);
- if(ret == SURF_SUCCESS)
- {
-  ret = mem_WriteSixStructure(filesix,sapiToSurfData);
-  if(ret != SURF_SUCCESS)
-  {
-   if(errorprint != 0)
-     fprintf(stderr,"SAPI-Error: Can't write back file: '%s' !\n",filesix);
-   return(-1);
-  }
- }
- else
- {
-  if(errorprint != 0)
-    fprintf(stderr,"SAPI-Error: Can't write back file: '%s' !\n",filesda);
-  return(-1);
- }
-
- return((long)0);
-}
-
-
diff --git a/src/surf/sapi_globals.c b/src/surf/sapi_globals.c
deleted file mode 100644
index 4edca13..0000000
--- a/src/surf/sapi_globals.c
+++ /dev/null
@@ -1,230 +0,0 @@
-/*
-/  See README file for copying and redistribution conditions.
-*/
-
-#include <stdio.h>
-#include <stdlib.h>
-#ifdef _WIN32
-#include <string.h>
-#include "types_win32.h"
-#else
-#include <string.h>
-#include <unistd.h>
-#endif
-#include <math.h>
-
-#include "xdr_surf.h"
-#include "mem_surf.h"
-#include "util_surf.h"
-#include "pb_math.h"
-#define  __SAPI__
-#include "mb_sapi.h"
-
-
-
-extern SurfDataInfo*      sapiToSurfData;
-extern SurfSoundingData*  sapiToSdaBlock;
-
-static char sccsid[50] = {"@(#)libsapi.a  Version 3.1 17.10.2001"};
-
-
-/* There are C++ - Compilers, which omit unreferenced statics */
-char* forCCsapi(void)
-{
- return(sccsid);
-}
-
-
-long SAPI_getNrSoundings(void)
-{
- long nrSoundings = 0;
-
- if(sapiToSurfData != NULL) nrSoundings = sapiToSurfData->nrOfSoundings;
- return(nrSoundings);
-}
-
-
-long SAPI_getNrBeams(void)
-{
- long nrBeams = 0;
-
- if(sapiToSurfData != NULL) nrBeams = sapiToSurfData->nrBeams;
- return(nrBeams);
-}
-
-
-long SAPI_posPresentationIsRad(void)
-{
- if(sapiToSurfData != NULL)
- {
-  if(sapiToSurfData->toGlobalData->presentationOfPosition == EASTING_NORTHING)
-    return((long)1);
- }
- return((long)0);
-}
-
-
-char* SAPI_getTypeOfSounder(void)
-{
- static char sounderType[2] = {"?"};
-
- if(sapiToSurfData != NULL) sounderType[0] = sapiToSurfData->toGlobalData->typeOfSounder;
- return(sounderType);
-}
-
-
-char* SAPI_getNameOfSounder(void)
-{
- static char nameOfSounder[20] = {"?"};
-
- if(sapiToSurfData != NULL)
- {
-  strncpy(nameOfSounder,sapiToSurfData->toGlobalData->nameOfSounder,STRING_SIZE);
- }
- return(nameOfSounder);
-}
-
-
-char* SAPI_getNameOfShip(void)
-{
- static char nameOfShip[20] = {"?"};
-
- if(sapiToSurfData != NULL)
- {
-  strncpy(nameOfShip,sapiToSurfData->toGlobalData->shipsName,STRING_SIZE);
- }
- return(nameOfShip);
-}
-
-
-long SAPI_getNrSoundvelocityProfiles(void)
-{
- long nrCProfiles = 0;
-
- if(sapiToSurfData != NULL) nrCProfiles = sapiToSurfData->nrCProfiles;
- return(nrCProfiles);
-}
-
-
-long SAPI_getNrEvents(void)
-{
- long nrEvents = 0;
-
- if(sapiToSurfData != NULL) nrEvents = sapiToSurfData->nrEvents;
- return(nrEvents);
-}
-
-
-long SAPI_getNrPolygonElements(void)
-{
- long nrPolyElements = 0;
-
- if(sapiToSurfData != NULL) nrPolyElements = sapiToSurfData->nrPolyElements;
- return(nrPolyElements);
-}
-
-
-long SAPI_getNrPositionsensors(void)
-{
- long nrPosiSensors = 0;
-
- if(sapiToSurfData != NULL) nrPosiSensors = sapiToSurfData->nrPosiSensors;
- return(nrPosiSensors);
-}
-
-
-long SAPI_dataHaveHighFrequencyLayer(void)
-{
- long layer=0;
- if(sapiToSurfData != NULL)
- {
-  if(sapiToSurfData->toGlobalData->highFrequency > 0.0) layer=1;
- }
- return(layer);
-}
-
-
-long SAPI_dataHaveMediumFrequencyLayer(void)
-{
- long layer=0;
- if(sapiToSurfData != NULL)
- {
-  if(sapiToSurfData->toGlobalData->mediumFrequency > 0.0) layer=1;
- }
- return(layer);
-}
-
-
-long SAPI_dataHaveLowFrequencyLayer(void)
-{
- long layer=0;
- if(sapiToSurfData != NULL)
- {
-  if(sapiToSurfData->toGlobalData->lowFrequency > 0.0) layer=1;
- }
- return(layer);
-}
-
-
-SurfGlobalData* SAPI_getGlobalData(void)
-{
- if(sapiToSurfData == NULL) return(NULL);
- return(sapiToSurfData->toGlobalData);
-}
-
-
-SurfStatistics* SAPI_getStatistics(void)
-{
- if(sapiToSurfData == NULL) return(NULL);
- return(sapiToSurfData->toStatistics);
-}
-
-
-SurfPositionAnySensor* SAPI_getPositionSensor(long nrSensor)
-{
- SurfPositionSensorArray* toSensor;
- long maxNrPosSens = 0;
-
- if(sapiToSurfData == NULL) return(NULL);
- maxNrPosSens = SAPI_getNrPositionsensors();
- if((nrSensor >= 0) && (nrSensor < maxNrPosSens))
- {
-  toSensor = (SurfPositionSensorArray*)sapiToSurfData->toPosiSensors[nrSensor].label;
-  return((SurfPositionAnySensor*)toSensor);
- }
- return(0);
-}
-
-
-SurfEventValues* SAPI_getEvent(long nrEvent)
-{
- long maxNrEvents = 0;
-
- if(sapiToSurfData == NULL) return(NULL);
- maxNrEvents = SAPI_getNrEvents();
- if((nrEvent >= 0) && (nrEvent < maxNrEvents))
- {
-  return(&(sapiToSurfData->toEvents->values[nrEvent]));
- }
- return(NULL);
-}
-
-
-SurfPolygons* SAPI_getPolygons(void)
-{
- if(sapiToSurfData == NULL) return(NULL);
- return(sapiToSurfData->toPolygons);
-}
-
-
-
-double SAPI_getAbsoluteStartTimeOfProfile(void)
-{
- SurfTm sTm;
-
- if(sapiToSurfData == NULL) return(0.0);
- surf_timeSizetoSurfTm(sapiToSurfData->toGlobalData->startTimeOfProfile,&sTm);
- return(surf_timeAbsoluteFromSurfTm (&sTm));
-}
-
-
diff --git a/src/surf/sapi_simple.c b/src/surf/sapi_simple.c
deleted file mode 100644
index cd988f7..0000000
--- a/src/surf/sapi_simple.c
+++ /dev/null
@@ -1,173 +0,0 @@
-/*
-/  See README file for copying and redistribution conditions.
-*/
-
-#include <stdio.h>
-#include <stdlib.h>
-#ifdef _WIN32
-#include <string.h>
-#include "types_win32.h"
-#else
-#include <string.h>
-#include <unistd.h>
-#endif
-#include <math.h>
-
-
-#include "xdr_surf.h"
-#include "mem_surf.h"
-#include "util_surf.h"
-#include "pb_math.h"
-#define  __SAPI__
-#include "mb_sapi.h"
-
-
-
-extern SurfDataInfo*      sapiToSurfData;
-extern SurfSoundingData*  sapiToSdaBlock;
-
-
-
-long SAPI_getXYZfromMultibeamSounding(long beam,long depthOverChartZero,
-                                      double* north,double* east,double* depth)
-{
- u_short soundingFlag,beamFlag;
- double posX,posY,heading,posAhead,posAstar,refPosX,refPosY;
- double myDepth,dynChartZero,chartZero;
- double cosHeading,sinHeading,xM,yM;
- SdaInfo* sapiToSdaInfo = NULL;
-
- if(sapiToSurfData != NULL) sapiToSdaInfo = sapiToSurfData->toSdaInfo;
- if(sapiToSdaInfo == NULL) return(-1);
- if(sapiToSdaInfo->toMultiBeamDepth == NULL) return(-1);
- if((beam >= 0) && (beam<SAPI_getNrBeams()))
- {
-  soundingFlag = (u_short)sapiToSdaInfo->toSoundings->soundingFlag;
-  if((soundingFlag & SF_DELETED) != 0) return(-1);
-  beamFlag = (u_short)sapiToSdaInfo->toMultiBeamDepth[beam].depthFlag;
-  if((beamFlag & (SB_DELETED+SB_DEPTH_SUPPRESSED+SB_REDUCED_FAN)) != 0) return(-1);
-
-  myDepth = (double)sapiToSdaInfo->toMultiBeamDepth[beam].depth;
-  posAhead = (double)sapiToSdaInfo->toMultiBeamDepth[beam].beamPositionAhead;
-  posAstar = (double)sapiToSdaInfo->toMultiBeamDepth[beam].beamPositionStar;
-  if(depthOverChartZero != 0)
-  {
-   chartZero = (double)sapiToSurfData->toGlobalData->chartZero;
-   dynChartZero = (double)sapiToSdaInfo->toSoundings->dynChartZero;
-   myDepth = myDepth + chartZero + dynChartZero;
-  }
-  heading = (double)sapiToSdaInfo->toSoundings->headingWhileTransmitting;
-  refPosX = sapiToSurfData->toGlobalData->referenceOfPositionX;
-  refPosY = sapiToSurfData->toGlobalData->referenceOfPositionY;
-
-  posX = (double)sapiToSdaInfo->toCenterPositions[0].centerPositionX + refPosX;
-  posY = (double)sapiToSdaInfo->toCenterPositions[0].centerPositionY + refPosY;
-
-  cosHeading = cos(heading);
-  sinHeading = sin(heading);
-  xM = (posAhead*sinHeading) + (posAstar * cosHeading);
-  yM = (posAhead*cosHeading) - (posAstar * sinHeading);
-  if(SAPI_posPresentationIsRad() != 0) /* rad-Presentation */
-  {
-   yM = M_TO_RAD_Y(yM);
-   xM = M_TO_RAD_X(xM,posY);
-  }
-  *east  = posX + xM;
-  *north  = posY + yM;
-  *depth  = myDepth;
-  return(0);
- }
- return(-1);
-}
-
-
-
-
-static long SAPI_getXYZfromSinglebeamSounding(char layer,long depthOverChartZero,
-                                              double* north,double* east,double* depth)
-{
- u_short soundingFlag,beamFlag;
- double posX,posY,refPosX,refPosY;
- double myDepth,dynChartZero,chartZero;
- SdaInfo* sapiToSdaInfo = NULL;
-
- if(sapiToSurfData != NULL) sapiToSdaInfo = sapiToSurfData->toSdaInfo;
- if(sapiToSdaInfo == NULL) return(-1);
- if(sapiToSdaInfo->toSingleBeamDepth == NULL) return(-1);
-
- soundingFlag = (u_short)sapiToSdaInfo->toSoundings->soundingFlag;
- if((soundingFlag & SF_DELETED) != 0) return(-1);
- beamFlag = (u_short)sapiToSdaInfo->toSingleBeamDepth->depthFlag;
- if((beamFlag & (SB_DELETED+SB_DEPTH_SUPPRESSED)) != 0) return(-1);
-
- switch(layer)
- {
-  case 'H':
-        myDepth = (double)sapiToSdaInfo->toSingleBeamDepth->depthHFreq;
-        break;
-  case 'M':
-        myDepth = (double)sapiToSdaInfo->toSingleBeamDepth->depthMFreq;
-        break;
-  case 'L':
-        myDepth = (double)sapiToSdaInfo->toSingleBeamDepth->depthLFreq;
-        break;
-  default:
-        myDepth = 0.0;
-        break;
- }
- if(depthOverChartZero != 0)
- {
-  chartZero = (double)sapiToSurfData->toGlobalData->chartZero;
-  dynChartZero = (double)sapiToSdaInfo->toSoundings->dynChartZero;
-  myDepth = myDepth + chartZero + dynChartZero;
- }
- refPosX = sapiToSurfData->toGlobalData->referenceOfPositionX;
- refPosY = sapiToSurfData->toGlobalData->referenceOfPositionY;
-
- posX = (double)sapiToSdaInfo->toCenterPositions[0].centerPositionX + refPosX;
- posY = (double)sapiToSdaInfo->toCenterPositions[0].centerPositionY + refPosY;
-
- *east  = posX;
- *north  = posY;
- *depth  = myDepth;
- return(0);
-}
-
-
-long SAPI_getXYZfromSinglebeamSoundingHF(long depthOverChartZero,
-                                         double* north,double* east,double* depth)
-{
- SdaInfo* sapiToSdaInfo = NULL;
-
- if(sapiToSurfData != NULL) sapiToSdaInfo = sapiToSurfData->toSdaInfo;
- if(sapiToSdaInfo == NULL) return(-1);
- if(SAPI_dataHaveHighFrequencyLayer()==0) return(-1);
- return(SAPI_getXYZfromSinglebeamSounding('H',depthOverChartZero,north,east,depth));
-}
-
-
-long SAPI_getXYZfromSinglebeamSoundingMF(long depthOverChartZero,
-                                         double* north,double* east,double* depth)
-{
- SdaInfo* sapiToSdaInfo = NULL;
-
- if(sapiToSurfData != NULL) sapiToSdaInfo = sapiToSurfData->toSdaInfo;
- if(sapiToSdaInfo == NULL) return(-1);
- if(SAPI_dataHaveMediumFrequencyLayer()==0) return(-1);
- return(SAPI_getXYZfromSinglebeamSounding('M',depthOverChartZero,north,east,depth));
-}
-
-
-long SAPI_getXYZfromSinglebeamSoundingLF(long depthOverChartZero,
-                                         double* north,double* east,double* depth)
-{
- SdaInfo* sapiToSdaInfo = NULL;
-
- if(sapiToSurfData != NULL) sapiToSdaInfo = sapiToSurfData->toSdaInfo;
- if(sapiToSdaInfo == NULL) return(-1);
- if(SAPI_dataHaveLowFrequencyLayer()==0) return(-1);
- return(SAPI_getXYZfromSinglebeamSounding('L',depthOverChartZero,north,east,depth));
-}
-
-
-
diff --git a/src/surf/surf.h b/src/surf/surf.h
deleted file mode 100644
index aaaa346..0000000
--- a/src/surf/surf.h
+++ /dev/null
@@ -1,1136 +0,0 @@
-/*-----------------------------------------------------------------------
-/ H E A D E R K O P F
-/ ------------------------------------------------------------------------
-/ ------------------------------------------------------------------------
-/  DATEINAME        : surf.h     Version 3.0
-/  ERSTELLUNGSDATUM : 29.07.93
-/ ----------------------------------------------------------------------*/
-/*!
-/ ------------------------------------------------------------------------
-/ COPYRIGHT (C) 1993: ATLAS ELEKTRONIK GMBH, 28305 BREMEN
-/ ------------------------------------------------------------------------
-/
-/  See README file for copying and redistribution conditions.
-/
-/
-/ HIER/SACHN: P: RP ____ _ ___ __
-/ BENENNUNG :
-/ ERSTELLER : Peter Block    : SAS3
-/ FREIGABE  : __.__.__  GS__
-/ AEND/STAND: __.__.__  __
-/ PRUEFVERM.:
-*/
-
-/*
-/ SPRACHE          : UNIX-C
-/ COMPILER         : Silicon Graphix
-/ BETRIEBSSYSTEM   : IRIX
-/ HARDWARE-UMGEBUNG: SGI Crimson
-/ URSPRUNGSHINWEIS :
-/
-/ ------------------------------------------------------------------------
-/ BESCHREIBUNG:       Definitions describing the "SURF-Format" V2.0
-/ ------------------------------------------------------------------------
-/
-/ ------------------------------------------------------------------------
-/ E N D E   D E S   K O P F E S
-/ ------------------------------------------------------------------------
-*/
-/************************************************************************/
-
-
-
-
-#ifndef _SURF
-#define _SURF
-
-#ifndef SURF20
-#define SURF20
-#endif
-
-#ifndef SURF30
-#define SURF30
-#endif
-
-#ifdef _WIN32
-#include "xdr_win32.h"
-#else
-#include <rpc/types.h>
-#include <rpc/xdr.h>
-#endif
-/*
-#include "strings_surf.h"
-*/
-/*
-   time/date-sets are presented in ASCII-Characters
-      DDMMYYHHMMSS.NN<0x0>
-   name-strings and Label-strings are presented in
-   c-string-annotation    ABCDEFG<0x0>
-*/
-
-#define LABEL_SIZE          16
-#define STRING_SIZE         16
-#define TIME_SIZE           16
-#define TEXT_SIZE           80
-
-
-/* if number of sets or contents are modified ,
-   you should update VERSION !!! */
-
-
-#define SURF_VERSION "SURF V3.0"
-
-#define SURF_VERS3_0 "SURF V3.0"
-#define SURF_VERS2_0 "SURF V2.0"
-
-
-/***************************************/
-/*                                     */
-/* SURF-elements describing SIX-files  */
-/*                                     */
-/***************************************/
-
-
-
-/* datatypes of different SURF-datasets */
-
-   /* marker types */
-
-#define      MIN_M          -4
-#define      EOD_M          -4
-#define      NROF_M         -3
-#define      SDA_M          -2
-#define      SIX_M          -1
-
-   /* six types */
-
-#define      DESCRIPTOR      1
-#define      GLOBALDATA      2
-#define      STATISTICS      3
-#define      POSITIONSENSORS 4
-#define      TRANSDUCERPARAM 5
-#define      BEAMANGLE       6
-#define      CPROFILE        7
-#define      AREAPOLYGON     8
-#define      EVENTS          9
-#define      FREETEXT       10
-#define      ADDSTATISTICS  11
-#define      TPESTATICS     12
-#define      FREESIXDESCR   13
-#define      FREESNDGDESCR  14
-#define      FREEBEAMDESCR  15
-#define      SIXATTDATA     16
-#define      VENDORTEXT     17
-#define      CPROFTPES      18
-#define      MAXSIX         18
-
-   /* sda types */
-
-#define      MINSDA          40
-#define      SOUNDING        40
-#define      CENTERPOSITION  41
-#define      SINGLEBEAMDEPTH 42
-#define      MULTIBEAMDEPTH  43
-#define      MULTIBEAMTT     44
-#define      MULTIBEAMRECV   45
-#define      SIGNALPARMS     46
-#define      SIGNALAMPLITUDE 47  /* wird nicht mehr benutzt V2.0 */
-#define      BEAMAMPLITUDES  48
-#define      EXTBEAMAMPLI    49
-#define      SIDESCANDATA    50
-#define      TXPARMS         51
-#define      POSITIONCEP     52
-#define      MULTITPES       53
-#define      SINGLETPES      54
-#define      SNDGATTDATA     55
-#define      BEAMATTDATA     56
-#define      MAXSDA          56
-
-   /* nrof types */
-
-#define      MAX_NROF_BEAMS_PER_TABLE          80
-#define      MAX_NROF_CPROFILES_PER_TABLE      81
-#define      MAX_NROF_POLYGONS_PER_TABLE       82
-#define      MAX_NROF_EVENTS                   83
-#define      MAX_NROF_FREE_TEXT_BLOCKS         84
-#define      MAX_NROF_SIDESCAN_DATA            85
-#define      NROF_RX_TVG_SETS                  86
-#define      NROF_TX_TVG_SETS                  87
-#define      MAX_NR_OF_TYPES                   87
-
-#ifdef __LP64__
-#define SURF_U_LONG unsigned int
-#else
-#define SURF_U_LONG unsigned long
-#endif
-
-
-/* SURF-dataset "Descriptor" */
-
-#define SURF_DESCRIPTOR_LABEL SURF_VERSION
-
-typedef short SurfMarkerDescriptor;
-
-typedef struct
-            {
-              short       typ        ;
-              SURF_U_LONG nr         ;
-            } SurfSixDescriptor;
-
-typedef struct
-            {
-              short       typ        ;
-              SURF_U_LONG nr         ;
-            } SurfSdaDescriptor;
-
-typedef struct
-            {
-              short       typ        ;
-              SURF_U_LONG nr         ;
-            } SurfNrofDescriptor;
-
-typedef struct
-            {
-              char                  label    [LABEL_SIZE]          ;
-              SurfMarkerDescriptor  six                            ;
-              SurfSixDescriptor     descriptor                     ;
-              SurfSixDescriptor     globalData                     ;
-              SurfSixDescriptor     statistics                     ;
-              SurfSixDescriptor     positionSensor                 ;
-              SurfSixDescriptor     transducer                     ;
-              SurfSixDescriptor     angleTab                       ;
-              SurfSixDescriptor     cProfile                       ;
-              SurfSixDescriptor     polygon                        ;
-              SurfSixDescriptor     events                         ;
-              SurfSixDescriptor     freeText                       ;
-              SurfSixDescriptor     addStatistics                  ;   /* new V3.0 */
-              SurfSixDescriptor     tpeStatics                     ;   /* new V3.0 */
-              SurfSixDescriptor     cprofTpes                      ;   /* new V3.0 */
-              SurfSixDescriptor     freeSixDescr                   ;   /* new V3.0 */
-              SurfSixDescriptor     freeSndgDescr                  ;   /* new V3.0 */
-              SurfSixDescriptor     freeBeamDescr                  ;   /* new V3.0 */
-              SurfSixDescriptor     freeSixAttData                 ;   /* new V3.0 */
-              SurfSixDescriptor     vendorText                     ;   /* new V3.0 */
-
-              SurfMarkerDescriptor  sda                            ;
-              SurfSdaDescriptor     soundings                      ;
-              SurfSdaDescriptor     centerPositions                ;
-              SurfSdaDescriptor     singleBeamDepth                ;
-              SurfSdaDescriptor     multiBeamDepth                 ;
-              SurfSdaDescriptor     multiBeamTT                    ;
-              SurfSdaDescriptor     multiBeamRecv                  ;
-              SurfSdaDescriptor     signalParams                   ;
-              SurfSdaDescriptor     signalAmplitudes               ;/* wird ab V2.0 nicht mehr benutzt*/
-              SurfSdaDescriptor     beamAmplitudes                 ;
-              SurfSdaDescriptor     extendBeamAmplitudes           ;
-              SurfSdaDescriptor     sidescanData                   ;
-              SurfSdaDescriptor     txParams                       ;
-              SurfSdaDescriptor     positionCpes                   ;   /* new V3.0 */
-              SurfSdaDescriptor     multiTpeParams                 ;   /* new V3.0 */
-              SurfSdaDescriptor     singleTpeParams                ;   /* new V3.0 */
-              SurfSdaDescriptor     sndgAttData                    ;   /* new V3.0 */
-              SurfSdaDescriptor     beamAttData                    ;   /* new V3.0 */
-
-              SurfMarkerDescriptor  nrof                           ;
-              SurfNrofDescriptor    maxNrOfBeams                   ;
-              SurfNrofDescriptor    maxNrOfCProfileElements        ;
-              SurfNrofDescriptor    maxNrOfPolygonElements         ;
-              SurfNrofDescriptor    maxNrOfEvents                  ;
-              SurfNrofDescriptor    maxNrOfFreeTextBlocks          ;
-              SurfNrofDescriptor    maxNrOfSidescanData            ;
-              SurfNrofDescriptor    nrOfRxTvgSets                  ;
-              SurfNrofDescriptor    nrOfTxTvgSets                  ;
-
-              SurfMarkerDescriptor  eod                            ;
-            } SurfDescriptor;
-
-
-
-
-
-/* SURF-dataset "Globaldata" */
-
-  /* Values of 'typeOfSounder' */
-
-#define MANUAL_DATA              'M'
-#define DIGITIZED_DATA           'D'
-#define VERTICAL_SOUNDER         'V'
-#define BOMA_TYPE_SOUNDER        'B'
-#define FAN_TYPE_SOUNDER         'F'
-
-#define DENSITY_TYPE_SOUNDER     'Z'
-
-
-  /* Values of 'presentationOfPosition' */
-
-#define EASTING_NORTHING         'E' /* Values will be scaled in [rad] */
-#define X_Y                      'X' /* Values will be scaled in [m]   */
-
-/* correctedParameterFlags */
-
-#define CP_TIDE_CORRECTED          1
-#define CP_DRAUGHT_CORRECTED       2
-#define CP_COURSE_MANIPULATED      4
-#define CP_HEAVE_MANIPULATED       8
-#define CP_ROLL_MANIPULATED       16
-#define CP_PITCH_MANIPULATED      32
-#define CP_CKEEL_MANIPULATED      64
-#define CP_CMEAN_MANIPULATED     128
-#define CP_SLOPE_KORRECTED       256
-#define CP_REDUCED_RAW_DATA      512 /* Data from .P-files , etc. */
-#define CP_SQUAT_CORRECTED      1024
-#define CP_HEAVE_COMPENSATED    2048
-
-
-#define SURF_GLOBAL_DATA_LABEL "GLOBALDATA"
-
-typedef struct
-            {
-              char    label                      [LABEL_SIZE];
-              char    shipsName                 [STRING_SIZE];
-              char    startTimeOfProfile          [TIME_SIZE];
-              char    regionOfProfile           [STRING_SIZE];
-              char    numberOfProfile           [STRING_SIZE];
-              float   chartZero                              ;  /* rel. NN*/
-              float   tideZero                               ;  /* rel. NN*/
-              SURF_U_LONG  numberOfMeasuredSoundings              ;
-              SURF_U_LONG  actualNumberOfSoundingSets             ;
-              char    timeDateOfTideModification  [TIME_SIZE];
-              char    timeDateOfDepthModification [TIME_SIZE];
-              char    timeDateOfPosiModification  [TIME_SIZE];
-              char    timeDateOfParaModification  [TIME_SIZE];
-              SURF_U_LONG  correctedParameterFlags                ;
-              float   offsetHeave                            ;
-              float   offsetRollPort                         ;
-              float   offsetRollStar                         ;
-              float   offsetPitchFore                        ;
-              float   offsetPitchAft                         ;
-              char    nameOfSounder             [STRING_SIZE];
-              char    typeOfSounder                          ;
-              float   highFrequency                          ;
-              float   mediumFrequency                        ;
-              float   lowFrequency                           ;
-              char    nameOfEllipsoid           [STRING_SIZE];
-              double  semiMajorAxis                          ;
-              double  flattening                             ;
-              char    projection                [STRING_SIZE];
-              char    presentationOfPosition                 ;
-              double  referenceMeridian                      ;
-              double  falseEasting                           ;
-              double  falseNorthing                          ;
-              double  referenceOfPositionX                   ;
-              double  referenceOfPositionY                   ;
-              char    presentationOfRelWay                   ;
-                /* 'p' = projection , 'l' = lineintegral */
-              float   planedTrackStartX                      ;
-              float   planedTrackStartY                      ;
-              float   planedTrackStopX                       ;
-              float   planedTrackStopY                       ;
-              float   originalTrackStartX                    ;
-              float   originalTrackStartY                    ;
-              float   originalTrackStopX                     ;
-              float   originalTrackStopY                     ;
-              float   originalStartStopDistance              ;
-              double  originalStartStopTime                  ;
-              char    timeDateOfTrackModification [TIME_SIZE];
-              float   modifiedTrackStartX                    ;
-              float   modifiedTrackStartY                    ;
-              float   modifiedTrackStopX                     ;
-              float   modifiedTrackStopY                     ;
-              float   modifiedStartStopDistance              ;
-            } SurfGlobalData;
-
-
-
-
-
-/* SURF-dataset "Statistics" */
-
-#define SURF_STATISTICS_LABEL "STATISTICS"
-
-typedef struct
-            {
-              char    label              [LABEL_SIZE];
-              double  minNorthing                    ;
-              double  maxNorthing                    ;
-              double  minEasting                     ;
-              double  maxEasting                     ;
-              float   minSpeed                       ;
-              float   maxSpeed                       ;
-              float   minRoll                        ;
-              float   maxRoll                        ;
-              float   minPitch                       ;
-              float   maxPitch                       ;
-              float   minHeave                       ;
-              float   maxHeave                       ;
-              float   minBeamPositionStar            ;
-              float   maxBeamPositionStar            ;
-              float   minBeamPositionAhead           ;
-              float   maxBeamPositionAhead           ;
-              float   minDepth                       ;
-              float   maxDepth                       ;
-            } SurfStatistics;
-
-
-
-
-/* SURF-dataset "Additional Statistics" */           /* new V3.0 */
-
-#define SURF_ADD_STATISTICS_LABEL "ADD_STATISTICS"
-
-typedef struct
-            {
-              double  variation                      ;
-              double  pointDistance                  ;
-              double  maxAstar                       ;
-              double  dFuture                        ;
-              u_short isReduced                      ;
-              u_short fromBeam                       ;
-              u_short toBeam                         ;
-              u_short reduceOuterBeams               ;
-            } SurfReductionParameters;
-
-
-typedef struct
-            {
-              double  depthMinDepth                  ;
-              double  depthMaxDepth                  ;
-              double  depthSlopeOver2                ;
-              double  depthSlopeOver3                ;
-              u_short depthHasParams                 ;
-              u_short depthFilterAhead               ;
-              u_short depthFilterAcross              ;
-              u_short posHasParams                   ;
-              double  posFilterRadius                ;
-              double  posMaxCourseChange             ;
-              double  dFuture1                       ;
-              double  dFuture2                       ;
-            } SurfLastFilterParameters;
-
-
-typedef struct
-            {
-              char    label[LABEL_SIZE]              ;
-              SURF_U_LONG  flag;
-              SURF_U_LONG  nrNotDeletedDepth              ;
-              SURF_U_LONG  nrNotReducedDepth              ;
-              SURF_U_LONG  nrNotDeletedSoundings          ;
-              SurfReductionParameters   redParm      ;
-              SurfLastFilterParameters  filterParm   ;
-              char    serverReduction[TEXT_SIZE]     ;
-              double  dFuture[10]                    ;
-              u_short iFuture[8]                     ;
-            } SurfAddStatistics;
-
-
-
-
-
-/* SURF-dataset "Positionsensors" */
-
-#define SURF_POSITION_SENSOR_LABEL "POSITIONSENSORS"
-#define UNION_SIZE 200
-
-typedef struct
-            {
-              char    label                       [LABEL_SIZE];
-              char    positionSensorName         [STRING_SIZE];
-              char    sensorUnion                 [UNION_SIZE];
-            } SurfPositionSensorArray;
-
-
-    /*  Now special Sensors */
-
-
-    /*  Overlayed Polarfix-Set  */
-
-#define POLARFIX "POLARFIX"
-
-typedef struct
-            {
-              char    label                       [LABEL_SIZE];
-              char    positionSensorName         [STRING_SIZE];
-              float   polarfixLocationX                       ;
-              float   polarfixLocationY                       ;
-              float   polarfixLocationZ                       ;
-              float   polarfixReferenceX                      ;
-              float   polarfixReferenceY                      ;
-              float   polarfixReferenceZ                      ;
-              float   polarfixReferenceDistance               ;
-              float   polarfixReferenceAngle                  ;
-              char    timeOfLastPolarfixEdit       [TIME_SIZE];
-              float   polarfixEditLocationX                   ;
-              float   polarfixEditLocationY                   ;
-              float   polarfixEditLocationZ                   ;
-              float   polarfixEditReferenceX                  ;
-              float   polarfixEditReferenceY                  ;
-              float   polarfixEditReferenceZ                  ;
-              float   polarfixEditReferenceDistance           ;
-              float   polarfixEditReferenceAngle              ;
-              float   polarfixAntennaPositionAhead            ;
-              float   polarfixAntennaPositionStar             ;
-              float   polarfixAntennaPositionHeight           ;
-            } SurfPositionPolarfix;
-
-    /*  other overlayed Sets */
-
-#define UNKNOWNPOSSENS   "UNKNOWN"
-#define INAV             "INTEGRATED NAV"
-#define SYLEDIS          "SYLEDIS"
-#define MNS2000          "MNS2000"
-#define GPS              "GPS"
-#define EPIRB            "EPIRB"
-
-typedef struct
-            {
-              char    label                       [LABEL_SIZE];
-              char    positionSensorName         [STRING_SIZE];
-              float   none1                                   ;
-              float   none2                                   ;
-              float   none3                                   ;
-              float   none4                                   ;
-              float   none5                                   ;
-              float   none6                                   ;
-              float   none7                                   ;
-              float   none8                                   ;
-              char    time9                        [TIME_SIZE];
-              float   none10                                  ;
-              float   none11                                  ;
-              float   none12                                  ;
-              float   none13                                  ;
-              float   none14                                  ;
-              float   none15                                  ;
-              float   none16                                  ;
-              float   none17                                  ;
-              float   sensorAntennaPositionAhead              ;
-              float   sensorAntennaPositionStar               ;
-              float   sensorAntennaPositionHeight             ;
-            } SurfPositionAnySensor;
-
-
-
-
-
-
-/* SURF-dataset "Multibeam-Angle-Table" */
-
-#define SURF_MULTIBEAM_ANGLE_LABEL "MULTIBEAMANGLES"
-
-typedef struct
-            {
-              char              label    [LABEL_SIZE];
-              u_short actualNumberOfBeams            ;
-              float   beamAngle                   [1]; /*numberOfBeams times*/
-            } SurfMultiBeamAngleTable;
-
-#define SIZE_OF_SURF_MULTIBEAM_ANGLE_TAB(MAX_NR_OF_BEAMS) \
-        (MAX_NR_OF_BEAMS == 0)?\
-        0\
-        :\
-        (sizeof(SurfMultiBeamAngleTable) + \
-        ((MAX_NR_OF_BEAMS - 1) * sizeof(float)))
-
-
-
-/* SURF-dataset "Transducer Parameters" */
-
-#define SURF_TRANSDUCER_TABLE_LABEL "TRANSDUCERTABLE"
-
-typedef struct
-            {
-              char              label    [LABEL_SIZE];
-              float   transducerDepth                ;
-              float   transducerPositionAhead        ;
-              float   transducerPositionStar         ;
-              float   transducerTwoThetaHFreq        ;
-              float   transducerTwoThetaMFreq        ;
-              float   transducerTwoThetaLFreq        ;
-            } SurfTransducerParameterTable;
-
-
-
-
-
-
-/* SURF-dataset "C-profile-tables" */
-
-#define SURF_C_PROFILE_LABEL "C_PROFILES"
-
-typedef struct
-            {
-               float  depth                          ;
-               float  cValue                         ;
-            } CProfileValues;
-
-
-typedef struct
-            {
-              char              label    [LABEL_SIZE];
-              float             relTime              ;
-              u_short           numberOfActualValues ;
-              CProfileValues    values            [1];
-            } SurfCProfileTable;
-
-#define SIZE_OF_SURF_C_PROFILE_TAB(MAX_NR_OF_PROFILES) \
-        (MAX_NR_OF_PROFILES == 0)?\
-        0\
-        :\
-        (sizeof(SurfCProfileTable) + \
-        ((MAX_NR_OF_PROFILES - 1) * sizeof(CProfileValues)))
-
-
-
-
-/* SURF-dataset "C-profile-TPE-Values" */
-
-#define SURF_C_PROFILE_TPE_LABEL "C_PROFILE_TPES"
-
-typedef struct
-            {
-              char              label    [LABEL_SIZE];
-              float             cpTpes            [1];
-            } SurfCProfileTpeTable;
-
-#define SIZE_OF_SURF_C_PROFILE_TPE_TAB(MAX_NR_OF_PROFILES) \
-        (MAX_NR_OF_PROFILES == 0)?\
-        0\
-        :\
-        (sizeof(SurfCProfileTpeTable) + \
-        ((MAX_NR_OF_PROFILES - 1) * sizeof(float)))
-
-
-
-
-
-
-/* SURF-dataset "Polygon" */
-
-#define SURF_POLYGONS_LABEL "POLYGON"
-
-typedef struct
-            {
-              double  polygonX                       ;
-              double  polygonY                       ;
-            } SurfPolygonValues;
-
-typedef struct
-            {
-              char              label    [LABEL_SIZE];
-              SurfPolygonValues values            [1];
-            } SurfPolygons;
-
-#define SIZE_OF_SURF_POLYGON_ARRAY(NR_OF_POLYGONS) \
-        (NR_OF_POLYGONS == 0)?\
-        0\
-        :\
-        (sizeof(SurfPolygons) + \
-        ((NR_OF_POLYGONS - 1) * sizeof(SurfPolygonValues)))
-
-
-
-
-
-
-/* SURF-dataset "Events " */
-
-#define SURF_EVENT_LABEL "EVENTS"
-#define EVENT_SIZE 84
-
-typedef struct
-            {
-              double  positionX                      ;
-              double  positionY                      ;
-              float   relTime                        ;
-              char    text[EVENT_SIZE]               ;
-            } SurfEventValues;
-
-typedef struct
-            {
-              char              label    [LABEL_SIZE];
-              SurfEventValues   values            [1];
-            } SurfEvents;
-
-#define SIZE_OF_SURF_EVENT_ARRAY(NR_OF_EVENTS) \
-        (NR_OF_EVENTS == 0)?\
-        0\
-        :\
-        (sizeof(SurfEvents) + \
-        ((NR_OF_EVENTS - 1) * sizeof(SurfEventValues)))
-
-
-
-
-
-
-/* SURF-dataset "Static Values for Tpe-Calculation" */           /* new V3.0 */
-/* RAN-Special !! */
-
-#define SURF_TPE_STATICS_LABEL "TPE_STATICS"
-
-typedef enum {
-              TPE_NEVERCALCULATED,
-              TPE_MUSTRECALCULATE,
-              TPE_ISCALCULATED
-             }TpeFlag;
-
-
-typedef struct
-            {
-              char    label    [LABEL_SIZE];
-              SURF_U_LONG  tpeFlag                        ;
-              char    timeDateOfLastTpeCalculation[TIME_SIZE];
-              double  ltncyHprMb                     ;
-              double  ltncyNavHss                    ;
-              double  initRoll                       ;
-              double  initPtch                       ;
-              double  initHve                        ;
-              double  initYaw                        ;
-              double  rollRateC                      ;
-              double  ptchRateC                      ;
-              double  hveRateC                       ;
-              double  yawRateC                       ;
-              double  lvrml                          ;
-              double  lvrmw                          ;
-              double  lvrmh                          ;
-              double  shpFctr                        ;
-              double  bwx                            ;
-              double  bwy                            ;
-              double  tmtDurn                        ;
-              double  dTide                          ;
-              double  Ss                             ;
-              double  detect                         ;
-              double  Ts                             ;
-              double  svTrns                         ;
-              double  reserve1                       ;
-              double  reserve2                       ;
-              double  reserve3                       ;
-              double  reserve4                       ;
-            } SurfTpeStatics;
-
-
-
-
-
-/* SURF-dataset "Free Six Data Descriptor"  */         /* new V3.0 */
-
-typedef struct
-            {
-              char    descr[STRING_SIZE]          ;
-            } SurfFreeSixDataDescr;
-
-#define SIZE_OF_SURF_SIX_ATTACHED_DESCR(NR_OF_SIX_ATTACHED_DATA) \
-            (NR_OF_SIX_ATTACHED_DATA == 0)?\
-            0\
-            :\
-            (sizeof(SurfFreeSixDataDescr) + \
-            ((NR_OF_SIX_ATTACHED_DATA - 1) * sizeof(SurfFreeSixDataDescr)))
-
-
-
-
-
-/* SURF-dataset "Free Sounding Data Descriptor"  */    /* new V3.0 */
-
-typedef struct
-            {
-              char    descr[STRING_SIZE]          ;
-            } SurfFreeSndgDataDescr;
-
-#define SIZE_OF_SURF_SNDG_ATTACHED_DESCR(NR_OF_SNDG_ATTACHED_DATA) \
-            (NR_OF_SNDG_ATTACHED_DATA == 0)?\
-            0\
-            :\
-            (sizeof(SurfFreeSndgDataDescr) + \
-            ((NR_OF_SNDG_ATTACHED_DATA - 1) * sizeof(SurfFreeSndgDataDescr)))
-
-
-
-
-
-
-/* SURF-dataset "Free Beam Data Descriptor"  */        /* new V3.0 */
-
-typedef struct
-            {
-              char    descr[STRING_SIZE]          ;
-            } SurfFreeBeamDataDescr;
-
-#define SIZE_OF_SURF_BEAM_ATTACHED_DESCR(NR_OF_BEAM_ATTACHED_DATA) \
-            (NR_OF_BEAM_ATTACHED_DATA == 0)?\
-            0\
-            :\
-            (sizeof(SurfFreeBeamDataDescr) + \
-            ((NR_OF_BEAM_ATTACHED_DATA - 1) * sizeof(SurfFreeBeamDataDescr)))
-
-
-
-
-
-
-/* SURF-dataset "Free SixAttached Data"  */           /* new V3.0 */
-
-typedef double SurfFreeSixAttachedData;
-
-#define SIZE_OF_SURF_SIX_ATTACHED_DATA(NR_OF_SIX_ATTACHED_DATA) \
-            (NR_OF_SIX_ATTACHED_DATA == 0)?\
-            0\
-            :\
-            (sizeof(SurfFreeSixAttachedData) + \
-            ((NR_OF_SIX_ATTACHED_DATA - 1) * sizeof(SurfFreeSixAttachedData)))
-
-
-
-
-
-
-/* SURF-dataset "Free Text " */
-
-#define SURF_FREE_TEXT_LABEL "FREETEXT"
-#define FREE_TEXT_BLOCK_SIZE        4
-
-typedef struct
-            {
-              char    text[FREE_TEXT_BLOCK_SIZE]               ;
-            } SurfFreeTextBlocks;
-
-typedef struct
-            {
-              char              label    [LABEL_SIZE];
-              SurfFreeTextBlocks blocks[1];
-            } SurfFreeText;
-
-#define SIZE_OF_FREE_TEXT_ARRAY(NR_OF_FREE_TEXT_BLOCKS) \
-        (NR_OF_FREE_TEXT_BLOCKS == 0)?\
-        0\
-        :\
-        (sizeof(SurfFreeText) + \
-        ((NR_OF_FREE_TEXT_BLOCKS - 1) * sizeof(SurfFreeTextBlocks)))
-
-
-
-
-
-
-/* SURF-dataset " Vendor Text " */
-
-typedef struct
-            {
-              char    text[TEXT_SIZE]               ;
-            } SurfVendorText;
-
-
-
-
-
-/***************************************/
-/*                                     */
-/* SURF-elements describing SDA-files  */
-/*                                     */
-/***************************************/
-
-
-
-
-/* SURF-dataset "Sounding-Data" */
-
-  /* soundingFlag */
-
-#define SF_DELETED                 1
-#define SF_COURSE_MANIPULATED      2
-#define SF_HEAVE_MANIPULATED       4
-#define SF_ROLL_MANIPULATED        8
-#define SF_PITCH_MANIPULATED      16
-#define SF_CKEEL_MANIPULATED      32
-#define SF_CMEAN_MANIPULATED      64
-#define SF_SLOPE_KORRECTED       128
-#define SF_FAN_PAT_1             256 /* 0 = full fan; 1 = split fan */
-#define SF_FAN_PAT_2             512 /* 0 = port fan; 1 = star  fan */
-#define SF_FAN_PAT_3            1024 /* 0 = norm.fan; 1 = ahead fan */
-#define SF_ALL_BEAMS_DELETED    2048
-
-/* FAN pattern */
-
-#define SF_FAN_PAT_MASK         (SF_FAN_PAT_1+SF_FAN_PAT_2)
-
-#define SF_FULL_FAN             0
-#define SF_PORT_FAN             (SF_FAN_PAT_1)
-#define SF_STAR_FAN             (SF_FAN_PAT_1+SF_FAN_PAT_2)
-
-
-typedef struct
-            {
-              u_short soundingFlag                   ;
-              u_short indexToAngle                   ;
-              u_short indexToTransducer              ;
-              u_short indexToCProfile                ;
-              float   relTime                        ;
-              float   relWay                         ;
-              float   tide                           ;
-              float   headingWhileTransmitting       ;
-              float   heaveWhileTransmitting         ;
-              float   rollWhileTransmitting          ;
-              float   pitchWhileTransmitting         ;
-              float   cKeel                          ;
-              float   cMean                          ;
-              float   dynChartZero                   ;
-            } SurfSoundingData;
-
-
-
-/* SURF-dataset "Free SoundingAttached Data"  */             /* new V3.0 */
-
-typedef float SurfFreeSoundingAttachedData;
-
-#define SIZE_OF_SURF_SNDG_ATTACHED_DATA(NR_OF_SNDG_ATTACHED_DATA) \
-            (NR_OF_SNDG_ATTACHED_DATA == 0)?\
-            0\
-            :\
-            (sizeof(SurfFreeSoundingAttachedData) + \
-            ((NR_OF_SNDG_ATTACHED_DATA - 1) * sizeof(SurfFreeSoundingAttachedData)))
-
-
-
-
-
-  /* positionFlag */
-
-#define PF_DELETED                 1
-
-
-
-/* SURF-dataset "Center-Position" */
-
-typedef struct
-            {
-              u_short positionFlag                   ;
-              float   centerPositionX                ;
-              float   centerPositionY                ;
-              float   speed                          ;
-            } SurfCenterPosition;
-
-
-
-
-/* SURF-dataset "Position-Cep"  */                    /* new V3.0 */
-
-typedef float SurfPositionCepData;
-
-
-
-
-
-/* SURF-dataset "Single-Beam-Depth" */
-
-/* depthFlag */
-#define SB_DELETED                 1
-#define SB_OBJECT                  2
-#define SB_FRAC_LINE               4
-#define SB_MAN_DATA                8
-#define SB_TIDE_CORRECTED         16
-#define SB_TIDE_MANIPULATED       32
-#define SB_POSI_MANIPULATED       64
-#define SB_DEPTH_MANIPULATED     128 /* Multibeam  */
-#define SB_H_DEPTH_MANIPULATED   128 /* Singlebeam */
-#define SB_M_DEPTH_MANIPULATED   256 /*     "      */
-#define SB_L_DEPTH_MANIPULATED   512 /*     "      */
-#define SB_DRAUGHT_CORRECTED    1024
-#define SB_DEPTH_SUPPRESSED     2048
-#define SB_REDUCED_FAN          4096 /* Multibeam  */
-#define SB_TRANSDUCER_PLUS1     8192 /* Multibeam  */
-
-typedef struct
-            {
-              u_short depthFlag                      ;
-              float   travelTimeOfRay                ;
-              float   depthHFreq                     ;
-              float   depthMFreq                     ;
-              float   depthLFreq                     ;
-            } SurfSingleBeamDepth;
-
-
-
-
-/* SURF-dataset "Multi-Beam-Depth" */
-
-typedef struct
-            {
-              u_short depthFlag                      ;
-              float   depth                          ;
-              float   beamPositionAhead              ;
-              float   beamPositionStar               ;
-            } SurfMultiBeamDepth;
-
-
-
-
-/* SURF-dataset "Multi-Beam-Travel-Time" */
-
-typedef struct
-            {
-              float   travelTimeOfRay                ;
-            } SurfMultiBeamTT;
-
-
-
-
-/* SURF-dataset "Multi-Beam-Receive" */
-
-typedef struct
-            {
-              float   headingWhileReceiving          ;
-              float   heaveWhileReceiving            ;
-            } SurfMultiBeamReceive;
-
-
-
-
-/* SURF-dataset "Beam-Amplitudes" */                    /* new V2.0 */
-
-typedef struct
-            {
-              u_short beamAmplitude                  ;  /* new V2.0 */
-            } SurfAmplitudes;
-
-
-
-
-/* SURF-dataset "Extended-Beam-Amplitudes" */           /* new V2.0 */
-
-typedef struct
-            {
-              float   mtau                           ;  /* new V2.0 */
-              u_short nis                            ;
-              u_short beamAmplitude                  ;
-            } SurfExtendedAmplitudes;
-
-
-
-
-/* SURF-dataset "Free Beamattached Data"  */            /* new V3.0 */
-
-typedef float SurfFreeBeamAttachedData;
-
-#define SIZE_OF_SURF_BEAM_ATTACHED_DATA(NR_OF_BEAM_ATTACHED_DATA) \
-            (NR_OF_BEAM_ATTACHED_DATA == 0)?\
-            0\
-            :\
-            (sizeof(SurfFreeBeamAttachedData) + \
-            ((NR_OF_BEAM_ATTACHED_DATA - 1) * sizeof(SurfFreeBeamAttachedData)))
-
-
-
-/* SURF-dataset "RxSignalparameter" */                 /* new V2.0 */
-
-typedef struct
-            {
-             float time;               /* scale : sec  */
-             float gain;               /* scale : dB */
-            }TvgRxSets;
-
-typedef struct
-            {
-             u_short bscatClass                     ;/* new V2.2 */
-             u_short nrActualGainSets               ;
-             float   rxGup                          ;
-             float   rxGain                         ;
-             float   ar                             ;
-             TvgRxSets rxSets[1]                    ;
-            } SurfSignalParameter;
-
-#define SIZE_OF_SURF_SIGNAL_PARAMETER(NR_OF_SETS) \
-        (NR_OF_SETS == 0)?\
-        0\
-        :\
-        (sizeof(SurfSignalParameter) + \
-        ((NR_OF_SETS - 1) * sizeof(TvgRxSets)))
-
-
-
-
-/* SURF-dataset "TxSignalparameter" */              /* new V2.2 */
-
-typedef struct
-            {
-             SURF_U_LONG txBeamIndex   ;  /* Code of external Beamshapetab */
-             float  txLevel       ;  /* scale : dB rel 1 uPa */
-             float  txBeamAngle   ;  /* scale : rad */
-             float  pulseLength   ;  /* scale : sec */
-            }TxSets;
-
-typedef struct
-            {
-             TxSets  txSets[1]                      ;  /* new V2.0 */
-            } SurfTxParameter;
-
-#define SIZE_OF_SURF_TX_PARAMETER(NR_OF_SETS) \
-        (NR_OF_SETS == 0)?\
-        0\
-        :\
-        ((NR_OF_SETS) * sizeof(TxSets))
-
-
-
-
-/* SURF-dataset "Signalamplitudes"  */
-        /* wird nicht mehr benutzt ab V2.0 */
-
-typedef struct
-            {
-              u_short amplitudesFlag                 ;
-              u_short actualNrOfAmplitudes           ;
-              float   maxAmplPosAstar                ;
-              u_char  amplitudes[1]                  ;
-            } SurfSignalAmplitudes;
-
-
-#define SIZE_OF_SURF_SIGNAL_AMPLITUDES_ARRAY(NR_OF_AMPLITUDES) \
-        (NR_OF_AMPLITUDES == 0)?\
-        0\
-        :\
-        (sizeof(SurfSignalAmplitudes) + \
-        ((NR_OF_AMPLITUDES - 1) * sizeof(u_char)))
-
-
-/* SURF-dataset "Sidescandata"  */
-
-typedef struct
-            {
-              SURF_U_LONG  sidescanFlag                   ;  /* new V2.0 */
-              u_short actualNrOfSsDataPort           ;
-              u_short actualNrOfSsDataStb            ;
-              float   minSsPosPort                   ;
-              float   minSsPosStb                    ;
-              float   maxSsPosPort                   ;
-              float   maxSsPosStb                    ;
-              u_char  ssData[1]                      ;
-            } SurfSidescanData;
-
-
-#define SIZE_OF_SURF_SIDESCAN_DATA_ARRAY(NR_OF_AMPLITUDES) \
-        (NR_OF_AMPLITUDES == 0)?\
-        0\
-        :\
-        (sizeof(SurfSidescanData) + \
-        ((NR_OF_AMPLITUDES - 1) * sizeof(u_char)))
-
-
-
-
-/* SURF-dataset "TPE-values"  */                         /* new V3.0 */
-
-typedef struct
-            {
-              float   depthTpe                       ;
-              float   posTpe                         ;
-              float   minDetectionVolumeTpe          ;
-            } SurfTpeValues;
-
-typedef SurfTpeValues SurfMultiBeamTpeValues;
-
-typedef SurfTpeValues SurfSingleBeamTpeValues;
-
-
-
-
-
-#endif /* ifndef _SURF */
diff --git a/src/surf/types_win32.h b/src/surf/types_win32.h
deleted file mode 100644
index 00ccf71..0000000
--- a/src/surf/types_win32.h
+++ /dev/null
@@ -1,9 +0,0 @@
-#ifndef _TYPES_WIN32
-#define _TYPES_WIN32
-
-typedef unsigned long  u_long;
-typedef unsigned short u_short;
-typedef unsigned int   u_int;
-typedef unsigned char  u_char;
-
-#endif
diff --git a/src/surf/util_surf.c b/src/surf/util_surf.c
deleted file mode 100644
index bc047c7..0000000
--- a/src/surf/util_surf.c
+++ /dev/null
@@ -1,793 +0,0 @@
-/*-----------------------------------------------------------------------
-/ P R O G R A M M K O P F
-/ ------------------------------------------------------------------------
-/ ------------------------------------------------------------------------
-/  DATEINAME        : util_surf.c
-/  ERSTELLUNGSDATUM : 13.08.93
-/ ------------------------------------------------------------------------
-/
-/ ------------------------------------------------------------------------
-/ COPYRIGHT (C) 1993: ATLAS ELEKTRONIK GMBH, 28305 BREMEN
-/ ------------------------------------------------------------------------
-/
-/  See README file for copying and redistribution conditions.
-/
-/
-/ HIER/SACHN: P: RP ____ _ ___ __
-/ BENENNUNG :
-/ ERSTELLER : Peter Block    : SAS3
-/ FREIGABE  : __.__.__  GS__
-/ AEND/STAND: __.__.__  __
-/ PRUEFVERM.:
-*/
-
-/*
-/ SPRACHE          : UNIX-C
-/ COMPILER         : Silicon Graphix
-/ BETRIEBSSYSTEM   : IRIX
-/ HARDWARE-UMGEBUNG: SGI Crimson
-/ URSPRUNGSHINWEIS :
-/
-/ ------------------------------------------------------------------------
-/ PROGRAMMBESCHREIBUNG:
-/ ------------------------------------------------------------------------
-/
-/    Utility-LIBRARY-Functions for SURF-presentation V2.0
-/
-/ ------------------------------------------------------------------------
-/ NAME, STRUKTUR UND KURZBESCHREIBUNG DER EINGABEPARAMETER:
-/ ------------------------------------------------------------------------
-/
-/    see mem_surf.h & util_surf.h
-/
-/ ------------------------------------------------------------------------
-/ NAME, STRUKTUR UND KURZBESCHREIBUNG DER AUSGABEPARAMETER:
-/ ------------------------------------------------------------------------
-/
-/    see mem_surf.h & util_surf.h
-/
-/ ------------------------------------------------------------------------
-/ VERHALTEN IM FEHLERFALL:
-/ ------------------------------------------------------------------------
-/
-/    see mem_surf.h & util_surf.h
-/
-/ ------------------------------------------------------------------------
-/ E N D E   D E S   P R O G R A M M K O P F E S
-/ ------------------------------------------------------------------------
-*/
-/* ***********************************************************************
-*                                                                        *
-*  BEGINN DES DEKLARATIONSTEILS                                          *
-*                                                                        *
-*********************************************************************** */
-
-
-#define _UTIL_SURF
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "xdr_surf.h"
-#include "mem_surf.h"
-#include "util_surf.h"
-
-
-/* ***********************************************************************
-*                                                                        *
-*  ENDE DES DEKLARATIONSTEILS                                            *
-*                                                                        *
-*********************************************************************** */
-
-static char sccsid[50] = {"@(#)libsurf.a  Version 3.1 15.12.1998"};
-
-
-/* There are C++ - Compilers, which omit unreferenced statics */
-char* forCCsurf(void)
-{
- return(sccsid);
-}
-
-
-
-
-
-/************************************************************
-*************************************************************
-*                                                           *
-*  Funktionen zur Manipulationen im SDA-Thread              *
-*                                                           *
-*                                                           *
-*************************************************************
-************************************************************/
-
-
-/************************************************************
-*                                                           *
-*  Setzen des Threadindex an eine 'mode' entsprechende      *
-*  Stelle im SDA-Thread und update des Pointerarrays        *
-*  auf diese Thread-Position                                *
-*                                                           *
-************************************************************/
-
-
-MoveInSdaThread surf_moveInSdaThread(SurfDataInfo* toSurfDataInfo,
-                                ModeMoveInSdaThread mode,
-                                u_long        nrOfSteps )
-                           
-{                          
- SurfSdaThread* toThread;
- u_long index,ii;
-
- index = toSurfDataInfo->activeThreadIndex;   
- ii = toSurfDataInfo->nrOfSoundings - 1;
- switch(mode)
- {
-   case BACK_ONE_STEP :
-           if(index == 0) 
-           {
-             return(END_OF_THREAD);
-           }
-           index --;
-           break;
-           
-   case FORE_ONE_STEP :
-           if(index >= ii)
-           {
-             return(END_OF_THREAD);
-           }
-           index ++;
-           break; 
-           
-   case BACK_X_STEPS:
-           if(index == 0) 
-           {
-             return(END_OF_THREAD);
-           }
-           if(index < nrOfSteps)
-           {
-             index = 0;
-           }
-           else
-           {
-             index = index - nrOfSteps;
-           }
-           break;
-           
-   case FORE_X_STEPS:
-           if(index >= ii)
-           {
-             return(END_OF_THREAD);
-           }
-           if(((long)(ii-index)) < (long)nrOfSteps)
-           {
-             index = ii;
-           }
-           else
-           {
-             index = index + nrOfSteps;
-           }
-           break;
-
-   case ABS_POSITION     :
-           if(nrOfSteps > ii)
-           {
-             index = ii;
-           }
-           else
-           {
-             index = nrOfSteps;
-           }
-           break;
-           
-   case HALF_WAY_ABS     :
-           index = ii/2;
-           break;
-           
-   case BACK_HALF_WAY_REL:
-           index = index /2;
-           break;
-           
-   case FORE_HALF_WAY_REL:
-           index = index + ((ii-index)/2);
-           break;
-           
-   case TO_START:
-           index = 0;
-           break;
-           
-   case TO_END:   
-           index = ii; 
-           break;
-           
-   default:
-           return(END_OF_THREAD);
- }
- 
- toSurfDataInfo->activeThreadIndex = index;   
- toThread = toSurfDataInfo->toSdaThread;
- setPointersInSdaInfo(toThread->thread[index].sounding,
-                      toSurfDataInfo->toSdaInfo);
- return(STEP_DONE);
-}
-
-
-
-
-
-/************************************************************
-*                                                           *
-*  Retten eines SDA-Blocks bevor Daten manipuliert werden   *
-*                                                           *
-*                                                           *
-************************************************************/
-
-
-XdrSurf surf_backupSdaBlock(SurfDataInfo* toSurfDataInfo) 
-{                          
- SurfSdaThread* toThread;
- SdaInfo* toSdaInfo;
- SurfSoundingData* toSdaBlock;
- SurfSoundingData* toSaveSdaBlock;
- u_long index;
-
- index = toSurfDataInfo->activeThreadIndex;   
- toThread  = toSurfDataInfo->toSdaThread;
- toSdaInfo = toSurfDataInfo->toSdaInfo;
- toSdaBlock = toThread->thread[index].sounding;
- toSaveSdaBlock = toThread->thread[index].saveSounding;
-
- if(toSaveSdaBlock == NULL)
- {
-  toSaveSdaBlock = (SurfSoundingData*)calloc(1,toSdaInfo->allS);
-  if(toSaveSdaBlock == NULL)
-  {
-   return(SURF_CANT_GET_MEMORY);
-  }
-  memcpy(toSaveSdaBlock,toSdaBlock,toSdaInfo->allS);
-  toThread->thread[index].saveSounding = toSaveSdaBlock;
- }
- 
- return(SURF_SUCCESS);
-}
-
-
-
-
-
-/************************************************************
-*                                                           *
-*  Verwerfen der Manipulation eines SDA-Blocks              *
-*                                                           *
-*                                                           *
-************************************************************/
-
-
-void surf_restoreSdaBlock(SurfDataInfo* toSurfDataInfo) 
-{                          
- SurfSdaThread* toThread;
- SdaInfo*  toSdaInfo;
- SurfSoundingData* toSdaBlock;
- SurfSoundingData* toSaveSdaBlock;
- u_long index;
-
- index = toSurfDataInfo->activeThreadIndex;   
- toThread  = toSurfDataInfo->toSdaThread;
- toSdaInfo = toSurfDataInfo->toSdaInfo;
- toSdaBlock = toThread->thread[index].sounding;
- toSaveSdaBlock = toThread->thread[index].saveSounding;
-
- if(toSaveSdaBlock != NULL)
- {
-  toThread->thread[index].sounding = toSaveSdaBlock;
-  toThread->thread[index].saveSounding = NULL;
-  free(toSdaBlock);
- }
-}
-
-
-
-
-
-/************************************************************
-*                                                           *
-*  Einfuegen eines neuen SDA-Blocks (je nach 'where' vor    *
-*    oder hinter die aktuelle Position) und fuellen des     *
-*    neuen Datenblocks mit den Daten an der akt. Position.  *
-*  Die akt. Position steht anscliessend auf dem neuen Block *
-*                                                           *
-************************************************************/
-
-
-XdrSurf surf_insertNewSdaBlockAtActualPosition(SurfDataInfo* toSurfDataInfo,
-                                               SDAinsertMode where) 
-{                          
- SurfSdaThread* toThread;
- SurfSdaThread* toNewThread;
- SdaInfo* toSdaInfo;
- SurfSoundingData* toSdaBlock;
- SurfSoundingData* toNewSdaBlock;
- u_long index,newBlockIndex,oldLengthOfThread,newLengthOfThread,ii;
-
- index = toSurfDataInfo->activeThreadIndex;   
- toThread  = toSurfDataInfo->toSdaThread;
- toSdaInfo = toSurfDataInfo->toSdaInfo;
- toSdaBlock = toThread->thread[index].sounding;
- oldLengthOfThread = toSurfDataInfo->nrOfSoundings;
- newLengthOfThread = oldLengthOfThread + 1;
-
- /* allocate the necessary memory */
- 
- toNewSdaBlock = (SurfSoundingData*)calloc(1,toSdaInfo->allS);
- if(toNewSdaBlock == NULL)
- {
-  return(SURF_CANT_GET_MEMORY);
- }
- toNewThread = (SurfSdaThread*)
-                   calloc((u_int)newLengthOfThread,sizeof(SurfSdaThreadElement));
- if(toNewThread == NULL)
- {
-  free(toNewSdaBlock);
-  return(SURF_CANT_GET_MEMORY);
- }
-
- /* fill the new Block with Data */
- 
- memcpy(toNewSdaBlock,toSdaBlock,toSdaInfo->allS);
-
- /* fill the thread - structure */
- 
- for(ii=0;ii<=index;ii++)
- {
-  memcpy(&(toNewThread->thread[ii].sounding),
-         &(toThread->thread[ii].sounding),sizeof(SurfSdaThreadElement));
- }
- for(ii=index;ii<oldLengthOfThread;ii++)
- {
-  memcpy(&(toNewThread->thread[ii+1].sounding),
-         &(toThread->thread[ii].sounding),sizeof(SurfSdaThreadElement));
- }
-
- switch (where)
- {
-  case INSERT_BEFOR_ACT_POS:
-     newBlockIndex = index;
-     index++;
-     break;
-
-  case INSERT_AFTER_ACT_POS:
-     newBlockIndex = index+1;
-     break;
-
-  default:
-     break;
- }
- 
- toNewThread->thread[newBlockIndex].sounding = toNewSdaBlock;
- toNewThread->thread[newBlockIndex].saveSounding = NULL;
- toNewThread->thread[newBlockIndex].flag         = INSERTED_BLOCK;
- 
- free(toThread);
-
- toSurfDataInfo->activeThreadIndex = newBlockIndex;   
- toSurfDataInfo->toSdaThread = toNewThread;
- toSurfDataInfo->nrOfSoundings = newLengthOfThread;
- 
- return(SURF_SUCCESS);
-}
-
-
-
-
-
-
-
-
-/************************************************************
-*************************************************************
-*                                                           *
-*  Funktionen zur Zeit-Darstellung in Surf                  *
-*                                                           *
-*                                                           *
-*************************************************************
-************************************************************/
-
-/************************************************************
-*                                                           *
-*  erzeugt aus ASCII-Text in 'TIME_SIZE' Structure          *
-*                fuer SurfTimeDate                          *
-*                                                           *
-************************************************************/
-
-
-
-void surf_timeSizetoTimeDate(char* timeSize,SurfTimeDate* timeDate)
-{
- u_short ii,jj;
-
- jj=0; 
- for(ii=0;ii<(u_short)6;ii++)
- {
-  if((ii==2) || (ii==4))
-  {
-   timeDate->date[jj]='.';
-   jj++;
-  }
-  timeDate->date[jj] = timeSize[ii];
-  jj++;
- }
- timeDate->date[jj] = 0; /* cstring !! */
-
- jj=0; 
- for(ii=6;ii<(u_short)12;ii++)
- {
-  if((ii==8) || (ii==10))
-  {
-   timeDate->time[jj] = ':';
-   jj++;
-  }
-  timeDate->time[jj] = timeSize[ii];
-  jj++;
- }
- timeDate->time[jj] = 0; /* cstring !! */
-}
-
-
-
-/************************************************************
-*                                                           *
-*  erzeugt aus ASCII-Text in 'TIME_SIZE' Structure          *
-*      Darstellung in 'SurfTm'                              *
-*                                                           *
-************************************************************/
-
-
-int twoDigitsToInt (char* timeSize,u_short where)
-{
- return(((timeSize[where] - '0') * 10) + (timeSize[where+1] - '0'));
-}
-
-
-void surf_timeSizetoSurfTm(char* timeSize,SurfTm* surfTm)
-{
- u_int year,month,day,switchCount,daySince1970;
-
- /* hour,minute,second,secfrac */
- 
- surfTm->fractionalSeconds = twoDigitsToInt(timeSize,13);
- surfTm->tmTime.tm_sec     = twoDigitsToInt(timeSize,10);
- surfTm->tmTime.tm_min     = twoDigitsToInt(timeSize,8);
- surfTm->tmTime.tm_hour    = twoDigitsToInt(timeSize,6);
-
- /* day,month,year */
-
- day                       = twoDigitsToInt(timeSize,0);
- surfTm->tmTime.tm_mday    = day;
- month                     = twoDigitsToInt(timeSize,2);
- surfTm->tmTime.tm_mon     = month - 1;                      
- year                      = twoDigitsToInt(timeSize,4);
- if (year<70) year = year + 100;
- surfTm->tmTime.tm_year    = year;
-
- switch(month)
- {
-  case 12:
-          day=day+30;
-  case 11:
-          day=day+31;
-  case 10:
-          day=day+30;
-  case  9:
-          day=day+31;
-  case  8:
-          day=day+31;
-  case  7:
-          day=day+30;
-  case  6:
-          day=day+31;
-  case  5:
-          day=day+30;
-  case  4:
-          day=day+31;
-  case  3:
-          day=day+28;
-  case  2:
-          day=day+31;
-  default:
-          break;
- }
-
- switchCount = (year >> 2) - 17;     /* alle 4 jahre 1 Schalttag,
-                                        17 Schalttage von 1900->1970 */
- daySince1970 = day + switchCount + ((year-70)*365);
- if((year%4) == 0)                   /* aktuelles jahr = Schaltjahr */
- {
-  if(month > 2)
-    day++;        /* Der aktuelle Schalttag wurde noch nicht bruecksichtigt */
-  else
-    daySince1970--; /* Ein Schalttag zuviel berechnet */ 
- }                                        
-
- surfTm->tmTime.tm_yday    = day -1;
- surfTm->tmTime.tm_wday    = (daySince1970 + 4)%7; /* der 1.1.1970 war ein
-                                                      Donnerstag => 4 */
- surfTm->tmTime.tm_isdst   = 0;
-}
-
-
-
-
-/************************************************************
-*                                                           *
-*  erzeugt aus ASCII-Text in 'TIME_SIZE' Structure          *
-*      Darstellung als "long" fuer HDB                      *
-*                                                           *
-************************************************************/
-
-
-long surf_timeSizeToInt(char* timeSize)
-{
- char buffer[20];
-
- strncpy(buffer,timeSize,10);
- buffer[6] = 0;
- return(atol(buffer));
-}
-
-
-
-
-
-/************************************************************
-*                                                           *
-*  ergaenzt eine Darstellung in 'SurfTm' um den Julian Day  *
-*                                                           *
-************************************************************/
-
-
-void surf_putJulianDayIntoTm(SurfTm* surfTm)
-{
- int year,month,day;
-
- /* day,month,year */
-
- day =  surfTm->tmTime.tm_mday-1;
- month = surfTm->tmTime.tm_mon + 1;                      
- year = surfTm->tmTime.tm_year;
-
- switch(month)
- {
-  case 12:
-          day=day+30;
-  case 11:
-          day=day+31;
-  case 10:
-          day=day+30;
-  case  9:
-          day=day+31;
-  case  8:
-          day=day+31;
-  case  7:
-          day=day+30;
-  case  6:
-          day=day+31;
-  case  5:
-          day=day+30;
-  case  4:
-          day=day+31;
-  case  3:
-          day=day+28;
-  case  2:
-          day=day+31;
-  default:
-          break;
- }
-
-
- if((year%4) == 0)                   /* aktuelles jahr = Schaltjahr */
- {
-  if(month > 2)
-    day++;        /* Der aktuelle Schalttag wurde noch nicht bruecksichtigt */
- }                                        
- 
- surfTm->tmTime.tm_yday    = day;
-}
-
-
-
-
-
-/************************************************************
-*                                                           *
-*  erzeugt aus Darstellung in 'SurfTm'                      *
-*              ASCII-Text in 'TIME_SIZE' Structure          *
-*                                                           *
-************************************************************/
-
-
-void intToTwoDigitsInSurfTime (char* timeSize,u_short where,int what)
-{
-  timeSize[where]    = (char)(what/10) + '0';
-  timeSize[where+1]  = (char)(what%10) + '0';
-}
-
-
-void surf_surfTmToTimeSize(char* timeSize,SurfTm* surfTm)
-{
- int year;
-
- /* hour,minute,second,secfrac */
- 
- intToTwoDigitsInSurfTime(timeSize,13,surfTm->fractionalSeconds);
- intToTwoDigitsInSurfTime(timeSize,10,surfTm->tmTime.tm_sec );
- intToTwoDigitsInSurfTime(timeSize, 8,surfTm->tmTime.tm_min );
- intToTwoDigitsInSurfTime(timeSize, 6,surfTm->tmTime.tm_hour);
-
- /* day,month,year */
-
- intToTwoDigitsInSurfTime(timeSize,0,surfTm->tmTime.tm_mday);
- intToTwoDigitsInSurfTime(timeSize,2,surfTm->tmTime.tm_mon + 1 );
- year = surfTm->tmTime.tm_year;
- if (year >= 100) year = year - 100;
- intToTwoDigitsInSurfTime(timeSize,4,year);
- timeSize[12] = '.';
- timeSize[15] = 0;
-}
-
-
-
-
-/************************************************************
-*                                                           *
-*  erzeugt aus ASCII-Text in 'TIME_SIZE' Structure          *
-*      Tageszeit in Sekunden   (SurfTime - Format)          *
-*                                                           *
-************************************************************/
-
-
-
-SurfTime surf_timeOfTheDayFromTimeSize (char* timeSize)
-{
- SurfTime ret;
- int fracSec,sec,min,hour;
-  
- /* hour,minute,second,secfrac */
- 
- fracSec = twoDigitsToInt(timeSize,13);
- sec     = twoDigitsToInt(timeSize,10);
- min     = twoDigitsToInt(timeSize,8);
- hour    = twoDigitsToInt(timeSize,6);
-
- ret = ((SurfTime)(fracSec)  / 100.0)
-     + ((SurfTime)(sec    )         )
-     + ((SurfTime)(min    ) *   60.0)
-     + ((SurfTime)(hour   ) * 3600.0);
-  
- return((SurfTime) ret);
-}
-
-
-
-
-
-/************************************************************
-*                                                           *
-*  erzeugt aus 'SurfTm'                                     *
-*      Tageszeit in Sekunden   (SurfTime - Format)          *
-*                                                           *
-************************************************************/
-
-
-
-SurfTime surf_timeOfTheDayFromSurfTm (SurfTm* surfTm)
-{
- SurfTime ret;
-  
- ret = ((SurfTime)(surfTm->fractionalSeconds)  / 100.0)
-     + ((SurfTime)(surfTm->tmTime.tm_sec    )         )
-     + ((SurfTime)(surfTm->tmTime.tm_min    ) *   60.0)
-     + ((SurfTime)(surfTm->tmTime.tm_hour   ) * 3600.0);
-  
- return(ret);
-}
-
-
-
-
-
-/************************************************************
-*                                                           *
-*  erzeugt aus 'SurfTm'                                     *
-*     absolute Zeit in Sekunden   (SurfTime - Format)       *
-*                                                           *
-************************************************************/
-
-
-
-SurfTime surf_timeAbsoluteFromSurfTm (SurfTm* surfTm)
-{
- SurfTime ret;
- int year,switchDays;
-
- surf_putJulianDayIntoTm(surfTm);
-  
- ret = surf_timeOfTheDayFromSurfTm (surfTm);
- ret = ret + ((SurfTime)(surfTm->tmTime.tm_yday) * 24.0 * 3600.0 );
-
- year  = surfTm->tmTime.tm_year;
- switchDays = (year/4) - 17;
- if((year%4) == 0)
-            switchDays--; 
- year  = year - 70 ;
-
- ret = ret + ((SurfTime)(switchDays)   * 24.0 * 3600.0 );
- ret = ret + ((SurfTime)(year) * 365.0 * 24.0 * 3600.0 );
- 
- return((SurfTime) ret);
-}
-
-
-
-/************************************************************
-*                                                           *
-*  erzeugt die Differenz in Sekunden aus zwei Zeiten in     *
-*     einer Darstellung in 'SurfTm'                         *
-*     unter Beruecksichtigung der Sekunden-Bruchteile       *
-*                                                           *
-************************************************************/
-
-
-SurfTime surf_difftime (SurfTm* later,SurfTm* earlier)
-{
- SurfTime ret,laterTime,earlierTime;
-
- laterTime   = surf_timeAbsoluteFromSurfTm (later);
- earlierTime = surf_timeAbsoluteFromSurfTm (earlier);
-
- ret = laterTime - earlierTime;
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             [...]
- return((SurfTime) ret);
-}
-
-
-
-
-
-void surf_setVendorText(SurfDataInfo* toSurfData)
-{
-#ifdef _WIN32
- static SurfVendorText vendorText =
- {{"This SURF-Dataset is generated by STN-Atlas utilities !" }};
-
- toSurfData->toVendorText = &vendorText;
- toSurfData->nrOfVendorText = 1;
-#else
- SurfVendorText* toVendorText=NULL;
- static SurfVendorText vendorText =
- {{"This SURF-Dataset is generated by STN-Atlas utilities !" }};
-
- toVendorText=(SurfVendorText*)calloc(1,sizeof(SurfVendorText));
- if(toVendorText != NULL)
- {
-  strcpy(toVendorText->text,vendorText.text);
-  toSurfData->toVendorText = toVendorText;
-  toSurfData->nrOfVendorText = 1;
- } 
-#endif
-}
-
-
-
-
-
-/*********************************************************************
-*         H I S T O R I E
-**********************************************************************
-*  Edition  History
-*   date    comments                                            by
-* --------  ------------------------------------------------ ---------
-* 13-08-93  created                                             pb
-* 21-10-93  new: surf_timeSizeToInt                             pb
-* 13-06-95  neue Version 2.0 (Sidescan-Backscatter)             pb
-*********************************************************************/
diff --git a/src/surf/util_surf.h b/src/surf/util_surf.h
deleted file mode 100644
index ae2814f..0000000
--- a/src/surf/util_surf.h
+++ /dev/null
@@ -1,208 +0,0 @@
-/*-----------------------------------------------------------------------
-/ H E A D E R K O P F
-/ ------------------------------------------------------------------------
-/ ------------------------------------------------------------------------
-/  DATEINAME        : util_surf.h
-/  ERSTELLUNGSDATUM : 09.08.93
-/ ----------------------------------------------------------------------*/
-/*!
-/ ------------------------------------------------------------------------
-/ COPYRIGHT (C) 1993: ATLAS ELEKTRONIK GMBH, 28305 BREMEN
-/ ------------------------------------------------------------------------
-/
-/
-/  See README file for copying and redistribution conditions.
-/
-/ HIER/SACHN: P: RP ____ _ ___ __
-/ BENENNUNG :
-/ ERSTELLER : Peter Block    : SAS3
-/ FREIGABE  : __.__.__  GS__
-/ AEND/STAND: __.__.__  __
-/ PRUEFVERM.:
-*/
-
-/*
-/ SPRACHE          : UNIX-C
-/ COMPILER         : Silicon Graphix
-/ BETRIEBSSYSTEM   : IRIX
-/ HARDWARE-UMGEBUNG: SGI Crimson
-/ URSPRUNGSHINWEIS :
-/
-/ ------------------------------------------------------------------------
-/ BESCHREIBUNG:
-/ ------------------------------------------------------------------------
-/
-/ ------------------------------------------------------------------------
-/ E N D E   D E S   K O P F E S
-/ ------------------------------------------------------------------------
-*/
-/************************************************************************/
-
-#ifndef _util_surf_h
-#define _util_surf_h
-
-#include <time.h>        
-
-
-/* Return-Vals of moveInSdaThread */
-
-enum _MoveInSdaThread {
-                        STEP_DONE     ,
-                        END_OF_THREAD  
-                      }; 
-typedef enum _MoveInSdaThread MoveInSdaThread;
-
-
-
-
-/* operating-mode of stepInSdaThread */
-
-enum _ModeMoveInSdaThread {
-                            FORE_ONE_STEP       ,
-                            BACK_ONE_STEP       ,
-                            FORE_X_STEPS        ,
-                            BACK_X_STEPS        ,
-                            ABS_POSITION        ,
-                            HALF_WAY_ABS        ,
-                            BACK_HALF_WAY_REL   ,
-                            FORE_HALF_WAY_REL   ,
-                            TO_START            ,
-                            TO_END               
-                          }; 
-typedef enum _ModeMoveInSdaThread ModeMoveInSdaThread;
-
-
-
-/* operating-mode of surf_insertNewSdaBlockAtActualPosition */
-
-enum _SDAinsertMode {
-                      INSERT_AFTER_ACT_POS,
-                      INSERT_BEFOR_ACT_POS 
-                    }; 
-typedef enum _SDAinsertMode SDAinsertMode;
-
-
-
-
-/************************************************************
-*                                                           *
-*  relative Zeiten werden im Format 'SurfTime' in           *
-*          Sekunden dargestellt                             *
-*                                                           *
-************************************************************/
-
-
-typedef double SurfTime;
-
-typedef struct {
-                char date[10];
-                char time[10];
-               }SurfTimeDate;
-               
-typedef struct {
-                struct tm tmTime;         /* see time.h */
-                int    fractionalSeconds; /* 1/100 sec. */
-               }SurfTm;
-
-
-
-#ifdef _UTIL_SURF
-
-
-MoveInSdaThread surf_moveInSdaThread(SurfDataInfo* toSurfDataInfo,
-                                ModeMoveInSdaThread mode,
-                                u_long        nrOfSteps );
-                                        
-XdrSurf surf_backupSdaBlock(SurfDataInfo* toSurfDataInfo); 
-
-void surf_restoreSdaBlock(SurfDataInfo* toSurfDataInfo); 
-
-
-XdrSurf surf_insertNewSdaBlockAtActualPosition(SurfDataInfo* toSurfDataInfo,
-                                               SDAinsertMode where); 
-
-
-/* Zeit-Funktionen */
-
-void surf_timeSizetoTimeDate(char* timeSize,SurfTimeDate* timeDate);
-
-void surf_timeSizetoSurfTm(char* timeSize,SurfTm* surfTm);
-
-void surf_surfTmToTimeSize(char* timeSize,SurfTm* surfTm);
-
-SurfTime surf_timeOfTheDayFromTimeSize (char* timeSize);
-
-SurfTime surf_timeOfTheDayFromSurfTm (SurfTm* surfTm);
-
-SurfTime surf_timeAbsoluteFromSurfTm (SurfTm* surfTm);
-
-SurfTime surf_difftime (SurfTm* later,SurfTm* earlier);
-
-void surf_putJulianDayIntoTm(SurfTm* surfTm);
-
-long surf_timeSizeToInt(char* timeSize);
-
-
-
-void surf_setVendorText(SurfDataInfo* toSurfData);
-
-
-#else
-
-
-
-extern MoveInSdaThread surf_moveInSdaThread(SurfDataInfo* toSurfDataInfo,
-                                ModeMoveInSdaThread mode,
-                                u_long        nrOfSteps );
-                                        
-extern XdrSurf surf_backupSdaBlock(SurfDataInfo* toSurfDataInfo); 
-
-extern void surf_restoreSdaBlock(SurfDataInfo* toSurfDataInfo); 
-
-
-extern XdrSurf surf_insertNewSdaBlockAtActualPosition(
-                                 SurfDataInfo* toSurfDataInfo,
-                                 SDAinsertMode where); 
-
-
-
-
-/* Zeit-Funktionen */
-
-extern void surf_timeSizetoTimeDate(char* timeSize,SurfTimeDate* timeDate);
-
-extern void surf_timeSizetoSurfTm(char* timeSize,SurfTm* surfTm);
-
-extern void surf_surfTmToTimeSize(char* timeSize,SurfTm* surfTm);
-
-extern SurfTime surf_timeOfTheDayFromTimeSize (char* timeSize);
-
-extern SurfTime surf_timeOfTheDayFromSurfTm (SurfTm* surfTm);
-
-extern SurfTime surf_timeAbsoluteFromSurfTm (SurfTm* surfTm);
-
-extern SurfTime surf_difftime (SurfTm* later,SurfTm* earlier);
-
-extern void surf_putJulianDayIntoTm(SurfTm* surfTm);
-
-extern long surf_timeSizeToInt(char* timeSize);
-
-
-
-extern void surf_setVendorText(SurfDataInfo* toSurfData);
-
-#endif
-
-
-#endif
-
-
-/*********************************************************************
-*         H I S T O R I E
-**********************************************************************
-*  Edition  History
-*   date    comments                                            by
-* --------  ------------------------------------------------ ---------
-* 09-08-93  created                                            Block
-* 21-10-93  new: surf_timeSizeToInt                            Block
-*********************************************************************/
diff --git a/src/surf/xdr_surf.c b/src/surf/xdr_surf.c
deleted file mode 100644
index 34eec89..0000000
--- a/src/surf/xdr_surf.c
+++ /dev/null
@@ -1,1434 +0,0 @@
-/*-----------------------------------------------------------------------
-/ P R O G R A M M K O P F
-/ ------------------------------------------------------------------------
-/ ------------------------------------------------------------------------
-/  DATEINAME        : xdr_surf.c Version 3.0
-/  ERSTELLUNGSDATUM : 28.07.93
-/ ------------------------------------------------------------------------
-/
-/ ------------------------------------------------------------------------
-/ COPYRIGHT (C) 1993: ATLAS ELEKTRONIK GMBH, 28305 BREMEN
-/ ------------------------------------------------------------------------
-/
-/  See README file for copying and redistribution conditions.
-/
-/
-/ HIER/SACHN: P: RP ____ _ ___ __
-/ BENENNUNG :
-/ ERSTELLER : Peter Block    : SAS3
-/ FREIGABE  : __.__.__  GS__
-/ AEND/STAND: __.__.__  __
-/ PRUEFVERM.:
-*/
-
-
-
-#define _XDR_SURF
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "xdr_surf.h"
-
-
-
-/* ***********************************************************************
-*                                                                        *
-*  ENDE DES DEKLARATIONSTEILS                                            *
-*                                                                        *
-*********************************************************************** */
-
-
-
-
-
-/***************************************/
-/*                                     */
-/* SURF-stringconversions              */
-/*                                     */
-/***************************************/
-
-
-
-XdrSurf xdr_SurfString(XDR *xdrs,char *gp)
-{
-  u_int sizeS;
-
-  sizeS=STRING_SIZE; 
-  return(xdr_bytes(xdrs,&gp,&sizeS,sizeS));
-}
-
- 
-XdrSurf xdr_SurfText(XDR *xdrs,char *gp)
-{
-  u_int sizeS;
-
-  sizeS=TEXT_SIZE; 
-  return(xdr_bytes(xdrs,&gp,&sizeS,sizeS));
-}
-
- 
-XdrSurf xdr_SurfTime(XDR *xdrs,char *gp)
-{
-  u_int sizeT;
-
-  sizeT=TIME_SIZE; 
-  return(xdr_bytes(xdrs,&gp,&sizeT,sizeT));
-}
-
-
-
-
-
-
-/***************************************/
-/*                                     */
-/* SURF-filehandles                    */
-/*                                     */
-/***************************************/
-
-
-
-/* handle XDR-formatted files for READ */
-
-FILE* xdrSurfOpenRead(XDR *xdrs,const char* filename)
-{
-  FILE* fp;
-
-  fp = fopen(filename,"rb+");
-  if(fp != NULL)
-  {
-    xdrstdio_create(xdrs,fp,XDR_DECODE);
-  } 
-  return(fp);
-}
-
-
-
-
-/* handle XDR-formatted files for WRITE */
-
-FILE* xdrSurfOpenWrite(XDR *xdrs,const char* filename)
-{
-  FILE* fp;
-
-  fp = fopen(filename,"wb+");
-  if(fp != NULL)
-  {
-    xdrstdio_create(xdrs,fp,XDR_ENCODE);
-  } 
-  return(fp);
-}
-
-
-
-/***************************************/
-/*                                     */
-/* SURF-conversions for     SIX-files  */
-/*                                     */
-/***************************************/
-
-
-short getSurfVersion(char* version)
-{
- if(strlen(version) != 9) return(0);
- if(strncmp(version,"SURF ",5) != 0) return(0);
- return(((short)(version[6]))*256 + ((short)(version[8])));
-}
-
-
- 
-XdrSurf xdr_SurfCheckVersion(XDR *xdrs,SurfDescriptor *gp,char* label,
-                                  short* newVersion,short* oldVersion)
-{
-  u_int sizeL;
-  char* toLabel;
-
-  /* Get the label and check the consistency of the stream */
-
-  toLabel = (char *)gp->label;
-  sizeL=LABEL_SIZE; 
-  if (xdr_bytes(xdrs,&toLabel,&sizeL,sizeL) != SURF_SUCCESS)
-  { 
-   return(SURF_FAILURE);
-  }
-  *oldVersion = getSurfVersion(gp->label);
-  *newVersion = getSurfVersion(SURF_VERSION);
-  if(*oldVersion == 0) return(SURF_WRONG_VERSION);
-  if(*oldVersion > *newVersion) return(SURF_WRONG_VERSION);
-  strcpy((char *)gp->label,SURF_VERSION);
-  return(SURF_SUCCESS);
-}
-
-
-void insertDefaultSixDescriptor(short typ,SurfSixDescriptor *gp)
-{
- gp->typ = typ;
- gp->nr  = 0l;
-}
-    
-    
-void insertDefaultSdaDescriptor(short typ,SurfSdaDescriptor *gp)
-{
- gp->typ = typ;
- gp->nr  = 0l;
-}
-    
-    
-void insertDefaultNrOfDescriptor(short typ,SurfNrofDescriptor *gp)
-{
- gp->typ = typ;
- gp->nr  = 0l;
-}
-    
- 
-XdrSurf xdr_SurfSixDescriptor(XDR *xdrs,SurfSixDescriptor *gp)
-{
-  return( 
-          xdr_short(xdrs,&gp->typ)                         &&
-          xdr_u_long(xdrs,&gp->nr)                         );
-}
-
- 
-XdrSurf xdr_SurfSdaDescriptor(XDR *xdrs,SurfSdaDescriptor *gp)
-{
-  return(
-          xdr_short(xdrs,&gp->typ)                         &&
-          xdr_u_long(xdrs,&gp->nr)                         );
-}
-
- 
-XdrSurf xdr_SurfNrofDescriptor(XDR *xdrs,SurfNrofDescriptor *gp)
-{
-  return(
-          xdr_short(xdrs,&gp->typ)                         &&
-          xdr_u_long(xdrs,&gp->nr)                         );
-}
-
- 
-XdrSurf xdr_SurfDescriptor(XDR *xdrs,SurfDescriptor *gp,
-                                  short* newVersion,short* oldVersion)
-{
-  XdrSurf status;
-  short newVers,oldVers,vers20,vers30;
-
-  /* Get the first Label and check the Version of the stream */
-
-  vers20 = getSurfVersion(SURF_VERS2_0);
-  vers30 = getSurfVersion(SURF_VERS3_0);
-
-  status = xdr_SurfCheckVersion(xdrs,gp,SURF_VERSION,&newVers,&oldVers);
-  if (status != SURF_SUCCESS) return(status);
-
-  *newVersion = newVers;
-  *oldVersion = oldVers;
-
-  status =
-        ( xdr_short                 (xdrs,&gp->six)                    &&
-          xdr_SurfSixDescriptor     (xdrs,&gp->descriptor)             &&
-          xdr_SurfSixDescriptor     (xdrs,&gp->globalData)             &&
-          xdr_SurfSixDescriptor     (xdrs,&gp->statistics)             &&
-          xdr_SurfSixDescriptor     (xdrs,&gp->positionSensor)         &&
-          xdr_SurfSixDescriptor     (xdrs,&gp->transducer)             &&
-          xdr_SurfSixDescriptor     (xdrs,&gp->angleTab)               &&
-          xdr_SurfSixDescriptor     (xdrs,&gp->cProfile)               &&
-          xdr_SurfSixDescriptor     (xdrs,&gp->polygon)                &&
-          xdr_SurfSixDescriptor     (xdrs,&gp->events)                 &&
-          xdr_SurfSixDescriptor     (xdrs,&gp->freeText)               );
-
-  if(oldVers < vers30)
-  {
-   insertDefaultSixDescriptor(ADDSTATISTICS  ,&gp->addStatistics  );
-   insertDefaultSixDescriptor(TPESTATICS     ,&gp->tpeStatics     );
-   insertDefaultSixDescriptor(CPROFTPES      ,&gp->cprofTpes      );
-   insertDefaultSixDescriptor(FREESIXDESCR   ,&gp->freeSixDescr   );
-   insertDefaultSixDescriptor(FREESNDGDESCR  ,&gp->freeSndgDescr  );
-   insertDefaultSixDescriptor(FREEBEAMDESCR  ,&gp->freeBeamDescr  );
-   insertDefaultSixDescriptor(SIXATTDATA     ,&gp->freeSixAttData );
-   insertDefaultSixDescriptor(VENDORTEXT     ,&gp->vendorText     );
-  }
-  else
-  {
-   status = status                                                     &&
-        ( xdr_SurfSixDescriptor     (xdrs,&gp->addStatistics)          &&
-          xdr_SurfSixDescriptor     (xdrs,&gp->tpeStatics)             &&
-          xdr_SurfSixDescriptor     (xdrs,&gp->cprofTpes)              &&
-          xdr_SurfSixDescriptor     (xdrs,&gp->freeSixDescr)           &&
-          xdr_SurfSixDescriptor     (xdrs,&gp->freeSndgDescr)          &&
-          xdr_SurfSixDescriptor     (xdrs,&gp->freeBeamDescr)          &&
-          xdr_SurfSixDescriptor     (xdrs,&gp->freeSixAttData)         &&
-          xdr_SurfSixDescriptor     (xdrs,&gp->vendorText)              );
-  }
-
-  status = status                                                      &&
-        ( xdr_short                 (xdrs,&gp->sda)                    &&
-          xdr_SurfSdaDescriptor     (xdrs,&gp->soundings)              &&
-          xdr_SurfSdaDescriptor     (xdrs,&gp->centerPositions)        &&
-          xdr_SurfSdaDescriptor     (xdrs,&gp->singleBeamDepth)        &&
-          xdr_SurfSdaDescriptor     (xdrs,&gp->multiBeamDepth)         &&
-          xdr_SurfSdaDescriptor     (xdrs,&gp->multiBeamTT)            &&
-          xdr_SurfSdaDescriptor     (xdrs,&gp->multiBeamRecv)          &&
-          xdr_SurfSdaDescriptor     (xdrs,&gp->signalParams)           &&
-          xdr_SurfSdaDescriptor     (xdrs,&gp->signalAmplitudes)       );
-
-  if(oldVers < vers20)
-  {
-   insertDefaultSdaDescriptor(BEAMAMPLITUDES,&gp->beamAmplitudes);
-   insertDefaultSdaDescriptor(EXTBEAMAMPLI  ,&gp->extendBeamAmplitudes);
-   insertDefaultSdaDescriptor(SIDESCANDATA  ,&gp->sidescanData);
-   insertDefaultSdaDescriptor(TXPARMS       ,&gp->txParams);
-  }
-  else
-  {
-   status = status                                                     &&
-         (xdr_SurfSdaDescriptor     (xdrs,&gp->beamAmplitudes)         &&
-          xdr_SurfSdaDescriptor     (xdrs,&gp->extendBeamAmplitudes)   &&
-          xdr_SurfSdaDescriptor     (xdrs,&gp->sidescanData)           &&
-          xdr_SurfSdaDescriptor     (xdrs,&gp->txParams)               );
-  }
-
-  if(oldVers < vers30)
-  {
-   insertDefaultSdaDescriptor(POSITIONCEP,&gp->positionCpes);
-   insertDefaultSdaDescriptor(MULTITPES  ,&gp->multiTpeParams);
-   insertDefaultSdaDescriptor(SINGLETPES ,&gp->singleTpeParams);
-   insertDefaultSdaDescriptor(SNDGATTDATA,&gp->sndgAttData);
-   insertDefaultSdaDescriptor(BEAMATTDATA,&gp->beamAttData);
-  }
-  else
-  {
-   status = status                                                     &&
-         (xdr_SurfSdaDescriptor     (xdrs,&gp->positionCpes)           &&
-          xdr_SurfSdaDescriptor     (xdrs,&gp->multiTpeParams)         &&
-          xdr_SurfSdaDescriptor     (xdrs,&gp->singleTpeParams)        &&
-          xdr_SurfSdaDescriptor     (xdrs,&gp->sndgAttData)            &&
-          xdr_SurfSdaDescriptor     (xdrs,&gp->beamAttData)            );
-  }
-
-  status = status &&       
-        ( xdr_short                 (xdrs,&gp->nrof)                   &&
-          xdr_SurfNrofDescriptor    (xdrs,&gp->maxNrOfBeams)           &&
-          xdr_SurfNrofDescriptor    (xdrs,&gp->maxNrOfCProfileElements)&&
-          xdr_SurfNrofDescriptor    (xdrs,&gp->maxNrOfPolygonElements) &&
-          xdr_SurfNrofDescriptor    (xdrs,&gp->maxNrOfEvents)          &&
-          xdr_SurfNrofDescriptor    (xdrs,&gp->maxNrOfFreeTextBlocks)  );
-
-  if(oldVers < vers20)
-  {
-   insertDefaultNrOfDescriptor(MAX_NROF_SIDESCAN_DATA,
-                                               &gp->maxNrOfSidescanData);
-   insertDefaultNrOfDescriptor(NROF_RX_TVG_SETS,&gp->nrOfRxTvgSets);
-   insertDefaultNrOfDescriptor(NROF_TX_TVG_SETS,&gp->nrOfTxTvgSets);
-  }
-  else
-  {
-   status = status &&
-       ( xdr_SurfNrofDescriptor    (xdrs,&gp->maxNrOfSidescanData)    &&
-         xdr_SurfNrofDescriptor    (xdrs,&gp->nrOfRxTvgSets)          &&
-         xdr_SurfNrofDescriptor    (xdrs,&gp->nrOfTxTvgSets)          );
-  }
-
-  status = status &&       
-        ( xdr_short                 (xdrs,&gp->eod)                    );
-  return(status);        
-}
-
-
-
-
- 
- 
- 
-XdrSurf xdr_SurfGlobalData(XDR *xdrs,SurfGlobalData *gp)
-{
-  char buffer[LABEL_SIZE];
-  u_int sizeL;
-  char* toLabel;
-
-  /* Get the Label and check the consistency of the stream */
-
-  sizeL=LABEL_SIZE; 
-  toLabel = (char *)gp->label;
-   
-  if (xdr_bytes(xdrs,&toLabel,&sizeL,sizeL) != SURF_SUCCESS)
-  { 
-   return(SURF_FAILURE);
-  }
-  if(strncpy(buffer,SURF_GLOBAL_DATA_LABEL,sizeL) == NULL)
-  {
-   return(SURF_FAILURE);
-  }
-  if((strncmp(gp->label,(const char*)buffer,sizeL)) != 0)
-  {
-   return(SURF_CORRUPTED_DATASET);
-  }  
-
-    
-  return(
-    xdr_SurfString(xdrs,(char*)&gp->shipsName)                             &&
-    xdr_SurfTime(xdrs,(char*)&gp->startTimeOfProfile)                      &&
-    xdr_SurfString(xdrs,(char*)&gp->regionOfProfile)                       &&
-    xdr_SurfString(xdrs,(char*)&gp->numberOfProfile)                       &&
-    xdr_float(xdrs,&gp->chartZero)                                         &&
-    xdr_float(xdrs,&gp->tideZero)                                          &&
-    xdr_u_long(xdrs,&gp->numberOfMeasuredSoundings)                        &&
-    xdr_u_long(xdrs,&gp->actualNumberOfSoundingSets)                       &&
-    xdr_SurfTime(xdrs,(char*)&gp->timeDateOfTideModification)              &&
-    xdr_SurfTime(xdrs,(char*)&gp->timeDateOfDepthModification)             &&
-    xdr_SurfTime(xdrs,(char*)&gp->timeDateOfPosiModification)              &&
-    xdr_SurfTime(xdrs,(char*)&gp->timeDateOfParaModification)              &&
-    xdr_u_long(xdrs,&gp->correctedParameterFlags)                          &&
-    xdr_float(xdrs,&gp->offsetHeave)                                       &&
-    xdr_float(xdrs,&gp->offsetRollPort)                                    &&
-    xdr_float(xdrs,&gp->offsetRollStar)                                    &&
-    xdr_float(xdrs,&gp->offsetPitchFore)                                   &&
-    xdr_float(xdrs,&gp->offsetPitchAft)                                    &&
-    xdr_SurfString(xdrs,(char*)&gp->nameOfSounder)                         &&
-    xdr_char(xdrs,&gp->typeOfSounder)                                      &&
-    xdr_float(xdrs,&gp->highFrequency)                                     &&
-    xdr_float(xdrs,&gp->mediumFrequency)                                   &&
-    xdr_float(xdrs,&gp->lowFrequency)                                      &&
-    xdr_SurfString(xdrs,(char*)&gp->nameOfEllipsoid)                       &&
-    xdr_double(xdrs,&gp->semiMajorAxis)                                    &&
-    xdr_double(xdrs,&gp->flattening)                                       &&
-    xdr_SurfString(xdrs,(char*)&gp->projection)                            &&
-    xdr_char(xdrs,&gp->presentationOfPosition)                             &&
-    xdr_double(xdrs,&gp->referenceMeridian)                                &&
-    xdr_double(xdrs,&gp->falseEasting)                                     &&
-    xdr_double(xdrs,&gp->falseNorthing)                                    &&
-    xdr_double(xdrs,&gp->referenceOfPositionX)                             &&
-    xdr_double(xdrs,&gp->referenceOfPositionY)                             &&
-    xdr_char(xdrs,&gp->presentationOfRelWay)                               &&
-    xdr_float(xdrs,&gp->planedTrackStartX)                                 &&
-    xdr_float(xdrs,&gp->planedTrackStartY)                                 &&
-    xdr_float(xdrs,&gp->planedTrackStopX)                                  &&
-    xdr_float(xdrs,&gp->planedTrackStopY)                                  &&
-    xdr_float(xdrs,&gp->originalTrackStartX)                               &&
-    xdr_float(xdrs,&gp->originalTrackStartY)                               &&
-    xdr_float(xdrs,&gp->originalTrackStopX)                                &&
-    xdr_float(xdrs,&gp->originalTrackStopY)                                &&
-    xdr_float(xdrs,&gp->originalStartStopDistance)                         &&
-    xdr_double(xdrs,&gp->originalStartStopTime)                            &&
-    xdr_SurfTime(xdrs,(char*)&gp->timeDateOfTrackModification)             &&
-    xdr_float(xdrs,&gp->modifiedTrackStartX)                               &&
-    xdr_float(xdrs,&gp->modifiedTrackStartY)                               &&
-    xdr_float(xdrs,&gp->modifiedTrackStopX)                                &&
-    xdr_float(xdrs,&gp->modifiedTrackStopY)                                &&
-    xdr_float(xdrs,&gp->modifiedStartStopDistance)                         );
-}
-
-
-
- 
-XdrSurf xdr_SurfStatistics(XDR *xdrs,SurfStatistics *gp)
-{
-  char buffer[LABEL_SIZE];
-  u_int sizeL;
-  char* toLabel;
-
-  /* Get the Label and check the consistency of the stream */
-
-  sizeL=LABEL_SIZE; 
-  toLabel = (char *)gp->label;
-   
-  if (xdr_bytes(xdrs,&toLabel,&sizeL,sizeL) != SURF_SUCCESS)
-  { 
-   return(SURF_FAILURE);
-  }
-  if(strncpy(buffer,SURF_STATISTICS_LABEL,sizeL) == NULL)
-  {
-   return(SURF_FAILURE);
-  }
-  if((strncmp(gp->label,(const char*)buffer,sizeL)) != 0)
-  {
-   return(SURF_CORRUPTED_DATASET);
-  }  
-    
-  return(
-            xdr_double(xdrs,&gp->minNorthing)                             &&
-            xdr_double(xdrs,&gp->maxNorthing)                             &&
-            xdr_double(xdrs,&gp->minEasting)                              &&
-            xdr_double(xdrs,&gp->maxEasting)                              &&
-            xdr_float(xdrs,&gp->   minSpeed)                              &&
-            xdr_float(xdrs,&gp->   maxSpeed)                              &&
-            xdr_float(xdrs,&gp->minRoll)                                  &&
-            xdr_float(xdrs,&gp->maxRoll)                                  &&
-            xdr_float(xdrs,&gp->minPitch)                                 &&
-            xdr_float(xdrs,&gp->maxPitch)                                 &&
-            xdr_float(xdrs,&gp->minHeave)                                 &&
-            xdr_float(xdrs,&gp->maxHeave)                                 &&
-            xdr_float(xdrs,&gp->minBeamPositionStar)                      &&
-            xdr_float(xdrs,&gp->maxBeamPositionStar)                      &&
-            xdr_float(xdrs,&gp->minBeamPositionAhead)                     &&
-            xdr_float(xdrs,&gp->maxBeamPositionAhead)                     &&
-            xdr_float(xdrs,&gp->minDepth)                                 &&
-            xdr_float(xdrs,&gp->maxDepth)                                 );
-}
-
-
-
- 
-XdrSurf xdr_SurfPositionPolarfix(XDR *xdrs,SurfPositionPolarfix *gp)
-{
-    
-  return(
-     xdr_float(xdrs,&gp->polarfixLocationX)                             &&
-     xdr_float(xdrs,&gp->polarfixLocationY)                             &&
-     xdr_float(xdrs,&gp->polarfixLocationZ)                             &&
-     xdr_float(xdrs,&gp->polarfixReferenceX)                            &&
-     xdr_float(xdrs,&gp->polarfixReferenceY)                            &&
-     xdr_float(xdrs,&gp->polarfixReferenceZ)                            &&
-     xdr_float(xdrs,&gp->polarfixReferenceDistance)                     &&
-     xdr_float(xdrs,&gp->polarfixReferenceAngle)                        &&
-     xdr_SurfTime(xdrs,(char*)&gp->timeOfLastPolarfixEdit)              &&
-     xdr_float(xdrs,&gp->polarfixEditLocationX)                         &&
-     xdr_float(xdrs,&gp->polarfixEditLocationY)                         &&
-     xdr_float(xdrs,&gp->polarfixEditLocationZ)                         &&
-     xdr_float(xdrs,&gp->polarfixEditReferenceX)                        &&
-     xdr_float(xdrs,&gp->polarfixEditReferenceY)                        &&
-     xdr_float(xdrs,&gp->polarfixEditReferenceZ)                        &&
-     xdr_float(xdrs,&gp->polarfixEditReferenceDistance)                 &&
-     xdr_float(xdrs,&gp->polarfixEditReferenceAngle)                    &&
-     xdr_float(xdrs,&gp->polarfixAntennaPositionAhead)                  &&
-     xdr_float(xdrs,&gp->polarfixAntennaPositionStar)                   &&
-     xdr_float(xdrs,&gp->polarfixAntennaPositionHeight)                 );
-}
-
-
-
-XdrSurf xdr_SurfPositionAnySensor(XDR *xdrs,SurfPositionAnySensor* gp)
-{
-  return(
-     xdr_float(xdrs,&gp->none1)                         &&
-     xdr_float(xdrs,&gp->none2)                         &&
-     xdr_float(xdrs,&gp->none3)                         &&
-     xdr_float(xdrs,&gp->none4)                         &&
-     xdr_float(xdrs,&gp->none5)                         &&
-     xdr_float(xdrs,&gp->none6)                         &&
-     xdr_float(xdrs,&gp->none7)                         &&
-     xdr_float(xdrs,&gp->none8)                         &&
-     xdr_SurfTime(xdrs,(char*)&gp->time9)               &&
-     xdr_float(xdrs,&gp->none10)                        &&
-     xdr_float(xdrs,&gp->none11)                        &&
-     xdr_float(xdrs,&gp->none12)                        &&
-     xdr_float(xdrs,&gp->none13)                        &&
-     xdr_float(xdrs,&gp->none14)                        &&
-     xdr_float(xdrs,&gp->none15)                        &&
-     xdr_float(xdrs,&gp->none16)                        &&
-     xdr_float(xdrs,&gp->none17)                        &&
-     xdr_float(xdrs,&gp->sensorAntennaPositionAhead)    &&
-     xdr_float(xdrs,&gp->sensorAntennaPositionStar)     &&
-     xdr_float(xdrs,&gp->sensorAntennaPositionHeight)   );
-} 
-
-
-
-
-XdrSurf xdr_SurfUnknownPositionSensor(XDR *xdrs,char *gp)
-{
-  u_int sizeU;
-
-  sizeU=UNION_SIZE;
-  return(xdr_bytes(xdrs,&gp,&sizeU,sizeU));
-}
-
-
- 
- 
-XdrSurf xdr_PositionSensorArray(XDR *xdrs,SurfPositionSensorArray *gp,short oldVers)
-{
-  SurfPositionAnySensor* toAny;
-  XdrSurf ret;
-  char buffer[LABEL_SIZE];
-  u_int sizeL,sizeS;
-  char* toLabel;
-  short vers30;
-
-  vers30 = getSurfVersion(SURF_VERS3_0);
-
-  /* Get the Label and check the consistency of the stream */
-
-  sizeL=LABEL_SIZE; 
-  sizeS=STRING_SIZE; 
-  toLabel = (char *)gp->label;
-   
-  if (xdr_bytes(xdrs,&toLabel,&sizeL,sizeL) != SURF_SUCCESS)
-  { 
-   return(SURF_FAILURE);
-  }
-  if(strncpy(buffer,SURF_POSITION_SENSOR_LABEL,sizeL) == NULL)
-  {
-   return(SURF_FAILURE);
-  }
-  if((strncmp(gp->label,(const char*)buffer,sizeL)) != 0)
-  {
-   return(SURF_CORRUPTED_DATASET);
-  }  
-
-  /* Try to get the specific Sensor */
-  
-  if (xdr_SurfString(xdrs,(char*)&gp->positionSensorName) != SURF_SUCCESS)
-  { 
-   return(SURF_FAILURE);
-  }
-
-  /* Test if Polarfix */
-  
-  if(strncpy(buffer,POLARFIX,sizeS) == NULL)
-  {
-   return(SURF_FAILURE);
-  }
-  if(strncmp(gp->positionSensorName,(const char*)buffer,sizeS) == 0)
-  {
-   return(xdr_SurfPositionPolarfix(xdrs,
-                            (SurfPositionPolarfix*)gp->sensorUnion));
-  }
-  else                          
-  {
-   if(oldVers < vers30)
-   {
-    ret=xdr_SurfUnknownPositionSensor(xdrs,(char*)&gp->sensorUnion);
-    toAny = (SurfPositionAnySensor*) gp->sensorUnion;
-    toAny->sensorAntennaPositionAhead = (float)0.0;
-    toAny->sensorAntennaPositionStar  = (float)0.0;
-    toAny->sensorAntennaPositionHeight= (float)0.0;
-    return(ret);
-   }
-   else
-   {
-    return(xdr_SurfPositionAnySensor(xdrs,
-                            (SurfPositionAnySensor*)gp->sensorUnion));
-   }                         
-  }  
-}
-
-            
-
-
-
- 
-XdrSurf xdr_SurfMultiBeamAngleTable(XDR *xdrs,
-                                    SurfMultiBeamAngleTable *gp,
-                                    u_short maxBeamNr)
-{
-  XdrSurf ret;
-  char buffer[LABEL_SIZE];
-  u_int sizeL;
-  u_short n;
-  char* toLabel;
-
-  /* Get the Label and check the consistency of the stream */
-
-  sizeL=LABEL_SIZE; 
-  toLabel = (char *)gp->label;
-   
-  if (xdr_bytes(xdrs,&toLabel,&sizeL,sizeL) != SURF_SUCCESS)
-  { 
-   return(SURF_FAILURE);
-  }
-  if(strncpy(buffer,SURF_MULTIBEAM_ANGLE_LABEL,sizeL) == NULL)
-  {
-   return(SURF_FAILURE);
-  }
-  if((strncmp(gp->label,(const char*)buffer,sizeL)) != 0)
-  {
-   return(SURF_CORRUPTED_DATASET);
-  }
-    
-  if(maxBeamNr == 0)
-  {
-   return(SURF_NR_OF_TABLE_ELEMENTS_ZERO);
-  }
-  
-  ret = xdr_u_short(xdrs,&gp->actualNumberOfBeams);
-  for(n = 0;n < maxBeamNr;n++)
-  {
-   if(xdr_float(xdrs,&gp->beamAngle[n]) != SURF_SUCCESS)
-   {
-    n = maxBeamNr;
-    ret = SURF_FAILURE; 
-   }
-  }
-  return(ret);
-}
-
-            
-
-
-
- 
-XdrSurf xdr_SurfTransducerParameterTable(XDR *xdrs,
-                                         SurfTransducerParameterTable *gp)
-{
-  char buffer[LABEL_SIZE];
-  u_int sizeL;
-  char* toLabel;
-
-  /* Get the Label and check the consistency of the stream */
-
-  sizeL=LABEL_SIZE; 
-  toLabel = (char *)gp->label;
-   
-  if (xdr_bytes(xdrs,&toLabel,&sizeL,sizeL) != SURF_SUCCESS)
-  { 
-   return(SURF_FAILURE);
-  }
-  if(strncpy(buffer,SURF_TRANSDUCER_TABLE_LABEL,sizeL) == NULL)
-  {
-   return(SURF_FAILURE);
-  }
-  if((strncmp(gp->label,(const char*)buffer,sizeL)) != 0)
-  {
-   return(SURF_CORRUPTED_DATASET);
-  }  
-    
-  return(
-            xdr_float(xdrs,&gp->transducerDepth)                &&
-            xdr_float(xdrs,&gp->transducerPositionAhead)        &&
-            xdr_float(xdrs,&gp->transducerPositionStar)         &&
-            xdr_float(xdrs,&gp->transducerTwoThetaHFreq)        &&
-            xdr_float(xdrs,&gp->transducerTwoThetaMFreq)        &&
-            xdr_float(xdrs,&gp->transducerTwoThetaLFreq)        );
-}
- 
-
-            
-
-
-
- 
-XdrSurf xdr_SurfCProfileTable(XDR *xdrs,
-                              SurfCProfileTable *gp,
-                              u_short maxNrOfElementsPerTable)
-{
-  XdrSurf ret;
-  char buffer[LABEL_SIZE];
-  u_int sizeL;
-  u_short n;
-  char* toLabel;
-
-  /* Get the Label and check the consistency of the stream */
-
-  ret = SURF_SUCCESS;
-  sizeL=LABEL_SIZE; 
-  toLabel = (char *)gp->label;
-   
-  if (xdr_bytes(xdrs,&toLabel,&sizeL,sizeL) != SURF_SUCCESS)
-  { 
-   return(SURF_FAILURE);
-  }
-  if(strncpy(buffer,SURF_C_PROFILE_LABEL,sizeL) == NULL)
-  {
-   return(SURF_FAILURE);
-  }
-  if((strncmp(gp->label,(const char*)buffer,sizeL)) != 0)
-  {
-   return(SURF_CORRUPTED_DATASET);
-  }
-    
-  if(maxNrOfElementsPerTable == 0)
-  {
-   return(SURF_NR_OF_TABLE_ELEMENTS_ZERO);
-  }
-
-  if((xdr_float(xdrs,&gp->relTime)                != SURF_SUCCESS) ||
-     (xdr_u_short(xdrs,&gp->numberOfActualValues) != SURF_SUCCESS))
-    return(SURF_FAILURE);
-  for(n = 0;n < maxNrOfElementsPerTable;n++)
-  {
-   if((xdr_float(xdrs,&gp->values[n].depth)  != SURF_SUCCESS)  ||
-      (xdr_float(xdrs,&gp->values[n].cValue) != SURF_SUCCESS)  )
-   {
-    n = maxNrOfElementsPerTable;
-    ret = SURF_FAILURE; 
-   }
-  }
-  return(ret);
-}
- 
-
-            
-
-
-XdrSurf xdr_SurfCProfileTableTpes(XDR *xdrs,
-                              SurfCProfileTpeTable *gp,
-                              u_short maxNrOfElementsPerTable)
-{
-  XdrSurf ret;
-  char buffer[LABEL_SIZE];
-  u_int sizeL;
-  u_short n;
-  char* toLabel;
-
-  /* Get the Label and check the consistency of the stream */
-
-  ret = SURF_SUCCESS;
-  sizeL=LABEL_SIZE; 
-  toLabel = (char *)gp->label;
-   
-  if (xdr_bytes(xdrs,&toLabel,&sizeL,sizeL) != SURF_SUCCESS)
-  { 
-   return(SURF_FAILURE);
-  }
-  if(strncpy(buffer,SURF_C_PROFILE_TPE_LABEL,sizeL) == NULL)
-  {
-   return(SURF_FAILURE);
-  }
-  if((strncmp(gp->label,(const char*)buffer,sizeL)) != 0)
-  {
-   return(SURF_CORRUPTED_DATASET);
-  }
-    
-  if(maxNrOfElementsPerTable == 0)
-  {
-   return(SURF_NR_OF_TABLE_ELEMENTS_ZERO);
-  }
-
-  for(n = 0;n < maxNrOfElementsPerTable;n++)
-  {
-   if(xdr_float(xdrs,&gp->cpTpes[n])  != SURF_SUCCESS)
-   {
-    n = maxNrOfElementsPerTable;
-    ret = SURF_FAILURE; 
-   }
-  }
-  return(ret);
-}
- 
-
-            
-
-
-
- 
-XdrSurf xdr_SurfPolygons(XDR *xdrs,
-                         SurfPolygons *gp,
-                         u_short maxNrOfElementsPerTable)
-{
-  XdrSurf ret;
-  char buffer[LABEL_SIZE];
-  u_int sizeL;
-  u_short n;
-  char* toLabel;
-
-  /* Get the Label and check the consistency of the stream */
-
-  sizeL=LABEL_SIZE; 
-  toLabel = (char *)gp->label;
-   
-  if (xdr_bytes(xdrs,&toLabel,&sizeL,sizeL) != SURF_SUCCESS)
-  { 
-   return(SURF_FAILURE);
-  }
-  if(strncpy(buffer,SURF_POLYGONS_LABEL,sizeL) == NULL)
-  {
-   return(SURF_FAILURE);
-  }
-  if((strncmp(gp->label,(const char*)buffer,sizeL)) != 0)
-  {
-   return(SURF_CORRUPTED_DATASET);
-  }
-    
-  if(maxNrOfElementsPerTable == 0)
-  {
-   return(SURF_NR_OF_TABLE_ELEMENTS_ZERO);
-  }
-  
-  ret = SURF_SUCCESS;
-  for(n = 0;n < maxNrOfElementsPerTable;n++)
-  {
-   if((xdr_double(xdrs,&gp->values[n].polygonX)  != SURF_SUCCESS)  ||
-      (xdr_double(xdrs,&gp->values[n].polygonY)  != SURF_SUCCESS)  )
-   {
-    n = maxNrOfElementsPerTable;
-    ret = SURF_FAILURE; 
-   }
-  }
-  return(ret);
-}
- 
-
-            
-
-
-
- 
-XdrSurf xdr_SurfEventText(XDR *xdrs,char *gp)
-{
-  u_int sizeE;
-
-  sizeE=EVENT_SIZE; 
-  return(xdr_bytes(xdrs,&gp,&sizeE,sizeE));
-}
-
-
-XdrSurf xdr_SurfEvents  (XDR *xdrs,
-                         SurfEvents   *gp,
-                         u_short maxNrOfElementsPerTable)
-{
-  XdrSurf ret;
-  char buffer[LABEL_SIZE];
-  u_int sizeL;
-  u_short n;
-  char* toLabel;
-
-  /* Get the Label and check the consistency of the stream */
-
-  sizeL=LABEL_SIZE; 
-  toLabel = (char *)gp->label;
-   
-  if (xdr_bytes(xdrs,&toLabel,&sizeL,sizeL) != SURF_SUCCESS)
-  { 
-   return(SURF_FAILURE);
-  }
-  if(strncpy(buffer,SURF_EVENT_LABEL,sizeL) == NULL)
-  {
-   return(SURF_FAILURE);
-  }
-  if((strncmp(gp->label,(const char*)buffer,sizeL)) != 0)
-  {
-   return(SURF_CORRUPTED_DATASET);
-  }
-    
-  if(maxNrOfElementsPerTable == 0)
-  {
-   return(SURF_NR_OF_TABLE_ELEMENTS_ZERO);
-  }
-  
-  ret = SURF_SUCCESS;
-  for(n = 0;n < maxNrOfElementsPerTable;n++)
-  {
-   if((xdr_double(xdrs,&gp->values[n].positionX)      != SURF_SUCCESS)  ||
-      (xdr_double(xdrs,&gp->values[n].positionY)      != SURF_SUCCESS)  ||
-      (xdr_float (xdrs,&gp->values[n].relTime)        != SURF_SUCCESS)  ||
-      (xdr_SurfEventText(xdrs,(char*)&gp->values[n].text) != SURF_SUCCESS))
-   {
-    n = maxNrOfElementsPerTable;
-    ret = SURF_FAILURE; 
-   }
-  }
-  return(ret);
-}
- 
-
-            
-
-
-
-XdrSurf xdr_SurfTpeStatics(XDR *xdrs,SurfTpeStatics *gp)
-{
-  char buffer[LABEL_SIZE];
-  u_int sizeL;
-  char* toLabel;
-
-  /* Get the Label and check the consistency of the stream */
-
-  sizeL=LABEL_SIZE; 
-  toLabel = (char *)gp->label;
-   
-  if (xdr_bytes(xdrs,&toLabel,&sizeL,sizeL) != SURF_SUCCESS)
-  { 
-   return(SURF_FAILURE);
-  }
-  if(strncpy(buffer,SURF_TPE_STATICS_LABEL,sizeL) == NULL)
-  {
-   return(SURF_FAILURE);
-  }
-  if((strncmp(gp->label,(const char*)buffer,sizeL)) != 0)
-  {
-   return(SURF_CORRUPTED_DATASET);
-  }  
-
-  return(
-    xdr_u_long(xdrs,&gp->tpeFlag       )                       &&
-    xdr_SurfTime(xdrs,(char*)&gp->timeDateOfLastTpeCalculation)&&
-    xdr_double(xdrs,&gp->ltncyHprMb)                           &&
-    xdr_double(xdrs,&gp->ltncyNavHss)                          &&
-    xdr_double(xdrs,&gp->initRoll)                             &&
-    xdr_double(xdrs,&gp->initPtch)                             &&
-    xdr_double(xdrs,&gp->initHve)                              &&
-    xdr_double(xdrs,&gp->initYaw)                              &&
-    xdr_double(xdrs,&gp->rollRateC)                            &&
-    xdr_double(xdrs,&gp->ptchRateC)                            &&
-    xdr_double(xdrs,&gp->hveRateC)                             &&
-    xdr_double(xdrs,&gp->yawRateC)                             &&
-    xdr_double(xdrs,&gp->lvrml)                                &&
-    xdr_double(xdrs,&gp->lvrmw)                                &&
-    xdr_double(xdrs,&gp->lvrmh)                                &&
-    xdr_double(xdrs,&gp->shpFctr)                              &&
-    xdr_double(xdrs,&gp->bwx)                                  &&
-    xdr_double(xdrs,&gp->bwy)                                  &&
-    xdr_double(xdrs,&gp->tmtDurn)                              &&
-    xdr_double(xdrs,&gp->dTide)                                &&
-    xdr_double(xdrs,&gp->Ss)                                   &&
-    xdr_double(xdrs,&gp->detect)                               &&
-    xdr_double(xdrs,&gp->Ts)                                   &&
-    xdr_double(xdrs,&gp->svTrns)                               &&
-    xdr_double(xdrs,&gp->reserve1)                             &&
-    xdr_double(xdrs,&gp->reserve2)                             &&
-    xdr_double(xdrs,&gp->reserve3)                             &&
-    xdr_double(xdrs,&gp->reserve4)                             );
-}   
-
-
-
-
-
- 
-XdrSurf xdr_SurfFreeText (XDR *xdrs,
-                         SurfFreeText   *gp,
-                         u_short maxNrOfElementsPerTable)
-{
-  XdrSurf ret;
-  char* bp;
-  char buffer[LABEL_SIZE];
-  u_int sizeL,sizeFT;
-  char* toLabel;
-
-  /* Get the Label and check the consistency of the stream */
-
-  sizeL=LABEL_SIZE; 
-  toLabel = (char *)gp->label;
-   
-  if (xdr_bytes(xdrs,&toLabel,&sizeL,sizeL) != SURF_SUCCESS)
-  { 
-   return(SURF_FAILURE);
-  }
-  if(strncpy(buffer,SURF_FREE_TEXT_LABEL,sizeL) == NULL)
-  {
-   return(SURF_FAILURE);
-  }
-  if((strncmp(gp->label,(const char*)buffer,sizeL)) != 0)
-  {
-   return(SURF_CORRUPTED_DATASET);
-  }
-    
-  if(maxNrOfElementsPerTable == 0)
-  {
-   return(SURF_NR_OF_TABLE_ELEMENTS_ZERO);
-  }
-  
-  ret = SURF_SUCCESS;
-  bp = (char*)gp->blocks[0].text;
-  sizeFT = maxNrOfElementsPerTable * FREE_TEXT_BLOCK_SIZE;
-  {
-   if(xdr_bytes(xdrs,&bp,&sizeFT,sizeFT)
-                != SURF_SUCCESS)
-   {
-    ret = SURF_FAILURE; 
-   }
-  }
-  return(ret);
-}
-
-
-
-
-static XdrSurf xdr_SurfReductionParameters(XDR *xdrs,SurfReductionParameters *gp)
-{
-  return(
-    xdr_double(xdrs,&gp->variation)                            &&
-    xdr_double(xdrs,&gp->pointDistance)                        &&
-    xdr_double(xdrs,&gp->maxAstar)                             &&
-    xdr_double(xdrs,&gp->dFuture)                              &&
-    xdr_u_short(xdrs,&gp->isReduced)                           &&
-    xdr_u_short(xdrs,&gp->fromBeam)                            &&
-    xdr_u_short(xdrs,&gp->toBeam)                              &&
-    xdr_u_short(xdrs,&gp->reduceOuterBeams)                    );
-}
-
-    
-static XdrSurf xdr_SurfLastFilterParameters(XDR *xdrs,SurfLastFilterParameters *gp)
-{
-  return(
-    xdr_double(xdrs,&gp->depthMinDepth)                        &&
-    xdr_double(xdrs,&gp->depthMaxDepth)                        &&
-    xdr_double(xdrs,&gp->depthSlopeOver2)                      &&
-    xdr_double(xdrs,&gp->depthSlopeOver3)                      &&
-    xdr_u_short(xdrs,&gp->depthHasParams)                      &&
-    xdr_u_short(xdrs,&gp->depthFilterAhead)                    &&
-    xdr_u_short(xdrs,&gp->depthFilterAcross)                   &&
-    xdr_u_short(xdrs,&gp->posHasParams)                        &&
-    xdr_double(xdrs,&gp->posFilterRadius)                      &&
-    xdr_double(xdrs,&gp->posMaxCourseChange)                   &&
-    xdr_double(xdrs,&gp->dFuture1)                             &&
-    xdr_double(xdrs,&gp->dFuture2)                             );
-}
-
-    
-
-XdrSurf xdr_SurfAddStatistics(XDR *xdrs,SurfAddStatistics *gp)
-{
-  char buffer[LABEL_SIZE];
-  u_int sizeL,sizeT;
-  char *toLabel,*toText;
-
-  /* Get the Label and check the consistency of the stream */
-
-  sizeL=LABEL_SIZE;
-  toLabel = (char *)gp->label;
-  sizeT=TEXT_SIZE ; 
-  toText  = (char *)gp->serverReduction;
-   
-  if (xdr_bytes(xdrs,&toLabel,&sizeL,sizeL) != SURF_SUCCESS)
-  { 
-   return(SURF_FAILURE);
-  }
-  if(strncpy(buffer,SURF_ADD_STATISTICS_LABEL,sizeL) == NULL)
-  {
-   return(SURF_FAILURE);
-  }
-  if((strncmp(gp->label,(const char*)buffer,sizeL)) != 0)
-  {
-   return(SURF_CORRUPTED_DATASET);
-  }  
-    
-  return(
-    xdr_u_long(xdrs,&gp->flag)                                 &&
-    xdr_u_long(xdrs,&gp->nrNotDeletedDepth)                    &&
-    xdr_u_long(xdrs,&gp->nrNotReducedDepth)                    &&
-    xdr_u_long(xdrs,&gp->nrNotDeletedSoundings)                &&
-    xdr_SurfReductionParameters(xdrs,&gp->redParm)             &&
-    xdr_SurfLastFilterParameters(xdrs,&gp->filterParm)         &&
-    xdr_bytes(xdrs,&toText,&sizeT,sizeT)                       &&
-    xdr_double(xdrs,&(gp->dFuture[0]))                         &&
-    xdr_double(xdrs,&(gp->dFuture[1]))                         &&
-    xdr_double(xdrs,&(gp->dFuture[2]))                         &&
-    xdr_double(xdrs,&(gp->dFuture[3]))                         &&
-    xdr_double(xdrs,&(gp->dFuture[4]))                         &&
-    xdr_double(xdrs,&(gp->dFuture[5]))                         &&
-    xdr_double(xdrs,&(gp->dFuture[6]))                         &&
-    xdr_double(xdrs,&(gp->dFuture[7]))                         &&
-    xdr_double(xdrs,&(gp->dFuture[8]))                         &&
-    xdr_double(xdrs,&(gp->dFuture[9]))                         &&
-    xdr_u_short(xdrs,&(gp->iFuture[0]))                        &&
-    xdr_u_short(xdrs,&(gp->iFuture[1]))                        &&
-    xdr_u_short(xdrs,&(gp->iFuture[2]))                        &&
-    xdr_u_short(xdrs,&(gp->iFuture[3]))                        &&
-    xdr_u_short(xdrs,&(gp->iFuture[4]))                        &&
-    xdr_u_short(xdrs,&(gp->iFuture[5]))                        &&
-    xdr_u_short(xdrs,&(gp->iFuture[6]))                        &&
-    xdr_u_short(xdrs,&(gp->iFuture[7]))                        );
-}    
-
-    
-
-XdrSurf xdr_SurfVendorText(XDR *xdrs,SurfVendorText *gp)
-{
-  u_int sizeT = TEXT_SIZE;
-  char *toText = (char *)gp->text;
-
-  return(xdr_bytes(xdrs,&toText,&sizeT,sizeT));
-}    
-
-
-XdrSurf xdr_SurfFreeSixDataDescr(XDR *xdrs,SurfFreeSixDataDescr *gp)
-{
-  u_int sizeT = STRING_SIZE;
-  char *toText = (char *)gp->descr;
-
-  return(xdr_bytes(xdrs,&toText,&sizeT,sizeT));
-}    
-
-
-XdrSurf xdr_SurfFreeSndgDataDescr(XDR *xdrs,SurfFreeSndgDataDescr *gp)
-{
-  u_int sizeT = STRING_SIZE;
-  char *toText = (char *)gp->descr;
-
-  return(xdr_bytes(xdrs,&toText,&sizeT,sizeT));
-}    
-
-
-XdrSurf xdr_SurfFreeBeamDataDescr(XDR *xdrs,SurfFreeBeamDataDescr *gp)
-{
-  u_int sizeT = STRING_SIZE;
-  char *toText = (char *)gp->descr;
-
-  return(xdr_bytes(xdrs,&toText,&sizeT,sizeT));
-}    
- 
-
-XdrSurf xdr_SurfFreeSixAttachedData(XDR *xdrs,SurfFreeSixAttachedData *gp)
-{
-  return(xdr_double(xdrs,gp));
-}    
- 
-
-
-
-/***************************************/
-/*                                     */
-/* SURF-conversions for     SDA-files  */
-/*                                     */
-/***************************************/
-
-
-
-
-
- 
-XdrSurf xdr_SurfSoundingData(XDR *xdrs,SurfSoundingData *gp,short versLess2)
-{
- if(versLess2 == 1) /* Version < 2.0 */
- {
-  gp->dynChartZero = (float)0.0;
-  return(
-              xdr_u_short(xdrs,&gp->soundingFlag)                  &&
-              xdr_u_short(xdrs,&gp->indexToAngle)                  &&
-              xdr_u_short(xdrs,&gp->indexToTransducer)             &&
-              xdr_u_short(xdrs,&gp->indexToCProfile)               &&
-              xdr_float(xdrs,&gp->relTime)                         &&
-              xdr_float(xdrs,&gp->relWay)                          &&
-              xdr_float(xdrs,&gp->tide)                            &&
-              xdr_float(xdrs,&gp->headingWhileTransmitting)        &&
-              xdr_float(xdrs,&gp->heaveWhileTransmitting)          &&
-              xdr_float(xdrs,&gp->rollWhileTransmitting)           &&
-              xdr_float(xdrs,&gp->pitchWhileTransmitting)          &&
-              xdr_float(xdrs,&gp->cKeel)                           &&
-              xdr_float(xdrs,&gp->cMean)                           );
- }
- else
- {
-  return(
-              xdr_u_short(xdrs,&gp->soundingFlag)                  &&
-              xdr_u_short(xdrs,&gp->indexToAngle)                  &&
-              xdr_u_short(xdrs,&gp->indexToTransducer)             &&
-              xdr_u_short(xdrs,&gp->indexToCProfile)               &&
-              xdr_float(xdrs,&gp->relTime)                         &&
-              xdr_float(xdrs,&gp->relWay)                          &&
-              xdr_float(xdrs,&gp->tide)                            &&
-              xdr_float(xdrs,&gp->headingWhileTransmitting)        &&
-              xdr_float(xdrs,&gp->heaveWhileTransmitting)          &&
-              xdr_float(xdrs,&gp->rollWhileTransmitting)           &&
-              xdr_float(xdrs,&gp->pitchWhileTransmitting)          &&
-              xdr_float(xdrs,&gp->cKeel)                           &&
-              xdr_float(xdrs,&gp->cMean)                           &&
-              xdr_float(xdrs,&gp->dynChartZero)                    );
- }
-}
-
-
-
- 
-
-XdrSurf xdr_SurfFreeSoundingAttachedData(XDR *xdrs,SurfFreeSoundingAttachedData *gp)
-{
-  return(xdr_float(xdrs,gp));
-}    
-
-
-
- 
-XdrSurf xdr_SurfCenterPosition(XDR *xdrs,SurfCenterPosition *gp)
-{
-
-  return(
-              xdr_u_short(xdrs,&gp->positionFlag)                  &&
-              xdr_float(xdrs,&gp->centerPositionX)                 &&
-              xdr_float(xdrs,&gp->centerPositionY)                 &&
-              xdr_float(xdrs,&gp->speed)                           );
-}
-
-
-
-
- 
-XdrSurf xdr_SurfSingleBeamDepth(XDR *xdrs,SurfSingleBeamDepth *gp)
-{
-
-  return(
-              xdr_u_short(xdrs,&gp->depthFlag)                     &&
-              xdr_float(xdrs,&gp->travelTimeOfRay)                 &&
-              xdr_float(xdrs,&gp->depthHFreq)                      &&
-              xdr_float(xdrs,&gp->depthMFreq)                      &&
-              xdr_float(xdrs,&gp->depthLFreq)                      );
-}
-
-
-
-
- 
-XdrSurf xdr_SurfMultiBeamDepth(XDR *xdrs,SurfMultiBeamDepth *gp)
-{
-
-  return(
-              xdr_u_short(xdrs,&gp->depthFlag)                     &&
-              xdr_float(xdrs,&gp->depth)                           &&
-              xdr_float(xdrs,&gp->beamPositionAhead)               &&
-              xdr_float(xdrs,&gp->beamPositionStar)                );
-}
-
-
-
-
- 
-XdrSurf xdr_SurfMultiBeamTT(XDR *xdrs,SurfMultiBeamTT *gp)
-{
-
-  return(
-              xdr_float(xdrs,&gp->travelTimeOfRay)                 );
-}
-
-
-
-
- 
-XdrSurf xdr_SurfMultiBeamReceive(XDR *xdrs,SurfMultiBeamReceive *gp)
-{
-
-  return(
-              xdr_float(xdrs,&gp->headingWhileReceiving)           &&
-              xdr_float(xdrs,&gp->heaveWhileReceiving)             );
-}
-
-
-
- 
-XdrSurf xdr_SurfAmplitudes(XDR *xdrs,SurfAmplitudes *gp)
-{
-  return(     xdr_u_short(xdrs,&gp->beamAmplitude)                 );
-}
-
-
-
- 
-XdrSurf xdr_SurfExtendedAmplitudes(XDR *xdrs,SurfExtendedAmplitudes *gp)
-{
-  return(     xdr_float(xdrs,&gp->mtau)                            &&
-              xdr_u_short(xdrs,&gp->nis)                           &&
-              xdr_u_short(xdrs,&gp->beamAmplitude)                 );
-}
-
-
-
-
-XdrSurf xdr_SurfFreeBeamAttachedData(XDR *xdrs,SurfFreeBeamAttachedData *gp)
-{
-  return(xdr_float(xdrs,gp));
-}    
-
-
-
- 
-XdrSurf xdr_SurfSignalParameter(XDR *xdrs,SurfSignalParameter *gp,short nrSets)
-{
- XdrSurf ret;
- short ii;
-
-  ret = (
-          xdr_u_short(xdrs,&gp->bscatClass)                        &&
-          xdr_u_short(xdrs,&gp->nrActualGainSets)                  &&
-          xdr_float(xdrs,&gp->rxGup)                               &&   
-          xdr_float(xdrs,&gp->rxGain)                              &&      
-          xdr_float(xdrs,&gp->ar)                                  );
-  for(ii=0;ii<nrSets;ii++)
-  {
-   ret = ret && (
-          xdr_float(xdrs,&gp->rxSets[ii].time)  &&
-          xdr_float(xdrs,&gp->rxSets[ii].gain)    ); 
-  }        
-  return(ret);            
-}
-
-
-
-
-XdrSurf xdr_SurfTxParameter(XDR *xdrs,SurfTxParameter *gp,short nrSets)
-{
- XdrSurf ret;
- short ii;
-
-  ret = SURF_SUCCESS;
-  for(ii=0;ii<nrSets;ii++)
-  {
-   ret = ret && (
-          xdr_u_long(xdrs,&gp->txSets[ii].txBeamIndex)   &&
-          xdr_float(xdrs,&gp->txSets[ii].txLevel)        &&  
-          xdr_float(xdrs,&gp->txSets[ii].txBeamAngle)    && 
-          xdr_float(xdrs,&gp->txSets[ii].pulseLength)    );   
-  }        
-  return(ret);            
-}
-
-
-
- 
-XdrSurf xdr_SurfSignalAmplitudes(XDR *xdrs,SurfSignalAmplitudes *gp,
-                                                   u_short nrAmplitudes)
-{
- XdrSurf ret;
- char* toAmplitudes;
- u_int sizeA;
- 
-  ret = SURF_SUCCESS;
-  if(nrAmplitudes > (u_short)0)
-  {
-   toAmplitudes = (char *)gp->amplitudes;
-   sizeA=nrAmplitudes; 
-
-   if((xdr_u_short(xdrs,&gp->amplitudesFlag)        != SURF_SUCCESS)  ||
-      (xdr_u_short(xdrs,&gp->actualNrOfAmplitudes)  != SURF_SUCCESS)  ||
-      (xdr_float(xdrs,&gp->maxAmplPosAstar)         != SURF_SUCCESS)  ||
-      (xdr_bytes(xdrs,&toAmplitudes,&sizeA,sizeA)   != SURF_SUCCESS))
-   {
-     ret = SURF_FAILURE; 
-   }
-  }
-  return(ret);
-}
-
-
-
- 
-XdrSurf xdr_SurfSidescanData(XDR *xdrs,SurfSidescanData *gp,
-                                                   u_short nrSsData)
-{
- XdrSurf ret;
- char* toSsData;
- u_int sizeA;
- 
-  ret = SURF_SUCCESS;
-  if(nrSsData > (u_short)0)
-  {
-   toSsData = (char *)gp->ssData;
-   sizeA=nrSsData;
-   
-   if((xdr_u_long(xdrs,&gp->sidescanFlag)           != SURF_SUCCESS)  ||
-      (xdr_u_short(xdrs,&gp->actualNrOfSsDataPort)  != SURF_SUCCESS)  ||
-      (xdr_u_short(xdrs,&gp->actualNrOfSsDataStb)   != SURF_SUCCESS)  ||
-      (xdr_float(xdrs,&gp->minSsPosPort)            != SURF_SUCCESS)  ||
-      (xdr_float(xdrs,&gp->minSsPosStb)             != SURF_SUCCESS)  ||
-      (xdr_float(xdrs,&gp->maxSsPosPort)            != SURF_SUCCESS)  ||
-      (xdr_float(xdrs,&gp->maxSsPosStb)             != SURF_SUCCESS)  ||
-      (xdr_bytes(xdrs,&toSsData,&sizeA,sizeA)       != SURF_SUCCESS))
-   {
-     ret = SURF_FAILURE;
-   }
-  }
-  return(ret);
-}
-
-
-
-
-XdrSurf xdr_SurfTpeValues(XDR *xdrs,SurfTpeValues *gp)
-{
-  return(     xdr_float(xdrs,&gp->depthTpe)                            &&
-              xdr_float(xdrs,&gp->posTpe)                              &&
-              xdr_float(xdrs,&gp->minDetectionVolumeTpe)               );
-}
-
-
-
- 
-XdrSurf xdr_SurfPositionCepData(XDR *xdrs,SurfPositionCepData *gp)
-{
-  return(     xdr_float(xdrs,gp)                                       );
-}
-
-
-
- 
-
diff --git a/src/surf/xdr_surf.h b/src/surf/xdr_surf.h
deleted file mode 100644
index fad1a52..0000000
--- a/src/surf/xdr_surf.h
+++ /dev/null
@@ -1,192 +0,0 @@
-/*-----------------------------------------------------------------------
-/ H E A D E R K O P F
-/ ------------------------------------------------------------------------
-/ ------------------------------------------------------------------------
-/  DATEINAME        : xdr_surf.h    Version 3.0
-/  ERSTELLUNGSDATUM : 28.07.93
-/ ----------------------------------------------------------------------*/
-/*!
-/ ------------------------------------------------------------------------
-/ COPYRIGHT (C) 1993: ATLAS ELEKTRONIK GMBH, 28305 BREMEN
-/ ------------------------------------------------------------------------
-/
-/
-/  See README file for copying and redistribution conditions.
-/
-/ HIER/SACHN: P: RP ____ _ ___ __
-/ BENENNUNG :
-/ ERSTELLER : Peter Block    : SAS3
-/ FREIGABE  : __.__.__  GS__
-/ AEND/STAND: __.__.__  __
-/ PRUEFVERM.:
-*/
-
-/*
-/ SPRACHE          : UNIX-C
-/ COMPILER         : Silicon Graphix
-/ BETRIEBSSYSTEM   : IRIX
-/ HARDWARE-UMGEBUNG: SGI Crimson
-/ URSPRUNGSHINWEIS :
-/
-/ ------------------------------------------------------------------------
-/ BESCHREIBUNG:   Definitions describing xdr_surf-functions V2.0
-/ ------------------------------------------------------------------------
-/
-/ ------------------------------------------------------------------------
-/ E N D E   D E S   K O P F E S
-/ ------------------------------------------------------------------------
-*/
-/************************************************************************/
-
-#ifndef _xdr_surf_h
-#define _xdr_surf_h
-
-#include "surf.h"
-
-/* Return-values of XDR-SURF-routines */
-
-typedef short XdrSurf;
- 
-#define SURF_FAILURE                    0
-#define SURF_SUCCESS                    1
-#define SURF_WRONG_VERSION              2
-#define SURF_CORRUPTED_DATASET          3
-#define SURF_NR_OF_TABLE_ELEMENTS_ZERO  4
-#define SURF_CANT_GET_MEMORY            5
-#define SURF_CANT_OPEN_FILE             6
-#define SURF_EOF                        7
-#define SURF_BAD_POSITION               8
-
-      
-#ifdef _XDR_SURF 
-
-short getSurfVersion(char* version);
-
-FILE* xdrSurfOpenWrite(XDR* xdrs,const char* filename);
-FILE* xdrSurfOpenRead(XDR* xdrs,const char* filename);
-
-XdrSurf xdr_SurfDescriptor(XDR *xdrs,SurfDescriptor *gp,
-                                  short* newVersion,short* oldVersion);
-XdrSurf xdr_SurfGlobalData(XDR* xdrs,SurfGlobalData *gp);
-XdrSurf xdr_SurfStatistics(XDR* xdrs,SurfStatistics *gp);
-XdrSurf xdr_PositionSensorArray(XDR* xdrs,SurfPositionSensorArray *gp,
-                                                              short oldVers);
-XdrSurf xdr_SurfMultiBeamAngleTable(XDR* xdrs,
-                                           SurfMultiBeamAngleTable *gp,
-                                           u_short maxBeamNr);
-XdrSurf xdr_SurfTransducerParameterTable(XDR* xdrs,
-                                           SurfTransducerParameterTable *gp);
-XdrSurf xdr_SurfCProfileTableTpes(XDR *xdrs,
-                                           SurfCProfileTpeTable *gp,
-                                           u_short maxNrOfElementsPerTable);
-XdrSurf xdr_SurfCProfileTable(XDR* xdrs,
-                                           SurfCProfileTable *gp,
-                                           u_short maxNrOfElementsPerTable);
-XdrSurf xdr_SurfPolygons(XDR* xdrs,
-                                           SurfPolygons *gp,
-                                           u_short maxNrOfElementsPerTable);
-XdrSurf xdr_SurfEvents  (XDR* xdrs,
-                                           SurfEvents   *gp,
-                                           u_short maxNrOfElementsPerTable);
-XdrSurf xdr_SurfFreeText(XDR* xdrs,
-                                           SurfFreeText *gp,
-                                           u_short maxNrOfElementsPerTable);
-XdrSurf xdr_SurfTpeStatics(XDR *xdrs,SurfTpeStatics *gp);
-XdrSurf xdr_SurfAddStatistics(XDR *xdrs,SurfAddStatistics *gp);
-XdrSurf xdr_SurfVendorText(XDR *xdrs,SurfVendorText *gp);
-XdrSurf xdr_SurfFreeSixDataDescr(XDR *xdrs,SurfFreeSixDataDescr *gp);
-XdrSurf xdr_SurfFreeSndgDataDescr(XDR *xdrs,SurfFreeSndgDataDescr *gp);
-XdrSurf xdr_SurfFreeBeamDataDescr(XDR *xdrs,SurfFreeBeamDataDescr *gp);
-XdrSurf xdr_SurfFreeSixAttachedData(XDR *xdrs,SurfFreeSixAttachedData *gp);
-
-
-XdrSurf xdr_SurfSoundingData(XDR* xdrs,SurfSoundingData *gp,short versLess2);
-XdrSurf xdr_SurfFreeSoundingAttachedData(XDR *xdrs,SurfFreeSoundingAttachedData *gp);
-XdrSurf xdr_SurfCenterPosition(XDR* xdrs,SurfCenterPosition *gp);
-XdrSurf xdr_SurfPositionCepData(XDR *xdrs,SurfPositionCepData *gp);
-XdrSurf xdr_SurfSingleBeamDepth(XDR* xdrs,SurfSingleBeamDepth *gp);
-XdrSurf xdr_SurfMultiBeamDepth(XDR* xdrs,SurfMultiBeamDepth *gp);
-XdrSurf xdr_SurfMultiBeamTT(XDR* xdrs,SurfMultiBeamTT *gp);
-XdrSurf xdr_SurfMultiBeamReceive(XDR* xdrs,SurfMultiBeamReceive *gp);
-XdrSurf xdr_SurfFreeBeamAttachedData(XDR *xdrs,SurfFreeBeamAttachedData *gp);
-XdrSurf xdr_SurfTpeValues(XDR *xdrs,SurfTpeValues *gp);
-XdrSurf xdr_SurfSignalParameter(XDR *xdrs,SurfSignalParameter *gp,short nrSets);
-XdrSurf xdr_SurfTxParameter(XDR *xdrs,SurfTxParameter *gp,short nrSets);
-XdrSurf xdr_SurfSignalAmplitudes(XDR* xdrs,SurfSignalAmplitudes *gp,
-                                           u_short nrAmplitudes);
-                                          
-XdrSurf xdr_SurfAmplitudes(XDR *xdrs,SurfAmplitudes *gp);
-XdrSurf xdr_SurfExtendedAmplitudes(XDR *xdrs,SurfExtendedAmplitudes *gp);
-XdrSurf xdr_SurfSidescanData(XDR *xdrs,SurfSidescanData *gp,
-                                                   u_short nrSsData);
-
-
-#else
-
-extern short getSurfVersion(char* version);
-
-extern FILE* xdrSurfOpenWrite(XDR* xdrs,const char* filename);
-extern FILE* xdrSurfOpenRead(XDR* xdrs,const char* filename);
-
-extern XdrSurf xdr_SurfDescriptor(XDR *xdrs,SurfDescriptor *gp,
-                                         short* newVersion,short* oldVersion);
-extern XdrSurf xdr_SurfGlobalData(XDR* xdrs,SurfGlobalData *gp);
-extern XdrSurf xdr_SurfStatistics(XDR* xdrs,SurfStatistics *gp);
-extern XdrSurf xdr_PositionSensorArray(XDR* xdrs,SurfPositionSensorArray *gp,
-                                                              short oldVers);
-extern XdrSurf xdr_SurfMultiBeamAngleTable(XDR* xdrs,
-                                           SurfMultiBeamAngleTable *gp,
-                                           u_short maxBeamNr);
-extern XdrSurf xdr_SurfTransducerParameterTable(XDR* xdrs,
-                                           SurfTransducerParameterTable *gp);
-extern XdrSurf xdr_SurfCProfileTableTpes(XDR *xdrs,
-                                           SurfCProfileTpeTable *gp,
-                                           u_short maxNrOfElementsPerTable);
-extern XdrSurf xdr_SurfCProfileTable(XDR* xdrs,
-                                           SurfCProfileTable *gp,
-                                           u_short maxNrOfElementsPerTable);
-extern XdrSurf xdr_SurfPolygons(XDR* xdrs,
-                                           SurfPolygons *gp,
-                                           u_short maxNrOfElementsPerTable);
-extern XdrSurf xdr_SurfEvents  (XDR* xdrs,
-                                           SurfEvents   *gp,
-                                           u_short maxNrOfElementsPerTable);
-extern XdrSurf xdr_SurfFreeText(XDR* xdrs,
-                                           SurfFreeText *gp,
-                                           u_short maxNrOfElementsPerTable);
-extern XdrSurf xdr_SurfTpeStatics(XDR *xdrs,SurfTpeStatics *gp);
-extern XdrSurf xdr_SurfAddStatistics(XDR *xdrs,SurfAddStatistics *gp);
-extern XdrSurf xdr_SurfVendorText(XDR *xdrs,SurfVendorText *gp);
-extern XdrSurf xdr_SurfFreeSixDataDescr(XDR *xdrs,SurfFreeSixDataDescr *gp);
-extern XdrSurf xdr_SurfFreeSndgDataDescr(XDR *xdrs,SurfFreeSndgDataDescr *gp);
-extern XdrSurf xdr_SurfFreeBeamDataDescr(XDR *xdrs,SurfFreeBeamDataDescr *gp);
-extern XdrSurf xdr_SurfFreeSixAttachedData(XDR *xdrs,SurfFreeSixAttachedData *gp);
-
-
-extern XdrSurf xdr_SurfSoundingData(XDR* xdrs,SurfSoundingData *gp,short versLess2);
-extern XdrSurf xdr_SurfFreeSoundingAttachedData(XDR *xdrs,SurfFreeSoundingAttachedData *gp);
-extern XdrSurf xdr_SurfCenterPosition(XDR* xdrs,SurfCenterPosition *gp);
-extern XdrSurf xdr_SurfPositionCepData(XDR *xdrs,SurfPositionCepData *gp);
-extern XdrSurf xdr_SurfSingleBeamDepth(XDR* xdrs,SurfSingleBeamDepth *gp);
-extern XdrSurf xdr_SurfMultiBeamDepth(XDR* xdrs,SurfMultiBeamDepth *gp);
-extern XdrSurf xdr_SurfMultiBeamTT(XDR* xdrs,SurfMultiBeamTT *gp);
-extern XdrSurf xdr_SurfMultiBeamReceive(XDR* xdrs,SurfMultiBeamReceive *gp);
-extern XdrSurf xdr_SurfFreeBeamAttachedData(XDR *xdrs,SurfFreeBeamAttachedData *gp);
-extern XdrSurf xdr_SurfTpeValues(XDR *xdrs,SurfTpeValues *gp);
-extern XdrSurf xdr_SurfSignalParameter(XDR *xdrs,SurfSignalParameter *gp,
-                                                              short nrSets);
-extern XdrSurf xdr_SurfTxParameter(XDR *xdrs,SurfTxParameter *gp,
-                                                              short nrSets);
-extern XdrSurf xdr_SurfSignalAmplitudes(XDR* xdrs,SurfSignalAmplitudes *gp,
-                                                      u_short nrAmplitudes);
-                                          
-extern XdrSurf xdr_SurfAmplitudes(XDR *xdrs,SurfAmplitudes *gp);
-extern XdrSurf xdr_SurfExtendedAmplitudes(XDR *xdrs,SurfExtendedAmplitudes *gp);
-extern XdrSurf xdr_SurfSidescanData(XDR *xdrs,SurfSidescanData *gp,
-                                                              u_short nrSsData);
-                                          
-
-#endif /* ifdef _XDR_SURF */
-
-
-#endif
diff --git a/src/surf/xdr_win32.c b/src/surf/xdr_win32.c
deleted file mode 100644
index 8df7efc..0000000
--- a/src/surf/xdr_win32.c
+++ /dev/null
@@ -1,654 +0,0 @@
-/*
-/  See README file for copying and redistribution conditions.
-*/
-#include <stdio.h>
-
-#include <stdlib.h>
-#include <string.h>
-
-#include "types_win32.h"
-#include "xdr_win32.h"
-
-
-#define BYTES_PER_XDR_UNIT 4
-
-
-
-
-
-
-
-static long ntohl(long val)
-
-{
-
- u_long ret,uval;
-
- uval=(u_long)val;
- ret = (((uval/0x1000000) & 0x0ff)            )
-
-     + (((uval/0x10000  ) & 0x0ff) * 0x100    )
-
-     + (((uval/0x100    ) & 0x0ff) * 0x10000  )
-
-     + (((uval          ) & 0x0ff) * 0x1000000);
-
- return((long)ret);
-
-
-}
-
-
-
-
-
-static long htonl(long val)
-
-{
-
- u_long ret,uval;
-
- uval=(u_long)val;
- ret = (((uval/0x1000000) & 0x0ff)            )
-
-     + (((uval/0x10000  ) & 0x0ff) * 0x100    )
-
-     + (((uval/0x100    ) & 0x0ff) * 0x10000  )
-
-     + (((uval          ) & 0x0ff) * 0x1000000);
-
- return((long)ret);
-
-    
-
-}
-
-
-
-
-
-static int xdrGetLong(XDR* xdrs,long* lp)
-
-{
-
- if (fread((char*)lp, sizeof(long),(size_t)1, (FILE *)xdrs->x_private) != 1)
-
-    return (FALSE);
-
- *lp = ntohl(*lp);
-
- return (TRUE);
-
-}
-
-
-
-
-
-static int xdrPutLong(XDR* xdrs,long *lp)
-
-{
-
- long mylong;
-
-
-
- mylong = htonl(*lp);
-
- lp = &mylong; 
-
- if (fwrite((char*)lp, sizeof(long), 1, (FILE *)xdrs->x_private) != 1)
-
-    return (FALSE);
-
- return (TRUE);
-
-}
-
-
-
-
-
-static int xdrGetBytes(XDR* xdrs,char* addr,u_int len)
-
-{
-
- if (len != 0)
-
- {
-
-  if(fread(addr, (int)len, 1, (FILE *)xdrs->x_private) != 1)
-
-    return(FALSE);
-
- }   
-
- return(TRUE);
-
-}
-
-
-
-
-
-static int xdrPutBytes(XDR* xdrs,char* addr,u_int len)
-
-{
-
- if(len != 0)
-
- {
-
-  if(fwrite(addr, (int)len, 1, (FILE *)xdrs->x_private) != 1)
-
-    return(FALSE);
-
- }   
-
- return(TRUE);
-
-}
-
-
-
-
-
-
-
-void xdrstdio_create(XDR* xdrs,FILE* file,XdrOp op)
-
-{
-
- xdrs->x_op = op;
-
- xdrs->x_private = (char*)file;
-
- xdrs->x_handy = 0;
-
- xdrs->x_base = 0;
-
-}
-
-
-
-
-
-
-
-int xdr_long(XDR* xdrs,long* lp)
-
-{
-
- switch(xdrs->x_op)
-
- {
-
-  case XDR_ENCODE:
-
-      return (xdrPutLong(xdrs, lp));
-
-  case XDR_DECODE:
-
-      return (xdrGetLong(xdrs, lp));
-
-  default:
-
-      break;
-
- }
-
- return (FALSE);
-
-}
-
-
-
-
-
-
-
-int xdr_u_long(XDR *xdrs,u_long* ulp)
-
-{
-
- return(xdr_long(xdrs,(long*) ulp));
-
-}
-
-
-
-
-
-
-
-int xdr_short(XDR *xdrs,short *sp)
-
-{
-
- long val;
-
- short sval;
-
-
-
- switch(xdrs->x_op)
-
- {
-
-  case XDR_ENCODE:
-
-      val = (long) *sp;
-
-      return(xdrPutLong(xdrs, &val));
-
-  case XDR_DECODE:
-
-      if(xdrGetLong(xdrs, &val) == TRUE) 
-
-      {
-
-       sval = (short)(val & 0x7fff);
-
-       if(val<0) sval = sval | 0x8000;
-
-       *sp = sval;
-
-       return(TRUE);
-
-      }
-
-  default:
-
-      break;
-
- }
-
- return (FALSE);
-
-}
-
-
-
-
-
-
-
-int xdr_u_short(XDR *xdrs,u_short* ulp)
-
-{
-
- long val = (long)((short)(*ulp));
-
- switch(xdrs->x_op)
-
- {
-
-  case XDR_ENCODE:
-
-           val=val & 0xffff;
-
-           return(xdr_long(xdrs,&val));
-
-  case XDR_DECODE:
-
-           if(xdr_long(xdrs,&val) == TRUE)
-
-           {
-
-            *ulp = (u_short)val;
-
-            return(TRUE);
-
-           }
-
-  default:
-
-           break;
-
- }
-
- return(FALSE);                   
-
-}
-
-
-
-
-
-
-
-int xdr_u_int(XDR* xdrs,u_int* ip)
-
-{
-
- if (sizeof (u_int) == sizeof (u_long)) 
-
-   return (xdr_u_long(xdrs,(u_long*)ip)); 
-
- else 
-
-   return (xdr_u_short(xdrs,(u_short*)ip));
-
-}
-
-
-
-
-
-
-
-int xdr_int(XDR* xdrs,int *ip)
-
-{
-
- if (sizeof (int) == sizeof (long)) 
-
-   return (xdr_long(xdrs,(long *)ip)); 
-
- else 
-
-   return (xdr_short(xdrs,(short *)ip));
-
-}
-
-
-
-
-
-
-
-int xdr_char(XDR *xdrs,char *cp)
-
-{
-
- int ii;
-
-
-
- ii = (int)(*cp);
-
- if (xdr_int(xdrs, &ii)) 
-
- {
-
-  *cp = (char)ii;
-
-  return(TRUE);
-
- }
-
- return(FALSE);
-
-}
-
-
-
-
-
-
-
-int xdr_u_char(XDR *xdrs,u_char *cp)
-
-{
-
- u_int ii;
-
-
-
- ii = (u_int)(*cp);
-
- if(xdr_u_int(xdrs, &ii))
-
- {
-
-  *cp = (u_char)ii;
-
-  return(TRUE);
-
- }
-
- return(FALSE); 
-
-}
-
-
-
-
-
-
-
-int xdr_opaque(XDR *xdrs,char* cp,unsigned int cnt)
-
-{
-
- static char crud[BYTES_PER_XDR_UNIT];
-
- u_int rndup;
-
-
-
- if(cnt == 0) return (TRUE);
-
- rndup = cnt % BYTES_PER_XDR_UNIT;
-
- if (rndup > 0) rndup = BYTES_PER_XDR_UNIT - rndup;
-
-
-
- switch(xdrs->x_op)
-
- {
-
-  case XDR_DECODE: 
-
-     if (!xdrGetBytes(xdrs, cp, cnt)) return(FALSE);
-
-     if (rndup == 0) return(TRUE);
-
-     return (xdrGetBytes(xdrs, crud, rndup));
-
-  case XDR_ENCODE:
-
-     if (!xdrPutBytes(xdrs, cp, cnt)) return (FALSE);
-
-     if (rndup == 0) return(TRUE);
-
-/*     return (xdrPutBytes(xdrs, xdr_zero, rndup)); */
-
-  case XDR_FREE:
-
-     return(TRUE);
-
-  default:
-
-     break;
-
- } 
-
- return (FALSE);
-
-}
-
-
-
-
-
-
-
-
-
-int xdr_bytes(XDR *xdrs,char **cpp,u_int *sizep,u_int maxsize)
-
-/*   *cpp is a pointer to the bytes, *sizep is the count.
-
-  If *cpp is NULL maxsize bytes are allocated              */
-
-{
-
- char *sp = *cpp;
-
- u_int nodesize;
-
-
-
- if (!xdr_u_int(xdrs, sizep)) 
-
-   return (FALSE);
-
-
-
- nodesize = *sizep;
-
- if((nodesize > maxsize) && (xdrs->x_op != XDR_FREE)) 
-
-   return (FALSE);
-
-
-
- switch (xdrs->x_op) 
-
- {
-
-  case XDR_DECODE:
-
-       if (nodesize == 0) return (TRUE);
-
-       if (sp == NULL) 
-
-       {
-
-        *cpp = sp = (char *)calloc(nodesize,sizeof(char));
-
-        if(sp == NULL) return (FALSE);
-
-       }
-
-  case XDR_ENCODE:
-
-	return (xdr_opaque(xdrs, sp, nodesize));
-
-  case XDR_FREE:
-
-	if (sp != NULL) 
-
-        {
-
-	 free(sp);
-
-         *cpp = NULL;
-
-        }
-
-	return (TRUE);
-
-  default:
-
-        break;
-
- }
-
- return (FALSE);
-
-}
-
-
-
-
-
-
-
-
-
-int xdr_float(XDR* xdrs,float *fp)
-
-/*
-
-//  What IEEE single precision floating point 
-
-// struct	ieee_single {
-
-// 	 unsigned int	mantissa: 23;
-
-//	 unsigned int	exp     : 8;
-
-//	 unsigned int	sign    : 1;
-
-//  };
-
-*/
-
-{
-
-  switch (xdrs->x_op) 
-
-  {
-
-   case XDR_ENCODE:
-
-        return (xdrPutLong(xdrs,(long *)fp));
-
-   case XDR_DECODE:
-
-        return (xdrGetLong(xdrs,(long *)fp));
-
-   case XDR_FREE:
-
-        return (TRUE);
-
-   default:
-
-        break;
-
-  }
-
-  return (FALSE);
-
-}
-
-
-
-
-
-
-
-int xdr_double(XDR* xdrs,double *dp)
-{
-
- long *lp;
-
- switch(xdrs->x_op)
- {
-
-  case XDR_ENCODE:
-       lp = (long *)dp;
-	   lp++;
-       xdrPutLong(xdrs, lp);
-       lp--;
-       return(xdrPutLong(xdrs, lp));
-
-  case XDR_DECODE:
-       lp = (long *)dp;
-	   lp++;
-       xdrGetLong(xdrs, lp);
-       lp--;
-       return(xdrGetLong(xdrs, lp));
-  case XDR_FREE:
-
-       return (TRUE);
-
-  default:
-
-       break;
-
- }
-
- return (FALSE);
-
-}
-
-
-
-
-
-
-
diff --git a/src/surf/xdr_win32.h b/src/surf/xdr_win32.h
deleted file mode 100644
index bb193f1..0000000
--- a/src/surf/xdr_win32.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
-/  See README file for copying and redistribution conditions.
-*/
-
-#ifndef XDRH_included
-#define XDRH_included
-
-#include "types_win32.h"
-
-#ifndef TRUE
-#define TRUE  (1==1)
-#endif
-#ifndef FALSE
-#define FALSE (0==1)
-#endif
-
-
-
-typedef enum
-{
-	XDR_ENCODE=0,
-	XDR_DECODE=1,
-	XDR_FREE=2
-}XdrOp;
-
-
-typedef struct 
-{
-  XdrOp     x_op;
-  char*   x_public;
-  char*   x_private;
-  char*   x_base;
-  int       x_handy;
-} XDR;
-
-
-void xdrstdio_create(XDR* xdrs,FILE* file,XdrOp op);
-int xdr_long(XDR* xdrs,long* lp);
-int xdr_u_long(XDR* xdrs,u_long* ulp);
-int xdr_short(XDR* xdrs,short* sp);
-int xdr_u_short(XDR* xdrs,u_short* ulp);
-int xdr_int(XDR* xdrs,int* ip);
-int xdr_u_int(XDR* xdrs,u_int* ip);
-int xdr_char(XDR* xdrs,char* cp);
-int xdr_u_char(XDR* xdrs,u_char* cp);
-int xdr_opaque(XDR* xdrs,char* cp,unsigned int cnt);
-int xdr_bytes(XDR* xdrs,char** cpp,u_int* sizep,u_int maxsize);
-int xdr_double(XDR* xdrs,double *dp);
-int xdr_float(XDR* xdrs,float *fp);
-
-#endif
diff --git a/src/utilities/Makefile.am b/src/utilities/Makefile.am
deleted file mode 100644
index ec642a3..0000000
--- a/src/utilities/Makefile.am
+++ /dev/null
@@ -1,145 +0,0 @@
-if BUILD_FFTW
- FFTW_PROG = mbsegypsd
-endif
-
-bin_PROGRAMS = mb7k2jstar \
-        mb7k2ss \
-        mb7kpreprocess \
-        mbabsorption \
-        mbareaclean \
-        mbauvloglist \
-        mbauvnavusbl \
-        mbbackangle \
-        mbclean \
-        mbcopy \
-        mbctdlist \
-        mbdatalist \
-        mbdefaults \
-        mbdumpesf \
-        mbextractsegy \
-        mbfilter \
-        mbformat \
-        mbgetesf \
-        mbgrid \
-        mbhistogram \
-        mbhsdump \
-        mbhysweeppreprocess \
-        mbinfo \
-        mbinsreprocess \
-        mbkongsbergpreprocess \
-        mblevitus \
-        mblist \
-        mbmosaic \
-        mbnavlist \
-        mbneptune2esf \
-        mbpreprocess \
-        mbprocess \
-        mbrollbias \
-        mbrolltimelag \
-        mbroutetime \
-        mbrphsbias \
-        mbsegygrid \
-        mbsegyinfo \
-        mbsegylist \
-        mbset \
-        mbsslayout \
-        mbstripnan \
-        mbsvplist \
-        mbsvpselect \
-        mbswplspreprocess \
-        mbtime \
-        $(FFTW_PROG)
-
-
-include_HEADERS = levitus.h
-
-AM_CFLAGS = ${libgmt_CFLAGS} ${libnetcdf_CFLAGS}
-
-AM_CPPFLAGS = -I${top_srcdir}/src/mbio \
-	      -I${top_srcdir}/src/mbaux \
-	      -I${top_srcdir}/src/gsf \
-	      ${libgmt_CPPFLAGS} \
-	      ${libnetcdf_CPPFLAGS} \
-	      ${libfftw_CPPFLAGS}
-
-AM_LDFLAGS =
-
-LIBS =  ${top_builddir}/src/mbio/libmbio.la \
-       	${libgmt_LIBS} ${libnetcdf_LIBS} ${libproj_LIBS} \
-        $(LIBM)
-
-mb7k2jstar_SOURCES = mb7k2jstar.c
-mb7k2ss_LDADD = ${top_builddir}/src/mbaux/libmbaux.la
-mb7k2ss_SOURCES = mb7k2ss.c
-mb7kpreprocess_LDADD = ${top_builddir}/src/mbaux/libmbaux.la
-mb7kpreprocess_SOURCES = mb7kpreprocess.c
-mbabsorption_SOURCES = mbabsorption.c
-mbareaclean_SOURCES = mbareaclean.c
-mbauvloglist_LDADD = ${top_builddir}/src/mbaux/libmbaux.la
-mbauvloglist_SOURCES = mbauvloglist.c
-mbauvnavusbl_LDADD = ${top_builddir}/src/mbaux/libmbaux.la
-mbauvnavusbl_SOURCES = mbauvnavusbl.c
-mbbackangle_LDADD = ${top_builddir}/src/mbaux/libmbaux.la
-mbbackangle_SOURCES = mbbackangle.c
-mbclean_SOURCES = mbclean.c
-mbcopy_LDADD = ${top_builddir}/src/gsf/libmbgsf.la
-mbcopy_SOURCES = mbcopy.c
-mbctdlist_LDADD = ${top_builddir}/src/mbaux/libmbaux.la
-mbctdlist_SOURCES = mbctdlist.c
-mbdatalist_SOURCES = mbdatalist.c
-mbdefaults_SOURCES = mbdefaults.c
-mbdumpesf_SOURCES = mbdumpesf.c
-mbextractsegy_SOURCES = mbextractsegy.c
-mbfilter_SOURCES = mbfilter.c
-mbformat_SOURCES = mbformat.c
-mbgetesf_SOURCES = mbgetesf.c
-mbgrid_LDADD = ${top_builddir}/src/mbaux/libmbaux.la
-mbgrid_SOURCES = mbgrid.c
-mbhistogram_SOURCES = mbhistogram.c
-mbhsdump_SOURCES = mbhsdump.c
-mbhysweeppreprocess_LDADD = ${top_builddir}/src/mbaux/libmbaux.la
-mbhysweeppreprocess_SOURCES = mbhysweeppreprocess.c
-mbinfo_SOURCES = mbinfo.c
-mbinsreprocess_SOURCES = mbinsreprocess.c
-mbkongsbergpreprocess_LDADD = ${top_builddir}/src/mbaux/libmbaux.la
-mbkongsbergpreprocess_SOURCES = mbkongsbergpreprocess.c
-mblevitus_SOURCES = mblevitus.c
-mblist_SOURCES = mblist.c
-mbmosaic_LDADD = ${top_builddir}/src/mbaux/libmbaux.la
-mbmosaic_SOURCES = mbmosaic.c
-mbnavlist_SOURCES = mbnavlist.c
-mbneptune2esf_SOURCES = mbneptune2esf.c
-mbpreprocess_LDADD = ${top_builddir}/src/mbaux/libmbaux.la
-mbpreprocess_SOURCES = mbpreprocess.c
-mbprocess_LDADD = ${top_builddir}/src/gsf/libmbgsf.la ${top_builddir}/src/mbaux/libmbaux.la
-mbprocess_SOURCES = mbprocess.c
-mbrollbias_SOURCES = mbrollbias.c
-mbrolltimelag_SOURCES = mbrolltimelag.c
-mbroutetime_SOURCES = mbroutetime.c
-mbrphsbias_SOURCES = mbrphsbias.c
-mbsegygrid_LDADD = ${top_builddir}/src/mbaux/libmbaux.la
-mbsegygrid_SOURCES = mbsegygrid.c
-mbsegyinfo_SOURCES = mbsegyinfo.c
-mbsegylist_SOURCES = mbsegylist.c
-mbset_SOURCES = mbset.c
-mbsslayout_LDADD = ${top_builddir}/src/mbaux/libmbaux.la
-mbsslayout_SOURCES = mbsslayout.c
-mbstripnan_SOURCES = mbstripnan.c
-mbsvplist_SOURCES = mbsvplist.c
-mbsvpselect_SOURCES = mbsvpselect.c geodesic.c
-mbswplspreprocess_LDADD = ${top_builddir}/src/mbaux/libmbaux.la
-mbswplspreprocess_SOURCES = mbswplspreprocess.c
-mbtime_SOURCES = mbtime.c
-if BUILD_FFTW
-mbsegypsd_LDADD = ${top_builddir}/src/mbaux/libmbaux.la \
-                  ${libgmt_LIBS} ${libnetcdf_LIBS} ${libproj_LIBS} ${libfftw_LIBS}
-mbsegypsd_SOURCES = mbsegypsd.c
-mbsegypsd_LDFLAGS =
-endif
-
-BUILT_SOURCES = levitus.h
-CLEANFILES = levitus.h
-DISTCLEANFILES = levitus.h
-
-levitus.h: Makefile
-	echo 'char *ifile = "$(mbsystemdatadir)/LevitusAnnual82.dat";' >$@
diff --git a/src/utilities/Makefile.in b/src/utilities/Makefile.in
deleted file mode 100644
index 8021d5e..0000000
--- a/src/utilities/Makefile.in
+++ /dev/null
@@ -1,1233 +0,0 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
-
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-
-
-VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
-am__make_running_with_option = \
-  case $${target_option-} in \
-      ?) ;; \
-      *) echo "am__make_running_with_option: internal error: invalid" \
-              "target option '$${target_option-}' specified" >&2; \
-         exit 1;; \
-  esac; \
-  has_opt=no; \
-  sane_makeflags=$$MAKEFLAGS; \
-  if $(am__is_gnu_make); then \
-    sane_makeflags=$$MFLAGS; \
-  else \
-    case $$MAKEFLAGS in \
-      *\\[\ \	]*) \
-        bs=\\; \
-        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
-          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
-    esac; \
-  fi; \
-  skip_next=no; \
-  strip_trailopt () \
-  { \
-    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
-  }; \
-  for flg in $$sane_makeflags; do \
-    test $$skip_next = yes && { skip_next=no; continue; }; \
-    case $$flg in \
-      *=*|--*) continue;; \
-        -*I) strip_trailopt 'I'; skip_next=yes;; \
-      -*I?*) strip_trailopt 'I';; \
-        -*O) strip_trailopt 'O'; skip_next=yes;; \
-      -*O?*) strip_trailopt 'O';; \
-        -*l) strip_trailopt 'l'; skip_next=yes;; \
-      -*l?*) strip_trailopt 'l';; \
-      -[dEDm]) skip_next=yes;; \
-      -[JT]) skip_next=yes;; \
-    esac; \
-    case $$flg in \
-      *$$target_option*) has_opt=yes; break;; \
-    esac; \
-  done; \
-  test $$has_opt = yes
-am__make_dryrun = (target_option=n; $(am__make_running_with_option))
-am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-bin_PROGRAMS = mb7k2jstar$(EXEEXT) mb7k2ss$(EXEEXT) \
-	mb7kpreprocess$(EXEEXT) mbabsorption$(EXEEXT) \
-	mbareaclean$(EXEEXT) mbauvloglist$(EXEEXT) \
-	mbauvnavusbl$(EXEEXT) mbbackangle$(EXEEXT) mbclean$(EXEEXT) \
-	mbcopy$(EXEEXT) mbctdlist$(EXEEXT) mbdatalist$(EXEEXT) \
-	mbdefaults$(EXEEXT) mbdumpesf$(EXEEXT) mbextractsegy$(EXEEXT) \
-	mbfilter$(EXEEXT) mbformat$(EXEEXT) mbgetesf$(EXEEXT) \
-	mbgrid$(EXEEXT) mbhistogram$(EXEEXT) mbhsdump$(EXEEXT) \
-	mbhysweeppreprocess$(EXEEXT) mbinfo$(EXEEXT) \
-	mbinsreprocess$(EXEEXT) mbkongsbergpreprocess$(EXEEXT) \
-	mblevitus$(EXEEXT) mblist$(EXEEXT) mbmosaic$(EXEEXT) \
-	mbnavlist$(EXEEXT) mbneptune2esf$(EXEEXT) \
-	mbpreprocess$(EXEEXT) mbprocess$(EXEEXT) mbrollbias$(EXEEXT) \
-	mbrolltimelag$(EXEEXT) mbroutetime$(EXEEXT) \
-	mbrphsbias$(EXEEXT) mbsegygrid$(EXEEXT) mbsegyinfo$(EXEEXT) \
-	mbsegylist$(EXEEXT) mbset$(EXEEXT) mbsslayout$(EXEEXT) \
-	mbstripnan$(EXEEXT) mbsvplist$(EXEEXT) mbsvpselect$(EXEEXT) \
-	mbswplspreprocess$(EXEEXT) mbtime$(EXEEXT) $(am__EXEEXT_1)
-subdir = src/utilities
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/depcomp $(include_HEADERS)
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
-	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
-	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
-	$(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-	$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/src/mbio/mb_config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
- at BUILD_FFTW_TRUE@am__EXEEXT_1 = mbsegypsd$(EXEEXT)
-am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(includedir)"
-PROGRAMS = $(bin_PROGRAMS)
-am_mb7k2jstar_OBJECTS = mb7k2jstar.$(OBJEXT)
-mb7k2jstar_OBJECTS = $(am_mb7k2jstar_OBJECTS)
-mb7k2jstar_LDADD = $(LDADD)
-AM_V_lt = $(am__v_lt_ at AM_V@)
-am__v_lt_ = $(am__v_lt_ at AM_DEFAULT_V@)
-am__v_lt_0 = --silent
-am__v_lt_1 = 
-am_mb7k2ss_OBJECTS = mb7k2ss.$(OBJEXT)
-mb7k2ss_OBJECTS = $(am_mb7k2ss_OBJECTS)
-mb7k2ss_DEPENDENCIES = ${top_builddir}/src/mbaux/libmbaux.la
-am_mb7kpreprocess_OBJECTS = mb7kpreprocess.$(OBJEXT)
-mb7kpreprocess_OBJECTS = $(am_mb7kpreprocess_OBJECTS)
-mb7kpreprocess_DEPENDENCIES = ${top_builddir}/src/mbaux/libmbaux.la
-am_mbabsorption_OBJECTS = mbabsorption.$(OBJEXT)
-mbabsorption_OBJECTS = $(am_mbabsorption_OBJECTS)
-mbabsorption_LDADD = $(LDADD)
-am_mbareaclean_OBJECTS = mbareaclean.$(OBJEXT)
-mbareaclean_OBJECTS = $(am_mbareaclean_OBJECTS)
-mbareaclean_LDADD = $(LDADD)
-am_mbauvloglist_OBJECTS = mbauvloglist.$(OBJEXT)
-mbauvloglist_OBJECTS = $(am_mbauvloglist_OBJECTS)
-mbauvloglist_DEPENDENCIES = ${top_builddir}/src/mbaux/libmbaux.la
-am_mbauvnavusbl_OBJECTS = mbauvnavusbl.$(OBJEXT)
-mbauvnavusbl_OBJECTS = $(am_mbauvnavusbl_OBJECTS)
-mbauvnavusbl_DEPENDENCIES = ${top_builddir}/src/mbaux/libmbaux.la
-am_mbbackangle_OBJECTS = mbbackangle.$(OBJEXT)
-mbbackangle_OBJECTS = $(am_mbbackangle_OBJECTS)
-mbbackangle_DEPENDENCIES = ${top_builddir}/src/mbaux/libmbaux.la
-am_mbclean_OBJECTS = mbclean.$(OBJEXT)
-mbclean_OBJECTS = $(am_mbclean_OBJECTS)
-mbclean_LDADD = $(LDADD)
-am_mbcopy_OBJECTS = mbcopy.$(OBJEXT)
-mbcopy_OBJECTS = $(am_mbcopy_OBJECTS)
-mbcopy_DEPENDENCIES = ${top_builddir}/src/gsf/libmbgsf.la
-am_mbctdlist_OBJECTS = mbctdlist.$(OBJEXT)
-mbctdlist_OBJECTS = $(am_mbctdlist_OBJECTS)
-mbctdlist_DEPENDENCIES = ${top_builddir}/src/mbaux/libmbaux.la
-am_mbdatalist_OBJECTS = mbdatalist.$(OBJEXT)
-mbdatalist_OBJECTS = $(am_mbdatalist_OBJECTS)
-mbdatalist_LDADD = $(LDADD)
-am_mbdefaults_OBJECTS = mbdefaults.$(OBJEXT)
-mbdefaults_OBJECTS = $(am_mbdefaults_OBJECTS)
-mbdefaults_LDADD = $(LDADD)
-am_mbdumpesf_OBJECTS = mbdumpesf.$(OBJEXT)
-mbdumpesf_OBJECTS = $(am_mbdumpesf_OBJECTS)
-mbdumpesf_LDADD = $(LDADD)
-am_mbextractsegy_OBJECTS = mbextractsegy.$(OBJEXT)
-mbextractsegy_OBJECTS = $(am_mbextractsegy_OBJECTS)
-mbextractsegy_LDADD = $(LDADD)
-am_mbfilter_OBJECTS = mbfilter.$(OBJEXT)
-mbfilter_OBJECTS = $(am_mbfilter_OBJECTS)
-mbfilter_LDADD = $(LDADD)
-am_mbformat_OBJECTS = mbformat.$(OBJEXT)
-mbformat_OBJECTS = $(am_mbformat_OBJECTS)
-mbformat_LDADD = $(LDADD)
-am_mbgetesf_OBJECTS = mbgetesf.$(OBJEXT)
-mbgetesf_OBJECTS = $(am_mbgetesf_OBJECTS)
-mbgetesf_LDADD = $(LDADD)
-am_mbgrid_OBJECTS = mbgrid.$(OBJEXT)
-mbgrid_OBJECTS = $(am_mbgrid_OBJECTS)
-mbgrid_DEPENDENCIES = ${top_builddir}/src/mbaux/libmbaux.la
-am_mbhistogram_OBJECTS = mbhistogram.$(OBJEXT)
-mbhistogram_OBJECTS = $(am_mbhistogram_OBJECTS)
-mbhistogram_LDADD = $(LDADD)
-am_mbhsdump_OBJECTS = mbhsdump.$(OBJEXT)
-mbhsdump_OBJECTS = $(am_mbhsdump_OBJECTS)
-mbhsdump_LDADD = $(LDADD)
-am_mbhysweeppreprocess_OBJECTS = mbhysweeppreprocess.$(OBJEXT)
-mbhysweeppreprocess_OBJECTS = $(am_mbhysweeppreprocess_OBJECTS)
-mbhysweeppreprocess_DEPENDENCIES =  \
-	${top_builddir}/src/mbaux/libmbaux.la
-am_mbinfo_OBJECTS = mbinfo.$(OBJEXT)
-mbinfo_OBJECTS = $(am_mbinfo_OBJECTS)
-mbinfo_LDADD = $(LDADD)
-am_mbinsreprocess_OBJECTS = mbinsreprocess.$(OBJEXT)
-mbinsreprocess_OBJECTS = $(am_mbinsreprocess_OBJECTS)
-mbinsreprocess_LDADD = $(LDADD)
-am_mbkongsbergpreprocess_OBJECTS = mbkongsbergpreprocess.$(OBJEXT)
-mbkongsbergpreprocess_OBJECTS = $(am_mbkongsbergpreprocess_OBJECTS)
-mbkongsbergpreprocess_DEPENDENCIES =  \
-	${top_builddir}/src/mbaux/libmbaux.la
-am_mblevitus_OBJECTS = mblevitus.$(OBJEXT)
-mblevitus_OBJECTS = $(am_mblevitus_OBJECTS)
-mblevitus_LDADD = $(LDADD)
-am_mblist_OBJECTS = mblist.$(OBJEXT)
-mblist_OBJECTS = $(am_mblist_OBJECTS)
-mblist_LDADD = $(LDADD)
-am_mbmosaic_OBJECTS = mbmosaic.$(OBJEXT)
-mbmosaic_OBJECTS = $(am_mbmosaic_OBJECTS)
-mbmosaic_DEPENDENCIES = ${top_builddir}/src/mbaux/libmbaux.la
-am_mbnavlist_OBJECTS = mbnavlist.$(OBJEXT)
-mbnavlist_OBJECTS = $(am_mbnavlist_OBJECTS)
-mbnavlist_LDADD = $(LDADD)
-am_mbneptune2esf_OBJECTS = mbneptune2esf.$(OBJEXT)
-mbneptune2esf_OBJECTS = $(am_mbneptune2esf_OBJECTS)
-mbneptune2esf_LDADD = $(LDADD)
-am_mbpreprocess_OBJECTS = mbpreprocess.$(OBJEXT)
-mbpreprocess_OBJECTS = $(am_mbpreprocess_OBJECTS)
-mbpreprocess_DEPENDENCIES = ${top_builddir}/src/mbaux/libmbaux.la
-am_mbprocess_OBJECTS = mbprocess.$(OBJEXT)
-mbprocess_OBJECTS = $(am_mbprocess_OBJECTS)
-mbprocess_DEPENDENCIES = ${top_builddir}/src/gsf/libmbgsf.la \
-	${top_builddir}/src/mbaux/libmbaux.la
-am_mbrollbias_OBJECTS = mbrollbias.$(OBJEXT)
-mbrollbias_OBJECTS = $(am_mbrollbias_OBJECTS)
-mbrollbias_LDADD = $(LDADD)
-am_mbrolltimelag_OBJECTS = mbrolltimelag.$(OBJEXT)
-mbrolltimelag_OBJECTS = $(am_mbrolltimelag_OBJECTS)
-mbrolltimelag_LDADD = $(LDADD)
-am_mbroutetime_OBJECTS = mbroutetime.$(OBJEXT)
-mbroutetime_OBJECTS = $(am_mbroutetime_OBJECTS)
-mbroutetime_LDADD = $(LDADD)
-am_mbrphsbias_OBJECTS = mbrphsbias.$(OBJEXT)
-mbrphsbias_OBJECTS = $(am_mbrphsbias_OBJECTS)
-mbrphsbias_LDADD = $(LDADD)
-am_mbsegygrid_OBJECTS = mbsegygrid.$(OBJEXT)
-mbsegygrid_OBJECTS = $(am_mbsegygrid_OBJECTS)
-mbsegygrid_DEPENDENCIES = ${top_builddir}/src/mbaux/libmbaux.la
-am_mbsegyinfo_OBJECTS = mbsegyinfo.$(OBJEXT)
-mbsegyinfo_OBJECTS = $(am_mbsegyinfo_OBJECTS)
-mbsegyinfo_LDADD = $(LDADD)
-am_mbsegylist_OBJECTS = mbsegylist.$(OBJEXT)
-mbsegylist_OBJECTS = $(am_mbsegylist_OBJECTS)
-mbsegylist_LDADD = $(LDADD)
-am__mbsegypsd_SOURCES_DIST = mbsegypsd.c
- at BUILD_FFTW_TRUE@am_mbsegypsd_OBJECTS = mbsegypsd.$(OBJEXT)
-mbsegypsd_OBJECTS = $(am_mbsegypsd_OBJECTS)
-am__DEPENDENCIES_1 =
- at BUILD_FFTW_TRUE@mbsegypsd_DEPENDENCIES =  \
- at BUILD_FFTW_TRUE@	${top_builddir}/src/mbaux/libmbaux.la \
- at BUILD_FFTW_TRUE@	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
- at BUILD_FFTW_TRUE@	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
-mbsegypsd_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
-	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
-	$(mbsegypsd_LDFLAGS) $(LDFLAGS) -o $@
-am_mbset_OBJECTS = mbset.$(OBJEXT)
-mbset_OBJECTS = $(am_mbset_OBJECTS)
-mbset_LDADD = $(LDADD)
-am_mbsslayout_OBJECTS = mbsslayout.$(OBJEXT)
-mbsslayout_OBJECTS = $(am_mbsslayout_OBJECTS)
-mbsslayout_DEPENDENCIES = ${top_builddir}/src/mbaux/libmbaux.la
-am_mbstripnan_OBJECTS = mbstripnan.$(OBJEXT)
-mbstripnan_OBJECTS = $(am_mbstripnan_OBJECTS)
-mbstripnan_LDADD = $(LDADD)
-am_mbsvplist_OBJECTS = mbsvplist.$(OBJEXT)
-mbsvplist_OBJECTS = $(am_mbsvplist_OBJECTS)
-mbsvplist_LDADD = $(LDADD)
-am_mbsvpselect_OBJECTS = mbsvpselect.$(OBJEXT) geodesic.$(OBJEXT)
-mbsvpselect_OBJECTS = $(am_mbsvpselect_OBJECTS)
-mbsvpselect_LDADD = $(LDADD)
-am_mbswplspreprocess_OBJECTS = mbswplspreprocess.$(OBJEXT)
-mbswplspreprocess_OBJECTS = $(am_mbswplspreprocess_OBJECTS)
-mbswplspreprocess_DEPENDENCIES =  \
-	${top_builddir}/src/mbaux/libmbaux.la
-am_mbtime_OBJECTS = mbtime.$(OBJEXT)
-mbtime_OBJECTS = $(am_mbtime_OBJECTS)
-mbtime_LDADD = $(LDADD)
-AM_V_P = $(am__v_P_ at AM_V@)
-am__v_P_ = $(am__v_P_ at AM_DEFAULT_V@)
-am__v_P_0 = false
-am__v_P_1 = :
-AM_V_GEN = $(am__v_GEN_ at AM_V@)
-am__v_GEN_ = $(am__v_GEN_ at AM_DEFAULT_V@)
-am__v_GEN_0 = @echo "  GEN     " $@;
-am__v_GEN_1 = 
-AM_V_at = $(am__v_at_ at AM_V@)
-am__v_at_ = $(am__v_at_ at AM_DEFAULT_V@)
-am__v_at_0 = @
-am__v_at_1 = 
-DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)/src/mbio
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
-am__mv = mv -f
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
-	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
-	$(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
-	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
-	$(AM_CFLAGS) $(CFLAGS)
-AM_V_CC = $(am__v_CC_ at AM_V@)
-am__v_CC_ = $(am__v_CC_ at AM_DEFAULT_V@)
-am__v_CC_0 = @echo "  CC      " $@;
-am__v_CC_1 = 
-CCLD = $(CC)
-LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
-	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
-	$(AM_LDFLAGS) $(LDFLAGS) -o $@
-AM_V_CCLD = $(am__v_CCLD_ at AM_V@)
-am__v_CCLD_ = $(am__v_CCLD_ at AM_DEFAULT_V@)
-am__v_CCLD_0 = @echo "  CCLD    " $@;
-am__v_CCLD_1 = 
-SOURCES = $(mb7k2jstar_SOURCES) $(mb7k2ss_SOURCES) \
-	$(mb7kpreprocess_SOURCES) $(mbabsorption_SOURCES) \
-	$(mbareaclean_SOURCES) $(mbauvloglist_SOURCES) \
-	$(mbauvnavusbl_SOURCES) $(mbbackangle_SOURCES) \
-	$(mbclean_SOURCES) $(mbcopy_SOURCES) $(mbctdlist_SOURCES) \
-	$(mbdatalist_SOURCES) $(mbdefaults_SOURCES) \
-	$(mbdumpesf_SOURCES) $(mbextractsegy_SOURCES) \
-	$(mbfilter_SOURCES) $(mbformat_SOURCES) $(mbgetesf_SOURCES) \
-	$(mbgrid_SOURCES) $(mbhistogram_SOURCES) $(mbhsdump_SOURCES) \
-	$(mbhysweeppreprocess_SOURCES) $(mbinfo_SOURCES) \
-	$(mbinsreprocess_SOURCES) $(mbkongsbergpreprocess_SOURCES) \
-	$(mblevitus_SOURCES) $(mblist_SOURCES) $(mbmosaic_SOURCES) \
-	$(mbnavlist_SOURCES) $(mbneptune2esf_SOURCES) \
-	$(mbpreprocess_SOURCES) $(mbprocess_SOURCES) \
-	$(mbrollbias_SOURCES) $(mbrolltimelag_SOURCES) \
-	$(mbroutetime_SOURCES) $(mbrphsbias_SOURCES) \
-	$(mbsegygrid_SOURCES) $(mbsegyinfo_SOURCES) \
-	$(mbsegylist_SOURCES) $(mbsegypsd_SOURCES) $(mbset_SOURCES) \
-	$(mbsslayout_SOURCES) $(mbstripnan_SOURCES) \
-	$(mbsvplist_SOURCES) $(mbsvpselect_SOURCES) \
-	$(mbswplspreprocess_SOURCES) $(mbtime_SOURCES)
-DIST_SOURCES = $(mb7k2jstar_SOURCES) $(mb7k2ss_SOURCES) \
-	$(mb7kpreprocess_SOURCES) $(mbabsorption_SOURCES) \
-	$(mbareaclean_SOURCES) $(mbauvloglist_SOURCES) \
-	$(mbauvnavusbl_SOURCES) $(mbbackangle_SOURCES) \
-	$(mbclean_SOURCES) $(mbcopy_SOURCES) $(mbctdlist_SOURCES) \
-	$(mbdatalist_SOURCES) $(mbdefaults_SOURCES) \
-	$(mbdumpesf_SOURCES) $(mbextractsegy_SOURCES) \
-	$(mbfilter_SOURCES) $(mbformat_SOURCES) $(mbgetesf_SOURCES) \
-	$(mbgrid_SOURCES) $(mbhistogram_SOURCES) $(mbhsdump_SOURCES) \
-	$(mbhysweeppreprocess_SOURCES) $(mbinfo_SOURCES) \
-	$(mbinsreprocess_SOURCES) $(mbkongsbergpreprocess_SOURCES) \
-	$(mblevitus_SOURCES) $(mblist_SOURCES) $(mbmosaic_SOURCES) \
-	$(mbnavlist_SOURCES) $(mbneptune2esf_SOURCES) \
-	$(mbpreprocess_SOURCES) $(mbprocess_SOURCES) \
-	$(mbrollbias_SOURCES) $(mbrolltimelag_SOURCES) \
-	$(mbroutetime_SOURCES) $(mbrphsbias_SOURCES) \
-	$(mbsegygrid_SOURCES) $(mbsegyinfo_SOURCES) \
-	$(mbsegylist_SOURCES) $(am__mbsegypsd_SOURCES_DIST) \
-	$(mbset_SOURCES) $(mbsslayout_SOURCES) $(mbstripnan_SOURCES) \
-	$(mbsvplist_SOURCES) $(mbsvpselect_SOURCES) \
-	$(mbswplspreprocess_SOURCES) $(mbtime_SOURCES)
-am__can_run_installinfo = \
-  case $$AM_UPDATE_INFO_DIR in \
-    n|no|NO) false;; \
-    *) (install-info --version) >/dev/null 2>&1;; \
-  esac
-am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
-am__vpath_adj = case $$p in \
-    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
-    *) f=$$p;; \
-  esac;
-am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
-am__install_max = 40
-am__nobase_strip_setup = \
-  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
-am__nobase_strip = \
-  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
-am__nobase_list = $(am__nobase_strip_setup); \
-  for p in $$list; do echo "$$p $$p"; done | \
-  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
-  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
-    if (++n[$$2] == $(am__install_max)) \
-      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
-    END { for (dir in files) print dir, files[dir] }'
-am__base_list = \
-  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
-  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
-am__uninstall_files_from_dir = { \
-  test -z "$$files" \
-    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
-    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
-         $(am__cd) "$$dir" && rm -f $$files; }; \
-  }
-HEADERS = $(include_HEADERS)
-am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
-# Read a list of newline-separated strings from the standard input,
-# and print each of them once, without duplicates.  Input order is
-# *not* preserved.
-am__uniquify_input = $(AWK) '\
-  BEGIN { nonempty = 0; } \
-  { items[$$0] = 1; nonempty = 1; } \
-  END { if (nonempty) { for (i in items) print i; }; } \
-'
-# Make sure the list of sources is unique.  This is necessary because,
-# e.g., the same source file might be shared among _SOURCES variables
-# for different programs/libraries.
-am__define_uniq_tagged_files = \
-  list='$(am__tagged_files)'; \
-  unique=`for i in $$list; do \
-    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-  done | $(am__uniquify_input)`
-ETAGS = etags
-CTAGS = ctags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-CC = @CC@
-CCAS = @CCAS@
-CCASDEPMODE = @CCASDEPMODE@
-CCASFLAGS = @CCASFLAGS@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DLLTOOL = @DLLTOOL@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GREP = @GREP@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBM = @LIBM@
-LIBOBJS = @LIBOBJS@
-LIBS = ${top_builddir}/src/mbio/libmbio.la \
-       	${libgmt_LIBS} ${libnetcdf_LIBS} ${libproj_LIBS} \
-        $(LIBM)
-
-LIBTOOL = @LIBTOOL@
-LIBTOOL_DEPS = @LIBTOOL_DEPS@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LTLIBOBJS = @LTLIBOBJS@
-LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
-MAINT = @MAINT@
-MAKEINFO = @MAKEINFO@
-MANIFEST_TOOL = @MANIFEST_TOOL@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-OTPS_DIR = @OTPS_DIR@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_URL = @PACKAGE_URL@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PKG_CONFIG = @PKG_CONFIG@
-PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
-PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-VERSION = @VERSION@
-XDR_LIB = @XDR_LIB@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_AR = @ac_ct_AR@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-fftw_app = @fftw_app@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libGLU_CFLAGS = @libGLU_CFLAGS@
-libGLU_LIBS = @libGLU_LIBS@
-libXm_CFLAGS = @libXm_CFLAGS@
-libXm_LIBS = @libXm_LIBS@
-libdir = @libdir@
-libexecdir = @libexecdir@
-libfftw3_CFLAGS = @libfftw3_CFLAGS@
-libfftw3_LIBS = @libfftw3_LIBS@
-libfftw_CPPFLAGS = @libfftw_CPPFLAGS@
-libfftw_LIBS = @libfftw_LIBS@
-libgmt_CFLAGS = @libgmt_CFLAGS@
-libgmt_CPPFLAGS = @libgmt_CPPFLAGS@
-libgmt_LIBS = @libgmt_LIBS@
-libmotif_CPPFLAGS = @libmotif_CPPFLAGS@
-libmotif_LIBS = @libmotif_LIBS@
-libnetcdf_CFLAGS = @libnetcdf_CFLAGS@
-libnetcdf_CPPFLAGS = @libnetcdf_CPPFLAGS@
-libnetcdf_LIBS = @libnetcdf_LIBS@
-libopengl_CPPFLAGS = @libopengl_CPPFLAGS@
-libopengl_LIBS = @libopengl_LIBS@
-libproj_CFLAGS = @libproj_CFLAGS@
-libproj_CPPFLAGS = @libproj_CPPFLAGS@
-libproj_LIBS = @libproj_LIBS@
-libpsl_CFLAGS = @libpsl_CFLAGS@
-libpsl_LIBS = @libpsl_LIBS@
-localedir = @localedir@
-localstatedir = @localstatedir@
-mandir = @mandir@
-mbsystemdatadir = @mbsystemdatadir@
-mbsystemhtmldir = @mbsystemhtmldir@
-mbsystempsdir = @mbsystempsdir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
- at BUILD_FFTW_TRUE@FFTW_PROG = mbsegypsd
-include_HEADERS = levitus.h
-AM_CFLAGS = ${libgmt_CFLAGS} ${libnetcdf_CFLAGS}
-AM_CPPFLAGS = -I${top_srcdir}/src/mbio \
-	      -I${top_srcdir}/src/mbaux \
-	      -I${top_srcdir}/src/gsf \
-	      ${libgmt_CPPFLAGS} \
-	      ${libnetcdf_CPPFLAGS} \
-	      ${libfftw_CPPFLAGS}
-
-AM_LDFLAGS = 
-mb7k2jstar_SOURCES = mb7k2jstar.c
-mb7k2ss_LDADD = ${top_builddir}/src/mbaux/libmbaux.la
-mb7k2ss_SOURCES = mb7k2ss.c
-mb7kpreprocess_LDADD = ${top_builddir}/src/mbaux/libmbaux.la
-mb7kpreprocess_SOURCES = mb7kpreprocess.c
-mbabsorption_SOURCES = mbabsorption.c
-mbareaclean_SOURCES = mbareaclean.c
-mbauvloglist_LDADD = ${top_builddir}/src/mbaux/libmbaux.la
-mbauvloglist_SOURCES = mbauvloglist.c
-mbauvnavusbl_LDADD = ${top_builddir}/src/mbaux/libmbaux.la
-mbauvnavusbl_SOURCES = mbauvnavusbl.c
-mbbackangle_LDADD = ${top_builddir}/src/mbaux/libmbaux.la
-mbbackangle_SOURCES = mbbackangle.c
-mbclean_SOURCES = mbclean.c
-mbcopy_LDADD = ${top_builddir}/src/gsf/libmbgsf.la
-mbcopy_SOURCES = mbcopy.c
-mbctdlist_LDADD = ${top_builddir}/src/mbaux/libmbaux.la
-mbctdlist_SOURCES = mbctdlist.c
-mbdatalist_SOURCES = mbdatalist.c
-mbdefaults_SOURCES = mbdefaults.c
-mbdumpesf_SOURCES = mbdumpesf.c
-mbextractsegy_SOURCES = mbextractsegy.c
-mbfilter_SOURCES = mbfilter.c
-mbformat_SOURCES = mbformat.c
-mbgetesf_SOURCES = mbgetesf.c
-mbgrid_LDADD = ${top_builddir}/src/mbaux/libmbaux.la
-mbgrid_SOURCES = mbgrid.c
-mbhistogram_SOURCES = mbhistogram.c
-mbhsdump_SOURCES = mbhsdump.c
-mbhysweeppreprocess_LDADD = ${top_builddir}/src/mbaux/libmbaux.la
-mbhysweeppreprocess_SOURCES = mbhysweeppreprocess.c
-mbinfo_SOURCES = mbinfo.c
-mbinsreprocess_SOURCES = mbinsreprocess.c
-mbkongsbergpreprocess_LDADD = ${top_builddir}/src/mbaux/libmbaux.la
-mbkongsbergpreprocess_SOURCES = mbkongsbergpreprocess.c
-mblevitus_SOURCES = mblevitus.c
-mblist_SOURCES = mblist.c
-mbmosaic_LDADD = ${top_builddir}/src/mbaux/libmbaux.la
-mbmosaic_SOURCES = mbmosaic.c
-mbnavlist_SOURCES = mbnavlist.c
-mbneptune2esf_SOURCES = mbneptune2esf.c
-mbpreprocess_LDADD = ${top_builddir}/src/mbaux/libmbaux.la
-mbpreprocess_SOURCES = mbpreprocess.c
-mbprocess_LDADD = ${top_builddir}/src/gsf/libmbgsf.la ${top_builddir}/src/mbaux/libmbaux.la
-mbprocess_SOURCES = mbprocess.c
-mbrollbias_SOURCES = mbrollbias.c
-mbrolltimelag_SOURCES = mbrolltimelag.c
-mbroutetime_SOURCES = mbroutetime.c
-mbrphsbias_SOURCES = mbrphsbias.c
-mbsegygrid_LDADD = ${top_builddir}/src/mbaux/libmbaux.la
-mbsegygrid_SOURCES = mbsegygrid.c
-mbsegyinfo_SOURCES = mbsegyinfo.c
-mbsegylist_SOURCES = mbsegylist.c
-mbset_SOURCES = mbset.c
-mbsslayout_LDADD = ${top_builddir}/src/mbaux/libmbaux.la
-mbsslayout_SOURCES = mbsslayout.c
-mbstripnan_SOURCES = mbstripnan.c
-mbsvplist_SOURCES = mbsvplist.c
-mbsvpselect_SOURCES = mbsvpselect.c geodesic.c
-mbswplspreprocess_LDADD = ${top_builddir}/src/mbaux/libmbaux.la
-mbswplspreprocess_SOURCES = mbswplspreprocess.c
-mbtime_SOURCES = mbtime.c
- at BUILD_FFTW_TRUE@mbsegypsd_LDADD = ${top_builddir}/src/mbaux/libmbaux.la \
- at BUILD_FFTW_TRUE@                  ${libgmt_LIBS} ${libnetcdf_LIBS} ${libproj_LIBS} ${libfftw_LIBS}
-
- at BUILD_FFTW_TRUE@mbsegypsd_SOURCES = mbsegypsd.c
- at BUILD_FFTW_TRUE@mbsegypsd_LDFLAGS = 
-BUILT_SOURCES = levitus.h
-CLEANFILES = levitus.h
-DISTCLEANFILES = levitus.h
-all: $(BUILT_SOURCES)
-	$(MAKE) $(AM_MAKEFLAGS) all-am
-
-.SUFFIXES:
-.SUFFIXES: .c .lo .o .obj
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
-	@for dep in $?; do \
-	  case '$(am__configure_deps)' in \
-	    *$$dep*) \
-	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-	        && { if test -f $@; then exit 0; else break; fi; }; \
-	      exit 1;; \
-	  esac; \
-	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/utilities/Makefile'; \
-	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --gnu src/utilities/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	@case '$?' in \
-	  *config.status*) \
-	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-	esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-install-binPROGRAMS: $(bin_PROGRAMS)
-	@$(NORMAL_INSTALL)
-	@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
-	if test -n "$$list"; then \
-	  echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
-	  $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
-	fi; \
-	for p in $$list; do echo "$$p $$p"; done | \
-	sed 's/$(EXEEXT)$$//' | \
-	while read p p1; do if test -f $$p \
-	 || test -f $$p1 \
-	  ; then echo "$$p"; echo "$$p"; else :; fi; \
-	done | \
-	sed -e 'p;s,.*/,,;n;h' \
-	    -e 's|.*|.|' \
-	    -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
-	sed 'N;N;N;s,\n, ,g' | \
-	$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
-	  { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
-	    if ($$2 == $$4) files[d] = files[d] " " $$1; \
-	    else { print "f", $$3 "/" $$4, $$1; } } \
-	  END { for (d in files) print "f", d, files[d] }' | \
-	while read type dir files; do \
-	    if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
-	    test -z "$$files" || { \
-	    echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
-	    $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
-	    } \
-	; done
-
-uninstall-binPROGRAMS:
-	@$(NORMAL_UNINSTALL)
-	@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
-	files=`for p in $$list; do echo "$$p"; done | \
-	  sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
-	      -e 's/$$/$(EXEEXT)/' \
-	`; \
-	test -n "$$list" || exit 0; \
-	echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
-	cd "$(DESTDIR)$(bindir)" && rm -f $$files
-
-clean-binPROGRAMS:
-	@list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \
-	echo " rm -f" $$list; \
-	rm -f $$list || exit $$?; \
-	test -n "$(EXEEXT)" || exit 0; \
-	list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
-	echo " rm -f" $$list; \
-	rm -f $$list
-
-mb7k2jstar$(EXEEXT): $(mb7k2jstar_OBJECTS) $(mb7k2jstar_DEPENDENCIES) $(EXTRA_mb7k2jstar_DEPENDENCIES) 
-	@rm -f mb7k2jstar$(EXEEXT)
-	$(AM_V_CCLD)$(LINK) $(mb7k2jstar_OBJECTS) $(mb7k2jstar_LDADD) $(LIBS)
-
-mb7k2ss$(EXEEXT): $(mb7k2ss_OBJECTS) $(mb7k2ss_DEPENDENCIES) $(EXTRA_mb7k2ss_DEPENDENCIES) 
-	@rm -f mb7k2ss$(EXEEXT)
-	$(AM_V_CCLD)$(LINK) $(mb7k2ss_OBJECTS) $(mb7k2ss_LDADD) $(LIBS)
-
-mb7kpreprocess$(EXEEXT): $(mb7kpreprocess_OBJECTS) $(mb7kpreprocess_DEPENDENCIES) $(EXTRA_mb7kpreprocess_DEPENDENCIES) 
-	@rm -f mb7kpreprocess$(EXEEXT)
-	$(AM_V_CCLD)$(LINK) $(mb7kpreprocess_OBJECTS) $(mb7kpreprocess_LDADD) $(LIBS)
-
-mbabsorption$(EXEEXT): $(mbabsorption_OBJECTS) $(mbabsorption_DEPENDENCIES) $(EXTRA_mbabsorption_DEPENDENCIES) 
-	@rm -f mbabsorption$(EXEEXT)
-	$(AM_V_CCLD)$(LINK) $(mbabsorption_OBJECTS) $(mbabsorption_LDADD) $(LIBS)
-
-mbareaclean$(EXEEXT): $(mbareaclean_OBJECTS) $(mbareaclean_DEPENDENCIES) $(EXTRA_mbareaclean_DEPENDENCIES) 
-	@rm -f mbareaclean$(EXEEXT)
-	$(AM_V_CCLD)$(LINK) $(mbareaclean_OBJECTS) $(mbareaclean_LDADD) $(LIBS)
-
-mbauvloglist$(EXEEXT): $(mbauvloglist_OBJECTS) $(mbauvloglist_DEPENDENCIES) $(EXTRA_mbauvloglist_DEPENDENCIES) 
-	@rm -f mbauvloglist$(EXEEXT)
-	$(AM_V_CCLD)$(LINK) $(mbauvloglist_OBJECTS) $(mbauvloglist_LDADD) $(LIBS)
-
-mbauvnavusbl$(EXEEXT): $(mbauvnavusbl_OBJECTS) $(mbauvnavusbl_DEPENDENCIES) $(EXTRA_mbauvnavusbl_DEPENDENCIES) 
-	@rm -f mbauvnavusbl$(EXEEXT)
-	$(AM_V_CCLD)$(LINK) $(mbauvnavusbl_OBJECTS) $(mbauvnavusbl_LDADD) $(LIBS)
-
-mbbackangle$(EXEEXT): $(mbbackangle_OBJECTS) $(mbbackangle_DEPENDENCIES) $(EXTRA_mbbackangle_DEPENDENCIES) 
-	@rm -f mbbackangle$(EXEEXT)
-	$(AM_V_CCLD)$(LINK) $(mbbackangle_OBJECTS) $(mbbackangle_LDADD) $(LIBS)
-
-mbclean$(EXEEXT): $(mbclean_OBJECTS) $(mbclean_DEPENDENCIES) $(EXTRA_mbclean_DEPENDENCIES) 
-	@rm -f mbclean$(EXEEXT)
-	$(AM_V_CCLD)$(LINK) $(mbclean_OBJECTS) $(mbclean_LDADD) $(LIBS)
-
-mbcopy$(EXEEXT): $(mbcopy_OBJECTS) $(mbcopy_DEPENDENCIES) $(EXTRA_mbcopy_DEPENDENCIES) 
-	@rm -f mbcopy$(EXEEXT)
-	$(AM_V_CCLD)$(LINK) $(mbcopy_OBJECTS) $(mbcopy_LDADD) $(LIBS)
-
-mbctdlist$(EXEEXT): $(mbctdlist_OBJECTS) $(mbctdlist_DEPENDENCIES) $(EXTRA_mbctdlist_DEPENDENCIES) 
-	@rm -f mbctdlist$(EXEEXT)
-	$(AM_V_CCLD)$(LINK) $(mbctdlist_OBJECTS) $(mbctdlist_LDADD) $(LIBS)
-
-mbdatalist$(EXEEXT): $(mbdatalist_OBJECTS) $(mbdatalist_DEPENDENCIES) $(EXTRA_mbdatalist_DEPENDENCIES) 
-	@rm -f mbdatalist$(EXEEXT)
-	$(AM_V_CCLD)$(LINK) $(mbdatalist_OBJECTS) $(mbdatalist_LDADD) $(LIBS)
-
-mbdefaults$(EXEEXT): $(mbdefaults_OBJECTS) $(mbdefaults_DEPENDENCIES) $(EXTRA_mbdefaults_DEPENDENCIES) 
-	@rm -f mbdefaults$(EXEEXT)
-	$(AM_V_CCLD)$(LINK) $(mbdefaults_OBJECTS) $(mbdefaults_LDADD) $(LIBS)
-
-mbdumpesf$(EXEEXT): $(mbdumpesf_OBJECTS) $(mbdumpesf_DEPENDENCIES) $(EXTRA_mbdumpesf_DEPENDENCIES) 
-	@rm -f mbdumpesf$(EXEEXT)
-	$(AM_V_CCLD)$(LINK) $(mbdumpesf_OBJECTS) $(mbdumpesf_LDADD) $(LIBS)
-
-mbextractsegy$(EXEEXT): $(mbextractsegy_OBJECTS) $(mbextractsegy_DEPENDENCIES) $(EXTRA_mbextractsegy_DEPENDENCIES) 
-	@rm -f mbextractsegy$(EXEEXT)
-	$(AM_V_CCLD)$(LINK) $(mbextractsegy_OBJECTS) $(mbextractsegy_LDADD) $(LIBS)
-
-mbfilter$(EXEEXT): $(mbfilter_OBJECTS) $(mbfilter_DEPENDENCIES) $(EXTRA_mbfilter_DEPENDENCIES) 
-	@rm -f mbfilter$(EXEEXT)
-	$(AM_V_CCLD)$(LINK) $(mbfilter_OBJECTS) $(mbfilter_LDADD) $(LIBS)
-
-mbformat$(EXEEXT): $(mbformat_OBJECTS) $(mbformat_DEPENDENCIES) $(EXTRA_mbformat_DEPENDENCIES) 
-	@rm -f mbformat$(EXEEXT)
-	$(AM_V_CCLD)$(LINK) $(mbformat_OBJECTS) $(mbformat_LDADD) $(LIBS)
-
-mbgetesf$(EXEEXT): $(mbgetesf_OBJECTS) $(mbgetesf_DEPENDENCIES) $(EXTRA_mbgetesf_DEPENDENCIES) 
-	@rm -f mbgetesf$(EXEEXT)
-	$(AM_V_CCLD)$(LINK) $(mbgetesf_OBJECTS) $(mbgetesf_LDADD) $(LIBS)
-
-mbgrid$(EXEEXT): $(mbgrid_OBJECTS) $(mbgrid_DEPENDENCIES) $(EXTRA_mbgrid_DEPENDENCIES) 
-	@rm -f mbgrid$(EXEEXT)
-	$(AM_V_CCLD)$(LINK) $(mbgrid_OBJECTS) $(mbgrid_LDADD) $(LIBS)
-
-mbhistogram$(EXEEXT): $(mbhistogram_OBJECTS) $(mbhistogram_DEPENDENCIES) $(EXTRA_mbhistogram_DEPENDENCIES) 
-	@rm -f mbhistogram$(EXEEXT)
-	$(AM_V_CCLD)$(LINK) $(mbhistogram_OBJECTS) $(mbhistogram_LDADD) $(LIBS)
-
-mbhsdump$(EXEEXT): $(mbhsdump_OBJECTS) $(mbhsdump_DEPENDENCIES) $(EXTRA_mbhsdump_DEPENDENCIES) 
-	@rm -f mbhsdump$(EXEEXT)
-	$(AM_V_CCLD)$(LINK) $(mbhsdump_OBJECTS) $(mbhsdump_LDADD) $(LIBS)
-
-mbhysweeppreprocess$(EXEEXT): $(mbhysweeppreprocess_OBJECTS) $(mbhysweeppreprocess_DEPENDENCIES) $(EXTRA_mbhysweeppreprocess_DEPENDENCIES) 
-	@rm -f mbhysweeppreprocess$(EXEEXT)
-	$(AM_V_CCLD)$(LINK) $(mbhysweeppreprocess_OBJECTS) $(mbhysweeppreprocess_LDADD) $(LIBS)
-
-mbinfo$(EXEEXT): $(mbinfo_OBJECTS) $(mbinfo_DEPENDENCIES) $(EXTRA_mbinfo_DEPENDENCIES) 
-	@rm -f mbinfo$(EXEEXT)
-	$(AM_V_CCLD)$(LINK) $(mbinfo_OBJECTS) $(mbinfo_LDADD) $(LIBS)
-
-mbinsreprocess$(EXEEXT): $(mbinsreprocess_OBJECTS) $(mbinsreprocess_DEPENDENCIES) $(EXTRA_mbinsreprocess_DEPENDENCIES) 
-	@rm -f mbinsreprocess$(EXEEXT)
-	$(AM_V_CCLD)$(LINK) $(mbinsreprocess_OBJECTS) $(mbinsreprocess_LDADD) $(LIBS)
-
-mbkongsbergpreprocess$(EXEEXT): $(mbkongsbergpreprocess_OBJECTS) $(mbkongsbergpreprocess_DEPENDENCIES) $(EXTRA_mbkongsbergpreprocess_DEPENDENCIES) 
-	@rm -f mbkongsbergpreprocess$(EXEEXT)
-	$(AM_V_CCLD)$(LINK) $(mbkongsbergpreprocess_OBJECTS) $(mbkongsbergpreprocess_LDADD) $(LIBS)
-
-mblevitus$(EXEEXT): $(mblevitus_OBJECTS) $(mblevitus_DEPENDENCIES) $(EXTRA_mblevitus_DEPENDENCIES) 
-	@rm -f mblevitus$(EXEEXT)
-	$(AM_V_CCLD)$(LINK) $(mblevitus_OBJECTS) $(mblevitus_LDADD) $(LIBS)
-
-mblist$(EXEEXT): $(mblist_OBJECTS) $(mblist_DEPENDENCIES) $(EXTRA_mblist_DEPENDENCIES) 
-	@rm -f mblist$(EXEEXT)
-	$(AM_V_CCLD)$(LINK) $(mblist_OBJECTS) $(mblist_LDADD) $(LIBS)
-
-mbmosaic$(EXEEXT): $(mbmosaic_OBJECTS) $(mbmosaic_DEPENDENCIES) $(EXTRA_mbmosaic_DEPENDENCIES) 
-	@rm -f mbmosaic$(EXEEXT)
-	$(AM_V_CCLD)$(LINK) $(mbmosaic_OBJECTS) $(mbmosaic_LDADD) $(LIBS)
-
-mbnavlist$(EXEEXT): $(mbnavlist_OBJECTS) $(mbnavlist_DEPENDENCIES) $(EXTRA_mbnavlist_DEPENDENCIES) 
-	@rm -f mbnavlist$(EXEEXT)
-	$(AM_V_CCLD)$(LINK) $(mbnavlist_OBJECTS) $(mbnavlist_LDADD) $(LIBS)
-
-mbneptune2esf$(EXEEXT): $(mbneptune2esf_OBJECTS) $(mbneptune2esf_DEPENDENCIES) $(EXTRA_mbneptune2esf_DEPENDENCIES) 
-	@rm -f mbneptune2esf$(EXEEXT)
-	$(AM_V_CCLD)$(LINK) $(mbneptune2esf_OBJECTS) $(mbneptune2esf_LDADD) $(LIBS)
-
-mbpreprocess$(EXEEXT): $(mbpreprocess_OBJECTS) $(mbpreprocess_DEPENDENCIES) $(EXTRA_mbpreprocess_DEPENDENCIES) 
-	@rm -f mbpreprocess$(EXEEXT)
-	$(AM_V_CCLD)$(LINK) $(mbpreprocess_OBJECTS) $(mbpreprocess_LDADD) $(LIBS)
-
-mbprocess$(EXEEXT): $(mbprocess_OBJECTS) $(mbprocess_DEPENDENCIES) $(EXTRA_mbprocess_DEPENDENCIES) 
-	@rm -f mbprocess$(EXEEXT)
-	$(AM_V_CCLD)$(LINK) $(mbprocess_OBJECTS) $(mbprocess_LDADD) $(LIBS)
-
-mbrollbias$(EXEEXT): $(mbrollbias_OBJECTS) $(mbrollbias_DEPENDENCIES) $(EXTRA_mbrollbias_DEPENDENCIES) 
-	@rm -f mbrollbias$(EXEEXT)
-	$(AM_V_CCLD)$(LINK) $(mbrollbias_OBJECTS) $(mbrollbias_LDADD) $(LIBS)
-
-mbrolltimelag$(EXEEXT): $(mbrolltimelag_OBJECTS) $(mbrolltimelag_DEPENDENCIES) $(EXTRA_mbrolltimelag_DEPENDENCIES) 
-	@rm -f mbrolltimelag$(EXEEXT)
-	$(AM_V_CCLD)$(LINK) $(mbrolltimelag_OBJECTS) $(mbrolltimelag_LDADD) $(LIBS)
-
-mbroutetime$(EXEEXT): $(mbroutetime_OBJECTS) $(mbroutetime_DEPENDENCIES) $(EXTRA_mbroutetime_DEPENDENCIES) 
-	@rm -f mbroutetime$(EXEEXT)
-	$(AM_V_CCLD)$(LINK) $(mbroutetime_OBJECTS) $(mbroutetime_LDADD) $(LIBS)
-
-mbrphsbias$(EXEEXT): $(mbrphsbias_OBJECTS) $(mbrphsbias_DEPENDENCIES) $(EXTRA_mbrphsbias_DEPENDENCIES) 
-	@rm -f mbrphsbias$(EXEEXT)
-	$(AM_V_CCLD)$(LINK) $(mbrphsbias_OBJECTS) $(mbrphsbias_LDADD) $(LIBS)
-
-mbsegygrid$(EXEEXT): $(mbsegygrid_OBJECTS) $(mbsegygrid_DEPENDENCIES) $(EXTRA_mbsegygrid_DEPENDENCIES) 
-	@rm -f mbsegygrid$(EXEEXT)
-	$(AM_V_CCLD)$(LINK) $(mbsegygrid_OBJECTS) $(mbsegygrid_LDADD) $(LIBS)
-
-mbsegyinfo$(EXEEXT): $(mbsegyinfo_OBJECTS) $(mbsegyinfo_DEPENDENCIES) $(EXTRA_mbsegyinfo_DEPENDENCIES) 
-	@rm -f mbsegyinfo$(EXEEXT)
-	$(AM_V_CCLD)$(LINK) $(mbsegyinfo_OBJECTS) $(mbsegyinfo_LDADD) $(LIBS)
-
-mbsegylist$(EXEEXT): $(mbsegylist_OBJECTS) $(mbsegylist_DEPENDENCIES) $(EXTRA_mbsegylist_DEPENDENCIES) 
-	@rm -f mbsegylist$(EXEEXT)
-	$(AM_V_CCLD)$(LINK) $(mbsegylist_OBJECTS) $(mbsegylist_LDADD) $(LIBS)
-
-mbsegypsd$(EXEEXT): $(mbsegypsd_OBJECTS) $(mbsegypsd_DEPENDENCIES) $(EXTRA_mbsegypsd_DEPENDENCIES) 
-	@rm -f mbsegypsd$(EXEEXT)
-	$(AM_V_CCLD)$(mbsegypsd_LINK) $(mbsegypsd_OBJECTS) $(mbsegypsd_LDADD) $(LIBS)
-
-mbset$(EXEEXT): $(mbset_OBJECTS) $(mbset_DEPENDENCIES) $(EXTRA_mbset_DEPENDENCIES) 
-	@rm -f mbset$(EXEEXT)
-	$(AM_V_CCLD)$(LINK) $(mbset_OBJECTS) $(mbset_LDADD) $(LIBS)
-
-mbsslayout$(EXEEXT): $(mbsslayout_OBJECTS) $(mbsslayout_DEPENDENCIES) $(EXTRA_mbsslayout_DEPENDENCIES) 
-	@rm -f mbsslayout$(EXEEXT)
-	$(AM_V_CCLD)$(LINK) $(mbsslayout_OBJECTS) $(mbsslayout_LDADD) $(LIBS)
-
-mbstripnan$(EXEEXT): $(mbstripnan_OBJECTS) $(mbstripnan_DEPENDENCIES) $(EXTRA_mbstripnan_DEPENDENCIES) 
-	@rm -f mbstripnan$(EXEEXT)
-	$(AM_V_CCLD)$(LINK) $(mbstripnan_OBJECTS) $(mbstripnan_LDADD) $(LIBS)
-
-mbsvplist$(EXEEXT): $(mbsvplist_OBJECTS) $(mbsvplist_DEPENDENCIES) $(EXTRA_mbsvplist_DEPENDENCIES) 
-	@rm -f mbsvplist$(EXEEXT)
-	$(AM_V_CCLD)$(LINK) $(mbsvplist_OBJECTS) $(mbsvplist_LDADD) $(LIBS)
-
-mbsvpselect$(EXEEXT): $(mbsvpselect_OBJECTS) $(mbsvpselect_DEPENDENCIES) $(EXTRA_mbsvpselect_DEPENDENCIES) 
-	@rm -f mbsvpselect$(EXEEXT)
-	$(AM_V_CCLD)$(LINK) $(mbsvpselect_OBJECTS) $(mbsvpselect_LDADD) $(LIBS)
-
-mbswplspreprocess$(EXEEXT): $(mbswplspreprocess_OBJECTS) $(mbswplspreprocess_DEPENDENCIES) $(EXTRA_mbswplspreprocess_DEPENDENCIES) 
-	@rm -f mbswplspreprocess$(EXEEXT)
-	$(AM_V_CCLD)$(LINK) $(mbswplspreprocess_OBJECTS) $(mbswplspreprocess_LDADD) $(LIBS)
-
-mbtime$(EXEEXT): $(mbtime_OBJECTS) $(mbtime_DEPENDENCIES) $(EXTRA_mbtime_DEPENDENCIES) 
-	@rm -f mbtime$(EXEEXT)
-	$(AM_V_CCLD)$(LINK) $(mbtime_OBJECTS) $(mbtime_LDADD) $(LIBS)
-
-mostlyclean-compile:
-	-rm -f *.$(OBJEXT)
-
-distclean-compile:
-	-rm -f *.tab.c
-
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/geodesic.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mb7k2jstar.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mb7k2ss.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mb7kpreprocess.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbabsorption.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbareaclean.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbauvloglist.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbauvnavusbl.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbbackangle.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbclean.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbcopy.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbctdlist.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbdatalist.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbdefaults.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbdumpesf.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbextractsegy.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbfilter.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbformat.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbgetesf.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbgrid.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbhistogram.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbhsdump.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbhysweeppreprocess.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbinfo.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbinsreprocess.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbkongsbergpreprocess.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mblevitus.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mblist.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbmosaic.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbnavlist.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbneptune2esf.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbpreprocess.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbprocess.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbrollbias.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbrolltimelag.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbroutetime.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbrphsbias.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbsegygrid.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbsegyinfo.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbsegylist.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbsegypsd.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbset.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbsslayout.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbstripnan.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbsvplist.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbsvpselect.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbswplspreprocess.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbtime.Po at am__quote@
-
-.c.o:
- at am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(COMPILE) -c -o $@ $<
-
-.c.obj:
- at am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
- at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-
-.c.lo:
- at am__fastdepCC_TRUE@	$(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(LTCOMPILE) -c -o $@ $<
-
-mostlyclean-libtool:
-	-rm -f *.lo
-
-clean-libtool:
-	-rm -rf .libs _libs
-install-includeHEADERS: $(include_HEADERS)
-	@$(NORMAL_INSTALL)
-	@list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \
-	if test -n "$$list"; then \
-	  echo " $(MKDIR_P) '$(DESTDIR)$(includedir)'"; \
-	  $(MKDIR_P) "$(DESTDIR)$(includedir)" || exit 1; \
-	fi; \
-	for p in $$list; do \
-	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
-	  echo "$$d$$p"; \
-	done | $(am__base_list) | \
-	while read files; do \
-	  echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includedir)'"; \
-	  $(INSTALL_HEADER) $$files "$(DESTDIR)$(includedir)" || exit $$?; \
-	done
-
-uninstall-includeHEADERS:
-	@$(NORMAL_UNINSTALL)
-	@list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \
-	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
-	dir='$(DESTDIR)$(includedir)'; $(am__uninstall_files_from_dir)
-
-ID: $(am__tagged_files)
-	$(am__define_uniq_tagged_files); mkid -fID $$unique
-tags: tags-am
-TAGS: tags
-
-tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
-	set x; \
-	here=`pwd`; \
-	$(am__define_uniq_tagged_files); \
-	shift; \
-	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
-	  test -n "$$unique" || unique=$$empty_fix; \
-	  if test $$# -gt 0; then \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      "$$@" $$unique; \
-	  else \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      $$unique; \
-	  fi; \
-	fi
-ctags: ctags-am
-
-CTAGS: ctags
-ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
-	$(am__define_uniq_tagged_files); \
-	test -z "$(CTAGS_ARGS)$$unique" \
-	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$unique
-
-GTAGS:
-	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && $(am__cd) $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) "$$here"
-cscopelist: cscopelist-am
-
-cscopelist-am: $(am__tagged_files)
-	list='$(am__tagged_files)'; \
-	case "$(srcdir)" in \
-	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
-	  *) sdir=$(subdir)/$(srcdir) ;; \
-	esac; \
-	for i in $$list; do \
-	  if test -f "$$i"; then \
-	    echo "$(subdir)/$$i"; \
-	  else \
-	    echo "$$sdir/$$i"; \
-	  fi; \
-	done >> $(top_builddir)/cscope.files
-
-distclean-tags:
-	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	list='$(DISTFILES)'; \
-	  dist_files=`for file in $$list; do echo $$file; done | \
-	  sed -e "s|^$$srcdirstrip/||;t" \
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
-	case $$dist_files in \
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
-			   sort -u` ;; \
-	esac; \
-	for file in $$dist_files; do \
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  if test -d $$d/$$file; then \
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
-	    if test -d "$(distdir)/$$file"; then \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
-	  else \
-	    test -f "$(distdir)/$$file" \
-	    || cp -p $$d/$$file "$(distdir)/$$file" \
-	    || exit 1; \
-	  fi; \
-	done
-check-am: all-am
-check: $(BUILT_SOURCES)
-	$(MAKE) $(AM_MAKEFLAGS) check-am
-all-am: Makefile $(PROGRAMS) $(HEADERS)
-installdirs:
-	for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(includedir)"; do \
-	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
-	done
-install: $(BUILT_SOURCES)
-	$(MAKE) $(AM_MAKEFLAGS) install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
-	if test -z '$(STRIP)'; then \
-	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	      install; \
-	else \
-	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
-	fi
-mostlyclean-generic:
-
-clean-generic:
-	-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
-
-distclean-generic:
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-	-test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
-
-maintainer-clean-generic:
-	@echo "This command is intended for maintainers to use"
-	@echo "it deletes files that may require special tools to rebuild."
-	-test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
-clean: clean-am
-
-clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am
-
-distclean: distclean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
-	distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am: install-includeHEADERS
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am: install-binPROGRAMS
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic \
-	mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am: uninstall-binPROGRAMS uninstall-includeHEADERS
-
-.MAKE: all check install install-am install-strip
-
-.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \
-	clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \
-	ctags ctags-am distclean distclean-compile distclean-generic \
-	distclean-libtool distclean-tags distdir dvi dvi-am html \
-	html-am info info-am install install-am install-binPROGRAMS \
-	install-data install-data-am install-dvi install-dvi-am \
-	install-exec install-exec-am install-html install-html-am \
-	install-includeHEADERS install-info install-info-am \
-	install-man install-pdf install-pdf-am install-ps \
-	install-ps-am install-strip installcheck installcheck-am \
-	installdirs maintainer-clean maintainer-clean-generic \
-	mostlyclean mostlyclean-compile mostlyclean-generic \
-	mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \
-	uninstall-am uninstall-binPROGRAMS uninstall-includeHEADERS
-
-
-levitus.h: Makefile
-	echo 'char *ifile = "$(mbsystemdatadir)/LevitusAnnual82.dat";' >$@
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/utilities/geodesic.c b/src/utilities/geodesic.c
deleted file mode 100644
index f31187e..0000000
--- a/src/utilities/geodesic.c
+++ /dev/null
@@ -1,1770 +0,0 @@
-/**
- * \file geodesic.c
- * \brief Implementation of the geodesic routines in C
- *
- * For the full documentation see geodesic.h.
- **********************************************************************/
-
-/** @cond SKIP */
-
-/*
- * This is a C implementation of the geodesic algorithms described in
- *
- *   C. F. F. Karney,
- *   Algorithms for geodesics,
- *   J. Geodesy <b>87</b>, 43--55 (2013);
- *   http://dx.doi.org/10.1007/s00190-012-0578-z
- *   Addenda: http://geographiclib.sf.net/geod-addenda.html
- *
- * See the comments in geodesic.h for documentation.
- *
- * Copyright (c) Charles Karney (2012-2013) <charles at karney.com> and licensed
- * under the MIT/X11 License.  For more information, see
- * http://geographiclib.sourceforge.net/
- */
-
-#include "geodesic.h"
-#include <math.h>
-
-#define GEOGRAPHICLIB_GEODESIC_ORDER 6
-#define nC1   GEOGRAPHICLIB_GEODESIC_ORDER
-#define nC1p  GEOGRAPHICLIB_GEODESIC_ORDER
-#define nC2   GEOGRAPHICLIB_GEODESIC_ORDER
-#define nA3   GEOGRAPHICLIB_GEODESIC_ORDER
-#define nA3x  nA3
-#define nC3   GEOGRAPHICLIB_GEODESIC_ORDER
-#define nC3x  ((nC3 * (nC3 - 1)) / 2)
-#define nC4   GEOGRAPHICLIB_GEODESIC_ORDER
-#define nC4x  ((nC4 * (nC4 + 1)) / 2)
-
-typedef double real;
-typedef int boolx;
-
-static unsigned init = 0;
-static const int FALSE = 0;
-static const int TRUE = 1;
-static unsigned digits, maxit1, maxit2;
-static real epsilon, realmin, pi, degree, NaN,
-tiny, tol0, tol1, tol2, tolb, xthresh;
-
-static void Init() {
-    if (!init) {
-#if defined(__DBL_MANT_DIG__)
-        digits = __DBL_MANT_DIG__;
-#else
-        digits = 53;
-#endif
-#if defined(__DBL_EPSILON__)
-        epsilon = __DBL_EPSILON__;
-#else
-        epsilon = pow(0.5, digits - 1);
-#endif
-#if defined(__DBL_MIN__)
-        realmin = __DBL_MIN__;
-#else
-        realmin = pow(0.5, 1022);
-#endif
-#if defined(M_PI)
-        pi = M_PI;
-#else
-        pi = atan2(0.0, -1.0);
-#endif
-        maxit1 = 20;
-        maxit2 = maxit1 + digits + 10;
-        tiny = sqrt(realmin);
-        tol0 = epsilon;
-        /* Increase multiplier in defn of tol1 from 100 to 200 to fix inverse case
-         * 52.784459512564 0 -52.784459512563990912 179.634407464943777557
-         * which otherwise failed for Visual Studio 10 (Release and Debug) */
-        tol1 = 200 * tol0;
-        tol2 = sqrt(tol0);
-        /* Check on bisection interval */
-        tolb = tol0 * tol2;
-        xthresh = 1000 * tol2;
-        degree = pi/180;
-        NaN = sqrt(-1.0);
-        init = 1;
-    }
-}
-
-enum captype {
-    CAP_NONE = 0U,
-    CAP_C1   = 1U<<0,
-    CAP_C1p  = 1U<<1,
-    CAP_C2   = 1U<<2,
-    CAP_C3   = 1U<<3,
-    CAP_C4   = 1U<<4,
-    CAP_ALL  = 0x1FU,
-    OUT_ALL  = 0x7F80U
-};
-
-static real sq(real x) { return x * x; }
-static real log1px(real x) {
-    volatile real
-    y = 1 + x,
-    z = y - 1;
-    /* Here's the explanation for this magic: y = 1 + z, exactly, and z
-     * approx x, thus log(y)/z (which is nearly constant near z = 0) returns
-     * a good approximation to the true log(1 + x)/x.  The multiplication x *
-     * (log(y)/z) introduces little additional error. */
-    return z == 0 ? x : x * log(y) / z;
-}
-
-static real atanhx(real x) {
-    real y = fabs(x);             /* Enforce odd parity */
-    y = log1px(2 * y/(1 - y))/2;
-    return x < 0 ? -y : y;
-}
-
-static real hypotx(real x, real y)
-{ return sqrt(x * x + y * y); }
-
-static real cbrtx(real x) {
-    real y = pow(fabs(x), 1/(real)(3)); /* Return the real cube root */
-    return x < 0 ? -y : y;
-}
-
-static real sumx(real u, real v, real* t) {
-    volatile real s = u + v;
-    volatile real up = s - v;
-    volatile real vpp = s - up;
-    up -= u;
-    vpp -= v;
-    *t = -(up + vpp);
-    /* error-free sum:
-     * u + v =       s      + t
-     *       = round(u + v) + t */
-    return s;
-}
-
-static real minx(real x, real y)
-{ return x < y ? x : y; }
-
-static real maxx(real x, real y)
-{ return x > y ? x : y; }
-
-static void swapx(real* x, real* y)
-{ real t = *x; *x = *y; *y = t; }
-
-static void SinCosNorm(real* sinx, real* cosx) {
-    real r = hypotx(*sinx, *cosx);
-    *sinx /= r;
-    *cosx /= r;
-}
-
-static real AngNormalize(real x)
-{ return x >= 180 ? x - 360 : (x < -180 ? x + 360 : x); }
-static real AngNormalize2(real x)
-{ return AngNormalize(fmod(x, (real)(360))); }
-
-static real AngDiff(real x, real y) {
-    real t, d = sumx(-x, y, &t);
-    if ((d - (real)(180)) + t > (real)(0))       /* y - x > 180 */
-        d -= (real)(360);                          /* exact */
-    else if ((d + (real)(180)) + t <= (real)(0)) /* y - x <= -180 */
-        d += (real)(360);                          /* exact */
-    return d + t;
-}
-
-static real AngRound(real x) {
-    const real z = 1/(real)(16);
-    volatile real y = fabs(x);
-    /* The compiler mustn't "simplify" z - (z - y) to y */
-    y = y < z ? z - (z - y) : y;
-    return x < 0 ? -y : y;
-}
-
-static void A3coeff(struct geod_geodesic* g);
-static void C3coeff(struct geod_geodesic* g);
-static void C4coeff(struct geod_geodesic* g);
-static real SinCosSeries(boolx sinp,
-                         real sinx, real cosx,
-                         const real c[], int n);
-static void Lengths(const struct geod_geodesic* g,
-                    real eps, real sig12,
-                    real ssig1, real csig1, real dn1,
-                    real ssig2, real csig2, real dn2,
-                    real cbet1, real cbet2,
-                    real* ps12b, real* pm12b, real* pm0,
-                    boolx scalep, real* pM12, real* pM21,
-                    /* Scratch areas of the right size */
-                    real C1a[], real C2a[]);
-static real Astroid(real x, real y);
-static real InverseStart(const struct geod_geodesic* g,
-                         real sbet1, real cbet1, real dn1,
-                         real sbet2, real cbet2, real dn2,
-                         real lam12,
-                         real* psalp1, real* pcalp1,
-                         /* Only updated if return val >= 0 */
-                         real* psalp2, real* pcalp2,
-                         /* Only updated for short lines */
-                         real* pdnm,
-                         /* Scratch areas of the right size */
-                         real C1a[], real C2a[]);
-static real Lambda12(const struct geod_geodesic* g,
-                     real sbet1, real cbet1, real dn1,
-                     real sbet2, real cbet2, real dn2,
-                     real salp1, real calp1,
-                     real* psalp2, real* pcalp2,
-                     real* psig12,
-                     real* pssig1, real* pcsig1,
-                     real* pssig2, real* pcsig2,
-                     real* peps, real* pdomg12,
-                     boolx diffp, real* pdlam12,
-                     /* Scratch areas of the right size */
-                     real C1a[], real C2a[], real C3a[]);
-static real A3f(const struct geod_geodesic* g, real eps);
-static void C3f(const struct geod_geodesic* g, real eps, real c[]);
-static void C4f(const struct geod_geodesic* g, real eps, real c[]);
-static real A1m1f(real eps);
-static void C1f(real eps, real c[]);
-static void C1pf(real eps, real c[]);
-static real A2m1f(real eps);
-static void C2f(real eps, real c[]);
-static int transit(real lon1, real lon2);
-static void accini(real s[]);
-static void acccopy(const real s[], real t[]);
-static void accadd(real s[], real y);
-static real accsum(const real s[], real y);
-static void accneg(real s[]);
-
-void geod_init(struct geod_geodesic* g, real a, real f) {
-    if (!init) Init();
-    g->a = a;
-    g->f = f <= 1 ? f : 1/f;
-    g->f1 = 1 - g->f;
-    g->e2 = g->f * (2 - g->f);
-    g->ep2 = g->e2 / sq(g->f1);   /* e2 / (1 - e2) */
-    g->n = g->f / ( 2 - g->f);
-    g->b = g->a * g->f1;
-    g->c2 = (sq(g->a) + sq(g->b) *
-             (g->e2 == 0 ? 1 :
-              (g->e2 > 0 ? atanhx(sqrt(g->e2)) : atan(sqrt(-g->e2))) /
-              sqrt(fabs(g->e2))))/2; /* authalic radius squared */
-    /* The sig12 threshold for "really short".  Using the auxiliary sphere
-     * solution with dnm computed at (bet1 + bet2) / 2, the relative error in the
-     * azimuth consistency check is sig12^2 * abs(f) * min(1, 1-f/2) / 2.  (Error
-     * measured for 1/100 < b/a < 100 and abs(f) >= 1/1000.  For a given f and
-     * sig12, the max error occurs for lines near the pole.  If the old rule for
-     * computing dnm = (dn1 + dn2)/2 is used, then the error increases by a
-     * factor of 2.)  Setting this equal to epsilon gives sig12 = etol2.  Here
-     * 0.1 is a safety factor (error decreased by 100) and max(0.001, abs(f))
-     * stops etol2 getting too large in the nearly spherical case. */
-    g->etol2 = 0.1 * tol2 /
-    sqrt( maxx((real)(0.001), fabs(g->f)) * minx((real)(1), 1 - g->f/2) / 2 );
-    
-    A3coeff(g);
-    C3coeff(g);
-    C4coeff(g);
-}
-
-void geod_lineinit(struct geod_geodesicline* l,
-                   const struct geod_geodesic* g,
-                   real lat1, real lon1, real azi1, unsigned caps) {
-    real alp1, cbet1, sbet1, phi, eps;
-    l->a = g->a;
-    l->f = g->f;
-    l->b = g->b;
-    l->c2 = g->c2;
-    l->f1 = g->f1;
-    /* If caps is 0 assume the standard direct calculation */
-    l->caps = (caps ? caps : GEOD_DISTANCE_IN | GEOD_LONGITUDE) |
-    GEOD_LATITUDE | GEOD_AZIMUTH; /* Always allow latitude and azimuth */
-    
-    /* Guard against underflow in salp0 */
-    azi1 = AngRound(AngNormalize(azi1));
-    lon1 = AngNormalize(lon1);
-    l->lat1 = lat1;
-    l->lon1 = lon1;
-    l->azi1 = azi1;
-    /* alp1 is in [0, pi] */
-    alp1 = azi1 * degree;
-    /* Enforce sin(pi) == 0 and cos(pi/2) == 0.  Better to face the ensuing
-     * problems directly than to skirt them. */
-    l->salp1 =      azi1  == -180 ? 0 : sin(alp1);
-    l->calp1 = fabs(azi1) ==   90 ? 0 : cos(alp1);
-    phi = lat1 * degree;
-    /* Ensure cbet1 = +epsilon at poles */
-    sbet1 = l->f1 * sin(phi);
-    cbet1 = fabs(lat1) == 90 ? tiny : cos(phi);
-    SinCosNorm(&sbet1, &cbet1);
-    l->dn1 = sqrt(1 + g->ep2 * sq(sbet1));
-    
-    /* Evaluate alp0 from sin(alp1) * cos(bet1) = sin(alp0), */
-    l->salp0 = l->salp1 * cbet1; /* alp0 in [0, pi/2 - |bet1|] */
-    /* Alt: calp0 = hypot(sbet1, calp1 * cbet1).  The following
-     * is slightly better (consider the case salp1 = 0). */
-    l->calp0 = hypotx(l->calp1, l->salp1 * sbet1);
-    /* Evaluate sig with tan(bet1) = tan(sig1) * cos(alp1).
-     * sig = 0 is nearest northward crossing of equator.
-     * With bet1 = 0, alp1 = pi/2, we have sig1 = 0 (equatorial line).
-     * With bet1 =  pi/2, alp1 = -pi, sig1 =  pi/2
-     * With bet1 = -pi/2, alp1 =  0 , sig1 = -pi/2
-     * Evaluate omg1 with tan(omg1) = sin(alp0) * tan(sig1).
-     * With alp0 in (0, pi/2], quadrants for sig and omg coincide.
-     * No atan2(0,0) ambiguity at poles since cbet1 = +epsilon.
-     * With alp0 = 0, omg1 = 0 for alp1 = 0, omg1 = pi for alp1 = pi. */
-    l->ssig1 = sbet1; l->somg1 = l->salp0 * sbet1;
-    l->csig1 = l->comg1 = sbet1 != 0 || l->calp1 != 0 ? cbet1 * l->calp1 : 1;
-    SinCosNorm(&l->ssig1, &l->csig1); /* sig1 in (-pi, pi] */
-    /* SinCosNorm(somg1, comg1); -- don't need to normalize! */
-    
-    l->k2 = sq(l->calp0) * g->ep2;
-    eps = l->k2 / (2 * (1 + sqrt(1 + l->k2)) + l->k2);
-    
-    if (l->caps & CAP_C1) {
-        real s, c;
-        l->A1m1 = A1m1f(eps);
-        C1f(eps, l->C1a);
-        l->B11 = SinCosSeries(TRUE, l->ssig1, l->csig1, l->C1a, nC1);
-        s = sin(l->B11); c = cos(l->B11);
-        /* tau1 = sig1 + B11 */
-        l->stau1 = l->ssig1 * c + l->csig1 * s;
-        l->ctau1 = l->csig1 * c - l->ssig1 * s;
-        /* Not necessary because C1pa reverts C1a
-         *    B11 = -SinCosSeries(TRUE, stau1, ctau1, C1pa, nC1p); */
-    }
-    
-    if (l->caps & CAP_C1p)
-        C1pf(eps, l->C1pa);
-    
-    if (l->caps & CAP_C2) {
-        l->A2m1 = A2m1f(eps);
-        C2f(eps, l->C2a);
-        l->B21 = SinCosSeries(TRUE, l->ssig1, l->csig1, l->C2a, nC2);
-    }
-    
-    if (l->caps & CAP_C3) {
-        C3f(g, eps, l->C3a);
-        l->A3c = -l->f * l->salp0 * A3f(g, eps);
-        l->B31 = SinCosSeries(TRUE, l->ssig1, l->csig1, l->C3a, nC3-1);
-    }
-    
-    if (l->caps & CAP_C4) {
-        C4f(g, eps, l->C4a);
-        /* Multiplier = a^2 * e^2 * cos(alpha0) * sin(alpha0) */
-        l->A4 = sq(l->a) * l->calp0 * l->salp0 * g->e2;
-        l->B41 = SinCosSeries(FALSE, l->ssig1, l->csig1, l->C4a, nC4);
-    }
-}
-
-real geod_genposition(const struct geod_geodesicline* l,
-                      boolx arcmode, real s12_a12,
-                      real* plat2, real* plon2, real* pazi2,
-                      real* ps12, real* pm12,
-                      real* pM12, real* pM21,
-                      real* pS12) {
-    real lat2 = 0, lon2 = 0, azi2 = 0, s12 = 0,
-    m12 = 0, M12 = 0, M21 = 0, S12 = 0;
-    /* Avoid warning about uninitialized B12. */
-    real sig12, ssig12, csig12, B12 = 0, AB1 = 0;
-    real omg12, lam12, lon12;
-    real ssig2, csig2, sbet2, cbet2, somg2, comg2, salp2, calp2, dn2;
-    unsigned outmask =
-    (plat2 ? GEOD_LATITUDE : 0U) |
-    (plon2 ? GEOD_LONGITUDE : 0U) |
-    (pazi2 ? GEOD_AZIMUTH : 0U) |
-    (ps12 ? GEOD_DISTANCE : 0U) |
-    (pm12 ? GEOD_REDUCEDLENGTH : 0U) |
-    (pM12 || pM21 ? GEOD_GEODESICSCALE : 0U) |
-    (pS12 ? GEOD_AREA : 0U);
-    
-    outmask &= l->caps & OUT_ALL;
-    if (!( TRUE /*Init()*/ &&
-          (arcmode || (l->caps & GEOD_DISTANCE_IN & OUT_ALL)) ))
-    /* Uninitialized or impossible distance calculation requested */
-        return NaN;
-    
-    if (arcmode) {
-        real s12a;
-        /* Interpret s12_a12 as spherical arc length */
-        sig12 = s12_a12 * degree;
-        s12a = fabs(s12_a12);
-        s12a -= 180 * floor(s12a / 180);
-        ssig12 = s12a ==  0 ? 0 : sin(sig12);
-        csig12 = s12a == 90 ? 0 : cos(sig12);
-    } else {
-        /* Interpret s12_a12 as distance */
-        real
-        tau12 = s12_a12 / (l->b * (1 + l->A1m1)),
-        s = sin(tau12),
-        c = cos(tau12);
-        /* tau2 = tau1 + tau12 */
-        B12 = - SinCosSeries(TRUE,
-                             l->stau1 * c + l->ctau1 * s,
-                             l->ctau1 * c - l->stau1 * s,
-                             l->C1pa, nC1p);
-        sig12 = tau12 - (B12 - l->B11);
-        ssig12 = sin(sig12); csig12 = cos(sig12);
-        if (fabs(l->f) > 0.01) {
-            /* Reverted distance series is inaccurate for |f| > 1/100, so correct
-             * sig12 with 1 Newton iteration.  The following table shows the
-             * approximate maximum error for a = WGS_a() and various f relative to
-             * GeodesicExact.
-             *     erri = the error in the inverse solution (nm)
-             *     errd = the error in the direct solution (series only) (nm)
-             *     errda = the error in the direct solution (series + 1 Newton) (nm)
-             *
-             *       f     erri  errd errda
-             *     -1/5    12e6 1.2e9  69e6
-             *     -1/10  123e3  12e6 765e3
-             *     -1/20   1110 108e3  7155
-             *     -1/50  18.63 200.9 27.12
-             *     -1/100 18.63 23.78 23.37
-             *     -1/150 18.63 21.05 20.26
-             *      1/150 22.35 24.73 25.83
-             *      1/100 22.35 25.03 25.31
-             *      1/50  29.80 231.9 30.44
-             *      1/20   5376 146e3  10e3
-             *      1/10  829e3  22e6 1.5e6
-             *      1/5   157e6 3.8e9 280e6 */
-            real
-            ssig2 = l->ssig1 * csig12 + l->csig1 * ssig12,
-            csig2 = l->csig1 * csig12 - l->ssig1 * ssig12,
-            serr;
-            B12 = SinCosSeries(TRUE, ssig2, csig2, l->C1a, nC1);
-            serr = (1 + l->A1m1) * (sig12 + (B12 - l->B11)) - s12_a12 / l->b;
-            sig12 = sig12 - serr / sqrt(1 + l->k2 * sq(ssig2));
-            ssig12 = sin(sig12); csig12 = cos(sig12);
-            /* Update B12 below */
-        }
-    }
-    
-    /* sig2 = sig1 + sig12 */
-    ssig2 = l->ssig1 * csig12 + l->csig1 * ssig12;
-    csig2 = l->csig1 * csig12 - l->ssig1 * ssig12;
-    dn2 = sqrt(1 + l->k2 * sq(ssig2));
-    if (outmask & (GEOD_DISTANCE | GEOD_REDUCEDLENGTH | GEOD_GEODESICSCALE)) {
-        if (arcmode || fabs(l->f) > 0.01)
-            B12 = SinCosSeries(TRUE, ssig2, csig2, l->C1a, nC1);
-        AB1 = (1 + l->A1m1) * (B12 - l->B11);
-    }
-    /* sin(bet2) = cos(alp0) * sin(sig2) */
-    sbet2 = l->calp0 * ssig2;
-    /* Alt: cbet2 = hypot(csig2, salp0 * ssig2); */
-    cbet2 = hypotx(l->salp0, l->calp0 * csig2);
-    if (cbet2 == 0)
-    /* I.e., salp0 = 0, csig2 = 0.  Break the degeneracy in this case */
-        cbet2 = csig2 = tiny;
-    /* tan(omg2) = sin(alp0) * tan(sig2) */
-    somg2 = l->salp0 * ssig2; comg2 = csig2;  /* No need to normalize */
-    /* tan(alp0) = cos(sig2)*tan(alp2) */
-    salp2 = l->salp0; calp2 = l->calp0 * csig2; /* No need to normalize */
-    /* omg12 = omg2 - omg1 */
-    omg12 = atan2(somg2 * l->comg1 - comg2 * l->somg1,
-                  comg2 * l->comg1 + somg2 * l->somg1);
-    
-    if (outmask & GEOD_DISTANCE)
-        s12 = arcmode ? l->b * ((1 + l->A1m1) * sig12 + AB1) : s12_a12;
-    
-    if (outmask & GEOD_LONGITUDE) {
-        lam12 = omg12 + l->A3c *
-        ( sig12 + (SinCosSeries(TRUE, ssig2, csig2, l->C3a, nC3-1)
-                   - l->B31));
-        lon12 = lam12 / degree;
-        /* Use AngNormalize2 because longitude might have wrapped multiple
-         * times. */
-        lon12 = AngNormalize2(lon12);
-        lon2 = AngNormalize(l->lon1 + lon12);
-    }
-    
-    if (outmask & GEOD_LATITUDE)
-        lat2 = atan2(sbet2, l->f1 * cbet2) / degree;
-    
-    if (outmask & GEOD_AZIMUTH)
-    /* minus signs give range [-180, 180). 0- converts -0 to +0. */
-        azi2 = 0 - atan2(-salp2, calp2) / degree;
-    
-    if (outmask & (GEOD_REDUCEDLENGTH | GEOD_GEODESICSCALE)) {
-        real
-        B22 = SinCosSeries(TRUE, ssig2, csig2, l->C2a, nC2),
-        AB2 = (1 + l->A2m1) * (B22 - l->B21),
-        J12 = (l->A1m1 - l->A2m1) * sig12 + (AB1 - AB2);
-        if (outmask & GEOD_REDUCEDLENGTH)
-        /* Add parens around (csig1 * ssig2) and (ssig1 * csig2) to ensure
-         * accurate cancellation in the case of coincident points. */
-            m12 = l->b * ((dn2 * (l->csig1 * ssig2) - l->dn1 * (l->ssig1 * csig2))
-                          - l->csig1 * csig2 * J12);
-        if (outmask & GEOD_GEODESICSCALE) {
-            real t = l->k2 * (ssig2 - l->ssig1) * (ssig2 + l->ssig1) / (l->dn1 + dn2);
-            M12 = csig12 + (t *  ssig2 -  csig2 * J12) * l->ssig1 / l->dn1;
-            M21 = csig12 - (t * l->ssig1 - l->csig1 * J12) *  ssig2 /  dn2;
-        }
-    }
-    
-    if (outmask & GEOD_AREA) {
-        real
-        B42 = SinCosSeries(FALSE, ssig2, csig2, l->C4a, nC4);
-        real salp12, calp12;
-        if (l->calp0 == 0 || l->salp0 == 0) {
-            /* alp12 = alp2 - alp1, used in atan2 so no need to normalized */
-            salp12 = salp2 * l->calp1 - calp2 * l->salp1;
-            calp12 = calp2 * l->calp1 + salp2 * l->salp1;
-            /* The right thing appears to happen if alp1 = +/-180 and alp2 = 0, viz
-             * salp12 = -0 and alp12 = -180.  However this depends on the sign being
-             * attached to 0 correctly.  The following ensures the correct
-             * behavior. */
-            if (salp12 == 0 && calp12 < 0) {
-                salp12 = tiny * l->calp1;
-                calp12 = -1;
-            }
-        } else {
-            /* tan(alp) = tan(alp0) * sec(sig)
-             * tan(alp2-alp1) = (tan(alp2) -tan(alp1)) / (tan(alp2)*tan(alp1)+1)
-             * = calp0 * salp0 * (csig1-csig2) / (salp0^2 + calp0^2 * csig1*csig2)
-             * If csig12 > 0, write
-             *   csig1 - csig2 = ssig12 * (csig1 * ssig12 / (1 + csig12) + ssig1)
-             * else
-             *   csig1 - csig2 = csig1 * (1 - csig12) + ssig12 * ssig1
-             * No need to normalize */
-            salp12 = l->calp0 * l->salp0 *
-            (csig12 <= 0 ? l->csig1 * (1 - csig12) + ssig12 * l->ssig1 :
-             ssig12 * (l->csig1 * ssig12 / (1 + csig12) + l->ssig1));
-            calp12 = sq(l->salp0) + sq(l->calp0) * l->csig1 * csig2;
-        }
-        S12 = l->c2 * atan2(salp12, calp12) + l->A4 * (B42 - l->B41);
-    }
-    
-    if (outmask & GEOD_LATITUDE)
-        *plat2 = lat2;
-    if (outmask & GEOD_LONGITUDE)
-        *plon2 = lon2;
-    if (outmask & GEOD_AZIMUTH)
-        *pazi2 = azi2;
-    if (outmask & GEOD_DISTANCE)
-        *ps12 = s12;
-    if (outmask & GEOD_REDUCEDLENGTH)
-        *pm12 = m12;
-    if (outmask & GEOD_GEODESICSCALE) {
-        if (pM12) *pM12 = M12;
-        if (pM21) *pM21 = M21;
-    }
-    if (outmask & GEOD_AREA)
-        *pS12 = S12;
-    
-    return arcmode ? s12_a12 : sig12 / degree;
-}
-
-void geod_position(const struct geod_geodesicline* l, real s12,
-                   real* plat2, real* plon2, real* pazi2) {
-    geod_genposition(l, FALSE, s12, plat2, plon2, pazi2, 0, 0, 0, 0, 0);
-}
-
-real geod_gendirect(const struct geod_geodesic* g,
-                    real lat1, real lon1, real azi1,
-                    boolx arcmode, real s12_a12,
-                    real* plat2, real* plon2, real* pazi2,
-                    real* ps12, real* pm12, real* pM12, real* pM21,
-                    real* pS12) {
-    struct geod_geodesicline l;
-    unsigned outmask =
-    (plat2 ? GEOD_LATITUDE : 0U) |
-    (plon2 ? GEOD_LONGITUDE : 0U) |
-    (pazi2 ? GEOD_AZIMUTH : 0U) |
-    (ps12 ? GEOD_DISTANCE : 0U) |
-    (pm12 ? GEOD_REDUCEDLENGTH : 0U) |
-    (pM12 || pM21 ? GEOD_GEODESICSCALE : 0U) |
-    (pS12 ? GEOD_AREA : 0U);
-    
-    geod_lineinit(&l, g, lat1, lon1, azi1,
-                  /* Automatically supply GEOD_DISTANCE_IN if necessary */
-                  outmask | (arcmode ? GEOD_NONE : GEOD_DISTANCE_IN));
-    return geod_genposition(&l, arcmode, s12_a12,
-                            plat2, plon2, pazi2, ps12, pm12, pM12, pM21, pS12);
-}
-
-void geod_direct(const struct geod_geodesic* g,
-                 real lat1, real lon1, real azi1,
-                 real s12,
-                 real* plat2, real* plon2, real* pazi2) {
-    geod_gendirect(g, lat1, lon1, azi1, FALSE, s12, plat2, plon2, pazi2,
-                   0, 0, 0, 0, 0);
-}
-
-real geod_geninverse(const struct geod_geodesic* g,
-                     real lat1, real lon1, real lat2, real lon2,
-                     real* ps12, real* pazi1, real* pazi2,
-                     real* pm12, real* pM12, real* pM21, real* pS12) {
-    real s12 = 0, azi1 = 0, azi2 = 0, m12 = 0, M12 = 0, M21 = 0, S12 = 0;
-    real lon12;
-    int latsign, lonsign, swapp;
-    real phi, sbet1, cbet1, sbet2, cbet2, s12x = 0, m12x = 0;
-    real dn1, dn2, lam12, slam12, clam12;
-    real a12 = 0, sig12, calp1 = 0, salp1 = 0, calp2 = 0, salp2 = 0;
-    /* index zero elements of these arrays are unused */
-    real C1a[nC1 + 1], C2a[nC2 + 1], C3a[nC3];
-    boolx meridian;
-    real omg12 = 0;
-    
-    unsigned outmask =
-    (ps12 ? GEOD_DISTANCE : 0U) |
-    (pazi1 || pazi2 ? GEOD_AZIMUTH : 0U) |
-    (pm12 ? GEOD_REDUCEDLENGTH : 0U) |
-    (pM12 || pM21 ? GEOD_GEODESICSCALE : 0U) |
-    (pS12 ? GEOD_AREA : 0U);
-    
-    outmask &= OUT_ALL;
-    /* Compute longitude difference (AngDiff does this carefully).  Result is
-     * in [-180, 180] but -180 is only for west-going geodesics.  180 is for
-     * east-going and meridional geodesics. */
-    lon12 = AngDiff(AngNormalize(lon1), AngNormalize(lon2));
-    /* If very close to being on the same half-meridian, then make it so. */
-    lon12 = AngRound(lon12);
-    /* Make longitude difference positive. */
-    lonsign = lon12 >= 0 ? 1 : -1;
-    lon12 *= lonsign;
-    /* If really close to the equator, treat as on equator. */
-    lat1 = AngRound(lat1);
-    lat2 = AngRound(lat2);
-    /* Swap points so that point with higher (abs) latitude is point 1 */
-    swapp = fabs(lat1) >= fabs(lat2) ? 1 : -1;
-    if (swapp < 0) {
-        lonsign *= -1;
-        swapx(&lat1, &lat2);
-    }
-    /* Make lat1 <= 0 */
-    latsign = lat1 < 0 ? 1 : -1;
-    lat1 *= latsign;
-    lat2 *= latsign;
-    /* Now we have
-     *
-     *     0 <= lon12 <= 180
-     *     -90 <= lat1 <= 0
-     *     lat1 <= lat2 <= -lat1
-     *
-     * longsign, swapp, latsign register the transformation to bring the
-     * coordinates to this canonical form.  In all cases, 1 means no change was
-     * made.  We make these transformations so that there are few cases to
-     * check, e.g., on verifying quadrants in atan2.  In addition, this
-     * enforces some symmetries in the results returned. */
-    
-    phi = lat1 * degree;
-    /* Ensure cbet1 = +epsilon at poles */
-    sbet1 = g->f1 * sin(phi);
-    cbet1 = lat1 == -90 ? tiny : cos(phi);
-    SinCosNorm(&sbet1, &cbet1);
-    
-    phi = lat2 * degree;
-    /* Ensure cbet2 = +epsilon at poles */
-    sbet2 = g->f1 * sin(phi);
-    cbet2 = fabs(lat2) == 90 ? tiny : cos(phi);
-    SinCosNorm(&sbet2, &cbet2);
-    
-    /* If cbet1 < -sbet1, then cbet2 - cbet1 is a sensitive measure of the
-     * |bet1| - |bet2|.  Alternatively (cbet1 >= -sbet1), abs(sbet2) + sbet1 is
-     * a better measure.  This logic is used in assigning calp2 in Lambda12.
-     * Sometimes these quantities vanish and in that case we force bet2 = +/-
-     * bet1 exactly.  An example where is is necessary is the inverse problem
-     * 48.522876735459 0 -48.52287673545898293 179.599720456223079643
-     * which failed with Visual Studio 10 (Release and Debug) */
-    
-    if (cbet1 < -sbet1) {
-        if (cbet2 == cbet1)
-            sbet2 = sbet2 < 0 ? sbet1 : -sbet1;
-    } else {
-        if (fabs(sbet2) == -sbet1)
-            cbet2 = cbet1;
-    }
-    
-    dn1 = sqrt(1 + g->ep2 * sq(sbet1));
-    dn2 = sqrt(1 + g->ep2 * sq(sbet2));
-    
-    lam12 = lon12 * degree;
-    slam12 = lon12 == 180 ? 0 : sin(lam12);
-    clam12 = cos(lam12);      /* lon12 == 90 isn't interesting */
-    
-    meridian = lat1 == -90 || slam12 == 0;
-    
-    if (meridian) {
-        
-        /* Endpoints are on a single full meridian, so the geodesic might lie on
-         * a meridian. */
-        
-        real ssig1, csig1, ssig2, csig2;
-        calp1 = clam12; salp1 = slam12; /* Head to the target longitude */
-        calp2 = 1; salp2 = 0;           /* At the target we're heading north */
-        
-        /* tan(bet) = tan(sig) * cos(alp) */
-        ssig1 = sbet1; csig1 = calp1 * cbet1;
-        ssig2 = sbet2; csig2 = calp2 * cbet2;
-        
-        /* sig12 = sig2 - sig1 */
-        sig12 = atan2(maxx(csig1 * ssig2 - ssig1 * csig2, (real)(0)),
-                      csig1 * csig2 + ssig1 * ssig2);
-        {
-            real dummy;
-            Lengths(g, g->n, sig12, ssig1, csig1, dn1, ssig2, csig2, dn2,
-                    cbet1, cbet2, &s12x, &m12x, &dummy,
-                    (outmask & GEOD_GEODESICSCALE) != 0U, &M12, &M21, C1a, C2a);
-        }
-        /* Add the check for sig12 since zero length geodesics might yield m12 <
-         * 0.  Test case was
-         *
-         *    echo 20.001 0 20.001 0 | Geod -i
-         *
-         * In fact, we will have sig12 > pi/2 for meridional geodesic which is
-         * not a shortest path. */
-        if (sig12 < 1 || m12x >= 0) {
-            m12x *= g->b;
-            s12x *= g->b;
-            a12 = sig12 / degree;
-        } else
-        /* m12 < 0, i.e., prolate and too close to anti-podal */
-            meridian = FALSE;
-    }
-    
-    if (!meridian &&
-        sbet1 == 0 &&           /* and sbet2 == 0 */
-        /* Mimic the way Lambda12 works with calp1 = 0 */
-        (g->f <= 0 || lam12 <= pi - g->f * pi)) {
-        
-        /* Geodesic runs along equator */
-        calp1 = calp2 = 0; salp1 = salp2 = 1;
-        s12x = g->a * lam12;
-        sig12 = omg12 = lam12 / g->f1;
-        m12x = g->b * sin(sig12);
-        if (outmask & GEOD_GEODESICSCALE)
-            M12 = M21 = cos(sig12);
-        a12 = lon12 / g->f1;
-        
-    } else if (!meridian) {
-        
-        /* Now point1 and point2 belong within a hemisphere bounded by a
-         * meridian and geodesic is neither meridional or equatorial. */
-        
-        /* Figure a starting point for Newton's method */
-        real dnm = 0;
-        sig12 = InverseStart(g, sbet1, cbet1, dn1, sbet2, cbet2, dn2,
-                             lam12,
-                             &salp1, &calp1, &salp2, &calp2, &dnm,
-                             C1a, C2a);
-        
-        if (sig12 >= 0) {
-            /* Short lines (InverseStart sets salp2, calp2, dnm) */
-            s12x = sig12 * g->b * dnm;
-            m12x = sq(dnm) * g->b * sin(sig12 / dnm);
-            if (outmask & GEOD_GEODESICSCALE)
-                M12 = M21 = cos(sig12 / dnm);
-            a12 = sig12 / degree;
-            omg12 = lam12 / (g->f1 * dnm);
-        } else {
-            
-            /* Newton's method.  This is a straightforward solution of f(alp1) =
-             * lambda12(alp1) - lam12 = 0 with one wrinkle.  f(alp) has exactly one
-             * root in the interval (0, pi) and its derivative is positive at the
-             * root.  Thus f(alp) is positive for alp > alp1 and negative for alp <
-             * alp1.  During the course of the iteration, a range (alp1a, alp1b) is
-             * maintained which brackets the root and with each evaluation of
-             * f(alp) the range is shrunk, if possible.  Newton's method is
-             * restarted whenever the derivative of f is negative (because the new
-             * value of alp1 is then further from the solution) or if the new
-             * estimate of alp1 lies outside (0,pi); in this case, the new starting
-             * guess is taken to be (alp1a + alp1b) / 2. */
-            real ssig1 = 0, csig1 = 0, ssig2 = 0, csig2 = 0, eps = 0;
-            unsigned numit = 0;
-            /* Bracketing range */
-            real salp1a = tiny, calp1a = 1, salp1b = tiny, calp1b = -1;
-            boolx tripn, tripb;
-            for (tripn = FALSE, tripb = FALSE; numit < maxit2; ++numit) {
-                /* the WGS84 test set: mean = 1.47, sd = 1.25, max = 16
-                 * WGS84 and random input: mean = 2.85, sd = 0.60 */
-                real dv,
-                v = (Lambda12(g, sbet1, cbet1, dn1, sbet2, cbet2, dn2, salp1, calp1,
-                              &salp2, &calp2, &sig12, &ssig1, &csig1, &ssig2, &csig2,
-                              &eps, &omg12, numit < maxit1, &dv, C1a, C2a, C3a)
-                     - lam12);
-                /* 2 * tol0 is approximately 1 ulp for a number in [0, pi]. */
-                /* Reversed test to allow escape with NaNs */
-                if (tripb || !(fabs(v) >= (tripn ? 8 : 2) * tol0)) break;
-                /* Update bracketing values */
-                if (v > 0 && (numit > maxit1 || calp1/salp1 > calp1b/salp1b))
-                { salp1b = salp1; calp1b = calp1; }
-                else if (v < 0 && (numit > maxit1 || calp1/salp1 < calp1a/salp1a))
-                { salp1a = salp1; calp1a = calp1; }
-                if (numit < maxit1 && dv > 0) {
-                    real
-                    dalp1 = -v/dv;
-                    real
-                    sdalp1 = sin(dalp1), cdalp1 = cos(dalp1),
-                    nsalp1 = salp1 * cdalp1 + calp1 * sdalp1;
-                    if (nsalp1 > 0 && fabs(dalp1) < pi) {
-                        calp1 = calp1 * cdalp1 - salp1 * sdalp1;
-                        salp1 = nsalp1;
-                        SinCosNorm(&salp1, &calp1);
-                        /* In some regimes we don't get quadratic convergence because
-                         * slope -> 0.  So use convergence conditions based on epsilon
-                         * instead of sqrt(epsilon). */
-                        tripn = fabs(v) <= 16 * tol0;
-                        continue;
-                    }
-                }
-                /* Either dv was not postive or updated value was outside legal
-                 * range.  Use the midpoint of the bracket as the next estimate.
-                 * This mechanism is not needed for the WGS84 ellipsoid, but it does
-                 * catch problems with more eccentric ellipsoids.  Its efficacy is
-                 * such for the WGS84 test set with the starting guess set to alp1 =
-                 * 90deg:
-                 * the WGS84 test set: mean = 5.21, sd = 3.93, max = 24
-                 * WGS84 and random input: mean = 4.74, sd = 0.99 */
-                salp1 = (salp1a + salp1b)/2;
-                calp1 = (calp1a + calp1b)/2;
-                SinCosNorm(&salp1, &calp1);
-                tripn = FALSE;
-                tripb = (fabs(salp1a - salp1) + (calp1a - calp1) < tolb ||
-                         fabs(salp1 - salp1b) + (calp1 - calp1b) < tolb);
-            }
-            {
-                real dummy;
-                Lengths(g, eps, sig12, ssig1, csig1, dn1, ssig2, csig2, dn2,
-                        cbet1, cbet2, &s12x, &m12x, &dummy,
-                        (outmask & GEOD_GEODESICSCALE) != 0U, &M12, &M21, C1a, C2a);
-            }
-            m12x *= g->b;
-            s12x *= g->b;
-            a12 = sig12 / degree;
-            omg12 = lam12 - omg12;
-        }
-    }
-    
-    if (outmask & GEOD_DISTANCE)
-        s12 = 0 + s12x;             /* Convert -0 to 0 */
-    
-    if (outmask & GEOD_REDUCEDLENGTH)
-        m12 = 0 + m12x;             /* Convert -0 to 0 */
-    
-    if (outmask & GEOD_AREA) {
-        real
-        /* From Lambda12: sin(alp1) * cos(bet1) = sin(alp0) */
-        salp0 = salp1 * cbet1,
-        calp0 = hypotx(calp1, salp1 * sbet1); /* calp0 > 0 */
-        real alp12;
-        if (calp0 != 0 && salp0 != 0) {
-            real
-            /* From Lambda12: tan(bet) = tan(sig) * cos(alp) */
-            ssig1 = sbet1, csig1 = calp1 * cbet1,
-            ssig2 = sbet2, csig2 = calp2 * cbet2,
-            k2 = sq(calp0) * g->ep2,
-            eps = k2 / (2 * (1 + sqrt(1 + k2)) + k2),
-            /* Multiplier = a^2 * e^2 * cos(alpha0) * sin(alpha0). */
-            A4 = sq(g->a) * calp0 * salp0 * g->e2;
-            real C4a[nC4];
-            real B41, B42;
-            SinCosNorm(&ssig1, &csig1);
-            SinCosNorm(&ssig2, &csig2);
-            C4f(g, eps, C4a);
-            B41 = SinCosSeries(FALSE, ssig1, csig1, C4a, nC4);
-            B42 = SinCosSeries(FALSE, ssig2, csig2, C4a, nC4);
-            S12 = A4 * (B42 - B41);
-        } else
-        /* Avoid problems with indeterminate sig1, sig2 on equator */
-            S12 = 0;
-        
-        if (!meridian &&
-            omg12 < (real)(0.75) * pi &&   /* Long difference too big */
-            sbet2 - sbet1 < (real)(1.75)) { /* Lat difference too big */
-            /* Use tan(Gamma/2) = tan(omg12/2)
-             * * (tan(bet1/2)+tan(bet2/2))/(1+tan(bet1/2)*tan(bet2/2))
-             * with tan(x/2) = sin(x)/(1+cos(x)) */
-            real
-            somg12 = sin(omg12), domg12 = 1 + cos(omg12),
-            dbet1 = 1 + cbet1, dbet2 = 1 + cbet2;
-            alp12 = 2 * atan2( somg12 * ( sbet1 * dbet2 + sbet2 * dbet1 ),
-                              domg12 * ( sbet1 * sbet2 + dbet1 * dbet2 ) );
-        } else {
-            /* alp12 = alp2 - alp1, used in atan2 so no need to normalize */
-            real
-            salp12 = salp2 * calp1 - calp2 * salp1,
-            calp12 = calp2 * calp1 + salp2 * salp1;
-            /* The right thing appears to happen if alp1 = +/-180 and alp2 = 0, viz
-             * salp12 = -0 and alp12 = -180.  However this depends on the sign
-             * being attached to 0 correctly.  The following ensures the correct
-             * behavior. */
-            if (salp12 == 0 && calp12 < 0) {
-                salp12 = tiny * calp1;
-                calp12 = -1;
-            }
-            alp12 = atan2(salp12, calp12);
-        }
-        S12 += g->c2 * alp12;
-        S12 *= swapp * lonsign * latsign;
-        /* Convert -0 to 0 */
-        S12 += 0;
-    }
-    
-    /* Convert calp, salp to azimuth accounting for lonsign, swapp, latsign. */
-    if (swapp < 0) {
-        swapx(&salp1, &salp2);
-        swapx(&calp1, &calp2);
-        if (outmask & GEOD_GEODESICSCALE)
-            swapx(&M12, &M21);
-    }
-    
-    salp1 *= swapp * lonsign; calp1 *= swapp * latsign;
-    salp2 *= swapp * lonsign; calp2 *= swapp * latsign;
-    
-    if (outmask & GEOD_AZIMUTH) {
-        /* minus signs give range [-180, 180). 0- converts -0 to +0. */
-        azi1 = 0 - atan2(-salp1, calp1) / degree;
-        azi2 = 0 - atan2(-salp2, calp2) / degree;
-    }
-    
-    if (outmask & GEOD_DISTANCE)
-        *ps12 = s12;
-    if (outmask & GEOD_AZIMUTH) {
-        if (pazi1) *pazi1 = azi1;
-        if (pazi2) *pazi2 = azi2;
-    }
-    if (outmask & GEOD_REDUCEDLENGTH)
-        *pm12 = m12;
-    if (outmask & GEOD_GEODESICSCALE) {
-        if (pM12) *pM12 = M12;
-        if (pM21) *pM21 = M21;
-    }
-    if (outmask & GEOD_AREA)
-        *pS12 = S12;
-    
-    /* Returned value in [0, 180] */
-    return a12;
-}
-
-void geod_inverse(const struct geod_geodesic* g,
-                  real lat1, real lon1, real lat2, real lon2,
-                  real* ps12, real* pazi1, real* pazi2) {
-    geod_geninverse(g, lat1, lon1, lat2, lon2, ps12, pazi1, pazi2, 0, 0, 0, 0);
-}
-
-real SinCosSeries(boolx sinp, real sinx, real cosx, const real c[], int n) {
-    /* Evaluate
-     * y = sinp ? sum(c[i] * sin( 2*i    * x), i, 1, n) :
-     *            sum(c[i] * cos((2*i+1) * x), i, 0, n-1)
-     * using Clenshaw summation.  N.B. c[0] is unused for sin series
-     * Approx operation count = (n + 5) mult and (2 * n + 2) add */
-    real ar, y0, y1;
-    c += (n + sinp);              /* Point to one beyond last element */
-    ar = 2 * (cosx - sinx) * (cosx + sinx); /* 2 * cos(2 * x) */
-    y0 = n & 1 ? *--c : 0; y1 = 0;          /* accumulators for sum */
-    /* Now n is even */
-    n /= 2;
-    while (n--) {
-        /* Unroll loop x 2, so accumulators return to their original role */
-        y1 = ar * y0 - y1 + *--c;
-        y0 = ar * y1 - y0 + *--c;
-    }
-    return sinp
-    ? 2 * sinx * cosx * y0      /* sin(2 * x) * y0 */
-    : cosx * (y0 - y1);         /* cos(x) * (y0 - y1) */
-}
-
-void Lengths(const struct geod_geodesic* g,
-             real eps, real sig12,
-             real ssig1, real csig1, real dn1,
-             real ssig2, real csig2, real dn2,
-             real cbet1, real cbet2,
-             real* ps12b, real* pm12b, real* pm0,
-             boolx scalep, real* pM12, real* pM21,
-             /* Scratch areas of the right size */
-             real C1a[], real C2a[]) {
-    real s12b = 0, m12b = 0, m0 = 0, M12 = 0, M21 = 0;
-    real A1m1, AB1, A2m1, AB2, J12;
-    
-    /* Return m12b = (reduced length)/b; also calculate s12b = distance/b,
-     * and m0 = coefficient of secular term in expression for reduced length. */
-    C1f(eps, C1a);
-    C2f(eps, C2a);
-    A1m1 = A1m1f(eps);
-    AB1 = (1 + A1m1) * (SinCosSeries(TRUE, ssig2, csig2, C1a, nC1) -
-                        SinCosSeries(TRUE, ssig1, csig1, C1a, nC1));
-    A2m1 = A2m1f(eps);
-    AB2 = (1 + A2m1) * (SinCosSeries(TRUE, ssig2, csig2, C2a, nC2) -
-                        SinCosSeries(TRUE, ssig1, csig1, C2a, nC2));
-    m0 = A1m1 - A2m1;
-    J12 = m0 * sig12 + (AB1 - AB2);
-    /* Missing a factor of b.
-     * Add parens around (csig1 * ssig2) and (ssig1 * csig2) to ensure accurate
-     * cancellation in the case of coincident points. */
-    m12b = dn2 * (csig1 * ssig2) - dn1 * (ssig1 * csig2) - csig1 * csig2 * J12;
-    /* Missing a factor of b */
-    s12b = (1 + A1m1) * sig12 + AB1;
-    if (scalep) {
-        real csig12 = csig1 * csig2 + ssig1 * ssig2;
-        real t = g->ep2 * (cbet1 - cbet2) * (cbet1 + cbet2) / (dn1 + dn2);
-        M12 = csig12 + (t * ssig2 - csig2 * J12) * ssig1 / dn1;
-        M21 = csig12 - (t * ssig1 - csig1 * J12) * ssig2 / dn2;
-    }
-    *ps12b = s12b;
-    *pm12b = m12b;
-    *pm0 = m0;
-    if (scalep) {
-        *pM12 = M12;
-        *pM21 = M21;
-    }
-}
-
-real Astroid(real x, real y) {
-    /* Solve k^4+2*k^3-(x^2+y^2-1)*k^2-2*y^2*k-y^2 = 0 for positive root k.
-     * This solution is adapted from Geocentric::Reverse. */
-    real k;
-    real
-    p = sq(x),
-    q = sq(y),
-    r = (p + q - 1) / 6;
-    if ( !(q == 0 && r <= 0) ) {
-        real
-        /* Avoid possible division by zero when r = 0 by multiplying equations
-         * for s and t by r^3 and r, resp. */
-        S = p * q / 4,            /* S = r^3 * s */
-        r2 = sq(r),
-        r3 = r * r2,
-        /* The discrimant of the quadratic equation for T3.  This is zero on
-         * the evolute curve p^(1/3)+q^(1/3) = 1 */
-        disc = S * (S + 2 * r3);
-        real u = r;
-        real v, uv, w;
-        if (disc >= 0) {
-            real T3 = S + r3, T;
-            /* Pick the sign on the sqrt to maximize abs(T3).  This minimizes loss
-             * of precision due to cancellation.  The result is unchanged because
-             * of the way the T is used in definition of u. */
-            T3 += T3 < 0 ? -sqrt(disc) : sqrt(disc); /* T3 = (r * t)^3 */
-            /* N.B. cbrtx always returns the real root.  cbrtx(-8) = -2. */
-            T = cbrtx(T3);            /* T = r * t */
-            /* T can be zero; but then r2 / T -> 0. */
-            u += T + (T != 0 ? r2 / T : 0);
-        } else {
-            /* T is complex, but the way u is defined the result is real. */
-            real ang = atan2(sqrt(-disc), -(S + r3));
-            /* There are three possible cube roots.  We choose the root which
-             * avoids cancellation.  Note that disc < 0 implies that r < 0. */
-            u += 2 * r * cos(ang / 3);
-        }
-        v = sqrt(sq(u) + q);              /* guaranteed positive */
-        /* Avoid loss of accuracy when u < 0. */
-        uv = u < 0 ? q / (v - u) : u + v; /* u+v, guaranteed positive */
-        w = (uv - q) / (2 * v);           /* positive? */
-        /* Rearrange expression for k to avoid loss of accuracy due to
-         * subtraction.  Division by 0 not possible because uv > 0, w >= 0. */
-        k = uv / (sqrt(uv + sq(w)) + w);   /* guaranteed positive */
-    } else {               /* q == 0 && r <= 0 */
-        /* y = 0 with |x| <= 1.  Handle this case directly.
-         * for y small, positive root is k = abs(y)/sqrt(1-x^2) */
-        k = 0;
-    }
-    return k;
-}
-
-real InverseStart(const struct geod_geodesic* g,
-                  real sbet1, real cbet1, real dn1,
-                  real sbet2, real cbet2, real dn2,
-                  real lam12,
-                  real* psalp1, real* pcalp1,
-                  /* Only updated if return val >= 0 */
-                  real* psalp2, real* pcalp2,
-                  /* Only updated for short lines */
-                  real* pdnm,
-                  /* Scratch areas of the right size */
-                  real C1a[], real C2a[]) {
-    real salp1 = 0, calp1 = 0, salp2 = 0, calp2 = 0, dnm = 0;
-    
-    /* Return a starting point for Newton's method in salp1 and calp1 (function
-     * value is -1).  If Newton's method doesn't need to be used, return also
-     * salp2 and calp2 and function value is sig12. */
-    real
-    sig12 = -1,               /* Return value */
-    /* bet12 = bet2 - bet1 in [0, pi); bet12a = bet2 + bet1 in (-pi, 0] */
-    sbet12 = sbet2 * cbet1 - cbet2 * sbet1,
-    cbet12 = cbet2 * cbet1 + sbet2 * sbet1;
-#if defined(__GNUC__) && __GNUC__ == 4 &&       \
-(__GNUC_MINOR__ < 6 || defined(__MINGW32__))
-    /* Volatile declaration needed to fix inverse cases
-     * 88.202499451857 0 -88.202499451857 179.981022032992859592
-     * 89.262080389218 0 -89.262080389218 179.992207982775375662
-     * 89.333123580033 0 -89.333123580032997687 179.99295812360148422
-     * which otherwise fail with g++ 4.4.4 x86 -O3 (Linux)
-     * and g++ 4.4.0 (mingw) and g++ 4.6.1 (tdm mingw). */
-    real sbet12a;
-    {
-        volatile real xx1 = sbet2 * cbet1;
-        volatile real xx2 = cbet2 * sbet1;
-        sbet12a = xx1 + xx2;
-    }
-#else
-    real sbet12a = sbet2 * cbet1 + cbet2 * sbet1;
-#endif
-    boolx shortline = cbet12 >= 0 && sbet12 < (real)(0.5) &&
-    cbet2 * lam12 < (real)(0.5);
-    real omg12 = lam12, somg12, comg12, ssig12, csig12;
-    if (shortline) {
-        real sbetm2 = sq(sbet1 + sbet2);
-        /* sin((bet1+bet2)/2)^2
-         * =  (sbet1 + sbet2)^2 / ((sbet1 + sbet2)^2 + (cbet1 + cbet2)^2) */
-        sbetm2 /= sbetm2 + sq(cbet1 + cbet2);
-        dnm = sqrt(1 + g->ep2 * sbetm2);
-        omg12 /= g->f1 * dnm;
-    }
-    somg12 = sin(omg12); comg12 = cos(omg12);
-    
-    salp1 = cbet2 * somg12;
-    calp1 = comg12 >= 0 ?
-    sbet12 + cbet2 * sbet1 * sq(somg12) / (1 + comg12) :
-    sbet12a - cbet2 * sbet1 * sq(somg12) / (1 - comg12);
-    
-    ssig12 = hypotx(salp1, calp1);
-    csig12 = sbet1 * sbet2 + cbet1 * cbet2 * comg12;
-    
-    if (shortline && ssig12 < g->etol2) {
-        /* really short lines */
-        salp2 = cbet1 * somg12;
-        calp2 = sbet12 - cbet1 * sbet2 *
-        (comg12 >= 0 ? sq(somg12) / (1 + comg12) : 1 - comg12);
-        SinCosNorm(&salp2, &calp2);
-        /* Set return value */
-        sig12 = atan2(ssig12, csig12);
-    } else if (fabs(g->n) > (real)(0.1) || /* No astroid calc if too eccentric */
-               csig12 >= 0 ||
-               ssig12 >= 6 * fabs(g->n) * pi * sq(cbet1)) {
-        /* Nothing to do, zeroth order spherical approximation is OK */
-    } else {
-        /* Scale lam12 and bet2 to x, y coordinate system where antipodal point
-         * is at origin and singular point is at y = 0, x = -1. */
-        real y, lamscale, betscale;
-        /* Volatile declaration needed to fix inverse case
-         * 56.320923501171 0 -56.320923501171 179.664747671772880215
-         * which otherwise fails with g++ 4.4.4 x86 -O3 */
-        volatile real x;
-        if (g->f >= 0) {            /* In fact f == 0 does not get here */
-            /* x = dlong, y = dlat */
-            {
-                real
-                k2 = sq(sbet1) * g->ep2,
-                eps = k2 / (2 * (1 + sqrt(1 + k2)) + k2);
-                lamscale = g->f * cbet1 * A3f(g, eps) * pi;
-            }
-            betscale = lamscale * cbet1;
-            
-            x = (lam12 - pi) / lamscale;
-            y = sbet12a / betscale;
-        } else {                    /* f < 0 */
-            /* x = dlat, y = dlong */
-            real
-            cbet12a = cbet2 * cbet1 - sbet2 * sbet1,
-            bet12a = atan2(sbet12a, cbet12a);
-            real m12b, m0, dummy;
-            /* In the case of lon12 = 180, this repeats a calculation made in
-             * Inverse. */
-            Lengths(g, g->n, pi + bet12a,
-                    sbet1, -cbet1, dn1, sbet2, cbet2, dn2,
-                    cbet1, cbet2, &dummy, &m12b, &m0, FALSE,
-                    &dummy, &dummy, C1a, C2a);
-            x = -1 + m12b / (cbet1 * cbet2 * m0 * pi);
-            betscale = x < -(real)(0.01) ? sbet12a / x :
-            -g->f * sq(cbet1) * pi;
-            lamscale = betscale / cbet1;
-            y = (lam12 - pi) / lamscale;
-        }
-        
-        if (y > -tol1 && x > -1 - xthresh) {
-            /* strip near cut */
-            if (g->f >= 0) {
-                salp1 = minx((real)(1), -(real)(x)); calp1 = - sqrt(1 - sq(salp1));
-            } else {
-                calp1 = maxx((real)(x > -tol1 ? 0 : -1), (real)(x));
-                salp1 = sqrt(1 - sq(calp1));
-            }
-        } else {
-            /* Estimate alp1, by solving the astroid problem.
-             *
-             * Could estimate alpha1 = theta + pi/2, directly, i.e.,
-             *   calp1 = y/k; salp1 = -x/(1+k);  for f >= 0
-             *   calp1 = x/(1+k); salp1 = -y/k;  for f < 0 (need to check)
-             *
-             * However, it's better to estimate omg12 from astroid and use
-             * spherical formula to compute alp1.  This reduces the mean number of
-             * Newton iterations for astroid cases from 2.24 (min 0, max 6) to 2.12
-             * (min 0 max 5).  The changes in the number of iterations are as
-             * follows:
-             *
-             * change percent
-             *    1       5
-             *    0      78
-             *   -1      16
-             *   -2       0.6
-             *   -3       0.04
-             *   -4       0.002
-             *
-             * The histogram of iterations is (m = number of iterations estimating
-             * alp1 directly, n = number of iterations estimating via omg12, total
-             * number of trials = 148605):
-             *
-             *  iter    m      n
-             *    0   148    186
-             *    1 13046  13845
-             *    2 93315 102225
-             *    3 36189  32341
-             *    4  5396      7
-             *    5   455      1
-             *    6    56      0
-             *
-             * Because omg12 is near pi, estimate work with omg12a = pi - omg12 */
-            real k = Astroid(x, y);
-            real
-            omg12a = lamscale * ( g->f >= 0 ? -x * k/(1 + k) : -y * (1 + k)/k );
-            somg12 = sin(omg12a); comg12 = -cos(omg12a);
-            /* Update spherical estimate of alp1 using omg12 instead of lam12 */
-            salp1 = cbet2 * somg12;
-            calp1 = sbet12a - cbet2 * sbet1 * sq(somg12) / (1 - comg12);
-        }
-    }
-    if (salp1 > 0)              /* Sanity check on starting guess */
-        SinCosNorm(&salp1, &calp1);
-    else {
-        salp1 = 1; calp1 = 0;
-    }
-    
-    *psalp1 = salp1;
-    *pcalp1 = calp1;
-    if (shortline)
-        *pdnm = dnm;
-    if (sig12 >= 0) {
-        *psalp2 = salp2;
-        *pcalp2 = calp2;
-    }
-    return sig12;
-}
-
-real Lambda12(const struct geod_geodesic* g,
-              real sbet1, real cbet1, real dn1,
-              real sbet2, real cbet2, real dn2,
-              real salp1, real calp1,
-              real* psalp2, real* pcalp2,
-              real* psig12,
-              real* pssig1, real* pcsig1,
-              real* pssig2, real* pcsig2,
-              real* peps, real* pdomg12,
-              boolx diffp, real* pdlam12,
-              /* Scratch areas of the right size */
-              real C1a[], real C2a[], real C3a[]) {
-    real salp2 = 0, calp2 = 0, sig12 = 0,
-    ssig1 = 0, csig1 = 0, ssig2 = 0, csig2 = 0, eps = 0, domg12 = 0, dlam12 = 0;
-    real salp0, calp0;
-    real somg1, comg1, somg2, comg2, omg12, lam12;
-    real B312, h0, k2;
-    
-    if (sbet1 == 0 && calp1 == 0)
-    /* Break degeneracy of equatorial line.  This case has already been
-     * handled. */
-        calp1 = -tiny;
-    
-    /* sin(alp1) * cos(bet1) = sin(alp0) */
-    salp0 = salp1 * cbet1;
-    calp0 = hypotx(calp1, salp1 * sbet1); /* calp0 > 0 */
-    
-    /* tan(bet1) = tan(sig1) * cos(alp1)
-     * tan(omg1) = sin(alp0) * tan(sig1) = tan(omg1)=tan(alp1)*sin(bet1) */
-    ssig1 = sbet1; somg1 = salp0 * sbet1;
-    csig1 = comg1 = calp1 * cbet1;
-    SinCosNorm(&ssig1, &csig1);
-    /* SinCosNorm(&somg1, &comg1); -- don't need to normalize! */
-    
-    /* Enforce symmetries in the case abs(bet2) = -bet1.  Need to be careful
-     * about this case, since this can yield singularities in the Newton
-     * iteration.
-     * sin(alp2) * cos(bet2) = sin(alp0) */
-    salp2 = cbet2 != cbet1 ? salp0 / cbet2 : salp1;
-    /* calp2 = sqrt(1 - sq(salp2))
-     *       = sqrt(sq(calp0) - sq(sbet2)) / cbet2
-     * and subst for calp0 and rearrange to give (choose positive sqrt
-     * to give alp2 in [0, pi/2]). */
-    calp2 = cbet2 != cbet1 || fabs(sbet2) != -sbet1 ?
-    sqrt(sq(calp1 * cbet1) +
-         (cbet1 < -sbet1 ?
-          (cbet2 - cbet1) * (cbet1 + cbet2) :
-          (sbet1 - sbet2) * (sbet1 + sbet2))) / cbet2 :
-    fabs(calp1);
-    /* tan(bet2) = tan(sig2) * cos(alp2)
-     * tan(omg2) = sin(alp0) * tan(sig2). */
-    ssig2 = sbet2; somg2 = salp0 * sbet2;
-    csig2 = comg2 = calp2 * cbet2;
-    SinCosNorm(&ssig2, &csig2);
-    /* SinCosNorm(&somg2, &comg2); -- don't need to normalize! */
-    
-    /* sig12 = sig2 - sig1, limit to [0, pi] */
-    sig12 = atan2(maxx(csig1 * ssig2 - ssig1 * csig2, (real)(0)),
-                  csig1 * csig2 + ssig1 * ssig2);
-    
-    /* omg12 = omg2 - omg1, limit to [0, pi] */
-    omg12 = atan2(maxx(comg1 * somg2 - somg1 * comg2, (real)(0)),
-                  comg1 * comg2 + somg1 * somg2);
-    k2 = sq(calp0) * g->ep2;
-    eps = k2 / (2 * (1 + sqrt(1 + k2)) + k2);
-    C3f(g, eps, C3a);
-    B312 = (SinCosSeries(TRUE, ssig2, csig2, C3a, nC3-1) -
-            SinCosSeries(TRUE, ssig1, csig1, C3a, nC3-1));
-    h0 = -g->f * A3f(g, eps);
-    domg12 = salp0 * h0 * (sig12 + B312);
-    lam12 = omg12 + domg12;
-    
-    if (diffp) {
-        if (calp2 == 0)
-            dlam12 = - 2 * g->f1 * dn1 / sbet1;
-        else {
-            real dummy;
-            Lengths(g, eps, sig12, ssig1, csig1, dn1, ssig2, csig2, dn2,
-                    cbet1, cbet2, &dummy, &dlam12, &dummy,
-                    FALSE, &dummy, &dummy, C1a, C2a);
-            dlam12 *= g->f1 / (calp2 * cbet2);
-        }
-    }
-    
-    *psalp2 = salp2;
-    *pcalp2 = calp2;
-    *psig12 = sig12;
-    *pssig1 = ssig1;
-    *pcsig1 = csig1;
-    *pssig2 = ssig2;
-    *pcsig2 = csig2;
-    *peps = eps;
-    *pdomg12 = domg12;
-    if (diffp)
-        *pdlam12 = dlam12;
-    
-    return lam12;
-}
-
-real A3f(const struct geod_geodesic* g, real eps) {
-    /* Evaluate sum(A3x[k] * eps^k, k, 0, nA3x-1) by Horner's method */
-    real v = 0;
-    int i;
-    for (i = nA3x; i; )
-        v = eps * v + g->A3x[--i];
-    return v;
-}
-
-void C3f(const struct geod_geodesic* g, real eps, real c[]) {
-    /* Evaluate C3 coeffs by Horner's method
-     * Elements c[1] thru c[nC3 - 1] are set */
-    int i, j, k;
-    real mult = 1;
-    for (j = nC3x, k = nC3 - 1; k; ) {
-        real t = 0;
-        for (i = nC3 - k; i; --i)
-            t = eps * t + g->C3x[--j];
-        c[k--] = t;
-    }
-    
-    for (k = 1; k < nC3; ) {
-        mult *= eps;
-        c[k++] *= mult;
-    }
-}
-
-void C4f(const struct geod_geodesic* g, real eps, real c[]) {
-    /* Evaluate C4 coeffs by Horner's method
-     * Elements c[0] thru c[nC4 - 1] are set */
-    int i, j, k;
-    real mult = 1;
-    for (j = nC4x, k = nC4; k; ) {
-        real t = 0;
-        for (i = nC4 - k + 1; i; --i)
-            t = eps * t + g->C4x[--j];
-        c[--k] = t;
-    }
-    
-    for (k = 1; k < nC4; ) {
-        mult *= eps;
-        c[k++] *= mult;
-    }
-}
-
-/* Generated by Maxima on 2010-09-04 10:26:17-04:00 */
-
-/* The scale factor A1-1 = mean value of (d/dsigma)I1 - 1 */
-real A1m1f(real eps)  {
-    real
-    eps2 = sq(eps),
-    t = eps2*(eps2*(eps2+4)+64)/256;
-    return (t + eps) / (1 - eps);
-}
-
-/* The coefficients C1[l] in the Fourier expansion of B1 */
-void C1f(real eps, real c[])  {
-    real
-    eps2 = sq(eps),
-    d = eps;
-    c[1] = d*((6-eps2)*eps2-16)/32;
-    d *= eps;
-    c[2] = d*((64-9*eps2)*eps2-128)/2048;
-    d *= eps;
-    c[3] = d*(9*eps2-16)/768;
-    d *= eps;
-    c[4] = d*(3*eps2-5)/512;
-    d *= eps;
-    c[5] = -7*d/1280;
-    d *= eps;
-    c[6] = -7*d/2048;
-}
-
-/* The coefficients C1p[l] in the Fourier expansion of B1p */
-void C1pf(real eps, real c[])  {
-    real
-    eps2 = sq(eps),
-    d = eps;
-    c[1] = d*(eps2*(205*eps2-432)+768)/1536;
-    d *= eps;
-    c[2] = d*(eps2*(4005*eps2-4736)+3840)/12288;
-    d *= eps;
-    c[3] = d*(116-225*eps2)/384;
-    d *= eps;
-    c[4] = d*(2695-7173*eps2)/7680;
-    d *= eps;
-    c[5] = 3467*d/7680;
-    d *= eps;
-    c[6] = 38081*d/61440;
-}
-
-/* The scale factor A2-1 = mean value of (d/dsigma)I2 - 1 */
-real A2m1f(real eps)  {
-    real
-    eps2 = sq(eps),
-    t = eps2*(eps2*(25*eps2+36)+64)/256;
-    return t * (1 - eps) - eps;
-}
-
-/* The coefficients C2[l] in the Fourier expansion of B2 */
-void C2f(real eps, real c[])  {
-    real
-    eps2 = sq(eps),
-    d = eps;
-    c[1] = d*(eps2*(eps2+2)+16)/32;
-    d *= eps;
-    c[2] = d*(eps2*(35*eps2+64)+384)/2048;
-    d *= eps;
-    c[3] = d*(15*eps2+80)/768;
-    d *= eps;
-    c[4] = d*(7*eps2+35)/512;
-    d *= eps;
-    c[5] = 63*d/1280;
-    d *= eps;
-    c[6] = 77*d/2048;
-}
-
-/* The scale factor A3 = mean value of (d/dsigma)I3 */
-void A3coeff(struct geod_geodesic* g) {
-    g->A3x[0] = 1;
-    g->A3x[1] = (g->n-1)/2;
-    g->A3x[2] = (g->n*(3*g->n-1)-2)/8;
-    g->A3x[3] = ((-g->n-3)*g->n-1)/16;
-    g->A3x[4] = (-2*g->n-3)/64;
-    g->A3x[5] = -3/(real)(128);
-}
-
-/* The coefficients C3[l] in the Fourier expansion of B3 */
-void C3coeff(struct geod_geodesic* g) {
-    g->C3x[0] = (1-g->n)/4;
-    g->C3x[1] = (1-g->n*g->n)/8;
-    g->C3x[2] = ((3-g->n)*g->n+3)/64;
-    g->C3x[3] = (2*g->n+5)/128;
-    g->C3x[4] = 3/(real)(128);
-    g->C3x[5] = ((g->n-3)*g->n+2)/32;
-    g->C3x[6] = ((-3*g->n-2)*g->n+3)/64;
-    g->C3x[7] = (g->n+3)/128;
-    g->C3x[8] = 5/(real)(256);
-    g->C3x[9] = (g->n*(5*g->n-9)+5)/192;
-    g->C3x[10] = (9-10*g->n)/384;
-    g->C3x[11] = 7/(real)(512);
-    g->C3x[12] = (7-14*g->n)/512;
-    g->C3x[13] = 7/(real)(512);
-    g->C3x[14] = 21/(real)(2560);
-}
-
-/* Generated by Maxima on 2012-10-19 08:02:34-04:00 */
-
-/* The coefficients C4[l] in the Fourier expansion of I4 */
-void C4coeff(struct geod_geodesic* g) {
-    g->C4x[0] = (g->n*(g->n*(g->n*(g->n*(100*g->n+208)+572)+3432)-12012)+30030)/
-    45045;
-    g->C4x[1] = (g->n*(g->n*(g->n*(64*g->n+624)-4576)+6864)-3003)/15015;
-    g->C4x[2] = (g->n*((14144-10656*g->n)*g->n-4576)-858)/45045;
-    g->C4x[3] = ((-224*g->n-4784)*g->n+1573)/45045;
-    g->C4x[4] = (1088*g->n+156)/45045;
-    g->C4x[5] = 97/(real)(15015);
-    g->C4x[6] = (g->n*(g->n*((-64*g->n-624)*g->n+4576)-6864)+3003)/135135;
-    g->C4x[7] = (g->n*(g->n*(5952*g->n-11648)+9152)-2574)/135135;
-    g->C4x[8] = (g->n*(5792*g->n+1040)-1287)/135135;
-    g->C4x[9] = (468-2944*g->n)/135135;
-    g->C4x[10] = 1/(real)(9009);
-    g->C4x[11] = (g->n*((4160-1440*g->n)*g->n-4576)+1716)/225225;
-    g->C4x[12] = ((4992-8448*g->n)*g->n-1144)/225225;
-    g->C4x[13] = (1856*g->n-936)/225225;
-    g->C4x[14] = 8/(real)(10725);
-    g->C4x[15] = (g->n*(3584*g->n-3328)+1144)/315315;
-    g->C4x[16] = (1024*g->n-208)/105105;
-    g->C4x[17] = -136/(real)(63063);
-    g->C4x[18] = (832-2560*g->n)/405405;
-    g->C4x[19] = -128/(real)(135135);
-    g->C4x[20] = 128/(real)(99099);
-}
-
-int transit(real lon1, real lon2) {
-    real lon12;
-    /* Return 1 or -1 if crossing prime meridian in east or west direction.
-     * Otherwise return zero. */
-    /* Compute lon12 the same way as Geodesic::Inverse. */
-    lon1 = AngNormalize(lon1);
-    lon2 = AngNormalize(lon2);
-    lon12 = AngDiff(lon1, lon2);
-    return lon1 < 0 && lon2 >= 0 && lon12 > 0 ? 1 :
-    (lon2 < 0 && lon1 >= 0 && lon12 < 0 ? -1 : 0);
-}
-
-void accini(real s[]) {
-    /* Initialize an accumulator; this is an array with two elements. */
-    s[0] = s[1] = 0;
-}
-
-void acccopy(const real s[], real t[]) {
-    /* Copy an accumulator; t = s. */
-    t[0] = s[0]; t[1] = s[1];
-}
-
-void accadd(real s[], real y) {
-    /* Add y to an accumulator. */
-    real u, z = sumx(y, s[1], &u);
-    s[0] = sumx(z, s[0], &s[1]);
-    if (s[0] == 0)
-        s[0] = u;
-    else
-        s[1] = s[1] + u;
-}
-
-real accsum(const real s[], real y) {
-    /* Return accumulator + y (but don't add to accumulator). */
-    real t[2];
-    acccopy(s, t);
-    accadd(t, y);
-    return t[0];
-}
-
-void accneg(real s[]) {
-    /* Negate an accumulator. */
-    s[0] = -s[0]; s[1] = -s[1];
-}
-
-void geod_polygon_init(struct geod_polygon* p, boolx polylinep) {
-    p->lat0 = p->lon0 = p->lat = p->lon = NaN;
-    p->polyline = (polylinep != 0);
-    accini(p->P);
-    accini(p->A);
-    p->num = p->crossings = 0;
-}
-
-void geod_polygon_addpoint(const struct geod_geodesic* g,
-                           struct geod_polygon* p,
-                           real lat, real lon) {
-    lon = AngNormalize(lon);
-    if (p->num == 0) {
-        p->lat0 = p->lat = lat;
-        p->lon0 = p->lon = lon;
-    } else {
-        real s12, S12;
-        geod_geninverse(g, p->lat, p->lon, lat, lon,
-                        &s12, 0, 0, 0, 0, 0, p->polyline ? 0 : &S12);
-        accadd(p->P, s12);
-        if (!p->polyline) {
-            accadd(p->A, S12);
-            p->crossings += transit(p->lon, lon);
-        }
-        p->lat = lat; p->lon = lon;
-    }
-    ++p->num;
-}
-
-void geod_polygon_addedge(const struct geod_geodesic* g,
-                          struct geod_polygon* p,
-                          real azi, real s) {
-    if (p->num) {                 /* Do nothing is num is zero */
-        real lat, lon, S12;
-        geod_gendirect(g, p->lat, p->lon, azi, FALSE, s,
-                       &lat, &lon, 0,
-                       0, 0, 0, 0, p->polyline ? 0 : &S12);
-        accadd(p->P, s);
-        if (!p->polyline) {
-            accadd(p->A, S12);
-            p->crossings += transit(p->lon, lon);
-        }
-        p->lat = lat; p->lon = lon;
-        ++p->num;
-    }
-}
-
-unsigned geod_polygon_compute(const struct geod_geodesic* g,
-                              const struct geod_polygon* p,
-                              boolx reverse, boolx sign,
-                              real* pA, real* pP) {
-    real s12, S12, t[2], area0;
-    int crossings;
-    if (p->num < 2) {
-        if (pP) *pP = 0;
-        if (!p->polyline && pA) *pA = 0;
-        return p->num;
-    }
-    if (p->polyline) {
-        if (pP) *pP = p->P[0];
-        return p->num;
-    }
-    geod_geninverse(g, p->lat, p->lon, p->lat0, p->lon0,
-                    &s12, 0, 0, 0, 0, 0, &S12);
-    if (pP) *pP = accsum(p->P, s12);
-    acccopy(p->A, t);
-    accadd(t, S12);
-    crossings = p->crossings + transit(p->lon, p->lon0);
-    area0 = 4 * pi * g->c2;
-    if (crossings & 1)
-        accadd(t, (t[0] < 0 ? 1 : -1) * area0/2);
-    /* area is with the clockwise sense.  If !reverse convert to
-     * counter-clockwise convention. */
-    if (!reverse)
-        accneg(t);
-    /* If sign put area in (-area0/2, area0/2], else put area in [0, area0) */
-    if (sign) {
-        if (t[0] > area0/2)
-            accadd(t, -area0);
-        else if (t[0] <= -area0/2)
-            accadd(t, +area0);
-    } else {
-        if (t[0] >= area0)
-            accadd(t, -area0);
-        else if (t[0] < 0)
-            accadd(t, +area0);
-    }
-    if (pA) *pA = 0 + t[0];
-    return p->num;
-}
-
-unsigned geod_polygon_testpoint(const struct geod_geodesic* g,
-                                const struct geod_polygon* p,
-                                real lat, real lon,
-                                boolx reverse, boolx sign,
-                                real* pA, real* pP) {
-    real perimeter, tempsum, area0;
-    int crossings, i;
-    unsigned num = p->num + 1;
-    if (num == 1) {
-        if (pP) *pP = 0;
-        if (!p->polyline && pA) *pA = 0;
-        return num;
-    }
-    perimeter = p->P[0];
-    tempsum = p->polyline ? 0 : p->A[0];
-    crossings = p->crossings;
-    for (i = 0; i < (p->polyline ? 1 : 2); ++i) {
-        real s12, S12;
-        geod_geninverse(g,
-                        i == 0 ? p->lat  : lat, i == 0 ? p->lon  : lon,
-                        i != 0 ? p->lat0 : lat, i != 0 ? p->lon0 : lon,
-                        &s12, 0, 0, 0, 0, 0, p->polyline ? 0 : &S12);
-        perimeter += s12;
-        if (!p->polyline) {
-            tempsum += S12;
-            crossings += transit(i == 0 ? p->lon  : lon,
-                                 i != 0 ? p->lon0 : lon);
-        }
-    }
-    
-    if (pP) *pP = perimeter;
-    if (p->polyline)
-        return num;
-    
-    area0 = 4 * pi * g->c2;
-    if (crossings & 1)
-        tempsum += (tempsum < 0 ? 1 : -1) * area0/2;
-    /* area is with the clockwise sense.  If !reverse convert to
-     * counter-clockwise convention. */
-    if (!reverse)
-        tempsum *= -1;
-    /* If sign put area in (-area0/2, area0/2], else put area in [0, area0) */
-    if (sign) {
-        if (tempsum > area0/2)
-            tempsum -= area0;
-        else if (tempsum <= -area0/2)
-            tempsum += area0;
-    } else {
-        if (tempsum >= area0)
-            tempsum -= area0;
-        else if (tempsum < 0)
-            tempsum += area0;
-    }
-    if (pA) *pA = 0 + tempsum;
-    return num;
-}
-
-unsigned geod_polygon_testedge(const struct geod_geodesic* g,
-                               const struct geod_polygon* p,
-                               real azi, real s,
-                               boolx reverse, boolx sign,
-                               real* pA, real* pP) {
-    real perimeter, tempsum, area0;
-    int crossings;
-    unsigned num = p->num + 1;
-    if (num == 1) {               /* we don't have a starting point! */
-        if (pP) *pP = NaN;
-        if (!p->polyline && pA) *pA = NaN;
-        return 0;
-    }
-    perimeter = p->P[0] + s;
-    if (p->polyline) {
-        if (pP) *pP = perimeter;
-        return num;
-    }
-    
-    tempsum = p->A[0];
-    crossings = p->crossings;
-    {
-        real lat, lon, s12, S12;
-        geod_gendirect(g, p->lat, p->lon, azi, FALSE, s,
-                       &lat, &lon, 0,
-                       0, 0, 0, 0, &S12);
-        tempsum += S12;
-        crossings += transit(p->lon, lon);
-        geod_geninverse(g, lat,  lon, p->lat0,  p->lon0,
-                        &s12, 0, 0, 0, 0, 0, &S12);
-        perimeter += s12;
-        tempsum += S12;
-        crossings += transit(lon, p->lon0);
-    }
-    
-    area0 = 4 * pi * g->c2;
-    if (crossings & 1)
-        tempsum += (tempsum < 0 ? 1 : -1) * area0/2;
-    /* area is with the clockwise sense.  If !reverse convert to
-     * counter-clockwise convention. */
-    if (!reverse)
-        tempsum *= -1;
-    /* If sign put area in (-area0/2, area0/2], else put area in [0, area0) */
-    if (sign) {
-        if (tempsum > area0/2)
-            tempsum -= area0;
-        else if (tempsum <= -area0/2)
-            tempsum += area0;
-    } else {
-        if (tempsum >= area0)
-            tempsum -= area0;
-        else if (tempsum < 0)
-            tempsum += area0;
-    }
-    if (pP) *pP = perimeter;
-    if (pA) *pA = 0 + tempsum;
-    return num;
-}
-
-void geod_polygonarea(const struct geod_geodesic* g,
-                      real lats[], real lons[], int n,
-                      real* pA, real* pP) {
-    int i;
-    struct geod_polygon p;
-    geod_polygon_init(&p, FALSE);
-    for (i = 0; i < n; ++i)
-        geod_polygon_addpoint(g, &p, lats[i], lons[i]);
-    geod_polygon_compute(g, &p, FALSE, TRUE, pA, pP);
-}
-
-/** @endcond */
diff --git a/src/utilities/geodesic.h b/src/utilities/geodesic.h
deleted file mode 100644
index c41a232..0000000
--- a/src/utilities/geodesic.h
+++ /dev/null
@@ -1,751 +0,0 @@
-/**
- * \file geodesic.h
- * \brief Header for the geodesic routines in C
- *
- * This an implementation in C of the geodesic algorithms described in
- * - C. F. F. Karney,
- *   <a href="http://dx.doi.org/10.1007/s00190-012-0578-z">
- *   Algorithms for geodesics</a>,
- *   J. Geodesy <b>87</b>, 43--55 (2013);
- *   DOI: <a href="http://dx.doi.org/10.1007/s00190-012-0578-z">
- *   10.1007/s00190-012-0578-z</a>;
- *   addenda: <a href="http://geographiclib.sf.net/geod-addenda.html">
- *   geod-addenda.html</a>.
- * .
- * The principal advantages of these algorithms over previous ones (e.g.,
- * Vincenty, 1975) are
- * - accurate to round off for |<i>f</i>| < 1/50;
- * - the solution of the inverse problem is always found;
- * - differential and integral properties of geodesics are computed.
- *
- * The shortest path between two points on the ellipsoid at (\e lat1, \e
- * lon1) and (\e lat2, \e lon2) is called the geodesic.  Its length is
- * \e s12 and the geodesic from point 1 to point 2 has forward azimuths
- * \e azi1 and \e azi2 at the two end points.
- *
- * Traditionally two geodesic problems are considered:
- * - the direct problem -- given \e lat1, \e lon1, \e s12, and \e azi1,
- *   determine \e lat2, \e lon2, and \e azi2.  This is solved by the function
- *   geod_direct().
- * - the inverse problem -- given \e lat1, \e lon1, and \e lat2, \e lon2,
- *   determine \e s12, \e azi1, and \e azi2.  This is solved by the function
- *   geod_inverse().
- *
- * The ellipsoid is specified by its equatorial radius \e a (typically in
- * meters) and flattening \e f.  The routines are accurate to round off with
- * double precision arithmetic provided that |<i>f</i>| < 1/50; for the
- * WGS84 ellipsoid, the errors are less than 15 nanometers.  (Reasonably
- * accurate results are obtained for |<i>f</i>| < 1/5.)  For a prolate
- * ellipsoid, specify \e f < 0.
- *
- * The routines also calculate several other quantities of interest
- * - \e S12 is the area between the geodesic from point 1 to point 2 and the
- *   equator; i.e., it is the area, measured counter-clockwise, of the
- *   quadrilateral with corners (\e lat1,\e lon1), (0,\e lon1), (0,\e lon2),
- *   and (\e lat2,\e lon2).
- * - \e m12, the reduced length of the geodesic is defined such that if
- *   the initial azimuth is perturbed by \e dazi1 (radians) then the
- *   second point is displaced by \e m12 \e dazi1 in the direction
- *   perpendicular to the geodesic.  On a curved surface the reduced
- *   length obeys a symmetry relation, \e m12 + \e m21 = 0.  On a flat
- *   surface, we have \e m12 = \e s12.
- * - \e M12 and \e M21 are geodesic scales.  If two geodesics are
- *   parallel at point 1 and separated by a small distance \e dt, then
- *   they are separated by a distance \e M12 \e dt at point 2.  \e M21
- *   is defined similarly (with the geodesics being parallel to one
- *   another at point 2).  On a flat surface, we have \e M12 = \e M21
- *   = 1.
- * - \e a12 is the arc length on the auxiliary sphere.  This is a
- *   construct for converting the problem to one in spherical
- *   trigonometry.  \e a12 is measured in degrees.  The spherical arc
- *   length from one equator crossing to the next is always 180°.
- *
- * If points 1, 2, and 3 lie on a single geodesic, then the following
- * addition rules hold:
- * - \e s13 = \e s12 + \e s23
- * - \e a13 = \e a12 + \e a23
- * - \e S13 = \e S12 + \e S23
- * - \e m13 = \e m12 \e M23 + \e m23 \e M21
- * - \e M13 = \e M12 \e M23 − (1 − \e M12 \e M21) \e
- *   m23 / \e m12
- * - \e M31 = \e M32 \e M21 − (1 − \e M23 \e M32) \e
- *   m12 / \e m23
- *
- * The shortest distance returned by the solution of the inverse problem is
- * (obviously) uniquely defined.  However, in a few special cases there are
- * multiple azimuths which yield the same shortest distance.  Here is a
- * catalog of those cases:
- * - \e lat1 = −\e lat2 (with neither at a pole).  If \e azi1 = \e
- *   azi2, the geodesic is unique.  Otherwise there are two geodesics
- *   and the second one is obtained by setting [\e azi1, \e azi2] = [\e
- *   azi2, \e azi1], [\e M12, \e M21] = [\e M21, \e M12], \e S12 =
- *   −\e S12.  (This occurs when the longitude difference is near
- *   ±180° for oblate ellipsoids.)
- * - \e lon2 = \e lon1 ± 180° (with neither at a pole).  If
- *   \e azi1 = 0° or ±180°, the geodesic is unique.
- *   Otherwise there are two geodesics and the second one is obtained by
- *   setting [\e azi1, \e azi2] = [−\e azi1, −\e azi2], \e
- *   S12 = −\e S12.  (This occurs when the \e lat2 is near
- *   −\e lat1 for prolate ellipsoids.)
- * - Points 1 and 2 at opposite poles.  There are infinitely many
- *   geodesics which can be generated by setting [\e azi1, \e azi2] =
- *   [\e azi1, \e azi2] + [\e d, −\e d], for arbitrary \e d.  (For
- *   spheres, this prescription applies when points 1 and 2 are
- *   antipodal.)
- * - \e s12 = 0 (coincident points).  There are infinitely many geodesics
- *   which can be generated by setting [\e azi1, \e azi2] = [\e azi1, \e
- *   azi2] + [\e d, \e d], for arbitrary \e d.
- *
- * These routines are a simple transcription of the corresponding C++ classes
- * in <a href="http://geographiclib.sf.net"> GeographicLib</a>.  The "class
- * data" is represented by the structs geod_geodesic, geod_geodesicline,
- * geod_polygon and pointers to these objects are passed as initial arguments
- * to the member functions.  Most of the internal comments have been retained.
- * However, in the process of transcription some documentation has been lost
- * and the documentation for the C++ classes, GeographicLib::Geodesic,
- * GeographicLib::GeodesicLine, and GeographicLib::PolygonArea, should be
- * consulted.  The C++ code remains the "reference implementation".  Think
- * twice about restructuring the internals of the C code since this may make
- * porting fixes from the C++ code more difficult.
- *
- * Copyright (c) Charles Karney (2012-2013) <charles at karney.com> and licensed
- * under the MIT/X11 License.  For more information, see
- * http://geographiclib.sourceforge.net/
- *
- * This library was distributed with
- * <a href="../index.html">GeographicLib</a> 1.32.
- **********************************************************************/
-
-#if !defined(GEODESIC_H)
-#define GEODESIC_H 1
-
-/**
- * The major version of the geodesic library.  (This tracks the version of
- * GeographicLib.)
- **********************************************************************/
-#define GEODESIC_VERSION_MAJOR 1
-/**
- * The minor version of the geodesic library.  (This tracks the version of
- * GeographicLib.)
- **********************************************************************/
-#define GEODESIC_VERSION_MINOR 32
-/**
- * The patch level of the geodesic library.  (This tracks the version of
- * GeographicLib.)
- **********************************************************************/
-#define GEODESIC_VERSION_PATCH 0
-
-#if defined(__cplusplus)
-extern "C" {
-#endif
-
-//------------------
-//WGS84 parameters
-#define A_ 6378137
-#define B_ 6356752.314245
-#define F_ 0.00335281066
-//-------------------
-    /**
-     * The struct containing information about the ellipsoid.  This must be
-     * initialized by geod_init() before use.
-     **********************************************************************/
-    struct geod_geodesic {
-        double a;                   /**< the equatorial radius */
-        double f;                   /**< the flattening */
-        /**< @cond SKIP */
-        double f1, e2, ep2, n, b, c2, etol2;
-        double A3x[6], C3x[15], C4x[21];
-        /**< @endcond */
-    };
-    
-    /**
-     * The struct containing information about a single geodesic.  This must be
-     * initialized by geod_lineinit() before use.
-     **********************************************************************/
-    struct geod_geodesicline {
-        double lat1;                /**< the starting latitude */
-        double lon1;                /**< the starting longitude */
-        double azi1;                /**< the starting azimuth */
-        double a;                   /**< the equatorial radius */
-        double f;                   /**< the flattening */
-        /**< @cond SKIP */
-        double b, c2, f1, salp0, calp0, k2,
-        salp1, calp1, ssig1, csig1, dn1, stau1, ctau1, somg1, comg1,
-        A1m1, A2m1, A3c, B11, B21, B31, A4, B41;
-        double C1a[6+1], C1pa[6+1], C2a[6+1], C3a[6], C4a[6];
-        /**< @endcond */
-        unsigned caps;              /**< the capabilities */
-    };
-    
-    /**
-     * The struct for accumulating information about a geodesic polygon.  This is
-     * used for computing the perimeter and area of a polygon.  This must be
-     * initialized by geod_polygon_init() before use.
-     **********************************************************************/
-    struct geod_polygon {
-        double lat;                 /**< the current latitude */
-        double lon;                 /**< the current longitude */
-        /**< @cond SKIP */
-        double lat0;
-        double lon0;
-        double A[2];
-        double P[2];
-        int polyline;
-        int crossings;
-        /**< @endcond */
-        unsigned num;               /**< the number of points so far */
-    };
-    
-    /**
-     * Initialize a geod_geodesic object.
-     *
-     * @param[out] g a pointer to the object to be initialized.
-     * @param[in] a the equatorial radius (meters).
-     * @param[in] f the flattening.
-     **********************************************************************/
-    void geod_init(struct geod_geodesic* g, double a, double f);
-    
-    /**
-     * Initialize a geod_geodesicline object.
-     *
-     * @param[out] l a pointer to the object to be initialized.
-     * @param[in] g a pointer to the geod_geodesic object specifying the
-     *   ellipsoid.
-     * @param[in] lat1 latitude of point 1 (degrees).
-     * @param[in] lon1 longitude of point 1 (degrees).
-     * @param[in] azi1 azimuth at point 1 (degrees).
-     * @param[in] caps bitor'ed combination of geod_mask() values specifying the
-     *   capabilities the geod_geodesicline object should possess, i.e., which
-     *   quantities can be returned in calls to geod_position() and
-     *   geod_genposition().
-     *
-     * \e g must have been initialized with a call to geod_init().  \e lat1
-     * should be in the range [−90°, 90°]; \e lon1 and \e azi1
-     * should be in the range [−540°, 540°).
-     *
-     * The geod_mask values are [see geod_mask()]:
-     * - \e caps |= GEOD_LATITUDE for the latitude \e lat2; this is
-     *   added automatically,
-     * - \e caps |= GEOD_LONGITUDE for the latitude \e lon2,
-     * - \e caps |= GEOD_AZIMUTH for the latitude \e azi2; this is
-     *   added automatically,
-     * - \e caps |= GEOD_DISTANCE for the distance \e s12,
-     * - \e caps |= GEOD_REDUCEDLENGTH for the reduced length \e m12,
-     * - \e caps |= GEOD_GEODESICSCALE for the geodesic scales \e M12
-     *   and \e M21,
-     * - \e caps |= GEOD_AREA for the area \e S12,
-     * - \e caps |= GEOD_DISTANCE_IN permits the length of the
-     *   geodesic to be given in terms of \e s12; without this capability the
-     *   length can only be specified in terms of arc length.
-     * .
-     * A value of \e caps = 0 is treated as GEOD_LATITUDE | GEOD_LONGITUDE |
-     * GEOD_AZIMUTH | GEOD_DISTANCE_IN (to support the solution of the "standard"
-     * direct problem).
-     **********************************************************************/
-    void geod_lineinit(struct geod_geodesicline* l,
-                       const struct geod_geodesic* g,
-                       double lat1, double lon1, double azi1, unsigned caps);
-    
-    /**
-     * Solve the direct geodesic problem.
-     *
-     * @param[in] g a pointer to the geod_geodesic object specifying the
-     *   ellipsoid.
-     * @param[in] lat1 latitude of point 1 (degrees).
-     * @param[in] lon1 longitude of point 1 (degrees).
-     * @param[in] azi1 azimuth at point 1 (degrees).
-     * @param[in] s12 distance between point 1 and point 2 (meters); it can be
-     *   negative.
-     * @param[out] plat2 pointer to the latitude of point 2 (degrees).
-     * @param[out] plon2 pointer to the longitude of point 2 (degrees).
-     * @param[out] pazi2 pointer to the (forward) azimuth at point 2 (degrees).
-     *
-     * \e g must have been initialized with a call to geod_init().  \e lat1
-     * should be in the range [−90°, 90°]; \e lon1 and \e azi1
-     * should be in the range [−540°, 540°).  The values of \e lon2
-     * and \e azi2 returned are in the range [−180°, 180°).  Any of
-     * the "return" arguments \e plat2, etc., may be replaced by 0, if you do not
-     * need some quantities computed.
-     *
-     * If either point is at a pole, the azimuth is defined by keeping the
-     * longitude fixed, writing \e lat = ±(90° − ε), and
-     * taking the limit ε → 0+.  An arc length greater that 180°
-     * signifies a geodesic which is not a shortest path.  (For a prolate
-     * ellipsoid, an additional condition is necessary for a shortest path: the
-     * longitudinal extent must not exceed of 180°.)
-     *
-     * Example, determine the point 10000 km NE of JFK:
-     @code
-     struct geod_geodesic g;
-     double lat, lon;
-     geod_init(&g, 6378137, 1/298.257223563);
-     geod_direct(&g, 40.64, -73.78, 45.0, 10e6, &lat, &lon, 0);
-     printf("%.5f %.5f\n", lat, lon);
-     @endcode
-     **********************************************************************/
-    void geod_direct(const struct geod_geodesic* g,
-                     double lat1, double lon1, double azi1, double s12,
-                     double* plat2, double* plon2, double* pazi2);
-    
-    /**
-     * Solve the inverse geodesic problem.
-     *
-     * @param[in] g a pointer to the geod_geodesic object specifying the
-     *   ellipsoid.
-     * @param[in] lat1 latitude of point 1 (degrees).
-     * @param[in] lon1 longitude of point 1 (degrees).
-     * @param[in] lat2 latitude of point 2 (degrees).
-     * @param[in] lon2 longitude of point 2 (degrees).
-     * @param[out] ps12 pointer to the distance between point 1 and point 2
-     *   (meters).
-     * @param[out] pazi1 pointer to the azimuth at point 1 (degrees).
-     * @param[out] pazi2 pointer to the (forward) azimuth at point 2 (degrees).
-     *
-     * \e g must have been initialized with a call to geod_init().  \e lat1
-     * and \e lat2 should be in the range [−90°, 90°]; \e lon1 and
-     * \e lon2 should be in the range [−540°, 540°).  The values of
-     * \e azi1 and \e azi2 returned are in the range [−180°, 180°).
-     * Any of the "return" arguments \e ps12, etc., may be replaced by 0, if you
-     * do not need some quantities computed.
-     *
-     * If either point is at a pole, the azimuth is defined by keeping the
-     * longitude fixed, writing \e lat = ±(90° − ε), and
-     * taking the limit ε → 0+.
-     *
-     * The solution to the inverse problem is found using Newton's method.  If
-     * this fails to converge (this is very unlikely in geodetic applications
-     * but does occur for very eccentric ellipsoids), then the bisection method
-     * is used to refine the solution.
-     *
-     * Example, determine the distance between JFK and Singapore Changi Airport:
-     @code
-     struct geod_geodesic g;
-     double s12;
-     geod_init(&g, 6378137, 1/298.257223563);
-     geod_inverse(&g, 40.64, -73.78, 1.36, 103.99, &s12, 0, 0);
-     printf("%.3f\n", s12);
-     @endcode
-     **********************************************************************/
-    void geod_inverse(const struct geod_geodesic* g,
-                      double lat1, double lon1, double lat2, double lon2,
-                      double* ps12, double* pazi1, double* pazi2);
-    
-    /**
-     * Compute the position along a geod_geodesicline.
-     *
-     * @param[in] l a pointer to the geod_geodesicline object specifying the
-     *   geodesic line.
-     * @param[in] s12 distance between point 1 and point 2 (meters); it can be
-     *   negative.
-     * @param[out] plat2 pointer to the latitude of point 2 (degrees).
-     * @param[out] plon2 pointer to the longitude of point 2 (degrees); requires
-     *   that \e l was initialized with \e caps |= GEOD_LONGITUDE.
-     * @param[out] pazi2 pointer to the (forward) azimuth at point 2 (degrees).
-     *
-     * \e l must have been initialized with a call to geod_lineinit() with \e
-     * caps |= GEOD_DISTANCE_IN.  The values of \e lon2 and \e azi2 returned are
-     * in the range [−180°, 180°).  Any of the "return" arguments
-     * \e plat2, etc., may be replaced by 0, if you do not need some quantities
-     * computed.
-     *
-     * Example, compute way points between JFK and Singapore Changi Airport
-     * the "obvious" way using geod_direct():
-     @code
-     struct geod_geodesic g;
-     double s12, azi1, lat[101],lon[101];
-     int i;
-     geod_init(&g, 6378137, 1/298.257223563);
-     geod_inverse(&g, 40.64, -73.78, 1.36, 103.99, &s12, &azi1, 0);
-     for (i = 0; i < 101; ++i) {
-     geod_direct(&g, 40.64, -73.78, azi1, i * s12 * 0.01, lat + i, lon + i, 0);
-     printf("%.5f %.5f\n", lat[i], lon[i]);
-     }
-     @endcode
-     * A faster way using geod_position():
-     @code
-     struct geod_geodesic g;
-     struct geod_geodesicline l;
-     double s12, azi1, lat[101],lon[101];
-     int i;
-     geod_init(&g, 6378137, 1/298.257223563);
-     geod_inverse(&g, 40.64, -73.78, 1.36, 103.99, &s12, &azi1, 0);
-     geod_lineinit(&l, &g, 40.64, -73.78, azi1, 0);
-     for (i = 0; i < 101; ++i) {
-     geod_position(&l, i * s12 * 0.01, lat + i, lon + i, 0);
-     printf("%.5f %.5f\n", lat[i], lon[i]);
-     }
-     @endcode
-     **********************************************************************/
-    void geod_position(const struct geod_geodesicline* l, double s12,
-                       double* plat2, double* plon2, double* pazi2);
-    
-    /**
-     * The general direct geodesic problem.
-     *
-     * @param[in] g a pointer to the geod_geodesic object specifying the
-     *   ellipsoid.
-     * @param[in] lat1 latitude of point 1 (degrees).
-     * @param[in] lon1 longitude of point 1 (degrees).
-     * @param[in] azi1 azimuth at point 1 (degrees).
-     * @param[in] arcmode flag determining the meaning of the \e
-     *   s12_a12.
-     * @param[in] s12_a12 if \e arcmode is 0, this is the distance between
-     *   point 1 and point 2 (meters); otherwise it is the arc length between
-     *   point 1 and point 2 (degrees); it can be negative.
-     * @param[out] plat2 pointer to the latitude of point 2 (degrees).
-     * @param[out] plon2 pointer to the longitude of point 2 (degrees).
-     * @param[out] pazi2 pointer to the (forward) azimuth at point 2 (degrees).
-     * @param[out] ps12 pointer to the distance between point 1 and point 2
-     *   (meters).
-     * @param[out] pm12 pointer to the reduced length of geodesic (meters).
-     * @param[out] pM12 pointer to the geodesic scale of point 2 relative to
-     *   point 1 (dimensionless).
-     * @param[out] pM21 pointer to the geodesic scale of point 1 relative to
-     *   point 2 (dimensionless).
-     * @param[out] pS12 pointer to the area under the geodesic
-     *   (meters<sup>2</sup>).
-     * @return \e a12 arc length of between point 1 and point 2 (degrees).
-     *
-     * \e g must have been initialized with a call to geod_init().  \e lat1
-     * should be in the range [−90°, 90°]; \e lon1 and \e azi1
-     * should be in the range [−540°, 540°).  The function value \e
-     * a12 equals \e s12_a12 is \e arcmode is non-zero.  Any of the "return"
-     * arguments \e plat2, etc., may be replaced by 0, if you do not need some
-     * quantities computed.
-     **********************************************************************/
-    double geod_gendirect(const struct geod_geodesic* g,
-                          double lat1, double lon1, double azi1,
-                          int arcmode, double s12_a12,
-                          double* plat2, double* plon2, double* pazi2,
-                          double* ps12, double* pm12, double* pM12, double* pM21,
-                          double* pS12);
-    
-    /**
-     * The general inverse geodesic calculation.
-     *
-     * @param[in] g a pointer to the geod_geodesic object specifying the
-     *   ellipsoid.
-     * @param[in] lat1 latitude of point 1 (degrees).
-     * @param[in] lon1 longitude of point 1 (degrees).
-     * @param[in] lat2 latitude of point 2 (degrees).
-     * @param[in] lon2 longitude of point 2 (degrees).
-     * @param[out] ps12 pointer to the distance between point 1 and point 2
-     *  (meters).
-     * @param[out] pazi1 pointer to the azimuth at point 1 (degrees).
-     * @param[out] pazi2 pointer to the (forward) azimuth at point 2 (degrees).
-     * @param[out] pm12 pointer to the reduced length of geodesic (meters).
-     * @param[out] pM12 pointer to the geodesic scale of point 2 relative to
-     *   point 1 (dimensionless).
-     * @param[out] pM21 pointer to the geodesic scale of point 1 relative to
-     *   point 2 (dimensionless).
-     * @param[out] pS12 pointer to the area under the geodesic
-     *   (meters<sup>2</sup>).
-     * @return \e a12 arc length of between point 1 and point 2 (degrees).
-     *
-     * \e g must have been initialized with a call to geod_init().  \e lat1
-     * and \e lat2 should be in the range [−90°, 90°]; \e lon1 and
-     * \e lon2 should be in the range [−540°, 540°).  Any of the
-     * "return" arguments \e ps12, etc., may be replaced by 0, if you do not need
-     * some quantities computed.
-     **********************************************************************/
-    double geod_geninverse(const struct geod_geodesic* g,
-                           double lat1, double lon1, double lat2, double lon2,
-                           double* ps12, double* pazi1, double* pazi2,
-                           double* pm12, double* pM12, double* pM21,
-                           double* pS12);
-    
-    /**
-     * The general position function.
-     *
-     * @param[in] l a pointer to the geod_geodesicline object specifying the
-     *   geodesic line.
-     * @param[in] arcmode flag determining the meaning of the second parameter;
-     *   if arcmode is 0, then \e l must have been initialized with \e caps |=
-     *   GEOD_DISTANCE_IN.
-     * @param[in] s12_a12 if \e arcmode is 0, this is the distance between
-     *   point 1 and point 2 (meters); otherwise it is the arc length between
-     *   point 1 and point 2 (degrees); it can be negative.
-     * @param[out] plat2 pointer to the latitude of point 2 (degrees).
-     * @param[out] plon2 pointer to the longitude of point 2 (degrees); requires
-     *   that \e l was initialized with \e caps |= GEOD_LONGITUDE.
-     * @param[out] pazi2 pointer to the (forward) azimuth at point 2 (degrees).
-     * @param[out] ps12 pointer to the distance between point 1 and point 2
-     *   (meters); requires that \e l was initialized with \e caps |=
-     *   GEOD_DISTANCE.
-     * @param[out] pm12 pointer to the reduced length of geodesic (meters);
-     *   requires that \e l was initialized with \e caps |= GEOD_REDUCEDLENGTH.
-     * @param[out] pM12 pointer to the geodesic scale of point 2 relative to
-     *   point 1 (dimensionless); requires that \e l was initialized with \e caps
-     *   |= GEOD_GEODESICSCALE.
-     * @param[out] pM21 pointer to the geodesic scale of point 1 relative to
-     *   point 2 (dimensionless); requires that \e l was initialized with \e caps
-     *   |= GEOD_GEODESICSCALE.
-     * @param[out] pS12 pointer to the area under the geodesic
-     *   (meters<sup>2</sup>); requires that \e l was initialized with \e caps |=
-     *   GEOD_AREA.
-     * @return \e a12 arc length of between point 1 and point 2 (degrees).
-     *
-     * \e l must have been initialized with a call to geod_lineinit() with \e
-     * caps |= GEOD_DISTANCE_IN.  The values of \e lon2 and \e azi2 returned are
-     * in the range [−180°, 180°).  Any of the "return" arguments
-     * \e plat2, etc., may be replaced by 0, if you do not need some quantities
-     * computed.  Requesting a value which \e l is not capable of computing is
-     * not an error; the corresponding argument will not be altered.
-     *
-     * Example, compute way points between JFK and Singapore Changi Airport
-     * using geod_genposition().  In this example, the points are evenly space in
-     * arc length (and so only approximately equally space in distance).  This is
-     * faster than using geod_position() would be appropriate if drawing the path
-     * on a map.
-     @code
-     struct geod_geodesic g;
-     struct geod_geodesicline l;
-     double a12, azi1, lat[101],lon[101];
-     int i;
-     geod_init(&g, 6378137, 1/298.257223563);
-     a12 = geod_geninverse(&g, 40.64, -73.78, 1.36, 103.99,
-     0, &azi1, 0, 0, 0, 0, 0);
-     geod_lineinit(&l, &g, 40.64, -73.78, azi1, GEOD_LATITUDE | GEOD_LONGITUDE);
-     for (i = 0; i < 101; ++i) {
-     geod_genposition(&l, 1, i * a12 * 0.01,
-     lat + i, lon + i, 0, 0, 0, 0, 0, 0);
-     printf("%.5f %.5f\n", lat[i], lon[i]);
-     }
-     @endcode
-     **********************************************************************/
-    double geod_genposition(const struct geod_geodesicline* l,
-                            int arcmode, double s12_a12,
-                            double* plat2, double* plon2, double* pazi2,
-                            double* ps12, double* pm12,
-                            double* pM12, double* pM21,
-                            double* pS12);
-    
-    /**
-     * Initialize a geod_polygon object.
-     *
-     * @param[out] p a pointer to the object to be initialized.
-     * @param[in] polylinep non-zero if a polyline instead of a polygon.
-     *
-     * If \e polylinep is zero, then the sequence of vertices and edges added by
-     * geod_polygon_addpoint() and geod_polygon_addedge() define a polygon and
-     * the perimeter and area are returned by geod_polygon_compute().  If \e
-     * polylinep is non-zero, then the vertices and edges define a polyline and
-     * only the perimeter is returned by geod_polygon_compute().
-     *
-     * An example of the use of this function is given in the documentation for
-     * geod_polygon_compute().
-     **********************************************************************/
-    void geod_polygon_init(struct geod_polygon* p, int polylinep);
-    
-    /**
-     * Add a point to the polygon or polyline.
-     *
-     * @param[in] g a pointer to the geod_geodesic object specifying the
-     *   ellipsoid.
-     * @param[in,out] p a pointer to the geod_polygon object specifying the
-     *   polygon.
-     * @param[in] lat the latitude of the point (degrees).
-     * @param[in] lon the longitude of the point (degrees).
-     *
-     * \e g and \e p must have been initialized with calls to geod_init() and
-     * geod_polygon_init(), respectively.  The same \e g must be used for all the
-     * points and edges in a polygon.  \e lat should be in the range
-     * [−90°, 90°] and \e lon should be in the range
-     * [−540°, 540°).
-     *
-     * An example of the use of this function is given in the documentation for
-     * geod_polygon_compute().
-     **********************************************************************/
-    void geod_polygon_addpoint(const struct geod_geodesic* g,
-                               struct geod_polygon* p,
-                               double lat, double lon);
-    
-    /**
-     * Add an edge to the polygon or polyline.
-     *
-     * @param[in] g a pointer to the geod_geodesic object specifying the
-     *   ellipsoid.
-     * @param[in,out] p a pointer to the geod_polygon object specifying the
-     *   polygon.
-     * @param[in] azi azimuth at current point (degrees).
-     * @param[in] s distance from current point to next point (meters).
-     *
-     * \e g and \e p must have been initialized with calls to geod_init() and
-     * geod_polygon_init(), respectively.  The same \e g must be used for all the
-     * points and edges in a polygon.  \e azi should be in the range
-     * [−540°, 540°).  This does nothing if no points have been
-     * added yet.  The \e lat and \e lon fields of \e p give the location of
-     * the new vertex.
-     **********************************************************************/
-    void geod_polygon_addedge(const struct geod_geodesic* g,
-                              struct geod_polygon* p,
-                              double azi, double s);
-    
-    /**
-     * Return the results for a polygon.
-     *
-     * @param[in] g a pointer to the geod_geodesic object specifying the
-     *   ellipsoid.
-     * @param[in] p a pointer to the geod_polygon object specifying the polygon.
-     * @param[in] reverse if non-zero then clockwise (instead of
-     *   counter-clockwise) traversal counts as a positive area.
-     * @param[in] sign if non-zero then return a signed result for the area if
-     *   the polygon is traversed in the "wrong" direction instead of returning
-     *   the area for the rest of the earth.
-     * @param[out] pA pointer to the area of the polygon (meters<sup>2</sup>);
-     *   only set if \e polyline is non-zero in the call to geod_polygon_init().
-     * @param[out] pP pointer to the perimeter of the polygon or length of the
-     *   polyline (meters).
-     * @return the number of points.
-     *
-     * Only simple polygons (which are not self-intersecting) are allowed.
-     * There's no need to "close" the polygon by repeating the first vertex.  Set
-     * \e pA or \e pP to zero, if you do not want the corresponding quantity
-     * returned.
-     *
-     * Example, compute the perimeter and area of the geodesic triangle with
-     * vertices (0°N,0°E), (0°N,90°E), (90°N,0°E).
-     @code
-     double A, P;
-     int n;
-     struct geod_geodesic g;
-     struct geod_polygon p;
-     geod_init(&g, 6378137, 1/298.257223563);
-     geod_polygon_init(&p, 0);
-     
-     geod_polygon_addpoint(&g, &p,  0,  0);
-     geod_polygon_addpoint(&g, &p,  0, 90);
-     geod_polygon_addpoint(&g, &p, 90,  0);
-     n = geod_polygon_compute(&g, &p, 0, 1, &A, &P);
-     printf("%d %.8f %.3f\n", n, P, A);
-     @endcode
-     **********************************************************************/
-    unsigned geod_polygon_compute(const struct geod_geodesic* g,
-                                  const struct geod_polygon* p,
-                                  int reverse, int sign,
-                                  double* pA, double* pP);
-    
-    /**
-     * Return the results assuming a tentative final test point is added;
-     * however, the data for the test point is not saved.  This lets you report a
-     * running result for the perimeter and area as the user moves the mouse
-     * cursor.  Ordinary floating point arithmetic is used to accumulate the data
-     * for the test point; thus the area and perimeter returned are less accurate
-     * than if geod_polygon_addpoint() and geod_polygon_compute() are used.
-     *
-     * @param[in] g a pointer to the geod_geodesic object specifying the
-     *   ellipsoid.
-     * @param[in] p a pointer to the geod_polygon object specifying the polygon.
-     * @param[in] lat the latitude of the test point (degrees).
-     * @param[in] lon the longitude of the test point (degrees).
-     * @param[in] reverse if non-zero then clockwise (instead of
-     *   counter-clockwise) traversal counts as a positive area.
-     * @param[in] sign if non-zero then return a signed result for the area if
-     *   the polygon is traversed in the "wrong" direction instead of returning
-     *   the area for the rest of the earth.
-     * @param[out] pA pointer to the area of the polygon (meters<sup>2</sup>);
-     *   only set if \e polyline is non-zero in the call to geod_polygon_init().
-     * @param[out] pP pointer to the perimeter of the polygon or length of the
-     *   polyline (meters).
-     * @return the number of points.
-     *
-     * \e lat should be in the range [−90°, 90°] and \e
-     * lon should be in the range [−540°, 540°).
-     **********************************************************************/
-    unsigned geod_polygon_testpoint(const struct geod_geodesic* g,
-                                    const struct geod_polygon* p,
-                                    double lat, double lon,
-                                    int reverse, int sign,
-                                    double* pA, double* pP);
-    
-    /**
-     * Return the results assuming a tentative final test point is added via an
-     * azimuth and distance; however, the data for the test point is not saved.
-     * This lets you report a running result for the perimeter and area as the
-     * user moves the mouse cursor.  Ordinary floating point arithmetic is used
-     * to accumulate the data for the test point; thus the area and perimeter
-     * returned are less accurate than if geod_polygon_addedge() and
-     * geod_polygon_compute() are used.
-     *
-     * @param[in] g a pointer to the geod_geodesic object specifying the
-     *   ellipsoid.
-     * @param[in] p a pointer to the geod_polygon object specifying the polygon.
-     * @param[in] azi azimuth at current point (degrees).
-     * @param[in] s distance from current point to final test point (meters).
-     * @param[in] reverse if non-zero then clockwise (instead of
-     *   counter-clockwise) traversal counts as a positive area.
-     * @param[in] sign if non-zero then return a signed result for the area if
-     *   the polygon is traversed in the "wrong" direction instead of returning
-     *   the area for the rest of the earth.
-     * @param[out] pA pointer to the area of the polygon (meters<sup>2</sup>);
-     *   only set if \e polyline is non-zero in the call to geod_polygon_init().
-     * @param[out] pP pointer to the perimeter of the polygon or length of the
-     *   polyline (meters).
-     * @return the number of points.
-     *
-     * \e azi should be in the range [−540°, 540°).
-     **********************************************************************/
-    unsigned geod_polygon_testedge(const struct geod_geodesic* g,
-                                   const struct geod_polygon* p,
-                                   double azi, double s,
-                                   int reverse, int sign,
-                                   double* pA, double* pP);
-    
-    /**
-     * A simple interface for computing the area of a geodesic polygon.
-     *
-     * @param[in] g a pointer to the geod_geodesic object specifying the
-     *   ellipsoid.
-     * @param[in] lats an array of latitudes of the polygon vertices (degrees).
-     * @param[in] lons an array of longitudes of the polygon vertices (degrees).
-     * @param[in] n the number of vertices.
-     * @param[out] pA pointer to the area of the polygon (meters<sup>2</sup>).
-     * @param[out] pP pointer to the perimeter of the polygon (meters).
-     *
-     * \e lats should be in the range [−90°, 90°]; \e lons should
-     * be in the range [−540°, 540°).
-     *
-     * Only simple polygons (which are not self-intersecting) are allowed.
-     * There's no need to "close" the polygon by repeating the first vertex.  The
-     * area returned is signed with counter-clockwise traversal being treated as
-     * positive.
-     *
-     * Example, compute the area of Antarctic:
-     @code
-     double
-     lats[] = {-72.9, -71.9, -74.9, -74.3, -77.5, -77.4, -71.7, -65.9, -65.7,
-     -66.6, -66.9, -69.8, -70.0, -71.0, -77.3, -77.9, -74.7},
-     lons[] = {-74, -102, -102, -131, -163, 163, 172, 140, 113,
-     88, 59, 25, -4, -14, -33, -46, -61};
-     struct geod_geodesic g;
-     double A, P;
-     geod_init(&g, 6378137, 1/298.257223563);
-     geod_polygonarea(&g, lats, lons, (sizeof lats) / (sizeof lats[0]), &A, &P);
-     printf("%.0f %.2f\n", A, P);
-     @endcode
-     **********************************************************************/
-    void geod_polygonarea(const struct geod_geodesic* g,
-                          double lats[], double lons[], int n,
-                          double* pA, double* pP);
-    
-    /**
-     * mask values for the the \e caps argument to geod_lineinit().
-     **********************************************************************/
-    enum geod_mask {
-        GEOD_NONE         = 0U,                     /**< Calculate nothing */
-        GEOD_LATITUDE     = 1U<<7  | 0U,            /**< Calculate latitude */
-        GEOD_LONGITUDE    = 1U<<8  | 1U<<3,         /**< Calculate longitude */
-        GEOD_AZIMUTH      = 1U<<9  | 0U,            /**< Calculate azimuth */
-        GEOD_DISTANCE     = 1U<<10 | 1U<<0,         /**< Calculate distance */
-        GEOD_DISTANCE_IN  = 1U<<11 | 1U<<0 | 1U<<1, /**< Allow distance as input  */
-        GEOD_REDUCEDLENGTH= 1U<<12 | 1U<<0 | 1U<<2, /**< Calculate reduced length */
-        GEOD_GEODESICSCALE= 1U<<13 | 1U<<0 | 1U<<2, /**< Calculate geodesic scale */
-        GEOD_AREA         = 1U<<14 | 1U<<4,         /**< Calculate reduced length */
-        GEOD_ALL          = 0x7F80U| 0x1FU          /**< Calculate everything */
-    };
-    
-#if defined(__cplusplus)
-}
-#endif
-
-#endif
diff --git a/src/utilities/mb7k2jstar.c b/src/utilities/mb7k2jstar.c
deleted file mode 100644
index e5efa19..0000000
--- a/src/utilities/mb7k2jstar.c
+++ /dev/null
@@ -1,2574 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mb7k2jstar.c	5/19/2005
- *    $Id: mb7k2jstar.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 2005-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mb7k2jstar extracts Edgetech subbottom profiler and sidescan data
- * from Reson 7k format data and outputs in the Edgetech Jstar format.
- *
- * Author:	D. W. Caress
- * Date:	May 19, 2005
- *
- * $Log: mb7k2jstar.c,v $
- * Revision 5.9  2008/09/13 06:08:09  caress
- * Updates to apply suggested patches to segy handling. Also fixes to remove compiler warnings.
- *
- * Revision 5.8  2007/10/08 16:48:07  caress
- * State of the code on 8 October 2007.
- *
- * Revision 5.7  2006/12/15 21:42:49  caress
- * Incremental CVS update.
- *
- * Revision 5.6  2006/04/26 22:05:25  caress
- * Changes to handle MBARI Mapping AUV data better.
- *
- * Revision 5.5  2006/04/19 18:32:07  caress
- * Allowed smoothing of extracted sidescan.
- *
- * Revision 5.4  2006/01/18 15:17:00  caress
- * Added stdlib.h include.
- *
- * Revision 5.3  2005/11/05 01:07:54  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.2  2005/08/17 17:27:02  caress
- * Fixed scaling for heading, roll, and pitch values.
- *
- * Revision 5.1  2005/06/15 15:35:37  caress
- * Fixed issues.
- *
- * Revision 5.0  2005/06/04 05:00:05  caress
- * Program to extract subbottom and sidescan data from Reson 7k files into Edgetech Jstar files.
- *
- *
- *
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <math.h>
-#include <string.h>
-
-/* MBIO include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_define.h"
-#include "mb_io.h"
-#include "mbsys_reson7k.h"
-#include "mbsys_jstar.h"
-
-/* local defines */
-#define	MB7K2JSTAR_SSLOW	1
-#define	MB7K2JSTAR_SSHIGH	2
-#define	MB7K2JSTAR_SBP		3
-#define	MB7K2JSTAR_ALL		4
-#define	MB7K2JSTAR_BOTTOMPICK_NONE		0
-#define	MB7K2JSTAR_BOTTOMPICK_BATHYMETRY	1
-#define	MB7K2JSTAR_BOTTOMPICK_ALTITUDE		2
-#define	MB7K2JSTAR_BOTTOMPICK_ARRIVAL		3
-#define	MB7K2JSTAR_SSGAIN_OFF			0
-#define	MB7K2JSTAR_SSGAIN_TVG_1OVERR		1
-#define MBES_ALLOC_NUM			128
-#define MBES_ROUTE_WAYPOINT_NONE		0
-#define MBES_ROUTE_WAYPOINT_SIMPLE	1
-#define MBES_ROUTE_WAYPOINT_TRANSIT	2
-#define MBES_ROUTE_WAYPOINT_STARTLINE	3
-#define MBES_ROUTE_WAYPOINT_ENDLINE	4
-#define MBES_ONLINE_THRESHOLD		15.0
-#define MBES_ONLINE_COUNT		30
-
-static char rcs_id[] = "$Id: mb7k2jstar.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-
-int main (int argc, char **argv)
-{
-	char program_name[] = "mb7k2jstar";
-	char help_message[] =  "mb7k2jstar extracts Edgetech subbottom profiler and sidescan data \nfrom Reson 7k format data and outputs in the Edgetech Jstar format.";
-	char usage_message[] = "mb7k2jstar [-Ifile -Atype -Bmode[/threshold] -C -Fformat -Lstartline/lineroot -Ooutfile -Rroutefile -X -H -V]";
-	extern char *optarg;
-	int	errflg = 0;
-	int	c;
-	int	help = 0;
-	int	flag = 0;
-
-	/* MBIO status variables */
-	int	status = MB_SUCCESS;
-	int	verbose = 0;
-	int	error = MB_ERROR_NO_ERROR;
-	char	*message;
-
-	/* MBIO read control parameters */
-	int	read_datalist = MB_NO;
-	char	read_file[MB_PATH_MAXLINE];
-	char	output_file[MB_PATH_MAXLINE];
-	char	current_output_file[MB_PATH_MAXLINE];
-	int	new_output_file = MB_YES;
-	int	output_file_set = MB_NO;
-	void	*datalist;
-	int	look_processed = MB_DATALIST_LOOK_YES;
-	double	file_weight;
-	int	format = 0;
-	int	pings;
-	int	lonflip;
-	double	bounds[4];
-	int	btime_i[7];
-	int	etime_i[7];
-	double	btime_d;
-	double	etime_d;
-	double	speedmin;
-	double	timegap;
-	char	file[MB_PATH_MAXLINE];
-	int	beams_bath;
-	int	beams_amp;
-	int	pixels_ss;
-	double	timeshift = 0.0;
-
-	/* MBIO read values */
-	void	*imbio_ptr = NULL;
-	struct mb_io_struct *imb_io_ptr = NULL;
-	void	*istore_ptr = NULL;
-	struct mbsys_reson7k_struct *istore = NULL;
-	void	*ombio_ptr = NULL;
-	struct mb_io_struct *omb_io_ptr = NULL;
-	void	*ostore_ptr = NULL;
-	struct mbsys_jstar_struct *ostore = NULL;
-	int	kind;
-	int	time_i[7];
-	int	time_j[5];
-	double	time_d;
-	double	navlon;
-	double	navlat;
-	double	speed;
-	double	heading;
-	double	distance;
-	double	altitude;
-	double	sonardepth;
-	double	roll;
-	double	pitch;
-	double	heave;
-	char	*beamflag = NULL;
-	double	*bath = NULL;
-	double	*bathacrosstrack = NULL;
-	double	*bathalongtrack = NULL;
-	double	*amp = NULL;
-	double	*ss = NULL;
-	double	*ssacrosstrack = NULL;
-	double	*ssalongtrack = NULL;
-	double	*ttimes = NULL;
-	double	*angles = NULL;
-	double	*angles_forward = NULL;
-	double	*angles_null = NULL;
-	double	*bheave = NULL;
-	double	*alongtrack_offset = NULL;
-	double	draft;
-	double	ssv;
-	double	ssv_use = 1500.0;
-
-	char	comment[MB_COMMENT_MAXLINE];
-	int	icomment = 0;
-
-	/* jstar data */
-	s7k_fsdwchannel	*s7kchannel;		/* Channel header and data */
-	s7k_fsdwssheader *s7kssheader;		/* Edgetech sidescan header */
-	s7k_fsdwsegyheader *s7ksegyheader;		/* Segy header for subbottom trace */
-	struct mbsys_jstar_channel_struct *channel;
-	int	obeams_bath;
-	int	obeams_amp;
-	int	opixels_ss;
-
-	/* extract modes */
-	int	extract_sbp = MB_NO;
-	int	extract_sslow = MB_NO;
-	int	extract_sshigh = MB_NO;
-	int	print_comments = MB_NO;
-
-	/* bottompick mode */
-	int	bottompickmode = MB7K2JSTAR_BOTTOMPICK_ALTITUDE;
-	double	bottompickthreshold = 0.4;
-
-	/* sidescan gain mode */
-	int	gainmode = MB7K2JSTAR_SSGAIN_OFF;
-	double	gainfactor = 1.0;
-	int	ssflip = MB_NO;
-
-	/* route and auto-line data */
-	char	route_file[MB_PATH_MAXLINE];
-	int	route_file_set = MB_NO;
-	int	checkroutebearing = MB_NO;
-	int	rawroutefile = MB_NO;
-	char	lineroot[MB_PATH_MAXLINE];
-	int	nroutepoint = 0;
-	int	nroutepointalloc = 0;
-	double	lon;
-	double	lat;
-	double	topo;
-	int	waypoint;
-	double	*routelon = NULL;
-	double	*routelat = NULL;
-	double	*routeheading = NULL;
-	int	*routewaypoint = NULL;
-	double	range;
-	double	rangethreshold = 50.0;
-	double	rangelast;
-	int	activewaypoint = 0;
-	int	startline = 1;
-	int	linenumber;
-
-	/* counting variables */
-	int	nreaddata = 0;
-	int	nreadheader = 0;
-	int	nreadssv = 0;
-	int	nreadnav1 = 0;
-	int	nreadsbp = 0;
-	int	nreadsslo = 0;
-	int	nreadsshi = 0;
-	int	nwritesbp = 0;
-	int	nwritesslo = 0;
-	int	nwritesshi = 0;
-	int	nreaddatatot = 0;
-	int	nreadheadertot = 0;
-	int	nreadssvtot = 0;
-	int	nreadnav1tot = 0;
-	int	nreadsbptot = 0;
-	int	nreadsslotot = 0;
-	int	nreadsshitot = 0;
-	int	nwritesbptot = 0;
-	int	nwritesslotot = 0;
-	int	nwritesshitot = 0;
-
-	int	mode;
-	int	format_status, format_guess;
-	int	format_output = MBF_EDGJSTAR;
-	int	shortspersample;
-	int	trace_size;
-	char	*data;
-	unsigned short	*datashort;
-	double	value, threshold;
-	double	channelmax;
-	int	channelpick;
-	double	ttime_min;
-	double	ttime_min_use;
-	int	ttime_min_ok = MB_NO;
-	int	beam_min;
-	int	smooth = 0;
-	double	factor;
-	double	mtodeglon, mtodeglat;
-	double	lastlon;
-	double	lastlat;
-	double	lastheading;
-	double	headingdiff;
-	int	oktowrite;
-	double	dx, dy;
-	FILE	*fp = NULL;
-	char	*result;
-	int	nget;
-	int	point_ok;
-
-	int	read_data;
-	int	found;
-	int	i, j, n;
-
-	startline = 1;
-	strcpy(lineroot, "jstar");
-
-	/* get current default values */
-	status = mb_defaults(verbose,&format,&pings,&lonflip,bounds,
-		btime_i,etime_i,&speedmin,&timegap);
-
-	/* set default input to datalist.mb-1 */
-	strcpy (read_file, "datalist.mb-1");
-
-	/* process argument list */
-	while ((c = getopt(argc, argv, "A:a:B:b:CcF:f:G:g:I:i:L:l:MmO:o:R:r:S:s:T:t:XxVvHh")) != -1)
-	  switch (c)
-		{
-		case 'H':
-		case 'h':
-			help++;
-			break;
-		case 'V':
-		case 'v':
-			verbose++;
-			break;
-		case 'A':
-		case 'a':
-			if (strncmp(optarg, "SSLOW", 5) == 0
-				|| strncmp(optarg, "sslow", 5) == 0)
-				{
-				extract_sslow = MB_YES;
-				}
-			else if (strncmp(optarg, "SSHIGH", 6) == 0
-				|| strncmp(optarg, "sshigh", 6) == 0)
-				{
-				extract_sshigh = MB_YES;
-				}
-			else if (strncmp(optarg, "SBP", 3) == 0
-				|| strncmp(optarg, "sbp", 3) == 0)
-				{
-				extract_sbp = MB_YES;
-				}
-			else if (strncmp(optarg, "ALL", 3) == 0
-				|| strncmp(optarg, "all", 3) == 0)
-				{
-				extract_sshigh = MB_YES;
-				extract_sslow = MB_YES;
-				extract_sbp = MB_YES;
-				}
-			else
-				{
-				sscanf (optarg,"%d", &mode);
-				if (mode == MB7K2JSTAR_SSLOW)
-					extract_sslow = MB_YES;
-				else if (mode == MB7K2JSTAR_SSHIGH)
-					extract_sshigh = MB_YES;
-				else if (mode == MB7K2JSTAR_SBP)
-					extract_sbp = MB_YES;
-				else if (mode == MB7K2JSTAR_ALL)
-					{
-					extract_sshigh = MB_YES;
-					extract_sslow = MB_YES;
-					extract_sbp = MB_YES;
-					}
-				}
-			flag++;
-			break;
-		case 'B':
-		case 'b':
-			n = sscanf (optarg,"%d/%lf", &bottompickmode, &bottompickthreshold);
-			if (n == 0)
-				bottompickmode = MB7K2JSTAR_BOTTOMPICK_ALTITUDE;
-			else if (n == 1 && bottompickmode == MB7K2JSTAR_BOTTOMPICK_ARRIVAL)
-				bottompickthreshold = 0.5;
-			flag++;
-			break;
-		case 'C':
-		case 'c':
-			print_comments = MB_YES;
-			break;
-		case 'F':
-		case 'f':
-			sscanf (optarg,"%d", &format);
-			flag++;
-			break;
-		case 'G':
-		case 'g':
-			sscanf (optarg,"%d/%lf", &gainmode, &gainfactor);
-			flag++;
-			break;
-		case 'I':
-		case 'i':
-			sscanf (optarg,"%s", read_file);
-			flag++;
-			break;
-		case 'L':
-		case 'l':
-			sscanf (optarg,"%d/%s", &startline, lineroot);
-			flag++;
-			break;
-		case 'M':
-		case 'm':
-			checkroutebearing = MB_YES;
-			flag++;
-			break;
-		case 'O':
-		case 'o':
-			sscanf (optarg,"%s", output_file);
-			output_file_set  = MB_YES;
-			flag++;
-			break;
-		case 'R':
-		case 'r':
-			sscanf (optarg,"%s", route_file);
-			route_file_set = MB_YES;
-			flag++;
-			break;
-		case 'S':
-		case 's':
-			sscanf (optarg,"%d", &smooth);
-			flag++;
-			break;
-		case 'T':
-		case 't':
-			sscanf (optarg,"%lf", &timeshift);
-			flag++;
-			break;
-		case 'X':
-		case 'x':
-			ssflip = MB_YES;
-			flag++;
-			break;
-		case '?':
-			errflg++;
-		}
-
-	/* if error flagged then print it and exit */
-	if (errflg)
-		{
-		fprintf(stderr,"usage: %s\n", usage_message);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		error = MB_ERROR_BAD_USAGE;
-		exit(error);
-		}
-
-	/* print starting message */
-	if (verbose == 1 || help)
-		{
-		fprintf(stderr,"\nProgram %s\n",program_name);
-		fprintf(stderr,"Version %s\n",rcs_id);
-		fprintf(stderr,"MB-system Version %s\n",MB_VERSION);
-		}
-
-	/* print starting debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  Program <%s>\n",program_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Control Parameters:\n");
-		fprintf(stderr,"dbg2       verbose:             %d\n",verbose);
-		fprintf(stderr,"dbg2       help:                %d\n",help);
-		fprintf(stderr,"dbg2       format:              %d\n",format);
-		fprintf(stderr,"dbg2       pings:               %d\n",pings);
-		fprintf(stderr,"dbg2       lonflip:             %d\n",lonflip);
-		fprintf(stderr,"dbg2       bounds[0]:           %f\n",bounds[0]);
-		fprintf(stderr,"dbg2       bounds[1]:           %f\n",bounds[1]);
-		fprintf(stderr,"dbg2       bounds[2]:           %f\n",bounds[2]);
-		fprintf(stderr,"dbg2       bounds[3]:           %f\n",bounds[3]);
-		fprintf(stderr,"dbg2       btime_i[0]:          %d\n",btime_i[0]);
-		fprintf(stderr,"dbg2       btime_i[1]:          %d\n",btime_i[1]);
-		fprintf(stderr,"dbg2       btime_i[2]:          %d\n",btime_i[2]);
-		fprintf(stderr,"dbg2       btime_i[3]:          %d\n",btime_i[3]);
-		fprintf(stderr,"dbg2       btime_i[4]:          %d\n",btime_i[4]);
-		fprintf(stderr,"dbg2       btime_i[5]:          %d\n",btime_i[5]);
-		fprintf(stderr,"dbg2       btime_i[6]:          %d\n",btime_i[6]);
-		fprintf(stderr,"dbg2       etime_i[0]:          %d\n",etime_i[0]);
-		fprintf(stderr,"dbg2       etime_i[1]:          %d\n",etime_i[1]);
-		fprintf(stderr,"dbg2       etime_i[2]:          %d\n",etime_i[2]);
-		fprintf(stderr,"dbg2       etime_i[3]:          %d\n",etime_i[3]);
-		fprintf(stderr,"dbg2       etime_i[4]:          %d\n",etime_i[4]);
-		fprintf(stderr,"dbg2       etime_i[5]:          %d\n",etime_i[5]);
-		fprintf(stderr,"dbg2       etime_i[6]:          %d\n",etime_i[6]);
-		fprintf(stderr,"dbg2       speedmin:            %f\n",speedmin);
-		fprintf(stderr,"dbg2       timegap:             %f\n",timegap);
-		fprintf(stderr,"dbg2       timeshift:           %f\n",timeshift);
-		fprintf(stderr,"dbg2       bottompickmode:      %d\n",bottompickmode);
-		fprintf(stderr,"dbg2       bottompickthreshold: %f\n",bottompickthreshold);
-		fprintf(stderr,"dbg2       smooth:              %d\n",smooth);
-		fprintf(stderr,"dbg2       gainmode:            %d\n",gainmode);
-		fprintf(stderr,"dbg2       gainfactor:          %f\n",gainfactor);
-		fprintf(stderr,"dbg2       file:                %s\n",file);
-		fprintf(stderr,"dbg2       route_file_set:      %d\n",route_file_set);
-		fprintf(stderr,"dbg2       route_file:          %s\n",route_file);
-		fprintf(stderr,"dbg2       checkroutebearing:   %d\n",checkroutebearing);
-		fprintf(stderr,"dbg2       output_file:         %s\n",output_file);
-		fprintf(stderr,"dbg2       output_file_set:     %d\n",output_file_set);
-		fprintf(stderr,"dbg2       lineroot:            %s\n",lineroot);
-		fprintf(stderr,"dbg2       extract_sbp:         %d\n",extract_sbp);
-		fprintf(stderr,"dbg2       extract_sslow:       %d\n",extract_sslow);
-		fprintf(stderr,"dbg2       extract_sshigh:      %d\n",extract_sshigh);
-		fprintf(stderr,"dbg2       print_comments:      %d\n",print_comments);
-		}
-
-	/* if help desired then print it and exit */
-	if (help)
-		{
-		fprintf(stderr,"\n%s\n",help_message);
-		fprintf(stderr,"\nusage: %s\n", usage_message);
-		exit(error);
-		}
-
-	/* set output types if needed */
-	if (extract_sbp == MB_NO
-		&& extract_sslow == MB_NO
-		&& extract_sshigh == MB_NO)
-		{
-		extract_sbp = MB_YES;
-		extract_sslow = MB_YES;
-		extract_sshigh = MB_YES;
-		}
-
-	/* output output types */
-	fprintf(stdout, "\nData records to extract:\n");
-	if (extract_sbp == MB_YES)
-		fprintf(stdout, "     Subbottom\n");
-	if (extract_sslow == MB_YES)
-		fprintf(stdout, "     Low Sidescan\n");
-	if (extract_sshigh == MB_YES)
-		fprintf(stdout, "     High Sidescan\n");
-	if (ssflip == MB_YES)
-		fprintf(stdout, "     Sidescan port and starboard exchanged\n");
-
-	/* set starting line number and output file if route read */
-	if (route_file_set == MB_YES)
-		{
-		linenumber = startline;
-		sprintf(output_file, "%s_%4.4d.mb132", lineroot, linenumber);
-		}
-
-	/* new output file obviously needed */
-	new_output_file = MB_YES;
-
-	/* if specified read route file */
-	if (route_file_set == MB_YES)
-		{
-		/* open the input file */
-		if ((fp = fopen(route_file, "r")) == NULL)
-			{
-			error = MB_ERROR_OPEN_FAIL;
-			status = MB_FAILURE;
-			fprintf(stderr,"\nUnable to open route file <%s> for reading\n",route_file);
-			exit(status);
-			}
-		rawroutefile = MB_NO;
-		while ((result = fgets(comment,MB_PATH_MAXLINE,fp)) == comment)
-		    	{
-			if (comment[0] == '#')
-				{
-				if (strncmp(comment,"## Route File Version", 21) == 0)
-					{
-					rawroutefile = MB_NO;
-					}
-				}
-			else
-				{
-				nget = sscanf(comment,"%lf %lf %lf %d %lf",
-				    &lon, &lat, &topo, &waypoint, &heading);
-				if (comment[0] == '#')
-					{
-					fprintf(stderr,"buffer:%s",comment);
-					if (strncmp(comment,"## Route File Version", 21) == 0)
-						{
-						rawroutefile = MB_NO;
-						}
-					}
-		    		if ((rawroutefile == MB_YES && nget >= 2)
-					|| (rawroutefile == MB_NO && nget >= 3 && waypoint > MBES_ROUTE_WAYPOINT_NONE))
-					point_ok = MB_YES;
-				else
-					point_ok = MB_NO;
-
-				/* if good data check for need to allocate more space */
-				if (point_ok == MB_YES
-					&& nroutepoint + 1 > nroutepointalloc)
-				    	{
-				    	nroutepointalloc += MBES_ALLOC_NUM;
-					status = mb_reallocd(verbose,__FILE__,__LINE__,nroutepointalloc * sizeof(double),
-								(void **)&routelon, &error);
-					status = mb_reallocd(verbose,__FILE__,__LINE__,nroutepointalloc * sizeof(double),
-								(void **)&routelat, &error);
-					status = mb_reallocd(verbose,__FILE__,__LINE__,nroutepointalloc * sizeof(double),
-								(void **)&routeheading, &error);
-					status = mb_reallocd(verbose,__FILE__,__LINE__,nroutepointalloc * sizeof(int),
-								(void **)&routewaypoint, &error);
-				    	if (status != MB_SUCCESS)
-					    	{
-						mb_error(verbose,error,&message);
-						fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",
-							message);
-						fprintf(stderr,"\nProgram <%s> Terminated\n",
-							program_name);
-						exit(error);
-					    	}
-				    	}
-
-				/* add good point to route */
-				if (point_ok == MB_YES && nroutepointalloc > nroutepoint + 1)
-					{
-					routelon[nroutepoint] = lon;
-					routelat[nroutepoint] = lat;
-					routeheading[nroutepoint] = heading;
-					routewaypoint[nroutepoint] = waypoint;
-					nroutepoint++;
-					}
-				}
-			}
-
-		/* close the file */
-		fclose(fp);
-		fp = NULL;
-
-		/* set starting values */
-		activewaypoint = 1;
-		mb_coor_scale(verbose,routelat[activewaypoint], &mtodeglon, &mtodeglat);
-		rangelast = 1000 * rangethreshold;
-		oktowrite = 0;
-
-		/* output status */
-		if (verbose > 0)
-			{
-			/* output info on file output */
-			fprintf(stderr,"\nImported %d waypoints from route file: %s\n",
-				nroutepoint, route_file);
-			}
-		}
-
-
-	/* get format if required */
-	if (format == 0)
-		mb_get_format(verbose,read_file,NULL,&format,&error);
-
-	/* determine whether to read one file or a list of files */
-	if (format < 0)
-		read_datalist = MB_YES;
-
-	/* open file list */
-	if (read_datalist == MB_YES)
-	    {
-	    if ((status = mb_datalist_open(verbose,&datalist,
-					    read_file,look_processed,&error)) != MB_SUCCESS)
-		{
-		error = MB_ERROR_OPEN_FAIL;
-		fprintf(stderr,"\nUnable to open data list file: %s\n",
-			read_file);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-	    if ((status = mb_datalist_read(verbose,datalist,
-			    file,&format,&file_weight,&error))
-			    == MB_SUCCESS)
-		read_data = MB_YES;
-	    else
-		read_data = MB_NO;
-	    }
-	/* else copy single filename to be read */
-	else
-	    {
-	    strcpy(file, read_file);
-	    read_data = MB_YES;
-	    }
-
-	/* loop over all files to be read */
-	while (read_data == MB_YES && format == MBF_RESON7KR)
-	{
-
-	/* initialize reading the swath file */
-	if ((status = mb_read_init(
-		verbose,file,format,pings,lonflip,bounds,
-		btime_i,etime_i,speedmin,timegap,
-		&imbio_ptr,&btime_d,&etime_d,
-		&beams_bath,&beams_amp,&pixels_ss,&error)) != MB_SUCCESS)
-		{
-		mb_error(verbose,error,&message);
-		fprintf(stderr,"\nMBIO Error returned from function <mb_read_init>:\n%s\n",message);
-		fprintf(stderr,"\nMultibeam File <%s> not initialized for reading\n",file);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-
-	/* get pointers to data storage */
-	imb_io_ptr = (struct mb_io_struct *) imbio_ptr;
-	istore_ptr = imb_io_ptr->store_data;
-	istore = (struct mbsys_reson7k_struct *) istore_ptr;
-
-	if (error == MB_ERROR_NO_ERROR)
-		{
-		beamflag = NULL;
-		bath = NULL;
-		amp = NULL;
-		bathacrosstrack = NULL;
-		bathalongtrack = NULL;
-		ss = NULL;
-		ssacrosstrack = NULL;
-		ssalongtrack = NULL;
-		}
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(char), (void **)&beamflag, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(double), (void **)&bath, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_AMPLITUDE,
-						sizeof(double), (void **)&amp, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(double), (void **)&bathacrosstrack, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(double), (void **)&bathalongtrack, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_SIDESCAN,
-						sizeof(double), (void **)&ss, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_SIDESCAN,
-						sizeof(double), (void **)&ssacrosstrack, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_SIDESCAN,
-						sizeof(double), (void **)&ssalongtrack, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(double), (void **)&ttimes, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(double), (void **)&angles, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(double), (void **)&angles_forward, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(double), (void **)&angles_null, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(double), (void **)&bheave, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(double), (void **)&alongtrack_offset, &error);
-
-	/* if error initializing memory then quit */
-	if (error != MB_ERROR_NO_ERROR)
-		{
-		mb_error(verbose,error,&message);
-		fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",
-			message);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-
-	/* set up output file name if needed */
-	if (error == MB_ERROR_NO_ERROR)
-		{
-		if (output_file_set == MB_YES && ombio_ptr == NULL)
-			{
-			/* set flag to open new output file */
-			new_output_file = MB_YES;
-			}
-
-		else if (output_file_set == MB_NO && route_file_set == MB_NO)
-			{
-			new_output_file = MB_YES;
-			format_status = mb_get_format(verbose, file, output_file,
-		    				&format_guess, &error);
-			if (format_status != MB_SUCCESS || format_guess != format)
-				{
-				strcpy(output_file, file);
-				}
-			if (output_file[strlen(output_file)-1] == 'p')
-				{
-				output_file[strlen(output_file)-1] = '\0';
-				}
-			if (extract_sbp == MB_YES && extract_sslow == MB_YES && extract_sshigh == MB_YES)
-				{
-				strcat(output_file,".jsf");
-				format_output = MBF_EDGJSTAR;
-				}
-			else if (extract_sslow == MB_YES)
-				{
-				strcat(output_file,".mb132");
-				format_output = MBF_EDGJSTAR;
-				}
-			else if (extract_sshigh == MB_YES)
-				{
-				strcat(output_file,".mb133");
-				format_output = MBF_EDGJSTR2;
-				}
-			else if (extract_sbp == MB_YES)
-				{
-				strcat(output_file,".jsf");
-				format_output = MBF_EDGJSTAR;
-				}
-			}
-		}
-
-	/* read and print data */
-	nreaddata = 0;
-	nreadheader = 0;
-	nreadssv = 0;
-	nreadnav1 = 0;
-	nreadsbp = 0;
-	nreadsslo = 0;
-	nreadsshi = 0;
-	ttime_min_ok = MB_NO;
-
-	while (error <= MB_ERROR_NO_ERROR)
-		{
-		/* reset error */
-		error = MB_ERROR_NO_ERROR;
-
-		/* read next data record */
-		status = mb_get_all(verbose,imbio_ptr,&istore_ptr,&kind,
-				    time_i,&time_d,&navlon,&navlat,
-				    &speed,&heading,
-				    &distance,&altitude,&sonardepth,
-				    &beams_bath,&beams_amp,&pixels_ss,
-				    beamflag,bath,amp,bathacrosstrack,bathalongtrack,
-				    ss,ssacrosstrack,ssalongtrack,
-				    comment,&error);
-/*fprintf(stderr,"kind:%d %s \n\ttime_i:%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d  %f    time_i:%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d  %f\n",
-kind,notice_msg[kind],time_i[0],time_i[1],time_i[2],time_i[3],time_i[4],time_i[5],time_i[6],time_d,
-istore->time_i[0],istore->time_i[1],istore->time_i[2],istore->time_i[3],istore->time_i[4],istore->time_i[5],istore->time_i[6],istore->time_d);*/
-
-		/* reset nonfatal errors */
-		if (kind == MB_DATA_DATA && error < 0)
-			{
-			status = MB_SUCCESS;
-			error = MB_ERROR_NO_ERROR;
-			}
-
-		/* save last nav and heading */
-		if (status == MB_SUCCESS && kind == MB_DATA_DATA)
-			{
-			if (navlon != 0.0)
-				lastlon = navlon;
-			if (navlat != 0.0)
-				lastlat = navlat;
-			if (heading != 0.0)
-				lastheading = heading;
-			}
-
-		/* check survey data position against waypoints */
-/* fprintf(stderr,"status:%d error:%d kind:%d route_file_set:%d nroutepoint:%d navlon:%f navlat:%f\n",
-status,error,kind,route_file_set,nroutepoint,navlon,navlat); */
-		if (status == MB_SUCCESS && kind == MB_DATA_DATA
-			&& route_file_set == MB_YES && nroutepoint > 1
-			&& navlon != 0.0 && navlat != 0.0)
-			{
-			dx = (navlon - routelon[activewaypoint]) / mtodeglon;
-			dy = (navlat - routelat[activewaypoint]) / mtodeglat;
-			range = sqrt(dx * dx + dy * dy);
-/* fprintf(stderr,"activewaypoint:%d range:%f lon:%f %f lat:%f %f dx:%f dy:%f\n",
-activewaypoint, range, navlon, routelon[activewaypoint], navlat, routelat[activewaypoint], dx, dy);*/
-			if (range < rangethreshold
-				&& (activewaypoint == 0 || range > rangelast)
-				&& activewaypoint < nroutepoint - 1)
-				{
-/* fprintf(stderr,"New output by range to routepoint: %f\n",range); */
-				/* if needed set flag to open new output file */
-				if (new_output_file == MB_NO)
-				    {
-				    /* increment line number */
-				    linenumber++;
-
-				    /* set output file name */
-				    sprintf(output_file, "%s_%4.4d", lineroot, linenumber);
-				    if (extract_sbp == MB_YES && extract_sslow == MB_YES && extract_sshigh == MB_YES)
-					    {
-					    strcat(output_file,".jsf");
-					    format_output = MBF_EDGJSTAR;
-					    }
-				    else if (extract_sslow == MB_YES)
-					    {
-					    strcat(output_file,".mb132");
-					    format_output = MBF_EDGJSTAR;
-					    }
-				    else if (extract_sshigh == MB_YES)
-					    {
-					    strcat(output_file,".mb133");
-					    format_output = MBF_EDGJSTR2;
-					    }
-				    else if (extract_sbp == MB_YES)
-					    {
-					    strcat(output_file,".jsf");
-					    format_output = MBF_EDGJSTAR;
-					    }
-
-				    /* set to open new output file */
-				    new_output_file = MB_YES;
-				    }
-
-				/* increment active waypoint */
-				activewaypoint++;
-				mb_coor_scale(verbose,routelat[activewaypoint], &mtodeglon, &mtodeglat);
-				rangelast = 1000 * rangethreshold;
-				oktowrite = 0;
-				}
-			else
-				rangelast = range;
-			}
-
-		if (kind == MB_DATA_DATA
-			&& error <= MB_ERROR_NO_ERROR)
-			{
-			/* extract travel times */
-			status = mb_ttimes(verbose,imbio_ptr,
-				istore_ptr,&kind,&beams_bath,
-				ttimes,angles,
-				angles_forward,angles_null,
-				bheave,alongtrack_offset,
-				&draft,&ssv,&error);
-
-			/* check surface sound velocity */
-			if (ssv > 0.0)
-				ssv_use = ssv;
-
-			/* get bottom arrival time, if possible */
-			ttime_min = 0.0;
-			found = MB_NO;
-			for (i=0;i<beams_bath;i++)
-				{
-				if (mb_beam_ok(beamflag[i]))
-					{
-					if (found == MB_NO || ttimes[i] < ttime_min)
-						{
-						ttime_min = ttimes[i];
-						beam_min = i;
-						found = MB_YES;
-						}
-					}
-				}
-			if (found == MB_YES)
-				{
-				ttime_min_use = ttime_min;
-				ttime_min_ok = MB_YES;
-				}
-/*fprintf(stderr,"found:%d beam_min:%d ttime_min_use:%f\n", found, beam_min, ttime_min_use);*/
-			}
-
-		/* nonfatal errors do not matter */
-		if (error < MB_ERROR_NO_ERROR)
-			{
-			error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-
-		/* if needed open new output file */
-		if (status == MB_SUCCESS
-			&& new_output_file == MB_YES
-			&& ((extract_sbp == MB_YES && kind == MB_DATA_SUBBOTTOM_SUBBOTTOM)
-				|| (extract_sslow == MB_YES && kind == MB_DATA_SIDESCAN2)
-				|| (extract_sshigh == MB_YES && kind == MB_DATA_SIDESCAN3)))
-			{
-
-			/* close any old output file unless a single file has been specified */
-			if (ombio_ptr != NULL)
-				{
-				/* close the swath file */
-				status = mb_close(verbose,&ombio_ptr,&error);
-
-				/* generate inf file */
-				if (status == MB_SUCCESS)
-					{
-					status = mb_make_info(verbose, MB_YES,
-								current_output_file,
-								format_output,
-								&error);
-					}
-
-				/* output counts */
-				fprintf(stdout, "\nData records written to: %s\n", current_output_file);
-				fprintf(stdout, "     Subbottom:     %d\n", nwritesbp);
-				fprintf(stdout, "     Low Sidescan:  %d\n", nwritesslo);
-				fprintf(stdout, "     High Sidescan: %d\n", nwritesshi);
-				nwritesbptot += nwritesbp;
-				nwritesslotot += nwritesslo;
-				nwritesshitot += nwritesshi;
-				}
-
-			/* open the new file */
-			nwritesbp = 0;
-			nwritesslo = 0;
-			nwritesshi = 0;
-			if ((status = mb_write_init(
-				verbose,output_file,MBF_EDGJSTAR,
-				&ombio_ptr,&obeams_bath,&obeams_amp,&opixels_ss,&error)) != MB_SUCCESS)
-				{
-				mb_error(verbose,error,&message);
-				fprintf(stderr,"\nMBIO Error returned from function <mb_write_init>:\n%s\n",message);
-				fprintf(stderr,"\nMultibeam File <%s> not initialized for writing\n",file);
-				fprintf(stderr,"\nProgram <%s> Terminated\n",
-					program_name);
-				exit(error);
-				}
-
-			/* save current_output_file */
-			strcpy(current_output_file, output_file);
-
-			/* get pointers to data storage */
-			omb_io_ptr = (struct mb_io_struct *) ombio_ptr;
-			ostore_ptr = omb_io_ptr->store_data;
-			ostore = (struct mbsys_jstar_struct *) ostore_ptr;
-
-			/* reset new_output_file */
-			new_output_file = MB_NO;
-			}
-
-		/* apply time shift if needed */
-		if (status == MB_SUCCESS && timeshift != 0.0
-			&& (kind == MB_DATA_SUBBOTTOM_SUBBOTTOM
-				|| kind == MB_DATA_SIDESCAN2
-				|| kind == MB_DATA_SIDESCAN3))
-			{
-			time_d += timeshift;
-			mb_get_date(verbose,time_d,time_i);
-			mb_get_jtime(verbose,time_i,time_j);
-/*fprintf(stderr,"Applying time shift: %f  %f\n",timeshift, time_d);*/
-			}
-
-		/* get some more values */
-		if (status == MB_SUCCESS
-			&& (kind == MB_DATA_SUBBOTTOM_SUBBOTTOM
-				|| kind == MB_DATA_DATA
-				|| kind == MB_DATA_SIDESCAN2
-				|| kind == MB_DATA_SIDESCAN3))
-			{
-/*for (i=MAX(0,imb_io_ptr->nfix-5);i<imb_io_ptr->nfix;i++)
-fprintf(stderr,"dbg2       nav fix[%2d]:   %f %f %f\n",
-i, imb_io_ptr->fix_time_d[i],
-imb_io_ptr->fix_lon[i],
-imb_io_ptr->fix_lat[i]);*/
-			mb_get_jtime(verbose, istore->time_i, time_j);
-			speed = 0.0;
-			mb_hedint_interp(verbose, imbio_ptr, time_d,
-					&heading, &error);
-			mb_navint_interp(verbose, imbio_ptr, time_d, heading, speed,
-					&navlon, &navlat, &speed, &error);
-			mb_depint_interp(verbose, imbio_ptr, time_d,
-					&sonardepth, &error);
-			mb_altint_interp(verbose, imbio_ptr, time_d,
-					&altitude, &error);
-			mb_attint_interp(verbose, imbio_ptr, time_d,
-					&heave, &roll, &pitch, &error);
-			}
-
-		/* if following a route check that the vehicle has come on line
-		    	(within MBES_ONLINE_THRESHOLD degrees)
-		    	before writing any data */
-		if (checkroutebearing == MB_YES
-		    	&& nroutepoint > 1 && activewaypoint > 0)
-		    	{
-			headingdiff = fabs(routeheading[activewaypoint-1] - heading);
-			if (headingdiff > 180.0)
-				headingdiff = 360.0 - headingdiff;
-			if (headingdiff < MBES_ONLINE_THRESHOLD)
-				oktowrite++;
-			else
-				oktowrite = 0;
-/* fprintf(stderr,"heading: %f %f %f oktowrite:%d\n",
-routeheading[activewaypoint-1],heading,headingdiff,oktowrite);*/
-			}
-		else
-		    	oktowrite = MBES_ONLINE_COUNT;
-/* if (status == MB_SUCCESS)
-fprintf(stderr,"activewaypoint:%d linenumber:%d range:%f   lon: %f %f   lat: %f %f oktowrite:%d\n",
-activewaypoint,linenumber,range, navlon,
-routelon[activewaypoint], navlat, routelat[activewaypoint], oktowrite);*/
-
-	   	/* handle multibeam data */
-		if (status == MB_SUCCESS && kind == MB_DATA_DATA)
-			{
-/*fprintf(stderr,"MB_DATA_DATA: status:%d error:%d kind:%d\n",status,error,kind);*/
-			nreaddata++;
-			}
-
-	   	/* handle file header data */
-		else if (status == MB_SUCCESS && kind == MB_DATA_HEADER)
-			{
-/*fprintf(stderr,"MB_DATA_HEADER: status:%d error:%d kind:%d\n",status,error,kind);*/
-			nreadheader++;
-			}
-
-	   	/* handle bluefin ctd data */
-		else if (status == MB_SUCCESS && kind == MB_DATA_SSV)
-			{
-/*fprintf(stderr,"MB_DATA_SSV: status:%d error:%d kind:%d\n",status,error,kind);*/
-			nreadssv++;
-			}
-
-	   	/* handle bluefin nav data */
-		else if (status == MB_SUCCESS && kind == MB_DATA_NAV2)
-			{
-/*fprintf(stderr,"MB_DATA_NAV1: status:%d error:%d kind:%d\n",status,error,kind);*/
-			nreadnav1++;
-			}
-
-	   	/* handle subbottom data */
-		else if (status == MB_SUCCESS && kind == MB_DATA_SUBBOTTOM_SUBBOTTOM)
-			{
-/*fprintf(stderr,"MB_DATA_SUBBOTTOM_SUBBOTTOM: status:%d error:%d kind:%d\n",status,error,kind);*/
-			nreadsbp++;
-
-			/* output data if desired */
-			if (extract_sbp == MB_YES && nreadnav1 > 0 && oktowrite >= MBES_ONLINE_COUNT)
-				{
-				/* set overall parameters */
-				ostore->kind = kind;
-				ostore->subsystem = 0;
-
-				/* copy subbottom data to jstar storage */
-				channel = (struct mbsys_jstar_channel_struct *) &(ostore->sbp);
-				s7kchannel = (s7k_fsdwchannel *) &(istore->fsdwsb.channel);
-				s7ksegyheader = (s7k_fsdwsegyheader *) &(istore->fsdwsb.segyheader);
-
-				/* message header values */
-				channel->message.start_marker = 0x1601;
-				channel->message.version = 0;
-				channel->message.session = 0;
-				channel->message.type = 80;
-				channel->message.command = 0;
-				channel->message.subsystem = 0;
-				channel->message.channel = 0;
-				channel->message.sequence = 0;
-				channel->message.reserved = 0;
-				channel->message.size = 0;
-
-				/* Trace Header */
-				channel->sequenceNumber = s7ksegyheader->sequenceNumber; 		/* 0-3 : Trace Sequence Number (always 0) ** */
-				channel->startDepth = s7ksegyheader->startDepth;          		/* 4-7 : Starting depth (window offset) in samples. */
-				channel->pingNum = s7ksegyheader->pingNum;              		/* 8-11: Ping number (increments with ping) ** */
-				channel->channelNum = s7ksegyheader->channelNum;           		/* 12-15 : Channel Number (0 .. n) ** */
-				for (i=0;i<6;i++)
-					channel->unused1[i] = s7ksegyheader->unused1[i];          	/* 16-27 */
-
-				channel->traceIDCode = s7ksegyheader->traceIDCode;         		/* 28-29 : ID Code (always 1 => seismic data) ** */
-
-				for (i=0;i<2;i++)
-					channel->unused2[i] = s7ksegyheader->unused2[i];     		/* 30-33 */
-				channel->dataFormat = s7ksegyheader->dataFormat;			/* 34-35 : DataFormatType */
-													/*   0 = 1 short  per sample  - envelope data */
-													/*   1 = 2 shorts per sample, - stored as real(1), imag(1), */
-													/*   2 = 1 short  per sample  - before matched filter */
-													/*   3 = 1 short  per sample  - real part analytic signal */
-													/*   4 = 1 short  per sample  - pixel data / ceros data */
-				channel->NMEAantennaeR = s7ksegyheader->NMEAantennaeR;			/* 36-37 : Distance from towfish to antennae in cm */
-				channel->NMEAantennaeO = s7ksegyheader->NMEAantennaeO;			/* 38-39 : Distance to antennae starboard direction in cm */
-				for (i=0;i<32;i++)
-					channel->RS232[i] = s7ksegyheader->RS232[i];			/* 40-71 : Reserved for RS232 data - TBD */
-				/* -------------------------------------------------------------------- */
-				/* Navigation data :                                                    */
-				/* If the coorUnits are seconds(2), the x values represent longitude    */
-				/* and the y values represent latitude.  A positive value designates    */
-				/* the number of seconds east of Greenwich Meridian or north of the     */
-				/* equator.                                                             */
-				/* -------------------------------------------------------------------- */
-				channel->sourceCoordX = s7ksegyheader->sourceCoordX;			/* 72-75 : Meters or Seconds of Arc */
-				channel->sourceCoordY = s7ksegyheader->sourceCoordY;			/* 76-79 : Meters or Seconds of Arc */
-				channel->groupCoordX = s7ksegyheader->groupCoordX;			/* 80-83 : mm or 10000 * (Minutes of Arc) */
-				channel->groupCoordY = s7ksegyheader->groupCoordY;			/* 84-87 : mm or 10000 * (Minutes of Arc) */
-				channel->coordUnits = s7ksegyheader->coordUnits;			/* 88-89 : Units of coordinates - 1->length (x /y), 2->seconds of arc */
-				for (i=0;i<24;i++)
-					channel->annotation[i] = s7ksegyheader->annotation[i];		/* 90-113 : Annotation string */
-				channel->samples = s7ksegyheader->samples;				/* 114-115 : Samples in this packet ** */
-													/* Note:  Large sample sizes require multiple packets. */
-				channel->sampleInterval = s7ksegyheader->sampleInterval;		/* 116-119 : Sample interval in ns of stored data ** */
-				channel->ADCGain = s7ksegyheader->ADCGain;				/* 120-121 : Gain factor of ADC */
-				channel->pulsePower = s7ksegyheader->pulsePower;			/* 122-123 : user pulse power setting (0 - 100) percent */
-				channel->correlated = s7ksegyheader->correlated;			/* 124-125 : correlated data 1 - No, 2 - Yes */
-				channel->startFreq = s7ksegyheader->startFreq;				/* 126-127 : Starting frequency in 10 * Hz */
-				channel->endFreq = s7ksegyheader->endFreq;				/* 128-129 : Ending frequency in 10 * Hz */
-				channel->sweepLength = s7ksegyheader->sweepLength;			/* 130-131 : Sweep length in ms */
-				for (i=0;i<4;i++)
-					channel->unused7[i] = s7ksegyheader->unused7[i];		/* 132-139 */
-				channel->aliasFreq = s7ksegyheader->aliasFreq;				/* 140-141 : alias Frequency (sample frequency / 2) */
-				channel->pulseID = s7ksegyheader->pulseID;				/* 142-143 : Unique pulse identifier */
-				for (i=0;i<6;i++)
-					channel->unused8[i] = s7ksegyheader->unused8[i];		/* 144-155 */
-				channel->year = istore->time_i[0];					/* 156-157 : Year data recorded (CPU time) */
-				channel->day = time_j[1];						/* 158-159 : day */
-				channel->hour = istore->time_i[3];					/* 160-161 : hour */
-				channel->minute = istore->time_i[4];					/* 162-163 : minute */
-				channel->second = istore->time_i[5];					/* 164-165 : second */
-				channel->timeBasis = s7ksegyheader->timeBasis;				/* 166-167 : Always 3 (other not specified by standard) */
-				channel->weightingFactor = s7ksegyheader->weightingFactor;		/* 168-169 :  weighting factor for block floating point expansion */
-													/*            -- defined as 2 -N volts for lsb */
-				channel->unused9 = s7ksegyheader->unused9;				/* 170-171 : */
-				/* -------------------------------------------------------------------- */
-				/* From pitch/roll/temp/heading sensor */
-				/* -------------------------------------------------------------------- */
-				channel->heading = s7ksegyheader->heading;				/* 172-173 : Compass heading (100 * degrees) -180.00 to 180.00 degrees */
-				channel->pitch = s7ksegyheader->pitch;					/* 174-175 : Pitch */
-				channel->roll = s7ksegyheader->roll;					/* 176-177 : Roll */
-				channel->temperature = s7ksegyheader->temperature;			/* 178-179 : Temperature (10 * degrees C) */
-				/* -------------------------------------------------------------------- */
-				/* User defined area from 180-239                                       */
-				/* -------------------------------------------------------------------- */
-				channel->heaveCompensation = s7ksegyheader->heaveCompensation;		/* 180-181 : Heave compensation offset (samples) */
-				channel->trigSource = s7ksegyheader->trigSource;   			/* 182-183 : TriggerSource (0 = internal, 1 = external) */
-				channel->markNumber = s7ksegyheader->markNumber;			/* 184-185 : Mark Number (0 = no mark) */
-				channel->NMEAHour = s7ksegyheader->NMEAHour;				/* 186-187 : Hour */
-				channel->NMEAMinutes = s7ksegyheader->NMEAMinutes;			/* 188-189 : Minutes */
-				channel->NMEASeconds = s7ksegyheader->NMEASeconds;			/* 190-191 : Seconds */
-				channel->NMEACourse = s7ksegyheader->NMEACourse;			/* 192-193 : Course */
-				channel->NMEASpeed = s7ksegyheader->NMEASpeed;				/* 194-195 : Speed */
-				channel->NMEADay = s7ksegyheader->NMEADay;				/* 196-197 : Day */
-				channel->NMEAYear = s7ksegyheader->NMEAYear;				/* 198-199 : Year */
-				channel->millisecondsToday = 0.001 * istore->time_i[6]			/* 200-203 : Millieconds today */
-							+ 1000 * (istore->time_i[5]
-								+ 60.0 * (istore->time_i[4]
-									+ 60.0 * istore->time_i[3]));
-				channel->ADCMax = s7ksegyheader->ADCMax;				/* 204-205 : Maximum absolute value for ADC samples for this packet */
-				channel->calConst = s7ksegyheader->calConst;				/* 206-207 : System constant in tenths of a dB */
-				channel->vehicleID = s7ksegyheader->vehicleID;				/* 208-209 : Vehicle ID */
-				for (i=0;i<6;i++)
-					channel->softwareVersion[i] = s7ksegyheader->softwareVersion[i];/* 210-215 : Software version number */
-				/* Following items are not in X-Star */
-				channel->sphericalCorrection = s7ksegyheader->sphericalCorrection;	/* 216-219 : Initial spherical correction factor (useful for multiping /*/
-													/* deep application) * 100 */
-				channel->packetNum = s7ksegyheader->packetNum;				/* 220-221 : Packet number (1 - N) (Each ping starts with packet 1) */
-				channel->ADCDecimation = s7ksegyheader->ADCDecimation;			/* 222-223 : A/D decimation before FFT */
-				channel->decimation = s7ksegyheader->decimation;			/* 224-225 : Decimation factor after FFT */
-				channel->unuseda = s7ksegyheader->unuseda[0];
-
-				/* -------------------------------------------------------------------- */
-				/* MB-System-only parameters from 236-239                               */
-				/* -------------------------------------------------------------------- */
-				channel->depth = 0;							/* 227-231 : Seafloor depth in 0.001 m */
-				channel->sonardepth = 0;						/* 236-235 : Sonar depth in 0.001 m */
-				channel->sonaraltitude = 0;						/* 236-239 : Sonar altitude in 0.001 m */
-
-				/* allocate memory for the trace */
-				if (channel->dataFormat == 1)
-					shortspersample = 2;
-				else
-					shortspersample = 1;
-				trace_size = shortspersample * channel->samples * sizeof(short);
-				channel->message.size = shortspersample * channel->samples * sizeof(short);
-				if (channel->trace_alloc < trace_size)
-					{
-					if ((status = mb_reallocd(verbose,__FILE__,__LINE__,trace_size, (void **)&(channel->trace), &error))
-						== MB_SUCCESS)
-						{
-						channel->trace_alloc = trace_size;
-						}
-					}
-
-				/* copy the trace */
-				if (status == MB_SUCCESS)
-					{
-					data = (char *) channel->trace;
-					for (i=0;i<trace_size;i++)
-						data[i] = s7kchannel->data[i];
-					}
-
-				/* set the sonar altitude using the specified mode */
-				if (bottompickmode == MB7K2JSTAR_BOTTOMPICK_ARRIVAL)
-					{
-					/* get bottom arrival in trace */
-					if (channel->dataFormat == MBSYS_JSTAR_TRACEFORMAT_ANALYTIC)
-						{
-						channelmax = 0.0;
-						for (i=0;i<channel->samples;i++)
-							{
-							value = sqrt((double) (channel->trace[2*i] * channel->trace[2*i]
-								+ channel->trace[2*i+1] * channel->trace[2*i+1]));
-							channelmax = MAX(value, channelmax);
-							}
-						channelpick = 0;
-						threshold = bottompickthreshold * channelmax;
-						for (i=0;i<channel->samples && channelpick == 0;i++)
-							{
-							value = sqrt((double) (channel->trace[2*i] * channel->trace[2*i]
-								+ channel->trace[2*i+1] * channel->trace[2*i+1]));
-							if (value >= threshold)
-								channelpick = i;
-							}
-						}
-					else
-						{
-						channelmax = 0.0;
-						for (i=0;i<channel->samples;i++)
-							{
-							value = (double)(channel->trace[i]);
-							channelmax = MAX(value, channelmax);
-							}
-						channelpick = 0;
-						threshold = bottompickthreshold * channelmax;
-						for (i=0;i<channel->samples && channelpick == 0;i++)
-							{
-							value = (double)(channel->trace[i]);
-							if (value >= threshold)
-								channelpick = i;
-							}
-						}
-
-					/* set sonar altitude */
-					channel->sonaraltitude = 0.00075 * channelpick * channel->sampleInterval;
-					}
-				else if (bottompickmode == MB7K2JSTAR_BOTTOMPICK_BATHYMETRY)
-					{
-					channel->sonaraltitude = (int) (750000.0 * ttime_min_use);
-					if (channel->sonaraltitude == 0)
-						channel->sonaraltitude = 1000 * altitude;
-					}
-				else
-					{
-					channel->sonaraltitude = 1000 * altitude;
-					}
-
-				/* reset navigation and other values */
-				if (navlon < 180.0) navlon = navlon + 360.0;
-				if (navlon > 180.0) navlon = navlon - 360.0;
-				channel->sourceCoordX = (int) (360000.0 * navlon);
-				channel->sourceCoordY = (int) (360000.0 * navlat);
-				channel->groupCoordX = (int) (360000.0 * navlon);
-				channel->groupCoordY = (int) (360000.0 * navlat);
-				channel->coordUnits = 2;
-				channel->heading = (short) (100.0 * heading);
-				channel->startDepth = sonardepth / channel->sampleInterval / 0.00000075;
-				channel->sonardepth = 1000 * sonardepth;
-				channel->depth = channel->sonardepth + channel->sonaraltitude;
-				channel->roll = (short) (32768 * roll / 180.0);
-				channel->pitch = (short) (32768 * pitch / 180.0);
-				channel->heaveCompensation = heave /
-						channel->sampleInterval / 0.00000075;
-
-				/* write the record */
-				mb_write_ping(verbose, ombio_ptr, ostore_ptr, &error);
-				nwritesbp++;
-				}
-			}
-
-	   	/* handle low frequency sidescan data */
-		else if (status == MB_SUCCESS && kind == MB_DATA_SIDESCAN2)
-			{
-/*fprintf(stderr,"MB_DATA_SIDESCAN2: status:%d error:%d kind:%d\n",status,error,kind);*/
-			nreadsslo++;
-
-			/* output data if desired */
-			if (extract_sslow == MB_YES && nreadnav1 > 0 && oktowrite >= MBES_ONLINE_COUNT)
-				{
-				/* set overall parameters */
-				ostore->kind = MB_DATA_DATA;
-				ostore->subsystem = 20;
-
-				/*----------------------------------------------------------------*/
-				/* copy low frequency port sidescan to jstar storage */
-				if (ssflip == MB_YES)
-					channel = (struct mbsys_jstar_channel_struct *) &(ostore->ssstbd);
-				else
-					channel = (struct mbsys_jstar_channel_struct *) &(ostore->ssport);
-				s7kchannel = (s7k_fsdwchannel *) &(istore->fsdwsslo.channel[0]);
-				s7kssheader = (s7k_fsdwssheader *) &(istore->fsdwsslo.ssheader[0]);
-
-				/* message header values */
-				channel->message.start_marker = 0x1601;
-				channel->message.version = 0;
-				channel->message.session = 0;
-				channel->message.type = 80;
-				channel->message.command = 0;
-				channel->message.subsystem = 20;
-				if (ssflip == MB_YES)
-					channel->message.channel = 1;
-				else
-					channel->message.channel = 0;
-				channel->message.sequence = 0;
-				channel->message.reserved = 0;
-				channel->message.size = 0;
-
-				/* Trace Header */
-				channel->sequenceNumber = 0; 						/* 0-3 : Trace Sequence Number (always 0) ** */
-				channel->startDepth = s7kssheader->startDepth;          		/* 4-7 : Starting depth (window offset) in samples. */
-				channel->pingNum = s7kssheader->pingNum;              			/* 8-11: Ping number (increments with ping) ** */
-				channel->channelNum = s7kssheader->channelNum;           		/* 12-15 : Channel Number (0 .. n) ** */
-				for (i=0;i<6;i++)
-					channel->unused1[i] = 0;          				/* 16-27 */
-
-				channel->traceIDCode = 1;         					/* 28-29 : ID Code (always 1 => seismic data) ** */
-
-				for (i=0;i<2;i++)
-					channel->unused2[i] = 0;   			  		/* 30-33 */
-				channel->dataFormat = s7kssheader->dataFormat;				/* 34-35 : DataFormatType */
-													/*   0 = 1 short  per sample  - envelope data */
-													/*   1 = 2 shorts per sample, - stored as real(1), imag(1), */
-													/*   2 = 1 short  per sample  - before matched filter */
-													/*   3 = 1 short  per sample  - real part analytic signal */
-													/*   4 = 1 short  per sample  - pixel data / ceros data */
-				channel->NMEAantennaeR = 0;						/* 36-37 : Distance from towfish to antennae in cm */
-				channel->NMEAantennaeO = 0;						/* 38-39 : Distance to antennae starboard direction in cm */
-				for (i=0;i<32;i++)
-					channel->RS232[i] = 0;						/* 40-71 : Reserved for RS232 data - TBD */
-				/* -------------------------------------------------------------------- */
-				/* Navigation data :                                                    */
-				/* If the coorUnits are seconds(2), the x values represent longitude    */
-				/* and the y values represent latitude.  A positive value designates    */
-				/* the number of seconds east of Greenwich Meridian or north of the     */
-				/* equator.                                                             */
-				/* -------------------------------------------------------------------- */
-				channel->sourceCoordX = 0;						/* 72-75 : Meters or Seconds of Arc */
-				channel->sourceCoordY = 0;						/* 76-79 : Meters or Seconds of Arc */
-				channel->groupCoordX = 0;						/* 80-83 : mm or 10000 * (Minutes of Arc) */
-				channel->groupCoordY = 0;						/* 84-87 : mm or 10000 * (Minutes of Arc) */
-				channel->coordUnits = 0;						/* 88-89 : Units of coordinates - 1->length (x /y), 2->seconds of arc */
-				for (i=0;i<24;i++)
-					channel->annotation[i] = 0;					/* 90-113 : Annotation string */
-				channel->samples = s7kssheader->samples;				/* 114-115 : Samples in this packet ** */
-													/* Note:  Large sample sizes require multiple packets. */
-				channel->sampleInterval = s7kssheader->sampleInterval;			/* 116-119 : Sample interval in ns of stored data ** */
-				channel->ADCGain = s7kssheader->ADCGain;				/* 120-121 : Gain factor of ADC */
-				channel->pulsePower = 0;						/* 122-123 : user pulse power setting (0 - 100) percent */
-				channel->correlated = 0;						/* 124-125 : correlated data 1 - No, 2 - Yes */
-				channel->startFreq = 0;							/* 126-127 : Starting frequency in 10 * Hz */
-				channel->endFreq = 0;							/* 128-129 : Ending frequency in 10 * Hz */
-				channel->sweepLength = 0;						/* 130-131 : Sweep length in ms */
-				for (i=0;i<4;i++)
-					channel->unused7[i] = 0;					/* 132-139 */
-				channel->aliasFreq = 0;							/* 140-141 : alias Frequency (sample frequency / 2) */
-				channel->pulseID = s7kssheader->pulseID;				/* 142-143 : Unique pulse identifier */
-				for (i=0;i<6;i++)
-					channel->unused8[i] = 0;					/* 144-155 */
-				channel->year = istore->time_i[0];					/* 156-157 : Year data recorded (CPU time) */
-				channel->day = time_j[1];						/* 158-159 : day */
-				channel->hour = istore->time_i[3];					/* 160-161 : hour */
-				channel->minute = istore->time_i[4];					/* 162-163 : minute */
-				channel->second = istore->time_i[5];					/* 164-165 : second */
-				channel->timeBasis = 3;							/* 166-167 : Always 3 (other not specified by standard) */
-				channel->weightingFactor = s7kssheader->weightingFactor;		/* 168-169 :  weighting factor for block floating point expansion */
-													/*            -- defined as 2 -N volts for lsb */
-				channel->unused9 = 0;							/* 170-171 : */
-				/* -------------------------------------------------------------------- */
-				/* From pitch/roll/temp/heading sensor */
-				/* -------------------------------------------------------------------- */
-				channel->heading = s7kssheader->heading;				/* 172-173 : Compass heading (100 * degrees) -180.00 to 180.00 degrees */
-				channel->pitch = s7kssheader->pitch;					/* 174-175 : Pitch */
-				channel->roll = s7kssheader->roll;					/* 176-177 : Roll */
-				channel->temperature = s7kssheader->temperature;			/* 178-179 : Temperature (10 * degrees C) */
-				/* -------------------------------------------------------------------- */
-				/* User defined area from 180-239                                       */
-				/* -------------------------------------------------------------------- */
-				channel->heaveCompensation = 0;						/* 180-181 : Heave compensation offset (samples) */
-				channel->trigSource = s7kssheader->trigSource;   			/* 182-183 : TriggerSource (0 = internal, 1 = external) */
-				channel->markNumber = s7kssheader->markNumber;				/* 184-185 : Mark Number (0 = no mark) */
-				channel->NMEAHour = 0;							/* 186-187 : Hour */
-				channel->NMEAMinutes = 0;						/* 188-189 : Minutes */
-				channel->NMEASeconds = 0;						/* 190-191 : Seconds */
-				channel->NMEACourse = 0;						/* 192-193 : Course */
-				channel->NMEASpeed = 0;							/* 194-195 : Speed */
-				channel->NMEADay = 0;							/* 196-197 : Day */
-				channel->NMEAYear = 0;							/* 198-199 : Year */
-				channel->millisecondsToday = 0.001 * istore->time_i[6]			/* 200-203 : Millieconds today */
-							+ 1000 * (istore->time_i[5]
-								+ 60.0 * (istore->time_i[4]
-									+ 60.0 * istore->time_i[3]));
-				channel->ADCMax = s7kssheader->ADCMax;					/* 204-205 : Maximum absolute value for ADC samples for this packet */
-				channel->calConst = 0;							/* 206-207 : System constant in tenths of a dB */
-				channel->vehicleID = 0;							/* 208-209 : Vehicle ID */
-				for (i=0;i<6;i++)
-					channel->softwareVersion[i] = 0;				/* 210-215 : Software version number */
-				/* Following items are not in X-Star */
-				channel->sphericalCorrection = 0;					/* 216-219 : Initial spherical correction factor (useful for multiping /*/
-													/* deep application) * 100 */
-				channel->packetNum = s7kssheader->packetNum;				/* 220-221 : Packet number (1 - N) (Each ping starts with packet 1) */
-				channel->ADCDecimation = 0;						/* 222-223 : A/D decimation before FFT */
-				channel->decimation = 0;						/* 224-225 : Decimation factor after FFT */
-				channel->unuseda = 0;
-
-				/* -------------------------------------------------------------------- */
-				/* MB-System-only parameters from 236-239                               */
-				/* -------------------------------------------------------------------- */
-				channel->depth = 0;							/* 227-231 : Seafloor depth in 0.001 m */
-				channel->sonardepth = 0;						/* 236-235 : Sonar depth in 0.001 m */
-				channel->sonaraltitude = 0;						/* 236-239 : Sonar altitude in 0.001 m */
-
-				/* allocate memory for the trace */
-				if (channel->dataFormat == 1)
-					shortspersample = 2;
-				else
-					shortspersample = 1;
-				trace_size = shortspersample * channel->samples * sizeof(short);
-				channel->message.size = shortspersample * channel->samples * sizeof(short);
-				if (channel->trace_alloc < trace_size)
-					{
-					if ((status = mb_reallocd(verbose,__FILE__,__LINE__,trace_size, (void **)&(channel->trace), &error))
-						== MB_SUCCESS)
-						{
-						channel->trace_alloc = trace_size;
-						}
-					}
-
-				/* copy the trace */
-				if (status == MB_SUCCESS)
-					{
-					if (smooth > 0 && channel->dataFormat == 0)
-						{
-						datashort = (unsigned short *) s7kchannel->data;
-						for (i=0;i<channel->samples;i++)
-							{
-							n = 0;
-							channel->trace[i] = 0.0;
-							for (j=MAX(i-smooth,0);j<MIN(i+smooth,channel->samples-1);j++)
-								{
-								channel->trace[i] += datashort[j];
-								n++;
-/*fprintf(stderr,"i:%d j:%d raw:%d tot:%d\n",i,j,datashort[j],channel->trace[i]);*/
-								}
-							channel->trace[i] /= n;
-/*fprintf(stderr,"Final data[%d] n:%d : %d\n", i, n, channel->trace[i]);*/
-							}
-						}
-					else if (smooth < 0 && channel->dataFormat == 0)
-						{
-						datashort = (unsigned short *) s7kchannel->data;
-						for (i=0;i<channel->samples;i++)
-							{
-							n = 0;
-							value = 0.0;
-							for (j=MAX(i+smooth,0);j<MIN(i-smooth,channel->samples-1);j++)
-								{
-								value += datashort[j] * datashort[j];
-								n++;
-/*fprintf(stderr,"i:%d j:%d raw:%d tot:%d\n",i,j,datashort[j],channel->trace[i]);*/
-								}
-							channel->trace[i] = (unsigned int) (sqrt(value) / n);
-/*fprintf(stderr,"Final data[%d] n:%d : %d\n", i, n, channel->trace[i]);*/
-							}
-						}
-					else
-						{
-						data = (char *) channel->trace;
-						for (i=0;i<trace_size;i++)
-							{
-							data[i] = s7kchannel->data[i];
-							}
-						}
-					}
-
-				/* set the sonar altitude using the specified mode */
-				if (bottompickmode == MB7K2JSTAR_BOTTOMPICK_ARRIVAL)
-					{
-					/* get bottom arrival in trace */
-					if (channel->dataFormat == MBSYS_JSTAR_TRACEFORMAT_ANALYTIC)
-						{
-						channelmax = 0.0;
-						for (i=0;i<channel->samples;i++)
-							{
-							value = sqrt((double) (channel->trace[2*i] * channel->trace[2*i]
-								+ channel->trace[2*i+1] * channel->trace[2*i+1]));
-							channelmax = MAX(value, channelmax);
-							}
-						channelpick = 0;
-						threshold = bottompickthreshold * channelmax;
-						for (i=0;i<channel->samples && channelpick == 0;i++)
-							{
-							value = sqrt((double) (channel->trace[2*i] * channel->trace[2*i]
-								+ channel->trace[2*i+1] * channel->trace[2*i+1]));
-							if (value >= threshold)
-								channelpick = i;
-							}
-						}
-					else
-						{
-						channelmax = 0.0;
-						for (i=0;i<channel->samples;i++)
-							{
-							value = (double)(channel->trace[i]);
-							channelmax = MAX(value, channelmax);
-							}
-						channelpick = 0;
-						threshold = bottompickthreshold * channelmax;
-						for (i=0;i<channel->samples && channelpick == 0;i++)
-							{
-							value = (double)(channel->trace[i]);
-							if (value >= threshold)
-								channelpick = i;
-							}
-						}
-
-					/* set sonar altitude */
-					channel->sonaraltitude = 0.00075 * channelpick * channel->sampleInterval;
-					}
-				else if (bottompickmode == MB7K2JSTAR_BOTTOMPICK_BATHYMETRY)
-					{
-					channel->sonaraltitude = (int) (750000.0 * ttime_min_use);
-					if (channel->sonaraltitude == 0)
-						channel->sonaraltitude = 1000 * altitude;
-					}
-				else
-					{
-					channel->sonaraltitude = 1000 * altitude;
-					}
-
-				/* apply gain if specified */
-				if (gainmode == MB7K2JSTAR_SSGAIN_TVG_1OVERR)
-					{
-					channelpick = (int) (((double)channel->sonaraltitude) / 0.00075 / ((double)channel->sampleInterval));
-					channelpick = MAX(channelpick, 1);
-/*fprintf(stderr,"altitude:%d sampleInterval:%d channelpick:%d\n",channel->sonaraltitude,channel->sampleInterval,channelpick);*/
-					for (i=0;i<channelpick;i++)
-						{
-						channel->trace[i] = (unsigned short) (gainfactor * channel->trace[i]);
-						}
-					for (i=channelpick;i<channel->samples;i++)
-						{
-						factor = gainfactor * (((double)( i * i)) / ((double) (channelpick * channelpick)));
-/*fprintf(stderr,"sample %d: factor:%f value: %d",i,factor,channel->trace[i]);*/
-						channel->trace[i] = (unsigned short) (factor * channel->trace[i]);
-/*fprintf(stderr," %d\n",channel->trace[i]);*/
-						}
-					}
-
-				/* reset navigation and other values */
-				if (navlon < 180.0) navlon = navlon + 360.0;
-				if (navlon > 180.0) navlon = navlon - 360.0;
-				channel->sourceCoordX = (int) (360000.0 * navlon);
-				channel->sourceCoordY = (int) (360000.0 * navlat);
-				channel->groupCoordX = (int) (360000.0 * navlon);
-				channel->groupCoordY = (int) (360000.0 * navlat);
-				channel->coordUnits = 2;
-				channel->heading = (short) (100.0 * heading);
-				channel->startDepth = sonardepth / channel->sampleInterval / 0.00000075;
-				channel->depth = channel->sonardepth + channel->sonaraltitude;
-				channel->sonardepth = 1000 * sonardepth;
-				channel->roll = (short) (32768 * roll / 180.0);
-				channel->pitch = (short) (32768 * pitch / 180.0);
-				channel->heaveCompensation = heave /
-						channel->sampleInterval / 0.00000075;
-
-				/*----------------------------------------------------------------*/
-				/* copy low frequency starboard sidescan to jstar storage */
-				if (ssflip == MB_YES)
-					channel = (struct mbsys_jstar_channel_struct *) &(ostore->ssport);
-				else
-					channel = (struct mbsys_jstar_channel_struct *) &(ostore->ssstbd);
-				s7kchannel = (s7k_fsdwchannel *) &(istore->fsdwsslo.channel[1]);
-				s7kssheader = (s7k_fsdwssheader *) &(istore->fsdwsslo.ssheader[1]);
-
-				/* message header values */
-				channel->message.start_marker = 0x1601;
-				channel->message.version = 0;
-				channel->message.session = 0;
-				channel->message.type = 80;
-				channel->message.command = 0;
-				channel->message.subsystem = 20;
-				if (ssflip == MB_YES)
-					channel->message.channel = 0;
-				else
-					channel->message.channel = 1;
-				channel->message.sequence = 0;
-				channel->message.reserved = 0;
-				channel->message.size = 0;
-
-				/* Trace Header */
-				channel->sequenceNumber = 0; 						/* 0-3 : Trace Sequence Number (always 0) ** */
-				channel->startDepth = s7kssheader->startDepth;          		/* 4-7 : Starting depth (window offset) in samples. */
-				channel->pingNum = s7kssheader->pingNum;              			/* 8-11: Ping number (increments with ping) ** */
-				channel->channelNum = s7kssheader->channelNum;           		/* 12-15 : Channel Number (0 .. n) ** */
-				for (i=0;i<6;i++)
-					channel->unused1[i] = 0;          				/* 16-27 */
-
-				channel->traceIDCode = 1;         					/* 28-29 : ID Code (always 1 => seismic data) ** */
-
-				for (i=0;i<2;i++)
-					channel->unused2[i] = 0;   			  		/* 30-33 */
-				channel->dataFormat = s7kssheader->dataFormat;				/* 34-35 : DataFormatType */
-													/*   0 = 1 short  per sample  - envelope data */
-													/*   1 = 2 shorts per sample, - stored as real(1), imag(1), */
-													/*   2 = 1 short  per sample  - before matched filter */
-													/*   3 = 1 short  per sample  - real part analytic signal */
-													/*   4 = 1 short  per sample  - pixel data / ceros data */
-				channel->NMEAantennaeR = 0;						/* 36-37 : Distance from towfish to antennae in cm */
-				channel->NMEAantennaeO = 0;						/* 38-39 : Distance to antennae starboard direction in cm */
-				for (i=0;i<32;i++)
-					channel->RS232[i] = 0;						/* 40-71 : Reserved for RS232 data - TBD */
-				/* -------------------------------------------------------------------- */
-				/* Navigation data :                                                    */
-				/* If the coorUnits are seconds(2), the x values represent longitude    */
-				/* and the y values represent latitude.  A positive value designates    */
-				/* the number of seconds east of Greenwich Meridian or north of the     */
-				/* equator.                                                             */
-				/* -------------------------------------------------------------------- */
-				channel->sourceCoordX = 0;						/* 72-75 : Meters or Seconds of Arc */
-				channel->sourceCoordY = 0;						/* 76-79 : Meters or Seconds of Arc */
-				channel->groupCoordX = 0;						/* 80-83 : mm or 10000 * (Minutes of Arc) */
-				channel->groupCoordY = 0;						/* 84-87 : mm or 10000 * (Minutes of Arc) */
-				channel->coordUnits = 0;						/* 88-89 : Units of coordinates - 1->length (x /y), 2->seconds of arc */
-				for (i=0;i<24;i++)
-					channel->annotation[i] = 0;					/* 90-113 : Annotation string */
-				channel->samples = s7kssheader->samples;				/* 114-115 : Samples in this packet ** */
-													/* Note:  Large sample sizes require multiple packets. */
-				channel->sampleInterval = s7kssheader->sampleInterval;			/* 116-119 : Sample interval in ns of stored data ** */
-				channel->ADCGain = s7kssheader->ADCGain;				/* 120-121 : Gain factor of ADC */
-				channel->pulsePower = 0;						/* 122-123 : user pulse power setting (0 - 100) percent */
-				channel->correlated = 0;						/* 124-125 : correlated data 1 - No, 2 - Yes */
-				channel->startFreq = 0;							/* 126-127 : Starting frequency in 10 * Hz */
-				channel->endFreq = 0;							/* 128-129 : Ending frequency in 10 * Hz */
-				channel->sweepLength = 0;						/* 130-131 : Sweep length in ms */
-				for (i=0;i<4;i++)
-					channel->unused7[i] = 0;					/* 132-139 */
-				channel->aliasFreq = 0;							/* 140-141 : alias Frequency (sample frequency / 2) */
-				channel->pulseID = s7kssheader->pulseID;				/* 142-143 : Unique pulse identifier */
-				for (i=0;i<6;i++)
-					channel->unused8[i] = 0;					/* 144-155 */
-				channel->year = istore->time_i[0];					/* 156-157 : Year data recorded (CPU time) */
-				channel->day = time_j[1];						/* 158-159 : day */
-				channel->hour = istore->time_i[3];					/* 160-161 : hour */
-				channel->minute = istore->time_i[4];					/* 162-163 : minute */
-				channel->second = istore->time_i[5];					/* 164-165 : second */
-				channel->timeBasis = 3;							/* 166-167 : Always 3 (other not specified by standard) */
-				channel->weightingFactor = s7kssheader->weightingFactor;		/* 168-169 :  weighting factor for block floating point expansion */
-													/*            -- defined as 2 -N volts for lsb */
-				channel->unused9 = 0;							/* 170-171 : */
-				/* -------------------------------------------------------------------- */
-				/* From pitch/roll/temp/heading sensor */
-				/* -------------------------------------------------------------------- */
-				channel->heading = s7kssheader->heading;				/* 172-173 : Compass heading (100 * degrees) -180.00 to 180.00 degrees */
-				channel->pitch = s7kssheader->pitch;					/* 174-175 : Pitch */
-				channel->roll = s7kssheader->roll;					/* 176-177 : Roll */
-				channel->temperature = s7kssheader->temperature;			/* 178-179 : Temperature (10 * degrees C) */
-				/* -------------------------------------------------------------------- */
-				/* User defined area from 180-239                                       */
-				/* -------------------------------------------------------------------- */
-				channel->heaveCompensation = 0;						/* 180-181 : Heave compensation offset (samples) */
-				channel->trigSource = s7kssheader->trigSource;   			/* 182-183 : TriggerSource (0 = internal, 1 = external) */
-				channel->markNumber = s7kssheader->markNumber;				/* 184-185 : Mark Number (0 = no mark) */
-				channel->NMEAHour = 0;							/* 186-187 : Hour */
-				channel->NMEAMinutes = 0;						/* 188-189 : Minutes */
-				channel->NMEASeconds = 0;						/* 190-191 : Seconds */
-				channel->NMEACourse = 0;						/* 192-193 : Course */
-				channel->NMEASpeed = 0;							/* 194-195 : Speed */
-				channel->NMEADay = 0;							/* 196-197 : Day */
-				channel->NMEAYear = 0;							/* 198-199 : Year */
-				channel->millisecondsToday = 0.001 * istore->time_i[6]			/* 200-203 : Millieconds today */
-							+ 1000 * (istore->time_i[5]
-								+ 60.0 * (istore->time_i[4]
-									+ 60.0 * istore->time_i[3]));
-				channel->ADCMax = s7kssheader->ADCMax;					/* 204-205 : Maximum absolute value for ADC samples for this packet */
-				channel->calConst = 0;							/* 206-207 : System constant in tenths of a dB */
-				channel->vehicleID = 0;							/* 208-209 : Vehicle ID */
-				for (i=0;i<6;i++)
-					channel->softwareVersion[i] = 0;				/* 210-215 : Software version number */
-				/* Following items are not in X-Star */
-				channel->sphericalCorrection = 0;					/* 216-219 : Initial spherical correction factor (useful for multiping /*/
-													/* deep application) * 100 */
-				channel->packetNum = s7kssheader->packetNum;				/* 220-221 : Packet number (1 - N) (Each ping starts with packet 1) */
-				channel->ADCDecimation = 0;						/* 222-223 : A/D decimation before FFT */
-				channel->decimation = 0;						/* 224-225 : Decimation factor after FFT */
-				channel->unuseda = 0;
-
-				/* -------------------------------------------------------------------- */
-				/* MB-System-only parameters from 236-239                               */
-				/* -------------------------------------------------------------------- */
-				channel->depth = 0;							/* 227-231 : Seafloor depth in 0.001 m */
-				channel->sonardepth = 0;						/* 236-235 : Sonar depth in 0.001 m */
-				channel->sonaraltitude = 0;						/* 236-239 : Sonar altitude in 0.001 m */
-
-				/* allocate memory for the trace */
-				if (channel->dataFormat == 1)
-					shortspersample = 2;
-				else
-					shortspersample = 1;
-				trace_size = shortspersample * channel->samples * sizeof(short);
-				channel->message.size = shortspersample * channel->samples * sizeof(short);
-				if (channel->trace_alloc < trace_size)
-					{
-					if ((status = mb_reallocd(verbose,__FILE__,__LINE__,trace_size, (void **)&(channel->trace), &error))
-						== MB_SUCCESS)
-						{
-						channel->trace_alloc = trace_size;
-						}
-					}
-
-				/* copy the trace */
-				if (status == MB_SUCCESS)
-					{
-					if (smooth > 0 && channel->dataFormat == 0)
-						{
-						datashort = (unsigned short *) s7kchannel->data;
-						for (i=0;i<channel->samples;i++)
-							{
-							n = 0;
-							channel->trace[i] = 0.0;
-							for (j=MAX(i-smooth,0);j<MIN(i+smooth,channel->samples-1);j++)
-								{
-								channel->trace[i] += datashort[j];
-								n++;
-/*fprintf(stderr,"i:%d j:%d raw:%d tot:%d\n",i,j,datashort[j],channel->trace[i]);*/
-								}
-							channel->trace[i] /= n;
-/*fprintf(stderr,"Final data[%d] n:%d : %d\n", i, n, channel->trace[i]);*/
-							}
-						}
-					else if (smooth < 0 && channel->dataFormat == 0)
-						{
-						datashort = (unsigned short *) s7kchannel->data;
-						for (i=0;i<channel->samples;i++)
-							{
-							n = 0;
-							value = 0.0;
-							for (j=MAX(i+smooth,0);j<MIN(i-smooth,channel->samples-1);j++)
-								{
-								value += datashort[j] * datashort[j];
-								n++;
-/*fprintf(stderr,"i:%d j:%d raw:%d tot:%d\n",i,j,datashort[j],channel->trace[i]);*/
-								}
-							channel->trace[i] = (unsigned int) (sqrt(value) / n);
-/*fprintf(stderr,"Final data[%d] n:%d : %d\n", i, n, channel->trace[i]);*/
-							}
-						}
-					else
-						{
-						data = (char *) channel->trace;
-						for (i=0;i<trace_size;i++)
-							{
-							data[i] = s7kchannel->data[i];
-							}
-						}
-					}
-
-				/* set the sonar altitude using the specified mode */
-				if (bottompickmode == MB7K2JSTAR_BOTTOMPICK_ARRIVAL)
-					{
-					/* get bottom arrival in trace */
-					if (channel->dataFormat == MBSYS_JSTAR_TRACEFORMAT_ANALYTIC)
-						{
-						channelmax = 0.0;
-						for (i=0;i<channel->samples;i++)
-							{
-							value = sqrt((double) (channel->trace[2*i] * channel->trace[2*i]
-								+ channel->trace[2*i+1] * channel->trace[2*i+1]));
-							channelmax = MAX(value, channelmax);
-							}
-						channelpick = 0;
-						threshold = bottompickthreshold * channelmax;
-						for (i=0;i<channel->samples && channelpick == 0;i++)
-							{
-							value = sqrt((double) (channel->trace[2*i] * channel->trace[2*i]
-								+ channel->trace[2*i+1] * channel->trace[2*i+1]));
-							if (value >= threshold)
-								channelpick = i;
-							}
-						}
-					else
-						{
-						channelmax = 0.0;
-						for (i=0;i<channel->samples;i++)
-							{
-							value = (double)(channel->trace[i]);
-							channelmax = MAX(value, channelmax);
-							}
-						channelpick = 0;
-						threshold = bottompickthreshold * channelmax;
-						for (i=0;i<channel->samples && channelpick == 0;i++)
-							{
-							value = (double)(channel->trace[i]);
-							if (value >= threshold)
-								channelpick = i;
-							}
-						}
-
-					/* set sonar altitude */
-					channel->sonaraltitude = 0.00075 * channelpick * channel->sampleInterval;
-					}
-				else if (bottompickmode == MB7K2JSTAR_BOTTOMPICK_BATHYMETRY)
-					{
-					channel->sonaraltitude = (int) (750000.0 * ttime_min_use);
-					if (channel->sonaraltitude == 0)
-						channel->sonaraltitude = 1000 * altitude;
-					}
-				else
-					{
-					channel->sonaraltitude = 1000 * altitude;
-					}
-
-				/* apply gain if specified */
-				if (gainmode == MB7K2JSTAR_SSGAIN_TVG_1OVERR)
-					{
-					channelpick = (int) (((double)channel->sonaraltitude) / 0.00075 / ((double)channel->sampleInterval));
-/*fprintf(stderr,"altitude:%d sampleInterval:%d channelpick:%d\n",channel->sonaraltitude,channel->sampleInterval,channelpick);*/
-					channelpick = MAX(channelpick, 1);
-					for (i=channelpick;i<channel->samples;i++)
-						{
-						factor = gainfactor * (((double)( i * i)) / ((double) (channelpick * channelpick)));
-/*fprintf(stderr,"sample %d: factor:%f value: %d",i,factor,channel->trace[i]);*/
-						channel->trace[i] = (unsigned short) (factor * channel->trace[i]);
-/*fprintf(stderr," %d\n",channel->trace[i]);*/
-						}
-					}
-
-				/* reset navigation and other values */
-				if (navlon < 180.0) navlon = navlon + 360.0;
-				if (navlon > 180.0) navlon = navlon - 360.0;
-				channel->sourceCoordX = (int) (360000.0 * navlon);
-				channel->sourceCoordY = (int) (360000.0 * navlat);
-				channel->groupCoordX = (int) (360000.0 * navlon);
-				channel->groupCoordY = (int) (360000.0 * navlat);
-				channel->coordUnits = 2;
-				channel->heading = (short) (100.0 * heading);
-				channel->startDepth = sonardepth / channel->sampleInterval / 0.00000075;
-				channel->sonardepth = 1000 * sonardepth;
-				channel->depth = channel->sonardepth + channel->sonaraltitude;
-				channel->roll = (short) (32768 * roll / 180.0);
-				channel->pitch = (short) (32768 * pitch / 180.0);
-				channel->heaveCompensation = heave /
-						channel->sampleInterval / 0.00000075;
-
-				/* write the record */
-				nwritesslo++;
-				mb_write_ping(verbose, ombio_ptr, ostore_ptr, &error);
-				}
-			}
-
-	   	/* handle high frequency sidescan data */
-		else if (status == MB_SUCCESS && kind == MB_DATA_SIDESCAN3)
-			{
-/*fprintf(stderr,"MB_DATA_SIDESCAN3: status:%d error:%d kind:%d\n",status,error,kind);*/
-			nreadsshi++;
-
-			/* output data if desired */
-			if (extract_sshigh == MB_YES && nreadnav1 > 0 && oktowrite >= MBES_ONLINE_COUNT)
-				{
-				/* set overall parameters */
-				ostore->kind = MB_DATA_SIDESCAN2;
-				ostore->subsystem = 21;
-
-				/*----------------------------------------------------------------*/
-				/* copy high frequency port sidescan to jstar storage */
-				if (ssflip == MB_YES)
-					channel = (struct mbsys_jstar_channel_struct *) &(ostore->ssstbd);
-				else
-					channel = (struct mbsys_jstar_channel_struct *) &(ostore->ssport);
-				s7kchannel = (s7k_fsdwchannel *) &(istore->fsdwsshi.channel[0]);
-				s7kssheader = (s7k_fsdwssheader *) &(istore->fsdwsshi.ssheader[0]);
-
-				/* message header values */
-				channel->message.start_marker = 0x1601;
-				channel->message.version = 0;
-				channel->message.session = 0;
-				channel->message.type = 80;
-				channel->message.command = 0;
-				channel->message.subsystem = 21;
-				channel->message.channel = 0;
-				channel->message.sequence = 0;
-				channel->message.reserved = 0;
-				channel->message.size = 0;
-
-				/* Trace Header */
-				channel->sequenceNumber = 0; 						/* 0-3 : Trace Sequence Number (always 0) ** */
-				channel->startDepth = s7kssheader->startDepth;          		/* 4-7 : Starting depth (window offset) in samples. */
-				channel->pingNum = s7kssheader->pingNum;              			/* 8-11: Ping number (increments with ping) ** */
-				channel->channelNum = s7kssheader->channelNum;           		/* 12-15 : Channel Number (0 .. n) ** */
-				for (i=0;i<6;i++)
-					channel->unused1[i] = 0;          				/* 16-27 */
-
-				channel->traceIDCode = 1;         					/* 28-29 : ID Code (always 1 => seismic data) ** */
-
-				for (i=0;i<2;i++)
-					channel->unused2[i] = 0;   			  		/* 30-33 */
-				channel->dataFormat = s7kssheader->dataFormat;				/* 34-35 : DataFormatType */
-													/*   0 = 1 short  per sample  - envelope data */
-													/*   1 = 2 shorts per sample, - stored as real(1), imag(1), */
-													/*   2 = 1 short  per sample  - before matched filter */
-													/*   3 = 1 short  per sample  - real part analytic signal */
-													/*   4 = 1 short  per sample  - pixel data / ceros data */
-				channel->NMEAantennaeR = 0;						/* 36-37 : Distance from towfish to antennae in cm */
-				channel->NMEAantennaeO = 0;						/* 38-39 : Distance to antennae starboard direction in cm */
-				for (i=0;i<32;i++)
-					channel->RS232[i] = 0;						/* 40-71 : Reserved for RS232 data - TBD */
-				/* -------------------------------------------------------------------- */
-				/* Navigation data :                                                    */
-				/* If the coorUnits are seconds(2), the x values represent longitude    */
-				/* and the y values represent latitude.  A positive value designates    */
-				/* the number of seconds east of Greenwich Meridian or north of the     */
-				/* equator.                                                             */
-				/* -------------------------------------------------------------------- */
-				channel->sourceCoordX = 0;						/* 72-75 : Meters or Seconds of Arc */
-				channel->sourceCoordY = 0;						/* 76-79 : Meters or Seconds of Arc */
-				channel->groupCoordX = 0;						/* 80-83 : mm or 10000 * (Minutes of Arc) */
-				channel->groupCoordY = 0;						/* 84-87 : mm or 10000 * (Minutes of Arc) */
-				channel->coordUnits = 0;						/* 88-89 : Units of coordinates - 1->length (x /y), 2->seconds of arc */
-				for (i=0;i<24;i++)
-					channel->annotation[i] = 0;					/* 90-113 : Annotation string */
-				channel->samples = s7kssheader->samples;				/* 114-115 : Samples in this packet ** */
-													/* Note:  Large sample sizes require multiple packets. */
-				channel->sampleInterval = s7kssheader->sampleInterval;			/* 116-119 : Sample interval in ns of stored data ** */
-				channel->ADCGain = s7kssheader->ADCGain;				/* 120-121 : Gain factor of ADC */
-				channel->pulsePower = 0;						/* 122-123 : user pulse power setting (0 - 100) percent */
-				channel->correlated = 0;						/* 124-125 : correlated data 1 - No, 2 - Yes */
-				channel->startFreq = 0;							/* 126-127 : Starting frequency in 10 * Hz */
-				channel->endFreq = 0;							/* 128-129 : Ending frequency in 10 * Hz */
-				channel->sweepLength = 0;						/* 130-131 : Sweep length in ms */
-				for (i=0;i<4;i++)
-					channel->unused7[i] = 0;					/* 132-139 */
-				channel->aliasFreq = 0;							/* 140-141 : alias Frequency (sample frequency / 2) */
-				channel->pulseID = s7kssheader->pulseID;				/* 142-143 : Unique pulse identifier */
-				for (i=0;i<6;i++)
-					channel->unused8[i] = 0;					/* 144-155 */
-				channel->year = istore->time_i[0];					/* 156-157 : Year data recorded (CPU time) */
-				channel->day = time_j[1];						/* 158-159 : day */
-				channel->hour = istore->time_i[3];					/* 160-161 : hour */
-				channel->minute = istore->time_i[4];					/* 162-163 : minute */
-				channel->second = istore->time_i[5];					/* 164-165 : second */
-				channel->timeBasis = 3;							/* 166-167 : Always 3 (other not specified by standard) */
-				channel->weightingFactor = s7kssheader->weightingFactor;		/* 168-169 :  weighting factor for block floating point expansion */
-													/*            -- defined as 2 -N volts for lsb */
-				channel->unused9 = 0;							/* 170-171 : */
-				/* -------------------------------------------------------------------- */
-				/* From pitch/roll/temp/heading sensor */
-				/* -------------------------------------------------------------------- */
-				channel->heading = s7kssheader->heading;				/* 172-173 : Compass heading (100 * degrees) -180.00 to 180.00 degrees */
-				channel->pitch = s7kssheader->pitch;					/* 174-175 : Pitch */
-				channel->roll = s7kssheader->roll;					/* 176-177 : Roll */
-				channel->temperature = s7kssheader->temperature;			/* 178-179 : Temperature (10 * degrees C) */
-				/* -------------------------------------------------------------------- */
-				/* User defined area from 180-239                                       */
-				/* -------------------------------------------------------------------- */
-				channel->heaveCompensation = 0;						/* 180-181 : Heave compensation offset (samples) */
-				channel->trigSource = s7kssheader->trigSource;   			/* 182-183 : TriggerSource (0 = internal, 1 = external) */
-				channel->markNumber = s7kssheader->markNumber;				/* 184-185 : Mark Number (0 = no mark) */
-				channel->NMEAHour = 0;							/* 186-187 : Hour */
-				channel->NMEAMinutes = 0;						/* 188-189 : Minutes */
-				channel->NMEASeconds = 0;						/* 190-191 : Seconds */
-				channel->NMEACourse = 0;						/* 192-193 : Course */
-				channel->NMEASpeed = 0;							/* 194-195 : Speed */
-				channel->NMEADay = 0;							/* 196-197 : Day */
-				channel->NMEAYear = 0;							/* 198-199 : Year */
-				channel->millisecondsToday = 0.001 * istore->time_i[6]			/* 200-203 : Millieconds today */
-							+ 1000 * (istore->time_i[5]
-								+ 60.0 * (istore->time_i[4]
-									+ 60.0 * istore->time_i[3]));
-				channel->ADCMax = s7kssheader->ADCMax;					/* 204-205 : Maximum absolute value for ADC samples for this packet */
-				channel->calConst = 0;							/* 206-207 : System constant in tenths of a dB */
-				channel->vehicleID = 0;							/* 208-209 : Vehicle ID */
-				for (i=0;i<6;i++)
-					channel->softwareVersion[i] = 0;				/* 210-215 : Software version number */
-				/* Following items are not in X-Star */
-				channel->sphericalCorrection = 0;					/* 216-219 : Initial spherical correction factor (useful for multiping /*/
-													/* deep application) * 100 */
-				channel->packetNum = s7kssheader->packetNum;				/* 220-221 : Packet number (1 - N) (Each ping starts with packet 1) */
-				channel->ADCDecimation = 0;						/* 222-223 : A/D decimation before FFT */
-				channel->decimation = 0;						/* 224-225 : Decimation factor after FFT */
-				channel->unuseda = 0;
-
-				/* -------------------------------------------------------------------- */
-				/* MB-System-only parameters from 236-239                               */
-				/* -------------------------------------------------------------------- */
-				channel->depth = 0;							/* 227-231 : Seafloor depth in 0.001 m */
-				channel->sonardepth = 0;						/* 236-235 : Sonar depth in 0.001 m */
-				channel->sonaraltitude = 0;						/* 236-239 : Sonar altitude in 0.001 m */
-
-				/* allocate memory for the trace */
-				if (channel->dataFormat == 1)
-					shortspersample = 2;
-				else
-					shortspersample = 1;
-				trace_size = shortspersample * channel->samples * sizeof(short);
-				channel->message.size = shortspersample * channel->samples * sizeof(short);
-				if (channel->trace_alloc < trace_size)
-					{
-					if ((status = mb_reallocd(verbose,__FILE__,__LINE__,trace_size, (void **)&(channel->trace), &error))
-						== MB_SUCCESS)
-						{
-						channel->trace_alloc = trace_size;
-						}
-					}
-
-				/* copy the trace */
-				if (status == MB_SUCCESS)
-					{
-					if (smooth > 0 && channel->dataFormat == 0)
-						{
-						datashort = (unsigned short *) s7kchannel->data;
-						for (i=0;i<channel->samples;i++)
-							{
-							n = 0;
-							channel->trace[i] = 0.0;
-							for (j=MAX(i-smooth,0);j<MIN(i+smooth,channel->samples-1);j++)
-								{
-								channel->trace[i] += datashort[j];
-								n++;
-/*fprintf(stderr,"i:%d j:%d raw:%d tot:%d\n",i,j,datashort[j],channel->trace[i]);*/
-								}
-							channel->trace[i] /= n;
-/*fprintf(stderr,"Final data[%d] n:%d : %d\n", i, n, channel->trace[i]);*/
-							}
-						}
-					else if (smooth < 0 && channel->dataFormat == 0)
-						{
-						datashort = (unsigned short *) s7kchannel->data;
-						for (i=0;i<channel->samples;i++)
-							{
-							n = 0;
-							value = 0.0;
-							for (j=MAX(i+smooth,0);j<MIN(i-smooth,channel->samples-1);j++)
-								{
-								value += datashort[j] * datashort[j];
-								n++;
-/*fprintf(stderr,"i:%d j:%d raw:%d tot:%d\n",i,j,datashort[j],channel->trace[i]);*/
-								}
-							channel->trace[i] = (unsigned int) (sqrt(value) / n);
-/*fprintf(stderr,"Final data[%d] n:%d : %d\n", i, n, channel->trace[i]);*/
-							}
-						}
-					else
-						{
-						data = (char *) channel->trace;
-						for (i=0;i<trace_size;i++)
-							{
-							data[i] = s7kchannel->data[i];
-							}
-						}
-					}
-
-				/* set the sonar altitude using the specified mode */
-				if (bottompickmode == MB7K2JSTAR_BOTTOMPICK_ARRIVAL)
-					{
-					/* get bottom arrival in trace */
-					if (channel->dataFormat == MBSYS_JSTAR_TRACEFORMAT_ANALYTIC)
-						{
-						channelmax = 0.0;
-						for (i=0;i<channel->samples;i++)
-							{
-							value = sqrt((double) (channel->trace[2*i] * channel->trace[2*i]
-								+ channel->trace[2*i+1] * channel->trace[2*i+1]));
-							channelmax = MAX(value, channelmax);
-							}
-						channelpick = 0;
-						threshold = bottompickthreshold * channelmax;
-						for (i=0;i<channel->samples && channelpick == 0;i++)
-							{
-							value = sqrt((double) (channel->trace[2*i] * channel->trace[2*i]
-								+ channel->trace[2*i+1] * channel->trace[2*i+1]));
-							if (value >= threshold)
-								channelpick = i;
-							}
-						}
-					else
-						{
-						channelmax = 0.0;
-						for (i=0;i<channel->samples;i++)
-							{
-							value = (double)(channel->trace[i]);
-							channelmax = MAX(value, channelmax);
-							}
-						channelpick = 0;
-						threshold = bottompickthreshold * channelmax;
-						for (i=0;i<channel->samples && channelpick == 0;i++)
-							{
-							value = (double)(channel->trace[i]);
-							if (value >= threshold)
-								channelpick = i;
-							}
-						}
-
-					/* set sonar altitude */
-					channel->sonaraltitude = 0.00075 * channelpick * channel->sampleInterval;
-					}
-				else if (bottompickmode == MB7K2JSTAR_BOTTOMPICK_BATHYMETRY)
-					{
-					channel->sonaraltitude = (int) (750000.0 * ttime_min_use);
-					if (channel->sonaraltitude == 0)
-						channel->sonaraltitude = 1000 * altitude;
-					}
-				else
-					{
-					channel->sonaraltitude = 1000 * altitude;
-					}
-
-				/* reset navigation and other values */
-				if (navlon < 180.0) navlon = navlon + 360.0;
-				if (navlon > 180.0) navlon = navlon - 360.0;
-				channel->sourceCoordX = (int) (360000.0 * navlon);
-				channel->sourceCoordY = (int) (360000.0 * navlat);
-				channel->groupCoordX = (int) (360000.0 * navlon);
-				channel->groupCoordY = (int) (360000.0 * navlat);
-				channel->coordUnits = 2;
-				channel->heading = (short) (100.0 * heading);
-				channel->startDepth = sonardepth / channel->sampleInterval / 0.00000075;
-				channel->sonardepth = 1000 * sonardepth;
-				channel->depth = channel->sonardepth + channel->sonaraltitude;
-				channel->roll = (short) (32768 * roll / 180.0);
-				channel->pitch = (short) (32768 * pitch / 180.0);
-				channel->heaveCompensation = heave /
-						channel->sampleInterval / 0.00000075;
-
-				/*----------------------------------------------------------------*/
-				/* copy high frequency starboard sidescan to jstar storage */
-				if (ssflip == MB_YES)
-					channel = (struct mbsys_jstar_channel_struct *) &(ostore->ssport);
-				else
-					channel = (struct mbsys_jstar_channel_struct *) &(ostore->ssstbd);
-				s7kchannel = (s7k_fsdwchannel *) &(istore->fsdwsshi.channel[1]);
-				s7kssheader = (s7k_fsdwssheader *) &(istore->fsdwsshi.ssheader[1]);
-
-				/* message header values */
-				channel->message.start_marker = 0x1601;
-				channel->message.version = 0;
-				channel->message.session = 0;
-				channel->message.type = 80;
-				channel->message.command = 0;
-				channel->message.subsystem = 21;
-				channel->message.channel = 1;
-				channel->message.sequence = 0;
-				channel->message.reserved = 0;
-				channel->message.size = 0;
-
-				/* Trace Header */
-				channel->sequenceNumber = 0; 						/* 0-3 : Trace Sequence Number (always 0) ** */
-				channel->startDepth = s7kssheader->startDepth;          		/* 4-7 : Starting depth (window offset) in samples. */
-				channel->pingNum = s7kssheader->pingNum;              			/* 8-11: Ping number (increments with ping) ** */
-				channel->channelNum = s7kssheader->channelNum;           		/* 12-15 : Channel Number (0 .. n) ** */
-				for (i=0;i<6;i++)
-					channel->unused1[i] = 0;          				/* 16-27 */
-
-				channel->traceIDCode = 1;         					/* 28-29 : ID Code (always 1 => seismic data) ** */
-
-				for (i=0;i<2;i++)
-					channel->unused2[i] = 0;   			  		/* 30-33 */
-				channel->dataFormat = s7kssheader->dataFormat;				/* 34-35 : DataFormatType */
-													/*   0 = 1 short  per sample  - envelope data */
-													/*   1 = 2 shorts per sample, - stored as real(1), imag(1), */
-													/*   2 = 1 short  per sample  - before matched filter */
-													/*   3 = 1 short  per sample  - real part analytic signal */
-													/*   4 = 1 short  per sample  - pixel data / ceros data */
-				channel->NMEAantennaeR = 0;						/* 36-37 : Distance from towfish to antennae in cm */
-				channel->NMEAantennaeO = 0;						/* 38-39 : Distance to antennae starboard direction in cm */
-				for (i=0;i<32;i++)
-					channel->RS232[i] = 0;						/* 40-71 : Reserved for RS232 data - TBD */
-				/* -------------------------------------------------------------------- */
-				/* Navigation data :                                                    */
-				/* If the coorUnits are seconds(2), the x values represent longitude    */
-				/* and the y values represent latitude.  A positive value designates    */
-				/* the number of seconds east of Greenwich Meridian or north of the     */
-				/* equator.                                                             */
-				/* -------------------------------------------------------------------- */
-				channel->sourceCoordX = 0;						/* 72-75 : Meters or Seconds of Arc */
-				channel->sourceCoordY = 0;						/* 76-79 : Meters or Seconds of Arc */
-				channel->groupCoordX = 0;						/* 80-83 : mm or 10000 * (Minutes of Arc) */
-				channel->groupCoordY = 0;						/* 84-87 : mm or 10000 * (Minutes of Arc) */
-				channel->coordUnits = 0;						/* 88-89 : Units of coordinates - 1->length (x /y), 2->seconds of arc */
-				for (i=0;i<24;i++)
-					channel->annotation[i] = 0;					/* 90-113 : Annotation string */
-				channel->samples = s7kssheader->samples;				/* 114-115 : Samples in this packet ** */
-													/* Note:  Large sample sizes require multiple packets. */
-				channel->sampleInterval = s7kssheader->sampleInterval;			/* 116-119 : Sample interval in ns of stored data ** */
-				channel->ADCGain = s7kssheader->ADCGain;				/* 120-121 : Gain factor of ADC */
-				channel->pulsePower = 0;						/* 122-123 : user pulse power setting (0 - 100) percent */
-				channel->correlated = 0;						/* 124-125 : correlated data 1 - No, 2 - Yes */
-				channel->startFreq = 0;							/* 126-127 : Starting frequency in 10 * Hz */
-				channel->endFreq = 0;							/* 128-129 : Ending frequency in 10 * Hz */
-				channel->sweepLength = 0;						/* 130-131 : Sweep length in ms */
-				for (i=0;i<4;i++)
-					channel->unused7[i] = 0;					/* 132-139 */
-				channel->aliasFreq = 0;							/* 140-141 : alias Frequency (sample frequency / 2) */
-				channel->pulseID = s7kssheader->pulseID;				/* 142-143 : Unique pulse identifier */
-				for (i=0;i<6;i++)
-					channel->unused8[i] = 0;					/* 144-155 */
-				channel->year = istore->time_i[0];					/* 156-157 : Year data recorded (CPU time) */
-				channel->day = time_j[1];						/* 158-159 : day */
-				channel->hour = istore->time_i[3];					/* 160-161 : hour */
-				channel->minute = istore->time_i[4];					/* 162-163 : minute */
-				channel->second = istore->time_i[5];					/* 164-165 : second */
-				channel->timeBasis = 3;							/* 166-167 : Always 3 (other not specified by standard) */
-				channel->weightingFactor = s7kssheader->weightingFactor;		/* 168-169 :  weighting factor for block floating point expansion */
-													/*            -- defined as 2 -N volts for lsb */
-				channel->unused9 = 0;							/* 170-171 : */
-				/* -------------------------------------------------------------------- */
-				/* From pitch/roll/temp/heading sensor */
-				/* -------------------------------------------------------------------- */
-				channel->heading = s7kssheader->heading;				/* 172-173 : Compass heading (100 * degrees) -180.00 to 180.00 degrees */
-				channel->pitch = s7kssheader->pitch;					/* 174-175 : Pitch */
-				channel->roll = s7kssheader->roll;					/* 176-177 : Roll */
-				channel->temperature = s7kssheader->temperature;			/* 178-179 : Temperature (10 * degrees C) */
-				/* -------------------------------------------------------------------- */
-				/* User defined area from 180-239                                       */
-				/* -------------------------------------------------------------------- */
-				channel->heaveCompensation = 0;						/* 180-181 : Heave compensation offset (samples) */
-				channel->trigSource = s7kssheader->trigSource;   			/* 182-183 : TriggerSource (0 = internal, 1 = external) */
-				channel->markNumber = s7kssheader->markNumber;				/* 184-185 : Mark Number (0 = no mark) */
-				channel->NMEAHour = 0;							/* 186-187 : Hour */
-				channel->NMEAMinutes = 0;						/* 188-189 : Minutes */
-				channel->NMEASeconds = 0;						/* 190-191 : Seconds */
-				channel->NMEACourse = 0;						/* 192-193 : Course */
-				channel->NMEASpeed = 0;							/* 194-195 : Speed */
-				channel->NMEADay = 0;							/* 196-197 : Day */
-				channel->NMEAYear = 0;							/* 198-199 : Year */
-				channel->millisecondsToday = 0.001 * istore->time_i[6]			/* 200-203 : Millieconds today */
-							+ 1000 * (istore->time_i[5]
-								+ 60.0 * (istore->time_i[4]
-									+ 60.0 * istore->time_i[3]));
-				channel->ADCMax = s7kssheader->ADCMax;					/* 204-205 : Maximum absolute value for ADC samples for this packet */
-				channel->calConst = 0;							/* 206-207 : System constant in tenths of a dB */
-				channel->vehicleID = 0;							/* 208-209 : Vehicle ID */
-				for (i=0;i<6;i++)
-					channel->softwareVersion[i] = 0;				/* 210-215 : Software version number */
-				/* Following items are not in X-Star */
-				channel->sphericalCorrection = 0;					/* 216-219 : Initial spherical correction factor (useful for multiping /*/
-													/* deep application) * 100 */
-				channel->packetNum = s7kssheader->packetNum;				/* 220-221 : Packet number (1 - N) (Each ping starts with packet 1) */
-				channel->ADCDecimation = 0;						/* 222-223 : A/D decimation before FFT */
-				channel->decimation = 0;						/* 224-225 : Decimation factor after FFT */
-				channel->unuseda = 0;
-
-				/* -------------------------------------------------------------------- */
-				/* MB-System-only parameters from 236-239                               */
-				/* -------------------------------------------------------------------- */
-				channel->depth = 0;							/* 227-231 : Seafloor depth in 0.001 m */
-				channel->sonardepth = 0;						/* 236-235 : Sonar depth in 0.001 m */
-				channel->sonaraltitude = 0;						/* 236-239 : Sonar altitude in 0.001 m */
-
-				/* allocate memory for the trace */
-				if (channel->dataFormat == 1)
-					shortspersample = 2;
-				else
-					shortspersample = 1;
-				trace_size = shortspersample * channel->samples * sizeof(short);
-				channel->message.size = shortspersample * channel->samples * sizeof(short);
-				if (channel->trace_alloc < trace_size)
-					{
-					if ((status = mb_reallocd(verbose,__FILE__,__LINE__,trace_size, (void **)&(channel->trace), &error))
-						== MB_SUCCESS)
-						{
-						channel->trace_alloc = trace_size;
-						}
-					}
-
-				/* copy the trace */
-				if (status == MB_SUCCESS)
-					{
-					if (smooth > 0 && channel->dataFormat == 0)
-						{
-						datashort = (unsigned short *) s7kchannel->data;
-						for (i=0;i<channel->samples;i++)
-							{
-							n = 0;
-							channel->trace[i] = 0.0;
-							for (j=MAX(i-smooth,0);j<MIN(i+smooth,channel->samples-1);j++)
-								{
-								channel->trace[i] += datashort[j];
-								n++;
-/*fprintf(stderr,"i:%d j:%d raw:%d tot:%d\n",i,j,datashort[j],channel->trace[i]);*/
-								}
-							channel->trace[i] /= n;
-/*fprintf(stderr,"Final data[%d] n:%d : %d\n", i, n, channel->trace[i]);*/
-							}
-						}
-					else if (smooth < 0 && channel->dataFormat == 0)
-						{
-						datashort = (unsigned short *) s7kchannel->data;
-						for (i=0;i<channel->samples;i++)
-							{
-							n = 0;
-							value = 0.0;
-							for (j=MAX(i+smooth,0);j<MIN(i-smooth,channel->samples-1);j++)
-								{
-								value += datashort[j] * datashort[j];
-								n++;
-/*fprintf(stderr,"i:%d j:%d raw:%d tot:%d\n",i,j,datashort[j],channel->trace[i]);*/
-								}
-							channel->trace[i] = (unsigned int) (sqrt(value) / n);
-/*fprintf(stderr,"Final data[%d] n:%d : %d\n", i, n, channel->trace[i]);*/
-							}
-						}
-					else
-						{
-						data = (char *) channel->trace;
-						for (i=0;i<trace_size;i++)
-							{
-							data[i] = s7kchannel->data[i];
-							}
-						}
-					}
-
-				/* set the sonar altitude using the specified mode */
-				if (bottompickmode == MB7K2JSTAR_BOTTOMPICK_ARRIVAL)
-					{
-					/* get bottom arrival in trace */
-					if (channel->dataFormat == MBSYS_JSTAR_TRACEFORMAT_ANALYTIC)
-						{
-						channelmax = 0.0;
-						for (i=0;i<channel->samples;i++)
-							{
-							value = sqrt((double) (channel->trace[2*i] * channel->trace[2*i]
-								+ channel->trace[2*i+1] * channel->trace[2*i+1]));
-							channelmax = MAX(value, channelmax);
-							}
-						channelpick = 0;
-						threshold = bottompickthreshold * channelmax;
-						for (i=0;i<channel->samples && channelpick == 0;i++)
-							{
-							value = sqrt((double) (channel->trace[2*i] * channel->trace[2*i]
-								+ channel->trace[2*i+1] * channel->trace[2*i+1]));
-							if (value >= threshold)
-								channelpick = i;
-							}
-						}
-					else
-						{
-						channelmax = 0.0;
-						for (i=0;i<channel->samples;i++)
-							{
-							value = (double)(channel->trace[i]);
-							channelmax = MAX(value, channelmax);
-							}
-						channelpick = 0;
-						threshold = bottompickthreshold * channelmax;
-						for (i=0;i<channel->samples && channelpick == 0;i++)
-							{
-							value = (double)(channel->trace[i]);
-							if (value >= threshold)
-								channelpick = i;
-							}
-						}
-
-					/* set sonar altitude */
-					channel->sonaraltitude = 0.00075 * channelpick * channel->sampleInterval;
-					}
-				else if (bottompickmode == MB7K2JSTAR_BOTTOMPICK_BATHYMETRY)
-					{
-					channel->sonaraltitude = (int) (750000.0 * ttime_min_use);
-					if (channel->sonaraltitude == 0)
-						channel->sonaraltitude = 1000 * altitude;
-					}
-				else
-					{
-					channel->sonaraltitude = 1000 * altitude;
-					}
-
-				/* reset navigation and other values */
-				if (navlon < 180.0) navlon = navlon + 360.0;
-				if (navlon > 180.0) navlon = navlon - 360.0;
-				channel->sourceCoordX = (int) (360000.0 * navlon);
-				channel->sourceCoordY = (int) (360000.0 * navlat);
-				channel->groupCoordX = (int) (360000.0 * navlon);
-				channel->groupCoordY = (int) (360000.0 * navlat);
-				channel->coordUnits = 2;
-				channel->heading = (short) (100.0 * heading);
-				channel->startDepth = sonardepth / channel->sampleInterval / 0.00000075;
-				channel->sonardepth = 1000 * sonardepth;
-				channel->depth = channel->sonardepth + channel->sonaraltitude;
-				channel->roll = (short) (32768 * roll / 180.0);
-				channel->pitch = (short) (32768 * pitch / 180.0);
-				channel->heaveCompensation = heave /
-						channel->sampleInterval / 0.00000075;
-
-				/* write the record */
-				nwritesshi++;
-				mb_write_ping(verbose, ombio_ptr, ostore_ptr, &error);
-				}
-			}
-
-	   	/* handle unknown data */
-		else  if (status == MB_SUCCESS)
-			{
-/*fprintf(stderr,"DATA TYPE UNKNOWN: status:%d error:%d kind:%d\n",status,error,kind);*/
-			}
-
-	   	/* handle read error */
-		else
-			{
-/*fprintf(stderr,"READ FAILURE: status:%d error:%d kind:%d\n",status,error,kind);*/
-			}
-
-		/* print debug statements */
-		if (verbose >= 2)
-			{
-			fprintf(stderr,"\ndbg2  Ping read in program <%s>\n",
-				program_name);
-			fprintf(stderr,"dbg2       kind:           %d\n",kind);
-			fprintf(stderr,"dbg2       error:          %d\n",error);
-			fprintf(stderr,"dbg2       status:         %d\n",status);
-			}
-
-		/* print comments */
-		if (print_comments == MB_YES && kind == MB_DATA_COMMENT)
-			{
-			if (icomment == 0)
-				{
-				fprintf(stderr,"\nComments:\n");
-				icomment++;
-				}
-			fprintf(stderr,"%s\n",comment);
-			}
-		}
-
-	/* close the swath file */
-	status = mb_close(verbose,&imbio_ptr,&error);
-
-	/* output counts */
-	fprintf(stdout, "\nData records read from: %s\n", file);
-	fprintf(stdout, "     Survey:        %d\n", nreaddata);
-	fprintf(stdout, "     File Header:   %d\n", nreadheader);
-	fprintf(stdout, "     Bluefin CTD:   %d\n", nreadssv);
-	fprintf(stdout, "     Bluefin Nav:   %d\n", nreadnav1);
-	fprintf(stdout, "     Subbottom:     %d\n", nreadsbp);
-	fprintf(stdout, "     Low Sidescan:  %d\n", nreadsslo);
-	fprintf(stdout, "     High Sidescan: %d\n", nreadsshi);
-	nreaddatatot += nreaddata;
-	nreadheadertot += nreadheader;
-	nreadssvtot += nreadssv;
-	nreadnav1tot += nreadnav1;
-	nreadsbptot += nreadsbp;
-	nreadsslotot += nreadsslo;
-	nreadsshitot += nreadsshi;
-
-	/* figure out whether and what to read next */
-        if (read_datalist == MB_YES)
-                {
-		if ((status = mb_datalist_read(verbose,datalist,
-			    file,&format,&file_weight,&error))
-			    == MB_SUCCESS)
-                        read_data = MB_YES;
-                else
-                        read_data = MB_NO;
-                }
-        else
-                {
-                read_data = MB_NO;
-                }
-
-	/* end loop over files in list */
-	}
-	if (read_datalist == MB_YES)
-		mb_datalist_close(verbose,&datalist,&error);
-
-	/* close output file if still open */
-	if (ombio_ptr != NULL)
-		{
-		/* close the swath file */
-		status = mb_close(verbose,&ombio_ptr,&error);
-
-		/* generate inf file */
-		if (status == MB_SUCCESS)
-			{
-			status = mb_make_info(verbose, MB_YES,
-						output_file,
-						format_output,
-						&error);
-			}
-		}
-
-	/* output counts */
-	fprintf(stdout, "\nTotal data records read from: %s\n", file);
-	fprintf(stdout, "     Survey:        %d\n", nreaddatatot);
-	fprintf(stdout, "     File Header:   %d\n", nreadheadertot);
-	fprintf(stdout, "     Bluefin CTD:   %d\n", nreadssvtot);
-	fprintf(stdout, "     Bluefin Nav:   %d\n", nreadnav1tot);
-	fprintf(stdout, "     Subbottom:     %d\n", nreadsbptot);
-	fprintf(stdout, "     Low Sidescan:  %d\n", nreadsslotot);
-	fprintf(stdout, "     High Sidescan: %d\n", nreadsshitot);
-	fprintf(stdout, "Total data records written to: %s\n", output_file);
-	fprintf(stdout, "     Subbottom:     %d\n", nwritesbptot);
-	fprintf(stdout, "     Low Sidescan:  %d\n", nwritesslotot);
-	fprintf(stdout, "     High Sidescan: %d\n", nwritesshitot);
-
-	/* deallocate route arrays */
-	if (route_file_set == MB_YES)
-		{
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&routelon, &error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&routelat, &error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&routeheading, &error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&routewaypoint, &error);
-		}
-
-	/* check memory */
-	if (verbose >= 4)
-		status = mb_memory_list(verbose,&error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  Program <%s> completed\n",
-			program_name);
-		fprintf(stderr,"dbg2  Ending status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* end it all */
-	exit(error);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/utilities/mb7k2ss.c b/src/utilities/mb7k2ss.c
deleted file mode 100644
index e4126e9..0000000
--- a/src/utilities/mb7k2ss.c
+++ /dev/null
@@ -1,2514 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mb7k2ss.c		8/15/2007
- *    $Id: mb7k2ss.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 2007-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mb7k2ss extracts Edgetech sidescan data
- * from Reson 7k format data, lays the sidescan on the bottom,
- * and outputs in format 71 mbldeoih.
- *
- * Author:	D. W. Caress
- * Date:	August 15, 2007
- *              R/V Atlantis, Axial Seamount
- *
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <math.h>
-#include <string.h>
-
-/* MBIO include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_define.h"
-#include "mb_io.h"
-#include "mb_aux.h"
-#include "mbsys_reson7k.h"
-#include "mbsys_ldeoih.h"
-
-/* local defines */
-#define	MB7K2SS_SS_FLAT_BOTTOM			0
-#define	MB7K2SS_SS_3D_BOTTOM			1
-#define	MB7K2SS_SSDIMENSION			4001
-#define	MB7K2SS_SSLOW				1
-#define	MB7K2SS_SSHIGH				2
-
-#define	MB7K2SS_BOTTOMPICK_NONE			0
-#define	MB7K2SS_BOTTOMPICK_BATHYMETRY		1
-#define	MB7K2SS_BOTTOMPICK_ALTITUDE		2
-#define	MB7K2SS_BOTTOMPICK_ARRIVAL		3
-#define	MB7K2SS_BOTTOMPICK_3DBATHY		4
-
-#define	MB7K2SS_SSGAIN_OFF			0
-#define	MB7K2SS_SSGAIN_TVG_1OVERR		1
-
-#define MB7K2SS_ALLOC_NUM			128
-#define MB7K2SS_ALLOC_CHUNK				1024
-
-#define MB7K2SS_ROUTE_WAYPOINT_NONE		0
-#define MB7K2SS_ROUTE_WAYPOINT_SIMPLE		1
-#define MB7K2SS_ROUTE_WAYPOINT_TRANSIT		2
-#define MB7K2SS_ROUTE_WAYPOINT_STARTLINE	3
-#define MB7K2SS_ROUTE_WAYPOINT_ENDLINE		4
-#define MB7K2SS_ONLINE_THRESHOLD		15.0
-#define MB7K2SS_ONLINE_COUNT			30
-
-#define	MB7K2SS_NUM_ANGLES			171
-#define	MB7K2SS_ANGLE_MAX			85.0
-
-int mb7k2ss_get_flatbottom_table(int verbose, int nangle, double angle_min, double angle_max,
-					double navlon, double navlat, double altitude, double pitch,
-					double *table_angle, double *table_xtrack, double *table_ltrack,
-					double *table_altitude, double *table_range,
-					int *error);
-
-static char rcs_id[] = "$Id: mb7k2ss.c 2227 2015-02-05 21:12:31Z caress $";
-char program_name[] = "mb7k2ss";
-
-/*--------------------------------------------------------------------*/
-
-int main (int argc, char **argv)
-{
-	char help_message[] =  "mb7k2ss extracts sidescan sonar data from Reson 7k format data, \nbins and lays the sidescan onto the seafloor, and outputs files \nin the MBF_MBLDEOIH formst (MBIO format id 71).\n";
-	char usage_message[] = "mb7k2ss [-Ifile -Atype -Bmode[/threshold] -C -D -Fformat -Lstartline/lineroot -Ooutfile -Rroutefile -Ttopogridfile -X -H -V]";
-	extern char *optarg;
-	int	errflg = 0;
-	int	c;
-	int	help = 0;
-	int	flag = 0;
-
-	/* MBIO status variables */
-	int	status = MB_SUCCESS;
-	int	verbose = 0;
-	int	error = MB_ERROR_NO_ERROR;
-	char	*message;
-
-	/* MBIO read control parameters */
-	int	read_datalist = MB_NO;
-	mb_path	read_file;
-	mb_path	output_file;
-	mb_path	current_output_file;
-	int	new_output_file = MB_YES;
-	int	output_file_set = MB_NO;
-	void	*datalist;
-	int	look_processed = MB_DATALIST_LOOK_YES;
-	double	file_weight;
-	int	format = 0;
-	int	pings;
-	int	lonflip;
-	double	bounds[4];
-	int	btime_i[7];
-	int	etime_i[7];
-	double	btime_d;
-	double	etime_d;
-	double	speedmin;
-	double	timegap;
-	mb_path	file;
-	int	beams_bath;
-	int	beams_amp;
-	int	pixels_ss;
-
-	/* topography parameters */
-	mb_path	topogridfile;
-	void	*topogrid_ptr = NULL;
-
-	/* MBIO read values */
-	void	*imbio_ptr = NULL;
-	struct mb_io_struct *imb_io_ptr = NULL;
-	void	*istore_ptr = NULL;
-	struct mbsys_reson7k_struct *istore = NULL;
-	void	*ombio_ptr = NULL;
-	struct mb_io_struct *omb_io_ptr = NULL;
-	void	*ostore_ptr = NULL;
-	struct mbsys_ldeoih_struct *ostore = NULL;
-	int	kind;
-	int	time_i[7];
-	double	time_d;
-	double	navlon;
-	double	navlat;
-	double	speed;
-	double	heading;
-	double	distance;
-	double	altitude;
-	double	sonardepth;
-	double	roll;
-	double	pitch;
-	double	heave;
-	char	*beamflag = NULL;
-	double	*bath = NULL;
-	double	*bathacrosstrack = NULL;
-	double	*bathalongtrack = NULL;
-	double	*amp = NULL;
-	double	*ss = NULL;
-	double	*ssacrosstrack = NULL;
-	double	*ssalongtrack = NULL;
-	double	*ttimes = NULL;
-	double	*angles = NULL;
-	double	*angles_forward = NULL;
-	double	*angles_null = NULL;
-	double	*bheave = NULL;
-	double	*alongtrack_offset = NULL;
-	double	draft;
-	double	ssv;
-	double	ssv_use = 1500.0;
-
-	char	comment[MB_COMMENT_MAXLINE];
-	int	icomment = 0;
-
-	/* synchronous navigation, heading, attitude data (from multibeam bathymetry records) */
-	int	ndat = 0;
-	int	ndat_alloc = 0;
-	double	*dat_time_d = NULL;
-	double	*dat_lon = NULL;
-	double	*dat_lat = NULL;
-	double	*dat_speed = NULL;
-	double	*dat_sonardepth = NULL;
-	double	*dat_heading = NULL;
-	double	*dat_draft = NULL;
-	double	*dat_roll = NULL;
-	double	*dat_pitch = NULL;
-	double	*dat_heave = NULL;
-	double	*dat_altitude = NULL;
-
-	/* sidescan data data */
-	s7k_fsdwchannel	*sschannelport;		/* Port hannel header and data */
-	s7k_fsdwssheader *ssheaderport;		/* Port Edgetech sidescan header */
-	s7k_fsdwchannel	*sschannelstbd;		/* Starboard channel header and data */
-	s7k_fsdwssheader *ssheaderstbd;		/* Starboard Edgetech sidescan header */
-
-	/* output sidescan data */
-	int	obeams_bath;
-	int	obeams_amp;
-	int	opixels_ss;
-	double	oss[MB7K2SS_SSDIMENSION];
-	double	ossacrosstrack[MB7K2SS_SSDIMENSION];
-	double	ossalongtrack[MB7K2SS_SSDIMENSION];
-	int	ossbincount[MB7K2SS_SSDIMENSION];
-	int	swath_width_set = MB_NO;
-	double	swath_width = -1.0;
-	double	pixel_width;
-
-	/* extract modes */
-	int	extract_type = MB7K2SS_SSLOW;
-	int	target_kind = MB_DATA_SIDESCAN2;
-	int	print_comments = MB_NO;
-
-	/* bottompick mode */
-	int	bottompickmode = MB7K2SS_BOTTOMPICK_ALTITUDE;
-	double	bottompickthreshold = 0.4;
-
-	/* sidescan layout mode */
-	int	sslayoutmode = MB7K2SS_SS_FLAT_BOTTOM;
-	double	ss_altitude;
-
-	/* sidescan gain mode */
-	int	gainmode = MB7K2SS_SSGAIN_OFF;
-	double	gainfactor = 1.0;
-	int	ssflip = MB_NO;
-
-	/* sidescan interpolation scale */
-	int	interpbins = 0;
-
-	/* route and auto-line data */
-	mb_path	timelist_file;
-	int	timelist_file_set = MB_NO;
-	int	ntimepoint = 0;
-	int	ntimepointalloc = 0;
-	double	*routetime_d = NULL;
-	mb_path	route_file;
-	int	route_file_set = MB_NO;
-	int	checkroutebearing = MB_NO;
-	int	rawroutefile = MB_NO;
-	mb_path	lineroot;
-	int	nroutepoint = 0;
-	int	nroutepointalloc = 0;
-	double	lon;
-	double	lat;
-	double	topo;
-	int	waypoint;
-	double	*routelon = NULL;
-	double	*routelat = NULL;
-	double	*routeheading = NULL;
-	int	*routewaypoint = NULL;
-	double	range;
-	double	rangethreshold = 50.0;
-	double	rangelast;
-	int	activewaypoint = 0;
-	int	startline = 1;
-	int	linenumber;
-
-	/* bottom layout parameters */
-	int	nangle = MB7K2SS_NUM_ANGLES;
-	double	angle_min = -MB7K2SS_ANGLE_MAX;
-	double	angle_max = MB7K2SS_ANGLE_MAX;
-	double	table_angle[MB7K2SS_NUM_ANGLES];
-	double	table_xtrack[MB7K2SS_NUM_ANGLES];
-	double	table_ltrack[MB7K2SS_NUM_ANGLES];
-	double	table_altitude[MB7K2SS_NUM_ANGLES];
-	double	table_range[MB7K2SS_NUM_ANGLES];
-
-	/* counting variables */
-	int	nreaddata = 0;
-	int	nreadheader = 0;
-	int	nreadssv = 0;
-	int	nreadnav1 = 0;
-	int	nreadsbp = 0;
-	int	nreadsslo = 0;
-	int	nreadsshi = 0;
-	int	nwritesslo = 0;
-	int	nwritesshi = 0;
-	int	nreaddatatot = 0;
-	int	nreadheadertot = 0;
-	int	nreadssvtot = 0;
-	int	nreadnav1tot = 0;
-	int	nreadsbptot = 0;
-	int	nreadsslotot = 0;
-	int	nreadsshitot = 0;
-	int	nwritesslotot = 0;
-	int	nwritesshitot = 0;
-
-	/* auto plotting */
-	FILE	*sfp = NULL;
-	char	scriptfile[MB_PATH_MAXLINE];
-	char	command[MB_PATH_MAXLINE];
-
-	int	mode;
-	int	format_status, format_guess;
-	int	format_output = MBF_MBLDEOIH;
-	unsigned short	*datashort;
-	double	value, threshold;
-	double	channelmax;
-	int	portchannelpick;
-	int	stbdchannelpick;
-	double	ttime;
-	double	ttime_min;
-	double	ttime_min_use;
-	double	nadir_depth;
-	int	istart;
-	int	ttime_min_ok = MB_NO;
-	int	beam_min;
-	int	smooth = 0;
-	double	weight;
-	double	factor;
-	double	mtodeglon, mtodeglat;
-	double	lastlon;
-	double	lastlat;
-	double	lastheading;
-	double	headingdiff;
-	int	linechange;
-	int	oktowrite;
-	double	dx, dy;
-	int	kangle, kstart;
-	double	xtrack, ltrack, rr, rangemin;
-	FILE	*fp = NULL;
-	char	*result;
-	int	nget;
-	int	point_ok;
-	int	previous, jj, interpable;
-	double	dss, dssl, fraction;
-	int	intstat, itime;
-	int	jport, jstbd;
-
-	int	read_data;
-	int	found, done;
-	int	shellstatus;
-	int	i, j, n;
-
-	startline = 1;
-	strcpy(lineroot, "sidescan");
-
-	/* get current default values */
-	status = mb_defaults(verbose,&format,&pings,&lonflip,bounds,
-		btime_i,etime_i,&speedmin,&timegap);
-
-	/* set default input to datalist.mb-1 */
-	strcpy (read_file, "datalist.mb-1");
-
-	/* process argument list */
-	while ((c = getopt(argc, argv, "A:a:B:b:CcD:d:F:f:G:g:I:i:L:l:MmO:o:Q:q:R:r:S:s:T:t:U:u:W:w:XxVvHh")) != -1)
-	  switch (c)
-		{
-		case 'H':
-		case 'h':
-			help++;
-			break;
-		case 'V':
-		case 'v':
-			verbose++;
-			break;
-		case 'A':
-		case 'a':
-			if (strncmp(optarg, "SSLOW", 5) == 0
-				|| strncmp(optarg, "sslow", 5) == 0)
-				{
-				extract_type = MB7K2SS_SSLOW;
-				target_kind = MB_DATA_SIDESCAN2;
-				}
-			else if (strncmp(optarg, "SSHIGH", 6) == 0
-				|| strncmp(optarg, "sshigh", 6) == 0)
-				{
-				extract_type = MB7K2SS_SSHIGH;
-				target_kind = MB_DATA_SIDESCAN3;
-				}
-			else
-				{
-				sscanf (optarg,"%d", &mode);
-				if (mode == MB7K2SS_SSLOW)
-					{
-					extract_type = MB7K2SS_SSLOW;
-					target_kind = MB_DATA_SIDESCAN2;
-					}
-				else if (mode == MB7K2SS_SSHIGH)
-					{
-					extract_type = MB7K2SS_SSHIGH;
-					target_kind = MB_DATA_SIDESCAN3;
-					}
-				}
-			flag++;
-			break;
-		case 'B':
-		case 'b':
-			n = sscanf (optarg,"%d/%lf", &bottompickmode, &bottompickthreshold);
-			if (n == 0)
-				bottompickmode = MB7K2SS_BOTTOMPICK_ALTITUDE;
-			else if (n == 1 && bottompickmode == MB7K2SS_BOTTOMPICK_ARRIVAL)
-				bottompickthreshold = 0.5;
-			flag++;
-			break;
-		case 'C':
-		case 'c':
-			print_comments = MB_YES;
-			break;
-		case 'D':
-		case 'd':
-			sscanf (optarg,"%d", &interpbins);
-			break;
-		case 'F':
-		case 'f':
-			sscanf (optarg,"%d", &format);
-			flag++;
-			break;
-		case 'G':
-		case 'g':
-			sscanf (optarg,"%d/%lf", &gainmode, &gainfactor);
-			flag++;
-			break;
-		case 'I':
-		case 'i':
-			sscanf (optarg,"%s", read_file);
-			flag++;
-			break;
-		case 'L':
-		case 'l':
-			sscanf (optarg,"%d/%s", &startline, lineroot);
-			flag++;
-			break;
-		case 'M':
-		case 'm':
-			checkroutebearing = MB_YES;
-			flag++;
-			break;
-		case 'O':
-		case 'o':
-			sscanf (optarg,"%s", output_file);
-			output_file_set  = MB_YES;
-			flag++;
-			break;
-		case 'Q':
-		case 'q':
-			sscanf (optarg,"%s", timelist_file);
-			timelist_file_set = MB_YES;
-			flag++;
-			break;
-		case 'R':
-		case 'r':
-			sscanf (optarg,"%s", route_file);
-			route_file_set = MB_YES;
-			flag++;
-			break;
-		case 'S':
-		case 's':
-			sscanf (optarg,"%d", &smooth);
-			flag++;
-			break;
-		case 'T':
-		case 't':
-			sscanf (optarg,"%s", topogridfile);
-			sslayoutmode = MB7K2SS_SS_3D_BOTTOM;
-			flag++;
-			break;
-		case 'U':
-		case 'u':
-			sscanf (optarg,"%lf", &rangethreshold);
-			flag++;
-			break;
-		case 'W':
-		case 'w':
-			sscanf (optarg,"%lf", &swath_width);
-			if (swath_width > 0.0)
-				swath_width_set = MB_YES;
-			flag++;
-			break;
-		case 'X':
-		case 'x':
-			ssflip = MB_YES;
-			flag++;
-			break;
-		case '?':
-			errflg++;
-		}
-
-	/* if error flagged then print it and exit */
-	if (errflg)
-		{
-		fprintf(stderr,"usage: %s\n", usage_message);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		error = MB_ERROR_BAD_USAGE;
-		exit(error);
-		}
-
-	/* print starting message */
-	if (verbose == 1 || help)
-		{
-		fprintf(stderr,"\nProgram %s\n",program_name);
-		fprintf(stderr,"Version %s\n",rcs_id);
-		fprintf(stderr,"MB-system Version %s\n",MB_VERSION);
-		}
-
-	/* print starting debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  Program <%s>\n",program_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Control Parameters:\n");
-		fprintf(stderr,"dbg2       verbose:             %d\n",verbose);
-		fprintf(stderr,"dbg2       help:                %d\n",help);
-		fprintf(stderr,"dbg2       format:              %d\n",format);
-		fprintf(stderr,"dbg2       pings:               %d\n",pings);
-		fprintf(stderr,"dbg2       lonflip:             %d\n",lonflip);
-		fprintf(stderr,"dbg2       bounds[0]:           %f\n",bounds[0]);
-		fprintf(stderr,"dbg2       bounds[1]:           %f\n",bounds[1]);
-		fprintf(stderr,"dbg2       bounds[2]:           %f\n",bounds[2]);
-		fprintf(stderr,"dbg2       bounds[3]:           %f\n",bounds[3]);
-		fprintf(stderr,"dbg2       btime_i[0]:          %d\n",btime_i[0]);
-		fprintf(stderr,"dbg2       btime_i[1]:          %d\n",btime_i[1]);
-		fprintf(stderr,"dbg2       btime_i[2]:          %d\n",btime_i[2]);
-		fprintf(stderr,"dbg2       btime_i[3]:          %d\n",btime_i[3]);
-		fprintf(stderr,"dbg2       btime_i[4]:          %d\n",btime_i[4]);
-		fprintf(stderr,"dbg2       btime_i[5]:          %d\n",btime_i[5]);
-		fprintf(stderr,"dbg2       btime_i[6]:          %d\n",btime_i[6]);
-		fprintf(stderr,"dbg2       etime_i[0]:          %d\n",etime_i[0]);
-		fprintf(stderr,"dbg2       etime_i[1]:          %d\n",etime_i[1]);
-		fprintf(stderr,"dbg2       etime_i[2]:          %d\n",etime_i[2]);
-		fprintf(stderr,"dbg2       etime_i[3]:          %d\n",etime_i[3]);
-		fprintf(stderr,"dbg2       etime_i[4]:          %d\n",etime_i[4]);
-		fprintf(stderr,"dbg2       etime_i[5]:          %d\n",etime_i[5]);
-		fprintf(stderr,"dbg2       etime_i[6]:          %d\n",etime_i[6]);
-		fprintf(stderr,"dbg2       speedmin:            %f\n",speedmin);
-		fprintf(stderr,"dbg2       timegap:             %f\n",timegap);
-		fprintf(stderr,"dbg2       bottompickmode:      %d\n",bottompickmode);
-		fprintf(stderr,"dbg2       bottompickthreshold: %f\n",bottompickthreshold);
-		fprintf(stderr,"dbg2       smooth:              %d\n",smooth);
-		fprintf(stderr,"dbg2       swath_width_set:     %d\n",swath_width_set);
-		fprintf(stderr,"dbg2       swath_width:         %f\n",swath_width);
-		fprintf(stderr,"dbg2       interpbins:          %d\n",interpbins);
-		fprintf(stderr,"dbg2       gainmode:            %d\n",gainmode);
-		fprintf(stderr,"dbg2       gainfactor:          %f\n",gainfactor);
-		fprintf(stderr,"dbg2       sslayoutmode:        %d\n",sslayoutmode);
-		fprintf(stderr,"dbg2       topogridfile:        %s\n",topogridfile);
-		fprintf(stderr,"dbg2       timelist_file_set:   %d\n",timelist_file_set);
-		fprintf(stderr,"dbg2       timelist_file:       %s\n",timelist_file);
-		fprintf(stderr,"dbg2       route_file_set:      %d\n",route_file_set);
-		fprintf(stderr,"dbg2       route_file:          %s\n",route_file);
-		fprintf(stderr,"dbg2       checkroutebearing:   %d\n",checkroutebearing);
-		fprintf(stderr,"dbg2       output_file:         %s\n",output_file);
-		fprintf(stderr,"dbg2       output_file_set:     %d\n",output_file_set);
-		fprintf(stderr,"dbg2       lineroot:            %s\n",lineroot);
-		fprintf(stderr,"dbg2       extract_type:        %d\n",extract_type);
-		fprintf(stderr,"dbg2       print_comments:      %d\n",print_comments);
-		}
-
-	/* if help desired then print it and exit */
-	if (help)
-		{
-		fprintf(stderr,"\n%s\n",help_message);
-		fprintf(stderr,"\nusage: %s\n", usage_message);
-		exit(status);
-		}
-
-	/* print starting debug statements */
-	if (verbose == 1)
-		{
-		fprintf(stderr,"\nProgram <%s>\n",program_name);
-		fprintf(stderr,"Version %s\n",rcs_id);
-		fprintf(stderr,"MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"Control Parameters:\n");
-		if (bottompickmode == MB7K2SS_BOTTOMPICK_BATHYMETRY)
-			fprintf(stderr,"     bottompickmode:      Bathymetry\n");
-		else if (bottompickmode == MB7K2SS_BOTTOMPICK_ALTITUDE)
-			fprintf(stderr,"     bottompickmode:      Altitude\n");
-		else if (bottompickmode == MB7K2SS_BOTTOMPICK_ARRIVAL)
-			{
-			fprintf(stderr,"     bottompickmode:      Sidescan first arrival\n");
-			fprintf(stderr,"     bottompickthreshold: %f\n",bottompickthreshold);
-			}
-		else if (bottompickmode == MB7K2SS_BOTTOMPICK_3DBATHY)
-			{
-			fprintf(stderr,"     bottompickmode:      3D Bathymetry\n");
-			fprintf(stderr,"     topogridfile:        %s\n",topogridfile);
-			}
-		fprintf(stderr,"     bottompickthreshold: %f\n",bottompickthreshold);
-		fprintf(stderr,"     smooth:              %d\n",smooth);
-		if (swath_width_set == MB_YES)
-			fprintf(stderr,"     swath_width:         %f\n",swath_width);
-		else
-			fprintf(stderr,"     swath_width:         Maximum available\n");
-		if (gainmode == MB7K2SS_SSGAIN_OFF)
-			fprintf(stderr,"     gainmode:            Off\n");
-		else
-			{
-			fprintf(stderr,"     gainmode:            TVG applied as gainfactor/R\n");
-			fprintf(stderr,"     gainfactor:          %f\n",gainfactor);
-			}
-		if (sslayoutmode == MB7K2SS_SS_FLAT_BOTTOM)
-			fprintf(stderr,"     sslayoutmode:        Flat bottom\n");
-		else if (sslayoutmode == MB7K2SS_SS_3D_BOTTOM)
-			{
-			fprintf(stderr,"     sslayoutmode:        3D bottom\n");
-			fprintf(stderr,"     topogridfile:        %s\n",topogridfile);
-			}
-		fprintf(stderr,"     interpolation bins:  %d\n",interpbins);
-		if (timelist_file_set == MB_YES)
-			fprintf(stderr,"     timelist_file:       %s\n",timelist_file);
-		if (route_file_set == MB_YES)
-			fprintf(stderr,"     route_file:          %s\n",route_file);
-		fprintf(stderr,"     checkroutebearing:   %d\n",checkroutebearing);
-		if (output_file_set == MB_YES)
-			fprintf(stderr,"     output_file:         %s\n",output_file);
-		fprintf(stderr,"     lineroot:            %s\n",lineroot);
-		fprintf(stderr,"     extract_type:        %d\n",extract_type);
-		fprintf(stderr,"     print_comments:      %d\n",print_comments);
-		}
-
-	/* output output types */
-	fprintf(stdout, "\nData records to extract:\n");
-	if (extract_type == MB7K2SS_SSLOW)
-		fprintf(stdout, "     Low Sidescan\n");
-	else if (extract_type == MB7K2SS_SSHIGH)
-		fprintf(stdout, "     High Sidescan\n");
-	if (ssflip == MB_YES)
-		fprintf(stdout, "     Sidescan port and starboard exchanged\n");
-
-	/* set starting line number and output file if route read */
-	if (route_file_set == MB_YES || timelist_file_set == MB_YES)
-		{
-		linenumber = startline;
-		if (extract_type == MB7K2SS_SSLOW)
-			sprintf(output_file, "%s_%4.4d_sslo.mb71", lineroot, linenumber);
-		else if (extract_type == MB7K2SS_SSHIGH)
-			sprintf(output_file, "%s_%4.4d_sshi.mb71", lineroot, linenumber);
-		}
-
-	/* new output file obviously needed */
-	new_output_file = MB_YES;
-
-	/* if specified read route time list file */
-	if (timelist_file_set == MB_YES)
-		{
-		/* open the input file */
-		if ((fp = fopen(timelist_file, "r")) == NULL)
-			{
-			error = MB_ERROR_OPEN_FAIL;
-			status = MB_FAILURE;
-			fprintf(stderr,"\nUnable to open time list file <%s> for reading\n",timelist_file);
-			exit(status);
-			}
-		rawroutefile = MB_NO;
-		while ((result = fgets(comment,MB_PATH_MAXLINE,fp)) == comment)
-		    	{
-			if (comment[0] != '#')
-				{
-				nget = sscanf(comment,"%d %d %lf %lf %lf %lf",
-				    &i, &waypoint, &lon, &lat, &heading, &time_d);
-
-				/* if good data check for need to allocate more space */
-				if (ntimepoint + 1 > ntimepointalloc)
-				    	{
-				    	ntimepointalloc += MB7K2SS_ALLOC_NUM;
-					status = mb_reallocd(verbose, __FILE__, __LINE__, ntimepointalloc * sizeof(double),
-								(void **)&routelon, &error);
-					status = mb_reallocd(verbose, __FILE__, __LINE__, ntimepointalloc * sizeof(double),
-								(void **)&routelat, &error);
-					status = mb_reallocd(verbose, __FILE__, __LINE__, ntimepointalloc * sizeof(double),
-								(void **)&routeheading, &error);
-					status = mb_reallocd(verbose, __FILE__, __LINE__, ntimepointalloc * sizeof(int),
-								(void **)&routewaypoint, &error);
-					status = mb_reallocd(verbose, __FILE__, __LINE__, ntimepointalloc * sizeof(double),
-								(void **)&routetime_d, &error);
-				    	if (status != MB_SUCCESS)
-					    	{
-						mb_error(verbose,error,&message);
-						fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",
-							message);
-						fprintf(stderr,"\nProgram <%s> Terminated\n",
-							program_name);
-						exit(error);
-					    	}
-				    	}
-
-				/* add good point to route */
-				if (ntimepointalloc > ntimepoint)
-					{
-					routewaypoint[ntimepoint] = waypoint;
-					routelon[ntimepoint] = lon;
-					routelat[ntimepoint] = lat;
-					routeheading[ntimepoint] = heading;
-					routetime_d[ntimepoint] = time_d;
-					ntimepoint++;
-					}
-				}
-			}
-
-		/* close the file */
-		fclose(fp);
-		fp = NULL;
-
-		activewaypoint = 1;
-		mb_coor_scale(verbose,routelat[activewaypoint], &mtodeglon, &mtodeglat);
-		rangelast = 1000 * rangethreshold;
-		oktowrite = 0;
-		linechange = MB_NO;
-
-		/* output status */
-		if (verbose > 0)
-			{
-			/* output info on file output */
-			fprintf(stderr,"Read %d waypoints from time list file: %s\n",
-				ntimepoint, timelist_file);
-			}
-		}
-
-	/* if specified read route file */
-	else if (route_file_set == MB_YES)
-		{
-		/* open the input file */
-		if ((fp = fopen(route_file, "r")) == NULL)
-			{
-			error = MB_ERROR_OPEN_FAIL;
-			status = MB_FAILURE;
-			fprintf(stderr,"\nUnable to open route file <%s> for reading\n",route_file);
-			exit(status);
-			}
-		rawroutefile = MB_NO;
-		while ((result = fgets(comment,MB_PATH_MAXLINE,fp)) == comment)
-		    	{
-			if (comment[0] == '#')
-				{
-				if (strncmp(comment,"## Route File Version", 21) == 0)
-					{
-					rawroutefile = MB_NO;
-					}
-				}
-			else
-				{
-				nget = sscanf(comment,"%lf %lf %lf %d %lf",
-				    &lon, &lat, &topo, &waypoint, &heading);
-				if (comment[0] == '#')
-					{
-					fprintf(stderr,"buffer:%s",comment);
-					if (strncmp(comment,"## Route File Version", 21) == 0)
-						{
-						rawroutefile = MB_NO;
-						}
-					}
-		    		if ((rawroutefile == MB_YES && nget >= 2)
-					|| (rawroutefile == MB_NO && nget >= 3 && waypoint > MB7K2SS_ROUTE_WAYPOINT_NONE))
-					point_ok = MB_YES;
-				else
-					point_ok = MB_NO;
-
-				/* if good data check for need to allocate more space */
-				if (point_ok == MB_YES
-					&& nroutepoint + 1 > nroutepointalloc)
-				    	{
-				    	nroutepointalloc += MB7K2SS_ALLOC_NUM;
-					status = mb_reallocd(verbose, __FILE__, __LINE__, nroutepointalloc * sizeof(double),
-								(void **)&routelon, &error);
-					status = mb_reallocd(verbose, __FILE__, __LINE__, nroutepointalloc * sizeof(double),
-								(void **)&routelat, &error);
-					status = mb_reallocd(verbose, __FILE__, __LINE__, nroutepointalloc * sizeof(double),
-								(void **)&routeheading, &error);
-					status = mb_reallocd(verbose, __FILE__, __LINE__, nroutepointalloc * sizeof(int),
-								(void **)&routewaypoint, &error);
-				    	if (status != MB_SUCCESS)
-					    	{
-						mb_error(verbose,error,&message);
-						fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",
-							message);
-						fprintf(stderr,"\nProgram <%s> Terminated\n",
-							program_name);
-						exit(error);
-					    	}
-				    	}
-
-				/* add good point to route */
-				if (point_ok == MB_YES && nroutepointalloc > nroutepoint + 1)
-					{
-					routelon[nroutepoint] = lon;
-					routelat[nroutepoint] = lat;
-					routeheading[nroutepoint] = heading;
-					routewaypoint[nroutepoint] = waypoint;
-					nroutepoint++;
-					}
-				}
-			}
-
-		/* close the file */
-		fclose(fp);
-		fp = NULL;
-
-		/* set starting values */
-		activewaypoint = 1;
-		mb_coor_scale(verbose,routelat[activewaypoint], &mtodeglon, &mtodeglat);
-		rangelast = 1000 * rangethreshold;
-		oktowrite = 0;
-		linechange = MB_NO;
-
-		/* output status */
-		if (verbose > 0)
-			{
-			/* output info on file output */
-			fprintf(stderr,"\nImported %d waypoints from route file: %s\n",
-				nroutepoint, route_file);
-			}
-		}
-
-	/* read topography grid if 3D bottom correction specified */
-	if (sslayoutmode == MB7K2SS_SS_3D_BOTTOM)
-		{
-		status = mb_topogrid_init(verbose, topogridfile, &lonflip, &topogrid_ptr, &error);
-		}
-	if (error != MB_ERROR_NO_ERROR)
-		{
-		mb_error(verbose,error,&message);
-		fprintf(stderr,"\nMBIO Error loading topography grid: %s\n%s\n",topogridfile,message);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",program_name);
-		mb_memory_clear(verbose, &error);
-		exit(error);
-		}
-
-	/* set up plotting script file */
-	if ((route_file_set == MB_YES && nroutepoint > 1) ||
-		(timelist_file_set == MB_YES && ntimepoint > 1))
-		{
-		sprintf(scriptfile, "%s_ssswathplot.cmd", lineroot);
-		}
-	else if (output_file_set == MB_NO || read_datalist == MB_YES)
-		{
-		sprintf(scriptfile, "%s_ssswathplot.cmd", read_file);
-		}
-	else
-		{
-		sprintf(scriptfile, "%s_ssswathplot.cmd", file);
-		}
-	if ((sfp = fopen(scriptfile, "w")) == NULL)
-		{
-		error = MB_ERROR_OPEN_FAIL;
-		status = MB_FAILURE;
-		fprintf(stderr,"\nUnable to open plotting script file <%s> \n",scriptfile);
-		exit(status);
-		}
-
-	/* get format if required */
-	if (format == 0)
-		mb_get_format(verbose,read_file,NULL,&format,&error);
-
-	/* determine whether to read one file or a list of files */
-	if (format < 0)
-		read_datalist = MB_YES;
-
-	/* open file list */
-	if (read_datalist == MB_YES)
-	    {
-	    if ((status = mb_datalist_open(verbose,&datalist,
-					    read_file,look_processed,&error)) != MB_SUCCESS)
-		{
-		error = MB_ERROR_OPEN_FAIL;
-		fprintf(stderr,"\nUnable to open data list file: %s\n",
-			read_file);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-	    if ((status = mb_datalist_read(verbose,datalist,
-			    file,&format,&file_weight,&error))
-			    == MB_SUCCESS)
-		read_data = MB_YES;
-	    else
-		read_data = MB_NO;
-	    }
-	/* else copy single filename to be read */
-	else
-	    {
-	    strcpy(file, read_file);
-	    read_data = MB_YES;
-	    }
-
-	/* first read and store all navigation, attitude, heading, sonar depth, and altitude
-	   data from the survey (multibeam) records - loop over all files to be read
-	   - use fbt files if available */
-	while (read_data == MB_YES && format == MBF_RESON7KR)
-		{
-		/* use fbt file if available as source for processed navigation and attitude */
-		mb_get_fbt(verbose, file, &format, &error);
-
-		/* initialize reading the swath file */
-		if ((status = mb_read_init(
-			verbose,file,format,pings,lonflip,bounds,
-			btime_i,etime_i,speedmin,timegap,
-			&imbio_ptr,&btime_d,&etime_d,
-			&beams_bath,&beams_amp,&pixels_ss,&error)) != MB_SUCCESS)
-			{
-			mb_error(verbose,error,&message);
-			fprintf(stderr,"\nMBIO Error returned from function <mb_read_init>:\n%s\n",message);
-			fprintf(stderr,"\nMultibeam File <%s> not initialized for reading\n",file);
-			fprintf(stderr,"\nProgram <%s> Terminated\n",
-				program_name);
-			exit(error);
-			}
-
-		/* get pointers to data storage */
-		imb_io_ptr = (struct mb_io_struct *) imbio_ptr;
-		istore_ptr = imb_io_ptr->store_data;
-		istore = (struct mbsys_reson7k_struct *) istore_ptr;
-		nreaddata = 0;
-
-		if (error == MB_ERROR_NO_ERROR)
-			{
-			beamflag = NULL;
-			bath = NULL;
-			amp = NULL;
-			bathacrosstrack = NULL;
-			bathalongtrack = NULL;
-			ss = NULL;
-			ssacrosstrack = NULL;
-			ssalongtrack = NULL;
-			}
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							sizeof(char), (void **)&beamflag, &error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							sizeof(double), (void **)&bath, &error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_AMPLITUDE,
-							sizeof(double), (void **)&amp, &error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							sizeof(double), (void **)&bathacrosstrack, &error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							sizeof(double), (void **)&bathalongtrack, &error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_SIDESCAN,
-							sizeof(double), (void **)&ss, &error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_SIDESCAN,
-							sizeof(double), (void **)&ssacrosstrack, &error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_SIDESCAN,
-							sizeof(double), (void **)&ssalongtrack, &error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							sizeof(double), (void **)&ttimes, &error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							sizeof(double), (void **)&angles, &error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							sizeof(double), (void **)&angles_forward, &error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							sizeof(double), (void **)&angles_null, &error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							sizeof(double), (void **)&bheave, &error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							sizeof(double), (void **)&alongtrack_offset, &error);
-
-		/* if error initializing memory then quit */
-		if (error != MB_ERROR_NO_ERROR)
-			{
-			mb_error(verbose,error,&message);
-			fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",
-				message);
-			fprintf(stderr,"\nProgram <%s> Terminated\n",
-				program_name);
-			exit(error);
-			}
-
-		/* loop over reading data from current file */
-		while (error <= MB_ERROR_NO_ERROR)
-			{
-			/* reset error */
-			error = MB_ERROR_NO_ERROR;
-
-			/* read next data record */
-			status = mb_get_all(verbose,imbio_ptr,&istore_ptr,&kind,
-					    time_i,&time_d,&navlon,&navlat,
-					    &speed,&heading,
-					    &distance,&altitude,&sonardepth,
-					    &beams_bath,&beams_amp,&pixels_ss,
-					    beamflag,bath,amp,bathacrosstrack,bathalongtrack,
-					    ss,ssacrosstrack,ssalongtrack,
-					    comment,&error);
-
-			/* reset nonfatal errors */
-			if (kind == MB_DATA_DATA && error < 0)
-				{
-				status = MB_SUCCESS;
-				error = MB_ERROR_NO_ERROR;
-				}
-
-			/* get desired information */
-			if (status == MB_SUCCESS && kind == MB_DATA_DATA)
-				{
-				status = mb_extract_nav(verbose,imbio_ptr,istore_ptr,&kind,
-							time_i,&time_d,&navlon,&navlat,
-							&speed,&heading,&draft,
-							&roll,&pitch,&heave,&error);
-
-				/* allocate memory for altitude arrays if needed */
-				if (ndat + 1 >= ndat_alloc)
-					{
-					ndat_alloc +=  MB7K2SS_ALLOC_CHUNK;
-					status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_alloc*sizeof(double),(void **)&dat_time_d,&error);
-					status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_alloc*sizeof(double),(void **)&dat_lon,&error);
-					status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_alloc*sizeof(double),(void **)&dat_lat,&error);
-					status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_alloc*sizeof(double),(void **)&dat_speed,&error);
-					status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_alloc*sizeof(double),(void **)&dat_sonardepth,&error);
-					status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_alloc*sizeof(double),(void **)&dat_heading,&error);
-					status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_alloc*sizeof(double),(void **)&dat_draft,&error);
-					status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_alloc*sizeof(double),(void **)&dat_roll,&error);
-					status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_alloc*sizeof(double),(void **)&dat_pitch,&error);
-					status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_alloc*sizeof(double),(void **)&dat_heave,&error);
-					status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_alloc*sizeof(double),(void **)&dat_altitude,&error);
-					if (error != MB_ERROR_NO_ERROR)
-						{
-						mb_error(verbose,error,&message);
-						fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",message);
-						fprintf(stderr,"\nProgram <%s> Terminated\n",
-						    program_name);
-						exit(error);
-						}
-					}
-
-				/* store the altitude data */
-				if (ndat == 0 || dat_time_d[ndat-1] < time_d)
-					{
-					dat_time_d[ndat] = time_d;
-					dat_lon[ndat] = navlon;
-					dat_lat[ndat] = navlat;
-					dat_speed[ndat] = speed;
-					dat_sonardepth[ndat] = sonardepth;
-					dat_heading[ndat] = heading;
-					dat_draft[ndat] = draft;
-					dat_roll[ndat] = roll;
-					dat_pitch[ndat] = pitch;
-					dat_heave[ndat] = heave;
-					dat_altitude[ndat] = altitude;
-					ndat++;
-					nreaddata++;
-					}
-				}
-			}
-
-		/* close the swath file */
-		status = mb_close(verbose,&imbio_ptr,&error);
-
-		/* output counts */
-		fprintf(stdout, "Read %6d nav and attitude data from: %s\n", nreaddata, file);
-		nreaddatatot += nreaddata;
-
-		/* figure out whether and what to read next */
-		if (read_datalist == MB_YES)
-			{
-			if ((status = mb_datalist_read(verbose,datalist,
-				    file,&format,&file_weight,&error))
-				    == MB_SUCCESS)
-				read_data = MB_YES;
-			else
-				read_data = MB_NO;
-			}
-		else
-			{
-			read_data = MB_NO;
-			}
-
-		/* end loop over files in list */
-		}
-		if (read_datalist == MB_YES)
-			mb_datalist_close(verbose,&datalist,&error);
-
-	/* output counts */
-	fprintf(stdout, "\nRead %6d nav and attitude data from: %s\n", nreaddatatot, read_file);
-	nreaddatatot = 0;
-	nreaddata = 0;
-
-	/* open file list */
-	if (read_datalist == MB_YES)
-	    {
-	    if ((status = mb_datalist_open(verbose,&datalist,
-					    read_file,look_processed,&error)) != MB_SUCCESS)
-		{
-		error = MB_ERROR_OPEN_FAIL;
-		fprintf(stderr,"\nUnable to open data list file: %s\n",
-			read_file);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-	    if ((status = mb_datalist_read(verbose,datalist,
-			    file,&format,&file_weight,&error))
-			    == MB_SUCCESS)
-		read_data = MB_YES;
-	    else
-		read_data = MB_NO;
-	    }
-	/* else copy single filename to be read */
-	else
-	    {
-	    strcpy(file, read_file);
-	    read_data = MB_YES;
-	    }
-
-	/* loop over all files to be read */
-	while (read_data == MB_YES && format == MBF_RESON7KR)
-	{
-
-	/* initialize reading the swath file */
-	if ((status = mb_read_init(
-		verbose,file,format,pings,lonflip,bounds,
-		btime_i,etime_i,speedmin,timegap,
-		&imbio_ptr,&btime_d,&etime_d,
-		&beams_bath,&beams_amp,&pixels_ss,&error)) != MB_SUCCESS)
-		{
-		mb_error(verbose,error,&message);
-		fprintf(stderr,"\nMBIO Error returned from function <mb_read_init>:\n%s\n",message);
-		fprintf(stderr,"\nMultibeam File <%s> not initialized for reading\n",file);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-
-	/* get pointers to data storage */
-	imb_io_ptr = (struct mb_io_struct *) imbio_ptr;
-	istore_ptr = imb_io_ptr->store_data;
-	istore = (struct mbsys_reson7k_struct *) istore_ptr;
-	itime = 0;
-
-	if (error == MB_ERROR_NO_ERROR)
-		{
-		beamflag = NULL;
-		bath = NULL;
-		amp = NULL;
-		bathacrosstrack = NULL;
-		bathalongtrack = NULL;
-		ss = NULL;
-		ssacrosstrack = NULL;
-		ssalongtrack = NULL;
-		}
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(char), (void **)&beamflag, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(double), (void **)&bath, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_AMPLITUDE,
-						sizeof(double), (void **)&amp, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(double), (void **)&bathacrosstrack, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(double), (void **)&bathalongtrack, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_SIDESCAN,
-						sizeof(double), (void **)&ss, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_SIDESCAN,
-						sizeof(double), (void **)&ssacrosstrack, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_SIDESCAN,
-						sizeof(double), (void **)&ssalongtrack, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(double), (void **)&ttimes, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(double), (void **)&angles, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(double), (void **)&angles_forward, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(double), (void **)&angles_null, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(double), (void **)&bheave, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(double), (void **)&alongtrack_offset, &error);
-
-	/* if error initializing memory then quit */
-	if (error != MB_ERROR_NO_ERROR)
-		{
-		mb_error(verbose,error,&message);
-		fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",
-			message);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-
-	/* set up output file name if needed */
-	if (error == MB_ERROR_NO_ERROR)
-		{
-		if (output_file_set == MB_YES && ombio_ptr == NULL)
-			{
-			/* set flag to open new output file */
-			new_output_file = MB_YES;
-			}
-
-		else if (output_file_set == MB_NO
-			 && route_file_set == MB_NO
-			 && timelist_file_set == MB_NO)
-			{
-			new_output_file = MB_YES;
-			format_status = mb_get_format(verbose, file, output_file,
-		    				&format_guess, &error);
-			if (format_status != MB_SUCCESS || format_guess != format)
-				{
-				strcpy(output_file, file);
-				}
-			if (output_file[strlen(output_file)-1] == 'p')
-				{
-				output_file[strlen(output_file)-1] = '\0';
-				}
-			if (extract_type == MB7K2SS_SSLOW)
-				{
-				strcat(output_file,"_sslo.mb71");
-				format_output = MBF_MBLDEOIH;
-				}
-			else if (extract_type == MB7K2SS_SSHIGH)
-				{
-				strcat(output_file,"_sshi.mb71");
-				format_output = MBF_MBLDEOIH;
-				}
-			}
-		}
-
-	/* read and print data */
-	nreaddata = 0;
-	nreadheader = 0;
-	nreadssv = 0;
-	nreadnav1 = 0;
-	nreadsbp = 0;
-	nreadsslo = 0;
-	nreadsshi = 0;
-	ttime_min_ok = MB_NO;
-
-	while (error <= MB_ERROR_NO_ERROR)
-		{
-		/* reset error */
-		error = MB_ERROR_NO_ERROR;
-
-		/* read next data record */
-		status = mb_get_all(verbose,imbio_ptr,&istore_ptr,&kind,
-				    time_i,&time_d,&navlon,&navlat,
-				    &speed,&heading,
-				    &distance,&altitude,&sonardepth,
-				    &beams_bath,&beams_amp,&pixels_ss,
-				    beamflag,bath,amp,bathacrosstrack,bathalongtrack,
-				    ss,ssacrosstrack,ssalongtrack,
-				    comment,&error);
-/*fprintf(stderr,"kind:%d %s \n\ttime_i:%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d  %f    time_i:%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d  %f\n",
-kind,notice_msg[kind],time_i[0],time_i[1],time_i[2],time_i[3],time_i[4],time_i[5],time_i[6],time_d,
-istore->time_i[0],istore->time_i[1],istore->time_i[2],istore->time_i[3],istore->time_i[4],istore->time_i[5],istore->time_i[6],istore->time_d);*/
-
-		/* reset nonfatal errors */
-		if (error < 0)
-			{
-			status = MB_SUCCESS;
-			error = MB_ERROR_NO_ERROR;
-			}
-
-		/* get nav and attitude */
-		if (status == MB_SUCCESS
-			&& (kind == MB_DATA_SUBBOTTOM_SUBBOTTOM
-				|| kind == MB_DATA_SIDESCAN2
-				|| kind == MB_DATA_SIDESCAN3))
-			{
-			intstat = mb_linear_interp(verbose,
-					dat_time_d-1, dat_lon-1,
-					ndat, time_d, &navlon, &itime,
-					&error);
-			intstat = mb_linear_interp(verbose,
-					dat_time_d-1, dat_lat-1,
-					ndat, time_d, &navlat, &itime,
-					&error);
-			intstat = mb_linear_interp(verbose,
-					dat_time_d-1, dat_speed-1,
-					ndat, time_d, &speed, &itime,
-					&error);
-			intstat = mb_linear_interp(verbose,
-					dat_time_d-1, dat_sonardepth-1,
-					ndat, time_d, &sonardepth, &itime,
-					&error);
-			intstat = mb_linear_interp(verbose,
-					dat_time_d-1, dat_heading-1,
-					ndat, time_d, &heading, &itime,
-					&error);
-			intstat = mb_linear_interp(verbose,
-					dat_time_d-1, dat_draft-1,
-					ndat, time_d, &draft, &itime,
-					&error);
-			intstat = mb_linear_interp(verbose,
-					dat_time_d-1, dat_roll-1,
-					ndat, time_d, &roll, &itime,
-					&error);
-			intstat = mb_linear_interp(verbose,
-					dat_time_d-1, dat_pitch-1,
-					ndat, time_d, &pitch, &itime,
-					&error);
-			intstat = mb_linear_interp(verbose,
-					dat_time_d-1, dat_heave-1,
-					ndat, time_d, &heave, &itime,
-					&error);
-			intstat = mb_linear_interp(verbose,
-					dat_time_d-1, dat_altitude-1,
-					ndat, time_d, &altitude, &itime,
-					&error);
-			}
-
-		/* save last nav and heading */
-		if (status == MB_SUCCESS && kind == target_kind)
-			{
-			if (navlon != 0.0)
-				lastlon = navlon;
-			if (navlat != 0.0)
-				lastlat = navlat;
-			if (heading != 0.0)
-				lastheading = heading;
-			}
-
-		/* check survey data position against time list or waypoints */
-		if (status == MB_SUCCESS && kind == target_kind
-			&& navlon != 0.0 && navlat != 0.0)
-			{
-			/* to set lines check survey data time against time list */
-			if (ntimepoint > 1)
-				{
-/* fprintf(stderr,"CHECK TIME: activewaypoint:%d routetime_d:%f time_d:%f dt:%f\n",
-activewaypoint,routetime_d[activewaypoint],time_d,time_d - routetime_d[activewaypoint]); */
-				dx = (navlon - routelon[activewaypoint]) / mtodeglon;
-				dy = (navlat - routelat[activewaypoint]) / mtodeglat;
-				range = sqrt(dx * dx + dy * dy);
-				if (time_d >= routetime_d[activewaypoint]
-					&& activewaypoint < ntimepoint)
-					{
-					linechange = MB_YES;
-/* fprintf(stderr,"LINECHANGE BY TIME!! dx:%f dy:%f range:%f activewaypoint:%d time_d: %f %f\n",
-dx,dy,range,activewaypoint,time_d,routetime_d[activewaypoint]); */
-					}
-				}
-
-			/* else to set lines check survey data position against waypoints */
-			else if (nroutepoint > 1
-				 && navlon != 0.0 && navlat != 0.0)
-				{
-				dx = (navlon - routelon[activewaypoint]) / mtodeglon;
-				dy = (navlat - routelat[activewaypoint]) / mtodeglat;
-				range = sqrt(dx * dx + dy * dy);
-/* fprintf(stderr,"CHECK WAYPOINT: activewaypoint:%d range:%f rangethreshold:%f\n",activewaypoint,range,rangethreshold); */
-				if (range < rangethreshold
-					&& (activewaypoint == 0 || range > rangelast)
-					&& activewaypoint < nroutepoint - 1)
-					{
-					linechange = MB_YES;
-/* fprintf(stderr,"LINECHANGE BY WAYPOINT!! dx:%f dy:%f range:%f activewaypoint:%d time_d: %f %f\n",
-dx,dy,range,activewaypoint,time_d,routetime_d[activewaypoint]); */
-					}
-				}
-
-/* fprintf(stderr,"status:%d error:%d | kind:%d %d | route_file_set:%d nroutepoint:%d navlon:%f navlat:%f\n",
-status,error,kind,target_kind,route_file_set,nroutepoint,navlon,navlat);
-fprintf(stderr,"activewaypoint:%d range:%f rangelast:%f lon:%f %f lat:%f %f\n",
-activewaypoint, range, rangelast, navlon, routelon[activewaypoint], navlat, routelat[activewaypoint]); */
-
-			/* check survey data position against waypoints */
-			if (linechange == MB_YES)
-				{
-				/* increment line number */
-				linenumber++;
-
-				/* set output file name */
-				if (extract_type == MB7K2SS_SSLOW)
-					sprintf(output_file, "%s_%4.4d_sslo.mb71", lineroot, linenumber);
-				else if (extract_type == MB7K2SS_SSHIGH)
-					sprintf(output_file, "%s_%4.4d_sshi.mb71", lineroot, linenumber);
-				format_output = MBF_MBLDEOIH;
-
-				/* set to open new output file */
-				new_output_file = MB_YES;
-
-				/* increment active waypoint */
-				activewaypoint++;
-				mb_coor_scale(verbose,routelat[activewaypoint], &mtodeglon, &mtodeglat);
-				rangelast = 1000 * rangethreshold;
-				oktowrite = 0;
-				linechange = MB_NO;
-				}
-			else
-				rangelast = range;
-/*fprintf(stderr,"> activewaypoint:%d linenumber:%d range:%f   lon: %f %f   lat: %f %f oktowrite:%d\n",
-activewaypoint,linenumber,range, navlon,
-routelon[activewaypoint], navlat, routelat[activewaypoint], oktowrite);*/
-			}
-
-		if (kind == MB_DATA_DATA
-			&& error <= MB_ERROR_NO_ERROR)
-			{
-			/* extract travel times */
-			status = mb_ttimes(verbose,imbio_ptr,
-				istore_ptr,&kind,&beams_bath,
-				ttimes,angles,
-				angles_forward,angles_null,
-				bheave,alongtrack_offset,
-				&draft,&ssv,&error);
-
-			/* check surface sound velocity */
-			if (ssv > 0.0)
-				ssv_use = ssv;
-
-			/* get bottom arrival time, if possible */
-			ttime_min = 0.0;
-			found = MB_NO;
-			for (i=0;i<beams_bath;i++)
-				{
-				if (mb_beam_ok(beamflag[i]))
-					{
-					if (found == MB_NO || ttimes[i] < ttime_min)
-						{
-						ttime_min = ttimes[i];
-						nadir_depth = bath[i];
-						beam_min = i;
-						found = MB_YES;
-						}
-					}
-				}
-			if (found == MB_YES)
-				{
-				ttime_min_use = ttime_min;
-				ttime_min_ok = MB_YES;
-				}
-			}
-
-		/* nonfatal errors do not matter */
-		if (error < MB_ERROR_NO_ERROR)
-			{
-			error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-
-		/* if needed open new output file */
-		if (status == MB_SUCCESS
-			&& new_output_file == MB_YES
-			&& (((extract_type == MB7K2SS_SSLOW && kind == MB_DATA_SIDESCAN2)
-				|| (extract_type == MB7K2SS_SSHIGH && kind == MB_DATA_SIDESCAN3))))
-			{
-
-			/* close any old output file unless a single file has been specified */
-			if (ombio_ptr != NULL)
-				{
-				/* close the swath file */
-				status = mb_close(verbose,&ombio_ptr,&error);
-
-				/* generate inf file */
-				if (status == MB_SUCCESS)
-					{
-					status = mb_make_info(verbose, MB_YES,
-								current_output_file,
-								format_output,
-								&error);
-					}
-
-				/* output counts */
-				fprintf(stdout, "\nData records written to: %s\n", current_output_file);
-				fprintf(stdout, "     Low Sidescan:  %d\n", nwritesslo);
-				fprintf(stdout, "     High Sidescan: %d\n", nwritesshi);
-				nwritesslotot += nwritesslo;
-				nwritesshitot += nwritesshi;
-
-				/* output commands to first cut plotting script file */
-				fprintf(sfp, "# Generate swath plot of sidescan file: %s\n", current_output_file);
-				fprintf(sfp, "mbm_plot -I %s -N -G5 -S -Pb -V -O %s_ssrawplot\n",
-					current_output_file, current_output_file);
-				fprintf(sfp, "%s_ssrawplot.cmd\n\n", current_output_file);
-				}
-
-			/* open the new file */
-			nwritesslo = 0;
-			nwritesshi = 0;
-			if ((status = mb_write_init(
-				verbose,output_file,MBF_MBLDEOIH,
-				&ombio_ptr,&obeams_bath,&obeams_amp,&opixels_ss,&error)) != MB_SUCCESS)
-				{
-				mb_error(verbose,error,&message);
-				fprintf(stderr,"\nMBIO Error returned from function <mb_write_init>:\n%s\n",message);
-				fprintf(stderr,"\nMultibeam File <%s> not initialized for writing\n",output_file);
-				fprintf(stderr,"\nProgram <%s> Terminated\n",
-					program_name);
-				exit(error);
-				}
-
-			/* save current_output_file */
-			strcpy(current_output_file, output_file);
-
-			/* get pointers to data storage */
-			omb_io_ptr = (struct mb_io_struct *) ombio_ptr;
-			ostore_ptr = omb_io_ptr->store_data;
-			ostore = (struct mbsys_ldeoih_struct *) ostore_ptr;
-
-			/* reset new_output_file */
-			new_output_file = MB_NO;
-			}
-
-		/* if following a route check that the vehicle has come on line
-		    	(within MB7K2SS_ONLINE_THRESHOLD degrees)
-		    	before writing any data */
-		if (checkroutebearing == MB_YES
-		    	&& nroutepoint > 1 && activewaypoint > 0)
-		    	{
-			headingdiff = fabs(routeheading[activewaypoint-1] - heading);
-			if (headingdiff > 180.0)
-				headingdiff = 360.0 - headingdiff;
-			if (headingdiff < MB7K2SS_ONLINE_THRESHOLD)
-				oktowrite++;
-			else
-				oktowrite = 0;
-/* fprintf(stderr,"heading: %f %f %f oktowrite:%d\n",
-routeheading[activewaypoint-1],heading,headingdiff,oktowrite);*/
-			}
-		else
-		    	oktowrite = MB7K2SS_ONLINE_COUNT;
-/* if (status == MB_SUCCESS)
-fprintf(stderr,"activewaypoint:%d linenumber:%d range:%f   lon: %f %f   lat: %f %f oktowrite:%d\n",
-activewaypoint,linenumber,range, navlon,
-routelon[activewaypoint], navlat, routelat[activewaypoint], oktowrite);*/
-
-	   	/* handle multibeam data */
-		if (status == MB_SUCCESS && kind == MB_DATA_DATA)
-			{
-/*fprintf(stderr,"MB_DATA_DATA: status:%d error:%d kind:%d\n",status,error,kind);*/
-			nreaddata++;
-			}
-
-	   	/* handle file header data */
-		else if (status == MB_SUCCESS && kind == MB_DATA_HEADER)
-			{
-/*fprintf(stderr,"MB_DATA_HEADER: status:%d error:%d kind:%d\n",status,error,kind);*/
-			nreadheader++;
-			}
-
-	   	/* handle bluefin ctd data */
-		else if (status == MB_SUCCESS && kind == MB_DATA_SSV)
-			{
-/*fprintf(stderr,"MB_DATA_SSV: status:%d error:%d kind:%d\n",status,error,kind);*/
-			nreadssv++;
-			}
-
-	   	/* handle bluefin nav data */
-		else if (status == MB_SUCCESS && kind == MB_DATA_NAV2)
-			{
-/*fprintf(stderr,"MB_DATA_NAV1: status:%d error:%d kind:%d\n",status,error,kind);*/
-			nreadnav1++;
-			}
-
-	   	/* handle subbottom data */
-		else if (status == MB_SUCCESS && kind == MB_DATA_SUBBOTTOM_SUBBOTTOM)
-			{
-/*fprintf(stderr,"MB_DATA_SUBBOTTOM_SUBBOTTOM: status:%d error:%d kind:%d\n",status,error,kind);*/
-			nreadsbp++;
-			}
-
-	   	/* handle low frequency sidescan data */
-		else if (status == MB_SUCCESS && kind == MB_DATA_SIDESCAN2)
-			{
-/*fprintf(stderr,"MB_DATA_SIDESCAN2: status:%d error:%d kind:%d\n",status,error,kind);*/
-			nreadsslo++;
-
-			/* output data if desired */
-			if (extract_type == MB7K2SS_SSLOW && nreadnav1 > 0 && oktowrite >= MB7K2SS_ONLINE_COUNT)
-				{
-				/* get channels */
-				if (ssflip == MB_YES)
-					{
-					sschannelport = (s7k_fsdwchannel *) &(istore->fsdwsslo.channel[1]);
-					ssheaderport = (s7k_fsdwssheader *) &(istore->fsdwsslo.ssheader[1]);
-					sschannelstbd = (s7k_fsdwchannel *) &(istore->fsdwsslo.channel[0]);
-					ssheaderstbd = (s7k_fsdwssheader *) &(istore->fsdwsslo.ssheader[0]);
-					}
-				else
-					{
-					sschannelport = (s7k_fsdwchannel *) &(istore->fsdwsslo.channel[0]);
-					ssheaderport = (s7k_fsdwssheader *) &(istore->fsdwsslo.ssheader[0]);
-					sschannelstbd = (s7k_fsdwchannel *) &(istore->fsdwsslo.channel[1]);
-					ssheaderstbd = (s7k_fsdwssheader *) &(istore->fsdwsslo.ssheader[1]);
-					}
-
-				/* set some values */
-				ostore->depth_scale = 0;
-				ostore->distance_scale = 0;
-				ostore->beam_xwidth = 0.9;
-				ostore->beam_lwidth = 0.9;
-				ostore->kind = MB_DATA_DATA;
-				ostore->ss_type = MB_SIDESCAN_LINEAR;	/* sets sidescan to be scaled linear */
-				opixels_ss = MB7K2SS_SSDIMENSION;
-
-				/* reset the sonar altitude using the specified mode */
-				if (bottompickmode == MB7K2SS_BOTTOMPICK_ARRIVAL)
-					{
-					/* get bottom arrival in port trace */
-					datashort = (unsigned short *) sschannelport->data;
-					channelmax = 0.0;
-					for (i=0;i<ssheaderport->samples;i++)
-						{
-						if (ssheaderport->dataFormat == EDGETECH_TRACEFORMAT_ANALYTIC)
-							value = sqrt((double) (datashort[2*i] * datashort[2*i]
-								+ datashort[2*i+1] * datashort[2*i+1]));
-						else
-							value = (double)(datashort[i]);
-						channelmax = MAX(value, channelmax);
-						}
-					portchannelpick = 0;
-					threshold = bottompickthreshold * channelmax;
-					for (i=0;i<ssheaderport->samples && portchannelpick == 0;i++)
-						{
-						if (ssheaderport->dataFormat == EDGETECH_TRACEFORMAT_ANALYTIC)
-							value = sqrt((double) (datashort[2*i] * datashort[2*i]
-								+ datashort[2*i+1] * datashort[2*i+1]));
-						else
-							value = (double)(datashort[i]);
-						if (value >= threshold)
-							portchannelpick = i;
-						}
-
-					/* get bottom arrival in starboard trace */
-					datashort = (unsigned short *) sschannelstbd->data;
-					channelmax = 0.0;
-					for (i=0;i<ssheaderstbd->samples;i++)
-						{
-						if (ssheaderstbd->dataFormat == EDGETECH_TRACEFORMAT_ANALYTIC)
-							value = sqrt((double) (datashort[2*i] * datashort[2*i]
-								+ datashort[2*i+1] * datashort[2*i+1]));
-						else
-							value = (double)(datashort[i]);
-						channelmax = MAX(value, channelmax);
-						}
-					stbdchannelpick = 0;
-					threshold = bottompickthreshold * channelmax;
-					for (i=0;i<ssheaderstbd->samples && stbdchannelpick == 0;i++)
-						{
-						if (ssheaderstbd->dataFormat == EDGETECH_TRACEFORMAT_ANALYTIC)
-							value = sqrt((double) (datashort[2*i] * datashort[2*i]
-								+ datashort[2*i+1] * datashort[2*i+1]));
-						else
-							value = (double)(datashort[i]);
-						if (value >= threshold)
-							stbdchannelpick = i;
-						}
-
-					/* set sonar altitude */
-					ttime = 0.0000000005 * ((portchannelpick + stbdchannelpick) * ssheaderport->sampleInterval);
-					ss_altitude = 0.5 * ssv_use * ttime;
-					}
-				else if (bottompickmode == MB7K2SS_BOTTOMPICK_BATHYMETRY)
-					{
-					if (ttime_min_ok == MB_YES)
-						{
-						ss_altitude = 0.5 * ssv_use * ttime_min_use;
-						}
-					}
-				
-				/* else if getting altitude from topography model set initial value zero */
-				else if (bottompickmode == MB7K2SS_BOTTOMPICK_3DBATHY)
-					{
-					mb_topogrid_topo(verbose, topogrid_ptr, navlon, navlat, &topo, &error);
-					ss_altitude = -sonardepth - topo;
-					}
-
-				/* else use the altitude we already have */
-				else
-					{
-					ss_altitude = altitude;
-					}
-
-				/* get flat bottom layout table */
-				if (sslayoutmode == MB7K2SS_SS_FLAT_BOTTOM)
-					mb7k2ss_get_flatbottom_table(verbose, nangle, angle_min, angle_max,
-									navlon, navlat, ss_altitude, 0.0,
-									table_angle, table_xtrack, table_ltrack, table_altitude,
-									table_range, &error);
-				/* else get 3D bottom layout table */
-				else
-					mb_topogrid_getangletable(verbose, topogrid_ptr, nangle, angle_min, angle_max,
-									navlon, navlat, heading,
-									ss_altitude, sonardepth, pitch,
-									table_angle, table_xtrack, table_ltrack,
-									table_altitude, table_range, &error);
-
-				/* get swath width and pixel size */
-				rr = 0.0000000005 * ssv_use *(ssheaderport->samples * ssheaderport->sampleInterval);
-				if (swath_width_set == MB_NO)
-					swath_width = 2.2 * sqrt(rr * rr - ss_altitude * ss_altitude);
-				pixel_width = swath_width / (opixels_ss - 1);
-
-				/* initialize the output sidescan */
-
-				for (j=0;j<opixels_ss;j++)
-					{
-					oss[j] = 0.0;
-					ossacrosstrack[j] = pixel_width * (double)(j - (opixels_ss / 2));
-					ossalongtrack[j] = 0.0;
-					ossbincount[j] = 0;
-					}
-
-				/* find minimum range */
-				rangemin = table_range[0];
-				kstart = 0;
-				for (kangle=1;kangle<nangle;kangle++)
-					{
-					if (table_range[kangle] < rangemin)
-						{
-						rangemin = table_range[kangle];
-						kstart = kangle;
-						}
-					}
-/*fprintf(stderr,"port minimum range:%f kstart:%d\n",rangemin,kstart);*/
-
-				/* bin port trace */
-				datashort = (unsigned short *) sschannelport->data;
-				istart = ss_altitude / (0.0000000005 * ssv_use * ssheaderport->sampleInterval);
-				istart = rangemin / (0.0000000005 * ssv_use * ssheaderport->sampleInterval);
-				weight = exp(MB_LN_2 * ((double)ssheaderport->weightingFactor));
-				for (i=istart;i<ssheaderport->samples;i++)
-					{
-					/* get sample value */
-					if (ssheaderport->dataFormat == EDGETECH_TRACEFORMAT_ANALYTIC)
-						value = sqrt((double) (datashort[2*i] * datashort[2*i]
-							+ datashort[2*i+1] * datashort[2*i+1]));
-					else
-						value = (double)(datashort[i]);
-
-					/* get sample range */
-					rr = 0.0000000005 * ssv_use *(i * ssheaderport->sampleInterval);
-
-					/* look up position(s) for this range */
-					done = MB_NO;
-					for (kangle=kstart;kangle>0 && done == MB_NO;kangle--)
-						{
-						found = MB_NO;
-						if (rr <= table_range[kstart])
-							{
-							xtrack = table_xtrack[kstart];
-							ltrack = table_ltrack[kstart];
-							done = MB_YES;
-							found = MB_YES;
-							}
-						else if (rr > table_range[kangle] && rr <= table_range[kangle-1])
-							{
-							factor = (rr - table_range[kangle])
-								/ (table_range[kangle-1] - table_range[kangle]);
-							xtrack = table_xtrack[kangle]
-								+ factor * (table_xtrack[kangle-1] - table_xtrack[kangle]);
-							ltrack = table_ltrack[kangle]
-								+ factor * (table_ltrack[kangle-1] - table_ltrack[kangle]);
-							found = MB_YES;
-							done = MB_YES;
-							}
-						else if (rr < table_range[kangle] && rr >= table_range[kangle-1])
-							{
-							factor = (rr - table_range[kangle])
-								/ (table_range[kangle-1] - table_range[kangle]);
-							xtrack = table_xtrack[kangle]
-								+ factor * (table_xtrack[kangle-1] - table_xtrack[kangle]);
-							ltrack = table_ltrack[kangle]
-								+ factor * (table_ltrack[kangle-1] - table_ltrack[kangle]);
-							found = MB_YES;
-							done = MB_YES;
-							}
-
-						/* bin the value and position */
-						if (found == MB_YES)
-							{
-							j = opixels_ss / 2 + (int)(xtrack / pixel_width);
-							if (j >= 0 && j < opixels_ss)
-								{
-								oss[j] += value / weight;
-								ossbincount[j]++;
-								ossalongtrack[j] += ltrack;
-								}
-/* fprintf(stderr,"port:%5d rr:%10.2f x:%10.2f l:%10.2f kangle:%d\n",
-i,rr,xtrack,ltrack,kangle); */
-							}
-						}
-					}
-
-				/* find minimum range */
-				rangemin = table_range[0];
-				kstart = 0;
-				for (kangle=1;kangle<nangle;kangle++)
-					{
-					if (table_range[kangle] < rangemin)
-						{
-						rangemin = table_range[kangle];
-						kstart = kangle;
-						}
-					}
-/*fprintf(stderr,"stbd minimum range:%f kstart:%d\n",rr,kstart);*/
-/*fprintf(stderr,"kstart:%d angle:%f range:%f xtrack:%f ltrack:%f\n",
-kstart,
-angle_min + kstart * (angle_max - angle_min) / (nangle - 1),
-table_range[kstart],table_xtrack[kstart],table_ltrack[kstart]);*/
-
-				/* bin stbd trace */
-				datashort = (unsigned short *) sschannelstbd->data;
-				istart = ss_altitude / (0.0000000005 * ssv_use * ssheaderstbd->sampleInterval);
-				istart = rangemin / (0.0000000005 * ssv_use * ssheaderstbd->sampleInterval);
-				weight = exp(MB_LN_2 * ((double)ssheaderstbd->weightingFactor));
-				for (i=istart;i<ssheaderstbd->samples;i++)
-					{
-					/* get sample value */
-					if (ssheaderstbd->dataFormat == EDGETECH_TRACEFORMAT_ANALYTIC)
-						value = sqrt((double) (datashort[2*i] * datashort[2*i]
-							+ datashort[2*i+1] * datashort[2*i+1]));
-					else
-						value = (double)(datashort[i]);
-
-					/* get sample range */
-					rr = 0.0000000005 * ssv_use *(i * ssheaderstbd->sampleInterval);
-
-					/* look up position for this range */
-					done = MB_NO;
-					for (kangle=kstart;kangle<nangle-1 && done == MB_NO;kangle++)
-						{
-						found = MB_NO;
-						if (rr <= table_range[kstart])
-							{
-							xtrack = table_xtrack[kstart];
-							ltrack = table_ltrack[kstart];
-							done = MB_YES;
-							found = MB_YES;
-							}
-						else if (rr > table_range[kangle] && rr <= table_range[kangle+1])
-							{
-							factor = (rr - table_range[kangle])
-								/ (table_range[kangle+1] - table_range[kangle]);
-							xtrack = table_xtrack[kangle]
-								+ factor * (table_xtrack[kangle+1] - table_xtrack[kangle]);
-							ltrack = table_ltrack[kangle]
-								+ factor * (table_ltrack[kangle+1] - table_ltrack[kangle]);
-							found = MB_YES;
-							done = MB_YES;
-							}
-						else if (rr < table_range[kangle] && rr >= table_range[kangle+1])
-							{
-							factor = (rr - table_range[kangle])
-								/ (table_range[kangle+1] - table_range[kangle]);
-							xtrack = table_xtrack[kangle]
-								+ factor * (table_xtrack[kangle+1] - table_xtrack[kangle]);
-							ltrack = table_ltrack[kangle]
-								+ factor * (table_ltrack[kangle+1] - table_ltrack[kangle]);
-							found = MB_YES;
-							done = MB_YES;
-							}
-
-						/* bin the value and position */
-						if (found == MB_YES)
-							{
-							j = opixels_ss / 2 + (int)(xtrack / pixel_width);
-							if (j >= 0 && j < opixels_ss)
-								{
-								oss[j] += value / weight;
-								ossbincount[j]++;
-								ossalongtrack[j] += ltrack;
-								}
-/* fprintf(stderr,"stbd:%5d rr:%10.2f x:%10.2f l:%10.2f kangle:%d\n",
-i,rr,xtrack,ltrack,kangle); */
-							}
-						}
-					}
-
-				/* calculate the output sidescan */
-				jport = -1;
-				jstbd = -1;
-				for (j=0;j<opixels_ss;j++)
-					{
-					if (ossbincount[j] > 0)
-						{
-						oss[j] /= (double) ossbincount[j];
-						ossalongtrack[j] /= (double) ossbincount[j];
-						if (jport < 0)
-							jport = j;
-						jstbd = j;
-						}
-					else
-						oss[j] = MB_SIDESCAN_NULL;
-					}
-/* fprintf(stderr,"SS bounds: %d %d      %f %f   %f\n",jport,jstbd,(jport - opixels_ss/2)*pixel_width,(jstbd - opixels_ss/2)*pixel_width,
-(jport - opixels_ss/2)*pixel_width - (jstbd - opixels_ss/2)*pixel_width);*/
-/*for (j=0;j<opixels_ss;j++)
-{
-fprintf(stderr,"AAA j:%d x:%7.2f l:%7.2f s:%6.2f\n",j,ossacrosstrack[j],ossalongtrack[j],oss[j]);
-}*/
-
-				/* interpolate gaps in the output sidescan */
-				previous = opixels_ss;
-				for (j=0;j<opixels_ss;j++)
-					{
-					if (ossbincount[j] > 0)
-						{
-						interpable = j - previous - 1;
-						if (interpable > 0 && interpable <= interpbins)
-							{
-							dss = oss[j] - oss[previous];
-							dssl = ossalongtrack[j] - ossalongtrack[previous];
-							for (jj=previous+1;jj<j;jj++)
-								{
-								fraction = ((double)(jj - previous))
-										/ ((double)(j - previous));
-								oss[jj] = oss[previous] + fraction * dss;
-								ossalongtrack[jj] = ossalongtrack[previous] + fraction * dssl;
-								}
-							}
-						previous = j;
-						}
-					}
-/*for (j=0;j<opixels_ss;j++)
-{
-fprintf(stderr,"III j:%d x:%7.2f l:%7.2f s:%6.2f\n",j,ossacrosstrack[j],ossalongtrack[j],oss[j]);
-}*/
-
-				/* insert data */
-				mb_insert_nav(verbose, ombio_ptr, (void *)ostore,
-						time_i, time_d,
-						navlon, navlat, speed, heading, draft,
-						roll, pitch, heave,
-						&error);
-				status = mb_insert_altitude(verbose, ombio_ptr, (void *)ostore,
-						sonardepth, ss_altitude, &error);
-				status = mb_insert(verbose, ombio_ptr, (void *)ostore,
-						MB_DATA_DATA, time_i, time_d,
-						navlon, navlat, speed, heading,
-						beams_bath,beams_amp,opixels_ss,
-						beamflag,bath,amp,bathacrosstrack,
-						bathalongtrack,
-						oss,ossacrosstrack,ossalongtrack,
-						comment, &error);
-
-				/* write the record */
-				nwritesslo++;
-				mb_write_ping(verbose, ombio_ptr, (void *)ostore, &error);
-				}
-			}
-
-	   	/* handle high frequency sidescan data */
-		else if (status == MB_SUCCESS && kind == MB_DATA_SIDESCAN3)
-			{
-/*fprintf(stderr,"MB_DATA_SIDESCAN3: status:%d error:%d kind:%d\n",status,error,kind);*/
-			nreadsshi++;
-
-			/* output data if desired */
-			if (extract_type == MB7K2SS_SSHIGH && nreadnav1 > 0 && oktowrite >= MB7K2SS_ONLINE_COUNT)
-				{
-				/* get channels */
-				if (ssflip == MB_YES)
-					{
-					sschannelport = (s7k_fsdwchannel *) &(istore->fsdwsshi.channel[1]);
-					ssheaderport = (s7k_fsdwssheader *) &(istore->fsdwsshi.ssheader[1]);
-					sschannelstbd = (s7k_fsdwchannel *) &(istore->fsdwsshi.channel[0]);
-					ssheaderstbd = (s7k_fsdwssheader *) &(istore->fsdwsshi.ssheader[0]);
-					}
-				else
-					{
-					sschannelport = (s7k_fsdwchannel *) &(istore->fsdwsshi.channel[0]);
-					ssheaderport = (s7k_fsdwssheader *) &(istore->fsdwsshi.ssheader[0]);
-					sschannelstbd = (s7k_fsdwchannel *) &(istore->fsdwsshi.channel[1]);
-					ssheaderstbd = (s7k_fsdwssheader *) &(istore->fsdwsshi.ssheader[1]);
-					}
-
-				/* set some values */
-				ostore->depth_scale = 0;
-				ostore->distance_scale = 0;
-				ostore->beam_xwidth = 0.6;
-				ostore->beam_lwidth = 0.6;
-				ostore->kind = MB_DATA_DATA;
-				ostore->ss_type = MB_SIDESCAN_LINEAR;	/* sets sidescan to be scaled linear */
-				opixels_ss = MB7K2SS_SSDIMENSION;
-
-				/* reset the sonar altitude using the specified mode */
-				if (bottompickmode == MB7K2SS_BOTTOMPICK_ARRIVAL)
-					{
-					/* get bottom arrival in port trace */
-					datashort = (unsigned short *) sschannelport->data;
-					channelmax = 0.0;
-					for (i=0;i<ssheaderport->samples;i++)
-						{
-						if (ssheaderport->dataFormat == EDGETECH_TRACEFORMAT_ANALYTIC)
-							value = sqrt((double) (datashort[2*i] * datashort[2*i]
-								+ datashort[2*i+1] * datashort[2*i+1]));
-						else
-							value = (double)(datashort[i]);
-						channelmax = MAX(value, channelmax);
-						}
-					portchannelpick = 0;
-					threshold = bottompickthreshold * channelmax;
-					for (i=0;i<ssheaderport->samples && portchannelpick == 0;i++)
-						{
-						if (ssheaderport->dataFormat == EDGETECH_TRACEFORMAT_ANALYTIC)
-							value = sqrt((double) (datashort[2*i] * datashort[2*i]
-								+ datashort[2*i+1] * datashort[2*i+1]));
-						else
-							value = (double)(datashort[i]);
-						if (value >= threshold)
-							portchannelpick = i;
-						}
-
-					/* get bottom arrival in starboard trace */
-					datashort = (unsigned short *) sschannelstbd->data;
-					channelmax = 0.0;
-					for (i=0;i<ssheaderstbd->samples;i++)
-						{
-						if (ssheaderstbd->dataFormat == EDGETECH_TRACEFORMAT_ANALYTIC)
-							value = sqrt((double) (datashort[2*i] * datashort[2*i]
-								+ datashort[2*i+1] * datashort[2*i+1]));
-						else
-							value = (double)(datashort[i]);
-						channelmax = MAX(value, channelmax);
-						}
-					stbdchannelpick = 0;
-					threshold = bottompickthreshold * channelmax;
-					for (i=0;i<ssheaderstbd->samples && stbdchannelpick == 0;i++)
-						{
-						if (ssheaderstbd->dataFormat == EDGETECH_TRACEFORMAT_ANALYTIC)
-							value = sqrt((double) (datashort[2*i] * datashort[2*i]
-								+ datashort[2*i+1] * datashort[2*i+1]));
-						else
-							value = (double)(datashort[i]);
-						if (value >= threshold)
-							stbdchannelpick = i;
-						}
-
-					/* set sonar altitude */
-					ttime = 0.0000000005 * ((portchannelpick + stbdchannelpick) * ssheaderport->sampleInterval);
-					ss_altitude = 0.5 * ssv_use * ttime;
-					}
-				else if (bottompickmode == MB7K2SS_BOTTOMPICK_BATHYMETRY)
-					{
-					if (ttime_min_ok == MB_YES)
-						{
-						ss_altitude = 0.5 * ssv_use * ttime_min_use;
-						}
-					}
-				/* else use the altitude we already have */
-				else
-					{
-					ss_altitude = altitude;
-					}
-
-				/* get flat bottom layout table */
-				if (sslayoutmode == MB7K2SS_SS_FLAT_BOTTOM)
-					mb7k2ss_get_flatbottom_table(verbose, nangle, angle_min, angle_max,
-									navlon, navlat, ss_altitude, 0.0,
-									table_angle, table_xtrack, table_ltrack, table_altitude,
-									table_range, &error);
-				/* else get 3D bottom layout table */
-				else
-					mb_topogrid_getangletable(verbose, topogrid_ptr, nangle, angle_min, angle_max,
-									navlon, navlat, heading,
-									ss_altitude, sonardepth, pitch,
-									table_angle, table_xtrack, table_ltrack,
-									table_altitude, table_range, &error);
-
-				/* get swath width and pixel size */
-				rr = 0.0000000005 * ssv_use *(ssheaderport->samples * ssheaderport->sampleInterval);
-				if (swath_width_set == MB_NO)
-					swath_width = 2.2 * sqrt(rr * rr - ss_altitude * ss_altitude);
-				pixel_width = swath_width / (opixels_ss - 1);
-
-				/* initialize the output sidescan */
-				for (j=0;j<opixels_ss;j++)
-					{
-					oss[j] = 0.0;
-					ossacrosstrack[j] = pixel_width * (double)(j - (opixels_ss / 2));
-					ossalongtrack[j] = 0.0;
-					ossbincount[j] = 0;
-					}
-
-				/* find minimum range */
-				rangemin = table_range[0];
-				kstart = 0;
-				for (kangle=1;kangle<nangle;kangle++)
-					{
-					if (table_range[kangle] < rangemin)
-						{
-						rangemin = table_range[kangle];
-						kstart = kangle;
-						}
-					}
-
-				/* bin port trace */
-				datashort = (unsigned short *) sschannelport->data;
-				istart = ss_altitude / (0.0000000005 * ssv_use * ssheaderport->sampleInterval);
-				istart = rangemin / (0.0000000005 * ssv_use * ssheaderport->sampleInterval);
-				weight = exp(MB_LN_2 * ((double)ssheaderport->weightingFactor));
-				for (i=istart;i<ssheaderport->samples;i++)
-					{
-					/* get sample value */
-					if (ssheaderport->dataFormat == EDGETECH_TRACEFORMAT_ANALYTIC)
-						value = sqrt((double) (datashort[2*i] * datashort[2*i]
-							+ datashort[2*i+1] * datashort[2*i+1]));
-					else
-						value = (double)(datashort[i]);
-
-					/* get sample range */
-					rr = 0.0000000005 * ssv_use *(i * ssheaderport->sampleInterval);
-
-					/* look up position(s) for this range */
-					done = MB_NO;
-					for (kangle=kstart;kangle>0 && done == MB_NO;kangle--)
-						{
-						found = MB_NO;
-						if (rr <= table_range[kstart])
-							{
-							xtrack = table_xtrack[kstart];
-							ltrack = table_ltrack[kstart];
-							done = MB_YES;
-							found = MB_YES;
-							}
-						else if (rr > table_range[kangle] && rr <= table_range[kangle-1])
-							{
-							factor = (rr - table_range[kangle])
-								/ (table_range[kangle-1] - table_range[kangle]);
-							xtrack = table_xtrack[kangle]
-								+ factor * (table_xtrack[kangle-1] - table_xtrack[kangle]);
-							ltrack = table_ltrack[kangle]
-								+ factor * (table_ltrack[kangle-1] - table_ltrack[kangle]);
-							found = MB_YES;
-							done = MB_YES;
-							}
-						else if (rr < table_range[kangle] && rr >= table_range[kangle-1])
-							{
-							factor = (rr - table_range[kangle])
-								/ (table_range[kangle-1] - table_range[kangle]);
-							xtrack = table_xtrack[kangle]
-								+ factor * (table_xtrack[kangle-1] - table_xtrack[kangle]);
-							ltrack = table_ltrack[kangle]
-								+ factor * (table_ltrack[kangle-1] - table_ltrack[kangle]);
-							found = MB_YES;
-							done = MB_YES;
-							}
-
-						/* bin the value and position */
-						if (found == MB_YES)
-							{
-							j = opixels_ss / 2 + (int)(xtrack / pixel_width);
-							if (j >= 0 && j < opixels_ss)
-								{
-								oss[j] += value / weight;
-								ossbincount[j]++;
-								ossalongtrack[j] += ltrack;
-								}
-							}
-						}
-
-					}
-
-				/* find minimum range */
-				rangemin = table_range[0];
-				kstart = 0;
-				for (kangle=1;kangle<nangle;kangle++)
-					{
-					if (table_range[kangle] < rangemin)
-						{
-						rangemin = table_range[kangle];
-						kstart = kangle;
-						}
-					}
-
-				/* bin stbd trace */
-				datashort = (unsigned short *) sschannelstbd->data;
-				istart = ss_altitude / (0.0000000005 * ssv_use * ssheaderstbd->sampleInterval);
-				weight = exp(MB_LN_2 * ((double)ssheaderstbd->weightingFactor));
-				for (i=istart;i<ssheaderstbd->samples;i++)
-					{
-					/* get sample value */
-					if (ssheaderstbd->dataFormat == EDGETECH_TRACEFORMAT_ANALYTIC)
-						value = sqrt((double) (datashort[2*i] * datashort[2*i]
-							+ datashort[2*i+1] * datashort[2*i+1]));
-					else
-						value = (double)(datashort[i]);
-
-					/* get sample range */
-					rr = 0.0000000005 * ssv_use *(i * ssheaderstbd->sampleInterval);
-
-					/* look up position for this range */
-					done = MB_NO;
-					for (kangle=kstart;kangle<nangle-1 && done == MB_NO;kangle++)
-						{
-						found = MB_NO;
-						if (rr <= table_range[kstart])
-							{
-							xtrack = table_xtrack[kstart];
-							ltrack = table_ltrack[kstart];
-							done = MB_YES;
-							found = MB_YES;
-							}
-						else if (rr > table_range[kangle] && rr <= table_range[kangle+1])
-							{
-							factor = (rr - table_range[kangle])
-								/ (table_range[kangle+1] - table_range[kangle]);
-							xtrack = table_xtrack[kangle]
-								+ factor * (table_xtrack[kangle+1] - table_xtrack[kangle]);
-							ltrack = table_ltrack[kangle]
-								+ factor * (table_ltrack[kangle+1] - table_ltrack[kangle]);
-							found = MB_YES;
-							done = MB_YES;
-							}
-						else if (rr < table_range[kangle] && rr >= table_range[kangle+1])
-							{
-							factor = (rr - table_range[kangle])
-								/ (table_range[kangle+1] - table_range[kangle]);
-							xtrack = table_xtrack[kangle]
-								+ factor * (table_xtrack[kangle+1] - table_xtrack[kangle]);
-							ltrack = table_ltrack[kangle]
-								+ factor * (table_ltrack[kangle+1] - table_ltrack[kangle]);
-							found = MB_YES;
-							done = MB_YES;
-							}
-
-						/* bin the value and position */
-						if (found == MB_YES)
-							{
-							j = opixels_ss / 2 + (int)(xtrack / pixel_width);
-							if (j >= 0 && j < opixels_ss)
-								{
-								oss[j] += value / weight;
-								ossbincount[j]++;
-								ossalongtrack[j] += ltrack;
-								}
-							}
-						}
-					}
-
-				/* calculate the output sidescan */
-				for (j=0;j<opixels_ss;j++)
-					{
-					if (ossbincount[j] > 0)
-						{
-						oss[j] /= (double) ossbincount[j];
-						ossalongtrack[j] /= (double) ossbincount[j];
-						}
-					else
-						oss[j] = MB_SIDESCAN_NULL;
-					}
-
-				/* interpolate gaps in the output sidescan */
-				previous = opixels_ss;
-				for (j=0;j<opixels_ss;j++)
-					{
-					if (ossbincount[j] > 0)
-						{
-						interpable = j - previous - 1;
-						if (interpable > 0 && interpable <= interpbins)
-							{
-							dss = oss[j] - oss[previous];
-							dssl = ossalongtrack[j] - ossalongtrack[previous];
-							for (jj=previous+1;jj<j;jj++)
-								{
-								fraction = ((double)(jj - previous))
-										/ ((double)(j - previous));
-								oss[jj] = oss[previous] + fraction * dss;
-								ossalongtrack[jj] = ossalongtrack[previous] + fraction * dssl;
-								}
-							}
-						previous = j;
-						}
-					}
-
-				/* insert data */
-				mb_insert_nav(verbose, ombio_ptr, (void *)ostore,
-						time_i, time_d,
-						navlon, navlat, speed, heading, draft,
-						roll, pitch, heave,
-						&error);
-				status = mb_insert_altitude(verbose, ombio_ptr, (void *)ostore,
-						sonardepth, ss_altitude, &error);
-				status = mb_insert(verbose, ombio_ptr, (void *)ostore,
-						MB_DATA_DATA, time_i, time_d,
-						navlon, navlat, speed, heading,
-						beams_bath,beams_amp,opixels_ss,
-						beamflag,bath,amp,bathacrosstrack,
-						bathalongtrack,
-						oss,ossacrosstrack,ossalongtrack,
-						comment, &error);
-
-				/* write the record */
-				nwritesshi++;
-				mb_write_ping(verbose, ombio_ptr, (void *)ostore, &error);
-				}
-			}
-
-	   	/* handle unknown data */
-		else  if (status == MB_SUCCESS)
-			{
-/*fprintf(stderr,"DATA TYPE UNKNOWN: status:%d error:%d kind:%d\n",status,error,kind);*/
-			}
-
-	   	/* handle read error */
-		else
-			{
-/*fprintf(stderr,"READ FAILURE: status:%d error:%d kind:%d\n",status,error,kind);*/
-			}
-
-		/* print debug statements */
-		if (verbose >= 2)
-			{
-			fprintf(stderr,"\ndbg2  Ping read in program <%s>\n",
-				program_name);
-			fprintf(stderr,"dbg2       kind:           %d\n",kind);
-			fprintf(stderr,"dbg2       error:          %d\n",error);
-			fprintf(stderr,"dbg2       status:         %d\n",status);
-			}
-
-		/* print comments */
-		if (print_comments == MB_YES && kind == MB_DATA_COMMENT)
-			{
-			if (icomment == 0)
-				{
-				fprintf(stderr,"\nComments:\n");
-				icomment++;
-				}
-			fprintf(stderr,"%s\n",comment);
-			}
-		}
-
-	/* close the swath file */
-	status = mb_close(verbose,&imbio_ptr,&error);
-
-	/* output counts */
-	fprintf(stdout, "\nData records read from: %s\n", file);
-	fprintf(stdout, "     Survey:        %d\n", nreaddata);
-	fprintf(stdout, "     File Header:   %d\n", nreadheader);
-	fprintf(stdout, "     Bluefin CTD:   %d\n", nreadssv);
-	fprintf(stdout, "     Bluefin Nav:   %d\n", nreadnav1);
-	fprintf(stdout, "     Subbottom:     %d\n", nreadsbp);
-	fprintf(stdout, "     Low Sidescan:  %d\n", nreadsslo);
-	fprintf(stdout, "     High Sidescan: %d\n", nreadsshi);
-	nreaddatatot += nreaddata;
-	nreadheadertot += nreadheader;
-	nreadssvtot += nreadssv;
-	nreadnav1tot += nreadnav1;
-	nreadsbptot += nreadsbp;
-	nreadsslotot += nreadsslo;
-	nreadsshitot += nreadsshi;
-
-	/* figure out whether and what to read next */
-        if (read_datalist == MB_YES)
-                {
-		if ((status = mb_datalist_read(verbose,datalist,
-			    file,&format,&file_weight,&error))
-			    == MB_SUCCESS)
-                        read_data = MB_YES;
-                else
-                        read_data = MB_NO;
-                }
-        else
-                {
-                read_data = MB_NO;
-                }
-
-	/* end loop over files in list */
-	}
-	if (read_datalist == MB_YES)
-		mb_datalist_close(verbose,&datalist,&error);
-
-	/* close output file if still open */
-	if (ombio_ptr != NULL)
-		{
-		/* close the swath file */
-		status = mb_close(verbose,&ombio_ptr,&error);
-
-		/* generate inf file */
-		if (status == MB_SUCCESS)
-			{
-			status = mb_make_info(verbose, MB_YES,
-						output_file,
-						format_output,
-						&error);
-			}
-
-		/* output counts */
-		fprintf(stdout, "\nData records written to: %s\n", current_output_file);
-		fprintf(stdout, "     Low Sidescan:  %d\n", nwritesslo);
-		fprintf(stdout, "     High Sidescan: %d\n", nwritesshi);
-		nwritesslotot += nwritesslo;
-		nwritesshitot += nwritesshi;
-
-		/* output commands to first cut plotting script file */
-		fprintf(sfp, "# Generate swath plot of sidescan file: %s\n", current_output_file);
-		fprintf(sfp, "mbm_plot -I %s -N -G5 -S -Pb -V -O %s_ssrawplot\n",
-			current_output_file, current_output_file);
-		fprintf(sfp, "%s_ssrawplot.cmd\n\n", current_output_file);
-		}
-
-	/* close plotting script file */
-	fclose(sfp);
-	sprintf(command, "chmod +x %s", scriptfile);
-	shellstatus = system(command);
-
-	/* output counts */
-	fprintf(stdout, "\nTotal data records read:\n");
-	fprintf(stdout, "     Survey:        %d\n", nreaddatatot);
-	fprintf(stdout, "     File Header:   %d\n", nreadheadertot);
-	fprintf(stdout, "     Bluefin CTD:   %d\n", nreadssvtot);
-	fprintf(stdout, "     Bluefin Nav:   %d\n", nreadnav1tot);
-	fprintf(stdout, "     Subbottom:     %d\n", nreadsbptot);
-	fprintf(stdout, "     Low Sidescan:  %d\n", nreadsslotot);
-	fprintf(stdout, "     High Sidescan: %d\n", nreadsshitot);
-	fprintf(stdout, "Total data records written:\n");
-	fprintf(stdout, "     Low Sidescan:  %d\n", nwritesslotot);
-	fprintf(stdout, "     High Sidescan: %d\n", nwritesshitot);
-
-	/* deallocate route arrays */
-	if (route_file_set == MB_YES)
-		{
-		status = mb_freed(verbose, __FILE__, __LINE__, (void **)&routelon, &error);
-		status = mb_freed(verbose, __FILE__, __LINE__, (void **)&routelat, &error);
-		status = mb_freed(verbose, __FILE__, __LINE__, (void **)&routeheading, &error);
-		status = mb_freed(verbose, __FILE__, __LINE__, (void **)&routewaypoint, &error);
-		}
-
-	/* deallocate topography grid array if necessary */
-	if (sslayoutmode == MB7K2SS_SS_3D_BOTTOM)
-		status = mb_topogrid_deall(verbose, &topogrid_ptr, &error);
-
-	/* check memory */
-	if (verbose >= 4)
-		status = mb_memory_list(verbose,&error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  Program <%s> completed\n",
-			program_name);
-		fprintf(stderr,"dbg2  Ending status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* end it all */
-	exit(error);
-}
-/*--------------------------------------------------------------------*/
-int mb7k2ss_get_flatbottom_table(int verbose, int nangle, double angle_min, double angle_max,
-					double navlon, double navlat, double altitude, double pitch,
-					double *table_angle, double *table_xtrack, double *table_ltrack,
-					double *table_altitude, double *table_range,
-					int *error)
-{
-	char	*function_name = "mb7k2ss_get_flatbottom_table";
-	int	status = MB_SUCCESS;
-	double	dangle;
-	double	rr, xx, zz;
-	double	alpha, beta, theta, phi;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MB7K2SS function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:         %d\n", verbose);
-		fprintf(stderr,"dbg2       nangle:          %d\n", nangle);
-		fprintf(stderr,"dbg2       angle_min:       %f\n", angle_min);
-		fprintf(stderr,"dbg2       angle_max:       %f\n", angle_max);
-		fprintf(stderr,"dbg2       navlon:          %f\n", navlon);
-		fprintf(stderr,"dbg2       navlat:          %f\n", navlat);
-		fprintf(stderr,"dbg2       pitch:           %f\n", pitch);
-		}
-
-	/* loop over all of the angles */
-	dangle = (angle_max - angle_min) / (nangle - 1);
-	alpha = pitch;
-	zz = altitude;
-	for (i=0;i<nangle;i++)
-		{
-		/* get angles in takeoff coordinates */
-		table_angle[i] = angle_min + dangle * i;
-		beta = 90.0 - table_angle[i];
-		mb_rollpitch_to_takeoff(
-			verbose,
-			alpha, beta,
-			&theta, &phi,
-			error);
-
-		/* calculate range required to achieve desired altitude */
-		rr = zz / cos(DTR * theta);
-
-		/* get the position */
-		xx = rr * sin(DTR * theta);
-		table_xtrack[i] = xx * cos(DTR * phi);
-		table_ltrack[i] = xx * sin(DTR * phi);
-		table_altitude[i] = zz;
-		table_range[i] = rr;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MB7K2SS function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       Lookup tables:\n");
-		for (i=0;i<nangle;i++)
-			fprintf(stderr,"dbg2         %d %f %f %f %f %f\n",
-				i, table_angle[i], table_xtrack[i], table_ltrack[i], table_altitude[i], table_range[i]);
-		fprintf(stderr,"dbg2       error:           %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:          %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/utilities/mb7kpreprocess.c b/src/utilities/mb7kpreprocess.c
deleted file mode 100644
index f518ac2..0000000
--- a/src/utilities/mb7kpreprocess.c
+++ /dev/null
@@ -1,7735 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mb7kpreprocess.c	10/12/2005
- *    $Id: mb7kpreprocess.c 2250 2015-06-30 02:12:26Z caress $
- *
- *    Copyright (c) 2005-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mb7kpreprocess reads a Reson 7k format file, interpolates the
- * asynchronous navigation and attitude onto the multibeam data,
- * and writes a new 7k file with that information correctly embedded
- * in the multibeam data. This program can also fix various problems
- * with 7k data (early generations of the 6046 datalogger failed to
- * to meet the data format specification exactly).
- *
- * Author:	D. W. Caress
- * Date:	October 12, 2005
- *
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <math.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-
-/* MBIO include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_define.h"
-#include "mb_io.h"
-#include "mb_aux.h"
-#include "mbsys_reson7k.h"
-
-#define MB7KPREPROCESS_ALLOC_CHUNK 1000
-#define MB7KPREPROCESS_PROCESS		1
-#define MB7KPREPROCESS_TIMESTAMPLIST	2
-#define MB7KPREPROCESS_TIMEFIX_NONE	0
-#define MB7KPREPROCESS_TIMEFIX_RESON	1
-#define MB7KPREPROCESS_TIMEFIX_EDGETECH	2
-#define	MB7KPREPROCESS_TIMEDELAY_UNDEFINED	-1
-#define	MB7KPREPROCESS_TIMEDELAY_OFF		0
-#define	MB7KPREPROCESS_TIMEDELAY_ON		1
-#define	MB7KPREPROCESS_TIMELAG_OFF	0
-#define	MB7KPREPROCESS_TIMELAG_CONSTANT	1
-#define	MB7KPREPROCESS_TIMELAG_MODEL	2
-#define	MB7KPREPROCESS_KLUGE_USEVERTICALDEPTH		1
-#define	MB7KPREPROCESS_KLUGE_ZEROALONGTRACKANGLES	2
-#define	MB7KPREPROCESS_KLUGE_ZEROATTITUDECORRECTION	3
-#define	MB7KPREPROCESS_KLUGE_KEARFOTTROVNOISE		4
-#define	MB7KPREPROCESS_KLUGE_BEAMPATTERNTWEAK		5
-static char rcs_id[] = "$Id: mb7kpreprocess.c 2250 2015-06-30 02:12:26Z caress $";
-
-/*--------------------------------------------------------------------*/
-
-int main (int argc, char **argv)
-{
-	char program_name[] = "mb7kpreprocess";
-	char help_message[] =  "mb7kpreprocess reads a Reson 7k format file, interpolates the\nasynchronous navigation and attitude onto the multibeam data, \nand writes a new 7k file with that information correctly embedded\nin the multibeam data. This program can also fix various problems\nwith 7k data.";
-	char usage_message[] = "mb7kpreprocess [-A -B -Crollbias/pitchbias -Doffx/offy -Fformat -Ifile -Kklugemode -L  -Ninsfile  -Ooutfile [-Psonardepthfile | -Plagmax/ratemax] -Ssidescansource -Ttimelag -H -V]";
-	extern char *optarg;
-	int	errflg = 0;
-	int	c;
-	int	help = 0;
-	int	flag = 0;
-
-	/* MBIO status variables */
-	int	status = MB_SUCCESS;
-	int	verbose = 0;
-	int	error = MB_ERROR_NO_ERROR;
-	char	*message;
-
-	/* MBIO read control parameters */
-	int	read_datalist = MB_NO;
-	char	read_file[MB_PATH_MAXLINE];
-	void	*datalist;
-	int	look_processed = MB_DATALIST_LOOK_UNSET;
-	double	file_weight;
-	int	format = 0;
-	int	pings;
-	int	lonflip;
-	double	bounds[4];
-	int	btime_i[7];
-	int	etime_i[7];
-	double	btime_d;
-	double	etime_d;
-	double	speedmin;
-	double	timegap;
-	char	ifile[MB_PATH_MAXLINE];
-	char	ofile[MB_PATH_MAXLINE];
-	char	ctdfile[MB_PATH_MAXLINE];
-	int	ofile_set = MB_NO;
-	int	beams_bath;
-	int	beams_amp;
-	int	pixels_ss;
-	int	obeams_bath;
-	int	obeams_amp;
-	int	opixels_ss;
-	
-	/* platform definition file */
-	char	platform_file[MB_PATH_MAXLINE];
-	int	use_platform_file = MB_NO;
-	struct mb_platform_struct *platform = NULL;
-	struct mb_sensor_struct *sensor_swathbathymetry = NULL;
-	struct mb_sensor_struct *sensor_rollpitch = NULL;
-	struct mb_sensor_struct *sensor_heading = NULL;
-	struct mb_sensor_struct *sensor_position = NULL;
-	struct mb_sensor_struct *sensor_depth = NULL;
-
-	/* MBIO read values */
-	void	*imbio_ptr = NULL;
-	struct mb_io_struct *imb_io_ptr = NULL;
-	void	*istore_ptr = NULL;
-	struct mbsys_reson7k_struct *istore = NULL;
-	void	*ombio_ptr = NULL;
-	int	kind;
-	int	time_i[7];
-	int	time_j[5];
-	double	time_d;
-	double	navlon;
-	double	navlat;
-	double	speed;
-	double	distance;
-	double	altitude;
-	double	sonardepth;
-	double	heading, beamheading, beamheadingr;
-	double	roll, rollr, beamroll, beamrollr;
-	double	pitch, pitchr, beampitch, beampitchr;
-	double	heave, beamheave;
-	char	*beamflag = NULL;
-	double	*bath = NULL;
-	double	*bathacrosstrack = NULL;
-	double	*bathalongtrack = NULL;
-	double	*amp = NULL;
-	double	*ss = NULL;
-	double	*ssacrosstrack = NULL;
-	double	*ssalongtrack = NULL;
-	char	comment[MB_COMMENT_MAXLINE];
-
-	/* program mode */
-	int	mode = MB7KPREPROCESS_PROCESS;
-	int	fix_time_stamps = MB7KPREPROCESS_TIMEFIX_NONE;
-	int	goodnavattitudeonly = MB_YES;
-
-	/* data structure pointers */
-	s7k_header 		*header;
-	s7kr_reference		*reference;
-	s7kr_sensoruncal	*sensoruncal;
-	s7kr_sensorcal		*sensorcal;
-	s7kr_position 		*position;
-	s7kr_customattitude	*customattitude;
-	s7kr_tide		*tide;
-	s7kr_altitude		*altituderec;
-	s7kr_motion		*motion;
-	s7kr_depth		*depth;
-	s7kr_svp		*svp;
-	s7kr_ctd		*ctd;
-	s7kr_geodesy		*geodesy;
-	s7kr_rollpitchheave 	*rollpitchheave;
-	s7kr_heading		*headingrec;
-	s7kr_surveyline		*surveyline;
-	s7kr_navigation		*navigation;
-	s7kr_attitude		*attitude;
-	s7kr_fsdwss 		*fsdwsslo;
-	s7kr_fsdwss 		*fsdwsshi;
-	s7kr_fsdwsb 		*fsdwsb;
-	s7k_fsdwchannel 	*fsdwchannel;
-	s7k_fsdwssheader 	*fsdwssheader;
-	s7k_fsdwsegyheader 	*fsdwsegyheader;
-	s7kr_bluefin		*bluefin;
-	s7kr_volatilesettings	*volatilesettings;
-	s7kr_matchfilter	*matchfilter;
-	s7kr_beamgeometry	*beamgeometry;
-	s7kr_bathymetry		*bathymetry;
-	s7kr_backscatter	*backscatter;
-	s7kr_beam		*beam;
-	s7kr_v2pingmotion	*v2pingmotion;
-	s7kr_v2detectionsetup	*v2detectionsetup;
-	s7kr_v2beamformed	*v2beamformed;
-	s7kr_verticaldepth	*verticaldepth;
-	s7kr_v2detection	*v2detection;
-	s7kr_v2rawdetection	*v2rawdetection;
-	s7kr_v2snippet		*v2snippet;
-	s7kr_calibratedsnippet *calibratedsnippet;
-	s7kr_processedsidescan	*processedsidescan;
-	s7kr_image		*image;
-	s7kr_fileheader		*fileheader;
-	s7kr_installation	*installation;
-	s7kr_remotecontrolsettings	*remotecontrolsettings;
-
-	/* counting variables */
-	int	nfile_read = 0;
-	int	nfile_write = 0;
-	int	nrec_reference = 0;
-	int	nrec_sensoruncal = 0;
-	int	nrec_sensorcal = 0;
-	int	nrec_position = 0;
-	int	nrec_customattitude = 0;
-	int	nrec_tide = 0;
-	int	nrec_altitude = 0;
-	int	nrec_motion = 0;
-	int	nrec_depth = 0;
-	int	nrec_svp = 0;
-	int	nrec_ctd = 0;
-	int	nrec_geodesy = 0;
-	int	nrec_rollpitchheave = 0;
-	int	nrec_heading = 0;
-	int	nrec_surveyline = 0;
-	int	nrec_navigation = 0;
-	int	nrec_attitude = 0;
-	int	nrec_fsdwsslo = 0;
-	int	nrec_fsdwsshi = 0;
-	int	nrec_fsdwsbp = 0;
-	int	nrec_bluefinnav = 0;
-	int	nrec_bluefinenv = 0;
-	int	nrec_multibeam = 0;
-	int	nrec_volatilesettings = 0;
-	int	nrec_configuration = 0;
-	int	nrec_matchfilter = 0;
-	int	nrec_beamgeometry = 0;
-	int	nrec_calibration = 0;
-	int	nrec_bathymetry = 0;
-	int	nrec_backscatter = 0;
-	int	nrec_beam = 0;
-	int	nrec_verticaldepth = 0;
-	int	nrec_image = 0;
-	int	nrec_v2pingmotion = 0;
-	int	nrec_v2detectionsetup = 0;
-	int	nrec_v2beamformed = 0;
-	int	nrec_v2detection = 0;
-	int	nrec_v2rawdetection = 0;
-	int	nrec_v2snippet = 0;
-	int 	nrec_calibratedsnippet = 0;
-	int	nrec_processedsidescan = 0;
-	int	nrec_installation = 0;
-	int	nrec_systemeventmessage = 0;
-	int	nrec_fileheader = 0;
-	int	nrec_remotecontrolsettings = 0;
-	int	nrec_other = 0;
-	int	nrec_reference_tot = 0;
-	int	nrec_sensoruncal_tot = 0;
-	int	nrec_sensorcal_tot = 0;
-	int	nrec_position_tot = 0;
-	int	nrec_customattitude_tot = 0;
-	int	nrec_tide_tot = 0;
-	int	nrec_altitude_tot = 0;
-	int	nrec_motion_tot = 0;
-	int	nrec_depth_tot = 0;
-	int	nrec_svp_tot = 0;
-	int	nrec_ctd_tot = 0;
-	int	nrec_geodesy_tot = 0;
-	int	nrec_rollpitchheave_tot = 0;
-	int	nrec_heading_tot = 0;
-	int	nrec_surveyline_tot = 0;
-	int	nrec_navigation_tot = 0;
-	int	nrec_attitude_tot = 0;
-	int	nrec_fsdwsslo_tot = 0;
-	int	nrec_fsdwsshi_tot = 0;
-	int	nrec_fsdwsbp_tot = 0;
-	int	nrec_bluefinnav_tot = 0;
-	int	nrec_bluefinenv_tot = 0;
-	int	nrec_multibeam_tot = 0;
-	int	nrec_volatilesettings_tot = 0;
-	int	nrec_configuration_tot = 0;
-	int	nrec_matchfilter_tot = 0;
-	int	nrec_beamgeometry_tot = 0;
-	int	nrec_calibration_tot = 0;
-	int	nrec_bathymetry_tot = 0;
-	int	nrec_backscatter_tot = 0;
-	int	nrec_beam_tot = 0;
-	int	nrec_verticaldepth_tot = 0;
-	int	nrec_image_tot = 0;
-	int	nrec_v2pingmotion_tot = 0;
-	int	nrec_v2detectionsetup_tot = 0;
-	int	nrec_v2beamformed_tot = 0;
-	int	nrec_v2detection_tot = 0;
-	int	nrec_v2rawdetection_tot = 0;
-	int	nrec_v2snippet_tot = 0;
-	int	nrec_calibratedsnippet_tot = 0;
-	int	nrec_processedsidescan_tot = 0;
-	int	nrec_installation_tot = 0;
-	int	nrec_systemeventmessage_tot = 0;
-	int	nrec_fileheader_tot = 0;
-	int	nrec_remotecontrolsettings_tot = 0;
-	int	nrec_other_tot = 0;
-
-	/* last time_d variables - used to check for repeated data */
-	double	last_7k_time_d = 0.0;
-	double	last_bluefinnav_time_d = 0.0;
-	double	last_bluefinenv_time_d = 0.0;
-	double	last_fsdwsbp_time_d = 0.0;
-	double	last_fsdwsslo_time_d = 0.0;
-	double	last_fsdwsshi_time_d = 0.0;
-
-	/* merge navigation and attitude from separate Steve Rock data file */
-	char	rockfile[MB_PATH_MAXLINE];
-	int	rockdata = MB_NO;
-	int	nrock = 0;
-	double	*rock_time_d = NULL;
-	double	*rock_lon = NULL;
-	double	*rock_lat = NULL;
-	double	*rock_heading = NULL;
-	double	*rock_roll = NULL;
-	double	*rock_pitch = NULL;
-	double	*rock_sonardepth = NULL;
-	double	*rock_sonardepthfilter = NULL;
-
-	/* merge navigation and attitude from separate WHOI DSL data file */
-	char	dslfile[MB_PATH_MAXLINE];
-	int	dsldata = MB_NO;
-	int	ndsl = 0;
-	double	*dsl_time_d = NULL;
-	double	*dsl_lon = NULL;
-	double	*dsl_lat = NULL;
-	double	*dsl_heading = NULL;
-	double	*dsl_roll = NULL;
-	double	*dsl_pitch = NULL;
-	double	*dsl_sonardepth = NULL;
-	double	*dsl_sonardepthfilter = NULL;
-
-	/* merge navigation and attitude from separate ins data file */
-	char	insfile[MB_PATH_MAXLINE];
-	int	insdata = MB_NO;
-	int	nins = 0;
-	int	nins_altitude = 0;
-	int	nins_speed = 0;
-	double	*ins_time_d = NULL;
-	double	*ins_lon = NULL;
-	double	*ins_lat = NULL;
-	double	*ins_heading = NULL;
-	double	*ins_roll = NULL;
-	double	*ins_pitch = NULL;
-	double	*ins_sonardepth = NULL;
-	double	*ins_sonardepthfilter = NULL;
-	double	*ins_altitude_time_d = NULL;
-	double	*ins_altitude = NULL;
-	double	*ins_speed_time_d = NULL;
-	double	*ins_speed = NULL;
-	int	ins_output_index = -1;
-
-	/* merge sonardepth from separate parosci pressure sensor data file */
-	char	sonardepthfile[MB_PATH_MAXLINE];
-	int	sonardepthdata = MB_NO;
-	int	nsonardepth = 0;
-	double	*sonardepth_time_d = NULL;
-	double	*sonardepth_sonardepth = NULL;
-	double	*sonardepth_sonardepthfilter = NULL;
-
-	/* asynchronous navigation, heading, attitude data */
-	int	ndat_nav = 0;
-	int	ndat_nav_alloc = 0;
-	double	*dat_nav_time_d = NULL;
-	double	*dat_nav_lon = NULL;
-	double	*dat_nav_lat = NULL;
-	double	*dat_nav_speed = NULL;
-
-	int	ndat_sonardepth = 0;
-	int	ndat_sonardepth_alloc = 0;
-	double	*dat_sonardepth_time_d = NULL;
-	double	*dat_sonardepth_sonardepth = NULL;
-	double	*dat_sonardepth_sonardepthfilter = NULL;
-
-	int	ndat_heading = 0;
-	int	ndat_heading_alloc = 0;
-	double	*dat_heading_time_d = NULL;
-	double	*dat_heading_heading = NULL;
-
-	int	ndat_rph = 0;
-	int	ndat_rph_alloc = 0;
-	double	*dat_rph_time_d = NULL;
-	double	*dat_rph_roll = NULL;
-	double	*dat_rph_pitch = NULL;
-	double	*dat_rph_heave = NULL;
-
-	int	ndat_altitude = 0;
-	int	ndat_altitude_alloc = 0;
-	double	*dat_altitude_time_d = NULL;
-	double	*dat_altitude_altitude = NULL;
-
-	/* bathymetry time delay data */
-	int	ntimedelay = 0;
-	int	ntimedelaycount = 0;
-	int	ntimedelay_alloc = 0;
-	double	*timedelay_time_d = NULL;
-	double	*timedelay_timedelay = NULL;
-
-	/* bathymetry timetag data */
-	int	nbatht = 0;
-	int	nbatht_alloc = 0;
-	double	*batht_time_d = NULL;
-	int	*batht_ping = NULL;
-	double	*batht_time_d_new = NULL;
-	double	*batht_time_offset = NULL;
-	int	*batht_ping_offset = NULL;
-	int	*batht_good_offset = NULL;
-
-	/* edgetech timetag data */
-	int	nedget = 0;
-	int	nedget_alloc = 0;
-	double	*edget_time_d = NULL;
-	int	*edget_ping = NULL;
-	double	*edget_time_d_new = NULL;
-	double	*edget_time_offset = NULL;
-	int	*edget_ping_offset = NULL;
-	int	*edget_good_offset = NULL;
-
-	/* timedelay parameters */
-	int	timedelaymode = MB7KPREPROCESS_TIMEDELAY_UNDEFINED;
-	char	timedelayfile[MB_PATH_MAXLINE];
-
-	/* timelag parameters */
-	int	timelagmode = MB7KPREPROCESS_TIMELAG_OFF;
-	double	timelag = 0.0;
-	double	timelagm = 0.0;
-	double	timelagconstant = 0.0;
-	char	timelagfile[MB_PATH_MAXLINE];
-	int	ntimelag = 0;
-	double	*timelag_time_d = NULL;
-	double	*timelag_model = NULL;
-
-	/* range offset parameters */
-	int	nrangeoffset = 0;
-	int	rangeoffsetstart[3];
-	int	rangeoffsetend[3];
-	double	rangeoffset[3];
-
-	/* depth sensor filtering */
-	int	sonardepthfilter = MB_NO;
-	double	sonardepthfilterlength = 20.0;
-	double	sonardepthfilterdepth = 20.0;
-
-	/* depth sensor offset (+ makes vehicle deeper) */
-	double	sonardepthoffset = 0.0;
-
-	/* depth sensor lever arm parameter */
-	int	use_depthsensoroff = MB_NO;
-	double	depthsensoroffx = 0.0;
-	double	depthsensoroffy = 0.0;
-	double	depthsensoroffz = 0.0;
-	
-	int	sonar_offset_mode = MB_NO;
-	double	sonar_offset_x = 0.0;
-	double	sonar_offset_y = 0.0;
-	double	sonar_offset_z = 0.0;
-	double	sonar_offset_heading = 0.0;
-	double	sonar_offset_roll = 0.0;
-	double	sonar_offset_pitch = 0.0;
-	
-	int	vru_offset_mode = MB_NO;
-	double	vru_offset_x = 0.0;
-	double	vru_offset_y = 0.0;
-	double	vru_offset_z = 0.0;
-	double	vru_offset_heading = 0.0;
-	double	vru_offset_roll = 0.0;
-	double	vru_offset_pitch = 0.0;
-	
-	int	navigation_offset_mode = MB_NO;
-	double	navigation_offset_x = 0.0;
-	double	navigation_offset_y = 0.0;
-	double	navigation_offset_z = 0.0;
-	double	navigation_offset_heading = 0.0;
-	double	navigation_offset_roll = 0.0;
-	double	navigation_offset_pitch = 0.0;
-	double	position_offset_x = 0.0;
-	double	position_offset_y = 0.0;
-	double	position_offset_z = 0.0;
-
-	/* multibeam sidescan parameters */
-	int	ss_source = R7KRECID_None;
-
-	/* output asynchronous and synchronous time series ancilliary files */
-	char	athfile[MB_PATH_MAXLINE];
-	char	atsfile[MB_PATH_MAXLINE];
-	char	atafile[MB_PATH_MAXLINE];
-	char	stafile[MB_PATH_MAXLINE];
-	FILE	*athfp;
-	FILE	*atsfp;
-	FILE	*atafp;
-	FILE	*stafp;
-
-	/* kluge modes */
-	int	klugemode;
-	double	klugevalue;
-	int	kluge_useverticaldepth = MB_NO; /* kluge 1 */
-	int	kluge_zeroalongtrackangles = MB_NO; /* kluge 2 */
-	int	kluge_zeroattitudecorrection = MB_NO; /* kluge 3 */
-	int	kluge_kearfottrovnoise = MB_NO; /* kluge 4 */
-	int	kluge_beampatterntweak = MB_NO; /* kluge 5 */
-	double	kluge_beampatternfactor = 1.0;
-
-	/* MBARI data flag */
-	int	MBARIdata = MB_NO;
-	
-	/* variables for beam angle calculation */
-	mb_3D_orientation tx_align;
-	mb_3D_orientation tx_orientation;
-	double tx_steer;
-	mb_3D_orientation rx_align;
-	mb_3D_orientation rx_orientation;
-	double rx_steer;
-	double reference_heading;
-	double beamAzimuth;
-	double beamDepression;
-	double rollbias = 0.0;
-	double pitchbias = 0.0;
-
-	int	jtimedelay = 0;
-	int	jtimelag = 0;
-	int	jins = 0;
-	int	jrock = 0;
-	int	jdsl = 0;
-	int	jsonardepth = 0;
-	int	jdnav = 0;
-	int	jdaltitude = 0;
-	int	jdheading = 0;
-	int	jdattitude = 0;
-	int	jdsonardepth = 0;
-
-	int	interp_status;
-	double	soundspeed;
-	double	alpha, beta, theta, phi;
-	double	rr, xx, zz;
-	double	lever_x, lever_y, lever_z;
-	double	headingx, headingy, mtodeglon, mtodeglat;
-	double	dx, dy, dist, dt, v;
-	double	longitude_offset, latitude_offset;
-	int	j1, j2;
-	double	pixel_size;
-	double	swath_width;
-	int	time7k_i[7];
-	int	time7k_j[5];
-	double	time7k_d;
-
-	FILE	*tfp = NULL;
-	struct stat file_status;
-	int	fstat;
-	char	buffer[MB_PATH_MAXLINE];
-	char	*result;
-	int	read_data;
-	int	testformat;
-	char	fileroot[MB_PATH_MAXLINE];
-	int	found;
-	int	reson_lastread;
-	int	sslo_lastread;
-	double	sslo_last_time_d;
-	int	sslo_last_ping;
-	int	foundstart, foundend;
-	int	start, end;
-	int	nscan, startdata;
-	int	ins_time_d_index = -1;
-	int	ins_lon_index = -1;
-	int	ins_lat_index = -1;
-	int	ins_roll_index = -1;
-	int	ins_pitch_index = -1;
-	int	ins_heading_index = -1;
-	int	ins_sonardepth_index = -1;
-	int	ins_altitude_index = -1;
-	int	ins_speed_index = -1;
-	int	ins_velocityx_index = -1;
-	int	ins_velocityy_index = -1;
-	int	ins_velocityz_index = -1;
-	int	ins_len;
-	int	sonardepth_time_d_index;
-	int	sonardepth_sonardepth_index;
-	int	sonardepth_len;
-	int	nhalffilter;
-	double	sonardepth_filterweight;
-	double	dtime, dtol, weight;
-	double	factor;
-	double	velocityx, velocityy;
-	int	type_save, kind_save;
-	char	type[MB_PATH_MAXLINE], value[MB_PATH_MAXLINE];
-	int	year, month, day, hour, minute;
-	double	second, id;
-	char	sensor[24];
-	int	n;
-	int	i, j;
-
-	/* get current default values */
-	status = mb_defaults(verbose,&format,&pings,&lonflip,bounds,
-		btime_i,etime_i,&speedmin,&timegap);
-
-	/* set default input to datalist.mb-1 */
-	strcpy (read_file, "datalist.mb-1");
-
-	/* process argument list */
-	while ((c = getopt(argc, argv, "AaB:b:C:c:D:d:F:f:G:g:I:i:K:k:LlM:m:N:n:O:o:P:p:R:r:S:s:T:t:W:w:Z:z:VvHh")) != -1)
-	  switch (c)
-		{
-		case 'H':
-		case 'h':
-			help++;
-			break;
-		case 'V':
-		case 'v':
-			verbose++;
-			break;
-		case 'A':
-		case 'a':
-			goodnavattitudeonly = MB_NO;
-			flag++;
-			break;
-		case 'B':
-		case 'b':
-			sscanf (optarg,"%d", &fix_time_stamps);
-			break;
-		case 'C':
-		case 'c':
-			nscan = sscanf (optarg,"%lf/%lf", &sonar_offset_roll,&sonar_offset_pitch);
-			if (nscan == 2)
-				sonar_offset_mode = MB_YES;
-			break;
-		case 'D':
-		case 'd':
-			nscan = sscanf (optarg,"%lf/%lf/%lf/%lf", &depthsensoroffx, &depthsensoroffy, &depthsensoroffz, &sonardepthoffset);
-			if (nscan < 4)
-				{
-				if (nscan == 3)
-					{
-					sonardepthoffset = depthsensoroffz;
-					depthsensoroffz = depthsensoroffy;
-					depthsensoroffy = depthsensoroffx;
-					depthsensoroffx = 0.0;
-					}
-				else if (nscan == 2)
-					{
-					sonardepthoffset = 0.0;
-					depthsensoroffz = depthsensoroffy;
-					depthsensoroffy = depthsensoroffx;
-					depthsensoroffx = 0.0;
-					}
-				else if (nscan == 1)
-					{
-					sonardepthoffset = 0.0;
-					depthsensoroffz = 0.0;
-					depthsensoroffy = depthsensoroffx;
-					depthsensoroffx = 0.0;
-					}
-				}
-			if (nscan > 0)
-				use_depthsensoroff = MB_YES;
-			flag++;
-			break;
-		case 'F':
-		case 'f':
-			sscanf (optarg,"%d", &format);
-			flag++;
-			break;
-		case 'G':
-		case 'g':
-			sscanf (optarg,"%s", platform_file);
-			use_platform_file = MB_YES;
-			flag++;
-			break;
-		case 'I':
-		case 'i':
-			sscanf (optarg,"%s", read_file);
-			flag++;
-			break;
-		case 'K':
-		case 'k':
-			nscan = sscanf (optarg,"%d/%lf", &klugemode, &klugevalue);
-			if (klugemode == MB7KPREPROCESS_KLUGE_USEVERTICALDEPTH)
-				{
-				kluge_useverticaldepth = MB_YES;
-				}
-			if (klugemode == MB7KPREPROCESS_KLUGE_ZEROALONGTRACKANGLES)
-				{
-				kluge_zeroalongtrackangles = MB_YES;
-				}
-			if (klugemode == MB7KPREPROCESS_KLUGE_ZEROATTITUDECORRECTION)
-				{
-				kluge_zeroattitudecorrection = MB_YES;
-				}
-			if (klugemode == MB7KPREPROCESS_KLUGE_KEARFOTTROVNOISE)
-				{
-				kluge_kearfottrovnoise = MB_YES;
-				}
-			if (klugemode == MB7KPREPROCESS_KLUGE_BEAMPATTERNTWEAK
-				&& nscan == 2)
-				{
-				kluge_beampatterntweak = MB_YES;
-				kluge_beampatternfactor = klugevalue;
-				}
-			flag++;
-			break;
-		case 'L':
-		case 'l':
-			mode = MB7KPREPROCESS_TIMESTAMPLIST;
-			flag++;
-			break;
-		case 'M':
-		case 'm':
-			sscanf (optarg,"%s", rockfile);
-			rockdata  = MB_YES;
-			flag++;
-			break;
-		case 'N':
-		case 'n':
-			sscanf (optarg,"%s", insfile);
-			insdata  = MB_YES;
-			flag++;
-			break;
-		case 'O':
-		case 'o':
-			sscanf (optarg,"%s", ofile);
-			ofile_set  = MB_YES;
-			flag++;
-			break;
-		case 'P':
-		case 'p':
-			sscanf (optarg,"%s", buffer);
-			if ((fstat = stat(buffer, &file_status)) == 0
-				&& (file_status.st_mode & S_IFMT) != S_IFDIR)
-					{
-					sonardepthdata  = MB_YES;
-					strcpy(sonardepthfile,buffer);
-					}
-			else if (optarg[0] == 'F' || optarg[0] == 'f')
-				{
-				nscan = sscanf (&(optarg[1]),"%lf/%lf", &sonardepthfilterlength, &sonardepthfilterdepth);
-				if (nscan == 1)
-					sonardepthfilterdepth = 20.0;
-				if (nscan >= 1)
-					sonardepthfilter = MB_YES;
-				else
-					sonardepthfilter = MB_NO;
-				}
-			flag++;
-			break;
-		case 'R':
-		case 'r':
-			if (nrangeoffset < 3)
-				{
-				sscanf (optarg,"%d/%d/%lf",
-					&rangeoffsetstart[nrangeoffset],
-					&rangeoffsetend[nrangeoffset],
-					&rangeoffset[nrangeoffset]);
-				nrangeoffset++;
-				}
-			flag++;
-			break;
-		case 'S':
-		case 's':
-			if (optarg[0] == 'C')
-				ss_source = R7KRECID_7kCalibratedSnippetData;
-			else if (optarg[0] == 'S')
-				ss_source = R7KRECID_7kV2SnippetData;
-			else if (optarg[0] == 'B')
-				ss_source = R7KRECID_7kBackscatterImageData;
-			else
-				sscanf (optarg,"%d", &ss_source);
-			flag++;
-			break;
-		case 'T':
-		case 't':
-			sscanf (optarg,"%s", buffer);
-			if ((fstat = stat(buffer, &file_status)) == 0
-				&& (file_status.st_mode & S_IFMT) != S_IFDIR)
-					{
-					timelagmode = MB7KPREPROCESS_TIMELAG_MODEL;
-					strcpy(timelagfile,buffer);
-					}
-			else if (strncmp(buffer, "USE_TIME_DELAY", 14) == 0)
-				{
-				timedelaymode = MB7KPREPROCESS_TIMEDELAY_ON;
-				}
-			else if (strncmp(buffer, "NO_TIME_DELAY", 13) == 0)
-				{
-				timedelaymode = MB7KPREPROCESS_TIMEDELAY_OFF;
-				}
-			else
-				{
-				sscanf (optarg,"%lf", &timelagconstant);
-				timelagmode = MB7KPREPROCESS_TIMELAG_CONSTANT;
-				}
-			flag++;
-			break;
-		case 'W':
-		case 'w':
-			sscanf (optarg,"%s", dslfile);
-			dsldata  = MB_YES;
-			flag++;
-			break;
-		case 'Z':
-		case 'z':
-			/* sonar_offsets */
-			if (strncmp("sonar_offsets=", optarg, 14) == 0)
-				{
-				n = sscanf(optarg, "sonar_offsets=%lf/%lf/%lf/%lf/%lf/%lf",
-					   &sonar_offset_x,&sonar_offset_y,&sonar_offset_z,
-					   &sonar_offset_heading,&sonar_offset_roll,&sonar_offset_pitch);
-				if (n == 6)
-					sonar_offset_mode = MB_YES;
-				}
-			
-			/* vru_offsets */
-			else if (strncmp("vru_offsets=", optarg, 12) == 0)
-				{
-				n = sscanf(optarg, "vru_offsets=%lf/%lf/%lf/%lf/%lf/%lf",
-					   &vru_offset_x,&vru_offset_y,&vru_offset_z,
-					   &vru_offset_heading,&vru_offset_roll,&vru_offset_pitch);
-				if (n == 6)
-					sonar_offset_mode = MB_YES;
-				}
-			
-			/* navigation_offsets */
-			else if (strncmp("navigation_offsets=", optarg, 19) == 0)
-				{
-				n = sscanf(optarg, "navigation_offsets=%lf/%lf/%lf/%lf/%lf/%lf",
-					   &navigation_offset_x,&navigation_offset_y,&navigation_offset_z,
-					   &navigation_offset_heading,&navigation_offset_roll,&navigation_offset_pitch);
-				if (n == 6)
-					sonar_offset_mode = MB_YES;
-				}
-			flag++;
-			break;
-		case '?':
-			errflg++;
-		}
-
-	/* if error flagged then print it and exit */
-	if (errflg)
-		{
-		fprintf(stderr,"usage: %s\n", usage_message);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		error = MB_ERROR_BAD_USAGE;
-		exit(error);
-		}
-
-	/* print starting message */
-	if (verbose == 1 || help)
-		{
-		fprintf(stderr,"\nProgram %s\n",program_name);
-		fprintf(stderr,"Version %s\n",rcs_id);
-		fprintf(stderr,"MB-system Version %s\n",MB_VERSION);
-		}
-
-	/* print starting debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  Program <%s>\n",program_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Control Parameters:\n");
-		fprintf(stderr,"dbg2       verbose:             %d\n",verbose);
-		fprintf(stderr,"dbg2       help:                %d\n",help);
-		fprintf(stderr,"dbg2       format:              %d\n",format);
-		fprintf(stderr,"dbg2       pings:               %d\n",pings);
-		fprintf(stderr,"dbg2       lonflip:             %d\n",lonflip);
-		fprintf(stderr,"dbg2       bounds[0]:           %f\n",bounds[0]);
-		fprintf(stderr,"dbg2       bounds[1]:           %f\n",bounds[1]);
-		fprintf(stderr,"dbg2       bounds[2]:           %f\n",bounds[2]);
-		fprintf(stderr,"dbg2       bounds[3]:           %f\n",bounds[3]);
-		fprintf(stderr,"dbg2       btime_i[0]:          %d\n",btime_i[0]);
-		fprintf(stderr,"dbg2       btime_i[1]:          %d\n",btime_i[1]);
-		fprintf(stderr,"dbg2       btime_i[2]:          %d\n",btime_i[2]);
-		fprintf(stderr,"dbg2       btime_i[3]:          %d\n",btime_i[3]);
-		fprintf(stderr,"dbg2       btime_i[4]:          %d\n",btime_i[4]);
-		fprintf(stderr,"dbg2       btime_i[5]:          %d\n",btime_i[5]);
-		fprintf(stderr,"dbg2       btime_i[6]:          %d\n",btime_i[6]);
-		fprintf(stderr,"dbg2       etime_i[0]:          %d\n",etime_i[0]);
-		fprintf(stderr,"dbg2       etime_i[1]:          %d\n",etime_i[1]);
-		fprintf(stderr,"dbg2       etime_i[2]:          %d\n",etime_i[2]);
-		fprintf(stderr,"dbg2       etime_i[3]:          %d\n",etime_i[3]);
-		fprintf(stderr,"dbg2       etime_i[4]:          %d\n",etime_i[4]);
-		fprintf(stderr,"dbg2       etime_i[5]:          %d\n",etime_i[5]);
-		fprintf(stderr,"dbg2       etime_i[6]:          %d\n",etime_i[6]);
-		fprintf(stderr,"dbg2       speedmin:            %f\n",speedmin);
-		fprintf(stderr,"dbg2       timegap:             %f\n",timegap);
-		fprintf(stderr,"dbg2       read_file:           %s\n",read_file);
-		fprintf(stderr,"dbg2       use_platform_file:   %d\n",use_platform_file);
-		fprintf(stderr,"dbg2       platform_file:       %s\n",platform_file);
-		fprintf(stderr,"dbg2       ofile:               %s\n",ofile);
-		fprintf(stderr,"dbg2       ofile_set:           %d\n",ofile_set);
-		fprintf(stderr,"dbg2       ss_source:           %d\n",ss_source);
-		fprintf(stderr,"dbg2       rockfile:            %s\n",rockfile);
-		fprintf(stderr,"dbg2       rockdata:            %d\n",rockdata);
-		fprintf(stderr,"dbg2       dslfile:             %s\n",dslfile);
-		fprintf(stderr,"dbg2       dsldata:             %d\n",dsldata);
-		fprintf(stderr,"dbg2       insfile:             %s\n",insfile);
-		fprintf(stderr,"dbg2       insdata:             %d\n",insdata);
-		fprintf(stderr,"dbg2       mode:                %d\n",mode);
-		fprintf(stderr,"dbg2       fix_time_stamps:     %d\n",fix_time_stamps);
-		fprintf(stderr,"dbg2       goodnavattitudeonly: %d\n",goodnavattitudeonly);
-		fprintf(stderr,"dbg2       timedelaymode:       %d\n",timedelaymode);
-		fprintf(stderr,"dbg2       timelagmode:         %d\n",timelagmode);
-		fprintf(stderr,"dbg2       kluge_useverticaldepth:        %d\n",kluge_useverticaldepth);
-		fprintf(stderr,"dbg2       kluge_zeroalongtrackangles:    %d\n",kluge_zeroalongtrackangles);
-		fprintf(stderr,"dbg2       kluge_zeroattitudecorrection:  %d\n",kluge_zeroattitudecorrection);
-		fprintf(stderr,"dbg2       kluge_kearfottrovnoise:        %d\n",kluge_useverticaldepth);
-		fprintf(stderr,"dbg2       kluge_beampatterntweak:        %d\n",kluge_useverticaldepth);
-		fprintf(stderr,"dbg2       kluge_beampatternfactor:       %f\n",kluge_beampatternfactor);
-		if (timelagmode == MB7KPREPROCESS_TIMELAG_MODEL)
-			{
-			fprintf(stderr,"dbg2       timelagfile:         %s\n",timelagfile);
-			fprintf(stderr,"dbg2       ntimelag:            %d\n",ntimelag);
-			}
-		else
-			{
-			fprintf(stderr,"dbg2       timelagconstant:     %f\n",timelagconstant);
-			}
-		fprintf(stderr,"dbg2       timelag:                %f\n",timelag);
-		fprintf(stderr,"dbg2       sonardepthfilter:       %d\n",sonardepthfilter);
-		fprintf(stderr,"dbg2       sonardepthfilterlength: %f\n",sonardepthfilterlength);
-		fprintf(stderr,"dbg2       sonardepthfilterdepth:  %f\n",sonardepthfilterdepth);
-		fprintf(stderr,"dbg2       sonardepthfile:         %s\n",sonardepthfile);
-		fprintf(stderr,"dbg2       sonardepthdata:         %d\n",sonardepthdata);
-		fprintf(stderr,"dbg2       sonardepthoffset:       %f\n",sonardepthoffset);
-		fprintf(stderr,"dbg2       depthsensoroffx:        %f\n",depthsensoroffx);
-		fprintf(stderr,"dbg2       depthsensoroffy:        %f\n",depthsensoroffy);
-		fprintf(stderr,"dbg2       depthsensoroffz:        %f\n",depthsensoroffz);
-		fprintf(stderr,"dbg2       sonar_offset_mode:          %d\n",sonar_offset_mode);
-		fprintf(stderr,"dbg2       sonar_offset_x:             %f\n",sonar_offset_x);
-		fprintf(stderr,"dbg2       sonar_offset_y:             %f\n",sonar_offset_y);
-		fprintf(stderr,"dbg2       sonar_offset_z:             %f\n",sonar_offset_z);
-		fprintf(stderr,"dbg2       sonar_offset_heading:       %f\n",sonar_offset_heading);
-		fprintf(stderr,"dbg2       sonar_offset_roll:          %f\n",sonar_offset_roll);
-		fprintf(stderr,"dbg2       sonar_offset_pitch:         %f\n",sonar_offset_pitch);
-		fprintf(stderr,"dbg2       vru_offset_mode:            %d\n",vru_offset_mode);
-		fprintf(stderr,"dbg2       vru_offset_x:               %f\n",vru_offset_x);
-		fprintf(stderr,"dbg2       vru_offset_y:               %f\n",vru_offset_y);
-		fprintf(stderr,"dbg2       vru_offset_z:               %f\n",vru_offset_z);
-		fprintf(stderr,"dbg2       vru_offset_heading:         %f\n",vru_offset_heading);
-		fprintf(stderr,"dbg2       vru_offset_roll:            %f\n",vru_offset_roll);
-		fprintf(stderr,"dbg2       vru_offset_pitch:           %f\n",vru_offset_pitch);
-		fprintf(stderr,"dbg2       navigation_offset_mode:     %d\n",navigation_offset_mode);
-		fprintf(stderr,"dbg2       navigation_offset_x:        %f\n",navigation_offset_x);
-		fprintf(stderr,"dbg2       navigation_offset_y:        %f\n",navigation_offset_y);
-		fprintf(stderr,"dbg2       navigation_offset_z:        %f\n",navigation_offset_z);
-		fprintf(stderr,"dbg2       navigation_offset_heading:  %f\n",navigation_offset_heading);
-		fprintf(stderr,"dbg2       navigation_offset_roll:     %f\n",navigation_offset_roll);
-		fprintf(stderr,"dbg2       navigation_offset_pitch:    %f\n",navigation_offset_pitch);
-		for (i=0;i<nrangeoffset;i++)
-			fprintf(stderr,"dbg2       rangeoffset[%d]:         %d %d %f\n",
-				i,rangeoffsetstart[i], rangeoffsetend[i], rangeoffset[i]);
-		}
-
-	/* if help desired then print it and exit */
-	if (help)
-		{
-		fprintf(stderr,"\n%s\n",help_message);
-		fprintf(stderr,"\nusage: %s\n", usage_message);
-		exit(error);
-		}
-
-	/* read navigation and attitude data from AUV log file if specified */
-	if (insdata == MB_YES)
-		{
-		/* count the data points in the auv log file */
-		if ((tfp = fopen(insfile, "r")) == NULL)
-			{
-			error = MB_ERROR_OPEN_FAIL;
-			fprintf(stderr,"\nUnable to open ins data file <%s> for reading\n",insfile);
-			fprintf(stderr,"\nProgram <%s> Terminated\n",
-				program_name);
-			exit(error);
-			}
-
-		/* read the ascii header to determine how to parse the binary data */
-		ins_len = 0;
-		while ((result = fgets(buffer,MB_PATH_MAXLINE,tfp)) == buffer
-			&& strncmp(buffer, "# begin",7) != 0)
-			{
-			nscan = sscanf(buffer, "# %s %s", type, value);
-			if (nscan == 2)
-				{
-				if (strcmp(value, "time") == 0)
-					ins_time_d_index = ins_len;
-				if (strcmp(value, "mLonK") == 0)
-					ins_lon_index = ins_len;
-				if (strcmp(value, "mLatK") == 0)
-					ins_lat_index = ins_len;
-				if (strcmp(value, "longitude") == 0)
-					ins_lon_index = ins_len;
-				if (strcmp(value, "latitude") == 0)
-					ins_lat_index = ins_len;
-				if (strcmp(value, "mPhi") == 0)
-					ins_roll_index = ins_len;
-				if (strcmp(value, "mTheta") == 0)
-					ins_pitch_index = ins_len;
-				if (strcmp(value, "mPsi") == 0)
-					ins_heading_index = ins_len;
-				if (strcmp(value, "mDepth") == 0)
-					ins_sonardepth_index = ins_len;
-				if (strcmp(value, "mDepthK") == 0)
-					ins_sonardepth_index = ins_len;
-				if (strcmp(value, "mRollK") == 0)
-					ins_roll_index = ins_len;
-				if (strcmp(value, "mPitchK") == 0)
-					ins_pitch_index = ins_len;
-				if (strcmp(value, "mHeadK") == 0)
-					ins_heading_index = ins_len;
-				if (strcmp(value, "mAltitude") == 0)
-					ins_altitude_index = ins_len;
-				if (strcmp(value, "mWaterSpeed") == 0)
-					ins_speed_index = ins_len;
-				if (strcmp(value, "mVbodyxK") == 0)
-					ins_velocityx_index = ins_len;
-				if (strcmp(value, "mVbodyyK") == 0)
-					ins_velocityy_index = ins_len;
-				if (strcmp(value, "mVbodyzK") == 0)
-					ins_velocityz_index = ins_len;
-
-				if (strcmp(type, "double") == 0)
-					ins_len += 8;
-				else if (strcmp(type, "integer") == 0)
-					ins_len += 4;
-				else if (strcmp(type, "timeTag") == 0)
-					ins_len += 8;
-				}
-			}
-
-		/* count the binary data records described by the header
-			then rewind the file to the start of the binary data */
-		startdata = ftell(tfp);
-		nins = 0;
-		while (fread(buffer, ins_len, 1, tfp) == 1)
-			{
-			nins++;
-			}
-		fseek(tfp, startdata, 0);
-
-		/* allocate arrays for ins data */
-		if (nins > 0)
-		    {
-		    status = mb_mallocd(verbose, __FILE__, __LINE__, nins * sizeof(double), (void **)&ins_time_d,&error);
-		    if (error == MB_ERROR_NO_ERROR)
-		    	status = mb_mallocd(verbose, __FILE__, __LINE__, nins * sizeof(double), (void **)&ins_lon,&error);
-		    if (error == MB_ERROR_NO_ERROR)
-		    	status = mb_mallocd(verbose, __FILE__, __LINE__, nins * sizeof(double), (void **)&ins_lat,&error);
-		    if (error == MB_ERROR_NO_ERROR)
-		    	status = mb_mallocd(verbose, __FILE__, __LINE__, nins * sizeof(double), (void **)&ins_heading,&error);
-		    if (error == MB_ERROR_NO_ERROR)
-		    	status = mb_mallocd(verbose, __FILE__, __LINE__, nins * sizeof(double), (void **)&ins_roll,&error);
-		    if (error == MB_ERROR_NO_ERROR)
-		    	status = mb_mallocd(verbose, __FILE__, __LINE__, nins * sizeof(double), (void **)&ins_pitch,&error);
-		    if (error == MB_ERROR_NO_ERROR)
-		    	status = mb_mallocd(verbose, __FILE__, __LINE__, nins * sizeof(double), (void **)&ins_sonardepth,&error);
-		    if (error == MB_ERROR_NO_ERROR)
-		    	status = mb_mallocd(verbose, __FILE__, __LINE__, nins * sizeof(double), (void **)&ins_sonardepthfilter,&error);
-		    if (error == MB_ERROR_NO_ERROR)
-		    	status = mb_mallocd(verbose, __FILE__, __LINE__, nins * sizeof(double), (void **)&ins_altitude_time_d,&error);
-		    if (error == MB_ERROR_NO_ERROR)
-		    	status = mb_mallocd(verbose, __FILE__, __LINE__, nins * sizeof(double), (void **)&ins_altitude,&error);
-		    if (error == MB_ERROR_NO_ERROR)
-		    	status = mb_mallocd(verbose, __FILE__, __LINE__, nins * sizeof(double), (void **)&ins_speed_time_d,&error);
-		    if (error == MB_ERROR_NO_ERROR)
-		    	status = mb_mallocd(verbose, __FILE__, __LINE__, nins * sizeof(double), (void **)&ins_speed,&error);
-		    if (error != MB_ERROR_NO_ERROR)
-			{
-			mb_error(verbose,error,&message);
-			fprintf(stderr,"\nMBIO Error allocating ins data arrays:\n%s\n",message);
-			fprintf(stderr,"\nProgram <%s> Terminated\n",
-				program_name);
-			exit(error);
-			}
-		    }
-
-		/* if no ins data then quit */
-		else
-		    {
-		    error = MB_ERROR_BAD_DATA;
-		    fprintf(stderr,"\nUnable to read data from MBARI AUV navigation file <%s>\n",insfile);
-		    fprintf(stderr,"\nProgram <%s> Terminated\n",
-			    program_name);
-		    exit(error);
-		    }
-
-		/* read the data points in the auv log file */
-		nins = 0;
-		nins_altitude = 0;
-		nins_speed = 0;
-		while (fread(buffer, ins_len, 1, tfp) == 1)
-			{
-			if (ins_time_d_index >= 0)
-				mb_get_binary_double(MB_YES, &buffer[ins_time_d_index], &(ins_time_d[nins]));
-
-			if (ins_lon_index >= 0)
-				mb_get_binary_double(MB_YES, &buffer[ins_lon_index], &(ins_lon[nins]));
-			ins_lon[nins] *= RTD;
-
-			if (ins_lat_index >= 0)
-				mb_get_binary_double(MB_YES, &buffer[ins_lat_index], &(ins_lat[nins]));
-			ins_lat[nins] *= RTD;
-
-			if (ins_roll_index >= 0)
-				mb_get_binary_double(MB_YES, &buffer[ins_roll_index], &(ins_roll[nins]));
-			ins_roll[nins] *= RTD;
-
-			if (ins_pitch_index >= 0)
-				mb_get_binary_double(MB_YES, &buffer[ins_pitch_index], &(ins_pitch[nins]));
-			ins_pitch[nins] *= RTD;
-
-			if (ins_heading_index >= 0)
-				mb_get_binary_double(MB_YES, &buffer[ins_heading_index], &(ins_heading[nins]));
-			ins_heading[nins] *= RTD;
-
-			if (ins_sonardepth_index >= 0)
-				mb_get_binary_double(MB_YES, &buffer[ins_sonardepth_index], &(ins_sonardepth[nins]));
-			ins_sonardepth[nins] += sonardepthoffset;
-
-			if (ins_altitude_index >= 0)
-				mb_get_binary_double(MB_YES, &buffer[ins_altitude_index], &(ins_altitude[nins_altitude]));
-			ins_altitude_time_d[nins_altitude] = ins_time_d[nins];
-
-			if (ins_speed_index >= 0)
-				mb_get_binary_double(MB_YES, &buffer[ins_speed_index], &(ins_speed[nins_speed]));
-			ins_speed_time_d[nins_speed] = ins_time_d[nins];
-
-			if (ins_velocityx_index >= 0 && ins_velocityy_index >= 0)
-				{
-				mb_get_binary_double(MB_YES, &buffer[ins_velocityx_index], &velocityx);
-				mb_get_binary_double(MB_YES, &buffer[ins_velocityy_index], &velocityy);
-				ins_speed[nins_speed] = sqrt(velocityx * velocityx + velocityy * velocityy);
-				ins_speed_time_d[nins_speed] = ins_time_d[nins];
-				}
-/*fprintf(stderr,"INS DATA: %f %f %f %f %f %f %f %f %f\n",
-ins_time_d[nins],
-ins_lon[nins],
-ins_lat[nins],
-ins_roll[nins],
-ins_pitch[nins],
-ins_heading[nins],
-ins_sonardepth[nins],
-ins_altitude[nins],
-ins_speed[nins]);*/
-			nins++;
-			if (ins_altitude[nins_altitude] < 1000.0)
-				nins_altitude++;
-			if (ins_speed[nins_speed] > 0.0)
-				nins_speed++;
-			}
-		fclose(tfp);
-
-		/* output info */
-		if (nins > 0)
-			{
-			mb_get_date(verbose, ins_time_d[0], btime_i);
-			mb_get_date(verbose, ins_time_d[nins-1], etime_i);
-			fprintf(stderr, "%d INS data records read from %s  Start:%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d  End:%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d\n",
-					nins, insfile,
-					btime_i[0], btime_i[1], btime_i[2], btime_i[3], btime_i[4], btime_i[5], btime_i[6],
-					etime_i[0], etime_i[1], etime_i[2], etime_i[3], etime_i[4], etime_i[5], etime_i[6]);
-			}
-		else
-			fprintf(stderr, "No INS data read from %s....\n",insfile);
-		}
-
-	/* read navigation and attitude data from rock file if specified */
-	if (rockdata == MB_YES)
-		{
-		/* count the data points in the rock file */
-		if ((tfp = fopen(rockfile, "r")) == NULL)
-			{
-			error = MB_ERROR_OPEN_FAIL;
-			fprintf(stderr,"\nUnable to open rock data file <%s> for reading\n",rockfile);
-			fprintf(stderr,"\nProgram <%s> Terminated\n",
-				program_name);
-			exit(error);
-			}
-
-		/* count the data records */
-		nrock = 0;
-		while ((result = fgets(buffer,MB_PATH_MAXLINE,tfp)) == buffer)
-			if (buffer[0] != '#')
-			    nrock++;
-		rewind(tfp);
-
-		/* allocate arrays for rock data */
-		if (nrock > 0)
-		    {
-		    status = mb_mallocd(verbose, __FILE__, __LINE__, nrock * sizeof(double), (void **)&rock_time_d,&error);
-		    if (error == MB_ERROR_NO_ERROR)
-		    	status = mb_mallocd(verbose, __FILE__, __LINE__, nrock * sizeof(double), (void **)&rock_lon,&error);
-		    if (error == MB_ERROR_NO_ERROR)
-		    	status = mb_mallocd(verbose, __FILE__, __LINE__, nrock * sizeof(double), (void **)&rock_lat,&error);
-		    if (error == MB_ERROR_NO_ERROR)
-		    	status = mb_mallocd(verbose, __FILE__, __LINE__, nrock * sizeof(double), (void **)&rock_sonardepth,&error);
-		    if (error == MB_ERROR_NO_ERROR)
-		    	status = mb_mallocd(verbose, __FILE__, __LINE__, nrock * sizeof(double), (void **)&rock_sonardepthfilter,&error);
-		    if (error == MB_ERROR_NO_ERROR)
-		    	status = mb_mallocd(verbose, __FILE__, __LINE__, nrock * sizeof(double), (void **)&rock_heading,&error);
-		    if (error == MB_ERROR_NO_ERROR)
-		    	status = mb_mallocd(verbose, __FILE__, __LINE__, nrock * sizeof(double), (void **)&rock_roll,&error);
-		    if (error == MB_ERROR_NO_ERROR)
-		    	status = mb_mallocd(verbose, __FILE__, __LINE__, nrock * sizeof(double), (void **)&rock_pitch,&error);
-		    if (error != MB_ERROR_NO_ERROR)
-			{
-			mb_error(verbose,error,&message);
-			fprintf(stderr,"\nMBIO Error allocating rock data arrays:\n%s\n",message);
-			fprintf(stderr,"\nProgram <%s> Terminated\n",
-				program_name);
-			exit(error);
-			}
-		    }
-
-		/* if no rock data then quit */
-		else
-		    {
-		    error = MB_ERROR_BAD_DATA;
-		    fprintf(stderr,"\nUnable to read data from rock file <%s>\n",rockfile);
-		    fprintf(stderr,"\nProgram <%s> Terminated\n",
-			    program_name);
-		    exit(error);
-		    }
-
-		/* read the data points in the rock file */
-		nrock = 0;
-		while ((result = fgets(buffer,MB_PATH_MAXLINE,tfp)) == buffer)
-			{
-			if (buffer[0] != '#')
-			    if (sscanf(buffer,"%lf %lf %lf %lf %lf %lf %lf",
-					&rock_time_d[nrock], &rock_lon[nrock], &rock_lat[nrock], &rock_sonardepth[nrock],
-					&rock_heading[nrock], &rock_roll[nrock], &rock_pitch[nrock]) == 7)
-			    	{
-/*fprintf(stderr,"ROCK DATA: %f %f %f %f %f %f\n",
-rock_time_d[nrock],
-rock_lon[nrock],
-rock_lat[nrock],
-rock_sonardepth[nrock],
-rock_heading[nrock],
-rock_roll[nrock],
-rock_pitch[nrock],
-rock_heading[nrock]);*/
-			    	nrock++;
-				}
-			}
-		fclose(tfp);
-
-		/* output info */
-		if (nrock > 0)
-			{
-			mb_get_date(verbose, rock_time_d[0], btime_i);
-			mb_get_date(verbose, rock_time_d[nrock-1], etime_i);
-			fprintf(stderr, "%d Rock format nav records read from %s  Start:%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d  End:%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d\n",
-					nrock, rockfile,
-					btime_i[0], btime_i[1], btime_i[2], btime_i[3], btime_i[4], btime_i[5], btime_i[6],
-					etime_i[0], etime_i[1], etime_i[2], etime_i[3], etime_i[4], etime_i[5], etime_i[6]);
-			}
-		else
-			fprintf(stderr, "No Rock format nav data read from %s....\n",rockfile);
-		}
-
-	/* read navigation and attitude data from dsl file if specified */
-	if (dsldata == MB_YES)
-		{
-		/* count the data points in the dsl file */
-		if ((tfp = fopen(dslfile, "r")) == NULL)
-			{
-			error = MB_ERROR_OPEN_FAIL;
-			fprintf(stderr,"\nUnable to open dsl data file <%s> for reading\n",dslfile);
-			fprintf(stderr,"\nProgram <%s> Terminated\n",
-				program_name);
-			exit(error);
-			}
-
-		/* count the data records */
-		ndsl = 0;
-		while ((result = fgets(buffer,MB_PATH_MAXLINE,tfp)) == buffer)
-			if (buffer[0] != '#')
-			    ndsl++;
-		rewind(tfp);
-
-		/* allocate arrays for dsl data */
-		if (ndsl > 0)
-		    {
-		    status = mb_mallocd(verbose, __FILE__, __LINE__, ndsl * sizeof(double), (void **)&dsl_time_d,&error);
-		    if (error == MB_ERROR_NO_ERROR)
-		    	status = mb_mallocd(verbose, __FILE__, __LINE__, ndsl * sizeof(double), (void **)&dsl_lon,&error);
-		    if (error == MB_ERROR_NO_ERROR)
-		    	status = mb_mallocd(verbose, __FILE__, __LINE__, ndsl * sizeof(double), (void **)&dsl_lat,&error);
-		    if (error == MB_ERROR_NO_ERROR)
-		    	status = mb_mallocd(verbose, __FILE__, __LINE__, ndsl * sizeof(double), (void **)&dsl_sonardepth,&error);
-		    if (error == MB_ERROR_NO_ERROR)
-		    	status = mb_mallocd(verbose, __FILE__, __LINE__, ndsl * sizeof(double), (void **)&dsl_sonardepthfilter,&error);
-		    if (error == MB_ERROR_NO_ERROR)
-		    	status = mb_mallocd(verbose, __FILE__, __LINE__, ndsl * sizeof(double), (void **)&dsl_heading,&error);
-		    if (error == MB_ERROR_NO_ERROR)
-		    	status = mb_mallocd(verbose, __FILE__, __LINE__, ndsl * sizeof(double), (void **)&dsl_roll,&error);
-		    if (error == MB_ERROR_NO_ERROR)
-		    	status = mb_mallocd(verbose, __FILE__, __LINE__, ndsl * sizeof(double), (void **)&dsl_pitch,&error);
-		    if (error != MB_ERROR_NO_ERROR)
-			{
-			mb_error(verbose,error,&message);
-			fprintf(stderr,"\nMBIO Error allocating dsl data arrays:\n%s\n",message);
-			fprintf(stderr,"\nProgram <%s> Terminated\n",
-				program_name);
-			exit(error);
-			}
-		    }
-
-		/* if no dsl data then quit */
-		else
-		    {
-		    error = MB_ERROR_BAD_DATA;
-		    fprintf(stderr,"\nUnable to read data from dsl file <%s>\n",dslfile);
-		    fprintf(stderr,"\nProgram <%s> Terminated\n",
-			    program_name);
-		    exit(error);
-		    }
-
-		/* read the data points in the dsl file */
-		ndsl = 0;
-		while ((result = fgets(buffer,MB_PATH_MAXLINE,tfp)) == buffer)
-			{
-			if (buffer[0] != '#')
-			    {
-			    nscan = sscanf(buffer,"PPL %d/%d/%d %d:%d:%lf %s %lf %lf %lf %lf %lf %lf %lf",
-			    		&year, &month, &day, &hour, &minute, &second,
-					sensor, &dsl_lat[ndsl], &dsl_lon[ndsl], &dsl_sonardepth[ndsl],
-					&dsl_heading[ndsl], &dsl_pitch[ndsl], &dsl_roll[ndsl], &id);
-/* fprintf(stderr,"nscan:%d year:%d month:%d day:%d hour:%d minute:%d second:%f sensor:%s %f %f %f %f %f %f %f\n",
-nscan,year,month,day,hour,minute,second,sensor,dsl_lat[ndsl], dsl_lon[ndsl], dsl_sonardepth[ndsl],
-dsl_heading[ndsl], dsl_pitch[ndsl], dsl_roll[ndsl], id); */
-			    if (nscan == 14)
-			    	{
-				time_i[0] = year;
-				time_i[1] = month;
-				time_i[2] = day;
-				time_i[3] = hour;
-				time_i[4] = minute;
-				time_i[5] = (int)second;
-				time_i[6] = (int)((second - time_i[5]) * 1000000);
-				mb_get_time(verbose, time_i, &dsl_time_d[ndsl]);
-/* fprintf(stderr,"dsl DATA: %f %f %f %f %f %f %f %f\n",
-dsl_time_d[ndsl],
-dsl_lon[ndsl],
-dsl_lat[ndsl],
-dsl_sonardepth[ndsl],
-dsl_heading[ndsl],
-dsl_roll[ndsl],
-dsl_pitch[ndsl],
-dsl_heading[ndsl]); */
-			    	ndsl++;
-				}
-			    }
-			}
-		fclose(tfp);
-
-		/* output info */
-		if (ndsl > 0)
-			{
-			mb_get_date(verbose, dsl_time_d[0], btime_i);
-			mb_get_date(verbose, dsl_time_d[ndsl-1], etime_i);
-			fprintf(stderr, "%d DLS format nav records read from %s  Start:%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d  End:%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d\n",
-					ndsl, dslfile,
-					btime_i[0], btime_i[1], btime_i[2], btime_i[3], btime_i[4], btime_i[5], btime_i[6],
-					etime_i[0], etime_i[1], etime_i[2], etime_i[3], etime_i[4], etime_i[5], etime_i[6]);
-			}
-		else
-			fprintf(stderr, "No DSL format nav data read from %s....\n",dslfile);
-		}
-
-	/* read sonardepth data from AUV log file if specified */
-	if (sonardepthdata == MB_YES)
-		{
-		/* count the data points in the auv log file */
-		if ((tfp = fopen(sonardepthfile, "r")) == NULL)
-			{
-			error = MB_ERROR_OPEN_FAIL;
-			fprintf(stderr,"\nUnable to open sonardepth data file <%s> for reading\n",sonardepthfile);
-			fprintf(stderr,"\nProgram <%s> Terminated\n",
-				program_name);
-			exit(error);
-			}
-
-		/* read the ascii header to determine how to parse the binary data */
-		sonardepth_len = 0;
-		while ((result = fgets(buffer,MB_PATH_MAXLINE,tfp)) == buffer
-			&& strncmp(buffer, "# begin",7) != 0)
-			{
-			nscan = sscanf(buffer, "# %s %s", type, value);
-			if (nscan == 2)
-				{
-				if (strcmp(value, "time") == 0)
-					sonardepth_time_d_index = sonardepth_len;
-				if (strcmp(value, "depth") == 0)
-					sonardepth_sonardepth_index = sonardepth_len;
-
-				if (strcmp(type, "double") == 0)
-					sonardepth_len += 8;
-				else if (strcmp(type, "integer") == 0)
-					sonardepth_len += 4;
-				else if (strcmp(type, "timeTag") == 0)
-					sonardepth_len += 8;
-				}
-			}
-
-		/* count the binary data records described by the header
-			then rewind the file to the start of the binary data */
-		startdata = ftell(tfp);
-		nsonardepth = 0;
-		while (fread(buffer, sonardepth_len, 1, tfp) == 1)
-			{
-			nsonardepth++;
-			}
-		fseek(tfp, startdata, 0);
-
-		/* allocate arrays for sonardepth data */
-		if (nsonardepth > 0)
-		    {
-		    status = mb_mallocd(verbose, __FILE__, __LINE__, nsonardepth * sizeof(double), (void **)&sonardepth_time_d,&error);
-		    if (error == MB_ERROR_NO_ERROR)
-		    	status = mb_mallocd(verbose, __FILE__, __LINE__, nsonardepth * sizeof(double), (void **)&sonardepth_sonardepth,&error);
-		    if (error == MB_ERROR_NO_ERROR)
-		    	status = mb_mallocd(verbose, __FILE__, __LINE__, nsonardepth * sizeof(double), (void **)&sonardepth_sonardepthfilter,&error);
-		    if (error != MB_ERROR_NO_ERROR)
-			{
-			mb_error(verbose,error,&message);
-			fprintf(stderr,"\nMBIO Error allocating sonardepth data arrays:\n%s\n",message);
-			fprintf(stderr,"\nProgram <%s> Terminated\n",
-				program_name);
-			exit(error);
-			}
-		    }
-
-		/* if no sonardepth data then quit */
-		else
-		    {
-		    error = MB_ERROR_BAD_DATA;
-		    fprintf(stderr,"\nUnable to read data from MBARI AUV sonardepth file <%s>\n",sonardepthfile);
-		    fprintf(stderr,"\nProgram <%s> Terminated\n",
-			    program_name);
-		    exit(error);
-		    }
-
-		/* read the data points in the auv log file */
-		nsonardepth = 0;
-		while (fread(buffer, sonardepth_len, 1, tfp) == 1)
-			{
-			mb_get_binary_double(MB_YES, &buffer[sonardepth_time_d_index], &(sonardepth_time_d[nsonardepth]));
-			mb_get_binary_double(MB_YES, &buffer[sonardepth_sonardepth_index], &(sonardepth_sonardepth[nsonardepth]));
-/*fprintf(stderr,"SONARDEPTH DATA: %f %f\n",
-sonardepth_time_d[nsonardepth],
-sonardepth_sonardepth[nsonardepth]);*/
-			sonardepth_sonardepth[nsonardepth] += sonardepthoffset;
-			nsonardepth++;
-			}
-		fclose(tfp);
-
-		/* output info */
-		if (nsonardepth > 0)
-			{
-			mb_get_date(verbose, sonardepth_time_d[0], btime_i);
-			mb_get_date(verbose, sonardepth_time_d[nsonardepth-1], etime_i);
-			fprintf(stderr, "%d sonardepth records read from %s  Start:%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d  End:%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d\n",
-					nsonardepth, sonardepthfile,
-					btime_i[0], btime_i[1], btime_i[2], btime_i[3], btime_i[4], btime_i[5], btime_i[6],
-					etime_i[0], etime_i[1], etime_i[2], etime_i[3], etime_i[4], etime_i[5], etime_i[6]);
-			}
-		else
-			fprintf(stderr, "No sonardepth data read from %s....\n",sonardepthfile);
-		}
-
-	/* get time lag model if specified */
-	if (timelagmode == MB7KPREPROCESS_TIMELAG_MODEL)
-		{
-		/* count the data points in the timelag file */
-		ntimelag = 0;
-		if ((tfp = fopen(timelagfile, "r")) == NULL)
-			{
-			error = MB_ERROR_OPEN_FAIL;
-			fprintf(stderr,"\nUnable to open time lag model File <%s> for reading\n",timelagfile);
-			fprintf(stderr,"\nProgram <%s> Terminated\n",
-				program_name);
-			exit(error);
-			}
-		while ((result = fgets(buffer,MB_PATH_MAXLINE,tfp)) == buffer)
-			if (buffer[0] != '#')
-			    ntimelag++;
-		rewind(tfp);
-
-		/* allocate arrays for time lag */
-		if (ntimelag > 0)
-		    {
-		    status = mb_mallocd(verbose, __FILE__, __LINE__,ntimelag * sizeof(double), (void **)&timelag_time_d,&error);
-		    if (error == MB_ERROR_NO_ERROR)
-		    	status = mb_mallocd(verbose, __FILE__, __LINE__,ntimelag * sizeof(double), (void **)&timelag_model,&error);
-		    if (error != MB_ERROR_NO_ERROR)
-			{
-			mb_error(verbose,error,&message);
-			fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",message);
-			fprintf(stderr,"\nProgram <%s> Terminated\n",
-				program_name);
-			exit(error);
-			}
-		    }
-
-		/* if no time lag data then quit */
-		else
-		    {
-		    error = MB_ERROR_BAD_DATA;
-		    fprintf(stderr,"\nUnable to read data from time lag model file <%s>\n",timelagfile);
-		    fprintf(stderr,"\nProgram <%s> Terminated\n",
-			    program_name);
-		    exit(error);
-		    }
-
-		/* read the data points in the timelag file */
-		ntimelag = 0;
-		while ((result = fgets(buffer,MB_PATH_MAXLINE,tfp)) == buffer)
-		    {
-		    if (buffer[0] != '#')
-			{
-			/* read the time and time lag pair */
-			if (sscanf(buffer,"%lf %lf",&timelag_time_d[ntimelag],&timelag_model[ntimelag]) == 2)
-			    ntimelag++;
-			}
-		    }
-		fclose(tfp);
-
-		/* output info */
-		if (ntimelag > 0)
-			{
-			mb_get_date(verbose, timelag_time_d[0], btime_i);
-			mb_get_date(verbose, timelag_time_d[ntimelag-1], etime_i);
-			fprintf(stderr, "%d timelag records read from %s  Start:%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d  End:%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d\n",
-					ntimelag, timelagfile,
-					btime_i[0], btime_i[1], btime_i[2], btime_i[3], btime_i[4], btime_i[5], btime_i[6],
-					etime_i[0], etime_i[1], etime_i[2], etime_i[3], etime_i[4], etime_i[5], etime_i[6]);
-			}
-		else
-			fprintf(stderr, "No timelag data read from %s....\n",timelagfile);
-		}
-
-	/* null tfp - allows detection of whether time delay file was opened, which only happens for MBARI AUV
-		data with navigation and attitude in "bluefin" records */
-	tfp = NULL;
-	
-	/* load platform definition if specified or if offsets otherwise specified create a platform structure */
-	if (use_platform_file == MB_YES)
-		{
-		status = mb_platform_read(verbose, platform_file, (void **)&platform, &error);
-		if (status == MB_FAILURE)
-			{
-			error = MB_ERROR_OPEN_FAIL;
-			fprintf(stderr,"\nUnable to open and parse platform file: %s\n", platform_file);
-			fprintf(stderr,"\nProgram <%s> Terminated\n", program_name);
-			exit(error);				
-			}
-		}
-	else if (use_depthsensoroff == MB_YES || sonar_offset_mode == MB_YES)
-		{
-		status = mb_platform_init(verbose, MB_PLATFORM_NONE, NULL, NULL,
-						0, 1, 2, 3, 3, 3, 
-						(void **)&platform, &error);
-			
-		/* set sensor 0 (multibeam) */
-		if (status == MB_SUCCESS)
-			status = mb_platform_add_sensor(verbose, (void **)&platform,
-					MB_SENSOR_TYPE_SONAR_MULTIBEAM,
-					NULL,
-					NULL,
-					NULL,
-					0, 0,
-					1, 0,
-					&error);
-		if (status == MB_SUCCESS)
-			status = mb_platform_add_sensor_offset(verbose, (void **)&platform,
-					0, 0,
-					MB7KPREPROCESS_TIMELAG_OFF,
-					0.0,
-					0,
-					NULL,
-					NULL,
-					sonar_offset_mode,
-					sonar_offset_x,
-					sonar_offset_y,
-					sonar_offset_z,   
-					sonar_offset_mode,
-					sonar_offset_heading,
-					sonar_offset_roll,
-					sonar_offset_pitch,
-					&error);
-			
-		/* set sensor 1 (position) */
-		if (status == MB_SUCCESS)
-			status = mb_platform_add_sensor(verbose, (void **)&platform,
-					MB_SENSOR_TYPE_POSITION,
-					NULL,
-					NULL,
-					NULL,
-					0, 0,
-					1, ntimelag,
-					&error);
-		if (status == MB_SUCCESS)
-			status = mb_platform_add_sensor_offset(verbose, (void **)&platform,
-					1, 0,
-					timelagmode,
-					timelagconstant,
-					ntimelag,
-					timelag_time_d,
-					timelag_model,
-					navigation_offset_mode,
-					navigation_offset_x,
-					navigation_offset_y,
-					navigation_offset_z,   
-					navigation_offset_mode,
-					navigation_offset_heading,
-					navigation_offset_roll,
-					navigation_offset_pitch,
-					&error);
-			
-		/* set sensor 2 (sensor depth) */
-		if (status == MB_SUCCESS)
-			status = mb_platform_add_sensor(verbose, (void **)&platform,
-					MB_SENSOR_TYPE_POSITION,
-					NULL,
-					NULL,
-					NULL,
-					0, 0,
-					1, ntimelag,
-					&error);
-		if (status == MB_SUCCESS)
-			status = mb_platform_add_sensor_offset(verbose, (void **)&platform,
-					2, 0,
-					timelagmode,
-					timelagconstant,
-					ntimelag,
-					timelag_time_d,
-					timelag_model,
-					use_depthsensoroff,
-					depthsensoroffx,
-					depthsensoroffy,
-					depthsensoroffz,   
-					0,
-					0.0,
-					0.0,
-					0.0,
-					&error);
-			
-		/* set sensor 3 (attitude) */
-		if (status == MB_SUCCESS)
-			status = mb_platform_add_sensor(verbose, (void **)&platform,
-					MB_SENSOR_TYPE_VRU,
-					NULL,
-					NULL,
-					NULL,
-					0, 0,
-					1, ntimelag,
-					&error);
-		if (status == MB_SUCCESS)
-			status = mb_platform_add_sensor_offset(verbose, (void **)&platform,
-					3, 0,
-					timelagmode,
-					timelagconstant,
-					ntimelag,
-					timelag_time_d,
-					timelag_model,
-					vru_offset_mode,
-					vru_offset_x,
-					vru_offset_y,
-					vru_offset_z,   
-					vru_offset_mode,
-					vru_offset_heading,
-					vru_offset_roll,
-					vru_offset_pitch,
-					&error);
-		
-		/* deal with error */
-		if (status == MB_FAILURE)
-			{
-			error = MB_ERROR_OPEN_FAIL;
-			fprintf(stderr,"\nUnable to initialize platform offset structure\n");
-			fprintf(stderr,"\nProgram <%s> Terminated\n", program_name);
-			exit(error);				
-			}
-		}
-
-	/* get format if required */
-	if (format == 0)
-		mb_get_format(verbose,read_file,NULL,&format,&error);
-
-	/* determine whether to read one file or a list of files */
-	if (format < 0)
-		read_datalist = MB_YES;
-
-	/* open file list */
-	if (read_datalist == MB_YES)
-	    {
-	    if ((status = mb_datalist_open(verbose,&datalist,
-					    read_file,look_processed,&error)) != MB_SUCCESS)
-		{
-		error = MB_ERROR_OPEN_FAIL;
-		fprintf(stderr,"\nUnable to open data list file: %s\n",
-			read_file);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-	    if ((status = mb_datalist_read(verbose,datalist,
-			    ifile,&format,&file_weight,&error))
-			    == MB_SUCCESS)
-		read_data = MB_YES;
-	    else
-		read_data = MB_NO;
-	    }
-	/* else copy single filename to be read */
-	else
-	    {
-	    strcpy(ifile, read_file);
-	    read_data = MB_YES;
-	    }
-
-	/* loop over all files to be read */
-	while (read_data == MB_YES && format == MBF_RESON7KR)
-	{
-
-	/* initialize reading the swath file */
-	if ((status = mb_read_init(
-		verbose,ifile,format,pings,lonflip,bounds,
-		btime_i,etime_i,speedmin,timegap,
-		&imbio_ptr,&btime_d,&etime_d,
-		&beams_bath,&beams_amp,&pixels_ss,&error)) != MB_SUCCESS)
-		{
-		mb_error(verbose,error,&message);
-		fprintf(stderr,"\nMBIO Error returned from function <mb_read_init>:\n%s\n",message);
-		fprintf(stderr,"\nMultibeam File <%s> not initialized for reading\n",ifile);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-
-	/* get pointers to data storage */
-	imb_io_ptr = (struct mb_io_struct *) imbio_ptr;
-	istore_ptr = imb_io_ptr->store_data;
-	istore = (struct mbsys_reson7k_struct *) istore_ptr;
-
-	if (error == MB_ERROR_NO_ERROR)
-		{
-		beamflag = NULL;
-		bath = NULL;
-		amp = NULL;
-		bathacrosstrack = NULL;
-		bathalongtrack = NULL;
-		ss = NULL;
-		ssacrosstrack = NULL;
-		ssalongtrack = NULL;
-		}
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(char), (void **)&beamflag, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(double), (void **)&bath, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_AMPLITUDE,
-						sizeof(double), (void **)&amp, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(double), (void **)&bathacrosstrack, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(double), (void **)&bathalongtrack, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_SIDESCAN,
-						sizeof(double), (void **)&ss, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_SIDESCAN,
-						sizeof(double), (void **)&ssacrosstrack, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_SIDESCAN,
-						sizeof(double), (void **)&ssalongtrack, &error);
-
-	/* if error initializing memory then quit */
-	if (error != MB_ERROR_NO_ERROR)
-		{
-		mb_error(verbose,error,&message);
-		fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",
-			message);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-
-	/* reset file record counters */
-	nrec_reference = 0;
-	nrec_sensoruncal = 0;
-	nrec_sensorcal = 0;
-	nrec_position = 0;
-	nrec_customattitude = 0;
-	nrec_tide = 0;
-	nrec_altitude = 0;
-	nrec_motion = 0;
-	nrec_depth = 0;
-	nrec_svp = 0;
-	nrec_ctd = 0;
-	nrec_geodesy = 0;
-	nrec_rollpitchheave = 0;
-	nrec_heading = 0;
-	nrec_surveyline = 0;
-	nrec_navigation = 0;
-	nrec_attitude = 0;
-	nrec_fsdwsslo = 0;
-	nrec_fsdwsshi = 0;
-	nrec_fsdwsbp = 0;
-	nrec_bluefinnav = 0;
-	nrec_bluefinenv = 0;
-	nrec_multibeam = 0;
-	nrec_volatilesettings = 0;
-	nrec_configuration = 0;
-	nrec_matchfilter = 0;
-	nrec_beamgeometry = 0;
-	nrec_calibration = 0;
-	nrec_bathymetry = 0;
-	nrec_backscatter = 0;
-	nrec_beam = 0;
-	nrec_verticaldepth = 0;
-	nrec_image = 0;
-	nrec_v2pingmotion = 0;
-	nrec_v2detectionsetup = 0;
-	nrec_v2beamformed = 0;
-	nrec_v2detection = 0;
-	nrec_v2rawdetection = 0;
-	nrec_v2snippet = 0;
-	nrec_calibratedsnippet = 0;
-	nrec_processedsidescan = 0;
-	nrec_installation = 0;
-	nrec_systemeventmessage = 0;
-	nrec_fileheader = 0;
-	nrec_remotecontrolsettings = 0;
-	nrec_other = 0;
-
-	/* read and print data */
-	reson_lastread = MB_NO;
-	sslo_lastread = MB_NO;
-	while (error <= MB_ERROR_NO_ERROR)
-		{
-		/* reset error */
-		error = MB_ERROR_NO_ERROR;
-
-		/* read next data record */
-		status = mb_get_all(verbose,imbio_ptr,&istore_ptr,&kind,
-				    time_i,&time_d,&navlon,&navlat,
-				    &speed,&heading,
-				    &distance,&altitude,&sonardepth,
-				    &beams_bath,&beams_amp,&pixels_ss,
-				    beamflag,bath,amp,bathacrosstrack,bathalongtrack,
-				    ss,ssacrosstrack,ssalongtrack,
-				    comment,&error);
-
-		/* some nonfatal errors do not matter */
-		if (error < MB_ERROR_NO_ERROR && error > MB_ERROR_UNINTELLIGIBLE)
-			{
-			error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-
-	   	/* handle multibeam data */
-		if (status == MB_SUCCESS && kind == MB_DATA_DATA)
-			{
-			nrec_multibeam++;
-
-			bathymetry = &(istore->bathymetry);
-			if (istore->read_volatilesettings == MB_YES)
-				nrec_volatilesettings++;
-			if (istore->read_matchfilter == MB_YES)
-				nrec_matchfilter++;
-			if (istore->read_beamgeometry == MB_YES)
-				nrec_beamgeometry++;
-			if (istore->read_remotecontrolsettings == MB_YES)
-				nrec_remotecontrolsettings++;
-			if (istore->read_bathymetry == MB_YES)
-				nrec_bathymetry++;
-			if (istore->read_backscatter == MB_YES)
-				nrec_backscatter++;
-			if (istore->read_beam == MB_YES)
-				nrec_beam++;
-			if (istore->read_verticaldepth == MB_YES)
-				nrec_verticaldepth++;
-			if (istore->read_image == MB_YES)
-				nrec_image++;
-			if (istore->read_v2pingmotion == MB_YES)
-				nrec_v2pingmotion++;
-			if (istore->read_v2detectionsetup == MB_YES)
-				nrec_v2detectionsetup++;
-			if (istore->read_v2beamformed == MB_YES)
-				nrec_v2beamformed++;
-			if (istore->read_v2detection == MB_YES)
-				nrec_v2detection++;
-			if (istore->read_v2rawdetection == MB_YES)
-				nrec_v2rawdetection++;
-			if (istore->read_v2snippet == MB_YES)
-				nrec_v2snippet++;
-			if (istore->read_calibratedsnippet == MB_YES)
-				nrec_calibratedsnippet++;
-			if (istore->read_processedsidescan == MB_YES)
-				nrec_processedsidescan++;
-
-			/* print out record headers */
-			if (istore->read_volatilesettings == MB_YES)
-				{
-				volatilesettings = &(istore->volatilesettings);
-				header = &(volatilesettings->header);
-				time_j[0] = header->s7kTime.Year;
-				time_j[1] = header->s7kTime.Day;
-				time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-				time_j[3] = (int) header->s7kTime.Seconds;
-				time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-				mb_get_itime(verbose, time_j, time_i);
-				mb_get_time(verbose, time_i, &time_d);
-				if (verbose > 0)
-				fprintf(stderr,"R7KRECID_7kVolatileSonarSettings:  7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d\n",
-					time_i[0],time_i[1],time_i[2],
-					time_i[3],time_i[4],time_i[5],time_i[6],
-					header->RecordNumber);
-				}
-			if (istore->read_matchfilter == MB_YES)
-				{
-				matchfilter = &(istore->matchfilter);
-				header = &(matchfilter->header);
-				time_j[0] = header->s7kTime.Year;
-				time_j[1] = header->s7kTime.Day;
-				time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-				time_j[3] = (int) header->s7kTime.Seconds;
-				time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-				mb_get_itime(verbose, time_j, time_i);
-				mb_get_time(verbose, time_i, &time_d);
-				if (verbose > 0)
-				fprintf(stderr,"R7KRECID_7kVolatileSonarSettings:  7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d\n",
-					time_i[0],time_i[1],time_i[2],
-					time_i[3],time_i[4],time_i[5],time_i[6],
-					header->RecordNumber);
-				}
-			if (istore->read_beamgeometry == MB_YES)
-				{
-				beamgeometry = &(istore->beamgeometry);
-				header = &(beamgeometry->header);
-				time_j[0] = header->s7kTime.Year;
-				time_j[1] = header->s7kTime.Day;
-				time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-				time_j[3] = (int) header->s7kTime.Seconds;
-				time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-				mb_get_itime(verbose, time_j, time_i);
-				mb_get_time(verbose, time_i, &time_d);
-				if (verbose > 0)
-				fprintf(stderr,"R7KRECID_7kBeamGeometry:           7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d beams:%d\n",
-					time_i[0],time_i[1],time_i[2],
-					time_i[3],time_i[4],time_i[5],time_i[6],
-					header->RecordNumber,beamgeometry->number_beams);
-				}
-			if (istore->read_remotecontrolsettings == MB_YES)
-				{
-				remotecontrolsettings = &(istore->remotecontrolsettings);
-				header = &(remotecontrolsettings->header);
-				time_j[0] = header->s7kTime.Year;
-				time_j[1] = header->s7kTime.Day;
-				time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-				time_j[3] = (int) header->s7kTime.Seconds;
-				time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-				mb_get_itime(verbose, time_j, time_i);
-				mb_get_time(verbose, time_i, &time_d);
-				if (verbose > 0)
-				fprintf(stderr,"R7KRECID_7kremotecontrolsettings:  7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d\n",
-					time_i[0],time_i[1],time_i[2],
-					time_i[3],time_i[4],time_i[5],time_i[6],
-					header->RecordNumber);
-				}
-			if (istore->read_bathymetry == MB_YES)
-				{
-				bathymetry = &(istore->bathymetry);
-				header = &(bathymetry->header);
-				time_j[0] = header->s7kTime.Year;
-				time_j[1] = header->s7kTime.Day;
-				time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-				time_j[3] = (int) header->s7kTime.Seconds;
-				time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-				mb_get_itime(verbose, time_j, time_i);
-				mb_get_time(verbose, time_i, &time_d);
-				if (verbose > 0)
-				fprintf(stderr,"R7KRECID_7kBathymetricData:        7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d ping:%d beams:%d\n",
-					time_i[0],time_i[1],time_i[2],
-					time_i[3],time_i[4],time_i[5],time_i[6],
-					header->RecordNumber,bathymetry->ping_number,bathymetry->number_beams);
-
-				/* allocate memory for bathymetry timetag arrays if needed */
-				if (nbatht == 0 || nbatht >= nbatht_alloc)
-					{
-					nbatht_alloc +=  MB7KPREPROCESS_ALLOC_CHUNK;
-					status = mb_reallocd(verbose,__FILE__,__LINE__,nbatht_alloc*sizeof(double),(void **)&batht_time_d,&error);
-					status = mb_reallocd(verbose,__FILE__,__LINE__,nbatht_alloc*sizeof(int),(void **)&batht_ping,&error);
-					status = mb_reallocd(verbose,__FILE__,__LINE__,nbatht_alloc*sizeof(double),(void **)&batht_time_d_new,&error);
-					status = mb_reallocd(verbose,__FILE__,__LINE__,nbatht_alloc*sizeof(double),(void **)&batht_time_offset,&error);
-					status = mb_reallocd(verbose,__FILE__,__LINE__,nbatht_alloc*sizeof(int),(void **)&batht_ping_offset,&error);
-					status = mb_reallocd(verbose,__FILE__,__LINE__,nbatht_alloc*sizeof(int),(void **)&batht_good_offset,&error);
-					if (error != MB_ERROR_NO_ERROR)
-						{
-						mb_error(verbose,error,&message);
-						fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",message);
-						fprintf(stderr,"\nProgram <%s> Terminated\n",
-						    program_name);
-						exit(error);
-						}
-					}
-
-				/* store the bathtech time stamp */
-				if (nbatht == 0 || time_d > batht_time_d[nbatht-1])
-					{
-					batht_time_d[nbatht] = time_d;
-					batht_ping[nbatht] = bathymetry->ping_number;
-
-					/* grab the last sslo ping if it was the last thing read */
-					if (nedget > 0)
-						{
-						batht_time_offset[nbatht] = sslo_last_time_d - time_d;
-						batht_ping_offset[nbatht] = sslo_last_ping - bathymetry->ping_number;
-						batht_good_offset[nbatht] = MB_YES;
-						}
-					else
-						{
-						batht_time_offset[nbatht] = -9999.99;
-						batht_ping_offset[nbatht] = 0;
-						batht_good_offset[nbatht] = MB_NO;
-						}
-					nbatht++;
-					}
-				}
-			if (istore->read_backscatter == MB_YES)
-				{
-				backscatter = &(istore->backscatter);
-				header = &(backscatter->header);
-				time_j[0] = header->s7kTime.Year;
-				time_j[1] = header->s7kTime.Day;
-				time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-				time_j[3] = (int) header->s7kTime.Seconds;
-				time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-				mb_get_itime(verbose, time_j, time_i);
-				mb_get_time(verbose, time_i, &time_d);
-				if (verbose > 0)
-				fprintf(stderr,"R7KRECID_7kBackscatterImageData:   7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d ping:%d samples:%d\n",
-					time_i[0],time_i[1],time_i[2],
-					time_i[3],time_i[4],time_i[5],time_i[6],
-					header->RecordNumber,backscatter->ping_number,backscatter->number_samples);
-				}
-			if (istore->read_beam == MB_YES)
-				{
-				beam = &(istore->beam);
-				header = &(beam->header);
-				time_j[0] = header->s7kTime.Year;
-				time_j[1] = header->s7kTime.Day;
-				time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-				time_j[3] = (int) header->s7kTime.Seconds;
-				time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-				mb_get_itime(verbose, time_j, time_i);
-				mb_get_time(verbose, time_i, &time_d);
-				if (verbose > 0)
-				fprintf(stderr,"R7KRECID_7kBeamData: 7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d ping:%d beams:%d samples:%d\n",
-					time_i[0],time_i[1],time_i[2],
-					time_i[3],time_i[4],time_i[5],time_i[6],
-					header->RecordNumber,beam->ping_number,beam->number_beams,beam->number_samples);
-				}
-			if (istore->read_verticaldepth == MB_YES)
-				{
-				verticaldepth = &(istore->verticaldepth);
-				header = &(verticaldepth->header);
-				time_j[0] = header->s7kTime.Year;
-				time_j[1] = header->s7kTime.Day;
-				time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-				time_j[3] = (int) header->s7kTime.Seconds;
-				time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-				mb_get_itime(verbose, time_j, time_i);
-				mb_get_time(verbose, time_i, &time_d);
-				if (verbose > 0)
-				fprintf(stderr,"R7KRECID_7kVerticalDepth: 7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d ping:%d\n",
-					time_i[0],time_i[1],time_i[2],
-					time_i[3],time_i[4],time_i[5],time_i[6],
-					header->RecordNumber,verticaldepth->ping_number);
-				}
-			if (istore->read_image == MB_YES)
-				{
-				image = &(istore->image);
-				header = &(image->header);
-				time_j[0] = header->s7kTime.Year;
-				time_j[1] = header->s7kTime.Day;
-				time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-				time_j[3] = (int) header->s7kTime.Seconds;
-				time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-				mb_get_itime(verbose, time_j, time_i);
-				mb_get_time(verbose, time_i, &time_d);
-				if (verbose > 0)
-				fprintf(stderr,"R7KRECID_7kImageData:              7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d ping:%d width:%d height:%d\n",
-					time_i[0],time_i[1],time_i[2],
-					time_i[3],time_i[4],time_i[5],time_i[6],
-					header->RecordNumber,image->ping_number,image->width,image->height);
-				}
-			if (istore->read_v2pingmotion == MB_YES)
-				{
-				v2pingmotion = &(istore->v2pingmotion);
-				header = &(v2pingmotion->header);
-				time_j[0] = header->s7kTime.Year;
-				time_j[1] = header->s7kTime.Day;
-				time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-				time_j[3] = (int) header->s7kTime.Seconds;
-				time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-				mb_get_itime(verbose, time_j, time_i);
-				mb_get_time(verbose, time_i, &time_d);
-				if (verbose > 0)
-				fprintf(stderr,"R7KRECID_7kV2PingMotionData:        7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d ping:%d samples:%d\n",
-					time_i[0],time_i[1],time_i[2],
-					time_i[3],time_i[4],time_i[5],time_i[6],
-					header->RecordNumber,v2pingmotion->ping_number,v2pingmotion->n);
-				}
-			if (istore->read_v2detectionsetup == MB_YES)
-				{
-				v2detectionsetup = &(istore->v2detectionsetup);
-				header = &(v2detectionsetup->header);
-				time_j[0] = header->s7kTime.Year;
-				time_j[1] = header->s7kTime.Day;
-				time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-				time_j[3] = (int) header->s7kTime.Seconds;
-				time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-				mb_get_itime(verbose, time_j, time_i);
-				mb_get_time(verbose, time_i, &time_d);
-				if (verbose > 0)
-				fprintf(stderr,"R7KRECID_7kV2DetectionSetupData:    7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d ping:%d beams:%d\n",
-					time_i[0],time_i[1],time_i[2],
-					time_i[3],time_i[4],time_i[5],time_i[6],
-					header->RecordNumber,v2detectionsetup->ping_number,v2detectionsetup->number_beams);
-				}
-			if (istore->read_v2beamformed == MB_YES)
-				{
-				v2beamformed = &(istore->v2beamformed);
-				header = &(v2beamformed->header);
-				time_j[0] = header->s7kTime.Year;
-				time_j[1] = header->s7kTime.Day;
-				time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-				time_j[3] = (int) header->s7kTime.Seconds;
-				time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-				mb_get_itime(verbose, time_j, time_i);
-				mb_get_time(verbose, time_i, &time_d);
-				if (verbose > 0)
-				fprintf(stderr,"R7KRECID_7kV2BeamformedData:        7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d ping:%d beams:%d\n",
-					time_i[0],time_i[1],time_i[2],
-					time_i[3],time_i[4],time_i[5],time_i[6],
-					header->RecordNumber,v2beamformed->ping_number,v2beamformed->number_beams);
-				}
-			if (istore->read_v2detection == MB_YES)
-				{
-				v2detection = &(istore->v2detection);
-				header = &(v2detection->header);
-				time_j[0] = header->s7kTime.Year;
-				time_j[1] = header->s7kTime.Day;
-				time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-				time_j[3] = (int) header->s7kTime.Seconds;
-				time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-				mb_get_itime(verbose, time_j, time_i);
-				mb_get_time(verbose, time_i, &time_d);
-				if (verbose > 0)
-				fprintf(stderr,"R7KRECID_7kV2DetectionData:         7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d ping:%d beams:%d\n",
-					time_i[0],time_i[1],time_i[2],
-					time_i[3],time_i[4],time_i[5],time_i[6],
-					header->RecordNumber,v2detection->ping_number,v2detection->number_beams);
-				}
-			if (istore->read_v2rawdetection == MB_YES)
-				{
-				v2rawdetection = &(istore->v2rawdetection);
-				header = &(v2rawdetection->header);
-				time_j[0] = header->s7kTime.Year;
-				time_j[1] = header->s7kTime.Day;
-				time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-				time_j[3] = (int) header->s7kTime.Seconds;
-				time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-				mb_get_itime(verbose, time_j, time_i);
-				mb_get_time(verbose, time_i, &time_d);
-				if (verbose > 0)
-				fprintf(stderr,"R7KRECID_7kV2RawDetectionData:      7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d ping:%d beams:%d\n",
-					time_i[0],time_i[1],time_i[2],
-					time_i[3],time_i[4],time_i[5],time_i[6],
-					header->RecordNumber,v2rawdetection->ping_number,v2rawdetection->number_beams);
-				}
-			if (istore->read_v2snippet == MB_YES)
-				{
-				v2snippet = &(istore->v2snippet);
-				header = &(v2snippet->header);
-				time_j[0] = header->s7kTime.Year;
-				time_j[1] = header->s7kTime.Day;
-				time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-				time_j[3] = (int) header->s7kTime.Seconds;
-				time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-				mb_get_itime(verbose, time_j, time_i);
-				mb_get_time(verbose, time_i, &time_d);
-				if (verbose > 0)
-				fprintf(stderr,"R7KRECID_7kV2SnippetData:           7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d ping:%d beams:%d\n",
-					time_i[0],time_i[1],time_i[2],
-					time_i[3],time_i[4],time_i[5],time_i[6],
-					header->RecordNumber,v2snippet->ping_number,v2snippet->number_beams);
-				}
-			if (istore->read_calibratedsnippet == MB_YES)
-				{
-				calibratedsnippet = &(istore->calibratedsnippet);
-				header = &(calibratedsnippet->header);
-				time_j[0] = header->s7kTime.Year;
-				time_j[1] = header->s7kTime.Day;
-				time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-				time_j[3] = (int) header->s7kTime.Seconds;
-				time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-				mb_get_itime(verbose, time_j, time_i);
-				mb_get_time(verbose, time_i, &time_d);
-				if (verbose > 0)
-				fprintf(stderr,"R7KRECID_7kCalibratedSnippetData:           7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d ping:%d beams:%d\n",
-					time_i[0],time_i[1],time_i[2],
-					time_i[3],time_i[4],time_i[5],time_i[6],
-					header->RecordNumber,calibratedsnippet->ping_number,calibratedsnippet->number_beams);
-
-				}
-			if (istore->read_processedsidescan == MB_YES)
-				{
-				processedsidescan = &(istore->processedsidescan);
-				header = &(processedsidescan->header);
-				time_j[0] = header->s7kTime.Year;
-				time_j[1] = header->s7kTime.Day;
-				time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-				time_j[3] = (int) header->s7kTime.Seconds;
-				time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-				mb_get_itime(verbose, time_j, time_i);
-				mb_get_time(verbose, time_i, &time_d);
-				if (verbose > 0)
-				fprintf(stderr,"R7KRECID_7kProcessedSidescanData:   7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d ping:%d pixels:%d\n",
-					time_i[0],time_i[1],time_i[2],
-					time_i[3],time_i[4],time_i[5],time_i[6],
-					header->RecordNumber,processedsidescan->ping_number,processedsidescan->number_pixels);
-				}
-			}
-
-	   	/* handle reference point data */
-		else if (status == MB_SUCCESS && istore->type == R7KRECID_ReferencePoint)
-			{
-			nrec_reference++;
-
-			reference = &(istore->reference);
-			header = &(reference->header);
-			time_j[0] = header->s7kTime.Year;
-			time_j[1] = header->s7kTime.Day;
-			time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-			time_j[3] = (int) header->s7kTime.Seconds;
-			time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-			mb_get_itime(verbose, time_j, time_i);
-			mb_get_time(verbose, time_i, &time_d);
-			if (verbose > 0)
-				fprintf(stderr,"R7KRECID_ReferencePoint: 7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d\n",
-				time_i[0],time_i[1],time_i[2],
-				time_i[3],time_i[4],time_i[5],time_i[6],
-				header->RecordNumber);
-			}
-
-	   	/* handle uncalibrated sensor offset data */
-		else if (status == MB_SUCCESS && istore->type == R7KRECID_UncalibratedSensorOffset)
-			{
-			nrec_sensoruncal++;
-
-			sensoruncal = &(istore->sensoruncal);
-			header = &(sensoruncal->header);
-			time_j[0] = header->s7kTime.Year;
-			time_j[1] = header->s7kTime.Day;
-			time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-			time_j[3] = (int) header->s7kTime.Seconds;
-			time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-			mb_get_itime(verbose, time_j, time_i);
-			mb_get_time(verbose, time_i, &time_d);
-			if (verbose > 0)
-				fprintf(stderr,"R7KRECID_UncalibratedSensorOffset: 7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d\n",
-				time_i[0],time_i[1],time_i[2],
-				time_i[3],time_i[4],time_i[5],time_i[6],
-				header->RecordNumber);
-			}
-
-	   	/* handle calibrated sensor offset data */
-		else if (status == MB_SUCCESS && istore->type == R7KRECID_CalibratedSensorOffset)
-			{
-			nrec_sensorcal++;
-
-			sensorcal = &(istore->sensorcal);
-			header = &(sensorcal->header);
-			time_j[0] = header->s7kTime.Year;
-			time_j[1] = header->s7kTime.Day;
-			time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-			time_j[3] = (int) header->s7kTime.Seconds;
-			time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-			mb_get_itime(verbose, time_j, time_i);
-			mb_get_time(verbose, time_i, &time_d);
-			if (verbose > 0)
-				fprintf(stderr,"R7KRECID_CalibratedSensorOffset: 7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d\n",
-				time_i[0],time_i[1],time_i[2],
-				time_i[3],time_i[4],time_i[5],time_i[6],
-				header->RecordNumber);
-			}
-
-	   	/* handle position data */
-		else if (status == MB_SUCCESS && istore->type == R7KRECID_Position)
-			{
-			nrec_position++;
-
-			position = &(istore->position);
-			header = &(position->header);
-			time_j[0] = header->s7kTime.Year;
-			time_j[1] = header->s7kTime.Day;
-			time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-			time_j[3] = (int) header->s7kTime.Seconds;
-			time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-			mb_get_itime(verbose, time_j, time_i);
-			mb_get_time(verbose, time_i, &time_d);
-
-			if (verbose > 0)
-				fprintf(stderr,"R7KRECID_Position: 7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d\n",
-			time_i[0],time_i[1],time_i[2],
-			time_i[3],time_i[4],time_i[5],time_i[6],
-			header->RecordNumber);
-
-			/* allocate memory for position arrays if needed */
-			if (ndat_nav + 1 >= ndat_nav_alloc)
-				{
-				ndat_nav_alloc +=  MB7KPREPROCESS_ALLOC_CHUNK;
-				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_nav_alloc*sizeof(double),(void **)&dat_nav_time_d,&error);
-				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_nav_alloc*sizeof(double),(void **)&dat_nav_lon,&error);
-				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_nav_alloc*sizeof(double),(void **)&dat_nav_lat,&error);
-				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_nav_alloc*sizeof(double),(void **)&dat_nav_speed,&error);
-				if (error != MB_ERROR_NO_ERROR)
-					{
-					mb_error(verbose,error,&message);
-					fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",message);
-					fprintf(stderr,"\nProgram <%s> Terminated\n",
-					    program_name);
-					exit(error);
-					}
-				}
-
-			/* store the position data */
-			if (ndat_nav == 0 || dat_nav_time_d[ndat_nav-1] < time_d)
-				{
-				dat_nav_time_d[ndat_nav] = time_d + position->latency;
-				dat_nav_lon[ndat_nav] = RTD * position->longitude;
-				dat_nav_lat[ndat_nav] = RTD * position->latitude;
-				dat_nav_speed[ndat_nav] = 0.0;
-				ndat_nav++;
-				}
-
-			}
-
-	   	/* handle customattitude data */
-		else if (status == MB_SUCCESS && istore->type == R7KRECID_CustomAttitude)
-			{
-			nrec_customattitude++;
-
-			customattitude = &(istore->customattitude);
-			header = &(customattitude->header);
-			time_j[0] = header->s7kTime.Year;
-			time_j[1] = header->s7kTime.Day;
-			time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-			time_j[3] = (int) header->s7kTime.Seconds;
-			time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-			mb_get_itime(verbose, time_j, time_i);
-			mb_get_time(verbose, time_i, &time_d);
-
-			if (verbose > 0)
-				fprintf(stderr,"R7KRECID_CustomAttitude: 7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d\n",
-			time_i[0],time_i[1],time_i[2],
-			time_i[3],time_i[4],time_i[5],time_i[6],
-			header->RecordNumber);
-
-			/* allocate memory for customattitude arrays if needed */
-			if (ndat_rph + customattitude->n >= ndat_rph_alloc)
-				{
-				ndat_rph_alloc += MAX(MB7KPREPROCESS_ALLOC_CHUNK, customattitude->n);
-				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_rph_alloc*sizeof(double),(void **)&dat_rph_time_d,&error);
-				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_rph_alloc*sizeof(double),(void **)&dat_rph_roll,&error);
-				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_rph_alloc*sizeof(double),(void **)&dat_rph_pitch,&error);
-				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_rph_alloc*sizeof(double),(void **)&dat_rph_heave,&error);
-				if (error != MB_ERROR_NO_ERROR)
-					{
-					mb_error(verbose,error,&message);
-					fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",message);
-					fprintf(stderr,"\nProgram <%s> Terminated\n",
-					    program_name);
-					exit(error);
-					}
-				}
-
-			/* store the customattitude data */
-			for (i=0;i<customattitude->n;i++)
-				{
-				if (ndat_rph == 0 || dat_rph_time_d[ndat_rph-1] < time_d)
-					{
-					dat_rph_time_d[ndat_rph] = time_d + i / customattitude->frequency;
-					dat_rph_roll[ndat_rph] = RTD * customattitude->roll[i];
-					dat_rph_pitch[ndat_rph] = RTD * customattitude->pitch[i];
-					dat_rph_heave[ndat_rph] = customattitude->heave[i];
-					ndat_rph++;
-					}
-				}
-			}
-
-	   	/* handle tide data */
-		else if (status == MB_SUCCESS && istore->type == R7KRECID_Tide)
-			{
-			nrec_tide++;
-
-			tide = &(istore->tide);
-			header = &(fileheader->header);
-			time_j[0] = header->s7kTime.Year;
-			time_j[1] = header->s7kTime.Day;
-			time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-			time_j[3] = (int) header->s7kTime.Seconds;
-			time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-			mb_get_itime(verbose, time_j, time_i);
-			mb_get_time(verbose, time_i, &time_d);
-			if (verbose > 0)
-				fprintf(stderr,"R7KRECID_Tide: 7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d\n",
-				time_i[0],time_i[1],time_i[2],
-				time_i[3],time_i[4],time_i[5],time_i[6],
-				header->RecordNumber);
-			}
-
-	   	/* handle altitude data */
-		else if (status == MB_SUCCESS && istore->type == R7KRECID_Altitude)
-			{
-			nrec_altitude++;
-
-			altituderec = &(istore->altitude);
-			header = &(fileheader->header);
-			time_j[0] = header->s7kTime.Year;
-			time_j[1] = header->s7kTime.Day;
-			time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-			time_j[3] = (int) header->s7kTime.Seconds;
-			time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-			mb_get_itime(verbose, time_j, time_i);
-			mb_get_time(verbose, time_i, &time_d);
-			if (verbose > 0)
-				fprintf(stderr,"R7KRECID_Altitude: 7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d\n",
-				time_i[0],time_i[1],time_i[2],
-				time_i[3],time_i[4],time_i[5],time_i[6],
-				header->RecordNumber);
-
-			/* allocate memory for altitude arrays if needed */
-			if (ndat_altitude + 1 >= ndat_altitude_alloc)
-				{
-				ndat_altitude_alloc +=  MB7KPREPROCESS_ALLOC_CHUNK;
-				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_altitude_alloc*sizeof(double),(void **)&dat_altitude_time_d,&error);
-				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_altitude_alloc*sizeof(double),(void **)&dat_altitude_altitude,&error);
-				if (error != MB_ERROR_NO_ERROR)
-					{
-					mb_error(verbose,error,&message);
-					fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",message);
-					fprintf(stderr,"\nProgram <%s> Terminated\n",
-					    program_name);
-					exit(error);
-					}
-				}
-
-			/* store the altitude data */
-			if (ndat_altitude == 0 || dat_altitude_time_d[ndat_altitude-1] < time_d)
-				{
-				dat_altitude_time_d[ndat_altitude] = time_d;
-				dat_altitude_altitude[ndat_altitude] = altituderec->altitude;
-				ndat_altitude++;
-				}
-			}
-
-	   	/* handle motion data */
-		else if (status == MB_SUCCESS && istore->type == R7KRECID_MotionOverGround)
-			{
-			nrec_motion++;
-
-			motion = &(istore->motion);
-			header = &(motion->header);
-			time_j[0] = header->s7kTime.Year;
-			time_j[1] = header->s7kTime.Day;
-			time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-			time_j[3] = (int) header->s7kTime.Seconds;
-			time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-			mb_get_itime(verbose, time_j, time_i);
-			mb_get_time(verbose, time_i, &time_d);
-			if (verbose > 0)
-				fprintf(stderr,"R7KRECID_MotionOverGround: 7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d n:%d\n",
-				time_i[0],time_i[1],time_i[2],
-				time_i[3],time_i[4],time_i[5],time_i[6],
-				header->RecordNumber,motion->n);
-			}
-
-	   	/* handle depth data */
-		else if (status == MB_SUCCESS && istore->type == R7KRECID_Depth)
-			{
-			nrec_depth++;
-
-			depth = &(istore->depth);
-			header = &(depth->header);
-			time_j[0] = header->s7kTime.Year;
-			time_j[1] = header->s7kTime.Day;
-			time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-			time_j[3] = (int) header->s7kTime.Seconds;
-			time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-			mb_get_itime(verbose, time_j, time_i);
-			mb_get_time(verbose, time_i, &time_d);
-			if (verbose > 0)
-				fprintf(stderr,"R7KRECID_Depth: 7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d\n",
-				time_i[0],time_i[1],time_i[2],
-				time_i[3],time_i[4],time_i[5],time_i[6],
-				header->RecordNumber);
-
-			/* allocate memory for sonar depth arrays if needed */
-			if (ndat_sonardepth + 1 >= ndat_sonardepth_alloc)
-				{
-				ndat_sonardepth_alloc +=  MB7KPREPROCESS_ALLOC_CHUNK;
-				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_sonardepth_alloc*sizeof(double),(void **)&dat_sonardepth_time_d,&error);
-				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_sonardepth_alloc*sizeof(double),(void **)&dat_sonardepth_sonardepth,&error);
-				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_sonardepth_alloc*sizeof(double),(void **)&dat_sonardepth_sonardepthfilter,&error);
-				if (error != MB_ERROR_NO_ERROR)
-					{
-					mb_error(verbose,error,&message);
-					fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",message);
-					fprintf(stderr,"\nProgram <%s> Terminated\n",
-					    program_name);
-					exit(error);
-					}
-				}
-
-			/* store the sonar depth data */
-			if (ndat_sonardepth == 0 || dat_sonardepth_time_d[ndat_sonardepth-1] < time_d)
-				{
-				dat_sonardepth_time_d[ndat_sonardepth] = time_d;
-				dat_sonardepth_sonardepth[ndat_sonardepth] = depth->depth;
-				dat_sonardepth_sonardepthfilter[ndat_sonardepth] = 0.0;
-				ndat_sonardepth++;
-				}
-			}
-
-	   	/* handle sound velocity data */
-		else if (status == MB_SUCCESS && istore->type == R7KRECID_SoundVelocityProfile)
-			{
-			nrec_svp++;
-
-			svp = &(istore->svp);
-			header = &(svp->header);
-			time_j[0] = header->s7kTime.Year;
-			time_j[1] = header->s7kTime.Day;
-			time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-			time_j[3] = (int) header->s7kTime.Seconds;
-			time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-			mb_get_itime(verbose, time_j, time_i);
-			mb_get_time(verbose, time_i, &time_d);
-			if (verbose > 0)
-				fprintf(stderr,"R7KRECID_SoundVelocityProfile: 7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d n:%d\n",
-				time_i[0],time_i[1],time_i[2],
-				time_i[3],time_i[4],time_i[5],time_i[6],
-				header->RecordNumber,svp->n);
-			}
-
-	   	/* handle ctd data */
-		else if (status == MB_SUCCESS && istore->type == R7KRECID_CTD)
-			{
-			nrec_ctd++;
-
-			ctd = &(istore->ctd);
-			header = &(ctd->header);
-			time_j[0] = header->s7kTime.Year;
-			time_j[1] = header->s7kTime.Day;
-			time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-			time_j[3] = (int) header->s7kTime.Seconds;
-			time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-			mb_get_itime(verbose, time_j, time_i);
-			mb_get_time(verbose, time_i, &time_d);
-
-			if (verbose > 0)
-				fprintf(stderr,"R7KRECID_CTD: 7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d n:%d\n",
-			time_i[0],time_i[1],time_i[2],
-			time_i[3],time_i[4],time_i[5],time_i[6],
-			header->RecordNumber,ctd->n);
-			}
-
-	   	/* handle geodesy data */
-		else if (status == MB_SUCCESS && istore->type == R7KRECID_Geodesy)
-			{
-			nrec_geodesy++;
-
-			geodesy = &(istore->geodesy);
-			header = &(geodesy->header);
-			time_j[0] = header->s7kTime.Year;
-			time_j[1] = header->s7kTime.Day;
-			time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-			time_j[3] = (int) header->s7kTime.Seconds;
-			time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-			mb_get_itime(verbose, time_j, time_i);
-			mb_get_time(verbose, time_i, &time_d);
-
-			if (verbose > 0)
-				fprintf(stderr,"R7KRECID_Geodesy: 7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d\n",
-			time_i[0],time_i[1],time_i[2],
-			time_i[3],time_i[4],time_i[5],time_i[6],
-			header->RecordNumber);
-			}
-
-	   	/* handle rollpitchheave data */
-		else if (status == MB_SUCCESS && istore->type == R7KRECID_RollPitchHeave)
-			{
-			nrec_rollpitchheave++;
-
-			rollpitchheave = &(istore->rollpitchheave);
-			header = &(rollpitchheave->header);
-			time_j[0] = header->s7kTime.Year;
-			time_j[1] = header->s7kTime.Day;
-			time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-			time_j[3] = (int) header->s7kTime.Seconds;
-			time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-			mb_get_itime(verbose, time_j, time_i);
-			mb_get_time(verbose, time_i, &time_d);
-
-			if (verbose > 0)
-				fprintf(stderr,"R7KRECID_RollPitchHeave:               7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d\n",
-			time_i[0],time_i[1],time_i[2],
-			time_i[3],time_i[4],time_i[5],time_i[6],
-			header->RecordNumber);
-
-			/* allocate memory for rollpitchheave arrays if needed */
-			if (ndat_rph + 1 >= ndat_rph_alloc)
-				{
-				ndat_rph_alloc +=  MB7KPREPROCESS_ALLOC_CHUNK;
-				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_rph_alloc*sizeof(double),(void **)&dat_rph_time_d,&error);
-				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_rph_alloc*sizeof(double),(void **)&dat_rph_roll,&error);
-				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_rph_alloc*sizeof(double),(void **)&dat_rph_pitch,&error);
-				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_rph_alloc*sizeof(double),(void **)&dat_rph_heave,&error);
-				if (error != MB_ERROR_NO_ERROR)
-					{
-					mb_error(verbose,error,&message);
-					fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",message);
-					fprintf(stderr,"\nProgram <%s> Terminated\n",
-					    program_name);
-					exit(error);
-					}
-				}
-
-			/* store the rollpitchheave data */
-			if (ndat_rph == 0 || dat_rph_time_d[ndat_rph-1] < time_d)
-				{
-				dat_rph_time_d[ndat_rph] = time_d;
-				dat_rph_roll[ndat_rph] = RTD * rollpitchheave->roll;
-				dat_rph_pitch[ndat_rph] = RTD * rollpitchheave->pitch;
-				dat_rph_heave[ndat_rph] = rollpitchheave->heave;
-				ndat_rph++;
-				}
-
-			}
-
-	   	/* handle heading data */
-		else if (status == MB_SUCCESS && istore->type == R7KRECID_Heading)
-			{
-			nrec_heading++;
-
-			headingrec = &(istore->heading);
-			header = &(headingrec->header);
-			time_j[0] = header->s7kTime.Year;
-			time_j[1] = header->s7kTime.Day;
-			time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-			time_j[3] = (int) header->s7kTime.Seconds;
-			time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-			mb_get_itime(verbose, time_j, time_i);
-			mb_get_time(verbose, time_i, &time_d);
-			if (verbose > 0)
-				fprintf(stderr,"R7KRECID_Heading: 7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d\n",
-				time_i[0],time_i[1],time_i[2],
-				time_i[3],time_i[4],time_i[5],time_i[6],
-				header->RecordNumber);
-
-			/* allocate memory for sonar heading arrays if needed */
-			if (ndat_heading + 1 >= ndat_heading_alloc)
-				{
-				ndat_heading_alloc +=  MB7KPREPROCESS_ALLOC_CHUNK;
-				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_heading_alloc*sizeof(double),(void **)&dat_heading_time_d,&error);
-				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_heading_alloc*sizeof(double),(void **)&dat_heading_heading,&error);
-				if (error != MB_ERROR_NO_ERROR)
-					{
-					mb_error(verbose,error,&message);
-					fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",message);
-					fprintf(stderr,"\nProgram <%s> Terminated\n",
-					    program_name);
-					exit(error);
-					}
-				}
-
-			/* store the sonar heading data */
-			if (ndat_heading == 0 || dat_heading_time_d[ndat_heading-1] < time_d)
-				{
-				dat_heading_time_d[ndat_heading] = time_d;
-				dat_heading_heading[ndat_heading] = RTD * headingrec->heading;
-				ndat_heading++;
-				}
-			}
-
-	   	/* handle survey line data */
-		else if (status == MB_SUCCESS && istore->type == R7KRECID_SurveyLine)
-			{
-			nrec_surveyline++;
-
-			surveyline = &(istore->surveyline);
-			header = &(surveyline->header);
-			time_j[0] = header->s7kTime.Year;
-			time_j[1] = header->s7kTime.Day;
-			time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-			time_j[3] = (int) header->s7kTime.Seconds;
-			time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-			mb_get_itime(verbose, time_j, time_i);
-			mb_get_time(verbose, time_i, &time_d);
-
-			if (verbose > 0)
-				fprintf(stderr,"R7KRECID_SurveyLine: 7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d\n",
-			time_i[0],time_i[1],time_i[2],
-			time_i[3],time_i[4],time_i[5],time_i[6],
-			header->RecordNumber);
-			}
-
-	   	/* handle navigation data */
-		else if (status == MB_SUCCESS && istore->type == R7KRECID_Navigation)
-			{
-			nrec_navigation++;
-
-			navigation = &(istore->navigation);
-			header = &(navigation->header);
-			time_j[0] = header->s7kTime.Year;
-			time_j[1] = header->s7kTime.Day;
-			time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-			time_j[3] = (int) header->s7kTime.Seconds;
-			time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-			mb_get_itime(verbose, time_j, time_i);
-			mb_get_time(verbose, time_i, &time_d);
-
-			if (verbose > 0)
-				fprintf(stderr,"R7KRECID_Navigation: 7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d\n",
-			time_i[0],time_i[1],time_i[2],
-			time_i[3],time_i[4],time_i[5],time_i[6],
-			header->RecordNumber);
-
-			/* allocate memory for position arrays if needed */
-			if (ndat_nav + 1 >= ndat_nav_alloc)
-				{
-				ndat_nav_alloc +=  MB7KPREPROCESS_ALLOC_CHUNK;
-				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_nav_alloc*sizeof(double),(void **)&dat_nav_time_d,&error);
-				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_nav_alloc*sizeof(double),(void **)&dat_nav_lon,&error);
-				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_nav_alloc*sizeof(double),(void **)&dat_nav_lat,&error);
-				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_nav_alloc*sizeof(double),(void **)&dat_nav_speed,&error);
-				if (error != MB_ERROR_NO_ERROR)
-					{
-					mb_error(verbose,error,&message);
-					fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",message);
-					fprintf(stderr,"\nProgram <%s> Terminated\n",
-					    program_name);
-					exit(error);
-					}
-				}
-
-			/* store the navigation data */
-			if (ndat_nav == 0 || dat_nav_time_d[ndat_nav-1] < time_d)
-				{
-				dat_nav_time_d[ndat_nav] = time_d;
-				dat_nav_lon[ndat_nav] = RTD * navigation->longitude;
-				dat_nav_lat[ndat_nav] = RTD * navigation->latitude;
-				dat_nav_speed[ndat_nav] = navigation->speed;
-				ndat_nav++;
-				}
-
-			/* allocate memory for sonar heading arrays if needed */
-			if (ndat_heading + 1 >= ndat_heading_alloc)
-				{
-				ndat_heading_alloc +=  MB7KPREPROCESS_ALLOC_CHUNK;
-				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_heading_alloc*sizeof(double),(void **)&dat_heading_time_d,&error);
-				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_heading_alloc*sizeof(double),(void **)&dat_heading_heading,&error);
-				if (error != MB_ERROR_NO_ERROR)
-					{
-					mb_error(verbose,error,&message);
-					fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",message);
-					fprintf(stderr,"\nProgram <%s> Terminated\n",
-					    program_name);
-					exit(error);
-					}
-				}
-
-			/* store the sonar heading data */
-			if (ndat_heading == 0 || dat_heading_time_d[ndat_heading-1] < time_d)
-				{
-				dat_heading_time_d[ndat_heading] = time_d;
-				dat_heading_heading[ndat_heading] = RTD * navigation->heading;
-				ndat_heading++;
-				}
-			}
-
-	   	/* handle attitude data */
-		else if (status == MB_SUCCESS && istore->type == R7KRECID_Attitude)
-			{
-			nrec_attitude++;
-
-			attitude = &(istore->attitude);
-			header = &(attitude->header);
-			time_j[0] = header->s7kTime.Year;
-			time_j[1] = header->s7kTime.Day;
-			time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-			time_j[3] = (int) header->s7kTime.Seconds;
-			time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-			mb_get_itime(verbose, time_j, time_i);
-			mb_get_time(verbose, time_i, &time_d);
-
-			if (verbose > 0)
-				fprintf(stderr,"R7KRECID_Attitude: 7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d n:%d\n",
-			time_i[0],time_i[1],time_i[2],
-			time_i[3],time_i[4],time_i[5],time_i[6],
-			header->RecordNumber,attitude->n);
-
-			/* allocate memory for attitude arrays if needed */
-			if (ndat_rph + attitude->n >= ndat_rph_alloc)
-				{
-				ndat_rph_alloc += MB7KPREPROCESS_ALLOC_CHUNK;
-				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_rph_alloc*sizeof(double),(void **)&dat_rph_time_d,&error);
-				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_rph_alloc*sizeof(double),(void **)&dat_rph_roll,&error);
-				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_rph_alloc*sizeof(double),(void **)&dat_rph_pitch,&error);
-				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_rph_alloc*sizeof(double),(void **)&dat_rph_heave,&error);
-				if (error != MB_ERROR_NO_ERROR)
-					{
-					mb_error(verbose,error,&message);
-					fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",message);
-					fprintf(stderr,"\nProgram <%s> Terminated\n",
-					    program_name);
-					exit(error);
-					}
-				}
-
-			/* store the attitude data */
-			for (i=0;i<attitude->n;i++)
-				{
-				if (ndat_rph == 0 || dat_rph_time_d[ndat_rph-1] < time_d)
-					{
-					dat_rph_time_d[ndat_rph] = time_d + i * attitude->delta_time[i];
-					dat_rph_roll[ndat_rph] = RTD * attitude->roll[i];
-					dat_rph_pitch[ndat_rph] = RTD * attitude->pitch[i];
-					dat_rph_heave[ndat_rph] = attitude->heave[i];
-					ndat_rph++;
-					}
-				}
-			}
-
-	   	/* handle file header data */
-		else if (status == MB_SUCCESS && istore->type == R7KRECID_7kFileHeader)
-			{
-			nrec_fileheader++;
-
-			fileheader = &(istore->fileheader);
-			header = &(fileheader->header);
-			time_j[0] = header->s7kTime.Year;
-			time_j[1] = header->s7kTime.Day;
-			time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-			time_j[3] = (int) header->s7kTime.Seconds;
-			time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-			mb_get_itime(verbose, time_j, time_i);
-			mb_get_time(verbose, time_i, &time_d);
-			if (verbose > 0)
-				fprintf(stderr,"R7KRECID_7kFileHeader: 7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d\n",
-				time_i[0],time_i[1],time_i[2],
-				time_i[3],time_i[4],time_i[5],time_i[6],
-				header->RecordNumber);
-			}
-
-	   	/* handle installation data */
-		else if (status == MB_SUCCESS && istore->type == R7KRECID_7kInstallationParameters)
-			{
-			nrec_installation++;
-
-			installation = &(istore->installation);
-			header = &(installation->header);
-			time_j[0] = header->s7kTime.Year;
-			time_j[1] = header->s7kTime.Day;
-			time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-			time_j[3] = (int) header->s7kTime.Seconds;
-			time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-			mb_get_itime(verbose, time_j, time_i);
-			mb_get_time(verbose, time_i, &time_d);
-			if (verbose > 0)
-				fprintf(stderr,"R7KRECID_7kInstallationParameters: 7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d\n",
-				time_i[0],time_i[1],time_i[2],
-				time_i[3],time_i[4],time_i[5],time_i[6],
-				header->RecordNumber);
-
-			if (platform == NULL)
-				{
-				status = mb_platform_init(verbose, MB_PLATFORM_NONE, NULL, NULL,
-								0, 1, 1, 2, 2, 2, 
-								(void **)&platform, &error);
-					
-				/* set sensor 0 (multibeam) */
-				if (status == MB_SUCCESS)
-					status = mb_platform_add_sensor(verbose, (void **)&platform,
-							MB_SENSOR_TYPE_SONAR_MULTIBEAM,
-							NULL,
-							NULL,
-							NULL,
-							0, 0,
-							2, 0,
-							&error);
-				if (status == MB_SUCCESS)
-					status = mb_platform_add_sensor_offset(verbose, (void **)&platform,
-							0, 0,
-							MB7KPREPROCESS_TIMELAG_OFF,
-							0.0,
-							0,
-							NULL,
-							NULL,
-							MB_SENSOR_POSITION_OFFSET_STATIC,
-							(double) installation->transmit_x,
-							(double) installation->transmit_y,
-							(double) installation->transmit_z,   
-							MB_SENSOR_ATTITUDE_OFFSET_STATIC,
-							(double) installation->transmit_heading,
-							(double) installation->transmit_roll,
-							(double) installation->transmit_pitch,   
-							&error);
-				if (status == MB_SUCCESS)
-					status = mb_platform_add_sensor_offset(verbose, (void **)&platform,
-							0, 1,
-							MB7KPREPROCESS_TIMELAG_OFF,
-							0.0,
-							0,
-							NULL,
-							NULL,
-							MB_SENSOR_POSITION_OFFSET_STATIC,
-							(double) installation->receive_x,
-							(double) installation->receive_y,
-							(double) installation->receive_z,   
-							MB_SENSOR_ATTITUDE_OFFSET_STATIC,
-							(double) installation->receive_heading,
-							(double) installation->receive_roll,
-							(double) installation->receive_pitch,   
-							&error);
-					
-				/* set sensor 1 (position) */
-				if (status == MB_SUCCESS)
-					status = mb_platform_add_sensor(verbose, (void **)&platform,
-							MB_SENSOR_TYPE_POSITION,
-							NULL,
-							NULL,
-							NULL,
-							0, 0,
-							1, ntimelag,
-							&error);
-				if (status == MB_SUCCESS)
-					{
-					if (timelagmode == MB7KPREPROCESS_TIMELAG_OFF
-						&& installation->position_time_delay != 0)
-						status = mb_platform_add_sensor_offset(verbose, (void **)&platform,
-								1, 0,
-								MB7KPREPROCESS_TIMELAG_CONSTANT,
-								(double)(0.001 * installation->position_time_delay),
-								0,
-								NULL,
-								NULL,
-								MB_SENSOR_POSITION_OFFSET_STATIC,
-								(double) installation->position_x,
-								(double) installation->position_y,
-								(double) installation->position_z,   
-								MB_SENSOR_ATTITUDE_OFFSET_NONE,
-								(double) 0.0,
-								(double) 0.0,
-								(double) 0.0,   
-								&error);
-					else
-						status = mb_platform_add_sensor_offset(verbose, (void **)&platform,
-								1, 0,
-								timelagmode,
-								timelagconstant,
-								ntimelag,
-								timelag_time_d,
-								timelag_model,
-								MB_SENSOR_POSITION_OFFSET_STATIC,
-								(double) installation->position_x,
-								(double) installation->position_y,
-								(double) installation->position_z,   
-								MB_SENSOR_ATTITUDE_OFFSET_NONE,
-								(double) 0.0,
-								(double) 0.0,
-								(double) 0.0,   
-								&error);
-					}
-					
-				/* set sensor 2 (motion sensor) */
-				if (status == MB_SUCCESS)
-					status = mb_platform_add_sensor(verbose, (void **)&platform,
-							MB_SENSOR_TYPE_VRU,
-							NULL,
-							NULL,
-							NULL,
-							0, 0,
-							1, ntimelag,
-							&error);
-				if (status == MB_SUCCESS)
-					{
-					if (timelagmode == MB7KPREPROCESS_TIMELAG_OFF
-						&& installation->motion_time_delay != 0)
-						status = mb_platform_add_sensor_offset(verbose, (void **)&platform,
-								2, 0,
-								MB7KPREPROCESS_TIMELAG_CONSTANT,
-								(double)(0.001 * installation->motion_time_delay),
-								0,
-								NULL,
-								NULL,
-								MB_SENSOR_POSITION_OFFSET_STATIC,
-								(double) installation->motion_x,
-								(double) installation->motion_y,
-								(double) installation->motion_z,   
-								MB_SENSOR_ATTITUDE_OFFSET_STATIC,
-								(double) installation->motion_heading,
-								(double) installation->motion_roll,
-								(double) installation->motion_pitch,   
-								&error);
-					else
-						status = mb_platform_add_sensor_offset(verbose, (void **)&platform,
-								2, 0,
-								timelagmode,
-								timelagconstant,
-								ntimelag,
-								timelag_time_d,
-								timelag_model,
-								MB_SENSOR_POSITION_OFFSET_STATIC,
-								(double) installation->motion_x,
-								(double) installation->motion_y,
-								(double) installation->motion_z,   
-								MB_SENSOR_ATTITUDE_OFFSET_STATIC,
-								(double) installation->motion_heading,
-								(double) installation->motion_roll,
-								(double) installation->motion_pitch,   
-								&error);
-					}
-				
-				/* deal with error */
-				if (status == MB_FAILURE)
-					{
-					error = MB_ERROR_OPEN_FAIL;
-					fprintf(stderr,"\nUnable to initialize platform offset structure\n");
-					fprintf(stderr,"\nProgram <%s> Terminated\n", program_name);
-					exit(error);				
-					}
-				}
-			}
-
-	   	/* handle bluefin ctd data */
-		else if (status == MB_SUCCESS && istore->type == R7KRECID_Bluefin && kind == MB_DATA_SSV)
-			{
-			nrec_bluefinenv++;
-			MBARIdata = MB_YES;
-
-			bluefin = &(istore->bluefin);
-			header = &(bluefin->header);
-			time_j[0] = header->s7kTime.Year;
-			time_j[1] = header->s7kTime.Day;
-			time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-			time_j[3] = (int) header->s7kTime.Seconds;
-			time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-			mb_get_itime(verbose, time_j, time_i);
-			mb_get_time(verbose, time_i, &time_d);
-
-			if (verbose > 0)
-				fprintf(stderr,"R7KRECID_BluefinEnvironmental: 7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d n:%d\n",
-			time_i[0],time_i[1],time_i[2],
-			time_i[3],time_i[4],time_i[5],time_i[6],
-			header->RecordNumber,bluefin->number_frames);
-			for (i=0;i<bluefin->number_frames;i++)
-				{
-				time_j[0] = bluefin->environmental[i].s7kTime.Year;
-				time_j[1] = bluefin->environmental[i].s7kTime.Day;
-				time_j[2] = 60 * bluefin->environmental[i].s7kTime.Hours + bluefin->environmental[i].s7kTime.Minutes;
-				time_j[3] = (int) bluefin->environmental[i].s7kTime.Seconds;
-				time_j[4] = (int) (1000000 * (bluefin->environmental[i].s7kTime.Seconds - time_j[3]));
-				mb_get_itime(verbose, time_j, time_i);
-				if (verbose > 0)
-				fprintf(stderr,"                       %2.2d          7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) CTD_time:%f T_time:%f\n",
-					i,time_i[0],time_i[1],time_i[2],
-					time_i[3],time_i[4],time_i[5],time_i[6],
-					bluefin->environmental[i].ctd_time,
-					bluefin->environmental[i].temperature_time);
-				}
-			}
-
-	   	/* handle bluefin nav data */
-		else if (status == MB_SUCCESS && istore->type == R7KRECID_Bluefin && kind == MB_DATA_NAV2)
-			{
-			nrec_bluefinnav++;
-			MBARIdata = MB_YES;
-
-			bluefin = &(istore->bluefin);
-			header = &(bluefin->header);
-			time_j[0] = header->s7kTime.Year;
-			time_j[1] = header->s7kTime.Day;
-			time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-			time_j[3] = (int) header->s7kTime.Seconds;
-			time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-			mb_get_itime(verbose, time_j, time_i);
-			mb_get_time(verbose, time_i, &time_d);
-
-			/* apply time delay from MBARI AUV if not set and data are pre-2012 */
-			if (timedelaymode == MB7KPREPROCESS_TIMEDELAY_UNDEFINED
-			    && header->s7kTime.Year < 2012)
-				timedelaymode = MB7KPREPROCESS_TIMEDELAY_ON;
-			else if (timedelaymode == MB7KPREPROCESS_TIMEDELAY_UNDEFINED)
-				timedelaymode = MB7KPREPROCESS_TIMEDELAY_OFF;
-
-			/* output time delay from MBARI AUV */
-			if (tfp == NULL)
-				{
-				/* open file for timedelay values */
-				sprintf(timedelayfile, "%s_timedelay.txt", read_file);
-				if ((tfp = fopen(timedelayfile, "w")) == NULL)
-					{
-					error = MB_ERROR_OPEN_FAIL;
-					fprintf(stderr,"\nUnable to open time delay file <%s> for writing\n",timedelayfile);
-					fprintf(stderr,"\nProgram <%s> Terminated\n",
-						program_name);
-					exit(error);
-					}
-				}
-
-			if (verbose > 0)
-				fprintf(stderr,"R7KRECID_BluefinNav: 7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d n:%d\n",
-			time_i[0],time_i[1],time_i[2],
-			time_i[3],time_i[4],time_i[5],time_i[6],
-			header->RecordNumber,bluefin->number_frames);
-			for (i=0;i<bluefin->number_frames;i++)
-				{
-				time_j[0] = bluefin->nav[i].s7kTime.Year;
-				time_j[1] = bluefin->nav[i].s7kTime.Day;
-				time_j[2] = 60 * bluefin->nav[i].s7kTime.Hours + bluefin->nav[i].s7kTime.Minutes;
-				time_j[3] = (int) bluefin->nav[i].s7kTime.Seconds;
-				time_j[4] = (int) (1000000 * (bluefin->nav[i].s7kTime.Seconds - time_j[3]));
-				mb_get_itime(verbose, time_j, time_i);
-				if (verbose > 0)
-				fprintf(stderr,"                       %2.2d          7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) Pos_time:%f\n",
-					i,time_i[0],time_i[1],time_i[2],
-					time_i[3],time_i[4],time_i[5],time_i[6],
-					bluefin->nav[i].position_time);
-
-				/* output time delay from MBARI AUV */
-				if (tfp != NULL)
-					{
-					fprintf(tfp,"%f %f\n",
-					bluefin->nav[i].position_time,(-0.001*(double)bluefin->nav[i].timedelay));
-					}
-				}
-
-			/* allocate memory for position arrays if needed */
-			if (bluefin->number_frames > 0
-				&& ndat_nav + bluefin->number_frames >= ndat_nav_alloc)
-				{
-				ndat_nav_alloc += MAX(MB7KPREPROCESS_ALLOC_CHUNK, bluefin->number_frames);
-				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_nav_alloc*sizeof(double),(void **)&dat_nav_time_d,&error);
-				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_nav_alloc*sizeof(double),(void **)&dat_nav_lon,&error);
-				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_nav_alloc*sizeof(double),(void **)&dat_nav_lat,&error);
-				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_nav_alloc*sizeof(double),(void **)&dat_nav_speed,&error);
-				if (error != MB_ERROR_NO_ERROR)
-					{
-					mb_error(verbose,error,&message);
-					fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",message);
-					fprintf(stderr,"\nProgram <%s> Terminated\n",
-					    program_name);
-					exit(error);
-					}
-				}
-
-			/* allocate memory for sonar heading arrays if needed */
-			if (bluefin->number_frames > 0
-				&& ndat_heading + bluefin->number_frames >= ndat_heading_alloc)
-				{
-				ndat_heading_alloc += MAX(MB7KPREPROCESS_ALLOC_CHUNK, bluefin->number_frames);
-				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_heading_alloc*sizeof(double),(void **)&dat_heading_time_d,&error);
-				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_heading_alloc*sizeof(double),(void **)&dat_heading_heading,&error);
-				if (error != MB_ERROR_NO_ERROR)
-					{
-					mb_error(verbose,error,&message);
-					fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",message);
-					fprintf(stderr,"\nProgram <%s> Terminated\n",
-					    program_name);
-					exit(error);
-					}
-				}
-
-			/* allocate memory for attitude arrays if needed */
-			if (bluefin->number_frames > 0
-				&& ndat_rph + bluefin->number_frames >= ndat_rph_alloc)
-				{
-				ndat_rph_alloc += MAX(MB7KPREPROCESS_ALLOC_CHUNK, bluefin->number_frames);
-				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_rph_alloc*sizeof(double),(void **)&dat_rph_time_d,&error);
-				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_rph_alloc*sizeof(double),(void **)&dat_rph_roll,&error);
-				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_rph_alloc*sizeof(double),(void **)&dat_rph_pitch,&error);
-				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_rph_alloc*sizeof(double),(void **)&dat_rph_heave,&error);
-				if (error != MB_ERROR_NO_ERROR)
-					{
-					mb_error(verbose,error,&message);
-					fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",message);
-					fprintf(stderr,"\nProgram <%s> Terminated\n",
-					    program_name);
-					exit(error);
-					}
-				}
-
-			/* allocate memory for altitude arrays if needed */
-			if (bluefin->number_frames > 0
-				&& ndat_altitude + bluefin->number_frames >= ndat_altitude_alloc)
-				{
-				ndat_altitude_alloc += MAX(MB7KPREPROCESS_ALLOC_CHUNK, bluefin->number_frames);
-				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_altitude_alloc*sizeof(double),(void **)&dat_altitude_time_d,&error);
-				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_altitude_alloc*sizeof(double),(void **)&dat_altitude_altitude,&error);
-				if (error != MB_ERROR_NO_ERROR)
-					{
-					mb_error(verbose,error,&message);
-					fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",message);
-					fprintf(stderr,"\nProgram <%s> Terminated\n",
-					    program_name);
-					exit(error);
-					}
-				}
-
-			/* allocate memory for sonar depth arrays if needed */
-			if (bluefin->number_frames > 0
-				&& ndat_sonardepth + bluefin->number_frames >= ndat_sonardepth_alloc)
-				{
-				ndat_sonardepth_alloc += MAX(MB7KPREPROCESS_ALLOC_CHUNK, bluefin->number_frames);
-				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_sonardepth_alloc*sizeof(double),(void **)&dat_sonardepth_time_d,&error);
-				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_sonardepth_alloc*sizeof(double),(void **)&dat_sonardepth_sonardepth,&error);
-				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_sonardepth_alloc*sizeof(double),(void **)&dat_sonardepth_sonardepthfilter,&error);
-				if (error != MB_ERROR_NO_ERROR)
-					{
-					mb_error(verbose,error,&message);
-					fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",message);
-					fprintf(stderr,"\nProgram <%s> Terminated\n",
-					    program_name);
-					exit(error);
-					}
-				}
-
-			if (bluefin->number_frames > 0
-				&& ntimedelay + bluefin->number_frames >= ntimedelay_alloc)
-				{
-				ntimedelay_alloc +=  MB7KPREPROCESS_ALLOC_CHUNK;
-				status = mb_reallocd(verbose,__FILE__,__LINE__,ntimedelay_alloc*sizeof(double),(void **)&timedelay_time_d,&error);
-				status = mb_reallocd(verbose,__FILE__,__LINE__,ntimedelay_alloc*sizeof(double),(void **)&timedelay_timedelay,&error);
-				}
-
-			/* store the navigation and attitude data */
-			for (i=0;i<bluefin->number_frames;i++)
-				{
-				/* store regular nav and attitude values */
-				if (ndat_nav == 0 || dat_nav_time_d[ndat_nav-1] < bluefin->nav[i].position_time)
-					{
-					dat_nav_time_d[ndat_nav] = bluefin->nav[i].position_time;
-					dat_nav_lon[ndat_nav] = RTD * bluefin->nav[i].longitude;
-					dat_nav_lat[ndat_nav] = RTD * bluefin->nav[i].latitude;
-					dat_nav_speed[ndat_nav] = bluefin->nav[i].speed;
-					ndat_nav++;
-					}
-				if (ndat_heading == 0 || dat_heading_time_d[ndat_heading-1] < bluefin->nav[i].position_time)
-					{
-					dat_heading_time_d[ndat_heading] = bluefin->nav[i].position_time;
-					dat_heading_heading[ndat_heading] = RTD * bluefin->nav[i].yaw;
-					ndat_heading++;
-					}
-				if (ndat_rph == 0 || dat_rph_time_d[ndat_rph-1] < bluefin->nav[i].position_time)
-					{
-					dat_rph_time_d[ndat_rph] = bluefin->nav[i].position_time;
-					dat_rph_roll[ndat_rph] = RTD * bluefin->nav[i].roll;
-					dat_rph_pitch[ndat_rph] = RTD * bluefin->nav[i].pitch;
-					dat_rph_heave[ndat_rph] = 0.0;
-					ndat_rph++;
-					}
-				if (ndat_altitude == 0 || dat_altitude_time_d[ndat_altitude-1] < bluefin->nav[i].position_time)
-					{
-					dat_altitude_time_d[ndat_altitude] = bluefin->nav[i].position_time;
-					dat_altitude_altitude[ndat_altitude] = bluefin->nav[i].altitude;
-					ndat_altitude++;
-					}
-				if (ndat_sonardepth == 0 || dat_sonardepth_time_d[ndat_sonardepth-1] < bluefin->nav[i].depth_time)
-					{
-					dat_sonardepth_time_d[ndat_sonardepth] = bluefin->nav[i].depth_time;
-					dat_sonardepth_sonardepth[ndat_sonardepth] = bluefin->nav[i].depth;
-					dat_sonardepth_sonardepthfilter[ndat_sonardepth] = 0.0;
-					ndat_sonardepth++;
-					}
-
-				/* deal with MBARI AUV time delay values */
-/*fprintf(stderr,"TIMEDELAYS: count:%d delay: %d",ntimedelaycount,bluefin->nav[i].timedelay);*/
-				if (ntimedelaycount == 0)
-					{
-					timedelay_time_d[ntimedelay] = bluefin->nav[i].position_time;
-					timedelay_timedelay[ntimedelay] = (-0.001 * (double)bluefin->nav[i].timedelay);
-/*fprintf(stderr,"   USED: %f",timedelay_timedelay[ntimedelay]);*/
-					ntimedelay++;
-					}
-				else if (timedelay_timedelay[ntimedelay-1]
-							> (-0.001 * (double)bluefin->nav[i].timedelay))
-					{
-					timedelay_time_d[ntimedelay-1] = bluefin->nav[i].position_time;
-					timedelay_timedelay[ntimedelay-1] = (-0.001 * (double)bluefin->nav[i].timedelay);
-/*fprintf(stderr,"   USED: %d %f",ntimedelay,timedelay_timedelay[ntimedelay-1]);*/
-					}
-/*fprintf(stderr,"\n");*/
-				ntimedelaycount++;
-				if (ntimedelaycount >= 100)
-					ntimedelaycount = 0;
-				}
-
-			}
-
-
-	   	/* handle subbottom data */
-		else if (status == MB_SUCCESS && kind == MB_DATA_SUBBOTTOM_SUBBOTTOM)
-			{
-			nrec_fsdwsbp++;
-
-			fsdwsb = &(istore->fsdwsb);
-			header = &(fsdwsb->header);
-			time_j[0] = header->s7kTime.Year;
-			time_j[1] = header->s7kTime.Day;
-			time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-			time_j[3] = (int) header->s7kTime.Seconds;
-			time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-			mb_get_itime(verbose, time_j, time_i);
-			mb_get_time(verbose, time_i, &time_d);
-			fsdwchannel = &(fsdwsb->channel);
-			fsdwsegyheader = &(fsdwsb->segyheader);
-			if (verbose > 0)
-				fprintf(stderr,"R7KRECID_FSDWsubbottom:            7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) FSDWtime(%4.4d-%3.3d %2.2d:%2.2d:%2.2d.%3.3d) ping:%d sampint:%d samples:%d\n",
-				time_i[0],time_i[1],time_i[2],
-				time_i[3],time_i[4],time_i[5],time_i[6],
-				fsdwsegyheader->year,fsdwsegyheader->day,fsdwsegyheader->hour,fsdwsegyheader->minute,fsdwsegyheader->second,
-				fsdwsegyheader->millisecondsToday - 1000 * (int)(0.001 * fsdwsegyheader->millisecondsToday),
-				fsdwsb->ping_number,fsdwchannel->sample_interval,fsdwchannel->number_samples);
-			}
-
-	   	/* handle low frequency sidescan data */
-		else if (status == MB_SUCCESS && kind == MB_DATA_SIDESCAN2)
-			{
-			nrec_fsdwsslo++;
-
-			fsdwsslo = &(istore->fsdwsslo);
-			header = &(fsdwsslo->header);
-			time_j[0] = header->s7kTime.Year;
-			time_j[1] = header->s7kTime.Day;
-			time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-			time_j[3] = (int) header->s7kTime.Seconds;
-			time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-			mb_get_itime(verbose, time_j, time_i);
-			mb_get_time(verbose, time_i, &time_d);
-			for (i=0;i<fsdwsslo->number_channels;i++)
-				{
-				fsdwchannel = &(fsdwsslo->channel[i]);
-				fsdwssheader = &(fsdwsslo->ssheader[i]);
-				if (verbose > 0)
-				fprintf(stderr,"R7KRECID_FSDWsidescanLo:           7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) FSDWtime(%4.4d-%3.3d %2.2d:%2.2d:%2.2d.%3.3d) ping:%d channel:%d sampint:%d samples:%d\n",
-					time_i[0],time_i[1],time_i[2],
-					time_i[3],time_i[4],time_i[5],time_i[6],
-					fsdwssheader->year,fsdwssheader->day,fsdwssheader->hour,fsdwssheader->minute,fsdwssheader->second,
-					fsdwssheader->millisecondsToday - 1000 * (int)(0.001 * fsdwssheader->millisecondsToday),
-					fsdwsslo->ping_number,fsdwchannel->number,
-					fsdwchannel->sample_interval,fsdwchannel->number_samples);
-				}
-
-			/* allocate memory for edgetech timetag arrays if needed */
-			if (nedget == 0 || nedget >= nedget_alloc)
-				{
-				nedget_alloc +=  MB7KPREPROCESS_ALLOC_CHUNK;
-				status = mb_reallocd(verbose,__FILE__,__LINE__,nedget_alloc*sizeof(double),(void **)&edget_time_d,&error);
-				status = mb_reallocd(verbose,__FILE__,__LINE__,nedget_alloc*sizeof(int),(void **)&edget_ping,&error);
-				status = mb_reallocd(verbose,__FILE__,__LINE__,nedget_alloc*sizeof(double),(void **)&edget_time_d_new,&error);
-				status = mb_reallocd(verbose,__FILE__,__LINE__,nedget_alloc*sizeof(double),(void **)&edget_time_offset,&error);
-				status = mb_reallocd(verbose,__FILE__,__LINE__,nedget_alloc*sizeof(int),(void **)&edget_ping_offset,&error);
-				status = mb_reallocd(verbose,__FILE__,__LINE__,nedget_alloc*sizeof(int),(void **)&edget_good_offset,&error);
-				if (error != MB_ERROR_NO_ERROR)
-					{
-					mb_error(verbose,error,&message);
-					fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",message);
-					fprintf(stderr,"\nProgram <%s> Terminated\n",
-					    program_name);
-					exit(error);
-					}
-				}
-
-			/* store the edgetech time stamp */
-			fsdwchannel = &(fsdwsslo->channel[0]);
-			fsdwssheader = &(fsdwsslo->ssheader[0]);
-			time_j[0] = fsdwssheader->year;
-			time_j[1] = fsdwssheader->day;
-			time_j[2] = 60 * fsdwssheader->hour + fsdwssheader->minute;
-			time_j[3] = fsdwssheader->second;
-			time_j[4] = 1000 * (fsdwssheader->millisecondsToday
-						- 1000 * ((int)(0.001 * fsdwssheader->millisecondsToday)));
-			mb_get_itime(verbose, time_j, time_i);
-			mb_get_time(verbose, time_i, &time_d);
-			if (nedget == 0 || time_d > edget_time_d[nedget-1])
-				{
-				edget_time_d[nedget] = time_d;
-				edget_ping[nedget] = fsdwssheader->pingNum;
-
-				/* grab the last reson ping time if it exists */
-				if (nbatht > 1)
-					{
-					edget_time_offset[nedget] = batht_time_d[nbatht-1] + (batht_time_d[nbatht-1] - batht_time_d[nbatht-2]) - time_d;
-					edget_ping_offset[nedget] = batht_ping[nbatht-1] - fsdwssheader->pingNum;
-					edget_good_offset[nedget] = MB_YES;
-					}
-				else
-					{
-					edget_time_offset[nedget] = -9999.99;
-					edget_ping_offset[nedget] = 0;
-					edget_good_offset[nedget] = MB_NO;
-					}
-				nedget++;
-				}
-			sslo_last_time_d = time_d;
-			sslo_last_ping = fsdwssheader->pingNum;
-			}
-
-	   	/* handle high frequency sidescan data */
-		else if (status == MB_SUCCESS && kind == MB_DATA_SIDESCAN3)
-			{
-			nrec_fsdwsshi++;
-
-			fsdwsshi = &(istore->fsdwsshi);
-			header = &(fsdwsshi->header);
-			time_j[0] = header->s7kTime.Year;
-			time_j[1] = header->s7kTime.Day;
-			time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-			time_j[3] = (int) header->s7kTime.Seconds;
-			time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-			mb_get_itime(verbose, time_j, time_i);
-			mb_get_time(verbose, time_i, &time_d);
-			for (i=0;i<fsdwsshi->number_channels;i++)
-				{
-				fsdwchannel = &(fsdwsshi->channel[i]);
-				fsdwssheader = &(fsdwsshi->ssheader[i]);
-				if (verbose > 0)
-				fprintf(stderr,"R7KRECID_FSDWsidescanHi:           7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) FSDWtime(%4.4d-%3.3d %2.2d:%2.2d:%2.2d.%3.3d) ping:%d channel:%d sampint:%d samples:%d\n",
-					time_i[0],time_i[1],time_i[2],
-					time_i[3],time_i[4],time_i[5],time_i[6],
-					fsdwssheader->year,fsdwssheader->day,fsdwssheader->hour,fsdwssheader->minute,fsdwssheader->second,
-					fsdwssheader->millisecondsToday - 1000 * (int)(0.001 * fsdwssheader->millisecondsToday),
-					fsdwsshi->ping_number,fsdwchannel->number,
-					fsdwchannel->sample_interval,fsdwchannel->number_samples);
-				}
-			}
-
-	   	/* handle unknown data */
-		else  if (status == MB_SUCCESS)
-			{
-/*fprintf(stderr,"DATA TYPE UNKNOWN: status:%d error:%d kind:%d\n",status,error,kind);*/
-			nrec_other++;
-			}
-
-	   	/* handle read error */
-		else
-			{
-/*fprintf(stderr,"READ FAILURE: status:%d error:%d kind:%d\n",status,error,kind);*/
-			}
-
-		/* print debug statements */
-		if (verbose >= 2)
-			{
-			fprintf(stderr,"\ndbg2  Ping read in program <%s>\n",
-				program_name);
-			fprintf(stderr,"dbg2       kind:           %d\n",kind);
-			fprintf(stderr,"dbg2       error:          %d\n",error);
-			fprintf(stderr,"dbg2       status:         %d\n",status);
-			}
-
-		/* set reson_lastread flag */
-		if (status == MB_SUCCESS && kind == MB_DATA_DATA)
-			reson_lastread = MB_YES;
-		else
-			reson_lastread = MB_NO;
-
-		/* set sslo_lastread flag */
-		if (status == MB_SUCCESS && kind == MB_DATA_SIDESCAN2)
-			sslo_lastread = MB_YES;
-		else
-			sslo_lastread = MB_NO;
-		}
-
-	/* close the swath file */
-	status = mb_close(verbose,&imbio_ptr,&error);
-
-	/* output counts */
-	fprintf(stdout, "\nData records read from: %s\n", ifile);
-	fprintf(stdout, "     File Header:                       %d\n", nrec_fileheader);
-	fprintf(stdout, "     Multibeam:                         %d\n", nrec_multibeam);
-	fprintf(stdout, "          Volatile Settings:                 %d\n", nrec_volatilesettings);
-	fprintf(stdout, "          Match Filter:                      %d\n", nrec_matchfilter);
-	fprintf(stdout, "          Beam Geometry:                     %d\n", nrec_beamgeometry);
-	fprintf(stdout, "          Remote Control:                    %d\n", nrec_remotecontrolsettings);
-	fprintf(stdout, "          Bathymetry:                        %d\n", nrec_bathymetry);
-	fprintf(stdout, "          Processed Sidescan:                %d\n", nrec_processedsidescan);
-	fprintf(stdout, "          Backscatter:                       %d\n", nrec_backscatter);
-	fprintf(stdout, "          Beam:                              %d\n", nrec_beam);
-	fprintf(stdout, "          Image:                             %d\n", nrec_image);
-	fprintf(stdout, "          V2PingMotion:                      %d\n", nrec_v2pingmotion);
-	fprintf(stdout, "          V2DetectionSetup:                  %d\n", nrec_v2detectionsetup);
-	fprintf(stdout, "          V2Beamformed:                      %d\n", nrec_v2beamformed);
-	fprintf(stdout, "          V2Detection:                       %d\n", nrec_v2detection);
-	fprintf(stdout, "          V2RawDetection:                    %d\n", nrec_v2rawdetection);
-	fprintf(stdout, "          V2Snippet:                         %d\n", nrec_v2snippet);
-	fprintf(stdout, "          Calibrated Snippet:                %d\n", nrec_calibratedsnippet);
-	fprintf(stdout, "          Processedsidescan:                 %d\n", nrec_processedsidescan);
-	fprintf(stdout, "     Reference:                         %d\n", nrec_reference);
-	fprintf(stdout, "     Uncalibrated Sensor Offset:        %d\n", nrec_sensoruncal);
-	fprintf(stdout, "     Calibrated Sensor Offset:          %d\n", nrec_sensorcal);
-	fprintf(stdout, "     Position:                          %d\n", nrec_position);
-	fprintf(stdout, "     Custom Attitude:                   %d\n", nrec_customattitude);
-	fprintf(stdout, "     Tide:                              %d\n", nrec_tide);
-	fprintf(stdout, "     Altitude:                          %d\n", nrec_altitude);
-	fprintf(stdout, "     Motion Over Ground:                %d\n", nrec_motion);
-	fprintf(stdout, "     Depth:                             %d\n", nrec_depth);
-	fprintf(stdout, "     Sound Speed Profile:               %d\n", nrec_svp);
-	fprintf(stdout, "     CTD:                               %d\n", nrec_ctd);
-	fprintf(stdout, "     Geodosy:                           %d\n", nrec_geodesy);
-	fprintf(stdout, "     Roll Pitch Heave:                  %d\n", nrec_rollpitchheave);
-	fprintf(stdout, "     Heading:                           %d\n", nrec_heading);
-	fprintf(stdout, "     Survey Line:                       %d\n", nrec_surveyline);
-	fprintf(stdout, "     Navigation:                        %d\n", nrec_navigation);
-	fprintf(stdout, "     Attitude:                          %d\n", nrec_attitude);
-	fprintf(stdout, "     Edgetech Low Frequency Sidescan:   %d\n", nrec_fsdwsslo);
-	fprintf(stdout, "     Edgetech High Frequency Sidescan:  %d\n", nrec_fsdwsshi);
-	fprintf(stdout, "     Edgetech Subbottom:                %d\n", nrec_fsdwsbp);
-	fprintf(stdout, "     MBARI Mapping AUV Environmental:   %d\n", nrec_bluefinnav);
-	fprintf(stdout, "     MBARI Mapping AUV Navigation:      %d\n", nrec_bluefinenv);
-	fprintf(stdout, "     Configuration:                     %d\n", nrec_configuration);
-	fprintf(stdout, "     Calibration:                       %d\n", nrec_calibration);
-	fprintf(stdout, "     Vertical Depth:                    %d\n", nrec_verticaldepth);
-	fprintf(stdout, "     Installation:                      %d\n", nrec_installation);
-	fprintf(stdout, "     System Event Message:              %d\n", nrec_systemeventmessage);
-	fprintf(stdout, "     Other:                             %d\n", nrec_other);
-	nrec_fileheader_tot += nrec_fileheader;
-	nrec_multibeam_tot += nrec_multibeam;
-	nrec_volatilesettings_tot += nrec_volatilesettings;
-	nrec_matchfilter_tot += nrec_matchfilter;
-	nrec_beamgeometry_tot += nrec_beamgeometry;
-	nrec_remotecontrolsettings_tot += nrec_remotecontrolsettings;
-	nrec_bathymetry_tot += nrec_bathymetry;
-	nrec_backscatter_tot += nrec_backscatter;
-	nrec_beam_tot += nrec_beam;
-	nrec_image_tot += nrec_image;
-	nrec_v2pingmotion_tot += nrec_v2pingmotion;
-	nrec_v2detectionsetup_tot += nrec_v2detectionsetup;
-	nrec_v2beamformed_tot += nrec_v2beamformed;
-	nrec_v2detection_tot += nrec_v2detection;
-	nrec_v2rawdetection_tot += nrec_v2rawdetection;
-	nrec_v2snippet_tot += nrec_v2snippet;
-	nrec_calibratedsnippet_tot += nrec_calibratedsnippet;
-	nrec_processedsidescan_tot += nrec_processedsidescan;
-	nrec_reference_tot += nrec_reference;
-	nrec_sensoruncal_tot += nrec_sensoruncal;
-	nrec_sensorcal_tot += nrec_sensorcal;
-	nrec_position_tot += nrec_position;
-	nrec_customattitude_tot += nrec_customattitude;
-	nrec_tide_tot += nrec_tide;
-	nrec_altitude_tot += nrec_altitude;
-	nrec_motion_tot += nrec_motion;
-	nrec_depth_tot += nrec_depth;
-	nrec_svp_tot += nrec_svp;
-	nrec_ctd_tot += nrec_ctd;
-	nrec_geodesy_tot += nrec_geodesy;
-	nrec_rollpitchheave_tot += nrec_rollpitchheave;
-	nrec_heading_tot += nrec_heading;
-	nrec_surveyline_tot += nrec_surveyline;
-	nrec_navigation_tot += nrec_navigation;
-	nrec_attitude_tot += nrec_attitude;
-	nrec_fsdwsbp_tot += nrec_fsdwsbp;
-	nrec_fsdwsslo_tot += nrec_fsdwsslo;
-	nrec_fsdwsshi_tot += nrec_fsdwsshi;
-	nrec_bluefinenv_tot += nrec_bluefinenv;
-	nrec_position_tot += nrec_position;
-	nrec_bluefinnav_tot += nrec_bluefinnav;
-	nrec_configuration_tot += nrec_configuration;
-	nrec_calibration_tot += nrec_calibration;
-	nrec_verticaldepth_tot += nrec_verticaldepth;
-	nrec_installation_tot += nrec_installation;
-	nrec_systemeventmessage_tot += nrec_systemeventmessage;
-	nrec_other_tot += nrec_other;
-
-	/* figure out whether and what to read next */
-        if (read_datalist == MB_YES)
-                {
-		if ((status = mb_datalist_read(verbose,datalist,
-			    ifile,&format,&file_weight,&error))
-			    == MB_SUCCESS)
-                        read_data = MB_YES;
-                else
-                        read_data = MB_NO;
-                }
-        else
-                {
-                read_data = MB_NO;
-                }
-
-	/* end loop over files in list */
-	}
-	if (read_datalist == MB_YES)
-		mb_datalist_close(verbose,&datalist,&error);
-
-	/* close time delay file */
-	if (tfp != NULL)
-		{
-		fclose(tfp);
-		tfp = NULL;
-		}
-
-	/* apply time lag to all relevant data
-		timelag value calculated either from model imported from file (timelagmode == MB7KPREPROCESS_TIMELAG_MODEL)
-			or by a constant offset (timelagmode == MB7KPREPROCESS_TIMELAG_CONSTANT) plus any timedelay
-				values embedded in the data (MBARI AUV bluefin nav records only) */
-	if (timelagmode != MB7KPREPROCESS_TIMELAG_OFF)
-		{
-		/* correct time of navigation, heading, attitude, sonardepth, altitude
-			read from asynchronous records in 7k files */
-		if (timedelaymode == MB7KPREPROCESS_TIMEDELAY_ON || timelagmode != MB7KPREPROCESS_TIMELAG_OFF)
-			{
-if (timedelaymode == MB7KPREPROCESS_TIMEDELAY_ON)
-	fprintf(stderr,"Applying Reson vs MVC time delay from MBARI Mapping AUV\n");
-else
-	fprintf(stderr,"No time delay correction\n");
-if (timelagmode == MB7KPREPROCESS_TIMELAG_CONSTANT)
-	fprintf(stderr,"Applying constant time lag of %f seconds\n",timelagconstant);
-else if (timelagmode == MB7KPREPROCESS_TIMELAG_MODEL)
-	fprintf(stderr,"Applying time lag model from file: %s\n",timelagfile);
-else
-	fprintf(stderr,"No time lag correction\n");
-fprintf(stderr,"Applying timelag to %d nav data\n", ndat_nav);
-			j = 0;
-			for (i=0;i<ndat_nav;i++)
-				{
-				/* get timelag value */
-				timelag = 0.0;
-				if (timedelaymode == MB7KPREPROCESS_TIMEDELAY_ON && ntimedelay > 0)
-				interp_status = mb_linear_interp(verbose,
-							timedelay_time_d-1, timedelay_timedelay-1,
-							ntimedelay, dat_nav_time_d[i], &timelag, &jtimedelay,
-							&error);
-				if (timelagmode == MB7KPREPROCESS_TIMELAG_CONSTANT)
-					{
-					timelag -= timelagconstant;
-					}
-				else if (timelagmode == MB7KPREPROCESS_TIMELAG_MODEL && ntimelag > 0)
-					{
-					interp_status = mb_linear_interp(verbose,
-								timelag_time_d-1, timelag_model-1,
-								ntimelag, dat_nav_time_d[i], &timelagm, &jtimelag,
-								&error);
-					timelag -= timelagm;
-					}
-				dat_nav_time_d[i] += timelag;
-				}
-fprintf(stderr,"Applying timelag to %d heading data\n", ndat_heading);
-			j = 0;
-			for (i=0;i<ndat_heading;i++)
-				{
-				/* get timelag value */
-				timelag = 0.0;
-				if (timedelaymode == MB7KPREPROCESS_TIMEDELAY_ON && ntimedelay > 0)
-				interp_status = mb_linear_interp(verbose,
-							timedelay_time_d-1, timedelay_timedelay-1,
-							ntimedelay, dat_heading_time_d[i], &timelag, &jtimedelay,
-							&error);
-				if (timelagmode == MB7KPREPROCESS_TIMELAG_CONSTANT)
-					{
-					timelag -= timelagconstant;
-					}
-				else if (timelagmode == MB7KPREPROCESS_TIMELAG_MODEL && ntimelag > 0)
-					{
-					interp_status = mb_linear_interp(verbose,
-								timelag_time_d-1, timelag_model-1,
-								ntimelag, dat_heading_time_d[i], &timelagm, &jtimelag,
-								&error);
-					timelag -= timelagm;
-					}
-				dat_heading_time_d[i] += timelag;
-				}
-fprintf(stderr,"Applying timelag to %d attitude data\n", ndat_rph);
-			j = 0;
-			for (i=0;i<ndat_rph;i++)
-				{
-				/* get timelag value */
-				timelag = 0.0;
-				if (timedelaymode == MB7KPREPROCESS_TIMEDELAY_ON && ntimedelay > 0)
-				interp_status = mb_linear_interp(verbose,
-							timedelay_time_d-1, timedelay_timedelay-1,
-							ntimedelay, dat_rph_time_d[i], &timelag, &jtimedelay,
-							&error);
-				if (timelagmode == MB7KPREPROCESS_TIMELAG_CONSTANT)
-					{
-					timelag -= timelagconstant;
-					}
-				else if (timelagmode == MB7KPREPROCESS_TIMELAG_MODEL && ntimelag > 0)
-					{
-					interp_status = mb_linear_interp(verbose,
-								timelag_time_d-1, timelag_model-1,
-								ntimelag, dat_rph_time_d[i], &timelagm, &jtimelag,
-								&error);
-					timelag -= timelagm;
-					}
-				dat_rph_time_d[i] += timelag;
-				}
-fprintf(stderr,"Applying timelag to %d sonardepth data\n", ndat_sonardepth);
-			j = 0;
-			for (i=0;i<ndat_sonardepth;i++)
-				{
-				/* get timelag value */
-				timelag = 0.0;
-				if (timedelaymode == MB7KPREPROCESS_TIMEDELAY_ON && ntimedelay > 0)
-				interp_status = mb_linear_interp(verbose,
-							timedelay_time_d-1, timedelay_timedelay-1,
-							ntimedelay, dat_sonardepth_time_d[i], &timelag, &jtimedelay,
-							&error);
-				if (timelagmode == MB7KPREPROCESS_TIMELAG_CONSTANT)
-					{
-					timelag -= timelagconstant;
-					}
-				else if (timelagmode == MB7KPREPROCESS_TIMELAG_MODEL && ntimelag > 0)
-					{
-					interp_status = mb_linear_interp(verbose,
-								timelag_time_d-1, timelag_model-1,
-								ntimelag, dat_sonardepth_time_d[i], &timelagm, &jtimelag,
-								&error);
-					timelag -= timelagm;
-					}
-				dat_sonardepth_time_d[i] += timelag;
-				}
-fprintf(stderr,"Applying timelag to %d altitude data\n", ndat_altitude);
-			j = 0;
-			for (i=0;i<ndat_altitude;i++)
-				{
-				/* get timelag value */
-				timelag = 0.0;
-				if (timedelaymode == MB7KPREPROCESS_TIMEDELAY_ON && ntimedelay > 0)
-				interp_status = mb_linear_interp(verbose,
-							timedelay_time_d-1, timedelay_timedelay-1,
-							ntimedelay, dat_altitude_time_d[i], &timelag, &jtimedelay,
-							&error);
-				if (timelagmode == MB7KPREPROCESS_TIMELAG_CONSTANT)
-					{
-					timelag -= timelagconstant;
-					}
-				else if (timelagmode == MB7KPREPROCESS_TIMELAG_MODEL && ntimelag > 0)
-					{
-					interp_status = mb_linear_interp(verbose,
-								timelag_time_d-1, timelag_model-1,
-								ntimelag, dat_altitude_time_d[i], &timelagm, &jtimelag,
-								&error);
-					timelag -= timelagm;
-					}
-				dat_altitude_time_d[i] += timelag;
-				}
-
-			/* correct time of INS data read from MBARI AUV log file */
-fprintf(stderr,"Applying timelag to %d INS data\n", nins);
-			for (i=0;i<nins;i++)
-				{
-				/* get timelag value */
-				timelag = 0.0;
-				if (timedelaymode == MB7KPREPROCESS_TIMEDELAY_ON && ntimedelay > 0)
-				interp_status = mb_linear_interp(verbose,
-							timedelay_time_d-1, timedelay_timedelay-1,
-							ntimedelay, ins_time_d[i], &timelag, &jtimedelay,
-							&error);
-				if (timelagmode == MB7KPREPROCESS_TIMELAG_CONSTANT)
-					{
-					timelag -= timelagconstant;
-					}
-				else if (timelagmode == MB7KPREPROCESS_TIMELAG_MODEL && ntimelag > 0)
-					{
-					interp_status = mb_linear_interp(verbose,
-								timelag_time_d-1, timelag_model-1,
-								ntimelag, ins_time_d[i], &timelagm, &jtimelag,
-								&error);
-					timelag -= timelagm;
-					}
-				ins_time_d[i] += timelag;
-				}
-fprintf(stderr,"Applying timelag to %d INS altitude data\n", nins_altitude);
-			for (i=0;i<nins_altitude;i++)
-				{
-				/* get timelag value */
-				timelag = 0.0;
-				if (timedelaymode == MB7KPREPROCESS_TIMEDELAY_ON && ntimedelay > 0)
-				interp_status = mb_linear_interp(verbose,
-							timedelay_time_d-1, timedelay_timedelay-1,
-							ntimedelay, ins_altitude_time_d[i], &timelag, &jtimedelay,
-							&error);
-				if (timelagmode == MB7KPREPROCESS_TIMELAG_CONSTANT)
-					{
-					timelag -= timelagconstant;
-					}
-				else if (timelagmode == MB7KPREPROCESS_TIMELAG_MODEL && ntimelag > 0)
-					{
-					interp_status = mb_linear_interp(verbose,
-								timelag_time_d-1, timelag_model-1,
-								ntimelag, ins_altitude_time_d[i], &timelagm, &jtimelag,
-								&error);
-					timelag -= timelagm;
-					}
-				ins_altitude_time_d[i] += timelag;
-				}
-fprintf(stderr,"Applying timelag to %d INS speed data\n", nins_speed);
-			for (i=0;i<nins_speed;i++)
-				{
-				/* get timelag value */
-				timelag = 0.0;
-				if (timedelaymode == MB7KPREPROCESS_TIMEDELAY_ON && ntimedelay > 0)
-				interp_status = mb_linear_interp(verbose,
-							timedelay_time_d-1, timedelay_timedelay-1,
-							ntimedelay, ins_speed_time_d[i], &timelag, &jtimedelay,
-							&error);
-				if (timelagmode == MB7KPREPROCESS_TIMELAG_CONSTANT)
-					{
-					timelag -= timelagconstant;
-					}
-				else if (timelagmode == MB7KPREPROCESS_TIMELAG_MODEL && ntimelag > 0)
-					{
-					interp_status = mb_linear_interp(verbose,
-								timelag_time_d-1, timelag_model-1,
-								ntimelag, ins_speed_time_d[i], &timelagm, &jtimelag,
-								&error);
-					timelag -= timelagm;
-					}
-				ins_speed_time_d[i] += timelag;
-				}
-
-			/* correct time of navigation and attitude data read from WHOI DSL nav and attitude file */
-fprintf(stderr,"Applying timelag to %d DSL nav data\n", ndsl);
-			for (i=0;i<ndsl;i++)
-				{
-				/* get timelag value */
-				timelag = 0.0;
-				if (timedelaymode == MB7KPREPROCESS_TIMEDELAY_ON && ntimedelay > 0)
-				interp_status = mb_linear_interp(verbose,
-							timedelay_time_d-1, timedelay_timedelay-1,
-							ntimedelay, dsl_time_d[i], &timelag, &jtimedelay,
-							&error);
-				if (timelagmode == MB7KPREPROCESS_TIMELAG_CONSTANT)
-					{
-					timelag -= timelagconstant;
-					}
-				else if (timelagmode == MB7KPREPROCESS_TIMELAG_MODEL && ntimelag > 0)
-					{
-					interp_status = mb_linear_interp(verbose,
-								timelag_time_d-1, timelag_model-1,
-								ntimelag, dsl_time_d[i], &timelagm, &jtimelag,
-								&error);
-					timelag -= timelagm;
-					}
-				dsl_time_d[i] += timelag;
-				}
-
-			/* correct time of navigation and attitude data read from Steve Rock file */
-fprintf(stderr,"Applying timelag to %d Steve Rock nav data\n", nrock);
-			for (i=0;i<nrock;i++)
-				{
-				/* get timelag value */
-				timelag = 0.0;
-				if (timedelaymode == MB7KPREPROCESS_TIMEDELAY_ON && ntimedelay > 0)
-				interp_status = mb_linear_interp(verbose,
-							timedelay_time_d-1, timedelay_timedelay-1,
-							ntimedelay, rock_time_d[i], &timelag, &jtimedelay,
-							&error);
-				if (timelagmode == MB7KPREPROCESS_TIMELAG_CONSTANT)
-					{
-					timelag -= timelagconstant;
-					}
-				else if (timelagmode == MB7KPREPROCESS_TIMELAG_MODEL && ntimelag > 0)
-					{
-					interp_status = mb_linear_interp(verbose,
-								timelag_time_d-1, timelag_model-1,
-								ntimelag, rock_time_d[i], &timelagm, &jtimelag,
-								&error);
-					timelag -= timelagm;
-					}
-				rock_time_d[i] += timelag;
-				}
-
-			/* correct time of sonar depth data read from separate file */
-fprintf(stderr,"Applying timelag to %d sonardepth nav data\n", nsonardepth);
-			for (i=0;i<nsonardepth;i++)
-				{
-				/* get timelag value */
-				timelag = 0.0;
-				if (timedelaymode == MB7KPREPROCESS_TIMEDELAY_ON && ntimedelay > 0)
-				interp_status = mb_linear_interp(verbose,
-							timedelay_time_d-1, timedelay_timedelay-1,
-							ntimedelay, sonardepth_time_d[i], &timelag, &jtimedelay,
-							&error);
-				if (timelagmode == MB7KPREPROCESS_TIMELAG_CONSTANT)
-					{
-					timelag -= timelagconstant;
-					}
-				else if (timelagmode == MB7KPREPROCESS_TIMELAG_MODEL && ntimelag > 0)
-					{
-					interp_status = mb_linear_interp(verbose,
-								timelag_time_d-1, timelag_model-1,
-								ntimelag, sonardepth_time_d[i], &timelagm, &jtimelag,
-								&error);
-					timelag -= timelagm;
-					}
-				sonardepth_time_d[i] += timelag;
-				}
-			}
-		}
-
-	/* if desired apply filtering to sonardepth data */
-	if (sonardepthfilter == MB_YES)
-		{
-		/* apply filtering to sonardepth data
-			read from asynchronous records in 7k files */
-		if (ndat_sonardepth > 1)
-			{
-fprintf(stderr,"Applying filtering to %d sonardepth data\n", ndat_sonardepth);
-			dtime = (dat_sonardepth_time_d[ndat_sonardepth-1]  - dat_sonardepth_time_d[0]) / ndat_sonardepth;
-			nhalffilter = (int)(4.0 * sonardepthfilterlength / dtime);
-			for (i=0;i<ndat_sonardepth;i++)
-				{
-				dat_sonardepth_sonardepthfilter[i] = 0.0;
-				sonardepth_filterweight = 0.0;
-				j1 = MAX(i - nhalffilter, 0);
-				j2 = MIN(i + nhalffilter, ndat_sonardepth - 1);
-				for (j=j1;j<=j2;j++)
-					{
-					dtol = (dat_sonardepth_time_d[j] - dat_sonardepth_time_d[i]) / sonardepthfilterlength;
-					weight = exp(-dtol * dtol);
-					dat_sonardepth_sonardepthfilter[i] += weight * dat_sonardepth_sonardepth[j];
-					sonardepth_filterweight += weight;
-					}
-				if (sonardepth_filterweight > 0.0)
-					dat_sonardepth_sonardepthfilter[i] /= sonardepth_filterweight;
-				}
-			for (i=0;i<ndat_sonardepth;i++)
-				{
-				if (dat_sonardepth_sonardepth[i] < 2.0 * sonardepthfilterdepth)
-					factor = 1.0;
-				else
-					factor = exp(-(dat_sonardepth_sonardepth[i] - 2.0 * sonardepthfilterdepth)
-							/ (sonardepthfilterdepth));
-				dat_sonardepth_sonardepth[i] = (1.0 - factor) * dat_sonardepth_sonardepth[i]
-							+ factor * dat_sonardepth_sonardepthfilter[i];
-				}
-			}
-
-		/* filter sonardepth data from separate file */
-		if (nsonardepth > 1)
-			{
-fprintf(stderr,"Applying filtering to %d sonardepth nav data\n", nsonardepth);
-			dtime = (sonardepth_time_d[nsonardepth-1]  - sonardepth_time_d[0]) / nsonardepth;
-			nhalffilter = (int)(4.0 * sonardepthfilterlength / dtime);
-			for (i=0;i<nsonardepth;i++)
-				{
-				sonardepth_sonardepthfilter[i] = 0.0;
-				sonardepth_filterweight = 0.0;
-				j1 = MAX(i - nhalffilter, 0);
-				j2 = MIN(i + nhalffilter, nsonardepth - 1);
-				for (j=j1;j<=j2;j++)
-					{
-					dtol = (sonardepth_time_d[j] - sonardepth_time_d[i]) / sonardepthfilterlength;
-					weight = exp(-dtol * dtol);
-					sonardepth_sonardepthfilter[i] += weight * sonardepth_sonardepth[j];
-					sonardepth_filterweight += weight;
-					}
-				if (sonardepth_filterweight > 0.0)
-					sonardepth_sonardepthfilter[i] /= sonardepth_filterweight;
-				}
-			for (i=0;i<nsonardepth;i++)
-				{
-				if (sonardepth_sonardepth[i] < 2.0 * sonardepthfilterdepth)
-					factor = 1.0;
-				else
-					factor = exp(-(sonardepth_sonardepth[i] - 2.0 * sonardepthfilterdepth)
-							/ (sonardepthfilterdepth));
-				sonardepth_sonardepth[i] = (1.0 - factor) * sonardepth_sonardepth[i]
-							+ factor * sonardepth_sonardepthfilter[i];
-				}
-			}
-
-		/* filter sonardepth data from separate INS file */
-		if (nins > 1)
-			{
-fprintf(stderr,"Applying filtering to %d INS nav data\n", nins);
-			for (i=0;i<nins;i++)
-				{
-				ins_sonardepthfilter[i] = 0.0;
-				sonardepth_filterweight = 0.0;
-				dtime = (ins_time_d[nins-1]  - ins_time_d[0]) / nins;
-				nhalffilter = (int)(4.0 * sonardepthfilterlength / dtime);
-				j1 = MAX(i - nhalffilter, 0);
-				j2 = MIN(i + nhalffilter, nins - 1);
-				for (j=j1;j<=j2;j++)
-					{
-					dtol = (ins_time_d[j] - ins_time_d[i]) / sonardepthfilterlength;
-					weight = exp(-dtol * dtol);
-					ins_sonardepthfilter[i] += weight * ins_sonardepth[j];
-					sonardepth_filterweight += weight;
-					}
-				if (sonardepth_filterweight > 0.0)
-					ins_sonardepthfilter[i] /= sonardepth_filterweight;
-				}
-			for (i=0;i<nins;i++)
-				{
-				if (ins_sonardepth[i] < 2.0 * sonardepthfilterdepth)
-					factor = 1.0;
-				else
-					factor = exp(-(ins_sonardepth[i] - 2.0 * sonardepthfilterdepth)
-							/ (sonardepthfilterdepth));
-				ins_sonardepth[i] = (1.0 - factor) * ins_sonardepth[i]
-							+ factor * ins_sonardepthfilter[i];
-				}
-			}
-
-		/* filter sonardepth data from separate WHOI DSL file */
-		if (ndsl > 1)
-			{
-fprintf(stderr,"Applying filtering to %d DSL nav data\n", ndsl);
-			for (i=0;i<ndsl;i++)
-				{
-				dsl_sonardepthfilter[i] = 0.0;
-				sonardepth_filterweight = 0.0;
-				dtime = (dsl_time_d[ndsl-1]  - dsl_time_d[0]) / ndsl;
-				nhalffilter = (int)(4.0 * sonardepthfilterlength / dtime);
-				j1 = MAX(i - nhalffilter, 0);
-				j2 = MIN(i + nhalffilter, ndsl - 1);
-				for (j=j1;j<=j2;j++)
-					{
-					dtol = (dsl_time_d[j] - dsl_time_d[i]) / sonardepthfilterlength;
-					weight = exp(-dtol * dtol);
-					dsl_sonardepthfilter[i] += weight * dsl_sonardepth[j];
-					sonardepth_filterweight += weight;
-					}
-				if (sonardepth_filterweight > 0.0)
-					dsl_sonardepthfilter[i] /= sonardepth_filterweight;
-				}
-			for (i=0;i<ndsl;i++)
-				{
-				if (dsl_sonardepth[i] < 2.0 * sonardepthfilterdepth)
-					factor = 1.0;
-				else
-					factor = exp(-(dsl_sonardepth[i] - 2.0 * sonardepthfilterdepth)
-							/ (sonardepthfilterdepth));
-				dsl_sonardepth[i] = (1.0 - factor) * dsl_sonardepth[i]
-							+ factor * dsl_sonardepthfilter[i];
-				}
-			}
-
-		/* filter sonardepth data from separate Steve Rock file */
-		if (nrock > 1)
-			{
-fprintf(stderr,"Applying filtering to %d Rock nav data\n", nrock);
-			for (i=0;i<nrock;i++)
-				{
-				rock_sonardepthfilter[i] = 0.0;
-				sonardepth_filterweight = 0.0;
-				dtime = (rock_time_d[nrock-1]  - rock_time_d[0]) / nrock;
-				nhalffilter = (int)(4.0 * sonardepthfilterlength / dtime);
-				j1 = MAX(i - nhalffilter, 0);
-				j2 = MIN(i + nhalffilter, ndsl - 1);
-				for (j=j1;j<=j2;j++)
-					{
-					dtol = (rock_time_d[j] - rock_time_d[i]) / sonardepthfilterlength;
-					weight = exp(-dtol * dtol);
-					rock_sonardepthfilter[i] += weight * rock_sonardepth[j];
-					sonardepth_filterweight += weight;
-					}
-				if (sonardepth_filterweight > 0.0)
-					rock_sonardepthfilter[i] /= sonardepth_filterweight;
-				}
-			for (i=0;i<nrock;i++)
-				{
-				if (rock_sonardepth[i] < 2.0 * sonardepthfilterdepth)
-					factor = 1.0;
-				else
-					factor = exp(-(rock_sonardepth[i] - 2.0 * sonardepthfilterdepth)
-							/ (sonardepthfilterdepth));
-				rock_sonardepth[i] = (1.0 - factor) * rock_sonardepth[i]
-							+ factor * rock_sonardepthfilter[i];
-				}
-			}
-		}
-
-	/* fix problems with batht timestamp arrays */
-	for (i=0;i<nbatht;i++)
-		{
-		if (batht_good_offset[i] == MB_NO)
-			{
-			foundstart = MB_NO;
-			foundend = MB_NO;
-			for (j = i - 1; j >= 0 && foundstart == MB_NO; j--)
-				{
-				if (batht_good_offset[j] == MB_YES)
-					{
-					foundstart = MB_YES;
-					start = j;
-					}
-				}
-			for (j = i + 1; j < nbatht && foundend == MB_NO; j++)
-				{
-				if (batht_good_offset[j] == MB_YES)
-					{
-					foundend = MB_YES;
-					end = j;
-					}
-				}
-			if (foundstart == MB_YES && foundend == MB_YES)
-				{
-				batht_time_offset[i] = batht_time_offset[start]
-							+ (batht_time_offset[end] - batht_time_offset[start])
-								* ((double)(i - start)) / ((double)(end - start));
-				}
-			else if (foundstart == MB_YES)
-				{
-				batht_time_offset[i] = batht_time_offset[start];
-				}
-			else if (foundend == MB_YES)
-				{
-				batht_time_offset[i] = batht_time_offset[end];
-				}
-			}
-		batht_time_d_new[i] = batht_time_d[i] + batht_time_offset[i];
-		}
-
-	/* fix problems with edget timestamp arrays */
-	for (i=0;i<nedget;i++)
-		{
-		if (edget_good_offset[i] == MB_NO)
-			{
-			foundstart = MB_NO;
-			foundend = MB_NO;
-			for (j = i - 1; j >= 0 && foundstart == MB_NO; j--)
-				{
-				if (edget_good_offset[j] == MB_YES)
-					{
-					foundstart = MB_YES;
-					start = j;
-					}
-				}
-			for (j = i + 1; j < nedget && foundend == MB_NO; j++)
-				{
-				if (edget_good_offset[j] == MB_YES)
-					{
-					foundend = MB_YES;
-					end = j;
-					}
-				}
-			if (foundstart == MB_YES && foundend == MB_YES)
-				{
-				edget_time_offset[i] = edget_time_offset[start]
-							+ (edget_time_offset[end] - edget_time_offset[start])
-								* ((double)(i - start)) / ((double)(end - start));
-				}
-			else if (foundstart == MB_YES)
-				{
-				edget_time_offset[i] = edget_time_offset[start];
-				}
-			else if (foundend == MB_YES)
-				{
-				edget_time_offset[i] = edget_time_offset[end];
-				}
-			}
-		edget_time_d_new[i] = edget_time_d[i] + edget_time_offset[i];
-		}
-
-	/* remove noise from position data associated with Kearfott INS on an ROV
-		that consists of jumps every two seconds */
-	if (kluge_kearfottrovnoise == MB_YES && ndat_nav > 2)
-		{
-		longitude_offset = 0.0;
-		latitude_offset = 0.0;
-		mb_coor_scale(verbose,dat_nav_lat[0],&mtodeglon,&mtodeglat);
-		for (i=1;i<ndat_nav;i++)
-			{
-			dat_nav_lon[i] -= longitude_offset;
-			dat_nav_lat[i] -= latitude_offset;
-
-			dx = (dat_nav_lon[i] - dat_nav_lon[i-1]) / mtodeglon;
-			dy = (dat_nav_lat[i] - dat_nav_lat[i-1]) / mtodeglat;
-			dt = (dat_nav_time_d[i] - dat_nav_time_d[i-1]);
-			v = sqrt(dx * dx + dy * dy) / dt;
-
-			if (v > 0.5)
-				{
-				longitude_offset += (dat_nav_lon[i] - dat_nav_lon[i-1]);
-				latitude_offset += (dat_nav_lat[i] - dat_nav_lat[i-1]);
-				dat_nav_lon[i] = dat_nav_lon[i-1];
-				dat_nav_lat[i] = dat_nav_lat[i-1];
-				}
-			}
-		}
-
-	/* output ins navigation and attitude data */
-	if (nins > 0 && (verbose > 0 || mode == MB7KPREPROCESS_TIMESTAMPLIST))
-		{
-		fprintf(stdout, "\nTotal INS navigation/attitude data read: %d\n", nins);
-		for (i=0;i<nins;i++)
-			{
-			fprintf(stdout, "  INS: %12d %17.6f %11.6f %10.6f %8.3f %7.3f %6.3f %6.3f %6.3f %6.3f\n",
-				i, ins_time_d[i], ins_lon[i], ins_lat[i], ins_heading[i],
-				ins_sonardepth[i], ins_altitude[i], ins_speed[i],
-				ins_roll[i], ins_pitch[i]);
-			}
-		fprintf(stdout, "\nTotal INS altitude data read: %d\n", nins_altitude);
-		for (i=0;i<nins_altitude;i++)
-			{
-			fprintf(stdout, "  INS ALT: %12d %17.6f %6.3f\n",
-				i, ins_altitude_time_d[i], ins_altitude[i]);
-			}
-		fprintf(stdout, "\nTotal INS speed data read: %d\n", nins_speed);
-		for (i=0;i<nins_speed;i++)
-			{
-			fprintf(stdout, "  INS SPD: %12d %17.6f %6.3f\n",
-				i, ins_speed_time_d[i], ins_speed[i]);
-			}
-		}
-
-	/* output auv sonardepth data */
-	if (nsonardepth > 0 && (verbose > 0 || mode == MB7KPREPROCESS_TIMESTAMPLIST))
-		{
-		fprintf(stdout, "\nTotal auv sonardepth data read: %d\n", nsonardepth);
-		for (i=0;i<nins;i++)
-			{
-			fprintf(stdout, "  SONARDEPTH: %12d %8.3f %8.3f\n",
-				i, sonardepth_time_d[i], sonardepth_sonardepth[i]);
-			}
-		}
-
-	/* output 7k navigation and attitude data */
-	if (verbose > 0 || mode == MB7KPREPROCESS_TIMESTAMPLIST)
-		{
-		fprintf(stdout, "\nTotal 7k navigation data read: %d\n", ndat_nav);
-		for (i=0;i<ndat_nav;i++)
-			{
-			fprintf(stdout, "  NAV: %5d %17.6f %11.6f %10.6f %6.3f\n",
-				i, dat_nav_time_d[i], dat_nav_lon[i], dat_nav_lat[i], dat_nav_speed[i]);
-			}
-		fprintf(stdout, "\nTotal heading data read: %d\n", ndat_heading);
-		for (i=0;i<ndat_heading;i++)
-			{
-			fprintf(stdout, "  HDG: %5d %17.6f %8.3f\n",
-				i, dat_heading_time_d[i], dat_heading_heading[i]);
-			}
-		fprintf(stdout, "\nTotal sonardepth data read: %d\n", ndat_sonardepth);
-		for (i=0;i<ndat_sonardepth;i++)
-			{
-			fprintf(stdout, "  DEP: %5d %17.6f %8.3f\n",
-				i, dat_sonardepth_time_d[i], dat_sonardepth_sonardepth[i]);
-			}
-		fprintf(stdout, "\nTotal altitude data read: %d\n", ndat_altitude);
-		for (i=0;i<ndat_altitude;i++)
-			{
-			fprintf(stdout, "  ALT: %5d %17.6f %8.3f\n",
-				i, dat_altitude_time_d[i], dat_altitude_altitude[i]);
-			}
-		fprintf(stdout, "\nTotal attitude data read: %d\n", ndat_rph);
-		for (i=0;i<ndat_rph;i++)
-			{
-			fprintf(stdout, "  ALT: %5d %17.6f %8.3f %8.3f %8.3f\n",
-				i, dat_rph_time_d[i], dat_rph_roll[i], dat_rph_pitch[i], dat_rph_heave[i]);
-			}
-		fprintf(stdout, "\nTotal Edgetech time stamp data read: %d\n", nedget);
-		for (i=0;i<nedget;i++)
-			{
-			fprintf(stdout, "  EDG: %5d %17.6f %17.6f %5d   offsets: %17.6f %5d  %5d\n",
-				i, edget_time_d[i], edget_time_d_new[i], edget_ping[i], edget_time_offset[i], edget_ping_offset[i], edget_good_offset[i]);
-			}
-		fprintf(stdout, "\nTotal multibeam time stamp data read: %d\n", nbatht);
-		for (i=0;i<nbatht;i++)
-			{
-			fprintf(stdout, "  BAT: %5d %17.6f %17.6f %5d   offsets: %17.6f %5d  %5d\n",
-				i, batht_time_d[i], batht_time_d_new[i], batht_ping[i], batht_time_offset[i], batht_ping_offset[i], batht_good_offset[i]);
-			}
-		}
-
-	/* output counts */
-	fprintf(stdout, "\nTotal data records read from: %s\n", read_file);
-	fprintf(stdout, "     File Header:                       %d\n", nrec_fileheader_tot);
-	fprintf(stdout, "     Multibeam:                         %d\n", nrec_multibeam_tot);
-	fprintf(stdout, "          Volatile Settings:                 %d\n", nrec_volatilesettings_tot);
-	fprintf(stdout, "          Match Filter:                      %d\n", nrec_matchfilter_tot);
-	fprintf(stdout, "          Beam Geometry:                     %d\n", nrec_beamgeometry_tot);
-	fprintf(stdout, "          Remote Control:                    %d\n", nrec_remotecontrolsettings_tot);
-	fprintf(stdout, "          Bathymetry:                        %d\n", nrec_bathymetry_tot);
-	fprintf(stdout, "          Backscatter:                       %d\n", nrec_backscatter_tot);
-	fprintf(stdout, "          Beam:                              %d\n", nrec_beam_tot);
-	fprintf(stdout, "          Image:                             %d\n", nrec_image_tot);
-	fprintf(stdout, "          V2PingMotion:                      %d\n", nrec_v2pingmotion_tot);
-	fprintf(stdout, "          V2DetectionSetup:                  %d\n", nrec_v2detectionsetup_tot);
-	fprintf(stdout, "          V2Beamformed:                      %d\n", nrec_v2beamformed_tot);
-	fprintf(stdout, "          V2Detection:                       %d\n", nrec_v2detection_tot);
-	fprintf(stdout, "          V2RawDetection:                    %d\n", nrec_v2rawdetection_tot);
-	fprintf(stdout, "          V2Snippet:                         %d\n", nrec_v2snippet_tot);
-	fprintf(stdout, "          Calibrated Snippet:                %d\n", nrec_calibratedsnippet_tot);
-	fprintf(stdout, "          Processedsidescan:                 %d\n", nrec_processedsidescan_tot);
-	fprintf(stdout, "     Reference:                         %d\n", nrec_reference_tot);
-	fprintf(stdout, "     Uncalibrated Sensor Offset:        %d\n", nrec_sensoruncal_tot);
-	fprintf(stdout, "     Calibrated Sensor Offset:          %d\n", nrec_sensorcal_tot);
-	fprintf(stdout, "     Position:                          %d\n", nrec_position_tot);
-	fprintf(stdout, "     Custom Attitude:                   %d\n", nrec_customattitude_tot);
-	fprintf(stdout, "     Tide:                              %d\n", nrec_tide_tot);
-	fprintf(stdout, "     Altitude:                          %d\n", nrec_altitude_tot);
-	fprintf(stdout, "     Motion Over Ground:                %d\n", nrec_motion_tot);
-	fprintf(stdout, "     Depth:                             %d\n", nrec_depth_tot);
-	fprintf(stdout, "     Sound Speed Profile:               %d\n", nrec_svp_tot);
-	fprintf(stdout, "     CTD:                               %d\n", nrec_ctd_tot);
-	fprintf(stdout, "     Geodosy:                           %d\n", nrec_geodesy_tot);
-	fprintf(stdout, "     Roll Pitch Heave:                  %d\n", nrec_rollpitchheave_tot);
-	fprintf(stdout, "     Heading:                           %d\n", nrec_heading_tot);
-	fprintf(stdout, "     Survey Line:                       %d\n", nrec_surveyline_tot);
-	fprintf(stdout, "     Navigation:                        %d\n", nrec_navigation_tot);
-	fprintf(stdout, "     Attitude:                          %d\n", nrec_attitude_tot);
-	fprintf(stdout, "     Edgetech Low Frequency Sidescan:   %d\n", nrec_fsdwsslo_tot);
-	fprintf(stdout, "     Edgetech High Frequency Sidescan:  %d\n", nrec_fsdwsshi_tot);
-	fprintf(stdout, "     Edgetech Subbottom:                %d\n", nrec_fsdwsbp_tot);
-	fprintf(stdout, "     MBARI Mapping AUV Environmental:   %d\n", nrec_bluefinnav_tot);
-	fprintf(stdout, "     MBARI Mapping AUV Navigation:      %d\n", nrec_bluefinenv_tot);
-	fprintf(stdout, "     Configuration:                     %d\n", nrec_configuration_tot);
-	fprintf(stdout, "     Calibration:                       %d\n", nrec_calibration_tot);
-	fprintf(stdout, "     Vertical Depth:                    %d\n", nrec_verticaldepth_tot);
-	fprintf(stdout, "     Installation:                      %d\n", nrec_installation_tot);
-	fprintf(stdout, "     System Event Message:              %d\n", nrec_systemeventmessage_tot);
-	fprintf(stdout, "     Other:                             %d\n", nrec_other_tot);
-
-	nrec_reference_tot = 0;
-	nrec_sensoruncal_tot = 0;
-	nrec_sensorcal_tot = 0;
-	nrec_position_tot = 0;
-	nrec_customattitude_tot = 0;
-	nrec_tide_tot = 0;
-	nrec_altitude_tot = 0;
-	nrec_motion_tot = 0;
-	nrec_depth_tot = 0;
-	nrec_svp_tot = 0;
-	nrec_ctd_tot = 0;
-	nrec_geodesy_tot = 0;
-	nrec_rollpitchheave_tot = 0;
-	nrec_heading_tot = 0;
-	nrec_surveyline_tot = 0;
-	nrec_navigation_tot = 0;
-	nrec_attitude_tot = 0;
-	nrec_fsdwsslo_tot = 0;
-	nrec_fsdwsshi_tot = 0;
-	nrec_fsdwsbp_tot = 0;
-	nrec_bluefinnav_tot = 0;
-	nrec_bluefinenv_tot = 0;
-	nrec_multibeam_tot = 0;
-	nrec_volatilesettings_tot = 0;
-	nrec_configuration_tot = 0;
-	nrec_matchfilter_tot = 0;
-	nrec_beamgeometry_tot = 0;
-	nrec_calibration_tot = 0;
-	nrec_bathymetry_tot = 0;
-	nrec_backscatter_tot = 0;
-	nrec_beam_tot = 0;
-	nrec_verticaldepth_tot = 0;
-	nrec_image_tot = 0;
-	nrec_installation_tot = 0;
-	nrec_systemeventmessage_tot = 0;
-	nrec_fileheader_tot = 0;
-	nrec_remotecontrolsettings_tot = 0;
-	nrec_other_tot = 0;
-
-	/* now read the data files again, this time interpolating nav and attitude
-		into the multibeam records and fixing other problems found in the
-		data */
-	if (mode == MB7KPREPROCESS_PROCESS)
-	{
-
-	/* open file list */
-	if (read_datalist == MB_YES)
-	    {
-	    if ((status = mb_datalist_open(verbose,&datalist,
-					    read_file,look_processed,&error)) != MB_SUCCESS)
-		{
-		error = MB_ERROR_OPEN_FAIL;
-		fprintf(stderr,"\nUnable to open data list file: %s\n",
-			read_file);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-	    if ((status = mb_datalist_read(verbose,datalist,
-			    ifile,&format,&file_weight,&error))
-			    == MB_SUCCESS)
-		read_data = MB_YES;
-	    else
-		read_data = MB_NO;
-	    }
-	/* else copy single filename to be read */
-	else
-	    {
-	    strcpy(ifile, read_file);
-	    read_data = MB_YES;
-	    }
-
-	/* loop over all files to be read */
-	while (read_data == MB_YES && format == MBF_RESON7KR)
-	{
-	/* figure out the output file name */
-	if (ofile_set == MB_NO)
-		{
-		status = mb_get_format(verbose, ifile, fileroot, &testformat, &error);
-		if (testformat == MBF_RESON7KR
-			&& strncmp(".s7k",&ifile[strlen(ifile)-4],4) == 0)
-			sprintf(ofile, "%s.mb%d", fileroot, testformat);
-		else if (testformat == MBF_RESON7KR)
-			sprintf(ofile, "%sf.mb%d", fileroot, testformat);
-		else
-			sprintf(ofile, "%s.mb%d", ifile, testformat);
-		}
-
-	/* initialize reading the input swath file */
-	if ((status = mb_read_init(
-		verbose,ifile,format,pings,lonflip,bounds,
-		btime_i,etime_i,speedmin,timegap,
-		&imbio_ptr,&btime_d,&etime_d,
-		&beams_bath,&beams_amp,&pixels_ss,&error)) != MB_SUCCESS)
-		{
-		mb_error(verbose,error,&message);
-		fprintf(stderr,"\nMBIO Error returned from function <mb_read_init>:\n%s\n",message);
-		fprintf(stderr,"\nMultibeam File <%s> not initialized for reading\n",ifile);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-	nfile_read++;
-
-	/* if ofile has been set then there is only one output file, otherwise there
-		is an output file for each input file */
-	if (ofile_set == MB_NO || nfile_write == 0)
-		{
-		/* initialize writing the output swath sonar file */
-		if ((status = mb_write_init(
-			verbose,ofile,format,&ombio_ptr,
-			&obeams_bath,&obeams_amp,&opixels_ss,&error)) != MB_SUCCESS)
-			{
-			mb_error(verbose,error,&message);
-			fprintf(stderr,"\nMBIO Error returned from function <mb_write_init>:\n%s\n",message);
-			fprintf(stderr,"\nMultibeam File <%s> not initialized for writing\n",ofile);
-			fprintf(stderr,"\nProgram <%s> Terminated\n",
-				program_name);
-			exit(error);
-			}
-		nfile_write++;
-
-		/* initialize ctd output file */
-		sprintf(ctdfile,"%s_ctd.txt",fileroot);
-		if ((tfp = fopen(ctdfile, "w")) == NULL)
-			{
-			error = MB_ERROR_OPEN_FAIL;
-			fprintf(stderr,"\nUnable to open ctd data file <%s> for writing\n",ctdfile);
-			fprintf(stderr,"\nProgram <%s> Terminated\n",
-				program_name);
-			exit(error);
-			}
-
-		/* initialize asynchronous heading output file */
-		sprintf(athfile,"%s.ath",ofile);
-		if ((athfp = fopen(athfile, "w")) == NULL)
-			{
-			error = MB_ERROR_OPEN_FAIL;
-			fprintf(stderr,"\nUnable to open asynchronous heading data file <%s> for writing\n",athfile);
-			fprintf(stderr,"\nProgram <%s> Terminated\n",
-				program_name);
-			exit(error);
-			}
-
-		/* initialize asynchronous sonardepth output file */
-		sprintf(atsfile,"%s.ats",ofile);
-		if ((atsfp = fopen(atsfile, "w")) == NULL)
-			{
-			error = MB_ERROR_OPEN_FAIL;
-			fprintf(stderr,"\nUnable to open asynchronous sonardepth data file <%s> for writing\n",atsfile);
-			fprintf(stderr,"\nProgram <%s> Terminated\n",
-				program_name);
-			exit(error);
-			}
-
-		/* initialize asynchronous attitude output file */
-		sprintf(atafile,"%s.ata",ofile);
-		if ((atafp = fopen(atafile, "w")) == NULL)
-			{
-			error = MB_ERROR_OPEN_FAIL;
-			fprintf(stderr,"\nUnable to open asynchronous attitude data file <%s> for writing\n",atafile);
-			fprintf(stderr,"\nProgram <%s> Terminated\n",
-				program_name);
-			exit(error);
-			}
-
-		/* initialize synchronous attitude output file */
-		sprintf(stafile,"%s.sta",ofile);
-		if ((stafp = fopen(stafile, "w")) == NULL)
-			{
-			error = MB_ERROR_OPEN_FAIL;
-			fprintf(stderr,"\nUnable to open synchronous attitude data file <%s> for writing\n",stafile);
-			fprintf(stderr,"\nProgram <%s> Terminated\n",
-				program_name);
-			exit(error);
-			}
-		}
-
-	/* get pointers to data storage */
-	imb_io_ptr = (struct mb_io_struct *) imbio_ptr;
-	istore_ptr = imb_io_ptr->store_data;
-	istore = (struct mbsys_reson7k_struct *) istore_ptr;
-
-	/* initialize pixel_size and swath_width */
-	pixel_size = 0.0;
-	swath_width = 0.0;
-
-	if (error == MB_ERROR_NO_ERROR)
-		{
-		beamflag = NULL;
-		bath = NULL;
-		amp = NULL;
-		bathacrosstrack = NULL;
-		bathalongtrack = NULL;
-		ss = NULL;
-		ssacrosstrack = NULL;
-		ssalongtrack = NULL;
-		}
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(char), (void **)&beamflag, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(double), (void **)&bath, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_AMPLITUDE,
-						sizeof(double), (void **)&amp, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(double), (void **)&bathacrosstrack, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(double), (void **)&bathalongtrack, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_SIDESCAN,
-						sizeof(double), (void **)&ss, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_SIDESCAN,
-						sizeof(double), (void **)&ssacrosstrack, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_SIDESCAN,
-						sizeof(double), (void **)&ssalongtrack, &error);
-
-	/* if error initializing memory then quit */
-	if (error != MB_ERROR_NO_ERROR)
-		{
-		mb_error(verbose,error,&message);
-		fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",
-			message);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-
-	/* reset file record counters */
-	nrec_reference = 0;
-	nrec_sensoruncal = 0;
-	nrec_sensorcal = 0;
-	nrec_position = 0;
-	nrec_customattitude = 0;
-	nrec_tide = 0;
-	nrec_altitude = 0;
-	nrec_motion = 0;
-	nrec_depth = 0;
-	nrec_svp = 0;
-	nrec_ctd = 0;
-	nrec_geodesy = 0;
-	nrec_rollpitchheave = 0;
-	nrec_heading = 0;
-	nrec_surveyline = 0;
-	nrec_navigation = 0;
-	nrec_attitude = 0;
-	nrec_fsdwsslo = 0;
-	nrec_fsdwsshi = 0;
-	nrec_fsdwsbp = 0;
-	nrec_bluefinnav = 0;
-	nrec_bluefinenv = 0;
-	nrec_multibeam = 0;
-	nrec_volatilesettings = 0;
-	nrec_configuration = 0;
-	nrec_matchfilter = 0;
-	nrec_beamgeometry = 0;
-	nrec_calibration = 0;
-	nrec_bathymetry = 0;
-	nrec_backscatter = 0;
-	nrec_beam = 0;
-	nrec_verticaldepth = 0;
-	nrec_image = 0;
-	nrec_v2pingmotion = 0;
-	nrec_v2detectionsetup = 0;
-	nrec_v2beamformed = 0;
-	nrec_v2detection = 0;
-	nrec_v2rawdetection = 0;
-	nrec_v2snippet = 0;
-	nrec_calibratedsnippet = 0;
-	nrec_processedsidescan = 0;
-	nrec_installation = 0;
-	nrec_systemeventmessage = 0;
-	nrec_fileheader = 0;
-	nrec_remotecontrolsettings = 0;
-	nrec_other = 0;
-
-	/* read and print data */
-	while (error <= MB_ERROR_NO_ERROR)
-		{
-		/* reset error */
-		status = MB_SUCCESS;
-		error = MB_ERROR_NO_ERROR;
-
-		/* read next data record */
-		status = mb_get_all(verbose,imbio_ptr,&istore_ptr,&kind,
-				    time_i,&time_d,&navlon,&navlat,
-				    &speed,&heading,
-				    &distance,&altitude,&sonardepth,
-				    &beams_bath,&beams_amp,&pixels_ss,
-				    beamflag,bath,amp,bathacrosstrack,bathalongtrack,
-				    ss,ssacrosstrack,ssalongtrack,
-				    comment,&error);
-
-		/* some nonfatal errors do not matter */
-		if (error < MB_ERROR_NO_ERROR && error > MB_ERROR_UNINTELLIGIBLE)
-			{
-			error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-
-	   	/* handle multibeam data */
-		if (status == MB_SUCCESS && kind == MB_DATA_DATA)
-			{
-			nrec_multibeam++;
-
-			bathymetry = &(istore->bathymetry);
-			v2detection = &(istore->v2detection);
-			v2rawdetection = &(istore->v2rawdetection);
-			if (istore->read_volatilesettings == MB_YES)
-				nrec_volatilesettings++;
-			if (istore->read_matchfilter == MB_YES)
-				nrec_matchfilter++;
-			if (istore->read_beamgeometry == MB_YES)
-				nrec_beamgeometry++;
-			if (istore->read_remotecontrolsettings == MB_YES)
-				nrec_remotecontrolsettings++;
-			if (istore->read_bathymetry == MB_YES)
-				nrec_bathymetry++;
-			if (istore->read_backscatter == MB_YES)
-				nrec_backscatter++;
-			if (istore->read_beam == MB_YES)
-				nrec_beam++;
-			if (istore->read_verticaldepth == MB_YES)
-				nrec_verticaldepth++;
-			if (istore->read_image == MB_YES)
-				nrec_image++;
-			if (istore->read_v2pingmotion == MB_YES)
-				nrec_v2pingmotion++;
-			if (istore->read_v2detectionsetup == MB_YES)
-				nrec_v2detectionsetup++;
-			if (istore->read_v2beamformed == MB_YES)
-				nrec_v2beamformed++;
-			if (istore->read_v2detection == MB_YES)
-				nrec_v2detection++;
-			if (istore->read_v2rawdetection == MB_YES)
-				nrec_v2rawdetection++;
-			if (istore->read_v2snippet == MB_YES)
-				nrec_v2snippet++;
-			if (istore->read_calibratedsnippet == MB_YES)
-				nrec_calibratedsnippet++;
-			if (istore->read_processedsidescan == MB_YES)
-				nrec_processedsidescan++;
-
-			/* print out record headers */
-			if (istore->read_volatilesettings == MB_YES)
-				{
-				volatilesettings = &(istore->volatilesettings);
-				header = &(volatilesettings->header);
-				time_j[0] = header->s7kTime.Year;
-				time_j[1] = header->s7kTime.Day;
-				time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-				time_j[3] = (int) header->s7kTime.Seconds;
-				time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-				mb_get_itime(verbose, time_j, time_i);
-				mb_get_time(verbose, time_i, &time_d);
-				if (verbose > 0)
-				fprintf(stderr,"R7KRECID_7kVolatileSonarSettings:  7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d\n",
-					time_i[0],time_i[1],time_i[2],
-					time_i[3],time_i[4],time_i[5],time_i[6],
-					header->RecordNumber);
-				}
-			if (istore->read_matchfilter == MB_YES)
-				{
-				matchfilter = &(istore->matchfilter);
-				header = &(matchfilter->header);
-				time_j[0] = header->s7kTime.Year;
-				time_j[1] = header->s7kTime.Day;
-				time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-				time_j[3] = (int) header->s7kTime.Seconds;
-				time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-				mb_get_itime(verbose, time_j, time_i);
-				mb_get_time(verbose, time_i, &time_d);
-				if (verbose > 0)
-				fprintf(stderr,"R7KRECID_7kMatchFilter:            7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d\n",
-					time_i[0],time_i[1],time_i[2],
-					time_i[3],time_i[4],time_i[5],time_i[6],
-					header->RecordNumber);
-				}
-			if (istore->read_beamgeometry == MB_YES)
-				{
-				beamgeometry = &(istore->beamgeometry);
-				header = &(beamgeometry->header);
-				time_j[0] = header->s7kTime.Year;
-				time_j[1] = header->s7kTime.Day;
-				time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-				time_j[3] = (int) header->s7kTime.Seconds;
-				time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-				mb_get_itime(verbose, time_j, time_i);
-				mb_get_time(verbose, time_i, &time_d);
-				if (verbose > 0)
-				fprintf(stderr,"R7KRECID_7kBeamGeometry:           7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d beams:%d\n",
-					time_i[0],time_i[1],time_i[2],
-					time_i[3],time_i[4],time_i[5],time_i[6],
-					header->RecordNumber,beamgeometry->number_beams);
-				}
-			if (istore->read_remotecontrolsettings == MB_YES)
-				{
-				remotecontrolsettings = &(istore->remotecontrolsettings);
-				header = &(remotecontrolsettings->header);
-				time_j[0] = header->s7kTime.Year;
-				time_j[1] = header->s7kTime.Day;
-				time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-				time_j[3] = (int) header->s7kTime.Seconds;
-				time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-				mb_get_itime(verbose, time_j, time_i);
-				mb_get_time(verbose, time_i, &time_d);
-				if (verbose > 0)
-				fprintf(stderr,"R7KRECID_7kremotecontrolsettings:  7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d\n",
-					time_i[0],time_i[1],time_i[2],
-					time_i[3],time_i[4],time_i[5],time_i[6],
-					header->RecordNumber);
-				}
-			if (istore->read_bathymetry != MB_YES)
-				{
-				status = MB_FAILURE;
-				error = MB_ERROR_IGNORE;
-				}
-			else if (istore->read_bathymetry == MB_YES)
-				{
-				bathymetry = &(istore->bathymetry);
-				header = &(bathymetry->header);
-				time_j[0] = header->s7kTime.Year;
-				time_j[1] = header->s7kTime.Day;
-				time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-				time_j[3] = (int) header->s7kTime.Seconds;
-				time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-				mb_get_itime(verbose, time_j, time_i);
-				mb_get_time(verbose, time_i, &time_d);
-				last_7k_time_d = MAX(last_7k_time_d, time_d);
-				if (verbose > 0)
-				fprintf(stderr,"R7KRECID_7kBathymetricData:        7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d ping:%d beams:%d\n",
-					time_i[0],time_i[1],time_i[2],
-					time_i[3],time_i[4],time_i[5],time_i[6],
-					header->RecordNumber,bathymetry->ping_number,bathymetry->number_beams);
-				if (last_7k_time_d > time_d)
-					{
-					status = MB_FAILURE;
-					error = MB_ERROR_IGNORE;
-					}
-
-				/* apply fixes to good data */
-				if (status == MB_SUCCESS)
-					{
-					/* fix time stamp */
-					if (fix_time_stamps == MB7KPREPROCESS_TIMEFIX_RESON)
-						{
-						found = MB_NO;
-						for (j=0; j < nbatht && found == MB_NO; j++)
-							{
-							if (bathymetry->ping_number == batht_ping[j])
-								{
-								found = MB_YES;
-								time_d = batht_time_d_new[j];
-								mb_get_date(verbose, time_d, time_i);
-								mb_get_jtime(verbose, time_i, time_j);
-								header->s7kTime.Year = time_j[0];
-								header->s7kTime.Day = time_j[1];
-								header->s7kTime.Hours = time_i[3];
-								header->s7kTime.Minutes = time_i[4];
-								header->s7kTime.Seconds = time_i[5] + 0.000001 * time_i[6];
-								}
-							}
-						}
-
-					/* fix version 4 quality flags */
-					if (bathymetry->header.Version < 5)
-						{
-						for (i=0;i<bathymetry->number_beams;i++)
-							{
-							if ((bathymetry->quality[i]) < 16)
-								{
-								if (bathymetry->range[i] > 0.007)
-									{
-									bathymetry->quality[i] = 23;
-									}
-								else if (bathymetry->range[i] > 0.0)
-									{
-									bathymetry->quality[i] = 20;
-									}
-								else
-									{
-									bathymetry->quality[i] = 0;
-									}
-								}
-							}
-						}
-
-					/* fix early version 5 quality flags */
-					else if (bathymetry->header.Version == 5
-							&& header->s7kTime.Year < 2006)
-						{
-						for (i=0;i<bathymetry->number_beams;i++)
-							{
-							/* phase picks */
-							if ((bathymetry->quality[i]) == 8)
-								{
-/*fprintf(stderr,"beam %d: PHASE quality: %d",i,bathymetry->quality[i]);*/
-								bathymetry->quality[i] = 32 + 15;
-/*fprintf(stderr," %d\n",bathymetry->quality[i]);*/
-								}
-							else if ((bathymetry->quality[i]) == 4)
-								{
-/*fprintf(stderr,"beam %d: AMPLI quality: %d",i,bathymetry->quality[i]);*/
-								bathymetry->quality[i] = 16 + 15;
-/*fprintf(stderr," %d\n",bathymetry->quality[i]);*/
-								}
-							}
-						}
-
-					/* fix early MBARI version 5 quality flags */
-					else if (bathymetry->header.Version == 5
-							&& MBARIdata == MB_YES
-							&& header->s7kTime.Year < 2008)
-						{
-						for (i=0;i<bathymetry->number_beams;i++)
-							{
-							/* phase picks */
-							if ((bathymetry->quality[i]) == 4)
-								{
-/*fprintf(stderr,"beam %d: PHASE quality: %d",i,bathymetry->quality[i]);*/
-								bathymetry->quality[i] = 32 + 15;
-/*fprintf(stderr," %d\n",bathymetry->quality[i]);*/
-								}
-							else if ((bathymetry->quality[i]) == 2)
-								{
-/*fprintf(stderr,"beam %d: AMPLI quality: %d",i,bathymetry->quality[i]);*/
-								bathymetry->quality[i] = 16 + 15;
-/*fprintf(stderr," %d\n",bathymetry->quality[i]);*/
-								}
-							}
-						}
-
-					/* fix upgraded MBARI version 5 quality flags */
-					else if (bathymetry->header.Version >= 5
-							&& MBARIdata == MB_YES
-							&& header->s7kTime.Year <= 2010)
-						{
-						for (i=0;i<bathymetry->number_beams;i++)
-							{
-/* fprintf(stderr,"S Flag[%d]: %d\n",i,bathymetry->quality[i]); */
-							bathymetry->quality[i] = bathymetry->quality[i] & 15;
-
-							/* phase or amplitude picks */
-							if (bathymetry->quality[i] & 8)
-								{
-/* fprintf(stderr,"beam %d: PHASE quality: %d",i,bathymetry->quality[i]); */
-								bathymetry->quality[i] += 32;
-/* fprintf(stderr," %d\n",bathymetry->quality[i]); */
-								}
-							else if (bathymetry->quality[i] & 4)
-								{
-/* fprintf(stderr,"beam %d: AMPLI quality: %d",i,bathymetry->quality[i]); */
-								bathymetry->quality[i] += 16;
-/* fprintf(stderr," %d\n",bathymetry->quality[i]); */
-								}
-
-							/* flagged by sonar */
-							if ((bathymetry->quality[i] & 3) == 0 && bathymetry->quality[i] > 0)
-								{
-								bathymetry->quality[i] += 64;
-								}
-/* fprintf(stderr,"E Flag[%d]: %d\n\n",i,bathymetry->quality[i]); */
-							}
-						}
-
-					/* fix upgraded version 5 quality flags */
-					else if (bathymetry->header.Version >= 5)
-						{
-						for (i=0;i<bathymetry->number_beams;i++)
-							{
-//fprintf(stderr,"S Flag[%d]: %d\n",i,bathymetry->quality[i]);
-							bathymetry->quality[i] = bathymetry->quality[i] & 15;
-
-							/* phase or amplitude picks */
-							if (bathymetry->quality[i] & 8)
-								{
-//fprintf(stderr,"beam %d: PHASE quality: %d",i,bathymetry->quality[i]);
-								bathymetry->quality[i] += 32;
-//fprintf(stderr," %d\n",bathymetry->quality[i]);
-								}
-							else if (bathymetry->quality[i] & 4)
-								{
-//fprintf(stderr,"beam %d: AMPLI quality: %d",i,bathymetry->quality[i]);
-								bathymetry->quality[i] += 16;
-//fprintf(stderr," %d\n",bathymetry->quality[i]);
-								}
-
-							/* flagged by sonar */
-							if ((bathymetry->quality[i] & 3) == 3)
-								{
-								}
-							else if ((bathymetry->quality[i] & 3) == 0 && bathymetry->quality[i] > 0)
-								{
-								bathymetry->quality[i] += 64;
-								}
-							else if (bathymetry->quality[i] > 0)
-								{
-								bathymetry->quality[i] += 64;
-								}
-//fprintf(stderr,"E Flag[%d]: %d\n\n",i,bathymetry->quality[i]);
-							}
-						}
-
-					/* apply specified offsets to range values */
-					for (j=0;j<nrangeoffset;j++)
-						{
-						for (i=rangeoffsetstart[j];i<=rangeoffsetend[j];i++)
-							{
-							bathymetry->range[i] += rangeoffset[j];
-							}
-						}
-
-					/* recalculate optional values in bathymetry record */
-					interp_status = MB_SUCCESS;
-
-					/* get nav */
-					j = 0;
-					if (nins > 0)
-						{
-						interp_status = mb_linear_interp_longitude(verbose,
-									ins_time_d-1, ins_lon-1,
-									nins, time_d, &navlon, &jins,
-									&error);
-						if (interp_status == MB_SUCCESS)
-						interp_status = mb_linear_interp_latitude(verbose,
-									ins_time_d-1, ins_lat-1,
-									nins, time_d, &navlat, &jins,
-									&error);
-						if (interp_status == MB_SUCCESS)
-						interp_status = mb_linear_interp(verbose,
-									ins_speed_time_d-1, ins_speed-1,
-									nins_speed, time_d, &speed, &jins,
-									&error);
-						}
-					else if (nrock > 0)
-						{
-						interp_status = mb_linear_interp_longitude(verbose,
-									rock_time_d-1, rock_lon-1,
-									nrock, time_d, &navlon, &jrock,
-									&error);
-						if (interp_status == MB_SUCCESS)
-						interp_status = mb_linear_interp_latitude(verbose,
-									rock_time_d-1, rock_lat-1,
-									nrock, time_d, &navlat, &jrock,
-									&error);
-						if (jrock > 1)
-							{
-							j1 = jrock - 2;
-							j2 = jrock - 1;
-							}
-						else
-							{
-							j1 = jrock - 1;
-							j2 = jrock;
-							}
-						mb_coor_scale(verbose,navlat,&mtodeglon,&mtodeglat);
-						dx = (rock_lon[j2] - rock_lon[j1])/mtodeglon;
-						dy = (rock_lat[j2] - rock_lat[j1])/mtodeglat;
-						dist = sqrt(dx*dx + dy*dy);
-						dt = (rock_time_d[j2] - rock_time_d[j1]);
-						if (dt > 0.0)
-							speed = 3.6 * dist / dt;
-						}
-					else if (ndsl > 0)
-						{
-						interp_status = mb_linear_interp_longitude(verbose,
-									dsl_time_d-1, dsl_lon-1,
-									ndsl, time_d, &navlon, &jdsl,
-									&error);
-						if (interp_status == MB_SUCCESS)
-						interp_status = mb_linear_interp_latitude(verbose,
-									dsl_time_d-1, dsl_lat-1,
-									ndsl, time_d, &navlat, &jdsl,
-									&error);
-						if (jdsl > 1)
-							{
-							j1 = jdsl - 2;
-							j2 = jdsl - 1;
-							}
-						else
-							{
-							j1 = jdsl - 1;
-							j2 = jdsl;
-							}
-						mb_coor_scale(verbose,navlat,&mtodeglon,&mtodeglat);
-						dx = (dsl_lon[j2] - dsl_lon[j1])/mtodeglon;
-						dy = (dsl_lat[j2] - dsl_lat[j1])/mtodeglat;
-						dist = sqrt(dx*dx + dy*dy);
-						dt = (dsl_time_d[j2] - dsl_time_d[j1]);
-						if (dt > 0.0)
-							speed = 3.6 * dist / dt;
-						}
-					else if (ndat_nav > 0)
-						{
-						interp_status = mb_linear_interp_longitude(verbose,
-									dat_nav_time_d-1, dat_nav_lon-1,
-									ndat_nav, time_d, &navlon, &jdnav,
-									&error);
-						if (interp_status == MB_SUCCESS)
-						interp_status = mb_linear_interp_latitude(verbose,
-									dat_nav_time_d-1, dat_nav_lat-1,
-									ndat_nav, time_d, &navlat, &jdnav,
-									&error);
-						if (interp_status == MB_SUCCESS)
-						interp_status = mb_linear_interp(verbose,
-									dat_nav_time_d-1, dat_nav_speed-1,
-									ndat_nav, time_d, &speed, &jdnav,
-									&error);
-						}
-					else
-						{
-						navlon = 0.0;
-						navlat = 0.0;
-						speed = 0.0;
-						}
-
-					/* get heading */
-					j = 0;
-					if (interp_status != MB_SUCCESS)
-						{
-						}
-					else if (nins > 0)
-						{
-						interp_status = mb_linear_interp_heading(verbose,
-									ins_time_d-1, ins_heading-1,
-									nins, time_d, &heading, &jins,
-									&error);
-						}
-					else if (nrock > 0)
-						{
-						interp_status = mb_linear_interp_heading(verbose,
-									rock_time_d-1, rock_heading-1,
-									nrock, time_d, &heading, &jrock,
-									&error);
-						}
-					else if (ndsl > 0)
-						{
-						interp_status = mb_linear_interp_heading(verbose,
-									dsl_time_d-1, dsl_heading-1,
-									ndsl, time_d, &heading, &jdsl,
-									&error);
-						}
-					else if (ndat_heading > 0)
-						{
-						interp_status = mb_linear_interp_heading(verbose,
-									dat_heading_time_d-1, dat_heading_heading-1,
-									ndat_heading, time_d, &heading, &jdheading,
-									&error);
-						}
-					else
-						{
-						heading = 0.0;
-						}
-					if (heading < 0.0)
-						heading += 360.0;
-					else if (heading >= 360.0)
-						heading -= 360.0;
-
-					/* get altitude */
-					if (interp_status != MB_SUCCESS)
-						{
-						}
-					else if (nins > 0)
-						{
-						interp_status = mb_linear_interp(verbose,
-									ins_altitude_time_d-1, ins_altitude-1,
-									nins_altitude, time_d, &altitude, &jins,
-									&error);
-						}
-					else if (ndat_altitude > 0)
-						{
-						interp_status = mb_linear_interp(verbose,
-									dat_altitude_time_d-1, dat_altitude_altitude-1,
-									ndat_altitude, time_d, &altitude, &jdaltitude,
-									&error);
-						}
-					else
-						{
-						altitude = 0.0;
-						}
-
-					/* get attitude */
-					if (interp_status != MB_SUCCESS)
-						{
-						}
-					else if (nins > 0)
-						{
-						interp_status = mb_linear_interp(verbose,
-									ins_time_d-1, ins_roll-1,
-									nins, time_d, &roll, &jins,
-									&error);
-						if (interp_status == MB_SUCCESS)
-						interp_status = mb_linear_interp(verbose,
-									ins_time_d-1, ins_pitch-1,
-									nins, time_d, &pitch, &jins,
-									&error);
-						heave = 0.0;
-						}
-					else if (nrock > 0)
-						{
-						interp_status = mb_linear_interp(verbose,
-									rock_time_d-1, rock_roll-1,
-									nrock, time_d, &roll, &jrock,
-									&error);
-						if (interp_status == MB_SUCCESS)
-						interp_status = mb_linear_interp(verbose,
-									rock_time_d-1, rock_pitch-1,
-									nrock, time_d, &pitch, &jrock,
-									&error);
-						heave = 0.0;
-						}
-					else if (ndsl > 0)
-						{
-						interp_status = mb_linear_interp(verbose,
-									dsl_time_d-1, dsl_roll-1,
-									ndsl, time_d, &roll, &jdsl,
-									&error);
-						if (interp_status == MB_SUCCESS)
-						interp_status = mb_linear_interp(verbose,
-									dsl_time_d-1, dsl_pitch-1,
-									ndsl, time_d, &pitch, &jdsl,
-									&error);
-						heave = 0.0;
-						}
-					else if (ndat_rph > 0)
-						{
-						interp_status = mb_linear_interp(verbose,
-									dat_rph_time_d-1, dat_rph_roll-1,
-									ndat_rph, time_d, &roll, &jdattitude,
-									&error);
-						if (interp_status == MB_SUCCESS)
-						interp_status = mb_linear_interp(verbose,
-									dat_rph_time_d-1, dat_rph_pitch-1,
-									ndat_rph, time_d, &pitch, &jdattitude,
-									&error);
-						interp_status = mb_linear_interp(verbose,
-									dat_rph_time_d-1, dat_rph_heave-1,
-									ndat_rph, time_d, &heave, &jdattitude,
-									&error);
-						}
-					else
-						{
-						roll = 0.0;
-						pitch = 0.0;
-						heave = 0.0;
-						}
-
-					/* get sonar depth */
-					if (kluge_useverticaldepth == MB_YES)
-						{
-						verticaldepth = (s7kr_verticaldepth *)&(istore->verticaldepth);
-						sonardepth = (double)(verticaldepth->vertical_depth);
-						}
-					else if (interp_status != MB_SUCCESS)
-						{
-						}
-					else if (nsonardepth > 0)
-						{
-						if (interp_status == MB_SUCCESS)
-						interp_status = mb_linear_interp(verbose,
-									sonardepth_time_d-1, sonardepth_sonardepth-1,
-									nsonardepth, time_d, &sonardepth, &jsonardepth,
-									&error);
-						}
-					else if (nins > 0)
-						{
-						interp_status = mb_linear_interp(verbose,
-									ins_time_d-1, ins_sonardepth-1,
-									nins, time_d, &sonardepth, &jins,
-									&error);
-						}
-					else if (nrock > 0)
-						{
-						interp_status = mb_linear_interp(verbose,
-									rock_time_d-1, rock_sonardepth-1,
-									nrock, time_d, &sonardepth, &jrock,
-									&error);
-						}
-					else if (ndsl > 0)
-						{
-						interp_status = mb_linear_interp(verbose,
-									dsl_time_d-1, dsl_sonardepth-1,
-									ndsl, time_d, &sonardepth, &jdsl,
-									&error);
-						}
-					else if (ndat_sonardepth > 0)
-						{
-						interp_status = mb_linear_interp(verbose,
-									dat_sonardepth_time_d-1, dat_sonardepth_sonardepth-1,
-									ndat_sonardepth, time_d, &sonardepth, &jdsonardepth,
-									&error);
-						}
-					else
-						{
-						sonardepth = 0.0;
-						}
-//fprintf(stderr,"\nStarting sonardepth:%f\n",sonardepth);
-
-					/* get local translation between lon lat degrees and meters */
-					mb_coor_scale(verbose,navlat,&mtodeglon,&mtodeglat);
-					headingx = sin(DTR*heading);
-					headingy = cos(DTR*heading);	
-
-					if (platform != NULL)
-						{
-						status = mb_platform_position(verbose, (void **)&platform,
-										platform->source_swathbathymetry, 0,
-										navlon, navlat, sonardepth,
-										heading, roll, pitch,
-										&navlon, &navlat, &sonardepth,
-										&error);
-						}			
-
-					/* if the optional data are not all available, this ping
-						is not useful, and is discarded by setting
-						*error to MB_ERROR_MISSING_NAVATTITUDE
-						unless the -N flag has been specified */
-					if (interp_status == MB_FAILURE && goodnavattitudeonly == MB_YES)
-						{
-						status = MB_FAILURE;
-						error = MB_ERROR_MISSING_NAVATTITUDE;
-						}
-					}
-
-				/* if the optional data are available, then proceed */
-				if (status == MB_SUCCESS)
-					{		
-					/* initialize all of the beams */
-					for (i=0;i<bathymetry->number_beams;i++)
-						{
-						if (istore->read_v2rawdetection == MB_YES
-						    || (istore->read_v2detection == MB_YES && istore->read_v2detectionsetup == MB_YES))
-							bathymetry->quality[i] = 0;
-						bathymetry->depth[i] = 0.0;
-						bathymetry->acrosstrack[i] = 0.0;
-						bathymetry->alongtrack[i] = 0.0;
-						bathymetry->pointing_angle[i] = 0.0;
-						bathymetry->azimuth_angle[i] = 0.0;
-						}
-//fprintf(stderr,"sonardepth:%f heave:%f\n",sonardepth,heave);
-
-					/* set ping values */
-					bathymetry->longitude = DTR * navlon;
-					bathymetry->latitude = DTR * navlat;
-					bathymetry->heading = DTR * heading;
-					bathymetry->height_source = 1;
-					bathymetry->tide = 0.0;
-					bathymetry->roll = DTR * roll;
-					bathymetry->pitch = DTR * pitch;
-					bathymetry->heave = heave;
-					if ((volatilesettings->receive_flags & 0x2) != 0)
-						{
-						bathymetry->vehicle_height = -sonardepth - heave;
-						}
-					else
-						{								
-						bathymetry->vehicle_height = -sonardepth;
-						}
-//fprintf(stderr,"\nPing %d: %14.9f %13.9f %10.3f   %7.3f %7.3f %7.3f\n",
-//nrec_multibeam+nrec_multibeam_tot,
-//bathymetry->longitude, bathymetry->latitude, bathymetry->vehicle_height,
-//bathymetry->heading, bathymetry->roll, bathymetry->pitch);
-
-					/* get ready to calculate bathymetry */
-					if (volatilesettings->sound_velocity > 0.0)
-						soundspeed = volatilesettings->sound_velocity;
-					else if (bluefin->environmental[0].sound_speed > 0.0)
-						soundspeed = bluefin->environmental[0].sound_speed;
-					else
-						soundspeed = 1500.0;
-					rollr = DTR * roll;
-					pitchr = DTR * pitch;
-					
-					/* zero atttitude correction if requested */
-					if (kluge_zeroattitudecorrection == MB_YES)
-						{
-						rollr = 0.0;
-						pitchr = 0.0;
-						}
-
-					/* zero alongtrack angles if requested */
-					if (kluge_zeroalongtrackangles == MB_YES)
-						{
-						for (i=0;i<bathymetry->number_beams;i++)
-							{
-							beamgeometry->angle_alongtrack[i] = 0.0;
-							}
-						}
-
-					/* if requested apply kluge scaling of rx beam angles */
-					if (kluge_beampatterntweak == MB_YES)
-						{
-						/* case of v2rawdetection record */
-						if (istore->read_v2rawdetection == MB_YES)
-							{
-							for (i=0;i<v2rawdetection->number_beams;i++)
-								{
-								v2rawdetection->rx_angle[i] *= kluge_beampatternfactor;
-								}
-							}
-						
-						/* case of v2detection record with or without v2detectionsetup */
-						else if (istore->read_v2detection == MB_YES)
-							{
-							for (i=0;i<v2detection->number_beams;i++)
-								{
-								v2detection->angle_x[i] *= kluge_beampatternfactor;
-								}
-							}
-
-
-						/* else default case of beamgeometry record */
-						else
-							{
-							for (i=0;i<bathymetry->number_beams;i++)
-								{
-								beamgeometry->angle_acrosstrack[i] *= kluge_beampatternfactor;
-								}
-							}
-						}
-
-					/* get transducer angular offsets */
-					tx_align.roll = 0.0;
-					tx_align.pitch = 0.0;
-					tx_align.heading = 0.0;
-					rx_align.roll = 0.0;
-					rx_align.pitch = 0.0;
-					rx_align.heading = 0.0;
-					if (platform != NULL)
-						{
-						sensor_swathbathymetry = &platform->sensors[platform->source_swathbathymetry];
-						sensor_rollpitch = &platform->sensors[platform->source_rollpitch];
-						sensor_heading = &platform->sensors[platform->source_heading];
-						
-						if (sensor_swathbathymetry->offsets[0].attitude_offset_mode == MB_SENSOR_ATTITUDE_OFFSET_STATIC
-							&& sensor_rollpitch->offsets[0].attitude_offset_mode == MB_SENSOR_ATTITUDE_OFFSET_STATIC)
-							{
-							tx_align.roll = sensor_swathbathymetry->offsets[0].attitude_offset_roll
-									- sensor_rollpitch->offsets[0].attitude_offset_roll;
-							tx_align.pitch = sensor_swathbathymetry->offsets[0].attitude_offset_pitch
-									- sensor_rollpitch->offsets[0].attitude_offset_pitch;
-							rx_align.roll = sensor_swathbathymetry->offsets[0].attitude_offset_roll
-									- sensor_rollpitch->offsets[0].attitude_offset_roll;
-							rx_align.pitch = sensor_swathbathymetry->offsets[0].attitude_offset_pitch
-									- sensor_rollpitch->offsets[0].attitude_offset_pitch;
-							}
-						if (sensor_swathbathymetry->offsets[0].attitude_offset_mode == MB_SENSOR_ATTITUDE_OFFSET_STATIC
-							&& sensor_heading->offsets[0].attitude_offset_mode == MB_SENSOR_ATTITUDE_OFFSET_STATIC)
-							{
-							tx_align.heading = sensor_swathbathymetry->offsets[0].attitude_offset_azimuth
-									- sensor_heading->offsets[0].attitude_offset_azimuth;
-							rx_align.heading = sensor_swathbathymetry->offsets[0].attitude_offset_azimuth
-									- sensor_heading->offsets[0].attitude_offset_azimuth;
-							}
-						}			
-
-					/* loop over detections as available - the 7k format has used several
-					   different records over the years, so there are several different
-					   cases that must be handled */
-
-					/* case of v2rawdetection record */
-					if (istore->read_v2rawdetection == MB_YES)
-						{
-						for (j=0;j<v2rawdetection->number_beams;j++)
-							{
-							/* beam id */
-							i = v2rawdetection->beam_descriptor[j];
-							
-							/* get range and quality */
-							bathymetry->range[i] = v2rawdetection->detection_point[j]
-										/ v2rawdetection->sampling_rate;
-							bathymetry->quality[i] = v2rawdetection->quality[j];
-							
-							/* get roll at bottom return time for this beam */
-							if (nins > 0)
-								{
-								interp_status = mb_linear_interp(verbose,
-											ins_time_d-1, ins_roll-1,
-											nins, time_d + bathymetry->range[i], &beamroll, &jins,
-											&error);
-								}
-							else if (nrock > 0)
-								{
-								interp_status = mb_linear_interp(verbose,
-											rock_time_d-1, rock_roll-1,
-											nrock, time_d + bathymetry->range[i], &beamroll, &jrock,
-											&error);
-								}
-							else if (ndsl > 0)
-								{
-								interp_status = mb_linear_interp(verbose,
-											dsl_time_d-1, dsl_roll-1,
-											ndsl, time_d + bathymetry->range[i], &beamroll, &jdsl,
-											&error);
-								}
-							else if (ndat_rph > 0)
-								{
-								interp_status = mb_linear_interp(verbose,
-											dat_rph_time_d-1, dat_rph_roll-1,
-											ndat_rph, time_d + bathymetry->range[i], &beamroll, &jdattitude,
-											&error);
-								}
-							else
-								{
-								beamroll = roll;
-								}
-							beamrollr = DTR * beamroll;
-							
-							/* get pitch at bottom return time for this beam */
-							if (nins > 0)
-								{
-								interp_status = mb_linear_interp(verbose,
-											ins_time_d-1, ins_pitch-1,
-											nins, time_d + bathymetry->range[i], &beampitch, &jins,
-											&error);
-								}
-							else if (nrock > 0)
-								{
-								interp_status = mb_linear_interp(verbose,
-											rock_time_d-1, rock_pitch-1,
-											nrock, time_d + bathymetry->range[i], &beampitch, &jrock,
-											&error);
-								}
-							else if (ndsl > 0)
-								{
-								interp_status = mb_linear_interp(verbose,
-											dsl_time_d-1, dsl_pitch-1,
-											ndsl, time_d + bathymetry->range[i], &beampitch, &jdsl,
-											&error);
-								}
-							else if (ndat_rph > 0)
-								{
-								interp_status = mb_linear_interp(verbose,
-											dat_rph_time_d-1, dat_rph_pitch-1,
-											ndat_rph, time_d + bathymetry->range[i], &beampitch, &jdattitude,
-											&error);
-								}
-							else
-								{
-								beampitch = pitch;
-								}
-							beampitchr = DTR * beampitch;
-							
-							/* get heading at bottom return time for this beam */
-							if (nins > 0)
-								{
-								interp_status = mb_linear_interp(verbose,
-											ins_time_d-1, ins_heading-1,
-											nins, time_d + bathymetry->range[i], &beamheading, &jins,
-											&error);
-								}
-							else if (nrock > 0)
-								{
-								interp_status = mb_linear_interp(verbose,
-											rock_time_d-1, rock_heading-1,
-											nrock, time_d + bathymetry->range[i], &beamheading, &jrock,
-											&error);
-								}
-							else if (ndsl > 0)
-								{
-								interp_status = mb_linear_interp(verbose,
-											dsl_time_d-1, dsl_heading-1,
-											ndsl, time_d + bathymetry->range[i], &beamheading, &jdsl,
-											&error);
-								}
-							else if (ndat_heading > 0)
-								{
-								interp_status = mb_linear_interp_heading(verbose,
-											dat_heading_time_d-1, dat_heading_heading-1,
-											ndat_heading, time_d + bathymetry->range[i], &beamheading, &jdheading,
-											&error);
-								}
-							else
-								{
-								beamheading = heading;
-								}
-							beamheadingr = DTR * beamheading;
-							
-							/* calculate beam angles for raytracing using Jon Beaudoin's code based on:
-								Beaudoin, J., Hughes Clarke, J., and Bartlett, J. Application of
-								Surface Sound Speed Measurements in Post-Processing for Multi-Sector
-								Multibeam Echosounders : International Hydrographic Review, v.5, no.3,
-								p.26-31.
-								(http://www.omg.unb.ca/omg/papers/beaudoin_IHR_nov2004.pdf).
-							   note complexity if transducer arrays are reverse mounted, as determined
-							   by a mount heading angle of about 180 degrees rather than about 0 degrees.
-							   If a receive array or a transmit array are reverse mounted then:
-								1) subtract 180 from the heading mount angle of the array
-								2) flip the sign of the pitch and roll mount offsets of the array
-								3) flip the sign of the beam steering angle from that array
-									(reverse TX means flip sign of TX steer, reverse RX
-									means flip sign of RX steer) */
-							tx_steer = RTD * v2rawdetection->tx_angle;
-							tx_orientation.roll = roll;
-							tx_orientation.pitch = pitch;
-							tx_orientation.heading = heading;
-							rx_steer = -RTD * v2rawdetection->rx_angle[j];
-							rx_orientation.roll = beamroll;
-							rx_orientation.pitch = beampitch;
-							rx_orientation.heading = beamheading;
-							reference_heading = heading;
-			
-							status = mb_beaudoin(verbose,
-										tx_align,
-										tx_orientation,
-										tx_steer,
-										rx_align,
-										rx_orientation,
-										rx_steer,
-										reference_heading,
-										&beamAzimuth,
-										&beamDepression,
-										&error);
-							theta = 90.0 - beamDepression;
-							phi = 90.0 - beamAzimuth;
-							if (phi < 0.0)
-								phi += 360.0;
-//fprintf(stderr,"Beam:%5d:%3.3d tx: %f %f %f %f  rx: %f %f %f %f  refh:%f",
-//nrec_multibeam+nrec_multibeam_tot, i, tx_orientation.roll, tx_orientation.pitch, tx_orientation.heading, tx_steer,
-//rx_orientation.roll, rx_orientation.pitch, rx_orientation.heading, rx_steer, reference_heading);
-
-// BD    -90   0    +90
-// MB    180  90     0
-// MB = -BD + X
-// 180 = 90 + X ==> X = 90
-// 90 = -0 + X ==> X = 90
-// 0 = -90 + X ==> X = 90
- 														
-							/* calculate beam angles the old way */
-							/*alpha = RTD * (beampitchr + v2rawdetection->tx_angle) + pitchbias;
-							beta = 90.0 - RTD * (v2rawdetection->rx_angle[j] - beamrollr) + rollbias;
-							mb_rollpitch_to_takeoff(
-								verbose,
-								alpha, beta,
-								&theta, &phi,
-								&error);*/
- 
-							/* calculate bathymetry */
-							rr = 0.5 * soundspeed * bathymetry->range[i];
-							xx = rr * sin(DTR * theta);
-							zz = rr * cos(DTR * theta);
-							bathymetry->acrosstrack[i] = xx * cos(DTR * phi);
-							bathymetry->alongtrack[i] = xx * sin(DTR * phi);
-							bathymetry->depth[i] = zz + sonardepth - heave;
-							bathymetry->pointing_angle[i] = DTR * theta;
-							bathymetry->azimuth_angle[i] = DTR * phi;
-//fprintf(stderr," beamAzimuth:%f beamDepression:%f theta:%f phi:%f  bath: %f %f %f\n",
-//beamAzimuth, beamDepression, theta, phi, bathymetry->acrosstrack[i], bathymetry->alongtrack[i], zz);
-							}
-						}
-
-					/* case of v2detection record with v2detectionsetup */
-					else if (istore->read_v2detection == MB_YES && istore->read_v2detectionsetup == MB_YES)
-						{
-						for (j=0;j<v2detection->number_beams;j++)
-							{
-							i = v2detectionsetup->beam_descriptor[j];
-			
-							bathymetry->range[i] = v2detection->range[j];
-							bathymetry->quality[i] = v2detectionsetup->quality[j];
-							
-							/* compensate for pitch if not already compensated */
-							if ((volatilesettings->transmit_flags & 0xF) != 0)
-								{
-								beampitch = 0.0;
-								}
-							else
-								{
-								beampitch = pitch;
-								}
-							beampitchr = DTR * beampitch;
-							
-							/* compensate for roll if not already compensated */
-							if ((volatilesettings->receive_flags & 0x1) != 0)
-								{
-								beamroll = 0.0;
-								}
-							else
-								{								
-								/* get roll at bottom return time for this beam */
-								if (nins > 0)
-									{
-									interp_status = mb_linear_interp(verbose,
-												ins_time_d-1, ins_roll-1,
-												nins, time_d + bathymetry->range[i], &beamroll, &jins,
-												&error);
-									}
-								else if (nrock > 0)
-									{
-									interp_status = mb_linear_interp(verbose,
-												rock_time_d-1, rock_roll-1,
-												nrock, time_d + bathymetry->range[i], &beamroll, &jrock,
-												&error);
-									}
-								else if (ndsl > 0)
-									{
-									interp_status = mb_linear_interp(verbose,
-												dsl_time_d-1, dsl_roll-1,
-												ndsl, time_d + bathymetry->range[i], &beamroll, &jdsl,
-												&error);
-									}
-								else if (ndat_rph > 0)
-									{
-									interp_status = mb_linear_interp(verbose,
-												dat_rph_time_d-1, dat_rph_roll-1,
-												ndat_rph, time_d + bathymetry->range[i], &beamroll, &jdattitude,
-												&error);
-									}
-								else
-									{
-									beamroll = roll;
-									}
-								}
-							beamrollr = DTR * beamroll;
-								
-							/* calculate bathymetry */
-							alpha = RTD * (v2detection->angle_y[j] + pitchr
-									+ volatilesettings->steering_vertical) + pitchbias;
-							beta = 90.0 - RTD * (v2detection->angle_x[j] - rollr) + rollbias;
-							mb_rollpitch_to_takeoff(
-								verbose,
-								alpha, beta,
-								&theta, &phi,
-								&error);
-							rr = 0.5 * soundspeed * bathymetry->range[i];
-							xx = rr * sin(DTR * theta);
-							zz = rr * cos(DTR * theta);
-							bathymetry->acrosstrack[i] = xx * cos(DTR * phi);
-							bathymetry->alongtrack[i] = xx * sin(DTR * phi);
-							bathymetry->depth[i] = zz + sonardepth - heave;
-							bathymetry->pointing_angle[i] = DTR * theta;
-							bathymetry->azimuth_angle[i] = DTR * phi;
-							}
-						}
-
-					/* case of v2detection record */
-					else if (istore->read_v2detection == MB_YES)
-						{
-						/* now loop over the detects */
-						for (i=0;i<v2detection->number_beams;i++)
-							{
-							bathymetry->range[i] = v2detection->range[i];
-							/* bathymetry->quality[i] set in bathymetry record */
-							
-							/* compensate for pitch if not already compensated */
-							if ((volatilesettings->transmit_flags & 0xF) != 0)
-								{
-								beampitch = 0.0;
-								}
-							else
-								{
-								beampitch = pitch;
-								}
-							beampitchr = DTR * beampitch;
-							
-							/* compensate for roll if not already compensated */
-							if ((volatilesettings->receive_flags & 0x1) != 0)
-								{
-								beamroll = 0.0;
-								}
-							else
-								{								
-								/* get roll at bottom return time for this beam */
-								if (nins > 0)
-									{
-									interp_status = mb_linear_interp(verbose,
-												ins_time_d-1, ins_roll-1,
-												nins, time_d + bathymetry->range[i], &beamroll, &jins,
-												&error);
-									}
-								else if (nrock > 0)
-									{
-									interp_status = mb_linear_interp(verbose,
-												rock_time_d-1, rock_roll-1,
-												nrock, time_d + bathymetry->range[i], &beamroll, &jrock,
-												&error);
-									}
-								else if (ndsl > 0)
-									{
-									interp_status = mb_linear_interp(verbose,
-												dsl_time_d-1, dsl_roll-1,
-												ndsl, time_d + bathymetry->range[i], &beamroll, &jdsl,
-												&error);
-									}
-								else if (ndat_rph > 0)
-									{
-									interp_status = mb_linear_interp(verbose,
-												dat_rph_time_d-1, dat_rph_roll-1,
-												ndat_rph, time_d + bathymetry->range[i], &beamroll, &jdattitude,
-												&error);
-									}
-								else
-									{
-									beamroll = roll;
-									}
-								}
-							beamrollr = DTR * beamroll;
-								
-							/* calculate bathymetry */
-							alpha = RTD * (v2detection->angle_y[i] + beampitchr
-									+ volatilesettings->steering_vertical) + pitchbias;
-							beta = 90.0 - RTD * (v2detection->angle_x[i] - beamrollr) + rollbias;
-							mb_rollpitch_to_takeoff(
-								verbose,
-								alpha, beta,
-								&theta, &phi,
-								&error);
-							rr = 0.5 * soundspeed * bathymetry->range[i];
-							xx = rr * sin(DTR * theta);
-							zz = rr * cos(DTR * theta);
-							bathymetry->acrosstrack[i] = xx * cos(DTR * phi);
-							bathymetry->alongtrack[i] = xx * sin(DTR * phi);
-							bathymetry->depth[i] = zz + sonardepth - heave;
-							bathymetry->pointing_angle[i] = DTR * theta;
-							bathymetry->azimuth_angle[i] = DTR * phi;
-							}
-						}
-
-					/* else default case of beamgeometry record */
-					else
-						{
-						/* loop over all beams */
-						for (i=0;i<bathymetry->number_beams;i++)
-							{
-							/* bathymetry->range[i] set */
-							/* bathymetry->quality[i] set */
-							if ((bathymetry->quality[i] & 15) > 0)
-								{
-								/* compensate for pitch if not already compensated */
-								if ((volatilesettings->transmit_flags & 0xF) != 0)
-									{
-									beampitch = 0.0;
-									}
-								else
-									{
-									beampitch = pitch;
-									}
-								beampitchr = DTR * beampitch;
-								
-								/* compensate for roll if not already compensated */
-								if ((volatilesettings->receive_flags & 0x1) != 0)
-									{
-									beamroll = 0.0;
-									}
-								else
-									{								
-									/* get roll at bottom return time for this beam */
-									if (nins > 0)
-										{
-										interp_status = mb_linear_interp(verbose,
-													ins_time_d-1, ins_roll-1,
-													nins, time_d + bathymetry->range[i], &beamroll, &jins,
-													&error);
-										}
-									else if (nrock > 0)
-										{
-										interp_status = mb_linear_interp(verbose,
-													rock_time_d-1, rock_roll-1,
-													nrock, time_d + bathymetry->range[i], &beamroll, &jrock,
-													&error);
-										}
-									else if (ndsl > 0)
-										{
-										interp_status = mb_linear_interp(verbose,
-													dsl_time_d-1, dsl_roll-1,
-													ndsl, time_d + bathymetry->range[i], &beamroll, &jdsl,
-													&error);
-										}
-									else if (ndat_rph > 0)
-										{
-										interp_status = mb_linear_interp(verbose,
-													dat_rph_time_d-1, dat_rph_roll-1,
-													ndat_rph, time_d + bathymetry->range[i], &beamroll, &jdattitude,
-													&error);
-										}
-									else
-										{
-										beamroll = roll;
-										}
-									}
-								beamrollr = DTR * beamroll;
-								
-								/* compensate for heave if not already compensated */
-								if ((volatilesettings->receive_flags & 0x2) != 0)
-									{
-									beamheave = 0.0;
-									}
-								else
-									{								
-									/* get roll at bottom return time for this beam */
-									if (ndat_rph > 0)
-										{
-										interp_status = mb_linear_interp(verbose,
-													dat_rph_time_d-1, dat_rph_heave-1,
-													ndat_rph, time_d + bathymetry->range[i], &beamheave, &jdattitude,
-													&error);
-										}
-									else
-										{
-										beamheave = heave;
-										}
-									}
-								
-								/* calculate bathymetry */
-								alpha = RTD * (beamgeometry->angle_alongtrack[i] + pitchr
-									       + volatilesettings->steering_vertical) + pitchbias;
-								beta = 90.0 - RTD * (beamgeometry->angle_acrosstrack[i] - beamrollr) + rollbias;
-								mb_rollpitch_to_takeoff(
-									verbose,
-									alpha, beta,
-									&theta, &phi,
-									&error);
-								rr = 0.5 * soundspeed * bathymetry->range[i];
-								xx = rr * sin(DTR * theta);
-								zz = rr * cos(DTR * theta);
-								bathymetry->acrosstrack[i] = xx * cos(DTR * phi);
-								bathymetry->alongtrack[i] = xx * sin(DTR * phi);
-								bathymetry->depth[i] = zz + sonardepth - beamheave;
-								bathymetry->pointing_angle[i] = DTR * theta;
-								bathymetry->azimuth_angle[i] = DTR * phi;
-								}
-							}
-						}
-
-					/* set flag */
-					bathymetry->optionaldata = MB_YES;
-					bathymetry->header.OffsetToOptionalData
-							= MBSYS_RESON7K_RECORDHEADER_SIZE
-								+ R7KHDRSIZE_7kBathymetricData
-								+ bathymetry->number_beams * 9;
-
-					/* output synchronous attitude */
-					fprintf(stafp, "%0.6f\t%0.3f\t%0.3f\n",
-						time_d, roll, pitch);
-					}
-				}
-			if (istore->read_backscatter == MB_YES)
-				{
-				backscatter = &(istore->backscatter);
-				header = &(backscatter->header);
-				time_j[0] = header->s7kTime.Year;
-				time_j[1] = header->s7kTime.Day;
-				time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-				time_j[3] = (int) header->s7kTime.Seconds;
-				time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-				mb_get_itime(verbose, time_j, time_i);
-				mb_get_time(verbose, time_i, &time_d);
-				if (verbose > 0)
-				fprintf(stderr,"R7KRECID_7kBackscatterImageData:   7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d ping:%d samples:%d\n",
-					time_i[0],time_i[1],time_i[2],
-					time_i[3],time_i[4],time_i[5],time_i[6],
-					header->RecordNumber,backscatter->ping_number,backscatter->number_samples);
-				}
-			if (istore->read_beam == MB_YES)
-				{
-				beam = &(istore->beam);
-				header = &(beam->header);
-				time_j[0] = header->s7kTime.Year;
-				time_j[1] = header->s7kTime.Day;
-				time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-				time_j[3] = (int) header->s7kTime.Seconds;
-				time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-				mb_get_itime(verbose, time_j, time_i);
-				mb_get_time(verbose, time_i, &time_d);
-				if (verbose > 0)
-				fprintf(stderr,"R7KRECID_7kBeamData: 7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d ping:%d beams:%d samples:%d\n",
-					time_i[0],time_i[1],time_i[2],
-					time_i[3],time_i[4],time_i[5],time_i[6],
-					header->RecordNumber,beam->ping_number,beam->number_beams,beam->number_samples);
-				}
-			if (istore->read_verticaldepth == MB_YES)
-				{
-				verticaldepth = &(istore->verticaldepth);
-				header = &(verticaldepth->header);
-				time_j[0] = header->s7kTime.Year;
-				time_j[1] = header->s7kTime.Day;
-				time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-				time_j[3] = (int) header->s7kTime.Seconds;
-				time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-				mb_get_itime(verbose, time_j, time_i);
-				mb_get_time(verbose, time_i, &time_d);
-				if (verbose > 0)
-				fprintf(stderr,"R7KRECID_7kVerticalDepth: 7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d ping:%d\n",
-					time_i[0],time_i[1],time_i[2],
-					time_i[3],time_i[4],time_i[5],time_i[6],
-					header->RecordNumber,verticaldepth->ping_number);
-				}
-			if (istore->read_image == MB_YES)
-				{
-				image = &(istore->image);
-				header = &(image->header);
-				time_j[0] = header->s7kTime.Year;
-				time_j[1] = header->s7kTime.Day;
-				time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-				time_j[3] = (int) header->s7kTime.Seconds;
-				time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-				mb_get_itime(verbose, time_j, time_i);
-				mb_get_time(verbose, time_i, &time_d);
-				if (verbose > 0)
-				fprintf(stderr,"R7KRECID_7kImageData:              7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d ping:%d width:%d height:%d\n",
-					time_i[0],time_i[1],time_i[2],
-					time_i[3],time_i[4],time_i[5],time_i[6],
-					header->RecordNumber,image->ping_number,image->width,image->height);
-				}
-
-			/* regenerate sidescan */
-			status = mbsys_reson7k_makess(verbose, imbio_ptr, istore_ptr,
-						ss_source, MB_NO, &pixel_size,
-						MB_NO, &swath_width,
-						MB_YES, &error);
-			}
-
-	   	/* handle reference point data */
-		else if (status == MB_SUCCESS && istore->type == R7KRECID_ReferencePoint)
-			{
-			nrec_reference++;
-
-			reference = &(istore->reference);
-			header = &(reference->header);
-			time_j[0] = header->s7kTime.Year;
-			time_j[1] = header->s7kTime.Day;
-			time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-			time_j[3] = (int) header->s7kTime.Seconds;
-			time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-			mb_get_itime(verbose, time_j, time_i);
-			mb_get_time(verbose, time_i, &time_d);
-			if (verbose > 0)
-				fprintf(stderr,"R7KRECID_ReferencePoint: 7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d\n",
-				time_i[0],time_i[1],time_i[2],
-				time_i[3],time_i[4],time_i[5],time_i[6],
-				header->RecordNumber);
-			}
-
-	   	/* handle uncalibrated sensor offset data */
-		else if (status == MB_SUCCESS && istore->type == R7KRECID_UncalibratedSensorOffset)
-			{
-			nrec_sensoruncal++;
-
-			sensoruncal = &(istore->sensoruncal);
-			header = &(sensoruncal->header);
-			time_j[0] = header->s7kTime.Year;
-			time_j[1] = header->s7kTime.Day;
-			time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-			time_j[3] = (int) header->s7kTime.Seconds;
-			time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-			mb_get_itime(verbose, time_j, time_i);
-			mb_get_time(verbose, time_i, &time_d);
-			if (verbose > 0)
-				fprintf(stderr,"R7KRECID_UncalibratedSensorOffset: 7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d\n",
-				time_i[0],time_i[1],time_i[2],
-				time_i[3],time_i[4],time_i[5],time_i[6],
-				header->RecordNumber);
-			}
-
-	   	/* handle calibrated sensor offset data */
-		else if (status == MB_SUCCESS && istore->type == R7KRECID_CalibratedSensorOffset)
-			{
-			nrec_sensorcal++;
-
-			sensorcal = &(istore->sensorcal);
-			header = &(sensorcal->header);
-			time_j[0] = header->s7kTime.Year;
-			time_j[1] = header->s7kTime.Day;
-			time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-			time_j[3] = (int) header->s7kTime.Seconds;
-			time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-			mb_get_itime(verbose, time_j, time_i);
-			mb_get_time(verbose, time_i, &time_d);
-			if (verbose > 0)
-				fprintf(stderr,"R7KRECID_CalibratedSensorOffset: 7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d\n",
-				time_i[0],time_i[1],time_i[2],
-				time_i[3],time_i[4],time_i[5],time_i[6],
-				header->RecordNumber);
-			}
-
-	   	/* handle position data */
-		else if (status == MB_SUCCESS && istore->type == R7KRECID_Position)
-			{
-			nrec_position++;
-
-			position = &(istore->position);
-			header = &(position->header);
-			time_j[0] = header->s7kTime.Year;
-			time_j[1] = header->s7kTime.Day;
-			time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-			time_j[3] = (int) header->s7kTime.Seconds;
-			time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-			mb_get_itime(verbose, time_j, time_i);
-			mb_get_time(verbose, time_i, &time_d);
-
-			/* get timelag value */
-			timelag = 0.0;
-			if (timedelaymode == MB7KPREPROCESS_TIMEDELAY_ON && ntimedelay > 0)
-			interp_status = mb_linear_interp(verbose,
-						timedelay_time_d-1, timedelay_timedelay-1,
-						ntimedelay, time_d, &timelag, &jtimedelay,
-						&error);
-			if (timelagmode == MB7KPREPROCESS_TIMELAG_CONSTANT)
-				{
-				timelag -= timelagconstant;
-				}
-			else if (timelagmode == MB7KPREPROCESS_TIMELAG_MODEL && ntimelag > 0)
-				{
-				interp_status = mb_linear_interp(verbose,
-							timelag_time_d-1, timelag_model-1,
-							ntimelag, time_d, &timelagm, &jtimelag,
-							&error);
-				timelag -= timelagm;
-				}
-			time_d += timelag;
-			mb_get_date(verbose, time_d,time_i);
-			mb_get_jtime(verbose, time_i, time_j);
-			header->s7kTime.Year = time_i[0];
-			header->s7kTime.Day = time_j[1];
-			header->s7kTime.Hours = time_i[3];
-			header->s7kTime.Minutes = time_i[4];
-			header->s7kTime.Seconds = time_i[5] + 0.000001 * time_i[6];
-
-			if (verbose > 0)
-				fprintf(stderr,"R7KRECID_Position: 7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d\n",
-			time_i[0],time_i[1],time_i[2],
-			time_i[3],time_i[4],time_i[5],time_i[6],
-			header->RecordNumber);
-			}
-
-	   	/* handle customattitude data */
-		else if (status == MB_SUCCESS && istore->type == R7KRECID_CustomAttitude)
-			{
-			nrec_customattitude++;
-
-			customattitude = &(istore->customattitude);
-			header = &(customattitude->header);
-			time_j[0] = header->s7kTime.Year;
-			time_j[1] = header->s7kTime.Day;
-			time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-			time_j[3] = (int) header->s7kTime.Seconds;
-			time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-			mb_get_itime(verbose, time_j, time_i);
-			mb_get_time(verbose, time_i, &time_d);
-
-			/* get timelag value */
-			timelag = 0.0;
-			if (timedelaymode == MB7KPREPROCESS_TIMEDELAY_ON && ntimedelay > 0)
-			interp_status = mb_linear_interp(verbose,
-						timedelay_time_d-1, timedelay_timedelay-1,
-						ntimedelay, time_d, &timelag, &jtimedelay,
-						&error);
-			if (timelagmode == MB7KPREPROCESS_TIMELAG_CONSTANT)
-				{
-				timelag -= timelagconstant;
-				}
-			else if (timelagmode == MB7KPREPROCESS_TIMELAG_MODEL && ntimelag > 0)
-				{
-				interp_status = mb_linear_interp(verbose,
-							timelag_time_d-1, timelag_model-1,
-							ntimelag, time_d, &timelagm, &jtimelag,
-							&error);
-				timelag -= timelagm;
-				}
-			time_d += timelag;
-			mb_get_date(verbose, time_d,time_i);
-			mb_get_jtime(verbose, time_i, time_j);
-			header->s7kTime.Year = time_i[0];
-			header->s7kTime.Day = time_j[1];
-			header->s7kTime.Hours = time_i[3];
-			header->s7kTime.Minutes = time_i[4];
-			header->s7kTime.Seconds = time_i[5] + 0.000001 * time_i[6];
-
-			if (verbose > 0)
-				fprintf(stderr,"R7KRECID_CustomAttitude: 7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d\n",
-			time_i[0],time_i[1],time_i[2],
-			time_i[3],time_i[4],time_i[5],time_i[6],
-			header->RecordNumber);
-
-			/* output asynchronous heading and attitude */
-			for (i=0; i< customattitude->n; i++)
-				{
-				fprintf(athfp, "%0.6f\t%7.3f\n", time_d, RTD * customattitude->heading[i]);
-				fprintf(atafp, "%0.6f\t%0.3f\t%0.3f\n",
-						time_d, RTD * customattitude->roll[i], RTD * customattitude->pitch[i]);
-				}
-			}
-
-	   	/* handle tide data */
-		else if (status == MB_SUCCESS && istore->type == R7KRECID_Tide)
-			{
-			nrec_tide++;
-
-			tide = &(istore->tide);
-			header = &(fileheader->header);
-			time_j[0] = header->s7kTime.Year;
-			time_j[1] = header->s7kTime.Day;
-			time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-			time_j[3] = (int) header->s7kTime.Seconds;
-			time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-			mb_get_itime(verbose, time_j, time_i);
-			mb_get_time(verbose, time_i, &time_d);
-			if (verbose > 0)
-				fprintf(stderr,"R7KRECID_Tide: 7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d\n",
-				time_i[0],time_i[1],time_i[2],
-				time_i[3],time_i[4],time_i[5],time_i[6],
-				header->RecordNumber);
-			}
-
-	   	/* handle altitude data */
-		else if (status == MB_SUCCESS && istore->type == R7KRECID_Altitude)
-			{
-			nrec_altitude++;
-
-			altituderec = &(istore->altitude);
-			header = &(fileheader->header);
-			time_j[0] = header->s7kTime.Year;
-			time_j[1] = header->s7kTime.Day;
-			time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-			time_j[3] = (int) header->s7kTime.Seconds;
-			time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-			mb_get_itime(verbose, time_j, time_i);
-			mb_get_time(verbose, time_i, &time_d);
-
-			/* get timelag value */
-			timelag = 0.0;
-			if (timedelaymode == MB7KPREPROCESS_TIMEDELAY_ON && ntimedelay > 0)
-			interp_status = mb_linear_interp(verbose,
-						timedelay_time_d-1, timedelay_timedelay-1,
-						ntimedelay, time_d, &timelag, &jtimedelay,
-						&error);
-			if (timelagmode == MB7KPREPROCESS_TIMELAG_CONSTANT)
-				{
-				timelag -= timelagconstant;
-				}
-			else if (timelagmode == MB7KPREPROCESS_TIMELAG_MODEL && ntimelag > 0)
-				{
-				interp_status = mb_linear_interp(verbose,
-							timelag_time_d-1, timelag_model-1,
-							ntimelag, time_d, &timelagm, &jtimelag,
-							&error);
-				timelag -= timelagm;
-				}
-			time_d += timelag;
-			mb_get_date(verbose, time_d,time_i);
-			mb_get_jtime(verbose, time_i, time_j);
-			header->s7kTime.Year = time_i[0];
-			header->s7kTime.Day = time_j[1];
-			header->s7kTime.Hours = time_i[3];
-			header->s7kTime.Minutes = time_i[4];
-			header->s7kTime.Seconds = time_i[5] + 0.000001 * time_i[6];
-
-			if (verbose > 0)
-				fprintf(stderr,"R7KRECID_Altitude: 7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d\n",
-				time_i[0],time_i[1],time_i[2],
-				time_i[3],time_i[4],time_i[5],time_i[6],
-				header->RecordNumber);
-			}
-
-	   	/* handle motion data */
-		else if (status == MB_SUCCESS && istore->type == R7KRECID_MotionOverGround)
-			{
-			nrec_motion++;
-
-			motion = &(istore->motion);
-			header = &(motion->header);
-			time_j[0] = header->s7kTime.Year;
-			time_j[1] = header->s7kTime.Day;
-			time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-			time_j[3] = (int) header->s7kTime.Seconds;
-			time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-			mb_get_itime(verbose, time_j, time_i);
-			mb_get_time(verbose, time_i, &time_d);
-
-			/* get timelag value */
-			timelag = 0.0;
-			if (timedelaymode == MB7KPREPROCESS_TIMEDELAY_ON && ntimedelay > 0)
-			interp_status = mb_linear_interp(verbose,
-						timedelay_time_d-1, timedelay_timedelay-1,
-						ntimedelay, time_d, &timelag, &jtimedelay,
-						&error);
-			if (timelagmode == MB7KPREPROCESS_TIMELAG_CONSTANT)
-				{
-				timelag -= timelagconstant;
-				}
-			else if (timelagmode == MB7KPREPROCESS_TIMELAG_MODEL && ntimelag > 0)
-				{
-				interp_status = mb_linear_interp(verbose,
-							timelag_time_d-1, timelag_model-1,
-							ntimelag, time_d, &timelagm, &jtimelag,
-							&error);
-				timelag -= timelagm;
-				}
-			time_d += timelag;
-			mb_get_date(verbose, time_d,time_i);
-			mb_get_jtime(verbose, time_i, time_j);
-			header->s7kTime.Year = time_i[0];
-			header->s7kTime.Day = time_j[1];
-			header->s7kTime.Hours = time_i[3];
-			header->s7kTime.Minutes = time_i[4];
-			header->s7kTime.Seconds = time_i[5] + 0.000001 * time_i[6];
-
-			if (verbose > 0)
-				fprintf(stderr,"R7KRECID_MotionOverGround: 7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d n:%d\n",
-				time_i[0],time_i[1],time_i[2],
-				time_i[3],time_i[4],time_i[5],time_i[6],
-				header->RecordNumber,motion->n);
-			}
-
-	   	/* handle depth data */
-		else if (status == MB_SUCCESS && istore->type == R7KRECID_Depth)
-			{
-			nrec_depth++;
-
-			depth = &(istore->depth);
-			header = &(depth->header);
-			time_j[0] = header->s7kTime.Year;
-			time_j[1] = header->s7kTime.Day;
-			time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-			time_j[3] = (int) header->s7kTime.Seconds;
-			time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-			mb_get_itime(verbose, time_j, time_i);
-			mb_get_time(verbose, time_i, &time_d);
-
-			/* get timelag value */
-			timelag = 0.0;
-			if (timedelaymode == MB7KPREPROCESS_TIMEDELAY_ON && ntimedelay > 0)
-			interp_status = mb_linear_interp(verbose,
-						timedelay_time_d-1, timedelay_timedelay-1,
-						ntimedelay, time_d, &timelag, &jtimedelay,
-						&error);
-			if (timelagmode == MB7KPREPROCESS_TIMELAG_CONSTANT)
-				{
-				timelag -= timelagconstant;
-				}
-			else if (timelagmode == MB7KPREPROCESS_TIMELAG_MODEL && ntimelag > 0)
-				{
-				interp_status = mb_linear_interp(verbose,
-							timelag_time_d-1, timelag_model-1,
-							ntimelag, time_d, &timelagm, &jtimelag,
-							&error);
-				timelag -= timelagm;
-				}
-			time_d += timelag;
-			mb_get_date(verbose, time_d,time_i);
-			mb_get_jtime(verbose, time_i, time_j);
-			header->s7kTime.Year = time_i[0];
-			header->s7kTime.Day = time_j[1];
-			header->s7kTime.Hours = time_i[3];
-			header->s7kTime.Minutes = time_i[4];
-			header->s7kTime.Seconds = time_i[5] + 0.000001 * time_i[6];
-
-			if (verbose > 0)
-				fprintf(stderr,"R7KRECID_Depth: 7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d\n",
-				time_i[0],time_i[1],time_i[2],
-				time_i[3],time_i[4],time_i[5],time_i[6],
-				header->RecordNumber);
-			}
-
-	   	/* handle sound velocity data */
-		else if (status == MB_SUCCESS && istore->type == R7KRECID_SoundVelocityProfile)
-			{
-			nrec_svp++;
-
-			svp = &(istore->svp);
-			header = &(svp->header);
-			time_j[0] = header->s7kTime.Year;
-			time_j[1] = header->s7kTime.Day;
-			time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-			time_j[3] = (int) header->s7kTime.Seconds;
-			time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-			mb_get_itime(verbose, time_j, time_i);
-			mb_get_time(verbose, time_i, &time_d);
-
-			/* get timelag value */
-			timelag = 0.0;
-			if (timedelaymode == MB7KPREPROCESS_TIMEDELAY_ON && ntimedelay > 0)
-			interp_status = mb_linear_interp(verbose,
-						timedelay_time_d-1, timedelay_timedelay-1,
-						ntimedelay, time_d, &timelag, &jtimedelay,
-						&error);
-			if (timelagmode == MB7KPREPROCESS_TIMELAG_CONSTANT)
-				{
-				timelag -= timelagconstant;
-				}
-			else if (timelagmode == MB7KPREPROCESS_TIMELAG_MODEL && ntimelag > 0)
-				{
-				interp_status = mb_linear_interp(verbose,
-							timelag_time_d-1, timelag_model-1,
-							ntimelag, time_d, &timelagm, &jtimelag,
-							&error);
-				timelag -= timelagm;
-				}
-			time_d += timelag;
-			mb_get_date(verbose, time_d,time_i);
-			mb_get_jtime(verbose, time_i, time_j);
-			header->s7kTime.Year = time_i[0];
-			header->s7kTime.Day = time_j[1];
-			header->s7kTime.Hours = time_i[3];
-			header->s7kTime.Minutes = time_i[4];
-			header->s7kTime.Seconds = time_i[5] + 0.000001 * time_i[6];
-
-			if (verbose > 0)
-				fprintf(stderr,"R7KRECID_SoundVelocityProfile: 7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d n:%d\n",
-				time_i[0],time_i[1],time_i[2],
-				time_i[3],time_i[4],time_i[5],time_i[6],
-				header->RecordNumber,svp->n);
-			}
-
-	   	/* handle ctd data */
-		else if (status == MB_SUCCESS && istore->type == R7KRECID_CTD)
-			{
-			nrec_ctd++;
-
-			ctd = &(istore->ctd);
-			header = &(ctd->header);
-			time_j[0] = header->s7kTime.Year;
-			time_j[1] = header->s7kTime.Day;
-			time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-			time_j[3] = (int) header->s7kTime.Seconds;
-			time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-			mb_get_itime(verbose, time_j, time_i);
-			mb_get_time(verbose, time_i, &time_d);
-
-			/* get timelag value */
-			timelag = 0.0;
-			if (timedelaymode == MB7KPREPROCESS_TIMEDELAY_ON && ntimedelay > 0)
-			interp_status = mb_linear_interp(verbose,
-						timedelay_time_d-1, timedelay_timedelay-1,
-						ntimedelay, time_d, &timelag, &jtimedelay,
-						&error);
-			if (timelagmode == MB7KPREPROCESS_TIMELAG_CONSTANT)
-				{
-				timelag -= timelagconstant;
-				}
-			else if (timelagmode == MB7KPREPROCESS_TIMELAG_MODEL && ntimelag > 0)
-				{
-				interp_status = mb_linear_interp(verbose,
-							timelag_time_d-1, timelag_model-1,
-							ntimelag, time_d, &timelagm, &jtimelag,
-							&error);
-				timelag -= timelagm;
-				}
-			time_d += timelag;
-			mb_get_date(verbose, time_d,time_i);
-			mb_get_jtime(verbose, time_i, time_j);
-			header->s7kTime.Year = time_i[0];
-			header->s7kTime.Day = time_j[1];
-			header->s7kTime.Hours = time_i[3];
-			header->s7kTime.Minutes = time_i[4];
-			header->s7kTime.Seconds = time_i[5] + 0.000001 * time_i[6];
-
-			if (verbose > 0)
-				fprintf(stderr,"R7KRECID_CTD: 7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d n:%d\n",
-			time_i[0],time_i[1],time_i[2],
-			time_i[3],time_i[4],time_i[5],time_i[6],
-			header->RecordNumber,ctd->n);
-
-			/* output ctd data to file */
-			for (i=0; i<ctd->n; i++)
-				{
-				fprintf(tfp,"%.3f %11.6f %10.6f %.3f %.3f %.2f %.3f\n",
-					time_d, navlon, navlat, sonardepth, altitude,
-					ctd->temperature[i],
-					ctd->conductivity_salinity[i]);
-				}
-			}
-
-	   	/* handle geodesy data */
-		else if (status == MB_SUCCESS && istore->type == R7KRECID_Geodesy)
-			{
-			nrec_geodesy++;
-
-			geodesy = &(istore->geodesy);
-			header = &(geodesy->header);
-			time_j[0] = header->s7kTime.Year;
-			time_j[1] = header->s7kTime.Day;
-			time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-			time_j[3] = (int) header->s7kTime.Seconds;
-			time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-			mb_get_itime(verbose, time_j, time_i);
-			mb_get_time(verbose, time_i, &time_d);
-
-			if (verbose > 0)
-				fprintf(stderr,"R7KRECID_Geodesy: 7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d\n",
-			time_i[0],time_i[1],time_i[2],
-			time_i[3],time_i[4],time_i[5],time_i[6],
-			header->RecordNumber);
-			}
-
-	   	/* handle rollpitchheave data */
-		else if (status == MB_SUCCESS && istore->type == R7KRECID_RollPitchHeave)
-			{
-			nrec_rollpitchheave++;
-
-			rollpitchheave = &(istore->rollpitchheave);
-			header = &(rollpitchheave->header);
-			time_j[0] = header->s7kTime.Year;
-			time_j[1] = header->s7kTime.Day;
-			time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-			time_j[3] = (int) header->s7kTime.Seconds;
-			time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-			mb_get_itime(verbose, time_j, time_i);
-			mb_get_time(verbose, time_i, &time_d);
-
-			/* get timelag value */
-			timelag = 0.0;
-			if (timedelaymode == MB7KPREPROCESS_TIMEDELAY_ON && ntimedelay > 0)
-			interp_status = mb_linear_interp(verbose,
-						timedelay_time_d-1, timedelay_timedelay-1,
-						ntimedelay, time_d, &timelag, &jtimedelay,
-						&error);
-			if (timelagmode == MB7KPREPROCESS_TIMELAG_CONSTANT)
-				{
-				timelag -= timelagconstant;
-				}
-			else if (timelagmode == MB7KPREPROCESS_TIMELAG_MODEL && ntimelag > 0)
-				{
-				interp_status = mb_linear_interp(verbose,
-							timelag_time_d-1, timelag_model-1,
-							ntimelag, time_d, &timelagm, &jtimelag,
-							&error);
-				timelag -= timelagm;
-				}
-			time_d += timelag;
-			mb_get_date(verbose, time_d,time_i);
-			mb_get_jtime(verbose, time_i, time_j);
-			header->s7kTime.Year = time_i[0];
-			header->s7kTime.Day = time_j[1];
-			header->s7kTime.Hours = time_i[3];
-			header->s7kTime.Minutes = time_i[4];
-			header->s7kTime.Seconds = time_i[5] + 0.000001 * time_i[6];
-
-			if (verbose > 0)
-				fprintf(stderr,"R7KRECID_RollPitchHeave:               7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d\n",
-			time_i[0],time_i[1],time_i[2],
-			time_i[3],time_i[4],time_i[5],time_i[6],
-			header->RecordNumber);
-
-			/* output asynchronous attitude */
-			fprintf(atafp, "%0.6f\t%0.3f\t%0.3f\n",
-					time_d, RTD * rollpitchheave->roll, RTD * rollpitchheave->pitch);
-			}
-
-	   	/* handle heading data */
-		else if (status == MB_SUCCESS && istore->type == R7KRECID_Heading)
-			{
-			nrec_heading++;
-
-			headingrec = &(istore->heading);
-			header = &(headingrec->header);
-			time_j[0] = header->s7kTime.Year;
-			time_j[1] = header->s7kTime.Day;
-			time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-			time_j[3] = (int) header->s7kTime.Seconds;
-			time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-			mb_get_itime(verbose, time_j, time_i);
-			mb_get_time(verbose, time_i, &time_d);
-
-			/* get timelag value */
-			timelag = 0.0;
-			if (timedelaymode == MB7KPREPROCESS_TIMEDELAY_ON && ntimedelay > 0)
-			interp_status = mb_linear_interp(verbose,
-						timedelay_time_d-1, timedelay_timedelay-1,
-						ntimedelay, time_d, &timelag, &jtimedelay,
-						&error);
-			if (timelagmode == MB7KPREPROCESS_TIMELAG_CONSTANT)
-				{
-				timelag -= timelagconstant;
-				}
-			else if (timelagmode == MB7KPREPROCESS_TIMELAG_MODEL && ntimelag > 0)
-				{
-				interp_status = mb_linear_interp(verbose,
-							timelag_time_d-1, timelag_model-1,
-							ntimelag, time_d, &timelagm, &jtimelag,
-							&error);
-				timelag -= timelagm;
-				}
-			time_d += timelag;
-			mb_get_date(verbose, time_d,time_i);
-			mb_get_jtime(verbose, time_i, time_j);
-			header->s7kTime.Year = time_i[0];
-			header->s7kTime.Day = time_j[1];
-			header->s7kTime.Hours = time_i[3];
-			header->s7kTime.Minutes = time_i[4];
-			header->s7kTime.Seconds = time_i[5] + 0.000001 * time_i[6];
-
-			if (verbose > 0)
-				fprintf(stderr,"R7KRECID_Heading: 7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d\n",
-				time_i[0],time_i[1],time_i[2],
-				time_i[3],time_i[4],time_i[5],time_i[6],
-				header->RecordNumber);
-
-			/* output asynchronous heading */
-			fprintf(athfp, "%0.6f\t%7.3f\n", time_d, RTD * headingrec->heading);
-			}
-
-	   	/* handle survey line data */
-		else if (status == MB_SUCCESS && istore->type == R7KRECID_SurveyLine)
-			{
-			nrec_surveyline++;
-
-			surveyline = &(istore->surveyline);
-			header = &(surveyline->header);
-			time_j[0] = header->s7kTime.Year;
-			time_j[1] = header->s7kTime.Day;
-			time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-			time_j[3] = (int) header->s7kTime.Seconds;
-			time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-			mb_get_itime(verbose, time_j, time_i);
-			mb_get_time(verbose, time_i, &time_d);
-
-			if (verbose > 0)
-				fprintf(stderr,"R7KRECID_SurveyLine: 7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d\n",
-			time_i[0],time_i[1],time_i[2],
-			time_i[3],time_i[4],time_i[5],time_i[6],
-			header->RecordNumber);
-			}
-
-	   	/* handle navigation data */
-		else if (status == MB_SUCCESS && istore->type == R7KRECID_Navigation)
-			{
-			nrec_navigation++;
-
-			navigation = &(istore->navigation);
-			header = &(navigation->header);
-			time_j[0] = header->s7kTime.Year;
-			time_j[1] = header->s7kTime.Day;
-			time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-			time_j[3] = (int) header->s7kTime.Seconds;
-			time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-			mb_get_itime(verbose, time_j, time_i);
-			mb_get_time(verbose, time_i, &time_d);
-
-			/* get timelag value */
-			timelag = 0.0;
-			if (timedelaymode == MB7KPREPROCESS_TIMEDELAY_ON && ntimedelay > 0)
-			interp_status = mb_linear_interp(verbose,
-						timedelay_time_d-1, timedelay_timedelay-1,
-						ntimedelay, time_d, &timelag, &jtimedelay,
-						&error);
-			if (timelagmode == MB7KPREPROCESS_TIMELAG_CONSTANT)
-				{
-				timelag -= timelagconstant;
-				}
-			else if (timelagmode == MB7KPREPROCESS_TIMELAG_MODEL && ntimelag > 0)
-				{
-				interp_status = mb_linear_interp(verbose,
-							timelag_time_d-1, timelag_model-1,
-							ntimelag, time_d, &timelagm, &jtimelag,
-							&error);
-				timelag -= timelagm;
-				}
-			time_d += timelag;
-			mb_get_date(verbose, time_d,time_i);
-			mb_get_jtime(verbose, time_i, time_j);
-			header->s7kTime.Year = time_i[0];
-			header->s7kTime.Day = time_j[1];
-			header->s7kTime.Hours = time_i[3];
-			header->s7kTime.Minutes = time_i[4];
-			header->s7kTime.Seconds = time_i[5] + 0.000001 * time_i[6];
-
-			if (verbose > 0)
-				fprintf(stderr,"R7KRECID_Navigation: 7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d\n",
-			time_i[0],time_i[1],time_i[2],
-			time_i[3],time_i[4],time_i[5],time_i[6],
-			header->RecordNumber);
-			}
-
-	   	/* handle attitude data */
-		else if (status == MB_SUCCESS && istore->type == R7KRECID_Attitude)
-			{
-			nrec_attitude++;
-
-			attitude = &(istore->attitude);
-			header = &(attitude->header);
-			time_j[0] = header->s7kTime.Year;
-			time_j[1] = header->s7kTime.Day;
-			time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-			time_j[3] = (int) header->s7kTime.Seconds;
-			time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-			mb_get_itime(verbose, time_j, time_i);
-			mb_get_time(verbose, time_i, &time_d);
-
-			/* get timelag value */
-			timelag = 0.0;
-			if (timedelaymode == MB7KPREPROCESS_TIMEDELAY_ON && ntimedelay > 0)
-			interp_status = mb_linear_interp(verbose,
-						timedelay_time_d-1, timedelay_timedelay-1,
-						ntimedelay, time_d, &timelag, &jtimedelay,
-						&error);
-			if (timelagmode == MB7KPREPROCESS_TIMELAG_CONSTANT)
-				{
-				timelag -= timelagconstant;
-				}
-			else if (timelagmode == MB7KPREPROCESS_TIMELAG_MODEL && ntimelag > 0)
-				{
-				interp_status = mb_linear_interp(verbose,
-							timelag_time_d-1, timelag_model-1,
-							ntimelag, time_d, &timelagm, &jtimelag,
-							&error);
-				timelag -= timelagm;
-				}
-			time_d += timelag;
-			mb_get_date(verbose, time_d,time_i);
-			mb_get_jtime(verbose, time_i, time_j);
-			header->s7kTime.Year = time_i[0];
-			header->s7kTime.Day = time_j[1];
-			header->s7kTime.Hours = time_i[3];
-			header->s7kTime.Minutes = time_i[4];
-			header->s7kTime.Seconds = time_i[5] + 0.000001 * time_i[6];
-
-			if (verbose > 0)
-				fprintf(stderr,"R7KRECID_Attitude: 7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d n:%d\n",
-			time_i[0],time_i[1],time_i[2],
-			time_i[3],time_i[4],time_i[5],time_i[6],
-			header->RecordNumber,attitude->n);
-
-			/* output asynchronous attitude */
-			for (i=0; i<attitude->n; i++)
-				{
-				fprintf(atafp, "%0.6f\t%0.3f\t%0.3f\n",
-						time_d, RTD * attitude->roll[i], RTD * attitude->pitch[i]);
-				}
-			}
-
-	   	/* handle file header data */
-		else if (status == MB_SUCCESS && istore->type == R7KRECID_7kFileHeader)
-			{
-			nrec_fileheader++;
-
-			fileheader = &(istore->fileheader);
-			header = &(fileheader->header);
-			time_j[0] = header->s7kTime.Year;
-			time_j[1] = header->s7kTime.Day;
-			time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-			time_j[3] = (int) header->s7kTime.Seconds;
-			time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-			mb_get_itime(verbose, time_j, time_i);
-			mb_get_time(verbose, time_i, &time_d);
-			if (verbose > 0)
-				fprintf(stderr,"R7KRECID_7kFileHeader: 7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d\n",
-				time_i[0],time_i[1],time_i[2],
-				time_i[3],time_i[4],time_i[5],time_i[6],
-				header->RecordNumber);
-			}
-
-	   	/* handle installation data */
-		else if (status == MB_SUCCESS && istore->type == R7KRECID_7kInstallationParameters)
-			{
-			nrec_installation++;
-
-			installation = &(istore->installation);
-			header = &(installation->header);
-			time_j[0] = header->s7kTime.Year;
-			time_j[1] = header->s7kTime.Day;
-			time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-			time_j[3] = (int) header->s7kTime.Seconds;
-			time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-			mb_get_itime(verbose, time_j, time_i);
-			mb_get_time(verbose, time_i, &time_d);
-			if (verbose > 0)
-				fprintf(stderr,"R7KRECID_7kInstallationParameters: 7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d\n",
-				time_i[0],time_i[1],time_i[2],
-				time_i[3],time_i[4],time_i[5],time_i[6],
-				header->RecordNumber);
-			}
-
-	   	/* handle bluefin ctd data */
-		else if (status == MB_SUCCESS && istore->type == R7KRECID_Bluefin && kind == MB_DATA_SSV)
-			{
-			nrec_bluefinenv++;
-
-			bluefin = &(istore->bluefin);
-			header = &(bluefin->header);
-			time_j[0] = header->s7kTime.Year;
-			time_j[1] = header->s7kTime.Day;
-			time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-			time_j[3] = (int) header->s7kTime.Seconds;
-			time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-			mb_get_itime(verbose, time_j, time_i);
-			mb_get_time(verbose, time_i, &time_d);
-			last_bluefinenv_time_d = MAX(last_bluefinenv_time_d, time_d);
-			if (last_bluefinenv_time_d > time_d)
-				{
-				status = MB_FAILURE;
-				error = MB_ERROR_IGNORE;
-				}
-
-			/* get timelag value */
-			timelag = 0.0;
-			if (timedelaymode == MB7KPREPROCESS_TIMEDELAY_ON && ntimedelay > 0)
-			interp_status = mb_linear_interp(verbose,
-						timedelay_time_d-1, timedelay_timedelay-1,
-						ntimedelay, time_d, &timelag, &jtimedelay,
-						&error);
-			if (timelagmode == MB7KPREPROCESS_TIMELAG_CONSTANT)
-				{
-				timelag -= timelagconstant;
-				}
-			else if (timelagmode == MB7KPREPROCESS_TIMELAG_MODEL && ntimelag > 0)
-				{
-				interp_status = mb_linear_interp(verbose,
-							timelag_time_d-1, timelag_model-1,
-							ntimelag, time_d, &timelagm, &jtimelag,
-							&error);
-				timelag -= timelagm;
-				}
-			time_d += timelag;
-			mb_get_date(verbose, time_d,time_i);
-			mb_get_jtime(verbose, time_i, time_j);
-			header->s7kTime.Year = time_i[0];
-			header->s7kTime.Day = time_j[1];
-			header->s7kTime.Hours = time_i[3];
-			header->s7kTime.Minutes = time_i[4];
-			header->s7kTime.Seconds = time_i[5] + 0.000001 * time_i[6];
-
-			if (verbose > 0)
-				fprintf(stderr,"R7KRECID_BluefinEnvironmental:     7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d\n",
-					time_i[0],time_i[1],time_i[2],
-					time_i[3],time_i[4],time_i[5],time_i[6],
-					header->RecordNumber);
-			for (i=0;i<bluefin->number_frames;i++)
-				{
-				time_j[0] = bluefin->environmental[i].s7kTime.Year;
-				time_j[1] = bluefin->environmental[i].s7kTime.Day;
-				time_j[2] = 60 * bluefin->environmental[i].s7kTime.Hours + bluefin->environmental[i].s7kTime.Minutes;
-				time_j[3] = (int) bluefin->environmental[i].s7kTime.Seconds;
-				time_j[4] = (int) (1000000 * (bluefin->environmental[i].s7kTime.Seconds - time_j[3]));
-				mb_get_itime(verbose, time_j, time_i);
-				mb_get_time(verbose, time_i, &time_d);
-				time_d += timelag;
-				bluefin->environmental[i].ctd_time = time_d;
-				bluefin->environmental[i].temperature_time = time_d;
-				mb_get_date(verbose, time_d,time_i);
-				mb_get_jtime(verbose, time_i, time_j);
-				bluefin->environmental[i].s7kTime.Year = time_i[0];
-				bluefin->environmental[i].s7kTime.Day = time_j[1];
-				bluefin->environmental[i].s7kTime.Hours = time_i[3];
-				bluefin->environmental[i].s7kTime.Minutes = time_i[4];
-				bluefin->environmental[i].s7kTime.Seconds = time_i[5] + 0.000001 * time_i[6];
-				if (verbose > 0)
-				fprintf(stderr,"                       %2.2d          7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) CTD_time:%f T_time:%f\n",
-					i,time_i[0],time_i[1],time_i[2],
-					time_i[3],time_i[4],time_i[5],time_i[6],
-					bluefin->environmental[i].ctd_time,
-					bluefin->environmental[i].temperature_time);
-
-				/* get nav */
-				interp_status = MB_SUCCESS;
-				j = 0;
-				if (nins > 0)
-					{
-					interp_status = mb_linear_interp_longitude(verbose,
-								ins_time_d-1, ins_lon-1,
-								nins, time_d, &navlon, &jins,
-								&error);
-					if (interp_status == MB_SUCCESS)
-					interp_status = mb_linear_interp_latitude(verbose,
-								ins_time_d-1, ins_lat-1,
-								nins, time_d, &navlat, &jins,
-								&error);
-					}
-				else if (nrock > 0)
-					{
-					interp_status = mb_linear_interp_longitude(verbose,
-								rock_time_d-1, rock_lon-1,
-								nrock, time_d, &navlon, &jrock,
-								&error);
-					if (interp_status == MB_SUCCESS)
-					interp_status = mb_linear_interp_latitude(verbose,
-								rock_time_d-1, rock_lat-1,
-								nrock, time_d, &navlat, &jrock,
-								&error);
-					}
-				else if (ndsl > 0)
-					{
-					interp_status = mb_linear_interp_longitude(verbose,
-								dsl_time_d-1, dsl_lon-1,
-								ndsl, time_d, &navlon, &jdsl,
-								&error);
-					if (interp_status == MB_SUCCESS)
-					interp_status = mb_linear_interp_latitude(verbose,
-								dsl_time_d-1, dsl_lat-1,
-								ndsl, time_d, &navlat, &jdsl,
-								&error);
-					}
-				else if (ndat_nav > 0)
-					{
-					interp_status = mb_linear_interp_longitude(verbose,
-								dat_nav_time_d-1, dat_nav_lon-1,
-								ndat_nav, time_d, &navlon, &jdnav,
-								&error);
-					if (interp_status == MB_SUCCESS)
-					interp_status = mb_linear_interp_latitude(verbose,
-								dat_nav_time_d-1, dat_nav_lat-1,
-								ndat_nav, time_d, &navlat, &jdnav,
-								&error);
-					}
-				else
-					{
-					navlon = 0.0;
-					navlat = 0.0;
-					}
-
-				/* get sonar depth */
-				if (interp_status != MB_SUCCESS)
-					{
-					}
-				else if (nsonardepth > 0)
-					{
-					if (interp_status == MB_SUCCESS)
-					interp_status = mb_linear_interp(verbose,
-								sonardepth_time_d-1, sonardepth_sonardepth-1,
-								nsonardepth, time_d, &sonardepth, &jsonardepth,
-								&error);
-					}
-				else if (nins > 0)
-					{
-					interp_status = mb_linear_interp(verbose,
-								ins_time_d-1, ins_sonardepth-1,
-								nins, time_d, &sonardepth, &jins,
-								&error);
-					}
-				else if (nrock > 0)
-					{
-					interp_status = mb_linear_interp(verbose,
-								rock_time_d-1, rock_sonardepth-1,
-								nrock, time_d, &sonardepth, &jrock,
-								&error);
-					}
-				else if (ndsl > 0)
-					{
-					interp_status = mb_linear_interp(verbose,
-								dsl_time_d-1, dsl_sonardepth-1,
-								ndsl, time_d, &sonardepth, &jdsl,
-								&error);
-					}
-				else if (ndat_sonardepth > 0)
-					{
-					interp_status = mb_linear_interp(verbose,
-								dat_sonardepth_time_d-1, dat_sonardepth_sonardepth-1,
-								ndat_sonardepth, time_d, &sonardepth, &jdsonardepth,
-								&error);
-					}
-				else if (ndat_rph > 0)
-					{
-					interp_status = mb_linear_interp(verbose,
-								dat_rph_time_d-1, dat_rph_heave-1,
-								ndat_rph, time_d, &heave, &jdattitude,
-								&error);
-					sonardepth = heave;
-					}
-				else
-					{
-					sonardepth = 0.0;
-					}
-
-				/* get altitude */
-				if (interp_status != MB_SUCCESS)
-					{
-					}
-				else if (nins > 0)
-					{
-					interp_status = mb_linear_interp(verbose,
-								ins_altitude_time_d-1, ins_altitude-1,
-								nins_altitude, time_d, &altitude, &jins,
-								&error);
-					}
-				else if (ndat_altitude > 0)
-					{
-					interp_status = mb_linear_interp(verbose,
-								dat_altitude_time_d-1, dat_altitude_altitude-1,
-								ndat_altitude, time_d, &altitude, &jdaltitude,
-								&error);
-					}
-				else
-					{
-					altitude = 0.0;
-					}
-
-				/* output ctd data to file */
-				fprintf(tfp,"%.3f %11.6f %10.6f %.3f %.3f %.2f %.3f\n",
-					time_d, navlon, navlat, sonardepth, altitude,
-					bluefin->environmental[i].temperature,
-					bluefin->environmental[i].conductivity);
-				}
-			}
-
-	   	/* handle bluefin nav data */
-		else if (status == MB_SUCCESS && istore->type == R7KRECID_Bluefin && kind == MB_DATA_NAV2)
-			{
-			nrec_bluefinnav++;
-
-			bluefin = &(istore->bluefin);
-			header = &(bluefin->header);
-			time_j[0] = header->s7kTime.Year;
-			time_j[1] = header->s7kTime.Day;
-			time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-			time_j[3] = (int) header->s7kTime.Seconds;
-			time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-			mb_get_itime(verbose, time_j, time_i);
-			mb_get_time(verbose, time_i, &time_d);
-			last_bluefinnav_time_d = MAX(last_bluefinnav_time_d, time_d);
-			if (last_bluefinnav_time_d > time_d)
-				{
-				status = MB_FAILURE;
-				error = MB_ERROR_IGNORE;
-				}
-
-			/* get timelag value */
-			timelag = 0.0;
-			if (timedelaymode == MB7KPREPROCESS_TIMEDELAY_ON && ntimedelay > 0)
-			interp_status = mb_linear_interp(verbose,
-						timedelay_time_d-1, timedelay_timedelay-1,
-						ntimedelay, time_d, &timelag, &jtimedelay,
-						&error);
-			if (timelagmode == MB7KPREPROCESS_TIMELAG_CONSTANT)
-				{
-				timelag -= timelagconstant;
-				}
-			else if (timelagmode == MB7KPREPROCESS_TIMELAG_MODEL && ntimelag > 0)
-				{
-				interp_status = mb_linear_interp(verbose,
-							timelag_time_d-1, timelag_model-1,
-							ntimelag, time_d, &timelagm, &jtimelag,
-							&error);
-				timelag -= timelagm;
-				}
-			time_d += timelag;
-			mb_get_date(verbose, time_d,time_i);
-			mb_get_jtime(verbose, time_i, time_j);
-			header->s7kTime.Year = time_i[0];
-			header->s7kTime.Day = time_j[1];
-			header->s7kTime.Hours = time_i[3];
-			header->s7kTime.Minutes = time_i[4];
-			header->s7kTime.Seconds = time_i[5] + 0.000001 * time_i[6];
-
-			if (verbose > 0)
-				fprintf(stderr,"R7KRECID_BluefinNav:               7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d\n",
-						time_i[0],time_i[1],time_i[2],
-						time_i[3],time_i[4],time_i[5],time_i[6],
-						header->RecordNumber);
-			for (i=0;i<bluefin->number_frames;i++)
-				{
-				time_j[0] = bluefin->nav[i].s7kTime.Year;
-				time_j[1] = bluefin->nav[i].s7kTime.Day;
-				time_j[2] = 60 * bluefin->nav[i].s7kTime.Hours + bluefin->nav[i].s7kTime.Minutes;
-				time_j[3] = (int) bluefin->nav[i].s7kTime.Seconds;
-				time_j[4] = (int) (1000000 * (bluefin->nav[i].s7kTime.Seconds - time_j[3]));
-				mb_get_itime(verbose, time_j, time_i);
-				mb_get_time(verbose, time_i, &time_d);
-				time_d += timelag;
-				bluefin->nav[i].position_time += timelag;
-				bluefin->nav[i].depth_time += timelag;
-				mb_get_date(verbose, time_d,time_i);
-				mb_get_jtime(verbose, time_i, time_j);
-				bluefin->nav[i].s7kTime.Year = time_i[0];
-				bluefin->nav[i].s7kTime.Day = time_j[1];
-				bluefin->nav[i].s7kTime.Hours = time_i[3];
-				bluefin->nav[i].s7kTime.Minutes = time_i[4];
-				bluefin->nav[i].s7kTime.Seconds = time_i[5] + 0.000001 * time_i[6];
-				if (verbose > 0)
-				fprintf(stderr,"                       %2.2d          7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) Pos_time:%f\n",
-					i,time_i[0],time_i[1],time_i[2],
-					time_i[3],time_i[4],time_i[5],time_i[6],
-					bluefin->nav[i].position_time);
-
-				/* output asynchronous heading, sonardepth, and attitude */
-				fprintf(athfp, "%0.6f\t%7.3f\n", time_d, RTD * bluefin->nav[i].yaw);
-				sonardepth = bluefin->nav[i].depth
-						+ depthsensoroffx * sin(bluefin->nav[i].roll)
-						+ depthsensoroffy * sin(bluefin->nav[i].pitch)
-						+ depthsensoroffz * cos(bluefin->nav[i].pitch)
-						+ sonardepthoffset;
-				fprintf(atsfp, "%0.6f\t%0.3f\n", time_d, sonardepth);
-				fprintf(atafp, "%0.6f\t%0.3f\t%0.3f\n",
-						time_d, RTD * bluefin->nav[i].roll, RTD * bluefin->nav[i].pitch);
-				}
-			}
-
-	   	/* handle subbottom data */
-		else if (status == MB_SUCCESS && kind == MB_DATA_SUBBOTTOM_SUBBOTTOM)
-			{
-			nrec_fsdwsbp++;
-
-			fsdwsb = &(istore->fsdwsb);
-			header = &(fsdwsb->header);
-			time7k_j[0] = header->s7kTime.Year;
-			time7k_j[1] = header->s7kTime.Day;
-			time7k_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-			time7k_j[3] = (int) header->s7kTime.Seconds;
-			time7k_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time7k_j[3]));
-			mb_get_itime(verbose, time7k_j, time7k_i);
-			mb_get_time(verbose, time7k_i, &time7k_d);
-			last_fsdwsbp_time_d = MAX(last_fsdwsbp_time_d, time7k_d);
-			if (last_fsdwsbp_time_d > time7k_d)
-				{
-				status = MB_FAILURE;
-				error = MB_ERROR_IGNORE;
-				}
-			fsdwchannel = &(fsdwsb->channel);
-			fsdwsegyheader = &(fsdwsb->segyheader);
-			if (verbose > 0)
-				fprintf(stderr,"R7KRECID_FSDWsubbottom:            7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) FSDWtime(%4.4d-%3.3d %2.2d:%2.2d:%2.2d.%3.3d) ping:%d sampint:%d samples:%d\n",
-				time7k_i[0],time7k_i[1],time7k_i[2],
-				time7k_i[3],time7k_i[4],time7k_i[5],time7k_i[6],
-				fsdwsegyheader->year,fsdwsegyheader->day,fsdwsegyheader->hour,fsdwsegyheader->minute,fsdwsegyheader->second,
-				fsdwsegyheader->millisecondsToday - 1000 * (int)(0.001 * fsdwsegyheader->millisecondsToday),
-				fsdwsb->ping_number,fsdwchannel->sample_interval,fsdwchannel->number_samples);
-
-			/* fix time stamp */
-			if (fix_time_stamps == MB7KPREPROCESS_TIMEFIX_EDGETECH)
-				{
-				found = MB_NO;
-				for (j=0; j < nedget && found == MB_NO; j++)
-					{
-					if (istore->time_d >= edget_time_d[j])
-						{
-						found = MB_YES;
-						time_d = istore->time_d + edget_time_offset[j];
-						mb_get_date(verbose, time_d, time_i);
-						mb_get_jtime(verbose, time_i, time_j);
-						fsdwsegyheader->year = time_i[0];
-						fsdwsegyheader->day = time_j[1];
-						fsdwsegyheader->hour = time_i[3];
-						fsdwsegyheader->minute = time_i[4];
-						fsdwsegyheader->second = time_i[5];
-						fsdwsegyheader->millisecondsToday = 0.001 * time_i[6]
-										+ 1000 * (time_i[5]
-										+ 60.0 * (time_i[4]
-										+ 60.0 * time_i[3]));
-						if (verbose > 0)
-							fprintf(stderr,"R7KRECID_FSDWsubbottom FIXED:      7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) FSDWtime(%4.4d-%3.3d %2.2d:%2.2d:%2.2d.%3.3d) ping:%d sampint:%d samples:%d\n",
-							time7k_i[0],time7k_i[1],time7k_i[2],
-							time7k_i[3],time7k_i[4],time7k_i[5],time7k_i[6],
-							fsdwsegyheader->year,fsdwsegyheader->day,fsdwsegyheader->hour,fsdwsegyheader->minute,fsdwsegyheader->second,
-							fsdwsegyheader->millisecondsToday - 1000 * (int)(0.001 * fsdwsegyheader->millisecondsToday),
-							fsdwsb->ping_number,fsdwchannel->sample_interval,fsdwchannel->number_samples);
-						}
-					}
-				}
-			}
-
-	   	/* handle low frequency sidescan data */
-		else if (status == MB_SUCCESS && kind == MB_DATA_SIDESCAN2)
-			{
-			nrec_fsdwsslo++;
-			fsdwsslo = &(istore->fsdwsslo);
-			header = &(fsdwsslo->header);
-			time7k_j[0] = header->s7kTime.Year;
-			time7k_j[1] = header->s7kTime.Day;
-			time7k_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-			time7k_j[3] = (int) header->s7kTime.Seconds;
-			time7k_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time7k_j[3]));
-			mb_get_itime(verbose, time7k_j, time7k_i);
-			mb_get_time(verbose, time7k_i, &time7k_d);
-			last_fsdwsslo_time_d = MAX(last_fsdwsslo_time_d, time7k_d);
-			if (last_fsdwsslo_time_d > time7k_d)
-				{
-				status = MB_FAILURE;
-				error = MB_ERROR_IGNORE;
-				}
-			for (i=0;i<fsdwsslo->number_channels;i++)
-				{
-				fsdwchannel = &(fsdwsslo->channel[i]);
-				fsdwssheader = &(fsdwsslo->ssheader[i]);
-				if (verbose > 0)
-					fprintf(stderr,"R7KRECID_FSDWsidescanLo:           7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) FSDWtime(%4.4d-%3.3d %2.2d:%2.2d:%2.2d.%3.3d) ping:%d channel:%d sampint:%d samples:%d\n",
-					time7k_i[0],time7k_i[1],time7k_i[2],
-					time7k_i[3],time7k_i[4],time7k_i[5],time7k_i[6],
-					fsdwssheader->year,fsdwssheader->day,fsdwssheader->hour,fsdwssheader->minute,fsdwssheader->second,
-					fsdwssheader->millisecondsToday - 1000 * (int)(0.001 * fsdwssheader->millisecondsToday),
-					fsdwsslo->ping_number,fsdwchannel->number,
-					fsdwchannel->sample_interval,fsdwchannel->number_samples);
-				}
-
-			/* fix time stamp */
-			if (fix_time_stamps == MB7KPREPROCESS_TIMEFIX_EDGETECH)
-				{
-				found = MB_NO;
-				for (j=0; j < nedget && found == MB_NO; j++)
-					{
-					if (istore->time_d >= edget_time_d[j])
-						{
-						found = MB_YES;
-						time_d = istore->time_d + edget_time_offset[j];
-						mb_get_date(verbose, time_d, time_i);
-						mb_get_jtime(verbose, time_i, time_j);
-						for (i=0;i<fsdwsslo->number_channels;i++)
-							{
-							fsdwchannel = &(fsdwsslo->channel[i]);
-							fsdwssheader = &(fsdwsslo->ssheader[i]);
-							fsdwssheader->year = time_i[0];
-							fsdwssheader->day = time_j[1];
-							fsdwssheader->hour = time_i[3];
-							fsdwssheader->minute = time_i[4];
-							fsdwssheader->second = time_i[5];
-							fsdwssheader->millisecondsToday = 0.001 * time_i[6]
-										+ 1000 * (time_i[5]
-										+ 60.0 * (time_i[4]
-										+ 60.0 * time_i[3]));
-							if (verbose > 0)
-								fprintf(stderr,"R7KRECID_FSDWsidescanLo FIXED:     7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) FSDWtime(%4.4d-%3.3d %2.2d:%2.2d:%2.2d.%3.3d) ping:%d channel:%d sampint:%d samples:%d\n",
-								time7k_i[0],time7k_i[1],time7k_i[2],
-								time7k_i[3],time7k_i[4],time7k_i[5],time7k_i[6],
-								fsdwssheader->year,fsdwssheader->day,fsdwssheader->hour,fsdwssheader->minute,fsdwssheader->second,
-								fsdwssheader->millisecondsToday - 1000 * (int)(0.001 * fsdwssheader->millisecondsToday),
-								fsdwsslo->ping_number,fsdwchannel->number,
-								fsdwchannel->sample_interval,fsdwchannel->number_samples);
-							}
-						}
-					}
-				}
-			}
-
-	   	/* handle high frequency sidescan data */
-		else if (status == MB_SUCCESS && kind == MB_DATA_SIDESCAN3)
-			{
-			nrec_fsdwsshi++;
-
-			fsdwsshi = &(istore->fsdwsshi);
-			header = &(fsdwsshi->header);
-			time7k_j[0] = header->s7kTime.Year;
-			time7k_j[1] = header->s7kTime.Day;
-			time7k_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-			time7k_j[3] = (int) header->s7kTime.Seconds;
-			time7k_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time7k_j[3]));
-			mb_get_itime(verbose, time7k_j, time7k_i);
-			mb_get_time(verbose, time7k_i, &time7k_d);
-			last_fsdwsshi_time_d = MAX(last_fsdwsshi_time_d, time7k_d);
-			if (last_fsdwsshi_time_d > time7k_d)
-				{
-				status = MB_FAILURE;
-				error = MB_ERROR_IGNORE;
-				}
-			for (i=0;i<fsdwsshi->number_channels;i++)
-				{
-				fsdwchannel = &(fsdwsshi->channel[i]);
-				fsdwssheader = &(fsdwsshi->ssheader[i]);
-				if (verbose > 0)
-					fprintf(stderr,"R7KRECID_FSDWsidescanHi:           7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) FSDWtime(%4.4d-%3.3d %2.2d:%2.2d:%2.2d.%3.3d) ping:%d channel:%d sampint:%d samples:%d\n",
-					time7k_i[0],time7k_i[1],time7k_i[2],
-					time7k_i[3],time7k_i[4],time7k_i[5],time7k_i[6],
-					fsdwssheader->year,fsdwssheader->day,fsdwssheader->hour,fsdwssheader->minute,fsdwssheader->second,
-					fsdwssheader->millisecondsToday - 1000 * (int)(0.001 * fsdwssheader->millisecondsToday),
-					fsdwsshi->ping_number,fsdwchannel->number,
-					fsdwchannel->sample_interval,fsdwchannel->number_samples);
-				}
-
-			/* fix time stamp */
-			if (fix_time_stamps == MB7KPREPROCESS_TIMEFIX_EDGETECH)
-				{
-				found = MB_NO;
-				for (j=0; j < nedget && found == MB_NO; j++)
-					{
-					if (istore->time_d >= edget_time_d[j])
-						{
-						found = MB_YES;
-						time_d = istore->time_d + edget_time_offset[j];
-						mb_get_date(verbose, time_d, time_i);
-						mb_get_jtime(verbose, time_i, time_j);
-						for (i=0;i<fsdwsslo->number_channels;i++)
-							{
-							fsdwchannel = &(fsdwsshi->channel[i]);
-							fsdwssheader = &(fsdwsshi->ssheader[i]);
-							fsdwssheader->year = time_i[0];
-							fsdwssheader->day = time_j[1];
-							fsdwssheader->hour = time_i[3];
-							fsdwssheader->minute = time_i[4];
-							fsdwssheader->second = time_i[5];
-							fsdwssheader->millisecondsToday = 0.001 * time_i[6]
-										+ 1000 * (time_i[5]
-										+ 60.0 * (time_i[4]
-										+ 60.0 * time_i[3]));
-							if (verbose > 0)
-								fprintf(stderr,"R7KRECID_FSDWsidescanHi FIXED:     7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) FSDWtime(%4.4d-%3.3d %2.2d:%2.2d:%2.2d.%3.3d) ping:%d channel:%d sampint:%d samples:%d\n",
-								time7k_i[0],time7k_i[1],time7k_i[2],
-								time7k_i[3],time7k_i[4],time7k_i[5],time7k_i[6],
-								fsdwssheader->year,fsdwssheader->day,fsdwssheader->hour,fsdwssheader->minute,fsdwssheader->second,
-								fsdwssheader->millisecondsToday - 1000 * (int)(0.001 * fsdwssheader->millisecondsToday),
-								fsdwsshi->ping_number,fsdwchannel->number,
-								fsdwchannel->sample_interval,fsdwchannel->number_samples);
-							}
-						}
-					}
-				}
-			}
-
-	   	/* handle unknown data */
-		else  if (status == MB_SUCCESS)
-			{
-/*fprintf(stderr,"DATA TYPE UNKNOWN: status:%d error:%d kind:%d\n",status,error,kind);*/
-			nrec_other++;
-			}
-
-	   	/* handle read error */
-		else
-			{
-/*fprintf(stderr,"READ FAILURE: status:%d error:%d kind:%d\n",status,error,kind);*/
-			}
-
-		/* print debug statements */
-		if (verbose >= 2)
-			{
-			fprintf(stderr,"\ndbg2  Ping read in program <%s>\n",
-				program_name);
-			fprintf(stderr,"dbg2       kind:           %d\n",kind);
-			fprintf(stderr,"dbg2       error:          %d\n",error);
-			fprintf(stderr,"dbg2       status:         %d\n",status);
-			}
-
-	/*--------------------------------------------
-	  write the processed data
-	  --------------------------------------------*/
-
-	  	/* if using AUV ins data log for navigation and attitude, then
-			output these data in new bluefin racords while not outputting
-			any old bluefin records. */
-		if (nins > 0 && error == MB_ERROR_NO_ERROR && kind == MB_DATA_DATA)
-			{
-			/* if first output find starting point in ins, attitude, and speed data */
-			if (ins_output_index < 0)
-				{
-				for (i = 0; i < nins && ins_time_d[i] < time_d - 1; i++)
-					{
-					/*fprintf(stderr,"i:%d time: %f ins:%f\n",i,time_d,ins_time_d[i]);*/
-					}
-				ins_output_index = MAX(0,i-1);
-				}
-
-			/* output bluefin record with 25 samples if survey record has a time later than that
-				of the last sample output */
-			if (time_d > ins_time_d[ins_output_index])
-				{
-				bluefin = &(istore->bluefin);
-				header = &(bluefin->header);
-				type_save = istore->type;
-				kind_save = istore->kind;
-				istore->kind = MB_DATA_NAV2;
-				istore->type = R7KRECID_Bluefin;
-				bluefin->number_frames = MIN(25, nins - ins_output_index + 1);
-
-				header->Version = 4;
-				header->Offset = 60;
-				header->SyncPattern = 65535;
-				header->Size = 100 + 128 * bluefin->number_frames;
-				header->OffsetToOptionalData = 0;
-				header->OptionalDataIdentifier = 0;
-				mb_get_jtime(verbose, istore->time_i, time_j);
-				header->s7kTime.Year = istore->time_i[0];
-				header->s7kTime.Day = time_j[1];
-				header->s7kTime.Hours = istore->time_i[3];
-				header->s7kTime.Minutes = istore->time_i[4];
-				header->s7kTime.Seconds = istore->time_i[5] + 0.000001 * istore->time_i[6];
-				header->Reserved = 0;
-				header->RecordType = R7KRECID_Bluefin;
-				header->DeviceId = R7KDEVID_Bluefin;
-				header->Reserved2 = 0;
-				header->SystemEnumerator = 0;
-				header->DataSetNumber = 0;
-				header->RecordNumber = 0;
-				for (i=0;i<8;i++)
-					{
-					header->PreviousRecord[i] = 0;
-					header->NextRecord[i] = 0;
-					}
-				header->Flags = 0;
-				header->Reserved3 = 0;
-				header->Reserved4 = 0;
-				header->FragmentedTotal = 0;
-				header->FragmentNumber = 0;
-
-				bluefin->msec_timestamp = 0;
-				/* bluefin->number_frames = MIN(25, nins - ins_output_index + 1); */
-				bluefin->frame_size = 128;
-				bluefin->data_format = R7KRECID_BluefinNav;
-				for (i=0;i<16;i++)
-					bluefin->reserved[i] = 0;
-				if (verbose > 0)
-					fprintf(stderr,"R7KRECID_BluefinNav:               7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d\n",
-						time_i[0],time_i[1],time_i[2],
-						time_i[3],time_i[4],time_i[5],time_i[6],
-						header->RecordNumber);
-
-				for (i=0;i<bluefin->number_frames;i++)
-					{
-					bluefin->nav[i].packet_size = 128;
-					bluefin->nav[i].version = 2;
-					bluefin->nav[i].offset = 32;
-					bluefin->nav[i].data_type = 1;
-					bluefin->nav[i].data_size = 96;
-					mb_get_date(verbose, ins_time_d[ins_output_index], time_i);
-					mb_get_jtime(verbose, time_i, time_j);
-					bluefin->nav[i].s7kTime.Year = istore->time_i[0];
-					bluefin->nav[i].s7kTime.Day = time_j[1];
-					bluefin->nav[i].s7kTime.Hours = istore->time_i[3];
-					bluefin->nav[i].s7kTime.Minutes = istore->time_i[4];
-					bluefin->nav[i].s7kTime.Seconds = istore->time_i[5] + 0.000001 * istore->time_i[6];
-					if (verbose > 0)
-					fprintf(stderr,"                       %2.2d          7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) Pos_time:%f\n",
-						i,time_i[0],time_i[1],time_i[2],
-						time_i[3],time_i[4],time_i[5],time_i[6],
-						bluefin->nav[i].position_time);
-					bluefin->nav[i].checksum = 0;
-					bluefin->nav[i].timedelay = 0;
-					bluefin->nav[i].quality = 0;
-					bluefin->nav[i].latitude = DTR * ins_lat[ins_output_index];
-					bluefin->nav[i].longitude = DTR * ins_lon[ins_output_index];
-					speed = bluefin->nav[i].speed;
-					mb_linear_interp(verbose,
-								ins_speed_time_d-1, ins_speed-1,
-								nins_speed, ins_time_d[ins_output_index],
-								&speed, &jins,
-								&error);
-					bluefin->nav[i].depth = ins_sonardepth[ins_output_index];
-					mb_linear_interp(verbose,
-								ins_altitude_time_d-1, ins_altitude-1,
-								nins_altitude, ins_time_d[ins_output_index],
-								&(bluefin->nav[i].altitude), &jins,
-								&error);
-					bluefin->nav[i].roll = DTR * ins_roll[ins_output_index];
-					bluefin->nav[i].pitch = DTR * ins_pitch[ins_output_index];
-					bluefin->nav[i].yaw = DTR * ins_heading[ins_output_index];
-					bluefin->nav[i].northing_rate = 0;
-					bluefin->nav[i].easting_rate = 0;
-					bluefin->nav[i].depth_rate = 0;
-					bluefin->nav[i].altitude_rate = 0;
-					bluefin->nav[i].roll_rate = 0;
-					bluefin->nav[i].pitch_rate = 0;
-					bluefin->nav[i].yaw_rate = 0;
-					bluefin->nav[i].position_time = ins_time_d[ins_output_index];
-					bluefin->nav[i].depth_time = ins_time_d[ins_output_index];
-					ins_output_index++;
-					}
-
-				/* write the new bluefin record */
-				status = mb_put_all(verbose,ombio_ptr,
-						istore_ptr,MB_NO,MB_DATA_NAV2,
-						time_i,time_d,
-						navlon,navlat,speed,heading,
-						obeams_bath,obeams_amp,opixels_ss,
-						beamflag,bath,amp,bathacrosstrack,bathalongtrack,
-						ss,ssacrosstrack,ssalongtrack,
-						comment,&error);
-				if (status != MB_SUCCESS)
-					{
-					mb_error(verbose,error,&message);
-					fprintf(stderr,"\nMBIO Error returned from function <mb_put>:\n%s\n",message);
-					fprintf(stderr,"\nMultibeam Data Not Written To File <%s>\n",ofile);
-					fprintf(stderr,"\nProgram <%s> Terminated\n",
-						program_name);
-					exit(error);
-					}
-
-				/* restore kind and time_i */
-				istore->type = type_save;
-				istore->kind = kind_save;
-				mb_get_date(verbose, time_d, time_i);
-				}
-			}
-
-		/* do not output full beam data */
-		if (error == MB_ERROR_NO_ERROR && kind == MB_DATA_DATA
-			&& istore->read_beam == MB_YES)
-			istore->read_beam = MB_NO;
-
-		/* write some data */
-		if (error == MB_ERROR_NO_ERROR && (nins < 1 || kind != MB_DATA_NAV2))
-			{
-			status = mb_put_all(verbose,ombio_ptr,
-					istore_ptr,MB_NO,kind,
-					time_i,time_d,
-					navlon,navlat,speed,heading,
-					obeams_bath,obeams_amp,opixels_ss,
-					beamflag,bath,amp,bathacrosstrack,bathalongtrack,
-					ss,ssacrosstrack,ssalongtrack,
-					comment,&error);
-			if (status != MB_SUCCESS)
-				{
-				mb_error(verbose,error,&message);
-				fprintf(stderr,"\nMBIO Error returned from function <mb_put>:\n%s\n",message);
-				fprintf(stderr,"\nMultibeam Data Not Written To File <%s>\n",ofile);
-				fprintf(stderr,"\nProgram <%s> Terminated\n",
-					program_name);
-				exit(error);
-				}
-			}
-		}
-
-	/* output counts */
-	fprintf(stdout, "\nData records written to: %s\n", ofile);
-	fprintf(stdout, "     File Header:                       %d\n", nrec_fileheader);
-	fprintf(stdout, "     Multibeam:                         %d\n", nrec_multibeam);
-	fprintf(stdout, "          Volatile Settings:                 %d\n", nrec_volatilesettings);
-	fprintf(stdout, "          Match Filter:                      %d\n", nrec_matchfilter);
-	fprintf(stdout, "          Beam Geometry:                     %d\n", nrec_beamgeometry);
-	fprintf(stdout, "          Remote Control:                    %d\n", nrec_remotecontrolsettings);
-	fprintf(stdout, "          Bathymetry:                        %d\n", nrec_bathymetry);
-	fprintf(stdout, "          Backscatter:                       %d\n", nrec_backscatter);
-	fprintf(stdout, "          Beam:                              %d\n", nrec_beam);
-	fprintf(stdout, "          Image:                             %d\n", nrec_image);
-	fprintf(stdout, "          V2PingMotion:                      %d\n", nrec_v2pingmotion);
-	fprintf(stdout, "          V2DetectionSetup:                  %d\n", nrec_v2detectionsetup);
-	fprintf(stdout, "          V2Beamformed:                      %d\n", nrec_v2beamformed);
-	fprintf(stdout, "          V2Detection:                       %d\n", nrec_v2detection);
-	fprintf(stdout, "          V2RawDetection:                    %d\n", nrec_v2rawdetection);
-	fprintf(stdout, "          V2Snippet:                         %d\n", nrec_v2snippet);
-	fprintf(stdout, "          Calibrated Snippet:                %d\n", nrec_calibratedsnippet);
-	fprintf(stdout, "          Processedsidescan:                 %d\n", nrec_processedsidescan);
-	fprintf(stdout, "     Reference:                         %d\n", nrec_reference);
-	fprintf(stdout, "     Uncalibrated Sensor Offset:        %d\n", nrec_sensoruncal);
-	fprintf(stdout, "     Calibrated Sensor Offset:          %d\n", nrec_sensorcal);
-	fprintf(stdout, "     Position:                          %d\n", nrec_position);
-	fprintf(stdout, "     Custom Attitude:                   %d\n", nrec_customattitude);
-	fprintf(stdout, "     Tide:                              %d\n", nrec_tide);
-	fprintf(stdout, "     Altitude:                          %d\n", nrec_altitude);
-	fprintf(stdout, "     Motion Over Ground:                %d\n", nrec_motion);
-	fprintf(stdout, "     Depth:                             %d\n", nrec_depth);
-	fprintf(stdout, "     Sound Speed Profile:               %d\n", nrec_svp);
-	fprintf(stdout, "     CTD:                               %d\n", nrec_ctd);
-	fprintf(stdout, "     Geodosy:                           %d\n", nrec_geodesy);
-	fprintf(stdout, "     Roll Pitch Heave:                  %d\n", nrec_rollpitchheave);
-	fprintf(stdout, "     Heading:                           %d\n", nrec_heading);
-	fprintf(stdout, "     Survey Line:                       %d\n", nrec_surveyline);
-	fprintf(stdout, "     Navigation:                        %d\n", nrec_navigation);
-	fprintf(stdout, "     Attitude:                          %d\n", nrec_attitude);
-	fprintf(stdout, "     Edgetech Low Frequency Sidescan:   %d\n", nrec_fsdwsslo);
-	fprintf(stdout, "     Edgetech High Frequency Sidescan:  %d\n", nrec_fsdwsshi);
-	fprintf(stdout, "     Edgetech Subbottom:                %d\n", nrec_fsdwsbp);
-	fprintf(stdout, "     MBARI Mapping AUV Environmental:   %d\n", nrec_bluefinnav);
-	fprintf(stdout, "     MBARI Mapping AUV Navigation:      %d\n", nrec_bluefinenv);
-	fprintf(stdout, "     Configuration:                     %d\n", nrec_configuration);
-	fprintf(stdout, "     Calibration:                       %d\n", nrec_calibration);
-	fprintf(stdout, "     Vertical Depth:                    %d\n", nrec_verticaldepth);
-	fprintf(stdout, "     Installation:                      %d\n", nrec_installation);
-	fprintf(stdout, "     System Event Message:              %d\n", nrec_systemeventmessage);
-	fprintf(stdout, "     Other:                             %d\n", nrec_other);
-	nrec_fileheader_tot += nrec_fileheader;
-	nrec_multibeam_tot += nrec_multibeam;
-	nrec_volatilesettings_tot += nrec_volatilesettings;
-	nrec_matchfilter_tot += nrec_matchfilter;
-	nrec_beamgeometry_tot += nrec_beamgeometry;
-	nrec_remotecontrolsettings_tot += nrec_remotecontrolsettings;
-	nrec_bathymetry_tot += nrec_bathymetry;
-	nrec_backscatter_tot += nrec_backscatter;
-	nrec_beam_tot += nrec_beam;
-	nrec_image_tot += nrec_image;
-	nrec_v2pingmotion_tot += nrec_v2pingmotion;
-	nrec_v2detectionsetup_tot += nrec_v2detectionsetup;
-	nrec_v2beamformed_tot += nrec_v2beamformed;
-	nrec_v2detection_tot += nrec_v2detection;
-	nrec_v2rawdetection_tot += nrec_v2rawdetection;
-	nrec_v2snippet_tot += nrec_v2snippet;
-	nrec_calibratedsnippet_tot += nrec_calibratedsnippet;
-	nrec_processedsidescan_tot += nrec_processedsidescan;
-	nrec_reference_tot += nrec_reference;
-	nrec_sensoruncal_tot += nrec_sensoruncal;
-	nrec_sensorcal_tot += nrec_sensorcal;
-	nrec_position_tot += nrec_position;
-	nrec_customattitude_tot += nrec_customattitude;
-	nrec_tide_tot += nrec_tide;
-	nrec_altitude_tot += nrec_altitude;
-	nrec_motion_tot += nrec_motion;
-	nrec_depth_tot += nrec_depth;
-	nrec_svp_tot += nrec_svp;
-	nrec_ctd_tot += nrec_ctd;
-	nrec_geodesy_tot += nrec_geodesy;
-	nrec_rollpitchheave_tot += nrec_rollpitchheave;
-	nrec_heading_tot += nrec_heading;
-	nrec_surveyline_tot += nrec_surveyline;
-	nrec_navigation_tot += nrec_navigation;
-	nrec_attitude_tot += nrec_attitude;
-	nrec_fsdwsbp_tot += nrec_fsdwsbp;
-	nrec_fsdwsslo_tot += nrec_fsdwsslo;
-	nrec_fsdwsshi_tot += nrec_fsdwsshi;
-	nrec_bluefinenv_tot += nrec_bluefinenv;
-	nrec_position_tot += nrec_position;
-	nrec_bluefinnav_tot += nrec_bluefinnav;
-	nrec_configuration_tot += nrec_configuration;
-	nrec_calibration_tot += nrec_calibration;
-	nrec_verticaldepth_tot += nrec_verticaldepth;
-	nrec_installation_tot += nrec_installation;
-	nrec_systemeventmessage_tot += nrec_systemeventmessage;
-	nrec_other_tot += nrec_other;
-
-	/* figure out whether and what to read next */
-        if (read_datalist == MB_YES)
-                {
-		if ((status = mb_datalist_read(verbose,datalist,
-			    ifile,&format,&file_weight,&error))
-			    == MB_SUCCESS)
-                        read_data = MB_YES;
-                else
-                        read_data = MB_NO;
-                }
-        else
-                {
-                read_data = MB_NO;
-                }
-
-	/* close the input swath file */
-	status = mb_close(verbose,&imbio_ptr,&error);
-
-	/* close the output swath file if necessary */
-	if (ofile_set == MB_NO || read_data == MB_NO)
-		{
-		status = mb_close(verbose,&ombio_ptr,&error);
-		fclose(tfp);
-		fclose(athfp);
-		fclose(atsfp);
-		fclose(atafp);
-		fclose(stafp);
-
-		/* generate inf fnv and fbt files */
-		if (status == MB_SUCCESS)
-			{
-			status = mb_make_info(verbose, MB_YES, ofile, format, &error);
-			}
-		}
-
-	/* end loop over files in list */
-	}
-	if (read_datalist == MB_YES)
-		mb_datalist_close(verbose,&datalist,&error);
-
-	/* output counts */
-	fprintf(stdout, "\nTotal files read:  %d\n", nfile_read);
-	fprintf(stdout, "Total files written: %d\n", nfile_write);
-	fprintf(stdout, "\nTotal data records written from: %s\n", read_file);
-	fprintf(stdout, "     File Header:                       %d\n", nrec_fileheader_tot);
-	fprintf(stdout, "     Multibeam:                         %d\n", nrec_multibeam_tot);
-	fprintf(stdout, "          Volatile Settings:                 %d\n", nrec_volatilesettings_tot);
-	fprintf(stdout, "          Match Filter:                      %d\n", nrec_matchfilter_tot);
-	fprintf(stdout, "          Beam Geometry:                     %d\n", nrec_beamgeometry_tot);
-	fprintf(stdout, "          Remote Control:                    %d\n", nrec_remotecontrolsettings_tot);
-	fprintf(stdout, "          Bathymetry:                        %d\n", nrec_bathymetry_tot);
-	fprintf(stdout, "          Backscatter:                       %d\n", nrec_backscatter_tot);
-	fprintf(stdout, "          Beam:                              %d\n", nrec_beam_tot);
-	fprintf(stdout, "          Image:                             %d\n", nrec_image_tot);
-	fprintf(stdout, "          V2PingMotion:                      %d\n", nrec_v2pingmotion_tot);
-	fprintf(stdout, "          V2DetectionSetup:                  %d\n", nrec_v2detectionsetup_tot);
-	fprintf(stdout, "          V2Beamformed:                      %d\n", nrec_v2beamformed_tot);
-	fprintf(stdout, "          V2Detection:                       %d\n", nrec_v2detection_tot);
-	fprintf(stdout, "          V2RawDetection:                    %d\n", nrec_v2rawdetection_tot);
-	fprintf(stdout, "          V2Snippet:                         %d\n", nrec_v2snippet_tot);
-	fprintf(stdout, "          Calibrated Snippet:                %d\n", nrec_calibratedsnippet_tot);
-	fprintf(stdout, "          Processedsidescan:                 %d\n", nrec_processedsidescan_tot);
-	fprintf(stdout, "     Reference:                         %d\n", nrec_reference_tot);
-	fprintf(stdout, "     Uncalibrated Sensor Offset:        %d\n", nrec_sensoruncal_tot);
-	fprintf(stdout, "     Calibrated Sensor Offset:          %d\n", nrec_sensorcal_tot);
-	fprintf(stdout, "     Position:                          %d\n", nrec_position_tot);
-	fprintf(stdout, "     Custom Attitude:                   %d\n", nrec_customattitude_tot);
-	fprintf(stdout, "     Tide:                              %d\n", nrec_tide_tot);
-	fprintf(stdout, "     Altitude:                          %d\n", nrec_altitude_tot);
-	fprintf(stdout, "     Motion Over Ground:                %d\n", nrec_motion_tot);
-	fprintf(stdout, "     Depth:                             %d\n", nrec_depth_tot);
-	fprintf(stdout, "     Sound Speed Profile:               %d\n", nrec_svp_tot);
-	fprintf(stdout, "     CTD:                               %d\n", nrec_ctd_tot);
-	fprintf(stdout, "     Geodosy:                           %d\n", nrec_geodesy_tot);
-	fprintf(stdout, "     Roll Pitch Heave:                  %d\n", nrec_rollpitchheave_tot);
-	fprintf(stdout, "     Heading:                           %d\n", nrec_heading_tot);
-	fprintf(stdout, "     Survey Line:                       %d\n", nrec_surveyline_tot);
-	fprintf(stdout, "     Navigation:                        %d\n", nrec_navigation_tot);
-	fprintf(stdout, "     Attitude:                          %d\n", nrec_attitude_tot);
-	fprintf(stdout, "     Edgetech Low Frequency Sidescan:   %d\n", nrec_fsdwsslo_tot);
-	fprintf(stdout, "     Edgetech High Frequency Sidescan:  %d\n", nrec_fsdwsshi_tot);
-	fprintf(stdout, "     Edgetech Subbottom:                %d\n", nrec_fsdwsbp_tot);
-	fprintf(stdout, "     MBARI Mapping AUV Environmental:   %d\n", nrec_bluefinnav_tot);
-	fprintf(stdout, "     MBARI Mapping AUV Navigation:      %d\n", nrec_bluefinenv_tot);
-	fprintf(stdout, "     Configuration:                     %d\n", nrec_configuration_tot);
-	fprintf(stdout, "     Calibration:                       %d\n", nrec_calibration_tot);
-	fprintf(stdout, "     Vertical Depth:                    %d\n", nrec_verticaldepth_tot);
-	fprintf(stdout, "     Installation:                      %d\n", nrec_installation_tot);
-	fprintf(stdout, "     System Event Message:              %d\n", nrec_systemeventmessage_tot);
-	fprintf(stdout, "     Other:                             %d\n", nrec_other_tot);
-	}
-
-	/* deallocate navigation arrays */
-	if (ndat_nav > 0)
-		{
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&dat_nav_time_d,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&dat_nav_time_d,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&dat_nav_lon,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&dat_nav_lat,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&dat_nav_speed,&error);
-		}
-	if (ndat_sonardepth > 0)
-		{
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&dat_sonardepth_sonardepth,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&dat_sonardepth_sonardepthfilter,&error);
-		}
-	if (ndat_heading > 0)
-		{
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&dat_heading_heading,&error);
-		}
-	if (ndat_rph > 0)
-		{
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&dat_rph_roll,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&dat_rph_pitch,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&dat_rph_heave,&error);
-		}
-	if (ndat_altitude > 0)
-		{
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&dat_altitude_time_d,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&dat_altitude_altitude,&error);
-		}
-	if (ntimedelay > 0)
-		{
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&timedelay_time_d,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&timedelay_timedelay,&error);
-		}
-	if (nbatht > 0)
-		{
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&batht_time_d,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&batht_ping,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&batht_time_d_new,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&batht_time_offset,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&batht_ping_offset,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&batht_good_offset,&error);
-		}
-	if (nedget > 0)
-		{
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&edget_time_d,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&edget_ping,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&edget_time_d_new,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&edget_time_offset,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&edget_ping_offset,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&edget_good_offset,&error);
-		}
-	if (nins > 0)
-		{
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&ins_time_d,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&ins_lon,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&ins_lat,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&ins_heading,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&ins_roll,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&ins_pitch,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&ins_sonardepth,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&ins_sonardepthfilter,&error);
-		}
-	if (nrock > 0)
-		{
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&rock_time_d,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&rock_lon,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&rock_lat,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&rock_sonardepth,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&rock_sonardepthfilter,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&rock_heading,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&rock_roll,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&rock_pitch,&error);
-		}
-	if (ndsl > 0)
-		{
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&dsl_time_d,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&dsl_lon,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&dsl_lat,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&dsl_sonardepth,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&dsl_sonardepthfilter,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&dsl_heading,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&dsl_roll,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&dsl_pitch,&error);
-		}
-	if (nins_altitude > 0)
-		{
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&ins_altitude_time_d,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&ins_altitude,&error);
-		}
-	if (nins_speed > 0)
-		{
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&ins_speed_time_d,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&ins_speed,&error);
-		}
-	if (nsonardepth > 0)
-		{
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&sonardepth_time_d,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&sonardepth_sonardepth,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&sonardepth_sonardepthfilter,&error);
-		}
-		
-	/* deallocate platform structure */
-	if (platform != NULL)
-		{
-		status = mb_platform_deall(verbose, (void **)&platform, &error);
-		}
-
-	/* check memory */
-	if (verbose >= 4)
-		status = mb_memory_list(verbose,&error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  Program <%s> completed\n",
-			program_name);
-		fprintf(stderr,"dbg2  Ending status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* end it all */
-	exit(error);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/utilities/mb7kpreprocess.c.new b/src/utilities/mb7kpreprocess.c.new
deleted file mode 100644
index 12f8824..0000000
--- a/src/utilities/mb7kpreprocess.c.new
+++ /dev/null
@@ -1,7787 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mb7kpreprocess.c	10/12/2005
- *    $Id: mb7kpreprocess.c 2239 2015-05-07 00:51:42Z caress $
- *
- *    Copyright (c) 2005-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mb7kpreprocess reads a Reson 7k format file, interpolates the
- * asynchronous navigation and attitude onto the multibeam data,
- * and writes a new 7k file with that information correctly embedded
- * in the multibeam data. This program can also fix various problems
- * with 7k data (early generations of the 6046 datalogger failed to
- * to meet the data format specification exactly).
- *
- * Author:	D. W. Caress
- * Date:	October 12, 2005
- *
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <math.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-
-/* MBIO include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_define.h"
-#include "mb_io.h"
-#include "mb_aux.h"
-#include "mbsys_reson7k.h"
-
-#define MB7KPREPROCESS_ALLOC_CHUNK 1000
-#define MB7KPREPROCESS_PROCESS		1
-#define MB7KPREPROCESS_TIMESTAMPLIST	2
-#define MB7KPREPROCESS_TIMEFIX_NONE	0
-#define MB7KPREPROCESS_TIMEFIX_RESON	1
-#define MB7KPREPROCESS_TIMEFIX_EDGETECH	2
-#define	MB7KPREPROCESS_TIMEDELAY_UNDEFINED	-1
-#define	MB7KPREPROCESS_TIMEDELAY_OFF		0
-#define	MB7KPREPROCESS_TIMEDELAY_ON		1
-#define	MB7KPREPROCESS_TIMELAG_OFF	0
-#define	MB7KPREPROCESS_TIMELAG_CONSTANT	1
-#define	MB7KPREPROCESS_TIMELAG_MODEL	2
-#define	MB7KPREPROCESS_KLUGE_USEVERTICALDEPTH		1
-#define	MB7KPREPROCESS_KLUGE_ZEROALONGTRACKANGLES	2
-#define	MB7KPREPROCESS_KLUGE_ZEROATTITUDECORRECTION	3
-#define	MB7KPREPROCESS_KLUGE_KEARFOTTROVNOISE		4
-#define	MB7KPREPROCESS_KLUGE_BEAMPATTERNTWEAK		5
-static char rcs_id[] = "$Id: mb7kpreprocess.c 2239 2015-05-07 00:51:42Z caress $";
-
-/*--------------------------------------------------------------------*/
-
-int main (int argc, char **argv)
-{
-	char program_name[] = "mb7kpreprocess";
-	char help_message[] =  "mb7kpreprocess reads a Reson 7k format file, interpolates the\nasynchronous navigation and attitude onto the multibeam data, \nand writes a new 7k file with that information correctly embedded\nin the multibeam data. This program can also fix various problems\nwith 7k data.";
-	char usage_message[] = "mb7kpreprocess [-A -B -Crollbias/pitchbias -Doffx/offy -Fformat -Ifile -Kklugemode -L  -Ninsfile  -Ooutfile [-Psonardepthfile | -Plagmax/ratemax] -Ssidescansource -Ttimelag -H -V]";
-	extern char *optarg;
-	int	errflg = 0;
-	int	c;
-	int	help = 0;
-	int	flag = 0;
-
-	/* MBIO status variables */
-	int	status = MB_SUCCESS;
-	int	verbose = 0;
-	int	error = MB_ERROR_NO_ERROR;
-	char	*message;
-
-	/* MBIO read control parameters */
-	int	read_datalist = MB_NO;
-	char	read_file[MB_PATH_MAXLINE];
-	void	*datalist;
-	int	look_processed = MB_DATALIST_LOOK_UNSET;
-	double	file_weight;
-	int	format = 0;
-	int	pings;
-	int	lonflip;
-	double	bounds[4];
-	int	btime_i[7];
-	int	etime_i[7];
-	double	btime_d;
-	double	etime_d;
-	double	speedmin;
-	double	timegap;
-	char	ifile[MB_PATH_MAXLINE];
-	char	ofile[MB_PATH_MAXLINE];
-	char	ctdfile[MB_PATH_MAXLINE];
-	int	ofile_set = MB_NO;
-	int	beams_bath;
-	int	beams_amp;
-	int	pixels_ss;
-	int	obeams_bath;
-	int	obeams_amp;
-	int	opixels_ss;
-	
-	/* platform definition file */
-	char	platform_file[MB_PATH_MAXLINE];
-	int	use_platform_file = MB_NO;
-	struct mb_platform_struct *platform = NULL;
-	struct mb_sensor_struct *sensor_swathbathymetry = NULL;
-	struct mb_sensor_struct *sensor_rollpitch = NULL;
-	struct mb_sensor_struct *sensor_heading = NULL;
-	struct mb_sensor_struct *sensor_position = NULL;
-	struct mb_sensor_struct *sensor_depth = NULL;
-
-	/* MBIO read values */
-	void	*imbio_ptr = NULL;
-	struct mb_io_struct *imb_io_ptr = NULL;
-	void	*istore_ptr = NULL;
-	struct mbsys_reson7k_struct *istore = NULL;
-	void	*ombio_ptr = NULL;
-	int	kind;
-	int	time_i[7];
-	int	time_j[5];
-	double	time_d;
-	double	navlon;
-	double	navlat;
-	double	speed;
-	double	distance;
-	double	altitude;
-	double	sonardepth;
-	double	heading, beamheading, beamheadingr;
-	double	roll, rollr, beamroll, beamrollr;
-	double	pitch, pitchr, beampitch, beampitchr;
-	double	heave, beamheave;
-	char	*beamflag = NULL;
-	double	*bath = NULL;
-	double	*bathacrosstrack = NULL;
-	double	*bathalongtrack = NULL;
-	double	*amp = NULL;
-	double	*ss = NULL;
-	double	*ssacrosstrack = NULL;
-	double	*ssalongtrack = NULL;
-	char	comment[MB_COMMENT_MAXLINE];
-
-	/* program mode */
-	int	mode = MB7KPREPROCESS_PROCESS;
-	int	fix_time_stamps = MB7KPREPROCESS_TIMEFIX_NONE;
-	int	goodnavattitudeonly = MB_YES;
-
-	/* data structure pointers */
-	s7k_header 		*header;
-	s7kr_reference		*reference;
-	s7kr_sensoruncal	*sensoruncal;
-	s7kr_sensorcal		*sensorcal;
-	s7kr_position 		*position;
-	s7kr_customattitude	*customattitude;
-	s7kr_tide		*tide;
-	s7kr_altitude		*altituderec;
-	s7kr_motion		*motion;
-	s7kr_depth		*depth;
-	s7kr_svp		*svp;
-	s7kr_ctd		*ctd;
-	s7kr_geodesy		*geodesy;
-	s7kr_rollpitchheave 	*rollpitchheave;
-	s7kr_heading		*headingrec;
-	s7kr_surveyline		*surveyline;
-	s7kr_navigation		*navigation;
-	s7kr_attitude		*attitude;
-	s7kr_fsdwss 		*fsdwsslo;
-	s7kr_fsdwss 		*fsdwsshi;
-	s7kr_fsdwsb 		*fsdwsb;
-	s7k_fsdwchannel 	*fsdwchannel;
-	s7k_fsdwssheader 	*fsdwssheader;
-	s7k_fsdwsegyheader 	*fsdwsegyheader;
-	s7kr_bluefin		*bluefin;
-	s7kr_volatilesettings	*volatilesettings;
-	s7kr_matchfilter	*matchfilter;
-	s7kr_beamgeometry	*beamgeometry;
-	s7kr_bathymetry		*bathymetry;
-	s7kr_backscatter	*backscatter;
-	s7kr_beam		*beam;
-	s7kr_v2pingmotion	*v2pingmotion;
-	s7kr_v2detectionsetup	*v2detectionsetup;
-	s7kr_v2beamformed	*v2beamformed;
-	s7kr_verticaldepth	*verticaldepth;
-	s7kr_v2detection	*v2detection;
-	s7kr_v2rawdetection	*v2rawdetection;
-	s7kr_v2snippet		*v2snippet;
-	s7kr_calibratedsnippet *calibratedsnippet;
-	s7kr_processedsidescan	*processedsidescan;
-	s7kr_image		*image;
-	s7kr_fileheader		*fileheader;
-	s7kr_installation	*installation;
-	s7kr_remotecontrolsettings	*remotecontrolsettings;
-
-	/* counting variables */
-	int	nfile_read = 0;
-	int	nfile_write = 0;
-	int	nrec_reference = 0;
-	int	nrec_sensoruncal = 0;
-	int	nrec_sensorcal = 0;
-	int	nrec_position = 0;
-	int	nrec_customattitude = 0;
-	int	nrec_tide = 0;
-	int	nrec_altitude = 0;
-	int	nrec_motion = 0;
-	int	nrec_depth = 0;
-	int	nrec_svp = 0;
-	int	nrec_ctd = 0;
-	int	nrec_geodesy = 0;
-	int	nrec_rollpitchheave = 0;
-	int	nrec_heading = 0;
-	int	nrec_surveyline = 0;
-	int	nrec_navigation = 0;
-	int	nrec_attitude = 0;
-	int	nrec_fsdwsslo = 0;
-	int	nrec_fsdwsshi = 0;
-	int	nrec_fsdwsbp = 0;
-	int	nrec_bluefinnav = 0;
-	int	nrec_bluefinenv = 0;
-	int	nrec_multibeam = 0;
-	int	nrec_volatilesettings = 0;
-	int	nrec_configuration = 0;
-	int	nrec_matchfilter = 0;
-	int	nrec_beamgeometry = 0;
-	int	nrec_calibration = 0;
-	int	nrec_bathymetry = 0;
-	int	nrec_backscatter = 0;
-	int	nrec_beam = 0;
-	int	nrec_verticaldepth = 0;
-	int	nrec_image = 0;
-	int	nrec_v2pingmotion = 0;
-	int	nrec_v2detectionsetup = 0;
-	int	nrec_v2beamformed = 0;
-	int	nrec_v2detection = 0;
-	int	nrec_v2rawdetection = 0;
-	int	nrec_v2snippet = 0;
-	int 	nrec_calibratedsnippet = 0;
-	int	nrec_processedsidescan = 0;
-	int	nrec_installation = 0;
-	int	nrec_systemeventmessage = 0;
-	int	nrec_fileheader = 0;
-	int	nrec_remotecontrolsettings = 0;
-	int	nrec_other = 0;
-	int	nrec_reference_tot = 0;
-	int	nrec_sensoruncal_tot = 0;
-	int	nrec_sensorcal_tot = 0;
-	int	nrec_position_tot = 0;
-	int	nrec_customattitude_tot = 0;
-	int	nrec_tide_tot = 0;
-	int	nrec_altitude_tot = 0;
-	int	nrec_motion_tot = 0;
-	int	nrec_depth_tot = 0;
-	int	nrec_svp_tot = 0;
-	int	nrec_ctd_tot = 0;
-	int	nrec_geodesy_tot = 0;
-	int	nrec_rollpitchheave_tot = 0;
-	int	nrec_heading_tot = 0;
-	int	nrec_surveyline_tot = 0;
-	int	nrec_navigation_tot = 0;
-	int	nrec_attitude_tot = 0;
-	int	nrec_fsdwsslo_tot = 0;
-	int	nrec_fsdwsshi_tot = 0;
-	int	nrec_fsdwsbp_tot = 0;
-	int	nrec_bluefinnav_tot = 0;
-	int	nrec_bluefinenv_tot = 0;
-	int	nrec_multibeam_tot = 0;
-	int	nrec_volatilesettings_tot = 0;
-	int	nrec_configuration_tot = 0;
-	int	nrec_matchfilter_tot = 0;
-	int	nrec_beamgeometry_tot = 0;
-	int	nrec_calibration_tot = 0;
-	int	nrec_bathymetry_tot = 0;
-	int	nrec_backscatter_tot = 0;
-	int	nrec_beam_tot = 0;
-	int	nrec_verticaldepth_tot = 0;
-	int	nrec_image_tot = 0;
-	int	nrec_v2pingmotion_tot = 0;
-	int	nrec_v2detectionsetup_tot = 0;
-	int	nrec_v2beamformed_tot = 0;
-	int	nrec_v2detection_tot = 0;
-	int	nrec_v2rawdetection_tot = 0;
-	int	nrec_v2snippet_tot = 0;
-	int	nrec_calibratedsnippet_tot = 0;
-	int	nrec_processedsidescan_tot = 0;
-	int	nrec_installation_tot = 0;
-	int	nrec_systemeventmessage_tot = 0;
-	int	nrec_fileheader_tot = 0;
-	int	nrec_remotecontrolsettings_tot = 0;
-	int	nrec_other_tot = 0;
-
-	/* last time_d variables - used to check for repeated data */
-	double	last_7k_time_d = 0.0;
-	double	last_bluefinnav_time_d = 0.0;
-	double	last_bluefinenv_time_d = 0.0;
-	double	last_fsdwsbp_time_d = 0.0;
-	double	last_fsdwsslo_time_d = 0.0;
-	double	last_fsdwsshi_time_d = 0.0;
-
-	/* merge navigation and attitude from separate Steve Rock data file */
-	char	rockfile[MB_PATH_MAXLINE];
-	int	rockdata = MB_NO;
-	int	nrock = 0;
-	double	*rock_time_d = NULL;
-	double	*rock_lon = NULL;
-	double	*rock_lat = NULL;
-	double	*rock_heading = NULL;
-	double	*rock_roll = NULL;
-	double	*rock_pitch = NULL;
-	double	*rock_sonardepth = NULL;
-	double	*rock_sonardepthfilter = NULL;
-
-	/* merge navigation and attitude from separate WHOI DSL data file */
-	char	dslfile[MB_PATH_MAXLINE];
-	int	dsldata = MB_NO;
-	int	ndsl = 0;
-	double	*dsl_time_d = NULL;
-	double	*dsl_lon = NULL;
-	double	*dsl_lat = NULL;
-	double	*dsl_heading = NULL;
-	double	*dsl_roll = NULL;
-	double	*dsl_pitch = NULL;
-	double	*dsl_sonardepth = NULL;
-	double	*dsl_sonardepthfilter = NULL;
-
-	/* merge navigation and attitude from separate ins data file */
-	char	insfile[MB_PATH_MAXLINE];
-	int	insdata = MB_NO;
-	int	nins = 0;
-	int	nins_altitude = 0;
-	int	nins_speed = 0;
-	double	*ins_time_d = NULL;
-	double	*ins_lon = NULL;
-	double	*ins_lat = NULL;
-	double	*ins_heading = NULL;
-	double	*ins_roll = NULL;
-	double	*ins_pitch = NULL;
-	double	*ins_sonardepth = NULL;
-	double	*ins_sonardepthfilter = NULL;
-	double	*ins_altitude_time_d = NULL;
-	double	*ins_altitude = NULL;
-	double	*ins_speed_time_d = NULL;
-	double	*ins_speed = NULL;
-	int	ins_output_index = -1;
-
-	/* merge sonardepth from separate parosci pressure sensor data file */
-	char	sonardepthfile[MB_PATH_MAXLINE];
-	int	sonardepthdata = MB_NO;
-	int	nsonardepth = 0;
-	double	*sonardepth_time_d = NULL;
-	double	*sonardepth_sonardepth = NULL;
-	double	*sonardepth_sonardepthfilter = NULL;
-
-	/* asynchronous navigation, heading, attitude data */
-	int	ndat_nav = 0;
-	int	ndat_nav_alloc = 0;
-	double	*dat_nav_time_d = NULL;
-	double	*dat_nav_lon = NULL;
-	double	*dat_nav_lat = NULL;
-	double	*dat_nav_speed = NULL;
-
-	int	ndat_sonardepth = 0;
-	int	ndat_sonardepth_alloc = 0;
-	double	*dat_sonardepth_time_d = NULL;
-	double	*dat_sonardepth_sonardepth = NULL;
-	double	*dat_sonardepth_sonardepthfilter = NULL;
-
-	int	ndat_heading = 0;
-	int	ndat_heading_alloc = 0;
-	double	*dat_heading_time_d = NULL;
-	double	*dat_heading_heading = NULL;
-
-	int	ndat_rph = 0;
-	int	ndat_rph_alloc = 0;
-	double	*dat_rph_time_d = NULL;
-	double	*dat_rph_roll = NULL;
-	double	*dat_rph_pitch = NULL;
-	double	*dat_rph_heave = NULL;
-
-	int	ndat_altitude = 0;
-	int	ndat_altitude_alloc = 0;
-	double	*dat_altitude_time_d = NULL;
-	double	*dat_altitude_altitude = NULL;
-
-	/* bathymetry time delay data */
-	int	ntimedelay = 0;
-	int	ntimedelaycount = 0;
-	int	ntimedelay_alloc = 0;
-	double	*timedelay_time_d = NULL;
-	double	*timedelay_timedelay = NULL;
-
-	/* bathymetry timetag data */
-	int	nbatht = 0;
-	int	nbatht_alloc = 0;
-	double	*batht_time_d = NULL;
-	int	*batht_ping = NULL;
-	double	*batht_time_d_new = NULL;
-	double	*batht_time_offset = NULL;
-	int	*batht_ping_offset = NULL;
-	int	*batht_good_offset = NULL;
-
-	/* edgetech timetag data */
-	int	nedget = 0;
-	int	nedget_alloc = 0;
-	double	*edget_time_d = NULL;
-	int	*edget_ping = NULL;
-	double	*edget_time_d_new = NULL;
-	double	*edget_time_offset = NULL;
-	int	*edget_ping_offset = NULL;
-	int	*edget_good_offset = NULL;
-
-	/* timedelay parameters */
-	int	timedelaymode = MB7KPREPROCESS_TIMEDELAY_UNDEFINED;
-	char	timedelayfile[MB_PATH_MAXLINE];
-
-	/* timelag parameters */
-	int	timelagmode = MB7KPREPROCESS_TIMELAG_OFF;
-	double	timelag = 0.0;
-	double	timelagm = 0.0;
-	double	timelagconstant = 0.0;
-	char	timelagfile[MB_PATH_MAXLINE];
-	int	ntimelag = 0;
-	double	*timelag_time_d = NULL;
-	double	*timelag_model = NULL;
-
-	/* range offset parameters */
-	int	nrangeoffset = 0;
-	int	rangeoffsetstart[3];
-	int	rangeoffsetend[3];
-	double	rangeoffset[3];
-
-	/* depth sensor filtering */
-	int	sonardepthfilter = MB_NO;
-	double	sonardepthfilterlength = 20.0;
-	double	sonardepthfilterdepth = 20.0;
-
-	/* depth sensor offset (+ makes vehicle deeper) */
-	double	sonardepthoffset = 0.0;
-
-	/* depth sensor lever arm parameter */
-	int	use_depthsensoroff = MB_NO;
-	double	depthsensoroffx = 0.0;
-	double	depthsensoroffy = 0.0;
-	double	depthsensoroffz = 0.0;
-	
-	int	sonar_offset_mode = MB_NO;
-	double	sonar_offset_x = 0.0;
-	double	sonar_offset_y = 0.0;
-	double	sonar_offset_z = 0.0;
-	double	sonar_offset_heading = 0.0;
-	double	sonar_offset_roll = 0.0;
-	double	sonar_offset_pitch = 0.0;
-	
-	int	vru_offset_mode = MB_NO;
-	double	vru_offset_x = 0.0;
-	double	vru_offset_y = 0.0;
-	double	vru_offset_z = 0.0;
-	double	vru_offset_heading = 0.0;
-	double	vru_offset_roll = 0.0;
-	double	vru_offset_pitch = 0.0;
-	
-	int	navigation_offset_mode = MB_NO;
-	double	navigation_offset_x = 0.0;
-	double	navigation_offset_y = 0.0;
-	double	navigation_offset_z = 0.0;
-	double	navigation_offset_heading = 0.0;
-	double	navigation_offset_roll = 0.0;
-	double	navigation_offset_pitch = 0.0;
-	double	position_offset_x = 0.0;
-	double	position_offset_y = 0.0;
-	double	position_offset_z = 0.0;
-
-	/* multibeam sidescan parameters */
-	int	ss_source = R7KRECID_None;
-
-	/* output asynchronous and synchronous time series ancilliary files */
-	char	athfile[MB_PATH_MAXLINE];
-	char	atsfile[MB_PATH_MAXLINE];
-	char	atafile[MB_PATH_MAXLINE];
-	char	stafile[MB_PATH_MAXLINE];
-	FILE	*athfp;
-	FILE	*atsfp;
-	FILE	*atafp;
-	FILE	*stafp;
-
-	/* kluge modes */
-	int	klugemode;
-	double	klugevalue;
-	int	kluge_useverticaldepth = MB_NO; /* kluge 1 */
-	int	kluge_zeroalongtrackangles = MB_NO; /* kluge 2 */
-	int	kluge_zeroattitudecorrection = MB_NO; /* kluge 3 */
-	int	kluge_kearfottrovnoise = MB_NO; /* kluge 4 */
-	int	kluge_beampatterntweak = MB_NO; /* kluge 5 */
-	double	kluge_beampatternfactor = 1.0;
-
-	/* MBARI data flag */
-	int	MBARIdata = MB_NO;
-	
-	/* variables for beam angle calculation */
-	mb_3D_orientation tx_align;
-	mb_3D_orientation tx_orientation;
-	double tx_steer;
-	mb_3D_orientation rx_align;
-	mb_3D_orientation rx_orientation;
-	double rx_steer;
-	double reference_heading;
-	double beamAzimuth;
-	double beamDepression;
-	double rollbias = 0.0;
-	double pitchbias = 0.0;
-
-	int	jtimedelay = 0;
-	int	jtimelag = 0;
-	int	jins = 0;
-	int	jrock = 0;
-	int	jdsl = 0;
-	int	jsonardepth = 0;
-	int	jdnav = 0;
-	int	jdaltitude = 0;
-	int	jdheading = 0;
-	int	jdattitude = 0;
-	int	jdsonardepth = 0;
-
-	int	interp_status;
-	double	soundspeed;
-	double	alpha, beta, theta, phi;
-	double	rr, xx, zz;
-	double	lever_x, lever_y, lever_z;
-	double	headingx, headingy, mtodeglon, mtodeglat;
-	double	dx, dy, dist, dt, v;
-	double	longitude_offset, latitude_offset;
-	int	j1, j2;
-	double	pixel_size;
-	double	swath_width;
-	int	time7k_i[7];
-	int	time7k_j[5];
-	double	time7k_d;
-
-	FILE	*tfp = NULL;
-	struct stat file_status;
-	int	fstat;
-	char	buffer[MB_PATH_MAXLINE];
-	char	*result;
-	int	read_data;
-	int	testformat;
-	char	fileroot[MB_PATH_MAXLINE];
-	int	found;
-	int	reson_lastread;
-	int	sslo_lastread;
-	double	sslo_last_time_d;
-	int	sslo_last_ping;
-	int	foundstart, foundend;
-	int	start, end;
-	int	nscan, startdata;
-	int	ins_time_d_index = -1;
-	int	ins_lon_index = -1;
-	int	ins_lat_index = -1;
-	int	ins_roll_index = -1;
-	int	ins_pitch_index = -1;
-	int	ins_heading_index = -1;
-	int	ins_sonardepth_index = -1;
-	int	ins_altitude_index = -1;
-	int	ins_speed_index = -1;
-	int	ins_velocityx_index = -1;
-	int	ins_velocityy_index = -1;
-	int	ins_velocityz_index = -1;
-	int	ins_len;
-	int	sonardepth_time_d_index;
-	int	sonardepth_sonardepth_index;
-	int	sonardepth_len;
-	int	nhalffilter;
-	double	sonardepth_filterweight;
-	double	dtime, dtol, weight;
-	double	factor;
-	double	velocityx, velocityy;
-	int	type_save, kind_save;
-	char	type[MB_PATH_MAXLINE], value[MB_PATH_MAXLINE];
-	int	year, month, day, hour, minute;
-	double	second, id;
-	char	sensor[24];
-	int	n;
-	int	i, j;
-
-	/* get current default values */
-	status = mb_defaults(verbose,&format,&pings,&lonflip,bounds,
-		btime_i,etime_i,&speedmin,&timegap);
-
-	/* set default input to datalist.mb-1 */
-	strcpy (read_file, "datalist.mb-1");
-
-	/* process argument list */
-	while ((c = getopt(argc, argv, "AaB:b:C:c:D:d:F:f:G:g:I:i:K:k:LlM:m:N:n:O:o:P:p:R:r:S:s:T:t:W:w:Z:z:VvHh")) != -1)
-	  switch (c)
-		{
-		case 'H':
-		case 'h':
-			help++;
-			break;
-		case 'V':
-		case 'v':
-			verbose++;
-			break;
-		case 'A':
-		case 'a':
-			goodnavattitudeonly = MB_NO;
-			flag++;
-			break;
-		case 'B':
-		case 'b':
-			sscanf (optarg,"%d", &fix_time_stamps);
-			break;
-		case 'C':
-		case 'c':
-			nscan = sscanf (optarg,"%lf/%lf", &sonar_offset_roll,&sonar_offset_pitch);
-			if (nscan == 2)
-				sonar_offset_mode = MB_YES;
-			break;
-		case 'D':
-		case 'd':
-			nscan = sscanf (optarg,"%lf/%lf/%lf/%lf", &depthsensoroffx, &depthsensoroffy, &depthsensoroffz, &sonardepthoffset);
-			if (nscan < 4)
-				{
-				if (nscan == 3)
-					{
-					sonardepthoffset = depthsensoroffz;
-					depthsensoroffz = depthsensoroffy;
-					depthsensoroffy = depthsensoroffx;
-					depthsensoroffx = 0.0;
-					}
-				else if (nscan == 2)
-					{
-					sonardepthoffset = 0.0;
-					depthsensoroffz = depthsensoroffy;
-					depthsensoroffy = depthsensoroffx;
-					depthsensoroffx = 0.0;
-					}
-				else if (nscan == 1)
-					{
-					sonardepthoffset = 0.0;
-					depthsensoroffz = 0.0;
-					depthsensoroffy = depthsensoroffx;
-					depthsensoroffx = 0.0;
-					}
-				}
-			if (nscan > 0)
-				use_depthsensoroff = MB_YES;
-			flag++;
-			break;
-		case 'F':
-		case 'f':
-			sscanf (optarg,"%d", &format);
-			flag++;
-			break;
-		case 'G':
-		case 'g':
-			sscanf (optarg,"%s", platform_file);
-			use_platform_file = MB_YES;
-			flag++;
-			break;
-		case 'I':
-		case 'i':
-			sscanf (optarg,"%s", read_file);
-			flag++;
-			break;
-		case 'K':
-		case 'k':
-			nscan = sscanf (optarg,"%d/%lf", &klugemode, &klugevalue);
-			if (klugemode == MB7KPREPROCESS_KLUGE_USEVERTICALDEPTH)
-				{
-				kluge_useverticaldepth = MB_YES;
-				}
-			if (klugemode == MB7KPREPROCESS_KLUGE_ZEROALONGTRACKANGLES)
-				{
-				kluge_zeroalongtrackangles = MB_YES;
-				}
-			if (klugemode == MB7KPREPROCESS_KLUGE_ZEROATTITUDECORRECTION)
-				{
-				kluge_zeroattitudecorrection = MB_YES;
-				}
-			if (klugemode == MB7KPREPROCESS_KLUGE_KEARFOTTROVNOISE)
-				{
-				kluge_kearfottrovnoise = MB_YES;
-				}
-			if (klugemode == MB7KPREPROCESS_KLUGE_BEAMPATTERNTWEAK
-				&& nscan == 2)
-				{
-				kluge_beampatterntweak = MB_YES;
-				kluge_beampatternfactor = klugevalue;
-				}
-			flag++;
-			break;
-		case 'L':
-		case 'l':
-			mode = MB7KPREPROCESS_TIMESTAMPLIST;
-			flag++;
-			break;
-		case 'M':
-		case 'm':
-			sscanf (optarg,"%s", rockfile);
-			rockdata  = MB_YES;
-			flag++;
-			break;
-		case 'N':
-		case 'n':
-			sscanf (optarg,"%s", insfile);
-			insdata  = MB_YES;
-			flag++;
-			break;
-		case 'O':
-		case 'o':
-			sscanf (optarg,"%s", ofile);
-			ofile_set  = MB_YES;
-			flag++;
-			break;
-		case 'P':
-		case 'p':
-			sscanf (optarg,"%s", buffer);
-			if ((fstat = stat(buffer, &file_status)) == 0
-				&& (file_status.st_mode & S_IFMT) != S_IFDIR)
-					{
-					sonardepthdata  = MB_YES;
-					strcpy(sonardepthfile,buffer);
-					}
-			else if (optarg[0] == 'F' || optarg[0] == 'f')
-				{
-				nscan = sscanf (&(optarg[1]),"%lf/%lf", &sonardepthfilterlength, &sonardepthfilterdepth);
-				if (nscan == 1)
-					sonardepthfilterdepth = 20.0;
-				if (nscan >= 1)
-					sonardepthfilter = MB_YES;
-				else
-					sonardepthfilter = MB_NO;
-				}
-			flag++;
-			break;
-		case 'R':
-		case 'r':
-			if (nrangeoffset < 3)
-				{
-				sscanf (optarg,"%d/%d/%lf",
-					&rangeoffsetstart[nrangeoffset],
-					&rangeoffsetend[nrangeoffset],
-					&rangeoffset[nrangeoffset]);
-				nrangeoffset++;
-				}
-			flag++;
-			break;
-		case 'S':
-		case 's':
-			if (optarg[0] == 'C')
-				ss_source = R7KRECID_7kCalibratedSnippetData;
-			else if (optarg[0] == 'S')
-				ss_source = R7KRECID_7kV2SnippetData;
-			else if (optarg[0] == 'B')
-				ss_source = R7KRECID_7kBackscatterImageData;
-			else
-				sscanf (optarg,"%d", &ss_source);
-			flag++;
-			break;
-		case 'T':
-		case 't':
-			sscanf (optarg,"%s", buffer);
-			if ((fstat = stat(buffer, &file_status)) == 0
-				&& (file_status.st_mode & S_IFMT) != S_IFDIR)
-					{
-					timelagmode = MB7KPREPROCESS_TIMELAG_MODEL;
-					strcpy(timelagfile,buffer);
-					}
-			else if (strncmp(buffer, "USE_TIME_DELAY", 14) == 0)
-				{
-				timedelaymode = MB7KPREPROCESS_TIMEDELAY_ON;
-				}
-			else if (strncmp(buffer, "NO_TIME_DELAY", 13) == 0)
-				{
-				timedelaymode = MB7KPREPROCESS_TIMEDELAY_OFF;
-				}
-			else
-				{
-				sscanf (optarg,"%lf", &timelagconstant);
-				timelagmode = MB7KPREPROCESS_TIMELAG_CONSTANT;
-				}
-			flag++;
-			break;
-		case 'W':
-		case 'w':
-			sscanf (optarg,"%s", dslfile);
-			dsldata  = MB_YES;
-			flag++;
-			break;
-		case 'Z':
-		case 'z':
-			/* sonar_offsets */
-			if (strncmp("sonar_offsets=", optarg, 14) == 0)
-				{
-				n = sscanf(optarg, "sonar_offsets=%lf/%lf/%lf/%lf/%lf/%lf",
-					   &sonar_offset_x,&sonar_offset_y,&sonar_offset_z,
-					   &sonar_offset_heading,&sonar_offset_roll,&sonar_offset_pitch);
-				if (n == 6)
-					sonar_offset_mode = MB_YES;
-				}
-			
-			/* vru_offsets */
-			else if (strncmp("vru_offsets=", optarg, 12) == 0)
-				{
-				n = sscanf(optarg, "vru_offsets=%lf/%lf/%lf/%lf/%lf/%lf",
-					   &vru_offset_x,&vru_offset_y,&vru_offset_z,
-					   &vru_offset_heading,&vru_offset_roll,&vru_offset_pitch);
-				if (n == 6)
-					sonar_offset_mode = MB_YES;
-				}
-			
-			/* navigation_offsets */
-			else if (strncmp("navigation_offsets=", optarg, 19) == 0)
-				{
-				n = sscanf(optarg, "navigation_offsets=%lf/%lf/%lf/%lf/%lf/%lf",
-					   &navigation_offset_x,&navigation_offset_y,&navigation_offset_z,
-					   &navigation_offset_heading,&navigation_offset_roll,&navigation_offset_pitch);
-				if (n == 6)
-					sonar_offset_mode = MB_YES;
-				}
-			flag++;
-			break;
-		case '?':
-			errflg++;
-		}
-
-	/* if error flagged then print it and exit */
-	if (errflg)
-		{
-		fprintf(stderr,"usage: %s\n", usage_message);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		error = MB_ERROR_BAD_USAGE;
-		exit(error);
-		}
-
-	/* print starting message */
-	if (verbose == 1 || help)
-		{
-		fprintf(stderr,"\nProgram %s\n",program_name);
-		fprintf(stderr,"Version %s\n",rcs_id);
-		fprintf(stderr,"MB-system Version %s\n",MB_VERSION);
-		}
-
-	/* print starting debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  Program <%s>\n",program_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Control Parameters:\n");
-		fprintf(stderr,"dbg2       verbose:             %d\n",verbose);
-		fprintf(stderr,"dbg2       help:                %d\n",help);
-		fprintf(stderr,"dbg2       format:              %d\n",format);
-		fprintf(stderr,"dbg2       pings:               %d\n",pings);
-		fprintf(stderr,"dbg2       lonflip:             %d\n",lonflip);
-		fprintf(stderr,"dbg2       bounds[0]:           %f\n",bounds[0]);
-		fprintf(stderr,"dbg2       bounds[1]:           %f\n",bounds[1]);
-		fprintf(stderr,"dbg2       bounds[2]:           %f\n",bounds[2]);
-		fprintf(stderr,"dbg2       bounds[3]:           %f\n",bounds[3]);
-		fprintf(stderr,"dbg2       btime_i[0]:          %d\n",btime_i[0]);
-		fprintf(stderr,"dbg2       btime_i[1]:          %d\n",btime_i[1]);
-		fprintf(stderr,"dbg2       btime_i[2]:          %d\n",btime_i[2]);
-		fprintf(stderr,"dbg2       btime_i[3]:          %d\n",btime_i[3]);
-		fprintf(stderr,"dbg2       btime_i[4]:          %d\n",btime_i[4]);
-		fprintf(stderr,"dbg2       btime_i[5]:          %d\n",btime_i[5]);
-		fprintf(stderr,"dbg2       btime_i[6]:          %d\n",btime_i[6]);
-		fprintf(stderr,"dbg2       etime_i[0]:          %d\n",etime_i[0]);
-		fprintf(stderr,"dbg2       etime_i[1]:          %d\n",etime_i[1]);
-		fprintf(stderr,"dbg2       etime_i[2]:          %d\n",etime_i[2]);
-		fprintf(stderr,"dbg2       etime_i[3]:          %d\n",etime_i[3]);
-		fprintf(stderr,"dbg2       etime_i[4]:          %d\n",etime_i[4]);
-		fprintf(stderr,"dbg2       etime_i[5]:          %d\n",etime_i[5]);
-		fprintf(stderr,"dbg2       etime_i[6]:          %d\n",etime_i[6]);
-		fprintf(stderr,"dbg2       speedmin:            %f\n",speedmin);
-		fprintf(stderr,"dbg2       timegap:             %f\n",timegap);
-		fprintf(stderr,"dbg2       read_file:           %s\n",read_file);
-		fprintf(stderr,"dbg2       use_platform_file:   %d\n",use_platform_file);
-		fprintf(stderr,"dbg2       platform_file:       %s\n",platform_file);
-		fprintf(stderr,"dbg2       ofile:               %s\n",ofile);
-		fprintf(stderr,"dbg2       ofile_set:           %d\n",ofile_set);
-		fprintf(stderr,"dbg2       ss_source:           %d\n",ss_source);
-		fprintf(stderr,"dbg2       rockfile:            %s\n",rockfile);
-		fprintf(stderr,"dbg2       rockdata:            %d\n",rockdata);
-		fprintf(stderr,"dbg2       dslfile:             %s\n",dslfile);
-		fprintf(stderr,"dbg2       dsldata:             %d\n",dsldata);
-		fprintf(stderr,"dbg2       insfile:             %s\n",insfile);
-		fprintf(stderr,"dbg2       insdata:             %d\n",insdata);
-		fprintf(stderr,"dbg2       mode:                %d\n",mode);
-		fprintf(stderr,"dbg2       fix_time_stamps:     %d\n",fix_time_stamps);
-		fprintf(stderr,"dbg2       goodnavattitudeonly: %d\n",goodnavattitudeonly);
-		fprintf(stderr,"dbg2       timedelaymode:       %d\n",timedelaymode);
-		fprintf(stderr,"dbg2       timelagmode:         %d\n",timelagmode);
-		fprintf(stderr,"dbg2       kluge_useverticaldepth:        %d\n",kluge_useverticaldepth);
-		fprintf(stderr,"dbg2       kluge_zeroalongtrackangles:    %d\n",kluge_zeroalongtrackangles);
-		fprintf(stderr,"dbg2       kluge_zeroattitudecorrection:  %d\n",kluge_zeroattitudecorrection);
-		fprintf(stderr,"dbg2       kluge_kearfottrovnoise:        %d\n",kluge_useverticaldepth);
-		fprintf(stderr,"dbg2       kluge_beampatterntweak:        %d\n",kluge_useverticaldepth);
-		fprintf(stderr,"dbg2       kluge_beampatternfactor:       %f\n",kluge_beampatternfactor);
-		if (timelagmode == MB7KPREPROCESS_TIMELAG_MODEL)
-			{
-			fprintf(stderr,"dbg2       timelagfile:         %s\n",timelagfile);
-			fprintf(stderr,"dbg2       ntimelag:            %d\n",ntimelag);
-			}
-		else
-			{
-			fprintf(stderr,"dbg2       timelagconstant:     %f\n",timelagconstant);
-			}
-		fprintf(stderr,"dbg2       timelag:                %f\n",timelag);
-		fprintf(stderr,"dbg2       sonardepthfilter:       %d\n",sonardepthfilter);
-		fprintf(stderr,"dbg2       sonardepthfilterlength: %f\n",sonardepthfilterlength);
-		fprintf(stderr,"dbg2       sonardepthfilterdepth:  %f\n",sonardepthfilterdepth);
-		fprintf(stderr,"dbg2       sonardepthfile:         %s\n",sonardepthfile);
-		fprintf(stderr,"dbg2       sonardepthdata:         %d\n",sonardepthdata);
-		fprintf(stderr,"dbg2       sonardepthoffset:       %f\n",sonardepthoffset);
-		fprintf(stderr,"dbg2       depthsensoroffx:        %f\n",depthsensoroffx);
-		fprintf(stderr,"dbg2       depthsensoroffy:        %f\n",depthsensoroffy);
-		fprintf(stderr,"dbg2       depthsensoroffz:        %f\n",depthsensoroffz);
-		fprintf(stderr,"dbg2       sonar_offset_mode:          %d\n",sonar_offset_mode);
-		fprintf(stderr,"dbg2       sonar_offset_x:             %f\n",sonar_offset_x);
-		fprintf(stderr,"dbg2       sonar_offset_y:             %f\n",sonar_offset_y);
-		fprintf(stderr,"dbg2       sonar_offset_z:             %f\n",sonar_offset_z);
-		fprintf(stderr,"dbg2       sonar_offset_heading:       %f\n",sonar_offset_heading);
-		fprintf(stderr,"dbg2       sonar_offset_roll:          %f\n",sonar_offset_roll);
-		fprintf(stderr,"dbg2       sonar_offset_pitch:         %f\n",sonar_offset_pitch);
-		fprintf(stderr,"dbg2       vru_offset_mode:            %d\n",vru_offset_mode);
-		fprintf(stderr,"dbg2       vru_offset_x:               %f\n",vru_offset_x);
-		fprintf(stderr,"dbg2       vru_offset_y:               %f\n",vru_offset_y);
-		fprintf(stderr,"dbg2       vru_offset_z:               %f\n",vru_offset_z);
-		fprintf(stderr,"dbg2       vru_offset_heading:         %f\n",vru_offset_heading);
-		fprintf(stderr,"dbg2       vru_offset_roll:            %f\n",vru_offset_roll);
-		fprintf(stderr,"dbg2       vru_offset_pitch:           %f\n",vru_offset_pitch);
-		fprintf(stderr,"dbg2       navigation_offset_mode:     %d\n",navigation_offset_mode);
-		fprintf(stderr,"dbg2       navigation_offset_x:        %f\n",navigation_offset_x);
-		fprintf(stderr,"dbg2       navigation_offset_y:        %f\n",navigation_offset_y);
-		fprintf(stderr,"dbg2       navigation_offset_z:        %f\n",navigation_offset_z);
-		fprintf(stderr,"dbg2       navigation_offset_heading:  %f\n",navigation_offset_heading);
-		fprintf(stderr,"dbg2       navigation_offset_roll:     %f\n",navigation_offset_roll);
-		fprintf(stderr,"dbg2       navigation_offset_pitch:    %f\n",navigation_offset_pitch);
-		for (i=0;i<nrangeoffset;i++)
-			fprintf(stderr,"dbg2       rangeoffset[%d]:         %d %d %f\n",
-				i,rangeoffsetstart[i], rangeoffsetend[i], rangeoffset[i]);
-		}
-
-	/* if help desired then print it and exit */
-	if (help)
-		{
-		fprintf(stderr,"\n%s\n",help_message);
-		fprintf(stderr,"\nusage: %s\n", usage_message);
-		exit(error);
-		}
-
-	/* read navigation and attitude data from AUV log file if specified */
-	if (insdata == MB_YES)
-		{
-		/* count the data points in the auv log file */
-		if ((tfp = fopen(insfile, "r")) == NULL)
-			{
-			error = MB_ERROR_OPEN_FAIL;
-			fprintf(stderr,"\nUnable to open ins data file <%s> for reading\n",insfile);
-			fprintf(stderr,"\nProgram <%s> Terminated\n",
-				program_name);
-			exit(error);
-			}
-
-		/* read the ascii header to determine how to parse the binary data */
-		ins_len = 0;
-		while ((result = fgets(buffer,MB_PATH_MAXLINE,tfp)) == buffer
-			&& strncmp(buffer, "# begin",7) != 0)
-			{
-			nscan = sscanf(buffer, "# %s %s", type, value);
-			if (nscan == 2)
-				{
-				if (strcmp(value, "time") == 0)
-					ins_time_d_index = ins_len;
-				if (strcmp(value, "mLonK") == 0)
-					ins_lon_index = ins_len;
-				if (strcmp(value, "mLatK") == 0)
-					ins_lat_index = ins_len;
-				if (strcmp(value, "longitude") == 0)
-					ins_lon_index = ins_len;
-				if (strcmp(value, "latitude") == 0)
-					ins_lat_index = ins_len;
-				if (strcmp(value, "mPhi") == 0)
-					ins_roll_index = ins_len;
-				if (strcmp(value, "mTheta") == 0)
-					ins_pitch_index = ins_len;
-				if (strcmp(value, "mPsi") == 0)
-					ins_heading_index = ins_len;
-				if (strcmp(value, "mDepth") == 0)
-					ins_sonardepth_index = ins_len;
-				if (strcmp(value, "mDepthK") == 0)
-					ins_sonardepth_index = ins_len;
-				if (strcmp(value, "mRollK") == 0)
-					ins_roll_index = ins_len;
-				if (strcmp(value, "mPitchK") == 0)
-					ins_pitch_index = ins_len;
-				if (strcmp(value, "mHeadK") == 0)
-					ins_heading_index = ins_len;
-				if (strcmp(value, "mAltitude") == 0)
-					ins_altitude_index = ins_len;
-				if (strcmp(value, "mWaterSpeed") == 0)
-					ins_speed_index = ins_len;
-				if (strcmp(value, "mVbodyxK") == 0)
-					ins_velocityx_index = ins_len;
-				if (strcmp(value, "mVbodyyK") == 0)
-					ins_velocityy_index = ins_len;
-				if (strcmp(value, "mVbodyzK") == 0)
-					ins_velocityz_index = ins_len;
-
-				if (strcmp(type, "double") == 0)
-					ins_len += 8;
-				else if (strcmp(type, "integer") == 0)
-					ins_len += 4;
-				else if (strcmp(type, "timeTag") == 0)
-					ins_len += 8;
-				}
-			}
-
-		/* count the binary data records described by the header
-			then rewind the file to the start of the binary data */
-		startdata = ftell(tfp);
-		nins = 0;
-		while (fread(buffer, ins_len, 1, tfp) == 1)
-			{
-			nins++;
-			}
-		fseek(tfp, startdata, 0);
-
-		/* allocate arrays for ins data */
-		if (nins > 0)
-		    {
-		    status = mb_mallocd(verbose, __FILE__, __LINE__, nins * sizeof(double), (void **)&ins_time_d,&error);
-		    if (error == MB_ERROR_NO_ERROR)
-		    	status = mb_mallocd(verbose, __FILE__, __LINE__, nins * sizeof(double), (void **)&ins_lon,&error);
-		    if (error == MB_ERROR_NO_ERROR)
-		    	status = mb_mallocd(verbose, __FILE__, __LINE__, nins * sizeof(double), (void **)&ins_lat,&error);
-		    if (error == MB_ERROR_NO_ERROR)
-		    	status = mb_mallocd(verbose, __FILE__, __LINE__, nins * sizeof(double), (void **)&ins_heading,&error);
-		    if (error == MB_ERROR_NO_ERROR)
-		    	status = mb_mallocd(verbose, __FILE__, __LINE__, nins * sizeof(double), (void **)&ins_roll,&error);
-		    if (error == MB_ERROR_NO_ERROR)
-		    	status = mb_mallocd(verbose, __FILE__, __LINE__, nins * sizeof(double), (void **)&ins_pitch,&error);
-		    if (error == MB_ERROR_NO_ERROR)
-		    	status = mb_mallocd(verbose, __FILE__, __LINE__, nins * sizeof(double), (void **)&ins_sonardepth,&error);
-		    if (error == MB_ERROR_NO_ERROR)
-		    	status = mb_mallocd(verbose, __FILE__, __LINE__, nins * sizeof(double), (void **)&ins_sonardepthfilter,&error);
-		    if (error == MB_ERROR_NO_ERROR)
-		    	status = mb_mallocd(verbose, __FILE__, __LINE__, nins * sizeof(double), (void **)&ins_altitude_time_d,&error);
-		    if (error == MB_ERROR_NO_ERROR)
-		    	status = mb_mallocd(verbose, __FILE__, __LINE__, nins * sizeof(double), (void **)&ins_altitude,&error);
-		    if (error == MB_ERROR_NO_ERROR)
-		    	status = mb_mallocd(verbose, __FILE__, __LINE__, nins * sizeof(double), (void **)&ins_speed_time_d,&error);
-		    if (error == MB_ERROR_NO_ERROR)
-		    	status = mb_mallocd(verbose, __FILE__, __LINE__, nins * sizeof(double), (void **)&ins_speed,&error);
-		    if (error != MB_ERROR_NO_ERROR)
-			{
-			mb_error(verbose,error,&message);
-			fprintf(stderr,"\nMBIO Error allocating ins data arrays:\n%s\n",message);
-			fprintf(stderr,"\nProgram <%s> Terminated\n",
-				program_name);
-			exit(error);
-			}
-		    }
-
-		/* if no ins data then quit */
-		else
-		    {
-		    error = MB_ERROR_BAD_DATA;
-		    fprintf(stderr,"\nUnable to read data from MBARI AUV navigation file <%s>\n",insfile);
-		    fprintf(stderr,"\nProgram <%s> Terminated\n",
-			    program_name);
-		    exit(error);
-		    }
-
-		/* read the data points in the auv log file */
-		nins = 0;
-		nins_altitude = 0;
-		nins_speed = 0;
-		while (fread(buffer, ins_len, 1, tfp) == 1)
-			{
-			if (ins_time_d_index >= 0)
-				mb_get_binary_double(MB_YES, &buffer[ins_time_d_index], &(ins_time_d[nins]));
-
-			if (ins_lon_index >= 0)
-				mb_get_binary_double(MB_YES, &buffer[ins_lon_index], &(ins_lon[nins]));
-			ins_lon[nins] *= RTD;
-
-			if (ins_lat_index >= 0)
-				mb_get_binary_double(MB_YES, &buffer[ins_lat_index], &(ins_lat[nins]));
-			ins_lat[nins] *= RTD;
-
-			if (ins_roll_index >= 0)
-				mb_get_binary_double(MB_YES, &buffer[ins_roll_index], &(ins_roll[nins]));
-			ins_roll[nins] *= RTD;
-
-			if (ins_pitch_index >= 0)
-				mb_get_binary_double(MB_YES, &buffer[ins_pitch_index], &(ins_pitch[nins]));
-			ins_pitch[nins] *= RTD;
-
-			if (ins_heading_index >= 0)
-				mb_get_binary_double(MB_YES, &buffer[ins_heading_index], &(ins_heading[nins]));
-			ins_heading[nins] *= RTD;
-
-			if (ins_sonardepth_index >= 0)
-				mb_get_binary_double(MB_YES, &buffer[ins_sonardepth_index], &(ins_sonardepth[nins]));
-			ins_sonardepth[nins] += sonardepthoffset;
-
-			if (ins_altitude_index >= 0)
-				mb_get_binary_double(MB_YES, &buffer[ins_altitude_index], &(ins_altitude[nins_altitude]));
-			ins_altitude_time_d[nins_altitude] = ins_time_d[nins];
-
-			if (ins_speed_index >= 0)
-				mb_get_binary_double(MB_YES, &buffer[ins_speed_index], &(ins_speed[nins_speed]));
-			ins_speed_time_d[nins_speed] = ins_time_d[nins];
-
-			if (ins_velocityx_index >= 0 && ins_velocityy_index >= 0)
-				{
-				mb_get_binary_double(MB_YES, &buffer[ins_velocityx_index], &velocityx);
-				mb_get_binary_double(MB_YES, &buffer[ins_velocityy_index], &velocityy);
-				ins_speed[nins_speed] = sqrt(velocityx * velocityx + velocityy * velocityy);
-				ins_speed_time_d[nins_speed] = ins_time_d[nins];
-				}
-/*fprintf(stderr,"INS DATA: %f %f %f %f %f %f %f %f %f\n",
-ins_time_d[nins],
-ins_lon[nins],
-ins_lat[nins],
-ins_roll[nins],
-ins_pitch[nins],
-ins_heading[nins],
-ins_sonardepth[nins],
-ins_altitude[nins],
-ins_speed[nins]);*/
-			nins++;
-			if (ins_altitude[nins_altitude] < 1000.0)
-				nins_altitude++;
-			if (ins_speed[nins_speed] > 0.0)
-				nins_speed++;
-			}
-		fclose(tfp);
-
-		/* output info */
-		if (nins > 0)
-			{
-			mb_get_date(verbose, ins_time_d[0], btime_i);
-			mb_get_date(verbose, ins_time_d[nins-1], etime_i);
-			fprintf(stderr, "%d INS data records read from %s  Start:%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d  End:%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d\n",
-					nins, insfile,
-					btime_i[0], btime_i[1], btime_i[2], btime_i[3], btime_i[4], btime_i[5], btime_i[6],
-					etime_i[0], etime_i[1], etime_i[2], etime_i[3], etime_i[4], etime_i[5], etime_i[6]);
-			}
-		else
-			fprintf(stderr, "No INS data read from %s....\n",insfile);
-		}
-
-	/* read navigation and attitude data from rock file if specified */
-	if (rockdata == MB_YES)
-		{
-		/* count the data points in the rock file */
-		if ((tfp = fopen(rockfile, "r")) == NULL)
-			{
-			error = MB_ERROR_OPEN_FAIL;
-			fprintf(stderr,"\nUnable to open rock data file <%s> for reading\n",rockfile);
-			fprintf(stderr,"\nProgram <%s> Terminated\n",
-				program_name);
-			exit(error);
-			}
-
-		/* count the data records */
-		nrock = 0;
-		while ((result = fgets(buffer,MB_PATH_MAXLINE,tfp)) == buffer)
-			if (buffer[0] != '#')
-			    nrock++;
-		rewind(tfp);
-
-		/* allocate arrays for rock data */
-		if (nrock > 0)
-		    {
-		    status = mb_mallocd(verbose, __FILE__, __LINE__, nrock * sizeof(double), (void **)&rock_time_d,&error);
-		    if (error == MB_ERROR_NO_ERROR)
-		    	status = mb_mallocd(verbose, __FILE__, __LINE__, nrock * sizeof(double), (void **)&rock_lon,&error);
-		    if (error == MB_ERROR_NO_ERROR)
-		    	status = mb_mallocd(verbose, __FILE__, __LINE__, nrock * sizeof(double), (void **)&rock_lat,&error);
-		    if (error == MB_ERROR_NO_ERROR)
-		    	status = mb_mallocd(verbose, __FILE__, __LINE__, nrock * sizeof(double), (void **)&rock_sonardepth,&error);
-		    if (error == MB_ERROR_NO_ERROR)
-		    	status = mb_mallocd(verbose, __FILE__, __LINE__, nrock * sizeof(double), (void **)&rock_sonardepthfilter,&error);
-		    if (error == MB_ERROR_NO_ERROR)
-		    	status = mb_mallocd(verbose, __FILE__, __LINE__, nrock * sizeof(double), (void **)&rock_heading,&error);
-		    if (error == MB_ERROR_NO_ERROR)
-		    	status = mb_mallocd(verbose, __FILE__, __LINE__, nrock * sizeof(double), (void **)&rock_roll,&error);
-		    if (error == MB_ERROR_NO_ERROR)
-		    	status = mb_mallocd(verbose, __FILE__, __LINE__, nrock * sizeof(double), (void **)&rock_pitch,&error);
-		    if (error != MB_ERROR_NO_ERROR)
-			{
-			mb_error(verbose,error,&message);
-			fprintf(stderr,"\nMBIO Error allocating rock data arrays:\n%s\n",message);
-			fprintf(stderr,"\nProgram <%s> Terminated\n",
-				program_name);
-			exit(error);
-			}
-		    }
-
-		/* if no rock data then quit */
-		else
-		    {
-		    error = MB_ERROR_BAD_DATA;
-		    fprintf(stderr,"\nUnable to read data from rock file <%s>\n",rockfile);
-		    fprintf(stderr,"\nProgram <%s> Terminated\n",
-			    program_name);
-		    exit(error);
-		    }
-
-		/* read the data points in the rock file */
-		nrock = 0;
-		while ((result = fgets(buffer,MB_PATH_MAXLINE,tfp)) == buffer)
-			{
-			if (buffer[0] != '#')
-			    if (sscanf(buffer,"%lf %lf %lf %lf %lf %lf %lf",
-					&rock_time_d[nrock], &rock_lon[nrock], &rock_lat[nrock], &rock_sonardepth[nrock],
-					&rock_heading[nrock], &rock_roll[nrock], &rock_pitch[nrock]) == 7)
-			    	{
-/*fprintf(stderr,"ROCK DATA: %f %f %f %f %f %f\n",
-rock_time_d[nrock],
-rock_lon[nrock],
-rock_lat[nrock],
-rock_sonardepth[nrock],
-rock_heading[nrock],
-rock_roll[nrock],
-rock_pitch[nrock],
-rock_heading[nrock]);*/
-			    	nrock++;
-				}
-			}
-		fclose(tfp);
-
-		/* output info */
-		if (nrock > 0)
-			{
-			mb_get_date(verbose, rock_time_d[0], btime_i);
-			mb_get_date(verbose, rock_time_d[nrock-1], etime_i);
-			fprintf(stderr, "%d Rock format nav records read from %s  Start:%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d  End:%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d\n",
-					nrock, rockfile,
-					btime_i[0], btime_i[1], btime_i[2], btime_i[3], btime_i[4], btime_i[5], btime_i[6],
-					etime_i[0], etime_i[1], etime_i[2], etime_i[3], etime_i[4], etime_i[5], etime_i[6]);
-			}
-		else
-			fprintf(stderr, "No Rock format nav data read from %s....\n",rockfile);
-		}
-
-	/* read navigation and attitude data from dsl file if specified */
-	if (dsldata == MB_YES)
-		{
-		/* count the data points in the dsl file */
-		if ((tfp = fopen(dslfile, "r")) == NULL)
-			{
-			error = MB_ERROR_OPEN_FAIL;
-			fprintf(stderr,"\nUnable to open dsl data file <%s> for reading\n",dslfile);
-			fprintf(stderr,"\nProgram <%s> Terminated\n",
-				program_name);
-			exit(error);
-			}
-
-		/* count the data records */
-		ndsl = 0;
-		while ((result = fgets(buffer,MB_PATH_MAXLINE,tfp)) == buffer)
-			if (buffer[0] != '#')
-			    ndsl++;
-		rewind(tfp);
-
-		/* allocate arrays for dsl data */
-		if (ndsl > 0)
-		    {
-		    status = mb_mallocd(verbose, __FILE__, __LINE__, ndsl * sizeof(double), (void **)&dsl_time_d,&error);
-		    if (error == MB_ERROR_NO_ERROR)
-		    	status = mb_mallocd(verbose, __FILE__, __LINE__, ndsl * sizeof(double), (void **)&dsl_lon,&error);
-		    if (error == MB_ERROR_NO_ERROR)
-		    	status = mb_mallocd(verbose, __FILE__, __LINE__, ndsl * sizeof(double), (void **)&dsl_lat,&error);
-		    if (error == MB_ERROR_NO_ERROR)
-		    	status = mb_mallocd(verbose, __FILE__, __LINE__, ndsl * sizeof(double), (void **)&dsl_sonardepth,&error);
-		    if (error == MB_ERROR_NO_ERROR)
-		    	status = mb_mallocd(verbose, __FILE__, __LINE__, ndsl * sizeof(double), (void **)&dsl_sonardepthfilter,&error);
-		    if (error == MB_ERROR_NO_ERROR)
-		    	status = mb_mallocd(verbose, __FILE__, __LINE__, ndsl * sizeof(double), (void **)&dsl_heading,&error);
-		    if (error == MB_ERROR_NO_ERROR)
-		    	status = mb_mallocd(verbose, __FILE__, __LINE__, ndsl * sizeof(double), (void **)&dsl_roll,&error);
-		    if (error == MB_ERROR_NO_ERROR)
-		    	status = mb_mallocd(verbose, __FILE__, __LINE__, ndsl * sizeof(double), (void **)&dsl_pitch,&error);
-		    if (error != MB_ERROR_NO_ERROR)
-			{
-			mb_error(verbose,error,&message);
-			fprintf(stderr,"\nMBIO Error allocating dsl data arrays:\n%s\n",message);
-			fprintf(stderr,"\nProgram <%s> Terminated\n",
-				program_name);
-			exit(error);
-			}
-		    }
-
-		/* if no dsl data then quit */
-		else
-		    {
-		    error = MB_ERROR_BAD_DATA;
-		    fprintf(stderr,"\nUnable to read data from dsl file <%s>\n",dslfile);
-		    fprintf(stderr,"\nProgram <%s> Terminated\n",
-			    program_name);
-		    exit(error);
-		    }
-
-		/* read the data points in the dsl file */
-		ndsl = 0;
-		while ((result = fgets(buffer,MB_PATH_MAXLINE,tfp)) == buffer)
-			{
-			if (buffer[0] != '#')
-			    {
-			    nscan = sscanf(buffer,"PPL %d/%d/%d %d:%d:%lf %s %lf %lf %lf %lf %lf %lf %lf",
-			    		&year, &month, &day, &hour, &minute, &second,
-					sensor, &dsl_lat[ndsl], &dsl_lon[ndsl], &dsl_sonardepth[ndsl],
-					&dsl_heading[ndsl], &dsl_pitch[ndsl], &dsl_roll[ndsl], &id);
-/* fprintf(stderr,"nscan:%d year:%d month:%d day:%d hour:%d minute:%d second:%f sensor:%s %f %f %f %f %f %f %f\n",
-nscan,year,month,day,hour,minute,second,sensor,dsl_lat[ndsl], dsl_lon[ndsl], dsl_sonardepth[ndsl],
-dsl_heading[ndsl], dsl_pitch[ndsl], dsl_roll[ndsl], id); */
-			    if (nscan == 14)
-			    	{
-				time_i[0] = year;
-				time_i[1] = month;
-				time_i[2] = day;
-				time_i[3] = hour;
-				time_i[4] = minute;
-				time_i[5] = (int)second;
-				time_i[6] = (int)((second - time_i[5]) * 1000000);
-				mb_get_time(verbose, time_i, &dsl_time_d[ndsl]);
-/* fprintf(stderr,"dsl DATA: %f %f %f %f %f %f %f %f\n",
-dsl_time_d[ndsl],
-dsl_lon[ndsl],
-dsl_lat[ndsl],
-dsl_sonardepth[ndsl],
-dsl_heading[ndsl],
-dsl_roll[ndsl],
-dsl_pitch[ndsl],
-dsl_heading[ndsl]); */
-			    	ndsl++;
-				}
-			    }
-			}
-		fclose(tfp);
-
-		/* output info */
-		if (ndsl > 0)
-			{
-			mb_get_date(verbose, dsl_time_d[0], btime_i);
-			mb_get_date(verbose, dsl_time_d[ndsl-1], etime_i);
-			fprintf(stderr, "%d DLS format nav records read from %s  Start:%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d  End:%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d\n",
-					ndsl, dslfile,
-					btime_i[0], btime_i[1], btime_i[2], btime_i[3], btime_i[4], btime_i[5], btime_i[6],
-					etime_i[0], etime_i[1], etime_i[2], etime_i[3], etime_i[4], etime_i[5], etime_i[6]);
-			}
-		else
-			fprintf(stderr, "No DSL format nav data read from %s....\n",dslfile);
-		}
-
-	/* read sonardepth data from AUV log file if specified */
-	if (sonardepthdata == MB_YES)
-		{
-		/* count the data points in the auv log file */
-		if ((tfp = fopen(sonardepthfile, "r")) == NULL)
-			{
-			error = MB_ERROR_OPEN_FAIL;
-			fprintf(stderr,"\nUnable to open sonardepth data file <%s> for reading\n",sonardepthfile);
-			fprintf(stderr,"\nProgram <%s> Terminated\n",
-				program_name);
-			exit(error);
-			}
-
-		/* read the ascii header to determine how to parse the binary data */
-		sonardepth_len = 0;
-		while ((result = fgets(buffer,MB_PATH_MAXLINE,tfp)) == buffer
-			&& strncmp(buffer, "# begin",7) != 0)
-			{
-			nscan = sscanf(buffer, "# %s %s", type, value);
-			if (nscan == 2)
-				{
-				if (strcmp(value, "time") == 0)
-					sonardepth_time_d_index = sonardepth_len;
-				if (strcmp(value, "depth") == 0)
-					sonardepth_sonardepth_index = sonardepth_len;
-
-				if (strcmp(type, "double") == 0)
-					sonardepth_len += 8;
-				else if (strcmp(type, "integer") == 0)
-					sonardepth_len += 4;
-				else if (strcmp(type, "timeTag") == 0)
-					sonardepth_len += 8;
-				}
-			}
-
-		/* count the binary data records described by the header
-			then rewind the file to the start of the binary data */
-		startdata = ftell(tfp);
-		nsonardepth = 0;
-		while (fread(buffer, sonardepth_len, 1, tfp) == 1)
-			{
-			nsonardepth++;
-			}
-		fseek(tfp, startdata, 0);
-
-		/* allocate arrays for sonardepth data */
-		if (nsonardepth > 0)
-		    {
-		    status = mb_mallocd(verbose, __FILE__, __LINE__, nsonardepth * sizeof(double), (void **)&sonardepth_time_d,&error);
-		    if (error == MB_ERROR_NO_ERROR)
-		    	status = mb_mallocd(verbose, __FILE__, __LINE__, nsonardepth * sizeof(double), (void **)&sonardepth_sonardepth,&error);
-		    if (error == MB_ERROR_NO_ERROR)
-		    	status = mb_mallocd(verbose, __FILE__, __LINE__, nsonardepth * sizeof(double), (void **)&sonardepth_sonardepthfilter,&error);
-		    if (error != MB_ERROR_NO_ERROR)
-			{
-			mb_error(verbose,error,&message);
-			fprintf(stderr,"\nMBIO Error allocating sonardepth data arrays:\n%s\n",message);
-			fprintf(stderr,"\nProgram <%s> Terminated\n",
-				program_name);
-			exit(error);
-			}
-		    }
-
-		/* if no sonardepth data then quit */
-		else
-		    {
-		    error = MB_ERROR_BAD_DATA;
-		    fprintf(stderr,"\nUnable to read data from MBARI AUV sonardepth file <%s>\n",sonardepthfile);
-		    fprintf(stderr,"\nProgram <%s> Terminated\n",
-			    program_name);
-		    exit(error);
-		    }
-
-		/* read the data points in the auv log file */
-		nsonardepth = 0;
-		while (fread(buffer, sonardepth_len, 1, tfp) == 1)
-			{
-			mb_get_binary_double(MB_YES, &buffer[sonardepth_time_d_index], &(sonardepth_time_d[nsonardepth]));
-			mb_get_binary_double(MB_YES, &buffer[sonardepth_sonardepth_index], &(sonardepth_sonardepth[nsonardepth]));
-/*fprintf(stderr,"SONARDEPTH DATA: %f %f\n",
-sonardepth_time_d[nsonardepth],
-sonardepth_sonardepth[nsonardepth]);*/
-			sonardepth_sonardepth[nsonardepth] += sonardepthoffset;
-			nsonardepth++;
-			}
-		fclose(tfp);
-
-		/* output info */
-		if (nsonardepth > 0)
-			{
-			mb_get_date(verbose, sonardepth_time_d[0], btime_i);
-			mb_get_date(verbose, sonardepth_time_d[nsonardepth-1], etime_i);
-			fprintf(stderr, "%d sonardepth records read from %s  Start:%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d  End:%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d\n",
-					nsonardepth, sonardepthfile,
-					btime_i[0], btime_i[1], btime_i[2], btime_i[3], btime_i[4], btime_i[5], btime_i[6],
-					etime_i[0], etime_i[1], etime_i[2], etime_i[3], etime_i[4], etime_i[5], etime_i[6]);
-			}
-		else
-			fprintf(stderr, "No sonardepth data read from %s....\n",sonardepthfile);
-		}
-
-	/* get time lag model if specified */
-	if (timelagmode == MB7KPREPROCESS_TIMELAG_MODEL)
-		{
-		/* count the data points in the timelag file */
-		ntimelag = 0;
-		if ((tfp = fopen(timelagfile, "r")) == NULL)
-			{
-			error = MB_ERROR_OPEN_FAIL;
-			fprintf(stderr,"\nUnable to open time lag model File <%s> for reading\n",timelagfile);
-			fprintf(stderr,"\nProgram <%s> Terminated\n",
-				program_name);
-			exit(error);
-			}
-		while ((result = fgets(buffer,MB_PATH_MAXLINE,tfp)) == buffer)
-			if (buffer[0] != '#')
-			    ntimelag++;
-		rewind(tfp);
-
-		/* allocate arrays for time lag */
-		if (ntimelag > 0)
-		    {
-		    status = mb_mallocd(verbose, __FILE__, __LINE__,ntimelag * sizeof(double), (void **)&timelag_time_d,&error);
-		    if (error == MB_ERROR_NO_ERROR)
-		    	status = mb_mallocd(verbose, __FILE__, __LINE__,ntimelag * sizeof(double), (void **)&timelag_model,&error);
-		    if (error != MB_ERROR_NO_ERROR)
-			{
-			mb_error(verbose,error,&message);
-			fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",message);
-			fprintf(stderr,"\nProgram <%s> Terminated\n",
-				program_name);
-			exit(error);
-			}
-		    }
-
-		/* if no time lag data then quit */
-		else
-		    {
-		    error = MB_ERROR_BAD_DATA;
-		    fprintf(stderr,"\nUnable to read data from time lag model file <%s>\n",timelagfile);
-		    fprintf(stderr,"\nProgram <%s> Terminated\n",
-			    program_name);
-		    exit(error);
-		    }
-
-		/* read the data points in the timelag file */
-		ntimelag = 0;
-		while ((result = fgets(buffer,MB_PATH_MAXLINE,tfp)) == buffer)
-		    {
-		    if (buffer[0] != '#')
-			{
-			/* read the time and time lag pair */
-			if (sscanf(buffer,"%lf %lf",&timelag_time_d[ntimelag],&timelag_model[ntimelag]) == 2)
-			    ntimelag++;
-			}
-		    }
-		fclose(tfp);
-
-		/* output info */
-		if (ntimelag > 0)
-			{
-			mb_get_date(verbose, timelag_time_d[0], btime_i);
-			mb_get_date(verbose, timelag_time_d[ntimelag-1], etime_i);
-			fprintf(stderr, "%d timelag records read from %s  Start:%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d  End:%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d\n",
-					ntimelag, timelagfile,
-					btime_i[0], btime_i[1], btime_i[2], btime_i[3], btime_i[4], btime_i[5], btime_i[6],
-					etime_i[0], etime_i[1], etime_i[2], etime_i[3], etime_i[4], etime_i[5], etime_i[6]);
-			}
-		else
-			fprintf(stderr, "No timelag data read from %s....\n",timelagfile);
-		}
-
-	/* null tfp - allows detection of whether time delay file was opened, which only happens for MBARI AUV
-		data with navigation and attitude in "bluefin" records */
-	tfp = NULL;
-	
-	/* load platform definition if specified or if offsets otherwise specified create a platform structure */
-	if (use_platform_file == MB_YES)
-		{
-		status = mb_platform_read(verbose, platform_file, (void **)&platform, &error);
-		if (status == MB_FAILURE)
-			{
-			error = MB_ERROR_OPEN_FAIL;
-			fprintf(stderr,"\nUnable to open and parse platform file: %s\n", platform_file);
-			fprintf(stderr,"\nProgram <%s> Terminated\n", program_name);
-			exit(error);				
-			}
-		}
-	else if (use_depthsensoroff == MB_YES || sonar_offset_mode == MB_YES)
-		{
-		status = mb_platform_init(verbose, MB_PLATFORM_NONE, NULL, NULL,
-						0, 1, 2, 3, 3, 3, 
-						(void **)&platform, &error);
-			
-		/* set sensor 0 (multibeam) */
-		if (status == MB_SUCCESS)
-			status = mb_platform_add_sensor(verbose, (void **)&platform,
-					MB_SENSOR_TYPE_SONAR_MULTIBEAM,
-					NULL,
-					NULL,
-					NULL,
-					0, 0,
-					1, 0,
-					&error);
-		if (status == MB_SUCCESS)
-			status = mb_platform_add_sensor_offset(verbose, (void **)&platform,
-					0, 0,
-					MB7KPREPROCESS_TIMELAG_OFF,
-					0.0,
-					0,
-					NULL,
-					NULL,
-					sonar_offset_mode,
-					sonar_offset_x,
-					sonar_offset_y,
-					sonar_offset_z,   
-					sonar_offset_mode,
-					sonar_offset_heading,
-					sonar_offset_roll,
-					sonar_offset_pitch,
-					&error);
-			
-		/* set sensor 1 (position) */
-		if (status == MB_SUCCESS)
-			status = mb_platform_add_sensor(verbose, (void **)&platform,
-					MB_SENSOR_TYPE_POSITION,
-					NULL,
-					NULL,
-					NULL,
-					0, 0,
-					1, ntimelag,
-					&error);
-		if (status == MB_SUCCESS)
-			status = mb_platform_add_sensor_offset(verbose, (void **)&platform,
-					1, 0,
-					timelagmode,
-					timelagconstant,
-					ntimelag,
-					timelag_time_d,
-					timelag_model,
-					navigation_offset_mode,
-					navigation_offset_x,
-					navigation_offset_y,
-					navigation_offset_z,   
-					navigation_offset_mode,
-					navigation_offset_heading,
-					navigation_offset_roll,
-					navigation_offset_pitch,
-					&error);
-			
-		/* set sensor 2 (sensor depth) */
-		if (status == MB_SUCCESS)
-			status = mb_platform_add_sensor(verbose, (void **)&platform,
-					MB_SENSOR_TYPE_POSITION,
-					NULL,
-					NULL,
-					NULL,
-					0, 0,
-					1, ntimelag,
-					&error);
-		if (status == MB_SUCCESS)
-			status = mb_platform_add_sensor_offset(verbose, (void **)&platform,
-					2, 0,
-					timelagmode,
-					timelagconstant,
-					ntimelag,
-					timelag_time_d,
-					timelag_model,
-					use_depthsensoroff,
-					depthsensoroffx,
-					depthsensoroffy,
-					depthsensoroffz,   
-					0,
-					0.0,
-					0.0,
-					0.0,
-					&error);
-			
-		/* set sensor 3 (attitude) */
-		if (status == MB_SUCCESS)
-			status = mb_platform_add_sensor(verbose, (void **)&platform,
-					MB_SENSOR_TYPE_VRU,
-					NULL,
-					NULL,
-					NULL,
-					0, 0,
-					1, ntimelag,
-					&error);
-		if (status == MB_SUCCESS)
-			status = mb_platform_add_sensor_offset(verbose, (void **)&platform,
-					3, 0,
-					timelagmode,
-					timelagconstant,
-					ntimelag,
-					timelag_time_d,
-					timelag_model,
-					vru_offset_mode,
-					vru_offset_x,
-					vru_offset_y,
-					vru_offset_z,   
-					vru_offset_mode,
-					vru_offset_heading,
-					vru_offset_roll,
-					vru_offset_pitch,
-					&error);
-		
-		/* deal with error */
-		if (status == MB_FAILURE)
-			{
-			error = MB_ERROR_OPEN_FAIL;
-			fprintf(stderr,"\nUnable to initialize platform offset structure\n");
-			fprintf(stderr,"\nProgram <%s> Terminated\n", program_name);
-			exit(error);				
-			}
-		}
-
-	/* get format if required */
-	if (format == 0)
-		mb_get_format(verbose,read_file,NULL,&format,&error);
-
-	/* determine whether to read one file or a list of files */
-	if (format < 0)
-		read_datalist = MB_YES;
-
-	/* open file list */
-	if (read_datalist == MB_YES)
-	    {
-	    if ((status = mb_datalist_open(verbose,&datalist,
-					    read_file,look_processed,&error)) != MB_SUCCESS)
-		{
-		error = MB_ERROR_OPEN_FAIL;
-		fprintf(stderr,"\nUnable to open data list file: %s\n",
-			read_file);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-	    if ((status = mb_datalist_read(verbose,datalist,
-			    ifile,&format,&file_weight,&error))
-			    == MB_SUCCESS)
-		read_data = MB_YES;
-	    else
-		read_data = MB_NO;
-	    }
-	/* else copy single filename to be read */
-	else
-	    {
-	    strcpy(ifile, read_file);
-	    read_data = MB_YES;
-	    }
-
-	/* loop over all files to be read */
-	while (read_data == MB_YES && format == MBF_RESON7KR)
-	{
-
-	/* initialize reading the swath file */
-	if ((status = mb_read_init(
-		verbose,ifile,format,pings,lonflip,bounds,
-		btime_i,etime_i,speedmin,timegap,
-		&imbio_ptr,&btime_d,&etime_d,
-		&beams_bath,&beams_amp,&pixels_ss,&error)) != MB_SUCCESS)
-		{
-		mb_error(verbose,error,&message);
-		fprintf(stderr,"\nMBIO Error returned from function <mb_read_init>:\n%s\n",message);
-		fprintf(stderr,"\nMultibeam File <%s> not initialized for reading\n",ifile);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-
-	/* get pointers to data storage */
-	imb_io_ptr = (struct mb_io_struct *) imbio_ptr;
-	istore_ptr = imb_io_ptr->store_data;
-	istore = (struct mbsys_reson7k_struct *) istore_ptr;
-
-	if (error == MB_ERROR_NO_ERROR)
-		{
-		beamflag = NULL;
-		bath = NULL;
-		amp = NULL;
-		bathacrosstrack = NULL;
-		bathalongtrack = NULL;
-		ss = NULL;
-		ssacrosstrack = NULL;
-		ssalongtrack = NULL;
-		}
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(char), (void **)&beamflag, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(double), (void **)&bath, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_AMPLITUDE,
-						sizeof(double), (void **)&amp, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(double), (void **)&bathacrosstrack, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(double), (void **)&bathalongtrack, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_SIDESCAN,
-						sizeof(double), (void **)&ss, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_SIDESCAN,
-						sizeof(double), (void **)&ssacrosstrack, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_SIDESCAN,
-						sizeof(double), (void **)&ssalongtrack, &error);
-
-	/* if error initializing memory then quit */
-	if (error != MB_ERROR_NO_ERROR)
-		{
-		mb_error(verbose,error,&message);
-		fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",
-			message);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-
-	/* reset file record counters */
-	nrec_reference = 0;
-	nrec_sensoruncal = 0;
-	nrec_sensorcal = 0;
-	nrec_position = 0;
-	nrec_customattitude = 0;
-	nrec_tide = 0;
-	nrec_altitude = 0;
-	nrec_motion = 0;
-	nrec_depth = 0;
-	nrec_svp = 0;
-	nrec_ctd = 0;
-	nrec_geodesy = 0;
-	nrec_rollpitchheave = 0;
-	nrec_heading = 0;
-	nrec_surveyline = 0;
-	nrec_navigation = 0;
-	nrec_attitude = 0;
-	nrec_fsdwsslo = 0;
-	nrec_fsdwsshi = 0;
-	nrec_fsdwsbp = 0;
-	nrec_bluefinnav = 0;
-	nrec_bluefinenv = 0;
-	nrec_multibeam = 0;
-	nrec_volatilesettings = 0;
-	nrec_configuration = 0;
-	nrec_matchfilter = 0;
-	nrec_beamgeometry = 0;
-	nrec_calibration = 0;
-	nrec_bathymetry = 0;
-	nrec_backscatter = 0;
-	nrec_beam = 0;
-	nrec_verticaldepth = 0;
-	nrec_image = 0;
-	nrec_v2pingmotion = 0;
-	nrec_v2detectionsetup = 0;
-	nrec_v2beamformed = 0;
-	nrec_v2detection = 0;
-	nrec_v2rawdetection = 0;
-	nrec_v2snippet = 0;
-	nrec_calibratedsnippet = 0;
-	nrec_processedsidescan = 0;
-	nrec_installation = 0;
-	nrec_systemeventmessage = 0;
-	nrec_fileheader = 0;
-	nrec_remotecontrolsettings = 0;
-	nrec_other = 0;
-
-	/* read and print data */
-	reson_lastread = MB_NO;
-	sslo_lastread = MB_NO;
-	while (error <= MB_ERROR_NO_ERROR)
-		{
-		/* reset error */
-		error = MB_ERROR_NO_ERROR;
-
-		/* read next data record */
-		status = mb_get_all(verbose,imbio_ptr,&istore_ptr,&kind,
-				    time_i,&time_d,&navlon,&navlat,
-				    &speed,&heading,
-				    &distance,&altitude,&sonardepth,
-				    &beams_bath,&beams_amp,&pixels_ss,
-				    beamflag,bath,amp,bathacrosstrack,bathalongtrack,
-				    ss,ssacrosstrack,ssalongtrack,
-				    comment,&error);
-
-		/* some nonfatal errors do not matter */
-		if (error < MB_ERROR_NO_ERROR && error > MB_ERROR_UNINTELLIGIBLE)
-			{
-			error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-
-	   	/* handle multibeam data */
-		if (status == MB_SUCCESS && kind == MB_DATA_DATA)
-			{
-			nrec_multibeam++;
-
-			bathymetry = &(istore->bathymetry);
-			if (istore->read_volatilesettings == MB_YES)
-				nrec_volatilesettings++;
-			if (istore->read_matchfilter == MB_YES)
-				nrec_matchfilter++;
-			if (istore->read_beamgeometry == MB_YES)
-				nrec_beamgeometry++;
-			if (istore->read_remotecontrolsettings == MB_YES)
-				nrec_remotecontrolsettings++;
-			if (istore->read_bathymetry == MB_YES)
-				nrec_bathymetry++;
-			if (istore->read_backscatter == MB_YES)
-				nrec_backscatter++;
-			if (istore->read_beam == MB_YES)
-				nrec_beam++;
-			if (istore->read_verticaldepth == MB_YES)
-				nrec_verticaldepth++;
-			if (istore->read_image == MB_YES)
-				nrec_image++;
-			if (istore->read_v2pingmotion == MB_YES)
-				nrec_v2pingmotion++;
-			if (istore->read_v2detectionsetup == MB_YES)
-				nrec_v2detectionsetup++;
-			if (istore->read_v2beamformed == MB_YES)
-				nrec_v2beamformed++;
-			if (istore->read_v2detection == MB_YES)
-				nrec_v2detection++;
-			if (istore->read_v2rawdetection == MB_YES)
-				nrec_v2rawdetection++;
-			if (istore->read_v2snippet == MB_YES)
-				nrec_v2snippet++;
-			if (istore->read_calibratedsnippet == MB_YES)
-				nrec_calibratedsnippet++;
-			if (istore->read_processedsidescan == MB_YES)
-				nrec_processedsidescan++;
-
-			/* print out record headers */
-			if (istore->read_volatilesettings == MB_YES)
-				{
-				volatilesettings = &(istore->volatilesettings);
-				header = &(volatilesettings->header);
-				time_j[0] = header->s7kTime.Year;
-				time_j[1] = header->s7kTime.Day;
-				time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-				time_j[3] = (int) header->s7kTime.Seconds;
-				time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-				mb_get_itime(verbose, time_j, time_i);
-				mb_get_time(verbose, time_i, &time_d);
-				if (verbose > 0)
-				fprintf(stderr,"R7KRECID_7kVolatileSonarSettings:  7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d\n",
-					time_i[0],time_i[1],time_i[2],
-					time_i[3],time_i[4],time_i[5],time_i[6],
-					header->RecordNumber);
-				}
-			if (istore->read_matchfilter == MB_YES)
-				{
-				matchfilter = &(istore->matchfilter);
-				header = &(matchfilter->header);
-				time_j[0] = header->s7kTime.Year;
-				time_j[1] = header->s7kTime.Day;
-				time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-				time_j[3] = (int) header->s7kTime.Seconds;
-				time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-				mb_get_itime(verbose, time_j, time_i);
-				mb_get_time(verbose, time_i, &time_d);
-				if (verbose > 0)
-				fprintf(stderr,"R7KRECID_7kVolatileSonarSettings:  7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d\n",
-					time_i[0],time_i[1],time_i[2],
-					time_i[3],time_i[4],time_i[5],time_i[6],
-					header->RecordNumber);
-				}
-			if (istore->read_beamgeometry == MB_YES)
-				{
-				beamgeometry = &(istore->beamgeometry);
-				header = &(beamgeometry->header);
-				time_j[0] = header->s7kTime.Year;
-				time_j[1] = header->s7kTime.Day;
-				time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-				time_j[3] = (int) header->s7kTime.Seconds;
-				time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-				mb_get_itime(verbose, time_j, time_i);
-				mb_get_time(verbose, time_i, &time_d);
-				if (verbose > 0)
-				fprintf(stderr,"R7KRECID_7kBeamGeometry:           7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d beams:%d\n",
-					time_i[0],time_i[1],time_i[2],
-					time_i[3],time_i[4],time_i[5],time_i[6],
-					header->RecordNumber,beamgeometry->number_beams);
-				}
-			if (istore->read_remotecontrolsettings == MB_YES)
-				{
-				remotecontrolsettings = &(istore->remotecontrolsettings);
-				header = &(remotecontrolsettings->header);
-				time_j[0] = header->s7kTime.Year;
-				time_j[1] = header->s7kTime.Day;
-				time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-				time_j[3] = (int) header->s7kTime.Seconds;
-				time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-				mb_get_itime(verbose, time_j, time_i);
-				mb_get_time(verbose, time_i, &time_d);
-				if (verbose > 0)
-				fprintf(stderr,"R7KRECID_7kremotecontrolsettings:  7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d\n",
-					time_i[0],time_i[1],time_i[2],
-					time_i[3],time_i[4],time_i[5],time_i[6],
-					header->RecordNumber);
-				}
-			if (istore->read_bathymetry == MB_YES)
-				{
-				bathymetry = &(istore->bathymetry);
-				header = &(bathymetry->header);
-				time_j[0] = header->s7kTime.Year;
-				time_j[1] = header->s7kTime.Day;
-				time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-				time_j[3] = (int) header->s7kTime.Seconds;
-				time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-				mb_get_itime(verbose, time_j, time_i);
-				mb_get_time(verbose, time_i, &time_d);
-				if (verbose > 0)
-				fprintf(stderr,"R7KRECID_7kBathymetricData:        7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d ping:%d beams:%d\n",
-					time_i[0],time_i[1],time_i[2],
-					time_i[3],time_i[4],time_i[5],time_i[6],
-					header->RecordNumber,bathymetry->ping_number,bathymetry->number_beams);
-
-				/* allocate memory for bathymetry timetag arrays if needed */
-				if (nbatht == 0 || nbatht >= nbatht_alloc)
-					{
-					nbatht_alloc +=  MB7KPREPROCESS_ALLOC_CHUNK;
-					status = mb_reallocd(verbose,__FILE__,__LINE__,nbatht_alloc*sizeof(double),(void **)&batht_time_d,&error);
-					status = mb_reallocd(verbose,__FILE__,__LINE__,nbatht_alloc*sizeof(int),(void **)&batht_ping,&error);
-					status = mb_reallocd(verbose,__FILE__,__LINE__,nbatht_alloc*sizeof(double),(void **)&batht_time_d_new,&error);
-					status = mb_reallocd(verbose,__FILE__,__LINE__,nbatht_alloc*sizeof(double),(void **)&batht_time_offset,&error);
-					status = mb_reallocd(verbose,__FILE__,__LINE__,nbatht_alloc*sizeof(int),(void **)&batht_ping_offset,&error);
-					status = mb_reallocd(verbose,__FILE__,__LINE__,nbatht_alloc*sizeof(int),(void **)&batht_good_offset,&error);
-					if (error != MB_ERROR_NO_ERROR)
-						{
-						mb_error(verbose,error,&message);
-						fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",message);
-						fprintf(stderr,"\nProgram <%s> Terminated\n",
-						    program_name);
-						exit(error);
-						}
-					}
-
-				/* store the bathtech time stamp */
-				if (nbatht == 0 || time_d > batht_time_d[nbatht-1])
-					{
-					batht_time_d[nbatht] = time_d;
-					batht_ping[nbatht] = bathymetry->ping_number;
-
-					/* grab the last sslo ping if it was the last thing read */
-					if (nedget > 0)
-						{
-						batht_time_offset[nbatht] = sslo_last_time_d - time_d;
-						batht_ping_offset[nbatht] = sslo_last_ping - bathymetry->ping_number;
-						batht_good_offset[nbatht] = MB_YES;
-						}
-					else
-						{
-						batht_time_offset[nbatht] = -9999.99;
-						batht_ping_offset[nbatht] = 0;
-						batht_good_offset[nbatht] = MB_NO;
-						}
-					nbatht++;
-					}
-				}
-			if (istore->read_backscatter == MB_YES)
-				{
-				backscatter = &(istore->backscatter);
-				header = &(backscatter->header);
-				time_j[0] = header->s7kTime.Year;
-				time_j[1] = header->s7kTime.Day;
-				time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-				time_j[3] = (int) header->s7kTime.Seconds;
-				time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-				mb_get_itime(verbose, time_j, time_i);
-				mb_get_time(verbose, time_i, &time_d);
-				if (verbose > 0)
-				fprintf(stderr,"R7KRECID_7kBackscatterImageData:   7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d ping:%d samples:%d\n",
-					time_i[0],time_i[1],time_i[2],
-					time_i[3],time_i[4],time_i[5],time_i[6],
-					header->RecordNumber,backscatter->ping_number,backscatter->number_samples);
-				}
-			if (istore->read_beam == MB_YES)
-				{
-				beam = &(istore->beam);
-				header = &(beam->header);
-				time_j[0] = header->s7kTime.Year;
-				time_j[1] = header->s7kTime.Day;
-				time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-				time_j[3] = (int) header->s7kTime.Seconds;
-				time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-				mb_get_itime(verbose, time_j, time_i);
-				mb_get_time(verbose, time_i, &time_d);
-				if (verbose > 0)
-				fprintf(stderr,"R7KRECID_7kBeamData: 7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d ping:%d beams:%d samples:%d\n",
-					time_i[0],time_i[1],time_i[2],
-					time_i[3],time_i[4],time_i[5],time_i[6],
-					header->RecordNumber,beam->ping_number,beam->number_beams,beam->number_samples);
-				}
-			if (istore->read_verticaldepth == MB_YES)
-				{
-				verticaldepth = &(istore->verticaldepth);
-				header = &(verticaldepth->header);
-				time_j[0] = header->s7kTime.Year;
-				time_j[1] = header->s7kTime.Day;
-				time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-				time_j[3] = (int) header->s7kTime.Seconds;
-				time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-				mb_get_itime(verbose, time_j, time_i);
-				mb_get_time(verbose, time_i, &time_d);
-				if (verbose > 0)
-				fprintf(stderr,"R7KRECID_7kVerticalDepth: 7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d ping:%d\n",
-					time_i[0],time_i[1],time_i[2],
-					time_i[3],time_i[4],time_i[5],time_i[6],
-					header->RecordNumber,verticaldepth->ping_number);
-				}
-			if (istore->read_image == MB_YES)
-				{
-				image = &(istore->image);
-				header = &(image->header);
-				time_j[0] = header->s7kTime.Year;
-				time_j[1] = header->s7kTime.Day;
-				time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-				time_j[3] = (int) header->s7kTime.Seconds;
-				time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-				mb_get_itime(verbose, time_j, time_i);
-				mb_get_time(verbose, time_i, &time_d);
-				if (verbose > 0)
-				fprintf(stderr,"R7KRECID_7kImageData:              7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d ping:%d width:%d height:%d\n",
-					time_i[0],time_i[1],time_i[2],
-					time_i[3],time_i[4],time_i[5],time_i[6],
-					header->RecordNumber,image->ping_number,image->width,image->height);
-				}
-			if (istore->read_v2pingmotion == MB_YES)
-				{
-				v2pingmotion = &(istore->v2pingmotion);
-				header = &(v2pingmotion->header);
-				time_j[0] = header->s7kTime.Year;
-				time_j[1] = header->s7kTime.Day;
-				time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-				time_j[3] = (int) header->s7kTime.Seconds;
-				time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-				mb_get_itime(verbose, time_j, time_i);
-				mb_get_time(verbose, time_i, &time_d);
-				if (verbose > 0)
-				fprintf(stderr,"R7KRECID_7kV2PingMotionData:        7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d ping:%d samples:%d\n",
-					time_i[0],time_i[1],time_i[2],
-					time_i[3],time_i[4],time_i[5],time_i[6],
-					header->RecordNumber,v2pingmotion->ping_number,v2pingmotion->n);
-				}
-			if (istore->read_v2detectionsetup == MB_YES)
-				{
-				v2detectionsetup = &(istore->v2detectionsetup);
-				header = &(v2detectionsetup->header);
-				time_j[0] = header->s7kTime.Year;
-				time_j[1] = header->s7kTime.Day;
-				time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-				time_j[3] = (int) header->s7kTime.Seconds;
-				time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-				mb_get_itime(verbose, time_j, time_i);
-				mb_get_time(verbose, time_i, &time_d);
-				if (verbose > 0)
-				fprintf(stderr,"R7KRECID_7kV2DetectionSetupData:    7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d ping:%d beams:%d\n",
-					time_i[0],time_i[1],time_i[2],
-					time_i[3],time_i[4],time_i[5],time_i[6],
-					header->RecordNumber,v2detectionsetup->ping_number,v2detectionsetup->number_beams);
-				}
-			if (istore->read_v2beamformed == MB_YES)
-				{
-				v2beamformed = &(istore->v2beamformed);
-				header = &(v2beamformed->header);
-				time_j[0] = header->s7kTime.Year;
-				time_j[1] = header->s7kTime.Day;
-				time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-				time_j[3] = (int) header->s7kTime.Seconds;
-				time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-				mb_get_itime(verbose, time_j, time_i);
-				mb_get_time(verbose, time_i, &time_d);
-				if (verbose > 0)
-				fprintf(stderr,"R7KRECID_7kV2BeamformedData:        7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d ping:%d beams:%d\n",
-					time_i[0],time_i[1],time_i[2],
-					time_i[3],time_i[4],time_i[5],time_i[6],
-					header->RecordNumber,v2beamformed->ping_number,v2beamformed->number_beams);
-				}
-			if (istore->read_v2detection == MB_YES)
-				{
-				v2detection = &(istore->v2detection);
-				header = &(v2detection->header);
-				time_j[0] = header->s7kTime.Year;
-				time_j[1] = header->s7kTime.Day;
-				time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-				time_j[3] = (int) header->s7kTime.Seconds;
-				time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-				mb_get_itime(verbose, time_j, time_i);
-				mb_get_time(verbose, time_i, &time_d);
-				if (verbose > 0)
-				fprintf(stderr,"R7KRECID_7kV2DetectionData:         7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d ping:%d beams:%d\n",
-					time_i[0],time_i[1],time_i[2],
-					time_i[3],time_i[4],time_i[5],time_i[6],
-					header->RecordNumber,v2detection->ping_number,v2detection->number_beams);
-				}
-			if (istore->read_v2rawdetection == MB_YES)
-				{
-				v2rawdetection = &(istore->v2rawdetection);
-				header = &(v2rawdetection->header);
-				time_j[0] = header->s7kTime.Year;
-				time_j[1] = header->s7kTime.Day;
-				time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-				time_j[3] = (int) header->s7kTime.Seconds;
-				time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-				mb_get_itime(verbose, time_j, time_i);
-				mb_get_time(verbose, time_i, &time_d);
-				if (verbose > 0)
-				fprintf(stderr,"R7KRECID_7kV2RawDetectionData:      7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d ping:%d beams:%d\n",
-					time_i[0],time_i[1],time_i[2],
-					time_i[3],time_i[4],time_i[5],time_i[6],
-					header->RecordNumber,v2rawdetection->ping_number,v2rawdetection->number_beams);
-				}
-			if (istore->read_v2snippet == MB_YES)
-				{
-				v2snippet = &(istore->v2snippet);
-				header = &(v2snippet->header);
-				time_j[0] = header->s7kTime.Year;
-				time_j[1] = header->s7kTime.Day;
-				time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-				time_j[3] = (int) header->s7kTime.Seconds;
-				time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-				mb_get_itime(verbose, time_j, time_i);
-				mb_get_time(verbose, time_i, &time_d);
-				if (verbose > 0)
-				fprintf(stderr,"R7KRECID_7kV2SnippetData:           7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d ping:%d beams:%d\n",
-					time_i[0],time_i[1],time_i[2],
-					time_i[3],time_i[4],time_i[5],time_i[6],
-					header->RecordNumber,v2snippet->ping_number,v2snippet->number_beams);
-				}
-			if (istore->read_calibratedsnippet == MB_YES)
-				{
-				calibratedsnippet = &(istore->calibratedsnippet);
-				header = &(calibratedsnippet->header);
-				time_j[0] = header->s7kTime.Year;
-				time_j[1] = header->s7kTime.Day;
-				time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-				time_j[3] = (int) header->s7kTime.Seconds;
-				time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-				mb_get_itime(verbose, time_j, time_i);
-				mb_get_time(verbose, time_i, &time_d);
-				if (verbose > 0)
-				fprintf(stderr,"R7KRECID_7kCalibratedSnippetData:           7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d ping:%d beams:%d\n",
-					time_i[0],time_i[1],time_i[2],
-					time_i[3],time_i[4],time_i[5],time_i[6],
-					header->RecordNumber,calibratedsnippet->ping_number,calibratedsnippet->number_beams);
-
-				}
-			if (istore->read_processedsidescan == MB_YES)
-				{
-				processedsidescan = &(istore->processedsidescan);
-				header = &(processedsidescan->header);
-				time_j[0] = header->s7kTime.Year;
-				time_j[1] = header->s7kTime.Day;
-				time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-				time_j[3] = (int) header->s7kTime.Seconds;
-				time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-				mb_get_itime(verbose, time_j, time_i);
-				mb_get_time(verbose, time_i, &time_d);
-				if (verbose > 0)
-				fprintf(stderr,"R7KRECID_7kProcessedSidescanData:   7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d ping:%d pixels:%d\n",
-					time_i[0],time_i[1],time_i[2],
-					time_i[3],time_i[4],time_i[5],time_i[6],
-					header->RecordNumber,processedsidescan->ping_number,processedsidescan->number_pixels);
-				}
-			}
-
-	   	/* handle reference point data */
-		else if (status == MB_SUCCESS && istore->type == R7KRECID_ReferencePoint)
-			{
-			nrec_reference++;
-
-			reference = &(istore->reference);
-			header = &(reference->header);
-			time_j[0] = header->s7kTime.Year;
-			time_j[1] = header->s7kTime.Day;
-			time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-			time_j[3] = (int) header->s7kTime.Seconds;
-			time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-			mb_get_itime(verbose, time_j, time_i);
-			mb_get_time(verbose, time_i, &time_d);
-			if (verbose > 0)
-				fprintf(stderr,"R7KRECID_ReferencePoint: 7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d\n",
-				time_i[0],time_i[1],time_i[2],
-				time_i[3],time_i[4],time_i[5],time_i[6],
-				header->RecordNumber);
-			}
-
-	   	/* handle uncalibrated sensor offset data */
-		else if (status == MB_SUCCESS && istore->type == R7KRECID_UncalibratedSensorOffset)
-			{
-			nrec_sensoruncal++;
-
-			sensoruncal = &(istore->sensoruncal);
-			header = &(sensoruncal->header);
-			time_j[0] = header->s7kTime.Year;
-			time_j[1] = header->s7kTime.Day;
-			time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-			time_j[3] = (int) header->s7kTime.Seconds;
-			time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-			mb_get_itime(verbose, time_j, time_i);
-			mb_get_time(verbose, time_i, &time_d);
-			if (verbose > 0)
-				fprintf(stderr,"R7KRECID_UncalibratedSensorOffset: 7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d\n",
-				time_i[0],time_i[1],time_i[2],
-				time_i[3],time_i[4],time_i[5],time_i[6],
-				header->RecordNumber);
-			}
-
-	   	/* handle calibrated sensor offset data */
-		else if (status == MB_SUCCESS && istore->type == R7KRECID_CalibratedSensorOffset)
-			{
-			nrec_sensorcal++;
-
-			sensorcal = &(istore->sensorcal);
-			header = &(sensorcal->header);
-			time_j[0] = header->s7kTime.Year;
-			time_j[1] = header->s7kTime.Day;
-			time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-			time_j[3] = (int) header->s7kTime.Seconds;
-			time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-			mb_get_itime(verbose, time_j, time_i);
-			mb_get_time(verbose, time_i, &time_d);
-			if (verbose > 0)
-				fprintf(stderr,"R7KRECID_CalibratedSensorOffset: 7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d\n",
-				time_i[0],time_i[1],time_i[2],
-				time_i[3],time_i[4],time_i[5],time_i[6],
-				header->RecordNumber);
-			}
-
-	   	/* handle position data */
-		else if (status == MB_SUCCESS && istore->type == R7KRECID_Position)
-			{
-			nrec_position++;
-
-			position = &(istore->position);
-			header = &(position->header);
-			time_j[0] = header->s7kTime.Year;
-			time_j[1] = header->s7kTime.Day;
-			time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-			time_j[3] = (int) header->s7kTime.Seconds;
-			time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-			mb_get_itime(verbose, time_j, time_i);
-			mb_get_time(verbose, time_i, &time_d);
-
-			if (verbose > 0)
-				fprintf(stderr,"R7KRECID_Position: 7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d\n",
-			time_i[0],time_i[1],time_i[2],
-			time_i[3],time_i[4],time_i[5],time_i[6],
-			header->RecordNumber);
-
-			/* allocate memory for position arrays if needed */
-			if (ndat_nav + 1 >= ndat_nav_alloc)
-				{
-				ndat_nav_alloc +=  MB7KPREPROCESS_ALLOC_CHUNK;
-				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_nav_alloc*sizeof(double),(void **)&dat_nav_time_d,&error);
-				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_nav_alloc*sizeof(double),(void **)&dat_nav_lon,&error);
-				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_nav_alloc*sizeof(double),(void **)&dat_nav_lat,&error);
-				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_nav_alloc*sizeof(double),(void **)&dat_nav_speed,&error);
-				if (error != MB_ERROR_NO_ERROR)
-					{
-					mb_error(verbose,error,&message);
-					fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",message);
-					fprintf(stderr,"\nProgram <%s> Terminated\n",
-					    program_name);
-					exit(error);
-					}
-				}
-
-			/* store the position data */
-			if (ndat_nav == 0 || dat_nav_time_d[ndat_nav-1] < time_d)
-				{
-				dat_nav_time_d[ndat_nav] = time_d + position->latency;
-				dat_nav_lon[ndat_nav] = RTD * position->longitude;
-				dat_nav_lat[ndat_nav] = RTD * position->latitude;
-				dat_nav_speed[ndat_nav] = 0.0;
-				ndat_nav++;
-				}
-
-			}
-
-	   	/* handle customattitude data */
-		else if (status == MB_SUCCESS && istore->type == R7KRECID_CustomAttitude)
-			{
-			nrec_customattitude++;
-
-			customattitude = &(istore->customattitude);
-			header = &(customattitude->header);
-			time_j[0] = header->s7kTime.Year;
-			time_j[1] = header->s7kTime.Day;
-			time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-			time_j[3] = (int) header->s7kTime.Seconds;
-			time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-			mb_get_itime(verbose, time_j, time_i);
-			mb_get_time(verbose, time_i, &time_d);
-
-			if (verbose > 0)
-				fprintf(stderr,"R7KRECID_CustomAttitude: 7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d\n",
-			time_i[0],time_i[1],time_i[2],
-			time_i[3],time_i[4],time_i[5],time_i[6],
-			header->RecordNumber);
-
-			/* allocate memory for customattitude arrays if needed */
-			if (ndat_rph + customattitude->n >= ndat_rph_alloc)
-				{
-				ndat_rph_alloc += MAX(MB7KPREPROCESS_ALLOC_CHUNK, customattitude->n);
-				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_rph_alloc*sizeof(double),(void **)&dat_rph_time_d,&error);
-				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_rph_alloc*sizeof(double),(void **)&dat_rph_roll,&error);
-				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_rph_alloc*sizeof(double),(void **)&dat_rph_pitch,&error);
-				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_rph_alloc*sizeof(double),(void **)&dat_rph_heave,&error);
-				if (error != MB_ERROR_NO_ERROR)
-					{
-					mb_error(verbose,error,&message);
-					fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",message);
-					fprintf(stderr,"\nProgram <%s> Terminated\n",
-					    program_name);
-					exit(error);
-					}
-				}
-
-			/* store the customattitude data */
-			for (i=0;i<customattitude->n;i++)
-				{
-				if (ndat_rph == 0 || dat_rph_time_d[ndat_rph-1] < time_d)
-					{
-					dat_rph_time_d[ndat_rph] = time_d + i / customattitude->frequency;
-					dat_rph_roll[ndat_rph] = RTD * customattitude->roll[i];
-					dat_rph_pitch[ndat_rph] = RTD * customattitude->pitch[i];
-					dat_rph_heave[ndat_rph] = customattitude->heave[i];
-					ndat_rph++;
-					}
-				}
-			}
-
-	   	/* handle tide data */
-		else if (status == MB_SUCCESS && istore->type == R7KRECID_Tide)
-			{
-			nrec_tide++;
-
-			tide = &(istore->tide);
-			header = &(fileheader->header);
-			time_j[0] = header->s7kTime.Year;
-			time_j[1] = header->s7kTime.Day;
-			time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-			time_j[3] = (int) header->s7kTime.Seconds;
-			time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-			mb_get_itime(verbose, time_j, time_i);
-			mb_get_time(verbose, time_i, &time_d);
-			if (verbose > 0)
-				fprintf(stderr,"R7KRECID_Tide: 7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d\n",
-				time_i[0],time_i[1],time_i[2],
-				time_i[3],time_i[4],time_i[5],time_i[6],
-				header->RecordNumber);
-			}
-
-	   	/* handle altitude data */
-		else if (status == MB_SUCCESS && istore->type == R7KRECID_Altitude)
-			{
-			nrec_altitude++;
-
-			altituderec = &(istore->altitude);
-			header = &(fileheader->header);
-			time_j[0] = header->s7kTime.Year;
-			time_j[1] = header->s7kTime.Day;
-			time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-			time_j[3] = (int) header->s7kTime.Seconds;
-			time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-			mb_get_itime(verbose, time_j, time_i);
-			mb_get_time(verbose, time_i, &time_d);
-			if (verbose > 0)
-				fprintf(stderr,"R7KRECID_Altitude: 7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d\n",
-				time_i[0],time_i[1],time_i[2],
-				time_i[3],time_i[4],time_i[5],time_i[6],
-				header->RecordNumber);
-
-			/* allocate memory for altitude arrays if needed */
-			if (ndat_altitude + 1 >= ndat_altitude_alloc)
-				{
-				ndat_altitude_alloc +=  MB7KPREPROCESS_ALLOC_CHUNK;
-				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_altitude_alloc*sizeof(double),(void **)&dat_altitude_time_d,&error);
-				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_altitude_alloc*sizeof(double),(void **)&dat_altitude_altitude,&error);
-				if (error != MB_ERROR_NO_ERROR)
-					{
-					mb_error(verbose,error,&message);
-					fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",message);
-					fprintf(stderr,"\nProgram <%s> Terminated\n",
-					    program_name);
-					exit(error);
-					}
-				}
-
-			/* store the altitude data */
-			if (ndat_altitude == 0 || dat_altitude_time_d[ndat_altitude-1] < time_d)
-				{
-				dat_altitude_time_d[ndat_altitude] = time_d;
-				dat_altitude_altitude[ndat_altitude] = altituderec->altitude;
-				ndat_altitude++;
-				}
-			}
-
-	   	/* handle motion data */
-		else if (status == MB_SUCCESS && istore->type == R7KRECID_MotionOverGround)
-			{
-			nrec_motion++;
-
-			motion = &(istore->motion);
-			header = &(motion->header);
-			time_j[0] = header->s7kTime.Year;
-			time_j[1] = header->s7kTime.Day;
-			time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-			time_j[3] = (int) header->s7kTime.Seconds;
-			time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-			mb_get_itime(verbose, time_j, time_i);
-			mb_get_time(verbose, time_i, &time_d);
-			if (verbose > 0)
-				fprintf(stderr,"R7KRECID_MotionOverGround: 7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d n:%d\n",
-				time_i[0],time_i[1],time_i[2],
-				time_i[3],time_i[4],time_i[5],time_i[6],
-				header->RecordNumber,motion->n);
-			}
-
-	   	/* handle depth data */
-		else if (status == MB_SUCCESS && istore->type == R7KRECID_Depth)
-			{
-			nrec_depth++;
-
-			depth = &(istore->depth);
-			header = &(depth->header);
-			time_j[0] = header->s7kTime.Year;
-			time_j[1] = header->s7kTime.Day;
-			time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-			time_j[3] = (int) header->s7kTime.Seconds;
-			time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-			mb_get_itime(verbose, time_j, time_i);
-			mb_get_time(verbose, time_i, &time_d);
-			if (verbose > 0)
-				fprintf(stderr,"R7KRECID_Depth: 7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d\n",
-				time_i[0],time_i[1],time_i[2],
-				time_i[3],time_i[4],time_i[5],time_i[6],
-				header->RecordNumber);
-
-			/* allocate memory for sonar depth arrays if needed */
-			if (ndat_sonardepth + 1 >= ndat_sonardepth_alloc)
-				{
-				ndat_sonardepth_alloc +=  MB7KPREPROCESS_ALLOC_CHUNK;
-				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_sonardepth_alloc*sizeof(double),(void **)&dat_sonardepth_time_d,&error);
-				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_sonardepth_alloc*sizeof(double),(void **)&dat_sonardepth_sonardepth,&error);
-				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_sonardepth_alloc*sizeof(double),(void **)&dat_sonardepth_sonardepthfilter,&error);
-				if (error != MB_ERROR_NO_ERROR)
-					{
-					mb_error(verbose,error,&message);
-					fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",message);
-					fprintf(stderr,"\nProgram <%s> Terminated\n",
-					    program_name);
-					exit(error);
-					}
-				}
-
-			/* store the sonar depth data */
-			if (ndat_sonardepth == 0 || dat_sonardepth_time_d[ndat_sonardepth-1] < time_d)
-				{
-				dat_sonardepth_time_d[ndat_sonardepth] = time_d;
-				dat_sonardepth_sonardepth[ndat_sonardepth] = depth->depth;
-				dat_sonardepth_sonardepthfilter[ndat_sonardepth] = 0.0;
-				ndat_sonardepth++;
-				}
-			}
-
-	   	/* handle sound velocity data */
-		else if (status == MB_SUCCESS && istore->type == R7KRECID_SoundVelocityProfile)
-			{
-			nrec_svp++;
-
-			svp = &(istore->svp);
-			header = &(svp->header);
-			time_j[0] = header->s7kTime.Year;
-			time_j[1] = header->s7kTime.Day;
-			time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-			time_j[3] = (int) header->s7kTime.Seconds;
-			time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-			mb_get_itime(verbose, time_j, time_i);
-			mb_get_time(verbose, time_i, &time_d);
-			if (verbose > 0)
-				fprintf(stderr,"R7KRECID_SoundVelocityProfile: 7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d n:%d\n",
-				time_i[0],time_i[1],time_i[2],
-				time_i[3],time_i[4],time_i[5],time_i[6],
-				header->RecordNumber,svp->n);
-			}
-
-	   	/* handle ctd data */
-		else if (status == MB_SUCCESS && istore->type == R7KRECID_CTD)
-			{
-			nrec_ctd++;
-
-			ctd = &(istore->ctd);
-			header = &(ctd->header);
-			time_j[0] = header->s7kTime.Year;
-			time_j[1] = header->s7kTime.Day;
-			time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-			time_j[3] = (int) header->s7kTime.Seconds;
-			time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-			mb_get_itime(verbose, time_j, time_i);
-			mb_get_time(verbose, time_i, &time_d);
-
-			if (verbose > 0)
-				fprintf(stderr,"R7KRECID_CTD: 7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d n:%d\n",
-			time_i[0],time_i[1],time_i[2],
-			time_i[3],time_i[4],time_i[5],time_i[6],
-			header->RecordNumber,ctd->n);
-			}
-
-	   	/* handle geodesy data */
-		else if (status == MB_SUCCESS && istore->type == R7KRECID_Geodesy)
-			{
-			nrec_geodesy++;
-
-			geodesy = &(istore->geodesy);
-			header = &(geodesy->header);
-			time_j[0] = header->s7kTime.Year;
-			time_j[1] = header->s7kTime.Day;
-			time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-			time_j[3] = (int) header->s7kTime.Seconds;
-			time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-			mb_get_itime(verbose, time_j, time_i);
-			mb_get_time(verbose, time_i, &time_d);
-
-			if (verbose > 0)
-				fprintf(stderr,"R7KRECID_Geodesy: 7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d\n",
-			time_i[0],time_i[1],time_i[2],
-			time_i[3],time_i[4],time_i[5],time_i[6],
-			header->RecordNumber);
-			}
-
-	   	/* handle rollpitchheave data */
-		else if (status == MB_SUCCESS && istore->type == R7KRECID_RollPitchHeave)
-			{
-			nrec_rollpitchheave++;
-
-			rollpitchheave = &(istore->rollpitchheave);
-			header = &(rollpitchheave->header);
-			time_j[0] = header->s7kTime.Year;
-			time_j[1] = header->s7kTime.Day;
-			time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-			time_j[3] = (int) header->s7kTime.Seconds;
-			time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-			mb_get_itime(verbose, time_j, time_i);
-			mb_get_time(verbose, time_i, &time_d);
-
-			if (verbose > 0)
-				fprintf(stderr,"R7KRECID_RollPitchHeave:               7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d\n",
-			time_i[0],time_i[1],time_i[2],
-			time_i[3],time_i[4],time_i[5],time_i[6],
-			header->RecordNumber);
-
-			/* allocate memory for rollpitchheave arrays if needed */
-			if (ndat_rph + 1 >= ndat_rph_alloc)
-				{
-				ndat_rph_alloc +=  MB7KPREPROCESS_ALLOC_CHUNK;
-				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_rph_alloc*sizeof(double),(void **)&dat_rph_time_d,&error);
-				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_rph_alloc*sizeof(double),(void **)&dat_rph_roll,&error);
-				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_rph_alloc*sizeof(double),(void **)&dat_rph_pitch,&error);
-				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_rph_alloc*sizeof(double),(void **)&dat_rph_heave,&error);
-				if (error != MB_ERROR_NO_ERROR)
-					{
-					mb_error(verbose,error,&message);
-					fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",message);
-					fprintf(stderr,"\nProgram <%s> Terminated\n",
-					    program_name);
-					exit(error);
-					}
-				}
-
-			/* store the rollpitchheave data */
-			if (ndat_rph == 0 || dat_rph_time_d[ndat_rph-1] < time_d)
-				{
-				dat_rph_time_d[ndat_rph] = time_d;
-				dat_rph_roll[ndat_rph] = RTD * rollpitchheave->roll;
-				dat_rph_pitch[ndat_rph] = RTD * rollpitchheave->pitch;
-				dat_rph_heave[ndat_rph] = rollpitchheave->heave;
-				ndat_rph++;
-				}
-
-			}
-
-	   	/* handle heading data */
-		else if (status == MB_SUCCESS && istore->type == R7KRECID_Heading)
-			{
-			nrec_heading++;
-
-			headingrec = &(istore->heading);
-			header = &(headingrec->header);
-			time_j[0] = header->s7kTime.Year;
-			time_j[1] = header->s7kTime.Day;
-			time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-			time_j[3] = (int) header->s7kTime.Seconds;
-			time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-			mb_get_itime(verbose, time_j, time_i);
-			mb_get_time(verbose, time_i, &time_d);
-			if (verbose > 0)
-				fprintf(stderr,"R7KRECID_Heading: 7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d\n",
-				time_i[0],time_i[1],time_i[2],
-				time_i[3],time_i[4],time_i[5],time_i[6],
-				header->RecordNumber);
-
-			/* allocate memory for sonar heading arrays if needed */
-			if (ndat_heading + 1 >= ndat_heading_alloc)
-				{
-				ndat_heading_alloc +=  MB7KPREPROCESS_ALLOC_CHUNK;
-				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_heading_alloc*sizeof(double),(void **)&dat_heading_time_d,&error);
-				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_heading_alloc*sizeof(double),(void **)&dat_heading_heading,&error);
-				if (error != MB_ERROR_NO_ERROR)
-					{
-					mb_error(verbose,error,&message);
-					fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",message);
-					fprintf(stderr,"\nProgram <%s> Terminated\n",
-					    program_name);
-					exit(error);
-					}
-				}
-
-			/* store the sonar heading data */
-			if (ndat_heading == 0 || dat_heading_time_d[ndat_heading-1] < time_d)
-				{
-				dat_heading_time_d[ndat_heading] = time_d;
-				dat_heading_heading[ndat_heading] = RTD * headingrec->heading;
-				ndat_heading++;
-				}
-			}
-
-	   	/* handle survey line data */
-		else if (status == MB_SUCCESS && istore->type == R7KRECID_SurveyLine)
-			{
-			nrec_surveyline++;
-
-			surveyline = &(istore->surveyline);
-			header = &(surveyline->header);
-			time_j[0] = header->s7kTime.Year;
-			time_j[1] = header->s7kTime.Day;
-			time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-			time_j[3] = (int) header->s7kTime.Seconds;
-			time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-			mb_get_itime(verbose, time_j, time_i);
-			mb_get_time(verbose, time_i, &time_d);
-
-			if (verbose > 0)
-				fprintf(stderr,"R7KRECID_SurveyLine: 7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d\n",
-			time_i[0],time_i[1],time_i[2],
-			time_i[3],time_i[4],time_i[5],time_i[6],
-			header->RecordNumber);
-			}
-
-	   	/* handle navigation data */
-		else if (status == MB_SUCCESS && istore->type == R7KRECID_Navigation)
-			{
-			nrec_navigation++;
-
-			navigation = &(istore->navigation);
-			header = &(navigation->header);
-			time_j[0] = header->s7kTime.Year;
-			time_j[1] = header->s7kTime.Day;
-			time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-			time_j[3] = (int) header->s7kTime.Seconds;
-			time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-			mb_get_itime(verbose, time_j, time_i);
-			mb_get_time(verbose, time_i, &time_d);
-
-			if (verbose > 0)
-				fprintf(stderr,"R7KRECID_Navigation: 7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d\n",
-			time_i[0],time_i[1],time_i[2],
-			time_i[3],time_i[4],time_i[5],time_i[6],
-			header->RecordNumber);
-
-			/* allocate memory for position arrays if needed */
-			if (ndat_nav + 1 >= ndat_nav_alloc)
-				{
-				ndat_nav_alloc +=  MB7KPREPROCESS_ALLOC_CHUNK;
-				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_nav_alloc*sizeof(double),(void **)&dat_nav_time_d,&error);
-				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_nav_alloc*sizeof(double),(void **)&dat_nav_lon,&error);
-				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_nav_alloc*sizeof(double),(void **)&dat_nav_lat,&error);
-				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_nav_alloc*sizeof(double),(void **)&dat_nav_speed,&error);
-				if (error != MB_ERROR_NO_ERROR)
-					{
-					mb_error(verbose,error,&message);
-					fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",message);
-					fprintf(stderr,"\nProgram <%s> Terminated\n",
-					    program_name);
-					exit(error);
-					}
-				}
-
-			/* store the navigation data */
-			if (ndat_nav == 0 || dat_nav_time_d[ndat_nav-1] < time_d)
-				{
-				dat_nav_time_d[ndat_nav] = time_d;
-				dat_nav_lon[ndat_nav] = RTD * navigation->longitude;
-				dat_nav_lat[ndat_nav] = RTD * navigation->latitude;
-				dat_nav_speed[ndat_nav] = navigation->speed;
-				ndat_nav++;
-				}
-
-			/* allocate memory for sonar heading arrays if needed */
-			if (ndat_heading + 1 >= ndat_heading_alloc)
-				{
-				ndat_heading_alloc +=  MB7KPREPROCESS_ALLOC_CHUNK;
-				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_heading_alloc*sizeof(double),(void **)&dat_heading_time_d,&error);
-				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_heading_alloc*sizeof(double),(void **)&dat_heading_heading,&error);
-				if (error != MB_ERROR_NO_ERROR)
-					{
-					mb_error(verbose,error,&message);
-					fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",message);
-					fprintf(stderr,"\nProgram <%s> Terminated\n",
-					    program_name);
-					exit(error);
-					}
-				}
-
-			/* store the sonar heading data */
-			if (ndat_heading == 0 || dat_heading_time_d[ndat_heading-1] < time_d)
-				{
-				dat_heading_time_d[ndat_heading] = time_d;
-				dat_heading_heading[ndat_heading] = RTD * navigation->heading;
-				ndat_heading++;
-				}
-			}
-
-	   	/* handle attitude data */
-		else if (status == MB_SUCCESS && istore->type == R7KRECID_Attitude)
-			{
-			nrec_attitude++;
-
-			attitude = &(istore->attitude);
-			header = &(attitude->header);
-			time_j[0] = header->s7kTime.Year;
-			time_j[1] = header->s7kTime.Day;
-			time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-			time_j[3] = (int) header->s7kTime.Seconds;
-			time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-			mb_get_itime(verbose, time_j, time_i);
-			mb_get_time(verbose, time_i, &time_d);
-
-			if (verbose > 0)
-				fprintf(stderr,"R7KRECID_Attitude: 7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d n:%d\n",
-			time_i[0],time_i[1],time_i[2],
-			time_i[3],time_i[4],time_i[5],time_i[6],
-			header->RecordNumber,attitude->n);
-
-			/* allocate memory for attitude arrays if needed */
-			if (ndat_rph + attitude->n >= ndat_rph_alloc)
-				{
-				ndat_rph_alloc += MB7KPREPROCESS_ALLOC_CHUNK;
-				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_rph_alloc*sizeof(double),(void **)&dat_rph_time_d,&error);
-				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_rph_alloc*sizeof(double),(void **)&dat_rph_roll,&error);
-				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_rph_alloc*sizeof(double),(void **)&dat_rph_pitch,&error);
-				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_rph_alloc*sizeof(double),(void **)&dat_rph_heave,&error);
-				if (error != MB_ERROR_NO_ERROR)
-					{
-					mb_error(verbose,error,&message);
-					fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",message);
-					fprintf(stderr,"\nProgram <%s> Terminated\n",
-					    program_name);
-					exit(error);
-					}
-				}
-
-			/* store the attitude data */
-			for (i=0;i<attitude->n;i++)
-				{
-				if (ndat_rph == 0 || dat_rph_time_d[ndat_rph-1] < time_d)
-					{
-					dat_rph_time_d[ndat_rph] = time_d + i * attitude->delta_time[i];
-					dat_rph_roll[ndat_rph] = RTD * attitude->roll[i];
-					dat_rph_pitch[ndat_rph] = RTD * attitude->pitch[i];
-					dat_rph_heave[ndat_rph] = attitude->heave[i];
-					ndat_rph++;
-					}
-				}
-			}
-
-	   	/* handle file header data */
-		else if (status == MB_SUCCESS && istore->type == R7KRECID_7kFileHeader)
-			{
-			nrec_fileheader++;
-
-			fileheader = &(istore->fileheader);
-			header = &(fileheader->header);
-			time_j[0] = header->s7kTime.Year;
-			time_j[1] = header->s7kTime.Day;
-			time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-			time_j[3] = (int) header->s7kTime.Seconds;
-			time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-			mb_get_itime(verbose, time_j, time_i);
-			mb_get_time(verbose, time_i, &time_d);
-			if (verbose > 0)
-				fprintf(stderr,"R7KRECID_7kFileHeader: 7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d\n",
-				time_i[0],time_i[1],time_i[2],
-				time_i[3],time_i[4],time_i[5],time_i[6],
-				header->RecordNumber);
-			}
-
-	   	/* handle installation data */
-		else if (status == MB_SUCCESS && istore->type == R7KRECID_7kInstallationParameters)
-			{
-			nrec_installation++;
-
-			installation = &(istore->installation);
-			header = &(installation->header);
-			time_j[0] = header->s7kTime.Year;
-			time_j[1] = header->s7kTime.Day;
-			time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-			time_j[3] = (int) header->s7kTime.Seconds;
-			time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-			mb_get_itime(verbose, time_j, time_i);
-			mb_get_time(verbose, time_i, &time_d);
-			if (verbose > 0)
-				fprintf(stderr,"R7KRECID_7kInstallationParameters: 7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d\n",
-				time_i[0],time_i[1],time_i[2],
-				time_i[3],time_i[4],time_i[5],time_i[6],
-				header->RecordNumber);
-
-			if (platform == NULL)
-				{
-				status = mb_platform_init(verbose, MB_PLATFORM_NONE, NULL, NULL,
-								0, 1, 1, 2, 2, 2, 
-								(void **)&platform, &error);
-					
-				/* set sensor 0 (multibeam) */
-				if (status == MB_SUCCESS)
-					status = mb_platform_add_sensor(verbose, (void **)&platform,
-							MB_SENSOR_TYPE_SONAR_MULTIBEAM,
-							NULL,
-							NULL,
-							NULL,
-							0, 0,
-							2, 0,
-							&error);
-				if (status == MB_SUCCESS)
-					status = mb_platform_add_sensor_offset(verbose, (void **)&platform,
-							0, 0,
-							MB7KPREPROCESS_TIMELAG_OFF,
-							0.0,
-							0,
-							NULL,
-							NULL,
-							MB_SENSOR_POSITION_OFFSET_STATIC,
-							(double) installation->transmit_x,
-							(double) installation->transmit_y,
-							(double) installation->transmit_z,   
-							MB_SENSOR_ATTITUDE_OFFSET_STATIC,
-							(double) installation->transmit_heading,
-							(double) installation->transmit_roll,
-							(double) installation->transmit_pitch,   
-							&error);
-				if (status == MB_SUCCESS)
-					status = mb_platform_add_sensor_offset(verbose, (void **)&platform,
-							0, 1,
-							MB7KPREPROCESS_TIMELAG_OFF,
-							0.0,
-							0,
-							NULL,
-							NULL,
-							MB_SENSOR_POSITION_OFFSET_STATIC,
-							(double) installation->receive_x,
-							(double) installation->receive_y,
-							(double) installation->receive_z,   
-							MB_SENSOR_ATTITUDE_OFFSET_STATIC,
-							(double) installation->receive_heading,
-							(double) installation->receive_roll,
-							(double) installation->receive_pitch,   
-							&error);
-					
-				/* set sensor 1 (position) */
-				if (status == MB_SUCCESS)
-					status = mb_platform_add_sensor(verbose, (void **)&platform,
-							MB_SENSOR_TYPE_POSITION,
-							NULL,
-							NULL,
-							NULL,
-							0, 0,
-							1, ntimelag,
-							&error);
-				if (status == MB_SUCCESS)
-					{
-					if (timelagmode == MB7KPREPROCESS_TIMELAG_OFF
-						&& installation->position_time_delay != 0)
-						status = mb_platform_add_sensor_offset(verbose, (void **)&platform,
-								1, 0,
-								MB7KPREPROCESS_TIMELAG_CONSTANT,
-								(double)(0.001 * installation->position_time_delay),
-								0,
-								NULL,
-								NULL,
-								MB_SENSOR_POSITION_OFFSET_STATIC,
-								(double) installation->position_x,
-								(double) installation->position_y,
-								(double) installation->position_z,   
-								MB_SENSOR_ATTITUDE_OFFSET_NONE,
-								(double) 0.0,
-								(double) 0.0,
-								(double) 0.0,   
-								&error);
-					else
-						status = mb_platform_add_sensor_offset(verbose, (void **)&platform,
-								1, 0,
-								timelagmode,
-								timelagconstant,
-								ntimelag,
-								timelag_time_d,
-								timelag_model,
-								MB_SENSOR_POSITION_OFFSET_STATIC,
-								(double) installation->position_x,
-								(double) installation->position_y,
-								(double) installation->position_z,   
-								MB_SENSOR_ATTITUDE_OFFSET_NONE,
-								(double) 0.0,
-								(double) 0.0,
-								(double) 0.0,   
-								&error);
-					}
-					
-				/* set sensor 2 (motion sensor) */
-				if (status == MB_SUCCESS)
-					status = mb_platform_add_sensor(verbose, (void **)&platform,
-							MB_SENSOR_TYPE_VRU,
-							NULL,
-							NULL,
-							NULL,
-							0, 0,
-							1, ntimelag,
-							&error);
-				if (status == MB_SUCCESS)
-					{
-					if (timelagmode == MB7KPREPROCESS_TIMELAG_OFF
-						&& installation->motion_time_delay != 0)
-						status = mb_platform_add_sensor_offset(verbose, (void **)&platform,
-								2, 0,
-								MB7KPREPROCESS_TIMELAG_CONSTANT,
-								(double)(0.001 * installation->motion_time_delay),
-								0,
-								NULL,
-								NULL,
-								MB_SENSOR_POSITION_OFFSET_STATIC,
-								(double) installation->motion_x,
-								(double) installation->motion_y,
-								(double) installation->motion_z,   
-								MB_SENSOR_ATTITUDE_OFFSET_STATIC,
-								(double) installation->motion_heading,
-								(double) installation->motion_roll,
-								(double) installation->motion_pitch,   
-								&error);
-					else
-						status = mb_platform_add_sensor_offset(verbose, (void **)&platform,
-								2, 0,
-								timelagmode,
-								timelagconstant,
-								ntimelag,
-								timelag_time_d,
-								timelag_model,
-								MB_SENSOR_POSITION_OFFSET_STATIC,
-								(double) installation->motion_x,
-								(double) installation->motion_y,
-								(double) installation->motion_z,   
-								MB_SENSOR_ATTITUDE_OFFSET_STATIC,
-								(double) installation->motion_heading,
-								(double) installation->motion_roll,
-								(double) installation->motion_pitch,   
-								&error);
-					}
-				
-				/* deal with error */
-				if (status == MB_FAILURE)
-					{
-					error = MB_ERROR_OPEN_FAIL;
-					fprintf(stderr,"\nUnable to initialize platform offset structure\n");
-					fprintf(stderr,"\nProgram <%s> Terminated\n", program_name);
-					exit(error);				
-					}
-				}
-			}
-
-	   	/* handle bluefin ctd data */
-		else if (status == MB_SUCCESS && istore->type == R7KRECID_Bluefin && kind == MB_DATA_SSV)
-			{
-			nrec_bluefinenv++;
-			MBARIdata = MB_YES;
-
-			bluefin = &(istore->bluefin);
-			header = &(bluefin->header);
-			time_j[0] = header->s7kTime.Year;
-			time_j[1] = header->s7kTime.Day;
-			time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-			time_j[3] = (int) header->s7kTime.Seconds;
-			time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-			mb_get_itime(verbose, time_j, time_i);
-			mb_get_time(verbose, time_i, &time_d);
-
-			if (verbose > 0)
-				fprintf(stderr,"R7KRECID_BluefinEnvironmental: 7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d n:%d\n",
-			time_i[0],time_i[1],time_i[2],
-			time_i[3],time_i[4],time_i[5],time_i[6],
-			header->RecordNumber,bluefin->number_frames);
-			for (i=0;i<bluefin->number_frames;i++)
-				{
-				time_j[0] = bluefin->environmental[i].s7kTime.Year;
-				time_j[1] = bluefin->environmental[i].s7kTime.Day;
-				time_j[2] = 60 * bluefin->environmental[i].s7kTime.Hours + bluefin->environmental[i].s7kTime.Minutes;
-				time_j[3] = (int) bluefin->environmental[i].s7kTime.Seconds;
-				time_j[4] = (int) (1000000 * (bluefin->environmental[i].s7kTime.Seconds - time_j[3]));
-				mb_get_itime(verbose, time_j, time_i);
-				if (verbose > 0)
-				fprintf(stderr,"                       %2.2d          7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) CTD_time:%f T_time:%f\n",
-					i,time_i[0],time_i[1],time_i[2],
-					time_i[3],time_i[4],time_i[5],time_i[6],
-					bluefin->environmental[i].ctd_time,
-					bluefin->environmental[i].temperature_time);
-				}
-			}
-
-	   	/* handle bluefin nav data */
-		else if (status == MB_SUCCESS && istore->type == R7KRECID_Bluefin && kind == MB_DATA_NAV2)
-			{
-			nrec_bluefinnav++;
-			MBARIdata = MB_YES;
-
-			bluefin = &(istore->bluefin);
-			header = &(bluefin->header);
-			time_j[0] = header->s7kTime.Year;
-			time_j[1] = header->s7kTime.Day;
-			time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-			time_j[3] = (int) header->s7kTime.Seconds;
-			time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-			mb_get_itime(verbose, time_j, time_i);
-			mb_get_time(verbose, time_i, &time_d);
-
-			/* apply time delay from MBARI AUV if not set and data are pre-2012 */
-			if (timedelaymode == MB7KPREPROCESS_TIMEDELAY_UNDEFINED
-			    && header->s7kTime.Year < 2012)
-				timedelaymode = MB7KPREPROCESS_TIMEDELAY_ON;
-			else if (timedelaymode == MB7KPREPROCESS_TIMEDELAY_UNDEFINED)
-				timedelaymode = MB7KPREPROCESS_TIMEDELAY_OFF;
-
-			/* output time delay from MBARI AUV */
-			if (tfp == NULL)
-				{
-				/* open file for timedelay values */
-				sprintf(timedelayfile, "%s_timedelay.txt", read_file);
-				if ((tfp = fopen(timedelayfile, "w")) == NULL)
-					{
-					error = MB_ERROR_OPEN_FAIL;
-					fprintf(stderr,"\nUnable to open time delay file <%s> for writing\n",timedelayfile);
-					fprintf(stderr,"\nProgram <%s> Terminated\n",
-						program_name);
-					exit(error);
-					}
-				}
-
-			if (verbose > 0)
-				fprintf(stderr,"R7KRECID_BluefinNav: 7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d n:%d\n",
-			time_i[0],time_i[1],time_i[2],
-			time_i[3],time_i[4],time_i[5],time_i[6],
-			header->RecordNumber,bluefin->number_frames);
-			for (i=0;i<bluefin->number_frames;i++)
-				{
-				time_j[0] = bluefin->nav[i].s7kTime.Year;
-				time_j[1] = bluefin->nav[i].s7kTime.Day;
-				time_j[2] = 60 * bluefin->nav[i].s7kTime.Hours + bluefin->nav[i].s7kTime.Minutes;
-				time_j[3] = (int) bluefin->nav[i].s7kTime.Seconds;
-				time_j[4] = (int) (1000000 * (bluefin->nav[i].s7kTime.Seconds - time_j[3]));
-				mb_get_itime(verbose, time_j, time_i);
-				if (verbose > 0)
-				fprintf(stderr,"                       %2.2d          7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) Pos_time:%f\n",
-					i,time_i[0],time_i[1],time_i[2],
-					time_i[3],time_i[4],time_i[5],time_i[6],
-					bluefin->nav[i].position_time);
-
-				/* output time delay from MBARI AUV */
-				if (tfp != NULL)
-					{
-					fprintf(tfp,"%f %f\n",
-					bluefin->nav[i].position_time,(-0.001*(double)bluefin->nav[i].timedelay));
-					}
-				}
-
-			/* allocate memory for position arrays if needed */
-			if (bluefin->number_frames > 0
-				&& ndat_nav + bluefin->number_frames >= ndat_nav_alloc)
-				{
-				ndat_nav_alloc += MAX(MB7KPREPROCESS_ALLOC_CHUNK, bluefin->number_frames);
-				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_nav_alloc*sizeof(double),(void **)&dat_nav_time_d,&error);
-				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_nav_alloc*sizeof(double),(void **)&dat_nav_lon,&error);
-				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_nav_alloc*sizeof(double),(void **)&dat_nav_lat,&error);
-				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_nav_alloc*sizeof(double),(void **)&dat_nav_speed,&error);
-				if (error != MB_ERROR_NO_ERROR)
-					{
-					mb_error(verbose,error,&message);
-					fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",message);
-					fprintf(stderr,"\nProgram <%s> Terminated\n",
-					    program_name);
-					exit(error);
-					}
-				}
-
-			/* allocate memory for sonar heading arrays if needed */
-			if (bluefin->number_frames > 0
-				&& ndat_heading + bluefin->number_frames >= ndat_heading_alloc)
-				{
-				ndat_heading_alloc += MAX(MB7KPREPROCESS_ALLOC_CHUNK, bluefin->number_frames);
-				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_heading_alloc*sizeof(double),(void **)&dat_heading_time_d,&error);
-				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_heading_alloc*sizeof(double),(void **)&dat_heading_heading,&error);
-				if (error != MB_ERROR_NO_ERROR)
-					{
-					mb_error(verbose,error,&message);
-					fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",message);
-					fprintf(stderr,"\nProgram <%s> Terminated\n",
-					    program_name);
-					exit(error);
-					}
-				}
-
-			/* allocate memory for attitude arrays if needed */
-			if (bluefin->number_frames > 0
-				&& ndat_rph + bluefin->number_frames >= ndat_rph_alloc)
-				{
-				ndat_rph_alloc += MAX(MB7KPREPROCESS_ALLOC_CHUNK, bluefin->number_frames);
-				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_rph_alloc*sizeof(double),(void **)&dat_rph_time_d,&error);
-				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_rph_alloc*sizeof(double),(void **)&dat_rph_roll,&error);
-				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_rph_alloc*sizeof(double),(void **)&dat_rph_pitch,&error);
-				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_rph_alloc*sizeof(double),(void **)&dat_rph_heave,&error);
-				if (error != MB_ERROR_NO_ERROR)
-					{
-					mb_error(verbose,error,&message);
-					fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",message);
-					fprintf(stderr,"\nProgram <%s> Terminated\n",
-					    program_name);
-					exit(error);
-					}
-				}
-
-			/* allocate memory for altitude arrays if needed */
-			if (bluefin->number_frames > 0
-				&& ndat_altitude + bluefin->number_frames >= ndat_altitude_alloc)
-				{
-				ndat_altitude_alloc += MAX(MB7KPREPROCESS_ALLOC_CHUNK, bluefin->number_frames);
-				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_altitude_alloc*sizeof(double),(void **)&dat_altitude_time_d,&error);
-				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_altitude_alloc*sizeof(double),(void **)&dat_altitude_altitude,&error);
-				if (error != MB_ERROR_NO_ERROR)
-					{
-					mb_error(verbose,error,&message);
-					fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",message);
-					fprintf(stderr,"\nProgram <%s> Terminated\n",
-					    program_name);
-					exit(error);
-					}
-				}
-
-			/* allocate memory for sonar depth arrays if needed */
-			if (bluefin->number_frames > 0
-				&& ndat_sonardepth + bluefin->number_frames >= ndat_sonardepth_alloc)
-				{
-				ndat_sonardepth_alloc += MAX(MB7KPREPROCESS_ALLOC_CHUNK, bluefin->number_frames);
-				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_sonardepth_alloc*sizeof(double),(void **)&dat_sonardepth_time_d,&error);
-				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_sonardepth_alloc*sizeof(double),(void **)&dat_sonardepth_sonardepth,&error);
-				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_sonardepth_alloc*sizeof(double),(void **)&dat_sonardepth_sonardepthfilter,&error);
-				if (error != MB_ERROR_NO_ERROR)
-					{
-					mb_error(verbose,error,&message);
-					fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",message);
-					fprintf(stderr,"\nProgram <%s> Terminated\n",
-					    program_name);
-					exit(error);
-					}
-				}
-
-			if (bluefin->number_frames > 0
-				&& ntimedelay + bluefin->number_frames >= ntimedelay_alloc)
-				{
-				ntimedelay_alloc +=  MB7KPREPROCESS_ALLOC_CHUNK;
-				status = mb_reallocd(verbose,__FILE__,__LINE__,ntimedelay_alloc*sizeof(double),(void **)&timedelay_time_d,&error);
-				status = mb_reallocd(verbose,__FILE__,__LINE__,ntimedelay_alloc*sizeof(double),(void **)&timedelay_timedelay,&error);
-				}
-
-			/* store the navigation and attitude data */
-			for (i=0;i<bluefin->number_frames;i++)
-				{
-				/* store regular nav and attitude values */
-				if (ndat_nav == 0 || dat_nav_time_d[ndat_nav-1] < bluefin->nav[i].position_time)
-					{
-					dat_nav_time_d[ndat_nav] = bluefin->nav[i].position_time;
-					dat_nav_lon[ndat_nav] = RTD * bluefin->nav[i].longitude;
-					dat_nav_lat[ndat_nav] = RTD * bluefin->nav[i].latitude;
-					dat_nav_speed[ndat_nav] = bluefin->nav[i].speed;
-					ndat_nav++;
-					}
-				if (ndat_heading == 0 || dat_heading_time_d[ndat_heading-1] < bluefin->nav[i].position_time)
-					{
-					dat_heading_time_d[ndat_heading] = bluefin->nav[i].position_time;
-					dat_heading_heading[ndat_heading] = RTD * bluefin->nav[i].yaw;
-					ndat_heading++;
-					}
-				if (ndat_rph == 0 || dat_rph_time_d[ndat_rph-1] < bluefin->nav[i].position_time)
-					{
-					dat_rph_time_d[ndat_rph] = bluefin->nav[i].position_time;
-					dat_rph_roll[ndat_rph] = RTD * bluefin->nav[i].roll;
-					dat_rph_pitch[ndat_rph] = RTD * bluefin->nav[i].pitch;
-					dat_rph_heave[ndat_rph] = 0.0;
-					ndat_rph++;
-					}
-				if (ndat_altitude == 0 || dat_altitude_time_d[ndat_altitude-1] < bluefin->nav[i].position_time)
-					{
-					dat_altitude_time_d[ndat_altitude] = bluefin->nav[i].position_time;
-					dat_altitude_altitude[ndat_altitude] = bluefin->nav[i].altitude;
-					ndat_altitude++;
-					}
-				if (ndat_sonardepth == 0 || dat_sonardepth_time_d[ndat_sonardepth-1] < bluefin->nav[i].depth_time)
-					{
-					dat_sonardepth_time_d[ndat_sonardepth] = bluefin->nav[i].depth_time;
-					dat_sonardepth_sonardepth[ndat_sonardepth] = bluefin->nav[i].depth;
-					dat_sonardepth_sonardepthfilter[ndat_sonardepth] = 0.0;
-					ndat_sonardepth++;
-					}
-
-				/* deal with MBARI AUV time delay values */
-/*fprintf(stderr,"TIMEDELAYS: count:%d delay: %d",ntimedelaycount,bluefin->nav[i].timedelay);*/
-				if (ntimedelaycount == 0)
-					{
-					timedelay_time_d[ntimedelay] = bluefin->nav[i].position_time;
-					timedelay_timedelay[ntimedelay] = (-0.001 * (double)bluefin->nav[i].timedelay);
-/*fprintf(stderr,"   USED: %f",timedelay_timedelay[ntimedelay]);*/
-					ntimedelay++;
-					}
-				else if (timedelay_timedelay[ntimedelay-1]
-							> (-0.001 * (double)bluefin->nav[i].timedelay))
-					{
-					timedelay_time_d[ntimedelay-1] = bluefin->nav[i].position_time;
-					timedelay_timedelay[ntimedelay-1] = (-0.001 * (double)bluefin->nav[i].timedelay);
-/*fprintf(stderr,"   USED: %d %f",ntimedelay,timedelay_timedelay[ntimedelay-1]);*/
-					}
-/*fprintf(stderr,"\n");*/
-				ntimedelaycount++;
-				if (ntimedelaycount >= 100)
-					ntimedelaycount = 0;
-				}
-
-			}
-
-
-	   	/* handle subbottom data */
-		else if (status == MB_SUCCESS && kind == MB_DATA_SUBBOTTOM_SUBBOTTOM)
-			{
-			nrec_fsdwsbp++;
-
-			fsdwsb = &(istore->fsdwsb);
-			header = &(fsdwsb->header);
-			time_j[0] = header->s7kTime.Year;
-			time_j[1] = header->s7kTime.Day;
-			time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-			time_j[3] = (int) header->s7kTime.Seconds;
-			time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-			mb_get_itime(verbose, time_j, time_i);
-			mb_get_time(verbose, time_i, &time_d);
-			fsdwchannel = &(fsdwsb->channel);
-			fsdwsegyheader = &(fsdwsb->segyheader);
-			if (verbose > 0)
-				fprintf(stderr,"R7KRECID_FSDWsubbottom:            7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) FSDWtime(%4.4d-%3.3d %2.2d:%2.2d:%2.2d.%3.3d) ping:%d sampint:%d samples:%d\n",
-				time_i[0],time_i[1],time_i[2],
-				time_i[3],time_i[4],time_i[5],time_i[6],
-				fsdwsegyheader->year,fsdwsegyheader->day,fsdwsegyheader->hour,fsdwsegyheader->minute,fsdwsegyheader->second,
-				fsdwsegyheader->millisecondsToday - 1000 * (int)(0.001 * fsdwsegyheader->millisecondsToday),
-				fsdwsb->ping_number,fsdwchannel->sample_interval,fsdwchannel->number_samples);
-			}
-
-	   	/* handle low frequency sidescan data */
-		else if (status == MB_SUCCESS && kind == MB_DATA_SIDESCAN2)
-			{
-			nrec_fsdwsslo++;
-
-			fsdwsslo = &(istore->fsdwsslo);
-			header = &(fsdwsslo->header);
-			time_j[0] = header->s7kTime.Year;
-			time_j[1] = header->s7kTime.Day;
-			time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-			time_j[3] = (int) header->s7kTime.Seconds;
-			time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-			mb_get_itime(verbose, time_j, time_i);
-			mb_get_time(verbose, time_i, &time_d);
-			for (i=0;i<fsdwsslo->number_channels;i++)
-				{
-				fsdwchannel = &(fsdwsslo->channel[i]);
-				fsdwssheader = &(fsdwsslo->ssheader[i]);
-				if (verbose > 0)
-				fprintf(stderr,"R7KRECID_FSDWsidescanLo:           7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) FSDWtime(%4.4d-%3.3d %2.2d:%2.2d:%2.2d.%3.3d) ping:%d channel:%d sampint:%d samples:%d\n",
-					time_i[0],time_i[1],time_i[2],
-					time_i[3],time_i[4],time_i[5],time_i[6],
-					fsdwssheader->year,fsdwssheader->day,fsdwssheader->hour,fsdwssheader->minute,fsdwssheader->second,
-					fsdwssheader->millisecondsToday - 1000 * (int)(0.001 * fsdwssheader->millisecondsToday),
-					fsdwsslo->ping_number,fsdwchannel->number,
-					fsdwchannel->sample_interval,fsdwchannel->number_samples);
-				}
-
-			/* allocate memory for edgetech timetag arrays if needed */
-			if (nedget == 0 || nedget >= nedget_alloc)
-				{
-				nedget_alloc +=  MB7KPREPROCESS_ALLOC_CHUNK;
-				status = mb_reallocd(verbose,__FILE__,__LINE__,nedget_alloc*sizeof(double),(void **)&edget_time_d,&error);
-				status = mb_reallocd(verbose,__FILE__,__LINE__,nedget_alloc*sizeof(int),(void **)&edget_ping,&error);
-				status = mb_reallocd(verbose,__FILE__,__LINE__,nedget_alloc*sizeof(double),(void **)&edget_time_d_new,&error);
-				status = mb_reallocd(verbose,__FILE__,__LINE__,nedget_alloc*sizeof(double),(void **)&edget_time_offset,&error);
-				status = mb_reallocd(verbose,__FILE__,__LINE__,nedget_alloc*sizeof(int),(void **)&edget_ping_offset,&error);
-				status = mb_reallocd(verbose,__FILE__,__LINE__,nedget_alloc*sizeof(int),(void **)&edget_good_offset,&error);
-				if (error != MB_ERROR_NO_ERROR)
-					{
-					mb_error(verbose,error,&message);
-					fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",message);
-					fprintf(stderr,"\nProgram <%s> Terminated\n",
-					    program_name);
-					exit(error);
-					}
-				}
-
-			/* store the edgetech time stamp */
-			fsdwchannel = &(fsdwsslo->channel[0]);
-			fsdwssheader = &(fsdwsslo->ssheader[0]);
-			time_j[0] = fsdwssheader->year;
-			time_j[1] = fsdwssheader->day;
-			time_j[2] = 60 * fsdwssheader->hour + fsdwssheader->minute;
-			time_j[3] = fsdwssheader->second;
-			time_j[4] = 1000 * (fsdwssheader->millisecondsToday
-						- 1000 * ((int)(0.001 * fsdwssheader->millisecondsToday)));
-			mb_get_itime(verbose, time_j, time_i);
-			mb_get_time(verbose, time_i, &time_d);
-			if (nedget == 0 || time_d > edget_time_d[nedget-1])
-				{
-				edget_time_d[nedget] = time_d;
-				edget_ping[nedget] = fsdwssheader->pingNum;
-
-				/* grab the last reson ping time if it exists */
-				if (nbatht > 1)
-					{
-					edget_time_offset[nedget] = batht_time_d[nbatht-1] + (batht_time_d[nbatht-1] - batht_time_d[nbatht-2]) - time_d;
-					edget_ping_offset[nedget] = batht_ping[nbatht-1] - fsdwssheader->pingNum;
-					edget_good_offset[nedget] = MB_YES;
-					}
-				else
-					{
-					edget_time_offset[nedget] = -9999.99;
-					edget_ping_offset[nedget] = 0;
-					edget_good_offset[nedget] = MB_NO;
-					}
-				nedget++;
-				}
-			sslo_last_time_d = time_d;
-			sslo_last_ping = fsdwssheader->pingNum;
-			}
-
-	   	/* handle high frequency sidescan data */
-		else if (status == MB_SUCCESS && kind == MB_DATA_SIDESCAN3)
-			{
-			nrec_fsdwsshi++;
-
-			fsdwsshi = &(istore->fsdwsshi);
-			header = &(fsdwsshi->header);
-			time_j[0] = header->s7kTime.Year;
-			time_j[1] = header->s7kTime.Day;
-			time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-			time_j[3] = (int) header->s7kTime.Seconds;
-			time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-			mb_get_itime(verbose, time_j, time_i);
-			mb_get_time(verbose, time_i, &time_d);
-			for (i=0;i<fsdwsshi->number_channels;i++)
-				{
-				fsdwchannel = &(fsdwsshi->channel[i]);
-				fsdwssheader = &(fsdwsshi->ssheader[i]);
-				if (verbose > 0)
-				fprintf(stderr,"R7KRECID_FSDWsidescanHi:           7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) FSDWtime(%4.4d-%3.3d %2.2d:%2.2d:%2.2d.%3.3d) ping:%d channel:%d sampint:%d samples:%d\n",
-					time_i[0],time_i[1],time_i[2],
-					time_i[3],time_i[4],time_i[5],time_i[6],
-					fsdwssheader->year,fsdwssheader->day,fsdwssheader->hour,fsdwssheader->minute,fsdwssheader->second,
-					fsdwssheader->millisecondsToday - 1000 * (int)(0.001 * fsdwssheader->millisecondsToday),
-					fsdwsshi->ping_number,fsdwchannel->number,
-					fsdwchannel->sample_interval,fsdwchannel->number_samples);
-				}
-			}
-
-	   	/* handle unknown data */
-		else  if (status == MB_SUCCESS)
-			{
-/*fprintf(stderr,"DATA TYPE UNKNOWN: status:%d error:%d kind:%d\n",status,error,kind);*/
-			nrec_other++;
-			}
-
-	   	/* handle read error */
-		else
-			{
-/*fprintf(stderr,"READ FAILURE: status:%d error:%d kind:%d\n",status,error,kind);*/
-			}
-
-		/* print debug statements */
-		if (verbose >= 2)
-			{
-			fprintf(stderr,"\ndbg2  Ping read in program <%s>\n",
-				program_name);
-			fprintf(stderr,"dbg2       kind:           %d\n",kind);
-			fprintf(stderr,"dbg2       error:          %d\n",error);
-			fprintf(stderr,"dbg2       status:         %d\n",status);
-			}
-
-		/* set reson_lastread flag */
-		if (status == MB_SUCCESS && kind == MB_DATA_DATA)
-			reson_lastread = MB_YES;
-		else
-			reson_lastread = MB_NO;
-
-		/* set sslo_lastread flag */
-		if (status == MB_SUCCESS && kind == MB_DATA_SIDESCAN2)
-			sslo_lastread = MB_YES;
-		else
-			sslo_lastread = MB_NO;
-		}
-
-	/* close the swath file */
-	status = mb_close(verbose,&imbio_ptr,&error);
-
-	/* output counts */
-	fprintf(stdout, "\nData records read from: %s\n", ifile);
-	fprintf(stdout, "     File Header:                       %d\n", nrec_fileheader);
-	fprintf(stdout, "     Multibeam:                         %d\n", nrec_multibeam);
-	fprintf(stdout, "          Volatile Settings:                 %d\n", nrec_volatilesettings);
-	fprintf(stdout, "          Match Filter:                      %d\n", nrec_matchfilter);
-	fprintf(stdout, "          Beam Geometry:                     %d\n", nrec_beamgeometry);
-	fprintf(stdout, "          Remote Control:                    %d\n", nrec_remotecontrolsettings);
-	fprintf(stdout, "          Bathymetry:                        %d\n", nrec_bathymetry);
-	fprintf(stdout, "          Processed Sidescan:                %d\n", nrec_processedsidescan);
-	fprintf(stdout, "          Backscatter:                       %d\n", nrec_backscatter);
-	fprintf(stdout, "          Beam:                              %d\n", nrec_beam);
-	fprintf(stdout, "          Image:                             %d\n", nrec_image);
-	fprintf(stdout, "          V2PingMotion:                      %d\n", nrec_v2pingmotion);
-	fprintf(stdout, "          V2DetectionSetup:                  %d\n", nrec_v2detectionsetup);
-	fprintf(stdout, "          V2Beamformed:                      %d\n", nrec_v2beamformed);
-	fprintf(stdout, "          V2Detection:                       %d\n", nrec_v2detection);
-	fprintf(stdout, "          V2RawDetection:                    %d\n", nrec_v2rawdetection);
-	fprintf(stdout, "          V2Snippet:                         %d\n", nrec_v2snippet);
-	fprintf(stdout, "          Calibrated Snippet:                %d\n", nrec_calibratedsnippet);
-	fprintf(stdout, "          Processedsidescan:                 %d\n", nrec_processedsidescan);
-	fprintf(stdout, "     Reference:                         %d\n", nrec_reference);
-	fprintf(stdout, "     Uncalibrated Sensor Offset:        %d\n", nrec_sensoruncal);
-	fprintf(stdout, "     Calibrated Sensor Offset:          %d\n", nrec_sensorcal);
-	fprintf(stdout, "     Position:                          %d\n", nrec_position);
-	fprintf(stdout, "     Custom Attitude:                   %d\n", nrec_customattitude);
-	fprintf(stdout, "     Tide:                              %d\n", nrec_tide);
-	fprintf(stdout, "     Altitude:                          %d\n", nrec_altitude);
-	fprintf(stdout, "     Motion Over Ground:                %d\n", nrec_motion);
-	fprintf(stdout, "     Depth:                             %d\n", nrec_depth);
-	fprintf(stdout, "     Sound Speed Profile:               %d\n", nrec_svp);
-	fprintf(stdout, "     CTD:                               %d\n", nrec_ctd);
-	fprintf(stdout, "     Geodosy:                           %d\n", nrec_geodesy);
-	fprintf(stdout, "     Roll Pitch Heave:                  %d\n", nrec_rollpitchheave);
-	fprintf(stdout, "     Heading:                           %d\n", nrec_heading);
-	fprintf(stdout, "     Survey Line:                       %d\n", nrec_surveyline);
-	fprintf(stdout, "     Navigation:                        %d\n", nrec_navigation);
-	fprintf(stdout, "     Attitude:                          %d\n", nrec_attitude);
-	fprintf(stdout, "     Edgetech Low Frequency Sidescan:   %d\n", nrec_fsdwsslo);
-	fprintf(stdout, "     Edgetech High Frequency Sidescan:  %d\n", nrec_fsdwsshi);
-	fprintf(stdout, "     Edgetech Subbottom:                %d\n", nrec_fsdwsbp);
-	fprintf(stdout, "     MBARI Mapping AUV Environmental:   %d\n", nrec_bluefinnav);
-	fprintf(stdout, "     MBARI Mapping AUV Navigation:      %d\n", nrec_bluefinenv);
-	fprintf(stdout, "     Configuration:                     %d\n", nrec_configuration);
-	fprintf(stdout, "     Calibration:                       %d\n", nrec_calibration);
-	fprintf(stdout, "     Vertical Depth:                    %d\n", nrec_verticaldepth);
-	fprintf(stdout, "     Installation:                      %d\n", nrec_installation);
-	fprintf(stdout, "     System Event Message:              %d\n", nrec_systemeventmessage);
-	fprintf(stdout, "     Other:                             %d\n", nrec_other);
-	nrec_fileheader_tot += nrec_fileheader;
-	nrec_multibeam_tot += nrec_multibeam;
-	nrec_volatilesettings_tot += nrec_volatilesettings;
-	nrec_matchfilter_tot += nrec_matchfilter;
-	nrec_beamgeometry_tot += nrec_beamgeometry;
-	nrec_remotecontrolsettings_tot += nrec_remotecontrolsettings;
-	nrec_bathymetry_tot += nrec_bathymetry;
-	nrec_backscatter_tot += nrec_backscatter;
-	nrec_beam_tot += nrec_beam;
-	nrec_image_tot += nrec_image;
-	nrec_v2pingmotion_tot += nrec_v2pingmotion;
-	nrec_v2detectionsetup_tot += nrec_v2detectionsetup;
-	nrec_v2beamformed_tot += nrec_v2beamformed;
-	nrec_v2detection_tot += nrec_v2detection;
-	nrec_v2rawdetection_tot += nrec_v2rawdetection;
-	nrec_v2snippet_tot += nrec_v2snippet;
-	nrec_calibratedsnippet_tot += nrec_calibratedsnippet;
-	nrec_processedsidescan_tot += nrec_processedsidescan;
-	nrec_reference_tot += nrec_reference;
-	nrec_sensoruncal_tot += nrec_sensoruncal;
-	nrec_sensorcal_tot += nrec_sensorcal;
-	nrec_position_tot += nrec_position;
-	nrec_customattitude_tot += nrec_customattitude;
-	nrec_tide_tot += nrec_tide;
-	nrec_altitude_tot += nrec_altitude;
-	nrec_motion_tot += nrec_motion;
-	nrec_depth_tot += nrec_depth;
-	nrec_svp_tot += nrec_svp;
-	nrec_ctd_tot += nrec_ctd;
-	nrec_geodesy_tot += nrec_geodesy;
-	nrec_rollpitchheave_tot += nrec_rollpitchheave;
-	nrec_heading_tot += nrec_heading;
-	nrec_surveyline_tot += nrec_surveyline;
-	nrec_navigation_tot += nrec_navigation;
-	nrec_attitude_tot += nrec_attitude;
-	nrec_fsdwsbp_tot += nrec_fsdwsbp;
-	nrec_fsdwsslo_tot += nrec_fsdwsslo;
-	nrec_fsdwsshi_tot += nrec_fsdwsshi;
-	nrec_bluefinenv_tot += nrec_bluefinenv;
-	nrec_position_tot += nrec_position;
-	nrec_bluefinnav_tot += nrec_bluefinnav;
-	nrec_configuration_tot += nrec_configuration;
-	nrec_calibration_tot += nrec_calibration;
-	nrec_verticaldepth_tot += nrec_verticaldepth;
-	nrec_installation_tot += nrec_installation;
-	nrec_systemeventmessage_tot += nrec_systemeventmessage;
-	nrec_other_tot += nrec_other;
-
-	/* figure out whether and what to read next */
-        if (read_datalist == MB_YES)
-                {
-		if ((status = mb_datalist_read(verbose,datalist,
-			    ifile,&format,&file_weight,&error))
-			    == MB_SUCCESS)
-                        read_data = MB_YES;
-                else
-                        read_data = MB_NO;
-                }
-        else
-                {
-                read_data = MB_NO;
-                }
-
-	/* end loop over files in list */
-	}
-	if (read_datalist == MB_YES)
-		mb_datalist_close(verbose,&datalist,&error);
-
-	/* close time delay file */
-	if (tfp != NULL)
-		{
-		fclose(tfp);
-		tfp = NULL;
-		}
-
-	/* apply time lag to all relevant data
-		timelag value calculated either from model imported from file (timelagmode == MB7KPREPROCESS_TIMELAG_MODEL)
-			or by a constant offset (timelagmode == MB7KPREPROCESS_TIMELAG_CONSTANT) plus any timedelay
-				values embedded in the data (MBARI AUV bluefin nav records only) */
-	if (timelagmode != MB7KPREPROCESS_TIMELAG_OFF)
-		{
-		/* correct time of navigation, heading, attitude, sonardepth, altitude
-			read from asynchronous records in 7k files */
-		if (timedelaymode == MB7KPREPROCESS_TIMEDELAY_ON || timelagmode != MB7KPREPROCESS_TIMELAG_OFF)
-			{
-if (timedelaymode == MB7KPREPROCESS_TIMEDELAY_ON)
-	fprintf(stderr,"Applying Reson vs MVC time delay from MBARI Mapping AUV\n");
-else
-	fprintf(stderr,"No time delay correction\n");
-if (timelagmode == MB7KPREPROCESS_TIMELAG_CONSTANT)
-	fprintf(stderr,"Applying constant time lag of %f seconds\n",timelagconstant);
-else if (timelagmode == MB7KPREPROCESS_TIMELAG_MODEL)
-	fprintf(stderr,"Applying time lag model from file: %s\n",timelagfile);
-else
-	fprintf(stderr,"No time lag correction\n");
-fprintf(stderr,"Applying timelag to %d nav data\n", ndat_nav);
-			j = 0;
-			for (i=0;i<ndat_nav;i++)
-				{
-				/* get timelag value */
-				timelag = 0.0;
-				if (timedelaymode == MB7KPREPROCESS_TIMEDELAY_ON && ntimedelay > 0)
-				interp_status = mb_linear_interp(verbose,
-							timedelay_time_d-1, timedelay_timedelay-1,
-							ntimedelay, dat_nav_time_d[i], &timelag, &jtimedelay,
-							&error);
-				if (timelagmode == MB7KPREPROCESS_TIMELAG_CONSTANT)
-					{
-					timelag -= timelagconstant;
-					}
-				else if (timelagmode == MB7KPREPROCESS_TIMELAG_MODEL && ntimelag > 0)
-					{
-					interp_status = mb_linear_interp(verbose,
-								timelag_time_d-1, timelag_model-1,
-								ntimelag, dat_nav_time_d[i], &timelagm, &jtimelag,
-								&error);
-					timelag -= timelagm;
-					}
-				dat_nav_time_d[i] += timelag;
-				}
-fprintf(stderr,"Applying timelag to %d heading data\n", ndat_heading);
-			j = 0;
-			for (i=0;i<ndat_heading;i++)
-				{
-				/* get timelag value */
-				timelag = 0.0;
-				if (timedelaymode == MB7KPREPROCESS_TIMEDELAY_ON && ntimedelay > 0)
-				interp_status = mb_linear_interp(verbose,
-							timedelay_time_d-1, timedelay_timedelay-1,
-							ntimedelay, dat_heading_time_d[i], &timelag, &jtimedelay,
-							&error);
-				if (timelagmode == MB7KPREPROCESS_TIMELAG_CONSTANT)
-					{
-					timelag -= timelagconstant;
-					}
-				else if (timelagmode == MB7KPREPROCESS_TIMELAG_MODEL && ntimelag > 0)
-					{
-					interp_status = mb_linear_interp(verbose,
-								timelag_time_d-1, timelag_model-1,
-								ntimelag, dat_heading_time_d[i], &timelagm, &jtimelag,
-								&error);
-					timelag -= timelagm;
-					}
-				dat_heading_time_d[i] += timelag;
-				}
-fprintf(stderr,"Applying timelag to %d attitude data\n", ndat_rph);
-			j = 0;
-			for (i=0;i<ndat_rph;i++)
-				{
-				/* get timelag value */
-				timelag = 0.0;
-				if (timedelaymode == MB7KPREPROCESS_TIMEDELAY_ON && ntimedelay > 0)
-				interp_status = mb_linear_interp(verbose,
-							timedelay_time_d-1, timedelay_timedelay-1,
-							ntimedelay, dat_rph_time_d[i], &timelag, &jtimedelay,
-							&error);
-				if (timelagmode == MB7KPREPROCESS_TIMELAG_CONSTANT)
-					{
-					timelag -= timelagconstant;
-					}
-				else if (timelagmode == MB7KPREPROCESS_TIMELAG_MODEL && ntimelag > 0)
-					{
-					interp_status = mb_linear_interp(verbose,
-								timelag_time_d-1, timelag_model-1,
-								ntimelag, dat_rph_time_d[i], &timelagm, &jtimelag,
-								&error);
-					timelag -= timelagm;
-					}
-				dat_rph_time_d[i] += timelag;
-				}
-fprintf(stderr,"Applying timelag to %d sonardepth data\n", ndat_sonardepth);
-			j = 0;
-			for (i=0;i<ndat_sonardepth;i++)
-				{
-				/* get timelag value */
-				timelag = 0.0;
-				if (timedelaymode == MB7KPREPROCESS_TIMEDELAY_ON && ntimedelay > 0)
-				interp_status = mb_linear_interp(verbose,
-							timedelay_time_d-1, timedelay_timedelay-1,
-							ntimedelay, dat_sonardepth_time_d[i], &timelag, &jtimedelay,
-							&error);
-				if (timelagmode == MB7KPREPROCESS_TIMELAG_CONSTANT)
-					{
-					timelag -= timelagconstant;
-					}
-				else if (timelagmode == MB7KPREPROCESS_TIMELAG_MODEL && ntimelag > 0)
-					{
-					interp_status = mb_linear_interp(verbose,
-								timelag_time_d-1, timelag_model-1,
-								ntimelag, dat_sonardepth_time_d[i], &timelagm, &jtimelag,
-								&error);
-					timelag -= timelagm;
-					}
-				dat_sonardepth_time_d[i] += timelag;
-				}
-fprintf(stderr,"Applying timelag to %d altitude data\n", ndat_altitude);
-			j = 0;
-			for (i=0;i<ndat_altitude;i++)
-				{
-				/* get timelag value */
-				timelag = 0.0;
-				if (timedelaymode == MB7KPREPROCESS_TIMEDELAY_ON && ntimedelay > 0)
-				interp_status = mb_linear_interp(verbose,
-							timedelay_time_d-1, timedelay_timedelay-1,
-							ntimedelay, dat_altitude_time_d[i], &timelag, &jtimedelay,
-							&error);
-				if (timelagmode == MB7KPREPROCESS_TIMELAG_CONSTANT)
-					{
-					timelag -= timelagconstant;
-					}
-				else if (timelagmode == MB7KPREPROCESS_TIMELAG_MODEL && ntimelag > 0)
-					{
-					interp_status = mb_linear_interp(verbose,
-								timelag_time_d-1, timelag_model-1,
-								ntimelag, dat_altitude_time_d[i], &timelagm, &jtimelag,
-								&error);
-					timelag -= timelagm;
-					}
-				dat_altitude_time_d[i] += timelag;
-				}
-
-			/* correct time of INS data read from MBARI AUV log file */
-fprintf(stderr,"Applying timelag to %d INS data\n", nins);
-			for (i=0;i<nins;i++)
-				{
-				/* get timelag value */
-				timelag = 0.0;
-				if (timedelaymode == MB7KPREPROCESS_TIMEDELAY_ON && ntimedelay > 0)
-				interp_status = mb_linear_interp(verbose,
-							timedelay_time_d-1, timedelay_timedelay-1,
-							ntimedelay, ins_time_d[i], &timelag, &jtimedelay,
-							&error);
-				if (timelagmode == MB7KPREPROCESS_TIMELAG_CONSTANT)
-					{
-					timelag -= timelagconstant;
-					}
-				else if (timelagmode == MB7KPREPROCESS_TIMELAG_MODEL && ntimelag > 0)
-					{
-					interp_status = mb_linear_interp(verbose,
-								timelag_time_d-1, timelag_model-1,
-								ntimelag, ins_time_d[i], &timelagm, &jtimelag,
-								&error);
-					timelag -= timelagm;
-					}
-				ins_time_d[i] += timelag;
-				}
-fprintf(stderr,"Applying timelag to %d INS altitude data\n", nins_altitude);
-			for (i=0;i<nins_altitude;i++)
-				{
-				/* get timelag value */
-				timelag = 0.0;
-				if (timedelaymode == MB7KPREPROCESS_TIMEDELAY_ON && ntimedelay > 0)
-				interp_status = mb_linear_interp(verbose,
-							timedelay_time_d-1, timedelay_timedelay-1,
-							ntimedelay, ins_altitude_time_d[i], &timelag, &jtimedelay,
-							&error);
-				if (timelagmode == MB7KPREPROCESS_TIMELAG_CONSTANT)
-					{
-					timelag -= timelagconstant;
-					}
-				else if (timelagmode == MB7KPREPROCESS_TIMELAG_MODEL && ntimelag > 0)
-					{
-					interp_status = mb_linear_interp(verbose,
-								timelag_time_d-1, timelag_model-1,
-								ntimelag, ins_altitude_time_d[i], &timelagm, &jtimelag,
-								&error);
-					timelag -= timelagm;
-					}
-				ins_altitude_time_d[i] += timelag;
-				}
-fprintf(stderr,"Applying timelag to %d INS speed data\n", nins_speed);
-			for (i=0;i<nins_speed;i++)
-				{
-				/* get timelag value */
-				timelag = 0.0;
-				if (timedelaymode == MB7KPREPROCESS_TIMEDELAY_ON && ntimedelay > 0)
-				interp_status = mb_linear_interp(verbose,
-							timedelay_time_d-1, timedelay_timedelay-1,
-							ntimedelay, ins_speed_time_d[i], &timelag, &jtimedelay,
-							&error);
-				if (timelagmode == MB7KPREPROCESS_TIMELAG_CONSTANT)
-					{
-					timelag -= timelagconstant;
-					}
-				else if (timelagmode == MB7KPREPROCESS_TIMELAG_MODEL && ntimelag > 0)
-					{
-					interp_status = mb_linear_interp(verbose,
-								timelag_time_d-1, timelag_model-1,
-								ntimelag, ins_speed_time_d[i], &timelagm, &jtimelag,
-								&error);
-					timelag -= timelagm;
-					}
-				ins_speed_time_d[i] += timelag;
-				}
-
-			/* correct time of navigation and attitude data read from WHOI DSL nav and attitude file */
-fprintf(stderr,"Applying timelag to %d DSL nav data\n", ndsl);
-			for (i=0;i<ndsl;i++)
-				{
-				/* get timelag value */
-				timelag = 0.0;
-				if (timedelaymode == MB7KPREPROCESS_TIMEDELAY_ON && ntimedelay > 0)
-				interp_status = mb_linear_interp(verbose,
-							timedelay_time_d-1, timedelay_timedelay-1,
-							ntimedelay, dsl_time_d[i], &timelag, &jtimedelay,
-							&error);
-				if (timelagmode == MB7KPREPROCESS_TIMELAG_CONSTANT)
-					{
-					timelag -= timelagconstant;
-					}
-				else if (timelagmode == MB7KPREPROCESS_TIMELAG_MODEL && ntimelag > 0)
-					{
-					interp_status = mb_linear_interp(verbose,
-								timelag_time_d-1, timelag_model-1,
-								ntimelag, dsl_time_d[i], &timelagm, &jtimelag,
-								&error);
-					timelag -= timelagm;
-					}
-				dsl_time_d[i] += timelag;
-				}
-
-			/* correct time of navigation and attitude data read from Steve Rock file */
-fprintf(stderr,"Applying timelag to %d Steve Rock nav data\n", nrock);
-			for (i=0;i<nrock;i++)
-				{
-				/* get timelag value */
-				timelag = 0.0;
-				if (timedelaymode == MB7KPREPROCESS_TIMEDELAY_ON && ntimedelay > 0)
-				interp_status = mb_linear_interp(verbose,
-							timedelay_time_d-1, timedelay_timedelay-1,
-							ntimedelay, rock_time_d[i], &timelag, &jtimedelay,
-							&error);
-				if (timelagmode == MB7KPREPROCESS_TIMELAG_CONSTANT)
-					{
-					timelag -= timelagconstant;
-					}
-				else if (timelagmode == MB7KPREPROCESS_TIMELAG_MODEL && ntimelag > 0)
-					{
-					interp_status = mb_linear_interp(verbose,
-								timelag_time_d-1, timelag_model-1,
-								ntimelag, rock_time_d[i], &timelagm, &jtimelag,
-								&error);
-					timelag -= timelagm;
-					}
-				rock_time_d[i] += timelag;
-				}
-
-			/* correct time of sonar depth data read from separate file */
-fprintf(stderr,"Applying timelag to %d sonardepth nav data\n", nsonardepth);
-			for (i=0;i<nsonardepth;i++)
-				{
-				/* get timelag value */
-				timelag = 0.0;
-				if (timedelaymode == MB7KPREPROCESS_TIMEDELAY_ON && ntimedelay > 0)
-				interp_status = mb_linear_interp(verbose,
-							timedelay_time_d-1, timedelay_timedelay-1,
-							ntimedelay, sonardepth_time_d[i], &timelag, &jtimedelay,
-							&error);
-				if (timelagmode == MB7KPREPROCESS_TIMELAG_CONSTANT)
-					{
-					timelag -= timelagconstant;
-					}
-				else if (timelagmode == MB7KPREPROCESS_TIMELAG_MODEL && ntimelag > 0)
-					{
-					interp_status = mb_linear_interp(verbose,
-								timelag_time_d-1, timelag_model-1,
-								ntimelag, sonardepth_time_d[i], &timelagm, &jtimelag,
-								&error);
-					timelag -= timelagm;
-					}
-				sonardepth_time_d[i] += timelag;
-				}
-			}
-		}
-
-	/* if desired apply filtering to sonardepth data */
-	if (sonardepthfilter == MB_YES)
-		{
-		/* apply filtering to sonardepth data
-			read from asynchronous records in 7k files */
-		if (ndat_sonardepth > 1)
-			{
-fprintf(stderr,"Applying filtering to %d sonardepth data\n", ndat_sonardepth);
-			dtime = (dat_sonardepth_time_d[ndat_sonardepth-1]  - dat_sonardepth_time_d[0]) / ndat_sonardepth;
-			nhalffilter = (int)(4.0 * sonardepthfilterlength / dtime);
-			for (i=0;i<ndat_sonardepth;i++)
-				{
-				dat_sonardepth_sonardepthfilter[i] = 0.0;
-				sonardepth_filterweight = 0.0;
-				j1 = MAX(i - nhalffilter, 0);
-				j2 = MIN(i + nhalffilter, ndat_sonardepth - 1);
-				for (j=j1;j<=j2;j++)
-					{
-					dtol = (dat_sonardepth_time_d[j] - dat_sonardepth_time_d[i]) / sonardepthfilterlength;
-					weight = exp(-dtol * dtol);
-					dat_sonardepth_sonardepthfilter[i] += weight * dat_sonardepth_sonardepth[j];
-					sonardepth_filterweight += weight;
-					}
-				if (sonardepth_filterweight > 0.0)
-					dat_sonardepth_sonardepthfilter[i] /= sonardepth_filterweight;
-				}
-			for (i=0;i<ndat_sonardepth;i++)
-				{
-				if (dat_sonardepth_sonardepth[i] < 2.0 * sonardepthfilterdepth)
-					factor = 1.0;
-				else
-					factor = exp(-(dat_sonardepth_sonardepth[i] - 2.0 * sonardepthfilterdepth)
-							/ (sonardepthfilterdepth));
-				dat_sonardepth_sonardepth[i] = (1.0 - factor) * dat_sonardepth_sonardepth[i]
-							+ factor * dat_sonardepth_sonardepthfilter[i];
-				}
-			}
-
-		/* filter sonardepth data from separate file */
-		if (nsonardepth > 1)
-			{
-fprintf(stderr,"Applying filtering to %d sonardepth nav data\n", nsonardepth);
-			dtime = (sonardepth_time_d[nsonardepth-1]  - sonardepth_time_d[0]) / nsonardepth;
-			nhalffilter = (int)(4.0 * sonardepthfilterlength / dtime);
-			for (i=0;i<nsonardepth;i++)
-				{
-				sonardepth_sonardepthfilter[i] = 0.0;
-				sonardepth_filterweight = 0.0;
-				j1 = MAX(i - nhalffilter, 0);
-				j2 = MIN(i + nhalffilter, nsonardepth - 1);
-				for (j=j1;j<=j2;j++)
-					{
-					dtol = (sonardepth_time_d[j] - sonardepth_time_d[i]) / sonardepthfilterlength;
-					weight = exp(-dtol * dtol);
-					sonardepth_sonardepthfilter[i] += weight * sonardepth_sonardepth[j];
-					sonardepth_filterweight += weight;
-					}
-				if (sonardepth_filterweight > 0.0)
-					sonardepth_sonardepthfilter[i] /= sonardepth_filterweight;
-				}
-			for (i=0;i<nsonardepth;i++)
-				{
-				if (sonardepth_sonardepth[i] < 2.0 * sonardepthfilterdepth)
-					factor = 1.0;
-				else
-					factor = exp(-(sonardepth_sonardepth[i] - 2.0 * sonardepthfilterdepth)
-							/ (sonardepthfilterdepth));
-				sonardepth_sonardepth[i] = (1.0 - factor) * sonardepth_sonardepth[i]
-							+ factor * sonardepth_sonardepthfilter[i];
-				}
-			}
-
-		/* filter sonardepth data from separate INS file */
-		if (nins > 1)
-			{
-fprintf(stderr,"Applying filtering to %d INS nav data\n", nins);
-			for (i=0;i<nins;i++)
-				{
-				ins_sonardepthfilter[i] = 0.0;
-				sonardepth_filterweight = 0.0;
-				dtime = (ins_time_d[nins-1]  - ins_time_d[0]) / nins;
-				nhalffilter = (int)(4.0 * sonardepthfilterlength / dtime);
-				j1 = MAX(i - nhalffilter, 0);
-				j2 = MIN(i + nhalffilter, nins - 1);
-				for (j=j1;j<=j2;j++)
-					{
-					dtol = (ins_time_d[j] - ins_time_d[i]) / sonardepthfilterlength;
-					weight = exp(-dtol * dtol);
-					ins_sonardepthfilter[i] += weight * ins_sonardepth[j];
-					sonardepth_filterweight += weight;
-					}
-				if (sonardepth_filterweight > 0.0)
-					ins_sonardepthfilter[i] /= sonardepth_filterweight;
-				}
-			for (i=0;i<nins;i++)
-				{
-				if (ins_sonardepth[i] < 2.0 * sonardepthfilterdepth)
-					factor = 1.0;
-				else
-					factor = exp(-(ins_sonardepth[i] - 2.0 * sonardepthfilterdepth)
-							/ (sonardepthfilterdepth));
-				ins_sonardepth[i] = (1.0 - factor) * ins_sonardepth[i]
-							+ factor * ins_sonardepthfilter[i];
-				}
-			}
-
-		/* filter sonardepth data from separate WHOI DSL file */
-		if (ndsl > 1)
-			{
-fprintf(stderr,"Applying filtering to %d DSL nav data\n", ndsl);
-			for (i=0;i<ndsl;i++)
-				{
-				dsl_sonardepthfilter[i] = 0.0;
-				sonardepth_filterweight = 0.0;
-				dtime = (dsl_time_d[ndsl-1]  - dsl_time_d[0]) / ndsl;
-				nhalffilter = (int)(4.0 * sonardepthfilterlength / dtime);
-				j1 = MAX(i - nhalffilter, 0);
-				j2 = MIN(i + nhalffilter, ndsl - 1);
-				for (j=j1;j<=j2;j++)
-					{
-					dtol = (dsl_time_d[j] - dsl_time_d[i]) / sonardepthfilterlength;
-					weight = exp(-dtol * dtol);
-					dsl_sonardepthfilter[i] += weight * dsl_sonardepth[j];
-					sonardepth_filterweight += weight;
-					}
-				if (sonardepth_filterweight > 0.0)
-					dsl_sonardepthfilter[i] /= sonardepth_filterweight;
-				}
-			for (i=0;i<ndsl;i++)
-				{
-				if (dsl_sonardepth[i] < 2.0 * sonardepthfilterdepth)
-					factor = 1.0;
-				else
-					factor = exp(-(dsl_sonardepth[i] - 2.0 * sonardepthfilterdepth)
-							/ (sonardepthfilterdepth));
-				dsl_sonardepth[i] = (1.0 - factor) * dsl_sonardepth[i]
-							+ factor * dsl_sonardepthfilter[i];
-				}
-			}
-
-		/* filter sonardepth data from separate Steve Rock file */
-		if (nrock > 1)
-			{
-fprintf(stderr,"Applying filtering to %d Rock nav data\n", nrock);
-			for (i=0;i<nrock;i++)
-				{
-				rock_sonardepthfilter[i] = 0.0;
-				sonardepth_filterweight = 0.0;
-				dtime = (rock_time_d[nrock-1]  - rock_time_d[0]) / nrock;
-				nhalffilter = (int)(4.0 * sonardepthfilterlength / dtime);
-				j1 = MAX(i - nhalffilter, 0);
-				j2 = MIN(i + nhalffilter, ndsl - 1);
-				for (j=j1;j<=j2;j++)
-					{
-					dtol = (rock_time_d[j] - rock_time_d[i]) / sonardepthfilterlength;
-					weight = exp(-dtol * dtol);
-					rock_sonardepthfilter[i] += weight * rock_sonardepth[j];
-					sonardepth_filterweight += weight;
-					}
-				if (sonardepth_filterweight > 0.0)
-					rock_sonardepthfilter[i] /= sonardepth_filterweight;
-				}
-			for (i=0;i<nrock;i++)
-				{
-				if (rock_sonardepth[i] < 2.0 * sonardepthfilterdepth)
-					factor = 1.0;
-				else
-					factor = exp(-(rock_sonardepth[i] - 2.0 * sonardepthfilterdepth)
-							/ (sonardepthfilterdepth));
-				rock_sonardepth[i] = (1.0 - factor) * rock_sonardepth[i]
-							+ factor * rock_sonardepthfilter[i];
-				}
-			}
-		}
-
-	/* fix problems with batht timestamp arrays */
-	for (i=0;i<nbatht;i++)
-		{
-		if (batht_good_offset[i] == MB_NO)
-			{
-			foundstart = MB_NO;
-			foundend = MB_NO;
-			for (j = i - 1; j >= 0 && foundstart == MB_NO; j--)
-				{
-				if (batht_good_offset[j] == MB_YES)
-					{
-					foundstart = MB_YES;
-					start = j;
-					}
-				}
-			for (j = i + 1; j < nbatht && foundend == MB_NO; j++)
-				{
-				if (batht_good_offset[j] == MB_YES)
-					{
-					foundend = MB_YES;
-					end = j;
-					}
-				}
-			if (foundstart == MB_YES && foundend == MB_YES)
-				{
-				batht_time_offset[i] = batht_time_offset[start]
-							+ (batht_time_offset[end] - batht_time_offset[start])
-								* ((double)(i - start)) / ((double)(end - start));
-				}
-			else if (foundstart == MB_YES)
-				{
-				batht_time_offset[i] = batht_time_offset[start];
-				}
-			else if (foundend == MB_YES)
-				{
-				batht_time_offset[i] = batht_time_offset[end];
-				}
-			}
-		batht_time_d_new[i] = batht_time_d[i] + batht_time_offset[i];
-		}
-
-	/* fix problems with edget timestamp arrays */
-	for (i=0;i<nedget;i++)
-		{
-		if (edget_good_offset[i] == MB_NO)
-			{
-			foundstart = MB_NO;
-			foundend = MB_NO;
-			for (j = i - 1; j >= 0 && foundstart == MB_NO; j--)
-				{
-				if (edget_good_offset[j] == MB_YES)
-					{
-					foundstart = MB_YES;
-					start = j;
-					}
-				}
-			for (j = i + 1; j < nedget && foundend == MB_NO; j++)
-				{
-				if (edget_good_offset[j] == MB_YES)
-					{
-					foundend = MB_YES;
-					end = j;
-					}
-				}
-			if (foundstart == MB_YES && foundend == MB_YES)
-				{
-				edget_time_offset[i] = edget_time_offset[start]
-							+ (edget_time_offset[end] - edget_time_offset[start])
-								* ((double)(i - start)) / ((double)(end - start));
-				}
-			else if (foundstart == MB_YES)
-				{
-				edget_time_offset[i] = edget_time_offset[start];
-				}
-			else if (foundend == MB_YES)
-				{
-				edget_time_offset[i] = edget_time_offset[end];
-				}
-			}
-		edget_time_d_new[i] = edget_time_d[i] + edget_time_offset[i];
-		}
-
-	/* remove noise from position data associated with Kearfott INS on an ROV
-		that consists of jumps every two seconds */
-	if (kluge_kearfottrovnoise == MB_YES && ndat_nav > 2)
-		{
-		longitude_offset = 0.0;
-		latitude_offset = 0.0;
-		mb_coor_scale(verbose,dat_nav_lat[0],&mtodeglon,&mtodeglat);
-		for (i=1;i<ndat_nav;i++)
-			{
-			dat_nav_lon[i] -= longitude_offset;
-			dat_nav_lat[i] -= latitude_offset;
-
-			dx = (dat_nav_lon[i] - dat_nav_lon[i-1]) / mtodeglon;
-			dy = (dat_nav_lat[i] - dat_nav_lat[i-1]) / mtodeglat;
-			dt = (dat_nav_time_d[i] - dat_nav_time_d[i-1]);
-			v = sqrt(dx * dx + dy * dy) / dt;
-
-			if (v > 0.5)
-				{
-				longitude_offset += (dat_nav_lon[i] - dat_nav_lon[i-1]);
-				latitude_offset += (dat_nav_lat[i] - dat_nav_lat[i-1]);
-				dat_nav_lon[i] = dat_nav_lon[i-1];
-				dat_nav_lat[i] = dat_nav_lat[i-1];
-				}
-			}
-		}
-
-	/* output ins navigation and attitude data */
-	if (nins > 0 && (verbose > 0 || mode == MB7KPREPROCESS_TIMESTAMPLIST))
-		{
-		fprintf(stdout, "\nTotal INS navigation/attitude data read: %d\n", nins);
-		for (i=0;i<nins;i++)
-			{
-			fprintf(stdout, "  INS: %12d %17.6f %11.6f %10.6f %8.3f %7.3f %6.3f %6.3f %6.3f %6.3f\n",
-				i, ins_time_d[i], ins_lon[i], ins_lat[i], ins_heading[i],
-				ins_sonardepth[i], ins_altitude[i], ins_speed[i],
-				ins_roll[i], ins_pitch[i]);
-			}
-		fprintf(stdout, "\nTotal INS altitude data read: %d\n", nins_altitude);
-		for (i=0;i<nins_altitude;i++)
-			{
-			fprintf(stdout, "  INS ALT: %12d %17.6f %6.3f\n",
-				i, ins_altitude_time_d[i], ins_altitude[i]);
-			}
-		fprintf(stdout, "\nTotal INS speed data read: %d\n", nins_speed);
-		for (i=0;i<nins_speed;i++)
-			{
-			fprintf(stdout, "  INS SPD: %12d %17.6f %6.3f\n",
-				i, ins_speed_time_d[i], ins_speed[i]);
-			}
-		}
-
-	/* output auv sonardepth data */
-	if (nsonardepth > 0 && (verbose > 0 || mode == MB7KPREPROCESS_TIMESTAMPLIST))
-		{
-		fprintf(stdout, "\nTotal auv sonardepth data read: %d\n", nsonardepth);
-		for (i=0;i<nins;i++)
-			{
-			fprintf(stdout, "  SONARDEPTH: %12d %8.3f %8.3f\n",
-				i, sonardepth_time_d[i], sonardepth_sonardepth[i]);
-			}
-		}
-
-	/* output 7k navigation and attitude data */
-	if (verbose > 0 || mode == MB7KPREPROCESS_TIMESTAMPLIST)
-		{
-		fprintf(stdout, "\nTotal 7k navigation data read: %d\n", ndat_nav);
-		for (i=0;i<ndat_nav;i++)
-			{
-			fprintf(stdout, "  NAV: %5d %17.6f %11.6f %10.6f %6.3f\n",
-				i, dat_nav_time_d[i], dat_nav_lon[i], dat_nav_lat[i], dat_nav_speed[i]);
-			}
-		fprintf(stdout, "\nTotal heading data read: %d\n", ndat_heading);
-		for (i=0;i<ndat_heading;i++)
-			{
-			fprintf(stdout, "  HDG: %5d %17.6f %8.3f\n",
-				i, dat_heading_time_d[i], dat_heading_heading[i]);
-			}
-		fprintf(stdout, "\nTotal sonardepth data read: %d\n", ndat_sonardepth);
-		for (i=0;i<ndat_sonardepth;i++)
-			{
-			fprintf(stdout, "  DEP: %5d %17.6f %8.3f\n",
-				i, dat_sonardepth_time_d[i], dat_sonardepth_sonardepth[i]);
-			}
-		fprintf(stdout, "\nTotal altitude data read: %d\n", ndat_altitude);
-		for (i=0;i<ndat_altitude;i++)
-			{
-			fprintf(stdout, "  ALT: %5d %17.6f %8.3f\n",
-				i, dat_altitude_time_d[i], dat_altitude_altitude[i]);
-			}
-		fprintf(stdout, "\nTotal attitude data read: %d\n", ndat_rph);
-		for (i=0;i<ndat_rph;i++)
-			{
-			fprintf(stdout, "  ALT: %5d %17.6f %8.3f %8.3f %8.3f\n",
-				i, dat_rph_time_d[i], dat_rph_roll[i], dat_rph_pitch[i], dat_rph_heave[i]);
-			}
-		fprintf(stdout, "\nTotal Edgetech time stamp data read: %d\n", nedget);
-		for (i=0;i<nedget;i++)
-			{
-			fprintf(stdout, "  EDG: %5d %17.6f %17.6f %5d   offsets: %17.6f %5d  %5d\n",
-				i, edget_time_d[i], edget_time_d_new[i], edget_ping[i], edget_time_offset[i], edget_ping_offset[i], edget_good_offset[i]);
-			}
-		fprintf(stdout, "\nTotal multibeam time stamp data read: %d\n", nbatht);
-		for (i=0;i<nbatht;i++)
-			{
-			fprintf(stdout, "  BAT: %5d %17.6f %17.6f %5d   offsets: %17.6f %5d  %5d\n",
-				i, batht_time_d[i], batht_time_d_new[i], batht_ping[i], batht_time_offset[i], batht_ping_offset[i], batht_good_offset[i]);
-			}
-		}
-
-	/* output counts */
-	fprintf(stdout, "\nTotal data records read from: %s\n", read_file);
-	fprintf(stdout, "     File Header:                       %d\n", nrec_fileheader_tot);
-	fprintf(stdout, "     Multibeam:                         %d\n", nrec_multibeam_tot);
-	fprintf(stdout, "          Volatile Settings:                 %d\n", nrec_volatilesettings_tot);
-	fprintf(stdout, "          Match Filter:                      %d\n", nrec_matchfilter_tot);
-	fprintf(stdout, "          Beam Geometry:                     %d\n", nrec_beamgeometry_tot);
-	fprintf(stdout, "          Remote Control:                    %d\n", nrec_remotecontrolsettings_tot);
-	fprintf(stdout, "          Bathymetry:                        %d\n", nrec_bathymetry_tot);
-	fprintf(stdout, "          Backscatter:                       %d\n", nrec_backscatter_tot);
-	fprintf(stdout, "          Beam:                              %d\n", nrec_beam_tot);
-	fprintf(stdout, "          Image:                             %d\n", nrec_image_tot);
-	fprintf(stdout, "          V2PingMotion:                      %d\n", nrec_v2pingmotion_tot);
-	fprintf(stdout, "          V2DetectionSetup:                  %d\n", nrec_v2detectionsetup_tot);
-	fprintf(stdout, "          V2Beamformed:                      %d\n", nrec_v2beamformed_tot);
-	fprintf(stdout, "          V2Detection:                       %d\n", nrec_v2detection_tot);
-	fprintf(stdout, "          V2RawDetection:                    %d\n", nrec_v2rawdetection_tot);
-	fprintf(stdout, "          V2Snippet:                         %d\n", nrec_v2snippet_tot);
-	fprintf(stdout, "          Calibrated Snippet:                %d\n", nrec_calibratedsnippet_tot);
-	fprintf(stdout, "          Processedsidescan:                 %d\n", nrec_processedsidescan_tot);
-	fprintf(stdout, "     Reference:                         %d\n", nrec_reference_tot);
-	fprintf(stdout, "     Uncalibrated Sensor Offset:        %d\n", nrec_sensoruncal_tot);
-	fprintf(stdout, "     Calibrated Sensor Offset:          %d\n", nrec_sensorcal_tot);
-	fprintf(stdout, "     Position:                          %d\n", nrec_position_tot);
-	fprintf(stdout, "     Custom Attitude:                   %d\n", nrec_customattitude_tot);
-	fprintf(stdout, "     Tide:                              %d\n", nrec_tide_tot);
-	fprintf(stdout, "     Altitude:                          %d\n", nrec_altitude_tot);
-	fprintf(stdout, "     Motion Over Ground:                %d\n", nrec_motion_tot);
-	fprintf(stdout, "     Depth:                             %d\n", nrec_depth_tot);
-	fprintf(stdout, "     Sound Speed Profile:               %d\n", nrec_svp_tot);
-	fprintf(stdout, "     CTD:                               %d\n", nrec_ctd_tot);
-	fprintf(stdout, "     Geodosy:                           %d\n", nrec_geodesy_tot);
-	fprintf(stdout, "     Roll Pitch Heave:                  %d\n", nrec_rollpitchheave_tot);
-	fprintf(stdout, "     Heading:                           %d\n", nrec_heading_tot);
-	fprintf(stdout, "     Survey Line:                       %d\n", nrec_surveyline_tot);
-	fprintf(stdout, "     Navigation:                        %d\n", nrec_navigation_tot);
-	fprintf(stdout, "     Attitude:                          %d\n", nrec_attitude_tot);
-	fprintf(stdout, "     Edgetech Low Frequency Sidescan:   %d\n", nrec_fsdwsslo_tot);
-	fprintf(stdout, "     Edgetech High Frequency Sidescan:  %d\n", nrec_fsdwsshi_tot);
-	fprintf(stdout, "     Edgetech Subbottom:                %d\n", nrec_fsdwsbp_tot);
-	fprintf(stdout, "     MBARI Mapping AUV Environmental:   %d\n", nrec_bluefinnav_tot);
-	fprintf(stdout, "     MBARI Mapping AUV Navigation:      %d\n", nrec_bluefinenv_tot);
-	fprintf(stdout, "     Configuration:                     %d\n", nrec_configuration_tot);
-	fprintf(stdout, "     Calibration:                       %d\n", nrec_calibration_tot);
-	fprintf(stdout, "     Vertical Depth:                    %d\n", nrec_verticaldepth_tot);
-	fprintf(stdout, "     Installation:                      %d\n", nrec_installation_tot);
-	fprintf(stdout, "     System Event Message:              %d\n", nrec_systemeventmessage_tot);
-	fprintf(stdout, "     Other:                             %d\n", nrec_other_tot);
-
-	nrec_reference_tot = 0;
-	nrec_sensoruncal_tot = 0;
-	nrec_sensorcal_tot = 0;
-	nrec_position_tot = 0;
-	nrec_customattitude_tot = 0;
-	nrec_tide_tot = 0;
-	nrec_altitude_tot = 0;
-	nrec_motion_tot = 0;
-	nrec_depth_tot = 0;
-	nrec_svp_tot = 0;
-	nrec_ctd_tot = 0;
-	nrec_geodesy_tot = 0;
-	nrec_rollpitchheave_tot = 0;
-	nrec_heading_tot = 0;
-	nrec_surveyline_tot = 0;
-	nrec_navigation_tot = 0;
-	nrec_attitude_tot = 0;
-	nrec_fsdwsslo_tot = 0;
-	nrec_fsdwsshi_tot = 0;
-	nrec_fsdwsbp_tot = 0;
-	nrec_bluefinnav_tot = 0;
-	nrec_bluefinenv_tot = 0;
-	nrec_multibeam_tot = 0;
-	nrec_volatilesettings_tot = 0;
-	nrec_configuration_tot = 0;
-	nrec_matchfilter_tot = 0;
-	nrec_beamgeometry_tot = 0;
-	nrec_calibration_tot = 0;
-	nrec_bathymetry_tot = 0;
-	nrec_backscatter_tot = 0;
-	nrec_beam_tot = 0;
-	nrec_verticaldepth_tot = 0;
-	nrec_image_tot = 0;
-	nrec_installation_tot = 0;
-	nrec_systemeventmessage_tot = 0;
-	nrec_fileheader_tot = 0;
-	nrec_remotecontrolsettings_tot = 0;
-	nrec_other_tot = 0;
-
-	/* now read the data files again, this time interpolating nav and attitude
-		into the multibeam records and fixing other problems found in the
-		data */
-	if (mode == MB7KPREPROCESS_PROCESS)
-	{
-
-	/* open file list */
-	if (read_datalist == MB_YES)
-	    {
-	    if ((status = mb_datalist_open(verbose,&datalist,
-					    read_file,look_processed,&error)) != MB_SUCCESS)
-		{
-		error = MB_ERROR_OPEN_FAIL;
-		fprintf(stderr,"\nUnable to open data list file: %s\n",
-			read_file);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-	    if ((status = mb_datalist_read(verbose,datalist,
-			    ifile,&format,&file_weight,&error))
-			    == MB_SUCCESS)
-		read_data = MB_YES;
-	    else
-		read_data = MB_NO;
-	    }
-	/* else copy single filename to be read */
-	else
-	    {
-	    strcpy(ifile, read_file);
-	    read_data = MB_YES;
-	    }
-
-	/* loop over all files to be read */
-	while (read_data == MB_YES && format == MBF_RESON7KR)
-	{
-	/* figure out the output file name */
-	if (ofile_set == MB_NO)
-		{
-		status = mb_get_format(verbose, ifile, fileroot, &testformat, &error);
-		if (testformat == MBF_RESON7KR
-			&& strncmp(".s7k",&ifile[strlen(ifile)-4],4) == 0)
-			sprintf(ofile, "%s.mb%d", fileroot, testformat);
-		else if (testformat == MBF_RESON7KR)
-			sprintf(ofile, "%sf.mb%d", fileroot, testformat);
-		else
-			sprintf(ofile, "%s.mb%d", ifile, testformat);
-		}
-
-	/* initialize reading the input swath file */
-	if ((status = mb_read_init(
-		verbose,ifile,format,pings,lonflip,bounds,
-		btime_i,etime_i,speedmin,timegap,
-		&imbio_ptr,&btime_d,&etime_d,
-		&beams_bath,&beams_amp,&pixels_ss,&error)) != MB_SUCCESS)
-		{
-		mb_error(verbose,error,&message);
-		fprintf(stderr,"\nMBIO Error returned from function <mb_read_init>:\n%s\n",message);
-		fprintf(stderr,"\nMultibeam File <%s> not initialized for reading\n",ifile);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-	nfile_read++;
-
-	/* if ofile has been set then there is only one output file, otherwise there
-		is an output file for each input file */
-	if (ofile_set == MB_NO || nfile_write == 0)
-		{
-		/* initialize writing the output swath sonar file */
-		if ((status = mb_write_init(
-			verbose,ofile,format,&ombio_ptr,
-			&obeams_bath,&obeams_amp,&opixels_ss,&error)) != MB_SUCCESS)
-			{
-			mb_error(verbose,error,&message);
-			fprintf(stderr,"\nMBIO Error returned from function <mb_write_init>:\n%s\n",message);
-			fprintf(stderr,"\nMultibeam File <%s> not initialized for writing\n",ofile);
-			fprintf(stderr,"\nProgram <%s> Terminated\n",
-				program_name);
-			exit(error);
-			}
-		nfile_write++;
-
-		/* initialize ctd output file */
-		sprintf(ctdfile,"%s_ctd.txt",fileroot);
-		if ((tfp = fopen(ctdfile, "w")) == NULL)
-			{
-			error = MB_ERROR_OPEN_FAIL;
-			fprintf(stderr,"\nUnable to open ctd data file <%s> for writing\n",ctdfile);
-			fprintf(stderr,"\nProgram <%s> Terminated\n",
-				program_name);
-			exit(error);
-			}
-
-		/* initialize asynchronous heading output file */
-		sprintf(athfile,"%s.ath",ofile);
-		if ((athfp = fopen(athfile, "w")) == NULL)
-			{
-			error = MB_ERROR_OPEN_FAIL;
-			fprintf(stderr,"\nUnable to open asynchronous heading data file <%s> for writing\n",athfile);
-			fprintf(stderr,"\nProgram <%s> Terminated\n",
-				program_name);
-			exit(error);
-			}
-
-		/* initialize asynchronous sonardepth output file */
-		sprintf(atsfile,"%s.ats",ofile);
-		if ((atsfp = fopen(atsfile, "w")) == NULL)
-			{
-			error = MB_ERROR_OPEN_FAIL;
-			fprintf(stderr,"\nUnable to open asynchronous sonardepth data file <%s> for writing\n",atsfile);
-			fprintf(stderr,"\nProgram <%s> Terminated\n",
-				program_name);
-			exit(error);
-			}
-
-		/* initialize asynchronous attitude output file */
-		sprintf(atafile,"%s.ata",ofile);
-		if ((atafp = fopen(atafile, "w")) == NULL)
-			{
-			error = MB_ERROR_OPEN_FAIL;
-			fprintf(stderr,"\nUnable to open asynchronous attitude data file <%s> for writing\n",atafile);
-			fprintf(stderr,"\nProgram <%s> Terminated\n",
-				program_name);
-			exit(error);
-			}
-
-		/* initialize synchronous attitude output file */
-		sprintf(stafile,"%s.sta",ofile);
-		if ((stafp = fopen(stafile, "w")) == NULL)
-			{
-			error = MB_ERROR_OPEN_FAIL;
-			fprintf(stderr,"\nUnable to open synchronous attitude data file <%s> for writing\n",stafile);
-			fprintf(stderr,"\nProgram <%s> Terminated\n",
-				program_name);
-			exit(error);
-			}
-		}
-
-	/* get pointers to data storage */
-	imb_io_ptr = (struct mb_io_struct *) imbio_ptr;
-	istore_ptr = imb_io_ptr->store_data;
-	istore = (struct mbsys_reson7k_struct *) istore_ptr;
-
-	/* initialize pixel_size and swath_width */
-	pixel_size = 0.0;
-	swath_width = 0.0;
-
-	if (error == MB_ERROR_NO_ERROR)
-		{
-		beamflag = NULL;
-		bath = NULL;
-		amp = NULL;
-		bathacrosstrack = NULL;
-		bathalongtrack = NULL;
-		ss = NULL;
-		ssacrosstrack = NULL;
-		ssalongtrack = NULL;
-		}
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(char), (void **)&beamflag, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(double), (void **)&bath, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_AMPLITUDE,
-						sizeof(double), (void **)&amp, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(double), (void **)&bathacrosstrack, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(double), (void **)&bathalongtrack, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_SIDESCAN,
-						sizeof(double), (void **)&ss, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_SIDESCAN,
-						sizeof(double), (void **)&ssacrosstrack, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_SIDESCAN,
-						sizeof(double), (void **)&ssalongtrack, &error);
-
-	/* if error initializing memory then quit */
-	if (error != MB_ERROR_NO_ERROR)
-		{
-		mb_error(verbose,error,&message);
-		fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",
-			message);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-
-	/* reset file record counters */
-	nrec_reference = 0;
-	nrec_sensoruncal = 0;
-	nrec_sensorcal = 0;
-	nrec_position = 0;
-	nrec_customattitude = 0;
-	nrec_tide = 0;
-	nrec_altitude = 0;
-	nrec_motion = 0;
-	nrec_depth = 0;
-	nrec_svp = 0;
-	nrec_ctd = 0;
-	nrec_geodesy = 0;
-	nrec_rollpitchheave = 0;
-	nrec_heading = 0;
-	nrec_surveyline = 0;
-	nrec_navigation = 0;
-	nrec_attitude = 0;
-	nrec_fsdwsslo = 0;
-	nrec_fsdwsshi = 0;
-	nrec_fsdwsbp = 0;
-	nrec_bluefinnav = 0;
-	nrec_bluefinenv = 0;
-	nrec_multibeam = 0;
-	nrec_volatilesettings = 0;
-	nrec_configuration = 0;
-	nrec_matchfilter = 0;
-	nrec_beamgeometry = 0;
-	nrec_calibration = 0;
-	nrec_bathymetry = 0;
-	nrec_backscatter = 0;
-	nrec_beam = 0;
-	nrec_verticaldepth = 0;
-	nrec_image = 0;
-	nrec_v2pingmotion = 0;
-	nrec_v2detectionsetup = 0;
-	nrec_v2beamformed = 0;
-	nrec_v2detection = 0;
-	nrec_v2rawdetection = 0;
-	nrec_v2snippet = 0;
-	nrec_calibratedsnippet = 0;
-	nrec_processedsidescan = 0;
-	nrec_installation = 0;
-	nrec_systemeventmessage = 0;
-	nrec_fileheader = 0;
-	nrec_remotecontrolsettings = 0;
-	nrec_other = 0;
-
-	/* read and print data */
-	while (error <= MB_ERROR_NO_ERROR)
-		{
-		/* reset error */
-		status = MB_SUCCESS;
-		error = MB_ERROR_NO_ERROR;
-
-		/* read next data record */
-		status = mb_get_all(verbose,imbio_ptr,&istore_ptr,&kind,
-				    time_i,&time_d,&navlon,&navlat,
-				    &speed,&heading,
-				    &distance,&altitude,&sonardepth,
-				    &beams_bath,&beams_amp,&pixels_ss,
-				    beamflag,bath,amp,bathacrosstrack,bathalongtrack,
-				    ss,ssacrosstrack,ssalongtrack,
-				    comment,&error);
-
-		/* some nonfatal errors do not matter */
-		if (error < MB_ERROR_NO_ERROR && error > MB_ERROR_UNINTELLIGIBLE)
-			{
-			error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-
-	   	/* handle multibeam data */
-		if (status == MB_SUCCESS && kind == MB_DATA_DATA)
-			{
-			nrec_multibeam++;
-
-			bathymetry = &(istore->bathymetry);
-			v2detection = &(istore->v2detection);
-			v2rawdetection = &(istore->v2rawdetection);
-			if (istore->read_volatilesettings == MB_YES)
-				nrec_volatilesettings++;
-			if (istore->read_matchfilter == MB_YES)
-				nrec_matchfilter++;
-			if (istore->read_beamgeometry == MB_YES)
-				nrec_beamgeometry++;
-			if (istore->read_remotecontrolsettings == MB_YES)
-				nrec_remotecontrolsettings++;
-			if (istore->read_bathymetry == MB_YES)
-				nrec_bathymetry++;
-			if (istore->read_backscatter == MB_YES)
-				nrec_backscatter++;
-			if (istore->read_beam == MB_YES)
-				nrec_beam++;
-			if (istore->read_verticaldepth == MB_YES)
-				nrec_verticaldepth++;
-			if (istore->read_image == MB_YES)
-				nrec_image++;
-			if (istore->read_v2pingmotion == MB_YES)
-				nrec_v2pingmotion++;
-			if (istore->read_v2detectionsetup == MB_YES)
-				nrec_v2detectionsetup++;
-			if (istore->read_v2beamformed == MB_YES)
-				nrec_v2beamformed++;
-			if (istore->read_v2detection == MB_YES)
-				nrec_v2detection++;
-			if (istore->read_v2rawdetection == MB_YES)
-				nrec_v2rawdetection++;
-			if (istore->read_v2snippet == MB_YES)
-				nrec_v2snippet++;
-			if (istore->read_calibratedsnippet == MB_YES)
-				nrec_calibratedsnippet++;
-			if (istore->read_processedsidescan == MB_YES)
-				nrec_processedsidescan++;
-
-			/* print out record headers */
-			if (istore->read_volatilesettings == MB_YES)
-				{
-				volatilesettings = &(istore->volatilesettings);
-				header = &(volatilesettings->header);
-				time_j[0] = header->s7kTime.Year;
-				time_j[1] = header->s7kTime.Day;
-				time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-				time_j[3] = (int) header->s7kTime.Seconds;
-				time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-				mb_get_itime(verbose, time_j, time_i);
-				mb_get_time(verbose, time_i, &time_d);
-				if (verbose > 0)
-				fprintf(stderr,"R7KRECID_7kVolatileSonarSettings:  7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d\n",
-					time_i[0],time_i[1],time_i[2],
-					time_i[3],time_i[4],time_i[5],time_i[6],
-					header->RecordNumber);
-				}
-			if (istore->read_matchfilter == MB_YES)
-				{
-				matchfilter = &(istore->matchfilter);
-				header = &(matchfilter->header);
-				time_j[0] = header->s7kTime.Year;
-				time_j[1] = header->s7kTime.Day;
-				time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-				time_j[3] = (int) header->s7kTime.Seconds;
-				time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-				mb_get_itime(verbose, time_j, time_i);
-				mb_get_time(verbose, time_i, &time_d);
-				if (verbose > 0)
-				fprintf(stderr,"R7KRECID_7kMatchFilter:            7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d\n",
-					time_i[0],time_i[1],time_i[2],
-					time_i[3],time_i[4],time_i[5],time_i[6],
-					header->RecordNumber);
-				}
-			if (istore->read_beamgeometry == MB_YES)
-				{
-				beamgeometry = &(istore->beamgeometry);
-				header = &(beamgeometry->header);
-				time_j[0] = header->s7kTime.Year;
-				time_j[1] = header->s7kTime.Day;
-				time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-				time_j[3] = (int) header->s7kTime.Seconds;
-				time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-				mb_get_itime(verbose, time_j, time_i);
-				mb_get_time(verbose, time_i, &time_d);
-				if (verbose > 0)
-				fprintf(stderr,"R7KRECID_7kBeamGeometry:           7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d beams:%d\n",
-					time_i[0],time_i[1],time_i[2],
-					time_i[3],time_i[4],time_i[5],time_i[6],
-					header->RecordNumber,beamgeometry->number_beams);
-				}
-			if (istore->read_remotecontrolsettings == MB_YES)
-				{
-				remotecontrolsettings = &(istore->remotecontrolsettings);
-				header = &(remotecontrolsettings->header);
-				time_j[0] = header->s7kTime.Year;
-				time_j[1] = header->s7kTime.Day;
-				time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-				time_j[3] = (int) header->s7kTime.Seconds;
-				time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-				mb_get_itime(verbose, time_j, time_i);
-				mb_get_time(verbose, time_i, &time_d);
-				if (verbose > 0)
-				fprintf(stderr,"R7KRECID_7kremotecontrolsettings:  7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d\n",
-					time_i[0],time_i[1],time_i[2],
-					time_i[3],time_i[4],time_i[5],time_i[6],
-					header->RecordNumber);
-				}
-			if (istore->read_bathymetry != MB_YES)
-				{
-				status = MB_FAILURE;
-				error = MB_ERROR_IGNORE;
-				}
-			else if (istore->read_bathymetry == MB_YES)
-				{
-				bathymetry = &(istore->bathymetry);
-				header = &(bathymetry->header);
-				time_j[0] = header->s7kTime.Year;
-				time_j[1] = header->s7kTime.Day;
-				time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-				time_j[3] = (int) header->s7kTime.Seconds;
-				time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-				mb_get_itime(verbose, time_j, time_i);
-				mb_get_time(verbose, time_i, &time_d);
-				last_7k_time_d = MAX(last_7k_time_d, time_d);
-				if (verbose > 0)
-				fprintf(stderr,"R7KRECID_7kBathymetricData:        7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d ping:%d beams:%d\n",
-					time_i[0],time_i[1],time_i[2],
-					time_i[3],time_i[4],time_i[5],time_i[6],
-					header->RecordNumber,bathymetry->ping_number,bathymetry->number_beams);
-				if (last_7k_time_d > time_d)
-					{
-					status = MB_FAILURE;
-					error = MB_ERROR_IGNORE;
-					}
-
-				/* apply fixes to good data */
-				if (status == MB_SUCCESS)
-					{
-					/* fix time stamp */
-					if (fix_time_stamps == MB7KPREPROCESS_TIMEFIX_RESON)
-						{
-						found = MB_NO;
-						for (j=0; j < nbatht && found == MB_NO; j++)
-							{
-							if (bathymetry->ping_number == batht_ping[j])
-								{
-								found = MB_YES;
-								time_d = batht_time_d_new[j];
-								mb_get_date(verbose, time_d, time_i);
-								mb_get_jtime(verbose, time_i, time_j);
-								header->s7kTime.Year = time_j[0];
-								header->s7kTime.Day = time_j[1];
-								header->s7kTime.Hours = time_i[3];
-								header->s7kTime.Minutes = time_i[4];
-								header->s7kTime.Seconds = time_i[5] + 0.000001 * time_i[6];
-								}
-							}
-						}
-
-					/* fix version 4 quality flags */
-					if (bathymetry->header.Version < 5)
-						{
-						for (i=0;i<bathymetry->number_beams;i++)
-							{
-							if ((bathymetry->quality[i]) < 16)
-								{
-								if (bathymetry->range[i] > 0.007)
-									{
-									bathymetry->quality[i] = 23;
-									}
-								else if (bathymetry->range[i] > 0.0)
-									{
-									bathymetry->quality[i] = 20;
-									}
-								else
-									{
-									bathymetry->quality[i] = 0;
-									}
-								}
-							}
-						}
-
-					/* fix early version 5 quality flags */
-					else if (bathymetry->header.Version == 5
-							&& header->s7kTime.Year < 2006)
-						{
-						for (i=0;i<bathymetry->number_beams;i++)
-							{
-							/* phase picks */
-							if ((bathymetry->quality[i]) == 8)
-								{
-/*fprintf(stderr,"beam %d: PHASE quality: %d",i,bathymetry->quality[i]);*/
-								bathymetry->quality[i] = 32 + 15;
-/*fprintf(stderr," %d\n",bathymetry->quality[i]);*/
-								}
-							else if ((bathymetry->quality[i]) == 4)
-								{
-/*fprintf(stderr,"beam %d: AMPLI quality: %d",i,bathymetry->quality[i]);*/
-								bathymetry->quality[i] = 16 + 15;
-/*fprintf(stderr," %d\n",bathymetry->quality[i]);*/
-								}
-							}
-						}
-
-					/* fix early MBARI version 5 quality flags */
-					else if (bathymetry->header.Version == 5
-							&& MBARIdata == MB_YES
-							&& header->s7kTime.Year < 2008)
-						{
-						for (i=0;i<bathymetry->number_beams;i++)
-							{
-							/* phase picks */
-							if ((bathymetry->quality[i]) == 4)
-								{
-/*fprintf(stderr,"beam %d: PHASE quality: %d",i,bathymetry->quality[i]);*/
-								bathymetry->quality[i] = 32 + 15;
-/*fprintf(stderr," %d\n",bathymetry->quality[i]);*/
-								}
-							else if ((bathymetry->quality[i]) == 2)
-								{
-/*fprintf(stderr,"beam %d: AMPLI quality: %d",i,bathymetry->quality[i]);*/
-								bathymetry->quality[i] = 16 + 15;
-/*fprintf(stderr," %d\n",bathymetry->quality[i]);*/
-								}
-							}
-						}
-
-					/* fix upgraded MBARI version 5 quality flags */
-					else if (bathymetry->header.Version >= 5
-							&& MBARIdata == MB_YES
-							&& header->s7kTime.Year <= 2010)
-						{
-						for (i=0;i<bathymetry->number_beams;i++)
-							{
-/* fprintf(stderr,"S Flag[%d]: %d\n",i,bathymetry->quality[i]); */
-							bathymetry->quality[i] = bathymetry->quality[i] & 15;
-
-							/* phase or amplitude picks */
-							if (bathymetry->quality[i] & 8)
-								{
-/* fprintf(stderr,"beam %d: PHASE quality: %d",i,bathymetry->quality[i]); */
-								bathymetry->quality[i] += 32;
-/* fprintf(stderr," %d\n",bathymetry->quality[i]); */
-								}
-							else if (bathymetry->quality[i] & 4)
-								{
-/* fprintf(stderr,"beam %d: AMPLI quality: %d",i,bathymetry->quality[i]); */
-								bathymetry->quality[i] += 16;
-/* fprintf(stderr," %d\n",bathymetry->quality[i]); */
-								}
-
-							/* flagged by sonar */
-							if ((bathymetry->quality[i] & 3) == 0 && bathymetry->quality[i] > 0)
-								{
-								bathymetry->quality[i] += 64;
-								}
-/* fprintf(stderr,"E Flag[%d]: %d\n\n",i,bathymetry->quality[i]); */
-							}
-						}
-
-					/* fix upgraded version 5 quality flags */
-					else if (bathymetry->header.Version >= 5)
-						{
-						for (i=0;i<bathymetry->number_beams;i++)
-							{
-//fprintf(stderr,"S Flag[%d]: %d\n",i,bathymetry->quality[i]);
-							bathymetry->quality[i] = bathymetry->quality[i] & 15;
-
-							/* phase or amplitude picks */
-							if (bathymetry->quality[i] & 8)
-								{
-//fprintf(stderr,"beam %d: PHASE quality: %d",i,bathymetry->quality[i]);
-								bathymetry->quality[i] += 32;
-//fprintf(stderr," %d\n",bathymetry->quality[i]);
-								}
-							else if (bathymetry->quality[i] & 4)
-								{
-//fprintf(stderr,"beam %d: AMPLI quality: %d",i,bathymetry->quality[i]);
-								bathymetry->quality[i] += 16;
-//fprintf(stderr," %d\n",bathymetry->quality[i]);
-								}
-
-							/* flagged by sonar */
-							if ((bathymetry->quality[i] & 3) == 3)
-								{
-								}
-							else if ((bathymetry->quality[i] & 3) == 0 && bathymetry->quality[i] > 0)
-								{
-								bathymetry->quality[i] += 64;
-								}
-							else if (bathymetry->quality[i] > 0)
-								{
-								bathymetry->quality[i] += 64;
-								}
-//fprintf(stderr,"E Flag[%d]: %d\n\n",i,bathymetry->quality[i]);
-							}
-						}
-
-					/* apply specified offsets to range values */
-					for (j=0;j<nrangeoffset;j++)
-						{
-						for (i=rangeoffsetstart[j];i<=rangeoffsetend[j];i++)
-							{
-							bathymetry->range[i] += rangeoffset[j];
-							}
-						}
-
-					/* recalculate optional values in bathymetry record */
-					interp_status = MB_SUCCESS;
-
-					/* get nav */
-					j = 0;
-					if (nins > 0)
-						{
-						interp_status = mb_linear_interp_longitude(verbose,
-									ins_time_d-1, ins_lon-1,
-									nins, time_d, &navlon, &jins,
-									&error);
-						if (interp_status == MB_SUCCESS)
-						interp_status = mb_linear_interp_latitude(verbose,
-									ins_time_d-1, ins_lat-1,
-									nins, time_d, &navlat, &jins,
-									&error);
-						if (interp_status == MB_SUCCESS)
-						interp_status = mb_linear_interp(verbose,
-									ins_speed_time_d-1, ins_speed-1,
-									nins_speed, time_d, &speed, &jins,
-									&error);
-						}
-					else if (nrock > 0)
-						{
-						interp_status = mb_linear_interp_longitude(verbose,
-									rock_time_d-1, rock_lon-1,
-									nrock, time_d, &navlon, &jrock,
-									&error);
-						if (interp_status == MB_SUCCESS)
-						interp_status = mb_linear_interp_latitude(verbose,
-									rock_time_d-1, rock_lat-1,
-									nrock, time_d, &navlat, &jrock,
-									&error);
-						if (jrock > 1)
-							{
-							j1 = jrock - 2;
-							j2 = jrock - 1;
-							}
-						else
-							{
-							j1 = jrock - 1;
-							j2 = jrock;
-							}
-						mb_coor_scale(verbose,navlat,&mtodeglon,&mtodeglat);
-						dx = (rock_lon[j2] - rock_lon[j1])/mtodeglon;
-						dy = (rock_lat[j2] - rock_lat[j1])/mtodeglat;
-						dist = sqrt(dx*dx + dy*dy);
-						dt = (rock_time_d[j2] - rock_time_d[j1]);
-						if (dt > 0.0)
-							speed = 3.6 * dist / dt;
-						}
-					else if (ndsl > 0)
-						{
-						interp_status = mb_linear_interp_longitude(verbose,
-									dsl_time_d-1, dsl_lon-1,
-									ndsl, time_d, &navlon, &jdsl,
-									&error);
-						if (interp_status == MB_SUCCESS)
-						interp_status = mb_linear_interp_latitude(verbose,
-									dsl_time_d-1, dsl_lat-1,
-									ndsl, time_d, &navlat, &jdsl,
-									&error);
-						if (jdsl > 1)
-							{
-							j1 = jdsl - 2;
-							j2 = jdsl - 1;
-							}
-						else
-							{
-							j1 = jdsl - 1;
-							j2 = jdsl;
-							}
-						mb_coor_scale(verbose,navlat,&mtodeglon,&mtodeglat);
-						dx = (dsl_lon[j2] - dsl_lon[j1])/mtodeglon;
-						dy = (dsl_lat[j2] - dsl_lat[j1])/mtodeglat;
-						dist = sqrt(dx*dx + dy*dy);
-						dt = (dsl_time_d[j2] - dsl_time_d[j1]);
-						if (dt > 0.0)
-							speed = 3.6 * dist / dt;
-						}
-					else if (ndat_nav > 0)
-						{
-						interp_status = mb_linear_interp_longitude(verbose,
-									dat_nav_time_d-1, dat_nav_lon-1,
-									ndat_nav, time_d, &navlon, &jdnav,
-									&error);
-						if (interp_status == MB_SUCCESS)
-						interp_status = mb_linear_interp_latitude(verbose,
-									dat_nav_time_d-1, dat_nav_lat-1,
-									ndat_nav, time_d, &navlat, &jdnav,
-									&error);
-						if (interp_status == MB_SUCCESS)
-						interp_status = mb_linear_interp(verbose,
-									dat_nav_time_d-1, dat_nav_speed-1,
-									ndat_nav, time_d, &speed, &jdnav,
-									&error);
-						}
-					else
-						{
-						navlon = 0.0;
-						navlat = 0.0;
-						speed = 0.0;
-						}
-
-					/* get heading */
-					j = 0;
-					if (interp_status != MB_SUCCESS)
-						{
-						}
-					else if (nins > 0)
-						{
-						interp_status = mb_linear_interp_heading(verbose,
-									ins_time_d-1, ins_heading-1,
-									nins, time_d, &heading, &jins,
-									&error);
-						}
-					else if (nrock > 0)
-						{
-						interp_status = mb_linear_interp_heading(verbose,
-									rock_time_d-1, rock_heading-1,
-									nrock, time_d, &heading, &jrock,
-									&error);
-						}
-					else if (ndsl > 0)
-						{
-						interp_status = mb_linear_interp_heading(verbose,
-									dsl_time_d-1, dsl_heading-1,
-									ndsl, time_d, &heading, &jdsl,
-									&error);
-						}
-					else if (ndat_heading > 0)
-						{
-						interp_status = mb_linear_interp_heading(verbose,
-									dat_heading_time_d-1, dat_heading_heading-1,
-									ndat_heading, time_d, &heading, &jdheading,
-									&error);
-						}
-					else
-						{
-						heading = 0.0;
-						}
-					if (heading < 0.0)
-						heading += 360.0;
-					else if (heading >= 360.0)
-						heading -= 360.0;
-
-					/* get altitude */
-					if (interp_status != MB_SUCCESS)
-						{
-						}
-					else if (nins > 0)
-						{
-						interp_status = mb_linear_interp(verbose,
-									ins_altitude_time_d-1, ins_altitude-1,
-									nins_altitude, time_d, &altitude, &jins,
-									&error);
-						}
-					else if (ndat_altitude > 0)
-						{
-						interp_status = mb_linear_interp(verbose,
-									dat_altitude_time_d-1, dat_altitude_altitude-1,
-									ndat_altitude, time_d, &altitude, &jdaltitude,
-									&error);
-						}
-					else
-						{
-						altitude = 0.0;
-						}
-
-					/* get attitude */
-					if (interp_status != MB_SUCCESS)
-						{
-						}
-					else if (nins > 0)
-						{
-						interp_status = mb_linear_interp(verbose,
-									ins_time_d-1, ins_roll-1,
-									nins, time_d, &roll, &jins,
-									&error);
-						if (interp_status == MB_SUCCESS)
-						interp_status = mb_linear_interp(verbose,
-									ins_time_d-1, ins_pitch-1,
-									nins, time_d, &pitch, &jins,
-									&error);
-						heave = 0.0;
-						}
-					else if (nrock > 0)
-						{
-						interp_status = mb_linear_interp(verbose,
-									rock_time_d-1, rock_roll-1,
-									nrock, time_d, &roll, &jrock,
-									&error);
-						if (interp_status == MB_SUCCESS)
-						interp_status = mb_linear_interp(verbose,
-									rock_time_d-1, rock_pitch-1,
-									nrock, time_d, &pitch, &jrock,
-									&error);
-						heave = 0.0;
-						}
-					else if (ndsl > 0)
-						{
-						interp_status = mb_linear_interp(verbose,
-									dsl_time_d-1, dsl_roll-1,
-									ndsl, time_d, &roll, &jdsl,
-									&error);
-						if (interp_status == MB_SUCCESS)
-						interp_status = mb_linear_interp(verbose,
-									dsl_time_d-1, dsl_pitch-1,
-									ndsl, time_d, &pitch, &jdsl,
-									&error);
-						heave = 0.0;
-						}
-					else if (ndat_rph > 0)
-						{
-						interp_status = mb_linear_interp(verbose,
-									dat_rph_time_d-1, dat_rph_roll-1,
-									ndat_rph, time_d, &roll, &jdattitude,
-									&error);
-						if (interp_status == MB_SUCCESS)
-						interp_status = mb_linear_interp(verbose,
-									dat_rph_time_d-1, dat_rph_pitch-1,
-									ndat_rph, time_d, &pitch, &jdattitude,
-									&error);
-						interp_status = mb_linear_interp(verbose,
-									dat_rph_time_d-1, dat_rph_heave-1,
-									ndat_rph, time_d, &heave, &jdattitude,
-									&error);
-						}
-					else
-						{
-						roll = 0.0;
-						pitch = 0.0;
-						heave = 0.0;
-						}
-
-					/* get sonar depth */
-					if (kluge_useverticaldepth == MB_YES)
-						{
-						verticaldepth = (s7kr_verticaldepth *)&(istore->verticaldepth);
-						sonardepth = (double)(verticaldepth->vertical_depth);
-						}
-					else if (interp_status != MB_SUCCESS)
-						{
-						}
-					else if (nsonardepth > 0)
-						{
-						if (interp_status == MB_SUCCESS)
-						interp_status = mb_linear_interp(verbose,
-									sonardepth_time_d-1, sonardepth_sonardepth-1,
-									nsonardepth, time_d, &sonardepth, &jsonardepth,
-									&error);
-						}
-					else if (nins > 0)
-						{
-						interp_status = mb_linear_interp(verbose,
-									ins_time_d-1, ins_sonardepth-1,
-									nins, time_d, &sonardepth, &jins,
-									&error);
-						}
-					else if (nrock > 0)
-						{
-						interp_status = mb_linear_interp(verbose,
-									rock_time_d-1, rock_sonardepth-1,
-									nrock, time_d, &sonardepth, &jrock,
-									&error);
-						}
-					else if (ndsl > 0)
-						{
-						interp_status = mb_linear_interp(verbose,
-									dsl_time_d-1, dsl_sonardepth-1,
-									ndsl, time_d, &sonardepth, &jdsl,
-									&error);
-						}
-					else if (ndat_sonardepth > 0)
-						{
-						interp_status = mb_linear_interp(verbose,
-									dat_sonardepth_time_d-1, dat_sonardepth_sonardepth-1,
-									ndat_sonardepth, time_d, &sonardepth, &jdsonardepth,
-									&error);
-						}
-					else
-						{
-						sonardepth = 0.0;
-						}
-fprintf(stderr,"\nStarting sonardepth:%f\n",sonardepth);
-
-					/* get local translation between lon lat degrees and meters */
-					mb_coor_scale(verbose,navlat,&mtodeglon,&mtodeglat);
-					headingx = sin(DTR*heading);
-					headingy = cos(DTR*heading);	
-
-					if (platform != NULL)
-						{
-						sensor_swathbathymetry = &platform->sensors[platform->source_swathbathymetry];
-						sensor_rollpitch = &platform->sensors[platform->source_rollpitch];
-						sensor_heading = &platform->sensors[platform->source_heading];
-						sensor_position = &platform->sensors[platform->source_position];
-						sensor_depth = &platform->sensors[platform->source_depth];
-						
-						position_offset_x = 0.0;
-						position_offset_y = 0.0;
-						position_offset_z = 0.0;
-						if (sensor_swathbathymetry->offsets[0].position_offset_mode == MB_SENSOR_POSITION_OFFSET_STATIC)
-							{
-							position_offset_x = sensor_swathbathymetry->offsets[0].position_offset_x;
-							position_offset_y = sensor_swathbathymetry->offsets[0].position_offset_y;
-							position_offset_z = sensor_swathbathymetry->offsets[0].position_offset_z;
-							}
-						if (sensor_depth->offsets[0].position_offset_mode == MB_SENSOR_POSITION_OFFSET_STATIC)
-							{
-							position_offset_x -= sensor_depth->offsets[0].position_offset_x;
-							position_offset_y -= sensor_depth->offsets[0].position_offset_y;
-							position_offset_z -= sensor_depth->offsets[0].position_offset_z;
-							}
-						sonardepth += sonardepthoffset
-								+ sin(DTR * roll) * position_offset_x
-								- sin(DTR * pitch) * position_offset_y
-								+ cos(DTR * pitch) * position_offset_z;
-fprintf(stderr,"Positionoffset applied 1: sonardepthoffset:%f position_offset:%f %f %f sonardepth:%f\n",
-sonardepthoffset,position_offset_x,position_offset_y,position_offset_z,sonardepth);
-							
-						/* do lever arm calculation with sensor offsets */
-						mb_lever(verbose,
-								sensor_swathbathymetry->offsets[0].position_offset_x,
-								sensor_swathbathymetry->offsets[0].position_offset_y,
-								sensor_swathbathymetry->offsets[0].position_offset_z,
-								sensor_rollpitch->offsets[0].position_offset_x,
-								sensor_rollpitch->offsets[0].position_offset_y,
-								sensor_rollpitch->offsets[0].position_offset_z,
-								sensor_position->offsets[0].position_offset_x,
-								sensor_position->offsets[0].position_offset_y,
-								sensor_position->offsets[0].position_offset_z,
-								pitch, roll,
-								&lever_x, &lever_y, &lever_z, &error);
-
-	
-						/* apply position offsets */
-						navlon += headingy * position_offset_x * mtodeglon
-								+ headingx * position_offset_y * mtodeglon;
-						navlat+= -headingx * position_offset_x * mtodeglat
-								+ headingy * position_offset_y * mtodeglat;
-						sonardepth -= position_offset_z;
-fprintf(stderr,"Positionoffset applied 2: position_offset_z:%f sonardepth:%f\n",
-position_offset_z,sonardepth);
-
-						/* apply lever arm calculation */
-						navlon += headingy * lever_x * mtodeglon + headingx * lever_y * mtodeglon;
-						navlat+= -headingx * lever_x * mtodeglat + headingy * lever_y * mtodeglat;
-						sonardepth -= lever_z;
-fprintf(stderr,"Lever applied: lever_z:%f sonardepth:%f\n",
-lever_z,sonardepth);
-						}			
-
-					/* if the optional data are not all available, this ping
-						is not useful, and is discarded by setting
-						*error to MB_ERROR_MISSING_NAVATTITUDE
-						unless the -N flag has been specified */
-					if (interp_status == MB_FAILURE && goodnavattitudeonly == MB_YES)
-						{
-						status = MB_FAILURE;
-						error = MB_ERROR_MISSING_NAVATTITUDE;
-						}
-					}
-
-				/* if the optional data are available, then proceed */
-				if (status == MB_SUCCESS)
-					{		
-					/* initialize all of the beams */
-					for (i=0;i<bathymetry->number_beams;i++)
-						{
-						if (istore->read_v2rawdetection == MB_YES
-						    || (istore->read_v2detection == MB_YES && istore->read_v2detectionsetup == MB_YES))
-							bathymetry->quality[i] = 0;
-						bathymetry->depth[i] = 0.0;
-						bathymetry->acrosstrack[i] = 0.0;
-						bathymetry->alongtrack[i] = 0.0;
-						bathymetry->pointing_angle[i] = 0.0;
-						bathymetry->azimuth_angle[i] = 0.0;
-						}
-fprintf(stderr,"sonardepth:%f heave:%f\n",sonardepth,heave);
-
-					/* set ping values */
-					bathymetry->longitude = DTR * navlon;
-					bathymetry->latitude = DTR * navlat;
-					bathymetry->heading = DTR * heading;
-					bathymetry->height_source = 1;
-					bathymetry->tide = 0.0;
-					bathymetry->roll = DTR * roll;
-					bathymetry->pitch = DTR * pitch;
-					bathymetry->heave = heave;
-					if ((volatilesettings->receive_flags & 0x2) != 0)
-						{
-						bathymetry->vehicle_height = -sonardepth - heave;
-						}
-					else
-						{								
-						bathymetry->vehicle_height = -sonardepth;
-						}
-fprintf(stderr,"\nPing %d: %14.9f %13.9f %10.3f   %7.3f %7.3f %7.3f\n",
-nrec_multibeam+nrec_multibeam_tot,
-bathymetry->longitude, bathymetry->latitude, bathymetry->vehicle_height,
-bathymetry->heading, bathymetry->roll, bathymetry->pitch);
-
-					/* get ready to calculate bathymetry */
-					if (volatilesettings->sound_velocity > 0.0)
-						soundspeed = volatilesettings->sound_velocity;
-					else if (bluefin->environmental[0].sound_speed > 0.0)
-						soundspeed = bluefin->environmental[0].sound_speed;
-					else
-						soundspeed = 1500.0;
-					rollr = DTR * roll;
-					pitchr = DTR * pitch;
-					
-					/* zero atttitude correction if requested */
-					if (kluge_zeroattitudecorrection == MB_YES)
-						{
-						rollr = 0.0;
-						pitchr = 0.0;
-						}
-
-					/* zero alongtrack angles if requested */
-					if (kluge_zeroalongtrackangles == MB_YES)
-						{
-						for (i=0;i<bathymetry->number_beams;i++)
-							{
-							beamgeometry->angle_alongtrack[i] = 0.0;
-							}
-						}
-
-					/* if requested apply kluge scaling of rx beam angles */
-					if (kluge_beampatterntweak == MB_YES)
-						{
-						/* case of v2rawdetection record */
-						if (istore->read_v2rawdetection == MB_YES)
-							{
-							for (i=0;i<v2rawdetection->number_beams;i++)
-								{
-								v2rawdetection->rx_angle[i] *= kluge_beampatternfactor;
-								}
-							}
-						
-						/* case of v2detection record with or without v2detectionsetup */
-						else if (istore->read_v2detection == MB_YES)
-							{
-							for (i=0;i<v2detection->number_beams;i++)
-								{
-								v2detection->angle_x[i] *= kluge_beampatternfactor;
-								}
-							}
-
-
-						/* else default case of beamgeometry record */
-						else
-							{
-							for (i=0;i<bathymetry->number_beams;i++)
-								{
-								beamgeometry->angle_acrosstrack[i] *= kluge_beampatternfactor;
-								}
-							}
-						}
-
-					/* get transducer angular offsets */
-					tx_align.roll = 0.0;
-					tx_align.pitch = 0.0;
-					tx_align.heading = 0.0;
-					rx_align.roll = 0.0;
-					rx_align.pitch = 0.0;
-					rx_align.heading = 0.0;
-					if (platform != NULL)
-						{
-						sensor_swathbathymetry = &platform->sensors[platform->source_swathbathymetry];
-						sensor_rollpitch = &platform->sensors[platform->source_rollpitch];
-						sensor_heading = &platform->sensors[platform->source_heading];
-						
-						if (sensor_swathbathymetry->offsets[0].attitude_offset_mode == MB_SENSOR_ATTITUDE_OFFSET_STATIC
-							&& sensor_rollpitch->offsets[0].attitude_offset_mode == MB_SENSOR_ATTITUDE_OFFSET_STATIC)
-							{
-							tx_align.roll = sensor_swathbathymetry->offsets[0].attitude_offset_roll
-									- sensor_rollpitch->offsets[0].attitude_offset_roll;
-							tx_align.pitch = sensor_swathbathymetry->offsets[0].attitude_offset_pitch
-									- sensor_rollpitch->offsets[0].attitude_offset_pitch;
-							rx_align.roll = sensor_swathbathymetry->offsets[0].attitude_offset_roll
-									- sensor_rollpitch->offsets[0].attitude_offset_roll;
-							rx_align.pitch = sensor_swathbathymetry->offsets[0].attitude_offset_pitch
-									- sensor_rollpitch->offsets[0].attitude_offset_pitch;
-							}
-						if (sensor_swathbathymetry->offsets[0].attitude_offset_mode == MB_SENSOR_ATTITUDE_OFFSET_STATIC
-							&& sensor_heading->offsets[0].attitude_offset_mode == MB_SENSOR_ATTITUDE_OFFSET_STATIC)
-							{
-							tx_align.heading = sensor_swathbathymetry->offsets[0].attitude_offset_azimuth
-									- sensor_heading->offsets[0].attitude_offset_azimuth;
-							rx_align.heading = sensor_swathbathymetry->offsets[0].attitude_offset_azimuth
-									- sensor_heading->offsets[0].attitude_offset_azimuth;
-							}
-						}			
-
-					/* loop over detections as available - the 7k format has used several
-					   different records over the years, so there are several different
-					   cases that must be handled */
-
-					/* case of v2rawdetection record */
-					if (istore->read_v2rawdetection == MB_YES)
-						{
-						for (j=0;j<v2rawdetection->number_beams;j++)
-							{
-							/* beam id */
-							i = v2rawdetection->beam_descriptor[j];
-							
-							/* get range and quality */
-							bathymetry->range[i] = v2rawdetection->detection_point[j]
-										/ v2rawdetection->sampling_rate;
-							bathymetry->quality[i] = v2rawdetection->quality[j];
-							
-							/* get roll at bottom return time for this beam */
-							if (nins > 0)
-								{
-								interp_status = mb_linear_interp(verbose,
-											ins_time_d-1, ins_roll-1,
-											nins, time_d + bathymetry->range[i], &beamroll, &jins,
-											&error);
-								}
-							else if (nrock > 0)
-								{
-								interp_status = mb_linear_interp(verbose,
-											rock_time_d-1, rock_roll-1,
-											nrock, time_d + bathymetry->range[i], &beamroll, &jrock,
-											&error);
-								}
-							else if (ndsl > 0)
-								{
-								interp_status = mb_linear_interp(verbose,
-											dsl_time_d-1, dsl_roll-1,
-											ndsl, time_d + bathymetry->range[i], &beamroll, &jdsl,
-											&error);
-								}
-							else if (ndat_rph > 0)
-								{
-								interp_status = mb_linear_interp(verbose,
-											dat_rph_time_d-1, dat_rph_roll-1,
-											ndat_rph, time_d + bathymetry->range[i], &beamroll, &jdattitude,
-											&error);
-								}
-							else
-								{
-								beamroll = roll;
-								}
-							beamrollr = DTR * beamroll;
-							
-							/* get pitch at bottom return time for this beam */
-							if (nins > 0)
-								{
-								interp_status = mb_linear_interp(verbose,
-											ins_time_d-1, ins_pitch-1,
-											nins, time_d + bathymetry->range[i], &beampitch, &jins,
-											&error);
-								}
-							else if (nrock > 0)
-								{
-								interp_status = mb_linear_interp(verbose,
-											rock_time_d-1, rock_pitch-1,
-											nrock, time_d + bathymetry->range[i], &beampitch, &jrock,
-											&error);
-								}
-							else if (ndsl > 0)
-								{
-								interp_status = mb_linear_interp(verbose,
-											dsl_time_d-1, dsl_pitch-1,
-											ndsl, time_d + bathymetry->range[i], &beampitch, &jdsl,
-											&error);
-								}
-							else if (ndat_rph > 0)
-								{
-								interp_status = mb_linear_interp(verbose,
-											dat_rph_time_d-1, dat_rph_pitch-1,
-											ndat_rph, time_d + bathymetry->range[i], &beampitch, &jdattitude,
-											&error);
-								}
-							else
-								{
-								beampitch = pitch;
-								}
-							beampitchr = DTR * beampitch;
-							
-							/* get heading at bottom return time for this beam */
-							if (nins > 0)
-								{
-								interp_status = mb_linear_interp(verbose,
-											ins_time_d-1, ins_heading-1,
-											nins, time_d + bathymetry->range[i], &beamheading, &jins,
-											&error);
-								}
-							else if (nrock > 0)
-								{
-								interp_status = mb_linear_interp(verbose,
-											rock_time_d-1, rock_heading-1,
-											nrock, time_d + bathymetry->range[i], &beamheading, &jrock,
-											&error);
-								}
-							else if (ndsl > 0)
-								{
-								interp_status = mb_linear_interp(verbose,
-											dsl_time_d-1, dsl_heading-1,
-											ndsl, time_d + bathymetry->range[i], &beamheading, &jdsl,
-											&error);
-								}
-							else if (ndat_heading > 0)
-								{
-								interp_status = mb_linear_interp_heading(verbose,
-											dat_heading_time_d-1, dat_heading_heading-1,
-											ndat_heading, time_d + bathymetry->range[i], &beamheading, &jdheading,
-											&error);
-								}
-							else
-								{
-								beamheading = heading;
-								}
-							beamheadingr = DTR * beamheading;
-							
-							/* calculate beam angles for raytracing using Jon Beaudoin's code based on:
-								Beaudoin, J., Hughes Clarke, J., and Bartlett, J. Application of
-								Surface Sound Speed Measurements in Post-Processing for Multi-Sector
-								Multibeam Echosounders : International Hydrographic Review, v.5, no.3,
-								p.26-31.
-								(http://www.omg.unb.ca/omg/papers/beaudoin_IHR_nov2004.pdf).
-							   note complexity if transducer arrays are reverse mounted, as determined
-							   by a mount heading angle of about 180 degrees rather than about 0 degrees.
-							   If a receive array or a transmit array are reverse mounted then:
-								1) subtract 180 from the heading mount angle of the array
-								2) flip the sign of the pitch and roll mount offsets of the array
-								3) flip the sign of the beam steering angle from that array
-									(reverse TX means flip sign of TX steer, reverse RX
-									means flip sign of RX steer) */
-							tx_steer = RTD * v2rawdetection->tx_angle;
-							tx_orientation.roll = roll;
-							tx_orientation.pitch = pitch;
-							tx_orientation.heading = heading;
-							rx_steer = -RTD * v2rawdetection->rx_angle[j];
-							rx_orientation.roll = beamroll;
-							rx_orientation.pitch = beampitch;
-							rx_orientation.heading = beamheading;
-							reference_heading = heading;
-			
-							status = mb_beaudoin(verbose,
-										tx_align,
-										tx_orientation,
-										tx_steer,
-										rx_align,
-										rx_orientation,
-										rx_steer,
-										reference_heading,
-										&beamAzimuth,
-										&beamDepression,
-										&error);
-							theta = 90.0 - beamDepression;
-							phi = 90.0 - beamAzimuth;
-							if (phi < 0.0)
-								phi += 360.0;
-fprintf(stderr,"Beam:%5d:%3.3d tx: %f %f %f %f  rx: %f %f %f %f  refh:%f",
-nrec_multibeam+nrec_multibeam_tot, i, tx_orientation.roll, tx_orientation.pitch, tx_orientation.heading, tx_steer,
-rx_orientation.roll, rx_orientation.pitch, rx_orientation.heading, rx_steer, reference_heading);
-
-// BD    -90   0    +90
-// MB    180  90     0
-// MB = -BD + X
-// 180 = 90 + X ==> X = 90
-// 90 = -0 + X ==> X = 90
-// 0 = -90 + X ==> X = 90
- 														
-							/* calculate beam angles the old way */
-							/*alpha = RTD * (beampitchr + v2rawdetection->tx_angle) + pitchbias;
-							beta = 90.0 - RTD * (v2rawdetection->rx_angle[j] - beamrollr) + rollbias;
-							mb_rollpitch_to_takeoff(
-								verbose,
-								alpha, beta,
-								&theta, &phi,
-								&error);*/
- 
-							/* calculate bathymetry */
-							rr = 0.5 * soundspeed * bathymetry->range[i];
-							xx = rr * sin(DTR * theta);
-							zz = rr * cos(DTR * theta);
-							bathymetry->acrosstrack[i] = xx * cos(DTR * phi);
-							bathymetry->alongtrack[i] = xx * sin(DTR * phi);
-							bathymetry->depth[i] = zz + sonardepth - heave;
-							bathymetry->pointing_angle[i] = DTR * theta;
-							bathymetry->azimuth_angle[i] = DTR * phi;
-fprintf(stderr," beamAzimuth:%f beamDepression:%f theta:%f phi:%f  bath: %f %f %f\n",
-beamAzimuth, beamDepression, theta, phi, bathymetry->acrosstrack[i], bathymetry->alongtrack[i], zz);
-							}
-						}
-
-					/* case of v2detection record with v2detectionsetup */
-					else if (istore->read_v2detection == MB_YES && istore->read_v2detectionsetup == MB_YES)
-						{
-						for (j=0;j<v2detection->number_beams;j++)
-							{
-							i = v2detectionsetup->beam_descriptor[j];
-			
-							bathymetry->range[i] = v2detection->range[j];
-							bathymetry->quality[i] = v2detectionsetup->quality[j];
-							
-							/* compensate for pitch if not already compensated */
-							if ((volatilesettings->transmit_flags & 0xF) != 0)
-								{
-								beampitch = 0.0;
-								}
-							else
-								{
-								beampitch = pitch;
-								}
-							beampitchr = DTR * beampitch;
-							
-							/* compensate for roll if not already compensated */
-							if ((volatilesettings->receive_flags & 0x1) != 0)
-								{
-								beamroll = 0.0;
-								}
-							else
-								{								
-								/* get roll at bottom return time for this beam */
-								if (nins > 0)
-									{
-									interp_status = mb_linear_interp(verbose,
-												ins_time_d-1, ins_roll-1,
-												nins, time_d + bathymetry->range[i], &beamroll, &jins,
-												&error);
-									}
-								else if (nrock > 0)
-									{
-									interp_status = mb_linear_interp(verbose,
-												rock_time_d-1, rock_roll-1,
-												nrock, time_d + bathymetry->range[i], &beamroll, &jrock,
-												&error);
-									}
-								else if (ndsl > 0)
-									{
-									interp_status = mb_linear_interp(verbose,
-												dsl_time_d-1, dsl_roll-1,
-												ndsl, time_d + bathymetry->range[i], &beamroll, &jdsl,
-												&error);
-									}
-								else if (ndat_rph > 0)
-									{
-									interp_status = mb_linear_interp(verbose,
-												dat_rph_time_d-1, dat_rph_roll-1,
-												ndat_rph, time_d + bathymetry->range[i], &beamroll, &jdattitude,
-												&error);
-									}
-								else
-									{
-									beamroll = roll;
-									}
-								}
-							beamrollr = DTR * beamroll;
-								
-							/* calculate bathymetry */
-							alpha = RTD * (v2detection->angle_y[j] + pitchr
-									+ volatilesettings->steering_vertical) + pitchbias;
-							beta = 90.0 - RTD * (v2detection->angle_x[j] - rollr) + rollbias;
-							mb_rollpitch_to_takeoff(
-								verbose,
-								alpha, beta,
-								&theta, &phi,
-								&error);
-							rr = 0.5 * soundspeed * bathymetry->range[i];
-							xx = rr * sin(DTR * theta);
-							zz = rr * cos(DTR * theta);
-							bathymetry->acrosstrack[i] = xx * cos(DTR * phi);
-							bathymetry->alongtrack[i] = xx * sin(DTR * phi);
-							bathymetry->depth[i] = zz + sonardepth - heave;
-							bathymetry->pointing_angle[i] = DTR * theta;
-							bathymetry->azimuth_angle[i] = DTR * phi;
-							}
-						}
-
-					/* case of v2detection record */
-					else if (istore->read_v2detection == MB_YES)
-						{
-						/* now loop over the detects */
-						for (i=0;i<v2detection->number_beams;i++)
-							{
-							bathymetry->range[i] = v2detection->range[i];
-							/* bathymetry->quality[i] set in bathymetry record */
-							
-							/* compensate for pitch if not already compensated */
-							if ((volatilesettings->transmit_flags & 0xF) != 0)
-								{
-								beampitch = 0.0;
-								}
-							else
-								{
-								beampitch = pitch;
-								}
-							beampitchr = DTR * beampitch;
-							
-							/* compensate for roll if not already compensated */
-							if ((volatilesettings->receive_flags & 0x1) != 0)
-								{
-								beamroll = 0.0;
-								}
-							else
-								{								
-								/* get roll at bottom return time for this beam */
-								if (nins > 0)
-									{
-									interp_status = mb_linear_interp(verbose,
-												ins_time_d-1, ins_roll-1,
-												nins, time_d + bathymetry->range[i], &beamroll, &jins,
-												&error);
-									}
-								else if (nrock > 0)
-									{
-									interp_status = mb_linear_interp(verbose,
-												rock_time_d-1, rock_roll-1,
-												nrock, time_d + bathymetry->range[i], &beamroll, &jrock,
-												&error);
-									}
-								else if (ndsl > 0)
-									{
-									interp_status = mb_linear_interp(verbose,
-												dsl_time_d-1, dsl_roll-1,
-												ndsl, time_d + bathymetry->range[i], &beamroll, &jdsl,
-												&error);
-									}
-								else if (ndat_rph > 0)
-									{
-									interp_status = mb_linear_interp(verbose,
-												dat_rph_time_d-1, dat_rph_roll-1,
-												ndat_rph, time_d + bathymetry->range[i], &beamroll, &jdattitude,
-												&error);
-									}
-								else
-									{
-									beamroll = roll;
-									}
-								}
-							beamrollr = DTR * beamroll;
-								
-							/* calculate bathymetry */
-							alpha = RTD * (v2detection->angle_y[i] + beampitchr
-									+ volatilesettings->steering_vertical) + pitchbias;
-							beta = 90.0 - RTD * (v2detection->angle_x[i] - beamrollr) + rollbias;
-							mb_rollpitch_to_takeoff(
-								verbose,
-								alpha, beta,
-								&theta, &phi,
-								&error);
-							rr = 0.5 * soundspeed * bathymetry->range[i];
-							xx = rr * sin(DTR * theta);
-							zz = rr * cos(DTR * theta);
-							bathymetry->acrosstrack[i] = xx * cos(DTR * phi);
-							bathymetry->alongtrack[i] = xx * sin(DTR * phi);
-							bathymetry->depth[i] = zz + sonardepth - heave;
-							bathymetry->pointing_angle[i] = DTR * theta;
-							bathymetry->azimuth_angle[i] = DTR * phi;
-							}
-						}
-
-					/* else default case of beamgeometry record */
-					else
-						{
-						/* loop over all beams */
-						for (i=0;i<bathymetry->number_beams;i++)
-							{
-							/* bathymetry->range[i] set */
-							/* bathymetry->quality[i] set */
-							if ((bathymetry->quality[i] & 15) > 0)
-								{
-								/* compensate for pitch if not already compensated */
-								if ((volatilesettings->transmit_flags & 0xF) != 0)
-									{
-									beampitch = 0.0;
-									}
-								else
-									{
-									beampitch = pitch;
-									}
-								beampitchr = DTR * beampitch;
-								
-								/* compensate for roll if not already compensated */
-								if ((volatilesettings->receive_flags & 0x1) != 0)
-									{
-									beamroll = 0.0;
-									}
-								else
-									{								
-									/* get roll at bottom return time for this beam */
-									if (nins > 0)
-										{
-										interp_status = mb_linear_interp(verbose,
-													ins_time_d-1, ins_roll-1,
-													nins, time_d + bathymetry->range[i], &beamroll, &jins,
-													&error);
-										}
-									else if (nrock > 0)
-										{
-										interp_status = mb_linear_interp(verbose,
-													rock_time_d-1, rock_roll-1,
-													nrock, time_d + bathymetry->range[i], &beamroll, &jrock,
-													&error);
-										}
-									else if (ndsl > 0)
-										{
-										interp_status = mb_linear_interp(verbose,
-													dsl_time_d-1, dsl_roll-1,
-													ndsl, time_d + bathymetry->range[i], &beamroll, &jdsl,
-													&error);
-										}
-									else if (ndat_rph > 0)
-										{
-										interp_status = mb_linear_interp(verbose,
-													dat_rph_time_d-1, dat_rph_roll-1,
-													ndat_rph, time_d + bathymetry->range[i], &beamroll, &jdattitude,
-													&error);
-										}
-									else
-										{
-										beamroll = roll;
-										}
-									}
-								beamrollr = DTR * beamroll;
-								
-								/* compensate for heave if not already compensated */
-								if ((volatilesettings->receive_flags & 0x2) != 0)
-									{
-									beamheave = 0.0;
-									}
-								else
-									{								
-									/* get roll at bottom return time for this beam */
-									if (ndat_rph > 0)
-										{
-										interp_status = mb_linear_interp(verbose,
-													dat_rph_time_d-1, dat_rph_heave-1,
-													ndat_rph, time_d + bathymetry->range[i], &beamheave, &jdattitude,
-													&error);
-										}
-									else
-										{
-										beamheave = heave;
-										}
-									}
-								
-								/* calculate bathymetry */
-								alpha = RTD * (beamgeometry->angle_alongtrack[i] + pitchr
-									       + volatilesettings->steering_vertical) + pitchbias;
-								beta = 90.0 - RTD * (beamgeometry->angle_acrosstrack[i] - beamrollr) + rollbias;
-								mb_rollpitch_to_takeoff(
-									verbose,
-									alpha, beta,
-									&theta, &phi,
-									&error);
-								rr = 0.5 * soundspeed * bathymetry->range[i];
-								xx = rr * sin(DTR * theta);
-								zz = rr * cos(DTR * theta);
-								bathymetry->acrosstrack[i] = xx * cos(DTR * phi);
-								bathymetry->alongtrack[i] = xx * sin(DTR * phi);
-								bathymetry->depth[i] = zz + sonardepth - beamheave;
-								bathymetry->pointing_angle[i] = DTR * theta;
-								bathymetry->azimuth_angle[i] = DTR * phi;
-								}
-							}
-						}
-
-					/* set flag */
-					bathymetry->optionaldata = MB_YES;
-					bathymetry->header.OffsetToOptionalData
-							= MBSYS_RESON7K_RECORDHEADER_SIZE
-								+ R7KHDRSIZE_7kBathymetricData
-								+ bathymetry->number_beams * 9;
-
-					/* output synchronous attitude */
-					fprintf(stafp, "%0.6f\t%0.3f\t%0.3f\n",
-						time_d, roll, pitch);
-					}
-				}
-			if (istore->read_backscatter == MB_YES)
-				{
-				backscatter = &(istore->backscatter);
-				header = &(backscatter->header);
-				time_j[0] = header->s7kTime.Year;
-				time_j[1] = header->s7kTime.Day;
-				time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-				time_j[3] = (int) header->s7kTime.Seconds;
-				time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-				mb_get_itime(verbose, time_j, time_i);
-				mb_get_time(verbose, time_i, &time_d);
-				if (verbose > 0)
-				fprintf(stderr,"R7KRECID_7kBackscatterImageData:   7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d ping:%d samples:%d\n",
-					time_i[0],time_i[1],time_i[2],
-					time_i[3],time_i[4],time_i[5],time_i[6],
-					header->RecordNumber,backscatter->ping_number,backscatter->number_samples);
-				}
-			if (istore->read_beam == MB_YES)
-				{
-				beam = &(istore->beam);
-				header = &(beam->header);
-				time_j[0] = header->s7kTime.Year;
-				time_j[1] = header->s7kTime.Day;
-				time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-				time_j[3] = (int) header->s7kTime.Seconds;
-				time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-				mb_get_itime(verbose, time_j, time_i);
-				mb_get_time(verbose, time_i, &time_d);
-				if (verbose > 0)
-				fprintf(stderr,"R7KRECID_7kBeamData: 7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d ping:%d beams:%d samples:%d\n",
-					time_i[0],time_i[1],time_i[2],
-					time_i[3],time_i[4],time_i[5],time_i[6],
-					header->RecordNumber,beam->ping_number,beam->number_beams,beam->number_samples);
-				}
-			if (istore->read_verticaldepth == MB_YES)
-				{
-				verticaldepth = &(istore->verticaldepth);
-				header = &(verticaldepth->header);
-				time_j[0] = header->s7kTime.Year;
-				time_j[1] = header->s7kTime.Day;
-				time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-				time_j[3] = (int) header->s7kTime.Seconds;
-				time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-				mb_get_itime(verbose, time_j, time_i);
-				mb_get_time(verbose, time_i, &time_d);
-				if (verbose > 0)
-				fprintf(stderr,"R7KRECID_7kVerticalDepth: 7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d ping:%d\n",
-					time_i[0],time_i[1],time_i[2],
-					time_i[3],time_i[4],time_i[5],time_i[6],
-					header->RecordNumber,verticaldepth->ping_number);
-				}
-			if (istore->read_image == MB_YES)
-				{
-				image = &(istore->image);
-				header = &(image->header);
-				time_j[0] = header->s7kTime.Year;
-				time_j[1] = header->s7kTime.Day;
-				time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-				time_j[3] = (int) header->s7kTime.Seconds;
-				time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-				mb_get_itime(verbose, time_j, time_i);
-				mb_get_time(verbose, time_i, &time_d);
-				if (verbose > 0)
-				fprintf(stderr,"R7KRECID_7kImageData:              7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d ping:%d width:%d height:%d\n",
-					time_i[0],time_i[1],time_i[2],
-					time_i[3],time_i[4],time_i[5],time_i[6],
-					header->RecordNumber,image->ping_number,image->width,image->height);
-				}
-
-			/* regenerate sidescan */
-			status = mbsys_reson7k_makess(verbose, imbio_ptr, istore_ptr,
-						ss_source, MB_NO, &pixel_size,
-						MB_NO, &swath_width,
-						MB_YES, &error);
-			}
-
-	   	/* handle reference point data */
-		else if (status == MB_SUCCESS && istore->type == R7KRECID_ReferencePoint)
-			{
-			nrec_reference++;
-
-			reference = &(istore->reference);
-			header = &(reference->header);
-			time_j[0] = header->s7kTime.Year;
-			time_j[1] = header->s7kTime.Day;
-			time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-			time_j[3] = (int) header->s7kTime.Seconds;
-			time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-			mb_get_itime(verbose, time_j, time_i);
-			mb_get_time(verbose, time_i, &time_d);
-			if (verbose > 0)
-				fprintf(stderr,"R7KRECID_ReferencePoint: 7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d\n",
-				time_i[0],time_i[1],time_i[2],
-				time_i[3],time_i[4],time_i[5],time_i[6],
-				header->RecordNumber);
-			}
-
-	   	/* handle uncalibrated sensor offset data */
-		else if (status == MB_SUCCESS && istore->type == R7KRECID_UncalibratedSensorOffset)
-			{
-			nrec_sensoruncal++;
-
-			sensoruncal = &(istore->sensoruncal);
-			header = &(sensoruncal->header);
-			time_j[0] = header->s7kTime.Year;
-			time_j[1] = header->s7kTime.Day;
-			time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-			time_j[3] = (int) header->s7kTime.Seconds;
-			time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-			mb_get_itime(verbose, time_j, time_i);
-			mb_get_time(verbose, time_i, &time_d);
-			if (verbose > 0)
-				fprintf(stderr,"R7KRECID_UncalibratedSensorOffset: 7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d\n",
-				time_i[0],time_i[1],time_i[2],
-				time_i[3],time_i[4],time_i[5],time_i[6],
-				header->RecordNumber);
-			}
-
-	   	/* handle calibrated sensor offset data */
-		else if (status == MB_SUCCESS && istore->type == R7KRECID_CalibratedSensorOffset)
-			{
-			nrec_sensorcal++;
-
-			sensorcal = &(istore->sensorcal);
-			header = &(sensorcal->header);
-			time_j[0] = header->s7kTime.Year;
-			time_j[1] = header->s7kTime.Day;
-			time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-			time_j[3] = (int) header->s7kTime.Seconds;
-			time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-			mb_get_itime(verbose, time_j, time_i);
-			mb_get_time(verbose, time_i, &time_d);
-			if (verbose > 0)
-				fprintf(stderr,"R7KRECID_CalibratedSensorOffset: 7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d\n",
-				time_i[0],time_i[1],time_i[2],
-				time_i[3],time_i[4],time_i[5],time_i[6],
-				header->RecordNumber);
-			}
-
-	   	/* handle position data */
-		else if (status == MB_SUCCESS && istore->type == R7KRECID_Position)
-			{
-			nrec_position++;
-
-			position = &(istore->position);
-			header = &(position->header);
-			time_j[0] = header->s7kTime.Year;
-			time_j[1] = header->s7kTime.Day;
-			time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-			time_j[3] = (int) header->s7kTime.Seconds;
-			time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-			mb_get_itime(verbose, time_j, time_i);
-			mb_get_time(verbose, time_i, &time_d);
-
-			/* get timelag value */
-			timelag = 0.0;
-			if (timedelaymode == MB7KPREPROCESS_TIMEDELAY_ON && ntimedelay > 0)
-			interp_status = mb_linear_interp(verbose,
-						timedelay_time_d-1, timedelay_timedelay-1,
-						ntimedelay, time_d, &timelag, &jtimedelay,
-						&error);
-			if (timelagmode == MB7KPREPROCESS_TIMELAG_CONSTANT)
-				{
-				timelag -= timelagconstant;
-				}
-			else if (timelagmode == MB7KPREPROCESS_TIMELAG_MODEL && ntimelag > 0)
-				{
-				interp_status = mb_linear_interp(verbose,
-							timelag_time_d-1, timelag_model-1,
-							ntimelag, time_d, &timelagm, &jtimelag,
-							&error);
-				timelag -= timelagm;
-				}
-			time_d += timelag;
-			mb_get_date(verbose, time_d,time_i);
-			mb_get_jtime(verbose, time_i, time_j);
-			header->s7kTime.Year = time_i[0];
-			header->s7kTime.Day = time_j[1];
-			header->s7kTime.Hours = time_i[3];
-			header->s7kTime.Minutes = time_i[4];
-			header->s7kTime.Seconds = time_i[5] + 0.000001 * time_i[6];
-
-			if (verbose > 0)
-				fprintf(stderr,"R7KRECID_Position: 7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d\n",
-			time_i[0],time_i[1],time_i[2],
-			time_i[3],time_i[4],time_i[5],time_i[6],
-			header->RecordNumber);
-			}
-
-	   	/* handle customattitude data */
-		else if (status == MB_SUCCESS && istore->type == R7KRECID_CustomAttitude)
-			{
-			nrec_customattitude++;
-
-			customattitude = &(istore->customattitude);
-			header = &(customattitude->header);
-			time_j[0] = header->s7kTime.Year;
-			time_j[1] = header->s7kTime.Day;
-			time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-			time_j[3] = (int) header->s7kTime.Seconds;
-			time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-			mb_get_itime(verbose, time_j, time_i);
-			mb_get_time(verbose, time_i, &time_d);
-
-			/* get timelag value */
-			timelag = 0.0;
-			if (timedelaymode == MB7KPREPROCESS_TIMEDELAY_ON && ntimedelay > 0)
-			interp_status = mb_linear_interp(verbose,
-						timedelay_time_d-1, timedelay_timedelay-1,
-						ntimedelay, time_d, &timelag, &jtimedelay,
-						&error);
-			if (timelagmode == MB7KPREPROCESS_TIMELAG_CONSTANT)
-				{
-				timelag -= timelagconstant;
-				}
-			else if (timelagmode == MB7KPREPROCESS_TIMELAG_MODEL && ntimelag > 0)
-				{
-				interp_status = mb_linear_interp(verbose,
-							timelag_time_d-1, timelag_model-1,
-							ntimelag, time_d, &timelagm, &jtimelag,
-							&error);
-				timelag -= timelagm;
-				}
-			time_d += timelag;
-			mb_get_date(verbose, time_d,time_i);
-			mb_get_jtime(verbose, time_i, time_j);
-			header->s7kTime.Year = time_i[0];
-			header->s7kTime.Day = time_j[1];
-			header->s7kTime.Hours = time_i[3];
-			header->s7kTime.Minutes = time_i[4];
-			header->s7kTime.Seconds = time_i[5] + 0.000001 * time_i[6];
-
-			if (verbose > 0)
-				fprintf(stderr,"R7KRECID_CustomAttitude: 7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d\n",
-			time_i[0],time_i[1],time_i[2],
-			time_i[3],time_i[4],time_i[5],time_i[6],
-			header->RecordNumber);
-
-			/* output asynchronous heading and attitude */
-			for (i=0; i< customattitude->n; i++)
-				{
-				fprintf(athfp, "%0.6f\t%7.3f\n", time_d, RTD * customattitude->heading[i]);
-				fprintf(atafp, "%0.6f\t%0.3f\t%0.3f\n",
-						time_d, RTD * customattitude->roll[i], RTD * customattitude->pitch[i]);
-				}
-			}
-
-	   	/* handle tide data */
-		else if (status == MB_SUCCESS && istore->type == R7KRECID_Tide)
-			{
-			nrec_tide++;
-
-			tide = &(istore->tide);
-			header = &(fileheader->header);
-			time_j[0] = header->s7kTime.Year;
-			time_j[1] = header->s7kTime.Day;
-			time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-			time_j[3] = (int) header->s7kTime.Seconds;
-			time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-			mb_get_itime(verbose, time_j, time_i);
-			mb_get_time(verbose, time_i, &time_d);
-			if (verbose > 0)
-				fprintf(stderr,"R7KRECID_Tide: 7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d\n",
-				time_i[0],time_i[1],time_i[2],
-				time_i[3],time_i[4],time_i[5],time_i[6],
-				header->RecordNumber);
-			}
-
-	   	/* handle altitude data */
-		else if (status == MB_SUCCESS && istore->type == R7KRECID_Altitude)
-			{
-			nrec_altitude++;
-
-			altituderec = &(istore->altitude);
-			header = &(fileheader->header);
-			time_j[0] = header->s7kTime.Year;
-			time_j[1] = header->s7kTime.Day;
-			time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-			time_j[3] = (int) header->s7kTime.Seconds;
-			time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-			mb_get_itime(verbose, time_j, time_i);
-			mb_get_time(verbose, time_i, &time_d);
-
-			/* get timelag value */
-			timelag = 0.0;
-			if (timedelaymode == MB7KPREPROCESS_TIMEDELAY_ON && ntimedelay > 0)
-			interp_status = mb_linear_interp(verbose,
-						timedelay_time_d-1, timedelay_timedelay-1,
-						ntimedelay, time_d, &timelag, &jtimedelay,
-						&error);
-			if (timelagmode == MB7KPREPROCESS_TIMELAG_CONSTANT)
-				{
-				timelag -= timelagconstant;
-				}
-			else if (timelagmode == MB7KPREPROCESS_TIMELAG_MODEL && ntimelag > 0)
-				{
-				interp_status = mb_linear_interp(verbose,
-							timelag_time_d-1, timelag_model-1,
-							ntimelag, time_d, &timelagm, &jtimelag,
-							&error);
-				timelag -= timelagm;
-				}
-			time_d += timelag;
-			mb_get_date(verbose, time_d,time_i);
-			mb_get_jtime(verbose, time_i, time_j);
-			header->s7kTime.Year = time_i[0];
-			header->s7kTime.Day = time_j[1];
-			header->s7kTime.Hours = time_i[3];
-			header->s7kTime.Minutes = time_i[4];
-			header->s7kTime.Seconds = time_i[5] + 0.000001 * time_i[6];
-
-			if (verbose > 0)
-				fprintf(stderr,"R7KRECID_Altitude: 7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d\n",
-				time_i[0],time_i[1],time_i[2],
-				time_i[3],time_i[4],time_i[5],time_i[6],
-				header->RecordNumber);
-			}
-
-	   	/* handle motion data */
-		else if (status == MB_SUCCESS && istore->type == R7KRECID_MotionOverGround)
-			{
-			nrec_motion++;
-
-			motion = &(istore->motion);
-			header = &(motion->header);
-			time_j[0] = header->s7kTime.Year;
-			time_j[1] = header->s7kTime.Day;
-			time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-			time_j[3] = (int) header->s7kTime.Seconds;
-			time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-			mb_get_itime(verbose, time_j, time_i);
-			mb_get_time(verbose, time_i, &time_d);
-
-			/* get timelag value */
-			timelag = 0.0;
-			if (timedelaymode == MB7KPREPROCESS_TIMEDELAY_ON && ntimedelay > 0)
-			interp_status = mb_linear_interp(verbose,
-						timedelay_time_d-1, timedelay_timedelay-1,
-						ntimedelay, time_d, &timelag, &jtimedelay,
-						&error);
-			if (timelagmode == MB7KPREPROCESS_TIMELAG_CONSTANT)
-				{
-				timelag -= timelagconstant;
-				}
-			else if (timelagmode == MB7KPREPROCESS_TIMELAG_MODEL && ntimelag > 0)
-				{
-				interp_status = mb_linear_interp(verbose,
-							timelag_time_d-1, timelag_model-1,
-							ntimelag, time_d, &timelagm, &jtimelag,
-							&error);
-				timelag -= timelagm;
-				}
-			time_d += timelag;
-			mb_get_date(verbose, time_d,time_i);
-			mb_get_jtime(verbose, time_i, time_j);
-			header->s7kTime.Year = time_i[0];
-			header->s7kTime.Day = time_j[1];
-			header->s7kTime.Hours = time_i[3];
-			header->s7kTime.Minutes = time_i[4];
-			header->s7kTime.Seconds = time_i[5] + 0.000001 * time_i[6];
-
-			if (verbose > 0)
-				fprintf(stderr,"R7KRECID_MotionOverGround: 7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d n:%d\n",
-				time_i[0],time_i[1],time_i[2],
-				time_i[3],time_i[4],time_i[5],time_i[6],
-				header->RecordNumber,motion->n);
-			}
-
-	   	/* handle depth data */
-		else if (status == MB_SUCCESS && istore->type == R7KRECID_Depth)
-			{
-			nrec_depth++;
-
-			depth = &(istore->depth);
-			header = &(depth->header);
-			time_j[0] = header->s7kTime.Year;
-			time_j[1] = header->s7kTime.Day;
-			time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-			time_j[3] = (int) header->s7kTime.Seconds;
-			time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-			mb_get_itime(verbose, time_j, time_i);
-			mb_get_time(verbose, time_i, &time_d);
-
-			/* get timelag value */
-			timelag = 0.0;
-			if (timedelaymode == MB7KPREPROCESS_TIMEDELAY_ON && ntimedelay > 0)
-			interp_status = mb_linear_interp(verbose,
-						timedelay_time_d-1, timedelay_timedelay-1,
-						ntimedelay, time_d, &timelag, &jtimedelay,
-						&error);
-			if (timelagmode == MB7KPREPROCESS_TIMELAG_CONSTANT)
-				{
-				timelag -= timelagconstant;
-				}
-			else if (timelagmode == MB7KPREPROCESS_TIMELAG_MODEL && ntimelag > 0)
-				{
-				interp_status = mb_linear_interp(verbose,
-							timelag_time_d-1, timelag_model-1,
-							ntimelag, time_d, &timelagm, &jtimelag,
-							&error);
-				timelag -= timelagm;
-				}
-			time_d += timelag;
-			mb_get_date(verbose, time_d,time_i);
-			mb_get_jtime(verbose, time_i, time_j);
-			header->s7kTime.Year = time_i[0];
-			header->s7kTime.Day = time_j[1];
-			header->s7kTime.Hours = time_i[3];
-			header->s7kTime.Minutes = time_i[4];
-			header->s7kTime.Seconds = time_i[5] + 0.000001 * time_i[6];
-
-			if (verbose > 0)
-				fprintf(stderr,"R7KRECID_Depth: 7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d\n",
-				time_i[0],time_i[1],time_i[2],
-				time_i[3],time_i[4],time_i[5],time_i[6],
-				header->RecordNumber);
-			}
-
-	   	/* handle sound velocity data */
-		else if (status == MB_SUCCESS && istore->type == R7KRECID_SoundVelocityProfile)
-			{
-			nrec_svp++;
-
-			svp = &(istore->svp);
-			header = &(svp->header);
-			time_j[0] = header->s7kTime.Year;
-			time_j[1] = header->s7kTime.Day;
-			time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-			time_j[3] = (int) header->s7kTime.Seconds;
-			time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-			mb_get_itime(verbose, time_j, time_i);
-			mb_get_time(verbose, time_i, &time_d);
-
-			/* get timelag value */
-			timelag = 0.0;
-			if (timedelaymode == MB7KPREPROCESS_TIMEDELAY_ON && ntimedelay > 0)
-			interp_status = mb_linear_interp(verbose,
-						timedelay_time_d-1, timedelay_timedelay-1,
-						ntimedelay, time_d, &timelag, &jtimedelay,
-						&error);
-			if (timelagmode == MB7KPREPROCESS_TIMELAG_CONSTANT)
-				{
-				timelag -= timelagconstant;
-				}
-			else if (timelagmode == MB7KPREPROCESS_TIMELAG_MODEL && ntimelag > 0)
-				{
-				interp_status = mb_linear_interp(verbose,
-							timelag_time_d-1, timelag_model-1,
-							ntimelag, time_d, &timelagm, &jtimelag,
-							&error);
-				timelag -= timelagm;
-				}
-			time_d += timelag;
-			mb_get_date(verbose, time_d,time_i);
-			mb_get_jtime(verbose, time_i, time_j);
-			header->s7kTime.Year = time_i[0];
-			header->s7kTime.Day = time_j[1];
-			header->s7kTime.Hours = time_i[3];
-			header->s7kTime.Minutes = time_i[4];
-			header->s7kTime.Seconds = time_i[5] + 0.000001 * time_i[6];
-
-			if (verbose > 0)
-				fprintf(stderr,"R7KRECID_SoundVelocityProfile: 7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d n:%d\n",
-				time_i[0],time_i[1],time_i[2],
-				time_i[3],time_i[4],time_i[5],time_i[6],
-				header->RecordNumber,svp->n);
-			}
-
-	   	/* handle ctd data */
-		else if (status == MB_SUCCESS && istore->type == R7KRECID_CTD)
-			{
-			nrec_ctd++;
-
-			ctd = &(istore->ctd);
-			header = &(ctd->header);
-			time_j[0] = header->s7kTime.Year;
-			time_j[1] = header->s7kTime.Day;
-			time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-			time_j[3] = (int) header->s7kTime.Seconds;
-			time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-			mb_get_itime(verbose, time_j, time_i);
-			mb_get_time(verbose, time_i, &time_d);
-
-			/* get timelag value */
-			timelag = 0.0;
-			if (timedelaymode == MB7KPREPROCESS_TIMEDELAY_ON && ntimedelay > 0)
-			interp_status = mb_linear_interp(verbose,
-						timedelay_time_d-1, timedelay_timedelay-1,
-						ntimedelay, time_d, &timelag, &jtimedelay,
-						&error);
-			if (timelagmode == MB7KPREPROCESS_TIMELAG_CONSTANT)
-				{
-				timelag -= timelagconstant;
-				}
-			else if (timelagmode == MB7KPREPROCESS_TIMELAG_MODEL && ntimelag > 0)
-				{
-				interp_status = mb_linear_interp(verbose,
-							timelag_time_d-1, timelag_model-1,
-							ntimelag, time_d, &timelagm, &jtimelag,
-							&error);
-				timelag -= timelagm;
-				}
-			time_d += timelag;
-			mb_get_date(verbose, time_d,time_i);
-			mb_get_jtime(verbose, time_i, time_j);
-			header->s7kTime.Year = time_i[0];
-			header->s7kTime.Day = time_j[1];
-			header->s7kTime.Hours = time_i[3];
-			header->s7kTime.Minutes = time_i[4];
-			header->s7kTime.Seconds = time_i[5] + 0.000001 * time_i[6];
-
-			if (verbose > 0)
-				fprintf(stderr,"R7KRECID_CTD: 7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d n:%d\n",
-			time_i[0],time_i[1],time_i[2],
-			time_i[3],time_i[4],time_i[5],time_i[6],
-			header->RecordNumber,ctd->n);
-
-			/* output ctd data to file */
-			for (i=0; i<ctd->n; i++)
-				{
-				fprintf(tfp,"%.3f %11.6f %10.6f %.3f %.3f %.2f %.3f\n",
-					time_d, navlon, navlat, sonardepth, altitude,
-					ctd->temperature[i],
-					ctd->conductivity_salinity[i]);
-				}
-			}
-
-	   	/* handle geodesy data */
-		else if (status == MB_SUCCESS && istore->type == R7KRECID_Geodesy)
-			{
-			nrec_geodesy++;
-
-			geodesy = &(istore->geodesy);
-			header = &(geodesy->header);
-			time_j[0] = header->s7kTime.Year;
-			time_j[1] = header->s7kTime.Day;
-			time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-			time_j[3] = (int) header->s7kTime.Seconds;
-			time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-			mb_get_itime(verbose, time_j, time_i);
-			mb_get_time(verbose, time_i, &time_d);
-
-			if (verbose > 0)
-				fprintf(stderr,"R7KRECID_Geodesy: 7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d\n",
-			time_i[0],time_i[1],time_i[2],
-			time_i[3],time_i[4],time_i[5],time_i[6],
-			header->RecordNumber);
-			}
-
-	   	/* handle rollpitchheave data */
-		else if (status == MB_SUCCESS && istore->type == R7KRECID_RollPitchHeave)
-			{
-			nrec_rollpitchheave++;
-
-			rollpitchheave = &(istore->rollpitchheave);
-			header = &(rollpitchheave->header);
-			time_j[0] = header->s7kTime.Year;
-			time_j[1] = header->s7kTime.Day;
-			time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-			time_j[3] = (int) header->s7kTime.Seconds;
-			time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-			mb_get_itime(verbose, time_j, time_i);
-			mb_get_time(verbose, time_i, &time_d);
-
-			/* get timelag value */
-			timelag = 0.0;
-			if (timedelaymode == MB7KPREPROCESS_TIMEDELAY_ON && ntimedelay > 0)
-			interp_status = mb_linear_interp(verbose,
-						timedelay_time_d-1, timedelay_timedelay-1,
-						ntimedelay, time_d, &timelag, &jtimedelay,
-						&error);
-			if (timelagmode == MB7KPREPROCESS_TIMELAG_CONSTANT)
-				{
-				timelag -= timelagconstant;
-				}
-			else if (timelagmode == MB7KPREPROCESS_TIMELAG_MODEL && ntimelag > 0)
-				{
-				interp_status = mb_linear_interp(verbose,
-							timelag_time_d-1, timelag_model-1,
-							ntimelag, time_d, &timelagm, &jtimelag,
-							&error);
-				timelag -= timelagm;
-				}
-			time_d += timelag;
-			mb_get_date(verbose, time_d,time_i);
-			mb_get_jtime(verbose, time_i, time_j);
-			header->s7kTime.Year = time_i[0];
-			header->s7kTime.Day = time_j[1];
-			header->s7kTime.Hours = time_i[3];
-			header->s7kTime.Minutes = time_i[4];
-			header->s7kTime.Seconds = time_i[5] + 0.000001 * time_i[6];
-
-			if (verbose > 0)
-				fprintf(stderr,"R7KRECID_RollPitchHeave:               7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d\n",
-			time_i[0],time_i[1],time_i[2],
-			time_i[3],time_i[4],time_i[5],time_i[6],
-			header->RecordNumber);
-
-			/* output asynchronous attitude */
-			fprintf(atafp, "%0.6f\t%0.3f\t%0.3f\n",
-					time_d, RTD * rollpitchheave->roll, RTD * rollpitchheave->pitch);
-			}
-
-	   	/* handle heading data */
-		else if (status == MB_SUCCESS && istore->type == R7KRECID_Heading)
-			{
-			nrec_heading++;
-
-			headingrec = &(istore->heading);
-			header = &(headingrec->header);
-			time_j[0] = header->s7kTime.Year;
-			time_j[1] = header->s7kTime.Day;
-			time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-			time_j[3] = (int) header->s7kTime.Seconds;
-			time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-			mb_get_itime(verbose, time_j, time_i);
-			mb_get_time(verbose, time_i, &time_d);
-
-			/* get timelag value */
-			timelag = 0.0;
-			if (timedelaymode == MB7KPREPROCESS_TIMEDELAY_ON && ntimedelay > 0)
-			interp_status = mb_linear_interp(verbose,
-						timedelay_time_d-1, timedelay_timedelay-1,
-						ntimedelay, time_d, &timelag, &jtimedelay,
-						&error);
-			if (timelagmode == MB7KPREPROCESS_TIMELAG_CONSTANT)
-				{
-				timelag -= timelagconstant;
-				}
-			else if (timelagmode == MB7KPREPROCESS_TIMELAG_MODEL && ntimelag > 0)
-				{
-				interp_status = mb_linear_interp(verbose,
-							timelag_time_d-1, timelag_model-1,
-							ntimelag, time_d, &timelagm, &jtimelag,
-							&error);
-				timelag -= timelagm;
-				}
-			time_d += timelag;
-			mb_get_date(verbose, time_d,time_i);
-			mb_get_jtime(verbose, time_i, time_j);
-			header->s7kTime.Year = time_i[0];
-			header->s7kTime.Day = time_j[1];
-			header->s7kTime.Hours = time_i[3];
-			header->s7kTime.Minutes = time_i[4];
-			header->s7kTime.Seconds = time_i[5] + 0.000001 * time_i[6];
-
-			if (verbose > 0)
-				fprintf(stderr,"R7KRECID_Heading: 7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d\n",
-				time_i[0],time_i[1],time_i[2],
-				time_i[3],time_i[4],time_i[5],time_i[6],
-				header->RecordNumber);
-
-			/* output asynchronous heading */
-			fprintf(athfp, "%0.6f\t%7.3f\n", time_d, RTD * headingrec->heading);
-			}
-
-	   	/* handle survey line data */
-		else if (status == MB_SUCCESS && istore->type == R7KRECID_SurveyLine)
-			{
-			nrec_surveyline++;
-
-			surveyline = &(istore->surveyline);
-			header = &(surveyline->header);
-			time_j[0] = header->s7kTime.Year;
-			time_j[1] = header->s7kTime.Day;
-			time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-			time_j[3] = (int) header->s7kTime.Seconds;
-			time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-			mb_get_itime(verbose, time_j, time_i);
-			mb_get_time(verbose, time_i, &time_d);
-
-			if (verbose > 0)
-				fprintf(stderr,"R7KRECID_SurveyLine: 7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d\n",
-			time_i[0],time_i[1],time_i[2],
-			time_i[3],time_i[4],time_i[5],time_i[6],
-			header->RecordNumber);
-			}
-
-	   	/* handle navigation data */
-		else if (status == MB_SUCCESS && istore->type == R7KRECID_Navigation)
-			{
-			nrec_navigation++;
-
-			navigation = &(istore->navigation);
-			header = &(navigation->header);
-			time_j[0] = header->s7kTime.Year;
-			time_j[1] = header->s7kTime.Day;
-			time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-			time_j[3] = (int) header->s7kTime.Seconds;
-			time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-			mb_get_itime(verbose, time_j, time_i);
-			mb_get_time(verbose, time_i, &time_d);
-
-			/* get timelag value */
-			timelag = 0.0;
-			if (timedelaymode == MB7KPREPROCESS_TIMEDELAY_ON && ntimedelay > 0)
-			interp_status = mb_linear_interp(verbose,
-						timedelay_time_d-1, timedelay_timedelay-1,
-						ntimedelay, time_d, &timelag, &jtimedelay,
-						&error);
-			if (timelagmode == MB7KPREPROCESS_TIMELAG_CONSTANT)
-				{
-				timelag -= timelagconstant;
-				}
-			else if (timelagmode == MB7KPREPROCESS_TIMELAG_MODEL && ntimelag > 0)
-				{
-				interp_status = mb_linear_interp(verbose,
-							timelag_time_d-1, timelag_model-1,
-							ntimelag, time_d, &timelagm, &jtimelag,
-							&error);
-				timelag -= timelagm;
-				}
-			time_d += timelag;
-			mb_get_date(verbose, time_d,time_i);
-			mb_get_jtime(verbose, time_i, time_j);
-			header->s7kTime.Year = time_i[0];
-			header->s7kTime.Day = time_j[1];
-			header->s7kTime.Hours = time_i[3];
-			header->s7kTime.Minutes = time_i[4];
-			header->s7kTime.Seconds = time_i[5] + 0.000001 * time_i[6];
-
-			if (verbose > 0)
-				fprintf(stderr,"R7KRECID_Navigation: 7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d\n",
-			time_i[0],time_i[1],time_i[2],
-			time_i[3],time_i[4],time_i[5],time_i[6],
-			header->RecordNumber);
-			}
-
-	   	/* handle attitude data */
-		else if (status == MB_SUCCESS && istore->type == R7KRECID_Attitude)
-			{
-			nrec_attitude++;
-
-			attitude = &(istore->attitude);
-			header = &(attitude->header);
-			time_j[0] = header->s7kTime.Year;
-			time_j[1] = header->s7kTime.Day;
-			time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-			time_j[3] = (int) header->s7kTime.Seconds;
-			time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-			mb_get_itime(verbose, time_j, time_i);
-			mb_get_time(verbose, time_i, &time_d);
-
-			/* get timelag value */
-			timelag = 0.0;
-			if (timedelaymode == MB7KPREPROCESS_TIMEDELAY_ON && ntimedelay > 0)
-			interp_status = mb_linear_interp(verbose,
-						timedelay_time_d-1, timedelay_timedelay-1,
-						ntimedelay, time_d, &timelag, &jtimedelay,
-						&error);
-			if (timelagmode == MB7KPREPROCESS_TIMELAG_CONSTANT)
-				{
-				timelag -= timelagconstant;
-				}
-			else if (timelagmode == MB7KPREPROCESS_TIMELAG_MODEL && ntimelag > 0)
-				{
-				interp_status = mb_linear_interp(verbose,
-							timelag_time_d-1, timelag_model-1,
-							ntimelag, time_d, &timelagm, &jtimelag,
-							&error);
-				timelag -= timelagm;
-				}
-			time_d += timelag;
-			mb_get_date(verbose, time_d,time_i);
-			mb_get_jtime(verbose, time_i, time_j);
-			header->s7kTime.Year = time_i[0];
-			header->s7kTime.Day = time_j[1];
-			header->s7kTime.Hours = time_i[3];
-			header->s7kTime.Minutes = time_i[4];
-			header->s7kTime.Seconds = time_i[5] + 0.000001 * time_i[6];
-
-			if (verbose > 0)
-				fprintf(stderr,"R7KRECID_Attitude: 7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d n:%d\n",
-			time_i[0],time_i[1],time_i[2],
-			time_i[3],time_i[4],time_i[5],time_i[6],
-			header->RecordNumber,attitude->n);
-
-			/* output asynchronous attitude */
-			for (i=0; i<attitude->n; i++)
-				{
-				fprintf(atafp, "%0.6f\t%0.3f\t%0.3f\n",
-						time_d, RTD * attitude->roll[i], RTD * attitude->pitch[i]);
-				}
-			}
-
-	   	/* handle file header data */
-		else if (status == MB_SUCCESS && istore->type == R7KRECID_7kFileHeader)
-			{
-			nrec_fileheader++;
-
-			fileheader = &(istore->fileheader);
-			header = &(fileheader->header);
-			time_j[0] = header->s7kTime.Year;
-			time_j[1] = header->s7kTime.Day;
-			time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-			time_j[3] = (int) header->s7kTime.Seconds;
-			time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-			mb_get_itime(verbose, time_j, time_i);
-			mb_get_time(verbose, time_i, &time_d);
-			if (verbose > 0)
-				fprintf(stderr,"R7KRECID_7kFileHeader: 7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d\n",
-				time_i[0],time_i[1],time_i[2],
-				time_i[3],time_i[4],time_i[5],time_i[6],
-				header->RecordNumber);
-			}
-
-	   	/* handle installation data */
-		else if (status == MB_SUCCESS && istore->type == R7KRECID_7kInstallationParameters)
-			{
-			nrec_installation++;
-
-			installation = &(istore->installation);
-			header = &(installation->header);
-			time_j[0] = header->s7kTime.Year;
-			time_j[1] = header->s7kTime.Day;
-			time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-			time_j[3] = (int) header->s7kTime.Seconds;
-			time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-			mb_get_itime(verbose, time_j, time_i);
-			mb_get_time(verbose, time_i, &time_d);
-			if (verbose > 0)
-				fprintf(stderr,"R7KRECID_7kInstallationParameters: 7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d\n",
-				time_i[0],time_i[1],time_i[2],
-				time_i[3],time_i[4],time_i[5],time_i[6],
-				header->RecordNumber);
-			}
-
-	   	/* handle bluefin ctd data */
-		else if (status == MB_SUCCESS && istore->type == R7KRECID_Bluefin && kind == MB_DATA_SSV)
-			{
-			nrec_bluefinenv++;
-
-			bluefin = &(istore->bluefin);
-			header = &(bluefin->header);
-			time_j[0] = header->s7kTime.Year;
-			time_j[1] = header->s7kTime.Day;
-			time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-			time_j[3] = (int) header->s7kTime.Seconds;
-			time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-			mb_get_itime(verbose, time_j, time_i);
-			mb_get_time(verbose, time_i, &time_d);
-			last_bluefinenv_time_d = MAX(last_bluefinenv_time_d, time_d);
-			if (last_bluefinenv_time_d > time_d)
-				{
-				status = MB_FAILURE;
-				error = MB_ERROR_IGNORE;
-				}
-
-			/* get timelag value */
-			timelag = 0.0;
-			if (timedelaymode == MB7KPREPROCESS_TIMEDELAY_ON && ntimedelay > 0)
-			interp_status = mb_linear_interp(verbose,
-						timedelay_time_d-1, timedelay_timedelay-1,
-						ntimedelay, time_d, &timelag, &jtimedelay,
-						&error);
-			if (timelagmode == MB7KPREPROCESS_TIMELAG_CONSTANT)
-				{
-				timelag -= timelagconstant;
-				}
-			else if (timelagmode == MB7KPREPROCESS_TIMELAG_MODEL && ntimelag > 0)
-				{
-				interp_status = mb_linear_interp(verbose,
-							timelag_time_d-1, timelag_model-1,
-							ntimelag, time_d, &timelagm, &jtimelag,
-							&error);
-				timelag -= timelagm;
-				}
-			time_d += timelag;
-			mb_get_date(verbose, time_d,time_i);
-			mb_get_jtime(verbose, time_i, time_j);
-			header->s7kTime.Year = time_i[0];
-			header->s7kTime.Day = time_j[1];
-			header->s7kTime.Hours = time_i[3];
-			header->s7kTime.Minutes = time_i[4];
-			header->s7kTime.Seconds = time_i[5] + 0.000001 * time_i[6];
-
-			if (verbose > 0)
-				fprintf(stderr,"R7KRECID_BluefinEnvironmental:     7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d\n",
-					time_i[0],time_i[1],time_i[2],
-					time_i[3],time_i[4],time_i[5],time_i[6],
-					header->RecordNumber);
-			for (i=0;i<bluefin->number_frames;i++)
-				{
-				time_j[0] = bluefin->environmental[i].s7kTime.Year;
-				time_j[1] = bluefin->environmental[i].s7kTime.Day;
-				time_j[2] = 60 * bluefin->environmental[i].s7kTime.Hours + bluefin->environmental[i].s7kTime.Minutes;
-				time_j[3] = (int) bluefin->environmental[i].s7kTime.Seconds;
-				time_j[4] = (int) (1000000 * (bluefin->environmental[i].s7kTime.Seconds - time_j[3]));
-				mb_get_itime(verbose, time_j, time_i);
-				mb_get_time(verbose, time_i, &time_d);
-				time_d += timelag;
-				bluefin->environmental[i].ctd_time = time_d;
-				bluefin->environmental[i].temperature_time = time_d;
-				mb_get_date(verbose, time_d,time_i);
-				mb_get_jtime(verbose, time_i, time_j);
-				bluefin->environmental[i].s7kTime.Year = time_i[0];
-				bluefin->environmental[i].s7kTime.Day = time_j[1];
-				bluefin->environmental[i].s7kTime.Hours = time_i[3];
-				bluefin->environmental[i].s7kTime.Minutes = time_i[4];
-				bluefin->environmental[i].s7kTime.Seconds = time_i[5] + 0.000001 * time_i[6];
-				if (verbose > 0)
-				fprintf(stderr,"                       %2.2d          7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) CTD_time:%f T_time:%f\n",
-					i,time_i[0],time_i[1],time_i[2],
-					time_i[3],time_i[4],time_i[5],time_i[6],
-					bluefin->environmental[i].ctd_time,
-					bluefin->environmental[i].temperature_time);
-
-				/* get nav */
-				interp_status = MB_SUCCESS;
-				j = 0;
-				if (nins > 0)
-					{
-					interp_status = mb_linear_interp_longitude(verbose,
-								ins_time_d-1, ins_lon-1,
-								nins, time_d, &navlon, &jins,
-								&error);
-					if (interp_status == MB_SUCCESS)
-					interp_status = mb_linear_interp_latitude(verbose,
-								ins_time_d-1, ins_lat-1,
-								nins, time_d, &navlat, &jins,
-								&error);
-					}
-				else if (nrock > 0)
-					{
-					interp_status = mb_linear_interp_longitude(verbose,
-								rock_time_d-1, rock_lon-1,
-								nrock, time_d, &navlon, &jrock,
-								&error);
-					if (interp_status == MB_SUCCESS)
-					interp_status = mb_linear_interp_latitude(verbose,
-								rock_time_d-1, rock_lat-1,
-								nrock, time_d, &navlat, &jrock,
-								&error);
-					}
-				else if (ndsl > 0)
-					{
-					interp_status = mb_linear_interp_longitude(verbose,
-								dsl_time_d-1, dsl_lon-1,
-								ndsl, time_d, &navlon, &jdsl,
-								&error);
-					if (interp_status == MB_SUCCESS)
-					interp_status = mb_linear_interp_latitude(verbose,
-								dsl_time_d-1, dsl_lat-1,
-								ndsl, time_d, &navlat, &jdsl,
-								&error);
-					}
-				else if (ndat_nav > 0)
-					{
-					interp_status = mb_linear_interp_longitude(verbose,
-								dat_nav_time_d-1, dat_nav_lon-1,
-								ndat_nav, time_d, &navlon, &jdnav,
-								&error);
-					if (interp_status == MB_SUCCESS)
-					interp_status = mb_linear_interp_latitude(verbose,
-								dat_nav_time_d-1, dat_nav_lat-1,
-								ndat_nav, time_d, &navlat, &jdnav,
-								&error);
-					}
-				else
-					{
-					navlon = 0.0;
-					navlat = 0.0;
-					}
-
-				/* get sonar depth */
-				if (interp_status != MB_SUCCESS)
-					{
-					}
-				else if (nsonardepth > 0)
-					{
-					if (interp_status == MB_SUCCESS)
-					interp_status = mb_linear_interp(verbose,
-								sonardepth_time_d-1, sonardepth_sonardepth-1,
-								nsonardepth, time_d, &sonardepth, &jsonardepth,
-								&error);
-					}
-				else if (nins > 0)
-					{
-					interp_status = mb_linear_interp(verbose,
-								ins_time_d-1, ins_sonardepth-1,
-								nins, time_d, &sonardepth, &jins,
-								&error);
-					}
-				else if (nrock > 0)
-					{
-					interp_status = mb_linear_interp(verbose,
-								rock_time_d-1, rock_sonardepth-1,
-								nrock, time_d, &sonardepth, &jrock,
-								&error);
-					}
-				else if (ndsl > 0)
-					{
-					interp_status = mb_linear_interp(verbose,
-								dsl_time_d-1, dsl_sonardepth-1,
-								ndsl, time_d, &sonardepth, &jdsl,
-								&error);
-					}
-				else if (ndat_sonardepth > 0)
-					{
-					interp_status = mb_linear_interp(verbose,
-								dat_sonardepth_time_d-1, dat_sonardepth_sonardepth-1,
-								ndat_sonardepth, time_d, &sonardepth, &jdsonardepth,
-								&error);
-					}
-				else if (ndat_rph > 0)
-					{
-					interp_status = mb_linear_interp(verbose,
-								dat_rph_time_d-1, dat_rph_heave-1,
-								ndat_rph, time_d, &heave, &jdattitude,
-								&error);
-					sonardepth = heave;
-					}
-				else
-					{
-					sonardepth = 0.0;
-					}
-
-				/* get altitude */
-				if (interp_status != MB_SUCCESS)
-					{
-					}
-				else if (nins > 0)
-					{
-					interp_status = mb_linear_interp(verbose,
-								ins_altitude_time_d-1, ins_altitude-1,
-								nins_altitude, time_d, &altitude, &jins,
-								&error);
-					}
-				else if (ndat_altitude > 0)
-					{
-					interp_status = mb_linear_interp(verbose,
-								dat_altitude_time_d-1, dat_altitude_altitude-1,
-								ndat_altitude, time_d, &altitude, &jdaltitude,
-								&error);
-					}
-				else
-					{
-					altitude = 0.0;
-					}
-
-				/* output ctd data to file */
-				fprintf(tfp,"%.3f %11.6f %10.6f %.3f %.3f %.2f %.3f\n",
-					time_d, navlon, navlat, sonardepth, altitude,
-					bluefin->environmental[i].temperature,
-					bluefin->environmental[i].conductivity);
-				}
-			}
-
-	   	/* handle bluefin nav data */
-		else if (status == MB_SUCCESS && istore->type == R7KRECID_Bluefin && kind == MB_DATA_NAV2)
-			{
-			nrec_bluefinnav++;
-
-			bluefin = &(istore->bluefin);
-			header = &(bluefin->header);
-			time_j[0] = header->s7kTime.Year;
-			time_j[1] = header->s7kTime.Day;
-			time_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-			time_j[3] = (int) header->s7kTime.Seconds;
-			time_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time_j[3]));
-			mb_get_itime(verbose, time_j, time_i);
-			mb_get_time(verbose, time_i, &time_d);
-			last_bluefinnav_time_d = MAX(last_bluefinnav_time_d, time_d);
-			if (last_bluefinnav_time_d > time_d)
-				{
-				status = MB_FAILURE;
-				error = MB_ERROR_IGNORE;
-				}
-
-			/* get timelag value */
-			timelag = 0.0;
-			if (timedelaymode == MB7KPREPROCESS_TIMEDELAY_ON && ntimedelay > 0)
-			interp_status = mb_linear_interp(verbose,
-						timedelay_time_d-1, timedelay_timedelay-1,
-						ntimedelay, time_d, &timelag, &jtimedelay,
-						&error);
-			if (timelagmode == MB7KPREPROCESS_TIMELAG_CONSTANT)
-				{
-				timelag -= timelagconstant;
-				}
-			else if (timelagmode == MB7KPREPROCESS_TIMELAG_MODEL && ntimelag > 0)
-				{
-				interp_status = mb_linear_interp(verbose,
-							timelag_time_d-1, timelag_model-1,
-							ntimelag, time_d, &timelagm, &jtimelag,
-							&error);
-				timelag -= timelagm;
-				}
-			time_d += timelag;
-			mb_get_date(verbose, time_d,time_i);
-			mb_get_jtime(verbose, time_i, time_j);
-			header->s7kTime.Year = time_i[0];
-			header->s7kTime.Day = time_j[1];
-			header->s7kTime.Hours = time_i[3];
-			header->s7kTime.Minutes = time_i[4];
-			header->s7kTime.Seconds = time_i[5] + 0.000001 * time_i[6];
-
-			if (verbose > 0)
-				fprintf(stderr,"R7KRECID_BluefinNav:               7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d\n",
-						time_i[0],time_i[1],time_i[2],
-						time_i[3],time_i[4],time_i[5],time_i[6],
-						header->RecordNumber);
-			for (i=0;i<bluefin->number_frames;i++)
-				{
-				time_j[0] = bluefin->nav[i].s7kTime.Year;
-				time_j[1] = bluefin->nav[i].s7kTime.Day;
-				time_j[2] = 60 * bluefin->nav[i].s7kTime.Hours + bluefin->nav[i].s7kTime.Minutes;
-				time_j[3] = (int) bluefin->nav[i].s7kTime.Seconds;
-				time_j[4] = (int) (1000000 * (bluefin->nav[i].s7kTime.Seconds - time_j[3]));
-				mb_get_itime(verbose, time_j, time_i);
-				mb_get_time(verbose, time_i, &time_d);
-				time_d += timelag;
-				bluefin->nav[i].position_time += timelag;
-				bluefin->nav[i].depth_time += timelag;
-				mb_get_date(verbose, time_d,time_i);
-				mb_get_jtime(verbose, time_i, time_j);
-				bluefin->nav[i].s7kTime.Year = time_i[0];
-				bluefin->nav[i].s7kTime.Day = time_j[1];
-				bluefin->nav[i].s7kTime.Hours = time_i[3];
-				bluefin->nav[i].s7kTime.Minutes = time_i[4];
-				bluefin->nav[i].s7kTime.Seconds = time_i[5] + 0.000001 * time_i[6];
-				if (verbose > 0)
-				fprintf(stderr,"                       %2.2d          7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) Pos_time:%f\n",
-					i,time_i[0],time_i[1],time_i[2],
-					time_i[3],time_i[4],time_i[5],time_i[6],
-					bluefin->nav[i].position_time);
-
-				/* output asynchronous heading, sonardepth, and attitude */
-				fprintf(athfp, "%0.6f\t%7.3f\n", time_d, RTD * bluefin->nav[i].yaw);
-				sonardepth = bluefin->nav[i].depth
-						+ depthsensoroffx * sin(bluefin->nav[i].roll)
-						+ depthsensoroffy * sin(bluefin->nav[i].pitch)
-						+ depthsensoroffz * cos(bluefin->nav[i].pitch)
-						+ sonardepthoffset;
-				fprintf(atsfp, "%0.6f\t%0.3f\n", time_d, sonardepth);
-				fprintf(atafp, "%0.6f\t%0.3f\t%0.3f\n",
-						time_d, RTD * bluefin->nav[i].roll, RTD * bluefin->nav[i].pitch);
-				}
-			}
-
-	   	/* handle subbottom data */
-		else if (status == MB_SUCCESS && kind == MB_DATA_SUBBOTTOM_SUBBOTTOM)
-			{
-			nrec_fsdwsbp++;
-
-			fsdwsb = &(istore->fsdwsb);
-			header = &(fsdwsb->header);
-			time7k_j[0] = header->s7kTime.Year;
-			time7k_j[1] = header->s7kTime.Day;
-			time7k_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-			time7k_j[3] = (int) header->s7kTime.Seconds;
-			time7k_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time7k_j[3]));
-			mb_get_itime(verbose, time7k_j, time7k_i);
-			mb_get_time(verbose, time7k_i, &time7k_d);
-			last_fsdwsbp_time_d = MAX(last_fsdwsbp_time_d, time7k_d);
-			if (last_fsdwsbp_time_d > time7k_d)
-				{
-				status = MB_FAILURE;
-				error = MB_ERROR_IGNORE;
-				}
-			fsdwchannel = &(fsdwsb->channel);
-			fsdwsegyheader = &(fsdwsb->segyheader);
-			if (verbose > 0)
-				fprintf(stderr,"R7KRECID_FSDWsubbottom:            7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) FSDWtime(%4.4d-%3.3d %2.2d:%2.2d:%2.2d.%3.3d) ping:%d sampint:%d samples:%d\n",
-				time7k_i[0],time7k_i[1],time7k_i[2],
-				time7k_i[3],time7k_i[4],time7k_i[5],time7k_i[6],
-				fsdwsegyheader->year,fsdwsegyheader->day,fsdwsegyheader->hour,fsdwsegyheader->minute,fsdwsegyheader->second,
-				fsdwsegyheader->millisecondsToday - 1000 * (int)(0.001 * fsdwsegyheader->millisecondsToday),
-				fsdwsb->ping_number,fsdwchannel->sample_interval,fsdwchannel->number_samples);
-
-			/* fix time stamp */
-			if (fix_time_stamps == MB7KPREPROCESS_TIMEFIX_EDGETECH)
-				{
-				found = MB_NO;
-				for (j=0; j < nedget && found == MB_NO; j++)
-					{
-					if (istore->time_d >= edget_time_d[j])
-						{
-						found = MB_YES;
-						time_d = istore->time_d + edget_time_offset[j];
-						mb_get_date(verbose, time_d, time_i);
-						mb_get_jtime(verbose, time_i, time_j);
-						fsdwsegyheader->year = time_i[0];
-						fsdwsegyheader->day = time_j[1];
-						fsdwsegyheader->hour = time_i[3];
-						fsdwsegyheader->minute = time_i[4];
-						fsdwsegyheader->second = time_i[5];
-						fsdwsegyheader->millisecondsToday = 0.001 * time_i[6]
-										+ 1000 * (time_i[5]
-										+ 60.0 * (time_i[4]
-										+ 60.0 * time_i[3]));
-						if (verbose > 0)
-							fprintf(stderr,"R7KRECID_FSDWsubbottom FIXED:      7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) FSDWtime(%4.4d-%3.3d %2.2d:%2.2d:%2.2d.%3.3d) ping:%d sampint:%d samples:%d\n",
-							time7k_i[0],time7k_i[1],time7k_i[2],
-							time7k_i[3],time7k_i[4],time7k_i[5],time7k_i[6],
-							fsdwsegyheader->year,fsdwsegyheader->day,fsdwsegyheader->hour,fsdwsegyheader->minute,fsdwsegyheader->second,
-							fsdwsegyheader->millisecondsToday - 1000 * (int)(0.001 * fsdwsegyheader->millisecondsToday),
-							fsdwsb->ping_number,fsdwchannel->sample_interval,fsdwchannel->number_samples);
-						}
-					}
-				}
-			}
-
-	   	/* handle low frequency sidescan data */
-		else if (status == MB_SUCCESS && kind == MB_DATA_SIDESCAN2)
-			{
-			nrec_fsdwsslo++;
-			fsdwsslo = &(istore->fsdwsslo);
-			header = &(fsdwsslo->header);
-			time7k_j[0] = header->s7kTime.Year;
-			time7k_j[1] = header->s7kTime.Day;
-			time7k_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-			time7k_j[3] = (int) header->s7kTime.Seconds;
-			time7k_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time7k_j[3]));
-			mb_get_itime(verbose, time7k_j, time7k_i);
-			mb_get_time(verbose, time7k_i, &time7k_d);
-			last_fsdwsslo_time_d = MAX(last_fsdwsslo_time_d, time7k_d);
-			if (last_fsdwsslo_time_d > time7k_d)
-				{
-				status = MB_FAILURE;
-				error = MB_ERROR_IGNORE;
-				}
-			for (i=0;i<fsdwsslo->number_channels;i++)
-				{
-				fsdwchannel = &(fsdwsslo->channel[i]);
-				fsdwssheader = &(fsdwsslo->ssheader[i]);
-				if (verbose > 0)
-					fprintf(stderr,"R7KRECID_FSDWsidescanLo:           7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) FSDWtime(%4.4d-%3.3d %2.2d:%2.2d:%2.2d.%3.3d) ping:%d channel:%d sampint:%d samples:%d\n",
-					time7k_i[0],time7k_i[1],time7k_i[2],
-					time7k_i[3],time7k_i[4],time7k_i[5],time7k_i[6],
-					fsdwssheader->year,fsdwssheader->day,fsdwssheader->hour,fsdwssheader->minute,fsdwssheader->second,
-					fsdwssheader->millisecondsToday - 1000 * (int)(0.001 * fsdwssheader->millisecondsToday),
-					fsdwsslo->ping_number,fsdwchannel->number,
-					fsdwchannel->sample_interval,fsdwchannel->number_samples);
-				}
-
-			/* fix time stamp */
-			if (fix_time_stamps == MB7KPREPROCESS_TIMEFIX_EDGETECH)
-				{
-				found = MB_NO;
-				for (j=0; j < nedget && found == MB_NO; j++)
-					{
-					if (istore->time_d >= edget_time_d[j])
-						{
-						found = MB_YES;
-						time_d = istore->time_d + edget_time_offset[j];
-						mb_get_date(verbose, time_d, time_i);
-						mb_get_jtime(verbose, time_i, time_j);
-						for (i=0;i<fsdwsslo->number_channels;i++)
-							{
-							fsdwchannel = &(fsdwsslo->channel[i]);
-							fsdwssheader = &(fsdwsslo->ssheader[i]);
-							fsdwssheader->year = time_i[0];
-							fsdwssheader->day = time_j[1];
-							fsdwssheader->hour = time_i[3];
-							fsdwssheader->minute = time_i[4];
-							fsdwssheader->second = time_i[5];
-							fsdwssheader->millisecondsToday = 0.001 * time_i[6]
-										+ 1000 * (time_i[5]
-										+ 60.0 * (time_i[4]
-										+ 60.0 * time_i[3]));
-							if (verbose > 0)
-								fprintf(stderr,"R7KRECID_FSDWsidescanLo FIXED:     7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) FSDWtime(%4.4d-%3.3d %2.2d:%2.2d:%2.2d.%3.3d) ping:%d channel:%d sampint:%d samples:%d\n",
-								time7k_i[0],time7k_i[1],time7k_i[2],
-								time7k_i[3],time7k_i[4],time7k_i[5],time7k_i[6],
-								fsdwssheader->year,fsdwssheader->day,fsdwssheader->hour,fsdwssheader->minute,fsdwssheader->second,
-								fsdwssheader->millisecondsToday - 1000 * (int)(0.001 * fsdwssheader->millisecondsToday),
-								fsdwsslo->ping_number,fsdwchannel->number,
-								fsdwchannel->sample_interval,fsdwchannel->number_samples);
-							}
-						}
-					}
-				}
-			}
-
-	   	/* handle high frequency sidescan data */
-		else if (status == MB_SUCCESS && kind == MB_DATA_SIDESCAN3)
-			{
-			nrec_fsdwsshi++;
-
-			fsdwsshi = &(istore->fsdwsshi);
-			header = &(fsdwsshi->header);
-			time7k_j[0] = header->s7kTime.Year;
-			time7k_j[1] = header->s7kTime.Day;
-			time7k_j[2] = 60 * header->s7kTime.Hours + header->s7kTime.Minutes;
-			time7k_j[3] = (int) header->s7kTime.Seconds;
-			time7k_j[4] = (int) (1000000 * (header->s7kTime.Seconds - time7k_j[3]));
-			mb_get_itime(verbose, time7k_j, time7k_i);
-			mb_get_time(verbose, time7k_i, &time7k_d);
-			last_fsdwsshi_time_d = MAX(last_fsdwsshi_time_d, time7k_d);
-			if (last_fsdwsshi_time_d > time7k_d)
-				{
-				status = MB_FAILURE;
-				error = MB_ERROR_IGNORE;
-				}
-			for (i=0;i<fsdwsshi->number_channels;i++)
-				{
-				fsdwchannel = &(fsdwsshi->channel[i]);
-				fsdwssheader = &(fsdwsshi->ssheader[i]);
-				if (verbose > 0)
-					fprintf(stderr,"R7KRECID_FSDWsidescanHi:           7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) FSDWtime(%4.4d-%3.3d %2.2d:%2.2d:%2.2d.%3.3d) ping:%d channel:%d sampint:%d samples:%d\n",
-					time7k_i[0],time7k_i[1],time7k_i[2],
-					time7k_i[3],time7k_i[4],time7k_i[5],time7k_i[6],
-					fsdwssheader->year,fsdwssheader->day,fsdwssheader->hour,fsdwssheader->minute,fsdwssheader->second,
-					fsdwssheader->millisecondsToday - 1000 * (int)(0.001 * fsdwssheader->millisecondsToday),
-					fsdwsshi->ping_number,fsdwchannel->number,
-					fsdwchannel->sample_interval,fsdwchannel->number_samples);
-				}
-
-			/* fix time stamp */
-			if (fix_time_stamps == MB7KPREPROCESS_TIMEFIX_EDGETECH)
-				{
-				found = MB_NO;
-				for (j=0; j < nedget && found == MB_NO; j++)
-					{
-					if (istore->time_d >= edget_time_d[j])
-						{
-						found = MB_YES;
-						time_d = istore->time_d + edget_time_offset[j];
-						mb_get_date(verbose, time_d, time_i);
-						mb_get_jtime(verbose, time_i, time_j);
-						for (i=0;i<fsdwsslo->number_channels;i++)
-							{
-							fsdwchannel = &(fsdwsshi->channel[i]);
-							fsdwssheader = &(fsdwsshi->ssheader[i]);
-							fsdwssheader->year = time_i[0];
-							fsdwssheader->day = time_j[1];
-							fsdwssheader->hour = time_i[3];
-							fsdwssheader->minute = time_i[4];
-							fsdwssheader->second = time_i[5];
-							fsdwssheader->millisecondsToday = 0.001 * time_i[6]
-										+ 1000 * (time_i[5]
-										+ 60.0 * (time_i[4]
-										+ 60.0 * time_i[3]));
-							if (verbose > 0)
-								fprintf(stderr,"R7KRECID_FSDWsidescanHi FIXED:     7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) FSDWtime(%4.4d-%3.3d %2.2d:%2.2d:%2.2d.%3.3d) ping:%d channel:%d sampint:%d samples:%d\n",
-								time7k_i[0],time7k_i[1],time7k_i[2],
-								time7k_i[3],time7k_i[4],time7k_i[5],time7k_i[6],
-								fsdwssheader->year,fsdwssheader->day,fsdwssheader->hour,fsdwssheader->minute,fsdwssheader->second,
-								fsdwssheader->millisecondsToday - 1000 * (int)(0.001 * fsdwssheader->millisecondsToday),
-								fsdwsshi->ping_number,fsdwchannel->number,
-								fsdwchannel->sample_interval,fsdwchannel->number_samples);
-							}
-						}
-					}
-				}
-			}
-
-	   	/* handle unknown data */
-		else  if (status == MB_SUCCESS)
-			{
-/*fprintf(stderr,"DATA TYPE UNKNOWN: status:%d error:%d kind:%d\n",status,error,kind);*/
-			nrec_other++;
-			}
-
-	   	/* handle read error */
-		else
-			{
-/*fprintf(stderr,"READ FAILURE: status:%d error:%d kind:%d\n",status,error,kind);*/
-			}
-
-		/* print debug statements */
-		if (verbose >= 2)
-			{
-			fprintf(stderr,"\ndbg2  Ping read in program <%s>\n",
-				program_name);
-			fprintf(stderr,"dbg2       kind:           %d\n",kind);
-			fprintf(stderr,"dbg2       error:          %d\n",error);
-			fprintf(stderr,"dbg2       status:         %d\n",status);
-			}
-
-	/*--------------------------------------------
-	  write the processed data
-	  --------------------------------------------*/
-
-	  	/* if using AUV ins data log for navigation and attitude, then
-			output these data in new bluefin racords while not outputting
-			any old bluefin records. */
-		if (nins > 0 && error == MB_ERROR_NO_ERROR && kind == MB_DATA_DATA)
-			{
-			/* if first output find starting point in ins, attitude, and speed data */
-			if (ins_output_index < 0)
-				{
-				for (i = 0; i < nins && ins_time_d[i] < time_d - 1; i++)
-					{
-					/*fprintf(stderr,"i:%d time: %f ins:%f\n",i,time_d,ins_time_d[i]);*/
-					}
-				ins_output_index = MAX(0,i-1);
-				}
-
-			/* output bluefin record with 25 samples if survey record has a time later than that
-				of the last sample output */
-			if (time_d > ins_time_d[ins_output_index])
-				{
-				bluefin = &(istore->bluefin);
-				header = &(bluefin->header);
-				type_save = istore->type;
-				kind_save = istore->kind;
-				istore->kind = MB_DATA_NAV2;
-				istore->type = R7KRECID_Bluefin;
-				bluefin->number_frames = MIN(25, nins - ins_output_index + 1);
-
-				header->Version = 4;
-				header->Offset = 60;
-				header->SyncPattern = 65535;
-				header->Size = 100 + 128 * bluefin->number_frames;
-				header->OffsetToOptionalData = 0;
-				header->OptionalDataIdentifier = 0;
-				mb_get_jtime(verbose, istore->time_i, time_j);
-				header->s7kTime.Year = istore->time_i[0];
-				header->s7kTime.Day = time_j[1];
-				header->s7kTime.Hours = istore->time_i[3];
-				header->s7kTime.Minutes = istore->time_i[4];
-				header->s7kTime.Seconds = istore->time_i[5] + 0.000001 * istore->time_i[6];
-				header->Reserved = 0;
-				header->RecordType = R7KRECID_Bluefin;
-				header->DeviceId = R7KDEVID_Bluefin;
-				header->Reserved2 = 0;
-				header->SystemEnumerator = 0;
-				header->DataSetNumber = 0;
-				header->RecordNumber = 0;
-				for (i=0;i<8;i++)
-					{
-					header->PreviousRecord[i] = 0;
-					header->NextRecord[i] = 0;
-					}
-				header->Flags = 0;
-				header->Reserved3 = 0;
-				header->Reserved4 = 0;
-				header->FragmentedTotal = 0;
-				header->FragmentNumber = 0;
-
-				bluefin->msec_timestamp = 0;
-				/* bluefin->number_frames = MIN(25, nins - ins_output_index + 1); */
-				bluefin->frame_size = 128;
-				bluefin->data_format = R7KRECID_BluefinNav;
-				for (i=0;i<16;i++)
-					bluefin->reserved[i] = 0;
-				if (verbose > 0)
-					fprintf(stderr,"R7KRECID_BluefinNav:               7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) record_number:%d\n",
-						time_i[0],time_i[1],time_i[2],
-						time_i[3],time_i[4],time_i[5],time_i[6],
-						header->RecordNumber);
-
-				for (i=0;i<bluefin->number_frames;i++)
-					{
-					bluefin->nav[i].packet_size = 128;
-					bluefin->nav[i].version = 2;
-					bluefin->nav[i].offset = 32;
-					bluefin->nav[i].data_type = 1;
-					bluefin->nav[i].data_size = 96;
-					mb_get_date(verbose, ins_time_d[ins_output_index], time_i);
-					mb_get_jtime(verbose, time_i, time_j);
-					bluefin->nav[i].s7kTime.Year = istore->time_i[0];
-					bluefin->nav[i].s7kTime.Day = time_j[1];
-					bluefin->nav[i].s7kTime.Hours = istore->time_i[3];
-					bluefin->nav[i].s7kTime.Minutes = istore->time_i[4];
-					bluefin->nav[i].s7kTime.Seconds = istore->time_i[5] + 0.000001 * istore->time_i[6];
-					if (verbose > 0)
-					fprintf(stderr,"                       %2.2d          7Ktime(%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d) Pos_time:%f\n",
-						i,time_i[0],time_i[1],time_i[2],
-						time_i[3],time_i[4],time_i[5],time_i[6],
-						bluefin->nav[i].position_time);
-					bluefin->nav[i].checksum = 0;
-					bluefin->nav[i].timedelay = 0;
-					bluefin->nav[i].quality = 0;
-					bluefin->nav[i].latitude = DTR * ins_lat[ins_output_index];
-					bluefin->nav[i].longitude = DTR * ins_lon[ins_output_index];
-					speed = bluefin->nav[i].speed;
-					mb_linear_interp(verbose,
-								ins_speed_time_d-1, ins_speed-1,
-								nins_speed, ins_time_d[ins_output_index],
-								&speed, &jins,
-								&error);
-					bluefin->nav[i].depth = ins_sonardepth[ins_output_index];
-					mb_linear_interp(verbose,
-								ins_altitude_time_d-1, ins_altitude-1,
-								nins_altitude, ins_time_d[ins_output_index],
-								&(bluefin->nav[i].altitude), &jins,
-								&error);
-					bluefin->nav[i].roll = DTR * ins_roll[ins_output_index];
-					bluefin->nav[i].pitch = DTR * ins_pitch[ins_output_index];
-					bluefin->nav[i].yaw = DTR * ins_heading[ins_output_index];
-					bluefin->nav[i].northing_rate = 0;
-					bluefin->nav[i].easting_rate = 0;
-					bluefin->nav[i].depth_rate = 0;
-					bluefin->nav[i].altitude_rate = 0;
-					bluefin->nav[i].roll_rate = 0;
-					bluefin->nav[i].pitch_rate = 0;
-					bluefin->nav[i].yaw_rate = 0;
-					bluefin->nav[i].position_time = ins_time_d[ins_output_index];
-					bluefin->nav[i].depth_time = ins_time_d[ins_output_index];
-					ins_output_index++;
-					}
-
-				/* write the new bluefin record */
-				status = mb_put_all(verbose,ombio_ptr,
-						istore_ptr,MB_NO,MB_DATA_NAV2,
-						time_i,time_d,
-						navlon,navlat,speed,heading,
-						obeams_bath,obeams_amp,opixels_ss,
-						beamflag,bath,amp,bathacrosstrack,bathalongtrack,
-						ss,ssacrosstrack,ssalongtrack,
-						comment,&error);
-				if (status != MB_SUCCESS)
-					{
-					mb_error(verbose,error,&message);
-					fprintf(stderr,"\nMBIO Error returned from function <mb_put>:\n%s\n",message);
-					fprintf(stderr,"\nMultibeam Data Not Written To File <%s>\n",ofile);
-					fprintf(stderr,"\nProgram <%s> Terminated\n",
-						program_name);
-					exit(error);
-					}
-
-				/* restore kind and time_i */
-				istore->type = type_save;
-				istore->kind = kind_save;
-				mb_get_date(verbose, time_d, time_i);
-				}
-			}
-
-		/* do not output full beam data */
-		if (error == MB_ERROR_NO_ERROR && kind == MB_DATA_DATA
-			&& istore->read_beam == MB_YES)
-			istore->read_beam = MB_NO;
-
-		/* write some data */
-		if (error == MB_ERROR_NO_ERROR && (nins < 1 || kind != MB_DATA_NAV2))
-			{
-			status = mb_put_all(verbose,ombio_ptr,
-					istore_ptr,MB_NO,kind,
-					time_i,time_d,
-					navlon,navlat,speed,heading,
-					obeams_bath,obeams_amp,opixels_ss,
-					beamflag,bath,amp,bathacrosstrack,bathalongtrack,
-					ss,ssacrosstrack,ssalongtrack,
-					comment,&error);
-			if (status != MB_SUCCESS)
-				{
-				mb_error(verbose,error,&message);
-				fprintf(stderr,"\nMBIO Error returned from function <mb_put>:\n%s\n",message);
-				fprintf(stderr,"\nMultibeam Data Not Written To File <%s>\n",ofile);
-				fprintf(stderr,"\nProgram <%s> Terminated\n",
-					program_name);
-				exit(error);
-				}
-			}
-		}
-
-	/* output counts */
-	fprintf(stdout, "\nData records written to: %s\n", ofile);
-	fprintf(stdout, "     File Header:                       %d\n", nrec_fileheader);
-	fprintf(stdout, "     Multibeam:                         %d\n", nrec_multibeam);
-	fprintf(stdout, "          Volatile Settings:                 %d\n", nrec_volatilesettings);
-	fprintf(stdout, "          Match Filter:                      %d\n", nrec_matchfilter);
-	fprintf(stdout, "          Beam Geometry:                     %d\n", nrec_beamgeometry);
-	fprintf(stdout, "          Remote Control:                    %d\n", nrec_remotecontrolsettings);
-	fprintf(stdout, "          Bathymetry:                        %d\n", nrec_bathymetry);
-	fprintf(stdout, "          Backscatter:                       %d\n", nrec_backscatter);
-	fprintf(stdout, "          Beam:                              %d\n", nrec_beam);
-	fprintf(stdout, "          Image:                             %d\n", nrec_image);
-	fprintf(stdout, "          V2PingMotion:                      %d\n", nrec_v2pingmotion);
-	fprintf(stdout, "          V2DetectionSetup:                  %d\n", nrec_v2detectionsetup);
-	fprintf(stdout, "          V2Beamformed:                      %d\n", nrec_v2beamformed);
-	fprintf(stdout, "          V2Detection:                       %d\n", nrec_v2detection);
-	fprintf(stdout, "          V2RawDetection:                    %d\n", nrec_v2rawdetection);
-	fprintf(stdout, "          V2Snippet:                         %d\n", nrec_v2snippet);
-	fprintf(stdout, "          Calibrated Snippet:                %d\n", nrec_calibratedsnippet);
-	fprintf(stdout, "          Processedsidescan:                 %d\n", nrec_processedsidescan);
-	fprintf(stdout, "     Reference:                         %d\n", nrec_reference);
-	fprintf(stdout, "     Uncalibrated Sensor Offset:        %d\n", nrec_sensoruncal);
-	fprintf(stdout, "     Calibrated Sensor Offset:          %d\n", nrec_sensorcal);
-	fprintf(stdout, "     Position:                          %d\n", nrec_position);
-	fprintf(stdout, "     Custom Attitude:                   %d\n", nrec_customattitude);
-	fprintf(stdout, "     Tide:                              %d\n", nrec_tide);
-	fprintf(stdout, "     Altitude:                          %d\n", nrec_altitude);
-	fprintf(stdout, "     Motion Over Ground:                %d\n", nrec_motion);
-	fprintf(stdout, "     Depth:                             %d\n", nrec_depth);
-	fprintf(stdout, "     Sound Speed Profile:               %d\n", nrec_svp);
-	fprintf(stdout, "     CTD:                               %d\n", nrec_ctd);
-	fprintf(stdout, "     Geodosy:                           %d\n", nrec_geodesy);
-	fprintf(stdout, "     Roll Pitch Heave:                  %d\n", nrec_rollpitchheave);
-	fprintf(stdout, "     Heading:                           %d\n", nrec_heading);
-	fprintf(stdout, "     Survey Line:                       %d\n", nrec_surveyline);
-	fprintf(stdout, "     Navigation:                        %d\n", nrec_navigation);
-	fprintf(stdout, "     Attitude:                          %d\n", nrec_attitude);
-	fprintf(stdout, "     Edgetech Low Frequency Sidescan:   %d\n", nrec_fsdwsslo);
-	fprintf(stdout, "     Edgetech High Frequency Sidescan:  %d\n", nrec_fsdwsshi);
-	fprintf(stdout, "     Edgetech Subbottom:                %d\n", nrec_fsdwsbp);
-	fprintf(stdout, "     MBARI Mapping AUV Environmental:   %d\n", nrec_bluefinnav);
-	fprintf(stdout, "     MBARI Mapping AUV Navigation:      %d\n", nrec_bluefinenv);
-	fprintf(stdout, "     Configuration:                     %d\n", nrec_configuration);
-	fprintf(stdout, "     Calibration:                       %d\n", nrec_calibration);
-	fprintf(stdout, "     Vertical Depth:                    %d\n", nrec_verticaldepth);
-	fprintf(stdout, "     Installation:                      %d\n", nrec_installation);
-	fprintf(stdout, "     System Event Message:              %d\n", nrec_systemeventmessage);
-	fprintf(stdout, "     Other:                             %d\n", nrec_other);
-	nrec_fileheader_tot += nrec_fileheader;
-	nrec_multibeam_tot += nrec_multibeam;
-	nrec_volatilesettings_tot += nrec_volatilesettings;
-	nrec_matchfilter_tot += nrec_matchfilter;
-	nrec_beamgeometry_tot += nrec_beamgeometry;
-	nrec_remotecontrolsettings_tot += nrec_remotecontrolsettings;
-	nrec_bathymetry_tot += nrec_bathymetry;
-	nrec_backscatter_tot += nrec_backscatter;
-	nrec_beam_tot += nrec_beam;
-	nrec_image_tot += nrec_image;
-	nrec_v2pingmotion_tot += nrec_v2pingmotion;
-	nrec_v2detectionsetup_tot += nrec_v2detectionsetup;
-	nrec_v2beamformed_tot += nrec_v2beamformed;
-	nrec_v2detection_tot += nrec_v2detection;
-	nrec_v2rawdetection_tot += nrec_v2rawdetection;
-	nrec_v2snippet_tot += nrec_v2snippet;
-	nrec_calibratedsnippet_tot += nrec_calibratedsnippet;
-	nrec_processedsidescan_tot += nrec_processedsidescan;
-	nrec_reference_tot += nrec_reference;
-	nrec_sensoruncal_tot += nrec_sensoruncal;
-	nrec_sensorcal_tot += nrec_sensorcal;
-	nrec_position_tot += nrec_position;
-	nrec_customattitude_tot += nrec_customattitude;
-	nrec_tide_tot += nrec_tide;
-	nrec_altitude_tot += nrec_altitude;
-	nrec_motion_tot += nrec_motion;
-	nrec_depth_tot += nrec_depth;
-	nrec_svp_tot += nrec_svp;
-	nrec_ctd_tot += nrec_ctd;
-	nrec_geodesy_tot += nrec_geodesy;
-	nrec_rollpitchheave_tot += nrec_rollpitchheave;
-	nrec_heading_tot += nrec_heading;
-	nrec_surveyline_tot += nrec_surveyline;
-	nrec_navigation_tot += nrec_navigation;
-	nrec_attitude_tot += nrec_attitude;
-	nrec_fsdwsbp_tot += nrec_fsdwsbp;
-	nrec_fsdwsslo_tot += nrec_fsdwsslo;
-	nrec_fsdwsshi_tot += nrec_fsdwsshi;
-	nrec_bluefinenv_tot += nrec_bluefinenv;
-	nrec_position_tot += nrec_position;
-	nrec_bluefinnav_tot += nrec_bluefinnav;
-	nrec_configuration_tot += nrec_configuration;
-	nrec_calibration_tot += nrec_calibration;
-	nrec_verticaldepth_tot += nrec_verticaldepth;
-	nrec_installation_tot += nrec_installation;
-	nrec_systemeventmessage_tot += nrec_systemeventmessage;
-	nrec_other_tot += nrec_other;
-
-	/* figure out whether and what to read next */
-        if (read_datalist == MB_YES)
-                {
-		if ((status = mb_datalist_read(verbose,datalist,
-			    ifile,&format,&file_weight,&error))
-			    == MB_SUCCESS)
-                        read_data = MB_YES;
-                else
-                        read_data = MB_NO;
-                }
-        else
-                {
-                read_data = MB_NO;
-                }
-
-	/* close the input swath file */
-	status = mb_close(verbose,&imbio_ptr,&error);
-
-	/* close the output swath file if necessary */
-	if (ofile_set == MB_NO || read_data == MB_NO)
-		{
-		status = mb_close(verbose,&ombio_ptr,&error);
-		fclose(tfp);
-		fclose(athfp);
-		fclose(atsfp);
-		fclose(atafp);
-		fclose(stafp);
-
-		/* generate inf fnv and fbt files */
-		if (status == MB_SUCCESS)
-			{
-			status = mb_make_info(verbose, MB_YES, ofile, format, &error);
-			}
-		}
-
-	/* end loop over files in list */
-	}
-	if (read_datalist == MB_YES)
-		mb_datalist_close(verbose,&datalist,&error);
-
-	/* output counts */
-	fprintf(stdout, "\nTotal files read:  %d\n", nfile_read);
-	fprintf(stdout, "Total files written: %d\n", nfile_write);
-	fprintf(stdout, "\nTotal data records written from: %s\n", read_file);
-	fprintf(stdout, "     File Header:                       %d\n", nrec_fileheader_tot);
-	fprintf(stdout, "     Multibeam:                         %d\n", nrec_multibeam_tot);
-	fprintf(stdout, "          Volatile Settings:                 %d\n", nrec_volatilesettings_tot);
-	fprintf(stdout, "          Match Filter:                      %d\n", nrec_matchfilter_tot);
-	fprintf(stdout, "          Beam Geometry:                     %d\n", nrec_beamgeometry_tot);
-	fprintf(stdout, "          Remote Control:                    %d\n", nrec_remotecontrolsettings_tot);
-	fprintf(stdout, "          Bathymetry:                        %d\n", nrec_bathymetry_tot);
-	fprintf(stdout, "          Backscatter:                       %d\n", nrec_backscatter_tot);
-	fprintf(stdout, "          Beam:                              %d\n", nrec_beam_tot);
-	fprintf(stdout, "          Image:                             %d\n", nrec_image_tot);
-	fprintf(stdout, "          V2PingMotion:                      %d\n", nrec_v2pingmotion_tot);
-	fprintf(stdout, "          V2DetectionSetup:                  %d\n", nrec_v2detectionsetup_tot);
-	fprintf(stdout, "          V2Beamformed:                      %d\n", nrec_v2beamformed_tot);
-	fprintf(stdout, "          V2Detection:                       %d\n", nrec_v2detection_tot);
-	fprintf(stdout, "          V2RawDetection:                    %d\n", nrec_v2rawdetection_tot);
-	fprintf(stdout, "          V2Snippet:                         %d\n", nrec_v2snippet_tot);
-	fprintf(stdout, "          Calibrated Snippet:                %d\n", nrec_calibratedsnippet_tot);
-	fprintf(stdout, "          Processedsidescan:                 %d\n", nrec_processedsidescan_tot);
-	fprintf(stdout, "     Reference:                         %d\n", nrec_reference_tot);
-	fprintf(stdout, "     Uncalibrated Sensor Offset:        %d\n", nrec_sensoruncal_tot);
-	fprintf(stdout, "     Calibrated Sensor Offset:          %d\n", nrec_sensorcal_tot);
-	fprintf(stdout, "     Position:                          %d\n", nrec_position_tot);
-	fprintf(stdout, "     Custom Attitude:                   %d\n", nrec_customattitude_tot);
-	fprintf(stdout, "     Tide:                              %d\n", nrec_tide_tot);
-	fprintf(stdout, "     Altitude:                          %d\n", nrec_altitude_tot);
-	fprintf(stdout, "     Motion Over Ground:                %d\n", nrec_motion_tot);
-	fprintf(stdout, "     Depth:                             %d\n", nrec_depth_tot);
-	fprintf(stdout, "     Sound Speed Profile:               %d\n", nrec_svp_tot);
-	fprintf(stdout, "     CTD:                               %d\n", nrec_ctd_tot);
-	fprintf(stdout, "     Geodosy:                           %d\n", nrec_geodesy_tot);
-	fprintf(stdout, "     Roll Pitch Heave:                  %d\n", nrec_rollpitchheave_tot);
-	fprintf(stdout, "     Heading:                           %d\n", nrec_heading_tot);
-	fprintf(stdout, "     Survey Line:                       %d\n", nrec_surveyline_tot);
-	fprintf(stdout, "     Navigation:                        %d\n", nrec_navigation_tot);
-	fprintf(stdout, "     Attitude:                          %d\n", nrec_attitude_tot);
-	fprintf(stdout, "     Edgetech Low Frequency Sidescan:   %d\n", nrec_fsdwsslo_tot);
-	fprintf(stdout, "     Edgetech High Frequency Sidescan:  %d\n", nrec_fsdwsshi_tot);
-	fprintf(stdout, "     Edgetech Subbottom:                %d\n", nrec_fsdwsbp_tot);
-	fprintf(stdout, "     MBARI Mapping AUV Environmental:   %d\n", nrec_bluefinnav_tot);
-	fprintf(stdout, "     MBARI Mapping AUV Navigation:      %d\n", nrec_bluefinenv_tot);
-	fprintf(stdout, "     Configuration:                     %d\n", nrec_configuration_tot);
-	fprintf(stdout, "     Calibration:                       %d\n", nrec_calibration_tot);
-	fprintf(stdout, "     Vertical Depth:                    %d\n", nrec_verticaldepth_tot);
-	fprintf(stdout, "     Installation:                      %d\n", nrec_installation_tot);
-	fprintf(stdout, "     System Event Message:              %d\n", nrec_systemeventmessage_tot);
-	fprintf(stdout, "     Other:                             %d\n", nrec_other_tot);
-	}
-
-	/* deallocate navigation arrays */
-	if (ndat_nav > 0)
-		{
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&dat_nav_time_d,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&dat_nav_time_d,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&dat_nav_lon,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&dat_nav_lat,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&dat_nav_speed,&error);
-		}
-	if (ndat_sonardepth > 0)
-		{
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&dat_sonardepth_sonardepth,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&dat_sonardepth_sonardepthfilter,&error);
-		}
-	if (ndat_heading > 0)
-		{
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&dat_heading_heading,&error);
-		}
-	if (ndat_rph > 0)
-		{
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&dat_rph_roll,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&dat_rph_pitch,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&dat_rph_heave,&error);
-		}
-	if (ndat_altitude > 0)
-		{
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&dat_altitude_time_d,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&dat_altitude_altitude,&error);
-		}
-	if (ntimedelay > 0)
-		{
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&timedelay_time_d,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&timedelay_timedelay,&error);
-		}
-	if (nbatht > 0)
-		{
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&batht_time_d,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&batht_ping,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&batht_time_d_new,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&batht_time_offset,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&batht_ping_offset,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&batht_good_offset,&error);
-		}
-	if (nedget > 0)
-		{
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&edget_time_d,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&edget_ping,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&edget_time_d_new,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&edget_time_offset,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&edget_ping_offset,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&edget_good_offset,&error);
-		}
-	if (nins > 0)
-		{
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&ins_time_d,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&ins_lon,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&ins_lat,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&ins_heading,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&ins_roll,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&ins_pitch,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&ins_sonardepth,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&ins_sonardepthfilter,&error);
-		}
-	if (nrock > 0)
-		{
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&rock_time_d,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&rock_lon,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&rock_lat,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&rock_sonardepth,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&rock_sonardepthfilter,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&rock_heading,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&rock_roll,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&rock_pitch,&error);
-		}
-	if (ndsl > 0)
-		{
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&dsl_time_d,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&dsl_lon,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&dsl_lat,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&dsl_sonardepth,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&dsl_sonardepthfilter,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&dsl_heading,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&dsl_roll,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&dsl_pitch,&error);
-		}
-	if (nins_altitude > 0)
-		{
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&ins_altitude_time_d,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&ins_altitude,&error);
-		}
-	if (nins_speed > 0)
-		{
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&ins_speed_time_d,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&ins_speed,&error);
-		}
-	if (nsonardepth > 0)
-		{
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&sonardepth_time_d,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&sonardepth_sonardepth,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&sonardepth_sonardepthfilter,&error);
-		}
-		
-	/* deallocate platform structure */
-	if (platform != NULL)
-		{
-		status = mb_platform_deall(verbose, (void **)&platform, &error);
-		}
-
-	/* check memory */
-	if (verbose >= 4)
-		status = mb_memory_list(verbose,&error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  Program <%s> completed\n",
-			program_name);
-		fprintf(stderr,"dbg2  Ending status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* end it all */
-	exit(error);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/utilities/mbabsorption.c b/src/utilities/mbabsorption.c
deleted file mode 100644
index b185b98..0000000
--- a/src/utilities/mbabsorption.c
+++ /dev/null
@@ -1,279 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbabsorption.c	2/10/2008
- *    $Id: mbabsorption.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 2008-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * MBabsorption calculates the absorption of sound in sea water in dB/km
- * as a function of frequency, temperature, salinity, sound speed, and depth.
- *
- * We use the Francois and Garrison equations from:
- *     Francois, R.E., Garrison, G.R., "Sound absorption based
- *       on ocean measurements: Part I: Pure water and magnesium
- *       sulfate contributions", J. Acoust. Soc. Am., 72(3),
- *       896-907, 1982.
- *     Francois, R.E., Garrison, G.R., "Sound absorption based
- *       on ocean measurements: Part II: Boric acid contribution
- *       and equation for total absorption", J. Acoust. Soc. Am.,
- *       72(6), 1879-1890, 1982.
- *
- * Francois and Garrison [1982] model the sound absorption in
- * sea water as resulting from contributions from pure water,
- * magnesium sulfate, and boric acid. The boric acid contribution
- * is significant below 10 kHz. The equations are:
- *
- * absorption = Boric Acid Contribution
- * 		+ MbSO4 Contribution
- * 		+ Pure Water Contribution
- *
- * **************************
- *
- * Boric Acid Contribution
- * AlphaB = Ab * Pb * Fb * f**2
- *          -------------------
- *             f**2 + Fb**2
- *
- * Ab = 8.86 / c * 10**(0.78 * pH - 5) (dB/km/kHz)
- * Pb = 1
- * Fb = 2.8 * (S / 35)**0.5 * 10**(4 - 1245 / Tk) (kHz)
- *
- * **************************
- *
- * MgSO4 Contribution
- * AlphaM = Am * Pm * Fm * f**2
- *          -------------------
- *             f**2 + Fm**2
- *
- * Am = 21.44 * S * (1 + 0.025 * T) / c (dB/km/kHZ)
- * Pm = 1 - 0.000137 * D + 0.0000000062 * D**2
- * Fm = (8.17 * 10**(8 - 1990 / Tk)) / (1 + 0.0018 * (S - 35))  (kHz)
- *
- * **************************
- *
- * Pure Water Contribution
- * AlphaW = Aw * Pw * f**2
- *
- * For T <= 20 deg C
- *   Aw = 0.0004397 - 0.0000259 * T
- *           + 0.000000911 * T**2 - 0.000000015 * T**3 (dB/km/kHz)
- * For T > 20 deg C
- *   Aw = 0.0003964 - 0.00001146 * T
- *           + 0.000000145 * T**2 - 0.00000000049 * T**3 (dB/km/kHz)
- * Pw = 1 - 0.0000383 * D + 0.00000000049 * D**2
- *
- * **************************
- *
- * f = sound frequency (kHz)
- * c = speed of sound (m/s)
- *   =~ 1412 + 3.21 * T + 1.19 * S + 0.0167 * D
- * T = temperature (deg C)
- * Tk = temperature (deg K) = T + 273 (deg K)
- * S = salinity (per mil)
- * D = depth (m)
- *
- * **************************
- *
- * Author:	D. W. Caress
- * Date:	February 10, 2008
- *              R/V Zephyr
- *              Hanging out at the channel entrance to La Paz, BCS, MX
- *              helping out as MBARI tries to save the grounded
- *              R/V Western Flyer.
- *              Note: as I was writing this code the Flyer was refloated
- *              and successfully backed off the reef.
- *
- * $Log: mbabsorption.c,v $
- * Revision 5.0  2008/02/12 02:33:49  caress
- * Initial version.
- *
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <math.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_define.h"
-
-static char rcs_id[] = "$Id: mbabsorption.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-
-int main (int argc, char **argv)
-{
-	char program_name[] = "MBabsorption";
-	char help_message[] = "MBabsorption calculates the absorption of sound in sea water\nin dB/km as a function of frequency, temperature, salinity, \nsound speed, pH, and depth.";
-	char usage_message[] = "mbabsorption [-Csoundspeed -Ddepth -Ffrequency -Pph -Ssalinity -Ttemperature -V -H]";
-	extern char *optarg;
-	int	errflg = 0;
-	int	c;
-	int	status;
-	int	verbose = 0;
-	int	help = 0;
-	int	flag = 0;
-	int	error = MB_ERROR_NO_ERROR;
-	FILE	*outfp;
-
-	/* control parameters */
-	double	absorption; 		/* absorption (dB/km) */
-	double	frequency; 		/* frequency (kHz) */
-	double	temperature; 		/* temperature (deg C) */
-	double	salinity; 		/* salinity (per mil) */
-	double	soundspeed; 		/* speed of sound (m/sec) */
-	double	depth; 			/* depth (m) */
-	double	ph; 			/* pH */
-
-	/* set defaults */
-	frequency = 200.0;
-	temperature = 10.0;
-	salinity = 35.0;
-	soundspeed = 0.0;
-	depth = 0.0;
-	ph = 8.0;
-
-	/* process argument list */
-	while ((c = getopt(argc, argv, "VvHhC:c:D:d:F:f:P:p:S:s:T:t:")) != -1)
-	  switch (c)
-		{
-		case 'H':
-		case 'h':
-			help++;
-			break;
-		case 'V':
-		case 'v':
-			verbose++;
-			break;
-		case 'C':
-		case 'c':
-			sscanf (optarg,"%lf", &soundspeed);
-			flag++;
-			break;
-		case 'D':
-		case 'd':
-			sscanf (optarg,"%lf", &depth);
-			flag++;
-			break;
-		case 'F':
-		case 'f':
-			sscanf (optarg,"%lf", &frequency);
-			flag++;
-			break;
-		case 'P':
-		case 'p':
-			sscanf (optarg,"%lf", &ph);
-			flag++;
-			break;
-		case 'S':
-		case 's':
-			sscanf (optarg,"%lf", &salinity);
-			flag++;
-			break;
-		case 'T':
-		case 't':
-			sscanf (optarg,"%lf", &temperature);
-			flag++;
-			break;
-		case '?':
-			errflg++;
-		}
-
-	/* if error flagged then print it and exit */
-	if (errflg)
-		{
-		fprintf(stderr,"usage: %s\n", usage_message);
-		error = MB_ERROR_BAD_USAGE;
-		exit(error);
-		}
-
-	/* set output stream */
-	if (verbose <= 1)
-		outfp = stdout;
-	else
-		outfp = stderr;
-
-	/* print starting message */
-	if (verbose == 1 || help)
-		{
-		fprintf(outfp,"\nProgram %s\n",program_name);
-		fprintf(outfp,"Version %s\n",rcs_id);
-		fprintf(outfp,"MB-system Version %s\n",MB_VERSION);
-		}
-
-	/* print starting debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(outfp,"\ndbg2  Program <%s>\n",program_name);
-		fprintf(outfp,"dbg2  Version %s\n",rcs_id);
-		fprintf(outfp,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(outfp,"dbg2  Control Parameters:\n");
-		fprintf(outfp,"dbg2       verbose:    %d\n",verbose);
-		fprintf(outfp,"dbg2       help:       %d\n",help);
-		fprintf(outfp,"dbg2       frequency:  %f\n",frequency);
-		fprintf(outfp,"dbg2       temperature:%f\n",temperature);
-		fprintf(outfp,"dbg2       salinity:   %f\n",salinity);
-		fprintf(outfp,"dbg2       soundspeed: %f\n",soundspeed);
-		fprintf(outfp,"dbg2       depth:      %f\n",depth);
-		fprintf(outfp,"dbg2       ph:         %f\n",ph);
-		}
-
-	/* if help desired then print it and exit */
-	if (help)
-		{
-		fprintf(outfp,"\n%s\n",help_message);
-		fprintf(outfp,"\nusage: %s\n", usage_message);
-		exit(error);
-		}
-
-	/* call function to calculate absorption */
-	status = mb_absorption(verbose, frequency, temperature,
-				salinity, depth, ph, soundspeed,
-				&absorption, &error);
-
-	/* print it out */
-	if (verbose > 0)
-		{
-		fprintf(outfp,"\nProgram <%s>\n",program_name);
-		fprintf(outfp,"Version %s\n",rcs_id);
-		fprintf(outfp,"MB-system Version %s\n",MB_VERSION);
-		fprintf(outfp,"Input Parameters:\n");
-		fprintf(outfp,"     Frequency:        %f kHz\n",frequency);
-		fprintf(outfp,"     Temperature:      %f deg C\n",temperature);
-		fprintf(outfp,"     Salinity:         %f per mil\n",salinity);
-		if (soundspeed > 0.0)
-			fprintf(outfp,"     Soundspeed:       %f m/sec\n",soundspeed);
-		fprintf(outfp,"     Depth:            %f m\n",depth);
-		fprintf(outfp,"     pH:               %f\n",ph);
-		fprintf(outfp,"Result:\n");
-		fprintf(outfp,"     Sound absorption: %f dB/km\n",absorption);
-		}
-	else
-		{
-		fprintf(outfp, "%f\n", absorption);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(outfp,"\ndbg2  Program <%s> completed\n",
-			program_name);
-		fprintf(outfp,"dbg2  Ending status:\n");
-		fprintf(outfp,"dbg2       status:  %d\n",status);
-		}
-
-	/* end it all */
-	exit(error);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/utilities/mbareaclean.c b/src/utilities/mbareaclean.c
deleted file mode 100644
index cdda395..0000000
--- a/src/utilities/mbareaclean.c
+++ /dev/null
@@ -1,1532 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbareaclean.c	2/27/2003
- *    $Id: mbareaclean.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 2003-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbareaclean identifies and flags artifacts in swath sonar bathymetry data.
- * The edit events are output to edit save files which can be applied
- * to the data by the program mbprocess. These are the same edit save
- * files created and/or modified by mbclean and mbedit.
- * The input data are one swath file or a datalist referencing multiple
- * swath files. An area is specified in longitude and latitude bounds,
- * along with a bin size in meters. The area is divided into a grid with
- * square cells of the specified bin size. As the data are read, each of
- * the soundings that fall within one of the bins is stored. Once all of
- * data are read, one or more statistical tests are performed on the soundings
- * within each bin, providing there are a sufficient number of soundings.
- * The user may specify one or both of the following actions:
- *   1) Previously unflagged soundings that fail a test are flagged as bad.
- *   2) Previously flagged soundings that pass all tests are unflagged.
- * If a sounding's flag status is changed, that flagging action is output
- * to the edit save file of the swath file containing that sounding. This
- * program will create edit save files if necessary, or append to those that
- * already exist.
- *
- * Author:	D. W. Caress
- * Date:	February 27, 2003
- *		Amsterdam Airport
- *
- * $Log: mbareaclean.c,v $
- * Revision 5.13  2008/12/05 17:32:52  caress
- * Check-in mods 5 December 2008 including contributions from Gordon Keith.
- *
- * Revision 5.12  2008/07/10 18:16:33  caress
- * Proceeding towards 5.1.1beta20.
- *
- * Revision 5.10  2007/10/08 16:48:07  caress
- * State of the code on 8 October 2007.
- *
- * Revision 5.9  2006/08/09 22:41:27  caress
- * Fixed programs that read or write grids so that they do not use the GMT_begin() function; these programs will now work when GMT is built in the default fashion, when GMT is built in the default fashion, with "advisory file locking" enabled.
- *
- * Revision 5.8  2006/02/01 07:31:06  caress
- * Modifications suggested by Gordon Keith
- *
- * Revision 5.7  2006/01/27 19:13:04  caress
- * Version 5.0.8beta2
- *
- * Revision 5.6  2006/01/18 15:17:00  caress
- * Added stdlib.h include.
- *
- * Revision 5.5  2005/11/05 01:07:54  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.4  2004/12/02 06:39:28  caress
- * Fixes while supporting Reson 7k data.
- *
- * Revision 5.3  2004/09/16 00:57:46  caress
- * Fixed parsing of bounds argument.
- *
- * Revision 5.2  2003/07/26 18:01:22  caress
- * Changed beamflag handling code.
- *
- * Revision 5.1  2003/04/17 21:17:10  caress
- * Release 5.0.beta30
- *
- * Revision 5.0  2003/03/10 20:47:08  caress
- * Initial version.
- *
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <math.h>
-#include <string.h>
-#include <sys/stat.h>
-#include <time.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_define.h"
-#include "mb_io.h"
-#include "mb_swap.h"
-#include "mb_process.h"
-#include "mb_info.h"
-
-/* allocation */
-#define FILEALLOCNUM	16
-#define PINGALLOCNUM	128
-#define SNDGALLOCNUM	128
-
-struct mbareaclean_file_struct {
-	char	filelist[MB_PATH_MAXLINE];
-	int	file_format;
-	int	nping;
-	int	nping_alloc;
-	int	nnull;
-	int	nflag;
-	int	ngood;
-	int	nunflagged;
-	int	nflagged;
-	double	*ping_time_d;
-	int	*pingmultiplicity;
-	double	*ping_altitude;
-	int	nsndg;
-	int	nsndg_alloc;
-	int	sndg_countstart;
-  	int	beams_bath;
-	struct mbareaclean_sndg_struct *sndg;
-	};
-struct mbareaclean_sndg_struct {
-	int	sndg_file;
-	int	sndg_ping;
-	int	sndg_beam;
-	double	sndg_depth;
-	double	sndg_x;
-	double	sndg_y;
-	char	sndg_beamflag_org;
-	char	sndg_beamflag_esf;
-	char	sndg_beamflag;
-	char	sndg_edit;
-	};
-
-/* sounding atorage values and arrays */
-int	nfile = 0;
-int	nfile_alloc = 0;
-struct mbareaclean_file_struct 	*files = NULL;
-int	nsndg = 0;
-int	nsndg_alloc = 0;
-int	sndg_countstart = 0;
-int	**gsndg = NULL;
-int	*gsndgnum = NULL;
-int	*gsndgnum_alloc = NULL;
-struct mbareaclean_sndg_struct *sndg = NULL;
-
-/* sounding pointer resolving function */
-int getsoundingptr(int verbose, int soundingid,
-		struct mbareaclean_sndg_struct **sndgptr,
-		int *error);
-int flag_sounding(int verbose, int flag, int output_bad, int output_good,
-		  struct mbareaclean_sndg_struct *sndg, int *error);
-
-static char rcs_id[] = "$Id: mbareaclean.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-
-int main (int argc, char **argv)
-{
-	char program_name[] = "MBAREACLEAN";
-	char help_message[] =  "MBAREACLEAN identifies and flags artifacts in swath bathymetry data";
-	char usage_message[] = "mbareaclean [-Fformat -Iinfile -Rwest/east/south/north -B -G -Sbinsize	\n\t -Mthreshold/nmin -Dthreshold[/nmin[/nmax]] -Ttype -N[-]minbeam/maxbeam]";
-	extern char *optarg;
-	int	errflg = 0;
-	int	c;
-	int	help = 0;
-	int	flag = 0;
-
-	/* MBIO status variables */
-	int	status;
-	int	verbose = 0;
-	int	error = MB_ERROR_NO_ERROR;
-	char	*message = NULL;
-
-	/* MBIO read control parameters */
-	void	*mbio_ptr = NULL;
-	void	*store_ptr = NULL;
-	int	kind;
-	int	read_datalist = MB_NO;
-	char	read_file[MB_PATH_MAXLINE];
-	char	swathfile[MB_PATH_MAXLINE];
-	char	swathfileread[MB_PATH_MAXLINE];
-	void	*datalist;
-	int	look_processed = MB_DATALIST_LOOK_UNSET;
-	int	read_data;
-	double	file_weight;
-	int	format;
-	int	formatread;
-	int	variable_beams;
-	int	traveltime;
-	int	beam_flagging;
-	int	pings;
-	int	lonflip;
-	double	bounds[4];
-	int	btime_i[7];
-	int	etime_i[7];
-	double	btime_d;
-	double	etime_d;
-	double	speedmin;
-	double	timegap;
-	struct mb_info_struct mb_info;
-
-	int	time_i[7];
-	double	time_d;
-	int	pingsread;
-	double	navlon;
-	double	navlat;
-	double	speed;
-	double	heading;
-	double	distance;
-	double	altitude;
-	double	sonardepth;
-	int	beams_bath;
-	int	beams_amp;
-	int	pixels_ss;
-	char	*beamflag;
-	char	*beamflagorg;
-	int	*detect;
-	double	*bath;
-	double	*amp;
-	double	*bathlon;
-	double	*bathlat;
-	double	*ss;
-	double	*sslon;
-	double	*sslat;
-	char	comment[MB_COMMENT_MAXLINE];
-
-	/* mbareaclean control parameters */
-	int	median_filter = MB_NO;
-	double	median_filter_threshold = 0.25;
-	int	median_filter_nmin = 10;
-	int	density_filter = MB_NO;
-	int	density_filter_nmax = 0;
-	int	plane_fit = MB_NO;
-	double	plane_fit_threshold = 0.05;
-	int	plane_fit_nmin = 10;
-	int	std_dev_filter = MB_NO;
-	double	std_dev_threshold = 2.0;
-	int	std_dev_nmin = 10;
-	int	output_good = MB_NO;
-	int	output_bad = MB_NO;
-	int	flag_detect = MB_DETECT_AMPLITUDE;
-	int	use_detect = MB_NO;
-	int	limit_beams = MB_NO;
-	int	beam_in = MB_YES;
-	int	min_beam = 0;
-	int	max_beam = 0;
-	int	max_beam_no = 0;
-	double	areabounds[4];
-	int	areaboundsset = MB_NO;
-	double	binsize = 0.0;
-	int	binsizeset = MB_NO;
-	double	dx, dy;
-	int	nx, ny;
-	double	mtodeglon;
-	double	mtodeglat;
-	double	mean;
-	double	std_dev;
-	int	detect_status;
-	int 	detect_error;
-
-	/* median filter parameters */
-	int	binnum;
-	int	binnummax;
-	double	*bindepths;
-	double	threshold;
-	double	median_depth;
-
-	/* counting parameters */
-	int	files_tot = 0;
-	int	pings_tot = 0;
-	int	beams_tot = 0;
-	int	beams_good_org_tot = 0;
-	int	beams_flag_org_tot = 0;
-	int	beams_null_org_tot = 0;
-	int	pings_file = 0;
-	int	beams_file = 0;
-	int	beams_good_org_file = 0;
-	int	beams_flag_org_file = 0;
-	int	beams_null_org_file = 0;
-
-	/* save file control variables */
-	int	esffile_open = MB_NO;
-	char	esffile[MB_PATH_MAXLINE];
-	struct mb_esf_struct esf;
-	int	action;
-
-	double	xx, yy;
-	int	flagsounding;
-	double	median_depth_low;
-	double	median_depth_high;
-	int	done;
-	int	ix, iy, ib, kgrid;
-	double	d1, d2;
-	int	i1, i2, n;
-	int	i, j;
-
-	/* get current default values */
-	status = mb_defaults(verbose,&format,&pings,&lonflip,bounds,
-		btime_i,etime_i,&speedmin,&timegap);
-
-	/* reset all defaults but the format and lonflip */
-	strcpy(read_file,"datalist.mb-1");
-	format = 0;
-	pings = 1;
-	bounds[0] = -360.;
-	bounds[1] = 360.;
-	bounds[2] = -90.;
-	bounds[3] = 90.;
-	btime_i[0] = 1962;
-	btime_i[1] = 2;
-	btime_i[2] = 21;
-	btime_i[3] = 10;
-	btime_i[4] = 30;
-	btime_i[5] = 0;
-	btime_i[6] = 0;
-	etime_i[0] = 2062;
-	etime_i[1] = 2;
-	etime_i[2] = 21;
-	etime_i[3] = 10;
-	etime_i[4] = 30;
-	etime_i[5] = 0;
-	etime_i[6] = 0;
-	speedmin = 0.0;
-	timegap = 1000000000.0;
-
-	/* process argument list */
-	while ((c = getopt(argc, argv, "VvHhBbGgD:d:F:f:I:i:M:m:N:n:P:p:S:sT:t::R:r:")) != -1)
-	  switch (c)
-		{
-		case 'H':
-		case 'h':
-			help++;
-			break;
-		case 'V':
-		case 'v':
-			verbose++;
-			break;
-		case 'B':
-		case 'b':
-			output_bad = MB_YES;
-			flag++;
-			break;
-		case 'D':
-		case 'd':
-		  	std_dev_filter = MB_YES;
-			sscanf (optarg,"%lf/%d",
-				&std_dev_threshold,&std_dev_nmin);
-			flag++;
-			break;
-		case 'F':
-		case 'f':
-			sscanf (optarg,"%d", &format);
-			flag++;
-			break;
-		case 'G':
-		case 'g':
-			output_good = MB_YES;
-			flag++;
-			break;
-		case 'I':
-		case 'i':
-			sscanf (optarg,"%s", read_file);
-			flag++;
-			break;
-		case 'M':
-		case 'm':
-			median_filter = MB_YES;
-			n = sscanf (optarg,"%lf/%d/%d",
-					&d1,&i1,&i2);
-			if (n > 0) median_filter_threshold = d1;
-			if (n > 1) median_filter_nmin = i1;
-			if (n > 2)
-				{
-				density_filter = MB_YES;
-				density_filter_nmax = i2;
-				}
-			flag++;
-			break;
-		case 'N':
-		case 'n':
-			limit_beams = MB_YES;
-			sscanf (optarg,"%d/%d",
-					&min_beam,&max_beam_no);
-			if (optarg[0] == '-')
-			  {
-			    min_beam = -min_beam;
-			    beam_in = MB_NO;
-			  }
-			if (max_beam_no < 0)
-			  max_beam_no = -max_beam_no;
-			max_beam = max_beam_no;
-			if (max_beam < min_beam)
-			  max_beam = min_beam;
-			flag++;
-			break;
-		case 'P':
-		case 'p':
-			plane_fit = MB_YES;
-			sscanf (optarg,"%lf", &plane_fit_threshold);
-			n = sscanf (optarg,"%lf/%d/%lf",
-					&d1,&i1,&d2);
-			if (n > 0) plane_fit_threshold = d1;
-			if (n > 1) plane_fit_nmin = i1;
-			flag++;
-			break;
-		case 'R':
-		case 'r':
-				mb_get_bounds(optarg, areabounds);
-				areaboundsset = MB_YES;
-			flag++;
-			break;
-		case 'S':
-		case 's':
-			sscanf (optarg,"%lf", &binsize);
-			binsizeset = MB_YES;
-			flag++;
-			break;
-		case 'T':
-		case 't':
-		  	use_detect = MB_YES;
-			sscanf (optarg,"%d", &flag_detect);
-			flag++;
-			break;
-		case '?':
-			errflg++;
-		}
-
-	/* if error flagged then print it and exit */
-	if (errflg)
-		{
-		fprintf(stderr,"usage: %s\n", usage_message);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		error = MB_ERROR_BAD_USAGE;
-		exit(error);
-		}
-
-	/* turn on median filter if nothing specified */
-	if (median_filter == MB_NO
-		&& plane_fit == MB_NO
-	    	&& std_dev_filter == MB_NO)
-		median_filter = MB_YES;
-
-	/* turn on output bad if nothing specified */
-	if (output_bad == MB_NO
-		&& output_good == MB_NO)
-		output_bad = MB_YES;
-
-	/* print starting message */
-	if (verbose == 1 || help)
-		{
-		fprintf(stderr,"\nProgram %s\n",program_name);
-		fprintf(stderr,"Version %s\n",rcs_id);
-		fprintf(stderr,"MB-system Version %s\n",MB_VERSION);
-		}
-
-	/* print starting debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  Program <%s>\n",program_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Control Parameters:\n");
-		fprintf(stderr,"dbg2       verbose:        %d\n",verbose);
-		fprintf(stderr,"dbg2       help:           %d\n",help);
-		fprintf(stderr,"dbg2       pings:          %d\n",pings);
-		fprintf(stderr,"dbg2       lonflip:        %d\n",lonflip);
-		fprintf(stderr,"dbg2       bounds[0]:      %f\n",bounds[0]);
-		fprintf(stderr,"dbg2       bounds[1]:      %f\n",bounds[1]);
-		fprintf(stderr,"dbg2       bounds[2]:      %f\n",bounds[2]);
-		fprintf(stderr,"dbg2       bounds[3]:      %f\n",bounds[3]);
-		fprintf(stderr,"dbg2       btime_i[0]:     %d\n",btime_i[0]);
-		fprintf(stderr,"dbg2       btime_i[1]:     %d\n",btime_i[1]);
-		fprintf(stderr,"dbg2       btime_i[2]:     %d\n",btime_i[2]);
-		fprintf(stderr,"dbg2       btime_i[3]:     %d\n",btime_i[3]);
-		fprintf(stderr,"dbg2       btime_i[4]:     %d\n",btime_i[4]);
-		fprintf(stderr,"dbg2       btime_i[5]:     %d\n",btime_i[5]);
-		fprintf(stderr,"dbg2       btime_i[6]:     %d\n",btime_i[6]);
-		fprintf(stderr,"dbg2       etime_i[0]:     %d\n",etime_i[0]);
-		fprintf(stderr,"dbg2       etime_i[1]:     %d\n",etime_i[1]);
-		fprintf(stderr,"dbg2       etime_i[2]:     %d\n",etime_i[2]);
-		fprintf(stderr,"dbg2       etime_i[3]:     %d\n",etime_i[3]);
-		fprintf(stderr,"dbg2       etime_i[4]:     %d\n",etime_i[4]);
-		fprintf(stderr,"dbg2       etime_i[5]:     %d\n",etime_i[5]);
-		fprintf(stderr,"dbg2       etime_i[6]:     %d\n",etime_i[6]);
-		fprintf(stderr,"dbg2       speedmin:       %f\n",speedmin);
-		fprintf(stderr,"dbg2       timegap:        %f\n",timegap);
-		fprintf(stderr,"dbg2       data format:    %d\n",format);
-		fprintf(stderr,"dbg2       input file:     %s\n",read_file);
-		fprintf(stderr,"dbg2       median_filter:             %d\n",median_filter);
-		fprintf(stderr,"dbg2       median_filter_threshold:   %f\n",median_filter_threshold);
-		fprintf(stderr,"dbg2       median_filter_nmin:        %d\n",median_filter_nmin);
-		fprintf(stderr,"dbg2       density_filter:            %d\n",density_filter);
-		fprintf(stderr,"dbg2       density_filter_nmax:       %d\n",density_filter_nmax);
-		fprintf(stderr,"dbg2       plane_fit:                 %d\n",plane_fit);
-		fprintf(stderr,"dbg2       plane_fit_threshold:       %f\n",plane_fit_threshold);
-		fprintf(stderr,"dbg2       plane_fit_nmin:            %d\n",plane_fit_nmin);
-		fprintf(stderr,"dbg2       std_dev_filter:            %d\n",std_dev_filter);
-		fprintf(stderr,"dbg2       std_dev_threshold:         %f\n",std_dev_threshold);
-		fprintf(stderr,"dbg2       std_dev_nmin:              %d\n",std_dev_nmin);
-		fprintf(stderr,"dbg2       use_detect:                %d\n",use_detect);
-		fprintf(stderr,"dbg2       flag_detect:               %d\n",flag_detect);
-		fprintf(stderr,"dbg2       limit_beams:               %d\n",limit_beams);
-		fprintf(stderr,"dbg2       beam_in:                   %d\n",beam_in);
-		fprintf(stderr,"dbg2       min_beam:                  %d\n",min_beam);
-		fprintf(stderr,"dbg2       max_beam_no                %d\n",max_beam_no);
-		fprintf(stderr,"dbg2       output_good:    %d\n",output_good);
-		fprintf(stderr,"dbg2       output_bad:     %d\n",output_bad);
-		fprintf(stderr,"dbg2       areaboundsset:  %d\n",areaboundsset);
-		fprintf(stderr,"dbg2       areabounds[0]:  %f\n",areabounds[0]);
-		fprintf(stderr,"dbg2       areabounds[1]:  %f\n",areabounds[1]);
-		fprintf(stderr,"dbg2       areabounds[2]:  %f\n",areabounds[2]);
-		fprintf(stderr,"dbg2       areabounds[3]:  %f\n",areabounds[3]);
-		fprintf(stderr,"dbg2       binsizeset:     %d\n",binsizeset);
-		fprintf(stderr,"dbg2       binsize:        %f\n",binsize);
-		}
-
-	/* if help desired then print it and exit */
-	if (help)
-		{
-		fprintf(stderr,"\n%s\n",help_message);
-		fprintf(stderr,"\nusage: %s\n", usage_message);
-		exit(error);
-		}
-
-	/* if bounds not set get bounds of input data */
-	if (areaboundsset == MB_NO)
-		{
-		formatread = format;
-		status = mb_get_info_datalist(verbose, read_file, &formatread,
-				&mb_info, lonflip, &error);
-
-		areabounds[0] = mb_info.lon_min;
-		areabounds[1] = mb_info.lon_max;
-		areabounds[2] = mb_info.lat_min;
-		areabounds[3] = mb_info.lat_max;
-
-		if (binsizeset == MB_NO)
-			binsize = 0.2 * mb_info.altitude_max;
-		}
-
-	/* calculate grid properties */
-	mb_coor_scale(verbose,0.5*(areabounds[2]+areabounds[3]),&mtodeglon,&mtodeglat);
-	if (binsize <= 0.0)
-		binsize = (areabounds[1] - areabounds[0]) / 101 / mtodeglon;
-	dx = binsize * mtodeglon;
-	dy = binsize * mtodeglat;
-	nx = 1 + (int)((areabounds[1] - areabounds[0]) / dx);
-	ny = 1 + (int)((areabounds[3] - areabounds[2]) / dy);
-	if (nx > 1 && ny > 1)
-		{
-		dx = (areabounds[1] - areabounds[0]) / (nx - 1);
-		dy = (areabounds[3] - areabounds[2]) / (ny - 1);
-		}
-
-	/* allocate grid arrays */
-	nsndg = 0;
-	nsndg_alloc = 0;
-	status = mb_mallocd(verbose,__FILE__,__LINE__, nx * ny * sizeof(int *),
-			(void **)&gsndg, &error);
-	if (status == MB_SUCCESS)
-	status = mb_mallocd(verbose,__FILE__,__LINE__, nx * ny * sizeof(int),
-			(void **)&gsndgnum, &error);
-	if (status == MB_SUCCESS)
-	status = mb_mallocd(verbose,__FILE__,__LINE__, nx * ny * sizeof(int),
-			(void **)&gsndgnum_alloc, &error);
-
-	/* if error initializing memory then quit */
-	if (error != MB_ERROR_NO_ERROR)
-		{
-		mb_error(verbose,error,&message);
-		fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",message);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-
-	/* if error initializing memory then quit */
-	for (i=0;i<nx*ny;i++)
-		{
-		gsndg[i] = NULL;
-		gsndgnum[i] = 0;
-		gsndgnum_alloc[i] = 0;
-		}
-
-	/* give the statistics */
-	if (verbose >= 0)
-		{
-		fprintf(stderr,"Area of interest:\n");
-		fprintf(stderr,"     Minimum Longitude: %.6f Maximum Longitude: %.6f\n",
-			areabounds[0],areabounds[1]);
-		fprintf(stderr,"     Minimum Latitude:  %.6f Maximum Latitude:  %.6f\n",
-			areabounds[2],areabounds[3]);
-		fprintf(stderr,"     Bin Size:   %f\n", binsize);
-		fprintf(stderr,"     Dimensions: %d %d\n", nx, ny);
-		fprintf(stderr,"Cleaning algorithms:\n");
-		if (median_filter == MB_YES)
-			{
-			fprintf(stderr,"     Median filter: ON\n");
-			fprintf(stderr,"     Median filter threshold:    %f\n",
-					median_filter_threshold);
-			fprintf(stderr,"     Median filter minimum N:    %d\n",
-					median_filter_nmin);
-			}
-		else
-			fprintf(stderr,"     Median filter: OFF\n");
-		if (density_filter == MB_YES)
-			{
-			fprintf(stderr,"     Density filter: ON\n");
-			fprintf(stderr,"     Density filter maximum N:    %d\n",
-					density_filter_nmax);
-			}
-		else
-			fprintf(stderr,"     Density filter: OFF\n");
-		if (plane_fit == MB_YES)
-			{
-			fprintf(stderr,"     Plane fit:     ON\n");
-			fprintf(stderr,"     Plane fit threshold:        %f\n",
-					median_filter_threshold);
-			fprintf(stderr,"     Plane fit minimum N:        %d\n",
-					median_filter_nmin);
-			}
-		else
-			fprintf(stderr,"     Plane fit:     OFF\n");
-		if (std_dev_filter == MB_YES)
-			{
-			fprintf(stderr,"     Standard deviation filter: ON\n");
-			fprintf(stderr,"     Standard deviation filter threshold:    %f\n",
-					std_dev_threshold);
-			fprintf(stderr,"     Standard deviation filter minimum N:    %d\n",
-					std_dev_nmin);
-			}
-		else
-			fprintf(stderr,"     Standard deviation filter: OFF\n");
-		fprintf(stderr,"Restrictions:\n");
-		if (use_detect)
-			{
-			fprintf(stderr,"     Only flag if bottom detection algorithn is: ");
-			if (flag_detect == MB_DETECT_UNKNOWN)
-			  	fprintf(stderr,"UNKNOWN\n");
-			else if (flag_detect == MB_DETECT_AMPLITUDE)
-			  	fprintf(stderr,"AMPLITUDE\n");
-			else if (flag_detect == MB_DETECT_PHASE)
-			  	fprintf(stderr,"PHASE\n");
-			else
-			  	fprintf(stderr,"%d\n", flag_detect);
-			}
-		if (limit_beams == MB_YES)
-			{
-			fprintf(stderr,"     Only flag if beams ");
-			if (beam_in == MB_YES)
-			  fprintf(stderr,"between");
-			else
-			  fprintf(stderr,"outside");
-			fprintf(stderr," beams %d - %d\n", min_beam, max_beam_no);
-			}
-		else
-			fprintf(stderr,"     Flag all beams\n");
-		fprintf(stderr,"Output:\n");
-		if (output_bad == MB_YES)
-			fprintf(stderr,"     Flag unflagged soundings identified as bad:  ON\n");
-		else
-			fprintf(stderr,"     Flag unflagged soundings identified as bad:  OFF\n");
-		if (output_good == MB_YES)
-			fprintf(stderr,"     Unflag flagged soundings identified as good: ON\n");
-		else
-			fprintf(stderr,"     Unflag flagged soundings identified as good: OFF\n");
-		}
-
-	/* get format if required */
-	if (format == 0)
-		mb_get_format(verbose,read_file,NULL,&format,&error);
-
-	/* determine whether to read one file or a list of files */
-	if (format < 0)
-		read_datalist = MB_YES;
-
-	/* open file list */
-	if (read_datalist == MB_YES)
-	    {
-	    if ((status = mb_datalist_open(verbose,&datalist,
-					    read_file,look_processed,&error)) != MB_SUCCESS)
-		{
-		error = MB_ERROR_OPEN_FAIL;
-		fprintf(stderr,"\nUnable to open data list file: %s\n",
-			read_file);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-	    if ((status = mb_datalist_read(verbose,datalist,
-			    swathfile,&format,&file_weight,&error))
-			    == MB_SUCCESS)
-		read_data = MB_YES;
-	    else
-		read_data = MB_NO;
-	    }
-	/* else copy single filename to be read */
-	else
-	    {
-	    strcpy(swathfile, read_file);
-	    read_data = MB_YES;
-	    }
-
-	/* loop over all files to be read */
-	while (read_data == MB_YES)
-	{
-
-	/* check format and get format flags */
-	if ((status = mb_format_flags(verbose,&format,
-			&variable_beams, &traveltime, &beam_flagging,
-			&error))
-		!= MB_SUCCESS)
-		{
-		mb_error(verbose,error,&message);
-		fprintf(stderr,"\nMBIO Error returned from function <mb_format_flags> regarding input format %d:\n%s\n",format,message);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-
-	/* check for "fast bathymetry" or "fbt" file */
-	strcpy(swathfileread, swathfile);
-	formatread = format;
-	if (use_detect == MB_NO)
-	  	mb_get_fbt(verbose, swathfileread, &formatread, &error);
-
-	/* initialize reading the input swath sonar file */
-	if ((status = mb_read_init(
-		verbose,swathfileread,formatread,pings,lonflip,bounds,
-		btime_i,etime_i,speedmin,timegap,
-		&mbio_ptr,&btime_d,&etime_d,
-		&beams_bath,&beams_amp,&pixels_ss,&error)) != MB_SUCCESS)
-		{
-		mb_error(verbose,error,&message);
-		fprintf(stderr,"\nMBIO Error returned from function <mb_read_init>:\n%s\n",message);
-		fprintf(stderr,"\nMultibeam File <%s> not initialized for reading\n",swathfileread);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-
-	/* initialize and increment counting variables */
-	pings_file = 0;
-	beams_file = 0;
-
-	/* give the statistics */
-	if (verbose >= 0)
-		{
-		fprintf(stderr,"\nProcessing %s\n",swathfileread);
-		}
-
-	/* allocate memory for data arrays */
-	beamflag = NULL;
-	beamflagorg = NULL;
-	detect = NULL;
-	bath = NULL;
-	amp = NULL;
-	bathlon = NULL;
-	bathlat = NULL;
-	ss = NULL;
-	sslon = NULL;
-	sslat = NULL;
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(char), (void **)&beamflag, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(char), (void **)&detect, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(double), (void **)&bath, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_AMPLITUDE,
-						sizeof(double), (void **)&amp, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(double), (void **)&bathlon, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(double), (void **)&bathlat, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_SIDESCAN,
-						sizeof(double), (void **)&ss, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_SIDESCAN,
-						sizeof(double), (void **)&sslon, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_SIDESCAN,
-						sizeof(double), (void **)&sslat, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(char), (void **)&beamflagorg, &error);
-
-	/* if error initializing memory then quit */
-	if (error != MB_ERROR_NO_ERROR)
-		{
-		mb_error(verbose,error,&message);
-		fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",message);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-
-	/* update memory for files */
-	if (nfile >= nfile_alloc)
-		{
-		nfile_alloc += FILEALLOCNUM;
-		status = mb_reallocd(verbose, __FILE__, __LINE__,
-				nfile_alloc * sizeof(struct mbareaclean_file_struct),
-				(void **)&files, &error);
-
-		/* if error initializing memory then quit */
-		if (error != MB_ERROR_NO_ERROR)
-			{
-			mb_error(verbose,error,&message);
-			fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",message);
-			fprintf(stderr,"\nProgram <%s> Terminated\n",
-				program_name);
-			exit(error);
-			}
-		}
-
-	/* initialize current file */
-	strcpy(files[nfile].filelist, swathfile);
-	files[nfile].file_format = format;
-	files[nfile].nping = 0;
-	files[nfile].nping_alloc = PINGALLOCNUM;
-	files[nfile].nnull = 0;
-	files[nfile].nflag = 0;
-	files[nfile].ngood = 0;
-	files[nfile].nflagged = 0;
-	files[nfile].nunflagged = 0;
-	files[nfile].ping_time_d = NULL;
-	files[nfile].pingmultiplicity = NULL;
-	files[nfile].ping_altitude = NULL;
-	files[nfile].nsndg = 0;
-	files[nfile].nsndg_alloc = SNDGALLOCNUM;
-	files[nfile].sndg_countstart = nsndg;
-	files[nfile].beams_bath = beams_bath;
-	files[nfile].sndg = NULL;
-	status = mb_mallocd(verbose,__FILE__,__LINE__,
-			files[nfile].nping_alloc * sizeof(double),
-			(void **)&(files[nfile].ping_time_d), &error);
-	if (status == MB_SUCCESS)
-	status = mb_mallocd(verbose,__FILE__,__LINE__,
-			files[nfile].nping_alloc * sizeof(int),
-			(void **)&(files[nfile].pingmultiplicity), &error);
-	if (status == MB_SUCCESS)
-	status = mb_mallocd(verbose,__FILE__,__LINE__,
-			files[nfile].nping_alloc * sizeof(double),
-			(void **)&(files[nfile].ping_altitude), &error);
-	if (status == MB_SUCCESS)
-	status = mb_mallocd(verbose,__FILE__,__LINE__,
-			files[nfile].nsndg_alloc * sizeof(struct mbareaclean_sndg_struct),
-			(void **)&(files[nfile].sndg), &error);
-	if (error != MB_ERROR_NO_ERROR)
-		{
-		mb_error(verbose,error,&message);
-		fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",message);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-	nfile++;
-
-	/* now deal with old edit save file */
-	if (status == MB_SUCCESS)
-	    {
-	    /* handle esf edits */
-	    status = mb_esf_load(verbose, swathfile,
-			    MB_YES, MB_NO, esffile, &esf, &error);
-	    }
-
-	/* read */
-	done = MB_NO;
-	files_tot++;
-	pings_file = 0;
-	beams_file = 0;
-	beams_good_org_file = 0;
-	beams_flag_org_file = 0;
-	beams_null_org_file = 0;
-	while (done == MB_NO)
-	    {
-	    if (verbose > 1) fprintf(stderr,"\n");
-
-	    /* read next record */
-	    error = MB_ERROR_NO_ERROR;
-	    status = mb_read(verbose,mbio_ptr,&kind,
-			    &pingsread,time_i,&time_d,
-			    &navlon,&navlat,
-			    &speed,&heading,
-			    &distance,&altitude,&sonardepth,
-			    &beams_bath,&beams_amp,&pixels_ss,
-			    beamflag,bath,amp,bathlon,bathlat,
-			    ss,sslon,sslat,
-			    comment,&error);
-	    if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  current data status:\n");
-		fprintf(stderr,"dbg2    kind:       %d\n",kind);
-		fprintf(stderr,"dbg2    status:     %d\n",status);
-		}
-	    if (status == MB_SUCCESS && kind == MB_DATA_DATA)
-		{
-		for (i=0;i<beams_bath;i++)
-			beamflagorg[i] = beamflag[i];
-		status = mb_esf_apply(verbose, &esf,
-		    		time_d, 1, beams_bath,
-				beamflagorg, &error);
-
-		/* get detection */
-		if (use_detect == MB_YES)
-		  	{
-			status = mb_get_store(verbose,mbio_ptr,&store_ptr,&error);
-			detect_status = mb_detects(verbose,mbio_ptr,store_ptr,
-						&kind,&beams_bath,detect,&detect_error);
-
-			if (detect_status != MB_SUCCESS)
-				{
-				status = MB_SUCCESS;
-				for (i=0;i<beams_bath;i++)
-					{
-					detect[i] = MB_DETECT_UNKNOWN;
-					}
-				}
-		    	}
-
-		/* update counters */
-		pings_tot++;
-		pings_file++;
-		for (i=0;i<beams_bath;i++)
-			{
-			if (mb_beam_ok(beamflagorg[i]))
-				{
-				beams_tot++;
-				beams_file++;
-				beams_good_org_tot++;
-				beams_good_org_file++;
-				files[nfile-1].ngood++;
-				}
-			else if (beamflagorg[i] == MB_FLAG_NULL)
-				{
-				beams_null_org_tot++;
-				beams_null_org_file++;
-				files[nfile-1].nnull++;
-				}
-			else
-				{
-				beams_tot++;
-				beams_file++;
-				beams_flag_org_tot++;
-				beams_flag_org_file++;
-				files[nfile-1].nflag++;
-				}
-			}
-
-		/* allocate memory if necessary */
-		if (files[nfile-1].nping >= files[nfile-1].nping_alloc)
-			{
-			files[nfile-1].nping_alloc += PINGALLOCNUM;
-			status = mb_reallocd(verbose, __FILE__, __LINE__,
-					files[nfile-1].nping_alloc * sizeof(double),
-					(void **)&(files[nfile-1].ping_time_d), &error);
-			if (status == MB_SUCCESS)
-			status = mb_reallocd(verbose, __FILE__, __LINE__,
-					files[nfile-1].nping_alloc * sizeof(int),
-					(void **)&(files[nfile-1].pingmultiplicity), &error);
-			if (status == MB_SUCCESS)
-			status = mb_reallocd(verbose, __FILE__, __LINE__,
-					files[nfile-1].nping_alloc * sizeof(double),
-					(void **)&(files[nfile-1].ping_altitude), &error);
-			if (error != MB_ERROR_NO_ERROR)
-				{
-				mb_error(verbose,error,&message);
-				fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",message);
-				fprintf(stderr,"\nProgram <%s> Terminated\n",
-					program_name);
-				exit(error);
-				}
-			}
-
-		/* store the ping data */
-		files[nfile-1].ping_time_d[files[nfile-1].nping] = time_d;
-		if (files[nfile-1].nping > 0
-			&& files[nfile-1].ping_time_d[files[nfile-1].nping]
-				== files[nfile-1].ping_time_d[files[nfile-1].nping - 1])
-			{
-			files[nfile-1].pingmultiplicity[files[nfile-1].nping]
-				= files[nfile-1].pingmultiplicity[files[nfile-1].nping - 1] + 1;
-			}
-		else
-			{
-			files[nfile-1].pingmultiplicity[files[nfile-1].nping] = 0;
-			}
-		files[nfile-1].ping_altitude[files[nfile-1].nping] = altitude;
-		files[nfile-1].nping++;
-
-		/* check beam range */
-		if (limit_beams == MB_YES && max_beam_no == 0)
-		  max_beam = beams_bath - min_beam;
-
-		/* now loop over the beams and store the soundings in the grid bins */
-		for (ib=0;ib<beams_bath;ib++)
-			{
-			if (beamflagorg[ib] != MB_FLAG_NULL)
-				{
-				/* get bin for current beam */
-				ix = (bathlon[ib] - areabounds[0] - 0.5 * dx) / dx;
-				iy = (bathlat[ib] - areabounds[2] - 0.5 * dy) / dy;
-				kgrid = ix*ny + iy;
-
-				/* add sounding */
-				if (ix >= 0 && ix < nx
-					&& iy >= 0 && iy < ny)
-			        	{
-					if (files[nfile-1].nsndg >= files[nfile-1].nsndg_alloc)
-						{
-						files[nfile-1].nsndg_alloc += SNDGALLOCNUM;
-						status = mb_reallocd(verbose, __FILE__, __LINE__,
-									files[nfile-1].nsndg_alloc * sizeof(struct mbareaclean_sndg_struct),
-									(void **)&files[nfile-1].sndg, &error);
-						if (error != MB_ERROR_NO_ERROR)
-							{
-							mb_error(verbose,error,&message);
-							fprintf(stderr,"\nMBIO Error allocating sounding arrays:\n%s\n",message);
-							fprintf(stderr,"\nProgram <%s> Terminated\n",
-								program_name);
-							exit(error);
-							}
-						}
-
-
-					/* allocate space for sounding if needed */
-					if (gsndgnum[kgrid] >= gsndgnum_alloc[kgrid])
-						{
-						gsndgnum_alloc[kgrid] += SNDGALLOCNUM;
-						status = mb_reallocd(verbose, __FILE__, __LINE__,
-									gsndgnum_alloc[kgrid] * sizeof(int),
-									(void **)&gsndg[kgrid], &error);
-						if (error != MB_ERROR_NO_ERROR)
-							{
-							mb_error(verbose,error,&message);
-							fprintf(stderr,"\nMBIO Error allocating sounding arrays:\n%s\n",message);
-							fprintf(stderr,"\nProgram <%s> Terminated\n",
-								program_name);
-							exit(error);
-							}
-						}
-
-					/* store sounding data */
-					sndg = &(files[nfile-1].sndg[files[nfile-1].nsndg]);
-					sndg->sndg_file = nfile - 1;
-					sndg->sndg_ping = files[nfile - 1].nping - 1;
-					sndg->sndg_beam = ib;
-					sndg->sndg_depth = bath[ib];
-					sndg->sndg_x = bathlon[ib];
-					sndg->sndg_y = bathlat[ib];
-					sndg->sndg_beamflag_org = beamflag[ib];
-					sndg->sndg_beamflag_esf = beamflagorg[ib];
-					sndg->sndg_beamflag = beamflagorg[ib];
-					sndg->sndg_edit = MB_YES;
-					if (use_detect && detect[ib] != flag_detect)
-					  	sndg->sndg_edit = MB_NO;
-					if (limit_beams == MB_YES)
-					  	{
-						if (min_beam <= ib && ib <= max_beam)
-						  	{
-							if (beam_in == MB_NO)
-							  	sndg->sndg_edit = MB_NO;
-							}
-						else
-						    	{
-							if (beam_in == MB_YES)
-							  	sndg->sndg_edit = MB_NO;
-							}
-						}
-/* fprintf(stderr,"beam: %d  edit: %d\n", ib, sndg->sndg_edit);*/
-					files[nfile-1].nsndg++;
-					nsndg++;
-					gsndg[kgrid][gsndgnum[kgrid]]
-						= files[nfile-1].sndg_countstart
-							+ files[nfile-1].nsndg - 1;
-					gsndgnum[kgrid]++;
-/*fprintf(stderr,"NEW sounding:%d:%d file:%d time_d:%f depth:%f\n",
-nsndg-1,gsndg[kgrid][gsndgnum[kgrid]-1],sndg->sndg_file,
-files[sndg->sndg_file].ping_time_d[sndg->sndg_ping], sndg->sndg_depth);*/
-					}
-				}
-			}
-
-
-		}
-	    else if (error > MB_ERROR_NO_ERROR)
-		{
-		done = MB_YES;
-		}
-
-	    /* process a record */
-
-	    /* reset counters and data */
-	    }
-
-	/* close the files */
-	status = mb_close(verbose,&mbio_ptr,&error);
-	mb_esf_close(verbose, &esf, &error);
-
-	/* check memory */
-	if (verbose >= 4)
-		status = mb_memory_list(verbose,&error);
-
-	/* give the statistics */
-	if (verbose >= 0)
-		{
-		fprintf(stderr,"pings:%4d  beams: %7d good %7d flagged %7d null \n",
-				pings_file,beams_good_org_file
-				,beams_flag_org_file,beams_null_org_file);
-		}
-
-	/* figure out whether and what to read next */
-        if (read_datalist == MB_YES)
-                {
-		if ((status = mb_datalist_read(verbose,datalist,
-			    swathfile,&format,&file_weight,&error))
-			    == MB_SUCCESS)
-                        read_data = MB_YES;
-                else
-                        read_data = MB_NO;
-                }
-        else
-                {
-                read_data = MB_NO;
-                }
-
-	/* end loop over files in list */
-	}
-        if (read_datalist == MB_YES)
-		mb_datalist_close(verbose,&datalist,&error);
-
-	/* loop over grid cells to find maximum number of soundings */
-	binnummax = 0;
-	for (ix=0;ix<nx;ix++)
-	for (iy=0;iy<ny;iy++)
-		{
-		/* get cell id */
-		kgrid = ix*ny + iy;
-		xx = areabounds[0] + 0.5 * dx + ix * dx;
-		yy = areabounds[3] + 0.5 * dy + iy * dy;
-		binnummax = MAX(binnummax, gsndgnum[kgrid]);
-		}
-	status = mb_mallocd(verbose,__FILE__,__LINE__,
-			binnummax * sizeof(double),
-			(void **)&(bindepths), &error);
-	if (error != MB_ERROR_NO_ERROR)
-		{
-		mb_error(verbose,error,&message);
-		fprintf(stderr,"\nMBIO Error allocating sounding sorting array:\n%s\n",message);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-
-	/* deal with median filter */
-	if (median_filter == MB_YES)
-	{
-	/* loop over grid cells applying median filter test */
-	for (ix=0;ix<nx;ix++)
-	for (iy=0;iy<ny;iy++)
-		{
-		/* get cell id */
-		kgrid = ix*ny + iy;
-		xx = areabounds[0] + 0.5 * dx + ix * dx;
-		yy = areabounds[3] + 0.5 * dy + iy * dy;
-
-		/* load up array */
-		binnum = 0;
-		for (i=0;i<gsndgnum[kgrid];i++)
-			{
-			getsoundingptr(verbose, gsndg[kgrid][i], &sndg, &error);
-			if (mb_beam_ok(sndg->sndg_beamflag))
-				{
-				bindepths[binnum] = sndg->sndg_depth;
-				binnum++;
-				}
-/*fprintf(stderr,"ix:%d iy:%d kgrid:%d soundingid:%d beamflag:%d   binnum:%d\n",
-ix,iy,kgrid,gsndg[kgrid][i],sndg->sndg_beamflag,binnum);*/
-			}
-
-		/* apply median filter only if there are enough soundings */
-		if (binnum >= median_filter_nmin)
-			{
-			/* run qsort */
-			qsort((char *)bindepths,binnum,sizeof(double),
-				(void *)mb_double_compare);
-			median_depth = bindepths[binnum / 2];
-			if (density_filter == MB_YES
-				&& binnum / 2 - density_filter_nmax / 2 >= 0)
-				median_depth_low = bindepths[binnum / 2 + density_filter_nmax / 2];
-			else
-				median_depth_low = bindepths[0];
-			if (density_filter == MB_YES
-				&& binnum / 2 + density_filter_nmax / 2 < binnum)
-				median_depth_high = bindepths[binnum / 2 + density_filter_nmax / 2];
-			else
-				median_depth_high = bindepths[binnum-1];
-/* if (binnum>0)
-fprintf(stderr,"bin: %d %d %d  pos: %f %f  nsoundings:%d median:%f\n",
-ix,iy,kgrid,xx,yy,binnum,median_depth);*/
-
-			/* process the soundings */
-			for (i=0;i<gsndgnum[kgrid];i++)
-				{
-				getsoundingptr(verbose, gsndg[kgrid][i], &sndg, &error);
-				threshold = fabs(median_filter_threshold
-						* files[sndg->sndg_file].ping_altitude[sndg->sndg_ping]);
-				flagsounding = MB_NO;
-				if (fabs(sndg->sndg_depth - median_depth) > threshold)
-					flagsounding = MB_YES;
-				if (density_filter == MB_YES
-					&& (sndg->sndg_depth > median_depth_high
-						|| sndg->sndg_depth < median_depth_low))
-					flagsounding = MB_YES;
-/*fprintf(stderr,"sounding:%d file:%d time_d:%f depth:%f median:%f altitude:%f threshold:%f",
-gsndg[kgrid][i],sndg->sndg_file,
-files[sndg->sndg_file].ping_time_d[sndg->sndg_ping], sndg->sndg_depth,median_depth,
-files[sndg->sndg_file].ping_altitude[sndg->sndg_ping],
-threshold);*/
-				flag_sounding(verbose, flagsounding,
-					      output_bad, output_good,
-					      sndg, &error);
-				}
-			}
-		}
-	}
-
-	/* deal with standard deviation filter */
-	if (std_dev_filter == MB_YES)
-	  {
-	  /* loop over grid cells applying std dev filter test */
-	  for (ix=0;ix<nx;ix++)
-	  for (iy=0;iy<ny;iy++)
-	    {
-		  /* get cell id */
-		  kgrid = ix*ny + iy;
-		  xx = areabounds[0] + 0.5 * dx + ix * dx;
-		  yy = areabounds[3] + 0.5 * dy + iy * dy;
-
-		  /* get mean */
-		  mean = 0.0;
-		  binnum = 0;
-		  for (i=0;i<gsndgnum[kgrid];i++)
-		    {
-			  getsoundingptr(verbose, gsndg[kgrid][i], &sndg, &error);
-			  if (mb_beam_ok(sndg->sndg_beamflag))
-			    {
-			      mean += sndg->sndg_depth;
-			      binnum++;
-			    }
-		    }
-		  mean /= binnum;
-
-		      /* get standard deviation */
-		      std_dev = 0.0;
-		      for (i=0;i<gsndgnum[kgrid];i++)
-			{
-			  getsoundingptr(verbose, gsndg[kgrid][i], &sndg, &error);
-			  if (mb_beam_ok(sndg->sndg_beamflag))
-			    std_dev += (sndg->sndg_depth - mean) * (sndg->sndg_depth - mean);
-			}
-		      std_dev = sqrt(std_dev / binnum);
-
-		      threshold = std_dev * std_dev_threshold;
-
-if (binnum>0)
-fprintf(stderr,"bin: %d %d %d  pos: %f %f  nsoundings:%d / %d mean:%f std_dev:%f\n",
-	  ix,iy,kgrid,xx,yy,binnum,gsndgnum[kgrid],mean,std_dev);
-
-
-		  /* apply standard deviation threshold only if there are enough soundings */
-		  if (binnum >= std_dev_nmin)
-		    {
-
-		      /* process the soundings */
-		      for (i=0;i<gsndgnum[kgrid];i++)
-			{
-			  getsoundingptr(verbose, gsndg[kgrid][i], &sndg, &error);
-			  flag_sounding(verbose,
-					fabs(sndg->sndg_depth - mean) > threshold,
-					output_bad, output_good,
-					sndg, &error);
-			}
-
-		    }
-	    }
-	  }
-
-	/* loop over files checking for changed soundings */
-	for (i=0; i < nfile; i++)
-		{
-		/* open esf file */
-	    	status = mb_esf_load(verbose, files[i].filelist,
-			    MB_NO, MB_YES, esffile, &esf, &error);
-	    	if (status == MB_SUCCESS
-		    	&& esf.esffp != NULL)
-		    	esffile_open = MB_YES;
-	    	if (status == MB_FAILURE
-		    	&& error == MB_ERROR_OPEN_FAIL)
-		    	{
-		    	esffile_open = MB_NO;
-		    	fprintf(stderr, "\nUnable to open new edit save file %s\n",
-					esf.esffile);
-		    }
-
-		/* loop over all of the soundings */
-		for (j=0;j<files[i].nsndg;j++)
-			{
-			sndg = &(files[i].sndg[j]);
-			if (sndg->sndg_beamflag
-				!= sndg->sndg_beamflag_org)
-				{
-				if (mb_beam_ok(sndg->sndg_beamflag))
-					{
-					action = MBP_EDIT_UNFLAG;
-					}
-				else if (mb_beam_check_flag_manual(sndg->sndg_beamflag))
-					{
-					action = MBP_EDIT_FLAG;
-					}
-				else if (mb_beam_check_flag_filter(sndg->sndg_beamflag))
-					{
-					action = MBP_EDIT_FILTER;
-					}
-				mb_esf_save(verbose, &esf,
-						files[i].ping_time_d[sndg->sndg_ping],
-						sndg->sndg_beam
-							+ files[i].pingmultiplicity[sndg->sndg_ping]
-								* MB_ESF_MULTIPLICITY_FACTOR,
-						action, &error);
-				}
-			}
-
-		/* close esf file */
-		mb_esf_close(verbose, &esf, &error);
-
-		/* update mbprocess parameter file */
-		if (esffile_open == MB_YES)
-		    {
-		    /* update mbprocess parameter file */
-		    status = mb_pr_update_format(verbose, files[i].filelist,
-				MB_YES, files[i].file_format,
-				&error);
-		    status = mb_pr_update_edit(verbose, files[i].filelist,
-				MBP_EDIT_ON, esffile,
-				&error);
-		    }
-		}
-
-	/* give the total statistics */
-	if (verbose >= 0)
-		{
-		fprintf(stderr,"\nMBareaclean Processing Totals:\n");
-		fprintf(stderr,"-------------------------\n");
-		fprintf(stderr,"%d total swath data files processed\n",files_tot);
-		fprintf(stderr,"%d total pings processed\n",pings_tot);
-		fprintf(stderr,"%d total soundings processed\n",beams_tot);
-		fprintf(stderr,"-------------------------\n");
-		for (i=0;i<nfile;i++)
-			{
-			fprintf(stderr,"%3d soundings:%7d flagged:%7d unflagged:%7d  file:%s\n",
-				i, files[i].ngood + files[i].nflag,
-				files[i].nflagged, files[i].nunflagged,
-				files[i].filelist);
-			}
-		}
-
-	/* free arrays */
-	mb_freed(verbose,__FILE__, __LINE__, (void **)&bindepths,&error);
-	for (i=0;i<nx*ny;i++)
-		if (gsndg[i] != NULL)
-			mb_freed(verbose,__FILE__, __LINE__, (void **)&gsndg[i],&error);
-	mb_freed(verbose,__FILE__, __LINE__, (void **)&gsndg,&error);
-	mb_freed(verbose,__FILE__, __LINE__, (void **)&gsndgnum,&error);
-	mb_freed(verbose,__FILE__, __LINE__, (void **)&gsndgnum_alloc,&error);
-
-	for (i=0;i<nfile;i++)
-		{
-		mb_freed(verbose,__FILE__, __LINE__, (void **)&(files[nfile-1].ping_time_d),&error);
-		mb_freed(verbose,__FILE__, __LINE__, (void **)&(files[nfile-1].pingmultiplicity),&error);
-		mb_freed(verbose,__FILE__, __LINE__, (void **)&(files[nfile-1].ping_altitude),&error);
-		}
-
-	/* set program status */
-	status = MB_SUCCESS;
-
-	/* check memory */
-	if (verbose >= 4)
-		status = mb_memory_list(verbose,&error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  Program <%s> completed\n",
-			program_name);
-		fprintf(stderr,"dbg2  Ending status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* end it all */
-	exit(error);
-}
-/*--------------------------------------------------------------------*/
-int getsoundingptr(int verbose, int soundingid,
-		struct mbareaclean_sndg_struct **sndgptr,
-		int *error)
-{
-	/* local variables */
-	char	*function_name = "getsoundingptr";
-	int	status = MB_SUCCESS;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:         %d\n",verbose);
-		fprintf(stderr,"dbg2       soundingid:      %d\n",soundingid);
-		fprintf(stderr,"dbg2       sndgptr:         %p\n",(void *)sndgptr);
-		}
-
-	/* loop over the files until the sounding is found */
-	*sndgptr = NULL;
-	for (i=0; i < nfile && *sndgptr == NULL; i++)
-		{
-		if (soundingid >= files[i].sndg_countstart
-			&& soundingid < files[i].sndg_countstart + files[i].nsndg)
-			{
-			j = soundingid - files[i].sndg_countstart;
-			*sndgptr = &(files[i].sndg[j]);
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       *sndgptr:        %p\n",(void *)sndgptr);
-		fprintf(stderr,"dbg2       error:           %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:          %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-
-int flag_sounding(int verbose, int flag, int output_bad, int output_good,
-		  struct mbareaclean_sndg_struct *sndg, int *error)
-{
-	/* local variables */
-	char	*function_name = "flag_sounding";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:       %d\n",verbose);
-		fprintf(stderr,"dbg2       flag:          %d\n",flag);
-		fprintf(stderr,"dbg2       output_bad:    %d\n",output_bad);
-		fprintf(stderr,"dbg2       output_good:   %d\n",output_good);
-		fprintf(stderr,"dbg2       sndg->sndg_edit:     %d\n",sndg->sndg_edit);
-		fprintf(stderr,"dbg2       sndg->sndg_beam:     %d\n",sndg->sndg_beam);
-		fprintf(stderr,"dbg2       sndg->sndg_beamflag: %d\n",sndg->sndg_beamflag);
-		}
-
-	if (sndg->sndg_edit == MB_YES)
-	  {
-	    if (output_bad == MB_YES
-		&& mb_beam_ok(sndg->sndg_beamflag)
-		&& flag )
-	      {
-		sndg->sndg_beamflag = MB_FLAG_FLAG + MB_FLAG_FILTER;
-		files[sndg->sndg_file].nflagged++;
-	      }
-
-	    else if (output_good == MB_YES
-		     && !mb_beam_ok(sndg->sndg_beamflag)
-		     && sndg->sndg_beamflag != MB_FLAG_NULL
-		     && !flag)
-	      {
-		sndg->sndg_beamflag = MB_FLAG_NONE;
-		files[sndg->sndg_file].nunflagged++;
-	      }
-
-	    else if (output_good == MB_YES
-		     && !mb_beam_ok(sndg->sndg_beamflag)
-		     && sndg->sndg_beamflag != MB_FLAG_NULL
-		     && flag)
-	      {
-		sndg->sndg_edit = MB_NO;
-	      }
-	  }
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       sndg->sndg_edit:     %d\n",sndg->sndg_edit);
-		fprintf(stderr,"dbg2       sndg->sndg_beamflag: %d\n",sndg->sndg_beamflag);
-		fprintf(stderr,"dbg2       error:           %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:          %d\n",status);
-		}
-
-	/* return */
-	return(status);
-
-}
-
-/*--------------------------------------------------------------------*/
diff --git a/src/utilities/mbauvloglist.c b/src/utilities/mbauvloglist.c
deleted file mode 100644
index 26ec4d0..0000000
--- a/src/utilities/mbauvloglist.c
+++ /dev/null
@@ -1,858 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbauvloglist.c	8/14/2006
- *    $Id: mbauvloglist.c 2231 2015-02-21 01:46:02Z caress $
- *
- *    Copyright (c) 2006-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * MBauvloglist prints the specified contents of an MBARI AUV mission log
- * file to stdout. The form of the output is quite flexible;
- * MBsegylist is tailored to produce ascii files in spreadsheet
- * style with data columns separated by tabs.
- *
- * Author:	D. W. Caress
- * Date:	August 14, 2006
- * Location:	R/V Western Flyer hove to in a gale offshore British Columbia
- *
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <math.h>
-#include <string.h>
-#include <time.h>
-
-/* MBIO include files */
-#include "mb_status.h"
-#include "mb_define.h"
-#include "mb_aux.h"
-
-/* local defines */
-#define	NFIELDSMAX	50
-#define	MAX_OPTIONS	50
-#define	TYPE_UNKNOWN	0
-#define	TYPE_TIMETAG	1
-#define	TYPE_INTEGER	2
-#define	TYPE_DOUBLE	3
-#define	TYPE_ANGLE	4
-
-#define INDEX_ZERO		-1
-#define INDEX_MERGE_LON		-2
-#define INDEX_MERGE_LAT		-3
-#define INDEX_MERGE_HEADING	-4
-#define INDEX_MERGE_SPEED	-5
-#define INDEX_MERGE_SENSORDEPTH	-6
-#define INDEX_MERGE_ROLL	-7
-#define INDEX_MERGE_PITCH	-8
-#define INDEX_MERGE_HEAVE	-9
-
-#define OUTPUT_MODE_TAB		0
-#define OUTPUT_MODE_CSV		1
-#define OUTPUT_MODE_BINARY	2
-
-static char rcs_id[] = "$Id: mbauvloglist.c 2231 2015-02-21 01:46:02Z caress $";
-
-/*--------------------------------------------------------------------*/
-
-int main (int argc, char **argv)
-{
-	char program_name[] = "MBauvloglist";
-	char help_message[] =  "MBauvloglist lists table data from an MBARI AUV mission log file.";
-	char usage_message[] = "MBauvloglist -Ifile [-Fprintformat -Llonflip -Olist -H -V]";
-	extern char *optarg;
-	int	errflg = 0;
-	int	c;
-	int	help = 0;
-	int	flag = 0;
-
-	/* MBIO status variables */
-	int	status = MB_SUCCESS;
-	int	verbose = 0;
-	int	error = MB_ERROR_NO_ERROR;
-	char	*message = NULL;
-
-	/* MBIO read control parameters */
-	int	pings;
-	int	format;
-	int	lonflip;
-	double	bounds[4];
-	int	btime_i[7];
-	int	etime_i[7];
-	double	speedmin;
-	double	timegap;
-
-	/* auv log data */
-	FILE	*fp;
-	char	file[MB_PATH_MAXLINE];
-	struct	field
-		{
-		int	type;
-		int	size;
-		int	index;
-		char	name[MB_PATH_MAXLINE];
-		char	format[MB_PATH_MAXLINE];
-		char	description[MB_PATH_MAXLINE];
-		char	units[MB_PATH_MAXLINE];
-		double	scale;
-		};
-	struct	printfield
-		{
-		char	name[MB_PATH_MAXLINE];
-		int	index;
-		int	formatset;
-		char	format[MB_PATH_MAXLINE];
-		};
-	int	nfields = 0;
-	struct field fields[NFIELDSMAX];
-	int	nprintfields = 0;
-	struct printfield printfields[NFIELDSMAX];
-	int	nrecord;
-	int	recordsize;
-	int	printheader = MB_NO;
-	int	angles_in_degrees = MB_NO;
-
-	/* navigation, heading, attitude data for merging in fnv format */
-	int	nav_merge = MB_NO;
-	mb_path	nav_file;
-	int	nav_num = 0;
-	int	nav_alloc = 0;
-	double	*nav_time_d = NULL;
-	double	*nav_navlon = NULL;
-	double	*nav_navlat = NULL;
-	double	*nav_heading = NULL;
-	double	*nav_speed = NULL;
-	double	*nav_sensordepth = NULL;
-	double	*nav_roll = NULL;
-	double	*nav_pitch = NULL;
-	double	*nav_heave = NULL;
-	
-	/* output control */
-	int	output_mode = OUTPUT_MODE_TAB;
-
-	double	time_d = 0.0;
-	int	time_i[7];
-	int	time_j[5];
-	char	buffer[MB_PATH_MAXLINE];
-	char	type[MB_PATH_MAXLINE];
-	char	printformat[MB_PATH_MAXLINE];
-	char	*result;
-	int	nscan;
-	double	dvalue;
-	double	sec;
-	int	ivalue;
-	int	index;
-	int	jinterp = 0;
-	int	nchar;
-	int	nget;
-	int	nav_ok;
-	int	interp_status;
-	int	i, j;
-
-	/* get current default values */
-	status = mb_defaults(verbose,&format,&pings,&lonflip,bounds,
-		btime_i,etime_i,&speedmin,&timegap);
-
-	/* set file to null */
-	file[0] = '\0';
-	nav_file[0] = '\0';
-	strcpy(printformat, "default");
-
-	/* process argument list */
-	while ((c = getopt(argc, argv, "F:f:I:i:L:l:M:m:N:n:O:o:PpSsVvWwHh")) != -1)
-	  switch (c)
-		{
-		case 'H':
-		case 'h':
-			help++;
-			break;
-		case 'V':
-		case 'v':
-			verbose++;
-			break;
-		case 'F':
-		case 'f':
-			sscanf (optarg,"%s", printformat);
-			flag++;
-			break;
-		case 'I':
-		case 'i':
-			sscanf (optarg,"%s", file);
-			flag++;
-			break;
-		case 'L':
-		case 'l':
-			sscanf (optarg,"%d", &lonflip);
-			flag++;
-			break;
-		case 'M':
-		case 'm':
-			sscanf (optarg,"%d", &output_mode);
-			flag++;
-			break;
-		case 'N':
-		case 'n':
-			sscanf (optarg,"%s", nav_file);
-			nav_merge = MB_YES;
-			flag++;
-			break;
-		case 'O':
-		case 'o':
-			nscan = sscanf (optarg,"%s", printfields[nprintfields].name);
-			if (strlen(printformat) > 0 && strcmp(printformat, "default") != 0)
-				{
-				printfields[nprintfields].formatset = MB_YES;
-				strcpy(printfields[nprintfields].format,printformat);
-				}
-			else
-				{
-				printfields[nprintfields].formatset = MB_NO;
-				strcpy(printfields[nprintfields].format,"");
-				}
-			printfields[nprintfields].index = -1;
-			nprintfields++;
-			flag++;
-			break;
-		case 'P':
-		case 'p':
-			printheader = MB_YES;
-			flag++;
-			break;
-		case 'S':
-		case 's':
-			angles_in_degrees = MB_YES;
-			flag++;
-			break;
-		case '?':
-			errflg++;
-		}
-
-	/* if error flagged then print it and exit */
-	if (errflg)
-		{
-		fprintf(stderr,"usage: %s\n", usage_message);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		error = MB_ERROR_BAD_USAGE;
-		exit(error);
-		}
-
-	/* print starting message */
-	if (verbose == 1 || help)
-		{
-		fprintf(stderr,"\nProgram %s\n",program_name);
-		fprintf(stderr,"Version %s\n",rcs_id);
-		fprintf(stderr,"MB-system Version %s\n",MB_VERSION);
-		}
-
-	/* print starting debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  Program <%s>\n",program_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Control Parameters:\n");
-		fprintf(stderr,"dbg2       verbose:        %d\n",verbose);
-		fprintf(stderr,"dbg2       help:           %d\n",help);
-		fprintf(stderr,"dbg2       lonflip:        %d\n",lonflip);
-		fprintf(stderr,"dbg2       bounds[0]:      %f\n",bounds[0]);
-		fprintf(stderr,"dbg2       bounds[1]:      %f\n",bounds[1]);
-		fprintf(stderr,"dbg2       bounds[2]:      %f\n",bounds[2]);
-		fprintf(stderr,"dbg2       bounds[3]:      %f\n",bounds[3]);
-		fprintf(stderr,"dbg2       btime_i[0]:     %d\n",btime_i[0]);
-		fprintf(stderr,"dbg2       btime_i[1]:     %d\n",btime_i[1]);
-		fprintf(stderr,"dbg2       btime_i[2]:     %d\n",btime_i[2]);
-		fprintf(stderr,"dbg2       btime_i[3]:     %d\n",btime_i[3]);
-		fprintf(stderr,"dbg2       btime_i[4]:     %d\n",btime_i[4]);
-		fprintf(stderr,"dbg2       btime_i[5]:     %d\n",btime_i[5]);
-		fprintf(stderr,"dbg2       btime_i[6]:     %d\n",btime_i[6]);
-		fprintf(stderr,"dbg2       etime_i[0]:     %d\n",etime_i[0]);
-		fprintf(stderr,"dbg2       etime_i[1]:     %d\n",etime_i[1]);
-		fprintf(stderr,"dbg2       etime_i[2]:     %d\n",etime_i[2]);
-		fprintf(stderr,"dbg2       etime_i[3]:     %d\n",etime_i[3]);
-		fprintf(stderr,"dbg2       etime_i[4]:     %d\n",etime_i[4]);
-		fprintf(stderr,"dbg2       etime_i[5]:     %d\n",etime_i[5]);
-		fprintf(stderr,"dbg2       etime_i[6]:     %d\n",etime_i[6]);
-		fprintf(stderr,"dbg2       speedmin:       %f\n",speedmin);
-		fprintf(stderr,"dbg2       timegap:        %f\n",timegap);
-		fprintf(stderr,"dbg2       file:           %s\n",file);
-		fprintf(stderr,"dbg2       nav_file:       %s\n",nav_file);
-		fprintf(stderr,"dbg2       output_mode:    %d\n",output_mode);
-		fprintf(stderr,"dbg2       printheader:    %d\n",printheader);
-		fprintf(stderr,"dbg2       angles_in_degrees:%d\n",angles_in_degrees);
-		fprintf(stderr,"dbg2       nprintfields:   %d\n",nprintfields);
-		for (i=0;i<nprintfields;i++)
-			fprintf(stderr,"dbg2         printfields[%d]:      %s %d %s\n",
-						i,printfields[i].name,
-						printfields[i].formatset,
-						printfields[i].format);
-		}
-
-	/* if help desired then print it and exit */
-	if (help)
-		{
-		fprintf(stderr,"\n%s\n",help_message);
-		fprintf(stderr,"\nusage: %s\n", usage_message);
-		exit(error);
-		}
-
-	/* if nav merging to be done get nav */
-	if (nav_merge == MB_YES && strlen(nav_file) > 0)
-		{
-		/* count the data points in the nav file */
-		nav_num = 0;
-		nchar = MB_PATH_MAXLINE-1;
-		if ((fp = fopen(nav_file, "r")) == NULL)
-			{
-			error = MB_ERROR_OPEN_FAIL;
-			fprintf(stderr,"\nUnable to Open Navigation File <%s> for reading\n",nav_file);
-			fprintf(stderr,"\nProgram <%s> Terminated\n",
-				program_name);
-			exit(error);
-			}
-		while ((result = fgets(buffer,nchar,fp)) == buffer)
-			nav_num++;
-		fclose(fp);
-    
-		/* allocate arrays for nav */
-		if (nav_num > 0)
-			{
-			nav_alloc = nav_num;
-			status = mb_mallocd(verbose,__FILE__,__LINE__,nav_alloc*sizeof(double),(void **)&nav_time_d,&error);
-			status = mb_mallocd(verbose,__FILE__,__LINE__,nav_alloc*sizeof(double),(void **)&nav_navlon,&error);
-			status = mb_mallocd(verbose,__FILE__,__LINE__,nav_alloc*sizeof(double),(void **)&nav_navlat,&error);
-			status = mb_mallocd(verbose,__FILE__,__LINE__,nav_alloc*sizeof(double),(void **)&nav_heading,&error);
-			status = mb_mallocd(verbose,__FILE__,__LINE__,nav_alloc*sizeof(double),(void **)&nav_speed,&error);
-			status = mb_mallocd(verbose,__FILE__,__LINE__,nav_alloc*sizeof(double),(void **)&nav_sensordepth,&error);
-			status = mb_mallocd(verbose,__FILE__,__LINE__,nav_alloc*sizeof(double),(void **)&nav_roll,&error);
-			status = mb_mallocd(verbose,__FILE__,__LINE__,nav_alloc*sizeof(double),(void **)&nav_pitch,&error);
-			status = mb_mallocd(verbose,__FILE__,__LINE__,nav_alloc*sizeof(double),(void **)&nav_heave,&error);
-	
-			/* if error initializing memory then quit */
-			if (error != MB_ERROR_NO_ERROR)
-				{
-				mb_error(verbose,error,&message);
-				fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",message);
-				fprintf(stderr,"\nProgram <%s> Terminated\n",
-					program_name);
-				exit(error);
-				}
-			}
-    
-		/* read the data points in the nav file */
-		nav_num = 0;
-		if ((fp = fopen(nav_file, "r")) == NULL)
-			{
-			error = MB_ERROR_OPEN_FAIL;
-			fprintf(stderr,"\nUnable to Open navigation File <%s> for reading\n",nav_file);
-			fprintf(stderr,"\nProgram <%s> Terminated\n",
-				program_name);
-			exit(error);
-			}
-		while ((result = fgets(buffer,nchar,fp)) == buffer)
-			{
-			nget = sscanf(buffer,"%d %d %d %d %d %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf",
-				&time_i[0],&time_i[1],&time_i[2],
-				&time_i[3],&time_i[4],&sec,
-				&nav_time_d[nav_num],
-				&nav_navlon[nav_num],&nav_navlat[nav_num],
-				&nav_heading[nav_num],&nav_speed[nav_num],&nav_sensordepth[nav_num],
-				&nav_roll[nav_num],&nav_pitch[nav_num],&nav_heave[nav_num]);
-			if (nget >= 9)
-				nav_ok = MB_YES;
-			else
-				nav_ok = MB_NO;
-                        if (nav_num > 0 && nav_time_d[nav_num] <= nav_time_d[nav_num-1])
-                                nav_ok = MB_NO;
-			if (nav_ok == MB_YES)
-			    nav_num++;
-			}
-		fclose(fp);
- 		}
-fprintf(stderr,"%d %d records read from nav file %s\n",nav_alloc,nav_num,nav_file);
-		
-	/* open the input file */
-	if ((fp = fopen(file, "r")) == NULL)
-		{
-		error = MB_ERROR_OPEN_FAIL;
-		status = MB_FAILURE;
-		fprintf(stderr,"\nUnable to open log file <%s> for reading\n",file);
-		exit(status);
-		}
-
-	nfields = 0;
-	recordsize = 0;
-	while ((result = fgets(buffer,MB_PATH_MAXLINE,fp)) == buffer
-		&& strncmp(buffer, "# begin",7) != 0)
-		{
-		nscan = sscanf(buffer, "# %s %s %s",
-				type,
-				fields[nfields].name,
-				fields[nfields].format);
-		if (nscan == 2)
-			{
-			if (printheader == MB_YES)
-				fprintf(stdout,"# csv %s\n",  fields[nfields].name);
-			}
-
-		else if (nscan == 3)
-			{
-			if (printheader == MB_YES)
-				fprintf(stdout,"%s",buffer);
-
-			result = (char *) strchr(buffer, ',');
-			strcpy(fields[nfields].description, &(result[1]));
-			result = (char *) strchr(fields[nfields].description, ',');
-			result[0] = 0;
-			result = (char *) strrchr(buffer, ',');
-			strcpy(fields[nfields].units, &(result[1]));
-
-			fields[nfields].index = recordsize;
-			if (strcmp(type, "double") == 0)
-				{
-				fields[nfields].type = TYPE_DOUBLE;
-				fields[nfields].size = 8;
-				if (angles_in_degrees == MB_YES
-					&&(strcmp(fields[nfields].name, "mLatK") == 0
-						|| strcmp(fields[nfields].name, "mLonK") == 0
-						|| strcmp(fields[nfields].name, "mLatK") == 0
-						|| strcmp(fields[nfields].name, "mRollK") == 0
-						|| strcmp(fields[nfields].name, "mPitchK") == 0
-						|| strcmp(fields[nfields].name, "mHeadK") == 0
-						|| strcmp(fields[nfields].name, "mYawK") == 0
-						|| strcmp(fields[nfields].name, "mLonCB") == 0
-						|| strcmp(fields[nfields].name, "mLatCB") == 0
-						|| strcmp(fields[nfields].name, "mRollCB") == 0
-						|| strcmp(fields[nfields].name, "mPitchCB") == 0
-						|| strcmp(fields[nfields].name, "mHeadCB") == 0
-						|| strcmp(fields[nfields].name, "mYawCB") == 0))
-					fields[nfields].scale = RTD;
-				else
-					fields[nfields].scale = 1.0;
-				recordsize += 8;
-				}
-			else if (strcmp(type, "integer") == 0)
-				{
-				fields[nfields].type = TYPE_INTEGER;
-				fields[nfields].size = 4;
-				fields[nfields].scale = 1.0;
-				recordsize += 4;
-				}
-			else if (strcmp(type, "timeTag") == 0)
-				{
-				fields[nfields].type = TYPE_TIMETAG;
-				fields[nfields].size = 8;
-				fields[nfields].scale = 1.0;
-				recordsize += 8;
-				}
-			else if (strcmp(type, "angle") == 0)
-				{
-				fields[nfields].type = TYPE_ANGLE;
-				fields[nfields].size = 8;
-				if (angles_in_degrees == MB_YES
-					&&(strcmp(fields[nfields].name, "mRollCB") == 0
-						|| strcmp(fields[nfields].name, "mOmega_xCB") == 0
-						|| strcmp(fields[nfields].name, "mPitchCB") == 0
-						|| strcmp(fields[nfields].name, "mOmega_yCB") == 0
-						|| strcmp(fields[nfields].name, "mYawCB") == 0
-						|| strcmp(fields[nfields].name, "mOmega_zCB") == 0))
-					fields[nfields].scale = RTD;
-				else
-					fields[nfields].scale = 1.0;
-				recordsize += 8;
-				}
-			nfields++;
-			}
-		}
-
-	/* end here if asked only to print header */
-	if (nprintfields == 0 && printheader == MB_YES)
-		exit(error);
-
-	/* by default print everything */
-	if (nprintfields == 0)
-		{
-		nprintfields = nfields;
-		for (i=0;i<nfields;i++)
-			{
-			strcpy(printfields[i].name, fields[i].name);
-			printfields[i].index = i;
-			printfields[i].formatset = MB_NO;
-			strcpy(printfields[i].format, fields[i].format);
-			}
-		}
-
-	/* check the fields to be printed */
-	for (i=0;i<nprintfields;i++)
-		{
-		if (strcmp(printfields[i].name,"zero") == 0)
-			{
-			printfields[i].index = INDEX_ZERO;
-			if (printfields[i].formatset == MB_NO)
-				{
-				strcpy(printfields[i].format, "%f");
-				}
-			}
-		else if (strcmp(printfields[i].name,"timeTag") == 0)
-			{
-			printfields[i].index = INDEX_ZERO;
-			if (printfields[i].formatset == MB_NO)
-				{
-				strcpy(printfields[i].format, "%.8f");
-				}
-			}
-		else if (strcmp(printfields[i].name,"mergeLon") == 0)
-			{
-			printfields[i].index = INDEX_MERGE_LON;
-			if (printfields[i].formatset == MB_NO)
-				{
-				strcpy(printfields[i].format, "%.9f");
-				}
-			}
-		else if (strcmp(printfields[i].name,"mergeLat") == 0)
-			{
-			printfields[i].index = INDEX_MERGE_LAT;
-			if (printfields[i].formatset == MB_NO)
-				{
-				strcpy(printfields[i].format, "%.9f");
-				}
-			}
-		else if (strcmp(printfields[i].name,"mergeHeading") == 0)
-			{
-			printfields[i].index = INDEX_MERGE_HEADING;
-			if (printfields[i].formatset == MB_NO)
-				{
-				strcpy(printfields[i].format, "%.3f");
-				}
-			}
-		else if (strcmp(printfields[i].name,"mergeSpeed") == 0)
-			{
-			printfields[i].index = INDEX_MERGE_SPEED;
-			if (printfields[i].formatset == MB_NO)
-				{
-				strcpy(printfields[i].format, "%.3f");
-				}
-			}
-		else if (strcmp(printfields[i].name,"mergeDraft") == 0)
-			{
-			printfields[i].index = INDEX_MERGE_SENSORDEPTH;
-			if (printfields[i].formatset == MB_NO)
-				{
-				strcpy(printfields[i].format, "%.3f");
-				}
-			}
-		else if (strcmp(printfields[i].name,"mergeSensordepth") == 0)
-			{
-			printfields[i].index = INDEX_MERGE_SENSORDEPTH;
-			if (printfields[i].formatset == MB_NO)
-				{
-				strcpy(printfields[i].format, "%.3f");
-				}
-			}
-		else if (strcmp(printfields[i].name,"mergeRoll") == 0)
-			{
-			printfields[i].index = INDEX_MERGE_ROLL;
-			if (printfields[i].formatset == MB_NO)
-				{
-				strcpy(printfields[i].format, "%.3f");
-				}
-			}
-		else if (strcmp(printfields[i].name,"mergePitch") == 0)
-			{
-			printfields[i].index = INDEX_MERGE_PITCH;
-			if (printfields[i].formatset == MB_NO)
-				{
-				strcpy(printfields[i].format, "%.3f");
-				}
-			}
-		else if (strcmp(printfields[i].name,"mergeHeave") == 0)
-			{
-			printfields[i].index = INDEX_MERGE_HEAVE;
-			if (printfields[i].formatset == MB_NO)
-				{
-				strcpy(printfields[i].format, "%.3f");
-				}
-			}
-		else
-			{
-			for (j=0;j<nfields;j++)
-				{
-				if (strcmp(printfields[i].name, fields[j].name) == 0)
-					printfields[i].index = j;
-				}
-			if (printfields[i].formatset == MB_NO)
-				{
-				strcpy(printfields[i].format, fields[printfields[i].index].format);
-				}
-			}
-		}
-
-	/* if verbose print list of print field names */
-	if (verbose > 0)
-		{
-		for (i=0;i<nprintfields;i++)
-			{
-			if (i == 0)
-				fprintf(stdout, "# ");
-			fprintf(stdout, "%s", printfields[i].name);
-			if (i < nprintfields-1)
-				fprintf(stdout, " | ");
-			else
-				fprintf(stdout, "\n");
-			}
-		}
-
-	/* read the data records in the auv log file */
-	nrecord = 0;
-	while (fread(buffer, recordsize, 1, fp) == 1)
-		{
-		for (i=0;i<nprintfields;i++)
-			{
-			index = printfields[i].index;
-			if (index == INDEX_ZERO)
-				{
-				dvalue = 0.0;
-				if (output_mode == OUTPUT_MODE_BINARY)
-					fwrite(&dvalue, sizeof(double), 1, stdout);
-				else
-					fprintf(stdout, printfields[i].format, dvalue);
-				}
-			else if (index == INDEX_MERGE_LON)
-				{
-				interp_status = mb_linear_interp_longitude(verbose,
-							nav_time_d-1, nav_navlon-1,
-							nav_num, time_d, &dvalue, &jinterp,
-							&error);
-				if (jinterp < 2 || jinterp > nav_num-2)
-					dvalue = 0.0;
-				if (output_mode == OUTPUT_MODE_BINARY)
-					fwrite(&dvalue, sizeof(double), 1, stdout);
-				else
-					fprintf(stdout, printfields[i].format, dvalue);
-				}
-			else if (index == INDEX_MERGE_LAT)
-				{
-				interp_status = mb_linear_interp_latitude(verbose,
-							nav_time_d-1, nav_navlat-1,
-							nav_num, time_d, &dvalue, &jinterp,
-							&error);
-				if (jinterp < 2 || jinterp > nav_num-2)
-					dvalue = 0.0;
-				if (output_mode == OUTPUT_MODE_BINARY)
-					fwrite(&dvalue, sizeof(double), 1, stdout);
-				else
-					fprintf(stdout, printfields[i].format, dvalue);
-				}
-			else if (index == INDEX_MERGE_HEADING)
-				{
-				interp_status = mb_linear_interp_heading(verbose,
-							nav_time_d-1, nav_heading-1,
-							nav_num, time_d, &dvalue, &jinterp,
-							&error);
-				if (jinterp < 2 || jinterp > nav_num-2)
-					dvalue = 0.0;
-				if (output_mode == OUTPUT_MODE_BINARY)
-					fwrite(&dvalue, sizeof(double), 1, stdout);
-				else
-					fprintf(stdout, printfields[i].format, dvalue);
-				}
-			else if (index == INDEX_MERGE_SPEED)
-				{
-				interp_status = mb_linear_interp(verbose,
-							nav_time_d-1, nav_speed-1,
-							nav_num, time_d, &dvalue, &jinterp,
-							&error);
-				if (jinterp < 2 || jinterp > nav_num-2)
-					dvalue = 0.0;
-				if (output_mode == OUTPUT_MODE_BINARY)
-					fwrite(&dvalue, sizeof(double), 1, stdout);
-				else
-					fprintf(stdout, printfields[i].format, dvalue);
-				}
-			else if (index == INDEX_MERGE_SENSORDEPTH)
-				{
-				interp_status = mb_linear_interp(verbose,
-							nav_time_d-1, nav_sensordepth-1,
-							nav_num, time_d, &dvalue, &jinterp,
-							&error);
-				if (jinterp < 2 || jinterp > nav_num-2)
-					dvalue = 0.0;
-				if (output_mode == OUTPUT_MODE_BINARY)
-					fwrite(&dvalue, sizeof(double), 1, stdout);
-				else
-					fprintf(stdout, printfields[i].format, dvalue);
-				}
-			else if (index == INDEX_MERGE_ROLL)
-				{
-				interp_status = mb_linear_interp(verbose,
-							nav_time_d-1, nav_roll-1,
-							nav_num, time_d, &dvalue, &jinterp,
-							&error);
-				if (jinterp < 2 || jinterp > nav_num-2)
-					dvalue = 0.0;
-				if (output_mode == OUTPUT_MODE_BINARY)
-					fwrite(&dvalue, sizeof(double), 1, stdout);
-				else
-					fprintf(stdout, printfields[i].format, dvalue);
-				}
-			else if (index == INDEX_MERGE_PITCH)
-				{
-				interp_status = mb_linear_interp(verbose,
-							nav_time_d-1, nav_pitch-1,
-							nav_num, time_d, &dvalue, &jinterp,
-							&error);
-				if (jinterp < 2 || jinterp > nav_num-2)
-					dvalue = 0.0;
-				if (output_mode == OUTPUT_MODE_BINARY)
-					fwrite(&dvalue, sizeof(double), 1, stdout);
-				else
-					fprintf(stdout, printfields[i].format, dvalue);
-				}
-			else if (index == INDEX_MERGE_HEAVE)
-				{
-				interp_status = mb_linear_interp(verbose,
-							nav_time_d-1, nav_heave-1,
-							nav_num, time_d, &dvalue, &jinterp,
-							&error);
-				if (jinterp < 2 || jinterp > nav_num-2)
-					dvalue = 0.0;
-				if (output_mode == OUTPUT_MODE_BINARY)
-					fwrite(&dvalue, sizeof(double), 1, stdout);
-				else
-					fprintf(stdout, printfields[i].format, dvalue);
-				}
-			else if (fields[index].type == TYPE_DOUBLE)
-				{
-				mb_get_binary_double(MB_YES, &buffer[fields[index].index], &dvalue);
-				dvalue *= fields[index].scale;
-				if ((strcmp(fields[nfields].name, "mHeadK") == 0
-					|| strcmp(fields[nfields].name, "mYawK") == 0)
-					&& angles_in_degrees == MB_YES
-					&& dvalue < 0.0)
-					dvalue += 360.0;
-				if (output_mode == OUTPUT_MODE_BINARY)
-					fwrite(&dvalue, sizeof(double), 1, stdout);
-				else
-					fprintf(stdout, printfields[i].format, dvalue);
-				}
-			else if (fields[index].type == TYPE_INTEGER)
-				{
-				mb_get_binary_int(MB_YES, &buffer[fields[index].index], &ivalue);
-				if (output_mode == OUTPUT_MODE_BINARY)
-					fwrite(&ivalue, sizeof(int), 1, stdout);
-				else
-					fprintf(stdout, printfields[i].format, ivalue);
-				}
-			else if (fields[index].type == TYPE_TIMETAG)
-				{
-				mb_get_binary_double(MB_YES, &buffer[fields[index].index], &dvalue);
-				time_d = dvalue;
-				if (strcmp(printfields[i].format, "time_i") == 0)
-					{
-					mb_get_date(verbose,time_d,time_i);
-					if (output_mode == OUTPUT_MODE_BINARY)
-						{
-						fwrite(time_i, sizeof(int), 7, stdout);
-						}
-					else
-						{
-						fprintf(stdout,"%4.4d %2.2d %2.2d %2.2d %2.2d %2.2d.%6.6d",
-							time_i[0],time_i[1],time_i[2],time_i[3],time_i[4],time_i[5],time_i[6]);
-						}
-					}
-				else if (strcmp(printfields[i].format, "time_j") == 0)
-					{
-					mb_get_date(verbose,time_d,time_i);
-					mb_get_jtime(verbose,time_i,time_j);
-					if (output_mode == OUTPUT_MODE_BINARY)
-						{
-						fwrite(&time_i[0], sizeof(int), 1, stdout);
-						fwrite(&time_j[1], sizeof(int), 1, stdout);
-						fwrite(&time_i[3], sizeof(int), 1, stdout);
-						fwrite(&time_i[4], sizeof(int), 1, stdout);
-						fwrite(&time_i[5], sizeof(int), 1, stdout);
-						fwrite(&time_i[6], sizeof(int), 1, stdout);
-						}
-					else
-						{
-						fprintf(stdout,"%4.4d %3.3d %2.2d %2.2d %2.2d.%6.6d",
-							time_i[0],time_j[1],time_i[3],time_i[4],time_i[5],time_i[6]);
-						}
-					}
-				else
-					{
-					if (output_mode == OUTPUT_MODE_BINARY)
-						fwrite(&dvalue, sizeof(double), 1, stdout);
-					else
-						fprintf(stdout, printfields[i].format, time_d);
-					}
-				}
-			else if (fields[index].type == TYPE_ANGLE)
-				{
-				mb_get_binary_double(MB_YES, &buffer[fields[index].index], &dvalue);
-				dvalue *= fields[index].scale;
-				if (strcmp(fields[index].name, "mYawCB") == 0
-					&& angles_in_degrees == MB_YES
-					&& dvalue < 0.0)
-					dvalue += 360.0;
-				if (output_mode == OUTPUT_MODE_BINARY)
-					fwrite(&dvalue, sizeof(double), 1, stdout);
-				else
-					fprintf(stdout, printfields[i].format, dvalue);
-				}
-			if (output_mode == OUTPUT_MODE_TAB)
-				{
-				if (i < nprintfields - 1)
-					fprintf(stdout, "\t");
-				else
-					fprintf(stdout, "\n");
-				}
-			else if (output_mode == OUTPUT_MODE_CSV)
-				{
-				if (i < nprintfields - 1)
-					fprintf(stdout, ",");
-				else
-					fprintf(stdout, "\n");
-				}
-			}
-		nrecord++;
-		}
-	fclose(fp);
-
-	/* deallocate arrays for navigation */
-	if (nav_alloc > 0)
-		{
-		mb_freed(verbose,__FILE__,__LINE__,(void **)&nav_time_d,&error);
-		mb_freed(verbose,__FILE__,__LINE__,(void **)&nav_navlon,&error);
-		mb_freed(verbose,__FILE__,__LINE__,(void **)&nav_navlat,&error);
-		mb_freed(verbose,__FILE__,__LINE__,(void **)&nav_heading,&error);
-		mb_freed(verbose,__FILE__,__LINE__,(void **)&nav_speed,&error);
-		mb_freed(verbose,__FILE__,__LINE__,(void **)&nav_sensordepth,&error);
-		mb_freed(verbose,__FILE__,__LINE__,(void **)&nav_roll,&error);
-		mb_freed(verbose,__FILE__,__LINE__,(void **)&nav_pitch,&error);
-		mb_freed(verbose,__FILE__,__LINE__,(void **)&nav_heave,&error);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  Program <%s> completed\n",
-			program_name);
-		fprintf(stderr,"dbg2  Ending status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* end it all */
-	exit(error);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/utilities/mbauvnavusbl.c b/src/utilities/mbauvnavusbl.c
deleted file mode 100644
index 2689ae6..0000000
--- a/src/utilities/mbauvnavusbl.c
+++ /dev/null
@@ -1,746 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbauvnavusbl.c	11/21/2004
- *
- *    $Id: mbauvnavusbl.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 2004-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * MBauvnavusbl reads a primary navigation file (usually from a submerged platform
- * swath survey) and also reads secondary navigation (e.g. USBL fixes).
- * The program calculates position offsets between the raw survey navigation
- * and the secondary navigation every 3600 seconds (10 minutes), and then
- * linearly interpolates and applies this adjustment vector for each
- * primary navigation position. The adjusted navigation is output.
- *
- * Author:	D. W. Caress
- * Date:	November 21, 2004
- *
- * $Log: mbauvnavusbl.c,v $
- * Revision 5.3  2008/09/11 20:20:14  caress
- * Checking in updates made during cruise AT15-36.
- *
- * Revision 5.2  2006/01/18 15:17:00  caress
- * Added stdlib.h include.
- *
- * Revision 5.1  2004/12/18 01:38:52  caress
- * Working towards release 5.0.6.
- *
- * Revision 5.0  2004/12/02 06:41:47  caress
- * New program to help process ROV/AUV navigation data.
- *
- *
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <math.h>
-#include <string.h>
-#include <time.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_define.h"
-#include "mb_aux.h"
-
-/* local defines */
-#define	NCHARMAX	256
-
-static char rcs_id[] = "$Id: mbauvnavusbl.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-
-int main (int argc, char **argv)
-{
-	/* id variables */
-	char program_name[] = "MBauvnavusbl";
-	char help_message[] = "MBauvnavusbl reads a primary navigation file (usually from a submerged platform\n swath survey) and also reads secondary navigation (e.g. USBL fixes).\n The program calculates position offsets between the raw survey navigation\n and the secondary navigation every 3600 seconds (10 minutes), and then\n linearly interpolates and applies this adjustment vector for each\n primary navigation position. The adjusted navigation is output.";
-	char usage_message[] = "mbauvnavusbl -Inavfile -Ooutfile -Uusblfile [-Fnavformat -Llonflip -Musblformat -V -H ]";
-
-	/* parsing variables */
-	extern char *optarg;
-	int	errflg = 0;
-	int	c;
-	int	help = 0;
-	int	flag = 0;
-
-	/* MBIO status variables */
-	int	status = MB_SUCCESS;
-	int	verbose = 0;
-	int	error = MB_ERROR_NO_ERROR;
-	char	*message;
-
-	/* Files and formats */
-	char	ifile[MB_PATH_MAXLINE];
-	char	ofile[MB_PATH_MAXLINE];
-	char	ufile[MB_PATH_MAXLINE];
-	int	navformat = 9;
-	int	usblformat = 165;
-	FILE	*fp;
-
-	/* MBIO default parameters - only use lonflip */
-	int	format;
-	int	pings;
-	int	lonflip;
-	double	bounds[4];
-	int	btime_i[7];
-	int	etime_i[7];
-	double	speedmin;
-	double	timegap;
-
-	/* read and write values */
-	int	time_i[7];
-	double	navlon;
-	double	navlat;
-	double	heading;
-	double	sonardepth;
-
-	/* navigation handling variables */
-	int	useaverage = MB_NO;
-	double	tieinterval = 600.0;
-	int	nnav;
-	double	*ntime = NULL;
-	double	*nlon = NULL;
-	double	*nlat = NULL;
-	double	*nheading = NULL;
-	double	*nspeed = NULL;
-	double	*nsonardepth = NULL;
-	double	*nroll = NULL;
-	double	*npitch = NULL;
-	double	*nheave = NULL;
-	int	nusbl;
-	double	*utime = NULL;
-	double	*ulon = NULL;
-	double	*ulat = NULL;
-	double	*uheading = NULL;
-	double	*usonardepth = NULL;
-	double	*alon = NULL;
-	double	*alat = NULL;
-	double	*aheading = NULL;
-	double	*asonardepth = NULL;
-	int	ntie;
-	double	*ttime = NULL;
-	double	*tlon = NULL;
-	double	*tlat = NULL;
-	double	*theading = NULL;
-	double	*tsonardepth = NULL;
-	double	loncoravg;
-	double	latcoravg;
-
-	int	nav_ok;
-	int	nstime_i[7], nftime_i[7];
-	int	ustime_i[7], uftime_i[7];
-
-	char	buffer[NCHARMAX], *result;
-	int	nget;
-	int	year;
-	int	jday;
-	double	timetag;
-	double	easting, northing;
-	double	rov_altitude, rov_roll, rov_pitch;
-	int	position_flag, heading_flag, altitude_flag, attitude_flag, pressure_flag;
-	double	sec;
-	int	intstat;
-	int	i, j;
-
-	/* get current default values - only interested in lonflip */
-	status = mb_defaults(verbose,&format,&pings,&lonflip,bounds,
-		btime_i,etime_i,&speedmin,&timegap);
-
-	/* set default input and output */
-	strcpy (ifile, "stdin");
-	strcpy (ofile, "stdout");
-	strcpy (ufile, "\0");
-
-	/* process argument list */
-	while ((c = getopt(argc, argv, "VvHhAaF:f:L:l:I:i:O:o:M:m:U:u:")) != -1)
-	  switch (c)
-		{
-		case 'H':
-		case 'h':
-			help++;
-			break;
-		case 'V':
-		case 'v':
-			verbose++;
-			break;
-		case 'A':
-		case 'a':
-			useaverage = MB_YES;
-			flag++;
-			break;
-		case 'F':
-		case 'f':
-			sscanf (optarg,"%d", &navformat);
-			flag++;
-			break;
-		case 'L':
-		case 'l':
-			sscanf (optarg,"%d", &lonflip);
-			flag++;
-			break;
-		case 'I':
-		case 'i':
-			sscanf (optarg,"%s", ifile);
-			flag++;
-			break;
-		case 'O':
-		case 'o':
-			sscanf (optarg,"%s", ofile);
-			flag++;
-			break;
-		case 'M':
-		case 'm':
-			sscanf (optarg,"%d", &usblformat);
-			flag++;
-			break;
-		case 'U':
-		case 'u':
-			sscanf (optarg,"%s", ufile);
-			flag++;
-			break;
-		case '?':
-			errflg++;
-		}
-
-	/* if error flagged then print it and exit */
-	if (errflg)
-		{
-		fprintf(stderr,"usage: %s\n", usage_message);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		error = MB_ERROR_BAD_USAGE;
-		exit(error);
-		}
-
-	/* print starting message */
-	if (verbose == 1 || help)
-		{
-		fprintf(stderr,"\nProgram %s\n",program_name);
-		fprintf(stderr,"Version %s\n",rcs_id);
-		fprintf(stderr,"MB-system Version %s\n",MB_VERSION);
-		}
-
-	/* print starting debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  Program <%s>\n",program_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Control Parameters:\n");
-		fprintf(stderr,"dbg2       verbose:         %d\n",verbose);
-		fprintf(stderr,"dbg2       help:            %d\n",help);
-		fprintf(stderr,"dbg2       lonflip:         %d\n",lonflip);
-		fprintf(stderr,"dbg2       input file:      %s\n",ifile);
-		fprintf(stderr,"dbg2       output file:     %s\n",ofile);
-		fprintf(stderr,"dbg2       usbl file:       %s\n",ufile);
-		fprintf(stderr,"dbg2       nav format:      %d\n",navformat);
-		fprintf(stderr,"dbg2       usbl format:     %d\n",usblformat);
-		fprintf(stderr,"dbg2       useaverage:      %d\n",useaverage);
-		}
-
-	/* if help desired then print it and exit */
-	if (help)
-		{
-		fprintf(stderr,"\n%s\n",help_message);
-		fprintf(stderr,"\nusage: %s\n", usage_message);
-		exit(error);
-		}
-
-	/* count the nav points */
-	nnav = 0;
-	if ((fp = fopen(ifile, "r")) == NULL)
-		{
-		error = MB_ERROR_OPEN_FAIL;
-		fprintf(stderr,"\nUnable to Open Navigation File <%s> for reading\n",ifile);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-	while ((result = fgets(buffer,NCHARMAX,fp)) == buffer)
-		nnav++;
-	fclose(fp);
-
-	/* allocate space for the nav points */
-	status = mb_mallocd(verbose,__FILE__,__LINE__,nnav*sizeof(double),(void **)&ntime,&error);
-	status = mb_mallocd(verbose,__FILE__,__LINE__,nnav*sizeof(double),(void **)&nlon,&error);
-	status = mb_mallocd(verbose,__FILE__,__LINE__,nnav*sizeof(double),(void **)&nlat,&error);
-	status = mb_mallocd(verbose,__FILE__,__LINE__,nnav*sizeof(double),(void **)&nheading,&error);
-	status = mb_mallocd(verbose,__FILE__,__LINE__,nnav*sizeof(double),(void **)&nspeed,&error);
-	status = mb_mallocd(verbose,__FILE__,__LINE__,nnav*sizeof(double),(void **)&nsonardepth,&error);
-	status = mb_mallocd(verbose,__FILE__,__LINE__,nnav*sizeof(double),(void **)&nroll,&error);
-	status = mb_mallocd(verbose,__FILE__,__LINE__,nnav*sizeof(double),(void **)&npitch,&error);
-	status = mb_mallocd(verbose,__FILE__,__LINE__,nnav*sizeof(double),(void **)&nheave,&error);
-	status = mb_mallocd(verbose,__FILE__,__LINE__,nnav*sizeof(double),(void **)&alon,&error);
-	status = mb_mallocd(verbose,__FILE__,__LINE__,nnav*sizeof(double),(void **)&alat,&error);
-	status = mb_mallocd(verbose,__FILE__,__LINE__,nnav*sizeof(double),(void **)&aheading,&error);
-	status = mb_mallocd(verbose,__FILE__,__LINE__,nnav*sizeof(double),(void **)&asonardepth,&error);
-	status = mb_mallocd(verbose,__FILE__,__LINE__,nnav*sizeof(double),(void **)&ttime,&error);
-	status = mb_mallocd(verbose,__FILE__,__LINE__,nnav*sizeof(double),(void **)&tlon,&error);
-	status = mb_mallocd(verbose,__FILE__,__LINE__,nnav*sizeof(double),(void **)&tlat,&error);
-	status = mb_mallocd(verbose,__FILE__,__LINE__,nnav*sizeof(double),(void **)&theading,&error);
-	status = mb_mallocd(verbose,__FILE__,__LINE__,nnav*sizeof(double),(void **)&tsonardepth,&error);
-
-	/* if error initializing memory then quit */
-	if (error != MB_ERROR_NO_ERROR)
-		{
-		mb_error(verbose,error,&message);
-		fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",message);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-
-	/* read in nav points */
-	nnav = 0;
-	if ((fp = fopen(ifile, "r")) == NULL)
-		{
-		status = MB_FAILURE;
-		error = MB_ERROR_OPEN_FAIL;
-		fprintf(stderr,"\nUnable to Open Navigation File <%s> for reading\n",ifile);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-	strncpy(buffer,"\0",sizeof(buffer));
-	while ((result = fgets(buffer,NCHARMAX,fp)) == buffer)
-		{
-		nav_ok = MB_NO;
-
-		nget = sscanf(buffer,"%d %d %d %d %d %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf",
-			&time_i[0],&time_i[1],&time_i[2],
-			&time_i[3],&time_i[4],&sec,
-			&ntime[nnav],
-			&nlon[nnav],&nlat[nnav],
-			&nheading[nnav],&nspeed[nnav],
-			&nsonardepth[nnav],
-			&nroll[nnav],&npitch[nnav],&nheave[nnav]);
-		if (nget >= 12)
-			nav_ok = MB_YES;
-
-		/* make sure longitude is defined according to lonflip */
-		if (nav_ok == MB_YES)
-			{
-			if (lonflip == -1 && nlon[nnav] > 0.0)
-				nlon[nnav] = nlon[nnav] - 360.0;
-			else if (lonflip == 0 && nlon[nnav] < -180.0)
-				nlon[nnav] = nlon[nnav] + 360.0;
-			else if (lonflip == 0 && nlon[nnav] > 180.0)
-				nlon[nnav] = nlon[nnav] - 360.0;
-			else if (lonflip == 1 && nlon[nnav] < 0.0)
-				nlon[nnav] = nlon[nnav] + 360.0;
-			}
-
-		/* output some debug values */
-		if (verbose >= 5 && nav_ok == MB_YES)
-			{
-			fprintf(stderr,"\ndbg5  New navigation point read in program <%s>\n",program_name);
-			fprintf(stderr,"dbg5       nav[%d]: %f %f %f\n",
-				nnav,ntime[nnav],nlon[nnav],nlat[nnav]);
-			}
-		else if (verbose >= 5)
-			{
-			fprintf(stderr,"\ndbg5  Error parsing line in navigation file in program <%s>\n",program_name);
-			fprintf(stderr,"dbg5       line: %s\n",buffer);
-			}
-
-		/* check for reverses or repeats in time */
-		if (nav_ok == MB_YES)
-			{
-			if (nnav == 0)
-				nnav++;
-			else if (ntime[nnav] > ntime[nnav-1])
-				nnav++;
-			else if (nnav > 0 && ntime[nnav] <= ntime[nnav-1]
-				&& verbose >= 5)
-				{
-				fprintf(stderr,"\ndbg5  Navigation time error in program <%s>\n",program_name);
-				fprintf(stderr,"dbg5       nav[%d]: %f %f %f\n",
-					nnav-1,ntime[nnav-1],nlon[nnav-1],
-					nlat[nnav-1]);
-				fprintf(stderr,"dbg5       nav[%d]: %f %f %f\n",
-					nnav,ntime[nnav],nlon[nnav],
-					nlat[nnav]);
-				}
-			}
-		strncpy(buffer,"\0",sizeof(buffer));
-		}
-	fclose(fp);
-
-	/* check for nav */
-	if (nnav < 2)
-		{
-		fprintf(stderr,"\nNo navigation read from file <%s>\n",ifile);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-
-	/* count the usbl points */
-	nusbl = 0;
-	if ((fp = fopen(ufile, "r")) == NULL)
-		{
-		error = MB_ERROR_OPEN_FAIL;
-		fprintf(stderr,"\nUnable to Open USBL Navigation File <%s> for reading\n",ufile);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-	while ((result = fgets(buffer,NCHARMAX,fp)) == buffer)
-		nusbl++;
-	fclose(fp);
-
-	/* allocate space for the nav points */
-	status = mb_mallocd(verbose,__FILE__,__LINE__,nusbl*sizeof(double),(void **)&utime,&error);
-	status = mb_mallocd(verbose,__FILE__,__LINE__,nusbl*sizeof(double),(void **)&ulon,&error);
-	status = mb_mallocd(verbose,__FILE__,__LINE__,nusbl*sizeof(double),(void **)&ulat,&error);
-	status = mb_mallocd(verbose,__FILE__,__LINE__,nusbl*sizeof(double),(void **)&uheading,&error);
-	status = mb_mallocd(verbose,__FILE__,__LINE__,nusbl*sizeof(double),(void **)&usonardepth,&error);
-
-	/* if error initializing memory then quit */
-	if (error != MB_ERROR_NO_ERROR)
-		{
-		mb_error(verbose,error,&message);
-		fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",message);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-
-	/* read in usbl points */
-	nusbl = 0;
-	if ((fp = fopen(ufile, "r")) == NULL)
-		{
-		status = MB_FAILURE;
-		error = MB_ERROR_OPEN_FAIL;
-		fprintf(stderr,"\nUnable to Open USBL Navigation File <%s> for reading\n",ufile);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-	strncpy(buffer,"\0",sizeof(buffer));
-	while ((result = fgets(buffer,NCHARMAX,fp)) == buffer)
-		{
-		nav_ok = MB_NO;
-
-		/* ignore comments */
-		if (buffer[0] == '#')
-			{
-			}
-		else if (strchr(buffer, ',') != NULL)
-			{
-			nget = sscanf(buffer,
-				"%d,%d,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%d,%d,%d,%d,%d",
-				&year,
-				&jday,
-				&timetag,
-				&utime[nusbl],
-				&ulat[nusbl],
-				&ulon[nusbl],
-				&easting,
-				&northing,
-				&usonardepth[nusbl],
-				&uheading[nusbl],
-				&rov_altitude,
-				&rov_pitch,
-				&rov_roll,
-				&position_flag,
-				&pressure_flag,
-				&heading_flag,
-				&altitude_flag,
-				&attitude_flag);
-			}
-		    else
-			{
-			nget = sscanf(buffer,
-				"%d %d %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf,%d,%d,%d,%d,%d",
-				&year,
-				&jday,
-				&timetag,
-				&utime[nusbl],
-				&ulat[nusbl],
-				&ulon[nusbl],
-				&easting,
-				&northing,
-				&usonardepth[nusbl],
-				&uheading[nusbl],
-				&rov_altitude,
-				&rov_pitch,
-				&rov_roll,
-				&position_flag,
-				&pressure_flag,
-				&heading_flag,
-				&altitude_flag,
-				&attitude_flag);
-			}
-		if (nget == 18)
-			nav_ok = MB_YES;
-
-		/* make sure longitude is defined according to lonflip */
-		if (nav_ok == MB_YES)
-			{
-			if (lonflip == -1 && ulon[nusbl] > 0.0)
-				ulon[nusbl] = ulon[nusbl] - 360.0;
-			else if (lonflip == 0 && ulon[nusbl] < -180.0)
-				ulon[nusbl] = ulon[nusbl] + 360.0;
-			else if (lonflip == 0 && ulon[nusbl] > 180.0)
-				ulon[nusbl] = ulon[nusbl] - 360.0;
-			else if (lonflip == 1 && ulon[nusbl] < 0.0)
-				ulon[nusbl] = ulon[nusbl] + 360.0;
-			}
-
-		/* output some debug values */
-		if (verbose >= 5 && nav_ok == MB_YES)
-			{
-			fprintf(stderr,"\ndbg5  New USBL navigation point read in program <%s>\n",program_name);
-			fprintf(stderr,"dbg5       usbl[%d]: %f %f %f\n",
-				nusbl,utime[nusbl],ulon[nusbl],ulat[nusbl]);
-			}
-		else if (verbose >= 5)
-			{
-			fprintf(stderr,"\ndbg5  Error parsing line in navigation file in program <%s>\n",program_name);
-			fprintf(stderr,"dbg5       line: %s\n",buffer);
-			}
-
-		/* check for reverses or repeats in time */
-		if (nav_ok == MB_YES)
-			{
-			if (nusbl == 0)
-				nusbl++;
-			else if (utime[nusbl] > utime[nusbl-1])
-				nusbl++;
-			else if (nusbl > 0 && utime[nusbl] <= utime[nusbl-1]
-				&& verbose >= 5)
-				{
-				fprintf(stderr,"\ndbg5  USBL Navigation time error in program <%s>\n",program_name);
-				fprintf(stderr,"dbg5       usbl[%d]: %f %f %f\n",
-					nusbl-1,utime[nusbl-1],ulon[nusbl-1],
-					ulat[nusbl-1]);
-				fprintf(stderr,"dbg5       nav[%d]: %f %f %f\n",
-					nusbl,utime[nusbl],ulon[nusbl],
-					ulat[nusbl]);
-				}
-			}
-		strncpy(buffer,"\0",sizeof(buffer));
-		}
-	fclose(fp);
-
-	/* check for nav */
-	if (nusbl < 2)
-		{
-		fprintf(stderr,"\nNo USBL navigation read from file <%s>\n",ufile);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-
-	/* get start and finish times of nav */
-	mb_get_date(verbose,ntime[0],nstime_i);
-	mb_get_date(verbose,ntime[nnav-1],nftime_i);
-	mb_get_date(verbose,utime[0],ustime_i);
-	mb_get_date(verbose,utime[nusbl-1],uftime_i);
-
-	/* give the statistics */
-	if (verbose >= 1)
-		{
-		fprintf(stderr,"\n%d navigation records read\n",nnav);
-		fprintf(stderr,"Nav start time: %4.4d %2.2d %2.2d %2.2d:%2.2d:%2.2d.%6.6d\n",
-			nstime_i[0],nstime_i[1],nstime_i[2],nstime_i[3],
-			nstime_i[4],nstime_i[5],nstime_i[6]);
-		fprintf(stderr,"Nav end time:   %4.4d %2.2d %2.2d %2.2d:%2.2d:%2.2d.%6.6d\n",
-			nftime_i[0],nftime_i[1],nftime_i[2],nftime_i[3],
-			nftime_i[4],nftime_i[5],nftime_i[6]);
-		fprintf(stderr,"\n%d USBL navigation records read\n",nusbl);
-		fprintf(stderr,"Nav start time: %4.4d %2.2d %2.2d %2.2d:%2.2d:%2.2d.%6.6d\n",
-			ustime_i[0],ustime_i[1],ustime_i[2],ustime_i[3],
-			ustime_i[4],ustime_i[5],ustime_i[6]);
-		fprintf(stderr,"Nav end time:   %4.4d %2.2d %2.2d %2.2d:%2.2d:%2.2d.%6.6d\n",
-			uftime_i[0],uftime_i[1],uftime_i[2],uftime_i[3],
-			uftime_i[4],uftime_i[5],uftime_i[6]);
-		}
-
-	/* now loop over nav data getting ties every tieinterval fixes */
-	ntie = 0;
-	loncoravg = 0.0;
-	latcoravg = 0.0;
-	for (i=0;i<nnav;i++)
-		{
-		if (ntie == 0
-			|| (ntime[i] - ttime[ntie-1]) > tieinterval)
-			{
-			/* get time */
-			ttime[ntie] = ntime[i];
-
-			/* interpolate navigation from usbl navigation */
-			intstat = mb_linear_interp(verbose,
-					utime-1, ulon-1,
-					nusbl, ttime[ntie], &navlon, &j,
-					&error);
-			intstat = mb_linear_interp(verbose,
-					utime-1, ulat-1,
-					nusbl, ttime[ntie], &navlat, &j,
-					&error);
-			intstat = mb_linear_interp(verbose,
-					utime-1, uheading-1,
-					nusbl, ttime[ntie], &heading, &j,
-					&error);
-			intstat = mb_linear_interp(verbose,
-					utime-1, usonardepth-1,
-					nusbl, ttime[ntie], &sonardepth, &j,
-					&error);
-
-			/* get adjustments */
-			tlon[ntie] = navlon - nlon[i];
-			tlat[ntie] = navlat - nlat[i];
-			theading[ntie] = heading - nheading[i];
-			if (theading[ntie] < -180.0)
-				theading[ntie] += 360.0;
-			if (theading[ntie] > 180.0)
-				theading[ntie] -= 360.0;
-			tsonardepth[ntie] = sonardepth - nsonardepth[i];
-			ntie++;
-
-			/* get averages */
-			loncoravg += tlon[ntie-1];
-			latcoravg += tlat[ntie-1];
-			}
-		}
-
-	/* get averages */
-	if (ntie > 0)
-		{
-		loncoravg /= ntie;
-		latcoravg /= ntie;
-		}
-
-fprintf(stderr,"\nCalculated %d adjustment points:\n",ntie);
-for (i=0;i<ntie;i++)
-fprintf(stderr,"time:%f lon:%f lat:%f heading:%f sonardepth:%f\n",
-ttime[i],tlon[i],tlat[i],theading[i],tsonardepth[i]);
-fprintf(stderr,"Average lon:%f lat:%f\n",loncoravg,latcoravg);
-
-	/* open output file */
-	if ((fp = fopen(ofile, "w")) == NULL)
-		{
-		status = MB_FAILURE;
-		error = MB_ERROR_OPEN_FAIL;
-		fprintf(stderr,"\nUnable to Open Output Navigation File <%s> for writing\n",ofile);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-
-	/* now loop over nav data applying adjustments */
-	for (i=0;i<nnav;i++)
-		{
-		/* interpolate adjustment */
-		if (useaverage == MB_NO)
-			{
-			/* get adjustment by interpolation */
-			intstat = mb_linear_interp(verbose,
-					ttime-1, tlon-1,
-					ntie, ntime[i], &navlon, &j,
-					&error);
-			intstat = mb_linear_interp(verbose,
-					ttime-1, tlat-1,
-					ntie, ntime[i], &navlat, &j,
-					&error);
-
-			/* apply adjustment */
-			nlon[i] += navlon;
-			nlat[i] += navlat;
-			}
-
-		/* else use average adjustments */
-		else
-			{
-			/* apply adjustment */
-			nlon[i] += loncoravg;
-			nlat[i] += latcoravg;
-			}
-
-		/* write out the adjusted navigation */
-		mb_get_date(verbose,ntime[i],time_i);
-		sprintf(buffer,
-			"%4.4d %2.2d %2.2d %2.2d %2.2d %2.2d.%6.6d %16.6f %.6f %.6f %.2f %.2f %.2f %.2f %.2f %.2f\n",
-			time_i[0],
-			time_i[1],
-			time_i[2],
-			time_i[3],
-			time_i[4],
-			time_i[5],
-			time_i[6],
-			ntime[i],
-			nlon[i],
-			nlat[i],
-			nheading[i],
-			nspeed[i],
-			nsonardepth[i],
-			nroll[i],
-			npitch[i],
-			nheave[i]);
-		if (fputs(buffer, fp) == EOF)
-			{
-			error = MB_ERROR_WRITE_FAIL;
-			status = MB_FAILURE;
-			}
-		else
-			{
-			error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-		}
-	fclose(fp);
-
-	/* deallocate memory for data arrays */
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&ntime,&error);
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&nlon,&error);
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&nlat,&error);
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&nheading,&error);
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&nspeed,&error);
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&nsonardepth,&error);
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&nroll,&error);
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&npitch,&error);
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&nheave,&error);
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&alon,&error);
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&alat,&error);
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&aheading,&error);
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&asonardepth,&error);
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&utime,&error);
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&ulon,&error);
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&ulat,&error);
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&uheading,&error);
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&usonardepth,&error);
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&ttime,&error);
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&tlon,&error);
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&tlat,&error);
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&theading,&error);
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&tsonardepth,&error);
-
-	/* check memory */
-	if (verbose >= 4)
-		status = mb_memory_list(verbose,&error);
-
-	/* give the statistics */
-	if (verbose >= 1)
-		{
-		fprintf(stderr,"\n%d input navigation records\n",nnav);
-		fprintf(stderr,"%d input usbl records\n",nusbl);
-		}
-
-	/* end it all */
-	exit(error);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/utilities/mbbackangle.c b/src/utilities/mbbackangle.c
deleted file mode 100644
index f08b378..0000000
--- a/src/utilities/mbbackangle.c
+++ /dev/null
@@ -1,2062 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbbackangle.c	1/6/95
- *    $Id: mbbackangle.c 2238 2015-04-15 06:00:52Z caress $
- *
- *    Copyright (c) 1995-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * MBBACKANGLE reads a swath sonar data file and generates a table
- * of the average amplitude or sidescan values as a function of
- * the grazing angle with the seafloor. If bathymetry is
- * not available,  the seafloor is assumed to be flat. The takeoff
- * angle for each beam or pixel arrival is projected to the seafloor;
- * no raytracing is done.
- * The results are dumped to stdout.
- *
- * Author:	D. W. Caress
- * Date:	January 6, 1995
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <math.h>
-#include <string.h>
-#include <sys/stat.h>
-#include <time.h>
-
-/* MBIO include files */
-#include "mb_status.h"
-#include "mb_define.h"
-#include "mb_format.h"
-#include "mb_process.h"
-#include "mb_aux.h"
-
-/* mode defines */
-#define	MBBACKANGLE_AMP	1
-#define	MBBACKANGLE_SS	2
-#define	MBBACKANGLE_INNERSWATHLIMIT 15.0
-#define	MBBACKANGLE_BEAMPATTERN_EMPIRICAL		0
-#define	MBBACKANGLE_BEAMPATTERN_SIDESCAN		1
-
-/* define grid structure */
-struct mbba_grid_struct
-	{
-	mb_path	file;
-        mb_path projectionname;
-	int	projection_mode;
-	mb_path	projection_id;
-	float	nodatavalue;
-	int	nxy;
-	int	nx;
-	int	ny;
-	double	min;
-	double	max;
-	double	xmin;
-	double	xmax;
-	double	ymin;
-	double	ymax;
-	double	dx;
-	double	dy;
-	float	*data;
-	};
-
-/* function prototypes */
-int output_table(int verbose, FILE *tfp, int ntable, int nping, double time_d,
-	int nangles, double angle_max, double dangle, int symmetry,
-	int *nmean, double *mean, double *sigma,
-	int *error);
-int output_model(int verbose, FILE *tfp,
-	double ssbeamwidth, double ssdepression, double ref_angle,
-	int ntable, int nping, double time_d, double altitude,
-	int nangles, double angle_max, double dangle, int symmetry,
-	int *nmean, double *mean, double *sigma,
-	int *error);
-
-static char rcs_id[] = "$Id: mbbackangle.c 2238 2015-04-15 06:00:52Z caress $";
-char program_name[] = "mbbackangle";
-
-/*--------------------------------------------------------------------*/
-
-int main (int argc, char **argv)
-{
-	char help_message[] =
-"MBbackangle reads a swath sonar data file and generates a set \n\t\
-of tables containing the average amplitude an/or sidescan values\n\t\
-as a function of the angle of interaction (grazing angle) \n\t\
-with the seafloor. Each table represents the symmetrical \n\t\
-average function for a user defined number of pings. The tables \n\t\
-are output to a \".aga\" and \".sga\" files that can be applied \n\t\
-by MBprocess.";
-	char usage_message[] = "mbbackangle -Ifile \
-[-Akind -Bmode[/beamwidth/depression] -Fformat -Ggridmode/angle/min/max/nx/ny \
--Nnangles/angle_max -Ppings -Q -Rrefangle -Ttopogridfile -Zaltitude -V -H]";
-	extern char *optarg;
-	int	errflg = 0;
-	int	c;
-	int	help = 0;
-	int	flag = 0;
-
-	/* MBIO status variables */
-	int	status = MB_SUCCESS;
-	int	verbose = 0;
-	int	error = MB_ERROR_NO_ERROR;
-	char	*message;
-
-	/* MBIO read control parameters */
-	int	read_datalist = MB_NO;
-	char	read_file[MB_PATH_MAXLINE];
-	void	*datalist;
-	int	look_processed = MB_DATALIST_LOOK_UNSET;
-	double	file_weight;
-	int	format;
-	int	pings;
-	int	lonflip;
-	double	bounds[4];
-	int	btime_i[7];
-	int	etime_i[7];
-	double	btime_d;
-	double	etime_d;
-	double	speedmin;
-	double	timegap;
-	char	swathfile[MB_PATH_MAXLINE];
-	char	amptablefile[MB_PATH_MAXLINE];
-	char	sstablefile[MB_PATH_MAXLINE];
-	FILE	*atfp;
-	FILE	*stfp;
-	int	beams_bath;
-	int	beams_amp;
-	int	pixels_ss;
-
-	/* ESF File read */
-	char	esffile[MB_PATH_MAXLINE];
-	struct  mb_esf_struct esf;
-
-	/* MBIO read values */
-	void	*mbio_ptr = NULL;
-	int	kind;
-	int	time_i[7];
-	double	time_d;
-	double	navlon;
-	double	navlat;
-	double	speed;
-	double	heading;
-	double	distance;
-	double	altitude;
-	double	sonardepth;
-	char	*beamflag = NULL;
-	double	*bath = NULL;
-	double	*bathacrosstrack = NULL;
-	double	*bathalongtrack = NULL;
-	double	*amp = NULL;
-	double	*ss = NULL;
-	double	*ssacrosstrack = NULL;
-	double	*ssalongtrack = NULL;
-	char	comment[MB_COMMENT_MAXLINE];
-
-	/* slope calculation variables */
-	int	nsmooth = 5;
-	int	ndepths;
-	double	*depths;
-	double	*depthsmooth;
-	double	*depthacrosstrack;
-	int	nslopes;
-	double	*slopes;
-	double	*slopeacrosstrack;
-
-	/* topography parameters */
-	struct mbba_grid_struct grid;
-
-	/* angle function variables */
-	int	amplitude_on = MB_NO;
-	int	sidescan_on = MB_NO;
-	int	dump = MB_NO;
-	int	symmetry = MB_NO;
-	int	nangles = 81;
-	double	angle_max = 80.0;
-	double	dangle;
-	double	angle_start;
-	int	pings_avg = 50;
-	int	navg = 0;
-	int	ntotavg = 0;
-	int	*nmeanamp = NULL;
-	double	*meanamp = NULL;
-	double	*sigmaamp = NULL;
-	int	*nmeanss = NULL;
-	double	*meanss = NULL;
-	double	*sigmass = NULL;
-	int	*nmeantotamp = NULL;
-	double	*meantotamp = NULL;
-	double	*sigmatotamp = NULL;
-	int	*nmeantotss = NULL;
-	double	*meantotss = NULL;
-	double	*sigmatotss = NULL;
-	double	altitude_default = 0.0;
-	double	time_d_avg;
-	double	altitude_avg;
-	double	time_d_totavg;
-	double	altitude_totavg;
-	int	beammode = MBBACKANGLE_BEAMPATTERN_EMPIRICAL;
-	double	ssbeamwidth = 50.0;
-	double	ssdepression = 20.0;
-	int	corr_slope = MB_NO;
-	int	corr_topogrid = MB_NO;
-	int	corr_symmetry = MBP_SSCORR_ASYMMETRIC; /* BOB */
-	int	amp_corr_type;
-	int	amp_corr_slope = MBP_AMPCORR_IGNORESLOPE;
-	int	ss_corr_slope = MBP_SSCORR_IGNORESLOPE;
-	int	ss_type;
-	int	ss_corr_type;
-	double	ref_angle;
-	double	ref_angle_default = 30.0;
-
-	/* amp vs angle grid variables */
-	int	gridamp = MB_NO;
-	double	gridampangle = 0.0;
-	double	gridampmin = 0.0;
-	double	gridampmax = 0.0;
-	int	gridampnx = 0;
-	int	gridampny = 0;
-	double	gridampdx = 0.0;
-	double	gridampdy = 0.0;
-	float	*gridamphist = NULL;
-	int	gridss = MB_NO;
-	double	gridssangle = 0.0;
-	double	gridssmin = 0.0;
-	double	gridssmax = 0.0;
-	int	gridssnx = 0;
-	int	gridssny = 0;
-	double	gridssdx = 0.0;
-	double	gridssdy = 0.0;
-	float	*gridsshist = NULL;
-	char	gridfile[MB_PATH_MAXLINE];
-	char	*xlabel = "Grazing Angle (degrees)";
-	char	*ylabel = "Amplitude";
-	char	zlabel[MB_PATH_MAXLINE];
-	char	title[MB_PATH_MAXLINE];
-	char	plot_cmd[MB_PATH_MAXLINE];
-	char	*projection = "GenericLinear";
-
-	int	ampkind;
-	int	read_data;
-	double	mtodeglon, mtodeglat;
-	double	headingx, headingy;
-	double	r[3], rr;
-	double	v1[3], v2[3], v[3], vv;
-	double	slope;
-	double	bathy;
-	double	altitude_use;
-	double	angle;
-	double	ampmin;
-	double	ampmax;
-	double	norm;
-	int	nrec, namp, nss, ntable;
-	int	nrectot = 0;
-	int	namptot = 0;
-	int	nsstot = 0;
-	int	ntabletot = 0;
-	int	mode;
-	int	plot_status;
-
-	/* time, user, host variables */
-	time_t	right_now;
-	char	date[32], user[MB_PATH_MAXLINE], *user_ptr, host[MB_PATH_MAXLINE];
-
-	double	d1, d2;
-	int	i, j;
-	int	ix, jy, kgrid, k, n;
-	int	kgrid00, kgrid10,kgrid01,kgrid11;
-
-	char	*ctime();
-	char	*getenv();
-
-	/* get current default values */
-	status = mb_defaults(verbose,&format,&pings,&lonflip,bounds,
-		btime_i,etime_i,&speedmin,&timegap);
-
-	/* reset pings and timegap */
-	pings = 1;
-	timegap = 10000000.0;
-
-	/* set default input to stdin */
-	strcpy (read_file, "datalist.mb-1");
-
-	/* initialize grid */
-	memset(&grid, 0, sizeof (struct mbba_grid_struct));
-
-	/* process argument list */
-	while ((c = getopt(argc, argv, "A:a:B:b:CcDdF:f:G:g:HhI:i:N:n:P:p:QqR:r:T:t:VvZ:z:")) != -1)
-	  switch (c)
-		{
-		case 'A':
-		case 'a':
-			sscanf (optarg,"%d", &ampkind);
-			if (ampkind == MBBACKANGLE_SS)
-				sidescan_on = MB_YES;
-			if (ampkind == MBBACKANGLE_AMP)
-				amplitude_on = MB_YES;
-			flag++;
-			break;
-		case 'B':
-		case 'b':
-			n = sscanf (optarg,"%d/%lf/%lf", &beammode, &d1, &d2);
-			if (beammode == MBBACKANGLE_BEAMPATTERN_SIDESCAN)
-				{
-				if (n >= 2)
-					ssbeamwidth = d1;
-				if (n >= 3)
-					ssdepression = d2;
-				}
-			flag++;
-			break;
-		case 'C':
-		case 'c':
-			symmetry = MB_YES;
-			corr_symmetry = MBP_SSCORR_SYMMETRIC;
-			flag++;
-			break;
-		case 'D':
-		case 'd':
-			dump = MB_YES;
-			flag++;
-			break;
-		case 'F':
-		case 'f':
-			sscanf (optarg,"%d", &format);
-			flag++;
-			break;
-		case 'G':
-		case 'g':
-			n = sscanf (optarg,"%d/%lf/%lf/%lf/%d/%d", &mode,&angle, &ampmin, &ampmax, &i, &j);
-			if (n == 5)
-				{
-				n = sscanf (optarg,"%d/%lf/%lf/%d/%d", &mode,&angle, &ampmax, &i, &j);
-				ampmin = 0.0;
-				n = 6;
-				}
-			if (mode == MBBACKANGLE_AMP && n == 6)
-				{
-				gridamp = MB_YES;
-				gridampangle = angle;
-				gridampmin = ampmin;
-				gridampmax = ampmax;
-				gridampnx = i;
-				gridampny = j;
-				gridampdx = 2.0 * gridampangle / (gridampnx - 1);
-				gridampdy = (gridampmax - gridampmin) / (gridampny - 1);
-				}
-			else if (mode == MBBACKANGLE_SS && n == 6)
-				{
-				gridss = MB_YES;
-				gridssangle = angle;
-				gridssmin = ampmin;
-				gridssmax = ampmax;
-				gridssnx = i;
-				gridssny = j;
-				gridssdx = 2.0 * gridssangle / (gridssnx - 1);
-				gridssdy = (gridssmax - gridssmin) / (gridssny - 1);
-				}
-			flag++;
-			break;
-		case 'H':
-		case 'h':
-			help++;
-			break;
-		case 'I':
-		case 'i':
-			sscanf (optarg,"%s", read_file);
-			flag++;
-			break;
-		case 'N':
-		case 'n':
-			sscanf (optarg,"%d/%lf", &nangles, &angle_max);
-			flag++;
-			break;
-		case 'P':
-		case 'p':
-			sscanf (optarg,"%d", &pings_avg);
-			flag++;
-			break;
-		case 'Q':
-		case 'q':
-			corr_slope = MB_YES;
-			flag++;
-			break;
-		case 'R':
-		case 'r':
-			sscanf (optarg,"%lf", &ref_angle_default);
-			flag++;
-			break;
-		case 'T':
-		case 't':
-			sscanf (optarg,"%s", grid.file);
-			corr_topogrid = MB_YES;
-			flag++;
-			break;
-		case 'V':
-		case 'v':
-			verbose++;
-			break;
-		case 'Z':
-		case 'z':
-			sscanf (optarg,"%lf", &altitude_default);
-			flag++;
-			break;
-		case '?':
-			errflg++;
-		}
-
-	/* if error flagged then print it and exit */
-	if (errflg)
-		{
-		fprintf(stderr,"usage: %s\n", usage_message);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		error = MB_ERROR_BAD_USAGE;
-		exit(error);
-		}
-
-	/* print starting message */
-	if (verbose == 1 || help)
-		{
-		fprintf(stderr,"\nProgram %s\n",program_name);
-		fprintf(stderr,"Version %s\n",rcs_id);
-		fprintf(stderr,"MB-system Version %s\n",MB_VERSION);
-		}
-
-	/* set mode if necessary */
-	if (amplitude_on != MB_YES
-		&& sidescan_on != MB_YES)
-		{
-		amplitude_on = MB_YES;
-		sidescan_on = MB_YES;
-		}
-	if (corr_slope == MB_NO && corr_topogrid == MB_NO)
-		{
-		amp_corr_slope = MBP_AMPCORR_IGNORESLOPE;
-		ss_corr_slope = MBP_SSCORR_IGNORESLOPE;
-		}
-	else if (corr_slope == MB_YES && corr_topogrid == MB_NO)
-		{
-		amp_corr_slope = MBP_AMPCORR_USESLOPE;
-		ss_corr_slope = MBP_SSCORR_USESLOPE;
-		}
-	else if (corr_slope == MB_NO && corr_topogrid == MB_YES)
-		{
-		amp_corr_slope = MBP_AMPCORR_USETOPO;
-		ss_corr_slope = MBP_SSCORR_USETOPO;
-		}
-	else if (corr_slope == MB_YES && corr_topogrid == MB_YES)
-		{
-		amp_corr_slope = MBP_AMPCORR_USETOPOSLOPE;
-		ss_corr_slope = MBP_SSCORR_USETOPOSLOPE;
-		}
-
-	/* print starting debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  Program <%s>\n",program_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Control Parameters:\n");
-		fprintf(stderr,"dbg2       verbose:      %d\n",verbose);
-		fprintf(stderr,"dbg2       help:         %d\n",help);
-		fprintf(stderr,"dbg2       format:       %d\n",format);
-		fprintf(stderr,"dbg2       pings:        %d\n",pings);
-		fprintf(stderr,"dbg2       lonflip:      %d\n",lonflip);
-		fprintf(stderr,"dbg2       bounds[0]:    %f\n",bounds[0]);
-		fprintf(stderr,"dbg2       bounds[1]:    %f\n",bounds[1]);
-		fprintf(stderr,"dbg2       bounds[2]:    %f\n",bounds[2]);
-		fprintf(stderr,"dbg2       bounds[3]:    %f\n",bounds[3]);
-		fprintf(stderr,"dbg2       btime_i[0]:   %d\n",btime_i[0]);
-		fprintf(stderr,"dbg2       btime_i[1]:   %d\n",btime_i[1]);
-		fprintf(stderr,"dbg2       btime_i[2]:   %d\n",btime_i[2]);
-		fprintf(stderr,"dbg2       btime_i[3]:   %d\n",btime_i[3]);
-		fprintf(stderr,"dbg2       btime_i[4]:   %d\n",btime_i[4]);
-		fprintf(stderr,"dbg2       btime_i[5]:   %d\n",btime_i[5]);
-		fprintf(stderr,"dbg2       btime_i[6]:   %d\n",btime_i[6]);
-		fprintf(stderr,"dbg2       etime_i[0]:   %d\n",etime_i[0]);
-		fprintf(stderr,"dbg2       etime_i[1]:   %d\n",etime_i[1]);
-		fprintf(stderr,"dbg2       etime_i[2]:   %d\n",etime_i[2]);
-		fprintf(stderr,"dbg2       etime_i[3]:   %d\n",etime_i[3]);
-		fprintf(stderr,"dbg2       etime_i[4]:   %d\n",etime_i[4]);
-		fprintf(stderr,"dbg2       etime_i[5]:   %d\n",etime_i[5]);
-		fprintf(stderr,"dbg2       etime_i[6]:   %d\n",etime_i[6]);
-		fprintf(stderr,"dbg2       speedmin:     %f\n",speedmin);
-		fprintf(stderr,"dbg2       timegap:      %f\n",timegap);
-		fprintf(stderr,"dbg2       read_file:    %s\n",read_file);
-		fprintf(stderr,"dbg2       dump:         %d\n",dump);
-		fprintf(stderr,"dbg2       symmetry:     %d\n",symmetry);
-		fprintf(stderr,"dbg2       amplitude_on: %d\n",amplitude_on);
-		fprintf(stderr,"dbg2       sidescan_on:  %d\n",sidescan_on);
-		fprintf(stderr,"dbg2       corr_slope:   %d\n",corr_slope);
-		fprintf(stderr,"dbg2       corr_topogrid:%d\n",corr_topogrid);
-		fprintf(stderr,"dbg2       grid.file:    %s\n",grid.file);
-		fprintf(stderr,"dbg2       nangles:      %d\n",nangles);
-		fprintf(stderr,"dbg2       angle_max:    %f\n",angle_max);
-		fprintf(stderr,"dbg2       ref_angle:    %f\n",ref_angle_default);
-		fprintf(stderr,"dbg2       beammode:     %d\n",beammode);
-		fprintf(stderr,"dbg2       ssbeamwidth:  %f\n",ssbeamwidth);
-		fprintf(stderr,"dbg2       ssdepression: %f\n",ssdepression);
-		fprintf(stderr,"dbg2       ref_angle:    %f\n",ref_angle_default);
-		fprintf(stderr,"dbg2       pings_avg:    %d\n",pings_avg);
-		fprintf(stderr,"dbg2       angle_max:    %f\n",angle_max);
-		fprintf(stderr,"dbg2       altitude:     %f\n",altitude_default);
-		fprintf(stderr,"dbg2       gridamp:      %d\n",gridamp);
-		fprintf(stderr,"dbg2       gridampangle: %f\n",gridampangle);
-		fprintf(stderr,"dbg2       gridampmin:   %f\n",gridampmin);
-		fprintf(stderr,"dbg2       gridampmax:   %f\n",gridampmax);
-		fprintf(stderr,"dbg2       gridampnx:    %d\n",gridampnx);
-		fprintf(stderr,"dbg2       gridampny:    %d\n",gridampny);
-		fprintf(stderr,"dbg2       gridampdx:    %f\n",gridampdx);
-		fprintf(stderr,"dbg2       gridampdy:    %f\n",gridampdy);
-		fprintf(stderr,"dbg2       gridss:       %d\n",gridss);
-		fprintf(stderr,"dbg2       gridssangle:  %f\n",gridssangle);
-		fprintf(stderr,"dbg2       gridssmin:    %f\n",gridssmin);
-		fprintf(stderr,"dbg2       gridssmax:    %f\n",gridssmax);
-		fprintf(stderr,"dbg2       gridssnx:     %d\n",gridssnx);
-		fprintf(stderr,"dbg2       gridssny:     %d\n",gridssny);
-		fprintf(stderr,"dbg2       gridssdx:     %f\n",gridssdx);
-		fprintf(stderr,"dbg2       gridssdy:     %f\n",gridssdy);
-		}
-
-	/* if help desired then print it and exit */
-	if (help)
-		{
-		fprintf(stderr,"\n%s\n",help_message);
-		fprintf(stderr,"\nusage: %s\n", usage_message);
-		exit(error);
-		}
-
-	/* allocate memory for angle arrays */
-	if (amplitude_on == MB_YES)
-		{
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_mallocd(verbose,__FILE__,__LINE__,nangles*sizeof(int),
-				(void **)&nmeanamp,&error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_mallocd(verbose,__FILE__,__LINE__,nangles*sizeof(double),
-				(void **)&meanamp,&error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_mallocd(verbose,__FILE__,__LINE__,nangles*sizeof(double),
-				(void **)&sigmaamp,&error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_mallocd(verbose,__FILE__,__LINE__,nangles*sizeof(int),
-				(void **)&nmeantotamp,&error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_mallocd(verbose,__FILE__,__LINE__,nangles*sizeof(double),
-				(void **)&meantotamp,&error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_mallocd(verbose,__FILE__,__LINE__,nangles*sizeof(double),
-				(void **)&sigmatotamp,&error);
-		}
-	if (sidescan_on == MB_YES)
-		{
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_mallocd(verbose,__FILE__,__LINE__,nangles*sizeof(int),
-				(void **)&nmeanss,&error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_mallocd(verbose,__FILE__,__LINE__,nangles*sizeof(double),
-				(void **)&meanss,&error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_mallocd(verbose,__FILE__,__LINE__,nangles*sizeof(double),
-				(void **)&sigmass,&error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_mallocd(verbose,__FILE__,__LINE__,nangles*sizeof(int),
-				(void **)&nmeantotss,&error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_mallocd(verbose,__FILE__,__LINE__,nangles*sizeof(double),
-				(void **)&meantotss,&error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_mallocd(verbose,__FILE__,__LINE__,nangles*sizeof(double),
-				(void **)&sigmatotss,&error);
-		}
-
-	/* if error initializing memory then quit */
-	if (error != MB_ERROR_NO_ERROR)
-		{
-		mb_error(verbose,error,&message);
-		fprintf(stderr,"\nMBIO Error allocating angle arrays:\n%s\n",message);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-
-	/* check grid modes */
-	if (gridamp == MB_YES && amplitude_on == MB_NO)
-		gridamp = MB_NO;
-	if (gridss == MB_YES && sidescan_on == MB_NO)
-		gridss = MB_NO;
-
-	/* output some information */
-	if (verbose > 0)
-		{
-		fprintf(stderr, "\nPings to average:    %d\n", pings_avg);
-		fprintf(stderr, "Number of angle bins: %d\n", nangles);
-		fprintf(stderr, "Maximum angle:         %f\n", angle_max);
-		fprintf(stderr, "Default altitude:      %f\n", altitude_default);
-		if (amplitude_on == MB_YES)
-			fprintf(stderr, "Working on beam amplitude data...\n");
-		if (sidescan_on == MB_YES)
-			fprintf(stderr, "Working on sidescan data...\n");
-		if (beammode == MBBACKANGLE_BEAMPATTERN_EMPIRICAL)
-			fprintf(stderr, "Generating empirical correction tables...\n");
-		else if (beammode == MBBACKANGLE_BEAMPATTERN_SIDESCAN)
-			fprintf(stderr, "Generating sidescan model correction tables...\n");
-		if (corr_slope == MB_YES)
-			fprintf(stderr, "Using seafloor slope in calculating correction tables...\n");
-		else
-			fprintf(stderr, "Using flat bottom assumption in calculating correction tables...\n");
-		if (gridamp == MB_YES)
-			fprintf(stderr, "Outputting gridded histograms of beam amplitude vs grazing angle...\n");
-		if (gridss == MB_YES)
-			fprintf(stderr, "Outputting gridded histograms of sidescan amplitude vs grazing angle...\n");
-		}
-
-	/* get size of bins */
-	dangle = 2 * angle_max / (nangles-1);
-	angle_start = -angle_max - 0.5*dangle;
-
-	/* initialize histogram */
-	if (amplitude_on == MB_YES)
-	for (i=0;i<nangles;i++)
-		{
-		nmeanamp[i] = 0;
-		meanamp[i] = 0.0;
-		sigmaamp[i] = 0.0;
-		nmeantotamp[i] = 0;
-		meantotamp[i] = 0.0;
-		sigmatotamp[i] = 0.0;
-		}
-	if (sidescan_on == MB_YES)
-	for (i=0;i<nangles;i++)
-		{
-		nmeanss[i] = 0;
-		meanss[i] = 0.0;
-		sigmass[i] = 0.0;
-		nmeantotss[i] = 0;
-		meantotss[i] = 0.0;
-		sigmatotss[i] = 0.0;
-		}
-
-	/* get topography grid if specified */
-	if (corr_topogrid == MB_YES)
-		{
-		grid.data = NULL;
-		status = mb_read_gmt_grd(verbose, grid.file, &grid.projection_mode, grid.projection_id, &grid.nodatavalue,
-					&grid.nxy, &grid.nx, &grid.ny, &grid.min, &grid.max,
-					&grid.xmin, &grid.xmax, &grid.ymin, &grid.ymax,
-					&grid.dx, &grid.dy, &grid.data, NULL, NULL, &error);
-		if (status == MB_FAILURE)
-			{
-			error = MB_ERROR_OPEN_FAIL;
-			fprintf(stderr,"\nUnable to read grd file: %s\n",
-			    grid.file);
-			fprintf(stderr,"\nProgram <%s> Terminated\n",
-			    program_name);
-			exit(error);
-			}
-
-		/* rationalize grid bounds and lonflip */
-		if (lonflip == -1)
-			{
-			if (grid.xmax > 180.0)
-				{
-				grid.xmin -= 360.0;
-				grid.xmax -= 360.0;
-				}
-			}
-		else if (lonflip == 0)
-			{
-			if (grid.xmin > 180.0)
-				{
-				grid.xmin -= 360.0;
-				grid.xmax -= 360.0;
-				}
-			else if (grid.xmax < -180.0)
-				{
-				grid.xmin += 360.0;
-				grid.xmax += 360.0;
-				}
-			}
-		else if (lonflip == 1)
-			{
-			if (grid.xmin < -180.0)
-				{
-				grid.xmin += 360.0;
-				grid.xmax += 360.0;
-				}
-			}
-		if (grid.xmax > 180.0)
-			{
-			lonflip = 1;
-			}
-		else if (grid.xmin < -180.0)
-			{
-			lonflip = -1;
-			}
-		else
-			{
-			lonflip = 0;
-			}
-		}
-
-	/* initialize counting variables */
-	ntotavg = 0;
-	time_d_totavg = 0.0;
-	altitude_totavg = 0.0;
-
-	/* initialize grids */
-	if (gridamp == MB_YES)
-		{
-		/* allocate memory for output grids */
-		status = mb_mallocd(verbose,__FILE__,__LINE__,
-					gridampnx * gridampny * sizeof(float),
-					(void **)&gridamphist, &error);
-
-		/* if error initializing memory then quit */
-		if (error != MB_ERROR_NO_ERROR)
-			{
-			mb_error(verbose,error,&message);
-			fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",
-				message);
-			fprintf(stderr,"\nProgram <%s> Terminated\n",
-				program_name);
-			mb_memory_clear(verbose, &error);
-			exit(error);
-			}
-		}
-	if (gridss == MB_YES)
-		{
-		/* allocate memory for output grids */
-		status = mb_mallocd(verbose,__FILE__,__LINE__,
-					gridssnx * gridssny * sizeof(float),
-					(void **)&gridsshist, &error);
-
-		/* if error initializing memory then quit */
-		if (error != MB_ERROR_NO_ERROR)
-			{
-			mb_error(verbose,error,&message);
-			fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",
-				message);
-			fprintf(stderr,"\nProgram <%s> Terminated\n",
-				program_name);
-			mb_memory_clear(verbose, &error);
-			exit(error);
-			}
-		}
-
-	/* get format if required */
-	if (format == 0)
-		mb_get_format(verbose,read_file,NULL,&format,&error);
-
-	/* determine whether to read one file or a list of files */
-	if (format < 0)
-		read_datalist = MB_YES;
-
-	/* open file list */
-	if (read_datalist == MB_YES)
-	    {
-	    if ((status = mb_datalist_open(verbose,&datalist,
-					    read_file,look_processed,&error)) != MB_SUCCESS)
-		{
-		error = MB_ERROR_OPEN_FAIL;
-		fprintf(stderr,"\nUnable to open data list file: %s\n",
-			read_file);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-	    if ((status = mb_datalist_read(verbose,datalist,
-			    swathfile,&format,&file_weight,&error))
-			    == MB_SUCCESS)
-		read_data = MB_YES;
-	    else
-		read_data = MB_NO;
-	    }
-	/* else copy single filename to be read */
-	else
-	    {
-	    strcpy(swathfile, read_file);
-	    read_data = MB_YES;
-	    }
-
-	/* Deal with ESF File if avialable */
-	if (status == MB_SUCCESS)
-	{
-		status = mb_esf_load(verbose, swathfile, MB_YES, MB_NO, esffile, &esf, &error);
-
-	}
-
-	/* loop over all files to be read */
-	while (read_data == MB_YES)
-	{
-
-	/* obtain format array location - format id will
-		be aliased to current id if old format id given */
-	status = mb_format(verbose,&format,&error);
-
-	/* initialize reading the swath sonar file */
-	if ((status = mb_read_init(
-		verbose,swathfile,format,1,lonflip,bounds,
-		btime_i,etime_i,speedmin,timegap,
-		&mbio_ptr,&btime_d,&etime_d,
-		&beams_bath,&beams_amp,&pixels_ss,&error)) != MB_SUCCESS)
-		{
-		mb_error(verbose,error,&message);
-		fprintf(stderr,"\nMBIO Error returned from function <mb_read_init>:\n%s\n",message);
-		fprintf(stderr,"\nMultibeam File <%s> not initialized for reading\n",swathfile);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-
-	/* set correction modes according to format */
-	if (format == MBF_SB2100RW
-	    || format == MBF_SB2100B1
-	    || format == MBF_SB2100B2
-	    || format == MBF_EDGJSTAR
-	    || format == MBF_EDGJSTR2
-	    || format == MBF_RESON7KR)
-	    ss_corr_type = MBP_SSCORR_DIVISION;
-	else if (format == MBF_MBLDEOIH)
-	    ss_corr_type = MBP_SSCORR_UNKNOWN;
-	else
-	    ss_corr_type = MBP_SSCORR_SUBTRACTION;
-	amp_corr_type = MBP_AMPCORR_SUBTRACTION;
-	ref_angle = ref_angle_default;
-
-	/* allocate memory for data arrays */
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_mallocd(verbose,__FILE__,__LINE__,beams_bath*sizeof(char),
-					(void **)&beamflag,&error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_mallocd(verbose,__FILE__,__LINE__,beams_bath*sizeof(double),
-					(void **)&bath,&error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_mallocd(verbose,__FILE__,__LINE__,beams_amp*sizeof(double),
-					(void **)&amp,&error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_mallocd(verbose,__FILE__,__LINE__,beams_bath*sizeof(double),
-					(void **)&bathacrosstrack,&error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_mallocd(verbose,__FILE__,__LINE__,beams_bath*sizeof(double),
-					(void **)&bathalongtrack,&error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_mallocd(verbose,__FILE__,__LINE__,pixels_ss*sizeof(double),
-					(void **)&ss,&error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_mallocd(verbose,__FILE__,__LINE__,pixels_ss*sizeof(double),
-					(void **)&ssacrosstrack,&error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_mallocd(verbose,__FILE__,__LINE__,pixels_ss*sizeof(double),
-					(void **)&ssalongtrack,&error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_mallocd(verbose,__FILE__,__LINE__,beams_bath*sizeof(double),
-					(void **)&depths,&error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_mallocd(verbose,__FILE__,__LINE__,beams_bath*sizeof(double),
-					(void **)&depthsmooth,&error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_mallocd(verbose,__FILE__,__LINE__,beams_bath*sizeof(double),
-					(void **)&depthacrosstrack,&error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_mallocd(verbose,__FILE__,__LINE__,(beams_bath+1)*sizeof(double),
-					(void **)&slopes,&error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_mallocd(verbose,__FILE__,__LINE__,(beams_bath+1)*sizeof(double),
-					(void **)&slopeacrosstrack,&error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(char), (void **)&beamflag, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(double), (void **)&bath, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_AMPLITUDE,
-						sizeof(double), (void **)&amp, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(double), (void **)&bathacrosstrack, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(double), (void **)&bathalongtrack, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_SIDESCAN,
-						sizeof(double), (void **)&ss, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_SIDESCAN,
-						sizeof(double), (void **)&ssacrosstrack, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_SIDESCAN,
-						sizeof(double), (void **)&ssalongtrack, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(double), (void **)&depths, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(double), (void **)&depthsmooth, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(double), (void **)&depthacrosstrack, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(double), (void **)&slopes, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						2 * sizeof(double), (void **)&slopeacrosstrack, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						2 * sizeof(double), (void **)&bathalongtrack, &error);
-
-	/* if error initializing memory then quit */
-	if (error != MB_ERROR_NO_ERROR)
-		{
-		mb_error(verbose,error,&message);
-		fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",message);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-
-	/* output information */
-	if (error == MB_ERROR_NO_ERROR && verbose > 0)
-	    {
-	    fprintf(stderr, "\nprocessing swath file: %s %d\n", swathfile, format);
-	    }
-
-	/* initialize grid arrays */
-	if (error == MB_ERROR_NO_ERROR)
-	    {
-	    if (gridamp == MB_YES)
-		{
-		/* initialize the memory */
-		for (i=0;i<gridampnx*gridampny;i++)
-			{
-			gridamphist[i] = 0.0;
-			}
-		}
-	    if (gridss == MB_YES)
-		{
-		/* initialize the memory */
-		for (i=0;i<gridssnx*gridssny;i++)
-			{
-			gridsshist[i] = 0.0;
-			}
-		}
-	    }
-
-	/* open output files */
-	if (error == MB_ERROR_NO_ERROR
-		&& dump == MB_YES)
-	    {
-	    atfp = stdout;
-	    stfp = stdout;
-	    }
-	else if (error == MB_ERROR_NO_ERROR)
-	    {
-	    if (amplitude_on == MB_YES)
-	    	{
-	    	strcpy(amptablefile,swathfile);
- 	    	strcat(amptablefile,".aga");
-	    	if ((atfp = fopen(amptablefile,"w")) == NULL)
-		    {
-		    error = MB_ERROR_OPEN_FAIL;
-		    mb_error(verbose,error,&message);
-		    fprintf(stderr, "\nUnable to open output table file %s\n", amptablefile);
-		    fprintf(stderr, "Program %s aborted!\n", program_name);
-		    exit(error);
-		    }
-		}
-	    if (sidescan_on == MB_YES)
-	    	{
-	    	strcpy(sstablefile,swathfile);
- 	    	strcat(sstablefile,".sga");
-	    	if ((stfp = fopen(sstablefile,"w")) == NULL)
-		    {
-		    error = MB_ERROR_OPEN_FAIL;
-		    mb_error(verbose,error,&message);
-		    fprintf(stderr, "\nUnable to open output table file %s\n", sstablefile);
-		    fprintf(stderr, "Program %s aborted!\n", program_name);
-		    exit(error);
-		    }
-		}
-	    }
-
-	/* write to output file */
-	if (error == MB_ERROR_NO_ERROR)
-	    {
-	    /* set comments in table files */
-	    if (amplitude_on == MB_YES)
-	    	{
-		fprintf(atfp,"## Amplitude correction table files generated by program %s\n",program_name);
-	    	fprintf(atfp,"## Version %s\n",rcs_id);
-	    	fprintf(atfp,"## MB-system Version %s\n",MB_VERSION);
-	    	fprintf(atfp,"## Table file format: 1.0.0\n");
-	    	right_now = time((time_t *)0);
-	    	strcpy(date,ctime(&right_now));
-                date[strlen(date)-1] = '\0';
-	    	if ((user_ptr = getenv("USER")) == NULL)
-			user_ptr = getenv("LOGNAME");
-	    	if (user_ptr != NULL)
-			strcpy(user,user_ptr);
-	    	else
-			strcpy(user, "unknown");
-	    	gethostname(host,MB_PATH_MAXLINE);
-	    	fprintf(atfp,"## Run by user <%s> on cpu <%s> at <%s>\n",
-			user,host,date);
-	    	fprintf(atfp, "## Input swath file:      %s\n", swathfile);
-	    	fprintf(atfp, "## Input swath format:    %d\n", format);
-	    	fprintf(atfp, "## Output table file:     %s\n", amptablefile);
-	    	fprintf(atfp, "## Pings to average:      %d\n", pings_avg);
-	    	fprintf(atfp, "## Number of angle bins:  %d\n", nangles);
-	    	fprintf(atfp, "## Maximum angle:         %f\n", angle_max);
-	   	fprintf(atfp, "## Default altitude:      %f\n", altitude_default);
-		fprintf(atfp, "## Slope correction:      %d\n", amp_corr_slope);
-	   	fprintf(atfp, "## Data type:             beam amplitude\n");
-		}
-
-	    if (sidescan_on == MB_YES)
-	    	{
-		fprintf(stfp,"## Sidescan correction table files generated by program %s\n",program_name);
-	    	fprintf(stfp,"## Version %s\n",rcs_id);
-	    	fprintf(stfp,"## MB-system Version %s\n",MB_VERSION);
-	    	fprintf(stfp,"## Table file format: 1.0.0\n");
-	    	right_now = time((time_t *)0);
-	    	strcpy(date,ctime(&right_now));
-                date[strlen(date)-1] = '\0';
-	    	if ((user_ptr = getenv("USER")) == NULL)
-			user_ptr = getenv("LOGNAME");
-	    	if (user_ptr != NULL)
-			strcpy(user,user_ptr);
-	    	else
-			strcpy(user, "unknown");
-	    	gethostname(host,MB_PATH_MAXLINE);
-	    	fprintf(stfp,"## Run by user <%s> on cpu <%s> at <%s>\n",
-			user,host,date);
-	    	fprintf(stfp, "## Input swath file:      %s\n", swathfile);
-	    	fprintf(stfp, "## Input swath format:    %d\n", format);
-	    	fprintf(stfp, "## Output table file:     %s\n", sstablefile);
-	    	fprintf(stfp, "## Pings to average:      %d\n", pings_avg);
-	    	fprintf(stfp, "## Number of angle bins:  %d\n", nangles);
-	    	fprintf(stfp, "## Maximum angle:         %f\n", angle_max);
-	   	fprintf(stfp, "## Default altitude:      %f\n", altitude_default);
-		fprintf(stfp, "## Slope Correction:      %d\n", ss_corr_slope);
-	   	fprintf(stfp, "## Data type:             sidescan\n");
-		}
-	    }
-
-	/* initialize counting variables */
-	nrec = 0;
-	namp = 0;
-	nss = 0;
-	navg = 0;
-	ntable = 0;
-
-	/* read and process data */
-	while (error <= MB_ERROR_NO_ERROR)
-		{
-
-		/* read a ping of data */
-		status = mb_get(verbose,mbio_ptr,&kind,&pings,
-				time_i,&time_d,
-				&navlon,&navlat,
-				&speed,&heading,
-				&distance,&altitude,&sonardepth,
-				&beams_bath,&beams_amp,&pixels_ss,
-				beamflag,bath,amp,bathacrosstrack,bathalongtrack,
-				ss,ssacrosstrack,ssalongtrack,
-				comment,&error);
-
-
-		/* Apply ESF Edits if available */
-		if (esf.nedit > 0 && error == MB_ERROR_NO_ERROR && kind == MB_DATA_DATA)
-		{
-			status = mb_esf_apply(verbose, &esf,
-					time_d, 0,
-					beams_bath, beamflag, &error);
-
-		}
-
-
-		if ((navg > 0
-			&& (error == MB_ERROR_TIME_GAP
-				|| error == MB_ERROR_EOF))
-			|| (navg >= pings_avg)
-			|| (navg == 0 && error == MB_ERROR_EOF))
-			{
-			/* write out tables */
-			time_d_avg /= navg;
-			altitude_avg /= navg;
-			if (beammode == MBBACKANGLE_BEAMPATTERN_EMPIRICAL)
-				{
-				if (amplitude_on == MB_YES)
-				output_table(verbose, atfp, ntable, navg, time_d_avg,
-						nangles, angle_max, dangle, symmetry,
-						nmeanamp, meanamp, sigmaamp, &error);
-				if (sidescan_on == MB_YES)
-				output_table(verbose, stfp, ntable, navg, time_d_avg,
-						nangles, angle_max, dangle, symmetry,
-						nmeanss, meanss, sigmass, &error);
-				}
-			else if (beammode == MBBACKANGLE_BEAMPATTERN_SIDESCAN)
-				{
-				if (amplitude_on == MB_YES)
-				output_model(verbose, atfp, ssbeamwidth, ssdepression, ref_angle,
-						ntable, navg, time_d_avg, altitude_avg,
-						nangles, angle_max, dangle, symmetry,
-						nmeanamp, meanamp, sigmaamp, &error);
-				if (sidescan_on == MB_YES)
-				output_model(verbose, stfp, ssbeamwidth, ssdepression, ref_angle,
-						ntable, navg, time_d_avg, altitude_avg,
-						nangles, angle_max, dangle, symmetry,
-						nmeanss, meanss, sigmass, &error);
-				}
-			ntable++;
-
-			/* reinitialize arrays */
-			navg = 0;
-			time_d_avg = 0.0;
-			altitude_avg = 0.0;
-			if (amplitude_on == MB_YES)
-			for (i=0;i<nangles;i++)
-				{
-				nmeanamp[i] = 0;
-				meanamp[i] = 0.0;
-				sigmaamp[i] = 0.0;
-				}
-			if (sidescan_on == MB_YES)
-			for (i=0;i<nangles;i++)
-				{
-				nmeanss[i] = 0;
-				meanss[i] = 0.0;
-				sigmass[i] = 0.0;
-				}
-			}
-
-
-		/* process the pings */
-		if (error == MB_ERROR_NO_ERROR
-		    || error == MB_ERROR_TIME_GAP)
-		    {
-		    /* if needed, attempt to get sidescan correction type */
-		    if (ss_corr_type == MBP_SSCORR_UNKNOWN)
-		    	{
-			status = mb_sidescantype(verbose, mbio_ptr, NULL, &ss_type, &error);
-			if (status == MB_SUCCESS)
-				{
-				if (ss_type == MB_SIDESCAN_LINEAR)
-					ss_corr_type = MBP_SSCORR_DIVISION;
-				else
-					ss_corr_type = MBP_SSCORR_SUBTRACTION;
-				}
-			else
-				{
-				status = MB_SUCCESS;
-				error = MB_ERROR_NO_ERROR;
-				ss_corr_type = MBP_SSCORR_SUBTRACTION;
-				}
-			}
-
-		    /* increment record counter */
-		    nrec++;
-		    navg++;
-		    ntotavg++;
-
-		    /* increment time */
-		    time_d_avg += time_d;
-		    altitude_avg += altitude;
-		    time_d_totavg += time_d;
-		    altitude_totavg += altitude;
-
-		    /* get the seafloor slopes */
-		    if (beams_bath > 0)
-			mb_pr_set_bathyslope(verbose,nsmooth,
-				beams_bath,beamflag,bath,bathacrosstrack,
-				&ndepths,depths,depthacrosstrack,
-				&nslopes,slopes,slopeacrosstrack,
-				depthsmooth,
-				&error);
-
-
-		    /* get distance scaling and heading vector */
-		    mb_coor_scale(verbose,navlat,&mtodeglon,&mtodeglat);
-		    headingx = sin(heading * DTR);
-		    headingy = cos(heading * DTR);
-
-		    /* do the amplitude */
-		    if (amplitude_on == MB_YES)
-		    for (i=0;i<beams_amp;i++)
-			{
-			if (mb_beam_ok(beamflag[i]))
-			    {
-			    namp++;
-			    if (corr_topogrid == MB_YES)
-				{
-				/* get position in grid */
-				r[0] =  headingy * bathacrosstrack[i]
-					+ headingx * bathalongtrack[i];
-				r[1] =  -headingx * bathacrosstrack[i]
-					+ headingy * bathalongtrack[i];
-			        ix = (navlon + r[0] * mtodeglon - grid.xmin + 0.5 * grid.dx) / grid.dx;
-			        jy = (navlat + r[1] * mtodeglat - grid.ymin + 0.5 * grid.dy) / grid.dy;
-			        kgrid = ix * grid.ny + jy;
-			        kgrid00 = (ix - 1) * grid.ny + jy - 1;
-			        kgrid01 = (ix - 1) * grid.ny + jy + 1;
-			        kgrid10 = (ix + 1) * grid.ny + jy - 1;
-			        kgrid11 = (ix + 1) * grid.ny + jy + 1;
-				if (ix > 0 && ix < grid.nx - 1 && jy > 0 && jy < grid.ny - 1
-					&& grid.data[kgrid] > grid.nodatavalue
-					&& grid.data[kgrid00] > grid.nodatavalue
-					&& grid.data[kgrid01] > grid.nodatavalue
-					&& grid.data[kgrid10] > grid.nodatavalue
-					&& grid.data[kgrid11] > grid.nodatavalue)
-					{
-					/* get look vector for data */
-					bathy = -grid.data[kgrid];
-					r[2] = grid.data[kgrid] + sonardepth;
-					rr = -sqrt(r[0] * r[0] + r[1] * r[1] + r[2] * r[2]);
-					r[0] /= rr;
-					r[1] /= rr;
-					r[2] /= rr;
-
-					/* get normal vector to grid surface */
-					if (corr_slope == MB_YES)
-						{
-						v1[0] = 2.0 * grid.dx / mtodeglon;
-						v1[1] = 2.0 * grid.dy / mtodeglat;
-						v1[2] = grid.data[kgrid11] - grid.data[kgrid00];
-						v2[0] = -2.0 * grid.dx / mtodeglon;
-						v2[1] = 2.0 * grid.dy / mtodeglat;
-						v2[2] = grid.data[kgrid01] - grid.data[kgrid10];
-						v[0] = v1[1] * v2[2] - v2[1] * v1[2];
-						v[1] = v2[0] * v1[2] - v1[0] * v2[2];
-						v[2] = v1[0] * v2[1] - v2[0] * v1[1];
-						vv = sqrt(v[0] * v[0] + v[1] * v[1] + v[2] * v[2]);
-						v[0] /= vv;
-						v[1] /= vv;
-						v[2] /= vv;
-						}
-					else
-						{
-						v[0] = 0.0;
-						v[1] = 0.0;
-						v[2] = 1.0;
-						}
-
-					/* angle between look vector and surface normal
-						is the acos(r dot v) */
-					angle = RTD * acos(r[0] * v[0] + r[1] * v[1] + r[2] *v[2]);
-					if (bathacrosstrack[i] < 0.0)
-						angle = -angle;
-
-/* fprintf(stderr,"i:%d xtrack:%f ltrack:%f depth:%f sonardepth:%f rawangle:%f\n",
-i,bathacrosstrack[i],bathalongtrack[i],bath[i],sonardepth,RTD * atan(bathacrosstrack[i] / (sonardepth + grid.data[kgrid])));
-fprintf(stderr,"ix:%d of %d jy:%d of %d  topo:%f\n",
-ix,grid.nx,jy,grid.ny,grid.data[kgrid]);
-fprintf(stderr,"R:%f %f %f  V1:%f %f %f  V2:%f %f %f  V:%f %f %f  angle:%f\n\n",
-r[0],r[1],r[2],v1[0],v1[1],v1[2],v2[0],v2[1],v2[2],v[0],v[1],v[2],angle);*/
-					}
-				else
-					{
-					if (ix >= 0 && ix < grid.nx && jy >= 0 && jy < grid.ny
-						&& grid.data[kgrid] > grid.nodatavalue)
-					    bathy = -grid.data[kgrid];
-					else if (altitude > 0.0)
-					    bathy = altitude + sonardepth;
-					else
-					    bathy = altitude_default + sonardepth;
-					angle = RTD * atan(bathacrosstrack[i] / (bathy - sonardepth));
-					slope = 0.0;
-					}
-				}
-			    else if (beams_bath == beams_amp)
-				{
-				status = mb_pr_get_bathyslope(verbose,
-				    ndepths,depths,depthacrosstrack,
-				    nslopes,slopes,slopeacrosstrack,
-				    bathacrosstrack[i],
-				    &bathy,&slope,&error);
-				if (status != MB_SUCCESS)
-				    {
-				    if (altitude > 0.0)
-				    	bathy = altitude + sonardepth;
-				    else
-				    	bathy = altitude_default + sonardepth;
-				    slope = 0.0;
-				    status = MB_SUCCESS;
-				    error = MB_ERROR_NO_ERROR;
-				    }
-				altitude_use = bathy - sonardepth;
-				angle = RTD * atan(bathacrosstrack[i] / altitude_use);
-				if (corr_slope == MB_YES)
-					angle += RTD * atan(slope);
-				}
-			    else
-				{
-				if (altitude > 0.0)
-				    bathy = altitude + sonardepth;
-				else
-				    bathy = altitude_default + sonardepth;
-				slope = 0.0;
-				altitude_use = bathy - sonardepth;
-				angle = RTD * atan(bathacrosstrack[i] / altitude_use);
-				}
-			    if (bathy > 0.0)
-				{
-				/* load amplitude into table */
-				j = (angle - angle_start)/dangle;
-				if (j >= 0 && j < nangles)
-				    {
-				    meanamp[j] += amp[i];
-				    sigmaamp[j] += amp[i]*amp[i];
-				    nmeanamp[j]++;
-				    meantotamp[j] += amp[i];
-				    sigmatotamp[j] += amp[i]*amp[i];
-				    nmeantotamp[j]++;
-				    }
-
-				/* load amplitude into grid */
-				if (gridamp == MB_YES)
-				    {
-				    ix = (angle + gridampangle) / gridampdx;
-				    jy = (amp[i] - gridampmin) / gridampdy;
-				    if (ix >= 0 && ix < gridampnx && jy >= 0 && jy < gridampny)
-					{
-					k = ix * gridampny + jy;
-					gridamphist[k] += 1.0;
-					}
-				    }
-				}
-
-			    /* print debug statements */
-			    if (verbose >= 5)
-				{
-				fprintf(stderr,"dbg5       %d %d: slope:%f altitude:%f xtrack:%f ang:%f j:%d\n",
-				    nrec, i, slope, altitude_use, bathacrosstrack[i], angle, j);
-				}
-			    }
-			}
-
-
-		    /* do the sidescan */
-		    if (sidescan_on == MB_YES)
-		    for (i=0;i<pixels_ss;i++)
-			{
-			if (ss[i] > MB_SIDESCAN_NULL)
-			    {
-			    nss++;
-			    if (corr_topogrid == MB_YES)
-				{
-				/* get position in grid */
-				r[0] =  headingy * ssacrosstrack[i]
-					+ headingx * ssalongtrack[i];
-				r[1] =  -headingx * ssacrosstrack[i]
-					+ headingy * ssalongtrack[i];
-			        ix = (navlon + r[0] * mtodeglon - grid.xmin + 0.5 * grid.dx) / grid.dx;
-			        jy = (navlat + r[1] * mtodeglat - grid.ymin + 0.5 * grid.dy) / grid.dy;
-			        kgrid = ix * grid.ny + jy;
-			        kgrid00 = (ix - 1) * grid.ny + jy - 1;
-			        kgrid01 = (ix - 1) * grid.ny + jy + 1;
-			        kgrid10 = (ix + 1) * grid.ny + jy - 1;
-			        kgrid11 = (ix + 1) * grid.ny + jy + 1;
-				if (ix > 0 && ix < grid.nx - 1 && jy > 0 && jy < grid.ny - 1
-					&& grid.data[kgrid] > grid.nodatavalue
-					&& grid.data[kgrid00] > grid.nodatavalue
-					&& grid.data[kgrid01] > grid.nodatavalue
-					&& grid.data[kgrid10] > grid.nodatavalue
-					&& grid.data[kgrid11] > grid.nodatavalue)
-					{
-					/* get look vector for data */
-					bathy = -grid.data[kgrid];
-					r[2] = grid.data[kgrid] + sonardepth;
-					rr = -sqrt(r[0] * r[0] + r[1] * r[1] + r[2] * r[2]);
-					r[0] /= rr;
-					r[1] /= rr;
-					r[2] /= rr;
-
-					/* get normal vector to grid surface */
-					if (corr_slope == MB_YES)
-						{
-						v1[0] = 2.0 * grid.dx / mtodeglon;
-						v1[1] = 2.0 * grid.dy / mtodeglat;
-						v1[2] = grid.data[kgrid11] - grid.data[kgrid00];
-						v2[0] = -2.0 * grid.dx / mtodeglon;
-						v2[1] = 2.0 * grid.dy / mtodeglat;
-						v2[2] = grid.data[kgrid01] - grid.data[kgrid10];
-						v[0] = v1[1] * v2[2] - v2[1] * v1[2];
-						v[1] = v2[0] * v1[2] - v1[0] * v2[2];
-						v[2] = v1[0] * v2[1] - v2[0] * v1[1];
-						vv = sqrt(v[0] * v[0] + v[1] * v[1] + v[2] * v[2]);
-						v[0] /= vv;
-						v[1] /= vv;
-						v[2] /= vv;
-						}
-					else
-						{
-						v[0] = 0.0;
-						v[1] = 0.0;
-						v[2] = 1.0;
-						}
-
-					/* angle between look vector and surface normal
-						is the acos(r dot v) */
-					angle = RTD * acos(r[0] * v[0] + r[1] * v[1] + r[2] *v[2]);
-					if (ssacrosstrack[i] < 0.0)
-						angle = -angle;
-
-/* fprintf(stderr,"i:%d xtrack:%f ltrack:%f depth:%f sonardepth:%f rawangle:%f\n",
-i,ssacrosstrack[i],ssalongtrack[i],ss[i],sonardepth,RTD * atan(ssacrosstrack[i] / (sonardepth + grid.data[kgrid])));
-fprintf(stderr,"ix:%d of %d jy:%d of %d  topo:%f\n",
-ix,grid.nx,jy,grid.ny,grid.data[kgrid]);
-fprintf(stderr,"R:%f %f %f  V1:%f %f %f  V2:%f %f %f  V:%f %f %f  angle:%f\n\n",
-r[0],r[1],r[2],v1[0],v1[1],v1[2],v2[0],v2[1],v2[2],v[0],v[1],v[2],angle);*/
-					}
-				else
-					{
-					if (ix >= 0 && ix < grid.nx && jy >= 0 && jy < grid.ny
-						&& grid.data[kgrid] > grid.nodatavalue)
-					    bathy = -grid.data[kgrid];
-					else if (altitude > 0.0)
-					    bathy = altitude + sonardepth;
-					else
-					    bathy = altitude_default + sonardepth;
-					angle = RTD * atan(ssacrosstrack[i] / (bathy - sonardepth));
-					slope = 0.0;
-					}
-				}
-			    else if (beams_bath > 0)
-				{
-				status = mb_pr_get_bathyslope(verbose,
-				    ndepths,depths,depthacrosstrack,
-				    nslopes,slopes,slopeacrosstrack,
-				    ssacrosstrack[i],
-				    &bathy,&slope,&error);
-				if (status != MB_SUCCESS
-					|| bathy <= 0.0)
-				    {
-				    if (altitude > 0.0)
-				    	bathy = altitude + sonardepth;
-				    else
-				    	bathy = altitude_default;
-				    slope = 0.0;
-				    status = MB_SUCCESS;
-				    error = MB_ERROR_NO_ERROR;
-				    }
-				altitude_use = bathy - sonardepth;
-				angle = RTD * atan(ssacrosstrack[i] / altitude_use);
-				if (corr_slope == MB_YES)
-					angle += RTD * atan(slope);
-				}
-			    else
-				{
-				if (altitude > 0.0)
-				    	bathy = altitude + sonardepth;
-				else
-				    	bathy = altitude_default;
-				slope = 0.0;
-				altitude_use = bathy - sonardepth;
-				angle = RTD * atan(ssacrosstrack[i] / altitude_use);
-				}
-			    if (bathy > 0.0)
-				{
-				/* load amplitude into table */
-				j = (angle - angle_start)/dangle;
-				if (j >= 0 && j < nangles)
-				    {
-				    meanss[j] += ss[i];
-				    sigmass[j] += ss[i]*ss[i];
-				    nmeanss[j]++;
-				    meantotss[j] += ss[i];
-				    sigmatotss[j] += ss[i]*ss[i];
-				    nmeantotss[j]++;
-				    }
-
-				/* load amplitude into grid */
-				if (gridss == MB_YES)
-				    {
-				    ix = (angle + gridssangle) / gridssdx;
-				    jy = (ss[i] - gridssmin) / gridssdy;
-				    if (ix >= 0 && ix < gridssnx && jy >= 0 && jy < gridssny)
-					{
-					k = ix * gridssny + jy;
-					gridsshist[k] += 1.0;
-					}
-				    }
-				}
-
-			    /* print debug statements */
-			    if (verbose >= 5)
-				{
-				fprintf(stderr,"dbg5kkk       %d %d: slope:%f altitude:%f xtrack:%f ang:%f j:%d\n",
-				    nrec, i, slope, altitude_use, ssacrosstrack[i], angle, j);
-				}
-			    }
-			}
-
-		    }
-		}
-
-	/* close the swath sonar file */
-	status = mb_close(verbose,&mbio_ptr,&error);
-	/* Close ESF file if avialable and open */
-	if (esf.nedit > 0)
-		mb_esf_close(verbose, &esf, &error);
-
-	if (dump == MB_NO && amplitude_on == MB_YES)
-		fclose(atfp);
-	if (dump == MB_NO && sidescan_on == MB_YES)
-		fclose(stfp);
-	ntabletot += ntable;
-	nrectot += nrec;
-	namptot += namp;
-	nsstot += nss;
-
-	/* output grids */
-	if (gridamp == MB_YES)
-		{
-		/* normalize the grid */
-		ampmax = 0.0;
-		for (ix=0;ix<gridampnx;ix++)
-			{
-			norm = 0.0;
-			for (jy=0;jy<gridampny;jy++)
-				{
-				k = ix * gridampny + jy;
-				norm += gridamphist[k];
-				}
-			if (norm > 0.0)
-				{
-				norm *= 0.001;
-				for (jy=0;jy<gridampny;jy++)
-					{
-					k = ix * gridampny + jy;
-					gridamphist[k] /= norm;
-					ampmax = MAX(ampmax, gridamphist[k]);
-					}
-				}
-			}
-
-		/* set the strings */
-		strcpy(gridfile, swathfile);
- 	    	strcat(gridfile,"_aga.grd");
-		strcpy(zlabel, "Beam Amplitude PDF (X1000)");
-		strcpy(title, "Beam Amplitude vs. Grazing Angle PDF");
-
-		/* output the grid */
-		mb_write_gmt_grd(verbose, gridfile, gridamphist,
-				MB_DEFAULT_GRID_NODATA, 
-				gridampnx, gridampny,
-				(double)(-gridampangle), gridampangle,
-				gridampmin, gridampmax,
-				(double)0.0, ampmax,
-				gridampdx, gridampdy,
-				xlabel, ylabel, zlabel, title, projection,
-				argc, argv, &error);
-
-		/* run mbm_grdplot */
-		sprintf(plot_cmd, "mbm_grdplot -I%s -JX9/5 -G1 -MGQ100 -MXI%s -V -L\"File %s - %s:%s\"",
-				gridfile, amptablefile, gridfile, title, zlabel);
-		if (verbose)
-			{
-			fprintf(stderr, "\nexecuting mbm_grdplot...\n%s\n",
-				plot_cmd);
-			}
-		plot_status = system(plot_cmd);
-		if (plot_status == -1)
-			{
-			fprintf(stderr, "\nError executing mbm_grdplot on grid file %s\n", gridfile);
-			}
-		}
-	if (gridss == MB_YES)
-		{
-		/* normalize the grid */
-		ampmax = 0.0;
-		for (ix=0;ix<gridssnx;ix++)
-			{
-			norm = 0.0;
-			for (jy=0;jy<gridssny;jy++)
-				{
-				k = ix * gridssny + jy;
-				norm += gridsshist[k];
-				}
-			if (norm > 0.0)
-				{
-				norm *= 0.001;
-				for (jy=0;jy<gridssny;jy++)
-					{
-					k = ix * gridssny + jy;
-					gridsshist[k] /= norm;
-					ampmax = MAX(ampmax, gridsshist[k]);
-					}
-				}
-			}
-
-		/* set the strings */
-		strcpy(gridfile, swathfile);
- 	    	strcat(gridfile,"_sga.grd");
-		strcpy(zlabel, "Sidescan Amplitude PDF (X1000)");
-		strcpy(title, "Sidescan Amplitude vs. Grazing Angle PDF");
-
-		/* output the grid */
-		mb_write_gmt_grd(verbose, gridfile, gridsshist,
-				MB_DEFAULT_GRID_NODATA, 
-				gridssnx, gridssny,
-				(double)(-gridssangle), gridssangle,
-				gridssmin, gridssmax,
-				(double)0.0, ampmax,
-				gridssdx, gridssdy,
-				xlabel, ylabel, zlabel, title, projection,
-				argc, argv, &error);
-
-		/* run mbm_grdplot */
-		sprintf(plot_cmd, "mbm_grdplot -I%s -JX9/5 -G1 -S -MGQ100 -MXI%s -V -L\"File %s - %s:%s\"",
-				gridfile, sstablefile, gridfile, title, zlabel);
-		if (verbose)
-			{
-			fprintf(stderr, "\nexecuting mbm_grdplot...\n%s\n",
-				plot_cmd);
-			}
-		plot_status = system(plot_cmd);
-		if (plot_status == -1)
-			{
-			fprintf(stderr, "\nError executing mbm_grdplot on grid file %s\n", gridfile);
-			}
-		}
-
-	/* set amplitude correction in parameter file */
-	if (amplitude_on == MB_YES)
-		status = mb_pr_update_ampcorr(verbose, swathfile,
-			MB_YES, amptablefile,
-			amp_corr_type, corr_symmetry, ref_angle, amp_corr_slope,
-			grid.file, &error);
-
-	/* set sidescan correction in parameter file */
-	if (sidescan_on == MB_YES)
-		status = mb_pr_update_sscorr(verbose, swathfile,
-			MB_YES, sstablefile,
-			ss_corr_type, corr_symmetry, ref_angle, ss_corr_slope,
-			grid.file, &error);
-
-	/* output information */
-	if (error == MB_ERROR_NO_ERROR && verbose > 0)
-	    {
-	    fprintf(stderr, "%d records processed\n", nrec);
-	    if (amplitude_on == MB_YES)
-		{
-		fprintf(stderr, "%d amplitude data processed\n", namp);
-	    	fprintf(stderr, "%d tables written to %s\n", ntable, amptablefile);
-		}
-	    if (sidescan_on == MB_YES)
-		{
-		fprintf(stderr, "%d sidescan data processed\n", nss);
-	    	fprintf(stderr, "%d tables written to %s\n", ntable, sstablefile);
-		}
-	    }
-
-	/* figure out whether and what to read next */
-        if (read_datalist == MB_YES)
-                {
-		if ((status = mb_datalist_read(verbose,datalist,
-			    swathfile,&format,&file_weight,&error))
-			    == MB_SUCCESS)
-                        read_data = MB_YES;
-                else
-                        read_data = MB_NO;
-                }
-        else
-                {
-                read_data = MB_NO;
-                }
-
-	/* end loop over files in list */
-	}
-        if (read_datalist == MB_YES)
-		mb_datalist_close(verbose,&datalist,&error);
-
-	/* write out total tables */
-	time_d_totavg /= ntotavg;
-	altitude_totavg /= ntotavg;
-	if (dump == MB_NO && amplitude_on == MB_YES)
-	    {
-	    strcpy(amptablefile,read_file);
- 	    strcat(amptablefile,"_tot.aga");
-	    if ((atfp = fopen(amptablefile,"w")) == NULL)
-		{
-		error = MB_ERROR_OPEN_FAIL;
-		mb_error(verbose,error,&message);
-		fprintf(stderr, "\nUnable to open output table file %s\n", amptablefile);
-		fprintf(stderr, "Program %s aborted!\n", program_name);
-		exit(error);
-		}
-	    fprintf(atfp,"## Amplitude correction table files generated by program %s\n",program_name);
-	    fprintf(atfp,"## Version %s\n",rcs_id);
-	    fprintf(atfp,"## MB-system Version %s\n",MB_VERSION);
-	    fprintf(atfp,"## Table file format: 1.0.0\n");
-	    right_now = time((time_t *)0);
-	    strcpy(date,ctime(&right_now));
-            date[strlen(date)-1] = '\0';
-	    if ((user_ptr = getenv("USER")) == NULL)
-		    user_ptr = getenv("LOGNAME");
-	    if (user_ptr != NULL)
-		    strcpy(user,user_ptr);
-	    else
-		    strcpy(user, "unknown");
-	    gethostname(host,MB_PATH_MAXLINE);
-	    fprintf(atfp,"## Run by user <%s> on cpu <%s> at <%s>\n",
-		    user,host,date);
-	    fprintf(atfp, "## Input file:            %s\n", read_file);
-	    fprintf(atfp, "## Output table file:     %s\n", amptablefile);
-	    fprintf(atfp, "## Pings to average:      %d\n", pings_avg);
-	    fprintf(atfp, "## Number of angle bins:  %d\n", nangles);
-	    fprintf(atfp, "## Maximum angle:         %f\n", angle_max);
-	    fprintf(atfp, "## Default altitude:      %f\n", altitude_default);
-	    fprintf(atfp, "## Slope correction:      %d\n", amp_corr_slope);
-	    fprintf(atfp, "## Data type:             beam amplitude\n");
-	    if (beammode == MBBACKANGLE_BEAMPATTERN_EMPIRICAL)
-		    output_table(verbose, atfp, 0, ntotavg, time_d_totavg,
-				    nangles, angle_max, dangle, symmetry,
-				    nmeantotamp, meantotamp, sigmatotamp, &error);
-	    else if (beammode == MBBACKANGLE_BEAMPATTERN_SIDESCAN)
-		    output_model(verbose, atfp, ssbeamwidth, ssdepression, ref_angle,
-				    0, ntotavg, time_d_totavg, altitude_totavg,
-				    nangles, angle_max, dangle, symmetry,
-				    nmeantotamp, meantotamp, sigmatotamp, &error);
-	    fclose(atfp);
-	    }
-	if (dump == MB_NO && sidescan_on == MB_YES)
-	    {
-	    strcpy(sstablefile,read_file);
- 	    strcat(sstablefile,"_tot.sga");
-	    if ((stfp = fopen(sstablefile,"w")) == NULL)
-		{
-		error = MB_ERROR_OPEN_FAIL;
-		mb_error(verbose,error,&message);
-		fprintf(stderr, "\nUnable to open output table file %s\n", sstablefile);
-		fprintf(stderr, "Program %s aborted!\n", program_name);
-		exit(error);
-		}
-	    fprintf(stfp,"## Sidescan correction table files generated by program %s\n",program_name);
-	    fprintf(stfp,"## Version %s\n",rcs_id);
-	    fprintf(stfp,"## MB-system Version %s\n",MB_VERSION);
-	    fprintf(stfp,"## Table file format: 1.0.0\n");
-	    right_now = time((time_t *)0);
-	    strcpy(date,ctime(&right_now));
-            date[strlen(date)-1] = '\0';
-	    if ((user_ptr = getenv("USER")) == NULL)
-		    user_ptr = getenv("LOGNAME");
-	    if (user_ptr != NULL)
-		    strcpy(user,user_ptr);
-	    else
-		    strcpy(user, "unknown");
-	    gethostname(host,MB_PATH_MAXLINE);
-	    fprintf(stfp,"## Run by user <%s> on cpu <%s> at <%s>\n",
-		    user,host,date);
-	    fprintf(stfp, "## Input file:            %s\n", read_file);
-	    fprintf(stfp, "## Output table file:     %s\n", sstablefile);
-	    fprintf(stfp, "## Pings to average:      %d\n", pings_avg);
-	    fprintf(stfp, "## Number of angle bins:  %d\n", nangles);
-	    fprintf(stfp, "## Maximum angle:         %f\n", angle_max);
-	    fprintf(stfp, "## Default altitude:      %f\n", altitude_default);
-	    fprintf(stfp, "## Slope Correction:      %d\n", ss_corr_slope);
-	    fprintf(stfp, "## Data type:             sidescan\n");
-	    if (beammode == MBBACKANGLE_BEAMPATTERN_EMPIRICAL)
-		    output_table(verbose, stfp, 0, ntotavg, time_d_totavg,
-				    nangles, angle_max, dangle, symmetry,
-				    nmeantotss, meantotss, sigmatotss, &error);
-	    else if (beammode == MBBACKANGLE_BEAMPATTERN_SIDESCAN)
-		    output_model(verbose, stfp, ssbeamwidth, ssdepression, ref_angle,
-				    0, ntotavg, time_d_totavg, altitude_totavg,
-				    nangles, angle_max, dangle, symmetry,
-				    nmeantotss, meantotss, sigmatotss, &error);
-	    fclose(stfp);
-	    }
-
-	/* output information */
-	if (error == MB_ERROR_NO_ERROR && verbose > 0)
-	    {
-	    fprintf(stderr, "\n%d total records processed\n", nrectot);
-	    if (amplitude_on == MB_YES)
-		{
-		fprintf(stderr, "%d total amplitude data processed\n", namptot);
-	    	fprintf(stderr, "%d total aga tables written\n", ntabletot);
-		}
-	    if (sidescan_on == MB_YES)
-		{
-		fprintf(stderr, "%d total sidescan data processed\n", nsstot);
-	    	fprintf(stderr, "%d total sga tables written\n", ntabletot);
-		}
-	    }
-
-	/* deallocate memory used for data arrays */
-	if (amplitude_on == MB_YES)
-		{
-		mb_freed(verbose,__FILE__, __LINE__, (void **)&nmeanamp,&error);
-		mb_freed(verbose,__FILE__, __LINE__, (void **)&meanamp,&error);
-		mb_freed(verbose,__FILE__, __LINE__, (void **)&sigmaamp,&error);
-		mb_freed(verbose,__FILE__, __LINE__, (void **)&nmeantotamp,&error);
-		mb_freed(verbose,__FILE__, __LINE__, (void **)&meantotamp,&error);
-		mb_freed(verbose,__FILE__, __LINE__, (void **)&sigmatotamp,&error);
-		if (gridamp == MB_YES)
-			{
-			mb_freed(verbose,__FILE__, __LINE__, (void **)&gridamphist,&error);
-			}
-		}
-	if (sidescan_on == MB_YES)
-		{
-		mb_freed(verbose,__FILE__, __LINE__, (void **)&nmeanss,&error);
-		mb_freed(verbose,__FILE__, __LINE__, (void **)&meanss,&error);
-		mb_freed(verbose,__FILE__, __LINE__, (void **)&sigmass,&error);
-		mb_freed(verbose,__FILE__, __LINE__, (void **)&nmeantotss,&error);
-		mb_freed(verbose,__FILE__, __LINE__, (void **)&meantotss,&error);
-		mb_freed(verbose,__FILE__, __LINE__, (void **)&sigmatotss,&error);
-		if (gridss == MB_YES)
-			{
-			mb_freed(verbose,__FILE__, __LINE__, (void **)&gridsshist,&error);
-			}
-		}
-	if (grid.data != NULL)
-		{
-		mb_freed(verbose,__FILE__, __LINE__, (void **)&grid.data,&error);
-		}
-
-	/* set program status */
-	status = MB_SUCCESS;
-
-	/* check memory */
-	if (verbose >= 4)
-		status = mb_memory_list(verbose,&error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  Program <%s> completed\n",
-			program_name);
-		fprintf(stderr,"dbg2  Ending status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* end it all */
-	if (verbose > 0)
-		fprintf(stderr,"\n");
-	exit(error);
-}
-/*--------------------------------------------------------------------*/
-int output_table(int verbose, FILE *tfp, int ntable, int nping, double time_d,
-	int nangles, double angle_max, double dangle, int symmetry,
-	int *nmean, double *mean, double *sigma,
-	int *error)
-{
-	char	*function_name = "output_table";
-	int	status = MB_SUCCESS;
-	double	angle, amean, asigma, sum, sumsq, sumn;
-	int	time_i[7];
-	int	ii, jj, i0, i1;
-	int	i;
-
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBBACKANGLE function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:         %d\n", verbose);
-		fprintf(stderr,"dbg2       tfp:             %p\n", (void *)tfp);
-		fprintf(stderr,"dbg2       ntable:          %d\n", ntable);
-		fprintf(stderr,"dbg2       nping:           %d\n", nping);
-		fprintf(stderr,"dbg2       time_d:          %f\n", time_d);
-		fprintf(stderr,"dbg2       nangles:         %d\n", nangles);
-		fprintf(stderr,"dbg2       angle_max:       %f\n", angle_max);
-		fprintf(stderr,"dbg2       dangle:          %f\n", dangle);
-		fprintf(stderr,"dbg2       symmetry:        %d\n", symmetry);
-		fprintf(stderr,"dbg2       mean and sigma:\n");
-		for (i=0;i<nangles;i++)
-			fprintf(stderr,"dbg2         %d %f %d %f %f\n",
-				i, (i * dangle), nmean[i], mean[i], sigma[i]);
-		}
-
-	/* process sums and print out results */
-	mb_get_date(verbose, time_d, time_i);
-	fprintf(tfp,"# table: %d\n", ntable);
-	fprintf(tfp,"# nping: %d\n", nping);
-	fprintf(tfp,"# time:  %4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d    %16.6f\n",
-		time_i[0],time_i[1],time_i[2],
-		time_i[3],time_i[4],time_i[5],
-		time_i[6],time_d);
-	fprintf(tfp,"# nangles: %d\n", nangles);
-	for (i=0;i<nangles;i++)
-		{
-		amean = 0.0;
-		asigma = 0.0;
-		sum = 0.0;
-		sumsq = 0.0;
-		sumn = 0.0;
-		angle = -angle_max + i * dangle;
-		if (fabs(angle) > MBBACKANGLE_INNERSWATHLIMIT)
-			{
-			i0 = MAX(i - 1, 0);
-			i1 = MIN(i + 1, nangles - 1);
-			}
-		else
-			{
-			i0 = i;
-			i1 = i;
-			}
-		for (ii=i0;ii<=i1;ii++)
-			{
-			sum += mean[ii];
-			sumsq += sigma[ii];
-			sumn += nmean[ii];
-			if (symmetry == MB_YES)
-				{
-				jj = nangles - ii - 1;
-				sum += mean[jj];
-				sumsq += sigma[jj];
-				sumn += nmean[jj];
-				}
-			}
-		if (sumn > 0.0)
-			{
-			amean = sum /  sumn;
-			asigma = sqrt((sumsq / sumn) - amean * amean);
-			}
-		fprintf(tfp,"%7.4f %12.4f %12.4f\n", angle, amean, asigma);
-		}
-	fprintf(tfp,"#\n");
-	fprintf(tfp,"#\n");
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBBACKANGLE function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:           %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:          %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int output_model(int verbose, FILE *tfp,
-	double beamwidth, double depression, double ref_angle,
-	int ntable, int nping, double time_d, double altitude,
-	int nangles, double angle_max, double dangle, int symmetry,
-	int *nmean, double *mean, double *sigma,
-	int *error)
-{
-	char	*function_name = "output_model";
-	int	status = MB_SUCCESS;
-	double	ref_amp, range, del, factor, aa;
-	double	angle, amean, asigma, sum, sumsq, sumn;
-	int	time_i[7];
-	int	ii, jj, i0, i1, iref;
-	int	i;
-
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBBACKANGLE function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:         %d\n", verbose);
-		fprintf(stderr,"dbg2       tfp:             %p\n", (void *)tfp);
-		fprintf(stderr,"dbg2       beamwidth:       %f\n", beamwidth);
-		fprintf(stderr,"dbg2       depression:      %f\n", depression);
-		fprintf(stderr,"dbg2       ref_angle:       %f\n", ref_angle);
-		fprintf(stderr,"dbg2       ntable:          %d\n", ntable);
-		fprintf(stderr,"dbg2       nping:           %d\n", nping);
-		fprintf(stderr,"dbg2       time_d:          %f\n", time_d);
-		fprintf(stderr,"dbg2       altitude:        %f\n", altitude);
-		fprintf(stderr,"dbg2       nangles:         %d\n", nangles);
-		fprintf(stderr,"dbg2       angle_max:       %f\n", angle_max);
-		fprintf(stderr,"dbg2       dangle:          %f\n", dangle);
-		fprintf(stderr,"dbg2       symmetry:        %d\n", symmetry);
-		fprintf(stderr,"dbg2       mean and sigma:\n");
-		for (i=0;i<nangles;i++)
-			fprintf(stderr,"dbg2         %d %f %d %f %f\n",
-				i, (i * dangle), nmean[i], mean[i], sigma[i]);
-		}
-
-	/* get average amplitude at reference angle */
-	iref = (angle_max - ref_angle) / dangle;
-	i0 = MAX(iref - 1, 0);
-	i1 = MIN(iref + 1, nangles - 1);
-	ref_amp = 0.0;
-	sum = 0.0;
-	sumsq = 0.0;
-	sumn = 0.0;
-	for (ii=i0;ii<=i1;ii++)
-		{
-		sum += mean[ii];
-		sumsq += sigma[ii];
-		sumn += nmean[ii];
-		jj = nangles - ii - 1;
-		sum += mean[jj];
-		sumsq += sigma[jj];
-		sumn += nmean[jj];
-		}
-	if (sumn > 0.0)
-		{
-		ref_amp = sum /  sumn;
-		asigma = sqrt((sumsq / sumn) - ref_amp * ref_amp);
-		}
-
-	/* get model that combines gaussian with 1/r
-		- gaussian must drop to 0.7 max at 0.5 * beamwidth
-		- model must equal ref_amp at ref_angle */
-	del = (90.0 - depression) - 0.5 * beamwidth;
-	aa = -log(0.1) / (del * del);
-	del = 90.0 - depression - ref_angle;
-	range = altitude / cos (DTR * ref_angle);
-	factor = ref_amp * range * range / exp(-aa * del * del);
-
-	/* process sums and print out results */
-	mb_get_date(verbose, time_d, time_i);
-	fprintf(tfp,"# table: %d\n", ntable);
-	fprintf(tfp,"# nping: %d\n", nping);
-	fprintf(tfp,"# time:  %4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d    %16.6f\n",
-		time_i[0],time_i[1],time_i[2],
-		time_i[3],time_i[4],time_i[5],
-		time_i[6],time_d);
-	fprintf(tfp,"# nangles: %d\n", nangles);
-	for (i=0;i<nangles;i++)
-		{
-		angle = -angle_max + i * dangle;
-		del = fabs(angle) - (90 - depression);
-		range = altitude / cos (DTR * fabs(angle));
-		amean = factor * exp(-aa * del * del) / (range * range);
-		fprintf(tfp,"%7.4f %12.4f %12.4f\n", angle, amean, asigma);
-		}
-	fprintf(tfp,"#\n");
-	fprintf(tfp,"#\n");
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBBACKANGLE function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:           %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:          %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/utilities/mbclean.c b/src/utilities/mbclean.c
deleted file mode 100644
index 2ca6e2b..0000000
--- a/src/utilities/mbclean.c
+++ /dev/null
@@ -1,2087 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbclean.c	2/26/93
- *    $Id: mbclean.c 2240 2015-05-08 22:52:11Z caress $
- *
- *    Copyright (c) 1993-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbclean identifies and flags artifacts in swath sonar bathymetry data.
- * The edit events are output to an edit save file which can be applied
- * to the data by the program mbprocess.
- * Several algorithms are available for identifying artifacts; multiple
- * algorithmscan be applied in a single pass.  The most commonly used
- * approach is to identify artifacts  based  on  excessive  bathymetric
- * slopes.  If desired, mbclean will also flag beams associated with
- * "rails" where outer beams have  smaller  acrosstrack distances than
- * more inner beams (-Q option).  Low and high bounds on acceptable depth
- * values can be set; depth values outside  the  acceptable  range  will  be
- * flagged.  The acceptable depth ranges can either be absolute (-B option), relative
- * to the local median depth (-A option) or defined by low and high fractions
- * of the local median depth (-G option).  A set number of outer beams can also be
- * flagged.
-
- * The order in which the flagging algorithms are applied is as follows:
- *      1. Flag specified number of outer beams (-X option).
- *      2. Flag soundings outside specified acceptable
- *         depth range (-B option).
- *      3. Flag soundings outside acceptable depth range using
- *         fractions of local median depth (-G option).
- *      4. Flag soundings outside acceptable depth range using
- *         deviation from local median depth (-A option).
- *      5. Flag soundings associated with excessive slopes
- *         (-C option or default).
- *      6. Zap "rails" (-Q option).
- *      7. Flag all soundings in pings with too few
- *         good soundings (-U option).
- *
- *
- * Author:	D. W. Caress
- * Date:	February 26, 1993 (buffered i/o version)
- * Date:	January 19, 2001 (edit save file version)
- *
- * Acknowledgments:
- * This program is based to a large extent on the program mbcleanx
- * by Alberto Malinverno (formerly at L-DEO, now at Schlumberger),
- * which was in turn based on the original program mbclean (v. 1.0)
- * by David Caress.
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <math.h>
-#include <string.h>
-#include <sys/stat.h>
-#include <time.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_define.h"
-#include "mb_io.h"
-#include "mb_swap.h"
-#include "mb_process.h"
-
-/* local defines */
-#define	MBCLEAN_FLAG_ONE	1
-#define	MBCLEAN_FLAG_BOTH	2
-
-/* MBIO buffer size default */
-#define	MBCLEAN_BUFFER_DEFAULT	500
-
-/* edit action defines */
-#define	MBCLEAN_NOACTION	0
-
-/* ping structure definition */
-struct mbclean_ping_struct
-	{
-	int	time_i[7];
-	double	time_d;
-	int	multiplicity;
-	double	navlon;
-	double	navlat;
-	double	speed;
-	double	heading;
-	int	beams_bath;
-	char	*beamflag;
-	char	*beamflagorg;
-	double	*bath;
-	double	*bathacrosstrack;
-	double	*bathalongtrack;
-	double	*bathx;
-	double	*bathy;
-	};
-
-/* bad beam identifier structure definition */
-struct bad_struct
-	{
-	int	flag;
-	int	ping;
-	int	beam;
-	double	bath;
-	};
-
-/* edit output function */
-int mbclean_save_edit(int verbose, FILE *sofp, double time_d, int beam,
-			int action, int *error);
-
-static char rcs_id[] = "$Id: mbclean.c 2240 2015-05-08 22:52:11Z caress $";
-
-/*--------------------------------------------------------------------*/
-
-int main (int argc, char **argv)
-{
-	char program_name[] = "MBCLEAN";
-	char help_message[] =  "MBCLEAN identifies and flags artifacts in swath sonar bathymetry data\nBad beams  are  indentified  based  on  one simple criterion only: \nexcessive bathymetric slopes.   The default input and output streams \nare stdin and stdout.";
-	char usage_message[] = "mbclean [-Amax -Blow/high -Cslope/unit -Dmin/max \n"
-				"\t-Fformat -Gfraction_low/fraction_high -Iinfile -Krange_min \n"
-				"\t-Llonflip -Mmode -Ooutfile -Pmin_speed/max_speed -Q -Rmaxheadingrate \n"
-				"\t-Sspike_slope/mode/format -Ttolerance -Wwest/east/south/north \n"
-				"\t-Xbeamsleft/beamsright -Ydistanceleft/distanceright -Z\n\t-V -H]\n\n";
-	extern char *optarg;
-	int	errflg = 0;
-	int	c;
-	int	help = 0;
-	int	flag = 0;
-
-	/* MBIO status variables */
-	int	status;
-	int	verbose = 0;
-	int	error = MB_ERROR_NO_ERROR;
-	char	*message = NULL;
-
-	/* swath file locking variables */
-	int	uselockfiles;
-	int	lock_status;
-	int	locked;
-	int	lock_purpose;
-	mb_path	lock_program;
-	mb_path lock_cpu;
-	mb_path lock_user;
-	char	lock_date[25];
-
-	/* MBIO read control parameters */
-	int	read_datalist = MB_NO;
-	char	read_file[MB_PATH_MAXLINE];
-	char	swathfile[MB_PATH_MAXLINE];
-	char	swathfileread[MB_PATH_MAXLINE];
-	void	*datalist;
-	int	look_processed = MB_DATALIST_LOOK_UNSET;
-	int	oktoprocess;
-	double	file_weight;
-	int	format;
-	int	formatread;
-	int	variable_beams;
-	int	traveltime;
-	int	beam_flagging;
-	int	pings;
-	int	lonflip;
-	double	bounds[4];
-	int	btime_i[7];
-	int	etime_i[7];
-	double	btime_d;
-	double	etime_d;
-	double	speedmin;
-	double	timegap;
-	double	distance;
-	double	altitude;
-	double	sonardepth;
-	int	beams_bath;
-	int	beams_amp;
-	int	pixels_ss;
-	double	*amp;
-	double	*ss;
-	double	*ssacrosstrack;
-	double	*ssalongtrack;
-
-	/* mbio read and write values */
-	void	*mbio_ptr = NULL;
-	int	kind;
-	struct mbclean_ping_struct ping[3];
-	int	nrec, irec;
-	int	pingsread;
-	struct bad_struct bad[2];
-	int	find_bad;
-	int	nfiletot = 0;
-	int	ndatatot = 0;
-	int	ndepthrangetot = 0;
-	int	nminrangetot = 0;
-	int	nfractiontot = 0;
-	int	nspeedtot = 0;
-	int	nzeropostot = 0;
-	int	ndeviationtot = 0;
-	int	nouterbeamstot = 0;
-	int	nouterdistancetot = 0;
-	int	nrailtot = 0;
-	int     nlong_acrosstot=0; //2010/03/07 DY
-	int	nmintot = 0;
-	int	nbadtot = 0;
-	int	nspiketot = 0;
-	int	nflagtot = 0;
-	int	nunflagtot = 0;
-	int	nflagesftot = 0;
-	int	nunflagesftot = 0;
-	int	nzeroesftot = 0;
-	int	ndata = 0;
-	int	ndepthrange = 0;
-	int	nminrange = 0;
-	int	nfraction = 0;
-	int 	nspeed = 0;
-	int 	nzeropos = 0;
-	int 	nrangepos = 0;
-	int	ndeviation = 0;
-	int	nouterbeams = 0;
-	int	nouterdistance = 0;
-	int	nrail = 0;
-	int     nlong_across=0; //2010/03/07 DY
-	int     nmax_heading_rate=0; //2010/04/27 DY
-	int     nmax_heading_ratetot=0; //2010/04/27 DY
-	int	nmin = 0;
-	int	nbad = 0;
-	int	nspike = 0;
-	int	nflag = 0;
-	int	nunflag = 0;
-	int	nflagesf = 0;
-	int	nunflagesf = 0;
-	int	nzeroesf = 0;
-	char	comment[MB_COMMENT_MAXLINE];
-	int	check_slope = MB_NO;
-	double	slopemax = 1.0;
-	int	check_spike = MB_NO;
-	double	spikemax = 1.0;
-	int	spike_mode = 1;
-	int	slope_form = 0;
-	double	distancemin = 0.01;
-	double	distancemax = 0.25;
-	int	mode = MBCLEAN_FLAG_ONE;
-	int	zap_beams = MB_NO;
-	int	zap_beams_right = 0;
-	int	zap_beams_left = 0;
-	int	zap_distance = MB_NO;
-	double	zap_distance_right = 0.0;
-	double	zap_distance_left = 0.0;
-	int	zap_rails = MB_NO;
-	int     zap_long_across = MB_NO;  //2010/03/07 DY
-	int     zap_max_heading_rate = MB_NO;  //2010/04/27 DY
-	int	check_range = MB_NO;
-	double	depth_low;
-	double	depth_high;
-	int	check_range_min = MB_NO;
-	double	range_min;
-	int	check_fraction = MB_NO;
-	double	fraction_low;
-	double	fraction_high;
-	int	check_speed_good = MB_NO;
-	int	check_zero_position = MB_NO;
-	int	check_position_bounds = MB_NO;
-	double	speed_low;
-	double	speed_high;
-	double	west,east,south,north;
-	int	check_deviation = MB_NO;
-	double	deviation_max;
-	int	check_num_good_min = MB_NO;
-	int	num_good_min;
-	int	num_good;
-	int	action;
-
-	/* rail processing variables */
-	int	center;
-	double	lowdist; //2010/03/07 DY changed these to doubles
-	double	highdist;
-	double  backup_dist = 0; //2010/04/27 DY
-
-	/* max acrosstrack filter variable  2010/03/07 DY */
-	double max_acrosstrack = 120;
-
-	/* max heading_rate variable  2010/04/27 DY */
-	double max_heading_rate;
-	double last_heading = 0.0;
-	double last_time = 0.0;
-
-	/* slope processing variables */
-	double	mtodeglon;
-	double	mtodeglat;
-	double	headingx;
-	double	headingy;
-	int	nlist;
-	double	*list = NULL;
-	double	median = 0.0;
-	double	dd;
-	double	dd2;
-	double	slope;
-	double	slope2;
-
-	/* fix_edit_timestamps variables */
-	int	fix_edit_timestamps = MB_NO;
-	double	tolerance = 0.0;
-
-	/* save file control variables */
-	int	esffile_open = MB_NO;
-	char	esffile[MB_PATH_MAXLINE];
-	struct mb_esf_struct esf;
-
-	/* processing variables */
-	int	read_data;
-	int	start, done;
-	int	i, j, k, n, p, b;
-
-	/* get current default values */
-	status = mb_defaults(verbose,&format,&pings,&lonflip,bounds,
-		btime_i,etime_i,&speedmin,&timegap);
-	status = mb_uselockfiles(verbose,&uselockfiles);
-
-	/* reset all defaults but the format and lonflip */
-	pings = 1;
-	bounds[0] = -360.;
-	bounds[1] = 360.;
-	bounds[2] = -90.;
-	bounds[3] = 90.;
-	btime_i[0] = 1962;
-	btime_i[1] = 2;
-	btime_i[2] = 21;
-	btime_i[3] = 10;
-	btime_i[4] = 30;
-	btime_i[5] = 0;
-	btime_i[6] = 0;
-	etime_i[0] = 2062;
-	etime_i[1] = 2;
-	etime_i[2] = 21;
-	etime_i[3] = 10;
-	etime_i[4] = 30;
-	etime_i[5] = 0;
-	etime_i[6] = 0;
-	speedmin = 0.0;
-	timegap = 1000000000.0;
-	strcpy(read_file, "datalist.mb-1");
-
-	/* process argument list */
-	while ((c = getopt(argc, argv, "VvHhA:a:B:b:C:c:D:d:E:e:F:f:G:g:K:k:L:l:I:i:M:m:Q:q:P:p:R:r:S:s:T:t:U:u:W:w:X:x:Y:y:Zz")) != -1)
-	  {
-	    switch (c)
-		{
-		case 'H':
-		case 'h':
-			help++;
-			break;
-		case 'V':
-		case 'v':
-			verbose++;
-			break;
-		case 'A':
-		case 'a':
-			sscanf (optarg,"%lf", &deviation_max);
-			check_deviation = MB_YES;
-			flag++;
-			break;
-		case 'B':
-		case 'b':
-			sscanf (optarg,"%lf/%lf", &depth_low,&depth_high);
-			check_range = MB_YES;
-			flag++;
-			break;
-		case 'C':
-		case 'c':
-			slope_form = 0;
-			sscanf (optarg,"%lf/%d", &slopemax, &slope_form);
-			check_slope = MB_YES;
-			if (slope_form == 1)
-				slopemax = tan(slopemax);
-			else if (slope_form == 2)
-				slopemax = tan(DTR * slopemax);
-			flag++;
-			break;
-		case 'D':
-		case 'd':
-			sscanf (optarg,"%lf/%lf", &distancemin, &distancemax);
-			flag++;
-			break;
-		case 'E':                   //2010/03/07 DY added the max acrosstrack filter
-		case 'e':
-			sscanf (optarg,"%lf", &max_acrosstrack);
-			zap_long_across = MB_YES;
-			flag++;
-			break;
-		case 'F':
-		case 'f':
-			sscanf (optarg,"%d", &format);
-			flag++;
-			break;
-		case 'G':
-		case 'g':
-			sscanf (optarg,"%lf/%lf", &fraction_low,&fraction_high);
-			check_fraction = MB_YES;
-			flag++;
-			break;
-		case 'K':
-		case 'k':
-			sscanf (optarg,"%lf", &range_min);
-			check_range_min = MB_YES;
-			flag++;
-			break;	
-		case 'I':
-		case 'i':
-			sscanf (optarg,"%s", read_file);
-			flag++;
-			break;
-		case 'L':
-		case 'l':
-			sscanf (optarg,"%d", &lonflip);
-			flag++;
-			break;
-		case 'M':
-		case 'm':
-			sscanf (optarg,"%d", &mode);
-			flag++;
-			break;
-		case 'P':
-		case 'p':
-			sscanf (optarg,"%lf/%lf", &speed_low,&speed_high);
-			check_speed_good = MB_YES;
-			flag++;
-			break;
-		case 'Q':
-		case 'q':
-			zap_rails = MB_YES;
-			backup_dist = 0.0;
-			sscanf (optarg,"%lf", &backup_dist);
-			flag++;
-			break;
-		case 'R':
-		case 'r':
-			zap_max_heading_rate = MB_YES;
-			sscanf (optarg,"%lf", &max_heading_rate);
-			flag++;
-			break;
-		case 'S':
-		case 's':
-			slope_form = 0;
-			sscanf (optarg,"%lf/%d/%d", &spikemax, &spike_mode, &slope_form);
-			check_spike = MB_YES;
-			if (2 == slope_form)
-			  spikemax = tan(DTR * spikemax);
-			if (1 == slope_form)
-			  spikemax = tan(spikemax);
-			flag++;
-			break;
-		case 'T':
-		case 't':
-			fix_edit_timestamps = MB_YES;
-			sscanf (optarg,"%lf", &tolerance);
-			flag++;
-			break;
-		case 'U':
-		case 'u':
-			sscanf (optarg,"%d", &num_good_min);
-			check_num_good_min = MB_YES;
-			flag++;
-			break;
-		case 'W':
-		case 'w':
-			check_position_bounds = MB_YES;
-			sscanf (optarg,"%lf/%lf/%lf/%lf",&west,&east,&south,&north);
-			flag++;
-			break;
-		case 'X':
-		case 'x':
-			n = sscanf (optarg,"%d/%d", &zap_beams_left, &zap_beams_right);
-			if (n == 1)
-				zap_beams_right = zap_beams_left;
-			zap_beams = MB_YES;
-			flag++;
-			break;
-		case 'Y':
-		case 'y':
-			n = sscanf (optarg,"%lf/%lf", &zap_distance_left, &zap_distance_right);
-			if (n == 1)
-				zap_distance_right = zap_distance_left;
-			if (zap_distance_left > 0.0)
-				zap_distance_left = -zap_distance_left;
-			if (zap_distance_right < 0.0)
-				zap_distance_right = -zap_distance_right;
-			zap_distance = MB_YES;
-			flag++;
-			break;
-		case 'Z':
-		case 'z':
-			check_zero_position = MB_YES;
-			flag++;
-			break;
-		case '?':
-			errflg++;
-		}
-	  }
-
-	/* if error flagged then print it and exit */
-	if (errflg)
-		{
-		fprintf(stderr,"usage: %s\n", usage_message);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		error = MB_ERROR_BAD_USAGE;
-		exit(error);
-		}
-
-	/* turn on slope checking if nothing else is to be used */
-	if (check_slope == MB_NO
-		&& zap_beams == MB_NO
-		&& zap_distance == MB_NO
-		&& zap_rails == MB_NO
-		&& check_spike == MB_NO
-		&& check_range == MB_NO
-		&& check_fraction == MB_NO
-		&& check_speed_good == MB_NO
-		&& check_deviation == MB_NO
-		&& check_num_good_min == MB_NO
-		&& check_position_bounds == MB_NO
-		&& check_zero_position == MB_NO
-		&& fix_edit_timestamps == MB_NO)
-		check_slope = MB_YES;
-
-	/* print starting message */
-	if (verbose == 1 || help)
-		{
-		fprintf(stderr,"\nProgram %s\n",program_name);
-		fprintf(stderr,"Version %s\n",rcs_id);
-		fprintf(stderr,"MB-system Version %s\n",MB_VERSION);
-		}
-
-	/* print starting debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  Program <%s>\n",program_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Control Parameters:\n");
-		fprintf(stderr,"dbg2       verbose:              %d\n",verbose);
-		fprintf(stderr,"dbg2       help:                 %d\n",help);
-		fprintf(stderr,"dbg2       pings:                %d\n",pings);
-		fprintf(stderr,"dbg2       lonflip:              %d\n",lonflip);
-		fprintf(stderr,"dbg2       bounds[0]:            %f\n",bounds[0]);
-		fprintf(stderr,"dbg2       bounds[1]:            %f\n",bounds[1]);
-		fprintf(stderr,"dbg2       bounds[2]:            %f\n",bounds[2]);
-		fprintf(stderr,"dbg2       bounds[3]:            %f\n",bounds[3]);
-		fprintf(stderr,"dbg2       btime_i[0]:           %d\n",btime_i[0]);
-		fprintf(stderr,"dbg2       btime_i[1]:           %d\n",btime_i[1]);
-		fprintf(stderr,"dbg2       btime_i[2]:           %d\n",btime_i[2]);
-		fprintf(stderr,"dbg2       btime_i[3]:           %d\n",btime_i[3]);
-		fprintf(stderr,"dbg2       btime_i[4]:           %d\n",btime_i[4]);
-		fprintf(stderr,"dbg2       btime_i[5]:           %d\n",btime_i[5]);
-		fprintf(stderr,"dbg2       btime_i[6]:           %d\n",btime_i[6]);
-		fprintf(stderr,"dbg2       etime_i[0]:           %d\n",etime_i[0]);
-		fprintf(stderr,"dbg2       etime_i[1]:           %d\n",etime_i[1]);
-		fprintf(stderr,"dbg2       etime_i[2]:           %d\n",etime_i[2]);
-		fprintf(stderr,"dbg2       etime_i[3]:           %d\n",etime_i[3]);
-		fprintf(stderr,"dbg2       etime_i[4]:           %d\n",etime_i[4]);
-		fprintf(stderr,"dbg2       etime_i[5]:           %d\n",etime_i[5]);
-		fprintf(stderr,"dbg2       etime_i[6]:           %d\n",etime_i[6]);
-		fprintf(stderr,"dbg2       speedmin:             %f\n",speedmin);
-		fprintf(stderr,"dbg2       timegap:              %f\n",timegap);
-		fprintf(stderr,"dbg2       data format:          %d\n",format);
-		fprintf(stderr,"dbg2       input file:           %s\n",read_file);
-		fprintf(stderr,"dbg2       mode:                 %d\n",mode);
-		fprintf(stderr,"dbg2       zap_beams:            %d\n",zap_beams);
-		fprintf(stderr,"dbg2       zap_beams_left:       %d\n",zap_beams_left);
-		fprintf(stderr,"dbg2       zap_beams_right:      %d\n",zap_beams_right);
-		fprintf(stderr,"dbg2       zap_distance:         %d\n",zap_distance);
-		fprintf(stderr,"dbg2       zap_distance_left:    %f\n",zap_distance_left);
-		fprintf(stderr,"dbg2       zap_distance_right:   %f\n",zap_distance_right);
-		fprintf(stderr,"dbg2       zap_rails:            %d\n",zap_rails);
-		fprintf(stderr,"dbg2       backup_dist:          %f\n",backup_dist);
-		fprintf(stderr,"dbg2       zap_max_heading_rate: %d\n",zap_max_heading_rate);
-		fprintf(stderr,"dbg2       max_heading_rate:     %f\n",max_heading_rate);
-		fprintf(stderr,"dbg2       check_slope:          %d\n",check_slope);
-		fprintf(stderr,"dbg2       maximum slope:        %f\n",slopemax);
-		fprintf(stderr,"dbg2       check_spike:          %d\n",check_spike);
-		fprintf(stderr,"dbg2       maximum spike:        %f\n",spikemax);
-		fprintf(stderr,"dbg2       spike mode:           %d\n",spike_mode);
-		fprintf(stderr,"dbg2       minimum dist:         %f\n",distancemin);
-		fprintf(stderr,"dbg2       minimum dist:         %f\n",distancemax);
-		fprintf(stderr,"dbg2       check_range:          %d\n",check_range);
-		fprintf(stderr,"dbg2       depth_low:            %f\n",depth_low);
-		fprintf(stderr,"dbg2       depth_high:           %f\n",depth_high);
-		fprintf(stderr,"dbg2       check_fraction:       %d\n",check_fraction);
-		fprintf(stderr,"dbg2       fraction_low:         %f\n",fraction_low);
-		fprintf(stderr,"dbg2       fraction_high:        %f\n",fraction_high);
-		fprintf(stderr,"dbg2       check_deviation:      %d\n",check_deviation);
-		fprintf(stderr,"dbg2       check_num_good_min:   %d\n",check_num_good_min);
-		fprintf(stderr,"dbg2       num_good_min:         %d\n",num_good_min);
-		fprintf(stderr,"dbg2       zap_long_across:      %d\n",zap_long_across);
-		fprintf(stderr,"dbg2       max_acrosstrack:      %f\n",max_acrosstrack);
-		fprintf(stderr,"dbg2       fix_edit_timestamps:  %d\n",fix_edit_timestamps);
-		fprintf(stderr,"dbg2       tolerance:            %f\n",tolerance);
-		fprintf(stderr,"dbg2       check_speed_good:     %d\n",check_speed_good);
-		fprintf(stderr,"dbg2       speed_low:            %f\n",speed_low);
-		fprintf(stderr,"dbg2       speed_high:           %f\n",speed_high);
-		fprintf(stderr,"dbg2       check_position_bounds:%d\n",check_position_bounds);
-		fprintf(stderr,"dbg2       check_zero_position:  %d\n",check_zero_position);
-		}
-
-	/* if help desired then print it and exit */
-	if (help)
-		{
-		fprintf(stderr,"\n%s\n",help_message);
-		fprintf(stderr,"\nusage: %s\n", usage_message);
-		exit(error);
-		}
-
-	/* get format if required */
-	if (format == 0)
-		mb_get_format(verbose,read_file,NULL,&format,&error);
-
-	/* determine whether to read one file or a list of files */
-	if (format < 0)
-		read_datalist = MB_YES;
-
-	/* open file list */
-	if (read_datalist == MB_YES)
-	    {
-	    if ((status = mb_datalist_open(verbose,&datalist,
-					    read_file,look_processed,&error)) != MB_SUCCESS)
-		{
-		error = MB_ERROR_OPEN_FAIL;
-		fprintf(stderr,"\nUnable to open data list file: %s\n",
-			read_file);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-	    if ((status = mb_datalist_read(verbose,datalist,
-			    swathfile,&format,&file_weight,&error))
-			    == MB_SUCCESS)
-		read_data = MB_YES;
-	    else
-		read_data = MB_NO;
-	    }
-	/* else copy single filename to be read */
-	else
-	    {
-	    strcpy(swathfile, read_file);
-	    read_data = MB_YES;
-	    }
-
-	/* loop over all files to be read */
-	while (read_data == MB_YES)
-		{
-		oktoprocess = MB_YES;
-
-		/* check format and get format flags */
-		if ((status = mb_format_flags(verbose,&format,
-				&variable_beams, &traveltime, &beam_flagging,
-				&error))
-			!= MB_SUCCESS)
-			{
-			mb_error(verbose,error,&message);
-			fprintf(stderr,"\nMBIO Error returned from function <mb_format_flags> regarding input format %d:\n%s\n",format,message);
-			fprintf(stderr,"\nFile <%s> skipped by program <%s>\n", swathfile,program_name);
-			oktoprocess = MB_NO;
-			status = MB_SUCCESS;
-			error = MB_ERROR_NO_ERROR;
-			}
-
-		/* warn if beam flagging not supported for the current data format */
-		if (beam_flagging == MB_NO)
-			{
-			fprintf(stderr,"\nWarning:\nMBIO format %d does not allow flagging of bad bathymetry data.\n",format);
-			fprintf(stderr,"\nWhen mbprocess applies edits to file:\n\t%s\nthe soundings will be nulled (zeroed) rather than flagged.\n",
-				swathfile);
-			}
-
-		/* try to lock file */
-		if (uselockfiles == MB_YES)
-			status = mb_pr_lockswathfile(verbose, swathfile,
-					MBP_LOCK_EDITBATHY, program_name, &error);
-		else
-		    	{
-			lock_status = mb_pr_lockinfo(verbose, swathfile, &locked,
-					&lock_purpose, lock_program, lock_user, lock_cpu, lock_date, &error);
-
-			/* if locked get lock info */
-			if (error == MB_ERROR_FILE_LOCKED)
-				{
-				fprintf(stderr, "\nFile %s locked but lock ignored\n", swathfile);
-				fprintf(stderr, "File locked by <%s> running <%s>\n", lock_user, lock_program);
-				fprintf(stderr, "on cpu <%s> at <%s>\n", lock_cpu, lock_date);
-				error = MB_ERROR_NO_ERROR;
-				}
-			}
-
-		/* if locked let the user know file can't be opened */
-		if (status == MB_FAILURE)
-			{
-			/* if locked get lock info */
-			if (error == MB_ERROR_FILE_LOCKED)
-				{
-				lock_status = mb_pr_lockinfo(verbose, swathfile, &locked,
-						&lock_purpose, lock_program, lock_user, lock_cpu,
-						lock_date, &error);
-
-				fprintf(stderr, "\nUnable to open input file:\n");
-				fprintf(stderr, "  %s\n", swathfile);
-				fprintf(stderr, "File locked by <%s> running <%s>\n", lock_user, lock_program);
-				fprintf(stderr, "on cpu <%s> at <%s>\n", lock_cpu, lock_date);
-				}
-
-			/* else if unable to create lock file there is a permissions problem */
-			else if (error == MB_ERROR_OPEN_FAIL)
-				{
-				fprintf(stderr, "Unable to create lock file\n");
-				fprintf(stderr, "for intended input file:\n");
-				fprintf(stderr, "  %s\n", swathfile);
-				fprintf(stderr, "-Likely permissions issue\n");
-				}
-
-			/* reset error and status */
-			oktoprocess = MB_NO;
-			status = MB_SUCCESS;
-			error = MB_ERROR_NO_ERROR;
-			}
-
-		/* proceed if file locked and format ok */
-		if (oktoprocess == MB_YES)
-			{
-			/* check for "fast bathymetry" or "fbt" file */
-			strcpy(swathfileread, swathfile);
-			formatread = format;
-			mb_get_fbt(verbose, swathfileread, &formatread, &error);
-
-			/* initialize reading the input swath sonar file */
-			if ((status = mb_read_init(
-				verbose,swathfileread,formatread,pings,lonflip,bounds,
-				btime_i,etime_i,speedmin,timegap,
-				&mbio_ptr,&btime_d,&etime_d,
-				&beams_bath,&beams_amp,&pixels_ss,&error)) != MB_SUCCESS)
-				{
-				mb_error(verbose,error,&message);
-				fprintf(stderr,"\nMBIO Error returned from function <mb_read_init>:\n%s\n",message);
-				fprintf(stderr,"\nMultibeam File <%s> not initialized for reading\n",swathfile);
-				fprintf(stderr,"\nProgram <%s> Terminated\n",
-					program_name);
-				exit(error);
-				}
-
-			/* initialize and increment counting variables */
-			ndata = 0;
-			ndepthrange = 0;
-			nminrange = 0;
-			nfraction = 0;
-			nspeed = 0;
-			nzeropos = 0;
-			nrangepos = 0;
-			ndeviation = 0;
-			nouterbeams = 0;
-			nouterdistance = 0;
-			nrail = 0;
-			nlong_across=0; //2010/03/07 DY
-			nmin = 0;
-			nbad = 0;
-			nspike = 0;
-			nflag = 0;
-			nunflag = 0;
-			nflagesf = 0;
-			nunflagesf = 0;
-			nzeroesf = 0;
-
-			/* give the statistics */
-			if (verbose >= 0)
-				{
-				fprintf(stderr,"\nProcessing %s\n",swathfileread);
-				}
-
-			/* allocate memory for data arrays */
-			for (i=0;i<3;i++)
-				{
-				ping[i].beamflag = NULL;
-				ping[i].beamflagorg = NULL;
-				ping[i].bath = NULL;
-				ping[i].bathacrosstrack = NULL;
-				ping[i].bathalongtrack = NULL;
-				ping[i].bathx = NULL;
-				ping[i].bathy = NULL;
-				if (error == MB_ERROR_NO_ERROR)
-					status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-									sizeof(char), (void **)&ping[i].beamflag, &error);
-				if (error == MB_ERROR_NO_ERROR)
-					status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-									sizeof(char), (void **)&ping[i].beamflagorg, &error);
-				if (error == MB_ERROR_NO_ERROR)
-					status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-									sizeof(double), (void **)&ping[i].bath, &error);
-				if (error == MB_ERROR_NO_ERROR)
-					status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-									sizeof(double), (void **)&ping[i].bathacrosstrack, &error);
-				if (error == MB_ERROR_NO_ERROR)
-					status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-									sizeof(double), (void **)&ping[i].bathalongtrack, &error);
-				if (error == MB_ERROR_NO_ERROR)
-					status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-									sizeof(double), (void **)&ping[i].bathx, &error);
-				if (error == MB_ERROR_NO_ERROR)
-					status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-									sizeof(double), (void **)&ping[i].bathy, &error);
-				}
-			amp = NULL;
-			ss = NULL;
-			ssacrosstrack = NULL;
-			ssalongtrack = NULL;
-			list = NULL;
-			if (error == MB_ERROR_NO_ERROR)
-				status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_AMPLITUDE,
-								sizeof(double), (void **)&amp, &error);
-			if (error == MB_ERROR_NO_ERROR)
-				status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_SIDESCAN,
-								sizeof(double), (void **)&ss, &error);
-			if (error == MB_ERROR_NO_ERROR)
-				status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_SIDESCAN,
-								sizeof(double), (void **)&ssacrosstrack, &error);
-			if (error == MB_ERROR_NO_ERROR)
-				status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_SIDESCAN,
-								sizeof(double), (void **)&ssalongtrack, &error);
-			if (error == MB_ERROR_NO_ERROR)
-				status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-								4 * sizeof(double), (void **)&list, &error);
-
-			/* if error initializing memory then quit */
-			if (error != MB_ERROR_NO_ERROR)
-				{
-				mb_error(verbose,error,&message);
-				fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",message);
-				fprintf(stderr,"\nProgram <%s> Terminated\n",
-					program_name);
-				exit(error);
-				}
-
-			/* now deal with old edit save file */
-			if (status == MB_SUCCESS)
-			    {
-			    /* reset message */
-			    fprintf(stderr, "Sorting old edits...\n");
-
-			    /* handle esf edits */
-			    status = mb_esf_load(verbose, swathfile,
-					    MB_YES, MB_YES, esffile, &esf, &error);
-			    if (status == MB_SUCCESS
-				    && esf.esffp != NULL)
-				    esffile_open = MB_YES;
-			    if (status == MB_FAILURE
-				    && error == MB_ERROR_OPEN_FAIL)
-				    {
-				    esffile_open = MB_NO;
-				    fprintf(stderr, "\nUnable to open new edit save file %s\n",
-					esf.esffile);
-				    }
-			    else if (status == MB_FAILURE
-				    && error == MB_ERROR_MEMORY_FAIL)
-				    {
-				    esffile_open = MB_NO;
-				    fprintf(stderr, "\nUnable to allocate memory for edits in esf file %s\n", esf.esffile);
-				    }
-			    /* reset message */
-			    fprintf(stderr, "%d old edits sorted...\n",esf.nedit);
-			    }
-
-			/* read */
-			done = MB_NO;
-			start = 0;
-			nrec = 0;
-			fprintf(stderr, "Processing data...\n");
-			while (done == MB_NO)
-			    {
-			    if (verbose > 1) fprintf(stderr,"\n");
-
-			    /* read next record */
-			    error = MB_ERROR_NO_ERROR;
-			    status = mb_get(verbose,
-					    mbio_ptr,&kind,&pingsread,
-					    ping[nrec].time_i,&ping[nrec].time_d,
-					    &ping[nrec].navlon,&ping[nrec].navlat,
-					    &ping[nrec].speed,&ping[nrec].heading,
-					    &distance,&altitude,&sonardepth,
-					    &ping[nrec].beams_bath,&beams_amp,&pixels_ss,
-					    ping[nrec].beamflag,ping[nrec].bath,amp,
-					    ping[nrec].bathacrosstrack,ping[nrec].bathalongtrack,
-					    ss,ssacrosstrack,ssalongtrack,
-					    comment,
-					    &error);
-			    if (verbose >= 2)
-				{
-				fprintf(stderr,"\ndbg2  current data status:\n");
-				fprintf(stderr,"dbg2    kind:           %d\n",kind);
-				fprintf(stderr,"dbg2    status:         %d\n",status);
-				fprintf(stderr,"dbg2    ndata:          %d\n",ndata);
-				fprintf(stderr,"dbg2    nrec:           %d\n",nrec);
-				fprintf(stderr,"dbg2    nflagesf:       %d\n",nflagesf);
-				fprintf(stderr,"dbg2    nunflagesf:     %d\n",nunflagesf);
-				fprintf(stderr,"dbg2    nzeroesf:       %d\n",nzeroesf);
-				fprintf(stderr,"dbg2    nouterbeams:    %d\n",nouterbeams);
-				fprintf(stderr,"dbg2    nouterdistance: %d\n",nouterdistance);
-				fprintf(stderr,"dbg2    nmin:           %d\n",nmin);
-				fprintf(stderr,"dbg2    ndepthrange:    %d\n",ndepthrange);
-				fprintf(stderr,"dbg2    nminrange:      %d\n",nminrange);
-				fprintf(stderr,"dbg2    nfraction:      %d\n",nfraction);
-				fprintf(stderr,"dbg2    nspeed:         %d\n",nspeed);
-				fprintf(stderr,"dbg2    nzeropos:       %d\n",nzeropos);
-				fprintf(stderr,"dbg2    nrangepos:      %d\n",nrangepos);
-				fprintf(stderr,"dbg2    ndeviation:     %d\n",ndeviation);
-				fprintf(stderr,"dbg2    nrail:          %d\n",nrail);
-				fprintf(stderr,"dbg2    nlong_across:   %d\n",nlong_across);
-				fprintf(stderr,"dbg2    nbad:           %d\n",nbad);
-				fprintf(stderr,"dbg2    npike;          %d\n",nspike);
-				fprintf(stderr,"dbg2    nflag:          %d\n",nflag);
-				fprintf(stderr,"dbg2    nunflag:        %d\n",nunflag);
-				}
-			    if (status == MB_SUCCESS && kind == MB_DATA_DATA)
-				{
-				/* check for multiple pings with the same time stamps */
-				if (nrec > 0 && ping[nrec].time_d == ping[nrec-1].time_d)
-					{
-					ping[nrec].multiplicity = ping[nrec-1].multiplicity + 1;
-					}
-				else
-					{
-					ping[nrec].multiplicity = 0;
-					}
-
-				/* save original beamflags */
-				for (i=0;i<ping[nrec].beams_bath;i++)
-					{
-					ping[nrec].beamflagorg[i] = ping[nrec].beamflag[i];
-					}
-
-				/* get locations of data points in local coordinates */
-				mb_coor_scale(verbose,ping[nrec].navlat,
-						    &mtodeglon,&mtodeglat);
-				headingx = sin(ping[nrec].heading*DTR);
-				headingy = cos(ping[nrec].heading*DTR);
-				for (j=0;j<=nrec;j++)
-					{
-					for (i=0;i<ping[j].beams_bath;i++)
-						{
-						ping[j].bathx[i] = (ping[j].navlon - ping[0].navlon) / mtodeglon
-							+ headingy * ping[j].bathacrosstrack[i]
-							+ headingx * ping[j].bathalongtrack[i];
-						ping[j].bathy[i] = (ping[j].navlat - ping[0].navlat) / mtodeglat
-							- headingx * ping[j].bathacrosstrack[i]
-							+ headingy * ping[j].bathalongtrack[i];
-						}
-					}
-				if (verbose >= 2)
-					{
-					fprintf(stderr,"\ndbg2  beam locations (ping:beam xxx.xxx yyy.yyy)\n");
-					for (j=0;j<=nrec;j++)
-						for (i=0;i<ping[j].beams_bath;i++)
-							{
-							fprintf(stderr,"dbg2    %d:%3.3d %10.3f %10.3f\n",
-									j, i, ping[j].bathx[i], ping[j].bathy[i]);
-							}
-					}
-
-				/* if requested set all edit timestamps within tolerance of
-					ping[nrec].time_d to ping[nrec].time_d */
-				status = mb_esf_fixtimestamps(verbose, &esf,
-		    				ping[nrec].time_d, tolerance, &error);
-
-				/* apply saved edits */
-				status = mb_esf_apply(verbose, &esf,
-		    				ping[nrec].time_d, ping[nrec].multiplicity, ping[nrec].beams_bath,
-						ping[nrec].beamflag, &error);
-
-				/* update counters */
-				for (i=0;i<ping[nrec].beams_bath;i++)
-					{
-					if (ping[nrec].beamflag[i] != ping[nrec].beamflagorg[i])
-						{
-						if (mb_beam_ok(ping[nrec].beamflag[i]))
-						    nunflagesf++;
-						else
-						    nflagesf++;
-						}
-					}
-				ndata++;
-				nrec++;
-				}
-			    else if (error > MB_ERROR_NO_ERROR)
-				{
-				done = MB_YES;
-				}
-
-			    /* process a record */
-			    if (nrec > 0)
-				{
-				/* get record to process */
-				if (nrec >= 2)
-					irec = 1;
-				else if (nrec == 1)
-					irec = 0;
-
-				/* get center beam */
-				center = ping[irec].beams_bath / 2;
-
-				/* zap outer beams by number if requested */
-				if (zap_beams == MB_YES)
-					{
-					for (i=0;i<MIN(zap_beams_left, center);i++)
-						{
-						if (mb_beam_ok(ping[irec].beamflag[i]))
-							{
-							find_bad = MB_YES;
-							if (verbose >= 1)
-							fprintf(stderr,"x: %4d %2d %2d %2.2d:%2.2d:%2.2d.%6.6d  %4d %8.2f\n",
-									ping[irec].time_i[0],
-									ping[irec].time_i[1],
-									ping[irec].time_i[2],
-									ping[irec].time_i[3],
-									ping[irec].time_i[4],
-									ping[irec].time_i[5],
-									ping[irec].time_i[6],
-									i,ping[irec].bath[i]);
-							ping[irec].beamflag[i]
-								    = MB_FLAG_FLAG + MB_FLAG_FILTER;
-							nouterbeams++;
-							nflag++;
-							mb_ess_save(verbose, &esf, ping[irec].time_d,
-									i + ping[irec].multiplicity * MB_ESF_MULTIPLICITY_FACTOR,
-									MBP_EDIT_FILTER, &error);
-							}
-						}
-					for (i=0;i<MIN(zap_beams_right, center);i++)
-						{
-						j = ping[irec].beams_bath - i - 1;
-						if (mb_beam_ok(ping[irec].beamflag[j]))
-							{
-							find_bad = MB_YES;
-							if (verbose >= 1)
-							fprintf(stderr,"x: %4d %2d %2d %2.2d:%2.2d:%2.2d.%6.6d  %4d %8.2f\n",
-									ping[irec].time_i[0],
-									ping[irec].time_i[1],
-									ping[irec].time_i[2],
-									ping[irec].time_i[3],
-									ping[irec].time_i[4],
-									ping[irec].time_i[5],
-									ping[irec].time_i[6],
-									j,ping[irec].bath[j]);
-							ping[irec].beamflag[j]
-							    = MB_FLAG_FLAG + MB_FLAG_FILTER;
-							nouterbeams++;
-							nflag++;
-							mb_ess_save(verbose, &esf, ping[irec].time_d,
-									j + ping[irec].multiplicity * MB_ESF_MULTIPLICITY_FACTOR,
-									MBP_EDIT_FILTER, &error);
-							}
-						}
-					}
-
-				/* zap outer beams by distance if requested */
-				if (zap_distance == MB_YES)
-					{
-					for (i=0;i<ping[irec].beams_bath;i++)
-						{
-						if (mb_beam_ok(ping[irec].beamflag[i])
-							&& (ping[irec].bathacrosstrack[i] <= zap_distance_left
-							|| ping[irec].bathacrosstrack[i] >= zap_distance_right))
-							{
-							find_bad = MB_YES;
-							if (verbose >= 1)
-							fprintf(stderr,"y: %4d %2d %2d %2.2d:%2.2d:%2.2d.%6.6d  %4d %8.2f\n",
-									ping[irec].time_i[0],
-									ping[irec].time_i[1],
-									ping[irec].time_i[2],
-									ping[irec].time_i[3],
-									ping[irec].time_i[4],
-									ping[irec].time_i[5],
-									ping[irec].time_i[6],
-									i,ping[irec].bath[i]);
-							ping[irec].beamflag[i]
-								    = MB_FLAG_FLAG + MB_FLAG_FILTER;
-							nouterdistance++;
-							nflag++;
-							mb_ess_save(verbose, &esf, ping[irec].time_d,
-									i + ping[irec].multiplicity * MB_ESF_MULTIPLICITY_FACTOR,
-									MBP_EDIT_FILTER, &error);
-							}
-						}
-					}
-
-				/* check for speed range if requested */
-				if(check_speed_good == MB_YES)
-					{
-					if (ping[irec].speed > speed_high || ping[irec].speed < speed_low)
-						{
-						if (verbose >= 1)
-							fprintf(stderr,"p: %4d %2d %2d %2.2d:%2.2d:%2.2d.%6.6d  %4d %8.2f\n",
-								ping[irec].time_i[0],
-								ping[irec].time_i[1],
-								ping[irec].time_i[2],
-								ping[irec].time_i[3],
-								ping[irec].time_i[4],
-								ping[irec].time_i[5],
-								ping[irec].time_i[6],
-								i,ping[irec].speed);
-						for (i=0;i<ping[irec].beams_bath;i++)
-							{
-							find_bad = MB_YES;
-							ping[irec].beamflag[i] = MB_FLAG_FLAG + MB_FLAG_FILTER;
-							nspeed++;
-							nflag++;
-							mb_ess_save(verbose, &esf, ping[irec].time_d, 
-									i + ping[irec].multiplicity * MB_ESF_MULTIPLICITY_FACTOR, 
-									MBP_EDIT_FILTER, &error);
-							}
-						}
-					}
-
-				/* check for range latitude and longitude if requested */
-				if(check_position_bounds == MB_YES)
-					{
-					if (ping[irec].navlon<west || ping[irec].navlon>east ||  ping[irec].navlat<south || ping[irec].navlat>north)
-						{
-						if (verbose >= 1)
-							fprintf(stderr,"w: %4d %2d %2d %2.2d:%2.2d:%2.2d.%6.6d  %4d %f %f\n",
-							ping[irec].time_i[0],
-							ping[irec].time_i[1],
-							ping[irec].time_i[2],
-							ping[irec].time_i[3],
-							ping[irec].time_i[4],
-							ping[irec].time_i[5],
-							ping[irec].time_i[6],
-							i,mtodeglon,mtodeglat);
-						for (i=0;i<ping[irec].beams_bath;i++)
-							{
-							find_bad = MB_YES;
-							ping[irec].beamflag[i] = MB_FLAG_NULL;
-							nrangepos++;
-							nflag++;
-							mb_ess_save(verbose, &esf, ping[irec].time_d,
-								i + ping[irec].multiplicity * MB_ESF_MULTIPLICITY_FACTOR,
-								MBP_EDIT_ZERO, &error);
-							}
-						}
-					}
-
-				/* check for zero latitude and longitude if requested */
-				if(check_zero_position == MB_YES)
-					{
-					if (ping[irec].navlon==0.0 && ping[irec].navlat==0.0)
-						{
-						if (verbose >= 1)
-							fprintf(stderr,"z: %4d %2d %2d %2.2d:%2.2d:%2.2d.%6.6d  %4d %f %f\n",
-								ping[irec].time_i[0],
-								ping[irec].time_i[1],
-								ping[irec].time_i[2],
-								ping[irec].time_i[3],
-								ping[irec].time_i[4],
-								ping[irec].time_i[5],
-								ping[irec].time_i[6],
-								i,mtodeglon,mtodeglat);
-						for (i=0;i<ping[irec].beams_bath;i++)
-							{
-							find_bad = MB_YES;
-							ping[irec].beamflag[i] = MB_FLAG_NULL;
-							nzeropos++;
-							nflag++;
-							mb_ess_save(verbose, &esf, ping[irec].time_d, 
-										i + ping[irec].multiplicity * MB_ESF_MULTIPLICITY_FACTOR, 
-										MBP_EDIT_ZERO, &error);
-							}
-						}
-					}
-					
-				/* check depths for acceptable range if requested */
-				if (check_range == MB_YES)
-					{
-					for (i=0;i<ping[irec].beams_bath;i++)
-						{
-						if (mb_beam_ok(ping[irec].beamflag[i])
-							&& (ping[irec].bath[i] < depth_low ||
-								ping[irec].bath[i] > depth_high))
-							{
-							if (verbose >= 1)
-							fprintf(stderr,"b: %4d %2d %2d %2.2d:%2.2d:%2.2d.%6.6d  %4d %8.2f\n",
-								ping[irec].time_i[0],
-								ping[irec].time_i[1],
-								ping[irec].time_i[2],
-								ping[irec].time_i[3],
-								ping[irec].time_i[4],
-								ping[irec].time_i[5],
-								ping[irec].time_i[6],
-								i,ping[irec].bath[i]);
-							find_bad = MB_YES;
-							ping[irec].beamflag[i] = MB_FLAG_FLAG + MB_FLAG_FILTER;
-							ndepthrange++;
-							nflag++;
-    
-							mb_ess_save(verbose, &esf, ping[irec].time_d,
-									i + ping[irec].multiplicity * MB_ESF_MULTIPLICITY_FACTOR,
-									MBP_EDIT_FILTER, &error);
-							}
-						}
-					}
-					
-				/* check depths for minimum range if requested (replacement for Dana Yoerger test) */
-				if (check_range_min == MB_YES)
-					{
-					for (i=0;i<ping[irec].beams_bath;i++)
-						{
-						if (mb_beam_ok(ping[irec].beamflag[i])
-							&& sqrt(ping[irec].bathacrosstrack[i] * ping[irec].bathacrosstrack[i]
-									+ ping[irec].bathalongtrack[i] * ping[irec].bathalongtrack[i]
-									+ (ping[irec].bath[i] - sonardepth)
-										* (ping[irec].bath[i] - sonardepth))
-								< range_min)
-							{
-							if (verbose >= 1)
-							fprintf(stderr,"k: %4d %2d %2d %2.2d:%2.2d:%2.2d.%6.6d  %4d %8.2f\n",
-								ping[irec].time_i[0],
-								ping[irec].time_i[1],
-								ping[irec].time_i[2],
-								ping[irec].time_i[3],
-								ping[irec].time_i[4],
-								ping[irec].time_i[5],
-								ping[irec].time_i[6],
-								i,ping[irec].bath[i]);
-							find_bad = MB_YES;
-							ping[irec].beamflag[i] = MB_FLAG_FLAG + MB_FLAG_FILTER;
-							nminrange++;
-							nflag++;
-							mb_ess_save(verbose, &esf, ping[irec].time_d,
-									i + ping[irec].multiplicity * MB_ESF_MULTIPLICITY_FACTOR,
-									MBP_EDIT_FILTER, &error);
-							}
-						}
-					}
-
-				/* check for max heading rate if requested */
-				if (zap_max_heading_rate == MB_YES)
-					{
-					double dh, heading_rate;
-					dh = (ping[irec].heading-last_heading);
-					if(dh > 180)dh -=360;
-					if(dh < -180)dh +=360;
-					heading_rate = dh/(ping[irec].time_d-last_time);
-					//printf("heading rate is: %f\n",heading_rate);
-  
-					last_time = ping[irec].time_d;
-					last_heading = ping[irec].heading;
-					for (i=0;i<ping[irec].beams_bath;i++)
-						{
-						if (fabs(heading_rate) > max_heading_rate)
-							{
-							if (verbose >= 1)
-							fprintf(stderr,"r: %4d %2d %2d %2.2d:%2.2d:%2.2d.%6.6d  %4d %8.2f\n",
-								ping[irec].time_i[0],
-								ping[irec].time_i[1],
-								ping[irec].time_i[2],
-								ping[irec].time_i[3],
-								ping[irec].time_i[4],
-								ping[irec].time_i[5],
-								ping[irec].time_i[6],
-								i,ping[irec].bath[i]);
-							find_bad = MB_YES;
-							ping[irec].beamflag[i] = MB_FLAG_FLAG + MB_FLAG_FILTER;
-							nmax_heading_rate++;
-							nflag++;
-							mb_ess_save(verbose, &esf, ping[irec].time_d,
-									i + ping[irec].multiplicity * MB_ESF_MULTIPLICITY_FACTOR,
-									MBP_EDIT_FILTER, &error);
-							}
-						}
-					}
-
-				/* zap rails if requested */
-				if (zap_rails == MB_YES)
-					{
-					/* flag all beams with acrosstrack distance less than the maximum out to that beam */
-					lowdist = 0.0;
-					highdist = 0.0;
-
-					for (j=center;j<ping[irec].beams_bath;j++)
-						{
-						if (mb_beam_ok(ping[irec].beamflag[j])
-							&& ping[irec].bathacrosstrack[j] <= highdist - backup_dist)
-							{
-							if (verbose >= 1)
-							fprintf(stderr,"q: %4d %2d %2d %2.2d:%2.2d:%2.2d.%6.6d  %4d %8.2f\n",
-								ping[irec].time_i[0],
-								ping[irec].time_i[1],
-								ping[irec].time_i[2],
-								ping[irec].time_i[3],
-								ping[irec].time_i[4],
-								ping[irec].time_i[5],
-								ping[irec].time_i[6],
-								i,ping[irec].bath[i]);
-							find_bad = MB_YES;
-							ping[irec].beamflag[j] = MB_FLAG_FLAG + MB_FLAG_FILTER;
-							nrail++;
-							nflag++;
-							mb_ess_save(verbose, &esf, ping[irec].time_d,
-									j + ping[irec].multiplicity * MB_ESF_MULTIPLICITY_FACTOR,
-									MBP_EDIT_FILTER, &error);
-							}
-						else
-							highdist = ping[irec].bathacrosstrack[j];
-
-						k = center - (j - center) - 1;
-						if (mb_beam_ok(ping[irec].beamflag[k])
-							&& ping[irec].bathacrosstrack[k] >= lowdist + backup_dist)
-							{
-							find_bad = MB_YES;
-							if (verbose >= 1)
-							fprintf(stderr,"q: %4d %2d %2d %2.2d:%2.2d:%2.2d.%6.6d  %4d %8.2f\n",
-								ping[irec].time_i[0],
-								ping[irec].time_i[1],
-								ping[irec].time_i[2],
-								ping[irec].time_i[3],
-								ping[irec].time_i[4],
-								ping[irec].time_i[5],
-								ping[irec].time_i[6],
-								i,ping[irec].bath[i]);
-							ping[irec].beamflag[k] = MB_FLAG_FLAG + MB_FLAG_FILTER;
-							nrail++;
-							nflag++;
-							mb_ess_save(verbose, &esf, ping[irec].time_d,
-									k + ping[irec].multiplicity * MB_ESF_MULTIPLICITY_FACTOR,
-									MBP_EDIT_FILTER, &error);
-							}
-						else
-							lowdist = ping[irec].bathacrosstrack[k];
-						}
-					/* printf("%d %d xtrack: %.2f lowdist=%.2lf %d\n",irec,k,ping[irec].bathacrosstrack[k],
-						lowdist,ping[irec].beamflag[k]); */
-
-					} // if zap_rails==yes
-					
-				/* zap long acrosstrack if requested */
-				if (zap_long_across == MB_YES)
-					{
-					for (j=0;j<ping[irec].beams_bath;j++)
-						{
-						if (mb_beam_ok(ping[irec].beamflag[j])
-							&& fabs(ping[irec].bathacrosstrack[j]) > max_acrosstrack)
-							{
-							find_bad = MB_YES;
-							if (verbose >= 1)
-							fprintf(stderr,"e: %4d %2d %2d %2.2d:%2.2d:%2.2d.%6.6d  %4d %8.2f\n",
-								ping[irec].time_i[0],
-								ping[irec].time_i[1],
-								ping[irec].time_i[2],
-								ping[irec].time_i[3],
-								ping[irec].time_i[4],
-								ping[irec].time_i[5],
-								ping[irec].time_i[6],
-								i,ping[irec].bath[i]);
-							ping[irec].beamflag[j] = MB_FLAG_FLAG + MB_FLAG_FILTER;
-							nlong_across++;
-							nflag++;
-							mb_ess_save(verbose, &esf, ping[irec].time_d,
-									j + ping[irec].multiplicity * MB_ESF_MULTIPLICITY_FACTOR,
-									MBP_EDIT_FILTER, &error);
-							}
-						}
-					}
-
-				/* do tests that require looping over all available beams */
-				if (check_fraction == MB_YES
-				    || check_deviation == MB_YES
-				    || check_spike == MB_YES
-				    || check_slope == MB_YES)
-				    {
-				    for (i=0;i<ping[irec].beams_bath;i++)
-					{
-					if (mb_beam_ok(ping[irec].beamflag[i]))
-					    {
-					    /* get local median value from all available records */
-					    if (median <= 0.0)
-						median = ping[irec].bath[i];
-					    nlist = 0;
-					    for (j=0;j<nrec;j++)
-						{
-						for (k=0;k<ping[j].beams_bath;k++)
-						    {
-						    if (mb_beam_ok(ping[j].beamflag[k]))
-							{
-							dd = sqrt((ping[j].bathx[k]
-									- ping[irec].bathx[i])
-								    * (ping[j].bathx[k]
-									- ping[irec].bathx[i])
-								+ (ping[j].bathy[k]
-									- ping[irec].bathy[i])
-								    * (ping[j].bathy[k]
-									- ping[irec].bathy[i]));
-							if (dd <= distancemax * median)
-							    {
-							    list[nlist] = ping[j].bath[k];
-							    nlist++;
-							    }
-							}
-						    }
-						}
-					    qsort((char *)list,nlist,sizeof(double),(void *)mb_double_compare);
-					    median = list[nlist / 2];
-					    if (verbose >= 2)
-						{
-						fprintf(stderr,"\ndbg2  depth statistics:\n");
-						fprintf(stderr,"dbg2    number:        %d\n",nlist);
-						fprintf(stderr,"dbg2    minimum depth: %f\n",list[0]);
-						fprintf(stderr,"dbg2    median depth:  %f\n",median);
-						fprintf(stderr,"dbg2    maximum depth: %f\n",list[nlist-1]);
-						}
-
-					    /* check fractional deviation from median if desired */
-					    if (check_fraction == MB_YES
-						&& median > 0.0)
-						{
-						if (ping[irec].bath[i]/median < fraction_low
-						    || ping[irec].bath[i]/median > fraction_high)
-							{
-							if (verbose >= 1)
-							    fprintf(stderr,"f: %4d %2d %2d %2.2d:%2.2d:%2.2d.%6.6d  %4d %8.2f %8.2f\n",
-								ping[irec].time_i[0],
-								ping[irec].time_i[1],
-								ping[irec].time_i[2],
-								ping[irec].time_i[3],
-								ping[irec].time_i[4],
-								ping[irec].time_i[5],
-								ping[irec].time_i[6],
-								i,ping[irec].bath[i],median);
-							find_bad = MB_YES;
-							ping[irec].beamflag[i] = MB_FLAG_FLAG + MB_FLAG_FILTER;
-							nfraction++;
-							nflag++;
-							mb_ess_save(verbose, &esf, ping[irec].time_d,
-								    i + ping[irec].multiplicity * MB_ESF_MULTIPLICITY_FACTOR,
-								    MBP_EDIT_FILTER, &error);
-							}
-						}
-
-					    /* check absolute deviation from median if desired */
-					    if (check_deviation == MB_YES
-						&& median > 0.0)
-						{
-						if (fabs(ping[irec].bath[i] - median) > deviation_max)
-							{
-							if (verbose >= 1)
-							fprintf(stderr,"a: %4d %2d %2d %2.2d:%2.2d:%2.2d.%6.6d  %4d %8.2f %8.2f\n",
-							    ping[irec].time_i[0],
-							    ping[irec].time_i[1],
-							    ping[irec].time_i[2],
-							    ping[irec].time_i[3],
-							    ping[irec].time_i[4],
-							    ping[irec].time_i[5],
-							    ping[irec].time_i[6],
-							    i,ping[irec].bath[i],median);
-							find_bad = MB_YES;
-							ping[irec].beamflag[i] = MB_FLAG_FLAG + MB_FLAG_FILTER;
-							ndeviation++;
-							nflag++;
-							mb_ess_save(verbose, &esf, ping[irec].time_d,
-									i + ping[irec].multiplicity * MB_ESF_MULTIPLICITY_FACTOR,
-									MBP_EDIT_FILTER, &error);
-							}
-						}
-
-					    /* check spikes - acrosstrack */
-					    if (check_spike == MB_YES
-						&& 0 != (spike_mode & 1)
-						&& median > 0.0
-						&& i > 0
-						&& i < ping[irec].beams_bath -1
-						&& mb_beam_ok(ping[irec].beamflag[i-1])
-						&& mb_beam_ok(ping[irec].beamflag[i+1]))
-						{
-						dd = sqrt((ping[irec].bathx[i-1]
-							- ping[irec].bathx[i])
-							*(ping[irec].bathx[i-1]
-							- ping[irec].bathx[i])
-							+ (ping[irec].bathy[i-1]
-							- ping[irec].bathy[i])
-							*(ping[irec].bathy[i-1]
-							- ping[irec].bathy[i]));
-						if (dd > distancemin * median && dd <= distancemax * median)
-							{
-							slope = (ping[irec].bath[i-1]
-								- ping[irec].bath[i])/dd;
-							dd2 = sqrt((ping[irec].bathx[i+1]
-								- ping[irec].bathx[i])
-								*(ping[irec].bathx[i+1]
-								- ping[irec].bathx[i])
-								+ (ping[irec].bathy[i+1]
-								- ping[irec].bathy[i])
-								*(ping[irec].bathy[i+1]
-								- ping[irec].bathy[i]));
-							if (dd2 > distancemin * median && dd2 <= distancemax * median)
-								{
-								slope2 = (ping[irec].bath[i]
-									- ping[irec].bath[i+1])/dd2;
-								if ((slope > spikemax && slope2 < -spikemax) ||
-								    (slope2 > spikemax && slope < -spikemax))
-								  {
-								    nspike++;
-								    nflag++;
-								    ping[irec].beamflag[i] = MB_FLAG_FLAG + MB_FLAG_FILTER;
-								    mb_ess_save(verbose, &esf, ping[irec].time_d,
-											i + ping[irec].multiplicity * MB_ESF_MULTIPLICITY_FACTOR,
-											MBP_EDIT_FILTER, &error);
-								    if (verbose >= 1)
-								      {
-									if (verbose >= 2)
-									  fprintf(stderr,"\n");
-									fprintf(stderr,"s: %4d %2d %2d %2.2d:%2.2d:%2.2d.%6.6d  %4d %8.2f %8.2f %6.2f %6.2f %6.2f %6.2f\n",
-										ping[irec].time_i[0],
-										ping[irec].time_i[1],
-										ping[irec].time_i[2],
-										ping[irec].time_i[3],
-										ping[irec].time_i[4],
-										ping[irec].time_i[5],
-										ping[irec].time_i[6],
-										i,ping[irec].bath[i],median,slope,slope2,dd,dd2);
-								      }
-
-								  }
-								}
-							}
-						}
-
-					    /* check spikes - alongtrack */
-					    if (check_spike == MB_YES
-						&& nrec == 3
-						&& 0 != (spike_mode & 2)
-						&& mb_beam_ok(ping[0].beamflag[i])
-						&& mb_beam_ok(ping[2].beamflag[i]))
-						{
-						dd = sqrt((ping[0].bathx[i]
-							- ping[1].bathx[i])
-							*(ping[0].bathx[i]
-							- ping[1].bathx[i])
-							+ (ping[0].bathy[i]
-							- ping[1].bathy[i])
-							*(ping[0].bathy[i]
-							- ping[1].bathy[i]));
-						if (dd > distancemin * median && dd <= distancemax * median)
-							{
-							slope = (ping[0].bath[i]
-								- ping[1].bath[i])/dd;
-							dd2 = sqrt((ping[2].bathx[i]
-								- ping[1].bathx[i])
-								*(ping[2].bathx[i]
-								- ping[1].bathx[i])
-								+ (ping[2].bathy[i]
-								- ping[1].bathy[i])
-								*(ping[2].bathy[i]
-								- ping[1].bathy[i]));
-							if (dd2 > distancemin * median && dd2 <= distancemax * median)
-								{
-								slope2 = (ping[1].bath[i]
-									- ping[2].bath[i])/dd2;
-								if ((slope > spikemax && slope2 < -spikemax) ||
-								    (slope2 > spikemax && slope < -spikemax))
-								  {
-								    nspike++;
-								    nflag++;
-								    ping[1].beamflag[i] = MB_FLAG_FLAG + MB_FLAG_FILTER;
-								    mb_ess_save(verbose, &esf, ping[1].time_d,
-											i + ping[1].multiplicity * MB_ESF_MULTIPLICITY_FACTOR,
-											MBP_EDIT_FILTER, &error);
-								    if (verbose >= 1)
-								      {
-									if (verbose >= 2)
-									  fprintf(stderr,"\n");
-									fprintf(stderr,"s: %4d %2d %2d %2.2d:%2.2d:%2.2d.%6.6d  %4d %8.2f %8.2f %6.2f %6.2f %6.2f %6.2f\n",
-										ping[1].time_i[0],
-										ping[1].time_i[1],
-										ping[1].time_i[2],
-										ping[1].time_i[3],
-										ping[1].time_i[4],
-										ping[1].time_i[5],
-										ping[1].time_i[6],
-										i,ping[1].bath[i],median,slope,slope2,dd,dd2);
-								      }
-
-								  }
-								}
-							}
-
-						}
-
-					    /* check slopes - loop over each of the beams in the current ping */
-					    if (check_slope == MB_YES
-						&& nrec == 3
-						&& median > 0.0)
-					    for (j=0;j<nrec;j++)
-						{
-						for (k=0;k<ping[j].beams_bath;k++)
-						    {
-						    if (mb_beam_ok(ping[j].beamflag[k]))
-							{
-							dd = sqrt((ping[j].bathx[k]
-								- ping[1].bathx[i])
-								*(ping[j].bathx[k]
-								- ping[1].bathx[i])
-								+ (ping[j].bathy[k]
-								- ping[1].bathy[i])
-								*(ping[j].bathy[k]
-								- ping[1].bathy[i]));
-							if (dd > 0.0 && dd <= distancemax * median)
-							    slope = fabs((ping[j].bath[k]
-									- ping[1].bath[i])/dd);
-							else
-							    slope = 0.0;
-							if (slope > slopemax
-								&& dd > distancemin * median)
-							    {
-							    find_bad = MB_YES;
-							    if (mode == MBCLEAN_FLAG_BOTH)
-								{
-								bad[0].flag = MB_YES;
-								bad[0].ping = j;
-								bad[0].beam = k;
-								bad[0].bath =
-									ping[j].bath[k];
-								bad[1].flag = MB_YES;
-								bad[1].ping = 1;
-								bad[1].beam = i;
-								bad[1].bath =
-									ping[1].bath[i];
-								ping[j].beamflag[k] =
-									MB_FLAG_FLAG + MB_FLAG_FILTER;
-								ping[1].beamflag[i] =
-									MB_FLAG_FLAG + MB_FLAG_FILTER;
-								nbad++;
-								nflag = nflag + 2;
-								mb_ess_save(verbose, &esf, ping[j].time_d,
-										k + ping[j].multiplicity * MB_ESF_MULTIPLICITY_FACTOR,
-										MBP_EDIT_FILTER, &error);
-								mb_ess_save(verbose, &esf, ping[1].time_d,
-										i + ping[1].multiplicity * MB_ESF_MULTIPLICITY_FACTOR,
-										MBP_EDIT_FILTER, &error);
-								}
-							    else
-								{
-								if (fabs((double)ping[j].bath[k]-median)
-								> fabs((double)ping[1].bath[i]-median))
-								    {
-								    bad[0].flag = MB_YES;
-								    bad[0].ping = j;
-								    bad[0].beam = k;
-								    bad[0].bath = ping[j].bath[k];
-								    bad[1].flag = MB_NO;
-								    ping[j].beamflag[k]
-									= MB_FLAG_FLAG + MB_FLAG_FILTER;
-								    mb_ess_save(verbose, &esf, ping[j].time_d,
-						    				k + ping[j].multiplicity * MB_ESF_MULTIPLICITY_FACTOR,
-										MBP_EDIT_FILTER, &error);
-								    }
-								else
-								    {
-								    bad[0].flag = MB_YES;
-								    bad[0].ping = 1;
-								    bad[0].beam = i;
-								    bad[0].bath = ping[1].bath[i];
-								    bad[1].flag = MB_NO;
-								    ping[1].beamflag[i]
-									= MB_FLAG_FLAG + MB_FLAG_FILTER;
-								    mb_ess_save(verbose, &esf, ping[1].time_d,
-						    				i + ping[1].multiplicity * MB_ESF_MULTIPLICITY_FACTOR,
-										MBP_EDIT_FILTER, &error);
-								    }
-								nbad++;
-								nflag++;
-								}
-							    }
-							if (verbose >= 1 && slope > slopemax
-								&& dd > distancemin * median
-								&& bad[0].flag == MB_YES)
-							    {
-							    p = bad[0].ping;
-							    b = bad[0].beam;
-							    if (verbose >= 2)
-								    fprintf(stderr,"\n");
-							    fprintf(stderr,"s: %4d %2d %2d %2.2d:%2.2d:%2.2d.%6.6d  %4d %8.2f %8.2f %6.2f %6.2f\n",
-							    ping[p].time_i[0],
-							    ping[p].time_i[1],
-							    ping[p].time_i[2],
-							    ping[p].time_i[3],
-							    ping[p].time_i[4],
-							    ping[p].time_i[5],
-							    ping[p].time_i[6],
-							    b,bad[0].bath,median,slope,dd);
-							    }
-							if (verbose >= 1 && slope > slopemax
-								&& dd > distancemin * median
-								&& bad[1].flag == MB_YES)
-							    {
-							    p = bad[1].ping;
-							    b = bad[1].beam;
-							    if (verbose >= 2)
-								    fprintf(stderr,"\n");
-							    fprintf(stderr,"s: %4d %2d %2d %2.2d:%2.2d:%2.2d.%6.6d  %4d %8.2f %8.2f %6.2f %6.2f\n",
-							    ping[p].time_i[0],
-							    ping[p].time_i[1],
-							    ping[p].time_i[2],
-							    ping[p].time_i[3],
-							    ping[p].time_i[4],
-							    ping[p].time_i[5],
-							    ping[p].time_i[6],
-							    b,bad[1].bath,median,slope,dd);
-							    }
-							}
-						    }
-						}
-					    }
-					}
-				    }
-
-				/* check for minimum number of good depths
-					on each side of swath */
-				if (check_num_good_min == MB_YES
-				    && num_good_min > 0)
-				    {
-				    /* do port */
-				    num_good = 0;
-				    for (i=0;i<center;i++)
-					{
-					if (mb_beam_ok(ping[irec].beamflag[i]))
-						num_good++;
-					}
-				    if (num_good < num_good_min)
-					{
-					find_bad = MB_YES;
-					for (i=0;i<center;i++)
-					    {
-					    if (mb_beam_ok(ping[irec].beamflag[i]))
-						{
-						if (verbose >= 1)
-						fprintf(stderr,"n: %4d %2d %2d %2.2d:%2.2d:%2.2d.%6.6d  %4d %8.2f %3d %3d\n",
-						    ping[irec].time_i[0],
-						    ping[irec].time_i[1],
-						    ping[irec].time_i[2],
-						    ping[irec].time_i[3],
-						    ping[irec].time_i[4],
-						    ping[irec].time_i[5],
-						    ping[irec].time_i[6],
-						    i,ping[irec].bath[i],
-						    num_good, num_good_min);
-						ping[irec].beamflag[i]
-						    = MB_FLAG_FLAG + MB_FLAG_FILTER;
-						nmin++;
-						nflag++;
-						mb_ess_save(verbose, &esf, ping[irec].time_d,
-								i + ping[irec].multiplicity * MB_ESF_MULTIPLICITY_FACTOR,
-								MBP_EDIT_FILTER, &error);
-						}
-					    }
-					}
-
-				    /* do starboard */
-				    num_good = 0;
-				    for (i=center+1;i<ping[irec].beams_bath;i++)
-					{
-					if (mb_beam_ok(ping[irec].beamflag[i]))
-						num_good++;
-					}
-				    if (num_good < num_good_min)
-					{
-					find_bad = MB_YES;
-					for (i=center+1;i<ping[irec].beams_bath;i++)
-					    {
-					    if (mb_beam_ok(ping[irec].beamflag[i]))
-						{
-						if (verbose >= 1)
-						fprintf(stderr,"n: %4d %2d %2d %2.2d:%2.2d:%2.2d.%6.6d  %4d %8.2f %3d %3d\n",
-						    ping[irec].time_i[0],
-						    ping[irec].time_i[1],
-						    ping[irec].time_i[2],
-						    ping[irec].time_i[3],
-						    ping[irec].time_i[4],
-						    ping[irec].time_i[5],
-						    ping[irec].time_i[6],
-						    i,ping[irec].bath[i],
-						    num_good, num_good_min);
-						ping[irec].beamflag[i]
-						    = MB_FLAG_FLAG + MB_FLAG_FILTER;
-						nmin++;
-						nflag++;
-						mb_ess_save(verbose, &esf, ping[irec].time_d,
-								i + ping[irec].multiplicity * MB_ESF_MULTIPLICITY_FACTOR,
-								MBP_EDIT_FILTER, &error);
-						}
-					    }
-					}
-				    }
-				}
-
-			    /* write out edits from completed pings */
-			    if ((status == MB_SUCCESS
-				&& nrec == 3)
-				|| done == MB_YES)
-				{
-				if (done == MB_YES)
-					k = nrec;
-				else
-					k = 1;
-				for (irec=0;irec<k;irec++)
-				    {
-				    for (i=0;i<ping[irec].beams_bath;i++)
-					{
-					if (ping[irec].beamflag[i] !=
-						ping[irec].beamflagorg[i])
-					    {
-					    if (mb_beam_ok(ping[irec].beamflag[i]))
-						    action = MBP_EDIT_UNFLAG;
-					    else if (mb_beam_check_flag_filter2(ping[irec].beamflag[i]))
-						    action = MBP_EDIT_FILTER;
-					    else if (mb_beam_check_flag_filter(ping[irec].beamflag[i]))
-						    action = MBP_EDIT_FILTER;
-					    else if (ping[irec].beamflag[i] != MB_FLAG_NULL)
-						    action = MBP_EDIT_FLAG;
-					    else
-						    action = MBP_EDIT_ZERO;
-					    mb_esf_save(verbose, &esf,
-							    ping[irec].time_d,
-							    i + ping[irec].multiplicity * MB_ESF_MULTIPLICITY_FACTOR,
-							    action, &error);
-					    }
-					}
-				     }
-				}
-
-			    /* reset counters and data */
-			    if (status == MB_SUCCESS
-				&& nrec == 3)
-				{
-				/* copy data back one */
-				nrec = 2;
-				for (j=0;j<2;j++)
-				    {
-				    for (i=0;i<7;i++)
-					    ping[j].time_i[i] =
-						    ping[j+1].time_i[i];
-				    ping[j].time_d = ping[j+1].time_d;
-				    ping[j].navlon = ping[j+1].navlon;
-				    ping[j].navlat = ping[j+1].navlat;
-				    ping[j].speed = ping[j+1].speed;
-				    ping[j].heading = ping[j+1].heading;
-				    ping[j].beams_bath = ping[j+1].beams_bath;
-				    for (i=0;i<ping[j].beams_bath;i++)
-					{
-					ping[j].beamflag[i] = ping[j+1].beamflag[i];
-					ping[j].beamflagorg[i] = ping[j+1].beamflagorg[i];
-					ping[j].bath[i] = ping[j+1].bath[i];
-					ping[j].bathacrosstrack[i] = ping[j+1].bathacrosstrack[i];
-					ping[j].bathalongtrack[i] = ping[j+1].bathalongtrack[i];
-					ping[j].bathx[i] = ping[j+1].bathx[i];
-					ping[j].bathy[i] = ping[j+1].bathy[i];
-					}
-				    }
-				}
-			    }
-
-			/* close the file */
-			status = mb_close(verbose,&mbio_ptr,&error);
-
-/*for (i=0;i<esf.nedit;i++)
-{
-if (esf.edit_use[i] == 1000)
-fprintf(stderr,"BEAM FLAG TIED TO NULL BEAM: i:%d edit: %f %d %d   %d\n",
-i,esf.edit_time_d[i],esf.edit_beam[i],esf.edit_action[i],esf.edit_use[i]);
-else if (esf.edit_use[i] == 100)
-fprintf(stderr,"DUPLICATE BEAM FLAG: i:%d edit: %f %d %d   %d\n",
-i,esf.edit_time_d[i],esf.edit_beam[i],esf.edit_action[i],esf.edit_use[i]);
-else if (esf.edit_use[i] == 1)
-fprintf(stderr,"BEAM FLAG USED:      i:%d edit: %f %d %d   %d\n",
-i,esf.edit_time_d[i],esf.edit_beam[i],esf.edit_action[i],esf.edit_use[i]);
-else if (esf.edit_use[i] != 1)
-fprintf(stderr,"BEAM FLAG NOT USED:  i:%d edit: %f %d %d   %d\n",
-i,esf.edit_time_d[i],esf.edit_beam[i],esf.edit_action[i],esf.edit_use[i]);
-}*/
-
-			/* close edit save file */
-			status = mb_esf_close(verbose, &esf, &error);
-
-			/* update mbprocess parameter file */
-			if (esffile_open == MB_YES)
-			    {
-			    /* update mbprocess parameter file */
-			    status = mb_pr_update_format(verbose, swathfile,
-					MB_YES, format,
-					&error);
-			    status = mb_pr_update_edit(verbose, swathfile,
-					MBP_EDIT_ON, esffile,
-					&error);
-			    }
-
-			/* unlock the raw swath file */
-			if (uselockfiles == MB_YES)
-				status = mb_pr_unlockswathfile(verbose, swathfile,
-						MBP_LOCK_EDITBATHY, program_name, &error);
-
-			/* check memory */
-			if (verbose >= 4)
-				status = mb_memory_list(verbose,&error);
-
-			/* increment the total counting variables */
-			nfiletot++;
-			ndatatot += ndata;
-			nflagesftot += nflagesf;
-			nunflagesftot += nunflagesf;
-			nzeroesftot += nzeroesf;
-			ndepthrangetot += ndepthrange;
-			nminrangetot += nminrange;
-			nfractiontot += nfraction;
-			ndeviationtot += ndeviation;
-			nouterbeamstot += nouterbeams;
-			nouterdistancetot += nouterdistance;
-			nrailtot += nrail;
-			nlong_acrosstot += nlong_across;
-			nmax_heading_ratetot += nmax_heading_rate;
-			nmintot += nmin;
-			nbadtot += nbad;
-			nspiketot += nspike;
-			nflagtot += nflag;
-			nunflagtot += nunflag;
-
-			/* give the statistics */
-			if (verbose >= 0)
-				{
-				fprintf(stderr,"%d bathymetry data records processed\n",ndata);
-				if (esf.nedit > 0)
-					{
-					fprintf(stderr,"%d beams flagged in old esf file\n",nflagesf);
-					fprintf(stderr,"%d beams unflagged in old esf file\n",nunflagesf);
-					fprintf(stderr,"%d beams zeroed in old esf file\n",nzeroesf);
-					}
-				fprintf(stderr,"%d beams zapped by beam number\n",nouterbeams);
-				fprintf(stderr,"%d beams zapped by distance\n",nouterdistance);
-				fprintf(stderr,"%d beams zapped for too few good beams in ping\n",nmin);
-				fprintf(stderr,"%d beams out of acceptable depth range\n",ndepthrange);
-				fprintf(stderr,"%d beams less than minimum range\n",nminrange);
-				fprintf(stderr,"%d beams out of acceptable fractional depth range\n",nfraction);
-				fprintf(stderr,"%d beams out of acceptable speed range\n",nspeed);
-				fprintf(stderr,"%d beams have zero position (lat/lon)\n",nzeropos);
-				fprintf(stderr,"%d beams exceed acceptable deviation from median depth\n",ndeviation);
-				fprintf(stderr,"%d bad rail beams identified\n",nrail);
-				fprintf(stderr,"%d long acrosstrack beams identified\n",nlong_across);
-				fprintf(stderr,"%d max heading rate pings identified\n",nmax_heading_rate);
-				fprintf(stderr,"%d excessive slopes identified\n",nbad);
-				fprintf(stderr,"%d excessive spikes identified\n",nspike);
-				fprintf(stderr,"%d beams flagged\n",nflag);
-				fprintf(stderr,"%d beams unflagged\n",nunflag);
-				}
-			}
-
-		/* figure out whether and what to read next */
-        	if (read_datalist == MB_YES)
-                	{
-			if ((status = mb_datalist_read(verbose,datalist,
-				    swathfile,&format,&file_weight,&error))
-				    == MB_SUCCESS)
-                        	read_data = MB_YES;
-                	else
-                        	read_data = MB_NO;
-                	}
-        	else
-                	{
-                	read_data = MB_NO;
-                	}
-
-		/* end loop over files in list */
-		}
-        if (read_datalist == MB_YES)
-		mb_datalist_close(verbose,&datalist,&error);
-
-	/* give the total statistics */
-	if (verbose >= 0)
-		{
-		fprintf(stderr,"\nMBclean Processing Totals:\n");
-		fprintf(stderr,"-------------------------\n");
-		fprintf(stderr,"%d total swath data files processed\n",nfiletot);
-		fprintf(stderr,"%d total bathymetry data records processed\n",ndatatot);
-		fprintf(stderr,"%d total beams flagged in old esf files\n",nflagesftot);
-		fprintf(stderr,"%d total beams unflagged in old esf files\n",nunflagesftot);
-		fprintf(stderr,"%d total beams zeroed in old esf files\n",nzeroesftot);
-		fprintf(stderr,"%d total beams zapped by beam number\n",nouterbeamstot);
-		fprintf(stderr,"%d total beams zapped by distance\n",nouterdistancetot);
-		fprintf(stderr,"%d total beams zapped for too few good beams in ping\n",nmintot);
-		fprintf(stderr,"%d total beams out of acceptable depth range\n",ndepthrangetot);
-		fprintf(stderr,"%d total beams less than minimum range\n",nminrangetot);
-		fprintf(stderr,"%d total beams out of acceptable fractional depth range\n",nfractiontot);
-		fprintf(stderr,"%d total beams out of acceptable speed range\n",nspeedtot);
-		fprintf(stderr,"%d total beams zero position (lat/lon)\n",nzeropostot);
-		fprintf(stderr,"%d total beams exceed acceptable deviation from median depth\n",ndeviationtot);
-		fprintf(stderr,"%d total bad rail beams identified\n",nrailtot);
-		fprintf(stderr,"%d total long acrosstrack beams identified\n",nlong_acrosstot);
-		fprintf(stderr,"%d total max heading rate beams identified\n",nmax_heading_ratetot);
-		fprintf(stderr,"%d total excessive spikes identified\n",nspiketot);
-		fprintf(stderr,"%d total excessive slopes identified\n",nbadtot);
-		fprintf(stderr,"%d total beams flagged\n",nflagtot);
-		fprintf(stderr,"%d total beams unflagged\n",nunflagtot);
-		}
-
-	/* set program status */
-	status = MB_SUCCESS;
-
-	/* check memory */
-	if (verbose >= 4)
-		status = mb_memory_list(verbose,&error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  Program <%s> completed\n",
-			program_name);
-		fprintf(stderr,"dbg2  Ending status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* end it all */
-	exit(error);
-}
-/*--------------------------------------------------------------------*/
-int mbclean_save_edit(int verbose, FILE *sofp, double time_d, int beam, int action, int *error)
-{
-	/* local variables */
-	char	*function_name = "mbclean_save_edit";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       sofp:            %p\n",(void *)sofp);
-		fprintf(stderr,"dbg2       time_d:          %f\n",time_d);
-		fprintf(stderr,"dbg2       beam:            %d\n",beam);
-		fprintf(stderr,"dbg2       action:          %d\n",action);
-		}
-	/* write out the edit */
-fprintf(stderr,"OUTPUT EDIT: %f %d %d\n",time_d,beam,action);
-	if (sofp != NULL)
-	    {
-#ifdef BYTESWAPPED
-	    mb_swap_double(&time_d);
-	    beam = mb_swap_int(beam);
-	    action = mb_swap_int(action);
-#endif
-	    if (fwrite(&time_d, sizeof(double), 1, sofp) != 1)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	    if (status == MB_SUCCESS
-		&& fwrite(&beam, sizeof(int), 1, sofp) != 1)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	    if (status == MB_SUCCESS
-		&& fwrite(&action, sizeof(int), 1, sofp) != 1)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	    }
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/utilities/mbcopy.c b/src/utilities/mbcopy.c
deleted file mode 100644
index f01fd1e..0000000
--- a/src/utilities/mbcopy.c
+++ /dev/null
@@ -1,3276 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbcopy.c	2/4/93
- *    $Id: mbcopy.c 2224 2015-02-04 19:14:05Z caress $
- *
- *    Copyright (c) 1993-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * MBcopy copies an input swath sonar data file to an output
- * swath sonar data file with the specified conversions.  Options include
- * windowing in time and space and ping averaging.  The input and
- * output data formats may differ, though not all possible combinations
- * make sense.  The default input and output streams are stdin
- * and stdout.
- *
- * Author:	D. W. Caress
- * Date:	February 4, 1993
- *
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#include <string.h>
-#include <time.h>
-#include <unistd.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_define.h"
-#include "mb_io.h"
-#include "mbsys_xse.h"
-#include "mbsys_elacmk2.h"
-#include "mbsys_simrad.h"
-#include "mbsys_simrad2.h"
-#include "mbsys_ldeoih.h"
-#include "mbsys_gsf.h"
-#include "mbsys_hsds.h"
-#include "mbsys_reson8k.h"
-
-/* defines for special copying routines */
-#define	MBCOPY_PARTIAL			0
-#define	MBCOPY_FULL			1
-#define	MBCOPY_ELACMK2_TO_XSE		2
-#define	MBCOPY_XSE_TO_ELACMK2		3
-#define	MBCOPY_SIMRAD_TO_SIMRAD2	4
-#define	MBCOPY_ANY_TO_MBLDEOIH		5
-#define	MBCOPY_RESON8K_TO_GSF		6
-
-/* function prototypes */
-int setup_transfer_rules(int verbose, int ibeams, int obeams,
-		int *istart, int *iend, int *offset, int *error);
-int mbcopy_elacmk2_to_xse(int verbose,
-		struct mbsys_elacmk2_struct *istore,
-		struct mbsys_xse_struct *ostore,
-		int *error);
-int mbcopy_xse_to_elacmk2(int verbose,
-		struct mbsys_xse_struct *istore,
-		struct mbsys_elacmk2_struct *ostore,
-		int *error);
-int mbcopy_simrad_to_simrad2(int verbose,
-		struct mbsys_simrad_struct *istore,
-		struct mbsys_simrad2_struct *ostore,
-		int *error);
-int mbcopy_simrad_time_convert(int verbose,
-		int year, int month,
-		int day, int hour,
-		int minute, int second,
-		int centisecond,
-		int *date, int *msec,
-		int *error);
-int mbcopy_any_to_mbldeoih(int verbose,
-		int kind, int *time_i, double time_d,
-		double navlon, double navlat, double speed, double heading,
-		double draft, double altitude,
-		double roll, double pitch, double heave,
-		double	beamwidth_xtrack, double beamwidth_ltrack,
-		int nbath, int namp, int nss,
-		char *beamflag, double *bath, double *amp,
-		double *bathacrosstrack, double *bathalongtrack,
-		double *ss, double *ssacrosstrack, double *ssalongtrack,
-		char *comment,
-		void *ombio_ptr, void *ostore_ptr,
-		int *error);
-int mbcopy_reson8k_to_gsf(int verbose,
-		void *imbio_ptr,
-		void *ombio_ptr,
-		int *error);
-
-static char rcs_id[] = "$Id: mbcopy.c 2224 2015-02-04 19:14:05Z caress $";
-
-/*--------------------------------------------------------------------*/
-
-int main (int argc, char **argv)
-{
-	/* id variables */
-	char program_name[] = "MBcopy";
-	char help_message[] =  "MBcopy copies an input swath sonar data file to an output \nswath sonar data file with the specified conversions.  Options include \nwindowing in time and space and ping averaging.  The input and \noutput data formats may differ, though not all possible combinations \nmake sense.  The default input and output streams are stdin and stdout.";
-	char usage_message[] = "mbcopy [-Byr/mo/da/hr/mn/sc -Ccommentfile -D -Eyr/mo/da/hr/mn/sc \n\t-Fiformat/oformat/mformat -H  -Iinfile -Llonflip -Mmergefile -N -Ooutfile \n\t-Ppings -Qsleep_factor -Rw/e/s/n -Sspeed -V]";
-
-	/* parsing variables */
-	extern char *optarg;
-	int	errflg = 0;
-	int	c;
-	int	help = 0;
-	int	flag = 0;
-
-	/* MBIO status variables */
-	int	status;
-	int	verbose = 0;
-	int	error = MB_ERROR_NO_ERROR;
-	char	*message;
-
-	/* MBIO read control parameters */
-	int	iformat = 0;
-	int	pings;
-	int	lonflip;
-	double	bounds[4];
-	int	btime_i[7];
-	int	etime_i[7];
-	double	btime_d;
-	double	etime_d;
-	double	speedmin;
-	double	timegap;
-	int	fbtversion;
-	char	ifile[MB_PATH_MAXLINE];
-	int	ibeams_bath;
-	int	ibeams_amp;
-	int	ipixels_ss;
-	void	*imbio_ptr = NULL;
-
-	/* MBIO write control parameters */
-	int	oformat = 0;
-	char	ofile[MB_PATH_MAXLINE];
-	int	obeams_bath;
-	int	obeams_amp;
-	int	opixels_ss;
-	void	*ombio_ptr = NULL;
-
-	/* MBIO merge control parameters */
-	int	merge = MB_NO;
-	int	mformat = 0;
-	char	mfile[MB_PATH_MAXLINE];
-	int	mbeams_bath;
-	int	mbeams_amp;
-	int	mpixels_ss;
-	void	*mmbio_ptr = NULL;
-
-	/* MBIO read and write values */
-	struct mb_io_struct *omb_io_ptr;
-	struct mb_io_struct *imb_io_ptr;
-	struct mb_io_struct *mmb_io_ptr;
-	void	*istore_ptr;
-	void	*ostore_ptr;
-	int	kind;
-	int	time_i[7];
-	double	time_d;
-	double	navlon;
-	double	navlat;
-	double	speed;
-	double	heading;
-	double	distance;
-	double	altitude;
-	double	sonardepth;
-	char	*ibeamflag = NULL;
-	double	*ibath = NULL;
-	double	*ibathacrosstrack = NULL;
-	double	*ibathalongtrack = NULL;
-	double	*iamp = NULL;
-	double	*iss = NULL;
-	double	*issacrosstrack = NULL;
-	double	*issalongtrack = NULL;
-	char	*obeamflag = NULL;
-	double	*obath = NULL;
-	double	*obathacrosstrack = NULL;
-	double	*obathalongtrack = NULL;
-	double	*oamp = NULL;
-	double	*oss = NULL;
-	double	*ossacrosstrack = NULL;
-	double	*ossalongtrack = NULL;
-	double	draft;
-	double	roll;
-	double	pitch;
-	double	heave;
-	int	mstatus;
-	int	merror = MB_ERROR_NO_ERROR;
-	int	mkind = MB_DATA_NONE;
-	int	mpings = 0;
-	int	mtime_i[7];
-	double	mtime_d = 0.0;
-	double	mnavlon;
-	double	mnavlat;
-	double	mspeed;
-	double	mheading;
-	double	mdistance;
-	double	maltitude;
-	double	msonardepth;
-
-	char	mcomment[MB_COMMENT_MAXLINE];
-	int	mnbath, mnamp, mnss;
-	char	*mbeamflag = NULL;
-	double	*mbath = NULL;
-	double	*mbathacrosstrack = NULL;
-	double	*mbathalongtrack = NULL;
-	double	*mamp = NULL;
-	double	*mss = NULL;
-	double	*mssacrosstrack = NULL;
-	double	*mssalongtrack = NULL;
-	int	idata = 0;
-	int	icomment = 0;
-	int	odata = 0;
-	int	ocomment = 0;
-	int	nbath, namp, nss;
-	int	istart_bath, iend_bath, offset_bath;
-	int	istart_amp, iend_amp, offset_amp;
-	int	istart_ss, iend_ss, offset_ss;
-	char	comment[MB_COMMENT_MAXLINE];
-	int	insertcomments = MB_NO;
-	int	bathonly = MB_NO;
-	char	commentfile[MB_PATH_MAXLINE];
-	int	stripcomments = MB_NO;
-	int	copymode = MBCOPY_PARTIAL;
-	int	use_sleep = MB_NO;
-	int	inbounds = MB_YES;
-
-	/* sleep variable */
-	double	sleep_factor = 1.0;
-	double	time_d_last;
-	unsigned int	sleep_time;
-
-	/* time, user, host variables */
-	time_t	right_now;
-	char	date[32], user[128], *user_ptr, host[128];
-
-	FILE	*fp;
-	char	*result;
-	int	format;
-	double	seconds;
-	int	i, j;
-
-	char	*ctime();
-	char	*getenv();
-
-	/* get current default values */
-	status = mb_defaults(verbose,&format,&pings,&lonflip,bounds,
-		btime_i,etime_i,&speedmin,&timegap);
-	status = mb_fbtversion(verbose, &fbtversion);
-
-	/* set default input and output */
-	iformat = 0;
-	oformat = 0;
-	mformat = 0;
-	strcpy (commentfile, "\0");
-	strcpy (ifile, "stdin");
-	strcpy (ofile, "stdout");
-
-	/* process argument list */
-	while ((c = getopt(argc, argv, "B:b:C:c:DdE:e:F:f:HhI:i:L:l:M:m:NnO:o:P:p:Q:q:R:r:S:s:T:t:Vv")) != -1)
-	  switch (c)
-		{
-		case 'B':
-		case 'b':
-			sscanf (optarg,"%d/%d/%d/%d/%d/%lf",
-				&btime_i[0],&btime_i[1],&btime_i[2],
-				&btime_i[3],&btime_i[4],&seconds);
-			btime_i[5] = (int)floor(seconds);
-			btime_i[6] = 1000000 * (seconds - btime_i[5]);
-			flag++;
-			break;
-		case 'C':
-		case 'c':
-			sscanf (optarg,"%s", commentfile);
-			insertcomments = MB_YES;
-			flag++;
-			break;
-		case 'D':
-		case 'd':
-			bathonly = MB_YES;
-			flag++;
-			break;
-		case 'E':
-		case 'e':
-			sscanf (optarg,"%d/%d/%d/%d/%d/%lf",
-				&etime_i[0],&etime_i[1],&etime_i[2],
-				&etime_i[3],&etime_i[4],&seconds);
-			etime_i[5] = (int)floor(seconds);
-			etime_i[6] = 1000000 * (seconds - btime_i[5]);
-			flag++;
-			break;
-		case 'F':
-		case 'f':
-			i = sscanf (optarg,"%d/%d/%d", &iformat,&oformat,&mformat);
-			if (i == 1)
-				oformat = iformat;
-			flag++;
-			break;
-		case 'H':
-		case 'h':
-			help++;
-			break;
-		case 'I':
-		case 'i':
-			sscanf (optarg,"%s", ifile);
-			flag++;
-			break;
-		case 'L':
-		case 'l':
-			sscanf (optarg,"%d", &lonflip);
-			flag++;
-			break;
-		case 'M':
-		case 'm':
-			i = sscanf (optarg,"%s", mfile);
-			if (i == 1)
-				merge = MB_YES;
-			flag++;
-			break;
-		case 'N':
-		case 'n':
-			stripcomments = MB_YES;
-			break;
-		case 'O':
-		case 'o':
-			sscanf (optarg,"%s", ofile);
-			flag++;
-			break;
-		case 'P':
-		case 'p':
-			sscanf (optarg,"%d", &pings);
-			flag++;
-			break;
-		case 'Q':
-		case 'q':
-			sscanf (optarg,"%lf", &sleep_factor);
-			use_sleep = MB_YES;
-			flag++;
-			break;
-		case 'R':
-		case 'r':
-			mb_get_bounds(optarg, bounds);
-			flag++;
-			break;
-		case 'S':
-		case 's':
-			sscanf (optarg,"%lf", &speedmin);
-			flag++;
-			break;
-		case 'T':
-		case 't':
-			sscanf (optarg,"%lf", &timegap);
-			flag++;
-			break;
-		case 'V':
-		case 'v':
-			verbose++;
-			break;
-		case '?':
-			errflg++;
-		}
-
-	/* if error flagged then print it and exit */
-	if (errflg)
-		{
-		fprintf(stderr,"usage: %s\n", usage_message);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		error = MB_ERROR_BAD_USAGE;
-		exit(error);
-		}
-
-	/* print starting message */
-	if (verbose == 1 || help)
-		{
-		fprintf(stderr,"\nProgram %s\n",program_name);
-		fprintf(stderr,"Version %s\n",rcs_id);
-		fprintf(stderr,"MB-system Version %s\n",MB_VERSION);
-		}
-
-	/* print starting debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  Program <%s>\n",program_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Control Parameters:\n");
-		fprintf(stderr,"dbg2       verbose:        %d\n",verbose);
-		fprintf(stderr,"dbg2       help:           %d\n",help);
-		fprintf(stderr,"dbg2       pings:          %d\n",pings);
-		fprintf(stderr,"dbg2       lonflip:        %d\n",lonflip);
-		fprintf(stderr,"dbg2       bounds[0]:      %f\n",bounds[0]);
-		fprintf(stderr,"dbg2       bounds[1]:      %f\n",bounds[1]);
-		fprintf(stderr,"dbg2       bounds[2]:      %f\n",bounds[2]);
-		fprintf(stderr,"dbg2       bounds[3]:      %f\n",bounds[3]);
-		fprintf(stderr,"dbg2       btime_i[0]:     %d\n",btime_i[0]);
-		fprintf(stderr,"dbg2       btime_i[1]:     %d\n",btime_i[1]);
-		fprintf(stderr,"dbg2       btime_i[2]:     %d\n",btime_i[2]);
-		fprintf(stderr,"dbg2       btime_i[3]:     %d\n",btime_i[3]);
-		fprintf(stderr,"dbg2       btime_i[4]:     %d\n",btime_i[4]);
-		fprintf(stderr,"dbg2       btime_i[5]:     %d\n",btime_i[5]);
-		fprintf(stderr,"dbg2       btime_i[6]:     %d\n",btime_i[6]);
-		fprintf(stderr,"dbg2       etime_i[0]:     %d\n",etime_i[0]);
-		fprintf(stderr,"dbg2       etime_i[1]:     %d\n",etime_i[1]);
-		fprintf(stderr,"dbg2       etime_i[2]:     %d\n",etime_i[2]);
-		fprintf(stderr,"dbg2       etime_i[3]:     %d\n",etime_i[3]);
-		fprintf(stderr,"dbg2       etime_i[4]:     %d\n",etime_i[4]);
-		fprintf(stderr,"dbg2       etime_i[5]:     %d\n",etime_i[5]);
-		fprintf(stderr,"dbg2       etime_i[6]:     %d\n",etime_i[6]);
-		fprintf(stderr,"dbg2       speedmin:       %f\n",speedmin);
-		fprintf(stderr,"dbg2       timegap:        %f\n",timegap);
-		fprintf(stderr,"dbg2       input format:   %d\n",iformat);
-		fprintf(stderr,"dbg2       output format:  %d\n",oformat);
-		fprintf(stderr,"dbg2       merge format:   %d\n",mformat);
-		fprintf(stderr,"dbg2       input file:     %s\n",ifile);
-		fprintf(stderr,"dbg2       output file:    %s\n",ofile);
-		fprintf(stderr,"dbg2       merge file:     %s\n",mfile);
-		fprintf(stderr,"dbg2       insert comments:%d\n",insertcomments);
-		fprintf(stderr,"dbg2       comment file:   %s\n",commentfile);
-		fprintf(stderr,"dbg2       strip comments: %d\n",stripcomments);
-		fprintf(stderr,"dbg2       bath only:      %d\n",bathonly);
-		fprintf(stderr,"dbg2       use sleep:      %d\n",use_sleep);
-		fprintf(stderr,"dbg2       sleep factor:   %f\n",sleep_factor);
-		fprintf(stderr,"dbg2       fbtversion:     %d\n",fbtversion);
-		}
-
-	/* if help desired then print it and exit */
-	if (help)
-		{
-		fprintf(stderr,"\n%s\n",help_message);
-		fprintf(stderr,"\nusage: %s\n", usage_message);
-		exit(error);
-		}
-
-	/* get format if required */
-	if (format == 0)
-		mb_get_format(verbose,ifile,NULL,&format,&error);
-
-	/* settle the input/output formats */
-	if (iformat <= 0 && oformat <= 0)
-		{
-		iformat = format;
-		oformat = format;
-		}
-	else if (iformat > 0 && oformat <= 0)
-		oformat = iformat;
-
-	if (merge == MB_YES && mformat <=0)
-		mb_get_format(verbose,mfile,NULL,&mformat,&error);
-
-
-	/* obtain format array locations - format ids will
-		be aliased to current ids if old format ids given */
-	if ((status = mb_format(verbose,&iformat,&error))
-		!= MB_SUCCESS)
-		{
-		mb_error(verbose,error,&message);
-		fprintf(stderr,"\nMBIO Error returned from function <mb_format> regarding input format %d:\n%s\n",iformat,message);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-	if ((status = mb_format(verbose,&oformat,&error))
-		!= MB_SUCCESS)
-		{
-		mb_error(verbose,error,&message);
-		fprintf(stderr,"\nMBIO Error returned from function <mb_format> regarding output format %d:\n%s\n",oformat,message);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-	if (merge == MB_YES && (status = mb_format(verbose,&mformat,&error))
-		!= MB_SUCCESS)
-		{
-		mb_error(verbose,error,&message);
-		fprintf(stderr,"\nMBIO Error returned from function <mb_format> regarding merge format %d:\n%s\n",mformat,message);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-
-	/* initialize reading the input swath sonar file */
-	if ((status = mb_read_init(
-		verbose,ifile,iformat,pings,lonflip,bounds,
-		btime_i,etime_i,speedmin,timegap,
-		&imbio_ptr,&btime_d,&etime_d,
-		&ibeams_bath,&ibeams_amp,&ipixels_ss,&error)) != MB_SUCCESS)
-		{
-		mb_error(verbose,error,&message);
-		fprintf(stderr,"\nMBIO Error returned from function <mb_read_init>:\n%s\n",message);
-		fprintf(stderr,"\nMultibeam File <%s> not initialized for reading\n",ifile);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-	imb_io_ptr = (struct mb_io_struct *) imbio_ptr;
-
-	/* initialize reading the merge swath sonar file */
-	if (merge == MB_YES && (status = mb_read_init(
-		verbose,mfile,mformat,pings,lonflip,bounds,
-		btime_i,etime_i,speedmin,timegap,
-		&mmbio_ptr,&btime_d,&etime_d,
-		&mbeams_bath,&mbeams_amp,&mpixels_ss,&error)) != MB_SUCCESS)
-		{
-		mb_error(verbose,error,&message);
-		fprintf(stderr,"\nMBIO Error returned from function <mb_read_init>:\n%s\n",message);
-		fprintf(stderr,"\nMultibeam File <%s> not initialized for reading\n",mfile);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-	mmb_io_ptr = (struct mb_io_struct *) mmbio_ptr;
-
-	/* initialize writing the output swath sonar file */
-	if ((status = mb_write_init(
-		verbose,ofile,oformat,&ombio_ptr,
-		&obeams_bath,&obeams_amp,&opixels_ss,&error)) != MB_SUCCESS)
-		{
-		mb_error(verbose,error,&message);
-		fprintf(stderr,"\nMBIO Error returned from function <mb_write_init>:\n%s\n",message);
-		fprintf(stderr,"\nMultibeam File <%s> not initialized for writing\n",ofile);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-	omb_io_ptr = (struct mb_io_struct *) ombio_ptr;
-
-	/* bathonly mode works only if output format is mbldeoih */
-	if (bathonly == MB_YES && oformat != MBF_MBLDEOIH)
-		{
-		bathonly = MB_NO;
-		if (verbose > 0)
-		    {
-		    fprintf(stderr,"\nThe -D option (strip amplitude and sidescan) is only valid for output format %d\n",MBF_MBLDEOIH);
-		    fprintf(stderr,"Program %s is ignoring the -D argument\n",program_name);
-		    }
-		}
-
-	/* if bathonly mode for mbldeoih format, assume we are making an fbt file
-		- set the format to use - this allows user to set use of old format
-		in .mbio_defaults file - purpose is to keep compatibility with
-		Fledermaus */
-	if (bathonly == MB_YES && oformat == MBF_MBLDEOIH)
-		{
-		omb_io_ptr->save1 = fbtversion;
-		}
-
-	/* determine if full or partial copies will be made */
-	if (pings == 1
-		&& imb_io_ptr->system != MB_SYS_NONE
-		&& imb_io_ptr->system == omb_io_ptr->system)
-		copymode = MBCOPY_FULL;
-	else if (pings == 1
-		&& imb_io_ptr->system == MB_SYS_ELACMK2
-		&& omb_io_ptr->system == MB_SYS_XSE)
-		copymode = MBCOPY_ELACMK2_TO_XSE;
-	else if (pings == 1
-		&& imb_io_ptr->system == MB_SYS_XSE
-		&& omb_io_ptr->system == MB_SYS_ELACMK2)
-		copymode = MBCOPY_XSE_TO_ELACMK2;
-	else if (pings == 1
-		&& imb_io_ptr->system == MB_SYS_SIMRAD
-		&& omb_io_ptr->format == MBF_EM300MBA)
-		copymode = MBCOPY_SIMRAD_TO_SIMRAD2;
-	else if (pings == 1
-		&& omb_io_ptr->format == MBF_MBLDEOIH)
-		copymode = MBCOPY_ANY_TO_MBLDEOIH;
-	else if (pings == 1
-		&& imb_io_ptr->format == MBF_XTFR8101
-		&& omb_io_ptr->format ==  MBF_GSFGENMB )
-		copymode = MBCOPY_RESON8K_TO_GSF;
-	else
-		copymode = MBCOPY_PARTIAL;
-
-	/* quit if an unsupported copy to GSF is requested */
-	if (omb_io_ptr->format == MBF_GSFGENMB && copymode == MBCOPY_PARTIAL)
-		{
-		fprintf(stderr,"Requested copy from format %d to GSF format %d is unsupported\n",
-			imb_io_ptr->format, omb_io_ptr->format);
-		fprintf(stderr,"Please consider writing the necessary translation code for mbcopy.c \n");
-		fprintf(stderr,"\tand contributing it to the MB-System community\n");
-		exit(error);
-		}
-
-	/* print debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  Copy mode set in program <%s>\n",
-			program_name);
-		fprintf(stderr,"dbg2       pings:         %d\n",pings);
-		fprintf(stderr,"dbg2       iformat:       %d\n",iformat);
-		fprintf(stderr,"dbg2       oformat:       %d\n",oformat);
-		fprintf(stderr,"dbg2       isystem:       %d\n",
-			imb_io_ptr->system);
-		fprintf(stderr,"dbg2       osystem:       %d\n",
-			omb_io_ptr->system);
-		fprintf(stderr,"dbg2       copymode:      %d\n",copymode);
-		}
-
-	/* allocate memory for data arrays */
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(char), (void **)&ibeamflag, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(double), (void **)&ibath, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_AMPLITUDE,
-						sizeof(double), (void **)&iamp, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(double), (void **)&ibathacrosstrack, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(double), (void **)&ibathalongtrack, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_SIDESCAN,
-						sizeof(double), (void **)&iss, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_SIDESCAN,
-						sizeof(double), (void **)&issacrosstrack, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_SIDESCAN,
-						sizeof(double), (void **)&issalongtrack, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, ombio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(char), (void **)&obeamflag, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, ombio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(double), (void **)&obath, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, ombio_ptr, MB_MEM_TYPE_AMPLITUDE,
-						sizeof(double), (void **)&oamp, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, ombio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(double), (void **)&obathacrosstrack, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, ombio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(double), (void **)&obathalongtrack, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, ombio_ptr, MB_MEM_TYPE_SIDESCAN,
-						sizeof(double), (void **)&oss, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, ombio_ptr, MB_MEM_TYPE_SIDESCAN,
-						sizeof(double), (void **)&ossacrosstrack, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, ombio_ptr, MB_MEM_TYPE_SIDESCAN,
-						sizeof(double), (void **)&ossalongtrack, &error);
-
-	if (MB_YES == merge) {
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mmbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(char), (void **)&mbeamflag, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mmbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(double), (void **)&mbath, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mmbio_ptr, MB_MEM_TYPE_AMPLITUDE,
-						sizeof(double), (void **)&mamp, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mmbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(double), (void **)&mbathacrosstrack, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mmbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(double), (void **)&mbathalongtrack, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mmbio_ptr, MB_MEM_TYPE_SIDESCAN,
-						sizeof(double), (void **)&mss, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mmbio_ptr, MB_MEM_TYPE_SIDESCAN,
-						sizeof(double), (void **)&mssacrosstrack, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mmbio_ptr, MB_MEM_TYPE_SIDESCAN,
-						sizeof(double), (void **)&mssalongtrack, &error);
-	}
-
-	/* if error initializing memory then quit */
-	if (error != MB_ERROR_NO_ERROR)
-		{
-		mb_error(verbose,error,&message);
-		fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",message);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-
-	/* set up transfer rules */
-	if (omb_io_ptr->variable_beams == MB_YES
-		&& obeams_bath != ibeams_bath)
-		obeams_bath = ibeams_bath;
-	if (omb_io_ptr->variable_beams == MB_YES
-		&& obeams_amp != ibeams_amp)
-		obeams_amp = ibeams_amp;
-	if (omb_io_ptr->variable_beams == MB_YES
-		&& opixels_ss != ipixels_ss)
-		opixels_ss = ipixels_ss;
-	setup_transfer_rules(verbose,ibeams_bath,obeams_bath,
-		&istart_bath,&iend_bath,&offset_bath,&error);
-	setup_transfer_rules(verbose,ibeams_amp,obeams_amp,
-		&istart_amp,&iend_amp,&offset_amp,&error);
-	setup_transfer_rules(verbose,ipixels_ss,opixels_ss,
-		&istart_ss,&iend_ss,&offset_ss,&error);
-
-	/* insert comments from file into output */
-	if (insertcomments == MB_YES)
-		{
-		/* open file */
-		if ((fp = fopen(commentfile, "r")) == NULL)
-			{
-			error = MB_ERROR_OPEN_FAIL;
-			fprintf(stderr,"\nUnable to Open Comment File <%s> for reading\n",commentfile);
-			fprintf(stderr,"\nProgram <%s> Terminated\n",
-				program_name);
-			exit(error);
-			}
-
-		/* read and output comment lines */
-		strncpy(comment,"\0",256);
-		while ((result = fgets(comment,256,fp)) == comment)
-			{
-			kind = MB_DATA_COMMENT;
-			comment[(int)strlen(comment)-1] = '\0';
-			status = mb_put_comment(verbose,ombio_ptr,
-				comment,&error);
-			if (error == MB_ERROR_NO_ERROR) ocomment++;
-			}
-
-		/* close the file */
-		fclose(fp);
-		}
-
-	/* write comments to beginning of output file */
-	if (stripcomments == MB_NO)
-		{
-		kind = MB_DATA_COMMENT;
-		strncpy(comment,"\0",256);
-		sprintf(comment,"These data copied by program %s version %s",
-			program_name,rcs_id);
-		status = mb_put_comment(verbose,ombio_ptr,
-				comment,&error);
-		if (error == MB_ERROR_NO_ERROR) ocomment++;
-		strncpy(comment,"\0",256);
-		sprintf(comment,"MB-system Version %s",MB_VERSION);
-		status = mb_put_comment(verbose,ombio_ptr,
-				comment,&error);
-		if (error == MB_ERROR_NO_ERROR) ocomment++;
-		right_now = time((time_t *)0);
-		strcpy(date,ctime(&right_now));
-                date[strlen(date)-1] = '\0';
-		if ((user_ptr = getenv("USER")) == NULL)
-			user_ptr = getenv("LOGNAME");
-		if (user_ptr != NULL)
-			strcpy(user,user_ptr);
-		else
-			strcpy(user, "unknown");
-		gethostname(host,128);
-		strncpy(comment,"\0",256);
-		sprintf(comment,"Run by user <%s> on cpu <%s> at <%s>",
-			user,host,date);
-		status = mb_put_comment(verbose,ombio_ptr,
-				comment,&error);
-		if (error == MB_ERROR_NO_ERROR) ocomment++;
-		strncpy(comment,"\0",256);
-		sprintf(comment,"Control Parameters:");
-		status = mb_put_comment(verbose,ombio_ptr,
-				comment,&error);
-		if (error == MB_ERROR_NO_ERROR) ocomment++;
-		strncpy(comment,"\0",256);
-		sprintf(comment,"  Input file:         %s",ifile);
-		status = mb_put_comment(verbose,ombio_ptr,
-				comment,&error);
-		if (error == MB_ERROR_NO_ERROR) ocomment++;
-		strncpy(comment,"\0",256);
-		sprintf(comment,"  Input MBIO format:  %d",iformat);
-		status = mb_put_comment(verbose,ombio_ptr,
-				comment,&error);
-		if (error == MB_ERROR_NO_ERROR) ocomment++;
-		if (merge == MB_YES)
-			{
-			strncpy(comment,"\0",256);
-			sprintf(comment,"  Merge file:         %s",mfile);
-			status = mb_put_comment(verbose,ombio_ptr,
-					comment,&error);
-			if (error == MB_ERROR_NO_ERROR) ocomment++;
-			strncpy(comment,"\0",256);
-			sprintf(comment,"  Merge MBIO format:  %d",mformat);
-			status = mb_put_comment(verbose,ombio_ptr,
-					comment,&error);
-			if (error == MB_ERROR_NO_ERROR) ocomment++;
-			}
-		strncpy(comment,"\0",256);
-		sprintf(comment,"  Output file:        %s",ofile);
-		status = mb_put_comment(verbose,ombio_ptr,
-				comment,&error);
-		if (error == MB_ERROR_NO_ERROR) ocomment++;
-		strncpy(comment,"\0",256);
-		sprintf(comment,"  Output MBIO format: %d",oformat);
-		status = mb_put_comment(verbose,ombio_ptr,
-				comment,&error);
-		if (error == MB_ERROR_NO_ERROR) ocomment++;
-		strncpy(comment,"\0",256);
-		sprintf(comment,"  Ping averaging:     %d",pings);
-		status = mb_put_comment(verbose,ombio_ptr,
-				comment,&error);
-		if (error == MB_ERROR_NO_ERROR) ocomment++;
-		strncpy(comment,"\0",256);
-		sprintf(comment,"  Longitude flip:     %d",lonflip);
-		status = mb_put_comment(verbose,ombio_ptr,
-				comment,&error);
-		if (error == MB_ERROR_NO_ERROR) ocomment++;
-		strncpy(comment,"\0",256);
-		sprintf(comment,"  Longitude bounds:   %f %f",
-			bounds[0],bounds[1]);
-		status = mb_put_comment(verbose,ombio_ptr,
-				comment,&error);
-		if (error == MB_ERROR_NO_ERROR) ocomment++;
-		strncpy(comment,"\0",256);
-		sprintf(comment,"  Latitude bounds:    %f %f",
-			bounds[2],bounds[3]);
-		status = mb_put_comment(verbose,ombio_ptr,
-				comment,&error);
-		if (error == MB_ERROR_NO_ERROR) ocomment++;
-		strncpy(comment,"\0",256);
-		sprintf(comment,"  Begin time:         %d %d %d %d %d %d %d",
-			btime_i[0],btime_i[1],btime_i[2],
-			btime_i[3],btime_i[4],btime_i[5],btime_i[6]);
-		status = mb_put_comment(verbose,ombio_ptr,
-				comment,&error);
-		if (error == MB_ERROR_NO_ERROR) ocomment++;
-		strncpy(comment,"\0",256);
-		sprintf(comment,"  End time:           %d %d %d %d %d %d %d",
-			etime_i[0],etime_i[1],etime_i[2],
-			etime_i[3],etime_i[4],etime_i[5],etime_i[6]);
-		status = mb_put_comment(verbose,ombio_ptr,
-				comment,&error);
-		if (error == MB_ERROR_NO_ERROR) ocomment++;
-		strncpy(comment,"\0",256);
-		sprintf(comment,"  Minimum speed:      %f",speedmin);
-		status = mb_put_comment(verbose,ombio_ptr,
-				comment,&error);
-		if (error == MB_ERROR_NO_ERROR) ocomment++;
-		strncpy(comment,"\0",256);
-		sprintf(comment,"  Time gap:           %f",timegap);
-		status = mb_put_comment(verbose,ombio_ptr,
-				comment,&error);
-		if (error == MB_ERROR_NO_ERROR) ocomment++;
-		strncpy(comment,"\0",256);
-		sprintf(comment," ");
-		status = mb_put_comment(verbose,ombio_ptr,
-				comment,&error);
-		if (error == MB_ERROR_NO_ERROR) ocomment++;
-		}
-
-	/* start expecting data to be in time and space bounds */
-	inbounds = MB_YES;
-
-	/* read and write */
-	while (error <= MB_ERROR_NO_ERROR)
-		{
-
-		/* read some data */
-		error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-		if (copymode != MBCOPY_PARTIAL)
-			{
-			status = mb_get_all(verbose,imbio_ptr,&istore_ptr,&kind,
-				time_i,&time_d,
-				&navlon,&navlat,
-				&speed,&heading,
-				&distance,&altitude,&sonardepth,
-				&nbath,&namp,&nss,
-				ibeamflag,ibath,iamp,
-				ibathacrosstrack,ibathalongtrack,
-				iss,issacrosstrack,issalongtrack,
-				comment,&error);
-			}
-		else
-			{
-			status = mb_get(verbose,imbio_ptr,&kind,&pings,
-				time_i,&time_d,
-				&navlon,&navlat,
-				&speed,&heading,
-				&distance,&altitude,&sonardepth,
-				&nbath,&namp,&nss,
-				ibeamflag,ibath,iamp,
-				ibathacrosstrack,ibathalongtrack,
-				iss,issacrosstrack,issalongtrack,
-				comment,&error);
-			}
-
-		/* increment counter */
-		if (error <= MB_ERROR_NO_ERROR
-			&& kind == MB_DATA_DATA)
-			idata = idata + pings;
-		else if (error <= MB_ERROR_NO_ERROR
-			&& kind == MB_DATA_COMMENT)
-			icomment++;
-
-		/* time gaps do not matter to mbcopy */
-		if (error == MB_ERROR_TIME_GAP)
-			{
-			status = MB_SUCCESS;
-			error = MB_ERROR_NO_ERROR;
-			}
-
-		/* check for survey data in or out of bounds */
-		if (kind == MB_DATA_DATA)
-			{
-			if (error == MB_ERROR_NO_ERROR)
-				inbounds = MB_YES;
-			else if (error == MB_ERROR_OUT_BOUNDS
-				||error == MB_ERROR_OUT_TIME)
-				inbounds = MB_NO;
-			}
-
-
-		if(merge == MB_YES
-			&& kind == MB_DATA_DATA
-			&& error == MB_ERROR_NO_ERROR
-			&& inbounds == MB_YES)
-			{
-			  while (merror <= MB_ERROR_NO_ERROR
-				 && (mkind != MB_DATA_DATA
-				 	|| time_d - .001 > mtime_d))
-			    {
-			      /* find merge record */
-
-			      mstatus = mb_get(verbose,mmbio_ptr,&mkind,&mpings,
-					       mtime_i,&mtime_d,
-					       &mnavlon,&mnavlat,
-					       &mspeed,&mheading,
-					       &mdistance,&maltitude,&msonardepth,
-					       &mnbath,&mnamp,&mnss,
-					       mbeamflag,mbath,mamp,
-					       mbathacrosstrack,mbathalongtrack,
-					       mss,mssacrosstrack,mssalongtrack,
-					       mcomment,&merror);
-
-			    }
-
-			  if (time_d + .001 < mtime_d ||
-			      merror > 0)
-			    {
-			      inbounds = MB_NO;
-			    }
-			}
-
-		/* check numbers of input and output beams */
-		if (copymode == MBCOPY_PARTIAL
-			&& kind == MB_DATA_DATA
-			&& error == MB_ERROR_NO_ERROR
-			&& nbath != ibeams_bath)
-			{
-			ibeams_bath = nbath;
-			if (omb_io_ptr->variable_beams == MB_YES)
-				obeams_bath = ibeams_bath;
-			setup_transfer_rules(verbose,ibeams_bath,obeams_bath,
-				&istart_bath,&iend_bath,&offset_bath,&error);
-			}
-		if (copymode == MBCOPY_PARTIAL
-			&& kind == MB_DATA_DATA
-			&& error == MB_ERROR_NO_ERROR
-			&& namp != ibeams_amp)
-			{
-			ibeams_amp = namp;
-			if (omb_io_ptr->variable_beams == MB_YES)
-				obeams_amp = ibeams_amp;
-			setup_transfer_rules(verbose,ibeams_amp,obeams_amp,
-				&istart_amp,&iend_amp,&offset_amp,&error);
-			}
-		if (copymode == MBCOPY_PARTIAL
-			&& kind == MB_DATA_DATA
-			&& error == MB_ERROR_NO_ERROR
-			&& nss != ipixels_ss)
-			{
-			ipixels_ss = nss;
-			if (omb_io_ptr->variable_beams == MB_YES)
-				opixels_ss = ipixels_ss;
-			setup_transfer_rules(verbose,ipixels_ss,opixels_ss,
-				&istart_ss,&iend_ss,&offset_ss,&error);
-			}
-
-		/* output error messages */
-		if (verbose >= 1 && error == MB_ERROR_COMMENT)
-			{
-			if (icomment == 1)
-				fprintf(stderr,"\nComments:\n");
-			fprintf(stderr,"%s\n",comment);
-			}
-		else if (verbose >= 1 && error < MB_ERROR_NO_ERROR
-			&& error >= MB_ERROR_OTHER)
-			{
-			mb_error(verbose,error,&message);
-			fprintf(stderr,"\nNonfatal MBIO Error:\n%s\n",message);
-			fprintf(stderr,"Input Record: %d\n",idata);
-			fprintf(stderr,"Time: %d %d %d %d %d %d %d\n",
-				time_i[0],time_i[1],time_i[2],
-				time_i[3],time_i[4],time_i[5],time_i[6]);
-			}
-		else if (verbose >= 1 && error < MB_ERROR_NO_ERROR)
-			{
-			mb_error(verbose,error,&message);
-			fprintf(stderr,"\nNonfatal MBIO Error:\n%s\n",message);
-			fprintf(stderr,"Number of good records so far: %d\n",idata);
-			}
-		else if (verbose >= 1 && error != MB_ERROR_NO_ERROR
-			&& error != MB_ERROR_EOF)
-			{
-			mb_error(verbose,error,&message);
-			fprintf(stderr,"\nFatal MBIO Error:\n%s\n",message);
-			fprintf(stderr,"Last Good Time: %d %d %d %d %d %d %d\n",
-				time_i[0],time_i[1],time_i[2],
-				time_i[3],time_i[4],time_i[5],time_i[6]);
-			}
-
-		/* do sleep if required */
-		if (use_sleep == MB_YES
-			&& kind == MB_DATA_DATA
-			&& error <= MB_ERROR_NO_ERROR
-			&& idata == 1)
-			{
-			time_d_last = time_d;
-			}
-		else if (use_sleep == MB_YES
-			&& kind == MB_DATA_DATA
-			&& error <= MB_ERROR_NO_ERROR
-			&& idata > 1)
-			{
-			sleep_time = (unsigned int)
-				(sleep_factor * (time_d - time_d_last));
-			sleep(sleep_time);
-			time_d_last = time_d;
-			}
-
-		/* process some data */
-		if (copymode == MBCOPY_PARTIAL
-			&& kind == MB_DATA_DATA
-			&& error == MB_ERROR_NO_ERROR)
-			{
-			/* zero bathymetry */
-			for (j=0;j<offset_bath;j++)
-				{
-				obeamflag[j] = MB_FLAG_NULL;
-				obath[j] = 0.0;
-				obathacrosstrack[j] = 0.0;
-				obathalongtrack[j] = 0.0;
-				}
-
-			/* do bathymetry */
-			if (merge == MB_YES)
-				{
-				/* merge data */
-				for (i=istart_bath;i<iend_bath;i++)
-					{
-					j = i + offset_bath;
-					obeamflag[j] = mbeamflag[i];
-					obath[j] = mbath[i];
-					obathacrosstrack[j] = mbathacrosstrack[i];
-					obathalongtrack[j] = mbathalongtrack[i];
-					}
-				}
-			else
-				{
-				for (i=istart_bath;i<iend_bath;i++)
-					{
-					j = i + offset_bath;
-					obeamflag[j] = ibeamflag[i];
-					obath[j] = ibath[i];
-					obathacrosstrack[j] = ibathacrosstrack[i];
-					obathalongtrack[j] = ibathalongtrack[i];
-					}
-				}
-			for (j=iend_bath+offset_bath;j<obeams_bath;j++)
-				{
-				obeamflag[j] = MB_FLAG_NULL;
-				obath[j] = 0.0;
-				obathacrosstrack[j] = 0.0;
-				obathalongtrack[j] = 0.0;
-				}
-
-			/* do amplitudes */
-			for (j=0;j<offset_amp;j++)
-				{
-				oamp[j] = 0.0;
-				}
-			for (i=istart_amp;i<iend_amp;i++)
-				{
-				j = i + offset_amp;
-				oamp[j] = iamp[i];
-				}
-			for (j=iend_amp+offset_amp;j<obeams_amp;j++)
-				{
-				oamp[j] = 0.0;
-				}
-
-			/* do sidescan */
-			for (j=0;j<offset_ss;j++)
-				{
-				oss[j] = 0.0;
-				ossacrosstrack[j] = 0.0;
-				ossalongtrack[j] = 0.0;
-				}
-			for (i=istart_ss;i<iend_ss;i++)
-				{
-				j = i + offset_ss;
-				oss[j] = iss[i];
-				ossacrosstrack[j] = issacrosstrack[i];
-				ossalongtrack[j] = issalongtrack[i];
-				}
-			for (j=iend_ss+offset_ss;j<opixels_ss;j++)
-				{
-				oss[j] = 0.0;
-				ossacrosstrack[j] = 0.0;
-				ossalongtrack[j] = 0.0;
-				}
-			}
-
-		/* handle special full translation cases */
-		if (copymode == MBCOPY_FULL
-			&& error == MB_ERROR_NO_ERROR)
-			{
-			ostore_ptr = istore_ptr;
-			}
-		else if (copymode == MBCOPY_ELACMK2_TO_XSE
-			&& error == MB_ERROR_NO_ERROR)
-			{
-			ostore_ptr = omb_io_ptr->store_data;
-			status = mbcopy_elacmk2_to_xse(verbose,
-				    istore_ptr, ostore_ptr, &error);
-			}
-		else if (copymode == MBCOPY_XSE_TO_ELACMK2
-			&& error == MB_ERROR_NO_ERROR)
-			{
-			ostore_ptr = omb_io_ptr->store_data;
-			status = mbcopy_xse_to_elacmk2(verbose,
-				    istore_ptr, ostore_ptr, &error);
-			}
-		else if (copymode == MBCOPY_SIMRAD_TO_SIMRAD2
-			&& error == MB_ERROR_NO_ERROR)
-			{
-			ostore_ptr = omb_io_ptr->store_data;
-			status = mbcopy_simrad_to_simrad2(verbose,
-				    istore_ptr, ostore_ptr, &error);
-			}
-		else if (copymode == MBCOPY_RESON8K_TO_GSF
-			&& error == MB_ERROR_NO_ERROR)
-			{
-
-			ostore_ptr = omb_io_ptr->store_data;
-			status = mbcopy_reson8k_to_gsf(verbose,
-				    imbio_ptr, ombio_ptr, &error);
-			}
-		else if (copymode == MBCOPY_ANY_TO_MBLDEOIH
-			&& error == MB_ERROR_NO_ERROR)
-			{
-			if (kind == MB_DATA_DATA)
-				mb_extract_nav(verbose, imbio_ptr, istore_ptr,
-					&kind, time_i, &time_d,
-					&navlon, &navlat, &speed, &heading, &draft,
-					&roll, &pitch, &heave,
-					&error);
-			ostore_ptr = omb_io_ptr->store_data;
-			if (kind == MB_DATA_DATA
-				|| kind == MB_DATA_COMMENT)
-				{
-				/* strip amplitude and sidescan if requested */
-				if (bathonly == MB_YES)
-				    {
-				    namp = 0;
-				    nss = 0;
-				    }
-
-				/* copy the data to mbldeoih */
-				if (merge == MB_YES)
-					{
-					status = mbcopy_any_to_mbldeoih(verbose,
-						kind, time_i, time_d,
-						navlon, navlat, speed, heading,
-						draft, altitude, roll, pitch, heave,
-						imb_io_ptr->beamwidth_xtrack,
-						imb_io_ptr->beamwidth_ltrack,
-						nbath,namp,nss,
-						mbeamflag,mbath,iamp,mbathacrosstrack,
-						mbathalongtrack,
-						iss,issacrosstrack,issalongtrack,
-						comment,
-						ombio_ptr, ostore_ptr, &error);
-					}
-				else
-					{
-					  status = mbcopy_any_to_mbldeoih(verbose,
-						kind, time_i, time_d,
-						navlon, navlat, speed, heading,
-						draft, altitude, roll, pitch, heave,
-						imb_io_ptr->beamwidth_xtrack,
-						imb_io_ptr->beamwidth_ltrack,
-						nbath,namp,nss,
-						ibeamflag,ibath,iamp,ibathacrosstrack,
-						ibathalongtrack,
-						iss,issacrosstrack,issalongtrack,
-						comment,
-						ombio_ptr, ostore_ptr, &error);
-					}
-				}
-			else
-				error = MB_ERROR_OTHER;
-			}
-		else if (copymode == MBCOPY_PARTIAL
-			&& error == MB_ERROR_NO_ERROR)
-			{
-			istore_ptr = imb_io_ptr->store_data;
-			ostore_ptr = omb_io_ptr->store_data;
-			if (pings == 1 && kind == MB_DATA_DATA)
-				{
-				mb_extract_nav(verbose, imbio_ptr, istore_ptr,
-						&kind, time_i, &time_d,
-						&navlon, &navlat, &speed, &heading, &draft,
-						&roll, &pitch, &heave,
-						&error);
-				mb_insert_nav(verbose, ombio_ptr, ostore_ptr,
-						time_i, time_d,
-						navlon, navlat, speed, heading, draft,
-						roll, pitch, heave,
-						&error);
-				}
-			status = mb_insert(verbose, ombio_ptr, ostore_ptr,
-						kind, time_i, time_d,
-						navlon, navlat, speed, heading,
-						obeams_bath,obeams_amp,opixels_ss,
-						obeamflag,obath,oamp,obathacrosstrack,
-						obathalongtrack,
-						oss,ossacrosstrack,ossalongtrack,
-						comment, &error);
-			}
-
-		if (merge == MB_YES
-		    && kind == MB_DATA_DATA
-		    && error == MB_ERROR_NO_ERROR)
-		  {
-		    switch(copymode) {
-		    case MBCOPY_PARTIAL:
-		    case MBCOPY_ANY_TO_MBLDEOIH:
-		      /* Already looked after */
-		      break;
-		    case MBCOPY_FULL :
-		    case MBCOPY_SIMRAD_TO_SIMRAD2:
-		    case MBCOPY_ELACMK2_TO_XSE:
-		    case MBCOPY_XSE_TO_ELACMK2:
-		    case MBCOPY_RESON8K_TO_GSF:
-		      status = mb_insert(verbose, ombio_ptr, ostore_ptr,
-						kind, time_i, time_d,
-						navlon, navlat, speed, heading,
-						mbeams_bath,ibeams_amp,ipixels_ss,
-						mbeamflag,mbath,iamp,mbathacrosstrack,
-						mbathalongtrack,
-						iss,issacrosstrack,issalongtrack,
-						comment, &error);
-		      break;
-		    }
-		  }
-
-		/* write some data */
-		if ((error == MB_ERROR_NO_ERROR
-				&& kind != MB_DATA_COMMENT
-				&& inbounds == MB_YES)
-			|| (kind == MB_DATA_COMMENT && stripcomments == MB_NO))
-			{
-			status = mb_put_all(verbose,ombio_ptr,
-					ostore_ptr,MB_NO,kind,
-					time_i,time_d,
-					navlon,navlat,speed,heading,
-					obeams_bath,obeams_amp,opixels_ss,
-					obeamflag,obath,oamp,obathacrosstrack,
-					obathalongtrack,
-					oss,ossacrosstrack,ossalongtrack,
-					comment,&error);
-			if (status == MB_SUCCESS)
-				{
-				if (kind == MB_DATA_DATA)
-					odata++;
-				else if (kind == MB_DATA_COMMENT)
-					ocomment++;
-				}
-			else
-				{
-				mb_error(verbose,error,&message);
-				if (copymode != MBCOPY_PARTIAL)
-				    fprintf(stderr,"\nMBIO Error returned from function <mb_put_all>:\n%s\n",message);
-				else
-				    fprintf(stderr,"\nMBIO Error returned from function <mb_put>:\n%s\n",message);
-				fprintf(stderr,"\nMultibeam Data Not Written To File <%s>\n",ofile);
-				fprintf(stderr,"Output Record: %d\n",odata+1);
-				fprintf(stderr,"Time: %d %d %d %d %d %d %d\n",
-					time_i[0],time_i[1],time_i[2],
-					time_i[3],time_i[4],time_i[5],
-					time_i[6]);
-				fprintf(stderr,"\nProgram <%s> Terminated\n",
-					program_name);
-				exit(error);
-				}
-			}
-		}
-
-	/* close the files */
-	status = mb_close(verbose,&imbio_ptr,&error);
-	status = mb_close(verbose,&ombio_ptr,&error);
-
-	/* check memory */
-	if (verbose >= 4)
-		status = mb_memory_list(verbose,&error);
-
-	/* give the statistics */
-	if (verbose >= 1)
-		{
-		fprintf(stderr,"\n%d input data records\n",idata);
-		fprintf(stderr,"%d input comment records\n",icomment);
-		fprintf(stderr,"%d output data records\n",odata);
-		fprintf(stderr,"%d output comment records\n",ocomment);
-		}
-
-	/* end it all */
-	exit(error);
-}
-/*--------------------------------------------------------------------*/
-int setup_transfer_rules(int verbose, int ibeams, int obeams,
-		int *istart, int *iend, int *offset, int *error)
-{
-	char	*function_name = "setup_transfer_rules";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBcopy function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       ibeams:     %d\n",ibeams);
-		fprintf(stderr,"dbg2       obeams:     %d\n",obeams);
-		}
-
-	/* set up transfer rules */
-	if (ibeams == obeams)
-		{
-		*istart = 0;
-		*iend = ibeams;
-		*offset = 0;
-		}
-	else if (ibeams < obeams)
-		{
-		*istart = 0;
-		*iend = ibeams;
-		*offset = obeams/2 - ibeams/2;
-		}
-	else if (ibeams > obeams)
-		{
-		*istart = ibeams/2 - obeams/2;
-		*iend = *istart + obeams;
-		*offset = -*istart;
-		}
-
-	/* assume success */
-	*error = MB_ERROR_NO_ERROR;
-	status = MB_SUCCESS;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBcopy function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2       istart:     %d\n",*istart);
-		fprintf(stderr,"dbg2       iend:       %d\n",*iend);
-		fprintf(stderr,"dbg2       offset:     %d\n",*offset);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbcopy_elacmk2_to_xse(int verbose,
-	struct mbsys_elacmk2_struct *istore,
-	struct mbsys_xse_struct *ostore,
-	int *error)
-{
-	char	*function_name = "mbcopy_elacmk2_to_xse";
-	int	status = MB_SUCCESS;
-	double	time_d;
-	int	time_i[7];
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBcopy function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       istore:     %p\n",(void *)istore);
-		fprintf(stderr,"dbg2       ostore:     %p\n",(void *)ostore);
-		}
-
-	/* copy the data  */
-	if (istore != NULL && ostore != NULL
-		&& (void *) istore != (void *) ostore)
-		{
-		/* type of data record */
-		ostore->kind = istore->kind;  /* Survey, nav, Comment */
-
-		/* parameter (ship frames) */
-		ostore->par_source = 0;		/* sensor id */
-		mb_fix_y2k(verbose, istore->par_year, &time_i[0]);
-		time_i[1] = istore->par_month;
-		time_i[2] = istore->par_day;
-		time_i[3] = istore->par_hour;
-		time_i[4] = istore->par_minute;
-		time_i[5] = istore->par_second;
-		time_i[6] = 10000*istore->par_hundredth_sec
-			+ 100*istore->par_thousandth_sec;
-		mb_get_time(verbose,time_i,&time_d);
-		ostore->par_sec = ((unsigned int) time_d) + MBSYS_XSE_TIME_OFFSET;		/* sec since 1/1/1901 00:00 */
-		ostore->par_usec = (time_d - ((int) time_d)) * 1000000;		/* microseconds */
-		ostore->par_roll_bias = DTR * 0.01 * istore->roll_offset;		/* radians */
-		ostore->par_pitch_bias = DTR * 0.01 * istore->pitch_offset;		/* radians */
-		ostore->par_heading_bias = DTR * 0.01 * istore->heading_offset;	/* radians */
-		ostore->par_time_delay = 0.01 * istore->time_delay;		/* nav time lag, seconds */
-		ostore->par_trans_x_port = 0.01 * istore->transducer_port_x;	/* port transducer x position, meters */
-		ostore->par_trans_y_port = 0.01 * istore->transducer_port_y;	/* port transducer y position, meters */
-		ostore->par_trans_z_port = 0.01 * istore->transducer_port_depth;	/* port transducer z position, meters */
-		ostore->par_trans_x_stbd = 0.01 * istore->transducer_starboard_x;	/* starboard transducer x position, meters */
-		ostore->par_trans_y_stbd = 0.01 * istore->transducer_starboard_y;	/* starboard transducer y position, meters */
-		ostore->par_trans_z_stbd = 0.01 * istore->transducer_starboard_depth;	/* starboard transducer z position, meters */
-		ostore->par_trans_err_port = 0.01 * istore->transducer_port_error;	/* port transducer rotation in roll direction, radians */
-		ostore->par_trans_err_stbd = 0.01 * istore->transducer_starboard_error;	/* starboard transducer rotation in roll direction, radians */
-		ostore->par_nav_x = 0.01 * istore->antenna_x;		/* navigation antenna x position, meters */
-		ostore->par_nav_y = 0.01 * istore->antenna_y;		/* navigation antenna y position, meters */
-		ostore->par_nav_z = 0.01 * istore->antenna_height;		/* navigation antenna z position, meters */
-		ostore->par_hrp_x = 0.01 * istore->vru_x;		/* motion sensor x position, meters */
-		ostore->par_hrp_y = 0.01 * istore->vru_y;		/* motion sensor y position, meters */
-		ostore->par_hrp_z = 0.01 * istore->vru_height;		/* motion sensor z position, meters */
-
-		/* svp (sound velocity frames) */
-		ostore->svp_source = 0;		/* sensor id */
-		mb_fix_y2k(verbose, istore->svp_year, &time_i[0]);
-		time_i[1] = istore->svp_month;
-		time_i[2] = istore->svp_day;
-		time_i[3] = istore->svp_hour;
-		time_i[4] = istore->svp_minute;
-		time_i[5] = istore->svp_second;
-		time_i[6] = 10000*istore->svp_hundredth_sec
-			+ 100*istore->svp_thousandth_sec;
-		mb_get_time(verbose,time_i,&time_d);
-		ostore->svp_sec = ((unsigned int) time_d) + MBSYS_XSE_TIME_OFFSET;		/* sec since 1/1/1901 00:00 */
-		ostore->svp_usec = (time_d - ((int) time_d)) * 1000000;		/* microseconds */
-		ostore->svp_nsvp = istore->svp_num;		/* number of depth values */
-		ostore->svp_nctd = 0;		/* number of ctd values */
-		ostore->svp_ssv = istore->sound_vel;				/* m/s */
-		for (i=0;i<ostore->svp_nsvp;i++)
-		    {
-		    ostore->svp_depth[i] = 0.1 * istore->svp_depth[i];		/* m */
-		    ostore->svp_velocity[i] = 0.1 * istore->svp_vel[i];	/* m/s */
-		    ostore->svp_conductivity[i] = 0.0;	/* mmho/cm */
-		    ostore->svp_salinity[i] = 0.0;	/* o/oo */
-		    ostore->svp_temperature[i] = 0.0;	/* degree celcius */
-		    ostore->svp_pressure[i] = 0.0;	/* bar */
-		    }
-
-		/* position (navigation frames) */
-		ostore->nav_source = 0;		/* sensor id */
-		mb_fix_y2k(verbose, istore->pos_year, &time_i[0]);
-		time_i[1] = istore->pos_month;
-		time_i[2] = istore->pos_day;
-		time_i[3] = istore->pos_hour;
-		time_i[4] = istore->pos_minute;
-		time_i[5] = istore->pos_second;
-		time_i[6] = 10000*istore->pos_hundredth_sec
-			+ 100*istore->pos_thousandth_sec;
-		mb_get_time(verbose,time_i,&time_d);
-		ostore->nav_sec = ((unsigned int) time_d) + MBSYS_XSE_TIME_OFFSET;		/* sec since 1/1/1901 00:00 */
-		ostore->nav_usec = (time_d - ((int) time_d)) * 1000000;		/* microseconds */
-		ostore->nav_quality = 0;
-		ostore->nav_status = 0;
-		ostore->nav_description_len = 0;
-		for (i=0;i<MBSYS_XSE_DESCRIPTION_LENGTH;i++)
-		    ostore->nav_description[i] = 0;
-		ostore->nav_x = DTR * 0.00000009 * istore->pos_longitude;			/* eastings (m) or
-						    longitude (radians) */
-		ostore->nav_y = DTR * 0.00000009 * istore->pos_latitude;			/* northings (m) or
-						    latitude (radians) */
-		ostore->nav_z = 0.0;			/* height (m) or
-						    ellipsoidal height (m) */
-		ostore->nav_speed_ground = 0.0;	/* m/s */
-		ostore->nav_course_ground = DTR * 0.01 * istore->heading;	/* radians */
-		ostore->nav_speed_water = 0.0;	/* m/s */
-		ostore->nav_course_water = 0.0;	/* radians */
-
-		/* survey depth (multibeam frames) */
-		if (ostore->kind == MB_DATA_DATA)
-		    {
-		    ostore->mul_frame = MB_YES;	/* boolean flag - multibeam frame read */
-		    ostore->mul_group_beam = MB_NO;	/* boolean flag - beam group read */
-		    ostore->mul_group_tt = MB_YES;	/* boolean flag - tt group read */
-		    ostore->mul_group_quality = MB_YES;/* boolean flag - quality group read */
-		    ostore->mul_group_amp = MB_YES;	/* boolean flag - amp group read */
-		    ostore->mul_group_delay = MB_YES;	/* boolean flag - delay group read */
-		    ostore->mul_group_lateral = MB_YES;/* boolean flag - lateral group read */
-		    ostore->mul_group_along = MB_YES;	/* boolean flag - along group read */
-		    ostore->mul_group_depth = MB_YES;	/* boolean flag - depth group read */
-		    ostore->mul_group_angle = MB_YES;	/* boolean flag - angle group read */
-		    ostore->mul_group_heave = MB_YES;	/* boolean flag - heave group read */
-		    ostore->mul_group_roll = MB_YES;	/* boolean flag - roll group read */
-		    ostore->mul_group_pitch = MB_YES;	/* boolean flag - pitch group read */
-		    ostore->mul_group_gates = MB_NO;	/* boolean flag - gates group read */
-		    ostore->mul_group_noise = MB_NO;	/* boolean flag - noise group read */
-		    ostore->mul_group_length = MB_NO;	/* boolean flag - length group read */
-		    ostore->mul_group_hits = MB_NO;		/* boolean flag - hits group read */
-		    ostore->mul_group_heavereceive = MB_NO;	/* boolean flag - heavereceive group read */
-		    ostore->mul_group_azimuth = MB_NO;	/* boolean flag - azimuth group read */
-		    ostore->mul_group_mbsystemnav = MB_YES;	/* boolean flag - mbsystemnav group read */
-		    }
-		else
-		    {
-		    ostore->mul_frame = MB_NO;	/* boolean flag - multibeam frame read */
-		    ostore->mul_group_beam = MB_NO;	/* boolean flag - beam group read */
-		    ostore->mul_group_tt = MB_NO;	/* boolean flag - tt group read */
-		    ostore->mul_group_quality = MB_NO;/* boolean flag - quality group read */
-		    ostore->mul_group_amp = MB_NO;	/* boolean flag - amp group read */
-		    ostore->mul_group_delay = MB_NO;	/* boolean flag - delay group read */
-		    ostore->mul_group_lateral = MB_NO;/* boolean flag - lateral group read */
-		    ostore->mul_group_along = MB_NO;	/* boolean flag - along group read */
-		    ostore->mul_group_depth = MB_NO;	/* boolean flag - depth group read */
-		    ostore->mul_group_angle = MB_NO;	/* boolean flag - angle group read */
-		    ostore->mul_group_heave = MB_NO;	/* boolean flag - heave group read */
-		    ostore->mul_group_roll = MB_NO;	/* boolean flag - roll group read */
-		    ostore->mul_group_pitch = MB_NO;	/* boolean flag - pitch group read */
-		    ostore->mul_group_gates = MB_NO;	/* boolean flag - gates group read */
-		    ostore->mul_group_noise = MB_NO;	/* boolean flag - noise group read */
-		    ostore->mul_group_length = MB_NO;	/* boolean flag - length group read */
-		    ostore->mul_group_hits = MB_NO;		/* boolean flag - hits group read */
-		    ostore->mul_group_heavereceive = MB_NO;	/* boolean flag - heavereceive group read */
-		    ostore->mul_group_azimuth = MB_NO;	/* boolean flag - azimuth group read */
-		    ostore->mul_group_mbsystemnav = MB_NO;	/* boolean flag - mbsystemnav group read */
-		    }
-		ostore->mul_source = 0;		/* sensor id */
-		mb_fix_y2k(verbose, istore->pos_year, &time_i[0]);
-		time_i[1] = istore->month;
-		time_i[2] = istore->day;
-		time_i[3] = istore->hour;
-		time_i[4] = istore->minute;
-		time_i[5] = istore->second;
-		time_i[6] = 10000*istore->hundredth_sec
-			+ 100*istore->thousandth_sec;
-		mb_get_time(verbose,time_i,&time_d);
-		ostore->mul_sec = ((unsigned int) time_d) + MBSYS_XSE_TIME_OFFSET;		/* sec since 1/1/1901 00:00 */
-		ostore->mul_usec = (time_d - ((int) time_d)) * 1000000;		/* microseconds */
-		ostore->mul_lon = DTR * istore->longitude;		/* longitude (radians) */
-		ostore->mul_lat = DTR * istore->latitude;		/* latitude (radians) */
-		ostore->mul_heading = DTR * 0.01 * istore->heading;		/* heading (radians) */
-		ostore->mul_speed = 0.0;		/* speed (m/s) */
-		ostore->mul_ping = istore->ping_num;		/* ping number */
-		ostore->mul_frequency = 0.0;	/* transducer frequency (Hz) */
-		ostore->mul_pulse = istore->pulse_length;		/* transmit pulse length (sec) */
-		ostore->mul_power = istore->source_power;		/* transmit power (dB) */
-		ostore->mul_bandwidth = 0.0;	/* receive bandwidth (Hz) */
-		ostore->mul_sample = 0.0;		/* receive sample interval (sec) */
-		ostore->mul_swath = 0.0;		/* swath width (radians) */
-		ostore->mul_num_beams = istore->beams_bath;	/* number of beams */
-		for (i=0;i<ostore->mul_num_beams;i++)
-		    {
-		    j = istore->beams_bath - i - 1;
-		    ostore->beams[i].tt = 0.0001 * istore->beams[j].tt;
-		    ostore->beams[i].delay = 0.0005 * istore->beams[j].time_offset;
-		    ostore->beams[i].lateral = 0.01 * istore->beams[j].bath_acrosstrack;
-		    ostore->beams[i].along = 0.01 * istore->beams[j].bath_alongtrack;
-		    ostore->beams[i].depth = 0.01 * istore->beams[j].bath;
-		    ostore->beams[i].angle = DTR * 0.005 * istore->beams[j].angle;
-		    ostore->beams[i].heave = 0.001 * istore->beams[j].heave;
-		    ostore->beams[i].roll = DTR * 0.005 * istore->beams[j].roll;
-		    ostore->beams[i].pitch = DTR * 0.005 * istore->beams[j].pitch;
-		    ostore->beams[i].beam = i + 1;
-		    ostore->beams[i].quality = istore->beams[j].quality;
-		    ostore->beams[i].amplitude = istore->beams[j].amplitude;
-		    }
-
-		/* survey sidescan (sidescan frames) */
-		ostore->sid_frame = MB_NO;		/* boolean flag - sidescan frame read */
-		ostore->sid_group_avt = MB_NO;		/* boolean flag - amp vs time group read */
-		ostore->sid_group_pvt = MB_NO;		/* boolean flag - phase vs time group read */
-		ostore->sid_group_avl = MB_NO;		/* boolean flag - amp vs lateral group read */
-		ostore->sid_group_pvl = MB_NO;		/* boolean flag - phase vs lateral group read */
-		ostore->sid_group_signal = MB_NO;	/* boolean flag - phase vs lateral group read */
-		ostore->sid_group_ping = MB_NO;		/* boolean flag - phase vs lateral group read */
-		ostore->sid_group_complex = MB_NO;	/* boolean flag - phase vs lateral group read */
-		ostore->sid_group_weighting = MB_NO;	/* boolean flag - phase vs lateral group read */
-		ostore->sid_source = 0;		/* sensor id */
-		ostore->sid_sec = 0;	/* sec since 1/1/1901 00:00 */
-		ostore->sid_usec = 0;	/* microseconds */
-		ostore->sid_ping = 0;		/* ping number */
-		ostore->sid_frequency = 0.0;		/* transducer frequency (Hz) */
-		ostore->sid_pulse = 0.0;		/* transmit pulse length (sec) */
-		ostore->sid_power = 0.0;		/* transmit power (dB) */
-		ostore->sid_bandwidth = 0.0;		/* receive bandwidth (Hz) */
-		ostore->sid_sample = 0.0;		/* receive sample interval (sec) */
-		ostore->sid_avt_sampleus = 0;	/* sample interval (usec) */
-		ostore->sid_avt_offset = 0;		/* time offset (usec) */
-		ostore->sid_avt_num_samples = 0;	/* number of samples */
-		for (i=0;i<MBSYS_XSE_MAXPIXELS;i++)
-			ostore->sid_avt_amp[i] = 0; /* sidescan amplitude (dB) */
-		ostore->sid_pvt_sampleus = 0;	/* sample interval (usec) */
-		ostore->sid_pvt_offset = 0;		/* time offset (usec) */
-		ostore->sid_pvt_num_samples = 0;	/* number of samples */
-		for (i=0;i<MBSYS_XSE_MAXPIXELS;i++)
-			ostore->sid_pvt_phase[i] = 0; /* sidescan phase (radians) */
-		ostore->sid_avl_binsize = 0;	/* bin size (mm) */
-		ostore->sid_avl_offset = 0;		/* lateral offset (mm) */
-		ostore->sid_avl_num_samples = 0;	/* number of samples */
-		for (i=0;i<MBSYS_XSE_MAXPIXELS;i++)
-			ostore->sid_avl_amp[i] = 0; /* sidescan amplitude (dB) */
-		ostore->sid_pvl_binsize = 0;	/* bin size (mm) */
-		ostore->sid_pvl_offset = 0;		/* lateral offset (mm) */
-		ostore->sid_pvl_num_samples = 0;	/* number of samples */
-		for (i=0;i<MBSYS_XSE_MAXPIXELS;i++)
-			ostore->sid_pvl_phase[i] = 0; /* sidescan phase (radians) */
-		ostore->sid_sig_ping = 0;		/* ping number */
-		ostore->sid_sig_channel = 0;	/* channel number */
-		ostore->sid_sig_offset = 0.0;		/* start offset */
-		ostore->sid_sig_sample = 0.0;		/* bin size / sample interval */
-		ostore->sid_sig_num_samples = 0;	/* number of samples */
-		for (i=0;i<MBSYS_XSE_MAXPIXELS;i++)
-			ostore->sid_sig_phase[i] = 0; /* sidescan phase in radians */
-		ostore->sid_png_pulse = 0;	/* pulse type (0=constant, 1=linear sweep) */
-		ostore->sid_png_startfrequency = 0.0;	/* start frequency (Hz) */
-		ostore->sid_png_endfrequency = 0.0;	/* end frequency (Hz) */
-		ostore->sid_png_duration = 0.0;	/* pulse duration (msec) */
-		ostore->sid_png_mancode = 0;	/* manufacturer code (1=Edgetech, 2=Elac) */
-		ostore->sid_png_pulseid = 0;/* pulse identifier */
-		for (i=0;i<MBSYS_XSE_DESCRIPTION_LENGTH;i++)
-			ostore->sid_png_pulsename[i] = 0;	/* pulse name */
-		ostore->sid_cmp_ping = 0;		/* ping number */
-		ostore->sid_cmp_channel = 0;	/* channel number */
-		ostore->sid_cmp_offset = 0.0;		/* start offset (usec) */
-		ostore->sid_cmp_sample = 0.0;		/* bin size / sample interval (usec) */
-		ostore->sid_cmp_num_samples = 0;	/* number of samples */
-		for (i=0;i<MBSYS_XSE_MAXPIXELS;i++)
-			ostore->sid_cmp_real[i] = 0; /* real sidescan signal */
-		for (i=0;i<MBSYS_XSE_MAXPIXELS;i++)
-			ostore->sid_cmp_imaginary[i] = 0; /* imaginary sidescan signal */
-		ostore->sid_wgt_factorleft = 0;		/* weighting factor for block floating
-						point expansion  --
-						defined as 2^(-N) volts for lsb */
-		ostore->sid_wgt_samplesleft = 0;	/* number of left samples */
-		ostore->sid_wgt_factorright = 0;		/* weighting factor for block floating
-						point expansion  --
-						defined as 2^(-N) volts for lsb */
-		ostore->sid_wgt_samplesright = 0;	/* number of right samples */
-
-		/* comment */
-		for (i=0;i<MIN(MBSYS_ELACMK2_COMMENT_LENGTH, MBSYS_XSE_COMMENT_LENGTH);i++)
-			ostore->comment[i] = istore->comment[i];
-
-		/* unsupported frame */
-		ostore->rawsize = 0;
-		for (i=0;i<MBSYS_XSE_BUFFER_SIZE;i++)
-		    ostore->raw[i] = 0;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBcopy function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbcopy_xse_to_elacmk2(int verbose,
-		struct mbsys_xse_struct *istore,
-		struct mbsys_elacmk2_struct *ostore,
-		int *error)
-{
-	char	*function_name = "mbcopy_xse_to_elacmk2";
-	int	status = MB_SUCCESS;
-	double	time_d;
-	int	time_i[7];
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBcopy function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       istore:     %p\n",(void *)istore);
-		fprintf(stderr,"dbg2       ostore:     %p\n",(void *)ostore);
-		fprintf(stderr,"dbg2       kind:       %d\n",istore->kind);
-		}
-
-	/* copy the data  */
-	if (istore != NULL && ostore != NULL
-		&& (void *) istore != (void *) ostore)
-		{
-		/* type of data record */
-		ostore->kind = istore->kind;
-		ostore->sonar = MBSYS_ELACMK2_UNKNOWN;
-
-		/* parameter telegram */
-		time_d = istore->par_sec
-			    - MBSYS_XSE_TIME_OFFSET
-			    + 0.000001 * istore->par_usec;
-		mb_get_date(verbose,time_d,time_i);
-		mb_unfix_y2k(verbose, time_i[0], &ostore->par_year);
-		ostore->par_month = time_i[1];
-		ostore->par_day = time_i[2];
-		ostore->par_hour = time_i[3];
-		ostore->par_minute = time_i[4];
-		ostore->par_second = time_i[5];
-		ostore->par_hundredth_sec = time_i[6]/10000;
-		ostore->par_thousandth_sec
-			= (time_i[6]
-			- 10000 * ostore->par_hundredth_sec)/100;
-		ostore->roll_offset = RTD * 100 * istore->par_roll_bias;		/* roll offset (degrees) */
-		ostore->pitch_offset = RTD * 100 * istore->par_pitch_bias;	/* pitch offset (degrees) */
-		ostore->heading_offset = RTD * 100 * istore->par_heading_bias;	/* heading offset (degrees) */
-		ostore->time_delay = 100 * istore->par_time_delay;		/* positioning system delay (sec) */
-		ostore->transducer_port_height = 0;
-		ostore->transducer_starboard_height = 0;
-		ostore->transducer_port_depth = 200 * istore->par_trans_z_port;
-		ostore->transducer_starboard_depth = 200 * istore->par_trans_z_stbd;
-		ostore->transducer_port_x = 200 * istore->par_trans_x_port;
-		ostore->transducer_starboard_x = 200 * istore->par_trans_x_port;
-		ostore->transducer_port_y = 200 * istore->par_trans_x_port;
-		ostore->transducer_starboard_y = 200 * istore->par_trans_x_port;
-		ostore->transducer_port_error = 200 * RTD * istore->par_trans_err_port;
-		ostore->transducer_starboard_error = 200 * RTD * istore->par_trans_err_stbd;
-		ostore->antenna_height = 200 * istore->par_nav_z;
-		ostore->antenna_x = 200 * istore->par_nav_x;
-		ostore->antenna_y = 200 * istore->par_nav_y;
-		ostore->vru_height = 200 * istore->par_hrp_z;
-		ostore->vru_x = 200 * istore->par_hrp_x;
-		ostore->vru_y =200 * istore->par_hrp_y;
-		ostore->line_number = 0;
-		ostore->start_or_stop = 0;
-		ostore->transducer_serial_number = 0;
-		for (i=0;i<MIN(MBSYS_ELACMK2_COMMENT_LENGTH, MBSYS_XSE_COMMENT_LENGTH);i++)
-			ostore->comment[i] = istore->comment[i];
-
-		/* position (position telegrams) */
-		time_d = istore->nav_sec
-			    - MBSYS_XSE_TIME_OFFSET
-			    + 0.000001 * istore->nav_usec;
-		mb_get_date(verbose,time_d,time_i);
-		mb_unfix_y2k(verbose, time_i[0], &ostore->pos_year);
-		ostore->pos_month = time_i[1];
-		ostore->pos_day = time_i[2];
-		ostore->pos_hour = time_i[3];
-		ostore->pos_minute = time_i[4];
-		ostore->pos_second = time_i[5];
-		ostore->pos_hundredth_sec = time_i[6]/10000;
-		ostore->pos_thousandth_sec
-			= (time_i[6]
-			- 10000 * ostore->pos_hundredth_sec)/100;
-		ostore->pos_latitude = RTD * istore->nav_y / 0.00000009;
-		ostore->pos_longitude = RTD * istore->nav_x / 0.00000009;
-		ostore->utm_northing = 0;
-		ostore->utm_easting = 0;
-		ostore->utm_zone_lon = 0;
-		ostore->utm_zone = 0;
-		ostore->hemisphere = 0;
-		ostore->ellipsoid = 0;
-		ostore->pos_spare = 0;
-		ostore->semi_major_axis = 0;
-		ostore->other_quality = 0;
-
-		/* sound velocity profile */
-		time_d = istore->svp_sec
-			    - MBSYS_XSE_TIME_OFFSET
-			    + 0.000001 * istore->svp_usec;
-		mb_get_date(verbose,time_d,time_i);
-		mb_unfix_y2k(verbose, time_i[0], &ostore->svp_year);
-		ostore->svp_month = time_i[1];
-		ostore->svp_day = time_i[2];
-		ostore->svp_hour = time_i[3];
-		ostore->svp_minute = time_i[4];
-		ostore->svp_second = time_i[5];
-		ostore->svp_hundredth_sec = time_i[6]/10000;
-		ostore->svp_thousandth_sec
-			= (time_i[6]
-			- 10000 * ostore->svp_hundredth_sec)/100;
-		ostore->svp_num = istore->svp_nsvp;
-		for (i=0;i<500;i++)
-			{
-			ostore->svp_depth[i] = 10 * istore->svp_depth[i]; /* 0.1 meters */
-			ostore->svp_vel[i] = 10 * istore->svp_velocity[i];	/* 0.1 meters/sec */
-			}
-
-		/* depth telegram */
-		time_d = istore->mul_sec
-			    - MBSYS_XSE_TIME_OFFSET
-			    + 0.000001 * istore->mul_usec;
-		mb_get_date(verbose,time_d,time_i);
-		mb_unfix_y2k(verbose, time_i[0], &ostore->year);
-		ostore->month = time_i[1];
-		ostore->day = time_i[2];
-		ostore->hour = time_i[3];
-		ostore->minute = time_i[4];
-		ostore->second = time_i[5];
-		ostore->hundredth_sec = time_i[6]/10000;
-		ostore->thousandth_sec
-			= (time_i[6]
-			- 10000 * ostore->hundredth_sec)/100;
-		ostore->longitude = RTD * istore->mul_lon;
-		ostore->latitude = RTD * istore->mul_lat;
-		ostore->ping_num = istore->mul_ping;
-		ostore->sound_vel = 10 * istore->svp_ssv;
-		ostore->heading = 100 * RTD * istore->nav_course_ground;
-		ostore->pulse_length = istore->mul_pulse;
-		ostore->mode = 0;
-		ostore->source_power = istore->mul_power;
-		ostore->receiver_gain_stbd = 0;
-		ostore->receiver_gain_port = 0;
-		ostore->reserved = 0;
-		ostore->beams_bath = 0;
-		for (i=0;i<MBSYS_ELACMK2_MAXBEAMS;i++)
-			{
-			ostore->beams[i].bath = 0;
-			ostore->beams[i].bath_acrosstrack = 0;
-			ostore->beams[i].bath_alongtrack = 0;
-			ostore->beams[i].tt = 0;
-			ostore->beams[i].quality = 0;
-			ostore->beams[i].amplitude = 0;
-			ostore->beams[i].time_offset = 0;
-			ostore->beams[i].heave = 0;
-			ostore->beams[i].roll = 0;
-			ostore->beams[i].pitch = 0;
-			ostore->beams[i].angle = 0;
-			}
-		ostore->beams_bath = istore->beams[istore->mul_num_beams-1].beam;
-		for (i=0;i<istore->mul_num_beams;i++)
-			{
-			j = ostore->beams_bath - istore->beams[i].beam;
-			ostore->beams[j].bath = 100 * istore->beams[i].depth;
-			ostore->beams[j].bath_acrosstrack = -100 * istore->beams[i].lateral;
-			ostore->beams[j].bath_alongtrack = 100 * istore->beams[i].along;
-			ostore->beams[j].tt = 10000 * istore->beams[i].tt;
-			ostore->beams[j].quality = istore->beams[i].quality;
-			ostore->beams[j].amplitude = istore->beams[i].amplitude;
-			ostore->beams[j].time_offset = 10000 * istore->beams[i].delay;
-			ostore->beams[j].heave = 1000 * istore->beams[i].heave;
-			ostore->beams[j].roll = 200 * RTD * istore->beams[i].roll;
-			ostore->beams[j].pitch = 200 * RTD * istore->beams[i].pitch;
-			ostore->beams[j].angle = 200 * istore->beams[i].angle;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBcopy function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbcopy_simrad_to_simrad2(int verbose,
-		struct mbsys_simrad_struct *istore,
-		struct mbsys_simrad2_struct *ostore,
-		int *error)
-{
-	char	*function_name = "mbcopy_simrad_to_simrad2";
-	int	status = MB_SUCCESS;
-	struct mbsys_simrad_survey_struct *iping;
-	struct mbsys_simrad2_ping_struct *oping;
-	double	*angles_simrad;
-	double	bath_offset;
-	double	alpha, beta, theta, phi;
-	int	istep = 0;
-	int	interleave = 0;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBcopy function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       istore:     %p\n",(void *)istore);
-		fprintf(stderr,"dbg2       ostore:     %p\n",(void *)ostore);
-		fprintf(stderr,"dbg2       kind:       %d\n",istore->kind);
-		}
-
-	/* copy the data  */
-	if (istore != NULL && ostore != NULL
-		&& (void *) istore != (void *) ostore)
-		{
-		/* type of data record */
-		ostore->kind = istore->kind;
-		ostore->type = EM2_NONE;
-  		if (istore->kind == MB_DATA_DATA)
-		    ostore->type = EM2_BATH;
-		else if (istore->kind == MB_DATA_COMMENT)
-		    ostore->type = EM2_START;
-		else if (istore->kind == MB_DATA_START)
-		    ostore->type = EM2_START;
-		else if (istore->kind == MB_DATA_STOP)
-		    ostore->type = EM2_STOP2;
-		else if (istore->kind == MB_DATA_NAV)
-		    ostore->type = EM2_POS;
-		else if (istore->kind == MB_DATA_VELOCITY_PROFILE)
-		    ostore->type = EM2_SVP;
-		if (istore->sonar == MBSYS_SIMRAD_EM12S)
-		    ostore->sonar = MBSYS_SIMRAD2_EM12S;
-		else if (istore->sonar == MBSYS_SIMRAD_EM12D)
-		    ostore->sonar = MBSYS_SIMRAD2_EM12D;
-		else if (istore->sonar == MBSYS_SIMRAD_EM1000)
-		    ostore->sonar = MBSYS_SIMRAD2_EM1000;
-		else if (istore->sonar == MBSYS_SIMRAD_EM121)
-		    ostore->sonar = MBSYS_SIMRAD2_EM121;
-
-		/* time stamp */
-		mbcopy_simrad_time_convert(verbose,
-		    istore->year, istore->month,
-		    istore->day, istore->hour,
-		    istore->minute, istore->second,
-		    istore->centisecond,
-		    &ostore->date, &ostore->msec,
-		    error);
-
-		/* installation parameter values */
-		ostore->par_date = 0;	/* installation parameter date = year*10000 + month*100 + day
-					    Feb 26, 1995 = 19950226 */
-		ostore->par_msec = 0;	/* installation parameter time since midnight in msec
-					    08:12:51.234 = 29570234 */
-		mbcopy_simrad_time_convert(verbose,
-		    istore->par_year, istore->par_month,
-		    istore->par_day, istore->par_hour,
-		    istore->par_minute, istore->par_second,
-		    istore->par_centisecond,
-		    &ostore->par_date, &ostore->par_msec,
-		    error);
-		ostore->par_line_num = istore->survey_line; /* survey line number */
-		ostore->par_serial_1 = 0;/* system 1 serial number */
-		ostore->par_serial_2 = 0;/* system 2 serial number */
-		ostore->par_wlz = 0.0;	/* water line vertical location (m) */
-		ostore->par_smh = 0;	/* system main head serial number */
-		if (istore->sonar == MBSYS_SIMRAD_EM100)
-		    {
-		    ostore->par_s1z = istore->em100_td;	/* transducer 1 vertical location (m) */
-		    ostore->par_s1x = istore->em100_tx;	/* transducer 1 along location (m) */
-		    ostore->par_s1y = istore->em100_ty;	/* transducer 1 athwart location (m) */
-		    }
-		else if (istore->sonar == MBSYS_SIMRAD_EM1000)
-		    {
-		    ostore->par_s1z = istore->em1000_td;	/* transducer 1 vertical location (m) */
-		    ostore->par_s1x = istore->em1000_tx;	/* transducer 1 along location (m) */
-		    ostore->par_s1y = istore->em1000_ty;	/* transducer 1 athwart location (m) */
-		    }
-		else
-		    {
-		    ostore->par_s1z = istore->em12_td;	/* transducer 1 vertical location (m) */
-		    ostore->par_s1x = istore->em12_tx;	/* transducer 1 along location (m) */
-		    ostore->par_s1y = istore->em12_ty;	/* transducer 1 athwart location (m) */
-		    }
-		ostore->par_s1h = istore->heading_offset;	/* transducer 1 heading (deg) */
-		ostore->par_s1r = istore->roll_offset;	/* transducer 1 roll (m) */
-		ostore->par_s1p = istore->pitch_offset;	/* transducer 1 pitch (m) */
-		ostore->par_s1n = 0;	/* transducer 1 number of modules */
-		ostore->par_s2z = 0.0;	/* transducer 2 vertical location (m) */
-		ostore->par_s2x = 0.0;	/* transducer 2 along location (m) */
-		ostore->par_s2y = 0.0;	/* transducer 2 athwart location (m) */
-		ostore->par_s2h = 0.0;	/* transducer 2 heading (deg) */
-		ostore->par_s2r = 0.0;	/* transducer 2 roll (m) */
-		ostore->par_s2p = 0.0;	/* transducer 2 pitch (m) */
-		ostore->par_s2n = 0;	/* transducer 2 number of modules */
-		ostore->par_go1 = 0.0;	/* system (sonar head 1) gain offset */
-		ostore->par_go2 = 0.0;	/* sonar head 2 gain offset */
-		for (i=0;i<16;i++)
-		    {
-		    ostore->par_tsv[i] = '\0';	/* transmitter (sonar head 1) software version */
-		    ostore->par_rsv[i] = '\0';	/* receiver (sonar head 2) software version */
-		    ostore->par_bsv[i] = '\0';	/* beamformer software version */
-		    ostore->par_psv[i] = '\0';	/* processing unit software version */
-		    ostore->par_osv[i] = '\0';	/* operator station software version */
-		    }
-		ostore->par_dsd = 0.0;	/* depth sensor time delay (msec) */
-		ostore->par_dso = 0.0;	/* depth sensor offset */
-		ostore->par_dsf = 0.0;	/* depth sensor scale factor */
-		ostore->par_dsh[0] = 'I';	/* depth sensor heave (IN or NI) */
-		ostore->par_dsh[1] = 'N';	/* depth sensor heave (IN or NI) */
-		ostore->par_aps = 0;	/* active position system number */
-		ostore->par_p1m = 0;	/* position system 1 motion compensation (boolean) */
-		ostore->par_p1t = 0;	/* position system 1 time stamp used
-					    (0=system time, 1=position input time) */
-		ostore->par_p1z = 0.0;	/* position system 1 vertical location (m) */
-		ostore->par_p1x = 0.0;	/* position system 1 along location (m) */
-		ostore->par_p1y = 0.0;	/* position system 1 athwart location (m) */
-		ostore->par_p1d = istore->pos_delay;	/* position system 1 time delay (sec) */
-		for (i=0;i<16;i++)
-		    {
-		    ostore->par_p1g[i] = '\0';	/* position system 1 geodetic datum */
-		    }
-		ostore->par_p2m = 0;	/* position system 2 motion compensation (boolean) */
-		ostore->par_p2t = 0;	/* position system 2 time stamp used
-					    (0=system time, 1=position input time) */
-		ostore->par_p2z = 0.0;	/* position system 2 vertical location (m) */
-		ostore->par_p2x = 0.0;	/* position system 2 along location (m) */
-		ostore->par_p2y = 0.0;	/* position system 2 athwart location (m) */
-		ostore->par_p2d = 0.0;	/* position system 2 time delay (sec) */
-		for (i=0;i<16;i++)
-		    {
-		    ostore->par_p2g[i] = '\0';	/* position system 2 geodetic datum */
-		    }
-		ostore->par_p3m = 0;	/* position system 3 motion compensation (boolean) */
-		ostore->par_p3t = 0;	/* position system 3 time stamp used
-					    (0=system time, 1=position input time) */
-		ostore->par_p3z = 0.0;	/* position system 3 vertical location (m) */
-		ostore->par_p3x = 0.0;	/* position system 3 along location (m) */
-		ostore->par_p3y = 0.0;	/* position system 3 athwart location (m) */
-		ostore->par_p3d = 0.0;	/* position system 3 time delay (sec) */
-		for (i=0;i<16;i++)
-		    {
-		    ostore->par_p3g[i] = '\0';	/* position system 3 geodetic datum */
-		    }
-		ostore->par_msz = 0.0;	/* motion sensor vertical location (m) */
-		ostore->par_msx = 0.0;	/* motion sensor along location (m) */
-		ostore->par_msy = 0.0;	/* motion sensor athwart location (m) */
-		ostore->par_mrp[0] = 'H';	/* motion sensor roll reference plane (HO or RP) */
-		ostore->par_mrp[1] = 'O';	/* motion sensor roll reference plane (HO or RP) */
-		ostore->par_msd = 0.0;	/* motion sensor time delay (sec) */
-		ostore->par_msr = 0.0;	/* motion sensor roll offset (deg) */
-		ostore->par_msp = 0.0;	/* motion sensor pitch offset (deg) */
-		ostore->par_msg = 0.0;	/* motion sensor heading offset (deg) */
-		ostore->par_gcg = 0.0;	/* gyro compass heading offset (deg) */
-		for (i=0;i<4;i++)
-		    {
-		    ostore->par_cpr[i] = '\0';	/* cartographic projection */
-		    }
-		for (i=0;i<MBSYS_SIMRAD2_COMMENT_LENGTH;i++)
-		    {
-		    ostore->par_rop[i] = '\0';	/* responsible operator */
-		    ostore->par_sid[i] = '\0';	/* survey identifier */
-		    ostore->par_pll[i] = '\0';	/* survey line identifier (planned line number) */
-		    ostore->par_com[i] = '\0';	/* comment */
-		    }
-
-		/* runtime parameter values */
-		ostore->run_date = 0;		/* runtime parameter date = year*10000 + month*100 + day
-					    Feb 26, 1995 = 19950226 */
-		ostore->run_msec = 0;		/* runtime parameter time since midnight in msec
-					    08:12:51.234 = 29570234 */
-		ostore->run_ping_count = 0;	/* ping counter */
-		ostore->run_serial = 0;		/* system 1 or 2 serial number */
-		ostore->run_status = 0;		/* system status */
-		ostore->run_mode = 0;		/* system mode:
-					    0 : nearfield (EM3000) or very shallow (EM300)
-					    1 :	normal (EM3000) or shallow (EM300)
-					    2 : medium (EM300)
-					    3 : deep (EM300)
-					    4 : very deep (EM300) */
-		ostore->run_filter_id = 0;	/* filter identifier - the two lowest bits
-					    indicate spike filter strength:
-						00 : off
-						01 : weak
-						10 : medium
-						11 : strong
-					    bit 2 is set if the slope filter is on
-					    bit 3 is set if the sidelobe filter is on
-					    bit 4 is set if the range windows are expanded
-					    bit 5 is set if the smoothing filter is on
-					    bit	6 is set if the interference filter is on */
-		ostore->run_min_depth = 0;	/* minimum depth (m) */
-		ostore->run_max_depth = 0;	/* maximum depth (m) */
-		ostore->run_absorption = 0;	/* absorption coefficient (0.01 dB/km) */
-
-		ostore->run_tran_pulse = 0;	/* transmit pulse length (usec) */
-		if (istore->sonar == MBSYS_SIMRAD_EM12S
-		    || istore->sonar == MBSYS_SIMRAD_EM12D)
-		    ostore->run_tran_beam = 17;	/* transmit beamwidth (0.1 deg) */
-		else if (istore->sonar == MBSYS_SIMRAD_EM1000)
-		    ostore->run_tran_beam = 33;	/* transmit beamwidth (0.1 deg) */
-		else if (istore->sonar == MBSYS_SIMRAD_EM121)
-		    ostore->run_tran_beam = 10;	/* transmit beamwidth (0.1 deg) */
-		ostore->run_tran_pow = 0;	/* transmit power reduction (dB) */
-		if (istore->sonar == MBSYS_SIMRAD_EM12S
-		    || istore->sonar == MBSYS_SIMRAD_EM12D)
-		    ostore->run_rec_beam = 35;	/* receiver beamwidth (0.1 deg) */
-		else if (istore->sonar == MBSYS_SIMRAD_EM1000)
-		    ostore->run_rec_beam = 33;	/* receiver beamwidth (0.1 deg) */
-		else if (istore->sonar == MBSYS_SIMRAD_EM121)
-		    ostore->run_rec_beam = 10;	/* transmit beamwidth (0.1 deg) */
-		ostore->run_rec_band = 0;	/* receiver bandwidth (50 hz) */
-		ostore->run_rec_gain = 0;	/* receiver fixed gain (dB) */
-		ostore->run_tvg_cross = 0;	/* TVG law crossover angle (deg) */
-		ostore->run_ssv_source = 0;	/* source of sound speed at transducer:
-					    0 : from sensor
-					    1 : manual
-					    2 : from profile */
-		ostore->run_max_swath = 0;	/* maximum swath width (m) */
-		ostore->run_beam_space = 0;	/* beam spacing:
-					    0 : determined by beamwidth (EM3000)
-					    1 : equidistant
-					    2 : equiangle */
-		ostore->run_swath_angle = 0;	/* coverage sector of swath (deg) */
-		ostore->run_stab_mode = 0;	/* yaw and pitch stabilization mode:
-					    The upper bit (bit 7) is set if pitch
-					    stabilization is on.
-					    The two lower bits are used to show yaw
-					    stabilization mode as follows:
-						00 : none
-						01 : to survey line heading
-						10 : to mean vessel heading
-						11 : to manually entered heading */
-		for (i=0;i<4;i++)
-		    {
-		    ostore->run_spare[i] = '\0';
-		    }
-
-		/* sound velocity profile */
-		ostore->svp_use_date = 0;	/* date at start of use
-					    date = year*10000 + month*100 + day
-					    Feb 26, 1995 = 19950226 */
-		ostore->svp_use_msec = 0;	/* time at start of use since midnight in msec
-					    08:12:51.234 = 29570234 */
-		mbcopy_simrad_time_convert(verbose,
-		    istore->svp_year, istore->svp_month,
-		    istore->svp_day, istore->svp_hour,
-		    istore->svp_minute, istore->svp_second,
-		    istore->svp_centisecond,
-		    &ostore->svp_use_date, &ostore->svp_use_msec,
-		    error);
-		ostore->svp_count = 0;		/* sequential counter or input identifier */
-		ostore->svp_serial = 0;		/* system 1 serial number */
-		ostore->svp_origin_date = 0;	/* date at svp origin
-					    date = year*10000 + month*100 + day
-					    Feb 26, 1995 = 19950226 */
-		ostore->svp_origin_msec = 0;	/* time at svp origin since midnight in msec
-					    08:12:51.234 = 29570234 */
-		ostore->svp_num = istore->svp_num;		/* number of svp entries */
-		ostore->svp_depth_res = 100;	/* depth resolution (cm) */
-		for (i=0;i<MBSYS_SIMRAD_MAXSVP;i++)
-		    {
-		    ostore->svp_depth[i] = istore->svp_depth[i];	/* depth of svp entries (according to svp_depth_res) */
-		    ostore->svp_vel[i] = istore->svp_vel[i];	/* sound speed of svp entries (0.1 m/sec) */
-		    }
-
-		/* position */
-		ostore->pos_date = 0;		/* position date = year*10000 + month*100 + day
-					    Feb 26, 1995 = 19950226 */
-		ostore->pos_msec = 0;		/* position time since midnight in msec
-					    08:12:51.234 = 29570234 */
-		mbcopy_simrad_time_convert(verbose,
-		    istore->pos_year, istore->pos_month,
-		    istore->pos_day, istore->pos_hour,
-		    istore->pos_minute, istore->pos_second,
-		    istore->pos_centisecond,
-		    &ostore->pos_date, &ostore->pos_msec,
-		    error);
-		ostore->pos_count = 0;		/* sequential counter */
-		ostore->pos_serial = 0;		/* system 1 serial number */
-		ostore->pos_latitude = 20000000 * istore->pos_latitude;
-					/* latitude in decimal degrees * 20000000
-					    (negative in southern hemisphere)
-					    if valid, invalid = 0x7FFFFFFF */
-		ostore->pos_longitude = 10000000 * istore->pos_longitude;
-					/* longitude in decimal degrees * 10000000
-					    (negative in western hemisphere)
-					    if valid, invalid = 0x7FFFFFFF */
-		ostore->pos_quality = 0;	/* measure of position fix quality (cm) */
-		ostore->pos_speed = (int)(istore->speed / 0.036);
-					/* speed over ground (cm/sec) if valid,
-					    invalid = 0xFFFF */
-		ostore->pos_course = 0xFFFF;	/* course over ground (0.01 deg) if valid,
-					    invalid = 0xFFFF */
-		ostore->pos_heading = (int) (istore->line_heading * 100);;
-						/* heading (0.01 deg) if valid,
-					    invalid = 0xFFFF */
-		ostore->pos_system = istore->pos_type;
-					/* position system number, type, and realtime use
-					    - position system number given by two lowest bits
-					    - fifth bit set means position must be derived
-						from input Simrad 90 datagram
-					    - sixth bit set means valid time is that of
-						input datagram */
-		ostore->pos_input_size = 0;	/* number of bytes in input position datagram */
-		for (i=0;i<256;i++)
-		    {
-		    ostore->pos_input[i] = 0;	/* position input datagram as received, minus
-					    header and tail (such as NMEA 0183 $ and CRLF) */
-		    }
-
-		/* height */
-		ostore->hgt_date = 0;		/* height date = year*10000 + month*100 + day
-					    Feb 26, 1995 = 19950226 */
-		ostore->hgt_msec = 0;		/* height time since midnight in msec
-					    08:12:51.234 = 29570234 */
-		ostore->hgt_count = 0;		/* sequential counter */
-		ostore->hgt_serial = 0;		/* system 1 serial number */
-		ostore->hgt_height = 0;		/* height (0.01 m) */
-		ostore->hgt_type = 0;		/* height type as given in input datagram or if
-					    zero the height is derived from the GGK datagram
-					    and is the height of the water level re the
-					    vertical datum */
-
-		/* tide */
-		ostore->tid_date = 0;		/* tide date = year*10000 + month*100 + day
-					    Feb 26, 1995 = 19950226 */
-		ostore->tid_msec = 0;		/* tide time since midnight in msec
-					    08:12:51.234 = 29570234 */
-		ostore->tid_count = 0;		/* sequential counter */
-		ostore->tid_serial = 0;		/* system 1 serial number */
-		ostore->tid_origin_date = 0;	/* tide input date = year*10000 + month*100 + day
-					    Feb 26, 1995 = 19950226 */
-		ostore->tid_origin_msec = 0;	/* tide input time since midnight in msec
-					    08:12:51.234 = 29570234 */
-		ostore->tid_tide = 0;		/* tide offset (0.01 m) */
-
-		/* clock */
-		ostore->clk_date = 0;		/* system date = year*10000 + month*100 + day
-					    Feb 26, 1995 = 19950226 */
-		ostore->clk_msec = 0;		/* system time since midnight in msec
-					    08:12:51.234 = 29570234 */
-		ostore->clk_count = 0;		/* sequential counter */
-		ostore->clk_serial = 0;		/* system 1 serial number */
-		ostore->clk_origin_date	= 0;	/* external clock date = year*10000 + month*100 + day
-					    Feb 26, 1995 = 19950226 */
-		ostore->clk_origin_msec = 0;	/* external clock time since midnight in msec
-					    08:12:51.234 = 29570234 */
-		ostore->clk_1_pps_use = 0;	/* if 1 then the internal clock is synchronized
-					    to an external 1 PPS signal, if 0 then not */
-
-		/* allocate memory for data structure if needed */
-		if (istore->kind == MB_DATA_DATA
-			&& ostore->ping == NULL)
-			status = mb_mallocd(verbose, __FILE__, __LINE__,
-				sizeof(struct mbsys_simrad2_ping_struct),
-				(void **)&(ostore->ping),error);
-
-		if (istore->kind == MB_DATA_DATA
-			&& istore->ping != NULL
-			&& ostore->ping != NULL)
-			{
-			/* get data structure pointer */
-			iping = (struct mbsys_simrad_survey_struct *) istore->ping;
-			oping = (struct mbsys_simrad2_ping_struct *) ostore->ping;
-
-			/* set beam widths for EM121 */
-			if (istore->sonar == MBSYS_SIMRAD_EM121)
-			    {
-			    if (iping->bath_mode == 3)
-				{
-				ostore->run_tran_beam = 40;	/* transmit beamwidth (0.1 deg) */
-				ostore->run_rec_beam = 40;	/* transmit beamwidth (0.1 deg) */
-				}
-			    else if (iping->bath_mode == 2)
-				{
-				ostore->run_tran_beam = 20;	/* transmit beamwidth (0.1 deg) */
-				ostore->run_rec_beam = 20;	/* transmit beamwidth (0.1 deg) */
-				}
-			    else
-				{
-				ostore->run_tran_beam = 10;	/* transmit beamwidth (0.1 deg) */
-				ostore->run_rec_beam = 10;	/* transmit beamwidth (0.1 deg) */
-				}
-			    }
-
-			/* initialize everything */
-			oping->png_date = ostore->date;
-					/* date = year*10000 + month*100 + day
-					    Feb 26, 1995 = 19950226 */
-			oping->png_msec = ostore->msec;
-					/* time since midnight in msec
-					    08:12:51.234 = 29570234 */
-			oping->png_count = iping->ping_number;
-					/* sequential counter or input identifier */
-			oping->png_serial = iping->swath_id;
-					/* system 1 or system 2 serial number */
-			oping->png_latitude = 20000000 * iping->latitude;
-					/* latitude in decimal degrees * 20000000
-					    (negative in southern hemisphere)
-					    if valid, invalid = 0x7FFFFFFF */
-			oping->png_longitude = 10000000 * iping->longitude;
-					/* longitude in decimal degrees * 10000000
-					    (negative in western hemisphere)
-					    if valid, invalid = 0x7FFFFFFF */
-			oping->png_speed = 0xFFFF;
-					/* speed over ground (cm/sec) if valid,
-					    invalid = 0xFFFF */
-			if (ostore->sonar == MBSYS_SIMRAD2_EM121)
-			    oping->png_heading = iping->heading; /* heading (0.01 deg) */
-			else
-			    oping->png_heading = 10 * iping->heading; /* heading (0.01 deg) */
-			oping->png_ssv = iping->sound_vel;
-					/* sound speed at transducer (0.1 m/sec) */
-			oping->png_xducer_depth = iping->ping_heave + (int) (100 * ostore->par_s1z);
-			bath_offset = 0.01 * oping->png_xducer_depth;
-					/* transmit transducer depth (0.01 m)
-					    - The transmit transducer depth plus the
-						depth offset multiplier times 65536 cm
-						should be added to the beam depths to
-						derive the depths re the water line.
-						The depth offset multiplier will usually
-						be zero, except when the EM3000 sonar
-						head is on an underwater vehicle at a
-						depth greater than about 650 m. Note that
-						the offset multiplier will be negative
-						(-1) if the actual heave is large enough
-						to bring the transmit transducer above
-						the water line. This may represent a valid
-						situation,  but may also be due to an
-						erroneously set installation depth of
-						the either transducer or the water line. */
-			if (oping->png_xducer_depth > 0)
-			    oping->png_offset_multiplier = 0;
-					/* transmit transducer depth offset multiplier */
-			else
-			    {
-			    oping->png_offset_multiplier = -1;
-			    oping->png_xducer_depth = oping->png_xducer_depth + 65536;
-					/* transmit transducer depth offset multiplier */
-			    }
-
-			/* beam data */
-			oping->png_nbeams_max = iping->beams_bath;
-					/* maximum number of beams possible */
-			oping->png_nbeams = iping->beams_bath;
-					/* number of valid beams */
-			if ((ostore->sonar == MBSYS_SIMRAD2_EM12S
-				|| ostore->sonar == MBSYS_SIMRAD2_EM12D)
-			    && iping->bath_res == 1)
-			    {
-			    oping->png_depth_res = 10;
-					/* depth resolution (0.1 m) */
-			    oping->png_distance_res = 20;
-					/* x and y resolution (0.2 m) */
-			    oping->png_sample_rate = 5000;
-					/* sampling rate (Hz) */
-			    }
-			else if ((ostore->sonar == MBSYS_SIMRAD2_EM12S
-				|| ostore->sonar == MBSYS_SIMRAD2_EM12D)
-			    && iping->bath_res == 2)
-			    {
-			    oping->png_depth_res = 20;
-					/* depth resolution (0.2 m) */
-			    oping->png_distance_res = 50;
-					/* x and y resolution (0.5 m) */
-			    oping->png_sample_rate = 1250;
-					/* sampling rate (Hz) */
-			    }
-			else if (ostore->sonar == MBSYS_SIMRAD2_EM1000)
-			    {
-			    oping->png_depth_res = 2;
-					/* depth resolution (0.02 m) */
-			    oping->png_distance_res = 10;
-					/* x and y resolution (0.1 m) */
-			    oping->png_sample_rate = 20000;
-					/* sampling rate (Hz) */
-			    }
-			else if (ostore->sonar == MBSYS_SIMRAD2_EM121)
-			    {
-			    oping->png_depth_res = iping->depth_res;
-					/* depth resolution (0.01 m) */
-			    oping->png_distance_res = iping->across_res;
-					/* x and y resolution (0.01 m) */
-			    oping->png_sample_rate = (int)(1.0 / (0.0001 * iping->range_res));
-					/* sampling rate (Hz) */
-			    }
-
-			/* get angles */
-			interleave = MB_NO;
-			if (istore->sonar == MBSYS_SIMRAD_EM1000)
-				{
-				if (iping->bath_mode == 1)
-				    {
-				    angles_simrad = angles_EM1000_ISO_ANG_60_2_MS_48_FAIS;
-				    interleave = MB_NO;
-				    }
-				else if (iping->bath_mode == 2)
-				    {
-				    angles_simrad = angles_EM1000_ISO_ANG_120_07_MS_48_FAIS;
-				    interleave = MB_YES;
-				    }
-				else if (iping->bath_mode == 3)
-				    {
-				    angles_simrad = angles_EM1000_ISO_ANG_150_02_MS_60_FAIS;
-				    interleave = MB_YES;
-				    }
-				else if (iping->bath_mode == 4)
-				    {
-				    angles_simrad = angles_EM1000_CHANNEL_02_MS_60_FAIS;
-				    interleave = MB_YES;
-				    }
-				else if (iping->bath_mode == 5)
-				    {
-				    angles_simrad = angles_EM1000_150_02_MS_60_FAIS;
-				    interleave = MB_YES;
-				    }
-				else if (iping->bath_mode == 6)
-				    {
-				    angles_simrad = angles_EM1000_140_02_MS_60_FAIS;
-				    interleave = MB_YES;
-				    }
-				else if (iping->bath_mode == 7)
-				    {
-				    angles_simrad = angles_EM1000_128_02_MS_60_FAIS;
-				    interleave = MB_YES;
-				    }
-				else if (iping->bath_mode == 8)
-				    {
-				    angles_simrad = angles_EM1000_120_07_MS_48_FAIS;
-				    interleave = MB_YES;
-				    }
-				else if (iping->bath_mode == 9)
-				    {
-				    angles_simrad = angles_EM1000_104_07_MS_48_FAIS;
-				    interleave = MB_YES;
-				    }
-				else if (iping->bath_mode == 10)
-				    {
-				    angles_simrad = angles_EM1000_88_07_MS_48_FAIS;
-				    interleave = MB_YES;
-				    }
-				else if (iping->bath_mode == 11)
-				    {
-				    angles_simrad = angles_EM1000_70_2_MS_48_FAIS;
-				    interleave = MB_NO;
-				    }
-				else if (iping->bath_mode == 12)
-				    {
-				    angles_simrad = angles_EM1000_BERGE_02_MS_60_FAIS;
-				    interleave = MB_YES;
-				    }
-				else if (iping->bath_mode == 13)
-				    {
-				    angles_simrad = angles_EM1000_BERGE_02_MS_60_FAIS;
-				    interleave = MB_YES;
-				    }
-				}
-			else if (istore->sonar == MBSYS_SIMRAD_EM12S)
-				{
-				if (iping->bath_mode == 1)
-				    angles_simrad = angles_EM12S_ISO_ANG_SHALLOW;
-				else if (iping->bath_mode == 2)
-				    angles_simrad = angles_EM12S_ISO_ANG_DEEP;
-				else if (iping->bath_mode == 3)
-				    angles_simrad = angles_EM12S_SHALLOW;
-				else if (iping->bath_mode == 4)
-				    angles_simrad = angles_EM12S_120;
-				else if (iping->bath_mode == 5)
-				    angles_simrad = angles_EM12S_105;
-				else if (iping->bath_mode == 6)
-				    angles_simrad = angles_EM12S_90;
-				}
-			else if (istore->sonar == MBSYS_SIMRAD_EM12D
-				&& iping->swath_id == EM_SWATH_PORT)
-				{
-				if (iping->bath_mode == 1)
-				    angles_simrad = angles_EM12DP_ISO_ANG_SHALLOW;
-				else if (iping->bath_mode == 2)
-				    angles_simrad = angles_EM12DP_ISO_ANG_DEEP;
-				else if (iping->bath_mode == 3)
-				    angles_simrad = angles_EM12DP_SHALLOW;
-				else if (iping->bath_mode == 4)
-				    angles_simrad = angles_EM12DP_150;
-				else if (iping->bath_mode == 5)
-				    angles_simrad = angles_EM12DP_140;
-				else if (iping->bath_mode == 6)
-				    angles_simrad = angles_EM12DP_128;
-				else if (iping->bath_mode == 7)
-				    angles_simrad = angles_EM12DP_114;
-				else if (iping->bath_mode == 8)
-				    angles_simrad = angles_EM12DP_98;
-				}
-			else if (istore->sonar == MBSYS_SIMRAD_EM12D
-				&& iping->swath_id == EM_SWATH_STARBOARD)
-				{
-				if (iping->bath_mode == 1)
-				    angles_simrad = angles_EM12DS_ISO_ANG_SHALLOW;
-				else if (iping->bath_mode == 2)
-				    angles_simrad = angles_EM12DS_ISO_ANG_DEEP;
-				else if (iping->bath_mode == 3)
-				    angles_simrad = angles_EM12DS_SHALLOW;
-				else if (iping->bath_mode == 4)
-				    angles_simrad = angles_EM12DS_150;
-				else if (iping->bath_mode == 5)
-				    angles_simrad = angles_EM12DS_140;
-				else if (iping->bath_mode == 6)
-				    angles_simrad = angles_EM12DS_128;
-				else if (iping->bath_mode == 7)
-				    angles_simrad = angles_EM12DS_114;
-				else if (iping->bath_mode == 8)
-				    angles_simrad = angles_EM12DS_98;
-				}
-
-			/* if interleaved get center beam */
-			if (interleave == MB_YES)
-				{
-				if (iping->bath_mode == 12
-				    && fabs(iping->bath_acrosstrack[28])
-					< fabs(iping->bath_acrosstrack[29]))
-				    istep = 1;
-				else if (iping->bath_mode == 13
-				    && fabs(iping->bath_acrosstrack[31])
-					< fabs(iping->bath_acrosstrack[30]))
-				    istep = 1;
-				else if (fabs(iping->bath_acrosstrack[oping->png_nbeams/2-1])
-				    < fabs(iping->bath_acrosstrack[oping->png_nbeams/2]))
-				    istep = 1;
-				else
-				    istep = 0;
-				}
-
-			/* set beam values */
-			for (i=0;i<oping->png_nbeams;i++)
-			    {
-			    oping->png_depth[i] = (int)((unsigned short)iping->bath[i]);
-					/* depths in depth resolution units */
-			    if (oping->png_depth[i] != 0)
-				oping->png_depth[i] -= (int)(bath_offset / (0.01 * oping->png_depth_res));
-			    oping->png_acrosstrack[i] = iping->bath_acrosstrack[i];
-					/* acrosstrack distances in distance resolution units */
-			    oping->png_alongtrack[i] = iping->bath_alongtrack[i];
-					/* alongtrack distances in distance resolution units */
-
-			    alpha = 0.01 * iping->pitch;
-			    if (istore->sonar == MBSYS_SIMRAD_EM1000
-				&& iping->bath_mode == 13)
-				{
-				beta = 90.0 - angles_simrad[oping->png_nbeams-1-(2*i+istep)];
-				}
-			    else if (istore->sonar == MBSYS_SIMRAD_EM1000
-				&& interleave == MB_YES)
-				{
-				beta = 90.0 + angles_simrad[2*i+istep];
-				}
-			    else if (istore->sonar == MBSYS_SIMRAD_EM1000)
-				{
-				beta = 90.0 + angles_simrad[i];
-				}
-			    else
-				{
-				beta = 90.0 + angles_simrad[i];
-				}
-			    mb_rollpitch_to_takeoff(verbose,
-				    alpha, beta, &theta, &phi, error);
-			    oping->png_depression[i] = (int) (100 * (90.0 - theta));
-					/* Beam depression angles
-						in 0.01 degree. These are the takeoff angles used
-						in raytracing calculations. */
-			    oping->png_azimuth[i] = (int) (100 * (90.0 - phi));
-			    if (oping->png_azimuth[i] < 0) oping->png_azimuth[i] += 36000;
-					/* Beam azimuth angles
-						in 0.01 degree. These values used to rotate sounding
-						position relative to the sonar after raytracing. */
-			    oping->png_range[i] = iping->tt[i];
-					/* Ranges as one way
-						travel times in time units defined as half
-						the inverse sampling rate. */
-			    oping->png_quality[i] = iping->quality[i];
-					/* 0-254 */
-			    oping->png_window[i] = 0;
-					/* samples/4 */
-			    oping->png_amp[i] = iping->amp[i];
-					/* 0.5 dB */
-			    oping->png_beam_num[i] = i + 1;
-					/* beam 128 is first beam on
-					    second head of EM3000D */
-			    if (iping->bath[i] > 0)
-				oping->png_beamflag[i] = MB_FLAG_NONE;
-			    else
-				oping->png_beamflag[i] = MB_FLAG_NULL;
-			    }
-
-			/* raw travel time and angle data */
-			oping->png_raw1_read = MB_NO;	/* flag indicating actual reading of rawbeam1 record */
-			oping->png_raw2_read = MB_NO;	/* flag indicating actual reading of rawbeam2 record */
-			oping->png_raw_nbeams = 0;	/* number of raw travel times and angles
-				    - nonzero only if raw beam record read */
-					/* number of valid beams */
-
-			/* get raw pixel size to be stored in oping->png_max_range */
-			if (iping->pixels_ssraw > 0)
-			    oping->png_ss_read = MB_YES;	/* flag indicating actual reading of sidescan record */
-			else
-			    oping->png_ss_read = MB_NO;	/* flag indicating actual reading of sidescan record */
-			oping->png_ss_date = oping->png_date;	/* date = year*10000 + month*100 + day
-				    Feb 26, 1995 = 19950226 */
-			oping->png_ss_msec = oping->png_msec;	/* time since midnight in msec
-				    08:12:51.234 = 29570234 */
-			if (istore->sonar == MBSYS_SIMRAD_EM12D
-			    || istore->sonar == MBSYS_SIMRAD_EM12S
-			    || istore->sonar == MBSYS_SIMRAD_EM121)
-			    {
-			    if (iping->ss_mode == 1)
-				oping->png_max_range = 60;
-			    else if (iping->ss_mode == 2)
-				oping->png_max_range = 240;
-			    else if (iping->bath_mode == 1
-					|| iping->bath_mode == 3)
-				oping->png_max_range = 60;
-			    else
-				oping->png_max_range = 240;
-			    }
-			else if (istore->sonar == MBSYS_SIMRAD_EM1000)
-			    {
-			    if (iping->ss_mode == 3)
-				oping->png_max_range = 30;
-			    else if (iping->ss_mode == 4)
-				oping->png_max_range = 30;
-			    else if (iping->ss_mode == 5)
-				oping->png_max_range = 15;
-			    else
-				oping->png_max_range = 15;
-			    }
-
-			/* sidescan */
-			oping->png_r_zero = 0;
-					/* range to normal incidence used in TVG
-					    (R0 predicted) in samples */
-			oping->png_r_zero_corr = 0;
-					/* range to normal incidence used to correct
-					    sample amplitudes in number of samples */
-			oping->png_tvg_start = 0;
-					/* start sample of TVG ramp if not enough
-					    dynamic range (0 otherwise) */
-			oping->png_tvg_stop = 0;	\
-					/* stop sample of TVG ramp if not enough
-					    dynamic range (0 otherwise) */
-			oping->png_bsn = 0;
-					/* normal incidence backscatter (BSN) in dB */
-			oping->png_bso = 0;
-					/* oblique incidence backscatter (BSO) in dB */
-			if (ostore->sonar == MBSYS_SIMRAD2_EM121)
-			    oping->png_tx = 10 * iping->beam_width;
-			else if (ostore->sonar == MBSYS_SIMRAD2_EM12S
-				    || ostore->sonar == MBSYS_SIMRAD2_EM12D)
-			    oping->png_tx = 17;
-			else if (ostore->sonar == MBSYS_SIMRAD2_EM1000)
-			    oping->png_tx = 33;
-					/* Tx beamwidth in 0.1 degree */
-			oping->png_tvg_crossover = 0;
-					/* TVG law crossover angle in degrees */
-			oping->png_nbeams_ss = oping->png_nbeams;
-					/* number of beams with sidescan */
-			oping->png_npixels = iping->pixels_ssraw;
-			for (i=0;i<oping->png_nbeams_ss;i++)
-			    {
-			    oping->png_beam_index[i] = i;
-					/* beam index number */
-			    oping->png_sort_direction[i] = 0;
-					/* sorting direction - first sample in beam has lowest
-					    range if 1, highest if -1. */
-			    oping->png_beam_samples[i] = iping->beam_samples[i];
-					/* number of sidescan samples derived from
-						each beam */
-			    oping->png_start_sample[i] = iping->beam_start_sample[i];
-					/* start sample number */
-			    oping->png_center_sample[i] = iping->beam_center_sample[i];
-					/* center sample number */
-			    }
-			for (i=0;i<oping->png_npixels;i++)
-			    {
-			    oping->png_ssraw[i] = iping->ssraw[i];
-					/* the raw sidescan ordered port to starboard */
-			    }
-			oping->png_pixel_size = iping->pixel_size;
-			oping->png_pixels_ss = iping->pixels_ss;
-			for (i=0;i<oping->png_pixels_ss;i++)
-			    {
-			    if (iping->ss[i] != 0)
-			    	{
-			    	oping->png_ss[i] = iping->ss[i];
-					/* the processed sidescan ordered port to starboard */
-			    	oping->png_ssalongtrack[i] = iping->ssalongtrack[i];
-					/* the processed sidescan alongtrack distances
-						in distance resolution units */
-				}
-			    else
-			    	{
-			    	oping->png_ss[i] = EM2_INVALID_AMP;
-					/* the processed sidescan ordered port to starboard */
-			    	oping->png_ssalongtrack[i] = EM2_INVALID_AMP;
-					/* the processed sidescan alongtrack distances
-						in distance resolution units */
-				}
-			    }
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBcopy function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbcopy_simrad_time_convert(int verbose,
-		    int year, int month,
-		    int day, int hour,
-		    int minute, int second,
-		    int centisecond,
-		    int *date, int *msec,
-		    int *error)
-{
-	char	*function_name = "mbcopy_simrad_time_convert";
-	int	status = MB_SUCCESS;
-	int	time_i[7];
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBcopy function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       year:       %d\n",year);
-		fprintf(stderr,"dbg2       month:      %d\n",month);
-		fprintf(stderr,"dbg2       day:        %d\n",day);
-		fprintf(stderr,"dbg2       hour:       %d\n",hour);
-		fprintf(stderr,"dbg2       minute:     %d\n",minute);
-		fprintf(stderr,"dbg2       second:     %d\n",second);
-		fprintf(stderr,"dbg2       centisecond:%d\n",centisecond);
-		}
-
-	/* get time */
-	mb_fix_y2k(verbose, year, &time_i[0]);
-	time_i[1] = month;
-	time_i[2] = day;
-	time_i[3] = hour;
-	time_i[4] = minute;
-	time_i[5] = second;
-	time_i[6] = 10000 * centisecond;
-	*date = 10000 * time_i[0]
-			+ 100 * time_i[1]
-			+ time_i[2];
-	*msec = 3600000 * time_i[3]
-			+ 60000 * time_i[4]
-			+ 1000 * time_i[5]
-			+ 0.001 * time_i[6];
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBcopy function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       date:       %d\n",*date);
-		fprintf(stderr,"dbg2       msec:       %d\n",*msec);
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbcopy_any_to_mbldeoih(int verbose,
-		int kind, int *time_i, double time_d,
-		double navlon, double navlat, double speed, double heading,
-		double draft, double altitude,
-		double roll, double pitch, double heave,
-		double	beamwidth_xtrack, double beamwidth_ltrack,
-		int nbath, int namp, int nss,
-		char *beamflag, double *bath, double *amp,
-		double *bathacrosstrack, double *bathalongtrack,
-		double *ss, double *ssacrosstrack, double *ssalongtrack,
-		char *comment,
-		void *ombio_ptr, void *ostore_ptr,
-		int *error)
-{
-	char	*function_name = "mbcopy_any_to_mbldeoih";
-	int	status = MB_SUCCESS;
-	struct mbsys_ldeoih_struct *ostore;
-	int	i;
-
-	/* get data structure pointer */
-	ostore = (struct mbsys_ldeoih_struct *) ostore_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBcopy function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       ombio_ptr:  %p\n",(void *)ombio_ptr);
-		fprintf(stderr,"dbg2       ostore_ptr: %p\n",(void *)ostore_ptr);
-		fprintf(stderr,"dbg2       kind:       %d\n",kind);
-		}
-	if (verbose >= 2 && (kind == MB_DATA_DATA || kind == MB_DATA_NAV))
-		{
-		fprintf(stderr,"dbg2       time_i[0]:  %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:  %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:  %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:  %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:  %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:  %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:  %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:     %f\n",time_d);
-		fprintf(stderr,"dbg2       navlon:     %f\n",navlon);
-		fprintf(stderr,"dbg2       navlat:     %f\n",navlat);
-		fprintf(stderr,"dbg2       speed:      %f\n",speed);
-		fprintf(stderr,"dbg2       heading:    %f\n",heading);
-		fprintf(stderr,"dbg2       draft:      %f\n",draft);
-		fprintf(stderr,"dbg2       altitude:   %f\n",altitude);
-		fprintf(stderr,"dbg2       roll:       %f\n",roll);
-		fprintf(stderr,"dbg2       pitch:      %f\n",pitch);
-		fprintf(stderr,"dbg2       heave:      %f\n",heave);
-		fprintf(stderr,"dbg2       beamwidth_xtrack: %f\n",beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack: %f\n",beamwidth_ltrack);
-		}
-	if (verbose >= 2 && kind == MB_DATA_DATA)
-		{
-		fprintf(stderr,"dbg2       nbath:      %d\n",
-			nbath);
-		if (verbose >= 3)
-		 for (i=0;i<nbath;i++)
-		  fprintf(stderr,"dbg3       beam:%d  flag:%3d  bath:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,beamflag[i],bath[i],
-			bathacrosstrack[i],bathalongtrack[i]);
-		fprintf(stderr,"dbg2       namp:       %d\n",namp);
-		if (verbose >= 3)
-		 for (i=0;i<namp;i++)
-		  fprintf(stderr,"dbg3        beam:%d   amp:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,amp[i],bathacrosstrack[i],bathalongtrack[i]);
-		fprintf(stderr,"dbg2        nss:       %d\n",nss);
-		if (verbose >= 3)
-		 for (i=0;i<nss;i++)
-		  fprintf(stderr,"dbg3        pixel:%d   ss:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,ss[i],ssacrosstrack[i],ssalongtrack[i]);
-		}
-	if (verbose >= 2 && kind == MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"dbg2       comment:     \ndbg2       %s\n",
-			comment);
-		}
-
-	/* copy the data  */
-	if (ostore != NULL)
-		{
-		/* set beam widths */
-		ostore->beam_xwidth = beamwidth_xtrack;
-		ostore->beam_lwidth = beamwidth_ltrack;
-		ostore->kind = kind;
-
-		/* insert data */
-		if (kind == MB_DATA_DATA)
-		        {
-			mb_insert_nav(verbose, ombio_ptr, (void *)ostore,
-					time_i, time_d,
-					navlon, navlat, speed, heading, draft,
-					roll, pitch, heave,
-					error);
-			mb_insert_altitude(verbose, ombio_ptr, (void *)ostore,
-					draft, altitude,
-					error);
-			}
-		status = mb_insert(verbose, ombio_ptr, (void *)ostore,
-				kind, time_i, time_d,
-				navlon, navlat, speed, heading,
-				nbath,namp,nss,
-				beamflag,bath,amp,bathacrosstrack,
-				bathalongtrack,
-				ss,ssacrosstrack,ssalongtrack,
-				comment, error);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBcopy function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbcopy_reson8k_to_gsf(int verbose,
-		void *imbio_ptr,
-		void *ombio_ptr,
-		int *error)
-{
-	char	*function_name = "mbcopy_reson8k_to_gsf";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *imb_io_ptr;
-	struct mb_io_struct *omb_io_ptr;
-	struct mbsys_reson8k_struct *istore;
-	struct mbsys_gsf_struct *ostore;
-	gsfDataID	    *dataID; 		/* pointers withinin gsf data */
-	gsfRecords	    *records;
-	gsfSwathBathyPing   *mb_ping;
-	gsfMBParams params;
-	double gain_correction;
-	double	angscale;
-	double	alpha;
-	double	beta;
-	double	theta;
-	double	phi;
-	int	icenter;
-	int	i, ret;
-
-	imb_io_ptr  = (struct mb_io_struct *) imbio_ptr;
-	omb_io_ptr = (struct mb_io_struct *) ombio_ptr;
-
-	/* get reson data structure pointer */
-	istore = imb_io_ptr->store_data;
-
-	/* get gsf data structure pointer */
-	ostore = omb_io_ptr->store_data;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBcopy function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       imbio_ptr:  %p\n",(void *)imbio_ptr);
-		fprintf(stderr,"dbg2       ombio_ptr:  %p\n",(void *)ombio_ptr);
-		fprintf(stderr,"dbg2       istore:     %p\n",(void *)istore);
-		fprintf(stderr,"dbg2       ostore:     %p\n",(void *)ostore);
-		fprintf(stderr,"dbg2       kind:       %d\n",istore->kind);
-		}
-
-	/* copy the data  */
-	if (istore != NULL && ostore != NULL)
-		{
-		/* output gsf data structure  */
-		records = &(ostore->records);
-		dataID  = &(ostore->dataID);
-		mb_ping = &(records->mb_ping);
-
-		/* set data kind */
-		ostore->kind = istore->kind;
-
-		/* insert data in structure */
-		if (istore->kind == MB_DATA_DATA)
-			{
-			/* on the first ping set the processing parameters up  */
-			if (omb_io_ptr->ping_count == 0)
-				{
-				/* ostore->kind = MB_DATA_PROCESSING_PARAMETERS;
-				dataID->recordID = GSF_RECORD_PROCESSING_PARAMETERS; */
-				memset((void *)&params, 0, sizeof(gsfMBParams));
-
-				params.roll_compensated = GSF_COMPENSATED;
-				params.pitch_compensated = GSF_COMPENSATED;
-				params.heave_compensated = GSF_COMPENSATED;
-				params.tide_compensated = 0;
-				params.ray_tracing = 0      ;
-				params.depth_calculation =GSF_DEPTHS_RE_1500_MS;
-				params.to_apply.draft[0] = 0;
-				params.to_apply.roll_bias[0] = 0;;
-				params.to_apply.pitch_bias[0] = 0;;
-				params.to_apply.gyro_bias[0] = 0;;
-				/* note it appears the x and y axis are switched between
-					reson and gsf reference systems	*/
-				params.to_apply.position_x_offset = istore->NavOffsetY;
-				params.to_apply.position_y_offset = istore->NavOffsetX;
-				params.to_apply.position_z_offset = istore->NavOffsetZ;
-				params.to_apply.transducer_x_offset[0] = istore->MBOffsetY;
-				params.to_apply.transducer_y_offset[0] = istore->MBOffsetX;
-				params.to_apply.transducer_z_offset[0] = istore->MBOffsetZ;
-				params.to_apply.mru_roll_bias = istore->MRUOffsetRoll;
-				params.to_apply.mru_pitch_bias = istore->MRUOffsetPitch;
-				params.to_apply.mru_heading_bias = 0;
-				params.to_apply.mru_x_offset = istore->MRUOffsetY;
-				params.to_apply.mru_y_offset = istore->MRUOffsetX;
-				params.to_apply.mru_z_offset = istore->MRUOffsetZ;
-				params.to_apply.center_of_rotation_x_offset = 0;
-				params.to_apply.center_of_rotation_y_offset = 0;
-				params.to_apply.center_of_rotation_z_offset = 0;
-				ret = gsfPutMBParams(&params, records, omb_io_ptr->gsfid, 1);
-				}
-
-			/* set data id */
-			dataID->recordID = GSF_RECORD_SWATH_BATHYMETRY_PING;
-			mb_ping = &(records->mb_ping);
-
-			/* get time */
-			mb_ping->ping_time.tv_sec = (int) istore->png_time_d;
-			mb_ping->ping_time.tv_nsec
-				= (int) (1000000000
-				    * (istore->png_time_d
-					    - mb_ping->ping_time.tv_sec));
-
-			/* get navigation, applying inverse projection if defined */
-			mb_ping->longitude = istore->png_longitude;
-			mb_ping->latitude = istore->png_latitude;
-			if (imb_io_ptr->projection_initialized == MB_YES)
-				{
-				mb_proj_inverse(verbose, imb_io_ptr->pjptr,
-								mb_ping->longitude, mb_ping->latitude,
-								&(mb_ping->longitude), &(mb_ping->latitude),
-								error);
-				}
-
-			/* get heading */
-			mb_ping->heading = istore->png_heading;
-
-			/* get speed */
-			mb_ping->speed = istore->png_speed/ 1.852;
-
-			/* set sonar depth */
-			mb_ping->depth_corrector = istore->MBOffsetZ;
-
-                	/* do roll pitch heave */
-			mb_ping->roll =  istore->png_roll;
-			mb_ping->pitch = istore->png_pitch;
-			mb_ping->heave = istore->png_heave;
-
-			/* get numbers of beams */
-			mb_ping->number_beams = istore->beams_bath;
-
-			/* allocate memory in arrays if required */
-			if (istore->beams_bath > 0)
-			      {
-			      mb_ping->beam_flags
-				  = (unsigned char *)
-				      realloc(mb_ping->beam_flags,
-						  istore->beams_bath * sizeof(char));
-			      mb_ping->depth
-				  = (double *)
-				      realloc(mb_ping->depth,
-						  istore->beams_bath * sizeof(double));
-			      mb_ping->across_track
-				  = (double *)
-				      realloc(mb_ping->across_track,
-						  istore->beams_bath * sizeof(double));
-			      mb_ping->along_track
-				  = (double *)
-				      realloc(mb_ping->along_track,
-						  istore->beams_bath * sizeof(double));
-			      mb_ping->travel_time
-				  = (double *)
-				      realloc(mb_ping->travel_time,
-						  istore->beams_bath * sizeof(double));
-			      mb_ping->beam_angle
-				  = (double *)
-				      realloc(mb_ping->beam_angle,
-						  istore->beams_bath * sizeof(double));
-			      mb_ping->beam_angle_forward
-				  = (double *)
-				      realloc(mb_ping->beam_angle_forward,
-						  istore->beams_bath * sizeof(double));
-
-			      if (mb_ping->beam_flags == NULL
-				  || mb_ping->depth == NULL
-				  || mb_ping->across_track == NULL
-				  || mb_ping->along_track == NULL
-				  || mb_ping->travel_time == NULL
-				  || mb_ping->beam_angle_forward == NULL
-				  || mb_ping->beam_angle == NULL )
-				  {
-				  status = MB_FAILURE;
-				  *error = MB_ERROR_MEMORY_FAIL;
-				  }
-			      }
-			  if (istore->beams_amp > 0)
-			      {
-			      mb_ping->mr_amplitude
-				  = (double *)
-				      realloc(mb_ping->mr_amplitude,
-						  istore->beams_amp * sizeof(double));
-			      if (mb_ping->mr_amplitude == NULL)
-				  {
-				  status = MB_FAILURE;
-				  *error = MB_ERROR_MEMORY_FAIL;
-				  }
-			      }
-
-			  /* if ping flag set check for any unset
-			      beam flags - unset ping flag if any
-			      good beams found */
-			  if (mb_ping->ping_flags != 0)
-			      {
-			      for (i=0;i<istore->beams_bath;i++)
-				  {
-				  if (mb_beam_ok(istore->beamflag[i]))
-				      mb_ping->ping_flags = 0;
-				  }
-			      }
-
-			  /* read depth and beam location values into storage arrays */
-			  icenter = istore->beams_bath / 2;
-			  angscale = ((double)istore->beam_width_num)
-					/ ((double)istore->beam_width_denom);
-			  for (i=0;i<istore->beams_bath;i++)
-				  {
-				  mb_ping->beam_flags[i] = istore->beamflag[i];
-				  if (istore->beamflag[i] != MB_FLAG_NULL)
-				      {
-				      mb_ping->depth[i] = istore->bath[i];
-				      mb_ping->across_track[i] = istore->bath_acrosstrack[i];
-				      mb_ping->along_track[i] = istore->bath_alongtrack[i];
-				      mb_ping->travel_time[i] = 0.25 * (double)istore->range[i]/(double)istore->sample_rate;
-				      alpha = istore->png_pitch;
-				      beta = 90.0 + (icenter - i) * angscale + istore->png_roll;
-				      mb_rollpitch_to_takeoff(
-					      verbose,
-					      alpha, beta,
-					      &theta, &phi,
-					      error);
-				      mb_ping->beam_angle[i] = theta;
-				      if (phi < 0.0)
-				      	phi += 360.0;
-				      if (phi > 360.0)
-				      	phi -= 360.0;
-				      mb_ping->beam_angle_forward[i] = phi;
-/*fprintf(stderr,"MBCOPY: i:%d angles: %f %f\n",i,mb_ping->beam_angle[i],mb_ping->beam_angle_forward[i]);*/
-				      }
-				  else
-				      {
-				      mb_ping->depth[i] = 0.0;
-				      mb_ping->across_track[i] = 0.0;
-				      mb_ping->along_track[i] = 0.0;
-				      mb_ping->travel_time[i] = 0.0;
-				      mb_ping->beam_angle[i] = 0.0;
-				      mb_ping->beam_angle_forward[i] = 0;
-				      }
-				  }
-			  for (i=0;i<istore->beams_amp;i++)
-				  {
-				  mb_ping->mr_amplitude[i] = istore->amp[i];
-				  }
-
-			  /* choose gain factor -it's a guess based on dataset
-			  	regression analysis!! rcc */
-			  gain_correction = 2.2*(istore->gain & 63) + 6*istore->power;
-
-			  /* read amplitude values into storage arrays */
-			  if (mb_ping->mc_amplitude != NULL)
-			  	{
-				for (i=0;i<istore->beams_amp;i++)
-				  	{
-				 	/* note - we are storing 1/2 db increments */
-					mb_ping->mc_amplitude[i] = 40*log10(istore->intensity[i]);
-				  	}
-			  	}
-			  else if (mb_ping->mr_amplitude != NULL)
-			  	{
-				for (i=0;i<istore->beams_amp;i++)
-					{
-					mb_ping->mr_amplitude[i] = 40*log10(istore->intensity[i])- gain_correction;
-					}
-			  	}
-
-			/* generate imagery from sidescan trace
-				code here would have to be modified for snippets
-
-	        		mb_ping->brb_inten = (gsfBRBIntensity *) realloc(mb_ping->brb_inten,sizeof(gsfBRBIntensity));
-
-				gsfBRBIntensity *brb;
-				brb = mb_ping->brb_inten;
-				brb->bits_per_sample = (unsigned char) 16;
-				brb->applied_corrections = 0;
-				gsfTimeSeriesIntensity *brb_ts;
-				*brb_ts = brb->time_series;
-				*brb_ts = (gsfTimeSeriesIntensity*)realloc(*brb_ts,istore->beams_bath*sizeof(gsfTimeSeriesIntensity));
-				*/
-
-			/* now fill in the reson 8100 specific fields */
-			mb_ping->sensor_id = GSF_SWATH_BATHY_SUBRECORD_RESON_8101_SPECIFIC;
-			mb_ping->sensor_data.gsfReson8100Specific.latency = istore->latency ;
-			mb_ping->sensor_data.gsfReson8100Specific.ping_number = istore->ping_number ;
-			mb_ping->sensor_data.gsfReson8100Specific.sonar_id = istore->sonar_id ;
-			mb_ping->sensor_data.gsfReson8100Specific.sonar_model = istore->sonar_model ;
-			mb_ping->sensor_data.gsfReson8100Specific.frequency = istore->frequency ;
-			mb_ping->sensor_data.gsfReson8100Specific.surface_velocity = istore->velocity ;
-			mb_ping->sensor_data.gsfReson8100Specific.sample_rate = istore->sample_rate ;
-			mb_ping->sensor_data.gsfReson8100Specific.ping_rate = istore->ping_rate ;
-			mb_ping->sensor_data.gsfReson8100Specific.mode = GSF_8100_AMPLITUDE ;
-			mb_ping->sensor_data.gsfReson8100Specific.range = istore->range_set ;
-			mb_ping->sensor_data.gsfReson8100Specific.power = istore->power ;
-			mb_ping->sensor_data.gsfReson8100Specific.gain = istore->gain ;
-			mb_ping->sensor_data.gsfReson8100Specific.pulse_width = istore->pulse_width ;
-			mb_ping->sensor_data.gsfReson8100Specific.tvg_spreading = istore->tvg_spread ;
-			mb_ping->sensor_data.gsfReson8100Specific.tvg_absorption = istore->tvg_absorp ;
-			mb_ping->sensor_data.gsfReson8100Specific.fore_aft_bw = istore->projector_beam_width/10.;
-			mb_ping->sensor_data.gsfReson8100Specific.athwart_bw = (double)istore->beam_width_num/(double)istore->beam_width_denom;
-			mb_ping->sensor_data.gsfReson8100Specific.projector_type = istore->projector_type ;
-			mb_ping->sensor_data.gsfReson8100Specific.projector_angle = istore->projector_angle ;
-			mb_ping->sensor_data.gsfReson8100Specific.range_filt_min = istore->min_range ;
-			mb_ping->sensor_data.gsfReson8100Specific.range_filt_max = istore->max_range ;
-			mb_ping->sensor_data.gsfReson8100Specific.depth_filt_min = istore->min_depth ;
-			mb_ping->sensor_data.gsfReson8100Specific.depth_filt_max = istore-> max_depth;
-			mb_ping->sensor_data.gsfReson8100Specific.filters_active = istore->filters_active ;
-			mb_ping->sensor_data.gsfReson8100Specific.temperature = istore->temperature ;
-			mb_ping->sensor_data.gsfReson8100Specific.beam_spacing = (double)istore->beam_width_num/(double)istore->beam_width_denom;
-
-			/* set the GSF scale factors for this ping */
-			status = mbsys_gsf_setscalefactors(verbose, MB_YES, mb_ping, error);
-			}
-
-		/* insert comment in structure */
-		else if (istore->kind == MB_DATA_COMMENT)
-			{
-			dataID->recordID = GSF_RECORD_COMMENT;
-			if (records->comment.comment_length < strlen(istore->comment) + 1)
-			    {
-			    if ((records->comment.comment
-					= (char *)
-					    realloc(records->comment.comment,
-						strlen(istore->comment)+1))
-						    == NULL)
-				{
-				status = MB_FAILURE;
-				*error = MB_ERROR_MEMORY_FAIL;
-				records->comment.comment_length = 0;
-				}
-			    }
-			if ((status = MB_SUCCESS) && (records->comment.comment != NULL))
-			    {
-			    strcpy(records->comment.comment, istore->comment);
-			    records->comment.comment_length = strlen(istore->comment)+1;
-			    records->comment.comment_time.tv_sec = (int) istore->png_time_d;
-			    records->comment.comment_time.tv_nsec
-				    = (int) (1000000000
-					* (istore->png_time_d
-						- records->comment.comment_time.tv_sec));
-			    }
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return value:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/utilities/mbctdlist.c b/src/utilities/mbctdlist.c
deleted file mode 100644
index e7c9daf..0000000
--- a/src/utilities/mbctdlist.c
+++ /dev/null
@@ -1,1360 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbctdlist.c	9/14/2008
- *    $Id: mbctdlist.c 2251 2015-07-01 01:02:06Z caress $
- *
- *    Copyright (c) 2008-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * This program, mbctdlist, lists all ctd data records within swath data files.
- * The -O option specifies how the values are output in an mblist-like
- * fashion. The basic available values are
- *     conductivity
- *     temperature
- *     depth
- *     salinity
- *     sound speed
- *     longitude
- *     latittude
- *
- * Author:	D. W. Caress
- * Date:	September 14,  2008
- *
- * $Log: mbctdlist.c,v $
- * Revision 5.0  2008/09/20 00:51:31  caress
- * Initial version of mbctdlist - list ctd data.
- *
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <math.h>
-#include <string.h>
-#include <time.h>
-
-/* MBIO include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_define.h"
-#include "mb_process.h"
-#include "mb_aux.h"
-
-/* local options */
-#define	MAX_OPTIONS	25
-#define	MBCTDLIST_ALLOC_CHUNK 1024
-/* function prototypes */
-int printsimplevalue(int verbose,
-	double value, int width, int precision,
-	int ascii, int *invert, int *flipsign, int *error);
-int printNaN(int verbose, int ascii, int *invert, int *flipsign, int *error);
-
-/* NaN value */
-double	NaN;
-
-static char rcs_id[] = "$Id: mbctdlist.c 2251 2015-07-01 01:02:06Z caress $";
-
-/*--------------------------------------------------------------------*/
-
-int main (int argc, char **argv)
-{
-	char program_name[] = "mbctdlist";
-	char help_message[] =  "mbctdlist lists all CTD records within swath data files\nThe -O option specifies how the values are output\nin an mblist-likefashion.\n";
-	char usage_message[] = "mbctdlist [-A -Ddecimate -Fformat -Gdelimeter -H -Ifile -Llonflip -Ooutput_format -V -Zsegment]";
-	extern char *optarg;
-	int	errflg = 0;
-	int	c;
-	int	help = 0;
-	int	flag = 0;
-
-	/* MBIO status variables */
-	int	status = MB_SUCCESS;
-	int	interp_status = MB_SUCCESS;
-	int	verbose = 0;
-	int	error = MB_ERROR_NO_ERROR;
-	char	*message;
-
-	/* MBIO read control parameters */
-	int	read_datalist = MB_NO;
-	char	read_file[MB_PATH_MAXLINE];
-	void	*datalist;
-	int	look_processed = MB_DATALIST_LOOK_UNSET;
-	double	file_weight;
-	int	format;
-	int	pings;
-	int	decimate;
-	int	lonflip;
-	double	bounds[4];
-	int	btime_i[7];
-	int	etime_i[7];
-	double	btime_d;
-	double	etime_d;
-	double	speedmin;
-	double	timegap;
-	char	file[MB_PATH_MAXLINE];
-	int	beams_bath;
-	int	beams_amp;
-	int	pixels_ss;
-
-	/* output format list controls */
-	char	list[MAX_OPTIONS];
-	int	n_list;
-	double	distance_total = 0.0;
-	int	time_j[5];
-	int	mblist_next_value = MB_NO;
-	int	invert_next_value = MB_NO;
-	int	signflip_next_value = MB_NO;
-	int	first = MB_YES;
-	int	ascii = MB_YES;
-	int	segment = MB_NO;
-	char	segment_tag[MB_PATH_MAXLINE];
-	char	delimiter[MB_PATH_MAXLINE];
-
-	/* MBIO read values */
-	void	*mbio_ptr = NULL;
-	void	*store_ptr;
-	int	kind;
-	int	time_i[7];
-	double	time_d;
-	double	navlon;
-	double	navlat;
-	double	speed;
-	double	heading;
-	double	distance;
-	double	altitude;
-	double	sonardepth;
-	char	*beamflag = NULL;
-	double	*bath = NULL;
-	double	*bathacrosstrack = NULL;
-	double	*bathalongtrack = NULL;
-	double	*amp = NULL;
-	double	*ss = NULL;
-	double	*ssacrosstrack = NULL;
-	double	*ssalongtrack = NULL;
-	char	comment[MB_COMMENT_MAXLINE];
-
-	/* navigation, heading, attitude data */
-	int	survey_count = 0;
-	int	survey_count_tot = 0;
-	int	nnav = 0;
-	int	nnav_alloc = 0;
-	double	*nav_time_d = NULL;
-	double	*nav_lon = NULL;
-	double	*nav_lat = NULL;
-	double	*nav_sonardepth = NULL;
-	double	*nav_heading = NULL;
-	double	*nav_speed = NULL;
-	double	*nav_altitude = NULL;
-
-	/* CTD values */
-	int	ctd_count = 0;
-	int	ctd_count_tot = 0;
-	int	nctd;
-	double	ctd_time_d[MB_CTD_MAX];
-	double	ctd_conductivity[MB_CTD_MAX];
-	double	ctd_temperature[MB_CTD_MAX];
-	double	ctd_depth[MB_CTD_MAX];
-	double	ctd_salinity[MB_CTD_MAX];
-	double	ctd_soundspeed[MB_CTD_MAX];
-	int	nsensor;
-	double	sensor_time_d[MB_CTD_MAX];
-	double	sensor1[MB_CTD_MAX];
-	double	sensor2[MB_CTD_MAX];
-	double	sensor3[MB_CTD_MAX];
-	double	sensor4[MB_CTD_MAX];
-	double	sensor5[MB_CTD_MAX];
-	double	sensor6[MB_CTD_MAX];
-	double	sensor7[MB_CTD_MAX];
-	double	sensor8[MB_CTD_MAX];
-	double	conductivity;
-	double	temperature;
-	double	potentialtemperature;
-	double	depth;
-	double	salinity;
-	double	soundspeed;
-
-	/* additional time variables */
-	int	first_m = MB_YES;
-	double	time_d_ref;
-	int	first_u = MB_YES;
-	time_t	time_u;
-	time_t	time_u_ref;
-	double	seconds;
-
-	/* course calculation variables */
-	double	dlon, dlat, minutes;
-	int	degrees;
-	char	hemi;
-	double	headingx, headingy, mtodeglon, mtodeglat;
-	double	course, course_old;
-	double	time_d_old;
-	double	time_interval;
-	double	speed_made_good, speed_made_good_old;
-	double	navlon_old, navlat_old;
-	double	dx, dy;
-	double	b;
-
-	int	read_data;
-	int	ictd;
-	int	i, j;
-
-	/* get current default values */
-	status = mb_defaults(verbose,&format,&pings,&lonflip,bounds,
-		btime_i,etime_i,&speedmin,&timegap);
-	pings = 1;
-	bounds[0] = -360.0;
-	bounds[1] = 360.0;
-	bounds[2] = -90.0;
-	bounds[3] = 90.0;
-	ctd_count = 0;
-	ctd_count_tot = 0;
-
-	/* set default input to datalist.mb-1 */
-	strcpy (read_file, "datalist.mb-1");
-
-	/* set up the default list controls
-		(Time, lon, lat, conductivity, temperature, depth, salinity, sound speed) */
-	list[0]='T';
-	list[1]='X';
-	list[2]='Y';
-	list[3]='H';
-	list[4]='C';
-	list[5]='c';
-	list[6]='^';
-	list[7]='c';
-	list[8]='S';
-	list[9]='s';
-	n_list = 10;
-	sprintf(delimiter, "\t");
-	decimate = 1;
-
-	/* process argument list */
-	while ((c = getopt(argc, argv, "AaDdF:f:G:g:I:i:L:l:O:o:Z:z:VvHh")) != -1)
-	  switch (c)
-		{
-		case 'H':
-		case 'h':
-			help++;
-			break;
-		case 'V':
-		case 'v':
-			verbose++;
-			break;
-		case 'A':
-		case 'a':
-			ascii = MB_NO;
-			flag++;
-			break;
-		case 'D':
-		case 'd':
-			sscanf (optarg,"%d", &decimate);
-			flag++;
-			break;
-		case 'F':
-		case 'f':
-			sscanf (optarg,"%d", &format);
-			flag++;
-			break;
-		case 'G':
-		case 'g':
-			sscanf (optarg,"%s", delimiter);
-			flag++;
-			break;
-		case 'I':
-		case 'i':
-			sscanf (optarg,"%s", read_file);
-			flag++;
-			break;
-		case 'L':
-		case 'l':
-			sscanf (optarg,"%d", &lonflip);
-			flag++;
-			break;
-		case 'O':
-		case 'o':
-			for(j=0,n_list=0;j<(int)strlen(optarg);j++,n_list++)
-				if (n_list<MAX_OPTIONS)
-					list[n_list] = optarg[j];
-			break;
-		case 'Z':
-		case 'z':
-			segment = MB_YES;
-			sscanf (optarg,"%s", segment_tag);
-			flag++;
-			break;
-		case '?':
-			errflg++;
-		}
-
-	/* if error flagged then print it and exit */
-	if (errflg)
-		{
-		fprintf(stderr,"usage: %s\n", usage_message);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		error = MB_ERROR_BAD_USAGE;
-		exit(error);
-		}
-
-	/* print starting message */
-	if (verbose == 1 || help)
-		{
-		fprintf(stderr,"\nProgram %s\n",program_name);
-		fprintf(stderr,"Version %s\n",rcs_id);
-		fprintf(stderr,"MB-system Version %s\n",MB_VERSION);
-		}
-
-	/* print starting debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  Program <%s>\n",program_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Control Parameters:\n");
-		fprintf(stderr,"dbg2       verbose:        %d\n",verbose);
-		fprintf(stderr,"dbg2       help:           %d\n",help);
-		fprintf(stderr,"dbg2       format:         %d\n",format);
-		fprintf(stderr,"dbg2       pings:          %d\n",pings);
-		fprintf(stderr,"dbg2       lonflip:        %d\n",lonflip);
-		fprintf(stderr,"dbg2       decimate:       %d\n",decimate);
-		fprintf(stderr,"dbg2       bounds[0]:      %f\n",bounds[0]);
-		fprintf(stderr,"dbg2       bounds[1]:      %f\n",bounds[1]);
-		fprintf(stderr,"dbg2       bounds[2]:      %f\n",bounds[2]);
-		fprintf(stderr,"dbg2       bounds[3]:      %f\n",bounds[3]);
-		fprintf(stderr,"dbg2       btime_i[0]:     %d\n",btime_i[0]);
-		fprintf(stderr,"dbg2       btime_i[1]:     %d\n",btime_i[1]);
-		fprintf(stderr,"dbg2       btime_i[2]:     %d\n",btime_i[2]);
-		fprintf(stderr,"dbg2       btime_i[3]:     %d\n",btime_i[3]);
-		fprintf(stderr,"dbg2       btime_i[4]:     %d\n",btime_i[4]);
-		fprintf(stderr,"dbg2       btime_i[5]:     %d\n",btime_i[5]);
-		fprintf(stderr,"dbg2       btime_i[6]:     %d\n",btime_i[6]);
-		fprintf(stderr,"dbg2       etime_i[0]:     %d\n",etime_i[0]);
-		fprintf(stderr,"dbg2       etime_i[1]:     %d\n",etime_i[1]);
-		fprintf(stderr,"dbg2       etime_i[2]:     %d\n",etime_i[2]);
-		fprintf(stderr,"dbg2       etime_i[3]:     %d\n",etime_i[3]);
-		fprintf(stderr,"dbg2       etime_i[4]:     %d\n",etime_i[4]);
-		fprintf(stderr,"dbg2       etime_i[5]:     %d\n",etime_i[5]);
-		fprintf(stderr,"dbg2       etime_i[6]:     %d\n",etime_i[6]);
-		fprintf(stderr,"dbg2       speedmin:       %f\n",speedmin);
-		fprintf(stderr,"dbg2       timegap:        %f\n",timegap);
-		fprintf(stderr,"dbg2       ascii:          %d\n",ascii);
-		fprintf(stderr,"dbg2       segment:        %d\n",segment);
-		fprintf(stderr,"dbg2       segment_tag:    %s\n",segment_tag);
-		fprintf(stderr,"dbg2       delimiter:      %s\n",delimiter);
-		fprintf(stderr,"dbg2       file:           %s\n",file);
-		fprintf(stderr,"dbg2       n_list:         %d\n",n_list);
-		for (i=0;i<n_list;i++)
-			fprintf(stderr,"dbg2         list[%d]:      %c\n",
-						i,list[i]);
-		}
-
-	/* if help desired then print it and exit */
-	if (help)
-		{
-		fprintf(stderr,"\n%s\n",help_message);
-		fprintf(stderr,"\nusage: %s\n", usage_message);
-		exit(error);
-		}
-
-	/* get format if required */
-	if (format == 0)
-		mb_get_format(verbose,read_file,NULL,&format,&error);
-
-	/* determine whether to read one file or a list of files */
-	if (format < 0)
-		read_datalist = MB_YES;
-
-	/**************************************************************************************/
-
-	/* section 1 - read all data and save nav etc for interpolation onto ctd data */
-
-
-	/* open file list */
-	if (read_datalist == MB_YES)
-	    {
-	    if ((status = mb_datalist_open(verbose,&datalist,
-					    read_file,look_processed,&error)) != MB_SUCCESS)
-		{
-		error = MB_ERROR_OPEN_FAIL;
-		fprintf(stderr,"\nUnable to open data list file: %s\n",
-			read_file);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-	    if ((status = mb_datalist_read(verbose,datalist,
-			    file,&format,&file_weight,&error))
-			    == MB_SUCCESS)
-		read_data = MB_YES;
-	    else
-		read_data = MB_NO;
-	    }
-	/* else copy single filename to be read */
-	else
-	    {
-	    strcpy(file, read_file);
-	    read_data = MB_YES;
-	    }
-
-	/* loop over all files to be read */
-	while (read_data == MB_YES)
-	{
-	/* initialize reading the swath file */
-	if ((status = mb_read_init(
-		verbose,file,format,pings,lonflip,bounds,
-		btime_i,etime_i,speedmin,timegap,
-		&mbio_ptr,&btime_d,&etime_d,
-		&beams_bath,&beams_amp,&pixels_ss,&error)) != MB_SUCCESS)
-		{
-		mb_error(verbose,error,&message);
-		fprintf(stderr,"\nMBIO Error returned from function <mb_read_init>:\n%s\n",message);
-		fprintf(stderr,"\nMultibeam File <%s> not initialized for reading\n",file);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-
-	/* allocate memory for data arrays */
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(char), (void **)&beamflag, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(double), (void **)&bath, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_AMPLITUDE,
-						sizeof(double), (void **)&amp, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(double), (void **)&bathacrosstrack, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(double), (void **)&bathalongtrack, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_SIDESCAN,
-						sizeof(double), (void **)&ss, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_SIDESCAN,
-						sizeof(double), (void **)&ssacrosstrack, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_SIDESCAN,
-						sizeof(double), (void **)&ssalongtrack, &error);
-
-	/* if error initializing memory then quit */
-	if (error != MB_ERROR_NO_ERROR)
-		{
-		mb_error(verbose,error,&message);
-		fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",
-			message);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-
-	/* output separator for GMT style segment file output */
-	if (segment == MB_YES && ascii == MB_YES)
-		{
-		printf("%s\n", segment_tag);
-		}
-
-	/* output info */
-	if (verbose >= 1)
-		{
-		fprintf(stderr, "\nSearching %s for survey records\n", file);
-		}
-
-	/* read and print data */
-	survey_count = 0;
-	first = MB_YES;
-	while (error <= MB_ERROR_NO_ERROR)
-		{
-		/* read a data record */
-		status = mb_get_all(verbose,mbio_ptr,&store_ptr,&kind,
-			time_i,&time_d,&navlon,&navlat,
-			&speed,&heading,
-			&distance,&altitude,&sonardepth,
-			&beams_bath,&beams_amp,&pixels_ss,
-			beamflag,bath,amp,bathacrosstrack,bathalongtrack,
-			ss,ssacrosstrack,ssalongtrack,
-			comment,&error);
-
-		/* print debug statements */
-		if (verbose >= 2)
-			{
-			fprintf(stderr,"\ndbg2  Ping read in program <%s>\n",
-				program_name);
-			fprintf(stderr,"dbg2       kind:           %d\n",kind);
-			fprintf(stderr,"dbg2       error:          %d\n",error);
-			fprintf(stderr,"dbg2       status:         %d\n",status);
-			}
-
-		/* if survey data save the nav etc */
-		if (error <= MB_ERROR_NO_ERROR
-			&& kind == MB_DATA_DATA)
-			{
-			/* allocate memory for navigation/attitude arrays if needed */
-			if (nnav + 1 >= nnav_alloc)
-				{
-				nnav_alloc +=  MBCTDLIST_ALLOC_CHUNK;
-				status = mb_reallocd(verbose,__FILE__,__LINE__,nnav_alloc*sizeof(double),(void **)&nav_time_d,&error);
-				status = mb_reallocd(verbose,__FILE__,__LINE__,nnav_alloc*sizeof(double),(void **)&nav_lon,&error);
-				status = mb_reallocd(verbose,__FILE__,__LINE__,nnav_alloc*sizeof(double),(void **)&nav_lat,&error);
-				status = mb_reallocd(verbose,__FILE__,__LINE__,nnav_alloc*sizeof(double),(void **)&nav_speed,&error);
-				status = mb_reallocd(verbose,__FILE__,__LINE__,nnav_alloc*sizeof(double),(void **)&nav_sonardepth,&error);
-				status = mb_reallocd(verbose,__FILE__,__LINE__,nnav_alloc*sizeof(double),(void **)&nav_heading,&error);
-				status = mb_reallocd(verbose,__FILE__,__LINE__,nnav_alloc*sizeof(double),(void **)&nav_altitude,&error);
-				if (error != MB_ERROR_NO_ERROR)
-					{
-					mb_error(verbose,error,&message);
-					fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",message);
-					fprintf(stderr,"\nProgram <%s> Terminated\n",
-					    program_name);
-					exit(error);
-					}
-				}
-
-			/* save the nav etc */
-			if (nnav == 0 || time_d > nav_time_d[nnav-1])
-				{
-				nav_time_d[nnav] = time_d;
-				nav_lon[nnav] = navlon;
-				nav_lat[nnav] = navlat;
-				nav_speed[nnav] = speed;
-				nav_sonardepth[nnav] = sonardepth;
-				nav_heading[nnav] = heading;
-				nav_altitude[nnav] = altitude;
-				nnav++;
-				}
-			survey_count++;
-			survey_count_tot++;
-			}
-
-		}
-
-	/* close the swath file */
-	status = mb_close(verbose,&mbio_ptr,&error);
-
-	/* output info */
-	if (verbose >= 1)
-		{
-		fprintf(stderr, "nav extracted from %d survey records\n", survey_count);
-		}
-
-	/* figure out whether and what to read next */
-        if (read_datalist == MB_YES)
-                {
-		if ((status = mb_datalist_read(verbose,datalist,
-				    file,&format,&file_weight,&error))
-				    == MB_SUCCESS)
-                        read_data = MB_YES;
-                else
-                        read_data = MB_NO;
-                }
-        else
-                {
-                read_data = MB_NO;
-                }
-
-	/* end loop over files in list */
-	}
-	if (read_datalist == MB_YES)
-		mb_datalist_close(verbose,&datalist,&error);
-
-	/* output info */
-	if (verbose >= 1)
-		{
-		fprintf(stderr, "\nTotal %d survey records\n", survey_count_tot);
-		}
-
-	/**************************************************************************************/
-
-	/* section 2 - read data and output ctd data with time interpolation of nav etc */
-
-	/* open file list */
-	if (read_datalist == MB_YES)
-	    {
-	    if ((status = mb_datalist_open(verbose,&datalist,
-					    read_file,look_processed,&error)) != MB_SUCCESS)
-		{
-		error = MB_ERROR_OPEN_FAIL;
-		fprintf(stderr,"\nUnable to open data list file: %s\n",
-			read_file);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-	    if ((status = mb_datalist_read(verbose,datalist,
-			    file,&format,&file_weight,&error))
-			    == MB_SUCCESS)
-		read_data = MB_YES;
-	    else
-		read_data = MB_NO;
-	    }
-	/* else copy single filename to be read */
-	else
-	    {
-	    strcpy(file, read_file);
-	    read_data = MB_YES;
-	    }
-
-	/* loop over all files to be read */
-	while (read_data == MB_YES)
-	{
-	/* initialize reading the swath file */
-	if ((status = mb_read_init(
-		verbose,file,format,pings,lonflip,bounds,
-		btime_i,etime_i,speedmin,timegap,
-		&mbio_ptr,&btime_d,&etime_d,
-		&beams_bath,&beams_amp,&pixels_ss,&error)) != MB_SUCCESS)
-		{
-		mb_error(verbose,error,&message);
-		fprintf(stderr,"\nMBIO Error returned from function <mb_read_init>:\n%s\n",message);
-		fprintf(stderr,"\nMultibeam File <%s> not initialized for reading\n",file);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-
-	/* allocate memory for data arrays */
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(char), (void **)&beamflag, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(double), (void **)&bath, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_AMPLITUDE,
-						sizeof(double), (void **)&amp, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(double), (void **)&bathacrosstrack, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(double), (void **)&bathalongtrack, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_SIDESCAN,
-						sizeof(double), (void **)&ss, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_SIDESCAN,
-						sizeof(double), (void **)&ssacrosstrack, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_SIDESCAN,
-						sizeof(double), (void **)&ssalongtrack, &error);
-
-	/* if error initializing memory then quit */
-	if (error != MB_ERROR_NO_ERROR)
-		{
-		mb_error(verbose,error,&message);
-		fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",
-			message);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-
-	/* output info */
-	if (verbose >= 1)
-		{
-		fprintf(stderr, "\nSearching %s for CTD records\n", file);
-		}
-
-	/* read and print data */
-	ctd_count = 0;
-	first = MB_YES;
-	while (error <= MB_ERROR_NO_ERROR)
-		{
-		/* read a data record */
-		status = mb_get_all(verbose,mbio_ptr,&store_ptr,&kind,
-			time_i,&time_d,&navlon,&navlat,
-			&speed,&heading,
-			&distance,&altitude,&sonardepth,
-			&beams_bath,&beams_amp,&pixels_ss,
-			beamflag,bath,amp,bathacrosstrack,bathalongtrack,
-			ss,ssacrosstrack,ssalongtrack,
-			comment,&error);
-
-		/* print debug statements */
-		if (verbose >= 2)
-			{
-			fprintf(stderr,"\ndbg2  Ping read in program <%s>\n",
-				program_name);
-			fprintf(stderr,"dbg2       kind:           %d\n",kind);
-			fprintf(stderr,"dbg2       error:          %d\n",error);
-			fprintf(stderr,"dbg2       status:         %d\n",status);
-			}
-
-		/* if ctd then extract data */
-		if (error <= MB_ERROR_NO_ERROR
-			&& (kind == MB_DATA_CTD || kind == MB_DATA_SSV))
-			{
-			/* extract ctd */
-			status = mb_ctd(verbose, mbio_ptr, store_ptr,
-						&kind, &nctd, ctd_time_d,
-						ctd_conductivity, ctd_temperature,
-						ctd_depth, ctd_salinity, ctd_soundspeed, &error);
-
-			/* extract ancilliary sensor data */
-			status = mb_ancilliarysensor(verbose, mbio_ptr, store_ptr,
-						&kind, &nsensor, sensor_time_d,
-						sensor1, sensor2, sensor3,
-						sensor4, sensor5, sensor6,
-						sensor7, sensor8,
-						&error);
-
-			/* loop over the nctd ctd points, outputting each one */
-			if (error == MB_ERROR_NO_ERROR && nctd > 0)
-				{
-				for (ictd=0;ictd<nctd;ictd++)
-					{
-					/* get data */
-					time_d = ctd_time_d[ictd];
-					mb_get_date(verbose, time_d, time_i);
-					conductivity = ctd_conductivity[ictd];
-					temperature = ctd_temperature[ictd];
-					depth = ctd_depth[ictd];
-					salinity = ctd_salinity[ictd];
-					soundspeed = ctd_soundspeed[ictd];
-
-					/* get navigation */
-					j = 0;
-					speed = 0.0;
-					interp_status = mb_linear_interp_longitude(verbose,
-								nav_time_d-1, nav_lon-1,
-								nnav, time_d, &navlon, &j,
-								&error);
-					if (interp_status == MB_SUCCESS)
-					interp_status = mb_linear_interp_latitude(verbose,
-								nav_time_d-1, nav_lat-1,
-								nnav, time_d, &navlat, &j,
-								&error);
-					if (interp_status == MB_SUCCESS)
-					interp_status = mb_linear_interp_heading(verbose,
-								nav_time_d-1, nav_heading-1,
-								nnav, time_d, &heading, &j,
-								&error);
-					if (interp_status == MB_SUCCESS)
-					interp_status = mb_linear_interp(verbose,
-								nav_time_d-1, nav_sonardepth-1,
-								nnav, time_d, &sonardepth, &j,
-								&error);
-					if (interp_status == MB_SUCCESS)
-					interp_status = mb_linear_interp(verbose,
-								nav_time_d-1, nav_altitude-1,
-								nnav, time_d, &altitude, &j,
-								&error);
-					if (interp_status == MB_SUCCESS)
-					interp_status = mb_linear_interp(verbose,
-								nav_time_d-1, nav_speed-1,
-								nnav, time_d, &speed, &j,
-								&error);
-
-					/* only output if interpolation of nav etc has worked */
-					if (interp_status == MB_YES)
-						{
-
-						/* calculate course made good and distance */
-						mb_coor_scale(verbose,navlat, &mtodeglon, &mtodeglat);
-						headingx = sin(DTR * heading);
-						headingy = cos(DTR * heading);
-						if (first == MB_YES)
-							{
-							time_interval = 0.0;
-							course = heading;
-							speed_made_good = 0.0;
-							course_old = heading;
-							speed_made_good_old = speed;
-							distance = 0.0;
-							}
-						else
-							{
-							time_interval = time_d - time_d_old;
-							dx = (navlon - navlon_old)/mtodeglon;
-							dy = (navlat - navlat_old)/mtodeglat;
-							distance = sqrt(dx*dx + dy*dy);
-							if (distance > 0.0)
-								course = RTD*atan2(dx/distance,dy/distance);
-							else
-								course = course_old;
-							if (course < 0.0)
-								course = course + 360.0;
-							if (time_interval > 0.0)
-								speed_made_good = 3.6*distance/time_interval;
-							else
-								speed_made_good
-									= speed_made_good_old;
-							}
-						distance_total += 0.001 * distance;
-
-						/* reset old values */
-						navlon_old = navlon;
-						navlat_old = navlat;
-						course_old = course;
-						speed_made_good_old = speed_made_good;
-						time_d_old = time_d;
-
-						/* now loop over list of output parameters */
-						ctd_count++;
-						ctd_count_tot++;
-						if (nctd % decimate == 0)
-						for (i=0; i<n_list; i++)
-							{
-							switch (list[i])
-								{
-								case '/': /* Inverts next simple value */
-									invert_next_value = MB_YES;
-									break;
-								case '-': /* Flip sign on next simple value */
-									signflip_next_value = MB_YES;
-									break;
-								case '^': /* use mblist definitions of CcSsTt */
-									mblist_next_value = MB_YES;
-									break;
-								case '1': /* Sensor 1 - volts */
-									printsimplevalue(verbose, sensor1[ictd], 0, 3, ascii,
-											    &invert_next_value,
-											    &signflip_next_value, &error);
-									break;
-								case '2': /* Sensor 2 - volts */
-									printsimplevalue(verbose, sensor2[ictd], 0, 3, ascii,
-											    &invert_next_value,
-											    &signflip_next_value, &error);
-									break;
-								case '3': /* Sensor 3 - volts */
-									printsimplevalue(verbose, sensor3[ictd], 0, 3, ascii,
-											    &invert_next_value,
-											    &signflip_next_value, &error);
-									break;
-								case '4': /* Sensor 4 - volts */
-									printsimplevalue(verbose, sensor4[ictd], 0, 3, ascii,
-											    &invert_next_value,
-											    &signflip_next_value, &error);
-									break;
-								case '5': /* Sensor 5 - volts */
-									printsimplevalue(verbose, sensor5[ictd], 0, 3, ascii,
-											    &invert_next_value,
-											    &signflip_next_value, &error);
-									break;
-								case '6': /* Sensor 6 - volts */
-									printsimplevalue(verbose, sensor6[ictd], 0, 3, ascii,
-											    &invert_next_value,
-											    &signflip_next_value, &error);
-									break;
-								case '7': /* Sensor 7 - volts */
-									printsimplevalue(verbose, sensor7[ictd], 0, 3, ascii,
-											    &invert_next_value,
-											    &signflip_next_value, &error);
-									break;
-								case '8': /* Sensor 8 - volts */
-									printsimplevalue(verbose, sensor8[ictd], 0, 3, ascii,
-											    &invert_next_value,
-											    &signflip_next_value, &error);
-									break;
-								case 'C': /* Conductivity or Sonar altitude (m) */
-									if (mblist_next_value == MB_NO)
-										printsimplevalue(verbose, conductivity, 0, 5, ascii,
-											    &invert_next_value,
-											    &signflip_next_value, &error);
-									else
-										{
-										printsimplevalue(verbose, altitude, 0, 3, ascii,
-											    &invert_next_value,
-											    &signflip_next_value, &error);
-										mblist_next_value = MB_NO;
-										}
-									break;
-								case 'c': /* Temperature or sonar transducer depth (m) */
-									if (mblist_next_value == MB_NO)
-										printsimplevalue(verbose, temperature, 0, 5, ascii,
-											    &invert_next_value,
-											    &signflip_next_value, &error);
-									else
-										{
-										printsimplevalue(verbose, sonardepth, 0, 3, ascii,
-											    &invert_next_value,
-											    &signflip_next_value, &error);
-										mblist_next_value = MB_NO;
-										}
-									break;
-								case 'H': /* heading */
-									printsimplevalue(verbose, heading, 6, 2, ascii,
-											    &invert_next_value,
-											    &signflip_next_value, &error);
-									break;
-								case 'h': /* course */
-									printsimplevalue(verbose, course, 6, 2, ascii,
-											    &invert_next_value,
-											    &signflip_next_value, &error);
-									break;
-								case 'J': /* time string */
-									mb_get_jtime(verbose,time_i,time_j);
-									seconds = time_i[5] + 0.000001 * time_i[6];
-									if (ascii == MB_YES)
-									    {
-									    printf("%.4d %.3d %.2d %.2d %9.6f",
-										time_j[0],time_j[1],
-										time_i[3],time_i[4],
-										seconds);
-									    }
-									else
-									    {
-									    b = time_j[0];
-									    fwrite(&b, sizeof(double), 1, stdout);
-									    b = time_j[1];
-									    fwrite(&b, sizeof(double), 1, stdout);
-									    b = time_i[3];
-									    fwrite(&b, sizeof(double), 1, stdout);
-									    b = time_i[4];
-									    fwrite(&b, sizeof(double), 1, stdout);
-									    b = time_i[5];
-									    fwrite(&b, sizeof(double), 1, stdout);
-									    b = time_i[6];
-									    fwrite(&b, sizeof(double), 1, stdout);
-									    }
-									break;
-								case 'j': /* time string */
-									mb_get_jtime(verbose,time_i,time_j);
-									seconds = time_i[5] + 0.000001 * time_i[6];
-									if (ascii == MB_YES)
-									    {
-									    printf("%.4d %.3d %.4d %9.6f",
-										time_j[0],time_j[1],
-										time_j[2],seconds);
-									    }
-									else
-									    {
-									    b = time_j[0];
-									    fwrite(&b, sizeof(double), 1, stdout);
-									    b = time_j[1];
-									    fwrite(&b, sizeof(double), 1, stdout);
-									    b = time_j[2];
-									    fwrite(&b, sizeof(double), 1, stdout);
-									    b = time_j[3];
-									    fwrite(&b, sizeof(double), 1, stdout);
-									    b = time_j[4];
-									    fwrite(&b, sizeof(double), 1, stdout);
-									    }
-									break;
-								case 'L': /* along-track distance (km) */
-									printsimplevalue(verbose, distance_total, 7, 3, ascii,
-											    &invert_next_value,
-											    &signflip_next_value, &error);
-									break;
-								case 'l': /* along-track distance (m) */
-									printsimplevalue(verbose, 1000.0 * distance_total, 7, 3, ascii,
-											    &invert_next_value,
-											    &signflip_next_value, &error);
-									break;
-								case 'M': /* Decimal unix seconds since
-										1/1/70 00:00:00 */
-									printsimplevalue(verbose, time_d, 0, 6, ascii,
-											    &invert_next_value,
-											    &signflip_next_value, &error);
-									break;
-								case 'm': /* time in decimal seconds since
-										first record */
-									if (first_m == MB_YES)
-										{
-										time_d_ref = time_d;
-										first_m = MB_NO;
-										}
-									b = time_d - time_d_ref;
-									printsimplevalue(verbose, b, 0, 6, ascii,
-											    &invert_next_value,
-											    &signflip_next_value, &error);
-									break;
-								case 'P': /* potential temperature (degrees) */
-									/* approximation taken from http://mason.gmu.edu/~bklinger/seawater.pdf
-									  on 4/25/2012 - to be replaced by a better calculation at some point */
-									potentialtemperature = temperature
-												- 0.04 * (1.0 + 0.185 * temperature + 0.35 * (salinity - 35.0)) * (sonardepth / 1000.0)
-												-  0.0075 * (1.0 - temperature / 30.0) * (sonardepth * sonardepth / 1000000.0);
-									printsimplevalue(verbose, potentialtemperature, 0, 5, ascii,
-											    &invert_next_value,
-											    &signflip_next_value, &error);
-									break;
-								case 'S': /* salinity or speed */
-									if (mblist_next_value == MB_NO)
-										printsimplevalue(verbose, salinity, 0, 5, ascii,
-											    &invert_next_value,
-											    &signflip_next_value, &error);
-									else
-										{
-										printsimplevalue(verbose, speed, 5, 2, ascii,
-											    &invert_next_value,
-											    &signflip_next_value, &error);
-										mblist_next_value = MB_NO;
-										}
-									break;
-								case 's': /* speed made good */
-									if (mblist_next_value == MB_NO)
-										printsimplevalue(verbose, soundspeed, 0, 3, ascii,
-											    &invert_next_value,
-											    &signflip_next_value, &error);
-									else
-										{
-										printsimplevalue(verbose, speed_made_good, 5, 2, ascii,
-											    &invert_next_value,
-											    &signflip_next_value, &error);
-										mblist_next_value = MB_NO;
-										}
-									break;
-								case 'T': /* yyyy/mm/dd/hh/mm/ss time string */
-									seconds = time_i[5] + 1e-6 * time_i[6];
-									if (ascii == MB_YES)
-									    printf("%.4d/%.2d/%.2d/%.2d/%.2d/%9.6f",
-										time_i[0],time_i[1],time_i[2],
-										time_i[3],time_i[4],seconds);
-									else
-									    {
-									    b = time_i[0];
-									    fwrite(&b, sizeof(double), 1, stdout);
-									    b = time_i[1];
-									    fwrite(&b, sizeof(double), 1, stdout);
-									    b = time_i[2];
-									    fwrite(&b, sizeof(double), 1, stdout);
-									    b = time_i[3];
-									    fwrite(&b, sizeof(double), 1, stdout);
-									    b = time_i[4];
-									    fwrite(&b, sizeof(double), 1, stdout);
-									    b = seconds;
-									    fwrite(&b, sizeof(double), 1, stdout);
-									    }
-									break;
-								case 't': /* yyyy mm dd hh mm ss time string */
-									seconds = time_i[5] + 1e-6 * time_i[6];
-									if (ascii == MB_YES)
-									    printf("%.4d %.2d %.2d %.2d %.2d %9.6f",
-										time_i[0],time_i[1],time_i[2],
-										time_i[3],time_i[4],seconds);
-									else
-									    {
-									    b = time_i[0];
-									    fwrite(&b, sizeof(double), 1, stdout);
-									    b = time_i[1];
-									    fwrite(&b, sizeof(double), 1, stdout);
-									    b = time_i[2];
-									    fwrite(&b, sizeof(double), 1, stdout);
-									    b = time_i[3];
-									    fwrite(&b, sizeof(double), 1, stdout);
-									    b = time_i[4];
-									    fwrite(&b, sizeof(double), 1, stdout);
-									    b = seconds;
-									    fwrite(&b, sizeof(double), 1, stdout);
-									    }
-									break;
-								case 'U': /* unix time in seconds since 1/1/70 00:00:00 */
-									time_u = (int) time_d;
-									if (ascii == MB_YES)
-									    printf("%ld",time_u);
-									else
-									    {
-									    b = time_u;
-									    fwrite(&b, sizeof(double), 1, stdout);
-									    }
-									break;
-								case 'u': /* time in seconds since first record */
-									time_u = (int) time_d;
-									if (first_u == MB_YES)
-										{
-										time_u_ref = time_u;
-										first_u = MB_NO;
-										}
-									if (ascii == MB_YES)
-									    printf("%ld",time_u - time_u_ref);
-									else
-									    {
-									    b = time_u - time_u_ref;
-									    fwrite(&b, sizeof(double), 1, stdout);
-									    }
-									break;
-								case 'V': /* time in seconds since last value */
-								case 'v':
-									if (ascii == MB_YES)
-									    {
-									    if ( fabs(time_interval) > 100. )
-										printf("%g",time_interval);
-									    else
-										printf("%7.3f",time_interval);
-									    }
-									else
-									    {
-									    fwrite(&time_interval, sizeof(double), 1, stdout);
-									    }
-									break;
-								case 'X': /* longitude decimal degrees */
-									dlon = navlon;
-									printsimplevalue(verbose, dlon, 11, 6, ascii,
-											    &invert_next_value,
-											    &signflip_next_value, &error);
-									break;
-								case 'x': /* longitude degress + decimal minutes */
-									dlon = navlon;
-									if (dlon < 0.0)
-										{
-										hemi = 'W';
-										dlon = -dlon;
-										}
-									else
-										hemi = 'E';
-									degrees = (int) dlon;
-									minutes = 60.0*(dlon - degrees);
-									if (ascii == MB_YES)
-									    {
-									    printf("%3d %8.5f%c",
-										degrees, minutes, hemi);
-									    }
-									else
-									    {
-									    b = degrees;
-									    if (hemi == 'W') b = -b;
-									    fwrite(&b, sizeof(double), 1, stdout);
-									    b = minutes;
-									    fwrite(&b, sizeof(double), 1, stdout);
-									    }
-									break;
-								case 'Y': /* latitude decimal degrees */
-									dlat = navlat;
-									printsimplevalue(verbose, dlat, 11, 6, ascii,
-											    &invert_next_value,
-											    &signflip_next_value, &error);
-									break;
-								case 'y': /* latitude degrees + decimal minutes */
-									dlat = navlat;
-									if (dlat < 0.0)
-										{
-										hemi = 'S';
-										dlat = -dlat;
-										}
-									else
-										hemi = 'N';
-									degrees = (int) dlat;
-									minutes = 60.0*(dlat - degrees);
-									if (ascii == MB_YES)
-									    {
-									    printf("%3d %8.5f%c",
-										degrees, minutes, hemi);
-									    }
-									else
-									    {
-									    b = degrees;
-									    if (hemi == 'S') b = -b;
-									    fwrite(&b, sizeof(double), 1, stdout);
-									    b = minutes;
-									    fwrite(&b, sizeof(double), 1, stdout);
-									    }
-									break;
-								default:
-									if (ascii == MB_YES)
-									    printf("<Invalid Option: %c>",
-										list[i]);
-									break;
-								}
-							if (ascii == MB_YES)
-								{
-								if (i<(n_list-1)) printf ("%s", delimiter);
-								else printf ("\n");
-								}
-							}
-						first = MB_NO;
-						}
-					}
-				}
-			}
-
-		/* else if survey data ignore */
-		else if (error <= MB_ERROR_NO_ERROR
-			&& kind == MB_DATA_DATA)
-			{
-			}
-
-		}
-
-	/* close the swath file */
-	status = mb_close(verbose,&mbio_ptr,&error);
-
-	/* output info */
-	if (verbose >= 1)
-		{
-		fprintf(stderr, "%d CTD records\n", ctd_count);
-		}
-
-	/* figure out whether and what to read next */
-        if (read_datalist == MB_YES)
-                {
-		if ((status = mb_datalist_read(verbose,datalist,
-				    file,&format,&file_weight,&error))
-				    == MB_SUCCESS)
-                        read_data = MB_YES;
-                else
-                        read_data = MB_NO;
-                }
-        else
-                {
-                read_data = MB_NO;
-                }
-
-	/* end loop over files in list */
-	}
-	if (read_datalist == MB_YES)
-		mb_datalist_close(verbose,&datalist,&error);
-
-	/* output info */
-	if (verbose >= 1)
-		{
-		fprintf(stderr, "\nTotal %d CTD records\n", ctd_count_tot);
-		}
-
-	/* deallocate navigation arrays */
-	if (nnav > 0)
-		{
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&nav_time_d,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&nav_lon,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&nav_lat,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&nav_speed,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&nav_sonardepth,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&nav_heading,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&nav_altitude,&error);
-		}
-
-	/* check memory */
-	if (verbose >= 4)
-		status = mb_memory_list(verbose,&error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  Program <%s> completed\n",
-			program_name);
-		fprintf(stderr,"dbg2  Ending status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* end it all */
-	exit(error);
-}
-/*--------------------------------------------------------------------*/
-int printsimplevalue(int verbose,
-	double value, int width, int precision,
-	int ascii, int *invert, int *flipsign, int *error)
-{
-	char	*function_name = "printsimplevalue";
-	int	status = MB_SUCCESS;
-	char	format[24];
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBlist function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:         %d\n",verbose);
-		fprintf(stderr,"dbg2       value:           %f\n",value);
-		fprintf(stderr,"dbg2       width:           %d\n",width);
-		fprintf(stderr,"dbg2       precision:       %d\n",precision);
-		fprintf(stderr,"dbg2       ascii:           %d\n",ascii);
-		fprintf(stderr,"dbg2       invert:          %d\n",*invert);
-		fprintf(stderr,"dbg2       flipsign:        %d\n",*flipsign);
-		}
-
-	/* make print format */
-	format[0] = '%';
-	if (*invert == MB_YES)
-	    strcpy(format, "%g");
-	else if (width > 0)
-	    sprintf(&format[1], "%d.%df", width, precision);
-	else
-	    sprintf(&format[1], ".%df", precision);
-
-	/* invert value if desired */
-	if (*invert == MB_YES)
-	    {
-	    *invert = MB_NO;
-	    if (value != 0.0)
-		value = 1.0 / value;
-	    }
-
-	/* flip sign value if desired */
-	if (*flipsign == MB_YES)
-	    {
-	    *flipsign = MB_NO;
-	    value = -value;
-	    }
-
-	/* print value */
-	if (ascii == MB_YES)
-	    printf(format, value);
-	else
-	    fwrite(&value, sizeof(double), 1, stdout);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBlist function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       invert:          %d\n",*invert);
-		fprintf(stderr,"dbg2       error:           %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:          %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int printNaN(int verbose, int ascii, int *invert, int *flipsign, int *error)
-{
-	char	*function_name = "printNaN";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBlist function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:         %d\n",verbose);
-		fprintf(stderr,"dbg2       ascii:           %d\n",ascii);
-		fprintf(stderr,"dbg2       invert:          %d\n",*invert);
-		fprintf(stderr,"dbg2       flipsign:        %d\n",*flipsign);
-		}
-
-	/* reset invert flag */
-	if (*invert == MB_YES)
-	    *invert = MB_NO;
-
-	/* reset flipsign flag */
-	if (*flipsign == MB_YES)
-	    *flipsign = MB_NO;
-
-	/* print value */
-	if (ascii == MB_YES)
-	    printf("NaN");
-	else
-	    fwrite(&NaN, sizeof(double), 1, stdout);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBlist function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       invert:          %d\n",*invert);
-		fprintf(stderr,"dbg2       error:           %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:          %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/utilities/mbdatalist.c b/src/utilities/mbdatalist.c
deleted file mode 100644
index 923dd94..0000000
--- a/src/utilities/mbdatalist.c
+++ /dev/null
@@ -1,613 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbdatalist.c	10/10/2001
- *    $Id: mbdatalist.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 2001-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * MBdatalist parses recursive datalist files and outputs the
- * complete list of data files and formats.
- * The results are dumped to stdout.
- *
- * Author:	D. W. Caress
- * Date:	October 10, 2001
- *
- * $Log: mbdatalist.c,v $
- * Revision 5.11  2007/07/05 19:16:19  caress
- * Added file copy function.
- *
- * Revision 5.10  2006/01/06 18:19:58  caress
- * Working towards 5.0.8
- *
- * Revision 5.9  2005/11/05 01:07:54  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.8  2004/10/06 19:10:52  caress
- * Release 5.0.5 update.
- *
- * Revision 5.7  2003/04/17 21:17:10  caress
- * Release 5.0.beta30
- *
- * Revision 5.6  2002/05/29 23:43:09  caress
- * Release 5.0.beta18
- *
- * Revision 5.5  2002/04/08 21:01:04  caress
- * Release 5.0.beta17
- *
- * Revision 5.4  2002/04/06 02:53:45  caress
- * Release 5.0.beta16
- *
- * Revision 5.3  2002/03/26 07:45:14  caress
- * Release 5.0.beta15
- *
- * Revision 5.2  2002/02/22 09:07:08  caress
- * Release 5.0.beta13
- *
- * Revision 5.1  2001/10/19  00:56:17  caress
- * Now tries to use relative paths.
- *
- * Revision 5.0  2001/10/12  21:07:31  caress
- * Initial revision.
- *
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <math.h>
-#include <string.h>
-
-/* MBIO include files */
-#include "mb_status.h"
-#include "mb_define.h"
-#include "mb_format.h"
-#include "mb_status.h"
-#include "mb_process.h"
-
-static char rcs_id[] = "$Id: mbdatalist.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-
-int main (int argc, char **argv)
-{
-	char program_name[] = "mbdatalist";
-	char help_message[] =  "mbdatalist parses recursive datalist files and outputs the\ncomplete list of data files and formats. \nThe results are dumped to stdout.";
-	char usage_message[] = "mbdatalist [-Fformat -Ifile -N -O -P -Q -Rw/e/s/n -S -U -Y -Z -V -H]";
-	extern char *optarg;
-	int	errflg = 0;
-	int	c;
-	int	help = 0;
-	int	flag = 0;
-
-	/* MBIO status variables */
-	int	status = MB_SUCCESS;
-	int	verbose = 0;
-	int	error = MB_ERROR_NO_ERROR;
-
-	/* MBIO read control parameters */
-	char	read_file[MB_PATH_MAXLINE];
-	void	*datalist;
-	int	look_processed = MB_DATALIST_LOOK_UNSET;
-	int	look_bounds = MB_NO;
-	int	copyfiles = MB_NO;
-	int	file_in_bounds = MB_NO;
-	double	file_weight = 1.0;
-	int	format;
-	int	pings;
-	int	lonflip;
-	double	bounds[4];
-	int	btime_i[7];
-	int	etime_i[7];
-	double	speedmin;
-	double	timegap;
-	char	fileroot[MB_PATH_MAXLINE];
-	char	file[MB_PATH_MAXLINE];
-	char	pwd[MB_PATH_MAXLINE];
-	char	command[MB_PATH_MAXLINE];
-	char	*filename;
-	int	nfile = 0;
-	int	make_inf = MB_NO;
-	int	force_update = MB_NO;
-	int	status_report = MB_NO;
-	int	problem_report = MB_NO;
-	int	nparproblem;
-	int	ndataproblem;
-	int	nparproblemtot = 0;
-	int	ndataproblemtot = 0;
-	int	nproblemfiles = 0;
-	int	remove_locks = MB_NO;
-	int	make_datalistp = MB_NO;
-
-	int	prstatus = MB_PR_FILE_UP_TO_DATE;
-	int	lock_status;
-	int	lock_error;
-	int	locked;
-	int	lock_purpose;
-	mb_path	lock_program;
-	mb_path lock_cpu;
-	mb_path lock_user;
-	char	lock_date[25];
-	mb_path	lockfile;
-
-	char	*bufptr;
-	int	shellstatus;
-
-	/* output stream for basic stuff (stdout if verbose <= 1,
-		output if verbose > 1) */
-	FILE	*output;
-	FILE	*fp;
-
-	/* get current default values */
-	status = mb_defaults(verbose,&format,&pings,&lonflip,bounds,
-		btime_i,etime_i,&speedmin,&timegap);
-
-	/* set default input to stdin */
-	strcpy (read_file, "datalist.mb-1");
-
-	/* process argument list */
-	while ((c = getopt(argc, argv, "VvHhCcF:f:I:i:NnOoPpQqR:r:SsUuYyZz")) != -1)
-	  switch (c)
-		{
-		case 'C':
-		case 'c':
-			copyfiles = MB_YES;
-			flag++;
-			break;
-		case 'F':
-		case 'f':
-			sscanf (optarg,"%d", &format);
-			flag++;
-			break;
-		case 'H':
-		case 'h':
-			help++;
-			break;
-		case 'I':
-		case 'i':
-			sscanf (optarg,"%s", read_file);
-			flag++;
-			break;
-		case 'N':
-		case 'n':
-			force_update = MB_YES;
-			make_inf = MB_YES;
-			flag++;
-			break;
-		case 'O':
-		case 'o':
-			make_inf = MB_YES;
-			flag++;
-			break;
-		case 'P':
-		case 'p':
-			look_processed = MB_DATALIST_LOOK_YES;
-			flag++;
-			break;
-		case 'Q':
-		case 'q':
-			problem_report = MB_YES;
-			flag++;
-			break;
-		case 'R':
-		case 'r':
-			mb_get_bounds(optarg, bounds);
-			look_bounds = MB_YES;
-			flag++;
-			break;
-		case 'S':
-		case 's':
-			status_report = MB_YES;
-			flag++;
-			break;
-		case 'U':
-		case 'u':
-			look_processed = MB_DATALIST_LOOK_NO;
-			flag++;
-			break;
-		case 'V':
-		case 'v':
-			verbose++;
-			break;
-		case 'Y':
-		case 'y':
-			remove_locks = MB_YES;
-			break;
-		case 'Z':
-		case 'z':
-			make_datalistp = MB_YES;
-			break;
-		case '?':
-			errflg++;
-		}
-
-	/* set output stream */
-	if (verbose <= 1)
-		output = stdout;
-	else
-		output = stderr;
-
-	/* if error flagged then print it and exit */
-	if (errflg)
-		{
-		fprintf(output,"usage: %s\n", usage_message);
-		fprintf(output,"\nProgram <%s> Terminated\n",
-			program_name);
-		error = MB_ERROR_BAD_USAGE;
-		exit(error);
-		}
-
-	/* print starting message */
-	if (verbose == 1 || help)
-		{
-		fprintf(output,"\nProgram %s\n",program_name);
-		fprintf(output,"Version %s\n",rcs_id);
-		fprintf(output,"MB-system Version %s\n",MB_VERSION);
-		}
-
-	/* print starting debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(output,"\ndbg2  Program <%s>\n",program_name);
-		fprintf(output,"dbg2  Version %s\n",rcs_id);
-		fprintf(output,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(output,"dbg2  Control Parameters:\n");
-		fprintf(output,"dbg2       verbose:        %d\n",verbose);
-		fprintf(output,"dbg2       help:           %d\n",help);
-		fprintf(output,"dbg2       file:           %s\n",read_file);
-		fprintf(output,"dbg2       format:         %d\n",format);
-		fprintf(output,"dbg2       look_processed: %d\n",look_processed);
-		fprintf(output,"dbg2       copyfiles:      %d\n",copyfiles);
-		fprintf(output,"dbg2       make_inf:       %d\n",make_inf);
-		fprintf(output,"dbg2       force_update:   %d\n",force_update);
-		fprintf(output,"dbg2       status_report:  %d\n",status_report);
-		fprintf(output,"dbg2       problem_report: %d\n",problem_report);
-		fprintf(output,"dbg2       make_datalistp: %d\n",make_datalistp);
-		fprintf(output,"dbg2       remove_locks:   %d\n",remove_locks);
-		fprintf(output,"dbg2       pings:          %d\n",pings);
-		fprintf(output,"dbg2       lonflip:        %d\n",lonflip);
-		fprintf(output,"dbg2       bounds[0]:      %f\n",bounds[0]);
-		fprintf(output,"dbg2       bounds[1]:      %f\n",bounds[1]);
-		fprintf(output,"dbg2       bounds[2]:      %f\n",bounds[2]);
-		fprintf(output,"dbg2       bounds[3]:      %f\n",bounds[3]);
-		fprintf(output,"dbg2       btime_i[0]:     %d\n",btime_i[0]);
-		fprintf(output,"dbg2       btime_i[1]:     %d\n",btime_i[1]);
-		fprintf(output,"dbg2       btime_i[2]:     %d\n",btime_i[2]);
-		fprintf(output,"dbg2       btime_i[3]:     %d\n",btime_i[3]);
-		fprintf(output,"dbg2       btime_i[4]:     %d\n",btime_i[4]);
-		fprintf(output,"dbg2       btime_i[5]:     %d\n",btime_i[5]);
-		fprintf(output,"dbg2       btime_i[6]:     %d\n",btime_i[6]);
-		fprintf(output,"dbg2       etime_i[0]:     %d\n",etime_i[0]);
-		fprintf(output,"dbg2       etime_i[1]:     %d\n",etime_i[1]);
-		fprintf(output,"dbg2       etime_i[2]:     %d\n",etime_i[2]);
-		fprintf(output,"dbg2       etime_i[3]:     %d\n",etime_i[3]);
-		fprintf(output,"dbg2       etime_i[4]:     %d\n",etime_i[4]);
-		fprintf(output,"dbg2       etime_i[5]:     %d\n",etime_i[5]);
-		fprintf(output,"dbg2       etime_i[6]:     %d\n",etime_i[6]);
-		fprintf(output,"dbg2       speedmin:       %f\n",speedmin);
-		fprintf(output,"dbg2       timegap:        %f\n",timegap);
-		}
-
-	/* if help desired then print it and exit */
-	if (help)
-		{
-		fprintf(output,"\n%s\n",help_message);
-		fprintf(output,"\nusage: %s\n", usage_message);
-		exit(error);
-		}
-
-	/* if make_datalistp desired then make it */
-	if (make_datalistp)
-		{
-   		/* figure out data format and fileroot if possible */
-		status = mb_get_format(verbose, read_file,
-					fileroot, &format, &error);
-		sprintf(file, "%sp.mb-1", fileroot);
-
-	    	if ((fp = fopen(file,"w")) == NULL)
-		    {
-		    error = MB_ERROR_OPEN_FAIL;
-		    fprintf(stderr, "\nUnable to open output file %s\n", file);
-		    fprintf(stderr, "Program %s aborted!\n", program_name);
-		    exit(error);
-		    }
-		fprintf(fp, "$PROCESSED\n%s %d\n", read_file, format);
-		fclose(fp);
-		if (verbose > 0)
-		    fprintf(output, "Convenience datalist file %s created...\n", file);
-
-		/* exit unless building ancilliary files has also been requested */
-		if (make_inf == MB_NO)
-			exit(error);
-		}
-
-	/* get format if required */
-	if (format == 0)
-		mb_get_format(verbose,read_file,NULL,&format,&error);
-
-	/* if not a datalist just output filename format and weight */
-	if (format > 0)
-		{
-		nfile++;
-
-		if (make_inf == MB_YES)
-		    {
-		    status = mb_make_info(verbose, force_update,
-						read_file, format, &error);
-		    }
-		else if (problem_report == MB_YES)
-		    {
-		    status = mb_pr_check(verbose, read_file, &nparproblem, &ndataproblem, &error);
-		    if (nparproblem + ndataproblem > 0)
-			nproblemfiles++;
-		    nparproblemtot += nparproblem;
-		    ndataproblemtot += ndataproblem;
-
-		    }
-		else
-		    {
-		    /* check for mbinfo file if bounds checking enabled */
-		    if (look_bounds == MB_YES)
-			{
-			status = mb_check_info(verbose, read_file, lonflip, bounds,
-				    &file_in_bounds, &error);
-			if (status == MB_FAILURE)
-			    {
-			    file_in_bounds = MB_YES;
-			    status = MB_SUCCESS;
-			    error = MB_ERROR_NO_ERROR;
-			    }
-			}
-
-		    /* ouput file if no bounds checking or in bounds */
-		    if (look_bounds == MB_NO || file_in_bounds == MB_YES)
-			{
-			if (verbose > 0)
-				fprintf(output, "%s %d %f\n", read_file, format, file_weight);
-			else
-				fprintf(output, "%s %d %f", read_file, format, file_weight);
-
-			/* check status if desired */
-			if (status_report == MB_YES)
-			    {
-			    status = mb_pr_checkstatus(verbose, read_file, &prstatus, &error);
-			    if (verbose > 0)
-				{
-				if (prstatus == MB_PR_FILE_UP_TO_DATE)
-				    fprintf(output, "\tStatus: up to date\n");
-				else if (prstatus == MB_PR_FILE_NEEDS_PROCESSING)
-				    fprintf(output, "\tStatus: out of date - needs processing\n");
-				else if (prstatus == MB_PR_FILE_NOT_EXIST)
-				    fprintf(output, "\tStatus: file does not exist\n");
-				else if (prstatus == MB_PR_NO_PARAMETER_FILE)
-				    fprintf(output, "\tStatus: no parameter file - processing undefined\n");
-				}
-			    else
-				{
-				if (prstatus == MB_PR_FILE_UP_TO_DATE)
-				    fprintf(output, "\t<Up-to-date>");
-				else if (prstatus == MB_PR_FILE_NEEDS_PROCESSING)
-				    fprintf(output, "\t<Needs-processing>");
-				else if (prstatus == MB_PR_FILE_NOT_EXIST)
-				    fprintf(output, "\t<Does-not-exist>");
-				else if (prstatus == MB_PR_NO_PARAMETER_FILE)
-				    fprintf(output, "\t<No-parameter-file>");
-				}
-			    }
-
-			/* check locks if desired */
-			if (status_report == MB_YES || remove_locks == MB_YES)
-			    {
-			    lock_status = mb_pr_lockinfo(verbose, read_file, &locked,
-							    &lock_purpose, lock_program, lock_user,
-							    lock_cpu, lock_date, &lock_error);
-			    if (locked == MB_YES && status_report == MB_YES)
-				{
-				if (verbose > 0)
-					fprintf(output,"\tLocked by program <%s> run by <%s> on <%s> at <%s>\n",
-						lock_program, lock_user, lock_cpu, lock_date);
-				else
-					fprintf(output,"\t<Locked>");
-				}
-			    if (locked == MB_YES && remove_locks == MB_YES)
-			        {
-				sprintf(lockfile, "%s.lck", file);
-				sprintf(command, "/bin/rm -f %s", lockfile);
-				}
-			    }
-
-			if (verbose == 0)
-				fprintf(output, "\n");
-			}
-		    }
-		}
-
-	/* else parse datalist */
-	else
-		{
-		if ((status = mb_datalist_open(verbose,&datalist,
-						read_file,look_processed,&error)) != MB_SUCCESS)
-		    {
-		    error = MB_ERROR_OPEN_FAIL;
-		    fprintf(stderr,"\nUnable to open data list file: %s\n",
-			    read_file);
-		    fprintf(stderr,"\nProgram <%s> Terminated\n",
-			    program_name);
-		    exit(error);
-		    }
-		while ((status = mb_datalist_read(verbose,datalist,
-					    file,&format,&file_weight,&error))
-			    == MB_SUCCESS)
-			{
-			nfile++;
-			bufptr = getcwd(pwd, MB_PATH_MAXLINE);
-			mb_get_relative_path(verbose, file, pwd, &error);
-			if (make_inf == MB_YES)
-			    {
-			    status = mb_make_info(verbose, force_update,
-							file, format, &error);
-			    }
-			else if (problem_report == MB_YES)
-			    {
-			    status = mb_pr_check(verbose, file, &nparproblem, &ndataproblem, &error);
-		    	    if (nparproblem + ndataproblem > 0)
-				nproblemfiles++;
-		    	    nparproblemtot += nparproblem;
-		    	    ndataproblemtot += ndataproblem;
-			    }
-			else if (copyfiles == MB_YES)
-			    {
-			    /* check for mbinfo file if bounds checking enabled */
-			    if (look_bounds == MB_YES)
-				{
-				status = mb_check_info(verbose, file, lonflip, bounds,
-					    &file_in_bounds, &error);
-				if (status == MB_FAILURE)
-				    {
-				    file_in_bounds = MB_YES;
-				    status = MB_SUCCESS;
-				    error = MB_ERROR_NO_ERROR;
-				    }
-				}
-
-			    /* copy file if no bounds checking or in bounds */
-			    if (look_bounds == MB_NO || file_in_bounds == MB_YES)
-				{
-				fprintf(output, "Copying %s %d %f\n", file, format, file_weight);
-				sprintf(command, "cp %s* .", file);
-				shellstatus = system(command);
-				if ((filename = strrchr(file, '/')) != NULL)
-					filename++;
-				else
-					filename = file;
-				if (nfile == 1)
-					shellstatus = system("rm datalist.mb-1");
-			    	sprintf(command, "echo %s %d %f >> datalist.mb-1",
-					filename, format, file_weight);
-				shellstatus = system(command);
-			    	}
-			    }
-			else
-			    {
-			    /* check for mbinfo file if bounds checking enabled */
-			    if (look_bounds == MB_YES)
-				{
-				status = mb_check_info(verbose, file, lonflip, bounds,
-					    &file_in_bounds, &error);
-				if (status == MB_FAILURE)
-				    {
-				    file_in_bounds = MB_YES;
-				    status = MB_SUCCESS;
-				    error = MB_ERROR_NO_ERROR;
-				    }
-				}
-
-			    /* ouput file if no bounds checking or in bounds */
-			    if (look_bounds == MB_NO || file_in_bounds == MB_YES)
-				{
-				if (verbose > 0)
-					fprintf(output, "%s %d %f\n", file, format, file_weight);
-				else
-					fprintf(output, "%s %d %f", file, format, file_weight);
-
-				/* check status if desired */
-				if (status_report == MB_YES)
-				    {
-				    status = mb_pr_checkstatus(verbose, file, &prstatus, &error);
-				    if (verbose > 0)
-					{
-					if (prstatus == MB_PR_FILE_UP_TO_DATE)
-					    fprintf(output, "\tStatus: up to date\n");
-					else if (prstatus == MB_PR_FILE_NEEDS_PROCESSING)
-					    fprintf(output, "\tStatus: out of date - needs processing\n");
-					else if (prstatus == MB_PR_FILE_NOT_EXIST)
-					    fprintf(output, "\tStatus: file does not exist\n");
-					else if (prstatus == MB_PR_NO_PARAMETER_FILE)
-					    fprintf(output, "\tStatus: no parameter file - processing undefined\n");
-					}
-				    else
-					{
-					if (prstatus == MB_PR_FILE_UP_TO_DATE)
-					    fprintf(output, "\t<Up-to-date>");
-					else if (prstatus == MB_PR_FILE_NEEDS_PROCESSING)
-					    fprintf(output, "\t<Needs-processing>");
-					else if (prstatus == MB_PR_FILE_NOT_EXIST)
-					    fprintf(output, "\t<Does-not-exist>");
-					else if (prstatus == MB_PR_NO_PARAMETER_FILE)
-					    fprintf(output, "\t<No-parameter-file>");
-					}
-				    }
-
-				/* check locks if desired */
-				if (status_report == MB_YES || remove_locks == MB_YES)
-				    {
-				    lock_status = mb_pr_lockinfo(verbose, file, &locked,
-								    &lock_purpose, lock_program, lock_user,
-								    lock_cpu, lock_date, &lock_error);
-				    if (locked == MB_YES && status_report == MB_YES)
-					    {
-					    if (verbose > 0)
-						    fprintf(output,"\tLocked by program <%s> run by <%s> on <%s> at <%s>\n",
-							    lock_program, lock_user, lock_cpu, lock_date);
-					    else
-						    fprintf(output,"\t<Locked>");
-					    }
-				    if (locked == MB_YES && remove_locks == MB_YES)
-					{
-					sprintf(lockfile, "%s.lck", file);
-					fprintf(output, "\tRemoving lock file %s\n", lockfile);
-					sprintf(command, "/bin/rm -f %s", lockfile);
-					shellstatus = system(command);
-					}
-				    }
-
-				if (verbose == 0)
-					fprintf(output, "\n");
-				}
-			    }
-
-			}
-		mb_datalist_close(verbose,&datalist,&error);
-		}
-
-	/* set program status */
-	status = MB_SUCCESS;
-
-	/* output counts */
-	if (verbose > 0)
-	    {
-	    fprintf(output, "\nTotal swath files:         %d\n", nfile);
-	    if (problem_report == MB_YES)
-	    	{
-		fprintf(output, "Total files with problems: %d\n", nproblemfiles);
-		fprintf(output, "Total parameter problems:  %d\n", nparproblemtot);
-		fprintf(output, "Total data problems:       %d\n", ndataproblemtot);
-		}
-	    }
-
-	/* check memory */
-	if (verbose >= 4)
-		status = mb_memory_list(verbose,&error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(output,"\ndbg2  Program <%s> completed\n",
-			program_name);
-		fprintf(output,"dbg2  Ending status:\n");
-		fprintf(output,"dbg2       status:  %d\n",status);
-		}
-
-	/* end it all */
-	exit(error);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/utilities/mbdefaults.c b/src/utilities/mbdefaults.c
deleted file mode 100644
index 0b1680f..0000000
--- a/src/utilities/mbdefaults.c
+++ /dev/null
@@ -1,534 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbdefaults.c	1/23/93
- *	$Id: mbdefaults.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1993-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * MBDEFAULTS sets and retrieves the default MBIO control parameters
- * stored in the file ~/.mbio_defaults.  Only the parameters specified
- * by command line arguments will be changed; if no ~/.mbio_defaults
- * file exists one will be created.
- *
- * Author:	D. W. Caress
- * Date:	January 23, 1993
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_define.h"
-
-/* colortable view mode defines */
-#define	MBV_COLORTABLE_HAXBY		0
-#define	MBV_COLORTABLE_BRIGHT		1
-#define	MBV_COLORTABLE_MUTED		2
-#define	MBV_COLORTABLE_GRAY		3
-#define	MBV_COLORTABLE_FLAT		4
-#define	MBV_COLORTABLE_SEALEVEL1	5
-#define	MBV_COLORTABLE_SEALEVEL2	6
-
-/* colortable view mode defines */
-#define	MBV_COLORTABLE_NORMAL		0
-#define	MBV_COLORTABLE_REVERSED		1
-
-/* shade view mode defines */
-#define	MBV_SHADE_VIEW_NONE		0
-#define	MBV_SHADE_VIEW_ILLUMINATION	1
-#define	MBV_SHADE_VIEW_SLOPE		2
-#define	MBV_SHADE_VIEW_OVERLAY		3
-
-static char rcs_id[]="$Id: mbdefaults.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-
-int main (int argc, char **argv)
-{
-	char program_name[] = "MBDEFAULTS";
-	char help_message[] = "MBDEFAULTS sets and retrieves the /default MBIO control \nparameters stored in the file ~/.mbio_defaults. \nOnly the parameters specified by command line \narguments will be changed; if no ~/.mbio_defaults \nfile exists one will be created.";
-	char usage_message[] = "mbdefaults [-Bfileiobuffer -Dpsdisplay -Ffbtversion -Iimagedisplay -Llonflip\n\t-Mmbviewsettings\n\t-Ttimegap -Wproject -V -H]";
-	extern char *optarg;
-	int	errflg = 0;
-	int	c;
-	int	status;
-	int	error = MB_ERROR_NO_ERROR;
-	int	verbose = 0;
-	int	help = 0;
-	int	flag = 0;
-	FILE	*fp;
-	char	file[MB_PATH_MAXLINE];
-	char	psdisplay[MB_PATH_MAXLINE];
-	char	imgdisplay[MB_PATH_MAXLINE];
-	char	mbproject[MB_PATH_MAXLINE];
-	char	argstring[MB_PATH_MAXLINE];
-	int	fbtversion = 3;
-	int	uselockfiles = 1;
-	int	fileiobuffer = 0;
-	char	*HOME = "HOME";
-	int	primary_colortable;
-	int	primary_colortable_mode;
-	int	primary_shade_mode;
-	int	slope_colortable;
-	int	slope_colortable_mode;
-	int	secondary_colortable;
-	int	secondary_colortable_mode;
-	double	illuminate_magnitude;
-	double	illuminate_elevation;
-	double	illuminate_azimuth;
-	double	slope_magnitude;
-	char	*getenv();
-
-	/* MBIO control parameters */
-	int format;
-	int pings;
-	int lonflip;
-	double bounds[4];
-	int btime_i[7];
-	int etime_i[7];
-	double speedmin;
-	double timegap;
-	
-	int	n;
-
-	/* get current default mbio values */
-	status = mb_defaults(verbose,&format,&pings,&lonflip,bounds,
-		btime_i,etime_i,&speedmin,&timegap);
-
-	/* now get current mb environment values */
-	status = mb_env(verbose,psdisplay,imgdisplay,mbproject);
-
-	/* now get current mbview default display values */
-	status = mb_mbview_defaults(verbose,
-					&primary_colortable,
-					&primary_colortable_mode,
-					&primary_shade_mode,
-					&slope_colortable,
-					&slope_colortable_mode,
-					&secondary_colortable,
-					&secondary_colortable_mode,
-					&illuminate_magnitude,
-					&illuminate_elevation,
-					&illuminate_azimuth,
-					&slope_magnitude);
-
-	/* now get current fbtversion value */
-	status = mb_fbtversion(verbose,&fbtversion);
-
-	/* now get current uselockfiles value */
-	status = mb_uselockfiles(verbose,&uselockfiles);
-
-	/* now get current fileio buffering values */
-	status = mb_fileiobuffer(verbose,&fileiobuffer);
-
-	/* process argument list */
-	while ((c = getopt(argc, argv, "B:b:D:d:F:f:HhI:i:L:l:M:m:T:t:U:u:VvW:w:")) != -1)
-	  switch (c)
-		{
-		case 'B':
-		case 'b':
-			sscanf (optarg,"%d",&fileiobuffer);
-			flag++;
-			break;
-		case 'D':
-		case 'd':
-			sscanf (optarg,"%s",psdisplay);
-			flag++;
-			break;
-		case 'F':
-		case 'f':
-			sscanf (optarg,"%s",argstring);
-			if (strncmp(argstring,"new",3) == 0 || strncmp(argstring,"NEW",3) == 0)
-				fbtversion = 3;
-			else if (strncmp(argstring,"old",2) == 0 || strncmp(argstring,"OLD",2) == 0)
-				fbtversion = 2;
-			else if (strncmp(argstring,"2",1) == 0)
-				fbtversion = 2;
-			else if (strncmp(argstring,"3",1) == 0)
-				fbtversion = 3;
-			flag++;
-			break;
-		case 'I':
-		case 'i':
-			sscanf (optarg,"%s", imgdisplay);
-			flag++;
-			break;
-		case 'H':
-		case 'h':
-			help++;
-			break;
-		case 'L':
-		case 'l':
-			sscanf (optarg,"%d", &lonflip);
-			flag++;
-			break;
-		case 'M':
-		case 'm':
-			/* default primary colortable and modes */
-			if (optarg[0] == 'P' || optarg[0] == 'p')
-				n = sscanf (&optarg[1],"%d/%d/%d", &primary_colortable, &primary_colortable_mode, &primary_shade_mode);
-				
-			/* default slope colortable and mode */
-			else if (optarg[0] == 'G' ||optarg[0] == 'g')
-				n = sscanf (&optarg[1],"%d/%d", &slope_colortable, &slope_colortable_mode);
-				
-			/* default overlay colortable and mode */
-			else if (optarg[0] == 'O' ||optarg[0] == 'o')
-				n = sscanf (&optarg[1],"%d/%d", &secondary_colortable, &secondary_colortable_mode);
-				
-			/* default illumination parameters */
-			else if (optarg[0] == 'I' ||optarg[0] == 'i')
-				n = sscanf (&optarg[1],"%lf/%lf/%lf", &illuminate_magnitude, &illuminate_elevation, &illuminate_azimuth);
-				
-			/* default slope shading magnitude */
-			else if (optarg[0] == 'S' ||optarg[0] == 'S')
-				n = sscanf (&optarg[1],"%lf", &slope_magnitude);
-
-			flag++;
-			break;
-		case 'T':
-		case 't':
-			sscanf (optarg,"%lf", &timegap);
-			flag++;
-			break;
-		case 'U':
-		case 'u':
-			sscanf (optarg,"%s",argstring);
-			if (strncmp(argstring,"yes",3) == 0 || strncmp(argstring,"YES",3) == 0)
-				uselockfiles = 1;
-			else if (strncmp(argstring,"no",2) == 0 || strncmp(argstring,"NO",2) == 0)
-				uselockfiles = 0;
-			else if (strncmp(argstring,"1",1) == 0)
-				uselockfiles = 1;
-			else if (strncmp(argstring,"0",1) == 0)
-				uselockfiles = 0;
-			flag++;
-			break;
-		case 'V':
-		case 'v':
-			verbose++;
-			break;
-		case 'W':
-		case 'w':
-			sscanf (optarg,"%s", mbproject);
-			flag++;
-			break;
-		case '?':
-			errflg++;
-		}
-
-	/* if error flagged then print it and exit */
-	if (errflg)
-		{
-		fprintf(stderr,"usage: %s\n", usage_message);
-		error = MB_ERROR_BAD_USAGE;
-		exit(error);
-		}
-
-	/* print starting message */
-	if (verbose == 1 || help)
-		{
-		fprintf(stderr,"\nProgram %s\n",program_name);
-		fprintf(stderr,"Version %s\n",rcs_id);
-		fprintf(stderr,"MB-system Version %s\n",MB_VERSION);
-		}
-
-	/* print starting debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  Program <%s>\n",program_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Control Parameters:\n");
-		fprintf(stderr,"dbg2       verbose:                    %d\n",verbose);
-		fprintf(stderr,"dbg2       help:                       %d\n",help);
-		fprintf(stderr,"dbg2       format:                     %d\n",format);
-		fprintf(stderr,"dbg2       pings:                      %d\n",pings);
-		fprintf(stderr,"dbg2       lonflip:                    %d\n",lonflip);
-		fprintf(stderr,"dbg2       bounds[0]:                  %f\n",bounds[0]);
-		fprintf(stderr,"dbg2       bounds[1]:                  %f\n",bounds[1]);
-		fprintf(stderr,"dbg2       bounds[2]:                  %f\n",bounds[2]);
-		fprintf(stderr,"dbg2       bounds[3]:                  %f\n",bounds[3]);
-		fprintf(stderr,"dbg2       btime_i[0]:                 %d\n",btime_i[0]);
-		fprintf(stderr,"dbg2       btime_i[1]:                 %d\n",btime_i[1]);
-		fprintf(stderr,"dbg2       btime_i[2]:                 %d\n",btime_i[2]);
-		fprintf(stderr,"dbg2       btime_i[3]:                 %d\n",btime_i[3]);
-		fprintf(stderr,"dbg2       btime_i[4]:                 %d\n",btime_i[4]);
-		fprintf(stderr,"dbg2       btime_i[5]:                 %d\n",btime_i[5]);
-		fprintf(stderr,"dbg2       btime_i[6]:                 %d\n",btime_i[6]);
-		fprintf(stderr,"dbg2       etime_i[0]:                 %d\n",etime_i[0]);
-		fprintf(stderr,"dbg2       etime_i[1]:                 %d\n",etime_i[1]);
-		fprintf(stderr,"dbg2       etime_i[2]:                 %d\n",etime_i[2]);
-		fprintf(stderr,"dbg2       etime_i[3]:                 %d\n",etime_i[3]);
-		fprintf(stderr,"dbg2       etime_i[4]:                 %d\n",etime_i[4]);
-		fprintf(stderr,"dbg2       etime_i[5]:                 %d\n",etime_i[5]);
-		fprintf(stderr,"dbg2       etime_i[6]:                 %d\n",etime_i[6]);
-		fprintf(stderr,"dbg2       speedmin:                   %f\n",speedmin);
-		fprintf(stderr,"dbg2       timegap:                    %f\n",timegap);
-		fprintf(stderr,"dbg2       psdisplay:                  %s\n",psdisplay);
-		fprintf(stderr,"dbg2       imgdisplay:                 %s\n",imgdisplay);
-		fprintf(stderr,"dbg2       mbproject:                  %s\n",mbproject);
-		fprintf(stderr,"dbg2       fbtversion:                 %d\n",fbtversion);
-		fprintf(stderr,"dbg2       uselockfiles:               %d\n",uselockfiles);
-		fprintf(stderr,"dbg2       fileiobuffer:               %d\n",fileiobuffer);
-		fprintf(stderr,"dbg2       primary_colortable:         %d\n",primary_colortable);
-		fprintf(stderr,"dbg2       primary_colortable_mode:    %d\n",primary_colortable_mode);
-		fprintf(stderr,"dbg2       primary_shade_mode:         %d\n",primary_shade_mode);
-		fprintf(stderr,"dbg2       slope_colortable:           %d\n",slope_colortable);
-		fprintf(stderr,"dbg2       slope_colortable_mode:      %d\n",slope_colortable_mode);
-		fprintf(stderr,"dbg2       secondary_colortable:       %d\n",secondary_colortable);
-		fprintf(stderr,"dbg2       secondary_colortable_mode:  %d\n",secondary_colortable_mode);
-		fprintf(stderr,"dbg2       illuminate_magnitude:       %f\n",illuminate_magnitude);
-		fprintf(stderr,"dbg2       illuminate_elevation:       %f\n",illuminate_elevation);
-		fprintf(stderr,"dbg2       illuminate_azimuth:         %f\n",illuminate_azimuth);
-		fprintf(stderr,"dbg2       slope_magnitude:            %f\n",slope_magnitude);
-		}
-
-	/* if help desired then print it and exit */
-	if (help)
-		{
-		fprintf(stderr,"\n%s\n",help_message);
-		fprintf(stderr,"\nusage: %s\n", usage_message);
-		exit(error);
-		}
-
-	/* write out new ~/.mbio_defaults file if needed */
-	if (flag)
-		{
-		strcpy(file,getenv(HOME));
-		strcat(file,"/.mbio_defaults");
-		if ((fp = fopen(file, "w")) == NULL)
-			{
-			fprintf (stderr, "Could not open file %s\n", file);
-			error = MB_ERROR_OPEN_FAIL;
-			exit(error);
-			}
-		fprintf(fp,"MBIO Default Control Parameters\n");
-		fprintf(fp,"lonflip:    %d\n",lonflip);
-		fprintf(fp,"timegap:    %f\n",timegap);
-		fprintf(fp,"ps viewer:  %s\n",psdisplay);
-		fprintf(fp,"img viewer: %s\n",imgdisplay);
-		fprintf(fp,"project:    %s\n",mbproject);
-		fprintf(fp,"fbtversion: %d\n",fbtversion);
-		fprintf(fp,"uselockfiles:%d\n",uselockfiles);
-		fprintf(fp,"fileiobuffer:%d\n",fileiobuffer);
-		fprintf(fp,"mbview_primary_colortable:        %d\n",primary_colortable);
-		fprintf(fp,"mbview_primary_colortable_mode:   %d\n",primary_colortable_mode);
-		fprintf(fp,"mbview_primary_shade_mode:        %d\n",primary_shade_mode);
-		fprintf(fp,"mbview_slope_colortable:          %d\n",slope_colortable);
-		fprintf(fp,"mbview_slope_colortable_mode:     %d\n",slope_colortable_mode);
-		fprintf(fp,"mbview_secondary_colortable:      %d\n",secondary_colortable);
-		fprintf(fp,"mbview_secondary_colortable_mode: %d\n",secondary_colortable_mode);
-		fprintf(fp,"mbview_illuminate_magnitude:      %f\n",illuminate_magnitude);
-		fprintf(fp,"mbview_illuminate_elevation:      %f\n",illuminate_elevation);
-		fprintf(fp,"mbview_illuminate_azimuth:        %f\n",illuminate_azimuth);
-		fprintf(fp,"mbview_slope_magnitude:           %f\n",slope_magnitude);
-		fclose(fp);
-
-		printf("\nNew MBIO Default Control Parameters:\n");
-		printf("lonflip:    %d\n",lonflip);
-		printf("timegap:    %f\n",timegap);
-		printf("ps viewer:  %s\n",psdisplay);
-		printf("img viewer: %s\n",imgdisplay);
-		printf("project:    %s\n",mbproject);
-		if (fbtversion == 2)
-			printf("fbtversion: 2 (old)\n");
-		else if (fbtversion == 3)
-			printf("fbtversion: 3 (new)\n");
-		else
-			printf("fbtversion: %d\n",fbtversion);
-		printf("uselockfiles: %d\n",uselockfiles);
-		if (fileiobuffer == 0)
-			printf("fileiobuffer: %d (use standard fread() & fwrite() buffering)\n",fileiobuffer);
-		else if (fileiobuffer > 0)
-			printf("fileiobuffer: %d (use %d kB buffer for fread() & fwrite())\n",fileiobuffer,fileiobuffer);
-		else
-			printf("fileiobuffer: %d (use mmap for file i/o)\n",fileiobuffer);
-		if (primary_colortable == MBV_COLORTABLE_HAXBY)
-			printf("mbview primary colortable:    %d  (Haxby)\n",primary_colortable);
-		else if (primary_colortable == MBV_COLORTABLE_BRIGHT)
-			printf("mbview primary colortable:    %d  (Bright)\n",primary_colortable);
-		else if (primary_colortable == MBV_COLORTABLE_MUTED)
-			printf("mbview primary colortable:    %d  (Muted)\n",primary_colortable);
-		else if (primary_colortable == MBV_COLORTABLE_GRAY)
-			printf("mbview primary colortable:    %d  (Grayscale)\n",primary_colortable);
-		else if (primary_colortable == MBV_COLORTABLE_FLAT)
-			printf("mbview primary colortable:    %d  (Flat  gray)\n",primary_colortable);
-		else if (primary_colortable == MBV_COLORTABLE_SEALEVEL1)
-			printf("mbview primary colortable:    %d  (Sealevel 1)\n",primary_colortable);
-		else if (primary_colortable == MBV_COLORTABLE_SEALEVEL2)
-			printf("mbview primary colortable:    %d  (Sealevel 2)\n",primary_colortable);
-		if (primary_colortable_mode == MBV_COLORTABLE_NORMAL)
-			printf("mbview primary colortable mode:    %d  (Normal: Cold to Hot)\n",primary_colortable_mode);
-		else
-			printf("mbview primary colortable mode:    %d  (Reversed: Hot to Cold)\n",primary_colortable_mode);
-		if (primary_shade_mode == MBV_SHADE_VIEW_NONE)
-			printf("mbview primary shade mode:    %d  (No shading)\n",primary_shade_mode);
-		else if (primary_shade_mode == MBV_SHADE_VIEW_ILLUMINATION)
-			printf("mbview primary shade mode:    %d  (Shading by illumination)\n",primary_shade_mode);
-		else if (primary_shade_mode == MBV_SHADE_VIEW_SLOPE)
-			printf("mbview primary shade mode:    %d  (Shading by slope magnitude)\n",primary_shade_mode);
-		else if (primary_shade_mode == MBV_SHADE_VIEW_OVERLAY)
-			printf("mbview primary shade mode:    %d  (Shading by overlay)\n",primary_shade_mode);
-
-		if (slope_colortable == MBV_COLORTABLE_HAXBY)
-			printf("mbview slope colortable:    %d  (Haxby)\n",slope_colortable);
-		else if (slope_colortable == MBV_COLORTABLE_BRIGHT)
-			printf("mbview slope colortable:    %d  (Bright)\n",slope_colortable);
-		else if (slope_colortable == MBV_COLORTABLE_MUTED)
-			printf("mbview slope colortable:    %d  (Muted)\n",slope_colortable);
-		else if (slope_colortable == MBV_COLORTABLE_GRAY)
-			printf("mbview slope colortable:    %d  (Grayscale)\n",slope_colortable);
-		else if (slope_colortable == MBV_COLORTABLE_FLAT)
-			printf("mbview slope colortable:    %d  (Flat  gray)\n",slope_colortable);
-		else if (slope_colortable == MBV_COLORTABLE_SEALEVEL1)
-			printf("mbview slope colortable:    %d  (Sealevel 1)\n",slope_colortable);
-		else if (slope_colortable == MBV_COLORTABLE_SEALEVEL2)
-			printf("mbview slope colortable:    %d  (Sealevel 2)\n",slope_colortable);
-		if (slope_colortable_mode == MBV_COLORTABLE_NORMAL)
-			printf("mbview slope colortable mode:    %d  (Normal: Cold to Hot)\n",slope_colortable_mode);
-		else
-			printf("mbview slope colortable mode:    %d  (Reversed: Hot to Cold)\n",slope_colortable_mode);
-
-		if (secondary_colortable == MBV_COLORTABLE_HAXBY)
-			printf("mbview overlay colortable:    %d  (Haxby)\n",secondary_colortable);
-		else if (secondary_colortable == MBV_COLORTABLE_BRIGHT)
-			printf("mbview overlay colortable:    %d  (Bright)\n",secondary_colortable);
-		else if (secondary_colortable == MBV_COLORTABLE_MUTED)
-			printf("mbview overlay colortable:    %d  (Muted)\n",secondary_colortable);
-		else if (secondary_colortable == MBV_COLORTABLE_GRAY)
-			printf("mbview overlay colortable:    %d  (Grayscale)\n",secondary_colortable);
-		else if (secondary_colortable == MBV_COLORTABLE_FLAT)
-			printf("mbview overlay colortable:    %d  (Flat  gray)\n",secondary_colortable);
-		else if (secondary_colortable == MBV_COLORTABLE_SEALEVEL1)
-			printf("mbview overlay colortable:    %d  (Sealevel 1)\n",secondary_colortable);
-		else if (secondary_colortable == MBV_COLORTABLE_SEALEVEL2)
-			printf("mbview overlay colortable:    %d  (Sealevel 2)\n",secondary_colortable);
-		if (secondary_colortable_mode == MBV_COLORTABLE_NORMAL)
-			printf("mbview overlay colortable mode:    %d  (Normal: Cold to Hot)\n",secondary_colortable_mode);
-		else
-			printf("mbview overlay colortable mode:    %d  (Reversed: Hot to Cold)\n",secondary_colortable_mode);
-		printf("mbview illumination magnitude:    %f\n",illuminate_magnitude);
-		printf("mbview illumination elevation:    %f degrees\n",illuminate_elevation);
-		printf("mbview illumination azimuth:      %f degrees\n",illuminate_azimuth);
-		printf("mbview slope magnitude:           %f\n",slope_magnitude);
-		}
-
-	/* else just list the current defaults */
-	else
-		{
-		printf("\nCurrent MBIO Default Control Parameters:\n");
-		printf("lonflip:    %d\n",lonflip);
-		printf("timegap:    %f\n",timegap);
-		printf("ps viewer:  %s\n",psdisplay);
-		printf("img viewer: %s\n",imgdisplay);
-		printf("project:    %s\n",mbproject);
-		if (fbtversion == 2)
-			printf("fbtversion: 2 (old)\n");
-		else if (fbtversion == 3)
-			printf("fbtversion: 3 (new)\n");
-		else
-			printf("fbtversion: %d\n",fbtversion);
-		printf("uselockfiles: %d\n",uselockfiles);
-		if (fileiobuffer == 0)
-			printf("fileiobuffer: %d (use standard fread() & fwrite() buffering)\n",fileiobuffer);
-		else if (fileiobuffer > 0)
-			printf("fileiobuffer: %d (use %d kB buffer for fread() & fwrite())\n",fileiobuffer,fileiobuffer);
-		else
-			printf("fileiobuffer: %d (use mmap for file i/o)\n",fileiobuffer);
-		if (primary_colortable == MBV_COLORTABLE_HAXBY)
-			printf("mbview primary colortable:         %d  (Haxby)\n",primary_colortable);
-		else if (primary_colortable == MBV_COLORTABLE_BRIGHT)
-			printf("mbview primary colortable:         %d  (Bright)\n",primary_colortable);
-		else if (primary_colortable == MBV_COLORTABLE_MUTED)
-			printf("mbview primary colortable:         %d  (Muted)\n",primary_colortable);
-		else if (primary_colortable == MBV_COLORTABLE_GRAY)
-			printf("mbview primary colortable:         %d  (Grayscale)\n",primary_colortable);
-		else if (primary_colortable == MBV_COLORTABLE_FLAT)
-			printf("mbview primary colortable:         %d  (Flat  gray)\n",primary_colortable);
-		else if (primary_colortable == MBV_COLORTABLE_SEALEVEL1)
-			printf("mbview primary colortable:         %d  (Sealevel 1)\n",primary_colortable);
-		else if (primary_colortable == MBV_COLORTABLE_SEALEVEL2)
-			printf("mbview primary colortable:         %d  (Sealevel 2)\n",primary_colortable);
-		if (primary_colortable_mode == MBV_COLORTABLE_NORMAL)
-			printf("mbview primary colortable mode:    %d  (Normal: Cold to Hot)\n",primary_colortable_mode);
-		else
-			printf("mbview primary colortable mode:    %d  (Reversed: Hot to Cold)\n",primary_colortable_mode);
-		if (primary_shade_mode == MBV_SHADE_VIEW_NONE)
-			printf("mbview primary shade mode:         %d  (No shading)\n",primary_shade_mode);
-		else if (primary_shade_mode == MBV_SHADE_VIEW_ILLUMINATION)
-			printf("mbview primary shade mode:         %d  (Shading by illumination)\n",primary_shade_mode);
-		else if (primary_shade_mode == MBV_SHADE_VIEW_SLOPE)
-			printf("mbview primary shade mode:         %d  (Shading by slope magnitude)\n",primary_shade_mode);
-		else if (primary_shade_mode == MBV_SHADE_VIEW_OVERLAY)
-			printf("mbview primary shade mode:         %d  (Shading by overlay)\n",primary_shade_mode);
-
-		if (slope_colortable == MBV_COLORTABLE_HAXBY)
-			printf("mbview slope colortable:           %d  (Haxby)\n",slope_colortable);
-		else if (slope_colortable == MBV_COLORTABLE_BRIGHT)
-			printf("mbview slope colortable:           %d  (Bright)\n",slope_colortable);
-		else if (slope_colortable == MBV_COLORTABLE_MUTED)
-			printf("mbview slope colortable:           %d  (Muted)\n",slope_colortable);
-		else if (slope_colortable == MBV_COLORTABLE_GRAY)
-			printf("mbview slope colortable:           %d  (Grayscale)\n",slope_colortable);
-		else if (slope_colortable == MBV_COLORTABLE_FLAT)
-			printf("mbview slope colortable:           %d  (Flat  gray)\n",slope_colortable);
-		else if (slope_colortable == MBV_COLORTABLE_SEALEVEL1)
-			printf("mbview slope colortable:           %d  (Sealevel 1)\n",slope_colortable);
-		else if (slope_colortable == MBV_COLORTABLE_SEALEVEL2)
-			printf("mbview slope colortable:           %d  (Sealevel 2)\n",slope_colortable);
-		if (slope_colortable_mode == MBV_COLORTABLE_NORMAL)
-			printf("mbview slope colortable mode:      %d  (Normal: Cold to Hot)\n",slope_colortable_mode);
-		else
-			printf("mbview slope colortable mode:      %d  (Reversed: Hot to Cold)\n",slope_colortable_mode);
-
-		if (secondary_colortable == MBV_COLORTABLE_HAXBY)
-			printf("mbview overlay colortable:         %d  (Haxby)\n",secondary_colortable);
-		else if (secondary_colortable == MBV_COLORTABLE_BRIGHT)
-			printf("mbview overlay colortable:         %d  (Bright)\n",secondary_colortable);
-		else if (secondary_colortable == MBV_COLORTABLE_MUTED)
-			printf("mbview overlay colortable:         %d  (Muted)\n",secondary_colortable);
-		else if (secondary_colortable == MBV_COLORTABLE_GRAY)
-			printf("mbview overlay colortable:         %d  (Grayscale)\n",secondary_colortable);
-		else if (secondary_colortable == MBV_COLORTABLE_FLAT)
-			printf("mbview overlay colortable:         %d  (Flat  gray)\n",secondary_colortable);
-		else if (secondary_colortable == MBV_COLORTABLE_SEALEVEL1)
-			printf("mbview overlay colortable:         %d  (Sealevel 1)\n",secondary_colortable);
-		else if (secondary_colortable == MBV_COLORTABLE_SEALEVEL2)
-			printf("mbview overlay colortable:         %d  (Sealevel 2)\n",secondary_colortable);
-		if (secondary_colortable_mode == MBV_COLORTABLE_NORMAL)
-			printf("mbview overlay colortable mode:    %d  (Normal: Cold to Hot)\n",secondary_colortable_mode);
-		else
-			printf("mbview overlay colortable mode:    %d  (Reversed: Hot to Cold)\n",secondary_colortable_mode);
-		printf("mbview illumination magnitude:     %f\n",illuminate_magnitude);
-		printf("mbview illumination elevation:     %f degrees\n",illuminate_elevation);
-		printf("mbview illumination azimuth:       %f degrees\n",illuminate_azimuth);
-		printf("mbview slope magnitude:            %f\n",slope_magnitude);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  Program <%s> completed\n",program_name);
-		fprintf(stderr,"dbg2  Ending status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* end it all */
-	exit(error);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/utilities/mbdumpesf.c b/src/utilities/mbdumpesf.c
deleted file mode 100644
index 6bac55e..0000000
--- a/src/utilities/mbdumpesf.c
+++ /dev/null
@@ -1,403 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbdumpesf.c	3/20/2008
- *    $Id: mbdumpesf.c 2239 2015-05-07 00:51:42Z caress $
- *
- *    Copyright (c) 2008-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbdumpesf reads an MB-System edit save file and dumps the contents
- * as an ascii table to stdout. This is primarily used for debugging
- * bathymetry editing tools such as mbedit and mbeditviz.
- *
- * Author:	D. W. Caress
- * Date:	March 20, 2008
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <stdlib.h>
-#include <getopt.h>
-#include <unistd.h>
-#include <math.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_define.h"
-#include "mb_process.h"
-#include "mb_swap.h"
-
-static char rcs_id[] = "$Id: mbdumpesf.c 2239 2015-05-07 00:51:42Z caress $";
-
-#define OUTPUT_TEXT	0
-#define OUTPUT_ESF	1
-
-/*--------------------------------------------------------------------*/
-
-int main (int argc, char **argv)
-{
-	/* id variables */
-	char program_name[] = "mbdumpesf";
-	char help_message[] =  "mbdumpesf reads an MB-System edit save file and dumps the \ncontents as an ascii table to stdout.";
-	//char usage_message[] = "mbdumpesf [-Iesffile -V -H]";
-	char usage_message[] = "mbdumpesf --input=esffile\n"
-				"\t[--output=esffile --ignore-unflag --ignore-flag \n"
-				"\t--ignore-filter --ignore-zero \n"
-				"\t--verbose --help]";
-
-	/* parsing variables */
-	extern char *optarg;
-	int	option_index;
-	int	errflg = 0;
-	int	c;
-	int	help = 0;
-	int	flag = 0;
-
-	/* MBIO status variables */
-	int	status;
-	int	verbose = 0;
-	int	error = MB_ERROR_NO_ERROR;
-
-	/* command line option definitions */
-	/* mbdumpesf --input=esffile
-	 *		[--output=esffile --ignore-unflag --ignore-flag
-	 *		--ignore-filter --ignore-zero
-	 *		--verbose --help] */
-	static struct option options[] =
-		{
-		{"verbose",			no_argument, 		NULL, 		0},
-		{"help",			no_argument, 		NULL, 		0},
-		{"input",			required_argument, 	NULL, 		0},
-		{"output",			required_argument, 	NULL, 		0},
-		{"ignore-unflag",		no_argument, 		NULL, 		0},
-		{"ignore-flag",			no_argument, 		NULL, 		0},
-		{"ignore-filter",		no_argument, 		NULL, 		0},
-		{"ignore-zero",			no_argument, 		NULL, 		0},
-		{NULL,				0, 			NULL, 		0}
-		};
-
-	/* MBIO read and write control parameters */
-	char	iesffile[MB_PATH_MAXLINE];
-	char	oesffile[MB_PATH_MAXLINE];
-	int	omode = OUTPUT_TEXT;
-	FILE	*iesffp = NULL;
-	FILE	*oesffp = NULL;
-	struct stat file_status;
-	int	fstat;
-	int 	byteswapped;
-	int 	nedit;
-	double	time_d;
-	int	time_i[7];
-	int	beam;
-	int	action;
-	
-	int	ignore;
-	int	ignore_unflag = MB_NO;
-	int	ignore_flag = MB_NO;
-	int	ignore_filter = MB_NO;
-	int	ignore_zero = MB_NO;
-	
-	int	beam_flag = 0;
-	int	beam_unflag = 0;
-	int	beam_zero = 0;
-	int	beam_filter = 0;
-	int	beam_flag_ignore = 0;
-	int	beam_unflag_ignore = 0;
-	int	beam_zero_ignore = 0;
-	int	beam_filter_ignore = 0;
-
-	int	i;
-
-	/* get current default values */
-	byteswapped = mb_swap_check();
-
-	/* process argument list */
-	while ((c = getopt_long(argc, argv, "VvHhI:i:", options, &option_index)) != -1)
-	  switch (c)
-		{
-		/* long options all return c=0 */
-		case 0:
-			/* verbose */
-			if (strcmp("verbose", options[option_index].name) == 0)
-				{
-				verbose++;
-				}
-			
-			/* help */
-			else if (strcmp("help", options[option_index].name) == 0)
-				{
-				help++;
-				}
-				
-			/*-------------------------------------------------------
-			 * Define input and optional output esf file */
-			
-			/* input */
-			else if (strcmp("input", options[option_index].name) == 0)
-				{
-				strcpy(iesffile, optarg);
-				}
-			
-			/* output */
-			else if (strcmp("output", options[option_index].name) == 0)
-				{
-				strcpy(oesffile, optarg);
-				omode = OUTPUT_ESF;
-				}
-				
-			/*-------------------------------------------------------
-			 * Set special modes to ignore types of edit events,
-			 * thereby removing them from the output stream */
-			
-			/* ignore-unflag */
-			else if (strcmp("ignore-unflag", options[option_index].name) == 0)
-				{
-				ignore_unflag = MB_YES;
-				}
-			
-			/* ignore-flag */
-			else if (strcmp("ignore-flag", options[option_index].name) == 0)
-				{
-				ignore_flag = MB_YES;
-				}
-			
-			/* ignore-unflag */
-			else if (strcmp("ignore-filter", options[option_index].name) == 0)
-				{
-				ignore_filter = MB_YES;
-				}
-			
-			/* ignore-unflag */
-			else if (strcmp("ignore-zero", options[option_index].name) == 0)
-				{
-				ignore_zero = MB_YES;
-				}
-				
-			break;
-		case 'H':
-		case 'h':
-			help++;
-			break;
-		case 'V':
-		case 'v':
-			verbose++;
-			break;
-		case 'I':
-		case 'i':
-			sscanf (optarg,"%s", iesffile);
-			flag++;
-			break;
-		case '?':
-			errflg++;
-		}
-
-	/* if error flagged then print it and exit */
-	if (errflg)
-		{
-		fprintf(stderr,"usage: %s\n", usage_message);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		error = MB_ERROR_BAD_USAGE;
-		exit(error);
-		}
-
-	/* if help desired then print it and exit */
-	if (help)
-		{
-		fprintf(stderr,"\n%s\n",help_message);
-		fprintf(stderr,"\nusage: %s\n", usage_message);
-		exit(error);
-		}
-
-	/* print starting message */
-	if (verbose == 1 || help)
-		{
-		fprintf(stderr,"\nProgram %s\n",program_name);
-		fprintf(stderr,"Version %s\n",rcs_id);
-		fprintf(stderr,"MB-system Version %s\n",MB_VERSION);
-		}
-
-	/* print starting debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  Program <%s>\n",program_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Control Parameters:\n");
-		fprintf(stderr,"dbg2       verbose:          %d\n",verbose);
-		fprintf(stderr,"dbg2       help:             %d\n",help);
-		fprintf(stderr,"dbg2       input esf file:   %s\n",iesffile);
-		fprintf(stderr,"dbg2       omode:            %d\n",omode);
-		if (omode == OUTPUT_ESF)
-			fprintf(stderr,"dbg2       output esf file:  %s\n",oesffile);
-		fprintf(stderr,"dbg2       ignore_unflag:    %d\n",ignore_unflag);
-		fprintf(stderr,"dbg2       ignore_flag:      %d\n",ignore_flag);
-		fprintf(stderr,"dbg2       ignore_filter:    %d\n",ignore_filter);
-		fprintf(stderr,"dbg2       ignore_zero:      %d\n",ignore_zero);
-		}
-
-	/* check that esf file exists */
-	fstat = stat(iesffile, &file_status);
-	if (fstat == 0 && (file_status.st_mode & S_IFMT) != S_IFDIR)
-	    	{
-		/* get number of edits */
-		nedit = file_status.st_size / (sizeof(double) + 2 * sizeof(int));
-
-		/* open the input esf file */
-		if ((iesffp = fopen(iesffile, "r")) == NULL)
-			{
-			error = MB_ERROR_OPEN_FAIL;
-			fprintf(stderr,"\nUnable to edit save file <%s> for reading\n",iesffile);
-			fprintf(stderr,"\nProgram <%s> Terminated\n",
-			    program_name);
-			exit(error);
-			}
-
-		/* open the output esf file */
-		if (omode == OUTPUT_ESF
-			&& (oesffp = fopen(oesffile, "w")) == NULL)
-			{
-			error = MB_ERROR_OPEN_FAIL;
-			fprintf(stderr,"\nUnable to edit save file <%s> for reading\n",iesffile);
-			fprintf(stderr,"\nProgram <%s> Terminated\n",
-			    program_name);
-			exit(error);
-			}
-
-		/* loop over reading edit events and printing them out */
-		for (i=0;i<nedit && error == MB_ERROR_NO_ERROR;i++)
-			{
-			if (fread(&(time_d), sizeof(double), 1, iesffp) != 1
-				|| fread(&(beam), sizeof(int), 1, iesffp) != 1
-				|| fread(&(action), sizeof(int), 1, iesffp) != 1)
-				{
-				status = MB_FAILURE;
-				error = MB_ERROR_EOF;
-				}
-			else if (byteswapped == MB_YES)
-				{
-				mb_swap_double(&(time_d));
-				beam = mb_swap_int(beam);
-				action = mb_swap_int(action);
-				}
-			ignore = MB_NO;
-			if (action == MBP_EDIT_FLAG)
-				{
-				beam_flag++;
-				if (ignore_flag == MB_YES)
-					{
-					ignore = MB_YES;
-					beam_flag_ignore++;
-					}
-				}
-			else if (action == MBP_EDIT_UNFLAG)
-				{
-				beam_unflag++;
-				if (ignore_flag == MB_YES)
-					{
-					ignore = MB_YES;
-					beam_unflag_ignore++;
-					}
-				}
-			else if (action == MBP_EDIT_ZERO)
-				{
-				beam_zero++;
-				if (ignore_flag == MB_YES)
-					{
-					ignore = MB_YES;
-					beam_zero_ignore++;
-					}
-				}
-			else if (action == MBP_EDIT_FILTER)
-				{
-				beam_filter++;
-				if (ignore_flag == MB_YES)
-					{
-					ignore = MB_YES;
-					beam_filter_ignore++;
-					}
-				}
-
-			
-			/* write out the edit if not ignored */
-			if (ignore == MB_NO)
-				{
-				if (omode == OUTPUT_TEXT)
-					{
-					mb_get_date(verbose,time_d,time_i);
-					fprintf(stdout,"EDITS READ: i:%d time: %f %4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d beam:%d action:%d\n",
-						i,time_d,time_i[0],time_i[1],time_i[2],
-						time_i[3],time_i[4],time_i[5],time_i[6],
-						beam,action);
-					}
-				else
-					{
-					if (byteswapped == MB_YES)
-						{
-						mb_swap_double(&time_d);
-						beam = mb_swap_int(beam);
-						action = mb_swap_int(action);
-						}
-					if (fwrite(&time_d, sizeof(double), 1, oesffp) != 1)
-						{
-						status = MB_FAILURE;
-						error = MB_ERROR_WRITE_FAIL;
-						}
-					if (status == MB_SUCCESS
-					    && fwrite(&beam, sizeof(int), 1, oesffp) != 1)
-						{
-						status = MB_FAILURE;
-						error = MB_ERROR_WRITE_FAIL;
-						}
-					if (status == MB_SUCCESS
-					    && fwrite(&action, sizeof(int), 1, oesffp) != 1)
-						{
-						status = MB_FAILURE;
-						error = MB_ERROR_WRITE_FAIL;
-						}
-					}
-				}
-			}
-
-		/* close the edit save file */
-		fclose(iesffp);
-		if (omode == OUTPUT_ESF)
-			fclose(oesffp);
-		}
-
-
-	/* give the statistics */
-	if (verbose >= 1)
-		{
-		fprintf(stderr,"\nBeam flag read totals:\n");
-		fprintf(stderr,"\t%d beams flagged manually\n",beam_flag);
-		fprintf(stderr,"\t%d beams unflagged\n",beam_unflag);
-		fprintf(stderr,"\t%d beams zeroed\n",beam_zero);
-		fprintf(stderr,"\t%d beams flagged by filter\n",beam_filter);
-		if (ignore_flag == MB_YES || ignore_unflag == MB_YES
-		    || ignore_zero == MB_YES || ignore_filter == MB_YES)
-			{
-			fprintf(stderr,"\nBeam flag ignore totals:\n");
-			fprintf(stderr,"\t%d beams flagged manually (ignored in output)\n",beam_flag_ignore);
-			fprintf(stderr,"\t%d beams unflagged (ignored in output)\n",beam_unflag_ignore);
-			fprintf(stderr,"\t%d beams zeroed (ignored in output)\n",beam_zero_ignore);
-			fprintf(stderr,"\t%d beams flagged by filter (ignored in output)\n",beam_filter_ignore);
-			}
-		}
-
-	/* end it all */
-	exit(error);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/utilities/mbextractsegy.c b/src/utilities/mbextractsegy.c
deleted file mode 100644
index 547ab4e..0000000
--- a/src/utilities/mbextractsegy.c
+++ /dev/null
@@ -1,1580 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbextractsegy.c	4/18/2004
- *    $Id: mbextractsegy.c 2234 2015-03-05 07:41:54Z caress $
- *
- *    Copyright (c) 2004-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbextractsegy extracts subbottom profiler, center beam reflection,
- * or seismic reflection data from data supported by MB-System and
- * rewrites it as a SEGY file in the form used by SIOSEIS. .
- *
- * Author:	D. W. Caress
- * Date:	April 18, 2004
- *
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <math.h>
-#include <string.h>
-
-/* MBIO include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_define.h"
-#include "mb_segy.h"
-
-/* defines */
-#define MBES_ALLOC_NUM			128
-#define MBES_ROUTE_WAYPOINT_NONE		0
-#define MBES_ROUTE_WAYPOINT_SIMPLE	1
-#define MBES_ROUTE_WAYPOINT_TRANSIT	2
-#define MBES_ROUTE_WAYPOINT_STARTLINE	3
-#define MBES_ROUTE_WAYPOINT_ENDLINE	4
-#define MBES_ONLINE_THRESHOLD		15.0
-#define MBES_ONLINE_COUNT		30
-#define MBES_NUM_PLOT_MAX		50
-#define MBES_MAX_SWEEP			1.0
-
-static char rcs_id[] = "$Id: mbextractsegy.c 2234 2015-03-05 07:41:54Z caress $";
-
-/*--------------------------------------------------------------------*/
-
-int main (int argc, char **argv)
-{
-	char program_name[] = "MBextractsegy";
-	char help_message[] =  "MBextractsegy extracts subbottom profiler, center beam reflection,\nor seismic reflection data from data supported by MB-System and\nrewrites it as a SEGY file in the form used by SIOSEIS.";
-	char usage_message[] = "mbextractsegy [-Byr/mo/dy/hr/mn/sc/us -Eyr/mo/dy/hr/mn/sc/us -Fformat \n\t-Ifile -Jxscale/yscale -Lstartline/lineroot \n\t-Osegyfile -Qtimelistfile -Rroutefile \n\t-Ssampleformat -Zplotmax -H -V]";
-	extern char *optarg;
-	int	errflg = 0;
-	int	c;
-	int	help = 0;
-	int	flag = 0;
-
-	/* MBIO status variables */
-	int	status = MB_SUCCESS;
-	int	verbose = 0;
-	int	error = MB_ERROR_NO_ERROR;
-	char	*message;
-
-	/* MBIO read control parameters */
-	int	read_datalist = MB_NO;
-	mb_path	read_file;
-	mb_path	output_file;
-	mb_path	output_list_file;
-	int	output_file_set = MB_NO;
-	void	*datalist;
-	int	look_processed = MB_DATALIST_LOOK_UNSET;
-	double	file_weight;
-	int	format;
-	int	pings;
-	int	lonflip;
-	double	bounds[4];
-	int	btime_i[7];
-	int	etime_i[7];
-	double	btime_d;
-	double	etime_d;
-	double	speedmin;
-	double	timegap;
-	mb_path	file;
-	int	beams_bath;
-	int	beams_amp;
-	int	pixels_ss;
-	double	timeshift = 0.0;
-
-	/* MBIO read values */
-	void	*mbio_ptr = NULL;
-	void	*store_ptr = NULL;
-	int	kind;
-	int	time_i[7];
-	int	time_j[5];
-	double	time_d;
-	double	navlon;
-	double	navlat;
-	double	speed;
-	double	heading;
-	double	distance;
-	double	altitude;
-	double	sonardepth;
-	char	*beamflag = NULL;
-	double	*bath = NULL;
-	double	*bathacrosstrack = NULL;
-	double	*bathalongtrack = NULL;
-	double	*amp = NULL;
-	double	*ss = NULL;
-	double	*ssacrosstrack = NULL;
-	double	*ssalongtrack = NULL;
-	char	comment[MB_COMMENT_MAXLINE];
-	int	icomment = 0;
-
-	/* segy data */
-	int	sampleformat = MB_SEGY_SAMPLEFORMAT_ENVELOPE;
-	int	samplesize = 0;
-	struct mb_segyasciiheader_struct segyasciiheader;
-	struct mb_segyfileheader_struct segyfileheader;
-	struct mb_segytraceheader_struct segytraceheader;
-	int	segydata_alloc = 0;
-	float	*segydata = NULL;
-	int	buffer_alloc = 0;
-	char	*buffer = NULL;
-
-	/* route and auto-line data */
-	mb_path	timelist_file;
-	int	timelist_file_set = MB_NO;
-	int	ntimepoint = 0;
-	int	ntimepointalloc = 0;
-	double	*routetime_d = NULL;
-	mb_path	route_file;
-	int	route_file_set = MB_NO;
-	int	checkroutebearing = MB_NO;
-	int	rawroutefile = MB_NO;
-	mb_path	lineroot;
-	int	nroutepoint = 0;
-	int	nroutepointalloc = 0;
-	double	lon;
-	double	lat;
-	double	topo;
-	int	waypoint;
-	double	*routelon = NULL;
-	double	*routelat = NULL;
-	double	*routeheading = NULL;
-	int	*routewaypoint = NULL;
-	double	range;
-	double	rangethreshold = 25.0;
-	double	rangelast;
-	int	activewaypoint = 0;
-	int	startline = 1;
-	int	linenumber;
-
-	/* auto plotting */
-	FILE	*sfp = NULL;
-	mb_path	scriptfile;
-	int	recalculatesweep;
-	double	seafloordepthmin = -1.0;
-	double	seafloordepthmax = -1.0;
-	double	seafloordepthminplot[MBES_NUM_PLOT_MAX];
-	double	seafloordepthmaxplot[MBES_NUM_PLOT_MAX];
-	double	sweep;
-	double	delay;
-	double	startlon;
-	double	startlat;
-	int	startshot;
-	double	endlon;
-	double	endlat;
-	int	endshot;
-	double	linedistance;
-	double	linebearing;
-	int	nshot;
-	int	nshotmax;
-	int	nplot = 0;
-	double	xscale = 0.01;
-	double	yscale = 50.0;
-	double	maxwidth = 30.0;
-	mb_path	zbounds;
-	double	zmax = 50;
-
-	mb_path	command;
-	mb_path	scale;
-	double	mtodeglon, mtodeglat;
-	double	lastlon;
-	double	lastlat;
-	double	lastheading;
-	double	headingdiff;
-	double	lastdistance;
-	int	rangeok;
-	int	oktowrite;
-	int	linechange;
-	double	dx, dy;
-	FILE	*fp = NULL;
-	FILE	*cfp = NULL;
-	char	*result;
-	int	nget;
-	int	point_ok;
-	int	read_data;
-	int	nread;
-	int	nwrite;
-	int	first;
-	int	index;
-	double	tracemin, tracemax, tracerms, tracelength;
-	double	linetracemin, linetracemax, linetracelength, endofdata;
-	double	draft, roll, pitch, heave;
-	int	shellstatus;
-	int	i, j;
-
-	/* get current default values */
-	status = mb_defaults(verbose,&format,&pings,&lonflip,bounds,
-		btime_i,etime_i,&speedmin,&timegap);
-
-	/* set default input to datalist.mb-1 */
-	strcpy (read_file, "datalist.mb-1");
-
-	/* set default lineroot to sbp */
-	strcpy (lineroot, "sbp");
-
-	/* initialize output segy structures */
-	for (j=0;j<40;j++)
-		for (i=0;i<80;i++)
-			segyasciiheader.line[j][i] = 0;
-	segyfileheader.jobid = 0;
-	segyfileheader.line = 0;
-	segyfileheader.reel = 0;
-	segyfileheader.channels = 0;
-	segyfileheader.aux_channels = 0;
-	segyfileheader.sample_interval = 0;
-	segyfileheader.sample_interval_org = 0;
-	segyfileheader.number_samples = 0;
-	segyfileheader.number_samples_org = 0;
-	segyfileheader.format = 5;
-	segyfileheader.cdp_fold = 0;
-	segyfileheader.trace_sort = 0;
-	segyfileheader.vertical_sum = 0;
-	segyfileheader.sweep_start = 0;
-	segyfileheader.sweep_end = 0;
-	segyfileheader.sweep_length = 0;
-	segyfileheader.sweep_type = 0;
-	segyfileheader.sweep_trace = 0;
-	segyfileheader.sweep_taper_start = 0;
-	segyfileheader.sweep_taper_end = 0;
-	segyfileheader.sweep_taper = 0;
-	segyfileheader.correlated = 0;
-	segyfileheader.binary_gain = 0;
-	segyfileheader.amplitude = 0;
-	segyfileheader.units = 0;
-	segyfileheader.impulse_polarity = 0;
-	segyfileheader.domain = 0;
-	for (i=0;i<338;i++)
-		segyfileheader.extra[i] = 0;
-
-	/* process argument list */
-	while ((c = getopt(argc, argv, "B:b:D:d:E:e:F:f:I:i:J:j:L:l:MmO:o:Q:q:R:r:S:s:T:t:U:u:Z:z:VvHh")) != -1)
-	  switch (c)
-		{
-		case 'H':
-		case 'h':
-			help++;
-			break;
-		case 'V':
-		case 'v':
-			verbose++;
-			break;
-		case 'B':
-		case 'b':
-			sscanf (optarg,"%d/%d/%d/%d/%d/%d",
-				&btime_i[0],&btime_i[1],&btime_i[2],
-				&btime_i[3],&btime_i[4],&btime_i[5]);
-			btime_i[6] = 0;
-			flag++;
-			break;
-		case 'E':
-		case 'e':
-			sscanf (optarg,"%d/%d/%d/%d/%d/%d",
-				&etime_i[0],&etime_i[1],&etime_i[2],
-				&etime_i[3],&etime_i[4],&etime_i[5]);
-			etime_i[6] = 0;
-			flag++;
-			break;
-		case 'F':
-		case 'f':
-			sscanf (optarg,"%d", &format);
-			flag++;
-			break;
-		case 'I':
-		case 'i':
-			sscanf (optarg,"%s", read_file);
-			flag++;
-			break;
-		case 'J':
-		case 'j':
-			sscanf (optarg,"%lf/%lf/%lf", &xscale, &yscale, &maxwidth);
-			flag++;
-			break;
-		case 'L':
-		case 'l':
-			sscanf (optarg,"%d/%s", &startline, lineroot);
-			flag++;
-			break;
-		case 'M':
-		case 'm':
-			checkroutebearing = MB_YES;
-			flag++;
-			break;
-		case 'O':
-		case 'o':
-			sscanf (optarg,"%s", output_file);
-			output_file_set = MB_YES;
-			flag++;
-			break;
-		case 'Q':
-		case 'q':
-			sscanf (optarg,"%s", timelist_file);
-			timelist_file_set = MB_YES;
-			flag++;
-			break;
-		case 'R':
-		case 'r':
-			sscanf (optarg,"%s", route_file);
-			route_file_set = MB_YES;
-			flag++;
-			break;
-		case 'S':
-		case 's':
-			sscanf (optarg,"%d", &sampleformat);
-			flag++;
-			break;
-		case 'T':
-		case 't':
-			sscanf (optarg,"%lf", &timeshift);
-			flag++;
-			break;
-		case 'U':
-		case 'u':
-			sscanf (optarg,"%lf", &rangethreshold);
-			flag++;
-			break;
-		case 'Z':
-		case 'z':
-			sscanf (optarg,"%lf", &zmax);
-			flag++;
-			break;
-		case '?':
-			errflg++;
-		}
-
-	/* if error flagged then print it and exit */
-	if (errflg)
-		{
-		fprintf(stderr,"usage: %s\n", usage_message);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		error = MB_ERROR_BAD_USAGE;
-		exit(error);
-		}
-
-	/* print starting message */
-	if (verbose == 1 || help)
-		{
-		fprintf(stderr,"\nProgram %s\n",program_name);
-		fprintf(stderr,"Version %s\n",rcs_id);
-		fprintf(stderr,"MB-system Version %s\n",MB_VERSION);
-		}
-
-	/* print starting debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  Program <%s>\n",program_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Control Parameters:\n");
-		fprintf(stderr,"dbg2       verbose:           %d\n",verbose);
-		fprintf(stderr,"dbg2       help:              %d\n",help);
-		fprintf(stderr,"dbg2       format:            %d\n",format);
-		fprintf(stderr,"dbg2       pings:             %d\n",pings);
-		fprintf(stderr,"dbg2       lonflip:           %d\n",lonflip);
-		fprintf(stderr,"dbg2       bounds[0]:         %f\n",bounds[0]);
-		fprintf(stderr,"dbg2       bounds[1]:         %f\n",bounds[1]);
-		fprintf(stderr,"dbg2       bounds[2]:         %f\n",bounds[2]);
-		fprintf(stderr,"dbg2       bounds[3]:         %f\n",bounds[3]);
-		fprintf(stderr,"dbg2       btime_i[0]:        %d\n",btime_i[0]);
-		fprintf(stderr,"dbg2       btime_i[1]:        %d\n",btime_i[1]);
-		fprintf(stderr,"dbg2       btime_i[2]:        %d\n",btime_i[2]);
-		fprintf(stderr,"dbg2       btime_i[3]:        %d\n",btime_i[3]);
-		fprintf(stderr,"dbg2       btime_i[4]:        %d\n",btime_i[4]);
-		fprintf(stderr,"dbg2       btime_i[5]:        %d\n",btime_i[5]);
-		fprintf(stderr,"dbg2       btime_i[6]:        %d\n",btime_i[6]);
-		fprintf(stderr,"dbg2       etime_i[0]:        %d\n",etime_i[0]);
-		fprintf(stderr,"dbg2       etime_i[1]:        %d\n",etime_i[1]);
-		fprintf(stderr,"dbg2       etime_i[2]:        %d\n",etime_i[2]);
-		fprintf(stderr,"dbg2       etime_i[3]:        %d\n",etime_i[3]);
-		fprintf(stderr,"dbg2       etime_i[4]:        %d\n",etime_i[4]);
-		fprintf(stderr,"dbg2       etime_i[5]:        %d\n",etime_i[5]);
-		fprintf(stderr,"dbg2       etime_i[6]:        %d\n",etime_i[6]);
-		fprintf(stderr,"dbg2       speedmin:          %f\n",speedmin);
-		fprintf(stderr,"dbg2       timegap:           %f\n",timegap);
-		fprintf(stderr,"dbg2       sampleformat:      %d\n",sampleformat);
-		fprintf(stderr,"dbg2       timeshift:         %f\n",timeshift);
-		fprintf(stderr,"dbg2       file:              %s\n",file);
-		fprintf(stderr,"dbg2       timelist_file_set: %d\n",timelist_file_set);
-		fprintf(stderr,"dbg2       timelist_file:     %s\n",timelist_file);
-		fprintf(stderr,"dbg2       route_file_set:    %d\n",route_file_set);
-		fprintf(stderr,"dbg2       route_file:        %s\n",route_file);
-		fprintf(stderr,"dbg2       checkroutebearing: %d\n",checkroutebearing);
-		fprintf(stderr,"dbg2       output_file_set:   %d\n",output_file_set);
-		fprintf(stderr,"dbg2       output_file:       %s\n",output_file);
-		fprintf(stderr,"dbg2       lineroot:          %s\n",lineroot);
-		fprintf(stderr,"dbg2       xscale:            %f\n",xscale);
-		fprintf(stderr,"dbg2       yscale:            %f\n",yscale);
-		fprintf(stderr,"dbg2       maxwidth:          %f\n",maxwidth);
-		fprintf(stderr,"dbg2       rangethreshold:    %f\n",rangethreshold);
-		}
-
-	/* if help desired then print it and exit */
-	if (help)
-		{
-		fprintf(stderr,"\n%s\n",help_message);
-		fprintf(stderr,"\nusage: %s\n", usage_message);
-		exit(error);
-		}
-
-	/* set starting line number */
-	linenumber = startline;
-
-	/* set maximum number of shots per plot */
-	nshotmax = (int)(maxwidth / xscale);
-
-	/* if specified read route time list file */
-	if (timelist_file_set == MB_YES)
-		{
-		/* open the input file */
-		if ((fp = fopen(timelist_file, "r")) == NULL)
-			{
-			error = MB_ERROR_OPEN_FAIL;
-			status = MB_FAILURE;
-			fprintf(stderr,"\nUnable to open time list file <%s> for reading\n",timelist_file);
-			exit(status);
-			}
-		rawroutefile = MB_NO;
-		while ((result = fgets(comment,MB_PATH_MAXLINE,fp)) == comment)
-		    	{
-			if (comment[0] != '#')
-				{
-				nget = sscanf(comment,"%d %d %lf %lf %lf %lf",
-				    &i, &waypoint, &lon, &lat, &heading, &time_d);
-
-				/* if good data check for need to allocate more space */
-				if (ntimepoint + 1 > ntimepointalloc)
-				    	{
-				    	ntimepointalloc += MBES_ALLOC_NUM;
-					status = mb_reallocd(verbose, __FILE__, __LINE__, ntimepointalloc * sizeof(double),
-								(void **)&routelon, &error);
-					status = mb_reallocd(verbose, __FILE__, __LINE__, ntimepointalloc * sizeof(double),
-								(void **)&routelat, &error);
-					status = mb_reallocd(verbose, __FILE__, __LINE__, ntimepointalloc * sizeof(double),
-								(void **)&routeheading, &error);
-					status = mb_reallocd(verbose, __FILE__, __LINE__, ntimepointalloc * sizeof(int),
-								(void **)&routewaypoint, &error);
-					status = mb_reallocd(verbose, __FILE__, __LINE__, ntimepointalloc * sizeof(double),
-								(void **)&routetime_d, &error);
-				    	if (status != MB_SUCCESS)
-					    	{
-						mb_error(verbose,error,&message);
-						fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",
-							message);
-						fprintf(stderr,"\nProgram <%s> Terminated\n",
-							program_name);
-						exit(error);
-					    	}
-				    	}
-
-				/* add good point to route */
-				if (ntimepointalloc > ntimepoint)
-					{
-					routewaypoint[ntimepoint] = waypoint;
-					routelon[ntimepoint] = lon;
-					routelat[ntimepoint] = lat;
-					routeheading[ntimepoint] = heading;
-					routetime_d[ntimepoint] = time_d;
-					ntimepoint++;
-					}
-				}
-			}
-
-		/* close the file */
-		fclose(fp);
-		fp = NULL;
-
-		/* set starting values */
-		activewaypoint = 0;
-		mb_coor_scale(verbose,routelat[activewaypoint], &mtodeglon, &mtodeglat);
-		rangelast = 1000 * rangethreshold;
-		seafloordepthmin = -1.0;
-		seafloordepthmax = -1.0;
-		nplot = 0;
-		for (i=0;i<MBES_NUM_PLOT_MAX;i++)
-			{
-			seafloordepthminplot[i] = -1;
-			seafloordepthmaxplot[i] = -1;
-			}
-		oktowrite = 0;
-		rangeok = MB_NO;
-
-		/* output status */
-		if (verbose > 0)
-			{
-			/* output info on file output */
-			fprintf(stderr,"Read %d waypoints from time list file: %s\n",
-				ntimepoint, timelist_file);
-			}
-		}
-
-	/* if specified read route file */
-	else if (route_file_set == MB_YES)
-		{
-		/* open the input file */
-		if ((fp = fopen(route_file, "r")) == NULL)
-			{
-			error = MB_ERROR_OPEN_FAIL;
-			status = MB_FAILURE;
-			fprintf(stderr,"\nUnable to open route file <%s> for reading\n",route_file);
-			exit(status);
-			}
-		rawroutefile = MB_NO;
-		while ((result = fgets(comment,MB_PATH_MAXLINE,fp)) == comment)
-		    	{
-			if (comment[0] == '#')
-				{
-				if (strncmp(comment,"## Route File Version", 21) == 0)
-					{
-					rawroutefile = MB_NO;
-					}
-				}
-			else
-				{
-				nget = sscanf(comment,"%lf %lf %lf %d %lf",
-				    &lon, &lat, &topo, &waypoint, &heading);
-				if (comment[0] == '#')
-					{
-					fprintf(stderr,"buffer:%s",comment);
-					if (strncmp(comment,"## Route File Version", 21) == 0)
-						{
-						rawroutefile = MB_NO;
-						}
-					}
-		    		if ((rawroutefile == MB_YES && nget >= 2)
-					|| (rawroutefile == MB_NO && nget >= 3 && waypoint > MBES_ROUTE_WAYPOINT_NONE))
-					point_ok = MB_YES;
-				else
-					point_ok = MB_NO;
-
-				/* if good data check for need to allocate more space */
-				if (point_ok == MB_YES
-					&& nroutepoint + 1 > nroutepointalloc)
-				    	{
-				    	nroutepointalloc += MBES_ALLOC_NUM;
-					status = mb_reallocd(verbose, __FILE__, __LINE__, nroutepointalloc * sizeof(double),
-								(void **)&routelon, &error);
-					status = mb_reallocd(verbose, __FILE__, __LINE__, nroutepointalloc * sizeof(double),
-								(void **)&routelat, &error);
-					status = mb_reallocd(verbose, __FILE__, __LINE__, nroutepointalloc * sizeof(double),
-								(void **)&routeheading, &error);
-					status = mb_reallocd(verbose, __FILE__, __LINE__, nroutepointalloc * sizeof(int),
-								(void **)&routewaypoint, &error);
-				    	if (status != MB_SUCCESS)
-					    	{
-						mb_error(verbose,error,&message);
-						fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",
-							message);
-						fprintf(stderr,"\nProgram <%s> Terminated\n",
-							program_name);
-						exit(error);
-					    	}
-				    	}
-
-				/* add good point to route */
-				if (point_ok == MB_YES && nroutepointalloc > nroutepoint + 1)
-					{
-					routelon[nroutepoint] = lon;
-					routelat[nroutepoint] = lat;
-					routeheading[nroutepoint] = heading;
-					routewaypoint[nroutepoint] = waypoint;
-					nroutepoint++;
-					}
-				}
-			}
-
-		/* close the file */
-		fclose(fp);
-		fp = NULL;
-
-		/* set starting values */
-		activewaypoint = 1;
-		mb_coor_scale(verbose,routelat[activewaypoint], &mtodeglon, &mtodeglat);
-		rangelast = 1000 * rangethreshold;
-		seafloordepthmin = -1.0;
-		seafloordepthmax = -1.0;
-		nplot = 0;
-		for (i=0;i<MBES_NUM_PLOT_MAX;i++)
-			{
-			seafloordepthminplot[i] = -1;
-			seafloordepthmaxplot[i] = -1;
-			}
-		oktowrite = 0;
-		rangeok = MB_NO;
-
-		/* output status */
-		if (verbose > 0)
-			{
-			/* output info on file output */
-			fprintf(stderr,"Read %d waypoints from route file: %s\n",
-				nroutepoint, route_file);
-			}
-		}
-
-	/* get format if required */
-	if (format == 0)
-		mb_get_format(verbose,read_file,NULL,&format,&error);
-
-	/* get sample size from sampleformat */
-	if (sampleformat == MB_SEGY_SAMPLEFORMAT_ANALYTIC)
-		samplesize = 2 * sizeof(float);
-	else
-		samplesize = sizeof(float);
-
-	/* get plot zbounds from sampleformat */
-	if (sampleformat == MB_SEGY_SAMPLEFORMAT_ENVELOPE)
-		sprintf(zbounds, "0/%f/1", zmax);
-	else
-		sprintf(zbounds, "-%f/%f", zmax, zmax);
-
-	/* determine whether to read one file or a list of files */
-	if (format < 0)
-		read_datalist = MB_YES;
-
-	/* open file list */
-	if (read_datalist == MB_YES)
-	    {
-	    if ((status = mb_datalist_open(verbose,&datalist,
-					    read_file,look_processed,&error)) != MB_SUCCESS)
-		{
-		error = MB_ERROR_OPEN_FAIL;
-		fprintf(stderr,"\nUnable to open data list file: %s\n",
-			read_file);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-	    if ((status = mb_datalist_read(verbose,datalist,
-			    file,&format,&file_weight,&error))
-			    == MB_SUCCESS)
-		read_data = MB_YES;
-	    else
-		read_data = MB_NO;
-	    }
-	/* else copy single filename to be read */
-	else
-	    {
-	    strcpy(file, read_file);
-	    read_data = MB_YES;
-	    }
-
-	/* set up plotting script file */
-	if ((route_file_set == MB_YES && nroutepoint > 1) ||
-		(timelist_file_set == MB_YES && ntimepoint > 1))
-		{
-		sprintf(scriptfile, "%s_section.cmd", lineroot);
-		}
-	else if (output_file_set == MB_NO || read_datalist == MB_YES)
-		{
-		sprintf(scriptfile, "%s_section.cmd", read_file);
-		}
-	else
-		{
-		sprintf(scriptfile, "%s_section.cmd", file);
-		}
-	if ((sfp = fopen(scriptfile, "w")) == NULL)
-		{
-		error = MB_ERROR_OPEN_FAIL;
-		status = MB_FAILURE;
-		fprintf(stderr,"\nUnable to open plotting script file <%s> \n",scriptfile);
-		exit(status);
-		}
-
-	/* loop over all files to be read */
-	while (read_data == MB_YES)
-	{
-
-	/* initialize reading the swath file */
-	if ((status = mb_read_init(
-		verbose,file,format,pings,lonflip,bounds,
-		btime_i,etime_i,speedmin,timegap,
-		&mbio_ptr,&btime_d,&etime_d,
-		&beams_bath,&beams_amp,&pixels_ss,&error)) != MB_SUCCESS)
-		{
-		mb_error(verbose,error,&message);
-		fprintf(stderr,"\nMBIO Error returned from function <mb_read_init>:\n%s\n",message);
-		fprintf(stderr,"\nMultibeam File <%s> not initialized for reading\n",file);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-
-	/* allocate memory for data arrays */
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(char), (void **)&beamflag, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(double), (void **)&bath, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_AMPLITUDE,
-						sizeof(double), (void **)&amp, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(double), (void **)&bathacrosstrack, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(double), (void **)&bathalongtrack, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_SIDESCAN,
-						sizeof(double), (void **)&ss, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_SIDESCAN,
-						sizeof(double), (void **)&ssacrosstrack, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_SIDESCAN,
-						sizeof(double), (void **)&ssalongtrack, &error);
-
-	/* if error initializing memory then quit */
-	if (error != MB_ERROR_NO_ERROR)
-		{
-		mb_error(verbose,error,&message);
-		fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",
-			message);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-
-	/* read and print data */
-	nread = 0;
-	first = MB_YES;
-	lastlon = 0.0;
-	lastlat = 0.0;
-	lastheading = 0.0;
-	lastdistance = 0.0;
-	while (error <= MB_ERROR_NO_ERROR)
-		{
-		/* reset error */
-		error = MB_ERROR_NO_ERROR;
-
-		/* read next data record */
-		status = mb_get_all(verbose,mbio_ptr,&store_ptr,&kind,
-				    time_i,&time_d,&navlon,&navlat,
-				    &speed,&heading,
-				    &distance,&altitude,&sonardepth,
-				    &beams_bath,&beams_amp,&pixels_ss,
-				    beamflag,bath,amp,bathacrosstrack,bathalongtrack,
-				    ss,ssacrosstrack,ssalongtrack,
-				    comment,&error);
-		
-		/* ignore nonfatal errors */
-		if (error < 0)
-			{
-			error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-
-		/* deal with nav and time from survey data only - not nav, sidescan, or subbottom */
-		if (error <= MB_ERROR_NO_ERROR && kind == MB_DATA_DATA)
-			{
-			/* reset output flag */
-			linechange = MB_NO;
-
-			/* get nav data */
-			status = mb_extract_nav(verbose,mbio_ptr,store_ptr,&kind,
-					time_i,&time_d,&navlon,&navlat,
-					&speed,&heading,&draft,&roll,&pitch,&heave,&error);
-
-			/* save last nav and heading */
-			if (navlon != 0.0)
-				lastlon = navlon;
-			if (navlat != 0.0)
-				lastlat = navlat;
-			if (heading != 0.0)
-				lastheading = heading;
-			if (distance != 0.0)
-				lastdistance = distance;
-
-			/* to set lines check survey data time against time list */
-			if (ntimepoint > 1)
-				{
-				dx = (navlon - routelon[activewaypoint]) / mtodeglon;
-				dy = (navlat - routelat[activewaypoint]) / mtodeglat;
-				range = sqrt(dx * dx + dy * dy);
-				if (time_d >= routetime_d[activewaypoint]
-					&& activewaypoint < ntimepoint)
-					{
-					linechange = MB_YES;
-/* fprintf(stderr,"LINECHANGE 1!! dx:%f dy:%f range:%f activewaypoint:%d time_d: %f %f\n",
-dx,dy,range,activewaypoint,time_d,routetime_d[activewaypoint]); */
-					}
-				}
-
-			/* else to set lines check survey data position against waypoints */
-			else if (nroutepoint > 1 && navlon != 0.0 && navlat != 0.0)
-				{
-				dx = (navlon - routelon[activewaypoint]) / mtodeglon;
-				dy = (navlat - routelat[activewaypoint]) / mtodeglat;
-				range = sqrt(dx * dx + dy * dy);
-				if (range < rangethreshold)
-					rangeok = MB_YES;
-				if (rangeok == MB_YES
-					&& (activewaypoint == 0 || range > rangelast)
-					&& activewaypoint < nroutepoint - 1)
-					{
-					linechange = MB_YES;
-/* fprintf(stderr,"LINECHANGE 2!! dx:%f dy:%f range:%f %f activewaypoint:%d\n",dx,dy,range,rangethreshold,activewaypoint); */
-					}
-				}
-
-			/* apply line change */
-			if (linechange == MB_YES)
-				{
-				/* close current output file */
-				if (fp != NULL)
-				    {
-				    fclose(fp);
-				    fp = NULL;
-				    fclose(cfp);
-				    cfp = NULL;
-
-				    /* output count of segy records */
-				    fprintf(stderr,"%d records output to segy file %s\n",
-							nwrite, output_file);
-				    if (verbose > 0)
-					fprintf(stderr,"\n");
-
-				    /* use mbsegyinfo to generate a sinf file */
-				    sprintf(command, "mbsegyinfo -I %s -O", output_file);
-		   		    fprintf(stderr, "Executing: %s\n", command);
-				    shellstatus = system(command);
-
-				    /* get bearing and plot scale */
-				    dx = (endlon - startlon) / mtodeglon;
-				    dy = (endlat - startlat) / mtodeglat;
-				    linedistance = sqrt(dx * dx + dy * dy);
-				    linebearing = RTD * atan2(dx, dy);
-				    if (linebearing < 0.0)
-		    			linebearing += 360.0;
-				    if (linebearing >= 45.0 && linebearing <= 225.0)
-				        sprintf(scale, "-Jx%f/%f", xscale, yscale);
-				    else
-				        sprintf(scale, "-Jx-%f/%f", xscale, yscale);
-
-				    /* output commands to first cut plotting script file */
-				    /* The maximum useful plot length is about nshotmax shots, so
-		    			we break longer files up into multiple plots */
-				    nshot = endshot - startshot + 1;
-				    nplot = nwrite / nshotmax;
-				    if (nwrite % nshotmax > 0)
-		    			nplot++;
-//fprintf(stderr,"nwrite:%d nshotmax:%d nplot:%d\n",nwrite,nshotmax,nplot);
-				    /* calculate sweep needed for all of the data in the line - if this is more than 1.0 seconds,
-				      then make section plots using only the sweep needed for each section alone */
-				    delay = seafloordepthmin / 750.0;
-				    delay = ((int)(delay / 0.05)) * 0.05;
-				    endofdata = seafloordepthmax / 750.0 + linetracelength;
-				    endofdata = (1 + (int)(endofdata / 0.05)) * 0.05;
-				    sweep = endofdata - delay;
-				    if (sweep > MBES_MAX_SWEEP)
-				        recalculatesweep = MB_YES;
-				    else
-				        recalculatesweep = MB_NO;
-
-				    fprintf(sfp, "# Generate %d section plot(s) of segy file: %s\n", nplot, output_file);
-				    fprintf(sfp, "#   Section Start Position: %.6f %.6f\n", startlon, startlat);
-				    fprintf(sfp, "#   Section End Position:   %.6f %.6f\n", endlon, endlat);
-				    fprintf(sfp, "#   Section length: %f km\n", linedistance);
-				    fprintf(sfp, "#   Section bearing: %f degrees\n", linebearing);
-				    fprintf(stderr, "# Generate %d section plot(s) of segy file: %s\n", nplot, output_file);
-				    fprintf(stderr, "#   Section Start Position: %.6f %.6f\n", startlon, startlat);
-				    fprintf(stderr, "#   Section End Position:   %.6f %.6f\n", endlon, endlat);
-				    fprintf(stderr, "#   Section length: %f km\n", linedistance);
-				    fprintf(stderr, "#   Section bearing: %f degrees\n", linebearing);
-				    for (i=0;i<nplot;i++)
-		    			{
-					if (recalculatesweep == MB_YES)
-						{
-						seafloordepthmin = seafloordepthminplot[i];
-						seafloordepthmax = seafloordepthmaxplot[i];
-						delay = seafloordepthmin / 750.0;
-						delay = ((int)(delay / 0.05)) * 0.05;
-						endofdata = seafloordepthmax / 750.0 + linetracelength;
-						endofdata = (1 + (int)(endofdata / 0.05)) * 0.05;
-						sweep = endofdata - delay;
-						}
-
-		        		sprintf(command, "#   Section plot %d of %d\n", i + 1, nplot);
-					fprintf(stderr, "%s", command);
-					fprintf(sfp, "%s", command);
-					sprintf(command, "#     Seafloor depth min: %f (m) %f (s)  max: %f (m) %f (s)\n",
-						seafloordepthmin, seafloordepthmin / 750.0, seafloordepthmax, seafloordepthmax / 750.0);
-					fprintf(stderr, "%s", command);
-					fprintf(sfp, "%s", command);
-					sprintf(command, "#     Trace length: %f (s)\n", linetracelength);
-					fprintf(stderr, "%s", command);
-					fprintf(sfp, "%s", command);
-					sprintf(command, "#     Trace delay: %f (s)\n", delay);
-					fprintf(stderr, "%s", command);
-					fprintf(sfp, "%s", command);
-					sprintf(command, "#     Trace sweep: %f (s)\n", sweep);
-					fprintf(stderr, "%s", command);
-					fprintf(sfp, "%s", command);
-
-					sprintf(command, "mbsegygrid -I %s \\\n\t-S0/%d/%d -T%.2f/%.2f \\\n\t-O %s_%4.4d_%2.2d_section\n",
-							output_file, (startshot + i * nshotmax),
-							MIN((startshot  + (i + 1) * nshotmax - 1), endshot),
-							sweep, delay, lineroot, linenumber, i + 1);
-					fprintf(stderr, "%s", command);
-					fprintf(sfp, "%s", command);
-
-					sprintf(command, "mbm_grdplot -I %s_%4.4d_%2.2d_section.grd \\\n\t%s -Z%s \\\n\t-Ba250/a0.05g0.05 -G1 -W1/4 -D -V \\\n\t-O %s_%4.4d_%2.2d_sectionplot \\\n\t-L\"%s Line %d Plot %d of %d\"\n",
-							lineroot, linenumber, i + 1, scale, zbounds,
-							lineroot, linenumber, i + 1, lineroot, linenumber,
-							i + 1, nplot);
-					fprintf(stderr, "%s", command);
-					fprintf(sfp, "%s", command);
-
-					sprintf(command, "%s_%4.4d_%2.2d_sectionplot.cmd $1\n\n",
-							lineroot, linenumber, i + 1);
-					fprintf(stderr, "%s", command);
-					fprintf(sfp, "%s", command);
-
-					sprintf(command, "convert -density 100 %s_%4.4d_%2.2d_sectionplot.ps -trim -quality 75 %s_%4.4d_%2.2d_sectionplot.jpg\n\n",
-							lineroot, linenumber, i + 1, lineroot, linenumber, i + 1);
-					fprintf(stderr, "%s", command);
-					fprintf(sfp, "%s", command);
-					fflush(sfp);
-					}
-				    }
-
-				/* increment line number */
-				if (activewaypoint > 0)
-					linenumber++;
-
-				/* increment active waypoint */
-				activewaypoint++;
-				}
-
-			if (linechange == MB_YES)
-				{
-				mb_coor_scale(verbose,routelat[activewaypoint], &mtodeglon, &mtodeglat);
-				rangelast = 1000 * rangethreshold;
-				seafloordepthmin = -1.0;
-				seafloordepthmax = -1.0;
-				nplot = 0;
-				for (i=0;i<MBES_NUM_PLOT_MAX;i++)
-					{
-					seafloordepthminplot[i] = -1;
-					seafloordepthmaxplot[i] = -1;
-					}
-				oktowrite = 0;
-				rangeok = MB_NO;
-				}
-			else
-				rangelast = range;
-			if (verbose > 0 && nroutepoint > 0)
-				fprintf(stderr,"> activewaypoint:%d linenumber:%d time_d:%f range:%f   lon: %f %f   lat: %f %f oktowrite:%d rangeok:%d kind:%d\n",
-					activewaypoint, linenumber, time_d, range, navlon,
-					routelon[activewaypoint], navlat, routelat[activewaypoint],
-					oktowrite, rangeok, kind);
-			}
-
-		/* if desired extract subbottom data */
-		if (error == MB_ERROR_NO_ERROR
-			&& (kind  == MB_DATA_SUBBOTTOM_MCS
-				|| kind == MB_DATA_SUBBOTTOM_CNTRBEAM
-				|| kind == MB_DATA_SUBBOTTOM_SUBBOTTOM))
-		    {
-		    /* extract the header */
-		    status = mb_extract_segytraceheader(verbose,mbio_ptr,store_ptr,&kind,
-				    (void *)&segytraceheader,&error);
-
-		    /* allocate the required memory */
-		    if (status == MB_SUCCESS
-		    	&& segytraceheader.nsamps > segydata_alloc)
-			{
-			status = mb_mallocd(verbose, __FILE__, __LINE__, segytraceheader.nsamps * samplesize,
-						(void **)&segydata, &error);
-			if (status == MB_SUCCESS)
-				segydata_alloc = segytraceheader.nsamps;
-			else
-				segydata_alloc = 0;
-			}
-		    if (status == MB_SUCCESS
-		    	&& (buffer_alloc < MB_SEGY_TRACEHEADER_LENGTH
-				|| buffer_alloc < segytraceheader.nsamps * samplesize))
-			{
-			buffer_alloc = MAX(MB_SEGY_TRACEHEADER_LENGTH, segytraceheader.nsamps * samplesize);
-			status = mb_mallocd(verbose, __FILE__, __LINE__, buffer_alloc, (void **)&buffer, &error);
-			if (status != MB_SUCCESS)
-				buffer_alloc = 0;
-			}
-
-		    /* extract the data */
-		    if (status == MB_SUCCESS)
-			status = mb_extract_segy(verbose,mbio_ptr,store_ptr,&sampleformat,&kind,
-				    (void *)&segytraceheader,segydata,&error);
-
-		    /* apply time shift if needed */
-		    if (status == MB_SUCCESS && timeshift != 0.0)
-		    	{
-			time_j[0] = segytraceheader.year;
-			time_j[1] = segytraceheader.day_of_yr;
-			time_j[2] = 60 * segytraceheader.hour + segytraceheader.min;
-			time_j[3] = segytraceheader.sec;
-			time_j[4] = 1000 * segytraceheader.mils;
-			mb_get_itime(verbose,time_j,time_i);
-			mb_get_time(verbose,time_i,&time_d);
-			time_d += timeshift;
-			mb_get_date(verbose,time_d,time_i);
-			mb_get_jtime(verbose,time_i,time_j);
-			segytraceheader.year = time_i[0];
-			segytraceheader.day_of_yr = time_j[1];
-			segytraceheader.hour = time_i[3];
-			segytraceheader.min = time_i[4];
-			segytraceheader.sec = time_i[5];
-			}
-
-		    /* set nav and heading using most recent survey data */
-		    segytraceheader.src_long = (int)(lastlon * 360000.0);
-		    segytraceheader.src_lat = (int)(lastlat * 360000.0);
-		    segytraceheader.grp_long = (int)(lastlon * 360000.0);
-		    segytraceheader.grp_lat = (int)(lastlat * 360000.0);
-		    segytraceheader.heading = lastheading;
-		    segytraceheader.roll = roll;
-		    segytraceheader.pitch = pitch;
-		    segytraceheader.distance = 1000.0 * lastdistance;
-
-		    /* if following a route check that the vehicle has come on line
-		    	(within MBES_ONLINE_THRESHOLD degrees)
-		    	before writing any data */
-		    if (activewaypoint > 0 && checkroutebearing == MB_YES
-		    	&& nroutepoint > 1)
-		    	{
-			headingdiff = fabs(routeheading[activewaypoint-1] - segytraceheader.heading);
-			if (headingdiff > 180.0)
-				headingdiff = 360.0 - headingdiff;
-			if (headingdiff < MBES_ONLINE_THRESHOLD)
-				oktowrite++;
-			else
-				oktowrite = 0;
-/* fprintf(stderr,"heading: %f %f %f oktowrite:%d\n",
-routeheading[activewaypoint-1],segytraceheader.heading,headingdiff,oktowrite);*/
-			}
-		    else if (activewaypoint > 0)
-		    	oktowrite = MBES_ONLINE_COUNT;
-		    else if (nroutepoint == 0 && ntimepoint == 0)
-		    	oktowrite = MBES_ONLINE_COUNT;
-/*if (status == MB_SUCCESS)
-fprintf(stderr,"activewaypoint:%d linenumber:%d range:%f   lon: %f %f   lat: %f %f oktowrite:%d\n",
-activewaypoint,linenumber,range, navlon,
-routelon[activewaypoint], navlat, routelat[activewaypoint], oktowrite);*/
-
-		    /* open output segy file if needed */
-		    if (fp == NULL && oktowrite > 0)
-			{
-			/* set up output filename */
-			if (output_file_set == MB_NO)
-			    {
-			    if (nroutepoint > 1 || ntimepoint > 1)
-				    {
-				    sprintf(output_file, "%s_%4.4d.segy", lineroot, linenumber);
-				    }
-			    else
-				    {
-				    strcpy(output_file, file);
-				    strcat(output_file,".segy");
-				    }
-			    }
-
-			/* open the new file */
-			nwrite = 0;
-			if ((fp = fopen(output_file, "w")) == NULL)
-				{
-				status = MB_FAILURE;
-				error = MB_ERROR_WRITE_FAIL;
-				fprintf(stderr,"\nError opening output segy file:\n%s\n",
-					output_file);
-				fprintf(stderr,"\nProgram <%s> Terminated\n",
-					program_name);
-				exit(error);
-				}
-			else if (verbose > 0)
-				{
-				/* output info on file output */
-				fprintf(stderr,"Outputting subbottom data to segy file %s\n",
-					output_file);
-				}
-			sprintf(output_list_file,"%s.txt",output_file);
-			if ((cfp = fopen(output_list_file, "w")) == NULL)
-				{
-				status = MB_FAILURE;
-				error = MB_ERROR_WRITE_FAIL;
-				fprintf(stderr,"\nError opening output segy list file:\n%s\n",
-					output_list_file);
-				fprintf(stderr,"\nProgram <%s> Terminated\n",
-					program_name);
-				exit(error);
-				}
-			}
-
-		    /* note good status */
-		    if (status == MB_SUCCESS)
-		    	{
-			/* get trace min and max */
-			tracemin = segydata[0];
-			tracemax = segydata[0];
-			tracerms = 0.0;
-			for (i=0;i<segytraceheader.nsamps;i++)
-				{
-				tracemin = MIN(tracemin, segydata[i]);
-				tracemax = MAX(tracemax, segydata[i]);
-				tracerms += segydata[i] * segydata[i];
-				}
-			tracerms = sqrt(tracerms / segytraceheader.nsamps);
-			tracelength = 0.000001 * segytraceheader.si_micros * segytraceheader.nsamps;
-
-			/* get starting and ending positions */
-			if (nwrite == 0)
-				{
-				startlon = ((double)segytraceheader.src_long) / 360000.0;
-				startlat = ((double)segytraceheader.src_lat) / 360000.0;
-				startshot = segytraceheader.shot_num;
-				linetracemin = tracemin;
-				linetracemax = tracemax;
-				linetracelength = tracelength;
-				}
-			else
-				{
-				endlon = ((double)segytraceheader.src_long) / 360000.0;
-				endlat = ((double)segytraceheader.src_lat) / 360000.0;
-				endshot = segytraceheader.shot_num;
-				linetracemin = MIN(tracemin,linetracemin);
-				linetracemax = MAX(tracemax,linetracemax);
-				linetracelength = MAX(tracelength,linetracelength);
-				}
-
-			/* check for new section plot */
-			if (nwrite > 0 && (nwrite % nshotmax) == 0)
-				nplot++;
-
-			/* get seafloor depth min and max */
-			if (segytraceheader.src_wbd > 0)
-				{
-				if (seafloordepthmin < 0.0)
-					{
-					seafloordepthmin = 0.01 * ((double) segytraceheader.src_wbd);
-					seafloordepthmax = 0.01 * ((double) segytraceheader.src_wbd);
-					}
-				else
-					{
-					seafloordepthmin = MIN(seafloordepthmin, 0.01 * ((double) segytraceheader.src_wbd));
-					seafloordepthmax = MAX(seafloordepthmax, 0.01 * ((double) segytraceheader.src_wbd));
-					}
-				if (seafloordepthminplot[nplot] < 0.0)
-					{
-					seafloordepthminplot[nplot] = 0.01 * ((double) segytraceheader.src_wbd);
-					seafloordepthmaxplot[nplot] = 0.01 * ((double) segytraceheader.src_wbd);
-					}
-				else
-					{
-					seafloordepthminplot[nplot] = MIN(seafloordepthminplot[nplot], 0.01 * ((double) segytraceheader.src_wbd));
-					seafloordepthmaxplot[nplot] = MAX(seafloordepthmaxplot[nplot], 0.01 * ((double) segytraceheader.src_wbd));
-					}
-				}
-
-			/* output info */
-			nread++;
-			if (nread % 10 == 0 && verbose > 0)
-			fprintf(stderr,"file:%s record:%d shot:%d  %4.4d/%3.3d %2.2d:%2.2d:%2.2d.%3.3d samples:%d interval:%d usec  minmax: %f %f\n",
-				file,nread,segytraceheader.shot_num,
-				segytraceheader.year,segytraceheader.day_of_yr,
-				segytraceheader.hour,segytraceheader.min,segytraceheader.sec,segytraceheader.mils,
-				segytraceheader.nsamps,segytraceheader.si_micros,tracemin,tracemax);
-
-			/* only write data if ok */
-			if (oktowrite >= MBES_ONLINE_COUNT)
-				{
-				/* write characteristics file */
-				fprintf(stderr,"%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d  %d %d %d   %f %f %f  %f %f %f %f\n",
-					time_i[0],time_i[1],time_i[2],time_i[3],time_i[4],time_i[5],time_i[6],
-					segytraceheader.shot_num,segytraceheader.nsamps,segytraceheader.si_micros,
-					tracemin,tracemax,tracerms,
-					sonardepth,altitude,roll,pitch);
-
-				/* write fileheader if needed */
-				if (status == MB_SUCCESS && nwrite == 0)
-		    		    {
-				    segyfileheader.line = linenumber;
-				    segyfileheader.format = 5;
-				    segyfileheader.channels = 1;
-				    segyfileheader.aux_channels = 0;
-				    segyfileheader.sample_interval = segytraceheader.si_micros;
-				    segyfileheader.sample_interval_org = segytraceheader.si_micros;
-				    segyfileheader.number_samples = segytraceheader.nsamps;
-
-				    /* insert file header data into output buffer */
-				    index = 0;
-				    mb_put_binary_int(MB_NO, segyfileheader.jobid, (void *) &(buffer[index])); index += 4;
-				    mb_put_binary_int(MB_NO, segyfileheader.line, (void *) &(buffer[index])); index += 4;
-				    mb_put_binary_int(MB_NO, segyfileheader.reel, (void *) &(buffer[index])); index += 4;
-				    mb_put_binary_short(MB_NO, segyfileheader.channels, (void *) &(buffer[index])); index += 2;
-				    mb_put_binary_short(MB_NO, segyfileheader.aux_channels, (void *) &(buffer[index])); index += 2;
-				    mb_put_binary_short(MB_NO, segyfileheader.sample_interval, (void *) &(buffer[index])); index += 2;
-				    mb_put_binary_short(MB_NO, segyfileheader.sample_interval_org, (void *) &(buffer[index])); index += 2;
-				    mb_put_binary_short(MB_NO, segyfileheader.number_samples, (void *) &(buffer[index])); index += 2;
-				    mb_put_binary_short(MB_NO, segyfileheader.number_samples_org, (void *) &(buffer[index])); index += 2;
-				    mb_put_binary_short(MB_NO, segyfileheader.format, (void *) &(buffer[index])); index += 2;
-				    mb_put_binary_short(MB_NO, segyfileheader.cdp_fold, (void *) &(buffer[index])); index += 2;
-				    mb_put_binary_short(MB_NO, segyfileheader.trace_sort, (void *) &(buffer[index])); index += 2;
-				    mb_put_binary_short(MB_NO, segyfileheader.vertical_sum, (void *) &(buffer[index])); index += 2;
-				    mb_put_binary_short(MB_NO, segyfileheader.sweep_start, (void *) &(buffer[index])); index += 2;
-				    mb_put_binary_short(MB_NO, segyfileheader.sweep_end, (void *) &(buffer[index])); index += 2;
-				    mb_put_binary_short(MB_NO, segyfileheader.sweep_length, (void *) &(buffer[index])); index += 2;
-				    mb_put_binary_short(MB_NO, segyfileheader.sweep_type, (void *) &(buffer[index])); index += 2;
-				    mb_put_binary_short(MB_NO, segyfileheader.sweep_trace, (void *) &(buffer[index])); index += 2;
-				    mb_put_binary_short(MB_NO, segyfileheader.sweep_taper_start, (void *) &(buffer[index])); index += 2;
-				    mb_put_binary_short(MB_NO, segyfileheader.sweep_taper_end, (void *) &(buffer[index])); index += 2;
-				    mb_put_binary_short(MB_NO, segyfileheader.sweep_taper, (void *) &(buffer[index])); index += 2;
-				    mb_put_binary_short(MB_NO, segyfileheader.correlated, (void *) &(buffer[index])); index += 2;
-				    mb_put_binary_short(MB_NO, segyfileheader.binary_gain, (void *) &(buffer[index])); index += 2;
-				    mb_put_binary_short(MB_NO, segyfileheader.amplitude, (void *) &(buffer[index])); index += 2;
-				    mb_put_binary_short(MB_NO, segyfileheader.units, (void *) &(buffer[index])); index += 2;
-				    mb_put_binary_short(MB_NO, segyfileheader.impulse_polarity, (void *) &(buffer[index])); index += 2;
-				    mb_put_binary_short(MB_NO, segyfileheader.vibrate_polarity, (void *) &(buffer[index])); index += 2;
-				    mb_put_binary_short(MB_NO, segyfileheader.domain, (void *) &(buffer[index])); index += 2;
-				    for (i=0;i<338;i++)
-					    {
-					    buffer[index] = segyfileheader.extra[i]; index++;
-					    }
-
-				    segyfileheader.number_samples_org = segytraceheader.nsamps;
-				    if (fwrite(&segyasciiheader, 1, MB_SEGY_ASCIIHEADER_LENGTH, fp)
-							    != MB_SEGY_ASCIIHEADER_LENGTH)
-					    {
-					    status = MB_FAILURE;
-					    error = MB_ERROR_WRITE_FAIL;
-					    }
-				    else if (fwrite(buffer, 1, MB_SEGY_FILEHEADER_LENGTH, fp)
-							    != MB_SEGY_FILEHEADER_LENGTH)
-					    {
-					    status = MB_FAILURE;
-					    error = MB_ERROR_WRITE_FAIL;
-					    }
-				    }
-//fprintf(stderr,"J\n");
-
-				/* insert segy header data into output buffer */
-				index = 0;
-				mb_put_binary_int(MB_NO, segytraceheader.seq_num, (void *) &buffer[index]); index += 4;
-				mb_put_binary_int(MB_NO, segytraceheader.seq_reel, (void *) &buffer[index]); index += 4;
-				mb_put_binary_int(MB_NO, segytraceheader.shot_num, (void *) &buffer[index]); index += 4;
-				mb_put_binary_int(MB_NO, segytraceheader.shot_tr, (void *) &buffer[index]); index += 4;
-				mb_put_binary_int(MB_NO, segytraceheader.espn, (void *) &buffer[index]); index += 4;
-				mb_put_binary_int(MB_NO, segytraceheader.rp_num, (void *) &buffer[index]); index += 4;
-				mb_put_binary_int(MB_NO, segytraceheader.rp_tr, (void *) &buffer[index]); index += 4;
-				mb_put_binary_short(MB_NO, segytraceheader.trc_id, (void *) &buffer[index]); index += 2;
-				mb_put_binary_short(MB_NO, segytraceheader.num_vstk, (void *) &buffer[index]); index += 2;
-				mb_put_binary_short(MB_NO, segytraceheader.cdp_fold, (void *) &buffer[index]); index += 2;
-				mb_put_binary_short(MB_NO, segytraceheader.use, (void *) &buffer[index]); index += 2;
-				mb_put_binary_int(MB_NO, segytraceheader.range, (void *) &buffer[index]); index += 4;
-				mb_put_binary_int(MB_NO, segytraceheader.grp_elev, (void *) &buffer[index]); index += 4;
-				mb_put_binary_int(MB_NO, segytraceheader.src_elev, (void *) &buffer[index]); index += 4;
-				mb_put_binary_int(MB_NO, segytraceheader.src_depth, (void *) &buffer[index]); index += 4;
-				mb_put_binary_int(MB_NO, segytraceheader.grp_datum, (void *) &buffer[index]); index += 4;
-				mb_put_binary_int(MB_NO, segytraceheader.src_datum, (void *) &buffer[index]); index += 4;
-				mb_put_binary_int(MB_NO, segytraceheader.src_wbd, (void *) &buffer[index]); index += 4;
-				mb_put_binary_int(MB_NO, segytraceheader.grp_wbd, (void *) &buffer[index]); index += 4;
-        			mb_put_binary_short(MB_NO, segytraceheader.elev_scalar, (void *) &buffer[index]); index += 2;
-        			mb_put_binary_short(MB_NO, segytraceheader.coord_scalar, (void *) &buffer[index]); index += 2;
-				mb_put_binary_int(MB_NO, segytraceheader.src_long, (void *) &buffer[index]); index += 4;
-				mb_put_binary_int(MB_NO, segytraceheader.src_lat, (void *) &buffer[index]); index += 4;
-				mb_put_binary_int(MB_NO, segytraceheader.grp_long, (void *) &buffer[index]); index += 4;
-				mb_put_binary_int(MB_NO, segytraceheader.grp_lat, (void *) &buffer[index]); index += 4;
-        			mb_put_binary_short(MB_NO, segytraceheader.coord_units, (void *) &buffer[index]); index += 2;
-        			mb_put_binary_short(MB_NO, segytraceheader.wvel, (void *) &buffer[index]); index += 2;
-        			mb_put_binary_short(MB_NO, segytraceheader.sbvel, (void *) &buffer[index]); index += 2;
-        			mb_put_binary_short(MB_NO, segytraceheader.src_up_vel, (void *) &buffer[index]); index += 2;
-        			mb_put_binary_short(MB_NO, segytraceheader.grp_up_vel, (void *) &buffer[index]); index += 2;
-        			mb_put_binary_short(MB_NO, segytraceheader.src_static, (void *) &buffer[index]); index += 2;
-        			mb_put_binary_short(MB_NO, segytraceheader.grp_static, (void *) &buffer[index]); index += 2;
-        			mb_put_binary_short(MB_NO, segytraceheader.tot_static, (void *) &buffer[index]); index += 2;
-        			mb_put_binary_short(MB_NO, segytraceheader.laga, (void *) &buffer[index]); index += 2;
-				mb_put_binary_int(MB_NO, segytraceheader.delay_mils, (void *) &buffer[index]); index += 4;
-        			mb_put_binary_short(MB_NO, segytraceheader.smute_mils, (void *) &buffer[index]); index += 2;
-        			mb_put_binary_short(MB_NO, segytraceheader.emute_mils, (void *) &buffer[index]); index += 2;
-        			mb_put_binary_short(MB_NO, segytraceheader.nsamps, (void *) &buffer[index]); index += 2;
-        			mb_put_binary_short(MB_NO, segytraceheader.si_micros, (void *) &buffer[index]); index += 2;
-				for (i=0;i<19;i++)
-					{
-        				mb_put_binary_short(MB_NO, segytraceheader.other_1[i], (void *) &buffer[index]); index += 2;
-					}
-        			mb_put_binary_short(MB_NO, segytraceheader.year, (void *) &buffer[index]); index += 2;
-        			mb_put_binary_short(MB_NO, segytraceheader.day_of_yr, (void *) &buffer[index]); index += 2;
-        			mb_put_binary_short(MB_NO, segytraceheader.hour, (void *) &buffer[index]); index += 2;
-        			mb_put_binary_short(MB_NO, segytraceheader.min, (void *) &buffer[index]); index += 2;
-        			mb_put_binary_short(MB_NO, segytraceheader.sec, (void *) &buffer[index]); index += 2;
-        			mb_put_binary_short(MB_NO, segytraceheader.mils, (void *) &buffer[index]); index += 2;
-        			mb_put_binary_short(MB_NO, segytraceheader.tr_weight, (void *) &buffer[index]); index += 2;
-				for (i=0;i<5;i++)
-					{
-        				mb_put_binary_short(MB_NO, segytraceheader.other_2[i], (void *) &buffer[index]); index += 2;
-					}
-				mb_put_binary_float(MB_NO, segytraceheader.delay, (void *) &buffer[index]); index += 4;
-        			mb_put_binary_float(MB_NO, segytraceheader.smute_sec, (void *) &buffer[index]); index += 4;
-        			mb_put_binary_float(MB_NO, segytraceheader.emute_sec, (void *) &buffer[index]); index += 4;
-        			mb_put_binary_float(MB_NO, segytraceheader.si_secs, (void *) &buffer[index]); index += 4;
-        			mb_put_binary_float(MB_NO, segytraceheader.wbt_secs, (void *) &buffer[index]); index += 4;
-				mb_put_binary_int(MB_NO, segytraceheader.end_of_rp, (void *) &buffer[index]); index += 4;
-        			mb_put_binary_float(MB_NO, segytraceheader.dummy1, (void *) &buffer[index]); index += 4;
-        			mb_put_binary_float(MB_NO, segytraceheader.dummy2, (void *) &buffer[index]); index += 4;
-        			mb_put_binary_float(MB_NO, segytraceheader.dummy3, (void *) &buffer[index]); index += 4;
-        			mb_put_binary_float(MB_NO, segytraceheader.dummy4, (void *) &buffer[index]); index += 4;
-        			mb_put_binary_float(MB_NO, segytraceheader.soundspeed, (void *) &buffer[index]); index += 4;
-        			mb_put_binary_float(MB_NO, segytraceheader.distance, (void *) &buffer[index]); index += 4;
-        			mb_put_binary_float(MB_NO, segytraceheader.roll, (void *) &buffer[index]); index += 4;
-        			mb_put_binary_float(MB_NO, segytraceheader.pitch, (void *) &buffer[index]); index += 4;
-        			mb_put_binary_float(MB_NO, segytraceheader.heading, (void *) &buffer[index]); index += 4;
-
-				/* write out segy header */
-				if (fwrite(buffer,1,MB_SEGY_TRACEHEADER_LENGTH,fp)
-							!= MB_SEGY_TRACEHEADER_LENGTH)
-					{
-					status = MB_FAILURE;
-					error = MB_ERROR_WRITE_FAIL;
-					}
-
-				/* insert segy data into output buffer */
-				index = 0;
-				for (i=0;i<segytraceheader.nsamps;i++)
-					{
-        				mb_put_binary_float(MB_NO, segydata[i], (void *) &buffer[index]); index += 4;
-					}
-
-				/* write out data */
-				nwrite++;
-				if (status == MB_SUCCESS
-					&& fwrite(buffer, 1, segytraceheader.nsamps * samplesize, fp)
-							!= segytraceheader.nsamps * samplesize)
-					{
-					status = MB_FAILURE;
-					error = MB_ERROR_WRITE_FAIL;
-					}
-				}
-
-			}
-		    }
-
-		/* print debug statements */
-		if (verbose >= 2)
-			{
-			fprintf(stderr,"\ndbg2  Ping read in program <%s>\n",
-				program_name);
-			fprintf(stderr,"dbg2       kind:           %d\n",kind);
-			fprintf(stderr,"dbg2       error:          %d\n",error);
-			fprintf(stderr,"dbg2       status:         %d\n",status);
-			}
-
-		/* print comments */
-		if (verbose >= 1 && kind == MB_DATA_COMMENT)
-			{
-			if (icomment == 0)
-				{
-				fprintf(stderr,"\nComments:\n");
-				icomment++;
-				}
-			fprintf(stderr,"%s\n",comment);
-			}
-		}
-
-	/* close the swath file */
-	status = mb_close(verbose,&mbio_ptr,&error);
-
-	/* output read statistics */
-	fprintf(stderr,"%d records read from %s\n", nread, file);
-
-	/* deallocate memory used for segy data arrays */
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&segydata,&error);
-	segydata_alloc = 0;
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&buffer,&error);
-	buffer_alloc = 0;
-
-	/* figure out whether and what to read next */
-        if (read_datalist == MB_YES)
-                {
-		if ((status = mb_datalist_read(verbose,datalist,
-			    file,&format,&file_weight,&error))
-			    == MB_SUCCESS)
-                        read_data = MB_YES;
-                else
-                        read_data = MB_NO;
-                }
-        else
-                {
-                read_data = MB_NO;
-                }
-
-	/* close output file if conditions warrent */
-	if (read_data == MB_NO
-		|| (output_file_set == MB_NO && nroutepoint < 2 && ntimepoint < 2))
-		{
-		/* close current output file */
-		if (fp != NULL)
-		    {
-		    fclose(fp);
-		    fp = NULL;
-
-		    /* output count of segy records */
-		    fprintf(stderr,"\n%d records output to segy file %s\n",
-					nwrite, output_file);
-		    if (verbose > 0)
-			fprintf(stderr,"\n");
-
-		    /* use mbsegyinfo to generate a sinf file */
-		    sprintf(command, "mbsegyinfo -I %s -O", output_file);
-		    fprintf(stderr, "Executing: %s\n", command);
-		    shellstatus = system(command);
-
-		    /* get bearing and plot scale */
-		    dx = (endlon - startlon) / mtodeglon;
-		    dy = (endlat - startlat) / mtodeglat;
-		    linedistance = sqrt(dx * dx + dy * dy);
-		    if (linebearing < 0.0)
-		    	linebearing += 360.0;
-		    if (linebearing >= 45.0 && linebearing <= 225.0)
-			sprintf(scale, "-Jx%f/%f", xscale, yscale);
-		    else
-			sprintf(scale, "-Jx-%f/%f", xscale, yscale);
-
-		    /* output commands to first cut plotting script file */
-		    /* The maximum useful plot length is about nshotmax shots, so
-		    	we break longer files up into multiple plots */
-		    nshot = endshot - startshot + 1;
-		    nplot = nwrite / nshotmax;
-		    if (nwrite % nshotmax > 0)
-		    	nplot++;
-/*fprintf(stderr,"seafloordepthmin:%f seafloordepthmax:%f linetracelength:%f\n", seafloordepthmin, seafloordepthmax,linetracelength);*/
-
-		    /* calculate sweep needed for all of the data in the line - if this is more than 1.0 seconds,
-		      then make section plots using only the sweep needed for each section alone */
-		    delay = seafloordepthmin / 750.0;
-		    delay = ((int)(delay / 0.05)) * 0.05;
-		    endofdata = seafloordepthmax / 750.0 + linetracelength;
-		    endofdata = (1 + (int)(endofdata / 0.05)) * 0.05;
-		    sweep = endofdata - delay;
-		    if (sweep > MBES_MAX_SWEEP)
-			recalculatesweep = MB_YES;
-		    else
-			{
-			recalculatesweep = MB_NO;
-			}
-
-		    fprintf(sfp, "# Generate %d section plot(s) of segy file: %s\n", nplot, output_file);
-		    fprintf(sfp, "#   Section Start Position: %.6f %.6f\n", startlon, startlat);
-		    fprintf(sfp, "#   Section End Position:   %.6f %.6f\n", endlon, endlat);
-		    fprintf(sfp, "#   Section length: %f km\n", linedistance);
-		    fprintf(sfp, "#   Section bearing: %f degrees\n", linebearing);
-		    fprintf(stderr, "# Generate %d section plot(s) of segy file: %s\n", nplot, output_file);
-		    fprintf(stderr, "#   Section Start Position: %.6f %.6f\n", startlon, startlat);
-		    fprintf(stderr, "#   Section End Position:   %.6f %.6f\n", endlon, endlat);
-		    fprintf(stderr, "#   Section length: %f km\n", linedistance);
-		    fprintf(stderr, "#   Section bearing: %f degrees\n", linebearing);
-		    for (i=0;i<nplot;i++)
-		    	{
-			if (recalculatesweep == MB_YES)
-				{
-				seafloordepthmin = seafloordepthminplot[i];
-				seafloordepthmax = seafloordepthmaxplot[i];
-				delay = seafloordepthmin / 750.0;
-				delay = ((int)(delay / 0.05)) * 0.05;
-				endofdata = seafloordepthmax / 750.0 + linetracelength;
-				endofdata = (1 + (int)(endofdata / 0.05)) * 0.05;
-				sweep = endofdata - delay;
-				}
-
-		        sprintf(command, "#   Section plot %d of %d\n", i + 1, nplot);
-			fprintf(stderr, "%s", command);
-			fprintf(sfp, "%s", command);
-		        sprintf(command, "#     Seafloor depth min: %f (m) %f (s)  max: %f (m) %f (s)\n",
-				seafloordepthmin, seafloordepthmin / 750.0, seafloordepthmax, seafloordepthmax / 750.0);
-			fprintf(stderr, "%s", command);
-			fprintf(sfp, "%s", command);
-		        sprintf(command, "#     Trace length: %f (s)\n", linetracelength);
-			fprintf(stderr, "%s", command);
-			fprintf(sfp, "%s", command);
-		        sprintf(command, "#     Trace delay: %f (s)\n", delay);
-			fprintf(stderr, "%s", command);
-			fprintf(sfp, "%s", command);
-		        sprintf(command, "#     Trace sweep: %f (s)\n", sweep);
-			fprintf(stderr, "%s", command);
-			fprintf(sfp, "%s", command);
-
-			sprintf(command, "mbsegygrid -I %s \\\n\t-S0/%d/%d -T%.2f/%.2f \\\n\t-O %s_%4.4d_%2.2d_section\n",
-					output_file, (startshot + i * nshotmax),
-					MIN((startshot  + (i + 1) * nshotmax - 1), endshot),
-					sweep, delay, lineroot, linenumber, i + 1);
-			fprintf(stderr, "%s", command);
-			fprintf(sfp, "%s", command);
-
-			sprintf(command, "mbm_grdplot -I %s_%4.4d_%2.2d_section.grd \\\n\t%s -Z%s \\\n\t-Ba250/a0.05g0.05 -G1 -W1/4 -D -V \\\n\t-O %s_%4.4d_%2.2d_sectionplot \\\n\t-L\"%s Line %d Plot %d of %d\"\n",
-					lineroot, linenumber, i + 1, scale, zbounds,
-					lineroot, linenumber, i + 1, lineroot, linenumber,
-					i + 1, nplot);
-			fprintf(stderr, "%s", command);
-			fprintf(sfp, "%s", command);
-
-			sprintf(command, "%s_%4.4d_%2.2d_sectionplot.cmd $1\n\n",
-					lineroot, linenumber, i + 1);
-			fprintf(stderr, "%s", command);
-			fprintf(sfp, "%s", command);
-
-			sprintf(command, "convert -density 100 %s_%4.4d_%2.2d_sectionplot.ps -trim -quality 75 %s_%4.4d_%2.2d_sectionplot.jpg\n\n",
-					lineroot, linenumber, i + 1, lineroot, linenumber, i + 1);
-			fprintf(stderr, "%s", command);
-			fprintf(sfp, "%s", command);
-			fflush(sfp);
-			}
-
-		    /* increment line number */
-		    linenumber++;
-		    }
-		}
-
-	/* end loop over files in list */
-	}
-	if (read_datalist == MB_YES)
-		mb_datalist_close(verbose,&datalist,&error);
-
-	/* close plotting script file */
-	fclose(sfp);
-	sprintf(command, "chmod +x %s", scriptfile);
-	shellstatus = system(command);
-
-	/* deallocate route arrays */
-	if (route_file_set == MB_YES)
-		{
-		status = mb_freed(verbose,__FILE__,__LINE__, (void **)&routelon, &error);
-		status = mb_freed(verbose,__FILE__,__LINE__, (void **)&routelat, &error);
-		status = mb_freed(verbose,__FILE__,__LINE__, (void **)&routeheading, &error);
-		status = mb_freed(verbose,__FILE__,__LINE__, (void **)&routewaypoint, &error);
-		}
-
-	/* check memory */
-	if (verbose >= 4)
-		status = mb_memory_list(verbose,&error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  Program <%s> completed\n",
-			program_name);
-		fprintf(stderr,"dbg2  Ending status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* end it all */
-	exit(error);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/utilities/mbfilter.c b/src/utilities/mbfilter.c
deleted file mode 100644
index 729d6a0..0000000
--- a/src/utilities/mbfilter.c
+++ /dev/null
@@ -1,2102 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbfilter.c	1/16/95
- *    $Id: mbfilter.c 2229 2015-02-14 23:04:41Z caress $
- *
- *    Copyright (c) 1995-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbfilter applies one or more simple filters to the specified
- * data (sidescan, beam amplitude, and/or bathymetry). The filters
- * include:
- *   a: boxcar mean filter for smoothing
- *   b: gaussian mean filter for smoothing
- *   c: boxcar median filter for smoothing
- *   d: inverse gradient filter for smoothing
- *   e: edge detection filter for contrast enhancement
- *   f: gradient subtraction filter for contrast enhancement
- * These filters are mostly intended for use with sidescan
- * data, and operate on 3x3 or 5x5 value windows with
- * no accommodation for differences in acrosstrack vs
- * alongtrack sampling.
- * The default input and output streams are stdin and stdout.
- *
- * Author:	D. W. Caress
- * Date:	January 16, 1995
- *
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <math.h>
-#include <string.h>
-#include <time.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_define.h"
-#include "mb_io.h"
-#include "mbsys_ldeoih.h"
-
-/* mode defines */
-#define	MBFILTER_BATH			0
-#define	MBFILTER_AMP			1
-#define	MBFILTER_SS			2
-
-#define	MBFILTER_HIPASS_NONE		0
-#define	MBFILTER_HIPASS_MEAN		1
-#define	MBFILTER_HIPASS_GAUSSIAN	2
-#define	MBFILTER_HIPASS_MEDIAN		3
-#define	MBFILTER_SMOOTH_NONE		0
-#define	MBFILTER_SMOOTH_MEAN		1
-#define	MBFILTER_SMOOTH_GAUSSIAN	2
-#define	MBFILTER_SMOOTH_MEDIAN		3
-#define	MBFILTER_SMOOTH_GRADIENT	4
-#define	MBFILTER_CONTRAST_NONE		0
-#define	MBFILTER_CONTRAST_EDGE		1
-#define	MBFILTER_CONTRAST_GRADIENT	2
-
-#define	MBFILTER_A_NONE			0
-#define	MBFILTER_A_HIPASS_MEAN		1
-#define	MBFILTER_A_HIPASS_GAUSSIAN	2
-#define	MBFILTER_A_HIPASS_MEDIAN	3
-#define	MBFILTER_A_SMOOTH_MEAN		4
-#define	MBFILTER_A_SMOOTH_GAUSSIAN	5
-#define	MBFILTER_A_SMOOTH_MEDIAN	6
-#define	MBFILTER_A_SMOOTH_GRADIENT	7
-#define	MBFILTER_A_CONTRAST_EDGE	8
-#define	MBFILTER_A_CONTRAST_GRADIENT	9
-
-/* MBIO buffer size default */
-#define	MBFILTER_BUFFER_DEFAULT	2000
-
-/* ping structure definition */
-struct mbfilter_ping_struct
-	{
-	int	time_i[7];
-	double	time_d;
-	double	navlon;
-	double	navlat;
-	double	speed;
-	double	heading;
-	double	distance;
-	double	altitude;
-	double	sonardepth;
-	double	roll;
-	double	pitch;
-	double	heave;
-	int	beams_bath;
-	int	beams_amp;
-	int	pixels_ss;
-	char	*beamflag;
-	double	*bath;
-	double	*bathacrosstrack;
-	double	*bathalongtrack;
-	double	*amp;
-	char	*pixelflag;
-	double	*ss;
-	double	*ssacrosstrack;
-	double	*ssalongtrack;
-	double	*dataprocess;
-	double	*datasave;
-	int	ndatapts;
-	double	*data_i_ptr;
-	double	*data_f_ptr;
-	char	*flag_ptr;
-	};
-
-/* filter structure definition */
-#define	MBFILTER_NFILTER_MAX	10
-struct mbfilter_filter_struct
-	{
-	int	mode;
-	int	xdim;
-	int	ldim;
-	int	iteration;
-	int	threshold;
-	double	threshold_lo;
-	double	threshold_hi;
-	double	hipass_offset;
-	};
-
-/* function prototypes */
-int hipass_mean(int verbose, int n, double *val, double *wgt,
-		double *hipass, int *error);
-int hipass_gaussian(int verbose, int n, double *val, double *wgt, double *dis,
-		double *hipass, int *error);
-int hipass_median(int verbose, int n, double *val, double *wgt,
-		double *hipass, int *error);
-int smooth_mean(int verbose, int n, double *val, double *wgt,
-		double *smooth, int *error);
-int smooth_gaussian(int verbose, int n, double *val, double *wgt, double *dis,
-		double *smooth, int *error);
-int smooth_median(int verbose, double original,
-		int apply_threshold, double threshold_lo, double threshold_hi,
-		int n, double *val, double *wgt,
-		double *smooth, int *error);
-int smooth_gradient(int verbose, int n, double *val, double *wgt,
-		double *smooth, int *error);
-int contrast_edge(int verbose, int n, double *val, double *grad,
-		double *result, int *error);
-int contrast_gradient(int verbose, int n, double *val, double *wgt,
-		double *result, int *error);
-int mbcopy_any_to_mbldeoih(int verbose, int system,
-		int kind, int *time_i, double time_d,
-		double navlon, double navlat, double speed, double heading,
-		double draft, double altitude,
-		double roll, double pitch, double heave,
-		double	beamwidth_xtrack, double beamwidth_ltrack,
-		int nbath, int namp, int nss,
-		char *beamflag, double *bath, double *amp,
-		double *bathacrosstrack, double *bathalongtrack,
-		double *ss, double *ssacrosstrack, double *ssalongtrack,
-		char *comment,
-		char *ombio_ptr, char *ostore_ptr,
-		int *error);
-
-static char rcs_id[] = "$Id: mbfilter.c 2229 2015-02-14 23:04:41Z caress $";
-
-/*--------------------------------------------------------------------*/
-
-int main (int argc, char **argv)
-{
-	char program_name[] = "MBFILTER";
-	char help_message[] =
-"mbfilter applies one or more simple filters to the specified\n\t\
-data (sidescan and/or beam amplitude). The filters\n\t\
-include:\n\t\
-  - boxcar mean for lo-pass filtering (-S1)\n\t\
-  - gaussian mean for lo-pass filtering (-S2)\n\t\
-  - boxcar median for lo-pass filtering (-S3)\n\t\
-  - inverse gradient for lo-pass filtering (-S4)\n\t\
-  - boxcar mean subtraction for hi-pass filtering (-D1)\n\t\
-  - gaussian mean subtraction for hi-pass filtering (-D2)\n\t\
-  - boxcar median subtraction for hi-pass filtering (-D3)\n\t\
-  - edge detection for contrast enhancement (-C1)\n\t\
-  - gradient magnitude subtraction for contrast enhancement (-C2)\n\t\
-These filters are primarily intended for use with sidescan\n\t\
-data. In particular, the lo-pass or smoothing filters\n\t\
-can be used for first-order speckle reduction in sidescan\n\t\
-data, and the hi-pass filters can be used to emphasize\n\t\
-fine scale structure in the data.\n\t\
-The default input and output streams are stdin and stdout.\n";
-
-	char usage_message[] = "mbfilter [\
--Akind -Byr/mo/da/hr/mn/sc\n\t\
--Cmode/xdim/ldim/iteration\n\t\
--Dmode/xdim/ldim/iteration/offset\n\t\
--Eyr/mo/da/hr/mn/sc -Fformat -Iinfile -Nbuffersize\n\t\
--Rwest/east/south/north -Smode/xdim/ldim/iteration\n\t\
--Tthreshold -V -H]";
-	extern char *optarg;
-	int	errflg = 0;
-	int	c;
-	int	help = 0;
-	int	flag = 0;
-
-	/* MBIO status variables */
-	int	status;
-	int	verbose = 0;
-	int	error = MB_ERROR_NO_ERROR;
-	char	*message;
-
-	/* MBIO read control parameters */
-	int	read_datalist = MB_NO;
-	char	read_file[MB_PATH_MAXLINE];
-	void	*datalist;
-	int	look_processed = MB_DATALIST_LOOK_UNSET;
-	double	file_weight;
-	int	format;
-	int	system;
-	int	pings;
-	int	lonflip;
-	double	bounds[4];
-	int	btime_i[7];
-	int	etime_i[7];
-	double	btime_d;
-	double	etime_d;
-	double	speedmin;
-	double	timegap;
-	int	beams_bath;
-	int	beams_amp;
-	int	pixels_ss;
-	int	obeams_bath;
-	int	obeams_amp;
-	int	opixels_ss;
-	char	file[MB_PATH_MAXLINE];
-	void	*imbio_ptr = NULL;
-
-	/* MBIO write control parameters */
-	char	ofile[MB_PATH_MAXLINE];
-	void	*ombio_ptr = NULL;
-
-	/* mbio read and write values */
-	struct mb_io_struct *imb_io_ptr;
-	struct mb_io_struct *omb_io_ptr;
-	void	*store_ptr;
-	int	kind;
-	int	ndata = 0;
-	char	comment[MB_COMMENT_MAXLINE];
-
-	/* buffer handling parameters */
-	int	n_buffer_max = MBFILTER_BUFFER_DEFAULT;
-	int	nhold = 0;
-	int	nhold_ping = 0;
-	int	nload;
-	int	nunload;
-	int	nread;
-	int	nreadtot = 0;
-	int	nwrite;
-	int	nwritetot = 0;
-	int	nexpect;
-	struct mbfilter_ping_struct ping[MBFILTER_BUFFER_DEFAULT];
-	int	first = MB_YES;
-	int	done;
-
-	/* time, user, host variables */
-	time_t	right_now;
-	char	date[32], user[128], *user_ptr, host[MB_PATH_MAXLINE];
-
-	/* processing control variables */
-	int	datakind = MBFILTER_SS;
-	int	num_filters = 0;
-	struct mbfilter_filter_struct filters[MBFILTER_NFILTER_MAX];
-	int	hipass_mode = MBFILTER_HIPASS_NONE;
-	int	hipass_xdim = 10;
-	int	hipass_ldim = 3;
-	int	hipass_iter = 1;
-	double	hipass_offset = 1000.0;
-	int	smooth_mode = MBFILTER_SMOOTH_NONE;
-	int	smooth_xdim = 3;
-	int	smooth_ldim = 3;
-	int	smooth_iter = 1;
-	int	contrast_mode = MBFILTER_CONTRAST_NONE;
-	int	contrast_xdim = 5;
-	int	contrast_ldim = 5;
-	int	contrast_iter = 1;
-	int	apply_threshold = MB_NO;
-	double	threshold_lo = 0.0;
-	double	threshold_hi = 0.0;
-	int	nweight;
-	int	nweightmax;
-	double	*weights;
-	double	*values;
-	double	*distances;
-	int	iteration;
-
-	int	read_data;
-	double	*dataptr0, *dataptr1;
-	char	*flagptr0, *flagptr1;
-	double	ddis;
-	int	ndatapts;
-	int	ifilter, ndx, ndl;
-	int	ia,  ib;
-	int	ja,  jb,  jbeg,  jend;
-	int	i, j, ii, jj, n;
-
-	char	*ctime();
-	char	*getenv();
-
-	/* get current default values */
-	status = mb_defaults(verbose,&format,&pings,&lonflip,bounds,
-		btime_i,etime_i,&speedmin,&timegap);
-
-	/* reset all defaults but the format and lonflip */
-	pings = 1;
-	bounds[0] = -360.;
-	bounds[1] = 360.;
-	bounds[2] = -90.;
-	bounds[3] = 90.;
-	btime_i[0] = 1962;
-	btime_i[1] = 2;
-	btime_i[2] = 21;
-	btime_i[3] = 10;
-	btime_i[4] = 30;
-	btime_i[5] = 0;
-	btime_i[6] = 0;
-	etime_i[0] = 2062;
-	etime_i[1] = 2;
-	etime_i[2] = 21;
-	etime_i[3] = 10;
-	etime_i[4] = 30;
-	etime_i[5] = 0;
-	etime_i[6] = 0;
-	speedmin = 0.0;
-	timegap = 1000000000.0;
-
-	/* set default input and output */
-	strcpy (read_file, "datalist.mb-1");
-
-	/* process argument list */
-	while ((c = getopt(argc, argv, "A:a:B:b:C:c:D:d:E:e:F:f:HhI:i:N:n:R:r:S:s:T:t:Vv")) != -1)
-	  switch (c)
-		{
-		case 'A':
-		case 'a':
-			sscanf (optarg,"%d", &datakind);
-			if (datakind != MBFILTER_SS && datakind != MBFILTER_AMP)
-				datakind = MBFILTER_SS;
-			flag++;
-			break;
-		case 'B':
-		case 'b':
-			sscanf (optarg,"%d/%d/%d/%d/%d/%d",
-				&btime_i[0],&btime_i[1],&btime_i[2],
-				&btime_i[3],&btime_i[4],&btime_i[5]);
-			btime_i[6] = 0;
-			flag++;
-			break;
-		case 'C':
-		case 'c':
-			n = sscanf (optarg,"%d/%d/%d/%d",
-				&contrast_mode, &contrast_xdim,
-				&contrast_ldim, &contrast_iter);
-			if (n >= 3)
-				{
-				filters[num_filters].mode = contrast_mode + 7;
-				filters[num_filters].xdim = contrast_xdim;
-				filters[num_filters].ldim = contrast_ldim;
-				filters[num_filters].threshold = MB_NO;
-				}
-			if (n >= 4)
-				filters[num_filters].iteration = contrast_iter;
-			else
-				filters[num_filters].iteration = 1;
-			if (n >= 3)
-				num_filters++;
-			flag++;
-			break;
-		case 'D':
-		case 'd':
-			n = sscanf (optarg,"%d/%d/%d/%d/%lf",
-				&hipass_mode, &hipass_xdim,
-				&hipass_ldim, &hipass_iter,
-				&hipass_offset);
-			if (n >= 3)
-				{
-				filters[num_filters].mode = hipass_mode;
-				filters[num_filters].xdim = hipass_xdim;
-				filters[num_filters].ldim = hipass_ldim;
-				filters[num_filters].threshold = MB_NO;
-				}
-			if (n >= 4)
-				filters[num_filters].iteration = hipass_iter;
-			else
-				filters[num_filters].iteration = 1;
-			if (n >= 5)
-				filters[num_filters].hipass_offset = hipass_offset;
-			else
-				filters[num_filters].hipass_offset = 1000.0;
-			if (n >= 3)
-				num_filters++;
-			flag++;
-			break;
-		case 'E':
-		case 'e':
-			sscanf (optarg,"%d/%d/%d/%d/%d/%d",
-				&etime_i[0],&etime_i[1],&etime_i[2],
-				&etime_i[3],&etime_i[4],&etime_i[5]);
-			etime_i[6] = 0;
-			flag++;
-			break;
-		case 'F':
-		case 'f':
-			sscanf (optarg,"%d", &format);
-			flag++;
-			break;
-		case 'H':
-		case 'h':
-			help++;
-			break;
-		case 'I':
-		case 'i':
-			sscanf (optarg,"%s", read_file);
-			flag++;
-			break;
-		case 'N':
-		case 'n':
-			sscanf (optarg,"%d", &n_buffer_max);
-			if (n_buffer_max > MBFILTER_BUFFER_DEFAULT
-			    || n_buffer_max < 10)
-			    n_buffer_max = MBFILTER_BUFFER_DEFAULT;
-			flag++;
-			break;
-		case 'R':
-		case 'r':
-			mb_get_bounds(optarg, bounds);
-			flag++;
-			break;
-		case 'S':
-		case 's':
-			n = sscanf (optarg,"%d/%d/%d/%d/%lf/%lf",
-				&smooth_mode, &smooth_xdim,
-				&smooth_ldim, &smooth_iter,
-				&threshold_lo, &threshold_hi);
-			if (n >= 3)
-				{
-				filters[num_filters].mode = smooth_mode + 3;
-				filters[num_filters].xdim = smooth_xdim;
-				filters[num_filters].ldim = smooth_ldim;
-				}
-			if (n >= 4)
-				filters[num_filters].iteration = smooth_iter;
-			else
-				filters[num_filters].iteration = 1;
-			if (n >= 6)
-				{
-				filters[num_filters].threshold = MB_YES;
-				filters[num_filters].threshold_lo = threshold_lo;
-				filters[num_filters].threshold_hi = threshold_hi;
-				}
-			else if (apply_threshold == MB_YES)
-				{
-				filters[num_filters].threshold = MB_YES;
-				filters[num_filters].threshold_lo = threshold_lo;
-				filters[num_filters].threshold_hi = threshold_hi;
-				}
-			else
-				filters[num_filters].threshold = MB_NO;
-			if (n >= 3)
-				num_filters++;
-			flag++;
-			break;
-		case 'T':
-		case 't':
-			sscanf (optarg,"%lf/%lf",
-				&threshold_lo, &threshold_hi);
-			apply_threshold = MB_YES;
-			flag++;
-			break;
-		case 'V':
-		case 'v':
-			verbose++;
-			break;
-		case '?':
-			errflg++;
-		}
-
-	/* if error flagged then print it and exit */
-	if (errflg)
-		{
-		fprintf(stderr,"usage: %s\n", usage_message);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		error = MB_ERROR_BAD_USAGE;
-		exit(error);
-		}
-
-	/* print starting message */
-	if (verbose == 1 || help)
-		{
-		fprintf(stderr,"\nProgram %s\n",program_name);
-		fprintf(stderr,"Version %s\n",rcs_id);
-		fprintf(stderr,"MB-system Version %s\n",MB_VERSION);
-		}
-
-	/* set data type if not set properly */
-	if (datakind != MBFILTER_BATH && datakind != MBFILTER_AMP)
-		datakind = MBFILTER_SS;
-
-	/* print starting debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  Program <%s>\n",program_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Control Parameters:\n");
-		fprintf(stderr,"dbg2       verbose:        %d\n",verbose);
-		fprintf(stderr,"dbg2       help:           %d\n",help);
-		fprintf(stderr,"dbg2       pings:          %d\n",pings);
-		fprintf(stderr,"dbg2       lonflip:        %d\n",lonflip);
-		fprintf(stderr,"dbg2       bounds[0]:      %f\n",bounds[0]);
-		fprintf(stderr,"dbg2       bounds[1]:      %f\n",bounds[1]);
-		fprintf(stderr,"dbg2       bounds[2]:      %f\n",bounds[2]);
-		fprintf(stderr,"dbg2       bounds[3]:      %f\n",bounds[3]);
-		fprintf(stderr,"dbg2       btime_i[0]:     %d\n",btime_i[0]);
-		fprintf(stderr,"dbg2       btime_i[1]:     %d\n",btime_i[1]);
-		fprintf(stderr,"dbg2       btime_i[2]:     %d\n",btime_i[2]);
-		fprintf(stderr,"dbg2       btime_i[3]:     %d\n",btime_i[3]);
-		fprintf(stderr,"dbg2       btime_i[4]:     %d\n",btime_i[4]);
-		fprintf(stderr,"dbg2       btime_i[5]:     %d\n",btime_i[5]);
-		fprintf(stderr,"dbg2       btime_i[6]:     %d\n",btime_i[6]);
-		fprintf(stderr,"dbg2       etime_i[0]:     %d\n",etime_i[0]);
-		fprintf(stderr,"dbg2       etime_i[1]:     %d\n",etime_i[1]);
-		fprintf(stderr,"dbg2       etime_i[2]:     %d\n",etime_i[2]);
-		fprintf(stderr,"dbg2       etime_i[3]:     %d\n",etime_i[3]);
-		fprintf(stderr,"dbg2       etime_i[4]:     %d\n",etime_i[4]);
-		fprintf(stderr,"dbg2       etime_i[5]:     %d\n",etime_i[5]);
-		fprintf(stderr,"dbg2       etime_i[6]:     %d\n",etime_i[6]);
-		fprintf(stderr,"dbg2       speedmin:       %f\n",speedmin);
-		fprintf(stderr,"dbg2       timegap:        %f\n",timegap);
-		fprintf(stderr,"dbg2       data format:    %d\n",format);
-		fprintf(stderr,"dbg2       read_file:      %s\n",read_file);
-		fprintf(stderr,"dbg2       datakind:       %d\n",datakind);
-		fprintf(stderr,"dbg2       n_buffer_max:   %d\n",n_buffer_max);
-		fprintf(stderr,"dbg2       num_filters:    %d\n",num_filters);
-		for (i=0;i<num_filters;i++)
-			{
-			fprintf(stderr,"dbg2       filters[%d].mode:          %d\n",i,filters[i].mode);
-			fprintf(stderr,"dbg2       filters[%d].xdim:          %d\n",i,filters[i].xdim);
-			fprintf(stderr,"dbg2       filters[%d].ldim:          %d\n",i,filters[i].ldim);
-			fprintf(stderr,"dbg2       filters[%d].iteration:     %d\n",i,filters[i].iteration);
-			fprintf(stderr,"dbg2       filters[%d].threshold:     %d\n",i,filters[i].threshold);
-			fprintf(stderr,"dbg2       filters[%d].threshold_lo:  %f\n",i,filters[i].threshold_lo);
-			fprintf(stderr,"dbg2       filters[%d].threshold_hi:  %f\n",i,filters[i].threshold_hi);
-			fprintf(stderr,"dbg2       filters[%d].hipass_offset: %f\n",i,filters[i].hipass_offset);
-			}
-		}
-
-	/* if help desired then print it and exit */
-	if (help)
-		{
-		fprintf(stderr,"\n%s\n",help_message);
-		fprintf(stderr,"\nusage: %s\n", usage_message);
-		exit(error);
-		}
-
-	/* get format if required */
-	if (format == 0)
-		mb_get_format(verbose,read_file,NULL,&format,&error);
-
-	/* determine whether to read one file or a list of files */
-	if (format < 0)
-		read_datalist = MB_YES;
-
-	/* output some information */
-	if (verbose > 0)
-		{
-		if (datakind == MBFILTER_BATH)
-			fprintf(stderr, "\nProcessing bathymetry data...\n");
-		else if (datakind == MBFILTER_AMP)
-			fprintf(stderr, "\nProcessing beam amplitude data...\n");
-		else if (datakind == MBFILTER_SS)
-			fprintf(stderr, "\nProcessing sidescan data...\n");
-		fprintf(stderr, "Number of filters to be applied: %d\n\n", num_filters);
-		for (i=0;i<num_filters;i++)
-			{
-			if (filters[i].mode == MBFILTER_A_HIPASS_MEAN)
-				fprintf(stderr,"Filter %d: High pass mean subtraction\n",i);
-			else if (filters[i].mode == MBFILTER_A_HIPASS_GAUSSIAN)
-				fprintf(stderr,"Filter %d: High pass Gaussian subtraction\n",i);
-			else if (filters[i].mode == MBFILTER_A_HIPASS_MEDIAN)
-				fprintf(stderr,"Filter %d: High pass median subtraction\n",i);
-			else if (filters[i].mode == MBFILTER_A_SMOOTH_MEAN)
-				fprintf(stderr,"Filter %d: Low pass mean\n",i);
-			else if (filters[i].mode == MBFILTER_A_SMOOTH_GAUSSIAN)
-				fprintf(stderr,"Filter %d: Low pass Gaussian\n",i);
-			else if (filters[i].mode == MBFILTER_A_SMOOTH_MEDIAN)
-				fprintf(stderr,"Filter %d: Low pass median\n",i);
-			else if (filters[i].mode == MBFILTER_A_SMOOTH_GRADIENT)
-			 	fprintf(stderr,"Filter %d: Low pass gradient\n",i);
-			else if (filters[i].mode == MBFILTER_A_CONTRAST_EDGE)
-				fprintf(stderr,"Filter %d: Contrast edge\n",i);
-			else if (filters[i].mode == MBFILTER_A_CONTRAST_GRADIENT)
-				fprintf(stderr,"Filter %d: Contrast gradient\n",i);
-			fprintf(stderr, "          Acrosstrack dimension: %d\n", filters[i].xdim);
-			fprintf(stderr, "          Alongtrack dimension:  %d\n", filters[i].ldim);
-			fprintf(stderr, "          Iterations:            %d\n", filters[i].iteration);
-			if (filters[i].mode == MBFILTER_A_SMOOTH_MEDIAN)
-				{
-				if (filters[i].threshold == MB_YES)
-					{
-					fprintf(stderr, "          Threshold applied\n");
-					fprintf(stderr, "          Threshold_lo:          %f\n", filters[i].threshold_lo);
-					fprintf(stderr, "          Threshold_hi:          %f\n", filters[i].threshold_hi);
-					}
-				else
-					{
-					fprintf(stderr, "          Threshold not applied\n");
-					}
-				}
-			if (filters[i].mode >= MBFILTER_A_HIPASS_MEAN
-				&& filters[i].mode <= MBFILTER_A_HIPASS_MEDIAN)
-				{
-				fprintf(stderr, "          Hipass_offset:         %f\n", filters[i].hipass_offset);
-				}
-			fprintf(stderr, "\n");
-			}
-		}
-
-	/* open file list */
-	if (read_datalist == MB_YES)
-	    {
-	    if ((status = mb_datalist_open(verbose,&datalist,
-					    read_file,look_processed,&error)) != MB_SUCCESS)
-		{
-		error = MB_ERROR_OPEN_FAIL;
-		fprintf(stderr,"\nUnable to open data list file: %s\n",
-			read_file);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-	    if ((status = mb_datalist_read(verbose,datalist,
-			    file,&format,&file_weight,&error))
-			    == MB_SUCCESS)
-		read_data = MB_YES;
-	    else
-		read_data = MB_NO;
-	    }
-	/* else copy single filename to be read */
-	else
-	    {
-	    strcpy(file, read_file);
-	    read_data = MB_YES;
-	    }
-
-	/* loop over all files to be read */
-	while (read_data == MB_YES)
-	{
-
-	/* check for format with amplitude or sidescan data */
-	status = mb_format_system(verbose,&format,&system,&error);
-	status = mb_format_dimensions(verbose,&format,
-			&beams_bath,&beams_amp,&pixels_ss,&error);
-	/* if (datakind == MBFILTER_BATH
-		&& beams_bath <= 0)
-		{
-		fprintf(stderr,"\nProgram <%s> is in bathymetry mode.\n",program_name);
-		fprintf(stderr,"Format %d is unacceptable because it does not include sidescan data.\n",format);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		error = MB_ERROR_BAD_FORMAT;
-		exit(error);
-		}
-	if (datakind == MBFILTER_SS
-		&& pixels_ss <= 0)
-		{
-		fprintf(stderr,"\nProgram <%s> is in sidescan mode.\n",program_name);
-		fprintf(stderr,"Format %d is unacceptable because it does not include sidescan data.\n",format);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		error = MB_ERROR_BAD_FORMAT;
-		exit(error);
-		}
-	if (datakind == MBFILTER_AMP
-		&& beams_amp <= 0)
-		{
-		fprintf(stderr,"\nProgram <%s> is in amplitude mode.\n",program_name);
-		fprintf(stderr,"Format %d is unacceptable because it does not include amplitude data.\n",format);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		error = MB_ERROR_BAD_FORMAT;
-		exit(error);
-		}*/
-
-	/* initialize reading the input swath sonar file */
-	if ((status = mb_read_init(
-		verbose,file,format,pings,lonflip,bounds,
-		btime_i,etime_i,speedmin,timegap,
-		&imbio_ptr,&btime_d,&etime_d,
-		&beams_bath,&beams_amp,&pixels_ss,&error)) != MB_SUCCESS)
-		{
-		mb_error(verbose,error,&message);
-		fprintf(stderr,"\nMBIO Error returned from function <mb_read_init>:\n%s\n",message);
-		fprintf(stderr,"\nMultibeam File <%s> not initialized for reading\n",file);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-	imb_io_ptr = (struct mb_io_struct *) imbio_ptr;
-
-	/* initialize writing the output swath sonar file */
-	if (datakind == MBFILTER_BATH)
-		sprintf(ofile, "%s.ffb", file);
-	else if (datakind == MBFILTER_AMP)
-		sprintf(ofile, "%s.ffa", file);
-	else if (datakind == MBFILTER_SS)
-		sprintf(ofile, "%s.ffs", file);
-	if ((status = mb_write_init(
-		verbose,ofile,71,&ombio_ptr,
-		&obeams_bath,&obeams_amp,&opixels_ss,&error)) != MB_SUCCESS)
-		{
-		mb_error(verbose,error,&message);
-		fprintf(stderr,"\nMBIO Error returned from function <mb_write_init>:\n%s\n",message);
-		fprintf(stderr,"\nMultibeam File <%s> not initialized for writing\n",ofile);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-	omb_io_ptr = (struct mb_io_struct *) ombio_ptr;
-
-	/* allocate memory for data arrays */
-	for (i=0;i<n_buffer_max;i++)
-		{
-		ping[i].beamflag = NULL;
-		ping[i].bath = NULL;
-		ping[i].amp = NULL;
-		ping[i].bathacrosstrack = NULL;
-		ping[i].bathalongtrack = NULL;
-		ping[i].pixelflag = NULL;
-		ping[i].ss = NULL;
-		ping[i].ssacrosstrack = NULL;
-		ping[i].ssalongtrack = NULL;
-		ping[i].dataprocess = NULL;
-		ping[i].datasave = NULL;
-		ping[i].data_i_ptr = NULL;
-		ping[i].data_f_ptr = NULL;
-		ping[i].flag_ptr = NULL;
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							sizeof(char), (void **)&ping[i].beamflag, &error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							sizeof(double), (void **)&ping[i].bath, &error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_AMPLITUDE,
-							sizeof(double), (void **)&ping[i].amp, &error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							sizeof(double), (void **)&ping[i].bathacrosstrack, &error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							sizeof(double), (void **)&ping[i].bathalongtrack, &error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_SIDESCAN,
-							sizeof(char), (void **)&ping[i].pixelflag, &error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_SIDESCAN,
-							sizeof(double), (void **)&ping[i].ss, &error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_SIDESCAN,
-							sizeof(double), (void **)&ping[i].ssacrosstrack, &error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_SIDESCAN,
-							sizeof(double), (void **)&ping[i].ssalongtrack, &error);
-		if (datakind == MBFILTER_BATH)
-		    {
-		    ndatapts = beams_bath;
-		    if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							sizeof(double), (void **)&ping[i].dataprocess, &error);
-		    if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							sizeof(double), (void **)&ping[i].datasave, &error);
-		    }
-		else if (datakind == MBFILTER_AMP)
-		    {
-		    ndatapts = beams_amp;
-		    if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_AMPLITUDE,
-							sizeof(double), (void **)&ping[i].dataprocess, &error);
-		    if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_AMPLITUDE,
-							sizeof(double), (void **)&ping[i].datasave, &error);
-		    }
-		else if (datakind == MBFILTER_SS)
-		    {
-		    ndatapts = pixels_ss;
-		    if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_SIDESCAN,
-							sizeof(double), (void **)&ping[i].dataprocess, &error);
-		    if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_SIDESCAN,
-							sizeof(double), (void **)&ping[i].datasave, &error);
-		    }
-		}
-
-	/* get ideal number of ping records to hold */
-	nhold_ping = 1;
-	nweightmax = 1;
-	for (i=0;i<num_filters;i++)
-		{
-		nhold_ping = MAX(nhold_ping, filters[i].ldim);
-		nweightmax = MAX(nweightmax, filters[i].xdim * filters[i].ldim);
-		}
-
-	/* allocate memory for weights */
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_mallocd(verbose,__FILE__,__LINE__,nweightmax*sizeof(double),
-				(void **)&weights,&error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_mallocd(verbose,__FILE__,__LINE__,nweightmax*sizeof(double),
-				(void **)&values,&error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_mallocd(verbose,__FILE__,__LINE__,nweightmax*sizeof(double),
-				(void **)&distances,&error);
-
-	/* if error initializing memory then quit */
-	if (error != MB_ERROR_NO_ERROR)
-		{
-		mb_error(verbose,error,&message);
-		fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",message);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-				program_name);
-		exit(error);
-		}
-
-	/* write comments to beginning of output file */
-	kind = MB_DATA_COMMENT;
-	sprintf(comment,"Data filtered by program %s",
-		program_name);
-	status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-	sprintf(comment,"Version %s",rcs_id);
-	status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-	sprintf(comment,"MB-system Version %s",MB_VERSION);
-	status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-	right_now = time((time_t *)0);
-	strcpy(date,ctime(&right_now));
-        date[strlen(date)-1] = '\0';
-	if ((user_ptr = getenv("USER")) == NULL)
-		user_ptr = getenv("LOGNAME");
-	if (user_ptr != NULL)
-		strcpy(user,user_ptr);
-	else
-		strcpy(user, "unknown");
-	gethostname(host,MB_PATH_MAXLINE);
-	sprintf(comment,"Run by user <%s> on cpu <%s> at <%s>",
-		user,host,date);
-	status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-	if (datakind == MBFILTER_BATH)
-		{
-		sprintf(comment, "Processing bathymetry data...");
-		status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-		}
-	else if (datakind == MBFILTER_AMP)
-		{
-		sprintf(comment, "Processing beam amplitude data...");
-		status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-		}
-	else if (datakind == MBFILTER_SS)
-		{
-		sprintf(comment, "Processing sidescan data...");
-		status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-		}
-	if (hipass_mode == MBFILTER_HIPASS_MEAN)
-		{
-		sprintf(comment, "applying mean subtraction filter for hipass");
-		status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-		}
-	else if (hipass_mode == MBFILTER_HIPASS_GAUSSIAN)
-		{
-		sprintf(comment, "applying gaussian mean subtraction filter for hipass");
-		status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-		}
-	else if (hipass_mode == MBFILTER_HIPASS_MEDIAN)
-		{
-		sprintf(comment, "applying median subtraction filter for hipass");
-		status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-		}
-	if (hipass_mode != MBFILTER_HIPASS_NONE)
-		{
-		sprintf(comment, "  filter acrosstrack dimension: %d", hipass_xdim);
-		status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-		sprintf(comment, "  filter alongtrack dimension:  %d", hipass_ldim);
-		status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-		sprintf(comment, "  filter iterations:            %d", hipass_iter);
-		status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-		sprintf(comment, "  filter offset:                %f", hipass_offset);
-		status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-		}
-	if (smooth_mode == MBFILTER_SMOOTH_MEAN)
-		{
-		sprintf(comment, "applying mean filter for smoothing");
-		status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-		}
-	else if (smooth_mode == MBFILTER_SMOOTH_GAUSSIAN)
-		{
-		sprintf(comment, "applying gaussian mean filter for smoothing");
-		status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-		}
-	else if (smooth_mode == MBFILTER_SMOOTH_MEDIAN)
-		{
-		sprintf(comment, "applying median filter for smoothing");
-		status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-		}
-	else if (smooth_mode == MBFILTER_SMOOTH_GRADIENT)
-		{
-		sprintf(comment, "applying inverse gradient filter for smoothing");
-		status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-		}
-	if (smooth_mode == MBFILTER_SMOOTH_MEDIAN
-		&& apply_threshold == MB_YES)
-		{
-		sprintf(comment, "  filter low ratio threshold:   %f", threshold_lo);
-		status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-		sprintf(comment, "  filter high ratio threshold:  %f", threshold_hi);
-		status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-		}
-	if (smooth_mode != MBFILTER_SMOOTH_NONE)
-		{
-		sprintf(comment, "  filter acrosstrack dimension: %d", smooth_xdim);
-		status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-		sprintf(comment, "  filter alongtrack dimension:  %d", smooth_ldim);
-		status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-		sprintf(comment, "  filter iterations:            %d", smooth_iter);
-		status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-		}
-	if (contrast_mode == MBFILTER_CONTRAST_EDGE)
-		{
-		sprintf(comment, "applying edge detection filter for contrast enhancement");
-		status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-		}
-	else if (contrast_mode == MBFILTER_CONTRAST_GRADIENT)
-		{
-		sprintf(comment, "applying gradient subtraction filter for contrast enhancement");
-		status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-		}
-	if (contrast_mode != MBFILTER_CONTRAST_NONE)
-		{
-		sprintf(comment, "  filter acrosstrack dimension: %d", contrast_xdim);
-		status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-		sprintf(comment, "  filter alongtrack dimension:  %d", contrast_ldim);
-		status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-		sprintf(comment, "  filter iterations:            %d", contrast_iter);
-		status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-		}
-	strncpy(comment,"\0",256);
-	sprintf(comment,"Control Parameters:");
-	status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-	strncpy(comment,"\0",256);
-	sprintf(comment,"  MBIO data format:   %d",format);
-	status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-	strncpy(comment,"\0",256);
-	sprintf(comment,"  Input file:         %s",file);
-	status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-	strncpy(comment,"\0",256);
-	sprintf(comment,"  Output file:        %s",ofile);
-	status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-	strncpy(comment,"\0",256);
-	sprintf(comment,"  Longitude flip:     %d",lonflip);
-	status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-	strncpy(comment,"\0",256);
-	sprintf(comment,"  Data kind:         %d",datakind);
-	status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-	strncpy(comment,"\0",256);
-	sprintf(comment," ");
-	status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-
-	/* read and write */
-	done = MB_NO;
-	first = MB_YES;
-	ndata = 0;
-	nhold = 0;
-	nread = 0;
-	nwrite = 0;
-	while (!done)
-		{
-		/* load some data into the buffer */
-		error = MB_ERROR_NO_ERROR;
-		nload = 0;
-		nunload = 0;
-		nexpect = n_buffer_max - ndata;
-		while (status == MB_SUCCESS
-			&& ndata < n_buffer_max)
-			{
-			status = mb_get_all(verbose,imbio_ptr,&store_ptr,&kind,
-						ping[ndata].time_i,
-						&ping[ndata].time_d,
-						&ping[ndata].navlon,
-						&ping[ndata].navlat,
-						&ping[ndata].speed,
-						&ping[ndata].heading,
-						&ping[ndata].distance,
-						&ping[ndata].altitude,
-						&ping[ndata].sonardepth,
-						&ping[ndata].beams_bath,
-						&ping[ndata].beams_amp,
-						&ping[ndata].pixels_ss,
-						ping[ndata].beamflag,
-						ping[ndata].bath,
-						ping[ndata].amp,
-						ping[ndata].bathacrosstrack,
-						ping[ndata].bathalongtrack,
-						ping[ndata].ss,
-						ping[ndata].ssacrosstrack,
-						ping[ndata].ssalongtrack,
-						comment,&error);
-			if (status == MB_SUCCESS && kind == MB_DATA_DATA)
-				{
-				if (datakind == MBFILTER_SS)
-					{
-					for(i=0;i<ping[ndata].pixels_ss;i++)
-						{
-						if (ping[ndata].ss[i] > MB_SIDESCAN_NULL)
-							ping[ndata].pixelflag[i] = MB_FLAG_NONE;
-						else
-							ping[ndata].pixelflag[i] = MB_FLAG_NULL;
-						}
-					}
-				status = mb_extract_nav(verbose, imbio_ptr, store_ptr, &kind,
-						ping[ndata].time_i,
-						&ping[ndata].time_d,
-						&ping[ndata].navlon,
-						&ping[ndata].navlat,
-						&ping[ndata].speed,
-						&ping[ndata].heading,
-						&ping[ndata].sonardepth,
-						&ping[ndata].roll,
-						&ping[ndata].pitch,
-						&ping[ndata].heave,
-						&error);
-				status = mb_extract_altitude(verbose, imbio_ptr, store_ptr, &kind,
-						&ping[ndata].sonardepth,
-						&ping[ndata].altitude,
-						&error);
-				}
-			if (status == MB_SUCCESS && kind == MB_DATA_DATA)
-				{
-				ndata++;
-				nread++;
-				nreadtot++;
-				nload++;
-				}
-			if (status == MB_FAILURE && error < 0)
-				{
-				status = MB_SUCCESS;
-				error = MB_ERROR_NO_ERROR;
-				}
-			}
-		if (status == MB_FAILURE && error > 0)
-			{
-			status = MB_SUCCESS;
-			error = MB_ERROR_NO_ERROR;
-			done = MB_YES;
-			}
-
-		/* give the statistics */
-		if (verbose >= 1)
-			{
-			fprintf(stderr,"%d records loaded into buffer\n",nload);
-			fprintf(stderr,"%d records held in buffer\n",ndata);
-			}
-
-		/* get start of ping output range */
-		if (first == MB_YES)
-			{
-			jbeg = 0;
-			first = MB_NO;
-			}
-		else
-			jbeg = MIN(nhold/2+1, ndata);
-
-		/* find number of pings to hold */
-		if (done == MB_YES)
-			nhold = 0;
-		else if (ndata > nhold_ping)
-			nhold = nhold_ping;
-		else
-			nhold = 0;
-
-		/* get end of ping output range */
-		if (done == MB_YES)
-			jend = ndata - 1;
-		else
-			{
-			jend = ndata - 1 - nhold / 2;
-			}
-		if (jend < jbeg)
-			jend = jbeg;
-		if (verbose >= 1)
-			{
-			fprintf(stderr,"%d survey records being processed\n\n",
-				(jend - jbeg + 1));
-			}
-/*fprintf(stderr, "done:%d jbeg:%d jend:%d ndata:%d nhold_ping:%d nhold:%d\n",
-done, jbeg, jend, ndata, nhold_ping, nhold);*/
-
-		/* loop over all filters */
-		for (ifilter=0;ifilter<num_filters;ifilter++)
-			{
-			iteration = 0;
-			ndx = filters[ifilter].xdim / 2;
-			ndl = filters[ifilter].ldim / 2;
-
-			while (iteration < filters[ifilter].iteration)
-				{
-				if (verbose > 0)
-					fprintf(stderr, "Applying filter %d iteration %d of %d...\n",
-							ifilter+1,iteration+1, filters[ifilter].iteration);
-
-				/* set in and out data arrays */
-				for (j=0;j<ndata;j++)
-				  {
-				  if (datakind == MBFILTER_BATH)
-				    {
-				    ping[j].ndatapts = ping[j].beams_bath;
-				    ping[j].data_i_ptr = ping[j].bath;
-				    ping[j].flag_ptr = ping[j].beamflag;
-				    }
-				  else if (datakind == MBFILTER_AMP)
-				    {
-				    ping[j].ndatapts = ping[j].beams_amp;
-				    ping[j].data_i_ptr = ping[j].amp;
-				    ping[j].flag_ptr = ping[j].beamflag;
-				    }
-				  else if (datakind == MBFILTER_SS)
-				    {
-				    ping[j].ndatapts = ping[j].pixels_ss;
-				    ping[j].data_i_ptr = ping[j].ss;
-				    ping[j].flag_ptr = ping[j].pixelflag;
-				    }
-				  ping[j].data_f_ptr = ping[j].dataprocess;
-				  }
-
-				/* loop over all the data */
-				for (j=0;j<ndata;j++)
-				  {
-
-				  /* get beginning and end pings */
-				  ja = j - ndl;
-				  jb = j + ndl;
-				  if (ja < 0) ja = 0;
-				  if (jb >= ndata) jb = ndata - 1;
-
-				  /* get data arrays and sizes to be used */
-				  dataptr0 = ping[j].data_i_ptr;
-				  flagptr0 = ping[j].flag_ptr;
-				  ndatapts = ping[j].ndatapts;
-
-				  /* loop over each value */
-				  for (i=0;i<ndatapts;i++)
-				    {
-				    /* get beginning and end values */
-				    ia = i - ndx;
-				    ib = i + ndx;
-				    if (ia < 0) ia = 0;
-				    if (ib >= ndatapts) ib = ndatapts - 1;
-				    nweight = 0;
-
-				    /* construct arrays of values and weights */
-				    if (mb_beam_ok(flagptr0[i]))
-				      {
-				      /* use primary value if valid */
-				      nweight = 1;
-				      values[0] = dataptr0[i];
-				      distances[0] = 0.0;
-
-				      /* loop over surrounding pings and values */
-				      for (jj=ja;jj<=jb;jj++)
-		        		for (ii=ia;ii<=ib;ii++)
-		        		  {
-					  dataptr1 = ping[jj].data_i_ptr;
-					  flagptr1 = ping[jj].flag_ptr;
-					  if ((jj != j || ii != i)
-					    && mb_beam_ok(flagptr1[ii]))
-					    {
-					    values[nweight] = dataptr1[ii];
-					    ddis = 0.0;
-					    if (ndx > 0)
-						ddis += (ii - i)*(ii - i)/(ndx*ndx);
-					    if (ndl > 0)
-						ddis += (jj - j)*(jj - j)/(ndl*ndl);
-					    distances[nweight] = sqrt(ddis);
-					    nweight++;
-					    }
-					  }
-				      }
-
-				    /* get filtered value */
-				    if (nweight > 0)
-				      {
-				      if (filters[ifilter].mode == MBFILTER_A_HIPASS_MEAN)
-		        		hipass_mean(verbose, nweight, values,
-						weights,
-						&ping[j].data_f_ptr[i], &error);
-				      else if (filters[ifilter].mode == MBFILTER_A_HIPASS_GAUSSIAN)
-		        		hipass_gaussian(verbose, nweight, values,
-						weights, distances,
-						&ping[j].data_f_ptr[i], &error);
-				      else if (filters[ifilter].mode == MBFILTER_A_HIPASS_MEDIAN)
-		        		hipass_median(verbose, nweight, values,
-						weights,
-						&ping[j].data_f_ptr[i], &error);
-				      else if (filters[ifilter].mode == MBFILTER_A_SMOOTH_MEAN)
-		        		smooth_mean(verbose, nweight, values, weights,
-						&ping[j].data_f_ptr[i], &error);
-				      else if (filters[ifilter].mode == MBFILTER_A_SMOOTH_GAUSSIAN)
-		        		smooth_gaussian(verbose, nweight, values,
-						weights, distances,
-						&ping[j].data_f_ptr[i], &error);
-				      else if (filters[ifilter].mode == MBFILTER_A_SMOOTH_MEDIAN)
-		        		smooth_median(verbose, dataptr0[i],
-						filters[ifilter].threshold,
-						filters[ifilter].threshold_lo,
-						filters[ifilter].threshold_hi,
-						nweight, values, weights,
-						&ping[j].data_f_ptr[i], &error);
-				      else if (filters[ifilter].mode == MBFILTER_A_SMOOTH_GRADIENT)
-		        		smooth_gradient(verbose, nweight, values, weights,
-						&ping[j].data_f_ptr[i], &error);
-				      else if (filters[ifilter].mode == MBFILTER_A_CONTRAST_EDGE)
-		        		contrast_edge(verbose, nweight, values, weights,
-						&ping[j].data_f_ptr[i], &error);
-				      else if (filters[ifilter].mode == MBFILTER_A_CONTRAST_GRADIENT)
-		        		contrast_gradient(verbose, nweight, values, weights,
-						&ping[j].data_f_ptr[i], &error);
-				      }
-				    else
-				      {
-				      ping[j].data_f_ptr[i] = MB_SIDESCAN_NULL;
-				      }
-				    }
-
-				  /* print out progress */
-		/*		  if (verbose > 0)
-				    fprintf(stderr, "done with ping %d of %d\n",
-					(j-jbeg+1), (jend-jbeg+1));*/
-				  }
-
-				/* reset initial array and add offset
-				    if done with final iteration */
-				if (iteration == filters[ifilter].iteration-1)
-				  for (j=0;j<ndata;j++)
-				    for (i=0;i<ping[j].ndatapts;i++)
-					ping[j].data_i_ptr[i] = ping[j].data_f_ptr[i]
-						+ filters[ifilter].hipass_offset;
-				else
-				  for (j=0;j<ndata;j++)
-				    for (i=0;i<ping[j].ndatapts;i++)
-					ping[j].data_i_ptr[i] = ping[j].data_f_ptr[i];
-
-				/* save results if done with final iteration */
-				if (ndata > 0 && iteration == filters[ifilter].iteration-1)
-				  {
-				  for (j=jbeg;j<=jend;j++)
-				    for (i=0;i<ping[j].ndatapts;i++)
-					ping[j].datasave[i] = ping[j].data_i_ptr[i];
-				  }
-
-				iteration++;
-				}
-			}
-
-		/* output pings to be cleared from buffer */
-		if (ndata > 0)
-		for (j=jbeg;j<=jend;j++)
-		  {
-		  if (datakind == MBFILTER_BATH)
-			{
-			status = mbcopy_any_to_mbldeoih(verbose, system,
-				MB_DATA_DATA, ping[j].time_i, ping[j].time_d,
-				ping[j].navlon, ping[j].navlat,
-				ping[j].speed, ping[j].heading,
-				ping[j].sonardepth, ping[j].altitude,
-				ping[j].roll, ping[j].pitch, ping[j].heave,
-				imb_io_ptr->beamwidth_xtrack,
-				imb_io_ptr->beamwidth_ltrack,
-				ping[j].beams_bath,
-				0,
-				0,
-				ping[j].beamflag,
-				ping[j].datasave,
-				ping[j].amp,
-				ping[j].bathacrosstrack,
-				ping[j].bathalongtrack,
-				ping[j].ss,
-				ping[j].ssacrosstrack,
-				ping[j].ssalongtrack,
-				comment,
-				ombio_ptr, omb_io_ptr->store_data, &error);
-			}
-		  else if (datakind == MBFILTER_AMP)
-			{
-			status = mbcopy_any_to_mbldeoih(verbose, system,
-				MB_DATA_DATA, ping[j].time_i, ping[j].time_d,
-				ping[j].navlon, ping[j].navlat,
-				ping[j].speed, ping[j].heading,
-				ping[j].sonardepth, ping[j].altitude,
-				ping[j].roll, ping[j].pitch, ping[j].heave,
-				imb_io_ptr->beamwidth_xtrack,
-				imb_io_ptr->beamwidth_ltrack,
-				ping[j].beams_bath,
-				ping[j].beams_amp,
-				0,
-				ping[j].beamflag,
-				ping[j].bath,
-				ping[j].datasave,
-				ping[j].bathacrosstrack,
-				ping[j].bathalongtrack,
-				ping[j].ss,
-				ping[j].ssacrosstrack,
-				ping[j].ssalongtrack,
-				comment,
-				ombio_ptr, omb_io_ptr->store_data, &error);
-			}
-
-		  else if (datakind == MBFILTER_SS)
-			{
-			status = mbcopy_any_to_mbldeoih(verbose, system,
-				MB_DATA_DATA, ping[j].time_i, ping[j].time_d,
-				ping[j].navlon, ping[j].navlat,
-				ping[j].speed, ping[j].heading,
-				ping[j].sonardepth, ping[j].altitude,
-				ping[j].roll, ping[j].pitch, ping[j].heave,
-				imb_io_ptr->beamwidth_xtrack,
-				imb_io_ptr->beamwidth_ltrack,
-				ping[j].beams_bath,
-				0,
-				ping[j].pixels_ss,
-				ping[j].beamflag,
-				ping[j].bath,
-				ping[j].amp,
-				ping[j].bathacrosstrack,
-				ping[j].bathalongtrack,
-				ping[j].datasave,
-				ping[j].ssacrosstrack,
-				ping[j].ssalongtrack,
-				comment,
-				ombio_ptr, omb_io_ptr->store_data, &error);
-			}
-
-		  /* write the data */
-/*fprintf(stderr,"calling mb_write_ping datakind:%d verbose:%d nwrite:%d\n",datakind,verbose,nwrite);*/
-		  status = mb_write_ping(verbose,ombio_ptr,omb_io_ptr->store_data,&error);
-		  if (status == MB_SUCCESS)
-		  	{
-		 	nunload++;
-		 	nwrite++;
-			nwritetot++;
-			}
-/*verbose = 1;
-fprintf(stderr,"nunload:%d nwrite:%d verbose:%d error:%d pointers: %d %d\n",
-nunload,nwrite,verbose,error,ombio_ptr,omb_io_ptr->store_data);*/
-		  }
-
-		/* save processed data in buffer */
-		if (ndata > nhold)
-			{
-			for (j=0;j<nhold;j++)
-			      {
-			      jj = ndata - nhold + j;
-			      for (i=0;i<7;i++)
-		      		ping[j].time_i[i] = ping[jj].time_i[i];
-			      ping[j].time_d = ping[jj].time_d;
-			      ping[j].navlon = ping[jj].navlon;
-			      ping[j].navlat = ping[jj].navlat;
-			      ping[j].speed = ping[jj].speed;
-			      ping[j].heading = ping[jj].heading;
-			      ping[j].distance = ping[jj].distance;
-			      ping[j].altitude = ping[jj].altitude;
-			      ping[j].sonardepth = ping[jj].sonardepth;
-			      ping[j].roll = ping[jj].roll;
-			      ping[j].pitch = ping[jj].pitch;
-			      ping[j].heave = ping[jj].heave;
-			      ping[j].beams_bath = ping[jj].beams_bath;
-			      ping[j].beams_amp = ping[jj].beams_amp;
-			      ping[j].pixels_ss = ping[jj].pixels_ss;
-			      for (i=0;i<ping[j].beams_bath;i++)
-		      		{
-				ping[j].beamflag[i] = ping[jj].beamflag[i];
-				ping[j].bath[i] = ping[jj].bath[i];
-				ping[j].bathacrosstrack[i] = ping[jj].bathacrosstrack[i];
-				ping[j].bathalongtrack[i] = ping[jj].bathalongtrack[i];
-				}
-			      for (i=0;i<ping[j].beams_amp;i++)
-		      		{
-				ping[j].amp[i] = ping[jj].amp[i];
-				}
-			      for (i=0;i<ping[j].pixels_ss;i++)
-		      		{
-				ping[j].pixelflag[i] = ping[jj].pixelflag[i];
-				ping[j].ss[i] = ping[jj].ss[i];
-				ping[j].ssacrosstrack[i] = ping[jj].ssacrosstrack[i];
-				ping[j].ssalongtrack[i] = ping[jj].ssalongtrack[i];
-				}
-			      for (i=0;i<ping[jj].ndatapts;i++)
-				ping[j].datasave[i] = ping[jj].datasave[i];
-			      }
-			ndata = nhold;
-			}
-
-		/* give the statistics */
-		if (verbose >= 1)
-			{
-			fprintf(stderr,"\n%d records written from buffer\n",nunload);
-			fprintf(stderr,"%d records saved in buffer\n\n",ndata);
-			}
-		}
-
-	/* close the files */
-	status = mb_close(verbose,&imbio_ptr,&error);
-	status = mb_close(verbose,&ombio_ptr,&error);
-
-	/* give the statistics */
-	if (verbose >= 1)
-		{
-		fprintf(stderr,"%d data records read from:  %s\n",nread,file);
-		fprintf(stderr,"%d data records written to: %s\n\n",nwrite,ofile);
-		}
-
-	/* figure out whether and what to read next */
-        if (read_datalist == MB_YES)
-                {
-		if ((status = mb_datalist_read(verbose,datalist,
-			    file,&format,&file_weight,&error))
-			    == MB_SUCCESS)
-                        read_data = MB_YES;
-                else
-                        read_data = MB_NO;
-                }
-        else
-                {
-                read_data = MB_NO;
-                }
-
-	/* end loop over files in list */
-	}
-	if (read_datalist == MB_YES)
-		mb_datalist_close(verbose,&datalist,&error);
-
-	/* check memory */
-	if (verbose >= 4)
-		status = mb_memory_list(verbose,&error);
-
-	/* give the statistics */
-	if (verbose >= 1)
-		{
-		fprintf(stderr,"%d total data records read\n",nreadtot);
-		fprintf(stderr,"%d total data records written\n",nwritetot);
-		}
-
-	/* end it all */
-	exit(error);
-}
-/*--------------------------------------------------------------------*/
-int hipass_mean(int verbose, int n, double *val, double *wgt,
-		double *hipass, int *error)
-{
-	char	*function_name = "hipass_mean";
-	int	status = MB_SUCCESS;
-	int	i, nn;
-
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBFILTER function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:         %d\n",verbose);
-		fprintf(stderr,"dbg2       n:               %d\n",n);
-		fprintf(stderr,"dbg2       val:             %p\n",(void *)val);
-		fprintf(stderr,"dbg2       wgt:             %p\n",(void *)wgt);
-		for (i=0;i<n;i++)
-			fprintf(stderr,"dbg2       val[%d]: %f\n", i, val[i]);
-		}
-
-	/* get mean */
-	*hipass = 0.0;
-	nn = 0;
-	for (i=0;i<n;i++)
-		{
-		*hipass += val[i];
-		nn++;
-		}
-	if (nn > 0)
-		*hipass = val[0] - *hipass/nn;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBFILTER function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       hipass:          %f\n",*hipass);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:          %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int hipass_gaussian(int verbose, int n, double *val, double *wgt, double *dis,
-		double *hipass, int *error)
-{
-	char	*function_name = "hipass_gaussian";
-	int	status = MB_SUCCESS;
-	double	wgtsum;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBFILTER function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:         %d\n",verbose);
-		fprintf(stderr,"dbg2       n:               %d\n",n);
-		fprintf(stderr,"dbg2       val:             %p\n",(void *)val);
-		fprintf(stderr,"dbg2       wgt:             %p\n",(void *)wgt);
-		fprintf(stderr,"dbg2       dis:             %p\n",(void *)dis);
-		for (i=0;i<n;i++)
-			fprintf(stderr,"dbg2       val[%d]: %f  dis[%d]: %f\n",
-				i, val[i], i, dis[i]);
-		}
-
-	/* get weights */
-	*hipass = 0.0;
-	wgtsum = 0.0;
-	for (i=0;i<n;i++)
-		{
-		wgt[i] = exp(-dis[i]*dis[i]);
-		wgtsum += wgt[i];
-		}
-
-	if (wgtsum > 0.0)
-		{
-		/* get value */
-		*hipass = 0.0;
-		for (i=0;i<n;i++)
-			{
-			*hipass += wgt[i]*val[i];
-			}
-		*hipass = val[0] - *hipass/wgtsum;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBFILTER function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       hipass:          %f\n",*hipass);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:          %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int hipass_median(int verbose, int n, double *val, double *wgt,
-		double *hipass, int *error)
-{
-	char	*function_name = "hipass_median";
-	int	status = MB_SUCCESS;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBFILTER function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:         %d\n",verbose);
-		fprintf(stderr,"dbg2       n:               %d\n",n);
-		fprintf(stderr,"dbg2       val:             %p\n",(void *)val);
-		fprintf(stderr,"dbg2       wgt:             %p\n",(void *)wgt);
-		for (i=0;i<n;i++)
-			fprintf(stderr,"dbg2       val[%d]: %f\n", i, val[i]);
-		}
-
-	/* start */
-	*hipass = 0.0;
-
-	/* sort values and get median value */
-	if (n > 0)
-		{
-		qsort((char *)val,n,sizeof(double),(void *)mb_double_compare);
-		*hipass = val[0] - val[n/2];
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBFILTER function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       hipass:          %f\n",*hipass);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:          %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int smooth_mean(int verbose, int n, double *val, double *wgt,
-		double *smooth, int *error)
-{
-	char	*function_name = "smooth_mean";
-	int	status = MB_SUCCESS;
-	int	i, nn;
-
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBFILTER function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:         %d\n",verbose);
-		fprintf(stderr,"dbg2       n:               %d\n",n);
-		fprintf(stderr,"dbg2       val:             %p\n",(void *)val);
-		fprintf(stderr,"dbg2       wgt:             %p\n",(void *)wgt);
-		for (i=0;i<n;i++)
-			fprintf(stderr,"dbg2       val[%d]: %f\n", i, val[i]);
-		}
-
-	/* get mean */
-	*smooth = 0.0;
-	nn = 0;
-	for (i=0;i<n;i++)
-		{
-		*smooth += val[i];
-		nn++;
-		}
-	if (nn > 0)
-		*smooth = *smooth/nn;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBFILTER function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       smooth:          %f\n",*smooth);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:          %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int smooth_gaussian(int verbose, int n, double *val, double *wgt, double *dis,
-		double *smooth, int *error)
-{
-	char	*function_name = "smooth_gaussian";
-	int	status = MB_SUCCESS;
-	double	wgtsum;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBFILTER function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:         %d\n",verbose);
-		fprintf(stderr,"dbg2       n:               %d\n",n);
-		fprintf(stderr,"dbg2       val:             %p\n",(void *)val);
-		fprintf(stderr,"dbg2       wgt:             %p\n",(void *)wgt);
-		fprintf(stderr,"dbg2       dis:             %p\n",(void *)dis);
-		for (i=0;i<n;i++)
-			fprintf(stderr,"dbg2       val[%d]: %f  dis[%d]: %f\n",
-				i, val[i], i, dis[i]);
-		}
-
-	/* get weights */
-	*smooth = 0.0;
-	wgtsum = 0.0;
-	for (i=0;i<n;i++)
-		{
-		wgt[i] = exp(-dis[i]*dis[i]);
-		wgtsum += wgt[i];
-		}
-
-	if (wgtsum > 0.0)
-		{
-		/* get value */
-		*smooth = 0.0;
-		for (i=0;i<n;i++)
-			{
-			*smooth += wgt[i]*val[i];
-			}
-		*smooth = *smooth/wgtsum;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBFILTER function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       smooth:          %f\n",*smooth);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:          %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int smooth_median(int verbose, double original,
-		int apply_threshold, double threshold_lo, double threshold_hi,
-		int n, double *val, double *wgt,
-		double *smooth, int *error)
-{
-	char	*function_name = "smooth_median";
-	int	status = MB_SUCCESS;
-	double	ratio;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBFILTER function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:         %d\n",verbose);
-		fprintf(stderr,"dbg2       original:        %f\n",original);
-		fprintf(stderr,"dbg2       apply_threshold: %d\n",apply_threshold);
-		fprintf(stderr,"dbg2       n:               %d\n",n);
-		fprintf(stderr,"dbg2       val:             %p\n",(void *)val);
-		fprintf(stderr,"dbg2       wgt:             %p\n",(void *)wgt);
-		for (i=0;i<n;i++)
-			fprintf(stderr,"dbg2       val[%d]: %f\n", i, val[i]);
-		}
-
-	/* start */
-	*smooth = 0.0;
-
-	/* sort values and get median value */
-	if (n > 0)
-		{
-		qsort((char *)val,n,sizeof(double),(void *)mb_double_compare);
-		*smooth = val[n/2];
-		}
-
-	/* apply thresholding */
-	if (apply_threshold == MB_YES)
-		{
-		ratio = original/(*smooth);
-		if (ratio < threshold_hi
-			&& ratio > threshold_lo)
-			{
-/*fprintf(stderr,"IGNORE MEDIAN FILTER: ratio:%f threshold:%f %f original:%f smooth:%f\n",
-ratio, threshold_lo, threshold_hi, original, *smooth);*/
-			*smooth = original;
-			}
-/*else
-fprintf(stderr,"** APPLY MEDIAN FILTER: ratio:%f threshold:%f %f original:%f smooth:%f\n",
-ratio, threshold_lo, threshold_hi, original, *smooth);*/
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBFILTER function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       smooth:          %f\n",*smooth);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:          %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int smooth_gradient(int verbose, int n, double *val, double *wgt,
-		double *smooth, int *error)
-{
-	char	*function_name = "smooth_gradient";
-	int	status = MB_SUCCESS;
-	double	wgtsum;
-	double	diff;
-	int	i, nn;
-
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBFILTER function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:         %d\n",verbose);
-		fprintf(stderr,"dbg2       n:               %d\n",n);
-		fprintf(stderr,"dbg2       val:             %p\n",(void *)val);
-		fprintf(stderr,"dbg2       wgt:             %p\n",(void *)wgt);
-		for (i=0;i<n;i++)
-			fprintf(stderr,"dbg2       val[%d]: %f\n", i, val[i]);
-		}
-
-	/* get weights */
-	*smooth = 0.0;
-	wgtsum = 0.0;
-	nn = 0;
-	wgt[0] = 0.5;
-	for (i=1;i<n;i++)
-		{
-		diff = fabs(val[i] - val[0]);
-		if (diff < 0.01)
-			diff = 0.01;
-		wgt[i] = 1.0/diff;
-		wgtsum += wgt[i];
-		nn++;
-		}
-	if (nn > 0)
-		{
-		*smooth = wgt[0]*val[0];
-		for (i=1;i<n;i++)
-			{
-			*smooth += 0.5*wgt[i]*val[i]/wgtsum;
-			}
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBFILTER function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       smooth:          %f\n",*smooth);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:          %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int contrast_edge(int verbose, int n, double *val, double *grad,
-		double *result, int *error)
-{
-	char	*function_name = "contrast_edge";
-	int	status = MB_SUCCESS;
-	double	edge;
-	double	gradsum;
-	double	contrast;
-	int	i, ii;
-
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBFILTER function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:         %d\n",verbose);
-		fprintf(stderr,"dbg2       n:               %d\n",n);
-		fprintf(stderr,"dbg2       val:             %p\n",(void *)val);
-		fprintf(stderr,"dbg2       grad:            %p\n",(void *)grad);
-		for (i=0;i<n;i++)
-			fprintf(stderr,"dbg2       val[%d]: %f\n", i, val[i]);
-		}
-
-	/* get gradients */
-	gradsum = 0.0;
-	edge = 0.0;
-	for (i=0;i<n;i++)
-	    {
-	    grad[i] = 0.0;
-	    for (ii=0;ii<n;ii++)
-		    {
-		    if (val[ii] > 0.0 && i != ii)
-			    {
-			    grad[i] += (val[ii] - val[i]) * (val[ii] - val[i]);
-			    }
-		    }
-	    gradsum += grad[i];
-	    edge += val[i] * grad[i];
-	    }
-	edge = edge / gradsum;
-	contrast = pow((fabs(val[0] - edge) / fabs(val[0] + edge)), 0.75);
-	if (val[0] >= edge)
-	    *result = edge * (1.0 + contrast) / (1.0 - contrast);
-	else
-	    *result = edge * (1.0 - contrast) / (1.0 + contrast);
-/*fprintf(stderr, "val: %f %f  edge:%f contrast:%f\n",
-val[0], *result, edge, contrast);*/
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBFILTER function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       result:          %f\n",*result);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:          %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int contrast_gradient(int verbose, int n, double *val, double *wgt,
-		double *result, int *error)
-{
-	char	*function_name = "contrast_gradient";
-	int	status = MB_SUCCESS;
-	double	gradient;
-	int	i, nn;
-
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBFILTER function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:         %d\n",verbose);
-		fprintf(stderr,"dbg2       n:               %d\n",n);
-		fprintf(stderr,"dbg2       val:             %p\n",(void *)val);
-		fprintf(stderr,"dbg2       wgt:             %p\n",(void *)wgt);
-		for (i=0;i<n;i++)
-			fprintf(stderr,"dbg2       val[%d]: %f\n", i, val[i]);
-		}
-
-	/* get weights */
-	*result = 0.0;
-	gradient = 0.0;
-	nn = 0;
-	for (i=1;i<n;i++)
-		{
-		gradient += (val[i] - val[0]) * (val[i] - val[0]);
-		nn++;
-		}
-	gradient = sqrt(gradient);
-	*result = val[0] - 2 * gradient;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBFILTER function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       result:          %f\n",*result);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:          %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbcopy_any_to_mbldeoih(int verbose, int system,
-		int kind, int *time_i, double time_d,
-		double navlon, double navlat, double speed, double heading,
-		double draft, double altitude,
-		double roll, double pitch, double heave,
-		double	beamwidth_xtrack, double beamwidth_ltrack,
-		int nbath, int namp, int nss,
-		char *beamflag, double *bath, double *amp,
-		double *bathacrosstrack, double *bathalongtrack,
-		double *ss, double *ssacrosstrack, double *ssalongtrack,
-		char *comment,
-		char *ombio_ptr, char *ostore_ptr,
-		int *error)
-{
-	char	*function_name = "mbcopy_any_to_mbldeoih";
-	int	status = MB_SUCCESS;
-	struct mbsys_ldeoih_struct *ostore;
-	int	i;
-
-	/* get data structure pointer */
-	ostore = (struct mbsys_ldeoih_struct *) ostore_ptr;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBcopy function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       ombio_ptr:  %p\n",(void *)ombio_ptr);
-		fprintf(stderr,"dbg2       ostore_ptr: %p\n",(void *)ostore_ptr);
-		fprintf(stderr,"dbg2       system:     %d\n",system);
-		fprintf(stderr,"dbg2       kind:       %d\n",kind);
-		}
-	if (verbose >= 2 && (kind == MB_DATA_DATA || kind == MB_DATA_NAV))
-		{
-		fprintf(stderr,"dbg2       time_i[0]:  %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:  %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:  %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:  %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:  %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:  %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:  %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:     %f\n",time_d);
-		fprintf(stderr,"dbg2       navlon:     %f\n",navlon);
-		fprintf(stderr,"dbg2       navlat:     %f\n",navlat);
-		fprintf(stderr,"dbg2       speed:      %f\n",speed);
-		fprintf(stderr,"dbg2       heading:    %f\n",heading);
-		fprintf(stderr,"dbg2       draft:      %f\n",draft);
-		fprintf(stderr,"dbg2       altitude:   %f\n",altitude);
-		fprintf(stderr,"dbg2       roll:       %f\n",roll);
-		fprintf(stderr,"dbg2       pitch:      %f\n",pitch);
-		fprintf(stderr,"dbg2       heave:      %f\n",heave);
-		fprintf(stderr,"dbg2       beamwidth_xtrack: %f\n",beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack: %f\n",beamwidth_ltrack);
-		}
-	if (verbose >= 2 && kind == MB_DATA_DATA)
-		{
-		fprintf(stderr,"dbg2       nbath:      %d\n",
-			nbath);
-		if (verbose >= 3)
-		 for (i=0;i<nbath;i++)
-		  fprintf(stderr,"dbg3       beam:%d  flag:%3d  bath:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,beamflag[i],bath[i],
-			bathacrosstrack[i],bathalongtrack[i]);
-		fprintf(stderr,"dbg2       namp:       %d\n",namp);
-		if (verbose >= 3)
-		 for (i=0;i<namp;i++)
-		  fprintf(stderr,"dbg3        beam:%d   amp:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,amp[i],bathacrosstrack[i],bathalongtrack[i]);
-		fprintf(stderr,"dbg2        nss:       %d\n",nss);
-		if (verbose >= 3)
-		 for (i=0;i<nss;i++)
-		  fprintf(stderr,"dbg3        pixel:%d   ss:%f  acrosstrack:%f  alongtrack:%f\n",
-			i,ss[i],ssacrosstrack[i],ssalongtrack[i]);
-		}
-	if (verbose >= 2 && kind == MB_DATA_COMMENT)
-		{
-		fprintf(stderr,"dbg2       comment:     \ndbg2       %s\n",
-			comment);
-		}
-
-	/* copy the data  */
-	if (ostore != NULL)
-		{
-		/* set beam widths */
-		ostore->beam_xwidth = beamwidth_xtrack;
-		ostore->beam_lwidth = beamwidth_ltrack;
-		if (system == MB_SYS_SB2100)
-			ostore->ss_type = MB_SIDESCAN_LINEAR;
-		else
-			ostore->ss_type = MB_SIDESCAN_LOGARITHMIC;
-		ostore->kind = kind;
-
-		/* insert data */
-		if (kind == MB_DATA_DATA)
-		        {
-			mb_insert_altitude(verbose, ombio_ptr, (void *)ostore,
-					draft, altitude,
-					error);
-			mb_insert_nav(verbose, ombio_ptr, (void *)ostore,
-					time_i, time_d,
-					navlon, navlat, speed, heading, draft,
-					roll, pitch, heave,
-					error);
-			}
-		status = mb_insert(verbose, ombio_ptr, (void *)ostore,
-				kind, time_i, time_d,
-				navlon, navlat, speed, heading,
-				nbath,namp,nss,
-				beamflag,bath,amp,bathacrosstrack,
-				bathalongtrack,
-				ss,ssacrosstrack,ssalongtrack,
-				comment, error);
-
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBcopy function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/utilities/mbformat.c b/src/utilities/mbformat.c
deleted file mode 100644
index e4f4918..0000000
--- a/src/utilities/mbformat.c
+++ /dev/null
@@ -1,420 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbformat.c	1/22/93
- *    $Id: mbformat.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1993-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * MBFORMAT provides a description of the swath data format
- * associated with a particular MBIO format identifier.  If
- * no format is specified, MBFORMAT will list descriptions of all
- * the currently supported formats.
- *
- * Author:	D. W. Caress
- * Date:	January 22, 1993
- *
- * $Log: mbformat.c,v $
- * Revision 5.9  2008/10/17 07:52:44  caress
- * Check in on October 17, 2008.
- *
- * Revision 5.8  2006/01/18 15:17:00  caress
- * Added stdlib.h include.
- *
- * Revision 5.7  2003/04/17 21:17:10  caress
- * Release 5.0.beta30
- *
- * Revision 5.6  2003/02/27 04:43:23  caress
- * Added -K option for output of fileroots.
- *
- * Revision 5.5  2002/10/02 23:56:06  caress
- * Release 5.0.beta24
- *
- * Revision 5.4  2001/07/21 22:04:10  caress
- * Made the -i and -f options work better.
- *
- * Revision 5.3  2001/07/20 17:05:25  caress
- * Set mbformat to output accurate format update date with
- * -W option (html output).
- *
- * Revision 5.2  2001/04/25  05:39:43  caress
- * Fixed -W option so html page looks right (white background).
- *
- * Revision 5.1  2001/03/22 21:14:16  caress
- * Trying to make release 5.0.beta0.
- *
- * Revision 5.0  2000/12/01  22:57:08  caress
- * First cut at Version 5.0.
- *
- * Revision 4.10  2000/10/11  01:06:15  caress
- * Convert to ANSI C
- *
- * Revision 4.9  2000/09/30  07:06:28  caress
- * Snapshot for Dale.
- *
- * Revision 4.8  1998/10/05  19:19:24  caress
- * MB-System version 4.6beta
- *
- * Revision 4.7  1997/04/21  17:19:14  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.6  1996/04/22  13:23:05  caress
- * Now have DTR and MIN/MAX defines in mb_define.h
- *
- * Revision 4.6  1996/04/22  13:23:05  caress
- * Now have DTR and MIN/MAX defines in mb_define.h
- *
- * Revision 4.5  1995/05/12  17:12:32  caress
- * Made exit status values consistent with Unix convention.
- * 0: ok  nonzero: error
- *
- * Revision 4.4  1995/04/12  16:25:54  caress
- * Added -A and -L options.
- *
- * Revision 4.3  1995/03/06  19:37:59  caress
- * Changed include strings.h to string.h for POSIX compliance.
- *
- * Revision 4.2  1994/10/21  13:02:31  caress
- * Release V4.0
- *
- * Revision 4.1  1994/03/12  01:44:37  caress
- * Added declarations of ctime and/or getenv for compatability
- * with SGI compilers.
- *
- * Revision 4.0  1994/03/06  00:13:22  caress
- * First cut at version 4.0
- *
- * Revision 4.0  1994/03/01  18:59:27  caress
- * First cut at new version. Any changes are associated with
- * support of three data types (beam bathymetry, beam amplitude,
- * and sidescan) instead of two (bathymetry and backscatter).
- *
- * Revision 3.0  1993/05/04  22:38:45  dale
- * Inital version.
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_format.h"
-#include "mb_status.h"
-#include "mb_define.h"
-
-/* local defines */
-#define MBFORMAT_LIST_LONG	0
-#define MBFORMAT_LIST_SIMPLE	1
-#define MBFORMAT_LIST_ROOT	2
-
-static char rcs_id[] = "$Id: mbformat.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-
-int main (int argc, char **argv)
-{
-	/* id variables */
-	char program_name[] = "MBFORMAT";
-	char help_message[] = "MBFORMAT is an utility which identifies the swath data formats \nassociated with MBIO format id's.  If no format id is specified, \nMBFORMAT lists all of the currently supported formats.";
-	char usage_message[] = "mbformat [-Fformat -Ifile -L -W -V -H]";
-
-	/* parsing variables */
-	extern char *optarg;
-	int	errflg = 0;
-	int	c;
-	int	error = MB_ERROR_NO_ERROR;
-	int	status;
-	int	help;
-	int	html;
-	int	verbose;
-	char	file[MB_PATH_MAXLINE];
-	char	root[MB_PATH_MAXLINE];
-	int	file_specified;
-	int	format;
-	int	format_save;
-	int	format_specified;
-	char	format_description[MB_DESCRIPTION_LENGTH];
-	char	*format_informal_ptr;
-	char	*format_attributes_ptr;
-	char	format_name[MB_DESCRIPTION_LENGTH];
-	char	format_informal[MB_DESCRIPTION_LENGTH];
-	char	format_attributes[MB_DESCRIPTION_LENGTH];
-	int	list_mode;
-	int	i;
-
-	help = 0;
-	verbose = 0;
-	file_specified = MB_NO;
-	format = 0;
-	format_specified = MB_NO;
-	html = MB_NO;
-	list_mode = MBFORMAT_LIST_LONG;
-
-	/* process argument list */
-	while ((c = getopt(argc, argv, "F:f:HhI:i:LlKkVvWw")) != -1)
-	  switch (c)
-		{
-		case 'F':
-		case 'f':
-			sscanf (optarg,"%d", &format);
-			format_specified = MB_YES;
-			break;
-		case 'L':
-		case 'l':
-			list_mode = MBFORMAT_LIST_SIMPLE;
-			break;
-		case 'K':
-		case 'k':
-			list_mode = MBFORMAT_LIST_ROOT;
-			break;
-		case 'H':
-		case 'h':
-			help++;
-			break;
-		case 'I':
-		case 'i':
-			sscanf (optarg,"%s", file);
-			file_specified = MB_YES;
-			break;
-		case 'V':
-		case 'v':
-			verbose++;
-			break;
-		case 'W':
-		case 'w':
-			html = MB_YES;
-			break;
-		case '?':
-			errflg++;
-		}
-
-	/* if error flagged then print it and exit */
-	if (errflg)
-		{
-		fprintf(stderr,"usage: %s\n", usage_message);
-		error = MB_ERROR_BAD_USAGE;
-		exit(error);
-		}
-
-	/* print starting message */
-	if (verbose == 1 || help)
-		{
-		fprintf(stderr,"\nProgram %s\n",program_name);
-		fprintf(stderr,"Version %s\n",rcs_id);
-		fprintf(stderr,"MB-system Version %s\n",MB_VERSION);
-		}
-
-	/* print starting debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  Program <%s>\n",program_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Control Parameters:\n");
-		fprintf(stderr,"dbg2       verbose: %d\n",verbose);
-		fprintf(stderr,"dbg2       help:    %d\n",help);
-		if (format_specified == MB_YES)
-		    fprintf(stderr,"dbg2       format:  %d\n",format);
-		if (file_specified == MB_YES)
-		    fprintf(stderr,"dbg2       file:    %s\n",file);
-		}
-
-	/* if help desired then print it and exit */
-	if (help)
-		{
-		fprintf(stderr,"\n%s\n",help_message);
-		fprintf(stderr,"\nusage: %s\n", usage_message);
-		exit(error);
-		}
-
-	/* print out the info */
-	if (file_specified == MB_YES)
-		{
-		format_save = format;
-		status = mb_get_format(verbose,file,root,&format,&error);
-		}
-	else if (format_specified == MB_YES)
-		{
-		format_save = format;
-		status = mb_format(verbose,&format,&error);
-		}
-	if (file_specified == MB_YES
-		&& format == 0)
-		{
-		if (list_mode == MBFORMAT_LIST_SIMPLE)
-			printf("%d\n",format);
-		else if (list_mode == MBFORMAT_LIST_ROOT)
-			printf("%s %d\n", root, format);
-		else
-			printf("Program %s unable to infer format from filename %s\n",program_name,file);
-		}
-	else if (format_specified == MB_YES
-		&& format == 0)
-		{
-		if (list_mode == MBFORMAT_LIST_SIMPLE)
-			printf("%d\n",format);
-		else if (list_mode == MBFORMAT_LIST_ROOT)
-			printf("%s %d\n", root, format);
-		else
-			printf("Specified format %d invalid for MB-System\n",format_save);
-		}
-	else if (format != 0)
-		{
-		if (list_mode == MBFORMAT_LIST_SIMPLE)
-			{
-			printf("%d\n",format);
-			}
-		else if (list_mode == MBFORMAT_LIST_ROOT)
-			{
-			printf("%s %d\n", root, format);
-			}
-		else
-			{
-			status = mb_format_description(verbose,&format,format_description,&error);
-			if (status == MB_SUCCESS)
-				{
-				printf("\nMBIO data format id: %d\n",format);
-				printf("%s",format_description);
-				}
-			else if (file_specified == MB_YES)
-				{
-				printf("Program %s unable to infer format from filename %s\n",program_name,file);
-				}
-			else if (format_specified == MB_YES)
-				{
-				printf("Specified format %d invalid for MB-System\n",format_save);
-				}
-			}
-		}
-	else if (html == MB_YES)
-		{
-		printf("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 3.2//EN\">\n");
-		printf("<HTML>\n<HEAD>\n   <TITLE>MB-System Supported Data Formats</TITLE>\n");
-		printf("</HEAD>\n<BODY TEXT=\"#000000\" BGCOLOR=\"#FFFFFF\" LINK=\"#336699\" VLINK=\"#997040\" ALINK=\"#CC9900\">\n\n");
-		printf("<CENTER><P><B><FONT SIZE=+2>MB-System Supported Swath Data Formats</FONT></B></P></CENTER>\n\n");
-		printf("<P>Each swath mapping sonar system outputs a data stream which includes\n");
-		printf("some values or parameters unique to that system. In general, a number of\n");
-		printf("different data formats have come into use for data from each of the sonar\n");
-		printf("systems; many of these formats include only a subset of the original data\n");
-		printf("stream. Internally, MBIO recognizes which sonar system each data format\n");
-		printf("is associated with and uses a data structure including the complete data\n");
-		printf("stream for that sonar. At present, formats associated with the following\n");
-		printf("sonars are supported: </P>\n\n");
-		printf("<UL>\n<LI>Sea Beam "classic" multibeam sonar </LI>\n\n");
-		printf("<LI>Hydrosweep DS multibeam sonar </LI>\n\n");
-		printf("<LI>Hydrosweep DS2 multibeam sonar </LI>\n\n");
-		printf("<LI>Hydrosweep MD multibeam sonar </LI>\n\n");
-		printf("<LI>Sea Beam 2000 multibeam sonar </LI>\n\n");
-		printf("<LI>Sea Beam 2112 and 2136 multibeam sonars </LI>\n\n");
-		printf("<LI>Sea Beam 2120 multibeam sonars </LI>\n\n");
-		printf("<LI>Simrad EM12, EM121, EM950, and EM1000 multibeam sonars </LI>\n\n");
-		printf("<LI>Simrad EM120, EM300, and EM3000 multibeam sonars</LI>\n\n");
-		printf("<LI>Simrad EM122, EM302, EM710, and EM3002 multibeam sonars</LI>\n\n");
-		printf("<LI>Simrad Mesotech SM2000 multibeam sonar</LI>\n\n");
-		printf("<LI>Hawaii MR-1 shallow tow interferometric sonar </LI>\n\n");
-		printf("<LI>ELAC Bottomchart and Bottomchart MkII shallow water multibeam sonars</LI>\n\n");
-		printf("<LI>Reson Seabat multibeam sonars (e.g. 9001, 8081, 7125)</LI>\n\n");
-		printf("<LI>WHOI DSL AMS-120 deep tow interferometric sonar </LI>\n\n");
-		printf("<LI>Sea Scan sidescan sonar</LI>\n\n");
-		printf("<LI>Furuno HS-1 multibeam sonar</LI>\n\n");
-		printf("<LI>Edgetech sidescan and subbottom profiler sonars</LI>\n\n");
-		printf("<LI>Imagenex DeltaT multibeam sonars</LI>\n\n");
-		printf("<LI>Odom ES3 multibeam sonar</LI>\n\n");
-		printf("</UL>\n\n");
-		printf("<P>The following swath mapping sonar data formats are currently supported by MB-System:</P>\n\n");
-
-		for (i=0;i<=1000;i++)
-			{
-			format = i;
-			if ((status = mb_format_description(verbose,&format,format_description,&error)) == MB_SUCCESS
-				&& format == i)
-				{
-				format_informal_ptr = (char *)
-				    strstr(format_description, "Informal Description:");
-				format_attributes_ptr = (char *)
-				    strstr(format_description, "Attributes:");
-				strncpy(format_name, format_description,
-					strlen(format_description)
-					    - strlen(format_informal_ptr));
-				format_name[strlen(format_description)
-					    - strlen(format_informal_ptr) - 1] = '\0';
-				strncpy(format_informal, format_informal_ptr,
-					strlen(format_informal_ptr)
-					    - strlen(format_attributes_ptr));
-				format_informal[strlen(format_informal_ptr)
-					    - strlen(format_attributes_ptr) - 1] = '\0';
-				strcpy(format_attributes, format_attributes_ptr);
-				format_attributes[strlen(format_attributes_ptr)-1] = '\0';
-				printf("\n<UL>\n<LI>MBIO Data Format ID:  %d </LI>\n",format);
-				printf("\n<UL>\n<LI>%s</LI>\n",format_name);
-				printf("\n<LI>%s</LI>\n",format_informal);
-				printf("\n<LI>%s</LI>\n",format_attributes);
-				printf("</UL>\n</UL>\n");
-				}
-			}
-
-		printf("\n<CENTER><P><BR>\n");
-		printf("Last Updated: %s</P></CENTER>\n", MB_FORMAT_UPDATEDATE);
-		printf("\n<P>\n<HR WIDTH=\"100%%\"></P>\n\n");
-		printf("<P><IMG SRC=\"mbsystem_logo_small.gif\" HEIGHT=55 WIDTH=158><A HREF=\"mbsystem_home.html\">Back\n");
-		printf("to MB-System Home Page...</A></P>\n");
-		printf("\n</BODY>\n</HTML>\n");
-
-		status = MB_SUCCESS;
-		error = MB_ERROR_NO_ERROR;
-		}
-	else if (list_mode == MB_YES)
-		{
-		for (i=0;i<=1000;i++)
-			{
-			format = i;
-			if ((status = mb_format(verbose,&format,&error)) == MB_SUCCESS
-				&& format == i)
-				{
-				printf("%d\n",format);
-				}
-			}
-		status = MB_SUCCESS;
-		error = MB_ERROR_NO_ERROR;
-		}
-	else
-		{
-		printf("\nSupported MBIO Formats:\n");
-		for (i=0;i<=1000;i++)
-			{
-			format = i;
-			if ((status = mb_format_description(verbose,&format,format_description,&error)) == MB_SUCCESS
-				&& format == i)
-				{
-				printf("\nMBIO Data Format ID:  %d\n",format);
-				printf("%s",format_description);
-				}
-			}
-		status = MB_SUCCESS;
-		error = MB_ERROR_NO_ERROR;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  Program <%s> completed\n",
-			program_name);
-		fprintf(stderr,"dbg2  Ending status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* end it all */
-	exit(error);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/utilities/mbgetesf.c b/src/utilities/mbgetesf.c
deleted file mode 100644
index e2f22ea..0000000
--- a/src/utilities/mbgetesf.c
+++ /dev/null
@@ -1,606 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbgetesf.c	6/15/93
- *    $Id: mbgetesf.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 2001-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbgetesf reads a multibeam data file and writes out
- * an edit save file which can be applied to other data files
- * containing the same data (but presumably in a different
- * state of processing).  This allows editing of one data file to
- * be transferred to another with ease.  The programs mbedit and
- * mbprocess can be used to apply the edit events to another file.
- *
- * Author:	D. W. Caress
- * Date:	January 24, 2001
- *
- * $Log: mbgetesf.c,v $
- * Revision 5.7  2008/05/16 22:44:37  caress
- * Release 5.1.1beta18
- *
- * Revision 5.6  2006/01/18 15:17:00  caress
- * Added stdlib.h include.
- *
- * Revision 5.5  2005/11/05 01:07:54  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.4  2005/03/25 04:43:02  caress
- * Standardized the string lengths used for filenames and comment data.
- *
- * Revision 5.3  2003/04/17 21:17:10  caress
- * Release 5.0.beta30
- *
- * Revision 5.2  2002/10/02 23:56:06  caress
- * Release 5.0.beta24
- *
- * Revision 5.1  2001/07/20 00:34:38  caress
- * Release 5.0.beta03
- *
- * Revision 5.0  2001/03/22 21:14:47  caress
- * Trying to make release 5.0.beta0.
- *
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <math.h>
-#include <string.h>
-#include <time.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_define.h"
-#include "mb_process.h"
-#include "mb_swap.h"
-
-#define MBGETESF_FLAGONLY   1
-#define MBGETESF_FLAGNULL   2
-#define MBGETESF_ALL	    3
-
-int mbgetesf_save_edit(int verbose, FILE *sofp, double time_d, int beam, int action, int *error);
-
-static char rcs_id[] = "$Id: mbgetesf.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-
-int main (int argc, char **argv)
-{
-	/* id variables */
-	char program_name[] = "mbgetest";
-	char help_message[] =  "mbgetesf reads a multibeam data file and writes out\nan edit save file which can be applied to other data files\ncontaining the same data (but presumably in a different\nstate of processing).  This allows editing of one data file to\nbe transferred to another with ease.  The programs mbedit and\nmbprocess can be used to apply the edit events to another file.";
-	char usage_message[] = "mbgetesf [-Fformat -Iinfile -Mmode -Oesffile -V -H]";
-
-	/* parsing variables */
-	extern char *optarg;
-	int	errflg = 0;
-	int	c;
-	int	help = 0;
-	int	flag = 0;
-
-	/* MBIO status variables */
-	int	status;
-	int	verbose = 0;
-	int	error = MB_ERROR_NO_ERROR;
-	char	*message = NULL;
-
-	/* MBIO read control parameters */
-	int	format;
-	int	pings;
-	int	lonflip;
-	double	bounds[4];
-	int	btime_i[7];
-	int	etime_i[7];
-	double	btime_d;
-	double	etime_d;
-	double	speedmin;
-	double	timegap;
-	char	ifile[MB_PATH_MAXLINE];
-	int	beams_bath;
-	int	beams_amp;
-	int	pixels_ss;
-	void	*imbio_ptr = NULL;
-
-	/* mbio read and write values */
-	void	*store_ptr;
-	int	kind;
-	int	time_i[7];
-	double	time_d;
-	double	navlon;
-	double	navlat;
-	double	speed;
-	double	heading;
-	double	distance;
-	double	altitude;
-	double	sonardepth;
-	int	nbath;
-	int	namp;
-	int	nss;
-	char	*beamflag = NULL;
-	double	*bath = NULL;
-	double	*bathacrosstrack = NULL;
-	double	*bathalongtrack = NULL;
-	double	*amp = NULL;
-	double	*ss = NULL;
-	double	*ssacrosstrack = NULL;
-	double	*ssalongtrack = NULL;
-	int	idata = 0;
-	int	beam_ok = 0;
-	int	beam_null = 0;
-	int	beam_ok_write = 0;
-	int	beam_null_write = 0;
-	int	beam_flag = 0;
-	int	beam_flag_manual = 0;
-	int	beam_flag_filter = 0;
-	int	beam_flag_sonar = 0;
-	char	comment[MB_COMMENT_MAXLINE];
-	int	mode;
-	int	kluge = 0;
-
-	/* save file control variables */
-	int	sofile_set = MB_NO;
-	char	sofile[MB_PATH_MAXLINE];
-	FILE	*sofp;
-	int	i;
-
-	/* get current default values */
-	status = mb_defaults(verbose,&format,&pings,&lonflip,bounds,
-		btime_i,etime_i,&speedmin,&timegap);
-
-	/* reset all defaults but the format and lonflip */
-	pings = 1;
-	bounds[0] = -360.;
-	bounds[1] = 360.;
-	bounds[2] = -90.;
-	bounds[3] = 90.;
-	btime_i[0] = 1962;
-	btime_i[1] = 2;
-	btime_i[2] = 21;
-	btime_i[3] = 10;
-	btime_i[4] = 30;
-	btime_i[5] = 0;
-	btime_i[6] = 0;
-	etime_i[0] = 2062;
-	etime_i[1] = 2;
-	etime_i[2] = 21;
-	etime_i[3] = 10;
-	etime_i[4] = 30;
-	etime_i[5] = 0;
-	etime_i[6] = 0;
-	speedmin = 0.0;
-	timegap = 1000000000.0;
-	mode = MBGETESF_FLAGONLY;
-
-	/* set default input and output */
-	strcpy (ifile, "stdin");
-
-	/* process argument list */
-	while ((c = getopt(argc, argv, "VvHhB:b:E:F:f:I:i:K:k:M:m:O:o:")) != -1)
-	  switch (c)
-		{
-		case 'H':
-		case 'h':
-			help++;
-			break;
-		case 'V':
-		case 'v':
-			verbose++;
-			break;
-		case 'B':
-		case 'b':
-			sscanf (optarg,"%d/%d/%d/%d/%d/%d",
-				&btime_i[0],&btime_i[1],&btime_i[2],
-				&btime_i[3],&btime_i[4],&btime_i[5]);
-			btime_i[6] = 0;
-			flag++;
-			break;
-		case 'E':
-		case 'e':
-			sscanf (optarg,"%d/%d/%d/%d/%d/%d",
-				&etime_i[0],&etime_i[1],&etime_i[2],
-				&etime_i[3],&etime_i[4],&etime_i[5]);
-			etime_i[6] = 0;
-			flag++;
-			break;
-		case 'F':
-		case 'f':
-			sscanf (optarg,"%d", &format);
-			flag++;
-			break;
-		case 'I':
-		case 'i':
-			sscanf (optarg,"%s", ifile);
-			flag++;
-			break;
-		case 'K':
-		case 'k':
-			sscanf (optarg,"%d", &kluge);
-			flag++;
-			break;
-		case 'M':
-		case 'm':
-			sscanf (optarg,"%d", &mode);
-			flag++;
-			break;
-		case 'O':
-		case 'o':
-			sscanf (optarg,"%s", sofile);
-			sofile_set = MB_YES;
-			flag++;
-			break;
-		case '?':
-			errflg++;
-		}
-
-	/* if error flagged then print it and exit */
-	if (errflg)
-		{
-		fprintf(stderr,"usage: %s\n", usage_message);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		error = MB_ERROR_BAD_USAGE;
-		exit(error);
-		}
-
-	/* print starting message */
-	if (verbose == 1 || help)
-		{
-		fprintf(stderr,"\nProgram %s\n",program_name);
-		fprintf(stderr,"Version %s\n",rcs_id);
-		fprintf(stderr,"MB-system Version %s\n",MB_VERSION);
-		}
-
-	/* print starting debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  Program <%s>\n",program_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Control Parameters:\n");
-		fprintf(stderr,"dbg2       verbose:        %d\n",verbose);
-		fprintf(stderr,"dbg2       help:           %d\n",help);
-		fprintf(stderr,"dbg2       data format:    %d\n",format);
-		fprintf(stderr,"dbg2       pings:          %d\n",pings);
-		fprintf(stderr,"dbg2       lonflip:        %d\n",lonflip);
-		fprintf(stderr,"dbg2       bounds[0]:      %f\n",bounds[0]);
-		fprintf(stderr,"dbg2       bounds[1]:      %f\n",bounds[1]);
-		fprintf(stderr,"dbg2       bounds[2]:      %f\n",bounds[2]);
-		fprintf(stderr,"dbg2       bounds[3]:      %f\n",bounds[3]);
-		fprintf(stderr,"dbg2       btime_i[0]:     %d\n",btime_i[0]);
-		fprintf(stderr,"dbg2       btime_i[1]:     %d\n",btime_i[1]);
-		fprintf(stderr,"dbg2       btime_i[2]:     %d\n",btime_i[2]);
-		fprintf(stderr,"dbg2       btime_i[3]:     %d\n",btime_i[3]);
-		fprintf(stderr,"dbg2       btime_i[4]:     %d\n",btime_i[4]);
-		fprintf(stderr,"dbg2       btime_i[5]:     %d\n",btime_i[5]);
-		fprintf(stderr,"dbg2       btime_i[6]:     %d\n",btime_i[6]);
-		fprintf(stderr,"dbg2       etime_i[0]:     %d\n",etime_i[0]);
-		fprintf(stderr,"dbg2       etime_i[1]:     %d\n",etime_i[1]);
-		fprintf(stderr,"dbg2       etime_i[2]:     %d\n",etime_i[2]);
-		fprintf(stderr,"dbg2       etime_i[3]:     %d\n",etime_i[3]);
-		fprintf(stderr,"dbg2       etime_i[4]:     %d\n",etime_i[4]);
-		fprintf(stderr,"dbg2       etime_i[5]:     %d\n",etime_i[5]);
-		fprintf(stderr,"dbg2       etime_i[6]:     %d\n",etime_i[6]);
-		fprintf(stderr,"dbg2       speedmin:       %f\n",speedmin);
-		fprintf(stderr,"dbg2       timegap:        %f\n",timegap);
-		fprintf(stderr,"dbg2       input file:     %s\n",ifile);
-		fprintf(stderr,"dbg2       mode:	   %d\n",mode);
-		fprintf(stderr,"dbg2       kluge:	   %d\n",kluge);
-		}
-
-	/* if help desired then print it and exit */
-	if (help)
-		{
-		fprintf(stderr,"\n%s\n",help_message);
-		fprintf(stderr,"\nusage: %s\n", usage_message);
-		exit(error);
-		}
-
-	/* get format if required */
-	if (format == 0)
-		mb_get_format(verbose,ifile,NULL,&format,&error);
-
-	/* initialize reading the input multibeam file */
-	if ((status = mb_read_init(
-		verbose,ifile,format,pings,lonflip,bounds,
-		btime_i,etime_i,speedmin,timegap,
-		&imbio_ptr,&btime_d,&etime_d,
-		&beams_bath,&beams_amp,&pixels_ss,&error)) != MB_SUCCESS)
-		{
-		mb_error(verbose,error,&message);
-		fprintf(stderr,"\nMBIO Error returned from function <mb_read_init>:\n%s\n",message);
-		fprintf(stderr,"\nMultibeam File <%s> not initialized for reading\n",ifile);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-
-	/* allocate memory for data arrays */
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(char), (void **)&beamflag, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(double), (void **)&bath, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_AMPLITUDE,
-						sizeof(double), (void **)&amp, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(double), (void **)&bathacrosstrack, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(double), (void **)&bathalongtrack, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_SIDESCAN,
-						sizeof(double), (void **)&ss, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_SIDESCAN,
-						sizeof(double), (void **)&ssacrosstrack, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_SIDESCAN,
-						sizeof(double), (void **)&ssalongtrack, &error);
-
-	/* if error initializing memory then quit */
-	if (error != MB_ERROR_NO_ERROR)
-		{
-		mb_error(verbose,error,&message);
-		fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",message);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-
-	/* now deal with new edit save file */
-	if (status == MB_SUCCESS)
-	    {
-	    /* get edit save file */
-	    if (sofile_set == MB_NO)
-		{
-		sofp = stdout;
-		}
-
-	    /* open the edit save file */
-	    else if ((sofp = fopen(sofile,"w")) == NULL)
-		{
-		error = MB_ERROR_OPEN_FAIL;
-		mb_error(verbose,error,&message);
-		fprintf(stderr,"\nEdit Save File <%s> not initialized for writing\n",sofile);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-	    }
-
-	/* read and write */
-	while (error <= MB_ERROR_NO_ERROR)
-		{
-		/* read some data */
-		error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-		status = mb_get_all(verbose,imbio_ptr,&store_ptr,&kind,
-			time_i,&time_d,&navlon,&navlat,
-			&speed,&heading,
-			&distance,&altitude,&sonardepth,
-			&nbath,&namp,&nss,
-			beamflag,bath,amp,bathacrosstrack,bathalongtrack,
-			ss,ssacrosstrack,ssalongtrack,
-			comment,&error);
-
-		/* increment counter */
-		if (error <= MB_ERROR_NO_ERROR
-			&& kind == MB_DATA_DATA)
-			idata = idata + pings;
-
-		/* time gaps do not matter to mbgetesf */
-		if (error == MB_ERROR_TIME_GAP)
-			{
-			status = MB_SUCCESS;
-			error = MB_ERROR_NO_ERROR;
-			}
-
-		/* time bounds do not matter to mbgetesf */
-		if (error == MB_ERROR_OUT_TIME)
-			{
-			status = MB_SUCCESS;
-			error = MB_ERROR_NO_ERROR;
-			}
-
-		/* space bounds do not matter to mbgetesf */
-		if (error == MB_ERROR_OUT_BOUNDS)
-			{
-			status = MB_SUCCESS;
-			error = MB_ERROR_NO_ERROR;
-			}
-
-		/* output error messages */
-		if (verbose >= 1 && error < MB_ERROR_NO_ERROR
-			&& error >= MB_ERROR_OTHER
-			&& error != MB_ERROR_COMMENT)
-			{
-			mb_error(verbose,error,&message);
-			fprintf(stderr,"\nNonfatal MBIO Error:\n%s\n",message);
-			fprintf(stderr,"Input Record: %d\n",idata);
-			fprintf(stderr,"Time: %d %d %d %d %d %d %d\n",
-				time_i[0],time_i[1],time_i[2],
-				time_i[3],time_i[4],time_i[5],time_i[6]);
-			}
-		else if (verbose >= 1 && error < MB_ERROR_NO_ERROR)
-			{
-			mb_error(verbose,error,&message);
-			fprintf(stderr,"\nNonfatal MBIO Error:\n%s\n",message);
-			fprintf(stderr,"Number of good records so far: %d\n",idata);
-			}
-		else if (verbose >= 1 && error != MB_ERROR_NO_ERROR
-			&& error != MB_ERROR_EOF)
-			{
-			mb_error(verbose,error,&message);
-			fprintf(stderr,"\nFatal MBIO Error:\n%s\n",message);
-			fprintf(stderr,"Last Good Time: %d %d %d %d %d %d %d\n",
-				time_i[0],time_i[1],time_i[2],
-				time_i[3],time_i[4],time_i[5],time_i[6]);
-			}
-
-		/* fix a problem with EM300/EM3000 data in HDCS format */
-		if (format == 151 && kluge == 1)
-		    {
-		    for (i=0;i<nbath-1;i++)
-			beamflag[i] = beamflag[i+1];
-		    beamflag[nbath-1] = MB_FLAG_FLAG;
-		    }
-
-		/* count and write the flags */
-		for (i=0;i<nbath;i++)
-		    {
-		    if (mb_beam_ok(beamflag[i]))
-			{
-			beam_ok++;
-			if (mode == MBGETESF_ALL)
-			    {
-			    mbgetesf_save_edit(verbose, sofp, time_d, i,
-						MBP_EDIT_UNFLAG, &error);
-			    beam_ok_write++;
-			    }
-			}
-		    else if (mb_beam_check_flag_null(beamflag[i]))
-			{
-			beam_null++;
-			if (mode == MBGETESF_FLAGNULL || mode == MBGETESF_ALL)
-			    {
-			    mbgetesf_save_edit(verbose, sofp, time_d, i,
-						MBP_EDIT_ZERO, &error);
-			    beam_null_write++;
-			    }
-			}
-		    else
-			{
-			beam_flag++;
-			if (mb_beam_check_flag_manual(beamflag[i]))
-			    {
-			    beam_flag_manual++;
-			    mbgetesf_save_edit(verbose, sofp, time_d, i,
-						MBP_EDIT_FLAG, &error);
-			    }
-			if (mb_beam_check_flag_filter(beamflag[i]))
-			    {
-			    beam_flag_filter++;
-			    mbgetesf_save_edit(verbose, sofp, time_d, i,
-						MBP_EDIT_FILTER, &error);
-			    }
-			if (mb_beam_check_flag_sonar(beamflag[i]))
-			    {
-			    beam_flag_sonar++;
-			    mbgetesf_save_edit(verbose, sofp, time_d, i,
-						MBP_EDIT_FLAG, &error);
-			    }
-			}
-		    }
-		}
-
-	/* close the file */
-	status = mb_close(verbose,&imbio_ptr,&error);
-
-	/* close edit save file */
-	fclose(sofp);
-
-	/* check memory */
-	if (verbose >= 4)
-		status = mb_memory_list(verbose,&error);
-
-	/* give the statistics */
-	if (verbose >= 1)
-		{
-		fprintf(stderr,"\nData records:\n");
-		fprintf(stderr,"\t%d input data records\n",idata);
-		fprintf(stderr,"\nBeam flag read totals:\n");
-		fprintf(stderr,"\t%d beams ok\n",beam_ok);
-		fprintf(stderr,"\t%d beams null\n",beam_null);
-		fprintf(stderr,"\t%d beams flagged\n",beam_flag);
-		fprintf(stderr,"\t%d beams flagged manually\n",beam_flag_manual);
-		fprintf(stderr,"\t%d beams flagged by filter\n",beam_flag_filter);
-		fprintf(stderr,"\t%d beams flagged by sonar\n",beam_flag_sonar);
-		fprintf(stderr,"\nBeam flag write totals:\n");
-		fprintf(stderr,"\t%d beams ok\n",beam_ok_write);
-		fprintf(stderr,"\t%d beams null\n",beam_null_write);
-		fprintf(stderr,"\t%d beams flagged\n",beam_flag);
-		fprintf(stderr,"\t%d beams flagged manually\n",beam_flag_manual);
-		fprintf(stderr,"\t%d beams flagged by filter\n",beam_flag_filter);
-		fprintf(stderr,"\t%d beams flagged by sonar\n",beam_flag_sonar);
-		}
-
-	/* end it all */
-	exit(error);
-}
-/*--------------------------------------------------------------------*/
-int mbgetesf_save_edit(int verbose, FILE *sofp, double time_d, int beam, int action, int *error)
-{
-	/* local variables */
-	char	*function_name = "mbgetesf_save_edit";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-
-		fprintf(stderr,"dbg2       sofp:            %p\n",(void *)sofp);
-		fprintf(stderr,"dbg2       time_d:          %f\n",time_d);
-		fprintf(stderr,"dbg2       beam:            %d\n",beam);
-		fprintf(stderr,"dbg2       action:          %d\n",action);
-		}
-
-	/* write out the edit */
-	if (sofp != NULL)
-	    {
-#ifdef BYTESWAPPED
-	    mb_swap_double(&time_d);
-	    beam = mb_swap_int(beam);
-	    action = mb_swap_int(action);
-#endif
-	    if (fwrite(&time_d, sizeof(double), 1, sofp) != 1)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	    if (status == MB_SUCCESS
-		&& fwrite(&beam, sizeof(int), 1, sofp) != 1)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	    if (status == MB_SUCCESS
-		&& fwrite(&action, sizeof(int), 1, sofp) != 1)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	    }
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/utilities/mbgrid.c b/src/utilities/mbgrid.c
deleted file mode 100644
index f170e38..0000000
--- a/src/utilities/mbgrid.c
+++ /dev/null
@@ -1,5775 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbgrid.c	5/2/94
- *    $Id: mbgrid.c 2247 2015-05-29 21:28:28Z caress $
- *
- *    Copyright (c) 1993-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * MBGRID is an utility used to grid bathymetry, amplitude, or
- * sidescan data contained in a set of swath sonar data files.
- * This program uses one of four algorithms (gaussian weighted mean,
- * median filter, minimum filter, maximum filter) to grid regions
- * covered by swaths and then fills in gaps between
- * the swaths (to the degree specified by the user) using a minimum
- * curvature algorithm.
- *
- * The April 1995 version reinstated the use of the IGPP/SIO zgrid routine
- * for thin plate spline interpolation. The zgrid code has been
- * translated from Fortran to C. The zgrid algorithm is much
- * faster than the Wessel and Smith minimum curvature algorithm
- * from the GMT program surface used in recent versions of mbgrid.
- *
- * The July 2002 version allows the creation of grids using
- * UTM eastings and northings rather than uniformly spaced
- * in longitude and latitude.
- *
- * Author:	D. W. Caress
- * Date:	February 22, 1993
- * Rewrite:	May 2, 1994
- * Rerewrite:	April 25, 1995
- * Rererewrite:	January 2, 1996
- *
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <math.h>
-#include <string.h>
-#include <time.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_define.h"
-#include "mb_io.h"
-#include "mb_info.h"
-#include "mb_aux.h"
-
-/* gridding algorithms */
-#define	MBGRID_WEIGHTED_MEAN                1
-#define	MBGRID_MEDIAN_FILTER                2
-#define	MBGRID_MINIMUM_FILTER               3
-#define	MBGRID_MAXIMUM_FILTER               4
-#define	MBGRID_WEIGHTED_FOOTPRINT_SLOPE     5
-#define	MBGRID_WEIGHTED_FOOTPRINT           6
-
-/* grid format definitions */
-#define	MBGRID_ASCII	1
-#define	MBGRID_OLDGRD	2
-#define	MBGRID_CDFGRD	3
-#define	MBGRID_ARCASCII	4
-#define	MBGRID_GMTGRD	100
-
-/* gridded data type */
-#define	MBGRID_DATA_BATHYMETRY	1
-#define	MBGRID_DATA_TOPOGRAPHY	2
-#define	MBGRID_DATA_AMPLITUDE	3
-#define	MBGRID_DATA_SIDESCAN	4
-
-/* flag for no data in grid */
-#define	NO_DATA_FLAG	99999
-
-/* number of data to be allocated at a time */
-#define	REALLOC_STEP_SIZE	25
-
-/* usage of footprint based weight */
-#define MBGRID_USE_NO		0
-#define MBGRID_USE_YES		1
-#define MBGRID_USE_CONDITIONAL	2
-
-/* interpolation mode */
-#define MBGRID_INTERP_NONE	0
-#define MBGRID_INTERP_GAP	1
-#define MBGRID_INTERP_NEAR	2
-#define MBGRID_INTERP_ALL	3
-
-/* comparison threshold */
-#define MBGRID_TINY		0.00000001
-
-/* interpolation algorithm
-	The code is set to use either of two
-	algorithms for 2D thin plate spline
-	interpolation. If the USESURFACE preprocessor
-	define is defined then
-	the code will use the surface algorithm
-	from GMT. If not, then the zgrid
-	algorithm will be used.
-	- The default is to use zgrid - to
-	change this uncomment the define below. */
-/* #define USESURFACE */
-
-/* approximate complementary error function */
-double erfcc(double x);
-double mbgrid_erf(double x);
-
-int write_ascii(int verbose, char *outfile, float *grid,
-		int nx, int ny,
-		double xmin, double xmax, double ymin, double ymax,
-		double dx, double dy, int *error);
-int write_arcascii(int verbose, char *outfile, float *grid,
-		int nx, int ny,
-		double xmin, double xmax, double ymin, double ymax,
-		double dx, double dy, double nodata, int *error);
-int write_oldgrd(int verbose, char *outfile, float *grid,
-		int nx, int ny,
-		double xmin, double xmax, double ymin, double ymax,
-		double dx, double dy, int *error);
-int mbgrid_weight(int verbose, double foot_a, double foot_b,
-		    double pcx, double pcy, double dx, double dy,
-		    double *px, double *py,
-		    double *weight, int *use, int *error);
-
-/* output stream for basic stuff (stdout if verbose <= 1,
-	stderr if verbose > 1) */
-FILE	*outfp;
-
-/* program identifiers */
-static char rcs_id[] = "$Id: mbgrid.c 2247 2015-05-29 21:28:28Z caress $";
-char program_name[] = "mbgrid";
-char help_message[] =  "mbgrid is an utility used to grid bathymetry, amplitude, or \nsidescan data contained in a set of swath sonar data files.  \nThis program uses one of four algorithms (gaussian weighted mean, \nmedian filter, minimum filter, maximum filter) to grid regions \ncovered swaths and then fills in gaps between \nthe swaths (to the degree specified by the user) using a minimum\ncurvature algorithm.";
-char usage_message[] = "mbgrid -Ifilelist -Oroot \
-[-Rwest/east/south/north -Rfactor -Adatatype\n\
-          -Bborder -Cclip[/mode[/tension]] -Dxdim/ydim -Edx/dy/units[!] -F\n\
-          -Ggridkind -H -Jprojection -Llonflip -M -N -Ppings -Sspeed\n\
-          -Utime -V -Wscale -Xextend]";
-/*--------------------------------------------------------------------*/
-
-int main (int argc, char **argv)
-{
-	extern char *optarg;
-	int	errflg = 0;
-	int	c;
-	int	help = 0;
-	int	flag = 0;
-
-	/* MBIO status variables */
-	int	status = MB_SUCCESS;
-	int	verbose = 0;
-	int	error = MB_ERROR_NO_ERROR;
-	char	*message = NULL;
-
-	/* MBIO read control parameters */
-	int	format;
-	int	pings;
-	int	lonflip;
-	double	bounds[4];
-	int	btime_i[7];
-	int	etime_i[7];
-	double	btime_d;
-	double	etime_d;
-	double	speedmin;
-	double	timegap;
-	int	beams_bath;
-	int	beams_amp;
-	int	pixels_ss;
-	char	file[MB_PATH_MAXLINE];
-	int	file_in_bounds;
-	void	*mbio_ptr = NULL;
-	struct mb_io_struct *mb_io_ptr = NULL;
-        int     topo_type;
-
-	/* mbgrid control variables */
-	char	filelist[MB_PATH_MAXLINE];
-	char	fileroot[MB_PATH_MAXLINE];
-	void	*datalist;
-	int	look_processed = MB_DATALIST_LOOK_UNSET;
-	double	file_weight;
-	int	xdim = 0;
-	int	ydim = 0;
-	int	spacing_priority = MB_NO;
-	int	set_dimensions = MB_NO;
-	int	set_spacing = MB_NO;
-	double	dx_set = 0.0;
-	double	dy_set = 0.0;
-	double	dx = 0.0;
-	double	dy = 0.0;
-	char	units[MB_PATH_MAXLINE];
-	int	clip = 0;
-	int	clipmode = MBGRID_INTERP_NONE;
-#ifdef USESURFACE
-	double	tension = 0.35;
-#else
-	double	tension = 0.0;
-#endif
-	int	grid_mode = MBGRID_WEIGHTED_MEAN;
-	int	datatype = MBGRID_DATA_BATHYMETRY;
-	char	gridkindstring[MB_PATH_MAXLINE];
-	int	gridkind = MBGRID_GMTGRD;
-	int	more = MB_NO;
-	int	use_NaN = MB_NO;
-	double	clipvalue = NO_DATA_FLAG;
-	float	outclipvalue = NO_DATA_FLAG;
-	double	scale = 1.0;
-        double  boundsfactor = 0.0;
-        int     setborder = MB_NO;
-	double	border = 0.0;
-	double	extend = 0.0;
-	int	check_time = MB_NO;
-	int	first_in_stays = MB_YES;
-	double	timediff = 300.0;
-	int	rformat;
-	int	pstatus;
-	char	path[MB_PATH_MAXLINE];
-	char	ppath[MB_PATH_MAXLINE];
-	char	rfile[MB_PATH_MAXLINE];
-	char	ofile[MB_PATH_MAXLINE];
-	char	dfile[MB_PATH_MAXLINE];
-	char	plot_cmd[MB_COMMENT_MAXLINE];
-	char	plot_stdout[MB_COMMENT_MAXLINE];
-	int	plot_status;
-
-	int	grdrasterid = 0;
-	char	backgroundfile[MB_PATH_MAXLINE];
-	char	backgroundfileuse[MB_PATH_MAXLINE];
-
-	/* mbio read values */
-	int	rpings;
-	int	kind;
-	int	time_i[7];
-	double	time_d;
-	double	navlon;
-	double	navlat;
-	double	speed;
-	double	heading;
-	double	distance;
-	double	altitude;
-	double	sonardepth;
-	char	*beamflag = NULL;
-	double	*bath = NULL;
-	double	*bathlon = NULL;
-	double	*bathlat = NULL;
-	double	*amp = NULL;
-	double	*ss = NULL;
-	double	*sslon = NULL;
-	double	*sslat = NULL;
-	char	comment[MB_COMMENT_MAXLINE];
-	struct mb_info_struct mb_info;
-	int	formatread;
-
-	/* lon,lat,value triples variables */
-	double	tlon;
-	double	tlat;
-	double	tvalue;
-
-	/* grid variables */
-	double	gbnd[4], wbnd[4], obnd[4];
-	int	gbndset = MB_NO;
-	double	xlon, ylat, xx, yy;
-	double	factor, weight, topofactor;
-	int	gxdim, gydim, offx, offy, xtradim;
-	double	sbnd[4], sdx, sdy;
-	int	sclip;
-	int	sxdim, sydim;
-	double	*grid = NULL;
-	double	*norm = NULL;
-	double	*sigma = NULL;
-	double	*firsttime = NULL;
-	double	*gridsmall = NULL;
-#ifdef USESURFACE
-	float	*bxdata = NULL;
-	float	*bydata = NULL;
-	float	*bzdata = NULL;
-	float	*sxdata = NULL;
-	float	*sydata = NULL;
-	float	*szdata = NULL;
-#else
-	float	*bdata = NULL;
-	float	*sdata = NULL;
-	float	*work1 = NULL;
-	int	*work2 = NULL;
-	int	*work3 = NULL;
-#endif
-        double  bdata_origin_x, bdata_origin_y;
-	float	*output = NULL;
-	float	*sgrid = NULL;
-	int	*num = NULL;
-	int	*cnt = NULL;
-	float	xmin, ymin, ddx, ddy, zflag, cay;
-	double	**data;
-	double	*value = NULL;
-	int	ndata, ndatafile, nbackground, nbackground_alloc;
-	int	time_ok;
-	double	zmin, zmax, zclip;
-	int	nmax;
-	double	smin, smax;
-	int	nbinset, nbinzero, nbinspline, nbinbackground;
-	int	bathy_in_feet = MB_NO;
-
-	/* projected grid parameters */
-	int	use_projection = MB_NO;
-	int	projection_pars_f = MB_NO;
-	double	reference_lon, reference_lat;
-	int	utm_zone = 1;
-	char	projection_pars[MB_PATH_MAXLINE];
-	char	projection_id[MB_PATH_MAXLINE];
-	int	proj_status;
-	void	*pjptr;
-	double	deglontokm, deglattokm;
-	double	mtodeglon, mtodeglat;
-
-	/* output char strings */
-	char	xlabel[MB_PATH_MAXLINE];
-	char	ylabel[MB_PATH_MAXLINE];
-	char	zlabel[MB_PATH_MAXLINE];
-	char	title[MB_PATH_MAXLINE];
-	char	nlabel[MB_PATH_MAXLINE];
-	char	sdlabel[MB_PATH_MAXLINE];
-
-	/* variables needed to handle Not-a-Number values */
-	float	NaN;
-
-	/* other variables */
-	FILE	*dfp, *rfp;
-	int	i, j, k, ii, jj, iii, jjj, kkk, ir, n;
-	int	i1, i2, j1, j2, k1, k2;
-	double	r;
-	int	dmask[9];
-	int	kgrid, kout, kint, ib, ix, iy;
-	int	ix1, ix2, iy1, iy2, isx, isy;
-	int	pid;
-
-	double	foot_dx, foot_dy, foot_dxn, foot_dyn;
-	double	foot_lateral, foot_range, foot_theta;
-	double	foot_dtheta, foot_dphi;
-	double	foot_hwidth, foot_hlength;
-	int	foot_wix, foot_wiy, foot_lix, foot_liy, foot_dix, foot_diy;
-	double	dzdx, dzdy, sbath;
-	double	xx0, yy0, bdx, bdy, xx1, xx2, yy1, yy2;
-	double	prx[5], pry[5];
-	int	use_weight;
-	int	fork_status;
-        char    *bufptr;
-        size_t  freadsize;
-
-	/* get current default values */
-	status = mb_defaults(verbose,&format,&pings,&lonflip,bounds,
-		btime_i,etime_i,&speedmin,&timegap);
-
-	/* set default input and output */
-	strcpy (filelist, "datalist.mb-1");
-
-	/* initialize some values */
-	gridkindstring[0] = '\0';
-	strcpy(fileroot,"grid");
-	strcpy(projection_id,"Geographic");
-	gbnd[0] = 0.0;
-	gbnd[1] = 0.0;
-	gbnd[2] = 0.0;
-	gbnd[3] = 0.0;
-	xdim = 101;
-	ydim = 101;
-	gxdim = 0;
-	gydim = 0;
- 	pid = getpid();
-
-	/* process argument list */
-	while ((c = getopt(argc, argv, "A:a:B:b:C:c:D:d:E:e:F:f:G:g:HhI:i:J:j:K:k:L:l:MmNnO:o:P:p:QqR:r:S:s:T:t:U:u:VvW:w:X:x:")) != -1)
-	  switch (c)
-		{
-		case 'A':
-		case 'a':
-			sscanf (optarg,"%d", &datatype);
-			flag++;
-			break;
-		case 'B':
-		case 'b':
-			sscanf (optarg,"%lf", &border);
-                        setborder = MB_YES;
-			flag++;
-			break;
-		case 'C':
-		case 'c':
-			n = sscanf (optarg,"%d/%d/%lf", &clip, &clipmode,&tension);
-			if (n < 1)
-				clipmode = MBGRID_INTERP_NONE;
-			else if (n == 1 && clip > 0)
-				clipmode = MBGRID_INTERP_GAP;
-			else if (n == 1)
-				clipmode = MBGRID_INTERP_NONE;
-			else if (clip > 0 && clipmode < 0)
-				clipmode = MBGRID_INTERP_GAP;
-			else if (clipmode >= 3)
-				clipmode = MBGRID_INTERP_ALL;
-                        if (n < 3)
-                                {
-#ifdef USESURFACE
-                                tension = 0.35;
-#else
-                                tension = 0.0;
-#endif
-                                }
-			flag++;
-			break;
-		case 'D':
-		case 'd':
-			n = sscanf (optarg,"%d/%d", &xdim, &ydim);
-			if (n == 2)
-				set_dimensions = MB_YES;
-			flag++;
-			break;
-		case 'E':
-		case 'e':
-			if (optarg[strlen(optarg)-1] == '!')
-			    {
-			    spacing_priority = MB_YES;
-			    optarg[strlen(optarg)-1] = '\0';
-			    }
-			n = sscanf (optarg,"%lf/%lf/%s", &dx_set, &dy_set, units);
-			if (n > 1)
-				set_spacing = MB_YES;
-			if (n < 3)
-				strcpy(units, "meters");
-			flag++;
-			break;
-		case 'F':
-		case 'f':
-			sscanf (optarg,"%d", &grid_mode);
-			flag++;
-			break;
-		case 'G':
-		case 'g':
-			if (optarg[0] == '=')
-				{
-				gridkind = MBGRID_GMTGRD;
-				strcpy(gridkindstring, optarg);
-				}
-			else
-				{
-				sscanf (optarg,"%d", &gridkind);
-				if (gridkind == MBGRID_CDFGRD)
-					{
-					gridkind = MBGRID_GMTGRD;
-					gridkindstring[0] = '\0';
-					}
-				else if (gridkind > MBGRID_GMTGRD)
-					{
-					sprintf(gridkindstring, "=%d", (gridkind - 100));
-					gridkind = MBGRID_GMTGRD;
-					}
-				}
-			flag++;
-			break;
-		case 'H':
-		case 'h':
-			help++;
-			break;
-		case 'I':
-		case 'i':
-			sscanf (optarg,"%s", filelist);
-			flag++;
-			break;
-		case 'J':
-		case 'j':
-			sscanf (optarg,"%s", projection_pars);
-			projection_pars_f = MB_YES;
-			flag++;
-			break;
-		case 'K':
-		case 'k':
-			sscanf (optarg,"%s", backgroundfile);
-			if ((grdrasterid = atoi(backgroundfile)) <= 0)
-				grdrasterid = -1;
-			flag++;
-			break;
-		case 'L':
-		case 'l':
-			sscanf (optarg,"%d", &lonflip);
-			flag++;
-			break;
-		case 'M':
-		case 'm':
-			more = MB_YES;
-			flag++;
-			break;
-		case 'N':
-		case 'n':
-			use_NaN = MB_YES;
-			flag++;
-			break;
-		case 'O':
-		case 'o':
-			sscanf (optarg,"%s", fileroot);
-			flag++;
-			break;
-		case 'P':
-		case 'p':
-			sscanf (optarg,"%d", &pings);
-			flag++;
-			break;
-		case 'Q':
-		case 'q':
-			bathy_in_feet = MB_YES;
-			flag++;
-			break;
-		case 'R':
-		case 'r':
-                        if (strchr(optarg,'/') == NULL)
-                            {
-                            sscanf (optarg,"%lf", &boundsfactor);
-                            if (boundsfactor <= 1.0)
-                                boundsfactor = 0.0;
-                            }
-			else
-                            {
-                            mb_get_bounds(optarg, gbnd);
-                            gbndset = MB_YES;
-                            }
-			flag++;
-			break;
-		case 'S':
-		case 's':
-			sscanf (optarg,"%lf", &speedmin);
-			flag++;
-			break;
-		case 'T':
-		case 't':
-			sscanf (optarg,"%lf", &tension);
-			flag++;
-			break;
-		case 'U':
-		case 'u':
-			sscanf (optarg,"%lf", &timediff);
-			timediff = 60*timediff;
-			check_time = MB_YES;
-			if (timediff < 0.0)
-				{
-				timediff = fabs(timediff);
-				first_in_stays = MB_NO;
-				}
-			flag++;
-			break;
-		case 'V':
-		case 'v':
-			verbose++;
-			break;
-		case 'W':
-		case 'w':
-			sscanf (optarg,"%lf", &scale);
-			flag++;
-			break;
-		case 'X':
-		case 'x':
-			sscanf (optarg,"%lf", &extend);
-			flag++;
-			break;
-		case '?':
-			errflg++;
-		}
-
-	/* set output stream to stdout or stderr */
-	if (verbose >= 2)
-	    outfp = stderr;
-	else
-	    outfp = stdout;
-
-	/* if error flagged then print it and exit */
-	if (errflg)
-		{
-		fprintf(outfp,"usage: %s\n", usage_message);
-		fprintf(outfp,"\nProgram <%s> Terminated\n",
-			program_name);
-		error = MB_ERROR_BAD_USAGE;
-		exit(error);
-		}
-
-	/* print starting message */
-	if (verbose == 1 || help)
-		{
-		fprintf(outfp,"\nProgram %s\n",program_name);
-		fprintf(outfp,"Version %s\n",rcs_id);
-		fprintf(outfp,"MB-system Version %s\n",MB_VERSION);
-		}
-
-	/* print starting debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(outfp,"\ndbg2  Program <%s>\n",program_name);
-		fprintf(outfp,"dbg2  Version %s\n",rcs_id);
-		fprintf(outfp,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(outfp,"dbg2  Control Parameters:\n");
-		fprintf(outfp,"dbg2       verbose:              %d\n",verbose);
-		fprintf(outfp,"dbg2       help:                 %d\n",help);
-		fprintf(outfp,"dbg2       pings:                %d\n",pings);
-		fprintf(outfp,"dbg2       lonflip:              %d\n",lonflip);
-		fprintf(outfp,"dbg2       btime_i[0]:           %d\n",btime_i[0]);
-		fprintf(outfp,"dbg2       btime_i[1]:           %d\n",btime_i[1]);
-		fprintf(outfp,"dbg2       btime_i[2]:           %d\n",btime_i[2]);
-		fprintf(outfp,"dbg2       btime_i[3]:           %d\n",btime_i[3]);
-		fprintf(outfp,"dbg2       btime_i[4]:           %d\n",btime_i[4]);
-		fprintf(outfp,"dbg2       btime_i[5]:           %d\n",btime_i[5]);
-		fprintf(outfp,"dbg2       btime_i[6]:           %d\n",btime_i[6]);
-		fprintf(outfp,"dbg2       etime_i[0]:           %d\n",etime_i[0]);
-		fprintf(outfp,"dbg2       etime_i[1]:           %d\n",etime_i[1]);
-		fprintf(outfp,"dbg2       etime_i[2]:           %d\n",etime_i[2]);
-		fprintf(outfp,"dbg2       etime_i[3]:           %d\n",etime_i[3]);
-		fprintf(outfp,"dbg2       etime_i[4]:           %d\n",etime_i[4]);
-		fprintf(outfp,"dbg2       etime_i[5]:           %d\n",etime_i[5]);
-		fprintf(outfp,"dbg2       etime_i[6]:           %d\n",etime_i[6]);
-		fprintf(outfp,"dbg2       speedmin:             %f\n",speedmin);
-		fprintf(outfp,"dbg2       timegap:              %f\n",timegap);
-		fprintf(outfp,"dbg2       file list:            %s\n",filelist);
-		fprintf(outfp,"dbg2       output file root:     %s\n",fileroot);
-		fprintf(outfp,"dbg2       grid x dimension:     %d\n",xdim);
-		fprintf(outfp,"dbg2       grid y dimension:     %d\n",ydim);
-		fprintf(outfp,"dbg2       grid x spacing:       %f\n",dx);
-		fprintf(outfp,"dbg2       grid y spacing:       %f\n",dy);
-		fprintf(outfp,"dbg2       grid bounds[0]:       %f\n",gbnd[0]);
-		fprintf(outfp,"dbg2       grid bounds[1]:       %f\n",gbnd[1]);
-		fprintf(outfp,"dbg2       grid bounds[2]:       %f\n",gbnd[2]);
-		fprintf(outfp,"dbg2       grid bounds[3]:       %f\n",gbnd[3]);
-		fprintf(outfp,"dbg2       boundsfactor:         %f\n",boundsfactor);
-		fprintf(outfp,"dbg2       clipmode:             %d\n",clipmode);
-		fprintf(outfp,"dbg2       clip:                 %d\n",clip);
-		fprintf(outfp,"dbg2       tension:              %f\n",tension);
-		fprintf(outfp,"dbg2       grdraster background: %d\n",grdrasterid);
-		fprintf(outfp,"dbg2       backgroundfile:       %s\n",backgroundfile);
-		fprintf(outfp,"dbg2       more:                 %d\n",more);
-		fprintf(outfp,"dbg2       use_NaN:              %d\n",use_NaN);
-		fprintf(outfp,"dbg2       grid_mode:            %d\n",grid_mode);
-		fprintf(outfp,"dbg2       data type:            %d\n",datatype);
-		fprintf(outfp,"dbg2       grid format:          %d\n",gridkind);
-		if (gridkind == MBGRID_GMTGRD)
-		fprintf(outfp,"dbg2       gmt grid format id:   %s\n",gridkindstring);
-		fprintf(outfp,"dbg2       scale:                %f\n",scale);
-		fprintf(outfp,"dbg2       timediff:             %f\n",timediff);
-		fprintf(outfp,"dbg2       setborder:            %d\n",setborder);
-		fprintf(outfp,"dbg2       border:               %f\n",border);
-		fprintf(outfp,"dbg2       extend:               %f\n",extend);
-		fprintf(outfp,"dbg2       bathy_in_feet:        %d\n",bathy_in_feet);
-		fprintf(outfp,"dbg2       projection_pars:      %s\n",projection_pars);
-		fprintf(outfp,"dbg2       proj flag 1:          %d\n",projection_pars_f);
-		fprintf(outfp,"dbg2       projection_id:        %s\n",projection_id);
-		fprintf(outfp,"dbg2       utm_zone:             %d\n",utm_zone);
-		}
-
-	/* if help desired then print it and exit */
-	if (help)
-		{
-		fprintf(outfp,"\n%s\n",help_message);
-		fprintf(outfp,"\nusage: %s\n", usage_message);
-		exit(error);
-		}
-
-	/* if bounds not set get bounds of input data */
-	if (gbndset == MB_NO)
-		{
-		formatread = -1;
-		status = mb_get_info_datalist(verbose, filelist, &formatread,
-				&mb_info, lonflip, &error);
-
-		gbnd[0] = mb_info.lon_min;
-		gbnd[1] = mb_info.lon_max;
-		gbnd[2] = mb_info.lat_min;
-		gbnd[3] = mb_info.lat_max;
-		gbndset = MB_YES;
-
-		if (set_spacing == MB_NO && set_dimensions == MB_NO)
-			{
-			dx_set = 0.02 * mb_info.altitude_max;
-			dy_set = 0.02 * mb_info.altitude_max;
-			set_spacing = MB_YES;
-			strcpy(units, "meters");
-			}
-		}
-
-        /* if requested expand the grid bounds */
-        if (boundsfactor > 1.0)
-                {
-                xx1 = 0.5 * (boundsfactor - 1.0) * (gbnd[1] - gbnd[0]);
-                yy1 = 0.5 * (boundsfactor - 1.0) * (gbnd[3] - gbnd[2]);
-		gbnd[0] -= xx1;
-		gbnd[1] += xx1;
-		gbnd[2] -= yy1;
-		gbnd[3] += yy1;
-                }
-
-	/* if bounds not specified then quit */
-	if (gbnd[0] >= gbnd[1] || gbnd[2] >= gbnd[3])
-		{
-		fprintf(outfp,"\nGrid bounds not properly specified:\n\t%f %f %f %f\n",gbnd[0],gbnd[1],gbnd[2],gbnd[3]);
-		fprintf(outfp,"\nProgram <%s> Terminated\n",
-			program_name);
-		error = MB_ERROR_BAD_PARAMETER;
-		exit(error);
-		}
-
-	/* footprint option only for bathymetry */
-	if ((grid_mode == MBGRID_WEIGHTED_FOOTPRINT_SLOPE || grid_mode == MBGRID_WEIGHTED_FOOTPRINT)
-		&& (datatype != MBGRID_DATA_TOPOGRAPHY && datatype != MBGRID_DATA_BATHYMETRY))
-		{
-		grid_mode = MBGRID_WEIGHTED_MEAN;
-		}
-
-	/* more option not available with minimum
-		or maximum filter algorithms */
-	if (more == MB_YES
-		&& (grid_mode == MBGRID_MINIMUM_FILTER
-		    || grid_mode == MBGRID_MAXIMUM_FILTER))
-		more = MB_NO;
-
-	/* NaN cannot be used for ASCII grids */
-	if (use_NaN == MB_YES
-		&& (gridkind == MBGRID_ASCII
-		    || gridkind == MBGRID_ARCASCII))
-		use_NaN = MB_NO;
-
-	/* define NaN in case it's needed */
-	if (use_NaN == MB_YES)
-		{
-		MB_MAKE_FNAN(NaN);
-		outclipvalue = NaN;
-		}
-
-	/* deal with projected gridding */
-	if (projection_pars_f == MB_YES)
-		{
-		/* check for UTM with undefined zone */
-		if (strcmp(projection_pars, "UTM") == 0
-			|| strcmp(projection_pars, "U") == 0
-			|| strcmp(projection_pars, "utm") == 0
-			|| strcmp(projection_pars, "u") == 0)
-			{
-			reference_lon = 0.5 * (gbnd[0] + gbnd[1]);
-			if (reference_lon < 180.0)
-				reference_lon += 360.0;
-			if (reference_lon >= 180.0)
-				reference_lon -= 360.0;
-			utm_zone = (int)(((reference_lon + 183.0)
-				/ 6.0) + 0.5);
-			reference_lat = 0.5 * (gbnd[2] + gbnd[3]);
-			if (reference_lat >= 0.0)
-				sprintf(projection_id, "UTM%2.2dN", utm_zone);
-			else
-				sprintf(projection_id, "UTM%2.2dS", utm_zone);
-			}
-		else
-			strcpy(projection_id, projection_pars);
-
-		/* set projection flag */
-		use_projection = MB_YES;
-		proj_status = mb_proj_init(verbose,projection_id,
-			&(pjptr), &error);
-
-		/* if projection not successfully initialized then quit */
-		if (proj_status != MB_SUCCESS)
-			{
-			fprintf(outfp,"\nOutput projection %s not found in database\n",
-				projection_id);
-			fprintf(outfp,"\nProgram <%s> Terminated\n",
-				program_name);
-			error = MB_ERROR_BAD_PARAMETER;
-			mb_memory_clear(verbose, &error);
-			exit(error);
-			}
-
-		/* tranlate lon lat bounds from UTM if required */
-		if (gbnd[0] < -360.0 || gbnd[0] > 360.0
-			|| gbnd[1] < -360.0 || gbnd[1] > 360.0
-			|| gbnd[2] < -90.0 || gbnd[2] > 90.0
-			|| gbnd[3] < -90.0 || gbnd[3] > 90.0)
-			{
-			/* first point */
-			xx = gbnd[0];
-			yy = gbnd[2];
-			mb_proj_inverse(verbose, pjptr, xx, yy,
-					&xlon, &ylat, &error);
-			mb_apply_lonflip(verbose, lonflip, &xlon);
-			obnd[0] = xlon;
-			obnd[1] = xlon;
-			obnd[2] = ylat;
-			obnd[3] = ylat;
-
-			/* second point */
-			xx = gbnd[1];
-			yy = gbnd[2];
-			mb_proj_inverse(verbose, pjptr, xx, yy,
-					&xlon, &ylat, &error);
-			mb_apply_lonflip(verbose, lonflip, &xlon);
-			obnd[0] = MIN(obnd[0], xlon);
-			obnd[1] = MAX(obnd[1], xlon);
-			obnd[2] = MIN(obnd[2], ylat);
-			obnd[3] = MAX(obnd[3], ylat);
-
-			/* third point */
-			xx = gbnd[0];
-			yy = gbnd[3];
-			mb_proj_inverse(verbose, pjptr, xx, yy,
-					&xlon, &ylat, &error);
-			mb_apply_lonflip(verbose, lonflip, &xlon);
-			obnd[0] = MIN(obnd[0], xlon);
-			obnd[1] = MAX(obnd[1], xlon);
-			obnd[2] = MIN(obnd[2], ylat);
-			obnd[3] = MAX(obnd[3], ylat);
-
-			/* fourth point */
-			xx = gbnd[1];
-			yy = gbnd[3];
-			mb_proj_inverse(verbose, pjptr, xx, yy,
-					&xlon, &ylat, &error);
-			mb_apply_lonflip(verbose, lonflip, &xlon);
-			obnd[0] = MIN(obnd[0], xlon);
-			obnd[1] = MAX(obnd[1], xlon);
-			obnd[2] = MIN(obnd[2], ylat);
-			obnd[3] = MAX(obnd[3], ylat);
-			}
-
-		/* else translate bounds to UTM */
-		else
-			{
-			/* copy gbnd to obnd */
-			obnd[0] = gbnd[0];
-			obnd[1] = gbnd[1];
-			obnd[2] = gbnd[2];
-			obnd[3] = gbnd[3];
-
-			/* first point */
-			xlon = obnd[0];
-			ylat = obnd[2];
-			mb_proj_forward(verbose, pjptr, xlon, ylat,
-					&xx, &yy, &error);
-			gbnd[0] = xx;
-			gbnd[1] = xx;
-			gbnd[2] = yy;
-			gbnd[3] = yy;
-
-			/* second point */
-			xlon = obnd[1];
-			ylat = obnd[2];
-			mb_proj_forward(verbose, pjptr, xlon, ylat,
-					&xx, &yy, &error);
-			gbnd[0] = MIN(gbnd[0], xx);
-			gbnd[1] = MAX(gbnd[1], xx);
-			gbnd[2] = MIN(gbnd[2], yy);
-			gbnd[3] = MAX(gbnd[3], yy);
-
-			/* third point */
-			xlon = obnd[0];
-			ylat = obnd[3];
-			mb_proj_forward(verbose, pjptr, xlon, ylat,
-					&xx, &yy, &error);
-			gbnd[0] = MIN(gbnd[0], xx);
-			gbnd[1] = MAX(gbnd[1], xx);
-			gbnd[2] = MIN(gbnd[2], yy);
-			gbnd[3] = MAX(gbnd[3], yy);
-
-			/* fourth point */
-			xlon = obnd[1];
-			ylat = obnd[3];
-			mb_proj_forward(verbose, pjptr, xlon, ylat,
-					&xx, &yy, &error);
-			gbnd[0] = MIN(gbnd[0], xx);
-			gbnd[1] = MAX(gbnd[1], xx);
-			gbnd[2] = MIN(gbnd[2], yy);
-			gbnd[3] = MAX(gbnd[3], yy);
-			}
-
-		/* calculate grid properties */
-		if (set_spacing == MB_YES)
-			{
-			xdim = (gbnd[1] - gbnd[0])/dx_set + 1;
-			if (dy_set <= 0.0)
-				dy_set = dx_set;
-			ydim = (gbnd[3] - gbnd[2])/dy_set + 1;
-			if (spacing_priority == MB_YES)
-				{
-				gbnd[1] = gbnd[0] + dx_set * (xdim - 1);
-				gbnd[3] = gbnd[2] + dy_set * (ydim - 1);
-				}
-			if (units[0] == 'M' || units[0] == 'm')
-				strcpy(units, "meters");
-			else if (units[0] == 'K' || units[0] == 'k')
-				strcpy(units, "km");
-			else if (units[0] == 'F' || units[0] == 'f')
-				strcpy(units, "feet");
-			else
-				strcpy(units, "unknown");
-			}
-
-/* fprintf(outfp," Projected coordinates on: proj_status:%d  projection:%s\n",
-proj_status, projection_id);
-fprintf(outfp," Lon Lat Bounds: %f %f %f %f\n",
-obnd[0], obnd[1], obnd[2], obnd[3]);
-fprintf(outfp," XY Bounds: %f %f %f %f\n",
-gbnd[0], gbnd[1], gbnd[2], gbnd[3]);*/
-
-		}
-
-	/* deal with no projection */
-	else
-		{
-
-		/* calculate grid properties */
-		mb_coor_scale(verbose,0.5*(gbnd[2]+gbnd[3]),&mtodeglon,&mtodeglat);
-		deglontokm = 0.001/mtodeglon;
-		deglattokm = 0.001/mtodeglat;
-		if (set_spacing == MB_YES
-			&& (units[0] == 'M' || units[0] == 'm'))
-			{
-			xdim = (gbnd[1] - gbnd[0])/(mtodeglon*dx_set) + 1;
-			if (dy_set <= 0.0)
-				dy_set = mtodeglon * dx_set / mtodeglat;
-			ydim = (gbnd[3] - gbnd[2])/(mtodeglat*dy_set) + 1;
-			if (spacing_priority == MB_YES)
-				{
-				gbnd[1] = gbnd[0] + mtodeglon * dx_set * (xdim - 1);
-				gbnd[3] = gbnd[2] + mtodeglat * dy_set * (ydim - 1);
-				}
-			strcpy(units, "meters");
-			}
-		else if (set_spacing == MB_YES
-			&& (units[0] == 'K' || units[0] == 'k'))
-			{
-			xdim = (gbnd[1] - gbnd[0])*deglontokm/dx_set + 1;
-			if (dy_set <= 0.0)
-				dy_set = deglattokm * dx_set / deglontokm;
-			ydim = (gbnd[3] - gbnd[2])*deglattokm/dy_set + 1;
-			if (spacing_priority == MB_YES)
-				{
-				gbnd[1] = gbnd[0] + dx_set * (xdim - 1) / deglontokm;
-				gbnd[3] = gbnd[2] + dy_set * (ydim - 1) / deglattokm;
-				}
-			strcpy(units, "km");
-			}
-		else if (set_spacing == MB_YES
-			&& (units[0] == 'F' || units[0] == 'f'))
-			{
-			xdim = (gbnd[1] - gbnd[0])/(mtodeglon*0.3048*dx_set) + 1;
-			if (dy_set <= 0.0)
-				dy_set = mtodeglon * dx_set / mtodeglat;
-			ydim = (gbnd[3] - gbnd[2])/(mtodeglat*0.3048*dy_set) + 1;
-			if (spacing_priority == MB_YES)
-				{
-				gbnd[1] = gbnd[0] + mtodeglon * 0.3048 * dx_set * (xdim - 1);
-				gbnd[3] = gbnd[2] + mtodeglat * 0.3048 * dy_set * (ydim - 1);
-				}
-			strcpy(units, "feet");
-			}
-		else if (set_spacing == MB_YES)
-			{
-			xdim = (gbnd[1] - gbnd[0])/dx_set + 1;
-			if (dy_set <= 0.0)
-				dy_set = dx_set;
-			ydim = (gbnd[3] - gbnd[2])/dy_set + 1;
-			if (spacing_priority == MB_YES)
-				{
-				gbnd[1] = gbnd[0] + dx_set * (xdim - 1);
-				gbnd[3] = gbnd[2] + dy_set * (ydim - 1);
-				}
-			strcpy(units, "degrees");
-			}
-		}
-
-	/* calculate other grid properties */
-	dx = (gbnd[1] - gbnd[0])/(xdim-1);
-	dy = (gbnd[3] - gbnd[2])/(ydim-1);
-	factor = 4.0/(scale*scale*dx*dy);
-	offx = 0;
-	offy = 0;
-	if (extend > 0.0)
-		{
-		offx = (int) (extend*xdim);
-		offy = (int) (extend*ydim);
-		}
-	xtradim = scale + 2;
-	gxdim = xdim + 2*offx;
-	gydim = ydim + 2*offy;
-	wbnd[0] = gbnd[0] - offx*dx;
-	wbnd[1] = gbnd[1] + offx*dx;
-	wbnd[2] = gbnd[2] - offy*dy;
-	wbnd[3] = gbnd[3] + offy*dy;
-	if (datatype == MBGRID_DATA_TOPOGRAPHY)
-		topofactor = -1.0;
-	else
-		topofactor = 1.0;
-	if (bathy_in_feet == MB_YES
-		&& (datatype == MBGRID_DATA_TOPOGRAPHY
-		|| datatype == MBGRID_DATA_BATHYMETRY))
-		topofactor = topofactor / 0.3048;
-
-	/* check that dx == dy for Arc ascii grid output */
-	if (gridkind == MBGRID_ARCASCII && fabs(dx - dy) > MBGRID_TINY)
-		{
-		fprintf(outfp,"\nArc Ascii grid output (-G4) requires square cells, but grid intervals dx:%f dy:%f differ...\n", dx, dy);
-		fprintf(outfp,"\nProgram <%s> Terminated\n",
-			program_name);
-		error = MB_ERROR_BAD_PARAMETER;
-		exit(error);
-		}
-
-	/* get data input bounds in lon lat */
-	if (use_projection == MB_NO)
-		{
-		bounds[0] = wbnd[0];
-		bounds[1] = wbnd[1];
-		bounds[2] = wbnd[2];
-		bounds[3] = wbnd[3];
-		}
-	/* get min max of lon lat for data input from projected bounds */
-	else
-		{
-		/* do first point */
-		xx = wbnd[0] - (wbnd[1] - wbnd[0]);
-		yy = wbnd[2] - (wbnd[3] - wbnd[2]);
-		mb_proj_inverse(verbose, pjptr,
-					xx, yy,
-					&xlon, &ylat,
-					&error);
-		mb_apply_lonflip(verbose, lonflip, &xlon);
-		bounds[0] = xlon;
-		bounds[1] = xlon;
-		bounds[2] = ylat;
-		bounds[3] = ylat;
-
-		/* do second point */
-		xx = wbnd[0] + (wbnd[1] - wbnd[0]);
-		yy = wbnd[2] - (wbnd[3] - wbnd[2]);
-		mb_proj_inverse(verbose, pjptr,
-					xx, yy,
-					&xlon, &ylat,
-					&error);
-		mb_apply_lonflip(verbose, lonflip, &xlon);
-		bounds[0] = MIN(bounds[0], xlon);
-		bounds[1] = MAX(bounds[1], xlon);
-		bounds[2] = MIN(bounds[2], ylat);
-		bounds[3] = MAX(bounds[3], ylat);
-
-		/* do third point */
-		xx = wbnd[0] - (wbnd[1] - wbnd[0]);
-		yy = wbnd[2] + (wbnd[3] - wbnd[2]);
-		mb_proj_inverse(verbose, pjptr,
-					xx, yy,
-					&xlon, &ylat,
-					&error);
-		mb_apply_lonflip(verbose, lonflip, &xlon);
-		bounds[0] = MIN(bounds[0], xlon);
-		bounds[1] = MAX(bounds[1], xlon);
-		bounds[2] = MIN(bounds[2], ylat);
-		bounds[3] = MAX(bounds[3], ylat);
-
-		/* do fourth point */
-		xx = wbnd[0] + (wbnd[1] - wbnd[0]);
-		yy = wbnd[2] + (wbnd[3] - wbnd[2]);
-		mb_proj_inverse(verbose, pjptr,
-					xx, yy,
-					&xlon, &ylat,
-					&error);
-		mb_apply_lonflip(verbose, lonflip, &xlon);
-		bounds[0] = MIN(bounds[0], xlon);
-		bounds[1] = MAX(bounds[1], xlon);
-		bounds[2] = MIN(bounds[2], ylat);
-		bounds[3] = MAX(bounds[3], ylat);
-		}
-
-	/* extend the bounds slightly to be sure no data gets missed */
-	xx = MIN(0.05*(bounds[1] - bounds[0]), 0.1);
-	yy = MIN(0.05*(bounds[3] - bounds[2]), 0.1);
-	bounds[0] = bounds[0] - xx;
-	bounds[1] = bounds[1] + xx;
-	bounds[2] = bounds[2] - yy;
-	bounds[3] = bounds[3] + yy;
-
-	/* figure out lonflip for data bounds */
-	if (bounds[0] < -180.0)
-		lonflip = -1;
-	else if (bounds[1] > 180.0)
-		lonflip = 1;
-	else if (lonflip == -1 && bounds[1] > 0.0)
-		lonflip = 0;
-	else if (lonflip == 1 && bounds[0] < 0.0)
-		lonflip = 0;
-
-	/* check interpolation parameters */
-	if ((clipmode == MBGRID_INTERP_GAP
-		|| clipmode == MBGRID_INTERP_NEAR)
-		&& clip > xdim && clip > ydim)
-		clipmode = MBGRID_INTERP_ALL;
-        if (clipmode == MBGRID_INTERP_ALL)
-                clip = MAX(xdim, ydim);
-        
-        /* set origin used to reduce data value size before conversion from
-         * double to float when calling the interpolation routines */
-        bdata_origin_x = 0.5 * (wbnd[0] + wbnd[1]);
-        bdata_origin_y = 0.5 * (wbnd[2] + wbnd[3]);
-
-	/* set plot label strings */
-	if (use_projection == MB_YES)
-		{
-		sprintf(xlabel,"Easting (%s)", units);
-		sprintf(ylabel,"Northing (%s)", units);
-		}
-	else
-		{
-		strcpy(xlabel,"Longitude");
-		strcpy(ylabel,"Latitude");
-		}
-	if (datatype == MBGRID_DATA_BATHYMETRY)
-		{
-		if (bathy_in_feet == MB_YES)
-			strcpy(zlabel,"Depth (ft)");
-		else
-			strcpy(zlabel,"Depth (m)");
-		strcpy(nlabel,"Number of Depth Data Points");
-		if (bathy_in_feet == MB_YES)
-			strcpy(sdlabel,"Depth Standard Deviation (ft)");
-		else
-			strcpy(sdlabel,"Depth Standard Deviation (m)");
-		strcpy(title,"Bathymetry Grid");
-		}
-	else if (datatype == MBGRID_DATA_TOPOGRAPHY)
-		{
-		if (bathy_in_feet == MB_YES)
-			strcpy(zlabel,"Topography (ft)");
-		else
-			strcpy(zlabel,"Topography (m)");
-		strcpy(nlabel,"Number of Topography Data Points");
-		if (bathy_in_feet == MB_YES)
-			strcpy(sdlabel,"Topography Standard Deviation (ft)");
-		else
-			strcpy(sdlabel,"Topography Standard Deviation (m)");
-		strcpy(title,"Topography Grid");
-		}
-	else if (datatype == MBGRID_DATA_AMPLITUDE)
-		{
-		strcpy(zlabel,"Amplitude");
-		strcpy(nlabel,"Number of Amplitude Data Points");
-		strcpy(sdlabel,"Amplitude Standard Deviation (m)");
-		strcpy(title,"Amplitude Grid");
-		}
-	else if (datatype == MBGRID_DATA_SIDESCAN)
-		{
-		strcpy(zlabel,"Sidescan");
-		strcpy(nlabel,"Number of Sidescan Data Points");
-		strcpy(sdlabel,"Sidescan Standard Deviation (m)");
-		strcpy(title,"Sidescan Grid");
-		}
-
-	/* output info */
-	if (verbose >= 0)
-		{
-		fprintf(outfp,"\nMBGRID Parameters:\n");
-		fprintf(outfp,"List of input files: %s\n",filelist);
-		fprintf(outfp,"Output fileroot:     %s\n",fileroot);
-		fprintf(outfp,"Input Data Type:     ");
-		if (datatype == MBGRID_DATA_BATHYMETRY)
-			{
-			fprintf(outfp,"Bathymetry\n");
-			if (bathy_in_feet == MB_YES)
-				fprintf(outfp,"Bathymetry gridded in feet\n");
-			}
-		else if (datatype == MBGRID_DATA_TOPOGRAPHY)
-			{
-			fprintf(outfp,"Topography\n");
-			if (bathy_in_feet == MB_YES)
-				fprintf(outfp,"Topography gridded in feet\n");
-			}
-		else if (datatype == MBGRID_DATA_AMPLITUDE)
-			fprintf(outfp,"Amplitude\n");
-		else if (datatype == MBGRID_DATA_SIDESCAN)
-			fprintf(outfp,"Sidescan\n");
-		else
-			fprintf(outfp,"Unknown?\n");
-		fprintf(outfp,"Gridding algorithm:  ");
-		if (grid_mode == MBGRID_MEDIAN_FILTER)
-			fprintf(outfp,"Median Filter\n");
-		else if (grid_mode == MBGRID_MINIMUM_FILTER)
-			fprintf(outfp,"Minimum Filter\n");
-		else if (grid_mode == MBGRID_MAXIMUM_FILTER)
-			fprintf(outfp,"Maximum Filter\n");
-		else if (grid_mode == MBGRID_WEIGHTED_FOOTPRINT_SLOPE)
-			fprintf(outfp,"Footprint-Slope Weighted Mean\n");
-		else if (grid_mode == MBGRID_WEIGHTED_FOOTPRINT)
-			fprintf(outfp,"Footprint Weighted Mean\n");
-		else
-			fprintf(outfp,"Gaussian Weighted Mean\n");
-		fprintf(outfp,"Grid projection: %s\n", projection_id);
-		if (use_projection == MB_YES)
-			{
-			fprintf(outfp,"Projection ID: %s\n", projection_id);
-			}
-		fprintf(outfp,"Grid dimensions: %d %d\n",xdim,ydim);
-		fprintf(outfp,"Grid bounds:\n");
-		if (use_projection == MB_YES)
-			{
-			fprintf(outfp,"  Eastings:  %9.4f %9.4f\n",gbnd[0],gbnd[1]);
-			fprintf(outfp,"  Northings: %9.4f %9.4f\n",gbnd[2],gbnd[3]);
-			fprintf(outfp,"  Longitude: %9.4f %9.4f\n",obnd[0],obnd[1]);
-			fprintf(outfp,"  Latitude:  %9.4f %9.4f\n",obnd[2],obnd[3]);
-			}
-		else
-			{
-			fprintf(outfp,"  Longitude: %9.4f %9.4f\n",gbnd[0],gbnd[1]);
-			fprintf(outfp,"  Latitude:  %9.4f %9.4f\n",gbnd[2],gbnd[3]);
-			}
-                if (boundsfactor > 1.0)
-                    fprintf(outfp,"  Grid bounds correspond to %f times actual data coverage\n",boundsfactor);
- 		fprintf(outfp,"Working grid dimensions: %d %d\n",gxdim,gydim);
-		if (use_projection == MB_YES)
-			{
-			fprintf(outfp,"Working Grid bounds:\n");
-			fprintf(outfp,"  Eastings:  %9.4f %9.4f\n",wbnd[0],wbnd[1]);
-			fprintf(outfp,"  Northings: %9.4f %9.4f\n",wbnd[2],wbnd[3]);
-			fprintf(outfp,"Easting interval:  %f %s\n",
-				dx,units);
-			fprintf(outfp,"Northing interval: %f %s\n",
-				dy,units);
-			if (set_spacing == MB_YES)
-				{
-				fprintf(outfp,"Specified Easting interval:  %f %s\n",
-					dx_set, units);
-				fprintf(outfp,"Specified Northing interval: %f %s\n",
-					dy_set, units);
-				}
-			}
-		else
-			{
-			fprintf(outfp,"Working Grid bounds:\n");
-			fprintf(outfp,"  Longitude: %9.4f %9.4f\n",wbnd[0],wbnd[1]);
-			fprintf(outfp,"  Latitude:  %9.4f %9.4f\n",wbnd[2],wbnd[3]);
-			fprintf(outfp,"Longitude interval: %f degrees or %f m\n",
-				dx,1000*dx*deglontokm);
-			fprintf(outfp,"Latitude interval:  %f degrees or %f m\n",
-				dy,1000*dy*deglattokm);
-			if (set_spacing == MB_YES)
-				{
-				fprintf(outfp,"Specified Longitude interval: %f %s\n",
-					dx_set, units);
-				fprintf(outfp,"Specified Latitude interval:  %f %s\n",
-					dy_set, units);
-				}
-			}
-		fprintf(outfp,"Input data bounds:\n");
-		fprintf(outfp,"  Longitude: %9.4f %9.4f\n",bounds[0],bounds[1]);
-		fprintf(outfp,"  Latitude:  %9.4f %9.4f\n",bounds[2],bounds[3]);
-		if (grid_mode == MBGRID_WEIGHTED_MEAN)
-			fprintf(outfp,"Gaussian filter 1/e length: %f grid intervals\n",
-				scale);
-		if (grid_mode == MBGRID_WEIGHTED_FOOTPRINT_SLOPE
-                        || grid_mode == MBGRID_WEIGHTED_FOOTPRINT)
-			fprintf(outfp,"Footprint 1/e distance: %f times footprint\n",
-				scale);
-		if (check_time == MB_YES && first_in_stays == MB_NO)
-			fprintf(outfp,"Swath overlap handling:       Last data used\n");
-		if (check_time == MB_YES && first_in_stays == MB_YES)
-			fprintf(outfp,"Swath overlap handling:       First data used\n");
-		if (check_time == MB_YES)
-			fprintf(outfp,"Swath overlap time threshold: %f minutes\n",
-				timediff/60.);
-		if (clipmode == MBGRID_INTERP_NONE)
-			fprintf(outfp,"Spline interpolation not applied\n");
-		else if (clipmode == MBGRID_INTERP_GAP)
-			{
-			fprintf(outfp,"Spline interpolation applied to fill data gaps\n");
-			fprintf(outfp,"Spline interpolation clipping dimension: %d\n",clip);
-			fprintf(outfp,"Spline tension (range 0.0 to infinity): %f\n",tension);
-			}
-		else if (clipmode == MBGRID_INTERP_NEAR)
-			{
-			fprintf(outfp,"Spline interpolation applied near data\n");
-			fprintf(outfp,"Spline interpolation clipping dimension: %d\n",clip);
-			fprintf(outfp,"Spline tension (range 0.0 to infinity): %f\n",tension);
-			}
-		else if (clipmode == MBGRID_INTERP_ALL)
-			{
-			fprintf(outfp,"Spline interpolation applied to fill entire grid\n");
-			fprintf(outfp,"Spline tension (range 0.0 to infinity): %f\n",tension);
-			}
-		if (grdrasterid == 0)
-			fprintf(outfp,"Background not applied\n");
-		else if (grdrasterid < 0)
-			fprintf(outfp,"Background obtained using grd2xyz from GMT grid file: %s\n",backgroundfile);
-		else
-			fprintf(outfp,"Background obtained using grdraster from dataset: %d\n",grdrasterid);
-		if (gridkind == MBGRID_ASCII)
-			fprintf(outfp,"Grid format %d:  ascii table\n",gridkind);
-		else if (gridkind == MBGRID_CDFGRD)
-			fprintf(outfp,"Grid format %d:  GMT version 2 grd (netCDF)\n",gridkind);
-		else if (gridkind == MBGRID_OLDGRD)
-			fprintf(outfp,"Grid format %d:  GMT version 1 grd (binary)\n",gridkind);
-		else if (gridkind == MBGRID_ARCASCII)
-			fprintf(outfp,"Grid format %d:  Arc/Info ascii table\n",gridkind);
-		else if (gridkind == MBGRID_GMTGRD)
-			{
-			fprintf(outfp,"Grid format %d:  GMT grid\n",gridkind);
-			if (strlen(gridkindstring) > 0)
-				fprintf(outfp,"GMT Grid ID:     %s\n",gridkindstring);
-			}
-		if (use_NaN == MB_YES)
-			fprintf(outfp,"NaN values used to flag regions with no data\n");
-		else
-			fprintf(outfp,"Real value of %f used to flag regions with no data\n",
-				outclipvalue);
-		if (more == MB_YES)
-			fprintf(outfp,"Data density and sigma grids also created\n");
-		fprintf(outfp,"MBIO parameters:\n");
-		fprintf(outfp,"  Ping averaging:       %d\n",pings);
-		fprintf(outfp,"  Longitude flipping:   %d\n",lonflip);
-		fprintf(outfp,"  Speed minimum:      %4.1f km/hr\n",speedmin);
-		}
-	if (verbose > 0)
-		fprintf(outfp,"\n");
-
-	/* if grdrasterid set extract background data
-		and interpolate it later onto internal grid */
-	if (grdrasterid != 0)
-		{
-		if (grdrasterid > 0)
-			fprintf(outfp,"\nExtracting background from grdraster dataset %d...\n",grdrasterid);
-		else
-			fprintf(outfp,"\nExtracting background from grid file %s...\n",backgroundfile);
-
-		/* guess about twice the data actually expected */
-		if (use_projection == MB_YES)
-			nbackground_alloc = 2 * gxdim * gydim;
-		else
-			nbackground_alloc = 2 * gxdim * gydim;
-
-		/* allocate and initialize background data arrays */
-#ifdef USESURFACE
-		status = mb_mallocd(verbose,__FILE__,__LINE__,nbackground_alloc*sizeof(float),(void **)&bxdata,&error);
-		if (status == MB_SUCCESS)
-			status = mb_mallocd(verbose,__FILE__,__LINE__,nbackground_alloc*sizeof(float),(void **)&bydata,&error);
-		if (status == MB_SUCCESS)
-			status = mb_mallocd(verbose,__FILE__,__LINE__,nbackground_alloc*sizeof(float),(void **)&bzdata,&error);
-		if (error != MB_ERROR_NO_ERROR)
-			{
-			mb_error(verbose,MB_ERROR_MEMORY_FAIL,&message);
-			fprintf(outfp,"\nMBIO Error allocating background data array:\n%s\n",
-				message);
-			fprintf(outfp,"\nProgram <%s> Terminated\n",
-				program_name);
-			mb_memory_clear(verbose, &error);
-			exit(error);
-			}
-		memset((char *)bxdata,0,nbackground_alloc*sizeof(float));
-		memset((char *)bydata,0,nbackground_alloc*sizeof(float));
-		memset((char *)bzdata,0,nbackground_alloc*sizeof(float));
-#else
-		status = mb_mallocd(verbose,__FILE__,__LINE__,3*nbackground_alloc*sizeof(float),(void **)&bdata,&error);
-		if (error != MB_ERROR_NO_ERROR)
-			{
-			mb_error(verbose,MB_ERROR_MEMORY_FAIL,&message);
-			fprintf(outfp,"\nMBIO Error allocating background interpolation work arrays:\n%s\n",
-				message);
-			fprintf(outfp,"\nProgram <%s> Terminated\n",
-				program_name);
-			mb_memory_clear(verbose, &error);
-			exit(error);
-			}
-		memset((char *)bdata,0,3*nbackground_alloc*sizeof(float));
-#endif
-
-		/* get initial grid using grdraster */
-		if (grdrasterid > 0)
-			{
-			sprintf(backgroundfile,"tmpgrdraster%d.grd", pid);
-			sprintf(plot_cmd, "grdraster %d -R%f/%f/%f/%f -G%s",
-				grdrasterid,bounds[0],bounds[1],bounds[2],bounds[3],backgroundfile);
-			fprintf(stderr, "Executing: %s\n", plot_cmd);
-			fork_status = system(plot_cmd);
-			if (fork_status != 0)
-				{
-				fprintf(outfp,"\nExecution of command:\n\t%s\nby system() call failed....\nProgram <%s> Terminated\n",
-						plot_cmd,program_name);
-				error = MB_ERROR_BAD_PARAMETER;
-				mb_memory_clear(verbose, &error);
-				exit(error);
-				}
-			}
-
-		/* if needed translate grid to normal registration */
-		sprintf(plot_cmd, "grdinfo %s", backgroundfile);
-		strcpy(backgroundfileuse, backgroundfile);
-		if ((rfp = popen(plot_cmd,"r")) != NULL)
-			{
-			/* parse the grdinfo results */
-			bufptr = fgets(plot_stdout, MB_COMMENT_MAXLINE, rfp);
-			bufptr = fgets(plot_stdout, MB_COMMENT_MAXLINE, rfp);
-			bufptr = fgets(plot_stdout, MB_COMMENT_MAXLINE, rfp);
-			bufptr = fgets(plot_stdout, MB_COMMENT_MAXLINE, rfp);
-			pclose(rfp);
-			if (strncmp(plot_stdout,"Pixel node registration used", 28) == 0)
-				{
-				sprintf(backgroundfileuse, "tmpgrdsampleT%d.grd", pid);
-				sprintf(plot_cmd, "grdsample %s -G%s -T",
-					backgroundfile, backgroundfileuse);
-				fprintf(stderr, "Executing: %s\n", plot_cmd);
-				fork_status = system(plot_cmd);
-				if (fork_status != 0)
-					{
-					fprintf(outfp,"\nExecution of command:\n\t%s\nby system() call failed....\nProgram <%s> Terminated\n",
-							plot_cmd,program_name);
-					error = MB_ERROR_BAD_PARAMETER;
-					mb_memory_clear(verbose, &error);
-					exit(error);
-					}
-				}
-			}
-		else
-			{
-			fprintf(outfp,"\nBackground data not extracted as per -K option\n");
-			if (grdrasterid > 0)
-				{
-				fprintf(outfp,"The program grdraster may not have been found\n");
-				fprintf(outfp,"or the specified background dataset %d may not exist.\n",
-					grdrasterid);
-				}
-			else
-				{
-				fprintf(outfp,"The specified background dataset %s may not exist.\n",
-					backgroundfile);
-				}
-			fprintf(outfp,"\nProgram <%s> Terminated\n",
-				program_name);
-			error = MB_ERROR_BAD_PARAMETER;
-			mb_memory_clear(verbose, &error);
-			exit(error);
-			}
-
-		/* resample extracted grid to have similar resolution as working grid */
-		sprintf(plot_cmd, "grdsample %s -Gtmpgrdsample%d.grd -R%.12f/%.12f/%.12f/%.12f -I%.12f/%.12f",
-				backgroundfileuse, pid,bounds[0],bounds[1],bounds[2],bounds[3], dx, dy);
-		fprintf(stderr, "Executing: %s\n", plot_cmd);
-		fork_status = system(plot_cmd);
-		if (fork_status != 0)
-			{
-			fprintf(outfp,"\nExecution of command:\n\t%s\nby system() call failed....\nProgram <%s> Terminated\n",
-					plot_cmd,program_name);
-			error = MB_ERROR_BAD_PARAMETER;
-			mb_memory_clear(verbose, &error);
-			exit(error);
-			}
-
-		/* extract points with preprocessing if that will help */
-		if (use_projection == MB_NO)
-			{
-			sprintf(plot_cmd, "grd2xyz tmpgrdsample%d.grd -s -bo | blockmean -bi -bo -C -R%f/%f/%f/%f -I%.12f/%.12f",
-				pid, bounds[0], bounds[1], bounds[2], bounds[3], dx, dy);
-			}
-		else
-			{
-			sprintf(plot_cmd, "grd2xyz tmpgrdsample%d.grd -S -bo",
-				pid);
-			}
-		fprintf(stderr, "Executing: %s\n", plot_cmd);
-		if ((rfp = popen(plot_cmd,"r")) != NULL)
-			{
-			/* loop over reading */
-			nbackground = 0;
-			while (fread(&tlon, sizeof(double), 1, rfp) == 1)
-				{
-				freadsize = fread(&tlat, sizeof(double), 1, rfp);
-				freadsize = fread(&tvalue, sizeof(double), 1, rfp);
-				if (lonflip == -1 && tlon > 0.0)
-					tlon -= 360.0;
-				else if (lonflip == 0 && tlon < -180.0)
-					tlon += 360.0;
-				else if (lonflip == 0 && tlon > 180.0)
-					tlon -= 360.0;
-				else if (lonflip == 1 && tlon < 0.0)
-					tlon += 360.0;
-				if (use_projection == MB_YES)
-					mb_proj_forward(verbose, pjptr, tlon, tlat,
-					&tlon, &tlat, &error);
-#ifdef USESURFACE
-				if (nbackground >= nbackground_alloc)
-					{
-					nbackground_alloc += 10000;
-					status = mb_reallocd(verbose,__FILE__,__LINE__,nbackground_alloc*sizeof(float),(void **)&bxdata,&error);
-					if (status == MB_SUCCESS)
-						status = mb_reallocd(verbose,__FILE__,__LINE__,nbackground_alloc*sizeof(float),(void **)&bydata,&error);
-					if (status == MB_SUCCESS)
-						status = mb_reallocd(verbose,__FILE__,__LINE__,nbackground_alloc*sizeof(float),(void **)&bzdata,&error);
-					if (error != MB_ERROR_NO_ERROR)
-						{
-						mb_error(verbose,MB_ERROR_MEMORY_FAIL,&message);
-						fprintf(outfp,"\nMBIO Error reallocating background data array:\n%s\n",
-							message);
-						fprintf(outfp,"\nProgram <%s> Terminated\n",
-							program_name);
-						mb_memory_clear(verbose, &error);
-						exit(error);
-						}
-					}
-				bxdata[nbackground] = (float) (tlon - bdata_origin_x);
-				bydata[nbackground] = (float) (tlat - bdata_origin_y);
-				bzdata[nbackground] = (float) tvalue;
-#else
-				if (nbackground >= nbackground_alloc)
-					{
-					nbackground_alloc += 10000;
-					status = mb_reallocd(verbose,__FILE__,__LINE__,3*nbackground_alloc*sizeof(float),(void **)&bdata,&error);
-					if (error != MB_ERROR_NO_ERROR)
-						{
-						mb_error(verbose,MB_ERROR_MEMORY_FAIL,&message);
-						fprintf(outfp,"\nMBIO Error allocating background interpolation work arrays:\n%s\n",
-							message);
-						fprintf(outfp,"\nProgram <%s> Terminated\n",
-							program_name);
-						mb_memory_clear(verbose, &error);
-						exit(error);
-						}
-					}
-				bdata[nbackground*3] = (float) (tlon - bdata_origin_x);
-				bdata[nbackground*3+1] = (float) (tlat - bdata_origin_y);
-				bdata[nbackground*3+2] = (float) tvalue;
-#endif
-				nbackground++;
-				}
-			pclose(rfp);
-			}
-		else
-			{
-			fprintf(outfp,"\nBackground data not extracted as per -K option\n");
-			fprintf(outfp,"The program grdraster may not have been found\n");
-			fprintf(outfp,"or the specified background dataset %d may not exist.\n",
-				grdrasterid);
-			fprintf(outfp,"\nProgram <%s> Terminated\n",
-				program_name);
-			error = MB_ERROR_BAD_PARAMETER;
-			mb_memory_clear(verbose, &error);
-			exit(error);
-			}
-
-		/* delete any temporary files */
-		sprintf(plot_cmd, "rm tmpgrd*%d.grd", pid);
-		fprintf(stderr, "Executing: %s\n", plot_cmd);
-		fork_status = system(plot_cmd);
-		if (fork_status != 0)
-			{
-			fprintf(outfp,"\nExecution of command:\n\t%s\nby system() call failed....\nProgram <%s> Terminated\n",
-					plot_cmd,program_name);
-			error = MB_ERROR_BAD_PARAMETER;
-			mb_memory_clear(verbose, &error);
-			exit(error);
-			}
-		}
-
-	/* allocate memory for grid arrays */
-	status = mb_mallocd(verbose,__FILE__,__LINE__,gxdim*gydim*sizeof(double),(void **)&grid,&error);
-	if (status == MB_SUCCESS)
-	status = mb_mallocd(verbose,__FILE__,__LINE__,gxdim*gydim*sizeof(double),(void **)&sigma,&error);
-	if (status == MB_SUCCESS)
-	status = mb_mallocd(verbose,__FILE__,__LINE__,gxdim*gydim*sizeof(double),(void **)&firsttime,&error);
-	if (status == MB_SUCCESS)
-	status = mb_mallocd(verbose,__FILE__,__LINE__,gxdim*gydim*sizeof(int),(void **)&cnt,&error);
-	if (status == MB_SUCCESS)
-	status = mb_mallocd(verbose,__FILE__,__LINE__,gxdim*gydim*sizeof(int),(void **)&num,&error);
-	if (status == MB_SUCCESS)
-	status = mb_mallocd(verbose,__FILE__,__LINE__,xdim*ydim*sizeof(float),(void **)&output,&error);
-
-	/* if error initializing memory then quit */
-	if (error != MB_ERROR_NO_ERROR)
-		{
-		mb_error(verbose,error,&message);
-		fprintf(outfp,"\nMBIO Error allocating data arrays:\n%s\n",
-			message);
-		fprintf(outfp,"\nProgram <%s> Terminated\n",
-			program_name);
-		mb_memory_clear(verbose, &error);
-		exit(error);
-		}
-
-	/* open datalist file for list of all files that contribute to the grid */
-	strcpy(dfile,fileroot);
-	strcat(dfile,".mb-1");
-	if ((dfp = fopen(dfile,"w")) == NULL)
-		{
-		error = MB_ERROR_OPEN_FAIL;
-		fprintf(outfp,"\nUnable to open datalist file: %s\n",
-			dfile);
-		}
-
-	/***** do weighted footprint slope gridding *****/
-	if (grid_mode == MBGRID_WEIGHTED_FOOTPRINT_SLOPE)
-	{
-	/* set up parameters for first cut low resolution slope grid */
-	for (i=0;i<4;i++)
-		sbnd[i] = wbnd[i];
-	sdx = 2.0 * dx;
-	sdy = 2.0 * dy;
-	sxdim = gxdim  / 2;
-	sydim = gydim  / 2;
-	sclip = MAX(gxdim, gydim);
-
-	/* allocate memory for additional arrays */
-	status = mb_mallocd(verbose,__FILE__,__LINE__,gxdim*gydim*sizeof(double),(void **)&norm,&error);
-	status = mb_mallocd(verbose,__FILE__,__LINE__,sxdim*sydim*sizeof(double),(void **)&gridsmall,&error);
-
-	/* if error initializing memory then quit */
-	if (error != MB_ERROR_NO_ERROR)
-		{
-		mb_error(verbose,error,&message);
-		fprintf(outfp,"\nMBIO Error allocating data arrays:\n%s\n",
-			message);
-		fprintf(outfp,"\nProgram <%s> Terminated\n",
-			program_name);
-		mb_memory_clear(verbose, &error);
-		exit(error);
-		}
-
-	/* do first pass using simple mean to get low-resolution quick bathymetry to provide bottom slope
-		estimates for footprint gridding */
-
-	/* initialize arrays */
-	for (i=0;i<sxdim;i++)
-		for (j=0;j<sydim;j++)
-			{
-			kgrid = i * sydim + j;
-			gridsmall[kgrid] = 0.0;
-			cnt[kgrid] = 0;
-			}
-
-	/* read in data */
-	fprintf(outfp,"\nDoing first pass to generate low resolution slope grid...\n");
-	ndata = 0;
-	if ((status = mb_datalist_open(verbose,&datalist,
-					filelist,look_processed,&error)) != MB_SUCCESS)
-		{
-		error = MB_ERROR_OPEN_FAIL;
-		fprintf(outfp,"\nUnable to open data list file: %s\n",
-			filelist);
-		fprintf(outfp,"\nProgram <%s> Terminated\n",
-			program_name);
-		mb_memory_clear(verbose, &error);
-		exit(error);
-		}
-	while ((status = mb_datalist_read2(verbose,datalist,
-			&pstatus,path,ppath,&format,&file_weight,&error))
-			== MB_SUCCESS)
-		{
-		ndatafile = 0;
-
-		/* if format > 0 then input is swath sonar file */
-		if (format > 0 && path[0] != '#')
-		{
-		/* apply pstatus */
-		if (pstatus == MB_PROCESSED_USE)
-			strcpy(file, ppath);
-		else
-			strcpy(file, path);
-
-		/* check for mbinfo file - get file bounds if possible */
-		rformat = format;
-		strcpy(rfile,file);
-		status = mb_check_info(verbose, rfile, lonflip, bounds,
-				&file_in_bounds, &error);
-		if (status == MB_FAILURE)
-			{
-			file_in_bounds = MB_YES;
-			status = MB_SUCCESS;
-			error = MB_ERROR_NO_ERROR;
-			}
-
-		/* initialize the swath sonar file */
-		if (file_in_bounds == MB_YES)
-		    {
-		    /* check for "fast bathymetry" or "fbt" file */
-		    if (datatype == MBGRID_DATA_TOPOGRAPHY
-			    || datatype == MBGRID_DATA_BATHYMETRY)
-			{
-			mb_get_fbt(verbose, rfile, &rformat, &error);
-			}
-
-		    /* call mb_read_init() */
-		    if ((status = mb_read_init(
-			verbose,rfile,rformat,pings,lonflip,bounds,
-			btime_i,etime_i,speedmin,timegap,
-			&mbio_ptr,&btime_d,&etime_d,
-			&beams_bath,&beams_amp,&pixels_ss,&error)) != MB_SUCCESS)
-			{
-			mb_error(verbose,error,&message);
-			fprintf(outfp,"\nMBIO Error returned from function <mb_read_init>:\n%s\n",message);
-			fprintf(outfp,"\nMultibeam File <%s> not initialized for reading\n",rfile);
-			fprintf(outfp,"\nProgram <%s> Terminated\n",
-				program_name);
-			mb_memory_clear(verbose, &error);
-			exit(error);
-			}
-
-		    /* get mb_io_ptr */
-		    mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-                    
-                    /* get topography type */
-                    status = mb_sonartype(verbose, mbio_ptr, mb_io_ptr->store_data, &topo_type, &error);
-
-		    /* allocate memory for reading data arrays */
-		    if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							    sizeof(char), (void **)&beamflag, &error);
-		    if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							    sizeof(double), (void **)&bath, &error);
-		    if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_AMPLITUDE,
-							    sizeof(double), (void **)&amp, &error);
-		    if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							    sizeof(double), (void **)&bathlon, &error);
-		    if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							    sizeof(double), (void **)&bathlat, &error);
-		    if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_SIDESCAN,
-							    sizeof(double), (void **)&ss, &error);
-		    if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_SIDESCAN,
-							    sizeof(double), (void **)&sslon, &error);
-		    if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_SIDESCAN,
-							    sizeof(double), (void **)&sslat, &error);
-
-		    /* if error initializing memory then quit */
-		    if (error != MB_ERROR_NO_ERROR)
-			{
-			mb_error(verbose,error,&message);
-			fprintf(outfp,"\nMBIO Error allocating data arrays:\n%s\n",
-				message);
-			fprintf(outfp,"\nProgram <%s> Terminated\n",
-				program_name);
-			mb_memory_clear(verbose, &error);
-			exit(error);
-			}
-
-		    /* loop over reading */
-		    while (error <= MB_ERROR_NO_ERROR)
-			{
-			status = mb_read(verbose,mbio_ptr,&kind,
-				&rpings,time_i,&time_d,
-				&navlon,&navlat,
-				&speed,&heading,
-				&distance,&altitude,&sonardepth,
-				&beams_bath,&beams_amp,&pixels_ss,
-				beamflag,bath,amp,bathlon,bathlat,
-				ss,sslon,sslat,
-				comment,&error);
-
-			/* time gaps are not a problem here */
-			if (error == MB_ERROR_TIME_GAP)
-				{
-				error = MB_ERROR_NO_ERROR;
-				status = MB_SUCCESS;
-				}
-
-			/* print debug statements */
-			if (verbose >= 2)
-				{
-				fprintf(outfp,"\ndbg2  Ping read in program <%s>\n",program_name);
-				fprintf(outfp,"dbg2       kind:           %d\n",kind);
-				fprintf(outfp,"dbg2       beams_bath:     %d\n",beams_bath);
-				fprintf(outfp,"dbg2       beams_amp:      %d\n",beams_amp);
-				fprintf(outfp,"dbg2       pixels_ss:      %d\n",pixels_ss);
-				fprintf(outfp,"dbg2       error:          %d\n",error);
-				fprintf(outfp,"dbg2       status:         %d\n",status);
-				}
-
-			if ((datatype == MBGRID_DATA_BATHYMETRY
-				|| datatype == MBGRID_DATA_TOPOGRAPHY)
-				&& error == MB_ERROR_NO_ERROR)
-			  {
-
-			  /* reproject beam positions if necessary */
-			  if (use_projection == MB_YES)
-			    {
-			    mb_proj_forward(verbose, pjptr,
-					    navlon, navlat,
-					    &navlon, &navlat,
-					    &error);
-			    for (ib=0;ib<beams_bath;ib++)
-			      if (mb_beam_ok(beamflag[ib]))
-				mb_proj_forward(verbose, pjptr,
-						bathlon[ib], bathlat[ib],
-						&bathlon[ib], &bathlat[ib],
-						&error);
-			    }
-
-			  /* deal with data */
-			  for (ib=0;ib<beams_bath;ib++)
-			    if (mb_beam_ok(beamflag[ib]))
-			      {
-			      /* get position in grid */
-			      ix = (bathlon[ib] - wbnd[0] + dx) / sdx;
-			      iy = (bathlat[ib] - wbnd[2] + dy) / sdy;
-/*fprintf(outfp, "\nib:%d ix:%d iy:%d   bath: lon:%f lat:%f bath:%f   nav: lon:%f lat:%f\n",
-ib, ix, iy, bathlon[ib], bathlat[ib], bath[ib], navlon, navlat);*/
-
-			      /* process if in region of interest */
-			      if (ix >= 0
-				&& ix < sxdim
-				&& iy >= 0
-				&& iy < sydim)
-			        {
-				kgrid = ix * sydim + iy;
-				gridsmall[kgrid] += topofactor * bath[ib];
-				cnt[kgrid]++;
-				ndata++;
-				ndatafile++;
-				}
-			      }
-			  }
-			}
-		    status = mb_close(verbose,&mbio_ptr,&error);
-		    status = MB_SUCCESS;
-		    error = MB_ERROR_NO_ERROR;
-		    }
-		if (verbose >= 2)
-			fprintf(outfp,"\n");
-		if (verbose > 0 || file_in_bounds == MB_YES)
-			fprintf(outfp,"%d data points processed in %s\n",
-				ndatafile,rfile);
-
-		/* add to datalist if data actually contributed */
-		if (ndatafile > 0 && dfp != NULL)
-			{
-			if (pstatus == MB_PROCESSED_USE)
-				fprintf(dfp, "P:");
-			else
-				fprintf(dfp, "R:");
-			fprintf(dfp, "%s %d %f\n", path, format, file_weight);
-			fflush(dfp);
-			}
-		} /* end if (format > 0) */
-
-		}
-	if (datalist != NULL)
-		mb_datalist_close(verbose,&datalist,&error);
-	if (verbose > 0)
-		fprintf(outfp,"\n%d total data points processed\n",ndata);
-
-	/* close datalist if necessary */
-	if (dfp != NULL)
-		{
-		fclose(dfp);
-		dfp = NULL;
-		}
-
-	/* now loop over all points in the low resolution grid */
-	if (verbose >= 1)
-		fprintf(outfp,"\nMaking low resolution slope grid...\n");
-	ndata = 8;
-	for (i=0;i<sxdim;i++)
-		for (j=0;j<sydim;j++)
-			{
-			kgrid = i * sydim + j;
-			if (cnt[kgrid] > 0)
-				{
-				gridsmall[kgrid] = gridsmall[kgrid]/((double)cnt[kgrid]);
-				ndata++;
-				}
-			}
-
-	/* now fill in the low resolution grid with interpolation */
-#ifdef USESURFACE
-	/* allocate and initialize sgrid */
-	status = mb_mallocd(verbose,__FILE__,__LINE__,ndata*sizeof(float),(void **)&sxdata,&error);
-	if (status == MB_SUCCESS)
-		status = mb_mallocd(verbose,__FILE__,__LINE__,ndata*sizeof(float),(void **)&sydata,&error);
-	if (status == MB_SUCCESS)
-		status = mb_mallocd(verbose,__FILE__,__LINE__,ndata*sizeof(float),(void **)&szdata,&error);
-	if (status == MB_SUCCESS)
-		status = mb_mallocd(verbose,__FILE__,__LINE__,sxdim*sydim*sizeof(float),(void **)&sgrid,&error);
-	if (error != MB_ERROR_NO_ERROR)
-		{
-		mb_error(verbose,MB_ERROR_MEMORY_FAIL,&message);
-		fprintf(outfp,"\nMBIO Error allocating interpolation work arrays:\n%s\n",
-			message);
-		fprintf(outfp,"\nProgram <%s> Terminated\n",
-			program_name);
-		mb_memory_clear(verbose, &error);
-		exit(error);
-		}
-	memset((char *)sgrid,0,sxdim*sydim*sizeof(float));
-	memset((char *)sxdata,0,ndata*sizeof(float));
-	memset((char *)sydata,0,ndata*sizeof(float));
-	memset((char *)szdata,0,ndata*sizeof(float));
-
-	/* get points from grid */
-        /* simultaneously find the depth values nearest to the grid corners and edge midpoints */
-	ndata = 0;
-  	for (i=0;i<sxdim;i++)
-		for (j=0;j<sydim;j++)
-			{
-			kgrid = i * sydim + j;
-			if (cnt[kgrid] > 0)
-				{
-				sxdata[ndata] = (float)(wbnd[0] + sdx * i - bdata_origin_x);
-				sydata[ndata] = (float)(wbnd[2] + sdy * j - bdata_origin_y);
-				szdata[ndata] = (float)gridsmall[kgrid];
-				ndata++;
- 				}
-			}
-
-	/* do the interpolation */
-	fprintf(outfp,"\nDoing Surface spline interpolation with %d data points...\n",ndata);
-	mb_surface(verbose, ndata, sxdata, sydata, szdata,
-		(wbnd[0] - bdata_origin_x), (wbnd[1] - bdata_origin_x),
-                (wbnd[2] - bdata_origin_y), (wbnd[3] - bdata_origin_y),
-                sdx, sdy,
-		tension, sgrid);
-#else
-	/* allocate and initialize sgrid */
-	status = mb_mallocd(verbose,__FILE__,__LINE__,3*ndata*sizeof(float),(void **)&sdata,&error);
-	if (status == MB_SUCCESS)
-		status = mb_mallocd(verbose,__FILE__,__LINE__,sxdim*sydim*sizeof(float),(void **)&sgrid,&error);
-	if (status == MB_SUCCESS)
-		status = mb_mallocd(verbose,__FILE__,__LINE__,ndata*sizeof(float),(void **)&work1,&error);
-	if (status == MB_SUCCESS)
-		status = mb_mallocd(verbose,__FILE__,__LINE__,ndata*sizeof(int),(void **)&work2,&error);
-	if (status == MB_SUCCESS)
-		status = mb_mallocd(verbose,__FILE__,__LINE__,(sxdim+sydim)*sizeof(int),(void **)&work3,&error);
-	if (error != MB_ERROR_NO_ERROR)
-		{
-		mb_error(verbose,MB_ERROR_MEMORY_FAIL,&message);
-		fprintf(outfp,"\nMBIO Error allocating interpolation work arrays:\n%s\n",
-			message);
-		fprintf(outfp,"\nProgram <%s> Terminated\n",
-			program_name);
-		mb_memory_clear(verbose, &error);
-		exit(error);
-		}
-	memset((char *)sgrid,0,sxdim*sydim*sizeof(float));
-	memset((char *)sdata,0,3*ndata*sizeof(float));
-	memset((char *)work1,0,ndata*sizeof(float));
-	memset((char *)work2,0,ndata*sizeof(int));
-	memset((char *)work3,0,(sxdim+sydim)*sizeof(int));
-
-	/* get points from grid */
-        /* simultaneously find the depth values nearest to the grid corners and edge midpoints */
-	ndata = 0;
-	for (i=0;i<sxdim;i++)
-		for (j=0;j<sydim;j++)
-			{
-			kgrid = i * sydim + j;
-			if (cnt[kgrid] > 0)
-				{
-				sdata[ndata++] = (float)(wbnd[0] + sdx * i - bdata_origin_x);
-				sdata[ndata++] = (float)(wbnd[2] + sdy * j - bdata_origin_y);
-				sdata[ndata++] = (float)gridsmall[kgrid];
-				}
-			}
-	ndata = ndata/3;
-
-	/* do the interpolation */
-	cay = (float)tension;
-	xmin = (float)(wbnd[0] - 0.5 * sdx - bdata_origin_x);
-	ymin = (float)(wbnd[2] - 0.5 * sdy - bdata_origin_y);
-	ddx = (float)sdx;
-	ddy = (float)sdy;
-	fprintf(outfp,"\nDoing Zgrid spline interpolation with %d data points...\n",ndata);
-/*for (i=0;i<ndata/3;i++)
-{
-if (sdata[3*i+2]>2000.0)
-fprintf(stderr,"%d %f\n",i,sdata[3*i+2]);
-}*/
-	mb_zgrid2(sgrid,&sxdim,&sydim,&xmin,&ymin,
-		&ddx,&ddy,sdata,&ndata,
-		work1,work2,work3,&cay,&sclip);
-#endif
-
-	zflag = 5.0e34;
-	for (i=0;i<sxdim;i++)
-	    for (j=0;j<sydim;j++)
-		{
-		kgrid = i * sydim + j;
-#ifdef USESURFACE
-		kint = i + (sydim - j - 1) * sxdim;
-#else
-		kint = i + j * sxdim;
-#endif
-		if (cnt[kgrid] == 0)
-			{
-			gridsmall[kgrid] = sgrid[kint];
-/*fprintf(stderr,"YES i:%d j:%d kgrid:%d kint:%d sgrid:%f gridsmall:%f\n",
-i,j,kgrid,kint,sgrid[kint],gridsmall[kgrid]);*/
-			}
-/*		else
-			{
-fprintf(stderr,"NO  i:%d j:%d kgrid:%d kint:%d sgrid:%f gridsmall:%f\n",
-i,j,kgrid,kint,sgrid[kint],gridsmall[kgrid]);
-			}*/
-		}
-
-
-	/* deallocate the interpolation arrays */
-#ifdef USESURFACE
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&sxdata,&error);
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&sydata,&error);
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&szdata,&error);
-#else
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&sdata,&error);
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&work1,&error);
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&work2,&error);
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&work3,&error);
-#endif
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&sgrid,&error);
-
-
-/*for (i=0;i<sxdim;i++)
-	for (j=0;j<sydim;j++)
-		{
-		kgrid = i * sydim + j;
-		kout = i*sydim + j;
-		output[kout] = (float) gridsmall[kgrid];
-		if (gridsmall[kgrid] >= clipvalue)
-			output[kout] = outclipvalue;
-		}
-zclip = clipvalue;
-zmin = zclip;
-zmax = zclip;
-for (i=0;i<sxdim;i++)
-	for (j=0;j<sydim;j++)
-		{
-		kgrid = i * sydim + j;
-		if (zmin == zclip
-			&& gridsmall[kgrid] < zclip)
-			zmin = gridsmall[kgrid];
-		if (zmax == zclip
-			&& gridsmall[kgrid] < zclip)
-			zmax = gridsmall[kgrid];
-		if (gridsmall[kgrid] < zmin && gridsmall[kgrid] < zclip)
-			zmin = gridsmall[kgrid];
-		if (gridsmall[kgrid] > zmax && gridsmall[kgrid] < zclip)
-			zmax = gridsmall[kgrid];
-		}
-strcpy(ofile,fileroot);
-strcat(ofile,"_lorez.grd");
-status = write_cdfgrd(verbose,ofile,output,sxdim,sydim,
-	wbnd[0],wbnd[1],wbnd[2],wbnd[3],
-	zmin,zmax,sdx,sdy,
-	xlabel,ylabel,zlabel,title,projection_id,
-	argc,argv,&error);*/
-
-	/* do second pass footprint gridding using slope estimates from first pass interpolated grid */
-
-	/* initialize arrays */
-	for (i=0;i<gxdim;i++)
-		for (j=0;j<gydim;j++)
-			{
-			kgrid = i * gydim + j;
-			grid[kgrid] = 0.0;
-			norm[kgrid] = 0.0;
-			sigma[kgrid] = 0.0;
-			firsttime[kgrid] = 0.0;
-			num[kgrid] = 0;
-			cnt[kgrid] = 0;
-			}
-
-	/* read in data */
-	fprintf(outfp,"\nDoing second pass to generate final grid...\n");
-	ndata = 0;
-	if ((status = mb_datalist_open(verbose,&datalist,
-					dfile,look_processed,&error)) != MB_SUCCESS)
-		{
-		error = MB_ERROR_OPEN_FAIL;
-		fprintf(outfp,"\nUnable to open data list file: %s\n",
-			filelist);
-		fprintf(outfp,"\nProgram <%s> Terminated\n",
-			program_name);
-		mb_memory_clear(verbose, &error);
-		exit(error);
-		}
-	while ((status = mb_datalist_read2(verbose,datalist,
-			&pstatus,path,ppath,&format,&file_weight,&error))
-			== MB_SUCCESS)
-		{
-		ndatafile = 0;
-
-		/* if format > 0 then input is swath sonar file */
-		if (format > 0 && path[0] != '#')
-		{
-		/* apply pstatus */
-		if (pstatus == MB_PROCESSED_USE)
-			strcpy(file, ppath);
-		else
-			strcpy(file, path);
-
-		/* check for mbinfo file - get file bounds if possible */
-		rformat = format;
-		strcpy(rfile,file);
-		status = mb_check_info(verbose, rfile, lonflip, bounds,
-				&file_in_bounds, &error);
-		if (status == MB_FAILURE)
-			{
-			file_in_bounds = MB_YES;
-			status = MB_SUCCESS;
-			error = MB_ERROR_NO_ERROR;
-			}
-
-		/* initialize the swath sonar file */
-		if (file_in_bounds == MB_YES)
-		    {
-		    /* check for "fast bathymetry" or "fbt" file */
-		    if (datatype == MBGRID_DATA_TOPOGRAPHY
-			    || datatype == MBGRID_DATA_BATHYMETRY)
-			{
-			mb_get_fbt(verbose, rfile, &rformat, &error);
-			}
-
-		    /* call mb_read_init() */
-		    if ((status = mb_read_init(
-			verbose,rfile,rformat,pings,lonflip,bounds,
-			btime_i,etime_i,speedmin,timegap,
-			&mbio_ptr,&btime_d,&etime_d,
-			&beams_bath,&beams_amp,&pixels_ss,&error)) != MB_SUCCESS)
-			{
-			mb_error(verbose,error,&message);
-			fprintf(outfp,"\nMBIO Error returned from function <mb_read_init>:\n%s\n",message);
-			fprintf(outfp,"\nMultibeam File <%s> not initialized for reading\n",rfile);
-			fprintf(outfp,"\nProgram <%s> Terminated\n",
-				program_name);
-			mb_memory_clear(verbose, &error);
-			exit(error);
-			}
-
-		    /* get mb_io_ptr */
-		    mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-                    
-                    /* get topography type */
-                    status = mb_sonartype(verbose, mbio_ptr, mb_io_ptr->store_data, &topo_type, &error);
-
-		    /* allocate memory for reading data arrays */
-		    if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							    sizeof(char), (void **)&beamflag, &error);
-		    if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							    sizeof(double), (void **)&bath, &error);
-		    if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_AMPLITUDE,
-							    sizeof(double), (void **)&amp, &error);
-		    if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							    sizeof(double), (void **)&bathlon, &error);
-		    if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							    sizeof(double), (void **)&bathlat, &error);
-		    if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_SIDESCAN,
-							    sizeof(double), (void **)&ss, &error);
-		    if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_SIDESCAN,
-							    sizeof(double), (void **)&sslon, &error);
-		    if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_SIDESCAN,
-							    sizeof(double), (void **)&sslat, &error);
-
-		    /* if error initializing memory then quit */
-		    if (error != MB_ERROR_NO_ERROR)
-			{
-			mb_error(verbose,error,&message);
-			fprintf(outfp,"\nMBIO Error allocating data arrays:\n%s\n",
-				message);
-			fprintf(outfp,"\nProgram <%s> Terminated\n",
-				program_name);
-			mb_memory_clear(verbose, &error);
-			exit(error);
-			}
-
-		    /* loop over reading */
-		    while (error <= MB_ERROR_NO_ERROR)
-			{
-			status = mb_read(verbose,mbio_ptr,&kind,
-				&rpings,time_i,&time_d,
-				&navlon,&navlat,
-				&speed,&heading,
-				&distance,&altitude,&sonardepth,
-				&beams_bath,&beams_amp,&pixels_ss,
-				beamflag,bath,amp,bathlon,bathlat,
-				ss,sslon,sslat,
-				comment,&error);
-
-			/* time gaps are not a problem here */
-			if (error == MB_ERROR_TIME_GAP)
-				{
-				error = MB_ERROR_NO_ERROR;
-				status = MB_SUCCESS;
-				}
-
-			/* print debug statements */
-			if (verbose >= 2)
-				{
-				fprintf(outfp,"\ndbg2  Ping read in program <%s>\n",program_name);
-				fprintf(outfp,"dbg2       kind:           %d\n",kind);
-				fprintf(outfp,"dbg2       beams_bath:     %d\n",beams_bath);
-				fprintf(outfp,"dbg2       beams_amp:      %d\n",beams_amp);
-				fprintf(outfp,"dbg2       pixels_ss:      %d\n",pixels_ss);
-				fprintf(outfp,"dbg2       error:          %d\n",error);
-				fprintf(outfp,"dbg2       status:         %d\n",status);
-				}
-
-			if ((datatype == MBGRID_DATA_BATHYMETRY
-				|| datatype == MBGRID_DATA_TOPOGRAPHY)
-				&& error == MB_ERROR_NO_ERROR)
-			  {
-
-			  /* reproject beam positions if necessary */
-			  if (use_projection == MB_YES)
-			    {
-			    mb_proj_forward(verbose, pjptr,
-					    navlon, navlat,
-					    &navlon, &navlat,
-					    &error);
-			    for (ib=0;ib<beams_bath;ib++)
-			      if (mb_beam_ok(beamflag[ib]))
-				mb_proj_forward(verbose, pjptr,
-						bathlon[ib], bathlat[ib],
-						&bathlon[ib], &bathlat[ib],
-						&error);
-			    }
-
-			  /* deal with data */
-			  for (ib=0;ib<beams_bath;ib++)
-			    if (mb_beam_ok(beamflag[ib]))
-			      {
-			      /* get position in grid */
-			      ix = (bathlon[ib] - wbnd[0] + 0.5*dx)/dx;
-			      iy = (bathlat[ib] - wbnd[2] + 0.5*dy)/dy;
-/*fprintf(outfp, "\nib:%d ix:%d iy:%d   bath: lon:%f lat:%f bath:%f   nav: lon:%f lat:%f\n",
-ib, ix, iy, bathlon[ib], bathlat[ib], bath[ib], navlon, navlat);*/
-
-			      /* deal with point data without footprint */
-                              if (topo_type != MB_TOPOGRAPHY_TYPE_MULTIBEAM)
-                                {
-				if (ix >= 0 && ix < gxdim
-					  && iy >= 0 && iy < gydim)
-				    {
-			            kgrid = ix*gydim + iy;
-				    norm[kgrid] = norm[kgrid] + file_weight;
-				    grid[kgrid] = grid[kgrid]
-					    + file_weight*topofactor*bath[ib];
-				    sigma[kgrid] = sigma[kgrid]
-					    + file_weight*topofactor*topofactor
-					    *bath[ib]*bath[ib];
-				    num[kgrid]++;
-				    cnt[kgrid]++;
-				    ndata++;
-				    ndatafile++;
-				    }
-                                }
-                                
-                              /* else deal with multibeam data that have beam footprints */
-                              else
-                                {
-  
-                                /* get slope from low resolution grid */
-                                isx = (bathlon[ib] - wbnd[0] + 0.5 * sdx)/sdx;
-                                isy = (bathlat[ib] - wbnd[2] + 0.5 * sdy)/sdy;
-                                isx = MIN( MAX(isx, 0), sxdim - 1);
-                                isy = MIN( MAX(isy, 0), sydim - 1);
-                                if (isx == 0)
-                                  {
-                                  k1 = isx * sydim + isy;
-                                  k2 = (isx + 1) * sydim + isy;
-                                  dzdx = (gridsmall[k2] - gridsmall[k1]) / sdx;
-                                  }
-                                else if (isx == sxdim - 1)
-                                  {
-                                  k1 = (isx - 1) * sydim + isy;
-                                  k2 = isx * sydim + isy;
-                                  dzdx = (gridsmall[k2] - gridsmall[k1]) / sdx;
-                                  }
-                                else
-                                  {
-                                  k1 = (isx - 1) * sydim + isy;
-                                  k2 = (isx + 1) * sydim + isy;
-                                  dzdx = (gridsmall[k2] - gridsmall[k1]) / (2.0 * sdx);
-                                  }
-                                if (isy == 0)
-                                  {
-                                  k1 = isx * sydim + isy;
-                                  k2 = isx * sydim + (isy + 1);
-                                  dzdy = (gridsmall[k2] - gridsmall[k1]) / sdy;
-                                  }
-                                else if (isy == sydim - 1)
-                                  {
-                                  k1 = isx * sydim + (isy - 1);
-                                  k2 = isx * sydim + isy;
-                                  dzdy = (gridsmall[k2] - gridsmall[k1]) / sdy;
-                                  }
-                                else
-                                  {
-                                  k1 = isx * sydim + (isy - 1);
-                                  k2 = isx * sydim + (isy + 1);
-                                  dzdy = (gridsmall[k2] - gridsmall[k1]) / (2.0 * sdy);
-                                  }
-  
-                                /* check if within allowed time */
-                                if (check_time == MB_YES)
-                                  {
-                                  /* if in region of interest
-                                     check if time is ok */
-                                  if (ix >= 0 && ix < gxdim
-                                    && iy >= 0 && iy < gydim)
-                                    {
-                                    kgrid = ix*gydim + iy;
-                                    if (firsttime[kgrid] <= 0.0)
-                                      {
-                                      firsttime[kgrid] = time_d;
-                                      time_ok = MB_YES;
-                                      }
-                                    else if (fabs(time_d - firsttime[kgrid])
-                                      > timediff)
-                                      {
-                                      if (first_in_stays == MB_YES)
-                                          time_ok = MB_NO;
-                                      else
-                                          {
-                                          time_ok = MB_YES;
-                                          firsttime[kgrid] = time_d;
-                                          ndata = ndata - cnt[kgrid];
-                                          ndatafile = ndatafile - cnt[kgrid];
-                                          norm[kgrid] = 0.0;
-                                          grid[kgrid] = 0.0;
-                                          sigma[kgrid] = 0.0;
-                                          num[kgrid] = 0;
-                                          cnt[kgrid] = 0;
-                                          }
-                                      }
-                                    else
-                                      time_ok = MB_YES;
-                                    }
-                                  else
-                                    time_ok = MB_YES;
-                                  }
-                                else
-                                  time_ok = MB_YES;
-  
-                                /* process if in region of interest */
-                                if (ix >= -xtradim
-                                  && ix < gxdim + xtradim
-                                  && iy >= -xtradim
-                                  && iy < gydim + xtradim
-                                  && time_ok == MB_YES)
-                                  {
-                                  /* calculate footprint - this is a kluge assuming
-                                     sonar at surface - also assumes lon lat grid
-                                     - to be generalized in later version
-                                     DWC 11/16/99 */
-                                  /* calculate footprint - now uses sonar altitude
-                                     - still assumes lon lat grid
-                                     - to be generalized in later version
-                                     DWC 1/29/2001 */
-                                  /* now handles projected grids
-                                     DWC 3/5/2003 */
-                                  if (use_projection == MB_YES)
-                                    {
-                                    foot_dx = (bathlon[ib] - navlon);
-                                    foot_dy = (bathlat[ib] - navlat);
-                                    }
-                                  else
-                                    {
-                                    foot_dx = (bathlon[ib] - navlon) / mtodeglon;
-                                    foot_dy = (bathlat[ib] - navlat) / mtodeglat;
-                                    }
-                                  foot_lateral = sqrt(foot_dx * foot_dx + foot_dy * foot_dy);
-                                  if (foot_lateral > 0.0)
-                                      {
-                                      foot_dxn = foot_dx / foot_lateral;
-                                      foot_dyn = foot_dy / foot_lateral;
-                                      }
-                                  else
-                                      {
-                                      foot_dxn = 1.0;
-                                      foot_dyn = 0.0;
-                                      }
-                                  foot_range = sqrt(foot_lateral * foot_lateral + altitude * altitude);
-                                  if (foot_range > 0.0)
-                                      {
-                                      foot_theta = RTD * atan2(foot_lateral, (bath[ib] - sonardepth));
-                                      foot_dtheta = 0.5 * scale * mb_io_ptr->beamwidth_xtrack;
-                                      foot_dphi = 0.5 * scale * mb_io_ptr->beamwidth_ltrack;
-                                      if (foot_dtheta <= 0.0)
-                                          foot_dtheta = 1.0;
-                                      if (foot_dphi <= 0.0)
-                                          foot_dphi = 1.0;
-                                      foot_hwidth =(bath[ib] - sonardepth) * tan(DTR * (foot_theta + foot_dtheta))
-                                                          - foot_lateral;
-                                      foot_hlength = foot_range * tan(DTR * foot_dphi);
-  /* fprintf(outfp, "bath:%f sonardepth:%f dx:%f dy:%f lateral:%f range:%f theta:%f dtheta:%f dphi:%f fhwidth:%f fhlength:%f\n",
-  bath[ib],sonardepth,foot_dx, foot_dy, foot_lateral, foot_range, foot_theta,foot_dtheta,foot_dphi,foot_hwidth,foot_hlength);*/
-  
-                                      /* get range of bins around footprint to examine */
-                                      if (use_projection == MB_YES)
-                                        {
-                                        foot_wix = fabs(foot_hwidth * cos(DTR * foot_theta) / dx);
-                                        foot_wiy = fabs(foot_hwidth * sin(DTR * foot_theta) / dx);
-                                        foot_lix = fabs(foot_hlength * sin(DTR * foot_theta) / dy);
-                                        foot_liy = fabs(foot_hlength * cos(DTR * foot_theta) / dy);
-                                        }
-                                      else
-                                        {
-                                        foot_wix = fabs(foot_hwidth * cos(DTR * foot_theta) * mtodeglon / dx);
-                                        foot_wiy = fabs(foot_hwidth * sin(DTR * foot_theta) * mtodeglon / dx);
-                                        foot_lix = fabs(foot_hlength * sin(DTR * foot_theta) * mtodeglat / dy);
-                                        foot_liy = fabs(foot_hlength * cos(DTR * foot_theta) * mtodeglat / dy);
-                                        }
-                                      foot_dix = 2 * MAX(foot_wix, foot_lix);
-                                      foot_diy = 2 * MAX(foot_wiy, foot_liy);
-  /*fprintf(outfp, "foot_hwidth:%f foot_hlength:%f\n", foot_hwidth, foot_hlength);
-  fprintf(outfp, "foot_wix:%d foot_wiy:%d  foot_lix:%d foot_liy:%d    foot_dix:%d foot_diy:%d\n",
-  foot_wix, foot_wiy, foot_lix, foot_liy, foot_dix, foot_diy);*/
-                                      ix1 = MAX(ix - foot_dix, 0);
-                                      ix2 = MIN(ix + foot_dix, gxdim - 1);
-                                      iy1 = MAX(iy - foot_diy, 0);
-                                      iy2 = MIN(iy + foot_diy, gydim - 1);
-  /*fprintf(outfp, "ix1:%d ix2:%d iy1:%d iy2:%d\n", ix1, ix2, iy1, iy2);*/
-  
-                                      /* loop over neighborhood of bins */
-                                      for (ii=ix1;ii<=ix2;ii++)
-                                       for (jj=iy1;jj<=iy2;jj++)
-                                         {
-                                         /* find center of bin in lon lat degrees from sounding center */
-                                         kgrid = ii * gydim + jj;
-                                         xx = (wbnd[0] + ii*dx + 0.5*dx - bathlon[ib]);
-                                         yy = (wbnd[2] + jj*dy + 0.5*dy - bathlat[ib]);
-  
-                                         /* get depth or topo value at this point using slope estimate */
-                                         sbath = topofactor * bath[ib] + dzdx * xx + dzdy * yy;
-  /*fprintf(stderr,"ib:%d ii:%d jj:%d bath:%f %f   diff:%f   xx:%f yy:%f dzdx:%f dzdy:%f\n",
-  ib,ii,jj,topofactor * bath[ib],sbath,topofactor * bath[ib]-sbath,xx,yy,dzdx,dzdy);*/
-  
-                                         /* get center and corners of bin in meters from sounding center */
-                                        if (use_projection == MB_YES)
-                                          {
-                                           xx0 = xx;
-                                           yy0 = yy;
-                                           bdx = 0.5 * dx;
-                                           bdy = 0.5 * dy;
-                                           }
-                                        else
-                                          {
-                                           xx0 = xx / mtodeglon;
-                                           yy0 = yy / mtodeglat;
-                                           bdx = 0.5 * dx/ mtodeglon;
-                                           bdy = 0.5 * dy/ mtodeglat;
-                                           }
-                                         xx1 = xx0 - bdx;
-                                         xx2 = xx0 + bdx;
-                                         yy1 = yy0 - bdy;
-                                         yy2 = yy0 + bdy;
-  /*fprintf(outfp, "ii:%d jj:%d ix:%d iy:%d xx:%f yy:%f\n", ii, jj, ix, iy, xx, yy);
-  fprintf(outfp, "p0: %f %f   p1: %f %f   p2: %f %f\n",
-  xx0, yy0, xx1, yy1, xx2, yy2);*/
-  
-                                         /* rotate center and corners of bin to footprint coordinates */
-                                         prx[0] = xx0 * foot_dxn + yy0 * foot_dyn;
-                                         pry[0] = -xx0 * foot_dyn + yy0 * foot_dxn;
-                                         prx[1] = xx1 * foot_dxn + yy1 * foot_dyn;
-                                         pry[1] = -xx1 * foot_dyn + yy1 * foot_dxn;
-                                         prx[2] = xx2 * foot_dxn + yy1 * foot_dyn;
-                                         pry[2] = -xx2 * foot_dyn + yy1 * foot_dxn;
-                                         prx[3] = xx1 * foot_dxn + yy2 * foot_dyn;
-                                         pry[3] = -xx1 * foot_dyn + yy2 * foot_dxn;
-                                         prx[4] = xx2 * foot_dxn + yy2 * foot_dyn;
-                                         pry[4] = -xx2 * foot_dyn + yy2 * foot_dxn;
-  
-                                         /* get weight integrated over bin */
-                                         mbgrid_weight(verbose, foot_hwidth, foot_hlength,
-                                                      prx[0], pry[0], bdx, bdy,
-                                                      &prx[1], &pry[1],
-                                                      &weight, &use_weight, &error);
-  
-                                         if (use_weight != MBGRID_USE_NO && weight > 0.000001)
-                                              {
-                                              weight *= file_weight;
-                                              norm[kgrid] = norm[kgrid] + weight;
-                                              grid[kgrid] = grid[kgrid] + weight * sbath;
-                                              sigma[kgrid] = sigma[kgrid] + weight * sbath * sbath;
-                                              if (use_weight == MBGRID_USE_YES)
-                                                  {
-                                                  num[kgrid]++;
-                                                  if (ii == ix && jj == iy)
-                                                          cnt[kgrid]++;
-                                                  }
-                                              }
-                                         }
-                                      ndata++;
-                                      ndatafile++;
-                                      }
-  
-                                  /* else for xyz data without footprint */
-                                  else if (ix >= 0 && ix < gxdim
-                                            && iy >= 0 && iy < gydim)
-                                      {
-                                      kgrid = ix*gydim + iy;
-                                      norm[kgrid] = norm[kgrid] + file_weight;
-                                      grid[kgrid] = grid[kgrid]
-                                              + file_weight*topofactor*bath[ib];
-                                      sigma[kgrid] = sigma[kgrid]
-                                              + file_weight*topofactor*topofactor
-                                              *bath[ib]*bath[ib];
-                                      num[kgrid]++;
-                                      cnt[kgrid]++;
-                                      ndata++;
-                                      ndatafile++;
-                                      }
-                                  }
-                                }
-                              }
-			  }
-			}
-		    status = mb_close(verbose,&mbio_ptr,&error);
-		    status = MB_SUCCESS;
-		    error = MB_ERROR_NO_ERROR;
-		    }
-		if (verbose >= 2)
-			fprintf(outfp,"\n");
-		if (verbose > 0 || file_in_bounds == MB_YES)
-			fprintf(outfp,"%d data points processed in %s\n",
-				ndatafile,rfile);
-		} /* end if (format > 0) */
-
-		}
-	if (datalist != NULL)
-		mb_datalist_close(verbose,&datalist,&error);
-	if (verbose > 0)
-		fprintf(outfp,"\n%d total data points processed\n",ndata);
-
-	/* now loop over all points in the output grid */
-	if (verbose >= 1)
-		fprintf(outfp,"\nMaking raw grid...\n");
-	nbinset = 0;
-	nbinzero = 0;
-	nbinspline = 0;
-	nbinbackground = 0;
-	for (i=0;i<gxdim;i++)
-		for (j=0;j<gydim;j++)
-			{
-			kgrid = i * gydim + j;
-			if (num[kgrid] > 0)
-				{
-				grid[kgrid] = grid[kgrid]/norm[kgrid];
-				factor = sigma[kgrid]/norm[kgrid]
-					- grid[kgrid]*grid[kgrid];
-				sigma[kgrid] = sqrt(fabs(factor));
-				nbinset++;
-				}
-			else
-				{
-				grid[kgrid] = clipvalue;
-				sigma[kgrid] = 0.0;
-				}
-			/* fprintf(outfp,"%d %d %d  %f %f %f   %d %d %f %f\n",
-			i,j,kgrid,
-			grid[kgrid], wbnd[0] + i*dx, wbnd[2] + j*dy,
-			num[kgrid],cnt[kgrid],norm[kgrid],sigma[kgrid]);*/
-			}
-
-	/***** end of weighted footprint slope gridding *****/
-	}
-
-	/***** do weighted footprint gridding *****/
-	else if (grid_mode == MBGRID_WEIGHTED_FOOTPRINT)
-	{
-
-	/* allocate memory for additional arrays */
-	status = mb_mallocd(verbose,__FILE__,__LINE__,gxdim*gydim*sizeof(double),(void **)&norm,&error);
-
-	/* initialize arrays */
-	for (i=0;i<gxdim;i++)
-		for (j=0;j<gydim;j++)
-			{
-			kgrid = i * gydim + j;
-			grid[kgrid] = 0.0;
-			norm[kgrid] = 0.0;
-			sigma[kgrid] = 0.0;
-			firsttime[kgrid] = 0.0;
-			num[kgrid] = 0;
-			cnt[kgrid] = 0;
-			}
-
-	/* read in data */
-	fprintf(outfp,"\nDoing single pass to generate grid...\n");
-	ndata = 0;
-	if ((status = mb_datalist_open(verbose,&datalist,
-					filelist,look_processed,&error)) != MB_SUCCESS)
-		{
-		error = MB_ERROR_OPEN_FAIL;
-		fprintf(outfp,"\nUnable to open data list file: %s\n",
-			filelist);
-		fprintf(outfp,"\nProgram <%s> Terminated\n",
-			program_name);
-		mb_memory_clear(verbose, &error);
-		exit(error);
-		}
-	while ((status = mb_datalist_read2(verbose,datalist,
-			&pstatus,path,ppath,&format,&file_weight,&error))
-			== MB_SUCCESS)
-		{
-		ndatafile = 0;
-
-		/* if format > 0 then input is swath sonar file */
-		if (format > 0 && path[0] != '#')
-		{
-		/* apply pstatus */
-		if (pstatus == MB_PROCESSED_USE)
-			strcpy(file, ppath);
-		else
-			strcpy(file, path);
-
-		/* check for mbinfo file - get file bounds if possible */
-		rformat = format;
-		strcpy(rfile,file);
-		status = mb_check_info(verbose, rfile, lonflip, bounds,
-				&file_in_bounds, &error);
-		if (status == MB_FAILURE)
-			{
-			file_in_bounds = MB_YES;
-			status = MB_SUCCESS;
-			error = MB_ERROR_NO_ERROR;
-			}
-
-		/* initialize the swath sonar file */
-		if (file_in_bounds == MB_YES)
-		    {
-		    /* check for "fast bathymetry" or "fbt" file */
-		    if (datatype == MBGRID_DATA_TOPOGRAPHY
-			    || datatype == MBGRID_DATA_BATHYMETRY)
-			{
-			mb_get_fbt(verbose, rfile, &rformat, &error);
-			}
-
-		    /* call mb_read_init() */
-		    if ((status = mb_read_init(
-			verbose,rfile,rformat,pings,lonflip,bounds,
-			btime_i,etime_i,speedmin,timegap,
-			&mbio_ptr,&btime_d,&etime_d,
-			&beams_bath,&beams_amp,&pixels_ss,&error)) != MB_SUCCESS)
-			{
-			mb_error(verbose,error,&message);
-			fprintf(outfp,"\nMBIO Error returned from function <mb_read_init>:\n%s\n",message);
-			fprintf(outfp,"\nMultibeam File <%s> not initialized for reading\n",rfile);
-			fprintf(outfp,"\nProgram <%s> Terminated\n",
-				program_name);
-			mb_memory_clear(verbose, &error);
-			exit(error);
-			}
-
-		    /* get mb_io_ptr */
-		    mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-                    
-                    /* get topography type */
-                    status = mb_sonartype(verbose, mbio_ptr, mb_io_ptr->store_data, &topo_type, &error);
-
-		    /* allocate memory for reading data arrays */
-		    if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							    sizeof(char), (void **)&beamflag, &error);
-		    if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							    sizeof(double), (void **)&bath, &error);
-		    if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_AMPLITUDE,
-							    sizeof(double), (void **)&amp, &error);
-		    if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							    sizeof(double), (void **)&bathlon, &error);
-		    if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							    sizeof(double), (void **)&bathlat, &error);
-		    if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_SIDESCAN,
-							    sizeof(double), (void **)&ss, &error);
-		    if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_SIDESCAN,
-							    sizeof(double), (void **)&sslon, &error);
-		    if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_SIDESCAN,
-							    sizeof(double), (void **)&sslat, &error);
-
-		    /* if error initializing memory then quit */
-		    if (error != MB_ERROR_NO_ERROR)
-			{
-			mb_error(verbose,error,&message);
-			fprintf(outfp,"\nMBIO Error allocating data arrays:\n%s\n",
-				message);
-			fprintf(outfp,"\nProgram <%s> Terminated\n",
-				program_name);
-			mb_memory_clear(verbose, &error);
-			exit(error);
-			}
-
-		    /* loop over reading */
-		    while (error <= MB_ERROR_NO_ERROR)
-			{
-			status = mb_read(verbose,mbio_ptr,&kind,
-				&rpings,time_i,&time_d,
-				&navlon,&navlat,
-				&speed,&heading,
-				&distance,&altitude,&sonardepth,
-				&beams_bath,&beams_amp,&pixels_ss,
-				beamflag,bath,amp,bathlon,bathlat,
-				ss,sslon,sslat,
-				comment,&error);
-
-			/* time gaps are not a problem here */
-			if (error == MB_ERROR_TIME_GAP)
-				{
-				error = MB_ERROR_NO_ERROR;
-				status = MB_SUCCESS;
-				}
-
-			/* print debug statements */
-			if (verbose >= 2)
-				{
-				fprintf(outfp,"\ndbg2  Ping read in program <%s>\n",program_name);
-				fprintf(outfp,"dbg2       kind:           %d\n",kind);
-				fprintf(outfp,"dbg2       beams_bath:     %d\n",beams_bath);
-				fprintf(outfp,"dbg2       beams_amp:      %d\n",beams_amp);
-				fprintf(outfp,"dbg2       pixels_ss:      %d\n",pixels_ss);
-				fprintf(outfp,"dbg2       error:          %d\n",error);
-				fprintf(outfp,"dbg2       status:         %d\n",status);
-				}
-
-			if ((datatype == MBGRID_DATA_BATHYMETRY
-				|| datatype == MBGRID_DATA_TOPOGRAPHY)
-				&& error == MB_ERROR_NO_ERROR)
-			  {
-
-			  /* reproject beam positions if necessary */
-			  if (use_projection == MB_YES)
-			    {
-			    mb_proj_forward(verbose, pjptr,
-					    navlon, navlat,
-					    &navlon, &navlat,
-					    &error);
-			    for (ib=0;ib<beams_bath;ib++)
-			      if (mb_beam_ok(beamflag[ib]))
-				mb_proj_forward(verbose, pjptr,
-						bathlon[ib], bathlat[ib],
-						&bathlon[ib], &bathlat[ib],
-						&error);
-			    }
-
-			  /* deal with data */
-			  for (ib=0;ib<beams_bath;ib++)
-			    if (mb_beam_ok(beamflag[ib]))
-			      {
-			      /* get position in grid */
-			      ix = (bathlon[ib] - wbnd[0] + 0.5*dx)/dx;
-			      iy = (bathlat[ib] - wbnd[2] + 0.5*dy)/dy;
-/*fprintf(outfp, "\nib:%d ix:%d iy:%d   bath: lon:%f lat:%f bath:%f   nav: lon:%f lat:%f\n",
-ib, ix, iy, bathlon[ib], bathlat[ib], bath[ib], navlon, navlat);*/
-
-			      /* check if within allowed time */
-			      if (check_time == MB_YES)
-			        {
-				/* if in region of interest
-				   check if time is ok */
-				if (ix >= 0 && ix < gxdim
-				  && iy >= 0 && iy < gydim)
-				  {
-			          kgrid = ix*gydim + iy;
-				  if (firsttime[kgrid] <= 0.0)
-				    {
-				    firsttime[kgrid] = time_d;
-				    time_ok = MB_YES;
-				    }
-				  else if (fabs(time_d - firsttime[kgrid])
-				    > timediff)
-				    {
-				    if (first_in_stays == MB_YES)
-					time_ok = MB_NO;
-				    else
-					{
-					time_ok = MB_YES;
-					firsttime[kgrid] = time_d;
-					ndata = ndata - cnt[kgrid];
-					ndatafile = ndatafile - cnt[kgrid];
-					norm[kgrid] = 0.0;
-					grid[kgrid] = 0.0;
-					sigma[kgrid] = 0.0;
-					num[kgrid] = 0;
-					cnt[kgrid] = 0;
-					}
-				    }
-			          else
-				    time_ok = MB_YES;
-				  }
-				else
-				  time_ok = MB_YES;
-				}
-			      else
-				time_ok = MB_YES;
-
-			      /* process if in region of interest */
-			      if (ix >= -xtradim
-				&& ix < gxdim + xtradim
-				&& iy >= -xtradim
-				&& iy < gydim + xtradim
-				&& time_ok == MB_YES)
-			        {
-                                /* deal with point data without footprint */
-                                if (topo_type != MB_TOPOGRAPHY_TYPE_MULTIBEAM)
-                                    {
-                                    kgrid = ix*gydim + iy;
-                                    norm[kgrid] = norm[kgrid] + file_weight;
-                                    grid[kgrid] = grid[kgrid]
-                                            + file_weight*topofactor*bath[ib];
-                                    sigma[kgrid] = sigma[kgrid]
-                                            + file_weight*topofactor*topofactor
-                                            *bath[ib]*bath[ib];
-                                    num[kgrid]++;
-                                    cnt[kgrid]++;
-                                    ndata++;
-                                    ndatafile++;
-                                    }
-                                  
-                                /* else deal with multibeam data that have beam footprints */
-                                else
-                                    {
-                                    /* calculate footprint - this is a kluge assuming
-                                       sonar at surface - also assumes lon lat grid
-                                       - to be generalized in later version
-                                       DWC 11/16/99 */
-                                    /* calculate footprint - now uses sonar altitude
-                                       - still assumes lon lat grid
-                                       - to be generalized in later version
-                                       DWC 1/29/2001 */
-                                    /* now handles projected grids
-                                       DWC 3/5/2003 */
-                                    if (use_projection == MB_YES)
-                                      {
-                                      foot_dx = (bathlon[ib] - navlon);
-                                      foot_dy = (bathlat[ib] - navlat);
-                                      }
-                                    else
-                                      {
-                                      foot_dx = (bathlon[ib] - navlon) / mtodeglon;
-                                      foot_dy = (bathlat[ib] - navlat) / mtodeglat;
-                                      }
-                                    foot_lateral = sqrt(foot_dx * foot_dx + foot_dy * foot_dy);
-                                    if (foot_lateral > 0.0)
-                                        {
-                                        foot_dxn = foot_dx / foot_lateral;
-                                        foot_dyn = foot_dy / foot_lateral;
-                                        }
-                                    else
-                                        {
-                                        foot_dxn = 1.0;
-                                        foot_dyn = 0.0;
-                                        }
-                                    foot_range = sqrt(foot_lateral * foot_lateral + altitude * altitude);
-                                    if (foot_range > 0.0)
-                                        {
-                                        foot_theta = RTD * atan2(foot_lateral, (bath[ib] - sonardepth));
-                                        foot_dtheta = 0.5 * scale * mb_io_ptr->beamwidth_xtrack;
-                                        foot_dphi = 0.5 * scale * mb_io_ptr->beamwidth_ltrack;
-                                        if (foot_dtheta <= 0.0)
-                                            foot_dtheta = 1.0;
-                                        if (foot_dphi <= 0.0)
-                                            foot_dphi = 1.0;
-                                        foot_hwidth =(bath[ib] - sonardepth) * tan(DTR * (foot_theta + foot_dtheta))
-                                                            - foot_lateral;
-                                        foot_hlength = foot_range * tan(DTR * foot_dphi);
-    /* fprintf(outfp, "bath:%f sonardepth:%f dx:%f dy:%f lateral:%f range:%f theta:%f dtheta:%f dphi:%f fhwidth:%f fhlength:%f\n",
-    bath[ib],sonardepth,foot_dx, foot_dy, foot_lateral, foot_range, foot_theta,foot_dtheta,foot_dphi,foot_hwidth,foot_hlength);*/
-    
-                                        /* get range of bins around footprint to examine */
-                                        if (use_projection == MB_YES)
-                                          {
-                                          foot_wix = fabs(foot_hwidth * cos(DTR * foot_theta) / dx);
-                                          foot_wiy = fabs(foot_hwidth * sin(DTR * foot_theta) / dx);
-                                          foot_lix = fabs(foot_hlength * sin(DTR * foot_theta) / dy);
-                                          foot_liy = fabs(foot_hlength * cos(DTR * foot_theta) / dy);
-                                          }
-                                        else
-                                          {
-                                          foot_wix = fabs(foot_hwidth * cos(DTR * foot_theta) * mtodeglon / dx);
-                                          foot_wiy = fabs(foot_hwidth * sin(DTR * foot_theta) * mtodeglon / dx);
-                                          foot_lix = fabs(foot_hlength * sin(DTR * foot_theta) * mtodeglat / dy);
-                                          foot_liy = fabs(foot_hlength * cos(DTR * foot_theta) * mtodeglat / dy);
-                                          }
-                                        foot_dix = 2 * MAX(foot_wix, foot_lix);
-                                        foot_diy = 2 * MAX(foot_wiy, foot_liy);
-    /*fprintf(outfp, "foot_hwidth:%f foot_hlength:%f\n", foot_hwidth, foot_hlength);
-    fprintf(outfp, "foot_wix:%d foot_wiy:%d  foot_lix:%d foot_liy:%d    foot_dix:%d foot_diy:%d\n",
-    foot_wix, foot_wiy, foot_lix, foot_liy, foot_dix, foot_diy);*/
-                                        ix1 = MAX(ix - foot_dix, 0);
-                                        ix2 = MIN(ix + foot_dix, gxdim - 1);
-                                        iy1 = MAX(iy - foot_diy, 0);
-                                        iy2 = MIN(iy + foot_diy, gydim - 1);
-    /*fprintf(outfp, "ix1:%d ix2:%d iy1:%d iy2:%d\n", ix1, ix2, iy1, iy2);*/
-    
-                                        /* loop over neighborhood of bins */
-                                        for (ii=ix1;ii<=ix2;ii++)
-                                         for (jj=iy1;jj<=iy2;jj++)
-                                           {
-                                           /* find center of bin in lon lat degrees from sounding center */
-                                           kgrid = ii * gydim + jj;
-                                           xx = (wbnd[0] + ii*dx + 0.5*dx - bathlon[ib]);
-                                           yy = (wbnd[2] + jj*dy + 0.5*dy - bathlat[ib]);
-    
-                                           /* get depth or topo value at this point */
-                                           sbath = topofactor * bath[ib];
-    /*fprintf(stderr,"ib:%d ii:%d jj:%d bath:%f %f   diff:%f   xx:%f yy:%f\n",
-    ib,ii,jj,topofactor * bath[ib],sbath,topofactor * bath[ib]-sbath,xx,yy);*/
-    
-                                           /* get center and corners of bin in meters from sounding center */
-                                          if (use_projection == MB_YES)
-                                            {
-                                             xx0 = xx;
-                                             yy0 = yy;
-                                             bdx = 0.5 * dx;
-                                             bdy = 0.5 * dy;
-                                             }
-                                          else
-                                            {
-                                             xx0 = xx / mtodeglon;
-                                             yy0 = yy / mtodeglat;
-                                             bdx = 0.5 * dx/ mtodeglon;
-                                             bdy = 0.5 * dy/ mtodeglat;
-                                             }
-                                           xx1 = xx0 - bdx;
-                                           xx2 = xx0 + bdx;
-                                           yy1 = yy0 - bdy;
-                                           yy2 = yy0 + bdy;
-    /*fprintf(outfp, "ii:%d jj:%d ix:%d iy:%d xx:%f yy:%f\n", ii, jj, ix, iy, xx, yy);
-    fprintf(outfp, "p0: %f %f   p1: %f %f   p2: %f %f\n",
-    xx0, yy0, xx1, yy1, xx2, yy2);*/
-    
-                                           /* rotate center and corners of bin to footprint coordinates */
-                                           prx[0] = xx0 * foot_dxn + yy0 * foot_dyn;
-                                           pry[0] = -xx0 * foot_dyn + yy0 * foot_dxn;
-                                           prx[1] = xx1 * foot_dxn + yy1 * foot_dyn;
-                                           pry[1] = -xx1 * foot_dyn + yy1 * foot_dxn;
-                                           prx[2] = xx2 * foot_dxn + yy1 * foot_dyn;
-                                           pry[2] = -xx2 * foot_dyn + yy1 * foot_dxn;
-                                           prx[3] = xx1 * foot_dxn + yy2 * foot_dyn;
-                                           pry[3] = -xx1 * foot_dyn + yy2 * foot_dxn;
-                                           prx[4] = xx2 * foot_dxn + yy2 * foot_dyn;
-                                           pry[4] = -xx2 * foot_dyn + yy2 * foot_dxn;
-    
-                                           /* get weight integrated over bin */
-                                           mbgrid_weight(verbose, foot_hwidth, foot_hlength,
-                                                        prx[0], pry[0], bdx, bdy,
-                                                        &prx[1], &pry[1],
-                                                        &weight, &use_weight, &error);
-    
-                                           if (use_weight != MBGRID_USE_NO && weight > 0.000001)
-                                                {
-                                                weight *= file_weight;
-                                                norm[kgrid] = norm[kgrid] + weight;
-                                                grid[kgrid] = grid[kgrid] + weight * sbath;
-                                                sigma[kgrid] = sigma[kgrid] + weight * sbath * sbath;
-                                                if (use_weight == MBGRID_USE_YES)
-                                                    {
-                                                    num[kgrid]++;
-                                                    if (ii == ix && jj == iy)
-                                                            cnt[kgrid]++;
-                                                    }
-                                                }
-                                           }
-                                        ndata++;
-                                        ndatafile++;
-                                        }
-    
-                                    /* else for xyz data without footprint */
-                                    else if (ix >= 0 && ix < gxdim
-                                              && iy >= 0 && iy < gydim)
-                                        {
-                                        kgrid = ix*gydim + iy;
-                                        norm[kgrid] = norm[kgrid] + file_weight;
-                                        grid[kgrid] = grid[kgrid]
-                                                + file_weight*topofactor*bath[ib];
-                                        sigma[kgrid] = sigma[kgrid]
-                                                + file_weight*topofactor*topofactor
-                                                *bath[ib]*bath[ib];
-                                        num[kgrid]++;
-                                        cnt[kgrid]++;
-                                        ndata++;
-                                        ndatafile++;
-                                        }
-                                    }
-				}
-			      }
-			  }
-			}
-		    status = mb_close(verbose,&mbio_ptr,&error);
-		    status = MB_SUCCESS;
-		    error = MB_ERROR_NO_ERROR;
-		    }
-		if (verbose >= 2)
-			fprintf(outfp,"\n");
-		if (verbose > 0 || file_in_bounds == MB_YES)
-			fprintf(outfp,"%d data points processed in %s\n",
-				ndatafile,rfile);
-
-		/* add to datalist if data actually contributed */
-		if (ndatafile > 0 && dfp != NULL)
-			{
-			if (pstatus == MB_PROCESSED_USE)
-				fprintf(dfp, "P:");
-			else
-				fprintf(dfp, "R:");
-			fprintf(dfp, "%s %d %f\n", path, format, file_weight);
-			fflush(dfp);
-			}
-		} /* end if (format > 0) */
-
-		}
-	if (datalist != NULL)
-		mb_datalist_close(verbose,&datalist,&error);
-	if (verbose > 0)
-		fprintf(outfp,"\n%d total data points processed\n",ndata);
-
-	/* close datalist if necessary */
-	if (dfp != NULL)
-		{
-		fclose(dfp);
-		dfp = NULL;
-		}
-
-	/* now loop over all points in the output grid */
-	if (verbose >= 1)
-		fprintf(outfp,"\nMaking raw grid...\n");
-	nbinset = 0;
-	nbinzero = 0;
-	nbinspline = 0;
-	nbinbackground = 0;
-	for (i=0;i<gxdim;i++)
-		for (j=0;j<gydim;j++)
-			{
-			kgrid = i * gydim + j;
-			if (num[kgrid] > 0)
-				{
-				grid[kgrid] = grid[kgrid]/norm[kgrid];
-				factor = sigma[kgrid]/norm[kgrid]
-					- grid[kgrid]*grid[kgrid];
-				sigma[kgrid] = sqrt(fabs(factor));
-				nbinset++;
-				}
-			else
-				{
-				grid[kgrid] = clipvalue;
-				sigma[kgrid] = 0.0;
-				}
-			/* fprintf(outfp,"%d %d %d  %f %f %f   %d %d %f %f\n",
-			i,j,kgrid,
-			grid[kgrid], wbnd[0] + i*dx, wbnd[2] + j*dy,
-			num[kgrid],cnt[kgrid],norm[kgrid],sigma[kgrid]);*/
-			}
-
-	/***** end of weighted footprint gridding *****/
-	}
-
-	/***** do weighted mean or min/max gridding *****/
-	else if (grid_mode != MBGRID_MEDIAN_FILTER)
-	{
-
-	/* allocate memory for additional arrays */
-	if (status == MB_SUCCESS)
-	status = mb_mallocd(verbose,__FILE__,__LINE__,gxdim*gydim*sizeof(double),(void **)&norm,&error);
-
-	/* if error initializing memory then quit */
-	if (error != MB_ERROR_NO_ERROR)
-		{
-		mb_error(verbose,error,&message);
-		fprintf(outfp,"\nMBIO Error allocating data arrays:\n%s\n",
-			message);
-		fprintf(outfp,"\nProgram <%s> Terminated\n",
-			program_name);
-		mb_memory_clear(verbose, &error);
-		exit(error);
-		}
-
-	/* initialize arrays */
-	for (i=0;i<gxdim;i++)
-		for (j=0;j<gydim;j++)
-			{
-			kgrid = i * gydim + j;
-			grid[kgrid] = 0.0;
-			norm[kgrid] = 0.0;
-			sigma[kgrid] = 0.0;
-			firsttime[kgrid] = 0.0;
-			num[kgrid] = 0;
-			cnt[kgrid] = 0;
-			}
-
-	/* read in data */
-	ndata = 0;
-	if ((status = mb_datalist_open(verbose,&datalist,
-					filelist,look_processed,&error)) != MB_SUCCESS)
-		{
-		error = MB_ERROR_OPEN_FAIL;
-		fprintf(outfp,"\nUnable to open data list file: %s\n",
-			filelist);
-		fprintf(outfp,"\nProgram <%s> Terminated\n",
-			program_name);
-		mb_memory_clear(verbose, &error);
-		exit(error);
-		}
-	while ((status = mb_datalist_read2(verbose,datalist,
-			&pstatus,path,ppath,&format,&file_weight,&error))
-			== MB_SUCCESS)
-		{
-		ndatafile = 0;
-
-		/* if format > 0 then input is swath sonar file */
-		if (format > 0 && path[0] != '#')
-		{
-		/* apply pstatus */
-		if (pstatus == MB_PROCESSED_USE)
-			strcpy(file, ppath);
-		else
-			strcpy(file, path);
-
-		/* check for mbinfo file - get file bounds if possible */
-		rformat = format;
-		strcpy(rfile,file);
-		status = mb_check_info(verbose, rfile, lonflip, bounds,
-				&file_in_bounds, &error);
-		if (status == MB_FAILURE)
-			{
-			file_in_bounds = MB_YES;
-			status = MB_SUCCESS;
-			error = MB_ERROR_NO_ERROR;
-			}
-
-		/* initialize the swath sonar file */
-		if (file_in_bounds == MB_YES)
-		    {
-		    /* check for "fast bathymetry" or "fbt" file */
-		    if (datatype == MBGRID_DATA_TOPOGRAPHY
-			    || datatype == MBGRID_DATA_BATHYMETRY)
-			{
-			mb_get_fbt(verbose, rfile, &rformat, &error);
-			}
-
-		    /* call mb_read_init() */
-		    if ((status = mb_read_init(
-			verbose,rfile,rformat,pings,lonflip,bounds,
-			btime_i,etime_i,speedmin,timegap,
-			&mbio_ptr,&btime_d,&etime_d,
-			&beams_bath,&beams_amp,&pixels_ss,&error)) != MB_SUCCESS)
-			{
-			mb_error(verbose,error,&message);
-			fprintf(outfp,"\nMBIO Error returned from function <mb_read_init>:\n%s\n",message);
-			fprintf(outfp,"\nMultibeam File <%s> not initialized for reading\n",rfile);
-			fprintf(outfp,"\nProgram <%s> Terminated\n",
-				program_name);
-			mb_memory_clear(verbose, &error);
-			exit(error);
-			}
-
-		    /* allocate memory for reading data arrays */
-		    if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							    sizeof(char), (void **)&beamflag, &error);
-		    if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							    sizeof(double), (void **)&bath, &error);
-		    if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_AMPLITUDE,
-							    sizeof(double), (void **)&amp, &error);
-		    if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							    sizeof(double), (void **)&bathlon, &error);
-		    if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							    sizeof(double), (void **)&bathlat, &error);
-		    if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_SIDESCAN,
-							    sizeof(double), (void **)&ss, &error);
-		    if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_SIDESCAN,
-							    sizeof(double), (void **)&sslon, &error);
-		    if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_SIDESCAN,
-							    sizeof(double), (void **)&sslat, &error);
-
-		    /* if error initializing memory then quit */
-		    if (error != MB_ERROR_NO_ERROR)
-			{
-			mb_error(verbose,error,&message);
-			fprintf(outfp,"\nMBIO Error allocating data arrays:\n%s\n",
-				message);
-			fprintf(outfp,"\nProgram <%s> Terminated\n",
-				program_name);
-			mb_memory_clear(verbose, &error);
-			exit(error);
-			}
-
-		    /* loop over reading */
-		    while (error <= MB_ERROR_NO_ERROR)
-			{
-			status = mb_read(verbose,mbio_ptr,&kind,
-				&rpings,time_i,&time_d,
-				&navlon,&navlat,
-				&speed,&heading,
-				&distance,&altitude,&sonardepth,
-				&beams_bath,&beams_amp,&pixels_ss,
-				beamflag,bath,amp,bathlon,bathlat,
-				ss,sslon,sslat,
-				comment,&error);
-
-			/* time gaps are not a problem here */
-			if (error == MB_ERROR_TIME_GAP)
-				{
-				error = MB_ERROR_NO_ERROR;
-				status = MB_SUCCESS;
-				}
-
-			/* print debug statements */
-			if (verbose >= 2)
-				{
-				fprintf(outfp,"\ndbg2  Ping read in program <%s>\n",program_name);
-				fprintf(outfp,"dbg2       kind:           %d\n",kind);
-				fprintf(outfp,"dbg2       beams_bath:     %d\n",beams_bath);
-				fprintf(outfp,"dbg2       beams_amp:      %d\n",beams_amp);
-				fprintf(outfp,"dbg2       pixels_ss:      %d\n",pixels_ss);
-				fprintf(outfp,"dbg2       error:          %d\n",error);
-				fprintf(outfp,"dbg2       status:         %d\n",status);
-				}
-
-			if ((datatype == MBGRID_DATA_BATHYMETRY
-				|| datatype == MBGRID_DATA_TOPOGRAPHY)
-				&& error == MB_ERROR_NO_ERROR)
-			  {
-
-			  /* reproject beam positions if necessary */
-			  if (use_projection == MB_YES)
-			    {
-			    for (ib=0;ib<beams_bath;ib++)
-			      if (mb_beam_ok(beamflag[ib]))
-				mb_proj_forward(verbose, pjptr,
-						bathlon[ib], bathlat[ib],
-						&bathlon[ib], &bathlat[ib],
-						&error);
-			    }
-
-			  /* deal with data */
-			  for (ib=0;ib<beams_bath;ib++)
-			    if (mb_beam_ok(beamflag[ib]))
-			      {
-			      /* get position in grid */
-			      ix = (bathlon[ib] - wbnd[0] + 0.5*dx)/dx;
-			      iy = (bathlat[ib] - wbnd[2] + 0.5*dy)/dy;
-/* if (ib==beams_bath/2)fprintf(outfp, "ib:%d ix:%d iy:%d   bath: lon:%.10f lat:%.10f bath:%f   dx:%.10f dy:%.10f  origin: lon:%.10f lat:%.10f\n",
-ib, ix, iy, bathlon[ib], bathlat[ib], bath[ib], dx, dy, wbnd[0], wbnd[1]); */
-
-			      /* check if within allowed time */
-			      if (check_time == MB_YES)
-			        {
-				/* if in region of interest
-				   check if time is ok */
-				if (ix >= 0 && ix < gxdim
-				  && iy >= 0 && iy < gydim)
-				  {
-			          kgrid = ix*gydim + iy;
-				  if (firsttime[kgrid] <= 0.0)
-				    {
-				    firsttime[kgrid] = time_d;
-				    time_ok = MB_YES;
-				    }
-				  else if (fabs(time_d - firsttime[kgrid])
-				    > timediff)
-				    {
-				    if (first_in_stays == MB_YES)
-					time_ok = MB_NO;
-				    else
-					{
-					time_ok = MB_YES;
-					firsttime[kgrid] = time_d;
-					ndata = ndata - cnt[kgrid];
-					ndatafile = ndatafile - cnt[kgrid];
-					norm[kgrid] = 0.0;
-					grid[kgrid] = 0.0;
-					sigma[kgrid] = 0.0;
-					num[kgrid] = 0;
-					cnt[kgrid] = 0;
-					}
-				    }
-			          else
-				    time_ok = MB_YES;
-				  }
-				else
-				  time_ok = MB_YES;
-				}
-			      else
-				time_ok = MB_YES;
-
-			      /* process if in region of interest */
-			      if (grid_mode == MBGRID_WEIGHTED_MEAN
-			        && ix >= -xtradim
-				&& ix < gxdim + xtradim
-				&& iy >= -xtradim
-				&& iy < gydim + xtradim
-				&& time_ok == MB_YES)
-			        {
-			        ix1 = MAX(ix - xtradim, 0);
-			        ix2 = MIN(ix + xtradim, gxdim - 1);
-			        iy1 = MAX(iy - xtradim, 0);
-			        iy2 = MIN(iy + xtradim, gydim - 1);
-			        for (ii=ix1;ii<=ix2;ii++)
-			         for (jj=iy1;jj<=iy2;jj++)
-				   {
-				   kgrid = ii*gydim + jj;
-				   xx = wbnd[0] + ii*dx - bathlon[ib];
-				   yy = wbnd[2] + jj*dy - bathlat[ib];
-				   weight = file_weight * exp(-(xx*xx + yy*yy)*factor);
-				   norm[kgrid] = norm[kgrid] + weight;
-				   grid[kgrid] = grid[kgrid]
-					+ weight*topofactor*bath[ib];
-				   sigma[kgrid] = sigma[kgrid]
-					+ weight*topofactor*topofactor
-					*bath[ib]*bath[ib];
-				   num[kgrid]++;
-				   if (ii == ix && jj == iy)
-					cnt[kgrid]++;
-				   }
-				ndata++;
-				ndatafile++;
-				}
-			      else if (ix >= 0
-				&& ix < gxdim
-				&& iy >= 0
-				&& iy < gydim
-				&& time_ok == MB_YES)
-			        {
-				kgrid = ix*gydim + iy;
-				if ((num[kgrid] > 0
-				  && grid_mode == MBGRID_MINIMUM_FILTER
-				  && grid[kgrid] > topofactor*bath[ib])
-				  || (num[kgrid] > 0
-				  && grid_mode == MBGRID_MAXIMUM_FILTER
-				  && grid[kgrid] < topofactor*bath[ib])
-				  || num[kgrid] <= 0)
-				  {
-				  norm[kgrid] = 1.0;
-				  grid[kgrid] = topofactor*bath[ib];
-				  sigma[kgrid] = topofactor*topofactor
-					    *bath[ib]*bath[ib];
-				  num[kgrid] = 1;
-				  cnt[kgrid] = 1;
-				  }
-				ndata++;
-				ndatafile++;
-				}
-			      }
-			  }
-			else if (datatype == MBGRID_DATA_AMPLITUDE
-				&& error == MB_ERROR_NO_ERROR)
-			  {
-
-			  /* reproject beam positions if necessary */
-			  if (use_projection == MB_YES)
-			    {
-			    for (ib=0;ib<beams_amp;ib++)
-			      if (mb_beam_ok(beamflag[ib]))
-				mb_proj_forward(verbose, pjptr,
-						bathlon[ib], bathlat[ib],
-						&bathlon[ib], &bathlat[ib],
-						&error);
-			    }
-
-			  /* deal with data */
-			  for (ib=0;ib<beams_amp;ib++)
-			    if (mb_beam_ok(beamflag[ib]))
-			      {
-			      /* get position in grid */
-			      ix = (bathlon[ib] - wbnd[0] + 0.5*dx)/dx;
-			      iy = (bathlat[ib] - wbnd[2] + 0.5*dy)/dy;
-
-			      /* check if within allowed time */
-			      if (check_time == MB_YES)
-			        {
-				/* if in region of interest
-				   check if time is ok */
-				if (ix >= 0 && ix < gxdim
-				  && iy >= 0 && iy < gydim)
-				  {
-			          kgrid = ix*gydim + iy;
-				  if (firsttime[kgrid] <= 0.0)
-				    {
-				    firsttime[kgrid] = time_d;
-				    time_ok = MB_YES;
-				    }
-				  else if (fabs(time_d - firsttime[kgrid])
-				    > timediff)
-				    {
-				    if (first_in_stays == MB_YES)
-					time_ok = MB_NO;
-				    else
-					{
-					time_ok = MB_YES;
-					firsttime[kgrid] = time_d;
-					ndata = ndata - cnt[kgrid];
-					ndatafile = ndatafile - cnt[kgrid];
-					norm[kgrid] = 0.0;
-					grid[kgrid] = 0.0;
-					sigma[kgrid] = 0.0;
-					num[kgrid] = 0;
-					cnt[kgrid] = 0;
-					}
-				    }
-			          else
-				    time_ok = MB_YES;
-				  }
-				else
-				  time_ok = MB_YES;
-				}
-			      else
-				time_ok = MB_YES;
-
-			      /* process if in region of interest */
-			      if (grid_mode == MBGRID_WEIGHTED_MEAN
-			        && ix >= -xtradim
-				&& ix < gxdim + xtradim
-				&& iy >= -xtradim
-				&& iy < gydim + xtradim
-				&& time_ok == MB_YES)
-			        {
-			        ix1 = MAX(ix - xtradim, 0);
-			        ix2 = MIN(ix + xtradim, gxdim - 1);
-			        iy1 = MAX(iy - xtradim, 0);
-			        iy2 = MIN(iy + xtradim, gydim - 1);
-			        for (ii=ix1;ii<=ix2;ii++)
-			         for (jj=iy1;jj<=iy2;jj++)
-				   {
-				   kgrid = ii*gydim + jj;
-				   xx = wbnd[0] + ii*dx - bathlon[ib];
-				   yy = wbnd[2] + jj*dy - bathlat[ib];
-				   weight = file_weight * exp(-(xx*xx + yy*yy)*factor);
-				   norm[kgrid] = norm[kgrid] + weight;
-				   grid[kgrid] = grid[kgrid] + weight*amp[ib];
-				   sigma[kgrid] = sigma[kgrid]
-					+ weight*amp[ib]*amp[ib];
-				   num[kgrid]++;
-				   if (ii == ix && jj == iy)
-					cnt[kgrid]++;
-				   }
-				ndata++;
-				ndatafile++;
-				}
-			      else if (ix >= 0
-				&& ix < gxdim
-				&& iy >= 0
-				&& iy < gydim
-				&& time_ok == MB_YES)
-			        {
-				kgrid = ix*gydim + iy;
-				if ((num[kgrid] > 0
-				  && grid_mode == MBGRID_MINIMUM_FILTER
-				  && grid[kgrid] > amp[ib])
-				  || (num[kgrid] > 0
-				  && grid_mode == MBGRID_MAXIMUM_FILTER
-				  && grid[kgrid] < amp[ib])
-				  || num[kgrid] <= 0)
-				  {
-				  norm[kgrid] = 1.0;
-				  grid[kgrid] = amp[ib];
-				  sigma[kgrid] = amp[ib]*amp[ib];
-				  num[kgrid] = 1;
-				  cnt[kgrid] = 1;
-				  }
-				ndata++;
-				ndatafile++;
-				}
-			      }
-			  }
-			else if (datatype == MBGRID_DATA_SIDESCAN
-				&& error == MB_ERROR_NO_ERROR)
-			  {
-
-			  /* reproject pixel positions if necessary */
-			  if (use_projection == MB_YES)
-			    {
-			    for (ib=0;ib<pixels_ss;ib++)
-			      if (ss[ib] > MB_SIDESCAN_NULL)
-				mb_proj_forward(verbose, pjptr,
-						sslon[ib], sslat[ib],
-						&sslon[ib], &sslat[ib],
-						&error);
-			    }
-
-			  /* deal with data */
-			  for (ib=0;ib<pixels_ss;ib++)
-			    if (ss[ib] > MB_SIDESCAN_NULL)
-			      {
-			      /* get position in grid */
-			      ix = (sslon[ib] - wbnd[0] + 0.5*dx)/dx;
-			      iy = (sslat[ib] - wbnd[2] + 0.5*dy)/dy;
-
-			      /* check if within allowed time */
-			      if (check_time == MB_YES)
-			        {
-				/* if in region of interest
-				   check if time is ok */
-				if (ix >= 0 && ix < gxdim
-				  && iy >= 0 && iy < gydim)
-				  {
-			          kgrid = ix*gydim + iy;
-				  if (firsttime[kgrid] <= 0.0)
-				    {
-				    firsttime[kgrid] = time_d;
-				    time_ok = MB_YES;
-				    }
-				  else if (fabs(time_d - firsttime[kgrid])
-				    > timediff)
-				    {
-				    if (first_in_stays == MB_YES)
-					time_ok = MB_NO;
-				    else
-					{
-					time_ok = MB_YES;
-					firsttime[kgrid] = time_d;
-					ndata = ndata - cnt[kgrid];
-					ndatafile = ndatafile - cnt[kgrid];
-					norm[kgrid] = 0.0;
-					grid[kgrid] = 0.0;
-					sigma[kgrid] = 0.0;
-					num[kgrid] = 0;
-					cnt[kgrid] = 0;
-					}
-				    }
-			          else
-				    time_ok = MB_YES;
-				  }
-				else
-				  time_ok = MB_YES;
-				}
-			      else
-				time_ok = MB_YES;
-
-			      /* process if in region of interest */
-			      if (grid_mode == MBGRID_WEIGHTED_MEAN
-			        && ix >= -xtradim
-				&& ix < gxdim + xtradim
-				&& iy >= -xtradim
-				&& iy < gydim + xtradim
-				&& time_ok == MB_YES)
-			        {
-			        ix1 = MAX(ix - xtradim, 0);
-			        ix2 = MIN(ix + xtradim, gxdim - 1);
-			        iy1 = MAX(iy - xtradim, 0);
-			        iy2 = MIN(iy + xtradim, gydim - 1);
-			        for (ii=ix1;ii<=ix2;ii++)
-			         for (jj=iy1;jj<=iy2;jj++)
-				   {
-				   kgrid = ii*gydim + jj;
-				   xx = wbnd[0] + ii*dx - sslon[ib];
-				   yy = wbnd[2] + jj*dy - sslat[ib];
-				   weight = file_weight * exp(-(xx*xx + yy*yy)*factor);
-				   norm[kgrid] = norm[kgrid] + weight;
-				   grid[kgrid] = grid[kgrid] + weight*ss[ib];
-				   sigma[kgrid] = sigma[kgrid]
-					+ weight*ss[ib]*ss[ib];
-				   num[kgrid]++;
-				   if (ii == ix && jj == iy)
-					cnt[kgrid]++;
-				   }
-				ndata++;
-				ndatafile++;
-				}
-			      else if (ix >= 0
-				&& ix < gxdim
-				&& iy >= 0
-				&& iy < gydim
-				&& time_ok == MB_YES)
-			        {
-				kgrid = ix*gydim + iy;
-				if ((num[kgrid] > 0
-				  && grid_mode == MBGRID_MINIMUM_FILTER
-				  && grid[kgrid] > ss[ib])
-				  || (num[kgrid] > 0
-				  && grid_mode == MBGRID_MAXIMUM_FILTER
-				  && grid[kgrid] < ss[ib])
-				  || num[kgrid] <= 0)
-				  {
-				  norm[kgrid] = 1.0;
-				  grid[kgrid] = ss[ib];
-				  sigma[kgrid] = ss[ib]*ss[ib];
-				  num[kgrid] = 1;
-				  cnt[kgrid] = 1;
-				  }
-				ndata++;
-				ndatafile++;
-				}
-			      }
-			  }
-			}
-		    status = mb_close(verbose,&mbio_ptr,&error);
-		    status = MB_SUCCESS;
-		    error = MB_ERROR_NO_ERROR;
-		    }
-		if (verbose >= 2)
-			fprintf(outfp,"\n");
-		if (verbose > 0 || file_in_bounds == MB_YES)
-			fprintf(outfp,"%d data points processed in %s\n",
-				ndatafile,rfile);
-
-		/* add to datalist if data actually contributed */
-		if (ndatafile > 0 && dfp != NULL)
-			{
-			if (pstatus == MB_PROCESSED_USE)
-				fprintf(dfp, "P:");
-			else
-				fprintf(dfp, "R:");
-			fprintf(dfp, "%s %d %f\n", path, format, file_weight);
-			fflush(dfp);
-			}
-		} /* end if (format > 0) */
-
-		/* if format == 0 then input is lon,lat,values triples file */
-		else if (format == 0 && path[0] != '#')
-		{
-		/* open data file */
-		if ((rfp = fopen(path,"r")) == NULL)
-			{
-			error = MB_ERROR_OPEN_FAIL;
-			fprintf(outfp,"\nUnable to open lon,lat,value triples data file1: %s\n",
-				path);
-			fprintf(outfp,"\nProgram <%s> Terminated\n",
-				program_name);
-			mb_memory_clear(verbose, &error);
-			exit(error);
-			}
-
-		/* loop over reading */
-		while (fscanf(rfp,"%lf %lf %lf",&tlon,&tlat,&tvalue) != EOF)
-			{
-			  /* reproject data positions if necessary */
-			  if (use_projection == MB_YES)
-				mb_proj_forward(verbose, pjptr,
-						tlon, tlat,
-						&tlon, &tlat,
-						&error);
-
-			  /* get position in grid */
-			  ix = (tlon - wbnd[0] + 0.5*dx)/dx;
-			  iy = (tlat - wbnd[2] + 0.5*dy)/dy;
-
-			  /* check if overwriting */
-			  if (check_time == MB_YES)
-			    {
-			    /* if in region of interest
-			       check if overwriting */
-			    if (ix >= 0 && ix < gxdim
-			      && iy >= 0 && iy < gydim)
-			      {
-			      kgrid = ix*gydim + iy;
-			      if (firsttime[kgrid] > 0.0)
-				time_ok = MB_NO;
-			      else
-				time_ok = MB_YES;
-			      }
-			    else
-			      time_ok = MB_YES;
-			    }
-			  else
-			    time_ok = MB_YES;
-
-			  /* process the data */
-			  if (grid_mode == MBGRID_WEIGHTED_MEAN
-			    && ix >= -xtradim
-			    && ix < gxdim + xtradim
-			    && iy >= -xtradim
-			    && iy < gydim + xtradim
-			    && time_ok == MB_YES)
-			    {
-			    ix1 = MAX(ix - xtradim, 0);
-			    ix2 = MIN(ix + xtradim, gxdim - 1);
-			    iy1 = MAX(iy - xtradim, 0);
-			    iy2 = MIN(iy + xtradim, gydim - 1);
-			    for (ii=ix1;ii<=ix2;ii++)
-			     for (jj=iy1;jj<=iy2;jj++)
-			       {
-			       kgrid = ii*gydim + jj;
-			       xx = wbnd[0] + ii*dx - tlon;
-			       yy = wbnd[2] + jj*dy - tlat;
-			       weight = file_weight * exp(-(xx*xx + yy*yy)*factor);
-			       norm[kgrid] = norm[kgrid] + weight;
-			       grid[kgrid] = grid[kgrid]
-				    + weight*topofactor*tvalue;
-			       sigma[kgrid] = sigma[kgrid]
-				    + weight*topofactor*topofactor
-				    *tvalue*tvalue;
-			       num[kgrid]++;
-			       if (ii == ix && jj == iy)
-				    cnt[kgrid]++;
-			       }
-			    ndata++;
-			    ndatafile++;
-			    }
-			  else if (ix >= 0
-			    && ix < gxdim
-			    && iy >= 0
-			    && iy < gydim
-			    && time_ok == MB_YES)
-			    {
-			    kgrid = ix*gydim + iy;
-			    if ((num[kgrid] > 0
-			      && grid_mode == MBGRID_MINIMUM_FILTER
-			      && grid[kgrid] > topofactor*tvalue)
-			      || (num[kgrid] > 0
-			      && grid_mode == MBGRID_MAXIMUM_FILTER
-			      && grid[kgrid] < topofactor*tvalue)
-			      || num[kgrid] <= 0)
-			      {
-			      norm[kgrid] = 1.0;
-			      grid[kgrid] = topofactor*tvalue;
-			      sigma[kgrid] = topofactor*topofactor
-					*tvalue*tvalue;
-			      num[kgrid] = 1;
-			      cnt[kgrid] = 1;
-			      }
-			    ndata++;
-			    ndatafile++;
-			    }
-			}
-		fclose(rfp);
-		status = MB_SUCCESS;
-		error = MB_ERROR_NO_ERROR;
-		if (verbose >= 2)
-			fprintf(outfp,"\n");
-		if (verbose > 0)
-			fprintf(outfp,"%d data points processed in %s\n",
-				ndatafile,file);
-
-		/* add to datalist if data actually contributed */
-		if (ndatafile > 0 && dfp != NULL)
-			{
-			if (pstatus == MB_PROCESSED_USE)
-				fprintf(dfp, "P:");
-			else
-				fprintf(dfp, "R:");
-			fprintf(dfp, "%s %d %f\n", path, format, file_weight);
-			fflush(dfp);
-			}
-		} /* end if (format == 0) */
-
-		}
-	if (datalist != NULL)
-		mb_datalist_close(verbose,&datalist,&error);
-	if (verbose > 0)
-		fprintf(outfp,"\n%d total data points processed\n",ndata);
-
-	/* close datalist if necessary */
-	if (dfp != NULL)
-		{
-		fclose(dfp);
-		dfp = NULL;
-		}
-
-	/* now loop over all points in the output grid */
-	if (verbose >= 1)
-		fprintf(outfp,"\nMaking raw grid...\n");
-	nbinset = 0;
-	nbinzero = 0;
-	nbinspline = 0;
-	nbinbackground = 0;
-	for (i=0;i<gxdim;i++)
-		for (j=0;j<gydim;j++)
-			{
-			kgrid = i * gydim + j;
-			if (cnt[kgrid] > 0)
-				{
-				grid[kgrid] = grid[kgrid]/norm[kgrid];
-				factor = sigma[kgrid]/norm[kgrid]
-					- grid[kgrid]*grid[kgrid];
-				sigma[kgrid] = sqrt(fabs(factor));
-				nbinset++;
-				}
-			else
-				{
-				grid[kgrid] = clipvalue;
-				sigma[kgrid] = 0.0;
-				}
-			/*fprintf(outfp,"%d %d %d  %f %f %f   %d %d %f %f\n",
-				i,j,kgrid,
-				grid[kgrid], wbnd[0] + i*dx, wbnd[2] + j*dy,
-				num[kgrid],cnt[kgrid],norm[kgrid],sigma[kgrid]);*/
-			}
-
-	/***** end of weighted mean gridding *****/
-	}
-
-	/***** else do median filtering gridding *****/
-	else if (grid_mode == MBGRID_MEDIAN_FILTER)
-	{
-
-	/* allocate memory for additional arrays */
-	status = mb_mallocd(verbose,__FILE__,__LINE__,gxdim*gydim*sizeof(double *),(void **)&data,&error);
-
-	/* if error initializing memory then quit */
-	if (error != MB_ERROR_NO_ERROR)
-		{
-		mb_error(verbose,error,&message);
-		fprintf(outfp,"\nMBIO Error allocating data arrays:\n%s\n",
-			message);
-		fprintf(outfp,"\nProgram <%s> Terminated\n",
-			program_name);
-		mb_memory_clear(verbose, &error);
-		exit(error);
-		}
-
-	/* initialize arrays */
-	for (i=0;i<gxdim;i++)
-		for (j=0;j<gydim;j++)
-			{
-			kgrid = i * gydim + j;
-			grid[kgrid] = 0.0;
-			sigma[kgrid] = 0.0;
-			firsttime[kgrid] = 0.0;
-			cnt[kgrid] = 0;
-			num[kgrid] = 0;
-			data[kgrid] = NULL;
-			}
-
-	/* read in data */
-	ndata = 0;
-	if ((status = mb_datalist_open(verbose,&datalist,
-					filelist,look_processed,&error)) != MB_SUCCESS)
-		{
-		error = MB_ERROR_OPEN_FAIL;
-		fprintf(outfp,"\nUnable to open data list file: %s\n",
-			filelist);
-		fprintf(outfp,"\nProgram <%s> Terminated\n",
-			program_name);
-		mb_memory_clear(verbose, &error);
-		exit(error);
-		}
-	while ((status = mb_datalist_read2(verbose,datalist,
-			&pstatus,path,ppath,&format,&file_weight,&error))
-			== MB_SUCCESS)
-		{
-		ndatafile = 0;
-
-		/* if format > 0 then input is swath sonar file */
-		if (format > 0 && path[0] != '#')
-		{
-		/* apply pstatus */
-		if (pstatus == MB_PROCESSED_USE)
-			strcpy(file, ppath);
-		else
-			strcpy(file, path);
-
-		/* check for mbinfo file - get file bounds if possible */
-		rformat = format;
-		strcpy(rfile,file);
-		status = mb_check_info(verbose, file, lonflip, bounds,
-				&file_in_bounds, &error);
-		if (status == MB_FAILURE)
-			{
-			file_in_bounds = MB_YES;
-			status = MB_SUCCESS;
-			error = MB_ERROR_NO_ERROR;
-			}
-
-		/* initialize the swath sonar file */
-		if (file_in_bounds == MB_YES)
-		    {
-		    /* check for "fast bathymetry" or "fbt" file */
-		    if (datatype == MBGRID_DATA_TOPOGRAPHY
-			    || datatype == MBGRID_DATA_BATHYMETRY)
-			{
-			mb_get_fbt(verbose, rfile, &rformat, &error);
-			}
-
-		    /* call mb_read_init() */
-		    if ((status = mb_read_init(
-			verbose,rfile,rformat,pings,lonflip,bounds,
-			btime_i,etime_i,speedmin,timegap,
-			&mbio_ptr,&btime_d,&etime_d,
-			&beams_bath,&beams_amp,&pixels_ss,&error)) != MB_SUCCESS)
-			{
-			mb_error(verbose,error,&message);
-			fprintf(outfp,"\nMBIO Error returned from function <mb_read_init>:\n%s\n",message);
-			fprintf(outfp,"\nMultibeam File <%s> not initialized for reading\n",rfile);
-			fprintf(outfp,"\nProgram <%s> Terminated\n",
-				program_name);
-			mb_memory_clear(verbose, &error);
-			exit(error);
-			}
-
-		    /* allocate memory for reading data arrays */
-		    if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							    sizeof(char), (void **)&beamflag, &error);
-		    if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							    sizeof(double), (void **)&bath, &error);
-		    if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_AMPLITUDE,
-							    sizeof(double), (void **)&amp, &error);
-		    if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							    sizeof(double), (void **)&bathlon, &error);
-		    if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							    sizeof(double), (void **)&bathlat, &error);
-		    if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_SIDESCAN,
-							    sizeof(double), (void **)&ss, &error);
-		    if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_SIDESCAN,
-							    sizeof(double), (void **)&sslon, &error);
-		    if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_SIDESCAN,
-							    sizeof(double), (void **)&sslat, &error);
-
-		    /* if error initializing memory then quit */
-		    if (error != MB_ERROR_NO_ERROR)
-			{
-			mb_error(verbose,error,&message);
-			fprintf(outfp,"\nMBIO Error allocating data arrays:\n%s\n",
-				message);
-			fprintf(outfp,"\nProgram <%s> Terminated\n",
-				program_name);
-			mb_memory_clear(verbose, &error);
-			exit(error);
-			}
-
-		    /* loop over reading */
-		    while (error <= MB_ERROR_NO_ERROR)
-			{
-			status = mb_read(verbose,mbio_ptr,&kind,
-				&rpings,time_i,&time_d,
-				&navlon,&navlat,
-				&speed,&heading,
-				&distance,&altitude,&sonardepth,
-				&beams_bath,&beams_amp,&pixels_ss,
-				beamflag,bath,amp,bathlon,bathlat,
-				ss,sslon,sslat,
-				comment,&error);
-
-			/* time gaps are not a problem here */
-			if (error == MB_ERROR_TIME_GAP)
-				{
-				error = MB_ERROR_NO_ERROR;
-				status = MB_SUCCESS;
-				}
-
-			/* print debug statements */
-			if (verbose >= 2)
-				{
-				fprintf(outfp,"\ndbg2  Ping read in program <%s>\n",program_name);
-				fprintf(outfp,"dbg2       kind:           %d\n",kind);
-				fprintf(outfp,"dbg2       beams_bath:     %d\n",beams_bath);
-				fprintf(outfp,"dbg2       beams_amp:      %d\n",beams_amp);
-				fprintf(outfp,"dbg2       pixels_ss:      %d\n",pixels_ss);
-				fprintf(outfp,"dbg2       error:          %d\n",error);
-				fprintf(outfp,"dbg2       status:         %d\n",status);
-				}
-
-			if ((datatype == MBGRID_DATA_BATHYMETRY
-				|| datatype == MBGRID_DATA_TOPOGRAPHY)
-				&& error == MB_ERROR_NO_ERROR)
-			  {
-
-			  /* reproject beam positions if necessary */
-			  if (use_projection == MB_YES)
-			    {
-			    for (ib=0;ib<beams_bath;ib++)
-			      if (mb_beam_ok(beamflag[ib]))
-				mb_proj_forward(verbose, pjptr,
-						bathlon[ib], bathlat[ib],
-						&bathlon[ib], &bathlat[ib],
-						&error);
-			    }
-
-			  /* deal with data */
-			  for (ib=0;ib<beams_bath;ib++)
-			    if (mb_beam_ok(beamflag[ib]))
-			      {
-			      ix = (bathlon[ib] - wbnd[0] + 0.5*dx)/dx;
-			      iy = (bathlat[ib] - wbnd[2] + 0.5*dy)/dy;
-			      if (ix >= 0 && ix < gxdim
-				&& iy >= 0 && iy < gydim)
-			        {
-			        /* check if within allowed time */
-				kgrid = ix*gydim + iy;
-			        if (check_time == MB_NO)
-			          time_ok = MB_YES;
-			        else
-			          {
-				  if (firsttime[kgrid] <= 0.0)
-				    {
-				    firsttime[kgrid] = time_d;
-				    time_ok = MB_YES;
-				    }
-				  else if (fabs(time_d - firsttime[kgrid])
-				    > timediff)
-				    {
-				    if (first_in_stays == MB_YES)
-					time_ok = MB_NO;
-				    else
-					{
-					time_ok = MB_YES;
-					firsttime[kgrid] = time_d;
-					ndata = ndata - cnt[kgrid];
-					ndatafile = ndatafile - cnt[kgrid];
-					cnt[kgrid] = 0;
-					}
-				    }
-			          else
-				    time_ok = MB_YES;
-				  }
-
-				/* make sure there is space for the data */
-				if (time_ok == MB_YES
-				  && cnt[kgrid] >= num[kgrid])
-				  {
-				  num[kgrid] += REALLOC_STEP_SIZE;
-				  if ((data[kgrid] = (double *)
-					realloc(data[kgrid], num[kgrid]*sizeof(double)))
-					== NULL)
-					{
-					error = MB_ERROR_MEMORY_FAIL;
-					mb_error(verbose,error,&message);
-					fprintf(outfp,"\nMBIO Error allocating data arrays:\n%s\n",
-					    message);
-					fprintf(outfp,"The weighted mean algorithm uses much less\n");
-					fprintf(outfp,"memory than the median filter algorithm.\n");
-					fprintf(outfp,"You could also try using ping averaging to\n");
-					fprintf(outfp,"reduce the number of data points to be gridded.\n");
-					fprintf(outfp,"\nProgram <%s> Terminated\n",
-					    program_name);
-					mb_memory_clear(verbose, &error);
-					exit(error);
-					}
-				  }
-
-				/* process it */
-				if (time_ok == MB_YES)
-				  {
-				  value = data[kgrid];
-				  value[cnt[kgrid]] = topofactor*bath[ib];
-				  cnt[kgrid]++;
-				  ndata++;
-				  ndatafile++;
-				  }
-				}
-			      }
-			  }
-			else if (datatype == MBGRID_DATA_AMPLITUDE
-				&& error == MB_ERROR_NO_ERROR)
-			  {
-
-			  /* reproject beam positions if necessary */
-			  if (use_projection == MB_YES)
-			    {
-			    for (ib=0;ib<beams_amp;ib++)
-			      if (mb_beam_ok(beamflag[ib]))
-				mb_proj_forward(verbose, pjptr,
-						bathlon[ib], bathlat[ib],
-						&bathlon[ib], &bathlat[ib],
-						&error);
-			    }
-
-			  /* deal with data */
-			  for (ib=0;ib<beams_bath;ib++)
-			    if (mb_beam_ok(beamflag[ib]))
-			      {
-			      ix = (bathlon[ib] - wbnd[0] + 0.5*dx)/dx;
-			      iy = (bathlat[ib] - wbnd[2] + 0.5*dy)/dy;
-			      if (ix >= 0 && ix < gxdim
-				&& iy >= 0 && iy < gydim)
-			        {
-			        /* check if within allowed time */
-				kgrid = ix*gydim + iy;
-			        if (check_time == MB_NO)
-			          time_ok = MB_YES;
-			        else
-			          {
-				  if (firsttime[kgrid] <= 0.0)
-				    {
-				    firsttime[kgrid] = time_d;
-				    time_ok = MB_YES;
-				    }
-				  else if (fabs(time_d - firsttime[kgrid])
-				    > timediff)
-				    {
-				    if (first_in_stays == MB_YES)
-					time_ok = MB_NO;
-				    else
-					{
-					time_ok = MB_YES;
-					firsttime[kgrid] = time_d;
-					ndata = ndata - cnt[kgrid];
-					ndatafile = ndatafile - cnt[kgrid];
-					cnt[kgrid] = 0;
-					}
-				    }
-			          else
-				    time_ok = MB_YES;
-				  }
-
-				/* make sure there is space for the data */
-				if (time_ok == MB_YES
-				  && cnt[kgrid] >= num[kgrid])
-				  {
-				  num[kgrid] += REALLOC_STEP_SIZE;
-				  if ((data[kgrid] = (double *)
-					realloc(data[kgrid], num[kgrid]*sizeof(double)))
-					== NULL)
-					{
-					error = MB_ERROR_MEMORY_FAIL;
-					mb_error(verbose,error,&message);
-					fprintf(outfp,"\nMBIO Error allocating data arrays:\n%s\n",
-					    message);
-					fprintf(outfp,"The weighted mean algorithm uses much less\n");
-					fprintf(outfp,"memory than the median filter algorithm.\n");
-					fprintf(outfp,"You could also try using ping averaging to\n");
-					fprintf(outfp,"reduce the number of data points to be gridded.\n");
-					fprintf(outfp,"\nProgram <%s> Terminated\n",
-					    program_name);
-					mb_memory_clear(verbose, &error);
-					exit(error);
-					}
-				  }
-
-				/* process it */
-				if (time_ok == MB_YES)
-				  {
-				  value = data[kgrid];
-				  value[cnt[kgrid]] = amp[ib];
-				  cnt[kgrid]++;
-				  ndata++;
-				  ndatafile++;
-				  }
-				}
-			      }
-			  }
-			else if (datatype == MBGRID_DATA_SIDESCAN
-				&& error == MB_ERROR_NO_ERROR)
-			  {
-
-			  /* reproject pixel positions if necessary */
-			  if (use_projection == MB_YES)
-			    {
-			    for (ib=0;ib<pixels_ss;ib++)
-			      if (ss[ib] > MB_SIDESCAN_NULL)
-				mb_proj_forward(verbose, pjptr,
-						sslon[ib], sslat[ib],
-						&sslon[ib], &sslat[ib],
-						&error);
-			    }
-
-			  /* deal with data */
-			  for (ib=0;ib<pixels_ss;ib++)
-			    if (ss[ib] > MB_SIDESCAN_NULL)
-			      {
-			      ix = (sslon[ib] - wbnd[0] + 0.5*dx)/dx;
-			      iy = (sslat[ib] - wbnd[2] + 0.5*dy)/dy;
-			      if (ix >= 0 && ix < gxdim
-				&& iy >= 0 && iy < gydim)
-			        {
-			        /* check if within allowed time */
-				kgrid = ix*gydim + iy;
-			        if (check_time == MB_NO)
-			          time_ok = MB_YES;
-			        else
-			          {
-				  if (firsttime[kgrid] <= 0.0)
-				    {
-				    firsttime[kgrid] = time_d;
-				    time_ok = MB_YES;
-				    }
-				  else if (fabs(time_d - firsttime[kgrid])
-				    > timediff)
-				    {
-				    if (first_in_stays == MB_YES)
-					time_ok = MB_NO;
-				    else
-					{
-					time_ok = MB_YES;
-					firsttime[kgrid] = time_d;
-					ndata = ndata - cnt[kgrid];
-					ndatafile = ndatafile - cnt[kgrid];
-					cnt[kgrid] = 0;
-					}
-				    }
-			          else
-				    time_ok = MB_YES;
-				  }
-
-				/* make sure there is space for the data */
-				if (time_ok == MB_YES
-				  && cnt[kgrid] >= num[kgrid])
-				  {
-				  num[kgrid] += REALLOC_STEP_SIZE;
-				  if ((data[kgrid] = (double *)
-					realloc(data[kgrid], num[kgrid]*sizeof(double)))
-					== NULL)
-					{
-					error = MB_ERROR_MEMORY_FAIL;
-					mb_error(verbose,error,&message);
-					fprintf(outfp,"\nMBIO Error allocating data arrays:\n%s\n",
-					    message);
-					fprintf(outfp,"The weighted mean algorithm uses much less\n");
-					fprintf(outfp,"memory than the median filter algorithm.\n");
-					fprintf(outfp,"You could also try using ping averaging to\n");
-					fprintf(outfp,"reduce the number of data points to be gridded.\n");
-					fprintf(outfp,"\nProgram <%s> Terminated\n",
-					    program_name);
-					mb_memory_clear(verbose, &error);
-					exit(error);
-					}
-				  }
-
-				/* process it */
-				if (time_ok == MB_YES)
-				  {
-				  value = data[kgrid];
-				  value[cnt[kgrid]] = ss[ib];
-				  cnt[kgrid]++;
-				  ndata++;
-				  ndatafile++;
-				  }
-				}
-			      }
-			  }
-			}
-		    status = mb_close(verbose,&mbio_ptr,&error);
-		    status = MB_SUCCESS;
-		    error = MB_ERROR_NO_ERROR;
-		    }
-		if (verbose >= 2)
-			fprintf(outfp,"\n");
-		if (verbose > 0 || file_in_bounds == MB_YES)
-			fprintf(outfp,"%d data points processed in %s\n",
-				ndatafile,rfile);
-
-		/* add to datalist if data actually contributed */
-		if (ndatafile > 0 && dfp != NULL)
-			{
-			if (pstatus == MB_PROCESSED_USE)
-				fprintf(dfp, "P:");
-			else
-				fprintf(dfp, "R:");
-			fprintf(dfp, "%s %d %f\n", path, format, file_weight);
-			fflush(dfp);
-			}
-		} /* end if (format > 0) */
-
-		/* if format == 0 then input is lon,lat,values triples file */
-		else if (format == 0 && path[0] != '#')
-		{
-		/* open data file */
-		if ((rfp = fopen(path,"r")) == NULL)
-			{
-			error = MB_ERROR_OPEN_FAIL;
-			fprintf(outfp,"\nUnable to open lon,lat,value triples data path: %s\n",
-				path);
-			fprintf(outfp,"\nProgram <%s> Terminated\n",
-				program_name);
-			mb_memory_clear(verbose, &error);
-			exit(error);
-			}
-
-		/* loop over reading */
-		while (fscanf(rfp,"%lf %lf %lf",&tlon,&tlat,&tvalue) != EOF)
-			{
-			  /* reproject data positions if necessary */
-			  if (use_projection == MB_YES)
-				mb_proj_forward(verbose, pjptr,
-						tlon, tlat,
-						&tlon, &tlat,
-						&error);
-
-			  /* get position in grid */
-			  ix = (tlon - wbnd[0] + 0.5*dx)/dx;
-			  iy = (tlat - wbnd[2] + 0.5*dy)/dy;
-			  if (ix >= 0 && ix < gxdim
-			    && iy >= 0 && iy < gydim)
-			    {
-			    /* check if overwriting */
-			    kgrid = ix*gydim + iy;
-			    if (check_time == MB_NO)
-			      time_ok = MB_YES;
-			    else
-			      {
-			      if (firsttime[kgrid] > 0.0)
-				time_ok = MB_NO;
-			      else
-				time_ok = MB_YES;
-			      }
-
-			    /* make sure there is space for the data */
-			    if (time_ok == MB_YES
-			      && cnt[kgrid] >= num[kgrid])
-			      {
-			      num[kgrid] += REALLOC_STEP_SIZE;
-			      if ((data[kgrid] = (double *)
-				    realloc(data[kgrid], num[kgrid]*sizeof(double)))
-				    == NULL)
-				    {
-				    error = MB_ERROR_MEMORY_FAIL;
-				    mb_error(verbose,error,&message);
-				    fprintf(outfp,"\nMBIO Error allocating data arrays:\n%s\n",
-					message);
-				    fprintf(outfp,"The weighted mean algorithm uses much less\n");
-				    fprintf(outfp,"memory than the median filter algorithm.\n");
-				    fprintf(outfp,"You could also try using ping averaging to\n");
-				    fprintf(outfp,"reduce the number of data points to be gridded.\n");
-				    fprintf(outfp,"\nProgram <%s> Terminated\n",
-					program_name);
-				    mb_memory_clear(verbose, &error);
-				    exit(error);
-				    }
-			      }
-
-			    /* process it */
-			    if (time_ok == MB_YES)
-			      {
-			      value = data[kgrid];
-			      value[cnt[kgrid]] = topofactor*tvalue;
-			      cnt[kgrid]++;
-			      ndata++;
-			      ndatafile++;
-			      }
-			    }
-			}
-		fclose(rfp);
-		status = MB_SUCCESS;
-		error = MB_ERROR_NO_ERROR;
-		if (verbose >= 2)
-			fprintf(outfp,"\n");
-		if (verbose > 0)
-			fprintf(outfp,"%d data points processed in %s\n",
-				ndatafile,file);
-
-		/* add to datalist if data actually contributed */
-		if (ndatafile > 0 && dfp != NULL)
-			{
-			if (pstatus == MB_PROCESSED_USE)
-				fprintf(dfp, "P:");
-			else
-				fprintf(dfp, "R:");
-			fprintf(dfp, "%s %d %f\n", path, format, file_weight);
-			fflush(dfp);
-			}
-		} /* end if (format == 0) */
-
-		}
-	if (datalist != NULL)
-		mb_datalist_close(verbose,&datalist,&error);
-	if (verbose > 0)
-		fprintf(outfp,"\n%d total data points processed\n",ndata);
-
-	/* close datalist if necessary */
-	if (dfp != NULL)
-		{
-		fclose(dfp);
-		dfp = NULL;
-		}
-
-	/* now loop over all points in the output grid */
-	if (verbose >= 1)
-		fprintf(outfp,"\nMaking raw grid...\n");
-	nbinset = 0;
-	nbinzero = 0;
-	nbinspline = 0;
-	nbinbackground = 0;
-	for (i=0;i<gxdim;i++)
-		for (j=0;j<gydim;j++)
-			{
-			kgrid = i * gydim + j;
-			if (cnt[kgrid] > 0)
-				{
-				value = data[kgrid];
-				qsort((char *)value,cnt[kgrid],sizeof(double),
-					(void *)mb_double_compare);
-				if (grid_mode == MBGRID_MEDIAN_FILTER)
-					{
-					grid[kgrid] = value[cnt[kgrid]/2];
-					}
-				else if (grid_mode == MBGRID_MINIMUM_FILTER)
-					{
-					grid[kgrid] = value[0];
-					}
-				else if (grid_mode == MBGRID_MAXIMUM_FILTER)
-					{
-					grid[kgrid] = value[cnt[kgrid]-1];
-					}
-				sigma[kgrid] = 0.0;
-				for (k=0;k<cnt[kgrid];k++)
-					sigma[kgrid] +=
-						(value[k] - grid[kgrid])
-						*(value[k] - grid[kgrid]);
-				if (cnt[kgrid] > 1)
-					sigma[kgrid] = sqrt(sigma[kgrid]
-						/(cnt[kgrid]-1));
-				else
-					sigma[kgrid] = 0.0;
-				nbinset++;
-				}
-			else
-				grid[kgrid] = clipvalue;
-/*			fprintf(outfp,"%d %d %d  %f %f %d %f %f\n",
-				i,j,kgrid,
-				wbnd[0] + i*dx, wbnd[2] + j*dy,
-				cnt[kgrid],grid[kgrid],sigma[kgrid]);*/
-			}
-
-	/* now deallocate space for the data */
-	for (i=0;i<gxdim;i++)
-		for (j=0;j<gydim;j++)
-			{
-			kgrid = i * gydim + j;
-			if (cnt[kgrid] > 0)
-				free(data[kgrid]);
-			}
-
-	/***** end of median filter gridding *****/
-	}
-
-	/* if clip set do smooth interpolation */
-	if (clipmode != MBGRID_INTERP_NONE && clip > 0 && nbinset > 0)
-		{
-		/* set up data vector */
-		if (setborder == MB_YES)
-			ndata = 2*gxdim + 2*gydim - 2;
-                else
-                        ndata = 8;
-		for (i=0;i<gxdim;i++)
-			for (j=0;j<gydim;j++)
-				{
-				kgrid = i * gydim + j;
-				if (grid[kgrid] < clipvalue) ndata++;
-				}
-
-#ifdef USESURFACE
-		/* allocate and initialize sgrid */
-		status = mb_mallocd(verbose,__FILE__,__LINE__,ndata*sizeof(float),(void **)&sxdata,&error);
-		if (status == MB_SUCCESS)
-			status = mb_mallocd(verbose,__FILE__,__LINE__,ndata*sizeof(float),(void **)&sydata,&error);
-		if (status == MB_SUCCESS)
-			status = mb_mallocd(verbose,__FILE__,__LINE__,ndata*sizeof(float),(void **)&szdata,&error);
-		if (status == MB_SUCCESS)
-			status = mb_mallocd(verbose,__FILE__,__LINE__,gxdim*gydim*sizeof(float),(void **)&sgrid,&error);
-		if (error != MB_ERROR_NO_ERROR)
-			{
-			mb_error(verbose,MB_ERROR_MEMORY_FAIL,&message);
-			fprintf(outfp,"\nMBIO Error allocating interpolation work arrays:\n%s\n",
-				message);
-			fprintf(outfp,"\nProgram <%s> Terminated\n",
-				program_name);
-			mb_memory_clear(verbose, &error);
-			exit(error);
-			}
-		memset((char *)sgrid,0,gxdim*gydim*sizeof(float));
-		memset((char *)sxdata,0,ndata*sizeof(float));
-		memset((char *)sydata,0,ndata*sizeof(float));
-		memset((char *)szdata,0,ndata*sizeof(float));
-
-		/* get points from grid */
-                /* simultaneously find the depth values nearest to the grid corners and edge midpoints */
-                ndata = 0;
-		for (i=0;i<gxdim;i++)
-			for (j=0;j<gydim;j++)
-				{
-				kgrid = i * gydim + j;
-				if (grid[kgrid] < clipvalue)
-					{
-					sxdata[ndata] = (float)(wbnd[0] + dx*i - bdata_origin_x);
-					sydata[ndata] = (float)(wbnd[2] + dy*j - bdata_origin_y);
-					szdata[ndata] = (float)grid[kgrid];
-					ndata++;
-					}
-				}
-
-		/* if desired set border */
-		if (setborder == MB_YES)
-			{
-			for (i=0;i<gxdim;i++)
-				{
-				j = 0;
-				kgrid = i * gydim + j;
-				if (grid[kgrid] >= clipvalue)
-					{
-					sxdata[ndata] = (float)(wbnd[0] + dx*i - bdata_origin_x);
-					sydata[ndata] = (float)(wbnd[2] + dy*j - bdata_origin_y);
-					szdata[ndata] = (float)border;
-					ndata++;
-					}
-				j = gydim - 1;
-				kgrid = i * gydim + j;
-				if (grid[kgrid] >= clipvalue)
-					{
-					sxdata[ndata] = (float)(wbnd[0] + dx*i - bdata_origin_x);
-					sydata[ndata] = (float)(wbnd[2] + dy*j - bdata_origin_y);
-					szdata[ndata] = (float)border;
-					ndata++;
-					}
-				}
-			for (j=1;j<gydim-1;j++)
-				{
-				i = 0;
-				kgrid = i * gydim + j;
-				if (grid[kgrid] >= clipvalue)
-					{
-					sxdata[ndata] = (float)(wbnd[0] + dx*i - bdata_origin_x);
-					sydata[ndata] = (float)(wbnd[2] + dy*j - bdata_origin_y);
-					szdata[ndata] = (float)border;
-					ndata++;
-					}
-				i = gxdim - 1;
-				kgrid = i * gydim + j;
-				if (grid[kgrid] >= clipvalue)
-					{
-					sxdata[ndata] = (float)(wbnd[0] + dx*i - bdata_origin_x);
-					sydata[ndata] = (float)(wbnd[2] + dy*j - bdata_origin_y);
-					szdata[ndata] = (float)border;
-					ndata++;
-					}
-				}
-			}
-
-		/* do the interpolation */
-		fprintf(outfp,"\nDoing Surface spline interpolation with %d data points...\n",ndata);
-		mb_surface(verbose, ndata, sxdata, sydata, szdata,
-			(float)(gbnd[0] - bdata_origin_x), (float)(gbnd[1] - bdata_origin_x),
-                        (float)(gbnd[2] - bdata_origin_y), (float)(gbnd[3] - bdata_origin_y),
-                        dx, dy,
-			tension, sgrid);
-#else
-		/* allocate and initialize sgrid */
-		status = mb_mallocd(verbose,__FILE__,__LINE__,3*ndata*sizeof(float),(void **)&sdata,&error);
-		if (status == MB_SUCCESS)
-			status = mb_mallocd(verbose,__FILE__,__LINE__,gxdim*gydim*sizeof(float),(void **)&sgrid,&error);
-		if (status == MB_SUCCESS)
-			status = mb_mallocd(verbose,__FILE__,__LINE__,ndata*sizeof(float),(void **)&work1,&error);
-		if (status == MB_SUCCESS)
-			status = mb_mallocd(verbose,__FILE__,__LINE__,ndata*sizeof(int),(void **)&work2,&error);
-		if (status == MB_SUCCESS)
-			status = mb_mallocd(verbose,__FILE__,__LINE__,(gxdim+gydim)*sizeof(int),(void **)&work3,&error);
-		if (error != MB_ERROR_NO_ERROR)
-			{
-			mb_error(verbose,MB_ERROR_MEMORY_FAIL,&message);
-			fprintf(outfp,"\nMBIO Error allocating interpolation work arrays:\n%s\n",
-				message);
-			fprintf(outfp,"\nProgram <%s> Terminated\n",
-				program_name);
-			mb_memory_clear(verbose, &error);
-			exit(error);
-			}
-		memset((char *)sgrid,0,gxdim*gydim*sizeof(float));
-		memset((char *)sdata,0,3*ndata*sizeof(float));
-		memset((char *)work1,0,ndata*sizeof(float));
-		memset((char *)work2,0,ndata*sizeof(int));
-		memset((char *)work3,0,(gxdim+gydim)*sizeof(int));
-
-		/* get points from grid */
-                /* simultaneously find the depth values nearest to the grid corners and edge midpoints */
-                ndata = 0;
- 		for (i=0;i<gxdim;i++)
-			for (j=0;j<gydim;j++)
-				{
-				kgrid = i * gydim + j;
-				if (grid[kgrid] < clipvalue)
-					{
-					sdata[ndata++] = (float)(wbnd[0] + dx*i - bdata_origin_x);
-					sdata[ndata++] = (float)(wbnd[2] + dy*j - bdata_origin_y);
-					sdata[ndata++] = (float)grid[kgrid];
-					}
-				}
-
-		/* if desired set border */
-		if (setborder == MB_YES)
-			{
-			for (i=0;i<gxdim;i++)
-				{
-				j = 0;
-				kgrid = i * gydim + j;
-				if (grid[kgrid] >= clipvalue)
-					{
-					sdata[ndata++] = (float)(wbnd[0] + dx*i - bdata_origin_x);
-					sdata[ndata++] = (float)(wbnd[2] + dy*j - bdata_origin_y);
-					sdata[ndata++] = (float)border;
-					}
-				j = gydim - 1;
-				kgrid = i * gydim + j;
-				if (grid[kgrid] >= clipvalue)
-					{
-					sdata[ndata++] = (float)(wbnd[0] + dx*i - bdata_origin_x);
-					sdata[ndata++] = (float)(wbnd[2] + dy*j - bdata_origin_y);
-					sdata[ndata++] = (float)border;
-					}
-				}
-			for (j=1;j<gydim-1;j++)
-				{
-				i = 0;
-				kgrid = i * gydim + j;
-				if (grid[kgrid] >= clipvalue)
-					{
-					sdata[ndata++] = (float)(wbnd[0] + dx*i - bdata_origin_x);
-					sdata[ndata++] = (float)(wbnd[2] + dy*j - bdata_origin_y);
-					sdata[ndata++] = (float)border;
-					}
-				i = gxdim - 1;
-				kgrid = i * gydim + j;
-				if (grid[kgrid] >= clipvalue)
-					{
-					sdata[ndata++] = (float)(wbnd[0] + dx*i - bdata_origin_x);
-					sdata[ndata++] = (float)(wbnd[2] + dy*j - bdata_origin_y);
-					sdata[ndata++] = (float)border;
-					}
-				}
-			}
-                ndata = ndata/3;
-
-		/* do the interpolation */
-		cay = (float)tension;
-		xmin = (float)(wbnd[0] - 0.5 * dx - bdata_origin_x);
-		ymin = (float)(wbnd[2] - 0.5 * dy - bdata_origin_y);
-		ddx = (float)dx;
-		ddy = (float)dy;
-		fprintf(outfp,"\nDoing Zgrid spline interpolation with %d data points...\n",ndata);
-/*for (i=0;i<ndata/3;i++)
-{
-if (sdata[3*i+2]>2000.0)
-fprintf(stderr,"%d %f\n",i,sdata[3*i+2]);
-}*/
-		if (clipmode == MBGRID_INTERP_ALL)
-			clip = MAX(gxdim,gydim);
-		mb_zgrid(sgrid,&gxdim,&gydim,&xmin,&ymin,
-			&ddx,&ddy,sdata,&ndata,
-			work1,work2,work3,&cay,&clip);
-#endif
-
-		if (clipmode == MBGRID_INTERP_GAP)
-		    fprintf(outfp,"Applying spline interpolation to fill gaps of %d cells or less...\n",clip);
-		else if (clipmode == MBGRID_INTERP_NEAR)
-		    fprintf(outfp,"Applying spline interpolation to fill %d cells from data...\n",clip);
-		else if (clipmode == MBGRID_INTERP_ALL)
-		    fprintf(outfp,"Applying spline interpolation to fill all undefined cells in the grid...\n");
-
-		/* translate the interpolation into the grid array
-		    filling only data gaps */
-		zflag = 5.0e34;
-		if (clipmode == MBGRID_INTERP_GAP)
-			{
-			for (i=0;i<gxdim;i++)
-			    for (j=0;j<gydim;j++)
-				{
-				kgrid = i * gydim + j;
-#ifdef USESURFACE
-				kint = i + (gydim -j - 1) * gxdim;
-#else
-				kint = i + j*gxdim;
-#endif
-				num[kgrid] = MB_NO;
-				if (grid[kgrid] >= clipvalue
-				    && sgrid[kint] < zflag)
-				    {
-				    /* initialize direction mask of search */
-				    for (ii=0;ii<9;ii++)
-					dmask[ii] = MB_NO;
-
-				    /* loop over rings around point, starting close */
-				    for (ir=0; ir <= clip && num[kgrid] == MB_NO; ir++)
-				      {
-				      /* set bounds of search */
-				      i1 = MAX(0, i - ir);
-				      i2 = MIN(gxdim - 1, i + ir);
-				      j1 = MAX(0, j - ir);
-				      j2 = MIN(gydim - 1, j + ir);
-
-				      jj = j1;
-				      for (ii=i1;ii<=i2 && num[kgrid] == MB_NO;ii++)
-				        {
-					if (grid[ii*gydim+jj] < clipvalue)
-					    {
-					    r = sqrt((double)((ii-i)*(ii-i) + (jj-j)*(jj-j)));
-					    iii = rint((ii - i)/r) + 1;
-					    jjj = rint((jj - j)/r) + 1;
-					    kkk = iii * 3 + jjj;
-					    dmask[kkk] = MB_YES;
-					    if ((dmask[0] && dmask[8])
-						|| (dmask[3] && dmask[5])
-						|| (dmask[6] && dmask[2])
-						|| (dmask[1] && dmask[7]))
-						num[kgrid] = MB_YES;
-					    }
-					}
-
-				      jj = j2;
-				      for (ii=i1;ii<=i2 && num[kgrid] == MB_NO;ii++)
-				        {
-					if (grid[ii*gydim+jj] < clipvalue)
-					    {
-					    r = sqrt((double)((ii-i)*(ii-i) + (jj-j)*(jj-j)));
-					    iii = rint((ii - i)/r) + 1;
-					    jjj = rint((jj - j)/r) + 1;
-					    kkk = iii * 3 + jjj;
-					    dmask[kkk] = MB_YES;
-					    if ((dmask[0] && dmask[8])
-						|| (dmask[3] && dmask[5])
-						|| (dmask[6] && dmask[2])
-						|| (dmask[1] && dmask[7]))
-						num[kgrid] = MB_YES;
-					    }
-					}
-
-				      ii = i1;
-				      for (jj=j1;jj<=j2 && num[kgrid] == MB_NO;jj++)
-				        {
-					if (grid[ii*gydim+jj] < clipvalue)
-					    {
-					    r = sqrt((double)((ii-i)*(ii-i) + (jj-j)*(jj-j)));
-					    iii = rint((ii - i)/r) + 1;
-					    jjj = rint((jj - j)/r) + 1;
-					    kkk = iii * 3 + jjj;
-					    dmask[kkk] = MB_YES;
-					    if ((dmask[0] && dmask[8])
-						|| (dmask[3] && dmask[5])
-						|| (dmask[6] && dmask[2])
-						|| (dmask[1] && dmask[7]))
-						num[kgrid] = MB_YES;
-					    }
-					}
-
-				      ii = i2;
-				      for (jj=j1;jj<=j2 && num[kgrid] == MB_NO;jj++)
-				        {
-					if (grid[ii*gydim+jj] < clipvalue)
-					    {
-					    r = sqrt((double)((ii-i)*(ii-i) + (jj-j)*(jj-j)));
-					    iii = rint((ii - i)/r) + 1;
-					    jjj = rint((jj - j)/r) + 1;
-					    kkk = iii * 3 + jjj;
-					    dmask[kkk] = MB_YES;
-					    if ((dmask[0] && dmask[8])
-						|| (dmask[3] && dmask[5])
-						|| (dmask[6] && dmask[2])
-						|| (dmask[1] && dmask[7]))
-						num[kgrid] = MB_YES;
-					    }
-					}
-				      }
-				    }
-				}
-			for (i=0;i<gxdim;i++)
-			    for (j=0;j<gydim;j++)
-				{
-				kgrid = i * gydim + j;
-#ifdef USESURFACE
-				kint = i + (gydim -j - 1) * gxdim;
-#else
-				kint = i + j*gxdim;
-#endif
-				if (num[kgrid] == MB_YES)
-					{
-					grid[kgrid] = sgrid[kint];
-					nbinspline++;
-					}
-				}
-			}
-
-		/* translate the interpolation into the grid array
-		    filling by proximity */
-		else if (clipmode == MBGRID_INTERP_NEAR)
-			{
-			for (i=0;i<gxdim;i++)
-			    for (j=0;j<gydim;j++)
-				{
-				kgrid = i * gydim + j;
-#ifdef USESURFACE
-				kint = i + (gydim -j - 1) * gxdim;
-#else
-				kint = i + j*gxdim;
-#endif
-
-				num[kgrid] = MB_NO;
-				if (grid[kgrid] >= clipvalue
-				    && sgrid[kint] < zflag)
-				    {
-				    /* loop over rings around point, starting close */
-				    for (ir=0; ir <= clip && num[kgrid] == MB_NO; ir++)
-				      {
-				      /* set bounds of search */
-				      i1 = MAX(0, i - ir);
-				      i2 = MIN(gxdim - 1, i + ir);
-				      j1 = MAX(0, j - ir);
-				      j2 = MIN(gydim - 1, j + ir);
-
-				      jj = j1;
-				      for (ii=i1;ii<=i2 && num[kgrid] == MB_NO;ii++)
-				        {
-					if (grid[ii*gydim+jj] < clipvalue)
-					    {
-					    num[kgrid] = MB_YES;
-					    }
-					}
-
-				      jj = j2;
-				      for (ii=i1;ii<=i2 && num[kgrid] == MB_NO;ii++)
-				        {
-					if (grid[ii*gydim+jj] < clipvalue)
-					    {
-					    num[kgrid] = MB_YES;
-					    }
-					}
-
-				      ii = i1;
-				      for (jj=j1;jj<=j2 && num[kgrid] == MB_NO;jj++)
-				        {
-					if (grid[ii*gydim+jj] < clipvalue)
-					    {
-					    num[kgrid] = MB_YES;
-					    }
-					}
-
-				      ii = i2;
-				      for (jj=j1;jj<=j2 && num[kgrid] == MB_NO;jj++)
-				        {
-					if (grid[ii*gydim+jj] < clipvalue)
-					    {
-					    num[kgrid] = MB_YES;
-					    }
-					}
-				      }
-				    }
-				}
-			for (i=0;i<gxdim;i++)
-			    for (j=0;j<gydim;j++)
-				{
-				kgrid = i * gydim + j;
-#ifdef USESURFACE
-				kint = i + (gydim -j - 1) * gxdim;
-#else
-				kint = i + j*gxdim;
-#endif
-				if (num[kgrid] == MB_YES)
-					{
-					grid[kgrid] = sgrid[kint];
-					nbinspline++;
-					}
-				}
-			}
-
-		/* translate the interpolation into the grid array
-		    filling all empty bins */
-		else
-			{
-			for (i=0;i<gxdim;i++)
-			    for (j=0;j<gydim;j++)
-				{
-				kgrid = i * gydim + j;
-#ifdef USESURFACE
-				kint = i + (gydim -j - 1) * gxdim;
-#else
-				kint = i + j*gxdim;
-#endif
-				if (grid[kgrid] >= clipvalue
-				    && sgrid[kint] < zflag)
-					{
-					grid[kgrid] = sgrid[kint];
-					nbinspline++;
-					}
-				}
-			}
-
-		/* deallocate the interpolation arrays */
-#ifdef USESURFACE
-		mb_freed(verbose,__FILE__,__LINE__,(void **)&sxdata,&error);
-		mb_freed(verbose,__FILE__,__LINE__,(void **)&sydata,&error);
-		mb_freed(verbose,__FILE__,__LINE__,(void **)&szdata,&error);
-#else
-		mb_freed(verbose,__FILE__,__LINE__,(void **)&sdata,&error);
-		mb_freed(verbose,__FILE__,__LINE__,(void **)&work1,&error);
-		mb_freed(verbose,__FILE__,__LINE__,(void **)&work2,&error);
-		mb_freed(verbose,__FILE__,__LINE__,(void **)&work3,&error);
-#endif
-		mb_freed(verbose,__FILE__,__LINE__,(void **)&sgrid,&error);
-		}
-
-	/* if grdrasterid set and background data previously read in
-		then interpolate it onto internal grid */
-	if (grdrasterid != 0 && nbackground > 0)
-		{
-
-		/* allocate and initialize grid and work arrays */
-#ifdef USESURFACE
-		status = mb_mallocd(verbose,__FILE__,__LINE__,gxdim*gydim*sizeof(float),(void **)&sgrid,&error);
-		if (error != MB_ERROR_NO_ERROR)
-			{
-			mb_error(verbose,MB_ERROR_MEMORY_FAIL,&message);
-			fprintf(outfp,"\nMBIO Error allocating background data array:\n%s\n",
-				message);
-			fprintf(outfp,"\nProgram <%s> Terminated\n",
-				program_name);
-			mb_memory_clear(verbose, &error);
-			exit(error);
-			}
-		memset((char *)sgrid,0,gxdim*gydim*sizeof(float));
-#else
-		status = mb_mallocd(verbose,__FILE__,__LINE__,gxdim*gydim*sizeof(float),(void **)&sgrid,&error);
-		if (status == MB_SUCCESS)
-			status = mb_mallocd(verbose,__FILE__,__LINE__,nbackground*sizeof(float),(void **)&work1,&error);
-		if (status == MB_SUCCESS)
-			status = mb_mallocd(verbose,__FILE__,__LINE__,nbackground*sizeof(int),(void **)&work2,&error);
-		if (status == MB_SUCCESS)
-			status = mb_mallocd(verbose,__FILE__,__LINE__,(gxdim+gydim)*sizeof(int),(void **)&work3,&error);
-		if (error != MB_ERROR_NO_ERROR)
-			{
-			mb_error(verbose,MB_ERROR_MEMORY_FAIL,&message);
-			fprintf(outfp,"\nMBIO Error allocating background interpolation work arrays:\n%s\n",
-				message);
-			fprintf(outfp,"\nProgram <%s> Terminated\n",
-				program_name);
-			mb_memory_clear(verbose, &error);
-			exit(error);
-			}
-		memset((char *)sgrid,0,gxdim*gydim*sizeof(float));
-		memset((char *)work1,0,nbackground*sizeof(float));
-		memset((char *)work2,0,nbackground*sizeof(int));
-		memset((char *)work3,0,(gxdim+gydim)*sizeof(int));
-#endif
-
-		/* do the interpolation */
-		fprintf(outfp,"\nDoing spline interpolation with %d data points from background...\n",nbackground);
-#ifdef USESURFACE
-		mb_surface(verbose, nbackground, bxdata, bydata, bzdata,
-			(float)(wbnd[0] - bdata_origin_x), (float)(wbnd[1] - bdata_origin_x),
-                        (float)(wbnd[2] - bdata_origin_y), (float)(wbnd[3] - bdata_origin_y),
-                        dx, dy,
-			tension, sgrid);
-#else
-		cay = (float)tension;
-		xmin = (float)(wbnd[0] - 0.5 * dx - bdata_origin_x);
-		ymin = (float)(wbnd[2] - 0.5 * dy - bdata_origin_y);
-		ddx = (float)dx;
-		ddy = (float)dy;
-		clip = MAX(gxdim,gydim);
-		fprintf(outfp,"\nDoing Zgrid spline interpolation with %d background points...\n",nbackground);
-		mb_zgrid2(sgrid,&gxdim,&gydim,&xmin,&ymin,
-			&ddx,&ddy,bdata,&nbackground,
-			work1,work2,work3,&cay,&clip);
-#endif
-
-		/* translate the interpolation into the grid array
-		    - interpolate only to fill a data gap */
-		zflag = 5.0e34;
-		for (i=0;i<gxdim;i++)
-		    for (j=0;j<gydim;j++)
-			{
-			kgrid = i * gydim + j;
-#ifdef USESURFACE
-			kint = i + (gydim -j - 1) * gxdim;
-#else
-			kint = i + j*gxdim;
-#endif
-			if (grid[kgrid] >= clipvalue
-			    && sgrid[kint] < zflag)
-				{
-				grid[kgrid] = sgrid[kint];
-				nbinbackground++;
-				}
-			}
-#ifdef USESURFACE
-		mb_freed(verbose,__FILE__,__LINE__,(void **)&bxdata,&error);
-		mb_freed(verbose,__FILE__,__LINE__,(void **)&bydata,&error);
-		mb_freed(verbose,__FILE__,__LINE__,(void **)&bzdata,&error);
-#else
-		mb_freed(verbose,__FILE__,__LINE__,(void **)&bdata,&error);
-		mb_freed(verbose,__FILE__,__LINE__,(void **)&work1,&error);
-		mb_freed(verbose,__FILE__,__LINE__,(void **)&work2,&error);
-		mb_freed(verbose,__FILE__,__LINE__,(void **)&work3,&error);
-#endif
-		mb_freed(verbose,__FILE__,__LINE__,(void **)&sgrid,&error);
-		}
-
-	/* get min max of data */
-	zclip = clipvalue;
-	zmin = zclip;
-	zmax = zclip;
-	for (i=0;i<gxdim;i++)
-		for (j=0;j<gydim;j++)
-			{
-			kgrid = i * gydim + j;
-			if (zmin == zclip
-				&& grid[kgrid] < zclip)
-				zmin = grid[kgrid];
-			if (zmax == zclip
-				&& grid[kgrid] < zclip)
-				zmax = grid[kgrid];
-			if (grid[kgrid] < zmin && grid[kgrid] < zclip)
-				zmin = grid[kgrid];
-			if (grid[kgrid] > zmax && grid[kgrid] < zclip)
-				zmax = grid[kgrid];
-			}
-	if (zmin == zclip)
-		zmin = 0.0;
-	if (zmax == zclip)
-		zmax = 0.0;
-
-	/* get min max of data distribution */
-	nmax = 0;
-	for (i=0;i<gxdim;i++)
-		for (j=0;j<gydim;j++)
-			{
-			kgrid = i * gydim + j;
-			if (cnt[kgrid] > nmax)
-				nmax = cnt[kgrid];
-			}
-
-	/* get min max of standard deviation */
-	smin = 0.0;
-	smax = 0.0;
-	for (i=0;i<gxdim;i++)
-		for (j=0;j<gydim;j++)
-			{
-			kgrid = i * gydim + j;
-			if (smin == 0.0
-				&& cnt[kgrid] > 0)
-				smin = sigma[kgrid];
-			if (smax == 0.0
-				&& cnt[kgrid] > 0)
-				smax = sigma[kgrid];
-			if (sigma[kgrid] < smin && cnt[kgrid] > 0)
-				smin = sigma[kgrid];
-			if (sigma[kgrid] > smax && cnt[kgrid] > 0)
-				smax = sigma[kgrid];
-			}
-	nbinzero = gxdim*gydim - nbinset - nbinspline - nbinbackground;
-	fprintf(outfp,"\nTotal number of bins:            %d\n",gxdim*gydim);
-	fprintf(outfp,"Bins set using data:             %d\n",nbinset);
-	fprintf(outfp,"Bins set using interpolation:    %d\n",nbinspline);
-	fprintf(outfp,"Bins set using background:       %d\n",nbinbackground);
-	fprintf(outfp,"Bins not set:                    %d\n",nbinzero);
-	fprintf(outfp,"Maximum number of data in a bin: %d\n",nmax);
-	fprintf(outfp,"Minimum value: %10.2f   Maximum value: %10.2f\n",
-		zmin,zmax);
-	fprintf(outfp,"Minimum sigma: %10.5f   Maximum sigma: %10.5f\n",
-		smin,smax);
-
-	/* write first output file */
-	if (verbose > 0)
-		fprintf(outfp,"\nOutputting results...\n");
-	for (i=0;i<xdim;i++)
-		for (j=0;j<ydim;j++)
-			{
-			kgrid = (i + offx)*gydim + (j + offy);
-			kout = i*ydim + j;
-			output[kout] = (float) grid[kgrid];
-			if (gridkind != MBGRID_ASCII
-				&& gridkind != MBGRID_ARCASCII
-				&& grid[kgrid] >= clipvalue)
-				{
-				output[kout] = outclipvalue;
-				}
-			}
-	if (gridkind == MBGRID_ASCII)
-		{
-		strcpy(ofile,fileroot);
-		strcat(ofile,".asc");
-		status = write_ascii(verbose,ofile,output,xdim,ydim,
-			gbnd[0],gbnd[1],gbnd[2],gbnd[3],
-			dx,dy,&error);
-		}
-	else if (gridkind == MBGRID_ARCASCII)
-		{
-		strcpy(ofile,fileroot);
-		strcat(ofile,".asc");
-		status = write_arcascii(verbose,ofile,output,xdim,ydim,
-			gbnd[0],gbnd[1],gbnd[2],gbnd[3],
-			dx,dy,outclipvalue,&error);
-		}
-	else if (gridkind == MBGRID_OLDGRD)
-		{
-		strcpy(ofile,fileroot);
-		strcat(ofile,".grd1");
-		status = write_oldgrd(verbose,ofile,output,xdim,ydim,
-			gbnd[0],gbnd[1],gbnd[2],gbnd[3],dx,dy,&error);
-		}
-	else if (gridkind == MBGRID_CDFGRD)
-		{
-		strcpy(ofile,fileroot);
-		strcat(ofile,".grd");
-		status = mb_write_gmt_grd(verbose,
-                                        ofile,
-                                        output,
-                                        outclipvalue,
-                                        xdim,ydim,
-                                        gbnd[0],gbnd[1],gbnd[2],gbnd[3],
-                                        zmin,zmax,
-                                        dx,dy,
-                                        xlabel,ylabel,zlabel,title,
-                                        projection_id,
-                                        argc,argv,
-                                        &error);
-		}
-	else if (gridkind == MBGRID_GMTGRD)
-		{
-		strcpy(ofile,fileroot);
-		strcat(ofile,".grd");
-		sprintf(ofile,"%s.grd%s", fileroot, gridkindstring);
-		status = mb_write_gmt_grd(verbose,
-                                        ofile,
-                                        output,
-                                        outclipvalue,
-                                        xdim,ydim,
-                                        gbnd[0],gbnd[1],gbnd[2],gbnd[3],
-                                        zmin,zmax,
-                                        dx,dy,
-                                        xlabel,ylabel,zlabel,title,
-                                        projection_id,
-                                        argc,argv,
-                                        &error);
-		}
-	if (status != MB_SUCCESS)
-		{
-		mb_error(verbose,error,&message);
-		fprintf(outfp,"\nError writing output file: %s\n%s\n",
-			ofile,message);
-		fprintf(outfp,"\nProgram <%s> Terminated\n",
-			program_name);
-		mb_memory_clear(verbose, &error);
-		exit(error);
-		}
-
-	/* write second output file */
-	if (more == MB_YES)
-		{
-		for (i=0;i<xdim;i++)
-			for (j=0;j<ydim;j++)
-				{
-				kgrid = (i + offx)*gydim + (j + offy);
-				kout = i*ydim + j;
-				output[kout] = (float) cnt[kgrid];
-				if (output[kout] < 0.0)
-					output[kout] = 0.0;
-				if (gridkind != MBGRID_ASCII
-					&& gridkind != MBGRID_ARCASCII
-					&& cnt[kgrid] <= 0)
-					output[kout] = outclipvalue;
-				}
-		if (gridkind == MBGRID_ASCII)
-			{
-			strcpy(ofile,fileroot);
-			strcat(ofile,"_num.asc");
-			status = write_ascii(verbose,ofile,output,xdim,ydim,
-				gbnd[0],gbnd[1],gbnd[2],gbnd[3],
-				dx,dy,&error);
-			}
-		else if (gridkind == MBGRID_ARCASCII)
-			{
-			strcpy(ofile,fileroot);
-			strcat(ofile,"_num.asc");
-			status = write_arcascii(verbose,ofile,output,xdim,ydim,
-				gbnd[0],gbnd[1],gbnd[2],gbnd[3],
-				dx,dy,outclipvalue,&error);
-			}
-		else if (gridkind == MBGRID_OLDGRD)
-			{
-			strcpy(ofile,fileroot);
-			strcat(ofile,"_num.grd1");
-			status = write_oldgrd(verbose,ofile,output,xdim,ydim,
-				gbnd[0],gbnd[1],gbnd[2],gbnd[3],
-				dx,dy,&error);
-			}
-		else if (gridkind == MBGRID_CDFGRD)
-			{
-			strcpy(ofile,fileroot);
-			strcat(ofile,"_num.grd");
-                        status = mb_write_gmt_grd(verbose,
-                                        ofile,
-                                        output,
-                                        outclipvalue,
-                                        xdim,ydim,
-                                        gbnd[0],gbnd[1],gbnd[2],gbnd[3],
-                                        zmin,zmax,
-                                        dx,dy,
-                                        xlabel,ylabel,zlabel,title,
-                                        projection_id,
-                                        argc,argv,
-                                        &error);
-			}
-		else if (gridkind == MBGRID_GMTGRD)
-			{
-			sprintf(ofile,"%s_num.grd%s", fileroot, gridkindstring);
-                        status = mb_write_gmt_grd(verbose,
-                                        ofile,
-                                        output,
-                                        outclipvalue,
-                                        xdim,ydim,
-                                        gbnd[0],gbnd[1],gbnd[2],gbnd[3],
-                                        zmin,zmax,
-                                        dx,dy,
-                                        xlabel,ylabel,zlabel,title,
-                                        projection_id,
-                                        argc,argv,
-                                        &error);
-			}
-		if (status != MB_SUCCESS)
-			{
-			mb_error(verbose,error,&message);
-			fprintf(outfp,"\nError writing output file: %s\n%s\n",
-				ofile,message);
-			fprintf(outfp,"\nProgram <%s> Terminated\n",
-				program_name);
-			mb_memory_clear(verbose, &error);
-			exit(error);
-			}
-
-		/* write third output file */
-		for (i=0;i<xdim;i++)
-			for (j=0;j<ydim;j++)
-				{
-				kgrid = (i + offx)*gydim + (j + offy);
-				kout = i*ydim + j;
-				output[kout] = (float) sigma[kgrid];
-				if (output[kout] < 0.0)
-					output[kout] = 0.0;
-				if (gridkind != MBGRID_ASCII
-					&& gridkind != MBGRID_ARCASCII
-					&& cnt[kgrid] <= 0)
-					output[kout] = outclipvalue;
-				}
-		if (gridkind == MBGRID_ASCII)
-			{
-			strcpy(ofile,fileroot);
-			strcat(ofile,"_sd.asc");
-			status = write_ascii(verbose,ofile,output,xdim,ydim,
-				gbnd[0],gbnd[1],gbnd[2],gbnd[3],
-				dx,dy,&error);
-			}
-		else if (gridkind == MBGRID_ARCASCII)
-			{
-			strcpy(ofile,fileroot);
-			strcat(ofile,"_sd.asc");
-			status = write_arcascii(verbose,ofile,output,xdim,ydim,
-				gbnd[0],gbnd[1],gbnd[2],gbnd[3],
-				dx,dy,outclipvalue,&error);
-			}
-		else if (gridkind == MBGRID_OLDGRD)
-			{
-			strcpy(ofile,fileroot);
-			strcat(ofile,"_sd.grd1");
-			status = write_oldgrd(verbose,ofile,output,xdim,ydim,
-				gbnd[0],gbnd[1],gbnd[2],gbnd[3],
-				dx,dy,&error);
-			}
-		else if (gridkind == MBGRID_CDFGRD)
-			{
-			strcpy(ofile,fileroot);
-			strcat(ofile,"_sd.grd");
-                        status = mb_write_gmt_grd(verbose,
-                                        ofile,
-                                        output,
-                                        outclipvalue,
-                                        xdim,ydim,
-                                        gbnd[0],gbnd[1],gbnd[2],gbnd[3],
-                                        zmin,zmax,
-                                        dx,dy,
-                                        xlabel,ylabel,zlabel,title,
-                                        projection_id,
-                                        argc,argv,
-                                        &error);
-			}
-		else if (gridkind == MBGRID_GMTGRD)
-			{
-			sprintf(ofile,"%s_sd.grd%s", fileroot, gridkindstring);
-                        status = mb_write_gmt_grd(verbose,
-                                        ofile,
-                                        output,
-                                        outclipvalue,
-                                        xdim,ydim,
-                                        gbnd[0],gbnd[1],gbnd[2],gbnd[3],
-                                        zmin,zmax,
-                                        dx,dy,
-                                        xlabel,ylabel,zlabel,title,
-                                        projection_id,
-                                        argc,argv,
-                                        &error);
-			}
-		if (status != MB_SUCCESS)
-			{
-			mb_error(verbose,error,&message);
-			fprintf(outfp,"\nError writing output file: %s\n%s\n",
-				ofile,message);
-			fprintf(outfp,"\nProgram <%s> Terminated\n",
-				program_name);
-			mb_memory_clear(verbose, &error);
-			exit(error);
-			}
-		}
-
-	/* deallocate arrays */
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&grid,&error);
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&norm,&error);
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&num,&error);
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&cnt,&error);
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&sigma,&error);
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&firsttime,&error);
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&output,&error);
-
-	/* deallocate projection */
-	if (use_projection == MB_YES)
-		proj_status = mb_proj_free(verbose, &(pjptr), &error);
-
-	/* run mbm_grdplot */
-	if (gridkind == MBGRID_GMTGRD)
-		{
-		/* execute mbm_grdplot */
-		strcpy(ofile,fileroot);
-		strcat(ofile,".grd");
-		if (datatype == MBGRID_DATA_BATHYMETRY)
-			{
-			sprintf(plot_cmd, "mbm_grdplot -I%s%s -G1 -C -D -V -L\"File %s - %s:%s\"",
-				ofile, gridkindstring, ofile, title, zlabel);
-			}
-		else if (datatype == MBGRID_DATA_TOPOGRAPHY)
-			{
-			sprintf(plot_cmd, "mbm_grdplot -I%s%s -G1 -C -V -L\"File %s - %s:%s\"",
-				ofile, gridkindstring, ofile, title, zlabel);
-			}
-		else if (datatype == MBGRID_DATA_AMPLITUDE)
-			{
-			sprintf(plot_cmd, "mbm_grdplot -I%s%s -G1 -W1/4 -S -D -V -L\"File %s - %s:%s\"",
-				ofile, gridkindstring, ofile, title, zlabel);
-			}
-		else
-			{
-			sprintf(plot_cmd, "mbm_grdplot -I%s%s -G1 -W1/4 -S -D -V -L\"File %s - %s:%s\"",
-				ofile, gridkindstring, ofile, title, zlabel);
-			}
-		if (verbose)
-			{
-			fprintf(outfp, "\nexecuting mbm_grdplot...\n%s\n",
-				plot_cmd);
-			}
-		plot_status = system(plot_cmd);
-		if (plot_status == -1)
-			{
-			fprintf(outfp, "\nError executing mbm_grdplot on output file %s\n", ofile);
-			}
-		}
-	if (more == MB_YES
-		&& gridkind == MBGRID_GMTGRD)
-		{
-		/* execute mbm_grdplot */
-		strcpy(ofile,fileroot);
-		strcat(ofile,"_num.grd");
-		sprintf(plot_cmd, "mbm_grdplot -I%s%s -G1 -W1/2 -V -L\"File %s - %s:%s\"",
-			ofile, gridkindstring, ofile, title, nlabel);
-		if (verbose)
-			{
-			fprintf(outfp, "\nexecuting mbm_grdplot...\n%s\n",
-				plot_cmd);
-			}
-		plot_status = system(plot_cmd);
-		if (plot_status == -1)
-			{
-			fprintf(outfp, "\nError executing mbm_grdplot on output file grd_%s\n", fileroot);
-			}
-
-		/* execute mbm_grdplot */
-		strcpy(ofile,fileroot);
-		strcat(ofile,"_sd.grd");
-		sprintf(plot_cmd, "mbm_grdplot -I%s%s -G1 -W1/2 -V -L\"File %s - %s:%s\"",
-			ofile, gridkindstring, ofile, title, sdlabel);
-		if (verbose)
-			{
-			fprintf(outfp, "\nexecuting mbm_grdplot...\n%s\n",
-				plot_cmd);
-			}
-		plot_status = system(plot_cmd);
-		if (plot_status == -1)
-			{
-			fprintf(outfp, "\nError executing mbm_grdplot on output file grd_%s\n", fileroot);
-			}
-		}
-
-	if (verbose > 0)
-		fprintf(outfp,"\nDone.\n\n");
-
-	/* check memory */
-	if (verbose >= 4)
-		status = mb_memory_list(verbose,&error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(outfp,"\ndbg2  Program <%s> completed\n",
-			program_name);
-		fprintf(outfp,"dbg2  Ending status:\n");
-		fprintf(outfp,"dbg2       status:  %d\n",status);
-		}
-
-	/* end it all */
-	exit(error);
-}
-/*--------------------------------------------------------------------*/
-/*
- * function write_ascii writes output grid to an ascii file
- */
-int write_ascii(int verbose, char *outfile, float *grid,
-		int nx, int ny,
-		double xmin, double xmax, double ymin, double ymax,
-		double dx, double dy, int *error)
-{
-	char	*function_name = "write_ascii";
-	int	status = MB_SUCCESS;
-	FILE	*fp;
-	int	i;
-	time_t	right_now;
-	char	date[32], user[MB_PATH_MAXLINE], *user_ptr, host[MB_PATH_MAXLINE];
-	char	*ctime();
-	char	*getenv();
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(outfp,"\ndbg2  Function <%s> called\n",
-			function_name);
-		fprintf(outfp,"dbg2  Input arguments:\n");
-		fprintf(outfp,"dbg2       verbose:    %d\n",verbose);
-		fprintf(outfp,"dbg2       outfile:    %s\n",outfile);
-		fprintf(outfp,"dbg2       grid:       %p\n",(void *)grid);
-		fprintf(outfp,"dbg2       nx:         %d\n",nx);
-		fprintf(outfp,"dbg2       ny:         %d\n",ny);
-		fprintf(outfp,"dbg2       xmin:       %f\n",xmin);
-		fprintf(outfp,"dbg2       xmax:       %f\n",xmax);
-		fprintf(outfp,"dbg2       ymin:       %f\n",ymin);
-		fprintf(outfp,"dbg2       ymax:       %f\n",ymax);
-		fprintf(outfp,"dbg2       dx:         %f\n",dx);
-		fprintf(outfp,"dbg2       dy:         %f\n",dy);
-		}
-
-	/* open the file */
-	if ((fp = fopen(outfile,"w")) == NULL)
-		{
-		*error = MB_ERROR_OPEN_FAIL;
-		status = MB_FAILURE;
-		}
-
-	/* output grid */
-	if (status == MB_SUCCESS)
-		{
-		fprintf(fp,"grid created by program MBGRID\n");
-		right_now = time((time_t *)0);
-		strcpy(date,ctime(&right_now));
-                date[strlen(date)-1] = '\0';
-		if ((user_ptr = getenv("USER")) == NULL)
-			user_ptr = getenv("LOGNAME");
-		if (user_ptr != NULL)
-			strcpy(user,user_ptr);
-		else
-			strcpy(user, "unknown");
-		i = gethostname(host,MB_PATH_MAXLINE);
-		fprintf(fp,"program run by %s on %s at %s\n",user,host,date);
-		fprintf(fp,"%d %d\n%f %f %f %f\n",nx,ny,xmin,xmax,ymin,ymax);
-		for (i=0;i<nx*ny;i++)
-			{
-			fprintf(fp,"%13.5g ",grid[i]);
-			if ((i+1) % 6 == 0) fprintf(fp,"\n");
-			}
-		if ((nx*ny) % 6 != 0) fprintf(fp,"\n");
-		fclose(fp);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(outfp,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(outfp,"dbg2  Return values:\n");
-		fprintf(outfp,"dbg2       error:      %d\n",*error);
-		fprintf(outfp,"dbg2  Return status:\n");
-		fprintf(outfp,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-/*
- * function write_arcascii writes output grid to an Arc/Info ascii file
- */
-int write_arcascii(int verbose, char *outfile, float *grid,
-		int nx, int ny,
-		double xmin, double xmax, double ymin, double ymax,
-		double dx, double dy, double nodata, int *error)
-{
-	char	*function_name = "write_ascii";
-	int	status = MB_SUCCESS;
-	FILE	*fp;
-	int	i, j, k;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(outfp,"\ndbg2  Function <%s> called\n",
-			function_name);
-		fprintf(outfp,"dbg2  Input arguments:\n");
-		fprintf(outfp,"dbg2       verbose:    %d\n",verbose);
-		fprintf(outfp,"dbg2       outfile:    %s\n",outfile);
-		fprintf(outfp,"dbg2       grid:       %p\n",(void *)grid);
-		fprintf(outfp,"dbg2       nx:         %d\n",nx);
-		fprintf(outfp,"dbg2       ny:         %d\n",ny);
-		fprintf(outfp,"dbg2       xmin:       %f\n",xmin);
-		fprintf(outfp,"dbg2       xmax:       %f\n",xmax);
-		fprintf(outfp,"dbg2       ymin:       %f\n",ymin);
-		fprintf(outfp,"dbg2       ymax:       %f\n",ymax);
-		fprintf(outfp,"dbg2       dx:         %f\n",dx);
-		fprintf(outfp,"dbg2       dy:         %f\n",dy);
-		fprintf(outfp,"dbg2       nodata:     %f\n",nodata);
-		}
-
-	/* open the file */
-	if ((fp = fopen(outfile,"w")) == NULL)
-		{
-		*error = MB_ERROR_OPEN_FAIL;
-		status = MB_FAILURE;
-		}
-
-	/* output grid */
-	if (status == MB_SUCCESS)
-		{
-		fprintf(fp, "ncols %d\n", nx);
-		fprintf(fp, "nrows %d\n", ny);
-		fprintf(fp, "xllcorner %.10g\n", xmin - 0.5 * dx);
-		fprintf(fp, "yllcorner %.10g\n", ymin - 0.5 * dy);
-		fprintf(fp, "cellsize %.10g\n", dx);
-		fprintf(fp, "nodata_value -99999\n");
-		for (j=0;j<ny;j++)
-		    {
-		    for (i=0;i<nx;i++)
-			{
-			k = i * ny + (ny - 1 - j);
-			if (grid[k] == nodata)
-			    fprintf(fp, "-99999 ");
-			else
-			    fprintf(fp,"%f ",grid[k]);
-			}
-		    fprintf(fp, "\n");
-		    }
-		fclose(fp);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(outfp,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(outfp,"dbg2  Return values:\n");
-		fprintf(outfp,"dbg2       error:      %d\n",*error);
-		fprintf(outfp,"dbg2  Return status:\n");
-		fprintf(outfp,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-/*
- * function write_oldgrd writes output grid to a
- * GMT version 1 binary grd file
- */
-int write_oldgrd(int verbose, char *outfile, float *grid,
-		int nx, int ny,
-		double xmin, double xmax, double ymin, double ymax,
-		double dx, double dy, int *error)
-{
-	char	*function_name = "write_oldgrd";
-	int	status = MB_SUCCESS;
-	FILE	*fp;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(outfp,"\ndbg2  Function <%s> called\n",
-			function_name);
-		fprintf(outfp,"dbg2  Input arguments:\n");
-		fprintf(outfp,"dbg2       verbose:    %d\n",verbose);
-		fprintf(outfp,"dbg2       outfile:    %s\n",outfile);
-		fprintf(outfp,"dbg2       grid:       %p\n",(void *)grid);
-		fprintf(outfp,"dbg2       nx:         %d\n",nx);
-		fprintf(outfp,"dbg2       ny:         %d\n",ny);
-		fprintf(outfp,"dbg2       xmin:       %f\n",xmin);
-		fprintf(outfp,"dbg2       xmax:       %f\n",xmax);
-		fprintf(outfp,"dbg2       ymin:       %f\n",ymin);
-		fprintf(outfp,"dbg2       ymax:       %f\n",ymax);
-		fprintf(outfp,"dbg2       dx:         %f\n",dx);
-		fprintf(outfp,"dbg2       dy:         %f\n",dy);
-		}
-
-	/* open the file */
-	if ((fp = fopen(outfile,"w")) == NULL)
-		{
-		*error = MB_ERROR_OPEN_FAIL;
-		status = MB_FAILURE;
-		}
-
-	/* output grid */
-	if (status == MB_SUCCESS)
-		{
-		fwrite ((char *)&nx, 1, 4, fp);
-		fwrite ((char *)&ny, 1, 4, fp);
-		fwrite ((char *)&xmin, 1, 8, fp);
-		fwrite ((char *)&xmax, 1, 8, fp);
-		fwrite ((char *)&ymin, 1, 8, fp);
-		fwrite ((char *)&ymax, 1, 8, fp);
-		fwrite ((char *)&dx, 1, 8, fp);
-		fwrite ((char *)&dy, 1, 8, fp);
-		fwrite ((char *)grid, nx*ny, 4, fp);
-		fclose(fp);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(outfp,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(outfp,"dbg2  Return values:\n");
-		fprintf(outfp,"dbg2       error:      %d\n",*error);
-		fprintf(outfp,"dbg2  Return status:\n");
-		fprintf(outfp,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-/*
- * function mbgrid_weight calculates the integrated weight over a bin
- * given the footprint of a sounding
- */
-int mbgrid_weight(int verbose, double foot_a, double foot_b,
-		    double pcx, double pcy, double dx, double dy,
-		    double *px, double *py,
-		    double *weight, int *use, int *error)
-{
-	char	*function_name = "mbgrid_weight";
-	int	status = MB_SUCCESS;
-	double	fa, fb;
-	double	xe, ye, ang, ratio;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(outfp,"\ndbg2  Function <%s> called\n",
-			function_name);
-		fprintf(outfp,"dbg2  Input arguments:\n");
-		fprintf(outfp,"dbg2       verbose:    %d\n",verbose);
-		fprintf(outfp,"dbg2       foot_a:     %f\n",foot_a);
-		fprintf(outfp,"dbg2       foot_b:     %f\n",foot_b);
-		fprintf(outfp,"dbg2       pcx:        %f\n",pcx);
-		fprintf(outfp,"dbg2       pcy:        %f\n",pcy);
-		fprintf(outfp,"dbg2       dx:         %f\n",dx);
-		fprintf(outfp,"dbg2       dy:         %f\n",dy);
-		fprintf(outfp,"dbg2       p1 x:       %f\n",px[0]);
-		fprintf(outfp,"dbg2       p1 y:       %f\n",py[0]);
-		fprintf(outfp,"dbg2       p2 x:       %f\n",px[1]);
-		fprintf(outfp,"dbg2       p2 y:       %f\n",py[1]);
-		fprintf(outfp,"dbg2       p3 x:       %f\n",px[2]);
-		fprintf(outfp,"dbg2       p3 y:       %f\n",py[2]);
-		fprintf(outfp,"dbg2       p4 x:       %f\n",px[3]);
-		fprintf(outfp,"dbg2       p4 y:       %f\n",py[3]);
-		}
-
-	/* The weighting function is
-		w(x, y) = (1 / (PI * a * b)) * exp(-(x**2/a**2 + y**2/b**2))
-	    in the footprint coordinate system, where the x axis
-	    is along the horizontal projection of the beam and the
-	    y axix is perpendicular to that. The integral of the
-	    weighting function over an simple rectangle defined
-	    by corners (x1, y1), (x2, y1), (x1, y2), (x2, y2) is
-		    x2 y2
-		W = I  I { w(x, y) } dx dy
-		    x1 y1
-
-		  = 1 / 4 * ( erfc(x1/a) - erfc(x2/a)) * ( erfc(y1/a) - erfc(y2/a))
-	    where erfc(u) is the complementary error function.
-	    Each bin is represented as a simple integral in geographic
-	    coordinates, but is rotated in the footprint coordinate system.
-	    I can't figure out how to evaluate this integral over a
-	    rotated rectangle,  and so I am crudely and incorrectly
-	    approximating the integrated weight value by evaluating it over
-	    the same sized rectangle centered at the same location.
-	    Maybe someday I'll figure out how to do it correctly.
-	    DWC 11/18/99 */
-
-	/* get integrated weight */
-	fa = foot_a;
-	fb = foot_b;
-/*	*weight = 0.25 * ( erfcc((pcx - dx) / fa) - erfcc((pcx + dx) / fa))
-			* ( erfcc((pcy - dy) / fb) - erfcc((pcy + dy) / fb));*/
-	*weight = 0.25 * ( mbgrid_erf((pcx + dx) / fa) - mbgrid_erf((pcx - dx) / fa))
-			* ( mbgrid_erf((pcy + dy) / fb) - mbgrid_erf((pcy - dy) / fb));
-
-	/* use if weight large or any ratio <= 1 */
-	if (*weight > 0.05)
-	    {
-	    *use = MBGRID_USE_YES;
-	    }
-	/* check ratio of each corner footprint 1/e distance */
-	else
-	    {
-	    *use = MBGRID_USE_NO;
-	    for (i=0;i<4;i++)
-		{
-		ang = RTD * atan2(py[i], px[i]);
-		xe = foot_a * cos(DTR * ang);
-		ye = foot_b * sin(DTR * ang);
-		ratio = sqrt((px[i] * px[i] + py[i] * py[i])
-				/ (xe * xe + ye * ye));
-		if (ratio <= 1.0)
-		    *use = MBGRID_USE_YES;
-		else if (ratio <= 2.0)
-		    *use = MBGRID_USE_CONDITIONAL;
-		}
-	    }
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(outfp,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(outfp,"dbg2  Return values:\n");
-		fprintf(outfp,"dbg2       error:      %d\n",*error);
-		fprintf(outfp,"dbg2       weight:     %f\n",*weight);
-		fprintf(outfp,"dbg2       use:        %d\n",*use);
-		fprintf(outfp,"dbg2  Return status:\n");
-		fprintf(outfp,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-/* approximate complementary error function from numerical recipies */
-double erfcc(double x)
-{
-	double t,z,ans;
-
-	z=fabs(x);
-	t=1.0/(1.0+0.5*z);
-	ans=t*exp(-z*z-1.26551223+t*(1.00002368+t*(0.37409196+t*(0.09678418+
-		t*(-0.18628806+t*(0.27886807+t*(-1.13520398+t*(1.48851587+
-		t*(-0.82215223+t*0.17087277)))))))));
-/* fprintf(outfp, "x:%f ans:%f\n", x, ans); */
-	return  x >= 0.0 ? ans : 2.0-ans;
-}
-/*--------------------------------------------------------------------*/
-/* approximate error function altered from numerical recipies */
-double mbgrid_erf(double x)
-{
-	double t, z, erfc_d, erf_d;
-
-	z=fabs(x);
-	t=1.0/(1.0+0.5*z);
-	erfc_d=t*exp(-z*z-1.26551223+t*(1.00002368+t*(0.37409196+t*(0.09678418+
-		t*(-0.18628806+t*(0.27886807+t*(-1.13520398+t*(1.48851587+
-		t*(-0.82215223+t*0.17087277)))))))));
-	erfc_d =  x >= 0.0 ? erfc_d : 2.0-erfc_d;
-	erf_d = 1.0 - erfc_d;
-	return  erf_d;
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/utilities/mbhistogram.c b/src/utilities/mbhistogram.c
deleted file mode 100644
index 8bf2cd0..0000000
--- a/src/utilities/mbhistogram.c
+++ /dev/null
@@ -1,786 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbhistogram.c	12/28/94
- *    $Id: mbhistogram.c 2247 2015-05-29 21:28:28Z caress $
- *
- *    Copyright (c) 1993-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * MBHISTOGRAM reads a swath sonar data file and generates a histogram
- * of the bathymetry,  amplitude,  or sidescan values. Alternatively,
- * mbhistogram can output a list of values which break up the
- * distribution into equal sized regions.
- * The results are dumped to stdout.
- *
- * Author:	D. W. Caress
- * Date:	December 28, 1994
- *
- *
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <math.h>
-#include <string.h>
-
-/* MBIO include files */
-#include "mb_status.h"
-#include "mb_define.h"
-
-/* mode defines */
-#define	MBHISTOGRAM_BATH	0
-#define	MBHISTOGRAM_AMP		1
-#define	MBHISTOGRAM_SS		2
-
-double	qsnorm(double p);
-
-static char rcs_id[] = "$Id: mbhistogram.c 2247 2015-05-29 21:28:28Z caress $";
-
-/*--------------------------------------------------------------------*/
-
-int main (int argc, char **argv)
-{
-	char program_name[] = "MBHISTOGRAM";
-	char help_message[] =  "MBHISTOGRAM reads a swath sonar data file and generates a histogram\n\tof the bathymetry,  amplitude,  or sidescan values. Alternatively, \n\tmbhistogram can output a list of values which break up the\n\tdistribution into equal sized regions.\n\tThe results are dumped to stdout.";
-	char usage_message[] = "mbhistogram [-Akind -Byr/mo/da/hr/mn/sc -Dmin/max -Eyr/mo/da/hr/mn/sc -Fformat -G -Ifile -Llonflip -Mnintervals -Nnbins -Ppings -Rw/e/s/n -Sspeed -V -H]";
-	extern char *optarg;
-	int	errflg = 0;
-	int	c;
-	int	help = 0;
-	int	flag = 0;
-
-	/* MBIO status variables */
-	int	status = MB_SUCCESS;
-	int	verbose = 0;
-	int	error = MB_ERROR_NO_ERROR;
-	char	*message;
-
-	/* MBIO read control parameters */
-	int	read_datalist = MB_NO;
-	char	read_file[MB_PATH_MAXLINE];
-	void	*datalist;
-	int	look_processed = MB_DATALIST_LOOK_UNSET;
-	double	file_weight;
-	int	format;
-	int	pings;
-	int	lonflip;
-	double	bounds[4];
-	int	btime_i[7];
-	int	etime_i[7];
-	double	btime_d;
-	double	etime_d;
-	double	speedmin;
-	double	timegap;
-	char	file[MB_PATH_MAXLINE];
-	int	beams_bath;
-	int	beams_amp;
-	int	pixels_ss;
-
-	/* MBIO read values */
-	void	*mbio_ptr = NULL;
-	int	kind;
-	int	time_i[7];
-	double	time_d;
-	double	navlon;
-	double	navlat;
-	double	speed;
-	double	heading;
-	double	distance;
-	double	altitude;
-	double	sonardepth;
-	char	*beamflag = NULL;
-	double	*bath = NULL;
-	double	*bathacrosstrack = NULL;
-	double	*bathalongtrack = NULL;
-	double	*amp = NULL;
-	double	*ss = NULL;
-	double	*ssacrosstrack = NULL;
-	double	*ssalongtrack = NULL;
-	char	comment[MB_COMMENT_MAXLINE];
-
-	/* histogram variables */
-	int	mode = MBHISTOGRAM_SS;
-	int	gaussian = MB_NO;
-	int	nbins = 0;
-	int	nintervals = 0;
-	double	value_min = 0.0;
-	double	value_max = 128.0;
-	double	dvalue_bin;
-	double	value_bin_min;
-	double	value_bin_max;
-	double	data_min;
-	double	data_max;
-	int	data_first = MB_YES;
-	double	target_min;
-	double	target_max;
-	double	*histogram = NULL;
-	double	*intervals = NULL;
-	double	total;
-	double	sum;
-	double	p;
-	double	target;
-	double	dinterval;
-	double	bin_fraction;
-	int	ibin;
-
-	/* output stream for basic stuff (stdout if verbose <= 1,
-		stderr if verbose > 1) */
-	FILE	*output;
-
-	int	read_data;
-	int	nrec, nvalue;
-	int	nrectot = 0;
-	int	nvaluetot = 0;
-	int	i, j;
-
-	/* get current default values */
-	status = mb_defaults(verbose,&format,&pings,&lonflip,bounds,
-		btime_i,etime_i,&speedmin,&timegap);
-
-	/* set default input to stdin */
-	strcpy (read_file, "stdin");
-
-	/* process argument list */
-	while ((c = getopt(argc, argv, "A:a:B:b:D:d:E:e:F:f:GgHhI:i:L:l:M:m:N:n:P:p:R:r:S:s:T:t:Vv")) != -1)
-	  switch (c)
-		{
-		case 'A':
-		case 'a':
-			sscanf (optarg,"%d", &mode);
-			flag++;
-			break;
-		case 'B':
-		case 'b':
-			sscanf (optarg,"%d/%d/%d/%d/%d/%d",
-				&btime_i[0],&btime_i[1],&btime_i[2],
-				&btime_i[3],&btime_i[4],&btime_i[5]);
-			btime_i[6] = 0;
-			flag++;
-			break;
-		case 'D':
-		case 'd':
-			sscanf (optarg,"%lf/%lf", &value_min,&value_max);
-			flag++;
-			break;
-		case 'E':
-		case 'e':
-			sscanf (optarg,"%d/%d/%d/%d/%d/%d",
-				&etime_i[0],&etime_i[1],&etime_i[2],
-				&etime_i[3],&etime_i[4],&etime_i[5]);
-			etime_i[6] = 0;
-			flag++;
-			break;
-		case 'F':
-		case 'f':
-			sscanf (optarg,"%d", &format);
-			flag++;
-			break;
-		case 'G':
-		case 'g':
-			gaussian = MB_YES;
-			break;
-		case 'H':
-		case 'h':
-			help++;
-			break;
-		case 'I':
-		case 'i':
-			sscanf (optarg,"%s", read_file);
-			flag++;
-			break;
-		case 'L':
-		case 'l':
-			sscanf (optarg,"%d", &lonflip);
-			flag++;
-			break;
-		case 'M':
-		case 'm':
-			sscanf (optarg,"%d", &nintervals);
-			flag++;
-			break;
-		case 'N':
-		case 'n':
-			sscanf (optarg,"%d", &nbins);
-			flag++;
-			break;
-		case 'P':
-		case 'p':
-			sscanf (optarg,"%d", &pings);
-			flag++;
-			break;
-		case 'R':
-		case 'r':
-			mb_get_bounds(optarg, bounds);
-			flag++;
-			break;
-		case 'S':
-		case 's':
-			sscanf (optarg,"%lf", &speedmin);
-			flag++;
-			break;
-		case 'T':
-		case 't':
-			sscanf (optarg,"%lf", &timegap);
-			flag++;
-			break;
-		case 'V':
-		case 'v':
-			verbose++;
-			break;
-		case '?':
-			errflg++;
-		}
-
-	/* set output stream */
-	if (verbose <= 1)
-		output = stdout;
-	else
-		output = stderr;
-
-	/* if error flagged then print it and exit */
-	if (errflg)
-		{
-		fprintf(output,"usage: %s\n", usage_message);
-		fprintf(output,"\nProgram <%s> Terminated\n",
-			program_name);
-		error = MB_ERROR_BAD_USAGE;
-		exit(error);
-		}
-
-	/* print starting message */
-	if (verbose == 1 || help)
-		{
-		fprintf(output,"\nProgram %s\n",program_name);
-		fprintf(output,"Version %s\n",rcs_id);
-		fprintf(output,"MB-system Version %s\n",MB_VERSION);
-		}
-
-	/* get format if required */
-	if (format == 0)
-		mb_get_format(verbose,read_file,NULL,&format,&error);
-
-	/* figure out histogram dimensions */
-	if (nintervals > 0 && nbins <= 0)
-		nbins = 50*nintervals;
-	if (nbins <= 0)
-		nbins = 16;
-
-	/* print starting debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(output,"\ndbg2  Program <%s>\n",program_name);
-		fprintf(output,"dbg2  Version %s\n",rcs_id);
-		fprintf(output,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(output,"dbg2  Control Parameters:\n");
-		fprintf(output,"dbg2       verbose:    %d\n",verbose);
-		fprintf(output,"dbg2       help:       %d\n",help);
-		fprintf(output,"dbg2       format:     %d\n",format);
-		fprintf(output,"dbg2       pings:      %d\n",pings);
-		fprintf(output,"dbg2       lonflip:    %d\n",lonflip);
-		fprintf(output,"dbg2       bounds[0]:  %f\n",bounds[0]);
-		fprintf(output,"dbg2       bounds[1]:  %f\n",bounds[1]);
-		fprintf(output,"dbg2       bounds[2]:  %f\n",bounds[2]);
-		fprintf(output,"dbg2       bounds[3]:  %f\n",bounds[3]);
-		fprintf(output,"dbg2       btime_i[0]: %d\n",btime_i[0]);
-		fprintf(output,"dbg2       btime_i[1]: %d\n",btime_i[1]);
-		fprintf(output,"dbg2       btime_i[2]: %d\n",btime_i[2]);
-		fprintf(output,"dbg2       btime_i[3]: %d\n",btime_i[3]);
-		fprintf(output,"dbg2       btime_i[4]: %d\n",btime_i[4]);
-		fprintf(output,"dbg2       btime_i[5]: %d\n",btime_i[5]);
-		fprintf(output,"dbg2       btime_i[6]: %d\n",btime_i[6]);
-		fprintf(output,"dbg2       etime_i[0]: %d\n",etime_i[0]);
-		fprintf(output,"dbg2       etime_i[1]: %d\n",etime_i[1]);
-		fprintf(output,"dbg2       etime_i[2]: %d\n",etime_i[2]);
-		fprintf(output,"dbg2       etime_i[3]: %d\n",etime_i[3]);
-		fprintf(output,"dbg2       etime_i[4]: %d\n",etime_i[4]);
-		fprintf(output,"dbg2       etime_i[5]: %d\n",etime_i[5]);
-		fprintf(output,"dbg2       etime_i[6]: %d\n",etime_i[6]);
-		fprintf(output,"dbg2       speedmin:   %f\n",speedmin);
-		fprintf(output,"dbg2       timegap:    %f\n",timegap);
-		fprintf(output,"dbg2       file:       %s\n",read_file);
-		fprintf(output,"dbg2       mode:       %d\n",mode);
-		fprintf(output,"dbg2       gaussian:   %d\n",gaussian);
-		fprintf(output,"dbg2       nbins:      %d\n",nbins);
-		fprintf(output,"dbg2       nintervals: %d\n",nintervals);
-		fprintf(output,"dbg2       value_min:  %f\n",value_min);
-		fprintf(output,"dbg2       value_max:  %f\n",value_max);
-		}
-
-	/* if help desired then print it and exit */
-	if (help)
-		{
-		fprintf(output,"\n%s\n",help_message);
-		fprintf(output,"\nusage: %s\n", usage_message);
-		exit(error);
-		}
-
-	/* allocate memory for histogram arrays */
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_mallocd(verbose,__FILE__,__LINE__,nbins*sizeof(double),
-				(void **)&histogram,&error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_mallocd(verbose,__FILE__,__LINE__,nintervals*sizeof(double),
-				(void **)&intervals,&error);
-
-	/* if error initializing memory then quit */
-	if (error != MB_ERROR_NO_ERROR)
-		{
-		mb_error(verbose,error,&message);
-		fprintf(output,"\nMBIO Error allocating histogram arrays:\n%s\n",message);
-		fprintf(output,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-
-	/* output some information */
-	if (verbose > 0)
-		{
-		fprintf(stderr, "\nNumber of data bins: %d\n", nbins);
-		fprintf(stderr, "Minimum value:         %f\n", value_min);
-		fprintf(stderr, "Maximum value:         %f\n", value_max);
-		if (mode == MBHISTOGRAM_BATH)
-			fprintf(stderr, "Working on bathymetry data...\n");
-		else if (mode == MBHISTOGRAM_AMP)
-			fprintf(stderr, "Working on beam amplitude data...\n");
-		else
-			fprintf(stderr, "Working on sidescan data...\n");
-		}
-
-	/* get size of bins */
-	dvalue_bin = (value_max - value_min)/(nbins-1);
-	value_bin_min = value_min - 0.5*dvalue_bin;
-	value_bin_max = value_max + 0.5*dvalue_bin;
-
-	/* initialize histogram */
-	for (i=0;i<nbins;i++)
-		histogram[i] = 0;
-
-	/* determine whether to read one file or a list of files */
-	if (format < 0)
-		read_datalist = MB_YES;
-
-	/* open file list */
-	if (read_datalist == MB_YES)
-	    {
-	    if ((status = mb_datalist_open(verbose,&datalist,
-					    read_file,look_processed,&error)) != MB_SUCCESS)
-		{
-		error = MB_ERROR_OPEN_FAIL;
-		fprintf(stderr,"\nUnable to open data list file: %s\n",
-			read_file);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-	    if ((status = mb_datalist_read(verbose,datalist,
-			    file,&format,&file_weight,&error))
-			    == MB_SUCCESS)
-		read_data = MB_YES;
-	    else
-		read_data = MB_NO;
-	    }
-	/* else copy single filename to be read */
-	else
-	    {
-	    strcpy(file, read_file);
-	    read_data = MB_YES;
-	    }
-
-	/* loop over all files to be read */
-	while (read_data == MB_YES)
-	{
-
-	/* obtain format array location - format id will
-		be aliased to current id if old format id given */
-	status = mb_format(verbose,&format,&error);
-
-	/* initialize reading the swath sonar data file */
-	if ((status = mb_read_init(
-		verbose,file,format,pings,lonflip,bounds,
-		btime_i,etime_i,speedmin,timegap,
-		&mbio_ptr,&btime_d,&etime_d,
-		&beams_bath,&beams_amp,&pixels_ss,&error)) != MB_SUCCESS)
-		{
-		mb_error(verbose,error,&message);
-		fprintf(output,"\nMBIO Error returned from function <mb_read_init>:\n%s\n",message);
-		fprintf(output,"\nMultibeam File <%s> not initialized for reading\n",file);
-		fprintf(output,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-
-	/* allocate memory for data arrays */
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(char), (void **)&beamflag, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(double), (void **)&bath, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_AMPLITUDE,
-						sizeof(double), (void **)&amp, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(double), (void **)&bathacrosstrack, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(double), (void **)&bathalongtrack, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_SIDESCAN,
-						sizeof(double), (void **)&ss, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_SIDESCAN,
-						sizeof(double), (void **)&ssacrosstrack, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_SIDESCAN,
-						sizeof(double), (void **)&ssalongtrack, &error);
-
-	/* if error initializing memory then quit */
-	if (error != MB_ERROR_NO_ERROR)
-		{
-		mb_error(verbose,error,&message);
-		fprintf(output,"\nMBIO Error allocating data arrays:\n%s\n",message);
-		fprintf(output,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-
-	/* output information */
-	if (error == MB_ERROR_NO_ERROR && verbose > 0)
-	    {
-	    fprintf(stderr, "\nprocessing file: %s %d\n", file, format);
-	    }
-
-	/* initialize counting variables */
-	nrec = 0;
-	nvalue = 0;
-
-	/* read and process data */
-	while (error <= MB_ERROR_NO_ERROR)
-		{
-
-		/* read a ping of data */
-		status = mb_get(verbose,mbio_ptr,&kind,&pings,
-				time_i,&time_d,
-				&navlon,&navlat,
-				&speed,&heading,
-				&distance,&altitude,&sonardepth,
-				&beams_bath,&beams_amp,&pixels_ss,
-				beamflag,bath,amp,bathacrosstrack,bathalongtrack,
-				ss,ssacrosstrack,ssalongtrack,
-				comment,&error);
-
-		/* process the pings */
-		if (error == MB_ERROR_NO_ERROR
-			|| error == MB_ERROR_TIME_GAP)
-			{
-			/* increment record counter */
-			nrec++;
-
-			/* do the bathymetry */
-			if (mode == MBHISTOGRAM_BATH)
-			for (i=0;i<beams_bath;i++)
-				{
-				if (mb_beam_ok(beamflag[i]))
-					{
-					nvalue++;
-					j = (bath[i] - value_bin_min)
-						/dvalue_bin;
-					if (j >= 0 && j < nbins)
-						histogram[j]++;
-					if (data_first == MB_YES)
-						{
-						data_min = bath[i];
-						data_max = bath[i];
-						data_first = MB_NO;
-						}
-					else
-						{
-						data_min = MIN(bath[i], data_min);
-						data_max = MAX(bath[i], data_max);
-						}
-					}
-				}
-
-			/* do the amplitude */
-			if (mode == MBHISTOGRAM_AMP)
-			for (i=0;i<beams_amp;i++)
-				{
-				if (mb_beam_ok(beamflag[i]))
-					{
-					nvalue++;
-					j = (amp[i] - value_bin_min)
-						/dvalue_bin;
-					if (j >= 0 && j < nbins)
-						histogram[j]++;
-					if (data_first == MB_YES)
-						{
-						data_min = amp[i];
-						data_max = amp[i];
-						data_first = MB_NO;
-						}
-					else
-						{
-						data_min = MIN(amp[i], data_min);
-						data_max = MAX(amp[i], data_max);
-						}
-					}
-				}
-
-			/* do the sidescan */
-			if (mode == MBHISTOGRAM_SS)
-			for (i=0;i<pixels_ss;i++)
-				{
-				if (ss[i] > MB_SIDESCAN_NULL)
-					{
-					nvalue++;
-					j = (ss[i] - value_bin_min)
-						/dvalue_bin;
-					if (j >= 0 && j < nbins)
-						histogram[j]++;
-					if (data_first == MB_YES)
-						{
-						data_min = ss[i];
-						data_max = ss[i];
-						data_first = MB_NO;
-						}
-					else
-						{
-						data_min = MIN(ss[i], data_min);
-						data_max = MAX(ss[i], data_max);
-						}
-					}
-				}
-
-			}
-		}
-
-	/* close the swath sonar data file */
-	status = mb_close(verbose,&mbio_ptr,&error);
-	nrectot += nrec;
-	nvaluetot += nvalue;
-
-	/* output information */
-	if (error == MB_ERROR_NO_ERROR && verbose > 0)
-	    {
-	    fprintf(stderr, "%d records processed\n%d data processed\n",
-		    nrec, nvalue);
-	    }
-
-	/* figure out whether and what to read next */
-        if (read_datalist == MB_YES)
-                {
-		if ((status = mb_datalist_read(verbose,datalist,
-			    file,&format,&file_weight,&error))
-			    == MB_SUCCESS)
-                        read_data = MB_YES;
-                else
-                        read_data = MB_NO;
-                }
-        else
-                {
-                read_data = MB_NO;
-                }
-
-	/* end loop over files in list */
-	}
-	if (read_datalist == MB_YES)
-		mb_datalist_close(verbose,&datalist,&error);
-
-	/* output information */
-	if (error == MB_ERROR_NO_ERROR && verbose > 0)
-	    {
-	    fprintf(stderr, "\n%d total records processed\n", nrectot);
-	    fprintf(stderr, "%d total data processed\n\n", nvaluetot);
-	    }
-
-	/* recast histogram as gaussian */
-	if (gaussian == MB_YES)
-		{
-		/* get total number of good values */
-		total = 0.0;
-		for (i=0;i<nbins;i++)
-			total = total + histogram[i];
-
-		/* recast histogram */
-		sum = 0.0;
-		for (i=0;i<nbins;i++)
-			{
-			p = (histogram[i]/2 + sum)/(total + 1);
-			sum = sum + histogram[i];
-			histogram[i] = qsnorm(p);
-			}
-		}
-
-	/* calculate gaussian intervals if required */
-	if (nintervals > 0 && gaussian == MB_YES)
-		{
-		/* get interval spacing */
-		target_min = -2.0;
-		target_max = 2.0;
-		dinterval = (target_max - target_min)/(nintervals-1);
-
-		/* get intervals */
-		intervals[0] = MAX(data_min, value_min);
-		intervals[nintervals-1] = MIN(data_max, value_max);
-		ibin = 0;
-		for (j=1;j<nintervals-1;j++)
-			{
-			target = target_min + j*dinterval;
-			while (histogram[ibin] < target && ibin < nbins-1)
-				ibin++;
-			if (ibin > 0)
-				bin_fraction = 1.0 - (histogram[ibin] - target)
-					/(histogram[ibin] - histogram[ibin-1]);
-			else
-				bin_fraction = 0.0;
-			intervals[j] = value_bin_min
-					+ dvalue_bin*ibin
-					+ bin_fraction*dvalue_bin;
-			}
-		}
-
-	/* calculate linear intervals if required */
-	else if (nintervals > 0)
-		{
-		/* get total number of good values */
-		total = 0.0;
-		for (i=0;i<nbins;i++)
-			total = total + histogram[i];
-
-		/* get interval spacing */
-		dinterval = total/(nintervals-1);
-
-		/* get intervals */
-		intervals[0] = value_bin_min;
-		total = 0.0;
-		ibin = -1;
-		for (j=1;j<nintervals;j++)
-			{
-			target = j*dinterval;
-			while (total < target && ibin < nbins-1)
-				{
-				ibin++;
-				total = total + histogram[ibin];
-				if (total <= 0.0)
-					intervals[0] = value_bin_min
-						+ dvalue_bin*ibin;
-				}
-			bin_fraction = 1.0 - (total - target)/histogram[ibin];
-			intervals[j] = value_bin_min
-					+ dvalue_bin*ibin
-					+ bin_fraction*dvalue_bin;
-			}
-		}
-
-	/* print out the results */
-	if (nintervals <= 0 && gaussian == MB_YES)
-		{
-		for (i=0;i<nbins;i++)
-			{
-			fprintf(output,"%f %f\n",
-				value_min+i*dvalue_bin,histogram[i]);
-			}
-		}
-	else if (nintervals <= 0)
-		{
-		for (i=0;i<nbins;i++)
-			{
-			fprintf(output,"%f %d\n",
-				value_min+i*dvalue_bin,(int)histogram[i]);
-			}
-		}
-	else
-		{
-		for (i=0;i<nintervals;i++)
-			fprintf(output,"%f\n",intervals[i]);
-		}
-
-	/* deallocate memory used for data arrays */
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&histogram,&error);
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&intervals,&error);
-
-	/* set program status */
-	status = MB_SUCCESS;
-
-	/* check memory */
-	if (verbose >= 4)
-		status = mb_memory_list(verbose,&error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(output,"\ndbg2  Program <%s> completed\n",
-			program_name);
-		fprintf(output,"dbg2  Ending status:\n");
-		fprintf(output,"dbg2       status:  %d\n",status);
-		}
-
-	/* end it all */
-	fprintf(output,"\n");
-	exit(error);
-}
-/*--------------------------------------------------------------------*/
-
-/* double qsnorm(p)
- * double	p;
- *
- * Function to invert the cumulative normal probability
- * function.  If z is a standardized normal random deviate,
- * and Q(z) = p is the cumulative Gaussian probability
- * function, then z = qsnorm(p).
- *
- * Note that 0.0 < p < 1.0.  Data values outside this range
- * will return +/- a large number (1.0e6).
- * To compute p from a sample of data to test for Normalcy,
- * sort the N samples into non-decreasing order, label them
- * i=[1, N], and then compute p = i/(N+1).
- *
- * Author:	Walter H. F. Smith
- * Date:	19 February, 1991-1995.
- *
- * Based on a Fortran subroutine by R. L. Parker.  I had been
- * using IMSL library routine DNORIN(DX) to do what qsnorm(p)
- * does, when I was at the Lamont-Doherty Geological Observatory
- * which had a site license for IMSL.  I now need to invert the
- * gaussian CDF without calling IMSL; hence, this routine.
- *
- */
-
-double	qsnorm(double p)
-{
-	double	t, z;
-
-	if (p <= 0.0) {
-		return(-1.0e6);
-	}
-	else if (p >= 1.0) {
-		return(1.0e6);
-	}
-	else if (p == 0.5) {
-		return(0.0);
-	}
-	else if (p > 0.5) {
-		t = sqrt(-2.0 * log(1.0 - p) );
-		z = t - (2.515517 +t*(0.802853 +t*0.010328))/
-			(1.0 + t*(1.432788 + t*(0.189269+ t*0.001308)));
-		return(z);
-	}
-	else {
-		t = sqrt(-2.0 * log(p) );
-		z = t - (2.515517 +t*(0.802853 +t*0.010328))/
-			(1.0 + t*(1.432788 + t*(0.189269+ t*0.001308)));
-		return(-z);
-	}
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/utilities/mbhsdump.c b/src/utilities/mbhsdump.c
deleted file mode 100644
index ea50fff..0000000
--- a/src/utilities/mbhsdump.c
+++ /dev/null
@@ -1,819 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbhsdump.c	6/16/93
- *    $Id: mbhsdump.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1993-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * HSDUMP lists the information contained in data records on
- * Hydrosweep DS data files, including survey, calibrate, water
- * velocity and comment records. The default input stream is stdin.
- *
- * Author:	D. W. Caress
- * Date:	June 16, 1993
- *
- * $Log: mbhsdump.c,v $
- * Revision 5.8  2008/09/13 06:08:09  caress
- * Updates to apply suggested patches to segy handling. Also fixes to remove compiler warnings.
- *
- * Revision 5.7  2008/09/11 20:20:14  caress
- * Checking in updates made during cruise AT15-36.
- *
- * Revision 5.6  2006/01/24 19:12:01  caress
- * Version 5.0.8 beta.
- *
- * Revision 5.5  2005/03/25 04:42:59  caress
- * Standardized the string lengths used for filenames and comment data.
- *
- * Revision 5.4  2003/04/17 21:17:10  caress
- * Release 5.0.beta30
- *
- * Revision 5.3  2002/10/02 23:56:06  caress
- * Release 5.0.beta24
- *
- * Revision 5.2  2001/07/20 00:34:38  caress
- * Release 5.0.beta03
- *
- * Revision 5.1  2001/03/22 21:14:16  caress
- * Trying to make release 5.0.beta0.
- *
- * Revision 5.0  2000/12/01  22:57:08  caress
- * First cut at Version 5.0.
- *
- * Revision 4.11  2000/10/11  01:06:15  caress
- * Convert to ANSI C
- *
- * Revision 4.10  2000/09/30  07:06:28  caress
- * Snapshot for Dale.
- *
- * Revision 4.9  1998/10/05  19:19:24  caress
- * MB-System version 4.6beta
- *
- * Revision 4.8  1997/04/21  17:19:14  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.7  1996/04/22  13:23:05  caress
- * Now have DTR and MIN/MAX defines in mb_define.h
- *
- * Revision 4.7  1996/04/22  13:23:05  caress
- * Now have DTR and MIN/MAX defines in mb_define.h
- *
- * Revision 4.6  1995/05/12  17:12:32  caress
- * Made exit status values consistent with Unix convention.
- * 0: ok  nonzero: error
- *
- * Revision 4.5  1995/03/06  19:37:59  caress
- * Changed include strings.h to string.h for POSIX compliance.
- *
- * Revision 4.4  1995/03/02  13:49:21  caress
- * Fixed bug related to error messages.
- *
- * Revision 4.3  1994/10/21  13:02:31  caress
- * Release V4.0
- *
- * Revision 4.2  1994/06/03  23:54:03  caress
- * Added format_num and fixed call to mb_format_inf.
- *
- * Revision 4.1  1994/03/12  01:44:37  caress
- * Added declarations of ctime and/or getenv for compatability
- * with SGI compilers.
- *
- * Revision 4.0  1994/03/06  00:13:22  caress
- * First cut at version 4.0
- *
- * Revision 4.0  1994/03/01  18:59:27  caress
- * First cut at new version. Any changes are associated with
- * support of three data types (beam bathymetry, beam amplitude,
- * and sidescan) instead of two (bathymetry and backscatter).
- *
- * Revision 3.1  1993/06/30  21:51:31  caress
- * Fixed some debug messages.
- *
- * Revision 3.0  1993/06/16  23:07:10  caress
- * Initial version derived from old program hsveldump.
- *
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_define.h"
-#include "mbsys_hsds.h"
-
-static char rcs_id[] = "$Id: mbhsdump.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-
-int main (int argc, char **argv)
-{
-	/* id variables */
-	char program_name[] = "mbhsdump";
-	char help_message[] =  "mbhsdump lists the information contained in data records on\n\tHydrosweep DS data files, including survey, calibrate, water \n\tvelocity and comment records. The default input stream is stdin.";
-	char usage_message[] = "mbhsdump [-Fformat -V -H -Iinfile -Okind]";
-
-	/* parsing variables */
-	extern char *optarg;
-	int	errflg = 0;
-	int	c;
-	int	help = 0;
-	int	flag = 0;
-
-	/* MBIO status variables */
-	int	status = MB_SUCCESS;
-	int	verbose = 0;
-	int	error = MB_ERROR_NO_ERROR;
-	char	format_description[MB_DESCRIPTION_LENGTH];
-	char	*message = NULL;
-
-	/* MBIO read and write control parameters */
-	int	format = 0;
-	int	pings;
-	int	lonflip;
-	double	bounds[4];
-	int	btime_i[7];
-	int	etime_i[7];
-	double	btime_d;
-	double	etime_d;
-	double	speedmin;
-	double	timegap;
-	int	beams_bath;
-	int	beams_amp;
-	int	pixels_ss;
-	char	file[MB_PATH_MAXLINE];
-	void	*mbio_ptr = NULL;
-
-	/* mbio read and write values */
-	void	*store_ptr;
-	struct mbsys_hsds_struct *store;
-	int	kind;
-	int	time_i[7];
-	double	time_d;
-	double	navlon;
-	double	navlat;
-	double	speed;
-	double	heading;
-	double	distance;
-	double	altitude;
-	double	sonardepth;
-	int	nbath;
-	int	namp;
-	int	nss;
-	char	*beamflag = NULL;
-	double	*bath = NULL;
-	double	*bathacrosstrack = NULL;
-	double	*bathalongtrack = NULL;
-	double	*amp = NULL;
-	double	*ss = NULL;
-	double	*ssacrosstrack = NULL;
-	double	*ssalongtrack = NULL;
-	char	comment[MB_COMMENT_MAXLINE];
-
-	/* dump control parameters */
-	int	mb_data_data_list = MB_NO;
-	int	mb_data_comment_list = MB_NO;
-	int	mb_data_calibrate_list = MB_NO;
-	int	mb_data_mean_velocity_list = MB_NO;
-	int	mb_data_velocity_profile_list = MB_NO;
-	int	mb_data_standby_list = MB_NO;
-	int	mb_data_nav_source_list = MB_NO;
-	int	mb_data_data_count = 0;
-	int	mb_data_comment_count = 0;
-	int	mb_data_calibrate_count = 0;
-	int	mb_data_mean_velocity_count = 0;
-	int	mb_data_velocity_profile_count = 0;
-	int	mb_data_standby_count = 0;
-	int	mb_data_nav_source_count = 0;
-
-	/* output stream for basic stuff (stdout if verbose <= 1,
-		stderr if verbose > 1) */
-	FILE	*output;
-
-	int	i;
-
-	/* get current default values */
-	status = mb_defaults(verbose,&format,&pings,&lonflip,bounds,
-		btime_i,etime_i,&speedmin,&timegap);
-
-	/* reset all defaults */
-	format = MBF_HSATLRAW;
-	pings = 1;
-	lonflip = 0;
-	bounds[0] = -360.;
-	bounds[1] = 360.;
-	bounds[2] = -90.;
-	bounds[3] = 90.;
-	btime_i[0] = 1962;
-	btime_i[1] = 2;
-	btime_i[2] = 21;
-	btime_i[3] = 10;
-	btime_i[4] = 30;
-	btime_i[5] = 0;
-	btime_i[6] = 0;
-	etime_i[0] = 2062;
-	etime_i[1] = 2;
-	etime_i[2] = 21;
-	etime_i[3] = 10;
-	etime_i[4] = 30;
-	etime_i[5] = 0;
-	etime_i[6] = 0;
-	speedmin = 0.0;
-	timegap = 1000000000.0;
-
-	/* set default input and output */
-	strcpy (file, "stdin");
-
-	/* process argument list */
-	while ((c = getopt(argc, argv, "VvHhF:f:I:i:O:o:")) != -1)
-	  switch (c)
-		{
-		case 'H':
-		case 'h':
-			help++;
-			break;
-		case 'V':
-		case 'v':
-			verbose++;
-			break;
-		case 'F':
-		case 'f':
-			sscanf (optarg,"%d", &format);
-			flag++;
-			break;
-		case 'I':
-		case 'i':
-			sscanf (optarg,"%s", file);
-			flag++;
-			break;
-		case 'O':
-		case 'o':
-			sscanf (optarg,"%d", &kind);
-			if (kind == MB_DATA_DATA)
-				mb_data_data_list = MB_YES;
-			if (kind == MB_DATA_COMMENT)
-				mb_data_comment_list = MB_YES;
-			if (kind == MB_DATA_CALIBRATE)
-				mb_data_calibrate_list = MB_YES;
-			if (kind == MB_DATA_MEAN_VELOCITY)
-				mb_data_mean_velocity_list = MB_YES;
-			if (kind == MB_DATA_VELOCITY_PROFILE)
-				mb_data_velocity_profile_list = MB_YES;
-			if (kind == MB_DATA_STANDBY)
-				mb_data_standby_list = MB_YES;
-			if (kind == MB_DATA_NAV_SOURCE)
-				mb_data_nav_source_list = MB_YES;
-			flag++;
-			break;
-		case '?':
-			errflg++;
-		}
-
-	/* set output stream */
-	if (verbose <= 1)
-		output = stdout;
-	else
-		output = stderr;
-
-	/* if error flagged then print it and exit */
-	if (errflg)
-		{
-		fprintf(output,"usage: %s\n", usage_message);
-		fprintf(output,"\nProgram <%s> Terminated\n",
-			program_name);
-		error = MB_ERROR_BAD_USAGE;
-		exit(error);
-		}
-
-	/* print starting message */
-	if (verbose == 1 || help)
-		{
-		fprintf(output,"\nProgram %s\n",program_name);
-		fprintf(output,"Version %s\n",rcs_id);
-		fprintf(output,"MB-system Version %s\n",MB_VERSION);
-		}
-
-	/* print starting debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(output,"\ndbg2  Program <%s>\n",program_name);
-		fprintf(output,"dbg2  Version %s\n",rcs_id);
-		fprintf(output,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(output,"dbg2  Control Parameters:\n");
-		fprintf(output,"dbg2       verbose:         %d\n",verbose);
-		fprintf(output,"dbg2       help:            %d\n",help);
-		fprintf(output,"dbg2       format:          %d\n",format);
-		fprintf(output,"dbg2       pings:           %d\n",pings);
-		fprintf(output,"dbg2       lonflip:         %d\n",lonflip);
-		fprintf(output,"dbg2       bounds[0]:       %f\n",bounds[0]);
-		fprintf(output,"dbg2       bounds[1]:       %f\n",bounds[1]);
-		fprintf(output,"dbg2       bounds[2]:       %f\n",bounds[2]);
-		fprintf(output,"dbg2       bounds[3]:       %f\n",bounds[3]);
-		fprintf(output,"dbg2       btime_i[0]:      %d\n",btime_i[0]);
-		fprintf(output,"dbg2       btime_i[1]:      %d\n",btime_i[1]);
-		fprintf(output,"dbg2       btime_i[2]:      %d\n",btime_i[2]);
-		fprintf(output,"dbg2       btime_i[3]:      %d\n",btime_i[3]);
-		fprintf(output,"dbg2       btime_i[4]:      %d\n",btime_i[4]);
-		fprintf(output,"dbg2       btime_i[5]:      %d\n",btime_i[5]);
-		fprintf(output,"dbg2       btime_i[6]:      %d\n",btime_i[6]);
-		fprintf(output,"dbg2       etime_i[0]:      %d\n",etime_i[0]);
-		fprintf(output,"dbg2       etime_i[1]:      %d\n",etime_i[1]);
-		fprintf(output,"dbg2       etime_i[2]:      %d\n",etime_i[2]);
-		fprintf(output,"dbg2       etime_i[3]:      %d\n",etime_i[3]);
-		fprintf(output,"dbg2       etime_i[4]:      %d\n",etime_i[4]);
-		fprintf(output,"dbg2       etime_i[5]:      %d\n",etime_i[5]);
-		fprintf(output,"dbg2       etime_i[6]:      %d\n",etime_i[6]);
-		fprintf(output,"dbg2       speedmin:        %f\n",speedmin);
-		fprintf(output,"dbg2       timegap:         %f\n",timegap);
-		fprintf(output,"dbg2       input file:      %s\n",file);
-		fprintf(output,"dbg2       mb_data_data_list:             %d\n",
-			mb_data_data_list);
-		fprintf(output,"dbg2       mb_data_comment_list:          %d\n",
-			mb_data_comment_list);
-		fprintf(output,"dbg2       mb_data_calibrate_list:        %d\n",
-			mb_data_calibrate_list);
-		fprintf(output,"dbg2       mb_data_mean_velocity_list:    %d\n",
-			mb_data_mean_velocity_list);
-		fprintf(output,"dbg2       mb_data_velocity_profile_list: %d\n",
-			mb_data_velocity_profile_list);
-		fprintf(output,"dbg2       mb_data_standby_list:          %d\n",
-			mb_data_standby_list);
-		fprintf(output,"dbg2       mb_data_nav_source_list:       %d\n",
-			mb_data_nav_source_list);
-		}
-
-	/* if help desired then print it and exit */
-	if (help)
-		{
-		fprintf(output,"\n%s\n",help_message);
-		fprintf(output,"\nusage: %s\n", usage_message);
-		exit(error);
-		}
-
-	/* if bad format specified then print it and exit */
-	status = mb_format(verbose,&format,&error);
-	if (format != MBF_HSATLRAW && format != MBF_HSLDEOIH)
-		{
-		fprintf(output,"\nProgram <%s> requires complete Hydrosweep DS data stream\n",program_name);
-		fprintf(output,"!!Format %d is unacceptable, only formats %d and %d can be used\n",format,MBF_HSATLRAW,MBF_HSLDEOIH);
-		fprintf(output,"\nProgram <%s> Terminated\n",
-			program_name);
-		error = MB_ERROR_BAD_FORMAT;
-		exit(error);
-		}
-
-	/* initialize reading the input multibeam file */
-	if ((status = mb_read_init(
-		verbose,file,format,pings,lonflip,bounds,
-		btime_i,etime_i,speedmin,timegap,
-		&mbio_ptr,&btime_d,&etime_d,
-		&beams_bath,&beams_amp,&pixels_ss,&error)) != MB_SUCCESS)
-		{
-		mb_error(verbose,error,&message);
-		fprintf(output,"\nMBIO Error returned from function <mb_read_init>:\n%s\n",message);
-		fprintf(output,"\nMultibeam File <%s> not initialized for reading\n",file);
-		fprintf(output,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-
-	/* allocate memory for data arrays */
-	status = mb_mallocd(verbose,__FILE__,__LINE__,beams_bath*sizeof(char),(void **)&beamflag,&error);
-	status = mb_mallocd(verbose,__FILE__,__LINE__,beams_bath*sizeof(double),(void **)&bath,&error);
-	status = mb_mallocd(verbose,__FILE__,__LINE__,beams_bath*sizeof(double),
-				(void **)&bathacrosstrack,&error);
-	status = mb_mallocd(verbose,__FILE__,__LINE__,beams_bath*sizeof(double),
-				(void **)&bathalongtrack,&error);
-	status = mb_mallocd(verbose,__FILE__,__LINE__,beams_amp*sizeof(double),(void **)&amp,&error);
-	status = mb_mallocd(verbose,__FILE__,__LINE__,pixels_ss*sizeof(double),(void **)&ss,&error);
-	status = mb_mallocd(verbose,__FILE__,__LINE__,pixels_ss*sizeof(double),
-			(void **)&ssacrosstrack,&error);
-	status = mb_mallocd(verbose,__FILE__,__LINE__,pixels_ss*sizeof(double),
-			(void **)&ssalongtrack,&error);
-
-	/* if error initializing memory then quit */
-	if (error != MB_ERROR_NO_ERROR)
-		{
-		mb_error(verbose,error,&message);
-		fprintf(output,"\nMBIO Error allocating data arrays:\n%s\n",message);
-		fprintf(output,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-
-	/* printf out file and format */
-	mb_format_description(verbose, &format, format_description, &error);
-	fprintf(output,"\nHydrosweep DS Data File:  %s\n",file);
-	fprintf(output,"MBIO Data Format ID:  %d\n",format);
-	fprintf(output,"%s",format_description);
-
-	/* read and list */
-	while (error <= MB_ERROR_NO_ERROR)
-		{
-		/* read some data */
-		error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-		status = mb_get_all(verbose,mbio_ptr,&store_ptr,&kind,
-				time_i,&time_d,&navlon,&navlat,
-				&speed,&heading,
-				&distance,&altitude,&sonardepth,
-				&nbath,&namp,&nss,
-				beamflag,bath,amp,bathacrosstrack,bathalongtrack,
-				ss,ssacrosstrack,ssalongtrack,
-				comment,&error);
-
-		/* get data structure pointer */
-		store = (struct mbsys_hsds_struct *) store_ptr;
-
-		/* non-survey data do not matter to mbhsdump */
-		if (error >= MB_ERROR_OTHER && error < MB_ERROR_NO_ERROR)
-			{
-			status = MB_SUCCESS;
-			error = MB_ERROR_NO_ERROR;
-			}
-
-		/* output error messages */
-		if (verbose >= 1 && error <= MB_ERROR_OTHER)
-			{
-			mb_error(verbose,error,&message);
-			fprintf(output,"\nNonfatal MBIO Error:\n%s\n",message);
-			}
-		else if (verbose >= 1 && error > MB_ERROR_NO_ERROR
-			&& error != MB_ERROR_EOF)
-			{
-			mb_error(verbose,error,&message);
-			fprintf(output,"\nFatal MBIO Error:\n%s\n",message);
-			}
-
-		/* deal with survey data record */
-		if (kind == MB_DATA_DATA && mb_data_data_list == MB_YES)
-			{
-			mb_data_data_count++;
-			fprintf(output,"\n");
-			fprintf(output,"Survey Data Record (ERGNMESS + ERGNSLZT +ERGNAMPL):\n");
-			fprintf(output,"  Time:            %2d/%2d/%4d %2.2d:%2.2d:%2.2d\n",
-				store->month,store->day,store->year,
-				store->hour,store->minute,store->second);
-			fprintf(output,"  Alternate Time:   %4d  %4d\n",
-				store->alt_minute,store->alt_second);
-			fprintf(output,"  Longitude:        %f\n",store->lon);
-			fprintf(output,"  Latitude:         %f\n",store->lat);
-			fprintf(output,"  Course:           %f\n",
-				store->course_true);
-			fprintf(output,"  Course On Ground: %f\n",
-				store->course_ground);
-			fprintf(output,"  Speed:            %f\n",
-				store->speed);
-			fprintf(output,"  Speed On Ground:  %f\n",
-				store->speed_ground);
-			fprintf(output,"  Transverse Speed: %f\n",
-				store->speed_transverse);
-			fprintf(output,"  Speed Reference:  %c%c\n",
-				store->speed_reference[0],
-				store->speed_reference[1]);
-			fprintf(output,"  Roll:             %f\n",
-				store->roll);
-			fprintf(output,"  Pitch:            %f\n",
-				store->pitch);
-			fprintf(output,"  Heave:            %f\n",
-				store->heave);
-			fprintf(output,"  Track:            %d\n",
-				store->track);
-			fprintf(output,"  Center Depth:     %f\n",
-				store->depth_center);
-			fprintf(output,"  Depth Scale:      %f\n",
-				store->depth_scale);
-			fprintf(output,"  Spare:            %d\n",
-				store->spare);
-			fprintf(output,"  Crosstrack Distances and Depths:\n");
-			for (i=0;i<MBSYS_HSDS_BEAMS;i++)
-				fprintf(output,"                    %5d %5d\n",
-					store->distance[i],store->depth[i]);
-			fprintf(output,"  Center Travel Time: %f\n",
-				store->time_center);
-			fprintf(output,"  Time Scale:       %f\n",
-				store->time_scale);
-			fprintf(output,"  Travel Times:\n");
-			for (i=0;i<MBSYS_HSDS_BEAMS;i++)
-				fprintf(output,"            %5d\n",
-					store->time[i]);
-			fprintf(output,"  Gyro Headings:\n");
-			for (i=0;i<11;i++)
-				fprintf(output,"            %f\n",
-					store->gyro[i]);
-			fprintf(output,"  Mode:             %c%c\n",
-				store->mode[0],store->mode[1]);
-			fprintf(output,"  Transmit Starboard: %d\n",
-				store->trans_strbd);
-			fprintf(output,"  Transmit Vertical:  %d\n",
-				store->trans_vert);
-			fprintf(output,"  Transmit Port:      %d\n",
-				store->trans_port);
-			fprintf(output,"  Pulse Starboard:    %d\n",
-				store->pulse_len_strbd);
-			fprintf(output,"  Pulse Vertical:     %d\n",
-				store->pulse_len_vert);
-			fprintf(output,"  Pulse Port:         %d\n",
-				store->pulse_len_port);
-			fprintf(output,"  Gain Start:         %d\n",
-				store->gain_start);
-			fprintf(output,"  Compensation Factor:%d\n",
-				store->r_compensation_factor);
-			fprintf(output,"  Compensation Start: %d\n",
-				store->compensation_start);
-			fprintf(output,"  Increase Start:     %d\n",
-				store->increase_start);
-			fprintf(output,"  Near TVC:           %d\n",
-				store->tvc_near);
-			fprintf(output,"  Far TVC:            %d\n",
-				store->tvc_far);
-			fprintf(output,"  Near Increase:      %d\n",
-				store->increase_int_near);
-			fprintf(output,"  Far Increase:       %d\n",
-				store->increase_int_far);
-			fprintf(output,"  Center Gain:        %d\n",
-				store->gain_center);
-			fprintf(output,"  Filter Gain:        %f\n",
-				store->filter_gain);
-			fprintf(output,"  Center Amplitude:   %d\n",
-				store->amplitude_center);
-			fprintf(output,"  Center Echo Time:   %d\n",
-				store->echo_duration_center);
-			fprintf(output,"  Echo Scale:         %d\n",
-				store->echo_scale_center);
-
-			fprintf(output,"  Amplitudes and Durations:\n");
-			for (i=0;i<MBSYS_HSDS_BEAMS;i++)
-				fprintf(output,"            %5d %5d\n",
-					store->amplitude[i],
-					store->echo_duration[i]);
-			fprintf(output,"  Echo Gains and Scales:\n");
-			for (i=0;i<16;i++)
-				fprintf(output,"            %5d %5d\n",
-					store->gain[i],
-					store->echo_scale[i]);
-			}
-
-		/* deal with comment record */
-		if (kind == MB_DATA_COMMENT && mb_data_comment_list == MB_YES)
-			{
-			mb_data_comment_count++;
-			fprintf(output,"\n");
-			fprintf(output,"Comment Record (LDEOCMNT):\n");
-			fprintf(output,"  %s\n",store->comment);
-			}
-
-		/* deal with calibrate data record */
-		if (kind == MB_DATA_CALIBRATE
-			&& mb_data_calibrate_list == MB_YES)
-			{
-			mb_data_calibrate_count++;
-			fprintf(output,"\n");
-			fprintf(output,"Calibrate Data Record (ERGNEICH + ERGNSLZT +ERGNAMPL):\n");
-			fprintf(output,"  Time:            %2d/%2d/%4d %2.2d:%2.2d:%2.2d\n",
-				store->month,store->day,store->year,
-				store->hour,store->minute,store->second);
-			fprintf(output,"  Alternate Time:   %4d  %4d\n",
-				store->alt_minute,store->alt_second);
-			fprintf(output,"  Longitude:        %f\n",store->lon);
-			fprintf(output,"  Latitude:         %f\n",store->lat);
-			fprintf(output,"  Course:           %f\n",
-				store->course_true);
-			fprintf(output,"  Course On Ground: %f\n",
-				store->course_ground);
-			fprintf(output,"  Speed:            %f\n",
-				store->speed);
-			fprintf(output,"  Speed On Ground:  %f\n",
-				store->speed_ground);
-			fprintf(output,"  Transverse Speed: %f\n",
-				store->speed_transverse);
-			fprintf(output,"  Speed Reference:  %c%c\n",
-				store->speed_reference[0],
-				store->speed_reference[1]);
-			fprintf(output,"  Roll:             %f\n",
-				store->roll);
-			fprintf(output,"  Pitch:            %f\n",
-				store->pitch);
-			fprintf(output,"  Heave:            %f\n",
-				store->heave);
-			fprintf(output,"  Track:            %d\n",
-				store->track);
-			fprintf(output,"  Center Depth:     %f\n",
-				store->depth_center);
-			fprintf(output,"  Depth Scale:      %f\n",
-				store->depth_scale);
-			fprintf(output,"  Spare:            %d\n",
-				store->spare);
-			fprintf(output,"  Crosstrack Distances and Depths:\n");
-			for (i=0;i<MBSYS_HSDS_BEAMS;i++)
-				fprintf(output,"                    %5d %5d\n",
-					store->distance[i],store->depth[i]);
-			fprintf(output,"  Center Travel Time: %f\n",
-				store->time_center);
-			fprintf(output,"  Time Scale:       %f\n",
-				store->time_scale);
-			fprintf(output,"  Travel Times:\n");
-			for (i=0;i<MBSYS_HSDS_BEAMS;i++)
-				fprintf(output,"            %5d\n",
-					store->time[i]);
-			fprintf(output,"  Gyro Headings:\n");
-			for (i=0;i<11;i++)
-				fprintf(output,"            %f\n",
-					store->gyro[i]);
-			fprintf(output,"  Mode:             %c%c\n",
-				store->mode[0],store->mode[1]);
-			fprintf(output,"  Transmit Starboard: %d\n",
-				store->trans_strbd);
-			fprintf(output,"  Transmit Vertical:  %d\n",
-				store->trans_vert);
-			fprintf(output,"  Transmit Port:      %d\n",
-				store->trans_port);
-			fprintf(output,"  Pulse Starboard:    %d\n",
-				store->pulse_len_strbd);
-			fprintf(output,"  Pulse Vertical:     %d\n",
-				store->pulse_len_vert);
-			fprintf(output,"  Pulse Port:         %d\n",
-				store->pulse_len_port);
-			fprintf(output,"  Gain Start:         %d\n",
-				store->gain_start);
-			fprintf(output,"  Compensation Factor:%d\n",
-				store->r_compensation_factor);
-			fprintf(output,"  Compensation Start: %d\n",
-				store->compensation_start);
-			fprintf(output,"  Increase Start:     %d\n",
-				store->increase_start);
-			fprintf(output,"  Near TVC:           %d\n",
-				store->tvc_near);
-			fprintf(output,"  Far TVC:            %d\n",
-				store->tvc_far);
-			fprintf(output,"  Near Increase:      %d\n",
-				store->increase_int_near);
-			fprintf(output,"  Far Increase:       %d\n",
-				store->increase_int_far);
-			fprintf(output,"  Center Gain:        %d\n",
-				store->gain_center);
-			fprintf(output,"  Filter Gain:        %f\n",
-				store->filter_gain);
-			fprintf(output,"  Center Amplitude:   %d\n",
-				store->amplitude_center);
-			fprintf(output,"  Center Echo Time:   %d\n",
-				store->echo_duration_center);
-			fprintf(output,"  Echo Scale:         %d\n",
-				store->echo_scale_center);
-
-			fprintf(output,"  Amplitudes and Durations:\n");
-			for (i=0;i<MBSYS_HSDS_BEAMS;i++)
-				fprintf(output,"            %5d %5d\n",
-					store->amplitude[i],
-					store->echo_duration[i]);
-			fprintf(output,"  Echo Gains and Scales:\n");
-			for (i=0;i<16;i++)
-				fprintf(output,"            %5d %5d\n",
-					store->gain[i],
-					store->echo_scale[i]);
-			}
-
-		/* deal with mean velocity data record */
-		if (kind == MB_DATA_MEAN_VELOCITY
-			&& mb_data_mean_velocity_list == MB_YES)
-			{
-			mb_data_mean_velocity_count++;
-			fprintf(output,"\n");
-			fprintf(output,"Mean Water Velocity Record (ERGNHYDI):\n");
-			fprintf(output,"  Time:            %2d/%2d/%4d %2.2d:%2.2d:%2.2d\n",
-				store->month,store->day,store->year,
-				store->hour,store->minute,store->second);
-			fprintf(output,"  Alternate Time:   %4d  %4d\n",
-				store->alt_minute,store->alt_second);
-			fprintf(output,"  Longitude:        %f\n",store->lon);
-			fprintf(output,"  Latitude:         %f\n",store->lat);
-			fprintf(output,"  Draught:          %f\n",
-				store->draught);
-			fprintf(output,"  Mean velocity:    %f\n",
-				store->vel_mean);
-			fprintf(output,"  Keel velocity:    %f\n",
-				store->vel_keel);
-			fprintf(output,"  Tide:             %f\n",store->tide);
-			}
-
-		/* deal with velocity profile data record */
-		if (kind == MB_DATA_VELOCITY_PROFILE
-			&& mb_data_velocity_profile_list == MB_YES)
-			{
-			mb_data_velocity_profile_count++;
-			fprintf(output,"\n");
-			fprintf(output,"Water Velocity Profile Record (ERGNCTDS):\n");
-			fprintf(output,"  Time:             %2d/%2d/%4d %2.2d:%2.2d:%2.2d\n",
-				store->month,store->day,store->year,
-				store->hour,store->minute,store->second);
-			fprintf(output,"  Longitude:        %f\n",store->lon);
-			fprintf(output,"  Latitude:         %f\n",store->lat);
-			fprintf(output,"  Number of points: %d\n",
-				store->num_vel);
-			fprintf(output,"  Water Velocity Profile:\n");
-			for (i=0;i<store->num_vel;i++)
-				fprintf(output,"    %f %f\n",
-					store->vdepth[i],store->velocity[i]);
-			}
-
-		/* deal with standby data record */
-		if (kind == MB_DATA_STANDBY
-			&& mb_data_standby_list == MB_YES)
-			{
-			mb_data_standby_count++;
-			fprintf(output,"\n");
-			fprintf(output,"Standby Data Record (ERGNPARA):\n");
-			fprintf(output,"  Time:            %2d/%2d/%4d %2.2d:%2.2d:%2.2d\n",
-				store->month,store->day,store->year,
-				store->hour,store->minute,store->second);
-			fprintf(output,"  Alternate Time:   %4d  %4d\n",
-				store->alt_minute,store->alt_second);
-			fprintf(output,"  Longitude:        %f\n",store->lon);
-			fprintf(output,"  Latitude:         %f\n",store->lat);
-			}
-
-		/* deal with navigation source data record */
-		if (kind == MB_DATA_NAV_SOURCE
-			&& mb_data_nav_source_list == MB_YES)
-			{
-			mb_data_nav_source_count++;
-			fprintf(output,"\n");
-			fprintf(output,"Standby Data Record (ERGNPARA):\n");
-			fprintf(output,"  Time:            %2d/%2d/%4d %2.2d:%2.2d:%2.2d\n",
-				store->month,store->day,store->year,
-				store->hour,store->minute,store->second);
-			fprintf(output,"  Alternate Time:   %4d  %4d\n",
-				store->alt_minute,store->alt_second);
-			fprintf(output,"  Longitude:        %f\n",store->lon);
-			fprintf(output,"  Latitude:         %f\n",store->lat);
-			fprintf(output,"  X Correction:     %f\n",
-				store->pos_corr_x);
-			fprintf(output,"  Y Correction:     %f\n",
-				store->pos_corr_y);
-			fprintf(output,"  Sensors:          ");
-			for (i=0;i<10;i++)
-				fprintf(output,"%c",store->sensors[i]);
-			fprintf(output,"\n");
-			}
-
-		}
-
-	/* close the file */
-	status = mb_close(verbose,&mbio_ptr,&error);
-
-	/* deallocate memory for data arrays */
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&beamflag,&error);
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&bath,&error);
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&bathacrosstrack,&error);
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&bathalongtrack,&error);
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&amp,&error);
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&ss,&error);
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&ssacrosstrack,&error);
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&ssalongtrack,&error);
-
-	/* check memory */
-	if (verbose >= 4)
-		status = mb_memory_list(verbose,&error);
-
-	/* give the statistics */
-	fprintf(output,"\n");
-	if (mb_data_data_list == MB_YES)
-		fprintf(output,"%d survey data records listed\n",
-			mb_data_data_count);
-	if (mb_data_comment_list == MB_YES)
-		fprintf(output,"%d comment records listed\n",
-			mb_data_comment_count);
-	if (mb_data_calibrate_list == MB_YES)
-		fprintf(output,"%d calibrate data records listed\n",
-			mb_data_calibrate_count);
-	if (mb_data_mean_velocity_list == MB_YES)
-		fprintf(output,"%d mean velocity data records listed\n",
-			mb_data_mean_velocity_count);
-	if (mb_data_velocity_profile_list == MB_YES)
-		fprintf(output,"%d velocity profile data records listed\n",
-			mb_data_velocity_profile_count);
-	if (mb_data_standby_list == MB_YES)
-		fprintf(output,"%d standby data records listed\n",
-			mb_data_standby_count);
-	if (mb_data_nav_source_list == MB_YES)
-		fprintf(output,"%d navigation source data records listed\n",
-			mb_data_nav_source_count);
-
-	/* end it all */
-	exit(error);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/utilities/mbhysweeppreprocess.c b/src/utilities/mbhysweeppreprocess.c
deleted file mode 100644
index 0f586db..0000000
--- a/src/utilities/mbhysweeppreprocess.c
+++ /dev/null
@@ -1,2361 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbhysweeppreprocess.c	1/1/2012
- *    $Id: mbhysweeppreprocess.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 2013-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbhysweeppreprocess reads a HYSWEEP HSX format file, interpolates the
- * asynchronous navigation and attitude onto the multibeam data,
- * and writes a new HSX file with that information correctly embedded
- * in the multibeam data. This program can also fix various problems
- * with the data, including sensor offsets.
- *
- * Author:	D. W. Caress
- * Date:	January 1, 2012
- *
- * $Log: mbhysweeppreprocess.c,v $
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <math.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-
-/* MBIO include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_define.h"
-#include "mb_io.h"
-#include "mb_aux.h"
-#include "mbsys_hysweep.h"
-
-#define MBHYSWEEPPREPROCESS_ALLOC_CHUNK 1000
-#define MBHYSWEEPPREPROCESS_PROCESS		1
-#define MBHYSWEEPPREPROCESS_TIMESTAMPLIST	2
-#define	MBHYSWEEPPREPROCESS_TIMELAG_OFF	0
-#define	MBHYSWEEPPREPROCESS_TIMELAG_CONSTANT	1
-#define	MBHYSWEEPPREPROCESS_TIMELAG_MODEL	2
-
-#define MBHYSWEEPPREPROCESS_SONAR_OFFSET_NONE		0
-#define MBHYSWEEPPREPROCESS_SONAR_OFFSET_SONAR		1
-#define MBHYSWEEPPREPROCESS_SONAR_OFFSET_MRU		2
-#define MBHYSWEEPPREPROCESS_SONAR_OFFSET_NAVIGATION	3
-
-#define MBHYSWEEPPREPROCESS_OFFSET_MAX	12
-
-#define MBHYSWEEPPREPROCESS_NAVFORMAT_NONE	0
-#define MBHYSWEEPPREPROCESS_NAVFORMAT_OFG	1
-
-static char rcs_id[] = "$Id: mbhysweeppreprocess.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-
-int main (int argc, char **argv)
-{
-	char program_name[] = "mbhysweeppreprocess";
-	char help_message[] =  "mbhysweeppreprocess reads a Hysweep HSX format file, interpolates the\nasynchronous navigation and attitude onto the multibeam data, \nand writes a new HSX file with that information correctly embedded\nin the multibeam data.";
-	char usage_message[] = "mbhysweeppreprocess [-Aoffsettype/x/y/z/t -Brollbias/pitchbias/headingbias -Dsonardepthfile -Idatalist -Jprojection -L -Mnavformat -Nnavfile -Ttimelag -H -V]";
-	extern char *optarg;
-	int	errflg = 0;
-	int	c;
-	int	help = 0;
-	int	flag = 0;
-
-	/* MBIO status variables */
-	int	status = MB_SUCCESS;
-	int	verbose = 0;
-	int	error = MB_ERROR_NO_ERROR;
-	char	*message;
-
-	/* MBIO read control parameters */
-	int	read_datalist = MB_NO;
-	char	read_file[MB_PATH_MAXLINE];
-	void	*datalist;
-	int	look_processed = MB_DATALIST_LOOK_UNSET;
-	double	file_weight;
-	int	format = 0;
-	int	pings;
-	int	lonflip;
-	double	bounds[4];
-	int	btime_i[7];
-	int	etime_i[7];
-	double	btime_d;
-	double	etime_d;
-	double	speedmin;
-	double	timegap;
-	char	ifile[MB_PATH_MAXLINE];
-	char	ofile[MB_PATH_MAXLINE];
-	int	ofile_set = MB_NO;
-	int	beams_bath;
-	int	beams_amp;
-	int	pixels_ss;
-	int	obeams_bath;
-	int	obeams_amp;
-	int	opixels_ss;
-
-	/* MBIO read values */
-	void	*imbio_ptr = NULL;
-	struct mb_io_struct *imb_io_ptr = NULL;
-	void	*istore_ptr = NULL;
-	struct mbsys_hysweep_struct *istore = NULL;
-	struct mbsys_hysweep_device_struct *device;
-	void	*ombio_ptr = NULL;
-	int	kind;
-	int	time_i[7];
-	double	time_d;
-	double	navlon;
-	double	navlat;
-	double	speed;
-	double	heading;
-	double	distance;
-	double	altitude;
-	double	sonardepth;
-	double	roll;
-	double	pitch;
-	char	*beamflag = NULL;
-	double	*bath = NULL;
-	double	*bathacrosstrack = NULL;
-	double	*bathalongtrack = NULL;
-	double	*amp = NULL;
-	double	*ss = NULL;
-	double	*ssacrosstrack = NULL;
-	double	*ssalongtrack = NULL;
-	char	comment[MB_COMMENT_MAXLINE];
-
-	/* program mode */
-	int	mode = MBHYSWEEPPREPROCESS_PROCESS;
-
-	/* counting variables */
-	int	nrec_POS = 0;
-	int	nrec_POSunused = 0;
-	int	nrec_GYR = 0;
-	int	nrec_HCP = 0;
-	int	nrec_EC1 = 0;
-	int	nrec_DFT = 0;
-	int	nrec_RMB = 0;
-	int	nrec_other = 0;
-	int	nrec_POS_tot = 0;
-	int	nrec_POSunused_tot = 0;
-	int	nrec_GYR_tot = 0;
-	int	nrec_HCP_tot = 0;
-	int	nrec_EC1_tot = 0;
-	int	nrec_DFT_tot = 0;
-	int	nrec_RMB_tot = 0;
-	int	nrec_other_tot = 0;
-
-	/* projection */
-	int	projection_set = MB_NO;
-	mb_path	proj4command;
-	void	*pjptr = NULL;
-
-	/* merge navigation data file */
-	char	navfile[MB_PATH_MAXLINE];
-	int	navdata = MB_NO;
-	int	navformat = MBHYSWEEPPREPROCESS_NAVFORMAT_OFG;
-	int	nnav = 0;
-	double	*nav_time_d = NULL;
-	double	*nav_lon = NULL;
-	double	*nav_lat = NULL;
-	double	*nav_heading = NULL;
-	double	*nav_sonardepth = NULL;
-	double	*nav_altitude = NULL;
-
-	/* merge sonardepth from separate data file */
-	char	sonardepthfile[MB_PATH_MAXLINE];
-	int	sonardepthdata = MB_NO;
-	int	nsonardepth = 0;
-	double	*sonardepth_time_d = NULL;
-	double	*sonardepth_sonardepth = NULL;
-
-	/* asynchronous navigation, heading, attitude data */
-	int	ndat_nav = 0;
-	int	ndat_nav_alloc = 0;
-	double	*dat_nav_time_d = NULL;
-	double	*dat_nav_lon = NULL;
-	double	*dat_nav_lat = NULL;
-
-	int	ndat_sonardepth = 0;
-	int	ndat_sonardepth_alloc = 0;
-	double	*dat_sonardepth_time_d = NULL;
-	double	*dat_sonardepth_sonardepth = NULL;
-
-	int	ndat_heading = 0;
-	int	ndat_heading_alloc = 0;
-	double	*dat_heading_time_d = NULL;
-	double	*dat_heading_heading = NULL;
-
-	int	ndat_rph = 0;
-	int	ndat_rph_alloc = 0;
-	double	*dat_rph_time_d = NULL;
-	double	*dat_rph_roll = NULL;
-	double	*dat_rph_pitch = NULL;
-	double	*dat_rph_heave = NULL;
-
-	int	ndat_altitude = 0;
-	int	ndat_altitude_alloc = 0;
-	double	*dat_altitude_time_d = NULL;
-	double	*dat_altitude_altitude = NULL;
-
-	/* timelag parameters */
-	int	timelagmode = MBHYSWEEPPREPROCESS_TIMELAG_OFF;
-	double	timelag = 0.0;
-	double	timelagm = 0.0;
-	double	timelagconstant = 0.0;
-	char	timelagfile[MB_PATH_MAXLINE];
-	int	ntimelag = 0;
-	double	*timelag_time_d = NULL;
-	double	*timelag_model = NULL;
-
-	/* sensor offset parameters */
-	double	offset_sonar_roll = 0.0;
-	double	offset_sonar_pitch = 0.0;
-	double	offset_sonar_heading = 0.0;
-	double	offset_sonar_x = 0.0;
-	double	offset_sonar_y = 0.0;
-	double	offset_sonar_z = 0.0;
-	double	offset_sonar_t = 0.0;
-	double	offset_mru_x = 0.0;
-	double	offset_mru_y = 0.0;
-	double	offset_mru_z = 0.0;
-	double	offset_mru_t = 0.0;
-	double	offset_nav_x = 0.0;
-	double	offset_nav_y = 0.0;
-	double	offset_nav_z = 0.0;
-	double	offset_nav_t = 0.0;
-
-	/* processing kluge modes */
-	int	klugemode;
-
-	int	interp_status;
-	double	alpha, beta, theta, phi;
-	double	rr, xx, zz;
-
-	FILE	*tfp = NULL;
-	struct stat file_status;
-	int	fstat;
-	char	buffer[MB_PATH_MAXLINE];
-	char	*result;
-	int	read_data;
-	char	fileroot[MB_PATH_MAXLINE];
-	int	nscan;
-	int	year, month, day, hour, minute;
-	double	second, yearsecond;
-	double	easting, northing;
-	int	testformat;
-	int	type;
-	double	offset_roll, offset_pitch, offset_heading;
-	double	offset_x, offset_y, offset_z, offset_t;
-	double	lever_x, lever_y, lever_z;
-	int	i, j;
-
-	/* get current default values */
-	status = mb_defaults(verbose,&format,&pings,&lonflip,bounds,
-		btime_i,etime_i,&speedmin,&timegap);
-
-	/* set default input to datalist.mb-1 */
-	strcpy (read_file, "datalist.mb-1");
-
-	/* process argument list */
-	while ((c = getopt(argc, argv, "A:a:B:b:D:d:F:f:I:i:J:j:K:k:LlM:m:N:n:O:o:T:t:VvHh")) != -1)
-	  switch (c)
-		{
-		case 'H':
-		case 'h':
-			help++;
-			break;
-		case 'V':
-		case 'v':
-			verbose++;
-			break;
-		case 'A':
-		case 'a':
-			nscan = sscanf (optarg,"%d/%lf/%lf/%lf/%lf",
-					&type, &offset_x, &offset_y, &offset_z, &offset_t);
-			if (nscan == 5)
-				{
-				if (type == MBHYSWEEPPREPROCESS_SONAR_OFFSET_SONAR)
-					{
-					offset_sonar_x = offset_x;
-					offset_sonar_y = offset_y;
-					offset_sonar_z = offset_z;
-					offset_sonar_t = offset_t;
-					}
-				else if (type == MBHYSWEEPPREPROCESS_SONAR_OFFSET_MRU)
-					{
-					offset_mru_x = offset_x;
-					offset_mru_y = offset_y;
-					offset_mru_z = offset_z;
-					offset_mru_t = offset_t;
-					}
-				else if (type == MBHYSWEEPPREPROCESS_SONAR_OFFSET_NAVIGATION)
-					{
-					offset_nav_x = offset_x;
-					offset_nav_y = offset_y;
-					offset_nav_z = offset_z;
-					offset_nav_t = offset_t;
-					}
-				}
-			flag++;
-			break;
-		case 'B':
-		case 'b':
-			nscan = sscanf (optarg,"%lf/%lf/%lf",
-					&offset_roll, &offset_pitch, &offset_heading);
-			if (nscan == 3)
-				{
-				offset_sonar_roll = offset_roll;
-				offset_sonar_pitch = offset_pitch;
-				offset_sonar_heading = offset_heading;
-				}
-			flag++;
-			break;
-		case 'D':
-		case 'd':
-			sscanf (optarg,"%s", buffer);
-			if ((fstat = stat(buffer, &file_status)) == 0
-				&& (file_status.st_mode & S_IFMT) != S_IFDIR)
-				{
-				sonardepthdata  = MB_YES;
-				strcpy(sonardepthfile,buffer);
-				}
-			flag++;
-			break;
-		case 'F':
-		case 'f':
-			sscanf (optarg,"%d", &format);
-			flag++;
-			break;
-		case 'I':
-		case 'i':
-			sscanf (optarg,"%s", read_file);
-			flag++;
-			break;
-		case 'J':
-		case 'j':
-			sscanf (optarg,"%s", proj4command);
-			projection_set = MB_YES;
-			flag++;
-			break;
-		case 'K':
-		case 'k':
-			sscanf (optarg,"%d", &klugemode);
-			flag++;
-			break;
-		case 'L':
-		case 'l':
-			mode = MBHYSWEEPPREPROCESS_TIMESTAMPLIST;
-			flag++;
-			break;
-		case 'M':
-		case 'm':
-			sscanf (optarg,"%d", &navformat);
-			flag++;
-			break;
-		case 'N':
-		case 'n':
-			sscanf (optarg,"%s", buffer);
-			if ((fstat = stat(buffer, &file_status)) == 0
-				&& (file_status.st_mode & S_IFMT) != S_IFDIR)
-				{
-				navdata  = MB_YES;
-				strcpy(navfile,buffer);
-				}
-			flag++;
-			break;
-		case 'O':
-		case 'o':
-			sscanf (optarg,"%s", ofile);
-			ofile_set  = MB_YES;
-			flag++;
-			break;
-		case 'T':
-		case 't':
-			sscanf (optarg,"%s", timelagfile);
-			if ((fstat = stat(timelagfile, &file_status)) == 0
-				&& (file_status.st_mode & S_IFMT) != S_IFDIR)
-					{
-					timelagmode = MBHYSWEEPPREPROCESS_TIMELAG_MODEL;
-					}
-			else
-				{
-				sscanf (optarg,"%lf", &timelagconstant);
-				timelagmode = MBHYSWEEPPREPROCESS_TIMELAG_CONSTANT;
-				}
-			flag++;
-			break;
-		case '?':
-			errflg++;
-		}
-
-	/* if error flagged then print it and exit */
-	if (errflg)
-		{
-		fprintf(stderr,"usage: %s\n", usage_message);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		error = MB_ERROR_BAD_USAGE;
-		exit(error);
-		}
-
-	/* print starting message */
-	if (verbose == 1 || help)
-		{
-		fprintf(stderr,"\nProgram %s\n",program_name);
-		fprintf(stderr,"Version %s\n",rcs_id);
-		fprintf(stderr,"MB-system Version %s\n",MB_VERSION);
-		}
-
-	/* print starting debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  Program <%s>\n",program_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Control Parameters:\n");
-		fprintf(stderr,"dbg2       verbose:             %d\n",verbose);
-		fprintf(stderr,"dbg2       help:                %d\n",help);
-		fprintf(stderr,"dbg2       format:              %d\n",format);
-		fprintf(stderr,"dbg2       pings:               %d\n",pings);
-		fprintf(stderr,"dbg2       lonflip:             %d\n",lonflip);
-		fprintf(stderr,"dbg2       bounds[0]:           %f\n",bounds[0]);
-		fprintf(stderr,"dbg2       bounds[1]:           %f\n",bounds[1]);
-		fprintf(stderr,"dbg2       bounds[2]:           %f\n",bounds[2]);
-		fprintf(stderr,"dbg2       bounds[3]:           %f\n",bounds[3]);
-		fprintf(stderr,"dbg2       btime_i[0]:          %d\n",btime_i[0]);
-		fprintf(stderr,"dbg2       btime_i[1]:          %d\n",btime_i[1]);
-		fprintf(stderr,"dbg2       btime_i[2]:          %d\n",btime_i[2]);
-		fprintf(stderr,"dbg2       btime_i[3]:          %d\n",btime_i[3]);
-		fprintf(stderr,"dbg2       btime_i[4]:          %d\n",btime_i[4]);
-		fprintf(stderr,"dbg2       btime_i[5]:          %d\n",btime_i[5]);
-		fprintf(stderr,"dbg2       btime_i[6]:          %d\n",btime_i[6]);
-		fprintf(stderr,"dbg2       etime_i[0]:          %d\n",etime_i[0]);
-		fprintf(stderr,"dbg2       etime_i[1]:          %d\n",etime_i[1]);
-		fprintf(stderr,"dbg2       etime_i[2]:          %d\n",etime_i[2]);
-		fprintf(stderr,"dbg2       etime_i[3]:          %d\n",etime_i[3]);
-		fprintf(stderr,"dbg2       etime_i[4]:          %d\n",etime_i[4]);
-		fprintf(stderr,"dbg2       etime_i[5]:          %d\n",etime_i[5]);
-		fprintf(stderr,"dbg2       etime_i[6]:          %d\n",etime_i[6]);
-		fprintf(stderr,"dbg2       speedmin:            %f\n",speedmin);
-		fprintf(stderr,"dbg2       timegap:             %f\n",timegap);
-		fprintf(stderr,"dbg2       read_file:           %s\n",read_file);
-		fprintf(stderr,"dbg2       ofile:               %s\n",ofile);
-		fprintf(stderr,"dbg2       ofile_set:           %d\n",ofile_set);
-		fprintf(stderr,"dbg2       projection_set:      %d\n",projection_set);
-		fprintf(stderr,"dbg2       proj4command:        %s\n",proj4command);
-		fprintf(stderr,"dbg2       navfile:             %s\n",navfile);
-		fprintf(stderr,"dbg2       navdata:             %d\n",navdata);
-		fprintf(stderr,"dbg2       sonardepthfile:      %s\n",sonardepthfile);
-		fprintf(stderr,"dbg2       sonardepthdata:      %d\n",sonardepthdata);
-		fprintf(stderr,"dbg2       timelagmode:         %d\n",timelagmode);
-		if (timelagmode == MBHYSWEEPPREPROCESS_TIMELAG_MODEL)
-			{
-			fprintf(stderr,"dbg2       timelagfile:         %s\n",timelagfile);
-			fprintf(stderr,"dbg2       ntimelag:            %d\n",ntimelag);
-			for (i=0;i<ntimelag;i++)
-				fprintf(stderr,"dbg2       timelag[%d]:         %f %f\n",
-					i, timelag_time_d[i], timelag_model[i]);
-			}
-		else
-			{
-			fprintf(stderr,"dbg2       timelag:             %f\n",timelag);
-			}
-		fprintf(stderr,"dbg2       offset_sonar_roll:   %f\n",offset_sonar_roll);
-		fprintf(stderr,"dbg2       offset_sonar_pitch:  %f\n",offset_sonar_pitch);
-		fprintf(stderr,"dbg2       offset_sonar_heading:%f\n",offset_sonar_heading);
-		fprintf(stderr,"dbg2       offset_sonar_x:      %f\n",offset_sonar_x);
-		fprintf(stderr,"dbg2       offset_sonar_y:      %f\n",offset_sonar_y);
-		fprintf(stderr,"dbg2       offset_sonar_z:      %f\n",offset_sonar_z);
-		fprintf(stderr,"dbg2       offset_sonar_t:      %f\n",offset_sonar_t);
-		fprintf(stderr,"dbg2       offset_mru_x:        %f\n",offset_mru_x);
-		fprintf(stderr,"dbg2       offset_mru_y:        %f\n",offset_mru_y);
-		fprintf(stderr,"dbg2       offset_mru_z:        %f\n",offset_mru_z);
-		fprintf(stderr,"dbg2       offset_mru_t:        %f\n",offset_mru_t);
-		fprintf(stderr,"dbg2       offset_nav_x:        %f\n",offset_nav_x);
-		fprintf(stderr,"dbg2       offset_nav_y:        %f\n",offset_nav_y);
-		fprintf(stderr,"dbg2       offset_nav_z:        %f\n",offset_nav_z);
-		fprintf(stderr,"dbg2       offset_nav_t:        %f\n",offset_nav_t);
-		}
-
-	/* if help desired then print it and exit */
-	if (help)
-		{
-		fprintf(stderr,"\n%s\n",help_message);
-		fprintf(stderr,"\nusage: %s\n", usage_message);
-		exit(error);
-		}
-
-	/* set projection for nav data */
-	if (projection_set == MB_YES)
-		{
-		mb_proj_init(verbose, proj4command, &pjptr, &error);
-		}
-
-	/* read navigation data from file if specified */
-	if (navdata == MB_YES)
-		{
-		/* count the data points in the nav file */
-		if ((tfp = fopen(navfile, "r")) == NULL)
-			{
-			error = MB_ERROR_OPEN_FAIL;
-			fprintf(stderr,"\nUnable to open nav data file <%s> for reading\n",navfile);
-			fprintf(stderr,"\nProgram <%s> Terminated\n",
-				program_name);
-			exit(error);
-			}
-
-		/* count the data records
-			then rewind the file to the start */
-		nnav = 0;
-		while (fgets(buffer, MB_PATH_MAXLINE, tfp) != NULL)
-			{
-			nnav++;
-			}
-		rewind(tfp);
-
-		/* allocate arrays for ins data */
-		if (nnav > 0)
-		    {
-		    status = mb_mallocd(verbose, __FILE__, __LINE__, nnav * sizeof(double), (void **)&nav_time_d,&error);
-		    if (error == MB_ERROR_NO_ERROR)
-		    	status = mb_mallocd(verbose, __FILE__, __LINE__, nnav * sizeof(double), (void **)&nav_lon,&error);
-		    if (error == MB_ERROR_NO_ERROR)
-		    	status = mb_mallocd(verbose, __FILE__, __LINE__, nnav * sizeof(double), (void **)&nav_lat,&error);
-		    if (error == MB_ERROR_NO_ERROR)
-		    	status = mb_mallocd(verbose, __FILE__, __LINE__, nnav * sizeof(double), (void **)&nav_heading,&error);
-		    if (error == MB_ERROR_NO_ERROR)
-		    	status = mb_mallocd(verbose, __FILE__, __LINE__, nnav * sizeof(double), (void **)&nav_sonardepth,&error);
-		    if (error == MB_ERROR_NO_ERROR)
-		    	status = mb_mallocd(verbose, __FILE__, __LINE__, nnav * sizeof(double), (void **)&nav_altitude,&error);
-		    if (error != MB_ERROR_NO_ERROR)
-			{
-			mb_error(verbose,error,&message);
-			fprintf(stderr,"\nMBIO Error allocating nav data arrays:\n%s\n",message);
-			fprintf(stderr,"\nProgram <%s> Terminated\n",
-				program_name);
-			exit(error);
-			}
-		    }
-
-		/* if no nav data then quit */
-		else
-		    {
-		    error = MB_ERROR_BAD_DATA;
-		    fprintf(stderr,"\nUnable to read data from nav file <%s>\n",navfile);
-		    fprintf(stderr,"\nProgram <%s> Terminated\n",
-			    program_name);
-		    exit(error);
-		    }
-
-		/* read the data points in the nav file */
-		nnav = 0;
-		while (fgets(buffer, MB_PATH_MAXLINE, tfp) != NULL)
-			{
-			if (buffer[0] != '#' && buffer[0] != 'O')
-				{
-				nscan = sscanf(buffer, "%d:%d:%d:%d:%d:%lf %lf %lf %lf %lf %lf %lf",
-						&year, &month, &day, &hour, &minute, &second, &yearsecond,
-						&northing, &easting, &sonardepth, &altitude, &heading);
-				if (nscan == 12)
-					{
-					time_i[0] = year;
-					time_i[1] = month;
-					time_i[2] = day;
-					time_i[3] = hour;
-					time_i[4] = minute;
-					time_i[5] = (int)floor(second);
-					time_i[6] = (int)((second - time_i[5]) * 1000000.0);
-					mb_get_time(verbose, time_i, &time_d);
-
-					if (projection_set == MB_YES)
-						{
-						mb_proj_inverse(verbose, pjptr, easting, northing,
-									&navlon, &navlat, &error);
-						}
-					else
-						{
-						navlon = easting;
-						navlat = northing;
-						}
-
-					nav_time_d[nnav] = time_d;
-					nav_lon[nnav] = navlon;
-					nav_lat[nnav] = navlat;
-					nav_heading[nnav] = heading;
-					nav_sonardepth[nnav] = sonardepth;
-					nav_altitude[nnav] = altitude;
-					nnav++;
-					}
-				}
-			}
-		fclose(tfp);
-		}
-
-	/* set projection for nav data */
-	if (projection_set == MB_YES)
-		{
-		mb_proj_free(verbose, &pjptr, &error);
-		}
-
-	/* read sonardepth data from separate file if specified */
-	if (sonardepthdata == MB_YES)
-		{
-		/* count the data points in the sonardepth file */
-		if ((tfp = fopen(sonardepthfile, "r")) == NULL)
-			{
-			error = MB_ERROR_OPEN_FAIL;
-			fprintf(stderr,"\nUnable to open sonardepth data file <%s> for reading\n",sonardepthfile);
-			fprintf(stderr,"\nProgram <%s> Terminated\n",
-				program_name);
-			exit(error);
-			}
-
-		/* count the data records then rewind the file to the start of the binary data */
-		nsonardepth = 0;
-		while (fgets(buffer, MB_PATH_MAXLINE, tfp) != NULL)
-			{
-			nsonardepth++;
-			}
-		rewind(tfp);
-
-		/* allocate arrays for sonardepth data */
-		if (nsonardepth > 0)
-		    {
-		    status = mb_mallocd(verbose, __FILE__, __LINE__, nsonardepth * sizeof(double), (void **)&sonardepth_time_d,&error);
-		    if (error == MB_ERROR_NO_ERROR)
-		    	status = mb_mallocd(verbose, __FILE__, __LINE__, nsonardepth * sizeof(double), (void **)&sonardepth_sonardepth,&error);
-		    if (error != MB_ERROR_NO_ERROR)
-			{
-			mb_error(verbose,error,&message);
-			fprintf(stderr,"\nMBIO Error allocating sonardepth data arrays:\n%s\n",message);
-			fprintf(stderr,"\nProgram <%s> Terminated\n",
-				program_name);
-			exit(error);
-			}
-		    }
-
-		/* if no sonardepth data then quit */
-		else
-		    {
-		    error = MB_ERROR_BAD_DATA;
-		    fprintf(stderr,"\nUnable to read data from sonardepth file <%s>\n",sonardepthfile);
-		    fprintf(stderr,"\nProgram <%s> Terminated\n",
-			    program_name);
-		    exit(error);
-		    }
-
-		/* read the data points in the separate file */
-		nsonardepth = 0;
-		while (fgets(buffer, MB_PATH_MAXLINE, tfp) != NULL)
-			{
-			if (buffer[0] != '#' && buffer[0] != 'O')
-				{
-				nscan = sscanf(buffer, "%d:%d:%d:%d:%d:%lf %lf",
-						&year, &month, &day, &hour, &minute, &second,
-						&sonardepth);
-				if (nscan == 7)
-					{
-					time_i[0] = year;
-					time_i[1] = month;
-					time_i[2] = day;
-					time_i[3] = hour;
-					time_i[4] = minute;
-					time_i[5] = (int)floor(second);
-					time_i[6] = (int)((second - time_i[5]) * 1000000.0);
-					mb_get_time(verbose, time_i, &time_d);
-
-					sonardepth_time_d[nsonardepth] = time_d;
-					sonardepth_sonardepth[nsonardepth] = sonardepth;
-					nsonardepth++;
-					}
-				}
-			nsonardepth++;
-			}
-		fclose(tfp);
-		}
-
-	/* get time lag model if specified */
-	if (timelagmode == MBHYSWEEPPREPROCESS_TIMELAG_MODEL)
-		{
-		/* count the data points in the timelag file */
-		ntimelag = 0;
-		if ((tfp = fopen(timelagfile, "r")) == NULL)
-			{
-			error = MB_ERROR_OPEN_FAIL;
-			fprintf(stderr,"\nUnable to open time lag model File <%s> for reading\n",timelagfile);
-			fprintf(stderr,"\nProgram <%s> Terminated\n",
-				program_name);
-			exit(error);
-			}
-		while ((result = fgets(buffer,MB_PATH_MAXLINE,tfp)) == buffer)
-			if (buffer[0] != '#')
-			    ntimelag++;
-		rewind(tfp);
-
-		/* allocate arrays for time lag */
-		if (ntimelag > 0)
-		    {
-		    status = mb_mallocd(verbose, __FILE__, __LINE__,ntimelag * sizeof(double), (void **)&timelag_time_d,&error);
-		    if (error == MB_ERROR_NO_ERROR)
-		    	status = mb_mallocd(verbose, __FILE__, __LINE__,ntimelag * sizeof(double), (void **)&timelag_model,&error);
-		    if (error != MB_ERROR_NO_ERROR)
-			{
-			mb_error(verbose,error,&message);
-			fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",message);
-			fprintf(stderr,"\nProgram <%s> Terminated\n",
-				program_name);
-			exit(error);
-			}
-		    }
-
-		/* if no time lag data then quit */
-		else
-		    {
-		    error = MB_ERROR_BAD_DATA;
-		    fprintf(stderr,"\nUnable to read data from time lag model file <%s>\n",timelagfile);
-		    fprintf(stderr,"\nProgram <%s> Terminated\n",
-			    program_name);
-		    exit(error);
-		    }
-
-		/* read the data points in the timelag file */
-		ntimelag = 0;
-		while ((result = fgets(buffer,MB_PATH_MAXLINE,tfp)) == buffer)
-		    {
-		    if (buffer[0] != '#')
-			{
-			/* read the time and time lag pair */
-			if (sscanf(buffer,"%lf %lf",&timelag_time_d[ntimelag],&timelag_model[ntimelag]) == 2)
-			    ntimelag++;
-			}
-		    }
-		fclose(tfp);
-		}
-
-	/* output counts */
-	fprintf(stdout, "\nData available for merging:\n");
-	fprintf(stdout, "     Navigation (northing easting sonardepth altitude heading): %d\n", nnav);
-	fprintf(stdout, "     Sonar depth (sonardepth):                                  %d\n", nsonardepth);
-	fprintf(stdout, "     Time lag:                                                  %d\n", ntimelag);
-	fprintf(stdout, "\nOffsets to be applied:\n");
-	fprintf(stdout, "     Roll bias:    %8.3f\n", offset_sonar_roll);
-	fprintf(stdout, "     Pitch bias:   %8.3f\n", offset_sonar_pitch);
-	fprintf(stdout, "     Heading bias: %8.3f\n", offset_sonar_heading);
-	fprintf(stdout, "               X (m)   Y (m)   Z (m)   T (sec)\n");
-	fprintf(stdout, "     Sonar: %8.3f %8.3f %8.3f %8.3f\n",
-				offset_sonar_x, offset_sonar_y,
-				offset_sonar_z, offset_sonar_t);
-	fprintf(stdout, "     MRU:   %8.3f %8.3f %8.3f %8.3f\n",
-				offset_mru_x, offset_mru_y,
-				offset_mru_z, offset_mru_t);
-	fprintf(stdout, "     Nav:   %8.3f %8.3f %8.3f %8.3f\n",
-				offset_nav_x, offset_nav_y,
-				offset_nav_z, offset_nav_t);
-
-	nrec_POS_tot = 0;
-	nrec_POSunused_tot = 0;
-	nrec_GYR_tot = 0;
-	nrec_HCP_tot = 0;
-	nrec_EC1_tot = 0;
-	nrec_DFT_tot = 0;
-	nrec_RMB_tot = 0;
-	nrec_other_tot = 0;
-
-	/* get format if required */
-	if (format == 0)
-		mb_get_format(verbose,read_file,NULL,&format,&error);
-
-	/* determine whether to read one file or a list of files */
-	if (format < 0)
-		read_datalist = MB_YES;
-
-	/* open file list */
-	if (read_datalist == MB_YES)
-	    {
-	    if ((status = mb_datalist_open(verbose,&datalist,
-					    read_file,look_processed,&error)) != MB_SUCCESS)
-		{
-		error = MB_ERROR_OPEN_FAIL;
-		fprintf(stderr,"\nUnable to open data list file: %s\n",
-			read_file);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-	    if ((status = mb_datalist_read(verbose,datalist,
-			    ifile,&format,&file_weight,&error))
-			    == MB_SUCCESS)
-		read_data = MB_YES;
-	    else
-		read_data = MB_NO;
-	    }
-	/* else copy single filename to be read */
-	else
-	    {
-	    strcpy(ifile, read_file);
-	    read_data = MB_YES;
-	    }
-
-	/* loop over all files to be read */
-	while (read_data == MB_YES && format == MBF_HYSWEEP1)
-	{
-
-	/* initialize reading the swath file */
-	if ((status = mb_read_init(
-		verbose,ifile,format,pings,lonflip,bounds,
-		btime_i,etime_i,speedmin,timegap,
-		&imbio_ptr,&btime_d,&etime_d,
-		&beams_bath,&beams_amp,&pixels_ss,&error)) != MB_SUCCESS)
-		{
-		mb_error(verbose,error,&message);
-		fprintf(stderr,"\nMBIO Error returned from function <mb_read_init>:\n%s\n",message);
-		fprintf(stderr,"\nMultibeam File <%s> not initialized for reading\n",ifile);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-
-	/* get pointers to data storage */
-	imb_io_ptr = (struct mb_io_struct *) imbio_ptr;
-	istore_ptr = imb_io_ptr->store_data;
-	istore = (struct mbsys_hysweep_struct *) istore_ptr;
-
-	/* set projection if specified */
-	if (projection_set == MB_YES)
-		{
-		strcpy(istore->PRJ_proj4_command,proj4command);
-		}
-
-	if (error == MB_ERROR_NO_ERROR)
-		{
-		beamflag = NULL;
-		bath = NULL;
-		amp = NULL;
-		bathacrosstrack = NULL;
-		bathalongtrack = NULL;
-		ss = NULL;
-		ssacrosstrack = NULL;
-		ssalongtrack = NULL;
-		}
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(char), (void **)&beamflag, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(double), (void **)&bath, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_AMPLITUDE,
-						sizeof(double), (void **)&amp, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(double), (void **)&bathacrosstrack, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(double), (void **)&bathalongtrack, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_SIDESCAN,
-						sizeof(double), (void **)&ss, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_SIDESCAN,
-						sizeof(double), (void **)&ssacrosstrack, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_SIDESCAN,
-						sizeof(double), (void **)&ssalongtrack, &error);
-
-	/* if error initializing memory then quit */
-	if (error != MB_ERROR_NO_ERROR)
-		{
-		mb_error(verbose,error,&message);
-		fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",
-			message);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-
-	/* reset file record counters */
-	nrec_POS = 0;
-	nrec_POSunused = 0;
-	nrec_GYR = 0;
-	nrec_HCP = 0;
-	nrec_EC1 = 0;
-	nrec_DFT = 0;
-	nrec_RMB = 0;
-	nrec_other = 0;
-
-	/* read and print data */
-	while (error <= MB_ERROR_NO_ERROR)
-		{
-		/* reset error */
-		error = MB_ERROR_NO_ERROR;
-
-		/* read next data record */
-		status = mb_get_all(verbose,imbio_ptr,&istore_ptr,&kind,
-				    time_i,&time_d,&navlon,&navlat,
-				    &speed,&heading,
-				    &distance,&altitude,&sonardepth,
-				    &beams_bath,&beams_amp,&pixels_ss,
-				    beamflag,bath,amp,bathacrosstrack,bathalongtrack,
-				    ss,ssacrosstrack,ssalongtrack,
-				    comment,&error);
-
-		/* some nonfatal errors do not matter */
-		if (error < MB_ERROR_NO_ERROR && error > MB_ERROR_UNINTELLIGIBLE)
-			{
-			error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-
-	   	/* handle multibeam data */
-		if (status == MB_SUCCESS && kind == MB_DATA_DATA)
-			{
-			nrec_RMB++;
-			}
-
-	   	/* save primary navigation data */
-		else if (status == MB_SUCCESS
-			&& (istore->kind == MB_DATA_NAV
-				|| istore->kind == MB_DATA_NAV1
-				|| istore->kind == MB_DATA_NAV2))
-			{
-			/* check device for being enabled */
-			device = (struct mbsys_hysweep_device_struct *)&(istore->devices[istore->POS_device_number]);
-			if (device->DV2_enabled == MB_YES)
-				{
-				nrec_POS++;
-
-				/* add latest fix */
-				if (imb_io_ptr->projection_initialized == MB_YES)
-					{
-					mb_proj_inverse(verbose, imb_io_ptr->pjptr,
-									istore->POS_x,
-									istore->POS_y,
-									&navlon, &navlat,
-									&error);
-					}
-				else
-					{
-					navlon = istore->POS_x;
-					navlat = istore->POS_y;
-					}
-
-				if (MBHYSWEEPPREPROCESS_TIMESTAMPLIST == MB_YES)
-					fprintf(stderr,"Record time: %4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d POS record:%d\n",
-						istore->time_i[0],istore->time_i[1],istore->time_i[2],
-						istore->time_i[3],istore->time_i[4],istore->time_i[5],istore->time_i[6],nrec_POS);
-
-				/* allocate memory for position arrays if needed */
-				if (ndat_nav + 1 >= ndat_nav_alloc)
-					{
-					ndat_nav_alloc +=  MBHYSWEEPPREPROCESS_ALLOC_CHUNK;
-					status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_nav_alloc*sizeof(double),(void **)&dat_nav_time_d,&error);
-					status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_nav_alloc*sizeof(double),(void **)&dat_nav_lon,&error);
-					status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_nav_alloc*sizeof(double),(void **)&dat_nav_lat,&error);
-					if (error != MB_ERROR_NO_ERROR)
-						{
-						mb_error(verbose,error,&message);
-						fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",message);
-						fprintf(stderr,"\nProgram <%s> Terminated\n",
-						    program_name);
-						exit(error);
-						}
-					}
-
-				/* store the position data */
-				if (ndat_nav == 0 || dat_nav_time_d[ndat_nav-1] < istore->time_d)
-					{
-					dat_nav_time_d[ndat_nav] = istore->time_d;
-					dat_nav_lon[ndat_nav] = navlon;
-					dat_nav_lat[ndat_nav] = navlat;
-					ndat_nav++;
-					}
-				}
-			else
-				{
-				nrec_POSunused++;
-				}
-
-			}
-
-	   	/* save primary attitude data */
-		if (status == MB_SUCCESS && kind == MB_DATA_ATTITUDE)
-			{
-			/* check device for being enabled */
-			device = (struct mbsys_hysweep_device_struct *)&(istore->devices[istore->HCP_device_number]);
-			if (device->DV2_enabled == MB_YES)
-				{
-				nrec_HCP++;
-
-
-				if (MBHYSWEEPPREPROCESS_TIMESTAMPLIST == MB_YES)
-					fprintf(stderr,"Record time: %4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d HCP record:%d\n",
-						istore->time_i[0],istore->time_i[1],istore->time_i[2],
-						istore->time_i[3],istore->time_i[4],istore->time_i[5],istore->time_i[6],nrec_HCP);
-
-				/* allocate memory for position arrays if needed */
-				if (ndat_rph + 1 >= ndat_rph_alloc)
-					{
-					ndat_rph_alloc +=  MBHYSWEEPPREPROCESS_ALLOC_CHUNK;
-					status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_rph_alloc*sizeof(double),(void **)&dat_rph_time_d,&error);
-					status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_rph_alloc*sizeof(double),(void **)&dat_rph_roll,&error);
-					status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_rph_alloc*sizeof(double),(void **)&dat_rph_pitch,&error);
-					status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_rph_alloc*sizeof(double),(void **)&dat_rph_heave,&error);
-					if (error != MB_ERROR_NO_ERROR)
-						{
-						mb_error(verbose,error,&message);
-						fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",message);
-						fprintf(stderr,"\nProgram <%s> Terminated\n",
-						    program_name);
-						exit(error);
-						}
-					}
-
-				/* store the attitude data */
-				if (ndat_rph == 0 || dat_rph_time_d[ndat_rph-1] < istore->time_d)
-					{
-					dat_rph_time_d[ndat_rph] = istore->time_d;
-					dat_rph_roll[ndat_rph] = -istore->HCP_roll;
-					dat_rph_pitch[ndat_rph] = istore->HCP_pitch;
-					dat_rph_heave[ndat_rph] = -istore->HCP_heave;
-					ndat_rph++;
-					}
-				}
-			}
-
-	   	/* save primary heading data */
-		if (status == MB_SUCCESS && kind == MB_DATA_HEADING)
-			{
-			/* check device for being enabled */
-			device = (struct mbsys_hysweep_device_struct *)&(istore->devices[istore->GYR_device_number]);
-			if (device->DV2_enabled == MB_YES)
-				{
-				nrec_GYR++;
-
-				if (MBHYSWEEPPREPROCESS_TIMESTAMPLIST == MB_YES)
-					fprintf(stderr,"Record time: %4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d GYR record:%d\n",
-						istore->time_i[0],istore->time_i[1],istore->time_i[2],
-						istore->time_i[3],istore->time_i[4],istore->time_i[5],istore->time_i[6],nrec_GYR);
-
-				/* allocate memory for position arrays if needed */
-				if (ndat_heading + 1 >= ndat_heading_alloc)
-					{
-					ndat_heading_alloc +=  MBHYSWEEPPREPROCESS_ALLOC_CHUNK;
-					status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_heading_alloc*sizeof(double),(void **)&dat_heading_time_d,&error);
-					status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_heading_alloc*sizeof(double),(void **)&dat_heading_heading,&error);
-					if (error != MB_ERROR_NO_ERROR)
-						{
-						mb_error(verbose,error,&message);
-						fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",message);
-						fprintf(stderr,"\nProgram <%s> Terminated\n",
-						    program_name);
-						exit(error);
-						}
-					}
-
-				/* store the heading data */
-				if (ndat_heading == 0 || dat_heading_time_d[ndat_heading-1] < istore->time_d)
-					{
-					dat_heading_time_d[ndat_heading] = istore->time_d;
-					dat_heading_heading[ndat_heading] = istore->GYR_heading;
-					ndat_heading++;
-					}
-				}
-			}
-
-	   	/* save primary sonardepth data */
-		if (status == MB_SUCCESS && kind == MB_DATA_SONARDEPTH)
-			{
-			/* check device for being enabled */
-			device = (struct mbsys_hysweep_device_struct *)&(istore->devices[istore->DFT_device_number]);
-			if (device->DV2_enabled == MB_YES)
-				{
-				nrec_DFT++;
-
-				if (MBHYSWEEPPREPROCESS_TIMESTAMPLIST == MB_YES)
-					fprintf(stderr,"Record time: %4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d DFT record:%d\n",
-						istore->time_i[0],istore->time_i[1],istore->time_i[2],
-						istore->time_i[3],istore->time_i[4],istore->time_i[5],istore->time_i[6],nrec_DFT);
-
-				/* allocate memory for position arrays if needed */
-				if (ndat_sonardepth + 1 >= ndat_sonardepth_alloc)
-					{
-					ndat_sonardepth_alloc +=  MBHYSWEEPPREPROCESS_ALLOC_CHUNK;
-					status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_sonardepth_alloc*sizeof(double),(void **)&dat_sonardepth_time_d,&error);
-					status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_sonardepth_alloc*sizeof(double),(void **)&dat_sonardepth_sonardepth,&error);
-					if (error != MB_ERROR_NO_ERROR)
-						{
-						mb_error(verbose,error,&message);
-						fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",message);
-						fprintf(stderr,"\nProgram <%s> Terminated\n",
-						    program_name);
-						exit(error);
-						}
-					}
-
-				/* store the sonardepth data */
-				if (ndat_sonardepth == 0 || dat_sonardepth_time_d[ndat_sonardepth-1] < istore->time_d)
-					{
-					dat_sonardepth_time_d[ndat_sonardepth] = istore->time_d;
-					dat_sonardepth_sonardepth[ndat_sonardepth] = istore->DFT_draft;
-					ndat_sonardepth++;
-					}
-				}
-			}
-
-	   	/* save primary altitude data */
-		if (status == MB_SUCCESS && kind == MB_DATA_ALTITUDE)
-			{
-			/* check device for being enabled */
-			device = (struct mbsys_hysweep_device_struct *)&(istore->devices[istore->GYR_device_number]);
-			if (device->DV2_enabled == MB_YES)
-				{
-				nrec_EC1++;
-
-				if (MBHYSWEEPPREPROCESS_TIMESTAMPLIST == MB_YES)
-					fprintf(stderr,"Record time: %4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d EC1 record:%d\n",
-						istore->time_i[0],istore->time_i[1],istore->time_i[2],
-						istore->time_i[3],istore->time_i[4],istore->time_i[5],istore->time_i[6],nrec_EC1);
-
-				/* allocate memory for position arrays if needed */
-				if (ndat_altitude + 1 >= ndat_altitude_alloc)
-					{
-					ndat_altitude_alloc +=  MBHYSWEEPPREPROCESS_ALLOC_CHUNK;
-					status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_altitude_alloc*sizeof(double),(void **)&dat_altitude_time_d,&error);
-					status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_altitude_alloc*sizeof(double),(void **)&dat_altitude_altitude,&error);
-					if (error != MB_ERROR_NO_ERROR)
-						{
-						mb_error(verbose,error,&message);
-						fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",message);
-						fprintf(stderr,"\nProgram <%s> Terminated\n",
-						    program_name);
-						exit(error);
-						}
-					}
-
-				/* store the altitude data */
-				if (ndat_altitude == 0 || dat_altitude_time_d[ndat_altitude-1] < istore->time_d)
-					{
-					dat_altitude_time_d[ndat_altitude] = istore->time_d;
-					dat_altitude_altitude[ndat_altitude] = istore->EC1_rawdepth;
-					ndat_altitude++;
-					}
-				}
-			}
-
-	   	/* handle unknown data */
-		else  if (status == MB_SUCCESS)
-			{
-/*fprintf(stderr,"DATA TYPE UNKNOWN: status:%d error:%d kind:%d\n",status,error,kind);*/
-			nrec_other++;
-			}
-
-	   	/* handle read error */
-		else
-			{
-/*fprintf(stderr,"READ FAILURE: status:%d error:%d kind:%d\n",status,error,kind);*/
-			}
-
-		/* print debug statements */
-		if (verbose >= 2)
-			{
-			fprintf(stderr,"\ndbg2  Ping read in program <%s>\n",
-				program_name);
-			fprintf(stderr,"dbg2       kind:           %d\n",kind);
-			fprintf(stderr,"dbg2       error:          %d\n",error);
-			fprintf(stderr,"dbg2       status:         %d\n",status);
-			}
-		}
-
-	/* close the swath file */
-	status = mb_close(verbose,&imbio_ptr,&error);
-
-	/* output counts */
-	fprintf(stdout, "\nData records read from: %s\n", ifile);
-	fprintf(stdout, "     Positions (POS):                   %d\n", nrec_POS);
-	fprintf(stdout, "     Positions ignored (POS):           %d\n", nrec_POSunused);
-	fprintf(stdout, "     Heading (GYR):                     %d\n", nrec_GYR);
-	fprintf(stdout, "     Attitude (HCP):                    %d\n", nrec_HCP);
-	fprintf(stdout, "     Echosounder (altitude) (EC1):      %d\n", nrec_EC1);
-	fprintf(stdout, "     Dynamic draft (DFT):               %d\n", nrec_DFT );
-	fprintf(stdout, "     Raw multibeam (RMB):               %d\n", nrec_RMB);
-	fprintf(stdout, "     Other:                             %d\n", nrec_other);
-	nrec_POS_tot += nrec_POS;
-	nrec_POSunused_tot += nrec_POSunused;
-	nrec_GYR_tot += nrec_GYR;
-	nrec_HCP_tot += nrec_HCP;
-	nrec_EC1_tot += nrec_EC1;
-	nrec_DFT_tot += nrec_DFT;
-	nrec_RMB_tot += nrec_RMB;
-	nrec_other_tot += nrec_other;
-
-	/* figure out whether and what to read next */
-        if (read_datalist == MB_YES)
-                {
-		if ((status = mb_datalist_read(verbose,datalist,
-			    ifile,&format,&file_weight,&error))
-			    == MB_SUCCESS)
-                        read_data = MB_YES;
-                else
-                        read_data = MB_NO;
-                }
-        else
-                {
-                read_data = MB_NO;
-                }
-
-	/* end loop over files in list */
-	}
-	if (read_datalist == MB_YES)
-		mb_datalist_close(verbose,&datalist,&error);
-
-	/* apply time lag to all relevant data
-		timelag value calculated either from model imported from file (timelagmode == MBHYSWEEPPREPROCESS_TIMELAG_MODEL)
-			or by a constant offset (timelagmode == MBHYSWEEPPREPROCESS_TIMELAG_CONSTANT) */
-	if (timelagmode != MBHYSWEEPPREPROCESS_TIMELAG_OFF)
-		{
-		/* correct time of navigation, heading, attitude, sonardepth, altitude
-			read from asynchronous records in files */
-fprintf(stderr,"Applying timelag to %d nav data\n", ndat_nav);
-		j = 0;
-		for (i=0;i<ndat_nav;i++)
-			{
-			/* get timelag value */
-			timelag = offset_nav_t;
-			if (timelagmode == MBHYSWEEPPREPROCESS_TIMELAG_CONSTANT)
-				{
-				timelag -= timelagconstant;
-				}
-			else if (timelagmode == MBHYSWEEPPREPROCESS_TIMELAG_MODEL && ntimelag > 0)
-				{
-				interp_status = mb_linear_interp(verbose,
-							timelag_time_d-1, timelag_model-1,
-							ntimelag, dat_nav_time_d[i], &timelagm, &j,
-							&error);
-				timelag -= timelagm;
-				}
-			dat_nav_time_d[i] += timelag;
-			}
-fprintf(stderr,"Applying timelag to %d heading data\n", ndat_heading);
-		j = 0;
-		for (i=0;i<ndat_heading;i++)
-			{
-			/* get timelag value */
-			timelag = offset_nav_t;
-			if (timelagmode == MBHYSWEEPPREPROCESS_TIMELAG_CONSTANT)
-				{
-				timelag -= timelagconstant;
-				}
-			else if (timelagmode == MBHYSWEEPPREPROCESS_TIMELAG_MODEL && ntimelag > 0)
-				{
-				interp_status = mb_linear_interp(verbose,
-							timelag_time_d-1, timelag_model-1,
-							ntimelag, dat_heading_time_d[i], &timelagm, &j,
-							&error);
-				timelag -= timelagm;
-				}
-			dat_heading_time_d[i] += timelag;
-			}
-fprintf(stderr,"Applying timelag to %d attitude data\n", ndat_rph);
-		j = 0;
-		for (i=0;i<ndat_rph;i++)
-			{
-			/* get timelag value */
-			timelag = offset_mru_t;
-			if (timelagmode == MBHYSWEEPPREPROCESS_TIMELAG_CONSTANT)
-				{
-				timelag -= timelagconstant;
-				}
-			else if (timelagmode == MBHYSWEEPPREPROCESS_TIMELAG_MODEL && ntimelag > 0)
-				{
-				interp_status = mb_linear_interp(verbose,
-							timelag_time_d-1, timelag_model-1,
-							ntimelag, dat_rph_time_d[i], &timelagm, &j,
-							&error);
-				timelag -= timelagm;
-				}
-			dat_rph_time_d[i] += timelag;
-			}
-fprintf(stderr,"Applying timelag to %d sonardepth data\n", ndat_sonardepth);
-		j = 0;
-		for (i=0;i<ndat_sonardepth;i++)
-			{
-			/* get timelag value */
-			timelag = offset_nav_t;
-			if (timelagmode == MBHYSWEEPPREPROCESS_TIMELAG_CONSTANT)
-				{
-				timelag -= timelagconstant;
-				}
-			else if (timelagmode == MBHYSWEEPPREPROCESS_TIMELAG_MODEL && ntimelag > 0)
-				{
-				interp_status = mb_linear_interp(verbose,
-							timelag_time_d-1, timelag_model-1,
-							ntimelag, dat_sonardepth_time_d[i], &timelagm, &j,
-							&error);
-				timelag -= timelagm;
-				}
-			dat_sonardepth_time_d[i] += timelag;
-			}
-fprintf(stderr,"Applying timelag to %d altitude data\n", ndat_altitude);
-		j = 0;
-		for (i=0;i<ndat_altitude;i++)
-			{
-			/* get timelag value */
-			timelag = offset_nav_t;
-			if (timelagmode == MBHYSWEEPPREPROCESS_TIMELAG_CONSTANT)
-				{
-				timelag -= timelagconstant;
-				}
-			else if (timelagmode == MBHYSWEEPPREPROCESS_TIMELAG_MODEL && ntimelag > 0)
-				{
-				interp_status = mb_linear_interp(verbose,
-							timelag_time_d-1, timelag_model-1,
-							ntimelag, dat_altitude_time_d[i], &timelagm, &j,
-							&error);
-				timelag -= timelagm;
-				}
-			dat_altitude_time_d[i] += timelag;
-			}
-
-		/* correct time of nav data read from separate file */
-fprintf(stderr,"Applying timelag to %d INS data\n", nnav);
-		for (i=0;i<nnav;i++)
-			{
-			/* get timelag value */
-			timelag = offset_mru_t;
-			if (timelagmode == MBHYSWEEPPREPROCESS_TIMELAG_CONSTANT)
-				{
-				timelag -= timelagconstant;
-				}
-			else if (timelagmode == MBHYSWEEPPREPROCESS_TIMELAG_MODEL && ntimelag > 0)
-				{
-				interp_status = mb_linear_interp(verbose,
-							timelag_time_d-1, timelag_model-1,
-							ntimelag, nav_time_d[i], &timelagm, &j,
-							&error);
-				timelag -= timelagm;
-				}
-			nav_time_d[i] += timelag;
-			}
-
-		/* correct time of sonar depth data read from separate file */
-fprintf(stderr,"Applying timelag to %d sonardepth nav data\n", nsonardepth);
-		for (i=0;i<nsonardepth;i++)
-			{
-			/* get timelag value */
-			timelag = offset_nav_t;
-			if (timelagmode == MBHYSWEEPPREPROCESS_TIMELAG_CONSTANT)
-				{
-				timelag -= timelagconstant;
-				}
-			else if (timelagmode == MBHYSWEEPPREPROCESS_TIMELAG_MODEL && ntimelag > 0)
-				{
-				interp_status = mb_linear_interp(verbose,
-							timelag_time_d-1, timelag_model-1,
-							ntimelag, sonardepth_time_d[i], &timelagm, &j,
-							&error);
-				timelag -= timelagm;
-				}
-			sonardepth_time_d[i] += timelag;
-			}
-		}
-
-	/* apply roll bias */
-	if (offset_sonar_roll != 0.0)
-		{
-		for (i=0;i<ndat_rph;i++)
-			{
-			dat_rph_roll[i] += offset_sonar_roll;
-			}
-		}
-
-	/* apply pitch bias */
-	if (offset_sonar_pitch != 0.0)
-		{
-		for (i=0;i<ndat_rph;i++)
-			{
-			dat_rph_pitch[i] += offset_sonar_pitch;
-			}
-		}
-
-	/* apply heading bias */
-	if (offset_sonar_heading != 0.0)
-		{
-		for (i=0;i<ndat_heading;i++)
-			{
-			dat_heading_heading[i] += offset_sonar_heading;
-			if (dat_heading_heading[i] >= 360.0)
-				dat_heading_heading[i] -= 360.0;
-			else if (dat_heading_heading[i] < 0.0)
-				dat_heading_heading[i] += 360.0;
-			}
-		for (i=0;i<nnav;i++)
-			{
-			nav_heading[i] += offset_sonar_heading;
-			if (nav_heading[i] >= 360.0)
-				nav_heading[i] -= 360.0;
-			else if (nav_heading[i] < 0.0)
-				nav_heading[i] += 360.0;
-			}
-		}
-
-	/* output navigation data */
-	if (nnav > 0 && (verbose > 0 || mode == MBHYSWEEPPREPROCESS_TIMESTAMPLIST))
-		fprintf(stdout, "\nTotal navigation data read: %d\n", nnav);
-	if (nnav > 0 && (mode == MBHYSWEEPPREPROCESS_TIMESTAMPLIST))
-		{
-		fprintf(stdout, "\nTotal navigation data read: %d\n", nnav);
-		for (i=0;i<nnav;i++)
-			{
-			fprintf(stdout, "  NAVIGATION: %12d %17.6f %11.6f %10.6f %8.3f %7.3f %6.3f\n",
-				i, nav_time_d[i], nav_lon[i], nav_lat[i], nav_heading[i],
-				nav_sonardepth[i], nav_altitude[i]);
-			}
-		}
-
-	/* output sonardepth data */
-	if (nsonardepth > 0 && (verbose >= 0 || mode == MBHYSWEEPPREPROCESS_TIMESTAMPLIST))
-		fprintf(stdout, "\nTotal sonardepth data read: %d\n", nsonardepth);
-	if (nsonardepth > 0 && (mode == MBHYSWEEPPREPROCESS_TIMESTAMPLIST))
-		{
-		fprintf(stdout, "\nTotal sonardepth data read: %d\n", nsonardepth);
-		for (i=0;i<nnav;i++)
-			{
-			fprintf(stdout, "  SONARDEPTH: %12d %8.3f %8.3f\n",
-				i, sonardepth_time_d[i], sonardepth_sonardepth[i]);
-			}
-		}
-
-	/* output asynchronous navigation and attitude data */
-	if (verbose > 0 || mode == MBHYSWEEPPREPROCESS_TIMESTAMPLIST)
-		fprintf(stdout, "\nTotal navigation data read: %d\n", ndat_nav);
-	if (mode == MBHYSWEEPPREPROCESS_TIMESTAMPLIST)
-		for (i=0;i<ndat_nav;i++)
-			{
-			fprintf(stdout, "  NAV: %5d %17.6f %11.6f %10.6f\n",
-				i, dat_nav_time_d[i], dat_nav_lon[i], dat_nav_lat[i]);
-			}
-	if (verbose > 0 || mode == MBHYSWEEPPREPROCESS_TIMESTAMPLIST)
-		fprintf(stdout, "\nTotal heading data read: %d\n", ndat_heading);
-	if (mode == MBHYSWEEPPREPROCESS_TIMESTAMPLIST)
-		for (i=0;i<ndat_heading;i++)
-			{
-			fprintf(stdout, "  HDG: %5d %17.6f %8.3f\n",
-				i, dat_heading_time_d[i], dat_heading_heading[i]);
-			}
-	if (verbose > 0 || mode == MBHYSWEEPPREPROCESS_TIMESTAMPLIST)
-		fprintf(stdout, "\nTotal sonardepth data read: %d\n", ndat_sonardepth);
-	if (mode == MBHYSWEEPPREPROCESS_TIMESTAMPLIST)
-		for (i=0;i<ndat_sonardepth;i++)
-			{
-			fprintf(stdout, "  DEP: %5d %17.6f %8.3f\n",
-				i, dat_sonardepth_time_d[i], dat_sonardepth_sonardepth[i]);
-			}
-	if (verbose > 0 || mode == MBHYSWEEPPREPROCESS_TIMESTAMPLIST)
-		fprintf(stdout, "\nTotal altitude data read: %d\n", ndat_altitude);
-	if (mode == MBHYSWEEPPREPROCESS_TIMESTAMPLIST)
-		for (i=0;i<ndat_altitude;i++)
-			{
-			fprintf(stdout, "  ALT: %5d %17.6f %8.3f\n",
-				i, dat_altitude_time_d[i], dat_altitude_altitude[i]);
-			}
-	if (verbose > 0 || mode == MBHYSWEEPPREPROCESS_TIMESTAMPLIST)
-		fprintf(stdout, "\nTotal attitude data read: %d\n", ndat_rph);
-	if (mode == MBHYSWEEPPREPROCESS_TIMESTAMPLIST)
-		for (i=0;i<ndat_rph;i++)
-			{
-			fprintf(stdout, "  HCP: %5d %17.6f %8.3f %8.3f %8.3f\n",
-				i, dat_rph_time_d[i], dat_rph_roll[i], dat_rph_pitch[i], dat_rph_heave[i]);
-			}
-
-	/* output counts */
-	fprintf(stdout, "\nTotal data records read from: %s\n", read_file);
-	fprintf(stdout, "     Positions (POS):                   %d\n", nrec_POS_tot);
-	fprintf(stdout, "     Positions ignored (POS):           %d\n", nrec_POSunused_tot);
-	fprintf(stdout, "     Heading (GYR):                     %d\n", nrec_GYR_tot);
-	fprintf(stdout, "     Attitude (HCP):                    %d\n", nrec_HCP_tot);
-	fprintf(stdout, "     Echosounder (altitude) (EC1):      %d\n", nrec_EC1_tot);
-	fprintf(stdout, "     Dynamic draft (DFT):               %d\n", nrec_DFT_tot);
-	fprintf(stdout, "     Raw multibeam (RMB):               %d\n", nrec_RMB_tot);
-	fprintf(stdout, "     Other:                             %d\n", nrec_other_tot);
-	nrec_POS_tot = 0;
-	nrec_POSunused_tot = 0;
-	nrec_GYR_tot = 0;
-	nrec_HCP_tot = 0;
-	nrec_EC1_tot = 0;
-	nrec_DFT_tot = 0;
-	nrec_RMB_tot = 0;
-	nrec_other_tot = 0;
-
-	/* now read the data files again, this time interpolating nav and attitude
-		into the multibeam records and fixing other problems found in the
-		data */
-	if (mode == MBHYSWEEPPREPROCESS_PROCESS)
-	{
-
-	/* open file list */
-	if (read_datalist == MB_YES)
-	    {
-	    if ((status = mb_datalist_open(verbose,&datalist,
-					    read_file,look_processed,&error)) != MB_SUCCESS)
-		{
-		error = MB_ERROR_OPEN_FAIL;
-		fprintf(stderr,"\nUnable to open data list file: %s\n",
-			read_file);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-	    if ((status = mb_datalist_read(verbose,datalist,
-			    ifile,&format,&file_weight,&error))
-			    == MB_SUCCESS)
-		read_data = MB_YES;
-	    else
-		read_data = MB_NO;
-	    }
-	/* else copy single filename to be read */
-	else
-	    {
-	    strcpy(ifile, read_file);
-	    read_data = MB_YES;
-	    }
-
-	/* loop over all files to be read */
-	while (read_data == MB_YES && format == MBF_HYSWEEP1)
-	{
-	/* figure out the output file name */
-	status = mb_get_format(verbose, ifile, fileroot, &testformat, &error);
-	if (testformat == MBF_HYSWEEP1
-		&& strncmp(".HSX",&ifile[strlen(ifile)-4],4) == 0)
-		sprintf(ofile, "%s.mb%d", fileroot, testformat);
-	else if (testformat == MBF_HYSWEEP1
-		&& strncmp(".hsx",&ifile[strlen(ifile)-4],4) == 0)
-		sprintf(ofile, "%s.mb%d", fileroot, testformat);
-	else if (testformat == MBF_HYSWEEP1)
-		sprintf(ofile, "%s.mb%d", ifile, testformat);
-
-	/* initialize reading the input swath file */
-	if ((status = mb_read_init(
-		verbose,ifile,format,pings,lonflip,bounds,
-		btime_i,etime_i,speedmin,timegap,
-		&imbio_ptr,&btime_d,&etime_d,
-		&beams_bath,&beams_amp,&pixels_ss,&error)) != MB_SUCCESS)
-		{
-		mb_error(verbose,error,&message);
-		fprintf(stderr,"\nMBIO Error returned from function <mb_read_init>:\n%s\n",message);
-		fprintf(stderr,"\nMultibeam File <%s> not initialized for reading\n",ifile);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-
-	/* initialize writing the output swath sonar file */
-	if ((status = mb_write_init(
-		verbose,ofile,format,&ombio_ptr,
-		&obeams_bath,&obeams_amp,&opixels_ss,&error)) != MB_SUCCESS)
-		{
-		mb_error(verbose,error,&message);
-		fprintf(stderr,"\nMBIO Error returned from function <mb_write_init>:\n%s\n",message);
-		fprintf(stderr,"\nMultibeam File <%s> not initialized for writing\n",ofile);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-
-	/* get pointers to data storage */
-	imb_io_ptr = (struct mb_io_struct *) imbio_ptr;
-	istore_ptr = imb_io_ptr->store_data;
-	istore = (struct mbsys_hysweep_struct *) istore_ptr;
-
-	/* set projection if specified */
-	if (projection_set == MB_YES)
-		{
-		strcpy(istore->PRJ_proj4_command,proj4command);
-		}
-
-	if (error == MB_ERROR_NO_ERROR)
-		{
-		beamflag = NULL;
-		bath = NULL;
-		amp = NULL;
-		bathacrosstrack = NULL;
-		bathalongtrack = NULL;
-		ss = NULL;
-		ssacrosstrack = NULL;
-		ssalongtrack = NULL;
-		}
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(char), (void **)&beamflag, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(double), (void **)&bath, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_AMPLITUDE,
-						sizeof(double), (void **)&amp, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(double), (void **)&bathacrosstrack, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(double), (void **)&bathalongtrack, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_SIDESCAN,
-						sizeof(double), (void **)&ss, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_SIDESCAN,
-						sizeof(double), (void **)&ssacrosstrack, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_SIDESCAN,
-						sizeof(double), (void **)&ssalongtrack, &error);
-
-	/* if error initializing memory then quit */
-	if (error != MB_ERROR_NO_ERROR)
-		{
-		mb_error(verbose,error,&message);
-		fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",
-			message);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-
-	/* reset file record counters */
-	nrec_POS = 0;
-	nrec_POSunused = 0;
-	nrec_GYR = 0;
-	nrec_HCP = 0;
-	nrec_EC1 = 0;
-	nrec_DFT = 0;
-	nrec_RMB = 0;
-	nrec_other = 0;
-
-	/* read and write data */
-	while (error <= MB_ERROR_NO_ERROR)
-		{
-		/* reset error */
-		status = MB_SUCCESS;
-		error = MB_ERROR_NO_ERROR;
-
-		/* read next data record */
-		status = mb_get_all(verbose,imbio_ptr,&istore_ptr,&kind,
-				    time_i,&time_d,&navlon,&navlat,
-				    &speed,&heading,
-				    &distance,&altitude,&sonardepth,
-				    &beams_bath,&beams_amp,&pixels_ss,
-				    beamflag,bath,amp,bathacrosstrack,bathalongtrack,
-				    ss,ssacrosstrack,ssalongtrack,
-				    comment,&error);
-
-		/* some nonfatal errors do not matter */
-		if (error < MB_ERROR_NO_ERROR && error > MB_ERROR_UNINTELLIGIBLE)
-			{
-			error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-
-	   	/* handle multibeam data */
-		if (status == MB_SUCCESS && kind == MB_DATA_DATA)
-			{
-			nrec_RMB++;
-
-			/* print debug statements */
-			if (verbose >= 4)
-				{
-				fprintf(stderr,"\ndbg4  Multibeam bathymetry read in by MB-System program <%s>\n",program_name);
-				fprintf(stderr,"dbg4       RMB_device_number:                 %d\n", istore->RMB_device_number);
-				fprintf(stderr,"dbg4       RMB_time:                          %f\n", istore->RMB_time);
-				fprintf(stderr,"dbg4       RMB_sonar_type:                    %x\n", istore->RMB_sonar_type);
-				fprintf(stderr,"dbg4       RMB_sonar_flags:                   %x\n", istore->RMB_sonar_flags);
-				fprintf(stderr,"dbg4       RMB_beam_data_available:           %x\n", istore->RMB_beam_data_available);
-				fprintf(stderr,"dbg4       RMB_num_beams:                     %d\n", istore->RMB_num_beams);
-				fprintf(stderr,"dbg4       RMB_num_beams_alloc:               %d\n", istore->RMB_num_beams_alloc);
-				fprintf(stderr,"dbg4       RMB_sound_velocity:                %f\n", istore->RMB_sound_velocity);
-				fprintf(stderr,"dbg4       RMB_ping_number:                   %d\n", istore->RMB_ping_number);
-				for (i=0;i<istore->RMB_num_beams;i++)
-					{
-					fprintf(stderr,"dbg4       beam:%4d", i);
-
-					if (istore->RMB_beam_data_available & 0x0001)
-					fprintf(stderr," mbrng:%f", istore->RMB_beam_ranges[i]);
-
-					if (istore->RMB_beam_data_available & 0x0002)
-					fprintf(stderr," mtrng:%f", istore->RMB_multi_ranges[i]);
-
-					if (istore->RMB_beam_data_available & 0x0004)
-					fprintf(stderr," est:%f", istore->RMB_sounding_eastings[i]);
-
-					if (istore->RMB_beam_data_available & 0x0004)
-					fprintf(stderr," nor:%f", istore->RMB_sounding_northings[i]);
-
-					if (istore->RMB_beam_data_available & 0x0008)
-					fprintf(stderr," dep:%f", istore->RMB_sounding_depths[i]);
-
-					if (istore->RMB_beam_data_available & 0x0010)
-					fprintf(stderr," ltr:%f", istore->RMB_sounding_along[i]);
-
-					if (istore->RMB_beam_data_available & 0x0020)
-					fprintf(stderr," atr:%f", istore->RMB_sounding_across[i]);
-
-					if (istore->RMB_beam_data_available & 0x0040)
-					fprintf(stderr," pth:%f", istore->RMB_sounding_pitchangles[i]);
-
-					if (istore->RMB_beam_data_available & 0x0080)
-					fprintf(stderr," rll:%f", istore->RMB_sounding_rollangles[i]);
-
-					if (istore->RMB_beam_data_available & 0x0100)
-					fprintf(stderr," toa:%f", istore->RMB_sounding_takeoffangles[i]);
-
-					if (istore->RMB_beam_data_available & 0x0200)
-					fprintf(stderr," azi:%f", istore->RMB_sounding_azimuthalangles[i]);
-
-					if (istore->RMB_beam_data_available & 0x0400)
-					fprintf(stderr," tim:%d", istore->RMB_sounding_timedelays[i]);
-
-					if (istore->RMB_beam_data_available & 0x0800)
-					fprintf(stderr," int:%d", istore->RMB_sounding_intensities[i]);
-
-					if (istore->RMB_beam_data_available & 0x1000)
-					fprintf(stderr," qua:%d", istore->RMB_sounding_quality[i]);
-
-					if (istore->RMB_beam_data_available & 0x2000)
-					fprintf(stderr," flg:%d", istore->RMB_sounding_flags[i]);
-
-					fprintf(stderr,"\n");
-					}
-				}
-
-			/* merge navigation from best available source */
-			if (nnav > 0)
-				{
-				interp_status = mb_linear_interp_longitude(verbose,
-							nav_time_d-1, nav_lon-1,
-							nnav, time_d, &navlon, &j,
-							&error);
-				if (interp_status == MB_SUCCESS)
-				interp_status = mb_linear_interp_latitude(verbose,
-							nav_time_d-1, nav_lat-1,
-							nnav, time_d, &navlat, &j,
-							&error);
-				}
-			else if (ndat_nav > 0)
-				{
-				interp_status = mb_linear_interp_longitude(verbose,
-							dat_nav_time_d-1, dat_nav_lon-1,
-							ndat_nav, time_d, &navlon, &j,
-							&error);
-				if (interp_status == MB_SUCCESS)
-				interp_status = mb_linear_interp_latitude(verbose,
-							dat_nav_time_d-1, dat_nav_lat-1,
-							ndat_nav, time_d, &navlat, &j,
-							&error);
-				}
-			else
-				{
-				navlon = 0.0;
-				navlat = 0.0;
-				speed = 0.0;
-				}
-
-			/* merge heading from best available source */
-			if (nnav > 0)
-				{
-				interp_status = mb_linear_interp_heading(verbose,
-							nav_time_d-1, nav_heading-1,
-							nnav, time_d, &heading, &j,
-							&error);
-				}
-			else if (ndat_heading > 0)
-				{
-				interp_status = mb_linear_interp_heading(verbose,
-							dat_heading_time_d-1, dat_heading_heading-1,
-							ndat_heading, time_d, &heading, &j,
-							&error);
-				}
-			else
-				{
-				heading = 0.0;
-				}
-			if (heading < 0.0)
-				heading += 360.0;
-			else if (heading >= 360.0)
-				heading -= 360.0;
-
-			/* merge sonardepth from best available source */
-			if (nsonardepth > 0)
-				{
-				interp_status = mb_linear_interp(verbose,
-							sonardepth_time_d-1, sonardepth_sonardepth-1,
-							nsonardepth, time_d, &sonardepth, &j,
-							&error);
-				}
-			else if (nnav > 0)
-				{
-				interp_status = mb_linear_interp(verbose,
-							nav_time_d-1, nav_sonardepth-1,
-							nnav, time_d, &sonardepth, &j,
-							&error);
-				}
-			else if (ndat_sonardepth > 0)
-				{
-				interp_status = mb_linear_interp(verbose,
-							dat_sonardepth_time_d-1, dat_sonardepth_sonardepth-1,
-							ndat_sonardepth, time_d, &sonardepth, &j,
-							&error);
-				}
-			else
-				{
-				sonardepth = 0.0;
-				}
-
-			/* merge altitude from best available source */
-			if (nnav > 0)
-				{
-				interp_status = mb_linear_interp(verbose,
-							nav_time_d-1, nav_altitude-1,
-							nnav, time_d, &altitude, &j,
-							&error);
-				}
-			else if (ndat_altitude > 0)
-				{
-				interp_status = mb_linear_interp(verbose,
-							dat_altitude_time_d-1, dat_altitude_altitude-1,
-							ndat_altitude, time_d, &altitude, &j,
-							&error);
-				}
-			else
-				{
-				altitude = 0.0;
-				}
-
-			/* get attitude from best available source */
-			if (ndat_rph > 0)
-				{
-				interp_status = mb_linear_interp(verbose,
-							dat_rph_time_d-1, dat_rph_roll-1,
-							ndat_rph, time_d, &roll, &j,
-							&error);
-				if (interp_status == MB_SUCCESS)
-				interp_status = mb_linear_interp(verbose,
-							dat_rph_time_d-1, dat_rph_pitch-1,
-							ndat_rph, time_d, &pitch, &j,
-							&error);
-				}
-			else
-				{
-				roll = 0.0;
-				pitch = 0.0;
-				}
-
-			/* do lever arm calculation with sensor offsets */
-			mb_lever(verbose, offset_sonar_x, offset_sonar_y, offset_sonar_z,
-					offset_mru_x, offset_mru_y, offset_mru_z,
-					offset_nav_x, offset_nav_y, offset_nav_z,
-					roll, pitch,
-					&lever_x, &lever_y, &lever_z, &error);
-
-			/* set values at sonar ping time */
-			istore->RMBint_lon = navlon;
-			istore->RMBint_lat = navlat;
-			if (imb_io_ptr->projection_initialized == MB_YES)
-				{
-				mb_proj_forward(verbose, imb_io_ptr->pjptr,
-								istore->RMBint_lon,
-								istore->RMBint_lat,
-								&(istore->RMBint_x),
-								&(istore->RMBint_y),
-								&error);
-				}
-			else
-				{
-				istore->RMBint_x = istore->RMBint_lon;
-				istore->RMBint_y = istore->RMBint_lat;
-				}
-			istore->RMBint_heave = 0.0;
-			istore->RMBint_roll = roll;
-			istore->RMBint_pitch = pitch;
-			istore->RMBint_heading = heading;
-			istore->RMBint_draft = sonardepth - lever_z;
-
-			/* get mapping sonar device pointer */
-			device = (struct mbsys_hysweep_device_struct *)&(istore->devices[istore->RMB_device_number]);
-
-			/* deal with case of multibeam sonar - recalculate bathymetry if possible */
-			if (istore->RMB_beam_data_available & 0x0001)
-				{
-				/* handle data that starts with beam angles in roll and pitch coordinates */
-				if (istore->RMB_sonar_type == 1 || istore->RMB_sonar_type == 2)
-					{
-					/* get beam roll angles from sonar parameters if necessary */
-					if (!(istore->RMB_beam_data_available & 0x0080))
-						{
-						for (i=0;i<istore->RMB_num_beams;i++)
-							{
-							istore->RMB_sounding_rollangles[i]
-								= device->MBI_first_beam_angle + i * device->MBI_angle_increment;
-							}
-						istore->RMB_beam_data_available = istore->RMB_beam_data_available | 0x0080;
-						}
-
-					/* set zero beam pitch angles if necessary */
-					if (!(istore->RMB_beam_data_available & 0x0040))
-						{
-						for (i=0;i<istore->RMB_num_beams;i++)
-							{
-							istore->RMB_sounding_pitchangles[i] = 0.0;
-							}
-						istore->RMB_beam_data_available = istore->RMB_beam_data_available | 0x0040;
-						}
-
-					/* get beam takeoff and azimuthal angles */
-					for (i=0;i<istore->RMB_num_beams;i++)
-						{
-						alpha = istore->RMB_sounding_pitchangles[i];
-						beta = 90.0 + istore->RMB_sounding_rollangles[i];
-
-						/* correct alpha for pitch if necessary */
-						if (!(device->MBI_sonar_flags & 0x0002))
-							alpha += istore->RMBint_pitch;
-
-						/* correct beta for roll if necessary */
-						if (!(device->MBI_sonar_flags & 0x0001))
-							beta -= istore->RMBint_roll;
-
-						mb_rollpitch_to_takeoff(
-							verbose,
-							alpha, beta,
-							&theta, &phi,
-							&error);
-						istore->RMB_sounding_takeoffangles[i] = theta;
-						istore->RMB_sounding_azimuthalangles[i] = 90.0 - phi;
-						}
-					istore->RMB_beam_data_available = istore->RMB_beam_data_available | 0x0300;
-					}
-
-				/* recalculate beam bathymetry if beam takeoff and azimuthal angles are available */
-				if ((istore->RMB_beam_data_available & 0x0300))
-					{
-					for (i=0;i<istore->RMB_num_beams;i++)
-						{
-						rr = istore->RMB_beam_ranges[i];
-						theta = istore->RMB_sounding_takeoffangles[i];
-						phi = 90.0 - istore->RMB_sounding_azimuthalangles[i];
-						xx = rr * sin(DTR * theta);
-						zz = rr * cos(DTR * theta);
-						istore->RMB_sounding_across[i] = xx * cos(DTR * phi);
-						istore->RMB_sounding_along[i] = xx * sin(DTR * phi);
-						istore->RMB_sounding_depths[i] = zz + istore->RMBint_draft - istore->RMBint_heave;
-						}
-					istore->RMB_beam_data_available = istore->RMB_beam_data_available | 0x0038;
-					}
-
-				/* get beam flags if necessary */
-				if (!(istore->RMB_beam_data_available & 0x2000))
-					{
-					for (i=0;i<istore->RMB_num_beams;i++)
-						{
-						istore->RMB_sounding_flags[i] = MB_FLAG_NONE;
-						}
-					istore->RMB_beam_data_available = istore->RMB_beam_data_available | 0x2000;
-
-					/* incorporate quality values */
-					if ((istore->RMB_beam_data_available & 0x1000)
-						&& strncmp(device->DEV_device_name, "Reson Seabat 8", 14) == 0)
-						{
-						for (i=0;i<istore->RMB_num_beams;i++)
-							{
-							if (istore->RMB_sounding_quality[i] < 2)
-								istore->RMB_sounding_flags[i] = MB_FLAG_FLAG + MB_FLAG_SONAR;
-							}
-						}
-
-					/* check for null ranges */
-					if ((istore->RMB_beam_data_available & 0x0001))
-						{
-						for (i=0;i<istore->RMB_num_beams;i++)
-							{
-							if (istore->RMB_beam_ranges[i] <= 0.0)
-								istore->RMB_sounding_flags[i] = MB_FLAG_FLAG + MB_FLAG_SONAR;
-							}
-						}
-					}
-				}
-
-			/* deal with case of multiple transducer sonar */
-			if (istore->RMB_beam_data_available & 0x0002)
-				{
-				/* get beam roll angles if necessary */
-				if (!(istore->RMB_beam_data_available & 0x0080))
-					{
-					for (i=0;i<istore->RMB_num_beams;i++)
-						{
-						istore->RMB_sounding_rollangles[i] = 0.0;
-						}
-					istore->RMB_beam_data_available = istore->RMB_beam_data_available | 0x0080;
-					}
-
-				/* correct beam roll angles for roll if necessary */
-				if (!(device->MBI_sonar_flags & 0x0001))
-					{
-					for (i=0;i<istore->RMB_num_beams;i++)
-						{
-						istore->RMB_sounding_rollangles[i] += istore->RMBint_roll;
-						}
-					}
-
-				/* get beam pitch angles if necessary */
-				if (!(istore->RMB_beam_data_available & 0x0040))
-					{
-					if (!(device->MBI_sonar_flags & 0x0002))
-						{
-						for (i=0;i<istore->RMB_num_beams;i++)
-							{
-							istore->RMB_sounding_pitchangles[i] = istore->RMBint_pitch;
-							}
-						}
-					else
-						{
-						for (i=0;i<istore->RMB_num_beams;i++)
-							{
-							istore->RMB_sounding_pitchangles[i] = 0.0;
-							}
-						}
-					istore->RMB_beam_data_available = istore->RMB_beam_data_available | 0x0040;
-					}
-
-				/* get beam takeoff and azimuthal angles if necessary */
-				if (!(istore->RMB_beam_data_available & 0x0100)
-					|| !(istore->RMB_beam_data_available & 0x0200))
-					{
-					for (i=0;i<istore->RMB_num_beams;i++)
-						{
-						alpha = istore->RMB_sounding_pitchangles[i];
-						beta = 90.0 - istore->RMB_sounding_rollangles[i];
-						mb_rollpitch_to_takeoff(
-							verbose,
-							alpha, beta,
-							&theta, &phi,
-							&error);
-						istore->RMB_sounding_takeoffangles[i] = theta;
-						istore->RMB_sounding_azimuthalangles[i] = 90.0 - phi;
-						}
-					istore->RMB_beam_data_available = istore->RMB_beam_data_available | 0x0300;
-					}
-
-				/* get beam bathymetry if necessary */
-				if (!(istore->RMB_beam_data_available & 0x0004)
-					|| !(istore->RMB_beam_data_available & 0x0008)
-					|| !(istore->RMB_beam_data_available & 0x0010)
-					|| !(istore->RMB_beam_data_available & 0x0020))
-					{
-					for (i=0;i<istore->RMB_num_beams;i++)
-						{
-						rr = istore->RMB_multi_ranges[i];
-						theta = istore->RMB_sounding_takeoffangles[i];
-						phi = 90.0 - istore->RMB_sounding_azimuthalangles[i];
-						xx = rr * sin(DTR * theta);
-						zz = rr * cos(DTR * theta);
-						istore->RMB_sounding_across[i] = xx * cos(DTR * phi);
-						istore->RMB_sounding_along[i] = xx * sin(DTR * phi);
-						istore->RMB_sounding_depths[i] = zz + istore->RMBint_draft - istore->RMBint_heave;
-						}
-					istore->RMB_beam_data_available = istore->RMB_beam_data_available | 0x003C;
-					}
-
-				/* get beam flags if necessary */
-				if (!(istore->RMB_beam_data_available & 0x2000))
-					{
-					for (i=0;i<istore->RMB_num_beams;i++)
-						{
-						istore->RMB_sounding_flags[i] = MB_FLAG_NONE;
-						}
-					istore->RMB_beam_data_available = istore->RMB_beam_data_available | 0x2000;
-					}
-				}
-
-			/* print debug statements */
-			if (verbose >= 4)
-				{
-				fprintf(stderr,"\ndbg4  Multibeam bathymetry calculated by MB-System program <%s>\n",program_name);
-				fprintf(stderr,"dbg4       RMB_device_number:                 %d\n", istore->RMB_device_number);
-				fprintf(stderr,"dbg4       RMB_time:                          %f\n", istore->RMB_time);
-				fprintf(stderr,"dbg4       RMB_sonar_type:                    %x\n", istore->RMB_sonar_type);
-				fprintf(stderr,"dbg4       RMB_sonar_flags:                   %x\n", istore->RMB_sonar_flags);
-				fprintf(stderr,"dbg4       RMB_beam_data_available:           %x\n", istore->RMB_beam_data_available);
-				fprintf(stderr,"dbg4       RMB_num_beams:                     %d\n", istore->RMB_num_beams);
-				fprintf(stderr,"dbg4       RMB_num_beams_alloc:               %d\n", istore->RMB_num_beams_alloc);
-				fprintf(stderr,"dbg4       RMB_sound_velocity:                %f\n", istore->RMB_sound_velocity);
-				fprintf(stderr,"dbg4       RMB_ping_number:                   %d\n", istore->RMB_ping_number);
-				for (i=0;i<istore->RMB_num_beams;i++)
-					{
-					fprintf(stderr,"dbg4       beam:%4d", i);
-
-					if (istore->RMB_beam_data_available & 0x0001)
-					fprintf(stderr," mbrng:%f", istore->RMB_beam_ranges[i]);
-
-					if (istore->RMB_beam_data_available & 0x0002)
-					fprintf(stderr," mtrng:%f", istore->RMB_multi_ranges[i]);
-
-					if (istore->RMB_beam_data_available & 0x0004)
-					fprintf(stderr," est:%f", istore->RMB_sounding_eastings[i]);
-
-					if (istore->RMB_beam_data_available & 0x0004)
-					fprintf(stderr," nor:%f", istore->RMB_sounding_northings[i]);
-
-					if (istore->RMB_beam_data_available & 0x0008)
-					fprintf(stderr," dep:%f", istore->RMB_sounding_depths[i]);
-
-					if (istore->RMB_beam_data_available & 0x0010)
-					fprintf(stderr," ltr:%f", istore->RMB_sounding_along[i]);
-
-					if (istore->RMB_beam_data_available & 0x0020)
-					fprintf(stderr," atr:%f", istore->RMB_sounding_across[i]);
-
-					if (istore->RMB_beam_data_available & 0x0040)
-					fprintf(stderr," pth:%f", istore->RMB_sounding_pitchangles[i]);
-
-					if (istore->RMB_beam_data_available & 0x0080)
-					fprintf(stderr," rll:%f", istore->RMB_sounding_rollangles[i]);
-
-					if (istore->RMB_beam_data_available & 0x0100)
-					fprintf(stderr," toa:%f", istore->RMB_sounding_takeoffangles[i]);
-
-					if (istore->RMB_beam_data_available & 0x0200)
-					fprintf(stderr," azi:%f", istore->RMB_sounding_azimuthalangles[i]);
-
-					if (istore->RMB_beam_data_available & 0x0400)
-					fprintf(stderr," tim:%d", istore->RMB_sounding_timedelays[i]);
-
-					if (istore->RMB_beam_data_available & 0x0800)
-					fprintf(stderr," int:%d", istore->RMB_sounding_intensities[i]);
-
-					if (istore->RMB_beam_data_available & 0x1000)
-					fprintf(stderr," qua:%d", istore->RMB_sounding_quality[i]);
-
-					if (istore->RMB_beam_data_available & 0x2000)
-					fprintf(stderr," flg:%d", istore->RMB_sounding_flags[i]);
-
-					fprintf(stderr,"\n");
-					}
-				}
-			}
-
-	   	/* handle navigation data */
-		else if (status == MB_SUCCESS
-			&& (kind == MB_DATA_NAV
-				|| kind == MB_DATA_NAV1
-				|| kind == MB_DATA_NAV2))
-			{
-			/* check device for being enabled */
-			device = (struct mbsys_hysweep_device_struct *)&(istore->devices[istore->POS_device_number]);
-			if (device->DV2_enabled == MB_YES)
-				nrec_POS++;
-			else
-				nrec_POSunused++;
-			}
-
-	   	/* handle attitude data */
-		else if (status == MB_SUCCESS && kind == MB_DATA_ATTITUDE)
-			{
-			nrec_HCP++;
-			}
-
-	   	/* handle heading data */
-		else if (status == MB_SUCCESS && kind == MB_DATA_HEADING)
-			{
-			nrec_GYR++;
-			}
-
-	   	/* handle altitude data */
-		else if (status == MB_SUCCESS && kind == MB_DATA_ALTITUDE)
-			{
-			nrec_EC1++;
-			}
-
-	   	/* handle sonar depth data */
-		else if (status == MB_SUCCESS && kind == MB_DATA_SONARDEPTH)
-			{
-			nrec_DFT++;
-			}
-
-	   	/* handle unknown data */
-		else  if (status == MB_SUCCESS)
-			{
-/*fprintf(stderr,"DATA TYPE UNKNOWN: status:%d error:%d kind:%d\n",status,error,kind);*/
-			}
-
-	   	/* handle read error */
-		else
-			{
-/*fprintf(stderr,"READ FAILURE: status:%d error:%d kind:%d\n",status,error,kind);*/
-			}
-
-		/* print debug statements */
-		if (verbose >= 2)
-			{
-			fprintf(stderr,"\ndbg2  Ping read in program <%s>\n",
-				program_name);
-			fprintf(stderr,"dbg2       kind:           %d\n",kind);
-			fprintf(stderr,"dbg2       error:          %d\n",error);
-			fprintf(stderr,"dbg2       status:         %d\n",status);
-			}
-
-	/*--------------------------------------------
-	  write the processed data
-	  --------------------------------------------*/
-
-		/* write some data */
-		if (error == MB_ERROR_NO_ERROR && (nnav < 1 || kind != MB_DATA_NAV2))
-			{
-			status = mb_put_all(verbose,ombio_ptr,
-					istore_ptr,MB_NO,kind,
-					time_i,time_d,
-					navlon,navlat,speed,heading,
-					obeams_bath,obeams_amp,opixels_ss,
-					beamflag,bath,amp,bathacrosstrack,bathalongtrack,
-					ss,ssacrosstrack,ssalongtrack,
-					comment,&error);
-			if (status != MB_SUCCESS)
-				{
-				mb_error(verbose,error,&message);
-				fprintf(stderr,"\nMBIO Error returned from function <mb_put>:\n%s\n",message);
-				fprintf(stderr,"\nMultibeam Data Not Written To File <%s>\n",ofile);
-				fprintf(stderr,"\nProgram <%s> Terminated\n",
-					program_name);
-				exit(error);
-				}
-			}
-		}
-
-	/* close the swath file */
-	status = mb_close(verbose,&imbio_ptr,&error);
-	status = mb_close(verbose,&ombio_ptr,&error);
-
-	/* output counts */
-	fprintf(stdout, "\nData records written to: %s\n", ofile);
-	fprintf(stdout, "     Positions (POS):                   %d\n", nrec_POS);
-	fprintf(stdout, "     Positions ignored (POS):           %d\n", nrec_POSunused);
-	fprintf(stdout, "     Heading (GYR):                     %d\n", nrec_GYR);
-	fprintf(stdout, "     Attitude (HCP):                    %d\n", nrec_HCP);
-	fprintf(stdout, "     Echosounder (altitude) (EC1):      %d\n", nrec_EC1);
-	fprintf(stdout, "     Dynamic draft (DFT):               %d\n", nrec_DFT );
-	fprintf(stdout, "     Raw multibeam (RMB):               %d\n", nrec_RMB);
-	fprintf(stdout, "     Other:                             %d\n", nrec_other);
-	nrec_POS_tot += nrec_POS;
-	nrec_POSunused_tot += nrec_POSunused;
-	nrec_GYR_tot += nrec_GYR;
-	nrec_HCP_tot += nrec_HCP;
-	nrec_EC1_tot += nrec_EC1;
-	nrec_DFT_tot += nrec_DFT;
-	nrec_RMB_tot += nrec_RMB;
-	nrec_other_tot += nrec_other;
-
-	/* generate inf fnv and fbt files */
-	if (status == MB_SUCCESS)
-		{
-		status = mb_make_info(verbose, MB_YES, ofile, format, &error);
-		}
-
-	/* figure out whether and what to read next */
-        if (read_datalist == MB_YES)
-                {
-		if ((status = mb_datalist_read(verbose,datalist,
-			    ifile,&format,&file_weight,&error))
-			    == MB_SUCCESS)
-                        read_data = MB_YES;
-                else
-                        read_data = MB_NO;
-                }
-        else
-                {
-                read_data = MB_NO;
-                }
-
-	/* end loop over files in list */
-	}
-	if (read_datalist == MB_YES)
-		mb_datalist_close(verbose,&datalist,&error);
-
-	/* output counts */
-	fprintf(stdout, "\nTotal data records written from: %s\n", read_file);
-	fprintf(stdout, "     Positions (POS):                   %d\n", nrec_POS_tot);
-	fprintf(stdout, "     Positions ignored (POS):           %d\n", nrec_POSunused_tot);
-	fprintf(stdout, "     Heading (GYR):                     %d\n", nrec_GYR_tot);
-	fprintf(stdout, "     Attitude (HCP):                    %d\n", nrec_HCP_tot);
-	fprintf(stdout, "     Echosounder (altitude) (EC1):      %d\n", nrec_EC1_tot);
-	fprintf(stdout, "     Dynamic draft (DFT):               %d\n", nrec_DFT_tot);
-	fprintf(stdout, "     Raw multibeam (RMB):               %d\n", nrec_RMB_tot);
-	fprintf(stdout, "     Other:                             %d\n", nrec_other_tot);
-	}
-
-	/* deallocate navigation arrays */
-	if (ndat_nav > 0)
-		{
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&dat_nav_time_d,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&dat_nav_time_d,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&dat_nav_lon,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&dat_nav_lat,&error);
-		}
-	if (ndat_sonardepth > 0)
-		{
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&dat_sonardepth_sonardepth,&error);
-		}
-	if (ndat_heading > 0)
-		{
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&dat_heading_heading,&error);
-		}
-	if (ndat_rph > 0)
-		{
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&dat_rph_roll,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&dat_rph_pitch,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&dat_rph_heave,&error);
-		}
-	if (ndat_altitude > 0)
-		{
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&dat_altitude_time_d,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&dat_altitude_altitude,&error);
-		}
-	if (nnav > 0)
-		{
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&nav_time_d,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&nav_lon,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&nav_lat,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&nav_heading,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&nav_sonardepth,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&nav_altitude,&error);
-		}
-	if (nsonardepth > 0)
-		{
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&sonardepth_time_d,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&sonardepth_sonardepth,&error);
-		}
-
-	/* check memory */
-	if (verbose >= 4)
-		status = mb_memory_list(verbose,&error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  Program <%s> completed\n",
-			program_name);
-		fprintf(stderr,"dbg2  Ending status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* end it all */
-	exit(error);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/utilities/mbinfo.c b/src/utilities/mbinfo.c
deleted file mode 100644
index dd41e50..0000000
--- a/src/utilities/mbinfo.c
+++ /dev/null
@@ -1,2898 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbinfo.c	2/1/93
- *    $Id: mbinfo.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1993-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * MBINFO reads a swath sonar data file and outputs
- * some basic statistics.  If pings are averaged (pings > 2)
- * MBINFO estimates the variance for each of the swath
- * bathymetry beams by reading a set number of pings (>2) and then finding
- * the variance of the detrended values for each beam. The variances
- * for the amplitude beams and sidescan values are
- * calculated without detrending.
- * The results are dumped to stdout.
- *
- * Author:	D. W. Caress
- * Date:	February 1, 1993
- *
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <math.h>
-#include <string.h>
-
-/* MBIO include files */
-#include "mb_status.h"
-#include "mb_define.h"
-#include "mb_io.h"
-
-#define MBINFO_MAXPINGS 50
-struct ping
-	{
-	char	*beamflag;
-	double	*bath;
-	double	*bathlon;
-	double	*bathlat;
-	double	*amp;
-	double	*ss;
-	double	*sslon;
-	double	*sslat;
-	};
-
-/* output formats */
-#define FREE_TEXT 	0
-#define JSON 		1
-#define XML			2
-#define MAX_OUTPUT_FORMAT 2
-
-static char rcs_id[] = "$Id: mbinfo.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-
-int main (int argc, char **argv)
-{
-	char program_name[] = "MBINFO";
-	char help_message[] =  "MBINFO reads a swath sonar data file and outputs\n"
-		"some basic statistics.  If pings are averaged (pings > 2)\n"
-		"MBINFO estimates the variance for each of the swath\n"
-		"beams by reading a set number of pings (>2) and then finding\n"
-		"the variance of the detrended values for each beam.\n"
-		"The results are dumped to stdout.";
-	char usage_message[] = "mbinfo [-Byr/mo/da/hr/mn/sc -C "
-		"-Eyr/mo/da/hr/mn/sc -Fformat -G -Ifile -Llonflip -Mnx/ny "
-		"-N -O -Ppings -Rw/e/s/n -Sspeed -W -V -H -XinfFormat]";
-	extern char *optarg;
-	int	errflg = 0;
-	int	c;
-	int	help = 0;
-	int	flag = 0;
-
-	/* MBIO status variables */
-	int	status = MB_SUCCESS;
-	int	verbose = 0;
-	int	error = MB_ERROR_NO_ERROR;
-	char	*message;
-	char	format_description[MB_DESCRIPTION_LENGTH];
-
-	/* MBIO read control parameters */
-	int	read_datalist = MB_NO;
-	char	read_file[MB_PATH_MAXLINE];
-	void	*datalist;
-	int	look_processed = MB_DATALIST_LOOK_UNSET;
-	double	file_weight;
-	int	format;
-	int	pings;
-	int	lonflip;
-	double	bounds[4];
-	int	btime_i[7];
-	int	etime_i[7];
-	double	btime_d;
-	double	etime_d;
-	double	speedmin;
-	double	timegap;
-	char	file[MB_PATH_MAXLINE];
-	int	pings_get = 1;
-	int	pings_read = 1;
-	int	beams_bath_alloc = 0;
-	int	beams_amp_alloc = 0;
-	int	pixels_ss_alloc = 0;
-	int	beams_bath_max = 0;
-	int	beams_amp_max = 0;
-	int	pixels_ss_max = 0;
-	int	beams_bath = 0;
-	int	beams_amp = 0;
-	int	pixels_ss = 0;
-
-	/* MBIO read values */
-	void	*mbio_ptr = NULL;
-	struct mb_io_struct *mb_io_ptr;
-	int	kind;
-	struct ping *data[MBINFO_MAXPINGS];
-	struct ping *datacur;
-	int	time_i[7];
-	double	time_d;
-	double	navlon;
-	double	navlat;
-	double	speed;
-	double	heading;
-	double	distance;
-	double	altitude;
-	double	sonardepth;
-	char	*beamflag = NULL;
-	double	*bath = NULL;
-	double	*bathlon = NULL;
-	double	*bathlat = NULL;
-	double	*amp = NULL;
-	double	*ss = NULL;
-	double	*sslon = NULL;
-	double	*sslat = NULL;
-	char	comment[MB_COMMENT_MAXLINE];
-	int	icomment = 0;
-
-	/* metadata controls */
-	int	imetadata = 0;
-	int	meta_vessel = 0;
-	int	meta_institution = 0;
-	int	meta_platform = 0;
-	int	meta_sonar = 0;
-	int	meta_sonarversion = 0;
-	int	meta_cruiseid = 0;
-	int	meta_cruisename = 0;
-	int	meta_pi = 0;
-	int	meta_piinstitution = 0;
-	int	meta_client = 0;
-	int	meta_svcorrected = 0;
-	int	meta_tidecorrected = 0;
-	int	meta_batheditmanual = 0;
-	int	meta_batheditauto = 0;
-	int	meta_rollbias = 0;
-	int	meta_pitchbias = 0;
-	int	meta_headingbias = 0;
-	int	meta_draft = 0;
-
-	/* mbinfo control parameters */
-	int	comments = MB_NO;
-	int	good_nav_only = MB_NO;
-	int	good_nav;
-	double	speed_threshold = 50.0;
-	int	bathy_in_feet = MB_NO;
-	double	bathy_scale;
-	int	lonflip_use = 0;
-	int	lonflip_set = MB_NO;
-
-	/* limit variables */
-	double	lonmin = 0.0;
-	double	lonmax = 0.0;
-	double	latmin = 0.0;
-	double	latmax = 0.0;
-	double	sdpmin = 0.0;
-	double	sdpmax = 0.0;
-	double	altmin = 0.0;
-	double	altmax = 0.0;
-	double	bathmin = 0.0;
-	double	bathmax = 0.0;
-	double	ampmin = 0.0;
-	double	ampmax = 0.0;
-	double	ssmin = 0.0;
-	double	ssmax = 0.0;
-	double	bathbeg = 0.0;
-	double	bathend = 0.0;
-	double	lonbeg = 0.0;
-	double	latbeg = 0.0;
-	double	lonend = 0.0;
-	double	latend = 0.0;
-	double	spdbeg = 0.0;
-	double	hdgbeg = 0.0;
-	double	sdpbeg = 0.0;
-	double	altbeg = 0.0;
-	double	spdend = 0.0;
-	double	hdgend = 0.0;
-	double	sdpend = 0.0;
-	double	altend = 0.0;
-	double	timbeg = 0.0;
-	double	timend = 0.0;
-	int	timbeg_i[7];
-	int	timend_i[7];
-	int	timbeg_j[5];
-	int	timend_j[5];
-	double	distot = 0.0;
-	double	timtot = 0.0;
-	double	spdavg = 0.0;
-	int	irec = 0;
-	int	isbtmrec = 0;
-	double	timbegfile = 0.0;
-	double	timendfile = 0.0;
-	double	distotfile = 0.0;
-	double	timtotfile = 0.0;
-	double	spdavgfile = 0.0;
-	int	irecfile = 0;
-	int	ntdbeams = 0;
-	int	ngdbeams = 0;
-	int	nzdbeams = 0;
-	int	nfdbeams = 0;
-	int	ntabeams = 0;
-	int	ngabeams = 0;
-	int	nzabeams = 0;
-	int	nfabeams = 0;
-	int	ntsbeams = 0;
-	int	ngsbeams = 0;
-	int	nzsbeams = 0;
-	int	nfsbeams = 0;
-	double	ngd_percent;
-	double	nzd_percent;
-	double	nfd_percent;
-	double	nga_percent;
-	double	nza_percent;
-	double	nfa_percent;
-	double	ngs_percent;
-	double	nzs_percent;
-	double	nfs_percent;
-	int	beginnav = MB_NO;
-	int	beginsdp = MB_NO;
-	int	beginalt = MB_NO;
-	int	beginbath = MB_NO;
-	int	beginamp = MB_NO;
-	int	beginss = MB_NO;
-	int	nread = 0;
-
-	/* variance finding variables */
-	int	nbath;
-	int	namp;
-	int	nss;
-	double	sumx, sumxx, sumy, sumxy, delta;
-	double	a, b, dev, mean, variance;
-	double	*bathmean = NULL;
-	double	*bathvar = NULL;
-	int	*nbathvar = NULL;
-	double	*ampmean = NULL;
-	double	*ampvar = NULL;
-	int	*nampvar = NULL;
-	double	*ssmean = NULL;
-	double	*ssvar = NULL;
-	int	*nssvar = NULL;
-	int	nbathtot_alloc = 0;
-	int	namptot_alloc = 0;
-	int	nsstot_alloc = 0;
-	double	*bathmeantot = NULL;
-	double	*bathvartot = NULL;
-	int	*nbathvartot = NULL;
-	double	*ampmeantot = NULL;
-	double	*ampvartot = NULL;
-	int	*nampvartot = NULL;
-	double	*ssmeantot = NULL;
-	double	*ssvartot = NULL;
-	int	*nssvartot = NULL;
-
-	/* coverage mask variables */
-	int	coverage_mask = MB_NO;
-	int	pass;
-	int	done;
-	int	mask_nx = 0;
-	int	mask_ny = 0;
-	double	mask_dx = 0.0;
-	double	mask_dy = 0.0;
-	int	*mask = NULL;
-
-	/* notice variables */
-	int	print_notices = MB_NO;
-	int	notice_list[MB_NOTICE_MAX];
-	int	notice_list_tot[MB_NOTICE_MAX];
-	int	notice_total;
-	char	*notice_msg;
-
-	/* output stream for basic stuff (stdout if verbose <= 1,
-		output if verbose > 1) */
-	FILE	*stream = NULL;
-	FILE	*output = NULL;
-	int	output_usefile = MB_NO;
-	char	output_file[MB_PATH_MAXLINE];
-	char	*fileprint;
-	int output_format = FREE_TEXT;
-	int len1,len2;
-	char    string[500];
-
-	int	read_data;
-	double	speed_apparent;
-	double	time_d_last = 0.0;
-	int	val_int;
-	double	val_double;
-	int	ix, iy;
-	int	i, j, k;
-	double	sigma;
-
-	char	*getenv();
-
-	/* initialize some variables */
-	for (i=0;i<7;i++)
-		{
-		timbeg_i[i] = 0;
-		timend_i[i] = 0;
-		}
-	for (i=0;i<MB_NOTICE_MAX;i++)
-		{
-		notice_list[i] = 0;
-		notice_list_tot[i] = 0;
-		}
-
-	/* get current default values */
-	status = mb_defaults(verbose,&format,&pings_get,&lonflip,bounds,
-		btime_i,etime_i,&speedmin,&timegap);
-
-	/* set default input to stdin */
-	strcpy (read_file, "stdin");
-
-	/* process argument list */
-	  while ((c = getopt(argc, argv, "VvHhB:b:CcE:e:F:f:GgI:i:L:l:M:m:NnOoP:p:R:r:S:s:T:t:WwX:x:")) != -1)
-	  switch (c)
-		{
-		case 'B':
-		case 'b':
-			sscanf (optarg,"%d/%d/%d/%d/%d/%d",
-				&btime_i[0],&btime_i[1],&btime_i[2],
-				&btime_i[3],&btime_i[4],&btime_i[5]);
-			btime_i[6] = 0;
-			flag++;
-			break;
-		case 'C':
-		case 'c':
-			comments = MB_YES;
-			flag++;
-			break;
-		case 'E':
-		case 'e':
-			sscanf (optarg,"%d/%d/%d/%d/%d/%d",
-				&etime_i[0],&etime_i[1],&etime_i[2],
-				&etime_i[3],&etime_i[4],&etime_i[5]);
-			etime_i[6] = 0;
-			flag++;
-			break;
-		case 'F':
-		case 'f':
-			sscanf (optarg,"%d", &format);
-			flag++;
-			break;
-		case 'G':
-		case 'g':
-			good_nav_only = MB_YES;
-			flag++;
-			break;
-		case 'H':
-		case 'h':
-			help++;
-			break;
-		case 'I':
-		case 'i':
-			sscanf (optarg,"%s", read_file);
-			flag++;
-			break;
-		case 'L':
-		case 'l':
-			sscanf (optarg,"%d", &lonflip);
-			lonflip_set = MB_YES;
-			lonflip_use = lonflip;
-			flag++;
-			break;
-		case 'M':
-		case 'm':
-			sscanf (optarg,"%d/%d", &mask_nx, &mask_ny);
-			coverage_mask = MB_YES;
-			flag++;
-			break;
-		case 'N':
-		case 'n':
-			print_notices = MB_YES;
-			flag++;
-			break;
-		case 'O':
-		case 'o':
-			output_usefile = MB_YES;
-			flag++;
-			break;
-		case 'P':
-		case 'p':
-			sscanf (optarg,"%d", &pings_read);
-			if (pings_read < 1)
-				pings_read = 1;
-			if (pings_read > MBINFO_MAXPINGS)
-				pings_read = MBINFO_MAXPINGS;
-			flag++;
-			break;
-		case 'R':
-		case 'r':
-			mb_get_bounds(optarg, bounds);
-			flag++;
-			break;
-		case 'S':
-		case 's':
-			sscanf (optarg,"%lf", &speedmin);
-			flag++;
-			break;
-		case 'T':
-		case 't':
-			sscanf (optarg,"%lf", &timegap);
-			flag++;
-			break;
-		case 'V':
-		case 'v':
-			verbose++;
-			break;
-		case 'W':
-		case 'w':
-			bathy_in_feet = MB_YES;
-			break;
-		case 'X':
-		case 'x':
-			sscanf (optarg,"%d",&output_format);
-			if (output_format < 0 || output_format > MAX_OUTPUT_FORMAT)
-			{
-				errflg++;
-				fprintf(stream,"Invalid output format for inf file");
-			}
-			flag++;
-			break;
-		case '?':
-			errflg++;
-		}
-
-	/* set output stream */
-	if (verbose <= 1)
-		stream = stdout;
-	else
-		stream = stderr;
-
-	/* if error flagged then print it and exit */
-	if (errflg)
-		{
-		fprintf(stream,"usage: %s\n", usage_message);
-		fprintf(stream,"\nProgram <%s> Terminated\n",
-			program_name);
-		error = MB_ERROR_BAD_USAGE;
-		exit(error);
-		}
-
-	/* print starting message */
-	if (verbose == 1 || help)
-		{
-		fprintf(stream,"\nProgram %s\n",program_name);
-		fprintf(stream,"Version %s\n",rcs_id);
-		fprintf(stream,"MB-system Version %s\n",MB_VERSION);
-		}
-
-	/* print starting debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stream,"\ndbg2  Program <%s>\n",program_name);
-		fprintf(stream,"dbg2  Version %s\n",rcs_id);
-		fprintf(stream,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stream,"dbg2  Control Parameters:\n");
-		fprintf(stream,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stream,"dbg2       help:       %d\n",help);
-		fprintf(stream,"dbg2       format:     %d\n",format);
-		fprintf(stream,"dbg2       pings:      %d\n",pings_read);
-		fprintf(stream,"dbg2       lonflip:    %d\n",lonflip);
-		fprintf(stream,"dbg2       bounds[0]:  %f\n",bounds[0]);
-		fprintf(stream,"dbg2       bounds[1]:  %f\n",bounds[1]);
-		fprintf(stream,"dbg2       bounds[2]:  %f\n",bounds[2]);
-		fprintf(stream,"dbg2       bounds[3]:  %f\n",bounds[3]);
-		fprintf(stream,"dbg2       btime_i[0]: %d\n",btime_i[0]);
-		fprintf(stream,"dbg2       btime_i[1]: %d\n",btime_i[1]);
-		fprintf(stream,"dbg2       btime_i[2]: %d\n",btime_i[2]);
-		fprintf(stream,"dbg2       btime_i[3]: %d\n",btime_i[3]);
-		fprintf(stream,"dbg2       btime_i[4]: %d\n",btime_i[4]);
-		fprintf(stream,"dbg2       btime_i[5]: %d\n",btime_i[5]);
-		fprintf(stream,"dbg2       btime_i[6]: %d\n",btime_i[6]);
-		fprintf(stream,"dbg2       etime_i[0]: %d\n",etime_i[0]);
-		fprintf(stream,"dbg2       etime_i[1]: %d\n",etime_i[1]);
-		fprintf(stream,"dbg2       etime_i[2]: %d\n",etime_i[2]);
-		fprintf(stream,"dbg2       etime_i[3]: %d\n",etime_i[3]);
-		fprintf(stream,"dbg2       etime_i[4]: %d\n",etime_i[4]);
-		fprintf(stream,"dbg2       etime_i[5]: %d\n",etime_i[5]);
-		fprintf(stream,"dbg2       etime_i[6]: %d\n",etime_i[6]);
-		fprintf(stream,"dbg2       speedmin:   %f\n",speedmin);
-		fprintf(stream,"dbg2       timegap:    %f\n",timegap);
-		fprintf(stream,"dbg2       good_nav:   %d\n",good_nav_only);
-		fprintf(stream,"dbg2       comments:   %d\n",comments);
-		fprintf(stream,"dbg2       file:       %s\n",read_file);
-		fprintf(stream,"dbg2       bathy feet: %d\n",bathy_in_feet);
-		fprintf(stream,"dbg2       lonflip_set:%d\n",lonflip_set);
-		fprintf(stream,"dbg2       coverage:   %d\n",coverage_mask);
-		if (coverage_mask == MB_YES)
-			{
-			fprintf(stream,"dbg2       mask_nx:    %d\n",mask_nx);
-			fprintf(stream,"dbg2       mask_ny:    %d\n",mask_ny);
-			}
-		}
-
-	/* if help desired then print it and exit */
-	if (help)
-		{
-		fprintf(stream,"\n%s\n",help_message);
-		fprintf(stream,"\nusage: %s\n", usage_message);
-		exit(error);
-		}
-
-	/* get format if required */
-	if (format == 0)
-		mb_get_format(verbose,read_file,NULL,&format,&error);
-
-	/* set bathymetry scaling */
-	if (bathy_in_feet == MB_YES)
-		bathy_scale = 1.0 / 0.3048;
-	else
-		bathy_scale = 1.0;
-
-	/* determine whether to read one file or a list of files */
-	if (format < 0)
-		read_datalist = MB_YES;
-
-	/* if reading from datalist then variance calculations
-		are disabled */
-	if (read_datalist == MB_YES)
-		pings_read = 1;
-
-	/* Open output file if requested */
-	if (output_usefile == MB_YES)
-		{
-		strcpy(output_file, read_file);
-		switch (output_format)
-			{
-			case FREE_TEXT:
-				strcat(output_file, ".inf");
-				break;
-			case JSON:
-				strcat(output_file,"_inf.json");
-				break;
-			case XML:
-				strcat(output_file,"_inf.xml");
-				break;
-			case '?':
-				break;
-			}
-		if ((output = fopen(output_file, "w")) == NULL)
-			output = stream;
-		}
-	else
-		{
-		output = stream;
-		}
-	switch (output_format)
-		{
-		case FREE_TEXT:
-			break;
-		case JSON:
-			fprintf(output,"{\n");
-			break;
-		case XML:
-			fprintf(output,"<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n");
-			fprintf(output,"<mbinfo>\n");
-			break;
-		case '?':
-			break;
-		}
-	/* read only once unless coverage mask requested */
-	pass = 0;
-	done = MB_NO;
-	while (done == MB_NO)
-	{
-	/* open file list */
-	if (read_datalist == MB_YES)
-	    {
-	    if ((status = mb_datalist_open(verbose,&datalist,
-					    read_file,look_processed,&error)) != MB_SUCCESS)
-		{
-		error = MB_ERROR_OPEN_FAIL;
-		fprintf(stderr,"\nUnable to open data list file: %s\n",
-			read_file);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-	    if ((status = mb_datalist_read(verbose,datalist,
-			    file,&format,&file_weight,&error))
-			    == MB_SUCCESS)
-		read_data = MB_YES;
-	    else
-		read_data = MB_NO;
-	    }
-	/* else copy single filename to be read */
-	else
-	    {
-	    strcpy(file, read_file);
-	    read_data = MB_YES;
-	    }
-
-	/* loop over all files to be read */
-	while (read_data == MB_YES)
-	{
-
-	/* initialize reading the swath file */
-	if ((status = mb_read_init(
-		verbose,file,format,pings_get,lonflip,bounds,
-		btime_i,etime_i,speedmin,timegap,
-		&mbio_ptr,&btime_d,&etime_d,
-		&beams_bath_alloc,
-		&beams_amp_alloc,
-		&pixels_ss_alloc,
-		&error)) != MB_SUCCESS)
-		{
-		mb_error(verbose,error,&message);
-		fprintf(stream,"\nMBIO Error returned from function <mb_read_init>:\n%s\n",message);
-		fprintf(stream,"\nSwath File <%s> not initialized for reading\n",file);
-		fprintf(stream,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-
-	/* allocate memory for data arrays */
-	for (i=0;i<pings_read;i++)
-		{
-		data[i] = NULL;
-		status = mb_mallocd(verbose,__FILE__,__LINE__,pings_read*sizeof(struct ping),
-				(void **)&data[i],&error);
-		if (error == MB_ERROR_NO_ERROR)
-			{
-			datacur = data[i];
-			datacur->beamflag = NULL;
-			datacur->bath = NULL;
-			datacur->amp = NULL;
-			datacur->bathlon = NULL;
-			datacur->bathlat = NULL;
-			datacur->ss = NULL;
-			datacur->sslon = NULL;
-			datacur->sslat = NULL;
-			}
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							sizeof(char), (void **)&datacur->beamflag, &error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							sizeof(double), (void **)&datacur->bath, &error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_AMPLITUDE,
-							sizeof(double), (void **)&datacur->amp, &error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							sizeof(double), (void **)&datacur->bathlon, &error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							sizeof(double), (void **)&datacur->bathlat, &error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_SIDESCAN,
-							sizeof(double), (void **)&datacur->ss, &error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_SIDESCAN,
-							sizeof(double), (void **)&datacur->sslon, &error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_SIDESCAN,
-							sizeof(double), (void **)&datacur->sslat, &error);
-		}
-	if (pings_read > 1 && pass == 0)
-		{
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							sizeof(double), (void **)&bathmean, &error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							sizeof(double), (void **)&bathvar, &error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							sizeof(int), (void **)&nbathvar, &error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_AMPLITUDE,
-							sizeof(double),(void **) &ampmean, &error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_AMPLITUDE,
-							sizeof(double), (void **)&ampvar, &error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_AMPLITUDE,
-							sizeof(int), (void **)&nampvar, &error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_SIDESCAN,
-							sizeof(double), (void **)&ssmean, &error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_SIDESCAN,
-							sizeof(double), (void **)&ssvar, &error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_SIDESCAN,
-							sizeof(int), (void **)&nssvar, &error);
-		}
-
-	/* if coverage mask requested get cell sizes */
-	if (pass == 1 && coverage_mask == MB_YES)
-	    {
-	    if (mask_nx > 1 && mask_ny <= 0)
-		{
-		if ((lonmax - lonmin) > (latmax - latmin))
-		    {
-		    mask_ny = mask_nx * (latmax - latmin) / (lonmax - lonmin);
-		    }
-		else
-		    {
-		    mask_ny = mask_nx;
-		    mask_nx = mask_ny * (lonmax - lonmin) / (latmax - latmin);
-		    if (mask_ny < 2)
-			mask_ny = 2;
-		    }
-		}
-	    if (mask_nx < 2)
-		mask_nx = 2;
-	    if (mask_ny < 2)
-		mask_ny = 2;
-	    mask_dx = (lonmax - lonmin) / mask_nx;
-	    mask_dy = (latmax - latmin) / mask_ny;
-
-	    /* allocate mask */
-	    status = mb_mallocd(verbose,__FILE__,__LINE__,mask_nx*mask_ny*sizeof(int),
-				(void **)&mask,&error);
-	    }
-
-	/* if error initializing memory then quit */
-	if (error != MB_ERROR_NO_ERROR)
-		{
-		mb_error(verbose,error,&message);
-		fprintf(stream,"\nMBIO Error allocating data arrays:\n%s\n",message);
-		fprintf(stream,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-
-	/* initialize data arrays */
-	irecfile = 0;
-	distotfile = 0.0;
-	timtotfile = 0.0;
-	spdavgfile = 0.0;
-	if (pass == 0 && pings_read > 1)
-		{
-		for (i=0;i<beams_bath_alloc;i++)
-			{
-			bathmean[i] = 0.0;
-			bathvar[i] = 0.0;
-			nbathvar[i] = 0;
-			}
-		for (i=0;i<beams_amp_alloc;i++)
-			{
-			ampmean[i] = 0.0;
-			ampvar[i] = 0.0;
-			nampvar[i] = 0;
-			}
-		for (i=0;i<pixels_ss_alloc;i++)
-			{
-			ssmean[i] = 0.0;
-			ssvar[i] = 0.0;
-			nssvar[i] = 0;
-			}
-		}
-	if (pass == 1 && coverage_mask == MB_YES)
-		{
-		for (i=0;i<mask_nx*mask_ny;i++)
-		    mask[i] = MB_NO;
-		}
-
-	/* initialize metadata counters */
-	meta_vessel = 0;
-	meta_institution = 0;
-	meta_platform = 0;
-	meta_sonar = 0;
-	meta_sonarversion = 0;
-	meta_cruiseid = 0;
-	meta_cruisename = 0;
-	meta_pi = 0;
-	meta_piinstitution = 0;
-	meta_client = 0;
-	meta_svcorrected = 0;
-	meta_tidecorrected = 0;
-	meta_batheditmanual = 0;
-	meta_batheditauto = 0;
-	meta_rollbias = 0;
-	meta_pitchbias = 0;
-	meta_headingbias = 0;
-	meta_draft = 0;
-
-	/* printf out file and format */
-	if (pass == 0)
-		{
-		if (strrchr(file, '/') == NULL)
-		    fileprint = file;
-		else
-		    fileprint = strrchr(file, '/') + 1;
-		mb_format_description(verbose,&format,format_description,&error);
-		switch (output_format)
-			{
-			case FREE_TEXT:
-				fprintf(output,"\nSwath Data File:      %s\n",fileprint);
-				fprintf(output,"MBIO Data Format ID:  %d\n",format);
-				fprintf(output,"%s",format_description);
-				break;
-			case JSON:
-				fprintf(output,"\"file_info\":{\n");
-				fprintf(output,"\"swath_data_file\":\"%s\",\n",fileprint);
-				fprintf(output,"\"mbio_data_format_id\":\"%d\",\n",format);
-				len1=strspn(format_description,"Formatname: ");
-				len2=strcspn(&format_description[len1],"\n");
-				strncpy(string,&format_description[len1],len2);
-				fprintf(output,"\"format_name\": \"%s\",\n",string);
-				len1+=len2+1;
-				len1+=strspn(&format_description[len1],"InformalDescription: ");
-				len2=strcspn(&format_description[len1],"\n");
-				strncpy(string,&format_description[len1],len2);
-				fprintf(output,"\"informal_description\": \"%s\",\n",string);
-				len1+=len2+1;
-				len1+=strspn(&format_description[len1],"Attributes: ");
-				len2=strlen(format_description);
-				format_description[strlen(format_description)-1]='\0';
-				for (len2=len1;len2<=strlen(format_description);len2++)
-					if (format_description[len2]==10)format_description[len2]=';';
-				fprintf(output,"\"attributes\": \"%s\"\n",&format_description[len1]);
-				fprintf(output,"},\n");
-				break;
-			case XML:
-				fprintf(output,"\t<file_info>\n");
-				fprintf(output,"\t\t<swath_data_file>%s</swath_data_file>\n",fileprint);
-				fprintf(output,"\t\t<mbio_data_format_id>%d</mbio_data_format_id>\n",format);
-				len1=strspn(format_description,"Formatname: ");
-				len2=strcspn(&format_description[len1],"\n");
-				strncpy(string,&format_description[len1],len2);
-				fprintf(output,"\t\t<format_name>%s</format_name>\n",string);
-				len1+=len2+1;
-				len1+=strspn(&format_description[len1],"InformalDescription: ");
-				len2=strcspn(&format_description[len1],"\n");
-				strncpy(string,&format_description[len1],len2);
-				fprintf(output,"\t\t<informal_description>%s</informal_description>\n",string);
-				len1+=len2+1;
-				len1+=strspn(&format_description[len1],"Attributes: ");
-				len2=strlen(format_description);
-				format_description[strlen(format_description)-1]='\0';
-				for (len2=len1;len2<=strlen(format_description);len2++)
-					if (format_description[len2]==10)format_description[len2]=' ';
-				fprintf(output,"\t\t<attributes>%s</attributes>\n",&format_description[len1]);
-				fprintf(output,"\t</file_info>\n");
-				break;
-			case '?':
-				errflg++;
-			}
-		}
-
-	/* read and process data */
-	while (error <= MB_ERROR_NO_ERROR)
-		{
-		nread = 0;
-		error = MB_ERROR_NO_ERROR;
-		while (nread < pings_read && error == MB_ERROR_NO_ERROR)
-			{
-
-			/* read a ping of data */
-			datacur = data[nread];
-			status = mb_read(verbose,mbio_ptr,&kind,&pings,
-				time_i,&time_d,
-				&navlon,&navlat,
-				&speed,&heading,
-				&distance,&altitude,&sonardepth,
-				&beams_bath,&beams_amp,&pixels_ss,
-				datacur->beamflag,datacur->bath,datacur->amp,
-				datacur->bathlon,datacur->bathlat,
-				datacur->ss,datacur->sslon,datacur->sslat,
-				comment,&error);
-
-			/* use local pointers for convenience - do not set these before the
-				mb_read call because registered arrays can be dynamically
-				reallocated during mb_read, mb_get, and mb_get_all calls */
-			beamflag = datacur->beamflag;
-			bath = datacur->bath;
-			amp = datacur->amp;
-			bathlon = datacur->bathlon;
-			bathlat = datacur->bathlat;
-			ss = datacur->ss;
-			sslon = datacur->sslon;
-			sslat = datacur->sslat;
-
-			/* increment counters */
-			if (pass == 0
-				&& (error == MB_ERROR_NO_ERROR
-				    || error == MB_ERROR_TIME_GAP))
-				{
-				irec++;
-				irecfile++;
-				nread++;
-				}
-
-			/* print comment records */
-			if (pass == 0
-				&& error == MB_ERROR_COMMENT
-				&& comments == MB_YES)
-				{
-				if (strncmp(comment,"META",4) != 0)
-					{
-					if (icomment == 0)
-						{
-						switch (output_format)
-					    	{
-							case FREE_TEXT:
-								fprintf(output,"\nComments in file %s:\n",file);
-								icomment++;
-								break;
-							case '?':
-								break;
-							}
-						}
-						switch (output_format)
-							{
-							case FREE_TEXT:
-								fprintf(output,"  %s\n",comment);
-								break;
-							case JSON:
-								fprintf(output,"\"comment\":\"%s\",\n",comment);
-								break;
-							case XML:
-								fprintf(output,"\t<comment>%s</comment>\n",comment);
-								break;
-							case '?':
-								break;
-						}
-					}
-				}
-
-			/* print metadata */
-			if (pass == 0
-				&& error == MB_ERROR_COMMENT
-				&& strncmp(comment,"META",4) == 0)
-				{
-					switch (output_format)
-					{
-						case FREE_TEXT:
-							if (imetadata == 0)
-								{
-								fprintf(output,"\nMetadata:\n");
-								imetadata++;
-								}
-							if (strncmp(comment, "METAVESSEL:", 11) == 0)
-								{
-								if (meta_vessel == 0)
-					    			fprintf(output,"Vessel:                 %s\n", &comment[11]);
-								meta_vessel++;
-								}
-							else if (strncmp(comment, "METAINSTITUTION:", 16) == 0)
-								{
-								if (meta_institution == 0)
-					    			fprintf(output,"Institution:            %s\n", &comment[16]);
-								meta_institution++;
-								}
-							else if (strncmp(comment, "METAPLATFORM:", 13) == 0)
-								{
-								if (meta_platform == 0)
-					    			fprintf(output,"Platform:               %s\n", &comment[13]);
-								meta_platform++;
-								}
-							else if (strncmp(comment, "METASONARVERSION:", 17) == 0)
-								{
-								if (meta_sonarversion == 0)
-					    			fprintf(output,"Sonar Version:          %s\n", &comment[17]);
-								meta_sonarversion++;
-								}
-							else if (strncmp(comment, "METASONAR:", 10) == 0)
-								{
-								if (meta_sonar == 0)
-					    			fprintf(output,"Sonar:                  %s\n", &comment[10]);
-								meta_sonar++;
-								}
-							else if (strncmp(comment, "METACRUISEID:", 13) == 0)
-								{
-								if (meta_cruiseid == 0)
-					    			fprintf(output,"Cruise ID:              %s\n", &comment[13]);
-								meta_cruiseid++;
-								}
-							else if (strncmp(comment, "METACRUISENAME:", 15) == 0)
-								{
-								if (meta_cruisename == 0)
-					    			fprintf(output,"Cruise Name:            %s\n", &comment[15]);
-								meta_cruisename++;
-								}
-							else if (strncmp(comment, "METAPI:", 7) == 0)
-								{
-								if (meta_pi == 0)
-					    			fprintf(output,"PI:                     %s\n", &comment[7]);
-								meta_pi++;
-								}
-							else if (strncmp(comment, "METAPIINSTITUTION:", 18) == 0)
-								{
-								if (meta_piinstitution == 0)
-					    			fprintf(output,"PI Institution:         %s\n", &comment[18]);
-								meta_piinstitution++;
-								}
-							else if (strncmp(comment, "METACLIENT:", 11) == 0)
-								{
-								if (meta_client == 0)
-					    			fprintf(output,"Client:                 %s\n", &comment[11]);
-								meta_client++;
-								}
-							else if (strncmp(comment, "METASVCORRECTED:", 16) == 0)
-								{
-								if (meta_svcorrected == 0)
-					    			{
-					    			sscanf(comment, "METASVCORRECTED:%d", &val_int);
-					    			if (val_int == MB_YES)
-									fprintf(output,"Corrected Depths:       YES\n");
-					    			else
-									fprintf(output,"Corrected Depths:       NO\n");
-					    			}
-								meta_svcorrected++;
-								}
-							else if (strncmp(comment, "METATIDECORRECTED:", 18) == 0)
-								{
-								if (meta_tidecorrected == 0)
-					    			{
-					    			sscanf(comment, "METATIDECORRECTED:%d", &val_int);
-					    			if (val_int == MB_YES)
-									fprintf(output,"Tide Corrected:         YES\n");
-					    			else
-									fprintf(output,"Tide Corrected:         NO\n");
-					    			}
-								meta_tidecorrected++;
-								}
-							else if (strncmp(comment, "METABATHEDITMANUAL:", 19) == 0)
-								{
-								if (meta_batheditmanual == 0)
-					    			{
-					    			sscanf(comment, "METABATHEDITMANUAL:%d", &val_int);
-					    			if (val_int == MB_YES)
-									fprintf(output,"Depths Manually Edited: YES\n");
-					    			else
-									fprintf(output,"Depths Manually Edited: NO\n");
-					    			}
-								meta_batheditmanual++;
-								}
-							else if (strncmp(comment, "METABATHEDITAUTO:", 17) == 0)
-								{
-								if (meta_batheditauto == 0)
-					    			{
-					    			sscanf(comment, "METABATHEDITAUTO:%d", &val_int);
-					    			if (val_int == MB_YES)
-									fprintf(output,"Depths Auto-Edited:     YES\n");
-					    			else
-									fprintf(output,"Depths Auto-Edited:     NO\n");
-					    			}
-								meta_batheditauto++;
-								}
-							else if (strncmp(comment, "METAROLLBIAS:", 13) == 0)
-								{
-								if (meta_rollbias == 0)
-					    			{
-					    			sscanf(comment, "METAROLLBIAS:%lf", &val_double);
-					    			fprintf(output,"Roll Bias:              %f degrees\n", val_double);
-					    			}
-								meta_rollbias++;
-								}
-							else if (strncmp(comment, "METAPITCHBIAS:", 14) == 0)
-								{
-								if (meta_pitchbias == 0)
-					    			{
-					    			sscanf(comment, "METAPITCHBIAS:%lf", &val_double);
-					    			fprintf(output,"Pitch Bias:             %f degrees\n", val_double);
-					    			}
-								meta_pitchbias++;
-								}
-							else if (strncmp(comment, "METAHEADINGBIAS:", 16) == 0)
-								{
-								if (meta_headingbias == 0)
-					    			{
-					    			sscanf(comment, "METAHEADINGBIAS:%lf", &val_double);
-					    			fprintf(output,"Heading Bias:           %f degrees\n", val_double);
-					    			}
-								meta_headingbias++;
-								}
-							else if (strncmp(comment, "METADRAFT:", 10) == 0)
-								{
-								if (meta_draft == 0)
-					    			{
-					    			sscanf(comment, "METADRAFT:%lf", &val_double);
-					    			fprintf(output,"Draft:                  %f m\n", val_double);
-					    			}
-								meta_draft++;
-								}
-							break;
-						case JSON:
-							if (strncmp(comment, "METAVESSEL:", 11) == 0)
-								{
-								if (meta_vessel == 0)
-					    			fprintf(output,"\"vessel\":\"%s\",\n", &comment[11]);
-								meta_vessel++;
-								}
-							else if (strncmp(comment, "METAINSTITUTION:", 16) == 0)
-								{
-								if (meta_institution == 0)
-					    			fprintf(output,"\"institution\":\"%s\",\n", &comment[16]);
-								meta_institution++;
-								}
-							else if (strncmp(comment, "METAPLATFORM:", 13) == 0)
-								{
-								if (meta_platform == 0)
-					    			fprintf(output,"\"platform\": \"%s \",\n", &comment[13]);
-								meta_platform++;
-								}
-							else if (strncmp(comment, "METASONARVERSION:", 17) == 0)
-								{
-								if (meta_sonarversion == 0)
-					    			fprintf(output,"\"sonar_version\": \"%s\",\n", &comment[17]);
-								meta_sonarversion++;
-								}
-							else if (strncmp(comment, "METASONAR:", 10) == 0)
-								{
-								if (meta_sonar == 0)
-					    			fprintf(output,"\"sonar\": \"%s\",\n", &comment[10]);
-								meta_sonar++;
-								}
-							else if (strncmp(comment, "METACRUISEID:", 13) == 0)
-								{
-								if (meta_cruiseid == 0)
-					    			fprintf(output,"\"cruise_id\": \"%s\",\n", &comment[13]);
-								meta_cruiseid++;
-								}
-							else if (strncmp(comment, "METACRUISENAME:", 15) == 0)
-								{
-								if (meta_cruisename == 0)
-					    			fprintf(output,"\"cruise_name\": \"%s\",\n", &comment[15]);
-								meta_cruisename++;
-								}
-							else if (strncmp(comment, "METAPI:", 7) == 0)
-								{
-								if (meta_pi == 0)
-					    			fprintf(output,"\"pi\": \"%s\",\n", &comment[7]);
-								meta_pi++;
-								}
-							else if (strncmp(comment, "METAPIINSTITUTION:", 18) == 0)
-								{
-								if (meta_piinstitution == 0)
-					    			fprintf(output,"\"pi_institution\": \"%s\",\n", &comment[18]);
-								meta_piinstitution++;
-								}
-							else if (strncmp(comment, "METACLIENT:", 11) == 0)
-								{
-								if (meta_client == 0)
-					    			fprintf(output,"\"client\": \"%s\",\n", &comment[11]);
-								meta_client++;
-								}
-							else if (strncmp(comment, "METASVCORRECTED:", 16) == 0)
-								{
-								if (meta_svcorrected == 0)
-					    			{
-					    			sscanf(comment, "METASVCORRECTED:%d", &val_int);
-					    			if (val_int == MB_YES)
-									fprintf(output,"\"corrected_depths\": \"YES\",\n");
-					    			else
-									fprintf(output,"\"corrected_depths\": \"NO\",\n");
-					    			}
-								meta_svcorrected++;
-								}
-							else if (strncmp(comment, "METATIDECORRECTED:", 18) == 0)
-								{
-								if (meta_tidecorrected == 0)
-					    			{
-					    			sscanf(comment, "METATIDECORRECTED:%d", &val_int);
-					    			if (val_int == MB_YES)
-									fprintf(output,"\"tide_corrected\": \"YES\",\n");
-					    			else
-									fprintf(output,"\"tide_corrected\": \"NO\",\n");
-					    			}
-								meta_tidecorrected++;
-								}
-							else if (strncmp(comment, "METABATHEDITMANUAL:", 19) == 0)
-								{
-								if (meta_batheditmanual == 0)
-					    			{
-					    			sscanf(comment, "METABATHEDITMANUAL:%d", &val_int);
-					    			if (val_int == MB_YES)
-									fprintf(output,"\"depths_manually_edited\": \"YES\",\n");
-					    			else
-									fprintf(output,"\"depths_manually_edited\": \"NO\",\n");
-					    			}
-								meta_batheditmanual++;
-								}
-							else if (strncmp(comment, "METABATHEDITAUTO:", 17) == 0)
-								{
-								if (meta_batheditauto == 0)
-					    			{
-					    			sscanf(comment, "METABATHEDITAUTO:%d", &val_int);
-					    			if (val_int == MB_YES)
-									fprintf(output,"\"depths_auto-edited\": \"YES\",\n");
-					    			else
-									fprintf(output,"\"depths_auto-edited\": \"NO\",\n");
-					    			}
-								meta_batheditauto++;
-								}
-							else if (strncmp(comment, "METAROLLBIAS:", 13) == 0)
-								{
-								if (meta_rollbias == 0)
-					    			{
-					    			sscanf(comment, "METAROLLBIAS:%lf", &val_double);
-					    			fprintf(output,"\"roll_bias\": \"%f\",\n", val_double);
-					    			}
-								meta_rollbias++;
-								}
-							else if (strncmp(comment, "METAPITCHBIAS:", 14) == 0)
-								{
-								if (meta_pitchbias == 0)
-					    			{
-					    			sscanf(comment, "METAPITCHBIAS:%lf", &val_double);
-					    			fprintf(output,"\"pitch_bias\": \"%f\",\n", val_double);
-					    			}
-								meta_pitchbias++;
-								}
-							else if (strncmp(comment, "METAHEADINGBIAS:", 16) == 0)
-								{
-								if (meta_headingbias == 0)
-					    			{
-					    			sscanf(comment, "METAHEADINGBIAS:%lf", &val_double);
-					    			fprintf(output,"\"heading_bias\": \"%f\",\n", val_double);
-					    			}
-								meta_headingbias++;
-								}
-							else if (strncmp(comment, "METADRAFT:", 10) == 0)
-								{
-								if (meta_draft == 0)
-					    			{
-					    			sscanf(comment, "METADRAFT:%lf", &val_double);
-					    			fprintf(output,"\"draft\": \"%f\",\n", val_double);
-					    			}
-								meta_draft++;
-								}
-							break;
-						case XML:
-							if (imetadata == 0)
-								{
-								fprintf(output,"\t<metadata>\n");
-								imetadata++;
-								}
-							if (strncmp(comment, "METAVESSEL:", 11) == 0)
-								{
-								if (meta_vessel == 0)
-					    			fprintf(output,"\t\t<vessel>%s</vessel>\n", &comment[11]);
-								meta_vessel++;
-								}
-							else if (strncmp(comment, "METAINSTITUTION:", 16) == 0)
-								{
-								if (meta_institution == 0)
-					    			fprintf(output,"\t\t<institution>%s</institution>\n", &comment[16]);
-								meta_institution++;
-								}
-							else if (strncmp(comment, "METAPLATFORM:", 13) == 0)
-								{
-								if (meta_platform == 0)
-					    			fprintf(output,"\t\t<platform>%s</platform>\n", &comment[13]);
-								meta_platform++;
-								}
-							else if (strncmp(comment, "METASONARVERSION:", 17) == 0)
-								{
-								if (meta_sonarversion == 0)
-					    			fprintf(output,"\t\t<sonar_version>%s</sonar_version>\n", &comment[17]);
-								meta_sonarversion++;
-								}
-							else if (strncmp(comment, "METASONAR:", 10) == 0)
-								{
-								if (meta_sonar == 0)
-					    			fprintf(output,"\t\t<sonar>%s</sonar>\n", &comment[10]);
-								meta_sonar++;
-								}
-							else if (strncmp(comment, "METACRUISEID:", 13) == 0)
-								{
-								if (meta_cruiseid == 0)
-					    			fprintf(output,"\t\t<cruise_id>%s</cruise_id>\n", &comment[13]);
-								meta_cruiseid++;
-								}
-							else if (strncmp(comment, "METACRUISENAME:", 15) == 0)
-								{
-								if (meta_cruisename == 0)
-					    			fprintf(output,"\t\t<cruise_name>%s</cruise_name>\n", &comment[15]);
-								meta_cruisename++;
-								}
-							else if (strncmp(comment, "METAPI:", 7) == 0)
-								{
-								if (meta_pi == 0)
-					    			fprintf(output,"\t\t<pi>%s</pi>\n", &comment[7]);
-								meta_pi++;
-								}
-							else if (strncmp(comment, "METAPIINSTITUTION:", 18) == 0)
-								{
-								if (meta_piinstitution == 0)
-					    			fprintf(output,"\t\t<pi_institution>%s</pi_institution>\n", &comment[18]);
-								meta_piinstitution++;
-								}
-							else if (strncmp(comment, "METACLIENT:", 11) == 0)
-								{
-								if (meta_client == 0)
-					    			fprintf(output,"\t\t<client>%s</client>\n", &comment[11]);
-								meta_client++;
-								}
-							else if (strncmp(comment, "METASVCORRECTED:", 16) == 0)
-								{
-								if (meta_svcorrected == 0)
-					    			{
-					    			sscanf(comment, "METASVCORRECTED:%d", &val_int);
-					    			if (val_int == MB_YES)
-									fprintf(output,"\t\t<corrected_depths>YES</corrected_depths>\n");
-					    			else
-									fprintf(output,"\t\t<corrected_depths>NO</corrected_depths>\n");
-					    			}
-								meta_svcorrected++;
-								}
-							else if (strncmp(comment, "METATIDECORRECTED:", 18) == 0)
-								{
-								if (meta_tidecorrected == 0)
-					    			{
-					    			sscanf(comment, "METATIDECORRECTED:%d", &val_int);
-					    			if (val_int == MB_YES)
-									fprintf(output,"\t\t<tide_corrected>YES</tide_corrected>\n");
-					    			else
-									fprintf(output,"\t\t<tide_corrected>NO</tide_corrected>\n");
-					    			}
-								meta_tidecorrected++;
-								}
-							else if (strncmp(comment, "METABATHEDITMANUAL:", 19) == 0)
-								{
-								if (meta_batheditmanual == 0)
-					    			{
-					    			sscanf(comment, "METABATHEDITMANUAL:%d", &val_int);
-					    			if (val_int == MB_YES)
-									fprintf(output,"\t\t<depths_manually_edited>YES</depths_manually_edited>\n");
-					    			else
-									fprintf(output,"\t\t<depths_manually_edited>NO</depths_manually_edited>\n");
-					    			}
-								meta_batheditmanual++;
-								}
-							else if (strncmp(comment, "METABATHEDITAUTO:", 17) == 0)
-								{
-								if (meta_batheditauto == 0)
-					    			{
-					    			sscanf(comment, "METABATHEDITAUTO:%d", &val_int);
-					    			if (val_int == MB_YES)
-									fprintf(output,"\t\t<depths_auto_edited>YES</depths_auto_edited>\n");
-					    			else
-									fprintf(output,"\t\t<depths_auto_edited>NO</depths_auto_edited>\n");
-					    			}
-								meta_batheditauto++;
-								}
-							else if (strncmp(comment, "METAROLLBIAS:", 13) == 0)
-								{
-								if (meta_rollbias == 0)
-					    			{
-					    			sscanf(comment, "METAROLLBIAS:%lf\n", &val_double);
-					    			fprintf(output,"\t\t<roll_bias>%f</roll_bias>\n", val_double);
-					    			}
-								meta_rollbias++;
-								}
-							else if (strncmp(comment, "METAPITCHBIAS:", 14) == 0)
-								{
-								if (meta_pitchbias == 0)
-					    			{
-					    			sscanf(comment, "METAPITCHBIAS:%lf", &val_double);
-					    			fprintf(output,"\t\t<pitch_bias>%f</pitch_bias>\n", val_double);
-					    			}
-								meta_pitchbias++;
-								}
-							else if (strncmp(comment, "METAHEADINGBIAS:", 16) == 0)
-								{
-								if (meta_headingbias == 0)
-					    			{
-					    			sscanf(comment, "METAHEADINGBIAS:%lf", &val_double);
-					    			fprintf(output,"\t\t<heading_bias>%f</heading_bias>\n", val_double);
-					    			}
-								meta_headingbias++;
-								}
-							else if (strncmp(comment, "METADRAFT:", 10) == 0)
-								{
-								if (meta_draft == 0)
-					    			{
-					    			sscanf(comment, "METADRAFT:%lf", &val_double);
-					    			fprintf(output,"\t\t<draft>%fm</draft>\n\t</metadata>\n", val_double);
-					    			}
-								meta_draft++;
-								}
-							break;
-							case '?':
-								break;
-						}
-					}
-
-			/* output error messages */
-			if (pass != 0 || error == MB_ERROR_COMMENT)
-				{
-				/* do nothing */
-				}
-			else if (error == MB_ERROR_SUBBOTTOM)
-				{
-				/* do nothing */
-				}
-			else if (verbose >= 1 && error < MB_ERROR_NO_ERROR
-				&& error >= MB_ERROR_OTHER)
-				{
-				mb_error(verbose,error,&message);
-				fprintf(stream,"\nNonfatal MBIO Error:\n%s\n",
-					message);
-				fprintf(stream,"Time: %d %d %d %d %d %d %d\n",
-					time_i[0],time_i[1],time_i[2],
-					time_i[3],time_i[4],time_i[5],
-					time_i[6]);
-				}
-			else if (verbose >= 1 && error < MB_ERROR_NO_ERROR)
-				{
-				mb_error(verbose,error,&message);
-				fprintf(stream,"\nNonfatal MBIO Error:\n%s\n",
-					message);
-				fprintf(stream,"Number of good records so far: %d\n",irecfile);
-				}
-			else if (verbose >= 1 && error > MB_ERROR_NO_ERROR
-				&& error != MB_ERROR_EOF)
-				{
-				mb_error(verbose,error,&message);
-				fprintf(stream,"\nFatal MBIO Error:\n%s\n",
-					message);
-				fprintf(stream,"Last Good Time: %d %d %d %d %d %d %d\n",
-					time_i[0],time_i[1],time_i[2],
-					time_i[3],time_i[4],time_i[5],
-					time_i[6]);
-				}
-
-			/* take note of min and maxes */
-			beams_bath_max = MAX(beams_bath_max, beams_bath);
-			beams_amp_max = MAX(beams_amp_max, beams_amp);
-			pixels_ss_max = MAX(pixels_ss_max, pixels_ss);
-			if (pass == 0
-				&& (error == MB_ERROR_NO_ERROR
-				    || error == MB_ERROR_TIME_GAP))
-				{
-				/* update data counts */
-				ntdbeams += beams_bath;
-				ntabeams += beams_amp;
-				ntsbeams += pixels_ss;
-
-				/* set lonflip if needed */
-				if (lonflip_set == MB_NO
-				    && (navlon != 0.0 || navlat != 0.0))
-				    {
-				    lonflip_set = MB_YES;
-				    if (navlon < -270.0)
-					lonflip_use = 0;
-				    else if (navlon >= -270.0 && navlon < -90.0)
-					lonflip_use = -1;
-				    else if (navlon >= -90.0 && navlon < 90.0)
-					lonflip_use = 0;
-				    else if (navlon >= 90.0 && navlon < 270.0)
-					lonflip_use = 1;
-				    else if (navlon >= 270.0)
-					lonflip_use = 0;
-
-				    /* change and apply lonflip if needed */
-				    if (lonflip_use != lonflip)
-					{
-					/* change lonflip used in reading */
-					mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-					mb_io_ptr->lonflip = lonflip_use;
-					lonflip = lonflip_use;
-
-					/* apply lonflip to data already read */
-					if (lonflip_use == -1)
-					    {
-					    if (navlon > 0.0)
-						navlon -= 360.0;
-					    for (i=0;i<beams_bath;i++)
-						{
-						if (bathlon[i] > 0.0)
-						    bathlon[i] -= 360.0;
-						}
-					    for (i=0;i<pixels_ss;i++)
-						{
-						if (sslon[i] > 0.0)
-						    sslon[i] -= 360.0;
-						}
-					    }
-					else if (lonflip_use == 1)
-					    {
-					    if (navlon < 0.0)
-						navlon += 360.0;
-					    for (i=0;i<beams_bath;i++)
-						{
-						if (bathlon[i] < 0.0)
-						    bathlon[i] += 360.0;
-						}
-					    for (i=0;i<pixels_ss;i++)
-						{
-						if (sslon[i] < 0.0)
-						    sslon[i] += 360.0;
-						}
-					    }
-					else if (lonflip_use == 0)
-					    {
-					    if (navlon < -180.0)
-						navlon += 360.0;
-					    if (navlon > 180.0)
-						navlon -= 360.0;
-					    for (i=0;i<beams_bath;i++)
-						{
-						if (bathlon[i] < -180.0)
-						    bathlon[i] += 360.0;
-						if (bathlon[i] > 180.0)
-						    bathlon[i] -= 360.0;
-						}
-					    for (i=0;i<pixels_ss;i++)
-						{
-						if (sslon[i] < -180.0)
-						    sslon[i] += 360.0;
-						if (sslon[i] > 180.0)
-						    sslon[i] -= 360.0;
-						}
-					    }
-					}
-				    }
-
-				/* get beginning values */
-				if (irec == 1)
-					{
-					if (beams_bath > 0)
-						{
-						if (mb_beam_ok(beamflag[beams_bath/2]))
-							bathbeg = bath[beams_bath/2];
-						else
-							bathbeg = altitude + sonardepth;
-						}
-					lonbeg = navlon;
-					latbeg = navlat;
-					timbeg = time_d;
-					timbegfile = time_d;
-					for (i=0;i<7;i++)
-						timbeg_i[i] = time_i[i];
-					spdbeg = speed;
-					hdgbeg = heading;
-					sdpbeg = sonardepth;
-					altbeg = altitude;
-					}
-				else if (good_nav_only == MB_YES)
-					{
-					if (lonbeg == 0.0 && latbeg == 0.0
-						&& navlon != 0.0 && navlat != 0.0)
-						{
-						lonbeg = navlon;
-						if (beams_bath > 0)
-							{
-							if (mb_beam_ok(beamflag[beams_bath/2]))
-								bathbeg = bath[beams_bath/2];
-							else
-								bathbeg = altitude + sonardepth;
-							}
-						latbeg = navlat;
-						if (spdbeg == 0.0 && speed != 0.0)
-							spdbeg = speed;
-						if (hdgbeg == 0.0 && heading != 0.0)
-							hdgbeg = heading;
-						if (sdpbeg == 0.0 && sonardepth != 0.0)
-							sdpbeg = sonardepth;
-						if (altbeg == 0.0 && altitude != 0.0)
-							altbeg = altitude;
-						}
-					}
-
-				/* reset ending values each time */
-				if (beams_bath > 0)
-					{
-					if (mb_beam_ok(beamflag[beams_bath/2]))
-						bathend = bath[beams_bath/2];
-					else
-						bathend = altitude + sonardepth;
-					}
-				lonend = navlon;
-				latend = navlat;
-				spdend = speed;
-				hdgend = heading;
-				sdpend = sonardepth;
-				altend = altitude;
-				timend = time_d;
-				timendfile = time_d;
-				for (i=0;i<7;i++)
-					timend_i[i] = time_i[i];
-
-				/* check for good nav */
-				speed_apparent = 3600.0*distance
-					/(time_d - time_d_last);
-				if (good_nav_only == MB_YES)
-					{
-					if (navlon == 0.0 || navlat == 0.0)
-					    {
-					    good_nav = MB_NO;
-					    }
-					else if (beginnav == MB_YES
-					    && speed_apparent >= speed_threshold)
-					    {
-					    good_nav = MB_NO;
-					    }
-					else
-					    {
-					    good_nav = MB_YES;
-					    }
-					}
-				else
-					good_nav = MB_YES;
-
-				/* get total distance */
-				if (good_nav_only == MB_NO ||
-					(good_nav == MB_YES
-					&& speed_apparent < speed_threshold))
-					{
-					distot+= distance;
-					distotfile += distance;
-					}
-
-				/* get starting mins and maxs */
-				if (beginnav == MB_NO && good_nav == MB_YES)
-					{
-					lonmin = navlon;
-					lonmax = navlon;
-					latmin = navlat;
-					latmax = navlat;
-					beginnav = MB_YES;
-					}
-				if (beginsdp == MB_NO && sonardepth > 0.0)
-					{
-					sdpmin = sonardepth;
-					sdpmax = sonardepth;
-					beginsdp = MB_YES;
-					}
-				if (beginalt == MB_NO && altitude > 0.0)
-					{
-					altmin = altitude;
-					altmax = altitude;
-					beginalt = MB_YES;
-					}
-				if (beginbath == MB_NO && beams_bath > 0)
-					for (i=0;i<beams_bath;i++)
-						if (mb_beam_ok(beamflag[i]))
-							{
-							bathmin = bath[i];
-							bathmax = bath[i];
-							beginbath = MB_YES;
-							}
-				if (beginamp == MB_NO && beams_amp > 0)
-					for (i=0;i<beams_amp;i++)
-						if (mb_beam_ok(beamflag[i]))
-							{
-							ampmin = amp[i];
-							ampmax = amp[i];
-							beginamp = MB_YES;
-							}
-				if (beginss == MB_NO && pixels_ss > 0)
-					for (i=0;i<pixels_ss;i++)
-						if (ss[i] > MB_SIDESCAN_NULL)
-							{
-							ssmin = ss[i];
-							ssmax = ss[i];
-							beginss = MB_YES;
-							}
-
-				/* get mins and maxs */
-				if (good_nav == MB_YES && beginnav == MB_YES)
-					{
-					lonmin = MIN(lonmin, navlon);
-					lonmax = MAX(lonmax, navlon);
-					latmin = MIN(latmin, navlat);
-					latmax = MAX(latmax, navlat);
-					}
-				if (beginsdp == MB_YES)
-					{
-					sdpmin = MIN(sdpmin, sonardepth);
-					sdpmax = MAX(sdpmax, sonardepth);
-					}
-				if (beginalt == MB_YES)
-					{
-					altmin = MIN(altmin, altitude);
-					altmax = MAX(altmax, altitude);
-					}
-				for (i=0;i<beams_bath;i++)
-					{
-					if (mb_beam_ok(beamflag[i]))
-						{
-						if (good_nav == MB_YES && beginnav == MB_YES)
-							{
-							lonmin = MIN(lonmin, bathlon[i]);
-							lonmax = MAX(lonmax, bathlon[i]);
-							latmin = MIN(latmin, bathlat[i]);
-							latmax = MAX(latmax, bathlat[i]);
-							}
-						bathmin = MIN(bathmin, bath[i]);
-						bathmax = MAX(bathmax, bath[i]);
-						ngdbeams++;
-						}
-					else if (beamflag[i] == MB_FLAG_NULL)
-						nzdbeams++;
-					else
-						nfdbeams++;
-					}
-				for (i=0;i<beams_amp;i++)
-					{
-					if (mb_beam_ok(beamflag[i]))
-						{
-						ampmin = MIN(ampmin, amp[i]);
-						ampmax = MAX(ampmax, amp[i]);
-						ngabeams++;
-						}
-					else if (beamflag[i] == MB_FLAG_NULL)
-						nzabeams++;
-					else
-						nfabeams++;
-					}
-				for (i=0;i<pixels_ss;i++)
-					{
-					if (ss[i] > MB_SIDESCAN_NULL)
-						{
-						if (good_nav == MB_YES && beginnav == MB_YES)
-							{
-							lonmin = MIN(lonmin, sslon[i]);
-							lonmax = MAX(lonmax, sslon[i]);
-							latmin = MIN(latmin, sslat[i]);
-							latmax = MAX(latmax, sslat[i]);
-							}
-						ssmin = MIN(ssmin, ss[i]);
-						ssmax = MAX(ssmax, ss[i]);
-						ngsbeams++;
-						}
-					else if (ss[i] == 0.0)
-						nzsbeams++;
-					else
-						nfsbeams++;
-					}
-
-				/* reset time of last ping */
-				time_d_last = time_d;
-				}
-
-			/* update coverage mask */
-			if (pass == 1 && coverage_mask == MB_YES
-				&& (error == MB_ERROR_NO_ERROR
-				    || error == MB_ERROR_TIME_GAP))
-			    {
-			    ix = (int)((navlon - lonmin) / mask_dx);
-			    iy = (int)((navlat - latmin) / mask_dy);
-			    if (ix >= 0 && ix < mask_nx
-				&& iy >= 0 && iy < mask_ny)
-				{
-				mask[ix+iy*mask_nx] = MB_YES;
-				}
-			    for (i=0;i<beams_bath;i++)
-				{
-				if (mb_beam_ok(beamflag[i]))
-				    {
-				    ix = (int)((bathlon[i] - lonmin) / mask_dx);
-				    iy = (int)((bathlat[i] - latmin) / mask_dy);
-				    if (ix >= 0 && ix < mask_nx
-					&& iy >= 0 && iy < mask_ny)
-					{
-					mask[ix+iy*mask_nx] = MB_YES;
-					}
-				    }
-				}
-			    for (i=0;i<pixels_ss;i++)
-				{
-				if (ss[i] > MB_SIDESCAN_NULL)
-				    {
-				    ix = (int)((sslon[i] - lonmin) / mask_dx);
-				    iy = (int)((sslat[i] - latmin) / mask_dy);
-				    if (ix >= 0 && ix < mask_nx
-					&& iy >= 0 && iy < mask_ny)
-					{
-					mask[ix+iy*mask_nx] = MB_YES;
-					}
-				    }
-				}
-			    }
-
-			/* look for problems */
-			if (pass == 0
-				&& (error == MB_ERROR_NO_ERROR
-				    || error == MB_ERROR_TIME_GAP))
-			    {
-			    if (navlon == 0.0 || navlat == 0.0)
-				mb_notice_log_problem(verbose, mbio_ptr, MB_PROBLEM_ZERO_NAV);
-			    else if (beginnav == MB_YES
-				&& speed_apparent >= speed_threshold)
-				mb_notice_log_problem(verbose, mbio_ptr, MB_PROBLEM_TOO_FAST);
-			    for (i=0;i<beams_bath;i++)
-				{
-				if (mb_beam_ok(beamflag[i]))
-				    {
-				    if (bath[i] > 11000.0)
-					mb_notice_log_problem(verbose, mbio_ptr,
-						MB_PROBLEM_TOO_DEEP);
-				    }
-				}
-			    }
-			}
-
-		/* print debug statements */
-		if (verbose >= 2)
-			{
-			fprintf(stream,"\ndbg2  Reading loop finished in program <%s>\n",
-				program_name);
-			fprintf(stream,"dbg2       status:     %d\n",status);
-			fprintf(stream,"dbg2       error:      %d\n",error);
-			fprintf(stream,"dbg2       nread:      %d\n",nread);
-			fprintf(stream,"dbg2       pings_read: %d\n",pings_read);
-			}
-
-		/* process the pings */
-		if (pass == 0
-			&& pings_read > 2
-			&& nread == pings_read
-			&& (error == MB_ERROR_NO_ERROR
-			|| error == MB_ERROR_TIME_GAP))
-			{
-
-			/* do the bathymetry */
-			for (i=0;i<beams_bath;i++)
-				{
-
-				/* fit line to depths */
-				nbath  = 0;
-				sumx  = 0.0;
-				sumxx = 0.0;
-				sumy  = 0.0;
-				sumxy = 0.0;
-				variance = 0.0;
-				for (j=0;j<nread;j++)
-					{
-					datacur = data[j];
-					bath = datacur->bath;
-					beamflag = datacur->beamflag;
-					if (mb_beam_ok(beamflag[i]))
-					  {
-					  nbath++;
-					  sumx  = sumx + j;
-					  sumxx = sumxx + j*j;
-					  sumy  = sumy + bath[i];
-					  sumxy = sumxy + j*bath[i];
-					  }
-					}
-				if (nbath == pings_read)
-					{
-					delta = nbath*sumxx - sumx*sumx;
-					a = (sumxx*sumy - sumx*sumxy)/delta;
-					b = (nbath*sumxy - sumx*sumy)/delta;
-					for (j=0;j<nread;j++)
-					  {
-					  datacur = data[j];
-					  bath = datacur->bath;
-					  beamflag = datacur->beamflag;
-					  if (mb_beam_ok(beamflag[i]))
-					    {
-					    dev = bath[i] - a - b*j;
-					    variance = variance + dev*dev;
-					    }
-					  }
-					bathmean[i] = bathmean[i] + sumy;
-					bathvar[i] = bathvar[i] + variance;
-					nbathvar[i] = nbathvar[i] + nbath;
-					}
-				}
-
-			/* do the amplitude */
-			for (i=0;i<beams_amp;i++)
-				{
-
-				/* get mean amplitude */
-				namp  = 0;
-				mean  = 0.0;
-				variance = 0.0;
-				for (j=0;j<nread;j++)
-					{
-					datacur = data[j];
-					amp = datacur->amp;
-					beamflag = datacur->beamflag;
-					if (mb_beam_ok(beamflag[i]))
-					  {
-					  namp++;
-					  mean  = mean + amp[i];
-					  }
-					}
-				if (namp == pings_read)
-					{
-					mean = mean/namp;
-					for (j=0;j<nread;j++)
-					  {
-					  datacur = data[j];
-					  amp = datacur->amp;
-					  if (mb_beam_ok(beamflag[i]))
-					    {
-					    dev = amp[i] - mean;
-					    variance = variance + dev*dev;
-					    }
-					  }
-					ampmean[i] = ampmean[i] + namp*mean;
-					ampvar[i] = ampvar[i] + variance;
-					nampvar[i] = nampvar[i] + namp;
-					}
-				}
-
-			/* do the sidescan */
-			for (i=0;i<pixels_ss;i++)
-				{
-
-				/* get mean sidescan */
-				nss  = 0;
-				mean  = 0.0;
-				variance = 0.0;
-				for (j=0;j<nread;j++)
-					{
-					datacur = data[j];
-					ss = datacur->ss;
-					if (ss[i] > MB_SIDESCAN_NULL)
-					  {
-					  nss++;
-					  mean  = mean + ss[i];
-					  }
-					}
-				if (nss == pings_read)
-					{
-					mean = mean/nss;
-					for (j=0;j<nread;j++)
-					  {
-					  datacur = data[j];
-					  ss = datacur->ss;
-					  if (ss[i] > MB_SIDESCAN_NULL)
-					    {
-					    dev = ss[i] - mean;
-					    variance = variance + dev*dev;
-					    }
-					  }
-					ssmean[i] = ssmean[i] + nss*mean;
-					ssvar[i] = ssvar[i] + variance;
-					nssvar[i] = nssvar[i] + nss;
-					}
-				}
-			}
-
-		/* print debug statements */
-		if (verbose >= 2)
-			{
-			fprintf(stream,"\ndbg2  Processing loop finished in program <%s>\n",
-				program_name);
-			fprintf(stream,"dbg2       status:     %d\n",status);
-			fprintf(stream,"dbg2       error:      %d\n",error);
-			fprintf(stream,"dbg2       nread:      %d\n",nread);
-			fprintf(stream,"dbg2       pings_read: %d\n",pings_read);
-			}
-		}
-
-	/* look for problems */
-	timtotfile = (timendfile - timbegfile)/3600.0;
-	if (timtotfile > 0.0)
-		spdavgfile = distotfile/timtotfile;
-	if (irecfile <= 0)
-	    mb_notice_log_problem(verbose, mbio_ptr, MB_PROBLEM_NO_DATA);
-	else if (timtotfile > 0.0 && spdavgfile >= speed_threshold)
-		mb_notice_log_problem(verbose, mbio_ptr, MB_PROBLEM_AVG_TOO_FAST);
-
-	/* get notices if desired */
-	if (print_notices == MB_YES && pass == 0)
-		{
-		status = mb_notice_get_list(verbose, mbio_ptr,
-					    notice_list);
-		for (i=0;i<MB_NOTICE_MAX;i++)
-			notice_list_tot[i] += notice_list[i];
-		}
-
-	/* deal with statistics */
-	if (pings_read > 2)
-		{
-		/* allocate total statistics arrays if needed */
-		if (nbathtot_alloc < beams_bath_max)
-			{
-			status = mb_reallocd(verbose,__FILE__,__LINE__,beams_bath_max*sizeof(double),
-						(void **)&bathmeantot,&error);
-			status = mb_reallocd(verbose,__FILE__,__LINE__,beams_bath_max*sizeof(double),
-						(void **)&bathvartot,&error);
-			status = mb_reallocd(verbose,__FILE__,__LINE__,beams_bath_max*sizeof(int),
-						(void **)&nbathvartot,&error);
-			if (error != MB_ERROR_NO_ERROR)
-				{
-				mb_error(verbose,error,&message);
-				fprintf(stream,"\nMBIO Error allocating data arrays:\n%s\n",message);
-				fprintf(stream,"\nProgram <%s> Terminated\n",
-					program_name);
-				exit(error);
-				}
-			else
-				{
-				for (i=nbathtot_alloc;i<beams_bath_max;i++)
-					{
-					bathmeantot[i] = 0.0;
-					bathvartot[i] = 0.0;
-					nbathvartot[i] = 0;
-					}
-				nbathtot_alloc = beams_bath_max;
-				}
-			}
-		if (namptot_alloc < beams_amp_max)
-			{
-			status = mb_reallocd(verbose,__FILE__,__LINE__,beams_amp_max*sizeof(double),
-						(void **)&ampmeantot,&error);
-			status = mb_reallocd(verbose,__FILE__,__LINE__,beams_amp_max*sizeof(double),
-						(void **)&ampvartot,&error);
-			status = mb_reallocd(verbose,__FILE__,__LINE__,beams_amp_max*sizeof(int),
-						(void **)&nampvartot,&error);
-			if (error != MB_ERROR_NO_ERROR)
-				{
-				mb_error(verbose,error,&message);
-				fprintf(stream,"\nMBIO Error allocating data arrays:\n%s\n",message);
-				fprintf(stream,"\nProgram <%s> Terminated\n",
-					program_name);
-				exit(error);
-				}
-			else
-				{
-				for (i=namptot_alloc;i<beams_amp_max;i++)
-					{
-					ampmeantot[i] = 0.0;
-					ampvartot[i] = 0.0;
-					nampvartot[i] = 0;
-					}
-				namptot_alloc = beams_amp_max;
-				}
-			}
-		if (nsstot_alloc < pixels_ss_max)
-			{
-			status = mb_reallocd(verbose,__FILE__,__LINE__,pixels_ss_max*sizeof(double),
-						(void **)&ssmeantot,&error);
-			status = mb_reallocd(verbose,__FILE__,__LINE__,pixels_ss_max*sizeof(double),
-						(void **)&ssvartot,&error);
-			status = mb_reallocd(verbose,__FILE__,__LINE__,pixels_ss_max*sizeof(int),
-						(void **)&nssvartot,&error);
-			if (error != MB_ERROR_NO_ERROR)
-				{
-				mb_error(verbose,error,&message);
-				fprintf(stream,"\nMBIO Error allocating data arrays:\n%s\n",message);
-				fprintf(stream,"\nProgram <%s> Terminated\n",
-					program_name);
-				exit(error);
-				}
-			else
-				{
-				for (i=nsstot_alloc;i<pixels_ss_max;i++)
-					{
-					ssmeantot[i] = 0.0;
-					ssvartot[i] = 0.0;
-					nssvartot[i] = 0;
-					}
-				nsstot_alloc = pixels_ss_max;
-				}
-			}
-
-		/* copy statistics to total statistics */
-		for (i=0;i<beams_bath;i++)
-			{
-			bathmeantot[i] += bathmean[i];
-			bathvartot[i] += bathvar[i];
-			nbathvartot[i] += nbathvar[i];
-			}
-		for (i=0;i<beams_amp;i++)
-			{
-			ampmeantot[i] += ampmean[i];
-			ampvartot[i] += ampvar[i];
-			nampvartot[i] += nampvar[i];
-			}
-		for (i=0;i<pixels_ss;i++)
-			{
-			ssmeantot[i] += ssmean[i];
-			ssvartot[i] += ssvar[i];
-			nssvartot[i] += nssvar[i];
-			}
-		}
-
-	/* close the swath file */
-	status = mb_close(verbose,&mbio_ptr,&error);
-
-	/* figure out whether and what to read next */
-        if (read_datalist == MB_YES)
-                {
-		if ((status = mb_datalist_read(verbose,datalist,
-			    file,&format,&file_weight,&error))
-			    == MB_SUCCESS)
-                        read_data = MB_YES;
-                else
-                        read_data = MB_NO;
-                }
-        else
-                {
-                read_data = MB_NO;
-                }
-
-	/* end loop over files in list */
-	}
-	if (read_datalist == MB_YES)
-		mb_datalist_close(verbose,&datalist,&error);
-
-	/* figure out if done */
-	if (pass > 0 || coverage_mask == MB_NO)
-	    done = MB_YES;
-	pass++;
-
-	/* end loop over reading passes */
-	}
-
-	/* calculate final variances */
-	if (pings_read > 2)
-		{
-		for (i=0;i<nbathtot_alloc;i++)
-			if (nbathvartot[i] > 0)
-				{
-				bathmeantot[i] = bathmeantot[i]/nbathvartot[i];
-				bathvartot[i] = bathvartot[i]/nbathvartot[i];
-				}
-		for (i=0;i<namptot_alloc;i++)
-			if (nampvartot[i] > 0)
-				{
-				ampmeantot[i] = ampmeantot[i]/nampvartot[i];
-				ampvartot[i] = ampvartot[i]/nampvartot[i];
-				}
-		for (i=0;i<nsstot_alloc;i++)
-			if (nssvartot[i] > 0)
-				{
-				ssmeantot[i] = ssmeantot[i]/nssvartot[i];
-				ssvartot[i] = ssvartot[i]/nssvartot[i];
-				}
-		}
-
-	/* calculate percentages of data */
-	if (ntdbeams > 0)
-		{
-		ngd_percent = 100.0*ngdbeams/ntdbeams;
-		nzd_percent = 100.0*nzdbeams/ntdbeams;
-		nfd_percent = 100.0*nfdbeams/ntdbeams;
-		}
-	else
-		{
-		ngd_percent = 0.0;
-		nzd_percent = 0.0;
-		nfd_percent = 0.0;
-		}
-	if (ntabeams > 0)
-		{
-		nga_percent = 100.0*ngabeams/ntabeams;
-		nza_percent = 100.0*nzabeams/ntabeams;
-		nfa_percent = 100.0*nfabeams/ntabeams;
-		}
-	else
-		{
-		nga_percent = 0.0;
-		nza_percent = 0.0;
-		nfa_percent = 0.0;
-		}
-	if (ntsbeams > 0)
-		{
-		ngs_percent = 100.0*ngsbeams/ntsbeams;
-		nzs_percent = 100.0*nzsbeams/ntsbeams;
-		nfs_percent = 100.0*nfsbeams/ntsbeams;
-		}
-	else
-		{
-		ngs_percent = 0.0;
-		nzs_percent = 0.0;
-		nfs_percent = 0.0;
-		}
-
-	/* now print out the results */
-	timtot = (timend - timbeg)/3600.0;
-	if (timtot > 0.0)
-		spdavg = distot/timtot;
-	mb_get_jtime(verbose,timbeg_i,timbeg_j);
-	mb_get_jtime(verbose,timend_i,timend_j);
-
-	switch (output_format)
-		{
-		case FREE_TEXT:
-			fprintf(output,"\nData Totals:\n");
-			fprintf(output,"Number of Records:                    %8d\n",irec);
-			isbtmrec = notice_list_tot[MB_DATA_SUBBOTTOM_MCS]
-					+ notice_list_tot[MB_DATA_SUBBOTTOM_CNTRBEAM]
-					+ notice_list_tot[MB_DATA_SUBBOTTOM_SUBBOTTOM];
-			if (isbtmrec > 0)
-				fprintf(output,"Number of Subbottom Records:          %8d\n",isbtmrec);
-			if (notice_list_tot[MB_DATA_SIDESCAN2] > 0)
-				fprintf(output,"Number of Secondary Sidescan Records: %8d\n",notice_list_tot[MB_DATA_SIDESCAN2]);
-			if (notice_list_tot[MB_DATA_SIDESCAN3] > 0)
-				fprintf(output,"Number of Tertiary Sidescan Records:  %8d\n",notice_list_tot[MB_DATA_SIDESCAN3]);
-			if (notice_list_tot[MB_DATA_WATER_COLUMN] > 0)
-				fprintf(output,"Number of Water Column Records:       %8d\n",notice_list_tot[MB_DATA_WATER_COLUMN]);
-
-			fprintf(output,"Bathymetry Data (%d beams):\n",beams_bath_max);
-			fprintf(output,"  Number of Beams:         %8d\n",
-				ntdbeams);
-			fprintf(output,"  Number of Good Beams:    %8d     %5.2f%%\n",
-				ngdbeams, ngd_percent);
-			fprintf(output,"  Number of Zero Beams:    %8d     %5.2f%%\n",
-				nzdbeams, nzd_percent);
-			fprintf(output,"  Number of Flagged Beams: %8d     %5.2f%%\n",
-				nfdbeams, nfd_percent);
-			fprintf(output,"Amplitude Data (%d beams):\n",beams_amp_max);
-			fprintf(output,"  Number of Beams:         %8d\n",
-				ntabeams);
-			fprintf(output,"  Number of Good Beams:    %8d     %5.2f%%\n",
-				ngabeams, nga_percent);
-			fprintf(output,"  Number of Zero Beams:    %8d     %5.2f%%\n",
-				nzabeams, nza_percent);
-			fprintf(output,"  Number of Flagged Beams: %8d     %5.2f%%\n",
-				nfabeams, nfa_percent);
-			fprintf(output,"Sidescan Data (%d pixels):\n",pixels_ss_max);
-			fprintf(output,"  Number of Pixels:        %8d\n",
-				ntsbeams);
-			fprintf(output,"  Number of Good Pixels:   %8d     %5.2f%%\n",
-				ngsbeams, ngs_percent);
-			fprintf(output,"  Number of Zero Pixels:   %8d     %5.2f%%\n",
-				nzsbeams, nzs_percent);
-			fprintf(output,"  Number of Flagged Pixels:%8d     %5.2f%%\n",
-				nfsbeams, nfs_percent);
-			fprintf(output,"\nNavigation Totals:\n");
-			fprintf(output,"Total Time:         %10.4f hours\n",timtot);
-			fprintf(output,"Total Track Length: %10.4f km\n",distot);
-			fprintf(output,"Average Speed:      %10.4f km/hr (%7.4f knots)\n",
-				spdavg,spdavg/1.85);
-			fprintf(output,"\nStart of Data:\n");
-			fprintf(output,"Time:  %2.2d %2.2d %4.4d %2.2d:%2.2d:%2.2d.%6.6d  JD%d (%4.4d-%2.2d-%2.2dT%2.2d:%2.2d:%2.2d.%6.6d)\n",
-				timbeg_i[1],timbeg_i[2],timbeg_i[0],timbeg_i[3],
-				timbeg_i[4],timbeg_i[5],timbeg_i[6],timbeg_j[1],
-				timbeg_i[0],timbeg_i[1],timbeg_i[2],timbeg_i[3],timbeg_i[4],timbeg_i[5],timbeg_i[6]);
-			if (bathy_in_feet == MB_NO)
-				fprintf(output,"Lon: %15.9f     Lat: %15.9f     Depth: %10.4f meters\n",
-					lonbeg,latbeg,bathbeg);
-			else
-				fprintf(output,"Lon: %15.9f     Lat: %15.9f     Depth: %10.4f feet\n",
-					lonbeg,latbeg,bathy_scale*bathbeg);
-			fprintf(output,"Speed: %7.4f km/hr (%7.4f knots)  Heading:%9.4f degrees\n",
-				spdbeg,spdbeg/1.85,hdgbeg);
-			fprintf(output,"Sonar Depth:%10.4f m  Sonar Altitude:%10.4f m\n",
-				sdpbeg,altbeg);
-			fprintf(output,"\nEnd of Data:\n");
-			fprintf(output,"Time:  %2.2d %2.2d %4.4d %2.2d:%2.2d:%2.2d.%6.6d  JD%d (%4.4d-%2.2d-%2.2dT%2.2d:%2.2d:%2.2d.%6.6d)\n",
-				timend_i[1],timend_i[2],timend_i[0],timend_i[3],
-				timend_i[4],timend_i[5],timend_i[6],timend_j[1],
-				timend_i[0],timend_i[1],timend_i[2],timend_i[3],timend_i[4],timend_i[5],timend_i[6]);
-			if (bathy_in_feet == MB_NO)
-				fprintf(output,"Lon: %15.9f     Lat: %15.9f     Depth: %10.4f meters\n",
-					lonend,latend,bathend);
-			else
-				fprintf(output,"Lon: %15.9f     Lat: %15.9f     Depth: %10.4f feet\n",
-					lonend,latend,bathy_scale*bathend);
-			fprintf(output,"Speed: %7.4f km/hr (%7.4f knots)  Heading:%9.4f degrees\n",
-				spdend,spdend/1.85,hdgend);
-			fprintf(output,"Sonar Depth:%10.4f m  Sonar Altitude:%10.4f m\n",
-				sdpend,altend);
-			fprintf(output,"\nLimits:\n");
-			fprintf(output,"Minimum Longitude:   %15.9f   Maximum Longitude:   %15.9f\n",lonmin,lonmax);
-			fprintf(output,"Minimum Latitude:    %15.9f   Maximum Latitude:    %15.9f\n",latmin,latmax);
-			fprintf(output,"Minimum Sonar Depth: %10.4f   Maximum Sonar Depth: %10.4f\n",sdpmin,sdpmax);
-			fprintf(output,"Minimum Altitude:    %10.4f   Maximum Altitude:    %10.4f\n",altmin,altmax);
-			if (ngdbeams > 0 || verbose >= 1)
-				fprintf(output,"Minimum Depth:       %10.4f   Maximum Depth:       %10.4f\n",
-					bathy_scale*bathmin,bathy_scale*bathmax);
-			if (ngabeams > 0 || verbose >= 1)
-				fprintf(output,"Minimum Amplitude:   %10.4f   Maximum Amplitude:   %10.4f\n",
-					ampmin,ampmax);
-			if (ngsbeams > 0 || verbose >= 1)
-				fprintf(output,"Minimum Sidescan:    %10.4f   Maximum Sidescan:    %10.4f\n",
-					ssmin,ssmax);
-			break;
-		case JSON:
-			fprintf(output,"\"data_totals\": {\n");
-			fprintf(output,"\"number_of_records\":\"%d\"",irec);
-			isbtmrec = notice_list_tot[MB_DATA_SUBBOTTOM_MCS]
-					+ notice_list_tot[MB_DATA_SUBBOTTOM_CNTRBEAM]
-					+ notice_list_tot[MB_DATA_SUBBOTTOM_SUBBOTTOM];
-			if (isbtmrec > 0)
-				fprintf(output,",\n\"number_of_subbottom_records\":\"%d\"\n",isbtmrec);
-			if (notice_list_tot[MB_DATA_SIDESCAN2] > 0)
-				fprintf(output,",\n\"number_of_secondary_sidescan_records\": \"%d\"",notice_list_tot[MB_DATA_SIDESCAN2]);
-			if (notice_list_tot[MB_DATA_SIDESCAN3] > 0)
-				fprintf(output,",\n\"number_of_tertiary_sidescan_records\": \"%d\"",notice_list_tot[MB_DATA_SIDESCAN3]);
-			if (notice_list_tot[MB_DATA_WATER_COLUMN] > 0)
-				fprintf(output,",\n\"number_of_water_column_records\": \"%d\"",notice_list_tot[MB_DATA_WATER_COLUMN]);
-			fprintf(output,"\n},\n");
-
-			fprintf(output,"\"bathymetry_data\": {\n\"max_beams_per_ping\": \"%d\",\n",beams_bath_max);
-			fprintf(output,"\"number_beams\": \"%d\",\n", ntdbeams);
-			fprintf(output,"\"number_good_beams\": \"%d\",\n\"percent_good_beams\": \"%5.2f\",\n",
-				ngdbeams, ngd_percent);
-			fprintf(output,"\"number_zero_beams\": \"%d\",\n\"percent_zero_beams\": \"%5.2f\",\n",
-				nzdbeams, nzd_percent);
-			fprintf(output,"\"number_flagged_beams\": \"%d\",\n\"percent_flagged_beams\": \"%5.2f\"\n",
-				nfdbeams, nfd_percent);
-			fprintf(output,"},\n");
-
-			fprintf(output,"\"amplitude_data\": {\n\"max_beams_per_ping\": \"%d\",\n",beams_amp_max);
-			fprintf(output,"\"number_beams\": \"%d\",\n", ntabeams);
-			fprintf(output,"\"number_good_beams\": \"%d\",\n\"percent_good_beams\": \" %5.2f\",\n",
-				ngabeams, nga_percent);
-			fprintf(output,"\"number_zero_beams\": \"%d\",\n\"percent_zero_beams\": \"%5.2f\",\n",
-				nzabeams, nza_percent);
-			fprintf(output,"\"number_flagged_beams\": \"%d\",\n\"percent_flagged_beams\": \"%5.2f\"\n",
-				nfabeams, nfa_percent);
-			fprintf(output,"},\n");
-
-			fprintf(output,"\"sidescan_data\": {\n\"max_pixels_per_ping\": \"%d\",\n",pixels_ss_max);
-			fprintf(output,"\"number_of_pixels\": \"%d\",\n", ntsbeams);
-			fprintf(output,"\"number_good_pixels\": \"%d\",\n\"percent_good_pixels\": \"%5.2f\",\n",
-				ngsbeams, ngs_percent);
-			fprintf(output,"\"number_zero_pixels\": \"%d\",\n\"percent_good_pixels\": \"%5.2f\",\n",
-				nzsbeams, nzs_percent);
-			fprintf(output,"\"number_flagged_pixels\": \"%d\",\n\"percent_flagged_pixels\": \"%5.2f\"\n",
-				nfsbeams, nfs_percent);
-			fprintf(output,"},\n");
-
-			fprintf(output,"\"navigation_totals\": {\n");
-			fprintf(output,"\"total_time_hours\": \"%.4f\",\n",timtot);
-			fprintf(output,"\"total_track_length_km\": \"%.4f\",\n",distot);
-			fprintf(output,"\"average_speed_km_per_hr\": \"%.4f\",\n\"average_speed_knots\": \"%.4f\"\n",
-				spdavg,spdavg/1.85);
-			fprintf(output,"},\n");
-
-			fprintf(output,"\"start_of_data\": {\n");
-			fprintf(output,"\"time\": \"%2.2d %2.2d %4.4d %2.2d:%2.2d:%2.2d.%6.6d  JD%d\",\n",
-				timbeg_i[1],timbeg_i[2],timbeg_i[0],timbeg_i[3],
-				timbeg_i[4],timbeg_i[5],timbeg_i[6],timbeg_j[1]);
-			fprintf(output,"\"time_iso\": \"%4.4d-%2.2d-%2.2dT%2.2d:%2.2d:%2.2d.%6.6d\",\n",
-				timbeg_i[0],timbeg_i[1],timbeg_i[2],timbeg_i[3],timbeg_i[4],timbeg_i[5],timbeg_i[6]);
-			if (bathy_in_feet == MB_NO)
-				fprintf(output,"\"longitude\": \"%.9f\",\n\"latitude\": \"%.9f\",\n\"depth_meters\": \"%.4f\",\n",
-					lonbeg,latbeg,bathbeg);
-			else
-				fprintf(output,"\"longitude\": \"%.9f\",\n\"latitude\": \"%.9f\",\n\"depth_feet\": \"%.4f\",\n",
-					lonbeg,latbeg,bathy_scale*bathbeg);
-			fprintf(output,"\"speed_km_per_hour\": \"%.4f\",\n\"speed_knots\": \"%.4f\",\n\"heading_degrees\": \"%.4f\",\n",
-				spdbeg,spdbeg/1.85,hdgbeg);
-			fprintf(output,"\"sonar_depth_meters\": \"%.4f\",\n\"sonar_altitude_meters\": \"%.4f\"\n",
-				sdpbeg,altbeg);
-			fprintf(output,"},\n");
-
-			fprintf(output,"\"end_of_data\": {\n");
-			fprintf(output,"\"time\": \"%2.2d %2.2d %4.4d %2.2d:%2.2d:%2.2d.%6.6d  JD%d\",\n",
-				timend_i[1],timend_i[2],timend_i[0],timend_i[3],
-				timend_i[4],timend_i[5],timend_i[6],timend_j[1]);
-			fprintf(output,"\"time_iso\": \"%4.4d-%2.2d-%2.2dT%2.2d:%2.2d:%2.2d.%6.6d\",\n",
-				timend_i[0],timend_i[1],timend_i[2],timend_i[3],timend_i[4],timend_i[5],timend_i[6]);
-			if (bathy_in_feet == MB_NO)
-				fprintf(output,"\"longitude\": \"%.9f\",\n\"latitude\": \"%.9f\",\n\"depth_meters\": \"%.4f\",\n",
-					lonend,latend,bathend);
-			else
-				fprintf(output,"\"longitude\": \"%.9f\",\n\"latitude\": \"%.9f\",\n\"depth_feet\": \"%.4f\",\n",
-					lonend,latend,bathy_scale*bathend);
-			fprintf(output,"\"speed_km_per_hour\": \"%.4f\",\n\"speed_knots\": \"%.4f\",\n\"heading_degrees\": \"%.4f\",\n",
-				spdend,spdend/1.85,hdgend);
-			fprintf(output,"\"sonar_depth_meters\": \"%.4f\",\n\"sonar_altitude_meters\": \"%.4f\"\n",
-				sdpend,altend);
-			fprintf(output,"},\n");
-
-			fprintf(output,"\"limits\": {\n");
-			fprintf(output,"\"minimum_longitude\": \"%.9f\",\n\"maximum_longitude\": \"%.9f\",\n",lonmin,lonmax);
-			fprintf(output,"\"minimum_latitude\": \"%.9f\",\n\"maximum_latitude\": \"%.9f\",\n",latmin,latmax);
-			fprintf(output,"\"minimum_sonar_depth\": \"%.4f\",\n\"maximum_sonar_depth\": \"%.4f\",\n",sdpmin,sdpmax);
-			fprintf(output,"\"minimum_altitude\": \"%.4f\",\n\"maximum_altitude\": \"%.4f\"",altmin,altmax);
-			if (ngdbeams > 0 || verbose >= 1)
-				fprintf(output,",\n\"minimum_depth\": \"%.4f\",\n\"maximum_depth\": \"%.4f\"",
-					bathy_scale*bathmin,bathy_scale*bathmax);
-			if (ngabeams > 0 || verbose >= 1)
-				fprintf(output,",\n\"minimum_amplitude\": \"%.4f\",\n\"maximum_amplitude\": \"%.4f\"",
-					ampmin,ampmax);
-			if (ngsbeams > 0 || verbose >= 1)
-				fprintf(output,",\n\"minimum_sidescan\": \"%.4f\",\n\"maximum_sidescan\": \"%.4f\"",
-					ssmin,ssmax);
-			fprintf(output,"\n}");
-			break;
-		case XML:
-			fprintf(output,"\t<data_totals>\n");
-			fprintf(output,"\t\t<number_of_records>%d</number_of_records>\n",irec);
-			isbtmrec = notice_list_tot[MB_DATA_SUBBOTTOM_MCS]
-					+ notice_list_tot[MB_DATA_SUBBOTTOM_CNTRBEAM]
-					+ notice_list_tot[MB_DATA_SUBBOTTOM_SUBBOTTOM];
-			if (isbtmrec > 0)
-				fprintf(output,"\t\t<number_of_subbottom_records>%d</number_of_subbottom_records>\n",isbtmrec);
-			if (notice_list_tot[MB_DATA_SIDESCAN2] > 0)
-				fprintf(output,"\t\t<number_of_secondary_sidescan_records>%d</number_of_secondary_sidescan_records>\n",notice_list_tot[MB_DATA_SIDESCAN2]);
-			if (notice_list_tot[MB_DATA_SIDESCAN3] > 0)
-				fprintf(output,"\t\t<number_of_tertiary_sidescan_records>%d</number_of_tertiary_sidescan_records>\n",notice_list_tot[MB_DATA_SIDESCAN3]);
-			if (notice_list_tot[MB_DATA_WATER_COLUMN] > 0)
-				fprintf(output,"\t\t<number_of_water_column_records>%d</number_of_water_column_records>\n",notice_list_tot[MB_DATA_WATER_COLUMN]);
-			fprintf(output,"\t</data_totals>\n");
-
-			fprintf(output,"\t<bathymetry_data>\n");
-			fprintf(output,"\t\t<max_beams_per_ping>%d</max_beams_per_ping>\n",beams_bath_max);
-			fprintf(output,"\t\t<number_beams>%d</number_beams>\n",ntdbeams);
-			fprintf(output,"\t\t<number_good_beams>%d</number_good_beams>\n",ngdbeams);
-			fprintf(output,"\t\t<percent_good_beams>%.2f</percent_good_beams>\n",ngd_percent);
-			fprintf(output,"\t\t<number_zero_beams>%d</number_zero_beams>\n",nzdbeams);
-			fprintf(output,"\t\t<percent_zero_beams>%.2f</percent_zero_beams>\n",nzd_percent);
-			fprintf(output,"\t\t<number_flagged_beams>%d</number_flagged_beams>\n",nfdbeams);
-			fprintf(output,"\t\t<percent_flagged_beams>%.2f</percent_flagged_beams>\n",nfd_percent);
-			fprintf(output,"\t</bathymetry_data>\n");
-			fprintf(output,"\t<amplitude_data>\n");
-			fprintf(output,"\t\t<max_beams_per_ping>%d</max_beams_per_ping>\n",beams_bath_max);
-			fprintf(output,"\t\t<number_beams>%d</number_beams>\n",ntabeams);
-			fprintf(output,"\t\t<number_good_beams>%d</number_good_beams>\n",ngabeams);
-			fprintf(output,"\t\t<percent_good_beams>%.2f</percent_good_beams>\n",nga_percent);
-			fprintf(output,"\t\t<number_zero_beams>%d</number_zero_beams>\n",nzabeams);
-			fprintf(output,"\t\t<percent_zero_beams>%.2f</percent_zero_beams>\n",nza_percent);
-			fprintf(output,"\t\t<number_flagged_beams>%d</number_flagged_beams>\n",nfabeams);
-			fprintf(output,"\t\t<percent_flagged_beams>%.2f</percent_flagged_beams>\n",nfa_percent);
-			fprintf(output,"\t</amplitude_data>\n");
-			fprintf(output,"\t<sidescan_data>\n");
-			fprintf(output,"\t\t<max_pixels_per_ping>%d</max_pixels_per_ping>\n",pixels_ss_max);
-			fprintf(output,"\t\t<number_pixels>%d</number_pixels>\n",ntsbeams);
-			fprintf(output,"\t\t<number_good_pixels>%d</number_good_pixels>\n",ngsbeams);
-			fprintf(output,"\t\t<percent_good_pixels>%.2f</percent_good_pixels>\n",ngs_percent);
-			fprintf(output,"\t\t<number_zero_pixels>%d</number_zero_pixels>\n",nzsbeams);
-			fprintf(output,"\t\t<percent_zero_pixels>%.2f</percent_zero_pixels>\n",nzs_percent);
-			fprintf(output,"\t\t<number_flagged_pixels>%d</number_flagged_pixels>\n",nfsbeams);
-			fprintf(output,"\t\t<percent_flagged_pixels>%.2f</percent_flagged_pixels>\n",nfs_percent);
-			fprintf(output,"\t</sidescan_data>\n");
-
-			fprintf(output,"\t<tnavigation_totals>\n");
-			fprintf(output,"\t\t<total_time_hours>%.4f</total_time_hours>\n",timtot);
-			fprintf(output,"\t\t<total_track_length_km>%.4f</total_track_length_km>\n",distot);
-			fprintf(output,"\t\t<average_speed_km_per_hr>%.4f</average_speed_km_per_hr>\n",spdavg);
-			fprintf(output,"\t\t<average_speed_knots>%.4f</average_speed_knots>\n",spdavg/1.85);
-			fprintf(output,"\t</tnavigation_totals>\n");
-
-			fprintf(output,"\t<start_of_data>\n");
-			fprintf(output,"\t\t<time>%2.2d %2.2d %4.4d %2.2d:%2.2d:%2.2d.%6.6d  JD%d</time>\n",
-				timbeg_i[1],timbeg_i[2],timbeg_i[0],timbeg_i[3],
-				timbeg_i[4],timbeg_i[5],timbeg_i[6],timbeg_j[1]);
-			fprintf(output,"\t\t<time_iso>%4.4d-%2.2d-%2.2dT%2.2d:%2.2d:%2.2d.%6.6d</time_iso>\n",
-				timbeg_i[0],timbeg_i[1],timbeg_i[2],timbeg_i[3],timbeg_i[4],timbeg_i[5],timbeg_i[6]);
-			if (bathy_in_feet == MB_NO)
-				{
-				fprintf(output,"\t\t<longitude>%.9f</longitude>\n",lonbeg);
-				fprintf(output,"\t\t<latitude>%.9f</latitude>\n",latbeg);
-				fprintf(output,"\t\t<depth_meters>%.4f</depth_meters>\n",bathbeg);
-				}
-			else
-				{
-				fprintf(output,"\t\t<longitude>%.9f</longitude>\n",lonbeg);
-				fprintf(output,"\t\t<latitude>%.9f</latitude>\n",latbeg);
-				fprintf(output,"\t\t<depth_meters>%.4f</depth_meters>\n",bathy_scale*bathbeg);
-				}
-			fprintf(output,"\t\t<speed_km_per_hour>%.4f</speed_km_per_hour>\n",spdbeg);
-			fprintf(output,"\t\t<speed_knots>%.4f</speed_knots>\n",spdbeg/1.85);
-			fprintf(output,"\t\t<heading_degrees>%.4f</heading_degrees>\n",hdgbeg);
-			fprintf(output,"\t\t<sonar_depth_meters>%.4f</sonar_depth_meters>\n",sdpbeg);
-			fprintf(output,"\t\t<sonar_altitude_meters>%.4f</sonar_altitude_meters>\n",altbeg);
-			fprintf(output,"\t</start_of_data>\n");
-
-			fprintf(output,"\t<end_of_data>\n");
-			fprintf(output,"\t\t<time>%2.2d %2.2d %4.4d %2.2d:%2.2d:%2.2d.%6.6d  JD%d</time>\n",
-				timend_i[1],timend_i[2],timend_i[0],timend_i[3],
-				timend_i[4],timend_i[5],timend_i[6],timend_j[1]);
-			fprintf(output,"\t\t<time_iso>%4.4d-%2.2d-%2.2dT%2.2d:%2.2d:%2.2d.%6.6d</time_iso>\n",
-				timend_i[0],timend_i[1],timend_i[2],timend_i[3],timend_i[4],timend_i[5],timend_i[6]);
-			if (bathy_in_feet == MB_NO)
-				{
-				fprintf(output,"\t\t<longitude>%.9f</longitude>\n",lonend);
-				fprintf(output,"\t\t<latitude>%.9f</latitude>\n",latend);
-				fprintf(output,"\t\t<depth_meters>%.4f</depth_meters>\n",bathend);
-				}
-			else
-				{
-				fprintf(output,"\t\t<longitude>%.9f</longitude>\n",lonend);
-				fprintf(output,"\t\t<latitude>%.9f</latitude>\n",latend);
-				fprintf(output,"\t\t<depth_meters>%.4f</depth_meters>\n",bathy_scale*bathend);
-				}
-			fprintf(output,"\t\t<speed_km_per_hour>%.4f</speed_km_per_hour>\n",spdend);
-			fprintf(output,"\t\t<speed_knots>%.4f</speed_knots>\n",spdend/1.85);
-			fprintf(output,"\t\t<heading_degrees>%.4f</heading_degrees>\n",hdgend);
-			fprintf(output,"\t\t<sonar_depth_meters>%.4f</sonar_depth_meters>\n",sdpend);
-			fprintf(output,"\t\t<sonar_altitude_meters>%.4f</sonar_altitude_meters>\n",altend);
-			fprintf(output,"\t</end_of_data>\n");
-
-			fprintf(output,"\t<limits>\n");
-			fprintf(output,"\t\t<minimum_longitude>%.9f</minimum_longitude>\n",lonmin);
-			fprintf(output,"\t\t<maximum_longitude>%.9f</maximum_longitude>\n",lonmax);
-			fprintf(output,"\t\t<minimum_latitude>%.9f</minimum_latitude>\n",latmin);
-			fprintf(output,"\t\t<maximum_latitude>%.9f</maximum_latitude>\n",latmax);
-			fprintf(output,"\t\t<minimum_sonar_depth>%.4f</minimum_sonar_depth>\n",sdpmin);
-			fprintf(output,"\t\t<maximum_sonar_depth>%.4f</maximum_sonar_depth>\n",sdpmax);
-			fprintf(output,"\t\t<minimum_altitude>%.4f</minimum_altitude>\n",altmin);
-			fprintf(output,"\t\t<maximum_altitude>%.4f</maximum_altitude>\n",altmax);
-			if (ngdbeams > 0 || verbose >= 1)
-				fprintf(output,"\t\t<minimum_depth>%.4f</minimum_depth>\n",bathy_scale*bathmin);
-				fprintf(output,"\t\t<maximum_depth>%.4f</maximum_depth>\n",bathy_scale*bathmax);
-			if (ngabeams > 0 || verbose >= 1)
-				fprintf(output,"\t\t<minimum_amplitude>%.4f</minimum_amplitude>\n",ampmin);
-				fprintf(output,"\t\t<maximum_amplitude>%.4f</maximum_amplitude>\n",ampmax);
-			if (ngsbeams > 0 || verbose >= 1)
-				fprintf(output,"\t\t<minimum_sidescan>%.4f</minimum_sidescan>\n",ssmin);
-				fprintf(output,"\t\t<maximum_sidescan>%.4f</maximum_sidescan>\n",ssmax);
-			fprintf(output,"\t</limits>\n");
-			break;
-		case '?':
-			break;
-		}
-	if (pings_read > 2 && beams_bath_max > 0
-		&& (ngdbeams > 0 || verbose >= 1))
-		{
-		switch (output_format)
-			{
-			case FREE_TEXT:
-				fprintf(output,"\nBeam Bathymetry Variances:\n");
-				fprintf(output,"Pings Averaged: %d\n",pings_read);
-				fprintf(output," Beam     N      Mean     Variance    Sigma\n");
-				fprintf(output," ----     -      ----     --------    -----\n");
-				for (i=0;i<beams_bath_max;i++)
-					fprintf(output,"%4d  %5d   %8.2f   %8.2f  %8.2f\n",
-						i,nbathvartot[i],bathy_scale*bathmeantot[i],
-						bathy_scale*bathy_scale*bathvartot[i],
-						bathy_scale*sqrt(bathvartot[i]));
-				fprintf(output,"\n");
-				break;
-			case JSON:
-				fprintf(output,",\n\"beam_bathymetry_variances\":{\n");
-				fprintf(output,"\"pings_averaged\": \"%d\",\n",pings_read);
-				fprintf(output,"\"columns\" : \"#beam,N,mean,variance,sigma\",\n");
-				fprintf(output,"\"values\": [\n");
-				for (i=0;i<beams_bath_max;i++)
-					{
-					if(i>0) fprintf(output,",\n");
-					sigma=bathy_scale*sqrt(bathvartot[i]);
-					if (isnan(sigma)) sigma=0;
-					fprintf(output,"{\"row\":\"%d,%d,%.2f,%.2f,%.2f\"}",
-						i,nbathvartot[i],bathy_scale*bathmeantot[i],
-						bathy_scale*bathy_scale*bathvartot[i], sigma);
-					}
-				fprintf(output,"]}");
-				break;
-			case XML:
-				fprintf(output,"\t<beam_bathymetry_variances>\n");
-				fprintf(output,"\t\t<pings_averaged>%d</pings_averaged>\n",pings_read);
-                fprintf(output,"\t\t<columns>pixel,N,mean,variance,sigma</columns>\n");
-				fprintf(output,"\t\t<values>\n");
-				for (i=0;i<beams_bath_max;i++)
-					{
-					if(i>0)
-					sigma=bathy_scale*sqrt(bathvartot[i]);
-					if(isnan(sigma)) sigma=0;
-                    fprintf(output,"\t\t\t<row>%d,%d,%.2f,%.2f,%.2f</row>\n",
-						i,nbathvartot[i],bathy_scale*bathmeantot[i],
-						bathy_scale*bathy_scale*bathvartot[i], sigma);
-					}
-				fprintf(output,"\t\t</values>\n");
-				fprintf(output,"\t</beam_bathymetry_variances>\n");
-				break;
-			case '?':
-				break;
-			}
-		}
-	if (pings_read > 2 && beams_amp_max > 0
-		&& (ngabeams > 0 || verbose >= 1))
-		{
-		switch (output_format)
-			{
-			case FREE_TEXT:
-				fprintf(output,"\nBeam Amplitude Variances:\n");
-				fprintf(output,"Pings Averaged: %d\n",pings_read);
-				fprintf(output," Beam     N      Mean     Variance    Sigma\n");
-				fprintf(output," ----     -      ----     --------    -----\n");
-				for (i=0;i<beams_amp_max;i++)
-					fprintf(output,"%4d  %5d   %8.2f   %8.2f  %8.2f\n",
-						i,nampvartot[i],ampmeantot[i],
-						ampvartot[i],sqrt(ampvartot[i]));
-				fprintf(output,"\n");
-				break;
-			case JSON:
-				fprintf(output,",\n\"beam_amplitude_variances\":{\n");
-				fprintf(output,"\"pings_averaged\": \"%d\",\n",pings_read);
-				fprintf(output,"\"columns\":\"beam,N,mean,variance,sigma\",\n");
-				fprintf(output,"\"values\": [\n");
-				for (i=0;i<beams_amp_max;i++)
-					{
-					if(i>0) fprintf(output,",\n");
-					sigma=sqrt(ampvartot[i]);
-					if (isnan(sigma)) sigma=0;
-					fprintf(output,"{\"row\" : \"%d,%d,%.2f,%.2f,%.2f\"}",
-						i,nampvartot[i],ampmeantot[i],
-						ampvartot[i],sigma);
-					}
-				fprintf(output,"\n]}");
-				break;
-			case XML:
-				fprintf(output,"\t<beam_amplitude_variances>\n");
-				fprintf(output,"\t\t<pings_averaged>%d</pings_averaged>\n",pings_read);
-				fprintf(output,"\t\t<columns>pixel,N,mean,variance,sigma</columns>\n");
-				fprintf(output,"\t\t<values>\n");
-				for (i=0;i<beams_amp_max;i++)
-					{
-					if(i>0)
-						sigma=sqrt(ampvartot[i]);
-					if(isnan(sigma)) sigma=0;
-						fprintf(output,"\t\t\t<row>%d,%d,%.2f,%.2f,%.2f</row>\n",
-						i,nampvartot[i],ampmeantot[i],
-						ampvartot[i],sigma);
-					}
-				fprintf(output,"\t\t</values>\n");
-				fprintf(output,"\t</beam_amplitude_variances>\n");
-				break;
-			case '?':
-				break;
-			}
-		}
-	if (pings_read > 2 && pixels_ss_max > 0
-		&& (ngsbeams > 0 || verbose >= 1))
-		{
-		switch (output_format)
-			{
-			case FREE_TEXT:
-				fprintf(output,"\nPixel Sidescan Variances:\n");
-				fprintf(output,"Pings Averaged: %d\n",pings_read);
-				fprintf(output," Beam     N      Mean     Variance    Sigma\n");
-				fprintf(output," ----     -      ----     --------    -----\n");
-				for (i=0;i<pixels_ss_max;i++)
-					fprintf(output,"%4d  %5d   %8.2f   %8.2f  %8.2f\n",
-						i,nssvartot[i],ssmeantot[i],
-						ssvartot[i],sqrt(ssvartot[i]));
-				fprintf(output,"\n");
-				break;
-			case JSON:
-				fprintf(output,",\n\"pixel_sidescan_variances\":{\n");
-				fprintf(output,"\"pings_averaged\": \"%d\",\n",pings_read);
-				fprintf(output,"\"columns\":\"pixel,N,mean,variance,sigma\",\n");
-				fprintf(output,"\"values\": [\n");
-				for (i=0;i<pixels_ss_max;i++)
-					{
-					if(i>0) fprintf(output,",\n");
-					sigma=sqrt(ssvartot[i]);
-					if(isnan(sigma)) sigma=0;
-					fprintf(output,"{\"row\":\"%d,%d,%.2f,%.2f,%.2f\"}",
-						i,nssvartot[i],ssmeantot[i],
-						ssvartot[i],sigma);
-					}
-				fprintf(output,"\n]\n}");
-				break;
-			case XML:
-				fprintf(output,"\t<pixel_sidescan_variances>\n");
-				fprintf(output,"\t\t<pings_averaged>%d</pings_averaged>\n",pings_read);
-				fprintf(output,"\t\t<columns>pixel,N,mean,variance,sigma</columns>\n");
-				fprintf(output,"\t\t<values>\n");
-				for (i=0;i<pixels_ss_max;i++)
-					{
-					if(i>0)
-						sigma=sqrt(ssvartot[i]);
-					if(isnan(sigma)) sigma=0;
-					fprintf(output,"\t\t\t<row>%d,%d,%.2f,%.2f,%.2f</row>\n",
-						i,nssvartot[i],ssmeantot[i],
-						ssvartot[i],sigma);
-					}
-				fprintf(output,"\t\t</values>\n");
-				fprintf(output,"\t</pixel_sidescan_variances>\n");
-				break;
-			case '?':
-				break;
-			}
-		}
-	if (print_notices == MB_YES)
-		{
-		switch (output_format)
-			{
-			case FREE_TEXT:
-				fprintf(output,"\nData Record Type Notices:\n");
-				for (i=0;i<=MB_DATA_KINDS;i++)
-					{
-					if (notice_list_tot[i] > 0)
-						{
-						mb_notice_message(verbose, i, &notice_msg);
-						fprintf(output, "DN: %d %s\n",
-							notice_list_tot[i], notice_msg);
-						}
-					}
-				fprintf(output,"\nNonfatal Error Notices:\n");
-				for (i=MB_DATA_KINDS+1;i<=MB_DATA_KINDS-(MB_ERROR_MIN);i++)
-					{
-					if (notice_list_tot[i] > 0)
-						{
-						mb_notice_message(verbose, i, &notice_msg);
-						fprintf(output, "EN: %d %s\n",
-							notice_list_tot[i], notice_msg);
-						}
-					}
-				fprintf(output,"\nProblem Notices:\n");
-				for (i=MB_DATA_KINDS-(MB_ERROR_MIN)+1;i<MB_NOTICE_MAX;i++)
-					{
-					if (notice_list_tot[i] > 0)
-						{
-						mb_notice_message(verbose, i, &notice_msg);
-						fprintf(output, "PN: %d %s\n",
-							notice_list_tot[i], notice_msg);
-						}
-					}
-				break;
-			case JSON:
-				fprintf(output,",\n\"notices\": {\n");
-				notice_total=0;
-				fprintf(output,"\"data_record_type_notices\": {\n");
-				for (i=0;i<=MB_DATA_KINDS;i++)
-					{
-					if (notice_list_tot[i] > 0)
-						{
-						mb_notice_message(verbose, i, &notice_msg);
-						if(notice_total>0) fprintf(output,",\n");
-						fprintf(output, "\"notice\": {\n\"notice_number\": \"%d\",\n\"notice_message\":\"%s\"\n}",
-							notice_list_tot[i], notice_msg);
-						notice_total++;
-						}
-					}
-				if (notice_total>0) fprintf(output,"\n");
-				fprintf(output,"}");
-				notice_total=0;
-				fprintf(output,",\n\"nonfatal_error_notices\": {\n");
-				for (i=MB_DATA_KINDS+1;i<=MB_DATA_KINDS-(MB_ERROR_MIN);i++)
-					{
-					if (notice_list_tot[i] > 0)
-						{
-						mb_notice_message(verbose, i, &notice_msg);
-						if(notice_total>0) fprintf(output,",\n");
-						fprintf(output, "\"notice\": {\n\"notice_number\": \"%d\",\n\"notice_message\":\"%s\"\n}",
-							notice_list_tot[i], notice_msg);
-						notice_total++;
-						}
-					}
-				if (notice_total>0) fprintf(output,"\n");
-				fprintf(output,"}");
-				notice_total=0;
-				fprintf(output,",\n\"problem_notices\": {\n");
-				for (i=MB_DATA_KINDS-(MB_ERROR_MIN)+1;i<MB_NOTICE_MAX;i++)
-					{
-					if (notice_list_tot[i] > 0)
-						{
-						mb_notice_message(verbose, i, &notice_msg);
-						if(notice_total>0) fprintf(output,",\n");
-						fprintf(output, "\"notice\": {\n\"notice_number\": \"%d\",\n\"notice_message\":\"%s\"\n}",
-							notice_list_tot[i], notice_msg);
-						notice_total++;
-						}
-					}
-				if (notice_total>0) fprintf(output,"\n");
-				fprintf(output,"}\n");
-				fprintf(output,"}");
-				break;
-			case XML:
-				fprintf(output,"\t<data_record_type_notices>\n");
-				for (i=0;i<=MB_DATA_KINDS;i++)
-					{
-					if (notice_list_tot[i] > 0)
-						{
-						mb_notice_message(verbose, i, &notice_msg);
-						fprintf(output, "\t\t<notice_number>%d</notice_number>\n",notice_list_tot[i]);
-						fprintf(output, "\t\t<notice_messsage>%s</notice_messsage>\n", notice_msg);
-						}
-					}
-				fprintf(output,"\t</data_record_type_notices>\n");
-				fprintf(output,"\t<nonfatal_error_notices>\n");
-				for (i=MB_DATA_KINDS+1;i<=MB_DATA_KINDS-(MB_ERROR_MIN);i++)
-					{
-					if (notice_list_tot[i] > 0)
-						{
-						mb_notice_message(verbose, i, &notice_msg);
-						fprintf(output, "\t\t<notice_number>%d</notice_number>\n",notice_list_tot[i]);
-						fprintf(output, "\t\t<notice_messsage>%s</notice_messsage>\n", notice_msg);
-						}
-					}
-				fprintf(output,"\t</nonfatal_error_notices>\n");
-				fprintf(output,"\t<problem_notices>\n");
-				for (i=MB_DATA_KINDS-(MB_ERROR_MIN)+1;i<MB_NOTICE_MAX;i++)
-					{
-					if (notice_list_tot[i] > 0)
-						{
-						mb_notice_message(verbose, i, &notice_msg);
-						fprintf(output, "\t\t<notice_number>%d</notice_number>\n",notice_list_tot[i]);
-						fprintf(output, "\t\t<notice_messsage>%s</notice_messsage>\n", notice_msg);
-						}
-					}
-				fprintf(output,"\t</problem_notices>\n");
-				break;
-			case '?':
-				break;
-			}
-		}
-	if (coverage_mask == MB_YES)
-		{
-		switch (output_format)
-			{
-			case FREE_TEXT:
-				fprintf(output,"\nCoverage Mask:\nCM dimensions: %d %d\n", mask_nx, mask_ny);
-				for (j=mask_ny-1;j>=0;j--)
-				{
-				fprintf(output, "CM:  ");
-				for (i=0;i<mask_nx;i++)
-					{
-					k = i + j * mask_nx;
-					fprintf(output, " %1d", mask[k]);
-					}
-				fprintf(output, "\n");
-				}
-				break;
-			case JSON:
-				fprintf(output,",\n\"coverage_mask\": {\n");
-				fprintf(output,"\"dimensions_nx\": \"%d\",\n\"dimensions_ny\": \"%d\",\n", mask_nx, mask_ny);
-				fprintf(output, "\"mask\": \" ");
-				for (j=mask_ny-1;j>=0;j--)
-					{
-					for (i=0;i<mask_nx;i++)
-						{
-						k = i + j * mask_nx;
-						if (i>0) fprintf(output,",");
-							fprintf(output, "%1d", mask[k]);
-						}
-					fprintf(output,"\n");
-					}
-				fprintf(output, "\"}");
-				break;
-			case '?':
-				break;
-			}
-		}
-
-	/* close root element for XML export */
-	switch (output_format)
-		{
-		case FREE_TEXT:
-			break;
-		case JSON:
-			fprintf(output,"}\n");
-			break;
-		case XML:
-			fprintf(output,"</mbinfo>\n");
-			break;
-		case '?':
-			break;
-		}
-
-	/* close output file */
-	if (output_usefile == MB_YES
-	    && output != NULL)
-		{
-		fclose(output);
-		}
-
-	/* deallocate memory used for data arrays */
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&bathmeantot,&error);
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&bathvartot,&error);
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&nbathvartot,&error);
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&ampmeantot,&error);
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&ampvartot,&error);
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&nampvartot,&error);
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&ssmeantot,&error);
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&ssvartot,&error);
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&nssvartot,&error);
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&mask,&error);
-
-	/* set program status */
-	status = MB_SUCCESS;
-
-	/* check memory */
-	if (verbose >= 4)
-		status = mb_memory_list(verbose,&error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stream,"\ndbg2  Program <%s> completed\n",
-			program_name);
-		fprintf(stream,"dbg2  Ending status:\n");
-		fprintf(stream,"dbg2       status:  %d\n",status);
-		}
-
-	/* end it all */
-	exit(error);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/utilities/mbinsreprocess.c b/src/utilities/mbinsreprocess.c
deleted file mode 100644
index 07259a4..0000000
--- a/src/utilities/mbinsreprocess.c
+++ /dev/null
@@ -1,578 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbinsreprocess.c	11/21/2004
- *
- *    $Id: mbinsreprocess.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 2014-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * MBauvnavusbl reads an INS navigation file (e.g. from a Kearfott SeaDevil),
- * including information about the state of navigation aiding by GPS, DVL,
- * and other navigation sources. It then identifies time periods without
- * aiding in which the navigation drifted in free inertial. These free
- * inertial periods are typically ended with a navigation tear as the INS
- * calculates a new state. This program removes the navigation tears by
- * linear interpolation in time. The adjusted navigation is output.
- *
- * Author:	D. W. Caress
- * Date:	November 21, 2004
- *
- * command line option definitions:
- * mbsslayout 	--verbose
- * 		--help
- * 		--input=filename
- * 		--output=filename
- */	
-
-/* standard include files */
-#include <stdio.h>
-#include <stdlib.h>
-#include <getopt.h>
-#include <unistd.h>
-#include <math.h>
-#include <string.h>
-#include <time.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_define.h"
-#include "mb_aux.h"
-
-/* local defines */
-#define	NFIELDSMAX	50
-#define	MAX_OPTIONS	50
-#define	TYPE_UNKNOWN	0
-#define	TYPE_TIMETAG	1
-#define	TYPE_INTEGER	2
-#define	TYPE_DOUBLE	3
-#define	TYPE_ANGLE	4
-#define	KEARFOTT_MONITOR_VALID_DVL		0x01
-#define	KEARFOTT_MONITOR_RESERVED		0x02
-#define	KEARFOTT_MONITOR_ZUPT_PROCESSED		0x04
-#define	KEARFOTT_MONITOR_DVL_REJECTED		0x08
-#define	KEARFOTT_MONITOR_DVL_PPROCESSED		0x10
-#define	KEARFOTT_MONITOR_GPS_REJECTED		0x20
-#define	KEARFOTT_MONITOR_GPS_PROCESSED		0x40
-#define	KEARFOTT_MONITOR_DEPTH_LOOP_OPEN	0x80
-
-static char version_id[] = "$Id: mbinsreprocess.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-
-int main (int argc, char **argv)
-{
-	/* id variables */
-	char program_name[] = "MBinsreprocess";
-	char help_message[] = "MBinsreprocess reads an INS navigation file (e.g. from a Kearfott SeaDevil), \nincluding information about the state of navigation aiding by GPS, DVL, \nand other navigation sources. It then identifies time periods without \naiding in which the navigation drifted in free inertial. These free \ninertial periods are typically ended with a navigation tear as the INS \ncalculates a new state. This program removes the navigation tears by \nlinear interpolation in time. [...]
-	char usage_message[] = "mbinsreprocess --input=filename --output=filename [--help --verbose]";
-	
-	static struct option options[] =
-		{
-		{"verbose",			no_argument, 		NULL, 		0},
-		{"help",			no_argument, 		NULL, 		0},
-		{"verbose",			no_argument, 		NULL, 		0},
-		{"input",			required_argument, 	NULL, 		0},
-		{"output",			required_argument, 	NULL, 		0},
-		{NULL,				0, 			NULL, 		0}
-		};
-		
-
-	/* parsing variables */
-	extern char *optarg;
-	int	option_index;
-	int	errflg = 0;
-	int	c;
-	int	help = 0;
-
-	/* MBIO status variables */
-	int	status = MB_SUCCESS;
-	int	verbose = 0;
-	int	error = MB_ERROR_NO_ERROR;
-	char	*message;
-
-	/* Files and formats */
-	char	ifile[MB_PATH_MAXLINE];
-	char	ofile[MB_PATH_MAXLINE];
-	FILE	*fp;
-
-	/* MBIO default parameters - only use lonflip */
-	int	format;
-	int	pings;
-	int	lonflip;
-	double	bounds[4];
-	int	btime_i[7];
-	int	etime_i[7];
-	double	speedmin;
-	double	timegap;
-
-	/* auv log data */
-	struct	field
-		{
-		int	type;
-		int	size;
-		int	index;
-		char	name[MB_PATH_MAXLINE];
-		char	format[MB_PATH_MAXLINE];
-		char	description[MB_PATH_MAXLINE];
-		char	units[MB_PATH_MAXLINE];
-		double	scale;
-		};
-	struct	printfield
-		{
-		char	name[MB_PATH_MAXLINE];
-		int	index;
-		int	formatset;
-		char	format[MB_PATH_MAXLINE];
-		};
-	int	nfields = 0;
-	struct field fields[NFIELDSMAX];
-
-	/* read and write values */
-	double	*time = NULL;
-	int	*mCyclesK = NULL;
-	int	*mModeK = NULL;
-	int	*mMonK = NULL;
-	double	*mLatK = NULL;
-	double	*mLonK = NULL;
-	double	*mNorthK = NULL;
-	double	*mEastK = NULL;
-	double	*mDepthK = NULL;
-	double	*mRollK = NULL;
-	double	*mPitchK = NULL;
-	double	*mHeadK = NULL;
-	double	*mVbodyxK = NULL;
-	double	*mVbodyyK = NULL;
-	double	*mVbodyzK = NULL;
-	double	*mAccelxK = NULL;
-	double	*mAccelyK = NULL;
-	double	*mAccelzK = NULL;
-	double	*mPrateK = NULL;
-	double	*mQrateK = NULL;
-	double	*mRrateK = NULL;
-	double	*utcTime = NULL;
-	
-	int	angles_in_degrees = MB_YES;
-	
-	int	time_i[7];
-	int	nrecord, irecord, nscan, ifield;
-	size_t	recordsize = 0;
-	size_t	fp_startpos = 0;
-	char	*result;
-	char	buffer[MB_PATH_MAXLINE];
-	char	type[MB_PATH_MAXLINE];
-	double	dvalue;
-	int	ivalue;
-	char	dvl_char, jump_char;
-	double	dx, dy, rr;
-
-	/* get current default values - only interested in lonflip */
-	status = mb_defaults(verbose,&format,&pings,&lonflip,bounds,
-		btime_i,etime_i,&speedmin,&timegap);
-
-	/* set default input and output */
-	strcpy (ifile, "stdin");
-	strcpy (ofile, "stdout");
-
-	/* process argument list */
-	while ((c = getopt_long(argc, argv, "", options, &option_index)) != -1)
-	  switch (c)
-		{
-		/* long options all return c=0 */
-		case 0:
-			/* verbose */
-			if (strcmp("verbose", options[option_index].name) == 0)
-				{
-				verbose++;
-				}
-			
-			/* help */
-			else if (strcmp("help", options[option_index].name) == 0)
-				{
-				help = MB_YES;
-				}
-				
-			/*-------------------------------------------------------
-			 * Define input and output files */
-			
-			/* input */
-			else if (strcmp("input", options[option_index].name) == 0)
-				{
-				strcpy(ifile, optarg);
-				}
-			
-			/* output */
-			else if (strcmp("output", options[option_index].name) == 0)
-				{
-				strcpy(ofile, optarg);
-				}
-						
-			break;
-		case '?':
-			errflg++;
-		}
-
-	/* if error flagged then print it and exit */
-	if (errflg)
-		{
-		fprintf(stderr,"usage: %s\n", usage_message);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		error = MB_ERROR_BAD_USAGE;
-		exit(error);
-		}
-
-	/* print starting message */
-	if (verbose == 1 || help)
-		{
-		fprintf(stderr,"\nProgram %s\n",program_name);
-		fprintf(stderr,"Source File Version %s\n",version_id);
-		fprintf(stderr,"MB-system Version %s\n",MB_VERSION);
-		}
-
-	/* print starting debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  Program <%s>\n",program_name);
-		fprintf(stderr,"dbg2  Version %s\n",version_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Default MB-System Parameters:\n");
-		fprintf(stderr,"dbg2       verbose:                    %d\n",verbose);
-		fprintf(stderr,"dbg2       help:                       %d\n",help);
-		fprintf(stderr,"dbg2       lonflip:                    %d\n",lonflip);
-		fprintf(stderr,"dbg2  Input and Output Files:\n");
-		fprintf(stderr,"dbg2       ifile:                      %s\n",ifile);
-		fprintf(stderr,"dbg2       ofile:                      %s\n",ofile);
-		}
-
-	/* if help desired then print it and exit */
-	if (help)
-		{
-		fprintf(stderr,"\n%s\n",help_message);
-		fprintf(stderr,"\nusage: %s\n", usage_message);
-		exit(error);
-		}
-
-	/* count the number of records in the  */
-		
-	/* open the input file */
-	if ((fp = fopen(ifile, "r")) == NULL)
-		{
-		error = MB_ERROR_OPEN_FAIL;
-		status = MB_FAILURE;
-		fprintf(stderr,"\nUnable to open log file <%s> for reading\n",ifile);
-		exit(status);
-		}
-
-	/* parse the ascii header listing the included data fields */
-	nfields = 0;
-	recordsize = 0;
-	while ((result = fgets(buffer,MB_PATH_MAXLINE,fp)) == buffer
-		&& strncmp(buffer, "# begin",7) != 0)
-		{
-		nscan = sscanf(buffer, "# %s %s %s",
-				type,
-				fields[nfields].name,
-				fields[nfields].format);
-		if (nscan == 3)
-			{
-			result = (char *) strchr(buffer, ',');
-			strcpy(fields[nfields].description, &(result[1]));
-			result = (char *) strchr(fields[nfields].description, ',');
-			result[0] = 0;
-			result = (char *) strrchr(buffer, ',');
-			strcpy(fields[nfields].units, &(result[1]));
-
-			fields[nfields].index = recordsize;
-			if (strcmp(type, "double") == 0)
-				{
-				fields[nfields].type = TYPE_DOUBLE;
-				fields[nfields].size = 8;
-				if (angles_in_degrees == MB_YES
-					&&(strcmp(fields[nfields].name, "mLatK") == 0
-						|| strcmp(fields[nfields].name, "mLonK") == 0
-						|| strcmp(fields[nfields].name, "mLatK") == 0
-						|| strcmp(fields[nfields].name, "mRollK") == 0
-						|| strcmp(fields[nfields].name, "mPitchK") == 0
-						|| strcmp(fields[nfields].name, "mHeadK") == 0
-						|| strcmp(fields[nfields].name, "mYawK") == 0
-						|| strcmp(fields[nfields].name, "mLonCB") == 0
-						|| strcmp(fields[nfields].name, "mLatCB") == 0
-						|| strcmp(fields[nfields].name, "mRollCB") == 0
-						|| strcmp(fields[nfields].name, "mPitchCB") == 0
-						|| strcmp(fields[nfields].name, "mHeadCB") == 0
-						|| strcmp(fields[nfields].name, "mYawCB") == 0))
-					fields[nfields].scale = RTD;
-				else
-					fields[nfields].scale = 1.0;
-				recordsize += 8;
-				}
-			else if (strcmp(type, "integer") == 0)
-				{
-				fields[nfields].type = TYPE_INTEGER;
-				fields[nfields].size = 4;
-				fields[nfields].scale = 1.0;
-				recordsize += 4;
-				}
-			else if (strcmp(type, "timeTag") == 0)
-				{
-				fields[nfields].type = TYPE_TIMETAG;
-				fields[nfields].size = 8;
-				fields[nfields].scale = 1.0;
-				recordsize += 8;
-				}
-			else if (strcmp(type, "angle") == 0)
-				{
-				fields[nfields].type = TYPE_ANGLE;
-				fields[nfields].size = 8;
-				if (angles_in_degrees == MB_YES
-					&&(strcmp(fields[nfields].name, "mRollCB") == 0
-						|| strcmp(fields[nfields].name, "mOmega_xCB") == 0
-						|| strcmp(fields[nfields].name, "mPitchCB") == 0
-						|| strcmp(fields[nfields].name, "mOmega_yCB") == 0
-						|| strcmp(fields[nfields].name, "mYawCB") == 0
-						|| strcmp(fields[nfields].name, "mOmega_zCB") == 0))
-					fields[nfields].scale = RTD;
-				else
-					fields[nfields].scale = 1.0;
-				recordsize += 8;
-				}
-			nfields++;
-			}
-		}
-
-	/* count the data records in the auv log file */
-	nrecord = 0;
-	fp_startpos = ftell(fp);
-	while (fread(buffer, recordsize, 1, fp) == 1)
-		{
-		nrecord++;
-		}
-	fseek(fp, fp_startpos, SEEK_SET);
-
-	/* allocate arrays */
-	if (nrecord > 0)
-		{
-		status = mb_mallocd(verbose, __FILE__, __LINE__, nrecord * sizeof(double), (void **)&time, &error);
-		status = mb_mallocd(verbose, __FILE__, __LINE__, nrecord * sizeof(int), (void **)&mCyclesK, &error);
-		status = mb_mallocd(verbose, __FILE__, __LINE__, nrecord * sizeof(int), (void **)&mModeK, &error);
-		status = mb_mallocd(verbose, __FILE__, __LINE__, nrecord * sizeof(int), (void **)&mMonK, &error);
-		status = mb_mallocd(verbose, __FILE__, __LINE__, nrecord * sizeof(double), (void **)&mLatK, &error);
-		status = mb_mallocd(verbose, __FILE__, __LINE__, nrecord * sizeof(double), (void **)&mLonK, &error);
-		status = mb_mallocd(verbose, __FILE__, __LINE__, nrecord * sizeof(double), (void **)&mNorthK, &error);
-		status = mb_mallocd(verbose, __FILE__, __LINE__, nrecord * sizeof(double), (void **)&mEastK, &error);
-		status = mb_mallocd(verbose, __FILE__, __LINE__, nrecord * sizeof(double), (void **)&mDepthK, &error);
-		status = mb_mallocd(verbose, __FILE__, __LINE__, nrecord * sizeof(double), (void **)&mRollK, &error);
-		status = mb_mallocd(verbose, __FILE__, __LINE__, nrecord * sizeof(double), (void **)&mPitchK, &error);
-		status = mb_mallocd(verbose, __FILE__, __LINE__, nrecord * sizeof(double), (void **)&mHeadK, &error);
-		status = mb_mallocd(verbose, __FILE__, __LINE__, nrecord * sizeof(double), (void **)&mVbodyxK, &error);
-		status = mb_mallocd(verbose, __FILE__, __LINE__, nrecord * sizeof(double), (void **)&mVbodyyK, &error);
-		status = mb_mallocd(verbose, __FILE__, __LINE__, nrecord * sizeof(double), (void **)&mVbodyzK, &error);
-		status = mb_mallocd(verbose, __FILE__, __LINE__, nrecord * sizeof(double), (void **)&mAccelxK, &error);
-		status = mb_mallocd(verbose, __FILE__, __LINE__, nrecord * sizeof(double), (void **)&mAccelyK, &error);
-		status = mb_mallocd(verbose, __FILE__, __LINE__, nrecord * sizeof(double), (void **)&mAccelzK, &error);
-		status = mb_mallocd(verbose, __FILE__, __LINE__, nrecord * sizeof(double), (void **)&mPrateK, &error);
-		status = mb_mallocd(verbose, __FILE__, __LINE__, nrecord * sizeof(double), (void **)&mQrateK, &error);
-		status = mb_mallocd(verbose, __FILE__, __LINE__, nrecord * sizeof(double), (void **)&mRrateK, &error);
-		status = mb_mallocd(verbose, __FILE__, __LINE__, nrecord * sizeof(double), (void **)&utcTime, &error);
-		memset(time, 0, nrecord * sizeof(double));
-		memset(mCyclesK, 0, nrecord * sizeof(int));
-		memset(mModeK, 0, nrecord * sizeof(int));
-		memset(mMonK, 0, nrecord * sizeof(int));
-		memset(mLatK, 0, nrecord * sizeof(double));
-		memset(mLonK, 0, nrecord * sizeof(double));
-		memset(mNorthK, 0, nrecord * sizeof(double));
-		memset(mEastK, 0, nrecord * sizeof(double));
-		memset(mDepthK, 0, nrecord * sizeof(double));
-		memset(mRollK, 0, nrecord * sizeof(double));
-		memset(mPitchK, 0, nrecord * sizeof(double));
-		memset(mHeadK, 0, nrecord * sizeof(double));
-		memset(mVbodyxK, 0, nrecord * sizeof(double));
-		memset(mVbodyyK, 0, nrecord * sizeof(double));
-		memset(mVbodyzK, 0, nrecord * sizeof(double));
-		memset(mAccelxK, 0, nrecord * sizeof(double));
-		memset(mAccelyK, 0, nrecord * sizeof(double));
-		memset(mAccelzK, 0, nrecord * sizeof(double));
-		memset(mPrateK, 0, nrecord * sizeof(double));
-		memset(mQrateK, 0, nrecord * sizeof(double));
-		memset(mRrateK, 0, nrecord * sizeof(double));
-		memset(utcTime, 0, nrecord * sizeof(double));
-
-		/* if error initializing memory then quit */
-		if (error != MB_ERROR_NO_ERROR)
-			{
-			mb_error(verbose,error,&message);
-			fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",message);
-			fprintf(stderr,"\nProgram <%s> Terminated\n",
-				program_name);
-			exit(error);
-			}
-		}
-    
-	/* read the records */
-	irecord = 0;
-	while (fread(buffer, recordsize, 1, fp) == 1)
-		{
-		/* loop over the fields in the record */
-		for (ifield=0;ifield<nfields;ifield++)
-			{
-			if (fields[ifield].type == TYPE_DOUBLE)
-				{
-				mb_get_binary_double(MB_YES, &buffer[fields[ifield].index], &dvalue);
-//fprintf(stderr,"irecord:%d ifield:%d TYPE_DOUBLE name:%s dvalue:%f\n",
-//	irecord, ifield, fields[ifield].name, dvalue);
-				dvalue *= fields[ifield].scale;
-				if ((strcmp(fields[ifield].name, "mHeadK") == 0
-					|| strcmp(fields[ifield].name, "mYawK") == 0)
-					&& angles_in_degrees == MB_YES
-					&& dvalue < 0.0)
-					dvalue += 360.0;
-				if (strcmp(fields[ifield].name, "mLatK") == 0)
-					mLatK[irecord] = dvalue;
-				if (strcmp(fields[ifield].name, "mLonK") == 0)
-					mLonK[irecord] = dvalue;
-				if (strcmp(fields[ifield].name, "mNorthK") == 0)
-					mNorthK[irecord] = dvalue;
-				if (strcmp(fields[ifield].name, "mEastK") == 0)
-					mEastK[irecord] = dvalue;
-				if (strcmp(fields[ifield].name, "mDepthK") == 0)
-					mDepthK[irecord] = dvalue;
-				if (strcmp(fields[ifield].name, "mRollK") == 0)
-					mRollK[irecord] = dvalue;
-				if (strcmp(fields[ifield].name, "mPitchK") == 0)
-					mPitchK[irecord] = dvalue;
-				if (strcmp(fields[ifield].name, "mHeadK") == 0)
-					mHeadK[irecord] = dvalue;
-				if (strcmp(fields[ifield].name, "mVbodyxK") == 0)
-					mVbodyxK[irecord] = dvalue;
-				if (strcmp(fields[ifield].name, "mVbodyyK") == 0)
-					mVbodyyK[irecord] = dvalue;
-				if (strcmp(fields[ifield].name, "mVbodyzK") == 0)
-					mVbodyzK[irecord] = dvalue;
-				if (strcmp(fields[ifield].name, "mAccelxK") == 0)
-					mAccelxK[irecord] = dvalue;
-				if (strcmp(fields[ifield].name, "mAccelyK") == 0)
-					mAccelyK[irecord] = dvalue;
-				if (strcmp(fields[ifield].name, "mAccelzK") == 0)
-					mAccelzK[irecord] = dvalue;
-				if (strcmp(fields[ifield].name, "mPrateK") == 0)
-					mPrateK[irecord] = dvalue;
-				if (strcmp(fields[ifield].name, "mQrateK") == 0)
-					mQrateK[irecord] = dvalue;
-				if (strcmp(fields[ifield].name, "mRrateK") == 0)
-					mRrateK[irecord] = dvalue;
-				if (strcmp(fields[ifield].name, "utcTime") == 0)
-					utcTime[irecord] = dvalue;
-				}
-			else if (fields[ifield].type == TYPE_INTEGER)
-				{
-				mb_get_binary_int(MB_YES, &buffer[fields[ifield].index], &ivalue);
-//fprintf(stderr,"irecord:%d ifield:%d TYPE_INTEGER name:%s ivalue:%d\n",
-//	irecord, ifield, fields[ifield].name, ivalue);
-				if (strcmp(fields[ifield].name, "mCyclesK") == 0)
-					mCyclesK[irecord] = ivalue;
-				if (strcmp(fields[ifield].name, "mModeK") == 0)
-					mModeK[irecord] = ivalue;
-				if (strcmp(fields[ifield].name, "mMonK") == 0)
-					mMonK[irecord] = ivalue;
-				}
-			else if (fields[ifield].type == TYPE_TIMETAG)
-				{
-				mb_get_binary_double(MB_YES, &buffer[fields[ifield].index], &dvalue);
-//fprintf(stderr,"irecord:%d ifield:%d TYPE_TIMETAG name:%s dvalue:%f\n",
-//	irecord, ifield, fields[ifield].name, dvalue);
-				if (strcmp(fields[ifield].name, "time") == 0)
-					time[irecord] = dvalue;
-				}
-			else if (fields[ifield].type == TYPE_ANGLE)
-				{
-				mb_get_binary_double(MB_YES, &buffer[fields[ifield].index], &dvalue);
-				dvalue *= fields[ifield].scale;
-				if (strcmp(fields[ifield].name, "mYawCB") == 0
-					&& angles_in_degrees == MB_YES
-					&& dvalue < 0.0)
-					dvalue += 360.0;
-				}
-			}
-		
-//		fprintf(stderr,"%7d %16.6f %14.9f %14.9f %10.3f %10.3f %7d %7d\n",
-//				irecord, time[irecord], mLonK[irecord], mLatK[irecord],
-//				mDepthK[irecord], mHeadK[irecord], mModeK[irecord], mMonK[irecord]);
-		/* increment record */
-		irecord++;
-		}
-	fclose(fp);
-	
-	/* output the data */
-	dx = 0.0;
-	dy = 0.0;
-	for (irecord=0;irecord<nrecord;irecord++)
-		{
-		if (irecord > 0)
-			{
-			dx = mEastK[irecord] - mEastK[irecord-1];
-			dy = mNorthK[irecord] - mNorthK[irecord-1];
-			rr = sqrt(dx * dx + dy * dy);
-			}
-		if (mMonK[irecord] & KEARFOTT_MONITOR_DVL_PPROCESSED)
-			dvl_char = 'X';
-		else
-			dvl_char = ' ';
-		if (rr > 1.0)
-			jump_char = '*';
-		else
-			jump_char = ' ';
-		mb_get_date(verbose, time[irecord], time_i);
-		fprintf(stderr,"%7d %4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d %16.6f %14.9f %14.9f %10.3f %10.3f %7d %7d |   %c %10.3f %c%c%c%c%c%c\n",
-				irecord, time_i[0], time_i[1], time_i[2], time_i[3], time_i[4], time_i[5], time_i[6],
-				time[irecord], mLonK[irecord], mLatK[irecord],
-				mDepthK[irecord], mHeadK[irecord], mModeK[irecord], mMonK[irecord],
-				dvl_char, rr, jump_char, jump_char, jump_char, jump_char, jump_char, jump_char);
-		}
-
-	/* deallocate memory for data arrays */
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&time, &error);
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&mCyclesK, &error);
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&mModeK, &error);
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&mMonK, &error);
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&mLatK, &error);
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&mLonK, &error);
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&mNorthK, &error);
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&mEastK, &error);
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&mDepthK, &error);
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&mRollK, &error);
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&mPitchK, &error);
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&mHeadK, &error);
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&mVbodyxK, &error);
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&mVbodyyK, &error);
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&mVbodyzK, &error);
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&mAccelxK, &error);
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&mAccelyK, &error);
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&mAccelzK, &error);
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&mPrateK, &error);
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&mQrateK, &error);
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&mRrateK, &error);
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&utcTime, &error);
-
-	/* check memory */
-	if (verbose >= 4)
-		status = mb_memory_list(verbose,&error);
-
-	/* give the statistics */
-	if (verbose >= 1)
-		{
-		fprintf(stderr,"\n%d input ins records\n",nrecord);
-		}
-
-	/* end it all */
-	exit(error);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/utilities/mbkongsbergpreprocess.c b/src/utilities/mbkongsbergpreprocess.c
deleted file mode 100644
index f472efb..0000000
--- a/src/utilities/mbkongsbergpreprocess.c
+++ /dev/null
@@ -1,2945 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbkongsbergpreprocess.c	1/1/2012
- *    $Id: mbkongsbergpreprocess.c 1938 2012-02-22 20:58:08Z caress $
- *
- *    Copyright (c) 2012-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbkongsbergpreprocess reads a HYSWEEP HSX format file, interpolates the
- * asynchronous navigation and attitude onto the multibeam data,
- * and writes a new HSX file with that information correctly embedded
- * in the multibeam data. This program can also fix various problems
- * with the data, including sensor offsets.
- *
- * Author:	D. W. Caress
- * Date:	June 1, 2012
- *
- * $Log: mbkongsbergpreprocess.c,v $
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <math.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-
-/* MBIO include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_define.h"
-#include "mb_io.h"
-#include "mb_aux.h"
-#include "mbsys_simrad3.h"
-
-#define MBKONSBERGPREPROCESS_ALLOC_CHUNK 1000
-#define MBKONSBERGPREPROCESS_PROCESS		1
-#define MBKONSBERGPREPROCESS_TIMESTAMPLIST	2
-#define	MBKONSBERGPREPROCESS_TIMELAG_OFF	0
-#define	MBKONSBERGPREPROCESS_TIMELAG_CONSTANT	1
-#define	MBKONSBERGPREPROCESS_TIMELAG_MODEL	2
-
-#define MBKONSBERGPREPROCESS_SONAR_OFFSET_NONE		0
-#define MBKONSBERGPREPROCESS_SONAR_OFFSET_SONAR		1
-#define MBKONSBERGPREPROCESS_SONAR_OFFSET_MRU		2
-#define MBKONSBERGPREPROCESS_SONAR_OFFSET_NAVIGATION	3
-
-#define MBKONSBERGPREPROCESS_OFFSET_MAX	12
-
-#define MBKONSBERGPREPROCESS_NAVFORMAT_NONE	0
-#define MBKONSBERGPREPROCESS_NAVFORMAT_OFG	1
-
-/* set precision of iterative raytracing depth & distance matching */
-#define MBKONSBERGPREPROCESS_BATH_RECALC_PRECISION 0.0001
-#define MBKONSBERGPREPROCESS_BATH_RECALC_NCALCMAX 50
-#define MBKONSBERGPREPROCESS_BATH_RECALC_ANGLEMODE 0
-
-#define MBKONSBERGPREPROCESS_USE_SENSORDEPTH_ONLY	0
-#define MBKONSBERGPREPROCESS_USE_HEAVE_ONLY		1
-
-#define MBKONSBERGPREPROCESS_WATERCOLUMN_IGNORE		0
-#define	MBKONSBERGPREPROCESS_WATERCOLUMN_OUTPUT		1
-
-static char rcs_id[] = "$Id: mbkongsbergpreprocess.c 1938 2012-02-22 20:58:08Z caress $";
-
-/*--------------------------------------------------------------------*/
-
-int main (int argc, char **argv)
-{
-	char program_name[] = "mbkongsbergpreprocess";
-	char help_message[] =  "mbkongsbergpreprocess reads a Kongsberg multibeam vendor format file (or datalist of files),\ninterpolates the asynchronous navigation and attitude onto the multibeam data, \nand writes the data as one or more format 59 files.";
-	char usage_message[] = "mbkongsbergpreprocess [-C -Doutputdirectory -Eoffx/offy[/offdepth] -Fformat -Ifile -Ooutfile \n\t\t\t-Pfilterlength/filterdepth -Sdatatype/source -Ttimelag -W -H -V]";
-
-	extern char *optarg;
-	int	errflg = 0;
-	int	c;
-	int	help = 0;
-	int	flag = 0;
-
-	/* MBIO status variables */
-	int	status = MB_SUCCESS;
-	int	verbose = 0;
-	int	error = MB_ERROR_NO_ERROR;
-	char	*message;
-
-	/* MBIO read control parameters */
-	int	read_datalist = MB_NO;
-	char	read_file[MB_PATH_MAXLINE];
-	void	*datalist;
-	int	look_processed = MB_DATALIST_LOOK_UNSET;
-	double	file_weight;
-	int	format = 0;
-	int	pings;
-	int	lonflip;
-	double	bounds[4];
-	int	btime_i[7];
-	int	etime_i[7];
-	double	btime_d;
-	double	etime_d;
-	double	speedmin;
-	double	timegap;
-	char	ifile[MB_PATH_MAXLINE];
-	char	ofile[MB_PATH_MAXLINE];
-	int	ofile_set = MB_NO;
-	char	odir[MB_PATH_MAXLINE];
-	int	odir_set = MB_NO;
-	int	beams_bath;
-	int	beams_amp;
-	int	pixels_ss;
-	int	obeams_bath;
-	int	obeams_amp;
-	int	opixels_ss;
-
-	/* MBIO read values */
-	struct mb_io_struct *imb_io_ptr = NULL;
-	struct mbsys_simrad3_struct *istore = NULL;
-	struct mbsys_simrad3_ping_struct *ping = NULL;
-	struct mbsys_simrad3_attitude_struct *attitude = NULL;
-	struct mbsys_simrad3_netattitude_struct *netattitude = NULL;
-	struct mbsys_simrad3_heading_struct *headingr = NULL;
-	void	*imbio_ptr = NULL;
-	void	*istore_ptr = NULL;
-	void	*ombio_ptr = NULL;
-	int	kind;
-	int	time_i[7];
-	double	time_d;
-	double	navlon;
-	double	navlat;
-	double	speed;
-	double	heading;
-	double	distance;
-	double	altitude;
-	double	sonardepth;
-	double	roll;
-	double	pitch;
-	double	heave;
-	char	*beamflag = NULL;
-	double	*bath = NULL;
-	double	*bathacrosstrack = NULL;
-	double	*bathalongtrack = NULL;
-	double	*amp = NULL;
-	double	*ss = NULL;
-	double	*ssacrosstrack = NULL;
-	double	*ssalongtrack = NULL;
-	char	comment[MB_COMMENT_MAXLINE];
-
-	/* program mode */
-	int	mode = MBKONSBERGPREPROCESS_PROCESS;
-	int	nav_source = MB_DATA_NAV;
-	int	attitude_source = MB_DATA_ATTITUDE;
-	int	heading_source = MB_DATA_HEADING;
-	int	sonardepth_source = MB_DATA_DATA;
-
-	/* counting variables file */
-	int	output_counts = MB_NO;
-	int	nfile_read = 0;
-	int	nfile_write = 0;
-	int	nrec_0x30_pu_id = 0;
-	int	nrec_0x31_pu_status = 0;
-	int	nrec_0x32_pu_bist = 0;
-	int	nrec_0x33_parameter_extra = 0;
-	int	nrec_0x41_attitude = 0;
-	int	nrec_0x43_clock = 0;
-	int	nrec_0x44_bathymetry = 0;
-	int	nrec_0x45_singlebeam = 0;
-	int	nrec_0x46_rawbeamF = 0;
-	int	nrec_0x47_surfacesoundspeed2 = 0;
-	int	nrec_0x48_heading = 0;
-	int	nrec_0x49_parameter_start = 0;
-	int	nrec_0x4A_tilt = 0;
-	int	nrec_0x4B_echogram = 0;
-	int	nrec_0x4E_rawbeamN = 0;
-	int	nrec_0x4F_quality = 0;
-	int	nrec_0x50_pos = 0;
-	int	nrec_0x52_runtime = 0;
-	int	nrec_0x53_sidescan = 0;
-	int	nrec_0x54_tide = 0;
-	int	nrec_0x55_svp2 = 0;
-	int	nrec_0x56_svp = 0;
-	int	nrec_0x57_surfacesoundspeed = 0;
-	int	nrec_0x58_bathymetry2 = 0;
-	int	nrec_0x59_sidescan2 = 0;
-	int	nrec_0x66_rawbeamf = 0;
-	int	nrec_0x68_height = 0;
-	int	nrec_0x69_parameter_stop = 0;
-	int	nrec_0x6B_water_column = 0;
-	int	nrec_0x6E_network_attitude = 0;
-	int	nrec_0x70_parameter = 0;
-	int	nrec_0x73_surface_sound_speed = 0;
-	int	nrec_0xE1_bathymetry_mbari57 = 0;
-	int	nrec_0xE2_sidescan_mbari57 = 0;
-	int	nrec_0xE3_bathymetry_mbari59 = 0;
-	int	nrec_0xE4_sidescan_mbari59 = 0;
-	int	nrec_0xE5_bathymetry_mbari59 = 0;
-
-	/* counting variables total */
-	int	nrec_0x30_pu_id_tot = 0;
-	int	nrec_0x31_pu_status_tot = 0;
-	int	nrec_0x32_pu_bist_tot = 0;
-	int	nrec_0x33_parameter_extra_tot = 0;
-	int	nrec_0x41_attitude_tot = 0;
-	int	nrec_0x43_clock_tot = 0;
-	int	nrec_0x44_bathymetry_tot = 0;
-	int	nrec_0x45_singlebeam_tot = 0;
-	int	nrec_0x46_rawbeamF_tot = 0;
-	int	nrec_0x47_surfacesoundspeed2_tot = 0;
-	int	nrec_0x48_heading_tot = 0;
-	int	nrec_0x49_parameter_start_tot = 0;
-	int	nrec_0x4A_tilt_tot = 0;
-	int	nrec_0x4B_echogram_tot = 0;
-	int	nrec_0x4E_rawbeamN_tot = 0;
-	int	nrec_0x4F_quality_tot = 0;
-	int	nrec_0x50_pos_tot = 0;
-	int	nrec_0x52_runtime_tot = 0;
-	int	nrec_0x53_sidescan_tot = 0;
-	int	nrec_0x54_tide_tot = 0;
-	int	nrec_0x55_svp2_tot = 0;
-	int	nrec_0x56_svp_tot = 0;
-	int	nrec_0x57_surfacesoundspeed_tot = 0;
-	int	nrec_0x58_bathymetry2_tot = 0;
-	int	nrec_0x59_sidescan2_tot = 0;
-	int	nrec_0x66_rawbeamf_tot = 0;
-	int	nrec_0x68_height_tot = 0;
-	int	nrec_0x69_parameter_stop_tot = 0;
-	int	nrec_0x6B_water_column_tot = 0;
-	int	nrec_0x6E_network_attitude_tot = 0;
-	int	nrec_0x70_parameter_tot = 0;
-	int	nrec_0x73_surface_sound_speed_tot = 0;
-	int	nrec_0xE1_bathymetry_mbari57_tot = 0;
-	int	nrec_0xE2_sidescan_mbari57_tot = 0;
-	int	nrec_0xE3_bathymetry_mbari59_tot = 0;
-	int	nrec_0xE4_sidescan_mbari59_tot = 0;
-	int	nrec_0xE5_bathymetry_mbari59_tot = 0;
-
-	/* asynchronous navigation, heading, attitude data */
-	int	ndat_nav = 0;
-	int	ndat_nav_alloc = 0;
-	double	*dat_nav_time_d = NULL;
-	double	*dat_nav_lon = NULL;
-	double	*dat_nav_lat = NULL;
-
-	int	ndat_sonardepth = 0;
-	int	ndat_sonardepth_alloc = 0;
-	double	*dat_sonardepth_time_d = NULL;
-	double	*dat_sonardepth_sonardepth = NULL;
-	double	*dat_sonardepth_sonardepthfilter = NULL;
-
-	int	ndat_heading = 0;
-	int	ndat_heading_alloc = 0;
-	double	*dat_heading_time_d = NULL;
-	double	*dat_heading_heading = NULL;
-
-	int	ndat_rph = 0;
-	int	ndat_rph_alloc = 0;
-	double	*dat_rph_time_d = NULL;
-	double	*dat_rph_roll = NULL;
-	double	*dat_rph_pitch = NULL;
-	double	*dat_rph_heave = NULL;
-
-	/* timelag parameters */
-	int	timelagmode = MBKONSBERGPREPROCESS_TIMELAG_OFF;
-	double	timelag = 0.0;
-	double	timelagconstant = 0.0;
-	char	timelagfile[MB_PATH_MAXLINE];
-	int	ntimelag = 0;
-	double	*timelag_time_d = NULL;
-	double	*timelag_model = NULL;
-
-	/* depth sensor filtering */
-	int	sonardepthfilter = MB_NO;
-	double	sonardepthfilterlength = 20.0;
-	double	sonardepthfilterdepth = 20.0;
-
-	/* depth sensor offset and lever arm parameters */
-	int	sonardepthlever = MB_NO;
-	double	sonardepthoffset = 0.0; /* depth sensor offset (+ makes vehicle deeper) */
-	double	depthsensoroffx = 0.0;
-	double	depthsensoroffy = 0.0;
-	double	depthsensoroffz = 0.0;
-
-	/* output asynchronous and synchronous time series ancilliary files */
-	char	athfile[MB_PATH_MAXLINE];
-	char	atsfile[MB_PATH_MAXLINE];
-	char	atafile[MB_PATH_MAXLINE];
-	char	stafile[MB_PATH_MAXLINE];
-	FILE	*athfp;
-	FILE	*atsfp;
-	FILE	*atafp;
-	FILE	*stafp;
-	
-	/* handling water column records */
-	int	watercolumnmode = MBKONSBERGPREPROCESS_WATERCOLUMN_IGNORE;
-
-	/* processing kluge modes */
-	int	klugemode;
-
-	int	interp_status;
-	FILE	*tfp = NULL;
-	struct stat file_status;
-	int	fstat;
-	char	buffer[MB_PATH_MAXLINE];
-	char	*result;
-	int	read_data;
-	char	fileroot[MB_PATH_MAXLINE];
-	char	*filenameptr;
-	int	testformat;
-	int	type, source;
-	double	start_time_d, end_time_d;
-	
-	double	transmit_time_d, transmit_heading, transmit_heave, transmit_roll, transmit_pitch;
-	double	receive_time_d, receive_heading, receive_heave, receive_roll, receive_pitch;
-	
-	/* transmit and receive array offsets */
-	double	tx_x, tx_y, tx_z, tx_h, tx_r, tx_p;
-	double	rx_x, rx_y, rx_z, rx_h, rx_r, rx_p;
-	
-	/* depth sensor offsets - used in place of heave for underwater platforms */
-	int	depthsensor_mode;
-	double	depth_off_x, depth_off_y, depth_off_z;
-	
-	/* roll and pitch sensor offsets */
-	double	rollpitch_off_x, rollpitch_off_y, rollpitch_off_z, rollpitch_off_h, rollpitch_off_r, rollpitch_off_p;
-	
-	/* heave sensor offsets */
-	double	heave_off_x, heave_off_y, heave_off_z, heave_off_h, heave_off_r, heave_off_p;
-	
-	/* heading sensor offset */
-	double	heading_off_x, heading_off_y, heading_off_z, heading_off_h, heading_off_r, heading_off_p;
-	
-	/* position sensor offsets */
-	double	position_off_x, position_off_y, position_off_z;
-	
-	/* lever arm offsets */
-	double	lever_x, lever_y, lever_z;
-	
-	/* variables for beam angle calculation */
-	mb_3D_orientation tx_align;
-	mb_3D_orientation tx_orientation;
-	double tx_steer;
-	mb_3D_orientation rx_align;
-	mb_3D_orientation rx_orientation;
-	double rx_steer;
-	double reference_heading;
-	double beamAzimuth;
-	double beamDepression;
-	double	*pixel_size, *swath_width;
-	mb_u_char detection_mask;
-	
-	int	jtimelag = 0;
-	int	jnav = 0;
-	int	jheading = 0;
-	int	jattitude = 0;
-	int	jsonardepth = 0;
-	int	nhalffilter;
-	double	sonardepth_filterweight;
-	double	dtime, dtol, weight;
-	double	factor;
-
-	int	nscan;
-	int	i, j, j1, j2;
-
-	/* get current default values */
-	status = mb_defaults(verbose,&format,&pings,&lonflip,bounds,
-		btime_i,etime_i,&speedmin,&timegap);
-
-	/* set default input to datalist.mb-1 */
-	strcpy (read_file, "datalist.mb-1");
-
-	/* set default nav and attitude sources */
-	nav_source = MB_DATA_NAV;
-	attitude_source = MB_DATA_ATTITUDE;
-	heading_source = MB_DATA_NAV;
-	sonardepth_source = MB_DATA_DATA;
-
-	/* process argument list */
-	while ((c = getopt(argc, argv, "CcD:d:E:e:F:f:I:i:K:k:O:o:P:p:S:s:T:t:VvHh")) != -1)
-	  switch (c)
-		{
-		case 'H':
-		case 'h':
-			help++;
-			break;
-		case 'V':
-		case 'v':
-			verbose++;
-			break;
-		case 'C':
-		case 'c':
-			output_counts = MB_YES;
-			flag++;
-			break;
-		case 'D':
-		case 'd':
-			sscanf (optarg,"%s", odir);
-			odir_set  = MB_YES;
-			flag++;
-			break;
-		case 'E':
-		case 'e':
-			nscan = sscanf (optarg,"%lf/%lf/%lf/%lf", &depthsensoroffx, &depthsensoroffy, &depthsensoroffz, &sonardepthoffset);
-			if (nscan < 4)
-				{
-				if (nscan == 3)
-					{
-					sonardepthoffset = depthsensoroffz;
-					depthsensoroffz = depthsensoroffy;
-					depthsensoroffy = depthsensoroffx;
-					depthsensoroffx = 0.0;
-					}
-				else if (nscan == 2)
-					{
-					sonardepthoffset = 0.0;
-					depthsensoroffz = depthsensoroffy;
-					depthsensoroffy = depthsensoroffx;
-					depthsensoroffx = 0.0;
-					}
-				else if (nscan == 1)
-					{
-					sonardepthoffset = 0.0;
-					depthsensoroffz = 0.0;
-					depthsensoroffy = depthsensoroffx;
-					depthsensoroffx = 0.0;
-					}
-				}
-			if (nscan > 0)
-				sonardepthlever = MB_YES;
-			flag++;
-			break;
-		case 'F':
-		case 'f':
-			sscanf (optarg,"%d", &format);
-			flag++;
-			break;
-		case 'I':
-		case 'i':
-			sscanf (optarg,"%s", read_file);
-			flag++;
-			break;
-		case 'K':
-		case 'k':
-			sscanf (optarg,"%d", &klugemode);
-			flag++;
-			break;
-		case 'O':
-		case 'o':
-			sscanf (optarg,"%s", ofile);
-			ofile_set  = MB_YES;
-			flag++;
-			break;
-		case 'P':
-		case 'p':
-			nscan = sscanf (optarg,"%lf/%lf", &sonardepthfilterlength, &sonardepthfilterdepth);
-			if (nscan == 1)
-				sonardepthfilterdepth = 20.0;
-			if (nscan >= 1)
-				sonardepthfilter = MB_YES;
-			else
-				sonardepthfilter = MB_NO;
-			break;
-		case 'S':
-		case 's':
-			sscanf (optarg,"%d/%d", &type, &source);
-			if (type == 1)
-				nav_source = source;
-			else if (type == 2)
-				heading_source = source;
-			else if (type == 3)
-				attitude_source = source;
-			else if (type == 4)
-				sonardepth_source = source;
-			flag++;
-			break;
-		case 'T':
-		case 't':
-			sscanf (optarg,"%s", timelagfile);
-			if ((fstat = stat(timelagfile, &file_status)) == 0
-				&& (file_status.st_mode & S_IFMT) != S_IFDIR)
-				{
-				timelagmode = MBKONSBERGPREPROCESS_TIMELAG_MODEL;
-				}
-			else
-				{
-				sscanf (optarg,"%lf", &timelagconstant);
-				timelagmode = MBKONSBERGPREPROCESS_TIMELAG_CONSTANT;
-				}
-			flag++;
-			break;
-		case 'W':
-		case 'w':
-			sscanf (optarg,"%d", &watercolumnmode);
-			flag++;
-			break;			
-		case '?':
-			errflg++;
-		}
-
-	/* if error flagged then print it and exit */
-	if (errflg)
-		{
-		fprintf(stderr,"usage: %s\n", usage_message);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		error = MB_ERROR_BAD_USAGE;
-		exit(error);
-		}
-
-	/* print starting message */
-	if (verbose == 1 || help)
-		{
-		fprintf(stderr,"\nProgram %s\n",program_name);
-		fprintf(stderr,"Version %s\n",rcs_id);
-		fprintf(stderr,"MB-system Version %s\n",MB_VERSION);
-		}
-
-	/* print starting debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  Program <%s>\n",program_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Control Parameters:\n");
-		fprintf(stderr,"dbg2       verbose:             %d\n",verbose);
-		fprintf(stderr,"dbg2       help:                %d\n",help);
-		fprintf(stderr,"dbg2       format:              %d\n",format);
-		fprintf(stderr,"dbg2       pings:               %d\n",pings);
-		fprintf(stderr,"dbg2       lonflip:             %d\n",lonflip);
-		fprintf(stderr,"dbg2       bounds[0]:           %f\n",bounds[0]);
-		fprintf(stderr,"dbg2       bounds[1]:           %f\n",bounds[1]);
-		fprintf(stderr,"dbg2       bounds[2]:           %f\n",bounds[2]);
-		fprintf(stderr,"dbg2       bounds[3]:           %f\n",bounds[3]);
-		fprintf(stderr,"dbg2       btime_i[0]:          %d\n",btime_i[0]);
-		fprintf(stderr,"dbg2       btime_i[1]:          %d\n",btime_i[1]);
-		fprintf(stderr,"dbg2       btime_i[2]:          %d\n",btime_i[2]);
-		fprintf(stderr,"dbg2       btime_i[3]:          %d\n",btime_i[3]);
-		fprintf(stderr,"dbg2       btime_i[4]:          %d\n",btime_i[4]);
-		fprintf(stderr,"dbg2       btime_i[5]:          %d\n",btime_i[5]);
-		fprintf(stderr,"dbg2       btime_i[6]:          %d\n",btime_i[6]);
-		fprintf(stderr,"dbg2       etime_i[0]:          %d\n",etime_i[0]);
-		fprintf(stderr,"dbg2       etime_i[1]:          %d\n",etime_i[1]);
-		fprintf(stderr,"dbg2       etime_i[2]:          %d\n",etime_i[2]);
-		fprintf(stderr,"dbg2       etime_i[3]:          %d\n",etime_i[3]);
-		fprintf(stderr,"dbg2       etime_i[4]:          %d\n",etime_i[4]);
-		fprintf(stderr,"dbg2       etime_i[5]:          %d\n",etime_i[5]);
-		fprintf(stderr,"dbg2       etime_i[6]:          %d\n",etime_i[6]);
-		fprintf(stderr,"dbg2       speedmin:            %f\n",speedmin);
-		fprintf(stderr,"dbg2       timegap:             %f\n",timegap);
-		fprintf(stderr,"dbg2       read_file:           %s\n",read_file);
-		fprintf(stderr,"dbg2       ofile:               %s\n",ofile);
-		fprintf(stderr,"dbg2       ofile_set:           %d\n",ofile_set);
-		fprintf(stderr,"dbg2       odir:               %s\n",odir);
-		fprintf(stderr,"dbg2       odir_set:           %d\n",odir_set);
-		if (timelagmode == MBKONSBERGPREPROCESS_TIMELAG_MODEL)
-			{
-			fprintf(stderr,"dbg2       timelagfile:         %s\n",timelagfile);
-			fprintf(stderr,"dbg2       ntimelag:            %d\n",ntimelag);
-			}
-		else
-			{
-			fprintf(stderr,"dbg2       timelag:             %f\n",timelag);
-			}
-		fprintf(stderr,"dbg2       timelag:                %f\n",timelag);
-		fprintf(stderr,"dbg2       watercolumnmode:        %d\n",watercolumnmode);
-		fprintf(stderr,"dbg2       sonardepthfilter:       %d\n",sonardepthfilter);
-		fprintf(stderr,"dbg2       sonardepthfilterlength: %f\n",sonardepthfilterlength);
-		fprintf(stderr,"dbg2       sonardepthfilterdepth:  %f\n",sonardepthfilterdepth);
-		fprintf(stderr,"dbg2       sonardepthlever:        %d\n",sonardepthlever);
-		fprintf(stderr,"dbg2       sonardepthoffset:       %f\n",sonardepthoffset);
-		fprintf(stderr,"dbg2       depthsensoroffx:        %f\n",depthsensoroffx);
-		fprintf(stderr,"dbg2       depthsensoroffy:        %f\n",depthsensoroffy);
-		fprintf(stderr,"dbg2       depthsensoroffz:        %f\n",depthsensoroffz);
-		}
-
-	/* if help desired then print it and exit */
-	if (help)
-		{
-		fprintf(stderr,"\n%s\n",help_message);
-		fprintf(stderr,"\nusage: %s\n", usage_message);
-		exit(error);
-		}
-
-	/* get time lag model if specified */
-	if (timelagmode == MBKONSBERGPREPROCESS_TIMELAG_MODEL)
-		{
-		/* count the data points in the timelag file */
-		ntimelag = 0;
-		if ((tfp = fopen(timelagfile, "r")) == NULL)
-			{
-			error = MB_ERROR_OPEN_FAIL;
-			fprintf(stderr,"\nUnable to open time lag model File <%s> for reading\n",timelagfile);
-			fprintf(stderr,"\nProgram <%s> Terminated\n",
-				program_name);
-			exit(error);
-			}
-		while ((result = fgets(buffer,MB_PATH_MAXLINE,tfp)) == buffer)
-			if (buffer[0] != '#')
-			    ntimelag++;
-		rewind(tfp);
-
-		/* allocate arrays for time lag */
-		if (ntimelag > 0)
-		    {
-		    status = mb_mallocd(verbose, __FILE__, __LINE__,ntimelag * sizeof(double), (void **)&timelag_time_d,&error);
-		    if (error == MB_ERROR_NO_ERROR)
-		    	status = mb_mallocd(verbose, __FILE__, __LINE__,ntimelag * sizeof(double), (void **)&timelag_model,&error);
-		    if (error != MB_ERROR_NO_ERROR)
-			{
-			mb_error(verbose,error,&message);
-			fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",message);
-			fprintf(stderr,"\nProgram <%s> Terminated\n",
-				program_name);
-			exit(error);
-			}
-		    }
-
-		/* if no time lag data then quit */
-		else
-		    {
-		    error = MB_ERROR_BAD_DATA;
-		    fprintf(stderr,"\nUnable to read data from time lag model file <%s>\n",timelagfile);
-		    fprintf(stderr,"\nProgram <%s> Terminated\n",
-			    program_name);
-		    exit(error);
-		    }
-
-		/* read the data points in the timelag file */
-		ntimelag = 0;
-		while ((result = fgets(buffer,MB_PATH_MAXLINE,tfp)) == buffer)
-		    {
-		    if (buffer[0] != '#')
-			{
-			/* read the time and time lag pair */
-			if (sscanf(buffer,"%lf %lf",&timelag_time_d[ntimelag],&timelag_model[ntimelag]) == 2)
-			    ntimelag++;
-			}
-		    }
-		fclose(tfp);
-
-		/* output info */
-		if (ntimelag > 0)
-			{
-			mb_get_date(verbose, timelag_time_d[0], btime_i);
-			mb_get_date(verbose, timelag_time_d[ntimelag-1], etime_i);
-			fprintf(stderr, "%d timelag records read from %s  Start:%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d  End:%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d\n",
-					ntimelag, timelagfile,
-					btime_i[0], btime_i[1], btime_i[2], btime_i[3], btime_i[4], btime_i[5], btime_i[6],
-					etime_i[0], etime_i[1], etime_i[2], etime_i[3], etime_i[4], etime_i[5], etime_i[6]);
-			}
-		else
-			fprintf(stderr, "No timelag data read from %s....\n",timelagfile);
-		}
-
-	/* get format if required */
-	if (format == 0)
-		mb_get_format(verbose,read_file,NULL,&format,&error);
-
-	/* determine whether to read one file or a list of files */
-	if (format < 0)
-		read_datalist = MB_YES;
-
-	/* open file list */
-	if (read_datalist == MB_YES)
-	    {
-	    if ((status = mb_datalist_open(verbose,&datalist,
-					    read_file,look_processed,&error)) != MB_SUCCESS)
-		{
-		error = MB_ERROR_OPEN_FAIL;
-		fprintf(stderr,"\nUnable to open data list file: %s\n",
-			read_file);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-	    if ((status = mb_datalist_read(verbose,datalist,
-			    ifile,&format,&file_weight,&error))
-			    == MB_SUCCESS)
-		read_data = MB_YES;
-	    else
-		read_data = MB_NO;
-	    }
-	/* else copy single filename to be read */
-	else
-	    {
-	    strcpy(ifile, read_file);
-	    read_data = MB_YES;
-	    }
-
-	/* loop over all files to be read */
-	while (read_data == MB_YES &&
-	       (format == MBF_EM300RAW
-		|| format == MBF_EM300MBA
-		|| format == MBF_EM710RAW
-		|| format == MBF_EM710MBA))
-	{
-	/* initialize reading the swath file */
-	if ((status = mb_read_init(
-		verbose,ifile,format,pings,lonflip,bounds,
-		btime_i,etime_i,speedmin,timegap,
-		&imbio_ptr,&btime_d,&etime_d,
-		&beams_bath,&beams_amp,&pixels_ss,&error)) != MB_SUCCESS)
-		{
-		mb_error(verbose,error,&message);
-		fprintf(stderr,"\nMBIO Error returned from function <mb_read_init>:\n%s\n",message);
-		fprintf(stderr,"\nMultibeam File <%s> not initialized for reading\n",ifile);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-
-	/* get pointers to data storage */
-	imb_io_ptr = (struct mb_io_struct *) imbio_ptr;
-	istore_ptr = imb_io_ptr->store_data;
-	istore = (struct mbsys_simrad3_struct *) istore_ptr;
-
-	if (error == MB_ERROR_NO_ERROR)
-		{
-		beamflag = NULL;
-		bath = NULL;
-		amp = NULL;
-		bathacrosstrack = NULL;
-		bathalongtrack = NULL;
-		ss = NULL;
-		ssacrosstrack = NULL;
-		ssalongtrack = NULL;
-		}
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(char), (void **)&beamflag, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(double), (void **)&bath, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_AMPLITUDE,
-						sizeof(double), (void **)&amp, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(double), (void **)&bathacrosstrack, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(double), (void **)&bathalongtrack, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_SIDESCAN,
-						sizeof(double), (void **)&ss, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_SIDESCAN,
-						sizeof(double), (void **)&ssacrosstrack, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_SIDESCAN,
-						sizeof(double), (void **)&ssalongtrack, &error);
-
-	/* if error initializing memory then quit */
-	if (error != MB_ERROR_NO_ERROR)
-		{
-		mb_error(verbose,error,&message);
-		fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",
-			message);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-
-	/* reset file record counters */
-	nrec_0x30_pu_id = 0;
-	nrec_0x31_pu_status = 0;
-	nrec_0x32_pu_bist = 0;
-	nrec_0x33_parameter_extra = 0;
-	nrec_0x41_attitude = 0;
-	nrec_0x43_clock = 0;
-	nrec_0x44_bathymetry = 0;
-	nrec_0x45_singlebeam = 0;
-	nrec_0x46_rawbeamF = 0;
-	nrec_0x47_surfacesoundspeed2 = 0;
-	nrec_0x48_heading = 0;
-	nrec_0x49_parameter_start = 0;
-	nrec_0x4A_tilt = 0;
-	nrec_0x4B_echogram = 0;
-	nrec_0x4E_rawbeamN = 0;
-	nrec_0x4F_quality = 0;
-	nrec_0x50_pos = 0;
-	nrec_0x52_runtime = 0;
-	nrec_0x53_sidescan = 0;
-	nrec_0x54_tide = 0;
-	nrec_0x55_svp2 = 0;
-	nrec_0x56_svp = 0;
-	nrec_0x57_surfacesoundspeed = 0;
-	nrec_0x58_bathymetry2 = 0;
-	nrec_0x59_sidescan2 = 0;
-	nrec_0x66_rawbeamf = 0;
-	nrec_0x68_height = 0;
-	nrec_0x69_parameter_stop = 0;
-	nrec_0x6B_water_column = 0;
-	nrec_0x6E_network_attitude = 0;
-	nrec_0x70_parameter = 0;
-	nrec_0x73_surface_sound_speed = 0;
-	nrec_0xE1_bathymetry_mbari57 = 0;
-	nrec_0xE2_sidescan_mbari57 = 0;
-	nrec_0xE3_bathymetry_mbari59 = 0;
-	nrec_0xE4_sidescan_mbari59 = 0;
-	nrec_0xE5_bathymetry_mbari59 = 0;
-
-	/* read and print data */
-	while (error <= MB_ERROR_NO_ERROR)
-		{
-		/* reset error */
-		error = MB_ERROR_NO_ERROR;
-
-		/* read next data record */
-		status = mb_get_all(verbose,imbio_ptr,&istore_ptr,&kind,
-				    time_i,&time_d,&navlon,&navlat,
-				    &speed,&heading,
-				    &distance,&altitude,&sonardepth,
-				    &beams_bath,&beams_amp,&pixels_ss,
-				    beamflag,bath,amp,bathacrosstrack,bathalongtrack,
-				    ss,ssacrosstrack,ssalongtrack,
-				    comment,&error);
-
-		/* some nonfatal errors do not matter */
-		if (error < MB_ERROR_NO_ERROR && error > MB_ERROR_UNINTELLIGIBLE)
-			{
-			error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-
-		/* count the record that was just read */
-		if (status == MB_SUCCESS && kind == MB_DATA_DATA)
-			{
-			ping = (struct mbsys_simrad3_ping_struct *) &(istore->pings[istore->ping_index]);
-
-			if (format == MBF_EM300RAW)
-				{
-				nrec_0x58_bathymetry2++;
-				if (ping->png_raw_read == MB_YES)
-					nrec_0x4E_rawbeamN++;
-				if (ping->png_ss_read == MB_YES)
-					nrec_0x59_sidescan2++;
-				}
-			else if (format == MBF_EM300MBA)
-				{
-				nrec_0xE5_bathymetry_mbari59++;
-				if (ping->png_raw_read == MB_YES)
-					nrec_0x4E_rawbeamN++;
-				if (ping->png_ss_read == MB_YES)
-					nrec_0x59_sidescan2++;
-				}
-			else if (format == MBF_EM710RAW)
-				{
-				nrec_0x58_bathymetry2++;
-				if (ping->png_raw_read == MB_YES)
-					nrec_0x4E_rawbeamN++;
-				if (ping->png_ss_read == MB_YES)
-					nrec_0x59_sidescan2++;
-				if (ping->png_quality_read == MB_YES)
-					nrec_0x4F_quality++;
-				}
-			else if (format == MBF_EM710MBA)
-				{
-				nrec_0xE5_bathymetry_mbari59++;
-				if (ping->png_raw_read == MB_YES)
-					nrec_0x4E_rawbeamN++;
-				if (ping->png_ss_read == MB_YES)
-					nrec_0x59_sidescan2++;
-				if (ping->png_quality_read == MB_YES)
-					nrec_0x4F_quality++;
-				}
-			}
-		else if (status == MB_SUCCESS)
-			{
-			if (istore->type == EM3_PU_ID)
-				nrec_0x30_pu_id++;
-			if (istore->type == EM3_PU_STATUS)
-				nrec_0x31_pu_status++;
-			if (istore->type == EM3_PU_BIST)
-				nrec_0x32_pu_bist++;
-			if (istore->type == EM3_ATTITUDE)
-				nrec_0x41_attitude++;
-			if (istore->type == EM3_CLOCK)
-				nrec_0x43_clock++;
-			if (istore->type == EM3_BATH)
-				nrec_0x44_bathymetry++;
-			if (istore->type == EM3_SBDEPTH)
-				nrec_0x45_singlebeam++;
-			if (istore->type == EM3_RAWBEAM)
-				nrec_0x46_rawbeamF++;
-			if (istore->type == EM3_SSV)
-				nrec_0x47_surfacesoundspeed2++;
-			if (istore->type == EM3_HEADING)
-				nrec_0x48_heading++;
-			if (istore->type == EM3_START)
-				nrec_0x49_parameter_start++;
-			if (istore->type == EM3_TILT)
-				nrec_0x4A_tilt++;
-			if (istore->type == EM3_CBECHO)
-				nrec_0x4B_echogram++;
-			if (istore->type == EM3_RAWBEAM4)
-				nrec_0x4E_rawbeamN++;
-			if (istore->type == EM3_QUALITY)
-				nrec_0x4F_quality++;
-			if (istore->type == EM3_POS)
-				nrec_0x50_pos++;
-			if (istore->type == EM3_RUN_PARAMETER)
-				nrec_0x52_runtime++;
-			if (istore->type == EM3_SS)
-				nrec_0x53_sidescan++;
-			if (istore->type == EM3_TIDE)
-				nrec_0x54_tide++;
-			if (istore->type == EM3_SVP2)
-				nrec_0x55_svp2++;
-			if (istore->type == EM3_SVP)
-				nrec_0x56_svp++;
-			if (istore->type == EM3_SSPINPUT)
-				nrec_0x57_surfacesoundspeed++;
-			if (istore->type == EM3_BATH2)
-				nrec_0x58_bathymetry2++;
-			if (istore->type == EM3_SS2)
-				nrec_0x59_sidescan2++;
-			if (istore->type == EM3_RAWBEAM3)
-				nrec_0x66_rawbeamf++;
-			if (istore->type == EM3_HEIGHT)
-				nrec_0x68_height++;
-			if (istore->type == EM3_STOP)
-				nrec_0x69_parameter_stop++;
-			if (istore->type == EM3_WATERCOLUMN)
-				nrec_0x6B_water_column++;
-			if (istore->type == EM3_NETATTITUDE)
-				nrec_0x6E_network_attitude++;
-			if (istore->type == EM3_REMOTE)
-				nrec_0x70_parameter++;
-			if (istore->type == EM3_SSP)
-				nrec_0x73_surface_sound_speed++;
-			if (istore->type == EM3_BATH_MBA)
-				nrec_0xE1_bathymetry_mbari57++;
-			if (istore->type == EM3_SS_MBA)
-				nrec_0xE2_sidescan_mbari57++;
-			if (istore->type == EM3_BATH2_MBA)
-				nrec_0xE3_bathymetry_mbari59++;
-			if (istore->type == EM3_SS2_MBA)
-				nrec_0xE4_sidescan_mbari59++;
-			if (istore->type == EM3_BATH3_MBA)
-				nrec_0xE5_bathymetry_mbari59++;
-			}
-
-	   	/* handle read error */
-		else
-			{
-/*fprintf(stderr,"READ FAILURE: status:%d error:%d kind:%d\n",status,error,kind);*/
-			}
-
-	   	/* save navigation and heading data from EM3_POS records */
-		if (status == MB_SUCCESS
-			&& istore->type == EM3_POS
-			&& (istore->kind == nav_source
-				|| istore->kind == heading_source))
-			{
-			/* get nav time */
-			time_i[0] = istore->pos_date / 10000;
-			time_i[1] = (istore->pos_date % 10000) / 100;
-			time_i[2] = istore->pos_date % 100;
-			time_i[3] = istore->pos_msec / 3600000;
-			time_i[4] = (istore->pos_msec % 3600000) / 60000;
-			time_i[5] = (istore->pos_msec % 60000) / 1000;
-			time_i[6] = (istore->pos_msec % 1000) * 1000;
-			mb_get_time(verbose, time_i, &time_d);
-
-			if (mode == MBKONSBERGPREPROCESS_TIMESTAMPLIST)
-				fprintf(stderr,"Record time: %4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d nrec_0x50_pos:%d\n",
-						time_i[0],time_i[1],time_i[2],time_i[3],time_i[4],time_i[5],time_i[6],nrec_0x50_pos);
-
-			/* deal with desired navigation source and valid positions */
-			if (istore->kind == nav_source
-				&& istore->pos_longitude != EM3_INVALID_INT
-				&& istore->pos_latitude != EM3_INVALID_INT)
-				{
-				/* allocate memory for position arrays if needed */
-				if (ndat_nav + 1 >= ndat_nav_alloc)
-					{
-					ndat_nav_alloc +=  MBKONSBERGPREPROCESS_ALLOC_CHUNK;
-					status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_nav_alloc*sizeof(double),(void **)&dat_nav_time_d,&error);
-					status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_nav_alloc*sizeof(double),(void **)&dat_nav_lon,&error);
-					status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_nav_alloc*sizeof(double),(void **)&dat_nav_lat,&error);
-					if (error != MB_ERROR_NO_ERROR)
-						{
-						mb_error(verbose,error,&message);
-						fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",message);
-						fprintf(stderr,"\nProgram <%s> Terminated\n",
-						    program_name);
-						exit(error);
-						}
-					}
-
-				/* store the position data */
-				if (ndat_nav == 0 || dat_nav_time_d[ndat_nav-1] < time_d)
-					{
-					dat_nav_time_d[ndat_nav] = time_d;
-					dat_nav_lon[ndat_nav] = (double)(0.0000001 * istore->pos_longitude);
-					dat_nav_lat[ndat_nav] = (double)(0.00000005 * istore->pos_latitude);
-
-					/* apply time lag correction if specified */
-					if (timelagmode == MBKONSBERGPREPROCESS_TIMELAG_CONSTANT)
-						{
-						dat_nav_time_d[ndat_nav] -= timelagconstant;
-						}
-					else if (timelagmode == MBKONSBERGPREPROCESS_TIMELAG_MODEL && ntimelag > 0)
-						{
-						interp_status = mb_linear_interp(verbose,
-									timelag_time_d-1, timelag_model-1,
-									ntimelag, dat_nav_time_d[ndat_nav], &timelag, &jtimelag,
-									&error);
-						dat_nav_time_d[ndat_nav] -= timelag;
-						}
-
-					/* increment counter */
-					ndat_nav++;
-					}
-				}
-
-			/* deal with desired heading source and valid heading */
-			if (istore->kind == heading_source
-				&& istore->pos_heading != EM3_INVALID_INT)
-				{
-
-				/* allocate memory for heading arrays if needed */
-				if (ndat_heading + 1 >= ndat_heading_alloc)
-					{
-					ndat_heading_alloc +=  MBKONSBERGPREPROCESS_ALLOC_CHUNK;
-					status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_heading_alloc*sizeof(double),(void **)&dat_heading_time_d,&error);
-					status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_heading_alloc*sizeof(double),(void **)&dat_heading_heading,&error);
-					if (error != MB_ERROR_NO_ERROR)
-						{
-						mb_error(verbose,error,&message);
-						fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",message);
-						fprintf(stderr,"\nProgram <%s> Terminated\n",
-						    program_name);
-						exit(error);
-						}
-					}
-
-				/* store the heading data */
-				if (ndat_heading == 0 || dat_heading_time_d[ndat_heading-1] < time_d)
-					{
-					dat_heading_time_d[ndat_heading] = time_d;
-					dat_heading_heading[ndat_heading] = (double)(0.01 * istore->pos_heading);
-
-					/* apply time lag correction if specified */
-					if (timelagmode == MBKONSBERGPREPROCESS_TIMELAG_CONSTANT)
-						{
-						dat_heading_time_d[ndat_heading] -= timelagconstant;
-						}
-					else if (timelagmode == MBKONSBERGPREPROCESS_TIMELAG_MODEL && ntimelag > 0)
-						{
-						interp_status = mb_linear_interp(verbose,
-									timelag_time_d-1, timelag_model-1,
-									ntimelag, dat_heading_time_d[ndat_heading], &timelag, &jtimelag,
-									&error);
-						dat_nav_time_d[ndat_heading] -= timelag;
-						}
-
-					/* increment counter */
-					ndat_heading++;
-					}
-				}
-
-			}
-
-	   	/* save sonardepth data from height records */
-		if (status == MB_SUCCESS
-			&& istore->type == EM3_HEIGHT
-		    	&& istore->kind == sonardepth_source)
-			{			
-			/* get sonardepth time */
-			time_i[0] = istore->hgt_date / 10000;
-			time_i[1] = (istore->hgt_date % 10000) / 100;
-			time_i[2] = istore->hgt_date % 100;
-			time_i[3] = istore->hgt_msec / 3600000;
-			time_i[4] = (istore->hgt_msec % 3600000) / 60000;
-			time_i[5] = (istore->hgt_msec % 60000) / 1000;
-			time_i[6] = (istore->hgt_msec % 1000) * 1000;
-			mb_get_time(verbose, time_i, &time_d);
-
-			if (mode == MBKONSBERGPREPROCESS_TIMESTAMPLIST)
-				fprintf(stderr,"Record time: %4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d nrec_0x68_height:%d\n",
-						time_i[0],time_i[1],time_i[2],time_i[3],time_i[4],time_i[5],time_i[6],nrec_0x68_height);
-
-			/* allocate memory for sonar depth arrays if needed */
-			if (ndat_sonardepth + 1 >= ndat_sonardepth_alloc)
-				{
-				ndat_sonardepth_alloc +=  MBKONSBERGPREPROCESS_ALLOC_CHUNK;
-				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_sonardepth_alloc*sizeof(double),(void **)&dat_sonardepth_time_d,&error);
-				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_sonardepth_alloc*sizeof(double),(void **)&dat_sonardepth_sonardepth,&error);
-				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_sonardepth_alloc*sizeof(double),(void **)&dat_sonardepth_sonardepthfilter,&error);
-				if (error != MB_ERROR_NO_ERROR)
-					{
-					mb_error(verbose,error,&message);
-					fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",message);
-					fprintf(stderr,"\nProgram <%s> Terminated\n",
-					    program_name);
-					exit(error);
-					}
-				}
-
-			/* store the sonar depth data */
-			if (ndat_sonardepth == 0 || dat_sonardepth_time_d[ndat_sonardepth-1] < time_d)
-				{
-				dat_sonardepth_time_d[ndat_sonardepth] = time_d;
-				dat_sonardepth_sonardepth[ndat_sonardepth] = 0.01 * istore->hgt_height;
-				dat_sonardepth_sonardepthfilter[ndat_sonardepth] = 0.0;
-				
-				/* apply time lag correction if specified */
-				if (timelagmode == MBKONSBERGPREPROCESS_TIMELAG_CONSTANT)
-					{
-					dat_sonardepth_time_d[ndat_sonardepth] -= timelagconstant;
-					}
-				else if (timelagmode == MBKONSBERGPREPROCESS_TIMELAG_MODEL && ntimelag > 0)
-					{
-					interp_status = mb_linear_interp(verbose,
-								timelag_time_d-1, timelag_model-1,
-								ntimelag, dat_sonardepth_time_d[ndat_sonardepth], &timelag, &jtimelag,
-								&error);
-					dat_sonardepth_time_d[ndat_sonardepth] -= timelag;
-					}
-
-				/* increment counter */
-				ndat_sonardepth++;
-				}
-			}
-
-	   	/* save primary attitude data from attitude records */
-		if (status == MB_SUCCESS
-			&& istore->type == EM3_ATTITUDE
-		    	&& istore->kind == attitude_source)
-			{
-			/* get attitude structure */
-			attitude = (struct mbsys_simrad3_attitude_struct *) istore->attitude;
-
-			/* get attitude time */
-			time_i[0] = attitude->att_date / 10000;
-			time_i[1] = (attitude->att_date % 10000) / 100;
-			time_i[2] = attitude->att_date % 100;
-			time_i[3] = attitude->att_msec / 3600000;
-			time_i[4] = (attitude->att_msec % 3600000) / 60000;
-			time_i[5] = (attitude->att_msec % 60000) / 1000;
-			time_i[6] = (attitude->att_msec % 1000) * 1000;
-			mb_get_time(verbose, time_i, &time_d);
-
-			if (mode == MBKONSBERGPREPROCESS_TIMESTAMPLIST)
-				fprintf(stderr,"Record time: %4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d nrec_0x41_attitude:%d\n",
-					time_i[0],time_i[1],time_i[2],
-					time_i[3],time_i[4],time_i[5],time_i[6],nrec_0x41_attitude);
-
-			/* allocate memory for attitude arrays if needed */
-			if (ndat_rph + attitude->att_ndata >= ndat_rph_alloc)
-				{
-				ndat_rph_alloc +=  MBKONSBERGPREPROCESS_ALLOC_CHUNK;
-				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_rph_alloc*sizeof(double),(void **)&dat_rph_time_d,&error);
-				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_rph_alloc*sizeof(double),(void **)&dat_rph_roll,&error);
-				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_rph_alloc*sizeof(double),(void **)&dat_rph_pitch,&error);
-				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_rph_alloc*sizeof(double),(void **)&dat_rph_heave,&error);
-				if (error != MB_ERROR_NO_ERROR)
-					{
-					mb_error(verbose,error,&message);
-					fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",message);
-					fprintf(stderr,"\nProgram <%s> Terminated\n",
-					    program_name);
-					exit(error);
-					}
-				}
-
-			/* store the attitude data */
-			if (ndat_rph == 0 || dat_rph_time_d[ndat_rph-1] < time_d)
-				{
-				for (i=0;i<attitude->att_ndata;i++)
-					{
-					dat_rph_time_d[ndat_rph] = (double)(time_d + 0.001 * attitude->att_time[i]);
-					dat_rph_heave[ndat_rph] = (double)(0.01 * attitude->att_heave[i]);
-					dat_rph_roll[ndat_rph] = (double)(0.01 * attitude->att_roll[i]);
-					dat_rph_pitch[ndat_rph] = (double)(0.01 * attitude->att_pitch[i]);
-
-					/* apply time lag correction if specified */
-					if (timelagmode == MBKONSBERGPREPROCESS_TIMELAG_CONSTANT)
-						{
-						dat_rph_time_d[ndat_rph] -= timelagconstant;
-						}
-					else if (timelagmode == MBKONSBERGPREPROCESS_TIMELAG_MODEL && ntimelag > 0)
-						{
-						interp_status = mb_linear_interp(verbose,
-									timelag_time_d-1, timelag_model-1,
-									ntimelag, dat_rph_time_d[ndat_rph], &timelag, &jtimelag,
-									&error);
-						dat_rph_time_d[ndat_rph] -= timelag;
-						}
-
-					/* increment counter */
-					ndat_rph++;
-					}
-				}
-			}
-
-	   	/* save primary attitude data from netattitude records */
-		if (status == MB_SUCCESS
-			&& istore->type == EM3_NETATTITUDE
-		    	&& istore->kind == attitude_source)
-			{
-			/* get netattitude structure */
-			netattitude = (struct mbsys_simrad3_netattitude_struct *) istore->netattitude;
-
-			/* get attitude time */
-			time_i[0] = netattitude->nat_date / 10000;
-			time_i[1] = (netattitude->nat_date % 10000) / 100;
-			time_i[2] = netattitude->nat_date % 100;
-			time_i[3] = netattitude->nat_msec / 3600000;
-			time_i[4] = (netattitude->nat_msec % 3600000) / 60000;
-			time_i[5] = (netattitude->nat_msec % 60000) / 1000;
-			time_i[6] = (netattitude->nat_msec % 1000) * 1000;
-			mb_get_time(verbose, time_i, &time_d);
-
-			if (mode == MBKONSBERGPREPROCESS_TIMESTAMPLIST)
-				fprintf(stderr,"Record time: %4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d nrec_0x6E_network_attitude:%d\n",
-					time_i[0],time_i[1],time_i[2],
-					time_i[3],time_i[4],time_i[5],time_i[6],nrec_0x6E_network_attitude);
-
-			/* allocate memory for attitude arrays if needed */
-			if (ndat_rph + netattitude->nat_ndata >= ndat_rph_alloc)
-				{
-				ndat_rph_alloc +=  MBKONSBERGPREPROCESS_ALLOC_CHUNK;
-				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_rph_alloc*sizeof(double),(void **)&dat_rph_time_d,&error);
-				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_rph_alloc*sizeof(double),(void **)&dat_rph_roll,&error);
-				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_rph_alloc*sizeof(double),(void **)&dat_rph_pitch,&error);
-				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_rph_alloc*sizeof(double),(void **)&dat_rph_heave,&error);
-				if (error != MB_ERROR_NO_ERROR)
-					{
-					mb_error(verbose,error,&message);
-					fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",message);
-					fprintf(stderr,"\nProgram <%s> Terminated\n",
-					    program_name);
-					exit(error);
-					}
-				}
-
-			/* store the attitude data */
-			if (ndat_rph == 0 || dat_rph_time_d[ndat_rph-1] < time_d)
-				{
-				for (i=0;i<netattitude->nat_ndata;i++)
-					{
-					dat_rph_time_d[ndat_rph] = (double)(time_d + 0.001 * netattitude->nat_time[i]);
-					dat_rph_heave[ndat_rph] = (double)(0.01 * netattitude->nat_heave[i]);
-					dat_rph_roll[ndat_rph] = (double)(0.01 * netattitude->nat_roll[i]);
-					dat_rph_pitch[ndat_rph] = (double)(0.01 * netattitude->nat_pitch[i]);
-
-					/* apply time lag correction if specified */
-					if (timelagmode == MBKONSBERGPREPROCESS_TIMELAG_CONSTANT)
-						{
-						dat_rph_time_d[ndat_rph] -= timelagconstant;
-						}
-					else if (timelagmode == MBKONSBERGPREPROCESS_TIMELAG_MODEL && ntimelag > 0)
-						{
-						interp_status = mb_linear_interp(verbose,
-									timelag_time_d-1, timelag_model-1,
-									ntimelag, dat_rph_time_d[ndat_rph], &timelag, &jtimelag,
-									&error);
-						dat_rph_time_d[ndat_rph] -= timelag;
-						}
-
-					/* increment counter */
-					ndat_rph++;
-					}
-				}
-			}
-
-	   	/* save primary heading data */
-		if (status == MB_SUCCESS
-			&& istore->type == EM3_HEADING
-		    	&& istore->kind == heading_source)
-			{
-			/* get heading structure */
-			headingr = (struct mbsys_simrad3_heading_struct *) istore->heading;
-
-			/* get heading time */
-			time_i[0] = headingr->hed_date / 10000;
-			time_i[1] = (headingr->hed_date % 10000) / 100;
-			time_i[2] = headingr->hed_date % 100;
-			time_i[3] = headingr->hed_msec / 3600000;
-			time_i[4] = (headingr->hed_msec % 3600000) / 60000;
-			time_i[5] = (headingr->hed_msec % 60000) / 1000;
-			time_i[6] = (headingr->hed_msec % 1000) * 1000;
-			mb_get_time(verbose, time_i, &time_d);
-
-			if (mode == MBKONSBERGPREPROCESS_TIMESTAMPLIST)
-				fprintf(stderr,"Record time: %4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d nrec_0x48_heading:%d\n",
-					time_i[0],time_i[1],time_i[2],
-					time_i[3],time_i[4],time_i[5],time_i[6],nrec_0x48_heading);
-
-			/* allocate memory for heading arrays if needed */
-			if (ndat_heading + headingr->hed_ndata >= ndat_heading_alloc)
-				{
-				ndat_heading_alloc +=  MBKONSBERGPREPROCESS_ALLOC_CHUNK;
-				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_heading_alloc*sizeof(double),(void **)&dat_heading_time_d,&error);
-				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_heading_alloc*sizeof(double),(void **)&dat_heading_heading,&error);
-				if (error != MB_ERROR_NO_ERROR)
-					{
-					mb_error(verbose,error,&message);
-					fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",message);
-					fprintf(stderr,"\nProgram <%s> Terminated\n",
-					    program_name);
-					exit(error);
-					}
-				}
-
-			/* store the heading data */
-			if (ndat_heading == 0 || dat_heading_time_d[ndat_heading-1] < time_d)
-				{
-				for (i=0;i<headingr->hed_ndata;i++)
-					{
-					dat_heading_time_d[ndat_heading] = (double)(time_d + 0.001 * headingr->hed_time[i]);
-					dat_heading_heading[ndat_heading] = (double)(0.01 * headingr->hed_heading[i]);
-
-					/* apply time lag correction if specified */
-					if (timelagmode == MBKONSBERGPREPROCESS_TIMELAG_CONSTANT)
-						{
-						dat_heading_time_d[ndat_heading] -= timelagconstant;
-						}
-					else if (timelagmode == MBKONSBERGPREPROCESS_TIMELAG_MODEL && ntimelag > 0)
-						{
-						interp_status = mb_linear_interp(verbose,
-									timelag_time_d-1, timelag_model-1,
-									ntimelag, dat_heading_time_d[ndat_heading], &timelag, &jtimelag,
-									&error);
-						dat_heading_time_d[ndat_heading] -= timelag;
-						}
-
-					/* increment counter */
-					ndat_heading++;
-					}
-				}
-			}
-
-	   	/* save heading data from survey records */
-		if (status == MB_SUCCESS
-			&& istore->kind == MB_DATA_DATA
-		    	&& istore->kind == heading_source)
-			{
-			/* get survey data structure */
-			ping = (struct mbsys_simrad3_ping_struct *) &(istore->pings[istore->ping_index]);
-
-			/* get ping time */
-			time_i[0] = ping->png_date / 10000;
-			time_i[1] = (ping->png_date % 10000) / 100;
-			time_i[2] = ping->png_date % 100;
-			time_i[3] = ping->png_msec / 3600000;
-			time_i[4] = (ping->png_msec % 3600000) / 60000;
-			time_i[5] = (ping->png_msec % 60000) / 1000;
-			time_i[6] = (ping->png_msec % 1000) * 1000;
-			mb_get_time(verbose, time_i, &time_d);
-
-			if (mode == MBKONSBERGPREPROCESS_TIMESTAMPLIST)
-				fprintf(stderr,"Record time: %4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d\n",
-					time_i[0],time_i[1],time_i[2],
-					time_i[3],time_i[4],time_i[5],time_i[6]);
-
-			/* allocate memory for heading arrays if needed */
-			if (ndat_heading + 1 >= ndat_heading_alloc)
-				{
-				ndat_heading_alloc +=  MBKONSBERGPREPROCESS_ALLOC_CHUNK;
-				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_heading_alloc*sizeof(double),(void **)&dat_heading_time_d,&error);
-				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_heading_alloc*sizeof(double),(void **)&dat_heading_heading,&error);
-				if (error != MB_ERROR_NO_ERROR)
-					{
-					mb_error(verbose,error,&message);
-					fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",message);
-					fprintf(stderr,"\nProgram <%s> Terminated\n",
-					    program_name);
-					exit(error);
-					}
-				}
-
-			/* store the heading data */
-			if (ndat_heading == 0 || dat_heading_time_d[ndat_heading-1] < time_d)
-				{
-				dat_heading_time_d[ndat_heading] = (double)(time_d);
-				dat_heading_heading[ndat_heading] = (double)(0.01 * ping->png_heading);
-
-				/* apply time lag correction if specified */
-				if (timelagmode == MBKONSBERGPREPROCESS_TIMELAG_CONSTANT)
-					{
-					dat_heading_time_d[ndat_heading] -= timelagconstant;
-					}
-				else if (timelagmode == MBKONSBERGPREPROCESS_TIMELAG_MODEL && ntimelag > 0)
-					{
-					interp_status = mb_linear_interp(verbose,
-								timelag_time_d-1, timelag_model-1,
-								ntimelag, dat_heading_time_d[ndat_heading], &timelag, &jtimelag,
-								&error);
-					dat_heading_time_d[ndat_heading] -= timelag;
-					}
-
-				/* increment counter */
-				ndat_heading++;
-				}
-			}
-
-	   	/* save sonardepth data from survey records */
-		if (status == MB_SUCCESS
-			&& istore->kind == MB_DATA_DATA
-		    	&& istore->kind == sonardepth_source)
-			{			
-			/* get survey data structure */
-			ping = (struct mbsys_simrad3_ping_struct *) &(istore->pings[istore->ping_index]);
-
-			/* get ping time */
-			time_i[0] = ping->png_date / 10000;
-			time_i[1] = (ping->png_date % 10000) / 100;
-			time_i[2] = ping->png_date % 100;
-			time_i[3] = ping->png_msec / 3600000;
-			time_i[4] = (ping->png_msec % 3600000) / 60000;
-			time_i[5] = (ping->png_msec % 60000) / 1000;
-			time_i[6] = (ping->png_msec % 1000) * 1000;
-			mb_get_time(verbose, time_i, &time_d);
-
-			if (mode == MBKONSBERGPREPROCESS_TIMESTAMPLIST)
-				fprintf(stderr,"Record time: %4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d\n",
-					time_i[0],time_i[1],time_i[2],
-					time_i[3],time_i[4],time_i[5],time_i[6]);
-
-			/* allocate memory for sonar depth arrays if needed */
-			if (ndat_sonardepth + 1 >= ndat_sonardepth_alloc)
-				{
-				ndat_sonardepth_alloc +=  MBKONSBERGPREPROCESS_ALLOC_CHUNK;
-				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_sonardepth_alloc*sizeof(double),(void **)&dat_sonardepth_time_d,&error);
-				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_sonardepth_alloc*sizeof(double),(void **)&dat_sonardepth_sonardepth,&error);
-				status = mb_reallocd(verbose,__FILE__,__LINE__,ndat_sonardepth_alloc*sizeof(double),(void **)&dat_sonardepth_sonardepthfilter,&error);
-				if (error != MB_ERROR_NO_ERROR)
-					{
-					mb_error(verbose,error,&message);
-					fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",message);
-					fprintf(stderr,"\nProgram <%s> Terminated\n",
-					    program_name);
-					exit(error);
-					}
-				}
-
-			/* store the sonar depth data */
-			if (ndat_sonardepth == 0 || dat_sonardepth_time_d[ndat_sonardepth-1] < time_d)
-				{
-				dat_sonardepth_time_d[ndat_sonardepth] = time_d;
-				dat_sonardepth_sonardepth[ndat_sonardepth] = ping->png_xducer_depth;
-				dat_sonardepth_sonardepthfilter[ndat_sonardepth] = 0.0;
-				
-				/* apply time lag correction if specified */
-				if (timelagmode == MBKONSBERGPREPROCESS_TIMELAG_CONSTANT)
-					{
-					dat_sonardepth_time_d[ndat_sonardepth] -= timelagconstant;
-					}
-				else if (timelagmode == MBKONSBERGPREPROCESS_TIMELAG_MODEL && ntimelag > 0)
-					{
-					interp_status = mb_linear_interp(verbose,
-								timelag_time_d-1, timelag_model-1,
-								ntimelag, dat_sonardepth_time_d[ndat_sonardepth], &timelag, &jtimelag,
-								&error);
-					dat_sonardepth_time_d[ndat_sonardepth] -= timelag;
-					}
-
-				/* increment counter */
-				ndat_sonardepth++;
-				}
-			}
-
-		/* print debug statements */
-		if (verbose >= 2)
-			{
-			fprintf(stderr,"\ndbg2  Ping read in program <%s>\n",
-				program_name);
-			fprintf(stderr,"dbg2       kind:           %d\n",kind);
-			fprintf(stderr,"dbg2       error:          %d\n",error);
-			fprintf(stderr,"dbg2       status:         %d\n",status);
-			}
-		}
-
-	/* close the swath file */
-	status = mb_close(verbose,&imbio_ptr,&error);
-
-	/* output counts */
-	if (output_counts == MB_YES)
-		{
-		fprintf(stdout, "\nData records read from: %s\n", ifile);
-		fprintf(stdout, "     nrec_0x30_pu_id:         %d\n", nrec_0x30_pu_id);
-		fprintf(stdout, "     nrec_0x31_pu_status:          %d\n", nrec_0x31_pu_status);
-		fprintf(stdout, "     nrec_0x32_pu_bist:           %d\n", nrec_0x32_pu_bist);
-		fprintf(stdout, "     nrec_0x33_parameter_extra:        %d\n", nrec_0x33_parameter_extra);
-		fprintf(stdout, "     nrec_0x41_attitude:               %d\n", nrec_0x41_attitude);
-		fprintf(stdout, "     nrec_0x43_clock:                  %d\n", nrec_0x43_clock);
-		fprintf(stdout, "     nrec_0x44_bathymetry:             %d\n", nrec_0x44_bathymetry);
-		fprintf(stdout, "     nrec_0x45_singlebeam:             %d\n", nrec_0x45_singlebeam);
-		fprintf(stdout, "     nrec_0x46_rawbeamF:               %d\n", nrec_0x46_rawbeamF);
-		fprintf(stdout, "     nrec_0x47_surfacesoundspeed2:     %d\n", nrec_0x47_surfacesoundspeed2);
-		fprintf(stdout, "     nrec_0x48_heading:                %d\n", nrec_0x48_heading);
-		fprintf(stdout, "     nrec_0x49_parameter_start:        %d\n", nrec_0x49_parameter_start);
-		fprintf(stdout, "     nrec_0x4A_tilt:                   %d\n", nrec_0x4A_tilt);
-		fprintf(stdout, "     nrec_0x4B_echogram:               %d\n", nrec_0x4B_echogram);
-		fprintf(stdout, "     nrec_0x4E_rawbeamN:               %d\n", nrec_0x4E_rawbeamN);
-		fprintf(stdout, "     nrec_0x4F_quality:                %d\n", nrec_0x4F_quality);
-		fprintf(stdout, "     nrec_0x50_pos:                    %d\n", nrec_0x50_pos);
-		fprintf(stdout, "     nrec_0x52_runtime:                %d\n", nrec_0x52_runtime);
-		fprintf(stdout, "     nrec_0x53_sidescan:               %d\n", nrec_0x53_sidescan);
-		fprintf(stdout, "     nrec_0x54_tide:                   %d\n", nrec_0x54_tide);
-		fprintf(stdout, "     nrec_0x55_svp2:                   %d\n", nrec_0x55_svp2);
-		fprintf(stdout, "     nrec_0x56_svp:                    %d\n", nrec_0x56_svp);
-		fprintf(stdout, "     nrec_0x57_surfacesoundspeed:      %d\n", nrec_0x57_surfacesoundspeed);
-		fprintf(stdout, "     nrec_0x58_bathymetry2:            %d\n", nrec_0x58_bathymetry2);
-		fprintf(stdout, "     nrec_0x59_sidescan2:              %d\n", nrec_0x59_sidescan2);
-		fprintf(stdout, "     nrec_0x66_rawbeamf:               %d\n", nrec_0x66_rawbeamf);
-		fprintf(stdout, "     nrec_0x68_height:                 %d\n", nrec_0x68_height);
-		fprintf(stdout, "     nrec_0x69_parameter_stop:         %d\n", nrec_0x69_parameter_stop);
-		fprintf(stdout, "     nrec_0x6B_water_column:           %d\n", nrec_0x6B_water_column);
-		fprintf(stdout, "     nrec_0x6E_network_attitude:       %d\n", nrec_0x6E_network_attitude);
-		fprintf(stdout, "     nrec_0x70_parameter:              %d\n", nrec_0x70_parameter);
-		fprintf(stdout, "     nrec_0x73_surface_sound_speed:    %d\n", nrec_0x73_surface_sound_speed);
-		fprintf(stdout, "     nrec_0xE1_bathymetry_mbari57:     %d\n", nrec_0xE1_bathymetry_mbari57);
-		fprintf(stdout, "     nrec_0xE2_sidescan_mbari57:       %d\n", nrec_0xE2_sidescan_mbari57);
-		fprintf(stdout, "     nrec_0xE3_bathymetry_mbari59:     %d\n", nrec_0xE3_bathymetry_mbari59);
-		fprintf(stdout, "     nrec_0xE4_sidescan_mbari59:       %d\n", nrec_0xE4_sidescan_mbari59);
-		fprintf(stdout, "     nrec_0xE5_bathymetry_mbari59:     %d\n", nrec_0xE5_bathymetry_mbari59);
-
-		nrec_0x30_pu_id_tot += nrec_0x30_pu_id;
-		nrec_0x31_pu_status_tot += nrec_0x31_pu_status;
-		nrec_0x32_pu_bist_tot += nrec_0x32_pu_bist;
-		nrec_0x33_parameter_extra_tot += nrec_0x33_parameter_extra;
-		nrec_0x41_attitude_tot += nrec_0x41_attitude;
-		nrec_0x43_clock_tot += nrec_0x43_clock;
-		nrec_0x44_bathymetry_tot += nrec_0x44_bathymetry;
-		nrec_0x45_singlebeam_tot += nrec_0x45_singlebeam;
-		nrec_0x46_rawbeamF_tot += nrec_0x46_rawbeamF;
-		nrec_0x47_surfacesoundspeed2_tot += nrec_0x47_surfacesoundspeed2;
-		nrec_0x48_heading_tot += nrec_0x48_heading;
-		nrec_0x49_parameter_start_tot += nrec_0x49_parameter_start;
-		nrec_0x4A_tilt_tot += nrec_0x4A_tilt;
-		nrec_0x4B_echogram_tot += nrec_0x4B_echogram;
-		nrec_0x4E_rawbeamN_tot += nrec_0x4E_rawbeamN;
-		nrec_0x4F_quality_tot += nrec_0x4F_quality;
-		nrec_0x50_pos_tot += nrec_0x50_pos;
-		nrec_0x52_runtime_tot += nrec_0x52_runtime;
-		nrec_0x53_sidescan_tot += nrec_0x53_sidescan;
-		nrec_0x54_tide_tot += nrec_0x54_tide;
-		nrec_0x55_svp2_tot += nrec_0x55_svp2;
-		nrec_0x56_svp_tot += nrec_0x56_svp;
-		nrec_0x57_surfacesoundspeed_tot += nrec_0x57_surfacesoundspeed;
-		nrec_0x58_bathymetry2_tot += nrec_0x58_bathymetry2;
-		nrec_0x59_sidescan2_tot += nrec_0x59_sidescan2;
-		nrec_0x66_rawbeamf_tot += nrec_0x66_rawbeamf;
-		nrec_0x68_height_tot += nrec_0x68_height;
-		nrec_0x69_parameter_stop_tot += nrec_0x69_parameter_stop;
-		nrec_0x6B_water_column_tot += nrec_0x6B_water_column;
-		nrec_0x6E_network_attitude_tot += nrec_0x6E_network_attitude;
-		nrec_0x70_parameter_tot += nrec_0x70_parameter;
-		nrec_0x73_surface_sound_speed_tot += nrec_0x73_surface_sound_speed;
-		nrec_0xE1_bathymetry_mbari57_tot += nrec_0xE1_bathymetry_mbari57;
-		nrec_0xE2_sidescan_mbari57_tot += nrec_0xE2_sidescan_mbari57;
-		nrec_0xE3_bathymetry_mbari59_tot += nrec_0xE3_bathymetry_mbari59;
-		nrec_0xE4_sidescan_mbari59_tot += nrec_0xE4_sidescan_mbari59;
-		nrec_0xE5_bathymetry_mbari59_tot += nrec_0xE5_bathymetry_mbari59;
-		}
-
-	/* figure out whether and what to read next */
-        if (read_datalist == MB_YES)
-                {
-		if ((status = mb_datalist_read(verbose,datalist,
-			    ifile,&format,&file_weight,&error))
-			    == MB_SUCCESS)
-                        read_data = MB_YES;
-                else
-                        read_data = MB_NO;
-                }
-        else
-                {
-                read_data = MB_NO;
-                }
-
-	/* end loop over files in list */
-	}
-	if (read_datalist == MB_YES)
-		mb_datalist_close(verbose,&datalist,&error);
-
-	/* if desired apply filtering to sonardepth data */
-	if (sonardepthfilter == MB_YES)
-		{
-		/* apply filtering to sonardepth data
-			read from asynchronous records in 7k files */
-		if (ndat_sonardepth > 1)
-			{
-fprintf(stderr,"Applying filtering to %d sonardepth data\n", ndat_sonardepth);
-			dtime = (dat_sonardepth_time_d[ndat_sonardepth-1]  - dat_sonardepth_time_d[0]) / ndat_sonardepth;
-			nhalffilter = (int)(4.0 * sonardepthfilterlength / dtime);
-			for (i=0;i<ndat_sonardepth;i++)
-				{
-				dat_sonardepth_sonardepthfilter[i] = 0.0;
-				sonardepth_filterweight = 0.0;
-				j1 = MAX(i - nhalffilter, 0);
-				j2 = MIN(i + nhalffilter, ndat_sonardepth - 1);
-				for (j=j1;j<=j2;j++)
-					{
-					dtol = (dat_sonardepth_time_d[j] - dat_sonardepth_time_d[i]) / sonardepthfilterlength;
-					weight = exp(-dtol * dtol);
-					dat_sonardepth_sonardepthfilter[i] += weight * dat_sonardepth_sonardepth[j];
-					sonardepth_filterweight += weight;
-					}
-				if (sonardepth_filterweight > 0.0)
-					dat_sonardepth_sonardepthfilter[i] /= sonardepth_filterweight;
-				}
-			for (i=0;i<ndat_sonardepth;i++)
-				{
-				if (dat_sonardepth_sonardepth[i] < 2.0 * sonardepthfilterdepth)
-					factor = 1.0;
-				else
-					factor = exp(-(dat_sonardepth_sonardepth[i] - 2.0 * sonardepthfilterdepth)
-							/ (sonardepthfilterdepth));
-				dat_sonardepth_sonardepth[i] = (1.0 - factor) * dat_sonardepth_sonardepth[i]
-							+ factor * dat_sonardepth_sonardepthfilter[i];
-				}
-			}
-		}
-
-	/* output asynchronous navigation and attitude data */
-	if (verbose > 0 || mode == MBKONSBERGPREPROCESS_TIMESTAMPLIST)
-		fprintf(stdout, "\nTotal navigation data read: %d\n", ndat_nav);
-	if (mode == MBKONSBERGPREPROCESS_TIMESTAMPLIST)
-		for (i=0;i<ndat_nav;i++)
-			{
-			fprintf(stdout, "  NAV: %5d %17.6f %11.6f %10.6f\n",
-				i, dat_nav_time_d[i], dat_nav_lon[i], dat_nav_lat[i]);
-			}
-	if (verbose > 0 || mode == MBKONSBERGPREPROCESS_TIMESTAMPLIST)
-		fprintf(stdout, "\nTotal sonardepth data read: %d\n", ndat_sonardepth);
-	if (mode == MBKONSBERGPREPROCESS_TIMESTAMPLIST)
-		for (i=0;i<ndat_sonardepth;i++)
-			{
-			fprintf(stdout, "  DEP: %5d %17.6f %8.3f\n",
-				i, dat_sonardepth_time_d[i], dat_sonardepth_sonardepth[i]);
-			}
-	if (verbose > 0 || mode == MBKONSBERGPREPROCESS_TIMESTAMPLIST)
-		fprintf(stdout, "\nTotal heading data read: %d\n", ndat_heading);
-	if (mode == MBKONSBERGPREPROCESS_TIMESTAMPLIST)
-		for (i=0;i<ndat_heading;i++)
-			{
-			fprintf(stdout, "  HDG: %5d %17.6f %8.3f\n",
-				i, dat_heading_time_d[i], dat_heading_heading[i]);
-			}
-	if (verbose > 0 || mode == MBKONSBERGPREPROCESS_TIMESTAMPLIST)
-		fprintf(stdout, "\nTotal attitude data read: %d\n", ndat_rph);
-	if (mode == MBKONSBERGPREPROCESS_TIMESTAMPLIST)
-		for (i=0;i<ndat_rph;i++)
-			{
-			fprintf(stdout, "  HCP: %5d %17.6f %8.3f %8.3f %8.3f\n",
-				i, dat_rph_time_d[i], dat_rph_roll[i], dat_rph_pitch[i], dat_rph_heave[i]);
-			}
-
-	/* output counts */
-	if (output_counts == MB_YES)
-		{
-		fprintf(stdout, "\nTotal data records read from: %s\n", read_file);
-		fprintf(stdout, "     nrec_0x30_pu_id_tot:     %d\n", nrec_0x30_pu_id_tot);
-		fprintf(stdout, "     nrec_0x31_pu_status_tot:      %d\n", nrec_0x31_pu_status_tot);
-		fprintf(stdout, "     nrec_0x32_pu_bist_tot:       %d\n", nrec_0x32_pu_bist_tot);
-		fprintf(stdout, "     nrec_0x33_parameter_extra_tot:    %d\n", nrec_0x33_parameter_extra_tot);
-		fprintf(stdout, "     nrec_0x41_attitude_tot:           %d\n", nrec_0x41_attitude_tot);
-		fprintf(stdout, "     nrec_0x43_clock_tot:              %d\n", nrec_0x43_clock_tot);
-		fprintf(stdout, "     nrec_0x44_bathymetry_tot:         %d\n", nrec_0x44_bathymetry_tot);
-		fprintf(stdout, "     nrec_0x45_singlebeam_tot:         %d\n", nrec_0x45_singlebeam_tot);
-		fprintf(stdout, "     nrec_0x46_rawbeamF_tot:           %d\n", nrec_0x46_rawbeamF_tot);
-		fprintf(stdout, "     nrec_0x47_surfacesoundspeed2_tot: %d\n", nrec_0x47_surfacesoundspeed2_tot);
-		fprintf(stdout, "     nrec_0x48_heading_tot:            %d\n", nrec_0x48_heading_tot);
-		fprintf(stdout, "     nrec_0x49_parameter_start_tot:    %d\n", nrec_0x49_parameter_start_tot);
-		fprintf(stdout, "     nrec_0x4A_tilt_tot:               %d\n", nrec_0x4A_tilt_tot);
-		fprintf(stdout, "     nrec_0x4B_echogram_tot:           %d\n", nrec_0x4B_echogram_tot);
-		fprintf(stdout, "     nrec_0x4E_rawbeamN_tot:           %d\n", nrec_0x4E_rawbeamN_tot);
-		fprintf(stdout, "     nrec_0x4F_quality_tot:            %d\n", nrec_0x4F_quality_tot);
-		fprintf(stdout, "     nrec_0x50_pos_tot:                %d\n", nrec_0x50_pos_tot);
-		fprintf(stdout, "     nrec_0x52_runtime_tot:            %d\n", nrec_0x52_runtime_tot);
-		fprintf(stdout, "     nrec_0x53_sidescan_tot:           %d\n", nrec_0x53_sidescan_tot);
-		fprintf(stdout, "     nrec_0x54_tide_tot:               %d\n", nrec_0x54_tide_tot);
-		fprintf(stdout, "     nrec_0x55_svp2_tot:               %d\n", nrec_0x55_svp2_tot);
-		fprintf(stdout, "     nrec_0x56_svp_tot:                %d\n", nrec_0x56_svp_tot);
-		fprintf(stdout, "     nrec_0x57_surfacesoundspeed_tot:  %d\n", nrec_0x57_surfacesoundspeed_tot);
-		fprintf(stdout, "     nrec_0x58_bathymetry2_tot:        %d\n", nrec_0x58_bathymetry2_tot);
-		fprintf(stdout, "     nrec_0x59_sidescan2_tot:          %d\n", nrec_0x59_sidescan2_tot);
-		fprintf(stdout, "     nrec_0x66_rawbeamf_tot:           %d\n", nrec_0x66_rawbeamf_tot);
-		fprintf(stdout, "     nrec_0x68_height_tot:             %d\n", nrec_0x68_height_tot);
-		fprintf(stdout, "     nrec_0x69_parameter_stop_tot:     %d\n", nrec_0x69_parameter_stop_tot);
-		fprintf(stdout, "     nrec_0x6B_water_column_tot:       %d\n", nrec_0x6B_water_column_tot);
-		fprintf(stdout, "     nrec_0x6E_network_attitude_tot:   %d\n", nrec_0x6E_network_attitude_tot);
-		fprintf(stdout, "     nrec_0x70_parameter_tot:          %d\n", nrec_0x70_parameter_tot);
-		fprintf(stdout, "     nrec_0x73_surface_sound_speed_tot:%d\n", nrec_0x73_surface_sound_speed_tot);
-		fprintf(stdout, "     nrec_0xE1_bathymetry_mbari57_tot: %d\n", nrec_0xE1_bathymetry_mbari57_tot);
-		fprintf(stdout, "     nrec_0xE2_sidescan_mbari57_tot:   %d\n", nrec_0xE2_sidescan_mbari57_tot);
-		fprintf(stdout, "     nrec_0xE3_bathymetry_mbari59_tot: %d\n", nrec_0xE3_bathymetry_mbari59_tot);
-		fprintf(stdout, "     nrec_0xE4_sidescan_mbari59_tot:   %d\n", nrec_0xE4_sidescan_mbari59_tot);
-		fprintf(stdout, "     nrec_0xE5_bathymetry_mbari59_tot: %d\n", nrec_0xE5_bathymetry_mbari59_tot);
-		}
-	nrec_0x30_pu_id_tot = 0;
-	nrec_0x31_pu_status_tot = 0;
-	nrec_0x32_pu_bist_tot = 0;
-	nrec_0x33_parameter_extra_tot = 0;
-	nrec_0x41_attitude_tot = 0;
-	nrec_0x43_clock_tot = 0;
-	nrec_0x44_bathymetry_tot = 0;
-	nrec_0x45_singlebeam_tot = 0;
-	nrec_0x46_rawbeamF_tot = 0;
-	nrec_0x47_surfacesoundspeed2_tot = 0;
-	nrec_0x48_heading_tot = 0;
-	nrec_0x49_parameter_start_tot = 0;
-	nrec_0x4A_tilt_tot = 0;
-	nrec_0x4B_echogram_tot = 0;
-	nrec_0x4E_rawbeamN_tot = 0;
-	nrec_0x4F_quality_tot = 0;
-	nrec_0x50_pos_tot = 0;
-	nrec_0x52_runtime_tot = 0;
-	nrec_0x53_sidescan_tot = 0;
-	nrec_0x54_tide_tot = 0;
-	nrec_0x55_svp2_tot = 0;
-	nrec_0x56_svp_tot = 0;
-	nrec_0x57_surfacesoundspeed_tot = 0;
-	nrec_0x58_bathymetry2_tot = 0;
-	nrec_0x59_sidescan2_tot = 0;
-	nrec_0x66_rawbeamf_tot = 0;
-	nrec_0x68_height_tot = 0;
-	nrec_0x69_parameter_stop_tot = 0;
-	nrec_0x6B_water_column_tot = 0;
-	nrec_0x6E_network_attitude_tot = 0;
-	nrec_0x70_parameter_tot = 0;
-	nrec_0x73_surface_sound_speed_tot = 0;
-	nrec_0xE1_bathymetry_mbari57_tot = 0;
-	nrec_0xE2_sidescan_mbari57_tot = 0;
-	nrec_0xE3_bathymetry_mbari59_tot = 0;
-	nrec_0xE4_sidescan_mbari59_tot = 0;
-	nrec_0xE5_bathymetry_mbari59_tot = 0;
-
-	/* now read the data files again, this time interpolating nav and attitude
-		into the multibeam records and fixing other problems found in the
-		data */
-	if (mode >= MBKONSBERGPREPROCESS_PROCESS)
-	{
-
-	/* open file list */
-	if (read_datalist == MB_YES)
-	    {
-	    if ((status = mb_datalist_open(verbose,&datalist,
-					    read_file,look_processed,&error)) != MB_SUCCESS)
-		{
-		error = MB_ERROR_OPEN_FAIL;
-		fprintf(stderr,"\nUnable to open data list file: %s\n",
-			read_file);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-	    if ((status = mb_datalist_read(verbose,datalist,
-			    ifile,&format,&file_weight,&error))
-			    == MB_SUCCESS)
-		read_data = MB_YES;
-	    else
-		read_data = MB_NO;
-	    }
-	/* else copy single filename to be read */
-	else
-	    {
-	    strcpy(ifile, read_file);
-	    read_data = MB_YES;
-	    }
-
-	/* loop over all files to be read */
-	while (read_data == MB_YES && (format == MBF_EM710RAW || format == MBF_EM710MBA))
-	{
-	/* figure out the output file name if not specified */
-	if (ofile_set == MB_NO)
-		{
-		status = mb_get_format(verbose, ifile, fileroot, &testformat, &error);
-		if (format == MBF_EM710MBA
-			&& strncmp(".mb59",&ifile[strlen(ifile)-5],5) == 0)
-			sprintf(ofile, "%sf.mb%d", fileroot, MBF_EM710MBA);
-		else
-			sprintf(ofile, "%s.mb%d", fileroot, MBF_EM710MBA);
-		}
-
-	/* if output directory was set by user, reset file path */
-	if (odir_set == MB_YES && odir!=NULL)
-		{
-		strcpy(buffer, odir);
-		if (buffer[strlen(odir)-1] != '/')
-			strcat(buffer, "/");
-		if (strrchr(ofile, '/') != NULL)
-			filenameptr = strrchr(ofile, '/') + 1;
-		else
-			filenameptr = ofile;
-		strcat(buffer, filenameptr);
-		strcpy(ofile,buffer);
-
-		}
-
-	/* initialize reading the input swath file */
-	if ((status = mb_read_init(
-		verbose,ifile,format,pings,lonflip,bounds,
-		btime_i,etime_i,speedmin,timegap,
-		&imbio_ptr,&btime_d,&etime_d,
-		&beams_bath,&beams_amp,&pixels_ss,&error)) != MB_SUCCESS)
-		{
-		mb_error(verbose,error,&message);
-		fprintf(stderr,"\nMBIO Error returned from function <mb_read_init>:\n%s\n",message);
-		fprintf(stderr,"\nMultibeam File <%s> not initialized for reading\n",ifile);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-	nfile_read++;
-
-	/* if ofile has been set then there is only one output file, otherwise there
-		is an output file for each input file */
-	if (ofile_set == MB_NO || nfile_write == 0)
-		{
-		/* initialize writing the output swath sonar file */
-		if ((status = mb_write_init(
-			verbose,ofile,MBF_EM710MBA,&ombio_ptr,
-			&obeams_bath,&obeams_amp,&opixels_ss,&error)) != MB_SUCCESS)
-			{
-			mb_error(verbose,error,&message);
-			fprintf(stderr,"\nMBIO Error returned from function <mb_write_init>:\n%s\n",message);
-			fprintf(stderr,"\nMultibeam File <%s> not initialized for writing\n",ofile);
-			fprintf(stderr,"\nProgram <%s> Terminated\n",
-				program_name);
-			exit(error);
-			}
-		nfile_write++;
-
-		/* initialize synchronous attitude output file */
-		sprintf(stafile,"%s.sta",ofile);
-		if ((stafp = fopen(stafile, "w")) == NULL)
-			{
-			error = MB_ERROR_OPEN_FAIL;
-			fprintf(stderr,"\nUnable to open synchronous attitude data file <%s> for writing\n",stafile);
-			fprintf(stderr,"\nProgram <%s> Terminated\n",
-				program_name);
-			exit(error);
-			}
-		}
-
-	/* get pointers to data storage */
-	imb_io_ptr = (struct mb_io_struct *) imbio_ptr;
-	istore_ptr = imb_io_ptr->store_data;
-	istore = (struct mbsys_simrad3_struct *) istore_ptr;
-
-	if (error == MB_ERROR_NO_ERROR)
-		{
-		beamflag = NULL;
-		bath = NULL;
-		amp = NULL;
-		bathacrosstrack = NULL;
-		bathalongtrack = NULL;
-		ss = NULL;
-		ssacrosstrack = NULL;
-		ssalongtrack = NULL;
-		}
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(char), (void **)&beamflag, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(double), (void **)&bath, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_AMPLITUDE,
-						sizeof(double), (void **)&amp, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(double), (void **)&bathacrosstrack, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(double), (void **)&bathalongtrack, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_SIDESCAN,
-						sizeof(double), (void **)&ss, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_SIDESCAN,
-						sizeof(double), (void **)&ssacrosstrack, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_SIDESCAN,
-						sizeof(double), (void **)&ssalongtrack, &error);
-
-	/* if error initializing memory then quit */
-	if (error != MB_ERROR_NO_ERROR)
-		{
-		mb_error(verbose,error,&message);
-		fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",
-			message);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-
-	/* reset file record counters */
-	nrec_0x30_pu_id = 0;
-	nrec_0x31_pu_status = 0;
-	nrec_0x32_pu_bist = 0;
-	nrec_0x33_parameter_extra = 0;
-	nrec_0x41_attitude = 0;
-	nrec_0x43_clock = 0;
-	nrec_0x44_bathymetry = 0;
-	nrec_0x45_singlebeam = 0;
-	nrec_0x46_rawbeamF = 0;
-	nrec_0x47_surfacesoundspeed2 = 0;
-	nrec_0x48_heading = 0;
-	nrec_0x49_parameter_start = 0;
-	nrec_0x4A_tilt = 0;
-	nrec_0x4B_echogram = 0;
-	nrec_0x4E_rawbeamN = 0;
-	nrec_0x4F_quality = 0;
-	nrec_0x50_pos = 0;
-	nrec_0x52_runtime = 0;
-	nrec_0x53_sidescan = 0;
-	nrec_0x54_tide = 0;
-	nrec_0x55_svp2 = 0;
-	nrec_0x56_svp = 0;
-	nrec_0x57_surfacesoundspeed = 0;
-	nrec_0x58_bathymetry2 = 0;
-	nrec_0x59_sidescan2 = 0;
-	nrec_0x66_rawbeamf = 0;
-	nrec_0x68_height = 0;
-	nrec_0x69_parameter_stop = 0;
-	nrec_0x6B_water_column = 0;
-	nrec_0x6E_network_attitude = 0;
-	nrec_0x70_parameter = 0;
-	nrec_0x73_surface_sound_speed = 0;
-	nrec_0xE1_bathymetry_mbari57 = 0;
-	nrec_0xE2_sidescan_mbari57 = 0;
-	nrec_0xE3_bathymetry_mbari59 = 0;
-	nrec_0xE4_sidescan_mbari59 = 0;
-	nrec_0xE5_bathymetry_mbari59 = 0;
-
-	/* read and write data */
-	while (error <= MB_ERROR_NO_ERROR)
-		{
-		/* reset error */
-		status = MB_SUCCESS;
-		error = MB_ERROR_NO_ERROR;
-
-		/* read next data record */
-		status = mb_get_all(verbose,imbio_ptr,&istore_ptr,&kind,
-				    time_i,&time_d,&navlon,&navlat,
-				    &speed,&heading,
-				    &distance,&altitude,&sonardepth,
-				    &beams_bath,&beams_amp,&pixels_ss,
-				    beamflag,bath,amp,bathacrosstrack,bathalongtrack,
-				    ss,ssacrosstrack,ssalongtrack,
-				    comment,&error);
-
-		/* some nonfatal errors do not matter */
-		if (error < MB_ERROR_NO_ERROR && error > MB_ERROR_UNINTELLIGIBLE)
-			{
-			error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-			
-		/* if specified set water column record to error so it will not be output */
-		if (watercolumnmode == MBKONSBERGPREPROCESS_WATERCOLUMN_IGNORE
-			&& status == MB_SUCCESS && istore->type == EM3_WATERCOLUMN)
-			{
-			error = MB_ERROR_IGNORE;
-			status = MB_FAILURE;
-			}
-
-		/* keep track of starting and ending time of sonar data for this file */
-		if (status == MB_SUCCESS && kind == MB_DATA_DATA)
-			{
-			if (nrec_0xE5_bathymetry_mbari59 == 0)
-				start_time_d = time_d;
-			end_time_d = time_d;
-			}
-
-		/* count the record that was just read */
-		if (status == MB_SUCCESS && kind == MB_DATA_DATA)
-			{
-			/* get survey data structure */
-			ping = (struct mbsys_simrad3_ping_struct *) &(istore->pings[istore->ping_index]);
-
-			nrec_0xE5_bathymetry_mbari59++;
-			if (ping->png_raw_read == MB_YES)
-				nrec_0x4E_rawbeamN++;
-			if (ping->png_ss_read == MB_YES)
-				nrec_0x59_sidescan2++;
-			if (ping->png_quality_read == MB_YES)
-				nrec_0x4F_quality++;
-			}
-		else if (status == MB_SUCCESS)
-			{
-			if (istore->type == EM3_PU_ID)
-				nrec_0x30_pu_id++;
-			if (istore->type == EM3_PU_STATUS)
-				nrec_0x31_pu_status++;
-			if (istore->type == EM3_PU_BIST)
-				nrec_0x32_pu_bist++;
-			if (istore->type == EM3_ATTITUDE)
-				nrec_0x41_attitude++;
-			if (istore->type == EM3_CLOCK)
-				nrec_0x43_clock++;
-			if (istore->type == EM3_BATH)
-				nrec_0x44_bathymetry++;
-			if (istore->type == EM3_SBDEPTH)
-				nrec_0x45_singlebeam++;
-			if (istore->type == EM3_RAWBEAM)
-				nrec_0x46_rawbeamF++;
-			if (istore->type == EM3_SSV)
-				nrec_0x47_surfacesoundspeed2++;
-			if (istore->type == EM3_HEADING)
-				nrec_0x48_heading++;
-			if (istore->type == EM3_START)
-				nrec_0x49_parameter_start++;
-			if (istore->type == EM3_TILT)
-				nrec_0x4A_tilt++;
-			if (istore->type == EM3_CBECHO)
-				nrec_0x4B_echogram++;
-			if (istore->type == EM3_RAWBEAM4)
-				nrec_0x4E_rawbeamN++;
-			if (istore->type == EM3_QUALITY)
-				nrec_0x4F_quality++;
-			if (istore->type == EM3_POS)
-				nrec_0x50_pos++;
-			if (istore->type == EM3_RUN_PARAMETER)
-				nrec_0x52_runtime++;
-			if (istore->type == EM3_SS)
-				nrec_0x53_sidescan++;
-			if (istore->type == EM3_TIDE)
-				nrec_0x54_tide++;
-			if (istore->type == EM3_SVP2)
-				nrec_0x55_svp2++;
-			if (istore->type == EM3_SVP)
-				nrec_0x56_svp++;
-			if (istore->type == EM3_SSPINPUT)
-				nrec_0x57_surfacesoundspeed++;
-			if (istore->type == EM3_BATH2)
-				nrec_0x58_bathymetry2++;
-			if (istore->type == EM3_SS2)
-				nrec_0x59_sidescan2++;
-			if (istore->type == EM3_RAWBEAM3)
-				nrec_0x66_rawbeamf++;
-			if (istore->type == EM3_HEIGHT)
-				nrec_0x68_height++;
-			if (istore->type == EM3_STOP)
-				nrec_0x69_parameter_stop++;
-			if (istore->type == EM3_WATERCOLUMN)
-				nrec_0x6B_water_column++;
-			if (istore->type == EM3_NETATTITUDE)
-				nrec_0x6E_network_attitude++;
-			if (istore->type == EM3_REMOTE)
-				nrec_0x70_parameter++;
-			if (istore->type == EM3_SSP)
-				nrec_0x73_surface_sound_speed++;
-			}
-
-	   	/* handle multibeam data */
-		if (status == MB_SUCCESS && kind == MB_DATA_DATA)
-			{
-			/* get survey data structure */
-			ping = (struct mbsys_simrad3_ping_struct *) &(istore->pings[istore->ping_index]);
-				
-			/* get transducer offsets */
-			if (istore->par_stc == 0)
-				{
-				tx_x = istore->par_s1x;
-				tx_y = istore->par_s1y;
-				tx_z = istore->par_s1z;
-				tx_h = istore->par_s1h;
-				tx_r = istore->par_s1r;
-				tx_p = istore->par_s1p;
-				rx_x = istore->par_s2x;
-				rx_y = istore->par_s2y;
-				rx_z = istore->par_s2z;
-				rx_h = istore->par_s2h;
-				rx_r = istore->par_s2r;
-				rx_p = istore->par_s2p;
-				}
-			else if (istore->par_stc == 1)
-				{
-				tx_x = istore->par_s1x;
-				tx_y = istore->par_s1y;
-				tx_z = istore->par_s1z;
-				tx_h = istore->par_s1h;
-				tx_r = istore->par_s1r;
-				tx_p = istore->par_s1p;
-				rx_x = istore->par_s1x;
-				rx_y = istore->par_s1y;
-				rx_z = istore->par_s1z;
-				rx_h = istore->par_s1h;
-				rx_r = istore->par_s1r;
-				rx_p = istore->par_s1p;
-				}
-			else if (istore->par_stc == 2 && ping->png_serial == istore->par_serial_1)
-				{
-				tx_x = istore->par_s1x;
-				tx_y = istore->par_s1y;
-				tx_z = istore->par_s1z;
-				tx_h = istore->par_s1h;
-				tx_r = istore->par_s1r;
-				tx_p = istore->par_s1p;
-				rx_x = istore->par_s1x;
-				rx_y = istore->par_s1y;
-				rx_z = istore->par_s1z;
-				rx_h = istore->par_s1h;
-				rx_r = istore->par_s1r;
-				rx_p = istore->par_s1p;
-				}
-			else if (istore->par_stc == 2 && ping->png_serial == istore->par_serial_2)
-				{
-				tx_x = istore->par_s2x;
-				tx_y = istore->par_s2y;
-				tx_z = istore->par_s2z;
-				tx_h = istore->par_s2h;
-				tx_r = istore->par_s2r;
-				tx_p = istore->par_s2p;
-				rx_x = istore->par_s2x;
-				rx_y = istore->par_s2y;
-				rx_z = istore->par_s2z;
-				rx_h = istore->par_s2h;
-				rx_r = istore->par_s2r;
-				rx_p = istore->par_s2p;
-				}
-			else if (istore->par_stc == 3 && ping->png_serial == istore->par_serial_1)
-				{
-				tx_x = istore->par_s1x;
-				tx_y = istore->par_s1y;
-				tx_z = istore->par_s1z;
-				tx_h = istore->par_s1h;
-				tx_r = istore->par_s1r;
-				tx_p = istore->par_s1p;
-				rx_x = istore->par_s2x;
-				rx_y = istore->par_s2y;
-				rx_z = istore->par_s2z;
-				rx_h = istore->par_s2h;
-				rx_r = istore->par_s2r;
-				rx_p = istore->par_s2p;
-				}
-			else if (istore->par_stc == 3 && ping->png_serial == istore->par_serial_2)
-				{
-				tx_x = istore->par_s1x;
-				tx_y = istore->par_s1y;
-				tx_z = istore->par_s1z;
-				tx_h = istore->par_s1h;
-				tx_r = istore->par_s1r;
-				tx_p = istore->par_s1p;
-				rx_x = istore->par_s3x;
-				rx_y = istore->par_s3y;
-				rx_z = istore->par_s3z;
-				rx_h = istore->par_s3h;
-				rx_r = istore->par_s3r;
-				rx_p = istore->par_s3p;
-				}
-			else if (istore->par_stc == 4 && ping->png_serial == istore->par_serial_1)
-				{
-				tx_x = istore->par_s0x;
-				tx_y = istore->par_s0y;
-				tx_z = istore->par_s0z;
-				tx_h = istore->par_s0h;
-				tx_r = istore->par_s0r;
-				tx_p = istore->par_s0p;
-				rx_x = istore->par_s2x;
-				rx_y = istore->par_s2y;
-				rx_z = istore->par_s2z;
-				rx_h = istore->par_s2h;
-				rx_r = istore->par_s2r;
-				rx_p = istore->par_s2p;
-				}
-			else if (istore->par_stc == 4 && ping->png_serial == istore->par_serial_2)
-				{
-				tx_x = istore->par_s1x;
-				tx_y = istore->par_s1y;
-				tx_z = istore->par_s1z;
-				tx_h = istore->par_s1h;
-				tx_r = istore->par_s1r;
-				tx_p = istore->par_s1p;
-				rx_x = istore->par_s3x;
-				rx_y = istore->par_s3y;
-				rx_z = istore->par_s3z;
-				rx_h = istore->par_s3h;
-				rx_r = istore->par_s3r;
-				rx_p = istore->par_s3p;
-				}
-				
-			/* get active sensor offsets */
-			if (istore->par_dsh[0] == 'I')
-				depthsensor_mode = MBKONSBERGPREPROCESS_USE_SENSORDEPTH_ONLY;
-			else
-				depthsensor_mode = MBKONSBERGPREPROCESS_USE_HEAVE_ONLY;
-			depth_off_x = istore->par_dsx;
-			depth_off_y = istore->par_dsy;
-			depth_off_z = istore->par_dsz;
-			if (istore->par_aps == 0)
-				{
-				position_off_x = istore->par_p1x;
-				position_off_y = istore->par_p1y;
-				position_off_z = istore->par_p1z;
-				}
-			else if (istore->par_aps == 1)
-				{
-				position_off_x = istore->par_p2x;
-				position_off_y = istore->par_p2y;
-				position_off_z = istore->par_p2z;
-				}
-			else if (istore->par_aps == 2)
-				{
-				position_off_x = istore->par_p3x;
-				position_off_y = istore->par_p3y;
-				position_off_z = istore->par_p3z;
-				}
-			if (istore->par_aro == 2)
-				{
-				rollpitch_off_x = istore->par_msx;
-				rollpitch_off_y = istore->par_msy;
-				rollpitch_off_z = istore->par_msz;
-				rollpitch_off_h = istore->par_msg;
-				rollpitch_off_r = istore->par_msr;
-				rollpitch_off_p = istore->par_msp;
-				}
-			else if (istore->par_aro == 3)
-				{
-				rollpitch_off_x = istore->par_nsx;
-				rollpitch_off_y = istore->par_nsy;
-				rollpitch_off_z = istore->par_nsz;
-				rollpitch_off_h = istore->par_nsg;
-				rollpitch_off_r = istore->par_nsr;
-				rollpitch_off_p = istore->par_nsp;
-				}
-			if (istore->par_ahe == 2)
-				{
-				heave_off_x = istore->par_msx;
-				heave_off_y = istore->par_msy;
-				heave_off_z = istore->par_msz;
-				heave_off_h = istore->par_msg;
-				heave_off_r = istore->par_msr;
-				heave_off_p = istore->par_msp;
-				}
-			else if (istore->par_ahe == 3)
-				{
-				heave_off_x = istore->par_nsx;
-				heave_off_y = istore->par_nsy;
-				heave_off_z = istore->par_nsz;
-				heave_off_h = istore->par_nsg;
-				heave_off_r = istore->par_nsr;
-				heave_off_p = istore->par_nsp;
-				}
-			if (istore->par_ahs == 0 || istore->par_ahs == 4)
-				{
-				heading_off_x = istore->par_p3x;
-				heading_off_y = istore->par_p3y;
-				heading_off_z = istore->par_p3z;
-				heading_off_h = istore->par_gcg;
-				heading_off_r = 0.0;
-				heading_off_p = 0.0;
-				}
-			else if (istore->par_ahs == 1)
-				{
-				heading_off_x = istore->par_p1x;
-				heading_off_y = istore->par_p1y;
-				heading_off_z = istore->par_p1z;
-				heading_off_h = istore->par_gcg;
-				heading_off_r = 0.0;
-				heading_off_p = 0.0;
-				}
-			else if (istore->par_ahs == 2)
-				{
-				heading_off_x = istore->par_msx;
-				heading_off_y = istore->par_msy;
-				heading_off_z = istore->par_msz;
-				heading_off_h = istore->par_msg + istore->par_gcg;
-				heading_off_r = istore->par_msr;
-				heading_off_p = istore->par_msp;
-				}
-			else if (istore->par_ahs == 3 && istore->par_nsz != 0.0)
-				{
-				heading_off_x = istore->par_nsx;
-				heading_off_y = istore->par_nsy;
-				heading_off_z = istore->par_nsz;
-				heading_off_h = istore->par_nsg + istore->par_gcg;
-				heading_off_r = istore->par_nsr;
-				heading_off_p = istore->par_nsp;
-				}
-			else if (istore->par_ahs == 3)
-				{
-				heading_off_x = istore->par_p2x;
-				heading_off_y = istore->par_p2y;
-				heading_off_z = istore->par_p2z;
-				heading_off_h = istore->par_gcg;
-				heading_off_r = 0.0;
-				heading_off_p = 0.0;
-				}
-
-			/* merge heading from best available source */
-			if (ndat_heading > 0)
-				{
-				interp_status = mb_linear_interp_heading(verbose,
-							dat_heading_time_d-1, dat_heading_heading-1,
-							ndat_heading, time_d, &heading, &jheading,
-							&error);
-				}
-			else
-				{
-				/* if from embedded ancilliary data apply installation parameters */
-				mb_hedint_interp(verbose, imbio_ptr, time_d,
-							&heading, &error);
-				}
-			if (heading < 0.0)
-				heading += 360.0;
-			else if (heading >= 360.0)
-				heading -= 360.0;
-
-			/* merge navigation from best available source */
-			if (ndat_nav > 0)
-				{
-				interp_status = mb_linear_interp_longitude(verbose,
-							dat_nav_time_d-1, dat_nav_lon-1,
-							ndat_nav, time_d, &navlon, &jnav,
-							&error);
-				if (interp_status == MB_SUCCESS)
-				interp_status = mb_linear_interp_latitude(verbose,
-							dat_nav_time_d-1, dat_nav_lat-1,
-							ndat_nav, time_d, &navlat, &jnav,
-							&error);
-				}
-			else
-				{
-				/* if from embedded ancilliary data apply installation parameters */
-				mb_navint_interp(verbose, imbio_ptr, time_d, heading, 0.0,
-							&navlon, &navlat, &speed, &error);
-				}
-			
-			/* merge sonardepth from best available source */
-			if (ndat_sonardepth > 0)
-				{
-				interp_status = mb_linear_interp(verbose,
-							dat_sonardepth_time_d-1, dat_sonardepth_sonardepth-1,
-							ndat_sonardepth, time_d, &sonardepth, &jsonardepth,
-							&error);
-				}
-			else
-				{
-				mb_depint_interp(verbose, imbio_ptr, time_d,
-							&sonardepth, &error);
-				}
-
-			/* get attitude from best available source */
-			if (ndat_rph > 0)
-				{
-				interp_status = mb_linear_interp(verbose,
-							dat_rph_time_d-1, dat_rph_roll-1,
-							ndat_rph, time_d, &roll, &jattitude,
-							&error);
-				if (interp_status == MB_SUCCESS)
-				interp_status = mb_linear_interp(verbose,
-							dat_rph_time_d-1, dat_rph_pitch-1,
-							ndat_rph, time_d, &pitch, &jattitude,
-							&error);
-				if (interp_status == MB_SUCCESS)
-				interp_status = mb_linear_interp(verbose,
-							dat_rph_time_d-1, dat_rph_heave-1,
-							ndat_rph, time_d, &heave, &jattitude,
-							&error);
-				}
-			else
-				{
-				mb_attint_interp(verbose, imbio_ptr, time_d,
-							&heave, &roll, &pitch, &error);
-				}
-
-			/* apply offset between depth sensor and sonar */
-			if (sonardepthlever == MB_YES)
-				{
-				sonardepth += sonardepthoffset
-						+ depthsensoroffx * sin(DTR * roll)
-						+ depthsensoroffy * sin(DTR * pitch)
-						+ depthsensoroffz * cos(DTR * pitch);
-				}
-
-			/* insert navigation */
-			if (navlon < -180.0)
-				navlon += 360.0;
-			else if (navlon > 180.0)
-				navlon -= 360.0;
-			ping->png_longitude = 10000000 * navlon;
-			ping->png_latitude = 20000000 * navlat;
-			
-			/* insert sonardepth */
-			ping->png_xducer_depth = sonardepth;
-
-			/* insert heading */
-			if (heading < 0.0)
-				heading += 360.0;
-			else if (heading > 360.0)
-				heading -= 360.0;
-			ping->png_heading = (int) rint(heading * 100);
-
-			/* insert roll pitch and heave */
-			ping->png_roll = (int) rint(roll / 0.01);
-			ping->png_pitch = (int) rint(pitch / 0.01);
-			ping->png_heave = (int) rint(heave / 0.01);
-
-			/* output synchronous attitude */
-			fprintf(stafp, "%0.6f\t%0.3f\t%0.3f\n",time_d, roll, pitch);
-	
-			/* calculate corrected ranges, angles, and bathymetry for each beam */
-			for (i=0;i<ping->png_nbeams;i++)
-				{
-				/* calculate time of transmit and receive */
-				transmit_time_d = time_d + (double) ping->png_raw_txoffset[ping->png_raw_rxsector[i]];
-				receive_time_d = transmit_time_d + ping->png_raw_rxrange[i];
-
-				/* merge heading from best available source */
-				if (ndat_heading > 0)
-					{
-					interp_status = mb_linear_interp_heading(verbose,
-								dat_heading_time_d-1, dat_heading_heading-1,
-								ndat_heading, transmit_time_d, &transmit_heading, &jheading,
-								&error);
-					interp_status = mb_linear_interp_heading(verbose,
-								dat_heading_time_d-1, dat_heading_heading-1,
-								ndat_heading, receive_time_d, &receive_heading, &jheading,
-								&error);
-					}
-				else
-					{
-					mb_hedint_interp(verbose, imbio_ptr, transmit_time_d,
-								&transmit_heading, &error);
-					mb_hedint_interp(verbose, imbio_ptr, receive_time_d,
-								&receive_heading, &error);
-					}
-				if (transmit_heading < 0.0)
-					transmit_heading += 360.0;
-				else if (transmit_heading >= 360.0)
-					transmit_heading -= 360.0;
-				if (receive_heading < 0.0)
-					receive_heading += 360.0;
-				else if (receive_heading >= 360.0)
-					receive_heading -= 360.0;
-	
-				/* get attitude from best available source */
-				if (ndat_rph > 0)
-					{
-					interp_status = mb_linear_interp(verbose,
-								dat_rph_time_d-1, dat_rph_roll-1,
-								ndat_rph, transmit_time_d, &transmit_roll, &jattitude,
-								&error);
-					if (interp_status == MB_SUCCESS)
-					interp_status = mb_linear_interp(verbose,
-								dat_rph_time_d-1, dat_rph_pitch-1,
-								ndat_rph, transmit_time_d, &transmit_pitch, &jattitude,
-								&error);
-					if (interp_status == MB_SUCCESS)
-					interp_status = mb_linear_interp(verbose,
-								dat_rph_time_d-1, dat_rph_heave-1,
-								ndat_rph, transmit_time_d, &transmit_heave, &jattitude,
-								&error);
-					interp_status = mb_linear_interp(verbose,
-								dat_rph_time_d-1, dat_rph_roll-1,
-								ndat_rph, receive_time_d, &receive_roll, &jattitude,
-								&error);
-					if (interp_status == MB_SUCCESS)
-					interp_status = mb_linear_interp(verbose,
-								dat_rph_time_d-1, dat_rph_pitch-1,
-								ndat_rph, receive_time_d, &receive_pitch, &jattitude,
-								&error);
-					if (interp_status == MB_SUCCESS)
-					interp_status = mb_linear_interp(verbose,
-								dat_rph_time_d-1, dat_rph_heave-1,
-								ndat_rph, receive_time_d, &receive_heave, &jattitude,
-								&error);
-					}
-				else
-					{
-					mb_attint_interp(verbose, imbio_ptr, transmit_time_d,
-								&transmit_heave, &transmit_roll, &transmit_pitch, &error);
-					mb_attint_interp(verbose, imbio_ptr, receive_time_d,
-								&receive_heave, &receive_roll, &receive_pitch, &error);
-					}
-	
-				/* get ssv and range */
-				if (ping->png_ssv <= 0)
-					ping->png_ssv = 150;
-				ping->png_range[i] = ping->png_raw_rxrange[i];
-				
-				/* ping->png_bheave[i] is the difference between the heave at the ping timestamp time that is factored
-				 * into the ping->png_xducer_depth value and the average heave at the sector transmit time and the beam receive time */
-				ping->png_bheave[i] = 0.5 *(receive_heave + transmit_heave) - heave;
-/* fprintf(stderr,"AAA png_count:%d beam:%d heave_ping:%f i:%d transmit_heave:%f receive_heave:%f bheave:%f\n",
-ping->png_count,i,heave_ping,i,transmit_heave,receive_heave,ping->png_bheave[i]); */
-
-				/* also add in lever arm due to the offset between the motion sensor and
-				 * the sonar */
-				/* status = mb_lever(verbose,
-							rx_y,
-							rx_x,
-							rx_z,
-							position_off_y,
-							position_off_x,
-							position_off_z,
-							rollpitch_off_y,
-							rollpitch_off_x,
-							rollpitch_off_z,
-							receive_pitch,
-							receive_roll,
-							&lever_x,
-							&lever_y,
-							&lever_z,
-							&error); */
-/* fprintf(stderr,"Lever: roll:%f pitch:%f  lever: %f %f %f\n",roll,pitch,lever_x,lever_y,lever_z); */
-
-				/* calculate beam angles for raytracing using Jon Beaudoin's code based on:
-					Beaudoin, J., Hughes Clarke, J., and Bartlett, J. Application of
-					Surface Sound Speed Measurements in Post-Processing for Multi-Sector
-					Multibeam Echosounders : International Hydrographic Review, v.5, no.3,
-					p.26-31.
-					(http://www.omg.unb.ca/omg/papers/beaudoin_IHR_nov2004.pdf).
-				   note complexity if transducer arrays are reverse mounted, as determined
-				   by a mount heading angle of about 180 degrees rather than about 0 degrees.
-				   If a receive array or a transmit array are reverse mounted then:
-					1) subtract 180 from the heading mount angle of the array
-					2) flip the sign of the pitch and roll mount offsets of the array
-					3) flip the sign of the beam steering angle from that array
-						(reverse TX means flip sign of TX steer, reverse RX
-						means flip sign of RX steer) */
-				if (tx_h <= 90.0 || tx_h >= 270.0)
-					{
-					tx_align.roll = tx_r;
-					tx_align.pitch = tx_p;
-					tx_align.heading = tx_h;
-					tx_steer = (0.01 * (double)ping->png_raw_txtiltangle[ping->png_raw_rxsector[i]]);
-					}
-				else
-					{
-					tx_align.roll = -tx_r;
-					tx_align.pitch = -tx_p;
-					tx_align.heading = tx_h - 180.0;
-					tx_steer = -(0.01 * (double)ping->png_raw_txtiltangle[ping->png_raw_rxsector[i]]);
-					}
-				tx_orientation.roll = transmit_roll;
-				tx_orientation.pitch = transmit_pitch;
-				tx_orientation.heading = transmit_heading;
-				if (rx_h <= 90.0 || rx_h >= 270.0)
-					{
-					rx_align.roll = rx_r;
-					rx_align.pitch = rx_p;
-					rx_align.heading = rx_h;
-					rx_steer = (0.01 * (double)ping->png_raw_rxpointangle[i]);
-					}
-				else
-					{
-					rx_align.roll = -rx_r;
-					rx_align.pitch = -rx_p;
-					rx_align.heading = rx_h - 180.0;
-					rx_steer = -(0.01 * (double)ping->png_raw_rxpointangle[i]);
-					}
-				rx_orientation.roll = receive_roll;
-				rx_orientation.pitch = receive_pitch;
-				rx_orientation.heading = receive_heading;
-				reference_heading = heading;
-
-				status = mb_beaudoin(verbose,
-							tx_align,
-							tx_orientation,
-							tx_steer,
-							rx_align,
-							rx_orientation,
-							rx_steer,
-							reference_heading,
-							&beamAzimuth,
-							&beamDepression,
-							&error);
-				ping->png_depression[i] = 90.0 - beamDepression;
-				ping->png_azimuth[i] = 90.0 + beamAzimuth;
-				if (ping->png_azimuth[i] < 0.0)
-					ping->png_azimuth[i] += 360.0;
-/* fprintf(stderr,"i:%d %f %f     %f %f\n",
-i,beamDepression,beamAzimuth,ping->png_depression[i],ping->png_azimuth[i]);*/
-	
-				/* calculate beamflag */
-				detection_mask = (mb_u_char) ping->png_raw_rxdetection[i];
-				if (istore->sonar == MBSYS_SIMRAD3_M3 && (ping->png_detection[i] & 128) == 128)
-					{
-					ping->png_beamflag[i] = MB_FLAG_NULL;
-					ping->png_raw_rxdetection[i] = ping->png_raw_rxdetection[i] | 128;
-					}
-				else if ((detection_mask & 128) == 128 && (detection_mask & 112) != 0)
-					{
-					ping->png_beamflag[i] = MB_FLAG_NULL;
-/* fprintf(stderr,"beam i:%d detection_mask:%d %d quality:%u beamflag:%u\n",
-i,ping->png_raw_rxdetection[i],detection_mask,(mb_u_char)ping->png_raw_rxquality[i],(mb_u_char)ping->png_beamflag[i]);*/
-					}
-				else if ((detection_mask & 128) == 128)
-					{
-					ping->png_beamflag[i] = MB_FLAG_FLAG + MB_FLAG_SONAR;
-/*fprintf(stderr,"beam i:%d detection_mask:%d %d quality:%u beamflag:%u\n",
-i,ping->png_raw_rxdetection[i],detection_mask,(mb_u_char)ping->png_raw_rxquality[i],(mb_u_char)ping->png_beamflag[i]);*/
-					}
-				else if (ping->png_clean[i] != 0)
-					{
-					ping->png_beamflag[i] = MB_FLAG_FLAG + MB_FLAG_SONAR;
-					}
-				else
-					{
-					ping->png_beamflag[i] = MB_FLAG_NONE;
-					}
-					
-				/* check for NaN value */
-				if (isnan(ping->png_depth[i]))
-					{
-					ping->png_beamflag[i] = MB_FLAG_NULL;
-					ping->png_depth[i] = 0.0;
-					}
-				}
-	
-			/* generate processed sidescan */
-			pixel_size = (double *) &imb_io_ptr->saved1;
-			swath_width = (double *) &imb_io_ptr->saved2;
-			ping->png_pixel_size = 0;
-			ping->png_pixels_ss = 0;
-			status = mbsys_simrad3_makess(verbose,
-					imbio_ptr, istore_ptr,
-					MB_NO, pixel_size,
-					MB_NO, swath_width,
-					1,
-					&error);
-			}
-
-	   	/* handle unknown data */
-		else  if (status == MB_SUCCESS)
-			{
-/*fprintf(stderr,"DATA TYPE OTHER THAN SURVEY: status:%d error:%d kind:%d\n",status,error,kind);*/
-			}
-
-	   	/* handle read error */
-		else
-			{
-/*fprintf(stderr,"READ FAILURE: status:%d error:%d kind:%d\n",status,error,kind);*/
-			}
-
-		/* print debug statements */
-		if (verbose >= 2)
-			{
-			fprintf(stderr,"\ndbg2  Ping read in program <%s>\n",
-				program_name);
-			fprintf(stderr,"dbg2       kind:           %d\n",kind);
-			fprintf(stderr,"dbg2       error:          %d\n",error);
-			fprintf(stderr,"dbg2       status:         %d\n",status);
-			}
-
-	/*--------------------------------------------
-	  write the processed data
-	  --------------------------------------------*/
-
-		/* write some data */
-		if (error == MB_ERROR_NO_ERROR)
-			{
-			status = mb_put_all(verbose,ombio_ptr,
-					istore_ptr,MB_NO,kind,
-					time_i,time_d,
-					navlon,navlat,speed,heading,
-					obeams_bath,obeams_amp,opixels_ss,
-					beamflag,bath,amp,bathacrosstrack,bathalongtrack,
-					ss,ssacrosstrack,ssalongtrack,
-					comment,&error);
-			if (status != MB_SUCCESS)
-				{
-				mb_error(verbose,error,&message);
-				fprintf(stderr,"\nMBIO Error returned from function <mb_put>:\n%s\n",message);
-				fprintf(stderr,"\nMultibeam Data Not Written To File <%s>\n",ofile);
-				fprintf(stderr,"\nProgram <%s> Terminated\n",
-					program_name);
-				exit(error);
-				}
-			}
-		}
-
-	/* output counts */
-	if(output_counts == MB_YES)
-		{
-		fprintf(stdout, "\nData records written to: %s\n", ofile);
-		fprintf(stdout, "     nrec_0x30_pu_id:         %d\n", nrec_0x30_pu_id);
-		fprintf(stdout, "     nrec_0x31_pu_status:          %d\n", nrec_0x31_pu_status);
-		fprintf(stdout, "     nrec_0x32_pu_bist:           %d\n", nrec_0x32_pu_bist);
-		fprintf(stdout, "     nrec_0x33_parameter_extra:        %d\n", nrec_0x33_parameter_extra);
-		fprintf(stdout, "     nrec_0x41_attitude:               %d\n", nrec_0x41_attitude);
-		fprintf(stdout, "     nrec_0x43_clock:                  %d\n", nrec_0x43_clock);
-		fprintf(stdout, "     nrec_0x44_bathymetry:             %d\n", nrec_0x44_bathymetry);
-		fprintf(stdout, "     nrec_0x45_singlebeam:             %d\n", nrec_0x45_singlebeam);
-		fprintf(stdout, "     nrec_0x46_rawbeamF:               %d\n", nrec_0x46_rawbeamF);
-		fprintf(stdout, "     nrec_0x47_surfacesoundspeed2:     %d\n", nrec_0x47_surfacesoundspeed2);
-		fprintf(stdout, "     nrec_0x48_heading:                %d\n", nrec_0x48_heading);
-		fprintf(stdout, "     nrec_0x49_parameter_start:        %d\n", nrec_0x49_parameter_start);
-		fprintf(stdout, "     nrec_0x4A_tilt:                   %d\n", nrec_0x4A_tilt);
-		fprintf(stdout, "     nrec_0x4B_echogram:               %d\n", nrec_0x4B_echogram);
-		fprintf(stdout, "     nrec_0x4E_rawbeamN:               %d\n", nrec_0x4E_rawbeamN);
-		fprintf(stdout, "     nrec_0x4F_quality:            v   %d\n", nrec_0x4F_quality);
-		fprintf(stdout, "     nrec_0x50_pos:                    %d\n", nrec_0x50_pos);
-		fprintf(stdout, "     nrec_0x52_runtime:                %d\n", nrec_0x52_runtime);
-		fprintf(stdout, "     nrec_0x53_sidescan:               %d\n", nrec_0x53_sidescan);
-		fprintf(stdout, "     nrec_0x54_tide:                   %d\n", nrec_0x54_tide);
-		fprintf(stdout, "     nrec_0x55_svp2:                   %d\n", nrec_0x55_svp2);
-		fprintf(stdout, "     nrec_0x56_svp:                    %d\n", nrec_0x56_svp);
-		fprintf(stdout, "     nrec_0x57_surfacesoundspeed:      %d\n", nrec_0x57_surfacesoundspeed);
-		fprintf(stdout, "     nrec_0x58_bathymetry2:            %d\n", nrec_0x58_bathymetry2);
-		fprintf(stdout, "     nrec_0x59_sidescan2:              %d\n", nrec_0x59_sidescan2);
-		fprintf(stdout, "     nrec_0x66_rawbeamf:               %d\n", nrec_0x66_rawbeamf);
-		fprintf(stdout, "     nrec_0x68_height:                 %d\n", nrec_0x68_height);
-		fprintf(stdout, "     nrec_0x69_parameter_stop:         %d\n", nrec_0x69_parameter_stop);
-		fprintf(stdout, "     nrec_0x6B_water_column:           %d\n", nrec_0x6B_water_column);
-		fprintf(stdout, "     nrec_0x6E_network_attitude:       %d\n", nrec_0x6E_network_attitude);
-		fprintf(stdout, "     nrec_0x70_parameter:              %d\n", nrec_0x70_parameter);
-		fprintf(stdout, "     nrec_0x73_surface_sound_speed:    %d\n", nrec_0x73_surface_sound_speed);
-		fprintf(stdout, "     nrec_0xE1_bathymetry_mbari57:     %d\n", nrec_0xE1_bathymetry_mbari57);
-		fprintf(stdout, "     nrec_0xE2_sidescan_mbari57:       %d\n", nrec_0xE2_sidescan_mbari57);
-		fprintf(stdout, "     nrec_0xE3_bathymetry_mbari59:     %d\n", nrec_0xE3_bathymetry_mbari59);
-		fprintf(stdout, "     nrec_0xE4_sidescan_mbari59:       %d\n", nrec_0xE4_sidescan_mbari59);
-		fprintf(stdout, "     nrec_0xE5_bathymetry_mbari59:     %d\n", nrec_0xE5_bathymetry_mbari59);
-		}
-
-	nrec_0x30_pu_id_tot += nrec_0x30_pu_id;
-	nrec_0x31_pu_status_tot += nrec_0x31_pu_status;
-	nrec_0x32_pu_bist_tot += nrec_0x32_pu_bist;
-	nrec_0x33_parameter_extra_tot += nrec_0x33_parameter_extra;
-	nrec_0x41_attitude_tot += nrec_0x41_attitude;
-	nrec_0x43_clock_tot += nrec_0x43_clock;
-	nrec_0x44_bathymetry_tot += nrec_0x44_bathymetry;
-	nrec_0x45_singlebeam_tot += nrec_0x45_singlebeam;
-	nrec_0x46_rawbeamF_tot += nrec_0x46_rawbeamF;
-	nrec_0x47_surfacesoundspeed2_tot += nrec_0x47_surfacesoundspeed2;
-	nrec_0x48_heading_tot += nrec_0x48_heading;
-	nrec_0x49_parameter_start_tot += nrec_0x49_parameter_start;
-	nrec_0x4A_tilt_tot += nrec_0x4A_tilt;
-	nrec_0x4B_echogram_tot += nrec_0x4B_echogram;
-	nrec_0x4E_rawbeamN_tot += nrec_0x4E_rawbeamN;
-	nrec_0x4F_quality_tot += nrec_0x4F_quality;
-	nrec_0x50_pos_tot += nrec_0x50_pos;
-	nrec_0x52_runtime_tot += nrec_0x52_runtime;
-	nrec_0x53_sidescan_tot += nrec_0x53_sidescan;
-	nrec_0x54_tide_tot += nrec_0x54_tide;
-	nrec_0x55_svp2_tot += nrec_0x55_svp2;
-	nrec_0x56_svp_tot += nrec_0x56_svp;
-	nrec_0x57_surfacesoundspeed_tot += nrec_0x57_surfacesoundspeed;
-	nrec_0x58_bathymetry2_tot += nrec_0x58_bathymetry2;
-	nrec_0x59_sidescan2_tot += nrec_0x59_sidescan2;
-	nrec_0x66_rawbeamf_tot += nrec_0x66_rawbeamf;
-	nrec_0x68_height_tot += nrec_0x68_height;
-	nrec_0x69_parameter_stop_tot += nrec_0x69_parameter_stop;
-	nrec_0x6B_water_column_tot += nrec_0x6B_water_column;
-	nrec_0x6E_network_attitude_tot += nrec_0x6E_network_attitude;
-	nrec_0x70_parameter_tot += nrec_0x70_parameter;
-	nrec_0x73_surface_sound_speed_tot += nrec_0x73_surface_sound_speed;
-	nrec_0xE1_bathymetry_mbari57_tot += nrec_0xE1_bathymetry_mbari57;
-	nrec_0xE2_sidescan_mbari57_tot += nrec_0xE2_sidescan_mbari57;
-	nrec_0xE3_bathymetry_mbari59_tot += nrec_0xE3_bathymetry_mbari59;
-	nrec_0xE4_sidescan_mbari59_tot += nrec_0xE4_sidescan_mbari59;
-	nrec_0xE5_bathymetry_mbari59_tot += nrec_0xE5_bathymetry_mbari59;
-
-	/* figure out whether and what to read next */
-        if (read_datalist == MB_YES)
-                {
-		if ((status = mb_datalist_read(verbose,datalist,
-			    ifile,&format,&file_weight,&error))
-			    == MB_SUCCESS)
-                        read_data = MB_YES;
-                else
-                        read_data = MB_NO;
-                }
-        else
-                {
-                read_data = MB_NO;
-                }
-
-	/* close the input swath file */
-	status = mb_close(verbose,&imbio_ptr,&error);
-
-	/* close the output swath file if necessary */
-	if (ofile_set == MB_NO || read_data == MB_NO)
-		{
-		status = mb_close(verbose,&ombio_ptr,&error);
-
-		/* open up start and end times by two minutes */
-		start_time_d -= 120.0;
-		end_time_d += 120.0;
-
-		/* output asynchronous heading output file */
-		sprintf(athfile,"%s.ath",ofile);
-		if ((athfp = fopen(athfile, "w")) != NULL)
-			{
-			for (i=0;i<ndat_heading;i++)
-				{
-				if (dat_heading_time_d[i] > start_time_d && dat_heading_time_d[i] < end_time_d)
-					fprintf(athfp, "%0.6f\t%7.3f\n",dat_heading_time_d[i], dat_heading_heading[i]);
-				}
-			fclose(athfp);
-			}
-		else
-			{
-			error = MB_ERROR_OPEN_FAIL;
-			fprintf(stderr,"\nUnable to open asynchronous heading data file <%s> for writing\n",athfile);
-			fprintf(stderr,"\nProgram <%s> Terminated\n",
-				program_name);
-			exit(error);
-			}
-
-		/* output asynchronous sonardepth output file */
-		sprintf(atsfile,"%s.ats",ofile);
-		if ((atsfp = fopen(atsfile, "w")) != NULL)
-			{
-			for (i=0;i<ndat_sonardepth;i++)
-				{
-				if (dat_sonardepth_time_d[i] > start_time_d && dat_sonardepth_time_d[i] < end_time_d)
-					fprintf(atsfp, "%0.6f\t%7.3f\n",dat_sonardepth_time_d[i], dat_sonardepth_sonardepth[i]);
-				}
-			fclose(atsfp);
-			}
-		else
-			{
-			error = MB_ERROR_OPEN_FAIL;
-			fprintf(stderr,"\nUnable to open asynchronous sonardepth data file <%s> for writing\n",atsfile);
-			fprintf(stderr,"\nProgram <%s> Terminated\n",
-				program_name);
-			exit(error);
-			}
-
-		/* output asynchronous attitude output file */
-		sprintf(atafile,"%s.ata",ofile);
-		if ((atafp = fopen(atafile, "w")) != NULL)
-			{
-			for (i=0;i<ndat_rph;i++)
-				{
-				if (dat_rph_time_d[i] > start_time_d && dat_rph_time_d[i] < end_time_d)
-					fprintf(atafp, "%0.6f\t%0.3f\t%0.3f\n",dat_rph_time_d[i], dat_rph_roll[i], dat_rph_pitch[i]);
-				}
-			fclose(atafp);
-			}
-		else
-			{
-			error = MB_ERROR_OPEN_FAIL;
-			fprintf(stderr,"\nUnable to open asynchronous attitude data file <%s> for writing\n",atafile);
-			fprintf(stderr,"\nProgram <%s> Terminated\n",
-				program_name);
-			exit(error);
-			}
-
-		/* close ats and sta files */
-		fclose(stafp);
-
-		/* generate inf fnv and fbt files */
-		if (status == MB_SUCCESS)
-			{
-			status = mb_make_info(verbose, MB_YES, ofile, MBF_EM710MBA, &error);
-			}
-		}
-
-	/* end loop over files in list */
-	}
-	if (read_datalist == MB_YES)
-		mb_datalist_close(verbose,&datalist,&error);
-
-	/* output counts */
-	if(output_counts == MB_YES)
-		{
-		fprintf(stdout, "\nTotal files read:  %d\n", nfile_read);
-		fprintf(stdout, "Total files written: %d\n", nfile_write);
-		fprintf(stdout, "\nTotal data records written from: %s\n", read_file);
-		fprintf(stdout, "     nrec_0x30_pu_id_tot:     %d\n", nrec_0x30_pu_id_tot);
-		fprintf(stdout, "     nrec_0x31_pu_status_tot:      %d\n", nrec_0x31_pu_status_tot);
-		fprintf(stdout, "     nrec_0x32_pu_bist_tot:       %d\n", nrec_0x32_pu_bist_tot);
-		fprintf(stdout, "     nrec_0x33_parameter_extra_tot:    %d\n", nrec_0x33_parameter_extra_tot);
-		fprintf(stdout, "     nrec_0x41_attitude_tot:           %d\n", nrec_0x41_attitude_tot);
-		fprintf(stdout, "     nrec_0x43_clock_tot:              %d\n", nrec_0x43_clock_tot);
-		fprintf(stdout, "     nrec_0x44_bathymetry_tot:         %d\n", nrec_0x44_bathymetry_tot);
-		fprintf(stdout, "     nrec_0x45_singlebeam_tot:         %d\n", nrec_0x45_singlebeam_tot);
-		fprintf(stdout, "     nrec_0x46_rawbeamF_tot:           %d\n", nrec_0x46_rawbeamF_tot);
-		fprintf(stdout, "     nrec_0x47_surfacesoundspeed2_tot: %d\n", nrec_0x47_surfacesoundspeed2_tot);
-		fprintf(stdout, "     nrec_0x48_heading_tot:            %d\n", nrec_0x48_heading_tot);
-		fprintf(stdout, "     nrec_0x49_parameter_start_tot:    %d\n", nrec_0x49_parameter_start_tot);
-		fprintf(stdout, "     nrec_0x4A_tilt_tot:               %d\n", nrec_0x4A_tilt_tot);
-		fprintf(stdout, "     nrec_0x4B_echogram_tot:           %d\n", nrec_0x4B_echogram_tot);
-		fprintf(stdout, "     nrec_0x4E_rawbeamN_tot:           %d\n", nrec_0x4E_rawbeamN_tot);
-		fprintf(stdout, "     nrec_0x4F_quality_tot:            %d\n", nrec_0x4F_quality_tot);
-		fprintf(stdout, "     nrec_0x50_pos_tot:                %d\n", nrec_0x50_pos_tot);
-		fprintf(stdout, "     nrec_0x52_runtime_tot:            %d\n", nrec_0x52_runtime_tot);
-		fprintf(stdout, "     nrec_0x53_sidescan_tot:           %d\n", nrec_0x53_sidescan_tot);
-		fprintf(stdout, "     nrec_0x54_tide_tot:               %d\n", nrec_0x54_tide_tot);
-		fprintf(stdout, "     nrec_0x55_svp2_tot:               %d\n", nrec_0x55_svp2_tot);
-		fprintf(stdout, "     nrec_0x56_svp_tot:                %d\n", nrec_0x56_svp_tot);
-		fprintf(stdout, "     nrec_0x57_surfacesoundspeed_tot:  %d\n", nrec_0x57_surfacesoundspeed_tot);
-		fprintf(stdout, "     nrec_0x58_bathymetry2_tot:        %d\n", nrec_0x58_bathymetry2_tot);
-		fprintf(stdout, "     nrec_0x59_sidescan2_tot:          %d\n", nrec_0x59_sidescan2_tot);
-		fprintf(stdout, "     nrec_0x66_rawbeamf_tot:           %d\n", nrec_0x66_rawbeamf_tot);
-		fprintf(stdout, "     nrec_0x68_height_tot:             %d\n", nrec_0x68_height_tot);
-		fprintf(stdout, "     nrec_0x69_parameter_stop_tot:     %d\n", nrec_0x69_parameter_stop_tot);
-		fprintf(stdout, "     nrec_0x6B_water_column_tot:       %d\n", nrec_0x6B_water_column_tot);
-		fprintf(stdout, "     nrec_0x6E_network_attitude_tot:   %d\n", nrec_0x6E_network_attitude_tot);
-		fprintf(stdout, "     nrec_0x70_parameter_tot:          %d\n", nrec_0x70_parameter_tot);
-		fprintf(stdout, "     nrec_0x73_surface_sound_speed_tot:%d\n", nrec_0x73_surface_sound_speed_tot);
-		fprintf(stdout, "     nrec_0xE1_bathymetry_mbari57_tot: %d\n", nrec_0xE1_bathymetry_mbari57_tot);
-		fprintf(stdout, "     nrec_0xE2_sidescan_mbari57_tot:   %d\n", nrec_0xE2_sidescan_mbari57_tot);
-		fprintf(stdout, "     nrec_0xE3_bathymetry_mbari59_tot: %d\n", nrec_0xE3_bathymetry_mbari59_tot);
-		fprintf(stdout, "     nrec_0xE4_sidescan_mbari59_tot:   %d\n", nrec_0xE4_sidescan_mbari59_tot);
-		fprintf(stdout, "     nrec_0xE5_bathymetry_mbari59_tot: %d\n", nrec_0xE5_bathymetry_mbari59_tot);
-		}
-	}
-
-	/* deallocate navigation arrays */
-	if (ndat_nav > 0)
-		{
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&dat_nav_time_d,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&dat_nav_time_d,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&dat_nav_lon,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&dat_nav_lat,&error);
-		}
-	if (ndat_heading > 0)
-		{
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&dat_heading_heading,&error);
-		}
-	if (ndat_rph > 0)
-		{
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&dat_rph_roll,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&dat_rph_pitch,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&dat_rph_heave,&error);
-		}
-
-	/* check memory */
-	if (verbose >= 4)
-		status = mb_memory_list(verbose,&error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  Program <%s> completed\n",
-			program_name);
-		fprintf(stderr,"dbg2  Ending status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* end it all */
-	exit(error);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/utilities/mblevitus.c b/src/utilities/mblevitus.c
deleted file mode 100644
index 41a6bb7..0000000
--- a/src/utilities/mblevitus.c
+++ /dev/null
@@ -1,505 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mblevitus.c	4/15/93
- *    $Id: mblevitus.c 2241 2015-05-12 21:00:35Z caress $
- *
- *    Copyright (c) 1993-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * MBLEVITUS generates an average water velocity profile for a
- * specified location from the Levitus temperature and salinity
- * database.
- *
- * The calculation of water sound velocity from salinity and
- * temperature observations proceeds in two steps. The first
- * step is to calculate the pressure as a function of depth
- * and latitude. We use equations from a 1989 book by Coates:
- * *
- * The second step is to calculate the water sound velocity.
- * We use the DelGrosso equation because of the results presented in
- *    Dusha, Brian D. Worcester, Peter F., Cornuelle, Bruce D.,
- *      Howe, Bruce. M. "On equations for the speed of sound
- *      in seawater", J. Acoust. Soc. Am., Vol 93, No 1,
- *      January 1993, pp 255-275.
- *
- * Author:	D. W. Caress
- * Date:	April 15, 1993
- * Rewrite:	March 26, 1997
- *
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <math.h>
-#include <string.h>
-#include <time.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_define.h"
-
-/* global defines */
-#define	MBLEVITUS_NO_DATA	-1000000000.0
-#define	NDEPTH_MAX		46
-#define	NLEVITUS_MAX		33
-
-static char rcs_id[] = "$Id: mblevitus.c 2241 2015-05-12 21:00:35Z caress $";
-
-/* Windows header file */
-#ifdef WIN32
-#include <windows.h>
-#endif
-
-/* Windows implementation of GMT_runtime_bindir */
-#ifdef WIN32
-char *GMT_runtime_bindir_win32 (char *result);
-#endif
-
-/*--------------------------------------------------------------------*/
-
-int main (int argc, char **argv)
-{
-	char program_name[] = "MBLEVITUS";
-	char help_message[] = "MBLEVITUS generates an average water velocity profile for a \nspecified location from the Levitus temperature and salinity database.";
-	char usage_message[] = "mblevitus [-Rlon/lat -Ooutfile -V -H]";
-	extern char *optarg;
-	int	errflg = 0;
-	int	c;
-	int	status;
-	int	verbose = 0;
-	int	help = 0;
-	int	flag = 0;
-	int	error = MB_ERROR_NO_ERROR;
-
-	/* input file set in include file */
-#ifndef WIN32
-#	include "levitus.h"
-#else
-	/* But on Windows get it from the bin dir */
-	char *pch, ifile[PATH_MAX+1];
-#endif
-
-	/* control parameters */
-	char	ofile[128];
-	FILE	*ifp, *ofp, *outfp;
-	int	record_size;
-	long	location;
-	double	longitude = 0.0;
-	double	latitude = 0.0;
-	double	lon_actual;
-	double	lat_actual;
-	int	ilon;
-	int	ilat;
-	int	nvelocity;
-	int	nvelocity_tot;
-	float	temperature[NLEVITUS_MAX][180];
-	float	salinity[NLEVITUS_MAX][180];
-	float	velocity[NDEPTH_MAX];
-	static float	depth[NDEPTH_MAX] = {
-		    0.,   10.,   20.,   30.,   50.,
-		   75.,  100.,  125.,  150.,  200.,
-		  250.,  300.,  400.,  500.,  600.,
-		  700.,  800.,  900., 1000., 1100.,
-		 1200., 1300., 1400., 1500., 1750.,
-		 2000., 2500., 3000., 3500., 4000.,
-		 4500., 5000., 5500., 6000., 6500.,
-		 7000., 7500., 8000., 8500., 9000.,
-		 9500.,10000.,10500.,11000.,11500.,
-		12000. }; /* 46 depth values */
-	double	pressure;
-	double	c0, dltact, dltacs, dltacp, dcstp;
-	double	zero = 0.0;
-
-	/* time, user, host variables */
-	time_t	right_now;
-	char	date[32], user[128], *user_ptr, host[128];
-
-	char	*lonptr, *latptr;
-	int	last_good;
-	int	i;
-
-	char	*ctime();
-	char	*getenv();
-
-	/* set default output */
-	strcpy(ofile,"velocity");
-
-	/* process argument list */
-	while ((c = getopt(argc, argv, "VvHhR:r:O:o:")) != -1)
-	  switch (c)
-		{
-		case 'H':
-		case 'h':
-			help++;
-			break;
-		case 'V':
-		case 'v':
-			verbose++;
-			break;
-		case 'R':
-		case 'r':
-			lonptr = strtok(optarg, "/");
-			latptr = strtok(NULL, "/");
-			if (lonptr != NULL && latptr != NULL)
-			    {
-			    longitude = mb_ddmmss_to_degree(lonptr);
-			    latitude = mb_ddmmss_to_degree(latptr);
-			    }
-			flag++;
-			break;
-		case 'O':
-		case 'o':
-			sscanf (optarg,"%s", ofile);
-			flag++;
-			break;
-		case '?':
-			errflg++;
-		}
-
-	/* if error flagged then print it and exit */
-	if (errflg)
-		{
-		fprintf(stderr,"usage: %s\n", usage_message);
-		error = MB_ERROR_BAD_USAGE;
-		exit(error);
-		}
-
-	/* set output stream */
-	if (verbose <= 1)
-		outfp = stdout;
-	else
-		outfp = stderr;
-
-#ifdef WIN32
-	/* Find the path to the bin directory and from it, the location of the Levitus file */
-	GMT_runtime_bindir_win32 (ifile);
-	pch = strrchr(ifile, '\\');
-	pch[0] = '\0';
-	strcat(ifile, "\\share\\mbsystem\\LevitusAnnual82.dat");
-#endif
-
-	/* print starting message */
-	if (verbose == 1 || help)
-		{
-		fprintf(outfp,"\nProgram %s\n",program_name);
-		fprintf(outfp,"Version %s\n",rcs_id);
-		fprintf(outfp,"MB-system Version %s\n",MB_VERSION);
-		}
-
-	/* print starting debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(outfp,"\ndbg2  Program <%s>\n",program_name);
-		fprintf(outfp,"dbg2  Version %s\n",rcs_id);
-		fprintf(outfp,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(outfp,"dbg2  Control Parameters:\n");
-		fprintf(outfp,"dbg2       verbose:    %d\n",verbose);
-		fprintf(outfp,"dbg2       help:       %d\n",help);
-		fprintf(outfp,"dbg2       ifile:      %s\n",ifile);
-		fprintf(outfp,"dbg2       ofile:      %s\n",ofile);
-		fprintf(outfp,"dbg2       longitude:  %f\n",longitude);
-		fprintf(outfp,"dbg2       latitude:   %f\n",latitude);
-		}
-
-	/* if help desired then print it and exit */
-	if (help)
-		{
-		fprintf(outfp,"\n%s\n",help_message);
-		fprintf(outfp,"\nusage: %s\n", usage_message);
-		exit(error);
-		}
-
-	/* open the data file */
-	if ((ifp = fopen(ifile, "rb")) == NULL)
-		{
-		error = MB_ERROR_OPEN_FAIL;
-		fprintf(stderr,"\nUnable to Open Levitus database file <%s> for reading\n",ifile);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-
-	/* check for sensible location */
-	if (longitude < -360.0 || longitude > 360.0
-		|| latitude < -90.0 || latitude > 90.0)
-		{
-		error = MB_ERROR_BAD_PARAMETER;
-		fprintf(stderr,"\nInvalid location specified:  longitude: %f  latitude: %f\n",longitude,latitude);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-
-	/* get the longitude and latitude indices */
-	if (longitude < 0.0)
-		ilon = (int) (longitude + 360.0);
-	else if (longitude >= 360.0)
-		ilon = (int) (longitude - 360.0);
-	else
-		ilon = (int) longitude;
-	lon_actual = ilon + 0.5;
-	ilat = (int) (latitude + 90.0);
-	lat_actual = ilat - 89.5;
-	fprintf(outfp,"\nLocation for mean annual water velocity profile:\n");
-	fprintf(outfp,"  Requested:  %6.4f longitude   %6.4f latitude\n",
-		longitude,latitude);
-	fprintf(outfp,"  Used:       %6.4f longitude   %6.4f latitude\n",
-		lon_actual,lat_actual);
-
-	/* read the temperature */
-	record_size = sizeof(float) * NLEVITUS_MAX * 180;
-	location = ilon*record_size;
-	status = fseek(ifp,location,0);
-	if ((status = fread(&temperature[0][0],1,record_size,ifp))
-		== record_size)
-		{
-		status = MB_SUCCESS;
-		error = MB_ERROR_NO_ERROR;
-		}
-	else
-		{
-		status = MB_FAILURE;
-		error = MB_ERROR_EOF;
-		}
-
-	/* read the salinity */
-	location = location + 360*record_size;
-	status = fseek(ifp,location,0);
-	if ((status = fread(&salinity[0][0],1,record_size,ifp))
-		== record_size)
-		{
-		status = MB_SUCCESS;
-		error = MB_ERROR_NO_ERROR;
-		}
-	else
-		{
-		status = MB_FAILURE;
-		error = MB_ERROR_EOF;
-		}
-
-	/* close input file */
-	fclose(ifp);
-
-	/* byte swap the data if necessary */
-#ifdef BYTESWAPPED
-	for (i=0;i<NLEVITUS_MAX;i++)
-		{
-		mb_swap_float(&temperature[i][ilat]);
-		mb_swap_float(&salinity[i][ilat]);
-		}
-#endif
-
-	/* calculate velocity from temperature and salinity */
-	nvelocity = 0;
-	nvelocity_tot = 0;
-	last_good = -1;
-	for (i=0;i<NDEPTH_MAX;i++)
-	  {
-	  if (i < NLEVITUS_MAX)
-	    if (salinity[i][ilat] > MBLEVITUS_NO_DATA)
-		{
-		last_good = i;
-		nvelocity++;
-		}
-	  if (last_good >= 0)
-		{
-		/* set counter */
-		nvelocity_tot++;
-
-		/* get pressure for a given depth
-			as a function of latitude */
-		pressure = 1.0052405 * depth[i]
-			* (1.0 + 0.00528 * sin (DTR * latitude)
-			    * sin(DTR * latitude))
-			+ 0.00000236 * depth[i] * depth[i];
-
-		/* calculate water sound speed using
-			DelGrosso equations */
-		/* convert decibar to kg/cm**2 */
-		pressure = pressure * 0.1019716;
-		c0 = 1402.392;
-		dltact  = temperature[last_good][ilat]
-			    * ( 5.01109398873
-			    + temperature[last_good][ilat]
-			    * (-0.0550946843172
-			    + temperature[last_good][ilat]
-			    * 0.000221535969240));
-		dltacs = salinity[last_good][ilat]
-			    * (1.32952290781
-			    + salinity[last_good][ilat]
-			    * 0.000128955756844);
-
-		dltacp = pressure
-			    * (0.156059257041E0
-				+ pressure
-				* (0.000024499868841
-				    + pressure
-				    * -0.00000000883392332513));
-		dcstp =  temperature[last_good][ilat]
-			    * (-0.0127562783426
-				    * salinity[last_good][ilat]
-				+ pressure
-				* ( 0.00635191613389
-				    + pressure
-				    * (0.265484716608E-7
-					* temperature[last_good][ilat]
-					- 0.00000159349479045
-					+ 0.522116437235E-9 * pressure)
-				    -0.000000438031096213
-				    * temperature[last_good][ilat]
-				    * temperature[last_good][ilat] ))
-			    + salinity[last_good][ilat]
-			    * (-0.161674495909E-8
-				* salinity[last_good][ilat]
-				* pressure * pressure
-				+ temperature[last_good][ilat]
-				* (0.0000968403156410
-				    * temperature[last_good][ilat]
-				    + pressure
-				    * ( 0.00000485639620015
-					* salinity[last_good][ilat]
-					-0.000340597039004)));
-		velocity[i] = c0 + dltact + dltacs + dltacp + dcstp;
-		}
-	  else
-		velocity[i] = salinity[i][ilat];
-	  }
-
-	/* check for existence of water velocity profile */
-	if (nvelocity < 1)
-		{
-		error = MB_ERROR_BAD_PARAMETER;
-		fprintf(stderr,"\nNo water velocity profile available for specified location.\n");
-		fprintf(stderr,"This place is probably subaerial!\n");
-		fprintf(stderr,"No output file created.\n");
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-
-	/* open the output file */
-	if ((ofp = fopen(ofile, "w")) == NULL)
-		{
-		error = MB_ERROR_OPEN_FAIL;
-		fprintf(stderr,"\nUnable to Open output file <%s> for writing\n",ofile);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-
-	/* print it out */
-	fprintf(ofp,"# Water velocity profile created by program %s version %s\n",
-		program_name,rcs_id);
-	fprintf(ofp,"# MB-system Version %s\n",MB_VERSION);
-	right_now = time((time_t *)0);
-	strcpy(date,ctime(&right_now));
-        date[strlen(date)-1] = '\0';
-	if ((user_ptr = getenv("USER")) == NULL)
-		user_ptr = getenv("LOGNAME");
-	if (user_ptr != NULL)
-		strcpy(user,user_ptr);
-	else
-		strcpy(user, "unknown");
-	gethostname(host,128);
-	fprintf(ofp,"# Run by user <%s> on cpu <%s> at <%s>\n",
-		user,host,date);
-	fprintf(ofp,"# Water velocity profile derived from Levitus\n");
-	fprintf(ofp,"# temperature and salinity database.  This profile\n");
-	fprintf(ofp,"# represents the annual average water velocity\n");
-	fprintf(ofp,"# structure for a 1 degree X 1 degree area centered\n");
-	fprintf(ofp,"# at %6.4f longitude and %6.4f latitude.\n",
-		lon_actual, lat_actual);
-	fprintf(ofp,"# This water velocity profile is in the form\n");
-	fprintf(ofp,"# of discrete (depth, velocity) points where\n");
-	fprintf(ofp,"# the depth is in meters and the velocity in\n");
-	fprintf(ofp,"# meters/second.\n");
-	fprintf(ofp,"# The first %d velocity values are defined using the\n",
-		nvelocity);
-	fprintf(ofp,"# salinity and temperature values available in the\n");
-	fprintf(ofp,"# Levitus database; the remaining %d velocity values are\n",
-		nvelocity_tot-nvelocity);
-	fprintf(ofp,"# calculated using the deepest temperature\n");
-	fprintf(ofp,"# and salinity value available.\n");
-
-	for (i=0;i<nvelocity_tot;i++)
-		fprintf(ofp,"%f %f\n",depth[i],velocity[i]);
-	fprintf(outfp,"Values defined directly by Levitus database:      %2d\n",
-		nvelocity);
-	fprintf(outfp,"Values assuming deepest salinity and temperature: %2d\n",
-		nvelocity_tot - nvelocity);
-	fprintf(outfp,"Velocity points written:                          %2d\n",
-		nvelocity_tot);
-	fprintf(outfp,"Output file: %s\n",ofile);
-	if (verbose >= 1)
-		{
-		fprintf(outfp,"\nMean annual water column profile:\n");
-		fprintf(outfp,"     Depth Temperature Salinity   Velocity\n");
-		for (i=0;i<nvelocity_tot;i++)
-			{
-			if (i<nvelocity)
-			fprintf(outfp,"%10.4f %9.4f %9.4f   %9.4f\n",
-				depth[i],temperature[i][ilat],
-				salinity[i][ilat],velocity[i]);
-			else
-			fprintf(outfp,"%10.4f %9.4f %9.4f   %9.4f\n",
-				depth[i],zero,
-				zero,velocity[i]);
-			}
-		}
-
-	/* close the output file */
-	fclose(ofp);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(outfp,"\ndbg2  Program <%s> completed\n",
-			program_name);
-		fprintf(outfp,"dbg2  Ending status:\n");
-		fprintf(outfp,"dbg2       status:  %d\n",status);
-		}
-
-	/* end it all */
-	exit(error);
-}
-
-/*--------------------------------------------------------------------*/
-
-/* Windows implementation of GMT_runtime_bindir */
-#ifdef WIN32
-char *GMT_runtime_bindir_win32 (char *result) {
-	TCHAR path[PATH_MAX+1];
-	char *c;
-
-	/* Get absolute path of executable */
-	if (GetModuleFileName (NULL, path, PATH_MAX) == PATH_MAX)
-		/* Path to long */
-		return NULL;
-
-	/* Convert to cstring */
-#ifdef _UNICODE
-	/* TCHAR is wchar_t* */
-	wcstombs (result, path, PATH_MAX);
-#else
-	/* TCHAR is char * */
-	strncpy (result, path, PATH_MAX);
-#endif
-
-	/* Truncate full path to dirname */
-	if ((c = strrchr (result, '\\')) && c != result)
-		*c = '\0';
-
-	return result;
-}
-#endif
-/*--------------------------------------------------------------------*/
diff --git a/src/utilities/mblist.c b/src/utilities/mblist.c
deleted file mode 100644
index 513f96b..0000000
--- a/src/utilities/mblist.c
+++ /dev/null
@@ -1,5466 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mblist.c	2/1/93
- *    $Id: mblist.c 2251 2015-07-01 01:02:06Z caress $
- *
- *    Copyright (c) 1993-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * MBlist prints the specified contents of a swath sonar data
- * file to stdout. The form of the output is quite flexible;
- * MBlist is tailored to produce ascii files in spreadsheet
- * style with data columns separated by tabs.
- *
- * Author:	D. W. Caress
- * Date:	February 1, 1993
- *
- * Note:	This program is based on the program mblist created
- *		by A. Malinverno (currently at Schlumberger, formerly
- *		at L-DEO) in August 1991.  It also includes elements
- *		derived from the program mbdump created by D. Caress
- *		in 1990.
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <math.h>
-#include <string.h>
-#include <time.h>
-
-/* MBIO include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_define.h"
-#include "mb_io.h"
-#include "mbsys_simrad2.h"
-#include "mbsys_simrad3.h"
-
-/* local options */
-#define	MAX_OPTIONS	25
-#define	DUMP_MODE_LIST	1
-#define	DUMP_MODE_BATH	2
-#define	DUMP_MODE_TOPO	3
-#define	DUMP_MODE_AMP	4
-#define	DUMP_MODE_SS	5
-#define	MBLIST_CHECK_ON			0
-#define	MBLIST_CHECK_ON_NULL		1
-#define	MBLIST_CHECK_OFF_RAW		2
-#define	MBLIST_CHECK_OFF_NAN		3
-#define	MBLIST_CHECK_OFF_FLAGNAN	4
-#define	MBLIST_SET_OFF	0
-#define	MBLIST_SET_ON	1
-#define	MBLIST_SET_ALL	2
-#define MBLIST_SET_EXCLUDE_OUTER 3
-
-/* function prototypes */
-int set_output(	int	verbose,
-		int	beams_bath,
-		int	beams_amp,
-		int	pixels_ss,
-		int	use_bath,
-		int	use_amp,
-		int	use_ss,
-		int	dump_mode,
-		int	beam_set,
-		int	pixel_set,
-		int	beam_vertical,
-		int	pixel_vertical,
-		int	*beam_start,
-		int	*beam_end,
-		int     *beam_exclude_percent,
-		int	*pixel_start,
-		int	*pixel_end,
-		int	*n_list,
-		char	*list,
-		int	*error);
-int set_bathyslope(int verbose,
-		int nbath, char *beamflag, double *bath, double *bathacrosstrack,
-		int *ndepths, double *depths, double *depthacrosstrack,
-		int *nslopes, double *slopes, double *slopeacrosstrack,
-		int *error);
-int get_bathyslope(int verbose,
-		int ndepths, double *depths, double *depthacrosstrack,
-		int nslopes, double *slopes, double *slopeacrosstrack,
-		double acrosstrack, double *depth,  double *slope,
-		int *error);
-int printsimplevalue(int verbose, FILE *output,
-		double value, int width, int precision,
-		int ascii, int *invert, int *flipsign, int *error);
-int printNaN(int verbose, FILE *output, int ascii, int *invert, int *flipsign, int *error);
-int mb_get_raw(int verbose, void *mbio_ptr,
-		int *mode,
-		int *ipulse_length,
-		int *png_count,
-		int *sample_rate,
-		double *absorption,
-		int *max_range,
-		int *r_zero,
-		int *r_zero_corr,
-		int *tvg_start,
-		int *tvg_stop,
-		double *bsn,
-		double *bso,
-		int *tx,
-		int *tvg_crossover,
-		int *nbeams_ss,
-		int *npixels,
-		int *beam_samples,
-		int *start_sample,
-		int *range,
-	        double *depression,
-		double *bs,
-		double *ss_pixels,
-		int *error);
-int mb_get_raw_simrad2(int verbose, void *mbio_ptr,
-		int *mode,
-		int *ipulse_length,
-		int *png_count,
-		int *sample_rate,
-		double *absorption,
-		int *max_range,
-		int *r_zero,
-		int *r_zero_corr,
-		int *tvg_start,
-		int *tvg_stop,
-		double *bsn,
-		double *bso,
-		int *tx,
-		int *tvg_crossover,
-		int *nbeams_ss,
-		int *npixels,
-		int *beam_samples,
-		int *start_sample,
-		int *range,
-		double *depression,
-		double *bs,
-		double *ss_pixels,
-		int *error);
-int mb_get_raw_simrad3(int verbose, void *mbio_ptr,
-		int *mode,
-		int *ipulse_length,
-		int *png_count,
-		int *sample_rate,
-		double *absorption,
-		int *max_range,
-		int *r_zero,
-		int *r_zero_corr,
-		int *tvg_start,
-		int *tvg_stop,
-		double *bsn,
-		double *bso,
-		int *tx,
-		int *tvg_crossover,
-		int *nbeams_ss,
-		int *npixels,
-		int *beam_samples,
-		int *start_sample,
-		int *range,
-		double *depression,
-		double *bs,
-		double *ss_pixels,
-		int *error);
-
-/* NaN value */
-double	NaN;
-
-static char rcs_id[] = "$Id: mblist.c 2251 2015-07-01 01:02:06Z caress $";
-
-/*--------------------------------------------------------------------*/
-
-int main (int argc, char **argv)
-{
-	char program_name[] = "MBLIST";
-	char help_message[] =  "MBLIST prints the specified contents of a swath data \nfile to stdout. The form of the output is quite flexible; \nMBLIST is tailored to produce ascii files in spreadsheet \nstyle with data columns separated by tabs.";
-	char usage_message[] = "mblist [-Byr/mo/da/hr/mn/sc -C -Ddump_mode -Eyr/mo/da/hr/mn/sc \n-Fformat -Gdelimiter -H -Ifile -Kdecimate -Llonflip -M[beam_start/beam_end | A | X%] -Npixel_start/pixel_end \n-Ooptions -Ppings -Rw/e/s/n -Sspeed -Ttimegap -Ucheck -Xoutfile -V -W -Zsegment]";
-	extern char *optarg;
-	int	errflg = 0;
-	int	c;
-	int	help = 0;
-	int	flag = 0;
-
-	/* MBIO status variables */
-	int	status = MB_SUCCESS;
-	int	verbose = 0;
-	int	error = MB_ERROR_NO_ERROR;
-	char	*message;
-
-	/* MBIO read control parameters */
-	int	read_datalist = MB_NO;
-	char	read_file[MB_PATH_MAXLINE];
-	void	*datalist;
-	int	look_processed = MB_DATALIST_LOOK_UNSET;
-	double	file_weight;
-	int	format;
-	int	pings;
-	int	pings_read;
-	int	decimate;
-	int	lonflip;
-	double	bounds[4];
-	int	btime_i[7];
-	int	etime_i[7];
-	double	btime_d;
-	double	etime_d;
-	double	speedmin;
-	double	timegap;
-	char	file[MB_PATH_MAXLINE];
-	int	beams_bath;
-	int	beams_amp;
-	int	pixels_ss;
-
-	/* output format list controls */
-	char	list[MAX_OPTIONS];
-	int	n_list;
-	int	beam_set = MBLIST_SET_OFF;
-	int	beam_start;
-	int	beam_end;
-	int     beam_exclude_percent;
-	int	beam_vertical = 0;
-	int	pixel_set = MBLIST_SET_OFF;
-	int	pixel_start;
-	int	pixel_end;
-	int	pixel_vertical = 0;
-	int	dump_mode = 1;
-	double	distance_total;
-	int	nread;
-	int	beam_status = MB_SUCCESS;
-	int	pixel_status = MB_SUCCESS;
-	int	time_j[5];
-	int	use_bath = MB_NO;
-	int	use_amp = MB_NO;
-	int	use_ss = MB_NO;
-	int	use_slope = MB_NO;
-	int	use_attitude = MB_NO;
-	int	use_nav = MB_NO;
-	int	use_gains = MB_NO;
-	int	use_detects = MB_YES;
-        int     use_pingnumber = MB_NO;
-	int	check_values = MBLIST_CHECK_ON;
-	int	check_nav = MB_NO;
-	int	check_bath = MB_NO;
-	int	check_amp = MB_NO;
-	int	check_ss = MB_NO;
-	int	invert_next_value = MB_NO;
-	int	signflip_next_value = MB_NO;
-	int	raw_next_value = MB_NO;
-	int	port_next_value = MB_NO;
-	int	stbd_next_value = MB_NO;
-	int	use_raw = MB_NO;
-	int	first = MB_YES;
-	int	ascii = MB_YES;
-	int	netcdf = MB_NO;
-	int	netcdf_cdl = MB_YES;
-	int	segment = MB_NO;
-	char	segment_tag[MB_PATH_MAXLINE];
-	char	delimiter[MB_PATH_MAXLINE];
-
-	/* MBIO read values */
-	void	*mbio_ptr = NULL;
-	void	*store_ptr = NULL;
-	int	kind;
-	int	time_i[7];
-	double	time_d;
-	double	navlon;
-	double	navlat;
-	double	speed;
-	double	heading;
-	double	distance;
-	double	altitude;
-	double	sonardepth;
-	double	draft;
-	double	roll;
-	double	pitch;
-	double	heave;
-	char	*beamflag = NULL;
-	double	*bath = NULL;
-	double	*bathacrosstrack = NULL;
-	double	*bathalongtrack = NULL;
-	int	*detect = NULL;
-	double	*amp = NULL;
-	double	*ss = NULL;
-	double	*ssacrosstrack = NULL;
-	double	*ssalongtrack = NULL;
-	char	comment[MB_COMMENT_MAXLINE];
-	int	icomment = 0;
-        int     pingnumber;
-
-	/* additional time variables */
-	int	first_m = MB_YES;
-	double	time_d_ref;
-	int	first_u = MB_YES;
-	time_t	time_u;
-	time_t	time_u_ref;
-	double	seconds;
-
-	/* crosstrack slope values */
-	double	avgslope;
-	double	sx, sy, sxx, sxy;
-	int	ns;
-	double	angle, depth, slope;
-	int	ndepths;
-	double	*depths = NULL;
-	double	*depthacrosstrack = NULL;
-	int	nslopes;
-	double	*slopes = NULL;
-	double	*slopeacrosstrack = NULL;
-
-	/* course calculation variables */
-	int	use_course = MB_NO;
-	int	use_time_interval = MB_NO;
-	double	course, course_old;
-	double	time_d_old, dt;
-	double	time_interval;
-	double	speed_made_good, speed_made_good_old;
-	double	navlon_old, navlat_old;
-	double	dx, dy, dist;
-	double	delta, b;
-	double	dlon, dlat, minutes;
-	int	degrees;
-	char	hemi;
-	double	headingx, headingy, mtodeglon, mtodeglat;
-
-	/* swathbounds variables */
-	int	use_swathbounds = MB_NO;
-	int	beam_port, beam_stbd;
-	int	pixel_port, pixel_stbd;
-
-	/* bathymetry feet flag */
-	int	bathy_in_feet = MB_NO;
-	double	bathy_scale;
-
-	/* raw data values */
-	int	count = 0;
-	int	invert;
-	int	flip;
-	int	mode;
-	int	ipulse_length;
-	int	png_count;
-	int	sample_rate;
-	double	absorption;
-	int	max_range;
-	int 	r_zero;
-	int 	r_zero_corr;
-	int 	tvg_start;
-	int	 tvg_stop;
-	double 	bsn;
-	double 	bso;
-	double	mback;
-	int	nback;
-	int 	tx;
-	int 	tvg_crossover;
-	int 	nbeams_ss;
-	int 	npixels;
-	int 	*beam_samples = NULL;
-	int 	*range = NULL;
-	int 	*start_sample = NULL;
-	double	*depression = NULL;
-	double	*bs = NULL;
-	double	*ss_pixels = NULL;
-	double	transmit_gain;
-	double	pulse_length;
-	double	receive_gain;
-
-        int     shellstatus;
-	int	read_data;
-	int	nbeams;
-	int	i, j, k, m;
-
-	/* output files */
-	FILE	**output;
-	FILE	*outfile;
-	char	output_file[MB_PATH_MAXLINE];
-	char	output_file_temp[MB_PATH_MAXLINE];
-	char	buffer[MB_BUFFER_MAX];
-
-	/* netcdf variables */
-	char	variable[MB_PATH_MAXLINE];
-	int	lcount = 0;
-	time_t	right_now;
-	char	date[32], user[128], *user_ptr, host[128];
-
-	/* get current default values */
-	status = mb_defaults(verbose,&format,&pings,&lonflip,bounds,
-		btime_i,etime_i,&speedmin,&timegap);
-
-	/* set default input to datalist.mb-1 */
-	strcpy (read_file, "datalist.mb-1");
-
-	/* set up the default list controls
-		(Time, lon, lat, heading, speed, along-track distance, center beam depth) */
-	list[0]='T';
-	list[1]='X';
-	list[2]='Y';
-	list[3]='H';
-	list[4]='S';
-	list[5]='L';
-	list[6]='Z';
-	n_list = 7;
-	sprintf(delimiter, "\t");
-
-	/* set dump mode flag to DUMP_MODE_LIST */
-	dump_mode = DUMP_MODE_LIST;
-	decimate = 1;
-
-	/* get NaN value */
-	MB_MAKE_DNAN(NaN);
-
-	strcpy(output_file, "-");
-
-	/* process argument list */
-	while ((c = getopt(argc, argv, "AaB:b:CcD:d:E:e:F:f:G:g:I:i:K:k:L:l:M:m:N:n:O:o:P:p:QqR:r:S:s:T:t:U:u:X:x:Z:z:VvWwHh")) != -1)
-	  switch (c)
-		{
-		case 'H':
-		case 'h':
-			help++;
-			break;
-		case 'V':
-		case 'v':
-			verbose++;
-			break;
-		case 'A':
-		case 'a':
-			ascii = MB_NO;
-			netcdf_cdl = MB_NO;
-			flag++;
-			break;
-		case 'B':
-		case 'b':
-			sscanf (optarg,"%d/%d/%d/%d/%d/%d",
-				&btime_i[0],&btime_i[1],&btime_i[2],
-				&btime_i[3],&btime_i[4],&btime_i[5]);
-			btime_i[6] = 0;
-			flag++;
-			break;
-		case 'C':
-		case 'c':
-			netcdf = MB_YES;
-			flag++;
-			break;
-		case 'D':
-		case 'd':
-			sscanf (optarg,"%d", &dump_mode);
-			if (dump_mode == DUMP_MODE_BATH)
-				beam_set = MBLIST_SET_ALL;
-			else if (dump_mode == DUMP_MODE_TOPO)
-				beam_set = MBLIST_SET_ALL;
-			else if (dump_mode == DUMP_MODE_AMP)
-				beam_set = MBLIST_SET_ALL;
-			else if (dump_mode == DUMP_MODE_SS)
-				pixel_set = MBLIST_SET_ALL;
-			flag++;
-			break;
-		case 'E':
-		case 'e':
-			sscanf (optarg,"%d/%d/%d/%d/%d/%d",
-				&etime_i[0],&etime_i[1],&etime_i[2],
-				&etime_i[3],&etime_i[4],&etime_i[5]);
-			etime_i[6] = 0;
-			flag++;
-			break;
-		case 'G':
-		case 'g':
-			sscanf (optarg,"%s", delimiter);
-			flag++;
-			break;
-		case 'F':
-		case 'f':
-			sscanf (optarg,"%d", &format);
-			flag++;
-			break;
-		case 'I':
-		case 'i':
-			sscanf (optarg,"%s", read_file);
-			flag++;
-			break;
-		case 'K':
-		case 'k':
-			sscanf (optarg,"%d", &decimate);
-			flag++;
-			break;
-		case 'L':
-		case 'l':
-			sscanf (optarg,"%d", &lonflip);
-			flag++;
-			break;
-		case 'M':
-		case 'm':
-			if (optarg[0] == 'a' || optarg[0] == 'A')
-			    {
-			    beam_set = MBLIST_SET_ALL;
-			    }
-			else if (optarg[0] == 'x' || optarg[0] == 'X')
-				{
-				beam_set = MBLIST_SET_EXCLUDE_OUTER;
-				sscanf(optarg,"%*c%d",&beam_exclude_percent);
-				}
-			else
-			    {
-			    sscanf (optarg,"%d/%d", &beam_start,&beam_end);
-			    beam_set = MBLIST_SET_ON;
-			    }
-			flag++;
-			break;
-		case 'N':
-		case 'n':
-			if (optarg[0] == 'a' || optarg[0] == 'A')
-			    {
-			    pixel_set = MBLIST_SET_ALL;
-			    }
-			else
-			    {
-			    sscanf (optarg,"%d/%d", &pixel_start,&pixel_end);
-			    pixel_set = MBLIST_SET_ON;
-			    }
-			flag++;
-			break;
-		case 'O':
-		case 'o':
-			for(j=0,n_list=0;j<(int)strlen(optarg);j++,n_list++)
-				if (n_list<MAX_OPTIONS)
-					list[n_list] = optarg[j];
-			flag++;
-			break;
-		case 'P':
-		case 'p':
-			sscanf (optarg,"%d", &pings);
-			flag++;
-			break;
-		case 'Q':
-		case 'q':
-			check_values = MBLIST_CHECK_OFF_RAW;
-			flag++;
-			break;
-		case 'R':
-		case 'r':
-			mb_get_bounds(optarg, bounds);
-			flag++;
-			break;
-		case 'S':
-		case 's':
-			sscanf (optarg,"%lf", &speedmin);
-			flag++;
-			break;
-		case 'T':
-		case 't':
-			sscanf (optarg,"%lf", &timegap);
-			flag++;
-			break;
-		case 'U':
-		case 'u':
-			if (optarg[0] == 'N')
-				check_nav =MB_YES;
-			else
-			    {
-			    sscanf (optarg,"%d", &check_values);
-			    if (check_values < MBLIST_CHECK_ON
-			      || check_values > MBLIST_CHECK_OFF_FLAGNAN)
-				check_values = MBLIST_CHECK_ON;
-			    }
-			flag++;
-			break;
-		case 'W':
-		case 'w':
-			bathy_in_feet = MB_YES;
-			break;
-		case 'X':
-		case 'x':
-			sscanf(optarg,"%s", output_file);
-			break;
-		case 'Z':
-		case 'z':
-			segment = MB_YES;
-			sscanf (optarg,"%s", segment_tag);
-			flag++;
-			break;
-		case '?':
-			errflg++;
-		}
-
-	/* if error flagged then print it and exit */
-	if (errflg)
-		{
-		fprintf(stderr,"usage: %s\n", usage_message);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		error = MB_ERROR_BAD_USAGE;
-		exit(error);
-		}
-
-	/* print starting message */
-	if (verbose == 1 || help)
-		{
-		fprintf(stderr,"\nProgram %s\n",program_name);
-		fprintf(stderr,"Version %s\n",rcs_id);
-		fprintf(stderr,"MB-system Version %s\n",MB_VERSION);
-		}
-
-	/* print starting debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  Program <%s>\n",program_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Control Parameters:\n");
-		fprintf(stderr,"dbg2       verbose:        %d\n",verbose);
-		fprintf(stderr,"dbg2       help:           %d\n",help);
-		fprintf(stderr,"dbg2       format:         %d\n",format);
-		fprintf(stderr,"dbg2       pings:          %d\n",pings);
-		fprintf(stderr,"dbg2       decimate:       %d\n",decimate);
-		fprintf(stderr,"dbg2       lonflip:        %d\n",lonflip);
-		fprintf(stderr,"dbg2       bounds[0]:      %f\n",bounds[0]);
-		fprintf(stderr,"dbg2       bounds[1]:      %f\n",bounds[1]);
-		fprintf(stderr,"dbg2       bounds[2]:      %f\n",bounds[2]);
-		fprintf(stderr,"dbg2       bounds[3]:      %f\n",bounds[3]);
-		fprintf(stderr,"dbg2       btime_i[0]:     %d\n",btime_i[0]);
-		fprintf(stderr,"dbg2       btime_i[1]:     %d\n",btime_i[1]);
-		fprintf(stderr,"dbg2       btime_i[2]:     %d\n",btime_i[2]);
-		fprintf(stderr,"dbg2       btime_i[3]:     %d\n",btime_i[3]);
-		fprintf(stderr,"dbg2       btime_i[4]:     %d\n",btime_i[4]);
-		fprintf(stderr,"dbg2       btime_i[5]:     %d\n",btime_i[5]);
-		fprintf(stderr,"dbg2       btime_i[6]:     %d\n",btime_i[6]);
-		fprintf(stderr,"dbg2       etime_i[0]:     %d\n",etime_i[0]);
-		fprintf(stderr,"dbg2       etime_i[1]:     %d\n",etime_i[1]);
-		fprintf(stderr,"dbg2       etime_i[2]:     %d\n",etime_i[2]);
-		fprintf(stderr,"dbg2       etime_i[3]:     %d\n",etime_i[3]);
-		fprintf(stderr,"dbg2       etime_i[4]:     %d\n",etime_i[4]);
-		fprintf(stderr,"dbg2       etime_i[5]:     %d\n",etime_i[5]);
-		fprintf(stderr,"dbg2       etime_i[6]:     %d\n",etime_i[6]);
-		fprintf(stderr,"dbg2       speedmin:       %f\n",speedmin);
-		fprintf(stderr,"dbg2       timegap:        %f\n",timegap);
-		fprintf(stderr,"dbg2       file:           %s\n",file);
-		fprintf(stderr,"dbg2       output_file:    %s\n",output_file);
-		fprintf(stderr,"dbg2       ascii:          %d\n",ascii);
-		fprintf(stderr,"dbg2       netcdf:         %d\n",netcdf);
-		fprintf(stderr,"dbg2       netcdf_cdl:     %d\n",netcdf_cdl);
-		fprintf(stderr,"dbg2       segment:        %d\n",segment);
-		fprintf(stderr,"dbg2       segment_tag:    %s\n",segment_tag);
-		fprintf(stderr,"dbg2       delimiter:      %s\n",delimiter);
-		fprintf(stderr,"dbg2       beam_set:       %d\n",beam_set);
-		fprintf(stderr,"dbg2       beam_start:     %d\n",beam_start);
-		fprintf(stderr,"dbg2       beam_end:       %d\n",beam_end);
-		fprintf(stderr,"dbg2       beam_exclude_percent: %d\n",beam_exclude_percent);
-		fprintf(stderr,"dbg2       pixel_set:      %d\n",pixel_set);
-		fprintf(stderr,"dbg2       pixel_start:    %d\n",pixel_start);
-		fprintf(stderr,"dbg2       pixel_end:      %d\n",pixel_end);
-		fprintf(stderr,"dbg2       dump_mode:      %d\n",dump_mode);
-		fprintf(stderr,"dbg2       check_values:   %d\n",check_values);
-		fprintf(stderr,"dbg2       check_nav:      %d\n",check_nav);
-		fprintf(stderr,"dbg2       n_list:         %d\n",n_list);
-		for (i=0;i<n_list;i++)
-			fprintf(stderr,"dbg2         list[%d]:      %c\n",
-						i,list[i]);
-		}
-
-	/* if help desired then print it and exit */
-	if (help)
-		{
-		fprintf(stderr,"\n%s\n",help_message);
-		fprintf(stderr,"\nusage: %s\n", usage_message);
-		exit(error);
-		}
-
-	/* get format if required */
-	if (format == 0)
-		mb_get_format(verbose,read_file,NULL,&format,&error);
-
-	/* set bathymetry scaling */
-	if (bathy_in_feet == MB_YES)
-		bathy_scale = 1.0 / 0.3048;
-	else
-		bathy_scale = 1.0;
-
-	/* determine whether to read one file or a list of files */
-	if (format < 0)
-		read_datalist = MB_YES;
-
-	/* open file list */
-	if (read_datalist == MB_YES)
-	    {
-	    if ((status = mb_datalist_open(verbose,&datalist,
-					    read_file,look_processed,&error)) != MB_SUCCESS)
-		{
-		error = MB_ERROR_OPEN_FAIL;
-		fprintf(stderr,"\nUnable to open data list file: %s\n",
-			read_file);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-	    if ((status = mb_datalist_read(verbose,datalist,
-			    file,&format,&file_weight,&error))
-			    == MB_SUCCESS)
-		read_data = MB_YES;
-	    else
-		read_data = MB_NO;
-	    }
-	/* else copy single filename to be read */
-	else
-	    {
-	    strcpy(file, read_file);
-	    read_data = MB_YES;
-	    }
-
-	/* set the initial along track distance here so */
-	/* it's cummulative over multiple files*/
-	distance_total = 0.0;
-
-	/* initialize output files */
-	status = mb_mallocd(verbose, __FILE__, __LINE__, n_list*sizeof(FILE*), (void **)&output, &error);
-
-	if (netcdf == MB_NO)
-	    {
-	    /* open output file */
-	    if (0 == strncmp("-",output_file,2))
-	      outfile = stdout;
-	    else
-	      outfile = fopen(output_file, "w");
-	    if (NULL == outfile)
-	      {
-		fprintf(stderr,"Could not open file: %s\n", output_file);
-		exit(1);
-	      }
-
-	    /* for non netcdf all output goes to the same file */
-	    for ( i=0; i < n_list; i++)
-	      output[i] = outfile;
-	    }
-	else
-	    {
-	    /* netcdf must be ascii and must not be segmented */
-	    ascii = MB_YES;
-	    segment = MB_NO;
-
-	    /* open CDL file */
-	    if (0 == strncmp("-",output_file,2) && netcdf_cdl == MB_NO)
-	      strcpy(output_file, "mblist.nc");
-	    if (0 == strncmp("-",output_file,2))
-	      {
-		outfile = stdout;
-	      }
-	    else
-	      {
-		strncpy(output_file_temp, output_file, MB_PATH_MAXLINE - 5);
-		if (netcdf_cdl == MB_NO)
-		  strcat(output_file_temp, ".cdl");
-		outfile = fopen(output_file_temp, "w+");
-		if (outfile == NULL)
-		  {
-		    fprintf(stderr, "Unable to open file: %s\n", output_file_temp);
-		    exit(1);
-		  }
-	      }
-
-	    /* output CDL headers */
-	    fprintf(outfile, "netcdf mlist {\n\n\t// ");
-	    for ( i=0; i < argc; i++)
-	      fprintf(outfile, "%s ", argv[i]);
-	    fprintf(outfile, "\n\t// %s\n\n", rcs_id);
-	    fprintf(outfile, "dimensions:\n\ttimestring = 26, timestring_J = 24, timestring_j = 23, \n\t");
-	    fprintf(outfile, "timefields_J = 6,  timefields_j = 5, timefields_t = 7, latm = 13, \n\t");
-
-	    /* find dimensions in format list */
-	    raw_next_value = MB_NO;
-	    for (i=0; i<n_list; i++)
-	    	if (list[i] == '/' || list[i] == '-'
-			|| list[i] == '=' || list[i] == '+') {
-		  // ignore
-		} else if (raw_next_value == MB_NO) {
-		    if (list[i] == '.')
-		        raw_next_value = MB_YES;
-		} else if (list[i] >= '0' && list[i] <= '9')
-		    count = count * 10 + list[i] - '0';
-		else {
-		  raw_next_value = MB_NO;
-		  if (count > 0) {
-		    fprintf(outfile, "%c = %d,  ", list[i], count);
-		    count = 0;
-		  }
-		}
-
-	    fprintf(outfile, "\n\tdata = unlimited ;\n\n");
-	    fprintf(outfile, "variables:\n\t");
-	    fprintf(outfile, ":command_line = \"");
-	    for ( i=0; i < argc; i++)
-	      fprintf(outfile, "%s ", argv[i]);
-	    fprintf(outfile, "\";\n\t:program_version = \"%s\";\n", rcs_id);
-	    fprintf(outfile, "\t:mbsystem_version = \"%s\";\n", MB_VERSION);
-
-	    right_now = time((time_t *)0);
-	    strcpy(date,ctime(&right_now));
-            date[strlen(date)-1] = '\0';
-	    if ((user_ptr = (char *) getenv("USER")) == NULL)
-	      user_ptr = (char *) getenv("LOGNAME");
-	    if (user_ptr != NULL)
-	      strcpy(user,user_ptr);
-	    else
-	      strcpy(user, "unknown");
-	    gethostname(host,128);
-
-	    fprintf(outfile, "\t:run = \"by <%s> on cpu <%s> at <%s>\";\n\n", user, host, date);
-
-
-	    /* get temporary output file for each variable */
-	    for (i=0; i<n_list; i++)
-	      {
-		output[i] = tmpfile();
-		if (output[i] == NULL)
-		  {
-		    fprintf(stderr, "Unable to open temp files\n");
-		    exit(1);
-		  }
-
-		if (raw_next_value == MB_NO)
-		  {
-		switch (list[i])
-		  {
-		  case '/': /* Inverts next simple value */
-		    invert_next_value = MB_YES;
-		    break;
-
-		  case '-': /* Flip sign on next simple value */
-		    signflip_next_value = MB_YES;
-		    break;
-
-		  case '.': /* Raw value next field */
-		    raw_next_value = MB_YES;
-		    break;
-
-		  case '=': /* Port-most value next field -ignored here */
-		    break;
-
-		  case '+': /* Starboard-most value next field - ignored here*/
-		    break;
-
-		  case 'A': /* Average seafloor crosstrack slope */
-		    strcpy(variable, "aslope");
-		    if (signflip_next_value == MB_YES)
-		      strcat(variable, "-");
-		    if (invert_next_value == MB_YES)
-		      strcat(variable, "_");
-
-		    fprintf(output[i], "\t%s = ", variable);
-
-		    fprintf(outfile, "\tfloat %s(data);\n", variable);
-		    fprintf(outfile, "\t\t%s:long_name = \"Average seafloor crosstrack slope\";\n", variable);
-		    fprintf(outfile, "\t\t%s:units = \"", variable);
-		    if (signflip_next_value == MB_YES)
-		      fprintf(outfile, "-");
-		    if (invert_next_value == MB_YES)
-		      fprintf(outfile, "tangent of angle from seafloor to vertical\";\n");
-		    else
-		      fprintf(outfile, "tangent of angle from seafloor to horizontal\";\n");
-
-		    signflip_next_value = MB_NO;
-		    invert_next_value = MB_NO;
-		    break;
-
-		  case 'a': /* Per-beam seafloor crosstrack slope */
-		    strcpy(variable, "bslope");
-		    if (signflip_next_value == MB_YES)
-		      strcat(variable, "-");
-		    if (invert_next_value == MB_YES)
-		      strcat(variable, "_");
-
-		    fprintf(output[i], "\t%s = ", variable);
-
-		    fprintf(outfile, "\tfloat %s(data);\n", variable);
-		    fprintf(outfile, "\t\t%s:long_name = \"Per-beam seafloor crosstrack slope\";\n", variable);
-		    fprintf(outfile, "\t\t%s:units = \"", variable);
-		    if (signflip_next_value == MB_YES)
-		      fprintf(outfile, "-");
-		    if (invert_next_value == MB_YES)
-		      fprintf(outfile, "tangent of angle from seafloor to vertical\";\n");
-		    else
-		      fprintf(outfile, "tangent of angle from seafloor to horizontal\";\n");
-
-		    signflip_next_value = MB_NO;
-		    invert_next_value = MB_NO;
-		    break;
-
-		  case 'B': /* amplitude */
-		    strcpy(variable, "amplitude");
-		    if (signflip_next_value == MB_YES)
-		      strcat(variable, "-");
-		    if (invert_next_value == MB_YES)
-		      strcat(variable, "_");
-
-		    fprintf(output[i], "\t%s = ", variable);
-
-		    fprintf(outfile, "\tfloat %s(data);\n", variable);
-		    fprintf(outfile, "\t\t%s:long_name = \"Amplitude\";\n", variable);
-		    fprintf(outfile, "\t\t%s:units = \"", variable);
-		    if (signflip_next_value == MB_YES)
-		      fprintf(outfile, "-");
-		    if (invert_next_value == MB_YES)
-		      fprintf(outfile, "1/");
-		    if (format == MBF_EM300RAW || format == MBF_EM300MBA)
-		      fprintf(outfile, "dB + 64\";\n");
-		    else
-		      fprintf(outfile, "backscatter\";\n");
-
-		    signflip_next_value = MB_NO;
-		    invert_next_value = MB_NO;
-
-		    break;
-
-		  case 'b': /* sidescan */
-		    strcpy(variable, "sidescan");
-		    if (signflip_next_value == MB_YES)
-		      strcat(variable, "-");
-		    if (invert_next_value == MB_YES)
-		      strcat(variable, "_");
-
-		    fprintf(output[i], "\t%s = ", variable);
-
-		    fprintf(outfile, "\tfloat %s(data);\n", variable);
-		    fprintf(outfile, "\t\t%s:long_name = \"sidescan\";\n", variable);
-		    fprintf(outfile, "\t\t%s:units = \"", variable);
-		    if (signflip_next_value == MB_YES)
-		      fprintf(outfile, "-");
-		    if (invert_next_value == MB_YES)
-		      fprintf(outfile, "1/");
-		    if (format == MBF_EM300RAW || format == MBF_EM300MBA)
-		      fprintf(outfile, "dB + 64\";\n");
-		    else
-		      fprintf(outfile, "backscatter\";\n");
-
-		    signflip_next_value = MB_NO;
-		    invert_next_value = MB_NO;
-
-		    break;
-
-		  case 'C': /* Sonar altitude (m) */
-		    strcpy(variable, "altitude");
-		    if (signflip_next_value == MB_YES)
-		      strcat(variable, "-");
-		    if (invert_next_value == MB_YES)
-		      strcat(variable, "_");
-
-		    fprintf(output[i], "\t%s = ", variable);
-
-		    fprintf(outfile, "\tfloat %s(data);\n", variable);
-		    fprintf(outfile, "\t\t%s:long_name = \"Sonar altitude\";\n", variable);
-		    fprintf(outfile, "\t\t%s:units = \"", variable);
-		    if (signflip_next_value == MB_YES)
-		      fprintf(outfile, "-");
-		    if (invert_next_value == MB_YES)
-		      fprintf(outfile, "1/");
-		    fprintf(outfile, "m\";\n");
-
-		    signflip_next_value = MB_NO;
-		    invert_next_value = MB_NO;
-
-		    break;
-
-		  case 'c': /* Sonar transducer depth (m) */
-		    strcpy(variable, "transducer");
-		    if (signflip_next_value == MB_YES)
-		      strcat(variable, "-");
-		    if (invert_next_value == MB_YES)
-		      strcat(variable, "_");
-
-		    fprintf(output[i], "\t%s = ", variable);
-
-		    fprintf(outfile, "\tfloat %s(data);\n", variable);
-		    fprintf(outfile, "\t\t%s:long_name = \"Sonar transducer depth\";\n", variable);
-		    fprintf(outfile, "\t\t%s:units = \"", variable);
-		    if (signflip_next_value == MB_YES)
-		      fprintf(outfile, "-");
-		    if (invert_next_value == MB_YES)
-		      fprintf(outfile, "1/");
-		    fprintf(outfile, "m\";\n");
-
-		    signflip_next_value = MB_NO;
-		    invert_next_value = MB_NO;
-		    break;
-
-		  case 'D': /* acrosstrack dist. */
-		  case 'd':
-		    strcpy(variable, "acrosstrack");
-		    if (signflip_next_value == MB_YES)
-		      strcat(variable, "-");
-		    if (invert_next_value == MB_YES)
-		      strcat(variable, "_");
-
-		    fprintf(output[i], "\t%s = ", variable);
-
-		    fprintf(outfile, "\tfloat %s(data);\n", variable);
-		    fprintf(outfile, "\t\t%s:long_name = \"Acrosstrack distance\";\n", variable);
-		    fprintf(outfile, "\t\t%s:units = \"", variable);
-		    if (signflip_next_value == MB_YES)
-		      fprintf(outfile, "-");
-		    if (invert_next_value == MB_YES)
-		      fprintf(outfile, "1/");
-		    if (bathy_in_feet == MB_YES)
-		      fprintf(outfile, "f\";\n");
-		    else
-		      fprintf(outfile, "m\";\n");
-
-		    signflip_next_value = MB_NO;
-		    invert_next_value = MB_NO;
-		    break;
-
-		  case 'E': /* alongtrack dist. */
-		  case 'e':
-		    strcpy(variable, "alongtrack");
-		    if (signflip_next_value == MB_YES)
-		      strcat(variable, "-");
-		    if (invert_next_value == MB_YES)
-		      strcat(variable, "_");
-
-		    fprintf(output[i], "\t%s = ", variable);
-
-		    fprintf(outfile, "\tfloat %s(data);\n", variable);
-		    fprintf(outfile, "\t\t%s:long_name = \"Alongtrack distance\";\n", variable);
-		    fprintf(outfile, "\t\t%s:units = \"", variable);
-		    if (signflip_next_value == MB_YES)
-		      fprintf(outfile, "-");
-		    if (invert_next_value == MB_YES)
-		      fprintf(outfile, "1/");
-		    if (bathy_in_feet == MB_YES)
-		      fprintf(outfile, "f\";\n");
-		    else
-		      fprintf(outfile, "m\";\n");
-
-		    signflip_next_value = MB_NO;
-		    invert_next_value = MB_NO;
-
-		    break;
-
-		  case 'F': /* beamflag (numeric only for netcdf) */
-		  case 'f':
-		    strcpy(variable, "beamflag");
-		    if (signflip_next_value == MB_YES)
-		      strcat(variable, "-");
-		    if (invert_next_value == MB_YES)
-		      strcat(variable, "_");
-
-		    fprintf(output[i], "\t%s = ", variable);
-
-		    fprintf(outfile, "\tfloat %s(data);\n", variable);
-		    fprintf(outfile, "\t\t%s:long_name = \"Beamflag\";\n", variable);
-		    fprintf(outfile, "\t\t%s:units = \"", variable);
-		    if (signflip_next_value == MB_YES)
-		      fprintf(outfile, "-");
-		    if (invert_next_value == MB_YES)
-		      fprintf(outfile, "1/");
-		    if (bathy_in_feet == MB_YES)
-		      fprintf(outfile, "f\";\n");
-		    else
-		      fprintf(outfile, "m\";\n");
-
-		    signflip_next_value = MB_NO;
-		    invert_next_value = MB_NO;
-
-		    break;
-
-		  case 'G': /* flat bottom grazing angle */
-		    strcpy(variable, "flatgrazing");
-		    if (signflip_next_value == MB_YES)
-		      strcat(variable, "-");
-		    if (invert_next_value == MB_YES)
-		      strcat(variable, "_");
-
-		    fprintf(output[i], "\t%s = ", variable);
-
-		    fprintf(outfile, "\tfloat %s(data);\n", variable);
-		    fprintf(outfile, "\t\t%s:long_name = \"Flat bottom grazing angle\";\n", variable);
-		    fprintf(outfile, "\t\t%s:units = \"", variable);
-		    if (signflip_next_value == MB_YES)
-		      fprintf(outfile, "-");
-		    if (invert_next_value == MB_YES)
-		      fprintf(outfile, "tangent of angle from beam to vertical\";\n");
-		    else
-		      fprintf(outfile, "tangent of angle from beam to horizontal\";\n");
-
-		    signflip_next_value = MB_NO;
-		    invert_next_value = MB_NO;
-		    break;
-
-		  case 'g': /* grazing angle using slope */
-		    strcpy(variable, "grazing");
-		    if (signflip_next_value == MB_YES)
-		      strcat(variable, "-");
-		    if (invert_next_value == MB_YES)
-		      strcat(variable, "_");
-
-		    fprintf(output[i], "\t%s = ", variable);
-
-		    fprintf(outfile, "\tfloat %s(data);\n", variable);
-		    fprintf(outfile, "\t\t%s:long_name = \"Grazing angle using slope\";\n", variable);
-		    fprintf(outfile, "\t\t%s:units = \"", variable);
-		    if (signflip_next_value == MB_YES)
-		      fprintf(outfile, "-");
-		    if (invert_next_value == MB_YES)
-		      fprintf(outfile, "tangent of angle from beam to perpendicular to seafloor\";\n");
-		    else
-		      fprintf(outfile, "tangent of angle from beam to seafloor\";\n");
-
-		    signflip_next_value = MB_NO;
-		    invert_next_value = MB_NO;
-		    break;
-
-		  case 'H': /* heading */
-		    strcpy(variable, "heading");
-		    if (signflip_next_value == MB_YES)
-		      strcat(variable, "-");
-		    if (invert_next_value == MB_YES)
-		      strcat(variable, "_");
-
-		    fprintf(output[i], "\t%s = ", variable);
-
-		    fprintf(outfile, "\tfloat %s(data);\n", variable);
-		    fprintf(outfile, "\t\t%s:long_name = \"Heading\";\n", variable);
-		    fprintf(outfile, "\t\t%s:units = \"", variable);
-		    if (signflip_next_value == MB_YES)
-		      fprintf(outfile, "-");
-		    if (invert_next_value == MB_YES)
-		      fprintf(outfile, "1/");
-		    fprintf(outfile, "degrees true\";\n");
-
-		    signflip_next_value = MB_NO;
-		    invert_next_value = MB_NO;
-		    break;
-
-		  case 'h': /* course */
-		    strcpy(variable, "course");
-		    if (signflip_next_value == MB_YES)
-		      strcat(variable, "-");
-		    if (invert_next_value == MB_YES)
-		      strcat(variable, "_");
-
-		    fprintf(output[i], "\t%s = ", variable);
-
-		    fprintf(outfile, "\tfloat %s(data);\n", variable);
-		    fprintf(outfile, "\t\t%s:long_name = \"Course\";\n", variable);
-		    fprintf(outfile, "\t\t%s:units = \"", variable);
-		    if (signflip_next_value == MB_YES)
-		      fprintf(outfile, "-");
-		    if (invert_next_value == MB_YES)
-		      fprintf(outfile, "1/");
-		    fprintf(outfile, "degrees true\";\n");
-
-		    signflip_next_value = MB_NO;
-		    invert_next_value = MB_NO;
-		    break;
-
-		  case 'J': /* time string */
-		    strcpy(variable, "time_J");
-
-		    fprintf(output[i], "\t%s = ", variable);
-
-		    fprintf(outfile, "\tlong %s(data,timefields_J);\n", variable);
-		    fprintf(outfile, "\t\t%s:long_name = \"Time - year julian_day hour minute seconds\";\n", variable);
-		    fprintf(outfile, "\t\t%s:units = \"", variable);
-
-		    fprintf(outfile, "year, julian day, hour, minute, second, nanosecond\";\n");
-		    break;
-
-		  case 'j': /* time string */
-		    strcpy(variable, "time_j");
-
-		    fprintf(output[i], "\t%s = ", variable);
-
-		    fprintf(outfile, "\tlong %s(data,timefields_j);\n", variable);
-		    fprintf(outfile, "\t\t%s:long_name = \"Time - year julian_day minute seconds\";\n", variable);
-		    fprintf(outfile, "\t\t%s:units = \"", variable);
-
-		    fprintf(outfile, "year, julian day, minute, second, nanosecond\";\n");
-
-		    break;
-
-		  case 'L': /* along-track distance (km) */
-		    strcpy(variable, "along_track");
-		    if (signflip_next_value == MB_YES)
-		      strcat(variable, "-");
-		    if (invert_next_value == MB_YES)
-		      strcat(variable, "_");
-
-		    fprintf(output[i], "\t%s = ", variable);
-
-		    fprintf(outfile, "\tfloat %s(data);\n", variable);
-		    fprintf(outfile, "\t\t%s:long_name = \"Alongtrack distance\";\n", variable);
-		    fprintf(outfile, "\t\t%s:units = \"", variable);
-		    if (signflip_next_value == MB_YES)
-		      fprintf(outfile, "-");
-		    if (invert_next_value == MB_YES)
-		      fprintf(outfile, "1/");
-		    fprintf(outfile, "km\";\n");
-
-		    signflip_next_value = MB_NO;
-		    invert_next_value = MB_NO;
-
-		    break;
-
-		  case 'l': /* along-track distance (m) */
-		    strcpy(variable, "along_track_m");
-		    if (signflip_next_value == MB_YES)
-		      strcat(variable, "-");
-		    if (invert_next_value == MB_YES)
-		      strcat(variable, "_");
-
-		    fprintf(output[i], "\t%s = ", variable);
-
-		    fprintf(outfile, "\tfloat %s(data);\n", variable);
-		    fprintf(outfile, "\t\t%s:long_name = \"Alongtrack distance\";\n", variable);
-		    fprintf(outfile, "\t\t%s:units = \"", variable);
-		    if (signflip_next_value == MB_YES)
-		      fprintf(outfile, "-");
-		    if (invert_next_value == MB_YES)
-		      fprintf(outfile, "1/");
-		    fprintf(outfile, "m\";\n");
-
-		    signflip_next_value = MB_NO;
-		    invert_next_value = MB_NO;
-		    break;
-
-		  case 'M': /* Decimal unix seconds since
-						1/1/70 00:00:00 */
-		    strcpy(variable, "unix_time");
-		    if (signflip_next_value == MB_YES)
-		      strcat(variable, "-");
-		    if (invert_next_value == MB_YES)
-		      strcat(variable, "_");
-
-		    fprintf(output[i], "\t%s = ", variable);
-
-		    fprintf(outfile, "\tdouble %s(data);\n", variable);
-		    fprintf(outfile, "\t\t%s:long_name = \"Seconds since 1/1/70 00:00:00\";\n", variable);
-		    fprintf(outfile, "\t\t%s:units = \"", variable);
-		    if (signflip_next_value == MB_YES)
-		      fprintf(outfile, "-");
-		    if (invert_next_value == MB_YES)
-		      fprintf(outfile, "1/");
-		    fprintf(outfile, "s\";\n");
-
-		    signflip_next_value = MB_NO;
-		    invert_next_value = MB_NO;
-		    break;
-
-		  case 'm': /* time in decimal seconds since
-						first record */
-
-		    strcpy(variable, "survey_time");
-		    if (signflip_next_value == MB_YES)
-		      strcat(variable, "-");
-		    if (invert_next_value == MB_YES)
-		      strcat(variable, "_");
-
-		    fprintf(output[i], "\t%s = ", variable);
-
-		    fprintf(outfile, "\tdouble %s(data);\n", variable);
-		    fprintf(outfile, "\t\t%s:long_name = \"Seconds since first record\";\n", variable);
-		    fprintf(outfile, "\t\t%s:units = \"", variable);
-		    if (signflip_next_value == MB_YES)
-		      fprintf(outfile, "-");
-		    if (invert_next_value == MB_YES)
-		      fprintf(outfile, "1/");
-		    fprintf(outfile, "s\";\n");
-
-		    signflip_next_value = MB_NO;
-		    invert_next_value = MB_NO;
-		    break;
-
-		  case 'N': /* ping counter */
-		    strcpy(variable, "ping");
-
-		    fprintf(output[i], "\t%s = ", variable);
-
-		    fprintf(outfile, "\tlong %s(data);\n", variable);
-		    fprintf(outfile, "\t\t%s:long_name = \"Ping counter\";\n", variable);
-		    fprintf(outfile, "\t\t%s:units = \"", variable);
-		    fprintf(outfile, "pings\";\n");
-		    break;
-
-		  case 'P': /* pitch */
-		    strcpy(variable, "pitch");
-		    if (signflip_next_value == MB_YES)
-		      strcat(variable, "-");
-		    if (invert_next_value == MB_YES)
-		      strcat(variable, "_");
-
-		    fprintf(output[i], "\t%s = ", variable);
-
-		    fprintf(outfile, "\tfloat %s(data);\n", variable);
-		    fprintf(outfile, "\t\t%s:long_name = \"Pitch\";\n", variable);
-		    fprintf(outfile, "\t\t%s:units = \"", variable);
-		    if (signflip_next_value == MB_YES)
-		      fprintf(outfile, "-");
-		    if (invert_next_value == MB_YES)
-		      fprintf(outfile, "1/");
-		    fprintf(outfile, "degrees from horizontal\";\n");
-
-		    signflip_next_value = MB_NO;
-		    invert_next_value = MB_NO;
-		    break;
-
-		  case 'p': /* draft */
-		    strcpy(variable, "draft");
-		    if (signflip_next_value == MB_YES)
-		      strcat(variable, "-");
-		    if (invert_next_value == MB_YES)
-		      strcat(variable, "_");
-
-		    fprintf(output[i], "\t%s = ", variable);
-
-		    fprintf(outfile, "\tfloat %s(data);\n", variable);
-		    fprintf(outfile, "\t\t%s:long_name = \"Draft\";\n", variable);
-		    fprintf(outfile, "\t\t%s:units = \"", variable);
-		    if (signflip_next_value == MB_YES)
-		      fprintf(outfile, "-");
-		    if (invert_next_value == MB_YES)
-		      fprintf(outfile, "1/");
-		    fprintf(outfile, "m\";\n");
-
-		    signflip_next_value = MB_NO;
-		    invert_next_value = MB_NO;
-		    break;
-
-		  case 'q': /* bottom detect type */
-		  case 'Q': /* bottom detect type */
-		    strcpy(variable, "bottom_detect_type");
-
-		    fprintf(output[i], "\t%s = ", variable);
-
-		    fprintf(outfile, "\tlong %s(data);\n", variable);
-		    fprintf(outfile, "\t\t%s:long_name = \"Bottom detect type\";\n", variable);
-		    fprintf(outfile, "\t\t%s:units = \"", variable);
-		    fprintf(outfile, "0=unknown,1=amplitude,2=phase\";\n");
-		    break;
-
-		  case 'R': /* roll */
-		    strcpy(variable, "roll");
-		    if (signflip_next_value == MB_YES)
-		      strcat(variable, "-");
-		    if (invert_next_value == MB_YES)
-		      strcat(variable, "_");
-
-		    fprintf(output[i], "\t%s = ", variable);
-
-		    fprintf(outfile, "\tfloat %s(data);\n", variable);
-		    fprintf(outfile, "\t\t%s:long_name = \"Roll\";\n", variable);
-		    fprintf(outfile, "\t\t%s:units = \"", variable);
-		    if (signflip_next_value == MB_YES)
-		      fprintf(outfile, "-");
-		    if (invert_next_value == MB_YES)
-		      fprintf(outfile, "1/");
-		    fprintf(outfile, "degrees from horizontal\";\n");
-
-		    signflip_next_value = MB_NO;
-		    invert_next_value = MB_NO;
-		    break;
-
-		  case 'r': /* heave */
-		    strcpy(variable, "heave");
-		    if (signflip_next_value == MB_YES)
-		      strcat(variable, "-");
-		    if (invert_next_value == MB_YES)
-		      strcat(variable, "_");
-
-		    fprintf(output[i], "\t%s = ", variable);
-
-		    fprintf(outfile, "\tfloat %s(data);\n", variable);
-		    fprintf(outfile, "\t\t%s:long_name = \"Heave\";\n", variable);
-		    fprintf(outfile, "\t\t%s:units = \"", variable);
-		    if (signflip_next_value == MB_YES)
-		      fprintf(outfile, "-");
-		    if (invert_next_value == MB_YES)
-		      fprintf(outfile, "1/");
-		    fprintf(outfile, "m\";\n");
-
-		    signflip_next_value = MB_NO;
-		    invert_next_value = MB_NO;
-		    break;
-
-		  case 'S': /* speed */
-		    strcpy(variable, "speed");
-		    if (signflip_next_value == MB_YES)
-		      strcat(variable, "-");
-		    if (invert_next_value == MB_YES)
-		      strcat(variable, "_");
-
-		    fprintf(output[i], "\t%s = ", variable);
-
-		    fprintf(outfile, "\tfloat %s(data);\n", variable);
-		    fprintf(outfile, "\t\t%s:long_name = \"Speed\";\n", variable);
-		    fprintf(outfile, "\t\t%s:units = \"", variable);
-		    if (signflip_next_value == MB_YES)
-		      fprintf(outfile, "-");
-		    if (invert_next_value == MB_YES)
-		      fprintf(outfile, "1/");
-		    fprintf(outfile, "km/hr\";\n");
-
-		    signflip_next_value = MB_NO;
-		    invert_next_value = MB_NO;
-		    break;
-
-		  case 's': /* speed made good */
-		    strcpy(variable, "speed_made_good");
-		    if (signflip_next_value == MB_YES)
-		      strcat(variable, "-");
-		    if (invert_next_value == MB_YES)
-		      strcat(variable, "_");
-
-		    fprintf(output[i], "\t%s = ", variable);
-
-		    fprintf(outfile, "\tfloat %s(data);\n", variable);
-		    fprintf(outfile, "\t\t%s:long_name = \"Speed made good\";\n", variable);
-		    fprintf(outfile, "\t\t%s:units = \"", variable);
-		    if (signflip_next_value == MB_YES)
-		      fprintf(outfile, "-");
-		    if (invert_next_value == MB_YES)
-		      fprintf(outfile, "1/");
-		    fprintf(outfile, "km/hr\";\n");
-
-		    signflip_next_value = MB_NO;
-		    invert_next_value = MB_NO;
-		    break;
-
-		  case 'T': /* yyyy/mm/dd/hh/mm/ss time string */
-		    strcpy(variable, "time_T");
-
-		    fprintf(output[i], "\t%s = ", variable);
-
-		    fprintf(outfile, "\tchar %s(data,timestring);\n", variable);
-		    fprintf(outfile, "\t\t%s:long_name = \"Time string - year/month/day/hour/minute/seconds\";\n", variable);
-		    fprintf(outfile, "\t\t%s:units = \"", variable);
-
-		    fprintf(outfile, "yyyy/MM/dd/hh/mm/ss.ssssss\";\n");
-		    break;
-
-		  case 't': /* yyyy mm dd hh mm ss time string */
-		    strcpy(variable, "time_t");
-
-		    fprintf(output[i], "\t%s = ", variable);
-
-		    fprintf(outfile, "\tlong %s(data,timefields_t);\n", variable);
-		    fprintf(outfile, "\t\t%s:long_name = \"Time - year month day hour minute seconds\";\n", variable);
-		    fprintf(outfile, "\t\t%s:units = \"", variable);
-
-		    fprintf(outfile, "year, month, day, hour, minute, second, nanosecond\";\n");
-		    break;
-
-		  case 'U': /* unix time in seconds since 1/1/70 00:00:00 */
-		    strcpy(variable, "unix_time_s");
-
-		    fprintf(output[i], "\t%s = ", variable);
-
-		    fprintf(outfile, "\tlong %s(data);\n", variable);
-		    fprintf(outfile, "\t\t%s:long_name = \"Integer seconds since 1/1/70 00:00:00\";\n", variable);
-		    fprintf(outfile, "\t\t%s:units = \"", variable);
-		    fprintf(outfile, "s\";\n");
-		    break;
-
-		  case 'u': /* time in seconds since first record */
-		    strcpy(variable, "survey_time_s");
-
-		    fprintf(output[i], "\t%s = ", variable);
-
-		    fprintf(outfile, "\tlong %s(data);\n", variable);
-		    fprintf(outfile, "\t\t%s:long_name = \"Integer seconds since first record\";\n", variable);
-		    fprintf(outfile, "\t\t%s:units = \"", variable);
-		    fprintf(outfile, "s\";\n");
-		    break;
-
-		  case 'V': /* time in seconds since last ping */
-		  case 'v':
-		    strcpy(variable, "ping_time");
-
-		    fprintf(output[i], "\t%s = ", variable);
-
-		    fprintf(outfile, "\tfloat %s(data);\n", variable);
-		    fprintf(outfile, "\t\t%s:long_name = \"Seconds since last ping\";\n", variable);
-		    fprintf(outfile, "\t\t%s:units = \"", variable);
-		    fprintf(outfile, "s\";\n");
-		    break;
-
-		  case 'X': /* longitude decimal degrees */
-		    strcpy(variable, "longitude");
-		    if (signflip_next_value == MB_YES)
-		      strcat(variable, "-");
-		    if (invert_next_value == MB_YES)
-		      strcat(variable, "_");
-
-		    fprintf(output[i], "\t%s = ", variable);
-
-		    fprintf(outfile, "\tdouble %s(data);\n", variable);
-		    fprintf(outfile, "\t\t%s:long_name = \"Longitude\";\n", variable);
-		    fprintf(outfile, "\t\t%s:units = \"", variable);
-		    if (signflip_next_value == MB_YES)
-		      fprintf(outfile, "-");
-		    if (invert_next_value == MB_YES)
-		      fprintf(outfile, "1/");
-		    fprintf(outfile, "degrees\";\n");
-
-		    signflip_next_value = MB_NO;
-		    invert_next_value = MB_NO;
-		    break;
-
-		  case 'x': /* longitude degress + decimal minutes */
-		    strcpy(variable, "longitude_minutes");
-
-		    fprintf(output[i], "\t%s = ", variable);
-
-		    fprintf(outfile, "\tchar %s(data,latm);\n", variable);
-		    fprintf(outfile, "\t\t%s:long_name = \"Longitude - decimal minutes\";\n", variable);
-		    fprintf(outfile, "\t\t%s:units = \"", variable);
-
-		    fprintf(outfile, "ddd mm.mmmmmH\";\n");
-		    break;
-
-		  case 'Y': /* latitude decimal degrees */
-		    strcpy(variable, "latitude");
-		    if (signflip_next_value == MB_YES)
-		      strcat(variable, "-");
-		    if (invert_next_value == MB_YES)
-		      strcat(variable, "_");
-
-		    fprintf(output[i], "\t%s = ", variable);
-
-		    fprintf(outfile, "\tdouble %s(data);\n", variable);
-		    fprintf(outfile, "\t\t%s:long_name = \"Latitude\";\n", variable);
-		    fprintf(outfile, "\t\t%s:units = \"", variable);
-		    if (signflip_next_value == MB_YES)
-		      fprintf(outfile, "-");
-		    if (invert_next_value == MB_YES)
-		      fprintf(outfile, "1/");
-		    fprintf(outfile, "degrees\";\n");
-
-		    signflip_next_value = MB_NO;
-		    invert_next_value = MB_NO;
-		    break;
-
-		  case 'y': /* latitude degrees + decimal minutes */
-		    strcpy(variable, "latitude_minutes");
-
-		    fprintf(output[i], "\t%s = ", variable);
-
-		    fprintf(outfile, "\tchar %s(data,latm);\n", variable);
-		    fprintf(outfile, "\t\t%s:long_name = \"Latitude - decimal minutes\";\n", variable);
-		    fprintf(outfile, "\t\t%s:units = \"", variable);
-
-		    fprintf(outfile, "ddd mm.mmmmmH\";\n");
-		    break;
-
-		  case 'Z': /* topography */
-		    strcpy(variable, "topography");
-		    if (signflip_next_value == MB_YES)
-		      strcat(variable, "-");
-		    if (invert_next_value == MB_YES)
-		      strcat(variable, "_");
-
-		    fprintf(output[i], "\t%s = ", variable);
-
-		    fprintf(outfile, "\tfloat %s(data);\n", variable);
-		    fprintf(outfile, "\t\t%s:long_name = \"Topography\";\n", variable);
-		    fprintf(outfile, "\t\t%s:units = \"", variable);
-		    if (signflip_next_value == MB_YES)
-		      fprintf(outfile, "-");
-		    if (invert_next_value == MB_YES)
-		      fprintf(outfile, "1/");
-		    if (bathy_in_feet == MB_YES)
-		      fprintf(outfile, "f\";\n");
-		    else
-		      fprintf(outfile, "m\";\n");
-
-		    signflip_next_value = MB_NO;
-		    invert_next_value = MB_NO;
-		    break;
-
-		  case 'z': /* depth */
-		    strcpy(variable, "depth");
-		    if (signflip_next_value == MB_YES)
-		      strcat(variable, "-");
-		    if (invert_next_value == MB_YES)
-		      strcat(variable, "_");
-
-		    fprintf(output[i], "\t%s = ", variable);
-
-		    fprintf(outfile, "\tfloat %s(data);\n", variable);
-		    fprintf(outfile, "\t\t%s:long_name = \"Depth\";\n", variable);
-		    fprintf(outfile, "\t\t%s:units = \"", variable);
-		    if (signflip_next_value == MB_YES)
-		      fprintf(outfile, "-");
-		    if (invert_next_value == MB_YES)
-		      fprintf(outfile, "1/");
-		    if (bathy_in_feet == MB_YES)
-		      fprintf(outfile, "f\";\n");
-		    else
-		      fprintf(outfile, "m\";\n");
-
-		    signflip_next_value = MB_NO;
-		    invert_next_value = MB_NO;
-		    break;
-
-		  case '#': /* beam number */
-		    strcpy(variable, "beam");
-
-		    fprintf(output[i], "\t%s = ", variable);
-
-		    fprintf(outfile, "\tlong %s(data);\n", variable);
-		    fprintf(outfile, "\t\t%s:long_name = \"Beam number\";\n", variable);
-		    fprintf(outfile, "\t\t%s:units = \"", variable);
-		    fprintf(outfile, "number\";\n");
-		    break;
-		  }
-		  }
-		else
-		  {
-		switch (list[i])
-		  {
-		  case '/': /* Inverts next simple value */
-		    invert_next_value = MB_YES;
-		    break;
-
-		  case '-': /* Flip sign on next simple value */
-		    signflip_next_value = MB_YES;
-		    break;
-
-		  case '.': /* Raw value next field */
-		    raw_next_value = MB_YES;
-		    count = 0;
-		    break;
-
-		  case '=': /* Port-most value next field -ignored here */
-		    break;
-
-		  case '+': /* Starboard-most value next field - ignored here*/
-		    break;
-
-		  case '0':
-		  case '1':
-		  case '2':
-		  case '3':
-		  case '4':
-		  case '5':
-		  case '6':
-		  case '7':
-		  case '8':
-		  case '9':
-		    	count = count * 10 + list[i] - '0';
-			break;
-
-		  case 'A': /* backscatter */
-			strcpy(variable, "backscatter");
-			if (signflip_next_value == MB_YES)
-			  strcat(variable, "-");
-			if (invert_next_value == MB_YES)
-			  strcat(variable, "_");
-
-			fprintf(output[i], "\t%s = ", variable);
-
-			fprintf(outfile, "\tfloat %s(data);\n", variable);
-			fprintf(outfile, "\t\t%s:long_name = \"Backscatter\";\n", variable);
-			fprintf(outfile, "\t\t%s:units = \"", variable);
-			if (signflip_next_value == MB_YES)
-			  fprintf(outfile, "-");
-			if (invert_next_value == MB_YES)
-			  fprintf(outfile, "1/");
-			fprintf(outfile, "dB\";\n");
-
-			signflip_next_value = MB_NO;
-			invert_next_value = MB_NO;
-			raw_next_value = MB_NO;
-			break;
-
-		  case 'a': /* absorption */
-			strcpy(variable, "absorption");
-			if (signflip_next_value == MB_YES)
-			  strcat(variable, "-");
-			if (invert_next_value == MB_YES)
-			  strcat(variable, "_");
-
-			fprintf(output[i], "\t%s = ", variable);
-
-			fprintf(outfile, "\tfloat %s(data);\n", variable);
-			fprintf(outfile, "\t\t%s:long_name = \"Mean absorption\";\n", variable);
-			fprintf(outfile, "\t\t%s:units = \"", variable);
-			if (signflip_next_value == MB_YES)
-			  fprintf(outfile, "-");
-			if (invert_next_value == MB_YES)
-			  fprintf(outfile, "1/");
-			fprintf(outfile, "dB/km\";\n");
-
-			signflip_next_value = MB_NO;
-			invert_next_value = MB_NO;
-			raw_next_value = MB_NO;
-			break;
-
-		  case 'B': /* BSN - Normal incidence backscatter */
-			strcpy(variable, "bsn");
-			if (signflip_next_value == MB_YES)
-			  strcat(variable, "-");
-			if (invert_next_value == MB_YES)
-			  strcat(variable, "_");
-
-			fprintf(output[i], "\t%s = ", variable);
-
-			fprintf(outfile, "\tfloat %s(data);\n", variable);
-			fprintf(outfile, "\t\t%s:long_name = \"Normal incidence backscatter\";\n", variable);
-			fprintf(outfile, "\t\t%s:units = \"", variable);
-			if (signflip_next_value == MB_YES)
-			  fprintf(outfile, "-");
-			if (invert_next_value == MB_YES)
-			  fprintf(outfile, "1/");
-			fprintf(outfile, "dB\";\n");
-
-			signflip_next_value = MB_NO;
-			invert_next_value = MB_NO;
-			raw_next_value = MB_NO;
-			break;
-
-		  case 'b': /* BSO - Oblique backscatter */
-			strcpy(variable, "bso");
-			if (signflip_next_value == MB_YES)
-			  strcat(variable, "-");
-			if (invert_next_value == MB_YES)
-			  strcat(variable, "_");
-
-			fprintf(output[i], "\t%s = ", variable);
-
-			fprintf(outfile, "\tfloat %s(data);\n", variable);
-			fprintf(outfile, "\t\t%s:long_name = \"Oblique backscatter\";\n", variable);
-			fprintf(outfile, "\t\t%s:units = \"", variable);
-			if (signflip_next_value == MB_YES)
-			  fprintf(outfile, "-");
-			if (invert_next_value == MB_YES)
-			  fprintf(outfile, "1/");
-			fprintf(outfile, "dB\";\n");
-
-			signflip_next_value = MB_NO;
-			invert_next_value = MB_NO;
-			raw_next_value = MB_NO;
-			break;
-
-		  case 'c': /* mean backscatter */
-			strcpy(variable, "mback");
-			if (signflip_next_value == MB_YES)
-			  strcat(variable, "-");
-			if (invert_next_value == MB_YES)
-			  strcat(variable, "_");
-
-			fprintf(output[i], "\t%s = ", variable);
-
-			fprintf(outfile, "\tfloat %s(data);\n", variable);
-			fprintf(outfile, "\t\t%s:long_name = \"Mean backscatter\";\n", variable);
-			fprintf(outfile, "\t\t%s:units = \"", variable);
-			if (signflip_next_value == MB_YES)
-			  fprintf(outfile, "-");
-			if (invert_next_value == MB_YES)
-			  fprintf(outfile, "1/");
-			if (format == MBF_EM300RAW || format == MBF_EM300MBA)
-			  fprintf(outfile, "dB + 64\";\n");
-			else
-			  fprintf(outfile, "backscatter\";\n");
-
-			signflip_next_value = MB_NO;
-			invert_next_value = MB_NO;
-			raw_next_value = MB_NO;
-			break;
-
-		  case 'd': /* beam depression angle */
-			strcpy(variable, "depression");
-			if (signflip_next_value == MB_YES)
-			  strcat(variable, "-");
-			if (invert_next_value == MB_YES)
-			  strcat(variable, "_");
-
-			fprintf(output[i], "\t%s = ", variable);
-
-			fprintf(outfile, "\tfloat %s(data);\n", variable);
-			fprintf(outfile, "\t\t%s:long_name = \"Beam depression angle\";\n", variable);
-			fprintf(outfile, "\t\t%s:units = \"", variable);
-			if (signflip_next_value == MB_YES)
-			  fprintf(outfile, "-");
-			if (invert_next_value == MB_YES)
-			  fprintf(outfile, "1/");
-			fprintf(outfile, "degrees\";\n");
-
-			signflip_next_value = MB_NO;
-			invert_next_value = MB_NO;
-			raw_next_value = MB_NO;
-			break;
-
-		  case 'F': /* filename */
-		    	strcpy(variable, "filename");
-
-			fprintf(output[i], "\t%s = ", variable);
-
-			fprintf(outfile, "\tchar %s(data,pathsize);\n", variable);
-			fprintf(outfile, "\t\t%s:long_name = \"Name of swath data file\";\n", variable);
-			fprintf(outfile, "\t\t%s:units = \"", variable);
-
-			fprintf(outfile, "file name\";\n");
-
-			signflip_next_value = MB_NO;
-			invert_next_value = MB_NO;
-			raw_next_value = MB_NO;
-			break;
-
-		  case 'f': /* format */
-		    	strcpy(variable, "format");
-
-			fprintf(output[i], "\t%s = ", variable);
-
-			fprintf(outfile, "\tshort %s(data);\n", variable);
-			fprintf(outfile, "\t\t%s:long_name = \"MBsystem file format number\";\n", variable);
-			fprintf(outfile, "\t\t%s:units = \"", variable);
-
-			fprintf(outfile, "see mbformat\";\n");
-
-			signflip_next_value = MB_NO;
-			invert_next_value = MB_NO;
-			raw_next_value = MB_NO;
-			break;
-
-		  case 'G': /* TVG start */
-			strcpy(variable, "tvg_start");
-			if (signflip_next_value == MB_YES)
-			  strcat(variable, "-");
-			if (invert_next_value == MB_YES)
-			  strcat(variable, "_");
-
-			fprintf(output[i], "\t%s = ", variable);
-
-			fprintf(outfile, "\tfloat %s(data);\n", variable);
-			fprintf(outfile, "\t\t%s:long_name = \"Start range of TVG ramp\";\n", variable);
-			fprintf(outfile, "\t\t%s:units = \"", variable);
-			if (signflip_next_value == MB_YES)
-			  fprintf(outfile, "-");
-			if (invert_next_value == MB_YES)
-			  fprintf(outfile, "1/");
-			fprintf(outfile, "samples\";\n");
-
-			signflip_next_value = MB_NO;
-			invert_next_value = MB_NO;
-			raw_next_value = MB_NO;
-			break;
-
-		  case 'g': /* TVG stop */
-			strcpy(variable, "tvg_stop");
-			if (signflip_next_value == MB_YES)
-			  strcat(variable, "-");
-			if (invert_next_value == MB_YES)
-			  strcat(variable, "_");
-
-			fprintf(output[i], "\t%s = ", variable);
-
-			fprintf(outfile, "\tfloat %s(data);\n", variable);
-			fprintf(outfile, "\t\t%s:long_name = \"Stop range of TVG ramp\";\n", variable);
-			fprintf(outfile, "\t\t%s:units = \"", variable);
-			if (signflip_next_value == MB_YES)
-			  fprintf(outfile, "-");
-			if (invert_next_value == MB_YES)
-			  fprintf(outfile, "1/");
-			fprintf(outfile, "samples\";\n");
-
-			signflip_next_value = MB_NO;
-			invert_next_value = MB_NO;
-			raw_next_value = MB_NO;
-			break;
-
-		  case 'L' : /* Pulse length */
-		    	strcpy(variable, "pulse_length");
-
-			fprintf(output[i], "\t%s = ", variable);
-
-			fprintf(outfile, "\tlong %s(data);\n", variable);
-			fprintf(outfile, "\t\t%s:long_name = \"Pulse Length\";\n", variable);
-			fprintf(outfile, "\t\t%s:units = \"", variable);
-			fprintf(outfile, "us");
-
-			signflip_next_value = MB_NO;
-			invert_next_value = MB_NO;
-			raw_next_value = MB_NO;
-			break;
-
-		  case 'l': /* Transmit pulse length */
-			strcpy(variable, "pulse_length");
-			if (signflip_next_value == MB_YES)
-			  strcat(variable, "-");
-			if (invert_next_value == MB_YES)
-			  strcat(variable, "_");
-
-			fprintf(output[i], "\t%s = ", variable);
-
-			fprintf(outfile, "\tfloat %s(data);\n", variable);
-			fprintf(outfile, "\t\t%s:long_name = \"Pulse length\";\n", variable);
-			fprintf(outfile, "\t\t%s:units = \"", variable);
-			if (signflip_next_value == MB_YES)
-			  fprintf(outfile, "-");
-			if (invert_next_value == MB_YES)
-			  fprintf(outfile, "1/");
-			fprintf(outfile, "seconds\";\n");
-
-			signflip_next_value = MB_NO;
-			invert_next_value = MB_NO;
-			raw_next_value = MB_NO;
-			break;
-
-		  case 'M' : /* Mode */
-		    	strcpy(variable, "mode");
-
-			fprintf(output[i], "\t%s = ", variable);
-
-			fprintf(outfile, "\tlong %s(data);\n", variable);
-			fprintf(outfile, "\t\t%s:long_name = \"Sounder mode\";\n", variable);
-			fprintf(outfile, "\t\t%s:units = \"", variable);
-			fprintf(outfile, "0=very shallow,1=shallow,2=medium,3=deep,4=very deep,5=extra deep\";\n");
-
-			signflip_next_value = MB_NO;
-			invert_next_value = MB_NO;
-			raw_next_value = MB_NO;
-			break;
-
-		  case 'N' : /* Ping number */
-		    	strcpy(variable, "ping_no");
-
-			fprintf(output[i], "\t%s = ", variable);
-
-			fprintf(outfile, "\tlong %s(data);\n", variable);
-			fprintf(outfile, "\t\t%s:long_name = \"Sounder ping counter\";\n", variable);
-			fprintf(outfile, "\t\t%s:units = \"", variable);
-			fprintf(outfile, "pings\";\n");
-
-			signflip_next_value = MB_NO;
-			invert_next_value = MB_NO;
-			raw_next_value = MB_NO;
-			break;
-
-		  case 'p': /* sidescan pixel */
-			strcpy(variable, "sidescan");
-			if (signflip_next_value == MB_YES)
-			  strcat(variable, "-");
-			if (invert_next_value == MB_YES)
-			  strcat(variable, "_");
-
-			fprintf(output[i], "\t%s = ", variable);
-
-			if (count == 0)
-			  fprintf(outfile, "\tfloat %s(data);\n", variable);
-			else
-			  fprintf(outfile, "\tfloat %s(data, %c);\n", variable, list[i]);
-
-			fprintf(outfile, "\t\t%s:long_name = \"Raw sidescan pixels\";\n", variable);
-			fprintf(outfile, "\t\t%s:units = \"", variable);
-			if (signflip_next_value == MB_YES)
-			  fprintf(outfile, "-");
-			if (invert_next_value == MB_YES)
-			  fprintf(outfile, "1/");
-			fprintf(outfile, "dB\";\n");
-
-			signflip_next_value = MB_NO;
-			invert_next_value = MB_NO;
-			raw_next_value = MB_NO;
-			break;
-
-		  case 'R': /* range */
-			strcpy(variable, "range");
-			if (signflip_next_value == MB_YES)
-			  strcat(variable, "-");
-			if (invert_next_value == MB_YES)
-			  strcat(variable, "_");
-
-			fprintf(output[i], "\t%s = ", variable);
-
-			fprintf(outfile, "\tfloat %s(data);\n", variable);
-			fprintf(outfile, "\t\t%s:long_name = \"Range \";\n", variable);
-			fprintf(outfile, "\t\t%s:units = \"", variable);
-			if (signflip_next_value == MB_YES)
-			  fprintf(outfile, "-");
-			if (invert_next_value == MB_YES)
-			  fprintf(outfile, "1/");
-			fprintf(outfile, "samples\";\n");
-
-			signflip_next_value = MB_NO;
-			invert_next_value = MB_NO;
-			raw_next_value = MB_NO;
-			break;
-
-		  case 'r': /* Sample rate */
-			strcpy(variable, "sample_rate");
-			if (signflip_next_value == MB_YES)
-			  strcat(variable, "-");
-			if (invert_next_value == MB_YES)
-			  strcat(variable, "_");
-
-			fprintf(output[i], "\t%s = ", variable);
-
-			fprintf(outfile, "\tfloat %s(data);\n", variable);
-			fprintf(outfile, "\t\t%s:long_name = \"Sample Rate\";\n", variable);
-			fprintf(outfile, "\t\t%s:units = \"", variable);
-			if (signflip_next_value == MB_YES)
-			  fprintf(outfile, "-");
-			if (invert_next_value == MB_YES)
-			  fprintf(outfile, "1/");
-			fprintf(outfile, "Hertz\";\n");
-
-			signflip_next_value = MB_NO;
-			invert_next_value = MB_NO;
-			raw_next_value = MB_NO;
-			break;
-
-		  case 'S': /* Sidescan pixels */
-			strcpy(variable, "pixels");
-			if (signflip_next_value == MB_YES)
-			  strcat(variable, "-");
-			if (invert_next_value == MB_YES)
-			  strcat(variable, "_");
-
-			fprintf(output[i], "\t%s = ", variable);
-
-			fprintf(outfile, "\tfloat %s(data);\n", variable);
-			fprintf(outfile, "\t\t%s:long_name = \"Total sidescan pixels \";\n", variable);
-			fprintf(outfile, "\t\t%s:units = \"", variable);
-			if (signflip_next_value == MB_YES)
-			  fprintf(outfile, "-");
-			if (invert_next_value == MB_YES)
-			  fprintf(outfile, "1/");
-			fprintf(outfile, "pixels\";\n");
-
-			signflip_next_value = MB_NO;
-			invert_next_value = MB_NO;
-			raw_next_value = MB_NO;
-			break;
-
-		  case 's': /* Sidescan pixels per beam */
-			strcpy(variable, "beam_pixels");
-			if (signflip_next_value == MB_YES)
-			  strcat(variable, "-");
-			if (invert_next_value == MB_YES)
-			  strcat(variable, "_");
-
-			fprintf(output[i], "\t%s = ", variable);
-
-			fprintf(outfile, "\tfloat %s(data);\n", variable);
-			fprintf(outfile, "\t\t%s:long_name = \"Sidescan pixels per beam\";\n", variable);
-			fprintf(outfile, "\t\t%s:units = \"", variable);
-			if (signflip_next_value == MB_YES)
-			  fprintf(outfile, "-");
-			if (invert_next_value == MB_YES)
-			  fprintf(outfile, "1/");
-			fprintf(outfile, "pixels\";\n");
-
-			signflip_next_value = MB_NO;
-			invert_next_value = MB_NO;
-			raw_next_value = MB_NO;
-			break;
-
-		  case 'T': /* Transmit gain */
-			strcpy(variable, "transmit_gain");
-			if (signflip_next_value == MB_YES)
-			  strcat(variable, "-");
-			if (invert_next_value == MB_YES)
-			  strcat(variable, "_");
-
-			fprintf(output[i], "\t%s = ", variable);
-
-			fprintf(outfile, "\tfloat %s(data);\n", variable);
-			fprintf(outfile, "\t\t%s:long_name = \"Transmit gain\";\n", variable);
-			fprintf(outfile, "\t\t%s:units = \"", variable);
-			if (signflip_next_value == MB_YES)
-			  fprintf(outfile, "-");
-			if (invert_next_value == MB_YES)
-			  fprintf(outfile, "1/");
-			fprintf(outfile, "dB\";\n");
-
-			signflip_next_value = MB_NO;
-			invert_next_value = MB_NO;
-			raw_next_value = MB_NO;
-			break;
-
-		  case 't': /* Receive gain */
-			strcpy(variable, "receive_gain");
-			if (signflip_next_value == MB_YES)
-			  strcat(variable, "-");
-			if (invert_next_value == MB_YES)
-			  strcat(variable, "_");
-
-			fprintf(output[i], "\t%s = ", variable);
-
-			fprintf(outfile, "\tfloat %s(data);\n", variable);
-			fprintf(outfile, "\t\t%s:long_name = \"Receive gain\";\n", variable);
-			fprintf(outfile, "\t\t%s:units = \"", variable);
-			if (signflip_next_value == MB_YES)
-			  fprintf(outfile, "-");
-			if (invert_next_value == MB_YES)
-			  fprintf(outfile, "1/");
-			fprintf(outfile, "dB\";\n");
-
-			signflip_next_value = MB_NO;
-			invert_next_value = MB_NO;
-			raw_next_value = MB_NO;
-			break;
-
-
-
-		  default:
-			raw_next_value = MB_NO;
-			break;
-		  }
-		  }
-
-	      }
-	    fprintf(outfile, "\n\ndata:\n");
-	  }
-
-	/* loop over all files to be read */
-	while (read_data == MB_YES)
-	{
-
-	/* initialize reading the swath file */
-	if ((status = mb_read_init(
-		verbose,file,format,pings,lonflip,bounds,
-		btime_i,etime_i,speedmin,timegap,
-		&mbio_ptr,&btime_d,&etime_d,
-		&beams_bath,&beams_amp,&pixels_ss,&error)) != MB_SUCCESS)
-		{
-		mb_error(verbose,error,&message);
-		fprintf(stderr,"\nMBIO Error returned from function <mb_read_init>:\n%s\n",message);
-		fprintf(stderr,"\nMultibeam File <%s> not initialized for reading\n",file);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-
-	/* figure out whether bath, amp, or ss will be used */
-	if (dump_mode == DUMP_MODE_BATH || dump_mode == DUMP_MODE_TOPO)
-		use_bath = MB_YES;
-	else if (dump_mode == DUMP_MODE_AMP)
-		use_amp = MB_YES;
-	else if (dump_mode == DUMP_MODE_SS)
-		use_ss = MB_YES;
-	else
-		for (i=0; i<n_list; i++)
-		    {
-		    if (raw_next_value == MB_NO)
-		        {
-			if (list[i] == 'Z' || list[i] == 'z'
-				|| list[i] == 'A' || list[i] == 'a'
-				|| list[i] == 'Q' || list[i] == 'q')
-				use_bath = MB_YES;
-			if (list[i] == 'B')
-				use_amp = MB_YES;
-			if (list[i] == 'b')
-				use_ss = MB_YES;
-			if (list[i] == 'h')
-				use_course = MB_YES;
-			if (list[i] == 's')
-				use_course = MB_YES;
-			if (list[i] == 'V' || list[i] == 'v')
-				use_time_interval = MB_YES;
-			if (list[i] == 'A' || list[i] == 'a'
-				|| list[i] == 'G' || list[i] == 'g')
-				use_slope = MB_YES;
-			if (list[i] == 'P' || list[i] == 'p'
-				|| list[i] == 'R' || list[i] == 'r')
-				use_attitude = MB_YES;
-			if (list[i] == 'Q' || list[i] == 'q')
-				use_detects = MB_YES;
-			if (list[i] == 'N' || list[i] == 'n')
-				use_pingnumber = MB_YES;
-			if (list[i] == 'X' || list[i] == 'x'
-				|| list[i] == 'Y' || list[i] == 'y')
-				use_nav = MB_YES;
-			if (list[i] == '.')
-			  raw_next_value = MB_YES;
-			if (list[i] == '=')
-			  use_swathbounds = MB_YES;
-			if (list[i] == '+')
-			  use_swathbounds = MB_YES;
-			}
-		    else
-			{
-			if (list[i] == 'T' || list[i] == 't' || list[i] == 'U' || list[i] == 'l')
-				use_gains = MB_YES;
-			else if (list[i] == 'F' || list[i] == 'f')
-				;// ignore
-			else
-				{
-				use_raw = MB_YES;
-				if (list[i] == 'R' || list[i] == 'd')
-					use_bath = MB_YES;
-				if (list[i] == 'B' || list[i] == 'b' || list[i] == 'c')
-					use_amp = MB_YES;
-				}
-			if (list[i] != '/' &&  list[i] != '-' && list[i] != '.')
-				raw_next_value = MB_NO;
-			}
-		    }
-	if (check_values == MBLIST_CHECK_ON
-		|| check_values == MBLIST_CHECK_ON_NULL)
-		{
-		if (use_bath == MB_YES) check_bath = MB_YES;
-		if (use_amp == MB_YES) check_amp = MB_YES;
-		if (use_ss == MB_YES) check_ss = MB_YES;
-		}
-
-	/* allocate memory for data arrays */
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(char), (void **)&beamflag, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(double), (void **)&bath, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_AMPLITUDE,
-						sizeof(double), (void **)&amp, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(double), (void **)&bathacrosstrack, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(double), (void **)&bathalongtrack, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_SIDESCAN,
-						sizeof(double), (void **)&ss, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_SIDESCAN,
-						sizeof(double), (void **)&ssacrosstrack, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_SIDESCAN,
-						sizeof(double), (void **)&ssalongtrack, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(double), (void **)&depths, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(double), (void **)&depthacrosstrack, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						2 * sizeof(double), (void **)&slopes, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						2 * sizeof(double), (void **)&slopeacrosstrack, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						2 * sizeof(int), (void **)&detect, &error);
-	if (use_raw == MB_YES)
-		{
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							sizeof(int), (void **)&beam_samples, &error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							sizeof(int), (void **)&start_sample, &error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							sizeof(int), (void **)&range, &error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							sizeof(double), (void **)&depression, &error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							sizeof(double), (void **)&bs, &error);
-		status = mb_mallocd(verbose, __FILE__, __LINE__,
-					(MBSYS_SIMRAD2_MAXRAWPIXELS)*sizeof(double),
-					(void **)&ss_pixels,&error);
-		}
-
-	/* if error initializing memory then quit */
-	if (error != MB_ERROR_NO_ERROR)
-		{
-		mb_error(verbose,error,&message);
-		fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",
-			message);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-
-	/* output separator for GMT style segment file output */
-	if (segment == MB_YES && ascii == MB_YES && netcdf == MB_NO)
-		{
-		fprintf(output[0],"%s\n", segment_tag);
-		}
-
-	/* read and print data */
-	nread = 0;
-	first = MB_YES;
-	while (error <= MB_ERROR_NO_ERROR)
-		{
-		/* reset error */
-		error = MB_ERROR_NO_ERROR;
-
-		/* read a ping of data */
-		if (pings == 1 || use_attitude == MB_YES || use_detects == MB_YES || use_pingnumber == MB_YES)
-		    {
-		    /* read next data record */
-		    status = mb_get_all(verbose,mbio_ptr,&store_ptr,&kind,
-			time_i,&time_d,&navlon,&navlat,
-			&speed,&heading,
-			&distance,&altitude,&sonardepth,
-			&beams_bath,&beams_amp,&pixels_ss,
-			beamflag,bath,amp,bathacrosstrack,bathalongtrack,
-			ss,ssacrosstrack,ssalongtrack,
-			comment,&error);
-
-		    /* time gaps are not a problem here */
-		    if (error == MB_ERROR_TIME_GAP)
-			    {
-			    error = MB_ERROR_NO_ERROR;
-			    status = MB_SUCCESS;
-			    }
-
-		    /* if survey data extract nav */
-		    if (error == MB_ERROR_NO_ERROR
-			&& kind == MB_DATA_DATA)
-			status = mb_extract_nav(verbose,mbio_ptr,store_ptr,&kind,
-					time_i,&time_d,&navlon,&navlat,
-					&speed,&heading,&draft,&roll,&pitch,&heave,&error);
-
-		    /* if survey data extract detects */
-		    if (error == MB_ERROR_NO_ERROR
-			&& kind == MB_DATA_DATA
-			&& use_detects)
-			status = mb_detects(verbose,mbio_ptr,store_ptr,&kind,
-					&nbeams,detect,&error);
-
-		    /* if survey data extract pingnumber */
-		    if (error == MB_ERROR_NO_ERROR
-			&& kind == MB_DATA_DATA
-			&& use_pingnumber)
-			status = mb_pingnumber(verbose,mbio_ptr,&pingnumber,&error);
-		    }
-		else
-		    {
-		    status = mb_get(verbose,mbio_ptr,&kind,&pings_read,
-			time_i,&time_d,
-			&navlon,&navlat,
-			&speed,&heading,
-			&distance,&altitude,&sonardepth,
-			&beams_bath,&beams_amp,&pixels_ss,
-			beamflag,bath,amp,bathacrosstrack,bathalongtrack,
-			ss,ssacrosstrack,ssalongtrack,
-			comment,&error);
-
-		    /* time gaps are not a problem here */
-		    if (error == MB_ERROR_TIME_GAP)
-			    {
-			    error = MB_ERROR_NO_ERROR;
-			    status = MB_SUCCESS;
-			    }
-		    }
-
-		/* make sure non survey data records are ignored */
-		if (error == MB_ERROR_NO_ERROR
-			&& kind != MB_DATA_DATA)
-			error = MB_ERROR_OTHER;
-
-		/* increment counter and set cumulative distance */
-		if (error <= MB_ERROR_NO_ERROR
-			&& kind == MB_DATA_DATA)
-			{
-			nread++;
-                        if (use_pingnumber == MB_NO)
-                            pingnumber = nread;
-			distance_total += distance;
-			}
-
-		/* print debug statements */
-		if (verbose >= 2)
-			{
-			fprintf(stderr,"\ndbg2  Ping read in program <%s>\n",
-				program_name);
-			fprintf(stderr,"dbg2       kind:           %d\n",kind);
-			fprintf(stderr,"dbg2       error:          %d\n",error);
-			fprintf(stderr,"dbg2       status:         %d\n",status);
-			}
-
-		/* print comments */
-		if (verbose >= 1 && kind == MB_DATA_COMMENT)
-			{
-			if (icomment == 0)
-				{
-				fprintf(stderr,"\nComments:\n");
-				icomment++;
-				}
-			fprintf(stderr,"%s\n",comment);
-			}
-
-		/* set output beams and pixels */
-		if (error == MB_ERROR_NO_ERROR)
-			{
-			/* find vertical-most non-null beam
-				and port and starboard-most good beams */
-			status = mb_swathbounds(verbose, MB_YES,
-				navlon, navlat, heading,
-				beams_bath, pixels_ss,
-				beamflag, bath, bathacrosstrack, bathalongtrack,
-				ss, ssacrosstrack, ssalongtrack,
-				&beam_port, &beam_vertical, &beam_stbd,
-				&pixel_port, &pixel_vertical, &pixel_stbd,
-				&error);
-
-			/* set and/or check beams and pixels to be output */
-			status = set_output(verbose,
-				beams_bath,beams_amp,pixels_ss,
-				use_bath,use_amp,use_ss,
-				dump_mode,beam_set,pixel_set,
-				beam_vertical, pixel_vertical,
-				&beam_start,&beam_end,
-				&beam_exclude_percent,
-				&pixel_start,&pixel_end,
-				&n_list,list,&error);
-
-			if (status == MB_FAILURE)
-				{
-				fprintf(stderr,"\nProgram <%s> Terminated\n",
-					program_name);
-				exit(error);
-				}
-
-			/* print debug statements */
-			if (verbose >= 2)
-				{
-				fprintf(stderr,"\ndbg2  Beams set for output in <%s>\n",
-					program_name);
-				fprintf(stderr,"dbg2       status:       %d\n",
-					status);
-				fprintf(stderr,"dbg2       error:        %d\n",
-					error);
-				fprintf(stderr,"dbg2       use_bath:     %d\n",
-					use_bath);
-				fprintf(stderr,"dbg2       use_amp:      %d\n",
-					use_amp);
-				fprintf(stderr,"dbg2       use_ss:       %d\n",
-					use_ss);
-				fprintf(stderr,"dbg2       beam_start:   %d\n",
-					beam_start);
-				fprintf(stderr,"dbg2       beam_end:     %d\n",
-					beam_end);
-				fprintf(stderr,"dbg2       beam_exclude_percent: %d\n",
-					beam_exclude_percent);
-				fprintf(stderr,"dbg2       pixel_start:  %d\n",
-					pixel_start);
-				fprintf(stderr,"dbg2       pixel_end:    %d\n",
-					pixel_end);
-				fprintf(stderr,"dbg2       check_values: %d\n",
-					check_values);
-				fprintf(stderr,"dbg2       check_bath:   %d\n",
-					check_bath);
-				fprintf(stderr,"dbg2       check_amp:    %d\n",
-					check_amp);
-				fprintf(stderr,"dbg2       check_ss:     %d\n",
-					check_ss);
-				fprintf(stderr,"dbg2       n_list:       %d\n",
-					n_list);
-				for (i=0;i<n_list;i++)
-					fprintf(stderr,"dbg2       list[%d]:      %c\n",
-						i,list[i]);
-				}
-			}
-
-		/* get factors for lon lat calculations */
-		if (error == MB_ERROR_NO_ERROR)
-			{
-			mb_coor_scale(verbose,navlat,&mtodeglon,&mtodeglat);
-			headingx = sin(DTR*heading);
-			headingy = cos(DTR*heading);
-			}
-
-		/* get time interval since last ping */
-		if (error == MB_ERROR_NO_ERROR
-			&& kind == MB_DATA_DATA
-			&& first == MB_YES)
-			{
-			time_interval = 0.0;
-			}
-		else if (error == MB_ERROR_NO_ERROR
-			&& kind == MB_DATA_DATA)
-			{
-			time_interval = time_d - time_d_old;
-			}
-
-		/* calculate course made good */
-		if (error == MB_ERROR_NO_ERROR
-			&& use_course == MB_YES)
-			{
-			if (first == MB_YES)
-				{
-				course = heading;
-				speed_made_good = speed;
-				course_old = heading;
-				speed_made_good_old = speed;
-				}
-			else
-				{
-				dx = (navlon - navlon_old)/mtodeglon;
-				dy = (navlat - navlat_old)/mtodeglat;
-				dist = sqrt(dx*dx + dy*dy);
-				if (dist > 0.0)
-					course = RTD*atan2(dx/dist,dy/dist);
-				else
-					course = course_old;
-				if (course < 0.0)
-					course = course + 360.0;
-				dt = (time_d - time_d_old);
-				if (dt > 0.0)
-					speed_made_good = 3.6*dist/dt;
-				else
-					speed_made_good
-						= speed_made_good_old;
-				}
-			}
-
-		/* calculate slopes if required */
-		if (error == MB_ERROR_NO_ERROR
-			&& use_slope == MB_YES)
-			{
-			/* get average slope */
-			ns = 0;
-			sx = 0.0;
-			sy = 0.0;
-			sxx = 0.0;
-			sxy = 0.0;
-			for (k=0;k<beams_bath;k++)
-			  if (mb_beam_ok(beamflag[k]))
-			    {
-			    sx += bathacrosstrack[k];
-			    sy += bath[k];
-			    sxx += bathacrosstrack[k]
-				*bathacrosstrack[k];
-			    sxy += bathacrosstrack[k]*bath[k];
-			    ns++;
-			    }
-			if (ns > 0)
-			  {
-			  delta = ns*sxx - sx*sx;
-			  /* a = (sxx*sy - sx*sxy)/delta; */
-			  b = (ns*sxy - sx*sy)/delta;
-			  avgslope = RTD * atan(b);
-			  }
-			else
-			  avgslope = 0.0;
-
-			/* get per beam slope */
-			set_bathyslope(verbose,
-				beams_bath,beamflag,bath,bathacrosstrack,
-				&ndepths,depths,depthacrosstrack,
-				&nslopes,slopes,slopeacrosstrack,
-				&error);
-			}
-
-		/* reset old values */
-		if (error == MB_ERROR_NO_ERROR)
-			{
-			navlon_old = navlon;
-			navlat_old = navlat;
-			course_old = course;
-			speed_made_good_old = speed_made_good;
-			time_d_old = time_d;
-			}
-
-		/* get raw values if required */
-		if (error == MB_ERROR_NO_ERROR
-			&& use_raw == MB_YES)
-			{
-			status = mb_get_raw(verbose, mbio_ptr,
-					&mode,
-					&ipulse_length,
-					&png_count,
-					&sample_rate,
-					&absorption,
-					&max_range,
-					&r_zero,
-					&r_zero_corr,
-					&tvg_start,
-					&tvg_stop,
-					&bsn,
-					&bso,
-					&tx,
-					&tvg_crossover,
-					&nbeams_ss,
-					&npixels,
-					beam_samples,
-					start_sample,
-					range,
-					depression,
-					bs,
-					ss_pixels,
-					&error);
-			}
-
-		/* get gains values if required */
-		if (error == MB_ERROR_NO_ERROR
-			&& use_gains == MB_YES)
-			{
-			status = mb_gains(verbose,mbio_ptr,store_ptr,&kind,
-					&transmit_gain,&pulse_length,&receive_gain,&error);
-			}
-
-		/* now loop over beams */
-		if (error == MB_ERROR_NO_ERROR && (nread - 1) % decimate == 0)
-		for (j=beam_start;j<=beam_end;j++)
-		  {
-		  /* check beam status */
-		  beam_status = MB_SUCCESS;
-		  if (check_bath == MB_YES
-		    && check_values == MBLIST_CHECK_ON
-		    && !mb_beam_ok(beamflag[j]))
-			beam_status = MB_FAILURE;
-		  else if (check_bath == MB_YES
-		    && check_values == MBLIST_CHECK_ON_NULL
-		    && beamflag[j] == MB_FLAG_NULL)
-			beam_status = MB_FAILURE;
-		  if (check_amp == MB_YES
-		    && check_values == MBLIST_CHECK_ON
-		    && !mb_beam_ok(beamflag[j]))
-			beam_status = MB_FAILURE;
-		  else if (check_amp == MB_YES
-		    && check_values == MBLIST_CHECK_ON_NULL
-		    && beamflag[j] == MB_FLAG_NULL)
-			beam_status = MB_FAILURE;
-		  if (check_ss == MB_YES && j != beam_vertical)
-			beam_status = MB_FAILURE;
-		  else if (check_ss == MB_YES && j == beam_vertical)
-			if (ss[pixel_vertical] <= MB_SIDESCAN_NULL)
-				beam_status = MB_FAILURE;
-		  if (use_time_interval == MB_YES && first == MB_YES)
-			beam_status = MB_FAILURE;
-		  if (check_nav == MB_YES && (navlon == 0.0 || navlon == 0.0))
-		  	beam_status = MB_FAILURE;
-
-		  /* print out good beams */
-		  if (beam_status == MB_SUCCESS)
-		    {
-		    for (i=0; i<n_list; i++)
-			{
-			if (netcdf == MB_YES && lcount > 0)
-			  fprintf(output[i], ", ");
-			if (port_next_value == MB_YES)
-				{
-				k = beam_port;
-				port_next_value = MB_NO;
-				}
-			else if (stbd_next_value == MB_YES)
-				{
-				k = beam_stbd;
-				stbd_next_value = MB_NO;
-				}
-			else
-				k = j;
-
-			if (raw_next_value == MB_NO)
-			    {
-			    switch (list[i])
-				{
-				case '/': /* Inverts next simple value */
-					invert_next_value = MB_YES;
-					break;
-				case '-': /* Flip sign on next simple value */
-					signflip_next_value = MB_YES;
-					break;
-				case '.': /* Raw value next field */
-					raw_next_value = MB_YES;
-		  			count = 0;
-					break;
-				case '=': /* Port-most value next field -ignored here */
-				  	port_next_value = MB_YES;
-				  	break;
-				case '+': /* Starboard-most value next field - ignored here*/
-				  	stbd_next_value = MB_YES;
-				  	break;
-				case 'A': /* Average seafloor crosstrack slope */
-					printsimplevalue(verbose, output[i], avgslope, 0, 4, ascii,
-							    &invert_next_value,
-							    &signflip_next_value, &error);
-					break;
-				case 'a': /* Per-beam seafloor crosstrack slope */
-					if (beamflag[k] == MB_FLAG_NULL
-					    && (check_values == MBLIST_CHECK_OFF_NAN
-						|| check_values == MBLIST_CHECK_OFF_FLAGNAN))
-					    {
-					    printNaN(verbose, output[i], ascii, &invert_next_value,
-							    &signflip_next_value, &error);
-					    }
-					else if (!mb_beam_ok(beamflag[k])
-					    && check_values == MBLIST_CHECK_OFF_FLAGNAN)
-					    {
-					    printNaN(verbose, output[i], ascii, &invert_next_value,
-							    &signflip_next_value, &error);
-					    }
-					else
-					    {
-					    status = get_bathyslope(verbose,
-						ndepths,depths,depthacrosstrack,
-						nslopes,slopes,slopeacrosstrack,
-						bathacrosstrack[k],
-						&depth,&slope,&error);
-					    printsimplevalue(verbose, output[i], slope, 0, 4, ascii,
-							    &invert_next_value,
-							    &signflip_next_value, &error);
-					    }
-					break;
-				case 'B': /* amplitude */
-					if (beamflag[k] == MB_FLAG_NULL
-					    && (check_values == MBLIST_CHECK_OFF_NAN
-						|| check_values == MBLIST_CHECK_OFF_FLAGNAN))
-					    {
-					    printNaN(verbose, output[i], ascii, &invert_next_value,
-							    &signflip_next_value, &error);
-					    }
-					else if (!mb_beam_ok(beamflag[k])
-					    && check_values == MBLIST_CHECK_OFF_FLAGNAN)
-					    {
-					    printNaN(verbose, output[i], ascii, &invert_next_value,
-							    &signflip_next_value, &error);
-					    }
-					else
-					    {
-					    printsimplevalue(verbose, output[i], amp[k], 0, 3, ascii,
-							    &invert_next_value,
-							    &signflip_next_value, &error);
-					    }
-					break;
-				case 'b': /* sidescan */
-					printsimplevalue(verbose, output[i], ss[pixel_vertical], 0, 3, ascii,
-							    &invert_next_value,
-							    &signflip_next_value, &error);
-					break;
-				case 'C': /* Sonar altitude (m) */
-					printsimplevalue(verbose, output[i], altitude, 0, 4, ascii,
-							    &invert_next_value,
-							    &signflip_next_value, &error);
-					break;
-				case 'c': /* Sonar transducer depth (m) */
-					printsimplevalue(verbose, output[i], sonardepth, 0, 4, ascii,
-							    &invert_next_value,
-							    &signflip_next_value, &error);
-					break;
-				case 'D': /* acrosstrack dist. */
-				case 'd':
-					if (beamflag[k] == MB_FLAG_NULL
-					    && (check_values == MBLIST_CHECK_OFF_NAN
-						|| check_values == MBLIST_CHECK_OFF_FLAGNAN))
-					    {
-					    printNaN(verbose, output[i], ascii, &invert_next_value,
-							    &signflip_next_value, &error);
-					    }
-					else if (!mb_beam_ok(beamflag[k])
-					    && check_values == MBLIST_CHECK_OFF_FLAGNAN)
-					    {
-					    printNaN(verbose, output[i], ascii, &invert_next_value,
-							    &signflip_next_value, &error);
-					    }
-					else
-					    {
-					    b = bathy_scale * bathacrosstrack[k];
-					    printsimplevalue(verbose, output[i], b, 0, 4, ascii,
-							    &invert_next_value,
-							    &signflip_next_value, &error);
-					    }
-					break;
-				case 'E': /* alongtrack dist. */
-				case 'e':
-					if (beamflag[k] == MB_FLAG_NULL
-					    && (check_values == MBLIST_CHECK_OFF_NAN
-						|| check_values == MBLIST_CHECK_OFF_FLAGNAN))
-					    {
-					    printNaN(verbose, output[i], ascii, &invert_next_value,
-							    &signflip_next_value, &error);
-					    }
-					else if (!mb_beam_ok(beamflag[k])
-					    && check_values == MBLIST_CHECK_OFF_FLAGNAN)
-					    {
-					    printNaN(verbose, output[i], ascii, &invert_next_value,
-							    &signflip_next_value, &error);
-					    }
-					else
-					    {
-					    b = bathy_scale * bathalongtrack[k];
-					    printsimplevalue(verbose, output[i], b, 0, 4, ascii,
-							    &invert_next_value,
-							    &signflip_next_value, &error);
-					    }
-					break;
-				case 'F': /* Beamflag numeric value */
-					if (ascii == MB_YES)
-                                            {
-					    if (netcdf == MB_YES)
-					    fprintf(output[i],"%u",beamflag[k]);
-					    else
-					    fprintf(output[i],"%u",beamflag[k]);
-                                            }
-                                        else
-                                            {
-					    b = beamflag[k];
-					    fwrite(&b, sizeof(double), 1, outfile);
-                                            }
-					break;
-				case 'f': /* Beamflag character value (ascii only) */
-					if (ascii == MB_YES)
-                                            {
-					    if (netcdf == MB_YES)
-                                                fprintf(output[i],"%u",beamflag[k]);
-					    else
-                                                {
-                                                if (mb_beam_check_flag_null(beamflag[k]))
-                                                    fprintf(output[i],"-");
-                                               else if (mb_beam_ok(beamflag[k]))
-                                                    fprintf(output[i],"G");
-                                               else if (mb_beam_check_flag_manual(beamflag[k]))
-                                                    fprintf(output[i],"M");
-                                               else if (mb_beam_check_flag_filter(beamflag[k]))
-                                                    fprintf(output[i],"F");
-                                               else if (mb_beam_check_flag_filter2(beamflag[k]))
-                                                    fprintf(output[i],"F");
-                                               else if (mb_beam_check_flag_gt_1x_iho(beamflag[k]))
-                                                    fprintf(output[i],"F");
-                                               else if (mb_beam_check_flag_gt_2x_iho(beamflag[k]))
-                                                    fprintf(output[i],"F");
-                                               else if (mb_beam_check_flag_footprint(beamflag[k]))
-                                                    fprintf(output[i],"F");
-                                               else if (mb_beam_check_flag_sonar(beamflag[k]))
-                                                    fprintf(output[i],"S");
-                                                }
-                                            }
-                                        else
-                                            {
-					    b = beamflag[k];
-					    fwrite(&b, sizeof(double), 1, outfile);
-                                            }
-					break;
-				case 'G': /* flat bottom grazing angle */
-					if (beamflag[k] == MB_FLAG_NULL
-					    && (check_values == MBLIST_CHECK_OFF_NAN
-						|| check_values == MBLIST_CHECK_OFF_FLAGNAN))
-					    {
-					    printNaN(verbose, output[i], ascii, &invert_next_value,
-							    &signflip_next_value, &error);
-					    }
-					else if (!mb_beam_ok(beamflag[k])
-					    && check_values == MBLIST_CHECK_OFF_FLAGNAN)
-					    {
-					    printNaN(verbose, output[i], ascii, &invert_next_value,
-							    &signflip_next_value, &error);
-					    }
-					else
-					    {
-					    angle = RTD*(atan(bathacrosstrack[k] / (bath[k] - sonardepth)));
-					    printsimplevalue(verbose, output[i], angle, 0, 3, ascii,
-							    &invert_next_value,
-							    &signflip_next_value, &error);
-					    }
-					break;
-				case 'g': /* grazing angle using slope */
-					if (beamflag[k] == MB_FLAG_NULL
-					    && (check_values == MBLIST_CHECK_OFF_NAN
-						|| check_values == MBLIST_CHECK_OFF_FLAGNAN))
-					    {
-					    printNaN(verbose, output[i], ascii, &invert_next_value,
-							    &signflip_next_value, &error);
-					    }
-					else if (!mb_beam_ok(beamflag[k])
-					    && check_values == MBLIST_CHECK_OFF_FLAGNAN)
-					    {
-					    printNaN(verbose, output[i], ascii, &invert_next_value,
-							    &signflip_next_value, &error);
-					    }
-					else
-					    {
-					    status = get_bathyslope(verbose,
-						ndepths,depths,depthacrosstrack,
-						nslopes,slopes,slopeacrosstrack,
-						bathacrosstrack[k],
-						&depth,&slope,&error);
-					    angle = RTD * (atan(bathacrosstrack[k] / (bath[k] - sonardepth)))
-						+ slope;
-					    printsimplevalue(verbose, output[i], angle, 0, 3, ascii,
-							    &invert_next_value,
-							    &signflip_next_value, &error);
-					    }
-					break;
-				case 'H': /* heading */
-					printsimplevalue(verbose, output[i], heading, 7, 3, ascii,
-							    &invert_next_value,
-							    &signflip_next_value, &error);
-					break;
-				case 'h': /* course */
-					printsimplevalue(verbose, output[i], course, 7, 3, ascii,
-							    &invert_next_value,
-							    &signflip_next_value, &error);
-					break;
-				case 'J': /* time string */
-					mb_get_jtime(verbose,time_i,time_j);
-					seconds = time_i[5] + 1e-6 * time_i[6];
-					if (ascii == MB_YES)
-					    {
-					    if (netcdf == MB_YES)
-					    fprintf(output[i],"%d, %d, %d, %d, %d, %d",
-						time_j[0],time_j[1],
-						time_i[3],time_i[4],
-						time_i[5],time_i[6]);
-					    else
-					    fprintf(output[i],"%.4d %.3d %.2d %.2d %9.6f",
-						time_j[0],time_j[1],
-						time_i[3],time_i[4],
-						seconds);
-
-					    }
-					else
-					    {
-					    b = time_j[0];
-					    fwrite(&b, sizeof(double), 1, outfile);
-					    b = time_j[1];
-					    fwrite(&b, sizeof(double), 1, outfile);
-					    b = time_i[3];
-					    fwrite(&b, sizeof(double), 1, outfile);
-					    b = time_i[4];
-					    fwrite(&b, sizeof(double), 1, outfile);
-					    b = time_i[5];
-					    fwrite(&b, sizeof(double), 1, outfile);
-					    b = time_i[6];
-					    fwrite(&b, sizeof(double), 1, outfile);
-					    }
-					break;
-				case 'j': /* time string */
-					mb_get_jtime(verbose,time_i,time_j);
-					seconds = time_i[5] + 1e-6 * time_i[6];
-					if (ascii == MB_YES)
-					    {
-					    if (netcdf == MB_YES)
-					    fprintf(output[i],"%d, %d, %d, %d, %d",
-						time_j[0],time_j[1],
-						time_j[2],time_j[3],time_j[4]);
-					    else
-					    fprintf(output[i],"%.4d %.3d %.4d %9.6f",
-						time_j[0],time_j[1],
-						time_j[2],seconds);
-					    }
-					else
-					    {
-					    b = time_j[0];
-					    fwrite(&b, sizeof(double), 1, outfile);
-					    b = time_j[1];
-					    fwrite(&b, sizeof(double), 1, outfile);
-					    b = time_j[2];
-					    fwrite(&b, sizeof(double), 1, outfile);
-					    b = time_j[3];
-					    fwrite(&b, sizeof(double), 1, outfile);
-					    b = time_j[4];
-					    fwrite(&b, sizeof(double), 1, outfile);
-					    }
-					break;
-				case 'L': /* along-track distance (km) */
-					printsimplevalue(verbose, output[i], distance_total, 8, 4, ascii,
-							    &invert_next_value,
-							    &signflip_next_value, &error);
-					break;
-				case 'l': /* along-track distance (m) */
-					printsimplevalue(verbose, output[i], 1000.0 * distance_total, 8, 4, ascii,
-							    &invert_next_value,
-							    &signflip_next_value, &error);
-					break;
-				case 'M': /* Decimal unix seconds since
-						1/1/70 00:00:00 */
-					printsimplevalue(verbose, output[i], time_d, 0, 6, ascii,
-							    &invert_next_value,
-							    &signflip_next_value, &error);
-					break;
-				case 'm': /* time in decimal seconds since
-						first record */
-					if (first_m == MB_YES)
-						{
-						time_d_ref = time_d;
-						first_m = MB_NO;
-						}
-					b = time_d - time_d_ref;
-					printsimplevalue(verbose, output[i], b, 0, 6, ascii,
-							    &invert_next_value,
-							    &signflip_next_value, &error);
-					break;
-				case 'N': /* ping counter */
-					if (ascii == MB_YES)
-					    fprintf(output[i],"%6d",pingnumber);
-					else
-					    {
-					    b = pingnumber;
-					    fwrite(&b, sizeof(double), 1, outfile);
-					    }
-					break;
-				case 'P': /* pitch */
-					printsimplevalue(verbose, output[i], pitch, 6, 3, ascii,
-							    &invert_next_value,
-							    &signflip_next_value, &error);
-					break;
-				case 'p': /* draft */
-					printsimplevalue(verbose, output[i], draft, 7, 4, ascii,
-							    &invert_next_value,
-							    &signflip_next_value, &error);
-					break;
-				case 'q': /* bottom detection type */
-					if (ascii == MB_YES)
-					    {
-					    if (netcdf == MB_YES) fprintf(output[i], "\"");
-
-					    fprintf(output[i],"%d",detect[k]);
-					    if (netcdf == MB_YES) fprintf(output[i], "\"");
-					    }
-					else
-					    {
-					    b = detect[k];
-					    fwrite(&b, sizeof(double), 1, outfile);
-					    }
-					break;
-				case 'Q': /* bottom detection type */
-					if (ascii == MB_YES)
-					    {
-					    if (netcdf == MB_YES)
-					    	{
-						fprintf(output[i], "\"");
-						fprintf(output[i],"%d",detect[k]);
-					    	fprintf(output[i], "\"");
-						}
-					    else
-					    	{
-						if (detect[k] == MB_DETECT_AMPLITUDE)
-						    fprintf(output[i],"A");
-						else if (detect[k] == MB_DETECT_PHASE)
-						    fprintf(output[i],"P");
-						else
-						    fprintf(output[i],"U");
-						}
-					    }
-					else
-					    {
-					    b = detect[k];
-					    fwrite(&b, sizeof(double), 1, outfile);
-					    }
-					break;
-				case 'R': /* roll */
-					printsimplevalue(verbose, output[i], roll, 6, 3, ascii,
-							    &invert_next_value,
-							    &signflip_next_value, &error);
-					break;
-				case 'r': /* heave */
-					printsimplevalue(verbose, output[i], heave, 7, 4, ascii,
-							    &invert_next_value,
-							    &signflip_next_value, &error);
-					break;
-				case 'S': /* speed */
-					printsimplevalue(verbose, output[i], speed, 6, 3, ascii,
-							    &invert_next_value,
-							    &signflip_next_value, &error);
-					break;
-				case 's': /* speed made good */
-					printsimplevalue(verbose, output[i], speed_made_good, 6, 3, ascii,
-							    &invert_next_value,
-							    &signflip_next_value, &error);
-					break;
-				case 'T': /* yyyy/mm/dd/hh/mm/ss time string */
-					seconds = time_i[5] + 1e-6 * time_i[6];
-					if (ascii == MB_YES)
-					    {
-					    if (netcdf == MB_YES) fprintf(output[i], "\"");
-
-					    fprintf(output[i],"%.4d/%.2d/%.2d/%.2d/%.2d/%9.6f",
-						time_i[0],time_i[1],time_i[2],
-						time_i[3],time_i[4],seconds);
-					    if (netcdf == MB_YES) fprintf(output[i], "\"");
-					    }
-					else
-					    {
-					    b = time_i[0];
-					    fwrite(&b, sizeof(double), 1, outfile);
-					    b = time_i[1];
-					    fwrite(&b, sizeof(double), 1, outfile);
-					    b = time_i[2];
-					    fwrite(&b, sizeof(double), 1, outfile);
-					    b = time_i[3];
-					    fwrite(&b, sizeof(double), 1, outfile);
-					    b = time_i[4];
-					    fwrite(&b, sizeof(double), 1, outfile);
-					    b = seconds;
-					    fwrite(&b, sizeof(double), 1, outfile);
-					    }
-					break;
-				case 't': /* yyyy mm dd hh mm ss time string */
-					seconds = time_i[5] + 1e-6 * time_i[6];
-					if (ascii == MB_YES)
-					    {
-					    if (netcdf == MB_YES)
-					    fprintf(output[i],"%d, %d, %d, %d, %d, %d, %d",
-						time_i[0],time_i[1],time_i[2],
-						time_i[3],time_i[4],time_i[5],
-						time_i[6]);
-					    else
-					    fprintf(output[i],"%.4d %.2d %.2d %.2d %.2d %9.6f",
-						time_i[0],time_i[1],time_i[2],
-						time_i[3],time_i[4],seconds);
-					    }
-					else
-					    {
-					    b = time_i[0];
-					    fwrite(&b, sizeof(double), 1, outfile);
-					    b = time_i[1];
-					    fwrite(&b, sizeof(double), 1, outfile);
-					    b = time_i[2];
-					    fwrite(&b, sizeof(double), 1, outfile);
-					    b = time_i[3];
-					    fwrite(&b, sizeof(double), 1, outfile);
-					    b = time_i[4];
-					    fwrite(&b, sizeof(double), 1, outfile);
-					    b = seconds;
-					    fwrite(&b, sizeof(double), 1, outfile);
-					    }
-					break;
-				case 'U': /* unix time in seconds since 1/1/70 00:00:00 */
-					time_u = (int) time_d;
-					if (ascii == MB_YES)
-					    fprintf(output[i],"%ld",time_u);
-					else
-					    {
-					    b = time_u;
-					    fwrite(&b, sizeof(double), 1, outfile);
-					    }
-					break;
-				case 'u': /* time in seconds since first record */
-					time_u = (int) time_d;
-					if (first_u == MB_YES)
-						{
-						time_u_ref = time_u;
-						first_u = MB_NO;
-						}
-					if (ascii == MB_YES)
-					    fprintf(output[i],"%ld",time_u - time_u_ref);
-					else
-					    {
-					    b = time_u - time_u_ref;
-					    fwrite(&b, sizeof(double), 1, outfile);
-					    }
-					break;
-				case 'V': /* time in seconds since last ping */
-				case 'v':
-					if (ascii == MB_YES)
-					    {
-					    if ( fabs(time_interval) > 100. )
-						fprintf(output[i],"%g",time_interval);
-					    else
-						fprintf(output[i],"%10.6f",time_interval);
-					    }
-					else
-					    {
-					    fwrite(&time_interval, sizeof(double), 1, outfile);
-					    }
-					break;
-				case 'X': /* longitude decimal degrees */
-					dlon = navlon;
-					if (beam_set != MBLIST_SET_OFF || k != j)
-					    dlon += headingy*mtodeglon
-							*bathacrosstrack[k]
-						    + headingx*mtodeglon
-							*bathalongtrack[k];
-					printsimplevalue(verbose, output[i], dlon, 15, 10, ascii,
-							    &invert_next_value,
-							    &signflip_next_value, &error);
-					break;
-				case 'x': /* longitude degress + decimal minutes */
-					dlon = navlon;
-					if (beam_set != MBLIST_SET_OFF || k != j)
-					    dlon += headingy*mtodeglon
-							*bathacrosstrack[k]
-						    + headingx*mtodeglon
-							*bathalongtrack[k];
-					if (dlon < 0.0)
-						{
-						hemi = 'W';
-						dlon = -dlon;
-						}
-					else
-						hemi = 'E';
-					degrees = (int) dlon;
-					minutes = 60.0*(dlon - degrees);
-					if (ascii == MB_YES)
-					    {
-					    if (netcdf == MB_YES) fprintf(output[i], "\"");
-					    fprintf(output[i],"%3d %11.8f%c",
-						degrees, minutes, hemi);
-					    if (netcdf == MB_YES) fprintf(output[i], "\"");
-					    }
-					else
-					    {
-					    b = degrees;
-					    if (hemi == 'W') b = -b;
-					    fwrite(&b, sizeof(double), 1, outfile);
-					    b = minutes;
-					    fwrite(&b, sizeof(double), 1, outfile);
-					    }
-					break;
-				case 'Y': /* latitude decimal degrees */
-					dlat = navlat;
-					if (beam_set != MBLIST_SET_OFF || k != j)
-					    dlat += -headingx*mtodeglat
-							*bathacrosstrack[k]
-						    + headingy*mtodeglat
-							*bathalongtrack[k];
-					printsimplevalue(verbose, output[i], dlat, 15, 10, ascii,
-							    &invert_next_value,
-							    &signflip_next_value, &error);
-					break;
-				case 'y': /* latitude degrees + decimal minutes */
-					dlat = navlat;
-					if (beam_set != MBLIST_SET_OFF || k != j)
-					    dlat += -headingx*mtodeglat
-							*bathacrosstrack[k]
-						    + headingy*mtodeglat
-							*bathalongtrack[k];
-					if (dlat < 0.0)
-						{
-						hemi = 'S';
-						dlat = -dlat;
-						}
-					else
-						hemi = 'N';
-					degrees = (int) dlat;
-					minutes = 60.0*(dlat - degrees);
-					if (ascii == MB_YES)
-					    {
-					    if (netcdf == MB_YES) fprintf(output[i], "\"");
-					    fprintf(output[i],"%3d %11.8f%c",
-						degrees, minutes, hemi);
-					    if (netcdf == MB_YES) fprintf(output[i], "\"");
-					    }
-					else
-					    {
-					    b = degrees;
-					    if (hemi == 'S') b = -b;
-					    fwrite(&b, sizeof(double), 1, outfile);
-					    b = minutes;
-					    fwrite(&b, sizeof(double), 1, outfile);
-					    }
-					break;
-				case 'Z': /* topography */
-					if (beamflag[k] == MB_FLAG_NULL
-					    && (check_values == MBLIST_CHECK_OFF_NAN
-						|| check_values == MBLIST_CHECK_OFF_FLAGNAN))
-					    {
-					    printNaN(verbose, output[i], ascii, &invert_next_value,
-							    &signflip_next_value, &error);
-					    }
-					else if (!mb_beam_ok(beamflag[k])
-					    && check_values == MBLIST_CHECK_OFF_FLAGNAN)
-					    {
-					    printNaN(verbose, output[i], ascii, &invert_next_value,
-							    &signflip_next_value, &error);
-					    }
-					else
-					    {
-					    b = -bathy_scale * bath[k];
-					    printsimplevalue(verbose, output[i], b, 0, 4, ascii,
-							    &invert_next_value,
-							    &signflip_next_value, &error);
-					    }
-					break;
-				case 'z': /* depth */
-					if (beamflag[k] == MB_FLAG_NULL
-					    && (check_values == MBLIST_CHECK_OFF_NAN
-						|| check_values == MBLIST_CHECK_OFF_FLAGNAN))
-					    {
-					    printNaN(verbose, output[i], ascii, &invert_next_value,
-							    &signflip_next_value, &error);
-					    }
-					else if (!mb_beam_ok(beamflag[k])
-					    && check_values == MBLIST_CHECK_OFF_FLAGNAN)
-					    {
-					    printNaN(verbose, output[i], ascii, &invert_next_value,
-							    &signflip_next_value, &error);
-					    }
-					else
-					    {
-					    b = bathy_scale * bath[k];
-					    printsimplevalue(verbose, output[i], b, 0, 4, ascii,
-							    &invert_next_value,
-							    &signflip_next_value, &error);
-					    }
-					break;
-				case '#': /* beam number */
-					if (ascii == MB_YES)
-					    fprintf(output[i],"%6d",k);
-					else
-					    {
-					    b = k;
-					    fwrite(&b, sizeof(double), 1, outfile);
-					    }
-					break;
-				default:
-					if (ascii == MB_YES)
-					    fprintf(output[i],"<Invalid Option: %c>",
-						list[i]);
-					break;
-				}
-			    }
-			else /* raw_next_value */
-			    {
-			    switch (list[i])
-				{
-				case '/': /* Inverts next simple value */
-					invert_next_value = MB_YES;
-					break;
-				case '-': /* Flip sign on next simple value */
-					signflip_next_value = MB_YES;
-					break;
-				case '.': /* Raw value next field */
-					raw_next_value = MB_YES;
-					count = 0;
-					break;
-				case '=': /* Port-most value next field -ignored here */
-				  	port_next_value = MB_YES;
-				  	break;
-				case '+': /* Starboard-most value next field - ignored here*/
-				  	stbd_next_value = MB_YES;
-				  	break;
-
-
-				case '0':
-				case '1':
-				case '2':
-				case '3':
-				case '4':
-				case '5':
-				case '6':
-				case '7':
-				case '8':
-				case '9':
-					count = count * 10 + list[i] - '0';
-					break;
-
-				case 'A': /* backscatter */
-					if (beamflag[k] == MB_FLAG_NULL
-					    && (check_values == MBLIST_CHECK_OFF_NAN
-						|| check_values == MBLIST_CHECK_OFF_FLAGNAN))
-					    {
-					    printNaN(verbose, output[i], ascii, &invert_next_value,
-							    &signflip_next_value, &error);
-					    }
-					else if (!mb_beam_ok(beamflag[k])
-					    && check_values == MBLIST_CHECK_OFF_FLAGNAN)
-					    {
-					    printNaN(verbose, output[i], ascii, &invert_next_value,
-							    &signflip_next_value, &error);
-					    }
-					else
-					    {
-					    printsimplevalue(verbose, output[i], bs[k], 5, 1, ascii,
-							    &invert_next_value,
-							    &signflip_next_value, &error);
-					    }
-					raw_next_value = MB_NO;
-					break;
-				case 'a': /* absorption */
-				        printsimplevalue(verbose, output[i], absorption, 5, 2, ascii,
-							    &invert_next_value,
-							    &signflip_next_value, &error);
-					raw_next_value = MB_NO;
-					break;
-				case 'B': /* BSN - Normal incidence backscatter */
-				        printsimplevalue(verbose, output[i], bsn, 5, 2, ascii,
-							    &invert_next_value,
-							    &signflip_next_value, &error);
-					raw_next_value = MB_NO;
-					break;
-				case 'b': /* BSO - Oblique backscatter */
-					printsimplevalue(verbose, output[i], bso, 5, 2, ascii,
-							    &invert_next_value,
-							    &signflip_next_value, &error);
-					raw_next_value = MB_NO;
-					break;
-				case 'c': /* Mean backscatter */
-				  	mback = 0;
-					nback = 0;
-				  	for (m = 0; m < beams_amp ; m++) {
-					  if (mb_beam_ok(beamflag[m])) {
-					    mback += amp[m];
-					    nback++;
-					  }
-					}
-					printsimplevalue(verbose, output[i], mback / nback, 5, 2, ascii,
-							    &invert_next_value,
-							    &signflip_next_value, &error);
-					raw_next_value = MB_NO;
-					break;
-				case 'd': /* beam depression angle */
-					if (beamflag[k] == MB_FLAG_NULL
-					    && (check_values == MBLIST_CHECK_OFF_NAN
-						|| check_values == MBLIST_CHECK_OFF_FLAGNAN))
-					    {
-					    printNaN(verbose, output[i], ascii, &invert_next_value,
-							    &signflip_next_value, &error);
-					    }
-					else if (!mb_beam_ok(beamflag[k])
-					    && check_values == MBLIST_CHECK_OFF_FLAGNAN)
-					    {
-					    printNaN(verbose, output[i], ascii, &invert_next_value,
-							    &signflip_next_value, &error);
-					    }
-					else
-					    {
-				            printsimplevalue(verbose, output[i], depression[k], 5, 2, ascii,
-							    &invert_next_value,
-							    &signflip_next_value, &error);
-					    }
-					raw_next_value = MB_NO;
-					break;
-
-				case 'F': /* filename */
-				  	if (netcdf == MB_YES) fprintf(output[i], "\"");
-					fprintf(output[i], "%s", file);
-
-					if (netcdf == MB_YES) fprintf(output[i], "\"");
-
-					if (ascii == MB_NO)
-					  for (k = strlen(file); k < MB_PATH_MAXLINE; k++)
-					    fwrite(&file[strlen(file)], sizeof(char), 1, outfile);
-
-					raw_next_value = MB_NO;
-					break;
-
-				case 'f': /* format */
-					if (ascii == MB_YES)
-					    fprintf(output[i],"%6d",format);
-					else
-					    {
-					    b = format;
-					    fwrite(&b, sizeof(double), 1, outfile);
-					    }
-					raw_next_value = MB_NO;
-					break;
-
-					break;
-				case 'G': /* TVG start */
-					if (ascii == MB_YES)
-					    fprintf(output[i],"%6d",tvg_start);
-					else
-					    {
-					    b = tvg_start;
-					    fwrite(&b, sizeof(double), 1, outfile);
-					    }
-					raw_next_value = MB_NO;
-					break;
-				case 'g': /* TVG stop */
-					if (ascii == MB_YES)
-					    fprintf(output[i],"%6d",tvg_stop);
-					else
-					    {
-					    b = tvg_stop;
-					    fwrite(&b, sizeof(double), 1, outfile);
-					    }
-					raw_next_value = MB_NO;
-					break;
-				case 'L': /* Pulse length */
-					if (ascii == MB_YES)
-					    fprintf(output[i],"%6d",ipulse_length);
-					else
-					    {
-					    b = ipulse_length;
-					    fwrite(&b, sizeof(double), 1, outfile);
-					    }
-					raw_next_value = MB_NO;
-					break;
-				case 'l': /* Transmit pulse length (sec) */
-					printsimplevalue(verbose, output[i], pulse_length, 9, 6, ascii,
-							    &invert_next_value,
-							    &signflip_next_value, &error);
-					raw_next_value = MB_NO;
-					break;
-				case 'M': /* mode */
-					if (ascii == MB_YES)
-					    fprintf(output[i],"%4d",mode);
-					else
-					    {
-					    b = mode;
-					    fwrite(&b, sizeof(double), 1, outfile);
-					    }
-					raw_next_value = MB_NO;
-					break;
-				case 'N': /* ping counter */
-					if (ascii == MB_YES)
-					    fprintf(output[i],"%6d",png_count);
-					else
-					    {
-					    b = png_count;
-					    fwrite(&b, sizeof(double), 1, outfile);
-					    }
-					raw_next_value = MB_NO;
-					break;
-				case 'p': /* sidescan */
-					invert = invert_next_value;
-					flip = signflip_next_value;
-				  	printsimplevalue(verbose, output[i], ss_pixels[start_sample[k]], 5, 1, ascii,
-							 &invert_next_value,
-							 &signflip_next_value, &error);
-					if (count > 0)
-					  {
-					    for (m = 1; m < count && m < beam_samples[k]; m++)
-					      {
-						if (netcdf == MB_YES)
-						  fprintf(output[i], ", ");
-						if (ascii == MB_YES)
-						  fprintf(output[i], "%s", delimiter);
-						invert_next_value = invert;
-						signflip_next_value = flip;
-
-						printsimplevalue(verbose, output[i], ss_pixels[start_sample[k] + m], 5, 1, ascii,
-								 &invert_next_value,
-								 &signflip_next_value, &error);
-					      }
-					    for (; m < count; m++)
-					      {
-						if (netcdf == MB_YES)
-						  fprintf(output[i], ", ");
-						if (ascii == MB_YES)
-						  fprintf(output[i], "%s", delimiter);
-						printNaN(verbose, output[i], ascii, &invert_next_value,
-							 &signflip_next_value, &error);
-					      }
-					  }
-
-					raw_next_value = MB_NO;
-					break;
-				case 'R': /* range */
-					if (ascii == MB_YES)
-					    fprintf(output[i],"%6d",range[k]);
-					else
-					    {
-					    b = range[k];
-					    fwrite(&b, sizeof(double), 1, outfile);
-					    }
-					raw_next_value = MB_NO;
-					break;
-				case 'r': /* Sample rate */
-					if (ascii == MB_YES)
-					    fprintf(output[i],"%6d",sample_rate);
-					else
-					    {
-					    b = sample_rate;
-					    fwrite(&b, sizeof(double), 1, outfile);
-					    }
-					raw_next_value = MB_NO;
-					break;
-				case 'S': /* Sidescan pixels */
-					if (ascii == MB_YES)
-					    fprintf(output[i],"%6d",npixels);
-					else
-					    {
-					    b = npixels;
-					    fwrite(&b, sizeof(double), 1, outfile);
-					    }
-					raw_next_value = MB_NO;
-					break;
-				case 's': /* Sidescan pixels per beam */
-					if (ascii == MB_YES)
-					    fprintf(output[i],"%6d",beam_samples[k]);
-					else
-					    {
-					    b = beam_samples[k];
-					    fwrite(&b, sizeof(double), 1, outfile);
-					    }
-					raw_next_value = MB_NO;
-					break;
-				case 'T': /* Transmit gain (dB) */
-					printsimplevalue(verbose, output[i], transmit_gain, 5, 1, ascii,
-							    &invert_next_value,
-							    &signflip_next_value, &error);
-					raw_next_value = MB_NO;
-					break;
-				case 't': /* Receive gain (dB) */
-					printsimplevalue(verbose, output[i], receive_gain, 5, 1, ascii,
-							    &invert_next_value,
-							    &signflip_next_value, &error);
-					raw_next_value = MB_NO;
-					break;
-
-				default:
-					if (ascii == MB_YES)
-					    fprintf(output[i],"<Invalid Option: %c>",
-						list[i]);
-					raw_next_value = MB_NO;
-					break;
-				}
-			    }
-			if (ascii == MB_YES)
-			    {
-			    if (i<(n_list-1)) fprintf(output[i], "%s", delimiter);
-			    else fprintf (output[lcount++ % n_list], "\n");
-			    }
-			}
-		    }
-		  }
-
-		/* now loop over pixels */
-		if (error == MB_ERROR_NO_ERROR && (nread - 1) % decimate == 0)
-		for (j=pixel_start;j<=pixel_end;j++)
-		  {
-		  /* check pixel status */
-		  pixel_status = MB_SUCCESS;
-		  if (check_bath == MB_YES && j != pixel_vertical)
-			pixel_status = MB_FAILURE;
-		  else if (check_bath == MB_YES && j == pixel_vertical)
-			{
-			if (check_values == MBLIST_CHECK_ON
-			    && !mb_beam_ok(beamflag[beam_vertical]))
-				pixel_status = MB_FAILURE;
-			else if (check_values == MBLIST_CHECK_ON_NULL
-			    && beamflag[beam_vertical] == MB_FLAG_NULL)
-				pixel_status = MB_FAILURE;
-			}
-		  if (check_amp == MB_YES && j != pixel_vertical)
-			pixel_status = MB_FAILURE;
-		  else if (check_amp == MB_YES && j == pixel_vertical)
-			{
-			if (check_values == MBLIST_CHECK_ON
-			    && !mb_beam_ok(beamflag[beam_vertical]))
-				pixel_status = MB_FAILURE;
-			else if (check_values == MBLIST_CHECK_ON_NULL
-			    && beamflag[beam_vertical] == MB_FLAG_NULL)
-				pixel_status = MB_FAILURE;
-			}
-		  if (check_ss == MB_YES && ss[j] <= MB_SIDESCAN_NULL)
-			pixel_status = MB_FAILURE;
-		  if (use_time_interval == MB_YES && first == MB_YES)
-			pixel_status = MB_FAILURE;
-		  if (check_nav == MB_YES && (navlon == 0.0 || navlon == 0.0))
-		  	pixel_status = MB_FAILURE;
-
-		  /* print out good pixels */
-		  if (pixel_status == MB_SUCCESS)
-		    {
-		    for (i=0; i<n_list; i++)
-			{
-			if (netcdf == MB_YES && lcount > 0)
-			  fprintf(output[i], ", ");
-			if (port_next_value == MB_YES)
-				{
-				k = pixel_port;
-				port_next_value = MB_NO;
-				}
-			else if (stbd_next_value == MB_YES)
-				{
-				k = pixel_stbd;
-				stbd_next_value = MB_NO;
-				}
-			else
-				k = j;
-
-
-			if (raw_next_value == MB_NO)
-			    {
-			    switch (list[i])
-				{
-				case '/': /* Inverts next simple value */
-					invert_next_value = MB_YES;
-					break;
-				case '-': /* Flip sign on next simple value */
-					signflip_next_value = MB_YES;
-					break;
-				case '.': /* Raw value next field */
-					raw_next_value = MB_YES;
-					count = 0;
-					break;
-				case '=': /* Port-most value next field -ignored here */
-				  	port_next_value = MB_YES;
-				  	break;
-				case '+': /* Starboard-most value next field - ignored here*/
-				  	stbd_next_value = MB_YES;
-				  	break;
-				case 'A': /* Average seafloor crosstrack slope */
-					printsimplevalue(verbose, output[i], avgslope, 0, 4, ascii,
-							    &invert_next_value,
-							    &signflip_next_value, &error);
-					break;
-				case 'a': /* Per-pixel seafloor crosstrack slope */
-					status = get_bathyslope(verbose,
-						ndepths,depths,depthacrosstrack,
-						nslopes,slopes,slopeacrosstrack,
-						ssacrosstrack[k],
-						&depth,&slope,&error);
-					printsimplevalue(verbose, output[i], slope, 0, 4, ascii,
-							    &invert_next_value,
-							    &signflip_next_value, &error);
-					break;
-				case 'B': /* amplitude */
-					printsimplevalue(verbose, output[i], amp[beam_vertical], 0, 3, ascii,
-							    &invert_next_value,
-							    &signflip_next_value, &error);
-					break;
-				case 'b': /* sidescan */
-					printsimplevalue(verbose, output[i], ss[k], 0, 3, ascii,
-							    &invert_next_value,
-							    &signflip_next_value, &error);
-					break;
-				case 'C': /* Sonar altitude (m) */
-					printsimplevalue(verbose, output[i], altitude, 0, 4, ascii,
-							    &invert_next_value,
-							    &signflip_next_value, &error);
-					break;
-				case 'c': /* Sonar transducer depth (m) */
-					printsimplevalue(verbose, output[i], sonardepth, 0, 4, ascii,
-							    &invert_next_value,
-							    &signflip_next_value, &error);
-					break;
-				case 'D': /* acrosstrack dist. */
-				case 'd':
-					b = bathy_scale * ssacrosstrack[k];
-					printsimplevalue(verbose, output[i], b, 0, 4, ascii,
-							&invert_next_value,
-							    &signflip_next_value, &error);
-					break;
-				case 'E': /* alongtrack dist. */
-				case 'e':
-					b = bathy_scale * ssalongtrack[k];
-					printsimplevalue(verbose, output[i], b, 0, 4, ascii,
-							&invert_next_value,
-							    &signflip_next_value, &error);
-					break;
-				case 'G': /* flat bottom grazing angle */
-					status = get_bathyslope(verbose,
-					    ndepths,depths,depthacrosstrack,
-					    nslopes,slopes,slopeacrosstrack,
-					    ssacrosstrack[k],
-					    &depth,&slope,&error);
-					angle = RTD*(atan(ssacrosstrack[k] / (depth - sonardepth)));
-					printsimplevalue(verbose, output[i], angle, 0, 3, ascii,
-							    &invert_next_value,
-							    &signflip_next_value, &error);
-					break;
-				case 'g': /* grazing angle using slope */
-					status = get_bathyslope(verbose,
-					    ndepths,depths,depthacrosstrack,
-					    nslopes,slopes,slopeacrosstrack,
-					    ssacrosstrack[k],
-					    &depth,&slope,&error);
-					angle = RTD * (atan(bathacrosstrack[k] / (depth - sonardepth)))
-					    + slope;
-					printsimplevalue(verbose, output[i], angle, 0, 3, ascii,
-							    &invert_next_value,
-							    &signflip_next_value, &error);
-					break;
-				case 'H': /* heading */
-					printsimplevalue(verbose, output[i], heading, 7, 3, ascii,
-							    &invert_next_value,
-							    &signflip_next_value, &error);
-					break;
-				case 'h': /* course */
-					printsimplevalue(verbose, output[i], course, 7, 3, ascii,
-							    &invert_next_value,
-							    &signflip_next_value, &error);
-					break;
-				case 'J': /* time string */
-					mb_get_jtime(verbose,time_i,time_j);
-					seconds = time_i[5] + 1e-6 * time_i[6];
-					if (ascii == MB_YES)
-					    {
-					    if (netcdf == MB_YES)
-					    fprintf(output[i],"%d, %d, %d, %d, %d, %d",
-						time_j[0],time_j[1],
-						time_i[3],time_i[4],
-						time_i[5],time_i[6]);
-					    else
-					    fprintf(output[i],"%.4d %.3d %.2d %.2d %9.6f",
-						time_j[0],time_j[1],
-						time_i[3],time_i[4],
-						seconds);
-					    }
-					else
-					    {
-					    b = time_j[0];
-					    fwrite(&b, sizeof(double), 1, outfile);
-					    b = time_j[1];
-					    fwrite(&b, sizeof(double), 1, outfile);
-					    b = time_i[3];
-					    fwrite(&b, sizeof(double), 1, outfile);
-					    b = time_i[4];
-					    fwrite(&b, sizeof(double), 1, outfile);
-					    b = time_i[5];
-					    fwrite(&b, sizeof(double), 1, outfile);
-					    b = time_i[6];
-					    fwrite(&b, sizeof(double), 1, outfile);
-					    }
-					break;
-				case 'j': /* time string */
-					mb_get_jtime(verbose,time_i,time_j);
-					seconds = time_i[5] + 1e-6 * time_i[6];
-					if (ascii == MB_YES)
-					    {
-					    if (netcdf == MB_YES)
-					    fprintf(output[i],"%d, %d, %d, %d, %d",
-						time_j[0],time_j[1],
-						time_j[2],time_j[3],time_j[4]);
-					    else
-					    fprintf(output[i],"%.4d %.3d %.4d %9.6f",
-						time_j[0],time_j[1],
-						time_j[2],seconds);
-					    }
-					else
-					    {
-					    b = time_j[0];
-					    fwrite(&b, sizeof(double), 1, outfile);
-					    b = time_j[1];
-					    fwrite(&b, sizeof(double), 1, outfile);
-					    b = time_j[2];
-					    fwrite(&b, sizeof(double), 1, outfile);
-					    b = time_j[3];
-					    fwrite(&b, sizeof(double), 1, outfile);
-					    b = time_j[4];
-					    fwrite(&b, sizeof(double), 1, outfile);
-					    }
-					break;
-				case 'L': /* along-track distance (km) */
-					printsimplevalue(verbose, output[i], distance_total, 8, 4, ascii,
-							    &invert_next_value,
-							    &signflip_next_value, &error);
-					break;
-				case 'l': /* along-track distance (m) */
-					printsimplevalue(verbose, output[i], 1000.0 * distance_total, 8, 4, ascii,
-							    &invert_next_value,
-							    &signflip_next_value, &error);
-					break;
-				case 'M': /* Decimal unix seconds since
-						1/1/70 00:00:00 */
-					printsimplevalue(verbose, output[i], time_d, 0, 6, ascii,
-							    &invert_next_value,
-							    &signflip_next_value, &error);
-					break;
-				case 'm': /* time in decimal seconds since
-						first record */
-					if (first_m == MB_YES)
-						{
-						time_d_ref = time_d;
-						first_m = MB_NO;
-						}
-					b = time_d - time_d_ref;
-					printsimplevalue(verbose, output[i], b, 0, 6, ascii,
-							    &invert_next_value,
-							    &signflip_next_value, &error);
-					break;
-				case 'N': /* ping counter */
-					if (ascii == MB_YES)
-					    fprintf(output[i],"%6d",pingnumber);
-					else
-					    {
-					    b = pingnumber;
-					    fwrite(&b, sizeof(double), 1, outfile);
-					    }
-					break;
-				case 'P': /* pitch */
-					printsimplevalue(verbose, output[i], pitch, 6, 3, ascii,
-							    &invert_next_value,
-							    &signflip_next_value, &error);
-					break;
-				case 'p': /* draft */
-					printsimplevalue(verbose, output[i], draft, 6, 3, ascii,
-							    &invert_next_value,
-							    &signflip_next_value, &error);
-					break;
-				case 'Q': /* bottom detection type */
-					if (ascii == MB_YES)
-					    {
-					    if (netcdf == MB_YES) fprintf(output[i], "\"");
-
-					    fprintf(output[i],"%d",MB_DETECT_UNKNOWN);
-					    if (netcdf == MB_YES) fprintf(output[i], "\"");
-					    }
-					else
-					    {
-					    b = MB_DETECT_UNKNOWN;
-					    fwrite(&b, sizeof(double), 1, outfile);
-					    }
-					break;
-				case 'R': /* roll */
-					printsimplevalue(verbose, output[i], roll, 6, 3, ascii,
-							    &invert_next_value,
-							    &signflip_next_value, &error);
-					break;
-				case 'r': /* heave */
-					printsimplevalue(verbose, output[i], heave, 7, 4, ascii,
-							    &invert_next_value,
-							    &signflip_next_value, &error);
-					break;
-				case 'S': /* speed */
-					printsimplevalue(verbose, output[i], speed, 6, 3, ascii,
-							    &invert_next_value,
-							    &signflip_next_value, &error);
-					break;
-				case 's': /* speed made good */
-					printsimplevalue(verbose, output[i], speed_made_good, 6, 3, ascii,
-							    &invert_next_value,
-							    &signflip_next_value, &error);
-					break;
-				case 'T': /* yyyy/mm/dd/hh/mm/ss time string */
-					seconds = time_i[5] + 1e-6 * time_i[6];
-					if (ascii == MB_YES)
-					    {
-					    if (netcdf == MB_YES) fprintf(output[i], "\"");
-					    fprintf(output[i],"%.4d/%.2d/%.2d/%.2d/%.2d/%9.6f",
-						time_i[0],time_i[1],time_i[2],
-						time_i[3],time_i[4],seconds);
-					    if (netcdf == MB_YES) fprintf(output[i], "\"");
-					    }
-					else
-					    {
-					    b = time_i[0];
-					    fwrite(&b, sizeof(double), 1, outfile);
-					    b = time_i[1];
-					    fwrite(&b, sizeof(double), 1, outfile);
-					    b = time_i[2];
-					    fwrite(&b, sizeof(double), 1, outfile);
-					    b = time_i[3];
-					    fwrite(&b, sizeof(double), 1, outfile);
-					    b = time_i[4];
-					    fwrite(&b, sizeof(double), 1, outfile);
-					    b = seconds;
-					    fwrite(&b, sizeof(double), 1, outfile);
-					    }
-					break;
-				case 't': /* yyyy mm dd hh mm ss time string */
-					seconds = time_i[5] + 1e-6 * time_i[6];
-					if (ascii == MB_YES)
-					    {
-					    if (netcdf == MB_YES)
-					    fprintf(output[i],"%d, %d, %d, %d, %d, %d, %d",
-						time_i[0],time_i[1],time_i[2],
-						time_i[3],time_i[4],time_i[5],
-						time_i[6]);
-					    else
-					    fprintf(output[i],"%.4d %.2d %.2d %.2d %.2d %9.6f",
-						time_i[0],time_i[1],time_i[2],
-						time_i[3],time_i[4],seconds);
-					    }
-					else
-					    {
-					    b = time_i[0];
-					    fwrite(&b, sizeof(double), 1, outfile);
-					    b = time_i[1];
-					    fwrite(&b, sizeof(double), 1, outfile);
-					    b = time_i[2];
-					    fwrite(&b, sizeof(double), 1, outfile);
-					    b = time_i[3];
-					    fwrite(&b, sizeof(double), 1, outfile);
-					    b = time_i[4];
-					    fwrite(&b, sizeof(double), 1, outfile);
-					    b = seconds;
-					    fwrite(&b, sizeof(double), 1, outfile);
-					    }
-					break;
-				case 'U': /* unix time in seconds since 1/1/70 00:00:00 */
-					time_u = (int) time_d;
-					if (ascii == MB_YES)
-					    fprintf(output[i],"%ld",time_u);
-					else
-					    {
-					    b = time_u;
-					    fwrite(&b, sizeof(double), 1, outfile);
-					    }
-					break;
-				case 'u': /* time in seconds since first record */
-					time_u = (int) time_d;
-					if (first_u == MB_YES)
-						{
-						time_u_ref = time_u;
-						first_u = MB_NO;
-						}
-					if (ascii == MB_YES)
-					    fprintf(output[i],"%ld",time_u - time_u_ref);
-					else
-					    {
-					    b = time_u - time_u_ref;
-					    fwrite(&b, sizeof(double), 1, outfile);
-					    }
-					break;
-				case 'V': /* time in seconds since last ping */
-				case 'v':
-					if (ascii == MB_YES)
-					    {
-					    if ( fabs(time_interval) > 100. )
-						fprintf(output[i],"%g",time_interval);
-					    else
-						fprintf(output[i],"%10.6f",time_interval);
-					    }
-					else
-					    {
-					    fwrite(&time_interval, sizeof(double), 1, outfile);
-					    }
-					break;
-				case 'X': /* longitude decimal degrees */
-					dlon = navlon;
-					if (pixel_set != MBLIST_SET_OFF || k != j)
-					    dlon += headingy*mtodeglon
-							*ssacrosstrack[k]
-						    + headingx*mtodeglon
-							*ssalongtrack[k];
-					printsimplevalue(verbose, output[i], dlon, 15, 10, ascii,
-							    &invert_next_value,
-							    &signflip_next_value, &error);
-					break;
-				case 'x': /* longitude degress + decimal minutes */
-					dlon = navlon;
-					if (pixel_set != MBLIST_SET_OFF || k != j)
-					    dlon += headingy*mtodeglon
-							*ssacrosstrack[k]
-						    + headingx*mtodeglon
-							*ssalongtrack[k];
-					if (dlon < 0.0)
-						{
-						hemi = 'W';
-						dlon = -dlon;
-						}
-					else
-						hemi = 'E';
-					degrees = (int) dlon;
-					minutes = 60.0*(dlon - degrees);
-					if (ascii == MB_YES)
-					    {
-					    if (netcdf == MB_YES) fprintf(output[i], "\"");
-					    fprintf(output[i],"%3d %11.8f%c",
-						degrees, minutes, hemi);
-					    if (netcdf == MB_YES) fprintf(output[i], "\"");
-					    }
-					else
-					    {
-					    b = degrees;
-					    if (hemi == 'W') b = -b;
-					    fwrite(&b, sizeof(double), 1, outfile);
-					    b = minutes;
-					    fwrite(&b, sizeof(double), 1, outfile);
-					    }
-					break;
-				case 'Y': /* latitude decimal degrees */
-					dlat = navlat;
-					if (pixel_set != MBLIST_SET_OFF || k != j)
-					    dlat += -headingx*mtodeglat
-							*ssacrosstrack[k]
-						    + headingy*mtodeglat
-							*ssalongtrack[k];
-					printsimplevalue(verbose, output[i], dlat, 15, 10, ascii,
-							    &invert_next_value,
-							    &signflip_next_value, &error);
-					break;
-				case 'y': /* latitude degrees + decimal minutes */
-					dlat = navlat;
-					if (pixel_set != MBLIST_SET_OFF || k != j)
-					    dlat += -headingx*mtodeglat
-							*ssacrosstrack[k]
-						    + headingy*mtodeglat
-							*ssalongtrack[k];
-					if (dlat < 0.0)
-						{
-						hemi = 'S';
-						dlat = -dlat;
-						}
-					else
-						hemi = 'N';
-					degrees = (int) dlat;
-					minutes = 60.0*(dlat - degrees);
-					if (ascii == MB_YES)
-					    {
-					    if (netcdf == MB_YES) fprintf(output[i], "\"");
-					    fprintf(output[i],"%3d %11.8f%c",
-						degrees, minutes, hemi);
-					    if (netcdf == MB_YES) fprintf(output[i], "\"");
-					    }
-					else
-					    {
-					    b = degrees;
-					    if (hemi == 'S') b = -b;
-					    fwrite(&b, sizeof(double), 1, outfile);
-					    b = minutes;
-					    fwrite(&b, sizeof(double), 1, outfile);
-					    }
-					break;
-				case 'Z': /* topography */
-					if (beamflag[beam_vertical] == MB_FLAG_NULL
-					    && (check_values == MBLIST_CHECK_OFF_NAN
-						|| check_values == MBLIST_CHECK_OFF_FLAGNAN))
-					    {
-					    printNaN(verbose, output[i], ascii, &invert_next_value,
-							    &signflip_next_value, &error);
-					    }
-					else if (!mb_beam_ok(beamflag[beam_vertical])
-					    && check_values == MBLIST_CHECK_OFF_FLAGNAN)
-					    {
-					    printNaN(verbose, output[i], ascii, &invert_next_value,
-							    &signflip_next_value, &error);
-					    }
-					else
-					    {
-					    b = -bathy_scale * bath[beam_vertical];
-					    printsimplevalue(verbose, output[i], b, 0, 4, ascii,
-							    &invert_next_value,
-							    &signflip_next_value, &error);
-					    }
-					break;
-				case 'z': /* depth */
-					if (beamflag[beam_vertical] == MB_FLAG_NULL
-					    && (check_values == MBLIST_CHECK_OFF_NAN
-						|| check_values == MBLIST_CHECK_OFF_FLAGNAN))
-					    {
-					    printNaN(verbose, output[i], ascii, &invert_next_value,
-							    &signflip_next_value, &error);
-					    }
-					else if (!mb_beam_ok(beamflag[beam_vertical])
-					    && check_values == MBLIST_CHECK_OFF_FLAGNAN)
-					    {
-					    printNaN(verbose, output[i], ascii, &invert_next_value,
-							    &signflip_next_value, &error);
-					    }
-					else
-					    {
-					    b = bathy_scale * bath[beam_vertical];
-					    printsimplevalue(verbose, output[i], b, 0, 4, ascii,
-							    &invert_next_value,
-							    &signflip_next_value, &error);
-					    }
-					break;
-				case '#': /* pixel number */
-					if (ascii == MB_YES)
-					    fprintf(output[i],"%6d",k);
-					else
-					    {
-					    b = k;
-					    fwrite(&b, sizeof(double), 1, outfile);
-					    }
-					break;
-				default:
-					fprintf(output[i],"<Invalid Option: %c>",
-						list[i]);
-					break;
-				}
-			    }
-			else /* raw_next_value */
-			    {
-			    switch (list[i])
-				{
-				case '/': /* Inverts next simple value */
-					invert_next_value = MB_YES;
-					break;
-				case '-': /* Flip sign on next simple value */
-					signflip_next_value = MB_YES;
-					break;
-				case '.': /* Raw value next field */
-					raw_next_value = MB_YES;
-					count = 0;
-					break;
-				case '=': /* Port-most value next field -ignored here */
-				  	port_next_value = MB_YES;
-				  	break;
-				case '+': /* Starboard-most value next field - ignored here*/
-				  	stbd_next_value = MB_YES;
-				  	break;
-
-				case '0':
-				case '1':
-				case '2':
-				case '3':
-				case '4':
-				case '5':
-				case '6':
-				case '7':
-				case '8':
-				case '9':
-					count = count * 10 + list[i] - '0';
-					break;
-
-				case 'A': /* backscatter */
-				        printsimplevalue(verbose, output[i], bs[beam_vertical], 5, 1, ascii,
-							    &invert_next_value,
-							    &signflip_next_value, &error);
-					raw_next_value = MB_NO;
-					break;
-				case 'a': /* absorption */
-				        printsimplevalue(verbose, output[i], absorption, 5, 2, ascii,
-							    &invert_next_value,
-							    &signflip_next_value, &error);
-					raw_next_value = MB_NO;
-					break;
-				case 'B': /* BSN - Normal incidence backscatter */
-				        printsimplevalue(verbose, output[i], bsn, 5, 2, ascii,
-							    &invert_next_value,
-							    &signflip_next_value, &error);
-					raw_next_value = MB_NO;
-					break;
-				case 'b': /* BSO - Oblique backscatter */
-					printsimplevalue(verbose, output[i], bso, 5, 2, ascii,
-							    &invert_next_value,
-							    &signflip_next_value, &error);
-					raw_next_value = MB_NO;
-					break;
-				case 'c': /* Mean backscatter */
-				  	mback = 0;
-					nback = 0;
-				  	for (m = 0; m < beams_amp ; m++) {
-					  if (mb_beam_ok(beamflag[m])) {
-					    mback += amp[m];
-					    nback++;
-					  }
-					}
-					printsimplevalue(verbose, output[i], mback / nback, 5, 2, ascii,
-							    &invert_next_value,
-							    &signflip_next_value, &error);
-					raw_next_value = MB_NO;
-					break;
-				case 'd': /* beam depression angle */
-				        printsimplevalue(verbose, output[i], depression[beam_vertical], 5, 2, ascii,
-							    &invert_next_value,
-							    &signflip_next_value, &error);
-					raw_next_value = MB_NO;
-					break;
-				case 'F': /* filename */
-				  	if (netcdf == MB_YES) fprintf(output[i], "\"");
-					fprintf(output[i], "%s", file);
-					if (netcdf == MB_YES) fprintf(output[i], "\"");
-
-					if (ascii == MB_NO)
-					  for (k = strlen(file); k < MB_PATH_MAXLINE; k++)
-					    fwrite(&file[strlen(file)], sizeof(char), 1, outfile);
-
-					raw_next_value = MB_NO;
-					break;
-
-				case 'f': /* format */
-					if (ascii == MB_YES)
-					    fprintf(output[i],"%6d",format);
-					else
-					    {
-					    b = format;
-					    fwrite(&b, sizeof(double), 1, outfile);
-					    }
-					raw_next_value = MB_NO;
-					break;
-
-				case 'G': /* TVG start */
-					if (ascii == MB_YES)
-					    fprintf(output[i],"%6d",tvg_start);
-					else
-					    {
-					    b = tvg_start;
-					    fwrite(&b, sizeof(double), 1, outfile);
-					    }
-					raw_next_value = MB_NO;
-					break;
-				case 'g': /* TVG stop */
-					if (ascii == MB_YES)
-					    fprintf(output[i],"%6d",tvg_stop);
-					else
-					    {
-					    b = tvg_stop;
-					    fwrite(&b, sizeof(double), 1, outfile);
-					    }
-					raw_next_value = MB_NO;
-					break;
-				case 'L': /* Pulse length */
-					if (ascii == MB_YES)
-					    fprintf(output[i],"%6d",ipulse_length);
-					else
-					    {
-					    b = ipulse_length;
-					    fwrite(&b, sizeof(double), 1, outfile);
-					    }
-					raw_next_value = MB_NO;
-					break;
-				case 'l': /* Transmit pulse length (sec) */
-					printsimplevalue(verbose, output[i], pulse_length, 9, 6, ascii,
-							    &invert_next_value,
-							    &signflip_next_value, &error);
-					raw_next_value = MB_NO;
-					break;
-				case 'M': /* mode */
-					if (ascii == MB_YES)
-					    fprintf(output[i],"%4d",mode);
-					else
-					    {
-					    b = mode;
-					    fwrite(&b, sizeof(double), 1, outfile);
-					    }
-					raw_next_value = MB_NO;
-					break;
-				case 'N': /* ping counter */
-					if (ascii == MB_YES)
-					    fprintf(output[i],"%6d",png_count);
-					else
-					    {
-					    b = png_count;
-					    fwrite(&b, sizeof(double), 1, outfile);
-					    }
-					raw_next_value = MB_NO;
-					break;
-				case 'p': /* sidescan */
-					invert = invert_next_value;
-					flip = signflip_next_value;
-				  	printsimplevalue(verbose, output[i], ss_pixels[start_sample[beam_vertical]], 5, 1, ascii,
-							 &invert_next_value,
-							 &signflip_next_value, &error);
-					if (count > 0)
-					  {
-					    for (m = 1; m < count && m < beam_samples[beam_vertical]; m++)
-					      {
-						if (netcdf == MB_YES)
-						  fprintf(output[i], ", ");
-						if (ascii == MB_YES)
-						  fprintf(output[i], "%s", delimiter);
-						invert_next_value = invert;
-						signflip_next_value = flip;
-
-						printsimplevalue(verbose, output[i], ss_pixels[start_sample[beam_vertical] + m], 5, 1, ascii,
-								 &invert_next_value,
-								 &signflip_next_value, &error);
-					      }
-					    for (; m < count; m++)
-					      {
-						if (netcdf == MB_YES)
-						  fprintf(output[i], ", ");
-						if (ascii == MB_YES)
-						  fprintf(output[i], "%s", delimiter);
-						printNaN(verbose, output[i], ascii, &invert_next_value,
-							 &signflip_next_value, &error);
-					      }
-					  }
-
-					raw_next_value = MB_NO;
-					break;
-
-				case 'R': /* range */
-					if (ascii == MB_YES)
-					    fprintf(output[i],"%6d",range[beam_vertical]);
-					else
-					    {
-					    b = range[beam_vertical];
-					    fwrite(&b, sizeof(double), 1, outfile);
-					    }
-					raw_next_value = MB_NO;
-					break;
-
-				case 'r': /* Sample rate */
-					if (ascii == MB_YES)
-					    fprintf(output[i],"%6d",sample_rate);
-					else
-					    {
-					    b = sample_rate;
-					    fwrite(&b, sizeof(double), 1, outfile);
-					    }
-					raw_next_value = MB_NO;
-					break;
-
-				case 'S': /* Sidescan pixels */
-					if (ascii == MB_YES)
-					    fprintf(output[i],"%6d",npixels);
-					else
-					    {
-					    b = npixels;
-					    fwrite(&b, sizeof(double), 1, outfile);
-					    }
-					raw_next_value = MB_NO;
-					break;
-				case 's': /* Sidescan pixels per beam */
-					if (ascii == MB_YES)
-					    fprintf(output[i],"%6d",beam_samples[beam_vertical]);
-					else
-					    {
-					    b = beam_samples[beam_vertical];
-					    fwrite(&b, sizeof(double), 1, outfile);
-					    }
-					raw_next_value = MB_NO;
-					break;
-				case 'T': /* Transmit gain (dB) */
-					printsimplevalue(verbose, output[i], transmit_gain, 5, 1, ascii,
-							    &invert_next_value,
-							    &signflip_next_value, &error);
-					raw_next_value = MB_NO;
-					break;
-				case 't': /* Receive gain (dB) */
-					printsimplevalue(verbose, output[i], receive_gain, 5, 1, ascii,
-							    &invert_next_value,
-							    &signflip_next_value, &error);
-					raw_next_value = MB_NO;
-					break;
-
-				default:
-					if (ascii == MB_YES)
-					    fprintf(output[i],"<Invalid Option: %c>",
-						list[i]);
-					raw_next_value = MB_NO;
-					break;
-				}
-			    }
-			if (ascii == MB_YES)
-			    {
-			    if (i<(n_list-1)) fprintf(output[i], "%s", delimiter);
-			    else fprintf (output[lcount++ % n_list], "\n");
-			    }
-			}
-		    }
-		  }
-
-		/* reset first flag */
-		if (error == MB_ERROR_NO_ERROR && first == MB_YES)
-			{
-			first = MB_NO;
-			}
-
-		}
-
-	/* close the swath file */
-	status = mb_close(verbose,&mbio_ptr,&error);
-
-	/* deallocate memory used for data arrays */
-	if (use_raw == MB_YES)
-		{
-		mb_freed(verbose,__FILE__, __LINE__, (void **)&ss_pixels,&error);
-		}
-
-	/* figure out whether and what to read next */
-        if (read_datalist == MB_YES)
-                {
-		if ((status = mb_datalist_read(verbose,datalist,
-			    file,&format,&file_weight,&error))
-			    == MB_SUCCESS)
-                        read_data = MB_YES;
-                else
-                        read_data = MB_NO;
-                }
-        else
-                {
-                read_data = MB_NO;
-                }
-
-	/* end loop over files in list */
-	}
-	if (read_datalist == MB_YES)
-		mb_datalist_close(verbose,&datalist,&error);
-
-	/* compile CDL file */
-	if (netcdf == MB_YES)
-	    {
-	    for (i=0; i<n_list; i++)
-	        {
-		if(list[i] != '/' && list[i] != '-' && list[i] != '.' &&
-		   !(list[i] >= '0' && list[i] <= '9'))
-		    {
-		    fprintf(output[i], " ;\n\n");
-		    rewind(output[i]);
-
-		    /* copy data to CDL file */
-		    for (j = fread(buffer, sizeof(char), MB_BUFFER_MAX, output[i]);
-			 j > 0;
-			 j = fread(buffer, sizeof(char), MB_BUFFER_MAX, output[i]))
-		        {
-			if (j != fwrite(buffer, sizeof(char), j, outfile))
-			    {
-			    fprintf(stderr, "Error writing to CDL file");
-			    }
-			}
-		    }
-		fclose(output[i]);
-		}
-
-	    fprintf(outfile, "}\n");
-	    fclose(outfile);
-
-	    /* convert cdl to netcdf */
-	    if (netcdf_cdl == MB_NO)
-	        {
-		sprintf(output_file_temp, "ncgen -o %s %s.cdl", output_file, output_file);
-		shellstatus = system(output_file_temp);
-		if (shellstatus == 0)
-		    {
-		    sprintf(output_file_temp, "rm %s.cdl", output_file);
-		    shellstatus = system(output_file_temp);
-		    }
-		}
-	    }
-	else
-	    {
-	    fclose(outfile);
-	    }
-
-	/* check memory */
-	if (verbose >= 4)
-		status = mb_memory_list(verbose,&error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  Program <%s> completed\n",
-			program_name);
-		fprintf(stderr,"dbg2  Ending status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* end it all */
-	exit(error);
-}
-/*--------------------------------------------------------------------*/
-int set_output(	int	verbose,
-		int	beams_bath,
-		int	beams_amp,
-		int	pixels_ss,
-		int	use_bath,
-		int	use_amp,
-		int	use_ss,
-		int	dump_mode,
-		int	beam_set,
-		int	pixel_set,
-		int	beam_vertical,
-		int	pixel_vertical,
-		int	*beam_start,
-		int	*beam_end,
-		int     *beam_exclude_percent,
-		int	*pixel_start,
-		int	*pixel_end,
-		int	*n_list,
-		char	*list,
-		int	*error)
-{
-	char	*function_name = "set_output";
-	int	status = MB_SUCCESS;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBLIST function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:         %d\n",verbose);
-		fprintf(stderr,"dbg2       beams_bath:      %d\n",beams_bath);
-		fprintf(stderr,"dbg2       beams_amp:       %d\n",beams_amp);
-		fprintf(stderr,"dbg2       pixels_ss:       %d\n",pixels_ss);
-		fprintf(stderr,"dbg2       use_bath:        %d\n",use_bath);
-		fprintf(stderr,"dbg2       use_amp:         %d\n",use_amp);
-		fprintf(stderr,"dbg2       use_ss:          %d\n",use_ss);
-		fprintf(stderr,"dbg2       dump_mode:       %d\n",dump_mode);
-		fprintf(stderr,"dbg2       :        %d\n",beam_set);
-		fprintf(stderr,"dbg2       pixel_set:       %d\n",pixel_set);
-		fprintf(stderr,"dbg2       beam_vertical:   %d\n",beam_vertical);
-		fprintf(stderr,"dbg2       pixel_vertical:  %d\n",pixel_vertical);
-		fprintf(stderr,"dbg2       beam_start:      %d\n",*beam_start);
-		fprintf(stderr,"dbg2       beam_end:        %d\n",*beam_end);
-		fprintf(stderr,"dbg2       beam_exclude_percent: %d\n",*beam_exclude_percent);
-		fprintf(stderr,"dbg2       pixel_start:     %d\n",*pixel_start);
-		fprintf(stderr,"dbg2       pixel_end:       %d\n",*pixel_end);
-		fprintf(stderr,"dbg2       n_list:          %d\n",*n_list);
-		for (i=0;i<*n_list;i++)
-		    fprintf(stderr,"dbg2       list[%2d]:        %c\n",
-						i,list[i]);
-		}
-
-	/* assume success */
-	*error = MB_ERROR_NO_ERROR;
-	status = MB_SUCCESS;
-
-	if (beam_set == MBLIST_SET_OFF
-		&& pixel_set == MBLIST_SET_OFF
-		&& beams_bath <= 0
-		&& pixels_ss <= 0)
-		{
-		*beam_start = 0;
-		*beam_end = 1;
-		*pixel_start = 0;
-		*pixel_end = -1;
-		}
-	else if (beam_set == MBLIST_SET_OFF && pixel_set != MBLIST_SET_OFF)
-		{
-		*beam_start = 0;
-		*beam_end = -1;
-		}
-	else if (beam_set == MBLIST_SET_OFF && beams_bath <= 0)
-		{
-		*beam_start = 0;
-		*beam_end = -1;
-		*pixel_start = pixel_vertical;
-		*pixel_end = pixel_vertical;
-		}
-	else if (beam_set == MBLIST_SET_OFF)
-		{
-		*beam_start = beam_vertical;
-		*beam_end = beam_vertical;
-		}
-	else if (beam_set == MBLIST_SET_ALL)
-		{
-		*beam_start = 0;
-		*beam_end = beams_bath - 1;
-		}
-	else if (beam_set == MBLIST_SET_EXCLUDE_OUTER)
-                {
-		*beam_start = (beams_bath * *beam_exclude_percent) / 100;
-		*beam_end= beams_bath - (*beam_start+1);
-		}
-	if (pixel_set == MBLIST_SET_OFF && beams_bath > 0)
-		{
-		*pixel_start = 0;
-		*pixel_end = -1;
-		}
-	else if (pixel_set == MBLIST_SET_ALL)
-		{
-		*pixel_start = 0;
-		*pixel_end = pixels_ss - 1;
-		}
-
-	/* deal with dump_mode if set */
-	if (dump_mode == DUMP_MODE_BATH)
-		{
-		*beam_start = 0;
-		*beam_end = beams_bath - 1;
-		*pixel_start = 0;
-		*pixel_end = -1;
-		strcpy(list,"XYz");
-		*n_list = 3;
-		}
-	else if (dump_mode == DUMP_MODE_TOPO)
-		{
-		*beam_start = 0;
-		*beam_end = beams_bath - 1;
-		*pixel_start = 0;
-		*pixel_end = -1;
-		strcpy(list,"XYZ");
-		*n_list = 3;
-		}
-	else if (dump_mode == DUMP_MODE_AMP)
-		{
-		*beam_start = 0;
-		*beam_end = beams_bath - 1;
-		*pixel_start = 0;
-		*pixel_end = -1;
-		strcpy(list,"XYB");
-		*n_list = 3;
-		}
-	else if (dump_mode == DUMP_MODE_SS)
-		{
-		*beam_start = 0;
-		*beam_end = -1;
-		*pixel_start = 0;
-		*pixel_end = pixels_ss - 1;
-		strcpy(list,"XYb");
-		*n_list = 3;
-		}
-
-	/* check if beam and pixel range is ok */
-	if ((use_bath == MB_YES && *beam_end >= *beam_start)
-		&& beams_bath <= 0)
-		{
-		fprintf(stderr,"\nBathymetry data not available\n");
-		status = MB_FAILURE;
-		*error = MB_ERROR_BAD_USAGE;
-		}
-	else if (use_bath == MB_YES
-		&& *beam_end >= *beam_start
-		&& (*beam_start < 0 || *beam_end >= beams_bath))
-		{
-		fprintf(stderr,"\nBeam range %d to %d exceeds available beams 0 to %d\n",
-			*beam_start,*beam_end,beams_bath-1);
-		status = MB_FAILURE;
-		*error = MB_ERROR_BAD_USAGE;
-		}
-	if (*error == MB_ERROR_NO_ERROR
-		&& use_amp == MB_YES && beams_amp <= 0)
-		{
-		fprintf(stderr,"\nAmplitude data not available\n");
-		status = MB_FAILURE;
-		*error = MB_ERROR_BAD_USAGE;
-		}
-	else if (*error == MB_ERROR_NO_ERROR
-		&& *beam_end >= *beam_start && use_amp == MB_YES &&
-		(*beam_start < 0 || *beam_end >= beams_amp))
-		{
-		fprintf(stderr,"\nAmplitude beam range %d to %d exceeds available beams 0 to %d\n",
-			*beam_start,*beam_end,beams_amp-1);
-		status = MB_FAILURE;
-		*error = MB_ERROR_BAD_USAGE;
-		}
-	if (*error == MB_ERROR_NO_ERROR
-		&& (use_ss == MB_YES || *pixel_end >= *pixel_start)
-		&& pixels_ss <= 0)
-		{
-		fprintf(stderr,"\nSidescan data not available\n");
-		status = MB_FAILURE;
-		*error = MB_ERROR_BAD_USAGE;
-		}
-	else if (*error == MB_ERROR_NO_ERROR
-		&& *pixel_end >= *pixel_start &&
-		(*pixel_start < 0 || *pixel_end >= pixels_ss))
-		{
-		fprintf(stderr,"\nPixels range %d to %d exceeds available pixels 0 to %d\n",
-			*pixel_start,*pixel_end,pixels_ss-1);
-		status = MB_FAILURE;
-		*error = MB_ERROR_BAD_USAGE;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBCOPY function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2       beam_start:    %d\n",*beam_start);
-		fprintf(stderr,"dbg2       beam_end:      %d\n",*beam_end);
-		fprintf(stderr,"dbg2       pixel_start:   %d\n",*pixel_start);
-		fprintf(stderr,"dbg2       pixel_end:     %d\n",*pixel_end);
-		fprintf(stderr,"dbg2       n_list:        %d\n",*n_list);
-		for (i=0;i<*n_list;i++)
-			fprintf(stderr,"dbg2       list[%2d]:      %c\n",
-						i,list[i]);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int set_bathyslope(int verbose,
-	int nbath, char *beamflag, double *bath, double *bathacrosstrack,
-	int *ndepths, double *depths, double *depthacrosstrack,
-	int *nslopes, double *slopes, double *slopeacrosstrack,
-	int *error)
-{
-	char	*function_name = "set_bathyslope";
-	int	status = MB_SUCCESS;
-	int	i;
-
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBlist function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:         %d\n",verbose);
-		fprintf(stderr,"dbg2       nbath:           %d\n",nbath);
-		fprintf(stderr,"dbg2       bath:            %p\n",(void *)bath);
-		fprintf(stderr,"dbg2       bathacrosstrack: %p\n",(void *)bathacrosstrack);
-		fprintf(stderr,"dbg2       bath:\n");
-		for (i=0;i<nbath;i++)
-			fprintf(stderr,"dbg2         %d %f %f\n",
-				i, bath[i], bathacrosstrack[i]);
-		}
-
-	/* first find all depths */
-	*ndepths = 0;
-	for (i=0;i<nbath;i++)
-		{
-		if (mb_beam_ok(beamflag[i]))
-			{
-			depths[*ndepths] = bath[i];
-			depthacrosstrack[*ndepths] = bathacrosstrack[i];
-			(*ndepths)++;
-			}
-		}
-
-	/* now calculate slopes */
-	*nslopes = *ndepths + 1;
-	for (i=0;i<*ndepths-1;i++)
-		{
-		slopes[i+1] = (depths[i+1] - depths[i])
-			/(depthacrosstrack[i+1] - depthacrosstrack[i]);
-		slopeacrosstrack[i+1] = 0.5*(depthacrosstrack[i+1]
-			+ depthacrosstrack[i]);
-		}
-	if (*ndepths > 1)
-		{
-		slopes[0] = 0.0;
-		slopeacrosstrack[0] = depthacrosstrack[0];
-		slopes[*ndepths] = 0.0;
-		slopeacrosstrack[*ndepths] =
-			depthacrosstrack[*ndepths-1];
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBlist function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       ndepths:         %d\n",
-			*ndepths);
-		fprintf(stderr,"dbg2       depths:\n");
-		for (i=0;i<*ndepths;i++)
-			fprintf(stderr,"dbg2         %d %f %f\n",
-				i, depths[i], depthacrosstrack[i]);
-		fprintf(stderr,"dbg2       nslopes:         %d\n",
-			*nslopes);
-		fprintf(stderr,"dbg2       slopes:\n");
-		for (i=0;i<*nslopes;i++)
-			fprintf(stderr,"dbg2         %d %f %f\n",
-				i, slopes[i], slopeacrosstrack[i]);
-		fprintf(stderr,"dbg2       error:           %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:          %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int get_bathyslope(int verbose,
-	int ndepths, double *depths, double *depthacrosstrack,
-	int nslopes, double *slopes, double *slopeacrosstrack,
-	double acrosstrack, double *depth,  double *slope,
-	int *error)
-{
-	char	*function_name = "get_bathyslope";
-	int	status = MB_SUCCESS;
-	int	found_depth, found_slope;
-	int	idepth, islope;
-	int	i;
-
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBlist function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:         %d\n",verbose);
-		fprintf(stderr,"dbg2       ndepths:         %d\n",
-			ndepths);
-		fprintf(stderr,"dbg2       depths:\n");
-		for (i=0;i<ndepths;i++)
-			fprintf(stderr,"dbg2         %d %f %f\n",
-				i, depths[i], depthacrosstrack[i]);
-		fprintf(stderr,"dbg2       nslopes:         %d\n",
-			nslopes);
-		fprintf(stderr,"dbg2       slopes:\n");
-		for (i=0;i<nslopes;i++)
-			fprintf(stderr,"dbg2         %d %f %f\n",
-				i, slopes[i], slopeacrosstrack[i]);
-		fprintf(stderr,"dbg2       acrosstrack:     %f\n",acrosstrack);
-		}
-
-	/* check if acrosstrack is in defined interval */
-	found_depth = MB_NO;
-	found_slope = MB_NO;
-	if (ndepths > 1)
-	if (acrosstrack >= depthacrosstrack[0]
-		&& acrosstrack <= depthacrosstrack[ndepths-1])
-	    {
-
-	    /* look for depth */
-	    idepth = -1;
-	    while (found_depth == MB_NO && idepth < ndepths - 2)
-		{
-		idepth++;
-		if (acrosstrack >= depthacrosstrack[idepth]
-		    && acrosstrack <= depthacrosstrack[idepth+1])
-		    {
-		    *depth = depths[idepth]
-			    + (acrosstrack - depthacrosstrack[idepth])
-			    /(depthacrosstrack[idepth+1]
-			    - depthacrosstrack[idepth])
-			    *(depths[idepth+1] - depths[idepth]);
-		    found_depth = MB_YES;
-		    *error = MB_ERROR_NO_ERROR;
-		    }
-		}
-
-	    /* look for slope */
-	    islope = -1;
-	    while (found_slope == MB_NO && islope < nslopes - 2)
-		{
-		islope++;
-		if (acrosstrack >= slopeacrosstrack[islope]
-		    && acrosstrack <= slopeacrosstrack[islope+1])
-		    {
-		    *slope = slopes[islope]
-			    + (acrosstrack - slopeacrosstrack[islope])
-			    /(slopeacrosstrack[islope+1]
-			    - slopeacrosstrack[islope])
-			    *(slopes[islope+1] - slopes[islope]);
-		    found_slope = MB_YES;
-		    *error = MB_ERROR_NO_ERROR;
-		    }
-		}
-	    }
-
-	/* translate slope to degrees */
-	if (found_slope == MB_YES)
-	    *slope = RTD * atan(*slope);
-
-	/* check for failure */
-	if (found_depth != MB_YES || found_slope != MB_YES)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_OTHER;
-		*depth = 0.0;
-		*slope = 0.0;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBlist function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       depth:           %f\n",*depth);
-		fprintf(stderr,"dbg2       slope:           %f\n",*slope);
-		fprintf(stderr,"dbg2       error:           %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:          %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int printsimplevalue(int verbose, FILE *output,
-	double value, int width, int precision,
-	int ascii, int *invert, int *flipsign, int *error)
-{
-	char	*function_name = "printsimplevalue";
-	int	status = MB_SUCCESS;
-	char	format[24];
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBlist function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:         %d\n",verbose);
-		fprintf(stderr,"dbg2       value:           %f\n",value);
-		fprintf(stderr,"dbg2       width:           %d\n",width);
-		fprintf(stderr,"dbg2       precision:       %d\n",precision);
-		fprintf(stderr,"dbg2       ascii:           %d\n",ascii);
-		fprintf(stderr,"dbg2       invert:          %d\n",*invert);
-		fprintf(stderr,"dbg2       flipsign:        %d\n",*flipsign);
-		}
-
-	/* make print format */
-	format[0] = '%';
-	if (*invert == MB_YES)
-	    strcpy(format, "%g");
-	else if (width > 0)
-	    sprintf(&format[1], "%d.%df", width, precision);
-	else
-	    sprintf(&format[1], ".%df", precision);
-
-	/* invert value if desired */
-	if (*invert == MB_YES)
-	    {
-	    *invert = MB_NO;
-	    if (value != 0.0)
-		value = 1.0 / value;
-	    }
-
-	/* flip sign value if desired */
-	if (*flipsign == MB_YES)
-	    {
-	    *flipsign = MB_NO;
-	    value = -value;
-	    }
-
-	/* print value */
-	if (ascii == MB_YES)
-	    fprintf(output,format, value);
-	else
-	    fwrite(&value, sizeof(double), 1, output);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBlist function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       invert:          %d\n",*invert);
-		fprintf(stderr,"dbg2       error:           %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:          %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int printNaN(int verbose, FILE *output, int ascii, int *invert, int *flipsign, int *error)
-{
-	char	*function_name = "printNaN";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBlist function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:         %d\n",verbose);
-		fprintf(stderr,"dbg2       ascii:           %d\n",ascii);
-		fprintf(stderr,"dbg2       invert:          %d\n",*invert);
-		fprintf(stderr,"dbg2       flipsign:        %d\n",*flipsign);
-		}
-
-	/* reset invert flag */
-	if (*invert == MB_YES)
-	    *invert = MB_NO;
-
-	/* reset flipsign flag */
-	if (*flipsign == MB_YES)
-	    *flipsign = MB_NO;
-
-	/* print value */
-	if (ascii == MB_YES)
-	    fprintf(output,"NaN");
-	else
-	    fwrite(&NaN, sizeof(double), 1, output);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBlist function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       invert:          %d\n",*invert);
-		fprintf(stderr,"dbg2       error:           %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:          %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-/*
-Method to get fields from raw data, similar to mb_get_all.
-*/
-int mb_get_raw(int verbose, void *mbio_ptr,
-		int	*mode,
-		int	*ipulse_length,
-		int	*png_count,
-		int	*sample_rate,
-		double	*absorption,
-		int 	*max_range,
-		int 	*r_zero,
-		int 	*r_zero_corr,
-		int 	*tvg_start,
-		int 	*tvg_stop,
-		double 	*bsn,
-		double 	*bso,
-		int 	*tx,
-		int 	*tvg_crossover,
-		int 	*nbeams_ss,
-		int 	*npixels,
-		int 	*beam_samples,
-		int	*start_sample,
-		int 	*range,
-		double	*depression,
-		double 	*bs,
-		double	*ss_pixels,
-		int 	*error)
-{
-	char	*function_name = "mb_get_raw";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBlist function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:         %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:        %p\n",(void *)mbio_ptr);
-		}
-
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	*mode = -1;
-	*ipulse_length = 0;
-	*png_count = 0;
-	*sample_rate = 0;
-	*absorption = 0;
-	*max_range = 0;
-	*r_zero = 0;
-	*r_zero_corr = 0;
-	*tvg_start = 0;
-	*tvg_stop = 0;
-	*bsn = 0;
-	*bso = 0;
-	*tx = 0;
-	*tvg_crossover = 0;
-	*nbeams_ss = 0;
-	*npixels = 0;
-
-	for (i = 0; i < mb_io_ptr->beams_bath_max; i++)
-	  {
-	    beam_samples[i] = 0;
-	    start_sample[i] = 0;
-	    range[i] = 0;
-	    depression[i] = 0.0;
-	    bs[i] = 0.0;
-	  }
-
-	switch (mb_io_ptr->format)
-	  {
-	  case MBF_EM300MBA:
-	  case MBF_EM300RAW:
-	    mb_get_raw_simrad2(verbose, mbio_ptr,
-				mode,
-				ipulse_length,
-				png_count,
-				sample_rate,
-				absorption,
-				max_range,
-				r_zero,
-				r_zero_corr,
-				tvg_start,
-				tvg_stop,
-				bsn,
-				bso,
-				tx,
-				tvg_crossover,
-				nbeams_ss,
-				npixels,
-				beam_samples,
-				start_sample,
-				range,
-				depression,
-				bs,
-				ss_pixels,
-				error);
-
-	    break;
-	  case MBF_EM710MBA:
-	  case MBF_EM710RAW:
-	    mb_get_raw_simrad3(verbose, mbio_ptr,
-				mode,
-				ipulse_length,
-				png_count,
-				sample_rate,
-				absorption,
-				max_range,
-				r_zero,
-				r_zero_corr,
-				tvg_start,
-				tvg_stop,
-				bsn,
-				bso,
-				tx,
-				tvg_crossover,
-				nbeams_ss,
-				npixels,
-				beam_samples,
-				start_sample,
-				range,
-				depression,
-				bs,
-				ss_pixels,
-				error);
-
-	    break;
-	  }
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBlist function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       mode:            %d\n",*mode);
-		fprintf(stderr,"dbg2       ipulse_length:   %d\n",*ipulse_length);
-		fprintf(stderr,"dbg2       png_count:       %d\n",*png_count);
-		fprintf(stderr,"dbg2       sample_rate:     %d\n",*sample_rate);
-		fprintf(stderr,"dbg2       absorption:      %f\n",*absorption);
-		fprintf(stderr,"dbg2       max_range:       %d\n",*max_range);
-		fprintf(stderr,"dbg2       r_zero:          %d\n",*r_zero);
-		fprintf(stderr,"dbg2       r_zero_corr:     %d\n",*r_zero_corr);
-		fprintf(stderr,"dbg2       tvg_start:       %d\n",*tvg_start);
-		fprintf(stderr,"dbg2       tvg_stop:        %d\n",*tvg_stop);
-		fprintf(stderr,"dbg2       bsn:             %f\n",*bsn);
-		fprintf(stderr,"dbg2       bso:             %f\n",*bso);
-		fprintf(stderr,"dbg2       tx:              %d\n",*tx);
-		fprintf(stderr,"dbg2       tvg_crossover:   %d\n",*tvg_crossover);
-		fprintf(stderr,"dbg2       nbeams_ss:       %d\n",*nbeams_ss);
-		fprintf(stderr,"dbg2       npixels:         %d\n",*npixels);
-		for (i = 0; i < mb_io_ptr->beams_bath_max; i++)
-			{
-			fprintf(stderr,"dbg2       beam:%d range:%d depression:%f bs:%f\n",
-				i,range[i],depression[i],bs[i]);
-			}
-		for (i = 0; i < mb_io_ptr->beams_bath_max; i++)
-			{
-			fprintf(stderr,"dbg2       beam:%d samples:%d start:%d\n",
-				i,beam_samples[i],start_sample[i]);
-			}
-		for (i = 0; i < *npixels; i++)
-			{
-			fprintf(stderr,"dbg2       pixel:%d ss:%f\n",
-				i,ss_pixels[i]);
-			}
-		fprintf(stderr,"dbg2       error:           %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:          %d\n",status);
-		}
-
-	return status;
-}
-
-/*--------------------------------------------------------------------*/
-/*
-Method to get fields from simrad2 raw data.
-*/
-
-int mb_get_raw_simrad2(int verbose, void *mbio_ptr,
-			int	*mode,
-			int	*ipulse_length,
-			int	*png_count,
-			int	*sample_rate,
-			double	*absorption,
-			int 	*max_range,
-			int 	*r_zero,
-			int 	*r_zero_corr,
-			int 	*tvg_start,
-			int 	*tvg_stop,
-			double 	*bsn,
-			double 	*bso,
-			int 	*tx,
-			int 	*tvg_crossover,
-			int 	*nbeams_ss,
-			int 	*npixels,
-			int 	*beam_samples,
-			int	*start_sample,
-			int 	*range,
-			double	*depression,
-			double 	*bs,
-			double	*ss_pixels,
-			int 	*error)
-{
-	char	*function_name = "mb_get_raw_simrad2";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_simrad2_struct *store_ptr;
-	struct mbsys_simrad2_ping_struct *ping_ptr;
-  	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBlist function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:         %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:        %p\n",(void *)mbio_ptr);
-		}
-
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-	store_ptr = (struct mbsys_simrad2_struct *) mb_io_ptr->store_data;
-	ping_ptr = store_ptr->ping;
-
-	if (store_ptr->kind == MB_DATA_DATA)
-	  {
-	    *mode = store_ptr->run_mode;
-	    *ipulse_length = store_ptr->run_tran_pulse;
-	    *png_count = ping_ptr->png_count;
-	    *sample_rate =  ping_ptr->png_sample_rate;
-	    *absorption = ping_ptr->png_max_range * 0.01;
-	    *max_range = ping_ptr->png_max_range;
-	    *r_zero = ping_ptr->png_r_zero;
-	    *r_zero_corr = ping_ptr->png_r_zero_corr;
-	    *tvg_start = ping_ptr->png_tvg_start;
-	    *tvg_stop = ping_ptr->png_tvg_stop;
-	    *bsn = ping_ptr->png_bsn * 0.5;
-	    *bso = ping_ptr->png_bso * 0.5;
-	    *tx = ping_ptr->png_tx;
-	    *tvg_crossover = ping_ptr->png_tvg_crossover;
-	    *nbeams_ss = ping_ptr->png_nbeams_ss;
-	    *npixels = ping_ptr->png_npixels;
-
-
-	    for (i = 0; i < ping_ptr->png_nbeams; i++)
-	      {
-		range[ping_ptr->png_beam_num[i] - 1] = ping_ptr->png_range[i];
-		depression[ping_ptr->png_beam_num[i] - 1] = ping_ptr->png_depression[i] * .01;
-		bs[ping_ptr->png_beam_num[i] - 1] = ping_ptr->png_amp[i] * 0.5;
-	      }
-	    for (i = 0; i < ping_ptr->png_nbeams_ss; i++)
-	      {
-		beam_samples[ping_ptr->png_beam_index[i]] = ping_ptr->png_beam_samples[i];
-		start_sample[ping_ptr->png_beam_index[i]] = ping_ptr->png_start_sample[i];
-	      }
-	    for (i = 0; i < ping_ptr->png_npixels; i++)
-	      ss_pixels[i] = ping_ptr->png_ssraw[i] * 0.5;
-	  }
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBlist function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       mode:            %d\n",*mode);
-		fprintf(stderr,"dbg2       ipulse_length:   %d\n",*ipulse_length);
-		fprintf(stderr,"dbg2       png_count:       %d\n",*png_count);
-		fprintf(stderr,"dbg2       sample_rate:     %d\n",*sample_rate);
-		fprintf(stderr,"dbg2       absorption:      %f\n",*absorption);
-		fprintf(stderr,"dbg2       max_range:       %d\n",*max_range);
-		fprintf(stderr,"dbg2       r_zero:          %d\n",*r_zero);
-		fprintf(stderr,"dbg2       r_zero_corr:     %d\n",*r_zero_corr);
-		fprintf(stderr,"dbg2       tvg_start:       %d\n",*tvg_start);
-		fprintf(stderr,"dbg2       tvg_stop:        %d\n",*tvg_stop);
-		fprintf(stderr,"dbg2       bsn:             %f\n",*bsn);
-		fprintf(stderr,"dbg2       bso:             %f\n",*bso);
-		fprintf(stderr,"dbg2       tx:              %d\n",*tx);
-		fprintf(stderr,"dbg2       tvg_crossover:   %d\n",*tvg_crossover);
-		fprintf(stderr,"dbg2       nbeams_ss:       %d\n",*nbeams_ss);
-		fprintf(stderr,"dbg2       npixels:         %d\n",*npixels);
-		for (i = 0; i < mb_io_ptr->beams_bath_max; i++)
-			{
-			fprintf(stderr,"dbg2       beam:%d range:%d depression:%f bs:%f\n",
-				i,range[i],depression[i],bs[i]);
-			}
-		for (i = 0; i < mb_io_ptr->beams_bath_max; i++)
-			{
-			fprintf(stderr,"dbg2       beam:%d samples:%d start:%d\n",
-				i,beam_samples[i],start_sample[i]);
-			}
-		for (i = 0; i < *npixels; i++)
-			{
-			fprintf(stderr,"dbg2       pixel:%d ss:%f\n",
-				i,ss_pixels[i]);
-			}
-		fprintf(stderr,"dbg2       error:           %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:          %d\n",status);
-		}
-
-	return status;
-}
-/*--------------------------------------------------------------------*/
-/*
-Method to get fields from simrad3 raw data.
-*/
-
-int mb_get_raw_simrad3(int verbose, void *mbio_ptr,
-			int	*mode,
-			int	*ipulse_length,
-			int	*png_count,
-			int	*sample_rate,
-			double	*absorption,
-			int 	*max_range,
-			int 	*r_zero,
-			int 	*r_zero_corr,
-			int 	*tvg_start,
-			int 	*tvg_stop,
-			double 	*bsn,
-			double 	*bso,
-			int 	*tx,
-			int 	*tvg_crossover,
-			int 	*nbeams_ss,
-			int 	*npixels,
-			int 	*beam_samples,
-			int	*start_sample,
-			int 	*range,
-			double	*depression,
-			double 	*bs,
-			double	*ss_pixels,
-			int 	*error)
-{
-	char	*function_name = "mb_get_raw_simrad3";
-	int	status = MB_SUCCESS;
-	struct mb_io_struct *mb_io_ptr;
-	struct mbsys_simrad3_struct *store_ptr;
-	struct mbsys_simrad3_ping_struct *ping_ptr;
-  	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBlist function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:         %d\n",verbose);
-		fprintf(stderr,"dbg2       mbio_ptr:        %p\n",(void *)mbio_ptr);
-		}
-
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-	store_ptr = (struct mbsys_simrad3_struct *) mb_io_ptr->store_data;
- 	ping_ptr = (struct mbsys_simrad3_ping_struct *) &(store_ptr->pings[store_ptr->ping_index]);
-
-	if (store_ptr->kind == MB_DATA_DATA)
-	  {
-	    *mode = store_ptr->run_mode;
-	    *ipulse_length = store_ptr->run_tran_pulse;
-	    *png_count = ping_ptr->png_count;
-	    *sample_rate =  ping_ptr->png_sample_rate;
-	    *absorption = store_ptr->run_absorption * 0.01;
-	    *max_range = 0;
-	    *r_zero = ping_ptr->png_r_zero;
-	    *r_zero_corr = 0;
-	    *tvg_start = 0;
-	    *tvg_stop = 0;
-	    *bsn = ping_ptr->png_bsn * 0.1;
-	    *bso = ping_ptr->png_bso * 0.1;
-	    *tx = ping_ptr->png_tx * 0.1;
-	    *tvg_crossover = ping_ptr->png_tvg_crossover;
-	    *nbeams_ss = ping_ptr->png_nbeams_ss;
-	    *npixels = ping_ptr->png_npixels;
-
-
-	    for (i = 0; i < ping_ptr->png_nbeams; i++)
-	      {
-		range[i] = ping_ptr->png_range[i];
-		depression[i] = ping_ptr->png_depression[i] * .01;
-		bs[i] = ping_ptr->png_amp[i] * 0.5;
-	      }
-	    for (i = 0; i < ping_ptr->png_nbeams_ss; i++)
-	      {
-		beam_samples[i] = ping_ptr->png_beam_samples[i];
-		start_sample[i] = ping_ptr->png_start_sample[i];
-	      }
-	    for (i = 0; i < ping_ptr->png_npixels; i++)
-	      ss_pixels[i] = ping_ptr->png_ssraw[i] * 0.5;
-	  }
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBlist function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       mode:            %d\n",*mode);
-		fprintf(stderr,"dbg2       ipulse_length:   %d\n",*ipulse_length);
-		fprintf(stderr,"dbg2       png_count:       %d\n",*png_count);
-		fprintf(stderr,"dbg2       sample_rate:     %d\n",*sample_rate);
-		fprintf(stderr,"dbg2       absorption:      %f\n",*absorption);
-		fprintf(stderr,"dbg2       max_range:       %d\n",*max_range);
-		fprintf(stderr,"dbg2       r_zero:          %d\n",*r_zero);
-		fprintf(stderr,"dbg2       r_zero_corr:     %d\n",*r_zero_corr);
-		fprintf(stderr,"dbg2       tvg_start:       %d\n",*tvg_start);
-		fprintf(stderr,"dbg2       tvg_stop:        %d\n",*tvg_stop);
-		fprintf(stderr,"dbg2       bsn:             %f\n",*bsn);
-		fprintf(stderr,"dbg2       bso:             %f\n",*bso);
-		fprintf(stderr,"dbg2       tx:              %d\n",*tx);
-		fprintf(stderr,"dbg2       tvg_crossover:   %d\n",*tvg_crossover);
-		fprintf(stderr,"dbg2       nbeams_ss:       %d\n",*nbeams_ss);
-		fprintf(stderr,"dbg2       npixels:         %d\n",*npixels);
-		for (i = 0; i < mb_io_ptr->beams_bath_max; i++)
-			{
-			fprintf(stderr,"dbg2       beam:%d range:%d depression:%f bs:%f\n",
-				i,range[i],depression[i],bs[i]);
-			}
-		for (i = 0; i < mb_io_ptr->beams_bath_max; i++)
-			{
-			fprintf(stderr,"dbg2       beam:%d samples:%d start:%d\n",
-				i,beam_samples[i],start_sample[i]);
-			}
-		for (i = 0; i < *npixels; i++)
-			{
-			fprintf(stderr,"dbg2       pixel:%d ss:%f\n",
-				i,ss_pixels[i]);
-			}
-		fprintf(stderr,"dbg2       error:           %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:          %d\n",status);
-		}
-
-	return status;
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/utilities/mbmosaic.c b/src/utilities/mbmosaic.c
deleted file mode 100644
index e339d8e..0000000
--- a/src/utilities/mbmosaic.c
+++ /dev/null
@@ -1,4926 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbmosaic.c	2/10/97
- *    $Id: mbmosaic.c 2247 2015-05-29 21:28:28Z caress $
- *
- *    Copyright (c) 1997-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbmosaic is an utility used to mosaic amplitude or sidescan
- * data contained in a set of swath mapping sonar data files.
- * This program mosaics the data using a prioritization scheme
- * tied to the apparent grazing angle and look azimuth for the
- * pixels/beams. The grazing
- * angle is calculated as arctan(xtrack / depth) where the
- * acrosstrack distance xtrack is positive to starboard.
- *
- * Author:	D. W. Caress
- * Date:	February 10, 1997
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <math.h>
-#include <string.h>
-#include <time.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_define.h"
-#include "mb_info.h"
-#include "mb_process.h"
-#include "mb_aux.h"
-
-/* gridding algorithms */
-#define	MBMOSAIC_SINGLE_BEST	1
-#define	MBMOSAIC_AVERAGE	2
-
-/* grid format definitions */
-#define	MBMOSAIC_ASCII		1
-#define	MBMOSAIC_OLDGRD		2
-#define	MBMOSAIC_CDFGRD		3
-#define	MBMOSAIC_ARCASCII	4
-#define	MBMOSAIC_GMTGRD		100
-
-/* gridded data type */
-#define	MBMOSAIC_DATA_AMPLITUDE		3
-#define	MBMOSAIC_DATA_SIDESCAN		4
-#define MBMOSAIC_DATA_FLAT_GRAZING	5
-#define MBMOSAIC_DATA_GRAZING		6
-#define MBMOSAIC_DATA_SLOPE		7
-
-/* prioritization mode */
-#define	MBMOSAIC_PRIORITY_NONE		0
-#define	MBMOSAIC_PRIORITY_ANGLE		1
-#define	MBMOSAIC_PRIORITY_AZIMUTH	2
-#define	MBMOSAIC_PRIORITY_HEADING	4
-
-/* priority tables */
-#define	MBMOSAIC_PRIORITYTABLE_FILE		0
-#define	MBMOSAIC_PRIORITYTABLE_60DEGREESUP	1
-#define	MBMOSAIC_PRIORITYTABLE_67DEGREESUP	2
-#define	MBMOSAIC_PRIORITYTABLE_75DEGREESUP	3
-#define	MBMOSAIC_PRIORITYTABLE_85DEGREESUP	4
-#define	MBMOSAIC_PRIORITYTABLE_60DEGREESDN	5
-#define	MBMOSAIC_PRIORITYTABLE_67DEGREESDN	6
-#define	MBMOSAIC_PRIORITYTABLE_75DEGREESDN	7
-#define	MBMOSAIC_PRIORITYTABLE_85DEGREESDN	8
-int	n_priority_angle_60degreesup = 3;
-double	priority_angle_60degreesup_angle[] = {-60, 0, 60};
-double	priority_angle_60degreesup_priority[] = {1.0, 0.0, 1.0};
-int	n_priority_angle_67degreesup = 3;
-double	priority_angle_67degreesup_angle[] = {-67, 0, 67};
-double	priority_angle_67degreesup_priority[] = {1.0, 0.0, 1.0};
-int	n_priority_angle_75degreesup = 3;
-double	priority_angle_75degreesup_angle[] = {-75, 0, 75};
-double	priority_angle_75degreesup_priority[] = {1.0, 0.0, 1.0};
-int	n_priority_angle_85degreesup = 3;
-double	priority_angle_85degreesup_angle[] = {-85, 0, 85};
-double	priority_angle_85degreesup_priority[] = {1.0, 0.0, 1.0};
-int	n_priority_angle_60degreesdn = 3;
-double	priority_angle_60degreesdn_angle[] = {-60, 0, 60};
-double	priority_angle_60degreesdn_priority[] = {0.0, 1.0, 0.0};
-int	n_priority_angle_67degreesdn = 3;
-double	priority_angle_67degreesdn_angle[] = {-67, 0, 67};
-double	priority_angle_67degreesdn_priority[] = {0.0, 1.0, 0.0};
-int	n_priority_angle_75degreesdn = 3;
-double	priority_angle_75degreesdn_angle[] = {-75, 0, 75};
-double	priority_angle_75degreesdn_priority[] = {0.0, 1.0, 0.0};
-int	n_priority_angle_85degreesdn = 3;
-double	priority_angle_85degreesdn_angle[] = {-85, 0, 85};
-double	priority_angle_85degreesdn_priority[] = {0.0, 1.0, 0.0};
-
-#define	MB7K2SS_NUM_ANGLES			171
-#define	MB7K2SS_ANGLE_MAX			85.0
-
-/* flag for no data in grid */
-#define	NO_DATA_FLAG	99999
-
-/* interpolation mode */
-#define MBMOSAIC_INTERP_NONE	0
-#define MBMOSAIC_INTERP_GAP	1
-#define MBMOSAIC_INTERP_NEAR	2
-#define MBMOSAIC_INTERP_ALL	3
-
-#define MBMOSAIC_FOOTPRINT_REAL		0
-#define MBMOSAIC_FOOTPRINT_SPACING	1
-struct	footprint
-	{
-	double	x[4];
-	double	y[4];
-	};
-
-int write_ascii(int verbose, char *outfile, float *grid,
-		int nx, int ny,
-		double xmin, double xmax, double ymin, double ymax,
-		double dx, double dy, int *error);
-int write_arcascii(int verbose, char *outfile, float *grid,
-		int nx, int ny,
-		double xmin, double xmax, double ymin, double ymax,
-		double dx, double dy, double nodata, int *error);
-int write_oldgrd(int verbose, char *outfile, float *grid,
-		int nx, int ny,
-		double xmin, double xmax, double ymin, double ymax,
-		double dx, double dy, int *error);
-int mbmosaic_get_beamangles(
-		int     verbose,
-                double  sonardepth,
-                int     beams_bath,
-                char    *beamflag,
-                double  *bath,
-                double  *bathacrosstrack,
-                double  *bathalongtrack,
-                double  *gangles,
-                int     *error);
-int mbmosaic_get_beampriorities(
-                int     verbose,
-                int     priority_mode,
-                int     n_priority_angle,
-                double  *priority_angle_angle,
-                double  *priority_angle_priority,
-                double  priority_azimuth,
-                double  priority_azimuth_factor,
-                double  priority_heading,
-                double  priority_heading_factor,
-                double  heading,
-                int     beams_bath,
-                char    *beamflag,
-                double  *gangles,
-                double  *priorities,
-                int     *error);
-int mbmosaic_get_beamslopes(
-                int     verbose,
-                int     beams_bath,
-                char    *beamflag,
-                double  *bath,
-                double  *bathacrosstrack,
-                double  *slopes,
-                int     *error);
-int mbmosaic_bath_getangletable(
-                int     verbose,
-                double  sonardepth,
-                int     beams_bath,
-                char    *beamflag,
-                double  *bath,
-                double  *bathacrosstrack,
-                double  *bathalongtrack,
-                double  angle_min,
-                double  angle_max,
-                int     nangle,
-                double  *table_angle,
-                double  *table_xtrack,
-                double  *table_ltrack,
-		double  *table_altitude,
-                double  *table_range,
-                int     *error);
-int mbmosaic_flatbottom_getangletable(
-                int     verbose,
-                double  altitude,
-                double  angle_min,
-                double  angle_max,
-                int     nangle,
-                double  *table_angle,
-                double  *table_xtrack,
-                double  *table_ltrack,
-		double  *table_altitude,
-                double  *table_range,
-                int     *error);
-int mbmosaic_get_ssangles(
-                int     verbose,
-                int     nangle,
-                double  *table_angle,
-                double  *table_xtrack,
-                double  *table_ltrack,
-                double  *table_altitude,
-                double  *table_range,
-                int  pixels_ss,
-                double  *ss,
-                double  *ssacrosstrack,
-                double  *gangles,
-                int  *error);
-int mbmosaic_get_sspriorities(
-                int     verbose,
-                int     priority_mode,
-                int     n_priority_angle,
-                double  *priority_angle_angle,
-                double  *priority_angle_priority,
-                double  priority_azimuth,
-                double  priority_azimuth_factor,
-                double  priority_heading,
-                double  priority_heading_factor,
-                double  heading,
-                int     pixels_ss,
-                double  *ss,
-                double  *gangles,
-                double  *priorities,
-                int     *error);
-int mbmosaic_get_footprint(
-		int	verbose,
-		int	mode,
-		double	beamwidth_xtrack,
-		double	beamwidth_ltrack,
-		double	altitude,
-		double	acrosstrack,
-		double	alongtrack,
-		double	acrosstrack_spacing,
-		struct footprint *footprint,
-		int	*error);
-int double_compare(double *a, double *b);
-
-/* program identifiers */
-static char rcs_id[] = "$Id: mbmosaic.c 2247 2015-05-29 21:28:28Z caress $";
-char program_name[] = "mbmosaic";
-char help_message[] =  "mbmosaic is an utility used to mosaic amplitude or \nsidescan data contained in a set of swath sonar data files.  \nThis program uses one of four algorithms (gaussian weighted mean, \nmedian filter, minimum filter, maximum filter) to grid regions \ncovered by multibeam swaths and then fills in gaps between \nthe swaths (to the degree specified by the user) using a minimum\ncurvature algorithm.";
-char usage_message[] = "mbmosaic -Ifilelist -Oroot \
-[-Rwest/east/south/north -Rfactor -Adatatype\n\
-          -Bborder -Cclip/mode/tension -Dxdim/ydim -Edx/dy/units \n\
-          -Fpriority_range -Ggridkind -H -Jprojection -Llonflip -M -N -Ppings \n\
-          -Sspeed -Ttopogrid -Ubearing/factor[/mode] -V -Wscale -Xextend \n\
-          -Ypriority_source -Zbathdef]";
-
-/*--------------------------------------------------------------------*/
-
-int main (int argc, char **argv)
-{
-	extern char *optarg;
-	int	errflg = 0;
-	int	c;
-	int	help = 0;
-	int	flag = 0;
-
-	/* MBIO status variables */
-	int	status = MB_SUCCESS;
-	int	verbose = 0;
-	int	error = MB_ERROR_NO_ERROR;
-	char	*message = NULL;
-
-	/* MBIO read control parameters */
-	int	format;
-	int	pings;
-	int	lonflip;
-	double	bounds[4];
-	int	btime_i[7];
-	int	etime_i[7];
-	double	btime_d;
-	double	etime_d;
-	double	speedmin;
-	double	timegap;
-	int	beams_bath;
-	int	beams_amp;
-	int	pixels_ss;
-	char	file[MB_PATH_MAXLINE];
-	int	file_in_bounds;
-	void	*mbio_ptr = NULL;
-        struct mb_io_struct *mb_io_ptr = NULL;
-        void    *store_ptr;
-
-	/* mbmosaic control variables */
-	char	filelist[MB_PATH_MAXLINE];
-	char	fileroot[MB_PATH_MAXLINE];
-	void	*datalist;
-	int	look_processed = MB_DATALIST_LOOK_UNSET;
-	double	file_weight;
-	int	xdim = 0;
-	int	ydim = 0;
-	int	spacing_priority = MB_NO;
-	int	set_dimensions = MB_NO;
-	int	set_spacing = MB_NO;
-	double	dx_set = 0.0;
-	double	dy_set = 0.0;
-	double	dx = 0.0;
-	double	dy = 0.0;
-	char	units[MB_PATH_MAXLINE];
-	int	clip = 0;
-	int	clipmode = MBMOSAIC_INTERP_NONE;
-	double	tension = 0.0;
-	int	grid_mode = MBMOSAIC_SINGLE_BEST;
-	int	datatype = MBMOSAIC_DATA_SIDESCAN;
-	int	usefiltered = MB_NO;
-	char	gridkindstring[MB_PATH_MAXLINE];
-	int	gridkind = MBMOSAIC_GMTGRD;
-	int	more = MB_NO;
-	int	use_NaN = MB_NO;
-	double	clipvalue = NO_DATA_FLAG;
-	float	outclipvalue = NO_DATA_FLAG;
-	double	scale = 1.0;
-        double  boundsfactor = 0.0;
-	double	border = 0.0;
-	double	extend = 0.0;
-	int	priority_mode = MBMOSAIC_PRIORITY_NONE;
-	int	priority_source = MBMOSAIC_PRIORITYTABLE_FILE;
-	double	priority_range = 0.0;
-	double	priority_azimuth = 0.0;
-	double	priority_azimuth_factor = 1.0;
-	double	priority_heading = 0.0;
-	double	priority_heading_factor = 1.0;
-	char	pfile[MB_PATH_MAXLINE];
-	int	n_priority_angle = 0;
-	double	*priority_angle_angle = NULL;
-	double	*priority_angle_priority = NULL;
-	int	weight_priorities = 0;
-        int     usetopogrid = MB_NO;
-	double	altitude_default = 1000.0;
-	int	pstatus;
-	char	path[MB_PATH_MAXLINE];
-	char	ppath[MB_PATH_MAXLINE];
-	char	ifile[MB_PATH_MAXLINE];
-	char	ofile[MB_PATH_MAXLINE];
-	char	dfile[MB_PATH_MAXLINE];
-	char	plot_cmd[MB_COMMENT_MAXLINE];
-	int	plot_status;
-	int	use_beams = MB_NO;
-	int 	use_slope = MB_NO;
-
-	/* topography parameters */
-        mb_path topogridfile;
-	void	*topogrid_ptr = NULL;
-
-	/* mbio read values */
-	int	kind;
-	int	time_i[7];
-	double	time_d;
-	double	navlon;
-	double	navlat;
-	double	speed;
-	double	heading;
-	double	distance;
-	double	altitude;
-	double	sonardepth;
-	char	*beamflag = NULL;
-	double	*bath = NULL;
-	double	*bathacrosstrack = NULL;
-	double	*bathalongtrack = NULL;
-	double	*bathlon = NULL;
-	double	*bathlat = NULL;
-	double	*amp = NULL;
-	double	*ss = NULL;
-	double	*ssacrosstrack = NULL;
-	double	*ssalongtrack = NULL;
-	double	*sslon = NULL;
-	double	*sslat = NULL;
-	char	comment[MB_COMMENT_MAXLINE];
-	double	*gangles = NULL;
-	double	*slopes = NULL;
-	double	*priorities = NULL;
-	struct	footprint *footprints = NULL;
-	struct mb_info_struct mb_info;
-	int	formatread;
-	double	beamwidth_xtrack;
-	double	beamwidth_ltrack;
-        double  draft;
-        double  roll;
-        double  pitch;
-        double  heave;
-
-	/* grid variables */
-	double	gbnd[4], wbnd[4], obnd[4];
-	int	gbndset = MB_NO;
-	double	xlon, ylat, xx, yy;
-	double	gaussian_factor;
-	int	gxdim, gydim, offx, offy;
-	double	*grid = NULL;
-	double	*norm = NULL;
-	double	*maxpriority = NULL;
-	int	*cnt = NULL;
-	int	*num = NULL;
-	double	*sigma = NULL;
-	float	*sdata = NULL;
-	float	*output = NULL;
-	float	*sgrid = NULL;
-        double  bdata_origin_x, bdata_origin_y;
-	double	sxmin, symin;
-	float	xmin, ymin, ddx, ddy, zflag, cay;
-	void	*work1 = NULL;
-	void	*work2 = NULL;
-	void	*work3 = NULL;
-	int	ndata, ndatafile;
-	double	zmin, zmax, zclip;
-	int	nmax;
-	double	smin, smax;
-	int	nbinset, nbinzero, nbinspline;
-
-	/* bottom layout parameters */
-	int	nangle = MB7K2SS_NUM_ANGLES;
-	double	angle_min = -MB7K2SS_ANGLE_MAX;
-	double	angle_max = MB7K2SS_ANGLE_MAX;
-	double	table_angle[MB7K2SS_NUM_ANGLES];
-	double	table_xtrack[MB7K2SS_NUM_ANGLES];
-	double	table_ltrack[MB7K2SS_NUM_ANGLES];
-	double	table_altitude[MB7K2SS_NUM_ANGLES];
-	double	table_range[MB7K2SS_NUM_ANGLES];
-        int     table_status = MB_SUCCESS;
-        int     table_error = MB_ERROR_NO_ERROR;
-
-	/* projected grid parameters */
-	int	use_projection = MB_NO;
-	int	projection_pars_f = MB_NO;
-	double	reference_lon, reference_lat;
-	int	utm_zone = 1;
-	char	projection_pars[MB_PATH_MAXLINE];
-	char	projection_id[MB_PATH_MAXLINE];
-	int	proj_status;
-	void	*pjptr;
-	double	deglontokm, deglattokm;
-	double	mtodeglon, mtodeglat;
-	double	headingx, headingy;
-
-	/* output char strings */
-	char	xlabel[MB_PATH_MAXLINE];
-	char	ylabel[MB_PATH_MAXLINE];
-	char	zlabel[MB_PATH_MAXLINE];
-	char	title[MB_PATH_MAXLINE];
-	char	nlabel[MB_PATH_MAXLINE];
-	char	sdlabel[MB_PATH_MAXLINE];
-
-	/* output stream for basic stuff (stdout if verbose <= 1,
-		stderr if verbose > 1) */
-	FILE	*outfp;
-
-	/* variables needed to handle Not-a-Number values */
-	float	NaN;
-
-	/* other variables */
-	FILE	*dfp, *fp;
-	char	buffer[MB_PATH_MAXLINE], *result;
-	double	norm_weight;
-	double	xsmin, xsmax;
-        double  xx1, yy1;
-	int	ismin, ismax;
-	int	footprint_mode;
-	int	inside;
-	double	acrosstrackspacing;
-        double  slope;
-	int	i, j, ii, jj, iii, jjj, kkk, n;
-	int	i1, i2, j1, j2;
-        int     ir;
-	double	r;
-	int	dmask[9];
-	int	kgrid, kout, kint, ib;
-	int	ixx[4], iyy[4];
-	int	ix1, ix2, iy1, iy2;
-        double  t1, t2;
-
-	/* get current default values */
-	status = mb_defaults(verbose,&format,&pings,&lonflip,bounds,
-		btime_i,etime_i,&speedmin,&timegap);
-
-	/* set default input and output */
-	strcpy (filelist, "datalist.mb-1");
-
-	/* initialize some values */
-	gridkindstring[0] = '\0';
-	strcpy(fileroot,"grid");
-	strcpy(projection_id,"Geographic");
-	gbnd[0] = 0.0;
-	gbnd[1] = 0.0;
-	gbnd[2] = 0.0;
-	gbnd[3] = 0.0;
-	xdim = 101;
-	ydim = 101;
-	gxdim = 0;
-	gydim = 0;
-
-	/* process argument list */
-	while ((c = getopt(argc, argv, "A:a:B:b:C:c:D:d:E:e:F:f:G:g:HhI:i:J:j:L:l:MmNnO:o:P:p:R:r:S:s:T:t:U:u:VvW:w:X:x:Y:y:Z:z:")) != -1)
-	  switch (c)
-		{
-		case 'A':
-		case 'a':
-			sscanf (optarg,"%d", &datatype);
-                        if (optarg[1] == 'f' || optarg[1] == 'F')
-				usefiltered = MB_YES;
-			flag++;
-			break;
-		case 'B':
-		case 'b':
-			sscanf (optarg,"%lf", &border);
-			flag++;
-			break;
-		case 'C':
-		case 'c':
-			n = sscanf (optarg,"%d/%d/%lf", &clip, &clipmode,&tension);
-			if (n < 1)
-				clipmode = MBMOSAIC_INTERP_NONE;
-			else if (n == 1 && clip > 0)
-				clipmode = MBMOSAIC_INTERP_GAP;
-			else if (n == 1)
-				clipmode = MBMOSAIC_INTERP_NONE;
-			else if (clip > 0 && clipmode < 0)
-				clipmode = MBMOSAIC_INTERP_GAP;
-			else if (clipmode >= 3)
-				clipmode = MBMOSAIC_INTERP_ALL;
-                        if (n < 3)
-                                {
-                                tension = 0.0;
-                                }
-			flag++;
-			break;
-		case 'D':
-		case 'd':
-			n = sscanf (optarg,"%d/%d", &xdim, &ydim);
-			if (n == 2)
-				set_dimensions = MB_YES;
-			flag++;
-			break;
-		case 'E':
-		case 'e':
-			if (optarg[strlen(optarg)-1] == '!')
-			    {
-			    spacing_priority = MB_YES;
-			    optarg[strlen(optarg)-1] = '\0';
-			    }
-			n = sscanf (optarg,"%lf/%lf/%s",
-				    &dx_set, &dy_set, units);
-			if (n > 1)
-				set_spacing = MB_YES;
-			if (n < 3)
-				strcpy(units, "meters");
-			flag++;
-			break;
-		case 'F':
-		case 'f':
-			sscanf (optarg,"%lf/%d", &priority_range, &weight_priorities);
-			grid_mode = MBMOSAIC_AVERAGE;
-			flag++;
-			break;
-		case 'G':
-		case 'g':
-			if (optarg[0] == '=')
-				{
-				gridkind = MBMOSAIC_GMTGRD;
-				strcpy(gridkindstring, optarg);
-				}
-			else
-				{
-				sscanf (optarg,"%d", &gridkind);
-				if (gridkind == MBMOSAIC_CDFGRD)
-					{
-					gridkind = MBMOSAIC_GMTGRD;
-					gridkindstring[0] = '\0';
-					}
-				else if (gridkind > MBMOSAIC_GMTGRD)
-					{
-					sprintf(gridkindstring, "=%d", (gridkind - 100));
-					gridkind = MBMOSAIC_GMTGRD;
-					}
-				}
-			flag++;
-			break;
-		case 'H':
-		case 'h':
-			help++;
-			break;
-		case 'I':
-		case 'i':
-			sscanf (optarg,"%s", filelist);
-			flag++;
-			break;
-		case 'J':
-		case 'j':
-			sscanf (optarg,"%s", projection_pars);
-			projection_pars_f = MB_YES;
-			flag++;
-			break;
-		case 'L':
-		case 'l':
-			sscanf (optarg,"%d", &lonflip);
-			flag++;
-			break;
-		case 'M':
-		case 'm':
-			more = MB_YES;
-			flag++;
-			break;
-		case 'N':
-		case 'n':
-			use_NaN = MB_YES;
-			flag++;
-			break;
-		case 'O':
-		case 'o':
-			sscanf (optarg,"%s", fileroot);
-			flag++;
-			break;
-		case 'P':
-		case 'p':
-			sscanf (optarg,"%d", &pings);
-			flag++;
-			break;
-		case 'R':
-		case 'r':
-                       if (strchr(optarg,'/') == NULL)
-                            {
-                            sscanf (optarg,"%lf", &boundsfactor);
-                            if (boundsfactor <= 1.0)
-                                boundsfactor = 0.0;
-                            }
-			else
-                            {
-                            mb_get_bounds(optarg, gbnd);
-                            gbndset = MB_YES;
-                            }
-			flag++;
-			break;
-		case 'S':
-		case 's':
-			sscanf (optarg,"%lf", &speedmin);
-			flag++;
-			break;
-		case 'T':
-		case 't':
-			sscanf (optarg,"%s", topogridfile);
-			usetopogrid = MB_YES;
-			flag++;
-			break;
-		case 'U':
-		case 'u':
-			n = sscanf (optarg,"%lf/%lf/%d", &t1, &t2, &kkk);
-                        if (n == 3 && kkk == 1)
-                            {
-                            priority_heading = t1;
-                            priority_heading_factor = t2;
-                            if ((priority_mode & MBMOSAIC_PRIORITY_HEADING) == 0)
-                                priority_mode += MBMOSAIC_PRIORITY_HEADING;
-                            }
-                        else if (n >= 2)
-                            {
-                            priority_azimuth = t1;
-                            priority_azimuth_factor = t2;
-                            if ((priority_mode & MBMOSAIC_PRIORITY_AZIMUTH) == 0)
-                                priority_mode += MBMOSAIC_PRIORITY_AZIMUTH;
-                            }
-			flag++;
-			break;
-		case 'V':
-		case 'v':
-			verbose++;
-			break;
-		case 'W':
-		case 'w':
-			sscanf (optarg,"%lf", &scale);
-			flag++;
-			break;
-		case 'X':
-		case 'x':
-			sscanf (optarg,"%lf", &extend);
-			flag++;
-			break;
-		case 'Y':
-		case 'y':
-			sscanf (optarg,"%d", &priority_source);
-			if (priority_source == MBMOSAIC_PRIORITYTABLE_60DEGREESUP)
-				{
-				n_priority_angle = n_priority_angle_60degreesup;
-				priority_angle_angle = priority_angle_60degreesup_angle;
-				priority_angle_priority = priority_angle_60degreesup_priority;
-				}
-			else if (priority_source == MBMOSAIC_PRIORITYTABLE_67DEGREESUP)
-				{
-				n_priority_angle = n_priority_angle_67degreesup;
-				priority_angle_angle = priority_angle_67degreesup_angle;
-				priority_angle_priority = priority_angle_67degreesup_priority;
-				}
-			else if (priority_source == MBMOSAIC_PRIORITYTABLE_75DEGREESUP)
-				{
-				n_priority_angle = n_priority_angle_75degreesup;
-				priority_angle_angle = priority_angle_75degreesup_angle;
-				priority_angle_priority = priority_angle_75degreesup_priority;
-				}
-			else if (priority_source == MBMOSAIC_PRIORITYTABLE_85DEGREESUP)
-				{
-				n_priority_angle = n_priority_angle_85degreesup;
-				priority_angle_angle = priority_angle_85degreesup_angle;
-				priority_angle_priority = priority_angle_85degreesup_priority;
-				}
-			else if (priority_source == MBMOSAIC_PRIORITYTABLE_60DEGREESDN)
-				{
-				n_priority_angle = n_priority_angle_60degreesdn;
-				priority_angle_angle = priority_angle_60degreesdn_angle;
-				priority_angle_priority = priority_angle_60degreesdn_priority;
-				}
-			else if (priority_source == MBMOSAIC_PRIORITYTABLE_67DEGREESDN)
-				{
-				n_priority_angle = n_priority_angle_67degreesdn;
-				priority_angle_angle = priority_angle_67degreesdn_angle;
-				priority_angle_priority = priority_angle_67degreesdn_priority;
-				}
-			else if (priority_source == MBMOSAIC_PRIORITYTABLE_75DEGREESDN)
-				{
-				n_priority_angle = n_priority_angle_75degreesdn;
-				priority_angle_angle = priority_angle_75degreesdn_angle;
-				priority_angle_priority = priority_angle_75degreesdn_priority;
-				}
-			else if (priority_source == MBMOSAIC_PRIORITYTABLE_85DEGREESDN)
-				{
-				n_priority_angle = n_priority_angle_85degreesdn;
-				priority_angle_angle = priority_angle_85degreesdn_angle;
-				priority_angle_priority = priority_angle_85degreesdn_priority;
-				}
-			else
-				{
-				sscanf (optarg,"%s", pfile);
-				}
-                        if ((priority_mode & MBMOSAIC_PRIORITY_ANGLE) == 0)
-                            priority_mode += MBMOSAIC_PRIORITY_ANGLE;
-			break;
-		case 'Z':
-		case 'z':
-			sscanf (optarg,"%lf", &altitude_default);
-			flag++;
-			break;
-		case '?':
-			errflg++;
-		}
-
-	/* set output stream to stdout or stderr */
-	if (verbose >= 2)
-	    outfp = stderr;
-	else
-	    outfp = stdout;
-
-	/* if error flagged then print it and exit */
-	if (errflg)
-		{
-		fprintf(outfp,"usage: %s\n", usage_message);
-		fprintf(outfp,"\nProgram <%s> Terminated\n",
-			program_name);
-		error = MB_ERROR_BAD_USAGE;
-		exit(error);
-		}
-
-	/* print starting message */
-	if (verbose == 1 || help)
-		{
-		fprintf(outfp,"\nProgram %s\n",program_name);
-		fprintf(outfp,"Version %s\n",rcs_id);
-		fprintf(outfp,"MB-system Version %s\n",MB_VERSION);
-		}
-
-	/* print starting debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(outfp,"\ndbg2  Program <%s>\n",program_name);
-		fprintf(outfp,"dbg2  Version %s\n",rcs_id);
-		fprintf(outfp,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(outfp,"dbg2  Control Parameters:\n");
-		fprintf(outfp,"dbg2       verbose:              %d\n",verbose);
-		fprintf(outfp,"dbg2       help:                 %d\n",help);
-		fprintf(outfp,"dbg2       pings:                %d\n",pings);
-		fprintf(outfp,"dbg2       lonflip:              %d\n",lonflip);
-		fprintf(outfp,"dbg2       btime_i[0]:           %d\n",btime_i[0]);
-		fprintf(outfp,"dbg2       btime_i[1]:           %d\n",btime_i[1]);
-		fprintf(outfp,"dbg2       btime_i[2]:           %d\n",btime_i[2]);
-		fprintf(outfp,"dbg2       btime_i[3]:           %d\n",btime_i[3]);
-		fprintf(outfp,"dbg2       btime_i[4]:           %d\n",btime_i[4]);
-		fprintf(outfp,"dbg2       btime_i[5]:           %d\n",btime_i[5]);
-		fprintf(outfp,"dbg2       btime_i[6]:           %d\n",btime_i[6]);
-		fprintf(outfp,"dbg2       etime_i[0]:           %d\n",etime_i[0]);
-		fprintf(outfp,"dbg2       etime_i[1]:           %d\n",etime_i[1]);
-		fprintf(outfp,"dbg2       etime_i[2]:           %d\n",etime_i[2]);
-		fprintf(outfp,"dbg2       etime_i[3]:           %d\n",etime_i[3]);
-		fprintf(outfp,"dbg2       etime_i[4]:           %d\n",etime_i[4]);
-		fprintf(outfp,"dbg2       etime_i[5]:           %d\n",etime_i[5]);
-		fprintf(outfp,"dbg2       etime_i[6]:           %d\n",etime_i[6]);
-		fprintf(outfp,"dbg2       speedmin:             %f\n",speedmin);
-		fprintf(outfp,"dbg2       timegap:              %f\n",timegap);
-		fprintf(outfp,"dbg2       file list:            %s\n",ifile);
-		fprintf(outfp,"dbg2       output file root:     %s\n",fileroot);
-		fprintf(outfp,"dbg2       grid x dimension:     %d\n",xdim);
-		fprintf(outfp,"dbg2       grid y dimension:     %d\n",ydim);
-		fprintf(outfp,"dbg2       grid x spacing:       %f\n",dx);
-		fprintf(outfp,"dbg2       grid y spacing:       %f\n",dy);
-		fprintf(outfp,"dbg2       grid bounds[0]:       %f\n",gbnd[0]);
-		fprintf(outfp,"dbg2       grid bounds[1]:       %f\n",gbnd[1]);
-		fprintf(outfp,"dbg2       grid bounds[2]:       %f\n",gbnd[2]);
-		fprintf(outfp,"dbg2       grid bounds[3]:       %f\n",gbnd[3]);
-		fprintf(outfp,"dbg2       boundsfactor:         %f\n",boundsfactor);
-		fprintf(outfp,"dbg2       clipmode:             %d\n",clipmode);
-		fprintf(outfp,"dbg2       clip:                 %d\n",clip);
-		fprintf(outfp,"dbg2       tension:              %f\n",tension);
-		fprintf(outfp,"dbg2       more:                 %d\n",more);
-		fprintf(outfp,"dbg2       use_NaN:              %d\n",use_NaN);
-		fprintf(outfp,"dbg2       data type:            %d\n",datatype);
-		fprintf(outfp,"dbg2       usefiltered:          %d\n",usefiltered);
-		fprintf(outfp,"dbg2       grid format:          %d\n",gridkind);
-		if (gridkind == MBMOSAIC_GMTGRD)
-		fprintf(outfp,"dbg2       gmt grid format id:   %s\n",gridkindstring);
-		fprintf(outfp,"dbg2       scale:                %f\n",scale);
-		fprintf(outfp,"dbg2       border:               %f\n",border);
-		fprintf(outfp,"dbg2       extend:               %f\n",extend);
-		fprintf(outfp,"dbg2       tension:              %f\n",tension);
-		fprintf(outfp,"dbg2       grid_mode:            %d\n",grid_mode);
-		fprintf(outfp,"dbg2       priority_mode:        %d\n",priority_mode);
-		fprintf(outfp,"dbg2       priority_range:       %f\n",priority_range);
-		fprintf(outfp,"dbg2       weight_priorities:    %d\n",weight_priorities);
-		fprintf(outfp,"dbg2       priority_source:      %d\n",priority_source);
-		fprintf(outfp,"dbg2       pfile:                %s\n",pfile);
-		fprintf(outfp,"dbg2       priority_azimuth:     %f\n",priority_azimuth);
-		fprintf(outfp,"dbg2       priority_azimuth_fac: %f\n",priority_azimuth_factor);
-		fprintf(outfp,"dbg2       altitude_default:     %f\n",altitude_default);
-		fprintf(outfp,"dbg2       projection_pars:      %s\n",projection_pars);
-		fprintf(outfp,"dbg2       proj flag 1:          %d\n",projection_pars_f);
-		fprintf(outfp,"dbg2       projection_id:        %s\n",projection_id);
-		fprintf(outfp,"dbg2       utm_zone:             %d\n",utm_zone);
-		fprintf(stderr,"dbg2      usetopogrid:          %d\n",usetopogrid);
-		fprintf(stderr,"dbg2      topogridfile:         %s\n",topogridfile);
-		}
-
-	/* if help desired then print it and exit */
-	if (help)
-		{
-		fprintf(outfp,"\n%s\n",help_message);
-		fprintf(outfp,"\nusage: %s\n", usage_message);
-		exit(error);
-		}
-
-	/* if bounds not set get bounds of input data */
-	if (gbndset == MB_NO)
-		{
-		formatread = -1;
-		status = mb_get_info_datalist(verbose, filelist, &formatread,
-				&mb_info, lonflip, &error);
-
-		gbnd[0] = mb_info.lon_min;
-		gbnd[1] = mb_info.lon_max;
-		gbnd[2] = mb_info.lat_min;
-		gbnd[3] = mb_info.lat_max;
-		gbndset = MB_YES;
-
-		if (set_spacing == MB_NO && set_dimensions == MB_NO)
-			{
-			dx_set = 0.02 * mb_info.altitude_max;
-			dy_set = 0.02 * mb_info.altitude_max;
-			set_spacing = MB_YES;
-			strcpy(units, "meters");
-			}
-		}
-
-        /* if requested expand the grid bounds */
-        if (boundsfactor > 1.0)
-                {
-                xx1 = 0.5 * (boundsfactor - 1.0) * (gbnd[1] - gbnd[0]);
-                yy1 = 0.5 * (boundsfactor - 1.0) * (gbnd[3] - gbnd[2]);
-		gbnd[0] -= xx1;
-		gbnd[1] += xx1;
-		gbnd[2] -= yy1;
-		gbnd[3] += yy1;
-                }
-
-	/* if bounds not specified then quit */
-	if (gbnd[0] >= gbnd[1] || gbnd[2] >= gbnd[3])
-		{
-		fprintf(outfp,"\nGrid bounds not properly specified:\n\t%f %f %f %f\n",gbnd[0],gbnd[1],gbnd[2],gbnd[3]);
-		fprintf(outfp,"\nProgram <%s> Terminated\n",
-			program_name);
-		error = MB_ERROR_BAD_PARAMETER;
-		exit(error);
-		}
-
-	/* use bathymetry/amplitude beams for types other than sidescan */
-	if (datatype == MBMOSAIC_DATA_SIDESCAN)
-	  	use_beams = MB_NO;
-	else
-	  	use_beams = MB_YES;
-
-	/* use bathymetry slope for slope and slope corrected grazing angle */
-	if (datatype == MBMOSAIC_DATA_GRAZING
-		|| datatype == MBMOSAIC_DATA_SLOPE)
-		use_slope = MB_YES;
-
-	/* more option not available with single best algorithm */
-	if (more == MB_YES
-		&& grid_mode == MBMOSAIC_SINGLE_BEST)
-		more = MB_NO;
-
-	/* NaN cannot be used for ASCII grids */
-	if (use_NaN == MB_YES
-		&& (gridkind == MBMOSAIC_ASCII
-		    || gridkind == MBMOSAIC_ARCASCII))
-		use_NaN = MB_NO;
-
-	/* define NaN in case it's needed */
-	if (use_NaN == MB_YES)
-		{
-		MB_MAKE_FNAN(NaN);
-		outclipvalue = NaN;
-		}
-
-	/* deal with projected gridding */
-	if (projection_pars_f == MB_YES)
-		{
-		/* check for UTM with undefined zone */
-		if (strcmp(projection_pars, "UTM") == 0
-			|| strcmp(projection_pars, "U") == 0
-			|| strcmp(projection_pars, "utm") == 0
-			|| strcmp(projection_pars, "u") == 0)
-			{
-			reference_lon = 0.5 * (gbnd[0] + gbnd[1]);
-			if (reference_lon < 180.0)
-				reference_lon += 360.0;
-			if (reference_lon >= 180.0)
-				reference_lon -= 360.0;
-			utm_zone = (int)(((reference_lon + 183.0)
-				/ 6.0) + 0.5);
-			reference_lat = 0.5 * (gbnd[2] + gbnd[3]);
-			if (reference_lat >= 0.0)
-				sprintf(projection_id, "UTM%2.2dN", utm_zone);
-			else
-				sprintf(projection_id, "UTM%2.2dS", utm_zone);
-			}
-		else
-			strcpy(projection_id, projection_pars);
-
-		/* set projection flag */
-		use_projection = MB_YES;
-		proj_status = mb_proj_init(verbose,projection_id,
-			&(pjptr), &error);
-
-		/* if projection not successfully initialized then quit */
-		if (proj_status != MB_SUCCESS)
-			{
-			fprintf(outfp,"\nOutput projection %s not found in database\n",
-				projection_id);
-			fprintf(outfp,"\nProgram <%s> Terminated\n",
-				program_name);
-			error = MB_ERROR_BAD_PARAMETER;
-			mb_memory_clear(verbose, &error);
-			exit(error);
-			}
-
-		/* tranlate lon lat bounds from UTM if required */
-		if (gbnd[0] < -360.0 || gbnd[0] > 360.0
-			|| gbnd[1] < -360.0 || gbnd[1] > 360.0
-			|| gbnd[2] < -90.0 || gbnd[2] > 90.0
-			|| gbnd[3] < -90.0 || gbnd[3] > 90.0)
-			{
-			/* first point */
-			xx = gbnd[0];
-			yy = gbnd[2];
-			mb_proj_inverse(verbose, pjptr, xx, yy,
-					&xlon, &ylat, &error);
-			mb_apply_lonflip(verbose, lonflip, &xlon);
-			obnd[0] = xlon;
-			obnd[1] = xlon;
-			obnd[2] = ylat;
-			obnd[3] = ylat;
-
-			/* second point */
-			xx = gbnd[1];
-			yy = gbnd[2];
-			mb_proj_inverse(verbose, pjptr, xx, yy,
-					&xlon, &ylat, &error);
-			mb_apply_lonflip(verbose, lonflip, &xlon);
-			obnd[0] = MIN(obnd[0], xlon);
-			obnd[1] = MAX(obnd[1], xlon);
-			obnd[2] = MIN(obnd[2], ylat);
-			obnd[3] = MAX(obnd[3], ylat);
-
-			/* third point */
-			xx = gbnd[0];
-			yy = gbnd[3];
-			mb_proj_inverse(verbose, pjptr, xx, yy,
-					&xlon, &ylat, &error);
-			mb_apply_lonflip(verbose, lonflip, &xlon);
-			obnd[0] = MIN(obnd[0], xlon);
-			obnd[1] = MAX(obnd[1], xlon);
-			obnd[2] = MIN(obnd[2], ylat);
-			obnd[3] = MAX(obnd[3], ylat);
-
-			/* fourth point */
-			xx = gbnd[1];
-			yy = gbnd[3];
-			mb_proj_inverse(verbose, pjptr, xx, yy,
-					&xlon, &ylat, &error);
-			mb_apply_lonflip(verbose, lonflip, &xlon);
-			obnd[0] = MIN(obnd[0], xlon);
-			obnd[1] = MAX(obnd[1], xlon);
-			obnd[2] = MIN(obnd[2], ylat);
-			obnd[3] = MAX(obnd[3], ylat);
-			}
-
-		/* else translate bounds to UTM */
-		else
-			{
-			/* copy gbnd to obnd */
-			obnd[0] = gbnd[0];
-			obnd[1] = gbnd[1];
-			obnd[2] = gbnd[2];
-			obnd[3] = gbnd[3];
-
-			/* first point */
-			xlon = obnd[0];
-			ylat = obnd[2];
-			mb_proj_forward(verbose, pjptr, xlon, ylat,
-					&xx, &yy, &error);
-			gbnd[0] = xx;
-			gbnd[1] = xx;
-			gbnd[2] = yy;
-			gbnd[3] = yy;
-
-			/* second point */
-			xlon = obnd[1];
-			ylat = obnd[2];
-			mb_proj_forward(verbose, pjptr, xlon, ylat,
-					&xx, &yy, &error);
-			gbnd[0] = MIN(gbnd[0], xx);
-			gbnd[1] = MAX(gbnd[1], xx);
-			gbnd[2] = MIN(gbnd[2], yy);
-			gbnd[3] = MAX(gbnd[3], yy);
-
-			/* third point */
-			xlon = obnd[0];
-			ylat = obnd[3];
-			mb_proj_forward(verbose, pjptr, xlon, ylat,
-					&xx, &yy, &error);
-			gbnd[0] = MIN(gbnd[0], xx);
-			gbnd[1] = MAX(gbnd[1], xx);
-			gbnd[2] = MIN(gbnd[2], yy);
-			gbnd[3] = MAX(gbnd[3], yy);
-
-			/* fourth point */
-			xlon = obnd[1];
-			ylat = obnd[3];
-			mb_proj_forward(verbose, pjptr, xlon, ylat,
-					&xx, &yy, &error);
-			gbnd[0] = MIN(gbnd[0], xx);
-			gbnd[1] = MAX(gbnd[1], xx);
-			gbnd[2] = MIN(gbnd[2], yy);
-			gbnd[3] = MAX(gbnd[3], yy);
-			}
-
-		/* calculate grid properties */
-		if (set_spacing == MB_YES)
-			{
-			xdim = (gbnd[1] - gbnd[0])/dx_set + 1;
-			if (dy_set <= 0.0)
-				dy_set = dx_set;
-			ydim = (gbnd[3] - gbnd[2])/dy_set + 1;
-			if (spacing_priority == MB_YES)
-				{
-				gbnd[1] = gbnd[0] + dx_set * (xdim - 1);
-				gbnd[3] = gbnd[2] + dy_set * (ydim - 1);
-				}
-			if (units[0] == 'M' || units[0] == 'm')
-				strcpy(units, "meters");
-			else if (units[0] == 'K' || units[0] == 'k')
-				strcpy(units, "km");
-			else if (units[0] == 'F' || units[0] == 'f')
-				strcpy(units, "feet");
-			else
-				strcpy(units, "unknown");
-			}
-
-fprintf(stderr," Projected coordinates on: proj_status:%d  projection:%s\n",
-proj_status, projection_id);
-fprintf(stderr," Lon Lat Bounds: %f %f %f %f\n",
-obnd[0], obnd[1], obnd[2], obnd[3]);
-fprintf(stderr," XY Bounds: %f %f %f %f\n",
-gbnd[0], gbnd[1], gbnd[2], gbnd[3]);
-		}
-
-	/* deal with no projection */
-	else
-		{
-
-		/* calculate grid properties */
-		mb_coor_scale(verbose,0.5*(gbnd[2]+gbnd[3]),&mtodeglon,&mtodeglat);
-		deglontokm = 0.001/mtodeglon;
-		deglattokm = 0.001/mtodeglat;
-		if (set_spacing == MB_YES
-			&& (units[0] == 'M' || units[0] == 'm'))
-			{
-			xdim = (gbnd[1] - gbnd[0])/(mtodeglon*dx_set) + 1;
-			if (dy_set <= 0.0)
-				dy_set = mtodeglon * dx_set / mtodeglat;
-			ydim = (gbnd[3] - gbnd[2])/(mtodeglat*dy_set) + 1;
-			if (spacing_priority == MB_YES)
-				{
-				gbnd[1] = gbnd[0] + mtodeglon * dx_set * (xdim - 1);
-				gbnd[3] = gbnd[2] + mtodeglat * dy_set * (ydim - 1);
-				}
-			strcpy(units, "meters");
-			}
-		else if (set_spacing == MB_YES
-			&& (units[0] == 'K' || units[0] == 'k'))
-			{
-			xdim = (gbnd[1] - gbnd[0])*deglontokm/dx_set + 1;
-			if (dy_set <= 0.0)
-				dy_set = deglattokm * dx_set / deglontokm;
-			ydim = (gbnd[3] - gbnd[2])*deglattokm/dy_set + 1;
-			if (spacing_priority == MB_YES)
-				{
-				gbnd[1] = gbnd[0] + dx_set * (xdim - 1) / deglontokm;
-				gbnd[3] = gbnd[2] + dy_set * (ydim - 1) / deglattokm;
-				}
-			strcpy(units, "km");
-			}
-		else if (set_spacing == MB_YES
-			&& (units[0] == 'F' || units[0] == 'f'))
-			{
-			xdim = (gbnd[1] - gbnd[0])/(mtodeglon * 0.3048 * dx_set) + 1;
-			if (dy_set <= 0.0)
-				dy_set = mtodeglon * dx_set / mtodeglat;
-			ydim = (gbnd[3] - gbnd[2])/(mtodeglat * 0.3048 * dy_set) + 1;
-			if (spacing_priority == MB_YES)
-				{
-				gbnd[1] = gbnd[0] + mtodeglon * 0.3048 * dx_set * (xdim - 1);
-				gbnd[3] = gbnd[2] + mtodeglat * 0.3048 * dy_set * (ydim - 1);
-				}
-			strcpy(units, "feet");
-			}
-		else if (set_spacing == MB_YES)
-			{
-			xdim = (gbnd[1] - gbnd[0])/dx_set + 1;
-			if (dy_set <= 0.0)
-				dy_set = dx_set;
-			ydim = (gbnd[3] - gbnd[2])/dy_set + 1;
-			if (spacing_priority == MB_YES)
-				{
-				gbnd[1] = gbnd[0] + dx_set * (xdim - 1);
-				gbnd[3] = gbnd[2] + dy_set * (ydim - 1);
-				}
-			strcpy(units, "degrees");
-			}
-		}
-
-	/* calculate other grid properties */
-	dx = (gbnd[1] - gbnd[0])/(xdim-1);
-	dy = (gbnd[3] - gbnd[2])/(ydim-1);
-	gaussian_factor = 4.0/(scale*scale*dx*dy);
-	offx = 0;
-	offy = 0;
-	if (extend > 0.0)
-		{
-		offx = (int) (extend*xdim);
-		offy = (int) (extend*ydim);
-		}
-	gxdim = xdim + 2*offx;
-	gydim = ydim + 2*offy;
-	wbnd[0] = gbnd[0] - offx*dx;
-	wbnd[1] = gbnd[1] + offx*dx;
-	wbnd[2] = gbnd[2] - offy*dy;
-	wbnd[3] = gbnd[3] + offy*dy;
-
-	/* get data input bounds in lon lat */
-	if (use_projection == MB_NO)
-		{
-		bounds[0] = wbnd[0];
-		bounds[1] = wbnd[1];
-		bounds[2] = wbnd[2];
-		bounds[3] = wbnd[3];
-		}
-	/* get min max of lon lat for data input from projected bounds */
-	else
-		{
-		/* do first point */
-		xx = wbnd[0] - (wbnd[1] - wbnd[0]);
-		yy = wbnd[2] - (wbnd[3] - wbnd[2]);
-		mb_proj_inverse(verbose, pjptr,
-					xx, yy,
-					&xlon, &ylat,
-					&error);
-		mb_apply_lonflip(verbose, lonflip, &xlon);
-		bounds[0] = xlon;
-		bounds[1] = xlon;
-		bounds[2] = ylat;
-		bounds[3] = ylat;
-
-		/* do second point */
-		xx = wbnd[0] + (wbnd[1] - wbnd[0]);
-		yy = wbnd[2] - (wbnd[3] - wbnd[2]);
-		mb_proj_inverse(verbose, pjptr,
-					xx, yy,
-					&xlon, &ylat,
-					&error);
-		mb_apply_lonflip(verbose, lonflip, &xlon);
-		bounds[0] = MIN(bounds[0], xlon);
-		bounds[1] = MAX(bounds[1], xlon);
-		bounds[2] = MIN(bounds[2], ylat);
-		bounds[3] = MAX(bounds[3], ylat);
-
-		/* do third point */
-		xx = wbnd[0] - (wbnd[1] - wbnd[0]);
-		yy = wbnd[2] + (wbnd[3] - wbnd[2]);
-		mb_proj_inverse(verbose, pjptr,
-					xx, yy,
-					&xlon, &ylat,
-					&error);
-		mb_apply_lonflip(verbose, lonflip, &xlon);
-		bounds[0] = MIN(bounds[0], xlon);
-		bounds[1] = MAX(bounds[1], xlon);
-		bounds[2] = MIN(bounds[2], ylat);
-		bounds[3] = MAX(bounds[3], ylat);
-
-		/* do fourth point */
-		xx = wbnd[0] + (wbnd[1] - wbnd[0]);
-		yy = wbnd[2] + (wbnd[3] - wbnd[2]);
-		mb_proj_inverse(verbose, pjptr,
-					xx, yy,
-					&xlon, &ylat,
-					&error);
-		mb_apply_lonflip(verbose, lonflip, &xlon);
-		bounds[0] = MIN(bounds[0], xlon);
-		bounds[1] = MAX(bounds[1], xlon);
-		bounds[2] = MIN(bounds[2], ylat);
-		bounds[3] = MAX(bounds[3], ylat);
-		}
-
-	/* extend the bounds slightly to be sure no data gets missed */
-	xx = MIN(0.05*(bounds[1] - bounds[0]), 0.1);
-	yy = MIN(0.05*(bounds[3] - bounds[2]), 0.1);
-	bounds[0] = bounds[0] - xx;
-	bounds[1] = bounds[1] + xx;
-	bounds[2] = bounds[2] - yy;
-	bounds[3] = bounds[3] + yy;
-
-	/* figure out lonflip for data bounds */
-	if (bounds[0] < -180.0)
-		lonflip = -1;
-	else if (bounds[1] > 180.0)
-		lonflip = 1;
-	else if (lonflip == -1 && bounds[1] > 0.0)
-		lonflip = 0;
-	else if (lonflip == 1 && bounds[0] < 0.0)
-		lonflip = 0;
-
-	/* check interpolation parameters */
-	if ((clipmode == MBMOSAIC_INTERP_GAP
-		|| clipmode == MBMOSAIC_INTERP_NEAR)
-		&& clip > xdim && clip > ydim)
-		clipmode = MBMOSAIC_INTERP_ALL;
-        if (clipmode == MBMOSAIC_INTERP_ALL)
-                clip = MAX(xdim, ydim);
-        
-        /* set origin used to reduce data value size before conversion from
-         * double to float when calling the interpolation routines */
-        bdata_origin_x = 0.5 * (wbnd[0] + wbnd[1]);
-        bdata_origin_y = 0.5 * (wbnd[2] + wbnd[3]);
-
-	/* if specified get static angle priorities */
-	if (priority_source == MBMOSAIC_PRIORITYTABLE_FILE
-		&& (priority_mode & MBMOSAIC_PRIORITY_ANGLE))
-		{
-		/* count priorities */
-		if ((fp = fopen(pfile, "r")) == NULL)
-			{
-			error = MB_ERROR_OPEN_FAIL;
-			fprintf(stderr,"\nUnable to Open Angle Weights File <%s> for reading\n",pfile);
-			fprintf(stderr,"\nProgram <%s> Terminated\n",
-				program_name);
-			mb_memory_clear(verbose, &error);
-			exit(error);
-			}
-		n_priority_angle = 0;
-		while ((result = fgets(buffer,MB_PATH_MAXLINE,fp)) == buffer)
-			{
-			if (buffer[0] != '#')
-				{
-				n_priority_angle++;
-				}
-			}
-		fclose(fp);
-
-		/* allocate memory */
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_mallocd(verbose,__FILE__,__LINE__,n_priority_angle*sizeof(double),
-				(void **)&priority_angle_angle,&error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_mallocd(verbose,__FILE__,__LINE__,n_priority_angle*sizeof(double),
-				(void **)&priority_angle_priority,&error);
-		if (error != MB_ERROR_NO_ERROR)
-			{
-			mb_error(verbose,error,&message);
-			fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",message);
-			fprintf(stderr,"\nProgram <%s> Terminated\n",
-				program_name);
-			mb_memory_clear(verbose, &error);
-			exit(error);
-			}
-
-		/* read in angle priorities */
-		if ((fp = fopen(pfile, "r")) == NULL)
-			{
-			error = MB_ERROR_OPEN_FAIL;
-			fprintf(stderr,"\nUnable to Open Angle Weights File <%s> for reading\n",pfile);
-			fprintf(stderr,"\nProgram <%s> Terminated\n",
-				program_name);
-			mb_memory_clear(verbose, &error);
-			exit(error);
-			}
-		n_priority_angle = 0;
-		while ((result = fgets(buffer,MB_PATH_MAXLINE,fp)) == buffer)
-			{
-			if (buffer[0] != '#')
-				{
-				sscanf(buffer,"%lf %lf",
-					&priority_angle_angle[n_priority_angle],
-					&priority_angle_priority[n_priority_angle]);
-				n_priority_angle++;
-				}
-			}
-		fclose(fp);
-		}
-
-	/* read topography grid if 3D bottom correction specified */
-	if (usetopogrid == MB_YES)
-		{
-		status = mb_topogrid_init(verbose, topogridfile, &lonflip, &topogrid_ptr, &error);
-		if (error != MB_ERROR_NO_ERROR)
-			{
-			mb_error(verbose,error,&message);
-			fprintf(stderr,"\nMBIO Error loading topography grid: %s\n%s\n",topogridfile,message);
-			fprintf(stderr,"\nProgram <%s> Terminated\n",
-				program_name);
-			mb_memory_clear(verbose, &error);
-			exit(error);
-			}
-		}
-
-	/* output info */
-	if (verbose >= 0)
-		{
-		fprintf(outfp,"\nMBMOSAIC Parameters:\n");
-		fprintf(outfp,"List of input files: %s\n",filelist);
-		fprintf(outfp,"Output fileroot:     %s\n",fileroot);
-		fprintf(outfp,"Input Data Type:     ");
-		if (datatype == MBMOSAIC_DATA_AMPLITUDE && usefiltered == MB_NO)
-			fprintf(outfp,"Amplitude (unfiltered)\n");
-		else if (datatype == MBMOSAIC_DATA_AMPLITUDE && usefiltered == MB_YES)
-			fprintf(outfp,"Amplitude (filtered)\n");
-		else if (datatype == MBMOSAIC_DATA_SIDESCAN && usefiltered == MB_NO)
-			fprintf(outfp,"Sidescan (unfiltered)\n");
-		else if (datatype == MBMOSAIC_DATA_SIDESCAN && usefiltered == MB_YES)
-			fprintf(outfp,"Sidescan (filtered)\n");
-		else if (datatype == MBMOSAIC_DATA_FLAT_GRAZING)
-			fprintf(outfp,"Flat bottom grazing angle\n");
-		else if (datatype == MBMOSAIC_DATA_GRAZING)
-			fprintf(outfp,"Grazing angle\n");
-		else if (datatype == MBMOSAIC_DATA_SLOPE)
-			fprintf(outfp,"Bottom slope\n");
-		else
-			fprintf(outfp,"Unknown?\n");
-		fprintf(outfp,"Grid projection: %s\n", projection_id);
-		if (use_projection == MB_YES)
-			{
-			fprintf(outfp,"Projection ID: %s\n", projection_id);
-			}
-		fprintf(outfp,"Grid dimensions: %d %d\n",xdim,ydim);
-		fprintf(outfp,"Grid bounds:\n");
-		if (use_projection == MB_YES)
-			{
-			fprintf(outfp,"  Eastings:  %9.4f %9.4f\n",gbnd[0],gbnd[1]);
-			fprintf(outfp,"  Northings: %9.4f %9.4f\n",gbnd[2],gbnd[3]);
-			fprintf(outfp,"  Longitude: %9.4f %9.4f\n",obnd[0],obnd[1]);
-			fprintf(outfp,"  Latitude:  %9.4f %9.4f\n",obnd[2],obnd[3]);
-			}
-		else
-			{
-			fprintf(outfp,"  Longitude: %9.4f %9.4f\n",gbnd[0],gbnd[1]);
-			fprintf(outfp,"  Latitude:  %9.4f %9.4f\n",gbnd[2],gbnd[3]);
-			}
-               if (boundsfactor > 1.0)
-                    fprintf(outfp,"  Grid bounds correspond to %f times actual data coverage\n",boundsfactor);
-		fprintf(outfp,"Working grid dimensions: %d %d\n",gxdim,gydim);
-		if (use_projection == MB_YES)
-			{
-			fprintf(outfp,"Working Grid bounds:\n");
-			fprintf(outfp,"  Eastings:  %9.4f %9.4f\n",wbnd[0],wbnd[1]);
-			fprintf(outfp,"  Northings: %9.4f %9.4f\n",wbnd[2],wbnd[3]);
-			fprintf(outfp,"Easting interval:  %f %s\n",
-				dx,units);
-			fprintf(outfp,"Northing interval: %f %s\n",
-				dy,units);
-			if (set_spacing == MB_YES)
-				{
-				fprintf(outfp,"Specified Easting interval:  %f %s\n",
-					dx_set, units);
-				fprintf(outfp,"Specified Northing interval: %f %s\n",
-					dy_set, units);
-				}
-			}
-		else
-			{
-			fprintf(outfp,"Working Grid bounds:\n");
-			fprintf(outfp,"  Longitude: %9.4f %9.4f\n",wbnd[0],wbnd[1]);
-			fprintf(outfp,"  Latitude:  %9.4f %9.4f\n",wbnd[2],wbnd[3]);
-			fprintf(outfp,"Longitude interval: %f degrees or %f m\n",
-				dx,1000*dx*deglontokm);
-			fprintf(outfp,"Latitude interval:  %f degrees or %f m\n",
-				dy,1000*dy*deglattokm);
-			if (set_spacing == MB_YES)
-				{
-				fprintf(outfp,"Specified Longitude interval: %f %s\n",
-					dx_set, units);
-				fprintf(outfp,"Specified Latitude interval:  %f %s\n",
-					dy_set, units);
-				}
-			}
-		fprintf(outfp,"Input data bounds:\n");
-		fprintf(outfp,"  Longitude: %9.4f %9.4f\n",bounds[0],bounds[1]);
-		fprintf(outfp,"  Latitude:  %9.4f %9.4f\n",bounds[2],bounds[3]);
-		fprintf(outfp,"Mosaicing algorithm:  \n");
-		if (grid_mode == MBMOSAIC_SINGLE_BEST)
-			fprintf(outfp,"  Single highest weighted pixel\n");
-		else if (grid_mode == MBMOSAIC_AVERAGE)
-			{
-			fprintf(outfp,"  Average of highest weighted pixels\n");
-			fprintf(outfp,"  Pixel weighting range: %f\n", priority_range);
-			}
-		if (priority_mode == MBMOSAIC_PRIORITY_NONE)
-			fprintf(outfp, "  All pixels weighted evenly\n");
-		if (priority_mode & MBMOSAIC_PRIORITY_ANGLE)
-			{
-			fprintf(outfp, "  Pixels prioritized by flat bottom grazing angle\n");
-                        if (usetopogrid == MB_YES)
-				fprintf(outfp, "  Pixel depths calculated from topography grid: %s\n", topogridfile);
-                        else
-				fprintf(outfp, "  Pixel depths calculated from topoography in the swath file\n");
-			if (priority_source == MBMOSAIC_PRIORITYTABLE_FILE)
-				fprintf(outfp, "  Pixel prioritization file: %s\n", pfile);
-			else if (priority_source == MBMOSAIC_PRIORITYTABLE_60DEGREESUP)
-				fprintf(outfp, "  Pixel prioritization model: default 120 degree swath increasing out\n");
-			else if (priority_source == MBMOSAIC_PRIORITYTABLE_67DEGREESUP)
-				fprintf(outfp, "  Pixel prioritization model: default 134 degree swath increasing out\n");
-			else if (priority_source == MBMOSAIC_PRIORITYTABLE_75DEGREESUP)
-				fprintf(outfp, "  Pixel prioritization model: default 150 degree swath increasing out\n");
-			else if (priority_source == MBMOSAIC_PRIORITYTABLE_85DEGREESUP)
-				fprintf(outfp, "  Pixel prioritization model: default 170 degree swath increasing out\n");
-			else if (priority_source == MBMOSAIC_PRIORITYTABLE_60DEGREESDN)
-				fprintf(outfp, "  Pixel prioritization model: default 120 degree swath decreasing out\n");
-			else if (priority_source == MBMOSAIC_PRIORITYTABLE_67DEGREESDN)
-				fprintf(outfp, "  Pixel prioritization model: default 134 degree swath decreasing out\n");
-			else if (priority_source == MBMOSAIC_PRIORITYTABLE_75DEGREESDN)
-				fprintf(outfp, "  Pixel prioritization model: default 150 degree swath decreasing out\n");
-			else if (priority_source == MBMOSAIC_PRIORITYTABLE_85DEGREESDN)
-				fprintf(outfp, "  Pixel prioritization model: default 170 degree swath decreasing out\n");
-			fprintf(outfp, "  Grazing angle priorities:\n");
-			for (i=0;i<n_priority_angle;i++)
-				{
-				fprintf(outfp,"    %3d  %10.3f  %10.3f\n",
-				i, priority_angle_angle[i],priority_angle_priority[i]);
-				}
-			}
-		if (priority_mode & MBMOSAIC_PRIORITY_AZIMUTH)
-			{
-			fprintf(outfp, "  Pixels weighted by look azimuth\n");
-			fprintf(outfp, "  Preferred look azimuth: %f\n", priority_azimuth);
-			fprintf(outfp, "  Look azimuth factor:    %f\n", priority_azimuth_factor);
-			}
-		if (priority_mode & MBMOSAIC_PRIORITY_HEADING)
-			{
-			fprintf(outfp, "  Pixels weighted by platform heading\n");
-			fprintf(outfp, "  Preferred heading:      %f\n", priority_heading);
-			fprintf(outfp, "  Heading factor:         %f\n", priority_heading_factor);
-			}
-		fprintf(outfp,"  Gaussian filter 1/e length: %f grid intervals\n",
-				scale);
-		if (clipmode == MBMOSAIC_INTERP_NONE)
-			fprintf(outfp,"Spline interpolation not applied\n");
-		else if (clipmode == MBMOSAIC_INTERP_GAP)
-			{
-			fprintf(outfp,"Spline interpolation applied to fill data gaps\n");
-			fprintf(outfp,"Spline interpolation clipping dimension: %d\n",clip);
-			fprintf(outfp,"Spline tension (range 0.0 to infinity): %f\n",tension);
-			}
-		else if (clipmode == MBMOSAIC_INTERP_NEAR)
-			{
-			fprintf(outfp,"Spline interpolation applied near data\n");
-			fprintf(outfp,"Spline interpolation clipping dimension: %d\n",clip);
-			fprintf(outfp,"Spline tension (range 0.0 to infinity): %f\n",tension);
-			}
-		else if (clipmode == MBMOSAIC_INTERP_ALL)
-			{
-			fprintf(outfp,"Spline interpolation applied to fill entire grid\n");
-			fprintf(outfp,"Spline tension (range 0.0 to infinity): %f\n",tension);
-			}
-		if (gridkind == MBMOSAIC_ASCII)
-			fprintf(outfp,"Grid format %d:  ascii table\n",gridkind);
-		else if (gridkind == MBMOSAIC_CDFGRD)
-			fprintf(outfp,"Grid format %d:  GMT version 2 grd (netCDF)\n",gridkind);
-		else if (gridkind == MBMOSAIC_OLDGRD)
-			fprintf(outfp,"Grid format %d:  GMT version 1 grd (binary)\n",gridkind);
-		else if (gridkind == MBMOSAIC_ARCASCII)
-			fprintf(outfp,"Grid format %d:  Arc/Info ascii table\n",gridkind);
-		else if (gridkind == MBMOSAIC_GMTGRD)
-			{
-			fprintf(outfp,"Grid format %d:  GMT grid\n",gridkind);
-			if (strlen(gridkindstring) > 0)
-				fprintf(outfp,"GMT Grid ID:     %s\n",gridkindstring);
-			}
-		if (use_NaN == MB_YES)
-			fprintf(outfp,"NaN values used to flag regions with no data\n");
-		else
-			fprintf(outfp,"Real value of %f used to flag regions with no data\n",
-				outclipvalue);
-		if (more == MB_YES)
-			fprintf(outfp,"Data density and sigma grids also created\n");
-		fprintf(outfp,"MBIO parameters:\n");
-		fprintf(outfp,"  Ping averaging:       %d\n",pings);
-		fprintf(outfp,"  Longitude flipping:   %d\n",lonflip);
-		fprintf(outfp,"  Speed minimum:      %4.1f km/hr\n",speedmin);
-		}
-	if (verbose > 0)
-		fprintf(outfp,"\n");
-
-	/* allocate memory for arrays */
-	status = mb_mallocd(verbose,__FILE__,__LINE__,gxdim*gydim*sizeof(double),(void **)&grid,&error);
-	status = mb_mallocd(verbose,__FILE__,__LINE__,gxdim*gydim*sizeof(double),(void **)&norm,&error);
-	status = mb_mallocd(verbose,__FILE__,__LINE__,gxdim*gydim*sizeof(double),(void **)&maxpriority,&error);
-	status = mb_mallocd(verbose,__FILE__,__LINE__,gxdim*gydim*sizeof(int),(void **)&cnt,&error);
-	if (clip != 0)
-	    status = mb_mallocd(verbose,__FILE__,__LINE__,gxdim*gydim*sizeof(int),(void **)&num,&error);
-	status = mb_mallocd(verbose,__FILE__,__LINE__,gxdim*gydim*sizeof(double),(void **)&sigma,&error);
-	status = mb_mallocd(verbose,__FILE__,__LINE__,xdim*ydim*sizeof(float),(void **)&output,&error);
-
-	/* if error initializing memory then quit */
-	if (error != MB_ERROR_NO_ERROR)
-		{
-		mb_error(verbose,error,&message);
-		fprintf(outfp,"\nMBIO Error allocating data arrays:\n%s\n",
-			message);
-		fprintf(outfp,"\nProgram <%s> Terminated\n",
-			program_name);
-		mb_memory_clear(verbose, &error);
-		exit(error);
-		}
-
-	/* initialize arrays */
-	for (i=0;i<gxdim;i++)
-		for (j=0;j<gydim;j++)
-			{
-			kgrid = i*gydim + j;
-			grid[kgrid] = 0.0;
-			norm[kgrid] = 0.0;
-			cnt[kgrid] = 0;
-			sigma[kgrid] = 0.0;
-			maxpriority[kgrid] = 0.0;
-			}
-
-	/* open datalist file for list of all files that contribute to the grid */
-	strcpy(dfile,fileroot);
-	strcat(dfile,".mb-1");
-	if ((dfp = fopen(dfile,"w")) == NULL)
-		{
-		error = MB_ERROR_OPEN_FAIL;
-		fprintf(outfp,"\nUnable to open datalist file: %s\n",
-			dfile);
-		}
-
-	/***** do first pass gridding *****/
-	if (grid_mode == MBMOSAIC_SINGLE_BEST
-	    || priority_mode != MBMOSAIC_PRIORITY_NONE)
-	{
-
-	/* read in data */
-	ndata = 0;
-	if ((status = mb_datalist_open(verbose,&datalist,
-					filelist,look_processed,&error)) != MB_SUCCESS)
-		{
-		error = MB_ERROR_OPEN_FAIL;
-		fprintf(outfp,"\nUnable to open data list file: %s\n",
-			filelist);
-		fprintf(outfp,"\nProgram <%s> Terminated\n",
-			program_name);
-		mb_memory_clear(verbose, &error);
-		exit(error);
-		}
-	while ((status = mb_datalist_read2(verbose,datalist,
-			&pstatus,path,ppath,&format,&file_weight,&error))
-			== MB_SUCCESS)
-		{
-		ndatafile = 0;
-
-		/* if format > 0 then input is multibeam file */
-		if (format > 0)
-		{
-		/* apply pstatus */
-		if (pstatus == MB_PROCESSED_USE)
-			strcpy(file, ppath);
-		else
-			strcpy(file, path);
-
-		/* check for mbinfo file - get file bounds if possible */
-		status = mb_check_info(verbose, file, lonflip, bounds,
-				&file_in_bounds, &error);
-		if (status == MB_FAILURE)
-			{
-			file_in_bounds = MB_YES;
-			status = MB_SUCCESS;
-			error = MB_ERROR_NO_ERROR;
-			}
-
-		/* initialize the multibeam file */
-		if (file_in_bounds == MB_YES)
-		    {
-		    /* check for filtered amplitude or sidescan file */
-		    if (usefiltered == MB_YES && datatype == MBMOSAIC_DATA_AMPLITUDE)
-			{
-			if ((status = mb_get_ffa(verbose, file, &format, &error)) != MB_SUCCESS)
-			    {
-			    mb_error(verbose,error,&message);
-			    fprintf(stderr,"\nMBIO Error returned from function <mb_get_ffa>:\n%s\n",message);
-			    fprintf(stderr,"Requested filtered amplitude file missing\n");
-			    fprintf(stderr,"\nMultibeam File <%s> not initialized for reading\n",file);
-			    fprintf(stderr,"\nProgram <%s> Terminated\n",
-				    program_name);
-			    exit(error);
-			    }
-			}
-		    else if (usefiltered == MB_YES && datatype == MBMOSAIC_DATA_SIDESCAN)
-			{
-			if ((status = mb_get_ffs(verbose, file, &format, &error)) != MB_SUCCESS)
-			    {
-			    mb_error(verbose,error,&message);
-			    fprintf(stderr,"\nMBIO Error returned from function <mb_get_ffs>:\n%s\n",message);
-			    fprintf(stderr,"Requested filtered sidescan file missing\n");
-			    fprintf(stderr,"\nMultibeam File <%s> not initialized for reading\n",file);
-			    fprintf(stderr,"\nProgram <%s> Terminated\n",
-				    program_name);
-			    exit(error);
-			    }
-			}
-
-		    /* open the file */
-		    if ((status = mb_read_init(
-			verbose,file,format,pings,lonflip,bounds,
-			btime_i,etime_i,speedmin,timegap,
-			&mbio_ptr,&btime_d,&etime_d,
-			&beams_bath,&beams_amp,&pixels_ss,&error)) != MB_SUCCESS)
-			{
-			mb_error(verbose,error,&message);
-			fprintf(outfp,"\nMBIO Error returned from function <mb_read_init>:\n%s\n",message);
-			fprintf(outfp,"\nMultibeam File <%s> not initialized for reading\n",file);
-			fprintf(outfp,"\nProgram <%s> Terminated\n",
-				program_name);
-			mb_memory_clear(verbose, &error);
-			exit(error);
-			}
-
-                    /* get pointers to data storage */
-                    mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-                    store_ptr = mb_io_ptr->store_data;
-
-		    /* allocate memory for reading data arrays */
-		    if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							    sizeof(char), (void **)&beamflag, &error);
-		    if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							    sizeof(double), (void **)&bath, &error);
-		    if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_AMPLITUDE,
-							    sizeof(double), (void **)&amp, &error);
-		    if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							    sizeof(double), (void **)&bathacrosstrack, &error);
-		    if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							    sizeof(double), (void **)&bathalongtrack, &error);
-		    if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							    sizeof(double), (void **)&bathlon, &error);
-		    if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							    sizeof(double), (void **)&bathlat, &error);
-		    if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_SIDESCAN,
-							    sizeof(double), (void **)&ss, &error);
-		    if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_SIDESCAN,
-							    sizeof(double), (void **)&ssacrosstrack, &error);
-		    if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_SIDESCAN,
-							    sizeof(double), (void **)&ssalongtrack, &error);
-		    if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_SIDESCAN,
-							    sizeof(double), (void **)&sslon, &error);
-		    if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_SIDESCAN,
-							    sizeof(double), (void **)&sslat, &error);
-		    if (datatype != MBMOSAIC_DATA_SIDESCAN)
-		    	{
-		    	if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_AMPLITUDE,
-							    sizeof(double), (void **)&gangles, &error);
-		    	if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_AMPLITUDE,
-							    sizeof(double), (void **)&slopes, &error);
-		    	if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_AMPLITUDE,
-							    sizeof(double), (void **)&priorities, &error);
-		    	if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_AMPLITUDE,
-							    sizeof(struct footprint), (void **)&footprints, &error);
-			}
-		    else
-		    	{
-		    	if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_SIDESCAN,
-							    sizeof(double), (void **)&gangles, &error);
-		    	if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_SIDESCAN,
-							    sizeof(double), (void **)&priorities, &error);
-		    	if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_SIDESCAN,
-							    sizeof(struct footprint), (void **)&footprints, &error);
-			}
-		    if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							    sizeof(double), (void **)&work1, &error);
-		    if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							    sizeof(double), (void **)&work2, &error);
-
-		    /* if error initializing memory then quit */
-		    if (error != MB_ERROR_NO_ERROR)
-			{
-			mb_error(verbose,error,&message);
-			fprintf(outfp,"\nMBIO Error allocating data arrays:\n%s\n",
-				message);
-			fprintf(outfp,"\nProgram <%s> Terminated\n",
-				program_name);
-			mb_memory_clear(verbose, &error);
-			exit(error);
-			}
-
-		    /* loop over reading */
-		    while (error <= MB_ERROR_NO_ERROR)
-			{
-                        status = mb_get_all(verbose,mbio_ptr,&store_ptr,&kind,
-                                            time_i,&time_d,&navlon,&navlat,
-                                            &speed,&heading,
-                                            &distance,&altitude,&sonardepth,
-                                            &beams_bath,&beams_amp,&pixels_ss,
-                                            beamflag,bath,amp,bathacrosstrack,bathalongtrack,
-                                            ss,ssacrosstrack,ssalongtrack,
-                                            comment,&error);
-
-			/* time gaps are not a problem here */
-			if (error == MB_ERROR_TIME_GAP)
-				{
-				error = MB_ERROR_NO_ERROR;
-				status = MB_SUCCESS;
-				}
-
-			/* print debug statements */
-			if (verbose >= 2)
-				{
-				fprintf(stderr,"\ndbg2  Ping read in program <%s>\n",program_name);
-				fprintf(stderr,"dbg2       kind:           %d\n",kind);
-				fprintf(stderr,"dbg2       beams_bath:     %d\n",beams_bath);
-				fprintf(stderr,"dbg2       beams_amp:      %d\n",beams_amp);
-				fprintf(stderr,"dbg2       pixels_ss:      %d\n",pixels_ss);
-				fprintf(stderr,"dbg2       error:          %d\n",error);
-				fprintf(stderr,"dbg2       status:         %d\n",status);
-				}
-
-			if (status == MB_SUCCESS && kind == MB_DATA_DATA)
-                            {
-                            status = mb_extract_nav(verbose,mbio_ptr,store_ptr,&kind,
-                                                    time_i,&time_d,&navlon,&navlat,
-                                                    &speed,&heading,&draft,
-                                                    &roll,&pitch,&heave,&error);
-
-                            /* get factors for lon lat calculations */
-                            if (error == MB_ERROR_NO_ERROR)
-                                    {
-                                    mb_coor_scale(verbose,navlat,&mtodeglon,&mtodeglat);
-                                    headingx = sin(DTR*heading);
-                                    headingy = cos(DTR*heading);
-                                    }
-
-                            /* get beam widths */
-                            if (error == MB_ERROR_NO_ERROR)
-                                    {
-                                    status = mb_beamwidths(verbose, mbio_ptr, &beamwidth_xtrack, &beamwidth_ltrack, &error);
-                                    }
-
-                            /* mosaic beam based data (amplitude, grazing angle, slope) */
-                            if (use_beams == MB_YES
-                                    && error == MB_ERROR_NO_ERROR)
-                              {
-                              /* translate beam locations to lon/lat */
-                              for (ib=0;ib<beams_amp;ib++)
-                                {
-                                if (mb_beam_ok(beamflag[ib]))
-                                    {
-                                    /* handle regular beams */
-                                    bathlon[ib] = navlon
-                                        + headingy * mtodeglon
-                                            * bathacrosstrack[ib]
-                                        + headingx * mtodeglon
-                                            * bathalongtrack[ib];
-                                    bathlat[ib] = navlat
-                                        - headingx * mtodeglat
-                                            * bathacrosstrack[ib]
-                                        + headingy * mtodeglat
-                                            * bathalongtrack[ib];
-
-                                    /* get footprints */
-                                    mbmosaic_get_footprint(verbose, MBMOSAIC_FOOTPRINT_REAL,
-                                                            beamwidth_xtrack, beamwidth_ltrack,
-                                                            (bath[ib] - sonardepth),
-                                                            bathacrosstrack[ib], bathalongtrack[ib],
-                                                            0.0, &footprints[ib], &error);
-                                    for (j=0;j<4;j++)
-                                            {
-                                            xx = navlon
-                                                + headingy * mtodeglon
-                                                    * footprints[ib].x[j]
-                                                + headingx * mtodeglon
-                                                    * footprints[ib].y[j];
-                                            yy = navlat
-                                                - headingx * mtodeglat
-                                                    * footprints[ib].x[j]
-                                                + headingy * mtodeglat
-                                                    * footprints[ib].y[j];
-                                            footprints[ib].x[j] = xx;
-                                            footprints[ib].y[j] = yy;
-                                            }
-                                    }
-                                }
-
-                              /* get beam angles */
-                              mbmosaic_get_beamangles(verbose, sonardepth, beams_bath, beamflag, bath, bathacrosstrack, bathalongtrack,
-                                                      gangles, &error);
-
-                              /* get priorities */
-                              mbmosaic_get_beampriorities(verbose, priority_mode,
-                                    n_priority_angle, priority_angle_angle, priority_angle_priority,
-                                    priority_azimuth, priority_azimuth_factor,
-                                    priority_heading, priority_heading_factor,
-                                    heading, beams_bath, beamflag, gangles, priorities, &error);
-
-                              /* get bathymetry slopes if needed */
-                              if (use_slope == MB_YES)
-                                    mbmosaic_get_beamslopes(verbose,beams_bath,beamflag,bath,bathacrosstrack,slopes,&error);
-
-                              /* reproject beam positions if necessary */
-                              if (use_projection == MB_YES)
-                                {
-                                for (ib=0;ib<beams_amp;ib++)
-                                  if (mb_beam_ok(beamflag[ib]))
-                                    {
-                                    mb_proj_forward(verbose, pjptr,
-                                                    bathlon[ib], bathlat[ib],
-                                                    &bathlon[ib], &bathlat[ib],
-                                                    &error);
-                                    for (j=0;j<4;j++)
-                                            {
-                                            mb_proj_forward(verbose, pjptr,
-                                                    footprints[ib].x[j], footprints[ib].y[j],
-                                                    &footprints[ib].x[j], &footprints[ib].y[j],
-                                                    &error);
-                                            }
-                                    }
-                                }
-
-                              /* deal with data */
-                              for (ib=0;ib<beams_amp;ib++)
-                                if (mb_beam_ok(beamflag[ib]))
-                                  {
-                                  /* get position in grid */
-                                  for (j=0;j<4;j++)
-                                     {
-                                     ixx[j] = (footprints[ib].x[j] - wbnd[0] + 0.5*dx)/dx;
-                                     iyy[j] = (footprints[ib].y[j] - wbnd[2] + 0.5*dy)/dy;
-                                     }
-                                  ix1 = ixx[0];
-                                  iy1 = iyy[0];
-                                  ix2 = ixx[0];
-                                  iy2 = iyy[0];
-                                  for (j=1;j<4;j++)
-                                     {
-                                     ix1 = MIN(ix1, ixx[j]);
-                                     iy1 = MIN(iy1, iyy[j]);
-                                     ix2 = MAX(ix2, ixx[j]);
-                                     iy2 = MAX(iy2, iyy[j]);
-                                     }
-    /*		              dix = (int)(scale * (ix2 - ix1));
-                                  diy = (int)(scale * (iy2 - iy1));
-                                  ix1 = MAX(ix1 - dix, 0);
-                                  ix2 = MIN(ix2 + dix, gxdim - 1);
-                                  iy1 = MAX(iy1 - diy, 0);
-                                  iy2 = MIN(iy2 + diy, gydim - 1);*/
-                                  ix1 = MAX(ix1, 0);
-                                  ix2 = MIN(ix2, gxdim - 1);
-                                  iy1 = MAX(iy1, 0);
-                                  iy2 = MIN(iy2, gydim - 1);
-
-                                  /* process if in region of interest */
-                                    for (ii=ix1;ii<=ix2;ii++)
-                                     for (jj=iy1;jj<=iy2;jj++)
-                                        {
-                                        /* set grid if highest weight */
-                                        kgrid = ii*gydim + jj;
-                                        xx = dx * ii + wbnd[0];
-                                        yy = dy * jj + wbnd[2];
-                                        inside = mb_pr_point_in_quad(verbose, xx, yy,
-                                                                    footprints[ib].x, footprints[ib].y,
-                                                                    &error);
-                                        if (inside == MB_YES
-                                            && priorities[ib] > maxpriority[kgrid])
-                                            {
-                                            if (datatype == MBMOSAIC_DATA_AMPLITUDE)
-                                                grid[kgrid] = amp[ib];
-                                            else if (datatype == MBMOSAIC_DATA_FLAT_GRAZING)
-                                              {
-                                                if (gangles[ib] > 0)
-                                                  grid[kgrid] = gangles[ib];
-                                                else
-                                                  grid[kgrid] = - gangles[ib];
-                                              }
-                                            else if (datatype == MBMOSAIC_DATA_GRAZING)
-                                              {
-                                                slope = slopes[ib] + gangles[ib];
-                                                if (slope < 0)
-                                                  slope = -slope;
-                                                grid[kgrid] = slope;
-                                              }
-                                            else if (datatype == MBMOSAIC_DATA_SLOPE)
-                                              {
-                                                slope = slopes[ib];
-                                                if (slope < 0)
-                                                  slope = -slope;
-                                                grid[kgrid] = slope;
-                                              }
-
-                                            cnt[kgrid] = 1;
-                                            maxpriority[kgrid] = priorities[ib];
-                                            }
-                                        }
-                                  ndata++;
-                                  ndatafile++;
-                                  }
-                              }
-
-                           /* mosaic sidescan */
-                            else if (datatype == MBMOSAIC_DATA_SIDESCAN
-                                    && error == MB_ERROR_NO_ERROR)
-                              {
-                              /* get spacing */
-                              xsmin = 0.0;
-                              xsmax = 0.0;
-                              ismin = pixels_ss / 2;
-                              ismax = pixels_ss / 2;
-                              for (ib=0;ib<pixels_ss;ib++)
-                                {
-                                if (ss[ib] > MB_SIDESCAN_NULL)
-                                    {
-                                    if (ssacrosstrack[ib] < xsmin)
-                                            {
-                                            xsmin = ssacrosstrack[ib];
-                                            ismin = ib;
-                                            }
-                                    if (ssacrosstrack[ib] > xsmax)
-                                            {
-                                            xsmax = ssacrosstrack[ib];
-                                            ismax = ib;
-                                            }
-                                    }
-                                }
-                              if (ismax > ismin)
-                                    {
-                                    footprint_mode = MBMOSAIC_FOOTPRINT_SPACING;
-                                    acrosstrackspacing = (xsmax - xsmin) / (ismax - ismin);
-                                    }
-                              else
-                                    {
-                                    footprint_mode = MBMOSAIC_FOOTPRINT_REAL;
-                                    acrosstrackspacing = 0.0;
-                                    }
-
-                              /* translate pixel locations to lon/lat */
-                              for (ib=0;ib<pixels_ss;ib++)
-                                {
-                                if (ss[ib] > MB_SIDESCAN_NULL)
-                                    {
-                                    sslon[ib] = navlon
-                                        + headingy * mtodeglon
-                                            * ssacrosstrack[ib]
-                                        + headingx * mtodeglon
-                                            * ssalongtrack[ib];
-                                    sslat[ib] = navlat
-                                        - headingx * mtodeglat
-                                            * ssacrosstrack[ib]
-                                        + headingy * mtodeglat
-                                            * ssalongtrack[ib];
-    /*fprintf(stderr,"ib:%d ss:%f  x:%f l:%f  lon:%f lat:%f fprnt:",
-    ib,ss[ib],ssacrosstrack[ib],ssalongtrack[ib],sslon[ib],sslat[ib]);*/
-
-                                    /* get footprints */
-                                    mbmosaic_get_footprint(verbose, footprint_mode,
-                                                            beamwidth_xtrack, beamwidth_ltrack,
-                                                            altitude,
-                                                            ssacrosstrack[ib], ssalongtrack[ib],
-                                                            acrosstrackspacing, &footprints[ib], &error);
-                                    for (j=0;j<4;j++)
-                                            {
-                                            xx = navlon
-                                                + headingy * mtodeglon
-                                                    * footprints[ib].x[j]
-                                                + headingx * mtodeglon
-                                                    * footprints[ib].y[j];
-                                            yy = navlat
-                                                - headingx * mtodeglat
-                                                    * footprints[ib].x[j]
-                                                + headingy * mtodeglat
-                                                    * footprints[ib].y[j];
-    /*fprintf(stderr," %f %f",footprints[ib].x[j],footprints[ib].y[j]);*/
-                                            footprints[ib].x[j] = xx;
-                                            footprints[ib].y[j] = yy;
-                                            }
-    /*fprintf(stderr,"\n");*/
-                                    }
-                                }
-
-                              /* get angle vs acrosstrack distance table using topographic grid */
-                              table_error = MB_ERROR_NO_ERROR;
-                              if (usetopogrid == MB_YES)
-                                {
-                                table_status = mb_topogrid_getangletable(verbose, topogrid_ptr, nangle, angle_min, angle_max,
-                                                                            navlon, navlat, heading,
-                                                                            altitude, sonardepth, pitch,
-                                                                            table_angle, table_xtrack, table_ltrack,
-                                                                            table_altitude, table_range, &table_error);
-                                if (table_status == MB_FAILURE)
-                                    {
-                                    mb_error(verbose,table_error,&message);
-                                    fprintf(outfp,"\nMBIO Error extracting topography from grid for sidescan:\n%s\n",message);
-                                    fprintf(outfp,"\nNonfatal error in program <%s>\n",program_name);
-                                    fprintf(outfp,"Requested angle-distance table extends beyond the bounds of the topography grid <%s>\n",topogridfile);
-                                    fprintf(outfp,"used for grazing angle calculation - flat bottom calculation used in places.\n");
-                                    table_status = MB_SUCCESS;
-                                    table_error = MB_ERROR_NO_ERROR;
-                                    }
-                                }
-
-                              /* get angle vs acrosstrack distance table using bathymetry from the swath file with sidescan */
-                              else
-                                {
-                                table_status = mbmosaic_bath_getangletable(verbose, sonardepth, beams_bath, beamflag, bath, bathacrosstrack, bathalongtrack,
-                                                                            angle_min, angle_max, nangle, table_angle, table_xtrack, table_ltrack,
-                                                                            table_altitude, table_range, &table_error);
-                                }
-
-                              /* if need be, calculate angles using flat bottom layout and nadir altitude */
-                              if (table_status == MB_FAILURE)
-                                {
-                                if (altitude <= 0.0)
-                                    altitude = altitude_default;
-                                table_status = mbmosaic_flatbottom_getangletable(verbose, altitude,
-                                                                            angle_min, angle_max, nangle, table_angle, table_xtrack, table_ltrack,
-                                                                            table_altitude, table_range, &table_error);
-                                }
-
-                              /* get angles for each pixel */
-                              mbmosaic_get_ssangles(verbose, nangle, table_angle, table_xtrack, table_ltrack, table_altitude, table_range,
-                                                                            pixels_ss, ss, ssacrosstrack, gangles, &error);
-
-                              /* get priorities for each pixel */
-                              mbmosaic_get_sspriorities(verbose, priority_mode,
-                                    n_priority_angle, priority_angle_angle, priority_angle_priority,
-                                    priority_azimuth, priority_azimuth_factor,
-                                    priority_heading, priority_heading_factor,
-                                    heading, pixels_ss, ss, gangles, priorities, &error);
-
-                              /* reproject pixel positions if necessary */
-                              if (use_projection == MB_YES)
-                                {
-                                for (ib=0;ib<pixels_ss;ib++)
-                                  if (ss[ib] > MB_SIDESCAN_NULL)
-                                    {
-                                    mb_proj_forward(verbose, pjptr,
-                                                    sslon[ib], sslat[ib],
-                                                    &sslon[ib], &sslat[ib],
-                                                    &error);
-                                    for (j=0;j<4;j++)
-                                            {
-                                            mb_proj_forward(verbose, pjptr,
-                                                    footprints[ib].x[j], footprints[ib].y[j],
-                                                    &footprints[ib].x[j], &footprints[ib].y[j],
-                                                    &error);
-                                            }
-                                    }
-                                }
-
-                              /* deal with data */
-                              for (ib=0;ib<pixels_ss;ib++)
-                                if (ss[ib] > MB_SIDESCAN_NULL)
-                                  {
-                                  /* get position in grid */
-                                  for (j=0;j<4;j++)
-                                     {
-                                     ixx[j] = (footprints[ib].x[j] - wbnd[0] + 0.5*dx)/dx;
-                                     iyy[j] = (footprints[ib].y[j] - wbnd[2] + 0.5*dy)/dy;
-                                     }
-                                  ix1 = ixx[0];
-                                  iy1 = iyy[0];
-                                  ix2 = ixx[0];
-                                  iy2 = iyy[0];
-                                  for (j=1;j<4;j++)
-                                     {
-                                     ix1 = MIN(ix1, ixx[j]);
-                                     iy1 = MIN(iy1, iyy[j]);
-                                     ix2 = MAX(ix2, ixx[j]);
-                                     iy2 = MAX(iy2, iyy[j]);
-                                     }
-    /*		              dix = (int)(scale * (ix2 - ix1));
-                                  diy = (int)(scale * (iy2 - iy1));
-                                  ix1 = MAX(ix1 - dix, 0);
-                                  ix2 = MIN(ix2 + dix, gxdim - 1);
-                                  iy1 = MAX(iy1 - diy, 0);
-                                  iy2 = MIN(iy2 + diy, gydim - 1);*/
-                                  ix1 = MAX(ix1, 0);
-                                  ix2 = MIN(ix2, gxdim - 1);
-                                  iy1 = MAX(iy1, 0);
-                                  iy2 = MIN(iy2, gydim - 1);
-
-                                  /* process if in region of interest */
-                                    for (ii=ix1;ii<=ix2;ii++)
-                                     for (jj=iy1;jj<=iy2;jj++)
-                                        {
-                                        /* set grid if highest weight */
-                                        kgrid = ii*gydim + jj;
-                                        xx = dx * ii + wbnd[0];
-                                        yy = dy * jj + wbnd[2];
-                                        inside = mb_pr_point_in_quad(verbose, xx, yy,
-                                                                    footprints[ib].x, footprints[ib].y,
-                                                                    &error);
-                                        if (inside == MB_YES
-                                            && priorities[ib] > maxpriority[kgrid])
-                                            {
-                                            grid[kgrid] = ss[ib];
-                                            cnt[kgrid] = 1;
-                                            maxpriority[kgrid] = priorities[ib];
-                                            }
-                                        }
-                                  ndata++;
-                                  ndatafile++;
-                                  }
-                              }
-                            }
-                        }
-		    status = mb_close(verbose,&mbio_ptr,&error);
-		    status = MB_SUCCESS;
-		    error = MB_ERROR_NO_ERROR;
-		    }
-		if (verbose >= 2)
-			fprintf(outfp,"\n");
-		if (verbose > 0 || file_in_bounds == MB_YES)
-			fprintf(outfp,"%u data points processed in %s\n",
-				ndatafile,file);
-
-		/* add to datalist if data actually contributed */
-		if (grid_mode != MBMOSAIC_AVERAGE
-			&& ndatafile > 0 && dfp != NULL)
-			{
-			if (pstatus == MB_PROCESSED_USE)
-				fprintf(dfp, "P:");
-			else
-				fprintf(dfp, "R:");
-			fprintf(dfp, "%s %d %f\n", path, format, file_weight);
-			fflush(dfp);
-			}
-		} /* end if (format > 0) */
-
-		}
-	if (datalist != NULL)
-		mb_datalist_close(verbose,&datalist,&error);
-	if (verbose > 0)
-		fprintf(outfp,"\n%u total data points processed in highest weight pass\n",ndata);
-	if (verbose > 0 && grid_mode == MBMOSAIC_AVERAGE)
-		fprintf(outfp, "\n");
-
-	}
-	/***** end of first pass gridding *****/
-
-	/***** do second pass gridding *****/
-	if (grid_mode == MBMOSAIC_AVERAGE)
-	{
-	/* initialize arrays */
-	for (i=0;i<gxdim;i++)
-		for (j=0;j<gydim;j++)
-			{
-			kgrid = i*gydim + j;
-			grid[kgrid] = 0.0;
-			cnt[kgrid] = 0;
-			sigma[kgrid] = 0.0;
-			}
-
-	/* read in data */
-	ndata = 0;
-	if ((status = mb_datalist_open(verbose,&datalist,
-					filelist,look_processed,&error)) != MB_SUCCESS)
-		{
-		error = MB_ERROR_OPEN_FAIL;
-		fprintf(outfp,"\nUnable to open data list file: %s\n",
-			filelist);
-		fprintf(outfp,"\nProgram <%s> Terminated\n",
-			program_name);
-		mb_memory_clear(verbose, &error);
-		exit(error);
-		}
-	while ((status = mb_datalist_read2(verbose,datalist,
-			&pstatus,path,ppath,&format,&file_weight,&error))
-			== MB_SUCCESS)
-		{
-		ndatafile = 0;
-
-		/* if format > 0 then input is multibeam file */
-		if (format > 0 && file[0] != '#')
-		{
-		/* apply pstatus */
-		if (pstatus == MB_PROCESSED_USE)
-			strcpy(file, ppath);
-		else
-			strcpy(file, path);
-
-		/* check for mbinfo file - get file bounds if possible */
-		status = mb_check_info(verbose, file, lonflip, bounds,
-				&file_in_bounds, &error);
-		if (status == MB_FAILURE)
-			{
-			file_in_bounds = MB_YES;
-			status = MB_SUCCESS;
-			error = MB_ERROR_NO_ERROR;
-			}
-
-		/* initialize the multibeam file */
-		if (file_in_bounds == MB_YES)
-		    {
-		    /* check for filtered amplitude or sidescan file */
-		    if (usefiltered == MB_YES && datatype == MBMOSAIC_DATA_AMPLITUDE)
-			{
-			if ((status = mb_get_ffa(verbose, file, &format, &error)) != MB_SUCCESS)
-			    {
-			    mb_error(verbose,error,&message);
-			    fprintf(stderr,"\nMBIO Error returned from function <mb_get_ffa>:\n%s\n",message);
-			    fprintf(stderr,"Requested filtered amplitude file missing\n");
-			    fprintf(stderr,"\nMultibeam File <%s> not initialized for reading\n",file);
-			    fprintf(stderr,"\nProgram <%s> Terminated\n",
-				    program_name);
-			    exit(error);
-			    }
-			}
-		    else if (usefiltered == MB_YES && datatype == MBMOSAIC_DATA_SIDESCAN)
-			{
-			if ((status = mb_get_ffs(verbose, file, &format, &error)) != MB_SUCCESS)
-			    {
-			    mb_error(verbose,error,&message);
-			    fprintf(stderr,"\nMBIO Error returned from function <mb_get_ffa>:\n%s\n",message);
-			    fprintf(stderr,"Requested filtered sidescan file missing\n");
-			    fprintf(stderr,"\nMultibeam File <%s> not initialized for reading\n",file);
-			    fprintf(stderr,"\nProgram <%s> Terminated\n",
-				    program_name);
-			    exit(error);
-			    }
-			}
-
-		    /* open the file */
-		    if ((status = mb_read_init(
-			verbose,file,format,pings,lonflip,bounds,
-			btime_i,etime_i,speedmin,timegap,
-			&mbio_ptr,&btime_d,&etime_d,
-			&beams_bath,&beams_amp,&pixels_ss,&error)) != MB_SUCCESS)
-			{
-			mb_error(verbose,error,&message);
-			fprintf(outfp,"\nMBIO Error returned from function <mb_read_init>:\n%s\n",message);
-			fprintf(outfp,"\nMultibeam File <%s> not initialized for reading\n",file);
-			fprintf(outfp,"\nProgram <%s> Terminated\n",
-				program_name);
-			mb_memory_clear(verbose, &error);
-			exit(error);
-			}
-
-                    /* get pointers to data storage */
-                    mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-                    store_ptr = mb_io_ptr->store_data;
-
-		    /* allocate memory for reading data arrays */
-		    if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							    sizeof(char), (void **)&beamflag, &error);
-		    if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							    sizeof(double), (void **)&bath, &error);
-		    if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_AMPLITUDE,
-							    sizeof(double), (void **)&amp, &error);
-		    if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							    sizeof(double), (void **)&bathacrosstrack, &error);
-		    if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							    sizeof(double), (void **)&bathalongtrack, &error);
-		    if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							    sizeof(double), (void **)&bathlon, &error);
-		    if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							    sizeof(double), (void **)&bathlat, &error);
-		    if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_SIDESCAN,
-							    sizeof(double), (void **)&ss, &error);
-		    if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_SIDESCAN,
-							    sizeof(double), (void **)&ssacrosstrack, &error);
-		    if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_SIDESCAN,
-							    sizeof(double), (void **)&ssalongtrack, &error);
-		    if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_SIDESCAN,
-							    sizeof(double), (void **)&sslon, &error);
-		    if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_SIDESCAN,
-							    sizeof(double), (void **)&sslat, &error);
-		    if (datatype != MBMOSAIC_DATA_SIDESCAN)
-		    	{
-		    	if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_AMPLITUDE,
-							    sizeof(double), (void **)&gangles, &error);
-		    	if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_AMPLITUDE,
-							    sizeof(double), (void **)&priorities, &error);
-		    	if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_AMPLITUDE,
-							    sizeof(struct footprint), (void **)&footprints, &error);
-			}
-		    else
-		    	{
-		    	if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_SIDESCAN,
-							    sizeof(double), (void **)&gangles, &error);
-		    	if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_SIDESCAN,
-							    sizeof(double), (void **)&priorities, &error);
-		    	if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_SIDESCAN,
-							    sizeof(struct footprint), (void **)&footprints, &error);
-			}
-		    if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							    sizeof(double), (void **)&work1, &error);
-		    if (error == MB_ERROR_NO_ERROR)
-			    status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							    sizeof(double), (void **)&work2, &error);
-
-		    /* if error initializing memory then quit */
-		    if (error != MB_ERROR_NO_ERROR)
-			{
-			mb_error(verbose,error,&message);
-			fprintf(outfp,"\nMBIO Error allocating data arrays:\n%s\n",
-				message);
-			fprintf(outfp,"\nProgram <%s> Terminated\n",
-				program_name);
-			mb_memory_clear(verbose, &error);
-			exit(error);
-			}
-
-		    /* loop over reading */
-		    while (error <= MB_ERROR_NO_ERROR)
-			{
-                        status = mb_get_all(verbose,mbio_ptr,&store_ptr,&kind,
-                                            time_i,&time_d,&navlon,&navlat,
-                                            &speed,&heading,
-                                            &distance,&altitude,&sonardepth,
-                                            &beams_bath,&beams_amp,&pixels_ss,
-                                            beamflag,bath,amp,bathacrosstrack,bathalongtrack,
-                                            ss,ssacrosstrack,ssalongtrack,
-                                            comment,&error);
-
-			/* time gaps are not a problem here */
-			if (error == MB_ERROR_TIME_GAP)
-				{
-				error = MB_ERROR_NO_ERROR;
-				status = MB_SUCCESS;
-				}
-
-			/* print debug statements */
-			if (verbose >= 2)
-				{
-				fprintf(stderr,"\ndbg2  Ping read in program <%s>\n",program_name);
-				fprintf(stderr,"dbg2       kind:           %d\n",kind);
-				fprintf(stderr,"dbg2       beams_bath:     %d\n",beams_bath);
-				fprintf(stderr,"dbg2       beams_amp:      %d\n",beams_amp);
-				fprintf(stderr,"dbg2       pixels_ss:      %d\n",pixels_ss);
-				fprintf(stderr,"dbg2       error:          %d\n",error);
-				fprintf(stderr,"dbg2       status:         %d\n",status);
-				}
-
-			if (status == MB_SUCCESS && kind == MB_DATA_DATA)
-                            {
-                            status = mb_extract_nav(verbose,mbio_ptr,store_ptr,&kind,
-                                                    time_i,&time_d,&navlon,&navlat,
-                                                    &speed,&heading,&draft,
-                                                    &roll,&pitch,&heave,&error);
-
-                            /* get factors for lon lat calculations */
-                            if (error == MB_ERROR_NO_ERROR)
-                                    {
-                                    mb_coor_scale(verbose,navlat,&mtodeglon,&mtodeglat);
-                                    headingx = sin(DTR*heading);
-                                    headingy = cos(DTR*heading);
-                                    }
-
-                            /* get beam widths */
-                            if (error == MB_ERROR_NO_ERROR)
-                                    {
-                                    status = mb_beamwidths(verbose, mbio_ptr, &beamwidth_xtrack, &beamwidth_ltrack, &error);
-                                    }
-
-                            /* mosaic beam based data (amplitude, grazing angle, slope) */
-                            if (use_beams == MB_YES
-                                    && error == MB_ERROR_NO_ERROR)
-                              {
-
-                              /* translate beam locations to lon/lat */
-                              for (ib=0;ib<beams_amp;ib++)
-                                {
-                                if (mb_beam_ok(beamflag[ib]))
-                                    {
-                                    bathlon[ib] = navlon
-                                        + headingy * mtodeglon
-                                            * bathacrosstrack[ib]
-                                        + headingx * mtodeglon
-                                            * bathalongtrack[ib];
-                                    bathlat[ib] = navlat
-                                        - headingx * mtodeglat
-                                            * bathacrosstrack[ib]
-                                        + headingy * mtodeglat
-                                            * bathalongtrack[ib];
-
-                                    /* get footprints */
-                                    mbmosaic_get_footprint(verbose, MBMOSAIC_FOOTPRINT_REAL,
-                                                            beamwidth_xtrack, beamwidth_ltrack,
-                                                            (bath[ib] - sonardepth),
-                                                            bathacrosstrack[ib], bathalongtrack[ib],
-                                                            0.0, &footprints[ib], &error);
-                                    for (j=0;j<4;j++)
-                                            {
-                                            xx = navlon
-                                                + headingy * mtodeglon
-                                                    * footprints[ib].x[j]
-                                                + headingx * mtodeglon
-                                                    * footprints[ib].y[j];
-                                            yy = navlat
-                                                - headingx * mtodeglat
-                                                    * footprints[ib].x[j]
-                                                + headingy * mtodeglat
-                                                    * footprints[ib].y[j];
-                                            footprints[ib].x[j] = xx;
-                                            footprints[ib].y[j] = yy;
-                                            }
-                                    }
-                                }
-
-                              /* get beam angles */
-                              mbmosaic_get_beamangles(verbose, sonardepth, beams_bath, beamflag, bath, bathacrosstrack, bathalongtrack,
-                                                      gangles, &error);
-
-                              /* get priorities */
-                              mbmosaic_get_beampriorities(verbose, priority_mode,
-                                    n_priority_angle, priority_angle_angle, priority_angle_priority,
-                                    priority_azimuth, priority_azimuth_factor,
-                                    priority_heading, priority_heading_factor,
-                                    heading, beams_bath, beamflag, gangles, priorities, &error);
-
-                              /* get bathymetry slopes if needed */
-                              if (use_slope == MB_YES)
-                                    mbmosaic_get_beamslopes(verbose,beams_bath,beamflag,bath,bathacrosstrack,slopes,&error);
-
-                              /* reproject beam positions if necessary */
-                              if (use_projection == MB_YES)
-                                {
-                                for (ib=0;ib<beams_amp;ib++)
-                                  if (mb_beam_ok(beamflag[ib]))
-                                    {
-                                    mb_proj_forward(verbose, pjptr,
-                                                    bathlon[ib], bathlat[ib],
-                                                    &bathlon[ib], &bathlat[ib],
-                                                    &error);
-                                    for (j=0;j<4;j++)
-                                            {
-                                            mb_proj_forward(verbose, pjptr,
-                                                    footprints[ib].x[j], footprints[ib].y[j],
-                                                    &footprints[ib].x[j], &footprints[ib].y[j],
-                                                    &error);
-                                            }
-                                    }
-                                }
-
-                              /* deal with data */
-                              for (ib=0;ib<beams_amp;ib++)
-                                if (mb_beam_ok(beamflag[ib]))
-                                  {
-                                  /* get position in grid */
-                                  for (j=0;j<4;j++)
-                                     {
-                                     ixx[j] = (footprints[ib].x[j] - wbnd[0] + 0.5*dx)/dx;
-                                     iyy[j] = (footprints[ib].y[j] - wbnd[2] + 0.5*dy)/dy;
-                                     }
-                                  ix1 = ixx[0];
-                                  iy1 = iyy[0];
-                                  ix2 = ixx[0];
-                                  iy2 = iyy[0];
-                                  for (j=1;j<4;j++)
-                                     {
-                                     ix1 = MIN(ix1, ixx[j]);
-                                     iy1 = MIN(iy1, iyy[j]);
-                                     ix2 = MAX(ix2, ixx[j]);
-                                     iy2 = MAX(iy2, iyy[j]);
-                                     }
-    /*		              dix = (int)(scale * (ix2 - ix1));
-                                  diy = (int)(scale * (iy2 - iy1));
-                                  ix1 = MAX(ix1 - dix, 0);
-                                  ix2 = MIN(ix2 + dix, gxdim - 1);
-                                  iy1 = MAX(iy1 - diy, 0);
-                                  iy2 = MIN(iy2 + diy, gydim - 1);*/
-                                  ix1 = MAX(ix1, 0);
-                                  ix2 = MIN(ix2, gxdim - 1);
-                                  iy1 = MAX(iy1, 0);
-                                  iy2 = MIN(iy2, gydim - 1);
-
-                                  /* process if in region of interest */
-                                    for (ii=ix1;ii<=ix2;ii++)
-                                     for (jj=iy1;jj<=iy2;jj++)
-                                        {
-                                        /* add to cell if weight high enough */
-                                        kgrid = ii*gydim + jj;
-                                        xx = dx * ii + wbnd[0];
-                                        yy = dy * jj + wbnd[2];
-                                        inside = mb_pr_point_in_quad(verbose, xx, yy,
-                                                                    footprints[ib].x, footprints[ib].y,
-                                                                    &error);
-                                        if (inside == MB_YES
-                                            && priorities[ib] > 0.0
-                                            && priorities[ib] >= maxpriority[kgrid] - priority_range)
-                                            {
-                                            xx = wbnd[0] + ii*dx - bathlon[ib];
-                                            yy = wbnd[2] + jj*dy - bathlat[ib];
-                                            norm_weight = file_weight * exp(-(xx*xx + yy*yy)*gaussian_factor);
-                                            if (weight_priorities == 1)
-                                                    norm_weight *= priorities[ib];
-                                            else if (weight_priorities == 2)
-                                                    norm_weight *= priorities[ib] * priorities[ib];
-                                            norm[kgrid] += norm_weight;
-                                            if (datatype == MBMOSAIC_DATA_AMPLITUDE)
-                                              {
-                                                grid[kgrid] += norm_weight * amp[ib];
-                                                sigma[kgrid] += norm_weight * amp[ib] * amp[ib];
-                                              }
-                                            else if (datatype == MBMOSAIC_DATA_FLAT_GRAZING)
-                                              {
-                                                if (gangles[ib] > 0)
-                                                  grid[kgrid] += norm_weight * gangles[ib];
-                                                else
-                                                  grid[kgrid] -= norm_weight * gangles[ib];
-                                                sigma[kgrid] += norm_weight * gangles[ib] * gangles[ib];
-                                              }
-                                            else if (datatype == MBMOSAIC_DATA_GRAZING)
-                                              {
-                                                slope = slopes[ib] + gangles[ib];
-                                                if (slope < 0)
-                                                  slope = -slope;
-                                                grid[kgrid] += norm_weight * slope;
-                                                sigma[kgrid] += norm_weight * slope * slope;
-                                              }
-                                            else if (datatype == MBMOSAIC_DATA_SLOPE)
-                                              {
-                                                slope = slopes[ib];
-                                                if (slope < 0)
-                                                  slope = -slope;
-                                                grid[kgrid] += norm_weight * slope;
-                                                sigma[kgrid] += norm_weight * slope * slope;
-                                              }
-                                            cnt[kgrid]++;
-                                            }
-                                        }
-                                    ndata++;
-                                    ndatafile++;
-                                  }
-                              }
-
-                            /* mosaic sidescan */
-                            else if (datatype == MBMOSAIC_DATA_SIDESCAN
-                                    && error == MB_ERROR_NO_ERROR)
-                              {
-                              /* get spacing */
-                              xsmin = 0.0;
-                              xsmax = 0.0;
-                              ismin = pixels_ss / 2;
-                              ismax = pixels_ss / 2;
-                              for (ib=0;ib<pixels_ss;ib++)
-                                {
-                                if (ss[ib] > MB_SIDESCAN_NULL)
-                                    {
-                                    if (ssacrosstrack[ib] < xsmin)
-                                            {
-                                            xsmin = ssacrosstrack[ib];
-                                            ismin = ib;
-                                            }
-                                    if (ssacrosstrack[ib] > xsmax)
-                                            {
-                                            xsmax = ssacrosstrack[ib];
-                                            ismax = ib;
-                                            }
-                                    }
-                                }
-                              if (ismax > ismin)
-                                    {
-                                    footprint_mode = MBMOSAIC_FOOTPRINT_SPACING;
-                                    acrosstrackspacing = (xsmax - xsmin) / (ismax - ismin);
-                                    }
-                              else
-                                    {
-                                    footprint_mode = MBMOSAIC_FOOTPRINT_REAL;
-                                    acrosstrackspacing = 0.0;
-                                    }
-
-                              /* translate pixel locations to lon/lat */
-                              for (ib=0;ib<pixels_ss;ib++)
-                                {
-                                if (ss[ib] > MB_SIDESCAN_NULL)
-                                    {
-                                    sslon[ib] = navlon
-                                        + headingy * mtodeglon
-                                            * ssacrosstrack[ib]
-                                        + headingx * mtodeglon
-                                            * ssalongtrack[ib];
-                                    sslat[ib] = navlat
-                                        - headingx * mtodeglat
-                                            * ssacrosstrack[ib]
-                                        + headingy * mtodeglat
-                                            * ssalongtrack[ib];
-
-                                    /* get footprints */
-                                    mbmosaic_get_footprint(verbose, footprint_mode,
-                                                            beamwidth_xtrack, beamwidth_ltrack,
-                                                            altitude,
-                                                            ssacrosstrack[ib], ssalongtrack[ib],
-                                                            acrosstrackspacing, &footprints[ib], &error);
-                                    for (j=0;j<4;j++)
-                                            {
-                                            xx = navlon
-                                                + headingy * mtodeglon
-                                                    * footprints[ib].x[j]
-                                                + headingx * mtodeglon
-                                                    * footprints[ib].y[j];
-                                            yy = navlat
-                                                - headingx * mtodeglat
-                                                    * footprints[ib].x[j]
-                                                + headingy * mtodeglat
-                                                    * footprints[ib].y[j];
-                                            footprints[ib].x[j] = xx;
-                                            footprints[ib].y[j] = yy;
-                                            }
-                                    }
-                                }
-
-                              /* get angle vs acrosstrack distance table using topographic grid */
-                              table_error = MB_ERROR_NO_ERROR;
-                              if (usetopogrid == MB_YES)
-                                {
-                                table_status = mb_topogrid_getangletable(verbose, topogrid_ptr, nangle, angle_min, angle_max,
-                                                                            navlon, navlat, heading,
-                                                                            altitude, sonardepth, pitch,
-                                                                            table_angle, table_xtrack, table_ltrack,
-                                                                            table_altitude, table_range, &table_error);
-                                if (table_status == MB_FAILURE)
-                                    {
-                                    mb_error(verbose,table_error,&message);
-                                    fprintf(outfp,"\nMBIO Error allocating data arrays:\n%s\n",message);
-                                    fprintf(outfp,"\nNonfatal error in program <%s>\n",program_name);
-                                    fprintf(outfp,"Sidescan data extends beyond the bounds of the topography grid <%s>\n",topogridfile);
-                                    fprintf(outfp,"used for grazing angle calculation - the mosaic may be truncated.\n");
-                                    table_status = MB_SUCCESS;
-                                    table_error = MB_ERROR_NO_ERROR;
-                                    }
-                                }
-
-                              /* get angle vs acrosstrack distance table using bathymetry from the swath file with sidescan */
-                              else
-                                {
-                                table_status = mbmosaic_bath_getangletable(verbose, sonardepth, beams_bath, beamflag, bath, bathacrosstrack, bathalongtrack,
-                                                                            angle_min, angle_max, nangle, table_angle, table_xtrack, table_ltrack,
-                                                                            table_altitude, table_range, &table_error);
-                                }
-
-                              /* if need be, calculate angles using flat bottom layout and nadir altitude */
-                              if (table_status == MB_FAILURE)
-                                {
-                                if (altitude <= 0.0)
-                                    altitude = altitude_default;
-                                table_status = mbmosaic_flatbottom_getangletable(verbose, altitude,
-                                                                            angle_min, angle_max, nangle, table_angle, table_xtrack, table_ltrack,
-                                                                            table_altitude, table_range, &table_error);
-                                }
-
-                              /* get angles for each pixel */
-                              mbmosaic_get_ssangles(verbose, nangle, table_angle, table_xtrack, table_ltrack, table_altitude, table_range,
-                                                                            pixels_ss, ss, ssacrosstrack, gangles, &error);
-
-                              /* get priorities for each pixel */
-                              mbmosaic_get_sspriorities(verbose, priority_mode,
-                                    n_priority_angle, priority_angle_angle, priority_angle_priority,
-                                    priority_azimuth, priority_azimuth_factor,
-                                    priority_heading, priority_heading_factor,
-                                    heading, pixels_ss, ss, gangles, priorities, &error);
-
-                            /* reproject pixel positions if necessary */
-                            if (use_projection == MB_YES)
-                              {
-                              for (ib=0;ib<pixels_ss;ib++)
-                                if (ss[ib] > MB_SIDESCAN_NULL)
-                                  {
-                                  mb_proj_forward(verbose, pjptr,
-                                                  sslon[ib], sslat[ib],
-                                                  &sslon[ib], &sslat[ib],
-                                                  &error);
-                                  for (j=0;j<4;j++)
-                                          {
-                                          mb_proj_forward(verbose, pjptr,
-                                                  footprints[ib].x[j], footprints[ib].y[j],
-                                                  &footprints[ib].x[j], &footprints[ib].y[j],
-                                                  &error);
-                                          }
-                                  }
-                              }
-
-                            /* deal with data */
-                            for (ib=0;ib<pixels_ss;ib++)
-                              if (ss[ib] > MB_SIDESCAN_NULL)
-                                {
-                                /* get position in grid */
-                                for (j=0;j<4;j++)
-                                   {
-                                   ixx[j] = (footprints[ib].x[j] - wbnd[0] + 0.5*dx)/dx;
-                                   iyy[j] = (footprints[ib].y[j] - wbnd[2] + 0.5*dy)/dy;
-                                   }
-                                ix1 = ixx[0];
-                                iy1 = iyy[0];
-                                ix2 = ixx[0];
-                                iy2 = iyy[0];
-                                for (j=1;j<4;j++)
-                                   {
-                                   ix1 = MIN(ix1, ixx[j]);
-                                   iy1 = MIN(iy1, iyy[j]);
-                                   ix2 = MAX(ix2, ixx[j]);
-                                   iy2 = MAX(iy2, iyy[j]);
-                                   }
-  /*		              dix = (int)(scale * (ix2 - ix1));
-                                diy = (int)(scale * (iy2 - iy1));
-                                ix1 = MAX(ix1 - dix, 0);
-                                ix2 = MIN(ix2 + dix, gxdim - 1);
-                                iy1 = MAX(iy1 - diy, 0);
-                                iy2 = MIN(iy2 + diy, gydim - 1);*/
-                                ix1 = MAX(ix1, 0);
-                                ix2 = MIN(ix2, gxdim - 1);
-                                iy1 = MAX(iy1, 0);
-                                iy2 = MIN(iy2, gydim - 1);
-
-                                /* process if in region of interest */
-                                  for (ii=ix1;ii<=ix2;ii++)
-                                   for (jj=iy1;jj<=iy2;jj++)
-                                      {
-                                      /* set grid if highest weight */
-                                      kgrid = ii*gydim + jj;
-                                      xx = dx * ii + wbnd[0];
-                                      yy = dy * jj + wbnd[2];
-                                      inside = mb_pr_point_in_quad(verbose, xx, yy,
-                                                                  footprints[ib].x, footprints[ib].y,
-                                                                  &error);
-  /* fprintf(stderr,"priorities[%d]:%f maxpriority[%d]:%f range:%f",
-  ib,priorities[ib],kgrid,maxpriority[kgrid],priority_range); */
-                                      if (inside == MB_YES
-                                          && priorities[ib] > 0.0
-                                          && priorities[ib] >= maxpriority[kgrid] - priority_range)
-                                          {
-  /*fprintf(stderr," - USE DATA!"); */
-                                          xx = wbnd[0] + ii*dx - sslon[ib];
-                                          yy = wbnd[2] + jj*dy - sslat[ib];
-                                          norm_weight = file_weight * exp(-(xx*xx + yy*yy)*gaussian_factor);
-                                          if (weight_priorities == 1)
-                                                  norm_weight *= priorities[ib];
-                                          else if (weight_priorities == 2)
-                                                  norm_weight *= priorities[ib] * priorities[ib];
-                                          grid[kgrid] += norm_weight * ss[ib];
-                                          norm[kgrid] += norm_weight;
-                                          sigma[kgrid] += norm_weight * ss[ib] * ss[ib];
-                                          cnt[kgrid]++;
-  /*fprintf(stderr," kgrid:%d norm_weight:%g grid:%g norm:%g cnt:%d",
-  kgrid,norm_weight,grid[kgrid],norm[kgrid],cnt[kgrid]);*/
-                                          }
-  /* fprintf(stderr,"\n"); */
-                                      }
-                                  ndata++;
-                                  ndatafile++;
-                                }
-                              }
-                            }
-                        }
-		    status = mb_close(verbose,&mbio_ptr,&error);
-		    status = MB_SUCCESS;
-		    error = MB_ERROR_NO_ERROR;
-		    }
-		if (verbose >= 2)
-			fprintf(outfp,"\n");
-		if (verbose > 0 || file_in_bounds == MB_YES)
-			fprintf(outfp,"%u data points processed in %s\n",
-				ndatafile,file);
-
-		/* add to datalist if data actually contributed */
-		if (ndatafile > 0 && dfp != NULL)
-			{
-			if (pstatus == MB_PROCESSED_USE)
-				fprintf(dfp, "P:");
-			else
-				fprintf(dfp, "R:");
-			fprintf(dfp, "%s %d %f\n", path, format, file_weight);
-			fflush(dfp);
-			}
-		} /* end if (format > 0) */
-
-		}
-	if (datalist != NULL)
-		mb_datalist_close(verbose,&datalist,&error);
-	if (verbose > 0)
-		fprintf(outfp,"\n%u total data points processed in averaging pass\n",ndata);
-
-	}
-	/***** end of second pass gridding *****/
-
-	/* close datalist if necessary */
-	if (dfp != NULL)
-		fclose(dfp);
-
-	/* deallocate topography grid array if necessary */
-	if (usetopogrid == MB_YES)
-		status = mb_topogrid_deall(verbose, &topogrid_ptr, &error);
-
-	/* now loop over all points in the output grid */
-	if (verbose >= 1)
-		fprintf(outfp,"\nMaking raw grid...\n");
-	nbinset = 0;
-	nbinzero = 0;
-	nbinspline = 0;
-
-	/* deal with single best mode */
-	if (grid_mode == MBMOSAIC_SINGLE_BEST)
-	    {
-	    for (i=0;i<gxdim;i++)
-		for (j=0;j<gydim;j++)
-		    {
-		    kgrid = i*gydim + j;
-		    if (cnt[kgrid] > 0)
-			{
-			nbinset++;
-			}
-		    else
-			{
-			grid[kgrid] = clipvalue;
-			}
-		    }
-	    }
-	else if (grid_mode == MBMOSAIC_AVERAGE)
-	    {
-	    for (i=0;i<gxdim;i++)
-		for (j=0;j<gydim;j++)
-		    {
-		    kgrid = i*gydim + j;
-		    if (cnt[kgrid] > 0)
-			{
-			nbinset++;
-			grid[kgrid] = grid[kgrid] / norm[kgrid];
-			sigma[kgrid] =
-				sqrt(fabs(sigma[kgrid] / norm[kgrid]
-					- grid[kgrid] * grid[kgrid]));
-			}
-		    else
-			{
-			grid[kgrid] = clipvalue;
-			}
-		    }
-	    }
-
-	/* if clip set do smooth interpolation */
-	if (clipmode != MBMOSAIC_INTERP_NONE && clip > 0 && nbinset > 0)
-		{
-		/* set up data vector */
-		ndata = 0;
-		if (border > 0.0)
-			ndata = 2*gxdim + 2*gydim - 2;
-		for (i=0;i<gxdim;i++)
-			for (j=0;j<gydim;j++)
-				{
-				kgrid = i*gydim + j;
-				if (grid[kgrid] < clipvalue) ndata++;
-				}
-
-		/* allocate and initialize sgrid */
-		status = mb_mallocd(verbose,__FILE__,__LINE__,3*ndata*sizeof(float),(void **)&sdata,&error);
-		if (status == MB_SUCCESS)
-			status = mb_mallocd(verbose,__FILE__,__LINE__,gxdim*gydim*sizeof(float),(void **)&sgrid,&error);
-		if (status == MB_SUCCESS)
-			status = mb_mallocd(verbose,__FILE__,__LINE__,ndata*sizeof(float),(void **)&work1,&error);
-		if (status == MB_SUCCESS)
-			status = mb_mallocd(verbose,__FILE__,__LINE__,ndata*sizeof(int),(void **)&work2,&error);
-		if (status == MB_SUCCESS)
-			status = mb_mallocd(verbose,__FILE__,__LINE__,(gxdim+gydim)*sizeof(int),(void **)&work3,&error);
-		if (error != MB_ERROR_NO_ERROR)
-			{
-			mb_error(verbose,MB_ERROR_MEMORY_FAIL,&message);
-			fprintf(outfp,"\nMBIO Error allocating interpolation work arrays:\n%s\n",
-				message);
-			fprintf(outfp,"\nProgram <%s> Terminated\n",
-				program_name);
-			mb_memory_clear(verbose, &error);
-			exit(error);
-			}
-		memset((char *)sgrid,0,gxdim*gydim*sizeof(float));
-
-		/* get points from grid */
-		sxmin = gbnd[0] - offx*dx;
-		symin = gbnd[2] - offy*dy;
-		ndata = 0;
-		for (i=0;i<gxdim;i++)
-			for (j=0;j<gydim;j++)
-				{
-				kgrid = i*gydim + j;
-				if (grid[kgrid] < clipvalue)
-					{
-					sdata[ndata++] = (float)(sxmin + dx*i - bdata_origin_x);
-					sdata[ndata++] = (float)(symin + dy*j - bdata_origin_y);
-					sdata[ndata++] = (float)grid[kgrid];
-					}
-				}
-		/* if desired set border */
-		if (border > 0.0)
-			{
-			for (i=0;i<gxdim;i++)
-				{
-				j = 0;
-				kgrid = i*gydim + j;
-				if (grid[kgrid] == clipvalue)
-					{
-					sdata[ndata++] = (float)(sxmin + dx*i - bdata_origin_x);
-					sdata[ndata++] = (float)(symin + dy*j - bdata_origin_y);
-					sdata[ndata++] = (float)border;
-					}
-				j = gydim - 1;
-				kgrid = i*gydim + j;
-				if (grid[kgrid] == clipvalue)
-					{
-					sdata[ndata++] = (float)(sxmin + dx*i - bdata_origin_x);
-					sdata[ndata++] = (float)(symin + dy*j - bdata_origin_y);
-					sdata[ndata++] = (float)border;
-					}
-				}
-			for (j=1;j<gydim-1;j++)
-				{
-				i = 0;
-				kgrid = i*gydim + j;
-				if (grid[kgrid] == clipvalue)
-					{
-					sdata[ndata++] = (float)(sxmin + dx*i - bdata_origin_x);
-					sdata[ndata++] = (float)(symin + dy*j - bdata_origin_y);
-					sdata[ndata++] = (float)border;
-					}
-				i = gxdim - 1;
-				kgrid = i*gydim + j;
-				if (grid[kgrid] == clipvalue)
-					{
-					sdata[ndata++] = (float)(sxmin + dx*i - bdata_origin_x);
-					sdata[ndata++] = (float)(symin + dy*j - bdata_origin_y);
-					sdata[ndata++] = (float)border;
-					}
-				}
-			}
-		ndata = ndata/3;
-
-		/* do the interpolation */
-		if (verbose > 0)
-			fprintf(outfp,"\nDoing spline interpolation with %u data points...\n",ndata);
-		cay = (float)tension;
-		xmin = (float)(sxmin - 0.5 * dx - bdata_origin_x);
-		ymin = (float)(symin - 0.5 * dy - bdata_origin_y);
-		ddx = (float)dx;
-		ddy = (float)dy;
-		if (clipmode == MBMOSAIC_INTERP_ALL)
-			clip = MAX(gxdim,gydim);
-		mb_zgrid2(sgrid,&gxdim,&gydim,&xmin,&ymin,
-			&ddx,&ddy,sdata,&ndata,
-			work1,work2,work3,&cay,&clip);
-
-		if (clipmode == MBMOSAIC_INTERP_GAP)
-		    fprintf(outfp,"Applying spline interpolation to fill gaps of %d cells or less...\n",clip);
-		else if (clipmode == MBMOSAIC_INTERP_NEAR)
-		    fprintf(outfp,"Applying spline interpolation to fill %d cells from data...\n",clip);
-		else if (clipmode == MBMOSAIC_INTERP_ALL)
-		    fprintf(outfp,"Applying spline interpolation to fill all undefined cells in the grid...\n");
-
-		/* translate the interpolation into the grid array
-		    filling only data gaps */
-		zflag = 5.0e34;
-		if (clipmode == MBMOSAIC_INTERP_GAP)
-			{
-			for (i=0;i<gxdim;i++)
-			    for (j=0;j<gydim;j++)
-				{
-				kgrid = i * gydim + j;
-#ifdef USESURFACE
-				kint = i + (gydim -j - 1) * gxdim;
-#else
-				kint = i + j*gxdim;
-#endif
-				num[kgrid] = MB_NO;
-				if (grid[kgrid] >= clipvalue
-				    && sgrid[kint] < zflag)
-				    {
-				    /* initialize direction mask of search */
-				    for (ii=0;ii<9;ii++)
-					dmask[ii] = MB_NO;
-
-				    /* loop over rings around point, starting close */
-				    for (ir=0; ir <= clip && num[kgrid] == MB_NO; ir++)
-				      {
-				      /* set bounds of search */
-				      i1 = MAX(0, i - ir);
-				      i2 = MIN(gxdim - 1, i + ir);
-				      j1 = MAX(0, j - ir);
-				      j2 = MIN(gydim - 1, j + ir);
-
-				      jj = j1;
-				      for (ii=i1;ii<=i2 && num[kgrid] == MB_NO;ii++)
-				        {
-					if (grid[ii*gydim+jj] < clipvalue)
-					    {
-					    r = sqrt((double)((ii-i)*(ii-i) + (jj-j)*(jj-j)));
-					    iii = rint((ii - i)/r) + 1;
-					    jjj = rint((jj - j)/r) + 1;
-					    kkk = iii * 3 + jjj;
-					    dmask[kkk] = MB_YES;
-					    if ((dmask[0] && dmask[8])
-						|| (dmask[3] && dmask[5])
-						|| (dmask[6] && dmask[2])
-						|| (dmask[1] && dmask[7]))
-						num[kgrid] = MB_YES;
-					    }
-					}
-
-				      jj = j2;
-				      for (ii=i1;ii<=i2 && num[kgrid] == MB_NO;ii++)
-				        {
-					if (grid[ii*gydim+jj] < clipvalue)
-					    {
-					    r = sqrt((double)((ii-i)*(ii-i) + (jj-j)*(jj-j)));
-					    iii = rint((ii - i)/r) + 1;
-					    jjj = rint((jj - j)/r) + 1;
-					    kkk = iii * 3 + jjj;
-					    dmask[kkk] = MB_YES;
-					    if ((dmask[0] && dmask[8])
-						|| (dmask[3] && dmask[5])
-						|| (dmask[6] && dmask[2])
-						|| (dmask[1] && dmask[7]))
-						num[kgrid] = MB_YES;
-					    }
-					}
-
-				      ii = i1;
-				      for (jj=j1;jj<=j2 && num[kgrid] == MB_NO;jj++)
-				        {
-					if (grid[ii*gydim+jj] < clipvalue)
-					    {
-					    r = sqrt((double)((ii-i)*(ii-i) + (jj-j)*(jj-j)));
-					    iii = rint((ii - i)/r) + 1;
-					    jjj = rint((jj - j)/r) + 1;
-					    kkk = iii * 3 + jjj;
-					    dmask[kkk] = MB_YES;
-					    if ((dmask[0] && dmask[8])
-						|| (dmask[3] && dmask[5])
-						|| (dmask[6] && dmask[2])
-						|| (dmask[1] && dmask[7]))
-						num[kgrid] = MB_YES;
-					    }
-					}
-
-				      ii = i2;
-				      for (jj=j1;jj<=j2 && num[kgrid] == MB_NO;jj++)
-				        {
-					if (grid[ii*gydim+jj] < clipvalue)
-					    {
-					    r = sqrt((double)((ii-i)*(ii-i) + (jj-j)*(jj-j)));
-					    iii = rint((ii - i)/r) + 1;
-					    jjj = rint((jj - j)/r) + 1;
-					    kkk = iii * 3 + jjj;
-					    dmask[kkk] = MB_YES;
-					    if ((dmask[0] && dmask[8])
-						|| (dmask[3] && dmask[5])
-						|| (dmask[6] && dmask[2])
-						|| (dmask[1] && dmask[7]))
-						num[kgrid] = MB_YES;
-					    }
-					}
-				      }
-				    }
-				}
-			for (i=0;i<gxdim;i++)
-			    for (j=0;j<gydim;j++)
-				{
-				kgrid = i * gydim + j;
-#ifdef USESURFACE
-				kint = i + (gydim -j - 1) * gxdim;
-#else
-				kint = i + j*gxdim;
-#endif
-				if (num[kgrid] == MB_YES)
-					{
-					grid[kgrid] = sgrid[kint];
-					nbinspline++;
-					}
-				}
-			}
-
-		/* translate the interpolation into the grid array
-		    filling by proximity */
-		else if (clipmode == MBMOSAIC_INTERP_NEAR)
-			{
-			for (i=0;i<gxdim;i++)
-			    for (j=0;j<gydim;j++)
-				{
-				kgrid = i * gydim + j;
-#ifdef USESURFACE
-				kint = i + (gydim -j - 1) * gxdim;
-#else
-				kint = i + j*gxdim;
-#endif
-
-				num[kgrid] = MB_NO;
-				if (grid[kgrid] >= clipvalue
-				    && sgrid[kint] < zflag)
-				    {
-				    /* loop over rings around point, starting close */
-				    for (ir=0; ir <= clip && num[kgrid] == MB_NO; ir++)
-				      {
-				      /* set bounds of search */
-				      i1 = MAX(0, i - ir);
-				      i2 = MIN(gxdim - 1, i + ir);
-				      j1 = MAX(0, j - ir);
-				      j2 = MIN(gydim - 1, j + ir);
-
-				      jj = j1;
-				      for (ii=i1;ii<=i2 && num[kgrid] == MB_NO;ii++)
-				        {
-					if (grid[ii*gydim+jj] < clipvalue)
-					    {
-					    num[kgrid] = MB_YES;
-					    }
-					}
-
-				      jj = j2;
-				      for (ii=i1;ii<=i2 && num[kgrid] == MB_NO;ii++)
-				        {
-					if (grid[ii*gydim+jj] < clipvalue)
-					    {
-					    num[kgrid] = MB_YES;
-					    }
-					}
-
-				      ii = i1;
-				      for (jj=j1;jj<=j2 && num[kgrid] == MB_NO;jj++)
-				        {
-					if (grid[ii*gydim+jj] < clipvalue)
-					    {
-					    num[kgrid] = MB_YES;
-					    }
-					}
-
-				      ii = i2;
-				      for (jj=j1;jj<=j2 && num[kgrid] == MB_NO;jj++)
-				        {
-					if (grid[ii*gydim+jj] < clipvalue)
-					    {
-					    num[kgrid] = MB_YES;
-					    }
-					}
-				      }
-				    }
-				}
-			for (i=0;i<gxdim;i++)
-			    for (j=0;j<gydim;j++)
-				{
-				kgrid = i * gydim + j;
-#ifdef USESURFACE
-				kint = i + (gydim -j - 1) * gxdim;
-#else
-				kint = i + j*gxdim;
-#endif
-				if (num[kgrid] == MB_YES)
-					{
-					grid[kgrid] = sgrid[kint];
-					nbinspline++;
-					}
-				}
-			}
-
-		/* translate the interpolation into the grid array
-		    filling all empty bins */
-		else
-			{
-			for (i=0;i<gxdim;i++)
-			    for (j=0;j<gydim;j++)
-				{
-				kgrid = i * gydim + j;
-#ifdef USESURFACE
-				kint = i + (gydim -j - 1) * gxdim;
-#else
-				kint = i + j*gxdim;
-#endif
-				if (grid[kgrid] >= clipvalue
-				    && sgrid[kint] < zflag)
-					{
-					grid[kgrid] = sgrid[kint];
-					nbinspline++;
-					}
-				}
-			}
-
-		/* deallocate the interpolation arrays */
-		for (i=0;i<gxdim;i++)
-		    for (j=0;j<gydim;j++)
-			{
-			kgrid = i*gydim + j;
-			kint = i + j*gxdim;
-			if (num[kgrid] == MB_YES)
-				{
-				grid[kgrid] = sgrid[kint];
-				nbinspline++;
-				}
-			}
-		mb_freed(verbose,__FILE__,__LINE__,(void **)&sdata,&error);
-		mb_freed(verbose,__FILE__,__LINE__,(void **)&sgrid,&error);
-		mb_freed(verbose,__FILE__,__LINE__,(void **)&work1,&error);
-		mb_freed(verbose,__FILE__,__LINE__,(void **)&work2,&error);
-		mb_freed(verbose,__FILE__,__LINE__,(void **)&work3,&error);
-		}
-
-	/* get min max of data */
-	zclip = clipvalue;
-	zmin = zclip;
-	zmax = zclip;
-	for (i=0;i<gxdim;i++)
-		for (j=0;j<gydim;j++)
-			{
-			kgrid = i*gydim + j;;
-			if (zmin == zclip
-				&& grid[kgrid] < zclip)
-				zmin = grid[kgrid];
-			if (zmax == zclip
-				&& grid[kgrid] < zclip)
-				zmax = grid[kgrid];
-			if (grid[kgrid] < zmin && grid[kgrid] < zclip)
-				zmin = grid[kgrid];
-			if (grid[kgrid] > zmax && grid[kgrid] < zclip)
-				zmax = grid[kgrid];
-			}
-	if (zmin == zclip)
-		zmin = 0.0;
-	if (zmax == zclip)
-		zmax = 0.0;
-
-	/* get min max of data distribution */
-	nmax = 0;
-	for (i=0;i<gxdim;i++)
-		for (j=0;j<gydim;j++)
-			{
-			kgrid = i*gydim + j;;
-			if (cnt[kgrid] > nmax)
-				nmax = cnt[kgrid];
-			}
-
-	/* get min max of standard deviation */
-	smin = 0.0;
-	smax = 0.0;
-	for (i=0;i<gxdim;i++)
-		for (j=0;j<gydim;j++)
-			{
-			kgrid = i*gydim + j;;
-			if (smin == 0.0
-				&& cnt[kgrid] > 1)
-				smin = sigma[kgrid];
-			if (smax == 0.0
-				&& cnt[kgrid] > 1)
-				smax = sigma[kgrid];
-			if (sigma[kgrid] < smin && cnt[kgrid] > 1)
-				smin = sigma[kgrid];
-			if (sigma[kgrid] > smax && cnt[kgrid] > 1)
-				smax = sigma[kgrid];
-			}
-	nbinzero = gxdim*gydim - nbinset - nbinspline;
-	fprintf(outfp,"\nTotal number of bins:            %d\n",gxdim*gydim);
-	fprintf(outfp,"Bins set using data:             %d\n",nbinset);
-	fprintf(outfp,"Bins set using interpolation:    %d\n",nbinspline);
-	fprintf(outfp,"Bins not set:                    %d\n",nbinzero);
-	fprintf(outfp,"Maximum number of data in a bin: %d\n",nmax);
-	fprintf(outfp,"Minimum value: %10.2f   Maximum value: %10.2f\n",
-		zmin,zmax);
-	fprintf(outfp,"Minimum sigma: %10.5f   Maximum sigma: %10.5f\n",
-		smin,smax);
-
-	/* set plot label strings */
-	if (use_projection == MB_YES)
-		{
-		sprintf(xlabel,"Easting (%s)", units);
-		sprintf(ylabel,"Northing (%s)", units);
-		}
-	else
-		{
-		strcpy(xlabel,"Longitude");
-		strcpy(ylabel,"Latitude");
-		}
-	if (datatype == MBMOSAIC_DATA_AMPLITUDE)
-		{
-		strcpy(zlabel,"Amplitude");
-		strcpy(nlabel,"Number of Amplitude Data Points");
-		strcpy(sdlabel,"Amplitude Standard Deviation (m)");
-		strcpy(title,"Amplitude Grid");
-		}
-	else if (datatype == MBMOSAIC_DATA_SIDESCAN)
-		{
-		strcpy(zlabel,"Sidescan");
-		strcpy(nlabel,"Number of Sidescan Data Points");
-		strcpy(sdlabel,"Sidescan Standard Deviation (m)");
-		strcpy(title,"Sidescan Grid");
-		}
-	else if (datatype == MBMOSAIC_DATA_FLAT_GRAZING)
-		{
-		strcpy(zlabel,"Degrees");
-		strcpy(nlabel,"Number of Bottom Data Points");
-		strcpy(sdlabel,"Grazing angle Standard Deviation (m)");
-		strcpy(title,"Flat bottom grazing angle Grid");
-		}
-	else if (datatype == MBMOSAIC_DATA_GRAZING)
-		{
-		strcpy(zlabel,"Degrees");
-		strcpy(nlabel,"Number of Bottom Data Points");
-		strcpy(sdlabel,"Grazing angle Standard Deviation (m)");
-		strcpy(title,"Grazing Angle Grid");
-		}
-	else if (datatype == MBMOSAIC_DATA_SLOPE)
-		{
-		strcpy(zlabel,"Degrees");
-		strcpy(nlabel,"Number of Slope Data Points");
-		strcpy(sdlabel,"Slope Standard Deviation (m)");
-		strcpy(title,"Slope Grid");
-		}
-
-	/* write first output file */
-	if (verbose > 0)
-		fprintf(outfp,"\nOutputting results...\n");
-	for (i=0;i<xdim;i++)
-		for (j=0;j<ydim;j++)
-			{
-			kgrid = (i + offx)*gydim + (j + offy);
-			kout = i*ydim + j;
-			output[kout] = (float) grid[kgrid];
-			if (gridkind != MBMOSAIC_ASCII
-				&& gridkind != MBMOSAIC_ARCASCII
-				&& grid[kgrid] == clipvalue)
-				{
-				output[kout] = outclipvalue;
-				}
-			}
-	if (gridkind == MBMOSAIC_ASCII)
-		{
-		strcpy(ofile,fileroot);
-		strcat(ofile,".asc");
-		status = write_ascii(verbose,ofile,output,xdim,ydim,
-			gbnd[0],gbnd[1],gbnd[2],gbnd[3],
-			dx,dy,&error);
-		}
-	else if (gridkind == MBMOSAIC_ARCASCII)
-		{
-		strcpy(ofile,fileroot);
-		strcat(ofile,".asc");
-		status = write_arcascii(verbose,ofile,output,xdim,ydim,
-			gbnd[0],gbnd[1],gbnd[2],gbnd[3],
-			dx,dy,clipvalue,&error);
-		}
-	else if (gridkind == MBMOSAIC_OLDGRD)
-		{
-		strcpy(ofile,fileroot);
-		strcat(ofile,".grd1");
-		status = write_oldgrd(verbose,ofile,output,xdim,ydim,
-			gbnd[0],gbnd[1],gbnd[2],gbnd[3],dx,dy,&error);
-		}
-	else if (gridkind == MBMOSAIC_CDFGRD)
-		{
-		strcpy(ofile,fileroot);
-		strcat(ofile,".grd");
-		status = mb_write_gmt_grd(verbose,
-                                        ofile,
-                                        output,
-                                        outclipvalue,
-                                        xdim,ydim,
-                                        gbnd[0],gbnd[1],gbnd[2],gbnd[3],
-                                        zmin,zmax,
-                                        dx,dy,
-                                        xlabel,ylabel,zlabel,title,
-                                        projection_id,
-                                        argc,argv,
-                                        &error);
-		}
-	else if (gridkind == MBMOSAIC_GMTGRD)
-		{
-		sprintf(ofile,"%s.grd%s", fileroot, gridkindstring);
-		status = mb_write_gmt_grd(verbose,
-                                        ofile,
-                                        output,
-                                        outclipvalue,
-                                        xdim,ydim,
-                                        gbnd[0],gbnd[1],gbnd[2],gbnd[3],
-                                        zmin,zmax,
-                                        dx,dy,
-                                        xlabel,ylabel,zlabel,title,
-                                        projection_id,
-                                        argc,argv,
-                                        &error);
-		}
-	if (status != MB_SUCCESS)
-		{
-		mb_error(verbose,error,&message);
-		fprintf(stderr,"\nError writing output file: %s\n%s\n",
-			ofile,message);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		mb_memory_clear(verbose, &error);
-		exit(error);
-		}
-
-	/* write second output file */
-	if (more == MB_YES)
-		{
-		for (i=0;i<xdim;i++)
-			for (j=0;j<ydim;j++)
-				{
-				kgrid = (i + offx)*gydim + (j + offy);
-				kout = i*ydim + j;
-				output[kout] = (float) cnt[kgrid];
-				if (output[kout] < 0.0)
-					output[kout] = 0.0;
-				if (gridkind != MBMOSAIC_ASCII
-					&& gridkind != MBMOSAIC_ARCASCII
-					&& cnt[kgrid] <= 0)
-					output[kout] = outclipvalue;
-				}
-		if (gridkind == MBMOSAIC_ASCII)
-			{
-			strcpy(ofile,fileroot);
-			strcat(ofile,"_num.asc");
-			status = write_ascii(verbose,ofile,output,xdim,ydim,
-				gbnd[0],gbnd[1],gbnd[2],gbnd[3],
-				dx,dy,&error);
-			}
-		else if (gridkind == MBMOSAIC_ARCASCII)
-			{
-			strcpy(ofile,fileroot);
-			strcat(ofile,".asc");
-			status = write_arcascii(verbose,ofile,output,xdim,ydim,
-				gbnd[0],gbnd[1],gbnd[2],gbnd[3],
-				dx,dy,clipvalue,&error);
-			}
-		else if (gridkind == MBMOSAIC_OLDGRD)
-			{
-			strcpy(ofile,fileroot);
-			strcat(ofile,"_num.grd1");
-			status = write_oldgrd(verbose,ofile,output,xdim,ydim,
-				gbnd[0],gbnd[1],gbnd[2],gbnd[3],
-				dx,dy,&error);
-			}
-		else if (gridkind == MBMOSAIC_CDFGRD)
-			{
-			strcpy(ofile,fileroot);
-			strcat(ofile,"_num.grd");
-                        status = mb_write_gmt_grd(verbose,
-                                        ofile,
-                                        output,
-                                        outclipvalue,
-                                        xdim,ydim,
-                                        gbnd[0],gbnd[1],gbnd[2],gbnd[3],
-                                        zmin,zmax,
-                                        dx,dy,
-                                        xlabel,ylabel,zlabel,title,
-                                        projection_id,
-                                        argc,argv,
-                                        &error);
-			}
-		else if (gridkind == MBMOSAIC_GMTGRD)
-			{
-			sprintf(ofile,"%s_num.grd%s", fileroot, gridkindstring);
-                        status = mb_write_gmt_grd(verbose,
-                                        ofile,
-                                        output,
-                                        outclipvalue,
-                                        xdim,ydim,
-                                        gbnd[0],gbnd[1],gbnd[2],gbnd[3],
-                                        zmin,zmax,
-                                        dx,dy,
-                                        xlabel,ylabel,zlabel,title,
-                                        projection_id,
-                                        argc,argv,
-                                        &error);
-			}
-		if (status != MB_SUCCESS)
-			{
-			mb_error(verbose,error,&message);
-			fprintf(stderr,"\nError writing output file: %s\n%s\n",
-				ofile,message);
-			fprintf(stderr,"\nProgram <%s> Terminated\n",
-				program_name);
-			mb_memory_clear(verbose, &error);
-			exit(error);
-			}
-
-		/* write third output file */
-		for (i=0;i<xdim;i++)
-			for (j=0;j<ydim;j++)
-				{
-				kgrid = (i + offx)*gydim + (j + offy);
-				kout = i*ydim + j;
-				output[kout] = (float) sigma[kgrid];
-				if (output[kout] < 0.0)
-					output[kout] = 0.0;
-				if (gridkind != MBMOSAIC_ASCII
-					&& gridkind != MBMOSAIC_ARCASCII
-					&& cnt[kgrid] <= 0)
-					output[kout] = outclipvalue;
-				}
-		if (gridkind == MBMOSAIC_ASCII)
-			{
-			strcpy(ofile,fileroot);
-			strcat(ofile,"_sd.asc");
-			status = write_ascii(verbose,ofile,output,xdim,ydim,
-				gbnd[0],gbnd[1],gbnd[2],gbnd[3],
-				dx,dy,&error);
-			}
-		else if (gridkind == MBMOSAIC_ARCASCII)
-			{
-			strcpy(ofile,fileroot);
-			strcat(ofile,".asc");
-			status = write_arcascii(verbose,ofile,output,xdim,ydim,
-				gbnd[0],gbnd[1],gbnd[2],gbnd[3],
-				dx,dy,clipvalue,&error);
-			}
-		else if (gridkind == MBMOSAIC_OLDGRD)
-			{
-			strcpy(ofile,fileroot);
-			strcat(ofile,"_sd.grd1");
-			status = write_oldgrd(verbose,ofile,output,xdim,ydim,
-				gbnd[0],gbnd[1],gbnd[2],gbnd[3],
-				dx,dy,&error);
-			}
-		else if (gridkind == MBMOSAIC_CDFGRD)
-			{
-			strcpy(ofile,fileroot);
-			strcat(ofile,"_sd.grd");
-                        status = mb_write_gmt_grd(verbose,
-                                        ofile,
-                                        output,
-                                        outclipvalue,
-                                        xdim,ydim,
-                                        gbnd[0],gbnd[1],gbnd[2],gbnd[3],
-                                        zmin,zmax,
-                                        dx,dy,
-                                        xlabel,ylabel,zlabel,title,
-                                        projection_id,
-                                        argc,argv,
-                                        &error);
-			}
-		else if (gridkind == MBMOSAIC_GMTGRD)
-			{
-			sprintf(ofile,"%s_sd.grd%s", fileroot, gridkindstring);
-                        status = mb_write_gmt_grd(verbose,
-                                        ofile,
-                                        output,
-                                        outclipvalue,
-                                        xdim,ydim,
-                                        gbnd[0],gbnd[1],gbnd[2],gbnd[3],
-                                        zmin,zmax,
-                                        dx,dy,
-                                        xlabel,ylabel,zlabel,title,
-                                        projection_id,
-                                        argc,argv,
-                                        &error);
-			}
-		if (status != MB_SUCCESS)
-			{
-			mb_error(verbose,error,&message);
-			fprintf(stderr,"\nError writing output file: %s\n%s\n",
-				ofile,message);
-			fprintf(stderr,"\nProgram <%s> Terminated\n",
-				program_name);
-			mb_memory_clear(verbose, &error);
-			exit(error);
-			}
-		}
-
-	/* deallocate arrays */
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&grid,&error);
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&norm,&error);
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&maxpriority,&error);
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&cnt,&error);
-	if (clip != 0)
-	    mb_freed(verbose,__FILE__,__LINE__,(void **)&num,&error);
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&sigma,&error);
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&output,&error);
-	if (priority_source == MBMOSAIC_PRIORITYTABLE_FILE
-		&& n_priority_angle > 0)
-		{
-		mb_freed(verbose,__FILE__,__LINE__,(void **)&priority_angle_angle,&error);
-		mb_freed(verbose,__FILE__,__LINE__,(void **)&priority_angle_priority,&error);
-		}
-
-	/* deallocate projection */
-	if (use_projection == MB_YES)
-		proj_status = mb_proj_free(verbose, &(pjptr), &error);
-
-	/* run mbm_grdplot */
-	if (gridkind == MBMOSAIC_GMTGRD)
-		{
-		/* execute mbm_grdplot */
-		strcpy(ofile,fileroot);
-		strcat(ofile,".grd");
-		if (datatype == MBMOSAIC_DATA_AMPLITUDE)
-			{
-			sprintf(plot_cmd, "mbm_grdplot -I%s%s -G1 -W1/4 -S -D -V -L\"File %s - %s:%s\"",
-				ofile, gridkindstring, ofile, title, zlabel);
-			}
-		else
-			{
-			sprintf(plot_cmd, "mbm_grdplot -I%s%s -G1 -W1/4 -S -D -V -L\"File %s - %s:%s\"",
-				ofile, gridkindstring, ofile, title, zlabel);
-			}
-		if (verbose)
-			{
-			fprintf(stderr, "\nexecuting mbm_grdplot...\n%s\n",
-				plot_cmd);
-			}
-		plot_status = system(plot_cmd);
-		if (plot_status == -1)
-			{
-			fprintf(stderr, "\nError executing mbm_grdplot on output file %s\n", ofile);
-			}
-		}
-	if (more == MB_YES
-		&& gridkind == MBMOSAIC_GMTGRD)
-		{
-		/* execute mbm_grdplot */
-		strcpy(ofile,fileroot);
-		strcat(ofile,"_num.grd");
-		sprintf(plot_cmd, "mbm_grdplot -I%s%s -G1 -W1/2 -V -L\"File %s - %s:%s\"",
-			ofile, gridkindstring, ofile, title, nlabel);
-		if (verbose)
-			{
-			fprintf(stderr, "\nexecuting mbm_grdplot...\n%s\n",
-				plot_cmd);
-			}
-		plot_status = system(plot_cmd);
-		if (plot_status == -1)
-			{
-			fprintf(stderr, "\nError executing mbm_grdplot on output file grd_%s\n", fileroot);
-			}
-
-		/* execute mbm_grdplot */
-		strcpy(ofile,fileroot);
-		strcat(ofile,"_sd.grd");
-		sprintf(plot_cmd, "mbm_grdplot -I%s%s -G1 -W1/2 -V -L\"File %s - %s:%s\"",
-			ofile, gridkindstring, ofile, title, sdlabel);
-		if (verbose)
-			{
-			fprintf(stderr, "\nexecuting mbm_grdplot...\n%s\n",
-				plot_cmd);
-			}
-		plot_status = system(plot_cmd);
-		if (plot_status == -1)
-			{
-			fprintf(stderr, "\nError executing mbm_grdplot on output file grd_%s\n", fileroot);
-			}
-		}
-
-	if (verbose > 0)
-		fprintf(outfp,"\nDone.\n\n");
-
-	/* check memory */
-	if (verbose >= 4)
-		status = mb_memory_list(verbose,&error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  Program <%s> completed\n",
-			program_name);
-		fprintf(stderr,"dbg2  Ending status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* end it all */
-	exit(error);
-}
-/*--------------------------------------------------------------------*/
-/*
- * function write_ascii writes output grid to an ascii file
- */
-int write_ascii(int verbose, char *outfile, float *grid,
-		int nx, int ny,
-		double xmin, double xmax, double ymin, double ymax,
-		double dx, double dy, int *error)
-{
-	char	*function_name = "write_ascii";
-	int	status = MB_SUCCESS;
-	FILE	*fp;
-	int	i;
-	time_t	right_now;
-	char	date[32], user[MB_PATH_MAXLINE], *user_ptr, host[MB_PATH_MAXLINE];
-	char	*ctime();
-	char	*getenv();
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  Function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       outfile:    %s\n",outfile);
-		fprintf(stderr,"dbg2       grid:       %p\n",(void *)grid);
-		fprintf(stderr,"dbg2       nx:         %d\n",nx);
-		fprintf(stderr,"dbg2       ny:         %d\n",ny);
-		fprintf(stderr,"dbg2       xmin:       %f\n",xmin);
-		fprintf(stderr,"dbg2       xmax:       %f\n",xmax);
-		fprintf(stderr,"dbg2       ymin:       %f\n",ymin);
-		fprintf(stderr,"dbg2       ymax:       %f\n",ymax);
-		fprintf(stderr,"dbg2       dx:         %f\n",dx);
-		fprintf(stderr,"dbg2       dy:         %f\n",dy);
-		}
-
-	/* open the file */
-	if ((fp = fopen(outfile,"w")) == NULL)
-		{
-		*error = MB_ERROR_OPEN_FAIL;
-		status = MB_FAILURE;
-		}
-
-	/* output grid */
-	if (status == MB_SUCCESS)
-		{
-		fprintf(fp,"grid created by program mbmosaic\n");
-		right_now = time((time_t *)0);
-		strcpy(date,ctime(&right_now));
-                date[strlen(date)-1] = '\0';
-		if ((user_ptr = getenv("USER")) == NULL)
-			user_ptr = getenv("LOGNAME");
-		if (user_ptr != NULL)
-			strcpy(user,user_ptr);
-		else
-			strcpy(user, "unknown");
-		i = gethostname(host,MB_PATH_MAXLINE);
-		fprintf(fp,"program run by %s on %s at %s\n",user,host,date);
-		fprintf(fp,"%d %d\n%f %f %f %f\n",nx,ny,xmin,xmax,ymin,ymax);
-		for (i=0;i<nx*ny;i++)
-			{
-			fprintf(fp,"%13.5g ",grid[i]);
-			if ((i+1) % 6 == 0) fprintf(fp,"\n");
-			}
-		if ((nx*ny) % 6 != 0) fprintf(fp,"\n");
-		fclose(fp);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-/*
- * function write_arcascii writes output grid to an Arc/Info ascii file
- */
-int write_arcascii(int verbose, char *outfile, float *grid,
-		int nx, int ny,
-		double xmin, double xmax, double ymin, double ymax,
-		double dx, double dy, double nodata, int *error)
-{
-	char	*function_name = "write_ascii";
-	int	status = MB_SUCCESS;
-	FILE	*fp;
-	int	i, j, k;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  Function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       outfile:    %s\n",outfile);
-		fprintf(stderr,"dbg2       grid:       %p\n",(void *)grid);
-		fprintf(stderr,"dbg2       nx:         %d\n",nx);
-		fprintf(stderr,"dbg2       ny:         %d\n",ny);
-		fprintf(stderr,"dbg2       xmin:       %f\n",xmin);
-		fprintf(stderr,"dbg2       xmax:       %f\n",xmax);
-		fprintf(stderr,"dbg2       ymin:       %f\n",ymin);
-		fprintf(stderr,"dbg2       ymax:       %f\n",ymax);
-		fprintf(stderr,"dbg2       dx:         %f\n",dx);
-		fprintf(stderr,"dbg2       dy:         %f\n",dy);
-		fprintf(stderr,"dbg2       nodata:     %f\n",nodata);
-		}
-
-	/* open the file */
-	if ((fp = fopen(outfile,"w")) == NULL)
-		{
-		*error = MB_ERROR_OPEN_FAIL;
-		status = MB_FAILURE;
-		}
-
-	/* output grid */
-	if (status == MB_SUCCESS)
-		{
-		fprintf(fp, "ncols %d\n", nx);
-		fprintf(fp, "nrows %d\n", ny);
-		fprintf(fp, "xllcorner %.10g\n", xmin);
-		fprintf(fp, "yllcorner %.10g\n", ymin);
-		fprintf(fp, "cellsize %.10g\n", dx);
-		fprintf(fp, "nodata_value -99999\n");
-		for (j=0;j<ny;j++)
-		    {
-		    for (i=0;i<nx;i++)
-			{
-			k = i * ny + (ny - 1 - j);
-			if (grid[k] == nodata)
-			    fprintf(fp, "-99999 ");
-			else
-			    fprintf(fp,"%f ",grid[k]);
-			}
-		    fprintf(fp, "\n");
-		    }
-		fclose(fp);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-/*
- * function write_oldgrd writes output grid to a
- * GMT version 1 binary grd file
- */
-int write_oldgrd(int verbose, char *outfile, float *grid,
-		int nx, int ny,
-		double xmin, double xmax, double ymin, double ymax,
-		double dx, double dy, int *error)
-{
-	char	*function_name = "write_oldgrd";
-	int	status = MB_SUCCESS;
-	FILE	*fp;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  Function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       outfile:    %s\n",outfile);
-		fprintf(stderr,"dbg2       grid:       %p\n",(void *)grid);
-		fprintf(stderr,"dbg2       nx:         %d\n",nx);
-		fprintf(stderr,"dbg2       ny:         %d\n",ny);
-		fprintf(stderr,"dbg2       xmin:       %f\n",xmin);
-		fprintf(stderr,"dbg2       xmax:       %f\n",xmax);
-		fprintf(stderr,"dbg2       ymin:       %f\n",ymin);
-		fprintf(stderr,"dbg2       ymax:       %f\n",ymax);
-		fprintf(stderr,"dbg2       dx:         %f\n",dx);
-		fprintf(stderr,"dbg2       dy:         %f\n",dy);
-		}
-
-	/* open the file */
-	if ((fp = fopen(outfile,"w")) == NULL)
-		{
-		*error = MB_ERROR_OPEN_FAIL;
-		status = MB_FAILURE;
-		}
-
-	/* output grid */
-	if (status == MB_SUCCESS)
-		{
-		fwrite ((char *)&nx, 1, 4, fp);
-		fwrite ((char *)&ny, 1, 4, fp);
-		fwrite ((char *)&xmin, 1, 8, fp);
-		fwrite ((char *)&xmax, 1, 8, fp);
-		fwrite ((char *)&ymin, 1, 8, fp);
-		fwrite ((char *)&ymax, 1, 8, fp);
-		fwrite ((char *)&dx, 1, 8, fp);
-		fwrite ((char *)&dy, 1, 8, fp);
-		fwrite ((char *)grid, nx*ny, 4, fp);
-		fclose(fp);
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:      %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int double_compare(double *a, double *b)
-{
-	if (*a > *b)
-		return(1);
-	else
-		return(-1);
-}
-/*--------------------------------------------------------------------*/
-int mbmosaic_get_footprint(
-		int	verbose,
-		int	mode,
-		double	beamwidth_xtrack,
-		double	beamwidth_ltrack,
-		double	altitude,
-		double	acrosstrack,
-		double	alongtrack,
-		double	acrosstrack_spacing,
-		struct footprint *footprint,
-		int	*error)
-{
-	char	*function_name = "mbmosaic_get_footprint";
-	int	status = MB_SUCCESS;
-	double	r;
-	double	theta, phi, thetap, phip;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBmosaic function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:             %d\n",verbose);
-		fprintf(stderr,"dbg2       mode:                %d\n",mode);
-		fprintf(stderr,"dbg2       beamwidth_xtrack:    %f\n",beamwidth_xtrack);
-		fprintf(stderr,"dbg2       beamwidth_ltrack:    %f\n",beamwidth_ltrack);
-		fprintf(stderr,"dbg2       altitude:            %f\n",altitude);
-		fprintf(stderr,"dbg2       acrosstrack:         %f\n",acrosstrack);
-		fprintf(stderr,"dbg2       alongtrack:          %f\n",alongtrack);
-		fprintf(stderr,"dbg2       acrosstrack_spacing: %f\n",acrosstrack_spacing);
-		}
-
-	/* calculate footprint location in sonar coordinates */
-	r = sqrt(altitude * altitude + acrosstrack * acrosstrack + alongtrack * alongtrack);
-	mb_xyz_to_takeoff(verbose, acrosstrack, alongtrack, altitude, &theta, &phi, error);
-
-	phip = phi - 0.5 * beamwidth_ltrack;
-	thetap = theta - 0.5 * beamwidth_xtrack;
-	if (mode == MBMOSAIC_FOOTPRINT_REAL)
-		footprint->x[0] = r * sin(DTR * thetap) * cos(DTR * phip);
-	else
-		footprint->x[0] = acrosstrack - 0.5 * acrosstrack_spacing;
-	footprint->y[0] = r * sin(DTR * thetap) * sin(DTR * phip);
-
-	phip = phi - 0.5 * beamwidth_ltrack;
-	thetap = theta + 0.5 * beamwidth_xtrack;
-	if (mode == MBMOSAIC_FOOTPRINT_REAL)
-		footprint->x[1] = r * sin(DTR * thetap) * cos(DTR * phip);
-	else
-		footprint->x[1] = acrosstrack + 0.5 * acrosstrack_spacing;
-	footprint->y[1] = r * sin(DTR * thetap) * sin(DTR * phip);
-
-	phip = phi + 0.5 * beamwidth_ltrack;
-	thetap = theta + 0.5 * beamwidth_xtrack;
-	if (mode == MBMOSAIC_FOOTPRINT_REAL)
-		footprint->x[2] = r * sin(DTR * thetap) * cos(DTR * phip);
-	else
-		footprint->x[2] = acrosstrack + 0.5 * acrosstrack_spacing;
-	footprint->y[2] = r * sin(DTR * thetap) * sin(DTR * phip);
-
-	phip = phi + 0.5 * beamwidth_ltrack;
-	thetap = theta - 0.5 * beamwidth_xtrack;
-	if (mode == MBMOSAIC_FOOTPRINT_REAL)
-		footprint->x[3] = r * sin(DTR * thetap) * cos(DTR * phip);
-	else
-		footprint->x[3] = acrosstrack - 0.5 * acrosstrack_spacing;
-	footprint->y[3] = r * sin(DTR * thetap) * sin(DTR * phip);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBmosaic function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		for (i=0;i<4;i++)
-			fprintf(stderr,"dbg2       footprint: x[%d]:%f y[%d]:%f\n",i,footprint->x[i],i,footprint->y[i]);
-		fprintf(stderr,"dbg2       error:           %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:          %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbmosaic_get_beamangles(
-		int     verbose,
-                double  sonardepth,
-                int     beams_bath,
-                char    *beamflag,
-                double  *bath,
-                double  *bathacrosstrack,
-                double  *bathalongtrack,
-                double  *gangles,
-                int     *error)
-{
-	char	*function_name = "mbmosaic_get_beamangles";
-	int	status = MB_SUCCESS;
- 	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBmosaic function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:         %d\n",verbose);
-		fprintf(stderr,"dbg2       sonardepth:      %f\n",sonardepth);
-		fprintf(stderr,"dbg2       beams_bath:      %d\n",beams_bath);
-		fprintf(stderr,"dbg2       bathymetry:\n");
-		for (i=0;i<beams_bath;i++)
-			fprintf(stderr,"dbg2         beam:%d  flag:%d  bath:%f %f %f\n",
-				i, beamflag[i], bath[i], bathacrosstrack[i], bathalongtrack[i]);
-		}
-
-        /* loop over all beams, calculate grazing angles for valid beams */
-        for (i=0;i<beams_bath;i++)
-                {
-                if (mb_beam_ok(beamflag[i]))
-                        {
-                        gangles[i] = RTD * atan(bathacrosstrack[i] / (bath[i] - sonardepth));
-                        }
-                }
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBmosaic function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       beams_bath:      %d\n",beams_bath);
-		fprintf(stderr,"dbg2       bathymetry:\n");
-		for (i=0;i<beams_bath;i++)
-			fprintf(stderr,"dbg2         beam:%d  flag:%d  bath:%f %f %f  angle:%f\n",
-				i, beamflag[i], bath[i], bathacrosstrack[i], bathalongtrack[i], gangles[i]);
-		fprintf(stderr,"dbg2       error:           %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:          %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbmosaic_get_beampriorities(
-                int     verbose,
-                int     priority_mode,
-                int     n_priority_angle,
-                double  *priority_angle_angle,
-                double  *priority_angle_priority,
-                double  priority_azimuth,
-                double  priority_azimuth_factor,
-                double  priority_heading,
-                double  priority_heading_factor,
-                double  heading,
-                int     beams_bath,
-                char    *beamflag,
-                double  *gangles,
-                double  *priorities,
-                int     *error)
-{
-	char	*function_name = "mbmosaic_get_beampriorities";
-	int	status = MB_SUCCESS;
-        double  azi_starboard, azi_port, weight_starboard, weight_port;
-        double  heading_difference, weight_heading;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBmosaic function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:                   %d\n",verbose);
-		fprintf(stderr,"dbg2       priority_mode:             %d\n",priority_mode);
-		fprintf(stderr,"dbg2       n_priority_angle:          %d\n",n_priority_angle);
-		fprintf(stderr,"dbg2       priority angle table:\n");
-		for (i=0;i<n_priority_angle;i++)
-			fprintf(stderr,"dbg2         %d  angle:%f  priority:%f\n",
-				i, priority_angle_angle[i], priority_angle_priority[i]);
-		fprintf(stderr,"dbg2       priority_azimuth:          %f\n",priority_azimuth);
-		fprintf(stderr,"dbg2       priority_azimuth_factor:   %f\n",priority_azimuth_factor);
-		fprintf(stderr,"dbg2       heading:         %f\n",heading);
-		fprintf(stderr,"dbg2       beams_bath:      %d\n",beams_bath);
-		fprintf(stderr,"dbg2       bathymetry grazing angles:\n");
-		for (i=0;i<beams_bath;i++)
-			fprintf(stderr,"dbg2         beam:%d  flag:%d angle:%f\n",
-				i, beamflag[i], gangles[i]);
-		}
-
-	/* initialize priority array */
-	for (i=0;i<beams_bath;i++)
-            {
-            if (mb_beam_ok(beamflag[i]))
-                {
-                priorities[i] = 1.0;
-                }
-            else
-                {
-                priorities[i] = 0.0;
-                }
-            }
-
-	/* get grazing angle priorities */
-	if (priority_mode & MBMOSAIC_PRIORITY_ANGLE)
-            {
-            /* loop over data getting angle based priorities */
-            for (i=0;i<beams_bath;i++)
-                {
-                if (mb_beam_ok(beamflag[i]))
-                    {
-                    /* priority zero if outside the range of the priority-angle table */
-                    if (gangles[i] < priority_angle_angle[0]
-                        || gangles[i] > priority_angle_angle[n_priority_angle-1])
-                        {
-                        priorities[i] = 0.0;
-                        }
-
-                    /* priority set using the priority-angle table */
-                    else
-                        {
-                        for (j=0;j<n_priority_angle-1;j++)
-                            {
-                            if (gangles[i] >= priority_angle_angle[j]
-                                && gangles[i] < priority_angle_angle[j+1])
-                                {
-                                priorities[i] *= (priority_angle_priority[j]
-                                                + (priority_angle_priority[j+1] - priority_angle_priority[j])
-                                                    * (gangles[i] - priority_angle_angle[j])
-                                                    / (priority_angle_angle[j+1] - priority_angle_angle[j]));
-                                }
-                            }
-                        }
-                    }
-                }
-            }
-
-	/* get look azimuth priorities */
-	if (priority_mode & MBMOSAIC_PRIORITY_AZIMUTH)
-            {
-            /* get priorities for starboard and port sides of ping */
-            azi_starboard = heading - 90.0 - priority_azimuth;
-            if (azi_starboard > 180.0)
-                azi_starboard -= 360.0 * ((int) ((azi_starboard + 180.0) / 360.0));
-            else if (azi_starboard < -180.0)
-                azi_starboard += 360.0 * ((int) ((-azi_starboard + 180.0) / 360.0));
-            if (priority_azimuth_factor * azi_starboard <= -90.0
-                || priority_azimuth_factor * azi_starboard >= 90.0)
-                weight_starboard = 0.0;
-            else
-                weight_starboard = MAX(cos(DTR * priority_azimuth_factor * azi_starboard), 0.0);
-            azi_port = heading + 90.0 - priority_azimuth;
-            if (azi_port > 180.0)
-                azi_port -= 360.0 * ((int) ((azi_port + 180.0) / 360.0));
-            else if (azi_port < -180.0)
-                azi_port += 360.0 * ((int) ((-azi_port + 180.0) / 360.0));
-            if (priority_azimuth_factor * azi_port <= -90.0
-                || priority_azimuth_factor * azi_port >= 90.0)
-                weight_port = 0.0;
-            else
-                weight_port = MAX(cos(DTR * priority_azimuth_factor * azi_port), 0.0);
-
-            /* apply the look azimuth priorities */
-            for (i=0;i<beams_bath;i++)
-                {
-                if (mb_beam_ok(beamflag[i]))
-                    {
-                    if (gangles[i] < 0.0)
-                        priorities[i] *= weight_starboard;
-                    else
-                        priorities[i] *= weight_port;
-                    }
-                }
-             }
-
-	/* get heading priorities */
-	if (priority_mode & MBMOSAIC_PRIORITY_HEADING)
-            {
-            /* get priorities for ping */
-            heading_difference = heading - priority_heading;
-            if (heading_difference > 180.0)
-                heading_difference -= 360.0;
-            else if (heading_difference < -180.0)
-                heading_difference += 360.0;
-            if (priority_heading_factor * heading_difference <= -90.0
-                || priority_heading_factor * heading_difference >= 90.0)
-                weight_heading = 0.0;
-            else
-                weight_heading = MAX(cos(DTR * priority_heading_factor * heading_difference), 0.0);
-
-            /* apply the heading priorities */
-            for (i=0;i<beams_bath;i++)
-                {
-                if (mb_beam_ok(beamflag[i]))
-                    {
-                    priorities[i] *= weight_heading;
-                    }
-                }
-             }
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBmosaic function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       beams_bath:      %d\n",beams_bath);
-		fprintf(stderr,"dbg2       bathymetry grazing angles and priorities:\n");
-		for (i=0;i<beams_bath;i++)
-			fprintf(stderr,"dbg2         beam:%d  flag:%d angle:%f  priority:%f\n",
-				i, beamflag[i], gangles[i], priorities[i]);
-		fprintf(stderr,"dbg2       error:           %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:          %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbmosaic_get_beamslopes(
-                int verbose,
-                int     beams_bath,
-                char    *beamflag,
-                double  *bath,
-                double  *bathacrosstrack,
-                double  *slopes,
-                int     *error)
-{
-	char	*function_name = "mbmosaic_get_beamslopes";
-	int	status = MB_SUCCESS;
-        int     found_pre, found_post;
-        int     i0, i1;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBmosaic function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:         %d\n",verbose);
-		fprintf(stderr,"dbg2       beams_bath:      %d\n",beams_bath);
-		fprintf(stderr,"dbg2       bathymetry:\n");
-		for (i=0;i<beams_bath;i++)
-			fprintf(stderr,"dbg2         beam:%d  flag:%d  bath:%f %f\n",
-				i, beamflag[i], bath[i], bathacrosstrack[i]);
-		}
-
-	/* get grazing angle priorities */
-	/* loop over data getting angle based priorities */
-        for (i=0;i<beams_bath;i++)
-            {
-            if (mb_beam_ok(beamflag[i]))
-                {
-                /* find previous good beam */
-                found_pre = MB_NO;
-                if (i > 0)
-                    {
-                    for (j=i-1; j>=0 && found_pre == MB_NO; j--)
-                        {
-                        if (mb_beam_ok(beamflag[j]))
-                            {
-                            found_pre = MB_YES;
-                            i0 = j;
-                            }
-                        }
-                    }
-
-               /* find post good beam */
-                found_post = MB_NO;
-                if (i < beams_bath-1)
-                    {
-                    for (j=i+1; j<beams_bath && found_post == MB_NO; j++)
-                        {
-                        if (mb_beam_ok(beamflag[j]))
-                            {
-                            found_post = MB_YES;
-                            i1 = j;
-                            }
-                        }
-                    }
-
-                /* calculate slope */
-                if (found_pre == MB_YES && found_post == MB_YES)
-                    {
-                    if (bathacrosstrack[i1] != bathacrosstrack[i0])
-                        slopes[i] = -(bath[i1] - bath[i0]) / (bathacrosstrack[i1] - bathacrosstrack[i0]);
-                    else
-                        slopes[i] = 0.0;
-                    }
-               else if (found_pre == MB_YES)
-                    {
-                    if (bathacrosstrack[i] != bathacrosstrack[i0])
-                        slopes[i] = -(bath[i] - bath[i0]) / (bathacrosstrack[i] - bathacrosstrack[i0]);
-                    else
-                        slopes[i] = 0.0;
-                    }
-              else if (found_post == MB_YES)
-                    {
-                    if (bathacrosstrack[i1] != bathacrosstrack[i])
-                        slopes[i] = -(bath[i1] - bath[i]) / (bathacrosstrack[i1] - bathacrosstrack[i]);
-                    else
-                        slopes[i] = 0.0;
-                    }
-              else
-                    {
-                    slopes[i] = 0.0;
-                    }
-                }
-            }
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBmosaic function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       beams_bath:      %d\n",beams_bath);
-		fprintf(stderr,"dbg2       bathymetry:\n");
-		for (i=0;i<beams_bath;i++)
-			fprintf(stderr,"dbg2         beam:%d  flag:%d  bath:%f %f  slope:%f\n",
-				i, beamflag[i], bath[i], bathacrosstrack[i], slopes[i]);
-		fprintf(stderr,"dbg2       error:           %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:          %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbmosaic_bath_getangletable(
-                int     verbose,
-                double  sonardepth,
-                int     beams_bath,
-                char    *beamflag,
-                double  *bath,
-                double  *bathacrosstrack,
-                double  *bathalongtrack,
-                double  angle_min,
-                double  angle_max,
-                int     nangle,
-                double  *table_angle,
-                double  *table_xtrack,
-                double  *table_ltrack,
-		double  *table_altitude,
-                double  *table_range,
-                int     *error)
-{
-	char	*function_name = "mbmosaic_bath_getangletable";
-	int	status = MB_SUCCESS;
-        double  dangle, angle0, angle1, factor;
-        int     found, foundnext;
-	int	i, j, jj, jstart, jnext;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBmosaic function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:         %d\n",verbose);
-		fprintf(stderr,"dbg2       sonardepth:      %f\n",sonardepth);
-		fprintf(stderr,"dbg2       beams_bath:      %d\n",beams_bath);
-		fprintf(stderr,"dbg2       bathymetry:\n");
-		for (i=0;i<beams_bath;i++)
-			fprintf(stderr,"dbg2         beam:%d  flag:%d  bath:%f %f\n",
-				i, beamflag[i], bath[i], bathacrosstrack[i]);
-		fprintf(stderr,"dbg2       angle_min:       %f\n",angle_min);
-		fprintf(stderr,"dbg2       angle_max:       %f\n",angle_max);
-		fprintf(stderr,"dbg2       nangle:          %d\n",nangle);
-		}
-
-        /* loop over the angles and figure out the other table values from the bathymetry */
-	dangle = (angle_max - angle_min) / (nangle - 1);
-        jstart = 0;
-        *error = MB_ERROR_NO_ERROR;
-	for (i=0;i<nangle;i++)
-            {
-            /* get angles in takeoff coordinates */
-            table_angle[i] = angle_min + dangle * i;
-            table_xtrack[i] = 0.0;
-            table_ltrack[i] = 0.0;
-            table_range[i] = 0.0;
-
-            /* estimate the table values for this angle from the bathymetry */
-            found = MB_NO;
-            for (j=jstart;j<beams_bath-1 && found == MB_NO; j++)
-                {
-                /* check if this beam is valid */
-                if (mb_beam_ok(beamflag[j]))
-                    {
-                   /* look for the next valid beam */
-                    foundnext = MB_NO;
-                    jnext = j;
-                    for (jj=j+1;jj<beams_bath && foundnext == MB_NO;jj++)
-                        {
-                        if (mb_beam_ok(beamflag[jj]))
-                            {
-                            jnext = jj;
-                            foundnext = MB_YES;
-                            }
-                        }
-
-                    /* get the angle for beam j */
-                    angle0 = RTD * atan(bathacrosstrack[j] / (bath[j] - sonardepth));
-                    if (foundnext == MB_YES)
-                        angle1 = RTD * atan(bathacrosstrack[jnext] / (bath[jnext] - sonardepth));
-
-                    /* deal with angle to port of swath edge */
-/* fprintf(stderr,"i:%d angle:%f angle0:%f j:%d jnext:%d foundnext:%d ",
-i,table_angle[i],angle0,j,jnext,foundnext);
-if (foundnext == MB_YES)
-fprintf(stderr," angle1:%f ",angle1); */
-                    if (table_angle[i] <= angle0)
-                        {
-                        table_altitude[i] = bath[j] - sonardepth;
-                        table_xtrack[i] = table_altitude[i] * tan(DTR * table_angle[i]);
-                        table_ltrack[i] = bathalongtrack[j];
-                        table_range[i] = sqrt(table_altitude[i] * table_altitude[i]
-                                        + table_xtrack[i] * table_xtrack[i]
-                                        + table_ltrack[i] * table_ltrack[i]);
-                        found = MB_YES;
-                        jstart = j;
-/* fprintf(stderr," A table: %f %f %f %f %f\n",
-table_angle[i],table_altitude[i],table_xtrack[i],table_ltrack[i],table_range[i]); */
-                        }
-
-                    /* deal with angle to starboard of swath edge */
-                    else if (foundnext == MB_NO)
-                        {
-                        table_altitude[i] = bath[j] - sonardepth;
-                        table_xtrack[i] = table_altitude[i] * tan(DTR * table_angle[i]);
-                        table_ltrack[i] = bathalongtrack[j];
-                        table_range[i] = sqrt(table_altitude[i] * table_altitude[i]
-                                        + table_xtrack[i] * table_xtrack[i]
-                                        + table_ltrack[i] * table_ltrack[i]);
-                        found = MB_YES;
-                        jstart = j;
-/* fprintf(stderr," B table: %f %f %f %f %f\n",
-table_angle[i],table_altitude[i],table_xtrack[i],table_ltrack[i],table_range[i]);*/
-                        }
-
-                    /* deal with angle to starboard of swath edge */
-                    else if (foundnext == MB_YES && table_angle[i] > angle1)
-                        {
-                        if (jnext == beams_bath - 1)
-                            {
-                            table_altitude[i] = bath[j] - sonardepth;
-                            table_xtrack[i] = table_altitude[i] * tan(DTR * table_angle[i]);
-                            table_ltrack[i] = bathalongtrack[j];
-                            table_range[i] = sqrt(table_altitude[i] * table_altitude[i]
-                                            + table_xtrack[i] * table_xtrack[i]
-                                            + table_ltrack[i] * table_ltrack[i]);
-                            found = MB_YES;
-                            }
-                        jstart = j;
-/* fprintf(stderr," B table: %f %f %f %f %f\n",
-table_angle[i],table_altitude[i],table_xtrack[i],table_ltrack[i],table_range[i]);*/
-                        }
-
-                    /* deal with angle between the two valid beams */
-                    else if (foundnext == MB_YES && table_angle[i] >= angle0 && table_angle[i] <= angle1)
-                        {
-                        factor = (table_angle[i] - angle0) / (angle1 - angle0);
-                        table_altitude[i] = (bath[j] - sonardepth) + factor * (bath[jnext] - bath[j]);
-                        table_xtrack[i] = table_altitude[i] * tan(DTR * table_angle[i]);
-                        table_ltrack[i] = bathalongtrack[j] + factor * (bathalongtrack[jnext] - bathalongtrack[j]);
-                        table_range[i] = sqrt(table_altitude[i] * table_altitude[i]
-                                        + table_xtrack[i] * table_xtrack[i]
-                                        + table_ltrack[i] * table_ltrack[i]);
-                        found = MB_YES;
-                        jstart = j;
-/* fprintf(stderr," C factor:%f x:%f %f %f table: %f %f %f %f %f\n",
-factor,bathacrosstrack[j],table_xtrack[i],bathacrosstrack[jnext],
-table_angle[i],table_altitude[i],table_xtrack[i],table_ltrack[i],table_range[i]);*/
-                        }
-
-                    /* else skip */
-/* else
-fprintf(stderr," SKIP\n");*/
-                    }
-                }
-
-            /* set error if necessary */
-            if (found == MB_NO)
-                {
-                status = MB_FAILURE;
-                *error = MB_ERROR_NOT_ENOUGH_DATA;
-                }
-            }
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBmosaic function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       nangle:          %d\n",nangle);
-		fprintf(stderr,"dbg2       tables:\n");
-		for (i=0;i<nangle;i++)
-			fprintf(stderr,"dbg2         %d angle:%f  xtrack:%f ltrack:%f altitude:%f range:%f\n",
-				i, table_angle[i], table_xtrack[i], table_ltrack[i], table_altitude[i], table_range[i]);
-		fprintf(stderr,"dbg2       error:           %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:          %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbmosaic_flatbottom_getangletable(
-                int     verbose,
-                double  altitude,
-                double  angle_min,
-                double  angle_max,
-                int     nangle,
-                double  *table_angle,
-                double  *table_xtrack,
-                double  *table_ltrack,
-		double  *table_altitude,
-                double  *table_range,
-                int     *error)
-{
-	char	*function_name = "mbmosaic_flatbottom_getangletable";
-	int	status = MB_SUCCESS;
-        double  dangle;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBmosaic function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:         %d\n",verbose);
-		fprintf(stderr,"dbg2       altitude:        %f\n",altitude);
-		fprintf(stderr,"dbg2       angle_min:       %f\n",angle_min);
-		fprintf(stderr,"dbg2       angle_max:       %f\n",angle_max);
-		fprintf(stderr,"dbg2       nangle:          %d\n",nangle);
-		}
-
-        /* loop over the angles and figure out the other table values from the bathymetry */
-	dangle = (angle_max - angle_min) / (nangle - 1);
-        *error = MB_ERROR_NO_ERROR;
-	for (i=0;i<nangle;i++)
-            {
-            /* get angles in takeoff coordinates */
-            table_angle[i] = angle_min + dangle * i;
-            table_xtrack[i] = altitude * tan(DTR * table_angle[i]);
-            table_ltrack[i] = 0.0;
-            table_range[i] = sqrt(altitude * altitude + table_xtrack[i] * table_xtrack[i]);
-            }
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBmosaic function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       nangle:          %d\n",nangle);
-		fprintf(stderr,"dbg2       tables:\n");
-		for (i=0;i<nangle;i++)
-			fprintf(stderr,"dbg2         %d angle:%f  xtrack:%f ltrack:%f altitude:%f range:%f\n",
-				i, table_angle[i], table_xtrack[i], table_ltrack[i], table_altitude[i], table_range[i]);
-		fprintf(stderr,"dbg2       error:           %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:          %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbmosaic_get_ssangles(
-                int     verbose,
-                int     nangle,
-                double  *table_angle,
-                double  *table_xtrack,
-                double  *table_ltrack,
-                double  *table_altitude,
-                double  *table_range,
-                int  pixels_ss,
-                double  *ss,
-                double  *ssacrosstrack,
-                double  *gangles,
-                int  *error)
-{
-	char	*function_name = "mbmosaic_get_ssangles";
-	int	status = MB_SUCCESS;
-        int     found;
-	int	i, j, jstart;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBmosaic function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:                   %d\n",verbose);
-		fprintf(stderr,"dbg2       nangle:          %d\n",nangle);
-		fprintf(stderr,"dbg2       tables:\n");
-		for (i=0;i<nangle;i++)
-			fprintf(stderr,"dbg2         %d angle:%f  xtrack:%f ltrack:%f altitude:%f range:%f\n",
-				i, table_angle[i], table_xtrack[i], table_ltrack[i], table_altitude[i], table_range[i]);
-		fprintf(stderr,"dbg2       pixels_ss:       %d\n",pixels_ss);
-		fprintf(stderr,"dbg2       sidescan:\n");
-		for (i=0;i<pixels_ss;i++)
-			fprintf(stderr,"dbg2         pixel:%d  ss:%f %f\n",
-				i, ss[i], ssacrosstrack[i]);
-		}
-
-        /* loop over the sidescan interpolating angles from the table on the basis of ssacrosstrack */
-        jstart = 0;
-        for (i=0;i<pixels_ss;i++)
-            {
-            /* get angles only for valid sidescan */
-            if (ss[i] > MB_SIDESCAN_NULL)
-                {
-                found = MB_NO;
-                for (j=jstart;j<nangle-1 && found == MB_NO;j++)
-                    {
-                    if (ssacrosstrack[i] < table_xtrack[j])
-                        {
-                        gangles[i] = table_angle[j];
-                        found = MB_YES;
-                        }
-                    else if (ssacrosstrack[i] >= table_xtrack[j]
-                            && ssacrosstrack[i] <= table_xtrack[j+1])
-                        {
-                        gangles[i] = table_angle[j] + (table_angle[j+1] - table_angle[j])
-                                                        * (ssacrosstrack[i] - table_xtrack[j])
-                                                        / (table_xtrack[j+1] - table_xtrack[j]);
-/*fprintf(stderr,"i:%d j:%d %d angles: %f %f %f  x: %f %f %f\n",
-i,j,j+1,table_angle[j],gangles[i],table_angle[j+1],table_xtrack[j],ssacrosstrack[i],table_xtrack[j+1]);*/
-                        found = MB_YES;
-                        jstart = j;
-                        }
-                    else if (ssacrosstrack[i] >= table_xtrack[j+1]
-                            && j == nangle - 2)
-                        {
-                        gangles[i] = table_angle[j+1];
-                        found = MB_YES;
-                        }
-                    }
-                }
-
-            /* zero angles for invalid sidescan */
-            else
-                {
-                gangles[i] = 0.0;
-                }
-            }
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBmosaic function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       pixels_ss:       %d\n",pixels_ss);
-		fprintf(stderr,"dbg2       sidescan grazing angles:\n");
-		for (i=0;i<pixels_ss;i++)
-			fprintf(stderr,"dbg2         pixel:%d  ss:%f %f angle:%f\n",
-				i, ss[i], ssacrosstrack[i], gangles[i]);
-		fprintf(stderr,"dbg2       error:           %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:          %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int mbmosaic_get_sspriorities(
-                int     verbose,
-                int     priority_mode,
-                int     n_priority_angle,
-                double  *priority_angle_angle,
-                double  *priority_angle_priority,
-                double  priority_azimuth,
-                double  priority_azimuth_factor,
-                double  priority_heading,
-                double  priority_heading_factor,
-                double  heading,
-                int     pixels_ss,
-                double  *ss,
-                double  *gangles,
-                double  *priorities,
-                int     *error)
-{
-	char	*function_name = "mbmosaic_get_sspriorities";
-	int	status = MB_SUCCESS;
-        double  azi_starboard, azi_port, weight_starboard, weight_port;
-        double  heading_difference, weight_heading;
-	int	i, j;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBmosaic function <%s> called\n",function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:                   %d\n",verbose);
-		fprintf(stderr,"dbg2       priority_mode:             %d\n",priority_mode);
-		fprintf(stderr,"dbg2       n_priority_angle:          %d\n",n_priority_angle);
-		fprintf(stderr,"dbg2       priority angle table:\n");
-		for (i=0;i<n_priority_angle;i++)
-			fprintf(stderr,"dbg2         %d  angle:%f  priority:%f\n",
-				i, priority_angle_angle[i], priority_angle_priority[i]);
-		fprintf(stderr,"dbg2       priority_azimuth:          %f\n",priority_azimuth);
-		fprintf(stderr,"dbg2       priority_azimuth_factor:   %f\n",priority_azimuth_factor);
-		fprintf(stderr,"dbg2       heading:         %f\n",heading);
-		fprintf(stderr,"dbg2       pixels_ss:       %d\n",pixels_ss);
-		fprintf(stderr,"dbg2       sidescan grazing angles:\n");
-		for (i=0;i<pixels_ss;i++)
-			fprintf(stderr,"dbg2         pixel:%d  ss:%f angle:%f\n",
-				i, ss[i], gangles[i]);
-		}
-
-	/* initialize priority array */
-	for (i=0;i<pixels_ss;i++)
-            {
-            if (ss[i] > MB_SIDESCAN_NULL)
-                {
-                priorities[i] = 1.0;
-                }
-            else
-                {
-                priorities[i] = 0.0;
-                }
-            }
-
-	/* get grazing angle priorities */
-	if (priority_mode & MBMOSAIC_PRIORITY_ANGLE)
-            {
-            /* loop over data getting angle based priorities */
-            for (i=0;i<pixels_ss;i++)
-                {
-                if (ss[i] > MB_SIDESCAN_NULL)
-                    {
-                    /* priority zero if outside the range of the priority-angle table */
-                    if (gangles[i] < priority_angle_angle[0]
-                        || gangles[i] > priority_angle_angle[n_priority_angle-1])
-                        {
-                        priorities[i] = 0.0;
-                        }
-
-                    /* priority set using the priority-angle table */
-                    else
-                        {
-                        for (j=0;j<n_priority_angle-1;j++)
-                            {
-                            if (gangles[i] >= priority_angle_angle[j]
-                                && gangles[i] < priority_angle_angle[j+1])
-                                {
-                                priorities[i] *= (priority_angle_priority[j]
-                                                + (priority_angle_priority[j+1] - priority_angle_priority[j])
-                                                    * (gangles[i] - priority_angle_angle[j])
-                                                    / (priority_angle_angle[j+1] - priority_angle_angle[j]));
-                                }
-                            }
-                        }
-                    }
-                }
-            }
-
-	/* get look azimuth priorities */
-	if (priority_mode & MBMOSAIC_PRIORITY_AZIMUTH)
-            {
-            /* get priorities for starboard and port sides of ping */
-            azi_starboard = heading - 90.0 - priority_azimuth;
-            if (azi_starboard > 180.0)
-                azi_starboard -= 360.0 * ((int) ((azi_starboard + 180.0) / 360.0));
-            else if (azi_starboard < -180.0)
-                azi_starboard += 360.0 * ((int) ((-azi_starboard + 180.0) / 360.0));
-            if (priority_azimuth_factor * azi_starboard <= -90.0
-                || priority_azimuth_factor * azi_starboard >= 90.0)
-                weight_starboard = 0.0;
-            else
-                weight_starboard = MAX(cos(DTR * priority_azimuth_factor * azi_starboard), 0.0);
-            azi_port = heading + 90.0 - priority_azimuth;
-            if (azi_port > 180.0)
-                azi_port -= 360.0 * ((int) ((azi_port + 180.0) / 360.0));
-            else if (azi_port < -180.0)
-                azi_port += 360.0 * ((int) ((-azi_port + 180.0) / 360.0));
-            if (priority_azimuth_factor * azi_port <= -90.0
-                || priority_azimuth_factor * azi_port >= 90.0)
-                weight_port = 0.0;
-            else
-                weight_port = MAX(cos(DTR * priority_azimuth_factor * azi_port), 0.0);
-
-            /* apply the look azimuth priorities */
-            for (i=0;i<pixels_ss;i++)
-                {
-                if (ss[i] > MB_SIDESCAN_NULL)
-                    {
-                    if (gangles[i] < 0.0)
-                        priorities[i] *= weight_starboard;
-                    else
-                        priorities[i] *= weight_port;
-                    }
-                }
-             }
-
-	/* get heading priorities */
-	if (priority_mode & MBMOSAIC_PRIORITY_HEADING)
-            {
-            /* get priorities for ping */
-            heading_difference = heading - priority_heading;
-            if (heading_difference > 180.0)
-                heading_difference -= 360.0;
-            else if (heading_difference < -180.0)
-                heading_difference += 360.0;
-            if (priority_heading_factor * heading_difference <= -90.0
-                || priority_heading_factor * heading_difference >= 90.0)
-                weight_heading = 0.0;
-            else
-                weight_heading = MAX(cos(DTR * priority_heading_factor * heading_difference), 0.0);
-
-            /* apply the look azimuth priorities */
-            for (i=0;i<pixels_ss;i++)
-                {
-                if (ss[i] > MB_SIDESCAN_NULL)
-                    {
-                    priorities[i] *= weight_heading;
-                    }
-                }
-             }
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBmosaic function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       pixels_ss:       %d\n",pixels_ss);
-		fprintf(stderr,"dbg2       sidescan grazing angles and priorities:\n");
-		for (i=0;i<pixels_ss;i++)
-			fprintf(stderr,"dbg2         pixel:%d  angle:%f  priority:%f\n",
-				i, gangles[i], priorities[i]);
-		fprintf(stderr,"dbg2       error:           %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:          %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/utilities/mbnavlist.c b/src/utilities/mbnavlist.c
deleted file mode 100644
index d3fbed4..0000000
--- a/src/utilities/mbnavlist.c
+++ /dev/null
@@ -1,1095 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbnavlist.c	2/1/93
- *    $Id: mbnavlist.c 2251 2015-07-01 01:02:06Z caress $
- *
- *    Copyright (c) 1993-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbnavlist prints the specified contents of navigation records
- * in a swath sonar data file to stdout. The form of the
- * output is quite flexible; mbnavlist is tailored to produce
- * ascii files in spreadsheet style with data columns separated by tabs.
- *
- * Author:	D. W. Caress
- * Date:	November 11, 1999
- *
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <math.h>
-#include <string.h>
-#include <time.h>
-
-/* MBIO include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_define.h"
-
-/* local options */
-#define	MAX_OPTIONS	25
-
-/* function prototypes */
-int printsimplevalue(int verbose,
-	double value, int width, int precision,
-	int ascii, int *invert, int *flipsign, int *error);
-int printNaN(int verbose, int ascii, int *invert, int *flipsign, int *error);
-
-/* NaN value */
-double	NaN;
-
-static char rcs_id[] = "$Id: mbnavlist.c 2251 2015-07-01 01:02:06Z caress $";
-
-/*--------------------------------------------------------------------*/
-
-int main (int argc, char **argv)
-{
-	char program_name[] = "mbnavlist";
-	char help_message[] =  "mbnavlist prints the specified contents of navigation records\nin a swath sonar data file to stdout. The form of the \noutput is quite flexible; mbnavlist is tailored to produce \nascii files in spreadsheet style with data columns separated by tabs.";
-	char usage_message[] = "mbnavlist [-Byr/mo/da/hr/mn/sc -Ddecimate -Eyr/mo/da/hr/mn/sc \n-Fformat -Gdelimiter -H -Ifile -Kkind -Llonflip \n-Ooptions -Rw/e/s/n -Sspeed \n-Ttimegap -V -Zsegment]";
-	extern char *optarg;
-	int	errflg = 0;
-	int	c;
-	int	help = 0;
-	int	flag = 0;
-
-	/* MBIO status variables */
-	int	status = MB_SUCCESS;
-	int	verbose = 0;
-	int	error = MB_ERROR_NO_ERROR;
-	char	*message;
-
-	/* MBIO read control parameters */
-	int	read_datalist = MB_NO;
-	char	read_file[MB_PATH_MAXLINE];
-	void	*datalist;
-	int	look_processed = MB_DATALIST_LOOK_UNSET;
-	double	file_weight;
-	int	format;
-	int	pings;
-	int	decimate;
-	int	lonflip;
-	double	bounds[4];
-	int	btime_i[7];
-	int	etime_i[7];
-	double	btime_d;
-	double	etime_d;
-	double	speedmin;
-	double	timegap;
-	char	file[MB_PATH_MAXLINE];
-	int	beams_bath;
-	int	beams_amp;
-	int	pixels_ss;
-
-	/* data record source types */
-	int	nav_source;
-	int	heading_source;
-	int	vru_source;
-	int	svp_source;
-	int	aux_nav_channel = -1;
-	int	data_kind = -1;
-
-	/* output format list controls */
-	char	list[MAX_OPTIONS];
-	int	n_list;
-	double	distance_total;
-	int	nread;
-	int	time_j[5];
-	int	invert_next_value = MB_NO;
-	int	signflip_next_value = MB_NO;
-	int	first = MB_YES;
-	int	ascii = MB_YES;
-	int	segment = MB_NO;
-	char	segment_tag[MB_PATH_MAXLINE];
-	char	delimiter[MB_PATH_MAXLINE];
-
-	/* MBIO read values */
-	void	*mbio_ptr = NULL;
-	void	*store_ptr;
-	int	kind;
-	int	time_i[7];
-	double	time_d;
-	double	navlon;
-	double	navlat;
-	double	speed;
-	double	heading;
-	double	distance;
-	double	altitude;
-	double	sonardepth;
-	double	draft;
-	double	roll;
-	double	pitch;
-	double	heave;
-	char	*beamflag = NULL;
-	double	*bath = NULL;
-	double	*bathacrosstrack = NULL;
-	double	*bathalongtrack = NULL;
-	double	*amp = NULL;
-	double	*ss = NULL;
-	double	*ssacrosstrack = NULL;
-	double	*ssalongtrack = NULL;
-	char	comment[MB_COMMENT_MAXLINE];
-	int	atime_i[7 * MB_ASYNCH_SAVE_MAX];
-	double	atime_d[MB_ASYNCH_SAVE_MAX];
-	double	anavlon[MB_ASYNCH_SAVE_MAX];
-	double	anavlat[MB_ASYNCH_SAVE_MAX];
-	double	aspeed[MB_ASYNCH_SAVE_MAX];
-	double	aheading[MB_ASYNCH_SAVE_MAX];
-	double	adraft[MB_ASYNCH_SAVE_MAX];
-	double	aroll[MB_ASYNCH_SAVE_MAX];
-	double	apitch[MB_ASYNCH_SAVE_MAX];
-	double	aheave[MB_ASYNCH_SAVE_MAX];
-
-	/* additional time variables */
-	int	first_m = MB_YES;
-	double	time_d_ref;
-	int	first_u = MB_YES;
-	time_t	time_u;
-	time_t	time_u_ref;
-	double	seconds;
-
-	/* course calculation variables */
-	double	dlon, dlat, minutes;
-	int	degrees;
-	char	hemi;
-	double	headingx, headingy, mtodeglon, mtodeglat;
-	double	course, course_old;
-	double	time_d_old;
-	double	time_interval;
-	double	speed_made_good, speed_made_good_old;
-	double	navlon_old, navlat_old;
-	double	dx, dy;
-	double	b;
-
-	int	read_data;
-	int	inav, n;
-	int	nnav;
-	int	i, j;
-
-	/* get current default values */
-	status = mb_defaults(verbose,&format,&pings,&lonflip,bounds,
-		btime_i,etime_i,&speedmin,&timegap);
-
-	/* set default input to datalist.mb-1 */
-	strcpy (read_file, "datalist.mb-1");
-
-	/* set up the default list controls
-		(lon, lat, along-track distance, center beam depth) */
-	list[0]='t';
-	list[1]='M';
-	list[2]='X';
-	list[3]='Y';
-	list[4]='H';
-	list[5]='s';
-	n_list = 6;
-	sprintf(delimiter, "\t");
-	decimate = 1;
-
-	/* process argument list */
-	while ((c = getopt(argc, argv, "AaB:b:D:d:E:e:F:f:G:g:I:i:K:k:L:l:N:n:O:o:R:r:S:s:T:t:Z:z:VvHh")) != -1)
-	  switch (c)
-		{
-		case 'H':
-		case 'h':
-			help++;
-			break;
-		case 'V':
-		case 'v':
-			verbose++;
-			break;
-		case 'A':
-		case 'a':
-			ascii = MB_NO;
-			flag++;
-			break;
-		case 'B':
-		case 'b':
-			sscanf (optarg,"%d/%d/%d/%d/%d/%d",
-				&btime_i[0],&btime_i[1],&btime_i[2],
-				&btime_i[3],&btime_i[4],&btime_i[5]);
-			btime_i[6] = 0;
-			flag++;
-			break;
-		case 'D':
-		case 'd':
-			sscanf (optarg,"%d", &decimate);
-			flag++;
-			break;
-		case 'E':
-		case 'e':
-			sscanf (optarg,"%d/%d/%d/%d/%d/%d",
-				&etime_i[0],&etime_i[1],&etime_i[2],
-				&etime_i[3],&etime_i[4],&etime_i[5]);
-			etime_i[6] = 0;
-			flag++;
-			break;
-		case 'F':
-		case 'f':
-			sscanf (optarg,"%d", &format);
-			flag++;
-			break;
-		case 'G':
-		case 'g':
-			sscanf (optarg,"%s", delimiter);
-			flag++;
-			break;
-		case 'I':
-		case 'i':
-			sscanf (optarg,"%s", read_file);
-			flag++;
-			break;
-		case 'K':
-		case 'k':
-			sscanf (optarg,"%d", &data_kind);
-			flag++;
-			break;
-		case 'L':
-		case 'l':
-			sscanf (optarg,"%d", &lonflip);
-			flag++;
-			break;
-		case 'N':
-		case 'n':
-			sscanf (optarg,"%d", &aux_nav_channel);
-			flag++;
-			break;
-		case 'O':
-		case 'o':
-			for(j=0,n_list=0;j<(int)strlen(optarg);j++,n_list++)
-				if (n_list<MAX_OPTIONS)
-					list[n_list] = optarg[j];
-			flag++;
-			break;
-		case 'R':
-		case 'r':
-			mb_get_bounds(optarg, bounds);
-			flag++;
-			break;
-		case 'S':
-		case 's':
-			sscanf (optarg,"%lf", &speedmin);
-			flag++;
-			break;
-		case 'T':
-		case 't':
-			sscanf (optarg,"%lf", &timegap);
-			flag++;
-			break;
-		case 'Z':
-		case 'z':
-			segment = MB_YES;
-			sscanf (optarg,"%s", segment_tag);
-			flag++;
-			break;
-		case '?':
-			errflg++;
-		}
-
-	/* if error flagged then print it and exit */
-	if (errflg)
-		{
-		fprintf(stderr,"usage: %s\n", usage_message);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		error = MB_ERROR_BAD_USAGE;
-		exit(error);
-		}
-
-	/* print starting message */
-	if (verbose == 1 || help)
-		{
-		fprintf(stderr,"\nProgram %s\n",program_name);
-		fprintf(stderr,"Version %s\n",rcs_id);
-		fprintf(stderr,"MB-system Version %s\n",MB_VERSION);
-		}
-
-	/* print starting debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  Program <%s>\n",program_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Control Parameters:\n");
-		fprintf(stderr,"dbg2       verbose:        %d\n",verbose);
-		fprintf(stderr,"dbg2       help:           %d\n",help);
-		fprintf(stderr,"dbg2       format:         %d\n",format);
-		fprintf(stderr,"dbg2       pings:          %d\n",pings);
-		fprintf(stderr,"dbg2       lonflip:        %d\n",lonflip);
-		fprintf(stderr,"dbg2       decimate:       %d\n",decimate);
-		fprintf(stderr,"dbg2       bounds[0]:      %f\n",bounds[0]);
-		fprintf(stderr,"dbg2       bounds[1]:      %f\n",bounds[1]);
-		fprintf(stderr,"dbg2       bounds[2]:      %f\n",bounds[2]);
-		fprintf(stderr,"dbg2       bounds[3]:      %f\n",bounds[3]);
-		fprintf(stderr,"dbg2       btime_i[0]:     %d\n",btime_i[0]);
-		fprintf(stderr,"dbg2       btime_i[1]:     %d\n",btime_i[1]);
-		fprintf(stderr,"dbg2       btime_i[2]:     %d\n",btime_i[2]);
-		fprintf(stderr,"dbg2       btime_i[3]:     %d\n",btime_i[3]);
-		fprintf(stderr,"dbg2       btime_i[4]:     %d\n",btime_i[4]);
-		fprintf(stderr,"dbg2       btime_i[5]:     %d\n",btime_i[5]);
-		fprintf(stderr,"dbg2       btime_i[6]:     %d\n",btime_i[6]);
-		fprintf(stderr,"dbg2       etime_i[0]:     %d\n",etime_i[0]);
-		fprintf(stderr,"dbg2       etime_i[1]:     %d\n",etime_i[1]);
-		fprintf(stderr,"dbg2       etime_i[2]:     %d\n",etime_i[2]);
-		fprintf(stderr,"dbg2       etime_i[3]:     %d\n",etime_i[3]);
-		fprintf(stderr,"dbg2       etime_i[4]:     %d\n",etime_i[4]);
-		fprintf(stderr,"dbg2       etime_i[5]:     %d\n",etime_i[5]);
-		fprintf(stderr,"dbg2       etime_i[6]:     %d\n",etime_i[6]);
-		fprintf(stderr,"dbg2       speedmin:       %f\n",speedmin);
-		fprintf(stderr,"dbg2       timegap:        %f\n",timegap);
-		fprintf(stderr,"dbg2       aux_nav_channel:%d\n",aux_nav_channel);
-		fprintf(stderr,"dbg2       data_kind:      %d\n",data_kind);
-		fprintf(stderr,"dbg2       ascii:          %d\n",ascii);
-		fprintf(stderr,"dbg2       segment:        %d\n",segment);
-		fprintf(stderr,"dbg2       segment_tag:    %s\n",segment_tag);
-		fprintf(stderr,"dbg2       delimiter:      %s\n",delimiter);
-		fprintf(stderr,"dbg2       file:           %s\n",file);
-		fprintf(stderr,"dbg2       n_list:         %d\n",n_list);
-		for (i=0;i<n_list;i++)
-			fprintf(stderr,"dbg2         list[%d]:      %c\n",
-						i,list[i]);
-		}
-
-	/* if help desired then print it and exit */
-	if (help)
-		{
-		fprintf(stderr,"\n%s\n",help_message);
-		fprintf(stderr,"\nusage: %s\n", usage_message);
-		exit(error);
-		}
-
-	/* get format if required */
-	if (format == 0)
-		mb_get_format(verbose,read_file,NULL,&format,&error);
-
-	/* determine whether to read one file or a list of files */
-	if (format < 0)
-		read_datalist = MB_YES;
-
-	/* open file list */
-	if (read_datalist == MB_YES)
-	    {
-	    if ((status = mb_datalist_open(verbose,&datalist,
-					    read_file,look_processed,&error)) != MB_SUCCESS)
-		{
-		error = MB_ERROR_OPEN_FAIL;
-		fprintf(stderr,"\nUnable to open data list file: %s\n",
-			read_file);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-	    if ((status = mb_datalist_read(verbose,datalist,
-			    file,&format,&file_weight,&error))
-			    == MB_SUCCESS)
-		read_data = MB_YES;
-	    else
-		read_data = MB_NO;
-	    }
-	/* else copy single filename to be read */
-	else
-	    {
-	    strcpy(file, read_file);
-	    read_data = MB_YES;
-	    }
-
-	/* loop over all files to be read */
-	while (read_data == MB_YES)
-	{
-	/* check format and get data sources */
-	if ((status = mb_format_source(verbose, &format,
-			&nav_source, &heading_source,
-			&vru_source, &svp_source,
-			&error)) == MB_FAILURE)
-		{
-		mb_error(verbose,error,&message);
-		fprintf(stderr,"\nMBIO Error returned from function <mb_format_source>:\n%s\n",message);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-
-	/* set auxiliary nav source if requested
-		- note this is superceded by data_kind if the -K option is used */
-	if (aux_nav_channel > 0)
-		{
-		if (aux_nav_channel == 1)
-		    nav_source = MB_DATA_NAV1;
-		else if (aux_nav_channel == 2)
-		    nav_source = MB_DATA_NAV2;
-		else if (aux_nav_channel == 3)
-		    nav_source = MB_DATA_NAV3;
-		}
-
-	/* initialize reading the swath file */
-	if ((status = mb_read_init(
-		verbose,file,format,pings,lonflip,bounds,
-		btime_i,etime_i,speedmin,timegap,
-		&mbio_ptr,&btime_d,&etime_d,
-		&beams_bath,&beams_amp,&pixels_ss,&error)) != MB_SUCCESS)
-		{
-		mb_error(verbose,error,&message);
-		fprintf(stderr,"\nMBIO Error returned from function <mb_read_init>:\n%s\n",message);
-		fprintf(stderr,"\nMultibeam File <%s> not initialized for reading\n",file);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-
-	/* allocate memory for data arrays */
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(char), (void **)&beamflag, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(double), (void **)&bath, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_AMPLITUDE,
-						sizeof(double), (void **)&amp, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(double), (void **)&bathacrosstrack, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(double), (void **)&bathalongtrack, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_SIDESCAN,
-						sizeof(double), (void **)&ss, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_SIDESCAN,
-						sizeof(double), (void **)&ssacrosstrack, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_SIDESCAN,
-						sizeof(double), (void **)&ssalongtrack, &error);
-
-	/* if error initializing memory then quit */
-	if (error != MB_ERROR_NO_ERROR)
-		{
-		mb_error(verbose,error,&message);
-		fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",
-			message);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-
-	/* output separator for GMT style segment file output */
-	if (segment == MB_YES && ascii == MB_YES)
-		{
-		printf("%s\n", segment_tag);
-		}
-
-	/* read and print data */
-	distance_total = 0.0;
-	nread = 0;
-	nnav = 0;
-	first = MB_YES;
-	while (error <= MB_ERROR_NO_ERROR)
-		{
-		/* read a ping of data */
-		status = mb_get_all(verbose,mbio_ptr,&store_ptr,&kind,
-			time_i,&time_d,&navlon,&navlat,
-			&speed,&heading,
-			&distance,&altitude,&sonardepth,
-			&beams_bath,&beams_amp,&pixels_ss,
-			beamflag,bath,amp,bathacrosstrack,bathalongtrack,
-			ss,ssacrosstrack,ssalongtrack,
-			comment,&error);
-
-		/* time gaps are not a problem here */
-		if (error == MB_ERROR_TIME_GAP)
-			{
-			error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-
-		/* check for appropriate navigation record */
-
-		/* if the -K option is used look for a particular
-			sort of data record */
-		if (error <= MB_ERROR_NO_ERROR)
-			{
-			if (data_kind > 0)
-				{
-				if (kind == data_kind)
-					{
-					error = MB_ERROR_NO_ERROR;
-					status = MB_SUCCESS;
-					}
-				else
-					{
-					error = MB_ERROR_IGNORE;
-					status = MB_FAILURE;
-					}
-				}
-			else
-				{
-				if (kind == nav_source)
-					{
-					error = MB_ERROR_NO_ERROR;
-					status = MB_SUCCESS;
-					}
-				else
-					{
-					error = MB_ERROR_IGNORE;
-					status = MB_FAILURE;
-					}
-				}
-			}
-
-		/* extract additional nav info */
-		if (error == MB_ERROR_NO_ERROR)
-			{
-		   	status = mb_extract_nnav(verbose,mbio_ptr,store_ptr,
-					MB_ASYNCH_SAVE_MAX, &kind, &n,
-				    	atime_i,atime_d,anavlon,anavlat,
-				    	aspeed,aheading,adraft,
-					aroll,apitch,aheave,&error);
-			}
-
-		/* increment counter */
-		if (error == MB_ERROR_NO_ERROR)
-			nread++;
-
-		/* print debug statements */
-		if (verbose >= 2)
-			{
-			fprintf(stderr,"\ndbg2  Nsv data read in program <%s>\n",
-				program_name);
-			fprintf(stderr,"dbg2       kind:           %d\n",kind);
-			fprintf(stderr,"dbg2       error:          %d\n",error);
-			fprintf(stderr,"dbg2       status:         %d\n",status);
-			fprintf(stderr,"dbg2       n:              %d\n",n);
-			}
-
-		/* loop over the n navigation points, outputting each one */
-		/* calculate course made good and distance */
-		if (error == MB_ERROR_NO_ERROR && n > 0)
-			{
-			for (inav=0;inav<n;inav++)
-				{
-				/* get data */
-				for (j=0;j<7;j++)
-					time_i[j] = atime_i[inav * 7 + j];
-				time_d = atime_d[inav];
-				navlon = anavlon[inav];
-				navlat = anavlat[inav];
-				speed = aspeed[inav];
-				heading = aheading[inav];
-				draft = adraft[inav];
-				roll = aroll[inav];
-				pitch = apitch[inav];
-				heave = aheave[inav];
-				sonardepth = draft - heave;
-
-/*
-seconds = time_i[5] + 1e-6 * time_i[6];
-fprintf(stdout, "kind:%d error:%d %d of %d: time:%4d/%2d/%2d %2.2d:%2.2d:%9.6f\n",
-kind, error, i, n,
-time_i[0],  time_i[1],  time_i[2],
-time_i[3],  time_i[4],  seconds);
-*/
-
-				/* calculate course made good and distance */
-				mb_coor_scale(verbose,navlat, &mtodeglon, &mtodeglat);
-				headingx = sin(DTR * heading);
-				headingy = cos(DTR * heading);
-				if (first == MB_YES)
-					{
-					time_interval = 0.0;
-					course = heading;
-					speed_made_good = 0.0;
-					course_old = heading;
-					speed_made_good_old = speed;
-					distance = 0.0;
-					}
-				else
-					{
-					time_interval = time_d - time_d_old;
-					dx = (navlon - navlon_old)/mtodeglon;
-					dy = (navlat - navlat_old)/mtodeglat;
-					distance = sqrt(dx*dx + dy*dy);
-					if (distance > 0.0)
-						course = RTD*atan2(dx/distance,dy/distance);
-					else
-						course = course_old;
-					if (course < 0.0)
-						course = course + 360.0;
-					if (time_interval > 0.0)
-						speed_made_good = 3.6*distance/time_interval;
-					else
-						speed_made_good
-							= speed_made_good_old;
-					}
-				distance_total += 0.001 * distance;
-
-				/* reset old values */
-				navlon_old = navlon;
-				navlat_old = navlat;
-				course_old = course;
-				speed_made_good_old = speed_made_good;
-				time_d_old = time_d;
-
-				/* now loop over list of output parameters */
-				if (nnav % decimate == 0)
-				for (i=0; i<n_list; i++)
-					{
-					switch (list[i])
-						{
-						case '/': /* Inverts next simple value */
-							invert_next_value = MB_YES;
-							break;
-						case '-': /* Flip sign on next simple value */
-							signflip_next_value = MB_YES;
-							break;
-						case 'c': /* Sonar transducer depth (m) */
-							printsimplevalue(verbose, sonardepth, 0, 3, ascii,
-									    &invert_next_value,
-									    &signflip_next_value, &error);
-							break;
-						case 'H': /* heading */
-							printsimplevalue(verbose, heading, 6, 2, ascii,
-									    &invert_next_value,
-									    &signflip_next_value, &error);
-							break;
-						case 'h': /* course */
-							printsimplevalue(verbose, course, 6, 2, ascii,
-									    &invert_next_value,
-									    &signflip_next_value, &error);
-							break;
-						case 'J': /* time string */
-							mb_get_jtime(verbose,time_i,time_j);
-							seconds = time_i[5] + 0.000001 * time_i[6];
-							if (ascii == MB_YES)
-							    {
-							    printf("%.4d %.3d %.2d %.2d %9.6f",
-								time_j[0],time_j[1],
-								time_i[3],time_i[4],
-								seconds);
-							    }
-							else
-							    {
-							    b = time_j[0];
-							    fwrite(&b, sizeof(double), 1, stdout);
-							    b = time_j[1];
-							    fwrite(&b, sizeof(double), 1, stdout);
-							    b = time_i[3];
-							    fwrite(&b, sizeof(double), 1, stdout);
-							    b = time_i[4];
-							    fwrite(&b, sizeof(double), 1, stdout);
-							    b = time_i[5];
-							    fwrite(&b, sizeof(double), 1, stdout);
-							    b = time_i[6];
-							    fwrite(&b, sizeof(double), 1, stdout);
-							    }
-							break;
-						case 'j': /* time string */
-							mb_get_jtime(verbose,time_i,time_j);
-							seconds = time_i[5] + 0.000001 * time_i[6];
-							if (ascii == MB_YES)
-							    {
-							    printf("%.4d %.3d %.4d %9.6f",
-								time_j[0],time_j[1],
-								time_j[2],seconds);
-							    }
-							else
-							    {
-							    b = time_j[0];
-							    fwrite(&b, sizeof(double), 1, stdout);
-							    b = time_j[1];
-							    fwrite(&b, sizeof(double), 1, stdout);
-							    b = time_j[2];
-							    fwrite(&b, sizeof(double), 1, stdout);
-							    b = time_j[3];
-							    fwrite(&b, sizeof(double), 1, stdout);
-							    b = time_j[4];
-							    fwrite(&b, sizeof(double), 1, stdout);
-							    }
-							break;
-						case 'L': /* along-track distance (km) */
-							printsimplevalue(verbose, distance_total, 7, 3, ascii,
-									    &invert_next_value,
-									    &signflip_next_value, &error);
-							break;
-						case 'l': /* along-track distance (m) */
-							printsimplevalue(verbose, 1000.0 * distance_total, 7, 3, ascii,
-									    &invert_next_value,
-									    &signflip_next_value, &error);
-							break;
-						case 'M': /* Decimal unix seconds since
-								1/1/70 00:00:00 */
-							printsimplevalue(verbose, time_d, 0, 6, ascii,
-									    &invert_next_value,
-									    &signflip_next_value, &error);
-							break;
-						case 'm': /* time in decimal seconds since
-								first record */
-							if (first_m == MB_YES)
-								{
-								time_d_ref = time_d;
-								first_m = MB_NO;
-								}
-							b = time_d - time_d_ref;
-							printsimplevalue(verbose, b, 0, 6, ascii,
-									    &invert_next_value,
-									    &signflip_next_value, &error);
-							break;
-						case 'P': /* pitch */
-							printsimplevalue(verbose, pitch, 5, 2, ascii,
-									    &invert_next_value,
-									    &signflip_next_value, &error);
-							break;
-						case 'p': /* draft */
-							printsimplevalue(verbose, draft, 5, 2, ascii,
-									    &invert_next_value,
-									    &signflip_next_value, &error);
-							break;
-						case 'R': /* roll */
-							printsimplevalue(verbose, roll, 5, 2, ascii,
-									    &invert_next_value,
-									    &signflip_next_value, &error);
-							break;
-						case 'r': /* heave */
-							printsimplevalue(verbose, heave, 5, 2, ascii,
-									    &invert_next_value,
-									    &signflip_next_value, &error);
-							break;
-						case 'S': /* speed */
-							printsimplevalue(verbose, speed, 5, 2, ascii,
-									    &invert_next_value,
-									    &signflip_next_value, &error);
-							break;
-						case 's': /* speed made good */
-							printsimplevalue(verbose, speed_made_good, 5, 2, ascii,
-									    &invert_next_value,
-									    &signflip_next_value, &error);
-							break;
-						case 'T': /* yyyy/mm/dd/hh/mm/ss time string */
-							seconds = time_i[5] + 1e-6 * time_i[6];
-							if (ascii == MB_YES)
-							    printf("%.4d/%.2d/%.2d/%.2d/%.2d/%9.6f",
-								time_i[0],time_i[1],time_i[2],
-								time_i[3],time_i[4],seconds);
-							else
-							    {
-							    b = time_i[0];
-							    fwrite(&b, sizeof(double), 1, stdout);
-							    b = time_i[1];
-							    fwrite(&b, sizeof(double), 1, stdout);
-							    b = time_i[2];
-							    fwrite(&b, sizeof(double), 1, stdout);
-							    b = time_i[3];
-							    fwrite(&b, sizeof(double), 1, stdout);
-							    b = time_i[4];
-							    fwrite(&b, sizeof(double), 1, stdout);
-							    b = seconds;
-							    fwrite(&b, sizeof(double), 1, stdout);
-							    }
-							break;
-						case 't': /* yyyy mm dd hh mm ss time string */
-							seconds = time_i[5] + 1e-6 * time_i[6];
-							if (ascii == MB_YES)
-							    printf("%.4d %.2d %.2d %.2d %.2d %9.6f",
-								time_i[0],time_i[1],time_i[2],
-								time_i[3],time_i[4],seconds);
-							else
-							    {
-							    b = time_i[0];
-							    fwrite(&b, sizeof(double), 1, stdout);
-							    b = time_i[1];
-							    fwrite(&b, sizeof(double), 1, stdout);
-							    b = time_i[2];
-							    fwrite(&b, sizeof(double), 1, stdout);
-							    b = time_i[3];
-							    fwrite(&b, sizeof(double), 1, stdout);
-							    b = time_i[4];
-							    fwrite(&b, sizeof(double), 1, stdout);
-							    b = seconds;
-							    fwrite(&b, sizeof(double), 1, stdout);
-							    }
-							break;
-						case 'U': /* unix time in seconds since 1/1/70 00:00:00 */
-							time_u = (int) time_d;
-							if (ascii == MB_YES)
-							    printf("%ld",time_u);
-							else
-							    {
-							    b = time_u;
-							    fwrite(&b, sizeof(double), 1, stdout);
-							    }
-							break;
-						case 'u': /* time in seconds since first record */
-							time_u = (int) time_d;
-							if (first_u == MB_YES)
-								{
-								time_u_ref = time_u;
-								first_u = MB_NO;
-								}
-							if (ascii == MB_YES)
-							    printf("%ld",time_u - time_u_ref);
-							else
-							    {
-							    b = time_u - time_u_ref;
-							    fwrite(&b, sizeof(double), 1, stdout);
-							    }
-							break;
-						case 'V': /* time in seconds since last ping */
-						case 'v':
-							if (ascii == MB_YES)
-							    {
-							    if ( fabs(time_interval) > 100. )
-								printf("%g",time_interval);
-							    else
-								printf("%7.3f",time_interval);
-							    }
-							else
-							    {
-							    fwrite(&time_interval, sizeof(double), 1, stdout);
-							    }
-							break;
-						case 'X': /* longitude decimal degrees */
-							dlon = navlon;
-							printsimplevalue(verbose, dlon, 14, 9, ascii,
-									    &invert_next_value,
-									    &signflip_next_value, &error);
-							break;
-						case 'x': /* longitude degress + decimal minutes */
-							dlon = navlon;
-							if (dlon < 0.0)
-								{
-								hemi = 'W';
-								dlon = -dlon;
-								}
-							else
-								hemi = 'E';
-							degrees = (int) dlon;
-							minutes = 60.0*(dlon - degrees);
-							if (ascii == MB_YES)
-							    {
-							    printf("%3d %9.6f%c",
-								degrees, minutes, hemi);
-							    }
-							else
-							    {
-							    b = degrees;
-							    if (hemi == 'W') b = -b;
-							    fwrite(&b, sizeof(double), 1, stdout);
-							    b = minutes;
-							    fwrite(&b, sizeof(double), 1, stdout);
-							    }
-							break;
-						case 'Y': /* latitude decimal degrees */
-							dlat = navlat;
-							printsimplevalue(verbose, dlat, 14, 9, ascii,
-									    &invert_next_value,
-									    &signflip_next_value, &error);
-							break;
-						case 'y': /* latitude degrees + decimal minutes */
-							dlat = navlat;
-							if (dlat < 0.0)
-								{
-								hemi = 'S';
-								dlat = -dlat;
-								}
-							else
-								hemi = 'N';
-							degrees = (int) dlat;
-							minutes = 60.0*(dlat - degrees);
-							if (ascii == MB_YES)
-							    {
-							    printf("%3d %9.6f%c",
-								degrees, minutes, hemi);
-							    }
-							else
-							    {
-							    b = degrees;
-							    if (hemi == 'S') b = -b;
-							    fwrite(&b, sizeof(double), 1, stdout);
-							    b = minutes;
-							    fwrite(&b, sizeof(double), 1, stdout);
-							    }
-							break;
-						default:
-							if (ascii == MB_YES)
-							    printf("<Invalid Option: %c>",
-								list[i]);
-							break;
-						}
-					if (ascii == MB_YES)
-						{
-						if (i<(n_list-1)) printf ("%s", delimiter);
-						else printf ("\n");
-						}
-					}
-				nnav++;
-				first = MB_NO;
-				}
-			}
-		}
-
-	/* close the swath file */
-	status = mb_close(verbose,&mbio_ptr,&error);
-
-	/* figure out whether and what to read next */
-        if (read_datalist == MB_YES)
-                {
-		if ((status = mb_datalist_read(verbose,datalist,
-			    file,&format,&file_weight,&error))
-			    == MB_SUCCESS)
-                        read_data = MB_YES;
-                else
-                        read_data = MB_NO;
-                }
-        else
-                {
-                read_data = MB_NO;
-                }
-
-	/* end loop over files in list */
-	}
-	if (read_datalist == MB_YES)
-		mb_datalist_close(verbose,&datalist,&error);
-
-	/* check memory */
-	if (verbose >= 4)
-		status = mb_memory_list(verbose,&error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  Program <%s> completed\n",
-			program_name);
-		fprintf(stderr,"dbg2  Ending status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* end it all */
-	exit(error);
-}
-/*--------------------------------------------------------------------*/
-int printsimplevalue(int verbose,
-	double value, int width, int precision,
-	int ascii, int *invert, int *flipsign, int *error)
-{
-	char	*function_name = "printsimplevalue";
-	int	status = MB_SUCCESS;
-	char	format[24];
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBlist function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:         %d\n",verbose);
-		fprintf(stderr,"dbg2       value:           %f\n",value);
-		fprintf(stderr,"dbg2       width:           %d\n",width);
-		fprintf(stderr,"dbg2       precision:       %d\n",precision);
-		fprintf(stderr,"dbg2       ascii:           %d\n",ascii);
-		fprintf(stderr,"dbg2       invert:          %d\n",*invert);
-		fprintf(stderr,"dbg2       flipsign:        %d\n",*flipsign);
-		}
-
-	/* make print format */
-	format[0] = '%';
-	if (*invert == MB_YES)
-	    strcpy(format, "%g");
-	else if (width > 0)
-	    sprintf(&format[1], "%d.%df", width, precision);
-	else
-	    sprintf(&format[1], ".%df", precision);
-
-	/* invert value if desired */
-	if (*invert == MB_YES)
-	    {
-	    *invert = MB_NO;
-	    if (value != 0.0)
-		value = 1.0 / value;
-	    }
-
-	/* flip sign value if desired */
-	if (*flipsign == MB_YES)
-	    {
-	    *flipsign = MB_NO;
-	    value = -value;
-	    }
-
-	/* print value */
-	if (ascii == MB_YES)
-	    printf(format, value);
-	else
-	    fwrite(&value, sizeof(double), 1, stdout);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBlist function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       invert:          %d\n",*invert);
-		fprintf(stderr,"dbg2       error:           %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:          %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int printNaN(int verbose, int ascii, int *invert, int *flipsign, int *error)
-{
-	char	*function_name = "printNaN";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBlist function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:         %d\n",verbose);
-		fprintf(stderr,"dbg2       ascii:           %d\n",ascii);
-		fprintf(stderr,"dbg2       invert:          %d\n",*invert);
-		fprintf(stderr,"dbg2       flipsign:        %d\n",*flipsign);
-		}
-
-	/* reset invert flag */
-	if (*invert == MB_YES)
-	    *invert = MB_NO;
-
-	/* reset flipsign flag */
-	if (*flipsign == MB_YES)
-	    *flipsign = MB_NO;
-
-	/* print value */
-	if (ascii == MB_YES)
-	    printf("NaN");
-	else
-	    fwrite(&NaN, sizeof(double), 1, stdout);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBlist function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       invert:          %d\n",*invert);
-		fprintf(stderr,"dbg2       error:           %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:          %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/utilities/mbneptune2esf.c b/src/utilities/mbneptune2esf.c
deleted file mode 100644
index 8e7f8cd..0000000
--- a/src/utilities/mbneptune2esf.c
+++ /dev/null
@@ -1,1253 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbneptune2esf.c	2004/11/11
- *    $Id: mbneptune2esf.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 2004-2015 by
- *    Gordon Keith
- *      CSIRO Marine Research
- *      Castray Esplanade
- *      Battery Point TAS 7000
- *      Australia
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * MBneptune2esf reads a binstat_?.rules file generated by manually cleaning
- * data using the correlation plot in the binstat tool of the neptune sofware
- * written by Kongsberg Simrad and writes these edits in an mbsystem esf file.
- * The purpose of this tool is to allow data cleaning done using neptune to
- * be carried into the mbsystem environment - thus making neptune a more useful
- * tool.
- *
- * MBneptune2esf applies all the manual edits in the rules file given to those
- * of the input files it recognises as matching the original lines.
- * A line is considered to match if the line name contained in the rules file
- * (e.g. 0002_20000408_221415) is part of the file name of the data file
- * (e.g. 0002_20000408_221415.mb57).
- *
- * Swath line files should be converted to format 57 using mbcopy before
- * using this program, as format 56 does not have the ability to flag data
- * (although it can be zeroed).
- *
- * Data flagged by rules generated in binstat is not flagged by this program -
- * only manually flagged data is flagged.
- *
- * Author:	G. J. Keith
- * Date:	11 November 2004
- *
- * Acknowledgments:
- * This program is based on a skeleton derived from mbclean.
- *
- * $Log: mbneptune2esf.c,v $
- * Revision 5.5  2008/09/11 20:20:14  caress
- * Checking in updates made during cruise AT15-36.
- *
- * Revision 5.4  2006/01/18 15:17:00  caress
- * Added stdlib.h include.
- *
- * Revision 5.3  2005/11/05 01:07:54  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.2  2005/03/25 04:43:02  caress
- * Standardized the string lengths used for filenames and comment data.
- *
- * Revision 5.1  2004/12/18 01:38:52  caress
- * Working towards release 5.0.6.
- *
- * Revision 5.0  2004/12/02 06:40:49  caress
- * New program submitted by Gordon Keith.
- *
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <math.h>
-#include <string.h>
-#include <sys/stat.h>
-#include <time.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_define.h"
-#include "mb_io.h"
-#include "mb_swap.h"
-#include "mb_process.h"
-#include "mbsys_simrad2.h"
-
-/* length of line name nnnn_yyyymmdd_hhmmss = 20 */
-#define LINE_NAME_LENGTH 20
-#define LINE_NAME_BUFFER LINE_NAME_LENGTH + 1
-
-/* use MB-System memory allocation functions */
-#define	USE_MB_MALLOC 1
-
-/* list of flagged beams */
-struct neptune_beam_list
-{
-  int	beam;
-  struct neptune_beam_list *next;
-};
-
-/* ping tree structure */
-struct neptune_ping_tree
-{
-  int	ping;
-  struct neptune_ping_tree *prev;
-  struct neptune_ping_tree *next;
-  struct neptune_beam_list *beams;
-};
-
-/* line tree structure */
-struct neptune_line_tree
-{
-  char	name[LINE_NAME_BUFFER];
-  struct neptune_line_tree *prev;
-  struct neptune_line_tree *next;
-  struct neptune_ping_tree *pings;
-};
-
-/* ping structure definition */
-struct mbclean_ping_struct
-	{
-	int	time_i[7];
-	double	time_d;
-	double	navlon;
-	double	navlat;
-	double	speed;
-	double	heading;
-	int	beams_bath;
-	char	*beamflag;
-	char	*beamflagorg;
-	double	*bath;
-	double	*bathacrosstrack;
-	double	*bathalongtrack;
-	double	*bathx;
-	double	*bathy;
-	};
-
-/* function prototypes */
-int mbclean_save_edit(int verbose, FILE *sofp, double time_d, int beam, int action, int *error);
-int find_line(int verbose, char* line_name, struct neptune_line_tree **node, int create,
-	      struct neptune_line_tree **result, int *nlines, int *error);
-int find_ping(int verbose, int ping, struct neptune_ping_tree **node, int create,
-	      struct neptune_ping_tree **result, int *error);
-int line_array(struct neptune_line_tree *line, struct neptune_line_tree ***array, int *n);
-int print_pings(FILE *output, struct neptune_ping_tree *node);
-int free_pings(int verbose, struct neptune_ping_tree **node, int *error);
-
-static char rcs_id[] = "$Id: mbneptune2esf.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-
-int main (int argc, char **argv)
-{
-	char program_name[] = "mbneptune2esf";
-	char help_message[] =  "mbneptune2esf reads a Simrad Neptune BinStat rules files and a list of MB-Systems data files\nand applies the flags in the rules file to the esf file of the coresponding line";
-	char usage_message[] = "mbneptune2esf [-Rrules -Fformat -Iinfile -Ooutfile -V -H]";
-	extern char *optarg;
-	int	errflg = 0;
-	int	c;
-	int	help = 0;
-	int	flag = 0;
-
-	/* MBIO status variables */
-	int	status;
-	int	verbose = 0;
-	int	error = MB_ERROR_NO_ERROR;
-	char	*message = NULL;
-
-	/* MBIO read control parameters */
-	int	read_datalist = MB_NO;
-	char	read_file[MB_PATH_MAXLINE];
-	char	swathfile[MB_PATH_MAXLINE];
-	void	*datalist;
-	int	look_processed = MB_DATALIST_LOOK_UNSET;
-	double	file_weight;
-	int	format;
-	int	variable_beams;
-	int	traveltime;
-	int	beam_flagging;
-	int	pings;
-	int	lonflip;
-	double	bounds[4];
-	int	btime_i[7];
-	int	etime_i[7];
-	double	btime_d;
-	double	etime_d;
-	double	speedmin;
-	double	timegap;
-	double	distance;
-	double	altitude;
-	double	sonardepth;
-	int	beams_bath;
-	int	beams_amp;
-	int	pixels_ss;
-	double	*amp;
-	double	*ss;
-	double	*ssacrosstrack;
-	double	*ssalongtrack;
-
-	/* mbio read and write values */
-	void	*mbio_ptr = NULL;
-	struct mb_io_struct	*mb_io_ptr;
-	struct mbsys_simrad2_struct	*store;
-	struct mbsys_simrad2_ping_struct *sim_ping;
-	int	kind;
-	struct mbclean_ping_struct cur_ping;
-	int	pingsread;
-	int	nfiletot = 0;
-	int	ndatatot = 0;
-	int	nflagtot = 0;
-	int	nzerotot = 0;
-	int	nflagesftot = 0;
-	int	nunflagesftot = 0;
-	int	nzeroesftot = 0;
-	int	ndata = 0;
-	int	nflag = 0;
-	int	nzero = 0;
-	int	nflagesf = 0;
-	int	nunflagesf = 0;
-	int	nzeroesf = 0;
-	char	comment[MB_COMMENT_MAXLINE];
-	int	mode = 1;
-	int	action;
-
-	/* rules file */
-	char    rulesfile[MB_PATH_MAXLINE];
-	struct neptune_line_tree *rule_lines = NULL;
-	int     no_lines = 0;
-	FILE    *rules_fp;
-	int	rules_done;
-	int	rule_level;
-	int	usable_rule;
-	int	nscan;
-	int	nlines;
-	int	npings;
-	int	nbeams;
-	int 	used;
-	int 	bytes;
-	char	buffer[MB_PATH_MAXLINE];
-	char	word[MB_PATH_MAXLINE];
-	char	buff[MB_PATH_MAXLINE];
-	char	beams_buff[MB_PATH_MAXLINE];
-	char	line_name[MB_PATH_MAXLINE];
-	int	nlen;
-	int	slen;
-	int	ping_no;
-	int	beam_no;
-	struct neptune_line_tree **lines;
-	struct neptune_line_tree *line;
-	struct neptune_ping_tree *ping;
-	struct neptune_beam_list *beam;
-	char	*buffer_ptr;
-
-	int     output_file_set = MB_NO;
-	char    output_file[MB_PATH_MAXLINE];
-	FILE	*output;
-
-	/* save file control variables */
-	int	esffile_open = MB_NO;
-	char	esffile[MB_PATH_MAXLINE];
-	struct mb_esf_struct esf;
-
-	/* processing variables */
-	int	pingmultiplicity;
-	double	time_d_lastping;
-	int	read_data;
-	int	start, done;
-	int	i, j, k;
-
-	/* get current default values */
-	status = mb_defaults(verbose,&format,&pings,&lonflip,bounds,
-		btime_i,etime_i,&speedmin,&timegap);
-
-	/* reset all defaults but the format and lonflip */
-	pings = 1;
-	bounds[0] = -360.;
-	bounds[1] = 360.;
-	bounds[2] = -90.;
-	bounds[3] = 90.;
-	btime_i[0] = 1962;
-	btime_i[1] = 2;
-	btime_i[2] = 21;
-	btime_i[3] = 10;
-	btime_i[4] = 30;
-	btime_i[5] = 0;
-	btime_i[6] = 0;
-	etime_i[0] = 2062;
-	etime_i[1] = 2;
-	etime_i[2] = 21;
-	etime_i[3] = 10;
-	etime_i[4] = 30;
-	etime_i[5] = 0;
-	etime_i[6] = 0;
-	speedmin = 0.0;
-	timegap = 1000000000.0;
-	strcpy(read_file, "datalist.mb-1");
-	strcpy(rulesfile, "-");
-
-	/* process argument list */
-	while ((c = getopt(argc, argv, "VvHhF:f:I:i:M:m:O:o:R:r:")) != -1)
-	  switch (c)
-		{
-		case 'H':
-		case 'h':
-			help++;
-			break;
-		case 'V':
-		case 'v':
-			verbose++;
-			break;
-		case 'F':
-		case 'f':
-			sscanf (optarg,"%d", &format);
-			flag++;
-			break;
-		case 'I':
-		case 'i':
-			sscanf (optarg,"%s", read_file);
-			flag++;
-			break;
-		case 'M':
-		case 'm':
-			sscanf (optarg,"%d", &mode);
-			flag++;
-			break;
-		case 'O':
-		case 'o':
-			sscanf (optarg,"%s", output_file);
-			output_file_set = MB_YES;
-			flag++;
-			break;
-		case 'R':
-		case 'r':
-			sscanf (optarg,"%s", rulesfile);
-			flag++;
-			break;
-		case '?':
-			errflg++;
-		}
-
-	/* if error flagged then print it and exit */
-	if (errflg)
-		{
-		fprintf(stderr,"usage: %s\n", usage_message);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		error = MB_ERROR_BAD_USAGE;
-		exit(error);
-		}
-
-	/* print starting message */
-	if (verbose == 1 || help)
-		{
-		fprintf(stderr,"\nProgram %s\n",program_name);
-		fprintf(stderr,"Version %s\n",rcs_id);
-		fprintf(stderr,"MB-system Version %s\n",MB_VERSION);
-		}
-
-	/* print starting debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  Program <%s>\n",program_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Control Parameters:\n");
-		fprintf(stderr,"dbg2       verbose:        %d\n",verbose);
-		fprintf(stderr,"dbg2       help:           %d\n",help);
-		fprintf(stderr,"dbg2       pings:          %d\n",pings);
-		fprintf(stderr,"dbg2       lonflip:        %d\n",lonflip);
-		fprintf(stderr,"dbg2       bounds[0]:      %f\n",bounds[0]);
-		fprintf(stderr,"dbg2       bounds[1]:      %f\n",bounds[1]);
-		fprintf(stderr,"dbg2       bounds[2]:      %f\n",bounds[2]);
-		fprintf(stderr,"dbg2       bounds[3]:      %f\n",bounds[3]);
-		fprintf(stderr,"dbg2       btime_i[0]:     %d\n",btime_i[0]);
-		fprintf(stderr,"dbg2       btime_i[1]:     %d\n",btime_i[1]);
-		fprintf(stderr,"dbg2       btime_i[2]:     %d\n",btime_i[2]);
-		fprintf(stderr,"dbg2       btime_i[3]:     %d\n",btime_i[3]);
-		fprintf(stderr,"dbg2       btime_i[4]:     %d\n",btime_i[4]);
-		fprintf(stderr,"dbg2       btime_i[5]:     %d\n",btime_i[5]);
-		fprintf(stderr,"dbg2       btime_i[6]:     %d\n",btime_i[6]);
-		fprintf(stderr,"dbg2       etime_i[0]:     %d\n",etime_i[0]);
-		fprintf(stderr,"dbg2       etime_i[1]:     %d\n",etime_i[1]);
-		fprintf(stderr,"dbg2       etime_i[2]:     %d\n",etime_i[2]);
-		fprintf(stderr,"dbg2       etime_i[3]:     %d\n",etime_i[3]);
-		fprintf(stderr,"dbg2       etime_i[4]:     %d\n",etime_i[4]);
-		fprintf(stderr,"dbg2       etime_i[5]:     %d\n",etime_i[5]);
-		fprintf(stderr,"dbg2       etime_i[6]:     %d\n",etime_i[6]);
-		fprintf(stderr,"dbg2       speedmin:       %f\n",speedmin);
-		fprintf(stderr,"dbg2       timegap:        %f\n",timegap);
-		fprintf(stderr,"dbg2       data format:    %d\n",format);
-		fprintf(stderr,"dbg2       input file:     %s\n",read_file);
-		fprintf(stderr,"dbg2       mode:           %d\n",mode);
-		}
-
-	/* if help desired then print it and exit */
-	if (help)
-		{
-		fprintf(stderr,"\n%s\n",help_message);
-		fprintf(stderr,"\nusage: %s\n", usage_message);
-		exit(error);
-		}
-
-	/* read rules */
-	if (0 == strncmp("-",rulesfile,2))
-	  rules_fp =stdin;
-	else
-	if ((rules_fp = fopen(rulesfile,"r")) == NULL)
-		{
-		fprintf(stderr,"\nUnable to open rules file %s\n",rulesfile);
-		fprintf(stderr,"\nusage: %s\n", usage_message);
-		exit(error);
-		}
-
-	rules_done = MB_NO;
-	usable_rule = MB_NO;
-	rule_level = 0;
-	status = MB_SUCCESS;
-	while (MB_NO == rules_done)
-		{
-		/* skip till we find a rule */
-		while (MB_NO == rules_done &&
-		       MB_NO == usable_rule)
-			{
-			buffer_ptr = fgets(buffer,MB_PATH_MAXLINE,rules_fp);
-			if (buffer_ptr != buffer)
-				rules_done = MB_YES;
-			else
-				{
-				  nscan = sscanf(buffer, "%s",word);
-				  if (1 == nscan && ')' == word[0])
-				  	rule_level--;
-				  else if (1 == nscan && '(' == word[0] && ')' != word[1])
-				    {
-				      rule_level++;
-				      if (2 == rule_level)
-					{
-					  nscan = sscanf(buffer, "%s %s",buff,word);
-					  if (2 == nscan && 0 == strncmp(word,"LINES_PING_BEAM_RULE",20))
-					    usable_rule = MB_YES;
-					}
-				    }
-				}
-			}
-
-		/* read a rule */
-		if (MB_NO == rules_done)
-			{
-			buffer_ptr = fgets(buffer,MB_PATH_MAXLINE,rules_fp);
-			if (buffer_ptr != buffer)
-				{
-				rules_done = MB_YES;
-				status = MB_FAILURE;
-				error = MB_ERROR_EOF;
-				}
-			else
-				{
-
-				if (MB_SUCCESS == status && 2 != sscanf(buffer,"%s %d",word,&nlines))
-				  status = MB_FAILURE;
-
-				if (MB_SUCCESS == status && 0 != strncmp(word,"NO_OF_LINES",11))
-				  status = MB_FAILURE;
-
-				if (MB_SUCCESS == status)
-				  for(i = 0; i < nlines; i++)
-				    {
-				      if (buffer != fgets(buffer,MB_PATH_MAXLINE,rules_fp))
-					status = MB_FAILURE;
-
-				      if (MB_SUCCESS == status && 2 != sscanf(buffer,"%s '%s'",word,line_name))
-					status = MB_FAILURE;
-
-				      if (MB_SUCCESS == status && 0 != strncmp(word,"LINE_NAME",9))
-					status = MB_FAILURE;
-
-				      if (MB_SUCCESS == status)
-					status = find_line(verbose,line_name,&rule_lines,MB_YES,&line,&no_lines,&error);
-
-				      if (buffer != fgets(buffer,MB_PATH_MAXLINE,rules_fp))
-					status = MB_FAILURE;
-
-				      if (MB_SUCCESS == status && 2 != sscanf(buffer,"%s %d",word,&npings))
-					status = MB_FAILURE;
-
-				      if (MB_SUCCESS == status && 0 != strncmp(word,"NO_OF_PINGS",11))
-					status = MB_FAILURE;
-
-				      if (MB_SUCCESS == status)
-					for(j = 0; j < npings; j++)
-					  {
-					    if (buffer != fgets(buffer,MB_PATH_MAXLINE,rules_fp))
-					      status = MB_FAILURE;
-
-					    if (MB_SUCCESS == status && 5 > sscanf(buffer,"%s %d %s %d %s %n",
-										   word,&ping_no,buff,&nbeams,beams_buff,&used))
-					      status = MB_FAILURE;
-
-					    if (MB_SUCCESS == status &&
-						(0 != strncmp(word,"PING",4) ||
-						 0 != strncmp(buff,"NO_OF_BEAMS",11) ||
-						 0 != strncmp(beams_buff,"BEAMS",5)))
-					      status = MB_FAILURE;
-
-					    if (MB_SUCCESS == status)
-					      status = find_ping(verbose,ping_no,&(line->pings),MB_YES,&ping,&error);
-
-                                            beam = ping->beams;
-                                            if (NULL != beam)
-					      {
-                                              while (NULL != beam->next)
-                                                beam = beam->next;
-					      }
-					    if (MB_SUCCESS == status)
-					      for (k = 0; k < nbeams; k++)
-						{
-						  if (MB_SUCCESS == status && 1 > sscanf(&buffer[used],"%d %n",
-											 &beam_no,&bytes))
-						    status = MB_FAILURE;
-						  used += bytes;
-
-						  if (NULL == beam)
-						    {
-#ifdef USE_MB_MALLOC
-						      status = mb_mallocd(verbose,__FILE__,__LINE__,sizeof(struct neptune_beam_list),(void **)&(ping->beams),&error);
-#else
-						      ping->beams = malloc(sizeof(struct neptune_beam_list));
-#endif
-						      beam = ping->beams;
-						    }
-						  else
-						    {
-#ifdef USE_MB_MALLOC
-						      status = mb_mallocd(verbose,__FILE__,__LINE__,sizeof(struct neptune_beam_list),(void **)&(beam->next),&error);
-#else
-						      beam->next = malloc(sizeof(struct neptune_beam_list));
-#endif
-						      beam = beam->next;
-						    }
-						  beam->beam = beam_no;
-						  beam->next = NULL;
-						}
-					  }
-				    }
-				if (MB_FAILURE == status && 1<= verbose)
-				  {
-				    fprintf(stderr,"Failed to understand line: \n%s",buffer);
-				  }
-
-				status = MB_SUCCESS;
-				}
-			}
-		}
-
-	/* put lines in an array */
-	status = mb_mallocd(verbose,__FILE__,__LINE__,no_lines * sizeof(void*),(void **)&lines,&error);
-	i = 0;
-	line_array(rule_lines,&lines,&i);
-
-	/* output rules found */
-	if (MB_YES == output_file_set)
-	  {
-	    if (0 == strncmp("-",output_file,2))
-	      output = stdout;
-	    else
-	      output = fopen(output_file, "w");
-	    if (output != NULL)
-	      {
-		for (i = 0; i < no_lines; i++)
-		  {
-		    fprintf(output, "%s\n", lines[i]->name);
-		    print_pings(output, lines[i]->pings);
-		  }
-	      }
-	  }
-
-	/* get format if required */
-	if (format == 0)
-		mb_get_format(verbose,read_file,NULL,&format,&error);
-
-	/* determine whether to read one file or a list of files */
-	if (format < 0)
-		read_datalist = MB_YES;
-
-	/* open file list */
-	if (read_datalist == MB_YES)
-	    {
-	    if ((status = mb_datalist_open(verbose,&datalist,
-					    read_file,look_processed,&error)) != MB_SUCCESS)
-		{
-		error = MB_ERROR_OPEN_FAIL;
-		fprintf(stderr,"\nUnable to open data list file: %s\n",
-			read_file);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-	    if ((status = mb_datalist_read(verbose,datalist,
-			    swathfile,&format,&file_weight,&error))
-			    == MB_SUCCESS)
-		read_data = MB_YES;
-	    else
-		read_data = MB_NO;
-	    }
-	/* else copy single filename to be read */
-	else
-	    {
-	    strcpy(swathfile, read_file);
-	    read_data = MB_YES;
-	    }
-
-	/* loop over all files to be read */
-	while (read_data == MB_YES)
-	{
-
-	  usable_rule = MB_NO;
-	  /* check if this file matches any lines */
-	  if (MBF_EM300RAW == format || MBF_EM300MBA == format)
-	  for (i = 0; i < no_lines; i++)
-	    {
-	      strcpy(line_name,lines[i]->name);
-	      nlen = strlen(line_name);
-	      slen = strlen(swathfile);
-	      for (j = 0 ; j <= slen-nlen; j++)
-		if (0 == strncmp(line_name,&swathfile[j],nlen))
-		    {
-		      usable_rule = MB_YES;
-		      line = lines[i];
-		      j = slen;
-		      i = no_lines;
-		    }
-	    }
-
-	  if (MB_YES == usable_rule)
-	    {
-
-	/* check format and get format flags */
-	if ((status = mb_format_flags(verbose,&format,
-			&variable_beams, &traveltime, &beam_flagging,
-			&error))
-		!= MB_SUCCESS)
-		{
-		mb_error(verbose,error,&message);
-		fprintf(stderr,"\nMBIO Error returned from function <mb_format_flags> regarding input format %d:\n%s\n",format,message);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-
-	/* check that clean mode is allowed
-		for the specified data format */
-	if (beam_flagging == MB_NO && mode <= 2)
-		{
-		fprintf(stderr,"\nMBIO format %d does not allow flagging of bad data (specified by cleaning mode %d).\n",format,mode);
-		fprintf(stderr,"\nCopy the data to another format or set the cleaning mode to zero \nbad data values (-M3 or -M4).\n");
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-
-	/* initialize reading the input swath sonar file */
-	if ((status = mb_read_init(
-		verbose,swathfile,format,pings,lonflip,bounds,
-		btime_i,etime_i,speedmin,timegap,
-		&mbio_ptr,&btime_d,&etime_d,
-		&beams_bath,&beams_amp,&pixels_ss,&error)) != MB_SUCCESS)
-		{
-		mb_error(verbose,error,&message);
-		fprintf(stderr,"\nMBIO Error returned from function <mb_read_init>:\n%s\n",message);
-		fprintf(stderr,"\nMultibeam File <%s> not initialized for reading\n",swathfile);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-
-	/* initialize and increment counting variables */
-	ndata = 0;
-	nflag = 0;
-	nzero = 0;
-	nflagesf = 0;
-	nunflagesf = 0;
-	nzeroesf = 0;
-
-	/* give the statistics */
-	if (verbose >= 0)
-		{
-		fprintf(stderr,"\nProcessing %s\n",swathfile);
-		}
-
-	/* allocate memory for data arrays */
-	cur_ping.beamflag = NULL;
-	cur_ping.beamflagorg = NULL;
-	cur_ping.bath = NULL;
-	cur_ping.bathacrosstrack = NULL;
-	cur_ping.bathalongtrack = NULL;
-	cur_ping.bathx = NULL;
-	cur_ping.bathy = NULL;
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(char), (void **)&cur_ping.beamflag, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(char), (void **)&cur_ping.beamflagorg, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(double), (void **)&cur_ping.bath, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(double), (void **)&cur_ping.bathacrosstrack, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(double), (void **)&cur_ping.bathalongtrack, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(double), (void **)&cur_ping.bathx, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(double), (void **)&cur_ping.bathy, &error);
-
-	amp = NULL;
-	ss = NULL;
-	ssacrosstrack = NULL;
-	ssalongtrack = NULL;
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_AMPLITUDE,
-						sizeof(double), (void **)&amp, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_SIDESCAN,
-						sizeof(double), (void **)&ss, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_SIDESCAN,
-						sizeof(double), (void **)&ssacrosstrack, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_SIDESCAN,
-						sizeof(double), (void **)&ssalongtrack, &error);
-
-	/* if error initializing memory then quit */
-	if (error != MB_ERROR_NO_ERROR)
-		{
-		mb_error(verbose,error,&message);
-		fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",message);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-
-	/* now deal with old edit save file */
-	if (status == MB_SUCCESS)
-	    {
-	    /* reset message */
-	    fprintf(stderr, "Sorting old edits...\n");
-
-	    /* handle esf edits */
-	    status = mb_esf_load(verbose, swathfile,
-				 MB_YES, MB_YES, esffile, &esf, &error);
-	    if (status == MB_SUCCESS
-		    && esf.esffp != NULL)
-		    esffile_open = MB_YES;
-	    if (status == MB_FAILURE
-		    && error == MB_ERROR_OPEN_FAIL)
-		    {
-		    esffile_open = MB_NO;
-		    fprintf(stderr, "\nUnable to open new edit save file %s\n",
-			esf.esffile);
-		    }
-	    else if (status == MB_FAILURE
-		    && error == MB_ERROR_MEMORY_FAIL)
-		    {
-		    esffile_open = MB_NO;
-		    fprintf(stderr, "\nUnable to allocate memory for edits in esf file %s\n", esf.esffile);
-		    }
-	    /* reset message */
-	    fprintf(stderr, "%d old edits sorted...\n",esf.nedit);
-	    }
-
-	/* read */
-	done = MB_NO;
-	start = 0;
-	time_d_lastping = 0.0;
-	fprintf(stderr, "Processing data...\n");
-	while (done == MB_NO)
-	    {
-	    if (verbose > 1) fprintf(stderr,"\n");
-
-	    /* read next record */
-	    error = MB_ERROR_NO_ERROR;
-	    status = mb_get(verbose,
-			    mbio_ptr,&kind,&pingsread,
-			    cur_ping.time_i,&cur_ping.time_d,
-			    &cur_ping.navlon,&cur_ping.navlat,
-			    &cur_ping.speed,&cur_ping.heading,
-			    &distance,&altitude,&sonardepth,
-			    &cur_ping.beams_bath,&beams_amp,&pixels_ss,
-			    cur_ping.beamflag,cur_ping.bath,amp,
-			    cur_ping.bathacrosstrack,cur_ping.bathalongtrack,
-			    ss,ssacrosstrack,ssalongtrack,
-			    comment,
-			    &error);
-	    if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  current data status:\n");
-		fprintf(stderr,"dbg2    kind:       %d\n",kind);
-		fprintf(stderr,"dbg2    status:     %d\n",status);
-		fprintf(stderr,"dbg2    ndata:      %d\n",ndata);
-		fprintf(stderr,"dbg2    nflagesf:   %d\n",nflagesf);
-		fprintf(stderr,"dbg2    nunflagesf: %d\n",nunflagesf);
-		fprintf(stderr,"dbg2    nzeroesf:   %d\n",nzeroesf);
-		fprintf(stderr,"dbg2    nflag:      %d\n",nflag);
-		fprintf(stderr,"dbg2    nzero:      %d\n",nzero);
-		}
-	    if (status == MB_SUCCESS && kind == MB_DATA_DATA)
-		{
-		/* save original beamflags */
-		for (i=0;i<cur_ping.beams_bath;i++)
-		    {
-		    cur_ping.beamflagorg[i] = cur_ping.beamflag[i];
-		    }
-
-		/* detect multiple pings with the same time stamps */
-		if (cur_ping.time_d == time_d_lastping)
-			{
-			pingmultiplicity++;
-			}
-		else
-			{
-			pingmultiplicity = 0;
-			}
-		time_d_lastping = cur_ping.time_d;
-
-		/* apply saved edits */
-		status = mb_esf_apply(verbose, &esf,
-		    		cur_ping.time_d, pingmultiplicity, cur_ping.beams_bath,
-				cur_ping.beamflag, &error);
-
-		/* update counters */
-		for (i=0;i<cur_ping.beams_bath;i++)
-		    {
-		    if (cur_ping.beamflag[i] != cur_ping.beamflagorg[i])
-		    	{
-			if (mb_beam_ok(cur_ping.beamflag[i]))
-			    nunflagesf++;
-			else
-			    nflagesf++;
-			}
-		    }
-		ndata++;
-
-	/* get mbio descriptor */
-	mb_io_ptr = (struct mb_io_struct *) mbio_ptr;
-
-	/* get data structure pointer */
-	store = (struct mbsys_simrad2_struct *) mb_io_ptr->store_data;
-
-	sim_ping = (struct mbsys_simrad2_ping_struct *) store->ping;
-
-	/* get ping no */
-	ping_no = sim_ping ->png_count;
-
-	/* if ping in rules get it and flag beams */
-	if (MB_SUCCESS == find_ping(verbose,ping_no,&line->pings,MB_NO,&ping,&error)) {
-	  beam = ping->beams;
-	  while (NULL != beam) {
-	    beam_no = beam->beam;
-			if (mb_beam_ok(cur_ping.beamflag[beam_no]))
-			    {
-			    if (verbose >= 1)
-			    fprintf(stderr,"z: %4d %2d %2d %2.2d:%2.2d:%2.2d.%6.6d  %4d %8.2f\n",
-					    cur_ping.time_i[0],
-					    cur_ping.time_i[1],
-					    cur_ping.time_i[2],
-					    cur_ping.time_i[3],
-					    cur_ping.time_i[4],
-					    cur_ping.time_i[5],
-					    cur_ping.time_i[6],
-					    i,cur_ping.bath[beam_no]);
-			    if (mode <= 2)
-				{
-				cur_ping.beamflag[beam_no]
-					    = MB_FLAG_FLAG + MB_FLAG_FILTER;
-				nflag++;
-				mb_ess_save(verbose, &esf, cur_ping.time_d,
-						beam_no + pingmultiplicity * MB_ESF_MULTIPLICITY_FACTOR,
-						MBP_EDIT_FILTER, &error);
-				}
-			    else
-				{
-				cur_ping.beamflag[beam_no] = MB_FLAG_NULL;
-				nzero++;
-				mb_ess_save(verbose, &esf, cur_ping.time_d,
-						beam_no + pingmultiplicity * MB_ESF_MULTIPLICITY_FACTOR,
-						MBP_EDIT_ZERO, &error);
-				}
-			    }
-
-	    beam = beam->next;
-	  }
-
-	    /* write out edits from completed pings */
-	    if (status == MB_SUCCESS
-		|| done == MB_YES)
-		{
-		    for (i=0;i<cur_ping.beams_bath;i++)
-			{
-			if (cur_ping.beamflag[i] !=
-				cur_ping.beamflagorg[i])
-			    {
-			    if (mb_beam_ok(cur_ping.beamflag[i]))
-				    action = MBP_EDIT_UNFLAG;
-			    else if (mb_beam_check_flag_filter2(cur_ping.beamflag[i]))
-				    action = MBP_EDIT_FILTER;
-			    else if (mb_beam_check_flag_filter(cur_ping.beamflag[i]))
-				    action = MBP_EDIT_FILTER;
-			    else if (cur_ping.beamflag[i] != MB_FLAG_NULL)
-				    action = MBP_EDIT_FLAG;
-			    else
-				    action = MBP_EDIT_ZERO;
-			    mb_esf_save(verbose, &esf,
-					    cur_ping.time_d,
-					    i + pingmultiplicity * MB_ESF_MULTIPLICITY_FACTOR,
-					    action, &error);
-			    }
-			}
-		}
-	}
-		}
-	    else if (error > MB_ERROR_NO_ERROR)
-		{
-		done = MB_YES;
-		}
-	    }
-
-	/* close the files */
-	status = mb_close(verbose,&mbio_ptr,&error);
-
-	/* close edit save file */
-	status = mb_esf_close(verbose, &esf, &error);
-
-	/* update mbprocess parameter file */
-	if (esffile_open == MB_YES)
-	    {
-	    /* update mbprocess parameter file */
-	    status = mb_pr_update_format(verbose, swathfile,
-			MB_YES, format,
-			&error);
-	    status = mb_pr_update_edit(verbose, swathfile,
-			MBP_EDIT_ON, esffile,
-			&error);
-	    }
-
-	/* check memory */
-	if (verbose >= 4)
-		status = mb_memory_list(verbose,&error);
-
-	/* increment the total counting variables */
-	nfiletot++;
-	ndatatot += ndata;
-	nflagesftot += nflagesf;
-	nunflagesftot += nunflagesf;
-	nzeroesftot += nzeroesf;
-	nflagtot += nflag;
-	nzerotot += nzero;
-
-	/* give the statistics */
-	if (verbose >= 0)
-		{
-		fprintf(stderr,"%d bathymetry data records processed\n",ndata);
-		if (esf.nedit > 0)
-			{
-			fprintf(stderr,"%d beams flagged in old esf file\n",nflagesf);
-			fprintf(stderr,"%d beams unflagged in old esf file\n",nunflagesf);
-			fprintf(stderr,"%d beams zeroed in old esf file\n",nzeroesf);
-			}
-		fprintf(stderr,"%d beams flagged\n",nflag);
-		fprintf(stderr,"%d beams zeroed\n",nzero);
-		}
-
-	    } /* if usable_rule */
-
-	/* figure out whether and what to read next */
-        if (read_datalist == MB_YES)
-                {
-		if ((status = mb_datalist_read(verbose,datalist,
-			    swathfile,&format,&file_weight,&error))
-			    == MB_SUCCESS)
-                        read_data = MB_YES;
-                else
-                        read_data = MB_NO;
-                }
-        else
-                {
-                read_data = MB_NO;
-                }
-
-	/* end loop over files in list */
-	}
-        if (read_datalist == MB_YES)
-		mb_datalist_close(verbose,&datalist,&error);
-
-	/* give the total statistics */
-	if (verbose >= 0)
-		{
-		fprintf(stderr,"\nMBclean Processing Totals:\n");
-		fprintf(stderr,"-------------------------\n");
-		fprintf(stderr,"%d total swath data files processed\n",nfiletot);
-		fprintf(stderr,"%d total bathymetry data records processed\n",ndatatot);
-		fprintf(stderr,"%d total beams flagged in old esf files\n",nflagesftot);
-		fprintf(stderr,"%d total beams unflagged in old esf files\n",nunflagesftot);
-		fprintf(stderr,"%d total beams zeroed in old esf files\n",nzeroesftot);
-		fprintf(stderr,"%d total beams flagged\n",nflagtot);
-		fprintf(stderr,"%d total beams zeroed\n",nzerotot);
-		}
-
-	/* set program status */
-	status = MB_SUCCESS;
-
-	/* free memory associated with lines. */
-	for (i=0; i < no_lines; i++)
-	      {
-	      free_pings(verbose, &lines[i]->pings, &error);
-#ifdef USE_MB_MALLOC
-	      mb_freed(verbose,__FILE__,__LINE__,(void **) &lines[i], &error);
-#else
-	      free(lines[i]);
-#endif
-	      }
-
-	/* check memory */
-	if (verbose >= 4)
-		status = mb_memory_list(verbose,&error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  Program <%s> completed\n",
-			program_name);
-		fprintf(stderr,"dbg2  Ending status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* end it all */
-	exit(error);
-}
-/*--------------------------------------------------------------------*/
-int mbclean_save_edit(int verbose, FILE *sofp, double time_d, int beam, int action, int *error)
-{
-	/* local variables */
-	char	*function_name = "mbclean_save_edit";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-
-		fprintf(stderr,"dbg2       sofp:            %p\n",(void *)sofp);
-		fprintf(stderr,"dbg2       time_d:          %f\n",time_d);
-		fprintf(stderr,"dbg2       beam:            %d\n",beam);
-		fprintf(stderr,"dbg2       action:          %d\n",action);
-		}
-	/* write out the edit */
-fprintf(stderr,"OUTPUT EDIT: %f %d %d\n",time_d,beam,action);
-	if (sofp != NULL)
-	    {
-#ifdef BYTESWAPPED
-	    mb_swap_double(&time_d);
-	    beam = mb_swap_int(beam);
-	    action = mb_swap_int(action);
-#endif
-	    if (fwrite(&time_d, sizeof(double), 1, sofp) != 1)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	    if (status == MB_SUCCESS
-		&& fwrite(&beam, sizeof(int), 1, sofp) != 1)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	    if (status == MB_SUCCESS
-		&& fwrite(&action, sizeof(int), 1, sofp) != 1)
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_WRITE_FAIL;
-		}
-	    }
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:       %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:      %d\n",status);
-		}
-
-	/* return */
-	return(status);
-}
-
-/*--------------------------------------------------------------------*/
-int find_line(int verbose, char* line_name, struct neptune_line_tree **node, int create,
-	      struct neptune_line_tree **result, int *nlines, int *error)
-{
-	int	status = MB_SUCCESS;
-	int	comp;
-
-	if (NULL == *node) {
-	  if (MB_NO == create)
-	    return MB_FAILURE;
-
-#ifdef USE_MB_MALLOC
-	    status = mb_mallocd(verbose,__FILE__,__LINE__,sizeof(struct neptune_line_tree),
-			(void **)result,error);
-#else
-	    *result = malloc(sizeof(struct neptune_line_tree));
-#endif
-	    if (MB_SUCCESS == status)
-	      {
-		strncpy((*result)->name,line_name,LINE_NAME_LENGTH);
-		(*result)->name[LINE_NAME_LENGTH] =0;
-		(*result)->prev = NULL;
-		(*result)->next = NULL;
-		(*result)->pings = NULL;
-		(*nlines)++;
-		*node = *result;
-	      }
-	    return status;
-	}
-
-	comp = strncmp(line_name,(*node)->name,LINE_NAME_LENGTH);
-	if (0 == comp)
-	  {
-	    *result = *node;
-	    return status;
-	  }
-	if (0 > comp)
-	  return find_line(verbose, line_name, &((*node)->prev), create, result, nlines, error);
-	  return find_line(verbose, line_name, &((*node)->next), create, result, nlines, error);
-
-}
-/*--------------------------------------------------------------------*/
-int find_ping(int verbose, int ping, struct neptune_ping_tree **node, int create,
-	      struct neptune_ping_tree **result, int *error)
-{
-	int	status = MB_SUCCESS;
-
-	if (NULL == *node) {
-	  if (MB_NO == create)
-	    return MB_FAILURE;
-
-#ifdef USE_MB_MALLOC
-	    status = mb_mallocd(verbose,__FILE__,__LINE__,sizeof(struct neptune_ping_tree),
-			(void **)result,error);
-#else
-	    *result = malloc(sizeof(struct neptune_ping_tree));
-#endif
-	    if (MB_SUCCESS == status)
-	      {
-		(*result)->ping = ping;
-		(*result)->prev = NULL;
-		(*result)->next = NULL;
-		(*result)->beams = NULL;
-		*node = *result;
-	      }
-	    return status;
-	}
-
-	if (ping == (*node)->ping)
-	  {
-	    *result = *node;
-	    return status;
-	  }
-	if ((*node)->ping > ping)
-	  return find_ping(verbose, ping, &((*node)->prev), create, result, error);
-	  return find_ping(verbose, ping, &((*node)->next), create, result, error);
-
-}
-/*--------------------------------------------------------------------*/
-
-int line_array(struct neptune_line_tree *line, struct neptune_line_tree ***array, int *n)
-{
-  if (NULL == line)
-    return MB_SUCCESS;
-
-  line_array(line->prev,array,n);
-  (*array)[(*n)++] = line;
-  line_array(line->next,array,n);
-  return MB_SUCCESS;
-}
-
-/*--------------------------------------------------------------------*/
-
-int print_pings(FILE *output, struct neptune_ping_tree *node)
-{
-  struct neptune_beam_list *beam;
-
-  if (NULL == node)
-    return MB_SUCCESS;
-
-  print_pings(output, node->prev);
-
-  fprintf(output, "\tPing %d beams: ", node->ping);
-  beam = node->beams;
-  while (NULL != beam)
-    {
-      fprintf(output, " %d", beam->beam);
-      beam = beam->next;
-    }
-  fprintf(output, "\n");
-
-  print_pings(output, node->next);
-  return MB_SUCCESS;
-}
-
-/*--------------------------------------------------------------------*/
-
-int free_pings(int verbose, struct neptune_ping_tree **node, int *error)
-{
-  struct neptune_beam_list *beam;
-  struct neptune_beam_list *nextbeam;
-
-  if (NULL == *node)
-    return MB_SUCCESS;
-
-  free_pings(verbose,&(*node)->prev,error);
-  free_pings(verbose,&(*node)->next,error);
-
-  beam = (*node)->beams;
-  while (NULL != beam)
-    {
-      nextbeam = beam->next;
-#ifdef USE_MB_MALLOC
-      mb_freed(verbose,__FILE__,__LINE__,(void **) &beam, error);
-#else
-      free(beam);
-#endif
-      beam = nextbeam;
-    }
-#ifdef USE_MB_MALLOC
-  mb_freed(verbose,__FILE__,__LINE__,(void **) node, error);
-#else
-  free(*node);
-#endif
-
-  return MB_SUCCESS;
-}
-
-
-/*--------------------------------------------------------------------*/
diff --git a/src/utilities/mbpreprocess.c b/src/utilities/mbpreprocess.c
deleted file mode 100644
index fece8ce..0000000
--- a/src/utilities/mbpreprocess.c
+++ /dev/null
@@ -1,2314 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbpreprocess.c	1/8/2014
- *    $Id: mbpreprocess.c 2230 2015-02-19 00:39:00Z caress $
- *
- *    Copyright (c) 2014-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * MBpreprocess handles preprocessing of swath sonar data as part of setting
- * up an MB-System processing structure for a dataset.
- *
- * This program replaces the several format-specific preprocessing programs
- * found in MB-System version 5 releases with a single program for version 6.
- *
- * Author:	D. W. Caress
- * Date:	January 8, 2014
- *
- *
- */
-
-/* source file version string */
-static char version_id[] = "$Id: mbpreprocess.c 2230 2015-02-19 00:39:00Z caress $";
-
-/* standard include files */
-#include <stdio.h>
-#include <stdlib.h>
-#include <getopt.h>
-#include <unistd.h>
-#include <math.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-
-/* MBIO include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_define.h"
-#include "mb_io.h"
-#include "mb_aux.h"
-
-/* local defines */
-#define MBPREPROCESS_ALLOC_CHUNK 1000
-
-#define MBPREPROCESS_MERGE_OFF 		0
-#define MBPREPROCESS_MERGE_FILE 	1
-#define MBPREPROCESS_MERGE_ASYNC 	2
-#define MBPREPROCESS_TIMESHIFT_OFF 	0
-#define MBPREPROCESS_TIMESHIFT_FILE 	1
-#define MBPREPROCESS_TIMESHIFT_CONSTANT 2
-
-#define MBPREPROCESS_TIMESHIFT_APPLY_NONE		0x00
-#define MBPREPROCESS_TIMESHIFT_APPLY_NAV		0x01
-#define MBPREPROCESS_TIMESHIFT_APPLY_SENSORDEPTH	0x02
-#define MBPREPROCESS_TIMESHIFT_APPLY_HEADING		0x04
-#define MBPREPROCESS_TIMESHIFT_APPLY_ALTITUDE		0x08
-#define MBPREPROCESS_TIMESHIFT_APPLY_ATTITUDE		0x10
-#define MBPREPROCESS_TIMESHIFT_APPLY_ALL_ANCILLIARY	0x7F
-#define MBPREPROCESS_TIMESHIFT_APPLY_SURVEY		0x80
-#define MBPREPROCESS_TIMESHIFT_APPLY_ALL		0xFF
-
-/*--------------------------------------------------------------------*/
-
-int main (int argc, char **argv)
-{
-	char program_name[] = "mbpreprocess";
-	char help_message[] =  "mbpreprocess handles preprocessing of swath sonar data as part of setting up an MB-System processing structure for a dataset.\n";
-	char usage_message[] = "mbpreprocess --verbose --help --merge-nav-from-file=file";
-	extern char *optarg;
-	int	option_index;
-	int	errflg = 0;
-	int	c;
-	int	help = 0;
-
-	/* MBIO status variables */
-	int	status = MB_SUCCESS;
-	int	verbose = 0;
-	int	error = MB_ERROR_NO_ERROR;
-	char	*message;
-
-	/* command line option definitions */
-	/* mbpreprocess --verbose
-	 * 		--help
-	 * 		--input=datalist
-	 * 		--format=format_id
-	 * 		--nav_file=file
-	 * 		--nav_file_format=format_id
-	 * 		--nav_async=record_kind
-	 * 		--sensordepth_file=file
-	 * 		--sensordepth_file_format=format_id
-	 * 		--sensordepth_async=record_kind
-	 * 		--heading_file=file
-	 * 		--heading_file_format=format_id
-	 * 		--heading_async=record_kind
-	 * 		--altitude_file=file
-	 * 		--altitude_file_format=format_id
-	 * 		--altitude_async=record_kind
-	 * 		--attitude_file=file
-	 * 		--attitude_file_format=format_id
-	 * 		--attitude_async=record_kind
-	 * 		--timeshift_file=file
-	 * 		--timeshift_constant=value
-	 * 		--timeshift_apply_nav=boolean
-	 * 		--timeshift_apply_sensordepth=boolean
-	 * 		--timeshift_apply_heading=boolean
-	 * 		--timeshift_apply_attitude=boolean
-	 * 		--timeshift_apply_all_ancilliary=boolean
-	 * 		--timeshift_apply_survey=boolean
-	 * 		--timeshift_apply_all=boolean
-	 * 		--sensor_offset_file=offset_file
-	 * 		--sonar_offsets=offset_x/offset_y/offset_z/offset_heading/offset_roll/offset_pitch
-	 * 		--vru_offsets=offset_x/offset_y/offset_z/offset_heading/offset_roll/offset_pitch
-	 * 		--navigation_offsets=offset_x/offset_y/offset_z/offset_heading/offset_roll/offset_pitch
-	 * 		--no_change_survey
-	 */
-	static struct option options[] =
-		{
-		{"verbose",			no_argument, 		NULL, 		0},
-		{"help",			no_argument, 		NULL, 		0},
-		{"verbose",			no_argument, 		NULL, 		0},
-		{"input",			required_argument, 	NULL, 		0},
-		{"format",			required_argument, 	NULL, 		0},
-		{"nav_file",			required_argument, 	NULL, 		0},
-		{"nav_file_format",		required_argument, 	NULL, 		0},
-		{"nav_async",			required_argument, 	NULL, 		0},
-		{"sensordepth_file",		required_argument, 	NULL, 		0},
-		{"sensordepth_file_format",	required_argument, 	NULL, 		0},
-		{"sensordepth_async",		required_argument, 	NULL, 		0},
-		{"heading_file",		required_argument, 	NULL, 		0},
-		{"heading_file_format",		required_argument, 	NULL, 		0},
-		{"heading_async",		required_argument, 	NULL, 		0},
-		{"altitude_file",		required_argument, 	NULL, 		0},
-		{"altitude_file_format",	required_argument, 	NULL, 		0},
-		{"altitude_async",		required_argument, 	NULL, 		0},
-		{"attitude_file",		required_argument, 	NULL, 		0},
-		{"attitude_file_format",	required_argument, 	NULL, 		0},
-		{"attitude_async",		required_argument, 	NULL, 		0},
-		{"timeshift_file",		required_argument, 	NULL, 		0},
-		{"timeshift_constant",		required_argument, 	NULL, 		0},
-		{"timeshift_apply_nav",		no_argument, 		NULL, 		0},
-		{"timeshift_apply_sensordepth",	no_argument, 		NULL, 		0},
-		{"timeshift_apply_heading",	no_argument, 		NULL, 		0},
-		{"timeshift_apply_attitude",	no_argument, 		NULL, 		0},
-		{"timeshift_apply_all_ancilliary",	no_argument, 		NULL, 		0},
-		{"timeshift_apply_survey",	no_argument, 		NULL, 		0},
-		{"timeshift_apply_all",		no_argument, 		NULL, 		0},
-		{"sensor_offset_file",		required_argument, 	NULL, 		0},
-		{"sonar_offsets",		required_argument, 	NULL, 		0},
-		{"vru_offsets",			required_argument, 	NULL, 		0},
-		{"navigation_offsets",		required_argument, 	NULL, 		0},
-		{"no_change_survey",		no_argument,		NULL,		0},
-		{NULL,				0, 			NULL, 		0}
-		};
-
-	/* asynchronous navigation, heading, attitude data */
-	int	nav_mode = MBPREPROCESS_MERGE_OFF;
-	mb_path	nav_file;
-	int	nav_file_format = 0;
-	int	nav_async = MB_DATA_DATA;
-	int	nav_num = 0;
-	int	nav_alloc = 0;
-	double	*nav_time_d = NULL;
-	double	*nav_navlon = NULL;
-	double	*nav_navlat = NULL;
-	double	*nav_speed = NULL;
-
-	int	sensordepth_mode = MBPREPROCESS_MERGE_OFF;
-	mb_path	sensordepth_file;
-	int	sensordepth_file_format = 0;
-	int	sensordepth_async = MB_DATA_DATA;
-	int	sensordepth_num = 0;
-	int	sensordepth_alloc = 0;
-	double	*sensordepth_time_d = NULL;
-	double	*sensordepth_sensordepth = NULL;
-
-	int	heading_mode = MBPREPROCESS_MERGE_OFF;
-	mb_path	heading_file;
-	int	heading_file_format = 0;
-	int	heading_async = MB_DATA_DATA;
-	int	heading_num = 0;
-	int	heading_alloc = 0;
-	double	*heading_time_d = NULL;
-	double	*heading_heading = NULL;
-
-	int	altitude_mode = MBPREPROCESS_MERGE_OFF;
-	mb_path	altitude_file;
-	int	altitude_file_format = 0;
-	int	altitude_async = MB_DATA_DATA;
-	int	altitude_num = 0;
-	int	altitude_alloc = 0;
-	double	*altitude_time_d = NULL;
-	double	*altitude_altitude = NULL;
-
-	int	attitude_mode = MBPREPROCESS_MERGE_OFF;
-	mb_path	attitude_file;
-	int	attitude_file_format = 0;
-	int	attitude_async = MB_DATA_DATA;
-	int	attitude_num = 0;
-	int	attitude_alloc = 0;
-	double	*attitude_time_d = NULL;
-	double	*attitude_roll = NULL;
-	double	*attitude_pitch = NULL;
-	double	*attitude_heave = NULL;
-
-	int	timeshift_mode = MBPREPROCESS_TIMESHIFT_OFF;
-	mb_u_char timeshift_apply = MBPREPROCESS_TIMESHIFT_APPLY_NONE;
-	mb_path	timeshift_file;
-	int	timeshift_format = 0;
-	int	timeshift_num = 0;
-	int	timeshift_alloc = 0;
-	double	*timeshift_time_d = NULL;
-	double	*timeshift_timeshift = NULL;
-	double	timeshift_constant = 0.0;
-	
-	mb_path	offset_file;
-	
-	int	sonar_offset_mode = MB_NO;
-	double	sonar_offset_x = 0.0;
-	double	sonar_offset_y = 0.0;
-	double	sonar_offset_z = 0.0;
-	double	sonar_offset_heading = 0.0;
-	double	sonar_offset_roll = 0.0;
-	double	sonar_offset_pitch = 0.0;
-	
-	int	vru_offset_mode = MB_NO;
-	double	vru_offset_x = 0.0;
-	double	vru_offset_y = 0.0;
-	double	vru_offset_z = 0.0;
-	double	vru_offset_heading = 0.0;
-	double	vru_offset_roll = 0.0;
-	double	vru_offset_pitch = 0.0;
-	
-	int	navigation_offset_mode = MB_NO;
-	double	navigation_offset_x = 0.0;
-	double	navigation_offset_y = 0.0;
-	double	navigation_offset_z = 0.0;
-	double	navigation_offset_heading = 0.0;
-	double	navigation_offset_roll = 0.0;
-	double	navigation_offset_pitch = 0.0;
-	
-	int	no_change_survey = MB_NO;
-	
-	int	timestamp_changed = MB_NO;
-	int	nav_changed = MB_NO;
-	int	heading_changed = MB_NO;
-	int	sensordepth_changed = MB_NO;
-	int	altitude_changed = MB_NO;
-	int	attitude_changed = MB_NO;
-
-	/* MBIO read control parameters */
-	int	read_datalist = MB_NO;
-	int	read_data;
-	mb_path	read_file;
-	void	*datalist;
-	int	look_processed = MB_DATALIST_LOOK_UNSET;
-	double	file_weight;
-	int	format = 0;
-	int	iformat;
-	int	oformat;
-	int	pings;
-	int	lonflip;
-	double	bounds[4];
-	int	btime_i[7];
-	int	etime_i[7];
-	double	btime_d;
-	double	etime_d;
-	double	speedmin;
-	double	timegap;
-	mb_path	ifile;
-	mb_path	ofile;
-	mb_path	fileroot;
-	int	beams_bath;
-	int	beams_amp;
-	int	pixels_ss;
-	int	obeams_bath;
-	int	obeams_amp;
-	int	opixels_ss;
-
-	/* MBIO read values */
-	void	*imbio_ptr = NULL;
-	void	*ombio_ptr = NULL;
-	void	*istore_ptr = NULL;
-	int	kind;
-	int	time_i[7];
-	double	time_d;
-	double	navlon;
-	double	navlat;
-	double	speed;
-	double	heading;
-	double	distance;
-	double	altitude;
-	double	sensordepth;
-	double	draft;
-	double	roll;
-	double	pitch;
-	double	heave;
-	char	*beamflag = NULL;
-	double	*bath = NULL;
-	double	*bathacrosstrack = NULL;
-	double	*bathalongtrack = NULL;
-	double	*amp = NULL;
-	double	*ss = NULL;
-	double	*ssacrosstrack = NULL;
-	double	*ssalongtrack = NULL;
-	char	comment[MB_COMMENT_MAXLINE];
-	double	navlon_org;
-	double	navlat_org;
-	double	speed_org;
-	double	heading_org;
-	double	altitude_org;
-	double	sensordepth_org;
-	double	draft_org;
-	double	roll_org;
-	double	pitch_org;
-	double	heave_org;
-	double	depth_offset_use, depth_offset_org, depth_offset_change;
-	double	range, alphar, betar;
-	double	lever_x, lever_y, lever_z;
-	double	headingx, headingy, mtodeglon, mtodeglat;
-
-	/* arrays for asynchronous data accessed using mb_extract_nnav() */
-	int	nanavmax = MB_NAV_MAX;
-	int	nanav;
-	int	atime_i[7*MB_NAV_MAX];
-	double	atime_d[MB_NAV_MAX];
-	double	alon[MB_NAV_MAX];
-	double	alat[MB_NAV_MAX];
-	double	aspeed[MB_NAV_MAX];
-	double	aheading[MB_NAV_MAX];
-	double	asensordepth[MB_NAV_MAX];
-	double	aroll[MB_NAV_MAX];
-	double	apitch[MB_NAV_MAX];
-	double	aheave[MB_NAV_MAX];
-	
-	/* counts of records read and written */
-	int	n_rf_data = 0;
-	int	n_rf_comment = 0;
-	int	n_rf_nav = 0;
-	int	n_rf_nav1 = 0;
-	int	n_rf_nav2 = 0;
-	int	n_rf_nav3 = 0;
-	int	n_rf_att = 0;
-	int	n_rf_att1 = 0;
-	int	n_rf_att2 = 0;
-	int	n_rf_att3 = 0;
-	int	n_rt_data = 0;
-	int	n_rt_comment = 0;
-	int	n_rt_nav = 0;
-	int	n_rt_nav1 = 0;
-	int	n_rt_nav2 = 0;
-	int	n_rt_nav3 = 0;
-	int	n_rt_att = 0;
-	int	n_rt_att1 = 0;
-	int	n_rt_att2 = 0;
-	int	n_rt_att3 = 0;
-	
-	int	n_wf_data = 0;
-	int	n_wf_comment = 0;
-	int	n_wf_nav = 0;
-	int	n_wf_nav1 = 0;
-	int	n_wf_nav2 = 0;
-	int	n_wf_nav3 = 0;
-	int	n_wf_att = 0;
-	int	n_wf_att1 = 0;
-	int	n_wf_att2 = 0;
-	int	n_wf_att3 = 0;
-	int	n_wt_data = 0;
-	int	n_wt_comment = 0;
-	int	n_wt_nav = 0;
-	int	n_wt_nav1 = 0;
-	int	n_wt_nav2 = 0;
-	int	n_wt_nav3 = 0;
-	int	n_wt_att = 0;
-	int	n_wt_att1 = 0;
-	int	n_wt_att2 = 0;
-	int	n_wt_att3 = 0;
-	
-	int	testformat;
-	int	interp_status = MB_SUCCESS;
-	int	interp_error = MB_ERROR_NO_ERROR;
-	double	timeshift;
-	int	jsurvey = 0;
-	int	jnav = 0;
-	int	jsensordepth = 0;
-	int	jheading = 0;
-	int	jaltitude = 0;
-	int	jattitude = 0;
-	int	i, j, n;
-
-	/* get current default values */
-	status = mb_defaults(verbose,&format,&pings,&lonflip,bounds,
-		btime_i,etime_i,&speedmin,&timegap);
-
-	/* set default input to datalist.mb-1 */
-	strcpy (read_file, "datalist.mb-1");
-
-	/* process argument list */
-	while ((c = getopt_long(argc, argv, "", options, &option_index)) != -1)
-	  switch (c)
-		{
-		/* long options all return c=0 */
-		case 0:
-			/* verbose */
-			if (strcmp("verbose", options[option_index].name) == 0)
-				{
-				verbose++;
-				}
-			
-			/* help */
-			else if (strcmp("help", options[option_index].name) == 0)
-				{
-				help = MB_YES;
-				}
-				
-			/*-------------------------------------------------------
-			 * Define input file and format (usually a datalist) */
-			
-			/* input */
-			else if (strcmp("input", options[option_index].name) == 0)
-				{
-				strcpy(read_file, optarg);
-				}
-			
-			/* format */
-			else if (strcmp("format", options[option_index].name) == 0)
-				{
-				n = sscanf(optarg, "%d", &format);
-				}
-				
-			/*-------------------------------------------------------
-			 * Define source of navigation - could be an external file
-			 * or an internal asynchronous record */
-			
-			/* nav_file */
-			else if (strcmp("nav_file", options[option_index].name) == 0)
-				{
-				strcpy(nav_file, optarg);
-				nav_mode = MBPREPROCESS_MERGE_FILE;
-				}
-			
-			/* nav_file_format */
-			else if (strcmp("nav_file_format", options[option_index].name) == 0)
-				{
-				n = sscanf(optarg, "%d", &nav_file_format);
-				}
-			
-			/* nav_async */
-			else if (strcmp("nav_async", options[option_index].name) == 0)
-				{
-				n = sscanf(optarg, "%d", &nav_async);
-				if (n == 1)
-					nav_mode = MBPREPROCESS_MERGE_ASYNC;
-				}
-				
-			/*-------------------------------------------------------
-			 * Define source of sensordepth - could be an external file
-			 * or an internal asynchronous record */
-			
-			/* sensordepth_file */
-			else if (strcmp("sensordepth_file", options[option_index].name) == 0)
-				{
-				strcpy(sensordepth_file, optarg);
-				sensordepth_mode = MBPREPROCESS_MERGE_FILE;
-				}
-			
-			/* sensordepth_file_format */
-			else if (strcmp("sensordepth_file_format", options[option_index].name) == 0)
-				{
-				n = sscanf(optarg, "%d", &sensordepth_file_format);
-				}
-			
-			/* sensordepth_async */
-			else if (strcmp("sensordepth_async", options[option_index].name) == 0)
-				{
-				n = sscanf(optarg, "%d", &sensordepth_async);
-				if (n == 1)
-					sensordepth_mode = MBPREPROCESS_MERGE_ASYNC;
-				}
-				
-			/*-------------------------------------------------------
-			 * Define source of heading - could be an external file
-			 * or an internal asynchronous record */
-			
-			/* heading_file */
-			else if (strcmp("heading_file", options[option_index].name) == 0)
-				{
-				strcpy(heading_file, optarg);
-				heading_mode = MBPREPROCESS_MERGE_FILE;
-				}
-			
-			/* heading_file_format */
-			else if (strcmp("heading_file_format", options[option_index].name) == 0)
-				{
-				n = sscanf(optarg, "%d", &heading_file_format);
-				}
-			
-			/* heading_async */
-			else if (strcmp("heading_async", options[option_index].name) == 0)
-				{
-				n = sscanf(optarg, "%d", &heading_async);
-				if (n == 1)
-					heading_mode = MBPREPROCESS_MERGE_ASYNC;
-				}
-				
-			/*-------------------------------------------------------
-			 * Define source of altitude - could be an external file
-			 * or an internal asynchronous record */
-			
-			/* altitude_file */
-			else if (strcmp("altitude_file", options[option_index].name) == 0)
-				{
-				strcpy(altitude_file, optarg);
-				altitude_mode = MBPREPROCESS_MERGE_FILE;
-				}
-			
-			/* altitude_file_format */
-			else if (strcmp("altitude_file_format", options[option_index].name) == 0)
-				{
-				n = sscanf(optarg, "%d", &altitude_file_format);
-				}
-			
-			/* altitude_async */
-			else if (strcmp("altitude_async", options[option_index].name) == 0)
-				{
-				n = sscanf(optarg, "%d", &altitude_async);
-				if (n == 1)
-					altitude_mode = MBPREPROCESS_MERGE_ASYNC;
-				}
-				
-			/*-------------------------------------------------------
-			 * Define source of attitude - could be an external file
-			 * or an internal asynchronous record */
-			
-			/* attitude_file */
-			else if (strcmp("attitude_file", options[option_index].name) == 0)
-				{
-				strcpy(attitude_file, optarg);
-				attitude_mode = MBPREPROCESS_MERGE_FILE;
-				}
-			
-			/* attitude_file_format */
-			else if (strcmp("attitude_file_format", options[option_index].name) == 0)
-				{
-				n = sscanf(optarg, "%d", &attitude_file_format);
-				}
-			
-			/* attitude_async */
-			else if (strcmp("attitude_async", options[option_index].name) == 0)
-				{
-				n = sscanf(optarg, "%d", &attitude_async);
-				if (n == 1)
-					attitude_mode = MBPREPROCESS_MERGE_ASYNC;
-				}
-				
-			/*-------------------------------------------------------
-			 * Define source of timeshift - could be an external file
-			 * or single value. Also define which data the timeshift model
-			 * will be applied to - nav, sensordepth, heading, attitude,
-			 * or all. */
-			
-			/* timeshift_file */
-			else if (strcmp("timeshift_file", options[option_index].name) == 0)
-				{
-				strcpy(timeshift_file, optarg);
-				timeshift_mode = MBPREPROCESS_TIMESHIFT_FILE;
-				}
-			
-			/* timeshift_constant */
-			else if (strcmp("timeshift_constant", options[option_index].name) == 0)
-				{
-				n = sscanf(optarg, "%lf", &timeshift_constant);
-				if (n == 1)
-					timeshift_mode = MBPREPROCESS_TIMESHIFT_CONSTANT;
-				}
-			
-			/* timeshift_apply_nav */
-			else if (strcmp("timeshift_apply_nav", options[option_index].name) == 0)
-				{
-				timeshift_apply =  timeshift_apply | MBPREPROCESS_TIMESHIFT_APPLY_NAV;
-				}
-			
-			/* timeshift_apply_sensordepth */
-			else if (strcmp("timeshift_apply_sensordepth", options[option_index].name) == 0)
-				{
-				timeshift_apply =  timeshift_apply | MBPREPROCESS_TIMESHIFT_APPLY_SENSORDEPTH;
-				}
-			
-			/* timeshift_apply_heading */
-			else if (strcmp("timeshift_apply_heading", options[option_index].name) == 0)
-				{
-				timeshift_apply =  timeshift_apply | MBPREPROCESS_TIMESHIFT_APPLY_HEADING;
-				}
-			
-			/* timeshift_apply_attitude */
-			else if (strcmp("timeshift_apply_attitude", options[option_index].name) == 0)
-				{
-				timeshift_apply =  timeshift_apply | MBPREPROCESS_TIMESHIFT_APPLY_ATTITUDE;
-				}
-			
-			/* timeshift_apply_altitude */
-			else if (strcmp("timeshift_apply_altitude", options[option_index].name) == 0)
-				{
-				timeshift_apply =  timeshift_apply | MBPREPROCESS_TIMESHIFT_APPLY_ATTITUDE;
-				}
-			
-			/* timeshift_apply_all_ancilliary */
-			else if (strcmp("timeshift_apply_all_ancilliary", options[option_index].name) == 0)
-				{
-				timeshift_apply =  MBPREPROCESS_TIMESHIFT_APPLY_ALL_ANCILLIARY;
-				}
-			
-			/* timeshift_apply_survey */
-			else if (strcmp("timeshift_apply_survey", options[option_index].name) == 0)
-				{
-				timeshift_apply =  MBPREPROCESS_TIMESHIFT_APPLY_SURVEY;
-				}
-			
-			/* timeshift_apply_all */
-			else if (strcmp("timeshift_apply_all", options[option_index].name) == 0)
-				{
-				timeshift_apply =  MBPREPROCESS_TIMESHIFT_APPLY_ALL;
-				}
-			
-			/* sensor_offset_file */
-			else if (strcmp("sensor_offset_file", options[option_index].name) == 0)
-				{
-				}
-			
-			/* sonar_offsets */
-			else if (strcmp("sonar_offsets", options[option_index].name) == 0)
-				{
-				n = sscanf(optarg, "%lf/%lf/%lf/%lf/%lf/%lf",
-					   &sonar_offset_x,&sonar_offset_y,&sonar_offset_z,
-					   &sonar_offset_heading,&sonar_offset_roll,&sonar_offset_pitch);
-				if (n == 6)
-					sonar_offset_mode = MB_YES;
-				}
-			
-			/* vru_offsets */
-			else if (strcmp("vru_offsets", options[option_index].name) == 0)
-				{
-				n = sscanf(optarg, "%lf/%lf/%lf/%lf/%lf/%lf",
-					   &vru_offset_x,&vru_offset_y,&vru_offset_z,
-					   &vru_offset_heading,&vru_offset_roll,&vru_offset_pitch);
-				if (n == 6)
-					sonar_offset_mode = MB_YES;
-				}
-			
-			/* navigation_offsets */
-			else if (strcmp("navigation_offsets", options[option_index].name) == 0)
-				{
-				n = sscanf(optarg, "%lf/%lf/%lf/%lf/%lf/%lf",
-					   &navigation_offset_x,&navigation_offset_y,&navigation_offset_z,
-					   &navigation_offset_heading,&navigation_offset_roll,&navigation_offset_pitch);
-				if (n == 6)
-					sonar_offset_mode = MB_YES;
-				}
-			
-			/* no_change_survey */
-			else if (strcmp("no_change_survey", options[option_index].name) == 0)
-				{
-				no_change_survey =  MB_YES;
-				}
-			
-			break;
-		case '?':
-			errflg++;
-		}
-
-	/* if error flagged then print it and exit */
-	if (errflg)
-		{
-		fprintf(stderr,"usage: %s\n", usage_message);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		error = MB_ERROR_BAD_USAGE;
-		exit(error);
-		}
-
-	/* print starting message */
-	if (verbose == 1 || help)
-		{
-		fprintf(stderr,"\nProgram %s\n",program_name);
-		fprintf(stderr,"Source File Version %s\n",version_id);
-		fprintf(stderr,"MB-system Version %s\n",MB_VERSION);
-		}
-
-	/* print starting debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  Program <%s>\n",program_name);
-		fprintf(stderr,"dbg2  Version %s\n",version_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Control Parameters:\n");
-		fprintf(stderr,"dbg2       verbose:                    %d\n",verbose);
-		fprintf(stderr,"dbg2       help:                       %d\n",help);
-		fprintf(stderr,"dbg2       format:                     %d\n",format);
-		fprintf(stderr,"dbg2       pings:                      %d\n",pings);
-		fprintf(stderr,"dbg2       lonflip:                    %d\n",lonflip);
-		fprintf(stderr,"dbg2       bounds[0]:                  %f\n",bounds[0]);
-		fprintf(stderr,"dbg2       bounds[1]:                  %f\n",bounds[1]);
-		fprintf(stderr,"dbg2       bounds[2]:                  %f\n",bounds[2]);
-		fprintf(stderr,"dbg2       bounds[3]:                  %f\n",bounds[3]);
-		fprintf(stderr,"dbg2       btime_i[0]:                 %d\n",btime_i[0]);
-		fprintf(stderr,"dbg2       btime_i[1]:                 %d\n",btime_i[1]);
-		fprintf(stderr,"dbg2       btime_i[2]:                 %d\n",btime_i[2]);
-		fprintf(stderr,"dbg2       btime_i[3]:                 %d\n",btime_i[3]);
-		fprintf(stderr,"dbg2       btime_i[4]:                 %d\n",btime_i[4]);
-		fprintf(stderr,"dbg2       btime_i[5]:                 %d\n",btime_i[5]);
-		fprintf(stderr,"dbg2       btime_i[6]:                 %d\n",btime_i[6]);
-		fprintf(stderr,"dbg2       etime_i[0]:                 %d\n",etime_i[0]);
-		fprintf(stderr,"dbg2       etime_i[1]:                 %d\n",etime_i[1]);
-		fprintf(stderr,"dbg2       etime_i[2]:                 %d\n",etime_i[2]);
-		fprintf(stderr,"dbg2       etime_i[3]:                 %d\n",etime_i[3]);
-		fprintf(stderr,"dbg2       etime_i[4]:                 %d\n",etime_i[4]);
-		fprintf(stderr,"dbg2       etime_i[5]:                 %d\n",etime_i[5]);
-		fprintf(stderr,"dbg2       etime_i[6]:                 %d\n",etime_i[6]);
-		fprintf(stderr,"dbg2       speedmin:                   %f\n",speedmin);
-		fprintf(stderr,"dbg2       timegap:                    %f\n",timegap);
-		fprintf(stderr,"dbg2       read_file:                  %s\n",read_file);
-		fprintf(stderr,"dbg2       nav_mode:                   %d\n",nav_mode);
-		fprintf(stderr,"dbg2       nav_file:                   %s\n",nav_file);
-		fprintf(stderr,"dbg2       nav_file_format:            %d\n",nav_file_format);
-		fprintf(stderr,"dbg2       nav_async:                  %d\n",nav_async);
-		fprintf(stderr,"dbg2       sensordepth_mode:           %d\n",sensordepth_mode);
-		fprintf(stderr,"dbg2       sensordepth_file:           %s\n",sensordepth_file);
-		fprintf(stderr,"dbg2       sensordepth_file_format:    %d\n",sensordepth_file_format);
-		fprintf(stderr,"dbg2       sensordepth_async:          %d\n",sensordepth_async);
-		fprintf(stderr,"dbg2       heading_mode:               %d\n",heading_mode);
-		fprintf(stderr,"dbg2       heading_file:               %s\n",heading_file);
-		fprintf(stderr,"dbg2       heading_file_format:        %d\n",heading_file_format);
-		fprintf(stderr,"dbg2       heading_async:              %d\n",heading_async);
-		fprintf(stderr,"dbg2       altitude_mode:              %d\n",altitude_mode);
-		fprintf(stderr,"dbg2       altitude_file:              %s\n",altitude_file);
-		fprintf(stderr,"dbg2       altitude_file_format:       %d\n",altitude_file_format);
-		fprintf(stderr,"dbg2       altitude_async:             %d\n",altitude_async);
-		fprintf(stderr,"dbg2       attitude_mode:              %d\n",attitude_mode);
-		fprintf(stderr,"dbg2       attitude_file:              %s\n",attitude_file);
-		fprintf(stderr,"dbg2       attitude_file_format:       %d\n",attitude_file_format);
-		fprintf(stderr,"dbg2       attitude_async:             %d\n",attitude_async);
-		fprintf(stderr,"dbg2       timeshift_mode:             %d\n",timeshift_mode);
-		fprintf(stderr,"dbg2       timeshift_file:             %s\n",timeshift_file);
-		fprintf(stderr,"dbg2       timeshift_format:           %d\n",timeshift_format);
-		fprintf(stderr,"dbg2       timeshift_apply:            %x\n",timeshift_apply);
-		fprintf(stderr,"dbg2       offset_file:                %s\n",offset_file);
-		fprintf(stderr,"dbg2       sonar_offset_mode:          %d\n",sonar_offset_mode);
-		fprintf(stderr,"dbg2       sonar_offset_x:             %f\n",sonar_offset_x);
-		fprintf(stderr,"dbg2       sonar_offset_y:             %f\n",sonar_offset_y);
-		fprintf(stderr,"dbg2       sonar_offset_z:             %f\n",sonar_offset_z);
-		fprintf(stderr,"dbg2       sonar_offset_heading:       %f\n",sonar_offset_heading);
-		fprintf(stderr,"dbg2       sonar_offset_roll:          %f\n",sonar_offset_roll);
-		fprintf(stderr,"dbg2       sonar_offset_pitch:         %f\n",sonar_offset_pitch);
-		fprintf(stderr,"dbg2       vru_offset_mode:            %d\n",vru_offset_mode);
-		fprintf(stderr,"dbg2       vru_offset_x:               %f\n",vru_offset_x);
-		fprintf(stderr,"dbg2       vru_offset_y:               %f\n",vru_offset_y);
-		fprintf(stderr,"dbg2       vru_offset_z:               %f\n",vru_offset_z);
-		fprintf(stderr,"dbg2       vru_offset_heading:         %f\n",vru_offset_heading);
-		fprintf(stderr,"dbg2       vru_offset_roll:            %f\n",vru_offset_roll);
-		fprintf(stderr,"dbg2       vru_offset_pitch:           %f\n",vru_offset_pitch);
-		fprintf(stderr,"dbg2       navigation_offset_mode:     %d\n",navigation_offset_mode);
-		fprintf(stderr,"dbg2       navigation_offset_x:        %f\n",navigation_offset_x);
-		fprintf(stderr,"dbg2       navigation_offset_y:        %f\n",navigation_offset_y);
-		fprintf(stderr,"dbg2       navigation_offset_z:        %f\n",navigation_offset_z);
-		fprintf(stderr,"dbg2       navigation_offset_heading:  %f\n",navigation_offset_heading);
-		fprintf(stderr,"dbg2       navigation_offset_roll:     %f\n",navigation_offset_roll);
-		fprintf(stderr,"dbg2       navigation_offset_pitch:    %f\n",navigation_offset_pitch);
-		fprintf(stderr,"dbg2       no_change_survey:           %d\n",no_change_survey);
-		}
-
-	/* if help desired then print it and exit */
-	if (help)
-		{
-		fprintf(stderr,"\n%s\n",help_message);
-		fprintf(stderr,"\nusage: %s\n", usage_message);
-		exit(error);
-		}
-		
-	/* load ancilliary data from external files if requested */
-	if (nav_mode == MBPREPROCESS_MERGE_FILE)
-		{
-		mb_loadnavdata(verbose, nav_file, nav_file_format, lonflip,
-			       &nav_num, &nav_alloc,
-			       &nav_time_d, &nav_navlon, &nav_navlat, &nav_speed, &error);
-		
-		if (verbose > 0)
-			fprintf(stderr,"%d navigation records loaded from file %s\n", nav_num, nav_file);
-		}
-	if (sensordepth_mode == MBPREPROCESS_MERGE_FILE)
-		{
-		mb_loadsensordepthdata(verbose, sensordepth_file, sensordepth_file_format,
-				       &sensordepth_num, &sensordepth_alloc,
-			       &sensordepth_time_d, &sensordepth_sensordepth, &error);
-		
-		if (verbose > 0)
-			fprintf(stderr,"%d sensordepth records loaded from file %s\n", sensordepth_num, sensordepth_file);
-		}
-	if (heading_mode == MBPREPROCESS_MERGE_FILE)
-		{
-		mb_loadheadingdata(verbose, heading_file, heading_file_format,
-			       &heading_num, &heading_alloc,
-			       &heading_time_d, &heading_heading, &error);
-		
-		if (verbose > 0)
-			fprintf(stderr,"%d heading records loaded from file %s\n", heading_num, heading_file);
-		}
-	if (altitude_mode == MBPREPROCESS_MERGE_FILE)
-		{
-		mb_loadaltitudedata(verbose, altitude_file, altitude_file_format,
-			       &altitude_num, &altitude_alloc,
-			       &altitude_time_d, &altitude_altitude, &error);
-		
-		if (verbose > 0)
-			fprintf(stderr,"%d altitude records loaded from file %s\n", altitude_num, altitude_file);
-		}
-	if (attitude_mode == MBPREPROCESS_MERGE_FILE)
-		{
-		mb_loadattitudedata(verbose, attitude_file, attitude_file_format,
-			       &attitude_num, &attitude_alloc,
-			       &attitude_time_d, &attitude_roll, &attitude_pitch, &attitude_heave, &error);
-		
-		if (verbose > 0)
-			fprintf(stderr,"%d attitude records loaded from file %s\n", heading_num, heading_file);
-		}
-	if (timeshift_mode == MBPREPROCESS_MERGE_FILE)
-		{
-		mb_loadtimeshiftdata(verbose, timeshift_file, timeshift_format,
-			       &timeshift_num, &timeshift_alloc,
-			       &timeshift_time_d, &timeshift_timeshift, &error);
-		
-		if (verbose > 0)
-			fprintf(stderr,"%d timeshift records loaded from file %s\n", heading_num, heading_file);
-		}
-
-	/*-------------------------------------------------------------------*/
-	
-	/* Do first pass through the data collecting ancilliary data from the desired source records */
-
-	/* get format if required */
-	if (format == 0)
-		mb_get_format(verbose,read_file,NULL,&format,&error);
-
-	/* determine whether to read one file or a list of files */
-	if (format < 0)
-		read_datalist = MB_YES;
-
-	/* open file list */
-	if (read_datalist == MB_YES)
-	    {
-	    if ((status = mb_datalist_open(verbose,&datalist,
-					    read_file,look_processed,&error)) != MB_SUCCESS)
-		{
-		error = MB_ERROR_OPEN_FAIL;
-		fprintf(stderr,"\nUnable to open data list file: %s\n",
-			read_file);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-	    if ((status = mb_datalist_read(verbose,datalist,
-			    ifile,&iformat,&file_weight,&error))
-			    == MB_SUCCESS)
-		read_data = MB_YES;
-	    else
-		read_data = MB_NO;
-	    }
-	/* else copy single filename to be read */
-	else
-	    {
-	    strcpy(ifile, read_file);
-	    iformat = format;
-	    read_data = MB_YES;
-	    }
-
-	/* loop over all files to be read */
-	while (read_data == MB_YES)
-		{
-		if (verbose > 0)
-			fprintf(stderr,"\nPass 1: Opening file %s %d\n", ifile, iformat);
-			
-		/* initialize reading the swath file */
-		if ((status = mb_read_init(
-			verbose,ifile,iformat,pings,lonflip,bounds,
-			btime_i,etime_i,speedmin,timegap,
-			&imbio_ptr,&btime_d,&etime_d,
-			&beams_bath,&beams_amp,&pixels_ss,&error)) != MB_SUCCESS)
-			{
-			mb_error(verbose,error,&message);
-			fprintf(stderr,"\nMBIO Error returned from function <mb_read_init>:\n%s\n",message);
-			fprintf(stderr,"\nMultibeam File <%s> not initialized for reading\n",ifile);
-			fprintf(stderr,"\nProgram <%s> Terminated\n",
-				program_name);
-			exit(error);
-			}
-	
-		beamflag = NULL;
-		bath = NULL;
-		amp = NULL;
-		bathacrosstrack = NULL;
-		bathalongtrack = NULL;
-		ss = NULL;
-		ssacrosstrack = NULL;
-		ssalongtrack = NULL;
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							sizeof(char), (void **)&beamflag, &error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							sizeof(double), (void **)&bath, &error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_AMPLITUDE,
-							sizeof(double), (void **)&amp, &error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							sizeof(double), (void **)&bathacrosstrack, &error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							sizeof(double), (void **)&bathalongtrack, &error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_SIDESCAN,
-							sizeof(double), (void **)&ss, &error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_SIDESCAN,
-							sizeof(double), (void **)&ssacrosstrack, &error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_SIDESCAN,
-							sizeof(double), (void **)&ssalongtrack, &error);
-	
-		/* if error initializing memory then quit */
-		if (error != MB_ERROR_NO_ERROR)
-			{
-			mb_error(verbose,error,&message);
-			fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",
-				message);
-			fprintf(stderr,"\nProgram <%s> Terminated\n",
-				program_name);
-			exit(error);
-			}
-				
-		/* zero file count records */
-		n_rf_data = 0;
-		n_rf_comment = 0;
-		n_rf_nav = 0;
-		n_rf_nav1 = 0;
-		n_rf_nav2 = 0;
-		n_rf_nav3 = 0;
-		n_rf_att = 0;
-		n_rf_att1 = 0;
-		n_rf_att2 = 0;
-		n_rf_att3 = 0;
-	
-		/* read data */
-		while (error <= MB_ERROR_NO_ERROR)
-			{
-			/* reset error */
-			error = MB_ERROR_NO_ERROR;
-	
-			/* read next data record */
-			status = mb_get_all(verbose,imbio_ptr,&istore_ptr,&kind,
-					    time_i,&time_d,&navlon,&navlat,
-					    &speed,&heading,
-					    &distance,&altitude,&sensordepth,
-					    &beams_bath,&beams_amp,&pixels_ss,
-					    beamflag,bath,amp,bathacrosstrack,bathalongtrack,
-					    ss,ssacrosstrack,ssalongtrack,
-					    comment,&error);
-	
-			/* some nonfatal errors do not matter */
-			if (error < MB_ERROR_NO_ERROR && error > MB_ERROR_UNINTELLIGIBLE)
-				{
-				error = MB_ERROR_NO_ERROR;
-				status = MB_SUCCESS;
-				}
-
-			/* print debug statements */
-			if (verbose >= 2)
-				{
-				fprintf(stderr,"\ndbg2  Data record read in program <%s>\n",
-					program_name);
-				fprintf(stderr,"dbg2       kind:           %d\n",kind);
-				fprintf(stderr,"dbg2       error:          %d\n",error);
-				fprintf(stderr,"dbg2       status:         %d\n",status);
-				}
-				
-			/* count records */
-			if (kind == MB_DATA_DATA)
-				{
-				n_rf_data++;
-				n_rt_data++;
-				}
-			else if (kind == MB_DATA_COMMENT)
-				{
-				n_rf_comment++;
-				n_rt_comment++;
-				}
-			else if (kind == MB_DATA_NAV)
-				{
-				n_rf_nav++;
-				n_rt_nav++;
-				}
-			else if (kind == MB_DATA_NAV1)
-				{
-				n_rf_nav1++;
-				n_rt_nav1++;
-				}
-			else if (kind == MB_DATA_NAV2)
-				{
-				n_rf_nav2++;
-				n_rt_nav2++;
-				}
-			else if (kind == MB_DATA_NAV3)
-				{
-				n_rf_nav3++;
-				n_rt_nav3++;
-				}
-			else if (kind == MB_DATA_ATTITUDE)
-				{
-				n_rf_att++;
-				n_rt_att++;
-				}
-			else if (kind == MB_DATA_ATTITUDE1)
-				{
-				n_rf_att1++;
-				n_rt_att1++;
-				}
-			else if (kind == MB_DATA_ATTITUDE2)
-				{
-				n_rf_att2++;
-				n_rt_att2++;
-				}
-			else if (kind == MB_DATA_ATTITUDE3)
-				{
-				n_rf_att3++;
-				n_rt_att3++;
-				}
-				
-			/* look for nav if not externally defined */
-			if (status == MB_SUCCESS
-				&& nav_mode == MBPREPROCESS_MERGE_ASYNC
-				&& kind == sensordepth_async)
-				{
-				/* extract nav data */
-				status = mb_extract_nnav(verbose, imbio_ptr, istore_ptr,
-							nanavmax, &kind, &nanav,
-							atime_i, atime_d,
-							alon, alat,
-							aspeed, aheading, asensordepth,
-							aroll, apitch, aheave,
-							&error);
-
-				/* allocate memory if needed */
-				if (status == MB_SUCCESS
-					&& nanav > 0
-					&& nav_num + nanav >= nav_alloc)
-					{
-					nav_alloc += MAX(MBPREPROCESS_ALLOC_CHUNK, nanav);
-					status = mb_reallocd(verbose,__FILE__,__LINE__,nav_alloc*sizeof(double),(void **)&nav_time_d,&error);
-					status = mb_reallocd(verbose,__FILE__,__LINE__,nav_alloc*sizeof(double),(void **)&nav_navlon,&error);
-					status = mb_reallocd(verbose,__FILE__,__LINE__,nav_alloc*sizeof(double),(void **)&nav_navlat,&error);
-					status = mb_reallocd(verbose,__FILE__,__LINE__,nav_alloc*sizeof(double),(void **)&nav_speed,&error);
-					if (error != MB_ERROR_NO_ERROR)
-						{
-						mb_error(verbose,error,&message);
-						fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",message);
-						fprintf(stderr,"\nProgram <%s> Terminated\n",
-						    program_name);
-						exit(error);
-						}
-					}
-					
-				/* copy the nav data */
-				if (status == MB_SUCCESS
-					&& nanav > 0)
-					{
-					for (i=0;i<nanav;i++)
-						{
-						if (atime_d[i] > 0.0 && alon[i] != 0.0 && alat[i] != 0.0)
-							{
-							nav_time_d[nav_num] = atime_d[i];
-							nav_navlon[nav_num] = alon[i];
-							nav_navlat[nav_num] = alat[i];
-							nav_speed[nav_num] = aspeed[i];
-							nav_num++;
-							}
-						}
-					}
-				}
-				
-			/* look for sensordepth if not externally defined */
-			if (status == MB_SUCCESS
-				&& sensordepth_mode == MBPREPROCESS_MERGE_ASYNC
-				&& kind == sensordepth_async)
-				{
-				/* extract sensordepth data */
-				status = mb_extract_nnav(verbose, imbio_ptr, istore_ptr,
-							nanavmax, &kind, &nanav,
-							atime_i, atime_d,
-							alon, alat,
-							aspeed, aheading, asensordepth,
-							aroll, apitch, aheave,
-							&error);
-
-				/* allocate memory if needed */
-				if (status == MB_SUCCESS
-					&& nanav > 0
-					&& sensordepth_num + nanav >= sensordepth_alloc)
-					{
-					sensordepth_alloc += MAX(MBPREPROCESS_ALLOC_CHUNK, nanav);
-					status = mb_reallocd(verbose,__FILE__,__LINE__,sensordepth_alloc*sizeof(double),(void **)&sensordepth_time_d,&error);
-					status = mb_reallocd(verbose,__FILE__,__LINE__,sensordepth_alloc*sizeof(double),(void **)&sensordepth_sensordepth,&error);
-					if (error != MB_ERROR_NO_ERROR)
-						{
-						mb_error(verbose,error,&message);
-						fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",message);
-						fprintf(stderr,"\nProgram <%s> Terminated\n",
-						    program_name);
-						exit(error);
-						}
-					}
-					
-				/* copy the sensordepth data */
-				if (status == MB_SUCCESS
-					&& nanav > 0)
-					{
-					for (i=0;i<nanav;i++)
-						{
-						sensordepth_time_d[sensordepth_num] = atime_d[i];
-						sensordepth_sensordepth[sensordepth_num] = asensordepth[i];
-						sensordepth_num++;
-						}
-					}
-				}
-				
-			/* look for heading if not externally defined */
-			if (status == MB_SUCCESS
-				&& heading_mode == MBPREPROCESS_MERGE_ASYNC
-				&& kind == heading_async)
-				{
-				/* extract heading data */
-				status = mb_extract_nnav(verbose, imbio_ptr, istore_ptr,
-							nanavmax, &kind, &nanav,
-							atime_i, atime_d,
-							alon, alat,
-							aspeed, aheading, asensordepth,
-							aroll, apitch, aheave,
-							&error);
-
-				/* allocate memory if needed */
-				if (status == MB_SUCCESS
-					&& nanav > 0
-					&& heading_num + nanav >= heading_alloc)
-					{
-					heading_alloc += MAX(MBPREPROCESS_ALLOC_CHUNK, nanav);
-					status = mb_reallocd(verbose,__FILE__,__LINE__,heading_alloc*sizeof(double),(void **)&heading_time_d,&error);
-					status = mb_reallocd(verbose,__FILE__,__LINE__,heading_alloc*sizeof(double),(void **)&heading_heading,&error);
-					if (error != MB_ERROR_NO_ERROR)
-						{
-						mb_error(verbose,error,&message);
-						fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",message);
-						fprintf(stderr,"\nProgram <%s> Terminated\n",
-						    program_name);
-						exit(error);
-						}
-					}
-					
-				/* copy the heading data */
-				if (status == MB_SUCCESS
-					&& nanav > 0)
-					{
-					for (i=0;i<nanav;i++)
-						{
-						heading_time_d[heading_num] = atime_d[i];
-						heading_heading[heading_num] = aheading[i];
-						heading_num++;
-						}
-					}
-				}
-				
-			/* look for altitude if not externally defined */
-			if (status == MB_SUCCESS
-				&& altitude_mode == MBPREPROCESS_MERGE_ASYNC
-				&& kind == altitude_async)
-				{
-				/* extract altitude data */
-				status = mb_extract_altitude(verbose, imbio_ptr, istore_ptr,
-							&kind, &sensordepth, &altitude,
-							&error);
-
-				/* allocate memory if needed */
-				if (status == MB_SUCCESS
-					&& altitude_num + 1 >= altitude_alloc)
-					{
-					altitude_alloc += MBPREPROCESS_ALLOC_CHUNK;
-					status = mb_reallocd(verbose,__FILE__,__LINE__,altitude_alloc*sizeof(double),(void **)&altitude_time_d,&error);
-					status = mb_reallocd(verbose,__FILE__,__LINE__,altitude_alloc*sizeof(double),(void **)&altitude_altitude,&error);
-					if (error != MB_ERROR_NO_ERROR)
-						{
-						mb_error(verbose,error,&message);
-						fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",message);
-						fprintf(stderr,"\nProgram <%s> Terminated\n",
-						    program_name);
-						exit(error);
-						}
-					}
-					
-				/* copy the altitude data */
-				if (status == MB_SUCCESS)
-					{
-					altitude_time_d[altitude_num] = time_d;
-					altitude_altitude[altitude_num] = altitude;
-					altitude_num++;
-					}
-				}
-				
-			/* look for attitude if not externally defined */
-			if (status == MB_SUCCESS
-				&& attitude_mode == MBPREPROCESS_MERGE_ASYNC
-				&& kind == attitude_async)
-				{
-				/* extract attitude data */
-				status = mb_extract_nnav(verbose, imbio_ptr, istore_ptr,
-							nanavmax, &kind, &nanav,
-							atime_i, atime_d,
-							alon, alat,
-							aspeed, aheading, asensordepth,
-							aroll, apitch, aheave,
-							&error);
-
-				/* allocate memory if needed */
-				if (status == MB_SUCCESS
-					&& nanav > 0
-					&& attitude_num + nanav >= attitude_alloc)
-					{
-					attitude_alloc += MAX(MBPREPROCESS_ALLOC_CHUNK, nanav);
-					status = mb_reallocd(verbose,__FILE__,__LINE__,attitude_alloc*sizeof(double),(void **)&attitude_time_d,&error);
-					status = mb_reallocd(verbose,__FILE__,__LINE__,attitude_alloc*sizeof(double),(void **)&attitude_roll,&error);
-					status = mb_reallocd(verbose,__FILE__,__LINE__,attitude_alloc*sizeof(double),(void **)&attitude_pitch,&error);
-					status = mb_reallocd(verbose,__FILE__,__LINE__,attitude_alloc*sizeof(double),(void **)&attitude_heave,&error);
-					if (error != MB_ERROR_NO_ERROR)
-						{
-						mb_error(verbose,error,&message);
-						fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",message);
-						fprintf(stderr,"\nProgram <%s> Terminated\n",
-						    program_name);
-						exit(error);
-						}
-					}
-					
-				/* copy the attitude data */
-				if (status == MB_SUCCESS
-					&& nanav > 0)
-					{
-					for (i=0;i<nanav;i++)
-						{
-						attitude_time_d[attitude_num] = atime_d[i];
-						attitude_roll[attitude_num] = aroll[i];
-						attitude_pitch[attitude_num] = apitch[i];
-						attitude_heave[attitude_num] = aheave[i];
-						attitude_num++;
-						}
-					}
-				}
-			}
-		
-		/* output data counts */
-		if (verbose > 0)
-			{
-			fprintf(stderr,"Pass 1: Records read from input file %s\n", ifile);
-			fprintf(stderr,"     %d survey records\n", n_rf_data);
-			fprintf(stderr,"     %d comment records\n", n_rf_comment);
-			fprintf(stderr,"     %d nav records\n", n_rf_nav);
-			fprintf(stderr,"     %d nav1 records\n", n_rf_nav1);
-			fprintf(stderr,"     %d nav2 records\n", n_rf_nav2);
-			fprintf(stderr,"     %d nav3 records\n", n_rf_nav3);
-			fprintf(stderr,"     %d att records\n", n_rf_att);
-			fprintf(stderr,"     %d att1 records\n", n_rf_att1);
-			fprintf(stderr,"     %d att2 records\n", n_rf_att2);
-			fprintf(stderr,"     %d att3 records\n", n_rf_att3);
-			}
-			
-		/* close the swath file */
-		status = mb_close(verbose,&imbio_ptr,&error);
-	
-		/* figure out whether and what to read next */
-		if (read_datalist == MB_YES)
-			{
-			if ((status = mb_datalist_read(verbose,datalist,
-				    ifile,&iformat,&file_weight,&error))
-				    == MB_SUCCESS)
-				read_data = MB_YES;
-			else
-				read_data = MB_NO;
-			}
-		else
-			{
-			read_data = MB_NO;
-			}
-	
-		/* end loop over files in list */
-		}
-	if (read_datalist == MB_YES)
-		mb_datalist_close(verbose,&datalist,&error);
-	
-	/* output data counts */
-	if (verbose > 0)
-		{
-		fprintf(stderr,"\n-----------------------------------------------\n");
-		fprintf(stderr,"Pass 1: Total records read from all input files:\n");
-		fprintf(stderr,"     %d survey records\n", n_rt_data);
-		fprintf(stderr,"     %d comment records\n", n_rt_comment);
-		fprintf(stderr,"     %d nav records\n", n_rt_nav);
-		fprintf(stderr,"     %d nav1 records\n", n_rt_nav1);
-		fprintf(stderr,"     %d nav2 records\n", n_rt_nav2);
-		fprintf(stderr,"     %d nav3 records\n", n_rt_nav3);
-		fprintf(stderr,"     %d att records\n", n_rt_att);
-		fprintf(stderr,"     %d att1 records\n", n_rt_att1);
-		fprintf(stderr,"     %d att2 records\n", n_rt_att2);
-		fprintf(stderr,"     %d att3 records\n", n_rt_att3);
-		fprintf(stderr,"Pass 1: Asynchronous data available for merging:\n");
-		fprintf(stderr,"     %d navigation data (mode:%d)\n", nav_num, nav_mode);
-		fprintf(stderr,"     %d sensordepth data (mode:%d)\n", sensordepth_num, sensordepth_mode);
-		fprintf(stderr,"     %d heading data (mode:%d)\n", heading_num, heading_mode);
-		fprintf(stderr,"     %d altitude data (mode:%d)\n", altitude_num, altitude_mode);
-		fprintf(stderr,"     %d attitude data (mode:%d)\n", attitude_num, attitude_mode);
-		fprintf(stderr,"     %d timeshift data (mode:%d)\n", timeshift_num, timeshift_mode);
-		fprintf(stderr,"-----------------------------------------------\n");
-		}
-		
-	/* end first pass through data */
-	
-	/*-------------------------------------------------------------------*/
-	
-	/* Apply any specified timeshift to the chosen data */
-	if (timeshift_mode != MBPREPROCESS_TIMESHIFT_OFF)
-		{
-		/* if no affected data have been specified apply timeshift to all */
-		if (timeshift_apply == MBPREPROCESS_TIMESHIFT_APPLY_NONE)
-			timeshift_apply =  MBPREPROCESS_TIMESHIFT_APPLY_ALL_ANCILLIARY;
-			
-		/* apply timeshift to nav data */
-		if (timeshift_apply &  MBPREPROCESS_TIMESHIFT_APPLY_NAV)
-			{
-			if (timeshift_mode == MBPREPROCESS_TIMESHIFT_FILE)
-				{
-				j = 0;
-				for (i=0;i<nav_num;i++)
-					{
-					interp_status = mb_linear_interp(verbose,
-								timeshift_time_d-1, timeshift_timeshift-1,
-								timeshift_num, nav_time_d[i], &timeshift, &j,
-								&interp_error);
-					nav_time_d[i] -= timeshift;
-					}
-				
-				}
-			else if (timeshift_mode == MBPREPROCESS_TIMESHIFT_CONSTANT)
-				{
-				for (i=0;i<nav_num;i++)
-					{
-					nav_time_d[i] -= timeshift_constant;
-					}
-				}
-			}
-			
-		/* apply timeshift to sensordepth data */
-		if (timeshift_apply & MBPREPROCESS_TIMESHIFT_APPLY_SENSORDEPTH)
-			{
-			if (timeshift_mode == MBPREPROCESS_TIMESHIFT_FILE)
-				{
-				j = 0;
-				for (i=0;i<sensordepth_num;i++)
-					{
-					interp_status = mb_linear_interp(verbose,
-								timeshift_time_d-1, timeshift_timeshift-1,
-								timeshift_num, sensordepth_time_d[i], &timeshift, &j,
-								&interp_error);
-					sensordepth_time_d[i] -= timeshift;
-					}
-				
-				}
-			else if (timeshift_mode == MBPREPROCESS_TIMESHIFT_CONSTANT)
-				{
-				for (i=0;i<sensordepth_num;i++)
-					{
-					sensordepth_time_d[i] -= timeshift_constant;
-					}
-				}
-			}
-			
-		/* apply timeshift to heading data */
-		if (timeshift_apply & MBPREPROCESS_TIMESHIFT_APPLY_HEADING)
-			{
-			if (timeshift_mode == MBPREPROCESS_TIMESHIFT_FILE)
-				{
-				j = 0;
-				for (i=0;i<heading_num;i++)
-					{
-					interp_status = mb_linear_interp(verbose,
-								timeshift_time_d-1, timeshift_timeshift-1,
-								timeshift_num, heading_time_d[i], &timeshift, &j,
-								&interp_error);
-					heading_time_d[i] -= timeshift;
-					}
-				
-				}
-			else if (timeshift_mode == MBPREPROCESS_TIMESHIFT_CONSTANT)
-				{
-				for (i=0;i<heading_num;i++)
-					{
-					heading_time_d[i] -= timeshift_constant;
-					}
-				}
-			}
-			
-		/* apply timeshift to altitude data */
-		if (timeshift_apply & MBPREPROCESS_TIMESHIFT_APPLY_ALTITUDE)
-			{
-			if (timeshift_mode == MBPREPROCESS_TIMESHIFT_FILE)
-				{
-				j = 0;
-				for (i=0;i<altitude_num;i++)
-					{
-					interp_status = mb_linear_interp(verbose,
-								timeshift_time_d-1, timeshift_timeshift-1,
-								timeshift_num, altitude_time_d[i], &timeshift, &j,
-								&interp_error);
-					altitude_time_d[i] -= timeshift;
-					}
-				
-				}
-			else if (timeshift_mode == MBPREPROCESS_TIMESHIFT_CONSTANT)
-				{
-				for (i=0;i<altitude_num;i++)
-					{
-					altitude_time_d[i] -= timeshift_constant;
-					}
-				}
-			}
-			
-		/* apply timeshift to attitude data */
-		if (timeshift_apply & MBPREPROCESS_TIMESHIFT_APPLY_ATTITUDE)
-			{
-			if (timeshift_mode == MBPREPROCESS_TIMESHIFT_FILE)
-				{
-				j = 0;
-				for (i=0;i<attitude_num;i++)
-					{
-					interp_status = mb_linear_interp(verbose,
-								timeshift_time_d-1, timeshift_timeshift-1,
-								timeshift_num, attitude_time_d[i], &timeshift, &j,
-								&interp_error);
-					attitude_time_d[i] -= timeshift;
-					}
-				
-				}
-			else if (timeshift_mode == MBPREPROCESS_TIMESHIFT_CONSTANT)
-				{
-				for (i=0;i<attitude_num;i++)
-					{
-					attitude_time_d[i] -= timeshift_constant;
-					}
-				}
-			}
-		}
-	
-	/*-------------------------------------------------------------------*/
-
-//for (i=0;i<nav_num;i++)
-//fprintf(stderr,"NAV %d %f %f %f\n",i,nav_time_d[i],nav_navlon[i],nav_navlat[i]);
-//fprintf(stderr," \n");
-
-	/* Do second pass through the data reading everything,
-		correcting survey data, and outputting everything */
-				
-	/* zero file count records */
-	n_rf_data = 0;
-	n_rf_comment = 0;
-	n_rf_nav = 0;
-	n_rf_nav1 = 0;
-	n_rf_nav2 = 0;
-	n_rf_nav3 = 0;
-	n_rf_att = 0;
-	n_rf_att1 = 0;
-	n_rf_att2 = 0;
-	n_rf_att3 = 0;
-	n_rt_data = 0;
-	n_rt_comment = 0;
-	n_rt_nav = 0;
-	n_rt_nav1 = 0;
-	n_rt_nav2 = 0;
-	n_rt_nav3 = 0;
-	n_rt_att = 0;
-	n_rt_att1 = 0;
-	n_rt_att2 = 0;
-	n_rt_att3 = 0;
-	n_wf_data = 0;
-	n_wf_comment = 0;
-	n_wf_nav = 0;
-	n_wf_nav1 = 0;
-	n_wf_nav2 = 0;
-	n_wf_nav3 = 0;
-	n_wf_att = 0;
-	n_wf_att1 = 0;
-	n_wf_att2 = 0;
-	n_wf_att3 = 0;
-	n_wt_data = 0;
-	n_wt_comment = 0;
-	n_wt_nav = 0;
-	n_wt_nav1 = 0;
-	n_wt_nav2 = 0;
-	n_wt_nav3 = 0;
-	n_wt_att = 0;
-	n_wt_att1 = 0;
-	n_wt_att2 = 0;
-	n_wt_att3 = 0;
-
-	/* open file list */
-	if (read_datalist == MB_YES)
-	    {
-	    if ((status = mb_datalist_open(verbose,&datalist,
-					    read_file,look_processed,&error)) != MB_SUCCESS)
-		{
-		error = MB_ERROR_OPEN_FAIL;
-		fprintf(stderr,"\nUnable to open data list file: %s\n",
-			read_file);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-	    if ((status = mb_datalist_read(verbose,datalist,
-			    ifile,&iformat,&file_weight,&error))
-			    == MB_SUCCESS)
-		read_data = MB_YES;
-	    else
-		read_data = MB_NO;
-	    }
-	/* else copy single filename to be read */
-	else
-	    {
-	    strcpy(ifile, read_file);
-	    iformat = format;
-	    read_data = MB_YES;
-	    }
-
-	/* loop over all files to be read */
-	while (read_data == MB_YES)
-		{
-		/* get output format - in some cases this may be a
-		 * different, generally extended format
-		 * more suitable for processing than the original */
-		if (iformat == MBF_EMOLDRAW
-			|| iformat == MBF_EM12IFRM
-			|| iformat == MBF_EM12DARW
-			|| iformat == MBF_EM300RAW
-			|| iformat == MBF_EM300MBA)
-			oformat = MBF_EM300MBA;
-		else if (iformat == MBF_EM710RAW
-			|| iformat == MBF_EM710MBA)
-			oformat = MBF_EM710MBA;
-		else
-			oformat = iformat;
-		
-		/* figure out the output file name */
-		status = mb_get_format(verbose, ifile, fileroot, &testformat, &error);
-		sprintf(ofile, "%s.mb%d", fileroot, oformat);
-		if (strcmp(ifile,ofile) == 0)
-			sprintf(ofile, "%sr.mb%d", fileroot, oformat);
-
-		if (verbose > 0)
-			fprintf(stderr,"\nPass 2: Opening input file:  %s %d\n", ifile, iformat);
-			
-		/* initialize reading the input file */
-		if ((status = mb_read_init(
-			verbose,ifile,iformat,pings,lonflip,bounds,
-			btime_i,etime_i,speedmin,timegap,
-			&imbio_ptr,&btime_d,&etime_d,
-			&beams_bath,&beams_amp,&pixels_ss,&error)) != MB_SUCCESS)
-			{
-			mb_error(verbose,error,&message);
-			fprintf(stderr,"\nMBIO Error returned from function <mb_read_init>:\n%s\n",message);
-			fprintf(stderr,"\nMultibeam File <%s> not initialized for reading\n",ifile);
-			fprintf(stderr,"\nProgram <%s> Terminated\n",
-				program_name);
-			exit(error);
-			}
-
-		if (verbose > 0)
-			fprintf(stderr,"Pass 2: Opening output file: %s %d\n", ofile, oformat);
-
-		/* initialize writing the output swath file */
-		if ((status = mb_write_init(
-			verbose,ofile,oformat,&ombio_ptr,
-			&obeams_bath,&obeams_amp,&opixels_ss,&error)) != MB_SUCCESS)
-			{
-			mb_error(verbose,error,&message);
-			fprintf(stderr,"\nMBIO Error returned from function <mb_write_init>:\n%s\n",message);
-			fprintf(stderr,"\nMultibeam File <%s> not initialized for writing\n",ofile);
-			fprintf(stderr,"\nProgram <%s> Terminated\n",
-				program_name);
-			exit(error);
-			}
-	
-		beamflag = NULL;
-		bath = NULL;
-		amp = NULL;
-		bathacrosstrack = NULL;
-		bathalongtrack = NULL;
-		ss = NULL;
-		ssacrosstrack = NULL;
-		ssalongtrack = NULL;
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							sizeof(char), (void **)&beamflag, &error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							sizeof(double), (void **)&bath, &error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_AMPLITUDE,
-							sizeof(double), (void **)&amp, &error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							sizeof(double), (void **)&bathacrosstrack, &error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							sizeof(double), (void **)&bathalongtrack, &error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_SIDESCAN,
-							sizeof(double), (void **)&ss, &error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_SIDESCAN,
-							sizeof(double), (void **)&ssacrosstrack, &error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_SIDESCAN,
-							sizeof(double), (void **)&ssalongtrack, &error);
-	
-		/* if error initializing memory then quit */
-		if (error != MB_ERROR_NO_ERROR)
-			{
-			mb_error(verbose,error,&message);
-			fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",
-				message);
-			fprintf(stderr,"\nProgram <%s> Terminated\n",
-				program_name);
-			exit(error);
-			}
-				
-		/* zero file count records */
-		n_rf_data = 0;
-		n_rf_comment = 0;
-		n_rf_nav = 0;
-		n_rf_nav1 = 0;
-		n_rf_nav2 = 0;
-		n_rf_nav3 = 0;
-		n_rf_att = 0;
-		n_rf_att1 = 0;
-		n_rf_att2 = 0;
-		n_rf_att3 = 0;
-		n_wf_data = 0;
-		n_wf_comment = 0;
-		n_wf_nav = 0;
-		n_wf_nav1 = 0;
-		n_wf_nav2 = 0;
-		n_wf_nav3 = 0;
-		n_wf_att = 0;
-		n_wf_att1 = 0;
-		n_wf_att2 = 0;
-		n_wf_att3 = 0;
-
-		/* ------------------------------- */
-		/* write comments to output file   */
-
-		/* ------------------------------- */
-		/* start read+process,+output loop */
-		while (error <= MB_ERROR_NO_ERROR)
-			{
-			/* reset error */
-			status = MB_SUCCESS;
-			error = MB_ERROR_NO_ERROR;
-	
-			/* read next data record */
-			status = mb_get_all(verbose,imbio_ptr,&istore_ptr,&kind,
-					    time_i,&time_d,&navlon_org,&navlat_org,
-					    &speed_org,&heading_org,
-					    &distance,&altitude_org,&sensordepth_org,
-					    &beams_bath,&beams_amp,&pixels_ss,
-					    beamflag,bath,amp,bathacrosstrack,bathalongtrack,
-					    ss,ssacrosstrack,ssalongtrack,
-					    comment,&error);
-	
-			/* some nonfatal errors do not matter */
-			if (error < MB_ERROR_NO_ERROR && error > MB_ERROR_UNINTELLIGIBLE)
-				{
-				error = MB_ERROR_NO_ERROR;
-				status = MB_SUCCESS;
-				}
-				
-			/* count records */
-			if (kind == MB_DATA_DATA)
-				{
-				n_rf_data++;
-				n_rt_data++;
-				}
-			else if (kind == MB_DATA_COMMENT)
-				{
-				n_rf_comment++;
-				n_rt_comment++;
-				}
-			else if (kind == MB_DATA_NAV)
-				{
-				n_rf_nav++;
-				n_rt_nav++;
-				}
-			else if (kind == MB_DATA_NAV1)
-				{
-				n_rf_nav1++;
-				n_rt_nav1++;
-				}
-			else if (kind == MB_DATA_NAV2)
-				{
-				n_rf_nav2++;
-				n_rt_nav2++;
-				}
-			else if (kind == MB_DATA_NAV3)
-				{
-				n_rf_nav3++;
-				n_rt_nav3++;
-				}
-			else if (kind == MB_DATA_ATTITUDE)
-				{
-				n_rf_att++;
-				n_rt_att++;
-				}
-			else if (kind == MB_DATA_ATTITUDE1)
-				{
-				n_rf_att1++;
-				n_rt_att1++;
-				}
-			else if (kind == MB_DATA_ATTITUDE2)
-				{
-				n_rf_att2++;
-				n_rt_att2++;
-				}
-			else if (kind == MB_DATA_ATTITUDE3)
-				{
-				n_rf_att3++;
-				n_rt_att3++;
-				}
-
-			timestamp_changed = MB_NO;
-			nav_changed = MB_NO;
-			heading_changed = MB_NO;
-			sensordepth_changed = MB_NO;
-			attitude_changed = MB_NO;
-				
-			/* apply preprocessing to survey data records */
-			if (status == MB_SUCCESS
-				&& (kind == MB_DATA_DATA
-					|| kind == MB_DATA_SUBBOTTOM_MCS
-					|| kind == MB_DATA_SUBBOTTOM_CNTRBEAM
-					|| kind == MB_DATA_SUBBOTTOM_SUBBOTTOM
-					|| kind == MB_DATA_SIDESCAN2
-					|| kind == MB_DATA_SIDESCAN3
-					|| kind == MB_DATA_WATER_COLUMN))
-				{
-				/* call mb_extract_nav to get attitude */
-				status = mb_extract_nav(verbose, imbio_ptr, istore_ptr, &kind,
-							time_i, &time_d, &navlon_org, &navlat_org,
-							&speed_org, &heading_org, &draft_org,
-							&roll_org, &pitch_org, &heave_org, &error);
-				
-				/* call mb_extract_altitude to get altitude */
-				status = mb_extract_altitude(verbose, imbio_ptr, istore_ptr,
-							&kind, &sensordepth_org, &altitude_org,
-							&error);
-				
-				/* save the original values */
-				navlon = navlon_org;
-				navlat = navlat_org;
-				speed = speed_org;
-				heading = heading_org;
-				altitude = altitude_org;
-				sensordepth = sensordepth_org;
-				draft = draft_org;
-				roll = roll_org;
-				pitch = pitch_org;
-				heave = heave_org;
-					
-				/* apply timeshift to survey data */
-				if (timeshift_apply & MBPREPROCESS_TIMESHIFT_APPLY_SURVEY)
-					{
-					if (timeshift_mode == MBPREPROCESS_TIMESHIFT_FILE)
-						{
-						interp_status = mb_linear_interp(verbose,
-										timeshift_time_d-1, timeshift_timeshift-1,
-										timeshift_num, time_d, &timeshift, &jsurvey,
-										&interp_error);
-						time_d += timeshift;						
-						}
-					else if (timeshift_mode == MBPREPROCESS_TIMESHIFT_CONSTANT)
-						{
-						time_d += timeshift_constant;
-						}
-					timestamp_changed = MB_YES;
-					}
-
-				/* get nav sensordepth heading attitude values for record timestamp */
-				if (nav_num > 0)
-					{
-					interp_status = mb_linear_interp_longitude(verbose,
-								nav_time_d-1, nav_navlon-1, nav_num, 
-								time_d, &navlon, &jnav,
-								&interp_error);
-					interp_status = mb_linear_interp_latitude(verbose,
-								nav_time_d-1, nav_navlat-1, nav_num, 
-								time_d, &navlat, &jnav,
-								&interp_error);
-					interp_status = mb_linear_interp(verbose,
-								nav_time_d-1, nav_speed-1, nav_num, 
-								time_d, &speed, &jnav,
-								&interp_error);
-					nav_changed = MB_YES;
-					}
-				if (sensordepth_num > 0)
-					{
-					interp_status = mb_linear_interp(verbose,
-								sensordepth_time_d-1, sensordepth_sensordepth-1, sensordepth_num, 
-								time_d, &sensordepth, &jsensordepth,
-								&interp_error);
-					sensordepth_changed = MB_YES;
-					}
-				if (heading_num > 0)
-					{
-					interp_status = mb_linear_interp_heading(verbose,
-								heading_time_d-1, heading_heading-1, heading_num, 
-								time_d, &heading, &jheading,
-								&interp_error);
-					heading_changed = MB_YES;
-					}
-				if (altitude_num > 0)
-					{
-					interp_status = mb_linear_interp(verbose,
-								altitude_time_d-1, altitude_altitude-1, altitude_num, 
-								time_d, &altitude, &jaltitude,
-								&interp_error);
-					altitude_changed = MB_YES;
-					}
-				if (attitude_num > 0)
-					{
-					interp_status = mb_linear_interp(verbose,
-								attitude_time_d-1, attitude_roll-1, attitude_num, 
-								time_d, &roll, &jattitude,
-								&interp_error);
-					interp_status = mb_linear_interp(verbose,
-								attitude_time_d-1, attitude_pitch-1, attitude_num, 
-								time_d, &pitch, &jattitude,
-								&interp_error);
-					interp_status = mb_linear_interp(verbose,
-								attitude_time_d-1, attitude_heave-1, attitude_num, 
-								time_d, &heave, &jattitude,
-								&interp_error);
-					attitude_changed = MB_YES;
-					}
-				if (sensordepth_num > 0 || attitude_num > 0)
-					{
-					draft = sensordepth - heave;
-					}
-					
-				/* attempt to execute a preprocess function for these data */
-				//status = mb_preprocess(verbose, imbio_ptr, istore_ptr,
-				//			time_d, navlon, navlat, speed,
-				//			heading, sensordepth,
-				//			roll, pitch, heave, &error);
-				status = MB_FAILURE;
-				
-				/* If a predefined preprocess function does not exist for 
-				 * this format then standard preprocessing will be done
-				 *      1) Replace time tag, nav, attitude
-				 * 	2) if attitude values changed rotate bathymetry accordingly
-				 * 	3) if any values changed reinsert the data */
-				if (status == MB_FAILURE)
-					{
-					/* reset status and error */
-					status = MB_SUCCESS;
-					error = MB_ERROR_NO_ERROR;
-					
-					/* if sensor offsets have been defined, apply lever arm correction */
-					if (sonar_offset_mode == MB_YES
-						|| vru_offset_mode == MB_YES
-						|| navigation_offset_mode == MB_YES)
-						{
-						/* do lever arm calculation with sensor offsets */
-						mb_lever(verbose, sonar_offset_x, sonar_offset_y, sonar_offset_z,
-								vru_offset_x, vru_offset_y, vru_offset_z,
-								navigation_offset_x, navigation_offset_y, navigation_offset_z,
-								pitch, roll,
-								&lever_x, &lever_y, &lever_z, &error);
-//fprintf(stderr,"LEVER:  roll:%f pitch:%f   lever: %f %f %f\n", roll, pitch, lever_x, lever_y, lever_z);
-						
-						/* get local translation between lon lat degrees and meters */
-						mb_coor_scale(verbose,navlat,&mtodeglon,&mtodeglat);
-						headingx = sin(DTR*heading);
-						headingy = cos(DTR*heading);	
-	
-						/* apply position offsets */
-						if (sonar_offset_x != 0.0 || sonar_offset_y != 0.0)
-							{
-							navlon += headingy * sonar_offset_x * mtodeglon
-									+ headingx * sonar_offset_y * mtodeglon;
-							navlat+= -headingx * sonar_offset_x * mtodeglat
-									+ headingy * sonar_offset_y * mtodeglat;
-							nav_changed = MB_YES;
-//fprintf(stderr,"HEADING: %f  %f %f POSITION OFFSET: meters: %f %f   lonlat: %f %f ",
-//heading, headingx, headingy,
-//sonar_offset_x, sonar_offset_y,
-//headingy * sonar_offset_x * mtodeglon + headingx * sonar_offset_y * mtodeglon,
-//-headingx * sonar_offset_x * mtodeglat + headingy * sonar_offset_y * mtodeglat);
-							}
-						if (sonar_offset_z != 0.0)
-							{
-							sensordepth -= sonar_offset_z;
-							sensordepth_changed = MB_YES;
-//fprintf(stderr,"SENSORDEPTH OFFSET: %f ",-sonar_offset_z);
-							}
-
-						/* apply lever arm calculation */
-						if (lever_x != 0.0 || lever_y != 0.0)
-							{
-							navlon += headingy * lever_x * mtodeglon
-									+ headingx * lever_y * mtodeglon;
-							navlat+= -headingx * lever_x * mtodeglat
-									+ headingy * lever_y * mtodeglat;
-							nav_changed = MB_YES;
-//fprintf(stderr,"LEVER ARM XY OFFSET: meters: %f %f   lonlat: %f %f ",
-//lever_x, lever_y,
-//headingy * lever_x * mtodeglon + headingx * lever_y * mtodeglon,
-//-headingx * lever_x * mtodeglat + headingy * lever_y * mtodeglat);
-							}
-						if (lever_z != 0.0)
-							{
-							sensordepth -= lever_z;
-							sensordepth_changed = MB_YES;
-//fprintf(stderr,"LEVER ARM Z OFFSET: %f ",-lever_z);
-							}						
-//if (sonar_offset_x != 0.0 || sonar_offset_y != 0.0 || sonar_offset_z != 0.0
-//|| lever_x != 0.0 || lever_y != 0.0 || lever_z != 0.0)
-//fprintf(stderr,"\n");
-						}
-					
-					/* if attitude changed apply rigid rotations to the bathymetry */
-					if (attitude_changed == MB_YES)
-						{				
-						/* add heave and draft */
-						depth_offset_use = heave + draft;
-						depth_offset_org = heave + draft_org;
-
-						/* loop over the beams */
-						for (i=0;i<beams_bath;i++)
-							{
-							if (beamflag[i] != MB_FLAG_NULL)
-								{
-								/* output some debug messages */
-								if (verbose >= 5)
-									{
-									fprintf(stderr,"\ndbg5  Depth value to be calculated in program <%s>:\n",program_name);
-									fprintf(stderr,"dbg5       kind:  %d\n",kind);
-									fprintf(stderr,"dbg5       beam:  %d\n",i);
-									fprintf(stderr,"dbg5       xtrack: %f\n",bathacrosstrack[i]);
-									fprintf(stderr,"dbg5       ltrack: %f\n",bathalongtrack[i]);
-									fprintf(stderr,"dbg5       depth:  %f\n",bath[i]);
-									}
-				
-								/* strip off heave + draft */
-								bath[i] -= depth_offset_org;
-				
-								/* get range and angles in
-								    roll-pitch frame */
-								range = sqrt(bath[i] * bath[i]
-									    + bathacrosstrack[i]
-										* bathacrosstrack[i]
-									    + bathalongtrack[i]
-										* bathalongtrack[i]);
-								if (fabs(range) < 0.001)
-									{
-									alphar = 0.0;
-									betar = 0.5 * M_PI;
-									}
-								else
-									{
-									alphar = asin(MAX(-1.0, MIN(1.0, (bathalongtrack[i] / range))));
-									betar = acos(MAX(-1.0, MIN(1.0, (bathacrosstrack[i] / range / cos(alphar)))));
-									}
-								if (bath[i] < 0.0)
-									betar = 2.0 * M_PI - betar;
-				
-								/* apply roll pitch corrections */
-								betar += DTR * (roll - roll_org);
-								alphar += DTR * (pitch - pitch_org);
-				
-								/* recalculate bathymetry */
-								bath[i] = range * cos(alphar) * sin(betar);
-								bathalongtrack[i] = range * sin(alphar);
-								bathacrosstrack[i] = range * cos(alphar) * cos(betar);
-				
-								/* add heave and draft back in */
-								bath[i] += depth_offset_use;
-								
-								/* output some debug messages */
-								if (verbose >= 5)
-									{
-									fprintf(stderr,"\ndbg5  Depth value calculated in program <%s>:\n",program_name);
-									fprintf(stderr,"dbg5       kind:  %d\n",kind);
-									fprintf(stderr,"dbg5       beam:  %d\n",i);
-									fprintf(stderr,"dbg5       xtrack: %f\n",bathacrosstrack[i]);
-									fprintf(stderr,"dbg5       ltrack: %f\n",bathalongtrack[i]);
-									fprintf(stderr,"dbg5       depth:  %f\n",bath[i]);
-									}
-								}
-							}
-						}
-		    
-					/* recalculate bathymetry by changes to sensor depth  */
-					else if (sensordepth_changed == MB_YES)
-						{
-						/* get draft change */
-						depth_offset_change = draft - draft_org;
-/* fprintf(stderr, "time:%f  drafts:%f %f  lever:%f  depth_offset_change:%f\n",
-time_d, draft, draft_org, lever_heave, depth_offset_change);*/
-			    
-						/* loop over the beams */
-						for (i=0;i<beams_bath;i++)
-							{
-							if (beamflag[i] != MB_FLAG_NULL)
-								{
-								/* apply transducer depth change to depths */
-								bath[i] += depth_offset_change;
-/* fprintf(stderr,"depth_offset_change:%f bath[%d]:%f\n",depth_offset_change,i,bath[i]);*/
-				
-								/* output some debug messages */
-								if (verbose >= 5)
-									{
-									fprintf(stderr,"\ndbg5  Depth value calculated in program <%s>:\n",program_name);
-									fprintf(stderr,"dbg5       kind:  %d\n",kind);
-									fprintf(stderr,"dbg5       beam:  %d\n",i);
-									fprintf(stderr,"dbg5       xtrack: %f\n",bathacrosstrack[i]);
-									fprintf(stderr,"dbg5       ltrack: %f\n",bathalongtrack[i]);
-									fprintf(stderr,"dbg5       depth:  %f\n",bath[i]);
-									}
-								}
-							}
-/*fprintf(stderr, "time:%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d draft:%f depth_offset_change:%f\n",
-time_i[0], time_i[1], time_i[2], time_i[3],
-time_i[4], time_i[5], time_i[6], draft, depth_offset_change);*/
-						}
-
-					/* insert navigation */
-					if (nav_changed == MB_YES
-						|| heading_changed == MB_YES
-						|| sensordepth_changed == MB_YES
-						|| attitude_changed == MB_YES)
-						{
-						status = mb_insert_nav(verbose, imbio_ptr, istore_ptr,
-									time_i, time_d, navlon, navlat,
-									speed, heading, draft,
-									roll, pitch, heave, &error);
-						}
-				
-					/* insert altitude */
-					if (altitude_changed == MB_YES)
-						{
-						status = mb_insert_altitude(verbose, imbio_ptr, istore_ptr,
-									sensordepth, altitude, &error);
-						if (status == MB_FAILURE)
-							{
-							status = MB_SUCCESS;
-							error = MB_ERROR_NO_ERROR;
-							}
-						}
-						
-					/* if attitude changed apply rigid rotations to the bathymetry */
-					if (no_change_survey == MB_NO
-						&& (attitude_changed == MB_YES
-							|| sensordepth_changed == MB_YES))
-						{
-						status = mb_insert(verbose,imbio_ptr,
-									istore_ptr, kind,
-									time_i, time_d,
-									navlon, navlat, speed, heading,
-									beams_bath,beams_amp,pixels_ss,
-									beamflag, bath, amp, bathacrosstrack, bathalongtrack,
-									ss, ssacrosstrack, ssalongtrack,
-									comment, &error);
-						}
-					}
-				}
-
-			/* write some data */
-			if (error == MB_ERROR_NO_ERROR)
-				{
-				status = mb_put_all(verbose,ombio_ptr,
-						istore_ptr,MB_NO,kind,
-						time_i,time_d,
-						navlon,navlat,speed,heading,
-						obeams_bath,obeams_amp,opixels_ss,
-						beamflag,bath,amp,bathacrosstrack,bathalongtrack,
-						ss,ssacrosstrack,ssalongtrack,
-						comment,&error);
-				if (status != MB_SUCCESS)
-					{
-					mb_error(verbose,error,&message);
-					fprintf(stderr,"\nMBIO Error returned from function <mb_put>:\n%s\n",message);
-					fprintf(stderr,"\nMultibeam Data Not Written To File <%s>\n",ofile);
-					fprintf(stderr,"\nProgram <%s> Terminated\n",
-						program_name);
-					exit(error);
-					}
-				
-				/* count records */
-				if (kind == MB_DATA_DATA)
-					{
-					n_wf_data++;
-					n_wt_data++;
-					}
-				else if (kind == MB_DATA_COMMENT)
-					{
-					n_wf_comment++;
-					n_wt_comment++;
-					}
-				else if (kind == MB_DATA_NAV)
-					{
-					n_wf_nav++;
-					n_wt_nav++;
-					}
-				else if (kind == MB_DATA_NAV1)
-					{
-					n_wf_nav1++;
-					n_wt_nav1++;
-					}
-				else if (kind == MB_DATA_NAV2)
-					{
-					n_wf_nav2++;
-					n_wt_nav2++;
-					}
-				else if (kind == MB_DATA_NAV3)
-					{
-					n_wf_nav3++;
-					n_wt_nav3++;
-					}
-				else if (kind == MB_DATA_ATTITUDE)
-					{
-					n_wf_att++;
-					n_wt_att++;
-					}
-				else if (kind == MB_DATA_ATTITUDE1)
-					{
-					n_wf_att1++;
-					n_wt_att1++;
-					}
-				else if (kind == MB_DATA_ATTITUDE2)
-					{
-					n_wf_att2++;
-					n_wt_att2++;
-					}
-				else if (kind == MB_DATA_ATTITUDE3)
-					{
-					n_wf_att3++;
-					n_wt_att3++;
-					}
-				}
-			}
-		/* end read+process+output data loop */
-		/* --------------------------------- */
-		
-		/* output data counts */
-		if (verbose > 0)
-			{
-			fprintf(stderr,"Pass 2: Records read from input file %s\n", ifile);
-			fprintf(stderr,"     %d survey records\n", n_rf_data);
-			fprintf(stderr,"     %d comment records\n", n_rf_comment);
-			fprintf(stderr,"     %d nav records\n", n_rf_nav);
-			fprintf(stderr,"     %d nav1 records\n", n_rf_nav1);
-			fprintf(stderr,"     %d nav2 records\n", n_rf_nav2);
-			fprintf(stderr,"     %d nav3 records\n", n_rf_nav3);
-			fprintf(stderr,"     %d att records\n", n_rf_att);
-			fprintf(stderr,"     %d att1 records\n", n_rf_att1);
-			fprintf(stderr,"     %d att2 records\n", n_rf_att2);
-			fprintf(stderr,"     %d att3 records\n", n_rf_att3);
-			fprintf(stderr,"Pass 2: Records written to output file %s\n", ofile);
-			fprintf(stderr,"     %d survey records\n", n_wf_data);
-			fprintf(stderr,"     %d comment records\n", n_wf_comment);
-			fprintf(stderr,"     %d nav records\n", n_wf_nav);
-			fprintf(stderr,"     %d nav1 records\n", n_wf_nav1);
-			fprintf(stderr,"     %d nav2 records\n", n_wf_nav2);
-			fprintf(stderr,"     %d nav3 records\n", n_wf_nav3);
-			fprintf(stderr,"     %d att records\n", n_wf_att);
-			fprintf(stderr,"     %d att1 records\n", n_wf_att1);
-			fprintf(stderr,"     %d att2 records\n", n_wf_att2);
-			fprintf(stderr,"     %d att3 records\n", n_wf_att3);
-			}
-	
-		/* close the input swath file */
-		status = mb_close(verbose,&imbio_ptr,&error);
-
-		/* close the output swath file */
-		status = mb_close(verbose,&ombio_ptr,&error);
-	
-		/* generate inf fnv and fbt files */
-		if (status == MB_SUCCESS)
-			status = mb_make_info(verbose, MB_YES, ofile, oformat, &error);
-	
-		/* figure out whether and what to read next */
-		if (read_datalist == MB_YES)
-			{
-			if ((status = mb_datalist_read(verbose,datalist,
-				    ifile,&format,&file_weight,&error))
-				    == MB_SUCCESS)
-				read_data = MB_YES;
-			else
-				read_data = MB_NO;
-			}
-		else
-			{
-			read_data = MB_NO;
-			}
-
-	
-		/* end loop over files in list */
-		}
-	if (read_datalist == MB_YES)
-		mb_datalist_close(verbose,&datalist,&error);
-	
-	/* output data counts */
-	if (verbose > 0)
-		{
-		fprintf(stderr,"\nPass 2: Total records read from all input files\n");
-		fprintf(stderr,"     %d survey records\n", n_rt_data);
-		fprintf(stderr,"     %d comment records\n", n_rt_comment);
-		fprintf(stderr,"     %d nav records\n", n_rt_nav);
-		fprintf(stderr,"     %d nav1 records\n", n_rt_nav1);
-		fprintf(stderr,"     %d nav2 records\n", n_rt_nav2);
-		fprintf(stderr,"     %d nav3 records\n", n_rt_nav3);
-		fprintf(stderr,"     %d att records\n", n_rt_att);
-		fprintf(stderr,"     %d att1 records\n", n_rt_att1);
-		fprintf(stderr,"     %d att2 records\n", n_rt_att2);
-		fprintf(stderr,"     %d att3 records\n", n_rt_att3);
-		fprintf(stderr,"Pass 2: Total records written to all output files\n");
-		fprintf(stderr,"     %d survey records\n", n_wt_data);
-		fprintf(stderr,"     %d comment records\n", n_wt_comment);
-		fprintf(stderr,"     %d nav records\n", n_wt_nav);
-		fprintf(stderr,"     %d nav1 records\n", n_wt_nav1);
-		fprintf(stderr,"     %d nav2 records\n", n_wt_nav2);
-		fprintf(stderr,"     %d nav3 records\n", n_wt_nav3);
-		fprintf(stderr,"     %d att records\n", n_wt_att);
-		fprintf(stderr,"     %d att1 records\n", n_wt_att1);
-		fprintf(stderr,"     %d att2 records\n", n_wt_att2);
-		fprintf(stderr,"     %d att3 records\n", n_wt_att3);
-		}
-		
-	/* end second pass through data */
-	
-	/*-------------------------------------------------------------------*/
-
-	/* deallocate nav, sensordepth, heading, attitude, and timeshift arrays */
-	if (nav_alloc > 0)
-		{
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&nav_time_d,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&nav_navlon,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&nav_navlat,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&nav_speed,&error);
-		}
-	if (sensordepth_alloc > 0)
-		{
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&sensordepth_time_d,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&sensordepth_sensordepth,&error);
-		}
-	if (heading_alloc > 0)
-		{
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&heading_time_d,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&heading_heading,&error);
-		}
-	if (attitude_alloc > 0)
-		{
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&attitude_time_d,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&attitude_roll,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&attitude_pitch,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&attitude_heave,&error);
-		}
-	if (timeshift_alloc > 0)
-		{
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&timeshift_time_d,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&timeshift_timeshift,&error);
-		}
-
-	/* check memory */
-	if (verbose >= 4)
-		status = mb_memory_list(verbose,&error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  Program <%s> completed\n",
-			program_name);
-		fprintf(stderr,"dbg2  Ending status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* end it all */
-	exit(error);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/utilities/mbprocess.c b/src/utilities/mbprocess.c
deleted file mode 100644
index fe2907f..0000000
--- a/src/utilities/mbprocess.c
+++ /dev/null
@@ -1,7245 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbprocess.c	3/31/93
- *    $Id: mbprocess.c 2250 2015-06-30 02:12:26Z caress $
- *
- *    Copyright (c) 2000-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbprocess is a tool for processing swath sonar bathymetry data.
- * This program performs a number of functions, including:
- *   - merging navigation
- *   - recalculating bathymetry from travel time and angle data
- *     by raytracing through a layered water sound velocity model.
- *   - applying changes to ship draft, roll bias and pitch bias
- *   - applying bathymetry edits from edit save files.
- * The parameters controlling mbprocess are included in an ascii
- * parameter file. The parameter file syntax is documented by
- * comments in the source file mbsystem/src/mbio/mb_process.h
- * and the manual pages for mbprocess and mbset. The program
- * mbset is used to create and modify parameter files.
- * The data format and the input and output data files can be
- * specified using command line options. If no parameter file is
- * specified (using the -P option) but an input file is specified
- * (with the -I option), then mbprocess will look for a parameter
- * file with the path inputfile.par, where inputfile is the input
- * file path.\n";
- *
- * Author:	D. W. Caress
- * Date:	January 4, 2000
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <math.h>
-#include <string.h>
-#include <time.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-
-/* mbio include files */
-#include "mb_format.h"
-#include "mb_status.h"
-#include "mb_define.h"
-#include "mb_aux.h"
-#include "mb_process.h"
-#include "mb_swap.h"
-#include "mbsys_atlas.h"
-#include "mbsys_simrad2.h"
-#include "mbsys_simrad3.h"
-#include "mbsys_reson7k.h"
-#include "gsf.h"
-#include "mbsys_gsf.h"
-
-/* define sidescan correction table structure */
-struct mbprocess_sscorr_struct
-	{
-	double	time_d;
-	int	nangle;
-	double	*angle;
-	double	*amplitude;
-	double	*sigma;
-	};
-
-/* define grid structure */
-struct mbprocess_grid_struct
-	{
-	mb_path	file;
-        mb_path projectionname;
-	int	projection_mode;
-	mb_path	projection_id;
-	float	nodatavalue;
-	int	nxy;
-	int	nx;
-	int	ny;
-	double	min;
-	double	max;
-	double	xmin;
-	double	xmax;
-	double	ymin;
-	double	ymax;
-	double	dx;
-	double	dy;
-	float	*data;
-	};
-
-/* function prototypes */
-int check_ss_for_bath(int verbose,
-	int nbath, char *beamflag, double *bath, double *bathacrosstrack,
-	int nss, double *ss, double *ssacrosstrack,
-	int *error);
-int get_corrtable(int verbose,
-	double time_d, int ncorrtable, int ncorrangle,
-	struct mbprocess_sscorr_struct	*corrtable,
-	struct mbprocess_sscorr_struct	*corrtableuse,
-	int *error);
-int get_anglecorr(int verbose,
-	int nangle, double *angles, double *corrs,
-	double angle, double *corr, int *error);
-
-static char rcs_id[] = "$Id: mbprocess.c 2250 2015-06-30 02:12:26Z caress $";
-
-/*--------------------------------------------------------------------*/
-
-int main (int argc, char **argv)
-{
-	/* id variables */
-	char program_name[] = "mbprocess";
-	char help_message[] =  "mbprocess is a tool for processing swath sonar bathymetry data.\n\
-This program performs a number of functions, including:\n\
-  - merging navigation\n\
-  - recalculating bathymetry from travel time and angle data\n\
-    by raytracing through a layered water sound velocity model.\n\
-  - applying changes to ship draft, roll bias and pitch bias\n\
-  - applying bathymetry edits from edit save files.\n\
-The parameters controlling mbprocess are included in an ascii\n\
-parameter file. The parameter file syntax is documented by\n\
-the manual pages for mbprocess and mbset. The program\n\
-mbset is used to create and modify parameter files.\n\
-The input file \"infile\"  must be specified with the -I option. The\n\
-data format can also be specified, thought the program can\n\
-infer the format if the standard MB-System suffix convention\n\
-is used (*.mbXXX where XXX is the MB-System format id number).\n\
-The program will look for and use a parameter file with the \n\
-name \"infile.par\". If no parameter file exists, the program \n\
-will infer a reasonable processing path by looking for navigation\n\
-and mbedit edit save files.\n";
-	char usage_message[] = "mbprocess -Iinfile [-C -Fformat -N -Ooutfile -P -S -T -V -H]";
-
-	/* parsing variables */
-	extern char *optarg;
-	int	errflg = 0;
-	int	c;
-	int	help = 0;
-	int	flag = 0;
-
-	/* MBIO status variables */
-	int	status = MB_SUCCESS;
-	int	verbose = 0;
-	int	error = MB_ERROR_NO_ERROR;
-	char	*message = NULL;
-
-	/* MBIO read and write control parameters */
-	int	pings;
-	int	lonflip;
-	double	bounds[4];
-	int	btime_i[7];
-	int	etime_i[7];
-	double	btime_d;
-	double	etime_d;
-	double	speedmin;
-	double	timegap;
-	int	beams_bath;
-	int	beams_amp;
-	int	pixels_ss;
-	void	*imbio_ptr = NULL;
-	void	*ombio_ptr = NULL;
-        int     nav_source;
-        int     heading_source;
-	int     vru_source;
-        int     svp_source;
-
-	/* mbio read and write values */
-	void	*store_ptr = NULL;
-	int	kind;
-	int	time_i[7];
-	double	time_d;
-	double	navlon;
-	double	navlat;
-	double	speed;
-	double	heading;
-	double	distance;
-	double	altitude;
-	double	sonardepth;
-	double	draft;
-	double	roll;
-	double	pitch;
-	double	heave;
-	int	nbath;
-	int	namp;
-	int	nss;
-	char	*beamflag = NULL;
-	double	*bath = NULL;
-	double	*bathacrosstrack = NULL;
-	double	*bathalongtrack = NULL;
-	double	*amp = NULL;
-	double	*ss = NULL;
-	double	*ssacrosstrack = NULL;
-	double	*ssalongtrack = NULL;
-	int	idata = 0;
-	int	inav = 0;
-	int	icomment = 0;
-	int	iother = 0;
-	int	odata = 0;
-	int	onav = 0;
-	int	ocomment = 0;
-	int	oother = 0;
-	char	comment[MB_COMMENT_MAXLINE];
-
-	/* sidescan recalculation */
-	int	pixel_size_set;
-	int	swath_width_set;
-	int	pixel_int;
-	double	pixel_size;
-	double	swath_width;
-
-	/* time, user, host variables */
-	time_t	right_now;
-	char	date[32], user[MBP_FILENAMESIZE], *user_ptr, host[MBP_FILENAMESIZE];
-
-	/* parameter controls */
-	struct mb_process_struct process;
-
-	/* processing variables */
-	int	checkuptodate = MB_YES;
-	int	testonly = MB_NO;
-	int	printfilestatus = MB_NO;
-	int	read_datalist = MB_NO;
-	int	read_data = MB_NO;
-	char	read_file[MB_PATH_MAXLINE];
-	void	*datalist;
-	int	look_processed = MB_DATALIST_LOOK_NO;
-	double	file_weight;
-	int	proceedprocess= MB_NO;
-	int	outofdate = MB_NO;
-	double	time_d_lastping = 0.0;
-	int	ifilemodtime = 0;
-	int	ofilemodtime = 0;
-	int	pfilemodtime = 0;
-	int	navfilemodtime = 0;
-	int	navadjfilemodtime = 0;
-	int	attitudefilemodtime = 0;
-	int	sonardepthfilemodtime = 0;
-	int	esfmodtime = 0;
-	int	svpmodtime = 0;
-	char	str_process_yes[] = "**: Data processed";
-	char	str_process_no[] = "--: Data not processed";
-	char	str_process_yes_test[] = "Data processed (test-only mode)";
-	char	str_process_no_test[] = "Data not processed (test-only mode)";
-	char	str_outofdate_yes[] = "out of date";
-	char	str_outofdate_overridden[] = "up to date but overridden";
-	char	str_outofdate_no[] = "up to date";
-	char	str_locked_yes[] = "locked";
-	char	str_locked_ignored[] = "locked but lock ignored";
-	char	str_locked_fail[] = "unlocked but set lock failed";
-	char	str_locked_no[] = "unlocked";
- 	int	format = 0;
-	int	variable_beams;
-	int	traveltime;
-	int	beam_flagging;
-	int	calculatespeedheading = MB_NO;
-	int	mbp_ifile_specified;
-	char	mbp_ifile[MBP_FILENAMESIZE];
-	char	mbp_pfile[MBP_FILENAMESIZE];
-	int	mbp_ofile_specified;
-	char	mbp_ofile[MBP_FILENAMESIZE];
-	int	mbp_format_specified;
-	int	mbp_format;
-	int	strip_comments;
-	FILE	*tfp;
-	struct stat file_status;
-	int	fstat;
-	int	nnav = 0;
-	int	nanav = 0;
-	int	nattitude = 0;
-	int	nsonardepth = 0;
-	int	ntide = 0;
-	int	nstatic = 0;
-	int	size, nchar, len, nget, nav_ok, attitude_ok, sonardepth_ok, tide_ok, static_ok;
-	int	time_j[5], stime_i[7], ftime_i[7];
-	int	ihr;
-	double	sec, hr;
-	int	quality, nsatellite, dilution, gpsheight;
-	char	*bufftmp;
-	char	NorS[2], EorW[2];
-	double	mlon, llon, mlat, llat;
-	int	degree, time_set;
-	double	dminute;
-	double	splineflag;
-	double	*ntime = NULL;
-        double  *nlon = NULL;
-        double  *nlat = NULL;
-        double  *nheading = NULL;
-        double  *nspeed = NULL;
-        double  *ndraft = NULL;
-        double  *nroll = NULL;
-        double  *npitch = NULL;
-        double  *nheave = NULL;
-        double  *natime = NULL;
-        double  *nalon = NULL;
-        double  *nalat = NULL;
-        double  *naz = NULL;
-        double  zoffset;
-	double	*nlonspl = NULL;
-        double  *nlatspl = NULL;
-        double  *nalonspl = NULL;
-        double  *nalatspl = NULL;
-        double  *nazspl = NULL;
-        double  *attitudetime = NULL;
-        double  *attituderoll = NULL;
-        double  *attitudepitch = NULL;
-        double  *attitudeheave = NULL;
-	double	*fsonardepthtime = NULL;
-        double  *fsonardepth = NULL;
-	double	*tidetime = NULL;
-        double  *tide = NULL;
-        double  tideval;
-	int	*staticbeam = NULL;
-	double  *staticangle; 
-	double	*staticoffset = NULL;
-	int	itime, iatime;
-	double	headingx, headingy;
-	double	mtodeglon, mtodeglat;
-	double	del_time, dx, dy, dist;
-        double  headingcalc, speedcalc;
-	double	lever_x = 0.0;
-	double	lever_y = 0.0;
-	double	lever_heave = 0.0;
-	double	time_d_old = 0.0;
-	double	navlon_old = 0.0;
-	double	navlat_old = 0.0;
-	double	speed_old = 0.0;
-	double	heading_old = 0.0;
-	int	nsvp = 0;
-	double	*depth = NULL;
-	double	*velocity = NULL;
-	double	*velocity_sum = NULL;
-	void	*rt_svp = NULL;
-	double	ssv;
-
-	/* swath file locking variables */
-	int	uselockfiles;
-	int	lock_status;
-	int	lock_error;
-	int	locked;
-	int	lock_purpose;
-	mb_path	lock_program;
-	mb_path lock_cpu;
-	mb_path lock_user;
-	mb_path	lock_date;
-
-	/* edit save file control variables */
-	struct mb_esf_struct esf;
-	int	neditnull;
-	int	neditduplicate;
-	int	neditnotused;
-	int	neditused;
-
-	double	draft_org, depth_offset_use, depth_offset_change, depth_offset_org, static_shift;
-	double	roll_org, pitch_org, heave_org;
-	double	ttime, range;
-	double	xx, zz, rr, vsum, vavg;
-	double	alpha, beta;
-        double  alphar, betar;
-	int	ray_stat;
-	double	*ttimes = NULL;
-	double	*angles = NULL;
-	double	*angles_forward = NULL;
-	double	*angles_null = NULL;
-	double	*bheave = NULL;
-	double	*alongtrack_offset = NULL;
-
-	/* ssv handling variables */
-	int	ssv_prelimpass = MB_NO;
-	double	ssv_default;
-	double	ssv_start;
-
-	/* sidescan correction */
-	double	altitude_default = 1000.0;
-	int	nsmooth = 5;
-	double	reference_amp;
-	double	reference_amp_port;
-	double	reference_amp_stbd;
-	int	itable;
-	int	nsscorrtable = 0;
-	int	nsscorrangle = 0;
-	struct mbprocess_sscorr_struct	*sscorrtable = NULL;
-	struct mbprocess_sscorr_struct	sscorrtableuse;
-	int	nampcorrtable = 0;
-	int	nampcorrangle = 0;
-	struct mbprocess_sscorr_struct	*ampcorrtable = NULL;
-	struct mbprocess_sscorr_struct	ampcorrtableuse;
-	int	ndepths;
-	double	*depths = NULL;
-	double	*depthsmooth = NULL;
-	double	*depthacrosstrack = NULL;
-	int	nslopes;
-	double	*slopes = NULL;
-	double	*slopeacrosstrack = NULL;
-	double	r[3];
-	double	v1[3], v2[3], v[3], vv;
-	double	slope;
-	double	bathy;
-	double	altitude_use;
-	double	angle;
-	double	correction;
-
-	/* topography parameters */
-	struct mbprocess_grid_struct grid;
-
-	char	buffer[MBP_FILENAMESIZE], dummy[MBP_FILENAMESIZE], *result;
-	char	*string1, *string2, *string3;
-	double	factor;
-	int	pingmultiplicity;
-	int	nbeams;
-	int	istart, iend, icut;
-	int	intstat;
-	int	ioff;
-	int	i, j, k, mm;
-	int	ix, jy, kgrid;
-	int	kgrid00, kgrid10,kgrid01,kgrid11;
-
-	char	*ctime();
-	char	*getenv();
-
-	/* get current default values */
-	status = mb_defaults(verbose,&mbp_format,&pings,&lonflip,bounds,
-		btime_i,etime_i,&speedmin,&timegap);
-	status = mb_uselockfiles(verbose,&uselockfiles);
-
-	/* reset all defaults */
-	pings = 1;
-	lonflip = 0;
-	bounds[0] = -360.;
-	bounds[1] = 360.;
-	bounds[2] = -90.;
-	bounds[3] = 90.;
-	btime_i[0] = 1962;
-	btime_i[1] = 2;
-	btime_i[2] = 21;
-	btime_i[3] = 10;
-	btime_i[4] = 30;
-	btime_i[5] = 0;
-	btime_i[6] = 0;
-	etime_i[0] = 2062;
-	etime_i[1] = 2;
-	etime_i[2] = 21;
-	etime_i[3] = 10;
-	etime_i[4] = 30;
-	etime_i[5] = 0;
-	etime_i[6] = 0;
-	speedmin = 0.0;
-	timegap = 1000000000.0;
-
-	/* set default input and output */
-	mbp_ifile_specified = MB_NO;
-	strcpy (mbp_ifile, "\0");
-	mbp_ofile_specified = MB_NO;
-	strcpy (mbp_ofile, "\0");
-	mbp_format_specified = MB_NO;
-	strip_comments = MB_NO;
-
-	/* initialize grid */
-	memset(&grid, 0, sizeof (struct mbprocess_grid_struct));
-
-	/* process argument list */
-	while ((c = getopt(argc, argv, "VvHhF:f:I:i:NnO:o:PpSsTt")) != -1)
-	  switch (c)
-		{
-		case 'H':
-		case 'h':
-			help++;
-			break;
-		case 'V':
-		case 'v':
-			verbose++;
-			flag++;
-			break;
-		case 'F':
-		case 'f':
-			sscanf (optarg,"%d", &format);
-			mbp_format_specified = MB_YES;
-			flag++;
-			break;
-		case 'I':
-		case 'i':
-			mbp_ifile_specified = MB_YES;
-			sscanf (optarg,"%s", read_file);
-			flag++;
-			break;
-		case 'N':
-		case 'n':
-			strip_comments = MB_YES;
-			flag++;
-			break;
-		case 'O':
-		case 'o':
-			mbp_ofile_specified = MB_YES;
-			sscanf (optarg,"%s", mbp_ofile);
-			flag++;
-			break;
-		case 'P':
-		case 'p':
-			checkuptodate = MB_NO;
-			flag++;
-			break;
-		case 'S':
-		case 's':
-			printfilestatus = MB_YES;
-			flag++;
-			break;
-		case 'T':
-		case 't':
-			testonly = MB_YES;
-			flag++;
-			break;
-		case '?':
-			errflg++;
-		}
-
-	/* if error flagged then print it and exit */
-	if (errflg)
-		{
-		fprintf(stderr,"usage: %s\n", usage_message);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		error = MB_ERROR_BAD_USAGE;
-		exit(error);
-		}
-
-	/* if help desired then print it and exit */
-	if (help)
-	    {
-	    fprintf(stderr,"\nProgram %s\n",program_name);
-	    fprintf(stderr,"Version %s\n",rcs_id);
-	    fprintf(stderr,"MB-System Version %s\n",MB_VERSION);
-	    fprintf(stderr,"\n%s\n",help_message);
-	    fprintf(stderr,"\nusage: %s\n", usage_message);
-	    exit(error);
-	    }
-
-	/* try datalist.mb-1 as input */
-	if (mbp_ifile_specified == MB_NO)
-	    {
-	    if ((fstat = stat("datalist.mb-1", &file_status)) == 0
-		    && (file_status.st_mode & S_IFMT) != S_IFDIR)
-		    {
-		    strcpy(read_file, "datalist.mb-1");
-		    mbp_ifile_specified = MB_YES;
-		    }
-	    }
-
-	/* quit if no input file specified */
-	if (mbp_ifile_specified == MB_NO)
-	    {
-	    fprintf(stderr,"\nProgram <%s> requires an input data file.\n",program_name);
-	    fprintf(stderr,"The input file may be specified with the -I option.\n");
-	    fprintf(stderr,"The default input file is \"datalist.mb-1\".\n");
-	    fprintf(stderr,"\nProgram <%s> Terminated\n",
-		    program_name);
-	    error = MB_ERROR_OPEN_FAIL;
-	    exit(error);
-	    }
-
-	/* get format if required */
-	if (format == 0)
-		mb_get_format(verbose,read_file,NULL,&format,&error);
-
-	/* determine whether to read one file or a list of files */
-	if (format < 0)
-		read_datalist = MB_YES;
-
-	/* open file list */
-	if (read_datalist == MB_YES)
-	    {
-	    if ((status = mb_datalist_open(verbose,&datalist,
-					    read_file,look_processed,&error)) != MB_SUCCESS)
-		{
-		error = MB_ERROR_OPEN_FAIL;
-		fprintf(stderr,"\nUnable to open data list file: %s\n",
-			read_file);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-	    if ((status = mb_datalist_read(verbose,datalist,
-			    mbp_ifile,&mbp_format,&file_weight,&error))
-			    == MB_SUCCESS)
-		read_data = MB_YES;
-	    else
-		read_data = MB_NO;
-	    }
-	/* else copy single filename to be read */
-	else
-	    {
-	    strcpy(mbp_ifile, read_file);
-	    mbp_format = format;
-	    read_data = MB_YES;
-	    }
-
-	/* print starting debug statements */
-	if (verbose >= 2)
-	    {
-	    fprintf(stderr,"\ndbg2  Program <%s>\n",program_name);
-	    fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-	    fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-	    fprintf(stderr,"\ndbg2  MB-System Control Parameters:\n");
-	    fprintf(stderr,"dbg2       verbose:         %d\n",verbose);
-	    fprintf(stderr,"dbg2       help:            %d\n",help);
-	    fprintf(stderr,"dbg2       read_file:       %s\n",read_file);
-	    fprintf(stderr,"dbg2       format:          %d\n",format);
-	    fprintf(stderr,"dbg2       pings:           %d\n",pings);
-	    fprintf(stderr,"dbg2       lonflip:         %d\n",lonflip);
-	    fprintf(stderr,"dbg2       bounds[0]:       %f\n",bounds[0]);
-	    fprintf(stderr,"dbg2       bounds[1]:       %f\n",bounds[1]);
-	    fprintf(stderr,"dbg2       bounds[2]:       %f\n",bounds[2]);
-	    fprintf(stderr,"dbg2       bounds[3]:       %f\n",bounds[3]);
-	    fprintf(stderr,"dbg2       btime_i[0]:      %d\n",btime_i[0]);
-	    fprintf(stderr,"dbg2       btime_i[1]:      %d\n",btime_i[1]);
-	    fprintf(stderr,"dbg2       btime_i[2]:      %d\n",btime_i[2]);
-	    fprintf(stderr,"dbg2       btime_i[3]:      %d\n",btime_i[3]);
-	    fprintf(stderr,"dbg2       btime_i[4]:      %d\n",btime_i[4]);
-	    fprintf(stderr,"dbg2       btime_i[5]:      %d\n",btime_i[5]);
-	    fprintf(stderr,"dbg2       btime_i[6]:      %d\n",btime_i[6]);
-	    fprintf(stderr,"dbg2       etime_i[0]:      %d\n",etime_i[0]);
-	    fprintf(stderr,"dbg2       etime_i[1]:      %d\n",etime_i[1]);
-	    fprintf(stderr,"dbg2       etime_i[2]:      %d\n",etime_i[2]);
-	    fprintf(stderr,"dbg2       etime_i[3]:      %d\n",etime_i[3]);
-	    fprintf(stderr,"dbg2       etime_i[4]:      %d\n",etime_i[4]);
-	    fprintf(stderr,"dbg2       etime_i[5]:      %d\n",etime_i[5]);
-	    fprintf(stderr,"dbg2       etime_i[6]:      %d\n",etime_i[6]);
-	    fprintf(stderr,"dbg2       speedmin:        %f\n",speedmin);
-	    fprintf(stderr,"dbg2       timegap:         %f\n",timegap);
-	    fprintf(stderr,"dbg2       strip_comments:  %d\n",strip_comments);
-	    fprintf(stderr,"dbg2       checkuptodate:   %d\n",checkuptodate);
-	    fprintf(stderr,"dbg2       printfilestatus: %d\n",printfilestatus);
-	    fprintf(stderr,"dbg2       testonly:        %d\n",testonly);
-	    fprintf(stderr,"dbg2       verbose:         %d\n",verbose);
-	    }
-
-	/* print starting info statements */
-	else if (verbose > 0)
-	    {
-	    fprintf(stderr,"\nProgram <%s>\n",program_name);
-	    fprintf(stderr,"Version %s\n",rcs_id);
-	    fprintf(stderr,"MB-system Version %s\n",MB_VERSION);
-	    fprintf(stderr,"\nProgram Operation:\n");
-	    fprintf(stderr,"  Input file:      %s\n",read_file);
-	    fprintf(stderr,"  Format:          %d\n",format);
-	    if (checkuptodate == MB_YES)
-		fprintf(stderr,"  Files processed only if out of date.\n");
-	    else
-		fprintf(stderr,"  All files processed.\n");
-	    if (strip_comments == MB_NO)
-		fprintf(stderr,"  Comments embedded in output.\n\n");
-	    else
-		fprintf(stderr,"  Comments stripped from output.\n\n");
-	    }
-
-	/* loop over all files to be read */
-	while (read_data == MB_YES)
-	{
-	/* load parameters */
-	status = mb_pr_readpar(verbose, mbp_ifile, MB_NO,
-			&process, &error);
-
-	/* reset output file and format if not reading from datalist */
-	if (read_datalist == MB_NO)
-	    {
-	    if (mbp_ofile_specified == MB_YES)
-		{
-		strcpy(process.mbp_ofile, mbp_ofile);
-		}
-	    if (mbp_format_specified == MB_YES)
-		{
-		process.mbp_format = mbp_format;
-		}
-	    }
-
-	/* make output file path global if needed */
-	if (status == MB_SUCCESS
-	    && mbp_ofile_specified == MB_NO
-	    && process.mbp_ofile[0] != '/' && process.mbp_ofile[1] != ':'
-	    && strrchr(process.mbp_ifile,'/') != NULL
-	    && (len = strrchr(process.mbp_ifile,'/')
-			- process.mbp_ifile + 1) > 1)
-	    {
-	    strcpy(mbp_ofile,process.mbp_ofile);
-	    strncpy(process.mbp_ofile,process.mbp_ifile,len);
-	    process.mbp_ofile[len] = '\0';
-	    strcat(process.mbp_ofile,mbp_ofile);
-	    }
-
-	/* get mod time for the input file */
-	ifilemodtime = 0;
-	if ((fstat = stat(mbp_ifile, &file_status)) == 0
-	    && (file_status.st_mode & S_IFMT) != S_IFDIR)
-	    {
- 	    ifilemodtime = file_status.st_mtime;
-	    }
-
-	/* check for existing parameter file */
-	pfilemodtime = 0;
-	sprintf(mbp_pfile, "%s.par", mbp_ifile);
-	if ((fstat = stat(mbp_pfile, &file_status)) == 0
-	    && (file_status.st_mode & S_IFMT) != S_IFDIR)
-	    {
-	    pfilemodtime = file_status.st_mtime;
-	    }
-
-	/* skip if processing cannot be inferred */
-	if (status == MB_FAILURE)
-	    {
-	    proceedprocess = MB_NO;
-	    if (verbose > 0 || testonly == MB_YES)
-	    fprintf(stderr,"Data skipped - processing unknown: %s\n",
-	    	mbp_ifile);
-	    }
-
-
-	/* skip if input file can't be read */
-	else if (ifilemodtime == 0)
-	    {
-	    proceedprocess = MB_NO;
-	    if (verbose > 0 || testonly == MB_YES)
-	    fprintf(stderr,"Data skipped - input file cannot be read: %s\n",
-	    	mbp_ifile);
-	    }
-
-	/* skip if parameter file can't be read */
-	else if (pfilemodtime == 0)
-	    {
-	    proceedprocess = MB_NO;
-	    if (verbose > 0 || testonly == MB_YES)
-	    fprintf(stderr,"Data skipped - parameter file cannot be read: %s\n",
-	    	mbp_pfile);
-	    }
-	/* check for up to date */
-	else
-	    {
-	    /* initialize file modification times as 0, update if they exist */
-	    ofilemodtime = 0;
-	    navfilemodtime = 0;
-	    navadjfilemodtime = 0;
-	    attitudefilemodtime = 0;
-	    sonardepthfilemodtime = 0;
-	    esfmodtime = 0;
-	    svpmodtime = 0;
-
-	    /* get mod time for the output file */
-	    if ((fstat = stat(process.mbp_ofile, &file_status)) == 0
-		&& (file_status.st_mode & S_IFMT) != S_IFDIR)
-		ofilemodtime = file_status.st_mtime;
-
-	    /* get mod time for the navigation file if needed */
-	    if (process.mbp_nav_mode != MBP_NAV_OFF
-		&& (fstat = stat(process.mbp_navfile, &file_status)) == 0
-		&& (file_status.st_mode & S_IFMT) != S_IFDIR)
-		navfilemodtime = file_status.st_mtime;
-
-	    /* get mod time for the navigation adjustment file if needed */
-	    if (process.mbp_navadj_mode != MBP_NAVADJ_OFF
-		&& (fstat = stat(process.mbp_navadjfile, &file_status)) == 0
-		&& (file_status.st_mode & S_IFMT) != S_IFDIR)
-		navadjfilemodtime = file_status.st_mtime;
-
-	    /* get mod time for the attitude file if needed */
-	    if (process.mbp_attitude_mode != MBP_ATTITUDE_OFF
-		&& (fstat = stat(process.mbp_attitudefile, &file_status)) == 0
-		&& (file_status.st_mode & S_IFMT) != S_IFDIR)
-		attitudefilemodtime = file_status.st_mtime;
-
-	    /* get mod time for the sonardepth file if needed */
-	    if (process.mbp_sonardepth_mode != MBP_SONARDEPTH_OFF
-		&& (fstat = stat(process.mbp_sonardepthfile, &file_status)) == 0
-		&& (file_status.st_mode & S_IFMT) != S_IFDIR)
-		sonardepthfilemodtime = file_status.st_mtime;
-
-	    /* get mod time for the edit save file if needed */
-	    if (process.mbp_edit_mode != MBP_EDIT_OFF
-		&& (fstat = stat(process.mbp_editfile, &file_status)) == 0
-		&& (file_status.st_mode & S_IFMT) != S_IFDIR)
-		esfmodtime = file_status.st_mtime;
-
-	    /* get mod time for the svp file if needed */
-	    if (process.mbp_svp_mode != MBP_SVP_OFF
-		&& (fstat = stat(process.mbp_svpfile, &file_status)) == 0
-		&& (file_status.st_mode & S_IFMT) != S_IFDIR)
-		svpmodtime = file_status.st_mtime;
-
-	    /* now check if processed file is out of date */
-	    if (ofilemodtime > 0
-		    && ofilemodtime >= ifilemodtime
-		    && ofilemodtime >= pfilemodtime
-		    && ofilemodtime >= navfilemodtime
-		    && ofilemodtime >= navadjfilemodtime
-		    && ofilemodtime >= attitudefilemodtime
-		    && ofilemodtime >= sonardepthfilemodtime
-		    && ofilemodtime >= esfmodtime
-		    && ofilemodtime >= svpmodtime)
-		outofdate = MB_NO;
-	    else
-	    	outofdate = MB_YES;
-
-	    /* deal with information */
-	    if (outofdate == MB_YES || checkuptodate == MB_NO)
-		{
-		/* not testing - do it for real */
-		if (testonly == MB_NO)
-		    {
-		    /* want to process, now try to set a lock of the file to be processed */
-		    if (uselockfiles == MB_YES)
-		    	{
-			lock_status = mb_pr_lockswathfile(verbose, process.mbp_ifile,
-						MBP_LOCK_PROCESS, program_name, &lock_error);
-			if (lock_status == MB_SUCCESS)
-			    {
-			    proceedprocess = MB_YES;
-			    locked = MB_NO;
-			    }
-			else if (lock_error == MB_ERROR_FILE_LOCKED)
-			    {
-			    proceedprocess = MB_NO;
-			    lock_status = mb_pr_lockinfo(verbose, process.mbp_ifile, &locked,
-							    &lock_purpose, lock_program, lock_user, lock_cpu, lock_date, &lock_error);
-			    }
-			else if (lock_error == MB_ERROR_OPEN_FAIL)
-			    {
-			    proceedprocess = MB_NO;
-			    locked = MB_NO;
-			    }
-			}
-
-		    /* want to process, but lock files are disabled */
-		    else
-		    	{
-		        lock_status = mb_pr_lockinfo(verbose, process.mbp_ifile, &locked,
-						&lock_purpose, lock_program, lock_user, lock_cpu, lock_date, &lock_error);
-			proceedprocess = MB_YES;
-			}
-		    }
-
-		/* else only testing */
-		else
-		    {
-		    /* want to process, check lock status of the file to be processed */
-		    lock_status = mb_pr_lockinfo(verbose, process.mbp_ifile, &locked,
-						&lock_purpose, lock_program, lock_user, lock_cpu, lock_date, &lock_error);
-		    if (locked == MB_NO || uselockfiles == MB_NO)
-			{
-			proceedprocess = MB_YES;
-			}
-		    else
-			{
-			proceedprocess = MB_NO;
-			}
-		    }
-		}
-	    else
-		{
-		proceedprocess = MB_NO;
-		lock_status = mb_pr_lockinfo(verbose, process.mbp_ifile, &locked,
-							&lock_purpose, lock_program, lock_user, lock_cpu, lock_date, &lock_error);
-		}
-
-	    /* write out information */
-	    if (testonly == MB_NO)
-		{
-		if (proceedprocess == MB_YES)
-			string1 = str_process_yes;
-		else if (proceedprocess == MB_NO)
-			string1 = str_process_no;
-		}
-	    else
-		{
-		if (proceedprocess == MB_YES)
-			string1 = str_process_yes_test;
-		else if (proceedprocess == MB_NO)
-			string1 = str_process_no_test;
-		}
-	    if (outofdate == MB_YES)
-		string2 = str_outofdate_yes;
-	    else if (outofdate == MB_NO && checkuptodate == MB_NO)
-		string2 = str_outofdate_overridden;
-	    else
-		string2 = str_outofdate_no;
-	    if (locked == MB_YES && uselockfiles == MB_NO)
-		string3 = str_locked_ignored;
-	    else if (locked == MB_YES)
-		string3 = str_locked_yes;
-	    else if (locked == MB_NO && lock_error == MB_ERROR_OPEN_FAIL)
-		string3 = str_locked_fail;
-	    else
-		string3 = str_locked_no;
-	    fprintf(stderr,"%s - %s - %s: \n\tInput:  %s\n\tOutput: %s\n",
-		string1, string2, string3, process.mbp_ifile, process.mbp_ofile);
-	    if (locked == MB_YES)
-		fprintf(stderr,"\tLocked by program <%s> run by <%s> on <%s> at <%s>\n", lock_program, lock_user, lock_cpu, lock_date);
-	    if (testonly == MB_YES || verbose > 0 || printfilestatus == MB_YES)
-		{
-		if (outofdate == MB_YES)
-			fprintf(stderr,"\tFile Status: out of date\n");
-		else
-			fprintf(stderr,"\tFile Status: up to date\n");
-		fprintf(stderr,"\t\tModification times and ages relative to the output file in seconds:\n");
-		mb_get_date_string(verbose, (double)ifilemodtime, dummy);
-		fprintf(stderr,"\t\t\tInput file:                 %s %12d <%s>\n", dummy, ofilemodtime - ifilemodtime, mbp_ifile);
-		if (pfilemodtime > 0)
-			{
-			mb_get_date_string(verbose, (double)pfilemodtime, dummy);
-			fprintf(stderr,"\t\t\tParameter file:             %s %12d <%s>\n", dummy, ofilemodtime - pfilemodtime, mbp_pfile);
-			}
-		else
-			{
-			fprintf(stderr,"\t\t\tParameter file:             None\n");
-			}
-		if (navfilemodtime > 0)
-			{
-			mb_get_date_string(verbose, (double)navfilemodtime, dummy);
-			fprintf(stderr,"\t\t\tNavigation file:            %s %12d <%s>\n", dummy, ofilemodtime - navfilemodtime, process.mbp_navfile);
-			}
-		else
-			{
-			fprintf(stderr,"\t\t\tNavigation file:            None\n");
-			}
-		if (navadjfilemodtime > 0)
-			{
-			mb_get_date_string(verbose, (double)navadjfilemodtime, dummy);
-			fprintf(stderr,"\t\t\tNavigation adjustment file: %s %12d <%s>\n", dummy, ofilemodtime - navadjfilemodtime, process.mbp_navadjfile);
-			}
-		else
-			{
-			fprintf(stderr,"\t\t\tNavigation adjustment file: None\n");
-			}
-		if (attitudefilemodtime > 0)
-			{
-			mb_get_date_string(verbose, (double)attitudefilemodtime, dummy);
-			fprintf(stderr,"\t\t\tSonar depth file:           %s %12d <%s>\n", dummy, ofilemodtime - attitudefilemodtime, process.mbp_attitudefile);
-			}
-		else
-			{
-			fprintf(stderr,"\t\t\tSonar depth file:           None\n");
-			}
-		if (sonardepthfilemodtime > 0)
-			{
-			mb_get_date_string(verbose, (double)sonardepthfilemodtime, dummy);
-			fprintf(stderr,"\t\t\tAttitude file:              %s %12d <%s>\n", dummy, ofilemodtime - sonardepthfilemodtime, process.mbp_sonardepthfile);
-			}
-		else
-			{
-			fprintf(stderr,"\t\t\tAttitude file:              None\n");
-			}
-		if (esfmodtime > 0)
-			{
-			mb_get_date_string(verbose, (double)esfmodtime, dummy);
-			fprintf(stderr,"\t\t\tEdit save file:             %s %12d <%s>\n", dummy, ofilemodtime - esfmodtime, process.mbp_editfile);
-			}
-		else
-			{
-			fprintf(stderr,"\t\t\tEdit save file:             None\n");
-			}
-		if (svpmodtime > 0)
-			{
-			mb_get_date_string(verbose, (double)svpmodtime, dummy);
-			fprintf(stderr,"\t\t\tSVP file:                   %s %12d <%s>\n", dummy, ofilemodtime - svpmodtime, process.mbp_svpfile);
-			}
-		else
-			{
-			fprintf(stderr,"\t\t\tSVP file:                   None\n");
-			}
-		if (ofilemodtime > 0)
-			{
-			mb_get_date_string(verbose, (double)ofilemodtime, dummy);
-			fprintf(stderr,"\t\t\tOutput file:                %s              <%s>\n", dummy, process.mbp_ofile);
-			}
-		else
-			{
-			fprintf(stderr,"\t\t\tOutput file:                None\n");
-			}
-		}
-
-	    /* reset proceedprocess if only testing */
-	    if (testonly == MB_YES)
-		proceedprocess = MB_NO;
-	    }
-
-	/* now process the input file */
-	if (proceedprocess == MB_YES)
-	{
-
-	/* check for nav format with heading, speed, and draft merge */
-	if (process.mbp_nav_mode == MBP_NAV_ON
-	    && (process.mbp_nav_heading == MBP_NAV_ON
-		|| process.mbp_nav_speed == MBP_NAV_ON
-		|| process.mbp_nav_draft == MBP_NAV_ON
-		|| process.mbp_nav_attitude == MBP_NAV_ON)
-	    && process.mbp_nav_format != 9)
-	    {
-	    fprintf(stderr,"\nWarning:\n\tNavigation format <%d> does not include \n",process.mbp_nav_format);
-	    fprintf(stderr,"\theading, speed, draft, roll, pitch and heave values.\n");
-	    if (process.mbp_nav_heading == MBP_NAV_ON)
-		{
-		fprintf(stderr,"Merging of heading data disabled.\n");
-		process.mbp_nav_heading = MBP_NAV_OFF;
-		}
-	    if (process.mbp_nav_speed == MBP_NAV_ON)
-		{
-		fprintf(stderr,"Merging of speed data disabled.\n");
-		process.mbp_nav_speed = MBP_NAV_OFF;
-		}
-	    if (process.mbp_nav_draft == MBP_NAV_ON)
-		{
-		fprintf(stderr,"Merging of draft data disabled.\n");
-		process.mbp_nav_draft = MBP_NAV_OFF;
-		}
-	    if (process.mbp_nav_attitude == MBP_NAV_ON)
-		{
-		fprintf(stderr,"Merging of roll, pitch, and heave data disabled.\n");
-		process.mbp_nav_attitude = MBP_NAV_OFF;
-		}
-	    }
-
-	/* check for format with travel time data */
-	if (process.mbp_bathrecalc_mode == MBP_BATHRECALC_RAYTRACE)
-	    {
-	    status = mb_format_flags(verbose,&process.mbp_format,
-			&variable_beams, &traveltime, &beam_flagging,
-			&error);
-	    if (traveltime != MB_YES)
-		{
-		fprintf(stderr,"\nWarning:\n\tFormat %d does not include travel time data.\n",
-			process.mbp_format);
-		fprintf(stderr,"\tTravel times and angles estimated assuming\n");
-		fprintf(stderr,"\t1500 m/s water sound speed.\n");
-		}
-	    }
-
-	/* check for right format if recalculating sidescan is on */
-	if (process.mbp_ssrecalc_mode == MBP_SSRECALC_ON
-	    && process.mbp_format != MBF_EM300MBA
-            && process.mbp_format != MBF_EM710MBA)
-	    {
-	    fprintf(stderr,"\nProgram <%s> only recalculates sidescan for format %d\n",program_name,MBF_EM300MBA);
-	    fprintf(stderr,"Format %d is specified. Sidescan recalculation disabled\n",process.mbp_format);
-	    process.mbp_ssrecalc_mode = MBP_SSRECALC_OFF;
-	    }
-
-	/* print starting info statements */
-	if (verbose == 1)
-	    {
-	    fprintf(stderr,"\nInput and Output Files:\n");
-	    if (process.mbp_format_specified == MB_YES)
-		    fprintf(stderr,"  Format:                        %d\n",process.mbp_format);
-	    fprintf(stderr,"  Input file:                    %s\n",process.mbp_ifile);
-	    fprintf(stderr,"  Output file:                   %s\n",process.mbp_ofile);
-	    if (strip_comments == MB_YES)
-		fprintf(stderr,"  Comments in output:            OFF\n");
-	    else
-		fprintf(stderr,"  Comments in output:            ON\n");
-
-	    fprintf(stderr,"\nNavigation Merging:\n");
-	    if (process.mbp_nav_mode == MBP_NAV_ON)
-		{
-		fprintf(stderr,"  Navigation merged from navigation file.\n");
-		fprintf(stderr,"  Navigation file:               %s\n", process.mbp_navfile);
-	        fprintf(stderr,"  Navigation format:             %d\n", process.mbp_nav_format);
-		if (process.mbp_nav_heading == MBP_NAV_ON)
-		    fprintf(stderr,"  Heading merged from navigation file.\n");
-		else
-		    fprintf(stderr,"  Heading not merged from navigation file.\n");
-		if (process.mbp_nav_speed == MBP_NAV_ON)
-		    fprintf(stderr,"  Speed merged from navigation file.\n");
-		else
-		    fprintf(stderr,"  Speed not merged from navigation file.\n");
-		if (process.mbp_nav_draft == MBP_NAV_ON)
-		    fprintf(stderr,"  Draft merged from navigation file.\n");
-		else
-		    fprintf(stderr,"  Draft not merged from navigation file.\n");
-		if (process.mbp_nav_attitude == MBP_NAV_ON)
-		    fprintf(stderr,"  Roll, pitch, and heave merged from navigation file.\n");
-		else
-		    fprintf(stderr,"  Roll, pitch, and heave not merged from navigation file.\n");
-	    	if (process.mbp_nav_algorithm == MBP_NAV_LINEAR)
-			fprintf(stderr,"  Navigation algorithm:          linear interpolation\n");
-	    	else if (process.mbp_nav_algorithm == MBP_NAV_SPLINE)
-			fprintf(stderr,"  Navigation algorithm:          spline interpolation\n");
-	    	fprintf(stderr,"  Navigation time shift:         %f\n", process.mbp_nav_timeshift);
-		}
-	    else
-		fprintf(stderr,"  Navigation not merged from navigation file.\n");
-
-	    fprintf(stderr,"\nNavigation Offsets and Shifts:\n");
-	    if (process.mbp_nav_shift == MBP_NAV_ON)
-		    {
-		    fprintf(stderr,"  Navigation positions shifted.\n");
-		    fprintf(stderr,"  Navigation offset x:       %f\n", process.mbp_nav_offsetx);
-		    fprintf(stderr,"  Navigation offset y:       %f\n", process.mbp_nav_offsety);
-		    fprintf(stderr,"  Navigation offset z:       %f\n", process.mbp_nav_offsetz);
-		    fprintf(stderr,"  Navigation shift longitude:%f\n", process.mbp_nav_shiftlon);
-		    fprintf(stderr,"  Navigation shift latitude: %f\n", process.mbp_nav_shiftlat);
-		    }
-	    else
-		    fprintf(stderr,"  Navigation positions not shifted.\n");
-
-	    fprintf(stderr,"\nAdjusted Navigation Merging:\n");
-	    if (process.mbp_navadj_mode >= MBP_NAVADJ_LL)
-	    	{
-		fprintf(stderr,"  Navigation merged from adjusted navigation file.\n");
-		fprintf(stderr,"  Adjusted navigation file:      %s\n", process.mbp_navadjfile);
-		if (process.mbp_navadj_mode == MBP_NAVADJ_LL)
-		    fprintf(stderr,"  Adjusted navigation applied to: lon lat only\n");
-		else if (process.mbp_navadj_mode == MBP_NAVADJ_LLZ)
-		    fprintf(stderr,"  Adjusted navigation applied to: lon lat depth_offset\n");
-		if (process.mbp_navadj_algorithm == MBP_NAV_LINEAR)
-		    fprintf(stderr,"  Adjusted navigation algorithm: linear interpolation\n");
-		else if (process.mbp_navadj_algorithm == MBP_NAV_SPLINE)
-		    fprintf(stderr,"  Adjusted navigation algorithm: spline interpolation\n");
-		}
-	    else
-		fprintf(stderr,"  Navigation not merged from adjusted navigation file.\n");
-
-	    fprintf(stderr,"\nAttitude Merging:\n");
-	    if (process.mbp_attitude_mode == MBP_ATTITUDE_ON)
-	        {
-		fprintf(stderr,"  Attitude merged from attitude file.\n");
-	        fprintf(stderr,"  Attitude file:                 %s\n", process.mbp_attitudefile);
-	        fprintf(stderr,"  Attitude format:               %d\n", process.mbp_attitude_format);
-		}
-	    else
-		fprintf(stderr,"  Attitude not merged from attitude file.\n");
-
-	    fprintf(stderr,"\nSonardepth Merging:\n");
-	    if (process.mbp_sonardepth_mode == MBP_SONARDEPTH_ON)
-	        {
-		fprintf(stderr,"  Sonardepth merged from sonardepth file.\n");
-	        fprintf(stderr,"  Sonardepth file:                 %s\n", process.mbp_sonardepthfile);
-	        fprintf(stderr,"  Sonardepth format:               %d\n", process.mbp_sonardepth_format);
-		}
-	    else
-		fprintf(stderr,"  Sonardepth not merged from sonardepth file.\n");
-
-	    fprintf(stderr,"\nData Cutting:\n");
-	    if (process.mbp_cut_num > 0)
-		fprintf(stderr,"  Data cutting enabled (%d commands).\n", process.mbp_cut_num);
-	    else
-		fprintf(stderr,"  Data cutting disabled.\n");
-	    for (i=0;i<process.mbp_cut_num;i++)
-		{
-		if (process.mbp_cut_kind[i] == MBP_CUT_DATA_BATH)
-		    fprintf(stderr, "  Cut[%d]: bathymetry", i);
-		else if (process.mbp_cut_kind[i] == MBP_CUT_DATA_AMP)
-		    fprintf(stderr, "  Cut[%d]: amplitude ", i);
-		else if (process.mbp_cut_kind[i] == MBP_CUT_DATA_SS)
-		    fprintf(stderr, "  Cut[%d]: sidescan  ", i);
-		if (process.mbp_cut_mode[i] == MBP_CUT_MODE_NUMBER)
-		    fprintf(stderr, "  number   ");
-		else if (process.mbp_cut_kind[i] == MBP_CUT_MODE_DISTANCE)
-		    fprintf(stderr, "  distance ");
-		else if (process.mbp_cut_kind[i] == MBP_CUT_MODE_SPEED)
-		    fprintf(stderr, "  speed    ");
-		fprintf(stderr, "  %f %f\n", process.mbp_cut_min[i], process.mbp_cut_max[i]);
-		}
-
-	    fprintf(stderr,"\nBathymetry Editing:\n");
-	    if (process.mbp_edit_mode == MBP_EDIT_ON)
-		fprintf(stderr,"  Bathymetry edits applied from file.\n");
-	    else
-		fprintf(stderr,"  Bathymetry edits not applied from file.\n");
-	    fprintf(stderr,"  Bathymetry edit file:          %s\n", process.mbp_editfile);
-
-	    fprintf(stderr,"\nBathymetry Recalculation:\n");
-	    if (process.mbp_bathrecalc_mode == MBP_BATHRECALC_OFF)
-		fprintf(stderr,"  Bathymetry not recalculated.\n");
-	    else if (process.mbp_bathrecalc_mode == MBP_BATHRECALC_RAYTRACE)
-		fprintf(stderr,"  Bathymetry recalculated by raytracing.\n");
-	    else if (process.mbp_bathrecalc_mode == MBP_BATHRECALC_ROTATE)
-		fprintf(stderr,"  Bathymetry recalculated by rigid rotation.\n");
-	    else if (process.mbp_bathrecalc_mode == MBP_BATHRECALC_OFFSET)
-		fprintf(stderr,"  Bathymetry recalculated by sonar depth shift.\n");
-	    fprintf(stderr,"  SVP file:                      %s\n", process.mbp_svpfile);
-	    if (process.mbp_ssv_mode == MBP_SSV_OFF)
-		fprintf(stderr,"  SSV not modified.\n");
-	    else if (process.mbp_ssv_mode == MBP_SSV_OFFSET)
-		fprintf(stderr,"  SSV offset by constant.\n");
-	    else
-		fprintf(stderr,"  SSV set to constant.\n");
-	    fprintf(stderr,"  SSV offset/constant:           %f m/s\n", process.mbp_ssv);
-	    fprintf(stderr,"  Travel time mode:              %d\n", process.mbp_tt_mode);
-	    fprintf(stderr,"  Travel time multiplier:        %f\n", process.mbp_tt_mult);
-	    fprintf(stderr,"  Raytrace angle mode:           %d\n", process.mbp_angle_mode);
-
-	    fprintf(stderr,"\nStatic Beam Bathymetry Corrections:\n");
-	    if (process.mbp_static_mode == MBP_STATIC_BEAM_ON)
-		{
-		fprintf(stderr,"  Static beam corrections applied to bathymetry.\n");
-	    	fprintf(stderr,"  Static file:                   %s m\n", process.mbp_staticfile);
- 		}
- 	    else if (process.mbp_static_mode == MBP_STATIC_ANGLE_ON)
-		{
-		fprintf(stderr,"  Static angle corrections applied to bathymetry.\n");
-	    	fprintf(stderr,"  Static file:                   %s m\n", process.mbp_staticfile);
- 		}
-	    else
-		fprintf(stderr,"  Static beam corrections off.\n");
-
-	    fprintf(stderr,"\nBathymetry Water Sound Speed Reference:\n");
-	    if (process.mbp_corrected == MB_YES)
-		fprintf(stderr,"  Output bathymetry reference:   CORRECTED\n");
-	    else if (process.mbp_corrected == MB_NO)
-		fprintf(stderr,"  Output bathymetry reference:   UNCORRECTED\n");
-	    if (process.mbp_svp_mode == MBP_SVP_SOUNDSPEEDREF)
-		{
-		if (process.mbp_corrected == MB_YES)
-		    fprintf(stderr,"  Depths modified from uncorrected to corrected\n");
-		else
-		    fprintf(stderr,"  Depths modified from corrected to uncorrected\n");
-		}
-	    else if (process.mbp_svp_mode == MBP_SVP_ON)
-		{
-		if (process.mbp_corrected == MB_YES)
-		    fprintf(stderr,"  Depths recalculated as corrected\n");
-		else
-		    fprintf(stderr,"  Depths recalculated as uncorrected\n");
-		}
-	    else
-		{
-		fprintf(stderr,"  Depths unmodified with respect to water sound speed reference\n");
-		}
-
-	    fprintf(stderr,"\nDraft Correction:\n");
-	    if (process.mbp_draft_mode == MBP_DRAFT_OFF)
-		fprintf(stderr,"  Draft not modified.\n");
-	    else if (process.mbp_draft_mode == MBP_DRAFT_SET)
-		fprintf(stderr,"  Draft set to constant.\n");
-	    else if (process.mbp_draft_mode == MBP_DRAFT_OFFSET)
-		fprintf(stderr,"  Draft offset by constant.\n");
-	    else if (process.mbp_draft_mode == MBP_DRAFT_MULTIPLY)
-		fprintf(stderr,"  Draft multiplied by constant.\n");
-	    else if (process.mbp_draft_mode == MBP_DRAFT_MULTIPLYOFFSET)
-		fprintf(stderr,"  Draft multiplied and offset by constants.\n");
-	    fprintf(stderr,"  Draft constant:                %f m\n", process.mbp_draft);
-	    fprintf(stderr,"  Draft offset:                  %f m\n", process.mbp_draft_offset);
-	    fprintf(stderr,"  Draft multiplier:              %f m\n", process.mbp_draft_mult);
-
-	    fprintf(stderr,"\nHeave Correction:\n");
-	    if (process.mbp_heave_mode == MBP_HEAVE_OFF)
-		fprintf(stderr,"  Heave not modified.\n");
-	    else if (process.mbp_heave_mode == MBP_HEAVE_OFFSET)
-		fprintf(stderr,"  Heave offset by constant.\n");
-	    else if (process.mbp_heave_mode == MBP_HEAVE_MULTIPLY)
-		fprintf(stderr,"  Heave multiplied by constant.\n");
-	    else if (process.mbp_heave_mode == MBP_HEAVE_MULTIPLYOFFSET)
-		fprintf(stderr,"  Heave multiplied and offset by constants.\n");
-	    fprintf(stderr,"  Heave offset:                  %f m\n", process.mbp_heave);
-	    fprintf(stderr,"  Heave multiplier:              %f m\n", process.mbp_heave_mult);
-
-	    fprintf(stderr,"\nLever Correction:\n");
-	    if (process.mbp_lever_mode == MBP_LEVER_OFF)
-		fprintf(stderr,"  Lever calculation off.\n");
-	    else
-		{
-		fprintf(stderr,"  Lever calculation used to calculate heave correction.\n");
-	    	fprintf(stderr,"  Heave offset:                  %f m\n", process.mbp_heave);
-	    	fprintf(stderr,"  VRU offset x:                  %f m\n", process.mbp_vru_offsetx);
-	    	fprintf(stderr,"  VRU offset y:                  %f m\n", process.mbp_vru_offsety);
-	    	fprintf(stderr,"  VRU offset z:                  %f m\n", process.mbp_vru_offsetz);
-	    	fprintf(stderr,"  Sonar offset x:                %f m\n", process.mbp_sonar_offsetx);
-	    	fprintf(stderr,"  Sonar offset y:                %f m\n", process.mbp_sonar_offsety);
-	    	fprintf(stderr,"  Sonar offset z:                %f m\n", process.mbp_sonar_offsetz);
-		}
-
-	    fprintf(stderr,"\nTide Correction:\n");
-	    if (process.mbp_tide_mode == MBP_TIDE_OFF)
-		fprintf(stderr,"  Tide calculation off.\n");
-	    else
-		{
-		fprintf(stderr,"  Tide correction applied to bathymetry.\n");
-	    	fprintf(stderr,"  Tide file:                     %s\n", process.mbp_tidefile);
-	    	fprintf(stderr,"  Tide format:                   %d\n", process.mbp_tide_format);
- 		}
-
-	    fprintf(stderr,"\nRoll Correction:\n");
-	    if (process.mbp_rollbias_mode == MBP_ROLLBIAS_OFF)
-		fprintf(stderr,"  Roll not modified.\n");
-	    else if (process.mbp_rollbias_mode == MBP_ROLLBIAS_SINGLE)
-		fprintf(stderr,"  Roll offset by bias.\n");
-	    else if (process.mbp_rollbias_mode == MBP_ROLLBIAS_DOUBLE)
-		fprintf(stderr,"  Roll offset by separate port and starboard biases.\n");
-	    fprintf(stderr,"  Roll bias:                     %f deg\n", process.mbp_rollbias);
-	    fprintf(stderr,"  Port roll bias:                %f deg\n", process.mbp_rollbias_port);
-	    fprintf(stderr,"  Starboard roll bias:           %f deg\n", process.mbp_rollbias_stbd);
-
-	    fprintf(stderr,"\nPitch Correction:\n");
-	    if (process.mbp_pitchbias_mode == MBP_PITCHBIAS_OFF)
-		fprintf(stderr,"  Pitch not modified.\n");
-	    else
-		fprintf(stderr,"  Pitch offset by bias.\n");
-	    fprintf(stderr,"  Pitch bias:                    %f deg\n", process.mbp_pitchbias);
-
-	    fprintf(stderr,"\nHeading Correction:\n");
-	    if (process.mbp_heading_mode == MBP_HEADING_OFF)
-		fprintf(stderr,"  Heading not modified.\n");
-	    else if (process.mbp_heading_mode == MBP_HEADING_CALC)
-		fprintf(stderr,"  Heading replaced by course-made-good.\n");
-	    else if (process.mbp_heading_mode == MBP_HEADING_OFFSET)
-		fprintf(stderr,"  Heading offset by bias.\n");
-	    else if (process.mbp_heading_mode == MBP_HEADING_CALCOFFSET)
-		fprintf(stderr,"  Heading replaced by course-made-good and then offset by bias.\n");
-	    fprintf(stderr,"  Heading offset:                %f deg\n", process.mbp_headingbias);
-
-	    fprintf(stderr,"\nAmplitude Corrections:\n");
-	    if (process.mbp_ampcorr_mode == MBP_AMPCORR_ON)
-		{
-		fprintf(stderr,"  Amplitude vs grazing angle corrections applied to amplitudes.\n");
-	    	fprintf(stderr,"  Amplitude correction file:      %s m\n", process.mbp_ampcorrfile);
-		if (process.mbp_ampcorr_type == MBP_AMPCORR_SUBTRACTION)
-	    		fprintf(stderr,"  Amplitude correction by subtraction (dB scale)\n");
-		else
-	    		fprintf(stderr,"  Amplitude correction by division (linear scale)\n");
-		if (process.mbp_ampcorr_symmetry == MBP_AMPCORR_SYMMETRIC)
-	    		fprintf(stderr,"  AVGA tables forced to be symmetric\n");
-		else
-	    		fprintf(stderr,"  AVGA tables allowed to be asymmetric\n");
-	    	fprintf(stderr,"  Reference grazing angle:       %f deg\n", process.mbp_ampcorr_angle);
-		if (process.mbp_ampcorr_slope == MBP_AMPCORR_IGNORESLOPE
-			|| process.mbp_ampcorr_slope == MBP_AMPCORR_USESLOPE)
-	    		fprintf(stderr,"  Amplitude correction uses swath bathymetry in file\n");
-		else
-	    		{
-			fprintf(stderr,"  Amplitude correction uses topography grid\n");
-	    		fprintf(stderr,"  Topography grid file:      %s m\n", process.mbp_ampsscorr_topofile);
-			}
-		if (process.mbp_ampcorr_slope == MBP_AMPCORR_IGNORESLOPE
-			|| process.mbp_ampcorr_slope == MBP_SSCORR_USETOPO)
-	    		fprintf(stderr,"  Amplitude correction ignores seafloor slope\n");
-		else
-	    		fprintf(stderr,"  Amplitude correction uses seafloor slope\n");
- 		}
-	    else
-		fprintf(stderr,"  Amplitude correction off.\n");
-
-	    fprintf(stderr,"\nSidescan Corrections:\n");
-	    if (process.mbp_sscorr_mode == MBP_SSCORR_ON)
-		{
-		fprintf(stderr,"  Amplitude vs grazing angle corrections applied to sidescan.\n");
-	    	fprintf(stderr,"  Sidescan correction file:      %s m\n", process.mbp_sscorrfile);
-		if (process.mbp_sscorr_type == MBP_SSCORR_SUBTRACTION)
-	    		fprintf(stderr,"  Sidescan correction by subtraction (dB scale)\n");
-		else
-	    		fprintf(stderr,"  Sidescan correction by division (linear scale)\n");
-		if (process.mbp_sscorr_symmetry == MBP_SSCORR_SYMMETRIC)
-	    		fprintf(stderr,"  AVGA tables forced to be symmetric\n");
-		else
-	    		fprintf(stderr,"  AVGA tables allowed to be asymmetric\n");
-	    	fprintf(stderr,"  Reference grazing angle:       %f deg\n", process.mbp_sscorr_angle);
-		if (process.mbp_sscorr_slope == MBP_SSCORR_IGNORESLOPE
-			|| process.mbp_sscorr_slope == MBP_SSCORR_USESLOPE)
-	    		fprintf(stderr,"  Sidescan correction uses swath bathymetry in file\n");
-		else
-	    		{
-			fprintf(stderr,"  Sidescan correction uses topography grid\n");
-	    		fprintf(stderr,"  Topography grid file:      %s m\n", process.mbp_ampsscorr_topofile);
-			}
-		if (process.mbp_sscorr_slope == MBP_SSCORR_IGNORESLOPE
-			|| process.mbp_sscorr_slope == MBP_SSCORR_USETOPO)
-	    		fprintf(stderr,"  Sidescan correction ignores seafloor slope\n");
-		else
-	    		fprintf(stderr,"  Sidescan correction uses seafloor slope\n");
- 		}
-	    else
-		fprintf(stderr,"  Sidescan correction off.\n");
-
-	    fprintf(stderr,"\nSidescan Recalculation:\n");
-	    if (process.mbp_ssrecalc_mode == MBP_SSRECALC_ON)
-		{
-		fprintf(stderr,"  Sidescan recalculated.\n");
-		fprintf(stderr,"  Sidescan pixel size:           %f\n",process.mbp_ssrecalc_pixelsize);
-		fprintf(stderr,"  Sidescan swath width:          %f\n",process.mbp_ssrecalc_swathwidth);
-		fprintf(stderr,"  Sidescan interpolation:        %d\n",process.mbp_ssrecalc_interpolate);
-		}
-	    else
-		fprintf(stderr,"  Sidescan not recalculated.\n");
-
-	    fprintf(stderr,"\nMetadata Insertion:\n");
-	    fprintf(stderr,"  Metadata vessel:               %s\n",process.mbp_meta_vessel);
-	    fprintf(stderr,"  Metadata institution:          %s\n",process.mbp_meta_institution);
-	    fprintf(stderr,"  Metadata platform:             %s\n",process.mbp_meta_platform);
-	    fprintf(stderr,"  Metadata sonar:                %s\n",process.mbp_meta_sonar);
-	    fprintf(stderr,"  Metadata sonarversion:         %s\n",process.mbp_meta_sonarversion);
-	    fprintf(stderr,"  Metadata cruiseid:             %s\n",process.mbp_meta_cruiseid);
-	    fprintf(stderr,"  Metadata cruisename:           %s\n",process.mbp_meta_cruisename);
-	    fprintf(stderr,"  Metadata pi:                   %s\n",process.mbp_meta_pi);
-	    fprintf(stderr,"  Metadata piinstitution:        %s\n",process.mbp_meta_piinstitution);
-	    fprintf(stderr,"  Metadata client:               %s\n",process.mbp_meta_client);
-	    fprintf(stderr,"  Metadata svcorrected:          %d\n",process.mbp_meta_svcorrected);
-	    fprintf(stderr,"  Metadata tidecorrected         %d\n",process.mbp_meta_tidecorrected);
-	    fprintf(stderr,"  Metadata batheditmanual        %d\n",process.mbp_meta_batheditmanual);
-	    fprintf(stderr,"  Metadata batheditauto:         %d\n",process.mbp_meta_batheditauto);
-	    fprintf(stderr,"  Metadata rollbias:             %f\n",process.mbp_meta_rollbias);
-	    fprintf(stderr,"  Metadata pitchbias:            %f\n",process.mbp_meta_pitchbias);
-	    fprintf(stderr,"  Metadata headingbias:          %f\n",process.mbp_meta_headingbias);
-	    fprintf(stderr,"  Metadata draft:                %f\n",process.mbp_meta_draft);
-
-	    fprintf(stderr,"\nProcessing Kluges:\n");
-	    fprintf(stderr,"  Kluge001:                      %d\n",process.mbp_kluge001);
-	    fprintf(stderr,"  Kluge002:                      %d\n",process.mbp_kluge002);
-	    fprintf(stderr,"  Kluge003:                      %d\n",process.mbp_kluge003);
-	    fprintf(stderr,"  Kluge004:                      %d\n",process.mbp_kluge004);
-	    fprintf(stderr,"  Kluge005:                      %d\n",process.mbp_kluge005);
-	    fprintf(stderr,"  Kluge006:                      %d\n",process.mbp_kluge006);
-	    fprintf(stderr,"  Kluge007:                      %d\n",process.mbp_kluge007);
-	    fprintf(stderr,"  Kluge008:                      %d\n",process.mbp_kluge008);
-	    fprintf(stderr,"  Kluge009:                      %d\n",process.mbp_kluge009);
-	    fprintf(stderr,"  Kluge010:                      %d\n",process.mbp_kluge010);
-	    }
-
-	/*--------------------------------------------
-	  get svp
-	  --------------------------------------------*/
-
-	/* if raytracing or correction/uncorrection to be done get svp */
-	nsvp = 0;
-	if (process.mbp_svp_mode != MBP_SVP_OFF)
-	    {
-	    /* count the data points in the svp file */
-	    nsvp = 0;
-	    if ((tfp = fopen(process.mbp_svpfile, "r")) == NULL)
-		    {
-		    error = MB_ERROR_OPEN_FAIL;
-		    fprintf(stderr,"\nUnable to Open Velocity Profile File <%s> for reading\n",process.mbp_svpfile);
-		    fprintf(stderr,"\nProgram <%s> Terminated\n",
-			    program_name);
-		    exit(error);
-		    }
-	    while ((result = fgets(buffer,MBP_FILENAMESIZE,tfp)) == buffer)
-		    if (buffer[0] != '#')
-			nsvp++;
-	    fclose(tfp);
-
-	    /* allocate arrays for svp */
-	    if (nsvp > 1)
-		{
-		size = (nsvp+2) * sizeof(double);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,size,(void **)&depth,&error);
-		if (error == MB_ERROR_NO_ERROR)
-		status = mb_mallocd(verbose,__FILE__,__LINE__,size,(void **)&velocity,&error);
-		if (error == MB_ERROR_NO_ERROR)
-		status = mb_mallocd(verbose,__FILE__,__LINE__,size,(void **)&velocity_sum,&error);
-
-		/* if error initializing memory then quit */
-		if (error != MB_ERROR_NO_ERROR)
-		    {
-		    mb_error(verbose,error,&message);
-		    fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",message);
-		    fprintf(stderr,"\nProgram <%s> Terminated\n",
-			    program_name);
-		    exit(error);
-		    }
-		}
-
-	    /* if no svp data then quit */
-	    else
-		{
-		error = MB_ERROR_BAD_DATA;
-		fprintf(stderr,"\nUnable to read data from SVP file <%s>\n",process.mbp_svpfile);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-
-	    /* read the data points in the svp file */
-	    nsvp = 0;
-	    if ((tfp = fopen(process.mbp_svpfile, "r")) == NULL)
-		{
-		error = MB_ERROR_OPEN_FAIL;
-		fprintf(stderr,"\nUnable to Open Velocity Profile File <%s> for reading\n",process.mbp_svpfile);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-	    while ((result = fgets(buffer,MBP_FILENAMESIZE,tfp)) == buffer)
-		{
-		if (buffer[0] != '#')
-		    {
-		    /* read the depth & sound speed pair */
-		    mm = sscanf(buffer,"%lf %lf",&depth[nsvp],&velocity[nsvp]);
-
-                    /* check for validity */
-                    if (mm == 2)
-                        {
-                        /* output some debug values */
-                        if (verbose >= 5)
-                            {
-                            fprintf(stderr,"\ndbg5  New velocity value read in program <%s>\n",program_name);
-                            fprintf(stderr,"dbg5       depth[%d]: %f  velocity[%d]: %f\n",
-                                nsvp,depth[nsvp],nsvp,velocity[nsvp]);
-                            }
-
-                        /* set initial depth to zero if needed */
-                        if (nsvp == 0)
-                            {
-                            if (depth[0] < 0.0)
-                                {
-                                /* output some info */
-                                fprintf(stderr,"Warning:\n\tProblem with svp value read in program <%s>\n",program_name);
-                                fprintf(stderr,"\t\tdepth[%d]: %f  velocity[%d]: %f reset so that first entry has zero depth\n",
-                                        nsvp,depth[0],nsvp,velocity[0]);
-
-                                depth[0] = 0.0;
-                                nsvp++;
-                                }
-                            else if (depth[0] > 0.0)
-                                {
-                                depth[1] = depth[0];
-                                depth[0] = 0.0;
-                                velocity[1] = velocity[0];
-                                nsvp += 2;
-
-                                /* output some info */
-                                 fprintf(stderr,"Warning:\n\tProblem with svp value read in program <%s>\n",program_name);
-                                fprintf(stderr,"\t\tdepth[%d]: %f  velocity[%d]: %f added so that first entry has zero depth\n",
-                                         nsvp,depth[0],nsvp,velocity[0]);
-                                fprintf(stderr,"\t\tdepth[%d]: %f  velocity[%d]: %f did not have zero depth\n",
-                                        nsvp,depth[1],nsvp,velocity[1]);
-                                }
-                            else
-                                {
-                                nsvp++;
-                                }
-                             }
-
-                        /* increment counter if all is ok */
-                        else if (depth[nsvp] > depth[nsvp-1])
-                            {
-                            nsvp++;
-                            }
-
-                        /* ignore sound speed value with duplicate or decreasing depth */
-                        else
-                            {
-                            /* output some info */
-                            fprintf(stderr,"Warning:\n\tProblem with svp value read in program <%s>\n",program_name);
-                            fprintf(stderr,"\t\tdepth[%d]: %f  velocity[%d]: %f ignored due to duplicate or decreasing depth\n",
-                                    nsvp,depth[nsvp],nsvp,velocity[nsvp]);
-                            }
-                        }
-		    }
-		}
-	    fclose(tfp);
-
-	    /* set ssv_default */
-	    ssv_default = velocity[0];
-
-	    /* if velocity profile doesn't extend to 12000 m depth
-		    extend it to that depth */
-	    if (depth[nsvp-1] < 12000.0)
-		    {
-		    depth[nsvp] = 12000.0;
-		    velocity[nsvp] = velocity[nsvp-1];
-		    nsvp++;
-		    }
-
-	    /* get velocity sums */
-	    velocity_sum[0] = 0.5*(velocity[1] + velocity[0])
-		    *(depth[1] - depth[0]);
-	    for (i=1;i<nsvp-1;i++)
-		    {
-		    velocity_sum[i] = velocity_sum[i-1]
-			+ 0.5*(velocity[i+1] + velocity[i])
-			*(depth[i+1] - depth[i]);
-		    }
-	    }
-
-	/*--------------------------------------------
-	  get nav
-	  --------------------------------------------*/
-
-	/* if nav merging to be done get nav */
-	if (process.mbp_nav_mode == MBP_NAV_ON)
-	    {
-	    /* set max number of characters to be read at a time */
-	    if (process.mbp_nav_format == 8)
-		    nchar = 96;
-	    else
-		    nchar = MBP_FILENAMESIZE-1;
-
-	    /* count the data points in the nav file */
-	    nnav = 0;
-	    if ((tfp = fopen(process.mbp_navfile, "r")) == NULL)
-		    {
-		    error = MB_ERROR_OPEN_FAIL;
-		    fprintf(stderr,"\nUnable to Open Navigation File <%s> for reading\n",process.mbp_navfile);
-		    fprintf(stderr,"\nProgram <%s> Terminated\n",
-			    program_name);
-		    exit(error);
-		    }
-	    while ((result = fgets(buffer,nchar,tfp)) == buffer)
-		    nnav++;
-	    fclose(tfp);
-
-	    /* allocate arrays for nav */
-	    if (nnav > 1)
-		{
-		size = (nnav+1)*sizeof(double);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,nnav*sizeof(double),(void **)&ntime,&error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,nnav*sizeof(double),(void **)&nlon,&error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,nnav*sizeof(double),(void **)&nlat,&error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,nnav*sizeof(double),(void **)&nheading,&error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,nnav*sizeof(double),(void **)&nspeed,&error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,nnav*sizeof(double),(void **)&ndraft,&error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,nnav*sizeof(double),(void **)&nroll,&error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,nnav*sizeof(double),(void **)&npitch,&error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,nnav*sizeof(double),(void **)&nheave,&error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,nnav*sizeof(double),(void **)&nlonspl,&error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,nnav*sizeof(double),(void **)&nlatspl,&error);
-
-		/* if error initializing memory then quit */
-		if (error != MB_ERROR_NO_ERROR)
-		    {
-		    mb_error(verbose,error,&message);
-		    fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",message);
-		    fprintf(stderr,"\nProgram <%s> Terminated\n",
-			    program_name);
-		    exit(error);
-		    }
-		}
-
-	    /* if no nav data then quit */
-	    else
-		{
-		error = MB_ERROR_BAD_DATA;
-		fprintf(stderr,"\nUnable to read data from navigation file <%s>\n",process.mbp_navfile);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-
-	    /* read the data points in the nav file */
-	    nnav = 0;
-	    if ((tfp = fopen(process.mbp_navfile, "r")) == NULL)
-		{
-		error = MB_ERROR_OPEN_FAIL;
-		fprintf(stderr,"\nUnable to Open navigation File <%s> for reading\n",process.mbp_navfile);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-	    while ((result = fgets(buffer,nchar,tfp)) == buffer)
-		{
-		nav_ok = MB_NO;
-
-		/* deal with nav in form: time_d lon lat */
-		if (process.mbp_nav_format == 1)
-			{
-			nget = sscanf(buffer,"%lf %lf %lf",
-				&ntime[nnav],&nlon[nnav],&nlat[nnav]);
-			if (nget == 3)
-				nav_ok = MB_YES;
-			}
-
-		/* deal with nav in form: yr mon day hour min sec lon lat */
-		else if (process.mbp_nav_format == 2)
-			{
-			nget = sscanf(buffer,"%d %d %d %d %d %lf %lf %lf",
-				&time_i[0],&time_i[1],&time_i[2],
-				&time_i[3],&time_i[4],&sec,
-				&nlon[nnav],&nlat[nnav]);
-			time_i[5] = (int) sec;
-			time_i[6] = 1000000*(sec - time_i[5]);
-			mb_get_time(verbose,time_i,&time_d);
-			ntime[nnav] = time_d;
-			if (nget == 8)
-				nav_ok = MB_YES;
-			}
-
-		/* deal with nav in form: yr jday hour min sec lon lat */
-		else if (process.mbp_nav_format == 3)
-			{
-			nget = sscanf(buffer,"%d %d %d %d %lf %lf %lf",
-				&time_j[0],&time_j[1],&ihr,
-				&time_j[2],&sec,
-				&nlon[nnav],&nlat[nnav]);
-			time_j[2] = time_j[2] + 60*ihr;
-			time_j[3] = (int) sec;
-			time_j[4] = 1000000*(sec - time_j[3]);
-			mb_get_itime(verbose,time_j,time_i);
-			mb_get_time(verbose,time_i,&time_d);
-			ntime[nnav] = time_d;
-			if (nget == 7)
-				nav_ok = MB_YES;
-			}
-
-		/* deal with nav in form: yr jday daymin sec lon lat */
-		else if (process.mbp_nav_format == 4)
-			{
-			nget = sscanf(buffer,"%d %d %d %lf %lf %lf",
-				&time_j[0],&time_j[1],&time_j[2],
-				&sec,
-				&nlon[nnav],&nlat[nnav]);
-			time_j[3] = (int) sec;
-			time_j[4] = 1000000*(sec - time_j[3]);
-			mb_get_itime(verbose,time_j,time_i);
-			mb_get_time(verbose,time_i,&time_d);
-			ntime[nnav] = time_d;
-			if (nget == 6)
-				nav_ok = MB_YES;
-			}
-
-		/* deal with nav in L-DEO processed nav format */
-		else if (process.mbp_nav_format == 5)
-			{
-			strncpy(dummy,"\0",128);
-			if (buffer[2] == '+')
-				{
-				time_j[0] = atoi(strncpy(dummy,buffer,2));
-				mb_fix_y2k(verbose, time_j[0], &time_j[0]);
-				ioff = 3;
-				}
-			else
-				{
-				time_j[0] = atoi(strncpy(dummy,buffer,4));
-				ioff = 5;
-				}
-			strncpy(dummy,"\0",128);
-			time_j[1] = atoi(strncpy(dummy,buffer+ioff,3));
-			strncpy(dummy,"\0",128);
-			ioff += 4;
-			hr = atoi(strncpy(dummy,buffer+ioff,2));
-			strncpy(dummy,"\0",128);
-			ioff += 3;
-			time_j[2] = atoi(strncpy(dummy,buffer+ioff,2))
-				+ 60*hr;
-			strncpy(dummy,"\0",128);
-			ioff += 3;
-			time_j[3] = atoi(strncpy(dummy,buffer+ioff,2));
-			time_j[4] = 0;
-			mb_get_itime(verbose,time_j,time_i);
-			mb_get_time(verbose,time_i,&time_d);
-			ntime[nnav] = time_d;
-
-			strncpy(NorS,"\0",sizeof(NorS));
-			ioff += 7;
-			NorS[0] = buffer[ioff];
-			ioff += 1;
-			strncpy(dummy,"\0",128);
-			mlat = atof(strncpy(dummy,buffer+ioff,3));
-			strncpy(dummy,"\0",128);
-			ioff += 3;
-			llat = atof(strncpy(dummy,buffer+ioff,8));
-			strncpy(EorW,"\0",sizeof(EorW));
-			ioff += 9;
-			EorW[0] = buffer[ioff];
-			strncpy(dummy,"\0",128);
-			ioff += 1;
-			mlon = atof(strncpy(dummy,buffer+ioff,4));
-			strncpy(dummy,"\0",128);
-			ioff += 4;
-			llon = atof(strncpy(dummy,buffer+ioff,8));
-			nlon[nnav] = mlon + llon/60.;
-			if (strncmp(EorW,"W",1) == 0)
-				nlon[nnav] = -nlon[nnav];
-			nlat[nnav] = mlat + llat/60.;
-			if (strncmp(NorS,"S",1) == 0)
-				nlat[nnav] = -nlat[nnav];
-			nav_ok = MB_YES;
-			}
-
-		/* deal with nav in real and pseudo NMEA 0183 format */
-		else if (process.mbp_nav_format == 6 || process.mbp_nav_format == 7)
-			{
-			/* check if real sentence */
-			len = strlen(buffer);
-			if (strncmp(buffer,"$",1) == 0)
-			    {
-			    if (strncmp(&buffer[3],"DAT",3) == 0
-				&& len > 15)
-				{
-				time_set = MB_NO;
-				strncpy(dummy,"\0",128);
-				time_i[0] = atoi(strncpy(dummy,buffer+7,4));
-				time_i[1] = atoi(strncpy(dummy,buffer+11,2));
-				time_i[2] = atoi(strncpy(dummy,buffer+13,2));
-				}
-			    else if ((strncmp(&buffer[3],"ZDA",3) == 0
-				    || strncmp(&buffer[3],"UNX",3) == 0)
-				    && len > 14)
-				{
-				time_set = MB_NO;
-				/* find start of ",hhmmss.ss" */
-				if ((bufftmp = strchr(buffer, ',')) != NULL)
-				    {
-				    strncpy(dummy,"\0",128);
-				    time_i[3] = atoi(strncpy(dummy,bufftmp+1,2));
-				    strncpy(dummy,"\0",128);
-				    time_i[4] = atoi(strncpy(dummy,bufftmp+3,2));
-				    strncpy(dummy,"\0",128);
-				    time_i[5] = atoi(strncpy(dummy,bufftmp+5,2));
-				    if (bufftmp[7] == '.')
-					{
-					strncpy(dummy,"\0",128);
-					time_i[6] = 10000*
-					    atoi(strncpy(dummy,bufftmp+8,2));
-					}
-				    else
-					time_i[6] = 0;
-				    /* find start of ",dd,mm,yyyy" */
-				    if ((bufftmp = strchr(&bufftmp[1], ',')) != NULL)
-					{
-					strncpy(dummy,"\0",128);
-					time_i[2] = atoi(strncpy(dummy,bufftmp+1,2));
-					strncpy(dummy,"\0",128);
-					time_i[1] = atoi(strncpy(dummy,bufftmp+4,2));
-					strncpy(dummy,"\0",128);
-					time_i[0] = atoi(strncpy(dummy,bufftmp+7,4));
-					time_set = MB_YES;
-					}
-				    }
-				}
-			    else if (((process.mbp_nav_format == 6 && strncmp(&buffer[3],"GLL",3) == 0)
-				|| (process.mbp_nav_format == 7 && strncmp(&buffer[3],"GGA",3) == 0))
-				&& time_set == MB_YES && len > 26)
-				{
-				time_set = MB_NO;
-				/* find start of ",ddmm.mm,N,ddmm.mm,E" */
-				if ((bufftmp = strchr(buffer, ',')) != NULL)
-				    {
-				    if (process.mbp_nav_format == 7)
-					bufftmp = strchr(&bufftmp[1], ',');
-				    strncpy(dummy,"\0",128);
-				    degree = atoi(strncpy(dummy,bufftmp+1,2));
-				    strncpy(dummy,"\0",128);
-				    dminute = atof(strncpy(dummy,bufftmp+3,5));
-				    strncpy(NorS,"\0",sizeof(NorS));
-				    bufftmp = strchr(&bufftmp[1], ',');
-				    strncpy(NorS,bufftmp+1,1);
-				    nlat[nnav] = degree + dminute/60.;
-				    if (strncmp(NorS,"S",1) == 0)
-					nlat[nnav] = -nlat[nnav];
-				    bufftmp = strchr(&bufftmp[1], ',');
-				    strncpy(dummy,"\0",128);
-				    degree = atoi(strncpy(dummy,bufftmp+1,3));
-				    strncpy(dummy,"\0",128);
-				    dminute = atof(strncpy(dummy,bufftmp+4,5));
-				    bufftmp = strchr(&bufftmp[1], ',');
-				    strncpy(EorW,"\0",sizeof(EorW));
-				    strncpy(EorW,bufftmp+1,1);
-				    nlon[nnav] = degree + dminute/60.;
-				    if (strncmp(EorW,"W",1) == 0)
-					nlon[nnav] = -nlon[nnav];
-				    mb_get_time(verbose,time_i,&time_d);
-				    ntime[nnav] = time_d;
-				    nav_ok = MB_YES;
-				    }
-				}
-			    }
-			}
-
-		/* deal with nav in Simrad 90 format */
-		else if (process.mbp_nav_format == 8)
-			{
-			mb_get_int(&(time_i[2]), buffer+2,  2);
-			mb_get_int(&(time_i[1]), buffer+4,  2);
-			mb_get_int(&(time_i[0]), buffer+6,  2);
-			mb_fix_y2k(verbose, time_i[0], &time_i[0]);
-			mb_get_int(&(time_i[3]), buffer+9,  2);
-			mb_get_int(&(time_i[4]), buffer+11, 2);
-			mb_get_int(&(time_i[5]), buffer+13, 2);
-			mb_get_int(&(time_i[6]), buffer+15, 2);
-			time_i[6] = 10000 * time_i[6];
-			mb_get_time(verbose,time_i,&time_d);
-			ntime[nnav] = time_d;
-
-			mb_get_double(&mlat,    buffer+18,   2);
-			mb_get_double(&llat, buffer+20,   7);
-			NorS[0] = buffer[27];
-			nlat[nnav] = mlat + llat/60.0;
-			if (NorS[0] == 'S' || NorS[0] == 's')
-				nlat[nnav] = -nlat[nnav];
-			mb_get_double(&mlon,    buffer+29,   3);
-			mb_get_double(&llon, buffer+32,   7);
-			EorW[0] = buffer[39];
-			nlon[nnav] = mlon + llon/60.0;
-			if (EorW[0] == 'W' || EorW[0] == 'w')
-				nlon[nnav] = -nlon[nnav];
-			nav_ok = MB_YES;
-			}
-
-		/* deal with nav in form: yr mon day hour min sec time_d lon lat heading speed draft*/
-		else if (process.mbp_nav_format == 9)
-			{
-			nget = sscanf(buffer,"%d %d %d %d %d %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf",
-				&time_i[0],&time_i[1],&time_i[2],
-				&time_i[3],&time_i[4],&sec,
-				&ntime[nnav],
-				&nlon[nnav],&nlat[nnav],
-				&nheading[nnav],&nspeed[nnav],&ndraft[nnav],
-				&nroll[nnav],&npitch[nnav],&nheave[nnav]);
-			if (nget >= 9)
-				nav_ok = MB_YES;
-                        if (nnav > 0 && ntime[nnav] <= ntime[nnav-1])
-                                nav_ok = MB_NO;
-			if (nav_ok == MB_YES)
-			    {
-			    if (process.mbp_nav_heading == MBP_NAV_ON && nget < 10)
-				{
-				fprintf(stderr,"\nHeading data missing from nav file.\nMerging of heading data disabled.\n");
-				process.mbp_nav_heading = MBP_NAV_OFF;
-				}
-			    if (process.mbp_nav_speed == MBP_NAV_ON && nget < 11)
-				{
-				fprintf(stderr,"Speed data missing from nav file.\nMerging of speed data disabled.\n");
-				process.mbp_nav_speed = MBP_NAV_OFF;
-				}
-			    if (process.mbp_nav_draft == MBP_NAV_ON && nget < 12)
-				{
-				fprintf(stderr,"Draft data missing from nav file.\nMerging of draft data disabled.\n");
-				process.mbp_nav_draft = MBP_NAV_OFF;
-				}
-			    if (process.mbp_nav_attitude == MBP_NAV_ON && nget < 15)
-				{
-				fprintf(stderr,"Roll, pitch, and heave data missing from nav file.\nMerging of roll, pitch, and heave data disabled.\n");
-				process.mbp_nav_attitude = MBP_NAV_OFF;
-				}
-			    if (process.mbp_nav_heading == MBP_NAV_OFF)
-				{
-				nheading[nnav] = 0.0;
-				}
-			    if (process.mbp_nav_speed == MBP_NAV_OFF)
-				{
-				nspeed[nnav] = 0.0;
-				}
-			    if (process.mbp_nav_draft == MBP_NAV_OFF)
-				{
-				ndraft[nnav] = 0.0;
-				}
-			    if (process.mbp_nav_attitude == MBP_NAV_OFF)
-				{
-				nroll[nnav] = 0.0;
-				npitch[nnav] = 0.0;
-				nheave[nnav] = 0.0;
-				}
-			    }
-			}
-
-		/* deal with nav in r2rnav form:
-			yyyy-mm-ddThh:mm:ss.sssZ decimalLongitude decimalLatitude quality nsat dilution height */
-		else if (process.mbp_nav_format == 10)
-			{
-			nget = sscanf(buffer,"%d-%d-%dT%d:%d:%lfZ %lf %lf %d %d %d %d",
-				&time_i[0],&time_i[1],&time_i[2],
-				&time_i[3],&time_i[4],&sec,
-				&nlon[nnav],&nlat[nnav],
-				&quality,&nsatellite,&dilution,&gpsheight);
-			if (nget != 12)
-				{
-				quality = 0;
-				nsatellite = 0;
-				dilution = 0;
-				gpsheight = 0;
-				}
-			time_i[5] = (int) floor(sec);
-			time_i[6] = (int)((sec - time_i[5]) * 1000000);
-			mb_get_time(verbose,time_i,&time_d);
-			ntime[nnav] = time_d;
-			nheading[nnav] = 0.0;
-			nspeed[nnav] = 0.0;
-			ndraft[nnav] = 0.0;
-			nroll[nnav] = 0.0;
-			npitch[nnav] = 0.0;
-			nheave[nnav] = 0.0;
-			if (nget >= 8)
-				nav_ok = MB_YES;
-			}
-
-
-		/* make sure longitude is defined according to lonflip */
-		if (nav_ok == MB_YES)
-			{
-			if (lonflip == -1 && nlon[nnav] > 0.0)
-				nlon[nnav] = nlon[nnav] - 360.0;
-			else if (lonflip == 0 && nlon[nnav] < -180.0)
-				nlon[nnav] = nlon[nnav] + 360.0;
-			else if (lonflip == 0 && nlon[nnav] > 180.0)
-				nlon[nnav] = nlon[nnav] - 360.0;
-			else if (lonflip == 1 && nlon[nnav] < 0.0)
-				nlon[nnav] = nlon[nnav] + 360.0;
-			}
-
-		/* output some debug values */
-		if (verbose >= 5 && nav_ok == MB_YES)
-			{
-			fprintf(stderr,"\ndbg5  New navigation point read in program <%s>\n",program_name);
-			fprintf(stderr,"dbg5       nav[%d]: %f %f %f\n",
-				nnav,ntime[nnav],nlon[nnav],nlat[nnav]);
-			}
-		else if (verbose >= 5)
-			{
-			fprintf(stderr,"\ndbg5  Error parsing line in navigation file in program <%s>\n",program_name);
-			fprintf(stderr,"dbg5       line: %s\n",buffer);
-			}
-
-		/* check for reverses or repeats in time */
-		if (nav_ok == MB_YES)
-			{
-			if (nnav == 0)
-				nnav++;
-			else if (ntime[nnav] > ntime[nnav-1])
-				nnav++;
-			else if (nnav > 0 && ntime[nnav] <= ntime[nnav-1]
-				&& verbose >= 5)
-				{
-				fprintf(stderr,"\ndbg5  Navigation time error in program <%s>\n",program_name);
-				fprintf(stderr,"dbg5       nav[%d]: %f %f %f\n",
-					nnav-1,ntime[nnav-1],nlon[nnav-1],
-					nlat[nnav-1]);
-				fprintf(stderr,"dbg5       nav[%d]: %f %f %f\n",
-					nnav,ntime[nnav],nlon[nnav],
-					nlat[nnav]);
-				}
-			}
-		strncpy(buffer,"\0",sizeof(buffer));
-		}
-	    fclose(tfp);
-
-
-	    /* check for nav */
-	    if (nnav < 2)
-		    {
-		    fprintf(stderr,"\nNo navigation read from file <%s>\n",process.mbp_navfile);
-		    fprintf(stderr,"\nProgram <%s> Terminated\n",
-			    program_name);
-		    exit(error);
-		    }
-
-	    /* apply time shift if needed */
-	    if (process.mbp_nav_timeshift != 0.0)
-		for (i=0;i<nnav;i++)
-		    ntime[i] += process.mbp_nav_timeshift;
-
-	    /* set up spline interpolation of nav points */
-	    splineflag = 1.0e30;
-	    mb_spline_init(verbose, ntime-1, nlon-1, nnav,
-			splineflag, splineflag, nlonspl-1, &error);
-	    mb_spline_init(verbose, ntime-1, nlat-1, nnav,
-			splineflag, splineflag, nlatspl-1, &error);
-
-	    /* get start and finish times of nav */
-	    mb_get_date(verbose,ntime[0],stime_i);
-	    mb_get_date(verbose,ntime[nnav-1],ftime_i);
-
-	    /* give the statistics */
-	    if (verbose >= 1)
-		    {
-		    fprintf(stderr,"\n%d navigation records read\n",nnav);
-		    fprintf(stderr,"Nav start time: %4.4d %2.2d %2.2d %2.2d:%2.2d:%2.2d.%6.6d\n",
-			    stime_i[0],stime_i[1],stime_i[2],stime_i[3],
-			    stime_i[4],stime_i[5],stime_i[6]);
-		    fprintf(stderr,"Nav end time:   %4.4d %2.2d %2.2d %2.2d:%2.2d:%2.2d.%6.6d\n",
-			    ftime_i[0],ftime_i[1],ftime_i[2],ftime_i[3],
-			    ftime_i[4],ftime_i[5],ftime_i[6]);
-		    }
-	    }
-
-	/*--------------------------------------------
-	  get adjusted nav
-	  --------------------------------------------*/
-
-	/* if adjusted nav merging to be done get adjusted nav */
-	if (process.mbp_navadj_mode >= MBP_NAVADJ_LL)
-	    {
-	    /* set max number of characters to be read at a time */
-	    nchar = 128;
-
-	    /* count the data points in the adjusted nav file */
-	    nanav = 0;
-	    if ((tfp = fopen(process.mbp_navadjfile, "r")) == NULL)
-		    {
-		    error = MB_ERROR_OPEN_FAIL;
-		    fprintf(stderr,"\nUnable to Open Adjusted Navigation File <%s> for reading\n",process.mbp_navadjfile);
-		    fprintf(stderr,"\nProgram <%s> Terminated\n",
-			    program_name);
-		    exit(error);
-		    }
-	    while ((result = fgets(buffer,nchar,tfp)) == buffer)
-		    if (buffer[0] != '#')
-		    	nanav++;
-	    fclose(tfp);
-
-	    /* allocate arrays for adjusted nav */
-	    if (nanav > 1)
-		{
-		size = (nanav+1)*sizeof(double);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,nanav*sizeof(double),(void **)&natime,&error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,nanav*sizeof(double),(void **)&nalon,&error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,nanav*sizeof(double),(void **)&nalat,&error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,nanav*sizeof(double),(void **)&naz,&error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,nanav*sizeof(double),(void **)&nalonspl,&error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,nanav*sizeof(double),(void **)&nalatspl,&error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,nanav*sizeof(double),(void **)&nazspl,&error);
-
-		/* if error initializing memory then quit */
-		if (error != MB_ERROR_NO_ERROR)
-		    {
-		    mb_error(verbose,error,&message);
-		    fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",message);
-		    fprintf(stderr,"\nProgram <%s> Terminated\n",
-			    program_name);
-		    exit(error);
-		    }
-		}
-
-	    /* if no adjusted nav data then quit */
-	    else
-		{
-		error = MB_ERROR_BAD_DATA;
-		fprintf(stderr,"\nUnable to read data from adjusted navigation file <%s>\n",process.mbp_navadjfile);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-
-	    /* read the data points in the nav file */
-	    nanav = 0;
-	    if ((tfp = fopen(process.mbp_navadjfile, "r")) == NULL)
-		{
-		error = MB_ERROR_OPEN_FAIL;
-		fprintf(stderr,"\nUnable to Open navigation File <%s> for reading\n",process.mbp_navadjfile);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-	    while ((result = fgets(buffer,nchar,tfp)) == buffer)
-		{
-		nav_ok = MB_NO;
-
-		/* deal with nav in form: yr mon day hour min sec time_d lon lat */
-		if (buffer[0] != '#')
-			{
-			nget = sscanf(buffer,"%d %d %d %d %d %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf",
-				&time_i[0],&time_i[1],&time_i[2],
-				&time_i[3],&time_i[4],&sec,
-				&natime[nanav],
-				&nalon[nanav],&nalat[nanav],
-				&heading, &speed, &draft,
-				&roll, &pitch, &heave,
-				&naz[nanav]);
-			if (process.mbp_navadj_mode == MBP_NAVADJ_LL && nget >= 9)
-				nav_ok = MB_YES;
-			else if (process.mbp_navadj_mode == MBP_NAVADJ_LLZ && nget >= 16)
-				nav_ok = MB_YES;
-			}
-
-		/* make sure longitude is defined according to lonflip */
-		if (nav_ok == MB_YES)
-			{
-			if (lonflip == -1 && nalon[nanav] > 0.0)
-				nalon[nanav] = nalon[nanav] - 360.0;
-			else if (lonflip == 0 && nalon[nanav] < -180.0)
-				nalon[nanav] = nalon[nanav] + 360.0;
-			else if (lonflip == 0 && nalon[nanav] > 180.0)
-				nalon[nanav] = nalon[nanav] - 360.0;
-			else if (lonflip == 1 && nalon[nanav] < 0.0)
-				nalon[nanav] = nalon[nanav] + 360.0;
-			}
-
-		/* output some debug values */
-		if (verbose >= 5 && nav_ok == MB_YES)
-			{
-			fprintf(stderr,"\ndbg5  New adjusted navigation point read in program <%s>\n",program_name);
-			fprintf(stderr,"dbg5       nav[%d]: %f %f %f\n",
-				nanav,natime[nanav],nalon[nanav],nalat[nanav]);
-			}
-		else if (verbose >= 5)
-			{
-			fprintf(stderr,"\ndbg5  Error parsing line in navigation file in program <%s>\n",program_name);
-			fprintf(stderr,"dbg5       line: %s\n",buffer);
-			}
-
-		/* check for reverses or repeats in time */
-		if (nav_ok == MB_YES)
-			{
-			if (nanav == 0)
-				nanav++;
-			else if (natime[nanav] > natime[nanav-1])
-				nanav++;
-			else if (nanav > 0 && natime[nanav] <= natime[nanav-1]
-				&& verbose >= 5)
-				{
-				fprintf(stderr,"\ndbg5  Navigation time error in program <%s>\n",program_name);
-				fprintf(stderr,"dbg5       adjusted nav[%d]: %f %f %f\n",
-					nanav-1,natime[nanav-1],nalon[nanav-1],
-					nalat[nanav-1]);
-				fprintf(stderr,"dbg5       adjusted nav[%d]: %f %f %f\n",
-					nanav,natime[nanav],nalon[nanav],
-					nalat[nanav]);
-				}
-			}
-		strncpy(buffer,"\0",sizeof(buffer));
-		}
-	    fclose(tfp);
-
-	    /* check for adjusted nav */
-	    if (nanav < 2)
-		    {
-		    fprintf(stderr,"\nNo adjusted navigation read from file <%s>\n",process.mbp_navadjfile);
-		    fprintf(stderr,"\nProgram <%s> Terminated\n",
-			    program_name);
-		    exit(error);
-		    }
-
-	    /* set up spline interpolation of adjusted nav points */
-	    splineflag = 1.0e30;
-	    mb_spline_init(verbose, natime-1, nalon-1, nanav,
-			splineflag, splineflag, nalonspl-1, &error);
-	    mb_spline_init(verbose, natime-1, nalat-1, nanav,
-			splineflag, splineflag, nalatspl-1, &error);
-	    mb_spline_init(verbose, natime-1, naz-1, nanav,
-			splineflag, splineflag, nazspl-1, &error);
-
-	    /* get start and finish times of nav */
-	    mb_get_date(verbose,natime[0],stime_i);
-	    mb_get_date(verbose,natime[nanav-1],ftime_i);
-
-	    /* give the statistics */
-	    if (verbose >= 1)
-		    {
-		    fprintf(stderr,"\n%d adjusted navigation records read\n",nanav);
-		    fprintf(stderr,"Adjusted nav start time: %4.4d %2.2d %2.2d %2.2d:%2.2d:%2.2d.%6.6d\n",
-			    stime_i[0],stime_i[1],stime_i[2],stime_i[3],
-			    stime_i[4],stime_i[5],stime_i[6]);
-		    fprintf(stderr,"Adjusted nav end time:   %4.4d %2.2d %2.2d %2.2d:%2.2d:%2.2d.%6.6d\n",
-			    ftime_i[0],ftime_i[1],ftime_i[2],ftime_i[3],
-			    ftime_i[4],ftime_i[5],ftime_i[6]);
-		    }
-	    }
-
-	/*--------------------------------------------
-	  get attitude
-	  --------------------------------------------*/
-
-	/* if attitude merging to be done get attitude */
-	if (process.mbp_attitude_mode == MBP_ATTITUDE_ON)
-	    {
-	    /* set max number of characters to be read at a time */
-	    nchar = 128;
-
-	    /* count the data points in the attitude file */
-	    nattitude = 0;
-	    if ((tfp = fopen(process.mbp_attitudefile, "r")) == NULL)
-		    {
-		    error = MB_ERROR_OPEN_FAIL;
-		    fprintf(stderr,"\nUnable to Open Attitude File <%s> for reading\n",process.mbp_attitudefile);
-		    fprintf(stderr,"\nProgram <%s> Terminated\n",
-			    program_name);
-		    exit(error);
-		    }
-	    while ((result = fgets(buffer,nchar,tfp)) == buffer)
-		    nattitude++;
-	    fclose(tfp);
-
-	    /* allocate arrays for attitude */
-	    if (nattitude > 1)
-		{
-		size = (nattitude+1)*sizeof(double);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,nattitude*sizeof(double),(void **)&attitudetime,&error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,nattitude*sizeof(double),(void **)&attituderoll,&error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,nattitude*sizeof(double),(void **)&attitudepitch,&error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,nattitude*sizeof(double),(void **)&attitudeheave,&error);
-
-		/* if error initializing memory then quit */
-		if (error != MB_ERROR_NO_ERROR)
-		    {
-		    mb_error(verbose,error,&message);
-		    fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",message);
-		    fprintf(stderr,"\nProgram <%s> Terminated\n",
-			    program_name);
-		    exit(error);
-		    }
-		}
-
-	    /* if no attitude data then quit */
-	    else
-		{
-		error = MB_ERROR_BAD_DATA;
-		fprintf(stderr,"\nUnable to read data from attitude file <%s>\n",process.mbp_attitudefile);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-
-	    /* read the data points in the attitude file */
-	    nattitude = 0;
-	    if ((tfp = fopen(process.mbp_attitudefile, "r")) == NULL)
-		{
-		error = MB_ERROR_OPEN_FAIL;
-		fprintf(stderr,"\nUnable to Open Attitude File <%s> for reading\n",process.mbp_attitudefile);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-	    while ((result = fgets(buffer,nchar,tfp)) == buffer)
-		{
-		attitude_ok = MB_NO;
-
-		/* ignore comments */
-		if (buffer[0] != '#')
-			{
-
-			/* deal with attitude in form: time_d roll pitch heave */
-			if (process.mbp_attitude_format == 1)
-				{
-				nget = sscanf(buffer,"%lf %lf %lf %lf",
-					&attitudetime[nattitude],&attituderoll[nattitude],
-					&attitudepitch[nattitude],&attitudeheave[nattitude]);
-				if (nget == 4)
-					attitude_ok = MB_YES;
-				}
-
-			/* deal with attitude in form: yr mon day hour min sec roll pitch heave */
-			else if (process.mbp_attitude_format == 2)
-				{
-				nget = sscanf(buffer,"%d %d %d %d %d %lf %lf %lf %lf",
-					&time_i[0],&time_i[1],&time_i[2],
-					&time_i[3],&time_i[4],&sec,
-					&attituderoll[nattitude],
-					&attitudepitch[nattitude],
-					&attitudeheave[nattitude]);
-				time_i[5] = (int) sec;
-				time_i[6] = 1000000*(sec - time_i[5]);
-				mb_get_time(verbose,time_i,&time_d);
-				attitudetime[nattitude] = time_d;
-				if (nget == 9)
-					attitude_ok = MB_YES;
-				}
-
-			/* deal with attitude in form: yr jday hour min sec roll pitch heave */
-			else if (process.mbp_attitude_format == 3)
-				{
-				nget = sscanf(buffer,"%d %d %d %d %lf %lf %lf %lf",
-					&time_j[0],&time_j[1],&ihr,
-					&time_j[2],&sec,
-					&attituderoll[nattitude],
-					&attitudepitch[nattitude],
-					&attitudeheave[nattitude]);
-				time_j[2] = time_j[2] + 60*ihr;
-				time_j[3] = (int) sec;
-				time_j[4] = 1000000*(sec - time_j[3]);
-				mb_get_itime(verbose,time_j,time_i);
-				mb_get_time(verbose,time_i,&time_d);
-				attitudetime[nattitude] = time_d;
-				if (nget == 9)
-					attitude_ok = MB_YES;
-				}
-
-			/* deal with attitude in form: yr jday daymin sec roll pitch heave */
-			else if (process.mbp_attitude_format == 4)
-				{
-				nget = sscanf(buffer,"%d %d %d %lf %lf %lf %lf",
-					&time_j[0],&time_j[1],&time_j[2],
-					&sec,
-					&attituderoll[nattitude],
-					&attitudepitch[nattitude],
-					&attitudeheave[nattitude]);
-				time_j[3] = (int) sec;
-				time_j[4] = 1000000*(sec - time_j[3]);
-				mb_get_itime(verbose,time_j,time_i);
-				mb_get_time(verbose,time_i,&time_d);
-				attitudetime[nattitude] = time_d;
-				if (nget == 7)
-					attitude_ok = MB_YES;
-				}
-			}
-
-		/* output some debug values */
-		if (verbose >= 5 && attitude_ok == MB_YES)
-			{
-			fprintf(stderr,"\ndbg5  New attitude point read in program <%s>\n",program_name);
-			fprintf(stderr,"dbg5       attitude[%d]: %f %f %f %f\n",
-				nattitude,attitudetime[nattitude],attituderoll[nattitude],
-				attitudepitch[nattitude],attitudeheave[nattitude]);
-			}
-		else if (verbose >= 5)
-			{
-			fprintf(stderr,"\ndbg5  Error parsing line in attitude file in program <%s>\n",program_name);
-			fprintf(stderr,"dbg5       line: %s\n",buffer);
-			}
-
-		/* check for reverses or repeats in time */
-		if (attitude_ok == MB_YES)
-			{
-			if (nattitude == 0)
-				nattitude++;
-			else if (attitudetime[nattitude] > attitudetime[nattitude-1])
-				nattitude++;
-			else if (nattitude > 0 && attitudetime[nattitude] <= attitudetime[nattitude-1]
-				&& verbose >= 5)
-				{
-				fprintf(stderr,"\ndbg5  Attitude time error in program <%s>\n",program_name);
-				fprintf(stderr,"dbg5       attitude[%d]: %f %f %f %f\n",
-					nattitude-1,attitudetime[nattitude-1],
-					attituderoll[nattitude-1],
-					attitudepitch[nattitude-1],
-					attitudeheave[nattitude-1]);
-				fprintf(stderr,"dbg5       attitude[%d]: %f %f %f %f\n",
-					nattitude,attitudetime[nattitude],
-					attituderoll[nattitude-1],
-					attitudepitch[nattitude-1],
-					attitudeheave[nattitude-1]);
-				}
-			}
-		strncpy(buffer,"\0",sizeof(buffer));
-		}
-	    fclose(tfp);
-
-
-	    /* check for attitude */
-	    if (nattitude < 2)
-		    {
-		    fprintf(stderr,"\nNo attitude read from file <%s>\n",process.mbp_attitudefile);
-		    fprintf(stderr,"\nProgram <%s> Terminated\n",
-			    program_name);
-		    exit(error);
-		    }
-
-	    /* get start and finish times of attitude */
-	    mb_get_date(verbose,attitudetime[0],stime_i);
-	    mb_get_date(verbose,attitudetime[nattitude-1],ftime_i);
-
-	    /* give the statistics */
-	    if (verbose >= 1)
-		    {
-		    fprintf(stderr,"\n%d attitude records read\n",nattitude);
-		    fprintf(stderr,"Attitude start time: %4.4d %2.2d %2.2d %2.2d:%2.2d:%2.2d.%6.6d\n",
-			    stime_i[0],stime_i[1],stime_i[2],stime_i[3],
-			    stime_i[4],stime_i[5],stime_i[6]);
-		    fprintf(stderr,"Attitude end time:   %4.4d %2.2d %2.2d %2.2d:%2.2d:%2.2d.%6.6d\n",
-			    ftime_i[0],ftime_i[1],ftime_i[2],ftime_i[3],
-			    ftime_i[4],ftime_i[5],ftime_i[6]);
-		    }
-	    }
-
-	/*--------------------------------------------
-	  get sonardepth
-	  --------------------------------------------*/
-
-	/* if sonardepth merging to be done get sonardepth */
-	if (process.mbp_sonardepth_mode == MBP_SONARDEPTH_ON)
-	    {
-	    /* set max number of characters to be read at a time */
-	    nchar = 128;
-
-	    /* count the data points in the sonardepth file */
-	    nsonardepth = 0;
-	    if ((tfp = fopen(process.mbp_sonardepthfile, "r")) == NULL)
-		    {
-		    error = MB_ERROR_OPEN_FAIL;
-		    fprintf(stderr,"\nUnable to Open Sonardepth File <%s> for reading\n",process.mbp_sonardepthfile);
-		    fprintf(stderr,"\nProgram <%s> Terminated\n",
-			    program_name);
-		    exit(error);
-		    }
-	    while ((result = fgets(buffer,nchar,tfp)) == buffer)
-		    nsonardepth++;
-	    fclose(tfp);
-
-	    /* allocate arrays for sonardepth */
-	    if (nsonardepth > 1)
-		{
-		size = (nsonardepth+1)*sizeof(double);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,nsonardepth*sizeof(double),(void **)&fsonardepthtime,&error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,nsonardepth*sizeof(double),(void **)&fsonardepth,&error);
-
-		/* if error initializing memory then quit */
-		if (error != MB_ERROR_NO_ERROR)
-		    {
-		    mb_error(verbose,error,&message);
-		    fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",message);
-		    fprintf(stderr,"\nProgram <%s> Terminated\n",
-			    program_name);
-		    exit(error);
-		    }
-		}
-
-	    /* if no sonardepth data then quit */
-	    else
-		{
-		error = MB_ERROR_BAD_DATA;
-		fprintf(stderr,"\nUnable to read data from sonardepth file <%s>\n",process.mbp_sonardepthfile);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-
-	    /* read the data points in the sonardepth file */
-	    nsonardepth = 0;
-	    if ((tfp = fopen(process.mbp_sonardepthfile, "r")) == NULL)
-		{
-		error = MB_ERROR_OPEN_FAIL;
-		fprintf(stderr,"\nUnable to Open Sonardepth File <%s> for reading\n",process.mbp_sonardepthfile);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-	    while ((result = fgets(buffer,nchar,tfp)) == buffer)
-		{
-		sonardepth_ok = MB_NO;
-
-		/* ignore comments */
-		if (buffer[0] != '#')
-			{
-
-			/* deal with sonardepth in form: time_d sonardepth */
-			if (process.mbp_sonardepth_format == 1)
-				{
-				nget = sscanf(buffer,"%lf %lf",
-					&fsonardepthtime[nsonardepth],&fsonardepth[nsonardepth]);
-				if (nget == 2)
-					sonardepth_ok = MB_YES;
-				}
-
-			/* deal with sonardepth in form: yr mon day hour min sec sonardepth */
-			else if (process.mbp_sonardepth_format == 2)
-				{
-				nget = sscanf(buffer,"%d %d %d %d %d %lf %lf",
-					&time_i[0],&time_i[1],&time_i[2],
-					&time_i[3],&time_i[4],&sec,
-					&fsonardepth[nsonardepth]);
-				time_i[5] = (int) sec;
-				time_i[6] = 1000000*(sec - time_i[5]);
-				mb_get_time(verbose,time_i,&time_d);
-				fsonardepthtime[nsonardepth] = time_d;
-				if (nget == 7)
-					sonardepth_ok = MB_YES;
-				}
-
-			/* deal with sonardepth in form: yr jday hour min sec sonardepth */
-			else if (process.mbp_sonardepth_format == 3)
-				{
-				nget = sscanf(buffer,"%d %d %d %d %lf %lf",
-					&time_j[0],&time_j[1],&ihr,
-					&time_j[2],&sec,
-					&fsonardepth[nsonardepth]);
-				time_j[2] = time_j[2] + 60*ihr;
-				time_j[3] = (int) sec;
-				time_j[4] = 1000000*(sec - time_j[3]);
-				mb_get_itime(verbose,time_j,time_i);
-				mb_get_time(verbose,time_i,&time_d);
-				fsonardepthtime[nsonardepth] = time_d;
-				if (nget == 7)
-					sonardepth_ok = MB_YES;
-				}
-
-			/* deal with sonardepth in form: yr jday daymin sec sonardepth */
-			else if (process.mbp_sonardepth_format == 4)
-				{
-				nget = sscanf(buffer,"%d %d %d %lf %lf",
-					&time_j[0],&time_j[1],&time_j[2],
-					&sec,
-					&fsonardepth[nsonardepth]);
-				time_j[3] = (int) sec;
-				time_j[4] = 1000000*(sec - time_j[3]);
-				mb_get_itime(verbose,time_j,time_i);
-				mb_get_time(verbose,time_i,&time_d);
-				fsonardepthtime[nsonardepth] = time_d;
-				if (nget == 5)
-					sonardepth_ok = MB_YES;
-				}
-			}
-
-		/* output some debug values */
-		if (verbose >= 5 && sonardepth_ok == MB_YES)
-			{
-			fprintf(stderr,"\ndbg5  New sonardepth point read in program <%s>\n",program_name);
-			fprintf(stderr,"dbg5       sonardepth[%d]: %f %f\n",
-				nsonardepth,fsonardepthtime[nsonardepth],fsonardepth[nsonardepth]);
-			}
-		else if (verbose >= 5)
-			{
-			fprintf(stderr,"\ndbg5  Error parsing line in sonardepth file in program <%s>\n",program_name);
-			fprintf(stderr,"dbg5       line: %s\n",buffer);
-			}
-
-		/* check for reverses or repeats in time */
-		if (sonardepth_ok == MB_YES)
-			{
-			if (nsonardepth == 0)
-				nsonardepth++;
-			else if (fsonardepthtime[nsonardepth] > fsonardepthtime[nsonardepth-1])
-				nsonardepth++;
-			else if (nsonardepth > 0 && fsonardepthtime[nsonardepth] <= fsonardepthtime[nsonardepth-1]
-				&& verbose >= 5)
-				{
-				fprintf(stderr,"\ndbg5  sonardepth time error in program <%s>\n",program_name);
-				fprintf(stderr,"dbg5       sonardepth[%d]: %f %f\n",
-					nsonardepth-1,fsonardepthtime[nsonardepth-1],
-					fsonardepth[nsonardepth-1]);
-				fprintf(stderr,"dbg5       sonardepth[%d]: %f %f\n",
-					nsonardepth,fsonardepthtime[nsonardepth],
-					fsonardepth[nsonardepth-1]);
-				}
-			}
-		strncpy(buffer,"\0",sizeof(buffer));
-		}
-	    fclose(tfp);
-
-
-	    /* check for sonardepth */
-	    if (nsonardepth < 2)
-		    {
-		    fprintf(stderr,"\nNo sonardepth read from file <%s>\n",process.mbp_sonardepthfile);
-		    fprintf(stderr,"\nProgram <%s> Terminated\n",
-			    program_name);
-		    exit(error);
-		    }
-
-	    /* get start and finish times of sonardepth */
-	    mb_get_date(verbose,fsonardepthtime[0],stime_i);
-	    mb_get_date(verbose,fsonardepthtime[nsonardepth-1],ftime_i);
-
-	    /* give the statistics */
-	    if (verbose >= 1)
-		    {
-		    fprintf(stderr,"\n%d sonardepth records read\n",nsonardepth);
-		    fprintf(stderr,"Sonardepth start time: %4.4d %2.2d %2.2d %2.2d:%2.2d:%2.2d.%6.6d\n",
-			    stime_i[0],stime_i[1],stime_i[2],stime_i[3],
-			    stime_i[4],stime_i[5],stime_i[6]);
-		    fprintf(stderr,"Sonardepth end time:   %4.4d %2.2d %2.2d %2.2d:%2.2d:%2.2d.%6.6d\n",
-			    ftime_i[0],ftime_i[1],ftime_i[2],ftime_i[3],
-			    ftime_i[4],ftime_i[5],ftime_i[6]);
-		    }
-	    }
-
-	/*--------------------------------------------
-	  get tide
-	  --------------------------------------------*/
-
-	/* if tide correction to be done get tide */
-	if (process.mbp_tide_mode == MBP_TIDE_ON)
-	    {
-	    /* set max number of characters to be read at a time */
-	    nchar = 128;
-
-	    /* count the data points in the tide file */
-	    ntide = 0;
-	    if ((tfp = fopen(process.mbp_tidefile, "r")) == NULL)
-		    {
-		    error = MB_ERROR_OPEN_FAIL;
-		    fprintf(stderr,"\nUnable to Open Tide File <%s> for reading\n",process.mbp_tidefile);
-		    fprintf(stderr,"\nProgram <%s> Terminated\n",
-			    program_name);
-		    exit(error);
-		    }
-	    while ((result = fgets(buffer,nchar,tfp)) == buffer)
-		    ntide++;
-	    fclose(tfp);
-
-	    /* allocate arrays for tide */
-	    if (ntide > 1)
-		{
-		size = (ntide+1)*sizeof(double);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,ntide*sizeof(double),(void **)&tidetime,&error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,ntide*sizeof(double),(void **)&tide,&error);
-
-		/* if error initializing memory then quit */
-		if (error != MB_ERROR_NO_ERROR)
-		    {
-		    mb_error(verbose,error,&message);
-		    fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",message);
-		    fprintf(stderr,"\nProgram <%s> Terminated\n",
-			    program_name);
-		    exit(error);
-		    }
-		}
-
-	    /* if no tide data then quit */
-	    else
-		{
-		error = MB_ERROR_BAD_DATA;
-		fprintf(stderr,"\nUnable to read data from tide file <%s>\n",process.mbp_tidefile);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-
-	    /* read the data points in the tide file */
-	    ntide = 0;
-	    if ((tfp = fopen(process.mbp_tidefile, "r")) == NULL)
-		{
-		error = MB_ERROR_OPEN_FAIL;
-		fprintf(stderr,"\nUnable to Open Tide File <%s> for reading\n",process.mbp_tidefile);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-	    while ((result = fgets(buffer,nchar,tfp)) == buffer)
-		{
-		tide_ok = MB_NO;
-
-		/* ignore comments */
-		if (buffer[0] != '#')
-			{
-
-			/* deal with tide in form: time_d tide */
-			if (process.mbp_tide_format == 1)
-				{
-				nget = sscanf(buffer,"%lf %lf",
-					&tidetime[ntide],&tide[ntide]);
-				if (nget == 2)
-					tide_ok = MB_YES;
-				}
-
-			/* deal with tide in form: yr mon day hour min sec tide */
-			else if (process.mbp_tide_format == 2)
-				{
-				nget = sscanf(buffer,"%d %d %d %d %d %lf %lf",
-					&time_i[0],&time_i[1],&time_i[2],
-					&time_i[3],&time_i[4],&sec,
-					&tide[ntide]);
-				time_i[5] = (int) sec;
-				time_i[6] = 1000000*(sec - time_i[5]);
-				mb_get_time(verbose,time_i,&time_d);
-				tidetime[ntide] = time_d;
-				if (nget == 7)
-					tide_ok = MB_YES;
-				}
-
-			/* deal with tide in form: yr jday hour min sec tide */
-			else if (process.mbp_tide_format == 3)
-				{
-				nget = sscanf(buffer,"%d %d %d %d %lf %lf",
-					&time_j[0],&time_j[1],&ihr,
-					&time_j[2],&sec,
-					&tide[ntide]);
-				time_j[2] = time_j[2] + 60*ihr;
-				time_j[3] = (int) sec;
-				time_j[4] = 1000000*(sec - time_j[3]);
-				mb_get_itime(verbose,time_j,time_i);
-				mb_get_time(verbose,time_i,&time_d);
-				tidetime[ntide] = time_d;
-				if (nget == 6)
-					tide_ok = MB_YES;
-				}
-
-			/* deal with tide in form: yr jday daymin sec tide */
-			else if (process.mbp_tide_format == 4)
-				{
-				nget = sscanf(buffer,"%d %d %d %lf %lf",
-					&time_j[0],&time_j[1],&time_j[2],
-					&sec,
-					&tide[ntide]);
-				time_j[3] = (int) sec;
-				time_j[4] = 1000000*(sec - time_j[3]);
-				mb_get_itime(verbose,time_j,time_i);
-				mb_get_time(verbose,time_i,&time_d);
-				tidetime[ntide] = time_d;
-				if (nget == 5)
-					tide_ok = MB_YES;
-				}
-			}
-
-		/* output some debug values */
-		if (verbose >= 5 && tide_ok == MB_YES)
-			{
-			fprintf(stderr,"\ndbg5  New tide point read in program <%s>\n",program_name);
-			fprintf(stderr,"dbg5       tide[%d]: %f %f\n",
-				ntide,tidetime[ntide],tide[ntide]);
-			}
-		else if (verbose >= 5)
-			{
-			fprintf(stderr,"\ndbg5  Error parsing line in tide file in program <%s>\n",program_name);
-			fprintf(stderr,"dbg5       line: %s\n",buffer);
-			}
-
-		/* check for reverses or repeats in time */
-		if (tide_ok == MB_YES)
-			{
-			if (ntide == 0)
-				ntide++;
-			else if (tidetime[ntide] > tidetime[ntide-1])
-				ntide++;
-			else if (ntide > 0 && tidetime[ntide] <= tidetime[ntide-1]
-				&& verbose >= 5)
-				{
-				fprintf(stderr,"\ndbg5  Tide time error in program <%s>\n",program_name);
-				fprintf(stderr,"dbg5       tide[%d]: %f %f\n",
-					ntide-1,tidetime[ntide-1],tide[ntide-1]);
-				fprintf(stderr,"dbg5       tide[%d]: %f %f\n",
-					ntide,tidetime[ntide],tide[ntide]);
-				}
-			}
-		strncpy(buffer,"\0",sizeof(buffer));
-		}
-	    fclose(tfp);
-
-
-	    /* check for tide */
-	    if (ntide < 1)
-		    {
-		    fprintf(stderr,"\nNo tide read from file <%s>\n",process.mbp_tidefile);
-		    fprintf(stderr,"\nProgram <%s> Terminated\n",
-			    program_name);
-		    exit(error);
-		    }
-
-	    /* get start and finish times of tide */
-	    mb_get_date(verbose,tidetime[0],stime_i);
-	    mb_get_date(verbose,tidetime[ntide-1],ftime_i);
-
-	    /* give the statistics */
-	    if (verbose >= 1)
-		    {
-		    fprintf(stderr,"\n%d tide records read\n",ntide);
-		    fprintf(stderr,"Tide start time: %4.4d %2.2d %2.2d %2.2d:%2.2d:%2.2d.%6.6d\n",
-			    stime_i[0],stime_i[1],stime_i[2],stime_i[3],
-			    stime_i[4],stime_i[5],stime_i[6]);
-		    fprintf(stderr,"Tide end time:   %4.4d %2.2d %2.2d %2.2d:%2.2d:%2.2d.%6.6d\n",
-			    ftime_i[0],ftime_i[1],ftime_i[2],ftime_i[3],
-			    ftime_i[4],ftime_i[5],ftime_i[6]);
-		    }
-	    }
-
-	/*--------------------------------------------
-	  get edits
-	  --------------------------------------------*/
-
-	/* get edits */
-	if (process.mbp_edit_mode == MBP_EDIT_ON)
-	    {
-	    status = mb_esf_open(verbose, process.mbp_editfile,
-			    MB_YES, MB_NO, &esf, &error);
-	    if (status == MB_FAILURE)
-		{
-		fprintf(stderr,"\nUnable to resd from Edit Save File <%s>\n",process.mbp_editfile);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-
-
-	    /* give the statistics */
-	    if (verbose >= 1)
-		    {
-		    fprintf(stderr,"\n%d bathymetry edits read\n",esf.nedit);
-		    }
-	    }
-
-	/*--------------------------------------------
-	  get beam static corrections
-	  --------------------------------------------*/
-
-	/* if static correction to be done get statics */
-	/* Static file is beam number vs correction */
-	if (process.mbp_static_mode == MBP_STATIC_BEAM_ON)
-	    {
-	    /* set max number of characters to be read at a time */
-	    nchar = 128;
-
-	    /* count the data points in the static file */
-	    nstatic = 0;
-	    if ((tfp = fopen(process.mbp_staticfile, "r")) == NULL)
-		    {
-		    error = MB_ERROR_OPEN_FAIL;
-		    fprintf(stderr,"\nUnable to Open Static File <%s> for reading\n",process.mbp_staticfile);
-		    fprintf(stderr,"\nProgram <%s> Terminated\n",
-			    program_name);
-		    exit(error);
-		    }
-	    while ((result = fgets(buffer,nchar,tfp)) == buffer)
-		    nstatic++;
-	    fclose(tfp);
-
-	    /* allocate arrays for static */
-	    if (nstatic > 0)
-		{
-		size = (nstatic+1)*sizeof(double);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,nstatic*sizeof(int),(void **)&staticbeam,&error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,nstatic*sizeof(double),(void **)&staticoffset,&error);
-
-		/* if error initializing memory then quit */
-		if (error != MB_ERROR_NO_ERROR)
-		    {
-		    mb_error(verbose,error,&message);
-		    fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",message);
-		    fprintf(stderr,"\nProgram <%s> Terminated\n",
-			    program_name);
-		    exit(error);
-		    }
-		}
-
-	    /* if no static data then quit */
-	    else
-		{
-		error = MB_ERROR_BAD_DATA;
-		fprintf(stderr,"\nUnable to read data from static file <%s>\n",process.mbp_staticfile);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-
-	    /* read the data points in the static file */
-	    nstatic = 0;
-	    if ((tfp = fopen(process.mbp_staticfile, "r")) == NULL)
-		{
-		error = MB_ERROR_OPEN_FAIL;
-		fprintf(stderr,"\nUnable to Open Static File <%s> for reading\n",process.mbp_staticfile);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-	    while ((result = fgets(buffer,nchar,tfp)) == buffer)
-		{
-		static_ok = MB_NO;
-
-		/* deal with static in form: beam_# offset */
-		if (buffer[0] != '#')
-			{
-			nget = sscanf(buffer,"%d %lf", &staticbeam[nstatic],&staticoffset[nstatic]);
-			if (nget == 2)
-				{
-				static_ok = MB_YES;
-				nstatic++;
-				}
-
-			/* output some debug values */
-			if (verbose >= 5 && static_ok == MB_YES)
-				{
-				fprintf(stderr,"\ndbg5  New static beam correction read in program <%s>\n",program_name);
-				fprintf(stderr,"dbg5       beam:%d offset:%f\n",
-					staticbeam[nstatic],staticoffset[nstatic]);
-				}
-			else if (verbose >= 5)
-				{
-				fprintf(stderr,"\ndbg5  Error parsing line in static beam correction file in program <%s>\n",program_name);
-				fprintf(stderr,"dbg5       line: %s\n",buffer);
-				}
-			}
-		}
-	    fclose(tfp);
-
-
-	    /* check for good static data */
-	    if (nstatic < 1)
-		    {
-		    fprintf(stderr,"\nNo static beam corrections read from file <%s>\n",process.mbp_staticfile);
-		    fprintf(stderr,"\nProgram <%s> Terminated\n",
-			    program_name);
-		    exit(error);
-		    }
-
-	    /* give the statistics */
-	    if (verbose >= 1)
-		    {
-		    fprintf(stderr,"\n%d static beam corrections read\n",nstatic);
-		    }
-	    }
-	    
-	/* if static correction to be done get statics */
-	/* Static file is grazing angle vs correction */
-	if (process.mbp_static_mode == MBP_STATIC_ANGLE_ON)
-	    {
-	    /* set max number of characters to be read at a time */
-	    nchar = 128;
-
-	    /* count the data points in the static file */
-	    nstatic = 0;
-	    if ((tfp = fopen(process.mbp_staticfile, "r")) == NULL)
-		    {
-		    error = MB_ERROR_OPEN_FAIL;
-		    fprintf(stderr,"\nUnable to Open Static File <%s> for reading\n",process.mbp_staticfile);
-		    fprintf(stderr,"\nProgram <%s> Terminated\n",
-			    program_name);
-		    exit(error);
-		    }
-	    while ((result = fgets(buffer,nchar,tfp)) == buffer)
-		    nstatic++;
-	    fclose(tfp);
-
-	    /* allocate arrays for static */
-	    if (nstatic > 0)
-		{
-		size = (nstatic+1)*sizeof(double);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,nstatic*sizeof(double),(void **)&staticoffset,&error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,nstatic*sizeof(double),(void **)&staticangle,&error); 
-
-		/* if error initializing memory then quit */
-		if (error != MB_ERROR_NO_ERROR)
-		    {
-		    mb_error(verbose,error,&message);
-		    fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",message);
-		    fprintf(stderr,"\nProgram <%s> Terminated\n",
-			    program_name);
-		    exit(error);
-		    }
-		}
-
-	    /* if no static data then quit */
-	    else
-		{
-		error = MB_ERROR_BAD_DATA;
-		fprintf(stderr,"\nUnable to read data from static file <%s>\n",process.mbp_staticfile);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-
-	    /* read the data points in the static file */
-	    nstatic = 0;
-	    if ((tfp = fopen(process.mbp_staticfile, "r")) == NULL)
-		{
-		error = MB_ERROR_OPEN_FAIL;
-		fprintf(stderr,"\nUnable to Open Static File <%s> for reading\n",process.mbp_staticfile);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-	    while ((result = fgets(buffer,nchar,tfp)) == buffer)
-		{
-		static_ok = MB_NO;
-
-		/* deal with static in form: angle offset */
-		if (buffer[0] != '#')
-			{
-			nget = sscanf(buffer,"%lf %lf", &staticangle[nstatic],&staticoffset[nstatic]); 
-			if (nget == 2)
-				{
-				static_ok = MB_YES;
-				nstatic++;
-				}
-
-			/* output some debug values */
-			if (verbose >= 5 && static_ok == MB_YES)
-				{
-				fprintf(stderr,"\ndbg5  New static angle correction read in program <%s>\n",program_name);
-				fprintf(stderr,"dbg5       angle:%f offset:%f\n",
-					staticangle[nstatic],staticoffset[nstatic]);
-				}
-			else if (verbose >= 5)
-				{
-				fprintf(stderr,"\ndbg5  Error parsing line in static angle correction file in program <%s>\n",program_name);
-				fprintf(stderr,"dbg5       line: %s\n",buffer);
-				}
-			}
-		}
-	    fclose(tfp);
-
-
-	    /* check for good static data */
-	    if (nstatic < 1)
-		    {
-		    fprintf(stderr,"\nNo static angle corrections read from file <%s>\n",process.mbp_staticfile);
-		    fprintf(stderr,"\nProgram <%s> Terminated\n",
-			    program_name);
-		    exit(error);
-		    }
-
-	    /* give the statistics */
-	    if (verbose >= 1)
-		    {
-		    fprintf(stderr,"\n%d static angle corrections read\n",nstatic);
-		    }
-	    }
-	 
-
-	/*--------------------------------------------
-	  get amplitude corrections
-	  --------------------------------------------*/
-	if (process.mbp_ampcorr_mode == MBP_AMPCORR_ON)
-	    {
-	    /* count the data points in the amplitude correction file */
-	    nampcorrtable = 0;
-	    nampcorrangle = 0;
-	    if ((tfp = fopen(process.mbp_ampcorrfile, "r")) == NULL)
-		    {
-		    error = MB_ERROR_OPEN_FAIL;
-		    fprintf(stderr,"\nUnable to Open Amplitude Correction File <%s> for reading\n",process.mbp_ampcorrfile);
-		    fprintf(stderr,"\nProgram <%s> Terminated\n",
-			    program_name);
-		    exit(error);
-		    }
-	    while ((result = fgets(buffer,MBP_FILENAMESIZE,tfp)) == buffer)
-	    	{
-		if (strncmp(buffer,"# table:",8) == 0)
-		    nampcorrtable++;
-		else if (strncmp(buffer,"# nangles:",10) == 0)
-		    sscanf(buffer,"# nangles:%d",&nampcorrangle);
-		}
-	    fclose(tfp);
-
-	    /* allocate arrays for amplitude correction tables */
-	    if (nampcorrtable > 0)
-		{
-		size = nampcorrtable*sizeof(struct mbprocess_sscorr_struct);
-		ampcorrtable = NULL;
-		status = mb_mallocd(verbose,__FILE__,__LINE__,size,(void **)&ampcorrtable,&error);
-		for (i=0;i<nampcorrtable;i++)
-			{
-			ampcorrtable[i].angle = NULL;
-			ampcorrtable[i].amplitude = NULL;
-			ampcorrtable[i].sigma = NULL;
-			status = mb_mallocd(verbose,__FILE__,__LINE__,nampcorrangle*sizeof(double),(void **)&(ampcorrtable[i].angle),&error);
-			status = mb_mallocd(verbose,__FILE__,__LINE__,nampcorrangle*sizeof(double),(void **)&(ampcorrtable[i].amplitude),&error);
-			status = mb_mallocd(verbose,__FILE__,__LINE__,nampcorrangle*sizeof(double),(void **)&(ampcorrtable[i].sigma),&error);
-			}
-		ampcorrtableuse.angle = NULL;
-		ampcorrtableuse.amplitude = NULL;
-		ampcorrtableuse.sigma = NULL;
-		status = mb_mallocd(verbose,__FILE__,__LINE__,nampcorrangle*sizeof(double),(void **)&(ampcorrtableuse.angle),&error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,nampcorrangle*sizeof(double),(void **)&(ampcorrtableuse.amplitude),&error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,nampcorrangle*sizeof(double),(void **)&(ampcorrtableuse.sigma),&error);
-
-		/* if error initializing memory then quit */
-		if (error != MB_ERROR_NO_ERROR)
-		    {
-		    mb_error(verbose,error,&message);
-		    fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",message);
-		    fprintf(stderr,"\nProgram <%s> Terminated\n",
-			    program_name);
-		    exit(error);
-		    }
-		}
-
-	    /* if no amplitude correction file then quit */
-	    else
-		{
-		error = MB_ERROR_BAD_DATA;
-		fprintf(stderr,"\nUnable to read data from amplitude correction file <%s>\n",process.mbp_ampcorrfile);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-
-	    /* read the data points in the amplitude correction file */
-	    nampcorrtable = 0;
-	    if ((tfp = fopen(process.mbp_ampcorrfile, "r")) == NULL)
-		{
-		error = MB_ERROR_OPEN_FAIL;
-		fprintf(stderr,"\nUnable to Open Amplitude Correction File <%s> for reading\n",process.mbp_ampcorrfile);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-	    while ((result = fgets(buffer,MBP_FILENAMESIZE,tfp)) == buffer)
-		{
-		/* deal with amplitude correction tables */
-		if (strncmp(buffer, "# table:",8) == 0)
-			{
-			nget = sscanf(buffer, "# table:%d", &itable);
-	    		nampcorrtable++;
-			ampcorrtable[itable].nangle = 0;
-			}
-		else if (strncmp(buffer, "# time:",7) == 0)
-			nget = sscanf(buffer, "# time: %d/%d/%d %d:%d:%d.%d %lf",
-				&time_i[0], &time_i[1], &time_i[2],
-				&time_i[3], &time_i[4], &time_i[5],
-				&time_i[6], &(ampcorrtable[itable].time_d));
-		else if (buffer[0] != '#')
-			{
-			nget = sscanf(buffer, "%lf %lf %lf",
-				&(ampcorrtable[itable].angle[ampcorrtable[itable].nangle]),
-				&(ampcorrtable[itable].amplitude[ampcorrtable[itable].nangle]),
-				&(ampcorrtable[itable].sigma[ampcorrtable[itable].nangle]));
-			(ampcorrtable[itable].nangle)++;
-			if (nget != 3)
-				{
-				fprintf(stderr,"\ndbg5  Error parsing line in sidescan correction file in program <%s>\n",program_name);
-				fprintf(stderr,"dbg5       line: %s\n",buffer);
-				}
-			}
-		}
-	    fclose(tfp);
-
-	    /* force amplitude correction tables to be symmetric if desired */
-	    if (process.mbp_ampcorr_symmetry == MBP_AMPCORR_SYMMETRIC)
-		    {
-		    for (itable=0;itable<nampcorrtable;itable++)
-			    {
-			    for (i=0;i<ampcorrtable[itable].nangle/2;i++)
-				    {
-				    j = ampcorrtable[itable].nangle - 1 - i;
-				    if (ampcorrtable[itable].amplitude[i] != 0.0
-				    	&& ampcorrtable[itable].amplitude[j] != 0.0)
-					factor = 0.5;
-				    else
-				    	factor = 1.0;
-				    ampcorrtable[itable].amplitude[i]
-					    = factor * (ampcorrtable[itable].amplitude[i]
-						    + ampcorrtable[itable].amplitude[j]);
-				    ampcorrtable[itable].sigma[i]
-					    = MAX(ampcorrtable[itable].sigma[i],
-						    ampcorrtable[itable].sigma[j]);
-				    ampcorrtable[itable].amplitude[j]
-					    = ampcorrtable[itable].amplitude[i];
-				    ampcorrtable[itable].sigma[j]
-					    = ampcorrtable[itable].sigma[i];
-				    }
-			    }
-		    }
-
-	    /* check for good amplitude correction data */
-	    if (nampcorrtable < 1)
-		    {
-		    fprintf(stderr,"\nNo amplitude correction tables read from file <%s>\n",process.mbp_ampcorrfile);
-		    fprintf(stderr,"\nProgram <%s> Terminated\n",
-			    program_name);
-		    exit(error);
-		    }
-
-	    /* give the statistics */
-	    if (verbose >= 1)
-		    {
-		    fprintf(stderr,"\n%d amplitude correction tables with %d angles read\n",
-		    		nampcorrtable, nampcorrangle);
-		    }
-	    }
-
-	/*--------------------------------------------
-	  get sidescan corrections
-	  --------------------------------------------*/
-	if (process.mbp_sscorr_mode == MBP_SSCORR_ON)
-	    {
-	    /* count the data points in the sidescan correction file */
-	    nsscorrtable = 0;
-	    nsscorrangle = 0;
-	    if ((tfp = fopen(process.mbp_sscorrfile, "r")) == NULL)
-		    {
-		    error = MB_ERROR_OPEN_FAIL;
-		    fprintf(stderr,"\nUnable to Open Sidescan Correction File <%s> for reading\n",process.mbp_sscorrfile);
-		    fprintf(stderr,"\nProgram <%s> Terminated\n",
-			    program_name);
-		    exit(error);
-		    }
-	    while ((result = fgets(buffer,MBP_FILENAMESIZE,tfp)) == buffer)
-	    	{
-		if (strncmp(buffer,"# table:",8) == 0)
-		    nsscorrtable++;
-		else if (strncmp(buffer,"# nangles:",10) == 0)
-		    sscanf(buffer,"# nangles:%d",&nsscorrangle);
-		}
-	    fclose(tfp);
-
-	    /* allocate arrays for sidescan correction tables */
-	    if (nsscorrtable > 0)
-		{
-		size = nsscorrtable*sizeof(struct mbprocess_sscorr_struct);
-		sscorrtable = NULL;
-		status = mb_mallocd(verbose,__FILE__,__LINE__,size,(void **)&sscorrtable,&error);
-		for (i=0;i<nsscorrtable;i++)
-			{
-			sscorrtable[i].angle = NULL;
-			sscorrtable[i].amplitude = NULL;
-			sscorrtable[i].sigma = NULL;
-			status = mb_mallocd(verbose,__FILE__,__LINE__,nsscorrangle*sizeof(double),(void **)&(sscorrtable[i].angle),&error);
-			status = mb_mallocd(verbose,__FILE__,__LINE__,nsscorrangle*sizeof(double),(void **)&(sscorrtable[i].amplitude),&error);
-			status = mb_mallocd(verbose,__FILE__,__LINE__,nsscorrangle*sizeof(double),(void **)&(sscorrtable[i].sigma),&error);
-			}
-		sscorrtableuse.angle = NULL;
-		sscorrtableuse.amplitude = NULL;
-		sscorrtableuse.sigma = NULL;
-		status = mb_mallocd(verbose,__FILE__,__LINE__,nsscorrangle*sizeof(double),(void **)&(sscorrtableuse.angle),&error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,nsscorrangle*sizeof(double),(void **)&(sscorrtableuse.amplitude),&error);
-		status = mb_mallocd(verbose,__FILE__,__LINE__,nsscorrangle*sizeof(double),(void **)&(sscorrtableuse.sigma),&error);
-
-		/* if error initializing memory then quit */
-		if (error != MB_ERROR_NO_ERROR)
-		    {
-		    mb_error(verbose,error,&message);
-		    fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",message);
-		    fprintf(stderr,"\nProgram <%s> Terminated\n",
-			    program_name);
-		    exit(error);
-		    }
-		}
-
-	    /* if no sidescan correction file then quit */
-	    else
-		{
-		error = MB_ERROR_BAD_DATA;
-		fprintf(stderr,"\nUnable to read data from sidescan correction file <%s>\n",process.mbp_sscorrfile);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-
-	    /* read the data points in the sidescan correction file */
-	    nsscorrtable = 0;
-	    if ((tfp = fopen(process.mbp_sscorrfile, "r")) == NULL)
-		{
-		error = MB_ERROR_OPEN_FAIL;
-		fprintf(stderr,"\nUnable to Open Sidescan Correction File <%s> for reading\n",process.mbp_sscorrfile);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-	    while ((result = fgets(buffer,MBP_FILENAMESIZE,tfp)) == buffer)
-		{
-		/* deal with sidescan correction tables */
-		if (strncmp(buffer, "# table:",8) == 0)
-			{
-			nget = sscanf(buffer, "# table:%d", &itable);
-	    		nsscorrtable++;
-			sscorrtable[itable].nangle = 0;
-			}
-		else if (strncmp(buffer, "# time:",7) == 0)
-			nget = sscanf(buffer, "# time: %d/%d/%d %d:%d:%d.%d %lf",
-				&time_i[0], &time_i[1], &time_i[2],
-				&time_i[3], &time_i[4], &time_i[5],
-				&time_i[6], &(sscorrtable[itable].time_d));
-		else if (buffer[0] != '#')
-			{
-			nget = sscanf(buffer, "%lf %lf %lf",
-				&(sscorrtable[itable].angle[sscorrtable[itable].nangle]),
-				&(sscorrtable[itable].amplitude[sscorrtable[itable].nangle]),
-				&(sscorrtable[itable].sigma[sscorrtable[itable].nangle]));
-			(sscorrtable[itable].nangle)++;
-			if (nget != 3)
-				{
-				fprintf(stderr,"\ndbg5  Error parsing line in sidescan correction file in program <%s>\n",program_name);
-				fprintf(stderr,"dbg5       line: %s\n",buffer);
-				}
-			}
-		}
-	    fclose(tfp);
-
-	    /* force sidescan correction tables to be symmetric if desired */
-	    if (process.mbp_sscorr_symmetry == MBP_SSCORR_SYMMETRIC)
-		    {
-		    for (itable=0;itable<nsscorrtable;itable++)
-			    {
-			    for (i=0;i<sscorrtable[itable].nangle/2;i++)
-				    {
-				    j = sscorrtable[itable].nangle - 1 - i;
-				    if (sscorrtable[itable].amplitude[i] != 0.0
-				    	&& sscorrtable[itable].amplitude[j] != 0.0)
-					factor = 0.5;
-				    else
-				    	factor = 1.0;
-				    sscorrtable[itable].amplitude[i]
-					    = factor * (sscorrtable[itable].amplitude[i]
-						    + sscorrtable[itable].amplitude[j]);
-				    sscorrtable[itable].amplitude[j]
-					    = sscorrtable[itable].amplitude[i];
-				    sscorrtable[itable].sigma[i]
-					    = MAX(sscorrtable[itable].sigma[i],
-						    sscorrtable[itable].sigma[j]);
-				    sscorrtable[itable].sigma[j]
-					    = sscorrtable[itable].sigma[i];
-				    }
-			    }
-		    }
-
-	    /* check for good sidescan correction data */
-	    if (nsscorrtable < 1)
-		    {
-		    fprintf(stderr,"\nNo sidescan correction tables read from file <%s>\n",process.mbp_sscorrfile);
-		    fprintf(stderr,"\nProgram <%s> Terminated\n",
-			    program_name);
-		    exit(error);
-		    }
-
-	    /* give the statistics */
-	    if (verbose >= 1)
-		    {
-		    fprintf(stderr,"\n%d sidescan correction tables with %d angles read\n",
-		    		nsscorrtable, nsscorrangle);
-		    }
-	    }
-
-	/*--------------------------------------------
-	  get topography grid
-	  --------------------------------------------*/
-	if ((process.mbp_ampcorr_mode == MBP_AMPCORR_ON
-			&& (process.mbp_ampcorr_slope == MBP_AMPCORR_USETOPO
-				|| process.mbp_ampcorr_slope == MBP_AMPCORR_USETOPOSLOPE))
-		|| (process.mbp_sscorr_mode == MBP_SSCORR_ON
-			&& (process.mbp_sscorr_slope == MBP_SSCORR_USETOPO
-				|| process.mbp_sscorr_slope == MBP_SSCORR_USETOPOSLOPE)))
-		{
-		grid.data = NULL;
-		strcpy(grid.file, process.mbp_ampsscorr_topofile);
-		status = mb_read_gmt_grd(verbose, grid.file, &grid.projection_mode, grid.projection_id, &grid.nodatavalue,
-					&grid.nxy, &grid.nx, &grid.ny, &grid.min, &grid.max,
-					&grid.xmin, &grid.xmax, &grid.ymin, &grid.ymax,
-					&grid.dx, &grid.dy, &grid.data, NULL, NULL, &error);
-		if (status == MB_FAILURE)
-			{
-			error = MB_ERROR_OPEN_FAIL;
-			fprintf(stderr,"\nUnable to read topography grid file: %s\n",
-			    grid.file);
-			fprintf(stderr,"\nProgram <%s> Terminated\n",
-			    program_name);
-			exit(error);
-			}
-
-		/* rationalize grid bounds and lonflip */
-		if (lonflip == -1)
-			{
-			if (grid.xmax > 180.0)
-				{
-				grid.xmin -= 360.0;
-				grid.xmax -= 360.0;
-				}
-			}
-		else if (lonflip == 0)
-			{
-			if (grid.xmin > 180.0)
-				{
-				grid.xmin -= 360.0;
-				grid.xmax -= 360.0;
-				}
-			else if (grid.xmax < -180.0)
-				{
-				grid.xmin += 360.0;
-				grid.xmax += 360.0;
-				}
-			}
-		else if (lonflip == 1)
-			{
-			if (grid.xmin < -180.0)
-				{
-				grid.xmin += 360.0;
-				grid.xmax += 360.0;
-				}
-			}
-		if (grid.xmax > 180.0)
-			{
-			lonflip = 1;
-			}
-		else if (grid.xmin < -180.0)
-			{
-			lonflip = -1;
-			}
-		else
-			{
-			lonflip = 0;
-			}
-		}
-
-
-	/*--------------------------------------------
-	  now open the swath files
-	  --------------------------------------------*/
-
-	/* initialize reading the input swath sonar file */
-	if ((status = mb_read_init(
-		verbose,process.mbp_ifile,process.mbp_format,pings,lonflip,bounds,
-		btime_i,etime_i,speedmin,timegap,
-		&imbio_ptr,&btime_d,&etime_d,
-		&beams_bath,&beams_amp,&pixels_ss,&error)) != MB_SUCCESS)
-		{
-		mb_error(verbose,error,&message);
-		fprintf(stderr,"\nMBIO Error returned from function <mb_read_init>:\n%s\n",message);
-		fprintf(stderr,"\nMultibeam File <%s> not initialized for reading\n",process.mbp_ifile);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-
-	/* initialize writing the output swath sonar file */
-	if ((status = mb_write_init(
-		verbose,process.mbp_ofile,process.mbp_format,&ombio_ptr,
-		&beams_bath,&beams_amp,&pixels_ss,&error)) != MB_SUCCESS)
-		{
-		mb_error(verbose,error,&message);
-		fprintf(stderr,"\nMBIO Error returned from function <mb_write_init>:\n%s\n",message);
-		fprintf(stderr,"\nMultibeam File <%s> not initialized for writing\n",process.mbp_ofile);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-
-	/* allocate memory for data arrays */
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(char), (void **)&beamflag, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(double), (void **)&bath, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_AMPLITUDE,
-						sizeof(double), (void **)&amp, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(double), (void **)&bathacrosstrack, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(double), (void **)&bathalongtrack, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_SIDESCAN,
-						sizeof(double), (void **)&ss, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_SIDESCAN,
-						sizeof(double), (void **)&ssacrosstrack, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_SIDESCAN,
-						sizeof(double), (void **)&ssalongtrack, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(double), (void **)&ttimes, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(double), (void **)&angles, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(double), (void **)&angles_forward, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(double), (void **)&angles_null, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(double), (void **)&bheave, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(double), (void **)&alongtrack_offset, &error);
-
-	/* if error initializing memory then quit */
-	if (error != MB_ERROR_NO_ERROR)
-		{
-		mb_error(verbose,error,&message);
-		fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",message);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-
-        /* get data kind sources for input format */
-        mb_format_source(verbose, &(process.mbp_format),
-		&nav_source, &heading_source,
-		&vru_source, &svp_source,
-		&error);
-
-	/*--------------------------------------------
-	  read the input file to get first ssv if necessary
-	  --------------------------------------------*/
-	/* read input file until a surface sound velocity value
-		is obtained, then close and reopen the file
-		this provides the starting surface sound velocity
-		for recalculating the bathymetry */
-	if (process.mbp_bathrecalc_mode == MBP_BATHRECALC_RAYTRACE
-		&& traveltime == MB_YES
-		&& process.mbp_ssv_mode != MBP_SSV_SET)
-	    {
-	    ssv_start = 0.0;
-	    ssv_prelimpass = MB_YES;
-	    error = MB_ERROR_NO_ERROR;
-	    while (error <= MB_ERROR_NO_ERROR
-		&& ssv_start <= 0.0)
-		{
-		/* read some data */
-		error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-		status = mb_get_all(verbose,imbio_ptr,&store_ptr,&kind,
-				time_i,&time_d,&navlon,&navlat,
-				&speed,&heading,
-				&distance,&altitude,&sonardepth,
-				&nbath,&namp,&nss,
-				beamflag,bath,amp,bathacrosstrack,bathalongtrack,
-				ss,ssacrosstrack,ssalongtrack,
-				comment,&error);
-
-		/* time gaps do not matter to mbprocess */
-		if (error == MB_ERROR_TIME_GAP)
-			{
-			status = MB_SUCCESS;
-			error = MB_ERROR_NO_ERROR;
-			}
-
-		/* out of bounds do not matter to mbprocess */
-		if (error == MB_ERROR_OUT_BOUNDS)
-			{
-			status = MB_SUCCESS;
-			error = MB_ERROR_NO_ERROR;
-			}
-
-		/* non-survey data do not matter to mbprocess */
-		if (error == MB_ERROR_OTHER)
-			{
-			status = MB_SUCCESS;
-			error = MB_ERROR_NO_ERROR;
-			}
-
-		if (kind == MB_DATA_DATA
-			&& error <= MB_ERROR_NO_ERROR)
-			{
-			/* extract travel times */
-			status = mb_ttimes(verbose,imbio_ptr,
-				store_ptr,&kind,&nbeams,
-				ttimes,angles,
-				angles_forward,angles_null,
-				bheave,alongtrack_offset,
-				&draft,&ssv,&error);
-
-			/* check surface sound velocity */
-			if (ssv > 0.0)
-				ssv_start = ssv;
-			}
-		}
-
-	    /* close and reopen the input file */
-	    status = mb_close(verbose,&imbio_ptr,&error);
-	    if ((status = mb_read_init(
-		verbose,process.mbp_ifile,process.mbp_format,pings,lonflip,bounds,
-		btime_i,etime_i,speedmin,timegap,
-		&imbio_ptr,&btime_d,&etime_d,
-		&beams_bath,&beams_amp,&pixels_ss,&error)) != MB_SUCCESS)
-		{
-		mb_error(verbose,error,&message);
-		fprintf(stderr,"\nMBIO Error returned from function <mb_read_init>:\n%s\n",message);
-		fprintf(stderr,"\nMultibeam File <%s> not initialized for reading\n",process.mbp_ifile);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-
-	    /* reallocate memory for data arrays */
-	    if (error == MB_ERROR_NO_ERROR)
-		    status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						    sizeof(char), (void **)&beamflag, &error);
-	    if (error == MB_ERROR_NO_ERROR)
-		    status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						    sizeof(double), (void **)&bath, &error);
-	    if (error == MB_ERROR_NO_ERROR)
-		    status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_AMPLITUDE,
-						    sizeof(double), (void **)&amp, &error);
-	    if (error == MB_ERROR_NO_ERROR)
-		    status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						    sizeof(double), (void **)&bathacrosstrack, &error);
-	    if (error == MB_ERROR_NO_ERROR)
-		    status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						    sizeof(double), (void **)&bathalongtrack, &error);
-	    if (error == MB_ERROR_NO_ERROR)
-		    status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_SIDESCAN,
-						    sizeof(double), (void **)&ss, &error);
-	    if (error == MB_ERROR_NO_ERROR)
-		    status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_SIDESCAN,
-						    sizeof(double), (void **)&ssacrosstrack, &error);
-	    if (error == MB_ERROR_NO_ERROR)
-		    status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_SIDESCAN,
-						    sizeof(double), (void **)&ssalongtrack, &error);
-	    if (error == MB_ERROR_NO_ERROR)
-		    status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						    sizeof(double), (void **)&ttimes, &error);
-	    if (error == MB_ERROR_NO_ERROR)
-		    status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						    sizeof(double), (void **)&angles, &error);
-	    if (error == MB_ERROR_NO_ERROR)
-		    status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						    sizeof(double), (void **)&angles_forward, &error);
-	    if (error == MB_ERROR_NO_ERROR)
-		    status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						    sizeof(double), (void **)&angles_null, &error);
-	    if (error == MB_ERROR_NO_ERROR)
-		    status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						    sizeof(double), (void **)&bheave, &error);
-	    if (error == MB_ERROR_NO_ERROR)
-		    status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						    sizeof(double), (void **)&alongtrack_offset, &error);
-
-	    /* if error initializing memory then quit */
-	    if (error != MB_ERROR_NO_ERROR)
-		    {
-		    mb_error(verbose,error,&message);
-		    fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",message);
-		    fprintf(stderr,"\nProgram <%s> Terminated\n",
-			    program_name);
-		    exit(error);
-		    }
-	    }
-	if (ssv_start <= 0.0)
-		ssv_start = ssv_default;
-
-	/* reset error */
-	error = MB_ERROR_NO_ERROR;
-	status = MB_SUCCESS;
-
-	/* allocate memory for amplitude and sidescan correction arrays */
-	/*  */
-	if (process.mbp_sscorr_mode == MBP_SSCORR_ON
-		|| process.mbp_ampcorr_mode == MBP_AMPCORR_ON
-		|| process.mbp_static_mode == MBP_STATIC_ANGLE_ON)
-		{
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							sizeof(double), (void **)&depths, &error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							sizeof(double), (void **)&depthsmooth, &error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							sizeof(double), (void **)&depthacrosstrack, &error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							2 * sizeof(double), (void **)&slopes, &error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							2 * sizeof(double), (void **)&slopeacrosstrack, &error);
-		}
-
-	/*--------------------------------------------
-	  output comments
-	  --------------------------------------------*/
-
-	/* write comments to beginning of output file */
-	if (strip_comments == MB_NO)
-		{
-		/* insert metadata */
-		if (strlen(process.mbp_meta_vessel) > 0)
-			{
-			sprintf(comment,"METAVESSEL:%s", process.mbp_meta_vessel);
-			status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-			if (error == MB_ERROR_NO_ERROR) ocomment++;
-			}
-		if (strlen(process.mbp_meta_institution) > 0)
-			{
-			sprintf(comment,"METAINSTITUTION:%s", process.mbp_meta_institution);
-			status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-			if (error == MB_ERROR_NO_ERROR) ocomment++;
-			}
-		if (strlen(process.mbp_meta_platform) > 0)
-			{
-			sprintf(comment,"METAPLATFORM:%s", process.mbp_meta_platform);
-			status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-			if (error == MB_ERROR_NO_ERROR) ocomment++;
-			}
-		if (strlen(process.mbp_meta_sonar) > 0)
-			{
-			sprintf(comment,"METASONAR:%s", process.mbp_meta_sonar);
-			status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-			if (error == MB_ERROR_NO_ERROR) ocomment++;
-			}
-		if (strlen(process.mbp_meta_sonarversion) > 0)
-			{
-			sprintf(comment,"METASONARVERSION:%s", process.mbp_meta_sonarversion);
-			status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-			if (error == MB_ERROR_NO_ERROR) ocomment++;
-			}
-		if (strlen(process.mbp_meta_cruiseid) > 0)
-			{
-			sprintf(comment,"METACRUISEID:%s", process.mbp_meta_cruiseid);
-			status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-			if (error == MB_ERROR_NO_ERROR) ocomment++;
-			}
-		if (strlen(process.mbp_meta_cruisename) > 0)
-			{
-			sprintf(comment,"METACRUISENAME:%s", process.mbp_meta_cruisename);
-			status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-			if (error == MB_ERROR_NO_ERROR) ocomment++;
-			}
-		if (strlen(process.mbp_meta_pi) > 0)
-			{
-			sprintf(comment,"METAPI:%s", process.mbp_meta_pi);
-			status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-			if (error == MB_ERROR_NO_ERROR) ocomment++;
-			}
-		if (strlen(process.mbp_meta_piinstitution) > 0)
-			{
-			sprintf(comment,"METAPIINSTITUTION:%s", process.mbp_meta_piinstitution);
-			status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-			if (error == MB_ERROR_NO_ERROR) ocomment++;
-			}
-		if (strlen(process.mbp_meta_client) > 0)
-			{
-			sprintf(comment,"METACLIENT:%s", process.mbp_meta_client);
-			status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-			if (error == MB_ERROR_NO_ERROR) ocomment++;
-			}
-		if (process.mbp_meta_svcorrected > -1)
-			{
-			sprintf(comment,"METASVCORRECTED:%d", process.mbp_meta_svcorrected);
-			status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-			if (error == MB_ERROR_NO_ERROR) ocomment++;
-			}
-		if (process.mbp_meta_tidecorrected > -1)
-			{
-			sprintf(comment,"METATIDECORRECTED:%d", process.mbp_meta_tidecorrected);
-			status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-			if (error == MB_ERROR_NO_ERROR) ocomment++;
-			}
-		if (process.mbp_meta_batheditmanual > -1)
-			{
-			sprintf(comment,"METABATHEDITMANUAL:%d", process.mbp_meta_batheditmanual);
-			status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-			if (error == MB_ERROR_NO_ERROR) ocomment++;
-			}
-		if (process.mbp_meta_batheditauto > -1)
-			{
-			sprintf(comment,"METABATHEDITAUTO:%d", process.mbp_meta_batheditauto);
-			status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-			if (error == MB_ERROR_NO_ERROR) ocomment++;
-			}
-		if (process.mbp_meta_rollbias < MBP_METANOVALUE)
-			{
-			sprintf(comment,"METAROLLBIAS:%f", process.mbp_meta_rollbias);
-			status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-			if (error == MB_ERROR_NO_ERROR) ocomment++;
-			}
-		if (process.mbp_meta_pitchbias < MBP_METANOVALUE)
-			{
-			sprintf(comment,"METAPITCHBIAS:%f", process.mbp_meta_pitchbias);
-			status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-			if (error == MB_ERROR_NO_ERROR) ocomment++;
-			}
-		if (process.mbp_meta_headingbias < MBP_METANOVALUE)
-			{
-			sprintf(comment,"METAHEADINGBIAS:%f", process.mbp_meta_headingbias);
-			status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-			if (error == MB_ERROR_NO_ERROR) ocomment++;
-			}
-		if (process.mbp_meta_draft < MBP_METANOVALUE)
-			{
-			sprintf(comment,"METADRAFT:%f", process.mbp_meta_draft);
-			status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-			if (error == MB_ERROR_NO_ERROR) ocomment++;
-			}
-
-		kind = MB_DATA_COMMENT;
-		strncpy(comment,"\0",MBP_FILENAMESIZE);
-		sprintf(comment,"Swath data modified by program %s",program_name);
-		status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-		if (error == MB_ERROR_NO_ERROR) ocomment++;
-		strncpy(comment,"\0",MBP_FILENAMESIZE);
-		sprintf(comment,"Version %s",rcs_id);
-		status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-		if (error == MB_ERROR_NO_ERROR) ocomment++;
-		strncpy(comment,"\0",MBP_FILENAMESIZE);
-		sprintf(comment,"MB-system Version %s",MB_VERSION);
-		status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-		if (error == MB_ERROR_NO_ERROR) ocomment++;
-		right_now = time((time_t *)0);
-		strcpy(date,ctime(&right_now));
-                date[strlen(date)-1] = '\0';
-		if ((user_ptr = getenv("USER")) == NULL)
-			user_ptr = getenv("LOGNAME");
-		if (user_ptr != NULL)
-			strcpy(user,user_ptr);
-		else
-			strcpy(user, "unknown");
-		gethostname(host,MBP_FILENAMESIZE);
-		strncpy(comment,"\0",MBP_FILENAMESIZE);
-		sprintf(comment,"Run by user <%s> on cpu <%s> at <%s>",
-			user,host,date);
-		status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-		if (error == MB_ERROR_NO_ERROR) ocomment++;
-
-		if (process.mbp_bathrecalc_mode == MBP_BATHRECALC_RAYTRACE)
-		    {
-		    strncpy(comment,"\0",MBP_FILENAMESIZE);
-		    sprintf(comment,"Depths and crosstrack distances recalculated from travel times");
-		    status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-		    if (error == MB_ERROR_NO_ERROR) ocomment++;
-		    strncpy(comment,"\0",MBP_FILENAMESIZE);
-		    sprintf(comment,"  by raytracing through a water velocity profile specified");
-		    status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-		    if (error == MB_ERROR_NO_ERROR) ocomment++;
-		    strncpy(comment,"\0",MBP_FILENAMESIZE);
-		    sprintf(comment,"  by the user.  The depths have been saved in units of");
-		    status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-		    if (error == MB_ERROR_NO_ERROR) ocomment++;
-		    strncpy(comment,"\0",MBP_FILENAMESIZE);
-		    if (process.mbp_corrected == MB_NO)
-			    sprintf(comment,"  uncorrected meters (the depth values are adjusted to be");
-		    else
-			    sprintf(comment,"  corrected meters (the depth values obtained by");
-		    status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-		    if (error == MB_ERROR_NO_ERROR) ocomment++;
-		    strncpy(comment,"\0",MBP_FILENAMESIZE);
-		    if (process.mbp_corrected == MB_NO)
-			    sprintf(comment,"  consistent with a vertical water velocity of 1500 m/s).");
-		    else
-			    sprintf(comment,"  raytracing are not adjusted further).");
-		    status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-		    if (error == MB_ERROR_NO_ERROR) ocomment++;
-		    }
-		else if (process.mbp_bathrecalc_mode == MBP_BATHRECALC_ROTATE)
-		    {
-		    strncpy(comment,"\0",MBP_FILENAMESIZE);
-		    sprintf(comment,"Depths and crosstrack distances adjusted for roll bias");
-		    status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-		    if (error == MB_ERROR_NO_ERROR) ocomment++;
-		    strncpy(comment,"\0",MBP_FILENAMESIZE);
-		    sprintf(comment,"  and pitch bias.");
-		    status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-		    if (error == MB_ERROR_NO_ERROR) ocomment++;
-		    }
-		else if (process.mbp_bathrecalc_mode == MBP_BATHRECALC_OFFSET)
-		    {
-		    strncpy(comment,"\0",MBP_FILENAMESIZE);
-		    sprintf(comment,"Depths and crosstrack distances adjusted for ");
-		    status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-		    if (error == MB_ERROR_NO_ERROR) ocomment++;
-		    strncpy(comment,"\0",MBP_FILENAMESIZE);
-		    sprintf(comment,"  change in transducer depth and/or heave.");
-		    status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-		    if (error == MB_ERROR_NO_ERROR) ocomment++;
-		    }
-		strncpy(comment,"\0",MBP_FILENAMESIZE);
-		sprintf(comment,"Control Parameters:");
-		status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-		if (error == MB_ERROR_NO_ERROR) ocomment++;
-		strncpy(comment,"\0",MBP_FILENAMESIZE);
-		sprintf(comment,"  MBIO data format:   %d",process.mbp_format);
-		status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-		if (error == MB_ERROR_NO_ERROR) ocomment++;
-		strncpy(comment,"\0",MBP_FILENAMESIZE);
-		sprintf(comment,"  Input file:         %s",process.mbp_ifile);
-		status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-		if (error == MB_ERROR_NO_ERROR) ocomment++;
-		strncpy(comment,"\0",MBP_FILENAMESIZE);
-		sprintf(comment,"  Output file:        %s",process.mbp_ofile);
-		status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-		if (error == MB_ERROR_NO_ERROR) ocomment++;
-
-		if (process.mbp_bathrecalc_mode == MBP_BATHRECALC_RAYTRACE)
-		    {
-		    if (process.mbp_angle_mode == MBP_ANGLES_OK)
-			{
-			strncpy(comment,"\0",MBP_FILENAMESIZE);
-			sprintf(comment,"  Angle mode:         angles not altered");
-			status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-			if (error == MB_ERROR_NO_ERROR) ocomment++;
-			}
-		    else if (process.mbp_angle_mode == MBP_ANGLES_SNELL)
-			{
-			strncpy(comment,"\0",MBP_FILENAMESIZE);
-			sprintf(comment,"  Angle mode:         angles corrected using Snell's Law");
-			status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-			if (error == MB_ERROR_NO_ERROR) ocomment++;
-			}
-		    else if (process.mbp_angle_mode == MBP_ANGLES_SNELLNULL)
-			{
-			strncpy(comment,"\0",MBP_FILENAMESIZE);
-			sprintf(comment,"  Angle mode:         angles corrected using Snell's Law and array geometry");
-			status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-			if (error == MB_ERROR_NO_ERROR) ocomment++;
-			}
-		    strncpy(comment,"\0",MBP_FILENAMESIZE);
-		    sprintf(comment,"  Default SSV:        %f",ssv_default);
-		    status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-		    if (error == MB_ERROR_NO_ERROR) ocomment++;
-		    if (ssv_prelimpass == MB_YES)
-			{
-			strncpy(comment,"\0",MBP_FILENAMESIZE);
-			sprintf(comment,"  SSV initial pass:   on");
-			status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-			if (error == MB_ERROR_NO_ERROR) ocomment++;
-			}
-		    else
-			{
-			strncpy(comment,"\0",MBP_FILENAMESIZE);
-			sprintf(comment,"  SSV initial pass:   off");
-			status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-			if (error == MB_ERROR_NO_ERROR) ocomment++;
-			}
-
-		    strncpy(comment,"\0",MBP_FILENAMESIZE);
-		    sprintf(comment,"  SVP file:               %s",process.mbp_svpfile);
-		    status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-		    if (error == MB_ERROR_NO_ERROR) ocomment++;
-		    strncpy(comment,"\0",MBP_FILENAMESIZE);
-		    sprintf(comment,"  Input water sound velocity profile:");
-		    status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-		    if (error == MB_ERROR_NO_ERROR) ocomment++;
-		    strncpy(comment,"\0",MBP_FILENAMESIZE);
-		    sprintf(comment,"    depth (m)   velocity (m/s)");
-		    status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-		    if (error == MB_ERROR_NO_ERROR) ocomment++;
-		    for (i=0;i<nsvp;i++)
-			{
-			strncpy(comment,"\0",MBP_FILENAMESIZE);
-			sprintf(comment,"     %10.2f     %10.2f",
-				depth[i],velocity[i]);
-			status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-			if (error == MB_ERROR_NO_ERROR) ocomment++;
-			}
-		    }
-		if (process.mbp_svp_mode != MBP_SVP_OFF)
-		    {
-		    if (process.mbp_corrected == MB_YES)
-			{
-			strncpy(comment,"\0",MBP_FILENAMESIZE);
-			sprintf(comment,"  Output bathymetry reference:   CORRECTED");
-			status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-			}
-		    else if (process.mbp_corrected == MB_NO)
-			{
-			strncpy(comment,"\0",MBP_FILENAMESIZE);
-			sprintf(comment,"  Output bathymetry reference:   UNCORRECTED");
-			status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-			}
-		    }
-		if (process.mbp_svp_mode == MBP_SVP_SOUNDSPEEDREF)
-		    {
-		    if (process.mbp_corrected == MB_YES)
-			{
-			strncpy(comment,"\0",MBP_FILENAMESIZE);
-			sprintf(comment,"  Depths modified from uncorrected to corrected.");
-			status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-			}
-		    else
-			{
-			strncpy(comment,"\0",MBP_FILENAMESIZE);
-			sprintf(comment,"  Depths modified from corrected to uncorrected.");
-			status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-			}
-		    }
-
-		if (process.mbp_rollbias_mode == MBP_ROLLBIAS_OFF)
-		    {
-		    strncpy(comment,"\0",MBP_FILENAMESIZE);
-		    sprintf(comment,"  Roll bias:       OFF");
-		    status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-		    if (error == MB_ERROR_NO_ERROR) ocomment++;
-		    }
-		else if (process.mbp_rollbias_mode == MBP_ROLLBIAS_SINGLE)
-		    {
-		    strncpy(comment,"\0",MBP_FILENAMESIZE);
-		    sprintf(comment,"  Roll bias:       %f degrees (starboard: -, port: +)",
-			    process.mbp_rollbias);
-		    status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-		    if (error == MB_ERROR_NO_ERROR) ocomment++;
-		    }
-		else if (process.mbp_rollbias_mode == MBP_ROLLBIAS_DOUBLE)
-		    {
-		    strncpy(comment,"\0",MBP_FILENAMESIZE);
-		    sprintf(comment,"  Port roll bias:  %f degrees (starboard: -, port: +)",
-			    process.mbp_rollbias_port);
-		    status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-		    if (error == MB_ERROR_NO_ERROR) ocomment++;
-		    strncpy(comment,"\0",MBP_FILENAMESIZE);
-		    sprintf(comment,"  Starboard roll bias:  %f degrees (starboard: -, port: +)",
-			    process.mbp_rollbias_stbd);
-		    status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-		    if (error == MB_ERROR_NO_ERROR) ocomment++;
-		    }
-		if (process.mbp_pitchbias_mode == MBP_PITCHBIAS_OFF)
-		    {
-		    strncpy(comment,"\0",MBP_FILENAMESIZE);
-		    sprintf(comment,"  Pitch bias:      OFF");
-		    status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-		    if (error == MB_ERROR_NO_ERROR) ocomment++;
-		    }
-		else if (process.mbp_pitchbias_mode == MBP_PITCHBIAS_ON)
-		    {
-		    strncpy(comment,"\0",MBP_FILENAMESIZE);
-		    sprintf(comment,"  Pitch bias:      %f degrees (aft: -, forward: +)",
-			    process.mbp_pitchbias);
-		    status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-		    if (error == MB_ERROR_NO_ERROR) ocomment++;
-		    }
-
-		if (process.mbp_draft_mode == MBP_DRAFT_SET)
-			{
-			strncpy(comment,"\0",MBP_FILENAMESIZE);
-			sprintf(comment,"  Draft set:      %f meters",
-				process.mbp_draft);
-			status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-			if (error == MB_ERROR_NO_ERROR) ocomment++;
-			}
-		else if (process.mbp_draft_mode == MBP_DRAFT_OFFSET)
-			{
-			strncpy(comment,"\0",MBP_FILENAMESIZE);
-			sprintf(comment,"  Draft offset:    %f meters",
-				process.mbp_draft_offset);
-			status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-			if (error == MB_ERROR_NO_ERROR) ocomment++;
-			}
-		else if (process.mbp_draft_mode == MBP_DRAFT_MULTIPLY)
-			{
-			strncpy(comment,"\0",MBP_FILENAMESIZE);
-			sprintf(comment,"  Draft multiplier: %f",
-				process.mbp_draft_mult);
-			status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-			if (error == MB_ERROR_NO_ERROR) ocomment++;
-			}
-		else if (process.mbp_draft_mode == MBP_DRAFT_MULTIPLYOFFSET)
-			{
-			strncpy(comment,"\0",MBP_FILENAMESIZE);
-			sprintf(comment,"  Draft offset:    %f meters",
-				process.mbp_draft_offset);
-			status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-			if (error == MB_ERROR_NO_ERROR) ocomment++;
-			strncpy(comment,"\0",MBP_FILENAMESIZE);
-			sprintf(comment,"  Draft multiplier: %f",
-				process.mbp_draft_mult);
-			status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-			if (error == MB_ERROR_NO_ERROR) ocomment++;
-			}
-		else if (process.mbp_draft_mode == MBP_DRAFT_OFF)
-			{
-			strncpy(comment,"\0",MBP_FILENAMESIZE);
-			sprintf(comment,"  Draft:           not modified");
-			status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-			if (error == MB_ERROR_NO_ERROR) ocomment++;
-			}
-		if (process.mbp_heave_mode == MBP_HEAVE_OFFSET)
-			{
-			strncpy(comment,"\0",MBP_FILENAMESIZE);
-			sprintf(comment,"  Heave offset: %f meters",
-				process.mbp_heave);
-			status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-			if (error == MB_ERROR_NO_ERROR) ocomment++;
-			}
-		else if (process.mbp_heave_mode == MBP_HEAVE_MULTIPLY)
-			{
-			strncpy(comment,"\0",MBP_FILENAMESIZE);
-			sprintf(comment,"  Heave multiplier: %f",
-				process.mbp_heave_mult);
-			status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-			if (error == MB_ERROR_NO_ERROR) ocomment++;
-			}
-		else if (process.mbp_heave_mode == MBP_HEAVE_MULTIPLYOFFSET)
-			{
-			strncpy(comment,"\0",MBP_FILENAMESIZE);
-			sprintf(comment,"  Heave offset: %f meters",
-				process.mbp_heave);
-			status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-			if (error == MB_ERROR_NO_ERROR) ocomment++;
-			strncpy(comment,"\0",MBP_FILENAMESIZE);
-			sprintf(comment,"  Heave multiplier: %f",
-				process.mbp_heave_mult);
-			status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-			if (error == MB_ERROR_NO_ERROR) ocomment++;
-			}
-		else if (process.mbp_heave_mode == MBP_HEAVE_OFF)
-			{
-			strncpy(comment,"\0",MBP_FILENAMESIZE);
-			sprintf(comment,"  Heave:           not modified");
-			status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-			if (error == MB_ERROR_NO_ERROR) ocomment++;
-			}
-		if (process.mbp_tt_mode == MBP_TT_MULTIPLY)
-			{
-			strncpy(comment,"\0",MBP_FILENAMESIZE);
-			sprintf(comment,"  Travel time multiplier: %f",
-				process.mbp_tt_mult);
-			status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-			if (error == MB_ERROR_NO_ERROR) ocomment++;
-			}
-		else if (process.mbp_tt_mode == MBP_TT_OFF)
-			{
-			strncpy(comment,"\0",MBP_FILENAMESIZE);
-			sprintf(comment,"  Travel time:     not modified");
-			status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-			if (error == MB_ERROR_NO_ERROR) ocomment++;
-			}
-	    	if (process.mbp_lever_mode == MBP_LEVER_OFF)
-			{
-			sprintf(comment,"  Lever calculation off.");
-			status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-			if (error == MB_ERROR_NO_ERROR) ocomment++;
-			}
-	    	else
-			{
-			sprintf(comment,"  Lever calculation used to calculate heave correction.");
-			status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-			if (error == MB_ERROR_NO_ERROR) ocomment++;
-	    		sprintf(comment,"  VRU offset x:                  %f m", process.mbp_vru_offsetx);
-			status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-			if (error == MB_ERROR_NO_ERROR) ocomment++;
-	    		sprintf(comment,"  VRU offset y:                  %f m", process.mbp_vru_offsety);
-			status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-			if (error == MB_ERROR_NO_ERROR) ocomment++;
-	    		sprintf(comment,"  VRU offset z:                  %f m", process.mbp_vru_offsetz);
-			status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-			if (error == MB_ERROR_NO_ERROR) ocomment++;
-	    		sprintf(comment,"  Sonar offset x:                %f m", process.mbp_sonar_offsetx);
-			status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-			if (error == MB_ERROR_NO_ERROR) ocomment++;
-	    		sprintf(comment,"  Sonar offset y:                %f m", process.mbp_sonar_offsety);
-			status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-			if (error == MB_ERROR_NO_ERROR) ocomment++;
-	    		sprintf(comment,"  Sonar offset z:                %f m", process.mbp_sonar_offsetz);
-			status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-			if (error == MB_ERROR_NO_ERROR) ocomment++;
-			}
-	    	if (process.mbp_tide_mode == MBP_TIDE_OFF)
-			{
-			sprintf(comment,"  Tide calculation off.");
-			status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-			if (error == MB_ERROR_NO_ERROR) ocomment++;
-			}
-	    	else
-			{
-			sprintf(comment,"  Tide correction applied to bathymetry.");
-			status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-			if (error == MB_ERROR_NO_ERROR) ocomment++;
-	    		sprintf(comment,"  Tide file:                     %s", process.mbp_tidefile);
-			status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-			if (error == MB_ERROR_NO_ERROR) ocomment++;
-	    		sprintf(comment,"  Tide format:                   %d", process.mbp_tide_format);
- 			status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-			if (error == MB_ERROR_NO_ERROR) ocomment++;
-			}
-		if (process.mbp_nav_mode == MBP_NAV_OFF)
-			{
-			strncpy(comment,"\0",MBP_FILENAMESIZE);
-			sprintf(comment,"  Merge navigation:          OFF");
-			status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-			if (error == MB_ERROR_NO_ERROR) ocomment++;
-			}
-		else if (process.mbp_nav_mode == MBP_NAV_ON)
-			{
-			strncpy(comment,"\0",MBP_FILENAMESIZE);
-			sprintf(comment,"  Merged navigation file:    %s", process.mbp_navfile);
-			status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-			if (error == MB_ERROR_NO_ERROR) ocomment++;
-
-			strncpy(comment,"\0",MBP_FILENAMESIZE);
-			sprintf(comment,"  Merged navigation format:  %d", process.mbp_nav_format);
-			status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-			if (error == MB_ERROR_NO_ERROR) ocomment++;
-
-			if (process.mbp_nav_heading == MBP_NAV_ON)
-			    {
-			    strncpy(comment,"\0",MBP_FILENAMESIZE);
-			    sprintf(comment,"  Heading merge:         ON");
-			    status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-			    if (error == MB_ERROR_NO_ERROR) ocomment++;
-			    }
-			else
-			    {
-			    strncpy(comment,"\0",MBP_FILENAMESIZE);
-			    sprintf(comment,"  Heading merge:         OFF");
-			    status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-			    if (error == MB_ERROR_NO_ERROR) ocomment++;
-			    }
-			if (process.mbp_nav_speed == MBP_NAV_ON)
-			    {
-			    strncpy(comment,"\0",MBP_FILENAMESIZE);
-			    sprintf(comment,"  Speed merge:           ON");
-			    status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-			    if (error == MB_ERROR_NO_ERROR) ocomment++;
-			    }
-			else
-			    {
-			    strncpy(comment,"\0",MBP_FILENAMESIZE);
-			    sprintf(comment,"  Speed merge:           OFF");
-			    status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-			    if (error == MB_ERROR_NO_ERROR) ocomment++;
-			    }
-			if (process.mbp_nav_draft == MBP_NAV_ON)
-			    {
-			    strncpy(comment,"\0",MBP_FILENAMESIZE);
-			    sprintf(comment,"  Draft merge:           ON");
-			    status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-			    if (error == MB_ERROR_NO_ERROR) ocomment++;
-			    }
-			else
-			    {
-			    strncpy(comment,"\0",MBP_FILENAMESIZE);
-			    sprintf(comment,"  Draft merge:           OFF");
-			    status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-			    if (error == MB_ERROR_NO_ERROR) ocomment++;
-			    }
-			if (process.mbp_nav_attitude == MBP_NAV_ON)
-			    {
-			    strncpy(comment,"\0",MBP_FILENAMESIZE);
-			    sprintf(comment,"  Attitude merge:        ON");
-			    status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-			    if (error == MB_ERROR_NO_ERROR) ocomment++;
-			    }
-			else
-			    {
-			    strncpy(comment,"\0",MBP_FILENAMESIZE);
-			    sprintf(comment,"  Attitude merge:        OFF");
-			    status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-			    if (error == MB_ERROR_NO_ERROR) ocomment++;
-			    }
-			if (process.mbp_nav_algorithm == MBP_NAV_LINEAR)
-			    {
-			    strncpy(comment,"\0",MBP_FILENAMESIZE);
-			    sprintf(comment,"  Navigation algorithm: linear interpolation");
-			    status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-			    if (error == MB_ERROR_NO_ERROR) ocomment++;
-			    }
-			else if (process.mbp_nav_algorithm == MBP_NAV_SPLINE)
-			    {
-			    strncpy(comment,"\0",MBP_FILENAMESIZE);
-			    sprintf(comment,"  Navigation algorithm: spline interpolation");
-			    status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-			    if (error == MB_ERROR_NO_ERROR) ocomment++;
-			    }
-	    		sprintf(comment,"  Navigation time shift:         %f", process.mbp_nav_timeshift);
-			status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-			if (error == MB_ERROR_NO_ERROR) ocomment++;
-			}
-	    	    if (process.mbp_nav_shift == MBP_NAV_ON)
-			    {
-			    sprintf(comment,"  Navigation positions shifted.");
-			    status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-			    if (error == MB_ERROR_NO_ERROR) ocomment++;
-				sprintf(comment,"  Navigation offset x:       %f", process.mbp_nav_offsetx);
-			    status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-			    if (error == MB_ERROR_NO_ERROR) ocomment++;
-				sprintf(comment,"  Navigation offset y:       %f", process.mbp_nav_offsety);
-			    status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-			    if (error == MB_ERROR_NO_ERROR) ocomment++;
-				sprintf(comment,"  Navigation offset z:       %f", process.mbp_nav_offsetz);
-			    status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-			    if (error == MB_ERROR_NO_ERROR) ocomment++;
-				sprintf(comment,"  Navigation shift longitude:%f", process.mbp_nav_shiftlon);
-			    status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-			    if (error == MB_ERROR_NO_ERROR) ocomment++;
-				sprintf(comment,"  Navigation shift latitude: %f", process.mbp_nav_shiftlat);
-			    status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-			    if (error == MB_ERROR_NO_ERROR) ocomment++;
-			    }
-	    	    else
-			    {
-			    sprintf(comment,"  Navigation positions not shifted.");
-			    status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-			    if (error == MB_ERROR_NO_ERROR) ocomment++;
-			    }
-		if (process.mbp_navadj_mode == MBP_NAVADJ_OFF)
-			{
-			strncpy(comment,"\0",MBP_FILENAMESIZE);
-			sprintf(comment,"  Merge adjusted navigation: OFF");
-			status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-			if (error == MB_ERROR_NO_ERROR) ocomment++;
-			}
-		else if (process.mbp_navadj_mode >= MBP_NAVADJ_LL)
-			{
-			strncpy(comment,"\0",MBP_FILENAMESIZE);
-			sprintf(comment,"  Adjusted navigation file: %s", process.mbp_navadjfile);
-			status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-			if (error == MB_ERROR_NO_ERROR) ocomment++;
-			strncpy(comment,"\0",MBP_FILENAMESIZE);
-			if (process.mbp_navadj_mode == MBP_NAVADJ_LL)
-				{
-				strncpy(comment,"\0",MBP_FILENAMESIZE);
-				sprintf(comment,"  Adjusted navigation applied to lon lat only");
-				status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-				if (error == MB_ERROR_NO_ERROR) ocomment++;
-				strncpy(comment,"\0",MBP_FILENAMESIZE);
-				}
-			else if (process.mbp_navadj_mode == MBP_NAVADJ_LLZ)
-				{
-				strncpy(comment,"\0",MBP_FILENAMESIZE);
-				sprintf(comment,"  Adjusted navigation applied to lon lat depth");
-				status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-				if (error == MB_ERROR_NO_ERROR) ocomment++;
-				strncpy(comment,"\0",MBP_FILENAMESIZE);
-				}
-			if (process.mbp_navadj_algorithm == MBP_NAV_LINEAR)
-			    sprintf(comment,"  Adjusted navigation algorithm: linear interpolation");
-			else if (process.mbp_navadj_algorithm == MBP_NAV_SPLINE)
-			    sprintf(comment,"  Adjusted navigation algorithm: spline interpolation");
-			status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-			if (error == MB_ERROR_NO_ERROR) ocomment++;
-			}
-	    	if (process.mbp_attitude_mode == MBP_ATTITUDE_OFF)
-			{
-			sprintf(comment,"  Attitude merging:              OFF.");
-			status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-			if (error == MB_ERROR_NO_ERROR) ocomment++;
-			}
-	    	else
-			{
-			sprintf(comment,"  Attitude merging:              ON.");
-			status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-			if (error == MB_ERROR_NO_ERROR) ocomment++;
-	    		sprintf(comment,"  Attitude file:                 %s", process.mbp_attitudefile);
-			status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-			if (error == MB_ERROR_NO_ERROR) ocomment++;
-	    		sprintf(comment,"  Attitude format:               %d", process.mbp_attitude_format);
- 			status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-			if (error == MB_ERROR_NO_ERROR) ocomment++;
-			}
-	    	if (process.mbp_sonardepth_mode == MBP_SONARDEPTH_OFF)
-			{
-			sprintf(comment,"  Sonardepth merging:              OFF.");
-			status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-			if (error == MB_ERROR_NO_ERROR) ocomment++;
-			}
-	    	else
-			{
-			sprintf(comment,"  Sonardepth merging:              ON.");
-			status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-			if (error == MB_ERROR_NO_ERROR) ocomment++;
-	    		sprintf(comment,"  Sonardepth file:                 %s", process.mbp_sonardepthfile);
-			status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-			if (error == MB_ERROR_NO_ERROR) ocomment++;
-	    		sprintf(comment,"  Sonardepth format:               %d", process.mbp_sonardepth_format);
- 			status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-			if (error == MB_ERROR_NO_ERROR) ocomment++;
-			}
-		if (process.mbp_heading_mode == MBP_HEADING_OFF)
-			{
-			strncpy(comment,"\0",MBP_FILENAMESIZE);
-			sprintf(comment,"  Heading modify:       OFF");
-			status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-			if (error == MB_ERROR_NO_ERROR) ocomment++;
-			}
-		if (process.mbp_heading_mode == MBP_HEADING_CALC
-				|| process.mbp_heading_mode == MBP_HEADING_CALCOFFSET)
-			{
-			strncpy(comment,"\0",MBP_FILENAMESIZE);
-			sprintf(comment,"  Heading modify:       COURSE MADE GOOD");
-			status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-			if (error == MB_ERROR_NO_ERROR) ocomment++;
-			}
-		if (process.mbp_heading_mode == MBP_HEADING_OFFSET
-				|| process.mbp_heading_mode == MBP_HEADING_CALCOFFSET)
-			{
-			strncpy(comment,"\0",MBP_FILENAMESIZE);
-			sprintf(comment,"  Heading offset:       %f deg", process.mbp_headingbias);
-			status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-			if (error == MB_ERROR_NO_ERROR) ocomment++;
-			}
-
-	    strncpy(comment,"\0",MBP_FILENAMESIZE);
-	    sprintf(comment,"Amplitude Corrections:");
-	    status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-	    if (process.mbp_ampcorr_mode == MBP_AMPCORR_ON)
-		{
-		strncpy(comment,"\0",MBP_FILENAMESIZE);
-		sprintf(comment,"  Amplitude vs grazing angle corrections applied to amplitudes.");
-		status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-	    	strncpy(comment,"\0",MBP_FILENAMESIZE);
-		sprintf(comment,"  Amplitude correction file:      %s m", process.mbp_ampcorrfile);
-		status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-		if (process.mbp_ampcorr_type == MBP_AMPCORR_SUBTRACTION)
-	    		{
-	    		strncpy(comment,"\0",MBP_FILENAMESIZE);
-			sprintf(comment,"  Amplitude correction by subtraction (dB scale)");
-			status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-			}
-		else
-	    		{
-	    		strncpy(comment,"\0",MBP_FILENAMESIZE);
-			sprintf(comment,"  Amplitude correction by division (linear scale)");
-			status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-			}
-		if (process.mbp_ampcorr_symmetry == MBP_AMPCORR_SYMMETRIC)
-	    		{
-	    		strncpy(comment,"\0",MBP_FILENAMESIZE);
-			sprintf(comment,"  AVGA tables forced to be symmetric");
-			status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-			}
-		else
-	    		{
-	    		strncpy(comment,"\0",MBP_FILENAMESIZE);
-			sprintf(comment,"  AVGA tables allowed to be asymmetric");
-			status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-			}
-	    	strncpy(comment,"\0",MBP_FILENAMESIZE);
-		sprintf(comment,"  Reference grazing angle:       %f deg", process.mbp_ampcorr_angle);
-		status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-		if (process.mbp_ampcorr_slope == MBP_AMPCORR_IGNORESLOPE
-			|| process.mbp_ampcorr_slope == MBP_AMPCORR_USESLOPE)
-	    		{
-			strncpy(comment,"\0",MBP_FILENAMESIZE);
-			sprintf(comment,"  Amplitude correction uses swath bathymetry in file");
-			status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-			}
-		else
-	    		{
-			strncpy(comment,"\0",MBP_FILENAMESIZE);
-			sprintf(comment,"  Amplitude correction uses topography grid");
-			status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-			strncpy(comment,"\0",MBP_FILENAMESIZE);
-			sprintf(comment,"  Topography grid file:      %s m", process.mbp_ampsscorr_topofile);
-			status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-			}
-		if (process.mbp_ampcorr_slope == MBP_AMPCORR_IGNORESLOPE)
-	    		{
-	    		strncpy(comment,"\0",MBP_FILENAMESIZE);
-			sprintf(comment,"  Amplitude correction ignores seafloor slope");
-			status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-			}
-		else
-	    		{
-			strncpy(comment,"\0",MBP_FILENAMESIZE);
-			sprintf(comment,"  Amplitude correction uses seafloor slope");
-			status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-			}
- 		}
-	    else
-		{
-		strncpy(comment,"\0",MBP_FILENAMESIZE);
-		sprintf(comment,"  Amplitude correction off.");
-		status = mb_put_comment(verbose,ombio_ptr,comment,&error);
- 		}
-
-	    strncpy(comment,"\0",MBP_FILENAMESIZE);
-	    sprintf(comment,"Sidescan Corrections:");
-	    status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-	    if (process.mbp_sscorr_mode == MBP_SSCORR_ON)
-		{
-		strncpy(comment,"\0",MBP_FILENAMESIZE);
-		sprintf(comment,"  Amplitude vs grazing angle corrections applied to sidescan.");
-		status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-	    	strncpy(comment,"\0",MBP_FILENAMESIZE);
-		sprintf(comment,"  Sidescan correction file:      %s m", process.mbp_sscorrfile);
-		status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-		if (process.mbp_sscorr_type == MBP_SSCORR_SUBTRACTION)
-	    		{
-			strncpy(comment,"\0",MBP_FILENAMESIZE);
-			sprintf(comment,"  Sidescan correction by subtraction (dB scale)");
-			status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-			}
-		else
-	    		{
-	    		strncpy(comment,"\0",MBP_FILENAMESIZE);
-			sprintf(comment,"  Sidescan correction by division (linear scale)");
-			status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-			}
-		if (process.mbp_sscorr_symmetry == MBP_SSCORR_SYMMETRIC)
-	    		{
-	    		strncpy(comment,"\0",MBP_FILENAMESIZE);
-			sprintf(comment,"  AVGA tables forced to be symmetric");
-			status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-			}
-		else
-	    		{
-	    		strncpy(comment,"\0",MBP_FILENAMESIZE);
-			sprintf(comment,"  AVGA tables allowed to be asymmetric");
-			status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-			}
-	    	strncpy(comment,"\0",MBP_FILENAMESIZE);
-		sprintf(comment,"  Reference grazing angle:       %f deg", process.mbp_sscorr_angle);
-		status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-		if (process.mbp_sscorr_slope == MBP_SSCORR_IGNORESLOPE
-			|| process.mbp_sscorr_slope == MBP_SSCORR_USESLOPE)
-	    		{
-			strncpy(comment,"\0",MBP_FILENAMESIZE);
-			sprintf(comment,"  Sidescan correction uses swath bathymetry in file");
-			status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-			}
-		else
-	    		{
-			strncpy(comment,"\0",MBP_FILENAMESIZE);
-			sprintf(comment,"  Sidescan correction uses topography grid");
-			status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-			strncpy(comment,"\0",MBP_FILENAMESIZE);
-			sprintf(comment,"  Topography grid file:      %s m", process.mbp_ampsscorr_topofile);
-			status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-			}
-		if (process.mbp_sscorr_slope == MBP_SSCORR_IGNORESLOPE)
-	    		{
-	    		strncpy(comment,"\0",MBP_FILENAMESIZE);
-			sprintf(comment,"  Sidescan correction ignores seafloor slope");
-			status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-			}
-		else
-	    		{
-			strncpy(comment,"\0",MBP_FILENAMESIZE);
-			sprintf(comment,"  Sidescan correction uses seafloor slope");
-			status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-			}
- 		}
-	    else
-		{
-		strncpy(comment,"\0",MBP_FILENAMESIZE);
-		sprintf(comment,"  Sidescan correction off.");
-		status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-		}
-
-	    strncpy(comment,"\0",MBP_FILENAMESIZE);
-	    sprintf(comment,"Sidescan Recalculation:");
-	    status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-	    if (process.mbp_ssrecalc_mode == MBP_SSRECALC_ON)
-		{
-		strncpy(comment,"\0",MBP_FILENAMESIZE);
-		sprintf(comment,"  Sidescan recalculated.");
-		status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-		strncpy(comment,"\0",MBP_FILENAMESIZE);
-		sprintf(comment,"  Sidescan pixel size:           %f",process.mbp_ssrecalc_pixelsize);
-		status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-		strncpy(comment,"\0",MBP_FILENAMESIZE);
-		sprintf(comment,"  Sidescan swath width:          %f",process.mbp_ssrecalc_swathwidth);
-		status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-		strncpy(comment,"\0",MBP_FILENAMESIZE);
-		sprintf(comment,"  Sidescan interpolation:        %d",process.mbp_ssrecalc_interpolate);
-		status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-		}
-	    else
-		{
-		strncpy(comment,"\0",MBP_FILENAMESIZE);
-		sprintf(comment,"  Sidescan not recalculated.");
-		status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-		}
-
-		strncpy(comment,"\0",MBP_FILENAMESIZE);
-		if (process.mbp_cut_num > 0)
-			sprintf(comment,"  Data cutting enabled (%d commands).", process.mbp_cut_num);
-		else
-			sprintf(comment,"  Data cutting disabled.");
-		status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-		if (error == MB_ERROR_NO_ERROR) ocomment++;
-		for (i=0;i<process.mbp_cut_num;i++)
-			{
-			strncpy(comment,"\0",MBP_FILENAMESIZE);
-			sprintf(comment, "  Cut[%d]: %d %d %f %f",
-				i, process.mbp_cut_kind[i], process.mbp_cut_mode[i],
-				process.mbp_cut_min[i], process.mbp_cut_max[i]);
-			status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-			sprintf(comment, "  %f %f", process.mbp_cut_min[i], process.mbp_cut_max[i]);
-			status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-			if (error == MB_ERROR_NO_ERROR) ocomment++;
-			}
-
-		if (process.mbp_edit_mode == MBP_EDIT_OFF)
-			{
-			strncpy(comment,"\0",MBP_FILENAMESIZE);
-			sprintf(comment,"  Merge bath edit:      OFF");
-			status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-			if (error == MB_ERROR_NO_ERROR) ocomment++;
-			}
-		else if (process.mbp_edit_mode == MBP_EDIT_ON)
-			{
-			strncpy(comment,"\0",MBP_FILENAMESIZE);
-			sprintf(comment,"  Bathy edit file:      %s", process.mbp_editfile);
-			status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-			if (error == MB_ERROR_NO_ERROR) ocomment++;
-			}
-
-		if (process.mbp_kluge001 == MB_YES)
-			{
-			strncpy(comment,"\0",MBP_FILENAMESIZE);
-			sprintf(comment,"  Processing Kluge001 applied (travel time correction to HSDS2 data)");
-			status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-			if (error == MB_ERROR_NO_ERROR) ocomment++;
-			}
-		else if (process.mbp_kluge002 == MB_YES)
-			{
-			strncpy(comment,"\0",MBP_FILENAMESIZE);
-			sprintf(comment,"  Processing Kluge002 applied (heave correction to Simrad data)");
-			status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-			if (error == MB_ERROR_NO_ERROR) ocomment++;
-			}
-		else if (process.mbp_kluge003 == MB_YES)
-			{
-			strncpy(comment,"\0",MBP_FILENAMESIZE);
-			sprintf(comment,"  Processing Kluge003 applied (roll correction for USCG Healy SB2112 data)");
-			status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-			if (error == MB_ERROR_NO_ERROR) ocomment++;
-			}
-		else if (process.mbp_kluge004 == MB_YES)
-			{
-			strncpy(comment,"\0",MBP_FILENAMESIZE);
-			sprintf(comment,"  Processing Kluge004 applied (remove data with overlapping time stamps)");
-			status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-			if (error == MB_ERROR_NO_ERROR) ocomment++;
-			}
-		else if (process.mbp_kluge005 == MB_YES)
-			{
-			strncpy(comment,"\0",MBP_FILENAMESIZE);
-			sprintf(comment,"  Processing Kluge005 applied (replaces survey record timestamps withtimestamps of corresponding merged navigation records)");
-			status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-			if (error == MB_ERROR_NO_ERROR) ocomment++;
-			}
-		else if (process.mbp_kluge006 == MB_YES)
-			{
-			strncpy(comment,"\0",MBP_FILENAMESIZE);
-			sprintf(comment,"  Processing Kluge006 applied (changes sonar depth / draft values without changing bathymetry values)");
-			status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-			if (error == MB_ERROR_NO_ERROR) ocomment++;
-			}
-		else if (process.mbp_kluge007 == MB_YES)
-			{
-			strncpy(comment,"\0",MBP_FILENAMESIZE);
-			sprintf(comment,"  Processing Kluge007 applied (zero alongtrack values > half altitude)");
-			status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-			if (error == MB_ERROR_NO_ERROR) ocomment++;
-			}
-		else if (process.mbp_kluge008 == MB_YES)
-			{
-			strncpy(comment,"\0",MBP_FILENAMESIZE);
-			sprintf(comment,"  Processing Kluge008 applied (undefined)");
-			status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-			if (error == MB_ERROR_NO_ERROR) ocomment++;
-			}
-		else if (process.mbp_kluge009 == MB_YES)
-			{
-			strncpy(comment,"\0",MBP_FILENAMESIZE);
-			sprintf(comment,"  Processing Kluge009 applied (undefined)");
-			status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-			if (error == MB_ERROR_NO_ERROR) ocomment++;
-			}
-		else if (process.mbp_kluge010 == MB_YES)
-			{
-			strncpy(comment,"\0",MBP_FILENAMESIZE);
-			sprintf(comment,"  Processing Kluge010 applied (undefined)");
-			status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-			if (error == MB_ERROR_NO_ERROR) ocomment++;
-			}
-
-		strncpy(comment,"\0",MBP_FILENAMESIZE);
-		sprintf(comment," ");
-		status = mb_put_comment(verbose,ombio_ptr,comment,&error);
-		if (error == MB_ERROR_NO_ERROR) ocomment++;
- 		}
-
-	/* set up the raytracing */
-	if (process.mbp_svp_mode != MBP_SVP_OFF)
-		status = mb_rt_init(verbose, nsvp, depth, velocity, &rt_svp, &error);
-
-	/* set up the sidescan recalculation */
-	if (process.mbp_ssrecalc_mode == MBP_SSRECALC_ON)
-		{
-		if (process.mbp_ssrecalc_pixelsize != 0.0)
-			{
-			pixel_size_set = MB_YES;
-			pixel_size = process.mbp_ssrecalc_pixelsize;
-			}
-		else
-			{
-			pixel_size_set = MB_NO;
-			pixel_size = 0.0;
-			}
-		if (process.mbp_ssrecalc_swathwidth != 0.0)
-			{
-			swath_width_set = MB_YES;
-			swath_width = process.mbp_ssrecalc_swathwidth;
-			}
-		else
-			{
-			swath_width_set = MB_NO;
-			swath_width = 0.0;
-			}
-		pixel_int = process.mbp_ssrecalc_interpolate;
-		}
-
-	/* initialize time_d_lastping */
-	time_d_lastping = 0.0;
-
-	/*--------------------------------------------
-	  loop over reading input
-	  --------------------------------------------*/
-
-	/* read and write */
-	while (error <= MB_ERROR_NO_ERROR)
-		{
-		/* read some data */
-		error = MB_ERROR_NO_ERROR;
-		status = MB_SUCCESS;
-		status = mb_get_all(verbose,imbio_ptr,&store_ptr,&kind,
-				time_i,&time_d,&navlon,&navlat,
-				&speed,&heading,
-				&distance,&altitude,&sonardepth,
-				&nbath,&namp,&nss,
-				beamflag,bath,amp,
-				bathacrosstrack,bathalongtrack,
-				ss,ssacrosstrack,ssalongtrack,
-				comment,&error);
-
-		
-
-		/* time gaps do not matter to mbprocess */
-		if (error == MB_ERROR_TIME_GAP)
-			{
-			status = MB_SUCCESS;
-			error = MB_ERROR_NO_ERROR;
-			}
-
-		/* out of bounds do not matter to mbprocess */
-		if (error == MB_ERROR_OUT_BOUNDS)
-			{
-			status = MB_SUCCESS;
-			error = MB_ERROR_NO_ERROR;
-			}
-
-		/* non-survey data do not matter to mbprocess */
-		if (error == MB_ERROR_OTHER)
-			{
-			status = MB_SUCCESS;
-			error = MB_ERROR_NO_ERROR;
-			}
-
-		/* compare and save survey data timestamps */
-		if (process.mbp_kluge004 == MB_YES
-			&& error == MB_ERROR_NO_ERROR
-			&& kind == MB_DATA_DATA)
-			{
-			if (time_d <= time_d_lastping)
-				{
-				error = MB_ERROR_UNINTELLIGIBLE;
-				status = MB_FAILURE;
-				}
-			}
-
-		/* detect multiple pings with the same time stamps */
-		if (error == MB_ERROR_NO_ERROR && kind == MB_DATA_DATA)
-			{
-			if (time_d == time_d_lastping)
-				{
-				pingmultiplicity++;
-				}
-			else
-				{
-				pingmultiplicity = 0;
-				}
-			time_d_lastping = time_d;
-			}
-
-		/* increment counter */
-		if (error <= MB_ERROR_NO_ERROR
-			&& kind == MB_DATA_DATA)
-			idata++;
-		else if (error <= MB_ERROR_NO_ERROR
-			&& kind == MB_DATA_NAV)
-			inav++;
-		else if (error <= MB_ERROR_NO_ERROR
-			&& kind == MB_DATA_COMMENT)
-			icomment++;
-		else if (error <= MB_ERROR_NO_ERROR)
-			iother++;
-
-		/* output error messages */
-		if (verbose >= 1 && error == MB_ERROR_COMMENT)
-			{
-			if (icomment == 1)
-				fprintf(stderr,"\nComments in Input:\n");
-			fprintf(stderr,"%s\n",comment);
-			}
-		else if (verbose >= 1 && error < MB_ERROR_NO_ERROR
-			&& error > MB_ERROR_OTHER)
-			{
-			mb_error(verbose,error,&message);
-			fprintf(stderr,"\nNonfatal MBIO Error:\n%s\n",message);
-			fprintf(stderr,"Input Record: %d\n",idata);
-			fprintf(stderr,"Time: %d %d %d %d %d %d\n",
-				time_i[0],time_i[1],time_i[2],
-				time_i[3],time_i[4],time_i[5]);
-			}
-		else if (verbose >= 1 && error < MB_ERROR_NO_ERROR)
-			{
-			mb_error(verbose,error,&message);
-			fprintf(stderr,"\nNonfatal MBIO Error:\n%s\n",message);
-			fprintf(stderr,"Input Record: %d\n",idata);
-			}
-		else if (verbose >= 1 && error != MB_ERROR_NO_ERROR
-			&& error != MB_ERROR_EOF)
-			{
-			mb_error(verbose,error,&message);
-			fprintf(stderr,"\nFatal MBIO Error:\n%s\n",message);
-			fprintf(stderr,"Last Good Time: %d %d %d %d %d %d\n",
-				time_i[0],time_i[1],time_i[2],
-				time_i[3],time_i[4],time_i[5]);
-			}
-
-	/*--------------------------------------------
-	  handle kluges 1 and 7
-	  --------------------------------------------*/
-
-		/* apply kluge001 - enables correction of travel times in
-               		Hydrosweep DS2 data from the R/V Maurice
-               		Ewing in 2001 and 2002. */
-		if (process.mbp_kluge001 == MB_YES
-			&& kind == MB_DATA_DATA
-			&& (format == 182 || format == 183))
-			status = mbsys_atlas_ttcorr(verbose,imbio_ptr,store_ptr,&error);
-
-		/* apply kluge007 - zero alongtrack distances > half the altitude */
-		if (process.mbp_kluge007== MB_YES
-			&& kind == MB_DATA_DATA)
-			{
-			for (i=0;i<nbath;i++)
-				{
-				if (fabs(bathalongtrack[i]) > 0.5 * altitude)
-					bathalongtrack[i] = 0.0;
-				}
-			for (i=0;i<nss;i++)
-				{
-				if (fabs(ssalongtrack[i]) > 0.5 * altitude)
-					ssalongtrack[i] = 0.0;
-				}
-			}
-
-	/*--------------------------------------------
-	  handle navigation merging
-	  --------------------------------------------*/
-
-		/* extract the navigation if available */
-		if (error == MB_ERROR_NO_ERROR
-			&& (kind == MB_DATA_DATA
-			    || kind == MB_DATA_NAV))
-			{
-			status = mb_extract_nav(verbose,imbio_ptr,store_ptr,&kind,
-					time_i,&time_d,&navlon,&navlat,
-					&speed,&heading,&draft_org,&roll_org,&pitch_org,&heave_org,&error);
-			draft = draft_org;
-			roll = roll_org;
-			pitch = pitch_org;
-			heave = heave_org;
-
-			/* apply kluge002 - enables correction of draft values in Simrad data
-        		       - some Simrad multibeam data has had an
-                		 error in which the heave has bee added
-                		 to the sonar depth (draft for hull
-                		 mounted sonars)
-        		       - this correction subtracts the heave
-                		 value from the sonar depth */
-			if (process.mbp_kluge002 == MB_YES
-			    && kind == MB_DATA_DATA)
-			    draft -= heave;
-			}
-
-		/* apply kluge005 - replaces survey record timestamps with
-        		timestamps of corresponding merged navigation
-        		records
-        		- this feature allows users to fix
-                	  timestamp errors using MBnavedit and
-                	  then insert the corrected timestamps
-                	  into processed data */
-		if (process.mbp_kluge005 == MB_YES
-			&& error == MB_ERROR_NO_ERROR
-			&& kind == MB_DATA_DATA
-			&& nnav > 0)
-			{
-/*fprintf(stderr,"time_d:%f ntime[%d]:%f kluge005:%d\n",
-time_d,idata-1,ntime[idata-1],process.mbp_kluge005);*/
-			time_d = ntime[idata-1];
-			mb_get_date(verbose,time_d,time_i);
-			}
-
-		/* interpolate the navigation if desired */
-		if (error == MB_ERROR_NO_ERROR
-			&& process.mbp_nav_mode == MBP_NAV_ON
-			&& (kind == MB_DATA_DATA
-			    || kind == MB_DATA_NAV))
-			{
-			/* interpolate navigation */
-			if (process.mbp_nav_algorithm == MBP_NAV_SPLINE
-			    && time_d >= ntime[0]
-			    && time_d <= ntime[nnav-1])
-			    {
-			    intstat = mb_spline_interp(verbose,
-					ntime-1, nlon-1, nlonspl-1,
-					nnav, time_d, &navlon, &itime,
-					&error);
-			    intstat = mb_spline_interp(verbose,
-					ntime-1, nlat-1, nlatspl-1,
-					nnav, time_d, &navlat, &itime,
-					&error);
-			    }
-			else
-			    {
-			    intstat = mb_linear_interp_longitude(verbose,
-					ntime-1, nlon-1,
-					nnav, time_d, &navlon, &itime,
-					&error);
-			    intstat = mb_linear_interp_latitude(verbose,
-					ntime-1, nlat-1,
-					nnav, time_d, &navlat, &itime,
-					&error);
-			    }
-
-			/* interpolate heading */
-			if (process.mbp_nav_heading == MBP_NAV_ON)
-			    {
-			    intstat = mb_linear_interp_heading(verbose,
-					ntime-1, nheading-1,
-					nnav, time_d, &heading, &itime,
-					&error);
-                            if (heading < 0.0)
-                                heading += 360.0;
-                            else if (heading > 360.0)
-                                heading -= 360.0;
-			    }
-
-			/* interpolate speed */
-			if (process.mbp_nav_speed == MBP_NAV_ON)
-			    {
-			    intstat = mb_linear_interp(verbose,
-					ntime-1, nspeed-1,
-					nnav, time_d, &speed, &itime,
-					&error);
-			    }
-
-			/* interpolate draft */
-			if (process.mbp_nav_draft == MBP_NAV_ON)
-			    {
-			    intstat = mb_linear_interp(verbose,
-					ntime-1, ndraft-1,
-					nnav, time_d, &draft, &itime,
-					&error);
-			    }
-
-			/* interpolate attitude */
-			if (process.mbp_nav_attitude == MBP_NAV_ON)
-			    {
-			    intstat = mb_linear_interp(verbose,
-					ntime-1, nroll-1,
-					nnav, time_d, &roll, &itime,
-					&error);
-			    intstat = mb_linear_interp(verbose,
-					ntime-1, npitch-1,
-					nnav, time_d, &pitch, &itime,
-					&error);
-			    intstat = mb_linear_interp(verbose,
-					ntime-1, nheave-1,
-					nnav, time_d, &heave, &itime,
-					&error);
-			    }
-			}
-
-	/*--------------------------------------------
-	  handle attitude merging
-	  --------------------------------------------*/
-
-		/* interpolate the attitude if desired */
-		if (error == MB_ERROR_NO_ERROR
-			&& process.mbp_attitude_mode == MBP_ATTITUDE_ON
-			&& (kind == MB_DATA_DATA
-			    || kind == MB_DATA_NAV))
-			{
-			/* interpolate adjusted navigation */
-			intstat = mb_linear_interp(verbose,
-					attitudetime-1, attituderoll-1,
-					nattitude, time_d, &roll, &iatime,
-					&error);
-			intstat = mb_linear_interp(verbose,
-					attitudetime-1, attitudepitch-1,
-					nattitude, time_d, &pitch, &iatime,
-					&error);
-			intstat = mb_linear_interp(verbose,
-					attitudetime-1, attitudeheave-1,
-					nattitude, time_d, &heave, &iatime,
-					&error);
-			}
-
-	/*--------------------------------------------
-	  handle sonar depth merging
-	  --------------------------------------------*/
-
-		/* interpolate the sonardepth if desired */
-		if (error == MB_ERROR_NO_ERROR
-			&& process.mbp_sonardepth_mode == MBP_SONARDEPTH_ON
-			&& (kind == MB_DATA_DATA
-			    || kind == MB_DATA_NAV))
-			{
-			/* interpolate adjusted navigation */
-			intstat = mb_linear_interp(verbose,
-					fsonardepthtime-1, fsonardepth-1,
-					nsonardepth, time_d, &draft, &iatime,
-					&error);
-			}
-
-	/*--------------------------------------------
-	  handle position shifts
-	  --------------------------------------------*/
-
-		/* apply position shifts if needed */
-    		if (process.mbp_nav_shift == MBP_NAV_ON)
-			{
-			mb_coor_scale(verbose,navlat,&mtodeglon,&mtodeglat);
-			headingx = sin(heading * DTR);
-			headingy = cos(heading * DTR);
-			navlon -= (headingy * mtodeglon
-					    * process.mbp_nav_offsetx
-			    	    + headingx * mtodeglon
-					    * process.mbp_nav_offsety
-				    - process.mbp_nav_shiftlon);
-			navlat -= (-headingx * mtodeglat
-					    * process.mbp_nav_offsetx
-			    	    + headingy * mtodeglat
-					    * process.mbp_nav_offsety
-				    - process.mbp_nav_shiftlat);
-			}
-
-	/*--------------------------------------------
-	  handle draft correction
-	  --------------------------------------------*/
-		/* add user specified draft correction if desired */
-		if (error == MB_ERROR_NO_ERROR
-			&& (kind == MB_DATA_DATA
-			    || kind == MB_DATA_NAV))
-			{
-			if (process.mbp_draft_mode == MBP_DRAFT_OFFSET)
-				draft = draft + process.mbp_draft_offset;
-			else if (process.mbp_draft_mode == MBP_DRAFT_MULTIPLY)
-				draft = draft * process.mbp_draft_mult;
-			else if (process.mbp_draft_mode == MBP_DRAFT_MULTIPLYOFFSET)
-				draft = draft * process.mbp_draft_mult + process.mbp_draft_offset;
-			else if (process.mbp_draft_mode == MBP_DRAFT_SET)
-				draft = process.mbp_draft;
-			}
-
-	/*--------------------------------------------
-	  handle adjusted navigation merging
-	  --------------------------------------------*/
-
-		/* interpolate the adjusted navigation if desired */
-		if (error == MB_ERROR_NO_ERROR
-			&& process.mbp_navadj_mode >= MBP_NAVADJ_LL
-			&& (kind == MB_DATA_DATA
-			    || kind == MB_DATA_NAV))
-			{
-			/* interpolate adjusted navigation */
-			if (process.mbp_navadj_algorithm == MBP_NAV_SPLINE
-			    && time_d >= natime[0]
-			    && time_d <= natime[nanav-1])
-			    {
-			    intstat = mb_spline_interp(verbose,
-					natime-1, nalon-1, nalonspl-1,
-					nanav, time_d, &navlon, &iatime,
-					&error);
-			    intstat = mb_spline_interp(verbose,
-					ntime-1, nalat-1, nalatspl-1,
-					nanav, time_d, &navlat, &iatime,
-					&error);
-			    }
-			else
-			    {
-			    intstat = mb_linear_interp_longitude(verbose,
-					natime-1, nalon-1,
-					nanav, time_d, &navlon, &iatime,
-					&error);
-			    intstat = mb_linear_interp_latitude(verbose,
-					natime-1, nalat-1,
-					nanav, time_d, &navlat, &iatime,
-					&error);
-			    }
-			}
-
-	/*--------------------------------------------
-	  apply z offset from navigation adjustment correction
-	  --------------------------------------------*/
-
-		/* apply z offset from navigation adjustment correction */
-		if (error == MB_ERROR_NO_ERROR
-			&& kind == MB_DATA_DATA
-			&& process.mbp_navadj_mode == MBP_NAVADJ_LLZ
-			&& nanav > 1)
-		    {
-		    /* interpolate z offset */
-		    if (process.mbp_navadj_algorithm == MBP_NAV_SPLINE
-			&& time_d >= natime[0]
-			&& time_d <= natime[nanav-1])
-			{
-			intstat = mb_spline_interp(verbose,
-				    natime-1, naz-1, nazspl-1,
-				    nanav, time_d, &zoffset, &iatime,
-				    &error);
-			}
-		    else
-			{
-			intstat = mb_linear_interp(verbose,
-				    natime-1, naz-1,
-				    nanav, time_d, &zoffset, &iatime,
-				    &error);
-			}
-
-		    /* apply z offset to draft / sonar depth */
-		    draft += zoffset;
-		    }
-
-	/*--------------------------------------------
-	  apply tide correction
-	  --------------------------------------------*/
-
-		/* apply tide corrections */
-		if (process.mbp_tide_mode == MBP_TIDE_ON
-			&& ntide > 0)
-		    {
-		    /* interpolate tide */
-		    intstat = mb_linear_interp(verbose,
-				tidetime-1, tide-1,
-				ntide, time_d, &tideval, &itime,
-				&error);
-
-		    /* apply tide to to draft / sonar depth */
-		    draft -= tideval;
-		    }
-
-	/*--------------------------------------------
-	  handle lever arm correction
-	  --------------------------------------------*/
-
-		/* do lever calculation to find heave implied by roll and pitch
-		   for a sonar displaced from the vru - this will be added to the
-		   bathymetry */
-	    	if (error == MB_ERROR_NO_ERROR
-			&& process.mbp_lever_mode == MBP_LEVER_ON
-			&& kind == MB_DATA_DATA)
-			{
-			alpha = pitch;
-			beta = roll;
-			if (process.mbp_pitchbias_mode == MBP_PITCHBIAS_ON)
-			    	alpha += process.mbp_pitchbias;
-			if (process.mbp_rollbias_mode == MBP_ROLLBIAS_SINGLE)
-			    	beta += process.mbp_rollbias;
-			else if (process.mbp_rollbias_mode == MBP_ROLLBIAS_DOUBLE)
-			    	beta += 0.5 * (process.mbp_rollbias_port
-							+ process.mbp_rollbias_stbd);
-			mb_lever(verbose,
-			    	process.mbp_sonar_offsetx,
-			    	process.mbp_sonar_offsety,
-			    	process.mbp_sonar_offsetz,
-			    	(double) 0.0,
-			    	(double) 0.0,
-			    	(double) 0.0,
-				process.mbp_vru_offsetx,
-				process.mbp_vru_offsety,
-				process.mbp_vru_offsetz,
-				alpha,
-				beta,
-				&lever_x,
-				&lever_y,
-				&lever_heave,
-				&error);
-/*fprintf(stderr, "alpha:%f beta:%f lever:%f\n",
-alpha, beta, lever_heave);*/
-			}
-
-	/*--------------------------------------------
-	  handle speed and heading calculation
-	  --------------------------------------------*/
-
-		/* make up heading and speed if required */
-		calculatespeedheading = MB_NO;
-		if (process.mbp_heading_mode == MBP_HEADING_CALC
-			|| process.mbp_heading_mode == MBP_HEADING_CALCOFFSET)
-			calculatespeedheading = MB_YES;
-		for (icut=0;icut<process.mbp_cut_num;icut++)
-		    {
-		    if (process.mbp_cut_mode[icut] == MBP_CUT_MODE_SPEED)
-			calculatespeedheading = MB_YES;
-		    }
-		if (error == MB_ERROR_NO_ERROR
-			&& (kind == MB_DATA_DATA
-			    || kind == nav_source)
-			&& calculatespeedheading == MB_YES)
-			{
-			if (process.mbp_nav_mode == MBP_NAV_ON)
-			    {
-			    mb_coor_scale(verbose,nlat[itime-1],&mtodeglon,&mtodeglat);
-			    del_time = ntime[itime] - ntime[itime-1];
-			    dx = (nlon[itime] - nlon[itime-1])/mtodeglon;
-			    dy = (nlat[itime] - nlat[itime-1])/mtodeglat;
-			    }
-			else if (process.mbp_navadj_mode >= MBP_NAVADJ_LL)
-			    {
-			    mb_coor_scale(verbose,nalat[iatime-1],&mtodeglon,&mtodeglat);
-			    del_time = natime[iatime] - natime[iatime-1];
-			    dx = (nalon[iatime] - nalon[iatime-1])/mtodeglon;
-			    dy = (nalat[iatime] - nalat[iatime-1])/mtodeglat;
-			    }
-			else if ((kind == MB_DATA_DATA && idata > 1)
-					|| (kind == MB_DATA_NAV && inav > 1))
-			    {
-			    mb_coor_scale(verbose,navlat,&mtodeglon,&mtodeglat);
-			    del_time = time_d - time_d_old;
-			    dx = (navlon - navlon_old)/mtodeglon;
-			    dy = (navlat - navlat_old)/mtodeglat;
-			    }
-			if ((process.mbp_nav_mode == MBP_NAV_ON)
-				|| (process.mbp_navadj_mode >= MBP_NAVADJ_LL)
-				|| ((kind == MB_DATA_DATA && idata > 1)
-					|| (kind == MB_DATA_NAV && inav > 1)))
-			    {
-			    dist = sqrt(dx*dx + dy*dy);
-			    if (del_time > 0.0)
-				{
-				speedcalc = 3.6*dist/del_time;
-				}
-			    else
-				speedcalc = speed_old;
-			    if (dist > 0.0 && del_time > 0.0)
-				{
-				headingcalc = RTD*atan2(dx/dist,dy/dist);
-                                if (headingcalc < 0.0)
-                                    headingcalc += 360.0;
-				}
-			    else
-				headingcalc = heading_old;
-			    }
-                        else
-                            {
-                            speedcalc = speed;
-                            headingcalc = heading;
-                            }
-                        if (process.mbp_heading_mode == MBP_HEADING_CALC
-                                || process.mbp_heading_mode == MBP_HEADING_CALCOFFSET)
-                                {
-                                heading = headingcalc;
-                                }
-                        else
-                                {
-                                speed = speedcalc;
-                                }
-			time_d_old = time_d;
-			navlon_old = navlon;
-			navlat_old = navlat;
-			heading_old = headingcalc;
-			speed_old = speedcalc;
-			}
-
-		/* adjust heading if required */
-		if (error == MB_ERROR_NO_ERROR
-			&& (kind == MB_DATA_DATA
-			    || kind == MB_DATA_NAV)
-			&& (process.mbp_heading_mode == MBP_HEADING_OFFSET
-			    || process.mbp_heading_mode == MBP_HEADING_CALCOFFSET))
-			{
-			heading += process.mbp_headingbias;
-			if (heading >= 360.0)
-			    heading -= 360.0;
-			else if (heading < 0.0)
-			    heading += 360.0;
-			}
-
-	/*--------------------------------------------
-	  deal with bathymetry
-	  --------------------------------------------*/
-
-		/* if survey data encountered,
-			get the bathymetry */
-		if (error == MB_ERROR_NO_ERROR
-			&& (kind == MB_DATA_DATA))
-			{
-
-	/*--------------------------------------------
-	  get travel time values
-	  --------------------------------------------*/
-
-			/* extract travel times if they exist */
-			if (traveltime == MB_YES)
-			    {
-			    status = mb_ttimes(verbose,imbio_ptr,
-				store_ptr,&kind,&nbeams,
-				ttimes,angles,
-				angles_forward,angles_null,
-				bheave,alongtrack_offset,
-				&draft_org,&ssv,&error);
-			    }
-
-			/* estimate travel times if they don't exist */
-			else
-			    {
-			    draft_org = sonardepth - heave;
-			    ssv = 1500.0;
-			    nbeams = nbath;
-			    for (i=0;i<nbath;i++)
-				{
-				if (beamflag[i] != MB_FLAG_NULL)
-				    {
-				    zz = bath[i] - sonardepth;
-				    rr = sqrt(zz * zz
-					+ bathacrosstrack[i] * bathacrosstrack[i]
-					+ bathalongtrack[i] * bathalongtrack[i]);
-				    ttimes[i] = rr / 750.0;
-				    mb_xyz_to_takeoff(verbose,
-						bathacrosstrack[i],
-						bathalongtrack[i],
-						(bath[i] - sonardepth),
-						&angles[i],
-						&angles_forward[i],
-						&error);
-				    }
-				else
-				    {
-				    angles[i] = 0.0;
-				    angles_forward[i] = 0.0;
-				    }
-				angles_null[i] = 0.0;
-				bheave[i] = 0.0;
-				alongtrack_offset[i] = 0.0;
-				}
-			    }
-
-	/*--------------------------------------------
-	  handle adjustments to ssv, heave, and travel times
-	  --------------------------------------------*/
-
-			/* set surface sound speed to default if needed */
-			if (ssv <= 0.0)
-				ssv = ssv_start;
-			else
-				ssv_start = ssv;
-
-			/* if heave adjustment specified do it */
-			if (process.mbp_heave_mode != MBP_HEAVE_OFF)
-			    {
-			    if (process.mbp_heave_mode == MBP_HEAVE_MULTIPLY
-				|| process.mbp_heave_mode == MBP_HEAVE_MULTIPLYOFFSET)
-				{
-				for (i=0;i<nbath;i++)
-				    bheave[i] *= process.mbp_heave_mult;
-				}
-			    if (process.mbp_heave_mode == MBP_HEAVE_OFFSET
-				|| process.mbp_heave_mode == MBP_HEAVE_MULTIPLYOFFSET)
-				{
-				for (i=0;i<nbath;i++)
-				    bheave[i] += process.mbp_heave;
-				}
-			    }
-
-			/* if tt adjustment specified do it */
-			if (process.mbp_tt_mode == MBP_TT_MULTIPLY)
-			    {
-			    for (i=0;i<nbath;i++)
-				ttimes[i] *= process.mbp_tt_mult;
-			    }
-
-			/* if ssv adjustment specified do it */
-			if (process.mbp_ssv_mode == MBP_SSV_SET)
-			    {
-			    ssv = process.mbp_ssv;
-			    }
-			else if (process.mbp_ssv_mode == MBP_SSV_OFFSET)
-			    {
-			    ssv += process.mbp_ssv;
-			    }
-
-	/*--------------------------------------------
-	  recalculate the bathymetry
-	  --------------------------------------------*/
-
-			/* apply kluge006 - resets draft without changing bathymetry */
-			if (process.mbp_kluge006 == MB_YES
-			    && kind == MB_DATA_DATA)
-			    {
-/*fprintf(stderr,"RESET Draft: %f %f %f\n",draft_org,draft,sonardepth);*/
-			    draft_org = draft;
-			    }
-
-			/* if svp specified recalculate bathymetry
-			    by raytracing  */
-			if (process.mbp_bathrecalc_mode == MBP_BATHRECALC_RAYTRACE)
-			    {
-/* fprintf(stderr,"\nPING: %4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d %f \n",
-time_i[0], time_i[1], time_i[2],
-time_i[3], time_i[4], time_i[5], time_i[6],
-time_d); */
-			    /* loop over the beams */
-			    for (i=0;i<nbeams;i++)
-			      {
-			      if (ttimes[i] > 0.0)
-				{
-				/* if needed, translate angles from takeoff
-					angle coordinates to roll-pitch
-					coordinates, apply roll and pitch
-					corrections, and translate back */
-				if (process.mbp_rollbias_mode != MBP_ROLLBIAS_OFF
-					|| process.mbp_pitchbias_mode == MBP_PITCHBIAS_ON
-					|| process.mbp_nav_attitude == MBP_NAV_ON
-					|| process.mbp_attitude_mode == MBP_ATTITUDE_ON
-					|| process.mbp_kluge003 == MB_YES)
-					{
-					mb_takeoff_to_rollpitch(
-						verbose,
-						angles[i], angles_forward[i],
-						&alpha, &beta,
-						&error);
-        			       /* apply kluge_003 - enables correction of beam angles in
-        				SeaBeam 2112 data
-        				- a data sample from the SeaBeam 2112 on
-                			  the USCG Icebreaker Healy (collected on
-                			  23 July 2003) was found to have an error
-                			  in which the beam angles had 0.25 times
-                			  the roll added
-        				- this correction subtracts 0.25 * roll
-                			  from the beam angles before the bathymetry
-                			  is recalculated by raytracing through a
-                			  water sound velocity profile
-        				- the mbprocess parameter files must be
-                			  set to enable bathymetry recalculation
-                			  by raytracing in order to apply this
-                			  correction */
-					if (process.mbp_kluge003 == MB_YES)
-						beta -= 0.25*roll;
-					if (process.mbp_nav_attitude == MBP_NAV_ON
-						|| process.mbp_attitude_mode == MBP_ATTITUDE_ON)
-						{
-						beta += roll - roll_org;
-						alpha += pitch - pitch_org;
-						}
-					if (process.mbp_pitchbias_mode == MBP_PITCHBIAS_ON)
-			    			alpha += process.mbp_pitchbias;
-			    		if (process.mbp_rollbias_mode == MBP_ROLLBIAS_SINGLE)
-			    			beta += process.mbp_rollbias;
-			    		else if (process.mbp_rollbias_mode == MBP_ROLLBIAS_DOUBLE
-						&& angles[i] >= 0.0)
-			    			beta += process.mbp_rollbias_stbd;
-			    		else if (process.mbp_rollbias_mode == MBP_ROLLBIAS_DOUBLE)
-			    			beta += process.mbp_rollbias_port;
-					mb_rollpitch_to_takeoff(
-						verbose,
-						alpha, beta,
-						&angles[i], &angles_forward[i],
-						&error);
-					}
-
-				/* add heave and draft */
-				depth_offset_use = bheave[i] + draft + lever_heave;
-
-				/* check depth_offset - use static shift if depth_offset negative */
-				if (depth_offset_use >= depth[0])
-				    {
-				    static_shift = 0.0;
-				    }
-				else
-				    {
-				    static_shift = depth_offset_use - depth[0];
-
-				    if (verbose > 0)
-				    	{
-					fprintf(stderr, "\nWarning: Sonar depth is shallower than the top\n");
-					fprintf(stderr, "of the SVP - transducers above water?!\n");
-					fprintf(stderr, "Raytracing performed from top of SVP followed by static shift.\n");
-					fprintf(stderr, "Sonar depth is sum of heave + draft (or transducer depth).\n");
-					fprintf(stderr, "Draft from data:       %f\n", draft);
-					fprintf(stderr, "Heave from data:       %f\n", bheave[i]);
-					fprintf(stderr, "Heave from lever calc: %f\n", lever_heave);
-					fprintf(stderr, "User specified draft:  %f\n", process.mbp_draft);
-					fprintf(stderr, "Depth offset used:     %f\n", depth_offset_use);
-					fprintf(stderr, "Data Record: %d\n",odata);
-					fprintf(stderr, "Ping time:  %4d %2d %2d %2d:%2d:%2d.%6d\n",
-						time_i[0], time_i[1], time_i[2],
-						time_i[3], time_i[4], time_i[5], time_i[6]);
-	    				}
-				    }
-/* fprintf(stderr,"draft_org:%f draft:%f depth_offset_use:%f static_shift:%f\n",
-draft_org,draft,depth_offset_use,static_shift);*/
-
-				/* raytrace */
-				status = mb_rt(verbose, rt_svp, (depth_offset_use - static_shift),
-					angles[i], 0.5*ttimes[i],
-					process.mbp_angle_mode, ssv, angles_null[i],
-					0, NULL, NULL, NULL,
-					&xx, &zz,
-					&ttime, &ray_stat, &error);
-
-				/* apply static shift if any */
-				zz += static_shift;
-
-/* fprintf(stderr,"PING:%4d %2d %2d %2d:%2d:%2d.%6d BEAM:%d depth_offset_use:%f draft:%f bheave:%f lever_heave:%f angle:%f tt:%f mode:%d ssv:%f null:%f xx:%f zz:%f tt:%f\n",
-time_i[0], time_i[1], time_i[2], time_i[3], time_i[4], time_i[5], time_i[6],i,
-depth_offset_use,draft,bheave[i],lever_heave,angles[i], 0.5*ttimes[i],process.mbp_angle_mode, ssv, angles_null[i],
-xx,zz,ttime); */
-/* fprintf(stderr, "%d %d : heave:%f draft:%f %f depth_offset:%f static:%f zz:%f\n",
-idata, i, bheave[i], draft, draft_org, depth_offset_use, static_shift, zz);*/
-/* fprintf(stderr,"COMPARE %d X:%f %f Y:%f %f Z:%f %f     %.3f %.3f %.3f\n",
-i,bathacrosstrack[i],xx*cos(DTR*angles_forward[i]),
-bathalongtrack[i],xx*sin(DTR*angles_forward[i]),
-bath[i],zz,
-bathacrosstrack[i]-xx*cos(DTR*angles_forward[i]),
-bathalongtrack[i]-xx*sin(DTR*angles_forward[i]),
-bath[i]-zz); */
-
-				/* get alongtrack and acrosstrack distances
-					and depth */
-				bathacrosstrack[i] = xx*cos(DTR*angles_forward[i]);
-				bathalongtrack[i] = xx*sin(DTR*angles_forward[i]) + alongtrack_offset[i];
-				bath[i] = zz;
-
-				/* output some debug values */
-				if (verbose >= 5)
-				    fprintf(stderr,"dbg5       %3d %3d %6.3f %6.3f %6.3f %8.2f %8.2f %8.2f\n",
-					idata, i, 0.5*ttimes[i], angles[i], angles_forward[i],
-					bathacrosstrack[i], bathalongtrack[i], bath[i]);
-
-				/* output some debug messages */
-				if (verbose >= 5)
-				    {
-				    fprintf(stderr,"\ndbg5  Depth value calculated in program <%s>:\n",program_name);
-				    fprintf(stderr,"dbg5       kind:  %d\n",kind);
-				    fprintf(stderr,"dbg5       beam:  %d\n",i);
-				    fprintf(stderr,"dbg5       tt:     %f\n",ttimes[i]);
-				    fprintf(stderr,"dbg5       xx:     %f\n",xx);
-				    fprintf(stderr,"dbg5       zz:     %f\n",zz);
-				    fprintf(stderr,"dbg5       xtrack: %f\n",bathacrosstrack[i]);
-				    fprintf(stderr,"dbg5       ltrack: %f\n",bathalongtrack[i]);
-				    fprintf(stderr,"dbg5       depth:  %f\n",bath[i]);
-				    }
-				}
-
-			      /* else if no travel time no data */
-			      else
-				beamflag[i] = MB_FLAG_NULL;
-			      }
-			    }
-
-			/* recalculate bathymetry by rigid rotations  */
-			else if (process.mbp_bathrecalc_mode == MBP_BATHRECALC_ROTATE)
-			    {
-			    /* loop over the beams */
-			    for (i=0;i<nbath;i++)
-			      {
-			      if (beamflag[i] != MB_FLAG_NULL)
-				{
-				/* output some debug messages */
-				if (verbose >= 5)
-				    {
-				    fprintf(stderr,"\ndbg5  Depth value to be calculated in program <%s>:\n",program_name);
-				    fprintf(stderr,"dbg5       kind:  %d\n",kind);
-				    fprintf(stderr,"dbg5       beam:  %d\n",i);
-				    fprintf(stderr,"dbg5       xtrack: %f\n",bathacrosstrack[i]);
-				    fprintf(stderr,"dbg5       ltrack: %f\n",bathalongtrack[i]);
-				    fprintf(stderr,"dbg5       depth:  %f\n",bath[i]);
-				    }
-
-				/* add heave and draft */
-				depth_offset_use = bheave[i] + draft + lever_heave;
-				depth_offset_org = bheave[i] + draft_org;
-
-				/* strip off heave + draft */
-				bath[i] -= depth_offset_org;
-
-				/* get range and angles in
-				    roll-pitch frame */
-				range = sqrt(bath[i] * bath[i]
-					    + bathacrosstrack[i]
-						* bathacrosstrack[i]
-					    + bathalongtrack[i]
-						* bathalongtrack[i]);
-                                if (fabs(range) < 0.001)
-                                        {
-                                        alphar = 0.0;
-                                        betar = 0.5 * M_PI;
-                                        }
-                                else
-                                        {
-                                        alphar = asin(MAX(-1.0, MIN(1.0, (bathalongtrack[i] / range))));
-                                        betar = acos(MAX(-1.0, MIN(1.0, (bathacrosstrack[i] / range / cos(alphar)))));
-                                        }
-                                if (bath[i] < 0.0)
-                                        betar = 2.0 * M_PI - betar;
-
-				/* apply roll pitch corrections */
-                                if (process.mbp_nav_attitude == MBP_NAV_ON
-                                        || process.mbp_attitude_mode == MBP_ATTITUDE_ON)
-                                        {
-                                        betar += DTR * (roll - roll_org);
-                                        alphar += DTR * (pitch - pitch_org);
-                                        }
-				if (process.mbp_pitchbias_mode == MBP_PITCHBIAS_ON)
-			    		alphar += DTR * process.mbp_pitchbias;
-			    	if (process.mbp_rollbias_mode == MBP_ROLLBIAS_SINGLE)
-			    		betar += DTR * process.mbp_rollbias;
-			    	else if (process.mbp_rollbias_mode == MBP_ROLLBIAS_DOUBLE
-					&& betar <= M_PI * 0.5)
-			    		betar += DTR * process.mbp_rollbias_stbd;
-			    	else if (process.mbp_rollbias_mode == MBP_ROLLBIAS_DOUBLE)
-			    		betar += DTR * process.mbp_rollbias_port;
-
-				/* recalculate bathymetry */
-				bath[i] = range * cos(alphar) * sin(betar);
-				bathalongtrack[i] = range * sin(alphar);
-				bathacrosstrack[i] = range * cos(alphar) * cos(betar);
-
-				/* add heave and draft back in */
-				bath[i] += depth_offset_use;
-
-				/* output some debug values */
-				if (verbose >= 5)
-				    fprintf(stderr,"dbg5       %3d %3d %8.2f %8.2f %8.2f\n",
-					idata, i,
-					bathacrosstrack[i],
-					bathalongtrack[i],
-					bath[i]);
-
-				/* output some debug messages */
-				if (verbose >= 5)
-				    {
-				    fprintf(stderr,"\ndbg5  Depth value calculated in program <%s>:\n",program_name);
-				    fprintf(stderr,"dbg5       kind:  %d\n",kind);
-				    fprintf(stderr,"dbg5       beam:  %d\n",i);
-				    fprintf(stderr,"dbg5       xtrack: %f\n",bathacrosstrack[i]);
-				    fprintf(stderr,"dbg5       ltrack: %f\n",bathalongtrack[i]);
-				    fprintf(stderr,"dbg5       depth:  %f\n",bath[i]);
-				    }
-				}
-			      }
-			    }
-
-			/* recalculate bathymetry by changes to transducer depth  */
-			else if (process.mbp_bathrecalc_mode == MBP_BATHRECALC_OFFSET
-				|| process.mbp_navadj_mode == MBP_NAVADJ_LLZ)
-			    {
-			    /* get draft change */
-			    depth_offset_change = draft - draft_org + lever_heave;
-/* fprintf(stderr, "time:%f  drafts:%f %f  lever:%f  depth_offset_change:%f\n",
-time_d, draft, draft_org, lever_heave, depth_offset_change);*/
-
-			    /* loop over the beams */
-			    for (i=0;i<nbath;i++)
-			      {
-			      if (beamflag[i] != MB_FLAG_NULL)
-				{
-				/* apply transducer depth change to depths */
-				bath[i] += depth_offset_change;
-/* fprintf(stderr,"depth_offset_change:%f bath[%d]:%f\n",depth_offset_change,i,bath[i]);*/
-
-				/* output some debug values */
-				if (verbose >= 5)
-				    fprintf(stderr,"dbg5       %3d %3d %8.2f %8.2f %8.2f\n",
-					idata, i,
-					bathacrosstrack[i],
-					bathalongtrack[i],
-					bath[i]);
-
-				/* output some debug messages */
-				if (verbose >= 5)
-				    {
-				    fprintf(stderr,"\ndbg5  Depth value calculated in program <%s>:\n",program_name);
-				    fprintf(stderr,"dbg5       kind:  %d\n",kind);
-				    fprintf(stderr,"dbg5       beam:  %d\n",i);
-				    fprintf(stderr,"dbg5       xtrack: %f\n",bathacrosstrack[i]);
-				    fprintf(stderr,"dbg5       ltrack: %f\n",bathalongtrack[i]);
-				    fprintf(stderr,"dbg5       depth:  %f\n",bath[i]);
-				    }
-				}
-			      }
-/*fprintf(stderr, "time:%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d draft:%f depth_offset_change:%f\n",
-time_i[0], time_i[1], time_i[2], time_i[3],
-time_i[4], time_i[5], time_i[6], draft, depth_offset_change);*/
-			    }
-
-	/*--------------------------------------------
-	  change water sound reference if needed
-	  --------------------------------------------*/
-
-			/* change bathymetry water sound reference if required */
-			if (process.mbp_svp_mode == MBP_SVP_SOUNDSPEEDREF
-			    || (process.mbp_svp_mode == MBP_SVP_ON
-				&& process.mbp_corrected == MB_NO))
-			    {
-			    for (i=0;i<nbath;i++)
-				{
-				if (beamflag[i] != MB_FLAG_NULL)
-				    {
-				    /* calculate average water sound speed
-					for current depth value */
-				    depth_offset_use = bheave[i] + draft + lever_heave;
-				    zz = bath[i] - depth_offset_use;
-				    k = -1;
-				    for (j=0;j<nsvp-1;j++)
-					{
-					if ((depth[j] < zz) && (depth[j+1] >= zz))
-					    k = j;
-					}
-				    if (k > 0)
-					vsum = velocity_sum[k-1];
-				    else
-					vsum = 0.0;
-				    if (k >= 0)
-					{
-					vsum += 0.5*(2*velocity[k]
-					    + (zz - depth[k])*(velocity[k+1] - velocity[k])
-					    /(depth[k+1] - depth[k]))*(zz - depth[k]);
-					vavg = vsum / zz;
-					}
-				    if (vavg <= 0.0) vavg = 1500.0;
-
-				    /* if uncorrected value desired */
-				    if (process.mbp_corrected == MB_NO)
-					bath[i] = zz * 1500.0 / vavg + depth_offset_use;
-				    else
-					bath[i] = zz * vavg / 1500.0 + depth_offset_use;
-
-				    }
-				}
-			    }
-
-	/*--------------------------------------------
-	  apply per-beam static offsets
-	  --------------------------------------------*/
-
-			/* apply static corrections */
-			if (process.mbp_static_mode == MBP_STATIC_BEAM_ON
-			    && nstatic > 0
-			    && nstatic <= nbath)
-			    {
-			    for (i=0;i<nstatic;i++)
-				{
-				if (staticbeam[i] >= 0
-				    && staticbeam[i] < nbath)
-				    {
-				    if (beamflag[staticbeam[i]] != MB_FLAG_NULL)
-					bath[staticbeam[i]] -= staticoffset[i];
-				    }
-				}
-			    }
-			
-	/*--------------------------------------------
-	  apply per-angle static offsets
-	  --------------------------------------------*/
-
-			/* apply static corrections */
-			if (process.mbp_static_mode == MBP_STATIC_ANGLE_ON
-			    && nstatic > 0)
-			    {
-			    mb_pr_set_bathyslope(verbose,
-						nsmooth,
-						nbath,
-						beamflag,
-						bath,
-						bathacrosstrack,
-						&ndepths,
-						depths,
-						depthacrosstrack,
-						&nslopes,
-						slopes,
-						slopeacrosstrack,
-						depthsmooth,
-						&error);
-			    for (i=0;i<nbath;i++)
-			    {
-				if (mb_beam_ok(beamflag[i]))
-			    	{
-					bathy = 0.0;
-			    		if (ndepths > 1)
-					{
-						status = mb_pr_get_bathyslope(verbose,
-									ndepths,
-				 					depths,
-				    					depthacrosstrack,
-				    					nslopes,
-				    					slopes,
-				    					slopeacrosstrack,
-				    					bathacrosstrack[i],
-				    					&bathy,&slope,&error);
-				    		if (bathy <= 0.0)
-						{
-							if (altitude > 0.0)
-								bathy = altitude + sonardepth;
-							else
-								bathy = altitude_default + sonardepth;
-							slope = 0.0;
-						}
-		    				if (bathy > 0.0)
-						{
-							altitude_use = bathy - sonardepth;
-							angle = RTD * atan(bathacrosstrack[i] / altitude_use);
-										    					
-						   	/* Get offset from SBO file */
-						   	status = mb_linear_interp(verbose,
-									staticangle-1, staticoffset-1,
-									nstatic, angle, &correction, &itime,
-									&error);
-							bath[i] -= correction;
-								
-						}
-				    	      }
-				    	}
-				    		
-				    }
-			    }
-			    
-
-			/* output some debug messages */
-			if (verbose >= 5)
-			    {
-			    fprintf(stderr,"\ndbg5  Depth values calculated in program <%s>:\n",program_name);
-			    fprintf(stderr,"dbg5       kind:  %d\n",kind);
-			    fprintf(stderr,"dbg5      beam    ttime      depth        xtrack    ltrack      flag\n");
-			    for (i=0;i<nbath;i++)
-				fprintf(stderr,"dbg5       %2d   %f   %f   %f   %f   %d\n",
-				    i,ttimes[i],
-				    bath[i],bathacrosstrack[i],
-				    bathalongtrack[i],beamflag[i]);
-			    }
-			}
-
-	/*--------------------------------------------
-	  apply beam edits
-	  --------------------------------------------*/
-
-		/* apply the saved edits */
-		if (process.mbp_edit_mode == MBP_EDIT_ON
-		    && esf.nedit > 0
-		    && error == MB_ERROR_NO_ERROR
-		    && kind == MB_DATA_DATA)
-		    {
-		    /* apply edits for this ping */
-		    status = mb_esf_apply(verbose, &esf,
-		    		time_d, pingmultiplicity, nbath,
-				beamflag, &error);
-		    }
-
-	/*--------------------------------------------
-	  apply data cutting to bathymetry
-	  --------------------------------------------*/
-
-		/* apply data cutting to bathymetry if specified */
-		if (process.mbp_cut_num > 0
-		    && error == MB_ERROR_NO_ERROR
-		    && kind == MB_DATA_DATA)
-		    {
-		    for (icut=0;icut<process.mbp_cut_num;icut++)
-			{
-			/* flag data according to beam number range */
-			if (process.mbp_cut_kind[icut] == MBP_CUT_DATA_BATH
-			    && process.mbp_cut_mode[icut] == MBP_CUT_MODE_NUMBER)
-			    {
-			    istart = MAX((int)process.mbp_cut_min[icut], 0);
-			    iend = MIN((int)process.mbp_cut_max[icut], nbath - 1);
-			    for (i=istart;i<=iend;i++)
-				{
-				if (mb_beam_ok(beamflag[i]))
-					beamflag[i]= MB_FLAG_FLAG + MB_FLAG_MANUAL;
-				}
-			    }
-
-			/* flag data according to beam
-				acrosstrack distance */
-			else if (process.mbp_cut_kind[icut] == MBP_CUT_DATA_BATH
-			    && process.mbp_cut_mode[icut] == MBP_CUT_MODE_DISTANCE)
-			    {
-			    for (i=0;i<nbath;i++)
-				{
-				if (mb_beam_ok(beamflag[i])
-				    && bathacrosstrack[i] >= process.mbp_cut_min[icut]
-				    && bathacrosstrack[i] <= process.mbp_cut_max[icut])
-					beamflag[i]= MB_FLAG_FLAG + MB_FLAG_MANUAL;
-				}
-			    }
-
-			/* flag data according to speed */
-			else if (process.mbp_cut_kind[icut] == MBP_CUT_DATA_BATH
-			    && process.mbp_cut_mode[icut] == MBP_CUT_MODE_SPEED)
-			    {
-			    if (speed < process.mbp_cut_min[icut]
-				|| speed > process.mbp_cut_max[icut])
-				{
-				for (i=0;i<nbath;i++)
-				    {
-				    if (mb_beam_ok(beamflag[i]))
-					    beamflag[i]= MB_FLAG_FLAG + MB_FLAG_MANUAL;
-				    }
-				}
-			    }
-			}
-		    }
-
-	/*--------------------------------------------
-	  insert data as altered so far (not done yet)
-	  --------------------------------------------*/
-
-		/* insert the altered navigation if available */
-		if (error == MB_ERROR_NO_ERROR
-			&& (kind == MB_DATA_DATA
-			    || kind == MB_DATA_NAV))
-			{
-if (heading < 0.0)
-fprintf(stderr,"INSERTING NEGATIVE HEADING:%f\n",heading);
-			status = mb_insert_nav(verbose,imbio_ptr,store_ptr,
-					time_i,time_d,navlon,navlat,
-					speed,heading,draft,roll,pitch,heave,&error);
-			}
-
-		/* insert the altered bathymetry, recalculate the sidescan,
-			and extract the results if desired */
-		if (process.mbp_ssrecalc_mode == MBP_SSRECALC_ON
-		    && error == MB_ERROR_NO_ERROR
-			&& kind == MB_DATA_DATA)
-			{
-			status = mb_insert(verbose,imbio_ptr,
-					store_ptr,kind,
-					time_i,time_d,
-					navlon,navlat,speed,heading,
-					nbath,namp,nss,
-					beamflag,bath,amp,bathacrosstrack,bathalongtrack,
-					ss,ssacrosstrack,ssalongtrack,
-					comment,&error);
-                        if (process.mbp_format == MBF_EM300MBA)
-			status = mbsys_simrad2_makess(verbose,
-					imbio_ptr,store_ptr,
-					pixel_size_set,&pixel_size,
-					swath_width_set,&swath_width,
-					pixel_int,
-					&error);
-                        else if (process.mbp_format == MBF_EM710MBA)
-			status = mbsys_simrad3_makess(verbose,
-					imbio_ptr,store_ptr,
-					pixel_size_set,&pixel_size,
-					swath_width_set,&swath_width,
-					pixel_int,
-					&error);
-                        else if (process.mbp_format == MBF_RESON7KR)
-			status = mbsys_reson7k_makess(verbose,
-					imbio_ptr,store_ptr,
-					R7KRECID_7kV2SnippetData,
-                                        pixel_size_set,&pixel_size,
-					swath_width_set,&swath_width,
-					pixel_int,
-					&error);
-			status = mb_extract(verbose,imbio_ptr,store_ptr,&kind,
-					time_i,&time_d,&navlon,&navlat,
-					&speed,&heading,
-					&nbath,&namp,&nss,
-					beamflag,bath,amp,
-					bathacrosstrack,bathalongtrack,
-					ss,ssacrosstrack,ssalongtrack,
-					comment,&error);
-			}
-
-	/*--------------------------------------------
-	  apply data cutting to amplitude and sidescan
-	  --------------------------------------------*/
-
-		/* apply data cutting to sidescan and amplitude if specified */
-		if (process.mbp_cut_num > 0
-		    && error == MB_ERROR_NO_ERROR
-		    && kind == MB_DATA_DATA)
-		    {
-		    for (icut=0;icut<process.mbp_cut_num;icut++)
-			{
-
-			/* flag data according to beam number range */
-			if (process.mbp_cut_kind[icut] == MBP_CUT_DATA_AMP
-			    && process.mbp_cut_mode[icut] == MBP_CUT_MODE_NUMBER)
-			    {
-			    istart = MAX((int)process.mbp_cut_min[icut], 0);
-			    iend = MIN((int)process.mbp_cut_max[icut], namp - 1);
-			    for (i=istart;i<=iend;i++)
-				{
-				if (mb_beam_ok(beamflag[i]))
-					beamflag[i]= MB_FLAG_FLAG + MB_FLAG_MANUAL;
-				}
-			    }
-
-			/* flag data according to beam
-				acrosstrack distance */
-			else if (process.mbp_cut_kind[icut] == MBP_CUT_DATA_AMP
-			    && process.mbp_cut_mode[icut] == MBP_CUT_MODE_DISTANCE)
-			    {
-			    for (i=0;i<namp;i++)
-				{
-				if (mb_beam_ok(beamflag[i])
-				    && bathacrosstrack[i] >= process.mbp_cut_min[icut]
-				    && bathacrosstrack[i] <= process.mbp_cut_max[icut])
-					beamflag[i]= MB_FLAG_FLAG + MB_FLAG_MANUAL;
-				}
-			    }
-
-			/* flag data according to speed */
-			else if (process.mbp_cut_kind[icut] == MBP_CUT_DATA_AMP
-			    && process.mbp_cut_mode[icut] == MBP_CUT_MODE_SPEED)
-			    {
-			    if (speed < process.mbp_cut_min[icut]
-				|| speed > process.mbp_cut_max[icut])
-				{
-				for (i=0;i<namp;i++)
-				    {
-				    amp[i] = 0.0;
-				    }
-				}
-			    }
-
-			/* flag data according to pixel number range */
-			else if (process.mbp_cut_kind[icut] == MBP_CUT_DATA_SS
-			    && process.mbp_cut_mode[icut] == MBP_CUT_MODE_NUMBER)
-			    {
-			    istart = MAX((int)process.mbp_cut_min[icut], 0);
-			    iend = MIN((int)process.mbp_cut_max[icut], nss - 1);
-			    for (i=istart;i<=iend;i++)
-				{
-				ss[i] = MB_SIDESCAN_NULL;
-				}
-			    }
-
-			/* flag data according to pixel
-				acrosstrack distance */
-			else if (process.mbp_cut_kind[icut] == MBP_CUT_DATA_SS
-			    && process.mbp_cut_mode[icut] == MBP_CUT_MODE_DISTANCE)
-			    {
-			    for (i=0;i<nss;i++)
-				{
-				if (ssacrosstrack[i] >= process.mbp_cut_min[icut]
-				    && ssacrosstrack[i] <= process.mbp_cut_max[icut])
-					ss[i]= MB_SIDESCAN_NULL;
-				}
-			    }
-
-			/* flag data according to speed */
-			else if (process.mbp_cut_kind[icut] == MBP_CUT_DATA_SS
-			    && process.mbp_cut_mode[icut] == MBP_CUT_MODE_SPEED)
-			    {
-			    if (speed < process.mbp_cut_min[icut]
-				|| speed > process.mbp_cut_max[icut])
-				{
-				for (i=0;i<nss;i++)
-				    {
-				    ss[i] = MB_SIDESCAN_NULL;
-				    }
-				}
-			    }
-			}
-		    }
-
-	/*--------------------------------------------
-	  apply grazing angle corrections to amplitude and sidescan
-	  --------------------------------------------*/
-
-	  	/* correct amplitude and sidescan using slopes from multibeam swath data */
-		if ((process.mbp_ampcorr_mode == MBP_AMPCORR_ON
-				&& (process.mbp_ampcorr_slope == MBP_AMPCORR_IGNORESLOPE
-					|| process.mbp_ampcorr_slope == MBP_AMPCORR_USESLOPE))
-			|| (process.mbp_sscorr_mode == MBP_SSCORR_ON
-				&& (process.mbp_sscorr_slope == MBP_SSCORR_IGNORESLOPE
-					|| process.mbp_sscorr_slope == MBP_SSCORR_USESLOPE)))
-			{
-			/* get seafloor slopes if needed for amplitude or sidescan correction */
-			if (error == MB_ERROR_NO_ERROR
-				&& kind == MB_DATA_DATA
-				&& ((process.mbp_ampcorr_mode == MBP_AMPCORR_ON
-					&& nampcorrtable > 0
-					&& nampcorrangle > 0)
-					||
-					(process.mbp_sscorr_mode == MBP_SSCORR_ON
-					&& nsscorrtable > 0
-					&& nsscorrangle > 0)
-					))
-				{
-				mb_pr_set_bathyslope(verbose,
-						nsmooth,
-						nbath,
-						beamflag,
-						bath,
-						bathacrosstrack,
-						&ndepths,
-						depths,
-						depthacrosstrack,
-						&nslopes,
-						slopes,
-						slopeacrosstrack,
-						depthsmooth,
-						&error);
-				}
-
-			/* correct the amplitude if desired */
-			if (process.mbp_ampcorr_mode == MBP_AMPCORR_ON
-			    && error == MB_ERROR_NO_ERROR
-				&& kind == MB_DATA_DATA
-				&& nampcorrtable > 0
-				&& nampcorrangle > 0)
-				{
-				/* calculate the correction table */
-				status = get_corrtable(verbose,
-					    time_d,
-					    nampcorrtable, nampcorrangle,
-					    ampcorrtable, &ampcorrtableuse,
-					    &error);
-
-				/* set the reference amplitudes */
-				status = get_anglecorr(verbose,
-							ampcorrtableuse.nangle,
-							ampcorrtableuse.angle,
-							ampcorrtableuse.amplitude,
-							(-process.mbp_ampcorr_angle),
-							&reference_amp_port,
-							&error);
-				status = get_anglecorr(verbose,
-							ampcorrtableuse.nangle,
-							ampcorrtableuse.angle,
-							ampcorrtableuse.amplitude,
-							process.mbp_ampcorr_angle,
-							&reference_amp_stbd,
-							&error);
-				reference_amp = 0.5 * (reference_amp_port
-								+ reference_amp_stbd);
-	/*fprintf(stderr, "itable:%d time:%f nangle:%d\n",
-	itable, ampcorrtableuse.time_d,
-	ampcorrtableuse.nangle);
-	for (i=0;i<ampcorrtableuse.nangle;i++)
-	fprintf(stderr,"i:%d angle:%f amplitude:%f sigma:%f\n",
-	i,ampcorrtableuse.angle[i],ampcorrtableuse.amplitude[i],ampcorrtableuse.sigma[i]);*/
-
-				/* get seafloor slopes */
-		    		for (i=0;i<namp;i++)
-					{
-					if (mb_beam_ok(beamflag[i]))
-			    			{
-						bathy = 0.0;
-			    			if (ndepths > 1)
-							{
-							status = mb_pr_get_bathyslope(verbose,
-				    					ndepths,
-				    					depths,
-				    					depthacrosstrack,
-				    					nslopes,
-				    					slopes,
-				    					slopeacrosstrack,
-				    					bathacrosstrack[i],
-				    					&bathy,&slope,&error);
-							if (status != MB_SUCCESS)
-				    				{
-				    				bathy = 0.0;
-				    				slope = 0.0;
-				    				status = MB_SUCCESS;
-				    				error = MB_ERROR_NO_ERROR;
-				    				}
-							}
-			    			if (bathy <= 0.0)
-							{
-							if (altitude > 0.0)
-								bathy = altitude + sonardepth;
-							else
-								bathy = altitude_default + sonardepth;
-							slope = 0.0;
-							}
-
-			    			if (bathy > 0.0)
-							{
-							altitude_use = bathy - sonardepth;
-							angle = RTD * atan(bathacrosstrack[i] / altitude_use);
-							if (process.mbp_ampcorr_slope != MBP_AMPCORR_IGNORESLOPE)
-							   angle += RTD * atan(slope);
-							status = get_anglecorr(verbose,
-									ampcorrtableuse.nangle,
-									ampcorrtableuse.angle,
-									ampcorrtableuse.amplitude,
-									angle, &correction, &error);
-/*fprintf(stderr, "ping:%d beam:%d slope:%f angle:%f corr:%f reference:%f amp: %f",
-j, i, slope, angle, correction, reference_amp, amp[i]);*/
-							if (process.mbp_ampcorr_type == MBP_AMPCORR_SUBTRACTION)
-				    				amp[i] = amp[i] - correction + reference_amp;
-							else
-				    				amp[i] = amp[i] / correction * reference_amp;
-/*fprintf(stderr, " amp: %f\n", amp[i]);*/
-							}
-			    			}
-					}
-				}
-
-			/* correct the sidescan if desired */
-			if (process.mbp_sscorr_mode == MBP_SSCORR_ON
-			    && error == MB_ERROR_NO_ERROR
-				&& kind == MB_DATA_DATA
-				&& nsscorrtable > 0
-				&& nsscorrangle > 0)
-				{
-				/* calculate the correction table */
-				status = get_corrtable(verbose,
-					    time_d,
-					    nsscorrtable, nsscorrangle,
-					    sscorrtable, &sscorrtableuse,
-					    &error);
-
-				/* set the reference amplitudes */
-				status = get_anglecorr(verbose,
-							sscorrtableuse.nangle,
-							sscorrtableuse.angle,
-							sscorrtableuse.amplitude,
-							(-process.mbp_sscorr_angle),
-							&reference_amp_port,
-							&error);
-				status = get_anglecorr(verbose,
-							sscorrtableuse.nangle,
-							sscorrtableuse.angle,
-							sscorrtableuse.amplitude,
-							process.mbp_sscorr_angle,
-							&reference_amp_stbd,
-							&error);
-				reference_amp = 0.5 * (reference_amp_port
-								+ reference_amp_stbd);
-
-	/*fprintf(stderr, "itable:%d time:%f nangle:%d\n",
-	itable, sscorrtableuse.time_d,
-	sscorrtableuse.nangle);
-	for (i=0;i<sscorrtableuse.nangle;i++)
-	fprintf(stderr,"i:%d angle:%f amplitude:%f sigma:%f\n",
-	i,sscorrtableuse.angle[i],sscorrtableuse.amplitude[i],sscorrtableuse.sigma[i]);*/
-
-				/* get seafloor slopes */
-		    		for (i=0;i<pixels_ss;i++)
-					{
-					if (ss[i] > MB_SIDESCAN_NULL)
-			    			{
-						bathy = 0.0;
-			    			if (ndepths > 1)
-							{
-							status = mb_pr_get_bathyslope(verbose,
-				    					ndepths,
-				    					depths,
-				    					depthacrosstrack,
-				    					nslopes,
-				    					slopes,
-				    					slopeacrosstrack,
-				    					ssacrosstrack[i],
-				    					&bathy,&slope,&error);
-							if (status != MB_SUCCESS)
-				    				{
-				    				bathy = 0.0;
-				    				slope = 0.0;
-				    				status = MB_SUCCESS;
-				    				error = MB_ERROR_NO_ERROR;
-				    				}
-							}
-			    			if (bathy <= 0.0)
-							{
-							if (altitude > 0.0)
-								bathy = altitude + sonardepth;
-							else
-								bathy = altitude_default + sonardepth;
-							slope = 0.0;
-							}
-
-			    			if (bathy > 0.0)
-							{
-							altitude_use = bathy - sonardepth;
-							angle = RTD * atan(ssacrosstrack[i] / altitude_use);
-	/*fprintf(stderr,"time_d:%f i:%d xtrack:%f altitude:%f sonardepth:%f bathy:%f altitude_use:%f angle:%f\n",
-	time_d, i, ssacrosstrack[i], altitude, sonardepth, bathy, altitude_use, angle);*/
-							if (process.mbp_sscorr_slope != MBP_SSCORR_IGNORESLOPE)
-							    {
-	/*fprintf(stderr,"SLOPECALC: time_d:%f i:%d angle:%f ",time_d,i,angle);*/
-							    angle += RTD * atan(slope);
-	/*fprintf(stderr,"slope:%f slopeangle:%f angle:%f\n",slope,RTD * atan(slope),angle);*/
-							    }
-							status = get_anglecorr(verbose,
-									sscorrtableuse.nangle,
-									sscorrtableuse.angle,
-									sscorrtableuse.amplitude,
-									angle, &correction, &error);
-/*fprintf(stderr, "ping:%d pixel:%d altitude_use:%f slope:%f angle:%f corr:%f reference:%f ss: %f",
-	idata, i, altitude_use, slope, angle, correction, reference_amp, ss[i]);*/
-							if (process.mbp_sscorr_type == MBP_SSCORR_SUBTRACTION)
-				    				ss[i] = ss[i] - correction + reference_amp;
-							else
-				    				ss[i] = ss[i] / correction * reference_amp;
-/*fprintf(stderr, " ss: %f\n", ss[i]);*/
-							}
-			    			}
-					}
-				}
-			}
-
-	  	/* correct amplitude and sidescan using slopes from topography grid */
-		else if ((process.mbp_ampcorr_mode == MBP_AMPCORR_ON
-				&& (process.mbp_ampcorr_slope == MBP_AMPCORR_USETOPO
-					|| process.mbp_ampcorr_slope == MBP_AMPCORR_USETOPOSLOPE))
-			|| (process.mbp_sscorr_mode == MBP_SSCORR_ON
-				&& (process.mbp_sscorr_slope == MBP_SSCORR_USETOPO
-					|| process.mbp_sscorr_slope == MBP_SSCORR_USETOPOSLOPE)))
-			{
-			/* get distance scaling and heading vector */
-			mb_coor_scale(verbose,navlat,&mtodeglon,&mtodeglat);
-			headingx = sin(heading * DTR);
-			headingy = cos(heading * DTR);
-
-			/* correct the amplitude if desired */
-			if (process.mbp_ampcorr_mode == MBP_AMPCORR_ON
-			    && error == MB_ERROR_NO_ERROR
-				&& kind == MB_DATA_DATA
-				&& nampcorrtable > 0
-				&& nampcorrangle > 0)
-				{
-				/* calculate the correction table */
-				status = get_corrtable(verbose,
-					    time_d,
-					    nampcorrtable, nampcorrangle,
-					    ampcorrtable, &ampcorrtableuse,
-					    &error);
-
-				/* set the reference amplitudes */
-				status = get_anglecorr(verbose,
-							ampcorrtableuse.nangle,
-							ampcorrtableuse.angle,
-							ampcorrtableuse.amplitude,
-							(-process.mbp_ampcorr_angle),
-							&reference_amp_port,
-							&error);
-				status = get_anglecorr(verbose,
-							ampcorrtableuse.nangle,
-							ampcorrtableuse.angle,
-							ampcorrtableuse.amplitude,
-							process.mbp_ampcorr_angle,
-							&reference_amp_stbd,
-							&error);
-				reference_amp = 0.5 * (reference_amp_port
-								+ reference_amp_stbd);
-	/*fprintf(stderr, "itable:%d time:%f nangle:%d\n",
-	itable, ampcorrtableuse.time_d,
-	ampcorrtableuse.nangle);
-	for (i=0;i<ampcorrtableuse.nangle;i++)
-	fprintf(stderr,"i:%d angle:%f amplitude:%f sigma:%f\n",
-	i,ampcorrtableuse.angle[i],ampcorrtableuse.amplitude[i],ampcorrtableuse.sigma[i]);*/
-
-				/* get seafloor slopes */
-		    		for (i=0;i<namp;i++)
-					{
-					if (mb_beam_ok(beamflag[i]))
-			    			{
-						/* get position in grid */
-						r[0] =  headingy * bathacrosstrack[i]
-							+ headingx * bathalongtrack[i];
-						r[1] =  -headingx * bathacrosstrack[i]
-							+ headingy * bathalongtrack[i];
-			        		ix = (navlon + r[0] * mtodeglon - grid.xmin + 0.5 * grid.dx) / grid.dx;
-			        		jy = (navlat + r[1] * mtodeglat - grid.ymin + 0.5 * grid.dy) / grid.dy;
-			        		kgrid = ix * grid.ny + jy;
-			        		kgrid00 = (ix - 1) * grid.ny + jy - 1;
-			        		kgrid01 = (ix - 1) * grid.ny + jy + 1;
-			        		kgrid10 = (ix + 1) * grid.ny + jy - 1;
-			        		kgrid11 = (ix + 1) * grid.ny + jy + 1;
-						if (ix > 0 && ix < grid.nx - 1 && jy > 0 && jy < grid.ny - 1
-							&& grid.data[kgrid] > grid.nodatavalue
-							&& grid.data[kgrid00] > grid.nodatavalue
-							&& grid.data[kgrid01] > grid.nodatavalue
-							&& grid.data[kgrid10] > grid.nodatavalue
-							&& grid.data[kgrid11] > grid.nodatavalue)
-							{
-							/* get look vector for data */
-							bathy = -grid.data[kgrid];
-							r[2] = grid.data[kgrid] + sonardepth;
-							rr = -sqrt(r[0] * r[0] + r[1] * r[1] + r[2] * r[2]);
-							r[0] /= rr;
-							r[1] /= rr;
-							r[2] /= rr;
-
-							/* get normal vector to grid surface */
-							if (process.mbp_ampcorr_slope == MB_YES)
-								{
-								v1[0] = 2.0 * grid.dx / mtodeglon;
-								v1[1] = 2.0 * grid.dy / mtodeglat;
-								v1[2] = grid.data[kgrid11] - grid.data[kgrid00];
-								v2[0] = -2.0 * grid.dx / mtodeglon;
-								v2[1] = 2.0 * grid.dy / mtodeglat;
-								v2[2] = grid.data[kgrid01] - grid.data[kgrid10];
-								v[0] = v1[1] * v2[2] - v2[1] * v1[2];
-								v[1] = v2[0] * v1[2] - v1[0] * v2[2];
-								v[2] = v1[0] * v2[1] - v2[0] * v1[1];
-								vv = sqrt(v[0] * v[0] + v[1] * v[1] + v[2] * v[2]);
-								v[0] /= vv;
-								v[1] /= vv;
-								v[2] /= vv;
-								}
-							else
-								{
-								v[0] = 0.0;
-								v[1] = 0.0;
-								v[2] = 1.0;
-								}
-
-							/* angle between look vector and surface normal
-								is the acos(r dot v) */
-							angle = RTD * acos(r[0] * v[0] + r[1] * v[1] + r[2] *v[2]);
-							if (bathacrosstrack[i] < 0.0)
-								angle = -angle;
-
-/* fprintf(stderr,"i:%d xtrack:%f ltrack:%f depth:%f sonardepth:%f rawangle:%f\n",
-i,bathacrosstrack[i],bathalongtrack[i],bath[i],sonardepth,RTD * atan(bathacrosstrack[i] / (sonardepth + grid.data[kgrid])));
-fprintf(stderr,"ix:%d of %d jy:%d of %d  topo:%f\n",
-ix,grid.nx,jy,grid.ny,grid.data[kgrid]);
-fprintf(stderr,"R:%f %f %f  V1:%f %f %f  V2:%f %f %f  V:%f %f %f  angle:%f\n\n",
-r[0],r[1],r[2],v1[0],v1[1],v1[2],v2[0],v2[1],v2[2],v[0],v[1],v[2],angle);*/
-							}
-						else
-							{
-							if (ix >= 0 && ix < grid.nx && jy >= 0 && jy < grid.ny
-								&& grid.data[kgrid] > grid.nodatavalue)
-							    bathy = -grid.data[kgrid];
-							else
-							    bathy = bath[i];
-							angle = RTD * atan(bathacrosstrack[i] / (bathy - sonardepth));
-							slope = 0.0;
-							}
-
-						/* apply correction */
-						status = get_anglecorr(verbose,
-								ampcorrtableuse.nangle,
-								ampcorrtableuse.angle,
-								ampcorrtableuse.amplitude,
-								angle, &correction, &error);
-/*fprintf(stderr, "ping:%d beam:%d slope:%f angle:%f corr:%f reference:%f amp: %f",
-j, i, slopeangle, angle, correction, reference_amp, amp[i]);*/
-						if (process.mbp_ampcorr_type == MBP_AMPCORR_SUBTRACTION)
-				    			amp[i] = amp[i] - correction + reference_amp;
-						else
-				    			amp[i] = amp[i] / correction * reference_amp;
-/*fprintf(stderr, " amp: %f\n", amp[i]);*/
-			    			}
-					}
-				}
-
-			/* correct the sidescan if desired */
-			if (process.mbp_sscorr_mode == MBP_SSCORR_ON
-			    && error == MB_ERROR_NO_ERROR
-				&& kind == MB_DATA_DATA
-				&& nsscorrtable > 0
-				&& nsscorrangle > 0)
-				{
-				/* calculate the correction table */
-				status = get_corrtable(verbose,
-					    time_d,
-					    nsscorrtable, nsscorrangle,
-					    sscorrtable, &sscorrtableuse,
-					    &error);
-
-				/* set the reference amplitudes */
-				status = get_anglecorr(verbose,
-							sscorrtableuse.nangle,
-							sscorrtableuse.angle,
-							sscorrtableuse.amplitude,
-							(-process.mbp_sscorr_angle),
-							&reference_amp_port,
-							&error);
-				status = get_anglecorr(verbose,
-							sscorrtableuse.nangle,
-							sscorrtableuse.angle,
-							sscorrtableuse.amplitude,
-							process.mbp_sscorr_angle,
-							&reference_amp_stbd,
-							&error);
-				reference_amp = 0.5 * (reference_amp_port
-								+ reference_amp_stbd);
-
-	/*fprintf(stderr, "itable:%d time:%f nangle:%d\n",
-	itable, sscorrtableuse.time_d,
-	sscorrtableuse.nangle);
-	for (i=0;i<sscorrtableuse.nangle;i++)
-	fprintf(stderr,"i:%d angle:%f amplitude:%f sigma:%f\n",
-	i,sscorrtableuse.angle[i],sscorrtableuse.amplitude[i],sscorrtableuse.sigma[i]);*/
-
-				/* get seafloor slopes */
-		    		for (i=0;i<pixels_ss;i++)
-					{
-					if (ss[i] > MB_SIDESCAN_NULL)
-			    			{
-						/* get position in grid */
-						r[0] =  headingy * ssacrosstrack[i]
-							+ headingx * ssalongtrack[i];
-						r[1] =  -headingx * ssacrosstrack[i]
-							+ headingy * ssalongtrack[i];
-			        		ix = (navlon + r[0] * mtodeglon - grid.xmin + 0.5 * grid.dx) / grid.dx;
-			        		jy = (navlat + r[1] * mtodeglat - grid.ymin + 0.5 * grid.dy) / grid.dy;
-			        		kgrid = ix * grid.ny + jy;
-			        		kgrid00 = (ix - 1) * grid.ny + jy - 1;
-			        		kgrid01 = (ix - 1) * grid.ny + jy + 1;
-			        		kgrid10 = (ix + 1) * grid.ny + jy - 1;
-			        		kgrid11 = (ix + 1) * grid.ny + jy + 1;
-						if (ix > 0 && ix < grid.nx - 1 && jy > 0 && jy < grid.ny - 1
-							&& grid.data[kgrid] > grid.nodatavalue
-							&& grid.data[kgrid00] > grid.nodatavalue
-							&& grid.data[kgrid01] > grid.nodatavalue
-							&& grid.data[kgrid10] > grid.nodatavalue
-							&& grid.data[kgrid11] > grid.nodatavalue)
-							{
-							/* get look vector for data */
-							bathy = -grid.data[kgrid];
-							r[2] = grid.data[kgrid] + sonardepth;
-							rr = -sqrt(r[0] * r[0] + r[1] * r[1] + r[2] * r[2]);
-							r[0] /= rr;
-							r[1] /= rr;
-							r[2] /= rr;
-
-							/* get normal vector to grid surface */
-							if (process.mbp_sscorr_slope == MB_YES)
-								{
-								v1[0] = 2.0 * grid.dx / mtodeglon;
-								v1[1] = 2.0 * grid.dy / mtodeglat;
-								v1[2] = grid.data[kgrid11] - grid.data[kgrid00];
-								v2[0] = -2.0 * grid.dx / mtodeglon;
-								v2[1] = 2.0 * grid.dy / mtodeglat;
-								v2[2] = grid.data[kgrid01] - grid.data[kgrid10];
-								v[0] = v1[1] * v2[2] - v2[1] * v1[2];
-								v[1] = v2[0] * v1[2] - v1[0] * v2[2];
-								v[2] = v1[0] * v2[1] - v2[0] * v1[1];
-								vv = sqrt(v[0] * v[0] + v[1] * v[1] + v[2] * v[2]);
-								v[0] /= vv;
-								v[1] /= vv;
-								v[2] /= vv;
-								}
-							else
-								{
-								v[0] = 0.0;
-								v[1] = 0.0;
-								v[2] = 1.0;
-								}
-
-							/* angle between look vector and surface normal
-								is the acos(r dot v) */
-							angle = RTD * acos(r[0] * v[0] + r[1] * v[1] + r[2] *v[2]);
-							if (ssacrosstrack[i] < 0.0)
-								angle = -angle;
-
-		/* fprintf(stderr,"i:%d xtrack:%f ltrack:%f depth:%f sonardepth:%f rawangle:%f\n",
-		i,ssacrosstrack[i],ssalongtrack[i],ss[i],sonardepth,RTD * atan(ssacrosstrack[i] / (sonardepth + grid.data[kgrid])));
-		fprintf(stderr,"ix:%d of %d jy:%d of %d  topo:%f\n",
-		ix,grid.nx,jy,grid.ny,grid.data[kgrid]);
-		fprintf(stderr,"R:%f %f %f  V1:%f %f %f  V2:%f %f %f  V:%f %f %f  angle:%f\n\n",
-		r[0],r[1],r[2],v1[0],v1[1],v1[2],v2[0],v2[1],v2[2],v[0],v[1],v[2],angle);*/
-							}
-						else
-							{
-							if (ix >= 0 && ix < grid.nx && jy >= 0 && jy < grid.ny
-								&& grid.data[kgrid] > grid.nodatavalue)
-							    bathy = -grid.data[kgrid];
-							else if (altitude > 0.0)
-							    bathy = altitude + sonardepth;
-							else
-							    bathy = altitude_default + sonardepth;
-							angle = RTD * atan(bathacrosstrack[i] / (bathy - sonardepth));
-							slope = 0.0;
-							}
-
-						/* apply correction */
-						status = get_anglecorr(verbose,
-								sscorrtableuse.nangle,
-								sscorrtableuse.angle,
-								sscorrtableuse.amplitude,
-								angle, &correction, &error);
-						if (process.mbp_sscorr_type == MBP_SSCORR_SUBTRACTION)
-				    			{
-                                                        ss[i] = ss[i] - correction + reference_amp;
-                                                        }
-						else
-				    			{
-                                                        ss[i] = ss[i] / correction * reference_amp;
-                                                        }
-			    			}
-					}
-				}
-			}
-
-	/*--------------------------------------------
-	  insert the altered data (now done)
-	  --------------------------------------------*/
-
-		/* insert the altered data if available */
-		if (error == MB_ERROR_NO_ERROR
-			&& (kind == MB_DATA_DATA
-			    || kind == MB_DATA_COMMENT))
-			{
-			status = mb_insert(verbose,imbio_ptr,
-					store_ptr,kind,
-					time_i,time_d,
-					navlon,navlat,speed,heading,
-					nbath,namp,nss,
-					beamflag,bath,amp,bathacrosstrack,bathalongtrack,
-					ss,ssacrosstrack,ssalongtrack,
-					comment,&error);
-			}
-
-	/*--------------------------------------------
-	  write the processed data
-	  --------------------------------------------*/
-
-		/* write some data */
-		if (error == MB_ERROR_NO_ERROR
-			|| (kind == MB_DATA_COMMENT
-				&& strip_comments == MB_NO))
-			{
-			status = mb_put_all(verbose,ombio_ptr,
-					store_ptr,MB_NO,kind,
-					time_i,time_d,
-					navlon,navlat,speed,heading,
-					nbath,namp,nss,
-					beamflag,bath,amp,bathacrosstrack,bathalongtrack,
-					ss,ssacrosstrack,ssalongtrack,
-					comment,&error);
-			if (status == MB_SUCCESS)
-				{
-				if (kind == MB_DATA_DATA)
-					odata++;
-				else if (kind == MB_DATA_NAV)
-					onav++;
-				else if (kind == MB_DATA_COMMENT)
-					ocomment++;
-				else
-					oother++;
-				}
-			else
-				{
-				mb_error(verbose,error,&message);
-				fprintf(stderr,"\nMBIO Error returned from function <mb_put>:\n%s\n",message);
-				fprintf(stderr,"\nMultibeam Data Not Written To File <%s>\n",process.mbp_ofile);
-				fprintf(stderr,"Output Record: %d\n",odata+1);
-				fprintf(stderr,"Time: %4d %2d %2d %2d:%2d:%2d.%6d\n",
-					time_i[0],time_i[1],time_i[2],
-					time_i[3],time_i[4],time_i[5],
-					time_i[6]);
-				fprintf(stderr,"\nProgram <%s> Terminated\n",
-					program_name);
-				exit(error);
-				}
-			}
-		}
-
-	/* output beam flagging success info */
-	neditnull = 0;
-	neditduplicate = 0;
-	neditnotused = 0;
-	neditused = 0;
-	for (i=0;i<esf.nedit;i++)
-		{
-		if (esf.edit[i].use == 1000)
-			{
-			neditnull++;
-			if (verbose >= 2)
-			fprintf(stderr,"BEAM FLAG TIED TO NULL BEAM: i:%d edit: %f %d %d   %d\n",
-				i,esf.edit[i].time_d,esf.edit[i].beam,esf.edit[i].action,esf.edit[i].use);
-			}
-		else if (esf.edit[i].use == 100)
-			{
-			neditduplicate++;
-			if (verbose >= 2)
-			fprintf(stderr,"DUPLICATE BEAM FLAG:         i:%d edit: %f %d %d   %d\n",
-				i,esf.edit[i].time_d,esf.edit[i].beam,esf.edit[i].action,esf.edit[i].use);
-			}
-		else if (esf.edit[i].use != 1)
-			{
-			neditnotused++;
-			if (verbose >= 2)
-			fprintf(stderr,"BEAM FLAG NOT USED:          i:%d edit: %f %d %d   %d\n",
-				i,esf.edit[i].time_d,esf.edit[i].beam,esf.edit[i].action,esf.edit[i].use);
-			}
-		else if (esf.edit[i].use == 1)
-			{
-			neditused++;
-			if (verbose >= 2)
-			fprintf(stderr,"BEAM FLAG USED:              i:%d edit: %f %d %d   %d\n",
-				i,esf.edit[i].time_d,esf.edit[i].beam,esf.edit[i].action,esf.edit[i].use);
-			}
-		}
-	if (verbose >= 1)
-		{
-		fprintf(stderr, "          %d flags used\n", neditused);
-		fprintf(stderr, "          %d flags not used\n", neditnotused);
-		fprintf(stderr, "          %d flags tied to null beams\n", neditnull);
-		fprintf(stderr, "          %d duplicate flags\n", neditduplicate);
-		}
-
-	/*--------------------------------------------
-	  close files and deallocate memory
-	  --------------------------------------------*/
-
-	/* close the files */
-	status = mb_close(verbose,&imbio_ptr,&error);
-	status = mb_close(verbose,&ombio_ptr,&error);
-
-	/* unlock the raw swath file */
-	if (uselockfiles == MB_YES)
-		lock_status = mb_pr_unlockswathfile(verbose, process.mbp_ifile,
-						MBP_LOCK_PROCESS, program_name, &lock_error);
-
-	/* deallocate arrays for amplitude correction tables */
-	if (nampcorrtable > 0)
-		{
-		mb_freed(verbose,__FILE__,__LINE__,(void **)&(ampcorrtableuse.angle),&error);
-		mb_freed(verbose,__FILE__,__LINE__,(void **)&(ampcorrtableuse.amplitude),&error);
-		mb_freed(verbose,__FILE__,__LINE__,(void **)&(ampcorrtableuse.sigma),&error);
-		for (i=0;i<nampcorrtable;i++)
-			{
-			mb_freed(verbose,__FILE__,__LINE__,(void **)&(ampcorrtable[i].angle),&error);
-			mb_freed(verbose,__FILE__,__LINE__,(void **)&(ampcorrtable[i].amplitude),&error);
-			mb_freed(verbose,__FILE__,__LINE__,(void **)&(ampcorrtable[i].sigma),&error);
-			}
-		status = mb_mallocd(verbose,__FILE__,__LINE__,size,(void **)&ampcorrtable,&error);
-		}
-
-	/* deallocate arrays for sidescan correction tables */
-	if (nsscorrtable > 0)
-		{
-		mb_freed(verbose,__FILE__,__LINE__,(void **)&(sscorrtableuse.angle),&error);
-		mb_freed(verbose,__FILE__,__LINE__,(void **)&(sscorrtableuse.amplitude),&error);
-		mb_freed(verbose,__FILE__,__LINE__,(void **)&(sscorrtableuse.sigma),&error);
-		for (i=0;i<nsscorrtable;i++)
-			{
-			mb_freed(verbose,__FILE__,__LINE__,(void **)&(sscorrtable[i].angle),&error);
-			mb_freed(verbose,__FILE__,__LINE__,(void **)&(sscorrtable[i].amplitude),&error);
-			mb_freed(verbose,__FILE__,__LINE__,(void **)&(sscorrtable[i].sigma),&error);
-			}
-		status = mb_mallocd(verbose,__FILE__,__LINE__,size,(void **)&sscorrtable,&error);
-		}
-
-	/* deallocate topography grid */
-	if (grid.data != NULL)
-		{
-		mb_freed(verbose,__FILE__,__LINE__,(void **)&grid.data,&error);
-		memset(&grid, 0, sizeof (struct mbprocess_grid_struct));
-		}
-
-	/* deallocate arrays for navigation */
-	if (nnav > 0)
-		{
-		mb_freed(verbose,__FILE__,__LINE__,(void **)&ntime,&error);
-		mb_freed(verbose,__FILE__,__LINE__,(void **)&nlon,&error);
-		mb_freed(verbose,__FILE__,__LINE__,(void **)&nlat,&error);
-		mb_freed(verbose,__FILE__,__LINE__,(void **)&nheading,&error);
-		mb_freed(verbose,__FILE__,__LINE__,(void **)&nspeed,&error);
-		mb_freed(verbose,__FILE__,__LINE__,(void **)&ndraft,&error);
-		mb_freed(verbose,__FILE__,__LINE__,(void **)&nroll,&error);
-		mb_freed(verbose,__FILE__,__LINE__,(void **)&npitch,&error);
-		mb_freed(verbose,__FILE__,__LINE__,(void **)&nheave,&error);
-		mb_freed(verbose,__FILE__,__LINE__,(void **)&nlonspl,&error);
-		mb_freed(verbose,__FILE__,__LINE__,(void **)&nlatspl,&error);
-		}
-
-	/* deallocate arrays for adjusted navigation */
-	if (nanav > 0)
-		{
-		mb_freed(verbose,__FILE__,__LINE__,(void **)&natime,&error);
-		mb_freed(verbose,__FILE__,__LINE__,(void **)&nalon,&error);
-		mb_freed(verbose,__FILE__,__LINE__,(void **)&nalat,&error);
-		mb_freed(verbose,__FILE__,__LINE__,(void **)&nalonspl,&error);
-		mb_freed(verbose,__FILE__,__LINE__,(void **)&nalatspl,&error);
-		}
-
-	/* deallocate arrays for attitude merging */
-	if (nanav > 0)
-		{
-		mb_freed(verbose,__FILE__,__LINE__,(void **)&attitudetime,&error);
-		mb_freed(verbose,__FILE__,__LINE__,(void **)&attituderoll,&error);
-		mb_freed(verbose,__FILE__,__LINE__,(void **)&attitudepitch,&error);
-		mb_freed(verbose,__FILE__,__LINE__,(void **)&attitudeheave,&error);
-		}
-
-	/* deallocate arrays for sonardepth merging */
-	if (nsonardepth > 0)
-		{
-		mb_freed(verbose,__FILE__,__LINE__,(void **)&fsonardepthtime,&error);
-		mb_freed(verbose,__FILE__,__LINE__,(void **)&fsonardepth,&error);
-		}
-
-	/* deallocate arrays for beam edits */
-	if (esf.nedit > 0)
-		{
-		mb_esf_close(verbose,&esf,&error);
-		}
-
-	/* deallocate memory for svp arrays and raytracing */
-	if (process.mbp_svp_mode != MBP_SVP_OFF)
-		{
-		mb_freed(verbose,__FILE__,__LINE__,(void **)&depth,&error);
-		mb_freed(verbose,__FILE__,__LINE__,(void **)&velocity,&error);
-		mb_freed(verbose,__FILE__,__LINE__,(void **)&velocity_sum,&error);
-		if (rt_svp != NULL)
-			status = mb_rt_deall(verbose, &rt_svp, &error);
-		}
-
-	/* check memory */
-	if (verbose >= 4)
-		status = mb_memory_list(verbose,&error);
-
-	/* give the statistics */
-	if (verbose >= 1)
-		{
-		fprintf(stderr,"\n%d input data records\n",idata);
-		fprintf(stderr,"%d input nav records\n",inav);
-		fprintf(stderr,"%d input comment records\n",icomment);
-		fprintf(stderr,"%d input other records\n",iother);
-		fprintf(stderr,"%d output data records\n",odata);
-		fprintf(stderr,"%d output nav records\n",onav);
-		fprintf(stderr,"%d output comment records\n",ocomment);
-		fprintf(stderr,"%d output other records\n",oother);
-		}
-
-	/* generate inf file */
-	if (status == MB_SUCCESS)
-		{
-		status = mb_make_info(verbose, MB_YES,
-					process.mbp_ofile,
-					process.mbp_format,
-					&error);
-		}
-
-	} /* end processing file */
-
-	/* figure out whether and what to read next */
-        if (read_datalist == MB_YES)
-                {
-		if ((status = mb_datalist_read(verbose,datalist,
-			    mbp_ifile,&format,&file_weight,&error))
-			    == MB_SUCCESS)
-                        read_data = MB_YES;
-                else
-                        read_data = MB_NO;
-                }
-        else
-                {
-                read_data = MB_NO;
-                }
-
-
-	} /* end loop over datalist */
-
-	if (read_datalist == MB_YES)
-		mb_datalist_close(verbose,&datalist,&error);
-
-	/* check memory */
-	if (verbose >= 4)
-		status = mb_memory_list(verbose,&error);
-
-
-	/* end it all */
-	exit(error);
-}
-/*--------------------------------------------------------------------*/
-int check_ss_for_bath(int verbose,
-	int nbath, char *beamflag, double *bath, double *bathacrosstrack,
-	int nss, double *ss, double *ssacrosstrack,
-	int *error)
-{
-	char	*function_name = "check_ss_for_bath";
-	int	status = MB_SUCCESS;
-	int	ifirst, ilast;
-	int	iss, ibath;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBPROCESS function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:         %d\n",verbose);
-		fprintf(stderr,"dbg2       nbath:           %d\n",nbath);
-		fprintf(stderr,"dbg2       bath:            %p\n",(void *)bath);
-		fprintf(stderr,"dbg2       bathacrosstrack: %p\n",(void *)bathacrosstrack);
-		fprintf(stderr,"dbg2       bath:\n");
-		for (i=0;i<nbath;i++)
-			fprintf(stderr,"dbg2         %d %f %f\n",
-				i, bath[i], bathacrosstrack[i]);
-		}
-
-	/* find limits of good bathy */
-	ifirst = -1;
-	ilast = -1;
-	i = 0;
-	for (i=0;i<nbath;i++)
-	    {
-	    if (mb_beam_ok(beamflag[i]))
-		{
-		if (ifirst < 0)
-		    ifirst = i;
-		ilast = i;
-		}
-	    }
-
-	/* loop over sidescan looking for bathy on either side
-	   - zero sidescan if bathy lacking */
-	if (ifirst < ilast)
-	    {
-	    ibath = ifirst;
-	    for (iss=0;iss<nss;iss++)
-		{
-		/* make sure ibath sets right interval for ss */
-		while (ibath < ilast - 1
-		    && (!mb_beam_ok(beamflag[ibath])
-			|| !mb_beam_ok(beamflag[ibath+1])
-			|| (mb_beam_ok(beamflag[ibath+1])
-			    && ssacrosstrack[iss] > bathacrosstrack[ibath+1])))
-		    ibath++;
-/*fprintf(stderr,"iss:%d ibath:%d %f %f  %f %f  ss: %f %f\n",
-iss,ibath,bath[ibath],bath[ibath+1],
-bathacrosstrack[ibath],bathacrosstrack[ibath+1],
-ss[iss],ssacrosstrack[iss]);*/
-
-		/* now zero sidescan if not surrounded by good bathy */
-		if (!mb_beam_ok(beamflag[ibath]) || !mb_beam_ok(beamflag[ibath+1]))
-		    ss[iss] = 0.0;
-		else if (ssacrosstrack[iss] < bathacrosstrack[ibath])
-		    ss[iss] = 0.0;
-		else if (ssacrosstrack[iss] > bathacrosstrack[ibath+1])
-		    ss[iss] = 0.0;
-		}
-	    }
-
-	/* else if no good bathy zero all sidescan */
-	else
-	    {
-	    for (iss=0;iss<nss;iss++)
-		{
-		ss[iss] = 0.0;
-		}
-	    }
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBPROCESS function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       error:           %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:          %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int get_corrtable(int verbose,
-	double time_d, int ncorrtable, int ncorrangle,
-	struct mbprocess_sscorr_struct	*corrtable,
-	struct mbprocess_sscorr_struct	*corrtableuse,
-	int *error)
-{
-	char	*function_name = "get_corrtable";
-	int	status = MB_SUCCESS;
-	double	factor;
-	int	ifirst, ilast, irecent, inext;
-	int	i, ii, itable;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBPROCESS function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:     %d\n",verbose);
-		fprintf(stderr,"dbg2       time_d:      %f\n",time_d);
-		fprintf(stderr,"dbg2       ncorrtable:  %d\n",ncorrtable);
-		fprintf(stderr,"dbg2       ncorrangle:  %d\n",ncorrangle);
-		fprintf(stderr,"dbg2       corrtable:   %p\n",(void *)corrtable);
-		}
-
-	/* find the correction table */
-	if (ncorrtable == 1
-		|| time_d <= corrtable[0].time_d)
-		{
-		corrtableuse->time_d = corrtable[0].time_d;
-		corrtableuse->nangle = corrtable[0].nangle;
-		for (i=0;i<ncorrangle;i++)
-			{
-			corrtableuse->angle[i] = corrtable[0].angle[i];
-			corrtableuse->amplitude[i] = corrtable[0].amplitude[i];
-			corrtableuse->sigma[i] = corrtable[0].sigma[i];
-			}
-		}
-	else if (time_d > corrtable[ncorrtable-1].time_d)
-		{
-		corrtableuse->time_d = corrtable[ncorrtable-1].time_d;
-		corrtableuse->nangle = corrtable[ncorrtable-1].nangle;
-		for (i=0;i<ncorrangle;i++)
-			{
-			corrtableuse->angle[i] = corrtable[ncorrtable-1].angle[i];
-			corrtableuse->amplitude[i] = corrtable[ncorrtable-1].amplitude[i];
-			corrtableuse->sigma[i] = corrtable[ncorrtable-1].sigma[i];
-			}
-		}
-	else
-		{
-		itable = 0;
-		for (i=0;i<ncorrtable-1;i++)
-			{
-			if (corrtable[i].time_d <= time_d
-				&& corrtable[i+1].time_d > time_d)
-				itable = i;
-			}
-		factor = (time_d - corrtable[itable].time_d)
-				/ (corrtable[itable+1].time_d
-					- corrtable[itable].time_d);
-		corrtableuse->time_d = time_d;
-		corrtableuse->nangle = MIN(corrtable[itable].nangle,
-						corrtable[itable].nangle);
-		for (i=0;i<corrtableuse->nangle;i++)
-		    {
-		    corrtableuse->angle[i]
-			    = corrtable[itable].angle[i]
-				    + factor * (corrtable[itable+1].angle[i]
-						    - corrtable[itable].angle[i]);
-		    if (corrtable[itable].amplitude[i] != 0.0
-			    && corrtable[itable+1].amplitude[i] != 0.0)
-			{
-			corrtableuse->amplitude[i]
-			    = corrtable[itable].amplitude[i]
-				    + factor * (corrtable[itable+1].amplitude[i]
-						    - corrtable[itable].amplitude[i]);
-			corrtableuse->sigma[i]
-			    = corrtable[itable].sigma[i]
-				    + factor * (corrtable[itable+1].sigma[i]
-						    - corrtable[itable].sigma[i]);
-			}
-		    else if (corrtable[itable].amplitude[i] != 0.0)
-			{
-			corrtableuse->amplitude[i]
-			    = corrtable[itable].amplitude[i];
-			corrtableuse->sigma[i]
-			    = corrtable[itable].sigma[i];
-			}
-		    else
-			{
-			corrtableuse->amplitude[i]
-			    = corrtable[itable+1].amplitude[i];
-			corrtableuse->sigma[i]
-			    = corrtable[itable+1].sigma[i];
-			}
-		    }
-		}
-
-	/* now interpolate or extrapolate any zero values */
-	ifirst = ncorrangle;
-	ilast = -1;
-	for (i=0;i<ncorrangle;i++)
-		{
-		if (corrtableuse->amplitude[i] != 0.0)
-		    {
-		    ifirst = MIN(i, ifirst);
-		    ilast = MAX(i, ilast);
-		    }
-		}
-	for (i=0;i<ncorrangle;i++)
-		{
-		if (corrtableuse->amplitude[i] != 0.0)
-		    irecent = i;
-		if (i < ifirst)
-		    {
-		    corrtableuse->amplitude[i] = corrtableuse->amplitude[ifirst];
-		    corrtableuse->sigma[i] = corrtableuse->sigma[ifirst];
-		    }
-		else if (i > ilast)
-		    {
-		    corrtableuse->amplitude[i] = corrtableuse->amplitude[ilast];
-		    corrtableuse->sigma[i] = corrtableuse->sigma[ilast];
-		    }
-		else if (corrtableuse->amplitude[i] == 0.0)
-		    {
-		    inext = -1;
-		    for (ii=i+1;ii<ilast;ii++)
-			{
-			if (corrtableuse->amplitude[ii] != 0.0
-			    && inext < 0)
-			    inext = ii;
-			}
-		    if (irecent < i && inext > i)
-			{
-			factor = ((double)(i - irecent))
-				/ ((double)(inext - irecent));
-			corrtableuse->amplitude[i]
-			    = corrtableuse->amplitude[irecent]
-				    + factor * (corrtableuse->amplitude[inext]
-						    - corrtableuse->amplitude[irecent]);
-			corrtableuse->sigma[i]
-			    = corrtableuse->sigma[irecent]
-				    + factor * (corrtableuse->sigma[inext]
-						    - corrtableuse->sigma[irecent]);
-			}
-		    }
-		}
-
-	/* assume success */
-	*error = MB_ERROR_NO_ERROR;
-	status = MB_SUCCESS;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBPROCESS function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       ncorrangle:      %d\n",ncorrangle);
-		for (i=0;i<ncorrangle;i++)
-		fprintf(stderr,"dbg2       correction[%d]: %f %f %f\n",
-		    i, corrtableuse->angle[i], corrtableuse->amplitude[i], corrtableuse->sigma[i]);
-		fprintf(stderr,"dbg2       error:           %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:          %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int get_anglecorr(int verbose,
-	int nangle, double *angles, double *corrs,
-	double angle, double *corr, int *error)
-{
-	char	*function_name = "get_anglecorr";
-	int	status = MB_SUCCESS;
-	int	iangle, found;
-	int	ifirst, ilast;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBPROCESS function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       nangle:      %d\n",nangle);
-		fprintf(stderr,"dbg2       angles:      %p\n",(void *)angles);
-		fprintf(stderr,"dbg2       corrs:       %p\n",(void *)corrs);
-		for (i=0;i<nangle;i++)
-			fprintf(stderr,"dbg2           angle[%d]:%f corrs[%d]:%f\n",i,angles[i],i,corrs[i]);
-		fprintf(stderr,"dbg2       angle:       %f\n",angle);
-		}
-
-	/* search for the specified angle */
-	found = MB_NO;
-	for (i=0;i<nangle-1;i++)
-		if (angle >= angles[i] && angle <= angles[i+1])
-			{
-			found = MB_YES;
-			iangle = i;
-			}
-
-	/* interpolate the correction */
-	if (found == MB_YES)
-		{
-		*corr = corrs[iangle]
-			+ (corrs[iangle+1] - corrs[iangle])
-			*(angle - angles[iangle])
-			/(angles[iangle+1] - angles[iangle]);
-		}
-	else if (angle < angles[0])
-		{
-		iangle = 0;
-		*corr = corrs[0];
-		}
-	else if (angle > angles[nangle-1])
-		{
-		iangle = nangle - 1;
-		*corr = corrs[nangle-1];
-		}
-	else
-		*corr = 0.0;
-
-	/* use outermost value if angle outside nonzero range */
-	if (*corr == 0.0)
-		{
-		ifirst = nangle - 1;
-		ilast = 0;
-		for (i=0;i<nangle;i++)
-			{
-			if (corr[i] != 0.0)
-				{
-				if (ifirst > i)
-					ifirst = i;
-				if (ilast < i)
-					ilast = i;
-				}
-			}
-		if (angle < 0.0)
-			*corr = corrs[ifirst];
-		if (angle > 0.0)
-			*corr = corrs[ilast];
-		}
-
-	/* assume success */
-	*error = MB_ERROR_NO_ERROR;
-	status = MB_SUCCESS;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBPROCESS function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       corr:            %f\n",*corr);
-		fprintf(stderr,"dbg2       error:           %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:          %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/utilities/mbps.c b/src/utilities/mbps.c
deleted file mode 100644
index 0bde7bb..0000000
--- a/src/utilities/mbps.c
+++ /dev/null
@@ -1,1111 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbps.c	11/4/93
- *    $Id: mbps.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 1993-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * MBPS is a program that plots an almost correct perspective view
- * of a piece of swath data. Input is some swath data
- * file; output is PostScript code.
- *
- * Authors:	Russ Alexander, UCSB
- *		Alberto Malinverno, L-DEO
- * Date:	September 15, 1993 (version 3)
- * Date:	August 31, 1991 (original version)
- *
- * $Log: mbps.c,v $
- * Revision 5.9  2008/09/13 06:08:09  caress
- * Updates to apply suggested patches to segy handling. Also fixes to remove compiler warnings.
- *
- * Revision 5.8  2006/01/18 15:15:10  caress
- * Had to change ps_text calls to work with pslib from GMT 4.1.
- *
- * Revision 5.7  2005/11/05 01:07:54  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.6  2005/03/25 04:43:01  caress
- * Standardized the string lengths used for filenames and comment data.
- *
- * Revision 5.5  2004/05/21 23:51:19  caress
- * Progress supporting Reson 7k data, including support for extracing subbottom profiler data.
- *
- * Revision 5.4  2003/04/17 21:18:57  caress
- * Release 5.0.beta30
- *
- * Revision 5.3  2001/07/20 00:34:38  caress
- * Release 5.0.beta03
- *
- * Revision 5.2  2001/03/22 21:15:49  caress
- * Trying to make release 5.0.beta0.
- *
- * Revision 5.1  2001/01/22  07:54:22  caress
- * Version 5.0.beta01
- *
- * Revision 5.0  2000/12/01  22:57:08  caress
- * First cut at Version 5.0.
- *
- * Revision 4.16  2000/10/11  01:06:15  caress
- * Convert to ANSI C
- *
- * Revision 4.15  2000/09/30  07:06:28  caress
- * Snapshot for Dale.
- *
- * Revision 4.14  1999/04/16  01:29:39  caress
- * Version 4.6 final release?
- *
- * Revision 4.13  1999/03/31  18:33:06  caress
- * MB-System 4.6beta7
- *
- * Revision 4.12  1999/02/04  23:55:08  caress
- * MB-System version 4.6beta7
- *
- * Revision 4.11  1998/10/05  19:19:24  caress
- * MB-System version 4.6beta
- *
- * Revision 4.10  1997/09/15  19:11:06  caress
- * Real Version 4.5
- *
- * Revision 4.9  1997/04/21  17:19:14  caress
- * MB-System 4.5 Beta Release.
- *
- * Revision 4.8  1996/04/22  13:23:05  caress
- * Now have DTR and MIN/MAX defines in mb_define.h
- *
- * Revision 4.8  1996/04/22  13:23:05  caress
- * Now have DTR and MIN/MAX defines in mb_define.h
- *
- * Revision 4.7  1995/05/12  17:12:32  caress
- * Made exit status values consistent with Unix convention.
- * 0: ok  nonzero: error
- *
- * Revision 4.6  1995/03/06  19:37:59  caress
- * Changed include strings.h to string.h for POSIX compliance.
- *
- * Revision 4.5  1995/03/02  13:49:21  caress
- * Fixed bug related to error messages.
- *
- * Revision 4.4  1994/10/21  13:02:31  caress
- * Release V4.0
- *
- * Revision 4.3  1994/07/29  19:02:56  caress
- * Changes associated with supporting byte swapped Lynx OS and
- * using unix second time base.
- *
- * Revision 4.2  1994/03/08  12:51:05  caress
- * Really fixed mb_format_inf call.
- * l
- *
- * Revision 4.1  1994/03/08  12:44:33  caress
- * Fixed mb_format_info call.
- *
- * Revision 4.0  1994/03/06  00:13:22  caress
- * First cut at version 4.0
- *
- * Revision 4.0  1994/03/01  18:59:27  caress
- * First cut at new version. Any changes are associated with
- * support of three data types (beam bathymetry, beam amplitude,
- * and sidescan) instead of two (bathymetry and backscatter).
- *
- * Revision 1.2  1993/11/04  19:32:28  caress
- * Fixed some details.  PSLIB calls now correct for GMT v 2.1.4
- * and gmtdefs now used in part.  Will need some more cleaning
- * up later.
- *
- * Revision 1.1  1993/11/04  18:09:06  caress
- * Initial revision
- *
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <math.h>
-#include <string.h>
-
-/* GMT include files */
-#include "gmt.h"
-#include "pslib.h"
-
-/* MBIO include files */
-#include "mb_status.h"
-#include "mb_define.h"
-
-/*--------------------------------------------------------------------*/
-
-/* Global defines */
-#define		MBPS_MAXPINGS	1000
-#define 	DY_DEF		(0.1)	/* km */
-#define		DZ_DEF		(-50)	/* m */
-#define		PLOT_XMAX_DEF	5.0
-#define		PLOT_YMAX_DEF	8.0
-#define		VIEWDIR_DEF	'S'
-#define		ALPHA_DEF	70.0
-#define		ETA_DEF		45.0
-#define		BAD		-9999999.99
-#define		VE_DEF		5.0
-
-struct ping
-	{
-	int	beams_bath;
-	char	*beamflag;
-	double	*bath;
-	double	*bathacrosstrack;
-	double	*bathalongtrack;
-	double	*xp;
-	double	*yp;
-	};
-
-int rgb_black[] = {0, 0, 0};
-int rgb_white[] = {255, 255, 255};
-
-static char rcs_id[] = "$Id: mbps.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-
-int main (int argc, char **argv)
-{
-	char program_name[] = "MBPS";
-	char help_message[] =  "MBPS reads a swath bathymetry data file and creates a postscript 3-d mesh plot";
-	char usage_message[] = "mbps [-Iinfile -Fformat -Nnpings -Ppings\n\t-Byr/mo/da/hr/mn/sc -Eyr/mo/da/hr/mn/sc  \n\t-Aalpha -Keta -Dviewdir -Xvertexag \n\t-T\"title\" -Wmetersperinch \n\t-Sspeedmin -Ggap -Ydisplay_stats \n\t-Zdisplay_scales -V -H]";
-	extern char *optarg;
-	int	errflg = 0;
-	int	c;
-	int	help = 0;
-	int	flag = 0;
-
-	/*ALBERTO definitions */
-	int	gap=1;
-	double	*xp, *yp;
-	double	xl[4], yl[4];
-	double	alpha =		ALPHA_DEF;
-	double	eta =		ETA_DEF;
-	double	ve =		VE_DEF;
-	char	viewdir =	VIEWDIR_DEF;
-	int	display_stats = MB_YES;
-	int	display_scales = MB_YES;
-	double	sin_eta, cos_eta;
-	double	sin_alpha, cos_alpha;
-	double	track_length, xscale, zscale, zscale_inch;
-	double	mean_xp=0.0, mean_yp=0.0, min_xp, max_xp, min_yp, max_yp;
-	double	scaling, x_off, y_off;
-	double	min_z, max_z, range_z, meters_per_inch=(-1.0);
-	double	mean_lat=0.0;
-	double	mean_lon=0.0;
-	double	mean_latmin;
-	double	mean_lonmin;
-	double	mean_hdg=0.0;
-	int	done, mean_knt=0;
-	int	orient;
-	char	label[100];
-	int	a, b, rotate;
-	double	x, y, z;
-
-	/* MBIO status variables */
-	int	status = MB_SUCCESS;
-	int	verbose = 0;
-	int	error = MB_ERROR_NO_ERROR;
-	char	*message;
-
-	/* MBIO read control parameters */
-	int	format;
-	int	lonflip;
-	double	bounds[4];
-	int	btime_i[7];
-	int	etime_i[7];
-	double	btime_d;
-	double	etime_d;
-	double	speedmin;
-	double	timegap;
-	char	file[MB_PATH_MAXLINE];
-	int	pings = 1;
-	int	beams_bath;
-	int	beams_amp;
-	int	pixels_ss;
-	int	num_pings_max = MBPS_MAXPINGS;
-
-	/* MBIO read values */
-	void	*mbio_ptr = NULL;
-	int	kind;
-	struct ping data[MBPS_MAXPINGS+3];
-	int	time_i[7];
-	double	time_d;
-	double	navlon;
-	double	navlat;
-	double	speed;
-	double	heading;
-	double	distance;
-	double	altitude;
-	double	sonardepth;
-	char	*beamflag;
-	double	*bath = NULL;
-	double	*bathacrosstrack = NULL;
-	double	*bathalongtrack = NULL;
-	double	*amp = NULL;
-	double	*ss = NULL;
-	double	*ssacrosstrack = NULL;
-	double	*ssalongtrack = NULL;
-	char	comment[MB_COMMENT_MAXLINE];
-	int	timbeg_i[7];
-	int	timend_i[7];
-	double	distot = 0.0;
-	int	nread;
-
-	char	title[MB_COMMENT_MAXLINE];
-	int	forward;
-	double	xx, yy, zz;
-	double	heading_start, dheading, dheadingx, dheadingy;
-	int	i, j, jj, k;
-
-	void Polygon_Fill();
-	void Good_Polygon();
-
-	/* initialize some time variables */
-	for (i=0;i<7;i++)
-		{
-		timbeg_i[i] = 0;
-		timend_i[i] = 0;
-		}
-
-	/* get current default values */
-	status = mb_defaults(verbose,&format,&pings,&lonflip,bounds,
-		btime_i,etime_i,&speedmin,&timegap);
-
-	/* set default input to stdin */
-	strcpy (file, "stdin");
-
-	/* process argument list */
-	while ((c = getopt(argc, argv, "VvHhF:f:B:b:E:e:S:s:T:t:I:i:A:a:X:x:K:k:D:d:N:n:P:p:W:w:G:g:YyZz")) != -1)
-	    switch (c)
-		{
-		case 'H':
-		case 'h':
-			help++;
-			break;
-		case 'V':
-		case 'v':
-			verbose++;
-			break;
-		case 'A':
-		case 'a':
-			sscanf (optarg, "%lf", &alpha);
-			flag++;
-			break;
-		case 'B':
-		case 'b':
-			sscanf (optarg,"%d/%d/%d/%d/%d/%d",
-				&btime_i[0],&btime_i[1],&btime_i[2],
-				&btime_i[3],&btime_i[4],&btime_i[5]);
-			btime_i[6] = 0;
-			flag++;
-			break;
-		case 'D':
-		case 'd':
-			sscanf (optarg, "%c", &viewdir);
-			flag++;
-			break;
-		case 'E':
-		case 'e':
-			sscanf (optarg,"%d/%d/%d/%d/%d/%d",
-				&etime_i[0],&etime_i[1],&etime_i[2],
-				&etime_i[3],&etime_i[4],&etime_i[5]);
-			etime_i[6] = 0;
-			flag++;
-			break;
-		case 'F':
-		case 'f':
-			sscanf (optarg,"%d", &format);
-			flag++;
-			break;
-		case 'G':
-		case 'g':
-			sscanf (optarg, "%d", &gap);
-			flag++;
-			break;
-		case 'I':
-		case 'i':
-			sscanf (optarg,"%s", file);
-			flag++;
-			break;
-		case 'K':
-		case 'k':
-			sscanf (optarg, "%lf", &eta);
-			flag++;
-			break;
-		case 'N':
-		case 'n':
-			sscanf (optarg, "%d", &num_pings_max);
-			if (num_pings_max < 2
-			    || num_pings_max > MBPS_MAXPINGS)
-			num_pings_max = MBPS_MAXPINGS;
-			flag++;
-			break;
-		case 'P':
-		case 'p':
-			sscanf (optarg, "%d", &pings);
-			flag++;
-			break;
-		case 'S':
-		case 's':
-			sscanf (optarg,"%lf", &speedmin);
-			flag++;
-			break;
-		case 'T':
-		case 't':
-			sscanf (optarg,"%s", title);
-			flag++;
-			break;
-		case 'X':
-		case 'x':
-			sscanf (optarg, "%lf", &ve);
-			flag++;
-			break;
-		case 'W':
-		case 'w':
-			sscanf (optarg, "%lf", &meters_per_inch);
-			flag++;
-			break;
-		case 'Y':
-		case 'y':
-			display_stats = MB_NO;
-			flag++;
-			break;
-		case 'Z':
-		case 'z':
-			display_scales = MB_NO;
-			flag++;
-			break;
-		case '?':
-			errflg++;
-			break;
-		} /* switch */
-
-
-	/* Process the title of the plot */
-	for (i = 1; i < argc; i++)
-		{
-		if (argv[i][0] == '-'&& ((argv[i][1]=='T')||(argv[i][1]=='t')) ) {
-			strcpy(title,argv[i]);
-			title[0]=' ';
-			title[1]=' ';
-			}
-		}
-
-	/* check that otions are allowed */
-	if ((viewdir!='P') && (viewdir!='S') && (viewdir!='B') &&
-            (viewdir!='p') && (viewdir!='s') && (viewdir!='b'))
-		{
-		fprintf(stderr,"viewdir must be either P/p (port) S/s (stbd) or B/b (back)\n");
-		errflg++;
-		}
-
-	/* if error flagged then print it and exit */
-	if (errflg)
-		{
-		fprintf(stderr,"usage: %s\n", usage_message);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		error = MB_ERROR_BAD_USAGE;
-		exit(error);
-		}
-
-	/* print starting message */
-	if (verbose == 1 || help)
-		{
-		fprintf(stderr,"\nProgram %s\n",program_name);
-		fprintf(stderr,"Version %s\n",rcs_id);
-		fprintf(stderr,"MB-system Version %s\n",MB_VERSION);
-		}
-
-	/* print starting debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  Program <%s>\n",program_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Control Parameters:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       help:       %d\n",help);
-		fprintf(stderr,"dbg2       format:     %d\n",format);
-		fprintf(stderr,"dbg2       btime_i[0]: %d\n",btime_i[0]);
-		fprintf(stderr,"dbg2       btime_i[1]: %d\n",btime_i[1]);
-		fprintf(stderr,"dbg2       btime_i[2]: %d\n",btime_i[2]);
-		fprintf(stderr,"dbg2       btime_i[3]: %d\n",btime_i[3]);
-		fprintf(stderr,"dbg2       btime_i[4]: %d\n",btime_i[4]);
-		fprintf(stderr,"dbg2       btime_i[5]: %d\n",btime_i[5]);
-		fprintf(stderr,"dbg2       btime_i[6]: %d\n",btime_i[6]);
-		fprintf(stderr,"dbg2       etime_i[0]: %d\n",etime_i[0]);
-		fprintf(stderr,"dbg2       etime_i[1]: %d\n",etime_i[1]);
-		fprintf(stderr,"dbg2       etime_i[2]: %d\n",etime_i[2]);
-		fprintf(stderr,"dbg2       etime_i[3]: %d\n",etime_i[3]);
-		fprintf(stderr,"dbg2       etime_i[4]: %d\n",etime_i[4]);
-		fprintf(stderr,"dbg2       etime_i[5]: %d\n",etime_i[5]);
-		fprintf(stderr,"dbg2       etime_i[6]: %d\n",etime_i[6]);
-		fprintf(stderr,"dbg2       speedmin:   %f\n",speedmin);
-		fprintf(stderr,"dbg2       file:       %s\n",file);
-		}
-
-	/* if help desired then print it and exit */
-	if (help)
-		{
-		fprintf(stderr,"\n%s\n",help_message);
-		fprintf(stderr,"\nusage: %s\n", usage_message);
-		exit(error);
-		}
-
-	/* get format if required */
-	if (format == 0)
-		mb_get_format(verbose,file,NULL,&format,&error);
-
-	/* initialize reading the swath file */
-	if ((status = mb_read_init(
-		verbose,file,format,pings,lonflip,bounds,
-		btime_i,etime_i,speedmin,timegap,
-		&mbio_ptr,&btime_d,&etime_d,
-		&beams_bath,&beams_amp,&pixels_ss,&error)) != MB_SUCCESS)
-		{
-		mb_error(verbose,error,&message);
-		fprintf(stderr,"\nMBIO Error returned from function <mb_read_init>:\n%s\n",message);
-		fprintf(stderr,"\nMultibeam File <%s> not initialized for reading\n",file);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-
-	/* initialize values */
-	sin_alpha = sin(alpha*DTR);
-	cos_alpha = cos(alpha*DTR);
-	sin_eta = sin(eta*DTR);
-	cos_eta = cos(eta*DTR);
-	min_z = 0.0;
-	max_z = -9999.0;
-
-	/* allocate memory for data arrays */
-	beamflag = NULL;
-	bath = NULL;
-	bathacrosstrack = NULL;
-	bathalongtrack = NULL;
-	amp = NULL;
-	ss = NULL;
-	ssacrosstrack = NULL;
-	ssalongtrack = NULL;
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(char), (void **)&beamflag, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(double), (void **)&bath, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(double), (void **)&bathacrosstrack, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(double), (void **)&bathalongtrack, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_AMPLITUDE,
-						sizeof(double), (void **)&amp, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_SIDESCAN,
-						sizeof(double), (void **)&ss, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_SIDESCAN,
-						sizeof(double), (void **)&ssacrosstrack, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_SIDESCAN,
-						sizeof(double), (void **)&ssalongtrack, &error);
-	for (i=0;i<num_pings_max+3;i++)
-		{
-		data[i].beams_bath = 0;
-		data[i].beamflag = NULL;
-		data[i].bath = NULL;
-		data[i].bathacrosstrack = NULL;
-		data[i].bathalongtrack = NULL;
-		data[i].xp = NULL;
-		data[i].yp = NULL;
-		}
-
-
-	/* if error initializing memory then quit */
-	if (error != MB_ERROR_NO_ERROR)
-		{
-		mb_error(verbose,error,&message);
-		fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",message);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-
-	/* read and process data */
-	nread = 0;
-	done = MB_NO;
-	error = MB_ERROR_NO_ERROR;
-	while (done == MB_NO && error <= MB_ERROR_NO_ERROR)
-		{
-		/* read a ping of data */
-		status = mb_get(verbose,mbio_ptr,&kind,&pings,
-			time_i,&time_d,
-			&navlon,&navlat,
-			&speed,&heading,
-			&distance,&altitude,&sonardepth,
-			&beams_bath,&beams_amp,&pixels_ss,
-			beamflag,bath,amp,
-			bathacrosstrack,
-			bathalongtrack,
-			ss,
-			ssacrosstrack,
-			ssalongtrack,
-			comment,&error);
-
-		/* only work with survey data */
-		if (error == MB_ERROR_NO_ERROR && kind == MB_DATA_DATA)
-			{
-
-			/* allocate arrays */
-			data[nread].beams_bath = beams_bath;
-			status = mb_mallocd(verbose, __FILE__, __LINE__, beams_bath*sizeof(char), (void **)&(data[nread].beamflag), &error);
-			status = mb_mallocd(verbose, __FILE__, __LINE__, beams_bath*sizeof(double), (void **)&(data[nread].bath), &error);
-			status = mb_mallocd(verbose, __FILE__, __LINE__, beams_bath*sizeof(double), (void **)&(data[nread].bathacrosstrack), &error);
-			status = mb_mallocd(verbose, __FILE__, __LINE__, beams_bath*sizeof(double), (void **)&(data[nread].bathalongtrack), &error);
-			status = mb_mallocd(verbose, __FILE__, __LINE__, beams_bath*sizeof(double), (void **)&(data[nread].xp), &error);
-			status = mb_mallocd(verbose, __FILE__, __LINE__, beams_bath*sizeof(double), (void **)&(data[nread].yp), &error);
-
-			/* copy data to storage arrays */
-			for (i=0;i<beams_bath;i++)
-				{
-				data[nread].beamflag[i] = beamflag[i];
-				data[nread].bath[i] = bath[i];
-				data[nread].bathacrosstrack[i] = bathacrosstrack[i];
-				data[nread].bathalongtrack[i] = bathalongtrack[i];
-				data[nread].xp[i] = BAD;
-				data[nread].yp[i] = BAD;
-				}
-
-			/* ignore time gaps */
-			if (error == MB_ERROR_TIME_GAP)
-				{
-				error = MB_ERROR_NO_ERROR;
-				status = MB_SUCCESS;
-				}
-
-			/* output error messages */
-			if (error == MB_ERROR_COMMENT)
-				{
-				/* do nothing */
-				}
-			else if (verbose >= 1 && error < MB_ERROR_NO_ERROR
-				&& error >= MB_ERROR_OTHER)
-				{
-				mb_error(verbose,error,&message);
-				fprintf(stderr,"\nNonfatal MBIO Error:\n%s\n",
-					message);
-				fprintf(stderr,"Time: %d %d %d %d %d %d %d\n",
-					time_i[0],time_i[1],time_i[2],
-					time_i[3],time_i[4],time_i[5],
-					time_i[6]);
-				}
-			else if (verbose >= 1 && error < MB_ERROR_NO_ERROR)
-				{
-				mb_error(verbose,error,&message);
-				fprintf(stderr,"\nNonfatal MBIO Error:\n%s\n",
-					message);
-				fprintf(stderr,"Number of good records so far: %d\n",nread);
-				}
-			else if (verbose >= 1 && error > MB_ERROR_NO_ERROR
-				&& error != MB_ERROR_EOF)
-				{
-				mb_error(verbose,error,&message);
-				fprintf(stderr,"\nFatal MBIO Error:\n%s\n",
-					message);
-				fprintf(stderr,"Last Good Time: %d %d %d %d %d %d %d\n",
-					time_i[0],time_i[1],time_i[2],
-					time_i[3],time_i[4],time_i[5],
-					time_i[6]);
-				}
-
-			/* calculate raw x,y locations for each beam */
-			if (status == MB_SUCCESS)
-				{
-				/* set initial heading */
-				if (nread == 0)
-					heading_start = heading;
-
-				/* get heading x and y components */
-				dheading = heading - heading_start;
-				if (dheading > 360.0)
-				    dheading -= 360.0;
-				else if (dheading < 0.0)
-				    dheading += 360.0;
-				dheadingx = sin(DTR * dheading);
-				dheadingy = cos(DTR * dheading);
-
-				/* get alongtrack distance in nav */
-				distot += distance * 1000.0;	/* distance in meters */
-
-				/* loop over the beams */
-				for (j=0; j<beams_bath; j++)
-					{
-					if (j >= data[nread].beams_bath)
-						{
-						data[nread].beamflag[j] = MB_FLAG_NULL;
-						data[nread].xp[j] = BAD;
-						data[nread].yp[j] = BAD;
-						}
-					else if (mb_beam_ok(beamflag[j]))
-						{
-						xx = dheadingy * bathacrosstrack[j]
-						    + dheadingx * bathalongtrack[j];
-						yy = distot
-						    - dheadingx * bathacrosstrack[j]
-						    + dheadingy * bathalongtrack[j];
-						zz = -bath[j];
-						if (viewdir=='S' || viewdir=='s')
-							{
-							data[nread].xp[j] = yy
-							    + xx * sin_eta * cos_alpha;
-							data[nread].yp[j] = zz * cos_eta * ve
-							    - xx * sin_eta * sin_alpha;
-							}
-						else if (viewdir=='P' || viewdir=='p')
-							{
-							data[nread].xp[j]= -yy
-							    - xx * sin_eta * cos_alpha;
-							data[nread].yp[j]= zz * cos_eta * ve
-							    + xx * sin_eta * sin_alpha;
-							}
-						else if (viewdir=='B' || viewdir=='b')
-							{
-							data[nread].xp[j] = xx
-							    + yy * sin_eta * cos_alpha;
-							data[nread].yp[j]= zz * cos_eta * ve
-							    + yy * sin_eta * sin_alpha;
-							}
-						mean_lat += navlat;
-						mean_lon += navlon;
-						mean_hdg += heading;
-						mean_xp += data[nread].xp[j];
-						mean_yp += data[nread].yp[j];
-						mean_knt++;
-
-						if (-data[nread].bath[j] < min_z)
-						    min_z= -data[nread].bath[j];
-						if (-data[nread].bath[j] > max_z)
-						    max_z= -data[nread].bath[j];
-						}
-					else
-						{
-						data[nread].xp[j] = BAD;
-						data[nread].yp[j] = BAD;
-						}
-					} /* for j=0 ... */
-
-				if (nread == 0)
-					{
-					for (k=0; k<7; k++)
-						timbeg_i[k] = time_i[k];
-					}
-				else
-					{
-					for (k=0; k<7; k++)
-						timend_i[k]=time_i[k];
-					}
-				}	/* if status==MB_SUCCESS */
-
-			/* increment counters */
-			if (error == MB_ERROR_NO_ERROR)
-				{
-				nread++;
-				}
-			}
-
-		/* print debug statements */
-		if (verbose >= 2)
-			{
-			fprintf(stderr,"\ndbg2  Reading loop finished in program <%s>\n",
-			program_name);
-			fprintf(stderr,"dbg2       status:     %d\n",status);
-			fprintf(stderr,"dbg2       error:      %d\n",error);
-			fprintf(stderr,"dbg2       nread:      %d\n",nread);
-			fprintf(stderr,"dbg2       pings:      %d\n",pings);
-			}
-
-		/* test if done */
-		if (nread >= num_pings_max
-			&& verbose >= 1)
-			{
-			fprintf(stderr, "%s: Maximum number of pings [%d] read before end of file reached...\n",
-			    program_name, num_pings_max);
-			done = MB_YES;
-			}
-		if (nread >= num_pings_max || error > MB_ERROR_NO_ERROR)
-			{
-			done = MB_YES;
-			}
-
-		}  /* end of processing data, 1'st while under read/process data */
-
-	/* close the swath file */
-	status = mb_close(verbose,&mbio_ptr,&error);
-
-	/* print debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  Reading loop finished in program <%s>\n",
-				program_name);
-		fprintf(stderr,"dbg2       status:     %d\n",status);
-		fprintf(stderr,"dbg2       error:      %d\n",error);
-		fprintf(stderr,"dbg2       nread:      %d\n",nread);
-		fprintf(stderr,"dbg2       pings: %d\n",pings);
-		}
-
-	/* total track length in m */
-	track_length = distot;
-	mean_lat /= mean_knt;
-	mean_latmin = fabs(mean_lat - (int) mean_lat) * 60.0;
-	mean_lon /= mean_knt;
-	mean_lonmin = fabs(mean_lon - (int) mean_lon) * 60.0;
-	mean_hdg /= mean_knt;
-	mean_xp /= mean_knt;
-	mean_yp /= mean_knt;
-
-	/* rescale xp[],yp[] to zero mean; get min and max */
-	max_yp = min_yp = max_xp = min_xp = 0.0;
-	for (i=0; i<nread; i++)
-		{
-		beamflag = data[i].beamflag;
-		xp = data[i].xp;
-		yp = data[i].yp;
-		for (j=0; j<data[i].beams_bath; j++)
-			{
-			if (mb_beam_ok(beamflag[j]))
-				{
-				yp[j] -= mean_yp;
-				xp[j] -= mean_xp;
-				min_xp = MIN(min_xp, xp[j]);
-				max_xp = MAX(max_xp, xp[j]);
-				min_yp = MIN(min_yp, yp[j]);
-				max_yp = MAX(max_yp, yp[j]);
-				} /* if yp[][] */
-			} 	  /* for j */
-		} 		  /* for i */
-
-	/* get page orientation, scaling(in/m) factor and startup plot */
-	if ((viewdir=='P') || (viewdir=='S') || (viewdir=='p') || (viewdir=='s'))
-		{
-		/* Landscape */
-		orient = 0;
-		if (meters_per_inch > 0.0)
-			{
-			scaling = 1.0 / meters_per_inch;
-			x_off = 11. / 2;
-			y_off = 8.5 / 2.;
-			}
-		else
-			{
-			if ( (5.2 / (max_yp - min_yp)) < (8.5 / (max_xp - min_xp)) )
-				scaling = (5.2 / (max_yp - min_yp));
-			else
-				scaling = (8.5 / (max_xp - min_xp));
-			x_off=(-(max_xp + min_xp) * scaling / 2.0) + (11. / 2);
-			y_off=(-(max_yp + min_yp) * scaling / 2.0) + (8.5 / 2) - .2;
-			}
-		}
-	else
-		{
-		/* Portrait */
-		orient = 1;
-		if (meters_per_inch > 0.0)
-			{
-			scaling = 1.0 / meters_per_inch;
-			x_off = 8.5 / 2.0;
-			y_off = 11. / 2.0;
-			}
-		else
-			{
-			if ( (8./(max_yp-min_yp))<(6.5/(max_xp-min_xp)) )
-				scaling = (8./(max_yp-min_yp));
-			else
-				scaling = (6.5/(max_xp-min_xp));
-			x_off=(-(max_xp+min_xp)*scaling/2.0)+(8.5/2);
-			y_off=(-(max_yp+min_yp)*scaling/2.0)+(11./2)-.2;
-			}
-		}
-
-       /* initialize the Postscript plotting */
-#ifdef GMT_MINOR_VERSION
-       ps_plotinit_hires(NULL,0,orient,x_off,y_off,1.0,1.0,1,300,1,
-               gmtdefs.paper_width, gmtdefs.page_rgb,
-               gmtdefs.encoding.name,
-               (struct EPS *)GMT_epsinfo (argv[0]));
-#else
-       ps_plotinit(NULL,0,orient,x_off,y_off,1.0,1.0,1,300,1,
-               gmtdefs.paper_width, gmtdefs.page_rgb,
-               gmtdefs.encoding.name,
-               (struct EPS *)GMT_epsinfo (argv[0]));
-#endif
-       GMT_echo_command (argc, argv);
-
-	/* now loop over the data in the appropriate order
-	    laying down white filled boxes with black outlines
-	    wherever the data is good */
-
-	if ((viewdir=='S') || (viewdir=='s'))
-		forward = MB_YES;
-	else if ((viewdir=='P') || (viewdir=='p'))
-		forward = MB_NO;
-	else if ((viewdir=='B') || (viewdir=='b'))
-		{
-		if (alpha < 90.0)
-			forward = MB_YES;
-		else
-			forward = MB_NO;
-		}
-	for (j=0;j<beams_bath-1;j++)
-		{
-		for (i=0;i<nread-1;i++)
-			{
-			if (forward == MB_YES)
-				jj = j;
-			else
-				jj = beams_bath - 2 - j;
-
-			/* make box */
-			if (mb_beam_ok(data[i].beamflag[jj])
-			    && mb_beam_ok(data[i+1].beamflag[jj])
-			    && mb_beam_ok(data[i].beamflag[jj+1])
-			    && mb_beam_ok(data[i+1].beamflag[jj+1]))
-				{
-				xl[0] = scaling * data[i].xp[jj];
-				yl[0] = scaling * data[i].yp[jj];
-				xl[1] = scaling * data[i+1].xp[jj];
-				yl[1] = scaling * data[i+1].yp[jj];
-				xl[2] = scaling * data[i+1].xp[jj+1];
-				yl[2] = scaling * data[i+1].yp[jj+1];
-				xl[3] = scaling * data[i].xp[jj+1];
-				yl[3] = scaling * data[i].yp[jj+1];
-				ps_polygon(xl,yl,4,rgb_white,1);
-				}
-			}
-		}
-
-	/* titles and such */
-	ps_setline(2);	/* set line width */
-
-	if (display_stats == MB_NO)
-		{
-		/* plot a title */
-		xl[0]=0;
-		yl[0]=max_yp*scaling+.6;
-		sprintf(label,"%s",title);
-		ps_text(xl[0],yl[0],20.,label,0.,6,0);
-		}
-	else
-		{
-		/* plot a title */
-		xl[0]=0;
-		yl[0]=max_yp*scaling+1.3;
-		sprintf(label,"%s",title);
-		ps_text(xl[0],yl[0],20.,label,0.,6,0);
-
-		/*xl[0]-=3.25;*/
-		yl[0]-=0.3;
-		sprintf(label,"Mean Lat.: %3d at +o@+ %4.1f'   Mean Lon.: %4d at +o @+%4.1f'   Heading: %.1lf at +o @+",(int)mean_lat, mean_latmin, (int)mean_lon, mean_lonmin, mean_hdg);
-		ps_text(xl[0],yl[0],15.,label,0.,6,0);
-
-		yl[0]-=0.3;
-		sprintf(label,"View Angle: %.1lf at +o @+  V.E.: %.1lfX   Scale: %.0lf m/inch   Track Length: %.1lf km",eta,ve,1.0/scaling,track_length/1000.0);
-		ps_text(xl[0],yl[0],15.,label,0.,6,0);
-
-		yl[0]-=0.3;
-		sprintf(label,
-		"From %.4d/%.2d/%.2d %.2d:%.2d:%.2d   to  %.4d/%.2d/%.2d %.2d:%.2d:%.2d",
-		timbeg_i[0],timbeg_i[1],timbeg_i[2],timbeg_i[3],
-		timbeg_i[4],timbeg_i[5],timend_i[0],timend_i[1],
-		timend_i[2],timend_i[3],timend_i[4],timend_i[5]);
-		ps_text(xl[0],yl[0],15.,label,0.,6,0);
-		} /* else after if display_stats */
-
-
-	if (display_scales == MB_YES)
-		{
-		/* plot the x-scale */
-		xscale=10000;		/* x scale in m */
-		if (track_length < 50000) xscale=5000;
-		if (track_length < 20000) xscale=2000;
-		if (track_length < 10000) xscale=1000;
-		xl[0]=xl[1]= (-xscale*scaling/2.0);
-		xl[2]=xl[3]= (-xl[0]);
-		xl[0]+=2.;xl[1]+=2.;xl[2]+=2.;xl[3]+=2.;
-		yl[1]=yl[2]= min_yp*scaling-1.;
-		yl[0]=yl[3]= yl[1]+0.1;
-
-#ifdef GMT_MINOR_VERSION
-		ps_line(xl,yl,4,3,0);
-#else
-		ps_line(xl,yl,4,3,0,0);
-#endif
-		sprintf(label,"%.0f km",xscale/1000.0);
-		ps_text(xl[0]+.5,yl[0]+.05,15.,label,0.,6,0);
-
-
-		/* plot the z-scale */
-		range_z=(max_z-min_z);
-		zscale=2000;		/* z scale in m */
-		if (range_z < 3000) zscale=1000;
-		if (range_z < 1000) zscale=500;
-		if (range_z < 500) zscale=200;
-		if (range_z < 250) zscale=100;
-		zscale_inch= zscale*scaling*cos_eta*ve;
-		xl[1]=xl[2]+0.5;
-		xl[2]=xl[1];
-		xl[0]=xl[3]= xl[1]+.1;
-		yl[0]=yl[1]= min_yp*scaling-1.;
-		yl[2]=yl[3]= yl[0]+zscale_inch;
-
-#ifdef GMT_MINOR_VERSION
-		ps_line(xl,yl,4,3,0);
-#else
-		ps_line(xl,yl,4,3,0,0);
-#endif
-		sprintf(label,"%.0f m",zscale);
-		ps_text(xl[0]+0.3,yl[0]+zscale_inch/2.0,15.,label,0.,6,0);
-
-
-		/* plot an arrow in the ship's direction */
-		a=0;
-		b=beams_bath/2;
-		while (!mb_beam_ok(data[a++].beamflag[b])) {}
-		xl[0] = data[--a].xp[b];
-		yl[0] = data[a].yp[b];
-		a = nread - 1;
-		while (!mb_beam_ok(data[a--].beamflag[b])) {}
-		xl[1] = data[++a].xp[b];
-		yl[1] = data[a].yp[b];
-		xl[1] = ((xl[1]-xl[0])/distot/2)+.6;
-		yl[1] = ((yl[1]-yl[0])/distot/2) + min_yp*scaling-1.;
-		xl[0] = 0.+.6;
-		yl[0] = 0.+min_yp*scaling-0.85;
-		ps_vector(xl[0],yl[0],xl[1],yl[1],
-		    0.01,0.25,0.1,1.0,rgb_black,0);
-		ps_text(xl[0]-1.7,yl[0]+.2,15.,"ship heading",0.,1,0);
-		ps_text(xl[0]-1.7,yl[0],15.,"direction",0.,1,0);
-
-
-		/* plot the three axes */
-		for (i=0;i<3;i++)
-			{
-			xl[0]=0.;	/* point in center of page */
-			yl[0]=0.;
-			rotate=0;	/* set to 1 if arrow is rotated below */
-			if (i==0)
-				{
-				/* x-axis */
-				x=1.;
-				y=0;
-				z=0;
-				}
-			else if (i==1)
-				{
-				/* y-axis */
-				x=0;
-				y=1.;
-				z=0;
-				}
-			else if (i==2)
-				{
-				/* z-axis */
-				x=0;
-				y=0;
-				z=-1.;
-				}
-
-			if (viewdir=='P' || viewdir=='p')
-				{
-				xl[1]=-y-x*sin_eta*cos_alpha+xl[0];
-				yl[1]= -z*cos_eta+x*sin_eta*sin_alpha+yl[0];
-				}
-			else if (viewdir=='B' || viewdir=='b')
-				{
-				xl[1]=(x+y*sin_eta*cos_alpha)+xl[0];
-				yl[1]=-z*cos_eta+y*sin_eta*sin_alpha+yl[0];
-				}
-			else if (viewdir=='S' || viewdir=='s')
-				{
-				xl[1]=y+x*sin_eta*cos_alpha+xl[0];
-				yl[1]=z*cos_eta-x*sin_eta*sin_alpha+yl[0];
-				}
-
-			if (yl[1]<yl[0])
-				{
-				/* rotate arrows 180 if facing downward */
-				xl[1]=-xl[1];
-				yl[1]=-yl[1];
-				rotate=1;
-				}
-
-			xl[0]=(-3.);		/* move arrows from center to lower left corner */
-			yl[0]=(min_yp*scaling-1.);
-			xl[1]=xl[0]+xl[1];
-			yl[1]=yl[0]+yl[1];
-
-			ps_vector(xl[0],yl[0],xl[1],yl[1],
-				0.01,0.25,0.1,1.0,rgb_black,0);
-
-			if (i==0&&rotate==0)
-				ps_text(xl[1],yl[1]+.15,15.,"x",0.,6,0);
-			else if (i==1&&rotate==0)
-				ps_text(xl[1],yl[1]+.15,15.,"y",0.,6,0);
-			else if (i==2&&rotate==0)
-				ps_text(xl[1],yl[1]+.15,15.,"z",0.,6,0);
-			else if (i==0&&rotate==1)
-				ps_text(xl[1],yl[1]+.15,15.,"-x",0.,6,0);
-			else if (i==1&&rotate==1)
-				ps_text(xl[1],yl[1]+.15,15.,"-y",0.,6,0);
-			else if (i==2&&rotate==1)
-				ps_text(xl[1],yl[1]+.15,15.,"z",0.,6,0);
-
-			} /* (i=0;i<3;i++) */
-		} /* if display_scales */
-
-	/* end the postscript file */
-	ps_plotend(1);
-
-	/* deallocate arrays */
-	for (i=0;i<nread;i++)
-		{
-		mb_freed(verbose,__FILE__, __LINE__, (void **)&(data[i].beams_bath), &error);
-		mb_freed(verbose,__FILE__, __LINE__, (void **)&(data[i].bath), &error);
-		mb_freed(verbose,__FILE__, __LINE__, (void **)&(data[i].bathacrosstrack), &error);
-		mb_freed(verbose,__FILE__, __LINE__, (void **)&(data[i].bathalongtrack), &error);
-		mb_freed(verbose,__FILE__, __LINE__, (void **)&(data[i].xp), &error);
-		mb_freed(verbose,__FILE__, __LINE__, (void **)&(data[i].yp), &error);
-		}
-
-	/* check memory */
-	if (verbose >= 4)
-		status = mb_memory_list(verbose,&error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  Program <%s> completed\n",
-			program_name);
-		fprintf(stderr,"dbg2  Ending status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* end it all */
-	exit(error);
-
-}	/* main */
-
-/*--------------------------------------------------------------------*/
diff --git a/src/utilities/mbrollbias.c b/src/utilities/mbrollbias.c
deleted file mode 100644
index 53ef7f1..0000000
--- a/src/utilities/mbrollbias.c
+++ /dev/null
@@ -1,1204 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbrollbias.c	5/16/93
- *    $Id: mbrollbias.c 2249 2015-06-26 19:26:09Z caress $
- *
- *    Copyright (c) 1993-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *    D. N. Chayes (dale at lamont.ldgo.columbia.edu)
- *    and S. O'Hara (sohara at lamont.ldgo.columbia.edu)
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * MBROLLBIAS is an utility used to assess roll bias of swath
- * sonar systems using data from two swaths covering the same
- * seafloor in opposite directions. The program takes two input
- * files and calculates best fitting planes for each dataset.
- * The roll bias is calculated by solving for a common roll bias
- * factor which explains the difference between the seafloor
- * slopes observed on the two swaths.  This approach assumes that
- * pitch bias is not a factor; this assumption is most correct when
- * the heading of the two shiptracks are exactly opposite. The area is
- * divided into a number of rectangular regions and calculations are done
- * in each region containing a sufficient number of data from both
- * swaths.  A positive roll bias value means that the ship is rolled
- * to port so that apparent depths are anomalously shallow to port
- * and deep to starboard.
- *
- * Author:	D. W. Caress
- * Date:	May 16, 1993
- *
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <math.h>
-#include <string.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_define.h"
-
-/* define minimum number of data to fit plane */
-#define	MINIMUM_NUMBER_DATA	100
-
-/* structure definitions */
-struct bath
-	{
-	double	x;
-	double	y;
-	double	d;
-	double	h;
-	};
-struct bathptr
-	{
-	struct bath *ptr;
-	};
-
-/* local prototypes */
-void gauss(double *a, double *vec,
-		int n, int nstore, double test,
-		int *ierror, int itriag);
-
-/* program identifiers */
-static char rcs_id[] = "$Id: mbrollbias.c 2249 2015-06-26 19:26:09Z caress $";
-char program_name[] = "MBROLLBIAS";
-char help_message[] =  "MBROLLBIAS is an utility used to assess roll bias of swath \nsonar systems using bathymetry data from two swaths covering the \nsame seafloor in opposite directions. The program takes two input  \nfiles and calculates best fitting planes for each dataset.   \nThe roll bias is calculated by solving for a common roll bias\nfactor which explains the difference between the seafloor\nslopes observed on the two swaths.  This approach assumes that \npitch bias is not a f [...]
-char usage_message[] = "mbrollbias -Dxdim/ydim -Fformat1/format2 -Ifile1 -Jfile2 -Llonflip -Rw/e/s/n -V -H]";
-
-/*--------------------------------------------------------------------*/
-
-int main (int argc, char **argv)
-{
-	extern char *optarg;
-	int	errflg = 0;
-	int	c;
-	int	help = 0;
-	int	flag = 0;
-
-	/* MBIO status variables */
-	int	status = MB_SUCCESS;
-	int	verbose = 0;
-	int	error = MB_ERROR_NO_ERROR;
-	char	*message;
-
-	/* MBIO read control parameters */
-	int	format;
-	int	pings;
-	int	lonflip;
-	double	bounds[4];
-	int	btime_i[7];
-	int	etime_i[7];
-	double	btime_d;
-	double	etime_d;
-	double	speedmin;
-	double	timegap;
-	int	beams_bath;
-	int	beams_amp;
-	int	pixels_ss;
-	void	*mbio_ptr = NULL;
-
-	/* mbrollbias control variables */
-	int	iformat;
-	int	jformat;
-	char	ifile[MB_PATH_MAXLINE];
-	char	jfile[MB_PATH_MAXLINE];
-	int	xdim, ydim;
-
-	/* mbio read values */
-	int	rpings;
-	int	kind;
-	int	time_i[7];
-	double	time_d;
-	double	navlon;
-	double	navlat;
-	double	speed;
-	double	heading;
-	double	distance;
-	double	altitude;
-	double	sonardepth;
-	char	*beamflag = NULL;
-	double	*bath = NULL;
-	double	*bathlon = NULL;
-	double	*bathlat = NULL;
-	double	*amp = NULL;
-	double	*ss = NULL;
-	double	*sslon = NULL;
-	double	*sslat = NULL;
-	char	comment[MB_COMMENT_MAXLINE];
-
-	/* grid variables */
-	double	deglontokm, deglattokm;
-	double	mtodeglon, mtodeglat;
-	double	dx, dy;
-	int	*icount = NULL;
-	int	*jcount = NULL;
-	struct bathptr	*idata = NULL;
-	struct bathptr	*jdata = NULL;
-	struct bath	*zone = NULL;
-	int	ndatafile;
-	double	iaa, ibb, icc, ihh;
-	double	jaa, jbb, jcc, jhh;
-	double	hx, hy, dd;
-	double	isine, icosine, jsine, jcosine;
-	double	roll_bias;
-
-	/* matrix parameters */
-	int	nmatrix = 3;
-	double	matrix[3][3];
-	double	vector[3];
-	double	xx[3];
-
-	/* output stream for basic stuff (stdout if verbose <= 1,
-		stderr if verbose > 1) */
-	FILE	*outfp;
-
-	/* other variables */
-	int	i, j, k;
-	int	ii, jj, kk;
-	int	ib, ix, iy, indx;
-
-	/* get current default values */
-	status = mb_defaults(verbose,&format,&pings,&lonflip,bounds,
-		btime_i,etime_i,&speedmin,&timegap);
-
-	/* set default input and output */
-	strcpy (ifile, "\0");
-	strcpy (jfile, "\0");
-
-	/* initialize some values */
-	pings = 1;
-	iformat = format;
-	jformat = format;
-	btime_i[0] = 1962;
-	btime_i[1] = 2;
-	btime_i[2] = 21;
-	btime_i[3] = 10;
-	btime_i[4] = 30;
-	btime_i[5] = 0;
-	btime_i[6] = 0;
-	etime_i[0] = 2062;
-	etime_i[1] = 2;
-	etime_i[2] = 21;
-	etime_i[3] = 10;
-	etime_i[4] = 30;
-	etime_i[5] = 0;
-	etime_i[6] = 0;
-	speedmin = 0.0;
-	timegap = 1000000000.0;
-	bounds[0] = 0.0;
-	bounds[1] = 0.0;
-	bounds[2] = 0.0;
-	bounds[3] = 0.0;
-	xdim = 5;
-	ydim = 5;
-
-	/* process argument list */
-	while ((c = getopt(argc, argv, "VvHhL:l:R:r:F:f:I:i:J:j:D:d:")) != -1)
-	  switch (c)
-		{
-		case 'H':
-		case 'h':
-			help++;
-			break;
-		case 'V':
-		case 'v':
-			verbose++;
-			break;
-		case 'L':
-		case 'l':
-			sscanf (optarg,"%d", &lonflip);
-			flag++;
-			break;
-		case 'R':
-		case 'r':
-			mb_get_bounds(optarg, bounds);
-			flag++;
-			break;
-		case 'F':
-		case 'f':
-			sscanf (optarg,"%d/%d", &iformat,&jformat);
-			flag++;
-			break;
-		case 'I':
-		case 'i':
-			sscanf (optarg,"%s", ifile);
-			flag++;
-			break;
-		case 'J':
-		case 'j':
-			sscanf (optarg,"%s", jfile);
-			flag++;
-			break;
-		case 'D':
-		case 'd':
-			sscanf (optarg,"%d/%d", &xdim, &ydim);
-			flag++;
-			break;
-		case '?':
-			errflg++;
-		}
-
-	/* set output stream */
-	if (verbose <= 1)
-		outfp = stdout;
-	else
-		outfp = stderr;
-
-	/* if error flagged then print it and exit */
-	if (errflg)
-		{
-		fprintf(outfp,"usage: %s\n", usage_message);
-		fprintf(outfp,"\nProgram <%s> Terminated\n",
-			program_name);
-		error = MB_ERROR_BAD_USAGE;
-		exit(error);
-		}
-
-	/* print starting message */
-	if (verbose == 1 || help)
-		{
-		fprintf(outfp,"\nProgram %s\n",program_name);
-		fprintf(outfp,"Version %s\n",rcs_id);
-		fprintf(outfp,"MB-system Version %s\n",MB_VERSION);
-		}
-
-	/* print starting debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(outfp,"\ndbg2  Program <%s>\n",program_name);
-		fprintf(outfp,"dbg2  Version %s\n",rcs_id);
-		fprintf(outfp,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(outfp,"dbg2  Control Parameters:\n");
-		fprintf(outfp,"dbg2       verbose:          %d\n",verbose);
-		fprintf(outfp,"dbg2       help:             %d\n",help);
-		fprintf(outfp,"dbg2       pings:            %d\n",pings);
-		fprintf(outfp,"dbg2       lonflip:          %d\n",lonflip);
-		fprintf(outfp,"dbg2       btime_i[0]:       %d\n",btime_i[0]);
-		fprintf(outfp,"dbg2       btime_i[1]:       %d\n",btime_i[1]);
-		fprintf(outfp,"dbg2       btime_i[2]:       %d\n",btime_i[2]);
-		fprintf(outfp,"dbg2       btime_i[3]:       %d\n",btime_i[3]);
-		fprintf(outfp,"dbg2       btime_i[4]:       %d\n",btime_i[4]);
-		fprintf(outfp,"dbg2       btime_i[5]:       %d\n",btime_i[5]);
-		fprintf(outfp,"dbg2       btime_i[6]:       %d\n",btime_i[6]);
-		fprintf(outfp,"dbg2       etime_i[0]:       %d\n",etime_i[0]);
-		fprintf(outfp,"dbg2       etime_i[1]:       %d\n",etime_i[1]);
-		fprintf(outfp,"dbg2       etime_i[2]:       %d\n",etime_i[2]);
-		fprintf(outfp,"dbg2       etime_i[3]:       %d\n",etime_i[3]);
-		fprintf(outfp,"dbg2       etime_i[4]:       %d\n",etime_i[4]);
-		fprintf(outfp,"dbg2       etime_i[5]:       %d\n",etime_i[5]);
-		fprintf(outfp,"dbg2       etime_i[6]:       %d\n",etime_i[6]);
-		fprintf(outfp,"dbg2       speedmin:         %f\n",speedmin);
-		fprintf(outfp,"dbg2       timegap:          %f\n",timegap);
-		fprintf(outfp,"dbg2       input file 1:     %s\n",ifile);
-		fprintf(outfp,"dbg2       input file 2:     %s\n",jfile);
-		fprintf(outfp,"dbg2       file 1 format:    %d\n",iformat);
-		fprintf(outfp,"dbg2       file 2 format:    %d\n",jformat);
-		fprintf(outfp,"dbg2       grid x dimension: %d\n",xdim);
-		fprintf(outfp,"dbg2       grid y dimension: %d\n",ydim);
-		fprintf(outfp,"dbg2       grid bounds[0]:   %f\n",bounds[0]);
-		fprintf(outfp,"dbg2       grid bounds[1]:   %f\n",bounds[1]);
-		fprintf(outfp,"dbg2       grid bounds[2]:   %f\n",bounds[2]);
-		fprintf(outfp,"dbg2       grid bounds[3]:   %f\n",bounds[3]);
-		}
-
-	/* if help desired then print it and exit */
-	if (help)
-		{
-		fprintf(outfp,"\n%s\n",help_message);
-		fprintf(outfp,"\nusage: %s\n", usage_message);
-		exit(error);
-		}
-
-	/* get format if required */
-	if (format == 0)
-		mb_get_format(verbose,ifile,NULL,&format,&error);
-
-	/* if bounds not specified then quit */
-	if (bounds[0] >= bounds[1] || bounds[2] >= bounds[3]
-		|| bounds[2] <= -90.0 || bounds[3] >= 90.0)
-		{
-		fprintf(outfp,"\nGrid bounds not properly specified:\n\t%f %f %f %f\n",bounds[0],bounds[1],bounds[2],bounds[3]);
-		fprintf(outfp,"\nProgram <%s> Terminated\n",
-			program_name);
-		error = MB_ERROR_BAD_PARAMETER;
-		exit(error);
-		}
-
-	/* calculate grid properties and other values */
-	mb_coor_scale(verbose,0.5*(bounds[2]+bounds[3]),&mtodeglon,&mtodeglat);
-	deglontokm = 0.001/mtodeglon;
-	deglattokm = 0.001/mtodeglat;
-	dx = (bounds[1] - bounds[0])/(xdim);
-	dy = (bounds[3] - bounds[2])/(ydim);
-
-	/* output info */
-	if (verbose >= 0)
-		{
-		fprintf(outfp,"\nMBROLLBIAS Parameters:\n");
-		fprintf(outfp,"Input file 1:     %s\n",ifile);
-		fprintf(outfp,"Input file 2:     %s\n",jfile);
-		fprintf(outfp,"Region grid bounds:\n");
-		fprintf(outfp,"  Longitude: %9.4f %9.4f\n",bounds[0],bounds[1]);
-		fprintf(outfp,"  Latitude:  %9.4f %9.4f\n",bounds[2],bounds[3]);
-		fprintf(outfp,"Region grid dimensions: %d %d\n",xdim,ydim);
-		fprintf(outfp,"Longitude interval: %f degrees or %f km\n",
-			dx,dx*deglontokm);
-		fprintf(outfp,"Latitude interval:  %f degrees or %f km\n",
-			dy,dy*deglattokm);
-		fprintf(outfp,"Longitude flipping:   %d\n",lonflip);
-		fprintf(outfp,"\n");
-		}
-
-	/* allocate memory for counting arrays */
-	status = mb_mallocd(verbose,__FILE__,__LINE__,xdim*ydim*sizeof(int),(void **)&icount,&error);
-	status = mb_mallocd(verbose,__FILE__,__LINE__,xdim*ydim*sizeof(int),(void **)&jcount,&error);
-
-	/* if error initializing memory then quit */
-	if (error != MB_ERROR_NO_ERROR)
-		{
-		mb_error(verbose,error,&message);
-		fprintf(outfp,"\nMBIO Error allocating data arrays:\n%s\n",
-			message);
-		fprintf(outfp,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-
-	/* initialize arrays */
-	for (i=0;i<xdim*ydim;i++)
-		{
-		icount[i] = 0;
-		jcount[i] = 0;
-		}
-
-	/* count data in first swath file */
-
-	/* initialize the first swath file */
-	ndatafile = 0;
-	if ((status = mb_read_init(
-		verbose,ifile,iformat,pings,lonflip,bounds,
-		btime_i,etime_i,speedmin,timegap,
-		&mbio_ptr,&btime_d,&etime_d,
-		&beams_bath,&beams_amp,&pixels_ss,&error)) != MB_SUCCESS)
-		{
-		mb_error(verbose,error,&message);
-		fprintf(outfp,"\nMBIO Error returned from function <mb_read_init>:\n%s\n",message);
-		fprintf(outfp,"\nMultibeam File <%s> not initialized for reading\n",ifile);
-		fprintf(outfp,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-
-	/* allocate memory for reading data arrays */
-	status = mb_mallocd(verbose,__FILE__,__LINE__,beams_bath*sizeof(char),(void **)&beamflag,&error);
-	status = mb_mallocd(verbose,__FILE__,__LINE__,beams_bath*sizeof(double),(void **)&bath,&error);
-	status = mb_mallocd(verbose,__FILE__,__LINE__,beams_bath*sizeof(double),(void **)&bathlon,&error);
-	status = mb_mallocd(verbose,__FILE__,__LINE__,beams_bath*sizeof(double),(void **)&bathlat,&error);
-	status = mb_mallocd(verbose,__FILE__,__LINE__,beams_amp*sizeof(double),(void **)&amp,&error);
-	status = mb_mallocd(verbose,__FILE__,__LINE__,pixels_ss*sizeof(double),(void **)&ss,&error);
-	status = mb_mallocd(verbose,__FILE__,__LINE__,pixels_ss*sizeof(double),(void **)&sslon,&error);
-	status = mb_mallocd(verbose,__FILE__,__LINE__,pixels_ss*sizeof(double),(void **)&sslat,&error);
-
-	/* if error initializing memory then quit */
-	if (error != MB_ERROR_NO_ERROR)
-		{
-		mb_error(verbose,error,&message);
-		fprintf(outfp,"\nMBIO Error allocating data arrays:\n%s\n",
-			message);
-		fprintf(outfp,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-
-	/* loop over reading */
-	while (error <= MB_ERROR_NO_ERROR)
-		{
-		status = mb_read(verbose,mbio_ptr,&kind,
-			&rpings,time_i,&time_d,
-			&navlon,&navlat,
-			&speed,&heading,
-			&distance,&altitude,&sonardepth,
-			&beams_bath,&beams_amp,&pixels_ss,
-			beamflag,bath,amp,bathlon,bathlat,
-			ss,sslon,sslat,
-			comment,&error);
-
-		/* time gaps are not a problem here */
-		if (error == MB_ERROR_TIME_GAP)
-			{
-			error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-
-		/* print debug statements */
-		if (verbose >= 2)
-			{
-			fprintf(stderr,"\ndbg2  Ping read in program <%s>\n",program_name);
-			fprintf(stderr,"dbg2       kind:           %d\n",kind);
-			fprintf(stderr,"dbg2       beams_bath:     %d\n",beams_bath);
-			fprintf(stderr,"dbg2       beams_amp:      %d\n",beams_amp);
-			fprintf(stderr,"dbg2       pixels_ss:      %d\n",pixels_ss);
-			fprintf(stderr,"dbg2       error:          %d\n",error);
-			fprintf(stderr,"dbg2       status:         %d\n",status);
-			}
-
-		if (error == MB_ERROR_NO_ERROR)
-			{
-			for (ib=0;ib<beams_bath;ib++)
-				if (mb_beam_ok(beamflag[ib]))
-				{
-				ix = (bathlon[ib] - bounds[0])/dx;
-				iy = (bathlat[ib] - bounds[2])/dy;
-				if (ix >= 0 && ix < xdim
-					&& iy >= 0 && iy < ydim)
-					{
-					indx = ix + iy*xdim;
-					icount[indx]++;
-					ndatafile++;
-					}
-				}
-			}
-		}
-	status = mb_close(verbose,&mbio_ptr,&error);
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&beamflag,&error);
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&bath,&error);
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&bathlon,&error);
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&bathlat,&error);
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&amp,&error);
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&ss,&error);
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&sslon,&error);
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&sslat,&error);
-	status = MB_SUCCESS;
-	error = MB_ERROR_NO_ERROR;
-	if (verbose >= 2)
-		fprintf(outfp,"\n");
-	fprintf(outfp,"%d depth points counted in %s\n",
-			ndatafile,ifile);
-
-	/* count data in second swath file */
-
-	/* initialize the second swath file */
-	ndatafile = 0;
-	if ((status = mb_read_init(
-		verbose,jfile,jformat,pings,lonflip,bounds,
-		btime_i,etime_i,speedmin,timegap,
-		&mbio_ptr,&btime_d,&etime_d,
-		&beams_bath,&beams_amp,&pixels_ss,&error)) != MB_SUCCESS)
-		{
-		mb_error(verbose,error,&message);
-		fprintf(outfp,"\nMBIO Error returned from function <mb_read_init>:\n%s\n",message);
-		fprintf(outfp,"\nMultibeam File <%s> not initialized for reading\n",jfile);
-		fprintf(outfp,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-
-	/* allocate memory for reading data arrays */
-	status = mb_mallocd(verbose,__FILE__,__LINE__,beams_bath*sizeof(char),(void **)&beamflag,&error);
-	status = mb_mallocd(verbose,__FILE__,__LINE__,beams_bath*sizeof(double),(void **)&bath,&error);
-	status = mb_mallocd(verbose,__FILE__,__LINE__,beams_bath*sizeof(double),(void **)&bathlon,&error);
-	status = mb_mallocd(verbose,__FILE__,__LINE__,beams_bath*sizeof(double),(void **)&bathlat,&error);
-	status = mb_mallocd(verbose,__FILE__,__LINE__,beams_amp*sizeof(double),(void **)&amp,&error);
-	status = mb_mallocd(verbose,__FILE__,__LINE__,pixels_ss*sizeof(double),(void **)&ss,&error);
-	status = mb_mallocd(verbose,__FILE__,__LINE__,pixels_ss*sizeof(double),(void **)&sslon,&error);
-	status = mb_mallocd(verbose,__FILE__,__LINE__,pixels_ss*sizeof(double),(void **)&sslat,&error);
-
-	/* if error initializing memory then quit */
-	if (error != MB_ERROR_NO_ERROR)
-		{
-		mb_error(verbose,error,&message);
-		fprintf(outfp,"\nMBIO Error allocating data arrays:\n%s\n",
-			message);
-		fprintf(outfp,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-
-	/* loop over reading */
-	while (error <= MB_ERROR_NO_ERROR)
-		{
-		status = mb_read(verbose,mbio_ptr,&kind,
-			&rpings,time_i,&time_d,
-			&navlon,&navlat,
-			&speed,&heading,
-			&distance,&altitude,&sonardepth,
-			&beams_bath,&beams_amp,&pixels_ss,
-			beamflag,bath,amp,bathlon,bathlat,
-			ss,sslon,sslat,
-			comment,&error);
-
-		/* time gaps are not a problem here */
-		if (error == MB_ERROR_TIME_GAP)
-			{
-			error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-
-		/* print debug statements */
-		if (verbose >= 2)
-			{
-			fprintf(stderr,"\ndbg2  Ping read in program <%s>\n",program_name);
-			fprintf(stderr,"dbg2       kind:           %d\n",kind);
-			fprintf(stderr,"dbg2       beams_bath:     %d\n",beams_bath);
-			fprintf(stderr,"dbg2       beams_amp:      %d\n",beams_amp);
-			fprintf(stderr,"dbg2       pixels_ss:      %d\n",pixels_ss);
-			fprintf(stderr,"dbg2       error:          %d\n",error);
-			fprintf(stderr,"dbg2       status:         %d\n",status);
-			}
-
-		if (error == MB_ERROR_NO_ERROR)
-			{
-			for (ib=0;ib<beams_bath;ib++)
-				if (mb_beam_ok(beamflag[ib]))
-				{
-				ix = (bathlon[ib] - bounds[0])/dx;
-				iy = (bathlat[ib] - bounds[2])/dy;
-				if (ix >= 0 && ix < xdim
-					&& iy >= 0 && iy < ydim)
-					{
-					indx = ix + iy*xdim;
-					jcount[indx]++;
-					ndatafile++;
-					}
-				}
-			}
-		}
-	status = mb_close(verbose,&mbio_ptr,&error);
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&beamflag,&error);
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&bath,&error);
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&bathlon,&error);
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&bathlat,&error);
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&amp,&error);
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&ss,&error);
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&sslon,&error);
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&sslat,&error);
-	status = MB_SUCCESS;
-	error = MB_ERROR_NO_ERROR;
-	if (verbose >= 2)
-		fprintf(outfp,"\n");
-	fprintf(outfp,"%d depth points counted in %s\n",
-			ndatafile,jfile);
-
-	/* allocate space for data */
-	status = mb_mallocd(verbose,__FILE__,__LINE__,xdim*ydim*sizeof(struct bathptr),
-			(void **)&idata,&error);
-	status = mb_mallocd(verbose,__FILE__,__LINE__,xdim*ydim*sizeof(struct bathptr),
-			(void **)&jdata,&error);
-	for (i=0;i<xdim;i++)
-		for (j=0;j<ydim;j++)
-			{
-			k = i*ydim + j;
-			idata[k].ptr = NULL;
-			jdata[k].ptr = NULL;
-			if (icount[k] > 0)
-				{
-				status = mb_mallocd(verbose,__FILE__,__LINE__,
-					icount[k]*sizeof(struct bath),
-					(void **)&(idata[k].ptr),&error);
-				icount[k] = 0;
-				}
-			if (jcount[k] > 0)
-				{
-				status = mb_mallocd(verbose,__FILE__,__LINE__,
-					jcount[k]*sizeof(struct bath),
-					(void **)&(jdata[k].ptr),&error);
-				jcount[k] = 0;
-				}
-			}
-
-	/* if error initializing memory then quit */
-	if (error != MB_ERROR_NO_ERROR)
-		{
-		mb_error(verbose,error,&message);
-		fprintf(outfp,"\nMBIO Error allocating data arrays:\n%s\n",
-			message);
-		fprintf(outfp,"Try using ping averaging to reduce the number of data.\n");
-		fprintf(outfp,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-
-	/* read data in first swath file */
-
-	/* initialize the first swath file */
-	ndatafile = 0;
-	if ((status = mb_read_init(
-		verbose,ifile,iformat,pings,lonflip,bounds,
-		btime_i,etime_i,speedmin,timegap,
-		&mbio_ptr,&btime_d,&etime_d,
-		&beams_bath,&beams_amp,&pixels_ss,&error)) != MB_SUCCESS)
-		{
-		mb_error(verbose,error,&message);
-		fprintf(outfp,"\nMBIO Error returned from function <mb_read_init>:\n%s\n",message);
-		fprintf(outfp,"\nMultibeam File <%s> not initialized for reading\n",ifile);
-		fprintf(outfp,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-
-	/* allocate memory for reading data arrays */
-	status = mb_mallocd(verbose,__FILE__,__LINE__,beams_bath*sizeof(double),(void **)&beamflag,&error);
-	status = mb_mallocd(verbose,__FILE__,__LINE__,beams_bath*sizeof(double),(void **)&bath,&error);
-	status = mb_mallocd(verbose,__FILE__,__LINE__,beams_bath*sizeof(double),(void **)&bathlon,&error);
-	status = mb_mallocd(verbose,__FILE__,__LINE__,beams_bath*sizeof(double),(void **)&bathlat,&error);
-	status = mb_mallocd(verbose,__FILE__,__LINE__,beams_amp*sizeof(double),(void **)&amp,&error);
-	status = mb_mallocd(verbose,__FILE__,__LINE__,pixels_ss*sizeof(double),(void **)&ss,&error);
-	status = mb_mallocd(verbose,__FILE__,__LINE__,pixels_ss*sizeof(double),(void **)&sslon,&error);
-	status = mb_mallocd(verbose,__FILE__,__LINE__,pixels_ss*sizeof(double),(void **)&sslat,&error);
-
-	/* if error initializing memory then quit */
-	if (error != MB_ERROR_NO_ERROR)
-		{
-		mb_error(verbose,error,&message);
-		fprintf(outfp,"\nMBIO Error allocating data arrays:\n%s\n",
-			message);
-		fprintf(outfp,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-
-	/* loop over reading */
-	while (error <= MB_ERROR_NO_ERROR)
-		{
-		status = mb_read(verbose,mbio_ptr,&kind,
-			&rpings,time_i,&time_d,
-			&navlon,&navlat,
-			&speed,&heading,
-			&distance,&altitude,&sonardepth,
-			&beams_bath,&beams_amp,&pixels_ss,
-			beamflag,bath,amp,bathlon,bathlat,
-			ss,sslon,sslat,
-			comment,&error);
-
-		/* time gaps are not a problem here */
-		if (error == MB_ERROR_TIME_GAP)
-			{
-			error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-
-		/* print debug statements */
-		if (verbose >= 2)
-			{
-			fprintf(stderr,"\ndbg2  Ping read in program <%s>\n",program_name);
-			fprintf(stderr,"dbg2       kind:           %d\n",kind);
-			fprintf(stderr,"dbg2       beams_bath:     %d\n",beams_bath);
-			fprintf(stderr,"dbg2       beams_amp:      %d\n",beams_amp);
-			fprintf(stderr,"dbg2       pixels_ss:      %d\n",pixels_ss);
-			fprintf(stderr,"dbg2       error:          %d\n",error);
-			fprintf(stderr,"dbg2       status:         %d\n",status);
-			}
-
-		if (error == MB_ERROR_NO_ERROR)
-			{
-			for (ib=0;ib<beams_bath;ib++)
-				if (mb_beam_ok(beamflag[ib]))
-				{
-				ix = (bathlon[ib] - bounds[0])/dx;
-				iy = (bathlat[ib] - bounds[2])/dy;
-				if (ix >= 0 && ix < xdim
-					&& iy >= 0 && iy < ydim)
-					{
-					indx = ix + iy*xdim;
-					zone = idata[indx].ptr;
-					zone[icount[indx]].x =
-						deglontokm*
-						(bathlon[ib] - bounds[0]);
-					zone[icount[indx]].y =
-						deglattokm*
-						(bathlat[ib] - bounds[2]);
-					zone[icount[indx]].d = 0.001*bath[ib];
-					zone[icount[indx]].h = heading;
-					icount[indx]++;
-					ndatafile++;
-					}
-				}
-			}
-		}
-	status = mb_close(verbose,&mbio_ptr,&error);
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&beamflag,&error);
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&bath,&error);
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&bathlon,&error);
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&bathlat,&error);
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&amp,&error);
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&ss,&error);
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&sslon,&error);
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&sslat,&error);
-	status = MB_SUCCESS;
-	error = MB_ERROR_NO_ERROR;
-	if (verbose >= 2)
-		fprintf(outfp,"\n");
-	fprintf(outfp,"%d depth points read from %s\n",
-			ndatafile,ifile);
-
-	/* read data in second swath file */
-
-	/* initialize the second swath file */
-	ndatafile = 0;
-	if ((status = mb_read_init(
-		verbose,jfile,jformat,pings,lonflip,bounds,
-		btime_i,etime_i,speedmin,timegap,
-		&mbio_ptr,&btime_d,&etime_d,
-		&beams_bath,&beams_amp,&pixels_ss,&error)) != MB_SUCCESS)
-		{
-		mb_error(verbose,error,&message);
-		fprintf(outfp,"\nMBIO Error returned from function <mb_read_init>:\n%s\n",message);
-		fprintf(outfp,"\nMultibeam File <%s> not initialized for reading\n",jfile);
-		fprintf(outfp,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-
-	/* allocate memory for reading data arrays */
-	status = mb_mallocd(verbose,__FILE__,__LINE__,beams_bath*sizeof(char),(void **)&beamflag,&error);
-	status = mb_mallocd(verbose,__FILE__,__LINE__,beams_bath*sizeof(double),(void **)&bath,&error);
-	status = mb_mallocd(verbose,__FILE__,__LINE__,beams_bath*sizeof(double),(void **)&bathlon,&error);
-	status = mb_mallocd(verbose,__FILE__,__LINE__,beams_bath*sizeof(double),(void **)&bathlat,&error);
-	status = mb_mallocd(verbose,__FILE__,__LINE__,beams_amp*sizeof(double),(void **)&amp,&error);
-	status = mb_mallocd(verbose,__FILE__,__LINE__,pixels_ss*sizeof(double),(void **)&ss,&error);
-	status = mb_mallocd(verbose,__FILE__,__LINE__,pixels_ss*sizeof(double),(void **)&sslon,&error);
-	status = mb_mallocd(verbose,__FILE__,__LINE__,pixels_ss*sizeof(double),(void **)&sslat,&error);
-
-	/* if error initializing memory then quit */
-	if (error != MB_ERROR_NO_ERROR)
-		{
-		mb_error(verbose,error,&message);
-		fprintf(outfp,"\nMBIO Error allocating data arrays:\n%s\n",
-			message);
-		fprintf(outfp,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-
-	/* loop over reading */
-	while (error <= MB_ERROR_NO_ERROR)
-		{
-		status = mb_read(verbose,mbio_ptr,&kind,
-			&rpings,time_i,&time_d,
-			&navlon,&navlat,
-			&speed,&heading,
-			&distance,&altitude,&sonardepth,
-			&beams_bath,&beams_amp,&pixels_ss,
-			beamflag,bath,amp,bathlon,bathlat,
-			ss,sslon,sslat,
-			comment,&error);
-
-		/* time gaps are not a problem here */
-		if (error == MB_ERROR_TIME_GAP)
-			{
-			error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-
-		/* print debug statements */
-		if (verbose >= 2)
-			{
-			fprintf(stderr,"\ndbg2  Ping read in program <%s>\n",program_name);
-			fprintf(stderr,"dbg2       kind:           %d\n",kind);
-			fprintf(stderr,"dbg2       beams_bath:     %d\n",beams_bath);
-			fprintf(stderr,"dbg2       beams_amp:      %d\n",beams_amp);
-			fprintf(stderr,"dbg2       pixels_ss:      %d\n",pixels_ss);
-			fprintf(stderr,"dbg2       error:          %d\n",error);
-			fprintf(stderr,"dbg2       status:         %d\n",status);
-			}
-
-		if (error == MB_ERROR_NO_ERROR)
-			{
-			for (ib=0;ib<beams_bath;ib++)
-				if (mb_beam_ok(beamflag[ib]))
-				{
-				ix = (bathlon[ib] - bounds[0])/dx;
-				iy = (bathlat[ib] - bounds[2])/dy;
-				if (ix >= 0 && ix < xdim
-					&& iy >= 0 && iy < ydim)
-					{
-					indx = ix + iy*xdim;
-					zone = jdata[indx].ptr;
-					zone[jcount[indx]].x =
-						deglontokm*
-						(bathlon[ib] - bounds[0]);
-					zone[jcount[indx]].y =
-						deglattokm*
-						(bathlat[ib] - bounds[2]);
-					zone[jcount[indx]].d = 0.001*bath[ib];
-					zone[jcount[indx]].h = heading;
-					jcount[indx]++;
-					ndatafile++;
-					}
-				}
-			}
-		}
-	status = mb_close(verbose,&mbio_ptr,&error);
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&beamflag,&error);
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&bath,&error);
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&bathlon,&error);
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&bathlat,&error);
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&amp,&error);
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&ss,&error);
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&sslon,&error);
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&sslat,&error);
-	status = MB_SUCCESS;
-	error = MB_ERROR_NO_ERROR;
-	if (verbose >= 2)
-		fprintf(outfp,"\n");
-	fprintf(outfp,"%d depth points read from %s\n",
-			ndatafile,jfile);
-
-	/* loop over regions */
-	for (i=0;i<xdim;i++)
-	  for (j=0;j<ydim;j++)
-		{
-		/* set index */
-		indx = i + j*xdim;
-
-		/* print out id info */
-		fprintf(outfp,"\nRegion %d (%d %d) bounds:\n",j+i*ydim,i,j);
-		fprintf(outfp,"    Longitude: %9.4f %9.4f\n",
-			bounds[0]+dx*i,bounds[0]+dx*(i+1));
-		fprintf(outfp,"    Latitude:  %9.4f %9.4f\n",
-			bounds[2]+dy*j,bounds[2]+dy*(j+1));
-
-		/* get the best fitting planes */
-		if (icount[indx] >= MINIMUM_NUMBER_DATA
-			&& jcount[indx] >= MINIMUM_NUMBER_DATA)
-			{
-			/* use data from first data file */
-			zone = idata[indx].ptr;
-
-			/* zero the arrays */
-			ihh = 0.0;
-			hx = 0.0;
-			hy = 0.0;
-			for (ii=0;ii<nmatrix;ii++)
-			  {
-			  vector[ii] = 0.0;
-			  for (jj=0;jj<nmatrix;jj++)
-				matrix[ii][jj] = 0.0;
-			  }
-
-			/* construct normal equations */
-			for (kk=0;kk<icount[indx];kk++)
-			  {
-			  ihh += zone[kk].h;
-			  hx += sin(DTR * zone[kk].h);
-			  hy += cos(DTR * zone[kk].h);
-			  xx[0] = 1.0;
-			  xx[1] = zone[kk].x;
-			  xx[2] = zone[kk].y;
-			  for (ii=0;ii<nmatrix;ii++)
-			    {
-			    vector[ii] += zone[kk].d * xx[ii];
-			    for (jj=0;jj<nmatrix;jj++)
-				{
-				matrix[ii][jj] += xx[ii] * xx[jj];
-				}
-			    }
-			  }
-
-			/* solve the normal equations */
-			gauss((double *)matrix,vector,nmatrix,nmatrix,1.0e-08,&error,1);
-
-			/* get the solution */
-			iaa = vector[0];
-			ibb = vector[1];
-			icc = vector[2];
-			hx = hx/icount[indx];
-			hy = hy/icount[indx];
-			dd = sqrt(hx * hx + hy * hy);
-			if (dd > 0.0)
-				ihh = RTD * atan2((hx/dd), (hy/dd));
-			else
-				ihh = ihh/icount[indx];
-			if (ihh > 360.0)
-				ihh = ihh - 360.0;
-			else if (ihh < 0.0)
-				ihh = ihh + 360.0;
-
-			/* use data from second data file */
-			zone = jdata[indx].ptr;
-
-			/* zero the arrays */
-			jhh = 0.0;
-			hx = 0.0;
-			hy = 0.0;
-			for (ii=0;ii<nmatrix;ii++)
-			  {
-			  vector[ii] = 0.0;
-			  for (jj=0;jj<nmatrix;jj++)
-				matrix[ii][jj] = 0.0;
-			  }
-
-			/* construct normal equations */
-			for (kk=0;kk<jcount[indx];kk++)
-			  {
-			  jhh += zone[kk].h;
-			  hx += sin(DTR * zone[kk].h);
-			  hy += cos(DTR * zone[kk].h);
-			  xx[0] = 1.0;
-			  xx[1] = zone[kk].x;
-			  xx[2] = zone[kk].y;
-			  for (ii=0;ii<nmatrix;ii++)
-			    {
-			    vector[ii] += zone[kk].d * xx[ii];
-			    for (jj=0;jj<nmatrix;jj++)
-				{
-				matrix[ii][jj] += xx[ii] * xx[jj];
-				}
-			    }
-			  }
-
-			/* solve the normal equations */
-			gauss((double *)matrix,vector,nmatrix,nmatrix,1.0e-08,&error,1);
-			if (error != 0)
-				{
-				fprintf(outfp,"matrix inversion error: %d\n",error);
-				}
-
-			/* get the solution */
-			jaa = vector[0];
-			jbb = vector[1];
-			jcc = vector[2];
-			hx = hx/jcount[indx];
-			hy = hy/jcount[indx];
-			dd = sqrt(hx * hx + hy * hy);
-			if (dd > 0.0)
-				jhh = RTD * atan2((hx/dd), (hy/dd));
-			else
-				jhh = jhh/jcount[indx];
-			if (jhh > 360.0)
-				jhh = jhh - 360.0;
-			else if (jhh < 0.0)
-				jhh = jhh + 360.0;
-
-			/* report results */
-			fprintf(outfp,"First data file:    %s\n",ifile);
-			fprintf(outfp,"    Number of data: %d\n",
-				icount[indx]);
-			fprintf(outfp,"    Mean heading:   %f\n",ihh);
-			fprintf(outfp,"    Plane fit:      %f %f %f\n",
-				iaa,ibb,icc);
-			fprintf(outfp,"Second data file:   %s\n",jfile);
-			fprintf(outfp,"    Number of data: %d\n",
-				jcount[indx]);
-			fprintf(outfp,"    Mean heading:   %f\n",jhh);
-			fprintf(outfp,"    Plane fit:      %f %f %f\n",
-				jaa,jbb,jcc);
-
-			/* calculate roll bias */
-			if (fabs(ihh - jhh) > 90.0)
-				{
-				isine = sin(DTR*ihh);
-				icosine = cos(DTR*ihh);
-				jsine = sin(DTR*jhh);
-				jcosine = cos(DTR*jhh);
-				if (fabs(jcosine-icosine) > 1.0)
-					{
-					roll_bias = -(ibb - jbb)
-						/(jcosine - icosine);
-					}
-				else
-					{
-					roll_bias = -(icc - jcc)
-						/(isine - jsine);
-					}
-				fprintf(outfp,"Roll bias:   %f (%f degrees)\n",
-					roll_bias,atan(roll_bias)/DTR);
-				fprintf(outfp,"Roll bias is positive to starboard, negative to port.\n");
-				fprintf(outfp,"A postive roll bias means the vertical reference used by \n    the swath system is biased to starboard, \n    giving rise to shallow bathymetry to port and \n    deep bathymetry to starboard.\n");
-				}
-			else
-				fprintf(outfp,"Track headings too similar to calculate roll bias!\n");
-			}
-		else
-			fprintf(outfp,"Not enough data to proceed!\n");
-		}
-
-	/* deallocate space for data */
-	for (i=0;i<xdim;i++)
-		for (j=0;j<ydim;j++)
-			{
-			k = i*ydim + j;
-			if (icount[k] > 0)
-				{
-				status = mb_freed(verbose,__FILE__,__LINE__,(void **)&idata[k].ptr,&error);
-				}
-			if (jcount[k] > 0)
-				{
-				status = mb_freed(verbose,__FILE__,__LINE__,(void **)&jdata[k].ptr,&error);
-				}
-			}
-	status = mb_freed(verbose,__FILE__,__LINE__,(void **)&idata,&error);
-	status = mb_freed(verbose,__FILE__,__LINE__,(void **)&jdata,&error);
-	status = mb_freed(verbose,__FILE__,__LINE__,(void **)&icount,&error);
-	status = mb_freed(verbose,__FILE__,__LINE__,(void **)&jcount,&error);
-
-	/* check memory */
-	if (verbose >= 4)
-		status = mb_memory_list(verbose,&error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  Program <%s> completed\n",
-			program_name);
-		fprintf(stderr,"dbg2  Ending status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* end it all */
-	exit(error);
-}
-/*--------------------------------------------------------------------*/
-void gauss(double *a, double *vec,
-		int n, int nstore, double test,
-		int *ierror, int itriag)
-{
-
-/* subroutine gauss, by william menke */
-/* july 1978 (modified feb 1983, nov 85) */
-
-/* a subroutine to solve a system of n linear equations in n unknowns*/
-/* where n doesn't exceed 10 */
-/* gaussian reduction with partial pivoting is used */
-/*      a               (sent, destroyed)       n by n matrix           */
-/*      vec             (sent, overwritten)     n vector, replaced w/ solution*/
-/*      nstore          (sent)                  dimension of a  */
-/*      test            (sent)                  div by zero check number*/
-/*      ierror          (returned)              zero on no error*/
-/*      itriag          (sent)                  matrix triangularized only*/
-/*                                               on TRUE useful when solving*/
-/*                                               multiple systems with same a */
-        static int isub[10], l1;
-        int line[10], iet, ieb, i, j, k, l, j2;
-        double big, testa, b, sum;
-
-
-        iet=0;  /* initial error flags, one for triagularization*/
-        ieb=0;  /* one for backsolving */
-
-/* triangularize the matrix a*/
-/* replacing the zero elements of the triangularized matrix */
-/* with the coefficients needed to transform the vector vec */
-
-        if (itriag) {   /* triangularize matrix */
-
-                for( j=0; j<n; j++ ) {      /*line is an array of flags*/
-                        line[j]=0;
-                        /* elements of a are not moved during pivoting*/
-                        /* line=0 flags unused lines */
-                        }    /*end for j*/
-
-                for( j=0; j<n-1; j++ ) {
-                        /*  triangularize matrix by partial pivoting */
-                       big = 0.0; /* find biggest element in j-th column*/
-                                  /* of unused portion of matrix*/
-                       for( l1=0; l1<n; l1++ ) {
-                               if( line[l1]==0 ) {
-                                       testa=(double) fabs(
-                                                (double) (*(a+l1*nstore+j)) );
-                                       if (testa>big) {
-                                                i=l1;
-                                                big=testa;
-                                                } /*end if*/
-                                        } /*end if*/
-                                } /*end for l1*/
-                       if( big<=test) {   /* test for div by 0 */
-                               iet=1;
-                               } /*end if*/
-
-                       line[i]=1;  /* selected unused line becomes used line */
-                       isub[j]=i;  /* isub points to j-th row of tri. matrix */
-
-                       sum=1.0/(*(a+i*nstore+j));
-                                /*reduce matrix towards triangle */
-                       for( k=0; k<n; k++ ) {
-                                if( line[k]==0 ) {
-                                        b=(*(a+k*nstore+j))*sum;
-                                        for( l=j+1; l<n; l++ ) {
-                                               *(a+k*nstore+l)=
-                                                        (*(a+k*nstore+l))
-                                                        -b*(*(a+i*nstore+l));
-                                               } /*end for l*/
-                                       *(a+k*nstore+j)=b;
-                                        } /*end if*/
-                                } /*end for k*/
-                        } /*end for j*/
-
-               for( j=0; j<n; j++ ) {
-                        /*find last unused row and set its pointer*/
-                        /*  this row contians the apex of the triangle*/
-                        if( line[j]==0) {
-                                l1=j;   /*apex of triangle*/
-                                isub[n-1]=j;
-                                break;
-                                } /*end if*/
-                        } /*end for j*/
-
-                } /*end if itriag true*/
-
-        /*start backsolving*/
-
-        for( i=0; i<n; i++ ) {  /* invert pointers. line(i) now gives*/
-                                /* row no in triang matrix of i-th row*/
-                                /* of actual matrix */
-                line[isub[i]] = i;
-                } /*end for i*/
-
-        for( j=0; j<n-1; j++) { /*transform the vector to match triang. matrix*/
-               b=vec[isub[j]];
-               for( k=0; k<n; k++ ) {
-                      if (line[k]>j) {  /* skip elements outside of triangle*/
-                                vec[k]=vec[k]-(*(a+k*nstore+j))*b;
-                                } /*end if*/
-                        } /*end for k*/
-                } /*end for j*/
-
-      b = *(a+l1*nstore+(n-1));   /*apex of triangle*/
-      if( ((double)fabs( (double) b))<=test) {
-                /*check for div by zero in backsolving*/
-                ieb=2;
-                } /*end if*/
-      vec[isub[n-1]]=vec[isub[n-1]]/b;
-
-      for( j=n-2; j>=0; j-- ) { /* backsolve rest of triangle*/
-                sum=vec[isub[j]];
-                for( j2=j+1; j2<n; j2++ ) {
-                        sum = sum - vec[isub[j2]] * (*(a+isub[j]*nstore+j2));
-                        } /*end for j2*/
-                        b = *(a+isub[j]*nstore+j);
-               if( ((double)fabs((double)b))<=test) {
-                        /* test for div by 0 in backsolving */
-                        ieb=2;
-                        } /*end if*/
-                vec[isub[j]]=sum/b;   /*solution returned in vec*/
-                } /*end for j*/
-
-/*put the solution vector into the proper order*/
-
-      for( i=0; i<n; i++ ) {    /* reorder solution */
-                for( k=i; k<n; k++ ) {  /* search for i-th solution element */
-                        if( line[k]==i ) {
-                                j=k;
-                                break;
-                                } /*end if*/
-                        } /*end for k*/
-               b = vec[j];       /* swap solution and pointer elements*/
-               vec[j] = vec[i];
-               vec[i] = b;
-               line[j] = line[i];
-                } /*end for i*/
-
-      *ierror = iet + ieb;   /* set final error flag*/
-}
-
-/*--------------------------------------------------------------------*/
diff --git a/src/utilities/mbrolltimelag.c b/src/utilities/mbrolltimelag.c
deleted file mode 100644
index 339af13..0000000
--- a/src/utilities/mbrolltimelag.c
+++ /dev/null
@@ -1,785 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbrolltimelag.c	11/10/2005
- *
- *    $Id: mbrolltimelag.c 2230 2015-02-19 00:39:00Z caress $
- *
- *    Copyright (c) 2005-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * MBrolltimelag extracts the roll time series and the apparent bottom
- * slope (linear fit to unflagged soundings for each ping) time series
- * from swath data, and then calculates the cross correlation between
- * the roll and the slope minus roll for a specified set of time lags.
- * The suite of cross correlation calculations are made for each
- * successive npings pings (default = 100) in each swath file. The
- * results are output to files, and cross correlation plots are
- * generated.
- *
- * Author:	D. W. Caress
- * Date:	November 11, 2005
- *
- * $Log: mbrolltimelag.c,v $
- * Revision 5.7  2008/09/13 06:08:09  caress
- * Updates to apply suggested patches to segy handling. Also fixes to remove compiler warnings.
- *
- * Revision 5.6  2008/02/12 02:48:39  caress
- * Added ability to set output filename root.
- *
- * Revision 5.5  2006/06/16 19:30:58  caress
- * Check in after the Santa Monica Basin Mapping AUV Expedition.
- *
- * Revision 5.4  2006/04/26 22:05:26  caress
- * Changes to handle MBARI Mapping AUV data better.
- *
- * Revision 5.3  2006/04/19 18:31:23  caress
- * Fixed use of mbm_histplot.
- *
- * Revision 5.2  2006/04/11 19:19:30  caress
- * Various fixes.
- *
- * Revision 5.1  2006/01/18 15:17:00  caress
- * Added stdlib.h include.
- *
- * Revision 5.0  2006/01/06 18:20:56  caress
- * Working towards 5.0.8
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <math.h>
-#include <string.h>
-#include <time.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_define.h"
-
-#define	MBRTL_ALLOC_CHUNK	1000
-
-static char rcs_id[] = "$Id: mbrolltimelag.c 2230 2015-02-19 00:39:00Z caress $";
-
-/*--------------------------------------------------------------------*/
-
-int main (int argc, char **argv)
-{
-	/* id variables */
-	char program_name[] = "MBrolltimelag";
-	char help_message[] = "MBrolltimelag extracts the roll time series and the apparent \nbottom slope time series from swath data, and then calculates \nthe cross correlation between the roll and the slope minus roll \nfor a specified set of time lags.";
-	char usage_message[] = "mbrolltimelag -Iswathdata [-Fformat -Krollsource -Nnping -Ooutputname -Snavchannel -Tnlag/lagmin/lagmax -V -H ]";
-
-	/* parsing variables */
-	extern char *optarg;
-	int	errflg = 0;
-	int	c;
-	int	help = 0;
-	int	flag = 0;
-
-	/* MBIO status variables */
-	int	status = MB_SUCCESS;
-	int	verbose = 0;
-	int	error = MB_ERROR_NO_ERROR;
-
-	/* Files and formats */
-	char	swathdata[MB_PATH_MAXLINE];
-	char	swathfile[MB_PATH_MAXLINE];
-	char	swathroot[MB_PATH_MAXLINE];
-	char	outroot[MB_PATH_MAXLINE];
-	char	outroot_defined = MB_NO;
-	char	xcorfile[MB_PATH_MAXLINE];
-	char	xcorfiletot[MB_PATH_MAXLINE];
-	char	cmdfile[MB_PATH_MAXLINE];
-	char	estimatefile[MB_PATH_MAXLINE];
-	char	histfile[MB_PATH_MAXLINE];
-	char	fhistfile[MB_PATH_MAXLINE];
-	char	modelfile[MB_PATH_MAXLINE];
-	int	format = 0;
-	int	formatguess = 0;
-	FILE	*fp = NULL;
-	FILE	*fpx = NULL;
-	FILE	*fpf = NULL;
-	FILE	*fpt = NULL;
-	FILE	*fpe = NULL;
-	FILE	*fph = NULL;
-	FILE	*fpm = NULL;
-	int	read_datalist = MB_NO;
-	int	read_data = MB_NO;
-	void	*datalist;
-	int	look_processed = MB_DATALIST_LOOK_UNSET;
-	double	file_weight;
-
-	/* cross correlation parameters */
-	int	navchannel = 1;
-	int	kind = MB_DATA_DATA;
-	int	npings = 100;
-	double	rthreshold = 0.9;
-	int	nlag = 41;
-	double	lagstart = -2.0;
-	double	lagend = 2.0;
-	double	lagstep = 0.05;
-	double	*rr = NULL;
-
-	/* slope data */
-	int	nslope = 0;
-	int	nslopetot = 0;
-	int	nslope_alloc = 0;
-	double	*slope_time_d = NULL;
-	double	*slope_slope = NULL;
-	double	*slope_roll = NULL;
-	int	nroll = 0;
-	int	nroll_alloc = 0;
-	double	*roll_time_d = NULL;
-	double	*roll_roll = NULL;
-
-	/* timelag histogram array */
-	int	*timelaghistogram = NULL;
-
-	double	time_d;
-	double	roll;
-	double	slope;
-	double	timelag;
-	double	sumsloperoll;
-	double	sumslopesq;
-	double	sumrollsq;
-	double	slopeminusmean;
-	double	rollminusmean;
-	double	r;
-	double	sum_x = 0.0;
-	double	sum_y = 0.0;
-	double	sum_xy = 0.0;
-	double	sum_x2 = 0.0;
-	double	sum_y2 = 0.0;
-	double	mmm, bbb;
-
-	int	nrollmean;
-	double	rollmean;
-	double	slopemean;
-
-	double	maxtimelag;
-	double	maxr;
-	double	peaktimelag;
-	double	peakr;
-	int	peakk;
-	int	peakkmax;
-	int	peakksum;
-	double	time_d_avg;
-	int	nestimate = 0;
-	int	nmodel = 0;
-
-	int	nr;
-	double	rollint;
-	int	found;
-	int	nscan;
-	int	j0, j1;
-	int	shellstatus;
-	int	i, j, k, l;
-
-	/* set default input */
-	strcpy(swathdata, "datalist.mb-1");
-
-	/* process argument list */
-	while ((c = getopt(argc, argv, "VvHhC:c:F:f:I:i:K:k:O:o:N:n:S:s:T:t:")) != -1)
-	  switch (c)
-		{
-		case 'H':
-		case 'h':
-			help++;
-			break;
-		case 'V':
-		case 'v':
-			verbose++;
-			break;
-		case 'C':
-		case 'c':
-			sscanf (optarg,"%lf", &rthreshold);
-			flag++;
-			break;
-		case 'F':
-		case 'f':
-			sscanf (optarg,"%d", &format);
-			flag++;
-			break;
-		case 'I':
-		case 'i':
-			sscanf (optarg,"%s", swathdata);
-			flag++;
-			break;
-		case 'K':
-		case 'k':
-			sscanf (optarg,"%d", &kind);
-			flag++;
-			break;
-		case 'N':
-		case 'n':
-			sscanf (optarg,"%d", &npings);
-			flag++;
-			break;
-		case 'O':
-		case 'o':
-			sscanf (optarg,"%s", outroot);
-			outroot_defined = MB_YES;
-			flag++;
-			break;
-		case 'S':
-		case 's':
-			sscanf (optarg,"%d", &navchannel);
-			if (navchannel > 0)
-				kind = MB_DATA_NONE;
-			flag++;
-			break;
-		case 'T':
-		case 't':
-			sscanf (optarg,"%d/%lf/%lf", &nlag, &lagstart, &lagend);
-			flag++;
-			break;
-		case '?':
-			errflg++;
-		}
-
-	/* if error flagged then print it and exit */
-	if (errflg)
-		{
-		fprintf(stderr,"usage: %s\n", usage_message);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		error = MB_ERROR_BAD_USAGE;
-		exit(error);
-		}
-
-	/* print starting message */
-	if (verbose == 1 || help)
-		{
-		fprintf(stderr,"\nProgram %s\n",program_name);
-		fprintf(stderr,"Version %s\n",rcs_id);
-		fprintf(stderr,"MB-system Version %s\n",MB_VERSION);
-		}
-
-	/* print starting debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  Program <%s>\n",program_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Control Parameters:\n");
-		fprintf(stderr,"dbg2       verbose:         %d\n",verbose);
-		fprintf(stderr,"dbg2       help:            %d\n",help);
-		fprintf(stderr,"dbg2       format:          %d\n",format);
-		fprintf(stderr,"dbg2       rthreshold:      %f\n",rthreshold);
-		fprintf(stderr,"dbg2       swathdata:       %s\n",swathdata);
-		fprintf(stderr,"dbg2       npings:          %d\n",npings);
-		fprintf(stderr,"dbg2       nlag:            %d\n",nlag);
-		fprintf(stderr,"dbg2       lagstart:        %f\n",lagstart);
-		fprintf(stderr,"dbg2       lagend:          %f\n",lagend);
-		fprintf(stderr,"dbg2       navchannel:      %d\n",navchannel);
-		fprintf(stderr,"dbg2       kind:            %d\n",kind);
-		}
-
-	/* if help desired then print it and exit */
-	if (help)
-		{
-		fprintf(stderr,"\n%s\n",help_message);
-		fprintf(stderr,"\nusage: %s\n", usage_message);
-		exit(error);
-		}
-
-	/* get format if required */
-	mb_get_format(verbose,swathdata,swathroot,&formatguess,&error);
-	if (format == 0)
-		format = formatguess;
-	if (outroot_defined == MB_NO)
-		strcpy(outroot, swathroot);
-
-	/* determine whether to read one file or a list of files */
-	if (format < 0)
-		read_datalist = MB_YES;
-
-	/* get time lag step */
-	lagstep = (lagend - lagstart) / (nlag - 1);
-	status = mb_reallocd(verbose,__FILE__,__LINE__, nlag * sizeof(double), (void **)&rr, &error);
-	status = mb_reallocd(verbose,__FILE__,__LINE__, nlag * sizeof(int), (void **)&timelaghistogram, &error);
-
-	/* print out some helpful information */
-	if (verbose > 0)
-		{
-		fprintf(stderr, "Program %s parameters:\n", program_name);
-		fprintf(stderr, "  Input:                           %s\n", swathdata);
-		fprintf(stderr, "  Format:                          %d\n", format);
-		fprintf(stderr, "  Number of pings per estimate:    %d\n", npings);
-		fprintf(stderr, "  Number of time lag calculations: %d\n", nlag);
-		fprintf(stderr, "  Start time lag reported:         %f\n", lagstart);
-		fprintf(stderr, "  End time lag reported:           %f\n", lagend);
-		fprintf(stderr, "  Time lag step:                   %f\n", lagstep);
-		}
-
-	/* first get roll data from the entire swathdata (which can be a datalist ) */
-	if (kind > MB_DATA_NONE)
-		sprintf(cmdfile, "mbnavlist -I%s -F%d -K%d -OMR", swathdata, format, kind);
-	else
-		sprintf(cmdfile, "mbnavlist -I%s -F%d -N%d -OMR", swathdata, format, navchannel);
-	fprintf(stderr,"\nRunning %s...\n",cmdfile);
-	fp = popen(cmdfile, "r");
-	while ((nscan = fscanf(fp, "%lf %lf", &time_d, &roll)) == 2)
-		{
-		if (nroll >= nroll_alloc)
-			{
-			nroll_alloc += MBRTL_ALLOC_CHUNK;
-			status = mb_reallocd(verbose,__FILE__,__LINE__, nroll_alloc * sizeof(double), (void **)&roll_time_d, &error);
-			status = mb_reallocd(verbose,__FILE__,__LINE__, nroll_alloc * sizeof(double), (void **)&roll_roll, &error);
-			}
-		if (nroll == 0 || time_d > roll_time_d[nroll-1])
-			{
-			roll_time_d[nroll] = time_d;
-			roll_roll[nroll] = roll;
-			nroll++;
-			}
-		}
-	pclose(fp);
-	fprintf(stderr,"%d roll data read from %s\n", nroll, swathdata);
-
-	/* open total cross correlation file */
-	if (read_datalist == MB_YES)
-		{
-		sprintf(xcorfiletot, "%s_xcorr.txt", outroot);
-		if ((fpt = fopen(xcorfiletot, "w")) == NULL)
-			{
-			error = MB_ERROR_OPEN_FAIL;
-			fprintf(stderr,"\nUnable to open cross correlation output: %s\n",
-				xcorfiletot);
-			fprintf(stderr,"\nProgram <%s> Terminated\n",
-				program_name);
-			exit(error);
-			}
-		}
-
-	/* open time lag estimate file */
-	sprintf(estimatefile, "%s_timelagest.txt", outroot);
-	if ((fpe = fopen(estimatefile, "w")) == NULL)
-		{
-		error = MB_ERROR_OPEN_FAIL;
-		fprintf(stderr,"\nUnable to open estimate output: %s\n",
-			estimatefile);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-
-	/* open time lag histogram file */
-	sprintf(histfile, "%s_timelaghist.txt", outroot);
-	if ((fph = fopen(histfile, "w")) == NULL)
-		{
-		error = MB_ERROR_OPEN_FAIL;
-		fprintf(stderr,"\nUnable to open histogram output: %s\n",
-			histfile);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-
-	/* open time lag model file */
-	sprintf(modelfile, "%s_timelagmodel.txt", outroot);
-	if ((fpm = fopen(modelfile, "w")) == NULL)
-		{
-		error = MB_ERROR_OPEN_FAIL;
-		fprintf(stderr,"\nUnable to open time lag model output: %s\n",
-			modelfile);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-
-	/* open file list */
-	if (read_datalist == MB_YES)
-	    {
-	    if ((status = mb_datalist_open(verbose,&datalist,
-					    swathdata,look_processed,&error)) != MB_SUCCESS)
-		{
-		error = MB_ERROR_OPEN_FAIL;
-		fprintf(stderr,"\nUnable to open data list file: %s\n",
-			swathdata);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-	    if ((status = mb_datalist_read(verbose,datalist,
-			    swathfile,&format,&file_weight,&error))
-			    == MB_SUCCESS)
-		read_data = MB_YES;
-	    else
-		read_data = MB_NO;
-	    }
-	/* else copy single filename to be read */
-	else
-	    {
-	    strcpy(swathfile, swathdata);
-	    read_data = MB_YES;
-	    }
-
-	/* loop over all files to be read */
-	while (read_data == MB_YES)
-		{
-		nestimate = 0;
-		nslope = 0;
-		time_d_avg = 0.0;
-		sprintf(cmdfile, "mblist -I%s -F%d -OMAR", swathfile, format);
-		fprintf(stderr,"\nRunning %s...\n",cmdfile);
-		fp = popen(cmdfile, "r");
-		while ((nscan = fscanf(fp, "%lf %lf %lf", &time_d, &slope, &roll)) == 3)
-			{
-			if (nslope >= nslope_alloc)
-				{
-				nslope_alloc += MBRTL_ALLOC_CHUNK;
-				status = mb_reallocd(verbose,__FILE__,__LINE__, nslope_alloc * sizeof(double), (void **)&slope_time_d, &error);
-				status = mb_reallocd(verbose,__FILE__,__LINE__, nslope_alloc * sizeof(double), (void **)&slope_slope, &error);
-				status = mb_reallocd(verbose,__FILE__,__LINE__, nslope_alloc * sizeof(double), (void **)&slope_roll, &error);
-				}
-			if (nslope == 0 || time_d > slope_time_d[nslope-1])
-				{
-				slope_time_d[nslope] = time_d;
-				time_d_avg += time_d;
-				slope_slope[nslope] = roll - slope;
-				slope_roll[nslope] = roll;
-				nslope++;
-				}
-			}
-		pclose(fp);
-		nslopetot += nslope;
-		if (nslope > 0)
-			time_d_avg /= nslope;
-		fprintf(stderr,"%d slope data read from %s\n", nslope, swathfile);
-
-		/* open time lag histogram file */
-		sprintf(fhistfile, "%s_timelaghist.txt", swathfile);
-		if ((fpf = fopen(fhistfile, "w")) == NULL)
-			{
-			error = MB_ERROR_OPEN_FAIL;
-			fprintf(stderr,"\nUnable to open histogram output: %s\n",
-				fhistfile);
-			fprintf(stderr,"\nProgram <%s> Terminated\n",
-				program_name);
-			exit(error);
-			}
-
-		/* open cross correlation file */
-		sprintf(xcorfile, "%s_xcorr.txt", swathfile);
-		if ((fpx = fopen(xcorfile, "w")) == NULL)
-			{
-			error = MB_ERROR_OPEN_FAIL;
-			fprintf(stderr,"\nUnable to open cross correlation output: %s\n",
-				xcorfile);
-			fprintf(stderr,"\nProgram <%s> Terminated\n",
-				program_name);
-			exit(error);
-			}
-
-		/* initialize time lag histogram */
-		for (k=0;k<nlag;k++)
-			{
-			timelaghistogram[k] = 0;
-			}
-
-		/* now do cross correlation calculations */
-		for (i=0;i<nslope/npings;i++)
-			{
-			/* get ping range in this chunk */
-			j0 = i * npings;
-			j1 = j0 + npings - 1;
-
-			/* get mean slope in this chunk */
-			slopemean = 0.0;
-			for (j = j0; j <= j1; j++)
-				{
-				slopemean += slope_slope[j];
-				}
-			slopemean /= npings;
-
-			/* get mean roll in this chunk */
-			rollmean = 0.0;
-			nrollmean = 0;
-			for (j = 0; j < nroll; j++)
-				{
-				if ((roll_time_d[j] >= slope_time_d[j0] + lagstart)
-					&& (roll_time_d[j] <= slope_time_d[j1] + lagend))
-					{
-					rollmean += roll_roll[j];
-					nrollmean++;
-					}
-				}
-			if (nrollmean > 0)
-				{
-				rollmean /= nrollmean;
-				}
-
-			/* calculate cross correlation for the specified time lags */
-			if (nrollmean > 0)
-				{
-				fprintf(fpx, ">\n");
-				if (fpt != NULL)
-					fprintf(fpt, ">\n");
-				for (k = 0; k < nlag; k++)
-					{
-					timelag = lagstart + k * lagstep;
-					sumsloperoll = 0.0;
-					sumslopesq = 0.0;
-					sumrollsq = 0.0;
-					nr = 0;
-
-					for (j = j0; j <= j1; j++)
-						{
-						/* interpolate lagged roll value */
-						found = MB_NO;
-						time_d = slope_time_d[j] + timelag;
-						for (l = nr; l < nroll - 1 && found == MB_NO; l++)
-							{
-							if (time_d >= roll_time_d[l]
-								&& time_d <= roll_time_d[l+1])
-								{
-								nr = l;
-								found = MB_YES;
-								}
-							}
-						if (found == MB_NO && time_d < roll_time_d[0])
-							{
-							rollint = roll_roll[0];
-							}
-						else if (found == MB_NO && time_d > roll_time_d[nroll - 1])
-							{
-							rollint = roll_roll[nroll - 1];
-							}
-						else
-							{
-							rollint = roll_roll[nr] + (roll_roll[nr+1] - roll_roll[nr])
-										* (time_d - roll_time_d[nr])
-										/ (roll_time_d[nr+1] - roll_time_d[nr]);
-							}
-
-						/* add to sums */
-						slopeminusmean = (slope_slope[j] - slopemean);
-						rollminusmean = (rollint - rollmean);
-						sumslopesq += slopeminusmean * slopeminusmean;
-						sumrollsq += rollminusmean * rollminusmean;
-						sumsloperoll += slopeminusmean * rollminusmean;
-						}
-
-					if (sumslopesq > 0.0 && sumrollsq > 0.0)
-						r = sumsloperoll / sqrt(sumslopesq) / sqrt(sumrollsq);
-					else
-						r = 0.0;
-					rr[k] = r;
-
-					/* output results */
-					fprintf(fpx, "%5.3f %5.3f \n", timelag, r);
-					if (fpt != NULL)
-						fprintf(fpt, "%5.3f %5.3f \n", timelag, r);
-					}
-
-				/* get max and closest peak cross correlations */
-				maxr = 0.0;
-				peakr = 0.0;
-				peaktimelag = 0.0;
-				for (k = 0; k < nlag; k++)
-					{
-					timelag = lagstart + k * lagstep;
-					if (timelag >= lagstart && timelag <= lagend)
-						{
-						if (rr[k] > maxr)
-							{
-							maxr = rr[k];
-							maxtimelag = timelag;
-							}
-						if (k == 0)
-							{
-							peakk = k;
-							peakr = rr[k];
-							peaktimelag = timelag;
-							}
-						else if (k < nlag - 1
-							&& rr[k] > 0.0
-							&& rr[k] > rr[k-1]
-							&& rr[k] > rr[k+1]
-							&& (peaktimelag == lagstart
-								|| rr[k] > peakr))
-							{
-							peakk = k;
-							peakr = rr[k];
-							peaktimelag = timelag;
-							}
-						else if (k == nlag - 1
-							&& peaktimelag == lagstart
-							&& rr[k] > peakr)
-							{
-							peakk = k;
-							peakr = rr[k];
-							peaktimelag = timelag;
-							}
-						}
-					}
-				}
-
-			/* print out best correlated time lag estimates */
-			if (peakr > rthreshold)
-				{
-				timelaghistogram[peakk]++;
-				}
-
-			/* augment histogram */
-			if (peakr > rthreshold)
-				{
-				fprintf(fpe, "%10.3f %6.3f\n", slope_time_d[(j0+j1)/2], peaktimelag);
-				fprintf(fpf, "%6.3f\n", peaktimelag);
-				fprintf(fph, "%6.3f\n", peaktimelag);
-				sum_x += slope_time_d[(j0+j1)/2];
-				sum_y += peaktimelag;
-				sum_xy += slope_time_d[(j0+j1)/2] * peaktimelag;
-				sum_x2 += slope_time_d[(j0+j1)/2] * slope_time_d[(j0+j1)/2];
-				sum_y2 += peaktimelag * peaktimelag;
-				nestimate++;
-				}
-
-			/* print out max and closest peak cross correlations */
-			if (verbose > 0)
-				{
-				fprintf(stderr, "cross correlation pings %5d - %5d: max: %6.3f %5.3f  peak: %6.3f %5.3f\n",
-				j0, j1, maxtimelag, maxr, peaktimelag, peakr);
-				}
-			}
-
-		/* close cross correlation and histogram files */
-		fclose(fpx);
-		fclose(fpf);
-
-		/* generate plot shellscript for cross correlation file */
-		sprintf(cmdfile, "mbm_xyplot -I%s -N", xcorfile);
-		fprintf(stderr, "Running: %s...\n", cmdfile);
-		shellstatus = system(cmdfile);
-
-		/* generate plot shellscript for time lag histogram */
-		sprintf(cmdfile, "mbm_histplot -I%s -C%g -L\"Frequency Histogram of %s:Time Lag (sec):Frequency:\"",
-				fhistfile, lagstep, swathfile);
-		fprintf(stderr, "Running: %s...\n", cmdfile);
-		shellstatus = system(cmdfile);
-
-		/* output peak time lag */
-		peakk = 0;
-		peakkmax = 0;
-		peakksum = 0;
-		timelag = 0.0;
-		for (k=0;k<nlag;k++)
-			{
-			if (timelaghistogram[k] > peakkmax)
-				{
-				peakkmax = timelaghistogram[k];
-				peakk = k;
-				}
-			peakksum += timelaghistogram[k];
-			}
-		if (nslope > 0 && peakksum > 0 && peakkmax > 1
-			&& peakkmax > peakksum / 5)
-			{
-			timelag = lagstart + peakk * lagstep;
-			fprintf(fpm, "%f %f\n", time_d_avg, timelag);
-			nmodel++;
-			fprintf(stderr,"Time lag model point: %f %f | nslope:%d peakksum:%d peakkmax:%d\n",
-				time_d_avg, timelag, nslope, peakksum, peakkmax);
-			}
-		else
-			{
-			if (peakkmax > 0)
-				timelag = lagstart + peakk * lagstep;
-			fprintf(stderr,"Time lag model point: %f %f | nslope:%d peakksum:%d peakkmax:%d | REJECTED\n",
-				time_d_avg, timelag, nslope, peakksum, peakkmax);
-			}
-
-		/* figure out whether and what to read next */
-        	if (read_datalist == MB_YES)
-                	{
-			if ((status = mb_datalist_read(verbose,datalist,
-				    swathfile,&format,&file_weight,&error))
-				    == MB_SUCCESS)
-                        	read_data = MB_YES;
-                	else
-                        	read_data = MB_NO;
-                	}
-        	else
-                	{
-                	read_data = MB_NO;
-                	}
-
-		/* end loop over files in list */
-		}
-	if (read_datalist == MB_YES)
-		mb_datalist_close(verbose,&datalist,&error);
-
-	/* close cross correlation file */
-	if (read_datalist == MB_YES)
-		fclose(fpt);
-
-	/* close estimate file */
-	fclose(fpe);
-
-	/* close histogram file */
-	fclose(fph);
-
-	/* close time lag model file */
-	fclose(fpm);
-
-	/* generate plot shellscript for cross correlation file */
-	if (read_datalist == MB_YES)
-		{
-		sprintf(cmdfile, "mbm_xyplot -I%s -N -L\"Roll Correlation With Acrosstrack Slope:Time Lag (sec):Correlation:\"", xcorfiletot);
-		fprintf(stderr, "Running: %s...\n", cmdfile);
-		shellstatus = system(cmdfile);
-		}
-
-	/* generate plot shellscript for time lag histogram */
-	sprintf(cmdfile, "mbm_histplot -I%s -C%g -L\"Frequency Histogram of %s:Time Lag (sec):Frequency:\"",
-			histfile, lagstep, swathdata);
-	fprintf(stderr, "Running: %s...\n", cmdfile);
-	shellstatus = system(cmdfile);
-
-	/* generate plot shellscript for time lag model if it exists */
-	if (nmodel > 1 || nestimate > 1)
-		{
-		mmm = (nestimate * sum_xy - sum_x * sum_y) / (nestimate * sum_x2 - sum_x * sum_x);
-		bbb = (sum_y - mmm * sum_x) / nestimate;
-
-		sprintf(cmdfile, "mbm_xyplot -I%s -ISc0.05:%s -I%s -ISc0.1:%s -L\"Time lag model of %s:Time (sec):Time Lag (sec):\"",
-				modelfile, estimatefile, modelfile, modelfile, swathdata);
-		fprintf(stderr, "Running: %s...\n", cmdfile);
-		shellstatus = system(cmdfile);
-		}
-
-	/* deallocate memory for data arrays */
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&slope_time_d,&error);
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&slope_slope,&error);
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&slope_roll,&error);
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&roll_time_d,&error);
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&roll_roll,&error);
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&rr,&error);
-	mb_freed(verbose,__FILE__,__LINE__,(void **)&timelaghistogram,&error);
-
-	/* check memory */
-	if (verbose >= 4)
-		status = mb_memory_list(verbose,&error);
-
-	/* give the statistics */
-	if (verbose >= 1)
-		{
-		fprintf(stderr,"\n%d input roll records\n", nroll);
-		fprintf(stderr,"%d input slope\n", nslopetot);
-		}
-
-	/* end it all */
-	exit(error);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/utilities/mbroutetime.c b/src/utilities/mbroutetime.c
deleted file mode 100644
index 73b12b7..0000000
--- a/src/utilities/mbroutetime.c
+++ /dev/null
@@ -1,626 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbroutetime.c	5/4/2009
- *    $Id: mbroutetime.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 2009-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbroutetime outputs a list of the times when a survey hit the waypoints
- * of a planned survey route. This (lon lat time_d) list can then be used by mbextractsegy
- * or mb7k2ss to extract subbottom (or sidescan) data into files corresponding
- * to the lines between waypoints. The input route files are in the MBgrdviz
- * route file format. The times are in decimal epoch seconds (seconds since 1/1/1970).
- *
- * Author:	D. W. Caress
- * Date:	May 5, 2009
- * Location:	R/V Thompson, at the dock in Apia, Samoa
- *
- * $Log: mbroutetime.c,v $
- *
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <math.h>
-#include <string.h>
-
-/* MBIO include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_define.h"
-
-/* defines */
-#define MBES_ALLOC_NUM			128
-#define MBES_ROUTE_WAYPOINT_NONE		0
-#define MBES_ROUTE_WAYPOINT_SIMPLE	1
-#define MBES_ROUTE_WAYPOINT_TRANSIT	2
-#define MBES_ROUTE_WAYPOINT_STARTLINE	3
-#define MBES_ROUTE_WAYPOINT_ENDLINE	4
-#define MBES_ONLINE_THRESHOLD		15.0
-#define MBES_ONLINE_COUNT		30
-
-static char rcs_id[] = "$Id: mbroutetime.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-
-int main (int argc, char **argv)
-{
-	char program_name[] = "MBroutetime";
-	char help_message[] =  "MBroutetime outputs a list of the times when a survey hit the waypoints\nof a planned survey route. This (lon lat time_d) list can then be used by mbextractsegy\nor mb7k2ss to extract subbottom (or sidescan) data into files corresponding\nto the lines between waypoints.";
-	char usage_message[] = "mbroutetime  -Rroutefile [-Fformat -Ifile -Owaypointtimefile -Urangethreshold -H -V]";
-	extern char *optarg;
-	int	errflg = 0;
-	int	c;
-	int	help = 0;
-	int	flag = 0;
-
-	/* MBIO status variables */
-	int	status = MB_SUCCESS;
-	int	verbose = 0;
-	int	error = MB_ERROR_NO_ERROR;
-	char	*message;
-
-	/* MBIO read control parameters */
-	int	read_datalist = MB_NO;
-	char	read_file[MB_PATH_MAXLINE];
-	char	output_file[MB_PATH_MAXLINE];
-	int	output_file_set = MB_NO;
-	void	*datalist;
-	int	look_processed = MB_DATALIST_LOOK_UNSET;
-	double	file_weight;
-	int	format;
-	int	pings;
-	int	lonflip;
-	double	bounds[4];
-	int	btime_i[7];
-	int	etime_i[7];
-	double	btime_d;
-	double	etime_d;
-	double	speedmin;
-	double	timegap;
-	char	file[MB_PATH_MAXLINE];
-	int	beams_bath;
-	int	beams_amp;
-	int	pixels_ss;
-
-	/* MBIO read values */
-	void	*mbio_ptr = NULL;
-	void	*store_ptr = NULL;
-	int	kind;
-	int	time_i[7];
-	double	time_d;
-	double	navlon;
-	double	navlat;
-	double	speed;
-	double	heading;
-	double	distance;
-	double	altitude;
-	double	sonardepth;
-	char	*beamflag = NULL;
-	double	*bath = NULL;
-	double	*bathacrosstrack = NULL;
-	double	*bathalongtrack = NULL;
-	double	*amp = NULL;
-	double	*ss = NULL;
-	double	*ssacrosstrack = NULL;
-	double	*ssalongtrack = NULL;
-	char	comment[MB_COMMENT_MAXLINE];
-
-	/* route and auto-line data */
-	char	route_file[MB_PATH_MAXLINE];
-	int	rawroutefile = MB_NO;
-	int	nroutepoint = 0;
-	int	nroutepointfound = 0;
-	int	nroutepointalloc = 0;
-	double	lon;
-	double	lat;
-	double	topo;
-	int	waypoint;
-	double	*routelon = NULL;
-	double	*routelat = NULL;
-	double	*routeheading = NULL;
-	int	*routewaypoint = NULL;
-	double	*routetime_d = NULL;
-	double	range;
-	double	rangethreshold = 25.0;
-	double	rangelast;
-	int	activewaypoint = 0;
-
-	double	mtodeglon, mtodeglat;
-	double	lastlon;
-	double	lastlat;
-	double	lastheading;
-	double	lasttime_d;
-	double	dx, dy;
-	FILE	*fp = NULL;
-	char	*result;
-	int	nget;
-	int	point_ok;
-	int	read_data;
-	int	nread;
-	int	i;
-
-	/* get current default values */
-	status = mb_defaults(verbose,&format,&pings,&lonflip,bounds,
-		btime_i,etime_i,&speedmin,&timegap);
-
-	/* set default input to datalist.mb-1 */
-	strcpy (read_file, "datalist.mb-1");
-
-	/* process argument list */
-	while ((c = getopt(argc, argv, "F:f:I:i:O:o:R:r:U:u:VvHh")) != -1)
-	  switch (c)
-		{
-		case 'H':
-		case 'h':
-			help++;
-			break;
-		case 'V':
-		case 'v':
-			verbose++;
-			break;
-		case 'F':
-		case 'f':
-			sscanf (optarg,"%d", &format);
-			flag++;
-			break;
-		case 'I':
-		case 'i':
-			sscanf (optarg,"%s", read_file);
-			flag++;
-			break;
-		case 'O':
-		case 'o':
-			sscanf (optarg,"%s", output_file);
-			output_file_set = MB_YES;
-			flag++;
-			break;
-		case 'R':
-		case 'r':
-			sscanf (optarg,"%s", route_file);
-			flag++;
-			break;
-		case 'U':
-		case 'u':
-			sscanf (optarg,"%lf", &rangethreshold);
-			flag++;
-			break;
-		case '?':
-			errflg++;
-		}
-
-	/* if error flagged then print it and exit */
-	if (errflg)
-		{
-		fprintf(stderr,"usage: %s\n", usage_message);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		error = MB_ERROR_BAD_USAGE;
-		exit(error);
-		}
-
-	/* print starting message */
-	if (verbose == 1 || help)
-		{
-		fprintf(stderr,"\nProgram %s\n",program_name);
-		fprintf(stderr,"Version %s\n",rcs_id);
-		fprintf(stderr,"MB-system Version %s\n",MB_VERSION);
-		}
-
-	/* print starting debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  Program <%s>\n",program_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Control Parameters:\n");
-		fprintf(stderr,"dbg2       verbose:           %d\n",verbose);
-		fprintf(stderr,"dbg2       help:              %d\n",help);
-		fprintf(stderr,"dbg2       format:            %d\n",format);
-		fprintf(stderr,"dbg2       pings:             %d\n",pings);
-		fprintf(stderr,"dbg2       lonflip:           %d\n",lonflip);
-		fprintf(stderr,"dbg2       bounds[0]:         %f\n",bounds[0]);
-		fprintf(stderr,"dbg2       bounds[1]:         %f\n",bounds[1]);
-		fprintf(stderr,"dbg2       bounds[2]:         %f\n",bounds[2]);
-		fprintf(stderr,"dbg2       bounds[3]:         %f\n",bounds[3]);
-		fprintf(stderr,"dbg2       btime_i[0]:        %d\n",btime_i[0]);
-		fprintf(stderr,"dbg2       btime_i[1]:        %d\n",btime_i[1]);
-		fprintf(stderr,"dbg2       btime_i[2]:        %d\n",btime_i[2]);
-		fprintf(stderr,"dbg2       btime_i[3]:        %d\n",btime_i[3]);
-		fprintf(stderr,"dbg2       btime_i[4]:        %d\n",btime_i[4]);
-		fprintf(stderr,"dbg2       btime_i[5]:        %d\n",btime_i[5]);
-		fprintf(stderr,"dbg2       btime_i[6]:        %d\n",btime_i[6]);
-		fprintf(stderr,"dbg2       etime_i[0]:        %d\n",etime_i[0]);
-		fprintf(stderr,"dbg2       etime_i[1]:        %d\n",etime_i[1]);
-		fprintf(stderr,"dbg2       etime_i[2]:        %d\n",etime_i[2]);
-		fprintf(stderr,"dbg2       etime_i[3]:        %d\n",etime_i[3]);
-		fprintf(stderr,"dbg2       etime_i[4]:        %d\n",etime_i[4]);
-		fprintf(stderr,"dbg2       etime_i[5]:        %d\n",etime_i[5]);
-		fprintf(stderr,"dbg2       etime_i[6]:        %d\n",etime_i[6]);
-		fprintf(stderr,"dbg2       speedmin:          %f\n",speedmin);
-		fprintf(stderr,"dbg2       timegap:           %f\n",timegap);
-		fprintf(stderr,"dbg2       read_file:         %s\n",read_file);
-		fprintf(stderr,"dbg2       route_file:        %s\n",route_file);
-		fprintf(stderr,"dbg2       output_file_set:   %d\n",output_file_set);
-		fprintf(stderr,"dbg2       output_file:       %s\n",output_file);
-		fprintf(stderr,"dbg2       rangethreshold:    %f\n",rangethreshold);
-		}
-
-	/* if help desired then print it and exit */
-	if (help)
-		{
-		fprintf(stderr,"\n%s\n",help_message);
-		fprintf(stderr,"\nusage: %s\n", usage_message);
-		exit(error);
-		}
-
-	/* read route file */
-	if ((fp = fopen(route_file, "r")) == NULL)
-		{
-		error = MB_ERROR_OPEN_FAIL;
-		status = MB_FAILURE;
-		fprintf(stderr,"\nUnable to open route file <%s> for reading\n",route_file);
-		exit(status);
-		}
-	rawroutefile = MB_NO;
-	while ((result = fgets(comment,MB_PATH_MAXLINE,fp)) == comment)
-		{
-		if (comment[0] == '#')
-			{
-			if (strncmp(comment,"## Route File Version", 21) == 0)
-				{
-				rawroutefile = MB_NO;
-				}
-			}
-		else
-			{
-			nget = sscanf(comment,"%lf %lf %lf %d %lf",
-			    &lon, &lat, &topo, &waypoint, &heading);
-			if (comment[0] == '#')
-				{
-				fprintf(stderr,"buffer:%s",comment);
-				if (strncmp(comment,"## Route File Version", 21) == 0)
-					{
-					rawroutefile = MB_NO;
-					}
-				}
-		    	if ((rawroutefile == MB_YES && nget >= 2)
-				|| (rawroutefile == MB_NO && nget >= 3 && waypoint > MBES_ROUTE_WAYPOINT_TRANSIT))
-				point_ok = MB_YES;
-			else
-				point_ok = MB_NO;
-
-			/* if good data check for need to allocate more space */
-			if (point_ok == MB_YES
-				&& nroutepoint + 2 > nroutepointalloc)
-				{
-				nroutepointalloc += MBES_ALLOC_NUM;
-				status = mb_reallocd(verbose, __FILE__, __LINE__, nroutepointalloc * sizeof(double),
-							(void **)&routelon, &error);
-				status = mb_reallocd(verbose, __FILE__, __LINE__, nroutepointalloc * sizeof(double),
-							(void **)&routelat, &error);
-				status = mb_reallocd(verbose, __FILE__, __LINE__, nroutepointalloc * sizeof(double),
-							(void **)&routeheading, &error);
-				status = mb_reallocd(verbose, __FILE__, __LINE__, nroutepointalloc * sizeof(int),
-							(void **)&routewaypoint, &error);
-				status = mb_reallocd(verbose, __FILE__, __LINE__, nroutepointalloc * sizeof(double),
-							(void **)&routetime_d, &error);
-				if (status != MB_SUCCESS)
-					{
-					mb_error(verbose,error,&message);
-					fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",
-						message);
-					fprintf(stderr,"\nProgram <%s> Terminated\n",
-						program_name);
-					exit(error);
-					}
-				}
-
-			/* add good point to route */
-			if (point_ok == MB_YES && nroutepointalloc > nroutepoint)
-				{
-				routelon[nroutepoint] = lon;
-				routelat[nroutepoint] = lat;
-				routeheading[nroutepoint] = heading;
-				routewaypoint[nroutepoint] = waypoint;
-				routetime_d[nroutepoint] = 0.0;
-				nroutepoint++;
-				}
-			}
-		}
-
-	/* close the file */
-	fclose(fp);
-	fp = NULL;
-	
-	/* Check that there are valid waypoints in memory */
-	if (nroutepoint < 1)
-		{
-		error = MB_ERROR_EOF;
-		status = MB_FAILURE;
-		fprintf(stderr,"\nNo line start or line end waypoints read from route file: <%s>\n",route_file);
-		fprintf(stderr,"\nProgram <%s> Terminated\n", program_name);
-		exit(error);
-		}
-	else if (nroutepoint < 2)
-		{
-		error = MB_ERROR_EOF;
-		status = MB_FAILURE;
-		fprintf(stderr,"\nOnly one line start or line end waypoint read from route file: <%s>\n",route_file);
-		fprintf(stderr,"\nProgram <%s> Terminated\n", program_name);
-		exit(error);
-		}
-
-	/* set starting values */
-	activewaypoint = 0;
-	mb_coor_scale(verbose,routelat[activewaypoint], &mtodeglon, &mtodeglat);
-	rangelast = 1000 * rangethreshold;
-
-	/* output status */
-	if (verbose > 0)
-		{
-		/* output info on file output */
-		fprintf(stderr,"Read %d waypoints from route file: %s\n",
-			nroutepoint, route_file);
-		}
-
-	/* get format if required */
-	if (format == 0)
-		mb_get_format(verbose,read_file,NULL,&format,&error);
-
-	/* determine whether to read one file or a list of files */
-	if (format < 0)
-		read_datalist = MB_YES;
-
-	/* open file list */
-	if (read_datalist == MB_YES)
-	    {
-	    if ((status = mb_datalist_open(verbose,&datalist,
-					    read_file,look_processed,&error)) != MB_SUCCESS)
-		{
-		error = MB_ERROR_OPEN_FAIL;
-		fprintf(stderr,"\nUnable to open data list file: %s\n",
-			read_file);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-	    if ((status = mb_datalist_read(verbose,datalist,
-			    file,&format,&file_weight,&error))
-			    == MB_SUCCESS)
-		read_data = MB_YES;
-	    else
-		read_data = MB_NO;
-	    }
-	/* else copy single filename to be read */
-	else
-	    {
-	    strcpy(file, read_file);
-	    read_data = MB_YES;
-	    }
-
-	/* loop over all files to be read */
-	while (read_data == MB_YES)
-		{
-		/* read fnv file if possible */
-		mb_get_fnv(verbose, file, &format, &error);
-
-		/* initialize reading the swath file */
-		if ((status = mb_read_init(
-			verbose,file,format,pings,lonflip,bounds,
-			btime_i,etime_i,speedmin,timegap,
-			&mbio_ptr,&btime_d,&etime_d,
-			&beams_bath,&beams_amp,&pixels_ss,&error)) != MB_SUCCESS)
-			{
-			mb_error(verbose,error,&message);
-			fprintf(stderr,"\nMBIO Error returned from function <mb_read_init>:\n%s\n",message);
-			fprintf(stderr,"\nMultibeam File <%s> not initialized for reading\n",file);
-			fprintf(stderr,"\nProgram <%s> Terminated\n",
-				program_name);
-			exit(error);
-			}
-
-		/* allocate memory for data arrays */
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							sizeof(char), (void **)&beamflag, &error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							sizeof(double), (void **)&bath, &error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_AMPLITUDE,
-							sizeof(double), (void **)&amp, &error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							sizeof(double), (void **)&bathacrosstrack, &error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							sizeof(double), (void **)&bathalongtrack, &error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_SIDESCAN,
-							sizeof(double), (void **)&ss, &error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_SIDESCAN,
-							sizeof(double), (void **)&ssacrosstrack, &error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_SIDESCAN,
-							sizeof(double), (void **)&ssalongtrack, &error);
-
-		/* if error initializing memory then quit */
-		if (error != MB_ERROR_NO_ERROR)
-			{
-			mb_error(verbose,error,&message);
-			fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",
-				message);
-			fprintf(stderr,"\nProgram <%s> Terminated\n",
-				program_name);
-			exit(error);
-			}
-
-		/* read and use data */
-		nread = 0;
-		while (error <= MB_ERROR_NO_ERROR && activewaypoint < nroutepoint)
-			{
-			/* reset error */
-			error = MB_ERROR_NO_ERROR;
-
-			/* read next data record */
-			status = mb_get_all(verbose,mbio_ptr,&store_ptr,&kind,
-			    time_i,&time_d,&navlon,&navlat,
-			    &speed,&heading,
-			    &distance,&altitude,&sonardepth,
-			    &beams_bath,&beams_amp,&pixels_ss,
-			    beamflag,bath,amp,bathacrosstrack,bathalongtrack,
-			    ss,ssacrosstrack,ssalongtrack,
-			    comment,&error);
-
-			/* deal with nav and time from survey data only - not nav, sidescan, or subbottom */
-			if (error <= MB_ERROR_NO_ERROR && kind == MB_DATA_DATA)
-				{
-				/* increment counter */
-				nread++;
-
-				/* save last nav and heading */
-				if (navlon != 0.0)
-					lastlon = navlon;
-				if (navlat != 0.0)
-					lastlat = navlat;
-				if (heading != 0.0)
-					lastheading = heading;
-				if (time_d != 0.0)
-					lasttime_d = time_d;
-
-
-				/* check survey data position against waypoints */
-				if (navlon != 0.0 && navlat != 0.0)
-					{
-					dx = (navlon - routelon[activewaypoint]) / mtodeglon;
-					dy = (navlat - routelat[activewaypoint]) / mtodeglat;
-					range = sqrt(dx * dx + dy * dy);
-					if (verbose > 0)
-						fprintf(stderr,"> activewaypoint:%d time_d:%f range:%f   lon: %f %f   lat: %f %f\n",
-							activewaypoint, time_d, range, navlon,
-							routelon[activewaypoint], navlat, routelat[activewaypoint]);
-
-					if (range < rangethreshold
-						&& (activewaypoint == 0 || range > rangelast)
-						&& activewaypoint < nroutepoint)
-						{
-						fprintf(stderr,"Waypoint %d of %d found with range %f m\n",
-								activewaypoint, nroutepoint, range);
-						routetime_d[activewaypoint] = time_d;
-						activewaypoint++;
-						nroutepointfound++;
-						mb_coor_scale(verbose,routelat[activewaypoint], &mtodeglon, &mtodeglat);
-						rangelast = 1000 * rangethreshold;
-						}
-					else
-						rangelast = range;
-					}
-				}
-
-			/* print debug statements */
-			if (verbose >= 2)
-				{
-				fprintf(stderr,"\ndbg2  Ping read in program <%s>\n",
-					program_name);
-				fprintf(stderr,"dbg2       kind:           %d\n",kind);
-				fprintf(stderr,"dbg2       error:          %d\n",error);
-				fprintf(stderr,"dbg2       status:         %d\n",status);
-				}
-			}
-
-		/* close the swath file */
-		status = mb_close(verbose,&mbio_ptr,&error);
-
-		/* output read statistics */
-		fprintf(stderr,"%d records read from %s\n", nread, file);
-
-		/* figure out whether and what to read next */
-        	if (read_datalist == MB_YES)
-                	{
-			if ((status = mb_datalist_read(verbose,datalist,
-				    file,&format,&file_weight,&error))
-				    == MB_SUCCESS)
-                        	read_data = MB_YES;
-                	else
-                        	read_data = MB_NO;
-                	}
-        	else
-                	{
-                	read_data = MB_NO;
-                	}
-
-		/* end loop over files in list */
-		}
-	if (read_datalist == MB_YES)
-		mb_datalist_close(verbose,&datalist,&error);
-
-	/* if the last route point was not reached, add one last waypoint */
-	if (nroutepointfound < nroutepoint)
-		{
-		fprintf(stderr,"Waypoint %d of %d set at end of data with range %f m to next specified waypoint\n",
-				activewaypoint, nroutepoint, range);
-		routelon[nroutepointfound] = lastlon;
-		routelat[nroutepointfound] = lastlat;
-		routeheading[nroutepointfound] = lastheading;
-		routetime_d[nroutepointfound] = lasttime_d;
-		routewaypoint[nroutepointfound] = MBES_ROUTE_WAYPOINT_ENDLINE;
-		nroutepointfound++;
-		}
-
-	/* output time list for the route */
-	if (output_file_set == MB_NO)
-		{
-		sprintf(output_file, "%s_wpttime_d.txt", read_file);
-		}
-	if ((fp = fopen(output_file, "w")) == NULL)
-		{
-		error = MB_ERROR_OPEN_FAIL;
-		status = MB_FAILURE;
-		fprintf(stderr,"\nUnable to open output waypoint time list file <%s> for writing\n",output_file);
-		exit(status);
-		}
-	for (i=0;i<nroutepointfound;i++)
-		{
-		fprintf(fp,"%3d %3d %11.6f %10.6f %10.6f %.6f\n", i, routewaypoint[i], routelon[i], routelat[i], routeheading[i], routetime_d[i]);
-		if (verbose > 0)
-			fprintf(stderr,"%3d %3d %11.6f %10.6f %10.6f %.6f\n", i, routewaypoint[i], routelon[i], routelat[i], routeheading[i], routetime_d[i]);
-		}
-	fclose(fp);
-
-	/* deallocate route arrays */
-	status = mb_freed(verbose,__FILE__,__LINE__, (void **)&routelon, &error);
-	status = mb_freed(verbose,__FILE__,__LINE__, (void **)&routelat, &error);
-	status = mb_freed(verbose,__FILE__,__LINE__, (void **)&routeheading, &error);
-	status = mb_freed(verbose,__FILE__,__LINE__, (void **)&routewaypoint, &error);
-	status = mb_freed(verbose,__FILE__,__LINE__, (void **)&routetime_d, &error);
-
-	/* check memory */
-	if (verbose >= 4)
-		status = mb_memory_list(verbose,&error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  Program <%s> completed\n",
-			program_name);
-		fprintf(stderr,"dbg2  Ending status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* end it all */
-	exit(error);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/utilities/mbrphsbias.c b/src/utilities/mbrphsbias.c
deleted file mode 100644
index 36645b0..0000000
--- a/src/utilities/mbrphsbias.c
+++ /dev/null
@@ -1,857 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbrphsbias.c	9/29/2013
- *    $Id: mbrphsbias.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 2013-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * MBrphsbias analyzes sonar soundings to solve for bias parameters associated
- * with the attitude sensors and first order speed of sound. In particular,
- * mbrphsbias uses a brute force multi-dimensional search over roll-bias,
- * pitch-bias, heading-bias, and array-water-sound-speed-bias to minimize the
- * variance of unflagged soundings in the input bathymetry data.
- *
- * Author:	D. W. Caress
- * Date:	September 29, 2013
- *		CCGS Sir Wilfrid Laurier
- *		136d00.6832'W 70d45.3653'W
- *		Beaufort Sea, Arctic Ocean
- *
- * $Log: mbrphsbias.c,v $
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <math.h>
-#include <string.h>
-#include <sys/stat.h>
-#include <time.h>
-
-/* mbio include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_define.h"
-#include "mb_io.h"
-#include "mb_swap.h"
-#include "mb_process.h"
-#include "mb_info.h"
-
-/* allocation */
-#define FILEALLOCNUM	16
-#define PINGALLOCNUM	128
-#define SNDGALLOCNUM	128
-
-/* mbrphsbias structures */
-struct	mbrphsbias_ping_struct
-	{
-	int	time_i[7];
-	double	time_d;
-	int	multiplicity;
-	double	navlon;
-	double	navlat;
-	double	speed;
-	double	heading;
-	double	distance;
-	double	altitude;
-	double	sonardepth;
-	double	draft;
-	double	roll;
-	double	pitch;
-	double	heave;
-	double	ssv;
-	int	beams_bath;
-	char	*beamflag;
-	double	*bath;
-	double	*bathacrosstrack;
-	double	*bathalongtrack;
-	double	*bathcorr;
-	double	*bathlon;
-	double	*bathlat;
-	double	*angles;
-	double	*angles_forward;
-	double	*angles_null;
-	double	*ttimes;
-	double	*bheave;
-	double	*alongtrack_offset;
-	};
-struct mbrphsbias_file_struct
-	{
-	char 	path[MB_PATH_MAXLINE];
-	int	format;
-	int	num_pings;
-	int	num_pings_alloc;
-	int	num_beams_tot;
-	int	num_beams_good;
-	int	num_beams_flagged;
-	int	num_beams_null;
-	struct mbrphsbias_ping_struct *pings;
-	};
-
-
-static char rcs_id[] = "$Id: mbrphsbias.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-
-int main (int argc, char **argv)
-{
-	char program_name[] = "MBrphsbias";
-	char help_message[] =  "MBrphsbias analyzes sonar soundings to solve for bias parameters associated with the attitude sensors and first order speed of sound.\n";
-	char usage_message[] = "mbrphsbias [-Fformat -Iinfile -Rwest/east/south/north -Sbinsize	\n\t-B]";
-	extern char *optarg;
-	int	errflg = 0;
-	int	c;
-	int	help = 0;
-	int	flag = 0;
-
-	/* MBIO status variables */
-	int	status;
-	int	verbose = 0;
-	int	error = MB_ERROR_NO_ERROR;
-	char	*message = NULL;
-
-	/* MBIO read control parameters */
-	void	*mbio_ptr = NULL;
-	void	*store_ptr = NULL;
-	int	kind;
-	int	read_datalist = MB_NO;
-	char	read_file[MB_PATH_MAXLINE];
-	char	swathfile[MB_PATH_MAXLINE];
-	char	swathfileread[MB_PATH_MAXLINE];
-	void	*datalist;
-	int	look_processed = MB_DATALIST_LOOK_UNSET;
-	int	read_data;
-	double	file_weight;
-	int	format;
-	int	formatread;
-	int	variable_beams;
-	int	traveltime;
-	int	beam_flagging;
-	int	pings;
-	int	lonflip;
-	double	bounds[4];
-	int	btime_i[7];
-	int	etime_i[7];
-	double	btime_d;
-	double	etime_d;
-	double	speedmin;
-	double	timegap;
-	struct mb_info_struct mb_info;
-
-	int	time_i[7];
-	double	time_d;
-	double	navlon;
-	double	navlat;
-	double	speed;
-	double	heading;
-	double	distance;
-	double	altitude;
-	double	sonardepth;
-	double	draft;
-	double	ssv;
-	double	roll;
-	double	pitch;
-	double	heave;
-	int	beams_bath;
-	int	beams_amp;
-	int	pixels_ss;
-	char	*beamflag;
-	double	*bath;
-	double	*amp;
-	double	*bathacrosstrack;
-	double	*bathalongtrack;
-	double	*ss;
-	double	*ssacrosstrack;
-	double	*ssalongtrack;
-	double	*ttimes;
-	double	*angles;
-	double	*angles_forward;
-	double	*angles_null;
-	double	*bheave;
-	double	*alongtrack_offset;
-	char	comment[MB_COMMENT_MAXLINE];
-
-        /* control parameters */
-	double	areabounds[4];
-	int	areaboundsset = MB_NO;
-	double	binsize = 0.0;
-	int	binsizeset = MB_NO;
-	double	mtodeglon;
-	double	mtodeglat;
-	double	dx, dy;
-	int	nx, ny;
-
-        /* sounding atorage values and arrays */
-        int	nfile = 0;
-        int	nfile_alloc = 0;
-        struct mbrphsbias_file_struct *files = NULL;
-        int	*gsndgnum = NULL;
-        double	*gsndgsqsum = NULL;
-
-	/* counting parameters */
-	int	files_tot = 0;
-	int	pings_tot = 0;
-	int	beams_tot = 0;
-	int	beams_good_tot = 0;
-	int	beams_flagged_tot = 0;
-	int	beams_null_tot = 0;
-
-	struct mbrphsbias_ping_struct *ping;
-	struct mbrphsbias_file_struct *file;
-
-	int	done;
-	int	nbeams;
-        int     i, j;
-
-	/* get current default values */
-	status = mb_defaults(verbose,&format,&pings,&lonflip,bounds,
-		btime_i,etime_i,&speedmin,&timegap);
-
-	/* reset all defaults but the format and lonflip */
-	strcpy(read_file,"datalist.mb-1");
-	format = 0;
-	pings = 1;
-	bounds[0] = -360.;
-	bounds[1] = 360.;
-	bounds[2] = -90.;
-	bounds[3] = 90.;
-	btime_i[0] = 1962;
-	btime_i[1] = 2;
-	btime_i[2] = 21;
-	btime_i[3] = 10;
-	btime_i[4] = 30;
-	btime_i[5] = 0;
-	btime_i[6] = 0;
-	etime_i[0] = 2062;
-	etime_i[1] = 2;
-	etime_i[2] = 21;
-	etime_i[3] = 10;
-	etime_i[4] = 30;
-	etime_i[5] = 0;
-	etime_i[6] = 0;
-	speedmin = 0.0;
-	timegap = 1000000000.0;
-
-	/* process argument list */
-	while ((c = getopt(argc, argv, "VvHhF:f:I:i:R:r:S:s:")) != -1)
-	  switch (c)
-		{
-		case 'H':
-		case 'h':
-			help++;
-			break;
-		case 'V':
-		case 'v':
-			verbose++;
-			break;
-		case 'F':
-		case 'f':
-			sscanf (optarg,"%d", &format);
-			flag++;
-			break;
-		case 'I':
-		case 'i':
-			sscanf (optarg,"%s", read_file);
-			flag++;
-			break;
-		case 'R':
-		case 'r':
-				mb_get_bounds(optarg, areabounds);
-				areaboundsset = MB_YES;
-			flag++;
-			break;
-		case 'S':
-		case 's':
-			sscanf (optarg,"%lf", &binsize);
-			binsizeset = MB_YES;
-			flag++;
-			break;
-		case '?':
-			errflg++;
-		}
-
-	/* if error flagged then print it and exit */
-	if (errflg)
-		{
-		fprintf(stderr,"usage: %s\n", usage_message);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		error = MB_ERROR_BAD_USAGE;
-		exit(error);
-		}
-	/* print starting message */
-	if (verbose == 1 || help)
-		{
-		fprintf(stderr,"\nProgram %s\n",program_name);
-		fprintf(stderr,"Version %s\n",rcs_id);
-		fprintf(stderr,"MB-system Version %s\n",MB_VERSION);
-		}
-
-	/* print starting debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  Program <%s>\n",program_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Control Parameters:\n");
-		fprintf(stderr,"dbg2       verbose:        %d\n",verbose);
-		fprintf(stderr,"dbg2       help:           %d\n",help);
-		fprintf(stderr,"dbg2       pings:          %d\n",pings);
-		fprintf(stderr,"dbg2       lonflip:        %d\n",lonflip);
-		fprintf(stderr,"dbg2       bounds[0]:      %f\n",bounds[0]);
-		fprintf(stderr,"dbg2       bounds[1]:      %f\n",bounds[1]);
-		fprintf(stderr,"dbg2       bounds[2]:      %f\n",bounds[2]);
-		fprintf(stderr,"dbg2       bounds[3]:      %f\n",bounds[3]);
-		fprintf(stderr,"dbg2       btime_i[0]:     %d\n",btime_i[0]);
-		fprintf(stderr,"dbg2       btime_i[1]:     %d\n",btime_i[1]);
-		fprintf(stderr,"dbg2       btime_i[2]:     %d\n",btime_i[2]);
-		fprintf(stderr,"dbg2       btime_i[3]:     %d\n",btime_i[3]);
-		fprintf(stderr,"dbg2       btime_i[4]:     %d\n",btime_i[4]);
-		fprintf(stderr,"dbg2       btime_i[5]:     %d\n",btime_i[5]);
-		fprintf(stderr,"dbg2       btime_i[6]:     %d\n",btime_i[6]);
-		fprintf(stderr,"dbg2       etime_i[0]:     %d\n",etime_i[0]);
-		fprintf(stderr,"dbg2       etime_i[1]:     %d\n",etime_i[1]);
-		fprintf(stderr,"dbg2       etime_i[2]:     %d\n",etime_i[2]);
-		fprintf(stderr,"dbg2       etime_i[3]:     %d\n",etime_i[3]);
-		fprintf(stderr,"dbg2       etime_i[4]:     %d\n",etime_i[4]);
-		fprintf(stderr,"dbg2       etime_i[5]:     %d\n",etime_i[5]);
-		fprintf(stderr,"dbg2       etime_i[6]:     %d\n",etime_i[6]);
-		fprintf(stderr,"dbg2       speedmin:       %f\n",speedmin);
-		fprintf(stderr,"dbg2       timegap:        %f\n",timegap);
-		fprintf(stderr,"dbg2       data format:    %d\n",format);
-		fprintf(stderr,"dbg2       input file:     %s\n",read_file);
-		fprintf(stderr,"dbg2       areaboundsset:  %d\n",areaboundsset);
-		fprintf(stderr,"dbg2       areabounds[0]:  %f\n",areabounds[0]);
-		fprintf(stderr,"dbg2       areabounds[1]:  %f\n",areabounds[1]);
-		fprintf(stderr,"dbg2       areabounds[2]:  %f\n",areabounds[2]);
-		fprintf(stderr,"dbg2       areabounds[3]:  %f\n",areabounds[3]);
-		fprintf(stderr,"dbg2       binsizeset:     %d\n",binsizeset);
-		fprintf(stderr,"dbg2       binsize:        %f\n",binsize);
-		}
-
-	/* if help desired then print it and exit */
-	if (help)
-		{
-		fprintf(stderr,"\n%s\n",help_message);
-		fprintf(stderr,"\nusage: %s\n", usage_message);
-		exit(error);
-		}
-
-	/* if bounds not set get bounds of input data */
-	if (areaboundsset == MB_NO)
-		{
-		formatread = format;
-		status = mb_get_info_datalist(verbose, read_file, &formatread,
-				&mb_info, lonflip, &error);
-
-		areabounds[0] = mb_info.lon_min;
-		areabounds[1] = mb_info.lon_max;
-		areabounds[2] = mb_info.lat_min;
-		areabounds[3] = mb_info.lat_max;
-
-		if (binsizeset == MB_NO)
-			binsize = 0.2 * mb_info.altitude_max;
-		}
-
-	/* calculate area grid properties */
-	mb_coor_scale(verbose,0.5*(areabounds[2]+areabounds[3]),&mtodeglon,&mtodeglat);
-	if (binsize <= 0.0)
-		binsize = (areabounds[1] - areabounds[0]) / 101 / mtodeglon;
-	dx = binsize * mtodeglon;
-	dy = binsize * mtodeglat;
-	nx = 1 + (int)((areabounds[1] - areabounds[0]) / dx);
-	ny = 1 + (int)((areabounds[3] - areabounds[2]) / dy);
-	if (nx > 1 && ny > 1)
-		{
-		dx = (areabounds[1] - areabounds[0]) / (nx - 1);
-		dy = (areabounds[3] - areabounds[2]) / (ny - 1);
-		}
-
-	/* allocate grid arrays */
-	status = mb_mallocd(verbose,__FILE__,__LINE__, nx * ny * sizeof(int *),
-			(void **)&gsndgnum, &error);
-	if (status == MB_SUCCESS)
-	status = mb_mallocd(verbose,__FILE__,__LINE__, nx * ny * sizeof(double),
-			(void **)&gsndgsqsum, &error);
-
-	/* if error initializing memory then quit */
-	if (error != MB_ERROR_NO_ERROR)
-		{
-		mb_error(verbose,error,&message);
-		fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",message);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-
-	/* give the grid info */
-	if (verbose >= 0)
-		{
-		fprintf(stderr,"\nMBrphsbias Processing Parameters:\n");
-		fprintf(stderr,"-------------------------\n");
-		fprintf(stderr,"Area Bounds:\n");
-		fprintf(stderr,"  longitude: %f %f\n",areabounds[0],areabounds[1]);
-		fprintf(stderr,"  latitude:  %f %f\n",areabounds[2],areabounds[3]);
-		fprintf(stderr,"Binsize: %f meters\n",binsize);
-		fprintf(stderr,"  longitude: %f\n",dx);
-		fprintf(stderr,"  latitude:  %f\n",dy);
-		fprintf(stderr,"Grid dimensions:\n");
-		fprintf(stderr,"  longitude: %d\n",nx);
-		fprintf(stderr,"  latitude:  %d\n",ny);
-		fprintf(stderr,"-------------------------\n");
-		}
-
-	/* if error initializing memory then quit */
-	for (i=0;i<nx*ny;i++)
-		{
-		gsndgnum[i] = 0;
-		gsndgsqsum[i] = 0.0;
-		}
-
-	/* get format if required */
-	if (format == 0)
-		mb_get_format(verbose,read_file,NULL,&format,&error);
-
-	/* determine whether to read one file or a list of files */
-	if (format < 0)
-		read_datalist = MB_YES;
-
-	/* open file list */
-	if (read_datalist == MB_YES)
-	    {
-	    if ((status = mb_datalist_open(verbose,&datalist,
-					    read_file,look_processed,&error)) != MB_SUCCESS)
-		{
-		error = MB_ERROR_OPEN_FAIL;
-		fprintf(stderr,"\nUnable to open data list file: %s\n",
-			read_file);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-	    if ((status = mb_datalist_read(verbose,datalist,
-			    swathfile,&format,&file_weight,&error))
-			    == MB_SUCCESS)
-		read_data = MB_YES;
-	    else
-		read_data = MB_NO;
-	    }
-	/* else copy single filename to be read */
-	else
-	    {
-	    strcpy(swathfile, read_file);
-	    read_data = MB_YES;
-	    }
-
-	/* loop over all files to be read */
-	while (read_data == MB_YES)
-            {
-            /* check format and get format flags */
-            if ((status = mb_format_flags(verbose,&format,
-                            &variable_beams, &traveltime, &beam_flagging,
-                            &error))
-                    != MB_SUCCESS)
-                    {
-                    mb_error(verbose,error,&message);
-                    fprintf(stderr,"\nMBIO Error returned from function <mb_format_flags> regarding input format %d:\n%s\n",format,message);
-                    fprintf(stderr,"\nProgram <%s> Terminated\n",
-                            program_name);
-                    exit(error);
-                    }
-
-            /* check for "fast bathymetry" or "fbt" file */
-            strcpy(swathfileread, swathfile);
-            formatread = format;
-            mb_get_fbt(verbose, swathfileread, &formatread, &error);
-
-            /* initialize reading the input swath sonar file */
-            if ((status = mb_read_init(
-                    verbose,swathfileread,formatread,pings,lonflip,bounds,
-                    btime_i,etime_i,speedmin,timegap,
-                    &mbio_ptr,&btime_d,&etime_d,
-                    &beams_bath,&beams_amp,&pixels_ss,&error)) != MB_SUCCESS)
-                    {
-                    mb_error(verbose,error,&message);
-                    fprintf(stderr,"\nMBIO Error returned from function <mb_read_init>:\n%s\n",message);
-                    fprintf(stderr,"\nMultibeam File <%s> not initialized for reading\n",swathfileread);
-                    fprintf(stderr,"\nProgram <%s> Terminated\n",
-                            program_name);
-                    exit(error);
-                    }
-
-            /* give the statistics */
-            if (verbose >= 0)
-                    {
-                    fprintf(stderr,"\nProcessing %s\n",swathfileread);
-                    }
-
-            /* allocate memory for data arrays */
-            beamflag = NULL;
-            bath = NULL;
-            amp = NULL;
-            bathacrosstrack = NULL;
-            bathalongtrack = NULL;
-            ss = NULL;
-            ssacrosstrack = NULL;
-            ssalongtrack = NULL;
-            ttimes = NULL;
-            angles = NULL;
-            angles_forward = NULL;
-            angles_null = NULL;
-            bheave = NULL;
-            alongtrack_offset = NULL;
-            if (error == MB_ERROR_NO_ERROR)
-                    status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-                                                    sizeof(char), (void **)&beamflag, &error);
-            if (error == MB_ERROR_NO_ERROR)
-                    status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-                                                    sizeof(double), (void **)&bath, &error);
-            if (error == MB_ERROR_NO_ERROR)
-                    status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_AMPLITUDE,
-                                                    sizeof(double), (void **)&amp, &error);
-            if (error == MB_ERROR_NO_ERROR)
-                    status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-                                                    sizeof(double), (void **)&bathacrosstrack, &error);
-            if (error == MB_ERROR_NO_ERROR)
-                    status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-                                                    sizeof(double), (void **)&bathalongtrack, &error);
-            if (error == MB_ERROR_NO_ERROR)
-                    status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-                                                    sizeof(double), (void **)&ttimes, &error);
-            if (error == MB_ERROR_NO_ERROR)
-                    status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-                                                    sizeof(double), (void **)&angles, &error);
-            if (error == MB_ERROR_NO_ERROR)
-                    status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-                                                    sizeof(double), (void **)&angles_forward, &error);
-            if (error == MB_ERROR_NO_ERROR)
-                    status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-                                                    sizeof(double), (void **)&angles_null, &error);
-            if (error == MB_ERROR_NO_ERROR)
-                    status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-                                                    sizeof(double), (void **)&bheave, &error);
-            if (error == MB_ERROR_NO_ERROR)
-                    status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-                                                    sizeof(double), (void **)&alongtrack_offset, &error);
-            if (error == MB_ERROR_NO_ERROR)
-                    status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_SIDESCAN,
-                                                    sizeof(double), (void **)&ss, &error);
-            if (error == MB_ERROR_NO_ERROR)
-                    status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_SIDESCAN,
-                                                    sizeof(double), (void **)&ssacrosstrack, &error);
-            if (error == MB_ERROR_NO_ERROR)
-                    status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_SIDESCAN,
-                                                    sizeof(double), (void **)&ssalongtrack, &error);
-
-            /* if error initializing memory then quit */
-            if (error != MB_ERROR_NO_ERROR)
-                    {
-                    mb_error(verbose,error,&message);
-                    fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",message);
-                    fprintf(stderr,"\nProgram <%s> Terminated\n",
-                            program_name);
-                    exit(error);
-                    }
-
-            /* update memory for files */
-            if (nfile >= nfile_alloc)
-                {
-                nfile_alloc += FILEALLOCNUM;
-                status = mb_reallocd(verbose, __FILE__, __LINE__,
-                                nfile_alloc * sizeof(struct mbrphsbias_file_struct),
-                                (void **)&files, &error);
-
-                /* if error initializing memory then quit */
-                if (error != MB_ERROR_NO_ERROR)
-                    {
-                    mb_error(verbose,error,&message);
-                    fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",message);
-                    fprintf(stderr,"\nProgram <%s> Terminated\n",
-                            program_name);
-                    exit(error);
-                    }
-                }
-
-            /* initialize current file */
-	    file = &(files[nfile]);
-            nfile++;
-            strcpy(file->path, swathfile);
-            file->format = format;
-            file->num_pings = 0;
-            file->num_beams_tot = 0;
-	    file->num_beams_good = 0;
-            file->num_beams_flagged = 0;
-            file->num_beams_null = 0;
-            file->num_pings_alloc = PINGALLOCNUM;
-            file->pings = NULL;
-            status = mb_mallocd(verbose,__FILE__,__LINE__,
-                            file->num_pings_alloc * sizeof(struct mbrphsbias_ping_struct),
-                            (void **)&(file->pings), &error);
-            if (error != MB_ERROR_NO_ERROR)
-                {
-                mb_error(verbose,error,&message);
-                fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",message);
-                fprintf(stderr,"\nProgram <%s> Terminated\n",
-                        program_name);
-                exit(error);
-                }
-
-            /* read the pings into memory */
-            done = MB_NO;
-            while (done == MB_NO)
-                {
-                if (verbose > 1) fprintf(stderr,"\n");
-
-                /* read next record */
-                error = MB_ERROR_NO_ERROR;
-		status = mb_get_all(verbose,mbio_ptr,&store_ptr,&kind,
-				    time_i,&time_d,&navlon,&navlat,
-				    &speed,&heading,
-				    &distance,&altitude,&sonardepth,
-				    &beams_bath,&beams_amp,&pixels_ss,
-				    beamflag,bath,amp,bathacrosstrack,bathalongtrack,
-				    ss,ssacrosstrack,ssalongtrack,
-				    comment,&error);
-		if (status == MB_FAILURE && error > MB_ERROR_NO_ERROR)
-		    done = MB_YES;
-                if (verbose >= 2)
-                    {
-                    fprintf(stderr,"\ndbg2  current data status:\n");
-                    fprintf(stderr,"dbg2    kind:       %d\n",kind);
-                    fprintf(stderr,"dbg2    status:     %d\n",status);
-                    }
-                if (status == MB_SUCCESS && kind == MB_DATA_DATA)
-                    {
-		    status = mb_extract_nav(verbose,mbio_ptr,store_ptr,&kind,
-					time_i,&time_d,&navlon,&navlat,
-					&speed,&heading,&draft,
-					&roll,&pitch,&heave,&error);
-		    status = mb_ttimes(verbose,mbio_ptr,
-					store_ptr,&kind,&nbeams,
-					ttimes,angles,
-					angles_forward,angles_null,
-					bheave,alongtrack_offset,
-					&draft,&ssv,&error);
-
-		    /* allocate memory if necessary */
-		    if (file->num_pings >= file->num_pings_alloc)
-			{
-			file->num_pings_alloc += PINGALLOCNUM;
-			status = mb_reallocd(verbose,__FILE__,__LINE__,
-					    file->num_pings_alloc * sizeof(struct mbrphsbias_ping_struct),
-					    (void **)&(file->pings), &error);
-			if (error != MB_ERROR_NO_ERROR)
-				{
-				mb_error(verbose,error,&message);
-				fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",message);
-				fprintf(stderr,"\nProgram <%s> Terminated\n",
-					program_name);
-				exit(error);
-				}
-			}
-		    ping = &(file->pings[file->num_pings]);
-		    status = mb_mallocd(verbose,__FILE__,__LINE__,
-				beams_bath * sizeof(char),
-				(void **)&(ping->beamflag), &error);
-		    if (error == MB_ERROR_NO_ERROR)
-		    status = mb_mallocd(verbose,__FILE__,__LINE__,
-				beams_bath * sizeof(double),
-				(void **)&(ping->bath), &error);
-		    if (error == MB_ERROR_NO_ERROR)
-		    status = mb_mallocd(verbose,__FILE__,__LINE__,
-				beams_bath * sizeof(double),
-				(void **)&(ping->bathacrosstrack), &error);
-		    if (error == MB_ERROR_NO_ERROR)
-		    status = mb_mallocd(verbose,__FILE__,__LINE__,
-				beams_bath * sizeof(double),
-				(void **)&(ping->bathalongtrack), &error);
-		    if (error == MB_ERROR_NO_ERROR)
-		    status = mb_mallocd(verbose,__FILE__,__LINE__,
-				beams_bath * sizeof(double),
-				(void **)&(ping->ttimes), &error);
-		    if (error == MB_ERROR_NO_ERROR)
-		    status = mb_mallocd(verbose,__FILE__,__LINE__,
-				beams_bath * sizeof(double),
-				(void **)&(ping->angles), &error);
-		    if (error == MB_ERROR_NO_ERROR)
-		    status = mb_mallocd(verbose,__FILE__,__LINE__,
-				beams_bath * sizeof(double),
-				(void **)&(ping->angles_forward), &error);
-		    if (error == MB_ERROR_NO_ERROR)
-		    status = mb_mallocd(verbose,__FILE__,__LINE__,
-				beams_bath * sizeof(double),
-				(void **)&(ping->angles_null), &error);
-		    if (error == MB_ERROR_NO_ERROR)
-		    status = mb_mallocd(verbose,__FILE__,__LINE__,
-				beams_bath * sizeof(double),
-				(void **)&(ping->bheave), &error);
-		    if (error == MB_ERROR_NO_ERROR)
-		    status = mb_mallocd(verbose,__FILE__,__LINE__,
-				beams_bath * sizeof(double),
-				(void **)&(ping->alongtrack_offset), &error);
-		    if (error != MB_ERROR_NO_ERROR)
-			{
-			mb_error(verbose,error,&message);
-			fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",message);
-			fprintf(stderr,"\nProgram <%s> Terminated\n",
-				program_name);
-			exit(error);
-			}
-
-                    /* update counters */
-                    pings_tot++;
-                    file->num_pings++;
-                    for (i=0;i<beams_bath;i++)
-				{
-				beams_tot++;
-				file->num_beams_tot++;
-				if (mb_beam_ok(beamflag[i]))
-					{
-					beams_good_tot++;
-					file->num_beams_good++;
-					}
-				else if (beamflag[i] == MB_FLAG_NULL)
-					{
-					beams_null_tot++;
-					file->num_beams_null++;
-					}
-				else
-					{
-					beams_flagged_tot++;
-					file->num_beams_flagged++;
-					}
-				}
-
-                    /* store the ping data */
-		    for (i=0;i<7;i++)
-			ping->time_i[i] = time_i[i];
-                    ping->time_d = time_d;
-                    if (file->num_pings > 0
-                            && ping->time_d
-                                    == file->pings[file->num_pings - 1].time_d)
-                            {
-                            ping->multiplicity
-                                    = file->pings[file->num_pings - 1].multiplicity + 1;
-                            }
-                    else
-                            {
-                            ping->multiplicity = 0;
-                            }
-                    ping->navlon = navlon;
-                    ping->navlat = navlat;
-                    ping->speed = speed;
-                    ping->heading = heading;
-                    ping->distance = distance;
-                    ping->altitude = altitude;
-                    ping->sonardepth = sonardepth;
-                    ping->draft = sonardepth - heave;
-                    ping->roll = roll;
-                    ping->pitch = pitch;
-                    ping->heave = heave;
-                    ping->ssv = ssv;
-                    ping->beams_bath = beams_bath;
-		    for (i=0;i<ping->beams_bath;i++)
-			{
-			ping->beamflag[i] = beamflag[i];
-			ping->bath[i] = bath[i];
-			ping->bathacrosstrack[i] = bathacrosstrack[i];
-			ping->bathalongtrack[i] = bathalongtrack[i];
-			ping->ttimes[i] = ttimes[i];
-			ping->angles[i] = angles[i];
-			ping->angles_forward[i] = angles_forward[i];
-			ping->angles_null[i] = angles_null[i];
-			ping->bheave[i] = bheave[i];
-			ping->alongtrack_offset[i] = alongtrack_offset[i];
-			}
-		    }
-		}
-
-
-            /* close the files */
-            status = mb_close(verbose,&mbio_ptr,&error);
-
-	    /* figure out whether and what to read next */
-            if (read_datalist == MB_YES)
-                {
-		if ((status = mb_datalist_read(verbose,datalist,
-			    swathfile,&format,&file_weight,&error))
-			    == MB_SUCCESS)
-		    read_data = MB_YES;
-		else
-		    read_data = MB_NO;
-                }
-            else
-                {
-                read_data = MB_NO;
-                }
-            }
-
-	/* give the total statistics */
-	if (verbose >= 0)
-            {
-            fprintf(stderr,"\nMBrphsbias Processing Totals:\n");
-            fprintf(stderr,"-------------------------\n");
-            fprintf(stderr,"%d total swath data files processed\n",files_tot);
-            fprintf(stderr,"%d total pings processed\n",pings_tot);
-            fprintf(stderr,"%d total soundings processed\n",beams_tot);
-            fprintf(stderr,"-------------------------\n");
-            for (i=0;i<nfile;i++)
-                {
-                }
-            }
-
-	/* free arrays */
-	mb_freed(verbose,__FILE__, __LINE__, (void **)&gsndgnum,&error);
-	mb_freed(verbose,__FILE__, __LINE__, (void **)&gsndgsqsum,&error);
-
-	for (i=0;i<nfile;i++)
-		{
-		file = &(files[nfile]);
-		for (j=0;j<file->num_pings;j++)
-			{
-			ping = &(file->pings[j]);
-			mb_freed(verbose,__FILE__, __LINE__, (void **)&(ping->beamflag),&error);
-			mb_freed(verbose,__FILE__, __LINE__, (void **)&(ping->bath),&error);
-			mb_freed(verbose,__FILE__, __LINE__, (void **)&(ping->bathacrosstrack),&error);
-			mb_freed(verbose,__FILE__, __LINE__, (void **)&(ping->bathalongtrack),&error);
-			mb_freed(verbose,__FILE__, __LINE__, (void **)&(ping->ttimes),&error);
-			mb_freed(verbose,__FILE__, __LINE__, (void **)&(ping->angles),&error);
-			mb_freed(verbose,__FILE__, __LINE__, (void **)&(ping->angles_forward),&error);
-			mb_freed(verbose,__FILE__, __LINE__, (void **)&(ping->angles_null),&error);
-			mb_freed(verbose,__FILE__, __LINE__, (void **)&(ping->bheave),&error);
-			mb_freed(verbose,__FILE__, __LINE__, (void **)&(ping->alongtrack_offset),&error);
-			}
-		mb_freed(verbose,__FILE__, __LINE__, (void **)&(file->pings),&error);
-		}
-	mb_freed(verbose,__FILE__, __LINE__, (void **)&files,&error);
-
-	/* set program status */
-	status = MB_SUCCESS;
-
-	/* check memory */
-	if (verbose >= 4)
-		status = mb_memory_list(verbose,&error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  Program <%s> completed\n",
-			program_name);
-		fprintf(stderr,"dbg2  Ending status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* end it all */
-	exit(error);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/utilities/mbsegygrid.c b/src/utilities/mbsegygrid.c
deleted file mode 100644
index 2cf0a7f..0000000
--- a/src/utilities/mbsegygrid.c
+++ /dev/null
@@ -1,1260 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbsegygrid.c	6/12/2004
- *    $Id: mbsegygrid.c 2234 2015-03-05 07:41:54Z caress $
- *
- *    Copyright (c) 2004-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbsegygrid inserts trace data from segy data files into a grid in
- * which the y-axis is some measure of trace number, range, or distance
- * along a profile, and the y-axis is time..
- *
- * Author:	D. W. Caress
- * Date:	June 12, 2004
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <math.h>
-#include <string.h>
-#include <time.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-
-/* MBIO include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_define.h"
-#include "mb_segy.h"
-#include "mb_aux.h"
-
-/* local options */
-#define MBSEGYGRID_USESHOT		0
-#define MBSEGYGRID_USECMP		1
-#define MBSEGYGRID_PLOTBYTRACENUMBER	0
-#define MBSEGYGRID_PLOTBYDISTANCE	1
-#define MBSEGYGRID_WINDOW_OFF		0
-#define MBSEGYGRID_WINDOW_ON		1
-#define MBSEGYGRID_WINDOW_SEAFLOOR	2
-#define MBSEGYGRID_WINDOW_DEPTH		3
-#define MBSEGYGRID_GAIN_OFF		0
-#define MBSEGYGRID_GAIN_TZERO		1
-#define MBSEGYGRID_GAIN_SEAFLOOR	2
-#define MBSEGYGRID_GAIN_AGCSEAFLOOR	3
-#define MBSEGYGRID_GEOMETRY_VERTICAL	0
-#define MBSEGYGRID_GEOMETRY_REAL	1
-#define MBSEGYGRID_FILTER_OFF		0
-#define MBSEGYGRID_FILTER_COSINE	1
-
-/* NaN value */
-float	NaN;
-
-int get_segy_limits(int verbose,
-		char	*segyfile,
-		int	*tracemode,
-		int	*tracestart,
-		int	*traceend,
-		int	*chanstart,
-		int	*chanend,
-		double	*timesweep,
-		double	*timedelay,
-		double	*startlon,
-		double	*startlat,
-		double	*endlon,
-		double	*endlat,
-		int *error);
-char	*ctime();
-char	*getenv();
-int fft(float *x, int *n, int *isign);
-int four1(float *data, int *n, int *isign);
-
-/* output stream for basic stuff (stdout if verbose <= 1,
-	stderr if verbose > 1) */
-FILE	*outfp;
-
-static char rcs_id[] = "$Id: mbsegygrid.c 2234 2015-03-05 07:41:54Z caress $";
-char program_name[] = "MBsegygrid";
-char help_message[] =  "MBsegygrid grids trace data from segy data files.";
-char usage_message[] = "MBsegygrid -Ifile -Oroot [-Ashotscale/timescale \n\
-          -Ddecimatex/decimatey -Gmode/gain[/window] -Rdistancebin[]/startlon/startlat/endlon/endlat]\n\
-          -Smode[/start/end[/schan/echan]] -Tsweep[/delay] \n\
-          -Wmode/start/end -H -V]";
-
-/*--------------------------------------------------------------------*/
-
-int main (int argc, char **argv)
-{
-	extern char *optarg;
-	int	errflg = 0;
-	int	c;
-	int	help = 0;
-	int	flag = 0;
-
-	/* MBIO status variables */
-	int	status = MB_SUCCESS;
-	int	verbose = 0;
-	int	error = MB_ERROR_NO_ERROR;
-	char	*message;
-
-	/* MBIO read control parameters */
-	int	format;
-	int	pings;
-	int	lonflip;
-	double	bounds[4];
-	int	btime_i[7];
-	int	etime_i[7];
-	double	speedmin;
-	double	timegap;
-
-	/* segy data */
-	char	segyfile[MB_PATH_MAXLINE];
-	void	*mbsegyioptr;
-	struct mb_segyasciiheader_struct asciiheader;
-	struct mb_segyfileheader_struct fileheader;
-	struct mb_segytraceheader_struct traceheader;
-	float	*trace = NULL;
-	float	*worktrace = NULL;
-	float	*filtertrace = NULL;
-
-	/* grid controls */
-	char	fileroot[MB_PATH_MAXLINE];
-	char	gridfile[MB_PATH_MAXLINE];
-	int	decimatex = 1;
-	int	decimatey = 1;
-	int	plotmode = MBSEGYGRID_PLOTBYTRACENUMBER;
-	double	distancebin = 1.0;
-	double	startlon = 0.0;
-	double	startlat = 0.0;
-	double	endlon = 0.0;
-	double	endlat = 0.0;
-	int	tracemode = MBSEGYGRID_USESHOT;
-	int	tracestart = 0;
-	int	traceend = 0;
-	int	chanstart = 0;
-	int	chanend = -1;
-	double	timesweep = 0.0;
-	double	timedelay = 0.0;
-	double	sampleinterval = 0.0;
-	int	windowmode = MBSEGYGRID_WINDOW_OFF;
-	double	windowstart, windowend;
-	int	gainmode = MBSEGYGRID_GAIN_OFF;
-	double	gain = 0.0;
-	double	gainwindow = 0.0;
-	double	gaindelay = 0.0;
-	int	agcmode = MB_NO;
-	double	agcwindow = 0.0;
-	double	agcmaxvalue = 0.0;
-	int	filtermode = MBSEGYGRID_FILTER_OFF;
-	double	filterwindow = 0.0;
-	int	geometrymode = MBSEGYGRID_GEOMETRY_VERTICAL;
-	int	ntraces;
-	int	ngridx = 0;
-	int	ngridy = 0;
-	int	ngridxy = 0;
-	float	*grid = NULL;
-	float	*gridweight = NULL;
-	double	xmin;
-	double	xmax;
-	double	ymin;
-	double	ymax;
-	double	dx;
-	double	dy;
-	double	gridmintot = 0.0;
-	double	gridmaxtot = 0.0;
-	char	projection[MB_PATH_MAXLINE];
-	char	xlabel[MB_PATH_MAXLINE];
-	char	ylabel[MB_PATH_MAXLINE];
-	char	zlabel[MB_PATH_MAXLINE];
-	char	title[MB_PATH_MAXLINE];
-	char	plot_cmd[MB_PATH_MAXLINE];
-	int	scale2distance = MB_NO;
-	double	shotscale = 1.0;
-	double	timescale = 1.0;
-
-	int	sinftracemode = MBSEGYGRID_USESHOT;
-	int	sinftracestart = 0;
-	int	sinftraceend = 0;
-	int	sinfchanstart = 0;
-	int	sinfchanend = -1;
-	double	sinftimesweep = 0.0;
-	double	sinftimedelay = 0.0;
-	double	sinfstartlon = 0.0;
-	double	sinfstartlat = 0.0;
-	double	sinfendlon = 0.0;
-	double	sinfendlat = 0.0;
-
-	int	nread;
-	int	tracecount, tracenum, channum, traceok;
-	double	tracemin, tracemax;
-	double	xwidth, ywidth;
-	int	ix, iy, iys, igainstart, igainend;
-	int	iystart, iyend;
-	double	factor, gtime, btime, stime, dtime, tmax;
-	double	cosfactor;
-	double	filtersum;
-	double	btimesave = 0.0;
-	double	stimesave = 0.0;
-	double	dtimesave = 0.0;
-	double	mtodeglon, mtodeglat;
-	double	navlon, navlat;
-	double	line_distance, line_dx, line_dy, trace_x;
-	double	cos_arg;
-	int	plot_status;
-	int	worktrace_alloc;
-	int	filtertrace_alloc;
-	int	nfilter;
-	int	iagchalfwindow;
-	int	iyc;
-	int	jstart, jend;
-	int	i, ii, j, k, n;
-
-	/* get current default values */
-	status = mb_defaults(verbose,&format,&pings,&lonflip,bounds,
-		btime_i,etime_i,&speedmin,&timegap);
-
-	/* set file to null */
-	segyfile[0] = '\0';
-
-	/* get NaN value */
-	MB_MAKE_FNAN(NaN);
-
-	/* process argument list */
-	while ((c = getopt(argc, argv, "A:a:B:b:C:c:D:d:F:f:G:g:I:i:O:o:R:r:S:s:T:t:VvW:w:Hh")) != -1)
-	  switch (c)
-		{
-		case 'H':
-		case 'h':
-			help++;
-			break;
-		case 'V':
-		case 'v':
-			verbose++;
-			break;
-		case 'A':
-		case 'a':
-			n = sscanf (optarg,"%lf/%lf", &shotscale, &timescale);
-			if (n == 2)
-				scale2distance = MB_YES;
-			flag++;
-			break;
-		case 'B':
-		case 'b':
-			n = sscanf (optarg,"%lf/%lf", &agcmaxvalue, &agcwindow);
-			if (n < 2)
-				agcwindow = 0.0;
-			agcmode = MB_YES;
-			flag++;
-			break;
-		case 'C':
-		case 'c':
-			n = sscanf (optarg,"%d", &geometrymode);
-			if (n < 1)
-				geometrymode = MBSEGYGRID_GEOMETRY_VERTICAL;
-			flag++;
-			break;
-		case 'D':
-		case 'd':
-			n = sscanf (optarg,"%d/%d", &decimatex, &decimatey);
-			flag++;
-			break;
-		case 'F':
-		case 'f':
-			n = sscanf (optarg,"%d/%lf", &filtermode, &filterwindow);
-			flag++;
-			break;
-		case 'G':
-		case 'g':
-			n = sscanf (optarg,"%d/%lf/%lf/%lf", &gainmode, &gain, &gainwindow, &gaindelay);
-			if (n < 4)
-				gaindelay = 0.0;
-			if (n < 3)
-				gainwindow = 0.0;
-			flag++;
-			break;
-		case 'I':
-		case 'i':
-			sscanf (optarg,"%s", segyfile);
-			flag++;
-			break;
-		case 'O':
-		case 'o':
-			sscanf (optarg,"%s", fileroot);
-			flag++;
-			break;
-		case 'R':
-		case 'r':
-			n = sscanf (optarg,"%lf/%lf/%lf/%lf/%lf", &distancebin, &startlon, &endlon, &startlat, &endlat);
-			plotmode = MBSEGYGRID_PLOTBYDISTANCE;
-			if (n < 1)
-				{
-				distancebin = 1.0;
-				}
-			if (n < 25)
-				{
-				startlon = 0.0;
-				startlat = 0.0;
-				endlon = 0.0;
-				endlat = 0.0;
-				}
-			flag++;
-			break;
-		case 'S':
-		case 's':
-			n = sscanf (optarg,"%d/%d/%d/%d/%d", &tracemode, &tracestart, &traceend, &chanstart, &chanend);
-			if (n < 5)
-				{
-				chanstart = 0;
-				chanend = -1;
-				}
-			if (n < 3)
-				{
-				tracestart = 0;
-				traceend = 0;
-				}
-			if (n < 1)
-				{
-				tracemode = MBSEGYGRID_USESHOT;
-				}
-			flag++;
-			break;
-		case 'T':
-		case 't':
-			n = sscanf (optarg,"%lf/%lf", &timesweep, &timedelay);
-			if (n < 2)
-				timedelay = 0.0;
-			flag++;
-			break;
-		case 'W':
-		case 'w':
-			n = sscanf (optarg,"%d/%lf/%lf", &windowmode, &windowstart, &windowend);
-			flag++;
-			break;
-		case '?':
-			errflg++;
-		}
-
-	/* set output stream to stdout or stderr */
-	if (verbose >= 2)
-	    outfp = stderr;
-	else
-	    outfp = stdout;
-
-	/* if error flagged then print it and exit */
-	if (errflg)
-		{
-		fprintf(outfp,"usage: %s\n", usage_message);
-		fprintf(outfp,"\nProgram <%s> Terminated\n",
-			program_name);
-		error = MB_ERROR_BAD_USAGE;
-		exit(error);
-		}
-
-	/* print starting message */
-	if (verbose == 1 || help)
-		{
-		fprintf(outfp,"\nProgram %s\n",program_name);
-		fprintf(outfp,"Version %s\n",rcs_id);
-		fprintf(outfp,"MB-system Version %s\n",MB_VERSION);
-		}
-
-	/* print starting debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(outfp,"\ndbg2  Program <%s>\n",program_name);
-		fprintf(outfp,"dbg2  Version %s\n",rcs_id);
-		fprintf(outfp,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(outfp,"dbg2  Control Parameters:\n");
-		fprintf(outfp,"dbg2       verbose:        %d\n",verbose);
-		fprintf(outfp,"dbg2       help:           %d\n",help);
-		fprintf(outfp,"dbg2       segyfile:       %s\n",segyfile);
-		fprintf(outfp,"dbg2       fileroot:       %s\n",fileroot);
-		fprintf(outfp,"dbg2       decimatex:      %d\n",decimatex);
-		fprintf(outfp,"dbg2       decimatey:      %d\n",decimatey);
-		fprintf(outfp,"dbg2       plotmode:       %d\n",plotmode);
-		fprintf(outfp,"dbg2       distancebin:    %f\n",distancebin);
-		fprintf(outfp,"dbg2       startlon:       %f\n",startlon);
-		fprintf(outfp,"dbg2       startlat:       %f\n",startlat);
-		fprintf(outfp,"dbg2       endlon:         %f\n",endlon);
-		fprintf(outfp,"dbg2       endlat:         %f\n",endlat);
-		fprintf(outfp,"dbg2       tracemode:      %d\n",tracemode);
-		fprintf(outfp,"dbg2       tracestart:     %d\n",tracestart);
-		fprintf(outfp,"dbg2       traceend:       %d\n",traceend);
-		fprintf(outfp,"dbg2       chanstart:      %d\n",chanstart);
-		fprintf(outfp,"dbg2       chanend:        %d\n",chanend);
-		fprintf(outfp,"dbg2       timesweep:      %f\n",timesweep);
-		fprintf(outfp,"dbg2       timedelay:      %f\n",timedelay);
-		fprintf(outfp,"dbg2       ngridx:         %d\n",ngridx);
-		fprintf(outfp,"dbg2       ngridy:         %d\n",ngridy);
-		fprintf(outfp,"dbg2       ngridxy:        %d\n",ngridxy);
-		fprintf(outfp,"dbg2       windowmode:     %d\n",windowmode);
-		fprintf(outfp,"dbg2       windowstart:    %f\n",windowstart);
-		fprintf(outfp,"dbg2       windowend:      %f\n",windowend);
-		fprintf(outfp,"dbg2       agcmode:        %d\n",agcmode);
-		fprintf(outfp,"dbg2       agcmaxvalue:    %f\n",agcmaxvalue);
-		fprintf(outfp,"dbg2       agcwindow:      %f\n",agcwindow);
-		fprintf(outfp,"dbg2       gainmode:       %d\n",gainmode);
-		fprintf(outfp,"dbg2       gain:           %f\n",gain);
-		fprintf(outfp,"dbg2       gainwindow:     %f\n",gainwindow);
-		fprintf(outfp,"dbg2       gaindelay:      %f\n",gaindelay);
-		fprintf(outfp,"dbg2       filtermode:     %d\n",filtermode);
-		fprintf(outfp,"dbg2       filterwindow:   %f\n",filterwindow);
-		fprintf(outfp,"dbg2       geometrymode:   %d\n",geometrymode);
-		fprintf(outfp,"dbg2       scale2distance: %d\n",scale2distance);
-		fprintf(outfp,"dbg2       shotscale:      %f\n",shotscale);
-		fprintf(outfp,"dbg2       timescale:      %f\n",timescale);
-		}
-
-	/* if help desired then print it and exit */
-	if (help)
-		{
-		fprintf(outfp,"\n%s\n",help_message);
-		fprintf(outfp,"\nusage: %s\n", usage_message);
-		exit(error);
-		}
-
-	/* get segy limits if required */
-	if (traceend < 1 || traceend < tracestart || timesweep <= 0.0
-		|| (plotmode == MBSEGYGRID_PLOTBYDISTANCE && startlon == 0.0))
-		{
-		get_segy_limits(verbose,
-				segyfile,
-				&sinftracemode,
-				&sinftracestart,
-				&sinftraceend,
-				&sinfchanstart,
-				&sinfchanend,
-				&sinftimesweep,
-				&sinftimedelay,
-				&sinfstartlon,
-				&sinfstartlat,
-				&sinfendlon,
-				&sinfendlat,
-				&error);
-		if (traceend < 1 || traceend < tracestart)
-			{
-			tracemode = sinftracemode;
-			tracestart = sinftracestart;
-			traceend = sinftraceend;
-			}
-		if (chanend < 1 || chanend < chanstart)
-			{
-			chanstart = sinfchanstart;
-			chanend = sinfchanend;
-			}
-		if (timesweep <= 0.0)
-			{
-			timesweep = sinftimesweep;
-			timedelay = sinftimedelay;
-			}
-		if (sinfstartlon != sinfendlon && sinfstartlat != sinfendlat)
-			{
-			startlon = sinfstartlon;
-			startlat = sinfstartlat;
-			endlon = sinfendlon;
-			endlat = sinfendlat;
-			}
-		}
-
-	/* check specified parameters */
-	if (traceend < 1 || traceend < tracestart)
-		{
-		fprintf(outfp,"\nBad trace numbers: %d %d specified...\n", tracestart, traceend);
-		fprintf(outfp,"\nProgram <%s> Terminated\n", program_name);
-		exit(error);
-		}
-	if (timesweep <= 0.0)
-		{
-		fprintf(outfp,"\nBad time sweep: %f specified...\n", timesweep);
-		fprintf(outfp,"\nProgram <%s> Terminated\n", program_name);
-		exit(error);
-		}
-
-	/* initialize reading the segy file */
-	if (mb_segy_read_init(verbose, segyfile,
-		&mbsegyioptr, &asciiheader, &fileheader, &error) != MB_SUCCESS)
-		{
-		mb_error(verbose,error,&message);
-		fprintf(outfp,"\nMBIO Error returned from function <mb_segy_read_init>:\n%s\n",message);
-		fprintf(outfp,"\nSEGY File <%s> not initialized for reading\n",segyfile);
-		fprintf(outfp,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-
-	/* calculate implied grid parameters */
-	strcpy(gridfile,fileroot);
-	strcat(gridfile,".grd");
-	if (chanend >= chanstart)
-		ntraces = (traceend - tracestart + 1) * (chanend - chanstart + 1);
-	else
-		ntraces = traceend - tracestart + 1;
-
-	/* set up plotting trace by trace */
-	if (plotmode == MBSEGYGRID_PLOTBYTRACENUMBER)
-		{
-		ngridx = ntraces / decimatex;
-		sampleinterval = 0.000001 * (double) (fileheader.sample_interval);
-		ngridy = timesweep / sampleinterval / decimatey + 1;
-		ngridxy = ngridx * ngridy;
-		xmin = (double) tracestart - 0.5;
-		xmax = (double) traceend + 0.5;
-		ymax = -(timedelay - 0.5 * sampleinterval / decimatey);
-		ymin = ymax - ngridy * sampleinterval * decimatey;
-		/*ymax = timedelay + timesweep + 0.5 * sampleinterval / decimatey;*/
-		}
-
-	/* set up plotting trace by distance along a line */
-	else if (plotmode == MBSEGYGRID_PLOTBYDISTANCE)
-		{
-		/* get distance scaling */
-		mb_coor_scale(verbose,0.5*(startlat + endlat),&mtodeglon,&mtodeglat);
-		dx = (endlon - startlon) / mtodeglon;
-		dy = (endlat - startlat) / mtodeglat;
-		line_distance = sqrt(dx * dx + dy * dy);
-		line_dx = dx / line_distance;
-		line_dy = dy / line_distance;
-
-		ngridx = (int)(line_distance / distancebin / decimatex);
-		sampleinterval = 0.000001 * (double) (fileheader.sample_interval);
-		ngridy = timesweep / sampleinterval / decimatey + 1;
-		ngridxy = ngridx * ngridy;
-		xmin = -0.5 * distancebin;
-		xmax = line_distance + 0.5 * distancebin;
-		ymax = -(timedelay - 0.5 * sampleinterval / decimatey);
-		ymin = ymax - ngridy * sampleinterval * decimatey;
-		/*ymax = timedelay + timesweep + 0.5 * sampleinterval / decimatey;*/
-		}
-
-	/* get start and end samples */
-	if (windowmode == MBSEGYGRID_WINDOW_OFF)
-		{
-		iystart = 0;
-		iyend = ngridy - 1;
-		}
-	else if (windowmode == MBSEGYGRID_WINDOW_ON)
-		{
-		iystart = MAX((windowstart) / sampleinterval, 0);
-		iyend = MIN((windowend) / sampleinterval, ngridy - 1);
-		}
-
-	/* allocate memory for grid array */
-	status = mb_mallocd(verbose,__FILE__,__LINE__, ngridxy * sizeof(float), (void **)&grid, &error);
-	status = mb_mallocd(verbose,__FILE__,__LINE__, ngridxy * sizeof(float), (void **)&gridweight, &error);
-
-	/* output info */
-	if (verbose >= 0)
-		{
-		fprintf(outfp,"\nMBsegygrid Parameters:\n");
-		fprintf(outfp,"Input segy file:         %s\n",segyfile);
-		fprintf(outfp,"Output fileroot:         %s\n",fileroot);
-		fprintf(outfp,"Input Parameters:\n");
-		fprintf(outfp,"     plot mode:          %d\n",plotmode);
-		fprintf(outfp,"     trace mode:         %d\n",tracemode);
-		fprintf(outfp,"     trace start:        %d\n",tracestart);
-		fprintf(outfp,"     trace end:          %d\n",traceend);
-		fprintf(outfp,"     channel start:      %d\n",chanstart);
-		fprintf(outfp,"     channel end:        %d\n",chanend);
-		fprintf(outfp,"     start longitude:    %f\n",startlon);
-		fprintf(outfp,"     start latitude:     %f\n",startlat);
-		fprintf(outfp,"     end longitude:      %f\n",endlon);
-		fprintf(outfp,"     end latitude:       %f\n",endlat);
-		fprintf(outfp,"     trace decimation:   %d\n",decimatex);
-		fprintf(outfp,"     time sweep:         %f seconds\n",timesweep);
-		fprintf(outfp,"     time delay:         %f seconds\n",timedelay);
-		fprintf(outfp,"     sample interval:    %f seconds\n",sampleinterval);
-		fprintf(outfp,"     sample decimation:  %d\n",decimatey);
-		fprintf(outfp,"     window mode:        %d\n",windowmode);
-		fprintf(outfp,"     window start:       %f seconds\n",windowstart);
-		fprintf(outfp,"     window end:         %f seconds\n",windowend);
-		fprintf(outfp,"     agcmode:            %d\n",agcmode);
-		fprintf(outfp,"     gain mode:          %d\n",gainmode);
-		fprintf(outfp,"     gain:               %f\n",gain);
-		fprintf(outfp,"     gainwindow:         %f\n",gainwindow);
-		fprintf(outfp,"     gaindelay:          %f\n",gaindelay);
-		fprintf(outfp,"Output Parameters:\n");
-		fprintf(outfp,"     grid filename:      %s\n",gridfile);
-		fprintf(outfp,"     x grid dimension:   %d\n",ngridx);
-		fprintf(outfp,"     y grid dimension:   %d\n",ngridy);
-		fprintf(outfp,"     grid xmin:          %f\n",xmin);
-		fprintf(outfp,"     grid xmax:          %f\n",xmax);
-		fprintf(outfp,"     grid ymin:          %f\n",ymin);
-		fprintf(outfp,"     grid ymax:          %f\n",ymax);
-		fprintf(outfp,"     NaN values used to flag regions with no data\n");
-		if (scale2distance == MB_YES)
-			{
-			fprintf(outfp,"     shot and time scaled to distance in meters\n");
-			fprintf(outfp,"     shotscale:          %f\n",shotscale);
-			fprintf(outfp,"     timescale:          %f\n",timescale);
-			fprintf(outfp,"     scaled grid xmin    %f\n",0.0);
-			fprintf(outfp,"     scaled grid xmax:   %f\n",shotscale * (xmax - xmin));
-			fprintf(outfp,"     scaled grid ymin:   %f\n",0.0);
-			fprintf(outfp,"     scaled grid ymax:   %f\n",timescale * (ymax - ymin));
-			}
-		}
-	if (verbose > 0)
-		fprintf(outfp,"\n");
-
-	/* proceed if all ok */
-	if (status == MB_SUCCESS)
-		{
-
-		/* initialize grid and weight arrays */
-		for (k=0;k<ngridxy;k++)
-			{
-			grid[k] = 0.0;
-			gridweight[k] = 0.0;
-			}
-
-		/* read and print data */
-		nread = 0;
-		while (error <= MB_ERROR_NO_ERROR)
-			{
-			/* reset error */
-			error = MB_ERROR_NO_ERROR;
-
-			/* read a trace */
-			status = mb_segy_read_trace(verbose, mbsegyioptr,
-					&traceheader, &trace, &error);
-
-			/* now process the trace */
-			if (status == MB_SUCCESS)
-				{
-				/* figure out where this trace is in the grid laterally */
-				if (plotmode == MBSEGYGRID_PLOTBYTRACENUMBER)
-					{
-					if (tracemode == MBSEGYGRID_USESHOT)
-						{
-						tracenum = traceheader.shot_num;
-						channum = traceheader.shot_tr;
-						}
-					else if (tracemode == MBSEGYGRID_USECMP)
-						{
-						tracenum = traceheader.rp_num;
-						channum = traceheader.rp_tr;
-						}
-					if (chanend >= chanstart)
-						{
-						tracecount = (tracenum - tracestart) * (chanend - chanstart + 1)
-								+ (channum - chanstart);
-						}
-					else
-						{
-						tracecount = tracenum - tracestart;
-						}
-					ix = tracecount / decimatex;
-
-					/* now check if this is a trace of interest */
-					traceok = MB_YES;
-					if (tracenum < tracestart
-						|| tracenum > traceend)
-						traceok = MB_NO;
-					else if (chanend >= chanstart
-							&& (channum < chanstart
-								|| channum > chanend))
-						traceok = MB_NO;
-					else if (tracecount % decimatex != 0)
-						traceok = MB_NO;
-					}
-				else if (plotmode == MBSEGYGRID_PLOTBYDISTANCE)
-					{
-					if (traceheader.coord_scalar < 0)
-						factor = 1.0 / ((float) (-traceheader.coord_scalar)) / 3600.0;
-					else
-						factor = (float) traceheader.coord_scalar / 3600.0;
-					if (traceheader.src_long != 0)
-						navlon  = factor * ((float)traceheader.src_long);
-					else
-						navlon  = factor * ((float)traceheader.grp_long);
-					if (traceheader.src_lat != 0)
-						navlat  = factor * ((float)traceheader.src_lat);
-					else
-						navlat  = factor * ((float)traceheader.grp_lat);
-					if (lonflip < 0)
-						{
-						if (navlon > 0.)
-							navlon = navlon - 360.;
-						else if (navlon < -360.)
-							navlon = navlon + 360.;
-						}
-					else if (lonflip == 0)
-						{
-						if (navlon > 180.)
-							navlon = navlon - 360.;
-						else if (navlon < -180.)
-							navlon = navlon + 360.;
-						}
-					else
-						{
-						if (navlon > 360.)
-							navlon = navlon - 360.;
-						else if (navlon < 0.)
-							navlon = navlon + 360.;
-						}
-					dx = (navlon - startlon) / mtodeglon;
-					dy = (navlat - startlat) / mtodeglat;
-					trace_x = dx * line_dx + dy * line_dy;
-					ix = ((int)((trace_x - 0.5 * distancebin) / distancebin)) / decimatex;
-					if (ix >= 0 && ix < ngridx)
-						traceok = MB_YES;
-					else
-						traceok = MB_NO;
-					}
-
-				/* figure out where this trace is in the grid vertically */
-				if (traceheader.elev_scalar < 0)
-					factor = 1.0 / ((float) (-traceheader.elev_scalar));
-				else
-					factor = (float) traceheader.elev_scalar;
-				if (traceheader.src_depth > 0)
-					{
-					btime = factor * traceheader.src_depth / 750.0 + 0.001 * traceheader.delay_mils;
-					dtime = factor * traceheader.src_depth / 750.0;
-					btimesave = btime;
-					dtimesave = dtime;
-					}
-				else if (traceheader.src_elev > 0)
-					{
-					btime = -factor * traceheader.src_elev / 750.0 + 0.001 * traceheader.delay_mils;
-					dtime = -factor * traceheader.src_elev / 750.0;
-					btimesave = btime;
-					dtimesave = dtime;
-					}
-				else
-					{
-					btime = btimesave;
-					dtime = dtimesave;
-					}
-				if (traceheader.src_wbd > 0)
-					{
-					stime = factor * traceheader.src_wbd / 750.0;
-					stimesave = stime;
-					}
-				else
-					{
-					stime = stimesave;
-					}
-				iys = (btime - timedelay) / sampleinterval;
-
-				/* get trace min and max */
-				tracemin = trace[0];
-				tracemax = trace[0];
-				for (i=0;i<traceheader.nsamps;i++)
-					{
-					tracemin = MIN(tracemin, trace[i]);
-					tracemax = MAX(tracemin, trace[i]);
-					}
-
-				if ((verbose == 0 && nread % 250 == 0) || (nread % 25 == 0))
-					{
-					if (traceok == MB_YES)
-						fprintf(outfp,"PROCESS ");
-					else
-						fprintf(outfp,"IGNORE  ");
-					if (tracemode == MBSEGYGRID_USESHOT)
-						fprintf(outfp,"read:%d position:%d shot:%d channel:%d ",
-							nread,tracecount,tracenum,channum);
-					else
-						fprintf(outfp,"read:%d position:%d rp:%d channel:%d ",
-							nread,tracecount,tracenum,channum);
-					if (plotmode == MBSEGYGRID_PLOTBYDISTANCE)
-						fprintf(outfp,"distance:%.3f ", trace_x);
-					fprintf(outfp,"%4.4d/%3.3d %2.2d:%2.2d:%2.2d.%3.3d samples:%d interval:%d usec minmax: %f %f\n",
-					traceheader.year,traceheader.day_of_yr,
-					traceheader.hour,traceheader.min,traceheader.sec,traceheader.mils,
-					traceheader.nsamps,traceheader.si_micros,
-					tracemin, tracemax);
-					}
-
-				/* now actually process traces of interest */
-				if (traceok == MB_YES)
-					{
-					/* get bounds of trace in depth window mode */
-					if (windowmode == MBSEGYGRID_WINDOW_DEPTH)
-						{
-						iystart = (int)((dtime + windowstart - timedelay) / sampleinterval);
-						iystart = MAX(iystart, 0);
-						iyend = (int)((dtime + windowend - timedelay) / sampleinterval);
-						iyend = MIN(iyend, ngridy - 1);
-						}
-					else if (windowmode == MBSEGYGRID_WINDOW_SEAFLOOR)
-						{
-						iystart = MAX((stime + windowstart - timedelay) / sampleinterval, 0);
-						iyend = MIN((stime + windowend - timedelay) / sampleinterval, ngridy - 1);
-						}
-
-					/* apply gain if desired */
-					if (gainmode == MBSEGYGRID_GAIN_TZERO
-						|| gainmode == MBSEGYGRID_GAIN_SEAFLOOR)
-						{
-						if (gainmode == MBSEGYGRID_GAIN_TZERO)
-							igainstart = (dtime - btime + gaindelay) / sampleinterval;
-						else if (gainmode == MBSEGYGRID_GAIN_SEAFLOOR)
-							igainstart = (stime - btime + gaindelay) / sampleinterval;
-						igainstart = MAX(0, igainstart);
-						if (gainwindow <= 0.0)
-							{
-							igainend = traceheader.nsamps - 1;
-							}
-						else
-							{
-							igainend = igainstart + gainwindow / sampleinterval;
-							igainend = MIN(traceheader.nsamps - 1, igainend);
-							}
-/*fprintf(stderr,"gainmode:%d btime:%f stime:%f igainstart:%d igainend:%d\n",
-gainmode,btime,stime,igainstart,igainend);*/
-						for (i=0;i<=igainstart;i++)
-							{
-							trace[i] = 0.0;
-							}
-						for (i=igainstart;i<=igainend;i++)
-							{
-							gtime = (i - igainstart) * sampleinterval;
-							factor = 1.0 + gain * gtime;
-/*fprintf(stderr,"i:%d iy:%d factor:%f trace[%d]: %f",
-i,iy,factor,i,trace[i]);*/
-							trace[i] = trace[i] * factor;
-/*fprintf(stderr," %f\n",trace[i]);*/
-							}
-						for (i=igainend+1;i<=traceheader.nsamps;i++)
-							{
-							trace[i] = 0.0;
-							}
-						}
-					else if (gainmode == MBSEGYGRID_GAIN_AGCSEAFLOOR)
-						{
-						igainstart = (stime - btime - 0.5 * gainwindow) / sampleinterval;
-						igainstart = MAX(0, igainstart);
-						igainend = (stime - btime + 0.5 * gainwindow) / sampleinterval;
-						igainend = MIN(traceheader.nsamps - 1, igainend);
-						tmax = fabs(trace[igainstart]);
-						for (i=igainstart;i<=igainend;i++)
-							{
-							tmax = MAX(tmax, fabs(trace[i]));
-							}
-						if (tmax > 0.0)
-							factor = gain / tmax;
-						else
-							factor = 1.0;
-						for (i=0;i<=traceheader.nsamps;i++)
-							{
-							trace[i] *= factor;
-							}
-/*fprintf(stderr,"igainstart:%d igainend:%d tmax:%f factor:%f\n",
-igainstart,igainend,tmax,factor);*/
-						}
-
-					/* apply filtering if desired */
-					if (filtermode != MBSEGYGRID_FILTER_OFF)
-						{
-						if (worktrace == NULL || traceheader.nsamps > worktrace_alloc)
-							{
-							status = mb_reallocd(verbose,__FILE__,__LINE__,
-										traceheader.nsamps * sizeof(float),
-										(void **)&worktrace, &error);
-							worktrace_alloc = traceheader.nsamps;
-							}
-						nfilter = 2 * ((int)(0.5 * filterwindow / sampleinterval)) + 1;
-						if (filtertrace == NULL || nfilter > filtertrace_alloc)
-							{
-							status = mb_reallocd(verbose,__FILE__,__LINE__,
-										nfilter * sizeof(float),
-										(void **)&filtertrace, &error);
-							filtertrace_alloc = nfilter;
-							}
-						filtersum = 0.0;
-						for (j=0;j<nfilter;j++)
-							{
-							cos_arg = (0.5 * M_PI * (j - nfilter / 2)) / (0.5 * nfilter);
-							filtertrace[j] = cos(cos_arg);
-							filtersum += filtertrace[j];
-/*fprintf(stderr,"FILTER: j:%d nfilter:%d cos_arg:%f cos:%f filtertrace:%f sum:%f\n",j,nfilter,cos_arg,cos(cos_arg),filtertrace[j],filtersum);*/
-							}
-						for (i=0;i<=traceheader.nsamps;i++)
-							{
-							worktrace[i] = 0.0;
-							filtersum = 0.0;
-							jstart = MAX(nfilter / 2 - i, 0);
-							jend = MIN(nfilter - 1, nfilter - 1 + (traceheader.nsamps - 1 - nfilter / 2 - i));
-							for (j=jstart;j<=jend;j++)
-								{
-								ii = i - nfilter/2 + j;
-								worktrace[i] += filtertrace[j] * trace[ii];
-								filtersum += filtertrace[j];
-/* fprintf(stderr,"      i:%d j:%d ii:%d trace:%f sum:%f\n",i,j,ii,worktrace[i],filtersum); */
-								}
-							worktrace[i] /= filtersum;
-/* fprintf(stderr,"i:%d jstart:%d jend:%d trace: %f %f\n",i,jstart,jend,trace[i], worktrace[i]);*/
-							}
-						for (i=0;i<=traceheader.nsamps;i++)
-							{
-							trace[i] = worktrace[i];
-							}
-						}
-
-					/* apply agc if desired */
-					if (agcmode == MB_YES && agcwindow > 0.0)
-						{
-						if (worktrace == NULL || traceheader.nsamps > worktrace_alloc)
-							{
-							status = mb_reallocd(verbose,__FILE__,__LINE__,
-										traceheader.nsamps * sizeof(float),
-										(void **)&worktrace, &error);
-							worktrace_alloc = traceheader.nsamps;
-							}
-						iagchalfwindow = 0.5 * agcwindow / sampleinterval;
-						for (i=0;i<=traceheader.nsamps;i++)
-							{
-							igainstart = i - iagchalfwindow;
-							igainstart = MAX(0, igainstart);
-							igainend = i + iagchalfwindow;
-							igainend = MIN(traceheader.nsamps - 1, igainend);
-							tmax = 0.0;
-							for (j=igainstart;j<=igainend;j++)
-								{
-								tmax = MAX(tmax, fabs(trace[j]));
-								}
-							if (tmax > 0.0)
-								worktrace[i] = trace[i] * agcmaxvalue / tmax;
-							else
-								worktrace[i] = trace[i];
-							}
-						for (i=0;i<=traceheader.nsamps;i++)
-							{
-							trace[i] = worktrace[i];
-							}
-						}
-					else if (agcmode == MB_YES)
-						{
-						tmax = 0.0;
-						for (i=0;i<=traceheader.nsamps;i++)
-							{
-							tmax = MAX(tmax, fabs(trace[i]));
-							}
-						if (tmax > 0.0)
-							factor = agcmaxvalue / tmax;
-						else
-							factor = 1.0;
-						for (i=0;i<=traceheader.nsamps;i++)
-							{
-							trace[i] *= factor;
-							}
-						}
-
-					/* process trace for simple vertical geometry */
-					if (geometrymode == MBSEGYGRID_GEOMETRY_VERTICAL)
-						{
-						for (i=0;i<traceheader.nsamps;i++)
-							{
-							iy = (ngridy - 1) - (iys + i / decimatey);
-							k = ix * ngridy + iy;
-							if (iy >= iystart && iy <= iyend)
-								{
-								grid[k] += trace[i];
-								gridweight[k] += 1.0;
-								}
-							}
-						}
-
-					/* process trace for real geometry using pitch */
-					else /* if (geometrymode == MBSEGYGRID_GEOMETRY_REAL) */
-						{
-						cosfactor = cos(DTR * traceheader.pitch);
-						for (i=0;i<traceheader.nsamps;i++)
-							{
-							/* get corrected y location of this sample
-							  in the section grid using the pitch angle */
-							iyc = iys + (int)(cosfactor * ((double)i)) / decimatey;
-
-							/* get the index of the sample location */
-							if (iyc >= iystart && iyc <= iyend)
-								{
-								iy = (ngridy - 1) - iyc;
-								k = ix * ngridy + iy;
-								grid[k] += trace[i];
-								gridweight[k] += 1.0;
-								}
-							}
-						}
-					}
-				}
-
-			/* now process the trace */
-			if (status == MB_SUCCESS)
-				nread++;
-			}
-
-		/* calculate the grid */
-		gridmintot = 0.0;
-		gridmaxtot = 0.0;
-		for (k=0;k<ngridxy;k++)
-			{
-			if (gridweight[k] > 0.0)
-				{
-				grid[k] = grid[k] / gridweight[k];
-				gridmintot = MIN(grid[k], gridmintot);
-				gridmaxtot = MAX(grid[k], gridmaxtot);
-				}
-			else
-				{
-				grid[k] = NaN;
-				}
-			}
-		}
-
-	/* write out the grid */
-	error = MB_ERROR_NO_ERROR;
-	status = MB_SUCCESS;
-	strcpy(projection, "SeismicProfile");
-	if (scale2distance == MB_YES)
-		{
-		strcpy(xlabel, "Distance (m)");
-		strcpy(ylabel, "Depth (m)");
-		xmax = shotscale * (xmax - xmin);
-		xmin = 0.0;
-		ymin = timescale * ymin;
-		ymax = timescale * ymax;
-		dx = shotscale * decimatex;
-		dy = timescale * sampleinterval / decimatey;
-		}
-	else
-		{
-		strcpy(xlabel, "Trace Number");
-		strcpy(ylabel, "Travel Time (seconds)");
-		dx = (double) decimatex;
-		dy = sampleinterval / decimatey;
-		}
-	strcpy(zlabel, "Trace Signal");
-	sprintf(title, "Seismic Grid from %s", segyfile);
-	status = mb_write_gmt_grd(verbose, gridfile, grid,
-		NaN, 
-		ngridx, ngridy,
-		xmin, xmax, ymin, ymax,
-		gridmintot, gridmaxtot, dx, dy,
-		xlabel, ylabel, zlabel, title,
-		projection, argc, argv, &error);
-
-	/* close the swath file */
-	status = mb_segy_close(verbose,&mbsegyioptr,&error);
-
-	/* deallocate memory for grid array */
-	if (worktrace != NULL)
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&worktrace, &error);
-	if (filtertrace != NULL)
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&filtertrace, &error);
-	status = mb_freed(verbose,__FILE__,__LINE__,(void **)&grid, &error);
-	status = mb_freed(verbose,__FILE__,__LINE__,(void **)&gridweight, &error);
-
-	/* run mbm_grdplot */
-	xwidth = MIN(0.01 * (double) ngridx, 55.0);
-	ywidth = MIN(0.01 * (double) ngridy, 28.0);
-	sprintf(plot_cmd, "mbm_grdplot -I%s -JX%f/%f -G1 -V -L\"File %s - %s:%s\"",
-			gridfile, xwidth, ywidth, gridfile, title, zlabel);
-	if (verbose)
-		{
-		fprintf(outfp, "\nexecuting mbm_grdplot...\n%s\n",
-			plot_cmd);
-		}
-	plot_status = system(plot_cmd);
-	if (plot_status == -1)
-		{
-		fprintf(outfp, "\nError executing mbm_grdplot on grid file %s\n", gridfile);
-		}
-
-	/* check memory */
-	if (verbose >= 4)
-		status = mb_memory_list(verbose,&error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(outfp,"\ndbg2  Program <%s> completed\n",
-			program_name);
-		fprintf(outfp,"dbg2  Ending status:\n");
-		fprintf(outfp,"dbg2       status:  %d\n",status);
-		}
-
-	/* end it all */
-	exit(error);
-}
-/*--------------------------------------------------------------------*/
-/*
- * function get_segy_limits gets info for default segy gridding
- */
-int get_segy_limits(int verbose,
-		char	*segyfile,
-		int	*tracemode,
-		int	*tracestart,
-		int	*traceend,
-		int	*chanstart,
-		int	*chanend,
-		double	*timesweep,
-		double	*timedelay,
-		double	*startlon,
-		double	*startlat,
-		double	*endlon,
-		double	*endlat,
-		int *error)
-{
-	char	*function_name = "get_segy_limits";
-	int	status = MB_SUCCESS;
-	char	sinffile[MB_PATH_MAXLINE];
-	char	command[MB_PATH_MAXLINE];
-	char	line[MB_PATH_MAXLINE];
-	FILE	*sfp;
-	int	datmodtime = 0;
-	int	sinfmodtime = 0;
-	struct stat file_status;
-	int	fstat;
-	double	delay0 = 0.0;
-	double	delay1 = 0.0;
-	double	delaydel = 0.0;
-	int	shot0, shot1, shotdel;
-	int	shottrace0, shottrace1, shottracedel;
-	int	rp0, rp1;
-	int	rpdel = 0;
-	int	rptrace0, rptrace1, rptracedel;
-	int	nscan;
-	int	shellstatus;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(outfp,"\ndbg2  Function <%s> called\n",
-			function_name);
-		fprintf(outfp,"dbg2  Input arguments:\n");
-		fprintf(outfp,"dbg2       verbose:    %d\n",verbose);
-		fprintf(outfp,"dbg2       segyfile:   %s\n",segyfile);
-		}
-
-	/* set sinf filename */
-	sprintf(sinffile, "%s.sinf", segyfile);
-
-	/* check status of segy and sinf file */
-	datmodtime = 0;
-	sinfmodtime = 0;
-	if ((fstat = stat(segyfile, &file_status)) == 0
-		&& (file_status.st_mode & S_IFMT) != S_IFDIR)
-		{
-		datmodtime = file_status.st_mtime;
-		}
-	if ((fstat = stat(sinffile, &file_status)) == 0
-		&& (file_status.st_mode & S_IFMT) != S_IFDIR)
-		{
-		sinfmodtime = file_status.st_mtime;
-		}
-
-	/* if sinf file is missing or out of date, make it */
-	if (datmodtime > 0 && datmodtime > sinfmodtime)
-		{
-		if (verbose >= 1)
-			fprintf(stderr,"\nGenerating sinf file for %s\n",segyfile);
-		sprintf(command, "mbsegyinfo -I %s -O", segyfile);
-		shellstatus = system(command);
-		}
-
-
-	/* read sinf file if possible */
-	sprintf(sinffile, "%s.sinf", segyfile);
-	if ((sfp = fopen(sinffile, "r")) != NULL)
-		{
-		/* read the sinf file */
-		while (fgets(line, MB_PATH_MAXLINE, sfp) != NULL)
-		    {
-		    if (strncmp(line, "  Trace length (sec):", 21) == 0)
-			{
-			nscan = sscanf(line, "  Trace length (sec):%lf", timesweep);
-			}
-		    else if (strncmp(line, "    Delay (sec):", 16) == 0)
-			{
-			nscan = sscanf(line, "    Delay (sec): %lf %lf %lf", &delay0, &delay1, &delaydel);
-			}
-		    else if (strncmp(line, "    Shot number:", 16) == 0)
-			{
-			nscan = sscanf(line, "    Shot number: %d %d %d", &shot0, &shot1, &shotdel);
-			}
-		    else if (strncmp(line, "    Shot trace:", 15) == 0)
-			{
-			nscan = sscanf(line, "    Shot trace: %d %d %d", &shottrace0, &shottrace1, &shottracedel);
-			}
-		    else if (strncmp(line, "    RP number:", 14) == 0)
-			{
-			nscan = sscanf(line, "    RP number: %d %d %d", &rp0, &rp1, &rpdel);
-			}
-		    else if (strncmp(line, "    RP trace:", 13) == 0)
-			{
-			nscan = sscanf(line, "    RP trace: %d %d %d", &rptrace0, &rptrace1, &rptracedel);
-			}
-		    else if (strncmp(line, "    Start Position:", 19) == 0)
-			{
-			nscan = sscanf(line, "    Start Position: Lon: %lf     Lat:   %lf", startlon, startlat);
-			}
-		    else if (strncmp(line, "    End Position:", 17) == 0)
-			{
-			nscan = sscanf(line, "    End Position:   Lon: %lf     Lat:   %lf", endlon, endlat);
-			}
-		    }
-		fclose(sfp);
-		}
-
-	/* set the trace mode */
-	if (rpdel > 1)
-		{
-		*tracemode = MBSEGYGRID_USECMP;
-		*tracestart = rp0;
-		*traceend = rp1;
-		*chanstart = rptrace0;
-		*chanend = rptrace1;
-		}
-	else
-		{
-		*tracemode = MBSEGYGRID_USESHOT;
-		*tracestart = shot0;
-		*traceend = shot1;
-		*chanstart = shottrace0;
-		*chanend = shottrace1;
-		}
-
-	/* set the sweep and delay */
-	if (delaydel > 0.0)
-		{
-		*timesweep += delaydel;
-		}
-	*timedelay = delay0;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(outfp,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(outfp,"dbg2  Return values:\n");
-		fprintf(outfp,"dbg2       tracemode:  %d\n",*tracemode);
-		fprintf(outfp,"dbg2       tracestart: %d\n",*tracestart);
-		fprintf(outfp,"dbg2       traceend:   %d\n",*traceend);
-		fprintf(outfp,"dbg2       chanstart:  %d\n",*chanstart);
-		fprintf(outfp,"dbg2       chanend:    %d\n",*chanend);
-		fprintf(outfp,"dbg2       timesweep:  %f\n",*timesweep);
-		fprintf(outfp,"dbg2       timedelay:  %f\n",*timedelay);
-		fprintf(outfp,"dbg2       startlon:   %f\n",*startlon);
-		fprintf(outfp,"dbg2       startlat:   %f\n",*startlat);
-		fprintf(outfp,"dbg2       endlon:     %f\n",*endlon);
-		fprintf(outfp,"dbg2       endlat:     %f\n",*endlat);
-		fprintf(outfp,"dbg2       error:      %d\n",*error);
-		fprintf(outfp,"dbg2  Return status:\n");
-		fprintf(outfp,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/utilities/mbsegyinfo.c b/src/utilities/mbsegyinfo.c
deleted file mode 100644
index a0acc45..0000000
--- a/src/utilities/mbsegyinfo.c
+++ /dev/null
@@ -1,560 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbsegyinfo.c	6/2/2004
- *    $Id: mbsegyinfo.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 2004-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * MBsegyinfo reads a segy data file and outputs some basic statistics.
- *
- * Author:	D. W. Caress
- * Date:	June 2, 2004
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <math.h>
-#include <string.h>
-#include <time.h>
-
-/* MBIO include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_define.h"
-#include "mb_segy.h"
-
-/* local options */
-#define	MAX_OPTIONS	25
-#define	MBLIST_CHECK_ON			0
-#define	MBLIST_CHECK_ON_NULL		1
-#define	MBLIST_CHECK_OFF_RAW		2
-#define	MBLIST_CHECK_OFF_NAN		3
-#define	MBLIST_CHECK_OFF_FLAGNAN	4
-#define	MBLIST_SET_OFF	0
-#define	MBLIST_SET_ON	1
-#define	MBLIST_SET_ALL	2
-
-static char rcs_id[] = "$Id: mbsegyinfo.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-
-int main (int argc, char **argv)
-{
-	char program_name[] = "MBsegyinfo";
-	char help_message[] =  "MBsegyinfo lists table data from a segy data file.";
-	char usage_message[] = "MBsegyinfo -Ifile [-Llonflip -O -H -V]";
-	extern char *optarg;
-	int	errflg = 0;
-	int	c;
-	int	help = 0;
-	int	flag = 0;
-
-	/* MBIO status variables */
-	int	status = MB_SUCCESS;
-	int	verbose = 0;
-	int	error = MB_ERROR_NO_ERROR;
-	char	*message;
-
-	/* MBIO read control parameters */
-	char	read_file[MB_PATH_MAXLINE];
-	int	pings;
-	int	lonflip;
-	double	bounds[4];
-	int	btime_i[7];
-	int	etime_i[7];
-	double	speedmin;
-	double	timegap;
-
-	/* segy data */
-	void	*mbsegyioptr;
-	struct mb_segyasciiheader_struct asciiheader;
-	struct mb_segyfileheader_struct fileheader;
-	struct mb_segytraceheader_struct traceheader;
-	float	*trace;
-
-	/* output format list controls */
-	int	nread = 0;
-	int	first = MB_YES;
-
-	/* limit variables */
-	int	shotmin = 0;
-	int	shotmax = 0;
-	int	shottracemin = 0;
-	int	shottracemax = 0;
-	int	rpmin = 0;
-	int	rpmax = 0;
-	int	rptracemin = 0;
-	int	rptracemax = 0;
-	double	rangemin = 0.0;
-	double	rangemax = 0.0;
-	double	receiverelevationmin = 0.0;
-	double	receiverelevationmax = 0.0;
-	double	sourceelevationmin = 0.0;
-	double	sourceelevationmax = 0.0;
-	double	sourcedepthmin = 0.0;
-	double	sourcedepthmax = 0.0;
-	double	sourcewaterdepthmin = 0.0;
-	double	sourcewaterdepthmax = 0.0;
-	double	receiverwaterdepthmin = 0.0;
-	double	receiverwaterdepthmax = 0.0;
-	double	delaymin = 0.0;
-	double	delaymax = 0.0;
-	double	lonmin = 0.0;
-	double	lonmax = 0.0;
-	double	latmin = 0.0;
-	double	latmax = 0.0;
-	double	lonbeg = 0.0;
-	double	latbeg = 0.0;
-	double	lonend = 0.0;
-	double	latend = 0.0;
-	double	timbeg = 0.0;
-	double	timend = 0.0;
-	int	timbeg_i[7];
-	int	timend_i[7];
-	int	timbeg_j[5];
-	int	timend_j[5];
-
-	int	time_i[7], time_j[5];
-	double	time_d;
-	double	navlon, navlat;
-	double	factor, sonardepth, waterdepth;
-	double	tracelength, delay;
-	double	range;
-	double	receiverelevation;
-	double	sourceelevation;
-	double	sourcedepth;
-	double	sourcewaterdepth;
-	double	receiverwaterdepth;
-
-	/* output stream for basic stuff (stdout if verbose <= 1,
-		output if verbose > 1) */
-	FILE	*stream = NULL;
-	FILE	*output = NULL;
-	int	output_usefile = MB_NO;
-	char	output_file[MB_PATH_MAXLINE];
-
-	int	format;
-	int	i;
-
-	/* get current default values */
-	status = mb_defaults(verbose,&format,&pings,&lonflip,bounds,
-		btime_i,etime_i,&speedmin,&timegap);
-
-	/* set read_file to null */
-	read_file[0] = '\0';
-
-	/* process argument list */
-	while ((c = getopt(argc, argv, "I:i:L:l:OoVvWwHh")) != -1)
-	  switch (c)
-		{
-		case 'H':
-		case 'h':
-			help++;
-			break;
-		case 'V':
-		case 'v':
-			verbose++;
-			break;
-		case 'I':
-		case 'i':
-			sscanf (optarg,"%s", read_file);
-			flag++;
-			break;
-		case 'L':
-		case 'l':
-			sscanf (optarg,"%d", &lonflip);
-			flag++;
-			break;
-		case 'O':
-		case 'o':
-			output_usefile = MB_YES;
-			flag++;
-			break;
-		case '?':
-			errflg++;
-		}
-
-	/* set output stream */
-	if (verbose <= 1)
-		stream = stdout;
-	else
-		stream = stderr;
-
-	/* if error flagged then print it and exit */
-	if (errflg)
-		{
-		fprintf(stderr,"usage: %s\n", usage_message);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		error = MB_ERROR_BAD_USAGE;
-		exit(error);
-		}
-
-	/* print starting message */
-	if (verbose == 1 || help)
-		{
-		fprintf(stderr,"\nProgram %s\n",program_name);
-		fprintf(stderr,"Version %s\n",rcs_id);
-		fprintf(stderr,"MB-system Version %s\n",MB_VERSION);
-		}
-
-	/* print starting debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  Program <%s>\n",program_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Control Parameters:\n");
-		fprintf(stderr,"dbg2       verbose:        %d\n",verbose);
-		fprintf(stderr,"dbg2       help:           %d\n",help);
-		fprintf(stderr,"dbg2       lonflip:        %d\n",lonflip);
-		fprintf(stderr,"dbg2       bounds[0]:      %f\n",bounds[0]);
-		fprintf(stderr,"dbg2       bounds[1]:      %f\n",bounds[1]);
-		fprintf(stderr,"dbg2       bounds[2]:      %f\n",bounds[2]);
-		fprintf(stderr,"dbg2       bounds[3]:      %f\n",bounds[3]);
-		fprintf(stderr,"dbg2       btime_i[0]:     %d\n",btime_i[0]);
-		fprintf(stderr,"dbg2       btime_i[1]:     %d\n",btime_i[1]);
-		fprintf(stderr,"dbg2       btime_i[2]:     %d\n",btime_i[2]);
-		fprintf(stderr,"dbg2       btime_i[3]:     %d\n",btime_i[3]);
-		fprintf(stderr,"dbg2       btime_i[4]:     %d\n",btime_i[4]);
-		fprintf(stderr,"dbg2       btime_i[5]:     %d\n",btime_i[5]);
-		fprintf(stderr,"dbg2       btime_i[6]:     %d\n",btime_i[6]);
-		fprintf(stderr,"dbg2       etime_i[0]:     %d\n",etime_i[0]);
-		fprintf(stderr,"dbg2       etime_i[1]:     %d\n",etime_i[1]);
-		fprintf(stderr,"dbg2       etime_i[2]:     %d\n",etime_i[2]);
-		fprintf(stderr,"dbg2       etime_i[3]:     %d\n",etime_i[3]);
-		fprintf(stderr,"dbg2       etime_i[4]:     %d\n",etime_i[4]);
-		fprintf(stderr,"dbg2       etime_i[5]:     %d\n",etime_i[5]);
-		fprintf(stderr,"dbg2       etime_i[6]:     %d\n",etime_i[6]);
-		fprintf(stderr,"dbg2       speedmin:       %f\n",speedmin);
-		fprintf(stderr,"dbg2       timegap:        %f\n",timegap);
-		fprintf(stderr,"dbg2       read_file:      %s\n",read_file);
-		}
-
-	/* if help desired then print it and exit */
-	if (help)
-		{
-		fprintf(stderr,"\n%s\n",help_message);
-		fprintf(stderr,"\nusage: %s\n", usage_message);
-		exit(error);
-		}
-
-	/* initialize reading the segy file */
-	if (mb_segy_read_init(verbose, read_file,
-		&mbsegyioptr, &asciiheader, &fileheader, &error) != MB_SUCCESS)
-		{
-		mb_error(verbose,error,&message);
-		fprintf(stderr,"\nMBIO Error returned from function <mb_segy_read_init>:\n%s\n",message);
-		fprintf(stderr,"\nSEGY File <%s> not initialized for reading\n",read_file);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-
-	/* Open output file if requested */
-	if (output_usefile == MB_YES)
-	    {
-	    strcpy(output_file, read_file);
-	    strcat(output_file, ".sinf");
-	    if ((output = fopen(output_file, "w")) == NULL)
-		output = stream;
-	    }
-	else
-	    {
-	    output = stream;
-	    }
-
-	/* read and print data */
-	nread = 0;
-	first = MB_YES;
-	while (error <= MB_ERROR_NO_ERROR)
-		{
-		/* reset error */
-		error = MB_ERROR_NO_ERROR;
-
-		/* read a trace */
-		status = mb_segy_read_trace(verbose, mbsegyioptr,
-				&traceheader, &trace, &error);
-/*fprintf(stderr,"read_file:%s record:%d shot:%d  %4.4d/%3.3d %2.2d:%2.2d:%2.2d.%3.3d samples:%d interval:%d\n",
-	read_file,nread,traceheader.shot_num,
-	traceheader.year,traceheader.day_of_yr,
-	traceheader.hour,traceheader.min,traceheader.sec,traceheader.mils,
-	traceheader.nsamps,traceheader.si_micros);*/
-
-		/* deal with success */
-		if (status == MB_SUCCESS)
-			{
-			nread++;
-
-			/* get needed values */
-			time_j[0] = traceheader.year;
-			time_j[1] = traceheader.day_of_yr;
-			time_j[2] = traceheader.min + 60 * traceheader.hour;
-			time_j[3] = traceheader.sec;
-			time_j[4] = 1000 * traceheader.mils;
-			mb_get_itime(verbose, time_j, time_i);
-			mb_get_time(verbose, time_i, &time_d);
-			if (traceheader.elev_scalar < 0)
-				factor = 1.0 / ((float) (-traceheader.elev_scalar));
-			else
-				factor = (float) traceheader.elev_scalar;
-			if (traceheader.grp_elev != 0)
-				sonardepth = -factor * traceheader.grp_elev;
-			else if (traceheader.src_elev != 0)
-				sonardepth = -factor * traceheader.src_elev;
-			else if (traceheader.src_depth != 0)
-				sonardepth = factor * traceheader.src_depth;
-			else
-				sonardepth = 0.0;
-			if (traceheader.src_wbd != 0)
-				waterdepth = -traceheader.grp_elev;
-			else if (traceheader.grp_wbd != 0)
-				waterdepth = -traceheader.src_elev;
-			else
-				waterdepth = 0;
-			if (traceheader.coord_scalar < 0)
-				factor = 1.0 / ((float) (-traceheader.coord_scalar)) / 3600.0;
-			else
-				factor = (float) traceheader.coord_scalar / 3600.0;
-			if (traceheader.src_long != 0)
-				navlon  = factor * ((float)traceheader.src_long);
-			else
-				navlon  = factor * ((float)traceheader.grp_long);
-			if (traceheader.src_lat != 0)
-				navlat  = factor * ((float)traceheader.src_lat);
-			else
-				navlat  = factor * ((float)traceheader.grp_lat);
-			if (lonflip < 0)
-				{
-				if (navlon > 0.)
-					navlon = navlon - 360.;
-				else if (navlon < -360.)
-					navlon = navlon + 360.;
-				}
-			else if (lonflip == 0)
-				{
-				if (navlon > 180.)
-					navlon = navlon - 360.;
-				else if (navlon < -180.)
-					navlon = navlon + 360.;
-				}
-			else
-				{
-				if (navlon > 360.)
-					navlon = navlon - 360.;
-				else if (navlon < 0.)
-					navlon = navlon + 360.;
-				}
-			if (traceheader.elev_scalar < 0)
-				factor = 1.0 / ((float) (-traceheader.elev_scalar));
-			else
-				factor = (float) traceheader.elev_scalar;
-			range = (double) traceheader.range;
-			receiverelevation = factor * ((double)traceheader.grp_elev);
-			sourceelevation = factor * ((double)traceheader.src_elev);
-			sourcedepth = factor * ((double)traceheader.src_depth);
-			sourcewaterdepth = factor * ((double)traceheader.src_wbd);
-			receiverwaterdepth = factor * ((double)traceheader.grp_wbd);
-			delay = 0.001 * ((double)traceheader.delay_mils);
-
-			/* get initial values */
-			if (first == MB_YES)
-				{
-				shotmin = traceheader.shot_num;
-				shotmax = traceheader.shot_num;
-				shottracemin = traceheader.shot_tr;
-				shottracemax = traceheader.shot_tr;
-				rpmin = traceheader.rp_num;
-				rpmax = traceheader.rp_num;
-				rptracemin = traceheader.rp_tr;
-				rptracemax = traceheader.rp_tr;
-				delaymin = delay;
-				delaymax = delay;
-				lonmin = navlon;
-				lonmax = navlon;
-				latmin = navlat;
-				latmax = navlat;
-				rangemin = range;
-				rangemax = range;
-				receiverelevationmin = receiverelevation;
-				receiverelevationmax = receiverelevation;
-				sourceelevationmin = sourceelevation;
-				sourceelevationmax = sourceelevation;
-				sourcedepthmin = sourcedepth;
-				sourcedepthmax = sourcedepth;
-				sourcewaterdepthmin = sourcewaterdepth;
-				sourcewaterdepthmax = sourcewaterdepth;
-				receiverwaterdepthmin = receiverwaterdepth;
-				receiverwaterdepthmax = receiverwaterdepth;
-
-				lonbeg = navlon;
-				latbeg = navlat;
-				lonend = navlon;
-				latend = navlat;
-				timbeg = time_d;
-				timend = time_d;
-				for (i=0;i<7;i++)
-					{
-					timbeg_i[i] = time_i[i];
-					timend_i[i] = time_i[i];
-					}
-				for (i=0;i<5;i++)
-					{
-					timbeg_j[i] = time_j[i];
-					timend_j[i] = time_j[i];
-					}
-				first = MB_NO;
-				}
-
-			/* get min max values */
-			else
-				{
-				shotmin = MIN(shotmin, traceheader.shot_num);
-				shotmax = MAX(shotmax, traceheader.shot_num);
-				shotmin = MIN(shotmin, traceheader.shot_num);
-				shotmax = MAX(shotmax, traceheader.shot_num);
-				rpmin = MIN(rpmin, traceheader.rp_num);
-				rpmax = MAX(rpmax, traceheader.rp_num);
-				rptracemin = MIN(rptracemin, traceheader.rp_tr);
-				rptracemax = MAX(rptracemax, traceheader.rp_tr);
-				delaymin = MIN(delaymin, delay);
-				delaymax = MAX(delaymax, delay);
-				if (navlon != 0.0 && navlat != 0.0)
-					{
-					lonmin = MIN(lonmin, navlon);
-					lonmax = MAX(lonmax, navlon);
-					latmin = MIN(latmin, navlat);
-					latmax = MAX(latmax, navlat);
-					}
-				lonend = navlon;
-				latend = navlat;
-				timend = time_d;
-				for (i=0;i<7;i++)
-					{
-					timend_i[i] = time_i[i];
-					}
-				for (i=0;i<5;i++)
-					{
-					timend_j[i] = time_j[i];
-					}
-				rangemin = MIN(rangemin, range);
-				rangemax = MAX(rangemax, range);
-				receiverelevationmin = MIN(receiverelevationmin, receiverelevation);
-				receiverelevationmax = MAX(receiverelevationmax, receiverelevation);
-				sourceelevationmin = MIN(sourceelevationmin, sourceelevation);
-				sourceelevationmax = MAX(sourceelevationmax, sourceelevation);
-				sourcedepthmin = MIN(sourcedepthmin, sourcedepth);
-				sourcedepthmax = MAX(sourcedepthmax, sourcedepth);
-				sourcewaterdepthmin = MIN(sourcewaterdepthmin, sourcewaterdepth);
-				sourcewaterdepthmax = MAX(sourcewaterdepthmax, sourcewaterdepth);
-				receiverwaterdepthmin = MIN(receiverwaterdepthmin, receiverwaterdepth);
-				receiverwaterdepthmax = MAX(receiverwaterdepthmax, receiverwaterdepth);
-				}
-
-			}
-
-		/* reset first flag */
-		if (error == MB_ERROR_NO_ERROR && first == MB_YES)
-			{
-			first = MB_NO;
-			}
-
-		}
-
-	/* close the swath file */
-	status = mb_segy_close(verbose,&mbsegyioptr,&error);
-
-	/* output the information */
-	tracelength = 0.000001 * (double)(fileheader.sample_interval * fileheader.number_samples);
-	fprintf(output,"\nSEGY Data File:      %s\n",read_file);
-	fprintf(output,"\nFile Header Info:\n");
-	fprintf(output,"  Channels:                   %8d\n",fileheader.channels);
-	fprintf(output,"  Auxiliary Channels:         %8d\n",fileheader.aux_channels);
-	fprintf(output,"  Sample Interval (usec):     %8d\n",fileheader.sample_interval);
-	fprintf(output,"  Number of Samples in Trace: %8d\n",fileheader.number_samples);
-	fprintf(output,"  Trace length (sec):         %8f\n",tracelength);
-	if (fileheader.format == 1)
-		fprintf(output,"  Data Format:                IBM 32 bit floating point\n");
-	else if (fileheader.format == 2)
-		fprintf(output,"  Data Format:                32 bit integer\n");
-	else if (fileheader.format == 3)
-		fprintf(output,"  Data Format:                16 bit integer\n");
-	else if (fileheader.format == 5)
-		fprintf(output,"  Data Format:                IEEE 32 bit integer\n");
-	else if (fileheader.format == 6)
-		fprintf(output,"  Data Format:                IEEE 32 bit integer\n");
-	else if (fileheader.format == 8)
-		fprintf(output,"  Data Format:                8 bit integer\n");
-	else if (fileheader.format == 11)
-		fprintf(output,"  Data Format:                Little-endian IEEE 32 bit floating point\n");
-	else
-		fprintf(output,"  Data Format:                Unknown\n");
-	fprintf(output,"  CDP Fold:                   %8d\n",fileheader.cdp_fold);
-	fprintf(output,"\nData Totals:\n");
-	fprintf(output,"  Number of Traces:           %8d\n",nread);
-	fprintf(output,"  Min Max Delta:\n");
-	fprintf(output,"    Shot number:              %8d %8d %8d\n",
-		shotmin, shotmax, shotmax - shotmin + 1);
-	fprintf(output,"    Shot trace:               %8d %8d %8d\n",
-		shottracemin, shottracemax, shottracemax - shottracemin + 1);
-	fprintf(output,"    RP number:                %8d %8d %8d\n",
-		rpmin, rpmax, rpmax - rpmin + 1);
-	fprintf(output,"    RP trace:                 %8d %8d %8d\n",
-		rptracemin, rptracemax, rptracemax - rptracemin + 1);
-	fprintf(output,"    Delay (sec):              %8f %8f %8f\n",
-		delaymin, delaymax, delaymax - delaymin);
-	fprintf(output,"    Range (m):                %8f %8f %8f\n",
-		rangemin, rangemax, rangemax - rangemin);
-	fprintf(output,"    Receiver Elevation (m):   %8f %8f %8f\n",
-		receiverelevationmin, receiverelevationmax, receiverelevationmax - receiverelevationmin);
-	fprintf(output,"    Source Elevation (m):     %8f %8f %8f\n",
-		sourceelevationmin, sourceelevationmax, sourceelevationmax - sourceelevationmin);
-	fprintf(output,"    Source Depth (m):         %8f %8f %8f\n",
-		sourcedepthmin, sourcedepthmax, sourcedepthmax - sourcedepthmin);
-	fprintf(output,"    Receiver Water Depth (m): %8f %8f %8f\n",
-		receiverwaterdepthmin, receiverwaterdepthmax, receiverwaterdepthmax - receiverwaterdepthmin);
-	fprintf(output,"    Source Water Depth (m):   %8f %8f %8f\n",
-		sourcewaterdepthmin, sourcewaterdepthmax, sourcewaterdepthmax - sourcewaterdepthmin);
-	fprintf(output,"\nNavigation Totals:\n");
-	fprintf(output,"\n  Start of Data:\n");
-	fprintf(output,"    Start Time:  %2.2d %2.2d %4.4d %2.2d:%2.2d:%2.2d.%6.6d  JD%d\n",
-		timbeg_i[1],timbeg_i[2],timbeg_i[0],timbeg_i[3],
-		timbeg_i[4],timbeg_i[5],timbeg_i[6],timbeg_j[1]);
-	fprintf(output,"    Start Position: Lon: %14.9f     Lat: %14.9f\n", lonbeg,latbeg);
-	fprintf(output,"\n  End of Data:\n");
-	fprintf(output,"    End Time:    %2.2d %2.2d %4.4d %2.2d:%2.2d:%2.2d.%6.6d  JD%d\n",
-		timend_i[1],timend_i[2],timend_i[0],timend_i[3],
-		timend_i[4],timend_i[5],timend_i[6],timend_j[1]);
-	fprintf(output,"    End Position:   Lon: %14.9f     Lat: %14.9f \n", lonend,latend);
-	fprintf(output,"\nLimits:\n");
-	fprintf(output,"  Minimum Longitude:   %14.9f   Maximum Longitude:   %14.9f\n",lonmin,lonmax);
-	fprintf(output,"  Minimum Latitude:    %14.9f   Maximum Latitude:    %14.9f\n",latmin,latmax);
-
-	/* check memory */
-	if (verbose >= 4)
-		status = mb_memory_list(verbose,&error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  Program <%s> completed\n",
-			program_name);
-		fprintf(stderr,"dbg2  Ending status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* end it all */
-	exit(error);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/utilities/mbsegylist.c b/src/utilities/mbsegylist.c
deleted file mode 100644
index 8d8575f..0000000
--- a/src/utilities/mbsegylist.c
+++ /dev/null
@@ -1,892 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbsegylist.c	5/29/2004
- *    $Id: mbsegylist.c 2251 2015-07-01 01:02:06Z caress $
- *
- *    Copyright (c) 2004-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * MBsegylist prints the specified contents of a segy data
- * file to stdout. The form of the output is quite flexible;
- * MBsegylist is tailored to produce ascii files in spreadsheet
- * style with data columns separated by tabs.
- *
- * Author:	D. W. Caress
- * Date:	May 29, 2004
- *
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <math.h>
-#include <string.h>
-#include <time.h>
-
-/* MBIO include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_define.h"
-#include "mb_segy.h"
-
-/* local options */
-#define	MAX_OPTIONS	25
-#define	MBLIST_CHECK_ON			0
-#define	MBLIST_CHECK_ON_NULL		1
-#define	MBLIST_CHECK_OFF_RAW		2
-#define	MBLIST_CHECK_OFF_NAN		3
-#define	MBLIST_CHECK_OFF_FLAGNAN	4
-#define	MBLIST_SET_OFF	0
-#define	MBLIST_SET_ON	1
-#define	MBLIST_SET_ALL	2
-
-/* NaN value */
-double	NaN;
-
-/* function prototypes */
-int printsimplevalue(int verbose,
-	double value, int width, int precision,
-	int ascii, int *invert, int *flipsign, int *error);
-int printNaN(int verbose, int ascii, int *invert, int *flipsign, int *error);
-
-static char rcs_id[] = "$Id: mbsegylist.c 2251 2015-07-01 01:02:06Z caress $";
-
-/*--------------------------------------------------------------------*/
-
-int main (int argc, char **argv)
-{
-	char program_name[] = "MBsegylist";
-	char help_message[] =  "MBsegylist lists table data from a segy data file.";
-	char usage_message[] = "MBsegylist -Ifile [-A -Ddecimate -Gdelimiter -Llonflip -Olist -H -V]";
-	extern char *optarg;
-	int	errflg = 0;
-	int	c;
-	int	help = 0;
-	int	flag = 0;
-
-	/* MBIO status variables */
-	int	status = MB_SUCCESS;
-	int	verbose = 0;
-	int	error = MB_ERROR_NO_ERROR;
-	char	*message;
-
-	/* MBIO read control parameters */
-	char	file[MB_PATH_MAXLINE];
-	int	pings;
-	int	decimate;
-	int	lonflip;
-	double	bounds[4];
-	int	btime_i[7];
-	int	etime_i[7];
-	double	speedmin;
-	double	timegap;
-
-	/* segy data */
-	void	*mbsegyioptr;
-	struct mb_segyasciiheader_struct asciiheader;
-	struct mb_segyfileheader_struct fileheader;
-	struct mb_segytraceheader_struct traceheader;
-	float	*trace;
-
-	/* output format list controls */
-	char	list[MAX_OPTIONS];
-	int	n_list;
-	int	nread;
-	int	invert_next_value = MB_NO;
-	int	signflip_next_value = MB_NO;
-	int	first = MB_YES;
-	int	ascii = MB_YES;
-	int	segment = MB_NO;
-	char	segment_tag[MB_PATH_MAXLINE];
-	char	delimiter[MB_PATH_MAXLINE];
-
-	/* additional time variables */
-	int	first_m = MB_YES;
-	double	time_d_ref;
-	int	first_u = MB_YES;
-	time_t	time_u;
-	time_t	time_u_ref;
-	double	time_interval;
-	double	minutes;
-	int	degrees;
-	char	hemi;
-
-	int	time_i[7], time_j[5];
-	double	time_d, time_d_old;
-	double	navlon, navlat;
-	double	factor, sonardepth, waterdepth;
-	double	delay, interval;
-	double	seconds;
-
-	double	b;
-	int	format;
-	int	i, j;
-
-	/* get current default values */
-	status = mb_defaults(verbose,&format,&pings,&lonflip,bounds,
-		btime_i,etime_i,&speedmin,&timegap);
-
-	/* set file to null */
-	file[0] = '\0';
-
-	/* set up the default list controls: TiXYSsCcDINL
-		(time, time interval, lon, lat, shot, shot trace #, cmp, cmp trace #,
-			delay, sample length, number samples, trace length) */
-	n_list = 0;
-	list[n_list]='T'; n_list++;
-	list[n_list]='i'; n_list++;
-	list[n_list]='X'; n_list++;
-	list[n_list]='Y'; n_list++;
-	list[n_list]='S'; n_list++;
-	list[n_list]='s'; n_list++;
-	list[n_list]='C'; n_list++;
-	list[n_list]='c'; n_list++;
-	list[n_list]='D'; n_list++;
-	list[n_list]='I'; n_list++;
-	list[n_list]='N'; n_list++;
-	list[n_list]='L'; n_list++;
-	sprintf(delimiter, "\t");
-	decimate = 1;
-
-	/* get NaN value */
-	MB_MAKE_DNAN(NaN);
-
-	/* process argument list */
-	while ((c = getopt(argc, argv, "AaD:d:G:g:I:i:L:l:O:o:VvWwZ:z:Hh")) != -1)
-	  switch (c)
-		{
-		case 'H':
-		case 'h':
-			help++;
-			break;
-		case 'V':
-		case 'v':
-			verbose++;
-			break;
-		case 'A':
-		case 'a':
-			ascii = MB_NO;
-			flag++;
-			break;
-		case 'D':
-		case 'd':
-			sscanf (optarg,"%d", &decimate);
-			flag++;
-			break;
-		case 'G':
-		case 'g':
-			sscanf (optarg,"%s", delimiter);
-			flag++;
-			break;
-		case 'I':
-		case 'i':
-			sscanf (optarg,"%s", file);
-			flag++;
-			break;
-		case 'L':
-		case 'l':
-			sscanf (optarg,"%d", &lonflip);
-			flag++;
-			break;
-		case 'O':
-		case 'o':
-			for(j=0,n_list=0;j<(int)strlen(optarg);j++,n_list++)
-				if (n_list<MAX_OPTIONS)
-					list[n_list] = optarg[j];
-			flag++;
-			break;
-		case 'Z':
-		case 'z':
-			segment = MB_YES;
-			sscanf (optarg,"%s", segment_tag);
-			flag++;
-			break;
-		case '?':
-			errflg++;
-		}
-
-	/* if error flagged then print it and exit */
-	if (errflg)
-		{
-		fprintf(stderr,"usage: %s\n", usage_message);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		error = MB_ERROR_BAD_USAGE;
-		exit(error);
-		}
-
-	/* print starting message */
-	if (verbose == 1 || help)
-		{
-		fprintf(stderr,"\nProgram %s\n",program_name);
-		fprintf(stderr,"Version %s\n",rcs_id);
-		fprintf(stderr,"MB-system Version %s\n",MB_VERSION);
-		}
-
-	/* print starting debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  Program <%s>\n",program_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Control Parameters:\n");
-		fprintf(stderr,"dbg2       verbose:        %d\n",verbose);
-		fprintf(stderr,"dbg2       help:           %d\n",help);
-		fprintf(stderr,"dbg2       lonflip:        %d\n",lonflip);
-		fprintf(stderr,"dbg2       decimate:       %d\n",decimate);
-		fprintf(stderr,"dbg2       bounds[0]:      %f\n",bounds[0]);
-		fprintf(stderr,"dbg2       bounds[1]:      %f\n",bounds[1]);
-		fprintf(stderr,"dbg2       bounds[2]:      %f\n",bounds[2]);
-		fprintf(stderr,"dbg2       bounds[3]:      %f\n",bounds[3]);
-		fprintf(stderr,"dbg2       btime_i[0]:     %d\n",btime_i[0]);
-		fprintf(stderr,"dbg2       btime_i[1]:     %d\n",btime_i[1]);
-		fprintf(stderr,"dbg2       btime_i[2]:     %d\n",btime_i[2]);
-		fprintf(stderr,"dbg2       btime_i[3]:     %d\n",btime_i[3]);
-		fprintf(stderr,"dbg2       btime_i[4]:     %d\n",btime_i[4]);
-		fprintf(stderr,"dbg2       btime_i[5]:     %d\n",btime_i[5]);
-		fprintf(stderr,"dbg2       btime_i[6]:     %d\n",btime_i[6]);
-		fprintf(stderr,"dbg2       etime_i[0]:     %d\n",etime_i[0]);
-		fprintf(stderr,"dbg2       etime_i[1]:     %d\n",etime_i[1]);
-		fprintf(stderr,"dbg2       etime_i[2]:     %d\n",etime_i[2]);
-		fprintf(stderr,"dbg2       etime_i[3]:     %d\n",etime_i[3]);
-		fprintf(stderr,"dbg2       etime_i[4]:     %d\n",etime_i[4]);
-		fprintf(stderr,"dbg2       etime_i[5]:     %d\n",etime_i[5]);
-		fprintf(stderr,"dbg2       etime_i[6]:     %d\n",etime_i[6]);
-		fprintf(stderr,"dbg2       speedmin:       %f\n",speedmin);
-		fprintf(stderr,"dbg2       timegap:        %f\n",timegap);
-		fprintf(stderr,"dbg2       file:           %s\n",file);
-		fprintf(stderr,"dbg2       ascii:          %d\n",ascii);
-		fprintf(stderr,"dbg2       segment:        %d\n",segment);
-		fprintf(stderr,"dbg2       segment_tag:    %s\n",segment_tag);
-		fprintf(stderr,"dbg2       delimiter:      %s\n",delimiter);
-		fprintf(stderr,"dbg2       n_list:         %d\n",n_list);
-		for (i=0;i<n_list;i++)
-			fprintf(stderr,"dbg2         list[%d]:      %c\n",
-						i,list[i]);
-		}
-
-	/* if help desired then print it and exit */
-	if (help)
-		{
-		fprintf(stderr,"\n%s\n",help_message);
-		fprintf(stderr,"\nusage: %s\n", usage_message);
-		exit(error);
-		}
-
-	/* initialize reading the segy file */
-	if (mb_segy_read_init(verbose, file,
-		&mbsegyioptr, &asciiheader, &fileheader, &error) != MB_SUCCESS)
-		{
-		mb_error(verbose,error,&message);
-		fprintf(stderr,"\nMBIO Error returned from function <mb_segy_read_init>:\n%s\n",message);
-		fprintf(stderr,"\nSEGY File <%s> not initialized for reading\n",file);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-
-	/* output separator for GMT style segment file output */
-	if (segment == MB_YES && ascii == MB_YES)
-		{
-		printf("%s\n", segment_tag);
-		}
-
-	/* read and print data */
-	nread = 0;
-	first = MB_YES;
-	while (error <= MB_ERROR_NO_ERROR)
-		{
-		/* reset error */
-		error = MB_ERROR_NO_ERROR;
-
-		/* read a trace */
-		status = mb_segy_read_trace(verbose, mbsegyioptr,
-				&traceheader, &trace, &error);
-/*fprintf(stderr,"file:%s record:%d shot:%d  %4.4d/%3.3d %2.2d:%2.2d:%2.2d.%3.3d samples:%d interval:%d\n",
-	file,nread,traceheader.shot_num,
-	traceheader.year,traceheader.day_of_yr,
-	traceheader.hour,traceheader.min,traceheader.sec,traceheader.mils,
-	traceheader.nsamps,traceheader.si_micros);*/
-
-		/* get needed values */
-		if (status == MB_SUCCESS)
-			{
-			nread++;
-			time_j[0] = traceheader.year;
-			time_j[1] = traceheader.day_of_yr;
-			time_j[2] = traceheader.min + 60 * traceheader.hour;
-			time_j[3] = traceheader.sec;
-			time_j[4] = 1000 * traceheader.mils;
-			mb_get_itime(verbose, time_j, time_i);
-			mb_get_time(verbose, time_i, &time_d);
-			if (first == MB_YES)
-				{
-				time_d_old = time_d;
-				}
-			if (traceheader.elev_scalar < 0)
-				factor = 1.0 / ((float) (-traceheader.elev_scalar));
-			else
-				factor = (float) traceheader.elev_scalar;
-			if (traceheader.grp_elev != 0)
-				sonardepth = -factor * traceheader.grp_elev;
-			else if (traceheader.src_elev != 0)
-				sonardepth = -factor * traceheader.src_elev;
-			else if (traceheader.src_depth != 0)
-				sonardepth = factor * traceheader.src_depth;
-			else
-				sonardepth = 0.0;
-			if (traceheader.src_wbd != 0)
-				waterdepth = -traceheader.grp_elev;
-			else if (traceheader.grp_wbd != 0)
-				waterdepth = -traceheader.src_elev;
-			else
-				waterdepth = 0;
-			if (traceheader.coord_scalar < 0)
-				factor = 1.0 / ((float) (-traceheader.coord_scalar)) / 3600.0;
-			else
-				factor = (float) traceheader.coord_scalar / 3600.0;
-			if (traceheader.src_long != 0)
-				navlon  = factor * ((float)traceheader.src_long);
-			else
-				navlon  = factor * ((float)traceheader.grp_long);
-			if (traceheader.src_lat != 0)
-				navlat  = factor * ((float)traceheader.src_lat);
-			else
-				navlat  = factor * ((float)traceheader.grp_lat);
-			if (lonflip < 0)
-				{
-				if (navlon > 0.)
-					navlon = navlon - 360.;
-				else if (navlon < -360.)
-					navlon = navlon + 360.;
-				}
-			else if (lonflip == 0)
-				{
-				if (navlon > 180.)
-					navlon = navlon - 360.;
-				else if (navlon < -180.)
-					navlon = navlon + 360.;
-				}
-			else
-				{
-				if (navlon > 360.)
-					navlon = navlon - 360.;
-				else if (navlon < 0.)
-					navlon = navlon + 360.;
-				}
-			}
-
-		/* print out info */
-		if (status == MB_SUCCESS && (nread - 1) % decimate == 0)
-			{
-			for (i=0; i<n_list; i++)
-				{
-				switch (list[i])
-					{
-					case '/': /* Inverts next simple value */
-						invert_next_value = MB_YES;
-						break;
-					case '-': /* Flip sign on next simple value */
-						signflip_next_value = MB_YES;
-						break;
-					case 'C': /* CDP number or CMP number or RP number */
-						if (ascii == MB_YES)
-						    printf("%6d",traceheader.rp_num);
-						else
-						    {
-						    b = traceheader.rp_num;
-						    fwrite(&b, sizeof(double), 1, stdout);
-						    }
-						break;
-					case 'c': /* CDP trace or CMP trace or RP trace */
-						if (ascii == MB_YES)
-						    printf("%6d",traceheader.rp_tr);
-						else
-						    {
-						    b = traceheader.rp_tr;
-						    fwrite(&b, sizeof(double), 1, stdout);
-						    }
-						break;
-					case 'D': /* trace start delay */
-						delay = 0.001 * traceheader.delay_mils;
-						printsimplevalue(verbose, delay, 0, 3, ascii,
-								    &invert_next_value,
-								    &signflip_next_value, &error);
-						break;
-					case 'I': /* sample interval in seconds */
-						interval = 0.000001 * traceheader.si_micros;
-						printsimplevalue(verbose, interval, 0, 6, ascii,
-								    &invert_next_value,
-								    &signflip_next_value, &error);
-						break;
-					case 'i': /* time interval since last trace */
-						interval = time_d - time_d_old;
-						printsimplevalue(verbose, interval, 0, 3, ascii,
-								    &invert_next_value,
-								    &signflip_next_value, &error);
-						break;
-					case 'J': /* time string */
-						mb_get_jtime(verbose,time_i,time_j);
-						seconds = time_i[5] + 0.000001 * time_i[6];
-						if (ascii == MB_YES)
-						    {
-						    printf("%.4d %.3d %.2d %.2d %9.6f",
-							time_j[0],time_j[1],
-							time_i[3],time_i[4],
-							seconds);
-						    }
-						else
-						    {
-						    b = time_j[0];
-						    fwrite(&b, sizeof(double), 1, stdout);
-						    b = time_j[1];
-						    fwrite(&b, sizeof(double), 1, stdout);
-						    b = time_i[3];
-						    fwrite(&b, sizeof(double), 1, stdout);
-						    b = time_i[4];
-						    fwrite(&b, sizeof(double), 1, stdout);
-						    b = time_i[5];
-						    fwrite(&b, sizeof(double), 1, stdout);
-						    b = time_i[6];
-						    fwrite(&b, sizeof(double), 1, stdout);
-						    }
-						break;
-					case 'j': /* time string */
-						mb_get_jtime(verbose,time_i,time_j);
-						seconds = time_i[5] + 0.000001 * time_i[6];
-						if (ascii == MB_YES)
-						    {
-						    printf("%.4d %.3d %.4d %9.6f",
-							time_j[0],time_j[1],
-							time_j[2],seconds);
-						    }
-						else
-						    {
-						    b = time_j[0];
-						    fwrite(&b, sizeof(double), 1, stdout);
-						    b = time_j[1];
-						    fwrite(&b, sizeof(double), 1, stdout);
-						    b = time_j[2];
-						    fwrite(&b, sizeof(double), 1, stdout);
-						    b = time_j[3];
-						    fwrite(&b, sizeof(double), 1, stdout);
-						    b = time_j[4];
-						    fwrite(&b, sizeof(double), 1, stdout);
-						    }
-						break;
-					case 'L': /* Trace length in seconds */
-						interval = 0.000001 * traceheader.si_micros
-								* traceheader.nsamps;
-						printsimplevalue(verbose, interval, 0, 6, ascii,
-								    &invert_next_value,
-								    &signflip_next_value, &error);
-						break;
-					case 'M': /* Decimal unix seconds since
-							1/1/70 00:00:00 */
-						printsimplevalue(verbose, time_d, 0, 6, ascii,
-								    &invert_next_value,
-								    &signflip_next_value, &error);
-						break;
-					case 'm': /* time in decimal seconds since
-							first record */
-						if (first_m == MB_YES)
-							{
-							time_d_ref = time_d;
-							first_m = MB_NO;
-							}
-						b = time_d - time_d_ref;
-						printsimplevalue(verbose, b, 0, 6, ascii,
-								    &invert_next_value,
-								    &signflip_next_value, &error);
-						break;
-					case 'N': /* number of samples in trace */
-						if (ascii == MB_YES)
-						    printf("%6d",traceheader.nsamps);
-						else
-						    {
-						    b = traceheader.nsamps;
-						    fwrite(&b, sizeof(double), 1, stdout);
-						    }
-						break;
-					case 'n': /* trace counter */
-						if (ascii == MB_YES)
-						    printf("%6d",nread);
-						else
-						    {
-						    b = nread;
-						    fwrite(&b, sizeof(double), 1, stdout);
-						    }
-						break;
-					case 'R': /* range */
-						if (ascii == MB_YES)
-						    printf("%6d",traceheader.range);
-						else
-						    {
-						    b = traceheader.range;
-						    fwrite(&b, sizeof(double), 1, stdout);
-						    }
-						break;
-					case 'S': /* shot number */
-						if (ascii == MB_YES)
-						    printf("%6d",traceheader.shot_num);
-						else
-						    {
-						    b = traceheader.shot_num;
-						    fwrite(&b, sizeof(double), 1, stdout);
-						    }
-						break;
-					case 's': /* shot trace */
-						if (ascii == MB_YES)
-						    printf("%6d",traceheader.shot_tr);
-						else
-						    {
-						    b = traceheader.shot_tr;
-						    fwrite(&b, sizeof(double), 1, stdout);
-						    }
-						break;
-					case 'T': /* yyyy/mm/dd/hh/mm/ss time string */
-						seconds = time_i[5] + 1e-6 * time_i[6];
-						if (ascii == MB_YES)
-						    printf("%.4d/%.2d/%.2d/%.2d/%.2d/%9.6f",
-							time_i[0],time_i[1],time_i[2],
-							time_i[3],time_i[4],seconds);
-						else
-						    {
-						    b = time_i[0];
-						    fwrite(&b, sizeof(double), 1, stdout);
-						    b = time_i[1];
-						    fwrite(&b, sizeof(double), 1, stdout);
-						    b = time_i[2];
-						    fwrite(&b, sizeof(double), 1, stdout);
-						    b = time_i[3];
-						    fwrite(&b, sizeof(double), 1, stdout);
-						    b = time_i[4];
-						    fwrite(&b, sizeof(double), 1, stdout);
-						    b = seconds;
-						    fwrite(&b, sizeof(double), 1, stdout);
-						    }
-						break;
-					case 't': /* yyyy mm dd hh mm ss time string */
-						seconds = time_i[5] + 1e-6 * time_i[6];
-						if (ascii == MB_YES)
-						    printf("%.4d %.2d %.2d %.2d %.2d %9.6f",
-							time_i[0],time_i[1],time_i[2],
-							time_i[3],time_i[4],seconds);
-						else
-						    {
-						    b = time_i[0];
-						    fwrite(&b, sizeof(double), 1, stdout);
-						    b = time_i[1];
-						    fwrite(&b, sizeof(double), 1, stdout);
-						    b = time_i[2];
-						    fwrite(&b, sizeof(double), 1, stdout);
-						    b = time_i[3];
-						    fwrite(&b, sizeof(double), 1, stdout);
-						    b = time_i[4];
-						    fwrite(&b, sizeof(double), 1, stdout);
-						    b = seconds;
-						    fwrite(&b, sizeof(double), 1, stdout);
-						    }
-						break;
-					case 'U': /* unix time in seconds since 1/1/70 00:00:00 */
-						time_u = (int) time_d;
-						if (ascii == MB_YES)
-						    printf("%ld",time_u);
-						else
-						    {
-						    b = time_u;
-						    fwrite(&b, sizeof(double), 1, stdout);
-						    }
-						break;
-					case 'u': /* time in seconds since first record */
-						time_u = (int) time_d;
-						if (first_u == MB_YES)
-							{
-							time_u_ref = time_u;
-							first_u = MB_NO;
-							}
-						if (ascii == MB_YES)
-						    printf("%ld",time_u - time_u_ref);
-						else
-						    {
-						    b = time_u - time_u_ref;
-						    fwrite(&b, sizeof(double), 1, stdout);
-						    }
-						break;
-					case 'V': /* time in seconds since last ping */
-					case 'v':
-						if (ascii == MB_YES)
-						    {
-						    if ( fabs(time_interval) > 100. )
-							printf("%g",time_interval);
-						    else
-							printf("%7.3f",time_interval);
-						    }
-						else
-						    {
-						    fwrite(&time_interval, sizeof(double), 1, stdout);
-						    }
-						break;
-					case 'X': /* longitude decimal degrees */
-						printsimplevalue(verbose, navlon, 11, 6, ascii,
-								    &invert_next_value,
-								    &signflip_next_value, &error);
-						break;
-					case 'x': /* longitude degress + decimal minutes */
-						if (navlon < 0.0)
-							{
-							hemi = 'W';
-							navlon = -navlon;
-							}
-						else
-							hemi = 'E';
-						degrees = (int) navlon;
-						minutes = 60.0*(navlon - degrees);
-						if (ascii == MB_YES)
-						    {
-						    printf("%3d %8.5f%c",
-							degrees, minutes, hemi);
-						    }
-						else
-						    {
-						    b = degrees;
-						    if (hemi == 'W') b = -b;
-						    fwrite(&b, sizeof(double), 1, stdout);
-						    b = minutes;
-						    fwrite(&b, sizeof(double), 1, stdout);
-						    }
-						break;
-					case 'Y': /* latitude decimal degrees */
-						printsimplevalue(verbose, navlat, 11, 6, ascii,
-								    &invert_next_value,
-								    &signflip_next_value, &error);
-						break;
-					case 'y': /* latitude degrees + decimal minutes */
-						if (navlat < 0.0)
-							{
-							hemi = 'S';
-							navlat = -navlat;
-							}
-						else
-							hemi = 'N';
-						degrees = (int) navlat;
-						minutes = 60.0*(navlat - degrees);
-						if (ascii == MB_YES)
-						    {
-						    printf("%3d %8.5f%c",
-							degrees, minutes, hemi);
-						    }
-						else
-						    {
-						    b = degrees;
-						    if (hemi == 'S') b = -b;
-						    fwrite(&b, sizeof(double), 1, stdout);
-						    b = minutes;
-						    fwrite(&b, sizeof(double), 1, stdout);
-						    }
-						break;
-					case 'Z': /* sonar depth (m) */
-						if (traceheader.elev_scalar < 0)
-							factor = 1.0 / ((float) (-traceheader.elev_scalar));
-						else
-							factor = (float) traceheader.elev_scalar;
-						if (traceheader.grp_elev != 0)
-							sonardepth = -factor * traceheader.grp_elev;
-						else if (traceheader.src_elev != 0)
-							sonardepth = -factor * traceheader.src_elev;
-						else if (traceheader.src_depth != 0)
-							sonardepth = factor * traceheader.src_depth;
-						else
-							sonardepth = 0.0;
-						printsimplevalue(verbose, sonardepth, 11, 6, ascii,
-								    &invert_next_value,
-								    &signflip_next_value, &error);
-						break;
-					case 'z': /* water depth (m) */
-						if (traceheader.elev_scalar < 0)
-							factor = 1.0 / ((float) (-traceheader.elev_scalar));
-						else
-							factor = (float) traceheader.elev_scalar;
-						if (traceheader.src_wbd != 0)
-							waterdepth = -factor * traceheader.src_wbd;
-						else if (traceheader.grp_wbd != 0)
-							waterdepth = -factor * traceheader.grp_wbd;
-						else
-							waterdepth = 0.0;
-						printsimplevalue(verbose, waterdepth, 11, 6, ascii,
-								    &invert_next_value,
-								    &signflip_next_value, &error);
-						break;
-					default:
-						if (ascii == MB_YES)
-						    printf("<Invalid Option: %c>",
-							list[i]);
-						break;
-					}
-				if (ascii == MB_YES)
-				    {
-				    if (i<(n_list-1)) printf ("%s",delimiter);
-				    else printf ("\n");
-				    }
-				}
-
-			}
-
-		/* reset first flag */
-		if (error == MB_ERROR_NO_ERROR && first == MB_YES)
-			{
-			first = MB_NO;
-			}
-
-		/* save old values */
-		if (error == MB_ERROR_NO_ERROR)
-			{
-			time_d_old = time_d;
-			}
-		}
-
-	/* close the swath file */
-	status = mb_segy_close(verbose,&mbsegyioptr,&error);
-
-	/* check memory */
-	if (verbose >= 4)
-		status = mb_memory_list(verbose,&error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  Program <%s> completed\n",
-			program_name);
-		fprintf(stderr,"dbg2  Ending status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* end it all */
-	exit(error);
-}
-/*--------------------------------------------------------------------*/
-int printsimplevalue(int verbose,
-	double value, int width, int precision,
-	int ascii, int *invert, int *flipsign, int *error)
-{
-	char	*function_name = "printsimplevalue";
-	int	status = MB_SUCCESS;
-	char	format[24];
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBlist function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:         %d\n",verbose);
-		fprintf(stderr,"dbg2       value:           %f\n",value);
-		fprintf(stderr,"dbg2       width:           %d\n",width);
-		fprintf(stderr,"dbg2       precision:       %d\n",precision);
-		fprintf(stderr,"dbg2       ascii:           %d\n",ascii);
-		fprintf(stderr,"dbg2       invert:          %d\n",*invert);
-		fprintf(stderr,"dbg2       flipsign:        %d\n",*flipsign);
-		}
-
-	/* make print format */
-	format[0] = '%';
-	if (*invert == MB_YES)
-	    strcpy(format, "%g");
-	else if (width > 0)
-	    sprintf(&format[1], "%d.%df", width, precision);
-	else
-	    sprintf(&format[1], ".%df", precision);
-
-	/* invert value if desired */
-	if (*invert == MB_YES)
-	    {
-	    *invert = MB_NO;
-	    if (value != 0.0)
-		value = 1.0 / value;
-	    }
-
-	/* flip sign value if desired */
-	if (*flipsign == MB_YES)
-	    {
-	    *flipsign = MB_NO;
-	    value = -value;
-	    }
-
-	/* print value */
-	if (ascii == MB_YES)
-	    printf(format, value);
-	else
-	    fwrite(&value, sizeof(double), 1, stdout);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBlist function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       invert:          %d\n",*invert);
-		fprintf(stderr,"dbg2       error:           %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:          %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
-int printNaN(int verbose, int ascii, int *invert, int *flipsign, int *error)
-{
-	char	*function_name = "printNaN";
-	int	status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBlist function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:         %d\n",verbose);
-		fprintf(stderr,"dbg2       ascii:           %d\n",ascii);
-		fprintf(stderr,"dbg2       invert:          %d\n",*invert);
-		fprintf(stderr,"dbg2       flipsign:        %d\n",*flipsign);
-		}
-
-	/* reset invert flag */
-	if (*invert == MB_YES)
-	    *invert = MB_NO;
-
-	/* reset flipsign flag */
-	if (*flipsign == MB_YES)
-	    *flipsign = MB_NO;
-
-	/* print value */
-	if (ascii == MB_YES)
-	    printf("NaN");
-	else
-	    fwrite(&NaN, sizeof(double), 1, stdout);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBlist function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       invert:          %d\n",*invert);
-		fprintf(stderr,"dbg2       error:           %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:          %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/utilities/mbsegypsd.c b/src/utilities/mbsegypsd.c
deleted file mode 100644
index d456b8a..0000000
--- a/src/utilities/mbsegypsd.c
+++ /dev/null
@@ -1,1000 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbsegypsd.c	11/2/2009
- *    $Id: mbsegypsd.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 2009-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * mbsegypsd calculates the power spectral densisty function of each trace in a
- * segy file, outputting the PSD as a GMT grid file with trace number along
- * the x axis and frequency along the y axis.
- *
- * Author:	D. W. Caress
- * Date:	November 2, 2009
- *
- * $Log: mbsegypsd.c,v $
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <math.h>
-#include <string.h>
-#include <time.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-
-/* FFTW include files */
-#include "fftw3.h"
-
-/* MBIO include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_define.h"
-#include "mb_segy.h"
-#include "mb_aux.h"
-
-/* local options */
-#define MBSEGYPSD_USESHOT		0
-#define MBSEGYPSD_USECMP		1
-#define MBSEGYPSD_WINDOW_OFF		0
-#define MBSEGYPSD_WINDOW_ON		1
-#define MBSEGYPSD_WINDOW_SEAFLOOR	2
-#define MBSEGYPSD_WINDOW_DEPTH		3
-
-/* NaN value */
-float	NaN;
-
-int get_segy_limits(int verbose,
-		char	*segyfile,
-		int	*tracemode,
-		int	*tracestart,
-		int	*traceend,
-		int	*chanstart,
-		int	*chanend,
-		double	*timesweep,
-		double	*timedelay,
-		int *error);
-char	*ctime();
-char	*getenv();
-
-/* output stream for basic stuff (stdout if verbose <= 1,
-	stderr if verbose > 1) */
-FILE	*outfp;
-
-static char rcs_id[] = "$Id: mbsegypsd.c 2227 2015-02-05 21:12:31Z caress $";
-char program_name[] = "mbsegypsd";
-char help_message[] =  "mbsegypsd calculates the power spectral density function of each trace in a segy data file, \noutputting the results as a GMT grid file.";
-char usage_message[] = "mbsegypsd -Ifile -Oroot [-Ashotscale \n\
-          -Ddecimatex -R \n\
-          -Smode[/start/end[/schan/echan]] -Tsweep[/delay] \n\
-          -Wmode/start/end -H -V]";
-
-/*--------------------------------------------------------------------*/
-
-int main (int argc, char **argv)
-{
-	extern char *optarg;
-	int	errflg = 0;
-	int	c;
-	int	help = 0;
-	int	flag = 0;
-
-	/* MBIO status variables */
-	int	status = MB_SUCCESS;
-	int	verbose = 0;
-	int	error = MB_ERROR_NO_ERROR;
-	char	*message;
-
-	/* segy data */
-	char	segyfile[MB_PATH_MAXLINE];
-	void	*mbsegyioptr;
-	struct mb_segyasciiheader_struct asciiheader;
-	struct mb_segyfileheader_struct fileheader;
-	struct mb_segytraceheader_struct traceheader;
-	float	*trace = NULL;
-	float	*worktrace = NULL;
-	double	*spsd = NULL;
-	double	*wpsd = NULL;
-	double	*spsdtot = NULL;
-	double	*wpsdtot = NULL;
-
-	/* fft controls */
-	int		nfft = 1024;
-	fftw_plan 	plan;
-	fftw_complex	*fftw_in = NULL;
-	fftw_complex	*fftw_out = NULL;
-	int		nsection;
-
-	/* grid controls */
-	char	fileroot[MB_PATH_MAXLINE];
-	char	gridfile[MB_PATH_MAXLINE];
-	char	psdfile[MB_PATH_MAXLINE];
-	int	decimatex = 1;
-	int	tracemode = MBSEGYPSD_USESHOT;
-	int	tracestart = 0;
-	int	traceend = 0;
-	int	chanstart = 0;
-	int	chanend = -1;
-	double	timesweep = 0.0;
-	double	timedelay = 0.0;
-	double	sampleinterval = 0.0;
-	int	windowmode = MBSEGYPSD_WINDOW_OFF;
-	double	windowstart, windowend;
-	int	ntraces;
-	int	ngridx = 0;
-	int	ngridy = 0;
-	int	ngridxy = 0;
-	float	*grid = NULL;
-	double	xmin;
-	double	xmax;
-	double	ymin;
-	double	ymax;
-	double	dx;
-	double	dy;
-	double	gridmintot = 0.0;
-	double	gridmaxtot = 0.0;
-	char	projection[MB_PATH_MAXLINE];
-	char	xlabel[MB_PATH_MAXLINE];
-	char	ylabel[MB_PATH_MAXLINE];
-	char	zlabel[MB_PATH_MAXLINE];
-	char	title[MB_PATH_MAXLINE];
-	char	plot_cmd[MB_PATH_MAXLINE];
-	int	scale2distance = MB_NO;
-	double	shotscale = 1.0;
-	double	frequencyscale = 1.0;
-	int	logscale = MB_NO;
-
-	int	sinftracemode = MBSEGYPSD_USESHOT;
-	int	sinftracestart = 0;
-	int	sinftraceend = 0;
-	int	sinfchanstart = 0;
-	int	sinfchanend = -1;
-	double	sinftimesweep = 0.0;
-	double	sinftimedelay = 0.0;
-
-	double	soundpressurelevel;
-
-	double	sint, taper;
-	double	norm, normraw, normtaper, normfft;
-
-	FILE	*fp;
-	int	nread;
-	int	tracecount, tracenum, channum, traceok;
-	double	tracemin, tracemax;
-	double	xwidth, ywidth;
-	int	ix, iy, iys;
-	int	itstart, itend;
-	double	factor, btime, stime, dtime;
-	double	btimesave = 0.0;
-	double	stimesave = 0.0;
-	double	dtimesave = 0.0;
-	int	plot_status;
-	int	kstart, kend;
-	int	i, j, k, n;
-
-	/* set file to null */
-	segyfile[0] = '\0';
-
-	/* get NaN value */
-	MB_MAKE_FNAN(NaN);
-
-	/* process argument list */
-	while ((c = getopt(argc, argv, "A:a:D:d:I:i:LlN:n:O:o:PpS:s:T:t:VvW:w:Hh")) != -1)
-	  switch (c)
-		{
-		case 'H':
-		case 'h':
-			help++;
-			break;
-		case 'V':
-		case 'v':
-			verbose++;
-			break;
-		case 'A':
-		case 'a':
-			n = sscanf (optarg,"%lf/%lf", &shotscale, &frequencyscale);
-			if (n == 2)
-				scale2distance = MB_YES;
-			flag++;
-			break;
-		case 'D':
-		case 'd':
-			n = sscanf (optarg,"%d", &decimatex);
-			flag++;
-			break;
-		case 'I':
-		case 'i':
-			sscanf (optarg,"%s", segyfile);
-			flag++;
-			break;
-		case 'L':
-		case 'l':
-			logscale = MB_YES;
-			flag++;
-			break;
-		case 'N':
-		case 'n':
-			n = sscanf (optarg,"%d", &nfft);
-			flag++;
-			break;
-		case 'G':
-		case 'O':
-		case 'o':
-			sscanf (optarg,"%s", fileroot);
-			flag++;
-			break;
-		case 'S':
-		case 's':
-			n = sscanf (optarg,"%d/%d/%d/%d/%d", &tracemode, &tracestart, &traceend, &chanstart, &chanend);
-			if (n < 5)
-				{
-				chanstart = 0;
-				chanend = -1;
-				}
-			if (n < 3)
-				{
-				tracestart = 0;
-				traceend = 0;
-				}
-			if (n < 1)
-				{
-				tracemode = MBSEGYPSD_USESHOT;
-				}
-			flag++;
-			break;
-		case 'T':
-		case 't':
-			n = sscanf (optarg,"%lf/%lf", &timesweep, &timedelay);
-			if (n < 2)
-				timedelay = 0.0;
-			flag++;
-			break;
-		case 'W':
-		case 'w':
-			n = sscanf (optarg,"%d/%lf/%lf", &windowmode, &windowstart, &windowend);
-			flag++;
-			break;
-		case '?':
-			errflg++;
-		}
-
-	/* set output stream to stdout or stderr */
-	if (verbose >= 2)
-	    outfp = stderr;
-	else
-	    outfp = stdout;
-
-	/* if error flagged then print it and exit */
-	if (errflg)
-		{
-		fprintf(outfp,"usage: %s\n", usage_message);
-		fprintf(outfp,"\nProgram <%s> Terminated\n",
-			program_name);
-		error = MB_ERROR_BAD_USAGE;
-		exit(error);
-		}
-
-	/* print starting message */
-	if (verbose == 1 || help)
-		{
-		fprintf(outfp,"\nProgram %s\n",program_name);
-		fprintf(outfp,"Version %s\n",rcs_id);
-		fprintf(outfp,"MB-system Version %s\n",MB_VERSION);
-		}
-
-	/* print starting debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(outfp,"\ndbg2  Program <%s>\n",program_name);
-		fprintf(outfp,"dbg2  Version %s\n",rcs_id);
-		fprintf(outfp,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(outfp,"dbg2  Control Parameters:\n");
-		fprintf(outfp,"dbg2       verbose:        %d\n",verbose);
-		fprintf(outfp,"dbg2       help:           %d\n",help);
-		fprintf(outfp,"dbg2       segyfile:       %s\n",segyfile);
-		fprintf(outfp,"dbg2       fileroot:       %s\n",fileroot);
-		fprintf(outfp,"dbg2       nfft:           %d\n",nfft);
-		fprintf(outfp,"dbg2       decimatex:      %d\n",decimatex);
-		fprintf(outfp,"dbg2       tracemode:      %d\n",tracemode);
-		fprintf(outfp,"dbg2       tracestart:     %d\n",tracestart);
-		fprintf(outfp,"dbg2       traceend:       %d\n",traceend);
-		fprintf(outfp,"dbg2       chanstart:      %d\n",chanstart);
-		fprintf(outfp,"dbg2       chanend:        %d\n",chanend);
-		fprintf(outfp,"dbg2       timesweep:      %f\n",timesweep);
-		fprintf(outfp,"dbg2       timedelay:      %f\n",timedelay);
-		fprintf(outfp,"dbg2       ngridx:         %d\n",ngridx);
-		fprintf(outfp,"dbg2       ngridy:         %d\n",ngridy);
-		fprintf(outfp,"dbg2       ngridxy:        %d\n",ngridxy);
-		fprintf(outfp,"dbg2       windowmode:     %d\n",windowmode);
-		fprintf(outfp,"dbg2       windowstart:    %f\n",windowstart);
-		fprintf(outfp,"dbg2       windowend:      %f\n",windowend);
-		fprintf(outfp,"dbg2       scale2distance: %d\n",scale2distance);
-		fprintf(outfp,"dbg2       shotscale:      %f\n",shotscale);
-		fprintf(outfp,"dbg2       frequencyscale: %f\n",frequencyscale);
-		fprintf(outfp,"dbg2       logscale:       %d\n",logscale);
-		}
-
-	/* if help desired then print it and exit */
-	if (help)
-		{
-		fprintf(outfp,"\n%s\n",help_message);
-		fprintf(outfp,"\nusage: %s\n", usage_message);
-		exit(error);
-		}
-
-	/* get segy limits if required */
-	if (traceend < 1 || traceend < tracestart || timesweep <= 0.0)
-		{
-		get_segy_limits(verbose,
-				segyfile,
-				&sinftracemode,
-				&sinftracestart,
-				&sinftraceend,
-				&sinfchanstart,
-				&sinfchanend,
-				&sinftimesweep,
-				&sinftimedelay,
-				&error);
-		if (traceend < 1 || traceend < tracestart)
-			{
-			tracemode = sinftracemode;
-			tracestart = sinftracestart;
-			traceend = sinftraceend;
-			}
-		if (chanend < 1 || chanend < chanstart)
-			{
-			chanstart = sinfchanstart;
-			chanend = sinfchanend;
-			}
-		if (timesweep <= 0.0)
-			{
-			timesweep = sinftimesweep;
-			timedelay = sinftimedelay;
-			}
-		}
-
-	/* check specified parameters */
-	if (traceend < 1 || traceend < tracestart)
-		{
-		fprintf(outfp,"\nBad trace numbers: %d %d specified...\n", tracestart, traceend);
-		fprintf(outfp,"\nProgram <%s> Terminated\n", program_name);
-		exit(error);
-		}
-	if (timesweep <= 0.0)
-		{
-		fprintf(outfp,"\nBad time sweep: %f specified...\n", timesweep);
-		fprintf(outfp,"\nProgram <%s> Terminated\n", program_name);
-		exit(error);
-		}
-
-	/* initialize reading the segy file */
-	if (mb_segy_read_init(verbose, segyfile,
-		&mbsegyioptr, &asciiheader, &fileheader, &error) != MB_SUCCESS)
-		{
-		mb_error(verbose,error,&message);
-		fprintf(outfp,"\nMBIO Error returned from function <mb_segy_read_init>:\n%s\n",message);
-		fprintf(outfp,"\nSEGY File <%s> not initialized for reading\n",segyfile);
-		fprintf(outfp,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-
-	/* calculate implied grid parameters */
-	strcpy(gridfile,fileroot);
-	strcat(gridfile,".grd");
-	strcpy(psdfile,fileroot);
-	strcat(psdfile,"_psd.txt");
-	if (chanend >= chanstart)
-		ntraces = (traceend - tracestart + 1) * (chanend - chanstart + 1);
-	else
-		ntraces = traceend - tracestart + 1;
-	ngridx = ntraces / decimatex;
-	sampleinterval = 0.000001 * (double) (fileheader.sample_interval);
-	ngridy = nfft / 2 + 1;
-	ngridxy = ngridx * ngridy;
-	dx = decimatex;
-	xmin = (double) tracestart - 0.5;
-	xmax = (double) traceend + 0.5;
-	dy = 1.0 / (2.0 * sampleinterval * ngridy);
-	ymin = -0.5 * dy;
-	ymax = (ngridy - 0.5) * dy;
-
-	/* get start and end samples */
-	if (windowmode == MBSEGYPSD_WINDOW_OFF)
-		{
-		itstart = 0;
-		itend = ngridy - 1;
-		}
-	else if (windowmode == MBSEGYPSD_WINDOW_ON)
-		{
-		itstart = MAX((windowstart) / sampleinterval, 0);
-		itend = MIN((windowend) / sampleinterval, ngridy - 1);
-		}
-
-	/* allocate memory for grid array */
-	status = mb_mallocd(verbose,__FILE__,__LINE__, 2 * ngridxy * sizeof(float), (void **)&grid, &error);
-	status = mb_mallocd(verbose,__FILE__,__LINE__, ngridy * sizeof(double), (void **)&spsd, &error);
-	status = mb_mallocd(verbose,__FILE__,__LINE__, ngridy * sizeof(double), (void **)&wpsd, &error);
-	status = mb_mallocd(verbose,__FILE__,__LINE__, ngridy * sizeof(double), (void **)&spsdtot, &error);
-	status = mb_mallocd(verbose,__FILE__,__LINE__, ngridy * sizeof(double), (void **)&wpsdtot, &error);
-
-	/* zero working psd array */
-	for (iy=0;iy<ngridy;iy++)
-		{
-		spsdtot[iy] = 0.0;
-		wpsdtot[iy] = 0.0;
-		}
-
-	/* output info */
-	if (verbose >= 0)
-		{
-		fprintf(outfp,"\nMBsegypsd Parameters:\n");
-		fprintf(outfp,"Input segy file:         %s\n",segyfile);
-		fprintf(outfp,"Output fileroot:         %s\n",fileroot);
-		fprintf(outfp,"Input Parameters:\n");
-		fprintf(outfp,"     trace mode:         %d\n",tracemode);
-		fprintf(outfp,"     trace start:        %d\n",tracestart);
-		fprintf(outfp,"     trace end:          %d\n",traceend);
-		fprintf(outfp,"     channel start:      %d\n",chanstart);
-		fprintf(outfp,"     channel end:        %d\n",chanend);
-		fprintf(outfp,"     trace decimation:   %d\n",decimatex);
-		fprintf(outfp,"     time sweep:         %f seconds\n",timesweep);
-		fprintf(outfp,"     time delay:         %f seconds\n",timedelay);
-		fprintf(outfp,"     sample interval:    %f seconds\n",sampleinterval);
-		fprintf(outfp,"     window mode:        %d\n",windowmode);
-		fprintf(outfp,"     window start:       %f seconds\n",windowstart);
-		fprintf(outfp,"     window end:         %f seconds\n",windowend);
-		fprintf(outfp,"Output Parameters:\n");
-		fprintf(outfp,"     grid filename:      %s\n",gridfile);
-		fprintf(outfp,"     psd filename:       %s\n",psdfile);
-		fprintf(outfp,"     x grid dimension:   %d\n",ngridx);
-		fprintf(outfp,"     y grid dimension:   %d\n",ngridy);
-		fprintf(outfp,"     grid xmin:          %f\n",xmin);
-		fprintf(outfp,"     grid xmax:          %f\n",xmax);
-		fprintf(outfp,"     grid ymin:          %f\n",ymin);
-		fprintf(outfp,"     grid ymax:          %f\n",ymax);
-		fprintf(outfp,"     NaN values used to flag regions with no data\n");
-		fprintf(outfp,"     shotscale:          %f\n",shotscale);
-		fprintf(outfp,"     frequencyscale:     %f\n",frequencyscale);
-		if (scale2distance == MB_YES)
-			{
-			fprintf(outfp,"     trace numbers scaled to distance in meters\n");
-			fprintf(outfp,"     scaled grid xmin    %f\n",0.0);
-			fprintf(outfp,"     scaled grid xmax:   %f\n",shotscale * (xmax - xmin));
-			}
-		}
-	if (verbose > 0)
-		fprintf(outfp,"\n");
-
-	/* proceed if all ok */
-	if (status == MB_SUCCESS)
-		{
-
-		/* fill grid with NaNs */
-		for (i=0;i<ngridxy;i++)
-			grid[i] = NaN;
-
-		/* generate the fftw plan */
-		fftw_in = (fftw_complex *) fftw_malloc(sizeof(fftw_complex) * nfft);
-		fftw_out = (fftw_complex *) fftw_malloc(sizeof(fftw_complex) * nfft);
-		plan = fftw_plan_dft_1d(nfft, fftw_in, fftw_out, FFTW_FORWARD, FFTW_MEASURE);
-
-		/* read and print data */
-		nread = 0;
-		while (error <= MB_ERROR_NO_ERROR)
-			{
-			/* reset error */
-			error = MB_ERROR_NO_ERROR;
-
-			/* read a trace */
-			status = mb_segy_read_trace(verbose, mbsegyioptr,
-					&traceheader, &trace, &error);
-
-			/* now process the trace */
-			if (status == MB_SUCCESS)
-				{
-				/* figure out where this trace is in the grid */
-				if (tracemode == MBSEGYPSD_USESHOT)
-					{
-					tracenum = traceheader.shot_num;
-					channum = traceheader.shot_tr;
-					}
-				else
-					{
-					tracenum = traceheader.rp_num;
-					channum = traceheader.rp_tr;
-					}
-				if (chanend >= chanstart)
-					{
-					tracecount = (tracenum - tracestart) * (chanend - chanstart + 1)
-							+ (channum - chanstart);
-					}
-				else
-					{
-					tracecount = tracenum - tracestart;
-					}
-				ix = tracecount / decimatex;
-				if (traceheader.elev_scalar < 0)
-					factor = 1.0 / ((float) (-traceheader.elev_scalar));
-				else
-					factor = (float) traceheader.elev_scalar;
-				if (traceheader.src_depth > 0)
-					{
-					btime = factor * traceheader.src_depth / 750.0 + 0.001 * traceheader.delay_mils;
-					dtime = factor * traceheader.src_depth / 750.0;
-					btimesave = btime;
-					dtimesave = dtime;
-					}
-				else if (traceheader.src_elev > 0)
-					{
-					btime = -factor * traceheader.src_elev / 750.0 + 0.001 * traceheader.delay_mils;
-					dtime = -factor * traceheader.src_elev / 750.0;
-					btimesave = btime;
-					dtimesave = dtime;
-					}
-				else
-					{
-					btime = btimesave;
-					dtime = dtimesave;
-					}
-				if (traceheader.src_wbd > 0)
-					{
-					stime = factor * traceheader.src_wbd / 750.0;
-					stimesave = stime;
-					}
-				else
-					{
-					stime = stimesave;
-					}
-				iys = (btime - timedelay) / sampleinterval;
-
-				/* now check if this is a trace of interest */
-				traceok = MB_YES;
-				if (tracenum < tracestart
-					|| tracenum > traceend)
-					traceok = MB_NO;
-				else if (chanend >= chanstart
-						&& (channum < chanstart
-							|| channum > chanend))
-					traceok = MB_NO;
-				else if (tracecount % decimatex != 0)
-					traceok = MB_NO;
-
-				/* get trace min and max */
-				tracemin = trace[0];
-				tracemax = trace[0];
-				for (i=0;i<traceheader.nsamps;i++)
-					{
-					tracemin = MIN(tracemin, trace[i]);
-					tracemax = MAX(tracemin, trace[i]);
-					}
-
-				if ((verbose == 0 && nread % 250 == 0) || (nread % 25 == 0))
-					{
-					if (traceok == MB_YES)
-						fprintf(outfp,"PROCESS ");
-					else
-						fprintf(outfp,"IGNORE  ");
-					if (tracemode == MBSEGYPSD_USESHOT)
-						fprintf(outfp,"read:%d position:%d shot:%d channel:%d ",
-							nread,tracecount,tracenum,channum);
-					else
-						fprintf(outfp,"read:%d position:%d rp:%d channel:%d ",
-							nread,tracecount,tracenum,channum);
-					fprintf(outfp,"%4.4d/%3.3d %2.2d:%2.2d:%2.2d.%3.3d samples:%d interval:%d usec minmax: %f %f\n",
-					traceheader.year,traceheader.day_of_yr,
-					traceheader.hour,traceheader.min,traceheader.sec,traceheader.mils,
-					traceheader.nsamps,traceheader.si_micros,
-					tracemin, tracemax);
-					}
-
-				/* now actually process traces of interest */
-				if (traceok == MB_YES)
-					{
-					/* zero working psd array */
-					for (iy=0;iy<ngridy;iy++)
-						{
-						spsd[iy] = 0.0;
-						wpsd[iy] = 0.0;
-						}
-
-					/* get bounds of trace in depth window mode */
-					if (windowmode == MBSEGYPSD_WINDOW_DEPTH)
-						{
-						itstart = (int)((dtime + windowstart - timedelay) / sampleinterval);
-						itstart = MAX(itstart, 0);
-						itend = (int)((dtime + windowend - timedelay) / sampleinterval);
-						itend = MIN(itend, ngridy - 1);
-						}
-					else if (windowmode == MBSEGYPSD_WINDOW_SEAFLOOR)
-						{
-						itstart = MAX((stime + windowstart - timedelay) / sampleinterval, 0);
-						itend = MIN((stime + windowend - timedelay) / sampleinterval, ngridy - 1);
-						}
-
-					/* loop over the data calculating fft in nfft long sections */
-					nsection = (itend - itstart + 1) / nfft;
-					if (((itend - itstart + 1) % nfft) > 0)
-						nsection++;
-					for (j=0;j<nsection;j++)
-						{
-						/* initialize normalization factors */
-						normraw = 0.0;
-						normtaper = 0.0;
-						normfft = 0.0;
-
-						/* extract data section to be fft'd with taper */
-						kstart = itstart + j * nfft;
-						kend = MIN(kstart + nfft, itend);
-						for (i=0;i<nfft;i++)
-							{
-							k = itstart + j * nfft + i;
-							if (k <= kend)
-								{
-								sint = sin(M_PI * ((double)(k - kstart)) / ((double)(kend - kstart)));
-								taper = sint * sint;
-								fftw_in[i][0] = taper * trace[k];
-								normraw += trace[k] * trace[k];
-								normtaper += fftw_in[i][0] * fftw_in[i][0];
-								}
-							else
-								fftw_in[i][0] = 0.0;
-/*if (ix < 500)
-fftw_in[i][0] = sin(2.0 * M_PI * 1000.0 * i * sampleinterval)
-			+ sin(2.0 * M_PI * 3000.0 * i * sampleinterval)
-			+ sin(2.0 * M_PI * 6000.0 * i * sampleinterval);*/
-							fftw_in[i][1] = 0.0;
-							}
-						soundpressurelevel = 20.0 * log10(normraw / nfft);
-/*fprintf(stderr,"Sound Pressure Level: %f dB re 1 uPa\n",soundpressurelevel);*/
-
-						/* execute the fft */
-						fftw_execute(plan);
-
-						/* get normalization factor - require variance of transform to equal variance of input */
-						for (i=1;i<nfft;i++)
-							{
-							normfft += fftw_out[i][0] * fftw_out[i][0] + fftw_out[i][1] * fftw_out[i][1];
-							}
-						norm = normraw / normfft;
-
-						/* apply normalization factor */
-						for (i=1;i<nfft;i++)
-							{
-							fftw_out[i][0] = norm * fftw_out[i][0];
-							fftw_out[i][1] = norm * fftw_out[i][1];
-							}
-
-						/* calculate psd from result of transform */
-						spsd[0] += fftw_out[0][0] * fftw_out[0][0] + fftw_out[0][1] * fftw_out[0][1];
-						wpsd[0] += 1.0;
-/* fprintf(stderr,"FFT result: i:%d  %f %f  %f\n",
-0,fftw_out[0][0],fftw_out[0][1],fftw_out[0][0] * fftw_out[0][0] + fftw_out[0][1] * fftw_out[0][1]);*/
-						for (i=1;i<nfft/2;i++)
-							{
-							spsd[i] += 2.0 * (fftw_out[i][0] * fftw_out[i][0] + fftw_out[i][1] * fftw_out[i][1]);
-							wpsd[i] += 1.0;
-/* fprintf(stderr,"FFT result: i:%d  %f %f  %f\n",
-i,fftw_out[i][0],fftw_out[i][1],2.0 * fftw_out[i][0] * fftw_out[i][0] + fftw_out[i][1] * fftw_out[i][1]);*/
-							}
-						if (nfft % 2 == 0)
-							{
-							spsd[i] += fftw_out[nfft/2][0] * fftw_out[nfft/2][0] + fftw_out[nfft/2][1] * fftw_out[nfft/2][1];
-							wpsd[i] += 1.0;
-/* fprintf(stderr,"FFT result: i:%d  %f %f  %f\n",
-nfft/2,fftw_out[nfft/2][0],fftw_out[nfft/2][1],fftw_out[nfft/2][0] * fftw_out[nfft/2][0] + fftw_out[nfft/2][1] * fftw_out[nfft/2][1]); */
-							}
-						}
-
-					/* output psd for this trace to the grid */
-/*fprintf(stderr,"N:%d Normalization: %f %f %f    ratios: %f %f     %f %f\n",
-nfft,normraw,normtaper,normfft,normraw/normfft,normfft/normraw,normtaper/normfft,normfft/normtaper);*/
-					for (iy=0;iy<ngridy;iy++)
-						{
-						k = (ngridy - 1 - iy) * ngridx + ix;
-						if (wpsd[iy] > 0.0)
-							{
-							if (logscale == MB_NO)
-								grid[k] = spsd[iy] / wpsd[iy];
-							else
-								grid[k] = 20.0 * log10(spsd[iy] / wpsd[iy]);
-							spsdtot[iy] += grid[k];
-							wpsdtot[iy] += 1.0;
-/*fprintf(stderr,"ix:%d iy:%d k:%d spsd:%f wpsd:%f     f:%f p:%f\n",
-ix,iy,k,spsd[iy],wpsd[iy],ymax * iy / ngridy,grid[k]);*/
-							gridmintot = MIN(grid[k], gridmintot);
-							gridmaxtot = MAX(grid[k], gridmaxtot);
-							}
-						}
-					}
-				}
-
-			/* now process the trace */
-			if (status == MB_SUCCESS)
-				nread++;
-			}
-
-		/* deallocate fftw arrays and plan */
-		fftw_destroy_plan(plan);
-		fftw_free(fftw_in);
-		fftw_free(fftw_out);
-		}
-
-	/* write out the grid */
-	error = MB_ERROR_NO_ERROR;
-	status = MB_SUCCESS;
-	strcpy(projection, "GenericLinear");
-	if (scale2distance == MB_YES)
-		{
-		strcpy(xlabel, "Distance (m)");
-		strcpy(ylabel, "Frequency (Hz)");
-		xmax *= shotscale;
-		xmin *= shotscale;
-		dx *= shotscale;
-		}
-	else
-		{
-		strcpy(xlabel, "Trace Number");
-		strcpy(ylabel, "Frequency (Hz)");
-		dx = (double) decimatex;
-		}
-	if (logscale == MB_YES)
-		strcpy(zlabel, "dB/Hz");
-	else
-		strcpy(zlabel, "Intensity/Hz");
-	sprintf(title, "Power Spectral Density Grid from %s", segyfile);
-	status = mb_write_gmt_grd(verbose, gridfile, grid,
-				NaN, 
-				ngridx, ngridy,
-				xmin, xmax, ymin, ymax,
-				gridmintot, gridmaxtot, dx, dy,
-				xlabel, ylabel, zlabel, title,
-				projection, argc, argv, &error);
-
-	/* output average power spectra */
-	if ((fp = fopen(psdfile, "w")) != NULL)
-		{
-		for (iy=0;iy<ngridy;iy++)
-			{
-			if (wpsdtot[iy] > 0.0)
-				{
-				spsdtot[iy] = spsdtot[iy] / wpsdtot[iy];
-				}
-			fprintf(fp, "%f %f\n", dy * iy, spsdtot[iy]);
-			}
-		fclose(fp);
-		}
-
-	/* close the segy file */
-	status = mb_segy_close(verbose,&mbsegyioptr,&error);
-
-	/* deallocate memory for grid array */
-	if (worktrace != NULL)
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&worktrace, &error);
-	status = mb_freed(verbose,__FILE__,__LINE__,(void **)&grid, &error);
-	status = mb_freed(verbose,__FILE__,__LINE__,(void **)&spsd, &error);
-	status = mb_freed(verbose,__FILE__,__LINE__,(void **)&wpsd, &error);
-	status = mb_freed(verbose,__FILE__,__LINE__,(void **)&spsdtot, &error);
-	status = mb_freed(verbose,__FILE__,__LINE__,(void **)&wpsdtot, &error);
-
-	/* run mbm_grdplot */
-	xwidth = MIN(0.01 * (double) ngridx, 55.0);
-	ywidth = MIN(0.01 * (double) ngridy, 28.0);
-	sprintf(plot_cmd, "mbm_grdplot -I%s -JX%f/%f -G1 -S -V -L\"File %s - %s:%s\"",
-			gridfile, xwidth, ywidth, gridfile, title, zlabel);
-	if (verbose)
-		{
-		fprintf(outfp, "\nexecuting mbm_grdplot...\n%s\n",
-			plot_cmd);
-		}
-	plot_status = system(plot_cmd);
-	if (plot_status == -1)
-		{
-		fprintf(outfp, "\nError executing mbm_grdplot on grid file %s\n", gridfile);
-		}
-
-	/* run mbm_xyplot */
-	xwidth = 9.0;
-	ywidth = 7.0;
-	sprintf(plot_cmd, "mbm_xyplot -I%s -JX%f/%f -V -L\"File %s - %s:%s\"",
-			psdfile, xwidth, ywidth, psdfile, title, zlabel);
-	if (verbose)
-		{
-		fprintf(outfp, "\nexecuting mbm_xyplot...\n%s\n",
-			plot_cmd);
-		}
-	plot_status = system(plot_cmd);
-	if (plot_status == -1)
-		{
-		fprintf(outfp, "\nError executing mbm_xyplot on psd file %s\n", psdfile);
-		}
-
-	/* check memory */
-	if (verbose >= 4)
-		status = mb_memory_list(verbose,&error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(outfp,"\ndbg2  Program <%s> completed\n",
-			program_name);
-		fprintf(outfp,"dbg2  Ending status:\n");
-		fprintf(outfp,"dbg2       status:  %d\n",status);
-		}
-
-	/* end it all */
-	exit(error);
-}
-/*--------------------------------------------------------------------*/
-/*
- * function get_segy_limits gets info for default segy gridding
- */
-int get_segy_limits(int verbose,
-		char	*segyfile,
-		int	*tracemode,
-		int	*tracestart,
-		int	*traceend,
-		int	*chanstart,
-		int	*chanend,
-		double	*timesweep,
-		double	*timedelay,
-		int *error)
-{
-	char	*function_name = "get_segy_limits";
-	int	status = MB_SUCCESS;
-	char	sinffile[MB_PATH_MAXLINE];
-	char	command[MB_PATH_MAXLINE];
-	char	line[MB_PATH_MAXLINE];
-	FILE	*sfp;
-	int	datmodtime = 0;
-	int	sinfmodtime = 0;
-	struct stat file_status;
-	int	fstat;
-	double	delay0 = 0.0;
-	double	delay1 = 0.0;
-	double	delaydel = 0.0;
-	int	shot0 = 0;
-	int	shot1 = 0;
-	int	shotdel = 0;
-	int	shottrace0 = 0;
-	int	shottrace1 = 0;
-	int	shottracedel = 0;
-	int	rp0 = 0;
-	int	rp1 = 0;
-	int	rpdel = 0;
-	int	rptrace0 = 0;
-	int	rptrace1 = 0;
-	int	rptracedel = 0;
-	int	nscan;
-	int	shellstatus;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(outfp,"\ndbg2  Function <%s> called\n",
-			function_name);
-		fprintf(outfp,"dbg2  Input arguments:\n");
-		fprintf(outfp,"dbg2       verbose:    %d\n",verbose);
-		fprintf(outfp,"dbg2       segyfile:   %s\n",segyfile);
-		}
-
-	/* set sinf filename */
-	sprintf(sinffile, "%s.sinf", segyfile);
-
-	/* check status of segy and sinf file */
-	datmodtime = 0;
-	sinfmodtime = 0;
-	if ((fstat = stat(segyfile, &file_status)) == 0
-		&& (file_status.st_mode & S_IFMT) != S_IFDIR)
-		{
-		datmodtime = file_status.st_mtime;
-		}
-	if ((fstat = stat(sinffile, &file_status)) == 0
-		&& (file_status.st_mode & S_IFMT) != S_IFDIR)
-		{
-		sinfmodtime = file_status.st_mtime;
-		}
-
-	/* if sinf file is missing or out of date, make it */
-	if (datmodtime > 0 && datmodtime > sinfmodtime)
-		{
-		if (verbose >= 1)
-			fprintf(stderr,"\nGenerating sinf file for %s\n",segyfile);
-		sprintf(command, "mbsegyinfo -I %s -O", segyfile);
-		shellstatus = system(command);
-		}
-
-
-	/* read sinf file if possible */
-	sprintf(sinffile, "%s.sinf", segyfile);
-	if ((sfp = fopen(sinffile, "r")) != NULL)
-		{
-		/* read the sinf file */
-		while (fgets(line, MB_PATH_MAXLINE, sfp) != NULL)
-		    {
-		    if (strncmp(line, "  Trace length (sec):", 21) == 0)
-			{
-			nscan = sscanf(line, "  Trace length (sec):%lf", timesweep);
-			}
-		    else if (strncmp(line, "    Delay (sec):", 16) == 0)
-			{
-			nscan = sscanf(line, "    Delay (sec): %lf %lf %lf", &delay0, &delay1, &delaydel);
-			}
-		    else if (strncmp(line, "    Shot number:", 16) == 0)
-			{
-			nscan = sscanf(line, "    Shot number: %d %d %d", &shot0, &shot1, &shotdel);
-			}
-		    else if (strncmp(line, "    Shot trace:", 15) == 0)
-			{
-			nscan = sscanf(line, "    Shot trace: %d %d %d", &shottrace0, &shottrace1, &shottracedel);
-			}
-		    else if (strncmp(line, "    RP number:", 14) == 0)
-			{
-			nscan = sscanf(line, "    RP number: %d %d %d", &rp0, &rp1, &rpdel);
-			}
-		    else if (strncmp(line, "    RP trace:", 13) == 0)
-			{
-			nscan = sscanf(line, "    RP trace: %d %d %d", &rptrace0, &rptrace1, &rptracedel);
-			}
-		    }
-		fclose(sfp);
-		}
-
-	/* set the trace mode */
-	if (rpdel > 1)
-		{
-		*tracemode = MBSEGYPSD_USECMP;
-		*tracestart = rp0;
-		*traceend = rp1;
-		*chanstart = rptrace0;
-		*chanend = rptrace1;
-		}
-	else
-		{
-		*tracemode = MBSEGYPSD_USESHOT;
-		*tracestart = shot0;
-		*traceend = shot1;
-		*chanstart = shottrace0;
-		*chanend = shottrace1;
-		}
-
-	/* set the sweep and delay */
-	if (delaydel > 0.0)
-		{
-		*timesweep += delaydel;
-		}
-	*timedelay = delay0;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(outfp,"\ndbg2  MBIO function <%s> completed\n",
-			function_name);
-		fprintf(outfp,"dbg2  Return values:\n");
-		fprintf(outfp,"dbg2       tracemode:  %d\n",*tracemode);
-		fprintf(outfp,"dbg2       tracestart: %d\n",*tracestart);
-		fprintf(outfp,"dbg2       traceend:   %d\n",*traceend);
-		fprintf(outfp,"dbg2       chanstart:  %d\n",*chanstart);
-		fprintf(outfp,"dbg2       chanend:    %d\n",*chanend);
-		fprintf(outfp,"dbg2       timesweep:  %f\n",*timesweep);
-		fprintf(outfp,"dbg2       timedelay:  %f\n",*timedelay);
-		fprintf(outfp,"dbg2       error:      %d\n",*error);
-		fprintf(outfp,"dbg2  Return status:\n");
-		fprintf(outfp,"dbg2       status:     %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/utilities/mbset.c b/src/utilities/mbset.c
deleted file mode 100644
index 125a440..0000000
--- a/src/utilities/mbset.c
+++ /dev/null
@@ -1,1660 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbset.c	1/4/2000
- *    $Id: mbset.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 2000-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * MBset is a tool for setting values in an mbprocess parameter file.
- * MBprocess is a tool for processing swath sonar bathymetry data
- * which performs a number of functions, including:
- *   - merging navigation
- *   - recalculating bathymetry from travel time and angle data
- *     by raytracing through a layered water sound velocity model.
- *   - applying changes to ship draft, roll bias and pitch bias
- *   - applying bathymetry edits from edit save files.
- * The parameters controlling mbprocess are included in an ascii
- * parameter file. The parameter file syntax is documented by
- * comments in the source file mbsystem/src/mbio/mb_process.h
- * and the manual pages for mbprocess and mbset.
- *
- * Author:	D. W. Caress
- * Date:	January 4, 2000
- *
- * $Log: mbset.c,v $
- * Revision 5.32  2009/03/02 18:54:40  caress
- * Fixed pixel size problems with mbmosaic, resurrected program mbfilter, and also updated copyright dates in several source files.
- *
- * Revision 5.31  2008/09/11 20:20:14  caress
- * Checking in updates made during cruise AT15-36.
- *
- * Revision 5.30  2008/05/24 19:41:44  caress
- * Added processing kluge (kluge006) allowing the sonar draft to be be changed without changing the calculated bathymetry.
- *
- * Revision 5.29  2008/05/13 20:22:07  caress
- * Fixed bug in handling navigation adjustment.
- *
- * Revision 5.28  2007/10/08 16:48:06  caress
- * State of the code on 8 October 2007.
- *
- * Revision 5.27  2006/01/24 22:23:15  caress
- * 5.0.8beta.
- *
- * Revision 5.26  2006/01/18 15:17:00  caress
- * Added stdlib.h include.
- *
- * Revision 5.25  2005/03/25 04:38:13  caress
- * Sonar depth merging has been added to mbprocess and mbset. This is controlled by the SONARDEPTHMODE, SONARDEPTHFILE, and SONARDEPTHFORMAT mbprocess parameters.
- *
- * Revision 5.24  2004/12/02 06:37:42  caress
- * Fixes while supporting Reson 7k data.
- *
- * Revision 5.23  2004/05/21 23:51:19  caress
- * Progress supporting Reson 7k data, including support for extracing subbottom profiler data.
- *
- * Revision 5.22  2003/04/17 21:18:57  caress
- * Release 5.0.beta30
- *
- * Revision 5.21  2003/01/15 20:52:13  caress
- * Release 5.0.beta28
- *
- * Revision 5.20  2002/10/02 23:56:06  caress
- * Release 5.0.beta24
- *
- * Revision 5.19  2002/09/19 00:28:12  caress
- * Release 5.0.beta23
- *
- * Revision 5.18  2002/09/07 04:49:23  caress
- * Added slope mode option to mb_process.
- *
- * Revision 5.17  2002/07/25 19:07:17  caress
- * Release 5.0.beta21
- *
- * Revision 5.16  2002/05/29 23:43:09  caress
- * Release 5.0.beta18
- *
- * Revision 5.15  2002/04/06 02:53:45  caress
- * Release 5.0.beta16
- *
- * Revision 5.14  2001/12/18 04:29:57  caress
- * Release 5.0.beta11.
- *
- * Revision 5.13  2001/11/15  22:58:02  caress
- * Added datalist parsing to mbset, fixed file path handling.
- *
- * Revision 5.12  2001/11/04  00:27:11  caress
- * Fixed handling of angle modes.
- *
- * Revision 5.11  2001/10/19 19:40:32  caress
- * Now uses relative paths.
- *
- * Revision 5.10  2001/10/19  00:56:17  caress
- * Now tries to use relative paths.
- *
- * Revision 5.9  2001/09/17  23:21:14  caress
- * Fixed metadata support.
- *
- * Revision 5.8  2001/08/10  22:42:50  dcaress
- * Release 5.0.beta07
- *
- * Revision 5.7  2001-08-03 18:01:07-07  caress
- * Added cut by speed.
- *
- * Revision 5.6  2001/07/31  00:42:12  caress
- * Added data cutting capability.
- *
- * Revision 5.5  2001/07/20 00:34:38  caress
- * Release 5.0.beta03
- *
- * Revision 5.4  2001/06/11 17:47:38  caress
- * Fixed pitchbias bug.
- *
- * Revision 5.3  2001/06/08  21:45:46  caress
- * Version 5.0.beta01
- *
- * Revision 5.2  2001/06/03  07:07:34  caress
- * Release 5.0.beta01.
- *
- * Revision 5.1  2001/03/22 21:15:49  caress
- * Trying to make release 5.0.beta0.
- *
- * Revision 5.0  2001/01/22  07:55:22  caress
- * Version 5.0.beta01
- *
- * Revision 1.1  2001/01/22  07:54:22  caress
- * Initial revision
- *
- *
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <math.h>
-#include <string.h>
-#include <time.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-
-/* mbio include files */
-#include "mb_format.h"
-#include "mb_status.h"
-#include "mb_define.h"
-#include "mb_process.h"
-#include "mb_swap.h"
-
-static char rcs_id[] = "$Id: mbset.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-
-int main (int argc, char **argv)
-{
-	/* id variables */
-	char program_name[] = "mbset";
-	char help_message[] = "MBset is a tool for setting values in an mbprocess parameter file.\n\
-MBprocess is a tool for processing swath sonar bathymetry data  \n\
-which performs a number of functions, including:\n\
-  - merging navigation\n\
-  - recalculating bathymetry from travel time and angle data\n\
-    by raytracing through a layered water sound velocity model.\n\
-  - applying changes to ship draft, roll bias and pitch bias\n\
-  - applying bathymetry edits from  edit save files.\n\
-The parameters controlling mbprocess are included in an ascii\n\
-parameter file. The parameter file syntax is documented by\n\
-the manual pages for mbprocess and mbset. \n\n";
-	char usage_message[] = "mbset -Iinfile -PPARAMETER:value [-E -L -N -V -H]";
-
-	/* parsing variables */
-	extern char *optarg;
-	int	errflg = 0;
-	int	c;
-	int	help = 0;
-	int	flag = 0;
-	int	pargc = 0;
-	char	**pargv = NULL;
-
-	/* MBIO status variables */
-	int	status = MB_SUCCESS;
-	int	verbose = 0;
-	int	error = MB_ERROR_NO_ERROR;
-
-	/* parameter controls */
-	struct mb_process_struct process;
-
-	/* processing variables */
-	int	explicit = MB_NO;
-	int	read_datalist = MB_NO;
-	int	read_data = MB_NO;
-	char	read_file[MBP_FILENAMESIZE];
-	void	*datalist;
-	int	look_processed = MB_DATALIST_LOOK_NO;
-	double	file_weight;
-	int	lookforfiles = MB_NO;
-	int	removembnavadjust = MB_NO;
-	struct stat file_status;
-	int	fstat;
- 	int	format = 0;
-	char	mbp_ifile[MBP_FILENAMESIZE];
-	int	mbp_format;
-	int	write_parameter_file = MB_NO;
-	int	nscan;
-	int	i;
-
-	/* set default input and output */
-	strcpy (mbp_ifile, "\0");
-	strcpy (read_file, "datalist.mb-1");
-
-	/* process argument list */
-	while ((c = getopt(argc, argv, "VvHhEeF:f:I:i:LlNnP:p:")) != -1)
-	  switch (c)
-		{
-		case 'H':
-		case 'h':
-			help++;
-			break;
-		case 'V':
-		case 'v':
-			verbose++;
-			break;
-		case 'E':
-		case 'e':
-			explicit = MB_YES;
-			flag++;
-			break;
-		case 'F':
-		case 'f':
-			sscanf (optarg,"%d", &format);
-			flag++;
-			break;
-		case 'I':
-		case 'i':
-			sscanf (optarg,"%s", read_file);
-			flag++;
-			break;
-		case 'L':
-		case 'l':
-			lookforfiles++;
-			flag++;
-			break;
-		case 'N':
-		case 'n':
-			removembnavadjust++;
-			flag++;
-			break;
-		case 'P':
-		case 'p':
-			if (strlen(optarg) > 1)
-			    {
-			    /* Replace first '=' before ':' with ':'  */
-			    for (i = 0; i < strlen(optarg); i++)
-				{
-				if (optarg[i] == ':')
-				    {
-				    break;
-				    }
-				else if (optarg[i] == '=')
-				    {
-				    optarg[i] = ':';
-				    break;
-				    }
-				}
-
-			    /* store the parameter argument */
-			    pargv = (char **) realloc(pargv, (pargc + 1) * sizeof(char *));
-			    pargv[pargc] = (char *) malloc(strlen(optarg)+1);
-			    strcpy(pargv[pargc], optarg);
-			    pargc++;
-			    }
-			flag++;
-			break;
-		case '?':
-			errflg++;
-		}
-
-	/* if error flagged then print it and exit */
-	if (errflg)
-		{
-		fprintf(stderr,"usage: %s\n", usage_message);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		error = MB_ERROR_BAD_USAGE;
-		exit(error);
-		}
-
-	/* print starting message */
-	if (verbose == 1 || help)
-		{
-		fprintf(stderr,"\nProgram %s\n",program_name);
-		fprintf(stderr,"Version %s\n",rcs_id);
-		fprintf(stderr,"MB-System Version %s\n",MB_VERSION);
-		}
-
-	/* if help desired then print it and exit */
-	if (help)
-		{
-		fprintf(stderr,"\n%s\n",help_message);
-		fprintf(stderr,"\nusage: %s\n", usage_message);
-		exit(error);
-		}
-
-	/* get format if required */
-	if (format == 0)
-		mb_get_format(verbose,read_file,NULL,&format,&error);
-
-	/* determine whether to read one file or a list of files */
-	if (format < 0)
-		read_datalist = MB_YES;
-
-	/* open file list */
-	if (read_datalist == MB_YES)
-	    {
-	    if ((status = mb_datalist_open(verbose,&datalist,
-					    read_file,look_processed,&error)) != MB_SUCCESS)
-		{
-		error = MB_ERROR_OPEN_FAIL;
-		fprintf(stderr,"\nUnable to open data list file: %s\n",
-			read_file);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-	    if ((status = mb_datalist_read(verbose,datalist,
-			    mbp_ifile,&mbp_format,&file_weight,&error))
-			    == MB_SUCCESS)
-		read_data = MB_YES;
-	    else
-		read_data = MB_NO;
-	    }
-	/* else copy single filename to be read */
-	else
-	    {
-	    strcpy(mbp_ifile, read_file);
-	    mbp_format = format;
-	    read_data = MB_YES;
-	    }
-
-	/* loop over all files to be read */
-	while (read_data == MB_YES)
-	{
-
-	/* load parameters */
-	status = mb_pr_readpar(verbose, mbp_ifile, lookforfiles,
-			&process, &error);
-	process.mbp_ifile_specified = MB_YES;
-	write_parameter_file = MB_NO;
-
-	if (process.mbp_format_specified == MB_NO)
-		{
-		process.mbp_format = mbp_format;
-		process.mbp_format_specified = MB_YES;
-		}
-	if (process.mbp_ofile_specified == MB_NO)
-		{
-		process.mbp_ofile_specified = MB_YES;
-		mb_pr_default_output(verbose, &process, &error);
-		}
-
-	/* apply request to remove all reference to mbnavadjust
-		- this includes deleting any adjusted navigation
-		file referenced by the process.mbp_navadjfile */
-	if (removembnavadjust == MB_YES)
-		{
-		/* delete the navadjust file if it exists */
-		if (strlen(process.mbp_navadjfile) > 0
-			&& (fstat = stat(process.mbp_navadjfile, &file_status)) == 0
-			&& (file_status.st_mode & S_IFMT) != S_IFDIR)
-			{
-			remove(process.mbp_navadjfile);
-			fprintf(stderr,"Removed navigation adjustment file %s for %s\n",
-				process.mbp_navadjfile, mbp_ifile);
-			}
-
-		/* set NAVADJFILE and NAVADJMODE to nothing and off */
-		if (strlen(process.mbp_navadjfile) > 0 || process.mbp_navadj_mode != MBP_NAV_OFF)
-			{
-			fprintf(stderr,"Turned off navigation adjustment for %s\n", mbp_ifile);
-			write_parameter_file = MB_YES;
-			}
-
-		process.mbp_navadjfile[0] = '\0';
-		process.mbp_navadj_mode = MBP_NAV_OFF;
-		}
-
-	/* if any parameters are being set, write a parameter file */
-	if (pargc > 0)
-		write_parameter_file = MB_YES;
-
-	/* process parameter list */
-	for (i=0;i<pargc;i++)
-		{
-		/* general parameters */
-		if (strncmp(pargv[i], "OUTFILE", 7) == 0)
-		    {
-		    nscan = sscanf(pargv[i], "OUTFILE:%s", process.mbp_ofile);
-		    if (nscan == 1)
-			process.mbp_ofile_specified = MB_YES;
-		    else
-			{
-			process.mbp_ofile_specified = MB_NO;
-			process.mbp_ofile[0] = '\0';
-			}
-		    }
-		else if (strncmp(pargv[i], "FORMAT", 6) == 0)
-		    {
-		    sscanf(pargv[i], "FORMAT:%d", &process.mbp_format);
-		    process.mbp_format_specified = MB_YES;
-		    }
-
-		/* navigation merging */
-		else if (strncmp(pargv[i], "NAVMODE", 7) == 0)
-		    {
-		    sscanf(pargv[i], "NAVMODE:%d", &process.mbp_nav_mode);
-		    if (explicit == MB_NO && process.mbp_nav_mode == MBP_NAV_OFF)
-			{
-			process.mbp_navfile[0] = '\0';
-			process.mbp_nav_heading = MBP_NAV_OFF;
-			process.mbp_nav_speed = MBP_NAV_OFF;
-			process.mbp_nav_draft = MBP_NAV_OFF;
-			process.mbp_nav_attitude = MBP_NAV_OFF;
-			}
-		    }
-		else if (strncmp(pargv[i], "NAVFILE", 7) == 0)
-		    {
-		    sscanf(pargv[i], "NAVFILE:%s", process.mbp_navfile);
-		    if (explicit == MB_NO)
-			{
-			process.mbp_nav_mode = MBP_NAV_ON;
-			process.mbp_nav_heading = MBP_NAV_ON;
-			process.mbp_nav_speed = MBP_NAV_ON;
-			process.mbp_nav_draft = MBP_NAV_ON;
-			process.mbp_nav_attitude = MBP_NAV_ON;
-			}
-		    }
-		else if (strncmp(pargv[i], "NAVFORMAT", 9) == 0)
-		    {
-		    sscanf(pargv[i], "NAVFORMAT:%d", &process.mbp_nav_format);
-		    }
-		else if (strncmp(pargv[i], "NAVHEADING", 10) == 0)
-		    {
-		    sscanf(pargv[i], "NAVHEADING:%d", &process.mbp_nav_heading);
-		    }
-		else if (strncmp(pargv[i], "NAVSPEED", 8) == 0)
-		    {
-		    sscanf(pargv[i], "NAVSPEED:%d", &process.mbp_nav_speed);
-		    }
-		else if (strncmp(pargv[i], "NAVDRAFT", 8) == 0)
-		    {
-		    sscanf(pargv[i], "NAVDRAFT:%d", &process.mbp_nav_draft);
-		    }
-		else if (strncmp(pargv[i], "NAVATTITUDE", 11) == 0)
-		    {
-		    sscanf(pargv[i], "NAVATTITUDE:%d", &process.mbp_nav_attitude);
-		    }
-		else if (strncmp(pargv[i], "NAVINTERP", 9) == 0)
-		    {
-		    sscanf(pargv[i], "NAVINTERP:%d", &process.mbp_nav_algorithm);
-		    }
-		else if (strncmp(pargv[i], "NAVTIMESHIFT", 12) == 0)
-		    {
-		    sscanf(pargv[i], "NAVTIMESHIFT:%lf", &process.mbp_nav_timeshift);
-		    }
-
-		/* navigation offsets and shifts */
-		else if (strncmp(pargv[i], "NAVOFFSETX", 10) == 0)
-		    {
-		    sscanf(pargv[i], "NAVOFFSETX:%lf", &process.mbp_nav_offsetx);
-		    process.mbp_nav_shift = MBP_NAV_ON;
-		    }
-		else if (strncmp(pargv[i], "NAVOFFSETY", 10) == 0)
-		    {
-		    sscanf(pargv[i], "NAVOFFSETY:%lf", &process.mbp_nav_offsety);
-		    process.mbp_nav_shift = MBP_NAV_ON;
-		    }
-		else if (strncmp(pargv[i], "NAVOFFSETZ", 10) == 0)
-		    {
-		    sscanf(pargv[i], "NAVOFFSETZ:%lf", &process.mbp_nav_offsetz);
-		    process.mbp_nav_shift = MBP_NAV_ON;
-		    }
-		else if (strncmp(pargv[i], "NAVSHIFTLON", 11) == 0)
-		    {
-		    sscanf(pargv[i], "NAVSHIFTLON:%lf", &process.mbp_nav_shiftlon);
-		    process.mbp_nav_shift = MBP_NAV_ON;
-		    }
-		else if (strncmp(pargv[i], "NAVSHIFTLAT", 11) == 0)
-		    {
-		    sscanf(pargv[i], "NAVSHIFTLAT:%lf", &process.mbp_nav_shiftlat);
-		    process.mbp_nav_shift = MBP_NAV_ON;
-		    }
-		else if (strncmp(pargv[i], "NAVSHIFT", 8) == 0)
-		    {
-		    sscanf(pargv[i], "NAVSHIFT:%d", &process.mbp_nav_shift);
-		    }
-
-		/* adjusted navigation merging */
-		else if (strncmp(pargv[i], "NAVADJMODE", 10) == 0)
-		    {
-		    sscanf(pargv[i], "NAVADJMODE:%d", &process.mbp_navadj_mode);
-		    if (explicit == MB_NO && process.mbp_navadj_mode == MBP_NAV_OFF)
-			{
-			process.mbp_navadjfile[0] = '\0';
-			}
-		    }
-		else if (strncmp(pargv[i], "NAVADJFILE", 10) == 0)
-		    {
-		    sscanf(pargv[i], "NAVADJFILE:%s", process.mbp_navadjfile);
-		    if (explicit == MB_NO)
-			{
-			process.mbp_navadj_mode = MBP_NAV_ON;
-			}
-		    }
-		else if (strncmp(pargv[i], "NAVADJINTERP", 12) == 0)
-		    {
-		    sscanf(pargv[i], "NAVADJINTERP:%d", &process.mbp_navadj_algorithm);
-		    }
-
-		/* attitude merging */
-		else if (strncmp(pargv[i], "ATTITUDEMODE", 12) == 0)
-		    {
-		    sscanf(pargv[i], "ATTITUDEMODE:%d", &process.mbp_attitude_mode);
-		    if (explicit == MB_NO && process.mbp_attitude_mode == MBP_ATTITUDE_OFF)
-			{
-			process.mbp_attitudefile[0] = '\0';
-			}
-		    }
-		else if (strncmp(pargv[i], "ATTITUDEFILE", 12) == 0)
-		    {
-		    sscanf(pargv[i], "ATTITUDEFILE:%s", process.mbp_attitudefile);
-		    if (explicit == MB_NO)
-			{
-			process.mbp_attitude_mode = MBP_ATTITUDE_ON;
-			}
-		    }
-		else if (strncmp(pargv[i], "ATTITUDEFORMAT", 14) == 0)
-		    {
-		    sscanf(pargv[i], "ATTITUDEFORMAT:%d", &process.mbp_attitude_format);
-		    }
-
-		/* sonardepth merging */
-		else if (strncmp(pargv[i], "SONARDEPTHMODE", 14) == 0)
-		    {
-		    sscanf(pargv[i], "SONARDEPTHMODE:%d", &process.mbp_sonardepth_mode);
-		    if (explicit == MB_NO && process.mbp_sonardepth_mode == MBP_SONARDEPTH_OFF)
-			{
-			process.mbp_sonardepthfile[0] = '\0';
-			}
-		    }
-		else if (strncmp(pargv[i], "SONARDEPTHFILE", 14) == 0)
-		    {
-		    sscanf(pargv[i], "SONARDEPTHFILE:%s", process.mbp_sonardepthfile);
-		    if (explicit == MB_NO)
-			{
-			process.mbp_sonardepth_mode = MBP_SONARDEPTH_ON;
-			}
-		    }
-		else if (strncmp(pargv[i], "SONARDEPTHFORMAT", 16) == 0)
-		    {
-		    sscanf(pargv[i], "SONARDEPTHFORMAT:%d", &process.mbp_sonardepth_format);
-		    }
-
-		/* data cutting */
-		else if (strncmp(pargv[i], "DATACUTCLEAR", 12) == 0)
-			{
-			process.mbp_cut_num = 0;
-			}
-		else if (strncmp(pargv[i], "DATACUT", 7) == 0)
-			{
-			if (process.mbp_cut_num < MBP_CUT_NUM_MAX)
-				{
-				sscanf(pargv[i], "DATACUT:%d:%d:%lf:%lf",
-					&process.mbp_cut_kind[process.mbp_cut_num],
-					&process.mbp_cut_mode[process.mbp_cut_num],
-					&process.mbp_cut_min[process.mbp_cut_num],
-					&process.mbp_cut_max[process.mbp_cut_num]);
-				process.mbp_cut_num++;
-				}
-			}
-		else if (strncmp(pargv[i], "BATHCUTNUMBER", 13) == 0)
-			{
-			if (process.mbp_cut_num < MBP_CUT_NUM_MAX)
-				{
-				sscanf(pargv[i], "BATHCUTNUMBER:%lf:%lf",
-					&process.mbp_cut_min[process.mbp_cut_num],
-					&process.mbp_cut_max[process.mbp_cut_num]);
-				process.mbp_cut_kind[process.mbp_cut_num] = MBP_CUT_DATA_BATH;
-				process.mbp_cut_mode[process.mbp_cut_num] = MBP_CUT_MODE_NUMBER;
-				process.mbp_cut_num++;
-				}
-			}
-		    else if (strncmp(pargv[i], "BATHCUTDISTANCE", 15) == 0)
-			{
-			if (process.mbp_cut_num < MBP_CUT_NUM_MAX)
-				{
-				sscanf(pargv[i], "BATHCUTDISTANCE:%lf:%lf",
-					&process.mbp_cut_min[process.mbp_cut_num],
-					&process.mbp_cut_max[process.mbp_cut_num]);
-				process.mbp_cut_kind[process.mbp_cut_num] = MBP_CUT_DATA_BATH;
-				process.mbp_cut_mode[process.mbp_cut_num] = MBP_CUT_MODE_DISTANCE;
-				process.mbp_cut_num++;
-				}
-			}
-		    else if (strncmp(pargv[i], "BATHCUTSPEED", 12) == 0)
-			{
-			if (process.mbp_cut_num < MBP_CUT_NUM_MAX)
-				{
-				sscanf(pargv[i], "BATHCUTSPEED:%lf:%lf",
-					&process.mbp_cut_min[process.mbp_cut_num],
-					&process.mbp_cut_max[process.mbp_cut_num]);
-				process.mbp_cut_kind[process.mbp_cut_num] = MBP_CUT_DATA_BATH;
-				process.mbp_cut_mode[process.mbp_cut_num] = MBP_CUT_MODE_SPEED;
-				process.mbp_cut_num++;
-				}
-			}
-		    else if (strncmp(pargv[i], "AMPCUTNUMBER", 12) == 0)
-			{
-			if (process.mbp_cut_num < MBP_CUT_NUM_MAX)
-				{
-				sscanf(pargv[i], "AMPCUTNUMBER:%lf:%lf",
-					&process.mbp_cut_min[process.mbp_cut_num],
-					&process.mbp_cut_max[process.mbp_cut_num]);
-				process.mbp_cut_kind[process.mbp_cut_num] = MBP_CUT_DATA_AMP;
-				process.mbp_cut_mode[process.mbp_cut_num] = MBP_CUT_MODE_NUMBER;
-				process.mbp_cut_num++;
-				}
-			}
-		    else if (strncmp(pargv[i], "AMPCUTDISTANCE", 14) == 0)
-			{
-			if (process.mbp_cut_num < MBP_CUT_NUM_MAX)
-				{
-				sscanf(pargv[i], "AMPCUTDISTANCE:%lf:%lf",
-					&process.mbp_cut_min[process.mbp_cut_num],
-					&process.mbp_cut_max[process.mbp_cut_num]);
-				process.mbp_cut_kind[process.mbp_cut_num] = MBP_CUT_DATA_AMP;
-				process.mbp_cut_mode[process.mbp_cut_num] = MBP_CUT_MODE_DISTANCE;
-				process.mbp_cut_num++;
-				}
-			}
-		    else if (strncmp(pargv[i], "AMPCUTSPEED", 11) == 0)
-			{
-			if (process.mbp_cut_num < MBP_CUT_NUM_MAX)
-				{
-				sscanf(pargv[i], "AMPCUTSPEED:%lf:%lf",
-					&process.mbp_cut_min[process.mbp_cut_num],
-					&process.mbp_cut_max[process.mbp_cut_num]);
-				process.mbp_cut_kind[process.mbp_cut_num] = MBP_CUT_DATA_AMP;
-				process.mbp_cut_mode[process.mbp_cut_num] = MBP_CUT_MODE_SPEED;
-				process.mbp_cut_num++;
-				}
-			}
-		    else if (strncmp(pargv[i], "SSCUTNUMBER", 11) == 0)
-			{
-			if (process.mbp_cut_num < MBP_CUT_NUM_MAX)
-				{
-				sscanf(pargv[i], "SSCUTNUMBER:%lf:%lf",
-					&process.mbp_cut_min[process.mbp_cut_num],
-					&process.mbp_cut_max[process.mbp_cut_num]);
-				process.mbp_cut_kind[process.mbp_cut_num] = MBP_CUT_DATA_SS;
-				process.mbp_cut_mode[process.mbp_cut_num] = MBP_CUT_MODE_NUMBER;
-				process.mbp_cut_num++;
-				}
-			}
-		    else if (strncmp(pargv[i], "SSCUTDISTANCE", 13) == 0)
-			{
-			if (process.mbp_cut_num < MBP_CUT_NUM_MAX)
-				{
-				sscanf(pargv[i], "SSCUTDISTANCE:%lf:%lf",
-					&process.mbp_cut_min[process.mbp_cut_num],
-					&process.mbp_cut_max[process.mbp_cut_num]);
-				process.mbp_cut_kind[process.mbp_cut_num] = MBP_CUT_DATA_SS;
-				process.mbp_cut_mode[process.mbp_cut_num] = MBP_CUT_MODE_DISTANCE;
-				process.mbp_cut_num++;
-				}
-			}
-		    else if (strncmp(pargv[i], "SSCUTSPEED", 10) == 0)
-			{
-			if (process.mbp_cut_num < MBP_CUT_NUM_MAX)
-				{
-				sscanf(pargv[i], "SSCUTSPEED:%lf:%lf",
-					&process.mbp_cut_min[process.mbp_cut_num],
-					&process.mbp_cut_max[process.mbp_cut_num]);
-				process.mbp_cut_kind[process.mbp_cut_num] = MBP_CUT_DATA_SS;
-				process.mbp_cut_mode[process.mbp_cut_num] = MBP_CUT_MODE_SPEED;
-				process.mbp_cut_num++;
-				}
-			}
-
-		/* bathymetry editing */
-		else if (strncmp(pargv[i], "EDITSAVEMODE", 12) == 0)
-		    {
-		    sscanf(pargv[i], "EDITSAVEMODE:%d", &process.mbp_edit_mode);
-		    if (explicit == MB_NO && process.mbp_edit_mode == MBP_EDIT_OFF)
-			{
-			process.mbp_editfile[0] = '\0';
-			}
-		    }
-		else if (strncmp(pargv[i], "EDITSAVEFILE", 12) == 0)
-		    {
-		    sscanf(pargv[i], "EDITSAVEFILE:%s", process.mbp_editfile);
-		    if (explicit == MB_NO)
-			{
-			process.mbp_edit_mode = MBP_EDIT_ON;
-			}
-		    }
-
-		/* bathymetry recalculation */
-		else if (strncmp(pargv[i], "RAYTRACE", 8) == 0)
-		    {
-		    sscanf(pargv[i], "RAYTRACE:%d", &process.mbp_svp_mode);
-		    }
-		else if (strncmp(pargv[i], "SVPMODE", 7) == 0)
-		    {
-		    sscanf(pargv[i], "SVPMODE:%d", &process.mbp_svp_mode);
-		    if (explicit == MB_NO && process.mbp_svp_mode == MBP_SVP_OFF)
-			{
-			process.mbp_svpfile[0] = '\0';
-			}
-		    }
-		else if (strncmp(pargv[i], "SVPFILE", 7) == 0)
-		    {
-		    sscanf(pargv[i], "SVPFILE:%s", process.mbp_svpfile);
-		    if (explicit == MB_NO)
-			{
-			process.mbp_svp_mode = MBP_SVP_ON;
-			}
-		    }
-		else if (strncmp(pargv[i], "SSVMODE", 7) == 0)
-		    {
-		    sscanf(pargv[i], "SSVMODE:%d", &process.mbp_ssv_mode);
-		    }
-		else if (strncmp(pargv[i], "SSV", 3) == 0)
-		    {
-		    sscanf(pargv[i], "SSV:%lf", &process.mbp_ssv);
-		    }
-		else if (strncmp(pargv[i], "TTMODE", 6) == 0)
-		    {
-		    sscanf(pargv[i], "TTMODE:%d", &process.mbp_tt_mode);
-		    }
-		else if (strncmp(pargv[i], "TTMULTIPLY", 10) == 0)
-		    {
-		    sscanf(pargv[i], "TTMULTIPLY:%lf", &process.mbp_tt_mult);
-		    }
-		else if (strncmp(pargv[i], "CORRECTED", 9) == 0)
-		    {
-		    sscanf(pargv[i], "CORRECTED:%d", &process.mbp_corrected);
-		    }
-		else if (strncmp(pargv[i], "ANGLEMODE", 9) == 0)
-		    {
-		    sscanf(pargv[i], "ANGLEMODE:%d", &process.mbp_angle_mode);
-		    }
-		else if (strncmp(pargv[i], "SOUNDSPEEDREF", 13) == 0)
-		    {
-		    sscanf(pargv[i], "SOUNDSPEEDREF:%d", &process.mbp_corrected);
-		    }
-
-		/* static beam bathymetry correction */
-		else if (strncmp(pargv[i], "STATICMODE", 10) == 0)
-		    {
-		    sscanf(pargv[i], "STATICMODE:%d", &process.mbp_static_mode);
-		    if (explicit == MB_NO && process.mbp_static_mode == MBP_STATIC_OFF)
-			{
-			process.mbp_staticfile[0] = '\0';
-			}
-		    }
-		else if (strncmp(pargv[i], "STATICFILE", 10) == 0)
-		    {
-		    sscanf(pargv[i], "STATICFILE:%s", process.mbp_staticfile);
-		    if (explicit == MB_NO)
-			{
-			process.mbp_static_mode = MBP_SVP_ON;
-			}
-		    }
-
-		/* draft correction */
-		else if (strncmp(pargv[i], "DRAFTMODE", 9) == 0)
-		    {
-		    sscanf(pargv[i], "DRAFTMODE:%d", &process.mbp_draft_mode);
-		    }
-		else if (strncmp(pargv[i], "DRAFTOFFSET", 11) == 0)
-		    {
-		    sscanf(pargv[i], "DRAFTOFFSET:%lf", &process.mbp_draft_offset);
-		    if (explicit == MB_NO
-			&& process.mbp_draft_mode == MBP_DRAFT_MULTIPLY)
-			{
-			process.mbp_draft_mode = MBP_DRAFT_MULTIPLYOFFSET;
-			}
-		    else if (explicit == MB_NO
-			&& process.mbp_draft_mode == MBP_DRAFT_OFF)
-			{
-			process.mbp_draft_mode = MBP_DRAFT_OFFSET;
-			}
-		    }
-		else if (strncmp(pargv[i], "DRAFTMULTIPLY", 13) == 0)
-		    {
-		    sscanf(pargv[i], "DRAFTMULTIPLY:%lf", &process.mbp_draft_mult);
-		    if (explicit == MB_NO
-			&& process.mbp_draft_mode == MBP_DRAFT_OFFSET)
-			{
-			process.mbp_draft_mode = MBP_DRAFT_MULTIPLYOFFSET;
-			}
-		    else if (explicit == MB_NO
-			&& process.mbp_draft_mode == MBP_DRAFT_OFF)
-			{
-			process.mbp_draft_mode = MBP_DRAFT_MULTIPLY;
-			}
-		    }
-		else if (strncmp(pargv[i], "DRAFT", 5) == 0)
-		    {
-		    sscanf(pargv[i], "DRAFT:%lf", &process.mbp_draft);
-		    if (explicit == MB_NO)
-			{
-			process.mbp_draft_mode = MBP_DRAFT_SET;
-			}
-		    }
-
-		/* heave correction */
-		else if (strncmp(pargv[i], "HEAVEMODE", 9) == 0)
-		    {
-		    sscanf(pargv[i], "HEAVEMODE:%d", &process.mbp_heave_mode);
-		    }
-		else if (strncmp(pargv[i], "HEAVEOFFSET", 11) == 0)
-		    {
-		    sscanf(pargv[i], "HEAVEOFFSET:%lf", &process.mbp_heave);
-		    if (explicit == MB_NO
-			&& process.mbp_heave_mode == MBP_HEAVE_MULTIPLY)
-			{
-			process.mbp_heave_mode = MBP_HEAVE_MULTIPLYOFFSET;
-			}
-		    else if (explicit == MB_NO
-			&& process.mbp_heave_mode == MBP_HEAVE_OFF)
-			{
-			process.mbp_heave_mode = MBP_HEAVE_OFFSET;
-			}
-		    }
-		else if (strncmp(pargv[i], "HEAVEMULTIPLY", 13) == 0)
-		    {
-		    sscanf(pargv[i], "HEAVEMULTIPLY:%lf", &process.mbp_heave_mult);
-		    if (explicit == MB_NO
-			&& process.mbp_heave_mode == MBP_HEAVE_OFFSET)
-			{
-			process.mbp_heave_mode = MBP_HEAVE_MULTIPLYOFFSET;
-			}
-		    else if (explicit == MB_NO
-			&& process.mbp_heave_mode == MBP_HEADING_OFF)
-			{
-			process.mbp_heave_mode = MBP_HEAVE_MULTIPLY;
-			}
-		    }
-
-		/* lever correction */
-		else if (strncmp(pargv[i], "LEVERMODE", 9) == 0)
-		    {
-		    sscanf(pargv[i], "LEVERMODE:%d", &process.mbp_lever_mode);
-		    }
-		else if (strncmp(pargv[i], "VRUOFFSETX", 10) == 0)
-		    {
-		    sscanf(pargv[i], "VRUOFFSETX:%lf", &process.mbp_vru_offsetx);
-		    if (explicit == MB_NO)
-			{
-			process.mbp_lever_mode = MBP_LEVER_ON;
-			}
-		    }
-		else if (strncmp(pargv[i], "VRUOFFSETY", 10) == 0)
-		    {
-		    sscanf(pargv[i], "VRUOFFSETY:%lf", &process.mbp_vru_offsety);
-		    if (explicit == MB_NO)
-			{
-			process.mbp_lever_mode = MBP_LEVER_ON;
-			}
-		    }
-		else if (strncmp(pargv[i], "VRUOFFSETZ", 10) == 0)
-		    {
-		    sscanf(pargv[i], "VRUOFFSETZ:%lf", &process.mbp_vru_offsetz);
-		    if (explicit == MB_NO)
-			{
-			process.mbp_lever_mode = MBP_LEVER_ON;
-			}
-		    }
-		else if (strncmp(pargv[i], "SONAROFFSETX", 12) == 0)
-		    {
-		    sscanf(pargv[i], "SONAROFFSETX:%lf", &process.mbp_sonar_offsetx);
-		    if (explicit == MB_NO)
-			{
-			process.mbp_lever_mode = MBP_LEVER_ON;
-			}
-		    }
-		else if (strncmp(pargv[i], "SONAROFFSETY", 12) == 0)
-		    {
-		    sscanf(pargv[i], "SONAROFFSETY:%lf", &process.mbp_sonar_offsety);
-		    if (explicit == MB_NO)
-			{
-			process.mbp_lever_mode = MBP_LEVER_ON;
-			}
-		    }
-		else if (strncmp(pargv[i], "SONAROFFSETZ", 12) == 0)
-		    {
-		    sscanf(pargv[i], "SONAROFFSETZ:%lf", &process.mbp_sonar_offsetz);
-		    if (explicit == MB_NO)
-			{
-			process.mbp_lever_mode = MBP_LEVER_ON;
-			}
-		    }
-
-		/* roll correction */
-		else if (strncmp(pargv[i], "ROLLBIASMODE", 12) == 0)
-		    {
-		    sscanf(pargv[i], "ROLLBIASMODE:%d", &process.mbp_rollbias_mode);
-		    }
-		else if (strncmp(pargv[i], "ROLLBIASPORT", 12) == 0)
-		    {
-		    sscanf(pargv[i], "ROLLBIASPORT:%lf", &process.mbp_rollbias_port);
-		    if (explicit == MB_NO)
-			{
-			process.mbp_rollbias_mode = MBP_ROLLBIAS_DOUBLE;
-			}
-		    }
-		else if (strncmp(pargv[i], "ROLLBIASSTBD", 12) == 0)
-		    {
-		    sscanf(pargv[i], "ROLLBIASSTBD:%lf", &process.mbp_rollbias_stbd);
-		    if (explicit == MB_NO)
-			{
-			process.mbp_rollbias_mode = MBP_ROLLBIAS_DOUBLE;
-			}
-		    }
-		else if (strncmp(pargv[i], "ROLLBIAS", 8) == 0)
-		    {
-		    sscanf(pargv[i], "ROLLBIAS:%lf", &process.mbp_rollbias);
-		    if (explicit == MB_NO)
-			{
-			process.mbp_rollbias_mode = MBP_ROLLBIAS_SINGLE;
-			}
-		    }
-
-		/* pitch correction */
-		else if (strncmp(pargv[i], "PITCHBIASMODE", 13) == 0)
-		    {
-		    sscanf(pargv[i], "PITCHBIASMODE:%d", &process.mbp_pitchbias_mode);
-		    }
-		else if (strncmp(pargv[i], "PITCHBIAS", 9) == 0)
-		    {
-		    sscanf(pargv[i], "PITCHBIAS:%lf", &process.mbp_pitchbias);
-		    if (explicit == MB_NO)
-			{
-			process.mbp_pitchbias_mode = MBP_PITCHBIAS_ON;
-			}
-		    }
-
-		/* heading correction */
-		else if (strncmp(pargv[i], "HEADINGMODE", 11) == 0)
-		    {
-		    sscanf(pargv[i], "HEADINGMODE:%d", &process.mbp_heading_mode);
-		    }
-		else if (strncmp(pargv[i], "HEADINGOFFSET", 13) == 0)
-		    {
-		    sscanf(pargv[i], "HEADINGOFFSET:%lf", &process.mbp_headingbias);
-		    if (explicit == MB_NO
-			&& process.mbp_heading_mode == MBP_HEADING_CALC)
-			{
-			process.mbp_heading_mode = MBP_HEADING_CALCOFFSET;
-			}
-		    else if (explicit == MB_NO
-			&& process.mbp_heading_mode == MBP_HEADING_OFF)
-			{
-			process.mbp_heading_mode = MBP_HEADING_OFFSET;
-			}
-		    }
-
-		/* tide correction */
-		else if (strncmp(pargv[i], "TIDEMODE", 8) == 0)
-		    {
-		    sscanf(pargv[i], "TIDEMODE:%d", &process.mbp_tide_mode);
-		    if (explicit == MB_NO && process.mbp_tide_mode == MBP_TIDE_OFF)
-			{
-			process.mbp_tidefile[0] = '\0';
-			}
-		    }
-		else if (strncmp(pargv[i], "TIDEFILE", 8) == 0)
-		    {
-		    sscanf(pargv[i], "TIDEFILE:%s", process.mbp_tidefile);
-		    if (explicit == MB_NO)
-			{
-			process.mbp_tide_mode = MBP_TIDE_ON;
-			}
-		    }
-		else if (strncmp(pargv[i], "TIDEFORMAT", 10) == 0)
-		    {
-		    sscanf(pargv[i], "TIDEFORMAT:%d", &process.mbp_tide_format);
-		    }
-
-		/* amplitude correction */
-		else if (strncmp(pargv[i], "AMPCORRMODE", 11) == 0)
-		    {
-		    sscanf(pargv[i], "AMPCORRMODE:%d", &process.mbp_ampcorr_mode);
-		    if (explicit == MB_NO && process.mbp_ampcorr_mode == MBP_AMPCORR_OFF)
-			{
-			process.mbp_ampcorrfile[0] = '\0';
-			}
-		    }
-		else if (strncmp(pargv[i], "AMPCORRFILE", 11) == 0)
-		    {
-		    sscanf(pargv[i], "AMPCORRFILE:%s", process.mbp_ampcorrfile);
-		    if (explicit == MB_NO)
-			{
-			process.mbp_ampcorr_mode = MBP_AMPCORR_ON;
-			}
-		    }
-		else if (strncmp(pargv[i], "AMPCORRTYPE", 11) == 0)
-		    {
-		    sscanf(pargv[i], "AMPCORRTYPE:%d", &process.mbp_ampcorr_type);
-		    }
-		else if (strncmp(pargv[i], "AMPCORRSYMMETRY", 15) == 0)
-		    {
-		    sscanf(pargv[i], "AMPCORRSYMMETRY:%d", &process.mbp_ampcorr_symmetry);
-		    }
-		else if (strncmp(pargv[i], "AMPCORRANGLE", 12) == 0)
-		    {
-		    sscanf(pargv[i], "AMPCORRANGLE:%lf", &process.mbp_ampcorr_angle);
-		    }
-		else if (strncmp(pargv[i], "AMPCORRSLOPE", 12) == 0)
-		    {
-		    sscanf(pargv[i], "AMPCORRSLOPE:%d", &process.mbp_ampcorr_slope);
-		    }
-		else if (strncmp(pargv[i], "AMPSSCORRTOPOFILE", 17) == 0)
-		    {
-		    sscanf(pargv[i], "AMPSSCORRTOPOFILE:%s", process.mbp_ampsscorr_topofile);
-		    }
-
-		/* sidescan correction */
-		else if (strncmp(pargv[i], "SSCORRMODE", 10) == 0)
-		    {
-		    sscanf(pargv[i], "SSCORRMODE:%d", &process.mbp_sscorr_mode);
-		    if (explicit == MB_NO && process.mbp_sscorr_mode == MBP_SSCORR_OFF)
-			{
-			process.mbp_sscorrfile[0] = '\0';
-			}
-		    }
-		else if (strncmp(pargv[i], "SSCORRFILE", 10) == 0)
-		    {
-		    sscanf(pargv[i], "SSCORRFILE:%s", process.mbp_sscorrfile);
-		    if (explicit == MB_NO)
-			{
-			process.mbp_sscorr_mode = MBP_SSCORR_ON;
-			}
-		    }
-		else if (strncmp(pargv[i], "SSCORRTYPE", 10) == 0)
-		    {
-		    sscanf(pargv[i], "SSCORRTYPE:%d", &process.mbp_sscorr_type);
-		    }
-		else if (strncmp(pargv[i], "SSCORRSYMMETRY", 14) == 0)
-		    {
-		    sscanf(pargv[i], "SSCORRSYMMETRY:%d", &process.mbp_sscorr_symmetry);
-		    }
-		else if (strncmp(pargv[i], "SSCORRANGLE", 11) == 0)
-		    {
-		    sscanf(pargv[i], "SSCORRANGLE:%lf", &process.mbp_sscorr_angle);
-		    }
-		else if (strncmp(pargv[i], "SSCORRSLOPE", 11) == 0)
-		    {
-		    sscanf(pargv[i], "SSCORRSLOPE:%d", &process.mbp_sscorr_slope);
-		    }
-		else if (strncmp(pargv[i], "AMPSSCORRTOPOFILE", 17) == 0)
-		    {
-		    sscanf(pargv[i], "AMPSSCORRTOPOFILE:%s", process.mbp_ampsscorr_topofile);
-		    }
-
-		/* sidescan recalculation */
-		else if (strncmp(pargv[i], "SSRECALCMODE", 12) == 0)
-		    {
-		    sscanf(pargv[i], "SSRECALCMODE:%d", &process.mbp_ssrecalc_mode);
-		    }
-		else if (strncmp(pargv[i], "SSPIXELSIZE", 11) == 0)
-		    {
-		    sscanf(pargv[i], "SSPIXELSIZE:%lf", &process.mbp_ssrecalc_pixelsize);
-		    }
-		else if (strncmp(pargv[i], "SSSWATHWIDTH", 11) == 0)
-		    {
-		    sscanf(pargv[i], "SSSWATHWIDTH:%lf", &process.mbp_ssrecalc_swathwidth);
-		    }
-		else if (strncmp(pargv[i], "SSINTERPOLATE", 11) == 0)
-		    {
-		    sscanf(pargv[i], "SSINTERPOLATE:%d", &process.mbp_ssrecalc_interpolate);
-		    }
-
-		/* metadata insertion */
-		else if (strncmp(pargv[i], "METAVESSEL:", 11) == 0)
-			{
-			strcpy(process.mbp_meta_vessel, &(pargv[i][11]));
-			}
-		else if (strncmp(pargv[i], "METAINSTITUTION:", 16) == 0)
-			{
-			strcpy(process.mbp_meta_institution, &(pargv[i][16]));
-			}
-		else if (strncmp(pargv[i], "METAPLATFORM:", 13) == 0)
-			{
-			strcpy(process.mbp_meta_platform, &(pargv[i][13]));
-			}
-		else if (strncmp(pargv[i], "METASONARVERSION:", 17) == 0)
-			{
-			strcpy(process.mbp_meta_sonarversion, &(pargv[i][17]));
-			}
-		else if (strncmp(pargv[i], "METASONAR:", 10) == 0)
-			{
-			strcpy(process.mbp_meta_sonar, &(pargv[i][10]));
-			}
-		else if (strncmp(pargv[i], "METACRUISEID:", 13) == 0)
-			{
-			strcpy(process.mbp_meta_cruiseid, &(pargv[i][13]));
-			}
-		else if (strncmp(pargv[i], "METACRUISENAME:", 15) == 0)
-			{
-			strcpy(process.mbp_meta_cruisename, &(pargv[i][15]));
-			}
-		else if (strncmp(pargv[i], "METAPIINSTITUTION:", 18) == 0)
-			{
-			strcpy(process.mbp_meta_piinstitution, &(pargv[i][18]));
-			}
-		else if (strncmp(pargv[i], "METACLIENT:", 11) == 0)
-			{
-			strcpy(process.mbp_meta_client, &(pargv[i][11]));
-			}
-		else if (strncmp(pargv[i], "METASVCORRECTED:", 16) == 0)
-			{
-			sscanf(pargv[i], "METASVCORRECTED:%d", &(process.mbp_meta_svcorrected));
-			}
-		else if (strncmp(pargv[i], "METATIDECORRECTED:", 18) == 0)
-			{
-			sscanf(pargv[i], "METATIDECORRECTED:%d", &(process.mbp_meta_tidecorrected));
-			}
-		else if (strncmp(pargv[i], "METABATHEDITMANUAL:", 19) == 0)
-			{
-			sscanf(pargv[i], "METABATHEDITMANUAL:%d", &(process.mbp_meta_batheditmanual));
-			}
-		else if (strncmp(pargv[i], "METABATHEDITAUTO:", 17) == 0)
-			{
-			sscanf(pargv[i], "METABATHEDITAUTO:%d", &(process.mbp_meta_batheditauto));
-			}
-		else if (strncmp(pargv[i], "METAROLLBIAS:", 13) == 0)
-			{
-			sscanf(pargv[i], "METAROLLBIAS:%lf", &(process.mbp_meta_rollbias));
-			}
-		else if (strncmp(pargv[i], "METAPITCHBIAS:", 14) == 0)
-			{
-			sscanf(pargv[i], "METAPITCHBIAS:%lf", &(process.mbp_meta_pitchbias));
-			}
-		else if (strncmp(pargv[i], "METAPI:", 7) == 0)
-			{
-			strcpy(process.mbp_meta_pi, &(pargv[i][7]));
-			}
-		else if (strncmp(pargv[i], "METAHEADINGBIAS:", 16) == 0)
-			{
-			sscanf(pargv[i], "METAHEADINGBIAS:%lf", &(process.mbp_meta_headingbias));
-			}
-		else if (strncmp(pargv[i], "METADRAFT:", 10) == 0)
-			{
-			sscanf(pargv[i], "METADRAFT:%lf", &(process.mbp_meta_draft));
-			}
-
-		/* processing kluges */
-		else if (strncmp(pargv[i], "KLUGE001:", 8) == 0)
-			{
-			sscanf(pargv[i], "KLUGE001:%d", &(process.mbp_kluge001));
-			}
-		else if (strncmp(pargv[i], "KLUGE002:", 8) == 0)
-			{
-			sscanf(pargv[i], "KLUGE002:%d", &(process.mbp_kluge002));
-			}
-		else if (strncmp(pargv[i], "KLUGE003:", 8) == 0)
-			{
-			sscanf(pargv[i], "KLUGE003:%d", &(process.mbp_kluge003));
-			}
-		else if (strncmp(pargv[i], "KLUGE004:", 8) == 0)
-			{
-			sscanf(pargv[i], "KLUGE004:%d", &(process.mbp_kluge004));
-			}
-		else if (strncmp(pargv[i], "KLUGE005:", 8) == 0)
-			{
-			sscanf(pargv[i], "KLUGE005:%d", &(process.mbp_kluge005));
-			}
-		else if (strncmp(pargv[i], "KLUGE006:", 8) == 0)
-			{
-			sscanf(pargv[i], "KLUGE006:%d", &(process.mbp_kluge006));
-			}
-		else if (strncmp(pargv[i], "KLUGE007:", 8) == 0)
-			{
-			sscanf(pargv[i], "KLUGE007:%d", &(process.mbp_kluge007));
-			}
-		else if (strncmp(pargv[i], "KLUGE008:", 8) == 0)
-			{
-			sscanf(pargv[i], "KLUGE008:%d", &(process.mbp_kluge008));
-			}
-		else if (strncmp(pargv[i], "KLUGE009:", 8) == 0)
-			{
-			sscanf(pargv[i], "KLUGE009:%d", &(process.mbp_kluge009));
-			}
-		else if (strncmp(pargv[i], "KLUGE010:", 8) == 0)
-			{
-			sscanf(pargv[i], "KLUGE010:%d", &(process.mbp_kluge010));
-			}
-
-		/* unrecognized command */
-		else
-		    {
-		    fprintf(stderr, "\nUnrecognized %s command: %s\n",
-			    program_name, pargv[i]);
-		    }
-		}
-
-	/* figure out data format or output filename if required */
-	if (process.mbp_format_specified == MB_NO
-	    || process.mbp_ofile_specified == MB_NO)
-	    {
-	    mb_pr_default_output(verbose, &process, &error);
-	    }
-
-	/* update bathymetry recalculation mode */
-	mb_pr_bathmode(verbose, &process, &error);
-
-	/* if any of the important modes has been turned on, write the parameter file */
-	if (process.mbp_nav_mode != MBP_NAV_OFF
-		|| process.mbp_navadj_mode != MBP_NAV_OFF
-		|| process.mbp_attitude_mode != 0
-		|| process.mbp_sonardepth_mode != 0
-		|| process.mbp_cut_num != 0
-		|| process.mbp_edit_mode != MBP_EDIT_OFF
-		|| process.mbp_bathrecalc_mode != MBP_BATHRECALC_OFF
-		|| process.mbp_draft_mode != MBP_DRAFT_OFF
-		|| process.mbp_heave_mode != MBP_HEAVE_OFF
-		|| process.mbp_lever_mode != MBP_LEVER_OFF
-		|| process.mbp_rollbias_mode != MBP_ROLLBIAS_OFF
-		|| process.mbp_pitchbias_mode != MBP_PITCHBIAS_OFF
-		|| process.mbp_heading_mode != MBP_HEADING_OFF
-		|| process.mbp_tide_mode != MBP_TIDE_OFF
-		|| process.mbp_ampcorr_mode != MBP_AMPCORR_OFF
-		|| process.mbp_sscorr_mode != MBP_SSCORR_OFF
-		|| process.mbp_ssrecalc_mode != MBP_SSRECALC_OFF
-		|| process.mbp_meta_vessel[0] != '\0'
-		|| process.mbp_meta_institution[0] != '\0'
-		|| process.mbp_meta_platform[0] != '\0'
-		|| process.mbp_meta_sonar[0] != '\0'
-		|| process.mbp_meta_sonarversion[0] != '\0'
-		|| process.mbp_meta_cruiseid[0] != '\0'
-		|| process.mbp_meta_cruisename[0] != '\0'
-		|| process.mbp_meta_pi[0] != '\0'
-		|| process.mbp_meta_piinstitution[0] != '\0'
-		|| process.mbp_meta_client[0] != '\0'
-		|| process.mbp_meta_svcorrected != MBP_CORRECTION_UNKNOWN
-		|| process.mbp_meta_tidecorrected != MBP_CORRECTION_UNKNOWN
-		|| process.mbp_meta_batheditmanual != MBP_CORRECTION_UNKNOWN
-		|| process.mbp_meta_batheditauto != MBP_CORRECTION_UNKNOWN
-		|| process.mbp_meta_rollbias != MBP_METANOVALUE + 1.
-		|| process.mbp_meta_pitchbias != MBP_METANOVALUE + 1.
-		|| process.mbp_meta_headingbias != MBP_METANOVALUE + 1.
-		|| process.mbp_meta_draft != MBP_METANOVALUE + 1.
-		|| process.mbp_kluge001 != MB_NO
-		|| process.mbp_kluge002 != MB_NO
-		|| process.mbp_kluge003 != MB_NO
-		|| process.mbp_kluge004 != MB_NO
-		|| process.mbp_kluge005 != MB_NO
-		|| process.mbp_kluge006 != MB_NO
-		|| process.mbp_kluge007 != MB_NO
-		|| process.mbp_kluge008 != MB_NO
-		|| process.mbp_kluge009 != MB_NO
-		|| process.mbp_kluge010 != MB_NO)
-		{
-		write_parameter_file = MB_YES;
-		}
-
-	/* print starting debug statements */
-	if (verbose >= 2)
-	    {
-	    fprintf(stderr,"\ndbg2  Program <%s>\n",program_name);
-	    fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-	    fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-	    fprintf(stderr,"\ndbg2  MB-System Control Parameters:\n");
-	    fprintf(stderr,"dbg2       verbose:         %d\n",verbose);
-	    fprintf(stderr,"dbg2       help:            %d\n",help);
-	    fprintf(stderr,"dbg2       verbose:         %d\n",verbose);
-	    }
-
-	/* print starting info statements */
-	if (verbose == 1)
-	    {
-	    fprintf(stderr,"\nProgram <%s>\n",program_name);
-	    fprintf(stderr,"Version %s\n",rcs_id);
-	    fprintf(stderr,"MB-system Version %s\n",MB_VERSION);
-	    fprintf(stderr,"\nOutput MBprocess Parameters:\n");
-	    fprintf(stderr,"\nInput and Output Files:\n");
-	    if (process.mbp_format_specified == MB_YES)
-		fprintf(stderr,"  Format:                        %d\n",process.mbp_format);
-	    if (process.mbp_ifile_specified == MB_YES)
-		fprintf(stderr,"  Input file:                    %s\n",process.mbp_ifile);
-	    if (process.mbp_ofile_specified == MB_YES)
-		fprintf(stderr,"  Output file:                   %s\n",process.mbp_ofile);
-
-	    fprintf(stderr,"\nNavigation Merging:\n");
-	    if (process.mbp_nav_mode == MBP_NAV_ON)
-		{
-		fprintf(stderr,"  Navigation merged from navigation file.\n");
-		fprintf(stderr,"  Navigation file:               %s\n", process.mbp_navfile);
-	        fprintf(stderr,"  Navigation format:             %d\n", process.mbp_nav_format);
-		if (process.mbp_nav_heading == MBP_NAV_ON)
-		    fprintf(stderr,"  Heading merged from navigation file.\n");
-		else
-		    fprintf(stderr,"  Heading not merged from navigation file.\n");
-		if (process.mbp_nav_speed == MBP_NAV_ON)
-		    fprintf(stderr,"  Speed merged from navigation file.\n");
-		else
-		    fprintf(stderr,"  Speed not merged from navigation file.\n");
-		if (process.mbp_nav_draft == MBP_NAV_ON)
-		    fprintf(stderr,"  Draft merged from navigation file.\n");
-		else
-		    fprintf(stderr,"  Draft not merged from navigation file.\n");
-		if (process.mbp_nav_attitude == MBP_NAV_ON)
-		    fprintf(stderr,"  Roll, pitch, and heave merged from navigation file.\n");
-		else
-		    fprintf(stderr,"  Roll, pitch, and heave not merged from navigation file.\n");
-		if (process.mbp_nav_algorithm == MBP_NAV_LINEAR)
-		    fprintf(stderr,"  Navigation algorithm:          linear interpolation\n");
-		else if (process.mbp_nav_algorithm == MBP_NAV_SPLINE)
-		    fprintf(stderr,"  Navigation algorithm:          spline interpolation\n");
-	    	fprintf(stderr,"  Navigation time shift:         %f\n", process.mbp_nav_timeshift);
-		}
-	    else
-		fprintf(stderr,"  Navigation not merged from navigation file.\n");
-
-	    fprintf(stderr,"\nNavigation Offsets and Shifts:\n");
-	    if (process.mbp_nav_shift == MBP_NAV_ON)
-		    {
-		    fprintf(stderr,"  Navigation positions shifted.\n");
-		    fprintf(stderr,"  Navigation offset x:       %f\n", process.mbp_nav_offsetx);
-		    fprintf(stderr,"  Navigation offset y:       %f\n", process.mbp_nav_offsety);
-		    fprintf(stderr,"  Navigation offset z:       %f\n", process.mbp_nav_offsetz);
-		    fprintf(stderr,"  Navigation longitude shift:%f\n", process.mbp_nav_shiftlon);
-		    fprintf(stderr,"  Navigation latitude shift: %f\n", process.mbp_nav_shiftlat);
-		    }
-	    else
-		    fprintf(stderr,"  Navigation positions not shifted.\n");
-
-	    fprintf(stderr,"\nAdjusted Navigation Merging:\n");
-	    if (process.mbp_navadj_mode == MBP_NAV_ON)
-		{
-		fprintf(stderr,"  Navigation merged from adjusted navigation file.\n");
-		fprintf(stderr,"  Adjusted navigation file:      %s\n", process.mbp_navadjfile);
-		if (process.mbp_navadj_algorithm == MBP_NAV_LINEAR)
-		    fprintf(stderr,"  Adjusted navigation algorithm: linear interpolation\n");
-		else if (process.mbp_navadj_algorithm == MBP_NAV_SPLINE)
-		    fprintf(stderr,"  Adjusted navigation algorithm: spline interpolation\n");
-		}
-	    else
-		fprintf(stderr,"  Navigation not merged from adjusted navigation file.\n");
-
-	    fprintf(stderr,"\nAttitude Merging:\n");
-	    if (process.mbp_attitude_mode == MBP_NAV_ON)
-	        {
-		fprintf(stderr,"  Attitude merged from attitude file.\n");
-	        fprintf(stderr,"  Attitude file:                 %s\n", process.mbp_attitudefile);
-	        fprintf(stderr,"  Attitude format:               %d\n", process.mbp_attitude_format);
-		}
-	    else
-		fprintf(stderr,"  Attitude not merged from attitude file.\n");
-
-	    fprintf(stderr,"\nData Cutting:\n");
-	    if (process.mbp_cut_num > 0)
-		fprintf(stderr,"  Data cutting enabled (%d commands).\n", process.mbp_cut_num);
-	    else
-		fprintf(stderr,"  Data cutting disabled.\n");
-	    for (i=0;i<process.mbp_cut_num;i++)
-		{
-		if (process.mbp_cut_kind[i] == MBP_CUT_DATA_BATH)
-		    fprintf(stderr, "  Cut[%d]: bathymetry", i);
-		else if (process.mbp_cut_kind[i] == MBP_CUT_DATA_AMP)
-		    fprintf(stderr, "  Cut[%d]: amplitude ", i);
-		else if (process.mbp_cut_kind[i] == MBP_CUT_DATA_SS)
-		    fprintf(stderr, "  Cut[%d]: sidescan  ", i);
-		if (process.mbp_cut_mode[i] == MBP_CUT_MODE_NUMBER)
-		    fprintf(stderr, "  number   ");
-		else if (process.mbp_cut_kind[i] == MBP_CUT_MODE_DISTANCE)
-		    fprintf(stderr, "  distance ");
-		fprintf(stderr, "  %f %f\n", process.mbp_cut_min[i], process.mbp_cut_max[i]);
-		}
-
-	    fprintf(stderr,"\nBathymetry Editing:\n");
-	    if (process.mbp_edit_mode == MBP_EDIT_ON)
-		fprintf(stderr,"  Bathymetry edits applied from file.\n");
-	    else
-		fprintf(stderr,"  Bathymetry edits not applied from file.\n");
-	    fprintf(stderr,"  Bathymetry edit file:          %s\n", process.mbp_editfile);
-
-	    fprintf(stderr,"\nBathymetry Recalculation:\n");
-	    if (process.mbp_bathrecalc_mode == MBP_BATHRECALC_OFF)
-		fprintf(stderr,"  Bathymetry not recalculated.\n");
-	    else if (process.mbp_bathrecalc_mode == MBP_BATHRECALC_RAYTRACE)
-		fprintf(stderr,"  Bathymetry recalculated by raytracing.\n");
-	    else if (process.mbp_bathrecalc_mode == MBP_BATHRECALC_ROTATE)
-		fprintf(stderr,"  Bathymetry recalculated by rigid rotation.\n");
-	    else if (process.mbp_bathrecalc_mode == MBP_BATHRECALC_OFFSET)
-		fprintf(stderr,"  Bathymetry recalculated by transducer depth shift.\n");
-	    fprintf(stderr,"  SVP file:                      %s\n", process.mbp_svpfile);
-	    if (process.mbp_ssv_mode == MBP_SSV_OFF)
-		fprintf(stderr,"  SSV not modified.\n");
-	    else if (process.mbp_ssv_mode == MBP_SSV_OFFSET)
-		fprintf(stderr,"  SSV offset by constant.\n");
-	    else
-		fprintf(stderr,"  SSV set to constant.\n");
-	    fprintf(stderr,"  SSV offset/constant:           %f m/s\n", process.mbp_ssv);
-	    fprintf(stderr,"  Travel time mode:              %d\n", process.mbp_tt_mode);
-	    fprintf(stderr,"  Travel time multiplier:        %f\n", process.mbp_tt_mult);
-	    fprintf(stderr,"  Raytrace angle mode:           %d\n", process.mbp_angle_mode);
-
-	    fprintf(stderr,"\nBathymetry Water Sound Speed Reference:\n");
-	    if (process.mbp_corrected == MB_YES)
-		fprintf(stderr,"  Output bathymetry reference:   CORRECTED\n");
-	    else if (process.mbp_corrected == MB_NO)
-		fprintf(stderr,"  Bathymetry reference:          UNCORRECTED\n");
-	    if (process.mbp_svp_mode == MBP_SVP_SOUNDSPEEDREF)
-		{
-		if (process.mbp_corrected == MB_YES)
-		    fprintf(stderr,"  Depths modified from uncorrected to corrected\n");
-		else
-		    fprintf(stderr,"  Depths modified from corrected to uncorrected\n");
-		}
-	    else if (process.mbp_svp_mode == MBP_SVP_ON)
-		{
-		if (process.mbp_corrected == MB_YES)
-		    fprintf(stderr,"  Depths recalculated as corrected\n");
-		else
-		    fprintf(stderr,"  Depths recalculated as uncorrected\n");
-		}
-	    else
-		{
-		fprintf(stderr,"  Depths unmodified with respect to water sound speed reference\n");
-		}
-
-	    fprintf(stderr,"\nDraft Correction:\n");
-	    if (process.mbp_draft_mode == MBP_DRAFT_OFF)
-		fprintf(stderr,"  Draft not modified.\n");
-	    else if (process.mbp_draft_mode == MBP_DRAFT_SET)
-		fprintf(stderr,"  Draft set to constant.\n");
-	    else if (process.mbp_draft_mode == MBP_DRAFT_OFFSET)
-		fprintf(stderr,"  Draft offset by constant.\n");
-	    else if (process.mbp_draft_mode == MBP_DRAFT_MULTIPLY)
-		fprintf(stderr,"  Draft multiplied by constant.\n");
-	    else if (process.mbp_draft_mode == MBP_DRAFT_MULTIPLYOFFSET)
-		fprintf(stderr,"  Draft multiplied and offset by constants.\n");
-	    fprintf(stderr,"  Draft constant:                %f m\n", process.mbp_draft);
-	    fprintf(stderr,"  Draft offset:                  %f m\n", process.mbp_draft_offset);
-	    fprintf(stderr,"  Draft multiplier:              %f m\n", process.mbp_draft_mult);
-
-	    fprintf(stderr,"\nHeave Correction:\n");
-	    if (process.mbp_heave_mode == MBP_HEAVE_OFF)
-		fprintf(stderr,"  Heave not modified.\n");
-	    else if (process.mbp_heave_mode == MBP_HEAVE_OFFSET)
-		fprintf(stderr,"  Heave offset by constant.\n");
-	    else if (process.mbp_heave_mode == MBP_HEAVE_MULTIPLY)
-		fprintf(stderr,"  Heave multiplied by constant.\n");
-	    else if (process.mbp_heave_mode == MBP_HEAVE_MULTIPLYOFFSET)
-		fprintf(stderr,"  Heave multiplied and offset by constants.\n");
-	    fprintf(stderr,"  Heave offset:                  %f m\n", process.mbp_heave);
-	    fprintf(stderr,"  Heave multiplier:              %f m\n", process.mbp_heave_mult);
-
-	    fprintf(stderr,"\nLever Correction:\n");
-	    if (process.mbp_lever_mode == MBP_LEVER_OFF)
-		fprintf(stderr,"  Lever calculation off.\n");
-	    else
-		{
-		fprintf(stderr,"  Lever calculation used to calculate heave correction.\n");
-	    	fprintf(stderr,"  Heave offset:                  %f m\n", process.mbp_heave);
-	    	fprintf(stderr,"  VRU offset x:                  %f m\n", process.mbp_vru_offsetx);
-	    	fprintf(stderr,"  VRU offset y:                  %f m\n", process.mbp_vru_offsety);
-	    	fprintf(stderr,"  VRU offset z:                  %f m\n", process.mbp_vru_offsetz);
-	    	fprintf(stderr,"  Sonar offset x:                %f m\n", process.mbp_sonar_offsetx);
-	    	fprintf(stderr,"  Sonar offset y:                %f m\n", process.mbp_sonar_offsety);
-	    	fprintf(stderr,"  Sonar offset z:                %f m\n", process.mbp_sonar_offsetz);
-		}
-
-	    fprintf(stderr,"\nTide Correction:\n");
-	    if (process.mbp_tide_mode == MBP_TIDE_OFF)
-		fprintf(stderr,"  Tide calculation off.\n");
-	    else
-		{
-		fprintf(stderr,"  Tide correction applied to bathymetry.\n");
-	    	fprintf(stderr,"  Tide file:                     %s\n", process.mbp_tidefile);
-	    	fprintf(stderr,"  Tide format:                   %d\n", process.mbp_tide_format);
- 		}
-
-	    fprintf(stderr,"\nRoll Correction:\n");
-	    if (process.mbp_rollbias_mode == MBP_ROLLBIAS_OFF)
-		fprintf(stderr,"  Roll not modified.\n");
-	    else if (process.mbp_rollbias_mode == MBP_ROLLBIAS_SINGLE)
-		fprintf(stderr,"  Roll offset by bias.\n");
-	    else if (process.mbp_rollbias_mode == MBP_ROLLBIAS_DOUBLE)
-		fprintf(stderr,"  Roll offset by separate port and starboard biases.\n");
-	    fprintf(stderr,"  Roll bias:                     %f deg\n", process.mbp_rollbias);
-	    fprintf(stderr,"  Port roll bias:                %f deg\n", process.mbp_rollbias_port);
-	    fprintf(stderr,"  Starboard roll bias:           %f deg\n", process.mbp_rollbias_stbd);
-
-	    fprintf(stderr,"\nPitch Correction:\n");
-	    if (process.mbp_pitchbias_mode == MBP_PITCHBIAS_OFF)
-		fprintf(stderr,"  Pitch not modified.\n");
-	    else
-		fprintf(stderr,"  Pitch offset by bias.\n");
-	    fprintf(stderr,"  Pitch bias:                    %f deg\n", process.mbp_pitchbias);
-
-	    fprintf(stderr,"\nHeading Correction:\n");
-	    if (process.mbp_heading_mode == MBP_HEADING_OFF)
-		fprintf(stderr,"  Heading not modified.\n");
-	    else if (process.mbp_heading_mode == MBP_HEADING_CALC)
-		fprintf(stderr,"  Heading replaced by course-made-good.\n");
-	    else if (process.mbp_heading_mode == MBP_HEADING_OFFSET)
-		fprintf(stderr,"  Heading offset by bias.\n");
-	    else if (process.mbp_heading_mode == MBP_HEADING_CALCOFFSET)
-		fprintf(stderr,"  Heading replaced by course-made-good and then offset by bias.\n");
-	    fprintf(stderr,"  Heading offset:                %f deg\n", process.mbp_headingbias);
-
-	    fprintf(stderr,"\nAmplitude Corrections:\n");
-	    if (process.mbp_ampcorr_mode == MBP_SSCORR_ON)
-		{
-		fprintf(stderr,"  Amplitude vs grazing angle corrections applied to amplitudes.\n");
-	    	fprintf(stderr,"  Amplitude correction file:      %s m\n", process.mbp_ampcorrfile);
-		if (process.mbp_ampcorr_type == MBP_AMPCORR_SUBTRACTION)
-	    		fprintf(stderr,"  Amplitude correction by subtraction (dB scale)\n");
-		else
-	    		fprintf(stderr,"  Amplitude correction by division (linear scale)\n");
-		if (process.mbp_ampcorr_symmetry == MBP_AMPCORR_SYMMETRIC)
-	    		fprintf(stderr,"  AVGA tables forced to be symmetric\n");
-		else
-	    		fprintf(stderr,"  AVGA tables allowed to be asymmetric\n");
-	    	fprintf(stderr,"  Reference grazing angle:       %f deg\n", process.mbp_ampcorr_angle);
-		if (process.mbp_ampcorr_slope == MBP_AMPCORR_IGNORESLOPE)
-	    		fprintf(stderr,"  Amplitude correction ignores seafloor slope\n");
-		else if (process.mbp_ampcorr_slope == MBP_AMPCORR_USESLOPE)
-	    		fprintf(stderr,"  Amplitude correction uses seafloor slope\n");
-		else
-	    		{
-			fprintf(stderr,"  Amplitude correction uses topography grid for slope\n");
-	    		fprintf(stderr,"  Topography grid file:      %s m\n", process.mbp_ampsscorr_topofile);
-			}
- 		}
-	    else
-		fprintf(stderr,"  Amplitude correction off.\n");
-
-	    fprintf(stderr,"\nSidescan Corrections:\n");
-	    if (process.mbp_sscorr_mode == MBP_SSCORR_ON)
-		{
-		fprintf(stderr,"  Amplitude vs grazing angle corrections applied to sidescan.\n");
-	    	fprintf(stderr,"  Sidescan correction file:      %s m\n", process.mbp_sscorrfile);
-		if (process.mbp_sscorr_type == MBP_SSCORR_SUBTRACTION)
-	    		fprintf(stderr,"  Sidescan correction by subtraction (dB scale)\n");
-		else
-	    		fprintf(stderr,"  Sidescan correction by division (linear scale)\n");
-		if (process.mbp_sscorr_symmetry == MBP_SSCORR_SYMMETRIC)
-	    		fprintf(stderr,"  AVGA tables forced to be symmetric\n");
-		else
-	    		fprintf(stderr,"  AVGA tables allowed to be asymmetric\n");
-	    	fprintf(stderr,"  Reference grazing angle:       %f deg\n", process.mbp_sscorr_angle);
-		if (process.mbp_sscorr_slope == MBP_SSCORR_IGNORESLOPE)
-	    		fprintf(stderr,"  Sidescan correction ignores seafloor slope\n");
-		else if (process.mbp_ampcorr_slope == MBP_SSCORR_USESLOPE)
-	    		fprintf(stderr,"  Sidescan correction uses seafloor slope\n");
-		else
-	    		{
-			fprintf(stderr,"  Sidescan correction uses topography grid for slope\n");
-	    		fprintf(stderr,"  Topography grid file:      %s m\n", process.mbp_ampsscorr_topofile);
-			}
- 		}
-	    else
-		fprintf(stderr,"  Sidescan correction off.\n");
-
-	    fprintf(stderr,"\nSidescan Recalculation:\n");
-	    if (process.mbp_ssrecalc_mode == MBP_SSRECALC_ON)
-		fprintf(stderr,"  Sidescan recalculated.\n");
-	    else
-		fprintf(stderr,"  Sidescan not recalculated.\n");
-	    fprintf(stderr,"  Sidescan pixel size:           %f\n",process.mbp_ssrecalc_pixelsize);
-	    fprintf(stderr,"  Sidescan swath width:          %f\n",process.mbp_ssrecalc_swathwidth);
-	    fprintf(stderr,"  Sidescan interpolation:        %d\n",process.mbp_ssrecalc_interpolate);
-
-	    fprintf(stderr,"\nMetadata Insertion:\n");
-	    fprintf(stderr,"  Metadata vessel:               %s\n",process.mbp_meta_vessel);
-	    fprintf(stderr,"  Metadata institution:          %s\n",process.mbp_meta_institution);
-	    fprintf(stderr,"  Metadata platform:             %s\n",process.mbp_meta_platform);
-	    fprintf(stderr,"  Metadata sonar:                %s\n",process.mbp_meta_sonar);
-	    fprintf(stderr,"  Metadata sonarversion:         %s\n",process.mbp_meta_sonarversion);
-	    fprintf(stderr,"  Metadata cruiseid:             %s\n",process.mbp_meta_cruiseid);
-	    fprintf(stderr,"  Metadata cruisename:           %s\n",process.mbp_meta_cruisename);
-	    fprintf(stderr,"  Metadata pi:                   %s\n",process.mbp_meta_pi);
-	    fprintf(stderr,"  Metadata piinstitution:        %s\n",process.mbp_meta_piinstitution);
-	    fprintf(stderr,"  Metadata client:               %s\n",process.mbp_meta_client);
-	    fprintf(stderr,"  Metadata svcorrected:          %d\n",process.mbp_meta_svcorrected);
-	    fprintf(stderr,"  Metadata tidecorrected         %d\n",process.mbp_meta_tidecorrected);
-	    fprintf(stderr,"  Metadata batheditmanual        %d\n",process.mbp_meta_batheditmanual);
-	    fprintf(stderr,"  Metadata batheditauto:         %d\n",process.mbp_meta_batheditauto);
-	    fprintf(stderr,"  Metadata rollbias:             %f\n",process.mbp_meta_rollbias);
-	    fprintf(stderr,"  Metadata pitchbias:            %f\n",process.mbp_meta_pitchbias);
-	    fprintf(stderr,"  Metadata headingbias:          %f\n",process.mbp_meta_headingbias);
-	    fprintf(stderr,"  Metadata draft:                %f\n",process.mbp_meta_draft);
-
-	    fprintf(stderr,"\nProcessing Kluges:\n");
-	    fprintf(stderr,"  Kluge001:                      %d\n",process.mbp_kluge001);
-	    fprintf(stderr,"  Kluge002:                      %d\n",process.mbp_kluge002);
-	    fprintf(stderr,"  Kluge003:                      %d\n",process.mbp_kluge003);
-	    fprintf(stderr,"  Kluge004:                      %d\n",process.mbp_kluge004);
-	    fprintf(stderr,"  Kluge005:                      %d\n",process.mbp_kluge005);
-	    fprintf(stderr,"  Kluge006:                      %d\n",process.mbp_kluge006);
-	    fprintf(stderr,"  Kluge007:                      %d\n",process.mbp_kluge007);
-	    fprintf(stderr,"  Kluge008:                      %d\n",process.mbp_kluge008);
-	    fprintf(stderr,"  Kluge009:                      %d\n",process.mbp_kluge009);
-	    fprintf(stderr,"  Kluge010:                      %d\n",process.mbp_kluge010);
-	    }
-
-	/* write parameters */
-	if (write_parameter_file == MB_YES)
-		status = mb_pr_writepar(verbose, mbp_ifile,
-			&process, &error);
-
-	/* output results */
-	if (status == MB_SUCCESS)
-		{
-		fprintf(stderr, "Success updating parameter file for %s...\n", mbp_ifile);
-		}
-	else
-		{
-		fprintf(stderr, "Failure to update parameter file for %s!!!\n", mbp_ifile);
-		}
-
-	/* figure out whether and what to read next */
-        if (read_datalist == MB_YES)
-                {
-		if ((status = mb_datalist_read(verbose,datalist,
-			    mbp_ifile,&format,&file_weight,&error))
-			    == MB_SUCCESS)
-                        read_data = MB_YES;
-                else
-                        read_data = MB_NO;
-                }
-        else
-                {
-                read_data = MB_NO;
-                }
-
-	} /* end loop over datalist */
-
-	if (read_datalist == MB_YES)
-		mb_datalist_close(verbose,&datalist,&error);
-
-	/* check memory */
-	if (verbose >= 4)
-		status = mb_memory_list(verbose,&error);
-
-	/* end it all */
-	exit(error);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/utilities/mbsslayout.c b/src/utilities/mbsslayout.c
deleted file mode 100644
index b6954b9..0000000
--- a/src/utilities/mbsslayout.c
+++ /dev/null
@@ -1,3244 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbsslayout.c	1/8/2014
- *    $Id: mbsslayout.c 2235 2015-03-22 15:21:55Z caress $
- *
- *    Copyright (c) 2014-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * MBsslayout reads sidescan in raw time series form, lays the sidescan
- * out regularly sampled on a specified topography model, and outputs
- * the sidescan to format 71 (MBF_MBLDEOIH) files.
- *
- * Author:	D. W. Caress
- * Date:	April 21, 2014
- *
- */
-
-/* source file version string */
-static char version_id[] = "$Id: mbsslayout.c 2235 2015-03-22 15:21:55Z caress $";
-
-/* standard include files */
-#include <stdio.h>
-#include <stdlib.h>
-#include <getopt.h>
-#include <unistd.h>
-#include <math.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-
-/* MBIO include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_define.h"
-#include "mb_io.h"
-#include "mb_aux.h"
-#include "mbsys_ldeoih.h"
-
-/* local defines */
-#define MBSSLAYOUT_ALLOC_CHUNK 			1024
-#define MBSSLAYOUT_ALLOC_NUM			128
-
-#define	MBSSLAYOUT_LINE_OFF			0
-#define	MBSSLAYOUT_LINE_TIME			1
-#define	MBSSLAYOUT_LINE_ROUTE			2
-
-#define MBSSLAYOUT_LAYOUT_FLATBOTTOM		0
-#define MBSSLAYOUT_LAYOUT_3DTOPO		1
-#define MBSSLAYOUT_ALTITUDE_ALTITUDE		0
-#define MBSSLAYOUT_ALTITUDE_BOTTOMPICK		1
-#define MBSSLAYOUT_ALTITUDE_TOPO_GRID		2
-#define MBSSLAYOUT_GAIN_OFF			0
-#define MBSSLAYOUT_GAIN_TVG			1
-#define	MBSSLAYOUT_SWATHWIDTH_VARIABLE		0
-#define	MBSSLAYOUT_SWATHWIDTH_CONSTANT		1
-
-#define MBSSLAYOUT_MERGE_OFF 			0
-#define MBSSLAYOUT_MERGE_FILE 			1
-#define MBSSLAYOUT_MERGE_ASYNC 			2
-
-#define MBSSLAYOUT_TIMESHIFT_OFF 		0
-#define MBSSLAYOUT_TIMESHIFT_FILE 		1
-#define MBSSLAYOUT_TIMESHIFT_CONSTANT 2
-#define MBSSLAYOUT_TIMESHIFT_APPLY_NONE		0x00
-#define MBSSLAYOUT_TIMESHIFT_APPLY_NAV		0x01
-#define MBSSLAYOUT_TIMESHIFT_APPLY_SENSORDEPTH	0x02
-#define MBSSLAYOUT_TIMESHIFT_APPLY_ALTITUDE	0x04
-#define MBSSLAYOUT_TIMESHIFT_APPLY_HEADING		0x08
-#define MBSSLAYOUT_TIMESHIFT_APPLY_ATTITUDE		0x10
-#define MBSSLAYOUT_TIMESHIFT_APPLY_SOUNDSPEED		0x20
-#define MBSSLAYOUT_TIMESHIFT_APPLY_UNUSED		0x40
-#define MBSSLAYOUT_TIMESHIFT_APPLY_ALL_ANCILLIARY	0x7F
-#define MBSSLAYOUT_TIMESHIFT_APPLY_SURVEY		0x80
-#define MBSSLAYOUT_TIMESHIFT_APPLY_ALL		0xFF
-
-#define MBSSLAYOUT_ROUTE_WAYPOINT_NONE		0
-#define MBSSLAYOUT_ROUTE_WAYPOINT_SIMPLE		1
-#define MBSSLAYOUT_ROUTE_WAYPOINT_TRANSIT		2
-#define MBSSLAYOUT_ROUTE_WAYPOINT_STARTLINE	3
-#define MBSSLAYOUT_ROUTE_WAYPOINT_ENDLINE		4
-#define MBSSLAYOUT_ONLINE_THRESHOLD		15.0
-#define MBSSLAYOUT_ONLINE_COUNT			30
-
-#define MBSSLAYOUT_SSDIMENSION			4001
-
-#define	MBSSLAYOUT_NUM_ANGLES			171
-#define	MBSSLAYOUT_ANGLE_MAX			85.0
-
-int mbsslayout_get_flatbottom_table(int verbose, int nangle, double angle_min, double angle_max,
-					double navlon, double navlat, double altitude, double pitch,
-					double *table_angle, double *table_xtrack, double *table_ltrack,
-					double *table_altitude, double *table_range,
-					int *error);
-
-/*--------------------------------------------------------------------*/
-
-int main (int argc, char **argv)
-{
-	char program_name[] = "mbsslayout";
-	char help_message[] =  "MBsslayout reads sidescan in raw time series form, lays the sidescan \nout regularly sampled on a specified topography model, and outputs \n the sidescan to format 71 (MBF_MBLDEOIH) files.\n";
-	char usage_message[] = "mbsslayout [--verbose --help --input=datalist --format=format";
-	extern char *optarg;
-	int	option_index;
-	int	errflg = 0;
-	int	c;
-	int	help = 0;
-
-	/* MBIO status variables */
-	int	status = MB_SUCCESS;
-	int	verbose = 0;
-	int	error = MB_ERROR_NO_ERROR;
-	char	*message;
-
-	/* command line option definitions */
-	/* mbsslayout --verbose
-	 * 		--help
-	 * 		--input=datalist
-	 * 		--format=format
-	 * 		
-	 * 		--output_source=record_kind
-	 * 		--output_name1=name
-	 * 		--output_name2=name
-	 * 		
-	 * 		--line_nameroot=name
-	 * 		--line_time_list=filename
-	 * 		--line_route=filename
-	 * 		--line_check_bearing
-	 * 		--line_range_threshold=value
-	 *
-	 * 		--topo_grid_file=filename
-	 * 		--altitude_altitude
-	 * 		--altitude_bottomppick
-	 * 		--altitude_bottompick_threshold=value
-	 * 		--altitude_topo_grid
-	 * 		--channel_swap
-	 * 		--swath_width=value
-	 * 		--gain=value
-	 * 		--interpolation=value
-	 * 		
-	 * 		--nav_file=filename
-	 * 		--nav_file_format=format_id
-	 * 		--nav_async=record_kind
-	 * 		--sensordepth_file=filename
-	 * 		--sensordepth_file_format=format_id
-	 * 		--sensordepth_async=record_kind
-	 * 		--altitude_file=filename
-	 * 		--altitude_file_format=format_id
-	 * 		--altitude_async=record_kind
-	 * 		--heading_file=filename
-	 * 		--heading_file_format=format_id
-	 * 		--heading_async=record_kind
-	 * 		--attitude_file=filename
-	 * 		--attitude_file_format=format_id
-	 * 		--attitude_async=record_kind
-	 * 		--soundspeed_constant=value
-	 * 		--soundspeed_file=filename
-	 * 		--soundspeed_file_format=format_id
-	 * 		--soundspeed_async=record_kind
-	 * 		--timeshift_file=filename
-	 * 		--timeshift_constant=value
-	 * 		--timeshift_apply_nav
-	 * 		--timeshift_apply_sensordepth
-	 * 		--timeshift_apply_altitude
-	 * 		--timeshift_apply_heading
-	 * 		--timeshift_apply_attitude
-	 * 		--timeshift_apply_all_ancilliary
-	 * 		--timeshift_apply_survey
-	 * 		--timeshift_apply_all
-	 * 		--sensor_offsets=filename
-	 */
-	static struct option options[] =
-		{
-		{"verbose",			no_argument, 		NULL, 		0},
-		{"help",			no_argument, 		NULL, 		0},
-		{"verbose",			no_argument, 		NULL, 		0},
-		{"input",			required_argument, 	NULL, 		0},
-		{"format",			required_argument, 	NULL, 		0},
-		{"output_source",		required_argument, 	NULL, 		0},
-		{"output_name1",		required_argument, 	NULL, 		0},
-		{"output_name2",		required_argument, 	NULL, 		0},
-		{"line_time_list",		required_argument, 	NULL, 		0},
-		{"line_position_list",		required_argument, 	NULL, 		0},
-		{"line_check_bearing",		no_argument, 		NULL, 		0},
-		{"line_range_threshold",	required_argument, 	NULL, 		0},
-		{"topo_grid_file",		required_argument, 	NULL, 		0},
-		{"altitude_altitude",		no_argument, 		NULL, 		0},
-		{"altitude_bottomppick",	no_argument, 		NULL, 		0},
-		{"altitude_topo_grid",		no_argument, 		NULL, 		0},
-		{"bottompick_threshold",	required_argument, 	NULL, 		0},
-		{"channel_swap",		required_argument, 	NULL, 		0},
-		{"swath_width",			required_argument, 	NULL, 		0},
-		{"gain",			required_argument, 	NULL, 		0},
-		{"interpolation",		required_argument, 	NULL, 		0},
-		{"nav_file",			required_argument, 	NULL, 		0},
-		{"nav_file_format",		required_argument, 	NULL, 		0},
-		{"nav_async",			required_argument, 	NULL, 		0},
-		{"sensordepth_file",		required_argument, 	NULL, 		0},
-		{"sensordepth_file_format",	required_argument, 	NULL, 		0},
-		{"sensordepth_async",		required_argument, 	NULL, 		0},
-		{"altitude_file",		required_argument, 	NULL, 		0},
-		{"altitude_file_format",	required_argument, 	NULL, 		0},
-		{"altitude_async",		required_argument, 	NULL, 		0},
-		{"heading_file",		required_argument, 	NULL, 		0},
-		{"heading_file_format",		required_argument, 	NULL, 		0},
-		{"heading_async",		required_argument, 	NULL, 		0},
-		{"attitude_file",		required_argument, 	NULL, 		0},
-		{"attitude_file_format",	required_argument, 	NULL, 		0},
-		{"attitude_async",		required_argument, 	NULL, 		0},
-		{"soundspeed_constant",		required_argument, 	NULL, 		0},
-		{"soundspeed_file",		required_argument, 	NULL, 		0},
-		{"soundspeed_file_format",	required_argument, 	NULL, 		0},
-		{"soundspeed_async",		required_argument, 	NULL, 		0},
-		{"timeshift_file",		required_argument, 	NULL, 		0},
-		{"timeshift_constant",		required_argument, 	NULL, 		0},
-		{"timeshift_apply_nav",		no_argument, 		NULL, 		0},
-		{"timeshift_apply_sensordepth",	no_argument, 		NULL, 		0},
-		{"timeshift_apply_altitude",	no_argument, 		NULL, 		0},
-		{"timeshift_apply_heading",	no_argument, 		NULL, 		0},
-		{"timeshift_apply_attitude",	no_argument, 		NULL, 		0},
-		{"timeshift_apply_all_ancilliary",	no_argument, 	NULL, 		0},
-		{"timeshift_apply_survey",	no_argument, 		NULL, 		0},
-		{"timeshift_apply_all",		no_argument, 		NULL, 		0},
-		{"sensor_offsets",		required_argument, 	NULL, 		0},
-		{NULL,				0, 			NULL, 		0}
-		};
-		
-	/* output variables */
-	int	output_source = MB_DATA_NONE;
-	mb_path	output_name1 = "Survey";
-	mb_path	output_name2 = "sidescan";
-	
-	/* survey line variables */
-	int	line_mode = MBSSLAYOUT_LINE_OFF;
-	mb_path	line_time_list;
-	mb_path	line_route;
-	int	line_check_bearing = MB_NO;
-	double	line_range_threshold = 50.0;
-	
-	/* sidescan layout variables */
-	int	layout_mode = MBSSLAYOUT_LAYOUT_FLATBOTTOM;
-	int	ss_altitude_mode = MBSSLAYOUT_ALTITUDE_ALTITUDE;
-	mb_path	topo_grid_file;
-	double	bottompick_threshold = 0.5;
-	int	channel_swap = MB_NO;
-	int	swath_mode = MBSSLAYOUT_SWATHWIDTH_VARIABLE;
-	double	swath_width = 0.0;
-	int	gain_mode = MBSSLAYOUT_GAIN_OFF;
-	double	gain = 1.0;
-	int	interpolation = 0;
-	
-	/* asynchronous navigation, heading, attitude data */
-	int	nav_mode = MBSSLAYOUT_MERGE_OFF;
-	mb_path	nav_file;
-	int	nav_file_format = 0;
-	int	nav_async = MB_DATA_DATA;
-	int	nav_num = 0;
-	int	nav_alloc = 0;
-	double	*nav_time_d = NULL;
-	double	*nav_navlon = NULL;
-	double	*nav_navlat = NULL;
-	double	*nav_speed = NULL;
-
-	int	sensordepth_mode = MBSSLAYOUT_MERGE_OFF;
-	mb_path	sensordepth_file;
-	int	sensordepth_file_format = 0;
-	int	sensordepth_async = MB_DATA_DATA;
-	int	sensordepth_num = 0;
-	int	sensordepth_alloc = 0;
-	double	*sensordepth_time_d = NULL;
-	double	*sensordepth_sensordepth = NULL;
-
-	int	altitude_mode = MBSSLAYOUT_MERGE_OFF;
-	mb_path	altitude_file;
-	int	altitude_file_format = 0;
-	int	altitude_async = MB_DATA_DATA;
-	int	altitude_num = 0;
-	int	altitude_alloc = 0;
-	double	*altitude_time_d = NULL;
-	double	*altitude_altitude = NULL;
-
-	int	heading_mode = MBSSLAYOUT_MERGE_OFF;
-	mb_path	heading_file;
-	int	heading_file_format = 0;
-	int	heading_async = MB_DATA_DATA;
-	int	heading_num = 0;
-	int	heading_alloc = 0;
-	double	*heading_time_d = NULL;
-	double	*heading_heading = NULL;
-
-	int	attitude_mode = MBSSLAYOUT_MERGE_OFF;
-	mb_path	attitude_file;
-	int	attitude_file_format = 0;
-	int	attitude_async = MB_DATA_DATA;
-	int	attitude_num = 0;
-	int	attitude_alloc = 0;
-	double	*attitude_time_d = NULL;
-	double	*attitude_roll = NULL;
-	double	*attitude_pitch = NULL;
-	double	*attitude_heave = NULL;
-
-	int	soundspeed_mode = MBSSLAYOUT_MERGE_OFF;
-	double	soundspeed_constant = 1500.0;
-	mb_path	soundspeed_file;
-	int	soundspeed_file_format = 0;
-	int	soundspeed_async = MB_DATA_DATA;
-	int	soundspeed_num = 0;
-	int	soundspeed_alloc = 0;
-	double	*soundspeed_time_d = NULL;
-	double	*soundspeed_soundspeed = NULL;
-
-	int	timeshift_mode = MBSSLAYOUT_TIMESHIFT_OFF;
-	mb_u_char timeshift_apply = MBSSLAYOUT_TIMESHIFT_APPLY_NONE;
-	mb_path	timeshift_file;
-	int	timeshift_format = 0;
-	int	timeshift_num = 0;
-	int	timeshift_alloc = 0;
-	double	*timeshift_time_d = NULL;
-	double	*timeshift_timeshift = NULL;
-	double	timeshift_constant = 0.0;
-
-	/* MBIO read control parameters */
-	int	read_datalist = MB_NO;
-	int	read_data;
-	mb_path	read_file;
-	mb_path	output_file;
-	void	*datalist;
-	int	look_processed = MB_DATALIST_LOOK_UNSET;
-	double	file_weight;
-	int	format = 0;
-	int	iformat;
-	int	pings;
-	int	lonflip;
-	double	bounds[4];
-	int	btime_i[7];
-	int	etime_i[7];
-	double	btime_d;
-	double	etime_d;
-	double	speedmin;
-	double	timegap;
-	mb_path	ifile;
-	mb_path	ofile;
-	int	beams_bath;
-	int	beams_amp;
-	int	pixels_ss;
-
-	/* MBIO read values */
-	void	*imbio_ptr = NULL;
-	void	*ombio_ptr = NULL;
-	struct mb_io_struct *omb_io_ptr;
-	void	*istore_ptr = NULL;
-	void	*ostore_ptr = NULL;
-	struct mbsys_ldeoih_struct *ostore;
-
-	int	kind;
-	int	time_i[7];
-	double	time_d;
-	double	navlon;
-	double	navlat;
-	double	speed;
-	double	heading;
-	double	distance;
-	double	altitude;
-	double	sensordraft;
-	double	sensordepth;
-	double	draft;
-	double	roll;
-	double	pitch;
-	double	heave;
-	double	soundspeed;
-	char	*beamflag = NULL;
-	double	*bath = NULL;
-	double	*bathacrosstrack = NULL;
-	double	*bathalongtrack = NULL;
-	double	*amp = NULL;
-	double	*ss = NULL;
-	double	*ssacrosstrack = NULL;
-	double	*ssalongtrack = NULL;
-	char	comment[MB_COMMENT_MAXLINE];
-	double	navlon_org;
-	double	navlat_org;
-	double	speed_org;
-	double	heading_org;
-	double	altitude_org;
-	double	sensordepth_org;
-	double	draft_org;
-	double	roll_org;
-	double	pitch_org;
-	double	heave_org;
-	double	ss_altitude;
-
-	/* arrays for asynchronous data accessed using mb_extract_nnav() */
-	int	nanavmax = MB_NAV_MAX;
-	int	nanav;
-	int	antime_i[7*MB_NAV_MAX];
-	double	antime_d[MB_NAV_MAX];
-	double	anlon[MB_NAV_MAX];
-	double	anlat[MB_NAV_MAX];
-	double	anspeed[MB_NAV_MAX];
-	double	anheading[MB_NAV_MAX];
-	double	ansensordraft[MB_NAV_MAX];
-	double	anroll[MB_NAV_MAX];
-	double	anpitch[MB_NAV_MAX];
-	double	anheave[MB_NAV_MAX];
-
-	/* arrays for asynchronous data accessed using mb_ctd() */
-	int	nactd;
-	double	actime_d[MB_CTD_MAX];
-	double	acconductivity[MB_CTD_MAX];
-	double	actemperature[MB_CTD_MAX];
-	double	acdepth[MB_CTD_MAX];
-	double	acsalinity[MB_CTD_MAX];
-	double	acsoundspeed[MB_CTD_MAX];
-	
-	/* raw sidescan */
-	int	sidescan_type = MB_SIDESCAN_LINEAR;
-	double	sample_interval;
-	double	beamwidth_xtrack = 0.0;
-	double	beamwidth_ltrack = 0.0;
-	int	num_samples_port = 0;
-	int	num_samples_port_alloc = 0;
-	double	*raw_samples_port = NULL;
-	int	num_samples_stbd = 0;
-	int	num_samples_stbd_alloc = 0;
-	double	*raw_samples_stbd = NULL;
-
-	/* bottom layout parameters */
-	int	nangle = MBSSLAYOUT_NUM_ANGLES;
-	double	angle_min = -MBSSLAYOUT_ANGLE_MAX;
-	double	angle_max = MBSSLAYOUT_ANGLE_MAX;
-	double	table_angle[MBSSLAYOUT_NUM_ANGLES];
-	double	table_xtrack[MBSSLAYOUT_NUM_ANGLES];
-	double	table_ltrack[MBSSLAYOUT_NUM_ANGLES];
-	double	table_altitude[MBSSLAYOUT_NUM_ANGLES];
-	double	table_range[MBSSLAYOUT_NUM_ANGLES];
-
-	/* output sidescan data */
-	int	obeams_bath;
-	int	obeams_amp;
-	int	opixels_ss;
-	double	oss[MBSSLAYOUT_SSDIMENSION];
-	double	ossacrosstrack[MBSSLAYOUT_SSDIMENSION];
-	double	ossalongtrack[MBSSLAYOUT_SSDIMENSION];
-	int	ossbincount[MBSSLAYOUT_SSDIMENSION];
-	double	pixel_width;
-	
-	/* counts of records read and written */
-	int	n_rf_data = 0;
-	int	n_rf_comment = 0;
-	int	n_rf_ss2 = 0;
-	int	n_rf_ss3 = 0;
-	int	n_rf_sbp = 0;
-	int	n_rf_nav = 0;
-	int	n_rf_nav1 = 0;
-	int	n_rf_nav2 = 0;
-	int	n_rf_nav3 = 0;
-	
-	int	n_rt_data = 0;
-	int	n_rt_comment = 0;
-	int	n_rt_ss2 = 0;
-	int	n_rt_ss3 = 0;
-	int	n_rt_sbp = 0;
-	int	n_rt_nav = 0;
-	int	n_rt_nav1 = 0;
-	int	n_rt_nav2 = 0;
-	int	n_rt_nav3 = 0;
-	
-	int	n_wf_data = 0;
-	int	n_wf_comment = 0;
-	int	n_wt_data = 0;
-	int	n_wt_comment = 0;
-	
-	mb_path	command;
-	int	interp_status = MB_SUCCESS;
-	int	interp_error = MB_ERROR_NO_ERROR;
-	int	shellstatus;
-	double	timeshift;
-	int	jsurvey = 0;
-	int	jnav = 0;
-	int	jsensordepth = 0;
-	int	jaltitude = 0;
-	int	jheading = 0;
-	int	jattitude = 0;
-	int	jsoundspeed = 0;
-	int	data_changed;
-	int	new_output_file = MB_NO;
-	int	rawroutefile = MB_NO;
-	int	oktowrite = MB_NO;
-	int	point_ok = MB_NO;
-	int	linechange = MB_NO;
-	int	line_number = 0;
-	int	nget;
-	int	waypoint;
-	int	activewaypoint = -1;
-	double	topo;
-	double	rangelast;
-	int	ntimepoint = 0;
-	int	ntimepointalloc = 0;
-	int	nroutepoint = 0;
-	int	nroutepointalloc = 0;
-	double	*routelon = NULL;
-	double	*routelat = NULL;
-	double	*routeheading = NULL;
-	double	*routetime_d = NULL;
-	int	*routewaypoint = NULL;
-	double	mtodeglon, mtodeglat;
-	void	*topogrid_ptr = NULL;
-	mb_path	scriptfile;
-	char	*result = NULL;
-	FILE	*fp, *sfp;
-	double	dx, dy, range;
-	double	channelmax, threshold, ttime;
-	int	portchannelpick, stbdchannelpick;
-	int	kangle, kstart;
-	double	xtrack, ltrack, rr, rangemin, factor, fraction;
-	int	done, found;
-	int	istart;
-	int	jport, jstbd;
-	int	previous, interpable;
-	double	dss, dssl;
-	
-	int	i, j, jj, n;
-
-	/* get current default values */
-	status = mb_defaults(verbose,&format,&pings,&lonflip,bounds,
-		btime_i,etime_i,&speedmin,&timegap);
-
-	/* set default input to datalist.mb-1 */
-	strcpy (read_file, "datalist.mb-1");
-
-	/* process argument list */
-	while ((c = getopt_long(argc, argv, "", options, &option_index)) != -1)
-	  switch (c)
-		{
-		/* long options all return c=0 */
-		case 0:
-			/* verbose */
-			if (strcmp("verbose", options[option_index].name) == 0)
-				{
-				verbose++;
-				}
-			
-			/* help */
-			else if (strcmp("help", options[option_index].name) == 0)
-				{
-				help = MB_YES;
-				}
-				
-			/*-------------------------------------------------------
-			 * Define input file and format (usually a datalist) */
-			
-			/* input */
-			else if (strcmp("input", options[option_index].name) == 0)
-				{
-				strcpy(read_file, optarg);
-				}
-			
-			/* format */
-			else if (strcmp("format", options[option_index].name) == 0)
-				{
-				n = sscanf(optarg, "%d", &format);
-				}
-				
-			/*-------------------------------------------------------
-			 * Define source data */
-			
-			/* output_source */
-			else if (strcmp("output_source", options[option_index].name) == 0)
-				{
-				n = sscanf(optarg, "%d", &output_source);
-				}
-			
-			/* output_name1 */
-			else if (strcmp("output_name1", options[option_index].name) == 0)
-				{
-				strcpy(output_name1, optarg);
-				}
-			
-			/* output_name2 */
-			else if (strcmp("output_name2", options[option_index].name) == 0)
-				{
-				strcpy(output_name2, optarg);
-				}
-												
-			/*-------------------------------------------------------
-			 * Define survey line specification */
-			
-			/* line_time_list */
-			else if (strcmp("line_time_list", options[option_index].name) == 0)
-				{
-				strcpy(line_time_list, optarg);
-				line_mode = MBSSLAYOUT_LINE_TIME;
-				}
-			
-			/* line_route */
-			else if (strcmp("line_route", options[option_index].name) == 0)
-				{
-				strcpy(line_route, optarg);
-				line_mode = MBSSLAYOUT_LINE_ROUTE;
-				}
-			
-			/* line_check_bearing */
-			else if (strcmp("line_check_bearing", options[option_index].name) == 0)
-				{
-				line_check_bearing = MB_YES;
-				}
-							
-			/*-------------------------------------------------------
-			 * Define sidescan layout algorithm parameters */
-			
-			/* topo_grid_file */
-			else if (strcmp("topo_grid_file", options[option_index].name) == 0)
-				{
-				strcpy(topo_grid_file, optarg);
-				layout_mode = MBSSLAYOUT_LAYOUT_3DTOPO;
-				}
-			
-			/* altitude_altitude */
-			else if (strcmp("altitude_altitude", options[option_index].name) == 0)
-				{
-				ss_altitude_mode = MBSSLAYOUT_ALTITUDE_ALTITUDE;
-				}
-			
-			/* altitude_bottomppick */
-			else if (strcmp("altitude_bottomppick", options[option_index].name) == 0)
-				{
-				ss_altitude_mode = MBSSLAYOUT_ALTITUDE_BOTTOMPICK;
-				}
-			
-			/* bottompick_threshold */
-			else if (strcmp("bottompick_threshold", options[option_index].name) == 0)
-				{
-				n = sscanf(optarg, "%lf", &bottompick_threshold);
-				ss_altitude_mode = MBSSLAYOUT_ALTITUDE_BOTTOMPICK;
-				}
-			
-			/* altitude_topo_grid */
-			else if (strcmp("altitude_topo_grid", options[option_index].name) == 0)
-				{
-				ss_altitude_mode = MBSSLAYOUT_ALTITUDE_TOPO_GRID;
-				}
-			
-			/* channel_swap */
-			else if (strcmp("channel_swap", options[option_index].name) == 0)
-				{
-				channel_swap = MB_YES;
-				}
-			
-			/* swath_width */
-			else if (strcmp("swath_width", options[option_index].name) == 0)
-				{
-				n = sscanf(optarg, "%lf", &swath_width);
-				swath_mode = MBSSLAYOUT_SWATHWIDTH_CONSTANT;
-				}
-			
-			/* gain */
-			else if (strcmp("gain", options[option_index].name) == 0)
-				{
-				n = sscanf(optarg, "%lf", &gain);
-				gain_mode = MBSSLAYOUT_GAIN_TVG;
-				}
-			
-			/* interpolation */
-			else if (strcmp("interpolation", options[option_index].name) == 0)
-				{
-				n = sscanf(optarg, "%d", &interpolation);
-				}
-			
-			/*-------------------------------------------------------
-			 * Define source of navigation - could be an external file
-			 * or an internal asynchronous record */
-			
-			/* nav_file */
-			else if (strcmp("nav_file", options[option_index].name) == 0)
-				{
-				strcpy(nav_file, optarg);
-				nav_mode = MBSSLAYOUT_MERGE_FILE;
-				}
-			
-			/* nav_file_format */
-			else if (strcmp("nav_file_format", options[option_index].name) == 0)
-				{
-				n = sscanf(optarg, "%d", &nav_file_format);
-				}
-			
-			/* nav_async */
-			else if (strcmp("nav_async", options[option_index].name) == 0)
-				{
-				n = sscanf(optarg, "%d", &nav_async);
-				if (n == 1)
-					nav_mode = MBSSLAYOUT_MERGE_ASYNC;
-				}
-				
-			/*-------------------------------------------------------
-			 * Define source of sensordepth - could be an external file
-			 * or an internal asynchronous record */
-			
-			/* sensordepth_file */
-			else if (strcmp("sensordepth_file", options[option_index].name) == 0)
-				{
-				strcpy(sensordepth_file, optarg);
-				sensordepth_mode = MBSSLAYOUT_MERGE_FILE;
-				}
-			
-			/* sensordepth_file_format */
-			else if (strcmp("sensordepth_file_format", options[option_index].name) == 0)
-				{
-				n = sscanf(optarg, "%d", &sensordepth_file_format);
-				}
-			
-			/* sensordepth_async */
-			else if (strcmp("sensordepth_async", options[option_index].name) == 0)
-				{
-				n = sscanf(optarg, "%d", &sensordepth_async);
-				if (n == 1)
-					sensordepth_mode = MBSSLAYOUT_MERGE_ASYNC;
-				}
-				
-			/*-------------------------------------------------------
-			 * Define source of altitude - could be an external file
-			 * or an internal asynchronous record */
-			
-			/* altitude_file */
-			else if (strcmp("altitude_file", options[option_index].name) == 0)
-				{
-				strcpy(altitude_file, optarg);
-				altitude_mode = MBSSLAYOUT_MERGE_FILE;
-				}
-			
-			/* altitude_file_format */
-			else if (strcmp("altitude_file_format", options[option_index].name) == 0)
-				{
-				n = sscanf(optarg, "%d", &altitude_file_format);
-				}
-			
-			/* altitude_async */
-			else if (strcmp("altitude_async", options[option_index].name) == 0)
-				{
-				n = sscanf(optarg, "%d", &altitude_async);
-				if (n == 1)
-					altitude_mode = MBSSLAYOUT_MERGE_ASYNC;
-				}
-				
-			/*-------------------------------------------------------
-			 * Define source of heading - could be an external file
-			 * or an internal asynchronous record */
-			
-			/* heading_file */
-			else if (strcmp("heading_file", options[option_index].name) == 0)
-				{
-				strcpy(heading_file, optarg);
-				heading_mode = MBSSLAYOUT_MERGE_FILE;
-				}
-			
-			/* heading_file_format */
-			else if (strcmp("heading_file_format", options[option_index].name) == 0)
-				{
-				n = sscanf(optarg, "%d", &heading_file_format);
-				}
-			
-			/* heading_async */
-			else if (strcmp("heading_async", options[option_index].name) == 0)
-				{
-				n = sscanf(optarg, "%d", &heading_async);
-				if (n == 1)
-					heading_mode = MBSSLAYOUT_MERGE_ASYNC;
-				}
-				
-			/*-------------------------------------------------------
-			 * Define source of attitude - could be an external file
-			 * or an internal asynchronous record */
-			
-			/* attitude_file */
-			else if (strcmp("attitude_file", options[option_index].name) == 0)
-				{
-				strcpy(attitude_file, optarg);
-				attitude_mode = MBSSLAYOUT_MERGE_FILE;
-				}
-			
-			/* attitude_file_format */
-			else if (strcmp("attitude_file_format", options[option_index].name) == 0)
-				{
-				n = sscanf(optarg, "%d", &attitude_file_format);
-				}
-			
-			/* attitude_async */
-			else if (strcmp("attitude_async", options[option_index].name) == 0)
-				{
-				n = sscanf(optarg, "%d", &attitude_async);
-				if (n == 1)
-					attitude_mode = MBSSLAYOUT_MERGE_ASYNC;
-				}
-				
-			/*-------------------------------------------------------
-			 * Define source of sound speed - could be an external file
-			 * or an internal asynchronous record */
-			
-			/* soundspeed_constant */
-			else if (strcmp("soundspeed_constant", options[option_index].name) == 0)
-				{
-				n = sscanf(optarg, "%lf", &soundspeed_constant);
-				soundspeed_mode = MBSSLAYOUT_MERGE_OFF;
-				}
-			
-			/* soundspeed_file */
-			else if (strcmp("soundspeed_file", options[option_index].name) == 0)
-				{
-				strcpy(soundspeed_file, optarg);
-				soundspeed_mode = MBSSLAYOUT_MERGE_FILE;
-				}
-			
-			/* soundspeed_file_format */
-			else if (strcmp("soundspeed_file_format", options[option_index].name) == 0)
-				{
-				n = sscanf(optarg, "%d", &soundspeed_file_format);
-				}
-			
-			/* soundspeed_async */
-			else if (strcmp("soundspeed_async", options[option_index].name) == 0)
-				{
-				n = sscanf(optarg, "%d", &soundspeed_async);
-				if (n == 1)
-					soundspeed_mode = MBSSLAYOUT_MERGE_ASYNC;
-				}
-				
-			/*-------------------------------------------------------
-			 * Define source of timeshift - could be an external file
-			 * or single value. Also define which data the timeshift model
-			 * will be applied to - nav, sensordepth, heading, attitude,
-			 * or all. */
-			
-			/* timeshift_file */
-			else if (strcmp("timeshift_file", options[option_index].name) == 0)
-				{
-				strcpy(timeshift_file, optarg);
-				timeshift_mode = MBSSLAYOUT_TIMESHIFT_FILE;
-				}
-			
-			/* timeshift_constant */
-			else if (strcmp("timeshift_constant", options[option_index].name) == 0)
-				{
-				n = sscanf(optarg, "%lf", &timeshift_constant);
-				if (n == 1)
-					timeshift_mode = MBSSLAYOUT_TIMESHIFT_CONSTANT;
-				}
-			
-			/* timeshift_apply_nav */
-			else if (strcmp("timeshift_apply_nav", options[option_index].name) == 0)
-				{
-				timeshift_apply =  timeshift_apply | MBSSLAYOUT_TIMESHIFT_APPLY_NAV;
-				}
-			
-			/* timeshift_apply_sensordepth */
-			else if (strcmp("timeshift_apply_sensordepth", options[option_index].name) == 0)
-				{
-				timeshift_apply =  timeshift_apply | MBSSLAYOUT_TIMESHIFT_APPLY_SENSORDEPTH;
-				}
-			
-			/* timeshift_apply_altitude */
-			else if (strcmp("timeshift_apply_altitude", options[option_index].name) == 0)
-				{
-				timeshift_apply =  timeshift_apply | MBSSLAYOUT_TIMESHIFT_APPLY_ALTITUDE;
-				}
-			
-			/* timeshift_apply_heading */
-			else if (strcmp("timeshift_apply_heading", options[option_index].name) == 0)
-				{
-				timeshift_apply =  timeshift_apply | MBSSLAYOUT_TIMESHIFT_APPLY_HEADING;
-				}
-			
-			/* timeshift_apply_attitude */
-			else if (strcmp("timeshift_apply_attitude", options[option_index].name) == 0)
-				{
-				timeshift_apply =  timeshift_apply | MBSSLAYOUT_TIMESHIFT_APPLY_ATTITUDE;
-				}
-			
-			/* timeshift_apply_soundspeed */
-			else if (strcmp("timeshift_apply_soundspeed", options[option_index].name) == 0)
-				{
-				timeshift_apply =  timeshift_apply | MBSSLAYOUT_TIMESHIFT_APPLY_SOUNDSPEED;
-				}
-			
-			/* timeshift_apply_all_ancilliary */
-			else if (strcmp("timeshift_apply_all_ancilliary", options[option_index].name) == 0)
-				{
-				timeshift_apply =  MBSSLAYOUT_TIMESHIFT_APPLY_ALL_ANCILLIARY;
-				}
-			
-			/* timeshift_apply_survey */
-			else if (strcmp("timeshift_apply_survey", options[option_index].name) == 0)
-				{
-				timeshift_apply =  MBSSLAYOUT_TIMESHIFT_APPLY_SURVEY;
-				}
-			
-			/* timeshift_apply_all */
-			else if (strcmp("timeshift_apply_all", options[option_index].name) == 0)
-				{
-				timeshift_apply =  MBSSLAYOUT_TIMESHIFT_APPLY_ALL;
-				}
-			
-			break;
-		case '?':
-			errflg++;
-		}
-
-	/* if error flagged then print it and exit */
-	if (errflg)
-		{
-		fprintf(stderr,"usage: %s\n", usage_message);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		error = MB_ERROR_BAD_USAGE;
-		exit(error);
-		}
-
-	/* print starting message */
-	if (verbose == 1 || help)
-		{
-		fprintf(stderr,"\nProgram %s\n",program_name);
-		fprintf(stderr,"Source File Version %s\n",version_id);
-		fprintf(stderr,"MB-system Version %s\n",MB_VERSION);
-		}
-
-	/* print starting debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  Program <%s>\n",program_name);
-		fprintf(stderr,"dbg2  Version %s\n",version_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Default MB-System Parameters:\n");
-		fprintf(stderr,"dbg2       verbose:                    %d\n",verbose);
-		fprintf(stderr,"dbg2       help:                       %d\n",help);
-		fprintf(stderr,"dbg2       pings:                      %d\n",pings);
-		fprintf(stderr,"dbg2       lonflip:                    %d\n",lonflip);
-		fprintf(stderr,"dbg2       bounds[0]:                  %f\n",bounds[0]);
-		fprintf(stderr,"dbg2       bounds[1]:                  %f\n",bounds[1]);
-		fprintf(stderr,"dbg2       bounds[2]:                  %f\n",bounds[2]);
-		fprintf(stderr,"dbg2       bounds[3]:                  %f\n",bounds[3]);
-		fprintf(stderr,"dbg2       btime_i[0]:                 %d\n",btime_i[0]);
-		fprintf(stderr,"dbg2       btime_i[1]:                 %d\n",btime_i[1]);
-		fprintf(stderr,"dbg2       btime_i[2]:                 %d\n",btime_i[2]);
-		fprintf(stderr,"dbg2       btime_i[3]:                 %d\n",btime_i[3]);
-		fprintf(stderr,"dbg2       btime_i[4]:                 %d\n",btime_i[4]);
-		fprintf(stderr,"dbg2       btime_i[5]:                 %d\n",btime_i[5]);
-		fprintf(stderr,"dbg2       btime_i[6]:                 %d\n",btime_i[6]);
-		fprintf(stderr,"dbg2       etime_i[0]:                 %d\n",etime_i[0]);
-		fprintf(stderr,"dbg2       etime_i[1]:                 %d\n",etime_i[1]);
-		fprintf(stderr,"dbg2       etime_i[2]:                 %d\n",etime_i[2]);
-		fprintf(stderr,"dbg2       etime_i[3]:                 %d\n",etime_i[3]);
-		fprintf(stderr,"dbg2       etime_i[4]:                 %d\n",etime_i[4]);
-		fprintf(stderr,"dbg2       etime_i[5]:                 %d\n",etime_i[5]);
-		fprintf(stderr,"dbg2       etime_i[6]:                 %d\n",etime_i[6]);
-		fprintf(stderr,"dbg2       speedmin:                   %f\n",speedmin);
-		fprintf(stderr,"dbg2       timegap:                    %f\n",timegap);
-		fprintf(stderr,"dbg2  Data Input Parameters:\n");
-		fprintf(stderr,"dbg2       read_file:                  %s\n",read_file);
-		fprintf(stderr,"dbg2       format:                     %d\n",format);
-		fprintf(stderr,"dbg2  Source Data Parameters:\n");
-		fprintf(stderr,"dbg2       output_source:              %d\n",output_source);
-		fprintf(stderr,"dbg2       output_name1:               %s\n",output_name1);
-		fprintf(stderr,"dbg2       output_name2:               %s\n",output_name2);
-		fprintf(stderr,"dbg2  Survey Line Parameters:\n");
-		fprintf(stderr,"dbg2       line_mode:                  %d\n",line_mode);
-		fprintf(stderr,"dbg2       line_time_list:             %s\n",line_time_list);
-		fprintf(stderr,"dbg2       line_route:                 %s\n",line_route);
-		fprintf(stderr,"dbg2       line_check_bearing:         %d\n",line_check_bearing);
-		fprintf(stderr,"dbg2       line_range_threshold:       %f\n",line_range_threshold);
-		fprintf(stderr,"dbg2  Sidescan Layout Algorithm Parameters:\n");
-		fprintf(stderr,"dbg2       layout_mode:                %d\n",layout_mode);
-		fprintf(stderr,"dbg2       topo_grid_file:             %s\n",topo_grid_file);
-		fprintf(stderr,"dbg2       ss_altitude_mode:           %d\n",ss_altitude_mode);
-		fprintf(stderr,"dbg2       bottompick_threshold:       %f\n",bottompick_threshold);
-		fprintf(stderr,"dbg2       channel_swap:               %d\n",channel_swap);
-		fprintf(stderr,"dbg2       swath_mode:                 %d\n",swath_mode);
-		fprintf(stderr,"dbg2       swath_width:                %f\n",swath_width);
-		fprintf(stderr,"dbg2       gain_mode:                  %d\n",gain_mode);
-		fprintf(stderr,"dbg2       gain:                       %f\n",gain);
-		fprintf(stderr,"dbg2       interpolation:              %d\n",interpolation);
-		fprintf(stderr,"dbg2  Navigation Source Parameters:\n");
-		fprintf(stderr,"dbg2       nav_mode:                   %d\n",nav_mode);
-		fprintf(stderr,"dbg2       nav_file:                   %s\n",nav_file);
-		fprintf(stderr,"dbg2       nav_file_format:            %d\n",nav_file_format);
-		fprintf(stderr,"dbg2       nav_async:                  %d\n",nav_async);
-		fprintf(stderr,"dbg2  Sensor Depth Source Parameters:\n");
-		fprintf(stderr,"dbg2       sensordepth_mode:           %d\n",sensordepth_mode);
-		fprintf(stderr,"dbg2       sensordepth_file:           %s\n",sensordepth_file);
-		fprintf(stderr,"dbg2       sensordepth_file_format:    %d\n",sensordepth_file_format);
-		fprintf(stderr,"dbg2       sensordepth_async:          %d\n",sensordepth_async);
-		fprintf(stderr,"dbg2  Altitude Source Parameters:\n");
-		fprintf(stderr,"dbg2       altitude_mode:              %d\n",altitude_mode);
-		fprintf(stderr,"dbg2       altitude_file:              %s\n",altitude_file);
-		fprintf(stderr,"dbg2       altitude_file_format:       %d\n",altitude_file_format);
-		fprintf(stderr,"dbg2       altitude_async:             %d\n",altitude_async);
-		fprintf(stderr,"dbg2  Heading Source Parameters:\n");
-		fprintf(stderr,"dbg2       heading_mode:               %d\n",heading_mode);
-		fprintf(stderr,"dbg2       heading_file:               %s\n",heading_file);
-		fprintf(stderr,"dbg2       heading_file_format:        %d\n",heading_file_format);
-		fprintf(stderr,"dbg2       heading_async:              %d\n",heading_async);
-		fprintf(stderr,"dbg2  Attitude Source Parameters:\n");
-		fprintf(stderr,"dbg2       attitude_mode:              %d\n",attitude_mode);
-		fprintf(stderr,"dbg2       attitude_file:              %s\n",attitude_file);
-		fprintf(stderr,"dbg2       attitude_file_format:       %d\n",attitude_file_format);
-		fprintf(stderr,"dbg2       attitude_async:             %d\n",attitude_async);
-		fprintf(stderr,"dbg2  Sound Speed Source Parameters:\n");
-		fprintf(stderr,"dbg2       soundspeed_mode:            %d\n",soundspeed_mode);
-		fprintf(stderr,"dbg2       soundspeed_constant:        %f\n",soundspeed_constant);
-		fprintf(stderr,"dbg2       soundspeed_file:            %s\n",soundspeed_file);
-		fprintf(stderr,"dbg2       soundspeed_file_format:     %d\n",soundspeed_file_format);
-		fprintf(stderr,"dbg2       soundspeed_async:           %d\n",soundspeed_async);
-		fprintf(stderr,"dbg2  Time Shift Source Parameters:\n");
-		fprintf(stderr,"dbg2       timeshift_mode:             %d\n",timeshift_mode);
-		fprintf(stderr,"dbg2       timeshift_file:             %s\n",timeshift_file);
-		fprintf(stderr,"dbg2       timeshift_format:           %d\n",timeshift_format);
-		fprintf(stderr,"dbg2       timeshift_constant:         %f\n",timeshift_constant);
-		fprintf(stderr,"dbg2       timeshift_apply:            %x\n",timeshift_apply);
-		}
-
-	/* if help desired then print it and exit */
-	if (help)
-		{
-		fprintf(stderr,"\n%s\n",help_message);
-		fprintf(stderr,"\nusage: %s\n", usage_message);
-		exit(error);
-		}
-		
-	/* print starting debug statements */
-	if (verbose == 1)
-		{
-		fprintf(stderr,"\nProgram <%s>\n",program_name);
-		fprintf(stderr,"Version %s\n",version_id);
-		fprintf(stderr,"MB-system Version %s\n\n",MB_VERSION);
-		fprintf(stderr,"Data Input Parameters:\n");
-		fprintf(stderr,"     read_file:                  %s\n",read_file);
-		fprintf(stderr,"     format:                     %d\n",format);
-		fprintf(stderr,"Output Channel Parameters:\n");
-		if (output_source != MB_DATA_NONE)
-			{
-			fprintf(stderr,"     output_source:            %d\n",output_source);
-			fprintf(stderr,"     output_name1:             %s\n",output_name1);
-			fprintf(stderr,"     output_name2:             %s\n",output_name2);
-			}
-		fprintf(stderr,"Survey Line Parameters:\n");
-		if (line_mode == MBSSLAYOUT_LINE_OFF)
-			{
-			fprintf(stderr,"     line_mode:                Data not recast into survey lines.\n");
-			}
-		else if (line_mode == MBSSLAYOUT_LINE_TIME)
-			{
-			fprintf(stderr,"     line_mode:                Lines defined by waypoint time list.\n");
-			fprintf(stderr,"     line_time_list:           %s\n",line_time_list);
-			fprintf(stderr,"     line_check_bearing:       %d\n",line_check_bearing);
-			
-			}
-		else if (line_mode == MBSSLAYOUT_LINE_ROUTE)
-			{
-			fprintf(stderr,"     line_mode:                Lines defined by route waypoint position list.\n");
-			fprintf(stderr,"     line_route:               %s\n",line_route);
-			fprintf(stderr,"     line_check_bearing:       %d\n",line_check_bearing);
-			}
-		fprintf(stderr,"Sidescan Layout Algorithm Parameters:\n");
-		if (layout_mode == MBSSLAYOUT_LAYOUT_FLATBOTTOM)
-			{
-			fprintf(stderr,"     layout_mode:              Flat bottom layout using altitude\n");	
-			}
-		else if (layout_mode == MBSSLAYOUT_LAYOUT_3DTOPO)
-			{
-			fprintf(stderr,"     layout_mode:              3D layout using topography model\n");	
-			fprintf(stderr,"     topo_grid_file:           %s\n",topo_grid_file);
-			}
-		if (ss_altitude_mode == MBSSLAYOUT_ALTITUDE_ALTITUDE)
-			{
-			fprintf(stderr,"     ss_altitude_mode:         Existing altitude value used\n");
-			}
-		else if (ss_altitude_mode == MBSSLAYOUT_ALTITUDE_BOTTOMPICK)
-			{
-			fprintf(stderr,"     ss_altitude_mode:         Altitude calculated using bottom pick in time series\n");
-			fprintf(stderr,"     bottompick_threshold:     %f\n",bottompick_threshold);
-			}
-		else if (layout_mode == MBSSLAYOUT_ALTITUDE_TOPO_GRID)
-			{
-			fprintf(stderr,"     ss_altitude_mode:         Altitude calculated during 3D layout on topography model\n");
-			}
-		if (channel_swap == MB_YES)
-			fprintf(stderr,"     channel_swap:             Swapping port and starboard\n");
-		else
-			fprintf(stderr,"     channel_swap:             No swap\n");
-		if (swath_mode == MBSSLAYOUT_SWATHWIDTH_CONSTANT)
-			{
-			fprintf(stderr,"     swath_mode:               Constant swath width\n");
-			fprintf(stderr,"     swath_width:              %f\n",swath_width);
-			}
-		else
-			{
-			fprintf(stderr,"     swath_mode:               Variable swath width\n");
-			}
-		if (gain_mode == MBSSLAYOUT_SWATHWIDTH_CONSTANT)
-			{
-			fprintf(stderr,"     gain_mode:                Gain applied\n");
-			fprintf(stderr,"     gain:                     %f\n",gain);
-			}
-		else
-			{
-			fprintf(stderr,"     gain_mode:                Gain not applied\n");
-			}
-		fprintf(stderr,"     interpolation:            %d\n",interpolation);
-		fprintf(stderr,"Navigation Source Parameters:\n");
-		if (nav_mode == MBSSLAYOUT_MERGE_OFF)
-			{
-			fprintf(stderr,"     nav_mode:                   No navigation merging\n");
-			}
-		else if (nav_mode == MBSSLAYOUT_MERGE_FILE)
-			{
-			fprintf(stderr,"     nav_mode:                   Navigation merged from external file\n");
-			fprintf(stderr,"     nav_file:                   %s\n",nav_file);
-			fprintf(stderr,"     nav_file_format:            %d\n",nav_file_format);
-			}
-		else if (nav_mode == MBSSLAYOUT_MERGE_ASYNC)
-			{
-			fprintf(stderr,"     nav_mode:                   Navigation merged from asynchronous data records\n");
-			fprintf(stderr,"     nav_async:                  %d\n",nav_async);
-			}
-
-		fprintf(stderr,"Sensor Depth Source Parameters:\n");
-		if (sensordepth_mode == MBSSLAYOUT_MERGE_OFF)
-			{
-			fprintf(stderr,"     sensordepth_mode:           No sensor depth merging\n");
-			}
-		else if (sensordepth_mode == MBSSLAYOUT_MERGE_FILE)
-			{
-			fprintf(stderr,"     sensordepth_mode:           Sensor depth merged from external file\n");
-			fprintf(stderr,"     sensordepth_file:           %s\n",sensordepth_file);
-			fprintf(stderr,"     sensordepth_file_format:    %d\n",sensordepth_file_format);
-			}
-		else if (sensordepth_mode == MBSSLAYOUT_MERGE_ASYNC)
-			{
-			fprintf(stderr,"     sensordepth_mode:           Sensor depth merged from asynchronous data records\n");
-			fprintf(stderr,"     sensordepth_async:          %d\n",sensordepth_async);
-			}
-
-		fprintf(stderr,"Altitude Source Parameters:\n");
-		if (altitude_mode == MBSSLAYOUT_MERGE_OFF)
-			{
-			fprintf(stderr,"     altitude_mode:              No altitude merging\n");
-			}
-		else if (altitude_mode == MBSSLAYOUT_MERGE_FILE)
-			{
-			fprintf(stderr,"     altitude_mode:              Altitude merged from external file\n");
-			fprintf(stderr,"     altitude_file:              %s\n",altitude_file);
-			fprintf(stderr,"     altitude_file_format:       %d\n",altitude_file_format);
-			}
-		else if (altitude_mode == MBSSLAYOUT_MERGE_ASYNC)
-			{
-			fprintf(stderr,"     altitude_mode:              Altitude merged from asynchronous data records\n");
-			fprintf(stderr,"     altitude_async:             %d\n",altitude_async);
-			}
-
-		fprintf(stderr,"Heading Source Parameters:\n");
-		if (heading_mode == MBSSLAYOUT_MERGE_OFF)
-			{
-			fprintf(stderr,"     heading_mode:               No heading merging\n");
-			}
-		else if (heading_mode == MBSSLAYOUT_MERGE_FILE)
-			{
-			fprintf(stderr,"     heading_mode:               Heading merged from external file\n");
-			fprintf(stderr,"     heading_file:               %s\n",heading_file);
-			fprintf(stderr,"     heading_file_format:        %d\n",heading_file_format);
-			}
-		else if (heading_mode == MBSSLAYOUT_MERGE_ASYNC)
-			{
-			fprintf(stderr,"     heading_mode:               Heading merged from asynchronous data records\n");
-			fprintf(stderr,"     heading_async:              %d\n",heading_async);
-			}
-
-		fprintf(stderr,"Attitude Source Parameters:\n");
-		if (attitude_mode == MBSSLAYOUT_MERGE_OFF)
-			{
-			fprintf(stderr,"     attitude_mode:              No attitude merging\n");
-			}
-		else if (attitude_mode == MBSSLAYOUT_MERGE_FILE)
-			{
-			fprintf(stderr,"     attitude_mode:              Attitude merged from external file\n");
-			fprintf(stderr,"     attitude_file:              %s\n",attitude_file);
-			fprintf(stderr,"     attitude_file_format:       %d\n",attitude_file_format);
-			}
-		else if (attitude_mode == MBSSLAYOUT_MERGE_ASYNC)
-			{
-			fprintf(stderr,"     attitude_mode:              Attitude merged from asynchronous data records\n");
-			fprintf(stderr,"     attitude_async:             %d\n",attitude_async);
-			}
-		fprintf(stderr,"Sound Speed Source Parameters:\n");
-		if (soundspeed_mode == MBSSLAYOUT_MERGE_OFF)
-			{
-			fprintf(stderr,"     soundspeed_mode:            No sound speed merging, constant value\n");
-			fprintf(stderr,"     soundspeed_constant:        %f meters/second\n",soundspeed_constant);
-			}
-		else if (soundspeed_mode == MBSSLAYOUT_MERGE_FILE)
-			{
-			fprintf(stderr,"     soundspeed_mode:            Sound speed merged from external file\n");
-			fprintf(stderr,"     soundspeed_file:            %s\n",soundspeed_file);
-			fprintf(stderr,"     soundspeed_file_format:     %d\n",soundspeed_file_format);
-			}
-		else if (soundspeed_mode == MBSSLAYOUT_MERGE_ASYNC)
-			{
-			fprintf(stderr,"     soundspeed_mode:            Sound speed merged from asynchronous data records\n");
-			fprintf(stderr,"     soundspeed_async:           %d\n",soundspeed_async);
-			}
-		fprintf(stderr,"Time Shift Source Parameters:\n");
-		if (timeshift_mode == MBSSLAYOUT_TIMESHIFT_OFF)
-			{
-			fprintf(stderr,"     timeshift_mode:             No time shift\n");
-			}
-		else if (timeshift_mode == MBSSLAYOUT_TIMESHIFT_FILE)
-			{
-			fprintf(stderr,"     timeshift_mode:             Time shift model read from external file\n");
-			fprintf(stderr,"     timeshift_file:             %s\n",timeshift_file);
-			fprintf(stderr,"     timeshift_format:           %d\n",timeshift_format);
-			}
-		else if (timeshift_mode == MBSSLAYOUT_TIMESHIFT_CONSTANT)
-			{
-			fprintf(stderr,"     timeshift_mode:             Constant time shift\n");
-			fprintf(stderr,"     timeshift_constant:         %f\n",timeshift_constant);
-			}
-		fprintf(stderr,"\n");
-		}
-
-	/* read topography grid if 3D bottom correction specified */
-	if (layout_mode == MBSSLAYOUT_LAYOUT_3DTOPO)
-		{
-		status = mb_topogrid_init(verbose, topo_grid_file, &lonflip, &topogrid_ptr, &error);
-		if (error != MB_ERROR_NO_ERROR)
-			{
-			mb_error(verbose,error,&message);
-			fprintf(stderr,"\nMBIO Error loading topography grid: %s\n%s\n", topo_grid_file, message);
-			fprintf(stderr,"\nProgram <%s> Terminated\n", program_name);
-			mb_memory_clear(verbose, &error);
-			exit(error);
-			}
-		}
-
-	/* load ancilliary data from external files if requested */
-	if (nav_mode == MBSSLAYOUT_MERGE_FILE)
-		{
-		mb_loadnavdata(verbose, nav_file, nav_file_format, lonflip,
-			       &nav_num, &nav_alloc,
-			       &nav_time_d, &nav_navlon, &nav_navlat, &nav_speed, &error);
-		
-		if (verbose > 0)
-			fprintf(stderr,"%d navigation records loaded from file %s\n", nav_num, nav_file);
-		}
-	if (sensordepth_mode == MBSSLAYOUT_MERGE_FILE)
-		{
-		mb_loadsensordepthdata(verbose, sensordepth_file, sensordepth_file_format,
-				       &sensordepth_num, &sensordepth_alloc,
-			       &sensordepth_time_d, &sensordepth_sensordepth, &error);
-		
-		if (verbose > 0)
-			fprintf(stderr,"%d sensordepth records loaded from file %s\n", sensordepth_num, sensordepth_file);
-		}
-	if (altitude_mode == MBSSLAYOUT_MERGE_FILE)
-		{
-		mb_loadaltitudedata(verbose, altitude_file, altitude_file_format,
-				       &altitude_num, &altitude_alloc,
-			       &altitude_time_d, &altitude_altitude, &error);
-		
-		if (verbose > 0)
-			fprintf(stderr,"%d altitude records loaded from file %s\n", altitude_num, altitude_file);
-		}
-	if (heading_mode == MBSSLAYOUT_MERGE_FILE)
-		{
-		mb_loadheadingdata(verbose, heading_file, heading_file_format,
-			       &heading_num, &heading_alloc,
-			       &heading_time_d, &heading_heading, &error);
-		
-		if (verbose > 0)
-			fprintf(stderr,"%d heading records loaded from file %s\n", heading_num, heading_file);
-		}
-	if (attitude_mode == MBSSLAYOUT_MERGE_FILE)
-		{
-		mb_loadattitudedata(verbose, attitude_file, attitude_file_format,
-			       &attitude_num, &attitude_alloc,
-			       &attitude_time_d, &attitude_roll, &attitude_pitch, &attitude_heave, &error);
-		
-		if (verbose > 0)
-			fprintf(stderr,"%d attitude records loaded from file %s\n", attitude_num, attitude_file);
-		}
-	if (soundspeed_mode == MBSSLAYOUT_MERGE_FILE)
-		{
-		mb_loadsoundspeeddata(verbose, soundspeed_file, soundspeed_file_format,
-			       &soundspeed_num, &soundspeed_alloc,
-			       &soundspeed_time_d, &soundspeed_soundspeed, &error);
-		
-		if (verbose > 0)
-			fprintf(stderr,"%d soundspeed records loaded from file %s\n", soundspeed_num, soundspeed_file);
-		}
-	if (timeshift_mode == MBSSLAYOUT_MERGE_FILE)
-		{
-		mb_loadtimeshiftdata(verbose, timeshift_file, timeshift_format,
-			       &timeshift_num, &timeshift_alloc,
-			       &timeshift_time_d, &timeshift_timeshift, &error);
-		
-		if (verbose > 0)
-			fprintf(stderr,"%d timeshift records loaded from file %s\n", heading_num, heading_file);
-		}
-
-	/* new output file obviously needed */
-	new_output_file = MB_YES;
-
-	/* if specified read route time list file */
-	if (line_mode == MBSSLAYOUT_LINE_TIME)
-		{
-		/* open the input file */
-		if ((fp = fopen(line_time_list, "r")) == NULL)
-			{
-			error = MB_ERROR_OPEN_FAIL;
-			status = MB_FAILURE;
-			fprintf(stderr,"\nUnable to open time list file <%s> for reading\n",line_time_list);
-			exit(status);
-			}
-		rawroutefile = MB_NO;
-		while ((result = fgets(comment,MB_PATH_MAXLINE,fp)) == comment)
-		    	{
-			if (comment[0] != '#')
-				{
-				nget = sscanf(comment,"%d %d %lf %lf %lf %lf",
-				    &i, &waypoint, &navlon, &navlat, &heading, &time_d);
-
-				/* if good data check for need to allocate more space */
-				if (ntimepoint + 1 > ntimepointalloc)
-				    	{
-				    	ntimepointalloc += MBSSLAYOUT_ALLOC_NUM;
-					status = mb_reallocd(verbose, __FILE__, __LINE__, ntimepointalloc * sizeof(double),
-								(void **)&routelon, &error);
-					status = mb_reallocd(verbose, __FILE__, __LINE__, ntimepointalloc * sizeof(double),
-								(void **)&routelat, &error);
-					status = mb_reallocd(verbose, __FILE__, __LINE__, ntimepointalloc * sizeof(double),
-								(void **)&routeheading, &error);
-					status = mb_reallocd(verbose, __FILE__, __LINE__, ntimepointalloc * sizeof(int),
-								(void **)&routewaypoint, &error);
-					status = mb_reallocd(verbose, __FILE__, __LINE__, ntimepointalloc * sizeof(double),
-								(void **)&routetime_d, &error);
-				    	if (status != MB_SUCCESS)
-					    	{
-						mb_error(verbose,error,&message);
-						fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",
-							message);
-						fprintf(stderr,"\nProgram <%s> Terminated\n",
-							program_name);
-						exit(error);
-					    	}
-				    	}
-
-				/* add good point to route */
-				if (ntimepointalloc > ntimepoint)
-					{
-					routewaypoint[ntimepoint] = waypoint;
-					routelon[ntimepoint] = navlon;
-					routelat[ntimepoint] = navlat;
-					routeheading[ntimepoint] = heading;
-					routetime_d[ntimepoint] = time_d;
-					ntimepoint++;
-					}
-				}
-			}
-
-		/* close the file */
-		fclose(fp);
-		fp = NULL;
-
-		activewaypoint = 1;
-		mb_coor_scale(verbose,routelat[activewaypoint], &mtodeglon, &mtodeglat);
-		rangelast = 1000 * line_range_threshold;
-		oktowrite = 0;
-		linechange = MB_NO;
-
-		/* output status */
-		if (verbose > 0)
-			{
-			/* output info on file output */
-			fprintf(stderr,"Read %d waypoints from time list file: %s\n",
-				ntimepoint, line_time_list);
-			}
-		}
-
-	/* if specified read route file */
-	else if (line_mode == MBSSLAYOUT_LINE_ROUTE)
-		{
-		/* open the input file */
-		if ((fp = fopen(line_route, "r")) == NULL)
-			{
-			error = MB_ERROR_OPEN_FAIL;
-			status = MB_FAILURE;
-			fprintf(stderr,"\nUnable to open route file <%s> for reading\n",line_route);
-			exit(status);
-			}
-		rawroutefile = MB_NO;
-		while ((result = fgets(comment,MB_PATH_MAXLINE,fp)) == comment)
-		    	{
-			if (comment[0] == '#')
-				{
-				if (strncmp(comment,"## Route File Version", 21) == 0)
-					{
-					rawroutefile = MB_NO;
-					}
-				}
-			else
-				{
-				nget = sscanf(comment,"%lf %lf %lf %d %lf",
-				    &navlon, &navlat, &topo, &waypoint, &heading);
-				if (comment[0] == '#')
-					{
-					fprintf(stderr,"buffer:%s",comment);
-					if (strncmp(comment,"## Route File Version", 21) == 0)
-						{
-						rawroutefile = MB_NO;
-						}
-					}
-		    		if ((rawroutefile == MB_YES && nget >= 2)
-					|| (rawroutefile == MB_NO && nget >= 3 && waypoint > MBSSLAYOUT_ROUTE_WAYPOINT_NONE))
-					point_ok = MB_YES;
-				else
-					point_ok = MB_NO;
-
-				/* if good data check for need to allocate more space */
-				if (point_ok == MB_YES
-					&& nroutepoint + 1 > nroutepointalloc)
-				    	{
-				    	nroutepointalloc += MBSSLAYOUT_ALLOC_NUM;
-					status = mb_reallocd(verbose, __FILE__, __LINE__, nroutepointalloc * sizeof(double),
-								(void **)&routelon, &error);
-					status = mb_reallocd(verbose, __FILE__, __LINE__, nroutepointalloc * sizeof(double),
-								(void **)&routelat, &error);
-					status = mb_reallocd(verbose, __FILE__, __LINE__, nroutepointalloc * sizeof(double),
-								(void **)&routeheading, &error);
-					status = mb_reallocd(verbose, __FILE__, __LINE__, nroutepointalloc * sizeof(int),
-								(void **)&routewaypoint, &error);
-				    	if (status != MB_SUCCESS)
-					    	{
-						mb_error(verbose,error,&message);
-						fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",
-							message);
-						fprintf(stderr,"\nProgram <%s> Terminated\n",
-							program_name);
-						exit(error);
-					    	}
-				    	}
-
-				/* add good point to route */
-				if (point_ok == MB_YES && nroutepointalloc > nroutepoint + 1)
-					{
-					routelon[nroutepoint] = navlon;
-					routelat[nroutepoint] = navlat;
-					routeheading[nroutepoint] = heading;
-					routewaypoint[nroutepoint] = waypoint;
-					nroutepoint++;
-					}
-				}
-			}
-
-		/* close the file */
-		fclose(fp);
-		fp = NULL;
-
-		/* set starting values */
-		activewaypoint = 1;
-		mb_coor_scale(verbose,routelat[activewaypoint], &mtodeglon, &mtodeglat);
-		rangelast = 1000 * line_range_threshold;
-		oktowrite = 0;
-		linechange = MB_NO;
-
-		/* output status */
-		if (verbose > 0)
-			{
-			/* output info on file output */
-			fprintf(stderr,"\nImported %d waypoints from route file: %s\n",
-				nroutepoint, line_route);
-			}
-		}
-
-	/* set up plotting script file */
-	if ((line_mode == MBSSLAYOUT_LINE_ROUTE && nroutepoint > 1) ||
-		(line_mode == MBSSLAYOUT_LINE_TIME && ntimepoint > 1))
-		{
-		sprintf(scriptfile, "%s_%s_ssswathplot.cmd", output_name1, output_name2);
-		}
-	else
-		{
-		sprintf(scriptfile, "%s_ssswathplot.cmd", read_file);
-		}
-	if ((sfp = fopen(scriptfile, "w")) == NULL)
-		{
-		error = MB_ERROR_OPEN_FAIL;
-		status = MB_FAILURE;
-		fprintf(stderr,"\nUnable to open plotting script file <%s> \n",scriptfile);
-		exit(status);
-		}
-
-	/*-------------------------------------------------------------------*/
-	
-	/* Do first pass through the data collecting ancilliary data from the desired source records */
-
-	/* get format if required */
-	if (format == 0)
-		mb_get_format(verbose,read_file,NULL,&format,&error);
-
-	/* determine whether to read one file or a list of files */
-	if (format < 0)
-		read_datalist = MB_YES;
-
-	/* open file list */
-	if (read_datalist == MB_YES)
-	    {
-	    if ((status = mb_datalist_open(verbose,&datalist,
-					    read_file,look_processed,&error)) != MB_SUCCESS)
-		{
-		error = MB_ERROR_OPEN_FAIL;
-		fprintf(stderr,"\nUnable to open data list file: %s\n",
-			read_file);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-	    if ((status = mb_datalist_read(verbose,datalist,
-			    ifile,&iformat,&file_weight,&error))
-			    == MB_SUCCESS)
-		read_data = MB_YES;
-	    else
-		read_data = MB_NO;
-	    }
-	/* else copy single filename to be read */
-	else
-	    {
-	    strcpy(ifile, read_file);
-	    iformat = format;
-	    read_data = MB_YES;
-	    }
-
-	/* loop over all files to be read */
-	while (read_data == MB_YES)
-		{
-		if (verbose > 0)
-			fprintf(stderr,"\nPass 1: Opening file %s %d\n", ifile, iformat);
-			
-		/* initialize reading the swath file */
-		if ((status = mb_read_init(
-			verbose,ifile,iformat,pings,lonflip,bounds,
-			btime_i,etime_i,speedmin,timegap,
-			&imbio_ptr,&btime_d,&etime_d,
-			&beams_bath,&beams_amp,&pixels_ss,&error)) != MB_SUCCESS)
-			{
-			mb_error(verbose,error,&message);
-			fprintf(stderr,"\nMBIO Error returned from function <mb_read_init>:\n%s\n",message);
-			fprintf(stderr,"\nMultibeam File <%s> not initialized for reading\n",ifile);
-			fprintf(stderr,"\nProgram <%s> Terminated\n",
-				program_name);
-			exit(error);
-			}
-	
-		beamflag = NULL;
-		bath = NULL;
-		amp = NULL;
-		bathacrosstrack = NULL;
-		bathalongtrack = NULL;
-		ss = NULL;
-		ssacrosstrack = NULL;
-		ssalongtrack = NULL;
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							sizeof(char), (void **)&beamflag, &error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							sizeof(double), (void **)&bath, &error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_AMPLITUDE,
-							sizeof(double), (void **)&amp, &error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							sizeof(double), (void **)&bathacrosstrack, &error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							sizeof(double), (void **)&bathalongtrack, &error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_SIDESCAN,
-							sizeof(double), (void **)&ss, &error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_SIDESCAN,
-							sizeof(double), (void **)&ssacrosstrack, &error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_SIDESCAN,
-							sizeof(double), (void **)&ssalongtrack, &error);
-	
-		/* if error initializing memory then quit */
-		if (error != MB_ERROR_NO_ERROR)
-			{
-			mb_error(verbose,error,&message);
-			fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",
-				message);
-			fprintf(stderr,"\nProgram <%s> Terminated\n",
-				program_name);
-			exit(error);
-			}
-				
-		/* zero file count records */
-		n_rf_data = 0;
-		n_rf_comment = 0;
-		n_rf_ss2 = 0;
-		n_rf_ss3 = 0;
-		n_rf_sbp = 0;
-		n_rf_nav = 0;
-		n_rf_nav1 = 0;
-		n_rf_nav2 = 0;
-		n_rf_nav3 = 0;
-	
-		/* read data */
-		while (error <= MB_ERROR_NO_ERROR)
-			{
-			/* reset error */
-			error = MB_ERROR_NO_ERROR;
-	
-			/* read next data record */
-			status = mb_get_all(verbose,imbio_ptr,&istore_ptr,&kind,
-					    time_i,&time_d,&navlon,&navlat,
-					    &speed,&heading,
-					    &distance,&altitude,&sensordepth,
-					    &beams_bath,&beams_amp,&pixels_ss,
-					    beamflag,bath,amp,bathacrosstrack,bathalongtrack,
-					    ss,ssacrosstrack,ssalongtrack,
-					    comment,&error);
-	
-			/* some nonfatal errors do not matter */
-			if (error < MB_ERROR_NO_ERROR && error > MB_ERROR_UNINTELLIGIBLE)
-				{
-				error = MB_ERROR_NO_ERROR;
-				status = MB_SUCCESS;
-				}
-
-			/* print debug statements */
-			if (verbose >= 2)
-				{
-				fprintf(stderr,"\ndbg2  Data record read in program <%s>\n",
-					program_name);
-				fprintf(stderr,"dbg2       kind:           %d\n",kind);
-				fprintf(stderr,"dbg2       error:          %d\n",error);
-				fprintf(stderr,"dbg2       status:         %d\n",status);
-				}
-				
-			/* count records */
-			if (kind == MB_DATA_DATA)
-				{
-				n_rf_data++;
-				n_rt_data++;
-				}
-			else if (kind == MB_DATA_COMMENT)
-				{
-				n_rf_comment++;
-				n_rt_comment++;
-				}
-			else if (kind == MB_DATA_SIDESCAN2)
-				{
-				n_rf_ss2++;
-				n_rt_ss2++;
-				}
-			else if (kind == MB_DATA_SIDESCAN3)
-				{
-				n_rf_ss3++;
-				n_rt_ss3++;
-				}
-			else if (kind == MB_DATA_SUBBOTTOM_SUBBOTTOM)
-				{
-				n_rf_sbp++;
-				n_rt_sbp++;
-				}
-			else if (kind == MB_DATA_NAV)
-				{
-				n_rf_nav++;
-				n_rt_nav++;
-				}
-			else if (kind == MB_DATA_NAV1)
-				{
-				n_rf_nav1++;
-				n_rt_nav1++;
-				}
-			else if (kind == MB_DATA_NAV2)
-				{
-				n_rf_nav2++;
-				n_rt_nav2++;
-				}
-			else if (kind == MB_DATA_NAV3)
-				{
-				n_rf_nav3++;
-				n_rt_nav3++;
-				}
-				
-			/* look for nav if not externally defined */
-			if (status == MB_SUCCESS
-				&& nav_mode == MBSSLAYOUT_MERGE_ASYNC
-				&& kind == sensordepth_async)
-				{
-				/* extract nav data */
-				status = mb_extract_nnav(verbose, imbio_ptr, istore_ptr,
-							nanavmax, &kind, &nanav,
-							antime_i, antime_d,
-							anlon, anlat,
-							anspeed, anheading, ansensordraft,
-							anroll, anpitch, anheave,
-							&error);
-
-				/* allocate memory if needed */
-				if (status == MB_SUCCESS
-					&& nanav > 0
-					&& nav_num + nanav >= nav_alloc)
-					{
-					nav_alloc += MAX(MBSSLAYOUT_ALLOC_CHUNK, nanav);
-					status = mb_reallocd(verbose,__FILE__,__LINE__,nav_alloc*sizeof(double),(void **)&nav_time_d,&error);
-					status = mb_reallocd(verbose,__FILE__,__LINE__,nav_alloc*sizeof(double),(void **)&nav_navlon,&error);
-					status = mb_reallocd(verbose,__FILE__,__LINE__,nav_alloc*sizeof(double),(void **)&nav_navlat,&error);
-					status = mb_reallocd(verbose,__FILE__,__LINE__,nav_alloc*sizeof(double),(void **)&nav_speed,&error);
-					if (error != MB_ERROR_NO_ERROR)
-						{
-						mb_error(verbose,error,&message);
-						fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",message);
-						fprintf(stderr,"\nProgram <%s> Terminated\n",
-						    program_name);
-						exit(error);
-						}
-					}
-					
-				/* copy the nav data */
-				if (status == MB_SUCCESS
-					&& nanav > 0)
-					{
-					for (i=0;i<nanav;i++)
-						{
-						nav_time_d[nav_num] = antime_d[i];
-						nav_navlon[nav_num] = anlon[i];
-						nav_navlat[nav_num] = anlat[i];
-						nav_speed[nav_num] = anspeed[i];
-						nav_num++;
-						}
-					}
-				}
-				
-			/* look for sensordepth if not externally defined */
-			if (status == MB_SUCCESS
-				&& sensordepth_mode == MBSSLAYOUT_MERGE_ASYNC
-				&& kind == sensordepth_async)
-				{
-				/* extract sensordepth data */
-				status = mb_extract_nnav(verbose, imbio_ptr, istore_ptr,
-							nanavmax, &kind, &nanav,
-							antime_i, antime_d,
-							anlon, anlat,
-							anspeed, anheading, ansensordraft,
-							anroll, anpitch, anheave,
-							&error);
-
-				/* allocate memory if needed */
-				if (status == MB_SUCCESS
-					&& nanav > 0
-					&& sensordepth_num + nanav >= sensordepth_alloc)
-					{
-					sensordepth_alloc += MAX(MBSSLAYOUT_ALLOC_CHUNK, nanav);
-					status = mb_reallocd(verbose,__FILE__,__LINE__,sensordepth_alloc*sizeof(double),(void **)&sensordepth_time_d,&error);
-					status = mb_reallocd(verbose,__FILE__,__LINE__,sensordepth_alloc*sizeof(double),(void **)&sensordepth_sensordepth,&error);
-					if (error != MB_ERROR_NO_ERROR)
-						{
-						mb_error(verbose,error,&message);
-						fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",message);
-						fprintf(stderr,"\nProgram <%s> Terminated\n",
-						    program_name);
-						exit(error);
-						}
-					}
-					
-				/* copy the sensordepth data */
-				if (status == MB_SUCCESS
-					&& nanav > 0)
-					{
-					for (i=0;i<nanav;i++)
-						{
-						sensordepth_time_d[sensordepth_num] = antime_d[i];
-						sensordepth_sensordepth[sensordepth_num] = ansensordraft[i] + anheave[i];
-						sensordepth_num++;
-						}
-					}
-				}
-				
-			/* look for altitude if not externally defined */
-			if (status == MB_SUCCESS
-				&& altitude_mode == MBSSLAYOUT_MERGE_ASYNC
-				&& kind == altitude_async)
-				{
-				/* extract altitude data */
-				status = mb_extract_nav(verbose, imbio_ptr, istore_ptr,
-							&kind, time_i, &time_d,
-							&navlon, &navlat,
-							&speed, &heading, &sensordraft,
-							&roll, &pitch, &heave,
-							&error);
-				status = mb_extract_altitude(verbose, imbio_ptr, istore_ptr,
-							&kind, &sensordepth, &altitude,
-							&error);
-
-				/* allocate memory if needed */
-				if (status == MB_SUCCESS
-					&& altitude_num + 1 >= altitude_alloc)
-					{
-					altitude_alloc += MAX(MBSSLAYOUT_ALLOC_CHUNK, nanav);
-					status = mb_reallocd(verbose,__FILE__,__LINE__,altitude_alloc*sizeof(double),(void **)&altitude_time_d,&error);
-					status = mb_reallocd(verbose,__FILE__,__LINE__,altitude_alloc*sizeof(double),(void **)&altitude_altitude,&error);
-					if (error != MB_ERROR_NO_ERROR)
-						{
-						mb_error(verbose,error,&message);
-						fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",message);
-						fprintf(stderr,"\nProgram <%s> Terminated\n",
-						    program_name);
-						exit(error);
-						}
-					}
-					
-				/* copy the altitude data */
-				if (status == MB_SUCCESS
-					&& nanav > 0)
-					{
-					altitude_time_d[altitude_num] = time_d;
-					altitude_altitude[altitude_num] = altitude;
-					altitude_num++;
-					}
-				}
-				
-			/* look for heading if not externally defined */
-			if (status == MB_SUCCESS
-				&& heading_mode == MBSSLAYOUT_MERGE_ASYNC
-				&& kind == heading_async)
-				{
-				/* extract heading data */
-				status = mb_extract_nnav(verbose, imbio_ptr, istore_ptr,
-							nanavmax, &kind, &nanav,
-							antime_i, antime_d,
-							anlon, anlat,
-							anspeed, anheading, ansensordraft,
-							anroll, anpitch, anheave,
-							&error);
-
-				/* allocate memory if needed */
-				if (status == MB_SUCCESS
-					&& nanav > 0
-					&& heading_num + nanav >= heading_alloc)
-					{
-					heading_alloc += MAX(MBSSLAYOUT_ALLOC_CHUNK, nanav);
-					status = mb_reallocd(verbose,__FILE__,__LINE__,heading_alloc*sizeof(double),(void **)&heading_time_d,&error);
-					status = mb_reallocd(verbose,__FILE__,__LINE__,heading_alloc*sizeof(double),(void **)&heading_heading,&error);
-					if (error != MB_ERROR_NO_ERROR)
-						{
-						mb_error(verbose,error,&message);
-						fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",message);
-						fprintf(stderr,"\nProgram <%s> Terminated\n",
-						    program_name);
-						exit(error);
-						}
-					}
-					
-				/* copy the heading data */
-				if (status == MB_SUCCESS
-					&& nanav > 0)
-					{
-					for (i=0;i<nanav;i++)
-						{
-						heading_time_d[heading_num] = antime_d[i];
-						heading_heading[heading_num] = anheading[i];
-						heading_num++;
-						}
-					}
-				}
-				
-			/* look for attitude if not externally defined */
-			if (status == MB_SUCCESS
-				&& attitude_mode == MBSSLAYOUT_MERGE_ASYNC
-				&& kind == attitude_async)
-				{
-				/* extract attitude data */
-				status = mb_extract_nnav(verbose, imbio_ptr, istore_ptr,
-							nanavmax, &kind, &nanav,
-							antime_i, antime_d,
-							anlon, anlat,
-							anspeed, anheading, ansensordraft,
-							anroll, anpitch, anheave,
-							&error);
-
-				/* allocate memory if needed */
-				if (status == MB_SUCCESS
-					&& nanav > 0
-					&& attitude_num + nanav >= attitude_alloc)
-					{
-					attitude_alloc += MAX(MBSSLAYOUT_ALLOC_CHUNK, nanav);
-					status = mb_reallocd(verbose,__FILE__,__LINE__,attitude_alloc*sizeof(double),(void **)&attitude_time_d,&error);
-					status = mb_reallocd(verbose,__FILE__,__LINE__,attitude_alloc*sizeof(double),(void **)&attitude_roll,&error);
-					status = mb_reallocd(verbose,__FILE__,__LINE__,attitude_alloc*sizeof(double),(void **)&attitude_pitch,&error);
-					status = mb_reallocd(verbose,__FILE__,__LINE__,attitude_alloc*sizeof(double),(void **)&attitude_heave,&error);
-					if (error != MB_ERROR_NO_ERROR)
-						{
-						mb_error(verbose,error,&message);
-						fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",message);
-						fprintf(stderr,"\nProgram <%s> Terminated\n",
-						    program_name);
-						exit(error);
-						}
-					}
-					
-				/* copy the attitude data */
-				if (status == MB_SUCCESS
-					&& nanav > 0)
-					{
-					for (i=0;i<nanav;i++)
-						{
-						attitude_time_d[attitude_num] = antime_d[i];
-						attitude_roll[attitude_num] = anroll[i];
-						attitude_pitch[attitude_num] = anpitch[i];
-						attitude_heave[attitude_num] = anheave[i];
-						attitude_num++;
-						}
-					}
-				}
-				
-			/* look for soundspeed if not externally defined */
-			if (status == MB_SUCCESS
-				&& soundspeed_mode == MBSSLAYOUT_MERGE_ASYNC
-				&& kind == sensordepth_async)
-				{
-				/* extract soundspeed data */
-				status = mb_ctd(verbose, imbio_ptr, istore_ptr,
-							&kind, &nactd,
-							actime_d, acconductivity, actemperature,
-							acdepth, acsalinity, acsoundspeed,
-							&error);
-
-				/* allocate memory if needed */
-				if (status == MB_SUCCESS
-					&& nactd > 0
-					&& soundspeed_num + nactd >= soundspeed_alloc)
-					{
-					soundspeed_alloc += MAX(MBSSLAYOUT_ALLOC_CHUNK, nactd);
-					status = mb_reallocd(verbose,__FILE__,__LINE__,soundspeed_alloc*sizeof(double),(void **)&soundspeed_time_d,&error);
-					status = mb_reallocd(verbose,__FILE__,__LINE__,soundspeed_alloc*sizeof(double),(void **)&soundspeed_soundspeed,&error);
-					if (error != MB_ERROR_NO_ERROR)
-						{
-						mb_error(verbose,error,&message);
-						fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",message);
-						fprintf(stderr,"\nProgram <%s> Terminated\n",
-						    program_name);
-						exit(error);
-						}
-					}
-					
-				/* copy the soundspeed data */
-				if (status == MB_SUCCESS
-					&& nactd > 0)
-					{
-					for (i=0;i<nactd;i++)
-						{
-						soundspeed_time_d[soundspeed_num] = actime_d[i];
-						soundspeed_soundspeed[soundspeed_num] = acsoundspeed[i];
-						soundspeed_num++;
-						}
-					}
-				}
-			}
-		
-		/* output data counts */
-		if (verbose > 0)
-			{
-			fprintf(stderr,"Pass 1: Records read from input file %s\n", ifile);
-			fprintf(stderr,"     %d survey records\n", n_rf_data);
-			fprintf(stderr,"     %d comment records\n", n_rf_comment);
-			fprintf(stderr,"     %d sidescan2 records\n", n_rf_ss2);
-			fprintf(stderr,"     %d sidescan3 records\n", n_rf_ss3);
-			fprintf(stderr,"     %d subbottom records\n", n_rf_sbp);
-			fprintf(stderr,"     %d nav records\n", n_rf_nav);
-			fprintf(stderr,"     %d nav1 records\n", n_rf_nav1);
-			fprintf(stderr,"     %d nav2 records\n", n_rf_nav2);
-			fprintf(stderr,"     %d nav3 records\n", n_rf_nav3);
-			}
-			
-		/* close the swath file */
-		status = mb_close(verbose,&imbio_ptr,&error);
-	
-		/* figure out whether and what to read next */
-		if (read_datalist == MB_YES)
-			{
-			if ((status = mb_datalist_read(verbose,datalist,
-				    ifile,&iformat,&file_weight,&error))
-				    == MB_SUCCESS)
-				read_data = MB_YES;
-			else
-				read_data = MB_NO;
-			}
-		else
-			{
-			read_data = MB_NO;
-			}
-	
-		/* end loop over files in list */
-		}
-	if (read_datalist == MB_YES)
-		mb_datalist_close(verbose,&datalist,&error);
-	
-	/* output data counts */
-	if (verbose > 0)
-		{
-		fprintf(stderr,"\nPass 1: Total records read from all input files\n");
-		fprintf(stderr,"     %d survey records\n", n_rt_data);
-		fprintf(stderr,"     %d comment records\n", n_rt_comment);
-		fprintf(stderr,"     %d sidescan2 records\n", n_rt_ss2);
-		fprintf(stderr,"     %d sidescan3 records\n", n_rt_ss3);
-		fprintf(stderr,"     %d subbottom records\n", n_rt_sbp);
-		fprintf(stderr,"     %d nav records\n", n_rt_nav);
-		fprintf(stderr,"     %d nav1 records\n", n_rt_nav1);
-		fprintf(stderr,"     %d nav2 records\n", n_rt_nav2);
-		fprintf(stderr,"     %d nav3 records\n", n_rt_nav3);
-		}
-		
-	/* end first pass through data */
-	
-	/*-------------------------------------------------------------------*/
-	
-	/* Apply any specified timeshift to the chosen data */
-	if (timeshift_mode != MBSSLAYOUT_TIMESHIFT_OFF)
-		{
-		/* if no affected data have been specified apply timeshift to all */
-		if (timeshift_apply == MBSSLAYOUT_TIMESHIFT_APPLY_NONE)
-			timeshift_apply =  MBSSLAYOUT_TIMESHIFT_APPLY_ALL_ANCILLIARY;
-			
-		/* apply timeshift to nav data */
-		if (timeshift_apply &  MBSSLAYOUT_TIMESHIFT_APPLY_NAV)
-			{
-			if (timeshift_mode == MBSSLAYOUT_TIMESHIFT_FILE)
-				{
-				j = 0;
-				for (i=0;i<nav_num;i++)
-					{
-					interp_status = mb_linear_interp(verbose,
-								timeshift_time_d-1, timeshift_timeshift-1,
-								timeshift_num, nav_time_d[i], &timeshift, &j,
-								&interp_error);
-					nav_time_d[i] -= timeshift;
-					}
-				
-				}
-			else if (timeshift_mode == MBSSLAYOUT_TIMESHIFT_CONSTANT)
-				{
-				for (i=0;i<nav_num;i++)
-					{
-					nav_time_d[i] -= timeshift_constant;
-					}
-				}
-			}
-			
-		/* apply timeshift to sensordepth data */
-		if (timeshift_apply & MBSSLAYOUT_TIMESHIFT_APPLY_SENSORDEPTH)
-			{
-			if (timeshift_mode == MBSSLAYOUT_TIMESHIFT_FILE)
-				{
-				j = 0;
-				for (i=0;i<sensordepth_num;i++)
-					{
-					interp_status = mb_linear_interp(verbose,
-								timeshift_time_d-1, timeshift_timeshift-1,
-								timeshift_num, sensordepth_time_d[i], &timeshift, &j,
-								&interp_error);
-					sensordepth_time_d[i] -= timeshift;
-					}
-				
-				}
-			else if (timeshift_mode == MBSSLAYOUT_TIMESHIFT_CONSTANT)
-				{
-				for (i=0;i<sensordepth_num;i++)
-					{
-					sensordepth_time_d[i] -= timeshift_constant;
-					}
-				}
-			}
-			
-		/* apply timeshift to heading data */
-		if (timeshift_apply & MBSSLAYOUT_TIMESHIFT_APPLY_HEADING)
-			{
-			if (timeshift_mode == MBSSLAYOUT_TIMESHIFT_FILE)
-				{
-				j = 0;
-				for (i=0;i<heading_num;i++)
-					{
-					interp_status = mb_linear_interp(verbose,
-								timeshift_time_d-1, timeshift_timeshift-1,
-								timeshift_num, heading_time_d[i], &timeshift, &j,
-								&interp_error);
-					heading_time_d[i] -= timeshift;
-					}
-				
-				}
-			else if (timeshift_mode == MBSSLAYOUT_TIMESHIFT_CONSTANT)
-				{
-				for (i=0;i<heading_num;i++)
-					{
-					heading_time_d[i] -= timeshift_constant;
-					}
-				}
-			}
-			
-		/* apply timeshift to attitude data */
-		if (timeshift_apply & MBSSLAYOUT_TIMESHIFT_APPLY_ATTITUDE)
-			{
-			if (timeshift_mode == MBSSLAYOUT_TIMESHIFT_FILE)
-				{
-				j = 0;
-				for (i=0;i<attitude_num;i++)
-					{
-					interp_status = mb_linear_interp(verbose,
-								timeshift_time_d-1, timeshift_timeshift-1,
-								timeshift_num, attitude_time_d[i], &timeshift, &j,
-								&interp_error);
-					attitude_time_d[i] -= timeshift;
-					}
-				
-				}
-			else if (timeshift_mode == MBSSLAYOUT_TIMESHIFT_CONSTANT)
-				{
-				for (i=0;i<attitude_num;i++)
-					{
-					attitude_time_d[i] -= timeshift_constant;
-					}
-				}
-			}
-			
-		/* apply timeshift to soundspeed data */
-		if (timeshift_apply & MBSSLAYOUT_TIMESHIFT_APPLY_SOUNDSPEED)
-			{
-			if (timeshift_mode == MBSSLAYOUT_TIMESHIFT_FILE)
-				{
-				j = 0;
-				for (i=0;i<soundspeed_num;i++)
-					{
-					interp_status = mb_linear_interp(verbose,
-								timeshift_time_d-1, timeshift_timeshift-1,
-								timeshift_num, soundspeed_time_d[i], &timeshift, &j,
-								&interp_error);
-					soundspeed_time_d[i] -= timeshift;
-					}
-				
-				}
-			else if (timeshift_mode == MBSSLAYOUT_TIMESHIFT_CONSTANT)
-				{
-				for (i=0;i<soundspeed_num;i++)
-					{
-					soundspeed_time_d[i] -= timeshift_constant;
-					}
-				}
-			}
-		}
-	
-	/*-------------------------------------------------------------------*/
-	
-	/* Do second pass through the data reading everything,
-		correcting survey data, and outputting everything */
-				
-	/* zero file count records */
-	n_rf_data = 0;
-	n_rf_comment = 0;
-	n_rf_ss2 = 0;
-	n_rf_ss3 = 0;
-	n_rf_sbp = 0;
-	n_rf_nav = 0;
-	n_rf_nav1 = 0;
-	n_rf_nav2 = 0;
-	n_rf_nav3 = 0;
-	n_rt_data = 0;
-	n_rt_comment = 0;
-	n_rt_ss2 = 0;
-	n_rt_ss3 = 0;
-	n_rt_sbp = 0;
-	n_rt_nav = 0;
-	n_rt_nav1 = 0;
-	n_rt_nav2 = 0;
-	n_rt_nav3 = 0;
-	n_wf_data = 0;
-	n_wf_comment = 0;
-	n_wt_data = 0;
-	n_wt_comment = 0;
-	
-	/* if generating survey line files the line number is initialized to 0 so the first line is 1 */
-	if (line_mode != MBSSLAYOUT_LINE_OFF)
-		{
-		line_number = activewaypoint;
-		new_output_file = MB_YES;
-		}
-
-	/* open file list */
-	if (read_datalist == MB_YES)
-	    {
-	    if ((status = mb_datalist_open(verbose,&datalist,
-					    read_file,look_processed,&error)) != MB_SUCCESS)
-		{
-		error = MB_ERROR_OPEN_FAIL;
-		fprintf(stderr,"\nUnable to open data list file: %s\n",
-			read_file);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-	    if ((status = mb_datalist_read(verbose,datalist,
-			    ifile,&iformat,&file_weight,&error))
-			    == MB_SUCCESS)
-		read_data = MB_YES;
-	    else
-		read_data = MB_NO;
-	    }
-	/* else copy single filename to be read */
-	else
-	    {
-	    strcpy(ifile, read_file);
-	    iformat = format;
-	    read_data = MB_YES;
-	    }
-
-	/* loop over all files to be read */
-	while (read_data == MB_YES)
-		{
-		if (verbose > 0)
-			fprintf(stderr,"\nPass 2: Opening input file:  %s %d\n", ifile, iformat);
-			
-		/* initialize reading the input file */
-		if ((status = mb_read_init(
-			verbose,ifile,iformat,pings,lonflip,bounds,
-			btime_i,etime_i,speedmin,timegap,
-			&imbio_ptr,&btime_d,&etime_d,
-			&beams_bath,&beams_amp,&pixels_ss,&error)) != MB_SUCCESS)
-			{
-			mb_error(verbose,error,&message);
-			fprintf(stderr,"\nMBIO Error returned from function <mb_read_init>:\n%s\n",message);
-			fprintf(stderr,"\nMultibeam File <%s> not initialized for reading\n",ifile);
-			fprintf(stderr,"\nProgram <%s> Terminated\n",
-				program_name);
-			exit(error);
-			}
-			
-		/* if not generating survey line files then open output file to coincide with this input file */
-		if (line_mode == MBSSLAYOUT_LINE_OFF)
-			new_output_file = MB_YES;
-	
-		beamflag = NULL;
-		bath = NULL;
-		amp = NULL;
-		bathacrosstrack = NULL;
-		bathalongtrack = NULL;
-		ss = NULL;
-		ssacrosstrack = NULL;
-		ssalongtrack = NULL;
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							sizeof(char), (void **)&beamflag, &error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							sizeof(double), (void **)&bath, &error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_AMPLITUDE,
-							sizeof(double), (void **)&amp, &error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							sizeof(double), (void **)&bathacrosstrack, &error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-							sizeof(double), (void **)&bathalongtrack, &error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_SIDESCAN,
-							sizeof(double), (void **)&ss, &error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_SIDESCAN,
-							sizeof(double), (void **)&ssacrosstrack, &error);
-		if (error == MB_ERROR_NO_ERROR)
-			status = mb_register_array(verbose, imbio_ptr, MB_MEM_TYPE_SIDESCAN,
-							sizeof(double), (void **)&ssalongtrack, &error);
-	
-		/* if error initializing memory then quit */
-		if (error != MB_ERROR_NO_ERROR)
-			{
-			mb_error(verbose,error,&message);
-			fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",
-				message);
-			fprintf(stderr,"\nProgram <%s> Terminated\n",
-				program_name);
-			exit(error);
-			}
-				
-		/* zero file count records */
-		n_rf_data = 0;
-		n_rf_comment = 0;
-		n_rf_ss2 = 0;
-		n_rf_ss3 = 0;
-		n_rf_sbp = 0;
-		n_rf_nav = 0;
-		n_rf_nav1 = 0;
-		n_rf_nav2 = 0;
-		n_rf_nav3 = 0;
-
-		/* ------------------------------- */
-		/* start read + output loop */
-		while (error <= MB_ERROR_NO_ERROR)
-			{
-			/* reset error */
-			status = MB_SUCCESS;
-			error = MB_ERROR_NO_ERROR;
-	
-			/* read next data record */
-			status = mb_get_all(verbose,imbio_ptr,&istore_ptr,&kind,
-					    time_i,&time_d,&navlon_org,&navlat_org,
-					    &speed_org,&heading_org,
-					    &distance,&altitude_org,&sensordepth_org,
-					    &beams_bath,&beams_amp,&pixels_ss,
-					    beamflag,bath,amp,bathacrosstrack,bathalongtrack,
-					    ss,ssacrosstrack,ssalongtrack,
-					    comment,&error);
-	
-			/* some nonfatal errors do not matter */
-			if (error < MB_ERROR_NO_ERROR && error > MB_ERROR_UNINTELLIGIBLE)
-				{
-				error = MB_ERROR_NO_ERROR;
-				status = MB_SUCCESS;
-				}
-				
-			/* count records */
-			if (kind == MB_DATA_DATA)
-				{
-				n_rf_data++;
-				n_rt_data++;
-				}
-			else if (kind == MB_DATA_COMMENT)
-				{
-				n_rf_comment++;
-				n_rt_comment++;
-				}
-			else if (kind == MB_DATA_SIDESCAN2)
-				{
-				n_rf_ss2++;
-				n_rt_ss2++;
-				}
-			else if (kind == MB_DATA_SIDESCAN3)
-				{
-				n_rf_ss3++;
-				n_rt_ss3++;
-				}
-			else if (kind == MB_DATA_SUBBOTTOM_SUBBOTTOM)
-				{
-				n_rf_sbp++;
-				n_rt_sbp++;
-				}
-			else if (kind == MB_DATA_NAV)
-				{
-				n_rf_nav++;
-				n_rt_nav++;
-				}
-			else if (kind == MB_DATA_NAV1)
-				{
-				n_rf_nav1++;
-				n_rt_nav1++;
-				}
-			else if (kind == MB_DATA_NAV2)
-				{
-				n_rf_nav2++;
-				n_rt_nav2++;
-				}
-			else if (kind == MB_DATA_NAV3)
-				{
-				n_rf_nav3++;
-				n_rt_nav3++;
-				}
-				
-			/* check for new line only if generating survey line files
-				and new line not already set
-				and this record is target data */
-			if (status == MB_SUCCESS
-				&& line_mode != MBSSLAYOUT_LINE_OFF
-				&& new_output_file == MB_NO
-				&& kind == output_source)
-				{
-				/* check waypoint time list */
-				if (line_mode == MBSSLAYOUT_LINE_TIME
-					&& time_d >= routetime_d[activewaypoint]
-					&& activewaypoint < ntimepoint)
-					{
-					new_output_file = MB_YES;
-/* fprintf(stderr,"LINECHANGE BY TIME!! dx:%f dy:%f range:%f activewaypoint:%d time_d: %f %f\n",
-dx,dy,range,activewaypoint,time_d,routetime_d[activewaypoint]); */
-					activewaypoint++;
-					line_number = activewaypoint;
-					}
-					
-				/* check waypoint position list */
-				else if (line_mode == MBSSLAYOUT_LINE_ROUTE)
-					{
-					dx = (navlon - routelon[activewaypoint]) / mtodeglon;
-					dy = (navlat - routelat[activewaypoint]) / mtodeglat;
-					range = sqrt(dx * dx + dy * dy);
-/* fprintf(stderr,"CHECK WAYPOINT: activewaypoint:%d range:%f line_range_threshold:%f\n",activewaypoint,range,line_range_threshold); */
-					if (range < line_range_threshold
-						&& (activewaypoint == 0 || range > rangelast)
-						&& activewaypoint < nroutepoint - 1)
-						{
-						new_output_file = MB_YES;
-/* fprintf(stderr,"LINECHANGE BY WAYPOINT!! dx:%f dy:%f range:%f activewaypoint:%d time_d: %f %f\n",
-dx,dy,range,activewaypoint,time_d,routetime_d[activewaypoint]); */
-						activewaypoint++;
-						line_number = activewaypoint;
-						}
-					}
-				}
-				
-			/* open output files if needed */
-			if (new_output_file == MB_YES)
-				{
-				/* reset flag */
-				new_output_file = MB_NO;
-				
-				if (output_source != MB_DATA_NONE)
-					{
-					/* close any old output file unless a single file has been specified */
-					if (ombio_ptr != NULL)
-						{
-						/* close the swath file */
-						status = mb_close(verbose,&ombio_ptr,&error);
-		
-						/* generate inf file */
-						/* if (status == MB_SUCCESS)
-							{
-							status = mb_make_info(verbose, MB_YES,
-										output_file,
-										MBF_MBLDEOIH,
-										&error);
-							}*/
-		
-						/* output counts */
-						if (verbose > 0)
-							{
-							fprintf(stdout, "\nPass 2: Closing output file: %s\n", output_file);
-							fprintf(stdout, "Pass 2: Records written to output file %s\n", output_file);
-							fprintf(stdout, "     %d survey records\n", n_wf_data);
-							fprintf(stdout, "     %d comment records\n", n_wf_comment);
-							}
-		
-						/* output commands to first cut plotting script file */
-						fprintf(sfp, "# Generate swath plot of sidescan file: %s\n", output_file);
-						fprintf(sfp, "mbm_plot -I %s -N -G5 -S -Pb -V -O %s_ssrawplot\n",
-							output_file, output_file);
-						fprintf(sfp, "%s_ssrawplot.cmd $1\n", output_file);
-						fprintf(sfp, "convert -density 100 %s_ssrawplot.ps -trim -quality 75 %s_ssrawplot.jpg\n\n", output_file, output_file);
-						}
-		
-					/* define the filename */
-					if (line_mode == MBSSLAYOUT_LINE_OFF)
-						sprintf(output_file, "%s_%s.mb%2.2d",
-							ifile, output_name2, MBF_MBLDEOIH);
-					else
-						sprintf(output_file, "%s_%s_%4.4d.mb%2.2d",
-							output_name1, output_name2, line_number, MBF_MBLDEOIH);
-
-					/* open the new file */
-					if (verbose > 0)
-						fprintf(stderr,"Pass 2: Opening output file:  %s %d\n", output_file, MBF_MBLDEOIH);
-					if ((status = mb_write_init(
-						verbose,output_file, MBF_MBLDEOIH,
-						&ombio_ptr, &obeams_bath, &obeams_amp, &opixels_ss, &error)) != MB_SUCCESS)
-						{
-						mb_error(verbose,error,&message);
-						fprintf(stderr,"\nMBIO Error returned from function <mb_write_init>:\n%s\n",message);
-						fprintf(stderr,"\nMultibeam File <%s> not initialized for writing\n",output_file);
-						fprintf(stderr,"\nProgram <%s> Terminated\n",
-							program_name);
-						exit(error);
-						}
-		
-					/* get pointers to data storage */
-					omb_io_ptr = (struct mb_io_struct *) ombio_ptr;
-					ostore_ptr = omb_io_ptr->store_data;
-					ostore = (struct mbsys_ldeoih_struct *) ostore_ptr;
-					
-					n_wf_data = 0;
-					n_wf_comment = 0;
-					}
-				}
-	
-			/* if data of interest have been read process them */
-			if (status == MB_SUCCESS
-				&& kind == output_source)
-				{
-				/* start out with no change defined */
-				data_changed = MB_NO;
-				
-				/* call mb_extract_rawssdimensions() */
-				status = mb_extract_rawssdimensions(verbose,imbio_ptr,istore_ptr,
-								&kind, &sample_interval,
-								&num_samples_port, &num_samples_stbd, &error);
-				
-				/* allocate memory if necessary */
-				if (num_samples_port > num_samples_port_alloc)
-					{
-					num_samples_port_alloc = num_samples_port;
-					status = mb_reallocd(verbose,__FILE__,__LINE__,num_samples_port_alloc*sizeof(double),(void **)&raw_samples_port,&error);
-					if (error != MB_ERROR_NO_ERROR)
-						{
-						mb_error(verbose,error,&message);
-						fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",message);
-						fprintf(stderr,"\nProgram <%s> Terminated\n",
-						    program_name);
-						exit(error);
-						}
-					}
-				if (num_samples_stbd > num_samples_stbd_alloc)
-					{
-					num_samples_stbd_alloc = num_samples_stbd;
-					status = mb_reallocd(verbose,__FILE__,__LINE__,num_samples_stbd_alloc*sizeof(double),(void **)&raw_samples_stbd,&error);
-					if (error != MB_ERROR_NO_ERROR)
-						{
-						mb_error(verbose,error,&message);
-						fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",message);
-						fprintf(stderr,"\nProgram <%s> Terminated\n",
-						    program_name);
-						exit(error);
-						}
-					}
-				
-				/* call mb_extract_rawss() */
-				status = mb_extract_rawss(verbose,imbio_ptr,istore_ptr,
-								&kind, &sidescan_type, &sample_interval,
-								&beamwidth_xtrack, &beamwidth_ltrack,
-								&num_samples_port, raw_samples_port,
-								&num_samples_stbd, raw_samples_stbd, &error);
-				
-				/* call mb_extract_nav to get attitude */
-				status = mb_extract_nav(verbose,imbio_ptr,istore_ptr,&kind,
-						time_i,&time_d,&navlon_org,&navlat_org,
-						&speed_org,&heading_org,&draft_org,&roll_org,&pitch_org,&heave_org,&error);
-				
-				/* save the original values */
-				navlon = navlon_org;
-				navlat = navlat_org;
-				speed = speed_org;
-				heading = heading_org;
-				altitude = altitude_org;
-				sensordepth = sensordepth_org;
-				draft = draft_org;
-				roll = roll_org;
-				pitch = pitch_org;
-				heave = heave_org;
-				soundspeed = soundspeed_constant;
-					
-				/* apply timeshift to survey data */
-				if (timeshift_apply & MBSSLAYOUT_TIMESHIFT_APPLY_SURVEY)
-					{
-					if (timeshift_mode == MBSSLAYOUT_TIMESHIFT_FILE)
-						{
-						interp_status = mb_linear_interp(verbose,
-										timeshift_time_d-1, timeshift_timeshift-1,
-										timeshift_num, time_d, &timeshift, &jsurvey,
-										&interp_error);
-						time_d += timeshift;						
-						}
-					else if (timeshift_mode == MBSSLAYOUT_TIMESHIFT_CONSTANT)
-						{
-						time_d += timeshift_constant;
-						}
-					}
-
-				/* get nav sensordepth heading attitude values for record timestamp */
-				if (nav_num > 0)
-					{
-					interp_status = mb_linear_interp_longitude(verbose,
-								nav_time_d-1, nav_navlon-1, nav_num, 
-								time_d, &navlon, &jnav,
-								&interp_error);
-					interp_status = mb_linear_interp_latitude(verbose,
-								nav_time_d-1, nav_navlat-1, nav_num, 
-								time_d, &navlat, &jnav,
-								&interp_error);
-					interp_status = mb_linear_interp(verbose,
-								nav_time_d-1, nav_speed-1, nav_num, 
-								time_d, &speed, &jnav,
-								&interp_error);
-					data_changed = MB_YES;
-					}
-				if (sensordepth_num > 0)
-					{
-					interp_status = mb_linear_interp(verbose,
-								sensordepth_time_d-1, sensordepth_sensordepth-1, sensordepth_num, 
-								time_d, &sensordepth, &jsensordepth,
-								&interp_error);
-					data_changed = MB_YES;
-					}
-				if (altitude_num > 0)
-					{
-					interp_status = mb_linear_interp(verbose,
-								altitude_time_d-1, altitude_altitude-1, altitude_num, 
-								time_d, &altitude, &jaltitude,
-								&interp_error);
-					data_changed = MB_YES;
-					}
-				if (heading_num > 0)
-					{
-					interp_status = mb_linear_interp_heading(verbose,
-								heading_time_d-1, heading_heading-1, heading_num, 
-								time_d, &heading, &jheading,
-								&interp_error);
-					data_changed = MB_YES;
-					}
-				if (attitude_num > 0)
-					{
-					interp_status = mb_linear_interp(verbose,
-								attitude_time_d-1, attitude_roll-1, attitude_num, 
-								time_d, &roll, &jattitude,
-								&interp_error);
-					interp_status = mb_linear_interp(verbose,
-								attitude_time_d-1, attitude_pitch-1, attitude_num, 
-								time_d, &pitch, &jattitude,
-								&interp_error);
-					interp_status = mb_linear_interp(verbose,
-								attitude_time_d-1, attitude_heave-1, attitude_num, 
-								time_d, &heave, &jattitude,
-								&interp_error);
-					data_changed = MB_YES;
-					}
-				if (sensordepth_num > 0 || attitude_num > 0)
-					{
-					draft = sensordepth - heave;
-					}
-				if (soundspeed_num > 0)
-					{
-					interp_status = mb_linear_interp(verbose,
-								soundspeed_time_d-1, soundspeed_soundspeed-1, soundspeed_num, 
-								time_d, &soundspeed, &jsoundspeed,
-								&interp_error);
-					data_changed = MB_YES;
-					}
-				
-				/* if specified get altitude from raw sidescan */
-				if (ss_altitude_mode == MBSSLAYOUT_ALTITUDE_BOTTOMPICK)
-					{
-					/* get bottom arrival in port trace */
-					channelmax = 0.0;
-					for (i=0;i<num_samples_port;i++)
-						{
-						channelmax = MAX(raw_samples_port[i], channelmax);
-						}
-					portchannelpick = 0;
-					threshold = bottompick_threshold * channelmax;
-					for (i=0;i<num_samples_port && portchannelpick == 0;i++)
-						{
-						if (raw_samples_port[i] >= threshold)
-							portchannelpick = i;
-						}
-
-					/* get bottom arrival in starboard trace */
-					channelmax = 0.0;
-					for (i=0;i<num_samples_stbd;i++)
-						{
-						channelmax = MAX(raw_samples_stbd[i], channelmax);
-						}
-					stbdchannelpick = 0;
-					threshold = bottompick_threshold * channelmax;
-					for (i=0;i<num_samples_stbd && stbdchannelpick == 0;i++)
-						{
-						if (raw_samples_stbd[i] >= threshold)
-							stbdchannelpick = i;
-						}
-					ttime = 0.5 * ((portchannelpick + stbdchannelpick) * sample_interval);
-					ss_altitude = 0.5 * soundspeed * ttime;
-					}
-				
-				/* else if getting altitude from topography model set initial value zero */
-				else if (ss_altitude_mode == MBSSLAYOUT_ALTITUDE_TOPO_GRID)
-					{
-					mb_topogrid_topo(verbose, topogrid_ptr, navlon, navlat, &topo, &error);
-					ss_altitude = -sensordepth - topo;
-					}
-				
-				/* else just use existing altitude value */
-				else if (ss_altitude_mode == MBSSLAYOUT_ALTITUDE_ALTITUDE)
-					{
-					ss_altitude = altitude;
-					}
-
-				/* get flat bottom layout table */
-				if (layout_mode == MBSSLAYOUT_LAYOUT_FLATBOTTOM)
-					mbsslayout_get_flatbottom_table(verbose, nangle, angle_min, angle_max,
-									navlon, navlat, ss_altitude, 0.0,
-									table_angle, table_xtrack, table_ltrack, table_altitude,
-									table_range, &error);
-				/* else get 3D bottom layout table */
-				else
-					{
-					mb_topogrid_getangletable(verbose, topogrid_ptr, nangle, angle_min, angle_max,
-									navlon, navlat, heading,
-									ss_altitude, sensordepth, pitch,
-									table_angle, table_xtrack, table_ltrack,
-									table_altitude, table_range, &error);
-					}
-/* fprintf(stderr,"altitude:%f sensordepth:%f pitch:%f\n",ss_altitude,sensordepth,pitch);
-for (i=0;i<nangle;i++)
-fprintf(stderr,"%d %f %f %f %f %f\n",i,table_angle[i],table_xtrack[i],table_ltrack[i],table_altitude[i],table_range[i]);*/
-				/* set some values */
-				ostore->depth_scale = 0;
-				ostore->distance_scale = 0;
-				ostore->beam_xwidth = beamwidth_xtrack;
-				ostore->beam_lwidth = beamwidth_ltrack;
-				ostore->kind = MB_DATA_DATA;
-				ostore->ss_type = sidescan_type;
-				opixels_ss = MBSSLAYOUT_SSDIMENSION;
-				
-				/* set one bathymetry sample from sensor depth and altitude */
-				obeams_bath = 1;
-				bath[0] = sensordepth + altitude;
-				bathacrosstrack[0] = 0.0;
-				bathalongtrack[0] = 0.0;
-
-				/* get swath width and pixel size */
-				if (swath_mode == MBSSLAYOUT_SWATHWIDTH_VARIABLE)
-					{
-					rr = 0.5 * soundspeed * sample_interval * MAX(num_samples_port,num_samples_stbd);
-					swath_width = 2.2 * sqrt(rr * rr - ss_altitude * ss_altitude);
-					}
-				pixel_width = swath_width / (opixels_ss - 1);
-
-				/* initialize the output sidescan */
-				for (j=0;j<opixels_ss;j++)
-					{
-					oss[j] = 0.0;
-					ossacrosstrack[j] = pixel_width * (double)(j - (opixels_ss / 2));
-					ossalongtrack[j] = 0.0;
-					ossbincount[j] = 0;
-					}
-
-				/* find minimum range */
-				rangemin = table_range[0];
-				kstart = 0;
-				for (kangle=1;kangle<nangle;kangle++)
-					{
-					if (table_range[kangle] < rangemin)
-						{
-						rangemin = table_range[kangle];
-						kstart = kangle;
-						}
-					}
-/* fprintf(stderr,"port minimum range:%f kstart:%d\n",rangemin,kstart);*/
-
-				/* bin port trace */
-				istart = rangemin / (soundspeed * sample_interval);
-				for (i=istart;i<num_samples_port;i++)
-					{
-					/* get sample range */
-					rr = 0.5 * soundspeed * sample_interval * i;
-
-					/* look up position(s) for this range */
-					done = MB_NO;
-					for (kangle=kstart;kangle>0 && done == MB_NO;kangle--)
-						{
-						found = MB_NO;
-						if (rr <= table_range[kstart])
-							{
-							xtrack = table_xtrack[kstart];
-							ltrack = table_ltrack[kstart];
-							done = MB_YES;
-							found = MB_YES;
-							}
-						else if (rr > table_range[kangle] && rr <= table_range[kangle-1])
-							{
-							factor = (rr - table_range[kangle])
-								/ (table_range[kangle-1] - table_range[kangle]);
-							xtrack = table_xtrack[kangle]
-								+ factor * (table_xtrack[kangle-1] - table_xtrack[kangle]);
-							ltrack = table_ltrack[kangle]
-								+ factor * (table_ltrack[kangle-1] - table_ltrack[kangle]);
-							found = MB_YES;
-							done = MB_YES;
-							}
-						else if (rr < table_range[kangle] && rr >= table_range[kangle-1])
-							{
-							factor = (rr - table_range[kangle])
-								/ (table_range[kangle-1] - table_range[kangle]);
-							xtrack = table_xtrack[kangle]
-								+ factor * (table_xtrack[kangle-1] - table_xtrack[kangle]);
-							ltrack = table_ltrack[kangle]
-								+ factor * (table_ltrack[kangle-1] - table_ltrack[kangle]);
-							found = MB_YES;
-							done = MB_YES;
-							}
-
-						/* bin the value and position */
-						if (found == MB_YES)
-							{
-							j = opixels_ss / 2 + (int)(xtrack / pixel_width);
-							if (j >= 0 && j < opixels_ss)
-								{
-								oss[j] += raw_samples_port[i];
-								ossbincount[j]++;
-								ossalongtrack[j] += ltrack;
-								}
-/* fprintf(stderr,"port:%5d rr:%10.2f x:%10.2f l:%10.2f kangle:%d\n",
-i,rr,xtrack,ltrack,kangle); */
-							}
-						}
-					}
-
-				/* find minimum range */
-				rangemin = table_range[0];
-				kstart = 0;
-				for (kangle=1;kangle<nangle;kangle++)
-					{
-					if (table_range[kangle] < rangemin)
-						{
-						rangemin = table_range[kangle];
-						kstart = kangle;
-						}
-					}
-/* fprintf(stderr,"stbd minimum range:%f kstart:%d\n",rr,kstart); */
-/* fprintf(stderr,"kstart:%d angle:%f range:%f xtrack:%f ltrack:%f\n",
-kstart,
-angle_min + kstart * (angle_max - angle_min) / (nangle - 1),
-table_range[kstart],table_xtrack[kstart],table_ltrack[kstart]);*/
-
-				/* bin stbd trace */
-				istart = rangemin / (soundspeed * sample_interval);
-				for (i=istart;i<num_samples_stbd;i++)
-					{
-					/* get sample range */
-					rr = 0.5 * soundspeed * sample_interval * i;
-
-					/* look up position for this range */
-					done = MB_NO;
-					for (kangle=kstart;kangle<nangle-1 && done == MB_NO;kangle++)
-						{
-						found = MB_NO;
-						if (rr <= table_range[kstart])
-							{
-							xtrack = table_xtrack[kstart];
-							ltrack = table_ltrack[kstart];
-							done = MB_YES;
-							found = MB_YES;
-							}
-						else if (rr > table_range[kangle] && rr <= table_range[kangle+1])
-							{
-							factor = (rr - table_range[kangle])
-								/ (table_range[kangle+1] - table_range[kangle]);
-							xtrack = table_xtrack[kangle]
-								+ factor * (table_xtrack[kangle+1] - table_xtrack[kangle]);
-							ltrack = table_ltrack[kangle]
-								+ factor * (table_ltrack[kangle+1] - table_ltrack[kangle]);
-							found = MB_YES;
-							done = MB_YES;
-							}
-						else if (rr < table_range[kangle] && rr >= table_range[kangle+1])
-							{
-							factor = (rr - table_range[kangle])
-								/ (table_range[kangle+1] - table_range[kangle]);
-							xtrack = table_xtrack[kangle]
-								+ factor * (table_xtrack[kangle+1] - table_xtrack[kangle]);
-							ltrack = table_ltrack[kangle]
-								+ factor * (table_ltrack[kangle+1] - table_ltrack[kangle]);
-							found = MB_YES;
-							done = MB_YES;
-							}
-
-						/* bin the value and position */
-						if (found == MB_YES)
-							{
-							j = opixels_ss / 2 + (int)(xtrack / pixel_width);
-							if (j >= 0 && j < opixels_ss)
-								{
-								oss[j] += raw_samples_stbd[i];
-								ossbincount[j]++;
-								ossalongtrack[j] += ltrack;
-								}
-/* fprintf(stderr,"stbd:%5d rr:%10.2f x:%10.2f l:%10.2f kangle:%d\n",
-i,rr,xtrack,ltrack,kangle); */
-							}
-						}
-					}
-
-				/* calculate the output sidescan */
-				jport = -1;
-				jstbd = -1;
-				for (j=0;j<opixels_ss;j++)
-					{
-					if (ossbincount[j] > 0)
-						{
-						oss[j] /= (double) ossbincount[j];
-						ossalongtrack[j] /= (double) ossbincount[j];
-						if (jport < 0)
-							jport = j;
-						jstbd = j;
-						}
-					else
-						oss[j] = MB_SIDESCAN_NULL;
-					}
-/* fprintf(stderr,"SS bounds: %d %d      %f %f   %f\n",jport,jstbd,(jport - opixels_ss/2)*pixel_width,(jstbd - opixels_ss/2)*pixel_width,
-(jport - opixels_ss/2)*pixel_width - (jstbd - opixels_ss/2)*pixel_width);*/
-/*for (j=0;j<opixels_ss;j++)
-{
-fprintf(stderr,"AAA j:%d x:%7.2f l:%7.2f s:%6.2f\n",j,ossacrosstrack[j],ossalongtrack[j],oss[j]);
-}*/
-
-				/* interpolate gaps in the output sidescan */
-				previous = opixels_ss;
-				for (j=0;j<opixels_ss;j++)
-					{
-					if (ossbincount[j] > 0)
-						{
-						interpable = j - previous - 1;
-						if (interpable > 0 && interpable <= interpolation)
-							{
-							dss = oss[j] - oss[previous];
-							dssl = ossalongtrack[j] - ossalongtrack[previous];
-							for (jj=previous+1;jj<j;jj++)
-								{
-								fraction = ((double)(jj - previous))
-										/ ((double)(j - previous));
-								oss[jj] = oss[previous] + fraction * dss;
-								ossalongtrack[jj] = ossalongtrack[previous] + fraction * dssl;
-								}
-							}
-						previous = j;
-						}
-					}
-/*for (j=0;j<opixels_ss;j++)
-{
-fprintf(stderr,"III j:%d x:%7.2f l:%7.2f s:%6.2f\n",j,ossacrosstrack[j],ossalongtrack[j],oss[j]);
-}*/
-
-				/* insert data */
-				mb_insert_nav(verbose, ombio_ptr, (void *)ostore,
-						time_i, time_d,
-						navlon, navlat, speed, heading, sensordraft,
-						roll, pitch, heave,
-						&error);
-				status = mb_insert_altitude(verbose, ombio_ptr, (void *)ostore,
-						sensordepth, ss_altitude, &error);
-				status = mb_insert(verbose, ombio_ptr, (void *)ostore,
-						MB_DATA_DATA, time_i, time_d,
-						navlon, navlat, speed, heading,
-						beams_bath,beams_amp,opixels_ss,
-						beamflag,bath,amp,bathacrosstrack,
-						bathalongtrack,
-						oss,ossacrosstrack,ossalongtrack,
-						comment, &error);
-				}
-
-			/* write some data */
-			if (error == MB_ERROR_NO_ERROR
-				&& kind == output_source)
-				{
-				/* write the record */
-				status = mb_write_ping(verbose, ombio_ptr, (void *)ostore, &error);
-				if (status != MB_SUCCESS)
-					{
-					mb_error(verbose,error,&message);
-					fprintf(stderr,"\nMBIO Error returned from function <mb_put>:\n%s\n",message);
-					fprintf(stderr,"\nMultibeam Data Not Written To File <%s>\n",ofile);
-					fprintf(stderr,"\nProgram <%s> Terminated\n",
-						program_name);
-					exit(error);
-					}
-				
-				/* count records */
-				if (kind == MB_DATA_COMMENT)
-					{
-					n_wf_comment++;
-					n_wt_comment++;
-					}
-				else
-					{
-					n_wf_data++;
-					n_wt_data++;
-					}
-				}
-			}
-		/* end read+process+output data loop */
-		/* --------------------------------- */
-		
-		/* output data counts */
-		if (verbose > 0)
-			{
-			fprintf(stderr,"Pass 2: Records read from input file %s\n", ifile);
-			fprintf(stderr,"     %d survey records\n", n_rf_data);
-			fprintf(stderr,"     %d comment records\n", n_rf_comment);
-			fprintf(stderr,"     %d sidescan2 records\n", n_rf_ss2);
-			fprintf(stderr,"     %d sidescan3 records\n", n_rf_ss3);
-			fprintf(stderr,"     %d subbottom records\n", n_rf_sbp);
-			fprintf(stderr,"     %d nav records\n", n_rf_nav);
-			fprintf(stderr,"     %d nav1 records\n", n_rf_nav1);
-			fprintf(stderr,"     %d nav2 records\n", n_rf_nav2);
-			fprintf(stderr,"     %d nav3 records\n", n_rf_nav3);
-			}
-	
-		/* close the input swath file */
-		status = mb_close(verbose,&imbio_ptr,&error);
-	
-		/* figure out whether and what to read next */
-		if (read_datalist == MB_YES)
-			{
-			if ((status = mb_datalist_read(verbose,datalist,
-				    ifile,&format,&file_weight,&error))
-				    == MB_SUCCESS)
-				read_data = MB_YES;
-			else
-				read_data = MB_NO;
-			}
-		else
-			{
-			read_data = MB_NO;
-			}
-
-	
-		/* end loop over files in list */
-		}
-	if (read_datalist == MB_YES)
-		mb_datalist_close(verbose,&datalist,&error);
-
-	/* close any open output file */
-	if (ombio_ptr != NULL)
-		{
-		/* close the swath file */
-		status = mb_close(verbose,&ombio_ptr,&error);
-
-		/* generate inf file */
-		/* if (status == MB_SUCCESS)
-			{
-			status = mb_make_info(verbose, MB_YES,
-						output_file,
-						MBF_MBLDEOIH,
-						&error);
-			}*/
-
-		/* output counts */
-		if (verbose > 0)
-			{
-			fprintf(stdout, "\nClosing output file: %s\n", output_file);
-			fprintf(stdout, "Pass 2: Records written to output file %s\n", output_file);
-			fprintf(stdout, "     %d survey records\n", n_wf_data);
-			fprintf(stdout, "     %d comment records\n", n_wf_comment);
-			}
-
-		/* output commands to first cut plotting script file */
-		fprintf(sfp, "# Generate swath plot of sidescan file: %s\n", output_file);
-		fprintf(sfp, "mbm_plot -I %s -N -G5 -S -Pb -V -O %s_ssrawplot\n",
-			output_file, output_file);
-		fprintf(sfp, "%s_ssrawplot.cmd $1\n", output_file);
-		fprintf(sfp, "convert -density 100 %s_ssrawplot.ps -trim -quality 75 %s_ssrawplot.jpg\n\n", output_file, output_file);
-		}
-
-	/* close plotting script file */
-	fclose(sfp);
-	sprintf(command, "chmod +x %s", scriptfile);
-	shellstatus = system(command);
-
-	/* output data counts */
-	if (verbose > 0)
-		{
-		fprintf(stderr,"\nPass 2: Total records read from all input files\n");
-		fprintf(stderr,"     %d survey records\n", n_rt_data);
-		fprintf(stderr,"     %d comment records\n", n_rt_comment);
-		fprintf(stderr,"     %d sidescan2 records\n", n_rt_ss2);
-		fprintf(stderr,"     %d sidescan3 records\n", n_rt_ss3);
-		fprintf(stderr,"     %d subbottom records\n", n_rt_sbp);
-		fprintf(stderr,"     %d nav records\n", n_rt_nav);
-		fprintf(stderr,"     %d nav1 records\n", n_rt_nav1);
-		fprintf(stderr,"     %d nav2 records\n", n_rt_nav2);
-		fprintf(stderr,"     %d nav3 records\n", n_rt_nav3);
-		fprintf(stderr,"Pass 2: Total records written to all output files\n");
-		fprintf(stderr,"     %d survey records\n", n_wt_data);
-		fprintf(stderr,"     %d comment records\n", n_wt_comment);
-		}
-		
-	/* end second pass through data */
-	
-	/*-------------------------------------------------------------------*/
-	
-	/* deallocate raw sidescan arrays */
-	if (num_samples_stbd_alloc > 0)
-		{
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&raw_samples_stbd,&error);
-		num_samples_stbd_alloc = 0;
-		}
-	if (num_samples_port_alloc > 0)
-		{
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&raw_samples_port,&error);
-		num_samples_port_alloc = 0;
-		}
-
-	/* deallocate nav, sensordepth, heading, attitude, and timeshift arrays */
-	if (nav_alloc > 0)
-		{
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&nav_time_d,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&nav_navlon,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&nav_navlat,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&nav_speed,&error);
-		nav_alloc = 0;
-		}
-	if (sensordepth_alloc > 0)
-		{
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&sensordepth_time_d,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&sensordepth_sensordepth,&error);
-		sensordepth_alloc = 0;
-		}
-	if (heading_alloc > 0)
-		{
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&heading_time_d,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&heading_heading,&error);
-		heading_alloc = 0;
-		}
-	if (attitude_alloc > 0)
-		{
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&attitude_time_d,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&attitude_roll,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&attitude_pitch,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&attitude_heave,&error);
-		attitude_alloc = 0;
-		}
-	if (timeshift_alloc > 0)
-		{
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&timeshift_time_d,&error);
-		status = mb_freed(verbose,__FILE__,__LINE__,(void **)&timeshift_timeshift,&error);
-		timeshift_alloc = 0;
-		}
-
-	/* deallocate route arrays */
-	if (line_mode == MBSSLAYOUT_LINE_TIME)
-		{
-		status = mb_freed(verbose, __FILE__, __LINE__, (void **)&routelon, &error);
-		status = mb_freed(verbose, __FILE__, __LINE__, (void **)&routelat, &error);
-		status = mb_freed(verbose, __FILE__, __LINE__, (void **)&routeheading, &error);
-		status = mb_freed(verbose, __FILE__, __LINE__, (void **)&routewaypoint, &error);
-		status = mb_freed(verbose, __FILE__, __LINE__, (void **)&routetime_d, &error);
-		}
-	else if (line_mode == MBSSLAYOUT_LINE_ROUTE)
-		{
-		status = mb_freed(verbose, __FILE__, __LINE__, (void **)&routelon, &error);
-		status = mb_freed(verbose, __FILE__, __LINE__, (void **)&routelat, &error);
-		status = mb_freed(verbose, __FILE__, __LINE__, (void **)&routeheading, &error);
-		status = mb_freed(verbose, __FILE__, __LINE__, (void **)&routewaypoint, &error);
-		}
-
-	/* deallocate topography grid array if necessary */
-	if (layout_mode == MBSSLAYOUT_LAYOUT_3DTOPO)
-		status = mb_topogrid_deall(verbose, &topogrid_ptr, &error);
-
-	/* check memory */
-	if (verbose >= 4)
-		status = mb_memory_list(verbose,&error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  Program <%s> completed\n",
-			program_name);
-		fprintf(stderr,"dbg2  Ending status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* end it all */
-	exit(error);
-}
-/*--------------------------------------------------------------------*/
-int mbsslayout_get_flatbottom_table(int verbose, int nangle, double angle_min, double angle_max,
-					double navlon, double navlat, double altitude, double pitch,
-					double *table_angle, double *table_xtrack, double *table_ltrack,
-					double *table_altitude, double *table_range,
-					int *error)
-{
-	char	*function_name = "mbsslayout_get_flatbottom_table";
-	int	status = MB_SUCCESS;
-	double	dangle;
-	double	rr, xx, zz;
-	double	alpha, beta, theta, phi;
-	int	i;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBSSLAYOUT function <%s> called\n",
-			function_name);
-		fprintf(stderr,"dbg2  Input arguments:\n");
-		fprintf(stderr,"dbg2       verbose:         %d\n", verbose);
-		fprintf(stderr,"dbg2       nangle:          %d\n", nangle);
-		fprintf(stderr,"dbg2       angle_min:       %f\n", angle_min);
-		fprintf(stderr,"dbg2       angle_max:       %f\n", angle_max);
-		fprintf(stderr,"dbg2       navlon:          %f\n", navlon);
-		fprintf(stderr,"dbg2       navlat:          %f\n", navlat);
-		fprintf(stderr,"dbg2       pitch:           %f\n", pitch);
-		}
-
-	/* loop over all of the angles */
-	dangle = (angle_max - angle_min) / (nangle - 1);
-	alpha = pitch;
-	zz = altitude;
-	for (i=0;i<nangle;i++)
-		{
-		/* get angles in takeoff coordinates */
-		table_angle[i] = angle_min + dangle * i;
-		beta = 90.0 - table_angle[i];
-		mb_rollpitch_to_takeoff(
-			verbose,
-			alpha, beta,
-			&theta, &phi,
-			error);
-
-		/* calculate range required to achieve desired altitude */
-		rr = zz / cos(DTR * theta);
-
-		/* get the position */
-		xx = rr * sin(DTR * theta);
-		table_xtrack[i] = xx * cos(DTR * phi);
-		table_ltrack[i] = xx * sin(DTR * phi);
-		table_altitude[i] = zz;
-		table_range[i] = rr;
-		}
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  MBSSLAYOUT function <%s> completed\n",
-			function_name);
-		fprintf(stderr,"dbg2  Return values:\n");
-		fprintf(stderr,"dbg2       Lookup tables:\n");
-		for (i=0;i<nangle;i++)
-			fprintf(stderr,"dbg2         %d %f %f %f %f %f\n",
-				i, table_angle[i], table_xtrack[i], table_ltrack[i], table_altitude[i], table_range[i]);
-		fprintf(stderr,"dbg2       error:           %d\n",*error);
-		fprintf(stderr,"dbg2  Return status:\n");
-		fprintf(stderr,"dbg2       status:          %d\n",status);
-		}
-
-	/* return status */
-	return(status);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/utilities/mbstripnan.c b/src/utilities/mbstripnan.c
deleted file mode 100644
index 8381aef..0000000
--- a/src/utilities/mbstripnan.c
+++ /dev/null
@@ -1,62 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:    mbstripNaN.c        8/8/02
- *    $Id: mbstripnan.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 2002-2015 by
- *    Mike McCann (mccann at mbari.org)
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-
-/* mbstripnan.c
- * Little program to filter output from GMT's grd2xyz removing any nodes
- * that have NaN elevations.  Output meant to feed into GMT's surface
- * in support of the mbm_grd2geovrml macro.
- *
- * Mike McCann   8 August 2002
- * MBARI
- *
- * $Log: mbstripnan.c,v $
- * Revision 5.3  2006/01/18 15:17:00  caress
- * Added stdlib.h include.
- *
- * Revision 5.2  2003/04/17 21:18:57  caress
- * Release 5.0.beta30
- *
- * Revision 5.1  2002/08/21 00:57:11  caress
- * Release 5.0.beta22
- *
- * Revision 5.0  2002/08/10 07:00:21  caress
- * First version from Mike McCann.
- *
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <math.h>
-#if defined(_WIN32) && !defined(isnan)
-#	define isnan(x) _isnan(x)
-#endif
-
-/*--------------------------------------------------------------------*/
-/*
- * Read double x,y,z on stdin and send to stdout all but NaNs
- */
-int main () {
-	struct node { double lon, lat, height; };
-	struct node n;
-	while ( ( fread(&n, 24, 1, stdin) > 0 ) ) {
-		if ( ! isnan(n.height) ) {
-			fwrite(&n, 24, 1, stdout);
-		}
-	}
-exit(0);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/utilities/mbsvplist.c b/src/utilities/mbsvplist.c
deleted file mode 100644
index d8e3030..0000000
--- a/src/utilities/mbsvplist.c
+++ /dev/null
@@ -1,920 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbsvplist.c	1/3/2001
- *    $Id: mbsvplist.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 2001-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * This program, mbsvplist, lists all water sound velocity
- * profiles (SVPs) within swath data files. Swath bathymetry is
- * calculated from raw angles and travel times by raytracing
- * through a model of the speed of sound in water. Many swath
- * data formats allow SVPs to be embedded in the data, and
- * often the SVPs used to calculate the data will be included.
- * By default, all unique SVPs encountered are listed to
- * stdout. The SVPs may instead be written to individual files
- * with names FILE_XXX.svp, where FILE is the swath data
- * filename and XXX is the SVP count within the file.  The -D
- * option causes duplicate SVPs to be output. The -P option
- * implies -O, and also causes the parameter file to be modified
- * so that the first svp output for each file becomes the
- * svp used for recalculating bathymetry for that swath file.
- *
- * Author:	D. W. Caress
- * Date:	January 3,  2001
- *
- * $Log: mbsvplist.c,v $
- * Revision 5.10  2008/09/20 00:57:41  caress
- * Release 5.1.1beta23
- *
- * Revision 5.9  2006/09/11 18:55:54  caress
- * Changes during Western Flyer and Thomas Thompson cruises, August-September
- * 2006.
- *
- * Revision 5.8  2006/01/18 15:17:00  caress
- * Added stdlib.h include.
- *
- * Revision 5.7  2005/11/05 01:07:54  caress
- * Programs changed to register arrays through mb_register_array() rather than allocating the memory directly with mb_realloc() or mb_malloc().
- *
- * Revision 5.6  2005/03/25 04:42:59  caress
- * Standardized the string lengths used for filenames and comment data.
- *
- * Revision 5.5  2004/10/06 19:10:53  caress
- * Release 5.0.5 update.
- *
- * Revision 5.4  2003/07/02 18:14:19  caress
- * Release 5.0.0
- *
- * Revision 5.3  2003/04/17 21:18:57  caress
- * Release 5.0.beta30
- *
- * Revision 5.2  2001/07/20 00:34:38  caress
- * Release 5.0.beta03
- *
- * Revision 5.1  2001/03/22 21:15:49  caress
- * Trying to make release 5.0.beta0.
- *
- * Revision 5.0  2001/01/04  21:43:50  caress
- * Initial revision.
- *
- *
- */
-
-
-/* standard include files */
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <math.h>
-#include <string.h>
-#include <time.h>
-
-/* MBIO include files */
-#include "mb_status.h"
-#include "mb_format.h"
-#include "mb_define.h"
-#include "mb_process.h"
-
-/* system function declarations */
-char	*ctime();
-char	*getenv();
-
-/* local defines */
-#define	MBSVPLIST_SVP_NUM_ALLOC		24
-#define	MBSVPLIST_PRINTMODE_CHANGE	0
-#define	MBSVPLIST_PRINTMODE_UNIQUE	1
-#define	MBSVPLIST_PRINTMODE_ALL		2
-
-struct mbsvplist_svp_struct {
-	int	time_set;		/* time stamp known */
-	int	position_set;		/* position known */
-	int	repeat_in_file;		/* repeats a previous svp in the same file */
-	int	match_last;		/* repeats the last svp in the same file or the previous file */
-	int	depthzero_reset;	/* uppermost SVP value set to zero depth */
-	double	time_d;
-	double	longitude;
-	double	latitude;
-	double	depthzero;
-	int	n;
-	double	depth[MB_SVP_MAX];
-	double	velocity[MB_SVP_MAX];
-};
-
-static char rcs_id[] = "$Id: mbsvplist.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-
-int main (int argc, char **argv)
-{
-	char program_name[] = "mbsvplist";
-	char help_message[] =  "mbsvplist lists all water sound velocity\nprofiles (SVPs) within swath data files. Swath bathymetry is\ncalculated from raw angles and travel times by raytracing\nthrough a model of the speed of sound in water. Many swath\ndata formats allow SVPs to be embedded in the data, and\noften the SVPs used to calculate the data will be included.\nBy default, all unique SVPs encountered are listed to\nstdout. The SVPs may instead be written to individual files\nwith names [...]
-	char usage_message[] = "mbsvplist [-C -D -Fformat -H -Ifile -Mmode -O -Nmin_num_pairs -P -T -V -Z]";
-	extern char *optarg;
-	int	errflg = 0;
-	int	c;
-	int	help = 0;
-	int	flag = 0;
-
-	/* MBIO status variables */
-	int	status = MB_SUCCESS;
-	int	verbose = 0;
-	int	error = MB_ERROR_NO_ERROR;
-	char	*message;
-
-	/* MBIO read control parameters */
-	int	read_datalist = MB_NO;
-	char	read_file[MB_PATH_MAXLINE];
-	void	*datalist;
-	int	look_processed = MB_DATALIST_LOOK_UNSET;
-	double	file_weight;
-	int	format;
-	int	pings;
-	int	lonflip;
-	double	bounds[4];
-	int	btime_i[7];
-	int	etime_i[7];
-	double	btime_d;
-	double	etime_d;
-	double	speedmin;
-	double	timegap;
-	char	file[MB_PATH_MAXLINE];
-	int	beams_bath;
-	int	beams_amp;
-	int	pixels_ss;
-
-	/* MBIO read values */
-	void	*mbio_ptr = NULL;
-	void	*store_ptr;
-	int	kind;
-	int	time_i[7];
-	double	time_d;
-	double	navlon;
-	double	navlat;
-	double	speed;
-	double	heading;
-	double	distance;
-	double	altitude;
-	double	sonardepth;
-	char	*beamflag = NULL;
-	double	*bath = NULL;
-	double	*bathacrosstrack = NULL;
-	double	*bathalongtrack = NULL;
-	double	*amp = NULL;
-	double	*ss = NULL;
-	double	*ssacrosstrack = NULL;
-	double	*ssalongtrack = NULL;
-	char	comment[MB_COMMENT_MAXLINE];
-	
-	/* save time stamp and position of last survey data */
-	double	last_time_d = 0.0;
-	double	last_navlon = 0.0;
-	double	last_navlat = 0.0;
-
-	/* data record source types */
-	int	nav_source;
-	int	heading_source;
-	int	vru_source;
-	int	svp_source;
-
-	/* output mode settings */
-	int	svp_printmode;
-	int	svp_force_zero;
-	int	svp_file_output;
-	int output_as_table = MB_NO;
-
-	/* SVP values */
-	int	svp_match_last = MB_NO;
-	int	svp_loaded = MB_NO;
-	int	svp_setprocess;
-	int	svp_save_count;
-	struct mbsvplist_svp_struct	svp;
-	struct mbsvplist_svp_struct	svp_last;
-	int				svp_save_alloc = 0;
-	struct mbsvplist_svp_struct	*svp_save = NULL;
-	char	svp_file[MB_PATH_MAXLINE];
-	FILE	*svp_fp;
-	int	svp_read;
-	int	svp_read_tot;
-	int	svp_written;
-	int	svp_written_tot;
-	int	svp_repeat_in_file;
-	int	svp_unique;
-	int	svp_unique_tot;
-	int	output_counts = MB_NO;
-	int	out_cnt = 0;
-	int	min_num_pairs = 0;
-	int	svp_time_i[7];
-	
-	/* ttimes values */
-	int	ssv_output = MB_NO;
-	int	nbeams;
-	double	*ttimes = NULL;
-	double	*angles = NULL;
-	double	*angles_forward = NULL;
-	double	*angles_null = NULL;
-	double	*heave = NULL;
-	double	*alongtrack_offset = NULL;
-	double	ssv;
-
-	time_t	right_now;
-	char	date[32], user[MB_PATH_MAXLINE], *user_ptr, host[MB_PATH_MAXLINE];
-	int	read_data;
-	int	i, j, isvp;
-
-	/* get current default values */
-	status = mb_defaults(verbose,&format,&pings,&lonflip,bounds,
-		btime_i,etime_i,&speedmin,&timegap);
-	pings = 1;
-	bounds[0] = -360.0;
-	bounds[1] = 360.0;
-	bounds[2] = -90.0;
-	bounds[3] = 90.0;
-	svp_printmode = MBSVPLIST_PRINTMODE_CHANGE;
-	svp_file_output = MB_NO;
-	svp_setprocess = MB_NO;
-	svp_force_zero = MB_NO;
-	ssv_output = MB_NO;
-	svp_read_tot = 0;
-	svp_written_tot = 0;
-	svp_unique_tot = 0;
-	svp_last.n = 0;
-
-	/* set default input to datalist.mb-1 */
-	strcpy (read_file, "datalist.mb-1");
-
-	/* process argument list */
-	while ((c = getopt(argc, argv, "CcDdF:f:I:i:M:m:N:n:OoPpSsTtZzVvHh")) != -1)
-	  switch (c)
-		{
-		case 'H':
-		case 'h':
-			help++;
-			break;
-		case 'V':
-		case 'v':
-			verbose++;
-			break;
-		case 'D':
-		case 'd':
-			svp_printmode = MBSVPLIST_PRINTMODE_ALL;
-			break;
-		case 'C':
-		case 'c':
-			output_counts = MB_YES;
-			ssv_output = MB_NO;
-			break;
-		case 'F':
-		case 'f':
-			sscanf (optarg,"%d", &format);
-			flag++;
-			break;
-		case 'I':
-		case 'i':
-			sscanf (optarg,"%s", read_file);
-			flag++;
-			break;
-		case 'M':
-		case 'm':
-			sscanf (optarg,"%d", &svp_printmode);
-			flag++;
-			break;
-		case 'N':
-		case 'n':
-			sscanf (optarg,"%d", &min_num_pairs);
-			break;
-		case 'O':
-		case 'o':
-			svp_file_output = MB_YES;
-			ssv_output = MB_NO;
-			break;
-		case 'P':
-		case 'p':
-			svp_file_output = MB_YES;
-			svp_setprocess = MB_YES;
-			ssv_output = MB_NO;
-			break;
-		case 'S':
-		case 's':
-			ssv_output = MB_YES;
-			svp_file_output = MB_NO;
-			svp_setprocess = MB_NO;
-			break;
-		case 'T':
-		case 't':
-			output_as_table = MB_YES;
-			ssv_output = MB_NO;
-			break;
-		case 'Z':
-		case 'z':
-			svp_force_zero = MB_YES;
-			break;
-		case '?':
-			errflg++;
-		}
-
-	/* if error flagged then print it and exit */
-	if (errflg)
-		{
-		fprintf(stderr,"usage: %s\n", usage_message);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		error = MB_ERROR_BAD_USAGE;
-		exit(error);
-		}
-
-	/* print starting message */
-	if (verbose == 1 || help)
-		{
-		fprintf(stderr,"\nProgram %s\n",program_name);
-		fprintf(stderr,"Version %s\n",rcs_id);
-		fprintf(stderr,"MB-system Version %s\n",MB_VERSION);
-		}
-
-	/* print starting debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  Program <%s>\n",program_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Control Parameters:\n");
-		fprintf(stderr,"dbg2       verbose:        %d\n",verbose);
-		fprintf(stderr,"dbg2       help:           %d\n",help);
-		fprintf(stderr,"dbg2       format:         %d\n",format);
-		fprintf(stderr,"dbg2       pings:          %d\n",pings);
-		fprintf(stderr,"dbg2       lonflip:        %d\n",lonflip);
-		fprintf(stderr,"dbg2       bounds[0]:      %f\n",bounds[0]);
-		fprintf(stderr,"dbg2       bounds[1]:      %f\n",bounds[1]);
-		fprintf(stderr,"dbg2       bounds[2]:      %f\n",bounds[2]);
-		fprintf(stderr,"dbg2       bounds[3]:      %f\n",bounds[3]);
-		fprintf(stderr,"dbg2       btime_i[0]:     %d\n",btime_i[0]);
-		fprintf(stderr,"dbg2       btime_i[1]:     %d\n",btime_i[1]);
-		fprintf(stderr,"dbg2       btime_i[2]:     %d\n",btime_i[2]);
-		fprintf(stderr,"dbg2       btime_i[3]:     %d\n",btime_i[3]);
-		fprintf(stderr,"dbg2       btime_i[4]:     %d\n",btime_i[4]);
-		fprintf(stderr,"dbg2       btime_i[5]:     %d\n",btime_i[5]);
-		fprintf(stderr,"dbg2       btime_i[6]:     %d\n",btime_i[6]);
-		fprintf(stderr,"dbg2       etime_i[0]:     %d\n",etime_i[0]);
-		fprintf(stderr,"dbg2       etime_i[1]:     %d\n",etime_i[1]);
-		fprintf(stderr,"dbg2       etime_i[2]:     %d\n",etime_i[2]);
-		fprintf(stderr,"dbg2       etime_i[3]:     %d\n",etime_i[3]);
-		fprintf(stderr,"dbg2       etime_i[4]:     %d\n",etime_i[4]);
-		fprintf(stderr,"dbg2       etime_i[5]:     %d\n",etime_i[5]);
-		fprintf(stderr,"dbg2       etime_i[6]:     %d\n",etime_i[6]);
-		fprintf(stderr,"dbg2       speedmin:       %f\n",speedmin);
-		fprintf(stderr,"dbg2       timegap:        %f\n",timegap);
-		fprintf(stderr,"dbg2       file:           %s\n",file);
-		}
-
-	/* if help desired then print it and exit */
-	if (help)
-		{
-		fprintf(stderr,"\n%s\n",help_message);
-		fprintf(stderr,"\nusage: %s\n", usage_message);
-		exit(error);
-		}
-
-	/* get format if required */
-	if (format == 0)
-		mb_get_format(verbose,read_file,NULL,&format,&error);
-
-	/* determine whether to read one file or a list of files */
-	if (format < 0)
-		read_datalist = MB_YES;
-
-	/* open file list */
-	if (read_datalist == MB_YES)
-	    {
-	    if ((status = mb_datalist_open(verbose,&datalist,
-					    read_file,look_processed,&error)) != MB_SUCCESS)
-		{
-		error = MB_ERROR_OPEN_FAIL;
-		fprintf(stderr,"\nUnable to open data list file: %s\n",
-			read_file);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-	    if ((status = mb_datalist_read(verbose,datalist,
-			    file,&format,&file_weight,&error))
-			    == MB_SUCCESS)
-		read_data = MB_YES;
-	    else
-		read_data = MB_NO;
-	    }
-	/* else copy single filename to be read */
-	else
-	    {
-	    strcpy(file, read_file);
-	    read_data = MB_YES;
-	    }
-
-	/* loop over all files to be read */
-	while (read_data == MB_YES)
-	{
-	/* check format and get data sources */
-	if ((status = mb_format_source(verbose, &format,
-			&nav_source, &heading_source,
-			&vru_source, &svp_source,
-			&error)) == MB_FAILURE)
-		{
-		mb_error(verbose,error,&message);
-		fprintf(stderr,"\nMBIO Error returned from function <mb_format_source>:\n%s\n",message);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-
-	/* initialize reading the swath file */
-	if ((status = mb_read_init(
-		verbose,file,format,pings,lonflip,bounds,
-		btime_i,etime_i,speedmin,timegap,
-		&mbio_ptr,&btime_d,&etime_d,
-		&beams_bath,&beams_amp,&pixels_ss,&error)) != MB_SUCCESS)
-		{
-		mb_error(verbose,error,&message);
-		fprintf(stderr,"\nMBIO Error returned from function <mb_read_init>:\n%s\n",message);
-		fprintf(stderr,"\nMultibeam File <%s> not initialized for reading\n",file);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-
-	/* allocate memory for data arrays */
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(char), (void **)&beamflag, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(double), (void **)&bath, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_AMPLITUDE,
-						sizeof(double), (void **)&amp, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(double), (void **)&bathacrosstrack, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(double), (void **)&bathalongtrack, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_SIDESCAN,
-						sizeof(double), (void **)&ss, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_SIDESCAN,
-						sizeof(double), (void **)&ssacrosstrack, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_SIDESCAN,
-						sizeof(double), (void **)&ssalongtrack, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(double), (void **)&ttimes, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(double), (void **)&angles, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(double), (void **)&angles_forward, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(double), (void **)&angles_null, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(double), (void **)&heave, &error);
-	if (error == MB_ERROR_NO_ERROR)
-		status = mb_register_array(verbose, mbio_ptr, MB_MEM_TYPE_BATHYMETRY,
-						sizeof(double), (void **)&alongtrack_offset, &error);
-
-	/* if error initializing memory then quit */
-	if (error != MB_ERROR_NO_ERROR)
-		{
-		mb_error(verbose,error,&message);
-		fprintf(stderr,"\nMBIO Error allocating data arrays:\n%s\n",
-			message);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		exit(error);
-		}
-
-	/* output info */
-	if (verbose >= 1)
-		{
-		if (ssv_output == MB_YES)
-			fprintf(stderr, "\nSearching %s for SSV records\n", file);
-		else
-			fprintf(stderr, "\nSearching %s for SVP records\n", file);
-		}
-
-	/* read and print data */
-	svp_loaded = MB_NO;
-	svp.n = 0;
-	svp_save_count = 0;
-	svp_read = 0;
-	svp_written = 0;
-	svp_unique = 0;
-	while (error <= MB_ERROR_NO_ERROR)
-		{
-		/* read a data record */
-		status = mb_get_all(verbose,mbio_ptr,&store_ptr,&kind,
-			time_i,&time_d,&navlon,&navlat,
-			&speed,&heading,
-			&distance,&altitude,&sonardepth,
-			&beams_bath,&beams_amp,&pixels_ss,
-			beamflag,bath,amp,bathacrosstrack,bathalongtrack,
-			ss,ssacrosstrack,ssalongtrack,
-			comment,&error);
-
-		/* print debug statements */
-		if (verbose >= 2)
-			{
-			fprintf(stderr,"\ndbg2  Ping read in program <%s>\n",
-				program_name);
-			fprintf(stderr,"dbg2       kind:           %d\n",kind);
-			fprintf(stderr,"dbg2       error:          %d\n",error);
-			fprintf(stderr,"dbg2       status:         %d\n",status);
-			}
-
-		/* if svp then extract data */
-		if (error <= MB_ERROR_NO_ERROR
-			&& kind == svp_source
-			&& svp_source != MB_DATA_NONE)
-			{
-			/* extract svp */
-			status = mb_extract_svp(verbose, mbio_ptr, store_ptr,
-						&kind, &svp.n,
-						svp.depth, svp.velocity,
-						&error);
-			if (status == MB_SUCCESS)
-				{
-				svp_read++;
-				svp_loaded = MB_YES;
-				svp.match_last = MB_NO;
-				svp.repeat_in_file = MB_NO;
-				if (last_time_d != 0.0)
-					{
-					svp.time_set = MB_YES;
-					svp.time_d = last_time_d;
-					}
-				else
-					{
-					svp.time_set = MB_NO;
-					svp.time_d = 0.0;
-					}
-				if (navlon != 0.0 || navlat != 0.0)
-					{
-					svp.position_set = MB_YES;
-					svp.longitude = navlon;
-					svp.latitude = navlat;
-					}
-				else if (last_navlon != 0.0 || last_navlat != 0.0)
-					{
-					svp.position_set = MB_YES;
-					svp.longitude = last_navlon;
-					svp.latitude = last_navlat;
-					}
-				else
-					{
-					svp.position_set = MB_NO;
-					svp.longitude = 0.0;
-					svp.latitude = 0.0;
-					}
-				svp.depthzero_reset = MB_NO;
-				svp.depthzero = 0.0;
-				}
-			else
-				{
-				svp_loaded = MB_NO;
-				}
-
-			/* force zero depth if requested */
-			if (svp_loaded == MB_YES
-				&& svp.n > 0
-				&& svp_force_zero == MB_YES
-				&& svp.depth[0] != 0.0)
-				{
-				svp.depthzero = svp.depth[0];
-				svp.depth[0] = 0.0;
-				svp.depthzero_reset = MB_YES;
-				}
-
-			/* check if the svp is a duplicate to a previous svp
-				in the same file */
-			if (svp_loaded == MB_YES)
-				{
-				svp_match_last = MB_NO;
-				for (j=0; j<svp_save_count && svp_match_last == MB_YES; j++)
-					{
-					if (svp.n == svp_save[j].n
-						&& memcmp(svp.depth, svp_save[j].depth, svp.n) ==0
-						&& memcmp(svp.velocity, svp_save[j].velocity, svp.n)==0)
-						{
-						svp_match_last = MB_YES;
-						}
-					}
-				svp.match_last = svp_match_last;
-				}
-
-			/* check if the svp is a duplicate to the previous svp
-				whether from the same file or a previous file */
-			if (svp_loaded == MB_YES)
-				{
-				/* check if svp is the same as the previous */
-				if (svp.n == svp_last.n
-					&& memcmp(svp.depth, svp_last.depth, svp.n) ==0
-					&& memcmp(svp.velocity, svp_last.velocity, svp.n)==0)
-					{
-					svp_repeat_in_file = MB_YES;
-					}
-				else
-					{
-					svp_repeat_in_file = MB_NO;
-					}
-				svp.repeat_in_file = svp_repeat_in_file;
-
-				/* save the svp */
-				svp_last.time_set = MB_NO;
-				svp_last.position_set = MB_NO;
-				svp_last.n = svp.n;
-				for (i=0;i<svp.n;i++)
-					{
-					svp_last.depth[i] = svp.depth[i];
-					svp_last.velocity[i] = svp.velocity[i];
-					}
-				}
-
-			/* if the svp is unique so far, save it in memory */
-			if (svp_loaded == MB_YES
-				&& svp_match_last == MB_NO
-				&& svp.n >= min_num_pairs)
-				{
-				/* allocate memory as needed */
-				if (svp_save_count >= svp_save_alloc)
-					{
-					svp_save_alloc += MBSVPLIST_SVP_NUM_ALLOC;
-					status = mb_reallocd(verbose,__FILE__,__LINE__,
-								svp_save_alloc * sizeof(struct mbsvplist_svp_struct),
-								(void **)&svp_save, &error);
-					}
-
-				/* save the svp */
-				svp_save[svp_save_count].time_set = svp.time_set;
-				svp_save[svp_save_count].position_set = svp.position_set;
-				svp_save[svp_save_count].repeat_in_file = svp.repeat_in_file;
-				svp_save[svp_save_count].match_last = svp.match_last;
-				svp_save[svp_save_count].time_d = svp.time_d;
-				svp_save[svp_save_count].longitude = svp.longitude;
-				svp_save[svp_save_count].latitude = svp.latitude;
-				svp_save[svp_save_count].n = svp.n;
-				for (i=0;i<svp.n;i++)
-					{
-					svp_save[svp_save_count].depth[i] = svp.depth[i];
-					svp_save[svp_save_count].velocity[i] = svp.velocity[i];
-					}
-				svp_save_count++;
-				svp_unique++;
-				}
-			}
-
-		/* else if survey data save most recent ping time
-			and if ssv output desired call mb_ttimes() and output ssv */
-		else if (error <= MB_ERROR_NO_ERROR
-			&& kind == MB_DATA_DATA)
-			{
-			/* save most recent survey time stamp and position */
-			last_time_d = time_d;
-			last_navlon = navlon;
-			last_navlat = navlat;
-			
-			/* check if any saved svps need time tags and position */
-			if (time_d != 0.0 && (navlon != 0.0 || navlat != 0.0))
-				{
-				for (isvp=0;isvp<svp_save_count;isvp++)
-					{
-					if (svp_save[isvp].time_set == MB_NO)
-						{
-						svp_save[isvp].time_set = MB_YES;
-						svp_save[isvp].time_d = time_d;
-						}
-					if (svp_save[isvp].position_set == MB_NO)
-						{
-						svp_save[isvp].position_set = MB_YES;
-						svp_save[isvp].longitude = navlon;
-						svp_save[isvp].latitude = navlat;
-						}
-					}
-				}
-
-			/* if desired output ssv_output */
-			if (ssv_output == MB_YES)
-				{
-				/* extract ttimes */
-				status = mb_ttimes(verbose, mbio_ptr, store_ptr,
-						&kind, &nbeams,
-						ttimes, angles,
-						angles_forward, angles_null,
-						heave, alongtrack_offset,
-						&sonardepth, &ssv, &error);
-
-				/* output ssv */
-				if (status == MB_SUCCESS)
-					fprintf(stdout, "%f %f\n", sonardepth, ssv);
-				}
-			}
-		}
-
-	/* close the swath file */
-	status = mb_close(verbose,&mbio_ptr,&error);
-	
-	/* output svps from this file if there are any and ssv_output and output_counts are MB_NO */
-	if (svp_save_count > 0 && ssv_output == MB_NO && output_counts == MB_NO)
-		{
-		for (isvp = 0; isvp < svp_save_count; isvp++)
-			{
-			if (svp_save[isvp].n >= min_num_pairs
-				&& ((svp_printmode == MBSVPLIST_PRINTMODE_CHANGE
-						&& (svp_written == 0 || svp_save[isvp].repeat_in_file == MB_NO))
-					|| (svp_printmode == MBSVPLIST_PRINTMODE_UNIQUE
-						&& (svp_save[isvp].match_last == MB_NO))
-					|| (svp_printmode == MBSVPLIST_PRINTMODE_ALL)))
-				{
-				/* set the output */
-				if (svp_file_output == MB_YES)
-					{
-					/* set file name */
-					sprintf(svp_file, "%s_%3.3d.svp", file, isvp);
-
-					/* open the file */
-					svp_fp = fopen(svp_file, "w");
-					}
-				else
-					svp_fp = stdout;
-					
-				/* get time as date */
-				mb_get_date(verbose, svp_save[isvp].time_d, svp_time_i);
-
-				/* print out the svp */
-				if (output_as_table == MB_YES) /* output csv table to stdout */
-					{
-					if (out_cnt == 0) /* output header records */
-						{
-						printf("#mbsvplist CSV table output\n#navigation information is approximate\n#SVP_cnt,date_time,longitude,latitude,num_data_points\n");
-						}
-					out_cnt++;
-					printf( "%d,%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d,%.6f,%.6f,%d\n",out_cnt,
-							svp_time_i[0], svp_time_i[1],
-							svp_time_i[2], svp_time_i[3],
-							svp_time_i[4], svp_time_i[5],
-							svp_time_i[6],
-							svp_save[isvp].longitude,svp_save[isvp].latitude,
-							svp_save[isvp].n);
-					}
-				else if (svp_fp != NULL)
-					{
-					/* output info */
-					if (verbose >= 1)
-					    {
-					    fprintf(stderr, "Outputting SVP to file: %s (# svp pairs=%d)\n", svp_file,svp_save[isvp].n);
-					    }
-
-					/* write it out */
-					fprintf(svp_fp, "## MB-SVP %4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d %.9f %.9f\n",
-							    svp_time_i[0], svp_time_i[1],
-							    svp_time_i[2], svp_time_i[3],
-							    svp_time_i[4], svp_time_i[5],
-							    svp_time_i[6],
-							    svp_save[isvp].longitude,
-							    svp_save[isvp].latitude);
-					fprintf(svp_fp, "## Water Sound Velocity Profile (SVP)\n");
-					fprintf(svp_fp, "## Output by Program %s\n",program_name);
-					fprintf(svp_fp, "## Program Version %s\n",rcs_id);
-					fprintf(svp_fp, "## MB-System Version %s\n",MB_VERSION);
-					right_now = time((time_t *)0);
-					strcpy(date,ctime(&right_now));
-					date[strlen(date)-1] = '\0';
-					if ((user_ptr = getenv("USER")) == NULL)
-						user_ptr = getenv("LOGNAME");
-					if (user_ptr != NULL)
-						strcpy(user,user_ptr);
-					else
-						strcpy(user, "unknown");
-					gethostname(host,MB_PATH_MAXLINE);
-					fprintf(svp_fp, "## Run by user <%s> on cpu <%s> at <%s>\n",
-						user,host,date);
-					fprintf(svp_fp, "## Swath File: %s\n",file);
-					fprintf(svp_fp, "## Start Time: %4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%6.6d\n",
-							    svp_time_i[0], svp_time_i[1],
-							    svp_time_i[2], svp_time_i[3],
-							    svp_time_i[4], svp_time_i[5],
-							    svp_time_i[6]);
-					fprintf(svp_fp, "## SVP Longitude: %f\n", svp_save[isvp].longitude);
-					fprintf(svp_fp, "## SVP Latitude:  %f\n", svp_save[isvp].latitude);
-					fprintf(svp_fp, "## SVP Count: %d\n", svp_save_count);
-					if (svp_save[isvp].depthzero_reset == MB_YES)
-						{
-						fprintf(svp_fp, "## Initial depth reset from %f to 0.0 meters\n", svp_save[isvp].depthzero);
-						}
-					if (verbose >= 1 && svp_save[isvp].depthzero_reset == MB_YES)
-					    {
-					    fprintf(stderr, "Initial depth reset from %f to 0.0 meters\n", svp_save[isvp].depthzero);
-					    }
-					fprintf(svp_fp, "## Number of SVP Points: %d\n",svp_save[isvp].n);
-					for (i=0;i<svp_save[isvp].n;i++)
-						fprintf(svp_fp, "%8.2f\t%7.2f\n",
-							svp_save[isvp].depth[i], svp_save[isvp].velocity[i]);
-					if (svp_file_output == MB_NO)
-						{
-						fprintf(svp_fp, "## \n");
-						fprintf(svp_fp, "## \n");
-						}
-					svp_written++;
-					}
-
-				/* close the svp file */
-				if (svp_file_output == MB_YES
-					&& svp_fp != NULL)
-					{
-					fclose(svp_fp);
-
-					/* if desired, set first svp output to be used for recalculating
-						bathymetry */
-					if (svp_setprocess == MB_YES
-						&& svp_save_count == 1)
-						{
-						status = mb_pr_update_svp(verbose, file,
-								MB_YES, svp_file, MBP_ANGLES_OK, MB_YES, &error);
-						}
-					}
-				}
-			}
-		}
-
-	/* update total counts */
-	svp_read_tot += svp_read;
-	svp_unique_tot += svp_unique;
-	svp_written_tot += svp_written;
-
-	/* output info */
-	if (verbose >= 1)
-		{
-		fprintf(stderr, "%d SVP records read\n", svp_read);
-		fprintf(stderr, "%d SVP unique records read\n", svp_unique);
-		fprintf(stderr, "%d SVP records written\n", svp_written);
-		}
-
-	/* figure out whether and what to read next */
-        if (read_datalist == MB_YES)
-                {
-		if ((status = mb_datalist_read(verbose,datalist,
-				    file,&format,&file_weight,&error))
-				    == MB_SUCCESS)
-                        read_data = MB_YES;
-                else
-                        read_data = MB_NO;
-                }
-        else
-                {
-                read_data = MB_NO;
-                }
-
-	/* end loop over files in list */
-	}
-	if (read_datalist == MB_YES)
-		mb_datalist_close(verbose,&datalist,&error);
-
-	/* output info */
-	if (verbose >= 1)
-		{
-		fprintf(stderr, "\nTotal %d SVP records read\n", svp_read_tot);
-		fprintf(stderr, "Total %d SVP unique records found\n", svp_unique_tot);
-		fprintf(stderr, "Total %d SVP records written\n", svp_written_tot);
-		}
-	if (output_counts == MB_YES)
-		fprintf(stdout, "%d\n", svp_unique_tot);
-
-	/* deallocate memory */
-	status = mb_freed(verbose,__FILE__,__LINE__,(void **)&svp_save,&error);
-
-	/* check memory */
-	if (verbose >= 4)
-		status = mb_memory_list(verbose,&error);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  Program <%s> completed\n",
-			program_name);
-		fprintf(stderr,"dbg2  Ending status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* end it all */
-	exit(error);
-}
-/*--------------------------------------------------------------------*/
diff --git a/src/utilities/mbsvpselect.c b/src/utilities/mbsvpselect.c
deleted file mode 100644
index 77af9ee..0000000
--- a/src/utilities/mbsvpselect.c
+++ /dev/null
@@ -1,1819 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbsvpselect.c	03.03.2014
- *	$Id: mbsvpselect.c 2247 2015-05-29 21:28:28Z caress $
- *
- *    Copyright (c) 2014-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * Mbsvpselect chooses and implements the best available sound speed model
- * for each swath file in a survey. The user provides a list of the
- * available sound speed models and specifies the criteria used for
- * model selection. The program uses mbset to turn on bathymetry
- * recalculation by raytracing through the sound speed model selected
- * for each swath file.
- *
- * Author:	Ammar Aljuhne (ammaraljuhne at gmail.com)
- * Co-author:   Christian do Santos Ferreira (cferreira at marum.de)
- *              MARUM, University of Bremen
- * Date:	3 March 2014
- *
- * Description:
- *
- * The tool aims to help users to automatically apply the sound velocity
- * correction to the survey files. since most surveys involve several SVPs,
- * the seletion of the appropriate SVP for each survey profile is still
- * missing in MB-System.
- *
- * After finding the appropriate svp for each profile based on the choosed
- * method, the results are copied to a txt file that shows each survey
- * profile with the corresponding SVP. the tool also calls mbset automatically
- * so no need to assign SVP to the data. it is done automatically.
- *
- * There are 5 methods for choosing the appropriate SVP for each survey
- * profile. These methods are:
- *
- * 1. Nearest SVP in position: the middle position of each survey profile
- *    is calculated and the geodesics (shortest distance on the ellipsoid)
- *    to all SVPs are calcualted. and the SVP with the shortest distance is
- *    chosen. when the middle position of the survey profile is calculated
- *    there is an option to check for 0 lat 0 long wrong values. if it is
- *    found at the starting the geodesic will be calculated to the end of
- *    the profile.
- *
- * 2. Nearest in time: the time interveal between the starting time of
- *    the profile and the time of the SVP, and the SVP with  the shortest
- *    interval will be chosen.
- *
- * 3. Nearest in position within time: a default time radius from the
- *    profile is set as 10 hours, and within this period the nearest SVP
- *    in position is chosen. if none of the SVPs are within this period the
- *    nearest in position will be taken despit of the period threshold. The
- *    period threshold can be set by the user.
- *
- * 4. Nearest in time within range: similar to the previous option but
- *    this time a default range of 10000 meters is set and within this range
- *    the svp nearest in time is chosen. also this 10000 meter value could
- *    be set by the user.
- *
- * 5. Nearest in season within range: similar to the previous option the
- *    selected SVP could be chosen based on the month only not on the year.
- *    it means within the specified range the user could chose either the svp
- *    nearest in time or the svp nearest in month (this could be interpreted
- *    as the svp that falls in the same seasonal period despite of the year
- *    when it was taken).
- *
- * Mbsvpselect reads the .inf file of each swath file referenced in a recursive
- * datalist structure to determine the location and collection time of the
- * relevant data. The ancilliary *.inf, *.fbt, and *.fnv files must be created
- * first. The water sound speed models (called SVPs by convention as an acronym
- * for Sound Velocity Profiles) to be used must include one of three supported
- * file headers specifying the time and location of the model.
- *
- * University of Bremen SVP headers:
- *   MB-SVP 2011/01/08 19:30:00 -52.965437  -36.986314
- *   (keyword yyyy/mm/dd hh:mm:ss latitude longitude)
- *
- * MB-System SVPs as now output by mbsvplist:
- *   ## MB-SVP 2011/01/08 19:30:00 -36.986314 -52.965437
- *   (keyword yyyy/mm/dd hh:mm:ss longitude latitude)
- *
- * CARIS sound velocity header format:
- *   Section 2013-150 23:22:18 -57:02:01 -26:02:18
- *   (keyword yyyy-yearDay  hh:mm:ss latitude (degree:min:sec) longitude (degree:min:sec))
- *
- * Mbsvpselect supports SVP files with single models or files with multiple models where
- * new headers occur between models.
- *
- * Instructions:
- *
- * 1) Set up a survey (or surveys) for MB-System processing in the usual way,
- *    including creating a datalist file referencing the swath data of interest
- *    and generating the ancilliary *.inf, *.fbt, and *.fnv files for each of
- *    the swath files.
- * 2) Create an svplist file (analagous to a datalist, but referencing the
- *    relevant SVP files). Each SVP file is expected to be a text file with
- *    depth-sound speed pairs on each line (depth in meters, sound speed in
- *    meters/second) excepting for a header line at the start of each discrete
- *    model. Any of the header formats listed above will work.
- *    that refers to a local svp datalist. the local datalists includes
- * 3) In order to turn on bathymetry recalculation by raytracing through the
- *    most appropriate sound speed model for each swath file, call mbsvpselect:
- *
- *      mbsvpselect -N -V -Idatalist -Ssvplist [-P0, -P1, -P2/period, -P3/range, -P3/range/1]
- *
- *    -N is the option to check 0 latitude 0 longitude in the survey lines.
- *    -V verbosity.
- *    -I input datalist
- *    -S input svp datalist
- *    -P the method for choosing the svp where:
- *        -P or -P0                 is the nearest in position
- *        -P1                       is the nearest in time
- *        -P2                       is nearest in position within time (default time period is 10 hours)
- *        -P2/time                  is nearest in position within specified time period (in hours)
- *        -P3                       is nearest in time within range   (default range is 10000 meters)
- *        -P3/range or -P3/range/0  is nearest in time within specified range (in meters)
- *        -P3/range/1                     is nearest in month (seasonal) within specified range in meter.
- *
- * Example
- *
- * Suppose you are working in a directory called Survey_1 containing
- * swath files that need to have the bathymetry recalculated by
- * raytracing through water sound speed models. The local datalist
- * file might contain something like:
- *      13349457_3934_2845.mb88 88
- *      13645323_3433_5543.mb88 88
- *      46372536_6563_4637.mb88 88
- *      64362825_6344_2635.mb88 88
- *
- * or, if you use absolute passwords, something like:
- *
- *      /MyMac/User/Survey_1/13349457_3934_2845.mb88 88
- *      /MyMac/User/Survey_1/13645323_3433_5543.mb88 88
- *      /MyMac/User/Survey_1/46372536_6563_4637.mb88 88
- *      /MyMac/User/Survey_1/64362825_6344_2635.mb88 88
- *
- * By convention, this datalist will be named something
- * like datalist.mb-1, where the ".mb-1" suffix indicates to
- * MB-System programs that this is a datalist file. As
- * documented elsewhere, datalist files can contain entries
- * that reference datalists rather than single files; thus
- * datalists can be recursive.
- * 
- * Suppose that the water properties were variable during this
- * survey, with the variability dominated by location.Further suppose 
- * that there are three SVP files in a separate directory with
- * names such as svp1.svp, svp2.svp, and svp3.svp. Each of these files
- * contains a single model derived from CTD casts at a particular
- * place and time indicated in the single header line. In that directory
- * one can create an svplist file named SVP_list.mb-1 with contents:
- *      svp1.svp
- *      svp2.svp
- *      svp3.svp
- * Since mbsvpselect allows svplists to be recursive (like datalists),
- * one can create a second svplist named my_svplist.mb-1in the survey 
- * processing directory that references the first with an entry like:
- *
- *      /MyMac/User/Survey_1/SVP_folder/SVP_list.mb-1 -1
- *
- * In order to turn on bathymetry recalculation for all of the
- * swath files referenced by datalist.mb-1 using the most appropriate
- * of the available sound speed models, run mbsvpselect with arguments
- * like:
- *
- *      mbsvpselect -N -V -I datalist.mb-1 -S my_svplist.mb-1 -P2/50
- *
- * Here the -P2/50 option specifies that the sound speed model to be
- * used for each file will be the closest one collected within 50 hours
- * of the swath data. The bathymetry recalculation will be turned on
- * using an mbset call of the form:
- *
- *      mbset -Idatalist.mb-1 -PSVPFILE:/MyMac/User/Survey_1/SVP_folder/svp1.svp
- *
- * Following the mbsvpselect usage, mbprocess must be run to actually
- * reprocess the swath data, including bathymetry recalculation by
- * raytracing.
- * 
- */
-
-/* ---------------------------------------------------------------- */
-
-/* include files */
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <time.h>
-#include <math.h>
-#include <unistd.h>
-
-#include "mb_define.h"
-#include "mb_status.h"
-
-#include "geodesic.h"
-
-/* struct info_holder (shortly inf) hold the information from auxiliary files .inf
- * that are created from mbdatalist command */
-
-struct info_holder
-	{
-	int flag;
-	char *file_name;
-	long double s_lat;
-	long double s_lon;
-	double e_sec;
-	long double e_lat;
-	long double e_lon;
-	long double ave_lat;
-	long double ave_lon;
-	struct tm s_datum_time;
-	struct tm e_datum_time;
-	struct tm ave_datum_time;
-	time_t s_Time;
-	time_t e_time;
-	};
-typedef struct info_holder inf;
-
-/* struct svp_holder (shortly svp) hold the information from auxiliary files .inf
- * that are created from mbdatalist command */
-struct svp_holder
-	{
-	char *file_name;
-	long double s_lat;
-	long double s_lon;
-	struct tm svp_datum_time;
-	time_t svp_Time;
-	};
-typedef struct svp_holder svp;
-
-int Is_Leap(int year);
-void calc_ave_dateTime(inf *inf_hold);
-void JulianToGregorian(int year, int yearDay, int* year_tm, int* month, int* wDay);
-void GregorianToJulian(int year, int month, int day, int* yearDay);
-void fill_struct_inf(inf *inf_hold, char *holder);
-void fill_struct_svp(svp *svp_hold, char *holder);
-void read_list(char *list, char *list_2);
-void trim_newline(char string[]);
-void pause_screen();
-double convert_decimal(int deg, int min, int sec);
-void print_inf(inf *cd);
-void print_svp(svp *cd);
-void mid_point(long double lat1,
-	long double lon1,
-	long double lat2,
-	long double lon2,
-	long double *lat3,
-	long double *lon3);
-void pause_screen(void);
-
-/* global variables */
-int counter_i_i2=0;
-int p_flag=0;
-int p_3_time = 10;
-int p_4_range = 10000;
-int p_4_flage = 0;
-int verbose=0;
-int zero_test=0;
-int size_2=0;
-int n_p2 = 0;
-char dHolder[1000][1000];
-char sdHolder[1000][1000];
-
-
-char holder[1000][1000];	/* copy the buffer into holder array for indexing */
-char holder_2[1000][1000];	/* copy the buffer into holder array for indexing */
-char holder_3[1000][1000];
-char holder_4[1000][1000];
-char dBuffer[BUFSIZ];
-char sdBuffer[BUFSIZ];
-char buffer[BUFSIZ];		/* String to hold the file name */
-char buffer_2[BUFSIZ];
-
-static char version_id[] = "$Id: mbsvpselect.c 2247 2015-05-29 21:28:28Z caress $";
-
-/* ------------------------------------------------------------------- */
-
-int main
-(
-	int argc,
-	char ** argv
-)
-{
-	char program_name[] = "mbsvpselect";
-	char help_message[] =  "Program mbsvpselect chooses and implements the best available sound speed\n"
-                                "model for each swath file in a survey. The user provides a list of the\n"
-                                "available sound speed models and specifies the criteria used for\n"
-                                "model selection. The program uses mbset to turn on bathymetry\n"
-                                "recalculation by raytracing through the sound speed model selected\n"
-                                "for each swath file.";
-	char usage_message[] = "mbsvpselect -H -N -Idatalist -Ssvplist "
-                                "[-P0, -P1, -P2/period, -P3/range, -P3/range/1]  -V";
-	extern char *optarg;
-	int	errflg = 0;
-	int	c;
-	int	help = 0;
-	int	flag = 0;
-
-	/* MBIO status variables */
-	int	status = MB_SUCCESS;
-	int	verbose = 0;
-	int	error = MB_ERROR_NO_ERROR;
-
-	char datalist[BUFSIZ];
-	char svplist[BUFSIZ];
-
-	int n;
-	int n1, n2, n3;
-
-	strcpy(datalist, "datalist.mb-1");
-	strcpy(svplist, "svplist.mb-1");
-	while ((c = getopt(argc, argv, "HhI:i:S:s:P:p:VvNn")) != -1)
-		switch (c)
-			{
-		case 'H':
-		case 'h':
-			help++;
-			break;
-		case 'I':
-		case 'i':
-			sscanf(optarg, "%s", datalist);
-			flag++;
-			break;
-		case 'N':
-		case 'n':
-			zero_test+=1;
-			break;
-		case 'P':
-		case 'p':
-			n = sscanf(optarg, "%d/%d/%d", &n1, &n2, &n3);
-			n_p2 =n;
-			/* printf("\nthis is n %d \n", n); */
-			if ((n1!=0) && (n1!=1) && (n1!=2) && (n1!=3))
-				{
-				puts("Only four options are available: 0 for nearest position, 1 for nearest in time, 2 for both, 3 for nearest in time within range");
-				puts("The default is svp_nearest in position");
-				puts("If option 2 is chosen without specifying time period, 10 hours is the default value");
-				puts("If option 3 is chosen without specifying range, 10000 meters is the default value");
-				puts("If option 3 is chosen two options are available : nearest in time and nearest in month");
-				pause_screen();
-				exit(0);
-				}
-			else
-				{
-				if (n == 0)
-					p_flag = 0;
-				if (n==1)
-					{
-					p_flag = n1;
-					if (p_flag ==2)
-						{
-						p_3_time = 10;
-						n2 = p_3_time;
-						}
-					if (p_flag==3)
-						{
-						p_4_range = 10000;
-						n2 = p_4_range;
-						}
-					}
-				if (n ==2)
-					{
-					p_flag = n1;
-					if ((p_flag==0) || (p_flag ==1))
-						puts(
-							"The options -P0 for nearest in position or -P1 for nearest in time do not need further arguments");
-
-					if (p_flag==2)
-						p_3_time = n2;
-					if (p_flag == 3)
-						p_4_range = n2;
-					}
-				if(n==3)
-					{
-					p_flag = n1;
-					p_4_range = n2;
-					p_4_flage = n3;
-					if ((p_flag==0) || (p_flag ==1))
-						puts(
-							"The options -P0 for nearest in position or -P1 for nearest in time do not need further arguments");
-
-					if ((p_4_flage!=0) && (p_4_flage!=1))
-						{
-						puts(
-							"If option 3 is chosen two options are available : nearest in time with -P3/0 and nearest in month with -P3/1");
-						pause_screen();
-						exit(0);
-						}
-					}
-				}
-			flag++;
-			break;
-		case 'S':
-		case 's':
-			sscanf(optarg, "%s", svplist);
-			flag++;
-			break;
-		case 'V':
-		case 'v':
-			verbose++;
-			break;
-		default:
-			break;
-			}
-
-	/* if error flagged then print it and exit */
-	if (errflg)
-		{
-		fprintf(stderr,"usage: %s\n", usage_message);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		error = MB_ERROR_BAD_USAGE;
-		exit(error);
-		}
-
-	/* print starting message */
-	if (verbose == 1 || help)
-		{
-		fprintf(stderr,"\nProgram %s\n",program_name);
-		fprintf(stderr,"Version %s\n",version_id);
-		fprintf(stderr,"MB-system Version %s\n",MB_VERSION);
-		}
-
-	/* print starting debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  Program <%s>\n",program_name);
-		fprintf(stderr,"dbg2  Version %s\n",version_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Control Parameters:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       help:       %d\n",help);
-		fprintf(stderr,"dbg2       datalist:   %s\n",datalist);
-		fprintf(stderr,"dbg2       svplist:    %s\n",svplist);
-		fprintf(stderr,"dbg2       p_flag:     %d\n",p_flag);
-		fprintf(stderr,"dbg2       p_3_time:   %d\n",p_3_time);
-		fprintf(stderr,"dbg2       p_4_range:  %d\n",p_4_range);
-		fprintf(stderr,"dbg2       p_4_flage:  %d\n",p_4_flage);
-		fprintf(stderr,"dbg2       zero_test:  %d\n",zero_test);
-		}
-
-	/* if help desired then print it and exit */
-	if (help)
-		{
-		fprintf(stderr,"\n%s\n",help_message);
-		fprintf(stderr,"\nusage: %s\n", usage_message);
-		exit(error);
-		}
-
-        /* do the work */        
-	read_list(datalist, svplist);
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  Program <%s> completed\n",
-			program_name);
-		fprintf(stderr,"dbg2  Ending status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		fprintf(stderr,"dbg2       error:   %d\n",error);
-		}
-
-	/* end it all */
-	exit(error);
-        
-} /* main */
-/* ---------------------------------------------------------------- */
-
-/* ---------------------------------------------------------------- */
-/* Is leap old */
-int Is_Leap
-(
-	int year
-)
-{
-	if ( year%400 == 0)
-		return 0;
-	else if ( year%100 == 0)
-		return 1;
-	else if ( year%4 == 0 )
-		return 0;
-	else
-		return 1;
-}
-/* ---------------------------------------------------------------- */
-/*
- * calc_ave_dateTime function fill the struct with average date and time. it takes the starting date
- *of the file and the end date of the file and then calculate the diffeence in  seconds
- * then it transform the sec into time format and add it to the starting date
- *
-   void calc_ave_dateTime(inf *inf_hold)
-   {
-    //time_t *temp1 = &inf_hold->s_Time;
-    //time_t *temp2 = &inf_hold->e_time;
-    double s = difftime(inf_hold->s_Time, inf_hold->e_time);
-    if(s>86400.0)
-    {
-        printf("\n\n\n\n%f\n\n\n", s);
-    }
-    else
-    {
-        printf("\n\n\n\n%f\n\n\n", s);
-    }
-   }*/
-/* ---------------------------------------------------------------- */
-void JulianToGregorian
-(
-	int year,
-	int yearDay,
-	int* year_tm,
-	int* month,
-	int* wDay
-)
-{
-	*year_tm = year-1900;
-	if(Is_Leap(year) == 0)
-		{
-		if(yearDay > 335)
-			{
-			*month = 11; *wDay = yearDay - 335;
-			}
-		if((yearDay > 305) && (yearDay<=335))
-			{
-			*month = 10; *wDay = yearDay - 305;
-			}
-		if((yearDay > 274) && (yearDay<=305))
-			{
-			*month = 9; *wDay = yearDay - 274;
-			}
-		if((yearDay > 244) && (yearDay<=274))
-			{
-			*month = 8; *wDay = yearDay - 244;
-			}
-		if((yearDay > 213) && (yearDay<=244))
-			{
-			*month = 7; *wDay = yearDay - 213;
-			}
-		if((yearDay > 182) && (yearDay<=213))
-			{
-			*month = 6; *wDay = yearDay - 182;
-			}
-		if((yearDay > 152) && (yearDay<=182))
-			{
-			*month = 5; *wDay = yearDay - 152;
-			}
-		if((yearDay > 121) && (yearDay<=152))
-			{
-			*month = 4; *wDay = yearDay - 121;
-			}
-		if((yearDay > 91) && (yearDay<=121))
-			{
-			*month = 3; *wDay = yearDay - 91;
-			}
-		if((yearDay > 60) && (yearDay<=91))
-			{
-			*month = 2; *wDay = yearDay - 60;
-			}
-		if((yearDay > 31) && (yearDay<=60))
-			{
-			*month = 1; *wDay = yearDay - 274;
-			}
-		if(yearDay <31)
-			{
-			*month = 0; *wDay = yearDay;
-			}
-		}
-	else
-		{
-		if(yearDay > 334)
-			{
-			*month = 11; *wDay = yearDay - 334;
-			}
-		if((yearDay > 304) && (yearDay<=334))
-			{
-			*month = 10; *wDay = yearDay - 304;
-			}
-		if((yearDay > 273) && (yearDay<=304))
-			{
-			*month = 9; *wDay = yearDay - 273;
-			}
-		if((yearDay > 243) && (yearDay<=273))
-			{
-			*month = 8; *wDay = yearDay - 243;
-			}
-		if((yearDay > 212) && (yearDay<=243))
-			{
-			*month = 7; *wDay = yearDay - 212;
-			}
-		if((yearDay > 181) && (yearDay<=212))
-			{
-			*month = 6; *wDay = yearDay - 181;
-			}
-		if((yearDay > 151) && (yearDay<=181))
-			{
-			*month = 5; *wDay = yearDay - 151;
-			}
-		if((yearDay > 120) && (yearDay<=151))
-			{
-			*month = 4; *wDay = yearDay - 120;
-			}
-		if((yearDay > 90) && (yearDay<=120))
-			{
-			*month = 3; *wDay = yearDay - 90;
-			}
-		if((yearDay > 59) && (yearDay<=90))
-			{
-			*month = 2; *wDay = yearDay - 59;
-			}
-		if((yearDay > 31) && (yearDay<=59))
-			{
-			*month = 1; *wDay = yearDay - 31;
-			}
-		if(yearDay <31)
-			{
-			*month = 0; *wDay = yearDay;
-			}
-		}
-} /* JulianToGregorian */
-/* ---------------------------------------------------------------- */
-void GregorianToJulian
-(
-	int year,
-	int month,
-	int day,
-	int* yearDay
-)
-{
-	if(Is_Leap(year))
-		switch (month)
-			{
-		case 0:
-			*yearDay = day;
-			break;
-		case 1:
-			*yearDay = day + 31;
-			break;
-		case 2:
-			*yearDay = day + 59;
-			break;
-		case 3:
-			*yearDay = day + 90;
-			break;
-		case 4:
-			*yearDay = day + 120;
-			break;
-		case 5:
-			*yearDay = day + 151;
-			break;
-		case 6:
-			*yearDay = day + 181;
-			break;
-		case 7:
-			*yearDay = day + 212;
-			break;
-		case 8:
-			*yearDay = day + 243;
-			break;
-		case 9:
-			*yearDay = day + 273;
-			break;
-		case 10:
-			*yearDay = day + 304;
-			break;
-		case 11:
-			*yearDay = day + 334;
-			break;
-
-		default:
-			break;
-			} /* switch */
-	else
-		switch (month)
-			{
-		case 0:
-			*yearDay = day;
-			break;
-		case 1:
-			*yearDay = day + 31;
-			break;
-		case 2:
-			*yearDay = day + 60;
-			break;
-		case 3:
-			*yearDay = day + 91;
-			break;
-		case 4:
-			*yearDay = day + 121;
-			break;
-		case 5:
-			*yearDay = day + 152;
-			break;
-		case 6:
-			*yearDay = day + 182;
-			break;
-		case 7:
-			*yearDay = day + 213;
-			break;
-		case 8:
-			*yearDay = day + 244;
-			break;
-		case 9:
-			*yearDay = day + 274;
-			break;
-		case 10:
-			*yearDay = day + 305;
-			break;
-		case 11:
-			*yearDay = day + 335;
-			break;
-
-		default:
-			break;
-			} /* switch */
-} /* GregorianToJulian */
-/* ---------------------------------------------------------------- */
-/*this function fills the inf struct with the appropriate values
- * it takes a pointer to the inf_struct and the file_name (file_name.inf) to read information from
- */
-void fill_struct_inf
-(
-	inf *inf_hold,
-	char *holder
-)
-{
-	int mon, year;
-	double s_sec;
-	inf_hold->flag=0;
-	FILE *fileName;
-	inf_hold->file_name = holder;
-	struct tm *ptr;
-        
-	/* reading relative inf file */
-	fileName = fopen(inf_hold->file_name, "r");
-	if(fileName == NULL)
-		{
-		printf("%s could not be opened Please check the datalist files\n", inf_hold->file_name);
-		exit(1);
-		}
-
-	/* reaching start of data key word */
-
-
-	while(fgets(buffer, sizeof buffer, fileName)!=NULL)
-		if (strcmp(buffer, "Start of Data:\n")==0)
-			break;
-
-
-	/* parsing date and time*/
-
-	fgets(buffer, sizeof buffer, fileName);
-
-	sscanf(buffer,
-		"%*s %d %d %d %i:%i:%lf %*s %*s",
-		&mon,
-		&inf_hold->s_datum_time.tm_mday,
-		&year,
-		&inf_hold->s_datum_time.tm_hour,
-		&inf_hold->s_datum_time.tm_min,
-		&s_sec);
-	inf_hold->s_datum_time.tm_mon = mon-1;
-	inf_hold->s_datum_time.tm_year = year-1900;
-	s_sec = floor(s_sec);
-	inf_hold->s_datum_time.tm_sec = (int) s_sec;
-	GregorianToJulian(inf_hold->s_datum_time.tm_year,
-		inf_hold->s_datum_time.tm_mon,
-		inf_hold->s_datum_time.tm_mday,
-		&inf_hold->s_datum_time.tm_yday);
-
-	ptr = &inf_hold->s_datum_time;
-	inf_hold->s_Time = mktime(ptr);
-
-	/* Lon and Lat processing*/
-
-	fgets(buffer, sizeof buffer, fileName);
-
-	sscanf(buffer, "%*s %Lf %*s %Lf %*s %*f %*s", &inf_hold->s_lon, &inf_hold->s_lat);
-
-	/*parsing end of data information*/
-
-	while(fgets(buffer, sizeof buffer, fileName)!=NULL)
-		if (strcmp(buffer, "End of Data:\n")==0)
-			break;
-
-	fgets(buffer, sizeof buffer, fileName);
-
-	sscanf(buffer,
-		"%*s %d %d %d %i:%i:%lf %*s %*s",
-		&mon,
-		&inf_hold->e_datum_time.tm_mday,
-		&year,
-		&inf_hold->e_datum_time.tm_hour,
-		&inf_hold->e_datum_time.tm_min,
-		&s_sec);
-
-	inf_hold->e_datum_time.tm_mon = mon-1;
-	inf_hold->e_datum_time.tm_year = year-1900;
-	s_sec = floor(s_sec);
-	inf_hold->e_datum_time.tm_sec = (int) s_sec;
-
-	struct tm *ptr2 = &inf_hold->e_datum_time;
-	inf_hold->e_time = mktime(ptr2);
-
-	/* calc_ave_dateTime(inf_hold); */
-
-	/* Lon and Lat processing */
-	fgets(buffer, sizeof buffer, fileName);
-
-	sscanf(buffer, "%*s %Lf %*s %Lf %*s %*f %*s", &inf_hold->e_lon, &inf_hold->e_lat);
-	if (zero_test>0)
-		{
-		if ((inf_hold->s_lat == 0.0) && (inf_hold->s_lon == 0.0))
-			{
-			if ((inf_hold->e_lon == 0.0) && (inf_hold->e_lon == 0.0))
-				inf_hold->flag=3;
-			else
-				inf_hold->flag=1;
-			}
-		else
-			{
-			if ((inf_hold->e_lon == 0.0) && (inf_hold->e_lon == 0.0))
-				inf_hold->flag=2;
-			else
-				inf_hold->flag=0;
-			}
-		}
-	/* calculate the mid_point */
-	mid_point(inf_hold->s_lat,
-		inf_hold->s_lon,
-		inf_hold->e_lat,
-		inf_hold->e_lon,
-		&inf_hold->ave_lat,
-		&inf_hold->ave_lon);
-
-	fclose(fileName);
-} /* fill_struct_inf */
-/* ------------------------------------------------------------------- */
-/* SVP tool is able to read only two SVP formats
- *
- *
- */
-
-/* ------------------------------------------------------------------- */
-void fill_struct_svp
-(
-	svp *svp_hold,
-	char *holder
-)
-{
-	int yearDay, month, year;
-	double seconds;
-	int s_lat_min=0;
-	int s_lat_deg=0;
-	int s_lat_sec =0;
-	int s_lon_min=0;
-	int s_lon_deg=0;
-	int s_lon_sec =0;
-	FILE *fileName;
-	svp_hold->file_name = holder;
-	char caris_str[] = "Section";
-	char mb1_str[] = "## MB-SVP";
-	char mb2_str[] = "MB-SVP";
-	char *ptr_caris = NULL;
-	char *ptr_mb1 = NULL;
-	char *ptr_mb2 = NULL;
-
-	/* reading relative svp file */
-	fileName = fopen(svp_hold->file_name, "r");
-
-	if(fileName == NULL)
-		{
-		printf("%s could not be opend\n", svp_hold->file_name);
-		exit(1);
-		}
-
-	/* reaching start of data */
-
-	while(fgets(buffer, sizeof buffer, fileName)!=NULL)
-		{
-		ptr_caris = strstr(buffer, caris_str);
-		ptr_mb1 = strstr(buffer, mb1_str);
-		ptr_mb2 = strstr(buffer, mb2_str);
-		if (ptr_caris != NULL)
-			{
-			printf("\n%s\n", buffer);
-			sscanf(buffer,
-				"%*s %d-%d  %i:%i:%i %d:%d:%d %d:%d:%d",
-				&year,
-				&yearDay,
-				&svp_hold->svp_datum_time.tm_hour,
-				&svp_hold->svp_datum_time.tm_min,
-				&svp_hold->svp_datum_time.tm_sec,
-				&s_lat_deg,
-				&s_lat_min,
-				&s_lat_sec,
-				&s_lon_deg,
-				&s_lon_min,
-				&s_lon_sec);
-			svp_hold->svp_datum_time.tm_year = year-1900;
-			svp_hold->svp_datum_time.tm_yday= yearDay;
-			JulianToGregorian(year,
-				yearDay,
-				&svp_hold->svp_datum_time.tm_year,
-				&svp_hold->svp_datum_time.tm_mon,
-				&svp_hold->svp_datum_time.tm_mday);
-			/* Julian to Gregorian date */
-			/* svp_hold->svp_datum_time.tm_yday = yearDay - 1; */
-			/* svp_hold->svp_datum_time.tm_year = year-1900; */
-
-
-
-			struct tm *ptr1 = &svp_hold->svp_datum_time;
-			svp_hold->svp_Time = mktime(ptr1);
-
-			/* latitude to decimal */
-			svp_hold->s_lat = convert_decimal(s_lat_deg, s_lat_min, s_lat_sec);
-			/* longitude to decimal */
-			svp_hold->s_lon = convert_decimal(s_lon_deg, s_lon_min, s_lon_sec);
-			break;
-			}
-		else if (ptr_mb1 != NULL)
-			{
-			printf("\n%s\n", buffer);
-			sscanf(buffer,
-				"## MB-SVP %d/%d/%d %d:%d:%lf %Lf %Lf",
-				&year,
-				&month,
-				&svp_hold->svp_datum_time.tm_mday,
-				&svp_hold->svp_datum_time.tm_hour,
-				&svp_hold->svp_datum_time.tm_min,
-				&seconds,
-				&svp_hold->s_lon,
-				&svp_hold->s_lat);
-
-			svp_hold->svp_datum_time.tm_mon = month - 1;
-			svp_hold->svp_datum_time.tm_year = year-1900;
-			svp_hold->svp_datum_time.tm_sec = seconds;
-			GregorianToJulian(svp_hold->svp_datum_time.tm_year,
-				svp_hold->svp_datum_time.tm_mon,
-				svp_hold->svp_datum_time.tm_mday,
-				&svp_hold->svp_datum_time.tm_yday);
-			struct tm *ptr = &svp_hold->svp_datum_time;
-			svp_hold->svp_Time = mktime(ptr);
-
-			break;
-			}
-		else if (ptr_mb2 != NULL)
-			{
-			printf("\n%s\n", buffer);
-			sscanf(buffer,
-				"%*s %d/%d/%d %i:%i %Lf %Lf",
-				&year,
-				&month,
-				&svp_hold->svp_datum_time.tm_mday,
-				&svp_hold->svp_datum_time.tm_hour,
-				&svp_hold->svp_datum_time.tm_min,
-				&svp_hold->s_lat,
-				&svp_hold->s_lon);
-
-			svp_hold->svp_datum_time.tm_mon = month - 1;
-			svp_hold->svp_datum_time.tm_year = year-1900;
-			svp_hold->svp_datum_time.tm_sec = 0;
-			GregorianToJulian(svp_hold->svp_datum_time.tm_year,
-				svp_hold->svp_datum_time.tm_mon,
-				svp_hold->svp_datum_time.tm_mday,
-				&svp_hold->svp_datum_time.tm_yday);
-			struct tm *ptr = &svp_hold->svp_datum_time;
-			svp_hold->svp_Time = mktime(ptr);
-
-			break;
-			}
-		}
-
-	fclose(fileName);
-} /* fill_struct_svp */
-/* ------------------------------------------------------------------- */
-void read_list
-(
-	char *list,
-	char *list_2
-)
-{
-	int size =0;
-	int i=0;
-	int i2=0;
-	/* int counter_i2 = 0; */
-	int j=0;
-	FILE *fDatalist;
-	FILE *fSvp;
-        FILE *testOpen;
-	FILE *fresult;
-	FILE *sdHold_file;
-	inf *inf_hold = NULL;
-	svp *svp_hold = NULL;
-	double dist[size][size_2];
-	double time_hold[size][size_2];
-	double hour_hold[size][size_2];
-	double min_hold[size][size_2];
-	double day_hold[size][size_2];
-	/* double dist_time[size][size_2]; */
-	double min_time[size];
-	double min_dis[size];
-	/* double max_dist[size]; */
-	int n = 0;
-	struct geod_geodesic g;
-	double azi1, azi2;
-        int count;
-
-	atexit(pause_screen);				/* pause the screen */
-
-	/* open datalist.mb-1 for names of the files */
-	fDatalist = fopen(list, "r");
-	fSvp      = fopen(list_2, "r");
-	if(fDatalist == NULL)
-		{
-		printf("%s Could not be found", list);
-		exit(1);
-		}
-
-	if(fSvp == NULL)
-		{
-		printf("%s Could not be found", list_2);
-		exit(1);
-		}
-	fresult = fopen("result.txt", "w+");
-	if(fresult == NULL)
-		{
-		printf("result.txt could not be found");
-		exit(1);
-		}
-	/* ------------------------------ */
-
-	while(fgets(dBuffer, sizeof dBuffer, fDatalist)!=NULL)
-		{
-		strcpy(holder[i], dBuffer);
-		while(holder[i][strlen(holder[i])-1] != ' ')
-			holder[i][strlen(holder[i])-1] = '\0';
-		holder[i][strlen(holder[i])-1] = '\0';
-		strcat(holder[i], ".inf");
-		testOpen = fopen(holder[i], "r");
-		if (testOpen==NULL)
-			{
-			i2=i;
-			strcpy(dHolder[i], dBuffer);
-			while(dHolder[i][strlen(dHolder[i])-1] != ' ')
-				dHolder[i][strlen(dHolder[i])-1] = '\0';
-			dHolder[i][strlen(dHolder[i])-1] = '\0';
-
-			FILE *dHold_file;
-			strcpy(holder_3[i], dHolder[i]);
-			while (holder_3[i][strlen(holder_3[i])-1] != '/')
-				holder_3[i][strlen(holder_3[i])-1] = '\0';
-
-			dHold_file = fopen(dHolder[i], "r");
-
-			if(dHold_file == NULL)
-				{
-				printf("%s Could not be found file in absolute path", dHolder[i]);
-				exit(1);
-				}
-			else
-				{
-				while(fgets(buffer, sizeof buffer, dHold_file)!=NULL)
-					{
-					strcpy(holder[i2], holder_3[i]);
-
-					/* printf("  \ntest 1 %s \n", holder[i2]); */
-					strcat(holder[i2], buffer);
-
-					/* printf("  \n %s \n", holder_2[i2]); */
-					/* printf("  \ntest 1 %s \n", holder[i2]); */
-					while(holder[i2][strlen(holder[i2])-1] != ' ')
-						holder[i2][strlen(holder[i2])-1] = '\0';
-					holder[i2][strlen(holder[i2])-1] = '\0';
-					strcat(holder[i2], ".inf");
-					/* printf("  \n %s %d %d\n", holder[i2], i , i2); */
-					/* printf("  \n %s \n", holder[i2]); */
-					/*fclose(dHold_file);*/
-					i2++;
-					counter_i_i2+=1;
-					}
-				/* counter_i2 += i2; */
-
-				fclose(dHold_file);
-				}
-			printf(" \n\n %d --- %d\n\n", i, i2);
-			}
-		if (i<i2)
-			i=i2;
-		else
-			i++;
-
-		}
-
-	/* ------------------------------ */
-
-	/* fill size */
-	if (i>i2)
-		size =i;
-	else
-		size=i2;
-	printf("\n\n%d files to be read in the datalist\n\n", size);
-
-	/* Allocate memory for inf_struct */
-	inf_hold = malloc((size)*sizeof(inf));
-	if(inf_hold==NULL)
-		{
-		printf("no memory for the process end of process");
-		exit(1);
-		}
-
-	for(i=0; i<size; i++)
-		{
-		fill_struct_inf(&inf_hold[i], holder[i]);
-		if (verbose==1)
-			print_inf(&inf_hold[i]);
-		}
-
-	/* reset for svp_hold */
-	i=0;
-	i2=0;
-	/* ------------------------ */
-	while(fgets(sdBuffer, sizeof sdBuffer, fSvp)!=NULL)
-		{
-		strcpy(sdHolder[i], sdBuffer);
-		while(sdHolder[i][strlen(sdHolder[i])-1] != ' ')
-			sdHolder[i][strlen(sdHolder[i])-1] = '\0';
-		sdHolder[i][strlen(sdHolder[i])-1] = '\0';
-		strcpy(holder_4[i], sdHolder[i]);
-		while (holder_4[i][strlen(holder_4[i])-1] != '/')
-			holder_4[i][strlen(holder_4[i])-1] = '\0';
-
-		sdHold_file = fopen(sdHolder[i], "r");
-		if(sdHold_file == NULL)
-			{
-			printf("Failure to open file: %s\n", sdHolder[i]);
-			exit(1);
-			}
-		else
-			{
-			while(fgets(buffer_2, sizeof buffer_2, sdHold_file)!=NULL)
-				{
-				strcpy(holder_2[i2], holder_4[i]);
-				strcat(holder_2[i2], buffer_2);
-				trim_newline(holder_2[i2]);
-
-				i2++;
-				}
-			fclose(sdHold_file);
-			}
-		i++;
-		}
-	/* ------------------------ */
-	printf("\n\n\n%d svp to be read\n\n\n", i2);
-	/* fill size of svp_list */
-	size_2=i2;
-
-	/* Allocate memory for svp_struct */
-	svp_hold = malloc((size_2)*sizeof(svp));
-	if(svp_hold==NULL)
-		{
-		printf("no memory for the process end of process");
-		exit(1);
-		}
-
-	for(i=0; i<size_2; i++)
-		{
-		fill_struct_svp(&svp_hold[i], holder_2[i]);
-		if (verbose==1)
-			print_svp(&svp_hold[i]);
-		}
-
-	/* calculating the distances and choose the appropriate file */
-	if(p_flag==0)
-		printf("\n Method chosen is %d nearest in position\n", p_flag);
-	if(p_flag==1)
-		printf("\n Method chosen is %d nearest in time\n", p_flag);
-	if(p_flag==2)
-		{
-		printf("\n Method chosen is %d nearest in position within time\n", p_flag);
-		if (n_p2==1)
-			printf(
-				"\n No specific time period was entered and the default time period %d hours will be taken\n",
-				p_3_time);
-		if (n_p2==2)
-			printf("\n Time period %d hours will be taken\n", p_3_time);
-		}
-	if(p_flag==3)
-		{
-		printf("\n Method chosen is %d nearest in time within range\n", p_flag);
-		printf("\n range  %d meters will be taken\n", p_4_range);
-		if (p_4_flage==0)
-			printf("\n Option 0 was chosen. The nearest in time within range will be calculated\n");
-
-		if (p_4_flage==1)
-			printf(
-				"\n Option 1 was chosen. The nearest in month within range will be calculated. This will calculate within the specified range the SVP with the nearest month to the profile regardless of the year. This is the seasonal interpretation \n");
-
-		}
-	geod_init(&g, A_, F_);
-	for(i=0; i<size; i++)
-		{
-		char all_in_sys[BUFSIZ]= "mbset";
-		if(p_flag==0)
-			{
-			switch (inf_hold[i].flag)
-				{
-			case 0:
-
-				if (verbose==1)
-					puts("\n\n========N check passed no 0.0 position was found===========\n\n");
-				if (verbose==1)
-					printf("\nCalculating the distances to all svp profiles for %s\n",
-						inf_hold[i].file_name);
-				for(j=0; j<size_2; j++)
-					{
-					geod_inverse(&g,
-						inf_hold[i].ave_lat,
-						inf_hold[i].ave_lon,
-						svp_hold[j].s_lat,
-						svp_hold[j].s_lon,
-						&dist[i][j],
-						&azi1,
-						&azi2);
-					if (verbose==1)
-						printf("Distance number %d is : %lf\n", j, dist[i][j]);
-					}
-				if (verbose==1)
-					printf("\nSearching for the SVP with nearest position\n");
-				min_dis[i] = dist[i][0];
-				for(j=0; j<size_2; j++)
-					if(min_dis[i]>dist[i][j])
-						{
-						min_dis[i] = dist[i][j];
-						n=j;
-						}
-				if (verbose==1)
-					printf("the shortest distance is number %d from the list\n", n);
-				if (verbose==1)
-					puts("==================================================");
-
-				fprintf(fresult,
-					"%s\n",
-					"============================================================");
-				fprintf(fresult, "%s\t", inf_hold[i].file_name);
-				fprintf(fresult, "%s\n", svp_hold[n].file_name);
-				fprintf(fresult,
-					"%s\n",
-					"=============================================================");
-				printf("Calling mbset\n");
-				/* printf("%s\n", all_in_sys); */
-				strcat(all_in_sys, " -I ");
-				inf_hold[i].file_name[strlen(inf_hold[i].file_name)-1]='\0';
-				inf_hold[i].file_name[strlen(inf_hold[i].file_name)-1]='\0';
-				inf_hold[i].file_name[strlen(inf_hold[i].file_name)-1]='\0';
-				inf_hold[i].file_name[strlen(inf_hold[i].file_name)-1]='\0';
-				strcat(all_in_sys, inf_hold[i].file_name);
-				/* printf("%s\n", all_in_sys); */
-				strcat(all_in_sys, " -PSVPFILE:");
-				strcat(all_in_sys, svp_hold[n].file_name);
-				printf("%s\n", all_in_sys);
-				system(all_in_sys);
-				break;
-			case 1:
-				if (verbose==1)
-					puts(
-						"\n\n=====================N check:   0.0 position was found=====================\n\n");
-
-				if (verbose==1)
-					printf(
-						"\nThe file %s has no navigation information at the start position and the svp profile will be assigned to the end point of the file\n",
-						inf_hold[i].file_name);
-				for(j=0; j<size_2; j++)
-					{
-					geod_inverse(&g,
-						inf_hold[i].s_lat,
-						inf_hold[i].s_lon,
-						svp_hold[j].s_lat,
-						svp_hold[j].s_lon,
-						&dist[i][j],
-						&azi1,
-						&azi2);
-					if (verbose==1)
-						printf("Distance number %d is : %lf\n", j, dist[i][j]);
-					}
-
-				if (verbose==1)
-					printf("\nSearching for the SVP with the nearest position\n");
-
-				min_dis[i] = dist[i][0];
-
-				for(j=0; j<size_2; j++)
-					if(min_dis[i]>dist[i][j])
-						{
-						min_dis[i] = dist[i][j];
-						n=j;
-						}
-				if (verbose==1)
-					printf("the shortest distance is number %d from the list\n", n);
-				if (verbose==1)
-					puts("==================================================");
-
-				fprintf(fresult,
-					"%s\n",
-					"============================================================");
-				fprintf(fresult, "%s\t", inf_hold[i].file_name);
-				fprintf(fresult, "%s\n", svp_hold[n].file_name);
-				fprintf(fresult,
-					"%s\n",
-					"=============================================================");
-				printf("Building the parameters to call mbset\n");
-				/* printf("%s\n", all_in_sys); */
-				strcat(all_in_sys, " -I ");
-				inf_hold[i].file_name[strlen(inf_hold[i].file_name)-1]='\0';
-				inf_hold[i].file_name[strlen(inf_hold[i].file_name)-1]='\0';
-				inf_hold[i].file_name[strlen(inf_hold[i].file_name)-1]='\0';
-				inf_hold[i].file_name[strlen(inf_hold[i].file_name)-1]='\0';
-				strcat(all_in_sys, inf_hold[i].file_name);
-				/* printf("%s\n", all_in_sys); */
-				strcat(all_in_sys, " -P ");
-				strcat(all_in_sys, svp_hold[n].file_name);
-				printf("%s\n", all_in_sys);
-				system(all_in_sys);
-				break;
-			case 2:
-				if (verbose==1)
-					puts(
-						"\n\n==============N check:   0.0 position was found===================\n\n");
-
-				if (verbose==1)
-					printf(
-						"\nThe file %s has no navigation information at the end position and the svp profile will be assigned to the start point of the file\n",
-						inf_hold[i].file_name);
-				for(j=0; j<size_2; j++)
-					{
-					geod_inverse(&g,
-						inf_hold[i].e_lat,
-						inf_hold[i].e_lon,
-						svp_hold[j].s_lat,
-						svp_hold[j].s_lon,
-						&dist[i][j],
-						&azi1,
-						&azi2);
-					if (verbose==1)
-						printf("Distance number %d is : %lf\n", j, dist[i][j]);
-					}
-				if (verbose==1)
-					printf("\nSearching for the SVP with the nearest position\n");
-
-				min_dis[i] = dist[i][0];
-
-				for(j=0; j<size_2; j++)
-					if(min_dis[i]>dist[i][j])
-						{
-						min_dis[i] = dist[i][j];
-						n=j;
-						}
-				if (verbose==1)
-					printf("the shortest distance is number %d from the list\n", n);
-				if (verbose==1)
-					puts("==================================================");
-				fprintf(fresult,
-					"%s\n",
-					"============================================================");
-				fprintf(fresult, "%s\t", inf_hold[i].file_name);
-				fprintf(fresult, "%s\n", svp_hold[n].file_name);
-				printf("Building the parameters to call mbset\n");
-				/* printf("%s\n", all_in_sys); */
-				strcat(all_in_sys, " -I ");
-				inf_hold[i].file_name[strlen(inf_hold[i].file_name)-1]='\0';
-				inf_hold[i].file_name[strlen(inf_hold[i].file_name)-1]='\0';
-				inf_hold[i].file_name[strlen(inf_hold[i].file_name)-1]='\0';
-				inf_hold[i].file_name[strlen(inf_hold[i].file_name)-1]='\0';
-				strcat(all_in_sys, inf_hold[i].file_name);
-				/* printf("%s\n", all_in_sys); */
-				strcat(all_in_sys, " -P ");
-				strcat(all_in_sys, svp_hold[n].file_name);
-				printf("%s\n", all_in_sys);
-				system(all_in_sys);
-				fprintf(fresult,
-					"%s\n",
-					"=============================================================");
-				break;
-			case 3:
-				if (verbose==1)
-					{
-					puts(
-						"\n\n==============N check:   0.0 position was found====================\n\n");
-					printf(
-						"\n!!!The file %s has no navigation information and no svp will be assigned to it!!!\n",
-						inf_hold[i].file_name);
-					fprintf(fresult,
-						"%s\n",
-						"============================================================");
-					fprintf(fresult, "%s\t", inf_hold[i].file_name);
-					fprintf(fresult, "%s\n", "NaN");
-					}
-				break;
-
-			default:
-				break;
-				} /* switch */
-			}
-		else
-			{
-			if (p_flag==1)			/* calculate the nearest in time */
-				{
-				if (verbose==1)
-					puts("==================================================");
-				if (verbose==1)
-					printf("\nCalculating the nearest svp in time for for %s\n",
-						inf_hold[i].file_name);
-				for(j=0; j<size_2; j++)
-					{
-					time_hold[i][j] = abs(difftime(inf_hold[i].s_Time, svp_hold[j].svp_Time));
-					if (verbose==1)
-						printf("Time number %d is : %lf\n", j, time_hold[i][j]);
-					}
-				if (verbose==1)
-					printf("\nSearch for the SVP that is the nearest in Time\n");
-				min_time[i] = time_hold[i][0];
-				for(j=0; j<size_2; j++)
-					if(min_time[i]>time_hold[i][j])
-						{
-						min_time[i] = time_hold[i][j];
-						n=j;
-						}
-				if (verbose==1)
-					printf("the shortest time interval is %d\n", n);
-				if (verbose==1)
-					puts("==================================================");
-
-				fprintf(fresult,
-					"%s\n",
-					"============================================================");
-				fprintf(fresult, "%s\t", inf_hold[i].file_name);
-				fprintf(fresult, "%s\n", svp_hold[n].file_name);
-				fprintf(fresult,
-					"%s\n",
-					"=============================================================");
-				printf("Building the parameters to call mbset\n");
-				/* printf("%s\n", all_in_sys); */
-				strcat(all_in_sys, " -I ");
-				inf_hold[i].file_name[strlen(inf_hold[i].file_name)-1]='\0';
-				inf_hold[i].file_name[strlen(inf_hold[i].file_name)-1]='\0';
-				inf_hold[i].file_name[strlen(inf_hold[i].file_name)-1]='\0';
-				inf_hold[i].file_name[strlen(inf_hold[i].file_name)-1]='\0';
-				strcat(all_in_sys, inf_hold[i].file_name);
-				/* printf("%s\n", all_in_sys); */
-				strcat(all_in_sys, " -PSVPFILE:");
-				strcat(all_in_sys, svp_hold[n].file_name);
-				printf("%s\n", all_in_sys);
-				system(all_in_sys);
-				}
-			/************calculate the nearest in position within time***************************/
-			if(p_flag==2)
-				{
-				if (verbose==1)
-					puts("==================================================");
-				if (verbose==1)
-					printf(
-						"\nCalculating the nearest svp in position within %d time period for for %s\n",
-						p_3_time,
-						inf_hold[i].file_name);
-				for(j=0; j<size_2; j++)
-					{
-					time_hold[i][j] = abs(difftime(inf_hold[i].s_Time, svp_hold[j].svp_Time));
-					/* dist[i][j] = distVincenty(inf_hold[i].ave_lat, inf_hold[i].ave_lon,
-					   svp_hold[j].s_lat, svp_hold[j].s_lon); */
-					geod_inverse(&g,
-						inf_hold[i].ave_lat,
-						inf_hold[i].ave_lon,
-						svp_hold[j].s_lat,
-						svp_hold[j].s_lon,
-						&dist[i][j],
-						&azi1,
-						&azi2);
-					if (verbose==1)
-						printf("Time %d is : %lf\n", j, time_hold[i][j]);
-					if (verbose==1)
-						printf("Dist %d is : %lf\n", j, dist[i][j]);
-					}
-				min_dis[i] = dist[i][0];
-
-				int count;
-				count = 0;
-
-				for(j=0; j<size_2; j++)
-					if(min_dis[i]>dist[i][j])
-						{
-						min_dis[i] = dist[i][j];
-						n=j;
-						}
-				for(j=0; j<size_2; j++)
-					{
-					int c = 0;
-					c = time_hold[i][j] - (p_3_time*3600);
-					if (c <= 0)
-						{
-						if (count == 0)
-							{
-							min_dis[i] = dist[i][j];
-							n=j;
-							count+=1;
-							}
-						else if (min_dis[i]>dist[i][j])
-							{
-							min_dis[i] = dist[i][j];
-							n=j;
-							}
-						}
-					}
-				fprintf(fresult,
-					"%s\n",
-					"============================================================");
-				fprintf(fresult, "%s\t", inf_hold[i].file_name);
-				fprintf(fresult, "%s\n", svp_hold[n].file_name);
-				fprintf(fresult,
-					"%s\n",
-					"=============================================================");
-				printf("Building the parameters to call mbset\n");
-				/* printf("%s\n", all_in_sys); */
-				strcat(all_in_sys, " -I ");
-				inf_hold[i].file_name[strlen(inf_hold[i].file_name)-1]='\0';
-				inf_hold[i].file_name[strlen(inf_hold[i].file_name)-1]='\0';
-				inf_hold[i].file_name[strlen(inf_hold[i].file_name)-1]='\0';
-				inf_hold[i].file_name[strlen(inf_hold[i].file_name)-1]='\0';
-				strcat(all_in_sys, inf_hold[i].file_name);
-				/* printf("%s\n", all_in_sys); */
-				strcat(all_in_sys, " -PSVPFILE:");
-				strcat(all_in_sys, svp_hold[n].file_name);
-				printf("%s\n", all_in_sys);
-				system(all_in_sys);
-				}
-			if (p_flag==3)
-				{
-				if (verbose==1)
-					puts("==================================================");
-				if (verbose==1)
-					printf("\nCalculating the nearest svp in time within %d range for for %s\n",
-						p_4_range,
-						inf_hold[i].file_name);
-				if(p_4_flage ==0)
-					printf("\n Calculating the nearest SVP in time\n");
-				if(p_4_flage ==1)
-					printf("\n Calculating the nearest SVP in month (seasonal selection)\n");
-				for(j=0; j<size_2; j++)
-					{
-					day_hold[i][j] = abs(
-						inf_hold[i].s_datum_time.tm_yday - svp_hold[j].svp_datum_time.tm_yday);
-					hour_hold[i][j] = abs(
-						inf_hold[i].s_datum_time.tm_hour - svp_hold[j].svp_datum_time.tm_hour);
-					min_hold[i][j] = abs(
-						inf_hold[i].s_datum_time.tm_min - svp_hold[j].svp_datum_time.tm_min);
-					time_hold[i][j] = abs(difftime(inf_hold[i].s_Time, svp_hold[j].svp_Time));
-					/* dist[i][j] = distVincenty(inf_hold[i].ave_lat, inf_hold[i].ave_lon,
-					   svp_hold[j].s_lat, svp_hold[j].s_lon); */
-					geod_inverse(&g,
-						inf_hold[i].ave_lat,
-						inf_hold[i].ave_lon,
-						svp_hold[j].s_lat,
-						svp_hold[j].s_lon,
-						&dist[i][j],
-						&azi1,
-						&azi2);
-					if (verbose==1)
-						printf("Time %d is : %lf\n", j, time_hold[i][j]);
-					if (verbose==1)
-						printf("distance %d is : %lf\n", j, dist[i][j]);
-					}
-				if(p_4_flage == 0)
-					{
-					min_time[i] = time_hold[i][0];
-					count = 0;
-					for(j=0; j<size_2; j++)
-						if(min_time[i]>time_hold[i][j])
-							{
-							min_time[i] = time_hold[i][j];
-							n=j;
-							}
-					for(j=0; j<size_2; j++)
-						{
-						int c = 0;
-						c = dist[i][j] - p_4_range;
-						if (c <= 0)
-							{
-							if (count == 0)
-								{
-								min_time[i] = time_hold[i][j];
-								n=j;
-								count+=1;
-								}
-							else if (min_time[i]>time_hold[i][j])
-								{
-								min_time[i] = time_hold[i][j];
-								n=j;
-								}
-							}
-						}
-					fprintf(fresult,
-						"%s\n",
-						"============================================================");
-					fprintf(fresult, "%s\t", inf_hold[i].file_name);
-					fprintf(fresult, "%s\n", svp_hold[n].file_name);
-					fprintf(fresult,
-						"%s\n",
-						"=============================================================");
-					printf("Building the parameters to call mbset\n");
-					/* printf("%s\n", all_in_sys); */
-					strcat(all_in_sys, " -I ");
-					inf_hold[i].file_name[strlen(inf_hold[i].file_name)-1]='\0';
-					inf_hold[i].file_name[strlen(inf_hold[i].file_name)-1]='\0';
-					inf_hold[i].file_name[strlen(inf_hold[i].file_name)-1]='\0';
-					inf_hold[i].file_name[strlen(inf_hold[i].file_name)-1]='\0';
-					strcat(all_in_sys, inf_hold[i].file_name);
-					/* printf("%s\n", all_in_sys); */
-					strcat(all_in_sys, " -PSVPFILE:");
-					strcat(all_in_sys, svp_hold[n].file_name);
-					printf("%s\n", all_in_sys);
-					system(all_in_sys);
-					}
-				else
-					{
-					min_time[i] = day_hold[i][0];
-					count = 0;
-					for(j=0; j<size_2; j++)
-						{
-						if(min_time[i]>day_hold[i][j])
-							{
-							min_time[i] = day_hold[i][j];
-							n=j;
-							}
-						else if(min_time[i]==day_hold[i][j])
-							{
-							if (hour_hold[i][n] > hour_hold[i][j])
-								{
-								min_time[i] = day_hold [i][j];
-								n = j;
-								}
-							else
-								{
-								if (hour_hold[i][n] == hour_hold[i][j])
-									if (min_hold[i][n] > min_hold[i][j])
-										{
-										min_time[i] = day_hold [i][j];
-										n = j;
-										}
-								}
-							}
-						}
-					for(j=0; j<size_2; j++)
-						{
-						int c = 0;
-						c = dist[i][j] - p_4_range;
-						if (c <= 0)
-							{
-							if (count == 0)
-								{
-								min_time[i] = time_hold[i][j];
-								n=j;
-								count+=1;
-								}
-							else if (min_time[i]>time_hold[i][j])
-								{
-								min_time[i] = time_hold[i][j];
-								n=j;
-								}
-							}
-						}
-					fprintf(fresult,
-						"%s\n",
-						"============================================================");
-					fprintf(fresult, "%s\t", inf_hold[i].file_name);
-					fprintf(fresult, "%s\n", svp_hold[n].file_name);
-					fprintf(fresult,
-						"%s\n",
-						"=============================================================");
-					printf("Building the parameters to call mbset\n");
-					/* printf("%s\n", all_in_sys); */
-					strcat(all_in_sys, " -I ");
-					inf_hold[i].file_name[strlen(inf_hold[i].file_name)-1]='\0';
-					inf_hold[i].file_name[strlen(inf_hold[i].file_name)-1]='\0';
-					inf_hold[i].file_name[strlen(inf_hold[i].file_name)-1]='\0';
-					inf_hold[i].file_name[strlen(inf_hold[i].file_name)-1]='\0';
-					strcat(all_in_sys, inf_hold[i].file_name);
-					/* printf("%s\n", all_in_sys); */
-					strcat(all_in_sys, " -PSVPFILE:");
-					strcat(all_in_sys, svp_hold[n].file_name);
-					printf("%s\n", all_in_sys);
-					system(all_in_sys);
-					}
-				}
-			}
-		}
-	free(inf_hold);
-	free(svp_hold);
-	fclose(fDatalist);
-	fclose(fSvp);
-	fclose(fresult);
-} /* read_list */
-/* ---------------------------------------------------------------- */
-/*
- *  Function trim_newline
- *	Delete the '\n' char from string
- */
-void trim_newline
-(
-	char string[]
-)
-{
-	if(string[strlen(string)-1] == '\n')
-		string[strlen(string)-1] = '\0';
-}
-/* ---------------------------------------------------------------- */
-/*
- * pause the screen at the exit of the program
- */
-void pause_screen
-	()
-{
-	printf("\nEnd the program press ENTER");
-	fflush(stdin);
-	getchar();
-}
-/* ---------------------------------------------------------------- */
-/*
- * convert_decimal function
- * convert lat or lon from deg(int):min(int):sec(int) to decimal format
- */
-double convert_decimal
-(
-	int deg,
-	int min,
-	int sec
-)
-{
-	if(deg>=0)
-		return (double)deg + (((double)min)/60) + (((double)sec)/3600);
-
-	return -(fabs((double)deg) + (((double)min)/60) + (((double)sec)/3600));
-}
-/* ---------------------------------------------------------------- */
-/* print the inf information on the screen */
-void print_inf
-(
-	inf *cd
-)
-{
-	struct tm *temp = &cd->s_datum_time;
-	puts("==================================================");
-	printf("file_name: %s\n", cd->file_name);
-	puts("starting Date and time");
-	printf("\n%s\n", asctime(temp));
-	temp = NULL;
-	temp = &cd->e_datum_time;
-	puts("ending Date and time");
-	printf("\n%s\n", asctime(temp));
-	puts("Start position");
-	printf("lat: %Lf\t", cd->s_lat);
-	printf("lon: %Lf\n", cd->s_lon);
-	puts("End position");
-	printf("e_lat: %Lf\t", cd->e_lat);
-	printf("e_lon: %Lf\n", cd->e_lon);
-	puts("Average position");
-	printf("ave_lat: %Lf\t", cd->ave_lat);
-	printf("ave_lon: %Lf\n", cd->ave_lon);
-	puts("==================================================");
-	temp = NULL;
-}
-/* --------------------------------------------------------------- */
-/* print the svp information on the screen */
-void print_svp
-(
-	svp *cd
-)
-{
-	struct tm *temp = &cd->svp_datum_time;
-	puts("==================================================");
-	printf("file_name: %s\n", cd->file_name);
-	puts("Date and time");
-	printf("\n%s\n", asctime(temp));
-	/*printf("%d-",cd->svp_datum_time.tm_year);
-	   printf("%d\t",cd->svp_datum_time.tm_yday);
-	   printf("%d:",cd->svp_datum_time.tm_hour);
-	   printf("%d:",cd->svp_datum_time.tm_min);
-	   printf("%d\n",cd->svp_datum_time.tm_sec);*/
-	puts("position");
-	printf("lat: %Lf\t", cd->s_lat);
-	printf("lon: %Lf\n", cd->s_lon);
-	puts("==================================================");
-}
-/* --------------------------------------------------------------- */
-/* calculate the average position of two points */
-/* http://www.movable-type.co.uk/scripts/latlong.html */
-void mid_point
-(
-	long double lat1,
-	long double lon1,
-	long double lat2,
-	long double lon2,
-	long double *lat3,
-	long double *lon3
-)
-{
-	double dLon = DTR * ((lon2)-(lon1));
-	double lat1_rad = DTR * ((lat1));
-	double lat2_rad = DTR * ((lat2));
-	double lon1_rad = DTR * ((lon1));
-	double bx = cos(lat2_rad)*cos(dLon);
-	double by = cos(lat2_rad)*sin(dLon);
-	*(lat3) =
-		atan2(sin(lat1_rad) + sin(lat2_rad),
-		sqrt((((cos(lat1_rad))+bx)*((cos(lat1_rad))+bx)) + (by*by)))*RTD;
-	*(lon3) = (lon1_rad + atan2(by, (cos(lat1_rad) + bx)))*RTD;
-}
-/* --------------------------------------------------------------- */
diff --git a/src/utilities/mbswplspreprocess.c b/src/utilities/mbswplspreprocess.c
deleted file mode 100644
index 8ac0991..0000000
--- a/src/utilities/mbswplspreprocess.c
+++ /dev/null
@@ -1,1547 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbsxppreprocess.c	09/12/2013
- *    $Id: mbswplspreprocess.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 2005-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-
-/*
- * mbswplspreprocess reads a BathySwath (formerly SWATHplus) sonar file
- * and prepairs an output file from these data that can be processed
- * with MB System.
- *
- * Currently, the following procedures are offered (all optional):
- *
- * 1. Split each transducer channel into its own file. This is the only
- *practical
- * way to handle all of the various ping modes and transducer configurations.
- *
- * 2. Strip rejected samples from pings. In some aquisition configurations,
- * the BathySwath records thousands of samples per ping, rejects them all,
- * and then re-saves hundreds more "processed" samples which have been subject
- * to filtering, statistical aggredation, and other desirable data reduction
- * processes. Effectively, the same data has been recorded twice with different
- * filter settings. Unfortunately, there is no flag to indicate which type
- * of sample we are dealing with and this causes all kinds of problems when
- * editing and plotting the pings with MB System later on. Not to mention
- * that the files can grow by a factor of 10 or more. It is best to strip
- * out these original data before MB System is used to edit the remaining
- * "processed" data.
- *
- * 3. Copy raw amplitude to the processed amplitude slot. SXP files store
- * both a raw and processed amplitude value for each sample in the ping.
- * MB Sytem works only with the processed amplitude slot. This option will
- * reset the processed amplitude slot back to the original raw value stored
- * in the file.
- *
- * 4. Print out the data packets to stdout. Useful for debugging.
- *
- * The code below is designed to also support SXI files, however much still
- * needs to be done. SXI files are closer in nature to a traditional multibeam
- * data format. However, the files do not carry ANY configuration information
- * and almost no filtering has been done on the samples. MB System will need
- * extensive additional filtering options to find the seafloor in such files.
- * I am not aware of anyone who has large collections of SXI files that need
- * processing which makes it a lower priority item for me and the USGS.
- *
- * Author:	D. P. Finlayson
- * Email:   dfinlayson at usgs.gov
- * Date:	Feb 28, 2013
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <string.h>
-
-/* MBIO include files */
-#include "mb_status.h"
-#include "mb_define.h"
-#include "mb_format.h"
-#include "mb_io.h"
-#include "mbsys_swathplus.h"
-
-#define MAX_ERROR_STRING              1024
-
-typedef struct mbdefaults_struct
-	{
-	int verbose;
-	int format;
-	int pings_get;
-	int lonflip;
-	int btime_i[7];
-	int etime_i[7];
-	double speedmin;
-	double timegap;
-	double bounds[4];
-	} mbdefaults;
-
-typedef struct options_struct
-	{
-	int errflg;
-	int split_txers;
-	int help;
-	int verbose;
-	int format;
-	int ofile_set;
-	int projection_set;
-	int write_output;
-	int print_ascii;
-	int remove_rejected;
-	int flip_rejected;
-	int copy_rawamp;
-	mb_path proj4command;
-	mb_path read_file;
-	mb_path basename;
-	} options;
-
-typedef struct counts_struct
-	{
-	int files_read;
-	int sxpheader;
-	int sxiheader;
-	int projection;
-	int sxpping1;
-	int sxpping2;
-	int sxiping;
-	int attitude;
-	int posll;
-	int posen;
-	int ssv;
-	int echosounder;
-	int tide;
-	int agds;
-	int comment;
-	int pos_offset;
-	int imu_offset;
-	int txer_offset;
-	int wl_offset;
-	int other;
-	int pings_per_txer[SWPLS_MAX_TXERS];
-	int ping_sel_off;
-	int ping_sel_single;
-	int ping_sel_alt;
-	int ping_sel_sim;
-	} counts;
-
-static void default_options(options *opts);
-static int parse_options(int verbose, int argc, char **argv, options *opts,
-	int *error);
-static void error_exit(int verbose, int error, char *funcname, char *message);
-static int process_output(int verbose, mbdefaults *mbdflts, options *opts,
-	mb_path ifile, counts *recs, int *error);
-static int remove_rejected_samps(int verbose, swpls_sxpping *ping, int *error);
-static int flip_sample_flags(int verbose, swpls_sxpping *ping, int *error);
-static int copy_rawamp(int verbose, swpls_sxpping *ping, int *error);
-static int print_mbdefaults(int verbose, options *opts, mbdefaults *dflts,
-	int *error);
-static int set_outfile_names(int verbose, mb_path *ofile, mb_path ifile,
-	mb_path *basename, int ofile_set, int split_txers,
-	int *error);
-static int ping_mode(int verbose, struct mbsys_swathplus_struct *store,
-	int *mode, int *error);
-static int ping_txno(int verbose, struct mbsys_swathplus_struct *store,
-	int *txno, int *error);
-static int zero_counts(int verbose, counts *c, int *error);
-static int add_counts(int verbose, counts *to, counts *from, int *error);
-static int print_counts(int verbose, counts *c, int *error);
-static int count_record(int verbose, counts *c,
-	struct mbsys_swathplus_struct *store, int *error);
-static int print_latest_record(int verbose,
-	struct mbsys_swathplus_struct *store,
-	int *error);
-
-static char help_message[] = 
-	"Preprocess SWATHplus SXP formatted files\n" 
-	"\n"
-	"Options:\n"
-	"-A        overwrite processed amplitude with raw\n"
-	"          amplitude data.\n"
-	"-B        flip flag on rejected/accepted samples.\n"
-	"-Fformat  MB System format id\n"
-	"-G        print data records to stdout\n"
-	"-H        print this help text\n"
-	"-Iinfile  SXP file to process\n"
-	"-Jproj4   Proj4 projection command\n"
-	"-N        do not write output to file, mostly useful with -G\n"
-	"-Ooutfile basename for output files [default: same as input]\n"
-	"-R        remove rejected samples from pings.\n"
-	"-S        split each transducer channel into a separate file\n"
-	"-V        verbosity\n"	
-	"\n"
-	"Report bugs to the MB System development team\n";
-
-static char usage_message[] =
-	"mbswplspreprocess [-ABGHNRSV -Fformat -Jproj4command-Obasename] -Ifile";
-
-static char rcs_id[] = "$Id: mbswplspreprocess.c";
-static char program_name[] = "mbswplspreprocess";
-
-/*----------------------------------------------------------------------*/
-int main(int argc, char **argv)
-{
-	/* MBIO status variables */
-	int status = MB_SUCCESS;
-	int error = MB_ERROR_NO_ERROR;
-
-	/* MBIO read control parameters */
-	int read_datalist = MB_NO;
-	void *datalist;
-	int look_processed = MB_DATALIST_LOOK_UNSET;
-	double file_weight;
-	mb_path ifile;
-
-	/* MBIO read values */
-	int read_data;
-
-	/* counting variables */
-	counts filerecs;
-	counts totrecs;
-
-	/* processing variables */
-	options opts;
-	mbdefaults mbdflts;
-
-	/* set default options */
-	default_options(&opts);
-
-	/* mb_mem_debug_on(opts.verbose, &error); */
-
-	/* get mbsystem default values */
-	status = mb_defaults(opts.verbose, &(mbdflts.format), &(mbdflts.pings_get),
-		&(mbdflts.lonflip), mbdflts.bounds, mbdflts.btime_i,
-		mbdflts.etime_i, &(mbdflts.speedmin),
-		&(mbdflts.timegap));
-
-	if (status == MB_SUCCESS)
-		{
-		parse_options(opts.verbose, argc, argv, &opts, &error);
-		}
-
-	if (opts.errflg)
-		{
-		fprintf(stderr, "usage: %s\n", usage_message);
-		fprintf(stderr, "\nProgram <%s> Terminated\n", program_name);
-		error = MB_ERROR_BAD_USAGE;
-		exit(error);
-		}
-
-	/* print starting debug statements */
-	if (opts.verbose >= 1)
-		{
-		print_mbdefaults(opts.verbose, &opts, &mbdflts, &error);
-		}
-
-	/* if help desired then print it and exit */
-	if (opts.help)
-		{
-		fprintf(stderr, "\nProgram %s\n", program_name);
-		fprintf(stderr, "Version %s\n", rcs_id);
-		fprintf(stderr, "MB-system Version %s\n", MB_VERSION);
-		fprintf(stderr, "\nusage: %s\n", usage_message);
-		fprintf(stderr, "\n%s\n", help_message);
-		exit(error);
-		}
-		
-	/* get format if required */
-	if (opts.format == 0)
-		{
-		mb_get_format(opts.verbose, opts.read_file, NULL, &(opts.format),
-			&error);
-		}
-
-	/* determine whether to read one file or a list of files */
-	if (opts.format < 0)
-		{
-		read_datalist = MB_YES;
-		}
-
-	/* open file list */
-	if (read_datalist == MB_YES)
-		{
-		if ((status =
-			mb_datalist_open(opts.verbose, &datalist, opts.read_file,
-				look_processed, &error)) != MB_SUCCESS)
-			{
-			char message[MAX_ERROR_STRING];
-			sprintf(message, "Unable to open data list file: %s\n",
-				opts.read_file);
-			error_exit(opts.verbose, MB_ERROR_OPEN_FAIL, "mb_datalist_open",
-				message);
-			}
-
-		if ((status =
-			mb_datalist_read(opts.verbose, datalist, ifile, &(opts.format),
-				&file_weight, &error)) == MB_SUCCESS)
-			{
-			read_data = MB_YES;
-			}
-		else
-			{
-			read_data = MB_NO;
-			}
-		}
-	/* else copy single filename to be read */
-	else
-		{
-		strcpy(ifile, opts.read_file);
-		read_data = MB_YES;
-		}
-
-	/* reset total record counter */
-	zero_counts(opts.verbose, &totrecs, &error);
-
-	/* loop over files to be read */
-	while (read_data == MB_YES)
-		{
-		/* reset file record counter */
-		zero_counts(opts.verbose, &filerecs, &error);
-
-		/* process the output files */
-		if (status == MB_SUCCESS)
-			{
-			status = process_output(opts.verbose, &mbdflts, &opts, ifile,
-				&filerecs, &error);
-			}
-
-		/* output counts */
-		filerecs.files_read++;
-		if (opts.verbose >= 1)
-			{
-			fprintf(stdout, "\nData records read from: %s\n", ifile);
-			print_counts(opts.verbose, &filerecs, &error);
-			}
-
-		/* add this file's counts to total */
-		add_counts(opts.verbose, &totrecs, &filerecs, &error);
-
-		/* figure out whether and what to read next */
-		if (read_datalist == MB_YES)
-			{
-			if ((status =
-				mb_datalist_read(opts.verbose, datalist, ifile, &(opts.format),
-					&file_weight, &error)) == MB_SUCCESS)
-				{
-				read_data = MB_YES;
-				}
-			else
-				{
-				read_data = MB_NO;
-				}
-			}
-		else
-			{
-			read_data = MB_NO;
-			}
-		}		/* end loop over files in list */
-
-	/* output counts */
-	if (opts.verbose >= 1)
-		{
-		fprintf(stdout, "\nTotal data records read:\n");
-		print_counts(opts.verbose, &totrecs, &error);
-		}
-
-	if (read_datalist == MB_YES)
-		{
-		mb_datalist_close(opts.verbose, &datalist, &error);
-		}
-
-	/* check memory */
-	status = mb_memory_list(opts.verbose, &error);
-
-	/* mb_mem_debug_off(opts.verbose, &error); */
-
-	return (status);
-}	/* main */
-/*---------------------------------------------------------------*/
-static void default_options(options *opts)
-{
-	/* standard mb system options */
-	opts->errflg = 0;
-	opts->help = MB_NO;
-	opts->verbose = 0;
-
-	/* transducer processing options */
-	opts->split_txers = MB_NO;
-	opts->remove_rejected = MB_NO;
-	opts->flip_rejected = MB_NO;
-	opts->copy_rawamp = MB_NO;
-
-	/* map projection */
-	opts->projection_set = MB_NO;
-	strcpy(opts->proj4command, "");
-
-	/* print ascii? */
-	opts->print_ascii = MB_NO;
-
-	/* input and output file names */
-	opts->format = 0;
-	opts->ofile_set = MB_NO;
-	strcpy(opts->read_file, "datalist.mb-1");
-	strcpy(opts->basename, "");
-	opts->write_output = MB_YES;
-}	/* default_options */
-/*----------------------------------------------------------------------*/
-static int parse_options(int verbose, int argc, char **argv, options *opts,
-	int *error)
-{
-	char *function_name = "parse_options";
-	int status = MB_SUCCESS;
-	extern char *optarg;
-	int c;
-	int flag = 0;
-
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  function <%s> called\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n");
-		fprintf(stderr, "dbg2       verbose:    %d\n", verbose);
-		fprintf(stderr, "dbg2       argc:       %d\n", argc);
-		fprintf(stderr, "dbg2       argv:       %p\n", (void *)argv);
-		fprintf(stderr, "dbg2       options:    %p\n", (void *)opts);
-		}
-
-	while ((c = getopt(argc, argv, "AaBbF:f:GgHhI:i:J:j:NnO:o:RrSsVv")) != -1)
-		{
-		switch (c)
-			{
-		case 'A':
-		case 'a':
-			opts->copy_rawamp = MB_YES;
-			break;
-		case 'B':
-		case 'b':
-			opts->flip_rejected = MB_YES;
-			break;
-		case 'F':
-		case 'f':
-			sscanf(optarg, "%d", &(opts->format));
-			flag++;
-			break;
-		case 'G':
-		case 'g':
-			opts->print_ascii = MB_YES;
-			break;
-		case 'H':
-		case 'h':
-			opts->help++;
-			break;
-		case 'I':
-		case 'i':
-			sscanf(optarg, "%s", &opts->read_file[0]);
-			flag++;
-			break;
-		case 'J':
-		case 'j':
-			sscanf(optarg, "%s", &opts->proj4command[0]);
-			opts->projection_set = MB_YES;
-			flag++;
-			break;
-		case 'N':
-		case 'n':
-			opts->write_output = MB_NO;
-			break;
-		case 'O':
-		case 'o':
-			sscanf(optarg, "%s", &opts->basename[0]);
-			opts->ofile_set = MB_YES;
-			flag++;
-			break;
-		case 'R':
-		case 'r':
-			opts->remove_rejected = MB_YES;
-			break;
-		case 'S':
-		case 's':
-			opts->split_txers = MB_YES;
-			break;
-		case 'V':
-		case 'v':
-			opts->verbose++;
-			break;
-		case '?':
-			opts->errflg++;
-			}	/* switch */
-		}
-
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  function <%s> completed\n", function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		fprintf(stderr, "dbg2        error:     %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2       status:     %d\n", status);
-		}
-
-	return (status);
-}	/* parse_options */
-/*---------------------------------------------------------------*/
-static int print_mbdefaults(int verbose, options *opts, mbdefaults *dflts,
-	int *error)
-{
-	char *function_name = "print_mbdefaults";
-	char *tagdebug2 = "dbg2 ";
-	char *tagdebug0 = "";
-	char *tag = NULL;
-	int status = MB_SUCCESS;
-
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  function <%s> called\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n");
-		fprintf(stderr, "dbg2       verbose:    %d\n", verbose);
-		fprintf(stderr, "dbg2       options:    %p\n", (void *)opts);
-		}
-		
-	if (verbose > 1)
-		tag = tagdebug2;
-	else
-		tag = tagdebug0;
-
-	fprintf(stderr, "\n%sProgram <%s>\n", tag, program_name);
-	fprintf(stderr, "%sVersion %s\n", tag, rcs_id);
-	fprintf(stderr, "%sMB-system Version %s\n", tag, MB_VERSION);
-	fprintf(stderr, "\n%sControl Parameters:\n", tag);
-	fprintf(stderr, "%sverbose:                  %d\n", tag, opts->verbose);
-	fprintf(stderr, "%shelp:                     %d\n", tag, opts->help);
-	fprintf(stderr, "%sformat:                   %d\n", tag, opts->format);
-	fprintf(stderr, "%slonflip:                  %d\n", tag, dflts->lonflip);
-	fprintf(stderr, "%sbounds[0]:                %f\n", tag, dflts->bounds[0]);
-	fprintf(stderr, "%sbounds[1]:                %f\n", tag, dflts->bounds[1]);
-	fprintf(stderr, "%sbounds[2]:                %f\n", tag, dflts->bounds[2]);
-	fprintf(stderr, "%sbounds[3]:                %f\n", tag, dflts->bounds[3]);
-	fprintf(stderr, "%sbtime_i[0]:               %d\n", tag, dflts->btime_i[0]);
-	fprintf(stderr, "%sbtime_i[1]:               %d\n", tag, dflts->btime_i[1]);
-	fprintf(stderr, "%sbtime_i[2]:               %d\n", tag, dflts->btime_i[2]);
-	fprintf(stderr, "%sbtime_i[3]:               %d\n", tag, dflts->btime_i[3]);
-	fprintf(stderr, "%sbtime_i[4]:               %d\n", tag, dflts->btime_i[4]);
-	fprintf(stderr, "%sbtime_i[5]:               %d\n", tag, dflts->btime_i[5]);
-	fprintf(stderr, "%sbtime_i[6]:               %d\n", tag, dflts->btime_i[6]);
-	fprintf(stderr, "%setime_i[0]:               %d\n", tag, dflts->etime_i[0]);
-	fprintf(stderr, "%setime_i[1]:               %d\n", tag, dflts->etime_i[1]);
-	fprintf(stderr, "%setime_i[2]:               %d\n", tag, dflts->etime_i[2]);
-	fprintf(stderr, "%setime_i[3]:               %d\n", tag, dflts->etime_i[3]);
-	fprintf(stderr, "%setime_i[4]:               %d\n", tag, dflts->etime_i[4]);
-	fprintf(stderr, "%setime_i[5]:               %d\n", tag, dflts->etime_i[5]);
-	fprintf(stderr, "%setime_i[6]:               %d\n", tag, dflts->etime_i[6]);
-	fprintf(stderr, "%sspeedmin:  		     %f\n", tag, dflts->speedmin);
-	fprintf(stderr, "%stimegap:  		     %f\n", tag, dflts->timegap);
-	fprintf(stderr, "%sread_file: 		     %s\n", tag, opts->read_file);
-	fprintf(stderr, "%sbasename: 		     %s\n", tag, opts->basename);
-	fprintf(stderr, "%sofile_set:                %d\n", tag, opts->ofile_set);
-	fprintf(stderr, "%sprojection_set:           %d\n", tag, opts->projection_set);
-	fprintf(stderr, "%sproj4command:             %s\n", tag, opts->proj4command);
-	fprintf(stderr, "%swrite_output:             %d\n", tag, opts->write_output);
-	fprintf(stderr, "%sprint_ascii:              %d\n", tag, opts->print_ascii);
-	fprintf(stderr, "%sremove_rejected:          %d\n", tag, opts->remove_rejected);
-	fprintf(stderr, "%sflip_rejected:            %d\n", tag, opts->flip_rejected);
-	fprintf(stderr, "%scopy_rawamp:              %d\n", tag, opts->copy_rawamp);
-
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  function <%s> completed\n", function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		fprintf(stderr, "dbg2        error:     %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2       status:     %d\n", status);
-		}
-
-	return (status);
-}	/* print_mbdefaults */
-/*---------------------------------------------------------------*/
-static void error_exit(int verbose, int error, char *funcname, char *message)
-{
-	char *errmsg;
-
-	mb_error(verbose, error, &errmsg);
-	fprintf(stderr, "\nMBIO Error returned from function %s>:\n%s\n", funcname,
-		errmsg);
-	fprintf(stderr, "\n%s\n", message);
-	fprintf(stderr, "\nProgram <%s> Terminated\n", program_name);
-	exit(error);
-}
-/*---------------------------------------------------------------*/
-static int process_output(int verbose, mbdefaults *mbdflts, options *opts,
-	mb_path ifile, counts *recs, int *error)
-{
-	char *function_name = "scan_input_heights";
-	int status = MB_SUCCESS;
-	int i;
-	void *imbio_ptr = NULL;
-	double btime_d, etime_d;
-	int beams_bath_alloc, beams_amp_alloc, pixels_ss_alloc;
-	void *ombio_ptr[SWPLS_MAX_TXERS];
-	struct mb_io_struct *imb_io_ptr = NULL;
-	void *istore_ptr = NULL;
-	int ofile_init[SWPLS_MAX_TXERS];
-	mb_path ofile[SWPLS_MAX_TXERS];
-	struct mbsys_swathplus_struct *istore = NULL;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  function <%s> called\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n");
-		fprintf(stderr, "dbg2       verbose:    %d\n", verbose);
-		fprintf(stderr, "dbg2       options:    %p\n", (void *)opts);
-		}
-
-	/* open the input file */
-	if ((status =
-		mb_read_init(opts->verbose, ifile, opts->format, mbdflts->pings_get,
-			mbdflts->lonflip, mbdflts->bounds, mbdflts->btime_i,
-			mbdflts->etime_i,
-			mbdflts->speedmin, mbdflts->timegap, &imbio_ptr, &btime_d, &etime_d,
-			&beams_bath_alloc, &beams_amp_alloc, &pixels_ss_alloc,
-			error)) != MB_SUCCESS)
-		{
-		char message[MAX_ERROR_STRING] = {0};
-		sprintf(message, "Swath File <%s> not initialized for reading\n",
-			ifile);
-		error_exit(opts->verbose, *error, "mb_read_init", message);
-		}
-		
-	/* get mbio and data structure descriptors */
-	imb_io_ptr = (struct mb_io_struct *)imbio_ptr;
-	istore_ptr = imb_io_ptr->store_data;
-	
-	/* set the projection for nav data */
-	if (opts->projection_set == MB_YES)
-		{
-		mb_proj_init(opts->verbose, opts->proj4command, &(imb_io_ptr->pjptr), error);
-		strncpy(imb_io_ptr->projection_id, opts->proj4command, MB_NAME_LENGTH);
-		imb_io_ptr->projection_initialized = MB_YES;		
-		}
-		
-	/* setup the output filename(s) for writing */
-	status = set_outfile_names(opts->verbose, ofile, ifile, &opts->basename,
-		opts->ofile_set, opts->split_txers, error);
-	for (i = 0; i < SWPLS_MAX_TXERS; i++)
-		{
-		ombio_ptr[i] = NULL;
-		ofile_init[i] = MB_NO;
-		}
-
-	/* start looping over data records */
-	while (*error <= MB_ERROR_NO_ERROR)
-		{
-		int kind = MB_DATA_NONE;
-
-		/* read the next record */
-		status =
-			mb_read_ping(opts->verbose, imbio_ptr, istore_ptr, &kind, error);
-
-		/* some nonfatal errors do not matter */
-		if ((*error < MB_ERROR_NO_ERROR) && (MB_ERROR_UNINTELLIGIBLE < *error))
-			{
-			error = MB_ERROR_NO_ERROR;
-			status = MB_SUCCESS;
-			}
-
-		istore = (struct mbsys_swathplus_struct *)istore_ptr;
-
-		if (status == MB_SUCCESS)
-			{
-			status = count_record(opts->verbose, recs, istore, error);
-			}
-
-		if ((status == MB_SUCCESS) && (opts->print_ascii == MB_YES))
-			{
-			status = print_latest_record(opts->verbose, istore, error);
-			}
-
-		/* process the sxp ping data to file */
-		if ((status == MB_SUCCESS) && (istore->kind == MB_DATA_DATA) &&
-			((istore->type == SWPLS_ID_PROCESSED_PING) ||
-			(istore->type == SWPLS_ID_PROCESSED_PING2)))
-			{
-			int obeams_bath, obeams_amp, opixels_ss;
-			struct mb_io_struct *omb_io_ptr = NULL;
-			void *ostore_ptr = NULL;
-			struct mbsys_swathplus_struct *ostore = NULL;
-			int txno = 0;
-			int txidx = 0;
-
-			if ((status == MB_SUCCESS) && (opts->flip_rejected == MB_YES))
-				{
-				status = flip_sample_flags(opts->verbose, &(istore->sxp_ping),
-					error);
-				}
-
-			if ((status == MB_SUCCESS) && (opts->remove_rejected == MB_YES))
-				{
-				status = remove_rejected_samps(opts->verbose,
-					&(istore->sxp_ping), error);
-				}
-
-			if ((status == MB_SUCCESS) && (opts->copy_rawamp == MB_YES))
-				{
-				status = copy_rawamp(opts->verbose, &(istore->sxp_ping), error);
-				}
-
-			if ((status == MB_SUCCESS) && (opts->write_output == MB_YES))
-				{
-				/* select the output file based on the txer channel */
-				status = ping_txno(opts->verbose, istore, &txno, error);
-				txidx = (opts->split_txers == MB_YES) ? txno - 1 : 0;
-
-				/* initialize the output file if necessary */
-				if (ofile_init[txidx] == MB_NO)
-					{
-					status = mb_write_init(opts->verbose, ofile[txidx], opts->format, 
-						&ombio_ptr[txidx],  &obeams_bath,
-						&obeams_amp, &opixels_ss, error);
-					if (status != MB_SUCCESS)
-						{
-						char message[MAX_ERROR_STRING] = {0};
-						sprintf(message, "SWATHplus file <%s> not initialized for writing.\n",
-							ofile[txidx]);
-						error_exit(verbose, *error, "mb_write_init", message);
-						}
-
-					if (status == MB_SUCCESS)
-						{
-						ofile_init[txidx] = MB_YES;
-						}
-					}
-
-				/* assign output pointers based on txer channel */
-				omb_io_ptr = (struct mb_io_struct *)ombio_ptr[txidx];
-				ostore_ptr = omb_io_ptr->store_data;
-				ostore = (struct mbsys_swathplus_struct *)ostore_ptr;
-
-				/* copy the ping from istore to ostore */
-				if (status == MB_SUCCESS)
-					{
-					status = mbsys_swathplus_copy(opts->verbose, imbio_ptr,
-						istore_ptr, ostore_ptr,
-						error);
-					}
-
-				/* write the ping to file */
-				if (status == MB_SUCCESS)
-					{
-					ostore->kind = MB_DATA_DATA;
-					ostore->type = SWPLS_ID_PROCESSED_PING2;
-					status = mb_write_ping(opts->verbose, ombio_ptr[txidx],
-						ostore, error);
-					}
-
-				/* check for error writing here */
-				if (status != MB_SUCCESS)
-					{
-					char message[MAX_ERROR_STRING] = {0};
-					sprintf(message, "Data not written to file <%s>\n",
-						ofile[txidx]);
-					error_exit(opts->verbose, *error, "mb_write_ping", message);
-					}
-				}		/* end write sxp data to file */
-			}		/* end processing sxp data */
-		}		/* end looping over all records in file */
-
-	/* close the files */
-	status = mb_close(opts->verbose, &imbio_ptr, error);
-	for (i = 0; i < SWPLS_MAX_TXERS; i++)
-		{
-		if (ofile_init[i] == MB_YES)
-			{
-			status = mb_close(opts->verbose, &ombio_ptr[i], error);
-			ofile_init[i] = MB_NO;
-			}
-		}
-
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  function <%s> completed\n", function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		fprintf(stderr, "dbg2        error:     %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2       status:     %d\n", status);
-		}
-
-	return (status);
-} /* process_output */
-/*----------------------------------------------------------------------*/
-static int set_outfile_names(int verbose, mb_path *ofile, mb_path ifile,
-	mb_path *basename, int ofile_set, int split_txers,
-	int *error)
-{
-	char *function_name = "set_outfile_names";
-	mb_path fileroot;
-	int format;
-	int status = MB_SUCCESS;
-	int i;
-
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  function <%s> called\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n");
-		fprintf(stderr, "dbg2       verbose:    %d\n", verbose);
-		fprintf(stderr, "dbg2       ofile:      %p\n", (void *)ofile);
-		fprintf(stderr, "dbg2       ifile:      %p\n", (void *)ifile);
-		}
-
-	/* clear ofile array */
-	for (i = 0; i < SWPLS_MAX_TXERS; i++)
-		{
-		strncpy(ofile[i], "", sizeof(ofile[i]));
-		}
-
-	/* get the fileroot name and format from the input name */
-	status = mb_get_format(verbose, ifile, fileroot, &format, error);
-
-	if ((ofile_set == MB_NO) && (split_txers == MB_NO))
-		{
-		if ((format == MBF_SWPLSSXP) &&
-			(strncmp(".sxp", &ifile[strlen(ifile) - 4], 4) == 0))
-			{
-			sprintf(ofile[0], "%s.mb%d", fileroot, format);
-			}
-		else if ((format == MBF_SWPLSSXI) &&
-			(strncmp(".sxi", &ifile[strlen(ifile) - 4], 4) == 0))
-			{
-			sprintf(ofile[0], "%s.mb%d", fileroot, format);
-			}
-		else
-			{
-			sprintf(ofile[0], "%s.mb%d", ifile, format);
-			}
-		}
-	else if ((ofile_set == MB_NO) && (split_txers == MB_YES))
-		{
-		if ((format == MBF_SWPLSSXP) &&
-			(strncmp(".sxp", &ifile[strlen(ifile) - 4], 4) == 0))
-			{
-			for (i = 0; i < SWPLS_MAX_TXERS; i++)
-				{
-				sprintf(ofile[i], "%s_txer%d.mb%d", fileroot, i + 1, format);
-				}
-			}
-		else if ((format == MBF_SWPLSSXI) &&
-			(strncmp(".sxi", &ifile[strlen(ifile) - 4], 4) == 0))
-			{
-			for (i = 0; i < SWPLS_MAX_TXERS; i++)
-				{
-				sprintf(ofile[i], "%s_txer%d.mb%d", fileroot, i + 1, format);
-				}
-			}
-		else
-			{
-			for (i = 0; i < SWPLS_MAX_TXERS; i++)
-				{
-				sprintf(ofile[i], "%s_txer%d.mb%d", ifile, i + 1, format);
-				}
-			}
-		}
-	else if ((ofile_set == MB_YES) && (split_txers == MB_NO))
-		{
-		if ((format == MBF_SWPLSSXP) &&
-			(strncmp(".sxp", &ifile[strlen(ifile) - 4], 4) == 0))
-			{
-			sprintf(ofile[0], "%s.mb%d", *basename, format);
-			}
-		else if ((format == MBF_SWPLSSXI) &&
-			(strncmp(".sxi", &ifile[strlen(ifile) - 4], 4) == 0))
-			{
-			sprintf(ofile[0], "%s.mb%d", *basename, format);
-			}
-		else
-			{
-			sprintf(ofile[0], "%s.mb%d", ifile, format);
-			}
-		}
-	else if ((ofile_set == MB_YES) && (split_txers == MB_YES))
-		{
-		if ((format == MBF_SWPLSSXP) &&
-			(strncmp(".sxp", &ifile[strlen(ifile) - 4], 4) == 0))
-			{
-			for (i = 0; i < SWPLS_MAX_TXERS; i++)
-				{
-				sprintf(ofile[i], "%s_txer%d.mb%d", *basename, i + 1, format);
-				}
-			}
-		else if ((format == MBF_SWPLSSXI) &&
-			(strncmp(".sxi", &ifile[strlen(ifile) - 4], 4) == 0))
-			{
-			for (i = 0; i < SWPLS_MAX_TXERS; i++)
-				{
-				sprintf(ofile[i], "%s_txer%d.mb%d", *basename, i + 1, format);
-				}
-			}
-		else
-			{
-			for (i = 0; i < SWPLS_MAX_TXERS; i++)
-				{
-				sprintf(ofile[i], "%s_txer%d.mb%d", ifile, i + 1, format);
-				}
-			}
-		}
-
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  function <%s> completed\n", function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		for (i = 0; i < SWPLS_MAX_TXERS; i++)
-			{
-			fprintf(stderr, "dbg2    ofile[%d]:      %s\n", i, ofile[i]);
-			}
-		fprintf(stderr, "dbg2       error:      %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2       status:     %d\n", status);
-		}
-
-	return (status);
-}	/* set_outfile_names */
-
-/*----------------------------------------------------------------------*/
-static int ping_txno(int verbose, struct mbsys_swathplus_struct *store,
-	int *txno, int *error)
-{
-	char *function_name = "ping_txno";
-	int status = MB_SUCCESS;
-
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  function <%s> called\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n");
-		fprintf(stderr, "dbg2       verbose:    %d\n", verbose);
-		fprintf(stderr, "dbg2       store:      %p\n", (void *)store);
-		}
-
-	/* get the transducer channe */
-	if ((store->kind == MB_DATA_DATA) &&
-		((store->type == SWPLS_ID_PROCESSED_PING) ||
-		(store->type == SWPLS_ID_PROCESSED_PING2)))
-		{
-		*txno = store->sxp_ping.txno;
-		}
-	else if ((store->kind == MB_DATA_DATA) &&
-		(store->type == SWPLS_ID_PARSED_PING))
-		{
-		*txno = store->sxi_ping.channel;
-		}
-	else
-		{
-		status = MB_FAILURE;
-		*error = MB_ERROR_UNINTELLIGIBLE;
-		}
-
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  function <%s> completed\n", function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		fprintf(stderr, "dbg2        txno:      %d\n", *txno);
-		fprintf(stderr, "dbg2       error:      %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2       status:     %d\n", status);
-		}
-
-	return (status);
-}	/* ping_txno */
-/*----------------------------------------------------------------------*/
-static int copy_rawamp(int verbose, swpls_sxpping *ping, int *error)
-{
-	char *function_name = "copy_rawamp";
-	int status = MB_SUCCESS;
-	int i;
-
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  function <%s> called\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n");
-		fprintf(stderr, "dbg2       verbose:     %d\n", verbose);
-		fprintf(stderr, "dbg2       ping:        %p\n", (void *)ping);
-		}
-
-	for (i = 0; i < ping->nosampsfile; i++)
-		{
-		ping->points[i].procamp = ping->points[i].amp;
-		}
-
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  function <%s> completed\n", function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		fprintf(stderr, "dbg2       error:      %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2       status:     %d\n", status);
-		}
-
-	return (status);
-}	/* copy_rawamp */
-/*----------------------------------------------------------------------*/
-static int remove_rejected_samps(int verbose, swpls_sxpping *ping, int *error)
-{
-	char *function_name = "remove_rejected_samps";
-	int status = MB_SUCCESS;
-	swpls_point *points;
-	int valid, i;
-
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  function <%s> called\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n");
-		fprintf(stderr, "dbg2       verbose:     %d\n", verbose);
-		fprintf(stderr, "dbg2       ping:        %p\n", (void *)ping);
-		}
-
-	/* count the number of valid samples */
-	valid = 0;
-	for (i = 0; i < ping->nosampsfile; i++)
-		{
-		if (ping->points[i].status != SWPLS_POINT_REJECTED)
-			{
-			valid++;
-			}
-		}
-
-	/* create a temporary array to hold the valid samples */
-	status = mb_mallocd(verbose, __FILE__, __LINE__,
-		valid * sizeof(swpls_point), (void **)&points, error);
-	if (status != MB_SUCCESS)
-		{
-		char message[MAX_ERROR_STRING] = {0};
-		sprintf(message,
-			"Failure to allocate memory for temporary array (%lu bytes)",
-			valid * sizeof(swpls_point));
-		error_exit(verbose, *error, "mb_mallocd", message);
-		}
-
-	/* copy the valid samples to the temporary array */
-	valid = 0;
-	for (i = 0; i < ping->nosampsfile; i++)
-		{
-		if (ping->points[i].status != SWPLS_POINT_REJECTED)
-			{
-			points[valid++] = ping->points[i];
-			}
-		}
-
-	/* copy the valid samples to the front of the ping->points array and adjust
-	   the sample count. This effectively truncates the ping on write. */
-	for (i = 0; i < valid; i++)
-		{
-		ping->points[i] = points[i];
-		}
-	ping->nosampsfile = valid;
-
-	/* free memory for the temporary points array */
-	status = mb_freed(verbose, __FILE__, __LINE__, (void **)&points, error);
-
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  function <%s> completed\n", function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		fprintf(stderr, "dbg2       error:      %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2       status:     %d\n", status);
-		}
-
-	return (status);
-}	/* remove_rejected_samps */
-/*----------------------------------------------------------------------*/
-static int flip_sample_flags(int verbose, swpls_sxpping *ping, int *error)
-{
-	char *function_name = "revcd";
-	int status = MB_SUCCESS;
-	int i;
-
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  function <%s> called\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n");
-		fprintf(stderr, "dbg2       verbose:     %d\n", verbose);
-		fprintf(stderr, "dbg2       ping:        %p\n", (void *)ping);
-		}
-
-	for (i = 0; i < ping->nosampsfile; i++)
-		{
-		if (ping->points[i].status != SWPLS_POINT_REJECTED)
-			{
-			ping->points[i].status = SWPLS_POINT_REJECTED;
-			}
-		else
-			{
-			ping->points[i].status = SWPLS_POINT_ACCEPTED;
-			}
-		}
-
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  function <%s> completed\n", function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		fprintf(stderr, "dbg2       error:      %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2       status:     %d\n", status);
-		}
-
-	return (status);
-}	/* flip_sample_flags */
-/*----------------------------------------------------------------------*/
-static int ping_mode(int verbose, struct mbsys_swathplus_struct *store,
-	int *mode, int *error)
-{
-	char *function_name = "ping_mode";
-	int status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  function <%s> called\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n");
-		fprintf(stderr, "dbg2       verbose:    %d\n", verbose);
-		fprintf(stderr, "dbg2       store:      %p\n", (void *)store);
-		}
-
-	/* use bitmask in ping status field to return ping mode */
-	if (store->kind == MB_DATA_DATA)
-		{
-		if ((store->type == SWPLS_ID_PROCESSED_PING) ||
-			(store->type == SWPLS_ID_PROCESSED_PING2))
-			{
-			*mode = store->sxp_ping.txstat & SWPLS_SONAR_SEL_MASK;
-			}
-		else if (store->type == SWPLS_ID_PARSED_PING)
-			{
-			*mode = store->sxi_ping.ping_state & SWPLS_SONAR_SEL_MASK;
-			}
-		else
-			{
-			status = MB_FAILURE;
-			*error = MB_ERROR_UNINTELLIGIBLE;
-			}
-		}
-	else
-		{
-		/* this isn't a ping, can't get it's mode */
-		status = MB_FAILURE;
-		*error = MB_ERROR_UNINTELLIGIBLE;
-		}
-
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  function <%s> completed\n", function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		fprintf(stderr, "dbg2        mode:      %d\n", *mode);
-		fprintf(stderr, "dbg2       error:      %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2       status:     %d\n", status);
-		}
-
-	return (status);
-}	/* ping_mode */
-
-/*----------------------------------------------------------------------
- * Functions for counting records (both sxp and sxi supported)
- *----------------------------------------------------------------------*/
-
-static int zero_counts(int verbose, counts *recs, int *error)
-{
-	char *function_name = "zero_counts";
-	int status = MB_SUCCESS;
-	int i;
-
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  function <%s> called\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n");
-		fprintf(stderr, "dbg2       verbose:    %d\n", verbose);
-		fprintf(stderr, "dbg2       recs:       %p\n", (void *)recs);
-		}
-
-	recs->files_read = 0;
-	recs->sxpheader = 0;
-	recs->sxiheader = 0;
-	recs->sxpping1 = 0;
-	recs->sxpping2 = 0;
-	recs->sxiping = 0;
-	recs->attitude = 0;
-	recs->posll = 0;
-	recs->posen = 0;
-	recs->ssv = 0;
-	recs->echosounder = 0;
-	recs->tide = 0;
-	recs->agds = 0;
-	recs->comment = 0;
-	recs->pos_offset = 0;
-	recs->imu_offset = 0;
-	recs->txer_offset = 0;
-	recs->wl_offset = 0;
-	recs->other = 0;
-	for (i = 0; i < SWPLS_MAX_TXERS; i++)
-		{
-		recs->pings_per_txer[i] = 0;
-		}
-	recs->ping_sel_off = 0;
-	recs->ping_sel_single = 0;
-	recs->ping_sel_alt = 0;
-	recs->ping_sel_sim = 0;
-
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  function <%s> completed\n", function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		fprintf(stderr, "dbg2       error:      %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2       status:     %d\n", status);
-		}
-
-	return (status);
-}	/* zero_counts */
-/*---------------------------------------------------------------*/
-static int count_record(int verbose, counts *recs,
-	struct mbsys_swathplus_struct *store, int *error)
-{
-	char *function_name = "count_record";
-	int status = MB_SUCCESS;
-
-	/* print input debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  function <%s> called\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n");
-		fprintf(stderr, "dbg2       verbose:    %d\n", verbose);
-		fprintf(stderr, "dbg2       recs:       %p\n", (void *)recs);
-		fprintf(stderr, "dbg2       store:      %p\n", (void *)store);
-		}
-
-	/* count the record type */
-	switch (store->type)
-		{
-	case SWPLS_ID_SXP_HEADER_DATA:
-		recs->sxpheader++;
-		break;
-	case SWPLS_ID_PROCESSED_PING:
-		recs->sxpping1++;
-		recs->pings_per_txer[store->sxp_ping.txno - 1]++;
-		break;
-	case SWPLS_ID_PROCESSED_PING2:
-		recs->sxpping2++;
-		recs->pings_per_txer[store->sxp_ping.txno - 1]++;
-		break;
-	case SWPLS_ID_SXI_HEADER_DATA:
-		recs->sxiheader++;
-		break;
-	case SWPLS_ID_PARSED_PING:
-		recs->sxiping++;
-		recs->pings_per_txer[store->sxi_ping.channel - 1]++;
-		break;
-	case SWPLS_ID_PARSED_ATTITUDE:
-		recs->attitude++;
-		break;
-	case SWPLS_ID_PARSED_POSITION_LL:
-		recs->posll++;
-		break;
-	case SWPLS_ID_PARSED_POSITION_EN:
-		recs->posen++;
-		break;
-	case SWPLS_ID_PARSED_SSV:
-		recs->ssv++;
-		break;
-	case SWPLS_ID_PARSED_ECHOSOUNDER:
-		recs->echosounder++;
-		break;
-	case SWPLS_ID_PARSED_TIDE:
-		recs->tide++;
-		break;
-	case SWPLS_ID_PARSED_AGDS:
-		recs->agds++;
-		break;
-	case SWPLS_ID_COMMENT:
-		recs->comment++;
-		break;
-	case SWPLS_ID_POS_OFFSET:
-		recs->pos_offset++;
-		break;
-	case SWPLS_ID_IMU_OFFSET:
-		recs->imu_offset++;
-		break;
-	case SWPLS_ID_TXER_OFFSET:
-		recs->txer_offset++;
-		break;
-	case SWPLS_ID_WL_OFFSET:
-		recs->wl_offset++;
-		break;
-	default:
-		recs->other++;
-		break;
-		}	/* switch */
-
-	if (store->kind == MB_DATA_DATA)
-		{
-		int mode;
-
-		ping_mode(verbose, store, &mode, error);
-		switch (mode)
-			{
-		case SWPLS_SONAR_SEL_OFF:
-			recs->ping_sel_off++;
-			break;
-		case SWPLS_SONAR_SEL_SINGLE:
-			recs->ping_sel_single++;
-			break;
-		case SWPLS_SONAR_SEL_ALT:
-			recs->ping_sel_alt++;
-			break;
-		case SWPLS_SONAR_SEL_SIM:
-			recs->ping_sel_sim++;
-			break;
-			}
-		}
-
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  function <%s> completed\n", function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		fprintf(stderr, "dbg2       error:      %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2       status:     %d\n", status);
-		}
-
-	return (status);
-}	/* count_record */
-/*----------------------------------------------------------------------*/
-static int add_counts(int verbose, counts *to, counts *from, int *error)
-{
-	char *function_name = "add_counts";
-	int status = MB_SUCCESS;
-	int i;
-
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  function <%s> called\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n");
-		fprintf(stderr, "dbg2       verbose:    %d\n", verbose);
-		fprintf(stderr, "dbg2       to:         %p\n", (void *)to);
-		fprintf(stderr, "dbg2       from:       %p\n", (void *)from);
-		}
-
-	to->files_read += from->files_read;
-	to->sxpheader += from->sxpheader;
-	to->sxiheader += from->sxiheader;
-	to->sxpping1 += from->sxpping1;
-	to->sxpping2 += from->sxpping2;
-	to->sxiping += from->sxiping;
-	to->attitude += from->attitude;
-	to->posll += from->posll;
-	to->posen += from->posen;
-	to->ssv += from->ssv;
-	to->echosounder += from->echosounder;
-	to->tide += from->tide;
-	to->agds += from->agds;
-	to->comment += from->comment;
-	to->pos_offset += from->pos_offset;
-	to->imu_offset += from->imu_offset;
-	to->txer_offset += from->txer_offset;
-	to->wl_offset += from->wl_offset;
-	to->other += from->other;
-	for (i = 0; i < SWPLS_MAX_TXERS; i++)
-		{
-		to->pings_per_txer[i] += from->pings_per_txer[i];
-		}
-	to->ping_sel_off += from->ping_sel_off;
-	to->ping_sel_single += from->ping_sel_single;
-	to->ping_sel_alt += from->ping_sel_alt;
-	to->ping_sel_sim += from->ping_sel_sim;
-
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  function <%s> completed\n", function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		fprintf(stderr, "dbg2       error:      %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2       status:     %d\n", status);
-		}
-
-	return (status);
-}	/* add_counts */
-/*----------------------------------------------------------------------*/
-static int print_counts(int verbose, counts *recs, int *error)
-{
-	char *function_name = "print_nrecs";
-	int status = MB_SUCCESS;
-	int i;
-
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  function <%s> called\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n");
-		fprintf(stderr, "dbg2       verbose:    %d\n", verbose);
-		fprintf(stderr, "dbg2       recs:       %p\n", (void *)recs);
-		}
-
-	fprintf(stdout, "\nFiles Read: %d\n", recs->files_read);
-	fprintf(stdout, "\nData Records Read:\n");
-	fprintf(stdout, "  sxpheader        = %d\n", recs->sxpheader);
-	fprintf(stdout, "  sxiheader        = %d\n", recs->sxiheader);
-	fprintf(stdout, "  sxpping1         = %d\n", recs->sxpping1);
-	fprintf(stdout, "  sxpping2         = %d\n", recs->sxpping2);
-	fprintf(stdout, "  sxiping          = %d\n", recs->sxiping);
-	fprintf(stdout, "  attitude         = %d\n", recs->attitude);
-	fprintf(stdout, "  posll            = %d\n", recs->posll);
-	fprintf(stdout, "  posen            = %d\n", recs->posen);
-	fprintf(stdout, "  ssv              = %d\n", recs->ssv);
-	fprintf(stdout, "  echosounder      = %d\n", recs->echosounder);
-	fprintf(stdout, "  tide             = %d\n", recs->tide);
-	fprintf(stdout, "  agds             = %d\n", recs->agds);
-	fprintf(stdout, "  comment          = %d\n", recs->comment);
-	fprintf(stdout, "  pos_offset       = %d\n", recs->pos_offset);
-	fprintf(stdout, "  imu_offset       = %d\n", recs->imu_offset);
-	fprintf(stdout, "  txer_offset      = %d\n", recs->txer_offset);
-	fprintf(stdout, "  wl_offset        = %d\n", recs->wl_offset);
-	fprintf(stdout, "  other            = %d\n", recs->other);
-	fprintf(stdout, "\nTransducers Observed:\n");
-	for (i = 0; i < SWPLS_MAX_TXERS; i++)
-		{
-		fprintf(stdout, "  Channel %d        = %d\n", i + 1,
-			recs->pings_per_txer[i]);
-		}
-	fprintf(stdout, "\nPing Modes Observed:\n");
-	fprintf(stdout, "  Sonar Off        = %d\n", recs->ping_sel_off);
-	fprintf(stdout, "  Single-Sided:    = %d\n", recs->ping_sel_single);
-	fprintf(stdout, "  Alternate Sides: = %d\n", recs->ping_sel_alt);
-	fprintf(stdout, "  Simultaneous:    = %d\n", recs->ping_sel_sim);
-
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  function <%s> completed\n", function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		fprintf(stderr, "dbg2       error:      %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2       status:     %d\n", status);
-		}
-
-	return (status);
-}	/* print_counts */
-/*----------------------------------------------------------------------*/
-static int print_latest_record(int verbose,
-	struct mbsys_swathplus_struct *store, int *error)
-{
-	char *function_name = "print_latest_record";
-	int status = MB_SUCCESS;
-	FILE *stream;
-
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  function <%s> called\n", function_name);
-		fprintf(stderr, "dbg2  Revision id: %s\n", rcs_id);
-		fprintf(stderr, "dbg2  Input arguments:\n");
-		fprintf(stderr, "dbg2       verbose:    %d\n", verbose);
-		fprintf(stderr, "dbg2       store:      %p\n", (void *)store);
-		}
-
-	stream = (verbose > 0) ? stderr : stdout;
-
-	if (store->type == SWPLS_ID_SXP_HEADER_DATA)
-		{
-		swpls_pr_sxpheader(verbose, stream, &(store->sxp_header), error);
-		}
-	else if (store->type == SWPLS_ID_PROJECTION)
-		{
-		swpls_pr_projection(verbose, stream, &(store->projection), error);
-		}
-	else if (store->type == SWPLS_ID_PROCESSED_PING)
-		{
-		swpls_pr_sxpping(verbose, stream, &(store->sxp_ping), error);
-		}
-	else if (store->type == SWPLS_ID_PROCESSED_PING2)
-		{
-		swpls_pr_sxpping(verbose, stream, &(store->sxp_ping), error);
-		}
-	else if (store->type == SWPLS_ID_SXI_HEADER_DATA)
-		{
-		swpls_pr_sxiheader(verbose, stream, &(store->sxi_header), error);
-		}
-	else if (store->type == SWPLS_ID_PARSED_PING)
-		{
-		swpls_pr_sxiping(verbose, stream, &(store->sxi_ping), error);
-		}
-	else if (store->type == SWPLS_ID_PARSED_ATTITUDE)
-		{
-		swpls_pr_attitude(verbose, stream, &(store->attitude), error);
-		}
-	else if (store->type == SWPLS_ID_PARSED_POSITION_LL)
-		{
-		swpls_pr_posll(verbose, stream, &(store->posll), error);
-		}
-	else if (store->type == SWPLS_ID_PARSED_POSITION_EN)
-		{
-		swpls_pr_posen(verbose, stream, &(store->posen), error);
-		}
-	else if (store->type == SWPLS_ID_PARSED_SSV)
-		{
-		swpls_pr_ssv(verbose, stream, &(store->ssv), error);
-		}
-	else if (store->type == SWPLS_ID_PARSED_ECHOSOUNDER)
-		{
-		swpls_pr_echosounder(verbose, stream, &(store->echosounder), error);
-		}
-	else if (store->type == SWPLS_ID_PARSED_TIDE)
-		{
-		swpls_pr_tide(verbose, stream, &(store->tide), error);
-		}
-	else if (store->type == SWPLS_ID_PARSED_AGDS)
-		{
-		swpls_pr_agds(verbose, stream, &(store->agds), error);
-		}
-	else if (store->type == SWPLS_ID_COMMENT)
-		{
-		swpls_pr_comment(verbose, stream, &(store->comment), error);
-		}
-	else if (store->type == SWPLS_ID_POS_OFFSET)
-		{
-		swpls_pr_pos_offset(verbose, stream, &(store->pos_offset), error);
-		}
-	else if (store->type == SWPLS_ID_IMU_OFFSET)
-		{
-		swpls_pr_imu_offset(verbose, stream, &(store->imu_offset), error);
-		}
-	else if (store->type == SWPLS_ID_TXER_OFFSET)
-		{
-		swpls_pr_txer_offset(verbose, stream, &(store->txer_offset), error);
-		}
-	else if (store->type == SWPLS_ID_WL_OFFSET)
-		{
-		swpls_pr_wl_offset(verbose, stream, &(store->wl_offset), error);
-		}
-	else
-		{
-		fprintf(stream, "UNKNOWN RECORD [ID: 0x%o]\n", store->type);
-		}
-
-	if (verbose >= 2)
-		{
-		fprintf(stderr, "\ndbg2  function <%s> completed\n", function_name);
-		fprintf(stderr, "dbg2  Return values:\n");
-		fprintf(stderr, "dbg2       error:      %d\n", *error);
-		fprintf(stderr, "dbg2  Return status:\n");
-		fprintf(stderr, "dbg2       status:     %d\n", status);
-		}
-
-	return (status);
-}	/* print_latest_record */
-
diff --git a/src/utilities/mbtime.c b/src/utilities/mbtime.c
deleted file mode 100644
index fa90c5f..0000000
--- a/src/utilities/mbtime.c
+++ /dev/null
@@ -1,183 +0,0 @@
-/*--------------------------------------------------------------------
- *    The MB-system:	mbtime.c	6/5/2008
- *    $Id: mbtime.c 2227 2015-02-05 21:12:31Z caress $
- *
- *    Copyright (c) 2008-2015 by
- *    David W. Caress (caress at mbari.org)
- *      Monterey Bay Aquarium Research Institute
- *      Moss Landing, CA 95039
- *    and Dale N. Chayes (dale at ldeo.columbia.edu)
- *      Lamont-Doherty Earth Observatory
- *      Palisades, NY 10964
- *
- *    See README file for copying and redistribution conditions.
- *--------------------------------------------------------------------*/
-/*
- * MBTIME converts time values between epoch seconds (seconds since
- * 1970/01/01 00:00:00.000000) and calendar time (e.g. 2008/006/05/17/24/32/0).
- * The input time is set using the command line arguments -Mtime_d for
- * epoch seconds and -Tyear/month/day/hour/minute/second/microsecond for
- * calendar time. The output time (in the form not specified as input) is
- * written to stdout.
- *
- * Author:	D. W. Caress
- * Date:	June 5, 2008
- *
- * $Log: mbtime.c,v $
- * Revision 5.0  2008/07/19 07:52:03  caress
- * Added program mbtime.
- *
- *
- */
-
-/* standard include files */
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <math.h>
-#include <string.h>
-
-/* MBIO include files */
-#include "mb_status.h"
-#include "mb_define.h"
-
-#define MBTIME_INPUT_EPOCH	0
-#define MBTIME_INPUT_CALENDAR	1
-
-static char rcs_id[] = "$Id: mbtime.c 2227 2015-02-05 21:12:31Z caress $";
-
-/*--------------------------------------------------------------------*/
-
-int main (int argc, char **argv)
-{
-	char program_name[] = "MBTIME";
-	char help_message[] =  "MBTIME converts time values between epoch seconds (seconds since \n1970/01/01 00:00:00.000000) and calendar time (e.g. 2008/006/05/17/24/32/0). \nThe input time is set using the command line arguments -Mtime_d for \nepoch seconds and -Tyear/month/day/hour/minute/second/microsecond for \ncalendar time. The output time (in the form not specified as input) is \nwritten to stdout.";
-	char usage_message[] = "mbtime [-Mtime_d -Tyear/month/day/hour/minute/second -V -H]";
-	extern char *optarg;
-	int	errflg = 0;
-	int	c;
-	int	help = 0;
-	int	flag = 0;
-
-	/* MBIO status variables */
-	int	status = MB_SUCCESS;
-	int	verbose = 0;
-	int	error = MB_ERROR_NO_ERROR;
-
-	/* time conversion variables */
-	int	mode = MBTIME_INPUT_EPOCH;
-	int	time_i[7];
-	double	time_d = 0.0;
-	double	seconds;
-
-	/* process argument list */
-	while ((c = getopt(argc, argv, "VvHhM:m:T:t:")) != -1)
-	  switch (c)
-		{
-		case 'H':
-		case 'h':
-			help++;
-			break;
-		case 'M':
-		case 'm':
-			sscanf (optarg,"%lf", &time_d);
-			mode = MBTIME_INPUT_EPOCH;
-			flag++;
-			break;
-		case 'T':
-		case 't':
-			sscanf (optarg,"%d/%d/%d/%d/%d/%lf",
-				&time_i[0],&time_i[1],&time_i[2],
-				&time_i[3],&time_i[4],&seconds);
-			time_i[5] = (int)seconds;
-			time_i[6] = (int)(1000000 * (seconds - time_i[5]));
-			mode = MBTIME_INPUT_CALENDAR;
-			flag++;
-			break;
-		case 'V':
-		case 'v':
-			verbose++;
-			break;
-		case '?':
-			errflg++;
-		}
-
-
-	/* if error flagged then print it and exit */
-	if (errflg)
-		{
-		fprintf(stderr,"usage: %s\n", usage_message);
-		fprintf(stderr,"\nProgram <%s> Terminated\n",
-			program_name);
-		error = MB_ERROR_BAD_USAGE;
-		exit(error);
-		}
-
-	/* print starting message */
-	if (verbose == 1 || help)
-		{
-		fprintf(stdout,"\nProgram %s\n",program_name);
-		fprintf(stdout,"Version %s\n",rcs_id);
-		fprintf(stdout,"MB-system Version %s\n",MB_VERSION);
-		}
-
-	/* print starting debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  Program <%s>\n",program_name);
-		fprintf(stderr,"dbg2  Version %s\n",rcs_id);
-		fprintf(stderr,"dbg2  MB-system Version %s\n",MB_VERSION);
-		fprintf(stderr,"dbg2  Control Parameters:\n");
-		fprintf(stderr,"dbg2       verbose:    %d\n",verbose);
-		fprintf(stderr,"dbg2       help:       %d\n",help);
-		fprintf(stderr,"dbg2       mode:       %d\n",mode);
-		fprintf(stderr,"dbg2       time_i[0]:  %d\n",time_i[0]);
-		fprintf(stderr,"dbg2       time_i[1]:  %d\n",time_i[1]);
-		fprintf(stderr,"dbg2       time_i[2]:  %d\n",time_i[2]);
-		fprintf(stderr,"dbg2       time_i[3]:  %d\n",time_i[3]);
-		fprintf(stderr,"dbg2       time_i[4]:  %d\n",time_i[4]);
-		fprintf(stderr,"dbg2       time_i[5]:  %d\n",time_i[5]);
-		fprintf(stderr,"dbg2       time_i[6]:  %d\n",time_i[6]);
-		fprintf(stderr,"dbg2       time_d:     %f\n",time_d);
-		}
-
-	/* if help desired then print it and exit */
-	if (help)
-		{
-		fprintf(stderr,"\n%s\n",help_message);
-		fprintf(stderr,"\nusage: %s\n", usage_message);
-		exit(error);
-		}
-
-	/* convert to calendar time and output */
-	if (mode == MBTIME_INPUT_EPOCH)
-		{
-		mb_get_date(verbose, time_d, time_i);
-		fprintf(stdout, "%4.4d/%2.2d/%2.2d/%2.2d/%2.2d/%2.2d.%6.6d\n",
-			time_i[0], time_i[1], time_i[2],
-			time_i[3], time_i[4], time_i[5], time_i[6]);
-		}
-
-	/* else convert to epoch time and output */
-	else
-		{
-		mb_get_time(verbose, time_i, &time_d);
-		fprintf(stdout, "%f\n", time_d);
-		}
-
-	/* set program status */
-	status = MB_SUCCESS;
-
-	/* print output debug statements */
-	if (verbose >= 2)
-		{
-		fprintf(stderr,"\ndbg2  Program <%s> completed\n",
-			program_name);
-		fprintf(stderr,"dbg2  Ending status:\n");
-		fprintf(stderr,"dbg2       status:  %d\n",status);
-		}
-
-	/* end it all */
-	exit(error);
-}
-/*--------------------------------------------------------------------*/

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/mbsystem.git



More information about the debian-science-commits mailing list